Windows-Universal-Examples: Class List

  • Main Page
  • Namespaces
  • Classes
  • Files
  • Directories
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
_360VideoPlaybackMain | Updates, renders, and presents holographic content using Direct3D
App | Provides application-specific behavior to supplement the default Application class
AppView | The IFrameworkView connects the app with Windows and handles application lifecycle events
AppViewSource |
CameraResources |
DeviceResources | Controls all the DirectX device resources
Disposer |
InteropStatics::IDirect3DDxgiInterfaceAccess |
SpatialInputHandler |
StepTimer | Helper class for animation and simulation timing
ViewProjectionConstantBuffer | Constant buffer used to send hologram position transform to the shader pipeline
ModelConstantBuffer | Constant buffer used to send hologram position transform to the shader pipeline
VertexPositionColor | Used to send per-vertex data to the vertex shader
VertexPositionTexture |
VideoRenderer | This sample renderer instantiates a basic rendering pipeline
FocusPointConstantBuffer |
Helpers |
MainPage | An empty page that can be used on its own or navigated to within a Frame
MediaTransportControls |
ModelConstantBuffer |
PlaybackPage | An empty page that can be used on its own or navigated to within a Frame
Program | Windows Holographic application using SharpDX
sealed | Provides application-specific behavior to supplement the default Application class
SpatialInputHandler |
VertexPositionTexture |
VideoGallery | An empty page that can be used on its own or navigated to within a Frame
VideoGallery::VideoItemInfo |
VideoItem |
VideoRenderer |
_RPC_CLIENT |
WrlFinal |
DefaultAccountScenario | This scenario covers getting the default account
IdentityChecker |
MultipleAccountsScenario |
SingleAccountScenario |
SingleAzureADScenario |
SingleMicrosoftAccountScenario |
App | Provides application-specific behavior to supplement the default Application class
DateTimeOffsetConverter | Convert a DateTime to a DateTimeOffset for use by a DatePicker, and back to allow for two-day data-binding
INavigationService | Navigation service interface, allows a test implementation to be substituted in its place
LoadStateEventArgs | Class used to hold the event data required when a page attempts to load state
NavigationHelper | NavigationHelper aids in navigation between pages
NavigationService | Navigation system that decouples the View Model from knowledge of the View for navigation purposes
RelayCommand | A command whose sole purpose is to relay its functionality to other objects by invoking delegates
RootFrameNavigationHelper | RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward
SaveStateEventArgs | Class used to hold the event data required when a page attempts to save state
SuspensionManager | SuspensionManager captures global session state to simplify process lifetime management for an application
SuspensionManagerException |
VisibilityConverter | Convert a Boolean status to Visibility.Visible (true) or Visibility.Collapsed (false)
Trip | Trip model
TripStore | Persistance layer for Trips created with Adventure Works
sealed | Provides application-specific behavior to supplement the default Application class
TripDetails | Code Behind for a list of trips, including a Save and Delete button
TripListView | Code Behind for a list of trips, including an Add button
TripListViewModel | View Model controlling the behavior of a List view of trips
TripViewModel | View Model associated with TripDetails.xaml
TripVoiceCommand | Simple struct to pass voice-command arguments to the appropriate view, in order to execute the action requested by the user
ViewModelBase | Base class for all view models
ViewModelLocator | ViewModelLocator ensures that viewmodels can be instantiated with a common reference to the TripStore
ViewModelBase |
AdventureWorksVoiceCommandService | The VoiceCommandService implements the entrypoint for all headless voice commands invoked via Cortana
sealed |
AllJoynBusObjectManager |
AuthTypeToStringConverter |
RelayCommand | Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates
Scenario1 |
Scenario1ViewModel |
Scenario2 |
Scenario2ViewModel |
AllJoynHelpers |
AppData |
OnboardingService |
RelayCommand | Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates
Scenario1 |
Scenario1ViewModel |
Scenario2 |
Scenario2ViewModel |
SecureInterfaceService | The implementation of ISecureInterfaceService that will handle the concatenation method calls
Animate |
AnimateCirclePosition |
AnimateLineListPosition |
AnimateLinePosition |
handle_closer |
CSendOperationStatus |
SetConnectedFunc |
ShutdownFunc |
StartFunc |
StopFunc |
AttributeValidationDescriptor |
MediaTypeValidationDescriptor |
App |
AsyncCallback< T > |
Audio |
IMemoryBufferByteAccess |
Scenario1_FilePlayback | Using the AudioGraph API to playback from a file input
Scenario2_DeviceCapture | This scenario shows using AudioGraph for audio capture from a microphone with low latency
Scenario3_FrameInput | Scenario 3: Using a frame input node to play audio
Scenario4_Submix | Shows use of a SubMix node with an effect applied to it
Scenario5_InboxEffects | This scenario is to demonstrate the use of Built-In Effects
Scenario6_CustomEffects | Using custom effects with the AudioGraph API
AudioFileReader |
AudioStreamReader |
AutoLock |
sealed |
BackgroundDeviceWatcher |
MediaItem |
MediaList |
MusicItem |
VideoItem |
PlaylistView | A custom control for playlists that wraps a ListView
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
PlaybackService | The central authority on playback in the application providing access to the player and active playlist
SettingsService |
Settings | An empty page that can be used on its own or navigated to within a Frame
MediaItemViewModel | View model for media items
MediaListViewModel | View model for a list of media items
PlaybackSessionViewModel |
PlaybackStateToButtonIconConverter |
PlayerViewModel | The view model for the player
SettingsViewModel |
BackgroundTaskInformation |
ConnectTask |
GeofenceBackgroundTask |
IoSyncBackgroundTask |
LocalSettingKeys |
LocationBackgroundTask |
Scenario1_BackgroundTask |
sealed |
Sync |
UpdateMetadataTask |
VisitBackgroundTask |
AdvertisementPublisherTask |
AdvertisementWatcherTask |
BadgeNotificationHistoryChangedTriggerTask |
BadgeNumericNotificationContent | Notification content object to display a number on a tile's badge
RfcommServerTask |
ToastActivationTypeBackgroundClosedTask |
ToastNotificationHistoryChangedTriggerTask |
ToastNotificationQuickReplyTask |
BarcodeDecodeTask |
DecodeEngine |
DecodeResult |
Provider |
sealed |
AppView | The IFrameworkView connects the app with Windows and handles application lifecycle events
AppViewSource |
BasicHologramMain |
BasicHologramMain::GamepadWithButtonState |
CameraResources |
DeviceResources | Controls all the DirectX device resources
Disposer |
InteropStatics::IDirect3DDxgiInterfaceAccess |
SpatialInputHandler |
StepTimer | Helper class for animation and simulation timing
ViewProjectionConstantBuffer | Constant buffer used to send hologram position transform to the shader pipeline
ModelConstantBuffer | Constant buffer used to send hologram position transform to the shader pipeline
SpinningCubeRenderer | This sample renderer instantiates a basic rendering pipeline
VertexPositionColor | Used to send per-vertex data to the vertex shader
HolographicTemplateAppMain | Updates, renders, and presents holographic content using Direct3D
HolographicTemplateAppMain::GamepadWithButtonState |
ModelConstantBuffer |
Program | Windows Holographic application using SharpDX
sealed |
SpatialInputHandler |
SpinningCubeRenderer |
VertexPositionColor |
BasicLoader |
Scenario1 |
Scenario2 |
Scenario3 |
BasicReaderWriter |
BasicShapes |
BasicTimer |
BasicVertex |
ColorToStringConverter |
VeryObservableCollection-g< T > |
Scenario1_Watcher | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Publisher | An empty page that can be used on its own or navigated to within a Frame
Scenario3_BackgroundWatcher | An empty page that can be used on its own or navigated to within a Frame
Scenario4_BackgroundPublisher | An empty page that can be used on its own or navigated to within a Frame
Camera |
AdvancedCaptureContext | Helper class to contain the information that describes an advanced capture
App | Provides application-specific behavior to supplement the default Application class
MainPage |
MainPage::AdvancedCaptureContext | Helper class to contain the information that describes an Advanced Capture
sealed | Provides application-specific behavior to supplement the default Application class
App | Provides application-specific behavior to supplement the default Application class
IMemoryBufferByteAccess |
MainPage |
sealed | Provides application-specific behavior to supplement the default Application class
App | Provides application-specific behavior to supplement the default Application class
InvertBoolConverter |
MainPage |
RoundingConverter |
Scenario1_SetRecordProfile | SetRecordProfile page that can be used on its own or navigated to within a Frame
Scenario2_ConcurrentProfile | ConcurrenProfile page that can be used on its own or navigated to within a Frame
Scenario3_EnableHdrProfile | EnableHDRProfile page that can be used on its own or navigated to within a Frame
App | Provides application-specific behavior to supplement the default Application class
CameraRotationHelper |
MainPage |
sealed | Provides application-specific behavior to supplement the default Application class
CameraCoordinateMapper |
CameraStreamCoordinateMapperMain |
CameraStreamProcessor |
CameraStreamProcessor::FrameData |
GpuCoordinateMapper |
GpuCoordinateMapper::CameraIntrinsics |
GpuCoordinateMapper::RasterizedFrameBlob |
GpuCoordinateMapper::VisualizeFrameBlob |
QuadRenderer |
sealed |
TextRenderer |
VertexPositionTex |
App | Provides application-specific behavior to supplement the default Application class
MainPage |
sealed | Provides application-specific behavior to supplement the default Application class
CardioidSound |
CAsyncState |
CMediaStream::CSourceLock |
ColorBGRA |
ISecureInterfaceConsumer |
ISecureInterfaceLegacySignals |
ISecureInterfaceProducer |
ISecureInterfaceService |
ISecureInterfaceSignals |
ISignalEmitter |
sealed |
ComAutoRelease |
DynamicCommandBar | We extend the CommandBar by adding logic to reflow commands as space is reduced
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario3 | An empty page that can be used on its own or navigated to within a Frame
Scenario4 | An empty page that can be used on its own or navigated to within a Frame
Scenario5 | An empty page that can be used on its own or navigated to within a Frame
Scenario6 | An empty page that can be used on its own or navigated to within a Frame
Scenario7 | An empty page that can be used on its own or navigated to within a Frame
Scenario8 | An empty page that can be used on its own or navigated to within a Frame
VisualProperties |
VisualPropertiesFactory |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
ComPtrList< T, NULLABLE > |
ConstantBufferChangeOnResize |
ConstantBufferChangesEveryFrame |
ConstantBufferChangesEveryPrim |
ConstantBufferNeverChanges |
Scenario1_Message |
Scenario2_MessageCaption |
Scenario3_CredentialPickerOptions |
CritSec |
CSampleService |
CServiceBase |
CustomComputeShaderMain |
CustomComputeShaderRenderer |
SampleOverlay |
sealed |
CustomDecaySound |
AudioEchoEffect |
IMemoryBufferByteAccess |
DeviceConnect | Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events
DeviceListEntry | The class will only expose properties from DeviceInformation that are going to be used in this sample
DeviceProperties |
EventHandlerForDevice | The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event is raised (app suspension and resume) or when the device is disconnected
FeatureReports | This page demonstrates how to use FeatureReports to communicate with the device
InputOutputReports | This scenario demonstrates how to get input reports and how to send output reports
InputReportEvents | This scenario demonstrates to how register and utilize input reports
OnDeviceConnectedEventArgs |
SuperMutt | This is the report descriptor for the support SuperMutt device
SuperMutt::Device |
SuperMutt::DeviceInputReportControlInformation | Only available for output reports
SuperMutt::LedPattern | Only available for Feature Reports
SuperMutt::ReadWriteBufferControlInformation | Only available for Input/Output Reports
Utilities |
App | Provides application-specific behavior to supplement the default Application class
CustomMediaTransportControls |
MainPage | An empty page that can be used on its own or navigated to within a Frame
CustomPixelShaderMain |
CustomPixelShaderRenderer |
SampleOverlay |
sealed |
Scenario1_DataEvents |
Scenario2_Polling |
DeviceConfiguration |
DeviceListEntry | The class will only expose properties from DeviceInformation that are going to be used in this sample
DeviceProperties |
EventHandlerForDevice | The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected
Scenario1_ConnectDisconnect | Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events
Scenario2_ConfigureDevice | An empty page that can be used on its own or navigated to within a Frame
Scenario3_ReadWrite | An empty page that can be used on its own or navigated to within a Frame
Scenario4_Events | An empty page that can be used on its own or navigated to within a Frame
Utilities | This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages
DescriptorTypeEntry | DescriptorTypeEntry is used so that the UI can bind to the list of these entries and display them
DeviceListEntry | The class will only expose properties from DeviceInformation that are going to be used in this sample
DeviceProperties |
EventHandlerForDevice | The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected
LocalSettingKeys |
OnDeviceConnectedEventArgs |
OsrFx2 |
OsrFx2::Pipe |
Scenario1_ConnectDisconnect | Demonstrates how to connect to a USB Device and respond to device disconnects, app suspending and resuming events
Scenario2_ControlTransfer | This page demonstrates how to use control transfers to communicate with the device
Scenario3_InterruptPipes | This page demonstrates how to use interrupts pipes on a UsbDevice
Scenario4_BulkPipes | This page demonstrates how to propertly use bulk pipes to read and write to the device
Scenario5_UsbDescriptors | This scenario demonstrates how get various descriptors from UsbDevice
Scenario6_InterfaceSettings | Scenario will demonstrate how to change interface settings (also known as alternate interface setting)
Scenario7_SyncDevice | An empty page that can be used on its own or navigated to within a Frame
SuperMutt |
SuperMutt::Pipe |
SuperMutt::VendorCommand |
SyncBackgroundTaskInformation |
Utilities |
CustomVertexShaderMain |
CustomVertexShaderRenderer |
SampleOverlay |
sealed |
Cylinder |
CylinderMesh |
D2DAdvancedColorImagesRenderer |
ImageInfo |
sealed | Provides application-specific behavior to supplement the default Application class
D2DGradientMeshMain |
D2DGradientMeshRenderer |
SampleOverlay |
sealed |
PhotoAdjustmentProperties |
PhotoAdjustmentRenderer |
sealed | Provides application-specific behavior to supplement the default Application class
GeneratorIncrementalLoadingClass-g< T > |
IncrementalLoadingBase |
LocalHostItem | Helper class describing a NetworkAdapter and its associated IP address
RemotePeer | Helper class used to identify and respond to a remote peer
Scenario1 | A page for first scenario
Scenario2 | A page for second scenario
Scenario3 | A page for third scenario
Scenario4 | A page for fourth scenario
Scenario5 | A page for fifth scenario
CacheChangedEventArgs-g< T > |
FileDataSource | A custom datasource over the file system that supports data virtualization
FileDataSource2 | A custom datasource over the file system that supports data virtualization
FileItem | Represents a file and its properties
ItemCacheManager< T > |
ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE > |
ItemIndexRangeList | Represents a sorted collection of discontiguous ItemIndexRanges
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 |
DDS_HEADER |
DDS_HEADER_DXT10 |
DDS_PIXELFORMAT |
AccessHandler | Access handler class for Desfire based ICC
CardDetails | Class hodls Desfire card details information
DesfireCommand | Class DesfireCommand extends the Iso7816.ApduCommand and provides mappings to Iso7816 command fields
DesfireResponse | Class DesfireResponse extends the Iso7816.ApduResponse
DftEffect |
DftTransform |
DirectXApplicationSource |
sealed |
Scenario1_ListView | An empty page that can be used on its own or navigated to within a Frame
Scenario2_DragUICustomization | An empty page that can be used on its own or navigated to within a Frame
Scenario3_StartDragAsync | An empty page that can be used on its own or navigated to within a Frame
CustomTextRenderer |
DWriteColorTextRendererMain |
DWriteColorTextRendererRenderer |
SampleOverlay |
sealed |
FontNameCollector |
Listener |
sealed |
sealed |
BaseControl |
BaseElement |
Button |
CameraResources |
DeviceResources |
ElementMargin |
Ellipse |
ExitButton |
FilledEllipse |
FilledRectangle |
FocusableElement |
GpuPerformanceTimer |
Line |
MeshGeometry |
PlayPauseButton |
Rectangle |
Resource |
SeekBarElement |
StepTimer |
Text |
TextureData |
ViewProjectionConstantBuffer |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario10_CpToClipboard |
Scenario11_CPDNoUI |
Scenario12_ShareData |
Scenario13_ShareTarget |
Scenario14_QueryCpPaste | An empty page that can be used on its own or navigated to within a Frame
Scenario15_DPLCreateFileEvents | Registering a background task and notification channel for raw notifications
Scenario16_NetworkResource | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario3 | An empty page that can be used on its own or navigated to within a Frame
Scenario4 | An empty page that can be used on its own or navigated to within a Frame
Scenario5 |
Scenario6 |
Scenario7 | An empty page that can be used on its own or navigated to within a Frame
Scenario8_ClipboardSource |
Scenario9_ClipboardTarget |
unique_bag |
unique_services |
Face |
App | Provides application-specific behavior to supplement the default Application class
MainPage |
sealed | Provides application-specific behavior to supplement the default Application class
FaceMesh |
AccessHandler | Access handler class for Felica based ICC
ApduResponse | Felica response APDU
Check | Felica Check command when sent to the card the card is expected to read the byte of blocks specified in the block list
GetHistoricalBytes | Felica GetHistoricalBytes command
GetUid | Felica GetUid command
Update | Felica Update command when sent to the card the card is expected to write the byte of blocks specified in the block list
CachedFileUpdater_Local | An empty page that can be used on its own or navigated to within a Frame
CachedFileUpdater_Remote | An empty page that can be used on its own or navigated to within a Frame
FileOpenPicker_PickAppFile | An empty page that can be used on its own or navigated to within a Frame
FileOpenPicker_PickCachedFile | An empty page that can be used on its own or navigated to within a Frame
FileOpenPicker_PickURLFile | An empty page that can be used on its own or navigated to within a Frame
FileSavePicker_FailToSave | An empty page that can be used on its own or navigated to within a Frame
FileSavePicker_SaveToAppStorage | An empty page that can be used on its own or navigated to within a Frame
FileSavePicker_SaveToCachedFile | An empty page that can be used on its own or navigated to within a Frame
MainPage_CachedFile |
MainPage_PickFile | An empty page that can be used on its own or navigated to within a Frame
MainPage_SaveFile | An empty page that can be used on its own or navigated to within a Frame
UpdateFileTask |
FilmicEffect |
CustomControlUsage | An empty page that can be used on its own or navigated to within a Frame
CustomFocusVisuals | An empty page that can be used on its own or navigated to within a Frame
SocialMediaCounter |
GameConfig |
GameHud |
GameInfoOverlay |
GameMain |
GameObject |
GameRenderer |
GameTimer |
Scenario1_DataEvents |
Scenario2_Polling |
Scenario3_Porting | An empty page that can be used on its own or navigated to within a Frame
HighScoreEntry |
HolographicApp1Main | Updates, renders, and presents holographic content using Direct3D
CubeModelConstantBuffer |
FaceTrackerProcessor |
HolographicFaceTrackerMain |
NV12VideoTexture |
QuadModelConstantBuffer |
QuadRenderer |
sealed |
SpinningCubeRenderer |
TextRenderer |
VertexPositionColor |
VertexPositionTex |
VideoFrameProcessor |
Button |
ControlBase |
Cursor |
HolographicMRCSampleMain |
IControl |
MediaCaptureManager |
ModelColorConstantBuffer |
ModelConstantBuffer |
Panel |
sealed |
SpatialInputHandler |
SpinningCubeRenderer |
VertexPosition |
VertexPositionColor |
VertexPositionTexture |
ClearTool |
HandHandler |
HolographicPaintMain |
IDPadHelper |
ModelConstantBuffer |
RenderingHelper |
sealed |
SourceHandler |
SourceHandler::PositionInformation |
SpatialControllerHandler |
Stroke |
Stroke::Square |
ThumbstickDPadHelper |
Tool |
ToolCarousel |
TouchpadDPadHelper |
VertexPosition |
HolographicSpatialMappingMain |
sealed |
SpatialInputHandler |
HolographicSpatialStageMain |
ModelConstantBuffer |
SceneController |
SceneObject |
sealed |
SpatialStageManager |
VertexPositionColor |
DistanceFieldRenderer |
HolographicTagAlongSampleMain |
ModelConstantBuffer |
QuadRenderer |
sealed |
SpatialInputHandler |
TextRenderer |
VertexPositionColorTex |
HolographicVoiceInputMain |
ModelColorConstantBuffer |
sealed |
SpatialInputHandler |
SpinningCubeRenderer |
VertexPositionColor |
AuthenticationTask |
ConfigStore |
IMFAsyncCallback |
IMFAttributes |
ImportableItemWrapper | Wrapper for the thumbnail and the ImportableItem
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario1_DataEvents |
Scenario2_Polling |
Scenario3_Calibration |
InkEventLogger |
int24in32 |
AccessHandler | Access handler class for Iso15693 based ICC
ApduResponse | Iso15693 response APDU
GetHistoricalBytes | Iso15693 GetHistoricalBytes command
GetUid | Iso15693 GetUid command
Read | Iso15693 read command
Write | Iso15693 write command
ApduCommand | Class ApduCommand implments the ISO 7816 apdu commands
ApduResponse | Class ApduResponse implments handler for the ISO 7816 apdu response
SelectCommand | Class that implements select command
IUIContentRootClone |
Scenario1_GetLamp | Scenario 1 Get Lamp Page
Scenario2_EnableSettings | An empty page that can be used on its own or navigated to within a Frame
Scenario3_AvailabilityChanged | An empty page that can be used on its own or navigated to within a Frame
LARGE_INTEGER |
Level |
Level1 |
Level2 |
Level3 |
Level4 |
Level5 |
Level6 |
Scenario1_DataEvents |
Scenario2_Polling |
LineSegment |
List< T > |
List< T >::Node |
List< T >::POSITION |
ILivePlayer |
LiveDashPlayer |
LiveSourceBufferManager | This class extends a source buffer manager but handles cases for live playback such as setting a live offset and the logic to pick the next segment to play
Manifest | Represents a DASH manifest of type .mpd
MediaSegment | Represents a media segment withing a media stream
MediaSegmentInformation |
MediaStream | Represents a stream of data, such as audio or video
Period | Represents a period within a media presentation description
Player | This class manages the source buffers (audio and video) and takes care of setting the mse stream source on the media element
SourceBufferManager | Handles the source buffer for each stream of data
DashManifestParser |
Downloader |
DASHEntry |
LiveDashPlayer | An empty page that can be used on its own or navigated to within a Frame
LuminanceHeatmapEffect |
Scenario1_BankCards | An empty page that can be used on its own or navigated to within a Frame
Scenario2_AamvaCards | An empty page that can be used on its own or navigated to within a Frame
App | Provides application-specific behavior to supplement the default Application class
Item |
ItemsDataSource |
DetailPage |
MasterDetailPage |
ItemViewModel |
Material |
Matrix4x4< T > |
Scenario1_TrimAndSaveClip |
Scenario2_AppendClips |
Scenario3_AddAudioTracks |
Scenario4_AddOverlays |
MediaReader |
MemDelete |
MeshObject |
METERING_CONTEXT |
PoseTrackingEntityData |
PoseTrackingFrameHeader |
TrackedPose |
FxCompile | Task to support Fxc.exe
CBaseAttributes< TBase > |
CalibrationBar |
CMarker |
CMediaSink |
CMediaSource |
CMediaStream |
CSchemeHandler |
CSetRateOperation |
CSourceOperation |
CStartOperation |
CStreamSink |
CStreamSink::CAsyncOperation |
ISinkCallback |
abstract |
CBufferEnumerator |
CBufferPacket |
CMediaBufferWrapper |
CNetworkChannel |
INetworkClient |
INetworkServer |
sealed |
sealed |
sealed::sealed |
StspDescription |
StspOperationHeader |
StspSampleHeader |
StspStreamDescription |
Bread |
Dimensions |
IAppliance |
IBread |
IBreadBakedEventArgs |
IOven |
IOvenFactory |
Oven |
sealed |
RegisterMessage |
SignatureMessage |
SubjectPublicKeyInfo |
SubjectPublicKeyInfo::SafeBCryptKeyHandle |
SubjectPublicKeyInfo::SafeLocalAllocHandle |
UserAndKeyHintMessage |
AuthenticationController |
HomeController |
DAL |
DAL::RegisteredUser |
FilterConfig |
RouteConfig |
WebApiApplication |
MidiDeviceWatcher | DeviceWatcher class to monitor adding/removing MIDI devices on the fly
Scenario1_MIDIDeviceEnumeration | An empty page that can be used on its own or navigated to within a Frame
Scenario2_ReceiveMIDIMessages | An empty page that can be used on its own or navigated to within a Frame
Scenario3_SendMIDIMessages | An empty page that can be used on its own or navigated to within a Frame
AccessHandler | Access handler class for Mifare Standard/Classic based ICC commands
ApduResponse | Mifare response APDU
DefaultKeys |
GeneralAuthenticate | Mifare Standard GetHistoricalBytes command
GetHistoricalBytes | Mifare Standard GetHistoricalBytes command
GetUid | Mifare Standard GetUid command
LoadKey | Mifare Standard Load Keys commad which stores the supplied key into the specified numbered key slot for subsequent use by the General Authenticate command
Read | Mifare Standard Read commad when sent to the card the card is expected to return 16 bytes
Write | Mifare Standard Write commad when sent to the card, writes 16 bytes at a time
AccessHandler | Access handler class for MifareUL based ICC
ApduResponse | Mifare response APDU
GetHistoricalBytes | Mifare UL GetHistoricalBytes command
GetUid | Mifare UL GetUid command
Read | Mifare UL Read commad when sent to the card the card is expected to return 16 byte of 4 Mifare pages starting at address addr
Write | Mifare UL Write commad when sent to the card, writes 4 bytes (1 Mifare block) at given block address addr
AccountWatcher | An empty page that can be used on its own or navigated to within a Frame
BroadbandDevice | An empty page that can be used on its own or navigated to within a Frame
GetConnectionProfiles | An empty page that can be used on its own or navigated to within a Frame
ModemDeviceServices | An empty page that can be used on its own or navigated to within a Frame
ModemInformation | An empty page that can be used on its own or navigated to within a Frame
ShowConnection | An empty page that can be used on its own or navigated to within a Frame
SimCard | An empty page that can be used on its own or navigated to within a Frame
MockUIContentRoot |
MoveLookController |
sealed |
sealed |
NfcProvHeader | The NfcProvHeader is a prefix to each NFC provisioning message which contains information about the protocol version, message index, total message count, and etc
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
CardReader | An empty page that can be used on its own or navigated to within a Frame
ManageCardScenario | An empty page that can be used on its own or navigated to within a Frame
NfcUtils |
ReceiptView | An empty page that can be used on its own or navigated to within a Frame
SetCardDataScenario |
NoOp< T > |
App | Provides application-specific behavior to supplement the default Application class
InstructionControl |
InstructionsControl |
PopToastControl |
StepsControl |
StepsHelperControl |
UpdateFourTilesControl |
TypeToUIElementConverter |
XmlDocumentToStringConverter |
BackButtonPage |
BindableBase | From http://danrigby.com/2012/04/01/inotifypropertychanged-the-net-4-5-way-revisited/
TilesHelper |
MainPage | An empty page that can be used on its own or navigated to within a Frame
IScenario |
Scenario |
ScenarioGroup |
ScenarioPage | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
OmnidirectionalSound |
App | Provides application-specific behavior to supplement the default Application class
MainPage | An empty page that can be used on its own or navigated to within a Frame
MainPage_OneHanded | An empty page that can be used on its own or navigated to within a Frame
Albums |
Collections |
Settings |
MainViewModel |
Model |
ScenarioElement | An empty page that can be used on its own or navigated to within a Frame
sealed |
OpQueue< T, TOperation > |
IOnboardingConsumer |
IOnboardingLegacySignals |
IOnboardingProducer |
IOnboardingService |
IOnboardingSignals |
ISignalEmitter |
sealed |
ConnectedTask |
ApduResponse | PCSC Apdu response
AtrInfo |
AtrParser | Helper class that parses the ATR and populate the AtrInfo class
IccDetection | Class used to detect the type of the ICC card detected
GeneralAuthenticate | PCSC GeneralAuthenticate command
GetData | PCSC GetData command
GetHistoricalBytes | PCSC GetHistoricalBytes command
GetUid | PCSC GetUid command
IncrementDecrement | PCSC IncrementDecrement command
LoadKeys | PCSC LoadKeys command
ManageSession | PCSC ManageSession command
ManageSessionResponse | PCSC ManageSession response
ReadBinary | PCSC ReadBinary command
SmartCardReaderUtils |
TransparentExchange | PCSC TransparentExchange command
TransparentExchangeResponse | PCSC TransparentExchange response
UpdateBinary | PCSC Updatebinary Command
HistoryRecord | Represents a history record object that gets binded to the ListView controller in the XAML
Scenario1_Events | 'Events' scenario page that gets navigated to when the user selected the 'Events' scenario
Scenario2_History | History Page that gets loaded when 'History' scenario is selected
Scenario3_CurrentStepCount | 'Current step count' illustration page
Scenario4_BackgroundPedometer | An empty page that can be used on its own or navigated to within a Frame
PersistentState |
PipeEvents |
PipeIn |
PipeOut |
SampleDataModel |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario3 |
TabHeader |
PlaybackControl | An empty page that can be used on its own or navigated to within a Frame
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario10 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario3 | An empty page that can be used on its own or navigated to within a Frame
Scenario4 | An empty page that can be used on its own or navigated to within a Frame
Scenario5 | An empty page that can be used on its own or navigated to within a Frame
Scenario6 | An empty page that can be used on its own or navigated to within a Frame
Scenario7 | An empty page that can be used on its own or navigated to within a Frame
Scenario8 | An empty page that can be used on its own or navigated to within a Frame
Scenario9 | An empty page that can be used on its own or navigated to within a Frame
PNTVertex |
Print3D |
ContinuationPage | A paged used to flow text from a given text container Usage: Output scenarios 1-4 might not fit entirely on a given "printer page" In that case simply add new continuation pages of the given size until all the content can be displayed
CustomOptionsPrintHelper |
DisablePreviewPrintHelper | This class customizes the standard PrintHelper in order to disable print preview
InvalidPageException |
PageDescription | Printable page description
PageRangePrintHelper |
PageToPrint | Page content to send to the printer
PhotosPrintHelper |
PreviewUnavailable | Used in scenario 5 to display a custom print preview unavailable page
PrintHelper |
Scenario1Basic | Scenario that demonstrates how to invoke the Print UI
Scenario2StandardOptions | Scenario that demos how to add customizations in the displayed options list
Scenario3CustomOptions | Scenario that demos how to add custom options (specific for the application)
Scenario4PageRange | Scenario that demonstrates a page range implementation
Scenario5Photos | Photo printing scenario
Scenario6DisablePreview | Scenario that demos how to disable the print preview in the Modern Print Dialog window
StandardOptionsPrintHelper |
PropertyGetContext< T > |
PropertySetContext |
Scenario1_DataEvents |
Scenario2_Polling |
Scenario3_DisplayOnOff |
Scenario4_BackgroundProximitySensor |
CustomException |
OvenClient | An empty page that can be used on its own or navigated to within a Frame
RandomNumberGeneratorTask |
RawSMBIOSData |
RawSMBIOSSystemInfo |
RawSMBIOSTable |
ReadStreamTask |
ReadStreamTask::ReadStreamTaskImpl |
ReinhardEffect |
Scenario1_DataEvents |
Scenario2_Polling |
RenderBuffer |
RippleEffect |
Metering |
RecognizedTextRun |
ScenarioContext |
App | Provides application-specific behavior to supplement the default Application class
MediaTransportControlsWithCustomCastButton |
ProjectedMediaTransportControls |
AzureDataProvider |
ItemsDataProvider |
VideoMetaData |
MainPage | An empty page that can be used on its own or navigated to within a Frame
ProjectionViewBroker |
ProjectionViewPage |
Scenario |
Scenario01 |
Scenario02 |
Scenario03 |
Scenario04 |
Scenario05 |
Scenario06 |
UnhandledExceptionPage | An empty page that can be used on its own or navigated to within a Frame
ApiInformation |
CustomDevicePickerFilter |
DialLaunchArguments |
RequiredDeviceProperties |
ViewLifetimeControl |
MainPage |
ProjectionViewPage | An empty page that can be used on its own or navigated to within a Frame
ProjectionViewPageInitializationData |
sealed |
Scenario |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario3 | An empty page that can be used on its own or navigated to within a Frame
sealed | Provides application-specific behavior to supplement the default Application class
sealed |
CAPTUREDEVICEPROPS |
DEVICEPROPS |
MFSampleGenerator |
sealed |
ToneSampleGenerator |
WASAPICapture |
WASAPIRenderer |
Account |
AccountOverviewPage |
AccountsHelper |
AddAuthorizationHeaderFilter |
App | Provides application-specific behavior to supplement the default Application class
AppContactPanel | A page that is hosted within the MyPeople flyout on the taskbar
AppException |
ApplicationTriggerTask | An empty page that can be used on its own or navigated to within a Frame
AudioCapturePermissions |
BackgroundActivity |
BackgroundAuthenticationCompletedEventArgs |
BackgroundTaskSample |
BarcodeScannerInfo | This class is used for data-binding
BindingHelpers |
BitrateHelper |
BitrateItem | Item which provides a nicer display name for "null" bitrate
BluetoothLEDeviceDisplay | Display class used to represent a BluetoothLEDevice in the Device list
BooleanToVisibilityConverter |
CachedFileUpdaterPage | An empty page that can be used on its own or navigated to within a Frame
CachedFileUpdaterPageSizeChangedEventArgs |
CalibrationBar |
CalligraphicPen |
CancelCommand |
CaptureFailedEventArgs |
ChatListView | This ListView is tailored to a Chat experience where the focus is on the last item in the list and as the user scrolls up the older messages are incrementally loaded
Cluster |
LoadStateEventArgs | Class used to hold the event data required when a page attempts to load state
NavigationHelper | NavigationHelper aids in navigation between pages
RootFrameNavigationHelper | RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward
SaveStateEventArgs | Class used to hold the event data required when a page attempts to save state
SuspensionManager | SuspensionManager captures global session state to simplify process lifetime management for an application
SuspensionManagerException |
CompletedCallback |
sealed | An empty page that can be used on its own or navigated to within a Frame
ConnectedDevice |
ConnectionSettingsPanel |
Constants | Class containing Attributes and UUIDs that will populate the SDP record
Contact |
Content |
ContentSelector |
PlayReadyInfo |
Conversation |
CopyFiles |
CopyImage |
CopyText |
CustomCommand |
CustomEditControl |
CustomEffectState |
CustomTextBox | Custom Text box control derived from Textbox class
CustomTitleBar |
CustomTrigger |
D2DSvgImageRenderer |
sealed | An empty page that can be used on its own or navigated to within a Frame
DataHelpers |
DefaultCloseCommand |
DetailsPage |
DeviceConnect | An empty page that can be used on its own or navigated to within a Frame
DeviceEvents |
DeviceHelpers |
DeviceInformationDisplay |
DeviceInformationKindChoice |
DeviceIO |
DeviceList |
DeviceListEntry |
DeviceReadWrite |
DeviceSelectorInfo |
DeviceWatcherHelper | Updates an ObservableCollection based on events from a DeviceWatcher
DiscoveredDevice |
DownloadOperationItem |
EdgeTappedListView |
EnableHelloPage |
Errors |
FileExtensions |
FileLoggingSessionScenario | FileLoggingSessionScenario is a central singleton class which contains the logging-specific sample code
FileOpenPickerPage | An empty page that can be used on its own or navigated to within a Frame
FileSavePickerPage | An empty page that can be used on its own or navigated to within a Frame
FileSavePickerPageSizeChangedEventArgs |
FirmwareAccess |
FrameFormatModel | View model for MediaFrameFormat used in XAML ContentControl
FrameRenderer |
FrameSourceGroupModel | View model for MediaFrameSourceGroup used in XAML ContentControl
FrameSourceInfoModel | View model for MediaFrameSourceInfo used in XAML ContentControl
FrameSourceState |
Fx2Driver |
GeneratedBitmapState |
GeoEquals |
GroupedBackgroundTask | An empty page that can be used on its own or navigated to within a Frame
GroupInfoList |
GuidComparer |
HelperFunctions |
Helpers |
Helpers::BufferConverter |
CommonLicenseRequest |
PlayReadyHelper | Encapsulates all the required calls to setup a MediaProtectionManger within a MediaPlayer for typical PlayReady scenarios
Helpers::sealed |
Helpers::ServiceStatusConverter |
HistoryAndRoaming |
HttpJsonContent |
ImagePage | Page2 is simply a blank page with a button to navigate back to the MainPage
InkRenderer |
InvalidPageException |
IsApiPropertyPresentTrigger |
Item | Items that are in the observable collection (ItemList)
ItemDetails |
ItemList | Observable collection that will contain the list of items
JsonRequest |
KeepConnectionOpenScenario | An empty page that can be used on its own or navigated to within a Frame
LampArrayInfo |
ListViewEdgeTappedEventArgs |
LocationTrackingReason | Page containing the Extended Execution LocationTracking Reason scenario functions
LoggingChannelScenario | Demonstrate usage of LoggingChannel and LoggingActivity
LoggingScenarioEventArgs |
LoggingSessionScenario | LoggingSessionScenario is a central singleton class which contains the logging-specific sample code
LookupTable< T, LookupTableSize > |
LowLatencyInputMain |
MainPage | An empty page that can be used on its own or navigated to within a Frame
MainPageSizeChangedEventArgs |
ManipulationInputProcessor |
MediaCapturePreviewer |
MediaFoundationConstants | Assorted Media Foundation constants from the Windows SDK C headers
MediaModel |
MeteringData | An empty page that can be used on its own or navigated to within a Frame
MEUserControl |
AdaptiveContentModel | A list of manifest URLs, both HLS and DASH; clear, encrypted and PlayReady; VOD and Live
MPEUserControl |
MultipleTasks |
NegatingBoolConverter | A value converter which negates a bool
OcrCapturedImage |
OcrFileImage |
OpenCloseConnectionScenario | An empty page that can be used on its own or navigated to within a Frame
OtherScenarios |
PageDescription | Printable page description
PlaceInfo |
PlaceLocation |
PlugInFilter |
PointOfInterest |
PresentationFormats | Class containing the details of Gatt characteristics presentation formats
PrintHelper |
ProtectionLevelSelectorInfo |
RadioModel |
ReadBytes | An empty page that can be used on its own or navigated to within a Frame
RectRenderer |
RfcommChatDeviceDisplay |
S1_AddWithAPI | An empty page that can be used on its own or navigated to within a Frame
S2_UpdateAndDeleteWithAPI | An empty page that can be used on its own or navigated to within a Frame
S3_RetrieveWithAPI | An empty page that can be used on its own or navigated to within a Frame
S4_CheckIndexRevision | An empty page that can be used on its own or navigated to within a Frame
S5_AddWithAppContent | An empty page that can be used on its own or navigated to within a Frame
S6_DeleteWithAppContent | An empty page that can be used on its own or navigated to within a Frame
S7_RetrieveWithAppContent | An empty page that can be used on its own or navigated to within a Frame
SampleBackgroundTask | An empty page that can be used on its own or navigated to within a Frame
SampleBackgroundTaskWithCondition | An empty page that can be used on its own or navigated to within a Frame
SampleConstants |
SampleDataModel |
SavingDataReason | Page containing the Extended Execution SavingData Reason scenario functions
Scenario | Scenario Class Object
Scenario01_GetText |
Scenario02_GetStream |
Scenario03_GetList |
Scenario04_PostText |
Scenario05_PostStream |
Scenario06_PostMultipart |
Scenario07_PostStreamWithProgress |
Scenario08_PostCustomContent |
Scenario09_GetCookie |
Scenario0_Choose |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario10 | An empty page that can be used on its own or navigated to within a Frame
Scenario10_SetCookie |
Scenario10_UnviewableContent | An empty page that can be used on its own or navigated to within a Frame
Scenario11 | An empty page that can be used on its own or navigated to within a Frame
Scenario11_DeleteCookie | An empty page that can be used on its own or navigated to within a Frame
Scenario12 | An empty page that can be used on its own or navigated to within a Frame
Scenario12_DisableCookies |
Scenario13 | An empty page that can be used on its own or navigated to within a Frame
Scenario13_RetryFilter |
Scenario14_MeteredConnectionFilter |
Scenario15_ServerCertificateValidation |
Scenario1_AddAccount |
Scenario1_Advertiser | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Analyze |
Scenario1_Basic |
Scenario1_BasicFunctionality | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Basics | This page uses methods of the ApiInformation class to detect the presence of types, methods, events, and enumerated values
Scenario1_BasicUserActivity | An empty page that can be used on its own or navigated to within a Frame
Scenario1_ChatClient |
Scenario1_Check |
Scenario1_CheckConsentAvailability |
Scenario1_Colors |
Scenario1_Configuration | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Configure |
Scenario1_ConfigureMobileHotspot |
Scenario1_Create |
Scenario1_CreateContact | An empty page that can be used on its own or navigated to within a Frame
Scenario1_CreateContacts | An empty page that can be used on its own or navigated to within a Frame
Scenario1_CreateTile |
Scenario1_CurrentActivity |
Scenario1_Data |
Scenario1_DataEvents |
Scenario1_Default |
Scenario1_Define |
Scenario1_DetectInPhoto | Page for demonstrating FaceDetection on an image file
Scenario1_DevicePicker | An empty page that can be used on its own or navigated to within a Frame
Scenario1_DeviceUse | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Directions |
Scenario1_Discovery |
Scenario1_DisplayDepthColorIR |
Scenario1_Download | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Enable |
Scenario1_EventAndMenuHookup |
Scenario1_ExampleOperations | Scenario that illustrates using OpenCV along with camera frames
Scenario1_ExtractTextSegments | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Files |
Scenario1_FindClaimEnable |
Scenario1_FindId |
Scenario1_FindUsers |
Scenario1_Geotag |
Scenario1_GetAndSetPin |
Scenario1_GetDeviceInformation |
Scenario1_Initialization | An empty page that can be used on its own or navigated to within a Frame
Scenario1_InkCanvasTactileFeedback |
Scenario1_Input | An empty page that can be used on its own or navigated to within a Frame
Scenario1_LanguageDetection |
Scenario1_Launch | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Launched |
Scenario1_LaunchFile | An empty page that can be used on its own or navigated to within a Frame
Scenario1_LongAndShortFormats |
Scenario1_ManageHotspot |
Scenario1_Metrics |
Scenario1_Mini |
Scenario1_MoveCertificate |
Scenario1_MultiVideoPlayback | Multi-video playback control
Scenario1_NavToUrl |
Scenario1_NetworkConnectivity |
Scenario1_OpenDrawer | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Orientation |
Scenario1_ParseAndStringify |
Scenario1_PercentPermilleFormatting |
Scenario1_PinTile |
Scenario1_Prefs |
Scenario1_PreviewSettings | Scenario 1 Change camera preview settings
Scenario1_Print |
Scenario1_ProvisionTPM |
Scenario1_ReactiveRequest | This Scenario demonstrates simple Reactive license Acquisition
Scenario1_ReadData |
Scenario1_Render |
Scenario1_Save |
Scenario1_SecondaryWindow |
Scenario1_SelectDisplay |
Scenario1_SimpleListView |
Scenario1_SimplestAdaptiveStreaming | See the README.md for discussion of this scenario
Scenario1_Single |
Scenario1_SingleFile | An empty page that can be used on its own or navigated to within a Frame
Scenario1_SpellingTextSuggestions | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Toggle |
Scenario1_TrackInWebcam | Page for demonstrating FaceTracking
Scenario1_TrackPosition |
Scenario1_TrialMode |
Scenario1_UIFonts |
Scenario1_UTF8 | An empty page that can be used on its own or navigated to within a Frame
Scenario1_Welcome |
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Add |
Scenario2_AdvancedUserActivity | An empty page that can be used on its own or navigated to within a Frame
Scenario2_BackgroundTask | This page is used to handle authentication by background task scenario
Scenario2_Binary | An empty page that can be used on its own or navigated to within a Frame
Scenario2_ChangePIN |
Scenario2_ChatServer |
Scenario2_Client |
Scenario2_CloseDrawer | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Conditional | This page shows how to use the ApiInformation class in app code to
Scenario2_Connector | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Custom |
Scenario2_DecimalFormatting |
Scenario2_DelayMini |
Scenario2_DetectInWebcam | Page for demonstrating FaceDetection on a webcam snapshot
Scenario2_DeviceWatcher | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Disable |
Scenario2_Display |
Scenario2_DisplayRegion |
Scenario2_DisplayText |
Scenario2_DocumentFonts | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Effects |
Scenario2_Engage |
Scenario2_EventHandlers | See the README.md for discussion of this scenario
Scenario2_Extend |
Scenario2_FindAvailableSourceGroups |
Scenario2_GetCurrentTextSegmentFromIndex | An empty page that can be used on its own or navigated to within a Frame
Scenario2_GetPosition |
Scenario2_History |
Scenario2_InAppPurchase |
Scenario2_Lang |
Scenario2_Launch |
Scenario2_LaunchUri | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Listen | Scenario describing how to listen for changes to a GPIO pin value
Scenario2_Load |
Scenario2_Manage |
Scenario2_ManageAccount |
Scenario2_Memory |
Scenario2_MultiFile | An empty page that can be used on its own or navigated to within a Frame
Scenario2_Multiple |
Scenario2_MultipleScanners | An empty page that can be used on its own or navigated to within a Frame
Scenario2_NavToString | An empty page that can be used on its own or navigated to within a Frame
Scenario2_NetworkCost |
Scenario2_Notifications |
Scenario2_PhotoSettings | Scenario 2 Change camera preview and photo settings
Scenario2_Polling |
Scenario2_PrintReceipt |
Scenario2_ProactiveRequest |
Scenario2_ReceiveContact | Page to handle the protocol activation
Scenario2_Remove |
Scenario2_RequestConsent |
Scenario2_RequestMany |
Scenario2_ScopedViews | An empty page that can be used on its own or navigated to within a Frame
Scenario2_ScriptDetection |
Scenario2_Settings |
Scenario2_ShakeEvents |
Scenario2_ShowHideEvents | Sample page to subscribe show/hide event of Touch Keyboard
Scenario2_SimpleGridView |
Scenario2_Stats |
Scenario2_StringTemplate |
Scenario2_SupportedTactileFeedback |
Scenario2_SynchronizingPlayers | Multi-video playback syncronization using TimelineControllerPositionOffset
Scenario2_SystemDefaultMenu |
Scenario2_ToggleMobileHotspot |
Scenario2_UnpinTile |
Scenario2_Upload | An empty page that can be used on its own or navigated to within a Frame
Scenario2_WatchUsers |
Scenario3 | An empty page that can be used on its own or navigated to within a Frame
Scenario3_ActiveSymbologies |
Scenario3_AdaptiveCard | An empty page that can be used on its own or navigated to within a Frame
Scenario3_AdaptiveSync | Multi-video live playback synchronization using an AdaptiveMediaSource
Scenario3_Add |
Scenario3_AppCapture |
Scenario3_AspectRatio | Scenario 3 keep aspect ratios the same
Scenario3_BackgroundDeviceWatcher | An empty page that can be used on its own or navigated to within a Frame
Scenario3_BackgroundTask |
Scenario3_BgChatServer | An empty page that can be used on its own or navigated to within a Frame
Scenario3_Calibration |
Scenario3_ChangeEvents |
Scenario3_CheckUserConsentGroup |
Scenario3_ChooseControl | This scenario shows how to choose a user control based on whether a class is present
Scenario3_Choosing |
Scenario3_ClientAuthentication |
Scenario3_CurrencyFormatting |
Scenario3_CustomItems |
Scenario3_Enum |
Scenario3_EnumerateTiles |
Scenario3_FixAccount |
Scenario3_ForegroundApp | The page is used to handle authenticate by foreground app scenario
Scenario3_Full |
Scenario3_HardwareDRM |
Scenario3_InkingFeedback |
Scenario3_InvokeScript |
Scenario3_LaunchAppServices |
Scenario3_Legacy |
Scenario3_MasterDetail |
Scenario3_MultipleClaims |
Scenario3_MultipleDrawers | An empty page that can be used on its own or navigated to within a Frame
Scenario3_NetworkConnectivityChanges |
Scenario3_Notifications | An empty page that can be used on its own or navigated to within a Frame
Scenario3_ParameterizedTemplate |
Scenario3_Polling |
Scenario3_ReceiveFile | An empty page that can be used on its own or navigated to within a Frame
Scenario3_Region |
Scenario3_Replace |
Scenario3_RequestModification | See the README.md for discussion of this scenario
Scenario3_ResetPIN |
Scenario3_SecondaryTiles |
Scenario3_ServerForeground |
Scenario3_SettingContainer | An empty page that can be used on its own or navigated to within a Frame
Scenario3_ShowHideMethods | Sample page to call TryShow/TryHide methods
Scenario3_SingleFolder | An empty page that can be used on its own or navigated to within a Frame
Scenario3_Size |
Scenario3_Transliteration |
Scenario3_Trim |
Scenario3_UnmanagedConsumable |
Scenario3_UsingWindows |
Scenario4 | An empty page that can be used on its own or navigated to within a Frame
Scenario4_BackgroundActivity | An empty page that can be used on its own or navigated to within a Frame
Scenario4_ChangeAdminKey |
Scenario4_ChangeSystemGroup |
Scenario4_CharacterGrouping | An empty page that can be used on its own or navigated to within a Frame
Scenario4_CompactOverlay |
Scenario4_CompletionGroups |
Scenario4_CompositeSettings |
Scenario4_ConsumableProduct | A page for fourth scenario
Scenario4_EdgeTappedListView |
Scenario4_ForegroundGeofence |
Scenario4_Input |
Scenario4_InteractionFeedback |
Scenario4_NumberParsing |
Scenario4_OrientationChanged | An empty page that can be used on its own or navigated to within a Frame
Scenario4_Override |
Scenario4_PartialReadWrite | An empty page that can be used on its own or navigated to within a Frame
Scenario4_ReceiveUri | An empty page that can be used on its own or navigated to within a Frame
Scenario4_Remove |
Scenario4_SaveFile | An empty page that can be used on its own or navigated to within a Frame
Scenario4_ScriptNotify |
Scenario4_SecureStop |
Scenario4_Settings |
Scenario4_ShowView |
Scenario4_Snapshot | An empty page that can be used on its own or navigated to within a Frame
Scenario4_StateTrigger | This page shows how to use a state trigger to manipulate setter properties if the property is available
Scenario4_SymbologyAttributes |
Scenario4_TilePinned |
Scenario4_Tuning | See the README.md for discussion of this scenario
Scenario4_UnicodeExtensions |
Scenario4_UpdatingLineDisplayAttributes |
Scenario5 | An empty page that can be used on its own or navigated to within a Frame
Scenario5_Capabilities | An empty page that can be used on its own or navigated to within a Frame
Scenario5_Clear |
Scenario5_DataEventsBatching |
Scenario5_DefiningCustomGlyphs |
Scenario5_DisplayingBarcodePreview |
Scenario5_GeofenceBackgroundTask |
Scenario5_GetSingleDevice | An empty page that can be used on its own or navigated to within a Frame
Scenario5_InkingAndInteractionFeedback |
Scenario5_IsSupported |
Scenario5_LaunchedFromSecondaryTile |
Scenario5_Metadata |
Scenario5_Msappdata |
Scenario5_NavToFiles |
Scenario5_RandomAccess |
Scenario5_RelativePositioning |
Scenario5_RestoreScrollPosition |
Scenario5_RoundingAndPadding |
Scenario5_Show |
Scenario5_TimeZone |
Scenario5_TriggerCFU |
Scenario5_UnicodeExtensions |
Scenario5_UserCollection |
Scenario5_VerifyResponse |
Scenario6 | An empty page that can be used on its own or navigated to within a Frame
Scenario6_AdInsertion | See the README.md for discussion of this scenario
Scenario6_AppListingURI | A page for sixth scenario
Scenario6_ClearScenario |
Scenario6_CustomFilterAddedProps | An empty page that can be used on its own or navigated to within a Frame
Scenario6_DeleteTPM |
Scenario6_GetLastVisit |
Scenario6_ManipulatingCursorAttributes |
Scenario6_NavToStream | An empty page that can be used on its own or navigated to within a Frame
Scenario6_NavToStream::StreamUriWinRTResolver | Sample URI resolver object for use with NavigateToLocalStreamUri
Scenario6_NumeralSystemTranslation |
Scenario6_RecoverableErrors |
Scenario6_Recurrence |
Scenario6_ScrollIntoView |
Scenario6_SecondaryTileNotification |
Scenario6_TimeZone |
Scenario7 | An empty page that can be used on its own or navigated to within a Frame
Scenario7_B2B | For more details on the business to business APIs, see: https://msdn.microsoft.com/en-us/library/windows/apps/mt609002.aspx
Scenario7_DeviceInformationKind | An empty page that can be used on its own or navigated to within a Frame
Scenario7_DownloadReordering |
Scenario7_ForegroundVisits |
Scenario7_ListAllCards |
Scenario7_LiveSeekableRange | See the README.md for discussion of this scenario
Scenario7_PinFromAppbar |
Scenario7_ScrollingContentUsingMarquee |
Scenario7_SetVersion |
Scenario7_Share | An empty page that can be used on its own or navigated to within a Frame
Scenario7_UsingUnicodeExtensions | An empty page that can be used on its own or navigated to within a Frame
Scenario8 | An empty page that can be used on its own or navigated to within a Frame
Scenario8_CaptureBitmap |
Scenario8_PairDevice | An empty page that can be used on its own or navigated to within a Frame
Scenario8_TransferMediaPlayer1 | This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement
Scenario8_TransmitAPDU |
Scenario8_UpdateAsync |
Scenario8_VisitsBackgroundTask |
Scenario9 | An empty page that can be used on its own or navigated to within a Frame
Scenario9_ContainsFullScreenElement | An empty page that can be used on its own or navigated to within a Frame
Scenario9_CustomPairDevice | An empty page that can be used on its own or navigated to within a Frame
Scenario9_TransferMediaPlayer2 | This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement
Scenario_CloudFontOverview |
Scenario_ContinuousDictation |
Scenario_ContinuousRecognitionListGrammar |
Scenario_ContinuousRecognitionSRGSGrammar |
Scenario_Document1 |
Scenario_Document2 |
Scenario_Document3 |
Scenario_ListConstraint |
Scenario_PauseAsync |
Scenario_PredefinedDictationGrammar |
Scenario_PredefinedWebSearchGrammar |
Scenario_SampleOverview |
Scenario_SRGSConstraint |
Scenario_SynthesizeSSML |
Scenario_SynthesizeText |
Scenario_SynthesizeTextBoundaries |
ScenarioBindingConverter |
ScenarioCommon |
SceneComposer |
SceneComposer::InkObject |
SceneComposer::SceneObject |
SceneComposer::ShapeObject |
School |
SdkSample |
sealed | An empty page that can be used on its own or navigated to within a Frame
sealed::sealed |
sealed::StreamFilteringCriteria |
SecondaryAppWindowPage |
SecondaryPage | An empty page that can be used on its own or navigated to within a Frame
SecondaryViewPage |
ServiceViewModel |
ServicingCompleteTask | An empty page that can be used on its own or navigated to within a Frame
SetErrorMessage |
SetLockScreenImage |
Shape |
ShapeRenderer |
ShareApplicationLink |
ShareCustomData |
ShareCustomProvider |
PlayReadyHelpers |
RelayCommand | A command whose sole purpose is to relay its functionality to other objects by invoking delegates
ShareDelayRenderedFiles |
ShareFiles |
ShareHtml |
ShareImage |
SharePage |
ShareTarget |
ShareText |
ShareWebLink |
ShowPackageFamilyName | An empty page that can be used on its own or navigated to within a Frame
SignIn | The sign in form that contains username and password fields and the option to sign in with either Microsoft Passport or traditional username/password authentication
SimpleLogger | A simple logger to display text to TextBlock asynchronisely
SizePreferenceString |
SlowInputStream |
SmartCardListItem |
SocketReaderWriter |
SourceGroupCollection | View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl
Status |
StreamResolution | Wrapper class around IMediaEncodingProperties to help how devices report supported resolutions
sealed | An empty page that can be used on its own or navigated to within a Frame
StringTrimmer |
SubPage |
SymbologyListEntry | This class is used for data-binding
sealed | An empty page that can be used on its own or navigated to within a Frame
TextMessage |
TimeTriggeredTask | An empty page that can be used on its own or navigated to within a Frame
TrackingEventCue | The custom data that can be created, scheduled then consumed as part of a TimedMetadataTrack which has been added by the app
TransportOptions |
UnspecifiedReason | Page containing the Extended Execution Unspecified Reason scenario functions
User |
UserSelect | The user select page, if users successfully log into the app they will be added to a saved set of users
UserViewModel |
Util |
HardwareDRMViewModel |
PlayReadyInfoViewModel |
ProactiveViewModel |
ReactiveViewModel |
SecureStopViewModel |
ViewModelBase |
AdvertisementWrapper | Wraps WiFiDirectServiceAdvertiser and handles callbacks and related state
DiscoveredDeviceWrapper |
Scenario1 | UI that exposes properties to begin advertising a Wi-Fi Direct Service
Scenario2 | UI exposing an interface to accept/decline incoming connection requests as an advertiser and to interact with connected sessions
Scenario3 | UI that provides a way to discover any Wi-Fi Direct service by name A real application would likely hard-code the service name to a well-known service rather than expose this in the UI
Scenario4 | UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with
Scenario5 | UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services This sample just demonstrates setting up the connection and sending strings A real application would likely open pre-determined ports for application communication
sealed | UI that exposes properties to begin advertising a Wi-Fi Direct Service
SessionRequestWrapper | Helper class to display session requests in list with extra data
SessionWrapper |
SocketWrapper |
StreamSocketListenerWrapper |
WiFiDirectServiceManager | Common class to wrap all of the services objects and state behind the UI
sealed | An empty page that can be used on its own or navigated to within a Frame
WindowInfo |
WordOverlay | Wraps recognized word and provides word overlay position and size based on current scale
WriteReadStream | An empty page that can be used on its own or navigated to within a Frame
sealed |
sealed |
sealed | An empty page that can be used on its own or navigated to within a Frame
SdrOverlayEffect |
sealed | Client side RPC implementation
ViewLifetimeControl |
ArduinoDevice |
DeviceListEntry | The class will only expose properties from DeviceInformation that are going to be used in this sample
DeviceProperties |
EventHandlerForDevice | The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected
Scenario1_ConnectDisconnect | Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events
Scenario2_LEDTemp | An empty page that can be used on its own or navigated to within a Frame
Utilities | This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages
Simple3DGame |
IGameUIControl |
sealed |
IGameUIControl |
sealed | A page that hosts a DirectX SwapChainPanel
CaptureDevice |
LowLatency | An empty page that can be used on its own or navigated to within a Frame
VideoChat | An empty page that can be used on its own or navigated to within a Frame
Scenario1 | Code-behind for Scenario 1, which demonstrates image properties with FileProperties
Scenario2 | Code-behind for Scenario 2, which demonstrates image editing using BitmapDecoder and BitmapEncoder
Scenario1_DataEvents |
Scenario2_Polling |
SampleSmsBackgroundTask |
RegisterWithBackgroundTask | An empty page that can be used on its own or navigated to within a Frame
SendTextMessage | An empty page that can be used on its own or navigated to within a Frame
SocketActivityTask |
Scenario1_Connect |
SoundEffect |
Sphere |
SphereMesh |
ExtendedSplash |
Scenario1 | An empty page that can be used on its own or navigated to within a Frame
Scenario2 | An empty page that can be used on its own or navigated to within a Frame
App | Provides application-specific behavior to supplement the default Application class
ControlSizeTrigger |
DeviceFamilyTrigger |
InputTypeTrigger |
ItemTemplateControl |
MainPage | An empty page that can be used on its own or navigated to within a Frame
MainViewModel |
Model |
STEREO_PARAMETERS |
Scenario1_Send |
LocalHostItem | Helper class describing a NetworkAdapter and its associated IP address
Scenario1 | A page for first scenario
Scenario2 | A page for second scenario
Scenario3 | A page for third scenario
Scenario4 | A page for fourth scenario
Scenario5 | A page for fifth scenario
StringTrimmer |
S1_GetAFeed | An empty page that can be used on its own or navigated to within a Frame
TangentVertex |
TargetTexture |
ActivitySensorBackgroundTask |
CompletionGroupTask |
EdpBackgroundTask |
PedometerBackgroundTask |
ProximitySensorBackgroundTask |
SampleBackgroundTask |
sealed |
ServicingComplete |
Scenario1_Conversion |
Scenario2_Prediction |
Scenario3_ReverseConversion |
TlvEntry |
App | Provides application-specific behavior to supplement the default Application class
ArticlePage | An empty page that can be used on its own or navigated to within a Frame
MainPage | An empty page that can be used on its own or navigated to within a Frame
SectionView |
ArticleViewModel |
HeroArticlesViewModel |
Turn |
TypeConversionHelpers |
RequestResponse | An empty page that can be used on its own or navigated to within a Frame
Vector2< T > |
Vector3< T > |
Vector4< T > |
VideoItemInfo |
VisualPropertiesFactory |
sealed |
WaveEffect |
WaveEffect::Vertex |
Scenario1_Facebook |
Scenario2_Twitter |
Scenario3_Flickr |
WICConvert |
WICTranslate |
Scenario1_CachedNetworks |
Scenario2_Scan |
Scenario3_RegisterForUpdates |
Scenario4_Connect | An empty page that can be used on its own or navigated to within a Frame
WiFiNetworkDisplay |
final |
ModelConstantBuffer |
ModelNormalConstantBuffer |
RealtimeSurfaceMeshRenderer |
SurfaceMeshProperties |
VertexPositionColor |
VertexPositionNormalColor |
ViewProjectionConstantBuffer |
BufferHelper |
sealed |
TrackedPose |
BackgroundDeviceWatcher |
BackgroundDeviceWatcher |
ConnectTask |
GeofenceBackgroundTask |
LocationBackgroundTask |
UpdateMetadataTask |
VisitBackgroundTask |
ConnectTask |
GeofenceBackgroundTask |
LocationBackgroundTask |
UpdateMetadataTask |
VisitBackgroundTask |
HttpMeteredConnectionFilter |
HttpRetryFilter |
HttpMeteredConnectionFilter |
HttpRetryFilter |
Item |
Item |
DetailPage |
MasterDetailPage |
App |
DetailPage |
MasterDetailPage |
ItemsDataSource |
ItemViewModel |
ItemViewModel |
RandomNumberGeneratorTask |
RandomNumberGeneratorTask |
LinguisticServices |
LinguisticServices |
Constants |
DeviceWatcherHelper |
EmbeddedMFAsyncCallback< Callback > |
ensure_close |
Errors |
BarcodeScannerInfo |
BindingHelpers |
ConnectionSettingsPanel |
CopyFiles |
CopyImage |
CopyText |
CustomTextBox |
CustomTitleBar |
DetailsPage |
EdgeTappedListView |
GroupInfoList |
HistoryAndRoaming |
HttpJsonContent |
ImagePage |
KeepConnectionOpenScenario |
OcrCapturedImage |
OcrFileImage |
OpenCloseConnectionScenario |
OtherScenarios |
PlugInFilter |
Scenario01_GetText |
Scenario02_GetStream |
Scenario03_GetList |
Scenario04_PostText |
Scenario05_PostStream |
Scenario06_PostMultipart |
Scenario07_PostStreamWithProgress |
Scenario08_PostCustomContent |
Scenario09_GetCookie |
Scenario1 |
Scenario10 |
Scenario10_SetCookie |
Scenario11 |
Scenario11_DeleteCookie |
Scenario12_DisableCookies |
Scenario13_RetryFilter |
Scenario14_MeteredConnectionFilter |
Scenario15_ServerCertificateValidation |
Scenario1_Advertiser |
Scenario1_Analyze |
Scenario1_Basic |
Scenario1_BasicFunctionality |
Scenario1_Basics |
Scenario1_Check |
Scenario1_CheckConsentAvailability |
Scenario1_Colors |
Scenario1_Configure |
Scenario1_ConfigureMobileHotspot |
Scenario1_Data |
Scenario1_DataEvents |
Scenario1_DetectInPhoto |
Scenario1_DevicePicker |
Scenario1_Discovery |
Scenario1_Enable |
Scenario1_ExtractTextSegments |
Scenario1_Files |
Scenario1_FindId |
Scenario1_FindUsers |
Scenario1_GetAndSetPin |
Scenario1_InkCanvasTactileFeedback |
Scenario1_LanguageDetection |
Scenario1_Launch |
Scenario1_Launched |
Scenario1_LongAndShortFormats |
Scenario1_ManageHotspot |
Scenario1_MoveCertificate |
Scenario1_NetworkConnectivity |
Scenario1_Orientation |
Scenario1_ParseAndStringify |
Scenario1_PercentPermilleFormatting |
Scenario1_PinTile |
Scenario1_Prefs |
Scenario1_Print |
Scenario1_ProvisionTPM |
Scenario1_ReadData |
Scenario1_Render |
Scenario1_Save |
Scenario1_SecondaryWindow |
Scenario1_SimpleListView |
Scenario1_SingleFile |
Scenario1_Toggle |
Scenario1_TrackInWebcam |
Scenario1_TrackPosition |
Scenario1_UIFonts |
Scenario1_UTF8 |
Scenario1_XmlReader |
Scenario2 |
Scenario2_Binary |
Scenario2_ChangePIN |
Scenario2_Client |
Scenario2_Connector |
Scenario2_DecimalFormatting |
Scenario2_DetectInWebcam |
Scenario2_DeviceWatcher |
Scenario2_Disable |
Scenario2_DisplayRegion |
Scenario2_DocumentFonts |
Scenario2_Effects |
Scenario2_Extend |
Scenario2_GetCurrentTextSegmentFromIndex |
Scenario2_GetPosition |
Scenario2_Lang |
Scenario2_Launch |
Scenario2_Listen |
Scenario2_Manage |
Scenario2_Memory |
Scenario2_MultiFile |
Scenario2_MultipleScanners |
Scenario2_NetworkCost |
Scenario2_Notifications |
Scenario2_Polling |
Scenario2_Remove |
Scenario2_RequestConsent |
Scenario2_RequestMany |
Scenario2_ScriptDetection |
Scenario2_Settings |
Scenario2_ShowHideEvents |
Scenario2_SimpleGridView |
Scenario2_Stats |
Scenario2_StringTemplate |
Scenario2_SupportedTactileFeedback |
Scenario2_ToggleMobileHotspot |
Scenario2_UnpinTile |
Scenario2_WatchUsers |
Scenario2_XmlWriter |
Scenario3 |
Scenario3_ActiveSymbologies |
Scenario3_AppCapture |
Scenario3_BackgroundDeviceWatcher |
Scenario3_BackgroundTask |
Scenario3_CheckUserConsentGroup |
Scenario3_Choosing |
Scenario3_ClientAuthentication |
Scenario3_CurrencyFormatting |
Scenario3_CustomItems |
Scenario3_Enum |
Scenario3_EnumerateTiles |
Scenario3_InkingFeedback |
Scenario3_MasterDetail |
Scenario3_NetworkConnectivityChanges |
Scenario3_ParameterizedTemplate |
Scenario3_Region |
Scenario3_ResetPIN |
Scenario3_SecondaryTiles |
Scenario3_ServerForeground |
Scenario3_SettingContainer |
Scenario3_ShowHideMethods |
Scenario3_SingleFolder |
Scenario3_Size |
Scenario3_Transliteration |
Scenario3_XmlWriterLite |
Scenario4 |
Scenario4_ChangeAdminKey |
Scenario4_ChangeSystemGroup |
Scenario4_CharacterGrouping |
Scenario4_CompactOverlay |
Scenario4_CompositeSettings |
Scenario4_EdgeTappedListView |
Scenario4_ForegroundGeofence |
Scenario4_Input |
Scenario4_InteractionFeedback |
Scenario4_NumberParsing |
Scenario4_Override |
Scenario4_PartialReadWrite |
Scenario4_SaveFile |
Scenario4_ShowView |
Scenario4_Snapshot |
Scenario4_SymbologyAttributes |
Scenario4_TilePinned |
Scenario4_UnicodeExtensions |
Scenario5 |
Scenario5_DisplayingBarcodePreview |
Scenario5_GeofenceBackgroundTask |
Scenario5_GetSingleDevice |
Scenario5_InkingAndInteractionFeedback |
Scenario5_IsSupported |
Scenario5_LaunchedFromSecondaryTile |
Scenario5_Msappdata |
Scenario5_RelativePositioning |
Scenario5_RestoreScrollPosition |
Scenario5_RoundingAndPadding |
Scenario5_TimeZone |
Scenario5_TriggerCFU |
Scenario5_UnicodeExtensions |
Scenario5_VerifyResponse |
Scenario6 |
Scenario6_ClearScenario |
Scenario6_CustomFilterAddedProps |
Scenario6_DeleteTPM |
Scenario6_GetLastVisit |
Scenario6_NumeralSystemTranslation |
Scenario6_ScrollIntoView |
Scenario6_SecondaryTileNotification |
Scenario6_TimeZone |
Scenario7 |
Scenario7_DeviceInformationKind |
Scenario7_ForegroundVisits |
Scenario7_ListAllCards |
Scenario7_PinFromAppbar |
Scenario7_SetVersion |
Scenario7_UsingUnicodeExtensions |
Scenario8 |
Scenario8_PairDevice |
Scenario8_TransmitAPDU |
Scenario8_UpdateAsync |
Scenario8_VisitsBackgroundTask |
Scenario9 |
Scenario9_CustomPairDevice |
School |
SecondaryAppWindowPage |
SecondaryViewPage |
ShowPackageFamilyName |
SlowInputStream |
SmartCardListItem |
SymbologyListEntry |
User |
Utils |
ViewLifetimeControl |
FileExtensions |
FileLoggingSessionScenario |
FileLoggingSessionScenario::BusySetter |
Helpers |
BarcodeScannerInfo |
BindingHelpers |
BluetoothLEDeviceDisplay |
ConnectedDevice |
ConnectionSettingsPanel |
Contact |
CopyFiles |
CopyImage |
CopyText |
CustomEffectState |
CustomTextBox |
CustomTitleBar |
DetailsPage |
DeviceInformationDisplay |
DeviceInformationKindChoice |
DeviceInformationKindChoices |
DeviceSelectorChoices |
DeviceSelectorInfo |
DeviceStateChangedEventArgs |
DeviceStateSourceT< D > |
DiscoveredDevice |
EdgeTappedListView |
EdgeTappedListView::ContainerEventTokens |
GeneratedBitmapState |
GroupInfoList |
HistoryAndRoaming |
HttpJsonContent |
ImagePage |
Item |
KeepConnectionOpenScenario |
ListViewEdgeTappedEventArgs |
LoggingScenarioEventArgs |
OcrCapturedImage |
OcrFileImage |
OpenCloseConnectionScenario |
OtherScenarios |
PlotDataReadyEventArgs |
PlotDataSourceT< D > |
PlugInFilter |
ProtectionLevelSelectorInfo |
ProtectionSelectorChoices |
RadioModel |
Scenario01_GetText |
Scenario02_GetStream |
Scenario03_GetList |
Scenario04_PostText |
Scenario05_PostStream |
Scenario06_PostMultipart |
Scenario07_PostStreamWithProgress |
Scenario08_PostCustomContent |
Scenario09_GetCookie |
Scenario1 | Creating a file
Scenario10 |
Scenario10_SetCookie |
Scenario11 |
Scenario11_DeleteCookie |
Scenario12_DisableCookies |
Scenario13_RetryFilter |
Scenario14_MeteredConnectionFilter |
Scenario15_ServerCertificateValidation |
Scenario1_Advertiser |
Scenario1_Analyze |
Scenario1_Basic |
Scenario1_BasicFunctionality |
Scenario1_Basics |
Scenario1_Check |
Scenario1_CheckConsentAvailability |
Scenario1_Colors |
Scenario1_Configure |
Scenario1_ConfigureMobileHotspot |
Scenario1_Data |
Scenario1_DataEvents |
Scenario1_DetectInPhoto |
Scenario1_DevicePicker |
Scenario1_Discovery |
Scenario1_Enable |
Scenario1_ExtractTextSegments |
Scenario1_Files |
Scenario1_FindId |
Scenario1_FindUsers |
Scenario1_GetAndSetPin |
Scenario1_InkCanvasTactileFeedback |
Scenario1_LanguageDetection |
Scenario1_Launch |
Scenario1_Launched |
Scenario1_LongAndShortFormats |
Scenario1_ManageHotspot |
Scenario1_MoveCertificate |
Scenario1_NetworkConnectivity |
Scenario1_Orientation |
Scenario1_ParseAndStringify |
Scenario1_PercentPermilleFormatting |
Scenario1_PinTile |
Scenario1_Prefs |
Scenario1_Print |
Scenario1_ProvisionTPM |
Scenario1_ReadData |
Scenario1_Render |
Scenario1_Save |
Scenario1_SecondaryWindow |
Scenario1_SimpleListView |
Scenario1_SingleFile |
Scenario1_Toggle |
Scenario1_TrackInWebcam |
Scenario1_TrackPosition |
Scenario1_UIFonts |
Scenario1_UTF8 |
Scenario1_XmlReader |
Scenario2 | Getting a file's parent folder
Scenario2_Binary |
Scenario2_ChangePIN |
Scenario2_Client |
Scenario2_Connector |
Scenario2_DecimalFormatting |
Scenario2_DetectInWebcam |
Scenario2_DeviceWatcher |
Scenario2_Disable |
Scenario2_DisplayRegion |
Scenario2_DocumentFonts |
Scenario2_Effects |
Scenario2_Extend |
Scenario2_GetCurrentTextSegmentFromIndex |
Scenario2_GetPosition |
Scenario2_Lang |
Scenario2_Launch |
Scenario2_Listen |
Scenario2_Manage |
Scenario2_Memory |
Scenario2_MultiFile |
Scenario2_MultipleScanners |
Scenario2_NetworkCost |
Scenario2_Notifications |
Scenario2_Polling |
Scenario2_Remove |
Scenario2_RequestConsent |
Scenario2_RequestMany |
Scenario2_ScriptDetection |
Scenario2_Settings |
Scenario2_ShowHideEvents | Sample page to subscribe show/hide event of Touch Keyboard
Scenario2_SimpleGridView |
Scenario2_Stats |
Scenario2_StringTemplate |
Scenario2_SupportedTactileFeedback |
Scenario2_ToggleMobileHotspot |
Scenario2_UnpinTile |
Scenario2_WatchUsers |
Scenario2_XmlWriter |
Scenario3 |
Scenario3_ActiveSymbologies |
Scenario3_AppCapture |
Scenario3_BackgroundDeviceWatcher |
Scenario3_BackgroundTask |
Scenario3_CheckUserConsentGroup |
Scenario3_Choosing |
Scenario3_ClientAuthentication |
Scenario3_CurrencyFormatting |
Scenario3_CustomItems |
Scenario3_Enum |
Scenario3_EnumerateTiles |
Scenario3_InkingFeedback |
Scenario3_MasterDetail |
Scenario3_NetworkConnectivityChanges |
Scenario3_ParameterizedTemplate |
Scenario3_Region |
Scenario3_ResetPIN |
Scenario3_SecondaryTiles |
Scenario3_ServerForeground |
Scenario3_SettingContainer |
Scenario3_ShowHideMethods | Sample page to call TryShow/TryHide methods
Scenario3_SingleFolder |
Scenario3_Size |
Scenario3_Transliteration |
Scenario3_XmlWriterLite |
Scenario4 | Writing and reading bytes in a file
Scenario4_ChangeAdminKey |
Scenario4_ChangeSystemGroup |
Scenario4_CharacterGrouping |
Scenario4_CompactOverlay |
Scenario4_CompositeSettings |
Scenario4_EdgeTappedListView |
Scenario4_ForegroundGeofence |
Scenario4_Input |
Scenario4_InteractionFeedback |
Scenario4_NumberParsing |
Scenario4_Override |
Scenario4_PartialReadWrite |
Scenario4_SaveFile |
Scenario4_ShowView |
Scenario4_Snapshot |
Scenario4_SymbologyAttributes |
Scenario4_TilePinned |
Scenario4_UnicodeExtensions |
Scenario5 | Writing and reading using a stream
Scenario5_DisplayingBarcodePreview |
Scenario5_GeofenceBackgroundTask |
Scenario5_GetSingleDevice |
Scenario5_InkingAndInteractionFeedback |
Scenario5_IsSupported |
Scenario5_LaunchedFromSecondaryTile |
Scenario5_Msappdata |
Scenario5_RelativePositioning |
Scenario5_RestoreScrollPosition |
Scenario5_RoundingAndPadding |
Scenario5_TimeZone |
Scenario5_TriggerCFU |
Scenario5_UnicodeExtensions |
Scenario5_VerifyResponse |
Scenario6 | Displaying file properties
Scenario6_ClearScenario |
Scenario6_CustomFilterAddedProps |
Scenario6_DeleteTPM |
Scenario6_GetLastVisit |
Scenario6_NumeralSystemTranslation |
Scenario6_ScrollIntoView |
Scenario6_SecondaryTileNotification |
Scenario6_TimeZone |
Scenario7 | Persisting access to a storage item for future use
Scenario7_DeviceInformationKind |
Scenario7_ForegroundVisits |
Scenario7_ListAllCards |
Scenario7_PinFromAppbar |
Scenario7_SetVersion |
Scenario7_UsingUnicodeExtensions |
Scenario8 | Copying a file
Scenario8_PairDevice |
Scenario8_TransmitAPDU |
Scenario8_UpdateAsync |
Scenario8_VisitsBackgroundTask |
Scenario9 |
Scenario9_CustomPairDevice |
School |
SecondaryAppWindowPage |
SecondaryViewPage |
ShowPackageFamilyName |
SizePreferenceString |
SlowInputStream |
SmartCardListItem |
SymbologyListEntry |
User |
UserViewModel |
Utils |
ViewLifetimeControl |
WordOverlay |
LampArrayInfo |
LoggingChannelScenario |
LoggingSessionScenario |
LoggingSessionScenario::BusySetter |
MediaFoundationInitializer |
MFSampleGenerator |
PresentationFormats |
RenderBuffer |
SampleHelpers |
SampleState |
scope_exit< Lambda > |
SimpleTaskCompletionSource< T > |
SimpleTaskCompletionSource< void > |
SocketReaderWriter |
ToneSampleGenerator |
ToneSampleGenerator::SineSampleInfo |
unique_cotaskmem_ptr< T > |
unique_disabled_control |
unique_shared_work_queue |
WASAPICapture |
WASAPIRenderer |
WorldCeilingMesh |
WorldFloorMesh |
WorldWallsMesh |
WrlFinal |
CustomException |
OvenClient | An empty page that can be used on its own or navigated to within a Frame
CustomException |
OvenClient | An empty page that can be used on its own or navigated to within a Frame
BasicTests |
ColorEntry |
CSharpModel |
EventTests | An empty page that can be used on its own or navigated to within a Frame
Functions |
ListsAndTemplates |
MyUserControl1 |
OtherBindings |
PhasingTests |
Templates |
BoolToVisibilityConverter |
ColorToStringConverter |
DataModel |
DOModel |
DoubleToIntConverter |
Employee |
EmployeeCollection |
EmployeeDictionary |
FileDataSource |
FileItem |
IEmployee |
IntToDoubleConverter |
Manager |
MapChangedEventArgs< K > |
VectorChangedEventArgs |
YangContainer |
Account |
AdaptivePage | An empty page that can be used on its own or navigated to within a Frame
BasicDeferral | An empty page that can be used on its own or navigated to within a Frame
DeferredControlTemplatePart | An empty page that can be used on its own or navigated to within a Frame
Email |
TitledImage |
BuildNewRss | An empty page that can be used on its own or navigated to within a Frame
GiftDispatch | An empty page that can be used on its own or navigated to within a Frame
MarkHotProducts | An empty page that can be used on its own or navigated to within a Frame
XmlLoading | An empty page that can be used on its own or navigated to within a Frame
XSLTTransform | An empty page that can be used on its own or navigated to within a Frame
Generated on Fri Nov 15 2024 22:23:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: _360VideoPlaybackMain Class Reference

  • Files
  • Directories
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • _360VideoPlaybackMain
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

_360VideoPlaybackMain Class Reference

Updates, renders, and presents holographic content using Direct3D.

#include "360VideoPlaybackMain.h"

List of all members.

Public Member Functions

_360VideoPlaybackMain ()
_360VideoPlaybackMain (DeviceResources deviceResources)
~_360VideoPlaybackMain ()
void | CreateVideoShaders ()
void | CreateVideoShaders ()
void | Dispose ()
void | LoadAppState ()
void | LoadAppState ()
void | OnCameraAdded (HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args)
void | OnCameraRemoved (HolographicSpace sender, HolographicSpaceCameraRemovedEventArgs args)
virtual void | OnDeviceLost ()
void | OnDeviceLost (Object sender, EventArgs e)
virtual void | OnDeviceRestored ()
void | OnDeviceRestored (Object sender, EventArgs e)
bool | Render (ref HolographicFrame holographicFrame)
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SaveAppState ()
void | SetHolographicSpace (HolographicSpace holographicSpace)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
void | UnregisterHolographicEventHandlers ()
HolographicFrame | Update ()
Windows::Graphics::Holographic::HolographicFrame | Update ()

Static Public Member Functions

static std::shared_ptr
< DX::DeviceResources > 		GetDeviceResources ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | OnLocatabilityChanged (SpatialLocator sender, Object args)

Private Attributes

SpatialLocatorAttachedFrameOfReference | attachreferenceFrame
DeviceResources deviceResources
HolographicSpace | holographicSpace
SpatialLocator | locator
Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
bool | m_isGamepadPressed = false
bool | m_isMouseLeftKeyPressed = false
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
std::unique_ptr
< MediaTransportControls > 		m_mediaTransportControls
Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference | m_referenceFrame
std::shared_ptr
< SpatialInputHandler > 		m_spatialInputHandler
DX::StepTimer m_timer
std::unique_ptr< VideoRenderer > | m_videoRenderer
StepTimer | timer = new StepTimer()

Static Private Attributes

static std::shared_ptr
< DX::DeviceResources > 		m_deviceResources = nullptr

Detailed Description

Definition at line 25 of file 360VideoPlaybackMain.h.

Constructor & Destructor Documentation

_360VideoPlaybackMain ( )

Definition at line 35 of file 360VideoPlaybackMain.cpp.

{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~_360VideoPlaybackMain ( )

Definition at line 141 of file 360VideoPlaybackMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

_360VideoPlaybackMain ( DeviceResources deviceResources ) [inline]

Loads and initializes application assets when the application is loaded.

Parameters:
deviceResources

Definition at line 62 of file _360VideoPlaybackMain.cs.

        {
            this.deviceResources = deviceResources;

            // Register to be notified if the Direct3D device is lost.
            this.deviceResources.DeviceLost += this.OnDeviceLost;
            this.deviceResources.DeviceRestored += this.OnDeviceRestored;
        }

Member Function Documentation

void CreateVideoShaders ( )

Definition at line 490 of file 360VideoPlaybackMain.cpp.

{
    m_videoRenderer->CreateDeviceDependentResources();
    m_mediaTransportControls->Initialize();
    m_mediaTransportControls->ApplyShaders();
}

void CreateVideoShaders ( ) [inline]

Definition at line 427 of file _360VideoPlaybackMain.cs.

        {
            videoRenderer.CreateDeviceDependentResourcesAsync();
        }

void Dispose ( ) [inline]

Definition at line 126 of file _360VideoPlaybackMain.cs.

        {
#if DRAW_SAMPLE_CONTENT
            if (videoRenderer != null)
            {
                videoRenderer.ReleaseDeviceDependentResources();
                videoRenderer.Dispose();
                videoRenderer = null;
            }
#endif
        }

shared_ptr< DX::DeviceResources > GetDeviceResources ( ) [static]

Definition at line 25 of file 360VideoPlaybackMain.cpp.

{
    if (_360VideoPlaybackMain::m_deviceResources == nullptr)
    {
        _360VideoPlaybackMain::m_deviceResources = make_shared<DX::DeviceResources>();
    }
    return _360VideoPlaybackMain::m_deviceResources;
}

void LoadAppState ( ) [inline]

Definition at line 307 of file _360VideoPlaybackMain.cs.

        {
            //
            // TODO: Insert code here to load your app state.
            //       This method is called when the app resumes.
            //
            //       For example, load information from the SpatialAnchorStore.
            //
        }

void LoadAppState ( )

Definition at line 376 of file 360VideoPlaybackMain.cpp.

{
    //
    // TODO: Insert code here to load your app state.
    //       This method is called when the app resumes.
    //
    //       For example, load information from the SpatialAnchorStore.
    //
}

void OnCameraAdded | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraAddedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 371 of file _360VideoPlaybackMain.cs.

        {
            Deferral deferral = args.GetDeferral();
            HolographicCamera holographicCamera = args.Camera;

            Task task1 = new Task(() =>
            {
                //
                // TODO: Allocate resources for the new camera and load any content specific to
                //       that camera. Note that the render target size (in pixels) is a property
                //       of the HolographicCamera object, and can be used to create off-screen
                //       render targets that match the resolution of the HolographicCamera.
                //

                // Create device-based resources for the holographic camera and add it to the list of
                // cameras used for updates and rendering. Notes:
                //   * Since this function may be called at any time, the AddHolographicCamera function
                //     waits until it can get a lock on the set of holographic camera resources before
                //     adding the new camera. At 60 frames per second this wait should not take long.
                //   * A subsequent Update will take the back buffer from the RenderingParameters of this
                //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
                //     Content can then be rendered for the HolographicCamera.
                deviceResources.AddHolographicCamera(holographicCamera);

                // Holographic frame predictions will not include any information about this camera until
                // the deferral is completed.
                deferral.Complete();
            });
            task1.Start();
        }

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraRemovedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 405 of file _360VideoPlaybackMain.cs.

        {
            Task task2 = new Task(() =>
            {
                //
                // TODO: Asynchronously unload or deactivate content resources (not back buffer
                //       resources) that are specific only to the camera that was removed.
                //
            });
            task2.Start();

            // Before letting this callback return, ensure that all references to the back buffer
            // are released.
            // Since this function may be called at any time, the RemoveHolographicCamera function
            // waits until it can get a lock on the set of holographic camera resources before
            // deallocating resources for this camera. At 60 frames per second this wait should
            // not take long.
            deviceResources.RemoveHolographicCamera(args.Camera);
        }

void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources need to be released.

Definition at line 321 of file _360VideoPlaybackMain.cs.

        {

#if DRAW_SAMPLE_CONTENT
            videoRenderer.ReleaseDeviceDependentResources();
#endif

        }

void OnDeviceLost ( ) [virtual]

Definition at line 388 of file 360VideoPlaybackMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_videoRenderer->ReleaseDeviceDependentResources();
#endif
}

void OnDeviceRestored | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources may now be recreated.

Definition at line 333 of file _360VideoPlaybackMain.cs.

        {
#if DRAW_SAMPLE_CONTENT
            videoRenderer.CreateDeviceDependentResourcesAsync();
#endif
        }

void OnDeviceRestored ( ) [virtual]

Definition at line 397 of file 360VideoPlaybackMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_videoRenderer->CreateDeviceDependentResources();
#endif
}

void OnLocatabilityChanged | ( | SpatialLocator | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Definition at line 340 of file _360VideoPlaybackMain.cs.

        {
            switch (sender.Locatability)
            {
                case SpatialLocatability.Unavailable:
                    // Holograms cannot be rendered.
                    {
                        String message = "Warning! Positional tracking is " + sender.Locatability + ".";
                        Debug.WriteLine(message);
                    }
                    break;

                // In the following three cases, it is still possible to place holograms using a
                // SpatialLocatorAttachedFrameOfReference.
                case SpatialLocatability.PositionalTrackingActivating:
                // The system is preparing to use positional tracking.

                case SpatialLocatability.OrientationOnly:
                // Positional tracking has not been activated.

                case SpatialLocatability.PositionalTrackingInhibited:
                    // Positional tracking is temporarily inhibited. User action may be required
                    // in order to restore positional tracking.
                    break;

                case SpatialLocatability.PositionalTrackingActive:
                    // Positional tracking is active. World-locked content can be rendered.
                    break;
            }
        }

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
bool Render ( ref HolographicFrame holographicFrame ) [inline]

Renders the current frame to each holographic display, according to the current application and spatial positioning state.

Returns true if the frame was rendered to at least one display.

Definition at line 214 of file _360VideoPlaybackMain.cs.

        {
            // Don't try to render anything before the first Update.
            if (timer.FrameCount == 0)
            {
                return false;
            }

            // Up-to-date frame predictions enhance the effectiveness of image stablization and
            // allow more accurate positioning of holograms.
            holographicFrame.UpdateCurrentPrediction();
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Lock the set of holographic camera resources, then draw to each camera
            // in this frame.
            return deviceResources.UseHolographicCameraResources(
                (Dictionary<uint, CameraResources> cameraResourceDictionary) =>
                {
                    bool atLeastOneCameraRendered = false;

                    foreach (var cameraPose in prediction.CameraPoses)
                    {
                        // This represents the device-based resources for a HolographicCamera.
                        CameraResources cameraResources = cameraResourceDictionary[cameraPose.HolographicCamera.Id];

                        // Get the device context.
                        var context = deviceResources.D3DDeviceContext;
                        var renderTargetView = cameraResources.BackBufferRenderTargetView;
                        var depthStencilView = cameraResources.DepthStencilView;

                        // Set render targets to the current holographic camera.
                        context.OutputMerger.SetRenderTargets(depthStencilView, renderTargetView);

                        // Clear the back buffer and depth stencil view.
                        SharpDX.Mathematics.Interop.RawColor4 transparent = new SharpDX.Mathematics.Interop.RawColor4(0.0f, 0.0f, 0.0f, 0.0f);
                        context.ClearRenderTargetView(renderTargetView, transparent);
                        context.ClearDepthStencilView(
                            depthStencilView,
                            SharpDX.Direct3D11.DepthStencilClearFlags.Depth | SharpDX.Direct3D11.DepthStencilClearFlags.Stencil,
                            1.0f,
                            0);

                        //
                        // TODO: Replace the sample content with your own content.
                        //
                        // Notes regarding holographic content:
                        //    * For drawing, remember that you have the potential to fill twice as many pixels
                        //      in a stereoscopic render target as compared to a non-stereoscopic render target
                        //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
                        //      and only draw holograms that the user can see.
                        //    * To help occlude hologram geometry, you can create a depth map using geometry
                        //      data obtained via the surface mapping APIs. You can use this depth map to avoid
                        //      rendering holograms that are intended to be hidden behind tables, walls,
                        //      monitors, and so on.
                        //    * Black pixels will appear transparent to the user wearing the device, but you
                        //      should still use alpha blending to draw semitransparent holograms. You should
                        //      also clear the screen to Transparent as shown above.
                        //

                        // The view and projection matrices for each holographic camera will change
                        // every frame. This function refreshes the data in the constant buffer for
                        // the holographic camera indicated by cameraPose.
                        cameraResources.UpdateViewProjectionBuffer(deviceResources, cameraPose, attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp)/*referenceFrame.CoordinateSystem*/);

                        // Attach the view/projection constant buffer for this camera to the graphics pipeline.
                        bool cameraActive = cameraResources.AttachViewProjectionBuffer(deviceResources);

#if DRAW_SAMPLE_CONTENT
                        // Only render world-locked content when positional tracking is active.
                        if (cameraActive)
                        {
                            // Draw the sample hologram.
                            videoRenderer.Render();
                        }
#endif
                        atLeastOneCameraRendered = true;
                    }

                    return atLeastOneCameraRendered;
                });
        }

bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )
void SaveAppState ( )

Definition at line 366 of file 360VideoPlaybackMain.cpp.

{
    //
    // TODO: Insert code here to save your app state.
    //       This method is called when the app is about to suspend.
    //
    //       For example, store information in the SpatialAnchorStore.
    //
}

void SaveAppState ( ) [inline]

Definition at line 297 of file _360VideoPlaybackMain.cs.

        {
            //
            // TODO: Insert code here to save your app state.
            //       This method is called when the app is about to suspend.
            //
            //       For example, store information in the SpatialAnchorStore.
            //
        }

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void SetHolographicSpace ( HolographicSpace holographicSpace ) [inline]

Definition at line 71 of file _360VideoPlaybackMain.cs.

        {
            this.holographicSpace = holographicSpace;

            //
            // TODO: Add code here to initialize your content.
            //

#if DRAW_SAMPLE_CONTENT
            // Initialize the sample hologram.
            videoRenderer = new VideoRenderer(deviceResources);

            spatialInputHandler = new SpatialInputHandler();
#endif

            // Use the default SpatialLocator to track the motion of the device.
            locator = SpatialLocator.GetDefault();

            // Be able to respond to changes in the positional tracking state.
            locator.LocatabilityChanged += this.OnLocatabilityChanged;

            // Respond to camera added events by creating any resources that are specific
            // to that camera, such as the back buffer render target view.
            // When we add an event handler for CameraAdded, the API layer will avoid putting
            // the new camera in new HolographicFrames until we complete the deferral we created
            // for that handler, or return from the handler without creating a deferral. This
            // allows the app to take more than one frame to finish creating resources and
            // loading assets for the new holographic camera.
            // This function should be registered before the app creates any HolographicFrames.
            holographicSpace.CameraAdded += this.OnCameraAdded;

            // Respond to camera removed events by releasing resources that were created for that
            // camera.
            // When the app receives a CameraRemoved event, it releases all references to the back
            // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
            // The app must also ensure that the back buffer is not attached as a render target, as
            // shown in DeviceResources.ReleaseResourcesForBackBuffer.
            holographicSpace.CameraRemoved += this.OnCameraRemoved;

            // The simplest way to render video Frame is to create a stationary reference frame
            // when the app is launched. This is roughly analogous to creating a "world" coordinate system
            // with the origin placed at the device's position as the app is launched.
            attachreferenceFrame = locator.CreateAttachedFrameOfReferenceAtCurrentHeading();

            // Notes on spatial tracking APIs:
            // * Stationary reference frames are designed to provide a best-fit position relative to the
            //   overall space. Individual positions within that reference frame are allowed to drift slightly
            //   as the device learns more about the environment.
            // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
            //   anchor the individual hologram to a position in the real world - for example, a point the user
            //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
            //   anchor will use the corrected position starting in the next frame after the correction has
            //   occurred.
        }

void UnregisterHolographicEventHandlers ( )

Definition at line 111 of file 360VideoPlaybackMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }

    if (m_videoRenderer != nullptr)
    {
        m_videoRenderer->ReleaseDeviceDependentResources();
    }
}

HolographicFrame Update ( )

Definition at line 150 of file 360VideoPlaybackMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);
    SpatialPointerPose^ position = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);

    bool inputReceived = false;

    // Check for new input state since the last frame.
    SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
    if (pointerState != nullptr)
    {
        inputReceived = true;
    }

    // Check for Gamepad input
    auto gamepads = Gamepad::Gamepads;
    if (gamepads->Size > 0)
    {
        auto currentButtonState = gamepads->GetAt(0)->GetCurrentReading().Buttons; // We are only going to support 1 controller at the moment
        if (static_cast<bool>(currentButtonState & GamepadButtons::A)) // Marking 'A' Button as our click button
        {
            if (!m_isGamepadPressed) // Control the frequency of calls in Update
            {
                inputReceived = true;
                m_isGamepadPressed = true;
            }
        }
        else
        {
            m_isGamepadPressed = false;
        }
    }

    // Check Mouse Input
    if (static_cast<bool>(CoreWindow::GetForCurrentThread()->GetKeyState(VirtualKey::LeftButton) & CoreVirtualKeyStates::Down))
    {
        if (!m_isMouseLeftKeyPressed) // Control the frequency of calls in Update
        {
            inputReceived = true;
            m_isMouseLeftKeyPressed = true;
        }
    }
    else
    {
        m_isMouseLeftKeyPressed = false;
    }

    // Handle input
    if (inputReceived)
    {
        if (m_mediaTransportControls->IsVisible())
        {
            m_mediaTransportControls->PerformPressedAction();
        }
        else if (position != nullptr)
        {
            m_mediaTransportControls->Show(position, MTC_SPAWN_DISTANCE);
        }
    }

    m_timer.Tick([this, position]()
    {
        //
        // TODO: Update scene objects.
        //
        // Put time-based updates here. By default this code will run once per frame,
        // but if you change the StepTimer to use a fixed time step this code will
        // run as many times as needed to get to the current step.
        //

#ifdef DRAW_SAMPLE_CONTENT
        m_videoRenderer->Update(m_timer);
        m_mediaTransportControls->Update(m_timer, position);
#endif
    });

    // We complete the frame update by using information about our content positioning
    // to set the focus point.

    for (auto cameraPose : prediction->CameraPoses)
    {
#ifdef DRAW_SAMPLE_CONTENT
        // The HolographicCameraRenderingParameters class provides access to set
        // the image stabilization parameters.
        HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

        // SetFocusPoint informs the system about a specific point in your scene to
        // prioritize for image stabilization. The focus point is set independently
        // for each holographic camera.
        // You should set the focus point near the content that the user is looking at.
        // In this example, we put the focus point at the center of the sample hologram,
        // since that is the only hologram available for the user to focus on.
        // You can also set the relative velocity and facing of that content; the sample
        // hologram is at a fixed point so we only need to indicate its position.
        float3 position = { 0.f, 0.f, 0.f };
        renderingParameters->SetFocusPoint(
            currentCoordinateSystem,
            position);
#endif
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

HolographicFrame Update ( ) [inline]

Updates the application state once per frame.

Definition at line 141 of file _360VideoPlaybackMain.cs.

        {
            // Before doing the timer update, there is some work to do per-frame
            // to maintain holographic rendering. First, we will get information
            // about the current frame.

            // The HolographicFrame has information that the app needs in order
            // to update and render the current frame. The app begins each new
            // frame by calling CreateNextFrame.
            HolographicFrame holographicFrame = holographicSpace.CreateNextFrame();

            // Get a prediction of where holographic cameras will be when this frame
            // is presented.
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Back buffers can change from frame to frame. Validate each buffer, and recreate
            // resource views and depth buffers as needed.
            deviceResources.EnsureCameraResources(holographicFrame, prediction);

            // Next, we get a coordinate system from the attached frame of reference that is
            // associated with the current frame. Later, this coordinate system is used for
            // for creating the stereo view matrices when rendering the sample content.
            SpatialCoordinateSystem currentCoordinateSystem = attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp);//referenceFrame.CoordinateSystem;

            timer.Tick(() =>
            {
                //
                // TODO: Update scene objects.
                //
                // Put time-based updates here. By default this code will run once per frame,
                // but if you change the StepTimer to use a fixed time step this code will
                // run as many times as needed to get to the current step.
                //

#if DRAW_SAMPLE_CONTENT
                videoRenderer.Update(timer);
#endif
            });

            // We complete the frame update by using information about our content positioning
            // to set the focus point.
            foreach (var cameraPose in prediction.CameraPoses)
            {
#if DRAW_SAMPLE_CONTENT
                // The HolographicCameraRenderingParameters class provides access to set
                // the image stabilization parameters.
                HolographicCameraRenderingParameters renderingParameters = holographicFrame.GetRenderingParameters(cameraPose);

                // SetFocusPoint informs the system about a specific point in your scene to
                // prioritize for image stabilization. The focus point is set independently
                // for each holographic camera.
                // You should set the focus point near the content that the user is looking at.
                // In this example, we put the focus point at the center of the sample hologram,
                // since that is the only hologram available for the user to focus on.
                // You can also set the relative velocity and facing of that content; the sample
                // hologram is at a fixed point so we only need to indicate its position.
                Vector3 position = new Vector3(0.0f, 0.0f, 0.0f);
                renderingParameters.SetFocusPoint(
                currentCoordinateSystem, position
                );
#endif
            }

            // The holographic frame will be used to get up-to-date view and projection matrices and
            // to present the swap chain.
            return holographicFrame;
        }

Member Data Documentation

SpatialLocatorAttachedFrameOfReference attachreferenceFrame [private]

Definition at line 56 of file _360VideoPlaybackMain.cs.

DeviceResources deviceResources [private]

Definition at line 44 of file _360VideoPlaybackMain.cs.

HolographicSpace holographicSpace [private]

Definition at line 50 of file _360VideoPlaybackMain.cs.

SpatialLocator locator [private]

Definition at line 53 of file _360VideoPlaybackMain.cs.

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 97 of file 360VideoPlaybackMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 98 of file 360VideoPlaybackMain.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources = nullptr [static, private]

Definition at line 82 of file 360VideoPlaybackMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 88 of file 360VideoPlaybackMain.h.

bool m_isGamepadPressed = false [private]

Definition at line 100 of file 360VideoPlaybackMain.h.

bool m_isMouseLeftKeyPressed = false [private]

Definition at line 101 of file 360VideoPlaybackMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 99 of file 360VideoPlaybackMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 91 of file 360VideoPlaybackMain.h.

std::unique_ptr<MediaTransportControls> m_mediaTransportControls [private]

Definition at line 75 of file 360VideoPlaybackMain.h.

Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference m_referenceFrame [private]

Definition at line 94 of file 360VideoPlaybackMain.h.

std::shared_ptr<SpatialInputHandler> m_spatialInputHandler [private]

Definition at line 78 of file 360VideoPlaybackMain.h.

DX::StepTimer m_timer [private]

Definition at line 85 of file 360VideoPlaybackMain.h.

std::unique_ptr<VideoRenderer> m_videoRenderer [private]

Definition at line 74 of file 360VideoPlaybackMain.h.

StepTimer timer = new StepTimer() [private]

Definition at line 47 of file _360VideoPlaybackMain.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/360VideoPlaybackMain.h
  • 360VideoPlayback/cs/_360VideoPlaybackMain.cs
  • 360VideoPlayback/cpp/360VideoPlaybackMain.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 13 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 19 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 31 of file App.xaml.cs.

        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 79 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 91 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/App.xaml.cs
  • 360VideoPlayback/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • AppView
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

AppView Class Reference

The IFrameworkView connects the app with Windows and handles application lifecycle events.

List of all members.

Public Member Functions

AppView (Uri sourceUri)
void | Dispose ()
void | Initialize (CoreApplicationView applicationView)
void | Load (string entryPoint)
void | Run ()
void | SetWindow (CoreWindow window)
void | Uninitialize ()

Static Public Attributes

static MediaPlayer | mediaPlayer = null

Private Member Functions

void | AppView_Consolidated (ApplicationView sender, ApplicationViewConsolidatedEventArgs args)
void | MediaPlayer_MediaOpened (MediaPlayer sender, object args)
async void | OnKeyPressed (CoreWindow sender, KeyEventArgs args)
void | OnmainWindowActivated (CoreWindow sender, WindowActivatedEventArgs args)
void | OnResuming (object sender, object args)
void | OnSuspending (object sender, SuspendingEventArgs args)
void | OnViewActivated (CoreApplicationView sender, IActivatedEventArgs args)
void | OnVisibilityChanged (CoreWindow sender, VisibilityChangedEventArgs args)
void | OnWindowClosed (CoreWindow sender, CoreWindowEventArgs arg)
void | TryCloseWindow ()

Private Attributes

bool | appViewConsolidated = false
bool | createdShaders = false
bool | createShaders = false
DeviceResources deviceResources
HolographicSpace | holographicSpace = null
_360VideoPlaybackMain main
bool | mainWindowReactivated = false
Uri | sourceUri
bool | windowClosed = false
bool | windowVisible = true

Detailed Description

Definition at line 18 of file AppView.cs.

Constructor & Destructor Documentation

AppView ( Uri sourceUri ) [inline]

Definition at line 36 of file AppView.cs.

        {
            windowVisible = true;
            mediaPlayer = new MediaPlayer();
            this.sourceUri = sourceUri;
        }

Member Function Documentation

void AppView_Consolidated | ( | ApplicationView | sender,
 |  | ApplicationViewConsolidatedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 140 of file AppView.cs.

        {
            appViewConsolidated = true;
            windowClosed = true;
            TryCloseWindow();
            Dispose();
        }

void Dispose ( ) [inline]

Definition at line 48 of file AppView.cs.

        {
            if (deviceResources != null)
            {
                deviceResources.Dispose();
                deviceResources = null;
            }

            if (main != null)
            {
                main.Dispose();
                main = null;
            }

            if (mediaPlayer != null)
            {
                mediaPlayer.Dispose();
                mediaPlayer = null;
            }
        }

void Initialize ( CoreApplicationView applicationView ) [inline]

The first method called when the IFrameworkView is being created.

Use this method to subscribe for Windows shell events and to initialize your app.

Definition at line 75 of file AppView.cs.

        {
            CoreWindow window = CoreWindow.GetForCurrentThread();
            if (window != null)
            {
                window.Activated += OnmainWindowActivated;
            }
            applicationView.Activated += this.OnViewActivated;
        }

void Load ( string entryPoint ) [inline]

The Load method can be used to initialize scene resources or to load a previously saved app state.

Definition at line 158 of file AppView.cs.

        {
        }

void MediaPlayer_MediaOpened | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 43 of file AppView.cs.

        {
            createShaders = true;
        }

async void OnKeyPressed | ( | CoreWindow | sender,
 |  | KeyEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 290 of file AppView.cs.

        {
            if (args.VirtualKey == Windows.System.VirtualKey.Escape)
            {
                await ApplicationViewSwitcher.SwitchAsync(VideoGallery.mainviewId, ApplicationView.GetForCurrentView().Id, ApplicationViewSwitchingOptions.ConsolidateViews);
            }
            //
            // TODO: Bluetooth keyboards are supported by HoloLens. You can use this method for
            //       keyboard input if you want to support it as an optional input method for
            //       your holographic app.
            //
        }

void OnmainWindowActivated | ( | CoreWindow | sender,
 |  | WindowActivatedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 85 of file AppView.cs.

        {
            mainWindowReactivated = true;
            windowClosed = true;
            TryCloseWindow();
        }

void OnResuming | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 256 of file AppView.cs.

        {
            // Restore any data or state that was unloaded on suspend. By default, data
            // and state are persisted when resuming from suspend. Note that this event
            // does not occur if the app was previously terminated.

            if (null != main)
            {
                main.LoadAppState();
            }

            //
            // TODO: Insert code here to load your app state.
            //
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 231 of file AppView.cs.

        {
            // Save app state asynchronously after requesting a deferral. Holding a deferral
            // indicates that the application is busy performing suspending operations. Be
            // aware that a deferral may not be held indefinitely; after about five seconds,
            // the app will be forced to exit.
            var deferral = args.SuspendingOperation.GetDeferral();

            Task.Run(() =>
                {
                    deviceResources.Trim();

                    if (null != main)
                    {
                        main.SaveAppState();
                    }

                    //
                    // TODO: Insert code here to save your app state.
                    //

                    deferral.Complete();
                });
        }

void OnViewActivated | ( | CoreApplicationView | sender,
 |  | IActivatedEventArgs | args |
 | ) |  |  | [inline, private]

Called when the app view is activated.

Activates the app's CoreWindow.

Definition at line 225 of file AppView.cs.

        {
            // Run() won't start until the CoreWindow is activated.
            sender.CoreWindow.Activate();
        }

void OnVisibilityChanged | ( | CoreWindow | sender,
 |  | VisibilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 276 of file AppView.cs.

        {
            windowVisible = args.Visible;
        }

void OnWindowClosed | ( | CoreWindow | sender,
 |  | CoreWindowEventArgs | arg |
 | ) |  |  | [inline, private]

Definition at line 281 of file AppView.cs.

        {
            windowClosed = true;
        }

void Run ( ) [inline]

This method is called after the window becomes active.

It oversees the update, draw, and present loop, and also oversees window message processing.

Definition at line 166 of file AppView.cs.

        {
            CoreWindow window = CoreWindow.GetForCurrentThread();
            window.Activate();
            while (!windowClosed)
            {
                if (createShaders)
                {
                    if (!createdShaders)
                    {
                        main.CreateVideoShaders();
                        createdShaders = true;
                    }
                }
                else
                {
                    window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessOneAndAllPending);
                    continue;
                }

                if (appViewConsolidated || mainWindowReactivated)
                {
                    TryCloseWindow();
                    windowClosed = true;

                }
                else
                {
                    window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessAllIfPresent);
                    if (windowVisible && (null != holographicSpace))
                    {
                        HolographicFrame frame = main.Update();

                        if (main.Render(ref frame))
                        {
                            deviceResources.Present(ref frame);
                        }
                    }
                }
            }
        }

void SetWindow ( CoreWindow window ) [inline]

Called when the CoreWindow object is created (or re-created).

Definition at line 95 of file AppView.cs.

        {
            ApplicationView.GetForCurrentView().Consolidated += AppView_Consolidated;

            // Register event handlers for app lifecycle.
            CoreApplication.Suspending += this.OnSuspending;
            CoreApplication.Resuming += this.OnResuming;

            // Register for keypress notifications.
            window.KeyDown += this.OnKeyPressed;

            // Register for notification that the app window is being closed.
            window.Closed += this.OnWindowClosed;

            // Register for notifications that the app window is losing focus.
            window.VisibilityChanged += this.OnVisibilityChanged;

            // At this point we have access to the device and we can create device-dependent
            // resources.
            deviceResources = new DeviceResources();

            main = new _360VideoPlaybackMain(deviceResources);

            // Create a holographic space for the core window for the current view.
            // Presenting holographic frames that are created by this holographic space will put
            // the app into exclusive mode.
            holographicSpace = HolographicSpace.CreateForCoreWindow(window);

            // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
            // space (when available) to create a Direct3D device. The HolographicSpace
            // uses this ID3D11Device to create and manage device-based resources such as
            // swap chains.
            deviceResources.SetHolographicSpace(holographicSpace);

            // The main class uses the holographic space for updates and rendering.
            main.SetHolographicSpace(holographicSpace);

            MediaSource source = MediaSource.CreateFromUri(sourceUri);
            mediaPlayer.MediaOpened += MediaPlayer_MediaOpened;
            mediaPlayer.Source = source;// Windows.Media.Core.MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/video.mp4"));

            mediaPlayer.IsVideoFrameServerEnabled = true;
            mediaPlayer.IsLoopingEnabled = true;
        }

void TryCloseWindow ( ) [inline, private]

Definition at line 148 of file AppView.cs.

        {
            CoreWindow window = CoreWindow.GetForCurrentThread();
            window?.Close();
        }

void Uninitialize ( ) [inline]

Terminate events do not cause Uninitialize to be called.

It will be called if your IFrameworkView class is torn down while the app is in the foreground.

Definition at line 214 of file AppView.cs.

        {
        }

Member Data Documentation

bool appViewConsolidated = false [private]

Definition at line 30 of file AppView.cs.

bool createdShaders = false [private]

Definition at line 26 of file AppView.cs.

bool createShaders = false [private]

Definition at line 25 of file AppView.cs.

DeviceResources deviceResources [private]

Definition at line 22 of file AppView.cs.

HolographicSpace holographicSpace = null [private]

Definition at line 29 of file AppView.cs.

_360VideoPlaybackMain main [private]

Definition at line 20 of file AppView.cs.

bool mainWindowReactivated = false [private]

Definition at line 31 of file AppView.cs.

MediaPlayer mediaPlayer = null [static]

Definition at line 33 of file AppView.cs.

Uri sourceUri [private]

Definition at line 34 of file AppView.cs.

bool windowClosed = false [private]

Definition at line 23 of file AppView.cs.

bool windowVisible = true [private]

Definition at line 24 of file AppView.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/AppView.cs
  • 360VideoPlayback/cpp/AppView.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppViewSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • AppViewSource
Public Member Functions | Private Attributes

AppViewSource Class Reference

List of all members.

Public Member Functions

AppViewSource (Uri sourceUri)
IFrameworkView | CreateView ()

Private Attributes

Uri | sourceUri

Detailed Description

Definition at line 7 of file AppViewSource.cs.

Constructor & Destructor Documentation

AppViewSource ( Uri sourceUri ) [inline]

Definition at line 9 of file AppViewSource.cs.

        {
            this.sourceUri = sourceUri;
        }

Member Function Documentation

IFrameworkView CreateView ( ) [inline]

Definition at line 14 of file AppViewSource.cs.

        {
            return new AppView(sourceUri);
        }

Member Data Documentation

Uri sourceUri [private]

Definition at line 19 of file AppViewSource.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/AppViewSource.cs
  • 360VideoPlayback/cpp/AppView.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • CameraResources
Public Member Functions | Public Attributes | Private Attributes

CameraResources Class Reference

Inherits _360VideoPlayback::Common::Disposer.

List of all members.

Public Member Functions

CameraResources (HolographicCamera holographicCamera)
bool | AttachViewProjectionBuffer (DeviceResources deviceResources)
void | CreateResourcesForBackBuffer (DeviceResources deviceResources, HolographicCameraRenderingParameters cameraParameters)
void | ReleaseAllDeviceResources (DeviceResources deviceResources)
void | ReleaseResourcesForBackBuffer (DeviceResources deviceResources)
void | UpdateViewProjectionBuffer (DeviceResources deviceResources, HolographicCameraPose cameraPose, SpatialCoordinateSystem coordinateSystem)

Public Attributes

SharpDX.DXGI.Format | BackBufferDxgiFormat = > dxgiFormat
RenderTargetView | BackBufferRenderTargetView = > d3dRenderTargetView
Texture2D | BackBufferTexture2D = > d3dBackBuffer
DepthStencilView DepthStencilView = > d3dDepthStencilView
HolographicCamera HolographicCamera = > holographicCamera
bool | IsRenderingStereoscopic = > isStereo
Size RenderTargetSize = > d3dRenderTargetSize
RawViewportF | Viewport = > d3dViewport

Private Attributes

Texture2D | d3dBackBuffer
DepthStencilView d3dDepthStencilView
Size d3dRenderTargetSize
RenderTargetView | d3dRenderTargetView
RawViewportF | d3dViewport
SharpDX.DXGI.Format | dxgiFormat
bool | framePending = false
HolographicCamera | holographicCamera = null
bool | isStereo = false
SharpDX.Direct3D11.Buffer | viewProjectionConstantBuffer

Detailed Description

Definition at line 24 of file CameraResources.cs.

Constructor & Destructor Documentation

CameraResources ( HolographicCamera holographicCamera ) [inline]

Definition at line 48 of file CameraResources.cs.

        {
            this.holographicCamera = holographicCamera;
            isStereo = holographicCamera.IsStereo;
            d3dRenderTargetSize = holographicCamera.RenderTargetSize;

            d3dViewport.Height = (float)d3dRenderTargetSize.Height;
            d3dViewport.Width = (float)d3dRenderTargetSize.Width;
            d3dViewport.X = 0;
            d3dViewport.Y = 0;
            d3dViewport.MinDepth = 0;
            d3dViewport.MaxDepth = 1;
        }

Member Function Documentation

bool AttachViewProjectionBuffer ( DeviceResources deviceResources ) [inline]

Gets the view-projection constant buffer for the display, and attaches it to the shader pipeline.

Definition at line 252 of file CameraResources.cs.

        {
            // This method uses Direct3D device-based resources.
            var context = deviceResources.D3DDeviceContext;

            // Loading is asynchronous. Resources must be created before they can be updated.
            // Cameras can also be added asynchronously, in which case they must be initialized
            // before they can be used.
            if (context == null || viewProjectionConstantBuffer == null || !framePending)
            {
                return false;
            }

            // Set the viewport for this camera.
            context.Rasterizer.SetViewport(Viewport);

            // Send the constant buffer to the vertex shader.
            context.VertexShader.SetConstantBuffers(1, viewProjectionConstantBuffer);

            // The template includes a pass-through geometry shader that is used by
            // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
            // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
            // will be enabled at run-time on systems that require it.
            // If your app will also use the geometry shader for other tasks and those
            // tasks require the view/projection matrix, uncomment the following line
            // of code to send the constant buffer to the geometry shader as well.
            //context.GeometryShader.SetConstantBuffers(1, viewProjectionConstantBuffer);

            framePending = false;

            return true;
        }

void CreateResourcesForBackBuffer | ( | DeviceResources | deviceResources,
 |  | HolographicCameraRenderingParameters | cameraParameters |
 | ) |  |  | [inline]

Updates resources associated with a holographic camera's swap chain.

The app does not access the swap chain directly, but it does create resource views for the back buffer.

Definition at line 67 of file CameraResources.cs.

        {
            var device = deviceResources.D3DDevice;

            // Get the WinRT object representing the holographic camera's back buffer.
            IDirect3DSurface surface = cameraParameters.Direct3D11BackBuffer;

            // Get a DXGI interface for the holographic camera's back buffer.
            // Holographic cameras do not provide the DXGI swap chain, which is owned
            // by the system. The Direct3D back buffer resource is provided using WinRT
            // interop APIs.
            InteropStatics.IDirect3DDxgiInterfaceAccess surfaceDxgiInterfaceAccess = surface as InteropStatics.IDirect3DDxgiInterfaceAccess;
            IntPtr pResource = surfaceDxgiInterfaceAccess.GetInterface(InteropStatics.ID3D11Resource);
            SharpDX.Direct3D11.Resource resource = SharpDX.Direct3D11.Resource.FromPointer<SharpDX.Direct3D11.Resource>(pResource);
            Marshal.Release(pResource);

            // Get a Direct3D interface for the holographic camera's back buffer.
            Texture2D cameraBackBuffer = resource.QueryInterface<Texture2D>();

            // Determine if the back buffer has changed. If so, ensure that the render target view
            // is for the current back buffer.
            if ((null == d3dBackBuffer) || (d3dBackBuffer.NativePointer != cameraBackBuffer.NativePointer))
            {
                // This can change every frame as the system moves to the next buffer in the
                // swap chain. This mode of operation will occur when certain rendering modes
                // are activated.
                d3dBackBuffer = cameraBackBuffer;

                // Create a render target view of the back buffer.
                // Creating this resource is inexpensive, and is better than keeping track of
                // the back buffers in order to pre-allocate render target views for each one.
                d3dRenderTargetView = this.ToDispose(new RenderTargetView(device, BackBufferTexture2D));

                // Get the DXGI format for the back buffer.
                // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
                Texture2DDescription backBufferDesc = BackBufferTexture2D.Description;
                dxgiFormat = backBufferDesc.Format;

                // Check for render target size changes.
                Size currentSize = holographicCamera.RenderTargetSize;
                if (d3dRenderTargetSize != currentSize)
                {
                    // Set render target size.
                    d3dRenderTargetSize = HolographicCamera.RenderTargetSize;

                    // A new depth stencil view is also needed.
                    this.RemoveAndDispose(ref d3dDepthStencilView);
                }
            }

            // Refresh depth stencil resources, if needed.
            if (null == DepthStencilView)
            {
                // Create a depth stencil view for use with 3D rendering if needed.
                var depthStencilDesc = new Texture2DDescription
                {
                    Format = SharpDX.DXGI.Format.D16_UNorm,
                    Width = (int)RenderTargetSize.Width,
                    Height = (int)RenderTargetSize.Height,
                    ArraySize = IsRenderingStereoscopic ? 2 : 1, // Create two textures when rendering in stereo.
                    MipLevels = 1, // Use a single mipmap level.
                    BindFlags = BindFlags.DepthStencil,
                    SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0)
                };

                using (var depthStencil = new Texture2D(device, depthStencilDesc))
                {
                    var depthStencilViewDesc = new DepthStencilViewDescription();
                    depthStencilViewDesc.Dimension = IsRenderingStereoscopic ? DepthStencilViewDimension.Texture2DArray : DepthStencilViewDimension.Texture2D;
                    depthStencilViewDesc.Texture2DArray.ArraySize = IsRenderingStereoscopic ? 2 : 0;
                    d3dDepthStencilView = this.ToDispose(new DepthStencilView(device, depthStencil, depthStencilViewDesc));
                }
            }

            // Create the constant buffer, if needed.
            if (null == viewProjectionConstantBuffer)
            {
                // Create a constant buffer to store view and projection matrices for the camera.
                ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
                viewProjectionConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                    device,
                    BindFlags.ConstantBuffer,
                    ref viewProjectionConstantBufferData));
            }
        }

void ReleaseAllDeviceResources ( DeviceResources deviceResources ) [inline]

Definition at line 176 of file CameraResources.cs.

        {
            ReleaseResourcesForBackBuffer(deviceResources);
            this.RemoveAndDispose(ref viewProjectionConstantBuffer);
        }

void ReleaseResourcesForBackBuffer ( DeviceResources deviceResources ) [inline]

Releases resources associated with a holographic display back buffer.

Definition at line 159 of file CameraResources.cs.

        {
            var context = deviceResources.D3DDeviceContext;

            this.RemoveAndDispose(ref d3dBackBuffer);
            this.RemoveAndDispose(ref d3dRenderTargetView);
            this.RemoveAndDispose(ref d3dDepthStencilView);

            const int D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT = 8;
            RenderTargetView[] nullViews = new RenderTargetView[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT];

            // Ensure system references to the back buffer are released by clearing the render
            // target from the graphics pipeline state, and then flushing the Direct3D context.
            context.OutputMerger.SetRenderTargets(null, nullViews);
            context.Flush();
        }

void UpdateViewProjectionBuffer | ( | DeviceResources | deviceResources,
 |  | HolographicCameraPose | cameraPose,
 |  | SpatialCoordinateSystem | coordinateSystem |
 | ) |  |  | [inline]

Updates the constant buffer for the display with view and projection matrices for the current frame.

Definition at line 186 of file CameraResources.cs.

        {
            // The system changes the viewport on a per-frame basis for system optimizations.
            d3dViewport.X = (float)cameraPose.Viewport.Left;
            d3dViewport.Y = (float)cameraPose.Viewport.Top;
            d3dViewport.Width = (float)cameraPose.Viewport.Width;
            d3dViewport.Height = (float)cameraPose.Viewport.Height;
            d3dViewport.MinDepth = 0;
            d3dViewport.MaxDepth = 1;

            // The projection transform for each frame is provided by the HolographicCameraPose.
            HolographicStereoTransform cameraProjectionTransform = cameraPose.ProjectionTransform;

            // Get a container object with the view and projection matrices for the given
            // pose in the given coordinate system.
            HolographicStereoTransform? viewTransformContainer = cameraPose.TryGetViewTransform(coordinateSystem);

            // If TryGetViewTransform returns null, that means the pose and coordinate system
            // cannot be understood relative to one another; content cannot be rendered in this
            // coordinate system for the duration of the current frame.
            // This usually means that positional tracking is not active for the current frame, in
            // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
            // content that is not world-locked instead.
            ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
            bool viewTransformAcquired = viewTransformContainer.HasValue;
            if (viewTransformAcquired)
            {
                // Otherwise, the set of view transforms can be retrieved.
                HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer.Value;

                // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
                // constantly moving relative to the world. The view matrices need to be updated
                // every frame.
                viewProjectionConstantBufferData.viewProjectionLeft = Matrix4x4.Transpose(
                    viewCoordinateSystemTransform.Left * cameraProjectionTransform.Left
                    );
                viewProjectionConstantBufferData.viewProjectionRight = Matrix4x4.Transpose(
                    viewCoordinateSystemTransform.Right * cameraProjectionTransform.Right
                    );
            }

            // Use the D3D device context to update Direct3D device-based resources.
            var context = deviceResources.D3DDeviceContext;

            // Loading is asynchronous. Resources must be created before they can be updated.
            if (context == null || viewProjectionConstantBuffer == null || !viewTransformAcquired)
            {
                framePending = false;
            }
            else
            {
                // Update the view and projection matrices.
                context.UpdateSubresource(ref viewProjectionConstantBufferData, viewProjectionConstantBuffer);

                framePending = true;
            }
        }

Member Data Documentation

SharpDX.DXGI.Format BackBufferDxgiFormat = > dxgiFormat

Definition at line 292 of file CameraResources.cs.

RenderTargetView BackBufferRenderTargetView = > d3dRenderTargetView

Definition at line 286 of file CameraResources.cs.

Texture2D BackBufferTexture2D = > d3dBackBuffer

Definition at line 288 of file CameraResources.cs.

Texture2D d3dBackBuffer [private]

Definition at line 29 of file CameraResources.cs.

DepthStencilView d3dDepthStencilView [private]

Definition at line 28 of file CameraResources.cs.

Size d3dRenderTargetSize [private]

Definition at line 37 of file CameraResources.cs.

RenderTargetView d3dRenderTargetView [private]

Definition at line 27 of file CameraResources.cs.

RawViewportF d3dViewport [private]

Definition at line 36 of file CameraResources.cs.

DepthStencilView DepthStencilView = > d3dDepthStencilView

Definition at line 287 of file CameraResources.cs.

SharpDX.DXGI.Format dxgiFormat [private]

Definition at line 35 of file CameraResources.cs.

bool framePending = false [private]

Definition at line 43 of file CameraResources.cs.

HolographicCamera HolographicCamera = > holographicCamera

Definition at line 297 of file CameraResources.cs.

HolographicCamera holographicCamera = null [private]

Definition at line 46 of file CameraResources.cs.

bool IsRenderingStereoscopic = > isStereo

Definition at line 294 of file CameraResources.cs.

bool isStereo = false [private]

Definition at line 40 of file CameraResources.cs.

Size RenderTargetSize = > d3dRenderTargetSize

Definition at line 293 of file CameraResources.cs.

RawViewportF Viewport = > d3dViewport

Definition at line 291 of file CameraResources.cs.

SharpDX.Direct3D11.Buffer viewProjectionConstantBuffer [private]

Definition at line 32 of file CameraResources.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Common/CameraResources.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • DeviceResources
Public Member Functions | Public Attributes | Events | Private Member Functions | Private Attributes

DeviceResources Class Reference

Controls all the DirectX device resources.

Inherits _360VideoPlayback::Common::Disposer.

List of all members.

Public Member Functions

DeviceResources ()
void | AddHolographicCamera (HolographicCamera camera)
void | EnsureCameraResources (HolographicFrame frame, HolographicFramePrediction prediction)
void | HandleDeviceLost ()
void | InitializeUsingHolographicSpace ()
void | Present (ref HolographicFrame frame)
void | RemoveHolographicCamera (HolographicCamera camera)
void | SetHolographicSpace (HolographicSpace holographicSpace)
delegate void | SwapChainAction (Dictionary< uint, CameraResources > cameraResourcesDictionary)
delegate bool | SwapChainActionWithResult (Dictionary< uint, CameraResources > cameraResourcesDictionary)
void | Trim ()
bool | UseHolographicCameraResources (SwapChainActionWithResult callback)
void | UseHolographicCameraResources (SwapChainAction callback)

Public Attributes

SharpDX.Direct2D1.Factory2 | D2DFactory = > d2dFactory
Device3 | D3DDevice = > d3dDevice
DeviceContext3 | D3DDeviceContext = > d3dContext
SharpDX.Direct3D.FeatureLevel | D3DDeviceFeatureLevel = > d3dFeatureLevel
bool | D3DDeviceSupportsVprt = > d3dDeviceSupportsVprt
IDirect3DDevice | D3DInteropDevice = > d3dInteropDevice
SharpDX.DirectWrite.Factory1 | DWriteFactory = > dwriteFactory
SharpDX.DXGI.Adapter3 | DxgiAdapter = > dxgiAdapter
SharpDX.WIC.ImagingFactory2 | WicImagingFactory = > wicFactory

Events

EventHandler | DeviceLost
EventHandler | DeviceRestored

Private Member Functions

void | CreateDeviceIndependentResources ()
void | CreateDeviceResources ()
void | DisposeDeviceAndContext ()

Private Attributes

Dictionary< uint, CameraResources > | cameraResourcesDictionary = new Dictionary<uint, CameraResources>()
Object | cameraResourcesLock = new Object()
SharpDX.Direct2D1.Factory2 | d2dFactory
DeviceContext3 | d3dContext
Device3 | d3dDevice
bool | d3dDeviceSupportsVprt = false
FeatureLevel | d3dFeatureLevel = FeatureLevel.Level_10_0
IDirect3DDevice | d3dInteropDevice
SharpDX.DirectWrite.Factory1 | dwriteFactory
SharpDX.DXGI.Adapter3 | dxgiAdapter
HolographicSpace | holographicSpace = null
SharpDX.WIC.ImagingFactory2 | wicFactory

Detailed Description

Definition at line 14 of file DeviceResources.cs.

Constructor & Destructor Documentation

DeviceResources ( ) [inline]

Constructor for DeviceResources.

Definition at line 52 of file DeviceResources.cs.

        {
            CreateDeviceIndependentResources();
        }

Member Function Documentation

void AddHolographicCamera ( HolographicCamera camera ) [inline]

Prepares to allocate resources and adds resource views for a camera.

Locks the set of holographic camera resources until the function exits.

Definition at line 292 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                cameraResourcesDictionary.Add(camera.Id, new CameraResources(camera));
            });
        }

void CreateDeviceIndependentResources ( ) [inline, private]

Configures resources that don't depend on the Direct3D device.

Definition at line 60 of file DeviceResources.cs.

        {
            // Dispose previous references and set to null
            this.RemoveAndDispose(ref d2dFactory);
            this.RemoveAndDispose(ref dwriteFactory);
            this.RemoveAndDispose(ref wicFactory);

            // Initialize Direct2D resources.
            var debugLevel = SharpDX.Direct2D1.DebugLevel.None;
            #if DEBUG
            if (DirectXHelper.SdkLayersAvailable())
            {
                debugLevel = SharpDX.Direct2D1.DebugLevel.Information;
            }
            #endif

            // Initialize the Direct2D Factory.
            d2dFactory = this.ToDispose(
                new SharpDX.Direct2D1.Factory2(
                    SharpDX.Direct2D1.FactoryType.SingleThreaded,
                    debugLevel
                    )
                );

            // Initialize the DirectWrite Factory.
            dwriteFactory = this.ToDispose(
                new SharpDX.DirectWrite.Factory1(SharpDX.DirectWrite.FactoryType.Shared)
                );

            // Initialize the Windows Imaging Component (WIC) Factory.
            wicFactory = this.ToDispose(
                new SharpDX.WIC.ImagingFactory2()
                );
        }

void CreateDeviceResources ( ) [inline, private]

Configures the Direct3D device, and stores handles to it and the device context.

Definition at line 143 of file DeviceResources.cs.

        {
            DisposeDeviceAndContext();

            // This flag adds support for surfaces with a different color channel ordering
            // than the API default. It is required for compatibility with Direct2D.
            DeviceCreationFlags creationFlags = DeviceCreationFlags.BgraSupport;
            creationFlags |= DeviceCreationFlags.VideoSupport;

#if DEBUG
            if (DirectXHelper.SdkLayersAvailable())
            {
                // If the project is in a debug build, enable debugging via SDK Layers with this flag.
                creationFlags |= DeviceCreationFlags.Debug;
            }
#endif

            // This array defines the set of DirectX hardware feature levels this app will support.
            // Note the ordering should be preserved.
            // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
            // of running on graphics cards starting with feature level 10.0.
            FeatureLevel[] featureLevels =
            {
                FeatureLevel.Level_12_1,
                FeatureLevel.Level_12_0,
                FeatureLevel.Level_11_1,
                FeatureLevel.Level_11_0,
                FeatureLevel.Level_10_1,
                FeatureLevel.Level_10_0
            };
            RasterizerStateDescription rasterDesc = new RasterizerStateDescription()
            {
                FillMode = FillMode.Solid,
                CullMode = CullMode.Back,
                IsFrontCounterClockwise = false,
                DepthBias = 0,
                SlopeScaledDepthBias = 0,
                DepthBiasClamp = 0,
                IsDepthClipEnabled = true,
                IsScissorEnabled = false,
                IsMultisampleEnabled = true,
                IsAntialiasedLineEnabled = true
            };

            // Create the Direct3D 11 API device object and a corresponding context.
            try
            {
                if (null != dxgiAdapter)
                {
                    using (var device = new Device(dxgiAdapter, creationFlags, featureLevels))
                    {
                        // Store pointers to the Direct3D 11.1 API device.
                        d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                    }
                }
                else
                {
                    using (var device = new Device(DriverType.Hardware, creationFlags, featureLevels))
                    {
                        // Store a pointer to the Direct3D device.
                        d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                    }
                }
            }
            catch
            {
                // If the initialization fails, fall back to the WARP device.
                // For more information on WARP, see:
                // http://go.microsoft.com/fwlink/?LinkId=286690
                using (var device = new Device(DriverType.Warp, creationFlags, featureLevels))
                {
                    d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                }
            }

            // Cache the feature level of the device that was created.
            d3dFeatureLevel = d3dDevice.FeatureLevel;

            // Store a pointer to the Direct3D immediate context.
            d3dContext = this.ToDispose(d3dDevice.ImmediateContext3);

            // Acquire the DXGI interface for the Direct3D device.
            using (var dxgiDevice = d3dDevice.QueryInterface<SharpDX.DXGI.Device3>())
            {
                // Wrap the native device using a WinRT interop object.
                IntPtr pUnknown;
                UInt32 hr = InteropStatics.CreateDirect3D11DeviceFromDXGIDevice(dxgiDevice.NativePointer, out pUnknown);
                if (hr == 0)
                {
                    d3dInteropDevice = (IDirect3DDevice)Marshal.GetObjectForIUnknown(pUnknown);
                    Marshal.Release(pUnknown);
                }

                // Store a pointer to the DXGI adapter.
                // This is for the case of no preferred DXGI adapter, or fallback to WARP.
                dxgiAdapter = this.ToDispose(dxgiDevice.Adapter.QueryInterface<SharpDX.DXGI.Adapter3>());
            }

            // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
            var options = d3dDevice.CheckD3D113Features3();
            if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
            {
                d3dDeviceSupportsVprt = true;
            }

            RasterizerState rsState = new RasterizerState(d3dDevice, rasterDesc);
            d3dContext.Rasterizer.State = rsState;
            // Need to multithread for video Playback MF threads
            DeviceMultithread mt = d3dDevice.QueryInterface<SharpDX.Direct3D.DeviceMultithread>();
            mt.SetMultithreadProtected(true);
        }

void DisposeDeviceAndContext ( ) [inline, private]

Disposes of a device-based resources.

Definition at line 258 of file DeviceResources.cs.

        {
            // Dispose existing references to Direct3D 11 device and contxt, and set to null.
            this.RemoveAndDispose(ref d3dDevice);
            this.RemoveAndDispose(ref d3dContext);
            this.RemoveAndDispose(ref dxgiAdapter);

            // Release the interop device.
            d3dInteropDevice = null;
        }

void EnsureCameraResources | ( | HolographicFrame | frame,
 |  | HolographicFramePrediction | prediction |
 | ) |  |  | [inline]

Validates the back buffer for each HolographicCamera and recreates resources for back buffers that have changed.

Locks the set of holographic camera resources until the function exits.

Definition at line 274 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                foreach (var pose in prediction.CameraPoses)
                {
                    var renderingParameters = frame.GetRenderingParameters(pose);
                    var cameraResources = cameraResourcesDictionary[pose.HolographicCamera.Id];

                    cameraResources.CreateResourcesForBackBuffer(this, renderingParameters);
                }
            });
        }

void HandleDeviceLost ( ) [inline]

Recreate all device resources and set them back to the current state.

Locks the set of holographic camera resources until the function exits.

Definition at line 320 of file DeviceResources.cs.

        {
            DeviceLost.Invoke(this, null);

            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                foreach (var pair in cameraResourcesDictionary)
                {
                    CameraResources cameraResources = pair.Value;
                    cameraResources.ReleaseAllDeviceResources(this);
                }
            });

            InitializeUsingHolographicSpace();

            DeviceRestored.Invoke(this, null);
        }

void InitializeUsingHolographicSpace ( ) [inline]

Definition at line 103 of file DeviceResources.cs.

        {
            // The holographic space might need to determine which adapter supports
            // holograms, in which case it will specify a non-zero PrimaryAdapterId.
            int shiftPos = sizeof(uint);
            ulong id = (ulong)holographicSpace.PrimaryAdapterId.LowPart | (((ulong)holographicSpace.PrimaryAdapterId.HighPart) << shiftPos);

            // When a primary adapter ID is given to the app, the app should find
            // the corresponding DXGI adapter and use it to create Direct3D devices
            // and device contexts. Otherwise, there is no restriction on the DXGI
            // adapter the app can use.
            if (id != 0)
            {
                // Create the DXGI factory.
                using (var dxgiFactory4 = new SharpDX.DXGI.Factory4())
                {
                    // Retrieve the adapter specified by the holographic space.
                    IntPtr adapterPtr;
                    dxgiFactory4.EnumAdapterByLuid((long)id, InteropStatics.IDXGIAdapter3, out adapterPtr);

                    if (adapterPtr != IntPtr.Zero)
                    {
                        dxgiAdapter = new SharpDX.DXGI.Adapter3(adapterPtr);
                    }
                }
            }
            else
            {
                this.RemoveAndDispose(ref dxgiAdapter);
            }

            CreateDeviceResources();

            holographicSpace.SetDirect3D11Device(d3dInteropDevice);
        }

void Present ( ref HolographicFrame frame ) [inline]

Present the contents of the swap chain to the screen.

Locks the set of holographic camera resources until the function exits.

Definition at line 356 of file DeviceResources.cs.

        {
            // By default, this API waits for the frame to finish before it returns.
            // Holographic apps should wait for the previous frame to finish before
            // starting work on a new frame. This allows for better results from
            // holographic frame predictions.
            var presentResult = frame.PresentUsingCurrentPrediction(
                HolographicFramePresentWaitBehavior.WaitForFrameToFinish
                );

            // The PresentUsingCurrentPrediction API will detect when the graphics device
            // changes or becomes invalid. When this happens, it is considered a Direct3D
            // device lost scenario.
            if (presentResult == HolographicFramePresentResult.DeviceRemoved)
            {
                // The Direct3D device, context, and resources should be recreated.
                HandleDeviceLost();
            }
        }

void RemoveHolographicCamera ( HolographicCamera camera ) [inline]

Definition at line 302 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                CameraResources cameraResources = cameraResourcesDictionary[camera.Id];

                if (null != cameraResources)
                {
                    cameraResources.ReleaseResourcesForBackBuffer(this);
                    cameraResourcesDictionary.Remove(camera.Id);
                }
            });
        }

void SetHolographicSpace ( HolographicSpace holographicSpace ) [inline]

Definition at line 95 of file DeviceResources.cs.

        {
            // Cache the holographic space. Used to re-initalize during device-lost scenarios.
            this.holographicSpace = holographicSpace;

            InitializeUsingHolographicSpace();
        }

delegate void SwapChainAction ( Dictionary< uint, CameraResources > cameraResourcesDictionary )
delegate bool SwapChainActionWithResult ( Dictionary< uint, CameraResources > cameraResourcesDictionary )
void Trim ( ) [inline]

Call this method when the app suspends.

It provides a hint to the driver that the app is entering an idle state and that temporary buffers can be reclaimed for use by other apps.

Definition at line 342 of file DeviceResources.cs.

        {
            d3dContext.ClearState();

            using (var dxgiDevice = d3dDevice.QueryInterface<SharpDX.DXGI.Device3>())
            {
                dxgiDevice.Trim();
            }
        }

bool UseHolographicCameraResources ( SwapChainActionWithResult callback ) [inline]

Device-based resources for holographic cameras are stored in a std::map.

Access this list by providing a callback to this function, and the std::map will be guarded from add and remove events until the callback returns. The callback is processed immediately and must not contain any nested calls to UseHolographicCameraResources. The callback takes a parameter of type Dictionary<uint, CameraResources> cameraResourcesDictionary through which the list of cameras will be accessed. The callback also returns a boolean result.

Definition at line 388 of file DeviceResources.cs.

        {
            bool success = false;
            lock (cameraResourcesLock)
            {
                success = callback(cameraResourcesDictionary);
            }
            return success;
        }

void UseHolographicCameraResources ( SwapChainAction callback ) [inline]

Device-based resources for holographic cameras are stored in a std::map.

Access this list by providing a callback to this function, and the std::map will be guarded from add and remove events until the callback returns. The callback is processed immediately and must not contain any nested calls to UseHolographicCameraResources. The callback takes a parameter of type Dictionary<uint, CameraResources> cameraResourcesDictionary through which the list of cameras will be accessed.

Definition at line 406 of file DeviceResources.cs.

        {
            lock (cameraResourcesLock)
            {
                callback(cameraResourcesDictionary);
            }
        }

Member Data Documentation

Dictionary<uint, CameraResources> cameraResourcesDictionary = new Dictionary<uint, CameraResources>() [private]

Definition at line 46 of file DeviceResources.cs.

Object cameraResourcesLock = new Object() [private]

Definition at line 47 of file DeviceResources.cs.

SharpDX.Direct2D1.Factory2 d2dFactory [private]

Definition at line 31 of file DeviceResources.cs.

SharpDX.Direct2D1.Factory2 D2DFactory = > d2dFactory

Definition at line 420 of file DeviceResources.cs.

DeviceContext3 d3dContext [private]

Definition at line 24 of file DeviceResources.cs.

Device3 d3dDevice [private]

Definition at line 23 of file DeviceResources.cs.

Device3 D3DDevice = > d3dDevice

Definition at line 416 of file DeviceResources.cs.

DeviceContext3 D3DDeviceContext = > d3dContext

Definition at line 417 of file DeviceResources.cs.

SharpDX.Direct3D.FeatureLevel D3DDeviceFeatureLevel = > d3dFeatureLevel

Definition at line 423 of file DeviceResources.cs.

bool d3dDeviceSupportsVprt = false [private]

Definition at line 43 of file DeviceResources.cs.

bool D3DDeviceSupportsVprt = > d3dDeviceSupportsVprt

Definition at line 424 of file DeviceResources.cs.

FeatureLevel d3dFeatureLevel = FeatureLevel.Level_10_0 [private]

Definition at line 39 of file DeviceResources.cs.

IDirect3DDevice d3dInteropDevice [private]

Definition at line 28 of file DeviceResources.cs.

IDirect3DDevice D3DInteropDevice = > d3dInteropDevice

Definition at line 419 of file DeviceResources.cs.

SharpDX.DirectWrite.Factory1 DWriteFactory = > dwriteFactory

Definition at line 421 of file DeviceResources.cs.

SharpDX.DirectWrite.Factory1 dwriteFactory [private]

Definition at line 32 of file DeviceResources.cs.

SharpDX.DXGI.Adapter3 dxgiAdapter [private]

Definition at line 25 of file DeviceResources.cs.

SharpDX.DXGI.Adapter3 DxgiAdapter = > dxgiAdapter

Definition at line 418 of file DeviceResources.cs.

HolographicSpace holographicSpace = null [private]

Definition at line 36 of file DeviceResources.cs.

SharpDX.WIC.ImagingFactory2 wicFactory [private]

Definition at line 33 of file DeviceResources.cs.

SharpDX.WIC.ImagingFactory2 WicImagingFactory = > wicFactory

Definition at line 422 of file DeviceResources.cs.

Event Documentation

EventHandler DeviceLost

Definition at line 17 of file DeviceResources.cs.

EventHandler DeviceRestored

Definition at line 20 of file DeviceResources.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Common/DeviceResources.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Disposer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • Disposer
Public Member Functions | Protected Member Functions | Properties

Disposer Class Reference

Inherited by CameraResources, DeviceResources, and VideoRenderer.

List of all members.

Public Member Functions

void | Dispose ()

Protected Member Functions

internal | Disposer ()
virtual void | Dispose (bool disposeManagedResources)
internal void | RemoveAndDispose< T > (ref T objectToDispose)
internal void | RemoveToDispose< T > (T objectToRemove)
internal T | ToDispose< T > (T objectToDispose)

Properties

SharpDX.DisposeCollector | DisposeCollector [get, set]
internal bool | IsDisposed [get, set]

Detailed Description

Definition at line 7 of file Disposer.cs.

Constructor & Destructor Documentation

internal Disposer ( ) [inline, protected]

Definition at line 27 of file Disposer.cs.

        {
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 14 of file Disposer.cs.

        {
            if (!IsDisposed)
            {
                Dispose(true);
                IsDisposed = true;
            }
        }

virtual void Dispose ( bool disposeManagedResources ) [inline, protected, virtual]

Definition at line 39 of file Disposer.cs.

        {
            // If the DisposeCollector exists, have it dispose of all COM objects.
            if (!IsDisposed && DisposeCollector != null)
            {
                DisposeCollector.Dispose();
            }

            // The DisposeCollector is done, and can be discarded.
            DisposeCollector = null;
        }

internal void RemoveAndDispose< T > ( ref T objectToDispose ) [inline, protected]
internal void RemoveToDispose< T > ( T objectToRemove ) [inline, protected]
internal T ToDispose< T > ( T objectToDispose ) [inline, protected]

Property Documentation

SharpDX.DisposeCollector DisposeCollector [get, set, private]

Definition at line 99 of file Disposer.cs.

internal bool IsDisposed [get, set, protected]

Definition at line 32 of file Disposer.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Common/Disposer.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InteropStatics::IDirect3DDxgiInterfaceAccess Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • InteropStatics
  • InteropStatics::IDirect3DDxgiInterfaceAccess
Public Member Functions

InteropStatics::IDirect3DDxgiInterfaceAccess Interface Reference

List of all members.

Public Member Functions

IntPtr GetInterface ([In] ref Guid iid)

Detailed Description

Definition at line 36 of file InteropStatics.cs.

Member Function Documentation

IntPtr GetInterface ( [In] ref Guid iid )
The documentation for this interface was generated from the following file:
  • 360VideoPlayback/cs/Common/InteropStatics.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • SpatialInputHandler
Public Member Functions | Private Attributes

SpatialInputHandler Class Reference

List of all members.

Public Member Functions

SpatialInputHandler ()
SpatialInteractionSourceState | CheckForInput ()
void | OnSourcePressed (SpatialInteractionManager sender, SpatialInteractionSourceEventArgs args)

Private Attributes

SpatialInteractionManager | interactionManager
SpatialInteractionSourceState | sourceState

Detailed Description

Definition at line 7 of file SpatialInputHandler.cs.

Constructor & Destructor Documentation

SpatialInputHandler ( ) [inline]

Definition at line 16 of file SpatialInputHandler.cs.

        {
            // The interaction manager provides an event that informs the app when
            // spatial interactions are detected.
            interactionManager = SpatialInteractionManager.GetForCurrentView();

            // Bind a handler to the SourcePressed event.
            interactionManager.SourcePressed += this.OnSourcePressed;

            //
            // TODO: Expand this class to use other gesture-based input events as applicable to
            //       your app.
            //
        }

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( ) [inline]

Definition at line 34 of file SpatialInputHandler.cs.

        {
            SpatialInteractionSourceState sourceState = this.sourceState;
            this.sourceState = null;
            return sourceState;
        }

void OnSourcePressed | ( | SpatialInteractionManager | sender,
 |  | SpatialInteractionSourceEventArgs | args |
 | ) |  |  | [inline]

Definition at line 41 of file SpatialInputHandler.cs.

        {
            sourceState = args.State;

            //
            // TODO: In your app or game engine, rewrite this method to queue
            //       input events in your input class or event handler.
            //
        }

Member Data Documentation

SpatialInteractionManager interactionManager [private]

Definition at line 10 of file SpatialInputHandler.cs.

SpatialInteractionSourceState sourceState [private]

Definition at line 13 of file SpatialInputHandler.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Content/SpatialInputHandler.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StepTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • StepTimer
Public Member Functions | Public Attributes | Properties | Static Private Member Functions | Private Attributes

StepTimer Class Reference

Helper class for animation and simulation timing.

List of all members.

Public Member Functions

StepTimer ()
void | ResetElapsedTime ()
void | Tick (Action update)

Public Attributes

double | ElapsedSeconds = 0> TicksToSeconds(ElapsedTicks)
double | TotalSeconds = 0> TicksToSeconds(TotalTicks)

Properties

long | ElapsedTicks [get, set]
int | FrameCount [get, set]
int | FramesPerSecond = 0 [get, set]
bool | IsFixedTimeStep = 0 [get, set]
double | TargetElapsedSeconds = TicksPerSecond / 60 [get, set]
long | TargetElapsedTicks = false [get, set]
long | TotalTicks [get, set]

Static Private Member Functions

static long | SecondsToTicks (double seconds)
static double | TicksToSeconds (long ticks)

Private Attributes

int | framesThisSecond = 0
long | leftOverTicks = 0
long | qpcFrequency
long | qpcLastTime
long | qpcMaxDelta
long | qpcSecondCounter = 0
const long | TicksPerSecond = 10000000

Detailed Description

Definition at line 9 of file StepTimer.cs.

Constructor & Destructor Documentation

StepTimer ( ) [inline]

Definition at line 26 of file StepTimer.cs.

        {
            qpcFrequency = Stopwatch.Frequency;
            qpcLastTime = Stopwatch.GetTimestamp();

            // Initialize max delta to 1/10 of a second.
            qpcMaxDelta = qpcFrequency / 10;
        }

Member Function Documentation

void ResetElapsedTime ( ) [inline]

After an intentional timing discontinuity (for instance a blocking IO operation) call this to avoid having the fixed timestep logic attempt a set of catch-up Update calls.

Definition at line 40 of file StepTimer.cs.

        {
            qpcLastTime = Stopwatch.GetTimestamp();

            leftOverTicks = 0;
            FramesPerSecond = 0;
            framesThisSecond = 0;
            qpcSecondCounter = 0;
        }

static long SecondsToTicks ( double seconds ) [inline, static, private]

Definition at line 182 of file StepTimer.cs.

        {
            return (long)(seconds * TicksPerSecond);
        }

void Tick ( Action update ) [inline]

Update timer state, calling the specified Update function the appropriate number of times.

Definition at line 102 of file StepTimer.cs.

        {
            // Query the current time.
            long currentTime = Stopwatch.GetTimestamp();

            long timeDelta = currentTime - qpcLastTime;

            qpcLastTime = currentTime;
            qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > qpcMaxDelta)
            {
                timeDelta = qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= qpcFrequency;

            long lastFrameCount = FrameCount;

            if (IsFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (Math.Abs(timeDelta - TargetElapsedTicks) < (TicksPerSecond / 4000))
                {
                    timeDelta = TargetElapsedTicks;
                }

                leftOverTicks += timeDelta;

                while (leftOverTicks >= TargetElapsedTicks)
                {
                    ElapsedTicks = TargetElapsedTicks;
                    TotalTicks += TargetElapsedTicks;
                    leftOverTicks -= TargetElapsedTicks;
                    FrameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                ElapsedTicks = timeDelta;
                TotalTicks += timeDelta;
                leftOverTicks = 0;
                FrameCount++;

                update();
            }

            // Track the current framerate.
            if (FrameCount != lastFrameCount)
            {
                framesThisSecond++;
            }

            if (qpcSecondCounter >= qpcFrequency)
            {
                FramesPerSecond = framesThisSecond;
                framesThisSecond = 0;
                qpcSecondCounter %= qpcFrequency;
            }
        }

static double TicksToSeconds ( long ticks ) [inline, static, private]

Definition at line 177 of file StepTimer.cs.

        {
            return (double)ticks / TicksPerSecond;
        }

Member Data Documentation

double ElapsedSeconds = 0> TicksToSeconds(ElapsedTicks)

Get elapsed time since the previous Update call.

Definition at line 58 of file StepTimer.cs.

int framesThisSecond = 0 [private]

Definition at line 23 of file StepTimer.cs.

long leftOverTicks = 0 [private]

Definition at line 20 of file StepTimer.cs.

long qpcFrequency [private]

Definition at line 15 of file StepTimer.cs.

long qpcLastTime [private]

Definition at line 16 of file StepTimer.cs.

long qpcMaxDelta [private]

Definition at line 17 of file StepTimer.cs.

long qpcSecondCounter = 0 [private]

Definition at line 24 of file StepTimer.cs.

const long TicksPerSecond = 10000000 [private]

Definition at line 12 of file StepTimer.cs.

double TotalSeconds = 0> TicksToSeconds(TotalTicks)

Get total time since the start of the program.

Definition at line 68 of file StepTimer.cs.

Property Documentation

long ElapsedTicks [get, set]

Get elapsed time since the previous Update call.

Definition at line 53 of file StepTimer.cs.

int FrameCount [get, set]

Get total number of updates since start of the program.

Definition at line 73 of file StepTimer.cs.

int FramesPerSecond = 0 [get, set]

Get the current framerate.

Definition at line 78 of file StepTimer.cs.

bool IsFixedTimeStep = 0 [get, set]

Get/Set whether to use fixed or variable timestep mode.

Definition at line 83 of file StepTimer.cs.

double TargetElapsedSeconds = TicksPerSecond / 60 [get, set]

Get/Set how often to call Update when in fixed timestep mode.

Definition at line 94 of file StepTimer.cs.

long TargetElapsedTicks = false [get, set]

Get/Set how often to call Update when in fixed timestep mode.

Definition at line 88 of file StepTimer.cs.

long TotalTicks [get, set]

Get total time since the start of the program.

Definition at line 63 of file StepTimer.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Common/StepTimer.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewProjectionConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Common
  • ViewProjectionConstantBuffer
Public Attributes

ViewProjectionConstantBuffer Struct Reference

Constant buffer used to send hologram position transform to the shader pipeline.

List of all members.

Public Attributes

Matrix4x4 viewProjectionLeft
Matrix4x4 viewProjectionRight

Detailed Description

Definition at line 16 of file CameraResources.cs.

Member Data Documentation

Matrix4x4 viewProjectionLeft

Definition at line 18 of file CameraResources.cs.

Matrix4x4 viewProjectionRight

Definition at line 19 of file CameraResources.cs.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cs/Common/CameraResources.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Content
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

Constant buffer used to send hologram position transform to the shader pipeline.

List of all members.

Public Attributes

Matrix4x4 model

Detailed Description

Definition at line 8 of file ShaderStructures.cs.

Member Data Documentation

Matrix4x4 model

Definition at line 10 of file ShaderStructures.cs.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cs/Content/ShaderStructures.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Content
  • VertexPositionColor
Public Member Functions | Public Attributes

VertexPositionColor Struct Reference

Used to send per-vertex data to the vertex shader.

List of all members.

Public Member Functions

VertexPositionColor (Vector3 pos, Vector3 color)

Public Attributes

Vector3 color
Vector3 pos

Detailed Description

Definition at line 16 of file ShaderStructures.cs.

Constructor & Destructor Documentation

VertexPositionColor | ( | Vector3 | pos,
 |  | Vector3 | color |
 | ) |  |  | [inline]

Definition at line 18 of file ShaderStructures.cs.

        {
            this.pos   = pos;
            this.color = color;
        }

Member Data Documentation

Vector3 color

Definition at line 25 of file ShaderStructures.cs.

Vector3 pos

Definition at line 24 of file ShaderStructures.cs.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cs/Content/ShaderStructures.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionTexture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Content
  • VertexPositionTexture
Public Member Functions | Public Attributes

VertexPositionTexture Struct Reference

List of all members.

Public Member Functions

VertexPositionTexture (Vector3 pos, Vector2 texture)

Public Attributes

Vector3 pos
Vector2 texture

Detailed Description

Definition at line 28 of file ShaderStructures.cs.

Constructor & Destructor Documentation

VertexPositionTexture | ( | Vector3 | pos,
 |  | Vector2 | texture |
 | ) |  |  | [inline]

Definition at line 30 of file ShaderStructures.cs.

        {
            this.pos = pos;
            this.texture = texture;
        }

Member Data Documentation

Vector3 pos

Definition at line 36 of file ShaderStructures.cs.

Vector2 texture

Definition at line 37 of file ShaderStructures.cs.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cs/Content/ShaderStructures.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Content
  • VideoRenderer
Public Member Functions | Private Member Functions | Private Attributes

VideoRenderer Class Reference

This sample renderer instantiates a basic rendering pipeline.

Inherits _360VideoPlayback::Common::Disposer.

List of all members.

Public Member Functions

VideoRenderer (DeviceResources deviceResources)
void | CreateDeviceDependentResourcesAsync ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Update (StepTimer timer)

Private Member Functions

void | ComputeSphere (int tessellation, bool invertn)
void | CreateD3D11Surface ()
async void | LoadShaders ()
void | M_mediaPlayer_VideoFrameAvailable (MediaPlayer sender, object args)
void | XMScalarSinCos (ref float Sin, ref float Cos, float Value)

Private Attributes

IDirect3DSurface | d3dInteropSurface
DeviceResources deviceResources
SharpDX.Direct3D11.GeometryShader | geometryShader
SharpDX.Direct3D11.Buffer | indexBuffer
int | indexCount = 0
SharpDX.Direct3D11.InputLayout | inputLayout
bool | loadingComplete = false
MediaPlayer | m_mediaPlayer
SharpDX.Direct3D11.SamplerState | m_quadTextureSamplerState
SharpDX.Direct3D11.Texture2D | m_texture
SharpDX.Direct3D11.ShaderResourceView | m_textureView
SharpDX.Direct3D11.Buffer | modelConstantBuffer
ModelConstantBuffer modelConstantBufferData
SharpDX.Direct3D11.PixelShader | pixelShader
Object | thisLock = new Object()
bool | usingVprtShaders = false
SharpDX.Direct3D11.Buffer | vertexBuffer
SharpDX.Direct3D11.VertexShader | vertexShader

Detailed Description

Definition at line 13 of file VideoRenderer.cs.

Constructor & Destructor Documentation

VideoRenderer ( DeviceResources deviceResources ) [inline]

Loads vertex and pixel shaders from files and instantiates the cube geometry.

Definition at line 49 of file VideoRenderer.cs.

        {
            this.deviceResources = deviceResources;
            m_mediaPlayer = AppView.mediaPlayer;

        }

Member Function Documentation

void ComputeSphere | ( | int | tessellation,
 |  | bool | invertn |
 | ) |  |  | [inline, private]

Definition at line 303 of file VideoRenderer.cs.

        {
            if (tessellation < 3)
            {
                new Exception("tesselation parameter out of range");
            }

            int verticalSegments = tessellation;
            int horizontalSegments = tessellation * 2;
            int vertCount = (verticalSegments + 1) * (horizontalSegments + 1);
            int idxCount = (verticalSegments) * (horizontalSegments + 1) * 6;

            float radius = 0.5f; // Diameter of the default Sphere will always be 1 to stay aligned

            VertexPositionTexture[] sphereVertArray = new VertexPositionTexture[vertCount];
            int[] cubeIndices = new int[idxCount];

            int writePos = 0;

            for (int i = 0; i <= verticalSegments; i++)
            {
                float v = 1 - (float)i / verticalSegments;

                float latitude = (float)(i * SharpDX.MathUtil.Pi /
                                           verticalSegments) - SharpDX.MathUtil.PiOverTwo;

                var dy = (float)Math.Sin(latitude);
                var dxz = (float)Math.Cos(latitude);

                // Create a single ring of vertices at this latitude.
                for (ushort j = 0; j <= horizontalSegments; j++)
                {
                    float u = (float)j / horizontalSegments;

                    float longitude = (float)(j * SharpDX.MathUtil.TwoPi / horizontalSegments);
                    float dx = (float)Math.Cos(longitude);
                    float dz = (float)Math.Sin(longitude);
                    dx *= dxz;
                    dz *= dxz;

                    Vector3 vect3 = new Vector3(dx, dy, dz);
                    VertexPositionTexture vert;
                    vert.pos = vect3 * radius;
                    vert.texture = new Vector2(u, v);

                    sphereVertArray[writePos] = vert;
                    writePos++;
                }
            }

            // Fill the index buffer with triangles joining each pair of latitude rings.
            int stride = horizontalSegments + 1;
            writePos = 0;
            for (int i = 0; i < verticalSegments; i++)
            {
                for (int j = 0; j <= horizontalSegments; j++)
                {
                    int nextI = i + 1;
                    int nextJ = (j + 1) % stride;

                    cubeIndices[writePos] = i * stride + j;
                    cubeIndices[++writePos] = nextI * stride + j;
                    cubeIndices[++writePos] = i * stride + nextJ;

                    cubeIndices[++writePos] = i * stride + nextJ;
                    cubeIndices[++writePos] = nextI * stride + j;
                    cubeIndices[++writePos] = nextI * stride + nextJ;
                    writePos++;
                }
            }

            vertexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
               deviceResources.D3DDevice,
               SharpDX.Direct3D11.BindFlags.VertexBuffer,
               sphereVertArray));

            indexCount = idxCount;

            indexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
               deviceResources.D3DDevice,
               SharpDX.Direct3D11.BindFlags.IndexBuffer,
               cubeIndices));
        }

void CreateD3D11Surface ( ) [inline, private]

Definition at line 279 of file VideoRenderer.cs.

        {
            SharpDX.DXGI.Surface2 surface = m_texture.QueryInterface<SharpDX.DXGI.Surface2>();
            IntPtr pUnknown;
            UInt32 hr = InteropStatics.CreateDirect3D11SurfaceFromDXGISurface(surface.NativePointer, out pUnknown);

            if (hr == 0)
            {
                d3dInteropSurface = (IDirect3DSurface)Marshal.GetObjectForIUnknown(pUnknown);
                Marshal.Release(pUnknown);
            }

            m_mediaPlayer.VideoFrameAvailable += M_mediaPlayer_VideoFrameAvailable;
            m_mediaPlayer.Play();
        }

void CreateDeviceDependentResourcesAsync ( ) [inline]

Creates device-based resources to store a constant buffer, cube geometry, and vertex and pixel shaders.

In some cases this will also store a geometry shader.

Definition at line 156 of file VideoRenderer.cs.

        {
            ReleaseDeviceDependentResources();

            // Create a constant buffer to store the model matrix.
            modelConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                deviceResources.D3DDevice,
                SharpDX.Direct3D11.BindFlags.ConstantBuffer,
                ref modelConstantBufferData));

            // Create the Texture, ShaderResource and Sampler state
            lock (thisLock)
            {
                m_texture = this.ToDispose(new SharpDX.Direct3D11.Texture2D(deviceResources.D3DDevice, new SharpDX.Direct3D11.Texture2DDescription()
                {
                    Format = SharpDX.DXGI.Format.R8G8B8A8_UNorm,
                    Width = (int)m_mediaPlayer.PlaybackSession.NaturalVideoWidth,//Width
                    Height = (int)m_mediaPlayer.PlaybackSession.NaturalVideoHeight,//Height
                    MipLevels = 1,
                    ArraySize = 1,
                    BindFlags = SharpDX.Direct3D11.BindFlags.ShaderResource | SharpDX.Direct3D11.BindFlags.RenderTarget,
                    Usage = SharpDX.Direct3D11.ResourceUsage.Default,
                    CpuAccessFlags = SharpDX.Direct3D11.CpuAccessFlags.None,
                    SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0),
                    OptionFlags = SharpDX.Direct3D11.ResourceOptionFlags.None
                }));

                m_textureView = this.ToDispose(new SharpDX.Direct3D11.ShaderResourceView(deviceResources.D3DDevice, m_texture));
            }

            m_quadTextureSamplerState = this.ToDispose(new SharpDX.Direct3D11.SamplerState(deviceResources.D3DDevice, new SharpDX.Direct3D11.SamplerStateDescription()
            {
                Filter = SharpDX.Direct3D11.Filter.Anisotropic,
                AddressU = SharpDX.Direct3D11.TextureAddressMode.Clamp,
                AddressV = SharpDX.Direct3D11.TextureAddressMode.Clamp,
                AddressW = SharpDX.Direct3D11.TextureAddressMode.Clamp,
                MaximumAnisotropy = 3,
                MinimumLod = 0,
                MaximumLod = 3,
                MipLodBias = 0,
                BorderColor = new SharpDX.Mathematics.Interop.RawColor4(0, 0, 0, 0),
                ComparisonFunction = SharpDX.Direct3D11.Comparison.Never
            }));

            CreateD3D11Surface();
            LoadShaders();
        }

async void LoadShaders ( ) [inline, private]

Definition at line 205 of file VideoRenderer.cs.

        {
            usingVprtShaders = deviceResources.D3DDeviceSupportsVprt;
            // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
            // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
            // we can avoid using a pass-through geometry shader to set the render
            // target array index, thus avoiding any overhead that would be
            // incurred by setting the geometry shader stage.
            var vertexShaderFileName = usingVprtShaders ? "Content\\Shaders\\VPRTVertexShader.cso" : "Content\\Shaders\\VertexShader.cso";
            var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
            // Load the compiled vertex shader.
            var vertexShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync(vertexShaderFileName));

            // After the vertex shader file is loaded, create the shader and input layout.
            vertexShader = this.ToDispose(new SharpDX.Direct3D11.VertexShader(
                deviceResources.D3DDevice,
                vertexShaderByteCode));

            SharpDX.Direct3D11.InputElement[] vertexDesc =
            {
                new SharpDX.Direct3D11.InputElement("POSITION", 0, SharpDX.DXGI.Format.R32G32B32_Float,  0, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
                new SharpDX.Direct3D11.InputElement("TEXCOORD", 1, SharpDX.DXGI.Format.R32G32_Float, 12, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
            };

            inputLayout = this.ToDispose(new SharpDX.Direct3D11.InputLayout(
                deviceResources.D3DDevice,
                vertexShaderByteCode,
                vertexDesc));

            if (!usingVprtShaders)
            {
                // Load the compiled pass-through geometry shader.
                var geometryShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\GeometryShader.cso"));

                // After the pass-through geometry shader file is loaded, create the shader.
                geometryShader = this.ToDispose(new SharpDX.Direct3D11.GeometryShader(
                    deviceResources.D3DDevice,
                    geometryShaderByteCode));
            }

            // Load the compiled pixel shader.
            var pixelShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\PixelShader.cso"));

            // After the pixel shader file is loaded, create the shader.
            pixelShader = this.ToDispose(new SharpDX.Direct3D11.PixelShader(
                deviceResources.D3DDevice,
                pixelShaderByteCode));

            ComputeSphere(16, true);
            // Once the cube is loaded, the object is ready to be rendered.
            loadingComplete = true;
        }

void M_mediaPlayer_VideoFrameAvailable | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 295 of file VideoRenderer.cs.

        {
            lock (thisLock)
            {
                m_mediaPlayer.CopyFrameToVideoSurface(d3dInteropSurface);
            }
        }

void ReleaseDeviceDependentResources ( ) [inline]

Releases device-based resources.

Definition at line 263 of file VideoRenderer.cs.

        {
            loadingComplete = false;
            usingVprtShaders = false;
            this.RemoveAndDispose(ref vertexShader);
            this.RemoveAndDispose(ref inputLayout);
            this.RemoveAndDispose(ref pixelShader);
            this.RemoveAndDispose(ref geometryShader);
            this.RemoveAndDispose(ref modelConstantBuffer);
            this.RemoveAndDispose(ref vertexBuffer);
            this.RemoveAndDispose(ref indexBuffer);
            this.RemoveAndDispose(ref m_texture);
            this.RemoveAndDispose(ref m_textureView);
            this.RemoveAndDispose(ref m_quadTextureSamplerState);
        }

void Render ( ) [inline]

Renders one frame using the vertex and pixel shaders.

On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3:: VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature, a pass-through geometry shader is also used to set the render target array index.

Definition at line 87 of file VideoRenderer.cs.

        {
            // Loading is asynchronous. Resources must be created before drawing can occur.
            if (!this.loadingComplete)
            {
                return;
            }

            var context = this.deviceResources.D3DDeviceContext;

            // Each vertex is one instance of the VertexPositionColor struct.
            int stride = SharpDX.Utilities.SizeOf<VertexPositionTexture>();
            int offset = 0;
            var bufferBinding = new SharpDX.Direct3D11.VertexBufferBinding(this.vertexBuffer, stride, offset);
            context.InputAssembler.SetVertexBuffers(0, bufferBinding);
            context.InputAssembler.SetIndexBuffer(
                this.indexBuffer,
                SharpDX.DXGI.Format.R32_UInt, // Each index is one 16-bit unsigned integer (short).
                0);
            context.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList;
            context.InputAssembler.InputLayout = this.inputLayout;

            // Attach the vertex shader.
            context.VertexShader.SetShader(this.vertexShader, null, 0);
            // Apply the model constant buffer to the vertex shader.
            context.VertexShader.SetConstantBuffers(0, this.modelConstantBuffer);

            if (!this.usingVprtShaders)
            {
                // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
                // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
                // a pass-through geometry shader is used to set the render target
                // array index.
                context.GeometryShader.SetShader(this.geometryShader, null, 0);
            }
            else
            {
                // Make sure that there is no geometry shader bound to the graphics
                // pipeline on devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
                // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature.
                context.GeometryShader.SetShader(null, null, 0);
            }

            // Attach the pixel shader.
            context.PixelShader.SetShader(this.pixelShader, null, 0);

            lock (thisLock)
            {

                context.PixelShader.SetShaderResources(0, 1, m_textureView);

                context.PixelShader.SetSamplers(0, 1, m_quadTextureSamplerState);

                // Draw the objects.
                context.DrawIndexedInstanced(
                    indexCount,     // Index count per instance.
                    2,              // Instance count.
                    0,              // Start index location.
                    0,              // Base vertex location.
                    0               // Start instance location.
                    );
            }
        }

void Update ( StepTimer timer ) [inline]

Called once per frame, rotates the cube and calculates the model and view matrices.

Definition at line 59 of file VideoRenderer.cs.

        {
            Vector3 scale = new Vector3(10.0f);
            Matrix4x4 modelscale = Matrix4x4.CreateScale(scale);

            // Here, we provide the model transform for the sample hologram. The model transform
            // matrix is transposed to prepare it for the shader.
            this.modelConstantBufferData.model = Matrix4x4.Transpose(modelscale);
            // Loading is asynchronous. Resources must be created before they can be updated.
            if (!loadingComplete)
            {
                return;
            }

            // Use the D3D device context to update Direct3D device-based resources.
            var context = this.deviceResources.D3DDeviceContext;

            // Update the model transform buffer for the hologram.
            context.UpdateSubresource(ref this.modelConstantBufferData, this.modelConstantBuffer);
        }

void XMScalarSinCos | ( | ref float | Sin,
 |  | ref float | Cos,
 |  | float | Value |
 | ) |  |  | [inline, private]

Definition at line 388 of file VideoRenderer.cs.

        {
            const float XM1div2PI = 0.159154943f;
            // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder.
            float quotient = XM1div2PI * Value;
            if (Value >= 0.0f)
            {
                quotient = (float)((int)(quotient + 0.5f));
            }
            else
            {
                quotient = (float)((int)(quotient - 0.5f));
            }
            float y = Value - SharpDX.MathUtil.TwoPi * quotient;

            // Map y to [-pi/2,pi/2] with sin(y) = sin(Value).
            float sign;
            if (y > SharpDX.MathUtil.PiOverTwo)
            {
                y = SharpDX.MathUtil.Pi - y;
                sign = -1.0f;
            }
            else if (y < -(SharpDX.MathUtil.PiOverTwo))
            {
                y = -(SharpDX.MathUtil.Pi) - y;
                sign = -1.0f;
            }
            else
            {
                sign = +1.0f;
            }

            float y2 = y * y;

            // 11-degree minimax approximation
            Sin = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y;

            // 10-degree minimax approximation
            float p = (float)((float)((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f);

            Cos = sign * p;
        }

Member Data Documentation

IDirect3DSurface d3dInteropSurface [private]

Definition at line 30 of file VideoRenderer.cs.

DeviceResources deviceResources [private]

Definition at line 16 of file VideoRenderer.cs.

SharpDX.Direct3D11.GeometryShader geometryShader [private]

Definition at line 23 of file VideoRenderer.cs.

SharpDX.Direct3D11.Buffer indexBuffer [private]

Definition at line 21 of file VideoRenderer.cs.

int indexCount = 0 [private]

Definition at line 34 of file VideoRenderer.cs.

SharpDX.Direct3D11.InputLayout inputLayout [private]

Definition at line 19 of file VideoRenderer.cs.

bool loadingComplete = false [private]

Definition at line 37 of file VideoRenderer.cs.

MediaPlayer m_mediaPlayer [private]

Definition at line 43 of file VideoRenderer.cs.

SharpDX.Direct3D11.SamplerState m_quadTextureSamplerState [private]

Definition at line 29 of file VideoRenderer.cs.

SharpDX.Direct3D11.Texture2D m_texture [private]

Definition at line 27 of file VideoRenderer.cs.

SharpDX.Direct3D11.ShaderResourceView m_textureView [private]

Definition at line 28 of file VideoRenderer.cs.

SharpDX.Direct3D11.Buffer modelConstantBuffer [private]

Definition at line 25 of file VideoRenderer.cs.

ModelConstantBuffer modelConstantBufferData [private]

Definition at line 33 of file VideoRenderer.cs.

SharpDX.Direct3D11.PixelShader pixelShader [private]

Definition at line 24 of file VideoRenderer.cs.

Object thisLock = new Object() [private]

Definition at line 44 of file VideoRenderer.cs.

bool usingVprtShaders = false [private]

Definition at line 41 of file VideoRenderer.cs.

SharpDX.Direct3D11.Buffer vertexBuffer [private]

Definition at line 20 of file VideoRenderer.cs.

SharpDX.Direct3D11.VertexShader vertexShader [private]

Definition at line 22 of file VideoRenderer.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Content/VideoRenderer.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FocusPointConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • FocusPointConstantBuffer
Public Attributes

FocusPointConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | focusPointColor
DirectX::XMFLOAT4 | focusPointDirection
DirectX::XMFLOAT4 | focusPointIntensity
DirectX::XMFLOAT4 | focusPointOrigin
DirectX::XMFLOAT4 | focusPointRadius

Detailed Description

Definition at line 22 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 focusPointColor

Definition at line 26 of file ShaderStructures.h.

DirectX::XMFLOAT4 focusPointDirection

Definition at line 25 of file ShaderStructures.h.

DirectX::XMFLOAT4 focusPointIntensity

Definition at line 28 of file ShaderStructures.h.

DirectX::XMFLOAT4 focusPointOrigin

Definition at line 24 of file ShaderStructures.h.

DirectX::XMFLOAT4 focusPointRadius

Definition at line 27 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Helpers
Static Public Member Functions | Static Private Member Functions

Helpers Class Reference

List of all members.

Static Public Member Functions

static Quaternion | CreateFromHeadingPitchRoll (double heading, double pitch, double roll)

Static Private Member Functions

static double | DegreetoRadians (double degree)

Detailed Description

Definition at line 5 of file Helpers.cs.

Member Function Documentation

static Quaternion CreateFromHeadingPitchRoll | ( | double | heading,
 |  | double | pitch,
 |  | double | roll |
 | ) |  |  | [inline, static]

Definition at line 7 of file Helpers.cs.

        {
            Quaternion result;
            double headingPart = DegreetoRadians(heading) * 0.5;
            double sin1 = System.Math.Sin(headingPart);
            double cos1 = System.Math.Cos(headingPart);

            double pitchPart = DegreetoRadians(-pitch) * 0.5;
            double sin2 = System.Math.Sin(pitchPart);
            double cos2 = System.Math.Cos(pitchPart);

            double rollPart = DegreetoRadians(roll) * 0.5;
            double sin3 = System.Math.Sin(rollPart);
            double cos3 = System.Math.Cos(rollPart);

            result.W = (float)(cos1 * cos2 * cos3 - sin1 * sin2 * sin3);
            result.X = (float)(cos1 * cos2 * sin3 + sin1 * sin2 * cos3);
            result.Y = (float)(sin1 * cos2 * cos3 + cos1 * sin2 * sin3);
            result.Z = (float)(cos1 * sin2 * cos3 - sin1 * cos2 * sin3);

            return result;
        }

static double DegreetoRadians ( double degree ) [inline, static, private]

Definition at line 30 of file Helpers.cs.

        {
            return degree * System.Math.PI / 180.0;
        }

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Helpers.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • MainPage
Public Member Functions | Private Member Functions

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()

Private Member Functions

void | goBack (object sender, BackRequestedEventArgs e)
void | MainPage_BackRequested (object sender, BackRequestedEventArgs e)

Detailed Description

Definition at line 11 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 13 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();
            SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
            this.contentFrame.Navigate(typeof(VideoGallery));
        }

Member Function Documentation

void goBack | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file MainPage.xaml.cs.

        {
            if (this.contentFrame.CanGoBack)
            {
                this.contentFrame.GoBack();
                e.Handled = true;
            }
        }

void MainPage_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file MainPage.xaml.cs.

        {
            goBack(null, e);
        }

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/MainPage.xaml.cs
  • 360VideoPlayback/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTransportControls Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • MediaTransportControls
Public Member Functions | Private Member Functions | Private Attributes

MediaTransportControls Class Reference

#include "MediaTransportControls.h"

List of all members.

Public Member Functions

MediaTransportControls ()
void | ApplyShaders ()
void | Hide ()
void | Initialize ()
bool | IsFocused ()
bool | IsVisible ()
void | PerformPressedAction ()
void | Render ()
void | Show (Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose, float distance)
void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose)

Private Member Functions

void | AddExitButton ()
void | AddPlayPauseButton ()
void | AddSeekbar ()
Windows::Foundation::Numerics::float4 | ComputeLookAtQuaternion (Windows::Foundation::Numerics::float3 objectPosition, Windows::Foundation::Numerics::float3 targetPosition, Windows::Foundation::Numerics::float3 upVector)

Private Attributes

std::list< std::shared_ptr
< BaseControl > > 		m_baseControls
std::shared_ptr< BaseControl > | m_exitButtonControl
float | m_inactiveSecondsCounter = 0.0f
bool | m_isVisible
std::shared_ptr< BaseControl > | m_playPauseButtonControl
Windows::Foundation::Numerics::float3 m_position
Windows::Foundation::Numerics::float4 m_rotation
std::shared_ptr< BaseControl > | m_seekbarControl
bool | m_shadersLoaded
Windows::Foundation::Numerics::float4x4 m_transform

Detailed Description

Definition at line 13 of file MediaTransportControls.h.

Constructor & Destructor Documentation

MediaTransportControls ( )

Definition at line 27 of file MediaTransportControls.cpp.

{
    m_isVisible = false;
    m_rotation = float4(0, 0, 0, 0);
    m_position = float3(0, 0, 0);
    m_shadersLoaded = false;
    m_transform = float4x4::identity();
}

Member Function Documentation

void AddExitButton ( ) [private]

Definition at line 82 of file MediaTransportControls.cpp.

{
    // Exit button element
    auto exitButtonElement = std::make_shared<ExitButton>();
    exitButtonElement->ArrangeElements();
    exitButtonElement->Initialize();

    // Exit button control
    m_exitButtonControl = std::make_shared<BaseControl>();
    m_exitButtonControl->SetScale(EXITBUTTON_SCALE);
    m_exitButtonControl->SetPosition(EXITBUTTON_POSITION);
    m_exitButtonControl->SnapInitialSizeToRootElement();
    m_exitButtonControl->SetRenderElement(exitButtonElement);
    m_exitButtonControl->Initialize();

    m_baseControls.push_back(m_exitButtonControl);
}

void AddPlayPauseButton ( ) [private]

Definition at line 43 of file MediaTransportControls.cpp.

{
    auto playPauseButtonElement = std::make_shared<PlayPauseButton>(PLAYPAUSE_CONTAINER_SIZE, PLAYPAUSE_TEXT_SIZE);
    playPauseButtonElement->Initialize();

    // Play/pause button control
    m_playPauseButtonControl = std::make_shared<BaseControl>(MeshGeometry::MakeTexturedCylinder(PLAYPAUSE_TESSELATION));
    m_playPauseButtonControl->SetScale(PLAYPAUSE_SCALE);
    m_playPauseButtonControl->SetPosition(PLAYPAUSE_POSITION);
    m_playPauseButtonControl->SnapInitialSizeToRootElement();
    m_playPauseButtonControl->SetRenderElement(playPauseButtonElement);
    m_playPauseButtonControl->Initialize();
    m_baseControls.push_back(m_playPauseButtonControl);
}

void AddSeekbar ( ) [private]

Definition at line 58 of file MediaTransportControls.cpp.

{
    auto seekBarStripSize = float2(300.0f, 50.0f);

    auto seekbarElement = std::make_shared<SeekBarElement>(
        static_cast<float>(seekBarStripSize.x),
        static_cast<float>(seekBarStripSize.y),
        static_cast<float>(seekBarStripSize.x) * 0.05f, /*left/right padding*/
        static_cast<float>(seekBarStripSize.y) * 0.44f /*bottom/top padding*/);

    seekbarElement->Initialize();
    seekbarElement->SetTranslation(float2(0.0f, static_cast<FLOAT>(seekBarStripSize.y) - seekbarElement->GetElementSize().y));

    m_seekbarControl = std::make_shared<BaseControl>();
    m_seekbarControl->SetTextureWidth(static_cast<UINT>(seekBarStripSize.x));
    m_seekbarControl->SetTextureHeight(static_cast<UINT>(seekBarStripSize.y));
    m_seekbarControl->SetScale(float3(0.25f, 0.25f, 0.25f));
    m_seekbarControl->SetPosition(SEEKBAR_POSITION);
    m_seekbarControl->SetRenderElement(seekbarElement);
    m_seekbarControl->Initialize();

    m_baseControls.push_back(m_seekbarControl);
}

void ApplyShaders ( )

Definition at line 185 of file MediaTransportControls.cpp.

{
    for (const auto& control : m_baseControls)
    {
        control->ApplyShaders();
    }
    m_shadersLoaded = true;
}

Windows::Foundation::Numerics::float4 ComputeLookAtQuaternion | ( | Windows::Foundation::Numerics::float3 | objectPosition,
 |  | Windows::Foundation::Numerics::float3 | targetPosition,
 |  | Windows::Foundation::Numerics::float3 | upVector |
 | ) |  |  | [inline, private]

Definition at line 33 of file MediaTransportControls.h.

        {
            // The Windows::Foundation::Numerics::make_float4x4_look_at() and DirectX::XMLookAtRH() functions are both designed to compute ViewProjection Matrices
            // View Projection Matrices are typically the inverse of the Camera's transform matrices and are used to convert vertices from World space to View space
            // To "fix" this for our application of pointing models at things, we just need to inverse the resulting ViewProjection from your inputs.
            // You can also roll your own vector math to just compute the rotation directly, but we'll stick with the platform calls for now since the inverse call is a minor tax.
            Windows::Foundation::Numerics::float4x4 lookAtViewMatrix = Windows::Foundation::Numerics::make_float4x4_look_at(targetPosition, objectPosition, upVector);
            Windows::Foundation::Numerics::quaternion worldSpaceLookAtQuaternion = Windows::Foundation::Numerics::inverse(Windows::Foundation::Numerics::make_quaternion_from_rotation_matrix(lookAtViewMatrix));
            return Windows::Foundation::Numerics::float4(worldSpaceLookAtQuaternion.x, worldSpaceLookAtQuaternion.y, worldSpaceLookAtQuaternion.z, worldSpaceLookAtQuaternion.w);
        };

void Hide ( )

Definition at line 175 of file MediaTransportControls.cpp.

{
    m_isVisible = false;
    for (const auto& control : m_baseControls)
    {
        control->SetIsVisible(false);
    }
    m_inactiveSecondsCounter = 0.0f;
}

void Initialize ( )

Definition at line 36 of file MediaTransportControls.cpp.

{
    this->AddPlayPauseButton();
    this->AddSeekbar();
    this->AddExitButton();
}

bool IsFocused ( )

Definition at line 194 of file MediaTransportControls.cpp.

{
    for (const auto& control : m_baseControls)
    {
        if (control->IsFocused())
        {
            return true;
        }
    }
    return false;
}

bool IsVisible ( ) [inline]

Definition at line 26 of file MediaTransportControls.h.

{ return m_isVisible; };

void PerformPressedAction ( )

Definition at line 142 of file MediaTransportControls.cpp.

{
    bool pressedFocusedElement = false;
    for (const auto& control : m_baseControls)
    {
        if (control->IsFocused())
        {
            control->PerformPressedAction();
            pressedFocusedElement = true;
            break;
        }
    }

    if (!pressedFocusedElement)
    {
        Hide();
    }
}

void Render ( )

Definition at line 131 of file MediaTransportControls.cpp.

{
    if (m_isVisible && m_shadersLoaded)
    {
        for (const auto& control : m_baseControls)
        {
            control->Render();
        }
    }
}

void Show | ( | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose,
 |  | float | distance
 | ) |  |
void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose
 | ) |  |

Member Data Documentation

std::list<std::shared_ptr<BaseControl> > m_baseControls [private]

Definition at line 45 of file MediaTransportControls.h.

std::shared_ptr<BaseControl> m_exitButtonControl [private]

Definition at line 42 of file MediaTransportControls.h.

float m_inactiveSecondsCounter = 0.0f [private]

Definition at line 29 of file MediaTransportControls.h.

bool m_isVisible [private]

Definition at line 48 of file MediaTransportControls.h.

std::shared_ptr<BaseControl> m_playPauseButtonControl [private]

Definition at line 46 of file MediaTransportControls.h.

Windows::Foundation::Numerics::float3 m_position [private]

Definition at line 51 of file MediaTransportControls.h.

Windows::Foundation::Numerics::float4 m_rotation [private]

Definition at line 50 of file MediaTransportControls.h.

std::shared_ptr<BaseControl> m_seekbarControl [private]

Definition at line 47 of file MediaTransportControls.h.

bool m_shadersLoaded [private]

Definition at line 49 of file MediaTransportControls.h.

Windows::Foundation::Numerics::float4x4 m_transform [private]

Definition at line 52 of file MediaTransportControls.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Content/MediaTransportControls.h
  • 360VideoPlayback/cpp/Content/MediaTransportControls.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4X4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • PlaybackPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

PlaybackPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

PlaybackPage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

bool | IsMediaAlreadyOpened ()
void | MediaPlayer_MediaOpened (MediaPlayer sender, object args)
void | OnKeyDown (CoreWindow sender, KeyEventArgs args)
void | OnPointerMoved (object sender, PointerRoutedEventArgs e)
void | OnPointerPressed (object sender, PointerRoutedEventArgs e)
void | OnPointerReleased (object sender, PointerRoutedEventArgs e)
void | OnPointerWheelChanged (object sender, PointerRoutedEventArgs e)
void | PlaybackPage_LayoutUpdated (object sender, object e)
void | PlaybackSession_PlaybackStateChanged (MediaPlaybackSession sender, object args)
void | ResetState ()
void | StartInputLoop ()

Private Attributes

Gamepad | activeGamePad = null
double | centerX = 0
double | centerY = 0
double | heading = 0
bool | isPointerPress = false
IAsyncAction | m_inputLoopWorker = null
MediaPlayer | mediaPlayer
const int | mouseWheelData = 120
Grid | mtcGrid = null
double | pitch = 0
double | rotationdelta = 1.8f
const int | scrollStep = 2
const double | THUMBSTICK_DEADZONE = 0.25f
StepTimer | timer = new StepTimer()
MediaPlaybackSphericalVideoProjection | videoProjection
WorkItemHandler | workItemHandler

Detailed Description

Definition at line 23 of file PlaybackPage.xaml.cs.

Constructor & Destructor Documentation

PlaybackPage ( ) [inline]

Definition at line 43 of file PlaybackPage.xaml.cs.

        {
            this.InitializeComponent();
            this.LayoutUpdated += PlaybackPage_LayoutUpdated;
        }

Member Function Documentation

bool IsMediaAlreadyOpened ( ) [inline, private]

Definition at line 222 of file PlaybackPage.xaml.cs.

        {
            if (mediaPlayer != null && videoProjection != null &&
                mediaPlayer.PlaybackSession.PlaybackState != MediaPlaybackState.Opening &&
                mediaPlayer.PlaybackSession.PlaybackState != MediaPlaybackState.None)
            {
                return true;
            }
            return false;
        }

void MediaPlayer_MediaOpened | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 194 of file PlaybackPage.xaml.cs.

        {
            videoProjection = mediaPlayer.PlaybackSession.SphericalVideoProjection;
            Windows.Media.MediaProperties.SphericalVideoFrameFormat videoFormat = videoProjection.FrameFormat;
            // Some times Content metadata doesn't provided correct format. Try to force the equirectangular format, if doesn't match
            if (videoFormat != Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular)
            {
                videoProjection.FrameFormat = Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular;
            }
            videoProjection.IsEnabled = true;
            videoProjection.HorizontalFieldOfViewInDegrees = 120;
            mediaPlayer.PlaybackSession.PlaybackStateChanged += PlaybackSession_PlaybackStateChanged;

            StartInputLoop();
        }

void OnKeyDown | ( | CoreWindow | sender,
 |  | KeyEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 85 of file PlaybackPage.xaml.cs.

        {
            if (IsMediaAlreadyOpened())
            {
                bool isMTCEnabled = VideoElement.AreTransportControlsEnabled;

                if (args.VirtualKey == VirtualKey.Up)
                {
                    pitch = pitch + 0.5;
                    videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(heading, pitch, 0);
                }
                if (args.VirtualKey == VirtualKey.Down)
                {
                    pitch = pitch - 0.5;
                    videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(heading, pitch, 0);
                }
                if (args.VirtualKey == VirtualKey.Right)
                {
                    heading = heading + 0.5;
                    videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(heading, pitch, 0);
                }
                if (args.VirtualKey == VirtualKey.Left)
                {
                    heading = heading - 0.5;
                    videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(heading, pitch, 0);
                }
                if (args.VirtualKey == VirtualKey.GamepadA)
                {
                    if (!isMTCEnabled)
                    {
                        VideoElement.AreTransportControlsEnabled = true;
                        m_inputLoopWorker.Cancel();
                        args.Handled = true;
                    }

                }
                if (args.VirtualKey == VirtualKey.GamepadB)
                {
                    if (isMTCEnabled)
                    {
                        VideoElement.AreTransportControlsEnabled = false;
                        StartInputLoop();
                        args.Handled = true;
                    }
                }
                if (args.VirtualKey == VirtualKey.GamepadLeftTrigger)
                {
                    double value = videoProjection.HorizontalFieldOfViewInDegrees + 2;

                    if (value <= 180)
                    {
                        videoProjection.HorizontalFieldOfViewInDegrees = value;
                    }
                    args.Handled = true;
                }
                if (args.VirtualKey == VirtualKey.GamepadRightTrigger)
                {
                    double value = videoProjection.HorizontalFieldOfViewInDegrees - 2;

                    if (value > 0)
                    {
                        videoProjection.HorizontalFieldOfViewInDegrees = value;
                    }
                    args.Handled = true;
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 240 of file PlaybackPage.xaml.cs.

        {
            if (mediaPlayer != null)
            {
                mediaPlayer.PlaybackSession.PlaybackStateChanged -= PlaybackSession_PlaybackStateChanged;
                mediaPlayer.MediaOpened -= MediaPlayer_MediaOpened;
            }
            if (mtcGrid != null)
            {
                mtcGrid.PointerPressed -= OnPointerPressed;
                mtcGrid.PointerReleased -= OnPointerReleased;
                mtcGrid.PointerWheelChanged -= OnPointerWheelChanged;
                VideoElement.PointerPressed -= OnPointerPressed;
                VideoElement.PointerReleased -= OnPointerReleased;
                VideoElement.PointerMoved -= OnPointerMoved;
                VideoElement.PointerWheelChanged -= OnPointerWheelChanged;
                Window.Current.CoreWindow.KeyDown -= OnKeyDown;
            }

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            mediaPlayer.Source = null;
            VideoElement.SetMediaPlayer(null);
            mediaPlayer = null;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 179 of file PlaybackPage.xaml.cs.

        {
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;

            Uri sourceUri = (Uri)e.Parameter;
            if (sourceUri != null)
            {
                mediaPlayer = new MediaPlayer();
                MediaSource source = MediaSource.CreateFromUri(sourceUri);
                mediaPlayer.Source = source;
                mediaPlayer.MediaOpened += MediaPlayer_MediaOpened;
                VideoElement.SetMediaPlayer(mediaPlayer);
            }
        }

void OnPointerMoved | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 153 of file PlaybackPage.xaml.cs.

        {
            if (e.OriginalSource != mtcGrid && isPointerPress)
            {
                double ChangeX = e.GetCurrentPoint(VideoElement).Position.X - centerX;
                double ChangeY = centerY - e.GetCurrentPoint(VideoElement).Position.Y;
                videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(ChangeX, ChangeY, 0);
            }
            e.Handled = true;
        }

void OnPointerPressed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 170 of file PlaybackPage.xaml.cs.

        {
            if (e.OriginalSource != mtcGrid && IsMediaAlreadyOpened())
            {
                isPointerPress = true;
            }
            e.Handled = true;
        }

void OnPointerReleased | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 164 of file PlaybackPage.xaml.cs.

        {
            ResetState();
            e.Handled = true;
        }

void OnPointerWheelChanged | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file PlaybackPage.xaml.cs.

        {
            if (e.OriginalSource != mtcGrid)
            {
                double value = videoProjection.HorizontalFieldOfViewInDegrees +
                    (scrollStep * e.GetCurrentPoint(VideoElement).Properties.MouseWheelDelta / mouseWheelData);
                if (value > 0 && value <= 180)
                {
                    videoProjection.HorizontalFieldOfViewInDegrees = value;
                }
            }
            e.Handled = true;
        }

void PlaybackPage_LayoutUpdated | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file PlaybackPage.xaml.cs.

        {
            centerX = VideoElement.ActualWidth / 2;
            centerY = VideoElement.ActualHeight / 2;
            if (mtcGrid == null)
            {
                FrameworkElement transportControlsTemplateRoot = (FrameworkElement)VisualTreeHelper.GetChild(VideoElement.TransportControls, 0);
                if (transportControlsTemplateRoot != null)
                {
                    mtcGrid = (Grid)transportControlsTemplateRoot.FindName("ControlPanelGrid");
                    mtcGrid.PointerPressed += OnPointerPressed;
                    mtcGrid.PointerReleased += OnPointerReleased;
                    mtcGrid.PointerWheelChanged += OnPointerWheelChanged;
                    VideoElement.PointerPressed += OnPointerPressed;
                    VideoElement.PointerReleased += OnPointerReleased;
                    VideoElement.PointerMoved += OnPointerMoved;
                    VideoElement.PointerWheelChanged += OnPointerWheelChanged;
                    Window.Current.CoreWindow.KeyDown += OnKeyDown;
                }
            }
        }

void PlaybackSession_PlaybackStateChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 210 of file PlaybackPage.xaml.cs.

        {
            if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
            {
                rotationdelta = 1.8f;
            }
            else
            {
                rotationdelta = 0.25f;
            }
        }

void ResetState ( ) [inline, private]

Definition at line 233 of file PlaybackPage.xaml.cs.

        {
            isPointerPress = false;
            pitch = 0;
            heading = 0;
        }

void StartInputLoop ( ) [inline, private]

Definition at line 265 of file PlaybackPage.xaml.cs.

        {
            // If the animation render loop is already running then do not start another thread.
            if (m_inputLoopWorker != null)
            {
                if (m_inputLoopWorker.Status == AsyncStatus.Started)
                {
                    return;
                }
                else
                {
                    m_inputLoopWorker.Close();
                }
            }

            workItemHandler = new WorkItemHandler((IAsyncAction action) =>
            {
                while (action.Status == AsyncStatus.Started)
                {
                    var gamepads = Gamepad.Gamepads;
                    if (gamepads.Count > 0 && activeGamePad == null)
                    {
                        // Get the Zero based first Gamepad
                        activeGamePad = gamepads[0];
                    }

                    if (activeGamePad != null)
                    {
                        timer.Tick(() =>
                        {
                            GamepadReading reading = activeGamePad.GetCurrentReading();
                            double deltax;
                            if (reading.LeftThumbstickX > THUMBSTICK_DEADZONE || reading.LeftThumbstickX < -THUMBSTICK_DEADZONE)
                            {
                                deltax = reading.LeftThumbstickX * reading.LeftThumbstickX * reading.LeftThumbstickX;
                            }
                            else
                            {
                                deltax = 0.0f;
                            }
                            double deltay;
                            if (reading.LeftThumbstickY > THUMBSTICK_DEADZONE || reading.LeftThumbstickY < -THUMBSTICK_DEADZONE)
                            {
                                deltay = reading.LeftThumbstickY * reading.LeftThumbstickY * reading.LeftThumbstickY;
                            }
                            else
                            {
                                deltay = 0.0f;
                            }

                            double rotationX = deltax * rotationdelta;
                            double rotationY = deltay * rotationdelta;

                            pitch += rotationY;
                            heading += rotationX;

                            // Limit pitch to straight up or straight down.
                            videoProjection.ViewOrientation = Helpers.CreateFromHeadingPitchRoll(heading, pitch, 0);
                        });
                    }
                }
            });

            m_inputLoopWorker = ThreadPool.RunAsync(workItemHandler, WorkItemPriority.High, WorkItemOptions.None);
        }

Member Data Documentation

Gamepad activeGamePad = null [private]

Definition at line 34 of file PlaybackPage.xaml.cs.

double centerX = 0 [private]

Definition at line 27 of file PlaybackPage.xaml.cs.

double centerY = 0 [private]

Definition at line 27 of file PlaybackPage.xaml.cs.

double heading = 0 [private]

Definition at line 30 of file PlaybackPage.xaml.cs.

bool isPointerPress = false [private]

Definition at line 32 of file PlaybackPage.xaml.cs.

IAsyncAction m_inputLoopWorker = null [private]

Definition at line 33 of file PlaybackPage.xaml.cs.

MediaPlayer mediaPlayer [private]

Definition at line 25 of file PlaybackPage.xaml.cs.

const int mouseWheelData = 120 [private]

Definition at line 41 of file PlaybackPage.xaml.cs.

Grid mtcGrid = null [private]

Definition at line 29 of file PlaybackPage.xaml.cs.

double pitch = 0 [private]

Definition at line 30 of file PlaybackPage.xaml.cs.

double rotationdelta = 1.8f [private]

Definition at line 39 of file PlaybackPage.xaml.cs.

const int scrollStep = 2 [private]

Definition at line 40 of file PlaybackPage.xaml.cs.

const double THUMBSTICK_DEADZONE = 0.25f [private]

Definition at line 36 of file PlaybackPage.xaml.cs.

StepTimer timer = new StepTimer() [private]

Definition at line 38 of file PlaybackPage.xaml.cs.

MediaPlaybackSphericalVideoProjection videoProjection [private]

Definition at line 31 of file PlaybackPage.xaml.cs.

WorkItemHandler workItemHandler [private]

Definition at line 35 of file PlaybackPage.xaml.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/PlaybackPage.xaml.cs
  • 360VideoPlayback/cpp/PlaybackPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Program Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • Program
Static Private Member Functions

Program Class Reference

Windows Holographic application using SharpDX.

List of all members.

Static Private Member Functions

static void Main ()

Detailed Description

Definition at line 9 of file Program.cs.

Member Function Documentation

static void Main ( ) [inline, static, private]

Defines the entry point of the application.

Definition at line 15 of file Program.cs.

        {
            var exclusiveViewApplicationSource = new AppViewSource();
            CoreApplication.Run(exclusiveViewApplicationSource);
        }

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/Program.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • sealed
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "App.xaml.h"

List of all members.

Public Member Functions

AppView (Windows::Foundation::Uri^sourceUri)
AppViewSource (Windows::Foundation::Uri^sourceUri)
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
MainPage ()
PlaybackPage ()
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()
VideoGallery ()
VideoItem (Platform::String^title, Windows::Foundation::Uri^sourceUri)

Static Public Member Functions

static int | GetMainViewId ()
static
Windows::Media::Playback::MediaPlayer 		GetMediaPlayer ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
void | OnMainViewActivated (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowActivatedEventArgs^args)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | GalleryGridView_ItemClick (Platform::Object^sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^e)
bool | IsMediaAlreadyOpened ()
void | OnBackRequested (Platform::Object^sender, Windows::UI::Core::BackRequestedEventArgs^args)
void | OnConsolidated (Windows::UI::ViewManagement::ApplicationView^sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^args)
void | OnKeyDown (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnLayoutUpdated (Platform::Object^sender, Platform::Object^args)
void | OnLoaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | OnMediaOpened (Windows::Media::Playback::MediaPlayer^sender, Platform::Object^args)
void | OnMediaOpened (Windows::Media::Playback::MediaPlayer^sender, Platform::Object^args)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnPlaybackStateChanged (Windows::Media::Playback::MediaPlaybackSession^sender, Platform::Object^args)
void | OnPointerMoved (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerPressed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerReleased (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerWheelChanged (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | ResetState ()
void | StartInputLoop ()
void | TryCloseWindow ()

Private Attributes

Windows::Gaming::Input::Gamepad | m_activeGamePad
bool | m_appViewConsolidated = false
double | m_centerX = 0
double | m_centerY = 0
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
double | m_heading
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
Windows::Foundation::IAsyncAction | m_inputLoopWorker
bool | m_isPointerPress = false
std::unique_ptr
< _360VideoPlaybackMain > 		m_main
bool | m_mainWindowReactivated = false
Windows::UI::Xaml::Controls::Grid | m_mtcGrid
double | m_pitch
Windows::Media::Playback::MediaPlayer | m_player
double | m_rotationdelta
bool | m_ShadersCreated = false
bool | m_ShadersNeed = false
Windows::Foundation::Uri | m_sourceUri
DX::StepTimer m_timer
bool | m_windowClosed = false
bool | m_windowVisible = true
Windows::Foundation::EventRegistrationToken | OnKeyDownToken
Windows::Foundation::EventRegistrationToken | OnLayoutUpdatedToken
Windows::Foundation::EventRegistrationToken | OnMediaOpenedToken
Windows::Foundation::EventRegistrationToken | OnMTCPointerMovedToken
Windows::Foundation::EventRegistrationToken | OnMTCPointerPressedToken
Windows::Foundation::EventRegistrationToken | OnMTCPointerReleasedToken
Windows::Foundation::EventRegistrationToken | OnMTCPointerWheelChangedToken
Windows::Foundation::EventRegistrationToken | OnPlaybackStateChangedToken
Windows::Foundation::EventRegistrationToken | OnPointerMovedToken
Windows::Foundation::EventRegistrationToken | OnPointerPressedToken
Windows::Foundation::EventRegistrationToken | OnPointerReleasedToken
Windows::Foundation::EventRegistrationToken | OnPointerWheelChangedToken
Windows::Media::Playback::MediaPlaybackSphericalVideoProjection | videoProjection

Static Private Attributes

static
Windows::Media::Playback::MediaPlayer 		m_mediaPlayer
static int | mainviewId

Detailed Description

An empty page that can be used on its own or navigated to within a Frame.

Definition at line 15 of file App.xaml.h.

Member Function Documentation

AppView ( Windows::Foundation::Uri^ sourceUri )
AppViewSource ( Windows::Foundation::Uri^ sourceUri )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
void GalleryGridView_ItemClick | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::ItemClickEventArgs^ | e |
 | ) |  |  | [private]
static int GetMainViewId ( ) [inline, static]

Definition at line 20 of file VideoGallery.xaml.h.

{ return mainviewId; }

static Windows::Media::Playback::MediaPlayer GetMediaPlayer ( ) [static]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
bool IsMediaAlreadyOpened ( ) [private]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
MainPage ( )
void OnBackRequested | ( | Platform::Object^ | sender,
 |  | Windows::UI::Core::BackRequestedEventArgs^ | args |
 | ) |  |  | [private]
void OnConsolidated | ( | Windows::UI::ViewManagement::ApplicationView^ | sender,
 |  | Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^ | args |
 | ) |  |  | [private]
void OnKeyDown | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [private]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
void OnLayoutUpdated | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnLoaded | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void OnMainViewActivated | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnMediaOpened | ( | Windows::Media::Playback::MediaPlayer^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnMediaOpened | ( | Windows::Media::Playback::MediaPlayer^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnPlaybackStateChanged | ( | Windows::Media::Playback::MediaPlaybackSession^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnPointerMoved | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e |
 | ) |  |  | [private]
void OnPointerPressed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e |
 | ) |  |  | [private]
void OnPointerReleased | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e |
 | ) |  |  | [private]
void OnPointerWheelChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e |
 | ) |  |  | [private]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
PlaybackPage ( )
void ResetState ( ) [private]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
void StartInputLoop ( ) [private]
void TryCloseWindow ( ) [private]
virtual void Uninitialize ( ) [virtual]
VideoGallery ( )
VideoItem | ( | Platform::String^ | title,
 |  | Windows::Foundation::Uri^ | sourceUri |
 | ) |  |  | [inline]

Definition at line 10 of file VideoItem.h.

            : m_title(title), m_sourceUri(sourceUri)
        {
        }

Member Data Documentation

internal __pad0__ [protected]

Definition at line 21 of file App.xaml.h.

Windows::Gaming::Input::Gamepad m_activeGamePad [private]

Definition at line 40 of file PlaybackPage.xaml.h.

bool m_appViewConsolidated = false [private]

Definition at line 43 of file AppView.h.

double m_centerX = 0 [private]

Definition at line 29 of file PlaybackPage.xaml.h.

double m_centerY = 0 [private]

Definition at line 29 of file PlaybackPage.xaml.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 38 of file AppView.h.

double m_heading [private]

Definition at line 33 of file PlaybackPage.xaml.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 46 of file AppView.h.

Windows::Foundation::IAsyncAction m_inputLoopWorker [private]

Definition at line 39 of file PlaybackPage.xaml.h.

bool m_isPointerPress = false [private]

Definition at line 38 of file PlaybackPage.xaml.h.

std::unique_ptr<_360VideoPlaybackMain> m_main [private]

Definition at line 37 of file AppView.h.

bool m_mainWindowReactivated = false [private]

Definition at line 44 of file AppView.h.

Windows::Media::Playback::MediaPlayer m_mediaPlayer [static, private]

Definition at line 47 of file AppView.h.

Windows::UI::Xaml::Controls::Grid m_mtcGrid [private]

Definition at line 31 of file PlaybackPage.xaml.h.

double m_pitch [private]

Definition at line 32 of file PlaybackPage.xaml.h.

Windows::Media::Playback::MediaPlayer m_player [private]

Definition at line 27 of file PlaybackPage.xaml.h.

double m_rotationdelta [private]

Definition at line 41 of file PlaybackPage.xaml.h.

bool m_ShadersCreated = false [private]

Definition at line 42 of file AppView.h.

bool m_ShadersNeed = false [private]

Definition at line 41 of file AppView.h.

Windows::Foundation::Uri m_sourceUri [private]

Definition at line 51 of file AppView.h.

DX::StepTimer m_timer [private]

Definition at line 35 of file PlaybackPage.xaml.h.

bool m_windowClosed = false [private]

Definition at line 39 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 40 of file AppView.h.

int mainviewId [static, private]

Definition at line 25 of file VideoGallery.xaml.h.

Windows::Foundation::EventRegistrationToken OnKeyDownToken [private]

Definition at line 61 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnLayoutUpdatedToken [private]

Definition at line 42 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnMediaOpenedToken [private]

Definition at line 63 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnMTCPointerMovedToken [private]

Definition at line 59 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnMTCPointerPressedToken [private]

Definition at line 50 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnMTCPointerReleasedToken [private]

Definition at line 53 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnMTCPointerWheelChangedToken [private]

Definition at line 56 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnPlaybackStateChangedToken [private]

Definition at line 65 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnPointerMovedToken [private]

Definition at line 58 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnPointerPressedToken [private]

Definition at line 49 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnPointerReleasedToken [private]

Definition at line 52 of file PlaybackPage.xaml.h.

Windows::Foundation::EventRegistrationToken OnPointerWheelChangedToken [private]

Definition at line 55 of file PlaybackPage.xaml.h.

Windows::Media::Playback::MediaPlaybackSphericalVideoProjection videoProjection [private]

Definition at line 37 of file PlaybackPage.xaml.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/App.xaml.h
  • 360VideoPlayback/cpp/AppView.h
  • 360VideoPlayback/cpp/PlaybackPage.xaml.h
  • 360VideoPlayback/cpp/VideoGallery.xaml.h
  • 360VideoPlayback/cpp/VideoItem.h
  • 360VideoPlayback/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 7 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 12 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );

    //
    // TODO: Expand this class to use other gesture-based input events as applicable to
    //       your app.
    //
}

~SpatialInputHandler ( )

Definition at line 31 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 40 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 22 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 25 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 28 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Content/SpatialInputHandler.h
  • 360VideoPlayback/cpp/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionTexture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • VertexPositionTexture
Public Attributes

VertexPositionTexture Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | position
DirectX::XMFLOAT2 | textureCoordinate

Detailed Description

Definition at line 16 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 position

Definition at line 18 of file ShaderStructures.h.

DirectX::XMFLOAT2 textureCoordinate

Definition at line 19 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoGallery Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • VideoGallery
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes

VideoGallery Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Classes

class | VideoItemInfo

Public Member Functions

VideoGallery ()

Static Public Attributes

static int | mainviewId = 0

Private Member Functions

async void | GalleryGridView_ItemClick (object sender, ItemClickEventArgs e)
void | VideoGallery_Loaded (object sender, RoutedEventArgs e)

Static Private Attributes

static VideoItemInfo[] | sampleVideos

Detailed Description

Definition at line 19 of file VideoGallery.xaml.cs.

Constructor & Destructor Documentation

VideoGallery ( ) [inline]

Definition at line 23 of file VideoGallery.xaml.cs.

        {
            this.InitializeComponent();
            mainviewId = ApplicationView.GetForCurrentView().Id;
            this.Loaded += VideoGallery_Loaded;
        }

Member Function Documentation

async void GalleryGridView_ItemClick | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file VideoGallery.xaml.cs.

        {
            VideoItem selectedVideo = (VideoItem)e.ClickedItem;
            if (selectedVideo != null)
            {
                if ((HolographicSpace.IsSupported && HolographicSpace.IsAvailable)
                    || SpatialSurfaceObserver.IsSupported())
                {
                    var appViewSource = new AppViewSource(selectedVideo.SourceUri);
                    var appView = CoreApplication.CreateNewView(appViewSource);
                    await appView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                    {
                        int appviewId = ApplicationView.GetForCurrentView().Id;
                        bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(appviewId, ViewSizePreference.Default, mainviewId, ViewSizePreference.Default);
                        System.Diagnostics.Debug.Assert(viewShown);
                    });
                }
                else
                {
                    Frame.Navigate(typeof(PlaybackPage), selectedVideo.SourceUri);
                }
            }
        }

void VideoGallery_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file VideoGallery.xaml.cs.

        {
            ObservableCollection<VideoItem> videoList = new ObservableCollection<VideoItem>();
            foreach (var info in sampleVideos)
            {
                videoList.Add(new VideoItem(info.Title, new Uri(info.Source)));
            }

            GalleryGridView.ItemsSource = videoList;
        }

Member Data Documentation

int mainviewId = 0 [static]

Definition at line 21 of file VideoGallery.xaml.cs.

VideoItemInfo [] sampleVideos [static, private]
Initial value:
        {

            new VideoItemInfo { Title = "Sample Video", Source = "https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/SampleVideo.mp4" }
        }

Definition at line 60 of file VideoGallery.xaml.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/VideoGallery.xaml.cs
  • 360VideoPlayback/cpp/VideoGallery.xaml.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoGallery::VideoItemInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • VideoGallery
  • VideoGallery::VideoItemInfo
Public Attributes

VideoGallery::VideoItemInfo Class Reference

List of all members.

Public Attributes

string | Source
string | Title

Detailed Description

Definition at line 54 of file VideoGallery.xaml.cs.

Member Data Documentation

string Source

Definition at line 57 of file VideoGallery.xaml.cs.

string Title

Definition at line 56 of file VideoGallery.xaml.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/VideoGallery.xaml.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • VideoItem
Public Member Functions | Properties

VideoItem Class Reference

List of all members.

Public Member Functions

VideoItem (string title, Uri sourceUri)

Properties

Uri | SourceUri [get, set]
string | Title [get, set]

Detailed Description

Definition at line 5 of file VideoItem.cs.

Constructor & Destructor Documentation

VideoItem | ( | string | title,
 |  | Uri | sourceUri |
 | ) |  |  | [inline]

Definition at line 7 of file VideoItem.cs.

        {
            Title = title;
            SourceUri = sourceUri;
        }

Property Documentation

Uri SourceUri [get, set]

Definition at line 13 of file VideoItem.cs.

string Title [get, set]

Definition at line 12 of file VideoItem.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/VideoItem.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • _360VideoPlayback
  • VideoRenderer
Public Member Functions | Private Member Functions | Private Attributes

VideoRenderer Class Reference

#include "VideoRenderer.h"

List of all members.

Public Member Functions

VideoRenderer ()
void | ComputeSphere (unsigned short tessellation, bool invertn)
void | CreateD3D11Surface ()
void | CreateDeviceDependentResources ()
void | LoadShaders ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Update (const DX::StepTimer &timer)

Private Member Functions

void | OnVideoFrameAvailable ()

Private Attributes

Concurrency::critical_section | m_critical
float | m_degreesPerSecond = 45.f
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_quadTextureSamplerState
Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface | m_surface
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_textureView
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader
Windows::Foundation::EventRegistrationToken | m_videoFrameAvailToken

Detailed Description

Definition at line 11 of file VideoRenderer.h.

Constructor & Destructor Documentation

VideoRenderer ( )

Definition at line 20 of file VideoRenderer.cpp.

{
    m_deviceResources = _360VideoPlaybackMain::GetDeviceResources();
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_modelConstantBuffer));
}

Member Function Documentation

void ComputeSphere | ( | unsigned short | tessellation,
 |  | bool | invertn
 | ) |  |

Definition at line 324 of file VideoRenderer.cpp.

{
    if (tessellation < 3)
        throw std::out_of_range("tesselation parameter out of range");

    unsigned short verticalSegments = tessellation;
    unsigned short horizontalSegments = tessellation * 2;
    const unsigned short vertCount = (verticalSegments + 1) * (horizontalSegments + 1);
    unsigned short indexCount = (verticalSegments) * (horizontalSegments + 1) * 6;

    float radius = 0.5f; // Diameter of the default Sphere will always be 1 to stay aligned

    std::vector<VertexPositionTexture> sphereVertices;

    for (unsigned short i = 0; i <= verticalSegments; i++)
    {
        float v = 1 - (float)i / verticalSegments;

        float latitude = (i * XM_PI / verticalSegments) - XM_PIDIV2;
        float dy, dxz;

        XMScalarSinCos(&dy, &dxz, latitude);

        // Create a single ring of vertices at this latitude.
        for (unsigned short j = 0; j <= horizontalSegments; j++)
        {
            float u = (float)j / horizontalSegments;

            float longitude = j * XM_2PI / horizontalSegments;
            float dx, dz;

            XMScalarSinCos(&dx, &dz, longitude);

            dx *= dxz;
            dz *= dxz;

            XMVECTOR normal = XMVectorSet(dx, dy, dz, 0) * radius;
            XMFLOAT3 normalFloat3;
            XMStoreFloat3(&normalFloat3, normal);
            VertexPositionTexture vert;
            vert.position = normalFloat3;

            vert.textureCoordinate = XMFLOAT2(1.0f - u, v);

            sphereVertices.push_back(vert);
        }
    }

    std::vector<unsigned short> sphereIndices;

    // Fill the index buffer with triangles joining each pair of latitude rings.
    unsigned short stride = horizontalSegments + 1;
    for (unsigned short i = 0; i < verticalSegments; i++)
    {
        for (unsigned short j = 0; j <= horizontalSegments; j++)
        {
            unsigned short nextI = i + 1;
            unsigned short nextJ = (j + 1) % stride;
            if (!invertn)
            {
                sphereIndices.push_back(i * stride + j);
                sphereIndices.push_back(nextI * stride + j);
                sphereIndices.push_back(i * stride + nextJ);

                sphereIndices.push_back(i * stride + nextJ);
                sphereIndices.push_back(nextI * stride + j);
                sphereIndices.push_back(nextI * stride + nextJ);
            }
            else
            {
                sphereIndices.push_back(nextI * stride + j);
                sphereIndices.push_back(i * stride + j);
                sphereIndices.push_back(i * stride + nextJ);

                sphereIndices.push_back(nextI * stride + j);
                sphereIndices.push_back(i * stride + nextJ);
                sphereIndices.push_back(nextI * stride + nextJ);
            }
        }
    }

    D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
    vertexBufferData.pSysMem = sphereVertices.data();
    vertexBufferData.SysMemPitch = 0;
    vertexBufferData.SysMemSlicePitch = 0;
    const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionTexture) * vertCount, D3D11_BIND_VERTEX_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &vertexBufferDesc,
            &vertexBufferData,
            &m_vertexBuffer
        )
    );

    m_indexCount = indexCount;

    D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
    indexBufferData.pSysMem = sphereIndices.data();
    indexBufferData.SysMemPitch = 0;
    indexBufferData.SysMemSlicePitch = 0;
    CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * indexCount, D3D11_BIND_INDEX_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &indexBufferDesc,
            &indexBufferData,
            &m_indexBuffer
        )
    );
}

void CreateD3D11Surface ( )

Definition at line 435 of file VideoRenderer.cpp.

{
    Microsoft::WRL::ComPtr<IDXGISurface> spDXGIInterfaceAccess;
    DX::ThrowIfFailed(m_texture->QueryInterface(IID_PPV_ARGS(&spDXGIInterfaceAccess)));
    m_surface = CreateDirect3DSurface(spDXGIInterfaceAccess.Get());
    m_videoFrameAvailToken =
        AppView::GetMediaPlayer()->VideoFrameAvailable +=
        ref new TypedEventHandler<MediaPlayer^, Platform::Object^>(
            std::bind(&VideoRenderer::OnVideoFrameAvailable, this));
    AppView::GetMediaPlayer()->Play();
}

void CreateDeviceDependentResources ( )

Definition at line 151 of file VideoRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // Create the Texture, ShaderResource and Sampler state

    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateTexture2D(
            &CD3D11_TEXTURE2D_DESC(
                DXGI_FORMAT_R8G8B8A8_UNORM,
                AppView::GetMediaPlayer()->PlaybackSession->NaturalVideoWidth,        // Width
                AppView::GetMediaPlayer()->PlaybackSession->NaturalVideoHeight,        // Height
                1,          // MipLevels
                1,          // ArraySize
                D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
            ),
            nullptr,
            &m_texture
        )
    );

    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateShaderResourceView(
            m_texture.Get(), nullptr,
            &m_textureView
        )
    );

    D3D11_SAMPLER_DESC desc;
    ZeroMemory(&desc, sizeof(D3D11_SAMPLER_DESC));

    desc.Filter = D3D11_FILTER_ANISOTROPIC;
    desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
    desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
    desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
    desc.MaxAnisotropy = 3;
    desc.MinLOD = 0;
    desc.MaxLOD = 3;
    desc.MipLODBias = 0.f;
    desc.BorderColor[0] = 0.f;
    desc.BorderColor[1] = 0.f;
    desc.BorderColor[2] = 0.f;
    desc.BorderColor[3] = 0.f;
    desc.ComparisonFunc = D3D11_COMPARISON_NEVER;

    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateSamplerState(
            &desc,
            &m_quadTextureSamplerState
        )
    );

    CreateD3D11Surface();
    LoadShaders();
}

void LoadShaders ( )

Definition at line 209 of file VideoRenderer.cpp.

{
    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
            )
        );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
        { {
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                        { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT,    0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        } };

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                static_cast<UINT>(vertexDesc.size()),
                fileData.data(),
                static_cast<UINT>(fileData.size()),
                &m_inputLayout
            )
        );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
            )
        );

    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                )
            );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> createSphereTask = shaderTaskGroup.then([this]()
    {
        ComputeSphere(16, true);
    });

    // Once the Sphere is created, the object is ready to be rendered.
    createSphereTask.then([this]()
    {
        m_loadingComplete = true;
    });
}

void OnVideoFrameAvailable ( ) [private]

Definition at line 447 of file VideoRenderer.cpp.

{
    critical_section::scoped_lock lock(m_critical);
    AppView::GetMediaPlayer()->CopyFrameToVideoSurface(m_surface);
}

void ReleaseDeviceDependentResources ( )

Definition at line 304 of file VideoRenderer.cpp.

{
    m_loadingComplete = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
    if (m_videoFrameAvailToken.Value)
    {
        if (AppView::GetMediaPlayer() != nullptr)
        {
            AppView::GetMediaPlayer()->VideoFrameAvailable -= m_videoFrameAvailToken;
        }
    }
}

void Render ( )

Definition at line 46 of file VideoRenderer.cpp.

{
    critical_section::scoped_lock lock(m_critical);
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
    );

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionTexture);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
    );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
    );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
    );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
    );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
        );
    }
    else
    {
        // Make sure that there is no geometry shader bound to the graphics
        // pipeline on devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature.
        context->GSSetShader(
            nullptr,
            nullptr,
            0
        );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
    );

    // Set the Texture Shader resource and samplers
    context->PSSetShaderResources(0, 1, m_textureView.GetAddressOf());
    context->PSSetSamplers(
        0,
        1,
        m_quadTextureSamplerState.GetAddressOf()
    );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
    );

}

void Update ( const DX::StepTimer & timer )

Definition at line 33 of file VideoRenderer.cpp.

{
    float3 scale = 10.0f;
    const XMMATRIX modelScale = XMMatrixScalingFromVector(XMLoadFloat3(&scale));
    const XMMATRIX localTransform = modelScale;
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(localTransform));
}

Member Data Documentation

Concurrency::critical_section m_critical [private]

Definition at line 53 of file VideoRenderer.h.

float m_degreesPerSecond = 45.f [private]

Definition at line 41 of file VideoRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 24 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 31 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 29 of file VideoRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 37 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 27 of file VideoRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 40 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 33 of file VideoRenderer.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 36 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 32 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_quadTextureSamplerState [private]

Definition at line 50 of file VideoRenderer.h.

Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface m_surface [private]

Definition at line 48 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [private]

Definition at line 47 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureView [private]

Definition at line 49 of file VideoRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 45 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 28 of file VideoRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 30 of file VideoRenderer.h.

Windows::Foundation::EventRegistrationToken m_videoFrameAvailToken [private]

Definition at line 52 of file VideoRenderer.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Content/VideoRenderer.h
  • 360VideoPlayback/cpp/Content/VideoRenderer.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: _RPC_CLIENT Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

_RPC_CLIENT Struct Reference

List of all members.

Public Attributes

RpcClient * RpcClient

Detailed Description

Definition at line 22 of file RpcClientApi.cpp.

Member Data Documentation

RpcClient* RpcClient

Definition at line 21 of file RpcClientApi.cpp.

The documentation for this struct was generated from the following file:
  • CustomCapability/Service/Client/RpcClientApi.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WrlFinal Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ABI
  • Microsoft
  • SDKSamples
  • Kitchen
  • WrlFinal
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

WrlFinal Class Reference

List of all members.

Public Member Functions

STDMETHODIMP | ActivateInstance (_COM_Outptr_ IInspectable **oven) override
STDMETHODIMP | ActivateInstance (_COM_Outptr_ IInspectable **oven) override
STDMETHODIMP | add_BreadBaked (_In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > *handler, _Out_ EventRegistrationToken *token) override
STDMETHODIMP | add_BreadBaked (_In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > *handler, _Out_ EventRegistrationToken *token) override
STDMETHODIMP | BakeBread (_In_ HSTRING flavor) override
STDMETHODIMP | BakeBread (_In_ HSTRING flavor) override
STDMETHODIMP | ConfigurePreheatTemperature (_In_ OvenTemperature temperature) override
STDMETHODIMP | ConfigurePreheatTemperature (_In_ OvenTemperature temperature) override
STDMETHODIMP | CreateOven (_In_ Dimensions dimensions, _COM_Outptr_ IOven **oven) override
STDMETHODIMP | CreateOven (_In_ Dimensions dimensions, _COM_Outptr_ IOven **oven) override
STDMETHODIMP | get_Flavor (_COM_Outptr_ HSTRING *value) override
STDMETHODIMP | get_Flavor (_COM_Outptr_ HSTRING *value) override
STDMETHODIMP | get_Volume (_Out_ double *value) override
STDMETHODIMP | get_Volume (_Out_ double *value) override
STDMETHODIMP | remove_BreadBaked (_In_ EventRegistrationToken token) override
STDMETHODIMP | remove_BreadBaked (_In_ EventRegistrationToken token) override
HRESULT | RuntimeClassInitialize ()
HRESULT | RuntimeClassInitialize (_In_ Dimensions dimensions)
HRESULT | RuntimeClassInitialize (HSTRING flavor)
HRESULT | RuntimeClassInitialize (_In_ Dimensions dimensions)
HRESULT | RuntimeClassInitialize (HSTRING flavor)
HRESULT | RuntimeClassInitialize ()

Public Attributes

HString | m_flavor

Private Member Functions

STDMETHODIMP | get_Bread (_COM_Outptr_ IBread **value) override
STDMETHODIMP | get_Bread (_COM_Outptr_ IBread **value) override
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs, TrustLevel::BaseTrust) public
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven, TrustLevel::BaseTrust)
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread, TrustLevel::BaseTrust)
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread, TrustLevel::BaseTrust)
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs, TrustLevel::BaseTrust) public
InspectableClass (RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven, TrustLevel::BaseTrust)

Private Attributes

AgileEventSource
< ITypedEventHandler< Oven
*, BreadBakedEventArgs * > > 		_breadBaked
Dimensions | _dims = { 1.0, 1.0, 1.0 }
OvenTemperature | _temperature = OvenTemperature::Medium
ComPtr< Bread > | m_bread

Detailed Description

Definition at line 24 of file OvenServer.cpp.

Member Function Documentation

STDMETHODIMP ActivateInstance ( _COM_Outptr_ IInspectable ** oven ) [inline, override]

Definition at line 97 of file OvenServer.cpp.

        {
            return MakeAndInitialize<Oven>(oven);
        }

STDMETHODIMP ActivateInstance ( _COM_Outptr_ IInspectable ** oven ) [inline, override]

Definition at line 90 of file OvenServer.cpp.

                    {
                        return MakeAndInitialize<Oven>(oven);
                    }

STDMETHODIMP add_BreadBaked | ( | _In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > * | handler,
 |  | _Out_ EventRegistrationToken * | token |
 | ) |  |  | [override]
STDMETHODIMP add_BreadBaked | ( | _In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > * | handler,
 |  | _Out_ EventRegistrationToken * | token |
 | ) |  |  | [override]
STDMETHODIMP BakeBread ( _In_ HSTRING flavor ) [override]
STDMETHODIMP BakeBread ( _In_ HSTRING flavor ) [override]
STDMETHODIMP ConfigurePreheatTemperature ( _In_ OvenTemperature temperature ) [override]
STDMETHODIMP ConfigurePreheatTemperature ( _In_ OvenTemperature temperature ) [override]
STDMETHODIMP CreateOven | ( | _In_ Dimensions | dimensions,
 |  | _COM_Outptr_ IOven ** | oven |
 | ) |  |  | [inline, override]

Definition at line 103 of file OvenServer.cpp.

        {
            return MakeAndInitialize<Oven>(oven, dimensions);
        }

STDMETHODIMP CreateOven | ( | _In_ Dimensions | dimensions,
 |  | _COM_Outptr_ IOven ** | oven |
 | ) |  |  | [inline, override]

Definition at line 96 of file OvenServer.cpp.

                    {
                        return MakeAndInitialize<Oven>(oven, dimensions);
                    }

STDMETHODIMP get_Bread ( _COM_Outptr_ IBread ** value ) [inline, override, private]

Definition at line 84 of file OvenServer.cpp.

        {
            return m_bread.CopyTo(value);
        }

STDMETHODIMP get_Bread ( _COM_Outptr_ IBread ** value ) [inline, override, private]

Definition at line 77 of file OvenServer.cpp.

                    {
                        return m_bread.CopyTo(value);
                    }

STDMETHODIMP get_Flavor ( _COM_Outptr_ HSTRING * value ) [inline, override]

Definition at line 34 of file OvenServer.cpp.

        {
            return m_flavor.CopyTo(value);
        }

STDMETHODIMP get_Flavor ( _COM_Outptr_ HSTRING * value ) [inline, override]

Definition at line 27 of file OvenServer.cpp.

                    {
                        return m_flavor.CopyTo(value);
                    }

STDMETHODIMP get_Volume ( _Out_ double * value ) [override]
STDMETHODIMP get_Volume ( _Out_ double * value ) [override]
InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [private]
InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [private]
InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [private]
InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [private]
InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [inline, private]

Definition at line 74 of file OvenServer.cpp.

          :
        HRESULT RuntimeClassInitialize(_In_ Bread* bread)
        {
            m_bread = bread;
            return S_OK;
        }

InspectableClass | ( | RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs | ,
 |  | TrustLevel::BaseTrust |  |
 | ) |  |  | [inline, private]

Definition at line 67 of file OvenServer.cpp.

                      :
                    HRESULT RuntimeClassInitialize(_In_ Bread* bread)
                    {
                        m_bread = bread;
                        return S_OK;
                    }

STDMETHODIMP remove_BreadBaked ( _In_ EventRegistrationToken token ) [override]
STDMETHODIMP remove_BreadBaked ( _In_ EventRegistrationToken token ) [override]
HRESULT RuntimeClassInitialize ( _In_ Dimensions dimensions ) [inline]

Definition at line 51 of file OvenServer.cpp.

        {
            _dims = dimensions;
            return S_OK;
        }

HRESULT RuntimeClassInitialize ( ) [inline]

Definition at line 46 of file OvenServer.cpp.

        {
            return S_OK;
        }

HRESULT RuntimeClassInitialize ( ) [inline]

Definition at line 39 of file OvenServer.cpp.

                    {
                        return S_OK;
                    }

HRESULT RuntimeClassInitialize ( HSTRING flavor ) [inline]

Definition at line 28 of file OvenServer.cpp.

        {
            return m_flavor.Set(flavor);
        }

HRESULT RuntimeClassInitialize ( HSTRING flavor ) [inline]

Definition at line 21 of file OvenServer.cpp.

                    {
                        return m_flavor.Set(flavor);
                    }

HRESULT RuntimeClassInitialize ( _In_ Dimensions dimensions ) [inline]

Definition at line 44 of file OvenServer.cpp.

                    {
                        _dims = dimensions;
                        return S_OK;
                    }

Member Data Documentation

AgileEventSource< ITypedEventHandler< Oven *, BreadBakedEventArgs * > > _breadBaked [private]

Definition at line 67 of file OvenServer.cpp.

Dimensions _dims = { 1.0, 1.0, 1.0 } [private]

Definition at line 68 of file OvenServer.cpp.

OvenTemperature _temperature = OvenTemperature::Medium [private]

Definition at line 69 of file OvenServer.cpp.

ComPtr< Bread > m_bread [private]

Definition at line 90 of file OvenServer.cpp.

HString m_flavor

Definition at line 38 of file OvenServer.cpp.

The documentation for this class was generated from the following files:
  • WRLInProcessWinRTComponent/cpp/Server/OvenServer.cpp
  • WRLOutOfProcessWinRTComponent/cpp/Server/OvenServer.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DefaultAccountScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • DefaultAccountScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

DefaultAccountScenario Class Reference

This scenario covers getting the default account. More...

List of all members.

Public Member Functions

DefaultAccountScenario ()
async void | AuthenticateWithRequestToken (WebAccountProvider Provider, String Scope, String ClientID)
void | OutputTokenResult (WebTokenRequestResult result)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Button_DefaultSignIn_Click (object sender, RoutedEventArgs e)
async void | Button_GetTokenSilently_Click (object sender, RoutedEventArgs e)
void | Button_Reset_Click (object sender, RoutedEventArgs e)
async Task | GetTokenSilent (WebAccountProvider Provider, WebAccount Account)

Private Attributes

const string | AzureActiveDirectoryAuthority = "organizations"
const string | AzureActiveDirectoryClientId = ""
const string | AzureActiveDirectoryScopeRequested = ""
WebAccount | defaultAccount
WebAccountProvider | defaultProvider
const string | DefaultProviderId = "https://login.windows.local"
const string | MicrosoftAccountAuthority = "consumers"
const string | MicrosoftAccountClientId = "none"
const string | MicrosoftAccountScopeRequested = "wl.basic"
const string | MicrosoftProviderId = "https://login.microsoft.com"
MainPage rootPage

Detailed Description

First you must get the default account provider by passing the id "https://login.windows.local" into WebAuthenticationCoreManager::FindAccountProviderAsync.

It's important to note whether this account is MSA or AAD depending on the authority that the provider has. MSA: authority == "consumers" AAD: authority == "organizations" These will determine what strings you pass into the token request.

Then you can call WebAuthenticationCoreManager::RequestTokenSilentlyAsync or WebAuthenticationCoreManager::RequestTokenAsync to get a token for the user.

The main difference between these APIs is that if the user needs to enter login credentials before a token can be returned, RequestTokenAsync will result in a UI popping up while RequestTokenSilentlyAsync will just return a result of UserInteractionRequired.

If you hit UserInteractionRequired, then you will need to call the regular RequestTokenAsync.

Definition at line 60 of file DefaultAccountScenario.xaml.cs.

Constructor & Destructor Documentation

DefaultAccountScenario ( ) [inline]

Definition at line 79 of file DefaultAccountScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AuthenticateWithRequestToken | ( | WebAccountProvider | Provider,
 |  | String | Scope,
 |  | String | ClientID |
 | ) |  |  | [inline]

Definition at line 137 of file DefaultAccountScenario.xaml.cs.

        {
            try
            {
                WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);

                // Azure Active Directory requires a resource to return a token
                if(Provider.Id == "https://login.microsoft.com" && Provider.Authority == "organizations")
                {
                    webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
                }

                // If the user selected a specific account, RequestTokenAsync will return a token for that account.
                // The user may be prompted for credentials or to authorize using that account with your app
                // If the user selected a provider, the user will be prompted for credentials to login to a new account
                WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);

                if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
                {
                    defaultAccount = webTokenRequestResult.ResponseData[0].WebAccount;

                    button_GetTokenSilently.IsEnabled = true;
                    textblock_SignedInStatus.Text = "Signed in with:";
                    textblock_SignedInStatus.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
                    listview_SignedInAccounts.Items.Clear();
                    listview_SignedInAccounts.Items.Add(defaultAccount.Id);
                }

                OutputTokenResult(webTokenRequestResult);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Web Token request failed: " + ex, NotifyType.ErrorMessage);
            }
        }

async void Button_DefaultSignIn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file DefaultAccountScenario.xaml.cs.

        {
            defaultProvider = await WebAuthenticationCoreManager.FindAccountProviderAsync(DefaultProviderId);

            if(defaultProvider == null)
            {
                rootPage.NotifyUser("This user does not have a primary account", NotifyType.StatusMessage);
            }
            else
            {
                // Set the clientID and scope based on the authority. The authority tells us if the account is a Microsoft account or an Azure AD.
                String scope = defaultProvider.Authority == MicrosoftAccountAuthority ? MicrosoftAccountScopeRequested : AzureActiveDirectoryScopeRequested;
                String clientID = defaultProvider.Authority == MicrosoftAccountAuthority ? MicrosoftAccountClientId : AzureActiveDirectoryClientId;

                AuthenticateWithRequestToken(defaultProvider, scope, clientID);
            }
        }

async void Button_GetTokenSilently_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file DefaultAccountScenario.xaml.cs.

        {
            if(defaultAccount == null || defaultProvider == null)
            {
                rootPage.NotifyUser("No account known to get account silently", NotifyType.ErrorMessage);
            }
            else
            {
                await GetTokenSilent(defaultProvider, defaultAccount);
            }
        }

void Button_Reset_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 126 of file DefaultAccountScenario.xaml.cs.

        {
            defaultAccount = null;
            defaultProvider = null;
            button_GetTokenSilently.IsEnabled = false;
            textblock_SignedInStatus.Text = "Not signed in";
            textblock_SignedInStatus.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
            listview_SignedInAccounts.Items.Clear();

        }

async Task GetTokenSilent | ( | WebAccountProvider | Provider,
 |  | WebAccount | Account |
 | ) |  |  | [inline, private]

Definition at line 173 of file DefaultAccountScenario.xaml.cs.

        {
            // Set the clientID and scope based on the authority. The authority tells us if the account is a Microsoft account or an Azure AD.
            String scope = defaultProvider.Authority == MicrosoftAccountAuthority ? MicrosoftAccountScopeRequested : AzureActiveDirectoryScopeRequested;
            String clientID = defaultProvider.Authority == MicrosoftAccountAuthority ? MicrosoftAccountClientId : AzureActiveDirectoryClientId;

            WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, scope, clientID);

            // Azure Active Directory requires a resource to return a token
            if (Provider.Authority == "organizations")
            {
                webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
            }

            WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.GetTokenSilentlyAsync(webTokenRequest, Account);

            if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Silent request successful for user:" + webTokenRequestResult.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
            }
            else if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.UserInteractionRequired)
            {
                rootPage.NotifyUser("Cannot retrieve token silently because user interaction is required to complete this request.", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + webTokenRequestResult.ResponseStatus + " Code: " + webTokenRequestResult.ResponseError.ErrorMessage, NotifyType.StatusMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 91 of file DefaultAccountScenario.xaml.cs.

        {

        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 84 of file DefaultAccountScenario.xaml.cs.

        {
            rootPage = MainPage.Current;

            IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AzureActiveDirectoryClientId);
        }

void OutputTokenResult ( WebTokenRequestResult result ) [inline]

Definition at line 203 of file DefaultAccountScenario.xaml.cs.

        {
            if (result.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Web Token request successful for user:" + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + result.ResponseStatus + " Code: " + result.ResponseError.ErrorMessage, NotifyType.StatusMessage);
            }
        }

Member Data Documentation

const string AzureActiveDirectoryAuthority = "organizations" [private]

Definition at line 67 of file DefaultAccountScenario.xaml.cs.

const string AzureActiveDirectoryClientId = "" [private]

Definition at line 73 of file DefaultAccountScenario.xaml.cs.

const string AzureActiveDirectoryScopeRequested = "" [private]

Definition at line 74 of file DefaultAccountScenario.xaml.cs.

WebAccount defaultAccount [private]

Definition at line 77 of file DefaultAccountScenario.xaml.cs.

WebAccountProvider defaultProvider [private]

Definition at line 76 of file DefaultAccountScenario.xaml.cs.

const string DefaultProviderId = "https://login.windows.local" [private]

Definition at line 64 of file DefaultAccountScenario.xaml.cs.

const string MicrosoftAccountAuthority = "consumers" [private]

Definition at line 66 of file DefaultAccountScenario.xaml.cs.

const string MicrosoftAccountClientId = "none" [private]

Definition at line 69 of file DefaultAccountScenario.xaml.cs.

const string MicrosoftAccountScopeRequested = "wl.basic" [private]

Definition at line 70 of file DefaultAccountScenario.xaml.cs.

const string MicrosoftProviderId = "https://login.microsoft.com" [private]

Definition at line 65 of file DefaultAccountScenario.xaml.cs.

MainPage rootPage [private]

Definition at line 62 of file DefaultAccountScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/DefaultAccountScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IdentityChecker Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • IdentityChecker
Static Public Member Functions

IdentityChecker Class Reference

List of all members.

Static Public Member Functions

static void SampleIdentityConfigurationCorrect (TextBlock outputLocation, String AzureClientId="Not applicable")

Detailed Description

Definition at line 12 of file IdentityChecker.cs.

Member Function Documentation

static void SampleIdentityConfigurationCorrect | ( | TextBlock | outputLocation,
 |  | String | AzureClientId = "Not applicable" |
 | ) |  |  | [inline, static]

Definition at line 14 of file IdentityChecker.cs.

        {
            string outputMessage = "";
            bool isCorrect = true;

            if (AzureClientId == "")
            {
                outputMessage += "Azure AD Client ID not set; cannot sign in with Azure AD\n";
                isCorrect = false;
            }

            if ( Package.Current.Id.Publisher == "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US")
            {
                outputMessage += "Application identity not set; cannot sign in with Microsoft account.\n";
                isCorrect = false;
            }

            if (!isCorrect)
            {
                outputMessage += "See Readme.MD for details";
                outputLocation.Text = outputMessage;
            }

        }

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/IdentityChecker.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleAccountsScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • MultipleAccountsScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

MultipleAccountsScenario Class Reference

List of all members.

Public Member Functions

MultipleAccountsScenario ()
async Task | AuthenticateWithRequestToken (WebAccountProvider Provider, String Scope, String ClientID)
void | OutputTokenResult (WebTokenRequestResult result)
void | StoreNewAccountDataLocally (WebAccount account)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddLinksAndDescription (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountProvidersToPane (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountsToPane (AccountsSettingsPaneCommandsRequestedEventArgs e)
async void | Button_Reset (object sender, RoutedEventArgs e)
void | Button_ShowAccountSettings (object sender, RoutedEventArgs e)
void | CreateLocalDataContainers ()
async Task< List< WebAccount > > | GetAllAccounts ()
async Task< List
< WebAccountProvider > > 		GetAllProviders ()
async Task< WebAccountProvider > | GetProvider (string ProviderID, string AuthorityId="")
async Task | LogoffAndRemoveAccount (WebAccount account)
async Task | LogoffAndRemoveAllAccounts ()
async void | OnAccountCommandsRequested (AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e)
void | OtherLinkInvoked (IUICommand command)
void | PrivacyPolicyInvoked (IUICommand command)
async void | WebAccountInvoked (WebAccountCommand command, WebAccountInvokedArgs args)
async void | WebAccountProviderCommandInvoked (WebAccountProviderCommand command)

Private Attributes

const string | AccountsContainer = "accountssettingscontainer"
const string | AppSpecificProviderId = "myproviderid"
const string | AppSpecificProviderName = "App specific provider"
const string | AuthoritySubContainer = "authorities"
const string | AzureActiveDirectoryAuthority = "organizations"
const string | AzureActiveDirectoryClientId = ""
const string | AzureActiveDirectoryScopeRequested = ""
const string | MicrosoftAccountAuthority = "consumers"
const string | MicrosoftAccountClientId = "none"
const string | MicrosoftAccountScopeRequested = "wl.basic"
const string | MicrosoftProviderId = "https://login.microsoft.com"
const string | ProviderIdSubContainer = "providers"
MainPage rootPage

Detailed Description

Definition at line 28 of file MultipleAccountsScenario.xaml.cs.

Constructor & Destructor Documentation

MultipleAccountsScenario ( ) [inline]

Definition at line 50 of file MultipleAccountsScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddLinksAndDescription ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 171 of file MultipleAccountsScenario.xaml.cs.

        {
            e.HeaderText = "Describe what adding an account to your application will do for the user";

            // You can add links such as privacy policy, help, general account settings
            e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
            e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
        }

async Task AddWebAccountProvidersToPane ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 190 of file MultipleAccountsScenario.xaml.cs.

        {
            // The order of providers displayed is determined by the order provided to the Accounts pane
            List<WebAccountProvider> providers = await GetAllProviders();

            foreach (WebAccountProvider provider in providers)
            {
                WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
                e.WebAccountProviderCommands.Add(providerCommand);
            }
        }

async Task AddWebAccountsToPane ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 202 of file MultipleAccountsScenario.xaml.cs.

        {
            List<WebAccount> accounts = await GetAllAccounts();

            foreach (WebAccount account in accounts)
            {
                WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove | SupportedWebAccountActions.Manage);
                e.WebAccountCommands.Add(command);
            }
        }

async Task AuthenticateWithRequestToken | ( | WebAccountProvider | Provider,
 |  | String | Scope,
 |  | String | ClientID |
 | ) |  |  | [inline]

Definition at line 232 of file MultipleAccountsScenario.xaml.cs.

        {
            try
            {
                WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);

                // Azure Active Directory requires a resource to return a token
                if (Provider.Id == "https://login.microsoft.com" && Provider.Authority == "organizations")
                {
                    webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
                }

                // If the user selected a specific account, RequestTokenAsync will return a token for that account.
                // The user may be prompted for credentials or to authorize using that account with your app
                // If the user selected a provider, the user will be prompted for credentials to login to a new account
                WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);

                if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
                {
                    StoreNewAccountDataLocally(webTokenRequestResult.ResponseData[0].WebAccount);
                }

                OutputTokenResult(webTokenRequestResult);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Web Token request failed: " + ex, NotifyType.ErrorMessage);
            }
        }

async void Button_Reset | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file MultipleAccountsScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Resetting ", NotifyType.ErrorMessage);

            await LogoffAndRemoveAllAccounts();

            ((Button)sender).IsEnabled = true;
        }

void Button_ShowAccountSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file MultipleAccountsScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);

            AccountsSettingsPane.Show();

            ((Button)sender).IsEnabled = true;
        }

void CreateLocalDataContainers ( ) [inline, private]

Definition at line 333 of file MultipleAccountsScenario.xaml.cs.

        {
            ApplicationData.Current.LocalSettings.CreateContainer(AccountsContainer, ApplicationDataCreateDisposition.Always);
            ApplicationData.Current.LocalSettings.Containers[AccountsContainer].CreateContainer(ProviderIdSubContainer, ApplicationDataCreateDisposition.Always);
            ApplicationData.Current.LocalSettings.Containers[AccountsContainer].CreateContainer(AuthoritySubContainer, ApplicationDataCreateDisposition.Always);
        }

async Task<List<WebAccount> > GetAllAccounts ( ) [inline, private]

Definition at line 93 of file MultipleAccountsScenario.xaml.cs.

        {
            List<WebAccount> accounts = new List<WebAccount>();

            ApplicationDataContainer AccountListContainer = ApplicationData.Current.LocalSettings.Containers[AccountsContainer];

            foreach (Object value in AccountListContainer.Containers[ProviderIdSubContainer].Values.Keys)
            {
                String accountID = value as String;
                String providerID = AccountListContainer.Containers[ProviderIdSubContainer].Values[accountID] as String;
                String authority = AccountListContainer.Containers[AuthoritySubContainer].Values[accountID] as String;

                WebAccountProvider provider = await GetProvider(providerID, authority);

                if (providerID == AppSpecificProviderId)
                {
                    accounts.Add(new WebAccount(provider, accountID, WebAccountState.None));
                }
                else
                {
                    WebAccount loadedAccount = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);
                    if(loadedAccount != null)
                    {
                        accounts.Add(loadedAccount);
                    }
                    else
                    {
                        // The account has been deleted
                        ApplicationDataContainer accountsContainer = ApplicationData.Current.LocalSettings.Containers[AccountsContainer];

                        accountsContainer.Containers[ProviderIdSubContainer].Values.Remove(accountID);
                        accountsContainer.Containers[AuthoritySubContainer].Values.Remove(accountID);
                    }
                }
            }

            return accounts;
        }

async Task<List<WebAccountProvider> > GetAllProviders ( ) [inline, private]

Definition at line 131 of file MultipleAccountsScenario.xaml.cs.

        {
            List<WebAccountProvider> providers = new List<WebAccountProvider>();
            providers.Add(await GetProvider(MicrosoftProviderId, MicrosoftAccountAuthority));
            providers.Add(await GetProvider(MicrosoftProviderId, AzureActiveDirectoryAuthority));
            providers.Add(await GetProvider(AppSpecificProviderId));

            return providers;
        }

async Task<WebAccountProvider> GetProvider | ( | string | ProviderID,
 |  | string | AuthorityId = "" |
 | ) |  |  | [inline, private]

Definition at line 142 of file MultipleAccountsScenario.xaml.cs.

        {
            if (ProviderID == AppSpecificProviderId)
            {
                return new WebAccountProvider(AppSpecificProviderId, AppSpecificProviderName, new Uri(this.BaseUri, "Assets/smallTile-sdk.png"));
            }
            else
            {
                return await WebAuthenticationCoreManager.FindAccountProviderAsync(ProviderID, AuthorityId);
            }
        }

async Task LogoffAndRemoveAccount ( WebAccount account ) [inline, private]

Definition at line 303 of file MultipleAccountsScenario.xaml.cs.

        {
            ApplicationDataContainer accountsContainer = ApplicationData.Current.LocalSettings.Containers[AccountsContainer];

            if(account.WebAccountProvider.Id != AppSpecificProviderId)
            {
                await account.SignOutAsync();

                accountsContainer.Containers[ProviderIdSubContainer].Values.Remove(account.Id);
                accountsContainer.Containers[AuthoritySubContainer].Values.Remove(account.Id);
            }
            else
            {
                //perform any actions needed to log off the app specific account
                accountsContainer.Containers[ProviderIdSubContainer].Values.Remove(account.UserName);
            }
        }

async Task LogoffAndRemoveAllAccounts ( ) [inline, private]

Definition at line 321 of file MultipleAccountsScenario.xaml.cs.

        {
            List<WebAccount> accounts = await GetAllAccounts();

            foreach(WebAccount account in accounts)
            {
                await LogoffAndRemoveAccount(account);
            }

            accounts = null;
        }

async void OnAccountCommandsRequested | ( | AccountsSettingsPane | sender,
 |  | AccountsSettingsPaneCommandsRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 154 of file MultipleAccountsScenario.xaml.cs.

        {
            // In order to make async calls within this callback, the deferral object is needed
            AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();

            // This scenario only supports a single account at one time.
            // If there already is an account, we do not include a provider in the list
            // This will prevent the add account button from showing up.
            await AddWebAccountProvidersToPane(e);
            await AddWebAccountsToPane(e);
            AddLinksAndDescription(e);

            deferral.Complete();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 66 of file MultipleAccountsScenario.xaml.cs.

        {
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 55 of file MultipleAccountsScenario.xaml.cs.

        {
            rootPage = MainPage.Current;

            CreateLocalDataContainers();

            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;

            IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AzureActiveDirectoryClientId);
        }

void OtherLinkInvoked ( IUICommand command ) [inline, private]

Definition at line 180 of file MultipleAccountsScenario.xaml.cs.

        {
            rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
        }

void OutputTokenResult ( WebTokenRequestResult result ) [inline]

Definition at line 278 of file MultipleAccountsScenario.xaml.cs.

        {
            if (result.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Web Token request successful for user:" + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + result.ResponseError, NotifyType.StatusMessage);
            }
        }

void PrivacyPolicyInvoked ( IUICommand command ) [inline, private]

Definition at line 185 of file MultipleAccountsScenario.xaml.cs.

        {
            rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
        }

void StoreNewAccountDataLocally ( WebAccount account ) [inline]

Definition at line 262 of file MultipleAccountsScenario.xaml.cs.

        {
            ApplicationDataContainer accountsContainer = ApplicationData.Current.LocalSettings.Containers[AccountsContainer];

            if (account.Id != "")
            {
                accountsContainer.Containers[ProviderIdSubContainer].Values[account.Id] = account.WebAccountProvider.Id;
                accountsContainer.Containers[AuthoritySubContainer].Values[account.Id] = account.WebAccountProvider.Authority;
            }
            else
            {
                accountsContainer.Containers[ProviderIdSubContainer].Values[account.UserName] = account.WebAccountProvider.Id;
            }

        }

async void WebAccountInvoked | ( | WebAccountCommand | command,
 |  | WebAccountInvokedArgs | args |
 | ) |  |  | [inline, private]

Definition at line 290 of file MultipleAccountsScenario.xaml.cs.

        {
            if (args.Action == WebAccountAction.Remove)
            {
                await LogoffAndRemoveAccount(command.WebAccount);
            }
            else if (args.Action == WebAccountAction.Manage)
            {
                // Display user management UI for this account
                rootPage.NotifyUser("Manage invoked for user: " + command.WebAccount.UserName, NotifyType.StatusMessage);
            }
        }

async void WebAccountProviderCommandInvoked ( WebAccountProviderCommand command ) [inline, private]

Definition at line 213 of file MultipleAccountsScenario.xaml.cs.

        {
            if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == MicrosoftAccountAuthority))
            {
                // ClientID is ignored by MSA
                await AuthenticateWithRequestToken(command.WebAccountProvider, MicrosoftAccountScopeRequested, MicrosoftAccountClientId);
            }
            else if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == AzureActiveDirectoryAuthority))
            {
                await AuthenticateWithRequestToken(command.WebAccountProvider, AzureActiveDirectoryScopeRequested, AzureActiveDirectoryClientId);
            }
            else if (command.WebAccountProvider.Id == AppSpecificProviderId)
            {
                // Show user registration/login for your app specific account type.
                // Store the user if registration/login successful
                StoreNewAccountDataLocally(new WebAccount(command.WebAccountProvider, "App Specific User(" + DateTime.Now + ")", WebAccountState.None));
            }
        }

Member Data Documentation

const string AccountsContainer = "accountssettingscontainer" [private]

Definition at line 35 of file MultipleAccountsScenario.xaml.cs.

const string AppSpecificProviderId = "myproviderid" [private]

Definition at line 32 of file MultipleAccountsScenario.xaml.cs.

const string AppSpecificProviderName = "App specific provider" [private]

Definition at line 33 of file MultipleAccountsScenario.xaml.cs.

const string AuthoritySubContainer = "authorities" [private]

Definition at line 37 of file MultipleAccountsScenario.xaml.cs.

const string AzureActiveDirectoryAuthority = "organizations" [private]

Definition at line 41 of file MultipleAccountsScenario.xaml.cs.

const string AzureActiveDirectoryClientId = "" [private]

Definition at line 47 of file MultipleAccountsScenario.xaml.cs.

const string AzureActiveDirectoryScopeRequested = "" [private]

Definition at line 48 of file MultipleAccountsScenario.xaml.cs.

const string MicrosoftAccountAuthority = "consumers" [private]

Definition at line 40 of file MultipleAccountsScenario.xaml.cs.

const string MicrosoftAccountClientId = "none" [private]

Definition at line 43 of file MultipleAccountsScenario.xaml.cs.

const string MicrosoftAccountScopeRequested = "wl.basic" [private]

Definition at line 44 of file MultipleAccountsScenario.xaml.cs.

const string MicrosoftProviderId = "https://login.microsoft.com" [private]

Definition at line 39 of file MultipleAccountsScenario.xaml.cs.

const string ProviderIdSubContainer = "providers" [private]

Definition at line 36 of file MultipleAccountsScenario.xaml.cs.

MainPage rootPage [private]

Definition at line 30 of file MultipleAccountsScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/MultipleAccountsScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SingleAccountScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • SingleAccountScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SingleAccountScenario Class Reference

List of all members.

Public Member Functions

SingleAccountScenario ()
async void | AuthenticateWithRequestToken (WebAccountProvider Provider, String Scope, String ClientID)
void | OutputTokenResult (WebTokenRequestResult result)
void | StoreNewAccountDataLocally (WebAccount account)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddLinksAndDescription (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountProvidersToPane (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountToPane (AccountsSettingsPaneCommandsRequestedEventArgs e)
async void | Button_Reset (object sender, RoutedEventArgs e)
void | Button_ShowAccountSettings (object sender, RoutedEventArgs e)
async Task< WebAccountProvider > | GetProvider (string ProviderID, string AuthorityId="")
async Task< WebAccount > | GetWebAccount ()
bool | HasAccountStored ()
async Task | LogoffAndRemoveAccount ()
async void | OnAccountCommandsRequested (AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e)
void | OtherLinkInvoked (IUICommand command)
void | PrivacyPolicyInvoked (IUICommand command)
void | RemoveAccountData ()
async void | WebAccountInvoked (WebAccountCommand command, WebAccountInvokedArgs args)
void | WebAccountProviderCommandInvoked (WebAccountProviderCommand command)

Private Attributes

const string | AppSpecificProviderId = "myproviderid"
const string | AppSpecificProviderName = "App specific provider"
const string | AzureActiveDirectoryAuthority = "organizations"
const string | AzureActiveDirectoryClientId = ""
const string | AzureActiveDirectoryScopeRequested = ""
const string | MicrosoftAccountAuthority = "consumers"
const string | MicrosoftAccountClientId = "none"
const string | MicrosoftAccountScopeRequested = "wl.basic"
const string | MicrosoftProviderId = "https://login.microsoft.com"
MainPage rootPage
const string | StoredAccountIdKey = "accountid"
const string | StoredAuthorityKey = "authority"
const string | StoredProviderIdKey = "providerid"

Detailed Description

Definition at line 29 of file SingleAccountScenario.xaml.cs.

Constructor & Destructor Documentation

SingleAccountScenario ( ) [inline]

Definition at line 51 of file SingleAccountScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddLinksAndDescription ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 115 of file SingleAccountScenario.xaml.cs.

        {
            e.HeaderText = "Describe what adding an account to your application will do for the user";

            // You can add links such as privacy policy, help, general account settings
            e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
            e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
        }

async Task AddWebAccountProvidersToPane ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 124 of file SingleAccountScenario.xaml.cs.

        {
            List<WebAccountProvider> providers = new List<WebAccountProvider>();

            // Microsoft account and Azure AD providers will always return. Non-installed plugins or incorrect identities will return null
            providers.Add(await GetProvider(MicrosoftProviderId, MicrosoftAccountAuthority));
            providers.Add(await GetProvider(MicrosoftProviderId, AzureActiveDirectoryAuthority));
            providers.Add(await GetProvider(AppSpecificProviderId));

            foreach (WebAccountProvider provider in providers)
            {
                WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
                e.WebAccountProviderCommands.Add(providerCommand);
            }
        }

async Task AddWebAccountToPane ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 168 of file SingleAccountScenario.xaml.cs.

        {
            WebAccount account = await GetWebAccount();

            WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove | SupportedWebAccountActions.Manage);
            e.WebAccountCommands.Add(command);
        }

async void AuthenticateWithRequestToken | ( | WebAccountProvider | Provider,
 |  | String | Scope,
 |  | String | ClientID |
 | ) |  |  | [inline]

Definition at line 217 of file SingleAccountScenario.xaml.cs.

        {
            try
            {
                WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);

                // Azure Active Directory requires a resource to return a token
                if(Provider.Id == "https://login.microsoft.com" && Provider.Authority == "organizations")
                {
                    webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
                }

                // If the user selected a specific account, RequestTokenAsync will return a token for that account.
                // The user may be prompted for credentials or to authorize using that account with your app
                // If the user selected a provider, the user will be prompted for credentials to login to a new account
                    WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);

                if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
                {
                    StoreNewAccountDataLocally(webTokenRequestResult.ResponseData[0].WebAccount);
                }

                OutputTokenResult(webTokenRequestResult);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Web Token request failed: " + ex, NotifyType.ErrorMessage);
            }
        }

async void Button_Reset | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file SingleAccountScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Resetting...", NotifyType.StatusMessage);

            await LogoffAndRemoveAccount();

            ((Button)sender).IsEnabled = true;
        }

void Button_ShowAccountSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file SingleAccountScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);

            AccountsSettingsPane.Show();

            ((Button)sender).IsEnabled = true;
        }

async Task<WebAccountProvider> GetProvider | ( | string | ProviderID,
 |  | string | AuthorityId = "" |
 | ) |  |  | [inline, private]

Definition at line 176 of file SingleAccountScenario.xaml.cs.

        {
            if (ProviderID == AppSpecificProviderId)
            {
                return new WebAccountProvider(AppSpecificProviderId, AppSpecificProviderName, new Uri(this.BaseUri, "Assets/smallTile-sdk.png"));
            }
            else
            {
                return await WebAuthenticationCoreManager.FindAccountProviderAsync(ProviderID, AuthorityId);
            }
        }

async Task<WebAccount> GetWebAccount ( ) [inline, private]

Definition at line 140 of file SingleAccountScenario.xaml.cs.

        {
            String accountID = ApplicationData.Current.LocalSettings.Values[StoredAccountIdKey] as String;
            String providerID = ApplicationData.Current.LocalSettings.Values[StoredProviderIdKey] as String;
            String authority = ApplicationData.Current.LocalSettings.Values[StoredAuthorityKey] as String;

            WebAccount account;

            WebAccountProvider provider = await GetProvider(providerID);

            if (providerID == AppSpecificProviderId)
            {
                account = new WebAccount(provider, accountID, WebAccountState.None);
            }
            else
            {
                account = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);

                // The account has been deleted if FindAccountAsync returns null
                if (account == null)
                {
                    RemoveAccountData();
                }
            }

            return account;
        }

bool HasAccountStored ( ) [inline, private]

Definition at line 297 of file SingleAccountScenario.xaml.cs.

        {
            return (ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountIdKey) &&
                ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredProviderIdKey) &&
                ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAuthorityKey));
        }

async Task LogoffAndRemoveAccount ( ) [inline, private]

Definition at line 304 of file SingleAccountScenario.xaml.cs.

        {
            if (HasAccountStored())
            {
                WebAccount account = await GetWebAccount();

                // Check if the account has been deleted already by Token Broker
                if (account != null)
                {
                    if (account.WebAccountProvider.Id == AppSpecificProviderId)
                    {
                        // perform actions to sign out of the app specific provider
                    }
                    else
                    {
                        await account.SignOutAsync();
                    }
                }
                account = null;
                RemoveAccountData();
            }
        }

async void OnAccountCommandsRequested | ( | AccountsSettingsPane | sender,
 |  | AccountsSettingsPaneCommandsRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file SingleAccountScenario.xaml.cs.

        {
            // In order to make async calls within this callback, the deferral object is needed
            AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();

            // This scenario only lets the user have one account at a time.
            // If there already is an account, we do not include a provider in the list
            // This will prevent the add account button from showing up.
            if (HasAccountStored())
            {
                await AddWebAccountToPane(e);
            }
            else
            {
                await AddWebAccountProvidersToPane(e);
            }

            AddLinksAndDescription(e);

            deferral.Complete();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 64 of file SingleAccountScenario.xaml.cs.

        {
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 56 of file SingleAccountScenario.xaml.cs.

        {
            rootPage = MainPage.Current;
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;

            IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AzureActiveDirectoryClientId);
        }

void OtherLinkInvoked ( IUICommand command ) [inline, private]

Definition at line 188 of file SingleAccountScenario.xaml.cs.

        {
            rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
        }

void OutputTokenResult ( WebTokenRequestResult result ) [inline]

Definition at line 271 of file SingleAccountScenario.xaml.cs.

        {
            if (result.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Web Token request successful for user:" + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + result.ResponseStatus + " Code: " + result.ResponseError.ErrorMessage, NotifyType.StatusMessage);
            }
        }

void PrivacyPolicyInvoked ( IUICommand command ) [inline, private]

Definition at line 193 of file SingleAccountScenario.xaml.cs.

        {
            rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
        }

void RemoveAccountData ( ) [inline, private]

Definition at line 327 of file SingleAccountScenario.xaml.cs.

        {
            ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountIdKey);
            ApplicationData.Current.LocalSettings.Values.Remove(StoredProviderIdKey);
            ApplicationData.Current.LocalSettings.Values.Remove(StoredAuthorityKey);
        }

void StoreNewAccountDataLocally ( WebAccount account ) [inline]

Definition at line 247 of file SingleAccountScenario.xaml.cs.

        {
            if (account.Id != "")
            {
                ApplicationData.Current.LocalSettings.Values["AccountID"] = account.Id;
            }
            else
            {
                // It's a custom account
                ApplicationData.Current.LocalSettings.Values["AccountID"] = account.UserName;
            }

            ApplicationData.Current.LocalSettings.Values["ProviderID"] = account.WebAccountProvider.Id;
            if (account.WebAccountProvider.Authority != null)
            {
                ApplicationData.Current.LocalSettings.Values["Authority"] = account.WebAccountProvider.Authority;
            }
            else
            {
                ApplicationData.Current.LocalSettings.Values["Authority"] = "";
            }
        }

async void WebAccountInvoked | ( | WebAccountCommand | command,
 |  | WebAccountInvokedArgs | args |
 | ) |  |  | [inline, private]

Definition at line 283 of file SingleAccountScenario.xaml.cs.

        {
            if (args.Action == WebAccountAction.Remove)
            {
                rootPage.NotifyUser("Removing account", NotifyType.StatusMessage);
                await LogoffAndRemoveAccount();
            }
            else if (args.Action == WebAccountAction.Manage)
            {
                // Display user management UI for this account
                rootPage.NotifyUser("Managing account", NotifyType.StatusMessage);
            }
        }

void WebAccountProviderCommandInvoked ( WebAccountProviderCommand command ) [inline, private]

Definition at line 198 of file SingleAccountScenario.xaml.cs.

        {
            if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == MicrosoftAccountAuthority))
            {
                // ClientID is ignored by MSA
                AuthenticateWithRequestToken(command.WebAccountProvider, MicrosoftAccountScopeRequested, MicrosoftAccountClientId);
            }
            else if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == AzureActiveDirectoryAuthority))
            {
                AuthenticateWithRequestToken(command.WebAccountProvider, AzureActiveDirectoryAuthority, AzureActiveDirectoryClientId);
            }
            else if (command.WebAccountProvider.Id == AppSpecificProviderId)
            {
                // Show user registration/login for your app specific account type.
                // Store the user if registration/login successful
                StoreNewAccountDataLocally(new WebAccount(command.WebAccountProvider, "App Specific User", WebAccountState.None));
            }
        }

Member Data Documentation

const string AppSpecificProviderId = "myproviderid" [private]

Definition at line 33 of file SingleAccountScenario.xaml.cs.

const string AppSpecificProviderName = "App specific provider" [private]

Definition at line 34 of file SingleAccountScenario.xaml.cs.

const string AzureActiveDirectoryAuthority = "organizations" [private]

Definition at line 38 of file SingleAccountScenario.xaml.cs.

const string AzureActiveDirectoryClientId = "" [private]

Definition at line 48 of file SingleAccountScenario.xaml.cs.

const string AzureActiveDirectoryScopeRequested = "" [private]

Definition at line 49 of file SingleAccountScenario.xaml.cs.

const string MicrosoftAccountAuthority = "consumers" [private]

Definition at line 37 of file SingleAccountScenario.xaml.cs.

const string MicrosoftAccountClientId = "none" [private]

Definition at line 44 of file SingleAccountScenario.xaml.cs.

const string MicrosoftAccountScopeRequested = "wl.basic" [private]

Definition at line 45 of file SingleAccountScenario.xaml.cs.

const string MicrosoftProviderId = "https://login.microsoft.com" [private]

Definition at line 36 of file SingleAccountScenario.xaml.cs.

MainPage rootPage [private]

Definition at line 31 of file SingleAccountScenario.xaml.cs.

const string StoredAccountIdKey = "accountid" [private]

Definition at line 40 of file SingleAccountScenario.xaml.cs.

const string StoredAuthorityKey = "authority" [private]

Definition at line 42 of file SingleAccountScenario.xaml.cs.

const string StoredProviderIdKey = "providerid" [private]

Definition at line 41 of file SingleAccountScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/SingleAccountScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SingleAzureADScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • SingleAzureADScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SingleAzureADScenario Class Reference

List of all members.

Public Member Functions

SingleAzureADScenario ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddLinksAndDescription (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccount (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountProvider (AccountsSettingsPaneCommandsRequestedEventArgs e)
async void | Button_Reset (object sender, RoutedEventArgs e)
void | Button_ShowAccountSettings (object sender, RoutedEventArgs e)
async Task | LogoffAndRemoveAccount ()
async void | OnAccountCommandsRequested (AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e)
void | OtherLinkInvoked (IUICommand command)
void | OutputTokenResult (WebTokenRequestResult result)
void | PrivacyPolicyInvoked (IUICommand command)
async Task | RequestTokenAndSaveAccount (WebAccountProvider Provider, String Scope, String ClientID)
async void | WebAccountInvoked (WebAccountCommand command, WebAccountInvokedArgs args)
async void | WebAccountProviderCommandInvoked (WebAccountProviderCommand command)

Private Attributes

const string | AccountClientId = ""
const string | AccountScopeRequested = ""
const string | AzureADAuthority = "organizations"
const string | MicrosoftAccountProviderId = "https://login.microsoft.com"
MainPage rootPage
const string | StoredAccountKey = "azureaccountid"

Detailed Description

Definition at line 26 of file SingleAzureADScenario.xaml.cs.

Constructor & Destructor Documentation

SingleAzureADScenario ( ) [inline]

Definition at line 38 of file SingleAzureADScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddLinksAndDescription ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 144 of file SingleAzureADScenario.xaml.cs.

        {
            e.HeaderText = "Describe what adding an account to your application will do for the user";

            // You can add links such as privacy policy, help, general account settings
            e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
            e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
        }

async Task AddWebAccount ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 125 of file SingleAzureADScenario.xaml.cs.

        {
            WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);

            String accountID = (String)ApplicationData.Current.LocalSettings.Values[StoredAccountKey];
            WebAccount account = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);

            if (account == null)
            {
                // The account has most likely been deleted in Windows settings
                // Unless there would be significant data loss, you should just delete the account
                // If there would be significant data loss, prompt the user to either re-add the account, or to remove it
                ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);
            }

            WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove);
            e.WebAccountCommands.Add(command);
        }

async Task AddWebAccountProvider ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 111 of file SingleAzureADScenario.xaml.cs.

        {
            // FindAccountProviderAsync returns the WebAccountProvider of an installed plugin
            // The Provider and Authority specifies the specific plugin
            // This scenario only supports Microsoft accounts.

            // The Microsoft account provider is always present in Windows 10 devices, as is the Azure AD plugin.
            // If a non-installed plugin or incorect identity is specified, FindAccountProviderAsync will return null
            WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);

            WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
            e.WebAccountProviderCommands.Add(providerCommand);
        }

async void Button_Reset | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 70 of file SingleAzureADScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Resetting...", NotifyType.StatusMessage);

            await LogoffAndRemoveAccount();

            ((Button)sender).IsEnabled = true;

        }

void Button_ShowAccountSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file SingleAzureADScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);

            AccountsSettingsPane.Show();

            ((Button)sender).IsEnabled = true;
        }

async Task LogoffAndRemoveAccount ( ) [inline, private]

Definition at line 224 of file SingleAzureADScenario.xaml.cs.

        {
            if (ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey))
            {
                WebAccountProvider providertoDelete = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);

                WebAccount accountToDelete = await WebAuthenticationCoreManager.FindAccountAsync(providertoDelete, (string)ApplicationData.Current.LocalSettings.Values[StoredAccountKey]);

                if(accountToDelete != null)
                {
                    await accountToDelete.SignOutAsync();
                }

                ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);

                SignInButton.Content = "Sign in";
            }
        }

async void OnAccountCommandsRequested | ( | AccountsSettingsPane | sender,
 |  | AccountsSettingsPaneCommandsRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file SingleAzureADScenario.xaml.cs.

        {
            // In order to make async calls within this callback, the deferral object is needed
            AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();

            // This scenario only lets the user have one account at a time.
            // If there already is an account, we do not include a provider in the list
            // This will prevent the add account button from showing up.
            bool isPresent = ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey);

            if (isPresent)
            {
                await AddWebAccount(e);
            }
            else
            {
                await AddWebAccountProvider(e);
            }

            AddLinksAndDescription(e);

            deferral.Complete();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file SingleAzureADScenario.xaml.cs.

        {
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file SingleAzureADScenario.xaml.cs.

        {
            rootPage = MainPage.Current;

            // The AccountCommandsRequested event triggers before the Accounts settings pane is displayed
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;

            IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AccountClientId);
        }

void OtherLinkInvoked ( IUICommand command ) [inline, private]

Definition at line 172 of file SingleAzureADScenario.xaml.cs.

        {
            rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
        }

void OutputTokenResult ( WebTokenRequestResult result ) [inline, private]

Definition at line 211 of file SingleAzureADScenario.xaml.cs.

        {
            if (result.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Web Token request successful for user: " + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
                SignInButton.Content = "Account";
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + result.ResponseError, NotifyType.StatusMessage);
            }
        }

void PrivacyPolicyInvoked ( IUICommand command ) [inline, private]

Definition at line 167 of file SingleAzureADScenario.xaml.cs.

        {
            rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
        }

async Task RequestTokenAndSaveAccount | ( | WebAccountProvider | Provider,
 |  | String | Scope,
 |  | String | ClientID |
 | ) |  |  | [inline, private]

Definition at line 177 of file SingleAzureADScenario.xaml.cs.

        {
            try
            {
                WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);

                webTokenRequest.Properties.Add("resource", "https://graph.windows.net");

                rootPage.NotifyUser("Requesting Web Token", NotifyType.StatusMessage);

                // If the user selected a specific account, RequestTokenAsync will return a token for that account.
                // The user may be prompted for credentials or to authorize using that account with your app
                // If the user selected a provider, the user will be prompted for credentials to login to a new account
                WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);

                // If a token was successfully returned, then store the WebAccount Id into local app data
                // This Id can be used to retrieve the account whenever needed. To later get a token with that account
                // First retrieve the account with FindAccountAsync, and include that webaccount
                // as a parameter to RequestTokenAsync or RequestTokenSilentlyAsync
                if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
                {
                    ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);

                    ApplicationData.Current.LocalSettings.Values[StoredAccountKey] = webTokenRequestResult.ResponseData[0].WebAccount.Id;
                }

                OutputTokenResult(webTokenRequestResult);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Web Token request failed: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

async void WebAccountInvoked | ( | WebAccountCommand | command,
 |  | WebAccountInvokedArgs | args |
 | ) |  |  | [inline, private]

Definition at line 158 of file SingleAzureADScenario.xaml.cs.

        {
            if (args.Action == WebAccountAction.Remove)
            {
                rootPage.NotifyUser("Removing account", NotifyType.StatusMessage);
                await LogoffAndRemoveAccount();
            }
        }

async void WebAccountProviderCommandInvoked ( WebAccountProviderCommand command ) [inline, private]

Definition at line 153 of file SingleAzureADScenario.xaml.cs.

        {
            await RequestTokenAndSaveAccount(command.WebAccountProvider, AccountScopeRequested, AccountClientId);
        }

Member Data Documentation

const string AccountClientId = "" [private]

Definition at line 35 of file SingleAzureADScenario.xaml.cs.

const string AccountScopeRequested = "" [private]

Definition at line 34 of file SingleAzureADScenario.xaml.cs.

const string AzureADAuthority = "organizations" [private]

Definition at line 33 of file SingleAzureADScenario.xaml.cs.

const string MicrosoftAccountProviderId = "https://login.microsoft.com" [private]

Definition at line 32 of file SingleAzureADScenario.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file SingleAzureADScenario.xaml.cs.

const string StoredAccountKey = "azureaccountid" [private]

Definition at line 36 of file SingleAzureADScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/SingleAzureADScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SingleMicrosoftAccountScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Accounts
  • SingleMicrosoftAccountScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SingleMicrosoftAccountScenario Class Reference

List of all members.

Public Member Functions

SingleMicrosoftAccountScenario ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddLinksAndDescription (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccount (AccountsSettingsPaneCommandsRequestedEventArgs e)
async Task | AddWebAccountProvider (AccountsSettingsPaneCommandsRequestedEventArgs e)
async void | Button_Reset (object sender, RoutedEventArgs e)
void | Button_ShowAccountSettings (object sender, RoutedEventArgs e)
async Task | LogoffAndRemoveAccount ()
async void | OnAccountCommandsRequested (AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e)
void | OtherLinkInvoked (IUICommand command)
void | OutputTokenResult (WebTokenRequestResult result)
void | PrivacyPolicyInvoked (IUICommand command)
async Task | RequestTokenAndSaveAccount (WebAccountProvider Provider, String Scope, String ClientID)
async void | WebAccountInvoked (WebAccountCommand command, WebAccountInvokedArgs args)
async void | WebAccountProviderCommandInvoked (WebAccountProviderCommand command)

Private Attributes

const string | AccountClientId = "none"
const string | AccountScopeRequested = "wl.basic"
const string | ConsumerAuthority = "consumers"
const string | MicrosoftAccountProviderId = "https://login.microsoft.com"
MainPage rootPage
const string | StoredAccountKey = "accountid"

Detailed Description

Definition at line 27 of file SingleMicrosoftAccountScenario.xaml.cs.

Constructor & Destructor Documentation

SingleMicrosoftAccountScenario ( ) [inline]

Definition at line 39 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddLinksAndDescription ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 145 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            e.HeaderText = "Describe what adding an account to your application will do for the user";

            // You can add links such as privacy policy, help, general account settings
            e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
            e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
        }

async Task AddWebAccount ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 126 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, ConsumerAuthority);

            String accountID = (String)ApplicationData.Current.LocalSettings.Values[StoredAccountKey];
            WebAccount account = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);

            if (account == null)
            {
                // The account has most likely been deleted in Windows settings
                // Unless there would be significant data loss, you should just delete the account
                // If there would be significant data loss, prompt the user to either re-add the account, or to remove it
                ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);
            }

            WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove);
            e.WebAccountCommands.Add(command);
        }

async Task AddWebAccountProvider ( AccountsSettingsPaneCommandsRequestedEventArgs e ) [inline, private]

Definition at line 112 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            // FindAccountProviderAsync returns the WebAccountProvider of an installed plugin
            // The Provider and Authority specifies the specific plugin
            // This scenario only supports Microsoft accounts.

            // The Microsoft account provider is always present in Windows 10 devices, as is the Azure AD plugin.
            // If a non-installed plugin or incorect identity is specified, FindAccountProviderAsync will return null
            WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, ConsumerAuthority);

            WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
            e.WebAccountProviderCommands.Add(providerCommand);
        }

async void Button_Reset | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Resetting...", NotifyType.StatusMessage);

            await LogoffAndRemoveAccount();

            ((Button)sender).IsEnabled = true;

        }

void Button_ShowAccountSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            ((Button)sender).IsEnabled = false;

            rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);

            AccountsSettingsPane.Show();

            ((Button)sender).IsEnabled = true;
        }

async Task LogoffAndRemoveAccount ( ) [inline, private]

Definition at line 223 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            if (ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey))
            {
                WebAccountProvider providertoDelete = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, ConsumerAuthority);

                WebAccount accountToDelete = await WebAuthenticationCoreManager.FindAccountAsync(providertoDelete, (string)ApplicationData.Current.LocalSettings.Values[StoredAccountKey]);

                if(accountToDelete != null)
                {
                    await accountToDelete.SignOutAsync();
                }

                ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);

                SignInButton.Content = "Sign in";
            }
        }

async void OnAccountCommandsRequested | ( | AccountsSettingsPane | sender,
 |  | AccountsSettingsPaneCommandsRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 85 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            // In order to make async calls within this callback, the deferral object is needed
            AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();

            // This scenario only lets the user have one account at a time.
            // If there already is an account, we do not include a provider in the list
            // This will prevent the add account button from showing up.
            bool isPresent = ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey);

            if (isPresent)
            {
                await AddWebAccount(e);
            }
            else
            {
                await AddWebAccountProvider(e);
            }

            AddLinksAndDescription(e);

            deferral.Complete();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 54 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            rootPage = MainPage.Current;

            // The AccountCommandsRequested event triggers before the Accounts settings pane is displayed
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;

            IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning);
        }

void OtherLinkInvoked ( IUICommand command ) [inline, private]

Definition at line 174 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
        }

void OutputTokenResult ( WebTokenRequestResult result ) [inline, private]

Definition at line 210 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            if (result.ResponseStatus == WebTokenRequestStatus.Success)
            {
                rootPage.NotifyUser("Web Token request successful for user: " + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
                SignInButton.Content = "Account";
            }
            else
            {
                rootPage.NotifyUser("Web Token request error: " + result.ResponseError, NotifyType.StatusMessage);
            }
        }

void PrivacyPolicyInvoked ( IUICommand command ) [inline, private]

Definition at line 169 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
        }

async Task RequestTokenAndSaveAccount | ( | WebAccountProvider | Provider,
 |  | String | Scope,
 |  | String | ClientID |
 | ) |  |  | [inline, private]

Definition at line 179 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            try
            {
                WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);
                rootPage.NotifyUser("Requesting Web Token", NotifyType.StatusMessage);

                // If the user selected a specific account, RequestTokenAsync will return a token for that account.
                // The user may be prompted for credentials or to authorize using that account with your app
                // If the user selected a provider, the user will be prompted for credentials to login to a new account
                WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);

                // If a token was successfully returned, then store the WebAccount Id into local app data
                // This Id can be used to retrieve the account whenever needed. To later get a token with that account
                // First retrieve the account with FindAccountAsync, and include that webaccount
                // as a parameter to RequestTokenAsync or RequestTokenSilentlyAsync
                if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
                {
                    ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);

                    ApplicationData.Current.LocalSettings.Values[StoredAccountKey] = webTokenRequestResult.ResponseData[0].WebAccount.Id;
                }

                OutputTokenResult(webTokenRequestResult);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Web Token request failed: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

async void WebAccountInvoked | ( | WebAccountCommand | command,
 |  | WebAccountInvokedArgs | args |
 | ) |  |  | [inline, private]

Definition at line 160 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            if (args.Action == WebAccountAction.Remove)
            {
                rootPage.NotifyUser("Removing account", NotifyType.StatusMessage);
                await LogoffAndRemoveAccount();
            }
        }

async void WebAccountProviderCommandInvoked ( WebAccountProviderCommand command ) [inline, private]

Definition at line 154 of file SingleMicrosoftAccountScenario.xaml.cs.

        {
            // ClientID is ignored by MSA
            await RequestTokenAndSaveAccount(command.WebAccountProvider, AccountScopeRequested, AccountClientId);
        }

Member Data Documentation

const string AccountClientId = "none" [private]

Definition at line 36 of file SingleMicrosoftAccountScenario.xaml.cs.

const string AccountScopeRequested = "wl.basic" [private]

Definition at line 35 of file SingleMicrosoftAccountScenario.xaml.cs.

const string ConsumerAuthority = "consumers" [private]

Definition at line 34 of file SingleMicrosoftAccountScenario.xaml.cs.

const string MicrosoftAccountProviderId = "https://login.microsoft.com" [private]

Definition at line 33 of file SingleMicrosoftAccountScenario.xaml.cs.

MainPage rootPage [private]

Definition at line 29 of file SingleMicrosoftAccountScenario.xaml.cs.

const string StoredAccountKey = "accountid" [private]

Definition at line 37 of file SingleMicrosoftAccountScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAccountManagement/cs/SingleMicrosoftAccountScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • App
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

App Class Reference

Provides application-specific behavior to supplement the default Application class. More...

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnActivated (IActivatedEventArgs args)
async override void | OnLaunched (LaunchActivatedEventArgs e)

Properties

static NavigationService | NavigationService [get, set]

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)
string | SemanticInterpretation (string interpretationKey, SpeechRecognitionResult speechRecognitionResult)

Private Attributes

RootFrameNavigationHelper rootFrameNavigationHelper

Detailed Description

Contains initialization of the NavigationService, and handles Activation via methods other than normal user interaction (For example, voice commands/Cortana or URI invoking)

Definition at line 31 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 37 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

OnActivated is the entry point for an application when it is launched via means other normal user interaction.

This includes Voice Commands, URI activation, being used as a share target from another app, etc. Here, we're going to handle the Voice Command activation from Cortana.

Note: Be aware that an older VCD could still be in place for your application if you modify it and update your app via the store. You should be aware that you could get activations that include commands in older versions of your VCD, and you should try to handle them gracefully.

Parameters:
args Details about the activation method, including the activation phrase (for voice commands) and the semantic interpretation, parameters, etc.

Definition at line 154 of file App.xaml.cs.

        {
            base.OnActivated(args);

            Type navigationToPageType;
            ViewModel.TripVoiceCommand? navigationCommand = null;

            // If the app was launched via a Voice Command, this corresponds to the "show trip to <location>" command.
            // Protocol activation occurs when a tile is clicked within Cortana (via the background task)
            if (args.Kind == ActivationKind.VoiceCommand)
            {
                // The arguments can represent many different activation types. Cast it so we can get the
                // parameters we care about out.
                var commandArgs = args as VoiceCommandActivatedEventArgs;

                Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;

                // Get the name of the voice command and the text spoken. See AdventureWorksCommands.xml for
                // the <Command> tags this can be filled with.
                string voiceCommandName = speechRecognitionResult.RulePath[0];
                string textSpoken = speechRecognitionResult.Text;

                // The commandMode is either "voice" or "text", and it indictes how the voice command
                // was entered by the user.
                // Apps should respect "text" mode by providing feedback in silent form.
                string commandMode = this.SemanticInterpretation("commandMode", speechRecognitionResult);

                switch (voiceCommandName)
                {
                    case "showTripToDestination":
                        // Access the value of the {destination} phrase in the voice command
                        string destination = this.SemanticInterpretation("destination", speechRecognitionResult);

                        // Create a navigation command object to pass to the page. Any object can be passed in,
                        // here we're using a simple struct.
                        navigationCommand = new ViewModel.TripVoiceCommand(
                            voiceCommandName,
                            commandMode,
                            textSpoken,
                            destination);

                        // Set the page to navigate to for this voice command.
                        navigationToPageType = typeof(View.TripDetails);
                        break;
                    default:
                        // If we can't determine what page to launch, go to the default entry point.
                        navigationToPageType = typeof(View.TripListView);
                        break;
                }
            }
            else if (args.Kind == ActivationKind.Protocol)
            {
                // Extract the launch context. In this case, we're just using the destination from the phrase set (passed
                // along in the background task inside Cortana), which makes no attempt to be unique. A unique id or
                // identifier is ideal for more complex scenarios. We let the destination page check if the
                // destination trip still exists, and navigate back to the trip list if it doesn't.
                var commandArgs = args as ProtocolActivatedEventArgs;
                Windows.Foundation.WwwFormUrlDecoder decoder = new Windows.Foundation.WwwFormUrlDecoder(commandArgs.Uri.Query);
                var destination = decoder.GetFirstValueByName("LaunchContext");

                navigationCommand = new ViewModel.TripVoiceCommand(
                                        "protocolLaunch",
                                        "text",
                                        "destination",
                                        destination);

                navigationToPageType = typeof(View.TripDetails);
            }
            else
            {
                // If we were launched via any other mechanism, fall back to the main page view.
                // Otherwise, we'll hang at a splash screen.
                navigationToPageType = typeof(View.TripListView);
            }

            // Re"peat the same basic initialization as OnLaunched() above, taking into account whether
            // or not the app is already active.
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                App.NavigationService = new NavigationService(rootFrame);

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            // Since we're expecting to always show a details page, navigate even if
            // a content frame is in place (unlike OnLaunched).
            // Navigate to either the main trip list page, or if a valid voice command
            // was provided, to the details page for that trip.
            rootFrame.Navigate(navigationToPageType, navigationCommand);

            // Ensure the current window is active
            Window.Current.Activate();
        }

async override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to respond to voice commands, or URI invoked. This also installs the voice commands into cortana.

Parameters:
e Details about the launch request and process.

Definition at line 57 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                App.NavigationService = new NavigationService(rootFrame);

                // Use the RootFrameNavigationHelper to respond to keyboard and mouse shortcuts.
                this.rootFrameNavigationHelper = new RootFrameNavigationHelper(rootFrame);

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // Determine if we're being activated normally, or with arguments from Cortana.
                if (string.IsNullOrEmpty(e.Arguments))
                {
                    // Launching normally.
                    rootFrame.Navigate(typeof(View.TripListView), "");
                }
                else
                {
                    // Launching with arguments. We assume, for now, that this is likely
                    // to be in the form of "destination=<location>" from activation via Cortana.
                    rootFrame.Navigate(typeof(View.TripDetails), e.Arguments);
                }
            }
            // Ensure the current window is active
            Window.Current.Activate();

            try
            {
                // Install the main VCD. Since there's no simple way to test that the VCD has been imported, or that it's your most recent
                // version, it's not unreasonable to do this upon app load.
                StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(@"AdventureWorksCommands.xml");

                await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(vcdStorageFile);

                // Update phrase list.
                ViewModel.ViewModelLocator locator = App.Current.Resources["ViewModelLocator"] as ViewModel.ViewModelLocator;
                if(locator != null)
                {
                    await locator.TripViewModel.UpdateDestinationPhraseList();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Installing Voice Commands Failed: " + ex.ToString());
            }
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 122 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 134 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            deferral.Complete();
        }

string SemanticInterpretation | ( | string | interpretationKey,
 |  | SpeechRecognitionResult | speechRecognitionResult |
 | ) |  |  | [inline, private]

Returns the semantic interpretation of a speech result.

Returns null if there is no interpretation for that key.

Parameters:
interpretationKey | The interpretation key.
speechRecognitionResult | The result to get an interpretation from.
Returns:

Definition at line 264 of file App.xaml.cs.

        {
            return speechRecognitionResult.SemanticInterpretation.Properties[interpretationKey].FirstOrDefault();
        }

Member Data Documentation

RootFrameNavigationHelper rootFrameNavigationHelper [private]

Definition at line 49 of file App.xaml.cs.

Property Documentation

NavigationService NavigationService [static, get, set]

Navigation service, provides a decoupled way to trigger the UI Frame to transition between views.

Definition at line 47 of file App.xaml.cs.

The documentation for this class was generated from the following files:
  • CortanaVoiceCommand/cs/AdventureWorks/App.xaml.cs
  • CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeOffsetConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • DateTimeOffsetConverter
Public Member Functions

DateTimeOffsetConverter Class Reference

Convert a DateTime to a DateTimeOffset for use by a DatePicker, and back to allow for two-day data-binding.

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 25 of file DateTimeOffsetConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Convert a DateTime to a DateTimeOffset.

Parameters:
value | The DateTime to convert
targetType | Ignored.
parameter | Ignored.
language | Ignored.
Returns:

Definition at line 35 of file DateTimeOffsetConverter.cs.

        {
            try
            {
                if(value == null)
                {
                    return "";
                }

                DateTime date = (DateTime)value;
                return string.Format(
                    "{0:dddd MMMM dd yyyy}",
                    date);
            }
            catch (Exception)
            {
                return "";
            }
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Convert a DateTimeOffset to a DateTime.

Parameters:
value | DateTimeOffset to convert.
targetType | Ignored.
parameter | Ignored.
language | Ignored.
Returns:

Definition at line 63 of file DateTimeOffsetConverter.cs.

        {
            try
            {
                string dateText = (string)value;
                DateTime date;
                if (DateTime.TryParse(dateText, out date))
                {
                    return date;
                }

                return null;
            }
            catch (Exception)
            {
                return null;
            }

        }

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/DateTimeOffsetConverter.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: INavigationService Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • INavigationService
Public Member Functions

INavigationService Interface Reference

Navigation service interface, allows a test implementation to be substituted in its place.

Inherited by NavigationService.

List of all members.

Public Member Functions

void | GoBack ()
bool | Navigate (Type source, object parameter=null)
bool | Navigate< T > (object parameter=null)

Detailed Description

Definition at line 19 of file INavigationService.cs.

Member Function Documentation

void GoBack ( )

Implemented in NavigationService.

bool Navigate | ( | Type | source,
 |  | object | parameter = null
 | ) |  |

Implemented in NavigationService.

bool Navigate< T > ( object parameter = null )

Implemented in NavigationService.

The documentation for this interface was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/INavigationService.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoadStateEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • LoadStateEventArgs
Public Member Functions | Properties

LoadStateEventArgs Class Reference

Class used to hold the event data required when a page attempts to load state.

List of all members.

Public Member Functions

LoadStateEventArgs (Object navigationParameter, Dictionary< string, Object > pageState)

Properties

Object | NavigationParameter [get, set]
Dictionary< string, Object > | PageState [get, set]

Detailed Description

Definition at line 322 of file NavigationHelper.cs.

Constructor & Destructor Documentation

LoadStateEventArgs | ( | Object | navigationParameter,
 |  | Dictionary< string, Object > | pageState |
 | ) |  |  | [inline]

Initializes a new instance of the LoadStateEventArgs class.

Parameters:
navigationParameter | The parameter value passed to Frame.Navigate(Type, Object) when this page was initially requested.
pageState | A dictionary of state preserved by this page during an earlier session. This will be null the first time a page is visited.

Definition at line 346 of file NavigationHelper.cs.

            : base()
        {
            this.NavigationParameter = navigationParameter;
            this.PageState = pageState;
        }

Property Documentation

Object NavigationParameter [get, set]

The parameter value passed to Frame.Navigate(Type, Object) when this page was initially requested.

Definition at line 328 of file NavigationHelper.cs.

Dictionary<string, Object> PageState [get, set]

A dictionary of state preserved by this page during an earlier session.

This will be null the first time a page is visited.

Definition at line 333 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NavigationHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • NavigationHelper
Public Member Functions | Properties | Events | Private Attributes

NavigationHelper Class Reference

NavigationHelper aids in navigation between pages. More...

List of all members.

Public Member Functions

NavigationHelper (Page page)
void | OnNavigatedFrom (NavigationEventArgs e)
void | OnNavigatedTo (NavigationEventArgs e)

Properties

Frame | Frame [get]
Page | Page [get, set]

Events

LoadStateEventHandler | LoadState
SaveStateEventHandler | SaveState

Private Attributes

String | _pageKey

Detailed Description

It manages the backstack and integrates SuspensionManager to handle process lifetime management and state management when navigating between pages.

To make use of NavigationHelper, follow these two steps or start with a BasicPage or any other Page item template other than BlankPage.

1) Create an instance of the NavigationHelper somewhere such as in the constructor for the page and register a callback for the LoadState and SaveState events.

            public MyPage()
            {
                this.InitializeComponent();
                this.navigationHelper = new NavigationHelper(this);
                this.navigationHelper.LoadState += navigationHelper_LoadState;
                this.navigationHelper.SaveState += navigationHelper_SaveState;
            }

            private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
            { }
            private void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
            { }

2) Register the page to call into the NavigationManager whenever the page participates in navigation by overriding the Windows.UI.Xaml.Controls.Page.OnNavigatedTo and Windows.UI.Xaml.Controls.Page.OnNavigatedFrom events.

            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                navigationHelper.OnNavigatedTo(e);
            }

            protected override void OnNavigatedFrom(NavigationEventArgs e)
            {
                navigationHelper.OnNavigatedFrom(e);
            }

Definition at line 58 of file NavigationHelper.cs.

Constructor & Destructor Documentation

NavigationHelper ( Page page ) [inline]

Initializes a new instance of the NavigationHelper class.

Parameters:
page A reference to the current page used for navigation. This reference allows for frame manipulation.

Definition at line 68 of file NavigationHelper.cs.

        {
            this.Page = page;
        }

Member Function Documentation

void OnNavigatedFrom ( NavigationEventArgs e ) [inline]

Invoked when this page will no longer be displayed in a Frame.

This method calls SaveState, where all page specific navigation and process lifetime management logic should be placed.

Parameters:
e Event data that describes how this page was reached. The Parameter property provides the group to be displayed.

Definition at line 140 of file NavigationHelper.cs.

        {
            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
            var pageState = new Dictionary<String, Object>();
            if (this.SaveState != null)
            {
                this.SaveState(this, new SaveStateEventArgs(pageState));
            }
            frameState[_pageKey] = pageState;
        }

void OnNavigatedTo ( NavigationEventArgs e ) [inline]

Invoked when this page is about to be displayed in a Frame.

This method calls LoadState, where all page specific navigation and process lifetime management logic should be placed.

Parameters:
e Event data that describes how this page was reached. The Parameter property provides the group to be displayed.

Definition at line 98 of file NavigationHelper.cs.

        {
            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
            this._pageKey = "Page-" + this.Frame.BackStackDepth;

            if (e.NavigationMode == NavigationMode.New)
            {
                // Clear existing state for forward navigation when adding a new page to the
                // navigation stack
                var nextPageKey = this._pageKey;
                int nextPageIndex = this.Frame.BackStackDepth;
                while (frameState.Remove(nextPageKey))
                {
                    nextPageIndex++;
                    nextPageKey = "Page-" + nextPageIndex;
                }

                // Pass the navigation parameter to the new page
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
                }
            }
            else
            {
                // Pass the navigation parameter and preserved page state to the page, using
                // the same strategy for loading suspended state and recreating pages discarded
                // from cache
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary<String, Object>)frameState[this._pageKey]));
                }
            }
        }

Member Data Documentation

String _pageKey [private]

Definition at line 75 of file NavigationHelper.cs.

Property Documentation

Frame Frame [get, private]

Definition at line 61 of file NavigationHelper.cs.

Page Page [get, set, private]

Definition at line 60 of file NavigationHelper.cs.

Event Documentation

LoadStateEventHandler LoadState

Handle this event to populate the page using content passed during navigation as well as any state that was saved by the SaveState event handler.

Definition at line 82 of file NavigationHelper.cs.

SaveStateEventHandler SaveState

Handle this event to save state that can be used by the LoadState event handler.

Save the state in case the application is suspended or the page is discarded from the navigation cache.

Definition at line 89 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NavigationService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • NavigationService
Public Member Functions | Private Attributes

NavigationService Class Reference

Navigation system that decouples the View Model from knowledge of the View for navigation purposes. More...

Inherits AdventureWorks::Common::INavigationService.

List of all members.

Public Member Functions

NavigationService (Frame frame)
void | GoBack ()
bool | Navigate (Type t, object parameter=null)
bool | Navigate< T > (object parameter=null)

Private Attributes

readonly Frame | frame

Detailed Description

This class can be replaced with a simple mock implementation for test purposes.

Definition at line 25 of file NavigationService.cs.

Constructor & Destructor Documentation

NavigationService ( Frame frame ) [inline]

Definition at line 33 of file NavigationService.cs.

        {
            this.frame = frame;
        }

Member Function Documentation

void GoBack ( ) [inline]

Goes back a page in the back stack.

Implements INavigationService.

Definition at line 65 of file NavigationService.cs.

        {
            frame.GoBack();
        }

bool Navigate | ( | Type | t,
 |  | object | parameter = null |
 | ) |  |  | [inline]

Navigate to the target page of the specified type.

Parameters:
t | Type of the view to navigate to.
parameter | Any parameters to pass to the newly loaded view
Returns:

Implements INavigationService.

Definition at line 57 of file NavigationService.cs.

        {
            return frame.Navigate(t, parameter);
        }

bool Navigate< T > ( object parameter = null ) [inline]

Navigate to the target page of type T.

Template Parameters:
T Type of the view to navigate to.
Parameters:
parameter Any parameters to pass to the newly loaded view
Returns:

Implements INavigationService.

Member Data Documentation

readonly Frame frame [private]

Keep track of the main Frame object, so we can issue Navigation calls to it, without the view models needing to maintain a reference to the views.

Definition at line 31 of file NavigationService.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationService.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelayCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • RelayCommand
Public Member Functions | Events | Private Attributes

RelayCommand Class Reference

A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...

List of all members.

Public Member Functions

RelayCommand (Action execute)
RelayCommand (Action execute, Func< bool > canExecute)
bool | CanExecute (object parameter)
void | Execute (object parameter)
void | RaiseCanExecuteChanged ()

Events

EventHandler | CanExecuteChanged

Private Attributes

readonly Func< bool > | _canExecute
readonly Action | _execute

Detailed Description

The default return value for the CanExecute method is 'true'. RaiseCanExecuteChanged needs to be called whenever CanExecute is expected to return a different value.

Definition at line 28 of file RelayCommand.cs.

Constructor & Destructor Documentation

RelayCommand ( Action execute ) [inline]

Creates a new command that can always execute.

Parameters:
execute The execution logic.

Definition at line 42 of file RelayCommand.cs.

            : this(execute, null)
        {
        }

RelayCommand | ( | Action | execute,
 |  | Func< bool > | canExecute |
 | ) |  |  | [inline]

Creates a new command.

Parameters:
execute | The execution logic.
canExecute | The execution status logic.

Definition at line 52 of file RelayCommand.cs.

        {
            if (execute == null)
                throw new ArgumentNullException("execute");
            _execute = execute;
            _canExecute = canExecute;
        }

Member Function Documentation

bool CanExecute ( object parameter ) [inline]

Determines whether this RelayCommand can execute in its current state.

Parameters:
parameter Data used by the command. If the command does not require data to be passed, this object can be set to null.
Returns:
true if this command can be executed; otherwise, false.

Definition at line 67 of file RelayCommand.cs.

        {
            return _canExecute == null ? true : _canExecute();
        }

void Execute ( object parameter ) [inline]

Executes the RelayCommand on the current command target.

Parameters:
parameter Data used by the command. If the command does not require data to be passed, this object can be set to null.

Definition at line 78 of file RelayCommand.cs.

        {
            _execute();
        }

void RaiseCanExecuteChanged ( ) [inline]

Method used to raise the CanExecuteChanged event to indicate that the return value of the CanExecute method has changed.

Definition at line 88 of file RelayCommand.cs.

        {
            var handler = CanExecuteChanged;
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }

Member Data Documentation

readonly Func<bool> _canExecute [private]

Definition at line 31 of file RelayCommand.cs.

readonly Action _execute [private]

Definition at line 30 of file RelayCommand.cs.

Event Documentation

EventHandler CanExecuteChanged

Raised when RaiseCanExecuteChanged is called.

Definition at line 36 of file RelayCommand.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/RelayCommand.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RootFrameNavigationHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • RootFrameNavigationHelper
Public Member Functions | Properties | Private Member Functions | Private Attributes

RootFrameNavigationHelper Class Reference

RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...

List of all members.

Public Member Functions

RootFrameNavigationHelper (Frame rootFrame)

Properties

Frame | Frame [get, set]

Private Member Functions

void | CoreDispatcher_AcceleratorKeyActivated (CoreDispatcher sender, AcceleratorKeyEventArgs e)
void | CoreWindow_PointerPressed (CoreWindow sender, PointerEventArgs e)
void | SystemNavigationManager_BackRequested (object sender, BackRequestedEventArgs e)
bool | TryGoBack ()
bool | TryGoForward ()
void | UpdateBackButton ()

Private Attributes

SystemNavigationManager | systemNavigationManager

Detailed Description

There should be only one RootFrameNavigationHelper per view, and it should be associated with the root frame.

To make use of RootFrameNavigationHelper, create an instance of the RootNavigationHelper such as in the constructor of your root page.

            public MyRootPage()
            {
                this.InitializeComponent();
                this.rootNavigationHelper = new RootNavigationHelper(MyFrame);
            }

Definition at line 172 of file NavigationHelper.cs.

Constructor & Destructor Documentation

RootFrameNavigationHelper ( Frame rootFrame ) [inline]

Initializes a new instance of the RootNavigationHelper class.

Parameters:
rootFrame A reference to the top-level frame. This reference allows for frame manipulation and to register navigation handlers.

Definition at line 182 of file NavigationHelper.cs.

        {
            this.Frame = rootFrame;

            // Handle keyboard and mouse navigation requests
            this.systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested;
            UpdateBackButton();

            // Listen to the window directly so we will respond to hotkeys regardless
            // of which element has focus.
            Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
                CoreDispatcher_AcceleratorKeyActivated;
            Window.Current.CoreWindow.PointerPressed +=
                this.CoreWindow_PointerPressed;

            // Update the Back button whenever a navigation occurs.
            this.Frame.Navigated += (s, e) => UpdateBackButton();
        }

Member Function Documentation

void CoreDispatcher_AcceleratorKeyActivated | ( | CoreDispatcher | sender,
 |  | AcceleratorKeyEventArgs | e |
 | ) |  |  | [inline, private]

Invoked on every keystroke, including system keys such as Alt key combinations.

Used to detect keyboard navigation between pages even when the page itself doesn't have focus.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 246 of file NavigationHelper.cs.

        {
            var virtualKey = e.VirtualKey;

            // Only investigate further when Left, Right, or the dedicated Previous or Next keys
            // are pressed
            if ((e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown ||
                e.EventType == CoreAcceleratorKeyEventType.KeyDown) &&
                (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right ||
                (int)virtualKey == 166 || (int)virtualKey == 167))
            {
                var coreWindow = Window.Current.CoreWindow;
                var downState = CoreVirtualKeyStates.Down;
                bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState;
                bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState;
                bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState;
                bool noModifiers = !menuKey && !controlKey && !shiftKey;
                bool onlyAlt = menuKey && !controlKey && !shiftKey;

                if (((int)virtualKey == 166 && noModifiers) ||
                    (virtualKey == VirtualKey.Left && onlyAlt))
                {
                    // When the previous key or Alt+Left are pressed navigate back
                    e.Handled = TryGoBack();
                }
                else if (((int)virtualKey == 167 && noModifiers) ||
                    (virtualKey == VirtualKey.Right && onlyAlt))
                {
                    // When the next key or Alt+Right are pressed navigate forward
                    e.Handled = TryGoForward();
                }
            }
        }

void CoreWindow_PointerPressed | ( | CoreWindow | sender,
 |  | PointerEventArgs | e |
 | ) |  |  | [inline, private]

Invoked on every mouse click, touch screen tap, or equivalent interaction.

Used to detect browser-style next and previous mouse button clicks to navigate between pages.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 288 of file NavigationHelper.cs.

        {
            var properties = e.CurrentPoint.Properties;

            // Ignore button chords with the left, right, and middle buttons
            if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
                properties.IsMiddleButtonPressed)
                return;

            // If back or foward are pressed (but not both) navigate appropriately
            bool backPressed = properties.IsXButton1Pressed;
            bool forwardPressed = properties.IsXButton2Pressed;
            if (backPressed ^ forwardPressed)
            {
                e.Handled = true;
                if (backPressed) this.TryGoBack();
                if (forwardPressed) this.TryGoForward();
            }
        }

void SystemNavigationManager_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 225 of file NavigationHelper.cs.

        {
            if (!e.Handled)
            {
                e.Handled = TryGoBack();
            }
        }

bool TryGoBack ( ) [inline, private]

Definition at line 202 of file NavigationHelper.cs.

        {
            bool navigated = false;
            if (this.Frame.CanGoBack)
            {
                this.Frame.GoBack();
                navigated = true;
            }
            return navigated;
        }

bool TryGoForward ( ) [inline, private]

Definition at line 213 of file NavigationHelper.cs.

        {
            bool navigated = false;
            if (this.Frame.CanGoForward)
            {
                this.Frame.GoForward();
                navigated = true;
            }
            return navigated;
        }

void UpdateBackButton ( ) [inline, private]

Definition at line 233 of file NavigationHelper.cs.

        {
            systemNavigationManager.AppViewBackButtonVisibility =
                this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }

Member Data Documentation

SystemNavigationManager systemNavigationManager [private]

Definition at line 175 of file NavigationHelper.cs.

Property Documentation

Frame Frame [get, set, private]

Definition at line 174 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SaveStateEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • SaveStateEventArgs
Public Member Functions | Properties

SaveStateEventArgs Class Reference

Class used to hold the event data required when a page attempts to save state.

List of all members.

Public Member Functions

SaveStateEventArgs (Dictionary< string, Object > pageState)

Properties

Dictionary< string, Object > PageState [get, set]

Detailed Description

Definition at line 356 of file NavigationHelper.cs.

Constructor & Destructor Documentation

SaveStateEventArgs ( Dictionary< string, Object > pageState ) [inline]

Initializes a new instance of the SaveStateEventArgs class.

Parameters:
pageState An empty dictionary to be populated with serializable state.

Definition at line 367 of file NavigationHelper.cs.

            : base()
        {
            this.PageState = pageState;
        }

Property Documentation

Dictionary<string, Object> PageState [get, set]

An empty dictionary to be populated with serializable state.

Definition at line 361 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuspensionManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • SuspensionManager
Static Public Member Functions | Properties | Static Private Member Functions | Private Attributes | Static Private Attributes

SuspensionManager Class Reference

SuspensionManager captures global session state to simplify process lifetime management for an application. More...

List of all members.

Static Public Member Functions

static void | RegisterFrame (Frame frame, String sessionStateKey, String sessionBaseKey=null)
static async Task | RestoreAsync (String sessionBaseKey=null)
static async Task | SaveAsync ()
static Dictionary< String, Object > | SessionStateForFrame (Frame frame)
static void | UnregisterFrame (Frame frame)

Properties

static List< Type > | KnownTypes [get]
static Dictionary< string, object > | SessionState [get]

Static Private Member Functions

static void | RestoreFrameNavigationState (Frame frame)
static void | SaveFrameNavigationState (Frame frame)

Private Attributes

const string | sessionStateFilename = "_sessionState.xml"

Static Private Attributes

static List< Type > | _knownTypes = new List<Type>()
static List< WeakReference
< Frame > > 		_registeredFrames = new List<WeakReference<Frame>>()
static Dictionary< string, object > | _sessionState = new Dictionary<string, object>()
static DependencyProperty | FrameSessionBaseKeyProperty
static DependencyProperty | FrameSessionStateKeyProperty
static DependencyProperty | FrameSessionStateProperty

Detailed Description

Note that session state will be automatically cleared under a variety of conditions and should only be used to store information that would be convenient to carry across sessions, but that should be discarded when an application crashes or is upgraded.

Definition at line 34 of file SuspensionManager.cs.

Member Function Documentation

static void RegisterFrame | ( | Frame | frame,
 |  | String | sessionStateKey,
 |  | String | sessionBaseKey = null |
 | ) |  |  | [inline, static]

Registers a Frame instance to allow its navigation history to be saved to and restored from SessionState.

Frames should be registered once immediately after creation if they will participate in session state management. Upon registration if state has already been restored for the specified key the navigation history will immediately be restored. Subsequent invocations of RestoreAsync will also restore navigation history.

Parameters:
frame | An instance whose navigation history should be managed by SuspensionManager
sessionStateKey | A unique key into SessionState used to store navigation-related information.
sessionBaseKey | An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.

Definition at line 168 of file SuspensionManager.cs.

        {
            if (frame.GetValue(FrameSessionStateKeyProperty) != null)
            {
                throw new InvalidOperationException("Frames can only be registered to one session state key");
            }

            if (frame.GetValue(FrameSessionStateProperty) != null)
            {
                throw new InvalidOperationException("Frames must be either be registered before accessing frame session state, or not registered at all");
            }

            if (!string.IsNullOrEmpty(sessionBaseKey))
            {
                frame.SetValue(FrameSessionBaseKeyProperty, sessionBaseKey);
                sessionStateKey = sessionBaseKey + "_" + sessionStateKey;
            }

            // Use a dependency property to associate the session key with a frame, and keep a list of frames whose
            // navigation state should be managed
            frame.SetValue(FrameSessionStateKeyProperty, sessionStateKey);
            _registeredFrames.Add(new WeakReference<Frame>(frame));

            // Check to see if navigation state can be restored
            RestoreFrameNavigationState(frame);
        }

static async Task RestoreAsync ( String sessionBaseKey = null ) [inline, static]

Restores previously saved SessionState.

Any Frame instances registered with RegisterFrame will also restore their prior navigation state, which in turn gives their active Page an opportunity restore its state.

Parameters:
sessionBaseKey An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.
Returns:
An asynchronous task that reflects when session state has been read. The content of SessionState should not be relied upon until this task completes.

Definition at line 114 of file SuspensionManager.cs.

        {
            _sessionState = new Dictionary<String, Object>();

            try
            {
                // Get the input stream for the SessionState file
                StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
                using (IInputStream inStream = await file.OpenSequentialReadAsync())
                {
                    // Deserialize the Session State
                    DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                    _sessionState = (Dictionary<string, object>)serializer.ReadObject(inStream.AsStreamForRead());
                }

                // Restore any registered frames to their saved state
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame) && (string)frame.GetValue(FrameSessionBaseKeyProperty) == sessionBaseKey)
                    {
                        frame.ClearValue(FrameSessionStateProperty);
                        RestoreFrameNavigationState(frame);
                    }
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static void RestoreFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 253 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            if (frameState.ContainsKey("Navigation"))
            {
                frame.SetNavigationState((String)frameState["Navigation"]);
            }
        }

static async Task SaveAsync ( ) [inline, static]

Save the current SessionState.

Any Frame instances registered with RegisterFrame will also preserve their current navigation stack, which in turn gives their active Page an opportunity to save its state.

Returns:
An asynchronous task that reflects when session state has been saved.

Definition at line 69 of file SuspensionManager.cs.

        {
            try
            {
                // Save the navigation state for all registered frames
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame))
                    {
                        SaveFrameNavigationState(frame);
                    }
                }

                // Serialize the session state synchronously to avoid asynchronous access to shared
                // state
                MemoryStream sessionData = new MemoryStream();
                DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                serializer.WriteObject(sessionData, _sessionState);

                // Get an output stream for the SessionState file and write the state asynchronously
                StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sessionStateFilename, CreationCollisionOption.ReplaceExisting);
                using (Stream fileStream = await file.OpenStreamForWriteAsync())
                {
                    sessionData.Seek(0, SeekOrigin.Begin);
                    await sessionData.CopyToAsync(fileStream);
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static void SaveFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 262 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            frameState["Navigation"] = frame.GetNavigationState();
        }

static Dictionary<String, Object> SessionStateForFrame ( Frame frame ) [inline, static]

Provides storage for session state associated with the specified Frame.

Frames that have been previously registered with RegisterFrame have their session state saved and restored automatically as a part of the global SessionState. Frames that are not registered have transient state that can still be useful when restoring pages that have been discarded from the navigation cache.

Apps may choose to rely on NavigationHelper to manage page-specific state instead of working with frame session state directly.

Parameters:
frame The instance for which session state is desired.
Returns:
A collection of state subject to the same serialization mechanism as SessionState.

Definition at line 227 of file SuspensionManager.cs.

        {
            var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);

            if (frameState == null)
            {
                var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
                if (frameSessionKey != null)
                {
                    // Registered frames reflect the corresponding session state
                    if (!_sessionState.ContainsKey(frameSessionKey))
                    {
                        _sessionState[frameSessionKey] = new Dictionary<String, Object>();
                    }
                    frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
                }
                else
                {
                    // Frames that aren't registered have transient state
                    frameState = new Dictionary<String, Object>();
                }
                frame.SetValue(FrameSessionStateProperty, frameState);
            }
            return frameState;
        }

static void UnregisterFrame ( Frame frame ) [inline, static]

Disassociates a Frame previously registered by RegisterFrame from SessionState.

Any navigation state previously captured will be removed.

Parameters:
frame An instance whose navigation history should no longer be managed.

Definition at line 202 of file SuspensionManager.cs.

        {
            // Remove session state and remove the frame from the list of frames whose navigation
            // state will be saved (along with any weak references that are no longer reachable)
            SessionState.Remove((String)frame.GetValue(FrameSessionStateKeyProperty));
            _registeredFrames.RemoveAll((weakFrameReference) =>
            {
                Frame testFrame;
                return !weakFrameReference.TryGetTarget(out testFrame) || testFrame == frame;
            });
        }

Member Data Documentation

List<Type> _knownTypes = new List<Type>() [static, private]

Definition at line 37 of file SuspensionManager.cs.

List<WeakReference<Frame> > _registeredFrames = new List<WeakReference<Frame>>() [static, private]

Definition at line 152 of file SuspensionManager.cs.

Dictionary<string, object> _sessionState = new Dictionary<string, object>() [static, private]

Definition at line 36 of file SuspensionManager.cs.

DependencyProperty FrameSessionBaseKeyProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionBaseKeyParams", typeof(String), typeof(SuspensionManager), null)

Definition at line 148 of file SuspensionManager.cs.

DependencyProperty FrameSessionStateKeyProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionStateKey", typeof(String), typeof(SuspensionManager), null)

Definition at line 146 of file SuspensionManager.cs.

DependencyProperty FrameSessionStateProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionState", typeof(Dictionary<String, Object>), typeof(SuspensionManager), null)

Definition at line 150 of file SuspensionManager.cs.

const string sessionStateFilename = "_sessionState.xml" [private]

Definition at line 38 of file SuspensionManager.cs.

Property Documentation

List<Type> KnownTypes [static, get]

List of custom types provided to the DataContractSerializer when reading and writing session state.

Initially empty, additional types may be added to customize the serialization process.

Definition at line 58 of file SuspensionManager.cs.

Dictionary<string, object> SessionState [static, get]

Provides access to global session state for the current session.

This state is serialized by SaveAsync and restored by RestoreAsync, so values must be serializable by DataContractSerializer and should be as compact as possible. Strings and other self-contained data types are strongly recommended.

Definition at line 48 of file SuspensionManager.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/SuspensionManager.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuspensionManagerException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • SuspensionManagerException
Public Member Functions

SuspensionManagerException Class Reference

List of all members.

Public Member Functions

SuspensionManagerException ()
SuspensionManagerException (Exception e)

Detailed Description

Definition at line 268 of file SuspensionManager.cs.

Constructor & Destructor Documentation

SuspensionManagerException ( ) [inline]

Definition at line 270 of file SuspensionManager.cs.

        {
        }

SuspensionManagerException ( Exception e ) [inline]

Definition at line 274 of file SuspensionManager.cs.

            : base("SuspensionManager failed", e)
        {

        }

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/SuspensionManager.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisibilityConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Common
  • VisibilityConverter
Public Member Functions

VisibilityConverter Class Reference

Convert a Boolean status to Visibility.Visible (true) or Visibility.Collapsed (false). More...

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Assists in avoiding having the view model keep references to UI types.

Definition at line 26 of file VisibilityConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Convert a boolean into a member of the Visibility enum, true for Visible, false for Collapsed.

Parameters:
value | The bool passed in
targetType | Ignored.
parameter | Ignored
language | Ignored
Returns:
Visibility.Visible if value was a true bool, otherwise Visibility.Collapsed

Definition at line 36 of file VisibilityConverter.cs.

        {
            if(value is bool)
            {
                if((bool)value == true)
                {
                    return Visibility.Visible;
                }
            }
            return Visibility.Collapsed;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Not used, converter is not intended for two-way binding.

Parameters:
value | Ignored
targetType | Ignored
parameter | Ignored
language | Ignored
Returns:

Definition at line 56 of file VisibilityConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/Common/VisibilityConverter.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Trip Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Model
  • Trip
Properties | Events | Private Member Functions | Private Attributes

Trip Class Reference

Trip model. More...

List of all members.

Properties

string | Description [get, set]
string | Destination [get, set]
DateTime | EndDate [get, set]
string | Notes [get, set]
DateTime | StartDate [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged (string propertyName)

Private Attributes

string | description
string | destination
DateTime | endDate
string | notes
DateTime | startDate

Detailed Description

Stores basic details about individual trips, retreived from the TripStore. Implements INotifyPropertyChanged to allow two-way data-binding at the UI layer.

Definition at line 25 of file Trip.cs.

Member Function Documentation

void NotifyPropertyChanged ( string propertyName ) [inline, private]

Notify any subscribers to the INotifyPropertyChanged interface that a property was updated.

This allows the UI to automatically update (for instance, if Cortana triggers an update to a trip, or removal of a trip).

Parameters:
propertyName The case-sensitive name of the property that was updated.

Definition at line 121 of file Trip.cs.

        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                PropertyChangedEventArgs args = new PropertyChangedEventArgs(propertyName);
                handler(this, args);
            }
        }

Member Data Documentation

string description [private]

Definition at line 28 of file Trip.cs.

string destination [private]

Definition at line 27 of file Trip.cs.

DateTime endDate [private]

Definition at line 30 of file Trip.cs.

string notes [private]

Definition at line 31 of file Trip.cs.

DateTime startDate [private]

Definition at line 29 of file Trip.cs.

Property Documentation

string Description [get, set]

Description of a trip.

Shown to users as a basic description in the UI.

Definition at line 55 of file Trip.cs.

string Destination [get, set]

Trip Destination.

Should not be an empty string.

Definition at line 39 of file Trip.cs.

DateTime EndDate [get, set]

The ending date of a trip.

Definition at line 87 of file Trip.cs.

string Notes [get, set]

Any notes about a trip, such as things to take, activities, etc.

Definition at line 103 of file Trip.cs.

DateTime StartDate [get, set]

The beginning date of a trip.

Definition at line 71 of file Trip.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 33 of file Trip.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks.shared/Model/Trip.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripStore Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • Model
  • TripStore
Public Member Functions | Properties | Private Member Functions | Private Attributes

TripStore Class Reference

Persistance layer for Trips created with Adventure Works. More...

List of all members.

Public Member Functions

TripStore ()
async Task | DeleteTrip (Trip trip)
async Task | LoadTrips ()
async Task | SaveTrip (Trip trip)

Properties

ObservableCollection< Trip > | Trips [get, set]

Private Member Functions

async Task | WriteTrips ()

Private Attributes

bool | loaded
ObservableCollection< Trip > | trips

Detailed Description

Writes out and retreives trips from a simple xml format like <root> <Trip> <Destination></Destination> <StartDate></StartDate> <EndDate></EndDate> <Notes></Notes> </Trip> <Trip> .... </Trip> </root>

Definition at line 42 of file TripStore.cs.

Constructor & Destructor Documentation

TripStore ( ) [inline]

Definition at line 51 of file TripStore.cs.

        {
            loaded = false;
            Trips = new ObservableCollection<Trip>();
        }

Member Function Documentation

async Task DeleteTrip ( Trip trip ) [inline]

Delete a trip from the persistent trip store, and save the trips file.

Parameters:
trip The trip to delete. If the trip is not an existing trip in the store, will not have an effect.

Definition at line 203 of file TripStore.cs.

        {
            Trips.Remove(trip);
            await WriteTrips();
        }

async Task LoadTrips ( ) [inline]

Load trips from a file on first-launch of the app.

If the file does not yet exist, pre-seed it with several trips, in order to give the app demonstration data.

Definition at line 76 of file TripStore.cs.

        {
            // Ensure that we don't load trip data more than once.
            if (loaded)
            {
                return;
            }
            loaded = true;

            StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
            this.trips.Clear();

            var item = await folder.TryGetItemAsync("trips.xml");
            if (item == null)
            {
                // Add some 'starter' trips
                trips.Add(
                    new Trip()
                    {
                        Destination = "London",
                        Description = "Trip to London!",
                        StartDate = new DateTime(2015, 5, 5),
                        EndDate = new DateTime(2015, 5, 15)
                    });
                trips.Add(
                    new Trip()
                    {
                        Destination = "Melbourne",
                        Description = "Trip to Australia",
                        StartDate = new DateTime(2016, 2, 2),
                        EndDate = new DateTime(2016, 5, 17),
                        Notes = "Bring Sunscreen!"
                    });
                trips.Add(
                    new Trip()
                    {
                        Destination = "Yosemite National Park",
                        Description = "Trip to Yosemite",
                        StartDate = new DateTime(2015, 7, 11),
                        EndDate = new DateTime(2015, 7, 19),
                        Notes = "Buy some new hiking boots"
                    });
                await WriteTrips();
                return;
            }

            // Load trips out of a simple XML format. For the purposes of this example, we're treating
            // parse failures as "no trips exist" which will result in the file being erased.
            if (item.IsOfType(StorageItemTypes.File))
            {
                StorageFile tripsFile = item as StorageFile;

                string tripXmlText = await FileIO.ReadTextAsync(tripsFile);

                try
                {
                    XElement xmldoc = XElement.Parse(tripXmlText);

                    var tripElements = xmldoc.Descendants("Trip");
                    foreach (var tripElement in tripElements)
                    {
                        Trip trip = new Trip();

                        var destElement = tripElement.Descendants("Destination").FirstOrDefault();
                        if (destElement != null)
                        {
                            trip.Destination = destElement.Value;
                        }

                        var descElement = tripElement.Descendants("Description").FirstOrDefault();
                        if (descElement != null)
                        {
                            trip.Description = descElement.Value;
                        }

                        var startElement = tripElement.Descendants("StartDate").FirstOrDefault();
                        if (startElement != null)
                        {
                            DateTime startDate;
                            if (DateTime.TryParse(startElement.Value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out startDate))
                            {
                                trip.StartDate = startDate;
                            }
                            else
                            {
                                trip.StartDate = null;
                            }
                        }

                        var endElement = tripElement.Descendants("EndDate").FirstOrDefault();
                        if (endElement != null)
                        {
                            DateTime endDate;
                            if (DateTime.TryParse(endElement.Value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out endDate))
                            {
                                trip.EndDate = endDate;
                            }
                            else
                            {
                                trip.EndDate = null;
                            }
                        }

                        var notesElement = tripElement.Descendants("Notes").FirstOrDefault();
                        if (notesElement != null)
                        {
                            trip.Notes = notesElement.Value;
                        }

                        Trips.Add(trip);
                    }
                }
                catch (XmlException ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                    return;
                }

            }
        }

async Task SaveTrip ( Trip trip ) [inline]

Add a trip to the persistent trip store, and saves the trips data file.

Parameters:
trip The trip to save or update in the data file.

Definition at line 213 of file TripStore.cs.

        {
            if (!Trips.Contains(trip))
            {
                Trips.Add(trip);
            }

            await WriteTrips();
        }

async Task WriteTrips ( ) [inline, private]

Write out a new XML file, overwriting the existing one if it already exists with the currently persisted trips.

See class comment for basic format.

Definition at line 227 of file TripStore.cs.

        {
            StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;

            XElement xmldoc = new XElement("Root");

            StorageFile tripsFile;

            var item = await folder.TryGetItemAsync("trips.xml");
            if (item == null)
            {
                tripsFile = await folder.CreateFileAsync("trips.xml");
            }
            else
            {
                tripsFile = await folder.GetFileAsync("trips.xml");
            }

            foreach (var trip in Trips)
            {
                string startDateField = null;
                if (trip.StartDate.HasValue)
                {
                    startDateField = trip.StartDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
                }

                string endDateField = null;
                if(trip.EndDate.HasValue)
                {
                    endDateField = trip.EndDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
                }

                xmldoc.Add(
                    new XElement("Trip",
                    new XElement("Destination", trip.Destination),
                    new XElement("Description", trip.Description),
                    new XElement("StartDate", startDateField),
                    new XElement("EndDate", endDateField),
                    new XElement("Notes", trip.Notes)));
            }

            await FileIO.WriteTextAsync(tripsFile, xmldoc.ToString());
        }

Member Data Documentation

bool loaded [private]

Definition at line 44 of file TripStore.cs.

ObservableCollection<Trip> trips [private]

Persist the loaded trips in memory for use in other parts of the application.

Definition at line 49 of file TripStore.cs.

Property Documentation

ObservableCollection<Trip> Trips [get, set]

Persisted trips, reloaded across executions of the application.

Definition at line 61 of file TripStore.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks.shared/Model/TripStore.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • sealed
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "App.xaml.h"

Inherits AdventureWorks::ViewModelBase, and AdventureWorks::ViewModelBase.

List of all members.

Public Member Functions

virtual | ~RelayCommand ()
BoolToVisibilityConverter ()
CalendarConverter ()
virtual bool | CanExecute (Platform::Object^parameter)
virtual Platform::Object | Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual void | Execute (Platform::Object^parameter)
void | NewTrip ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | RaiseCanExecuteChanged ()
void | SelectionChanged ()
void | ShowTrip (AdventureWorks_Shared::Trip^trip)
TripDetails ()
void | tripListBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^args)
TripListView ()
TripListViewModel (AdventureWorks_Shared::TripStore^store)
TripViewModel (AdventureWorks_Shared::TripStore^store)
TripVoiceCommand (Platform::String^voiceCommandName, Platform::String^commandMode, Platform::String^textSpoken, Platform::String^destination)
void | UpdateDestinationPhraseList ()
ViewModelLocator ()

Public Attributes

virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		CanExecuteChanged
internal std::function< void(Platform::Object^)> | executeCallback

Protected Member Functions

virtual void | OnActivated (Windows::ApplicationModel::Activation::IActivatedEventArgs^e) override
virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Properties

Platform::String | commandMode
Platform::String | destination
ViewModelBase modelSet
Platform::String | textSpoken

Private Member Functions

void | AddTrip ()
void | DeleteTrip ()
void | OnBackRequested (Platform::Object^sender, Windows::UI::Core::BackRequestedEventArgs^e)
void | OnNavigated (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationEventArgs^e)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | SaveTrip ()
Platform::String | SemanticInterpretation (Platform::String^tag, Windows::Media::SpeechRecognition::SpeechRecognitionResult^result)
void | setDestinationValidation (Platform::String^value)
void | setShowDelete (bool value)
void | setShowDestinationValidation (bool value)

Private Attributes

std::function< bool(Platform::Object^)> | _canExecuteCallback
std::function< void(Platform::Object^)> | _executeCallback
Windows::UI::Xaml::Input::ICommand | addTripCommand
TripListViewModel | defaultViewModel
TripViewModel | defaultViewModel
Windows::UI::Xaml::Input::ICommand | deleteTripCommand
Platform::String | destinationValidationError
Windows::UI::Xaml::Input::ICommand | saveTripCommand
AdventureWorks_Shared::Trip | selectedTrip
bool | showDelete = false
bool | showDestinationValidation = true
AdventureWorks_Shared::TripStore | store
AdventureWorks_Shared::Trip | trip
Windows::Foundation::Collections::IObservableVector
< AdventureWorks_Shared::Trip^> 		trips
bool | tripsLoaded = false

Detailed Description

An empty page that can be used on its own or navigated to within a Frame.

Definition at line 22 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~RelayCommand ( ) [virtual]

Member Function Documentation

void AddTrip ( ) [private]
BoolToVisibilityConverter ( )
CalendarConverter ( )
virtual bool CanExecute ( Platform::Object^ parameter ) [virtual]
virtual Platform::Object Convert | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [virtual]
virtual Platform::Object Convert | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [virtual]
virtual Platform::Object ConvertBack | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [virtual]
virtual Platform::Object ConvertBack | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [virtual]
void DeleteTrip ( ) [private]
virtual void Execute ( Platform::Object^ parameter ) [virtual]
void NewTrip ( )
virtual void OnActivated ( Windows::ApplicationModel::Activation::IActivatedEventArgs^ e ) [override, protected, virtual]
void OnBackRequested | ( | Platform::Object^ | sender,
 |  | Windows::UI::Core::BackRequestedEventArgs^ | e |
 | ) |  |  | [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
void OnNavigated | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationEventArgs^ | e |
 | ) |  |  | [private]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void RaiseCanExecuteChanged ( )
void SaveTrip ( ) [private]
void SelectionChanged ( )
Platform::String SemanticInterpretation | ( | Platform::String^ | tag,
 |  | Windows::Media::SpeechRecognition::SpeechRecognitionResult^ | result |
 | ) |  |  | [private]
void setDestinationValidation ( Platform::String^ value ) [private]
void setShowDelete ( bool value ) [private]
void setShowDestinationValidation ( bool value ) [private]
void ShowTrip ( AdventureWorks_Shared::Trip^ trip )
TripDetails ( )
void tripListBox_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | args
 | ) |  |
TripListView ( )
TripListViewModel ( AdventureWorks_Shared::TripStore^ store )
TripViewModel ( AdventureWorks_Shared::TripStore^ store )
TripVoiceCommand | ( | Platform::String^ | voiceCommandName,
 |  | Platform::String^ | commandMode,
 |  | Platform::String^ | textSpoken,
 |  | Platform::String^ | destination
 | ) |  |
void UpdateDestinationPhraseList ( )
ViewModelLocator ( )

Member Data Documentation

internal __pad0__ [protected]

Reimplemented from ViewModelBase.

Definition at line 29 of file App.xaml.h.

std::function<bool(Platform::Object^)> _canExecuteCallback [private]

Definition at line 29 of file RelayCommand.h.

std::function<void(Platform::Object^)> _executeCallback [private]

Definition at line 30 of file RelayCommand.h.

Windows::UI::Xaml::Input::ICommand addTripCommand [private]

Definition at line 42 of file TripListViewModel.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> CanExecuteChanged

Definition at line 18 of file RelayCommand.h.

TripViewModel defaultViewModel [private]

Definition at line 38 of file TripDetails.xaml.h.

TripListViewModel defaultViewModel [private]

Definition at line 40 of file TripListView.xaml.h.

Windows::UI::Xaml::Input::ICommand deleteTripCommand [private]

Definition at line 64 of file TripViewModel.h.

Platform::String destinationValidationError [private]

Definition at line 67 of file TripViewModel.h.

internal std::function<void(Platform::Object^)> executeCallback

Definition at line 24 of file RelayCommand.h.

Windows::UI::Xaml::Input::ICommand saveTripCommand [private]

Definition at line 63 of file TripViewModel.h.

AdventureWorks_Shared::Trip selectedTrip [private]

Definition at line 44 of file TripListViewModel.h.

bool showDelete = false [private]

Definition at line 69 of file TripViewModel.h.

bool showDestinationValidation = true [private]

Definition at line 66 of file TripViewModel.h.

AdventureWorks_Shared::TripStore store [private]

Definition at line 45 of file TripListViewModel.h.

AdventureWorks_Shared::Trip trip [private]

Definition at line 60 of file TripViewModel.h.

Windows::Foundation::Collections::IObservableVector<AdventureWorks_Shared::Trip^> trips [private]

Definition at line 43 of file TripListViewModel.h.

bool tripsLoaded = false [private]

Definition at line 41 of file TripListView.xaml.h.

Property Documentation

Platform::String commandMode

Definition at line 45 of file TripVoiceCommand.h.

Platform::String destination

Definition at line 48 of file TripVoiceCommand.h.

ViewModelBase modelSet

Definition at line 38 of file ViewModelLocator.h.

Platform::String textSpoken

Definition at line 47 of file TripVoiceCommand.h.

The documentation for this class was generated from the following files:
  • CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.h
  • CortanaVoiceCommand/cpp/AdventureWorks/Common/RelayCommand.h
  • CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.h
  • CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.h
  • CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripListViewModel.h
  • CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.h
  • CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.h
  • CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelLocator.h
  • CortanaVoiceCommand/cpp/AdventureWorks/Common/BoolToVisibilityConverter.h
  • CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.h
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripDetails Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • View
  • TripDetails
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

TripDetails Class Reference

Code Behind for a list of trips, including a Save and Delete button. More...

List of all members.

Public Member Functions

TripDetails ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

TripViewModel | DefaultViewModel [get]
NavigationHelper | NavigationHelper [get]

Private Member Functions

async void | Footer_Click (object sender, RoutedEventArgs e)
void | navigationHelper_LoadState (object sender, LoadStateEventArgs e)
void | navigationHelper_SaveState (object sender, SaveStateEventArgs e)

Private Attributes

TripViewModel defaultViewModel
NavigationHelper navigationHelper

Detailed Description

Associated with the TripViewModel for most behaviors and properties.

Definition at line 28 of file TripDetails.xaml.cs.

Constructor & Destructor Documentation

TripDetails ( ) [inline]

Definition at line 52 of file TripDetails.xaml.cs.

        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;
        }

Member Function Documentation

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle footer link clicks.

Parameters:
sender | The target uri
e | Ignored

Definition at line 159 of file TripDetails.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void navigationHelper_LoadState | ( | object | sender,
 |  | LoadStateEventArgs | e |
 | ) |  |  | [inline, private]

Populates the page with content passed during navigation.

Any saved state is also provided when recreating a page from a prior session. Resets the state of the view model by passing in the parameters provided by the caller.

Parameters:
sender | The source of the event; typically Common.NavigationHelper
e | Event data that provides both the navigation parameter passed to Frame.Navigate(Type, Object) when this page was initially requested and a dictionary of state preserved by this page during an earlier session. The state will be null the first time a page is visited.

Definition at line 73 of file TripDetails.xaml.cs.

        {
            defaultViewModel = (TripViewModel)this.DataContext;
            if (e.NavigationParameter is Trip)
            {
                // Activated via selecting a trip in the main page's list of trips.
                DefaultViewModel.ShowTrip((Trip)e.NavigationParameter);
            }
            else if (e.NavigationParameter is TripVoiceCommand)
            {
                // look up destination, set trip.
                TripVoiceCommand voiceCommand = (TripVoiceCommand)e.NavigationParameter;
                DefaultViewModel.LoadTripFromStore(voiceCommand.destination);

                // artificially populate the page backstack so we have something to
                // go back to to get to the main page.
                PageStackEntry backEntry = new PageStackEntry(typeof(View.TripListView), null, null);
                this.Frame.BackStack.Add(backEntry);
            }
            else if(e.NavigationParameter is string)
            {
                // We've been URI Activated, possibly by a user clicking on a tile in a Cortana session,
                // we should see an argument like destination=<Location>.
                // This should handle finding all of the destinations that match, but currently it only
                // finds the first one.
                string arguments = e.NavigationParameter as string;
                if(arguments != null)
                {
                    string[] args = arguments.Split('=');
                    if (args.Length == 2 && args[0].ToLowerInvariant() == "destination")
                    {
                        DefaultViewModel.LoadTripFromStore(args[1]);

                        // artificially populate the page backstack so we have something to
                        // go back to to get to the main page.
                        PageStackEntry backEntry = new PageStackEntry(typeof(View.TripListView), null, null);
                        this.Frame.BackStack.Add(backEntry);
                    }
                }
            }
            else
            {
                DefaultViewModel.NewTrip();
            }
        }

void navigationHelper_SaveState | ( | object | sender,
 |  | SaveStateEventArgs | e |
 | ) |  |  | [inline, private]

Preserves state associated with this page in case the application is suspended or the page is discarded from the navigation cache.

Values must conform to the serialization requirements of Common.SuspensionManager.SessionState.

Parameters:
sender | The source of the event; typically Common.NavigationHelper
e | Event data that provides an empty dictionary to be populated with serializable state.

Definition at line 127 of file TripDetails.xaml.cs.

        {
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 147 of file TripDetails.xaml.cs.

        {
            navigationHelper.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

The methods provided in this section are simply used to allow NavigationHelper to respond to the page's navigation methods.

Page specific logic should be placed in event handlers for the Common.NavigationHelper.LoadState and Common.NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session.

Definition at line 142 of file TripDetails.xaml.cs.

        {
            navigationHelper.OnNavigatedTo(e);
        }

Member Data Documentation

TripViewModel defaultViewModel [private]

Definition at line 31 of file TripDetails.xaml.cs.

NavigationHelper navigationHelper [private]

Definition at line 30 of file TripDetails.xaml.cs.

Property Documentation

TripViewModel DefaultViewModel [get]

The ViewModel that provides behaviors and properties associated with displaying a Trip's details.

Definition at line 38 of file TripDetails.xaml.cs.

NavigationHelper NavigationHelper [get]

NavigationHelper is used on each page to aid in navigation and process lifetime management.

Definition at line 47 of file TripDetails.xaml.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/View/TripDetails.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • View
  • TripListView
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

TripListView Class Reference

Code Behind for a list of trips, including an Add button. More...

List of all members.

Public Member Functions

TripListView ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

TripListViewModel | DefaultViewModel [get]
NavigationHelper | NavigationHelper [get]

Private Member Functions

async void | CoreWindow_VisibilityChanged (Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | navigationHelper_LoadState (object sender, LoadStateEventArgs e)
void | navigationHelper_SaveState (object sender, SaveStateEventArgs e)
void | tripListBox_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

TripListViewModel defaultViewModel
NavigationHelper navigationHelper

Detailed Description

Associated with the TripListViewModel for most behaviors and properties.

Definition at line 30 of file TripListView.xaml.cs.

Constructor & Destructor Documentation

TripListView ( ) [inline]

Definition at line 51 of file TripListView.xaml.cs.

        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;
        }

Member Function Documentation

async void CoreWindow_VisibilityChanged | ( | Windows.UI.Core.CoreWindow | sender,
 |  | Windows.UI.Core.VisibilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

If we've lost focus and returned to this app, reload the store, as the on-disk content might have been changed by the background task.

Parameters:
sender | Ignored
args | Ignored

Definition at line 65 of file TripListView.xaml.cs.

        {
            if (args.Visible == true)
            {
                await DefaultViewModel.LoadTrips();
            }
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle footer link clicks.

Parameters:
sender | The target uri
e | Ignored

Definition at line 145 of file TripListView.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void navigationHelper_LoadState | ( | object | sender,
 |  | LoadStateEventArgs | e |
 | ) |  |  | [inline, private]

Sets up the view model.

Parameters:
sender | The source of the event; typically Common.NavigationHelper
e | Event data that provides both the navigation parameter passed to Frame.Navigate(Type, Object) when this page was initially requested and a dictionary of state preserved by this page during an earlier session. The state will be null the first time a page is visited.

Definition at line 84 of file TripListView.xaml.cs.

        {
            defaultViewModel = (TripListViewModel)this.DataContext;

            DefaultViewModel.SelectedTrip = null;

            Window.Current.CoreWindow.VisibilityChanged += CoreWindow_VisibilityChanged;
        }

void navigationHelper_SaveState | ( | object | sender,
 |  | SaveStateEventArgs | e |
 | ) |  |  | [inline, private]

Preserves state associated with this page in case the application is suspended or the page is discarded from the navigation cache.

Values must conform to the serialization requirements of Common.SuspensionManager.SessionState.

Parameters:
sender | The source of the event; typically Common.NavigationHelper
e | Event data that provides an empty dictionary to be populated with serializable state.

Definition at line 101 of file TripListView.xaml.cs.

        {
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 121 of file TripListView.xaml.cs.

        {
            navigationHelper.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

The methods provided in this section are simply used to allow NavigationHelper to respond to the page's navigation methods.

Page specific logic should be placed in event handlers for the Common.NavigationHelper.LoadState and Common.NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session.

Definition at line 116 of file TripListView.xaml.cs.

        {
            navigationHelper.OnNavigatedTo(e);
        }

void tripListBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Since there's an imperfect click implementation on listboxes, this provides a quick way to handle the SelectionChanged event, in order to open the selected trip's details.

Parameters:
sender | Ignored
e | Ignored

Definition at line 135 of file TripListView.xaml.cs.

        {
            this.DefaultViewModel.SelectionChanged();
        }

Member Data Documentation

TripListViewModel defaultViewModel [private]

Definition at line 34 of file TripListView.xaml.cs.

NavigationHelper navigationHelper [private]

Definition at line 32 of file TripListView.xaml.cs.

Property Documentation

TripListViewModel DefaultViewModel [get]

Definition at line 37 of file TripListView.xaml.cs.

NavigationHelper NavigationHelper [get]

NavigationHelper is used on each page to aid in navigation and process lifetime management.

Definition at line 46 of file TripListView.xaml.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/View/TripListView.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripListViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModel
  • TripListViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

TripListViewModel Class Reference

View Model controlling the behavior of a List view of trips. More...

Inherits AdventureWorks::ViewModel::ViewModelBase.

List of all members.

Public Member Functions

TripListViewModel (TripStore store)

Properties

ICommand | AddTripCommand [get]
Trip | SelectedTrip [get, set]
ObservableCollection< Trip > | Trips [get, set]

Private Member Functions

void | AddTrip ()
internal async Task | LoadTrips ()
internal void | SelectionChanged ()

Private Attributes

ICommand | addTripCommand
Trip selectedTrip
TripStore store
ObservableCollection< Trip > | trips

Detailed Description

Definition at line 28 of file TripListViewModel.cs.

Constructor & Destructor Documentation

TripListViewModel ( TripStore store ) [inline]

Construct the trip view, passing in the persistent trip store.

Sets up a command to handle invoking the Add button.

Parameters:
store

Definition at line 40 of file TripListViewModel.cs.

        {
            this.store = store;
            Trips = store.Trips;

            addTripCommand = new RelayCommand(new Action(AddTrip));
        }

Member Function Documentation

void AddTrip ( ) [inline, private]

The implementation of the command to execute when the Add button is pressed.

Definition at line 104 of file TripListViewModel.cs.

        {
            App.NavigationService.Navigate<TripDetails>();
        }

internal async Task LoadTrips ( ) [inline, private]

Reload the trip store from data files.

Definition at line 95 of file TripListViewModel.cs.

        {
            await store.LoadTrips();
        }

internal void SelectionChanged ( ) [inline, private]

Handles a user selecting a trip on the UI by navigating to the TripDetails view for that trip.

Definition at line 113 of file TripListViewModel.cs.

        {
            if (SelectedTrip != null)
            {
                App.NavigationService.Navigate<TripDetails>(SelectedTrip);
            }
        }

Member Data Documentation

ICommand addTripCommand [private]

Definition at line 30 of file TripListViewModel.cs.

Trip selectedTrip [private]

Definition at line 32 of file TripListViewModel.cs.

TripStore store [private]

Definition at line 33 of file TripListViewModel.cs.

ObservableCollection<Trip> trips [private]

Definition at line 31 of file TripListViewModel.cs.

Property Documentation

ICommand AddTripCommand [get]

The command to invoke when the Add button is pressed.

Definition at line 85 of file TripListViewModel.cs.

Trip SelectedTrip [get, set]

A two-way binding that keeps reference to the currently selected trip on the UI.

Definition at line 69 of file TripListViewModel.cs.

ObservableCollection<Trip> Trips [get, set]

The list of trips to display on the UI.

Definition at line 52 of file TripListViewModel.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripListViewModel.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModel
  • TripViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

TripViewModel Class Reference

View Model associated with TripDetails.xaml. More...

Inherits AdventureWorks::ViewModel::ViewModelBase.

List of all members.

Public Member Functions

TripViewModel (TripStore store)
async Task | UpdateDestinationPhraseList ()

Properties

ICommand | DeleteTripCommand [get]
String | DestinationValidationError [get, set]
ICommand | SaveTripCommand [get]
bool | ShowDelete [get, set]
bool | ShowDestinationValidation [get, set]
Trip | Trip [get, set]

Private Member Functions

async void | DeleteTrip ()
internal async void | LoadTripFromStore (string destination)
internal void | NewTrip ()
async void | SaveTrip ()
internal void | ShowTrip (Trip trip)

Private Attributes

ICommand | deleteTripCommand
string | destinationValidationError
ICommand | saveTripCommand
bool | showDelete = false
bool | showDestinationValidation = false
TripStore store
Trip trip

Detailed Description

Provides access to an individual Trip, and Commands for saving new, updating existing, and deleting trips. Is able to both create brand new trips, and edit existing trips, hiding buttons that should not be accessible in some cases.

Definition at line 33 of file TripViewModel.cs.

Constructor & Destructor Documentation

TripViewModel ( TripStore store ) [inline]

Construct Trip ViewModel, providing the store to persist trips.

Creates the RelayCommands to be bound to various buttons in the UI.

Parameters:
store The persistent store

Definition at line 166 of file TripViewModel.cs.

        {
            trip = new Trip();
            saveTripCommand = new RelayCommand(new Action(SaveTrip));
            deleteTripCommand = new RelayCommand(new Action(DeleteTrip));
            this.store = store;
        }

Member Function Documentation

async void DeleteTrip ( ) [inline, private]

removes a trip from the store, and returns to the trip list.

Definition at line 177 of file TripViewModel.cs.

        {
            await store.DeleteTrip(Trip);
            await UpdateDestinationPhraseList();
            App.NavigationService.GoBack();
        }

internal async void LoadTripFromStore ( string destination ) [inline, private]

Load a trip fomr the store, and set up the view per a normal ShowTrip command.

Parameters:
destination

Definition at line 129 of file TripViewModel.cs.

        {
            Trip t = store.Trips.Where(p => p.Destination == destination).FirstOrDefault();
            if (t != null)
            {
                this.ShowTrip(t);
            }
            else
            {
                // Redirect back to the main page, and pass along an error message to show
                await Window.Current.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    App.NavigationService.Navigate<View.TripListView>(
                    string.Format(
                        "Sorry, couldn't find a trip with Destination {0}",
                        destination));
                });
            }
        }

internal void NewTrip ( ) [inline, private]

Sets up the view model to create a new trip.

Definition at line 264 of file TripViewModel.cs.

        {
            showDelete = false;
            Trip = new Trip();
        }

async void SaveTrip ( ) [inline, private]

Performs validation on the destination to ensure it's not empty, then saves a trip to the store.

If the destination isn't valid, shows a validation error.

Definition at line 227 of file TripViewModel.cs.

        {
            ShowDestinationValidation = false;
            bool valid = true;

            if (String.IsNullOrEmpty(Trip.Destination))
            {
                valid = false;
                ShowDestinationValidation = true;
                DestinationValidationError = "Destination cannot be blank";
            }
            else
            {
                Trip.Destination = Trip.Destination.Trim();
            }

            if (valid)
            {
                await store.SaveTrip(this.Trip);
                await UpdateDestinationPhraseList();
                App.NavigationService.GoBack();
            }
        }

internal void ShowTrip ( Trip trip ) [inline, private]

Sets up the view model to show an existing trip.

Parameters:
trip

Definition at line 255 of file TripViewModel.cs.

        {
            showDelete = true;
            Trip = trip;
        }

async Task UpdateDestinationPhraseList ( ) [inline]

Whenever a trip is modified, we trigger an update of the voice command Phrase list.

This allows voice commands such as "Adventure Works Show trip to {destination} to be up to date with saved Trips.

Definition at line 189 of file TripViewModel.cs.

        {
            try
            {
                // Update the destination phrase list, so that Cortana voice commands can use destinations added by users.
                // When saving a trip, the UI navigates automatically back to this page, so the phrase list will be
                // updated automatically.
                VoiceCommandDefinition commandDefinitions;

                string countryCode = CultureInfo.CurrentCulture.Name.ToLower();
                if(countryCode.Length == 0)
                {
                    countryCode = "en-us";
                }

                if (VoiceCommandDefinitionManager.InstalledCommandDefinitions.TryGetValue("AdventureWorksCommandSet_" + countryCode, out commandDefinitions))
                {
                    List<string> destinations = new List<string>();
                    foreach (Model.Trip t in store.Trips)
                    {
                        destinations.Add(t.Destination);
                    }

                    await commandDefinitions.SetPhraseListAsync("destination", destinations);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Updating Phrase list for VCDs: " + ex.ToString());
            }
        }

Member Data Documentation

ICommand deleteTripCommand [private]

Definition at line 36 of file TripViewModel.cs.

string destinationValidationError [private]

Definition at line 41 of file TripViewModel.cs.

ICommand saveTripCommand [private]

Definition at line 35 of file TripViewModel.cs.

bool showDelete = false [private]

Definition at line 43 of file TripViewModel.cs.

bool showDestinationValidation = false [private]

Definition at line 40 of file TripViewModel.cs.

TripStore store [private]

Definition at line 38 of file TripViewModel.cs.

Trip trip [private]

Definition at line 37 of file TripViewModel.cs.

Property Documentation

ICommand DeleteTripCommand [get]

Bound to the Delete button, provides a command to invoke when pressed.

Definition at line 154 of file TripViewModel.cs.

String DestinationValidationError [get, set]

We require that a destination be set to a non-empty string.

If the user attempts to save without one, this will be set to an explanatory validation prompt to be rendered in the UI.

Definition at line 67 of file TripViewModel.cs.

ICommand SaveTripCommand [get]

Bound to the save button, provides a command to invoke when pressed.

Definition at line 118 of file TripViewModel.cs.

bool ShowDelete [get, set]

Controls whether the Button that deletes trips is shown.

If creating a new trip, this is false. Otherwise, true.

Definition at line 102 of file TripViewModel.cs.

bool ShowDestinationValidation [get, set]

Controls whether the TextBlock that contains the destination validation string is visible.

Combined with the VisibilityConverter, can show or collapse elements.

Definition at line 85 of file TripViewModel.cs.

Trip Trip [get, set]

The Trip this view model represents.

Definition at line 49 of file TripViewModel.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripViewModel.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TripVoiceCommand Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModel
  • TripVoiceCommand
Public Member Functions | Public Attributes

TripVoiceCommand Struct Reference

Simple struct to pass voice-command arguments to the appropriate view, in order to execute the action requested by the user. More...

List of all members.

Public Member Functions

TripVoiceCommand (string voiceCommand, string commandMode, string textSpoken, string destination)

Public Attributes

string | commandMode
string | destination
string | textSpoken
string | voiceCommand

Detailed Description

Reference OnActivated() in App.xaml.cs, and AdventureWorksCommands.xml for context on what should go in here.

Definition at line 25 of file TripVoiceCommand.cs.

Constructor & Destructor Documentation

TripVoiceCommand | ( | string | voiceCommand,
 |  | string | commandMode,
 |  | string | textSpoken,
 |  | string | destination |
 | ) |  |  | [inline]

Set up the voice command struct with the provided details about the voice command.

Oriented around the "showTripToDestination" VCD command (See AdventureWorksCommands.xml)

Parameters:
voiceCommand | The voice command (the Command element in the VCD xml)
commandMode | The command mode (whether it was voice or text activation)
textSpoken | The raw voice command text.
destination | The destination parameter.

Definition at line 40 of file TripVoiceCommand.cs.

        {
            this.voiceCommand = voiceCommand;
            this.commandMode = commandMode;
            this.textSpoken = textSpoken;
            this.destination = destination;
        }

Member Data Documentation

string commandMode

Definition at line 28 of file TripVoiceCommand.cs.

string destination

Definition at line 30 of file TripVoiceCommand.cs.

string textSpoken

Definition at line 29 of file TripVoiceCommand.cs.

string voiceCommand

Definition at line 27 of file TripVoiceCommand.cs.

The documentation for this struct was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripVoiceCommand.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewModelBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModel
  • ViewModelBase
Protected Member Functions | Events

ViewModelBase Class Reference

Base class for all view models. More...

Inherited by TripListViewModel, and TripViewModel.

List of all members.

Protected Member Functions

void | NotifyPropertyChanged (string propertyName)

Events

PropertyChangedEventHandler | PropertyChanged

Detailed Description

Contains the common implementation of INotifyPropertyChanged and the notification helper method.

Definition at line 20 of file ViewModelBase.cs.

Member Function Documentation

void NotifyPropertyChanged ( string propertyName ) [inline, protected]

Notify subscribers of updates to the named property.

Parameters:
propertyName The full, case-sensitive, name of a property.

Definition at line 31 of file ViewModelBase.cs.

        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                PropertyChangedEventArgs args = new PropertyChangedEventArgs(propertyName);

                handler(this, args);
            }
        }

Event Documentation

PropertyChangedEventHandler PropertyChanged

Views subscribe to this event to get notified of property updates.

Definition at line 25 of file ViewModelBase.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelBase.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewModelLocator Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModel
  • ViewModelLocator
Public Member Functions | Properties | Private Member Functions | Private Attributes

ViewModelLocator Class Reference

ViewModelLocator ensures that viewmodels can be instantiated with a common reference to the TripStore. More...

List of all members.

Public Member Functions

ViewModelLocator ()

Properties

TripListViewModel | TripListViewModel [get]
TripViewModel | TripViewModel [get]

Private Member Functions

async void | InitializeStore (TripStore store)

Private Attributes

Dictionary< string, ViewModelBase > | modelSet = new Dictionary<string, ViewModelBase>()

Detailed Description

This allows for easier decoupling of the store implementation and the view models, and allows for less viewmodel specific code in the views.

Definition at line 26 of file ViewModelLocator.cs.

Constructor & Destructor Documentation

ViewModelLocator ( ) [inline]

Set up all of the known view models, and instantiate the trip repository.

Definition at line 33 of file ViewModelLocator.cs.

        {
            TripStore store = new TripStore();
            InitializeStore(store);
            modelSet.Add("TripListViewModel", new TripListViewModel(store));
            modelSet.Add("TripViewModel", new TripViewModel(store));
        }

Member Function Documentation

async void InitializeStore ( TripStore store ) [inline, private]

Definition at line 41 of file ViewModelLocator.cs.

        {
            await store.LoadTrips();
        }

Member Data Documentation

Dictionary<string, ViewModelBase> modelSet = new Dictionary<string, ViewModelBase>() [private]

Definition at line 28 of file ViewModelLocator.cs.

Property Documentation

TripListViewModel TripListViewModel [get]

TripList (main page) view model.

The TripListView is databound to this property.

Definition at line 50 of file ViewModelLocator.cs.

TripViewModel TripViewModel [get]

Trip (detail page) view model.

TripDetails page is databound to this property.

Definition at line 61 of file ViewModelLocator.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelLocator.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewModelBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • ViewModelBase
Public Attributes | Protected Member Functions

ViewModelBase Class Reference

#include "ViewModelBase.h"

Inherited by sealed, and sealed.

List of all members.

Public Attributes

internal | __pad0__: ViewModelBase()
virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler 		PropertyChanged

Protected Member Functions

void | NotifyPropertyChanged (Platform::String^propertyName)

Detailed Description

Definition at line 15 of file ViewModelBase.h.

Member Function Documentation

void NotifyPropertyChanged ( Platform::String^ propertyName ) [protected]

Member Data Documentation

internal __pad0__

Reimplemented in sealed.

Definition at line 18 of file ViewModelBase.h.

virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler PropertyChanged

Definition at line 22 of file ViewModelBase.h.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.h
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorksVoiceCommandService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks
  • VoiceCommands
  • AdventureWorksVoiceCommandService
Public Member Functions | Private Member Functions | Private Attributes

AdventureWorksVoiceCommandService Class Reference

The VoiceCommandService implements the entrypoint for all headless voice commands invoked via Cortana. More...

List of all members.

Public Member Functions

async void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

async Task< Model.Trip > | DisambiguateTrips (IEnumerable< Model.Trip > trips, string disambiguationMessage, string secondDisambiguationMessage)
async void | LaunchAppInForeground ()
void | OnTaskCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
void | OnVoiceCommandCompleted (VoiceCommandServiceConnection sender, VoiceCommandCompletedEventArgs args)
async Task | SendCompletionMessageForCancellation (string destination)
async Task | SendCompletionMessageForDestination (string destination)
async Task | ShowProgressScreen (string message)

Private Attributes

ResourceContext | cortanaContext
ResourceMap | cortanaResourceMap
DateTimeFormatInfo | dateFormatInfo
BackgroundTaskDeferral | serviceDeferral
VoiceCommandServiceConnection | voiceServiceConnection

Detailed Description

The individual commands supported are described in the AdventureworksCommands.xml VCD file in the AdventureWorks project. The service entrypoint is defined in the Package Manifest (See section uap:Extension in AdventureWorks:Package.appxmanifest)

Definition at line 34 of file AdventureWorksVoiceCommandService.cs.

Member Function Documentation

async Task<Model.Trip> DisambiguateTrips | ( | IEnumerable< Model.Trip > | trips,
 |  | string | disambiguationMessage,
 |  | string | secondDisambiguationMessage |
 | ) |  |  | [inline, private]

Demonstrates providing the user with a choice between multiple items.

In this case, if a user has two trips to the same destination with different dates, this will provide a way to differentiate them. Provide a way to choose between the items.

Parameters:
trips | The set of trips to choose between
disambiguationMessage | The initial disambiguation message
secondDisambiguationMessage | Repeat prompt retry message
Returns:

Definition at line 291 of file AdventureWorksVoiceCommandService.cs.

        {
            // Create the first prompt message.
            var userPrompt = new VoiceCommandUserMessage();
            userPrompt.DisplayMessage =
                userPrompt.SpokenMessage = disambiguationMessage;

            // Create a re-prompt message if the user responds with an out-of-grammar response.
            var userReprompt = new VoiceCommandUserMessage();
            userReprompt.DisplayMessage =
                userReprompt.SpokenMessage = secondDisambiguationMessage;

            // Create items for each item. Ideally, should be limited to a small number of items.
            var destinationContentTiles = new List<VoiceCommandContentTile>();
            int i = 1;
            foreach (Model.Trip trip in trips)
            {
                var destinationTile = new VoiceCommandContentTile();

                // To handle UI scaling, Cortana automatically looks up files with FileName.scale-<n>.ext formats based on the requested filename.
                // See the VoiceCommandService\Images folder for an example.
                destinationTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
                destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AdventureWorks.VoiceCommands/Images/GreyTile.png"));

                // The AppContext can be any arbitrary object, and will be maintained for the
                // response.
                destinationTile.AppContext = trip;
                string dateFormat = "";
                if (trip.StartDate != null)
                {
                    dateFormat = trip.StartDate.Value.ToString(dateFormatInfo.LongDatePattern);
                }
                else
                {
                    // The app allows a trip to not have a date, but the choices must be unique
                    // so they can be spoken aloud and be distinct, so add a number to identify them.
                    dateFormat = string.Format("{0}", i);
                }

                destinationTile.Title = trip.Destination + " " + dateFormat;
                destinationTile.TextLine1 = trip.Description;

                destinationContentTiles.Add(destinationTile);
                i++;
            }

            // Cortana will handle re-prompting if the user does not provide a valid response.
            var response = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt, destinationContentTiles);

            // If cortana is dismissed in this operation, null will be returned.
            var voiceCommandDisambiguationResult = await
                voiceServiceConnection.RequestDisambiguationAsync(response);
            if (voiceCommandDisambiguationResult != null)
            {
                return (Model.Trip)voiceCommandDisambiguationResult.SelectedItem.AppContext;
            }

            return null;
        }

async void LaunchAppInForeground ( ) [inline, private]

Provide a simple response that launches the app.

Expected to be used in the case where the voice command could not be recognized (eg, a VCD/code mismatch.)

Definition at line 446 of file AdventureWorksVoiceCommandService.cs.

        {
            var userMessage = new VoiceCommandUserMessage();
            userMessage.SpokenMessage = cortanaResourceMap.GetValue("LaunchingAdventureWorks", cortanaContext).ValueAsString;

            var response = VoiceCommandResponse.CreateResponse(userMessage);

            response.AppLaunchArgument = "";

            await voiceServiceConnection.RequestAppLaunchAsync(response);
        }

void OnTaskCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

When the background task is cancelled, clean up/cancel any ongoing long-running operations.

This cancellation notice may not be due to Cortana directly. The voice command connection will typically already be destroyed by this point and should not be expected to be active.

Parameters:
sender | This background task instance
reason | Contains an enumeration with the reason for task cancellation

Definition at line 481 of file AdventureWorksVoiceCommandService.cs.

        {
            System.Diagnostics.Debug.WriteLine("Task cancelled, clean up");
            if (this.serviceDeferral != null)
            {
                //Complete the service deferral
                this.serviceDeferral.Complete();
            }
        }

void OnVoiceCommandCompleted | ( | VoiceCommandServiceConnection | sender,
 |  | VoiceCommandCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle the completion of the voice command.

Your app may be cancelled for a variety of reasons, such as user cancellation or not providing progress to Cortana in a timely fashion. Clean up any pending long-running operations (eg, network requests).

Parameters:
sender | The voice connection associated with the command.
args | Contains an Enumeration indicating why the command was terminated.

Definition at line 466 of file AdventureWorksVoiceCommandService.cs.

        {
            if (this.serviceDeferral != null)
            {
                this.serviceDeferral.Complete();
            }
        }

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Background task entrypoint.

Voice Commands using the <VoiceCommandService target="..."> tag will invoke this when they are recognized by Cortana, passing along details of the invocation.

Background tasks must respond to activation by Cortana within 0.5 seconds, and must report progress to Cortana every 5 seconds (unless Cortana is waiting for user input). There is no execution time limit on the background task managed by Cortana, but developers should use plmdebug (https://msdn.microsoft.com/en-us/library/windows/hardware/jj680085%28v=vs.85%29.aspx) on the Cortana app package in order to prevent Cortana timing out the task during debugging.

Cortana dismisses its UI if it loses focus. This will cause it to terminate the background task, even if the background task is being debugged. Use of Remote Debugging is recommended in order to debug background task behaviors. In order to debug background tasks, open the project properties for the app package (not the background task project), and enable Debug -> "Do not launch, but debug my code when it starts". Alternatively, add a long initial progress screen, and attach to the background task process while it executes.

Parameters:
taskInstance Connection to the hosting background service process.

Definition at line 86 of file AdventureWorksVoiceCommandService.cs.

        {
            serviceDeferral = taskInstance.GetDeferral();

            // Register to receive an event if Cortana dismisses the background task. This will
            // occur if the task takes too long to respond, or if Cortana's UI is dismissed.
            // Any pending operations should be cancelled or waited on to clean up where possible.
            taskInstance.Canceled += OnTaskCanceled;

            var triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails;

            // Load localized resources for strings sent to Cortana to be displayed to the user.
            cortanaResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");

            // Select the system language, which is what Cortana should be running as.
            cortanaContext = ResourceContext.GetForViewIndependentUse();

            // Get the currently used system date format
            dateFormatInfo = CultureInfo.CurrentCulture.DateTimeFormat;

            // This should match the uap:AppService and VoiceCommandService references from the
            // package manifest and VCD files, respectively. Make sure we've been launched by
            // a Cortana Voice Command.
            if (triggerDetails != null && triggerDetails.Name == "AdventureWorksVoiceCommandService")
            {
                try
                {
                    voiceServiceConnection =
                        VoiceCommandServiceConnection.FromAppServiceTriggerDetails(
                            triggerDetails);

                    voiceServiceConnection.VoiceCommandCompleted += OnVoiceCommandCompleted;

                    // GetVoiceCommandAsync establishes initial connection to Cortana, and must be called prior to any
                    // messages sent to Cortana. Attempting to use ReportSuccessAsync, ReportProgressAsync, etc
                    // prior to calling this will produce undefined behavior.
                    VoiceCommand voiceCommand = await voiceServiceConnection.GetVoiceCommandAsync();

                    // Depending on the operation (defined in AdventureWorks:AdventureWorksCommands.xml)
                    // perform the appropriate command.
                    switch (voiceCommand.CommandName)
                    {
                        case "whenIsTripToDestination":
                            var destination = voiceCommand.Properties["destination"][0];
                            await SendCompletionMessageForDestination(destination);
                            break;
                        case "cancelTripToDestination":
                            var cancelDestination = voiceCommand.Properties["destination"][0];
                            await SendCompletionMessageForCancellation(cancelDestination);
                            break;
                        default:
                            // As with app activation VCDs, we need to handle the possibility that
                            // an app update may remove a voice command that is still registered.
                            // This can happen if the user hasn't run an app since an update.
                            LaunchAppInForeground();
                            break;
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("Handling Voice Command failed " + ex.ToString());
                }
            }
        }

async Task SendCompletionMessageForCancellation ( string destination ) [inline, private]

Handle the Trip Cancellation task.

This task demonstrates how to prompt a user for confirmation of an operation, show users a progress screen while performing a long-running task, and showing a completion screen.

Parameters:
destination The name of a destination, expected to match the phrase list.
Returns:

Definition at line 158 of file AdventureWorksVoiceCommandService.cs.

        {
            // Begin loading data to search for the target store. If this operation is going to take a long time,
            // for instance, requiring a response from a remote web service, consider inserting a progress screen
            // here, in order to prevent Cortana from timing out.
            string progressScreenString = string.Format(
                cortanaResourceMap.GetValue("ProgressLookingForTripToDest", cortanaContext).ValueAsString,
                destination);
            await ShowProgressScreen(progressScreenString);

            Model.TripStore store = new Model.TripStore();
            await store.LoadTrips();

            // We might have multiple trips to the destination. For now, we just pick the first.
            IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);
            Model.Trip trip = null;
            if (trips.Count() > 1)
            {
                // If there is more than one trip, provide a disambiguation screen rather than just picking one
                // however, more advanced logic here might be ideal (ie, if there's a significant number of items,
                // you may want to just fall back to a link to your app where you can provide a deeper search experience.
                string disambiguationDestinationString = string.Format(
                    cortanaResourceMap.GetValue("DisambiguationWhichTripToDest", cortanaContext).ValueAsString,
                    destination);
                string disambiguationRepeatString = cortanaResourceMap.GetValue("DisambiguationRepeat", cortanaContext).ValueAsString;
                trip = await DisambiguateTrips(trips, disambiguationDestinationString, disambiguationRepeatString);
            }
            else
            {
                // One or no trips exist with that destination, so retrieve it, or return null.
                trip = trips.FirstOrDefault();
            }

            var userPrompt = new VoiceCommandUserMessage();

            VoiceCommandResponse response;
            if (trip == null)
            {
                var userMessage = new VoiceCommandUserMessage();
                // In this scenario, perhaps someone has modified data on your service outside of this
                // apps control. If you're accessing a remote service, having a background task that
                // periodically refreshes the phrase list so it's likely to be in sync is ideal.
                // This is unlikely to occur for this sample app, however.
                string noSuchTripToDestination = string.Format(
                    cortanaResourceMap.GetValue("NoSuchTripToDestination", cortanaContext).ValueAsString,
                    destination);
                userMessage.DisplayMessage = userMessage.SpokenMessage = noSuchTripToDestination;

                response = VoiceCommandResponse.CreateResponse(userMessage);
                await voiceServiceConnection.ReportSuccessAsync(response);
            }
            else
            {
                // Prompt the user for confirmation that we've selected the correct trip to cancel.
                string cancelTripToDestination = string.Format(
                    cortanaResourceMap.GetValue("CancelTripToDestination", cortanaContext).ValueAsString,
                    destination);
                userPrompt.DisplayMessage = userPrompt.SpokenMessage = cancelTripToDestination;
                var userReprompt = new VoiceCommandUserMessage();
                string confirmCancelTripToDestination = string.Format(
                    cortanaResourceMap.GetValue("ConfirmCancelTripToDestination", cortanaContext).ValueAsString,
                    destination);
                userReprompt.DisplayMessage = userReprompt.SpokenMessage = confirmCancelTripToDestination;

                response = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt);

                var voiceCommandConfirmation = await voiceServiceConnection.RequestConfirmationAsync(response);

                // If RequestConfirmationAsync returns null, Cortana's UI has likely been dismissed.
                if (voiceCommandConfirmation != null)
                {
                    if (voiceCommandConfirmation.Confirmed == true)
                    {
                        string cancellingTripToDestination = string.Format(
                       cortanaResourceMap.GetValue("CancellingTripToDestination", cortanaContext).ValueAsString,
                       destination);
                        await ShowProgressScreen(cancellingTripToDestination);

                        // Perform the operation to remote the trip from the app's data.
                        // Since the background task runs within the app package of the installed app,
                        // we can access local files belonging to the app without issue.
                        await store.DeleteTrip(trip);

                        // Provide a completion message to the user.
                        var userMessage = new VoiceCommandUserMessage();
                        string cancelledTripToDestination = string.Format(
                            cortanaResourceMap.GetValue("CancelledTripToDestination", cortanaContext).ValueAsString,
                            destination);
                        userMessage.DisplayMessage = userMessage.SpokenMessage = cancelledTripToDestination;
                        response = VoiceCommandResponse.CreateResponse(userMessage);
                        await voiceServiceConnection.ReportSuccessAsync(response);
                    }
                    else
                    {
                        // Confirm no action for the user.
                        var userMessage = new VoiceCommandUserMessage();
                        string keepingTripToDestination = string.Format(
                            cortanaResourceMap.GetValue("KeepingTripToDestination", cortanaContext).ValueAsString,
                            destination);
                        userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination;

                        response = VoiceCommandResponse.CreateResponse(userMessage);
                        await voiceServiceConnection.ReportSuccessAsync(response);
                    }
                }
            }
        }

async Task SendCompletionMessageForDestination ( string destination ) [inline, private]

Search for, and show details related to a single trip, if the trip can be found.

This demonstrates a simple response flow in Cortana.

Parameters:
destination The destination, expected to be in the phrase list.
Returns:

Definition at line 357 of file AdventureWorksVoiceCommandService.cs.

        {
            // If this operation is expected to take longer than 0.5 seconds, the task must
            // provide a progress response to Cortana prior to starting the operation, and
            // provide updates at most every 5 seconds.
            string loadingTripToDestination = string.Format(
                       cortanaResourceMap.GetValue("LoadingTripToDestination", cortanaContext).ValueAsString,
                       destination);
            await ShowProgressScreen(loadingTripToDestination);
            Model.TripStore store = new Model.TripStore();
            await store.LoadTrips();

            // Look for the specified trip. The destination *should* be pulled from the grammar we
            // provided, and the subsequently updated phrase list, so it should be a 1:1 match, including case.
            // However, we might have multiple trips to the destination. For now, we just pick the first.
            IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);

            var userMessage = new VoiceCommandUserMessage();
            var destinationsContentTiles = new List<VoiceCommandContentTile>();
            if (trips.Count() == 0)
            {
                // In this scenario, perhaps someone has modified data on your service outside of your
                // control. If you're accessing a remote service, having a background task that
                // periodically refreshes the phrase list so it's likely to be in sync is ideal.
                // This is unlikely to occur for this sample app, however.
                string foundNoTripToDestination = string.Format(
                       cortanaResourceMap.GetValue("FoundNoTripToDestination", cortanaContext).ValueAsString,
                       destination);
                userMessage.DisplayMessage = foundNoTripToDestination;
                userMessage.SpokenMessage = foundNoTripToDestination;
            }
            else
            {
                // Set a title message for the page.
                string message = "";
                if (trips.Count() > 1)
                {
                    message = cortanaResourceMap.GetValue("PluralUpcomingTrips", cortanaContext).ValueAsString;
                }
                else
                {
                    message = cortanaResourceMap.GetValue("SingularUpcomingTrip", cortanaContext).ValueAsString;
                }
                userMessage.DisplayMessage = message;
                userMessage.SpokenMessage = message;

                // file in tiles for each destination, to display information about the trips without
                // launching the app.
                foreach (Model.Trip trip in trips)
                {
                    int i = 1;

                    var destinationTile = new VoiceCommandContentTile();

                    // To handle UI scaling, Cortana automatically looks up files with FileName.scale-<n>.ext formats based on the requested filename.
                    // See the VoiceCommandService\Images folder for an example.
                    destinationTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
                    destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AdventureWorks.VoiceCommands/Images/GreyTile.png"));

                    destinationTile.AppLaunchArgument = trip.Destination;
                    destinationTile.Title = trip.Destination;
                    if (trip.StartDate != null)
                    {
                        destinationTile.TextLine1 = trip.StartDate.Value.ToString(dateFormatInfo.LongDatePattern);
                    }
                    else
                    {
                        destinationTile.TextLine1 = trip.Destination + " " + i;
                    }

                    destinationsContentTiles.Add(destinationTile);
                    i++;
                }
            }

            var response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);

            if (trips.Count() > 0)
            {
                response.AppLaunchArgument = destination;
            }

            await voiceServiceConnection.ReportSuccessAsync(response);
        }

async Task ShowProgressScreen ( string message ) [inline, private]

Show a progress screen.

These should be posted at least every 5 seconds for a long-running operation, such as accessing network resources over a mobile carrier network.

Parameters:
message The message to display, relating to the task being performed.
Returns:

Definition at line 273 of file AdventureWorksVoiceCommandService.cs.

        {
            var userProgressMessage = new VoiceCommandUserMessage();
            userProgressMessage.DisplayMessage = userProgressMessage.SpokenMessage = message;

            VoiceCommandResponse response = VoiceCommandResponse.CreateResponse(userProgressMessage);
            await voiceServiceConnection.ReportProgressAsync(response);
        }

Member Data Documentation

ResourceContext cortanaContext [private]

The context for localized strings.

Definition at line 59 of file AdventureWorksVoiceCommandService.cs.

ResourceMap cortanaResourceMap [private]

ResourceMap containing localized strings for display in Cortana.

Definition at line 54 of file AdventureWorksVoiceCommandService.cs.

DateTimeFormatInfo dateFormatInfo [private]

Get globalization-aware date formats.

Definition at line 64 of file AdventureWorksVoiceCommandService.cs.

BackgroundTaskDeferral serviceDeferral [private]

Lifetime of the background service is controlled via the BackgroundTaskDeferral object, including registering for cancellation events, signalling end of execution, etc.

Cortana may terminate the background service task if it loses focus, or the background task takes too long to provide.

Background tasks can run for a maximum of 30 seconds.

Definition at line 49 of file AdventureWorksVoiceCommandService.cs.

VoiceCommandServiceConnection voiceServiceConnection [private]

the service connection is maintained for the lifetime of a cortana session, once a voice command has been triggered via Cortana.

Definition at line 40 of file AdventureWorksVoiceCommandService.cs.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cs/VoiceCommandService/AdventureWorksVoiceCommandService.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AdventureWorks_Shared
  • sealed
Public Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "Trip.h"

List of all members.

Public Member Functions

Windows::Foundation::IAsyncAction | DeleteTripAsync (Trip^trip)
Windows::Foundation::IAsyncAction | LoadTripsAsync ()
void | LoadTripsSync ()
void | NotifyPropertyChanged (Platform::String^propertyName)
Windows::Foundation::IAsyncAction | SaveTripAsync (Trip^trip)
Trip ()
TripStore ()

Properties

virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler 		_PropertyChanged
Platform::String | description
Platform::String | destination
Windows::Globalization::Calendar | endDate
Platform::String | notes
Windows::Globalization::Calendar | startDate

Private Member Functions

Concurrency::task< void > | LoadTripsTask ()
HRESULT | ReadXml (Windows::Storage::Streams::IRandomAccessStream^randomAccessReadStream)
void | WriteTrips ()

Private Attributes

bool | loaded
Windows::Foundation::Collections::IObservableVector
< Trip^> 		trips

Detailed Description

Definition at line 16 of file Trip.h.

Member Function Documentation

Windows::Foundation::IAsyncAction DeleteTripAsync ( Trip^ trip )
Windows::Foundation::IAsyncAction LoadTripsAsync ( )
void LoadTripsSync ( )
Concurrency::task<void> LoadTripsTask ( ) [private]
void NotifyPropertyChanged ( Platform::String^ propertyName )
HRESULT ReadXml ( Windows::Storage::Streams::IRandomAccessStream^ randomAccessReadStream ) [private]
Windows::Foundation::IAsyncAction SaveTripAsync ( Trip^ trip )
Trip ( )
TripStore ( )
void WriteTrips ( ) [private]

Member Data Documentation

bool loaded [private]

Definition at line 41 of file TripStore.h.

Windows::Foundation::Collections::IObservableVector<Trip^> trips [private]

Definition at line 35 of file TripStore.h.

Property Documentation

virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler _PropertyChanged

Definition at line 45 of file Trip.h.

Platform::String description

Definition at line 81 of file Trip.h.

Platform::String destination

Definition at line 80 of file Trip.h.

Windows::Globalization::Calendar endDate

Definition at line 83 of file Trip.h.

Platform::String notes

Definition at line 84 of file Trip.h.

Windows::Globalization::Calendar startDate

Definition at line 82 of file Trip.h.

The documentation for this class was generated from the following files:
  • CortanaVoiceCommand/cpp/AdventureWorks.Shared/Trip.h
  • CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.h
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoynBusObjectManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Static Public Member Functions | Static Private Member Functions | Static Private Attributes

AllJoynBusObjectManager Class Reference

#include "AllJoynBusObjectManager.h"

List of all members.

Static Public Member Functions

static bool | BusObjectExists (_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)
static bool | BusObjectIsRegistered (_In_ const alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject)
static QStatus | GetBusObject (_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _Out_ alljoyn_busobject *busObject)
static QStatus | ReleaseBusObject (_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)
static QStatus | TryRegisterBusObject (_Inout_ alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject, _In_ const bool secure)

Static Private Member Functions

static QStatus | CreateBusObject (_In_ const PCSTR objectPath, _Out_ alljoyn_busobject *busObject)
static QStatus | SaveBusObject (_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _In_ const alljoyn_busobject busObject)
static QStatus | UnregisterAndDestroyBusObject (_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)

Static Private Attributes

static std::map
< alljoyn_busattachment,
std::shared_ptr< std::map
< std::string, std::tuple
< alljoyn_busobject, bool, int > > > > 		BusAttachmentMap
static std::mutex | ModifyBusObjectMap

Detailed Description

Definition at line 23 of file AllJoynBusObjectManager.h.

Member Function Documentation

bool BusObjectExists | ( | _In_ const alljoyn_busattachment | busAttachment,
 |  | _In_ const PCSTR | objectPath |
 | ) |  |  | [static]

Definition at line 98 of file AllJoynBusObjectManager.cpp.

{
    // If a BusObject map exists for this BusAttachment, search for an entry with the specified ObjectPath.
    auto busObjectMapIterator = AllJoynBusObjectManager::BusAttachmentMap.find(busAttachment);
    if (AllJoynBusObjectManager::BusAttachmentMap.end() != busObjectMapIterator)
    {
        auto existingBusObject = busObjectMapIterator->second->find(std::string(objectPath));
        if (busObjectMapIterator->second->end() != existingBusObject)
        {
            return true;
        }
    }

    // If nothing is found above, the specified BusObject has not been saved yet.
    return false;
}

bool BusObjectIsRegistered | ( | _In_ const alljoyn_busattachment | busAttachment,
 |  | _In_ const alljoyn_busobject | busObject |
 | ) |  |  | [static]

Definition at line 115 of file AllJoynBusObjectManager.cpp.

{
    if (nullptr == busObject)
    {
        return false;
    }

    PCSTR objectPath = alljoyn_busobject_getpath(busObject);
    if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
    {
        std::tuple<alljoyn_busobject, bool, int> busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
        return std::get<1>(busObjectEntry);
    }
    return false;
}

QStatus CreateBusObject | ( | _In_ const PCSTR | objectPath,
 |  | _Out_ alljoyn_busobject * | busObject |
 | ) |  |  | [static, private]

Definition at line 131 of file AllJoynBusObjectManager.cpp.

{
    alljoyn_busobject_callbacks callbacks =
    {
        nullptr,
        nullptr,
        nullptr,
        nullptr
    };
    *busObject = alljoyn_busobject_create(objectPath, false, &callbacks, nullptr);
    if (*busObject == nullptr)
    {
        return ER_OUT_OF_MEMORY;
    }
    return ER_OK;
}

QStatus GetBusObject | ( | _In_ const alljoyn_busattachment | busAttachment,
 |  | _In_ const PCSTR | objectPath,
 |  | _Out_ alljoyn_busobject * | busObject |
 | ) |  |  | [static]

Definition at line 26 of file AllJoynBusObjectManager.cpp.

{
    // Ensure thread safety when creating BusObjects so that for each BusAttachment there is
    // at most one BusObject with any given ObjectPath.
    std::unique_lock<std::mutex> lock(AllJoynBusObjectManager::ModifyBusObjectMap);

    if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
    {
        std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
        *busObject = std::get<0>(busObjectEntry);

        // Increment the reference counter for this entry.
        std::get<2>(busObjectEntry)++;
        return ER_OK;
    }
    // If a matching BusObject does not exist, create and save one.
    RETURN_IF_QSTATUS_ERROR(AllJoynBusObjectManager::CreateBusObject(objectPath, busObject));
    return AllJoynBusObjectManager::SaveBusObject(busAttachment, objectPath, *busObject);
}

QStatus ReleaseBusObject | ( | _Inout_ alljoyn_busattachment | busAttachment,
 |  | _In_ const PCSTR | objectPath |
 | ) |  |  | [static]

Definition at line 46 of file AllJoynBusObjectManager.cpp.

{
    // Ensure thread safety when releasing BusObjects. Otherwise, BusObjects may continue to
    // exist and be registered on BusAttachments even when they have no references.
    std::unique_lock<std::mutex> lock(AllJoynBusObjectManager::ModifyBusObjectMap);

    if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
    {
        std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];

        // Decrement the reference counter for this entry.
        std::get<2>(busObjectEntry)--;

        // If there are no remaining references to this BusObject, unregister and destroy it.
        if (0 == std::get<2>(busObjectEntry))
        {
            return AllJoynBusObjectManager::UnregisterAndDestroyBusObject(busAttachment, objectPath);
        }
        return ER_OK;
    }
    return ER_OK;
}

QStatus SaveBusObject | ( | _In_ const alljoyn_busattachment | busAttachment,
 |  | _In_ const PCSTR | objectPath,
 |  | _In_ const alljoyn_busobject | busObject |
 | ) |  |  | [static, private]

Definition at line 148 of file AllJoynBusObjectManager.cpp.

{
    std::shared_ptr<std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>> busObjectMap;

    // Create a BusObject entry for this BusAttachment if it does not exist.
    auto busObjectMapIterator = AllJoynBusObjectManager::BusAttachmentMap.find(busAttachment);
    if (AllJoynBusObjectManager::BusAttachmentMap.end() != busObjectMapIterator)
    {
        busObjectMap = busObjectMapIterator->second;
    }
    else
    {
        busObjectMap = std::shared_ptr<std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>> (
            new std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>);
        AllJoynBusObjectManager::BusAttachmentMap.insert(std::make_pair(busAttachment, busObjectMap));
    }

    // Insert this BusObject into busObjectMap if it does not exist.
    auto existingBusObject = busObjectMap->find(std::string(objectPath));
    if (busObjectMap->end() == existingBusObject)
    {
        // Initialize the BusObject entry as "not registered" and with a single reference.
        busObjectMap->insert(std::make_pair(std::string(objectPath), std::make_tuple(busObject, false, 1)));
    }
    return ER_OK;
}

QStatus TryRegisterBusObject | ( | _Inout_ alljoyn_busattachment | busAttachment,
 |  | _In_ const alljoyn_busobject | busObject,
 |  | _In_ const bool | secure |
 | ) |  |  | [static]

Definition at line 69 of file AllJoynBusObjectManager.cpp.

{
    PCSTR objectPath = alljoyn_busobject_getpath(busObject);

    // To register this BusObject, it must first be created using GetBusObject so that a reference exists in BusAttachmentMap.
    if (!AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
    {
        return ER_BUS_OBJ_NOT_FOUND;
    }

    if (!AllJoynBusObjectManager::BusObjectIsRegistered(busAttachment, busObject))
    {
        if (secure)
        {
            RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_registerbusobject_secure(busAttachment, busObject));
        }
        else
        {
            RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_registerbusobject(busAttachment, busObject));
        }
        std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];

        // Record that the BusObject in this entry has been registered with its associated BusAttachment.
        std::get<1>(busObjectEntry) = true;
        return ER_OK;
    }
    return ER_OK;
}

QStatus UnregisterAndDestroyBusObject | ( | _Inout_ alljoyn_busattachment | busAttachment,
 |  | _In_ const PCSTR | objectPath |
 | ) |  |  | [static, private]

Definition at line 175 of file AllJoynBusObjectManager.cpp.

{
    if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
    {
        std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];

        // Unregister and destroy the specified BusObject, then remove its entry from the containing map.
        alljoyn_busattachment_unregisterbusobject(busAttachment, std::get<0>(busObjectEntry));
        alljoyn_busobject_destroy(std::get<0>(busObjectEntry));
        (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment]).erase(objectPath);

        // If the associated BusAttachment contains no more BusObjects, also remove the BusAttachment from BusAttachmentMap.
        if (AllJoynBusObjectManager::BusAttachmentMap[busAttachment]->size() == 0)
        {
            AllJoynBusObjectManager::BusAttachmentMap.erase(busAttachment);
        }
    }
    return ER_OK;
}

Member Data Documentation

std::map< alljoyn_busattachment, std::shared_ptr< std::map< std::string, std::tuple< alljoyn_busobject, bool, int > > > > BusAttachmentMap [static, private]

Definition at line 51 of file AllJoynBusObjectManager.h.

std::mutex ModifyBusObjectMap [static, private]

Definition at line 43 of file AllJoynBusObjectManager.h.

The documentation for this class was generated from the following files:
  • AllJoyn/shared/AllJoynBusObjectManager.h
  • AllJoyn/shared/AllJoynBusObjectManager.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AuthTypeToStringConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • AuthTypeToStringConverter
Public Member Functions

AuthTypeToStringConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 49 of file OnboardingEnumTypes.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 51 of file OnboardingEnumTypes.cs.

        {
            return value.ToString();
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 56 of file OnboardingEnumTypes.cs.

        {
            OnboardingAuthenticationType returnValue;

            if (Enum.TryParse(value.ToString(), true, out returnValue))
            {
                return returnValue;
            }
            else
            {
                return OnboardingAuthenticationType.Any;
            }
        }

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/OnboardingEnumTypes.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelayCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • RelayCommand
Public Member Functions | Properties | Private Attributes

RelayCommand Class Reference

Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates.

List of all members.

Public Member Functions

RelayCommand (Action< object > execute)
RelayCommand (Action< object > execute, Predicate< object > canExecute)
bool | CanExecute (object parameter)
void | Execute (object parameter)

Properties

EventHandler | CanExecuteChanged

Private Attributes

readonly Predicate< object > | canExecute
readonly Action< object > | execute

Detailed Description

Definition at line 20 of file RelayCommand.cs.

Constructor & Destructor Documentation

RelayCommand ( Action< object > execute ) [inline]

Definition at line 25 of file RelayCommand.cs.

            : this(execute, null)
        {
        }

RelayCommand | ( | Action< object > | execute,
 |  | Predicate< object > | canExecute |
 | ) |  |  | [inline]

Definition at line 36 of file RelayCommand.cs.

        {
            if (execute == null)
            {
                throw new ArgumentNullException("execute");
            }
            this.execute = execute;
            this.canExecute = canExecute;
        }

Member Function Documentation

bool CanExecute ( object parameter ) [inline]

Definition at line 46 of file RelayCommand.cs.

        {
            return canExecute == null ? true : canExecute(parameter);
        }

void Execute ( object parameter ) [inline]

Definition at line 51 of file RelayCommand.cs.

        {
            execute(parameter);
        }

Member Data Documentation

readonly Predicate<object> canExecute [private]

Definition at line 23 of file RelayCommand.cs.

readonly Action<object> execute [private]

Definition at line 22 of file RelayCommand.cs.

Property Documentation

EventHandler CanExecuteChanged [add, remove]

Definition at line 31 of file RelayCommand.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/RelayCommand.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • Scenario1
Public Member Functions | Protected Member Functions | Private Attributes

Scenario1 Class Reference

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Attributes

Scenario1ViewModel | m_scenario1ViewModel = null

Detailed Description

Definition at line 17 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 21 of file Scenario1.xaml.cs.

        {
            InitializeComponent();
            m_scenario1ViewModel = new Scenario1ViewModel();
            DataContext = m_scenario1ViewModel;
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario1.xaml.cs.

        {
            if (m_scenario1ViewModel != null)
            {
                m_scenario1ViewModel.ScenarioCleanup();
            }
        }

Member Data Documentation

Scenario1ViewModel m_scenario1ViewModel = null [private]

Definition at line 19 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1ViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • Scenario1ViewModel
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

Scenario1ViewModel Class Reference

List of all members.

Public Member Functions

Scenario1ViewModel ()
void | ScenarioCleanup ()

Protected Member Functions

async void | RaisePropertyChangedEventAsync ([CallerMemberName] string name="")

Properties

ICommand | AttemptAuthentication [get]
Visibility | AuthenticationVisibility [get, set]
ICommand | ConnectToProducer [get]
Visibility | ConsumerOptionsVisibility [get, set]
string | EnteredKey [get, set]
string | InputString1 [get, set]
string | InputString2 [get, set]
bool | IsUpperCaseEnabled [get, set]
ICommand | RequestConcatenate [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | Authenticate ()
void | BusAttachment_AuthenticationComplete (AllJoynBusAttachment sender, AllJoynAuthenticationCompleteEventArgs args)
async void | BusAttachment_CredentialsRequested (AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
void | BusAttachment_StateChanged (AllJoynBusAttachment sender, AllJoynBusAttachmentStateChangedEventArgs args)
async void | ConcatenateAsync ()
void | Consumer_IsUpperCaseEnabledChanged (SecureInterfaceConsumer sender, object args)
void | Consumer_SessionLost (AllJoynSession sender, AllJoynSessionLostEventArgs args)
void | DisposeConsumer ()
void | DisposeWatcher ()
async void | SetIsUpperCaseEnabledAsync (bool value)
void | Signals_TextSentReceived (SecureInterfaceSignals sender, SecureInterfaceTextSentReceivedEventArgs args)
void | Start ()
async void | UpdateIsUpperCaseEnabledAsync ()
async void | UpdateStatusAsync (string status, NotifyType statusType)
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)

Private Attributes

TaskCompletionSource< bool > | m_authenticateClicked = null
Visibility | m_authVisibility = Visibility.Collapsed
AllJoynBusAttachment | m_busAttachment = null
bool | m_callSetProperty = true
SecureInterfaceConsumer | m_consumer = null
Visibility | m_consumerOptionsVisibility = Visibility.Collapsed
CoreDispatcher | m_dispatcher
bool | m_isAuthenticated = false
bool | m_isCredentialsRequested = false
bool | m_isUpperCaseEnabled = false
string | m_key = string.Empty
MainPage m_rootPage
DeviceWatcher | m_watcher = null

Detailed Description

Definition at line 29 of file Scenario1ViewModel.cs.

Constructor & Destructor Documentation

Scenario1ViewModel ( ) [inline]

Definition at line 45 of file Scenario1ViewModel.cs.

        {
            m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            m_rootPage = MainPage.Current;
        }

Member Function Documentation

void Authenticate ( ) [inline, private]

Definition at line 196 of file Scenario1ViewModel.cs.

        {
            if (string.IsNullOrWhiteSpace(m_key))
            {
                UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
            }
            else
            {
                if (m_authenticateClicked != null)
                {
                    UpdateStatusAsync("Authenticating...", NotifyType.StatusMessage);
                    m_authenticateClicked.SetResult(true);
                }
            }
        }

void BusAttachment_AuthenticationComplete | ( | AllJoynBusAttachment | sender,
 |  | AllJoynAuthenticationCompleteEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 250 of file Scenario1ViewModel.cs.

        {
            if (args.Succeeded)
            {
                UpdateStatusAsync("Authentication was successful.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
            }

            m_isAuthenticated = args.Succeeded;
            EnteredKey = "";
            AuthenticationVisibility = Visibility.Collapsed;
        }

async void BusAttachment_CredentialsRequested | ( | AllJoynBusAttachment | sender,
 |  | AllJoynCredentialsRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 266 of file Scenario1ViewModel.cs.

        {
            Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();
            m_authenticateClicked = new TaskCompletionSource<bool>();
            m_isCredentialsRequested = true;
            AuthenticationVisibility = Visibility.Visible;

            // Wait for the user to provide key and click authenticate.
            UpdateStatusAsync("Please enter the key.", NotifyType.StatusMessage);
            await m_authenticateClicked.Task;
            m_authenticateClicked = null;

            if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke)
            {
                if (!string.IsNullOrEmpty(m_key))
                {
                    args.Credentials.PasswordCredential.Password = m_key;
                }
                else
                {
                    UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }

            credentialsDeferral.Complete();
        }

void BusAttachment_StateChanged | ( | AllJoynBusAttachment | sender,
 |  | AllJoynBusAttachmentStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 241 of file Scenario1ViewModel.cs.

        {
            if (args.State == AllJoynBusAttachmentState.Disconnected)
            {
                UpdateStatusAsync(string.Format("AllJoyn bus attachment has disconnected with AllJoyn error: 0x{0:X}.", args.Status), NotifyType.StatusMessage);
                ConsumerOptionsVisibility = Visibility.Collapsed;
            }
        }

async void ConcatenateAsync ( ) [inline, private]

Definition at line 212 of file Scenario1ViewModel.cs.

        {
            if (m_consumer != null)
            {
                if (string.IsNullOrWhiteSpace(InputString1) || string.IsNullOrWhiteSpace(InputString2))
                {
                    UpdateStatusAsync("Input strings cannot be empty.", NotifyType.ErrorMessage);
                }
                else
                {
                    // Call the Concatenate method with the input strings arguments.
                    SecureInterfaceConcatenateResult catResult = await m_consumer.ConcatenateAsync(InputString1, InputString2);

                    if (catResult.Status == AllJoynStatus.Ok)
                    {
                        UpdateStatusAsync(string.Format("Concatenation output : \"{0}\".", catResult.OutStr), NotifyType.StatusMessage);
                    }
                    else
                    {
                        UpdateStatusAsync(string.Format("AllJoyn Error : 0x{0:X}.", catResult.Status), NotifyType.ErrorMessage);
                    }
                }
            }
            else
            {
                UpdateStatusAsync("Consumer not connected.", NotifyType.ErrorMessage);
            }
        }

void Consumer_IsUpperCaseEnabledChanged | ( | SecureInterfaceConsumer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 372 of file Scenario1ViewModel.cs.

        {
            UpdateIsUpperCaseEnabledAsync();
        }

void Consumer_SessionLost | ( | AllJoynSession | sender,
 |  | AllJoynSessionLostEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 348 of file Scenario1ViewModel.cs.

        {
            UpdateStatusAsync(string.Format("AllJoyn session with the producer lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage);
            ConsumerOptionsVisibility = Visibility.Collapsed;
            DisposeConsumer();
        }

void DisposeConsumer ( ) [inline, private]

Definition at line 406 of file Scenario1ViewModel.cs.

        {
            if (m_consumer != null)
            {
                m_consumer.Session.Lost -= Consumer_SessionLost;
                m_consumer.Signals.TextSentReceived -= Signals_TextSentReceived;
                m_consumer.IsUpperCaseEnabledChanged -= Consumer_IsUpperCaseEnabledChanged;
                m_consumer.Dispose();
                m_consumer = null;
            }
        }

void DisposeWatcher ( ) [inline, private]

Definition at line 418 of file Scenario1ViewModel.cs.

        {
            if (m_watcher != null)
            {
                m_watcher.Added -= Watcher_Added;
                m_watcher.Stop();
                m_watcher = null;
            }
        }

async void RaisePropertyChangedEventAsync ( [CallerMemberName] string name = "" ) [inline, protected]

Definition at line 165 of file Scenario1ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            });
        }

void ScenarioCleanup ( ) [inline]

Definition at line 150 of file Scenario1ViewModel.cs.

        {
            DisposeConsumer();
            DisposeWatcher();

            if (m_busAttachment != null)
            {
                m_busAttachment.CredentialsRequested -= BusAttachment_CredentialsRequested;
                m_busAttachment.AuthenticationComplete -= BusAttachment_AuthenticationComplete;
                m_busAttachment.StateChanged -= BusAttachment_StateChanged;
                m_busAttachment.Disconnect();
                m_busAttachment = null;
            }
        }

async void SetIsUpperCaseEnabledAsync ( bool value ) [inline, private]

Definition at line 391 of file Scenario1ViewModel.cs.

        {
            SecureInterfaceSetIsUpperCaseEnabledResult setIsUpperCaseEnabledResult = await m_consumer.SetIsUpperCaseEnabledAsync(value);
            if (setIsUpperCaseEnabledResult.Status == AllJoynStatus.Ok)
            {
                UpdateStatusAsync("\"IsUpperCaseEnabled\" property successfully set.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync(string.Format("Set property failed with AllJoyn error: 0x{0:X}.", setIsUpperCaseEnabledResult.Status), NotifyType.ErrorMessage);
                m_callSetProperty = false;
                IsUpperCaseEnabled = !value;
            }
        }

void Signals_TextSentReceived | ( | SecureInterfaceSignals | sender,
 |  | SecureInterfaceTextSentReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 355 of file Scenario1ViewModel.cs.

        {
            // Show UI Toast.
            ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);

            // Populate UI Toast.
            XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
            toastTextElements[0].AppendChild(toastXml.CreateTextNode("Signal Received - " + args.Message));

            // Create and Send UI Toast.
            ToastNotification toast = new ToastNotification(toastXml);
            ToastNotificationManager.CreateToastNotifier().Show(toast);

            UpdateStatusAsync("Signal Received - " + args.Message, NotifyType.StatusMessage);
        }

void Start ( ) [inline, private]

Definition at line 173 of file Scenario1ViewModel.cs.

        {
            ScenarioCleanup();

            m_busAttachment = new AllJoynBusAttachment();
            m_busAttachment.StateChanged += BusAttachment_StateChanged;
            m_busAttachment.AuthenticationMechanisms.Clear();
            m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheSpeke);
            m_busAttachment.AuthenticationComplete += BusAttachment_AuthenticationComplete;
            m_busAttachment.CredentialsRequested += BusAttachment_CredentialsRequested;

            // Initialize a watcher object to listen for about interfaces.
            m_watcher = AllJoynBusAttachment.GetWatcher(new List<string> { "com.microsoft.Samples.SecureInterface" });

            // Subscribing to the added event that will be raised whenever a producer for this service is found.
            m_watcher.Added += Watcher_Added;

            UpdateStatusAsync("Searching...", NotifyType.StatusMessage);

            // Start watching for producers advertising this service.
            m_watcher.Start();
        }

async void UpdateIsUpperCaseEnabledAsync ( ) [inline, private]

Definition at line 377 of file Scenario1ViewModel.cs.

        {
            SecureInterfaceGetIsUpperCaseEnabledResult getIsUpperCaseEnabledResult = await m_consumer.GetIsUpperCaseEnabledAsync();
            if (getIsUpperCaseEnabledResult.Status == AllJoynStatus.Ok)
            {
                m_callSetProperty = false;
                IsUpperCaseEnabled = getIsUpperCaseEnabledResult.IsUpperCaseEnabled;
            }
            else
            {
                UpdateStatusAsync(string.Format("Get property failed with AllJoyn error: 0x{0:X}.", getIsUpperCaseEnabledResult.Status), NotifyType.ErrorMessage);
            }
        }

async void UpdateStatusAsync | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 428 of file Scenario1ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_rootPage.NotifyUser(status, statusType);
            });
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 297 of file Scenario1ViewModel.cs.

        {
            // Optional - Get the About data of the producer.
            AllJoynAboutDataView aboutData = await m_busAttachment.GetAboutDataAsync(await AllJoynServiceInfo.FromIdAsync(args.Id));

            // Check to see if device name is populated in the about data, since device name is not a mandatory field.
            if (string.IsNullOrEmpty(aboutData.DeviceName))
            {
                UpdateStatusAsync(string.Format("Found {0} from manufacturer: {1}. Connecting...", aboutData.AppName, aboutData.Manufacturer), NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync(string.Format("Found {0} on {1} from manufacturer: {2}. Connecting...", aboutData.AppName, aboutData.DeviceName, aboutData.Manufacturer), NotifyType.StatusMessage);
            }

            DisposeConsumer();
            UpdateStatusAsync("Joining session...", NotifyType.StatusMessage);
            m_consumer = await SecureInterfaceConsumer.FromIdAsync(args.Id, m_busAttachment);
            if (m_consumer != null)
            {
                m_consumer.IsUpperCaseEnabledChanged += Consumer_IsUpperCaseEnabledChanged;
                m_consumer.Signals.TextSentReceived += Signals_TextSentReceived;
                m_consumer.Session.Lost += Consumer_SessionLost;

                // At the time of connection, the request credentials callback not being invoked is an
                // indication that the consumer and producer are already authenticated from a previous session.
                if (!m_isCredentialsRequested)
                {
                    UpdateStatusAsync("Connected and already authenticated from previous session.", NotifyType.StatusMessage);
                    UpdateIsUpperCaseEnabledAsync();
                }
                else
                {
                    if (m_isAuthenticated)
                    {
                        UpdateStatusAsync("Connected with authentication.", NotifyType.StatusMessage);
                        UpdateIsUpperCaseEnabledAsync();
                    }
                    else
                    {
                        UpdateStatusAsync("Connected but authentication failed.", NotifyType.ErrorMessage);
                    }
                }
                ConsumerOptionsVisibility = Visibility.Visible;
            }
            else
            {
                UpdateStatusAsync("Attempt to join session failed.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

TaskCompletionSource<bool> m_authenticateClicked = null [private]

Definition at line 36 of file Scenario1ViewModel.cs.

Visibility m_authVisibility = Visibility.Collapsed [private]

Definition at line 37 of file Scenario1ViewModel.cs.

AllJoynBusAttachment m_busAttachment = null [private]

Definition at line 33 of file Scenario1ViewModel.cs.

bool m_callSetProperty = true [private]

Definition at line 42 of file Scenario1ViewModel.cs.

SecureInterfaceConsumer m_consumer = null [private]

Definition at line 35 of file Scenario1ViewModel.cs.

Visibility m_consumerOptionsVisibility = Visibility.Collapsed [private]

Definition at line 38 of file Scenario1ViewModel.cs.

CoreDispatcher m_dispatcher [private]

Definition at line 32 of file Scenario1ViewModel.cs.

bool m_isAuthenticated = false [private]

Definition at line 39 of file Scenario1ViewModel.cs.

bool m_isCredentialsRequested = false [private]

Definition at line 40 of file Scenario1ViewModel.cs.

bool m_isUpperCaseEnabled = false [private]

Definition at line 41 of file Scenario1ViewModel.cs.

string m_key = string.Empty [private]

Definition at line 43 of file Scenario1ViewModel.cs.

MainPage m_rootPage [private]

Definition at line 31 of file Scenario1ViewModel.cs.

DeviceWatcher m_watcher = null [private]

Definition at line 34 of file Scenario1ViewModel.cs.

Property Documentation

ICommand AttemptAuthentication [get]

Definition at line 129 of file Scenario1ViewModel.cs.

Visibility AuthenticationVisibility [get, set]

Definition at line 54 of file Scenario1ViewModel.cs.

ICommand ConnectToProducer [get]

Definition at line 118 of file Scenario1ViewModel.cs.

Visibility ConsumerOptionsVisibility [get, set]

Definition at line 67 of file Scenario1ViewModel.cs.

string EnteredKey [get, set]

Definition at line 80 of file Scenario1ViewModel.cs.

string InputString1 [get, set]

Definition at line 92 of file Scenario1ViewModel.cs.

string InputString2 [get, set]

Definition at line 94 of file Scenario1ViewModel.cs.

bool IsUpperCaseEnabled [get, set]

Definition at line 97 of file Scenario1ViewModel.cs.

ICommand RequestConcatenate [get]

Definition at line 140 of file Scenario1ViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 51 of file Scenario1ViewModel.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/Scenario1ViewModel.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • Scenario2
Public Member Functions | Protected Member Functions | Private Attributes

Scenario2 Class Reference

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Attributes

Scenario2ViewModel | m_scenario2ViewModel = null

Detailed Description

Definition at line 17 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 21 of file Scenario2.xaml.cs.

        {
            InitializeComponent();
            m_scenario2ViewModel = new Scenario2ViewModel();
            DataContext = m_scenario2ViewModel;
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario2.xaml.cs.

        {
            if (m_scenario2ViewModel != null)
            {
                m_scenario2ViewModel.ScenarioCleanup();
            }
        }

Member Data Documentation

Scenario2ViewModel m_scenario2ViewModel = null [private]

Definition at line 19 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2ViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynConsumerExperiences
  • Scenario2ViewModel
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario2ViewModel Class Reference

List of all members.

Public Member Functions

Scenario2ViewModel ()
void | ScenarioCleanup ()

Protected Member Functions

async void | RaisePropertyChangedEventAsync ([CallerMemberName] string name="")

Properties

ICommand | AttemptAuthentication [get]
Visibility | AuthenticationVisibility [get, set]
string[] | AuthTypeArray [get]
ICommand | Connect [get]
Visibility | ConnectPanelVisibility [get, set]
string | EnteredKey [get, set]
string | ManualSsid [get, set]
bool | ManualSsidIsChecked [get, set]
Visibility | ManualSsidTextBoxVisibility [get, set]
ICommand | Onboard [get]
ObservableCollection
< OnboardingScanListItem > 		OnboardeeNetworkList [get]
Visibility | OnboardeeSsidListVisibility [get, set]
ObservableCollection
< WiFiAvailableNetwork > 		OnboarderNetworkList [get]
Visibility | OnboarderSsidListVisibility [get, set]
Visibility | OnboardingConfigurationVisibility [get, set]
string | OnboardingPassword [get, set]
bool | OnboardingProducerIsChecked [get, set]
Visibility | PasswordVisibility [get, set]
bool | PhysicalDeviceIsChecked [get, set]
Visibility | ScanPanelVisibility [get, set]
OnboardingAuthenticationType | SelectedAuthType [get, set]
OnboardingScanListItem | SelectedOnboardeeNetwork [get, set]
WiFiAvailableNetwork | SelectedOnboarderNetwork [get, set]
WiFiAvailableNetwork | SelectedSoftAPNetwork [get, set]
int | SelectedWiFiAdapterIndex [get, set]
string | SoftAPPassword [get, set]
ICommand | StartScan [get]
ObservableCollection< string > | WiFiAdapterDisplayNames [get]
Visibility | WiFiAdapterListVisibility [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

async void | AttemptConnectionAsync ()
async void | AttemptOnboardingAsync (string ssid, string password, short authType)
void | Authenticate ()
void | BusAttachment_AuthenticationComplete (AllJoynBusAttachment sender, AllJoynAuthenticationCompleteEventArgs args)
async void | BusAttachment_CredentialsRequested (AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
void | BusAttachment_StateChanged (AllJoynBusAttachment sender, AllJoynBusAttachmentStateChangedEventArgs args)
void | ClearPasswords ()
async void | ConnectToSoftAPAsync ()
void | Consumer_SessionLost (AllJoynSession sender, AllJoynSessionLostEventArgs args)
void | DisposeConsumer ()
void | DisposeWatcher ()
async void | GetOnboardeeNetworkListAsync ()
void | GetOnboardingConfiguration ()
void | NetworkInformation_NetworkStatusChanged (object sender)
void | ResetControls ()
void | ScanForOnboardingInterfaces ()
async void | ScanForWiFiAdaptersAsync ()
async void | ScanForWiFiNetworksAsync ()
void | ShowOnboardeeSsidList ()
void | ShowOnboarderSsidList ()
void | Signals_ConnectionResultReceived (OnboardingSignals sender, OnboardingConnectionResultReceivedEventArgs args)
void | StartScanning ()
async void | UpdateConnectivityStatusAsync ()
async void | UpdateStatusAsync (string status, NotifyType statusType)
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)

Static Private Member Functions

static string | ConvertUtf8ToHex (string inputString)

Private Attributes

TaskCompletionSource< bool > | m_authenticateClicked = null
Visibility | m_authenticationVisibility = Visibility.Collapsed
AllJoynBusAttachment | m_busAttachment = null
Visibility | m_connectPanelVisibility = Visibility.Collapsed
OnboardingConsumer | m_consumer = null
CoreDispatcher | m_dispatcher
string | m_key = ""
string | m_manualSsid = ""
bool | m_manualSsidIsChecked = null
Visibility | m_manualSsidTextBoxVisibility = Visibility.Collapsed
ObservableCollection
< OnboardingScanListItem > 		m_onboardeeNetworkList
Visibility | m_onboardeeSsidListVisibility = Visibility.Visible
ObservableCollection
< WiFiAvailableNetwork > 		m_onboarderNetworkList
Visibility | m_onboarderSsidListVisibility = Visibility.Collapsed
Visibility | m_onboardingConfigurationVisibility = Visibility.Collapsed
string | m_onboardingPassword = ""
bool | m_onboardingProducerIsChecked = null
int | m_onboardSessionAlreadyJoined
Visibility | m_passwordVisibility = Visibility.Collapsed
bool | m_physicalDeviceIsChecked = null
MainPage m_rootPage
string | m_savedProfileName
Visibility | m_scanPanelVisibility = Visibility.Collapsed
OnboardingAuthenticationType | m_selectedAuthType = OnboardingAuthenticationType.Any
OnboardingScanListItem | m_selectedOnboardeeNetwork
WiFiAvailableNetwork | m_selectedOnboarderNetwork
WiFiAvailableNetwork | m_selectedSoftAPNetwork
int | m_selectedWiFiAdapterIndex = -1
bool | m_showOnboardeeSsidList = true
bool | m_showOnboarderSsidList = false
string | m_softAPPassword = ""
DeviceWatcher | m_watcher = null
WiFiAdapter | m_wiFiAdapter = null
ObservableCollection< string > | m_wiFiAdapterDisplayNames
IReadOnlyList< WiFiAdapter > | m_wiFiAdapterList
Visibility | m_wiFiAdapterListVisibility = Visibility.Collapsed

Detailed Description

Definition at line 33 of file Scenario2ViewModel.cs.

Constructor & Destructor Documentation

Scenario2ViewModel ( ) [inline]

Definition at line 72 of file Scenario2ViewModel.cs.

        {
            m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            m_rootPage = MainPage.Current;
            m_wiFiAdapterDisplayNames = new ObservableCollection<string>();
            m_onboarderNetworkList = new ObservableCollection<WiFiAvailableNetwork>();
            m_onboardeeNetworkList = new ObservableCollection<OnboardingScanListItem>();
        }

Member Function Documentation

async void AttemptConnectionAsync ( ) [inline, private]

Definition at line 923 of file Scenario2ViewModel.cs.

        {
            OnboardingConnectResult connectResult = await m_consumer.ConnectAsync();
            UpdateStatusAsync("Connect request sent.", NotifyType.StatusMessage);
        }

async void AttemptOnboardingAsync | ( | string | ssid,
 |  | string | password,
 |  | short | authType |
 | ) |  |  | [inline, private]

Definition at line 875 of file Scenario2ViewModel.cs.

        {
            if (string.IsNullOrWhiteSpace(ssid))
            {
                UpdateStatusAsync("No SSID selected. Please select a network or manually enter SSID.", NotifyType.ErrorMessage);
            }
            else
            {
                UpdateStatusAsync("Attempting to configure onboardee...", NotifyType.StatusMessage);

                OnboardingConfigureWiFiResult configureWifiResult = await m_consumer.ConfigureWiFiAsync(ssid, ConvertUtf8ToHex(password), authType);
                if (configureWifiResult.Status == AllJoynStatus.Ok)
                {
                    UpdateStatusAsync("Onboardee sucessfully configured.", NotifyType.StatusMessage);
                    if (configureWifiResult.Status2 == (short)ConfigureWiFiResultStatus.Concurrent)
                    {
                        // The Onboardee has indicated that it will attempt to connect to the desired AP concurrently, while the SoftAP is enabled. In this case,
                        // the Onboarder application must wait for the ConnectionResult signal to arrive over the AllJoyn session established over the SoftAP link.
                        // If the Onboardee does not connect to the desired AP concurrently, then there is no guaranteed way for the Onboarder application to find
                        // out if the connection attempt was successful or not. In the NotConcurrent connection attempt, if the Onboardee fails to connect to
                        // the desired AP, the Onboarder application will have to again start over with scanning and connecting to the Onboardee SoftAP.
                        // For more information please visit http://go.microsoft.com/fwlink/?LinkId=817239
                        m_consumer.Signals.ConnectionResultReceived += Signals_ConnectionResultReceived;
                    }
                    AttemptConnectionAsync();
                }
                else
                {
                    UpdateStatusAsync(string.Format("Attempt to configure WiFi failed with AllJoyn error: 0x{0:X}.", configureWifiResult.Status), NotifyType.ErrorMessage);
                }
            }
            ClearPasswords();
        }

void Authenticate ( ) [inline, private]

Definition at line 792 of file Scenario2ViewModel.cs.

        {
            if (string.IsNullOrWhiteSpace(m_key))
            {
                UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
            }
            else
            {
                if (m_authenticateClicked != null)
                {
                    UpdateStatusAsync("Authenticating...", NotifyType.StatusMessage);
                    m_authenticateClicked.SetResult(true);
                }
            }
        }

void BusAttachment_AuthenticationComplete | ( | AllJoynBusAttachment | sender,
 |  | AllJoynAuthenticationCompleteEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 711 of file Scenario2ViewModel.cs.

        {
            if (args.Succeeded)
            {
                UpdateStatusAsync("Authentication was successful.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
            }

            EnteredKey = "";
            AuthenticationVisibility = Visibility.Collapsed;
        }

async void BusAttachment_CredentialsRequested | ( | AllJoynBusAttachment | sender,
 |  | AllJoynCredentialsRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 726 of file Scenario2ViewModel.cs.

        {
            Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();

            if ((args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk) ||
                (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke))
            {
                m_authenticateClicked = new TaskCompletionSource<bool>();
                AuthenticationVisibility = Visibility.Visible;

                UpdateStatusAsync("Please enter the key.", NotifyType.StatusMessage);
                await m_authenticateClicked.Task;
                m_authenticateClicked = null;

                if (!string.IsNullOrEmpty(m_key))
                {
                    args.Credentials.PasswordCredential.Password = m_key;
                }
                else
                {
                    UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
                }
            }
            else if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheNull)
            {
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }

            credentialsDeferral.Complete();
        }

void BusAttachment_StateChanged | ( | AllJoynBusAttachment | sender,
 |  | AllJoynBusAttachmentStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 702 of file Scenario2ViewModel.cs.

        {
            if (args.State == AllJoynBusAttachmentState.Disconnected)
            {
                UpdateStatusAsync(string.Format("AllJoyn bus attachment has disconnected with AllJoyn error: 0x{0:X}.", args.Status), NotifyType.StatusMessage);
                ResetControls();
            }
        }

void ClearPasswords ( ) [inline, private]

Definition at line 941 of file Scenario2ViewModel.cs.

        {
            SoftAPPassword = "";
            OnboardingPassword = "";
        }

async void ConnectToSoftAPAsync ( ) [inline, private]

Definition at line 630 of file Scenario2ViewModel.cs.

        {
            if (m_wiFiAdapter != null)
            {
                if (m_selectedSoftAPNetwork == null)
                {
                    UpdateStatusAsync("Network not selected. Please select a network.", NotifyType.ErrorMessage);
                }
                else
                {
                    UpdateStatusAsync(string.Format("Attempting to connect to {0}...", m_selectedSoftAPNetwork.Ssid), NotifyType.StatusMessage);
                    WiFiConnectionResult result = null;
                    if (m_selectedSoftAPNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211)
                    {
                        result = await m_wiFiAdapter.ConnectAsync(m_selectedSoftAPNetwork, WiFiReconnectionKind.Manual);
                    }
                    else
                    {
                        if (string.IsNullOrWhiteSpace(m_softAPPassword))
                        {
                            UpdateStatusAsync("No password entered.", NotifyType.ErrorMessage);
                        }
                        else
                        {
                            PasswordCredential credential = new PasswordCredential();
                            credential.Password = m_softAPPassword;
                            result = await m_wiFiAdapter.ConnectAsync(m_selectedSoftAPNetwork, WiFiReconnectionKind.Manual, credential);
                        }
                        ClearPasswords();
                    }

                    if (result != null)
                    {
                        if (result.ConnectionStatus == WiFiConnectionStatus.Success)
                        {
                            UpdateStatusAsync(string.Format("Successfully connected to {0}.", m_selectedSoftAPNetwork.Ssid), NotifyType.StatusMessage);
                            ScanForOnboardingInterfaces();
                        }
                        else
                        {
                            UpdateStatusAsync(string.Format("Failed to connect to {0} with error: {1}.", m_selectedSoftAPNetwork.Ssid, result.ConnectionStatus), NotifyType.ErrorMessage);
                        }
                    }
                }
            }
        }

void Consumer_SessionLost | ( | AllJoynSession | sender,
 |  | AllJoynSessionLostEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 785 of file Scenario2ViewModel.cs.

        {
            UpdateStatusAsync(string.Format("AllJoyn session with the onboardee lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage);
            DisposeConsumer();
            ResetControls();
        }

static string ConvertUtf8ToHex ( string inputString ) [inline, static, private]

Definition at line 909 of file Scenario2ViewModel.cs.

        {
            if (string.IsNullOrEmpty(inputString))
            {
                return string.Empty;
            }
            else
            {
                var tempBuffer = CryptographicBuffer.ConvertStringToBinary(inputString, BinaryStringEncoding.Utf8);
                var hexString = CryptographicBuffer.EncodeToHexString(tempBuffer);
                return hexString;
            }
        }

void DisposeConsumer ( ) [inline, private]

Definition at line 984 of file Scenario2ViewModel.cs.

        {
            if (m_consumer != null)
            {
                m_consumer.Session.Lost -= Consumer_SessionLost;
                m_consumer.Dispose();
                m_consumer = null;
            }
        }

void DisposeWatcher ( ) [inline, private]

Definition at line 994 of file Scenario2ViewModel.cs.

        {
            if (m_watcher != null)
            {
                m_watcher.Added -= Watcher_Added;
                m_watcher.Stop();
                m_watcher = null;
            }
        }

async void GetOnboardeeNetworkListAsync ( ) [inline, private]

Definition at line 808 of file Scenario2ViewModel.cs.

        {
            UpdateStatusAsync("Requesting network list from the onboardee...", NotifyType.StatusMessage);
            OnboardingGetScanInfoResult getScanResult = await m_consumer.GetScanInfoAsync();
            if (getScanResult.Status == AllJoynStatus.Ok)
            {
                if (getScanResult.ScanList.Count > 0)
                {
                    await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        foreach (OnboardingScanListItem item in getScanResult.ScanList)
                        {
                            m_onboardeeNetworkList.Add(item);
                        }
                    });

                    ShowOnboardeeSsidList();
                    UpdateStatusAsync(string.Format("{0} network(s) returned. Scan age: {1} minutes.", getScanResult.ScanList.Count, getScanResult.Age), NotifyType.StatusMessage);
                }
                else
                {
                    // No networks returned by the onboardee. Provide the user option to configure onboardee with networks visible from onboarder.
                    UpdateStatusAsync("Please select a network or enter one manually.", NotifyType.StatusMessage);
                    ShowOnboarderSsidList();
                }
            }
            else
            {
                // Unable to get scan information from the onboardee. Provide the user option to configure onboardee with networks visible from onboarder.
                UpdateStatusAsync("Please select a network or enter one manually.", NotifyType.StatusMessage);
                ShowOnboarderSsidList();
            }
            OnboardingConfigurationVisibility = Visibility.Visible;
        }

void GetOnboardingConfiguration ( ) [inline, private]

Definition at line 843 of file Scenario2ViewModel.cs.

        {
            string configureSsid = null;

            if (m_manualSsidIsChecked == true)
            {
                if (!string.IsNullOrWhiteSpace(m_manualSsid))
                {
                    configureSsid = m_manualSsid;
                }
            }
            else
            {
                if (m_showOnboardeeSsidList)
                {
                    if (m_selectedOnboardeeNetwork != null)
                    {
                        configureSsid = m_selectedOnboardeeNetwork.Value1;
                    }
                }
                else
                {
                    if (m_selectedOnboarderNetwork != null)
                    {
                        configureSsid = m_selectedOnboarderNetwork.Ssid;
                    }
                }
            }

            AttemptOnboardingAsync(configureSsid, m_onboardingPassword, (short)m_selectedAuthType);
        }

void NetworkInformation_NetworkStatusChanged ( object sender ) [inline, private]

Definition at line 625 of file Scenario2ViewModel.cs.

        {
            UpdateConnectivityStatusAsync();
        }

async void RaisePropertyChangedEventAsync ( [CallerMemberName] string name = "" ) [inline, protected]

Definition at line 528 of file Scenario2ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            });
        }

void ResetControls ( ) [inline, private]

Definition at line 975 of file Scenario2ViewModel.cs.

        {
            ScanPanelVisibility = Visibility.Visible;
            WiFiAdapterListVisibility = Visibility.Collapsed;
            ConnectPanelVisibility = Visibility.Collapsed;
            AuthenticationVisibility = Visibility.Collapsed;
            OnboardingConfigurationVisibility = Visibility.Collapsed;
        }

void ScanForOnboardingInterfaces ( ) [inline, private]

Definition at line 677 of file Scenario2ViewModel.cs.

        {
            ScenarioCleanup();

            // Allow re-joining of a new session
            Interlocked.Exchange(ref m_onboardSessionAlreadyJoined, 0);

            m_busAttachment = new AllJoynBusAttachment();
            m_busAttachment.StateChanged += BusAttachment_StateChanged;
            m_busAttachment.AuthenticationMechanisms.Clear();

            // EcdhePsk authentication is deprecated as of the AllJoyn 16.04 release.
            // Newly added EcdheSpeke should be used instead. EcdhePsk authentication is
            // added here to maintain compatibility with devices running older AllJoyn versions.
            m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheNull);
            m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdhePsk);
            m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheSpeke);
            m_busAttachment.AuthenticationComplete += BusAttachment_AuthenticationComplete;
            m_busAttachment.CredentialsRequested += BusAttachment_CredentialsRequested;
            m_watcher = AllJoynBusAttachment.GetWatcher(new List<string> { "org.alljoyn.Onboarding" });
            m_watcher.Added += Watcher_Added;
            UpdateStatusAsync("Searching for onboarding interface...", NotifyType.StatusMessage);
            m_watcher.Start();
        }

async void ScanForWiFiAdaptersAsync ( ) [inline, private]

Definition at line 548 of file Scenario2ViewModel.cs.

        {
            if (m_wiFiAdapter == null)
            {
                UpdateStatusAsync("Requesting WiFi access...", NotifyType.StatusMessage);
                WiFiAccessStatus accessStatus = await WiFiAdapter.RequestAccessAsync();
                if (accessStatus != WiFiAccessStatus.Allowed)
                {
                    UpdateStatusAsync("WiFi access denied.", NotifyType.ErrorMessage);
                }
                else
                {
                    m_wiFiAdapterList = await WiFiAdapter.FindAllAdaptersAsync();
                    if (m_wiFiAdapterList.Count > 0)
                    {
                        for (int i = 0; i < m_wiFiAdapterList.Count; i++)
                        {
                            m_wiFiAdapterDisplayNames.Add(string.Format("Adapter {0}", (i + 1)));
                        }
                        WiFiAdapterListVisibility = Visibility.Visible;
                        UpdateStatusAsync("Please select a WiFi adapter.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        UpdateStatusAsync("No WiFi adapters detected on this machine.", NotifyType.ErrorMessage);
                    }
                }
            }
        }

async void ScanForWiFiNetworksAsync ( ) [inline, private]

Definition at line 578 of file Scenario2ViewModel.cs.

        {
            if (m_selectedWiFiAdapterIndex >= 0)
            {
                m_wiFiAdapter = m_wiFiAdapterList[m_selectedWiFiAdapterIndex];
            }

            if (m_wiFiAdapter != null)
            {
                UpdateConnectivityStatusAsync();
                NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged;
                UpdateStatusAsync("Scanning for available WiFi networks...", NotifyType.StatusMessage);
                await m_wiFiAdapter.ScanAsync();
                m_onboarderNetworkList.Clear();
                if (m_wiFiAdapter.NetworkReport.AvailableNetworks.Count > 0)
                {
                    foreach (WiFiAvailableNetwork network in m_wiFiAdapter.NetworkReport.AvailableNetworks)
                    {
                        m_onboarderNetworkList.Add(network);
                    }
                    ConnectPanelVisibility = Visibility.Visible;
                    UpdateStatusAsync("Scan complete. Please select a network to connect.", NotifyType.StatusMessage);
                }
                else
                {
                    UpdateStatusAsync("Scan complete. No WiFi networks found.", NotifyType.ErrorMessage);
                }
            }
        }

void ScenarioCleanup ( ) [inline]

Definition at line 513 of file Scenario2ViewModel.cs.

        {
            DisposeConsumer();
            DisposeWatcher();

            if (m_busAttachment != null)
            {
                m_busAttachment.CredentialsRequested -= BusAttachment_CredentialsRequested;
                m_busAttachment.AuthenticationComplete -= BusAttachment_AuthenticationComplete;
                m_busAttachment.StateChanged -= BusAttachment_StateChanged;
                m_busAttachment.Disconnect();
                m_busAttachment = null;
            }
        }

void ShowOnboardeeSsidList ( ) [inline, private]

Definition at line 947 of file Scenario2ViewModel.cs.

        {
            if (m_manualSsidIsChecked == true)
            {
                m_showOnboardeeSsidList = true;
                m_showOnboarderSsidList = false;
            }
            else
            {
                OnboardeeSsidListVisibility = Visibility.Visible;
                OnboarderSsidListVisibility = Visibility.Collapsed;
            }
        }

void ShowOnboarderSsidList ( ) [inline, private]

Definition at line 961 of file Scenario2ViewModel.cs.

        {
            if (m_manualSsidIsChecked == true)
            {
                m_showOnboardeeSsidList = false;
                m_showOnboarderSsidList = true;
            }
            else
            {
                OnboardeeSsidListVisibility = Visibility.Collapsed;
                OnboarderSsidListVisibility = Visibility.Visible;
            }
        }

void Signals_ConnectionResultReceived | ( | OnboardingSignals | sender,
 |  | OnboardingConnectionResultReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 929 of file Scenario2ViewModel.cs.

        {
            if (args.Arg.Value1 == (short)ConnectionResultCode.Validated)
            {
                UpdateStatusAsync("Onboarding successful.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync(string.Format("Connection attempt failed with result code: {0} and message: {1}.", ((ConnectionResultCode)args.Arg.Value1).ToString(), args.Arg.Value2), NotifyType.ErrorMessage);
            }
        }

void StartScanning ( ) [inline, private]

Definition at line 536 of file Scenario2ViewModel.cs.

        {
            if (m_onboardingProducerIsChecked == true)
            {
                ScanForOnboardingInterfaces();
            }
            else if (m_physicalDeviceIsChecked == true)
            {
                ScanForWiFiAdaptersAsync();
            }
        }

async void UpdateConnectivityStatusAsync ( ) [inline, private]

Definition at line 608 of file Scenario2ViewModel.cs.

        {
            if (m_wiFiAdapter != null)
            {
                ConnectionProfile connectedProfile = await m_wiFiAdapter.NetworkAdapter.GetConnectedProfileAsync();
                if ((connectedProfile != null) && (!connectedProfile.ProfileName.Equals(m_savedProfileName)))
                {
                    m_savedProfileName = connectedProfile.ProfileName;
                }
                else if ((connectedProfile == null) && (m_savedProfileName != null))
                {
                    UpdateStatusAsync("WiFi adapter disconnected from: " + m_savedProfileName, NotifyType.StatusMessage);
                    m_savedProfileName = null;
                }
            }
        }

async void UpdateStatusAsync | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 1004 of file Scenario2ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_rootPage.NotifyUser(status, statusType);
            });
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 760 of file Scenario2ViewModel.cs.

        {
            // This demo supports a single onboarding producer, if there are multiple onboarding producers found, then they are ignored.
            // Another approach would be to create a list of all producers found and then allow the user to choose the one they want
            bool bAlreadyJoined = (Interlocked.CompareExchange(ref m_onboardSessionAlreadyJoined, 1, 0) == 1);
            if (bAlreadyJoined)
            {
                return;
            }

            DisposeConsumer();
            UpdateStatusAsync("Joining session...", NotifyType.StatusMessage);
            m_consumer = await OnboardingConsumer.FromIdAsync(args.Id, m_busAttachment);

            if (m_consumer != null)
            {
                m_consumer.Session.Lost += Consumer_SessionLost;
                GetOnboardeeNetworkListAsync();
            }
            else
            {
                UpdateStatusAsync("Attempt to join session failed.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

TaskCompletionSource<bool> m_authenticateClicked = null [private]

Definition at line 69 of file Scenario2ViewModel.cs.

Visibility m_authenticationVisibility = Visibility.Collapsed [private]

Definition at line 53 of file Scenario2ViewModel.cs.

AllJoynBusAttachment m_busAttachment = null [private]

Definition at line 65 of file Scenario2ViewModel.cs.

Visibility m_connectPanelVisibility = Visibility.Collapsed [private]

Definition at line 49 of file Scenario2ViewModel.cs.

OnboardingConsumer m_consumer = null [private]

Definition at line 67 of file Scenario2ViewModel.cs.

CoreDispatcher m_dispatcher [private]

Definition at line 36 of file Scenario2ViewModel.cs.

string m_key = "" [private]

Definition at line 59 of file Scenario2ViewModel.cs.

string m_manualSsid = "" [private]

Definition at line 58 of file Scenario2ViewModel.cs.

bool m_manualSsidIsChecked = null [private]

Definition at line 60 of file Scenario2ViewModel.cs.

Visibility m_manualSsidTextBoxVisibility = Visibility.Collapsed [private]

Definition at line 48 of file Scenario2ViewModel.cs.

ObservableCollection<OnboardingScanListItem> m_onboardeeNetworkList [private]

Definition at line 41 of file Scenario2ViewModel.cs.

Visibility m_onboardeeSsidListVisibility = Visibility.Visible [private]

Definition at line 46 of file Scenario2ViewModel.cs.

ObservableCollection<WiFiAvailableNetwork> m_onboarderNetworkList [private]

Definition at line 40 of file Scenario2ViewModel.cs.

Visibility m_onboarderSsidListVisibility = Visibility.Collapsed [private]

Definition at line 47 of file Scenario2ViewModel.cs.

Visibility m_onboardingConfigurationVisibility = Visibility.Collapsed [private]

Definition at line 50 of file Scenario2ViewModel.cs.

string m_onboardingPassword = "" [private]

Definition at line 57 of file Scenario2ViewModel.cs.

bool m_onboardingProducerIsChecked = null [private]

Definition at line 61 of file Scenario2ViewModel.cs.

int m_onboardSessionAlreadyJoined [private]

Definition at line 70 of file Scenario2ViewModel.cs.

Visibility m_passwordVisibility = Visibility.Collapsed [private]

Definition at line 45 of file Scenario2ViewModel.cs.

bool m_physicalDeviceIsChecked = null [private]

Definition at line 62 of file Scenario2ViewModel.cs.

MainPage m_rootPage [private]

Definition at line 35 of file Scenario2ViewModel.cs.

string m_savedProfileName [private]

Definition at line 55 of file Scenario2ViewModel.cs.

Visibility m_scanPanelVisibility = Visibility.Collapsed [private]

Definition at line 51 of file Scenario2ViewModel.cs.

OnboardingAuthenticationType m_selectedAuthType = OnboardingAuthenticationType.Any [private]

Definition at line 68 of file Scenario2ViewModel.cs.

OnboardingScanListItem m_selectedOnboardeeNetwork [private]

Definition at line 44 of file Scenario2ViewModel.cs.

WiFiAvailableNetwork m_selectedOnboarderNetwork [private]

Definition at line 43 of file Scenario2ViewModel.cs.

WiFiAvailableNetwork m_selectedSoftAPNetwork [private]

Definition at line 42 of file Scenario2ViewModel.cs.

int m_selectedWiFiAdapterIndex = -1 [private]

Definition at line 54 of file Scenario2ViewModel.cs.

bool m_showOnboardeeSsidList = true [private]

Definition at line 63 of file Scenario2ViewModel.cs.

bool m_showOnboarderSsidList = false [private]

Definition at line 64 of file Scenario2ViewModel.cs.

string m_softAPPassword = "" [private]

Definition at line 56 of file Scenario2ViewModel.cs.

DeviceWatcher m_watcher = null [private]

Definition at line 66 of file Scenario2ViewModel.cs.

WiFiAdapter m_wiFiAdapter = null [private]

Definition at line 37 of file Scenario2ViewModel.cs.

ObservableCollection<string> m_wiFiAdapterDisplayNames [private]

Definition at line 39 of file Scenario2ViewModel.cs.

IReadOnlyList<WiFiAdapter> m_wiFiAdapterList [private]

Definition at line 38 of file Scenario2ViewModel.cs.

Visibility m_wiFiAdapterListVisibility = Visibility.Collapsed [private]

Definition at line 52 of file Scenario2ViewModel.cs.

Property Documentation

ICommand AttemptAuthentication [get]

Definition at line 492 of file Scenario2ViewModel.cs.

Visibility AuthenticationVisibility [get, set]

Definition at line 309 of file Scenario2ViewModel.cs.

string [] AuthTypeArray [get]

Definition at line 446 of file Scenario2ViewModel.cs.

ICommand Connect [get]

Definition at line 481 of file Scenario2ViewModel.cs.

Visibility ConnectPanelVisibility [get, set]

Definition at line 257 of file Scenario2ViewModel.cs.

string EnteredKey [get, set]

Definition at line 430 of file Scenario2ViewModel.cs.

string ManualSsid [get, set]

Definition at line 418 of file Scenario2ViewModel.cs.

bool ManualSsidIsChecked [get, set]

Definition at line 322 of file Scenario2ViewModel.cs.

Visibility ManualSsidTextBoxVisibility [get, set]

Definition at line 244 of file Scenario2ViewModel.cs.

ICommand Onboard [get]

Definition at line 503 of file Scenario2ViewModel.cs.

ObservableCollection<OnboardingScanListItem> OnboardeeNetworkList [get]

Definition at line 100 of file Scenario2ViewModel.cs.

Visibility OnboardeeSsidListVisibility [get, set]

Definition at line 190 of file Scenario2ViewModel.cs.

ObservableCollection<WiFiAvailableNetwork> OnboarderNetworkList [get]

Definition at line 92 of file Scenario2ViewModel.cs.

Visibility OnboarderSsidListVisibility [get, set]

Definition at line 217 of file Scenario2ViewModel.cs.

Visibility OnboardingConfigurationVisibility [get, set]

Definition at line 270 of file Scenario2ViewModel.cs.

string OnboardingPassword [get, set]

Definition at line 402 of file Scenario2ViewModel.cs.

bool OnboardingProducerIsChecked [get, set]

Definition at line 352 of file Scenario2ViewModel.cs.

Visibility PasswordVisibility [get, set]

Definition at line 177 of file Scenario2ViewModel.cs.

bool PhysicalDeviceIsChecked [get, set]

Definition at line 369 of file Scenario2ViewModel.cs.

Visibility ScanPanelVisibility [get, set]

Definition at line 283 of file Scenario2ViewModel.cs.

OnboardingAuthenticationType SelectedAuthType [get, set]

Definition at line 454 of file Scenario2ViewModel.cs.

OnboardingScanListItem SelectedOnboardeeNetwork [get, set]

Definition at line 161 of file Scenario2ViewModel.cs.

WiFiAvailableNetwork SelectedOnboarderNetwork [get, set]

Definition at line 149 of file Scenario2ViewModel.cs.

WiFiAvailableNetwork SelectedSoftAPNetwork [get, set]

Definition at line 121 of file Scenario2ViewModel.cs.

int SelectedWiFiAdapterIndex [get, set]

Definition at line 108 of file Scenario2ViewModel.cs.

string SoftAPPassword [get, set]

Definition at line 386 of file Scenario2ViewModel.cs.

ICommand StartScan [get]

Definition at line 470 of file Scenario2ViewModel.cs.

ObservableCollection<string> WiFiAdapterDisplayNames [get]

Definition at line 84 of file Scenario2ViewModel.cs.

Visibility WiFiAdapterListVisibility [get, set]

Definition at line 296 of file Scenario2ViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 81 of file Scenario2ViewModel.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ConsumerExperiences/cs/Scenario2ViewModel.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoynHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Static Public Member Functions

AllJoynHelpers Class Reference

#include "AllJoynHelpers.h"

List of all members.

Static Public Member Functions

template<class T >
static QCC_BOOL AJ_CALL | AcceptSessionJoinerHandler (_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ PCSTR joiner, _In_ const alljoyn_sessionopts opts)
template<class T >
static QCC_BOOL AJ_CALL | AcceptSessionJoinerHandler (_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ PCSTR joiner, _In_ const alljoyn_sessionopts opts)
static bool | CanSecure (_In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^authenticationMechanisms)
static bool | CanSecure (_In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^authenticationMechanisms)
template<class T >
static QStatus | CreateBusObject (_Inout_ Platform::WeakReference *target)
template<class T >
static QStatus | CreateBusObject (_Inout_ Platform::WeakReference *target)
static QStatus | CreateInterfaces (_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _In_ PCSTR introspectionXml)
static QStatus | CreateInterfaces (_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _In_ PCSTR introspectionXml)
template<class T >
static QStatus | CreateProducerSession (_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _Inout_ Platform::WeakReference *target)
template<class T >
static QStatus | CreateProducerSession (_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _Inout_ Platform::WeakReference *target)
static alljoyn_busattachment | GetInternalBusAttachment (_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
static alljoyn_busattachment | GetInternalBusAttachment (_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
static alljoyn_busobject | GetInternalBusObject (_In_ Windows::Devices::AllJoyn::AllJoynBusObject^busObject)
static alljoyn_busobject | GetInternalBusObject (_In_ Windows::Devices::AllJoyn::AllJoynBusObject^busObject)
static Platform::String | GetObjectPath (_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName)
static Platform::String | GetObjectPath (_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName)
static Platform::String | MultibyteToPlatformString (_In_ PCSTR)
static Platform::String | MultibyteToPlatformString (_In_ PCSTR)
static std::vector< char > | PlatformToMultibyteString (_In_ Platform::String^str)
static std::vector< char > | PlatformToMultibyteString (_In_ Platform::String^str)
template<class T >
static void AJ_CALL | PropertyChangedHandler (_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated, _In_ void *context)
template<class T >
static void AJ_CALL | PropertyChangedHandler (_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated, _In_ void *context)
template<class T >
static QStatus AJ_CALL | PropertyGetHandler (_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
template<class T >
static QStatus AJ_CALL | PropertyGetHandler (_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
template<class T >
static QStatus AJ_CALL | PropertySetHandler (_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
template<class T >
static QStatus AJ_CALL | PropertySetHandler (_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
template<class T >
static void AJ_CALL | SessionJoinedHandler (_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner)
template<class T >
static void AJ_CALL | SessionJoinedHandler (_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner)
template<class T >
static void AJ_CALL | SessionLostHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
template<class T >
static void AJ_CALL | SessionLostHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
template<class T >
static void AJ_CALL | SessionMemberAddedHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
template<class T >
static void AJ_CALL | SessionMemberAddedHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
template<class T >
static void AJ_CALL | SessionMemberRemovedHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
template<class T >
static void AJ_CALL | SessionMemberRemovedHandler (_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)

Detailed Description

Definition at line 55 of file AllJoynHelpers.h.

Member Function Documentation

static QCC_BOOL AJ_CALL AcceptSessionJoinerHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ PCSTR | joiner,
 |  | _In_ const alljoyn_sessionopts | opts |
 | ) |  |  | [inline, static]

Definition at line 160 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnAcceptSessionJoiner(sessionPort, joiner, opts);
    }

static QCC_BOOL AJ_CALL AcceptSessionJoinerHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ PCSTR | joiner,
 |  | _In_ const alljoyn_sessionopts | opts |
 | ) |  |  | [inline, static]

Definition at line 160 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnAcceptSessionJoiner(sessionPort, joiner, opts);
    }

bool CanSecure ( _In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^ authenticationMechanisms ) [static]

Definition at line 129 of file AllJoynHelpers.cpp.

{
    unsigned int noneMechanismIndex = 0;
    bool authenticationMechanismsContainsNone = false;

    // If there are no AuthenticationMechanisms, authentication
    // cannot be performed.
    if ((nullptr == authenticationMechanisms) || (authenticationMechanisms->Size == 0))
    {
        return false;
    }

    // If authenticationMechanisms contains one or more secure entries,
    // authentication can be performed.
    authenticationMechanismsContainsNone = authenticationMechanisms->IndexOf(AllJoynAuthenticationMechanism::None, &noneMechanismIndex);
    if (false == authenticationMechanismsContainsNone)
    {
        return true;
    }

    // If authenticationMechanisms contains any secure mechanisms,
    // authentication can be performed.
    for (auto authenticationMechanism : authenticationMechanisms)
    {
        if (authenticationMechanism != AllJoynAuthenticationMechanism::None)
        {
            return true;
        }
    }

    // If this point is reached, authentication cannot be performed
    // because no secure mechanisms are specified.
    return false;
}

static bool CanSecure ( _In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^ authenticationMechanisms ) [static]
static QStatus CreateBusObject ( _Inout_ Platform::WeakReference * target ) [inline, static]

Definition at line 133 of file AllJoynHelpers.h.

    {
        alljoyn_busobject_callbacks callbacks =
        {
            PropertyGetHandler<T>,
            PropertySetHandler<T>,
            nullptr,
            nullptr,
        };

        T^ caller = target->Resolve<T>();

        auto serviceObjectPath = PlatformToMultibyteString(caller->ServiceObjectPath);
        alljoyn_busobject busObject = alljoyn_busobject_create(serviceObjectPath.data(), false, &callbacks, target);
        if (busObject == nullptr)
        {
            return ER_FAIL;
        }

        caller->BusObject = busObject;

        return ER_OK;
    }

static QStatus CreateBusObject ( _Inout_ Platform::WeakReference * target ) [inline, static]

Definition at line 133 of file AllJoynHelpers.h.

    {
        alljoyn_busobject_callbacks callbacks =
        {
            PropertyGetHandler<T>,
            PropertySetHandler<T>,
            nullptr,
            nullptr,
        };

        T^ caller = target->Resolve<T>();

        auto serviceObjectPath = PlatformToMultibyteString(caller->ServiceObjectPath);
        alljoyn_busobject busObject = alljoyn_busobject_create(serviceObjectPath.data(), false, &callbacks, target);
        if (busObject == nullptr)
        {
            return ER_FAIL;
        }

        caller->BusObject = busObject;

        return ER_OK;
    }

static QStatus CreateInterfaces | ( | _Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment,
 |  | _In_ PCSTR | introspectionXml |
 | ) |  |  | [static]
static QStatus CreateInterfaces | ( | _Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment,
 |  | _In_ PCSTR | introspectionXml |
 | ) |  |  | [static]
static QStatus CreateProducerSession | ( | _Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment,
 |  | _Inout_ Platform::WeakReference * | target |
 | ) |  |  | [inline, static]

Definition at line 185 of file AllJoynHelpers.h.

    {
        alljoyn_sessionopts opts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, true, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY);

        alljoyn_sessionportlistener_callbacks callbacks =
        {
            AcceptSessionJoinerHandler<T>,
            SessionJoinedHandler<T>
        };

        T^ producer = target->Resolve<T>();
        producer->SessionPortListener = alljoyn_sessionportlistener_create(&callbacks, target);

        alljoyn_sessionport sessionPort = 42;
        alljoyn_busattachment_unbindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), sessionPort);
        RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_bindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), &sessionPort, opts, producer->SessionPortListener));
        producer->SessionPort = sessionPort;

        alljoyn_sessionopts_destroy(opts);

        return ER_OK;
    }

static QStatus CreateProducerSession | ( | _Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment,
 |  | _Inout_ Platform::WeakReference * | target |
 | ) |  |  | [inline, static]

Definition at line 185 of file AllJoynHelpers.h.

    {
        alljoyn_sessionopts opts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, true, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY);

        alljoyn_sessionportlistener_callbacks callbacks =
        {
            AcceptSessionJoinerHandler<T>,
            SessionJoinedHandler<T>
        };

        T^ producer = target->Resolve<T>();
        producer->SessionPortListener = alljoyn_sessionportlistener_create(&callbacks, target);

        alljoyn_sessionport sessionPort = 42;
        alljoyn_busattachment_unbindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), sessionPort);
        RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_bindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), &sessionPort, opts, producer->SessionPortListener));
        producer->SessionPort = sessionPort;

        alljoyn_sessionopts_destroy(opts);

        return ER_OK;
    }

static alljoyn_busattachment GetInternalBusAttachment ( _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment ) [static]
static alljoyn_busattachment GetInternalBusAttachment ( _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment ) [static]
static alljoyn_busobject GetInternalBusObject ( _In_ Windows::Devices::AllJoyn::AllJoynBusObject^ busObject ) [static]
static alljoyn_busobject GetInternalBusObject ( _In_ Windows::Devices::AllJoyn::AllJoynBusObject^ busObject ) [static]
static Platform::String GetObjectPath | ( | _In_ alljoyn_aboutobjectdescription | objectDescription,
 |  | _In_ PCSTR | interfaceName |
 | ) |  |  | [static]
Platform::String GetObjectPath | ( | _In_ alljoyn_aboutobjectdescription | objectDescription,
 |  | _In_ PCSTR | interfaceName |
 | ) |  |  | [static]

Definition at line 118 of file AllJoynHelpers.cpp.

{
    PCSTR path;
    if (alljoyn_aboutobjectdescription_getinterfacepaths(objectDescription, interfaceName, &path, 1) == 0)
    {
        return nullptr;
    }

    return AllJoynHelpers::MultibyteToPlatformString(path);
}

String MultibyteToPlatformString ( _In_ PCSTR str ) [static]

Definition at line 49 of file AllJoynHelpers.cpp.

{
    size_t length = strlen(str);

    UINT32 requiredBytes = MultiByteToWideChar(
        CP_UTF8,
        0,
        str,
        (int)length,
        nullptr,
        0);

    if (requiredBytes == 0)
    {
        return ref new String();
    }

    std::vector<wchar_t> buffer(requiredBytes + 1);

    UINT32 convertedBytes = MultiByteToWideChar(
        CP_UTF8,
        0,
        str,
        (int)length,
        (LPWSTR)&buffer[0],
        requiredBytes);

    buffer[convertedBytes] = '\0';
    return ref new String(&buffer[0]);
}

static Platform::String MultibyteToPlatformString ( _In_ PCSTR ) [static]
static std::vector<char> PlatformToMultibyteString ( _In_ Platform::String^ str ) [static]
static std::vector<char> PlatformToMultibyteString ( _In_ Platform::String^ str ) [static]
static void AJ_CALL PropertyChangedHandler | ( | _In_ alljoyn_proxybusobject | obj,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ const alljoyn_msgarg | changed,
 |  | _In_ const alljoyn_msgarg | invalidated,
 |  | _In_ void * | context |
 | ) |  |  | [inline, static]

Definition at line 85 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnPropertyChanged(obj, interfaceName, changed, invalidated);
    }

static void AJ_CALL PropertyChangedHandler | ( | _In_ alljoyn_proxybusobject | obj,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ const alljoyn_msgarg | changed,
 |  | _In_ const alljoyn_msgarg | invalidated,
 |  | _In_ void * | context |
 | ) |  |  | [inline, static]

Definition at line 85 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnPropertyChanged(obj, interfaceName, changed, invalidated);
    }

static QStatus AJ_CALL PropertyGetHandler | ( | _In_ const void * | context,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | value |
 | ) |  |  | [inline, static]

Definition at line 93 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnPropertyGet(interfaceName, propertyName, value);
    }

static QStatus AJ_CALL PropertyGetHandler | ( | _In_ const void * | context,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | value |
 | ) |  |  | [inline, static]

Definition at line 93 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnPropertyGet(interfaceName, propertyName, value);
    }

static QStatus AJ_CALL PropertySetHandler | ( | _In_ const void * | context,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | value |
 | ) |  |  | [inline, static]

Definition at line 101 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnPropertySet(interfaceName, propertyName, value);
    }

static QStatus AJ_CALL PropertySetHandler | ( | _In_ const void * | context,
 |  | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | value |
 | ) |  |  | [inline, static]

Definition at line 101 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        return caller->OnPropertySet(interfaceName, propertyName, value);
    }

static void AJ_CALL SessionJoinedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ alljoyn_sessionid | id,
 |  | _In_ PCSTR | joiner |
 | ) |  |  | [inline, static]

Definition at line 173 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionJoined(sessionPort, id, joiner);
    }

static void AJ_CALL SessionJoinedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ alljoyn_sessionid | id,
 |  | _In_ PCSTR | joiner |
 | ) |  |  | [inline, static]

Definition at line 173 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionJoined(sessionPort, id, joiner);
    }

static void AJ_CALL SessionLostHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ alljoyn_sessionlostreason | reason |
 | ) |  |  | [inline, static]

Definition at line 109 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionLost(sessionId, reason);
    }

static void AJ_CALL SessionLostHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ alljoyn_sessionlostreason | reason |
 | ) |  |  | [inline, static]

Definition at line 109 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionLost(sessionId, reason);
    }

static void AJ_CALL SessionMemberAddedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName |
 | ) |  |  | [inline, static]

Definition at line 117 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionMemberAdded(sessionId, uniqueName);
    }

static void AJ_CALL SessionMemberAddedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName |
 | ) |  |  | [inline, static]

Definition at line 117 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionMemberAdded(sessionId, uniqueName);
    }

static void AJ_CALL SessionMemberRemovedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName |
 | ) |  |  | [inline, static]

Definition at line 125 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionMemberRemoved(sessionId, uniqueName);
    }

static void AJ_CALL SessionMemberRemovedHandler | ( | _In_ const void * | context,
 |  | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName |
 | ) |  |  | [inline, static]

Definition at line 125 of file AllJoynHelpers.h.

    {
        T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
        caller->OnSessionMemberRemoved(sessionId, uniqueName);
    }

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h
  • AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h
  • AllJoyn/shared/AllJoynHelpers.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • AppData
Public Attributes | Properties | Events | Private Attributes | Static Private Attributes

AppData Class Reference

List of all members.

Public Attributes

const string | SampleNetworkPassword = "SamplePassword"

Properties

static bool | IsUpperCaseEnabled [get, set]
static short | LastErrorCode [get, set]
static string | LastErrorMessage [get, set]
static short | OnboardingConfigurationState [get, set]
static short | OnboardingConfigureAuthType [get, set]
static string | OnboardingConfigurePassphrase [get, set]
static string | OnboardingConfigureSsid [get, set]
static List
< OnboardingScanListItem > 		SampleNetworkScanList [get]

Events

static EventHandler | IsUpperCaseEnabledPropertyDataChanged

Private Attributes

const string | isUpperCaseEnabledPropertyKey = "IsUpperCaseEnabled"
const string | onboardingConfigurationStateKey = "OnboardingConfigurationState"
const string | onboardingConfigureAuthenticationTypeKey = "OnboardingConfigureAuthenticationType"
const string | onboardingConfigurePassphraseKey = "OnboardingConfigurePassphrase"
const string | onboardingConfigureSsidKey = "OnboardingConfigureSsid"
const string | onboardingLastErrorCodeKey = "OnboardingLastErrorCode"
const string | onboardingLastErrorMessageKey = "OnboardingLastErrorMessage"

Static Private Attributes

static ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings

Detailed Description

Definition at line 19 of file AppData.cs.

Member Data Documentation

const string isUpperCaseEnabledPropertyKey = "IsUpperCaseEnabled" [private]

Definition at line 21 of file AppData.cs.

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [static, private]

Definition at line 28 of file AppData.cs.

const string onboardingConfigurationStateKey = "OnboardingConfigurationState" [private]

Definition at line 25 of file AppData.cs.

const string onboardingConfigureAuthenticationTypeKey = "OnboardingConfigureAuthenticationType" [private]

Definition at line 24 of file AppData.cs.

const string onboardingConfigurePassphraseKey = "OnboardingConfigurePassphrase" [private]

Definition at line 23 of file AppData.cs.

const string onboardingConfigureSsidKey = "OnboardingConfigureSsid" [private]

Definition at line 22 of file AppData.cs.

const string onboardingLastErrorCodeKey = "OnboardingLastErrorCode" [private]

Definition at line 26 of file AppData.cs.

const string onboardingLastErrorMessageKey = "OnboardingLastErrorMessage" [private]

Definition at line 27 of file AppData.cs.

const string SampleNetworkPassword = "SamplePassword"

Definition at line 214 of file AppData.cs.

Property Documentation

bool IsUpperCaseEnabled [static, get, set]

Definition at line 33 of file AppData.cs.

short LastErrorCode [static, get, set]

Definition at line 130 of file AppData.cs.

string LastErrorMessage [static, get, set]

Definition at line 149 of file AppData.cs.

short OnboardingConfigurationState [static, get, set]

Definition at line 114 of file AppData.cs.

short OnboardingConfigureAuthType [static, get, set]

Definition at line 95 of file AppData.cs.

string OnboardingConfigurePassphrase [static, get, set]

Definition at line 76 of file AppData.cs.

string OnboardingConfigureSsid [static, get, set]

Definition at line 57 of file AppData.cs.

List<OnboardingScanListItem> SampleNetworkScanList [static, get]

Definition at line 168 of file AppData.cs.

Event Documentation

EventHandler IsUpperCaseEnabledPropertyDataChanged [static]

Definition at line 30 of file AppData.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/AppData.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnboardingService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • OnboardingService
Events | Private Member Functions

OnboardingService Class Reference

Inherits org::alljoyn::Onboarding::IOnboardingService.

List of all members.

Events

static EventHandler ConnectRequestRecieved

Private Member Functions

IAsyncOperation
< OnboardingConfigureWiFiResult >
IOnboardingService. 		ConfigureWiFiAsync (AllJoynMessageInfo info, string interfaceMemberSsid, string interfaceMemberPassphrase, short interfaceMemberAuthType)
IAsyncOperation
< OnboardingConnectResult >
IOnboardingService. 		ConnectAsync (AllJoynMessageInfo info)
IAsyncOperation
< OnboardingGetLastErrorResult >
IOnboardingService. 		GetLastErrorAsync (AllJoynMessageInfo info)
IAsyncOperation
< OnboardingGetScanInfoResult >
IOnboardingService. 		GetScanInfoAsync (AllJoynMessageInfo info)
IAsyncOperation
< OnboardingGetStateResult >
IOnboardingService. 		GetStateAsync (AllJoynMessageInfo info)
IAsyncOperation
< OnboardingGetVersionResult >
IOnboardingService. 		GetVersionAsync (AllJoynMessageInfo info)
IAsyncOperation
< OnboardingOffboardResult >
IOnboardingService. 		OffboardAsync (AllJoynMessageInfo info)

Detailed Description

Definition at line 21 of file OnboardingService.cs.

Member Function Documentation

IAsyncOperation<OnboardingConfigureWiFiResult> IOnboardingService. ConfigureWiFiAsync | ( | AllJoynMessageInfo | info,
 |  | string | interfaceMemberSsid,
 |  | string | interfaceMemberPassphrase,
 |  | short | interfaceMemberAuthType |
 | ) |  |  | [inline, private]

Definition at line 26 of file OnboardingService.cs.

        {
            IAsyncAction asyncAction = MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser("Configure WiFi request received", NotifyType.StatusMessage);
            });

            Task<OnboardingConfigureWiFiResult> task = new Task<OnboardingConfigureWiFiResult>(() =>
            {
                AppData.OnboardingConfigureSsid = interfaceMemberSsid;
                AppData.OnboardingConfigurePassphrase = interfaceMemberPassphrase;
                AppData.OnboardingConfigureAuthType = interfaceMemberAuthType;
                AppData.OnboardingConfigurationState = (short)ConfigurationState.NotValidated;
                return OnboardingConfigureWiFiResult.CreateSuccessResult((short)ConfigureWiFiResultStatus.Concurrent);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingConnectResult> IOnboardingService. ConnectAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 47 of file OnboardingService.cs.

        {
            Task<OnboardingConnectResult> task = new Task<OnboardingConnectResult>(() =>
            {
                EventHandler handler = ConnectRequestRecieved;
                if (handler != null)
                {
                    handler(new object(), new EventArgs());
                }

                return OnboardingConnectResult.CreateSuccessResult();
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingGetLastErrorResult> IOnboardingService. GetLastErrorAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 117 of file OnboardingService.cs.

        {
            Task<OnboardingGetLastErrorResult> task = new Task<OnboardingGetLastErrorResult>(() =>
            {
                OnboardingLastError lastError = new OnboardingLastError();
                lastError.Value1 = AppData.LastErrorCode;
                lastError.Value2 = AppData.LastErrorMessage;
                return OnboardingGetLastErrorResult.CreateSuccessResult(lastError);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingGetScanInfoResult> IOnboardingService. GetScanInfoAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 81 of file OnboardingService.cs.

        {
            Task<OnboardingGetScanInfoResult> task = new Task<OnboardingGetScanInfoResult>(() =>
            {
                return OnboardingGetScanInfoResult.CreateSuccessResult(1, AppData.SampleNetworkScanList);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingGetStateResult> IOnboardingService. GetStateAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 105 of file OnboardingService.cs.

        {
            Task<OnboardingGetStateResult> task = new Task<OnboardingGetStateResult>(() =>
            {
                return OnboardingGetStateResult.CreateSuccessResult(AppData.OnboardingConfigurationState);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingGetVersionResult> IOnboardingService. GetVersionAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 93 of file OnboardingService.cs.

        {
            Task<OnboardingGetVersionResult> task = new Task<OnboardingGetVersionResult>(() =>
            {
                return OnboardingGetVersionResult.CreateSuccessResult(1);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<OnboardingOffboardResult> IOnboardingService. OffboardAsync ( AllJoynMessageInfo info ) [inline, private]

Definition at line 65 of file OnboardingService.cs.

        {
            Task<OnboardingOffboardResult> task = new Task<OnboardingOffboardResult>(() =>
            {
                AppData.OnboardingConfigureSsid = null;
                AppData.OnboardingConfigurePassphrase = null;
                AppData.OnboardingConfigureAuthType = (short)OnboardingAuthenticationType.Any;
                AppData.OnboardingConfigurationState = (short)ConfigurationState.NotConfigured;
                return OnboardingOffboardResult.CreateSuccessResult();
            });

            task.Start();
            return task.AsAsyncOperation();
        }

Event Documentation

EventHandler ConnectRequestRecieved [static]

Definition at line 23 of file OnboardingService.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/OnboardingService.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelayCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • RelayCommand
Public Member Functions | Properties | Private Attributes

RelayCommand Class Reference

Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates.

List of all members.

Public Member Functions

RelayCommand (Action< object > execute)
RelayCommand (Action< object > execute, Predicate< object > canExecute)
bool | CanExecute (object parameter)
void | Execute (object parameter)

Properties

EventHandler | CanExecuteChanged

Private Attributes

readonly Predicate< object > | canExecute
readonly Action< object > | execute

Detailed Description

Definition at line 20 of file RelayCommand.cs.

Constructor & Destructor Documentation

RelayCommand ( Action< object > execute ) [inline]

Definition at line 25 of file RelayCommand.cs.

            : this(execute, null)
        {
        }

RelayCommand | ( | Action< object > | execute,
 |  | Predicate< object > | canExecute |
 | ) |  |  | [inline]

Definition at line 36 of file RelayCommand.cs.

        {
            if (execute == null)
            {
                throw new ArgumentNullException("execute");
            }
            this.execute = execute;
            this.canExecute = canExecute;
        }

Member Function Documentation

bool CanExecute ( object parameter ) [inline]

Definition at line 46 of file RelayCommand.cs.

        {
            return canExecute == null ? true : canExecute(parameter);
        }

void Execute ( object parameter ) [inline]

Definition at line 51 of file RelayCommand.cs.

        {
            execute(parameter);
        }

Member Data Documentation

readonly Predicate<object> canExecute [private]

Definition at line 23 of file RelayCommand.cs.

readonly Action<object> execute [private]

Definition at line 22 of file RelayCommand.cs.

Property Documentation

EventHandler CanExecuteChanged [add, remove]

Definition at line 31 of file RelayCommand.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/RelayCommand.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • Scenario1
Public Member Functions | Protected Member Functions | Private Attributes

Scenario1 Class Reference

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Attributes

Scenario1ViewModel | m_scenario1ViewModel = null

Detailed Description

Definition at line 17 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 21 of file Scenario1.xaml.cs.

        {
            InitializeComponent();
            m_scenario1ViewModel = new Scenario1ViewModel();
            DataContext = m_scenario1ViewModel;
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario1.xaml.cs.

        {
            if (m_scenario1ViewModel != null)
            {
                m_scenario1ViewModel.ScenarioCleanup();
            }
        }

Member Data Documentation

Scenario1ViewModel m_scenario1ViewModel = null [private]

Definition at line 19 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1ViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • Scenario1ViewModel
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

Scenario1ViewModel Class Reference

List of all members.

Public Member Functions

Scenario1ViewModel ()
void | ScenarioCleanup ()

Protected Member Functions

async void | RaisePropertyChangedEventAsync ([CallerMemberName] string name="")

Properties

bool | IsUpperCaseEnabled [get, set]
string | Key [get, set]
ICommand | LaunchProducer [get]
Visibility | ProducerOptionsVisibility [get, set]
ICommand | SendSignal [get]
string | SignalText [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | AlljoynBusAttachment_AuthenticationComplete (AllJoynBusAttachment sender, AllJoynAuthenticationCompleteEventArgs args)
void | AlljoynBusAttachment_CredentialsRequested (AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
void | AlljoynBusAttachment_StateChanged (AllJoynBusAttachment sender, AllJoynBusAttachmentStateChangedEventArgs args)
void | AppData_IsUpperCaseEnabledPropertyDataChanged (object sender, EventArgs e)
void | SendTextSignal ()
void | Start ()
async void | UpdateStatusAsync (string status, NotifyType statusType)

Private Attributes

AllJoynBusAttachment | m_busAttachment = null
CoreDispatcher | m_dispatcher
bool | m_isBusAttachmentConnected = false
string | m_key = ""
SecureInterfaceProducer | m_producer = null
Visibility | m_producerOptionsVisibility = Visibility.Collapsed
MainPage rootPage

Detailed Description

Definition at line 24 of file Scenario1ViewModel.cs.

Constructor & Destructor Documentation

Scenario1ViewModel ( ) [inline]

Definition at line 34 of file Scenario1ViewModel.cs.

        {
            m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            rootPage = MainPage.Current;
        }

Member Function Documentation

void AlljoynBusAttachment_AuthenticationComplete | ( | AllJoynBusAttachment | sender,
 |  | AllJoynAuthenticationCompleteEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 209 of file Scenario1ViewModel.cs.

        {
            if (args.Succeeded)
            {
                UpdateStatusAsync("Authentication was successful.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
            }
        }

void AlljoynBusAttachment_CredentialsRequested | ( | AllJoynBusAttachment | sender,
 |  | AllJoynCredentialsRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 221 of file Scenario1ViewModel.cs.

        {
            if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke)
            {
                args.Credentials.PasswordCredential.Password = m_key;
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }
        }

void AlljoynBusAttachment_StateChanged | ( | AllJoynBusAttachment | sender,
 |  | AllJoynBusAttachmentStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 188 of file Scenario1ViewModel.cs.

        {
            switch (args.State)
            {
                case AllJoynBusAttachmentState.Disconnected:
                    UpdateStatusAsync(string.Format("Disconnected from the AllJoyn bus attachment with AllJoyn status: 0x{0:X}.", args.Status), NotifyType.StatusMessage);
                    m_isBusAttachmentConnected = false;
                    ProducerOptionsVisibility = Visibility.Collapsed;
                    AppData.IsUpperCaseEnabledPropertyDataChanged -= AppData_IsUpperCaseEnabledPropertyDataChanged;
                    break;
                case AllJoynBusAttachmentState.Connected:
                    UpdateStatusAsync("Launched.", NotifyType.StatusMessage);
                    m_isBusAttachmentConnected = true;
                    ProducerOptionsVisibility = Visibility.Visible;
                    AppData.IsUpperCaseEnabledPropertyDataChanged += AppData_IsUpperCaseEnabledPropertyDataChanged;
                    break;
                default:
                    break;
            }
        }

void AppData_IsUpperCaseEnabledPropertyDataChanged | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 233 of file Scenario1ViewModel.cs.

        {
            RaisePropertyChangedEventAsync("IsUpperCaseEnabled");
        }

async void RaisePropertyChangedEventAsync ( [CallerMemberName] string name = "" ) [inline, protected]

Definition at line 125 of file Scenario1ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            });
        }

void ScenarioCleanup ( ) [inline]

Definition at line 108 of file Scenario1ViewModel.cs.

        {
            if (m_producer != null)
            {
                m_producer.Stop();
                m_producer.Dispose();
            }

            if (m_busAttachment != null)
            {
                m_busAttachment.CredentialsRequested -= AlljoynBusAttachment_CredentialsRequested;
                m_busAttachment.AuthenticationComplete -= AlljoynBusAttachment_AuthenticationComplete;
                m_busAttachment.StateChanged -= AlljoynBusAttachment_StateChanged;
                m_busAttachment.Disconnect();
            }
        }

void SendTextSignal ( ) [inline, private]

Definition at line 172 of file Scenario1ViewModel.cs.

        {
            if (m_producer != null)
            {
                if (!string.IsNullOrWhiteSpace(SignalText))
                {
                    m_producer.Signals.TextSent(SignalText);
                    UpdateStatusAsync("Signal sent.", NotifyType.StatusMessage);
                }
                else
                {
                    UpdateStatusAsync("No text entered.", NotifyType.ErrorMessage);
                }
            }
        }

void Start ( ) [inline, private]

Definition at line 133 of file Scenario1ViewModel.cs.

        {
            // Prevent launching the producer again if it is already launched.
            if (m_isBusAttachmentConnected)
            {
                UpdateStatusAsync("Already launched.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Launching...", NotifyType.StatusMessage);

                m_busAttachment = new AllJoynBusAttachment();
                m_busAttachment.StateChanged += AlljoynBusAttachment_StateChanged;
                m_busAttachment.AuthenticationMechanisms.Clear();
                m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheSpeke);
                m_busAttachment.AuthenticationComplete += AlljoynBusAttachment_AuthenticationComplete;
                m_busAttachment.CredentialsRequested += AlljoynBusAttachment_CredentialsRequested;

                // Optional - Populate About data for the producer.
                m_busAttachment.AboutData.DefaultManufacturer = "Contoso";
                m_busAttachment.AboutData.SupportUrl = new Uri("http://www.contoso.com/support");
                m_busAttachment.AboutData.ModelNumber = "ContosoTestModel";
                m_busAttachment.AboutData.DefaultDescription = "A secure AllJoyn sample";

                // Generate the one-time 6-digit numeric pre-shared key.
                Random rnd = new Random();
                Key = rnd.Next(100000, 1000000).ToString();

                // Initialize the producer object generated by the AllJoynCodeGenerator tool.
                m_producer = new SecureInterfaceProducer(m_busAttachment);

                // Instantiate SecureInterfaceService which will handle the concatenation method calls.
                m_producer.Service = new SecureInterfaceService();

                // Start advertising the service.
                m_producer.Start();
            }
        }

async void UpdateStatusAsync | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 238 of file Scenario1ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(status, statusType);
            });
        }

Member Data Documentation

AllJoynBusAttachment m_busAttachment = null [private]

Definition at line 30 of file Scenario1ViewModel.cs.

CoreDispatcher m_dispatcher [private]

Definition at line 27 of file Scenario1ViewModel.cs.

bool m_isBusAttachmentConnected = false [private]

Definition at line 29 of file Scenario1ViewModel.cs.

string m_key = "" [private]

Definition at line 28 of file Scenario1ViewModel.cs.

SecureInterfaceProducer m_producer = null [private]

Definition at line 31 of file Scenario1ViewModel.cs.

Visibility m_producerOptionsVisibility = Visibility.Collapsed [private]

Definition at line 32 of file Scenario1ViewModel.cs.

MainPage rootPage [private]

Definition at line 26 of file Scenario1ViewModel.cs.

Property Documentation

bool IsUpperCaseEnabled [get, set]

Definition at line 56 of file Scenario1ViewModel.cs.

string Key [get, set]

Definition at line 43 of file Scenario1ViewModel.cs.

ICommand LaunchProducer [get]

Definition at line 87 of file Scenario1ViewModel.cs.

Visibility ProducerOptionsVisibility [get, set]

Definition at line 74 of file Scenario1ViewModel.cs.

ICommand SendSignal [get]

Definition at line 98 of file Scenario1ViewModel.cs.

string SignalText [get, set]

Definition at line 71 of file Scenario1ViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 40 of file Scenario1ViewModel.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/Scenario1ViewModel.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • Scenario2
Public Member Functions | Protected Member Functions | Private Attributes

Scenario2 Class Reference

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Attributes

Scenario2ViewModel | m_scenario2ViewModel = null

Detailed Description

Definition at line 17 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 21 of file Scenario2.xaml.cs.

        {
            InitializeComponent();
            m_scenario2ViewModel = new Scenario2ViewModel();
            DataContext = m_scenario2ViewModel;
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario2.xaml.cs.

        {
            if (m_scenario2ViewModel != null)
            {
                m_scenario2ViewModel.ScenarioCleanup();
            }
        }

Member Data Documentation

Scenario2ViewModel m_scenario2ViewModel = null [private]

Definition at line 19 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2ViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • Scenario2ViewModel
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario2ViewModel Class Reference

List of all members.

Public Member Functions

Scenario2ViewModel ()
void | ScenarioCleanup ()

Protected Member Functions

async void | RaisePropertyChangedEventAsync ([CallerMemberName]string name="")

Properties

string | Key [get, set]
ICommand | LaunchProducer [get]
Visibility | SampleNetworkInfoVisibility [get, set]
List< OnboardingScanListItem > | SampleNetworkList [get]
OnboardingScanListItem | SelectedSampleNetwork [get, set]
string | SelectedSampleNetworkAuthentication [get]
string | SelectedSampleNetworkPassword [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | AlljoynBusAttachment_AuthenticationComplete (AllJoynBusAttachment sender, AllJoynAuthenticationCompleteEventArgs args)
void | AlljoynBusAttachment_CredentialsRequested (AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
void | AlljoynBusAttachment_StateChanged (AllJoynBusAttachment sender, AllJoynBusAttachmentStateChangedEventArgs args)
async void | OnboardingService_ConnectRequestRecieved (object sender, EventArgs e)
void | Start ()
async void | UpdateStatusAsync (string status, NotifyType statusType)

Static Private Member Functions

static string | ConvertUtf8ToHex (string inputString)

Private Attributes

AllJoynBusAttachment | m_busAttachment = null
CoreDispatcher | m_dispatcher
bool | m_isBusAttachmentConnected = false
string | m_key = ""
OnboardingProducer | m_producer = null
MainPage m_rootPage
Visibility | m_sampleNetworkInfoVisibility = Visibility.Collapsed
OnboardingScanListItem | m_selectedSampleNetwork

Detailed Description

Definition at line 27 of file Scenario2ViewModel.cs.

Constructor & Destructor Documentation

Scenario2ViewModel ( ) [inline]

Definition at line 38 of file Scenario2ViewModel.cs.

        {
            m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            m_rootPage = MainPage.Current;
        }

Member Function Documentation

void AlljoynBusAttachment_AuthenticationComplete | ( | AllJoynBusAttachment | sender,
 |  | AllJoynAuthenticationCompleteEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 222 of file Scenario2ViewModel.cs.

        {
            if (args.Succeeded)
            {
                UpdateStatusAsync("Authentication was successful.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
            }
        }

void AlljoynBusAttachment_CredentialsRequested | ( | AllJoynBusAttachment | sender,
 |  | AllJoynCredentialsRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 234 of file Scenario2ViewModel.cs.

        {
            if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke)
            {
                args.Credentials.PasswordCredential.Password = m_key;
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }
        }

void AlljoynBusAttachment_StateChanged | ( | AllJoynBusAttachment | sender,
 |  | AllJoynBusAttachmentStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 203 of file Scenario2ViewModel.cs.

        {
            switch (args.State)
            {
                case AllJoynBusAttachmentState.Disconnected:
                    UpdateStatusAsync(string.Format("Disconnected from the AllJoyn bus attachment with AllJoyn status: 0x{0:X}.", args.Status), NotifyType.StatusMessage);
                    m_isBusAttachmentConnected = false;
                    SampleNetworkInfoVisibility = Visibility.Collapsed;
                    break;
                case AllJoynBusAttachmentState.Connected:
                    UpdateStatusAsync("Launched.", NotifyType.StatusMessage);
                    m_isBusAttachmentConnected = true;
                    SampleNetworkInfoVisibility = Visibility.Visible;
                    break;
                default:
                    break;
            }
        }

static string ConvertUtf8ToHex ( string inputString ) [inline, static, private]

Definition at line 355 of file Scenario2ViewModel.cs.

        {
            if (string.IsNullOrEmpty(inputString))
            {
                return string.Empty;
            }
            else
            {
                var tempBuffer = CryptographicBuffer.ConvertStringToBinary(inputString, BinaryStringEncoding.Utf8);
                var hexString = CryptographicBuffer.EncodeToHexString(tempBuffer);
                return hexString;
            }
        }

async void OnboardingService_ConnectRequestRecieved | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 246 of file Scenario2ViewModel.cs.

        {
            UpdateStatusAsync("Connect Request received. Attempting to connect...", NotifyType.StatusMessage);
            AppData.OnboardingConfigurationState = (short)ConfigurationState.Validating;

            // 5 second delay to simulate connection attempt time.
            await Task.Delay(TimeSpan.FromSeconds(5));
            Onboarding returnArg = new Onboarding();

            if (string.IsNullOrWhiteSpace(AppData.OnboardingConfigureSsid))
            {
                returnArg.Value1 = (short)ConnectionResultCode.ErrorMessage;
                returnArg.Value2 = "Invalid SSID";
                AppData.OnboardingConfigurationState = (short)ConfigurationState.Error;
            }
            else
            {
                bool foundSsid = false;
                bool supportedProtocol = false;

                foreach (OnboardingScanListItem item in AppData.SampleNetworkScanList)
                {
                    if (item.Value1.Equals(AppData.OnboardingConfigureSsid))
                    {
                        foundSsid = true;
                        if (AppData.OnboardingConfigureAuthType == (short)OnboardingAuthenticationType.Any)
                        {
                            supportedProtocol = true;
                        }
                        else if (AppData.OnboardingConfigureAuthType == (short)OnboardingAuthenticationType.WpaAuto)
                        {
                            if ((item.Value2 == (short)OnboardingAuthenticationType.WpaTkip) || (item.Value2 == (short)OnboardingAuthenticationType.WpaCcmp))
                            {
                                supportedProtocol = true;
                            }
                        }
                        else if (AppData.OnboardingConfigureAuthType == (short)OnboardingAuthenticationType.Wpa2Auto)
                        {
                            if ((item.Value2 == (short)OnboardingAuthenticationType.Wpa2Tkip) || (item.Value2 == (short)OnboardingAuthenticationType.Wpa2Ccmp))
                            {
                                supportedProtocol = true;
                            }
                        }
                        else
                        {
                            if (item.Value2 == AppData.OnboardingConfigureAuthType)
                            {
                                supportedProtocol = true;
                            }
                        }
                        break;
                    }
                }

                if (foundSsid)
                {
                    if (supportedProtocol)
                    {
                        if (AppData.OnboardingConfigureAuthType == (short)OnboardingAuthenticationType.Open)
                        {
                            returnArg.Value1 = (short)ConnectionResultCode.Validated;
                            returnArg.Value2 = "Connected successfully";
                            AppData.OnboardingConfigurationState = (short)ConfigurationState.Validated;
                        }
                        else
                        {
                            if (AppData.OnboardingConfigurePassphrase.Equals(ConvertUtf8ToHex(AppData.SampleNetworkPassword), StringComparison.OrdinalIgnoreCase))
                            {
                                returnArg.Value1 = (short)ConnectionResultCode.Validated;
                                returnArg.Value2 = "Connected successfully";
                                AppData.OnboardingConfigurationState = (short)ConfigurationState.Validated;
                            }
                            else
                            {
                                returnArg.Value1 = (short)ConnectionResultCode.Unauthorized;
                                returnArg.Value2 = "Invalid password";
                                AppData.OnboardingConfigurationState = (short)ConfigurationState.Error;
                            }
                        }
                    }
                    else
                    {
                        returnArg.Value1 = (short)ConnectionResultCode.UnsupportedProtocol;
                        returnArg.Value2 = "Unsupported authentication mechanism";
                        AppData.OnboardingConfigurationState = (short)ConfigurationState.Error;
                    }
                }
                else
                {
                    returnArg.Value1 = (short)ConnectionResultCode.Unreachable;
                    returnArg.Value2 = "Configured SSID unreachable";
                    AppData.OnboardingConfigurationState = (short)ConfigurationState.Error;
                }
            }

            m_producer.Signals.ConnectionResult(returnArg);
            AppData.LastErrorCode = returnArg.Value1;
            AppData.LastErrorMessage = returnArg.Value2;

            if (returnArg.Value1 == (short)ConnectionResultCode.Validated)
            {
                UpdateStatusAsync("Onboarding successful. Connected to " + AppData.OnboardingConfigureSsid, NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync(string.Format("Onboarding Failed. Attempt to connect failed with result code: {0} and message: {1}.", ((ConnectionResultCode)returnArg.Value1).ToString(), returnArg.Value2), NotifyType.ErrorMessage);
            }
        }

async void RaisePropertyChangedEventAsync ( [CallerMemberName] string name = "" ) [inline, protected]

Definition at line 161 of file Scenario2ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            });
        }

void ScenarioCleanup ( ) [inline]

Definition at line 142 of file Scenario2ViewModel.cs.

        {
            OnboardingService.ConnectRequestRecieved -= OnboardingService_ConnectRequestRecieved;

            if (m_producer != null)
            {
                m_producer.Stop();
                m_producer.Dispose();
            }

            if (m_busAttachment != null)
            {
                m_busAttachment.CredentialsRequested -= AlljoynBusAttachment_CredentialsRequested;
                m_busAttachment.AuthenticationComplete -= AlljoynBusAttachment_AuthenticationComplete;
                m_busAttachment.StateChanged -= AlljoynBusAttachment_StateChanged;
                m_busAttachment.Disconnect();
            }
        }

void Start ( ) [inline, private]

Definition at line 169 of file Scenario2ViewModel.cs.

        {
            // Prevent launching the producer again if it is already launched.
            if (m_isBusAttachmentConnected)
            {
                UpdateStatusAsync("Already launched.", NotifyType.StatusMessage);
            }
            else
            {
                UpdateStatusAsync("Launching...", NotifyType.StatusMessage);

                m_busAttachment = new AllJoynBusAttachment();
                m_busAttachment.StateChanged += AlljoynBusAttachment_StateChanged;
                m_busAttachment.AuthenticationMechanisms.Clear();
                m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheSpeke);
                m_busAttachment.AuthenticationComplete += AlljoynBusAttachment_AuthenticationComplete;
                m_busAttachment.CredentialsRequested += AlljoynBusAttachment_CredentialsRequested;

                // Generate the one-time 6-digit numeric pre-shared key.
                Random rnd = new Random();
                Key = rnd.Next(100000, 1000000).ToString();

                // Initialize the producer object generated by the AllJoynCodeGenerator tool.
                m_producer = new OnboardingProducer(m_busAttachment);

                // Instantiate OnboardingService which will handle the onboarding method calls.
                m_producer.Service = new OnboardingService();
                OnboardingService.ConnectRequestRecieved += OnboardingService_ConnectRequestRecieved;

                // Start listening for consumers.
                m_producer.Start();
            }
        }

async void UpdateStatusAsync | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 369 of file Scenario2ViewModel.cs.

        {
            await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_rootPage.NotifyUser(status, statusType);
            });
        }

Member Data Documentation

AllJoynBusAttachment m_busAttachment = null [private]

Definition at line 32 of file Scenario2ViewModel.cs.

CoreDispatcher m_dispatcher [private]

Definition at line 30 of file Scenario2ViewModel.cs.

bool m_isBusAttachmentConnected = false [private]

Definition at line 31 of file Scenario2ViewModel.cs.

string m_key = "" [private]

Definition at line 36 of file Scenario2ViewModel.cs.

OnboardingProducer m_producer = null [private]

Definition at line 33 of file Scenario2ViewModel.cs.

MainPage m_rootPage [private]

Definition at line 29 of file Scenario2ViewModel.cs.

Visibility m_sampleNetworkInfoVisibility = Visibility.Collapsed [private]

Definition at line 35 of file Scenario2ViewModel.cs.

OnboardingScanListItem m_selectedSampleNetwork [private]

Definition at line 34 of file Scenario2ViewModel.cs.

Property Documentation

string Key [get, set]

Definition at line 47 of file Scenario2ViewModel.cs.

ICommand LaunchProducer [get]

Definition at line 132 of file Scenario2ViewModel.cs.

Visibility SampleNetworkInfoVisibility [get, set]

Definition at line 119 of file Scenario2ViewModel.cs.

List<OnboardingScanListItem> SampleNetworkList [get]

Definition at line 60 of file Scenario2ViewModel.cs.

OnboardingScanListItem SelectedSampleNetwork [get, set]

Definition at line 68 of file Scenario2ViewModel.cs.

string SelectedSampleNetworkAuthentication [get]

Definition at line 104 of file Scenario2ViewModel.cs.

string SelectedSampleNetworkPassword [get]

Definition at line 82 of file Scenario2ViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 44 of file Scenario2ViewModel.cs.

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/Scenario2ViewModel.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecureInterfaceService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AllJoynProducerExperiences
  • SecureInterfaceService
Public Member Functions

SecureInterfaceService Class Reference

The implementation of ISecureInterfaceService that will handle the concatenation method calls.

Inherits com::microsoft::Samples::SecureInterface::ISecureInterfaceService.

List of all members.

Public Member Functions

IAsyncOperation
< SecureInterfaceConcatenateResult > 		ConcatenateAsync (AllJoynMessageInfo info, string inStr1, string inStr2)
IAsyncOperation
< SecureInterfaceGetIsUpperCaseEnabledResult > 		GetIsUpperCaseEnabledAsync (AllJoynMessageInfo info)
IAsyncOperation
< SecureInterfaceSetIsUpperCaseEnabledResult > 		SetIsUpperCaseEnabledAsync (AllJoynMessageInfo info, bool value)

Detailed Description

Definition at line 24 of file SecureInterfaceService.cs.

Member Function Documentation

IAsyncOperation<SecureInterfaceConcatenateResult> ConcatenateAsync | ( | AllJoynMessageInfo | info,
 |  | string | inStr1,
 |  | string | inStr2 |
 | ) |  |  | [inline]

Definition at line 27 of file SecureInterfaceService.cs.

        {
            IAsyncAction asyncAction = MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser(string.Format("Concatenation request recieved for \"{0}\" and \"{1}\".", inStr1, inStr2), NotifyType.StatusMessage);
            });

            Task<SecureInterfaceConcatenateResult> task = new Task<SecureInterfaceConcatenateResult>(() =>
            {
                if (AppData.IsUpperCaseEnabled)
                {
                    inStr1 = inStr1.ToUpper();
                    inStr2 = inStr2.ToUpper();
                }
                return SecureInterfaceConcatenateResult.CreateSuccessResult(inStr1 + inStr2);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult> GetIsUpperCaseEnabledAsync ( AllJoynMessageInfo info ) [inline]

Definition at line 49 of file SecureInterfaceService.cs.

        {
            Task<SecureInterfaceGetIsUpperCaseEnabledResult> task = new Task<SecureInterfaceGetIsUpperCaseEnabledResult>(() =>
            {
                return SecureInterfaceGetIsUpperCaseEnabledResult.CreateSuccessResult(AppData.IsUpperCaseEnabled);
            });

            task.Start();
            return task.AsAsyncOperation();
        }

IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult> SetIsUpperCaseEnabledAsync | ( | AllJoynMessageInfo | info,
 |  | bool | value |
 | ) |  |  | [inline]

Definition at line 61 of file SecureInterfaceService.cs.

        {
            Task<SecureInterfaceSetIsUpperCaseEnabledResult> task = new Task<SecureInterfaceSetIsUpperCaseEnabledResult>(() =>
            {
                AppData.IsUpperCaseEnabled = value;
                return SecureInterfaceSetIsUpperCaseEnabledResult.CreateSuccessResult();
            });

            task.Start();
            return task.AsAsyncOperation();
        }

The documentation for this class was generated from the following file:
  • AllJoyn/ProducerExperiences/cs/SecureInterfaceService.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Animate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Attributes

Animate Class Reference

#include "Animate.h"

Inherited by AnimateCirclePosition, AnimateLineListPosition, and AnimateLinePosition.

List of all members.

Public Member Functions

Animate ()
bool | Continuous ()
void | Continuous (_In_ bool continuous)
void | Duration (_In_ float duration)
float | Duration ()
virtual DirectX::XMFLOAT3 | Evaluate (_In_ float t)=0
bool | IsActive (_In_ float t)
bool | IsFinished (_In_ float t)
float | Start ()
void | Start (_In_ float start)

Protected Attributes

bool | m_continuous
float | m_duration
float | m_startTime

Detailed Description

Definition at line 28 of file Animate.h.

Constructor & Destructor Documentation

Animate ( )

Definition at line 17 of file Animate.cpp.

                 :
    m_continuous(false),
    m_startTime(0.0f),
    m_duration(10.0f)
{
}

Member Function Documentation

bool Continuous ( )

Definition at line 44 of file Animate.cpp.

{
    return m_continuous;
}

void Continuous ( _In_ bool continuous )

Definition at line 49 of file Animate.cpp.

{
    m_continuous = continuous;
}

float Duration ( )

Definition at line 34 of file Animate.cpp.

{
    return m_duration;
}

void Duration ( _In_ float duration )

Definition at line 39 of file Animate.cpp.

{
    m_duration = duration;
}

virtual DirectX::XMFLOAT3 Evaluate ( _In_ float t ) [pure virtual]

Implemented in AnimateLinePosition, AnimateLineListPosition, and AnimateCirclePosition.

bool IsActive ( _In_ float t ) [inline]

Definition at line 35 of file Animate.h.

{ return ((t >= m_startTime) && (m_continuous || (t < (m_startTime + m_duration)))); };

bool IsFinished ( _In_ float t ) [inline]

Definition at line 36 of file Animate.h.

{ return (!m_continuous && (t >= (m_startTime + m_duration))); }

float Start ( )

Definition at line 24 of file Animate.cpp.

{
    return m_startTime;
}

void Start ( _In_ float start )

Definition at line 29 of file Animate.cpp.

{
    m_startTime = start;
}

Member Data Documentation

bool m_continuous [protected]

Definition at line 45 of file Animate.h.

float m_duration [protected]

Definition at line 46 of file Animate.h.

float m_startTime [protected]

Definition at line 47 of file Animate.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Animate.h
  • Simple3DGameDX/cppwinrt/GameContent/Animate.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimateCirclePosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AnimateCirclePosition Class Reference

#include "Animate.h"

Inherits Animate.

List of all members.

Public Member Functions

AnimateCirclePosition (_In_ DirectX::XMFLOAT3 center, _In_ DirectX::XMFLOAT3 startPosition, _In_ DirectX::XMFLOAT3 planeNormal, _In_ float duration, _In_ bool continuous, _In_ bool clockwise)
virtual DirectX::XMFLOAT3 | Evaluate (_In_ float t) override

Private Attributes

DirectX::XMFLOAT3 | m_center
bool | m_clockwise
DirectX::XMFLOAT3 | m_planeNormal
float | m_radius
DirectX::XMFLOAT4X4 | m_rotationMatrix
DirectX::XMFLOAT3 | m_startPosition

Detailed Description

Definition at line 113 of file Animate.h.

Constructor & Destructor Documentation

AnimateCirclePosition | ( | _In_ DirectX::XMFLOAT3 | center,
 |  | _In_ DirectX::XMFLOAT3 | startPosition,
 |  | _In_ DirectX::XMFLOAT3 | planeNormal,
 |  | _In_ float | duration,
 |  | _In_ bool | continuous,
 |  | _In_ bool | clockwise
 | ) |  |

Member Function Documentation

XMFLOAT3 Evaluate ( _In_ float t ) [override, virtual]

Implements Animate.

Definition at line 247 of file Animate.cpp.

{
    if (t <= m_startTime)
    {
        return m_startPosition;
    }

    if ((t >= (m_startTime + m_duration)) && !m_continuous)
    {
        return m_startPosition;
    }

    float startTime = m_startTime;
    if (m_continuous)
    {
        // For continuous operation move the start time forward to
        // eliminate previous iterations.
        startTime += ((int)((t - m_startTime) / m_duration)) * m_duration;
    }

    float u = (t - startTime) / m_duration * XM_2PI;

    XMFLOAT3 currentPosition;
    currentPosition.x = m_radius * cos(u);
    currentPosition.y = m_radius * sin(u);
    currentPosition.z = 0.0f;

    XMStoreFloat3(
        &currentPosition,
        XMVector3TransformCoord(
            XMLoadFloat3(&currentPosition),
            XMLoadFloat4x4(&m_rotationMatrix)
            )
        );

    return currentPosition;
}

Member Data Documentation

DirectX::XMFLOAT3 m_center [private]

Definition at line 128 of file Animate.h.

bool m_clockwise [private]

Definition at line 132 of file Animate.h.

DirectX::XMFLOAT3 m_planeNormal [private]

Definition at line 129 of file Animate.h.

float m_radius [private]

Definition at line 131 of file Animate.h.

DirectX::XMFLOAT4X4 m_rotationMatrix [private]

Definition at line 127 of file Animate.h.

DirectX::XMFLOAT3 m_startPosition [private]

Definition at line 130 of file Animate.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Animate.h
  • Simple3DGameDX/cppwinrt/GameContent/Animate.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimateLineListPosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AnimateLineListPosition Class Reference

#include "Animate.h"

Inherits Animate.

List of all members.

Public Member Functions

AnimateLineListPosition (_In_ unsigned int count, _In_reads_(count) DirectX::XMFLOAT3 const position[], _In_ float duration, _In_ bool continuous)
virtual DirectX::XMFLOAT3 | Evaluate (_In_ float t) override

Private Attributes

unsigned int | m_count
std::vector< LineSegment > | m_segment
float | m_totalLength

Detailed Description

Definition at line 88 of file Animate.h.

Constructor & Destructor Documentation

AnimateLineListPosition | ( | _In_ unsigned int | count,
 |  | _In_reads_(count) DirectX::XMFLOAT3 const | position[],
 |  | _In_ float | duration,
 |  | _In_ bool | continuous
 | ) |  |

Member Function Documentation

XMFLOAT3 Evaluate ( _In_ float t ) [override, virtual]

Implements Animate.

Definition at line 136 of file Animate.cpp.

{
    if (t <= m_startTime)
    {
        return m_segment[0].position;
    }

    if ((t >= (m_startTime + m_duration)) && !m_continuous)
    {
        return m_segment[m_count - 1].position;
    }

    float startTime = m_startTime;
    if (m_continuous)
    {
        // For continuous operation move the start time forward to
        // eliminate previous iterations.
        startTime += ((int)((t - m_startTime) / m_duration)) * m_duration;
    }

    float u = (t - startTime) / m_duration;
    // Find the right segment.
    unsigned int i = 0;
    while (u > m_segment[i + 1].uStart)
    {
        i++;
    }

    u -= m_segment[i].uStart;
    u /= m_segment[i].uLength;

    XMFLOAT3 currentPosition;
    currentPosition.x = m_segment[i].position.x + (m_segment[i + 1].position.x - m_segment[i].position.x) * u;
    currentPosition.y = m_segment[i].position.y + (m_segment[i + 1].position.y - m_segment[i].position.y) * u;
    currentPosition.z = m_segment[i].position.z + (m_segment[i + 1].position.z - m_segment[i].position.z) * u;

    return currentPosition;
}

Member Data Documentation

unsigned int m_count [private]

Definition at line 100 of file Animate.h.

std::vector<LineSegment> m_segment [private]

Definition at line 102 of file Animate.h.

float m_totalLength [private]

Definition at line 101 of file Animate.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Animate.h
  • Simple3DGameDX/cppwinrt/GameContent/Animate.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimateLinePosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AnimateLinePosition Class Reference

#include "Animate.h"

Inherits Animate.

List of all members.

Public Member Functions

AnimateLinePosition (_In_ DirectX::XMFLOAT3 startPosition, _In_ DirectX::XMFLOAT3 endPosition, _In_ float duration, _In_ bool continuous)
virtual DirectX::XMFLOAT3 | Evaluate (_In_ float t) override

Private Attributes

DirectX::XMFLOAT3 | m_endPosition
float | m_length
DirectX::XMFLOAT3 | m_startPosition

Detailed Description

Definition at line 54 of file Animate.h.

Constructor & Destructor Documentation

AnimateLinePosition | ( | _In_ DirectX::XMFLOAT3 | startPosition,
 |  | _In_ DirectX::XMFLOAT3 | endPosition,
 |  | _In_ float | duration,
 |  | _In_ bool | continuous
 | ) |  |

Member Function Documentation

XMFLOAT3 Evaluate ( _In_ float t ) [override, virtual]

Implements Animate.

Definition at line 70 of file Animate.cpp.

{
    if (t <= m_startTime)
    {
        return m_startPosition;
    }

    if ((t >= (m_startTime + m_duration)) && !m_continuous)
    {
        return m_endPosition;
    }

    float startTime = m_startTime;
    if (m_continuous)
    {
        // For continuous operation move the start time forward to
        // eliminate previous iterations.
        startTime += ((int)((t - m_startTime) / m_duration)) * m_duration;
    }

    float u = (t - startTime) / m_duration;
    XMFLOAT3 currentPosition;
    currentPosition.x = m_startPosition.x + (m_endPosition.x - m_startPosition.x) * u;
    currentPosition.y = m_startPosition.y + (m_endPosition.y - m_startPosition.y) * u;
    currentPosition.z = m_startPosition.z + (m_endPosition.z - m_startPosition.z) * u;

    return currentPosition;
}

Member Data Documentation

DirectX::XMFLOAT3 m_endPosition [private]

Definition at line 67 of file Animate.h.

float m_length [private]

Definition at line 68 of file Animate.h.

DirectX::XMFLOAT3 m_startPosition [private]

Definition at line 66 of file Animate.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Animate.h
  • Simple3DGameDX/cppwinrt/GameContent/Animate.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: handle_closer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{DDSTextureLoader.cpp}
  • handle_closer
Public Member Functions

handle_closer Struct Reference

List of all members.

Public Member Functions

void operator() (HANDLE h)

Detailed Description

Definition at line 126 of file DDSTextureLoader.cpp.

Member Function Documentation

void operator() ( HANDLE h ) [inline]

Definition at line 126 of file DDSTextureLoader.cpp.

{ void operator()(HANDLE h) { if (h) CloseHandle(h); } };

The documentation for this struct was generated from the following file:
  • HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSendOperationStatus Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{NetworkChannel.cpp}
  • CSendOperationStatus
Public Member Functions | Public Attributes | Private Attributes

CSendOperationStatus Class Reference

List of all members.

Public Member Functions

void | CheckException ()

Public Attributes

internal | __pad0__: CSendOperationStatus() { } void SetException(Exception ^error) { if (_error == nullptr) { _error = error

Private Attributes

Exception | _error

Detailed Description

Definition at line 15 of file NetworkChannel.cpp.

Member Function Documentation

void CheckException ( ) [inline]

Definition at line 30 of file NetworkChannel.cpp.

        {
            if (_error != nullptr)
            {
                throw _error;
            }
        }

Member Data Documentation

internal __pad0__

Definition at line 26 of file NetworkChannel.cpp.

Exception _error [private]

Definition at line 39 of file NetworkChannel.cpp.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SetConnectedFunc Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{StspMediaSink.cpp}
  • SetConnectedFunc
Public Member Functions | Public Attributes

SetConnectedFunc Class Reference

List of all members.

Public Member Functions

SetConnectedFunc (bool fConnected, LONGLONG llStartTime)
HRESULT | operator() (IMFStreamSink *pStream) const

Public Attributes

bool | _fConnected
LONGLONG | _llStartTime

Detailed Description

Definition at line 31 of file StspMediaSink.cpp.

Constructor & Destructor Documentation

SetConnectedFunc | ( | bool | fConnected,
 |  | LONGLONG | llStartTime |
 | ) |  |  | [inline]

Definition at line 34 of file StspMediaSink.cpp.

            : _fConnected(fConnected)
            , _llStartTime(llStartTime)
        {
        }

Member Function Documentation

HRESULT operator() ( IMFStreamSink * pStream ) const [inline]

Definition at line 40 of file StspMediaSink.cpp.

        {
            return static_cast<CStreamSink *>(pStream)->SetConnected(_fConnected, _llStartTime);
        }

Member Data Documentation

bool _fConnected

Definition at line 45 of file StspMediaSink.cpp.

LONGLONG _llStartTime

Definition at line 46 of file StspMediaSink.cpp.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShutdownFunc Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{StspMediaSink.cpp}
  • ShutdownFunc
Public Member Functions

ShutdownFunc Class Reference

List of all members.

Public Member Functions

HRESULT operator() (IMFStreamSink *pStream) const

Detailed Description

Definition at line 21 of file StspMediaSink.cpp.

Member Function Documentation

HRESULT operator() ( IMFStreamSink * pStream ) const [inline]

Definition at line 24 of file StspMediaSink.cpp.

        {
            static_cast<CStreamSink *>(pStream)->Shutdown();
            return S_OK;
        }

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StartFunc Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{StspMediaSink.cpp}
  • StartFunc
Public Member Functions | Public Attributes

StartFunc Class Reference

List of all members.

Public Member Functions

StartFunc (LONGLONG llStartTime)
HRESULT | operator() (IMFStreamSink *pStream) const

Public Attributes

LONGLONG | _llStartTime

Detailed Description

Definition at line 49 of file StspMediaSink.cpp.

Constructor & Destructor Documentation

StartFunc ( LONGLONG llStartTime ) [inline]

Definition at line 52 of file StspMediaSink.cpp.

            : _llStartTime(llStartTime)
        {
        }

Member Function Documentation

HRESULT operator() ( IMFStreamSink * pStream ) const [inline]

Definition at line 57 of file StspMediaSink.cpp.

        {
            return static_cast<CStreamSink *>(pStream)->Start(_llStartTime);
        }

Member Data Documentation

LONGLONG _llStartTime

Definition at line 62 of file StspMediaSink.cpp.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StopFunc Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{StspMediaSink.cpp}
  • StopFunc
Public Member Functions

StopFunc Class Reference

List of all members.

Public Member Functions

HRESULT operator() (IMFStreamSink *pStream) const

Detailed Description

Definition at line 65 of file StspMediaSink.cpp.

Member Function Documentation

HRESULT operator() ( IMFStreamSink * pStream ) const [inline]

Definition at line 68 of file StspMediaSink.cpp.

        {
            return static_cast<CStreamSink *>(pStream)->Stop();
        }

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AttributeValidationDescriptor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{Validation.cpp}
  • AttributeValidationDescriptor
Public Attributes

AttributeValidationDescriptor Struct Reference

List of all members.

Public Attributes

REFGUID | guidKey
bool(* | IsValid )(PROPVARIANT *pValue)

Detailed Description

Definition at line 27 of file Validation.cpp.

Member Data Documentation

REFGUID guidKey

Definition at line 29 of file Validation.cpp.

bool(* IsValid)(PROPVARIANT *pValue)

Definition at line 30 of file Validation.cpp.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Validation.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTypeValidationDescriptor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • anonymous_namespace{Validation.cpp}
  • MediaTypeValidationDescriptor
Public Attributes

MediaTypeValidationDescriptor Struct Reference

List of all members.

Public Attributes

const
AttributeValidationDescriptor * 		attributes
size_t | cAttributes
bool | fVideo
GUID | guidSubtype

Detailed Description

Definition at line 34 of file Validation.cpp.

Member Data Documentation

const AttributeValidationDescriptor* attributes

Definition at line 39 of file Validation.cpp.

size_t cAttributes

Definition at line 38 of file Validation.cpp.

bool fVideo

Definition at line 37 of file Validation.cpp.

GUID guidSubtype

Definition at line 36 of file Validation.cpp.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Validation.cpp
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

App Struct Reference

List of all members.

Public Member Functions

IFrameworkView | CreateView ()
void | Initialize (CoreApplicationView const &applicationView)
void | Load (winrt::hstring const &)
void | OnActivated (CoreApplicationView const &, IActivatedEventArgs const &)
void | OnDisplayContentsInvalidated (DisplayInformation const &, IInspectable const &)
void | OnDpiChanged (DisplayInformation const &sender, IInspectable const &)
void | OnOrientationChanged (DisplayInformation const &sender, IInspectable const &)
void | OnResuming (IInspectable const &, IInspectable const &)
void | OnStereoEnabledChanged (DisplayInformation const &, IInspectable const &)
winrt::fire_and_forget | OnSuspending (IInspectable const &, SuspendingEventArgs const &args)
void | OnVisibilityChanged (CoreWindow const &, VisibilityChangedEventArgs const &args)
void | OnWindowActivationChanged (CoreWindow const &, WindowActivatedEventArgs const &args)
void | OnWindowClosed (CoreWindow const &, CoreWindowEventArgs const &)
void | OnWindowSizeChanged (CoreWindow const &, WindowSizeChangedEventArgs const &args)
void | Run ()
void | SetWindow (CoreWindow const &window)
void | Uninitialize ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
winrt::com_ptr< GameMain > | m_main

Detailed Description

Definition at line 22 of file App.cpp.

Member Function Documentation

IFrameworkView CreateView ( ) [inline]

Definition at line 24 of file App.cpp.

    {
        return *this;
    }

void Initialize ( CoreApplicationView const & applicationView ) [inline]

Definition at line 29 of file App.cpp.

    {
        applicationView.Activated({ this, &App::OnActivated });

        CoreApplication::Suspending({ this, &App::OnSuspending });

        CoreApplication::Resuming({ this, &App::OnResuming });

        // At this point we have access to the device.
        // We can create the device-dependent resources.
        m_deviceResources = std::make_shared<DX::DeviceResources>();
    }

void Load ( winrt::hstring const & ) [inline]

Definition at line 42 of file App.cpp.

    {
        if (!m_main)
        {
            m_main = winrt::make_self<GameMain>(m_deviceResources);
        }
    }

void OnActivated | ( | CoreApplicationView const & | ,
 |  | IActivatedEventArgs const & |  |
 | ) |  |  | [inline]

Definition at line 88 of file App.cpp.

    {
        CoreWindow window = CoreWindow::GetForCurrentThread();
        window.Activate();
    }

void OnDisplayContentsInvalidated | ( | DisplayInformation const & | ,
 |  | IInspectable const & |  |
 | ) |  |  | [inline]

Definition at line 160 of file App.cpp.

    {
        m_deviceResources->ValidateDevice();
    }

void OnDpiChanged | ( | DisplayInformation const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [inline]

Definition at line 148 of file App.cpp.

    {
        m_deviceResources->SetDpi(sender.LogicalDpi());
        m_main->CreateWindowSizeDependentResources();
    }

void OnOrientationChanged | ( | DisplayInformation const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [inline]

Definition at line 154 of file App.cpp.

    {
        m_deviceResources->SetCurrentOrientation(sender.CurrentOrientation());
        m_main->CreateWindowSizeDependentResources();
    }

void OnResuming | ( | IInspectable const & | ,
 |  | IInspectable const & |  |
 | ) |  |  | [inline]

Definition at line 123 of file App.cpp.

    {
        // Restore any data or state that was unloaded on suspend. By default, data
        // and state are persisted when resuming from suspend. Note that this event
        // does not occur if the app was previously terminated.
        m_main->Resume();
    }

void OnStereoEnabledChanged | ( | DisplayInformation const & | ,
 |  | IInspectable const & |  |
 | ) |  |  | [inline]

Definition at line 131 of file App.cpp.

    {
        m_deviceResources->UpdateStereoState();
        m_main->CreateWindowSizeDependentResources();
    }

winrt::fire_and_forget OnSuspending | ( | IInspectable const & | ,
 |  | SuspendingEventArgs const & | args |
 | ) |  |  | [inline]

Definition at line 104 of file App.cpp.

    {
        auto lifetime = get_strong();

        // Save app state asynchronously after requesting a deferral. Holding a deferral
        // indicates that the application is busy performing suspending operations. Be
        // aware that a deferral may not be held indefinitely. After about five seconds,
        // the app will be forced to exit.
        SuspendingDeferral deferral = args.SuspendingOperation().GetDeferral();

        co_await winrt::resume_background();

        m_deviceResources->Trim();

        m_main->Suspend();

        deferral.Complete();
    }

void OnVisibilityChanged | ( | CoreWindow const & | ,
 |  | VisibilityChangedEventArgs const & | args |
 | ) |  |  | [inline]

Definition at line 94 of file App.cpp.

    {
        m_main->Visibility(args.Visible());
    }

void OnWindowActivationChanged | ( | CoreWindow const & | ,
 |  | WindowActivatedEventArgs const & | args |
 | ) |  |  | [inline]

Definition at line 99 of file App.cpp.

    {
        m_main->WindowActivationChanged(args.WindowActivationState());
    }

void OnWindowClosed | ( | CoreWindow const & | ,
 |  | CoreWindowEventArgs const & |  |
 | ) |  |  | [inline]

Definition at line 143 of file App.cpp.

    {
        m_main->Close();
    }

void OnWindowSizeChanged | ( | CoreWindow const & | ,
 |  | WindowSizeChangedEventArgs const & | args |
 | ) |  |  | [inline]

Definition at line 137 of file App.cpp.

    {
        m_deviceResources->SetLogicalSize(args.Size());
        m_main->CreateWindowSizeDependentResources();
    }

void Run ( ) [inline]

Definition at line 54 of file App.cpp.

    {
        m_main->Run();
    }

void SetWindow ( CoreWindow const & window ) [inline]

Definition at line 59 of file App.cpp.

    {
        window.PointerCursor(CoreCursor(CoreCursorType::Arrow, 0));

        PointerVisualizationSettings visualizationSettings{ PointerVisualizationSettings::GetForCurrentView() };
        visualizationSettings.IsContactFeedbackEnabled(false);
        visualizationSettings.IsBarrelButtonFeedbackEnabled(false);

        m_deviceResources->SetWindow(window);

        window.Activated({ this, &App::OnWindowActivationChanged });

        window.SizeChanged({ this, &App::OnWindowSizeChanged });

        window.Closed({ this, &App::OnWindowClosed });

        window.VisibilityChanged({ this, &App::OnVisibilityChanged });

        DisplayInformation currentDisplayInformation{ DisplayInformation::GetForCurrentView() };

        currentDisplayInformation.DpiChanged({ this, &App::OnDpiChanged });

        currentDisplayInformation.OrientationChanged({ this, &App::OnOrientationChanged });

        currentDisplayInformation.StereoEnabledChanged({ this, &App::OnStereoEnabledChanged });

        DisplayInformation::DisplayContentsInvalidated({ this, &App::OnDisplayContentsInvalidated });
    }

void Uninitialize ( ) [inline]

Definition at line 50 of file App.cpp.

    {
    }

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 166 of file App.cpp.

winrt::com_ptr<GameMain> m_main [private]

Definition at line 167 of file App.cpp.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cppwinrt/App.cpp
  • CameraStreamCoordinateMapper/cpp/App.cpp
  • D2DCustomEffects/cpp/ComputeShader/App.cpp
  • D2DCustomEffects/cpp/PixelShader/App.cpp
  • D2DCustomEffects/cpp/VertexShader/App.cpp
  • D2DGradientMesh/cpp/App.cpp
  • DWriteColorGlyph/cpp/App.cpp
  • Simple3DGameDX/cpp/App.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AsyncCallback< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Types | Public Member Functions | Public Attributes

AsyncCallback< T > Class Template Reference

#include "AsyncCB.h"

Inherits IMFAsyncCallback.

List of all members.

Public Types

typedef HRESULT(T::* | InvokeFn )(IMFAsyncResult *pAsyncResult)

Public Member Functions

AsyncCallback (T *pParent, InvokeFn fn)
STDMETHODIMP | GetParameters (DWORD *, DWORD *)
STDMETHODIMP | Invoke (IMFAsyncResult *pAsyncResult)
STDMETHODIMP | QueryInterface (REFIID iid, void **ppv)
STDMETHODIMP_ (ULONG) Release()
STDMETHODIMP_ (ULONG) AddRef()

Public Attributes

InvokeFn m_pInvokeFn
T * | m_pParent

Detailed Description

template<class T>
class AsyncCallback< T >

Definition at line 25 of file AsyncCB.h.

Member Typedef Documentation

typedef HRESULT(T::* InvokeFn)(IMFAsyncResult *pAsyncResult)

Definition at line 28 of file AsyncCB.h.

Constructor & Destructor Documentation

AsyncCallback | ( | T * | pParent,
 |  | InvokeFn | fn |
 | ) |  |  | [inline]

Definition at line 30 of file AsyncCB.h.

                                           : m_pParent(pParent), m_pInvokeFn(fn)
    {
    }

Member Function Documentation

STDMETHODIMP GetParameters | ( | DWORD * | ,
 |  | DWORD * |  |
 | ) |  |  | [inline]

Definition at line 68 of file AsyncCB.h.

    {
        // Implementation of this method is optional.
        return E_NOTIMPL;
    }

STDMETHODIMP Invoke ( IMFAsyncResult * pAsyncResult ) [inline]

Definition at line 74 of file AsyncCB.h.

    {
        return (m_pParent->*m_pInvokeFn)(pAsyncResult);
    }

STDMETHODIMP QueryInterface | ( | REFIID | iid,
 |  | void ** | ppv |
 | ) |  |  | [inline]

Definition at line 43 of file AsyncCB.h.

    {
        if (!ppv)
        {
            return E_POINTER;
        }
        if (iid == __uuidof(IUnknown))
        {
            *ppv = static_cast<IUnknown*>(static_cast<IMFAsyncCallback*>(this));
        }
        else if (iid == __uuidof(IMFAsyncCallback))
        {
            *ppv = static_cast<IMFAsyncCallback*>(this);
        }
        else
        {
            *ppv = NULL;
            return E_NOINTERFACE;
        }
        AddRef();
        return S_OK;
    }

STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 35 of file AsyncCB.h.

                                  {
        // Delegate to parent class.
        return m_pParent->AddRef();
    }

STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 39 of file AsyncCB.h.

                                   {
        // Delegate to parent class.
        return m_pParent->Release();
    }

Member Data Documentation

InvokeFn m_pInvokeFn

Definition at line 80 of file AsyncCB.h.

T* m_pParent

Definition at line 79 of file AsyncCB.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/AsyncCB.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Audio Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

Audio Class Reference

#include "Audio.h"

List of all members.

Public Member Functions

Audio ()
void | CreateDeviceIndependentResources ()
void | Initialize ()
IXAudio2 * | MusicEngine ()
void | ResumeAudio ()
IXAudio2 * | SoundEffectEngine ()
void | SuspendAudio ()

Private Attributes

bool | m_audioAvailable
winrt::com_ptr< IXAudio2 > | m_musicEngine
IXAudio2MasteringVoice * | m_musicMasteringVoice
winrt::com_ptr< IXAudio2 > | m_soundEffectEngine
IXAudio2MasteringVoice * | m_soundEffectMasteringVoice

Detailed Description

Definition at line 21 of file Audio.h.

Constructor & Destructor Documentation

Audio ( )

Definition at line 15 of file Audio.cpp.

             :
    m_audioAvailable(false)
{
}

Member Function Documentation

void CreateDeviceIndependentResources ( )

Definition at line 24 of file Audio.cpp.

{
    UINT32 flags = 0;

    winrt::check_hresult(
        XAudio2Create(m_musicEngine.put(), flags)
        );

#if defined(_DEBUG)
    XAUDIO2_DEBUG_CONFIGURATION debugConfiguration = { 0 };
    debugConfiguration.BreakMask = XAUDIO2_LOG_ERRORS;
    debugConfiguration.TraceMask = XAUDIO2_LOG_ERRORS;
    m_musicEngine->SetDebugConfiguration(&debugConfiguration);
#endif

    HRESULT hr = m_musicEngine->CreateMasteringVoice(&m_musicMasteringVoice);
    if (FAILED(hr))
    {
        // Unable to create an audio device
        m_audioAvailable = false;
        return;
    }

    winrt::check_hresult(
        XAudio2Create(m_soundEffectEngine.put(), flags)
        );

#if defined(_DEBUG)
    m_soundEffectEngine->SetDebugConfiguration(&debugConfiguration);
#endif

    winrt::check_hresult(
        m_soundEffectEngine->CreateMasteringVoice(&m_soundEffectMasteringVoice)
        );

    m_audioAvailable = true;
}

void Initialize ( )

Definition at line 20 of file Audio.cpp.

{
}

IXAudio2 * MusicEngine ( )

Definition at line 62 of file Audio.cpp.

{
    return m_musicEngine.get();
}

void ResumeAudio ( )

Definition at line 81 of file Audio.cpp.

{
    if (m_audioAvailable)
    {
        winrt::check_hresult(m_musicEngine->StartEngine());
        winrt::check_hresult(m_soundEffectEngine->StartEngine());
    }
}

IXAudio2 * SoundEffectEngine ( )

Definition at line 67 of file Audio.cpp.

{
    return m_soundEffectEngine.get();
}

void SuspendAudio ( )

Definition at line 72 of file Audio.cpp.

{
    if (m_audioAvailable)
    {
        m_musicEngine->StopEngine();
        m_soundEffectEngine->StopEngine();
    }
}

Member Data Documentation

bool m_audioAvailable [private]

Definition at line 34 of file Audio.h.

winrt::com_ptr<IXAudio2> m_musicEngine [private]

Definition at line 35 of file Audio.h.

IXAudio2MasteringVoice* m_musicMasteringVoice [private]

Definition at line 37 of file Audio.h.

winrt::com_ptr<IXAudio2> m_soundEffectEngine [private]

Definition at line 36 of file Audio.h.

IXAudio2MasteringVoice* m_soundEffectMasteringVoice [private]

Definition at line 38 of file Audio.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Audio.h
  • Simple3DGameDX/cppwinrt/GameContent/Audio.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IMemoryBufferByteAccess Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • IMemoryBufferByteAccess
Public Member Functions

IMemoryBufferByteAccess Interface Reference

List of all members.

Public Member Functions

void GetBuffer (out byte *buffer, out uint capacity)

Detailed Description

Definition at line 38 of file Scenario3_FrameInputNode.xaml.cs.

Member Function Documentation

void GetBuffer | ( | out byte * | buffer,
 |  | out uint | capacity
 | ) |  |
The documentation for this interface was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario3_FrameInputNode.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FilePlayback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario1_FilePlayback
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_FilePlayback Class Reference

Using the AudioGraph API to playback from a file input.

List of all members.

Public Member Functions

Scenario1_FilePlayback ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateAudioGraph ()
async void | File_Click (object sender, RoutedEventArgs e)
void | Graph_Click (object sender, RoutedEventArgs e)
void | LoopToggle_Toggled (object sender, RoutedEventArgs e)
void | PlaySpeedSlider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | TogglePlay ()

Private Attributes

AudioDeviceOutputNode | deviceOutput
AudioFileInputNode | fileInput
AudioGraph | graph
MainPage rootPage

Detailed Description

Definition at line 33 of file Scenario1_FilePlayback.xaml.cs.

Constructor & Destructor Documentation

Scenario1_FilePlayback ( ) [inline]

Definition at line 41 of file Scenario1_FilePlayback.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 176 of file Scenario1_FilePlayback.xaml.cs.

        {
            // Create an AudioGraph with default settings
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Cannot create graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;

            // Create a device output node
            CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();

            if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output node
                rootPage.NotifyUser(String.Format("Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                speakerContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceOutput = deviceOutputNodeResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
            speakerContainer.Background = new SolidColorBrush(Colors.Green);
        }

async void File_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario1_FilePlayback.xaml.cs.

        {
            // Clear any old messages.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // If another file is already loaded into the FileInput node
            if (fileInput != null)
            {
                // Release the file and dispose the contents of the node
                fileInput.Dispose();
                // Stop playback since a new file is being loaded. Also reset the button UI
                if (graphButton.Content.Equals("Stop Graph"))
                {
                    TogglePlay();
                }
            }

            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.FileTypeFilter.Add(".mp3");
            filePicker.FileTypeFilter.Add(".wav");
            filePicker.FileTypeFilter.Add(".wma");
            filePicker.FileTypeFilter.Add(".m4a");
            filePicker.ViewMode = PickerViewMode.Thumbnail;
            StorageFile file = await filePicker.PickSingleFileAsync();

            // File can be null if cancel is hit in the file picker
            if(file == null)
            {
                return;
            }

            CreateAudioFileInputNodeResult fileInputResult = await graph.CreateFileInputNodeAsync(file);
            if (AudioFileNodeCreationStatus.Success != fileInputResult.Status)
            {
                // Cannot read input file
                rootPage.NotifyUser(String.Format("Cannot read input file because {0}", fileInputResult.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            fileInput = fileInputResult.FileInputNode;

            if (fileInput.Duration <= TimeSpan.FromSeconds(3))
            {
                // Imported file is too short
                rootPage.NotifyUser("Please pick an audio file which is longer than 3 seconds", NotifyType.ErrorMessage);
                fileInput.Dispose();
                fileInput = null;
                return;
            }

            fileInput.AddOutgoingConnection(deviceOutput);
            fileButton.Background = new SolidColorBrush(Colors.Green);

            // Trim the file: set the start time to 3 seconds from the beginning
            // fileInput.EndTime can be used to trim from the end of file
            fileInput.StartTime = TimeSpan.FromSeconds(3);

            // Enable buttons in UI to start graph, loop and change playback speed factor
            graphButton.IsEnabled = true;
            loopToggle.IsEnabled = true;
            playSpeedSlider.IsEnabled = true;
        }

void Graph_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario1_FilePlayback.xaml.cs.

        {
            TogglePlay();
        }

void LoopToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario1_FilePlayback.xaml.cs.

        {
            // Set loop count to null for infinite looping
            // Set loop count to 0 to stop looping after current iteration
            // Set loop count to non-zero value for finite looping
            if (loopToggle.IsOn)
            {
                // If turning on looping, make sure the file hasn't finished playback yet
                if (fileInput.Position >= fileInput.Duration)
                {
                    // If finished playback, seek back to the start time we set
                    fileInput.Seek(fileInput.StartTime.Value);
                }
                fileInput.LoopCount = null; // infinite looping
            }
            else
            {
                fileInput.LoopCount = 0; // stop looping
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario1_FilePlayback.xaml.cs.

        {
            // Destroy the graph if the page is naviated away from
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario1_FilePlayback.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CreateAudioGraph();
        }

void PlaySpeedSlider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario1_FilePlayback.xaml.cs.

        {
            if (fileInput != null)
            {
                fileInput.PlaybackSpeedFactor = playSpeedSlider.Value;
            }
        }

void TogglePlay ( ) [inline, private]

Definition at line 130 of file Scenario1_FilePlayback.xaml.cs.

        {
            //Toggle playback
            if (graphButton.Content.Equals("Start Graph"))
            {
                graph.Start();
                graphButton.Content = "Stop Graph";
                audioPipe.Fill = new SolidColorBrush(Colors.Blue);
            }
            else
            {
                graph.Stop();
                graphButton.Content = "Start Graph";
                audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            }
        }

Member Data Documentation

AudioDeviceOutputNode deviceOutput [private]

Definition at line 39 of file Scenario1_FilePlayback.xaml.cs.

AudioFileInputNode fileInput [private]

Definition at line 38 of file Scenario1_FilePlayback.xaml.cs.

AudioGraph graph [private]

Definition at line 37 of file Scenario1_FilePlayback.xaml.cs.

MainPage rootPage [private]

Definition at line 35 of file Scenario1_FilePlayback.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario1_FilePlayback.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DeviceCapture Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario2_DeviceCapture
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_DeviceCapture Class Reference

This scenario shows using AudioGraph for audio capture from a microphone with low latency.

List of all members.

Public Member Functions

Scenario2_DeviceCapture ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateAudioGraph ()
async void | CreateGraphButton_Click (object sender, RoutedEventArgs e)
MediaEncodingProfile | CreateMediaEncodingProfile (StorageFile file)
async void | FileButton_Click (object sender, RoutedEventArgs e)
async void | Graph_UnrecoverableErrorOccurred (AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
void | inputDevicesListBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | outputDevicesListBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | PopulateInputDeviceList ()
async Task | PopulateOutputDeviceList ()
async void | RecordStopButton_Click (object sender, RoutedEventArgs e)
async Task | SelectOutputFile ()
async Task | ToggleRecordStop ()

Private Attributes

AudioDeviceInputNode | deviceInputNode
AudioDeviceOutputNode | deviceOutputNode
AudioFileOutputNode | fileOutputNode
AudioGraph | graph
DeviceInformationCollection | inputDevices
DeviceInformationCollection | outputDevices
MainPage rootPage

Detailed Description

Definition at line 39 of file Scenario2_DeviceCapture.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DeviceCapture ( ) [inline]

Definition at line 49 of file Scenario2_DeviceCapture.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 192 of file Scenario2_DeviceCapture.xaml.cs.

        {
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            settings.QuantumSizeSelectionMode = QuantumSizeSelectionMode.LowestLatency;
            settings.PrimaryRenderDevice = outputDevices[outputDevicesListBox.SelectedIndex - 1];

            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Cannot create graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;
            rootPage.NotifyUser("Graph successfully created!", NotifyType.StatusMessage);

            // Create a device output node
            CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();
            if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output node
                rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                outputDeviceContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output connection successfully created", NotifyType.StatusMessage);
            outputDeviceContainer.Background = new SolidColorBrush(Colors.Green);

            // Create a device input node using the default audio input device
            CreateAudioDeviceInputNodeResult deviceInputNodeResult = await graph.CreateDeviceInputNodeAsync(MediaCategory.Other, graph.EncodingProperties, inputDevices[inputDevicesListBox.SelectedIndex - 1]);

            if (deviceInputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device input node
                rootPage.NotifyUser(String.Format("Audio Device Input unavailable because {0}", deviceInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                inputDeviceContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceInputNode = deviceInputNodeResult.DeviceInputNode;
            rootPage.NotifyUser("Device Input connection successfully created", NotifyType.StatusMessage);
            inputDeviceContainer.Background = new SolidColorBrush(Colors.Green);

            // Since graph is successfully created, enable the button to select a file output
            fileButton.IsEnabled = true;

            // Disable the graph button to prevent accidental click
            createGraphButton.IsEnabled = false;

            // Because we are using lowest latency setting, we need to handle device disconnection errors
            graph.UnrecoverableErrorOccurred += Graph_UnrecoverableErrorOccurred;
        }

async void CreateGraphButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario2_DeviceCapture.xaml.cs.

        {
            await CreateAudioGraph();
        }

MediaEncodingProfile CreateMediaEncodingProfile ( StorageFile file ) [inline, private]

Definition at line 122 of file Scenario2_DeviceCapture.xaml.cs.

        {
            switch(file.FileType.ToString().ToLowerInvariant())
            {
                case ".wma":
                    return MediaEncodingProfile.CreateWma(AudioEncodingQuality.High);
                case ".mp3":
                    return MediaEncodingProfile.CreateMp3(AudioEncodingQuality.High);
                case ".wav":
                    return MediaEncodingProfile.CreateWav(AudioEncodingQuality.High);
                default:
                    throw new ArgumentException();
            }
        }

async void FileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario2_DeviceCapture.xaml.cs.

        {
            await SelectOutputFile();
        }

async void Graph_UnrecoverableErrorOccurred | ( | AudioGraph | sender,
 |  | AudioGraphUnrecoverableErrorOccurredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 249 of file Scenario2_DeviceCapture.xaml.cs.

        {
            // Recreate the graph and all nodes when this happens
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                sender.Dispose();
                // Re-query for devices
                await PopulateOutputDeviceList();
                await PopulateInputDeviceList();
                // Reset UI
                fileButton.IsEnabled = false;
                recordStopButton.IsEnabled = false;
                recordStopButton.Content = "Record";
                outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
                audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            });
        }

void inputDevicesListBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 293 of file Scenario2_DeviceCapture.xaml.cs.

        {
            if (inputDevicesListBox.SelectedIndex == 0)
            {
                createGraphButton.IsEnabled = false;
                fileButton.IsEnabled = false;
                fileButton.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                inputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));

                // Destroy graph
                if (graph != null)
                {
                    graph.Dispose();
                    graph = null;
                }
            }
            else
            {
                createGraphButton.IsEnabled = true;
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 61 of file Scenario2_DeviceCapture.xaml.cs.

        {
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 54 of file Scenario2_DeviceCapture.xaml.cs.

        {
            rootPage = MainPage.Current;
            await PopulateOutputDeviceList();
            await PopulateInputDeviceList();
        }

void outputDevicesListBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 268 of file Scenario2_DeviceCapture.xaml.cs.

        {
            if (outputDevicesListBox.SelectedIndex == 0)
            {
                createGraphButton.IsEnabled = false;
                outputDevice.Foreground = new SolidColorBrush(Color.FromArgb(255, 110, 110, 110));
                outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                fileButton.IsEnabled = false;
                fileButton.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                inputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));

                // Destroy graph
                if (graph != null)
                {
                    graph.Dispose();
                    graph = null;
                }
            }
            else
            {
                createGraphButton.IsEnabled = true;
                outputDevice.Foreground = new SolidColorBrush(Colors.White);
            }
        }

async Task PopulateInputDeviceList ( ) [inline, private]

Definition at line 181 of file Scenario2_DeviceCapture.xaml.cs.

        {
            inputDevicesListBox.Items.Clear();
            inputDevices = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioCaptureSelector());
            inputDevicesListBox.Items.Add("-- Pick input device --");
            foreach (var device in inputDevices)
            {
                inputDevicesListBox.Items.Add(device.Name);
            }
        }

async Task PopulateOutputDeviceList ( ) [inline, private]

Definition at line 170 of file Scenario2_DeviceCapture.xaml.cs.

        {
            outputDevicesListBox.Items.Clear();
            outputDevices = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioRenderSelector());
            outputDevicesListBox.Items.Add("-- Pick output device --");
            foreach (var device in outputDevices)
            {
                outputDevicesListBox.Items.Add(device.Name);
            }
        }

async void RecordStopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario2_DeviceCapture.xaml.cs.

        {
            await ToggleRecordStop();
        }

async Task SelectOutputFile ( ) [inline, private]

Definition at line 84 of file Scenario2_DeviceCapture.xaml.cs.

        {
            FileSavePicker saveFilePicker = new FileSavePicker();
            saveFilePicker.FileTypeChoices.Add("Pulse Code Modulation", new List<string>() { ".wav" });
            saveFilePicker.FileTypeChoices.Add("Windows Media Audio", new List<string>() { ".wma" });
            saveFilePicker.FileTypeChoices.Add("MPEG Audio Layer-3", new List<string>() { ".mp3" });
            saveFilePicker.SuggestedFileName = "New Audio Track";
            StorageFile file = await saveFilePicker.PickSaveFileAsync();

            // File can be null if cancel is hit in the file picker
            if (file == null)
            {
                return;
            }

            rootPage.NotifyUser(String.Format("Recording to {0}", file.Name.ToString()), NotifyType.StatusMessage);
            MediaEncodingProfile fileProfile = CreateMediaEncodingProfile(file);

            // Operate node at the graph format, but save file at the specified format
            CreateAudioFileOutputNodeResult fileOutputNodeResult = await graph.CreateFileOutputNodeAsync(file, fileProfile);

            if (fileOutputNodeResult.Status != AudioFileNodeCreationStatus.Success)
            {
                // FileOutputNode creation failed
                rootPage.NotifyUser(String.Format("Cannot create output file because {0}", fileOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                fileButton.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            fileOutputNode = fileOutputNodeResult.FileOutputNode;
            fileButton.Background = new SolidColorBrush(Colors.YellowGreen);

            // Connect the input node to both output nodes
            deviceInputNode.AddOutgoingConnection(fileOutputNode);
            deviceInputNode.AddOutgoingConnection(deviceOutputNode);
            recordStopButton.IsEnabled = true;
        }

async Task ToggleRecordStop ( ) [inline, private]

Definition at line 137 of file Scenario2_DeviceCapture.xaml.cs.

        {
            if (recordStopButton.Content.Equals("Record"))
            {
                graph.Start();
                recordStopButton.Content = "Stop";
                audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
                audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
            }
            else if (recordStopButton.Content.Equals("Stop"))
            {
                // Good idea to stop the graph to avoid data loss
                graph.Stop();
                audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
                audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));

                TranscodeFailureReason finalizeResult = await fileOutputNode.FinalizeAsync();
                if (finalizeResult != TranscodeFailureReason.None)
                {
                    // Finalization of file failed. Check result code to see why
                    rootPage.NotifyUser(String.Format("Finalization of file failed because {0}", finalizeResult.ToString()), NotifyType.ErrorMessage);
                    fileButton.Background = new SolidColorBrush(Colors.Red);
                    return;
                }

                recordStopButton.Content = "Record";
                rootPage.NotifyUser("Recording to file completed successfully!", NotifyType.StatusMessage);
                fileButton.Background = new SolidColorBrush(Colors.Green);
                recordStopButton.IsEnabled = false;
                createGraphButton.IsEnabled = false;
            }
        }

Member Data Documentation

AudioDeviceInputNode deviceInputNode [private]

Definition at line 45 of file Scenario2_DeviceCapture.xaml.cs.

AudioDeviceOutputNode deviceOutputNode [private]

Definition at line 44 of file Scenario2_DeviceCapture.xaml.cs.

AudioFileOutputNode fileOutputNode [private]

Definition at line 43 of file Scenario2_DeviceCapture.xaml.cs.

AudioGraph graph [private]

Definition at line 42 of file Scenario2_DeviceCapture.xaml.cs.

DeviceInformationCollection inputDevices [private]

Definition at line 47 of file Scenario2_DeviceCapture.xaml.cs.

DeviceInformationCollection outputDevices [private]

Definition at line 46 of file Scenario2_DeviceCapture.xaml.cs.

MainPage rootPage [private]

Definition at line 41 of file Scenario2_DeviceCapture.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario2_DeviceCapture.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_FrameInput Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario3_FrameInput
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_FrameInput Class Reference

Scenario 3: Using a frame input node to play audio. More...

List of all members.

Public Member Functions

Scenario3_FrameInput ()

Public Attributes

double | theta = 0

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Button_Click (object sender, RoutedEventArgs e)
async Task | CreateAudioGraph ()
unsafe AudioFrame | GenerateAudioData (uint samples)
void | node_QuantumStarted (AudioFrameInputNode sender, FrameInputNodeQuantumStartedEventArgs args)

Private Attributes

AudioDeviceOutputNode | deviceOutputNode
AudioFrameInputNode | frameInputNode
AudioGraph | graph
MainPage rootPage

Detailed Description

Audio data is dynamically generated to populate the audio frame

Definition at line 46 of file Scenario3_FrameInputNode.xaml.cs.

Constructor & Destructor Documentation

Scenario3_FrameInput ( ) [inline]

Definition at line 54 of file Scenario3_FrameInputNode.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario3_FrameInputNode.xaml.cs.

        {
            if (generateButton.Content.Equals("Generate Audio"))
            {
                frameInputNode.Start();
                generateButton.Content = "Stop";
                audioPipe.Fill = new SolidColorBrush(Colors.Blue);
            }
            else if (generateButton.Content.Equals("Stop"))
            {
                frameInputNode.Stop();
                generateButton.Content = "Generate Audio";
                audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            }
        }

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 126 of file Scenario3_FrameInputNode.xaml.cs.

        {
            // Create an AudioGraph with default settings
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Cannot create graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;

            // Create a device output node
            CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();
            if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output node
                rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                speakerContainer.Background = new SolidColorBrush(Colors.Red);
            }

            deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
            speakerContainer.Background = new SolidColorBrush(Colors.Green);

            // Create the FrameInputNode at the same format as the graph, except explicitly set mono.
            AudioEncodingProperties nodeEncodingProperties = graph.EncodingProperties;
            nodeEncodingProperties.ChannelCount = 1;
            frameInputNode = graph.CreateFrameInputNode(nodeEncodingProperties);
            frameInputNode.AddOutgoingConnection(deviceOutputNode);
            frameContainer.Background = new SolidColorBrush(Colors.Green);

            // Initialize the Frame Input Node in the stopped state
            frameInputNode.Stop();

            // Hook up an event handler so we can start generating samples when needed
            // This event is triggered when the node is required to provide data
            frameInputNode.QuantumStarted += node_QuantumStarted;

            // Start the graph since we will only start/stop the frame input node
            graph.Start();
        }

unsafe AudioFrame GenerateAudioData ( uint samples ) [inline, private]

Definition at line 89 of file Scenario3_FrameInputNode.xaml.cs.

        {
            // Buffer size is (number of samples) * (size of each sample)
            // We choose to generate single channel (mono) audio. For multi-channel, multiply by number of channels
            uint bufferSize = samples * sizeof(float);
            AudioFrame frame = new Windows.Media.AudioFrame(bufferSize);

            using (AudioBuffer buffer = frame.LockBuffer(AudioBufferAccessMode.Write))
            using (IMemoryBufferReference reference = buffer.CreateReference())
            {
                byte* dataInBytes;
                uint capacityInBytes;
                float* dataInFloat;

                // Get the buffer from the AudioFrame
                ((IMemoryBufferByteAccess)reference).GetBuffer(out dataInBytes, out capacityInBytes);

                // Cast to float since the data we are generating is float
                dataInFloat = (float*)dataInBytes;

                float freq = 1000; // choosing to generate frequency of 1kHz
                float amplitude = 0.3f;
                int sampleRate = (int)graph.EncodingProperties.SampleRate;
                double sampleIncrement = (freq * (Math.PI * 2)) / sampleRate;

                // Generate a 1kHz sine wave and populate the values in the memory buffer
                for (int i = 0; i < samples; i++)
                {
                    double sinValue = amplitude * Math.Sin(theta);
                    dataInFloat[i] = (float)sinValue;
                    theta += sampleIncrement;
                }
            }

            return frame;
        }

void node_QuantumStarted | ( | AudioFrameInputNode | sender,
 |  | FrameInputNodeQuantumStartedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 172 of file Scenario3_FrameInputNode.xaml.cs.

        {
            // GenerateAudioData can provide PCM audio data by directly synthesizing it or reading from a file.
            // Need to know how many samples are required. In this case, the node is running at the same rate as the rest of the graph
            // For minimum latency, only provide the required amount of samples. Extra samples will introduce additional latency.
            uint numSamplesNeeded = (uint) args.RequiredSamples;

            if(numSamplesNeeded != 0)
            {
                AudioFrame audioData = GenerateAudioData(numSamplesNeeded);
                frameInputNode.AddFrame(audioData);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 65 of file Scenario3_FrameInputNode.xaml.cs.

        {
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario3_FrameInputNode.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CreateAudioGraph();
        }

Member Data Documentation

AudioDeviceOutputNode deviceOutputNode [private]

Definition at line 50 of file Scenario3_FrameInputNode.xaml.cs.

AudioFrameInputNode frameInputNode [private]

Definition at line 51 of file Scenario3_FrameInputNode.xaml.cs.

AudioGraph graph [private]

Definition at line 49 of file Scenario3_FrameInputNode.xaml.cs.

MainPage rootPage [private]

Definition at line 48 of file Scenario3_FrameInputNode.xaml.cs.

double theta = 0

Definition at line 52 of file Scenario3_FrameInputNode.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario3_FrameInputNode.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Submix Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario4_Submix
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_Submix Class Reference

Shows use of a SubMix node with an effect applied to it.

List of all members.

Public Member Functions

Scenario4_Submix ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateAudioGraph ()
void | EchoEffectToggle_Toggled (object sender, RoutedEventArgs e)
async void | File1_Click (object sender, RoutedEventArgs e)
async void | File2_Click (object sender, RoutedEventArgs e)
void | GraphButton_Click (object sender, RoutedEventArgs e)
void | TogglePlay ()

Private Attributes

AudioDeviceOutputNode | deviceOutputNode
EchoEffectDefinition | echoEffect
AudioFileInputNode | fileInputNode1
AudioFileInputNode | fileInputNode2
AudioGraph | graph
MainPage rootPage
AudioSubmixNode | submixNode

Detailed Description

Definition at line 32 of file Scenario4_Submix.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Submix ( ) [inline]

Definition at line 41 of file Scenario4_Submix.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 209 of file Scenario4_Submix.xaml.cs.

        {
            // Create an AudioGraph with default setting
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Can't create the graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;

            // Create a device output node
            CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();

            if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output node
                rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                speakerContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
            speakerContainer.Background = new SolidColorBrush(Colors.Green);

            submixNode = graph.CreateSubmixNode();
            submixNodeContainer.Background = new SolidColorBrush(Colors.Green);
            submixNode.AddOutgoingConnection(deviceOutputNode);

            echoEffect = new EchoEffectDefinition(graph);
            echoEffect.WetDryMix = 0.7f;
            echoEffect.Feedback = 0.5f;
            echoEffect.Delay = 500.0f;
            submixNode.EffectDefinitions.Add(echoEffect);

            // Disable the effect in the beginning. Enable in response to user action (UI toggle switch)
            submixNode.DisableEffectsByDefinition(echoEffect);

            // All nodes can have an OutgoingGain property
            // Setting the gain on the Submix node attenuates the output of the node
            submixNode.OutgoingGain = 0.5;

            // Graph successfully created. Enable buttons to load files
            fileButton1.IsEnabled = true;
            fileButton2.IsEnabled = true;
        }

void EchoEffectToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 195 of file Scenario4_Submix.xaml.cs.

        {
            // Enable/Disable the echo effect
            // Also set the label for the UI
            if (echoEffectToggle.IsOn)
            {
                submixNode.EnableEffectsByDefinition(echoEffect);
            }
            else
            {
                submixNode.DisableEffectsByDefinition(echoEffect);
            }
        }

async void File1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario4_Submix.xaml.cs.

        {
            // If another file is already loaded into the FileInput node
            if (fileInputNode1 != null)
            {
                // Release the file and dispose the contents of the node
                fileInputNode1.Dispose();
                // Stop playback since a new file is being loaded. Also reset the button UI
                if (graphButton.Content.Equals("Stop Graph"))
                {
                    TogglePlay();
                }
            }

            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.FileTypeFilter.Add(".mp3");
            filePicker.FileTypeFilter.Add(".wma");
            filePicker.FileTypeFilter.Add(".wav");
            filePicker.ViewMode = PickerViewMode.Thumbnail;
            StorageFile file1 = await filePicker.PickSingleFileAsync();

            // File can be null if cancel is hit in the file picker
            if (file1 == null)
            {
                return;
            }

            CreateAudioFileInputNodeResult fileInputNodeResult = await graph.CreateFileInputNodeAsync(file1);
            if (fileInputNodeResult.Status != AudioFileNodeCreationStatus.Success)
            {
                // Cannot read input file
                rootPage.NotifyUser(String.Format("Can't read input file1 because {0}", fileInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            fileInputNode1 = fileInputNodeResult.FileInputNode;
            // Since we are going to play two files simultaneously, set outgoing gain to 0.5 to prevent clipping
            fileInputNode1.AddOutgoingConnection(submixNode, 0.5);

            // The graph might already be playing, so set up UI accordingly
            if (graphButton.Content.Equals("Stop Graph"))
            {
                audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
            }

            // UI tasks: enable buttons, show status message and change color of the input node box
            graphButton.IsEnabled = true;
            echoEffectToggle.IsEnabled = true;
            rootPage.NotifyUser("Loaded File 1", NotifyType.StatusMessage);
            fileButton1.Background = new SolidColorBrush(Colors.Green);
        }

async void File2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 113 of file Scenario4_Submix.xaml.cs.

        {
            // If another file is already loaded into the FileInput node
            if (fileInputNode2 != null)
            {
                // Release the file and dispose the contents of the node
                fileInputNode2.Dispose();
                // Stop playback since a new file is being loaded. Also reset the button UI
                if (graphButton.Content.Equals("Stop Graph"))
                {
                    TogglePlay();
                }
            }

            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.FileTypeFilter.Add(".mp3");
            filePicker.ViewMode = PickerViewMode.Thumbnail;
            StorageFile file2 = await filePicker.PickSingleFileAsync();

            // File can be null if cancel is hit in the file picker
            if (file2 == null)
            {
                return;
            }

            CreateAudioFileInputNodeResult fileInputNodeResult = await graph.CreateFileInputNodeAsync(file2);
            if (fileInputNodeResult.Status != AudioFileNodeCreationStatus.Success)
            {
                // Cannot read input file
                rootPage.NotifyUser(String.Format("Can't read input file2 because {0}", fileInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            fileInputNode2 = fileInputNodeResult.FileInputNode;
            // Since we are going to play two files simultaneously, set outgoing gain to 0.5 to prevent clipping
            fileInputNode2.AddOutgoingConnection(submixNode, 0.5);

            // The graph might already be playing, so set up UI accordingly
            if (graphButton.Content.Equals("Stop Graph"))
            {
                audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
            }

            // UI tasks: enable buttons, show status message and change color of the input node box
            graphButton.IsEnabled = true;
            echoEffectToggle.IsEnabled = true;
            rootPage.NotifyUser("Loaded File 2", NotifyType.StatusMessage);
            fileButton2.Background = new SolidColorBrush(Colors.Green);
        }

void GraphButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 164 of file Scenario4_Submix.xaml.cs.

        {
            TogglePlay();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario4_Submix.xaml.cs.

        {
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario4_Submix.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CreateAudioGraph();
        }

void TogglePlay ( ) [inline, private]

Definition at line 169 of file Scenario4_Submix.xaml.cs.

        {
            if (graphButton.Content.Equals("Start Graph"))
            {
                graph.Start();
                graphButton.Content = "Stop Graph";
                audioPipe3.Fill = new SolidColorBrush(Colors.Blue);
                if (fileInputNode1 != null)
                {
                    audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
                }
                if (fileInputNode2 != null)
                {
                    audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
                }
            }
            else if (graphButton.Content.Equals("Stop Graph"))
            {
                graph.Stop();
                graphButton.Content = "Start Graph";
                audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
                audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
                audioPipe3.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            }
        }

Member Data Documentation

AudioDeviceOutputNode deviceOutputNode [private]

Definition at line 38 of file Scenario4_Submix.xaml.cs.

EchoEffectDefinition echoEffect [private]

Definition at line 39 of file Scenario4_Submix.xaml.cs.

AudioFileInputNode fileInputNode1 [private]

Definition at line 36 of file Scenario4_Submix.xaml.cs.

AudioFileInputNode fileInputNode2 [private]

Definition at line 36 of file Scenario4_Submix.xaml.cs.

AudioGraph graph [private]

Definition at line 35 of file Scenario4_Submix.xaml.cs.

MainPage rootPage [private]

Definition at line 34 of file Scenario4_Submix.xaml.cs.

AudioSubmixNode submixNode [private]

Definition at line 37 of file Scenario4_Submix.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario4_Submix.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_InboxEffects Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario5_InboxEffects
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_InboxEffects Class Reference

This scenario is to demonstrate the use of Built-In Effects.

List of all members.

Public Member Functions

Scenario5_InboxEffects ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

double | ConvertRange (double value)
async Task | CreateAudioGraph ()
void | CreateEchoEffect ()
void | CreateEqEffect ()
void | CreateLimiterEffect ()
void | CreateReverbEffect ()
void | DecaySlider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | EchoEffectToggle_Toggled (object sender, RoutedEventArgs e)
void | EchoSlider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | Eq1Slider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | Eq2Slider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | Eq3Slider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | Eq4Slider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | EqToggle_Toggled (object sender, RoutedEventArgs e)
async void | File_Click (object sender, RoutedEventArgs e)
void | Graph_Click (object sender, RoutedEventArgs e)
void | LimiterEffectToggle_Toggled (object sender, RoutedEventArgs e)
void | LoudnessSlider_ValueChanged (object sender, RangeBaseValueChangedEventArgs e)
void | ReverbEffectToggle_Toggled (object sender, RoutedEventArgs e)
void | TogglePlay ()

Private Attributes

AudioDeviceOutputNode | deviceOutputNode
EchoEffectDefinition | echoEffectDefinition
EqualizerEffectDefinition | eqEffectDefinition
AudioFileInputNode | fileInputNode
AudioGraph | graph
LimiterEffectDefinition | limiterEffectDefinition
ReverbEffectDefinition | reverbEffectDefinition
MainPage rootPage

Detailed Description

Definition at line 33 of file Scenario5_InboxEffects.xaml.cs.

Constructor & Destructor Documentation

Scenario5_InboxEffects ( ) [inline]

Definition at line 44 of file Scenario5_InboxEffects.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

double ConvertRange ( double value ) [inline, private]

Definition at line 255 of file Scenario5_InboxEffects.xaml.cs.

        {
            // These are the same values as the ones in xapofx.h
            const double fxeq_min_gain = 0.126;
            const double fxeq_max_gain = 7.94;

            double scale = (fxeq_max_gain - fxeq_min_gain)/100;
            return (fxeq_min_gain + ((value) * scale));
        }

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 371 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Create an AudioGraph with default settings
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Cannot create graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;

            // Create a device output node
            CreateAudioDeviceOutputNodeResult outputDeviceNodeResult = await graph.CreateDeviceOutputNodeAsync();

            if (outputDeviceNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output node
                rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", outputDeviceNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                speakerContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceOutputNode = outputDeviceNodeResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
            speakerContainer.Background = new SolidColorBrush(Colors.Green);
        }

void CreateEchoEffect ( ) [inline, private]

Definition at line 302 of file Scenario5_InboxEffects.xaml.cs.

        {
            // create echo effect
            echoEffectDefinition = new EchoEffectDefinition(graph);

            // See the MSDN page for parameter explanations
            // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xapofx.fxecho_parameters(v=vs.85).aspx
            echoEffectDefinition.WetDryMix    = 0.7f;
            echoEffectDefinition.Feedback     = 0.5f;
            echoEffectDefinition.Delay        = 500.0f;

            fileInputNode.EffectDefinitions.Add(echoEffectDefinition);
            fileInputNode.DisableEffectsByDefinition(echoEffectDefinition);
        }

void CreateEqEffect ( ) [inline, private]

Definition at line 346 of file Scenario5_InboxEffects.xaml.cs.

        {
            // See the MSDN page for parameter explanations
            // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xapofx.fxeq_parameters(v=vs.85).aspx
            eqEffectDefinition = new EqualizerEffectDefinition(graph);
            eqEffectDefinition.Bands[0].FrequencyCenter   = 100.0f;
            eqEffectDefinition.Bands[0].Gain              = 4.033f;
            eqEffectDefinition.Bands[0].Bandwidth         = 1.5f;

            eqEffectDefinition.Bands[1].FrequencyCenter   = 900.0f;
            eqEffectDefinition.Bands[1].Gain              = 1.6888f;
            eqEffectDefinition.Bands[1].Bandwidth         = 1.5f;

            eqEffectDefinition.Bands[2].FrequencyCenter   = 5000.0f;
            eqEffectDefinition.Bands[2].Gain              = 2.4702f;
            eqEffectDefinition.Bands[2].Bandwidth         = 1.5f;

            eqEffectDefinition.Bands[3].FrequencyCenter   = 12000.0f;
            eqEffectDefinition.Bands[3].Gain              = 5.5958f;
            eqEffectDefinition.Bands[3].Bandwidth         = 2.0f;

            fileInputNode.EffectDefinitions.Add(eqEffectDefinition);
            fileInputNode.DisableEffectsByDefinition(eqEffectDefinition);
        }

void CreateLimiterEffect ( ) [inline, private]

Definition at line 334 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Create limiter effect
            limiterEffectDefinition = new LimiterEffectDefinition(graph);

            limiterEffectDefinition.Loudness = 1000;
            limiterEffectDefinition.Release = 10;

            fileInputNode.EffectDefinitions.Add(limiterEffectDefinition);
            fileInputNode.DisableEffectsByDefinition(limiterEffectDefinition);
        }

void CreateReverbEffect ( ) [inline, private]

Definition at line 317 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Create reverb effect
            reverbEffectDefinition = new ReverbEffectDefinition(graph);

            // See the MSDN page for parameter explanations
            // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xaudio2.xaudio2fx_reverb_parameters(v=vs.85).aspx
            reverbEffectDefinition.WetDryMix          = 50;
            reverbEffectDefinition.ReflectionsDelay   = 120;
            reverbEffectDefinition.ReverbDelay        = 30;
            reverbEffectDefinition.RearDelay          = 3;
            reverbEffectDefinition.DecayTime          = 2;

            fileInputNode.EffectDefinitions.Add(reverbEffectDefinition);
            fileInputNode.DisableEffectsByDefinition(reverbEffectDefinition);
        }

void DecaySlider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 186 of file Scenario5_InboxEffects.xaml.cs.

        {
            if(reverbEffectDefinition != null)
            {
                double currentValue = decaySlider.Value;
                decayLabel.Text = "Decay: " + currentValue.ToString() + "  s";
                reverbEffectDefinition.DecayTime = currentValue;
            }
        }

void EchoEffectToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 140 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Enable/Disable the effect in the graph
            // Also enable/disable the associated UI for effect parameters
            if (echoEffectToggle.IsOn)
            {
                echoSlider.IsEnabled = true;
                echoLabel.Foreground = new SolidColorBrush(Colors.White);
                fileInputNode.EnableEffectsByDefinition(echoEffectDefinition);
            }
            else
            {
                echoSlider.IsEnabled = false;
                echoLabel.Foreground = new SolidColorBrush(Color.FromArgb(255,74,74,74));
                fileInputNode.DisableEffectsByDefinition(echoEffectDefinition);
            }
        }

void EchoSlider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 158 of file Scenario5_InboxEffects.xaml.cs.

        {
            if(echoEffectDefinition != null)
            {
                int currentValue = (int)echoSlider.Value;
                echoLabel.Text = "Delay: " + currentValue.ToString() + "ms";
                echoEffectDefinition.Delay = currentValue;
            }
        }

void Eq1Slider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 266 of file Scenario5_InboxEffects.xaml.cs.

        {
            if(eqEffectDefinition != null)
            {
                double currentValue = ConvertRange(eq1Slider.Value);
                eqEffectDefinition.Bands[0].Gain = currentValue;
            }
        }

void Eq2Slider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 275 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (eqEffectDefinition != null)
            {
                double currentValue = ConvertRange(eq2Slider.Value);
                eqEffectDefinition.Bands[1].Gain = currentValue;
            }
        }

void Eq3Slider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 284 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (eqEffectDefinition != null)
            {
                double currentValue = ConvertRange(eq3Slider.Value);
                eqEffectDefinition.Bands[2].Gain = currentValue;
            }
        }

void Eq4Slider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 293 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (eqEffectDefinition != null)
            {
                double currentValue = ConvertRange(eq4Slider.Value);
                eqEffectDefinition.Bands[3].Gain = currentValue;
            }
        }

void EqToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 224 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Enable/Disable the effect in the graph
            // Also enable/disable the associated UI for effect parameters
            if (eqToggle.IsOn)
            {
                eq1Slider.IsEnabled = true;
                eq2Slider.IsEnabled = true;
                eq3Slider.IsEnabled = true;
                eq4Slider.IsEnabled = true;
                eq1SliderLabel.Foreground = new SolidColorBrush(Colors.White);
                eq2SliderLabel.Foreground = new SolidColorBrush(Colors.White);
                eq3SliderLabel.Foreground = new SolidColorBrush(Colors.White);
                eq4SliderLabel.Foreground = new SolidColorBrush(Colors.White);
                fileInputNode.EnableEffectsByDefinition(eqEffectDefinition);
            }
            else
            {
                eq1Slider.IsEnabled = false;
                eq2Slider.IsEnabled = false;
                eq3Slider.IsEnabled = false;
                eq4Slider.IsEnabled = false;
                eq1SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                eq2SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                eq3SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                eq4SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                fileInputNode.DisableEffectsByDefinition(eqEffectDefinition);
            }
        }

async void File_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario5_InboxEffects.xaml.cs.

        {
            // If another file is already loaded into the FileInput node
            if (fileInputNode != null)
            {
                // Release the file and dispose the contents of the node
                fileInputNode.Dispose();
                // Stop playback since a new file is being loaded. Also reset the button UI
                if (graphButton.Content.Equals("Stop Graph"))
                {
                    TogglePlay();
                }
            }

            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.FileTypeFilter.Add(".mp3");
            filePicker.FileTypeFilter.Add(".wma");
            filePicker.FileTypeFilter.Add(".wav");
            filePicker.ViewMode = PickerViewMode.Thumbnail;
            StorageFile file = await filePicker.PickSingleFileAsync();

            // File can be null if cancel is hit in the file picker
            if (file == null)
            {
                return;
            }

            CreateAudioFileInputNodeResult fileInputResult = await graph.CreateFileInputNodeAsync(file);
            if (fileInputResult.Status != AudioFileNodeCreationStatus.Success)
            {
                // Error reading the input file
                rootPage.NotifyUser(String.Format("Can't read input file because {0}", fileInputResult.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            // File loaded successfully. Enable these buttons in the UI
            graphButton.IsEnabled           = true;
            echoEffectToggle.IsEnabled      = true;
            reverbEffectToggle.IsEnabled    = true;
            limiterEffectToggle.IsEnabled   = true;
            eqToggle.IsEnabled              = true;

            fileInputNode = fileInputResult.FileInputNode;
            fileInputNode.AddOutgoingConnection(deviceOutputNode);

            rootPage.NotifyUser("Successfully loaded input file", NotifyType.StatusMessage);
            fileButton.Background = new SolidColorBrush(Colors.Green);

            // Create the four inbox effects
            CreateEchoEffect();
            CreateReverbEffect();
            CreateLimiterEffect();
            CreateEqEffect();
        }

void Graph_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 119 of file Scenario5_InboxEffects.xaml.cs.

        {
            TogglePlay();
        }

void LimiterEffectToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 196 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Enable/Disable the effect in the graph
            // Also enable/disable the associated UI for effect parameters
            if (limiterEffectToggle.IsOn)
            {
                loudnessSlider.IsEnabled = true;
                loudnessLabel.Foreground = new SolidColorBrush(Colors.White);
                fileInputNode.EnableEffectsByDefinition(limiterEffectDefinition);
            }
            else
            {
                loudnessSlider.IsEnabled = false;
                loudnessLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                fileInputNode.DisableEffectsByDefinition(limiterEffectDefinition);
            }
        }

void LoudnessSlider_ValueChanged | ( | object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 214 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (limiterEffectDefinition!= null)
            {
                uint currentValue = (uint)loudnessSlider.Value;
                limiterEffectDefinition.Loudness = currentValue;
                loudnessLabel.Text = "Loudness: " + currentValue.ToString();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 55 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario5_InboxEffects.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CreateAudioGraph();
        }

void ReverbEffectToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 168 of file Scenario5_InboxEffects.xaml.cs.

        {
            // Enable/Disable the effect in the graph
            // Also enable/disable the associated UI for effect parameters
            if (reverbEffectToggle.IsOn)
            {
                decaySlider.IsEnabled = true;
                decayLabel.Foreground = new SolidColorBrush(Colors.White);
                fileInputNode.EnableEffectsByDefinition(reverbEffectDefinition);
            }
            else
            {
                decaySlider.IsEnabled = false;
                decayLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
                fileInputNode.DisableEffectsByDefinition(reverbEffectDefinition);
            }
        }

void TogglePlay ( ) [inline, private]

Definition at line 124 of file Scenario5_InboxEffects.xaml.cs.

        {
            if (graphButton.Content.Equals("Start Graph"))
            {
                graph.Start();
                graphButton.Content = "Stop Graph";
                audioPipe.Fill = new SolidColorBrush(Colors.Blue);
            }
            else
            {
                graph.Stop();
                graphButton.Content = "Start Graph";
                audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            }
        }

Member Data Documentation

AudioDeviceOutputNode deviceOutputNode [private]

Definition at line 38 of file Scenario5_InboxEffects.xaml.cs.

EchoEffectDefinition echoEffectDefinition [private]

Definition at line 39 of file Scenario5_InboxEffects.xaml.cs.

EqualizerEffectDefinition eqEffectDefinition [private]

Definition at line 41 of file Scenario5_InboxEffects.xaml.cs.

AudioFileInputNode fileInputNode [private]

Definition at line 37 of file Scenario5_InboxEffects.xaml.cs.

AudioGraph graph [private]

Definition at line 36 of file Scenario5_InboxEffects.xaml.cs.

LimiterEffectDefinition limiterEffectDefinition [private]

Definition at line 42 of file Scenario5_InboxEffects.xaml.cs.

ReverbEffectDefinition reverbEffectDefinition [private]

Definition at line 40 of file Scenario5_InboxEffects.xaml.cs.

MainPage rootPage [private]

Definition at line 35 of file Scenario5_InboxEffects.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario5_InboxEffects.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_CustomEffects Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • AudioCreation
  • Scenario6_CustomEffects
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_CustomEffects Class Reference

Using custom effects with the AudioGraph API.

List of all members.

Public Member Functions

Scenario6_CustomEffects ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddCustomEffect ()
async Task | CreateAudioGraph ()
async void | File_Click (object sender, RoutedEventArgs e)
async void | FileInput_FileCompleted (AudioFileInputNode sender, object args)
void | Graph_Click (object sender, RoutedEventArgs e)
async Task | SelectInputFile ()
void | TogglePlay ()

Private Attributes

AudioDeviceOutputNode | deviceOutputNode
AudioFileInputNode | fileInputNode
AudioGraph | graph
MainPage rootPage

Detailed Description

Definition at line 35 of file Scenario6_CustomEffects.xaml.cs.

Constructor & Destructor Documentation

Scenario6_CustomEffects ( ) [inline]

Definition at line 42 of file Scenario6_CustomEffects.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddCustomEffect ( ) [inline, private]

Definition at line 167 of file Scenario6_CustomEffects.xaml.cs.

        {
            // Create a property set and add a property/value pair
            PropertySet echoProperties = new PropertySet();
            echoProperties.Add("Mix", 0.5f);

            // Instantiate the custom effect defined in the 'CustomEffect' project
            AudioEffectDefinition echoEffectDefinition = new AudioEffectDefinition(typeof(AudioEchoEffect).FullName, echoProperties);
            fileInputNode.EffectDefinitions.Add(echoEffectDefinition);
        }

async Task CreateAudioGraph ( ) [inline, private]

Definition at line 136 of file Scenario6_CustomEffects.xaml.cs.

        {
            // Create an AudioGraph with default settings
            AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
            CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);

            if (result.Status != AudioGraphCreationStatus.Success)
            {
                // Cannot create graph
                rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            graph = result.Graph;

            // Create a device output node
            CreateAudioDeviceOutputNodeResult deviceOutputResult = await graph.CreateDeviceOutputNodeAsync();

            if (deviceOutputResult.Status != AudioDeviceNodeCreationStatus.Success)
            {
                // Cannot create device output
                rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputResult.Status.ToString()), NotifyType.ErrorMessage);
                speakerContainer.Background = new SolidColorBrush(Colors.Red);
                return;
            }

            deviceOutputNode = deviceOutputResult.DeviceOutputNode;
            rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
            speakerContainer.Background = new SolidColorBrush(Colors.Green);
        }

async void File_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario6_CustomEffects.xaml.cs.

        {
            await SelectInputFile();
        }

async void FileInput_FileCompleted | ( | AudioFileInputNode | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 179 of file Scenario6_CustomEffects.xaml.cs.

        {
            // File playback is done. Stop the graph
            graph.Stop();

            // Reset the file input node so starting the graph will resume playback from beginning of the file
            sender.Reset();

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("End of file reached", NotifyType.StatusMessage);
                graphButton.Content = "Start Graph";
            });
        }

void Graph_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario6_CustomEffects.xaml.cs.

        {
            TogglePlay();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file Scenario6_CustomEffects.xaml.cs.

        {
            if (graph != null)
            {
                graph.Dispose();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario6_CustomEffects.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CreateAudioGraph();
        }

async Task SelectInputFile ( ) [inline, private]

Definition at line 66 of file Scenario6_CustomEffects.xaml.cs.

        {
            // If another file is already loaded into the FileInput node
            if (fileInputNode != null)
            {
                // Release the file and dispose the contents of the node
                fileInputNode.Dispose();
                // Stop playback since a new file is being loaded. Also reset the button UI
                if (graphButton.Content.Equals("Stop Graph"))
                {
                    TogglePlay();
                }
            }

            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.FileTypeFilter.Add(".mp3");
            filePicker.ViewMode = PickerViewMode.Thumbnail;
            StorageFile file = await filePicker.PickSingleFileAsync();

            // File can be null if cancel is hit in the file picker
            if (file == null)
            {
                return;
            }

            CreateAudioFileInputNodeResult fileInputNodeResult = await graph.CreateFileInputNodeAsync(file);
            if (fileInputNodeResult.Status != AudioFileNodeCreationStatus.Success)
            {
                // Cannot read file
                rootPage.NotifyUser(String.Format("Cannot read input file because {0}", fileInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
                return;
            }

            fileInputNode = fileInputNodeResult.FileInputNode;
            fileInputNode.AddOutgoingConnection(deviceOutputNode);
            fileButton.Background = new SolidColorBrush(Colors.Green);

            // Event Handler for file completion
            fileInputNode.FileCompleted += FileInput_FileCompleted;

            // Enable the button to start the graph
            graphButton.IsEnabled = true;

            // Create the custom effect and apply to the FileInput node
            AddCustomEffect();
        }

void TogglePlay ( ) [inline, private]

Definition at line 119 of file Scenario6_CustomEffects.xaml.cs.

        {
            // Toggle playback
            if (graphButton.Content.Equals("Start Graph"))
            {
                graph.Start();
                graphButton.Content = "Stop Graph";
                audioPipe.Fill = new SolidColorBrush(Colors.Blue);
            }
            else
            {
                graph.Stop();
                graphButton.Content = "Start Graph";
                audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
            }
        }

Member Data Documentation

AudioDeviceOutputNode deviceOutputNode [private]

Definition at line 40 of file Scenario6_CustomEffects.xaml.cs.

AudioFileInputNode fileInputNode [private]

Definition at line 39 of file Scenario6_CustomEffects.xaml.cs.

AudioGraph graph [private]

Definition at line 38 of file Scenario6_CustomEffects.xaml.cs.

MainPage rootPage [private]

Definition at line 37 of file Scenario6_CustomEffects.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/AudioCreation/Scenario6_CustomEffects.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioFileReader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AudioFileReader Class Reference

#include "AudioFileReader.h"

List of all members.

Public Member Functions

virtual | ~AudioFileReader ()
virtual | ~AudioFileReader ()
const BYTE * | GetData () const
const BYTE * | GetData () const
const WAVEFORMATEX * | GetFormat () const
const WAVEFORMATEX * | GetFormat () const
size_t | GetSize () const
size_t | GetSize () const
HRESULT | Initialize (_In_ LPCWSTR filename)
HRESULT | Initialize (_In_ LPCWSTR filename)

Private Attributes

std::vector< BYTE > | _audioData
WAVEFORMATEX | _format

Detailed Description

Definition at line 18 of file AudioFileReader.h.

Constructor & Destructor Documentation

virtual ~AudioFileReader ( ) [inline, virtual]

Definition at line 21 of file AudioFileReader.h.

{}

virtual ~AudioFileReader ( ) [inline, virtual]

Definition at line 20 of file AudioFileReader.h.

{}

Member Function Documentation

const BYTE* GetData ( ) const [inline]

Definition at line 34 of file AudioFileReader.h.

    {
        return _audioData.data();
    }

const BYTE* GetData ( ) const [inline]

Definition at line 33 of file AudioFileReader.h.

    {
        return _audioData.data();
    }

const WAVEFORMATEX* GetFormat ( ) const [inline]

Definition at line 24 of file AudioFileReader.h.

    {
        return &_format;
    }

const WAVEFORMATEX* GetFormat ( ) const [inline]

Definition at line 23 of file AudioFileReader.h.

    {
        return &_format;
    }

size_t GetSize ( ) const [inline]

Definition at line 28 of file AudioFileReader.h.

    {
        return _audioData.size();
    }

size_t GetSize ( ) const [inline]

Definition at line 29 of file AudioFileReader.h.

    {
        return _audioData.size();
    }

HRESULT Initialize ( _In_ LPCWSTR filename )
HRESULT Initialize ( _In_ LPCWSTR filename )

Member Data Documentation

std::vector< BYTE > _audioData [private]

Definition at line 41 of file AudioFileReader.h.

WAVEFORMATEX _format [private]

Definition at line 40 of file AudioFileReader.h.

The documentation for this class was generated from the following files:
  • HolographicVoiceInput/cpp/Audio/AudioFileReader.h
  • SpatialSound/cpp/AudioFileReader.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioStreamReader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AudioStreamReader Class Reference

#include "AudioStreamReader.h"

List of all members.

Public Member Functions

virtual | ~AudioStreamReader ()
const BYTE * | GetData () const
const WAVEFORMATEX * | GetFormat () const
size_t | GetSize () const
HRESULT | Initialize (_In_ Windows::Media::SpeechSynthesis::SpeechSynthesisStream^speechSynthesisStream)

Private Attributes

std::vector< BYTE > | _audioData
WAVEFORMATEX | _format

Detailed Description

Definition at line 18 of file AudioStreamReader.h.

Constructor & Destructor Documentation

virtual ~AudioStreamReader ( ) [inline, virtual]

Definition at line 21 of file AudioStreamReader.h.

{}

Member Function Documentation

const BYTE* GetData ( ) const [inline]

Definition at line 34 of file AudioStreamReader.h.

    {
        return _audioData.data();
    }

const WAVEFORMATEX* GetFormat ( ) const [inline]

Definition at line 24 of file AudioStreamReader.h.

    {
        return &_format;
    }

size_t GetSize ( ) const [inline]

Definition at line 29 of file AudioStreamReader.h.

    {
        return _audioData.size();
    }

HRESULT Initialize ( _In_ Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ speechSynthesisStream )

Member Data Documentation

std::vector<BYTE> _audioData [private]

Definition at line 41 of file AudioStreamReader.h.

WAVEFORMATEX _format [private]

Definition at line 40 of file AudioStreamReader.h.

The documentation for this class was generated from the following file:
  • HolographicVoiceInput/cpp/Audio/AudioStreamReader.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AutoLock Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

AutoLock Class Reference

#include "CritSec.h"

List of all members.

Public Member Functions

_Acquires_lock_ (m_pCriticalSection) AutoLock(CritSec &crit)
_Releases_lock_ (m_pCriticalSection)~AutoLock()

Private Attributes

CritSec * m_pCriticalSection

Detailed Description

Definition at line 45 of file CritSec.h.

Member Function Documentation

_Acquires_lock_ ( m_pCriticalSection ) [inline]

Definition at line 50 of file CritSec.h.

    {
        m_pCriticalSection = &crit;
        m_pCriticalSection->Lock();
    }

_Releases_lock_ ( m_pCriticalSection ) [inline]

Definition at line 57 of file CritSec.h.

    {
        m_pCriticalSection->Unlock();
    }

Member Data Documentation

CritSec* m_pCriticalSection [private]

Definition at line 48 of file CritSec.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/CritSec.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundDeviceWatcherTaskCpp
  • sealed
Public Member Functions

sealed Class Reference

#include "BackgroundDeviceWatcherTask.h"

List of all members.

Public Member Functions

BackgroundDeviceWatcher ()
virtual void Run (IBackgroundTaskInstance^taskInstance)

Detailed Description

Definition at line 10 of file BackgroundDeviceWatcherTask.h.

Member Function Documentation

BackgroundDeviceWatcher ( ) [inline]

Definition at line 13 of file BackgroundDeviceWatcherTask.h.

{}

virtual void Run ( IBackgroundTaskInstance^ taskInstance ) [virtual]
The documentation for this class was generated from the following file:
  • DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.h
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundDeviceWatcherTaskCs
  • BackgroundDeviceWatcher
Public Member Functions

BackgroundDeviceWatcher Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 17 of file BackgroundDeviceWatcher.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 19 of file BackgroundDeviceWatcher.cs.

        {
            Debug.WriteLine("BackgroundDeviceWatcher.Run called");

            uint eventCount = 0;
            ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
            DeviceWatcherTriggerDetails triggerDetails = (DeviceWatcherTriggerDetails)taskInstance.TriggerDetails;

            Debug.WriteLine(String.Format("Trigger contains {0} events", triggerDetails.DeviceWatcherEvents.Count));

            foreach (DeviceWatcherEvent e in triggerDetails.DeviceWatcherEvents)
            {
                switch (e.Kind)
                {
                case DeviceWatcherEventKind.Add:
                    Debug.WriteLine("Add: " + e.DeviceInformation.Id);
                    break;

                case DeviceWatcherEventKind.Update:
                    Debug.WriteLine("Update: " + e.DeviceInformationUpdate.Id);
                    break;

                case DeviceWatcherEventKind.Remove:
                    Debug.WriteLine("Remove: " + e.DeviceInformationUpdate.Id);
                    break;
                }
            };

            if (null != settings.Values["eventCount"] &&
                settings.Values["eventCount"].GetType() == typeof(uint))
            {
                eventCount = (uint)settings.Values["eventCount"];
            }

            // Add the number of events for this trigger to the number of events received in the past
            eventCount += (uint)triggerDetails.DeviceWatcherEvents.Count;

            Debug.WriteLine(eventCount + " events processed for lifetime of trigger");

            settings.Values["eventCount"] = eventCount;
        }

The documentation for this class was generated from the following file:
  • DeviceEnumerationAndPairing/cs/Tasks/BackgroundDeviceWatcher.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • DataModels
  • MediaItem
Public Member Functions | Public Attributes | Properties | Private Attributes

MediaItem Class Reference

Inherited by MusicItem, and VideoItem.

List of all members.

Public Member Functions

MediaItem ()
MediaItem (JsonObject json)
virtual MediaPlaybackItem | ToPlaybackItem ()

Public Attributes

const string | MediaItemIdKey = "mediaItemId"

Properties

string | ItemId [get, set]
Uri | MediaUri [get, set]
virtual Uri | PreviewImageUri [get, set]
string | Title [get, set]

Private Attributes

Uri | previewImageUri

Detailed Description

Definition at line 25 of file MediaItem.cs.

Constructor & Destructor Documentation

MediaItem ( ) [inline]

Definition at line 49 of file MediaItem.cs.

        {
        }

MediaItem ( JsonObject json ) [inline]

Definition at line 53 of file MediaItem.cs.

                                          : this()
        {
            ItemId = json.GetNamedString("id", Guid.NewGuid().ToString());
            Title = json.GetNamedString("title", string.Empty);

            if (json.Keys.Contains("mediaUri"))
                MediaUri = new Uri(json.GetNamedString("mediaUri"));
        }

Member Function Documentation

virtual MediaPlaybackItem ToPlaybackItem ( ) [inline, virtual]

Reimplemented in MusicItem, and VideoItem.

Definition at line 62 of file MediaItem.cs.

        {
            // Create the media source from the Uri
            var source = MediaSource.CreateFromUri(MediaUri);

            // Create a configurable playback item backed by the media source
            var playbackItem = new MediaPlaybackItem(source);

            // Populate display properties for the item that will be used
            // to automatically update SystemMediaTransportControls when
            // the item is playing.
            var displayProperties = playbackItem.GetDisplayProperties();

            // Populate thumbnail
            if (PreviewImageUri != null)
                displayProperties.Thumbnail = RandomAccessStreamReference.CreateFromUri(PreviewImageUri);

            // Apply properties to the playback item
            playbackItem.ApplyDisplayProperties(displayProperties);

            // It's often useful to save a reference or ID to correlate
            // a particular MediaPlaybackItem with the item from the
            // backing data model. CustomProperties stores serializable
            // types, so here we use the media item's URI as the
            // playback item's unique ID. You are also free to use your own
            // external dictionary if you want to reference non-serializable
            // types.
            source.CustomProperties[MediaItem.MediaItemIdKey] = ItemId;

            return playbackItem;
        }

Member Data Documentation

const string MediaItemIdKey = "mediaItemId"

Definition at line 27 of file MediaItem.cs.

Uri previewImageUri [private]

Definition at line 29 of file MediaItem.cs.

Property Documentation

string ItemId [get, set]

Definition at line 31 of file MediaItem.cs.

Uri MediaUri [get, set]

Definition at line 35 of file MediaItem.cs.

virtual Uri PreviewImageUri [get, set]

Reimplemented in MusicItem, and VideoItem.

Definition at line 38 of file MediaItem.cs.

string Title [get, set]

Definition at line 33 of file MediaItem.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/DataModels/MediaItem.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • DataModels
  • MediaList
Public Member Functions | Properties | Private Member Functions

MediaList Class Reference

Inherits List< MediaItem >.

List of all members.

Public Member Functions

MediaList ()
async Task | LoadFromApplicationUriAsync (string uri)
async Task | LoadFromApplicationUriAsync (Uri uri)
MediaPlaybackList | ToPlaybackList ()

Properties

string | Title [get, set]

Private Member Functions

MediaItem | LoadItem (JsonObject json)

Detailed Description

Definition at line 15 of file MediaList.cs.

Constructor & Destructor Documentation

MediaList ( ) [inline]

Definition at line 19 of file MediaList.cs.

        {
        }

Member Function Documentation

async Task LoadFromApplicationUriAsync ( string uri ) [inline]

Definition at line 23 of file MediaList.cs.

        {
            await LoadFromApplicationUriAsync(new Uri(uri));
        }

async Task LoadFromApplicationUriAsync ( Uri uri ) [inline]

Definition at line 28 of file MediaList.cs.

        {
            Clear();

            var storageFile = await StorageFile.GetFileFromApplicationUriAsync(uri);
            var jsonText = await FileIO.ReadTextAsync(storageFile);
            var json = JsonObject.Parse(jsonText);
            json = json.GetNamedObject("mediaList");

            Title = json["title"].GetString();
            var items = json["items"].GetArray();
            foreach (var jsonItem in items)
            {
                Add(LoadItem(jsonItem.GetObject()));
            }
        }

MediaItem LoadItem ( JsonObject json ) [inline, private]

Definition at line 45 of file MediaList.cs.

        {
            var mediaType = json["mediaType"].GetString();
            switch (mediaType)
            {
                case "music":
                    return new MusicItem(json);
                case "video":
                    return new VideoItem(json);
                default:
                    return new MediaItem(json);
            }
        }

MediaPlaybackList ToPlaybackList ( ) [inline]

Definition at line 59 of file MediaList.cs.

        {
            var playbackList = new MediaPlaybackList();

            // Make a new list and enable looping
            playbackList.AutoRepeatEnabled = true;

            // Add playback items to the list
            foreach (var mediaItem in this)
            {
                playbackList.Items.Add(mediaItem.ToPlaybackItem());
            }

            return playbackList;
        }

Property Documentation

string Title [get, set]

Definition at line 17 of file MediaList.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/DataModels/MediaList.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MusicItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • DataModels
  • MusicItem
Public Member Functions | Properties

MusicItem Class Reference

Inherits BackgroundMediaPlayback::DataModels::MediaItem.

List of all members.

Public Member Functions

MusicItem ()
MusicItem (JsonObject json)
override MediaPlaybackItem | ToPlaybackItem ()

Properties

Uri | AlbumArtUri [get, set]
override Uri | PreviewImageUri [get, set]

Detailed Description

Definition at line 12 of file MusicItem.cs.

Constructor & Destructor Documentation

MusicItem ( ) [inline]

Definition at line 29 of file MusicItem.cs.

                           : base()
        {
        }

MusicItem ( JsonObject json ) [inline]

Definition at line 33 of file MusicItem.cs.

                                          : base(json)
        {
            if (json.Keys.Contains("albumArtUri"))
                AlbumArtUri = new Uri(json.GetNamedString("albumArtUri"));
        }

Member Function Documentation

override MediaPlaybackItem ToPlaybackItem ( ) [inline, virtual]

Reimplemented from MediaItem.

Definition at line 39 of file MusicItem.cs.

        {
            var playbackItem = base.ToPlaybackItem();

            var displayProperties = playbackItem.GetDisplayProperties();
            displayProperties.Type = MediaPlaybackType.Music;
            displayProperties.MusicProperties.Title = Title;
            playbackItem.ApplyDisplayProperties(displayProperties);

            return playbackItem;
        }

Property Documentation

Uri AlbumArtUri [get, set]

Definition at line 14 of file MusicItem.cs.

override Uri PreviewImageUri [get, set]

Reimplemented from MediaItem.

Definition at line 17 of file MusicItem.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/DataModels/MusicItem.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • DataModels
  • VideoItem
Public Member Functions | Properties

VideoItem Class Reference

Inherits BackgroundMediaPlayback::DataModels::MediaItem.

List of all members.

Public Member Functions

VideoItem ()
VideoItem (JsonObject json)
override MediaPlaybackItem | ToPlaybackItem ()

Properties

override Uri | PreviewImageUri [get, set]
Uri | VideoPreviewImageUri [get, set]

Detailed Description

Definition at line 12 of file VideoItem.cs.

Constructor & Destructor Documentation

VideoItem ( ) [inline]

Definition at line 29 of file VideoItem.cs.

        {
        }

VideoItem ( JsonObject json ) [inline]

Definition at line 33 of file VideoItem.cs.

                                          : base(json)
        {
            if (json.Keys.Contains("videoPreviewImageUri"))
                VideoPreviewImageUri = new Uri(json.GetNamedString("videoPreviewImageUri"));
        }

Member Function Documentation

override MediaPlaybackItem ToPlaybackItem ( ) [inline, virtual]

Reimplemented from MediaItem.

Definition at line 39 of file VideoItem.cs.

        {
            var playbackItem = base.ToPlaybackItem();

            var displayProperties = playbackItem.GetDisplayProperties();
            displayProperties.Type = MediaPlaybackType.Video;
            displayProperties.VideoProperties.Title = Title;
            playbackItem.ApplyDisplayProperties(displayProperties);

            return playbackItem;
        }

Property Documentation

override Uri PreviewImageUri [get, set]

Reimplemented from MediaItem.

Definition at line 17 of file VideoItem.cs.

Uri VideoPreviewImageUri [get, set]

Definition at line 14 of file VideoItem.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/DataModels/VideoItem.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaylistView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • PlaylistView
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

PlaylistView Class Reference

A custom control for playlists that wraps a ListView.

List of all members.

Public Member Functions

PlaylistView ()

Properties

ItemClickEventHandler | ItemClick
MediaListViewModel | MediaList [get, set]
SelectionChangedEventHandler | SelectionChanged

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | RaisePropertyChanged (string propertyName)

Private Attributes

MediaListViewModel mediaList

Detailed Description

Definition at line 35 of file PlaylistView.xaml.cs.

Constructor & Destructor Documentation

PlaylistView ( ) [inline]

Definition at line 41 of file PlaylistView.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void RaisePropertyChanged ( string propertyName ) [inline, private]

Definition at line 88 of file PlaylistView.xaml.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

Member Data Documentation

MediaListViewModel mediaList [private]

Definition at line 37 of file PlaylistView.xaml.cs.

Property Documentation

ItemClickEventHandler ItemClick [add, remove]

Raised when an item is clicked.

Definition at line 50 of file PlaylistView.xaml.cs.

MediaListViewModel MediaList [get, set]

A collection of songs in the list to be displayed to the user.

Definition at line 68 of file PlaylistView.xaml.cs.

SelectionChangedEventHandler SelectionChanged [add, remove]

Raised when the selection changes.

Definition at line 59 of file PlaylistView.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 39 of file PlaylistView.xaml.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/Views/PlaylistView.xaml.cs
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • Scenario1
Public Member Functions | Properties | Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()
async void | speedButton_Click (object sender, RoutedEventArgs e)

Properties

MediaList | MediaList [get, set]
MediaPlaybackList | PlaybackList [get, set]
PlayerViewModel | PlayerViewModel [get, set]

Private Member Functions

async void | PlaybackList_ItemFailed (MediaPlaybackList sender, MediaPlaybackItemFailedEventArgs args)
async void | Player_MediaPlayerRateChanged (MediaPlayer sender, MediaPlayerRateChangedEventArgs e)
async void | Scenario1_Loaded (object sender, RoutedEventArgs e)
void | Scenario1_Unloaded (object sender, RoutedEventArgs e)
void | SettingsService_UseCustomControlsChanged (object sender, EventArgs e)
void | UpdateControlVisibility ()
void | UpdatePlaybackSpeed ()

Private Attributes

MediaPlayer | Player = > PlaybackService.Instance.Player

Detailed Description

Definition at line 43 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 60 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            // Never reuse the cached page because the model is designed to be unloaded and disposed
            this.NavigationCacheMode = NavigationCacheMode.Disabled;

            // Setup MediaPlayer view model
            PlayerViewModel = new PlayerViewModel(Player, Dispatcher);

            // Handle page load events
            Loaded += Scenario1_Loaded;
            Unloaded += Scenario1_Unloaded;

            // Respond to playback rate changes.
            Player.MediaPlayerRateChanged += Player_MediaPlayerRateChanged;
            UpdatePlaybackSpeed();
        }

Member Function Documentation

async void PlaybackList_ItemFailed | ( | MediaPlaybackList | sender,
 |  | MediaPlaybackItemFailedEventArgs | args |
 | ) |  |  | [inline, private]

Handle item failures.

Parameters:
sender
args

Definition at line 152 of file Scenario1.xaml.cs.

        {
            // Media callbacks use a worker thread so dispatch to UI as needed
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var error = string.Format("Item failed to play: {0} | 0x{1:x}",
                    args.Error.ErrorCode, args.Error.ExtendedError.HResult);
                MainPage.Current.NotifyUser(error, NotifyType.ErrorMessage);
            });
        }

async void Player_MediaPlayerRateChanged | ( | MediaPlayer | sender,
 |  | MediaPlayerRateChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 184 of file Scenario1.xaml.cs.

        {
            // Media callbacks use a worker thread so dispatch to UI as needed
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, UpdatePlaybackSpeed);
        }

async void Scenario1_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario1.xaml.cs.

        {
            Debug.WriteLine("Scenario1_Loaded");

            // Update controls according to settings
            UpdateControlVisibility();
            SettingsService.Instance.UseCustomControlsChanged += SettingsService_UseCustomControlsChanged;

            // Bind player to element
            mediaPlayerElement.SetMediaPlayer(Player);

            // Load the playlist data model if needed
            if (MediaList == null)
            {
                // Create the playlist data model
                MediaList = new MediaList();
                await MediaList.LoadFromApplicationUriAsync("ms-appx:///Assets/playlist.json");
            }

            // Create a new playback list matching the data model if one does not exist
            if (PlaybackList == null)
                PlaybackList = MediaList.ToPlaybackList();

            // Subscribe to playback list item failure events
            PlaybackList.ItemFailed += PlaybackList_ItemFailed;

            // Create the view model list from the data model and playback model
            // and assign it to the player
            PlayerViewModel.MediaList = new MediaListViewModel(MediaList, PlaybackList, Dispatcher);
        }

void Scenario1_Unloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario1.xaml.cs.

        {
            Debug.WriteLine("Scenario1_Unloaded");

            // Ensure the page is no longer holding references and force a GC
            // to ensure these are unloaded immediately since the app has
            // only a short timeframe to reduce working set to avoid suspending
            // on background transition.

            SettingsService.Instance.UseCustomControlsChanged -= SettingsService_UseCustomControlsChanged;

            PlaybackList.ItemFailed -= PlaybackList_ItemFailed;
            PlayerViewModel.Dispose();
            PlayerViewModel = null;

            GC.Collect();
        }

void SettingsService_UseCustomControlsChanged | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 128 of file Scenario1.xaml.cs.

        {
            UpdateControlVisibility();
        }

async void speedButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 163 of file Scenario1.xaml.cs.

        {
            // Create menu and add commands
            var popupMenu = new PopupMenu();

            popupMenu.Commands.Add(new UICommand("4.0x", command => Player.PlaybackSession.PlaybackRate = 4.0));
            popupMenu.Commands.Add(new UICommand("2.0x", command => Player.PlaybackSession.PlaybackRate = 2.0));
            popupMenu.Commands.Add(new UICommand("1.5x", command => Player.PlaybackSession.PlaybackRate = 1.5));
            popupMenu.Commands.Add(new UICommand("1.0x", command => Player.PlaybackSession.PlaybackRate = 1.0));
            popupMenu.Commands.Add(new UICommand("0.5x", command => Player.PlaybackSession.PlaybackRate = 0.5));

            // Get button transform and then offset it by half the button
            // width to center. This will show the popup just above the button.
            var control = sender as Control;
            var transform = control.TransformToVisual(null);
            var point = transform.TransformPoint(new Point(control.ActualWidth / 2, 0));

            // Show popup
            var selected = await popupMenu.ShowAsync(point);
        }

void UpdateControlVisibility ( ) [inline, private]

Definition at line 133 of file Scenario1.xaml.cs.

        {
            if (SettingsService.Instance.UseCustomControls)
            {
                mediaPlayerElement.AreTransportControlsEnabled = false;
                customButtons.Visibility = Visibility.Visible;
            }
            else
            {
                mediaPlayerElement.AreTransportControlsEnabled = true;
                customButtons.Visibility = Visibility.Collapsed;
            }
        }

void UpdatePlaybackSpeed ( ) [inline, private]

Definition at line 190 of file Scenario1.xaml.cs.

        {
            speedButton.Content = String.Format("{0:0.0}x", Player.PlaybackSession.PlaybackRate);
        }

Member Data Documentation

MediaPlayer Player = > PlaybackService.Instance.Player [private]

Definition at line 45 of file Scenario1.xaml.cs.

Property Documentation

MediaList MediaList [get, set, private]

Definition at line 53 of file Scenario1.xaml.cs.

MediaPlaybackList PlaybackList [get, set, private]

Definition at line 48 of file Scenario1.xaml.cs.

PlayerViewModel PlayerViewModel [get, set]

Definition at line 58 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • Services
  • PlaybackService
Public Member Functions | Properties | Static Private Attributes

PlaybackService Class Reference

The central authority on playback in the application providing access to the player and active playlist.

List of all members.

Public Member Functions

PlaybackService ()

Properties

MediaList | CurrentPlaylist [get, set]
static PlaybackService | Instance [get]
MediaPlayer | Player [get, set]

Static Private Attributes

static PlaybackService | instance

Detailed Description

Definition at line 15 of file PlaybackService.cs.

Constructor & Destructor Documentation

PlaybackService ( ) [inline]

Definition at line 45 of file PlaybackService.cs.

        {
            // Create the player instance
            Player = new MediaPlayer();
            Player.AutoPlay = false;
        }

Member Data Documentation

PlaybackService instance [static, private]

Definition at line 17 of file PlaybackService.cs.

Property Documentation

MediaList CurrentPlaylist [get, set]

The data model of the active playlist.

An application might have a database of items representing a user's media library, but here we use a simple list loaded from a JSON asset.

Definition at line 43 of file PlaybackService.cs.

PlaybackService Instance [static, get]

Definition at line 20 of file PlaybackService.cs.

MediaPlayer Player [get, set]

This application only requires a single shared MediaPlayer that all pages have access to.

The instance could have also been stored in Application.Resources or in an application defined data model.

Definition at line 36 of file PlaybackService.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/Services/PlaybackService.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SettingsService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • Services
  • SettingsService
Properties | Events | Private Attributes | Static Private Attributes

SettingsService Class Reference

List of all members.

Properties

static SettingsService | Instance [get]
bool | ToastOnAppEvents [get, set]
bool | UseCustomControls [get, set]

Events

EventHandler | UseCustomControlsChanged

Private Attributes

IPropertySet | settings = ApplicationData.Current.RoamingSettings.Values
const string | ToastOnAppEventsKey = "toast-on-app-events"
const string | UseCustomControlsKey = "use-custom-controls"

Static Private Attributes

static SettingsService | instance

Detailed Description

Definition at line 11 of file SettingsService.cs.

Member Data Documentation

SettingsService instance [static, private]

Definition at line 13 of file SettingsService.cs.

IPropertySet settings = ApplicationData.Current.RoamingSettings.Values [private]

Definition at line 28 of file SettingsService.cs.

const string ToastOnAppEventsKey = "toast-on-app-events" [private]

Definition at line 26 of file SettingsService.cs.

const string UseCustomControlsKey = "use-custom-controls" [private]

Definition at line 27 of file SettingsService.cs.

Property Documentation

SettingsService Instance [static, get]

Definition at line 16 of file SettingsService.cs.

bool ToastOnAppEvents [get, set]

Definition at line 33 of file SettingsService.cs.

bool UseCustomControls [get, set]

Definition at line 49 of file SettingsService.cs.

Event Documentation

EventHandler UseCustomControlsChanged

Definition at line 30 of file SettingsService.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/Services/SettingsService.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Settings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • Settings
Public Member Functions | Properties

Settings Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Settings ()

Properties

SettingsViewModel ViewModel [get, set]

Detailed Description

Definition at line 43 of file Settings.xaml.cs.

Constructor & Destructor Documentation

Settings ( ) [inline]

Definition at line 47 of file Settings.xaml.cs.

        {
            ViewModel = new SettingsViewModel();

            this.InitializeComponent();

            // Always use the cached page
            this.NavigationCacheMode = NavigationCacheMode.Required;
        }

Property Documentation

SettingsViewModel ViewModel [get, set]

Definition at line 45 of file Settings.xaml.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/Settings.xaml.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaItemViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • MediaItemViewModel
Public Member Functions | Public Attributes | Properties | Events | Private Member Functions | Private Attributes

MediaItemViewModel Class Reference

View model for media items. More...

List of all members.

Public Member Functions

MediaItemViewModel (MediaListViewModel listViewModel, MediaItem mediaItem)

Public Attributes

string | Title = > MediaItem.Title

Properties

MediaItem | MediaItem [get, set]
MediaPlaybackItem | PlaybackItem [get]
BitmapImage | PreviewImage [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | RaisePropertyChanged (string propertyName)

Private Attributes

MediaListViewModel listViewModel
MediaPlaybackItem | playbackItem
BitmapImage | previewImage

Detailed Description

The view model is backed by a data model (MediaItem) and a playback model (MediaPlaybackItem).

This class currently supports OneWay (read only) binding but could be extended to support TwoWay binding to persist changes back to the data and playback models.

The projected view is the same regardless of the type of media. More sophisticated applications may want to create separate models and XAML data templates for unique content display.

Definition at line 29 of file MediaItemViewModel.cs.

Constructor & Destructor Documentation

MediaItemViewModel | ( | MediaListViewModel | listViewModel,
 |  | MediaItem | mediaItem |
 | ) |  |  | [inline]

Definition at line 78 of file MediaItemViewModel.cs.

        {
            this.listViewModel = listViewModel;
            MediaItem = mediaItem;

            RaisePropertyChanged("Title");

            // This app caches all images by loading the BitmapImage
            // when the item is created, but production apps would
            // use a more resource friendly paging mechanism or
            // just use PreviewImageUri directly.
            //
            // The reason we cache here is to avoid audio gaps
            // between tracks on transitions when changing artwork.
            PreviewImage = new BitmapImage();
            PreviewImage.UriSource = mediaItem.PreviewImageUri;
        }

Member Function Documentation

void RaisePropertyChanged ( string propertyName ) [inline, private]

Definition at line 96 of file MediaItemViewModel.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

Member Data Documentation

MediaListViewModel listViewModel [private]

Definition at line 31 of file MediaItemViewModel.cs.

MediaPlaybackItem playbackItem [private]

Definition at line 32 of file MediaItemViewModel.cs.

BitmapImage previewImage [private]

Definition at line 34 of file MediaItemViewModel.cs.

string Title = > MediaItem.Title

Definition at line 40 of file MediaItemViewModel.cs.

Property Documentation

MediaItem MediaItem [get, set]

Definition at line 38 of file MediaItemViewModel.cs.

MediaPlaybackItem PlaybackItem [get]

Definition at line 57 of file MediaItemViewModel.cs.

BitmapImage PreviewImage [get, set]

Definition at line 43 of file MediaItemViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 36 of file MediaItemViewModel.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/MediaItemViewModel.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaListViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • MediaListViewModel
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

MediaListViewModel Class Reference

View model for a list of media items. More...

List of all members.

Public Member Functions

MediaListViewModel (MediaList mediaList, MediaPlaybackList playbackList, CoreDispatcher dispatcher)
void | Dispose ()

Protected Member Functions

override void | ClearItems ()
override void | InsertItem (int index, MediaItemViewModel item)
override void | MoveItem (int oldIndex, int newIndex)
override void | RemoveItem (int index)
override void | SetItem (int index, MediaItemViewModel item)

Properties

MediaItemViewModel | CurrentItem [get, set]
int | CurrentItemIndex [get, set]
MediaList | MediaList [get, set]
MediaPlaybackList | PlaybackList [get, set]

Private Member Functions

async void | PlaybackList_CurrentItemChanged (MediaPlaybackList sender, CurrentMediaPlaybackItemChangedEventArgs args)

Private Attributes

int | currentItemIndex = -1
CoreDispatcher | dispatcher
bool | disposed
bool | initializing

Detailed Description

The view model is backed by a data model (MediaList) and a playback model (MediaPlaybackList).

This class currently supports TwoWay binding with the playback model so changes to the view model list also update the list of items scheduled for playback.

Changes are not currently persisted back to or updated from the data model.

This view model subscribes to events on the player and must unsubscribe before unloading the UI in background mode. Call Dispose() to initiate this.

Definition at line 33 of file MediaListViewModel.cs.

Constructor & Destructor Documentation

MediaListViewModel | ( | MediaList | mediaList,
 |  | MediaPlaybackList | playbackList,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 95 of file MediaListViewModel.cs.

        {
            MediaList = mediaList;
            PlaybackList = playbackList;
            this.dispatcher = dispatcher;

            // Verify consistency of the lists that were passed in
            var mediaListIds = mediaList.Select(i => i.ItemId);
            var playbackListIds = playbackList.Items.Select(
                i => (string)i.Source.CustomProperties.SingleOrDefault(
                    p => p.Key == MediaItem.MediaItemIdKey).Value);

            if (!mediaListIds.SequenceEqual(playbackListIds))
                throw new ArgumentException("The passed in data model and playback model did not have the same sequence of items");

            // Initialize the view model items
            initializing = true;

            foreach (var mediaItem in mediaList)
                Add(new MediaItemViewModel(this, mediaItem));

            initializing = false;

            // The view model supports TwoWay binding so update when the playback list item changes
            PlaybackList.CurrentItemChanged += PlaybackList_CurrentItemChanged;

            // Start where the playback list is currently at
            CurrentItemIndex = (int)PlaybackList.CurrentItemIndex;
        }

Member Function Documentation

override void ClearItems ( ) [inline, protected]

Definition at line 134 of file MediaListViewModel.cs.

        {
            base.ClearItems();

            PlaybackList.Items.Clear();
        }

void Dispose ( ) [inline]

Definition at line 199 of file MediaListViewModel.cs.

        {
            if (disposed)
                return;

            PlaybackList.CurrentItemChanged -= PlaybackList_CurrentItemChanged;

            disposed = true;
        }

override void InsertItem | ( | int | index,
 |  | MediaItemViewModel | item |
 | ) |  |  | [inline, protected]

Definition at line 125 of file MediaListViewModel.cs.

        {
            base.InsertItem(index, item);

            // Don't add items during construction
            if (!initializing)
                PlaybackList.Items.Add(item.PlaybackItem);
        }

override void MoveItem | ( | int | oldIndex,
 |  | int | newIndex |
 | ) |  |  | [inline, protected]

Definition at line 155 of file MediaListViewModel.cs.

        {
            base.MoveItem(oldIndex, newIndex);

            var item = PlaybackList.Items[oldIndex];
            PlaybackList.Items.RemoveAt(oldIndex);
            PlaybackList.Items.Insert(newIndex, item);
        }

async void PlaybackList_CurrentItemChanged | ( | MediaPlaybackList | sender,
 |  | CurrentMediaPlaybackItemChangedEventArgs | args |
 | ) |  |  | [inline, private]

This call comes in on a worker thread so requires a little extra care to avoid touching the UI if it has already been disposed.

Parameters:
sender
args

Definition at line 170 of file MediaListViewModel.cs.

        {
            // If the event was unsubscribed before
            // this handler executed just return.
            if (disposed)
                return;

            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // If the event was unsubscribed before
                // this handler executed just return.
                if (disposed)
                    return;

                var playbackItem = args.NewItem;

                if (playbackItem == null)
                {
                    CurrentItem = null;
                }
                else
                {
                    // Find the single item in this list with a playback item
                    // matching the one we just received the event for.
                    CurrentItem = this.Single(mediaItemViewModel => mediaItemViewModel.PlaybackItem == playbackItem);
                }
            });
        }

override void RemoveItem ( int index ) [inline, protected]

Definition at line 141 of file MediaListViewModel.cs.

        {
            base.RemoveItem(index);

            PlaybackList.Items.RemoveAt(index);
        }

override void SetItem | ( | int | index,
 |  | MediaItemViewModel | item |
 | ) |  |  | [inline, protected]

Definition at line 148 of file MediaListViewModel.cs.

        {
            base.SetItem(index, item);

            PlaybackList.Items[index] = item.PlaybackItem;
        }

Member Data Documentation

int currentItemIndex = -1 [private]

Definition at line 36 of file MediaListViewModel.cs.

CoreDispatcher dispatcher [private]

Definition at line 35 of file MediaListViewModel.cs.

bool disposed [private]

Definition at line 37 of file MediaListViewModel.cs.

bool initializing [private]

Definition at line 38 of file MediaListViewModel.cs.

Property Documentation

MediaItemViewModel CurrentItem [get, set]

Definition at line 43 of file MediaListViewModel.cs.

int CurrentItemIndex [get, set]

Definition at line 61 of file MediaListViewModel.cs.

MediaList MediaList [get, set]

Definition at line 40 of file MediaListViewModel.cs.

MediaPlaybackList PlaybackList [get, set]

Definition at line 93 of file MediaListViewModel.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/MediaListViewModel.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackSessionViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • PlaybackSessionViewModel
Public Member Functions | Public Attributes | Events | Private Member Functions | Private Attributes

PlaybackSessionViewModel Class Reference

List of all members.

Public Member Functions

PlaybackSessionViewModel (MediaPlaybackSession playbackSession, CoreDispatcher dispatcher)
void | Dispose ()

Public Attributes

MediaPlaybackState | PlaybackState = > playbackSession.PlaybackState

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

async void | PlaybackSession_PlaybackStateChanged (MediaPlaybackSession sender, object args)
void | RaisePropertyChanged (string propertyName)

Private Attributes

CoreDispatcher | dispatcher
bool | disposed
MediaPlaybackSession | playbackSession
MediaPlayer | player

Detailed Description

Definition at line 12 of file PlaybackSessionViewModel.cs.

Constructor & Destructor Documentation

PlaybackSessionViewModel | ( | MediaPlaybackSession | playbackSession,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 22 of file PlaybackSessionViewModel.cs.

        {
            this.player = playbackSession.MediaPlayer;
            this.playbackSession = playbackSession;
            this.dispatcher = dispatcher;

            playbackSession.PlaybackStateChanged += PlaybackSession_PlaybackStateChanged;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 41 of file PlaybackSessionViewModel.cs.

        {
            if (disposed)
                return;

            playbackSession.PlaybackStateChanged -= PlaybackSession_PlaybackStateChanged;

            disposed = true;
        }

async void PlaybackSession_PlaybackStateChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 31 of file PlaybackSessionViewModel.cs.

        {
            if (disposed) return;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (disposed) return;
                RaisePropertyChanged("PlaybackState");
            });
        }

void RaisePropertyChanged ( string propertyName ) [inline, private]

Definition at line 51 of file PlaybackSessionViewModel.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

Member Data Documentation

CoreDispatcher dispatcher [private]

Definition at line 17 of file PlaybackSessionViewModel.cs.

bool disposed [private]

Definition at line 14 of file PlaybackSessionViewModel.cs.

MediaPlaybackSession playbackSession [private]

Definition at line 16 of file PlaybackSessionViewModel.cs.

MediaPlaybackState PlaybackState = > playbackSession.PlaybackState

Definition at line 19 of file PlaybackSessionViewModel.cs.

MediaPlayer player [private]

Definition at line 15 of file PlaybackSessionViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 20 of file PlaybackSessionViewModel.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/PlaybackSessionViewModel.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackStateToButtonIconConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • PlaybackStateToButtonIconConverter
Public Member Functions

PlaybackStateToButtonIconConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 10 of file PlaybackStateToButtonIconConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 12 of file PlaybackStateToButtonIconConverter.cs.

        {
            if (value is MediaPlaybackState)
            {
                var state = (MediaPlaybackState)value;

                if (state == MediaPlaybackState.Playing)
                {
                    return Symbol.Pause;
                }
                else
                {
                    return Symbol.Play;
                }
            }
            return null;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 30 of file PlaybackStateToButtonIconConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/PlaybackStateToButtonIconConverter.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayerViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • PlayerViewModel
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

PlayerViewModel Class Reference

The view model for the player. More...

List of all members.

Public Member Functions

PlayerViewModel (MediaPlayer player, CoreDispatcher dispatcher)
void | Dispose ()
void | SkipNext ()
void | SkipPrevious ()
void | TogglePlayPause ()

Properties

IEnumerable< string > | AudioCategories [get]
bool | CanSkipNext [get, set]
bool | CanSkipPrevious [get, set]
MediaListViewModel | MediaList [get, set]
PlaybackSessionViewModel | PlaybackSession [get, set]
string | SelectedAudioCategory [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | HandlePlaybackListChanges (IObservableVector< MediaPlaybackItem > vector)
async void | Items_VectorChanged (IObservableVector< MediaPlaybackItem > sender, IVectorChangedEventArgs args)
void | RaisePropertyChanged (string propertyName)
async void | SubscribedPlaybackList_CurrentItemChanged (MediaPlaybackList sender, CurrentMediaPlaybackItemChangedEventArgs args)

Private Attributes

bool | canSkipNext
bool | canSkipPrevious
CoreDispatcher | dispatcher
bool | disposed
MediaListViewModel mediaList
MediaPlayer | player
MediaPlaybackList | subscribedPlaybackList

Detailed Description

The view disables the ability to skip during a transition or when the playback list is empty.

Definition at line 20 of file PlayerViewModel.cs.

Constructor & Destructor Documentation

PlayerViewModel | ( | MediaPlayer | player,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 116 of file PlayerViewModel.cs.

        {
            this.player = player;
            this.dispatcher = dispatcher;

            PlaybackSession = new PlaybackSessionViewModel(player.PlaybackSession, dispatcher);
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 202 of file PlayerViewModel.cs.

        {
            if (disposed)
                return;

            if (MediaList != null)
            {
                MediaList.Dispose();
                MediaList = null; // Setter triggers vector unsubscribe logic
            }

            PlaybackSession.Dispose();

            disposed = true;
        }

void HandlePlaybackListChanges ( IObservableVector< MediaPlaybackItem > vector ) [inline, private]

Definition at line 183 of file PlayerViewModel.cs.

        {
            if (vector.Count > 0)
            {
                CanSkipNext = true;
                CanSkipPrevious = true;
            }
            else
            {
                CanSkipNext = false;
                CanSkipPrevious = false;
            }
        }

async void Items_VectorChanged | ( | IObservableVector< MediaPlaybackItem > | sender,
 |  | IVectorChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 163 of file PlayerViewModel.cs.

        {
            if (disposed) return;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (disposed) return;
                HandlePlaybackListChanges(sender);
            });
        }

void RaisePropertyChanged ( string propertyName ) [inline, private]

Definition at line 197 of file PlayerViewModel.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

void SkipNext ( ) [inline]

Definition at line 137 of file PlayerViewModel.cs.

        {
            if (!CanSkipNext)
                return;

            var playbackList = player.Source as MediaPlaybackList;
            if (playbackList == null)
                return;

            playbackList.MoveNext();
            CanSkipNext = false;
        }

void SkipPrevious ( ) [inline]

Definition at line 150 of file PlayerViewModel.cs.

        {
            if (!CanSkipPrevious)
                return;

            var playbackList = player.Source as MediaPlaybackList;
            if (playbackList == null)
                return;

            playbackList.MovePrevious();
            CanSkipPrevious = false;
        }

async void SubscribedPlaybackList_CurrentItemChanged | ( | MediaPlaybackList | sender,
 |  | CurrentMediaPlaybackItemChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 173 of file PlayerViewModel.cs.

        {
            if (disposed) return;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (disposed) return;
                HandlePlaybackListChanges(sender.Items);
            });
        }

void TogglePlayPause ( ) [inline]

Definition at line 124 of file PlayerViewModel.cs.

        {
            switch (player.PlaybackSession.PlaybackState)
            {
                case MediaPlaybackState.Playing:
                    player.Pause();
                    break;
                case MediaPlaybackState.Paused:
                    player.Play();
                    break;
            }
        }

Member Data Documentation

bool canSkipNext [private]

Definition at line 28 of file PlayerViewModel.cs.

bool canSkipPrevious [private]

Definition at line 29 of file PlayerViewModel.cs.

CoreDispatcher dispatcher [private]

Definition at line 24 of file PlayerViewModel.cs.

bool disposed [private]

Definition at line 22 of file PlayerViewModel.cs.

MediaListViewModel mediaList [private]

Definition at line 27 of file PlayerViewModel.cs.

MediaPlayer player [private]

Definition at line 23 of file PlayerViewModel.cs.

MediaPlaybackList subscribedPlaybackList [private]

Definition at line 25 of file PlayerViewModel.cs.

Property Documentation

IEnumerable<string> AudioCategories [get]

Definition at line 60 of file PlayerViewModel.cs.

bool CanSkipNext [get, set]

Definition at line 34 of file PlayerViewModel.cs.

bool CanSkipPrevious [get, set]

Definition at line 47 of file PlayerViewModel.cs.

MediaListViewModel MediaList [get, set]

Definition at line 78 of file PlayerViewModel.cs.

PlaybackSessionViewModel PlaybackSession [get, set]

Definition at line 31 of file PlayerViewModel.cs.

string SelectedAudioCategory [get, set]

Definition at line 65 of file PlayerViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 114 of file PlayerViewModel.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/PlayerViewModel.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SettingsViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundMediaPlayback
  • ViewModels
  • SettingsViewModel
Properties | Events | Private Member Functions

SettingsViewModel Class Reference

List of all members.

Properties

bool | ToastOnAppEvents [get, set]
bool | UseCustomControls [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | RaisePropertyChanged (string propertyName)

Detailed Description

Definition at line 14 of file SettingsViewModel.cs.

Member Function Documentation

void RaisePropertyChanged ( string propertyName ) [inline, private]

Definition at line 50 of file SettingsViewModel.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

Property Documentation

bool ToastOnAppEvents [get, set]

Definition at line 19 of file SettingsViewModel.cs.

bool UseCustomControls [get, set]

Definition at line 35 of file SettingsViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 16 of file SettingsViewModel.cs.

The documentation for this class was generated from the following file:
  • BackgroundMediaPlayback/cs/ViewModels/SettingsViewModel.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTaskInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • BackgroundTaskInformation
Public Attributes

BackgroundTaskInformation Class Reference

List of all members.

Public Attributes

const String | TaskCanceled = "Canceled"
const String | TaskCompleted = "Completed"

Detailed Description

Definition at line 18 of file Constants.cs.

Member Data Documentation

const String TaskCanceled = "Canceled"

Definition at line 20 of file Constants.cs.

const String TaskCompleted = "Completed"

Definition at line 21 of file Constants.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • ConnectTask
Public Member Functions | Private Member Functions

ConnectTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | DisplayToast (string ssid)

Detailed Description

Definition at line 55 of file Tasks.cs.

Member Function Documentation

void DisplayToast ( string ssid ) [inline, private]

Definition at line 99 of file Tasks.cs.

        {
            ToastNotifier ToastNotifier = ToastNotificationManager.CreateToastNotifier();

            // Create a two line toast and add audio reminder

            // Here the xml that will be passed to the
            // ToastNotification for the toast is retrieved
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

            string message = $"SSID: '{ssid}'. Connecting in five seconds.";

            // Set both lines of text
            XmlNodeList toastNodeList = toastXml.GetElementsByTagName("text");
            toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode("Please turn on your hotspot now!"));
            toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));

            // now create a xml node for the audio source
            IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
            XmlElement audio = toastXml.CreateElement("audio");
            audio.SetAttribute("src", "ms-winsoundevent:Notification.SMS");

            ToastNotification toast = new ToastNotification(toastXml);
            ToastNotifier.Show(toast);
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 57 of file Tasks.cs.

        {
            var triggerDetails = (WiFiOnDemandHotspotConnectTriggerDetails)taskInstance.TriggerDetails;

            // A real on-demand hotspot task would contact the hotspot device and tell it
            // to start advertising the SSID.
            //
            // This sample doesn't have a real hotspot device, so it will simulate the action
            // by displaying a toast to instruct the user to turn on the mobile hotspot manually.
            //
            // To demonstrate how to report errors turning on the hotspot, we will report an error
            // if the hotspot is configured without an SSID or without a password.

            WiFiOnDemandHotspotNetwork network = triggerDetails.RequestedNetwork;

            // Is this the network we know how to turn on?
            IPropertySet values = ApplicationData.Current.LocalSettings.Values;
            if (!values.TryGetValue("hotspotGuid", out object boxedHotspotGuid) || (Guid)boxedHotspotGuid != network.Id)
            {
                triggerDetails.ReportError(WiFiOnDemandHotspotConnectStatus.UnspecifiedFailure);
                return;
            }

            // To demonstrate how to report errors turning on the hotspot, we will report an error
            // if the hotspot is configured with an SSID named "error".
            WiFiOnDemandHotspotNetworkProperties properties = network.GetProperties();
            if (properties.Ssid == "error")
            {
                // Simulate an error turning on the hotspot. You can report any error code from the
                // WiFiOnDemandHotspotConnectStatus enumeration.
                triggerDetails.ReportError(WiFiOnDemandHotspotConnectStatus.NetworkNotAvailable);
            }
            else
            {
                DisplayToast(properties.Ssid);
                System.Threading.Thread.Sleep(5000);

                WiFiOnDemandHotspotConnectionResult result = triggerDetails.Connect();
                values["connectResult"] = (int)result.Status;
            }
        }

The documentation for this class was generated from the following file:
  • OnDemandHotspot/cs/BackgroundTask/Tasks.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeofenceBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • GeofenceBackgroundTask
Private Member Functions | Private Attributes

GeofenceBackgroundTask Class Reference

List of all members.

Private Member Functions

string | GenerateReportDescription (GeofenceStateChangeReport report)
void | ProcessGeofenceStateChangedReports ()
void IBackgroundTask. | Run (IBackgroundTaskInstance taskInstance)

Private Attributes

IDictionary< string, object > | _values = ApplicationData.Current.LocalSettings.Values
const int | maxEventDescriptors = 42

Detailed Description

Definition at line 21 of file GeofenceBackgroundTask.cs.

Member Function Documentation

string GenerateReportDescription ( GeofenceStateChangeReport report ) [inline, private]

Definition at line 86 of file GeofenceBackgroundTask.cs.

        {
            GeofenceState state = report.NewState;
            DateTimeOffset timestamp = report.Geoposition.Coordinate.Timestamp;

            string result = $"{report.Geofence.Id} {timestamp:G}";

            if (state == GeofenceState.Removed)
            {
                GeofenceRemovalReason reason = report.RemovalReason;
                if (reason == GeofenceRemovalReason.Expired)
                {
                    result += " (Removed/Expired)";
                }
                else if (reason == GeofenceRemovalReason.Used)
                {
                    result += " (Removed/Used)";
                }
            }
            else if (state == GeofenceState.Entered)
            {
                result += " (Entered)";
            }
            else if (state == GeofenceState.Exited)
            {
                result += " (Exited)";
            }
            return result;
        }

void ProcessGeofenceStateChangedReports ( ) [inline, private]

Definition at line 50 of file GeofenceBackgroundTask.cs.

        {
            // Load the values saved from last time.
            JsonArray geofenceBackgroundEvents = Helpers.LoadSavedJson("BackgroundGeofenceEventCollection");

            // Process the state changes that have occurred since the last time we ran.
            string description = null;
            GeofenceMonitor monitor = GeofenceMonitor.Current;
            IReadOnlyList<GeofenceStateChangeReport> reports = monitor.ReadReports();

            foreach (GeofenceStateChangeReport report in reports)
            {
                description = GenerateReportDescription(report);

                // Add to the collection, trimming old events if necessary.
                if (geofenceBackgroundEvents.Count == maxEventDescriptors)
                {
                    geofenceBackgroundEvents.RemoveAt(maxEventDescriptors - 1);
                }
                geofenceBackgroundEvents.Insert(0, JsonValue.CreateStringValue(description));
            }

            int numReports = reports.Count;
            if (numReports > 0)
            {
                // Save the modified results for next time.
                _values["BackgroundGeofenceEventCollection"] = geofenceBackgroundEvents.Stringify();

                if (numReports > 1)
                {
                    description = $"There are {numReports} new geofence events";
                }
                Helpers.DisplayToast(description);
            }
        }

void IBackgroundTask. Run ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 30 of file GeofenceBackgroundTask.cs.

        {
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            try
            {
                // Handle geofence state change reports
                ProcessGeofenceStateChangedReports();
            }
            catch (UnauthorizedAccessException)
            {
                _values["Status"] = "Location permissions are disabled. Enable access through the settings.";
                _values.Remove("BackgroundGeofenceEventCollection");
            }
            finally
            {
                deferral.Complete();
            }
        }

Member Data Documentation

IDictionary<string, object> _values = ApplicationData.Current.LocalSettings.Values [private]

Definition at line 28 of file GeofenceBackgroundTask.cs.

const int maxEventDescriptors = 42 [private]

Definition at line 25 of file GeofenceBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Tasks/GeofenceBackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoSyncBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • IoSyncBackgroundTask
Public Member Functions | Private Member Functions | Private Attributes

IoSyncBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Dispose ()
async void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
void | OpenDevice ()
async Task< UInt32 > | WriteToDeviceAsync ()

Private Attributes

IBackgroundTaskInstance | backgroundTaskInstance
CancellationTokenSource | cancellationTokenSource
BackgroundTaskDeferral | deferral
UsbDevice | device
DeviceUseDetails | deviceSyncDetails

Detailed Description

Definition at line 22 of file IoSyncBackgroundTask.cs.

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 91 of file IoSyncBackgroundTask.cs.

        {
            if (cancellationTokenSource != null)
            {
                cancellationTokenSource.Dispose();
                cancellationTokenSource = null;
            }
        }

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Cancels opening device and the IO operation, whichever is still running.

Parameters:
sender
reason

Definition at line 117 of file IoSyncBackgroundTask.cs.

        {
            cancellationTokenSource.Cancel();

            backgroundTaskInstance.Progress = 0;
        }

void OpenDevice ( ) [inline, private]

Definition at line 100 of file IoSyncBackgroundTask.cs.

        {
            var deviceTask = UsbDevice.FromIdAsync(deviceSyncDetails.DeviceId).AsTask(cancellationTokenSource.Token);

            deviceTask.Wait();

            device = deviceTask.Result;

            // We opened the device, so notify the app that we've completed a bit of the background task
            backgroundTaskInstance.Progress = 10;
        }

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 35 of file IoSyncBackgroundTask.cs.

        {
            backgroundTaskInstance = taskInstance;

            // Trigger details contain device id and arguments that are provided by the caller in the main app
            // The taskInstance can always be casted to DeviceUseDetails if this background task was started using a DeviceUseTrigger
            deviceSyncDetails = (DeviceUseDetails)taskInstance.TriggerDetails;

            deferral = taskInstance.GetDeferral();

            try
            {
                backgroundTaskInstance.Progress = 0;

                cancellationTokenSource = new CancellationTokenSource();

                taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

                // For simplicity, no error checking will be done after opening the device. Ideally, one should always
                // check if the device was successfully opened and respond accordingly. For an example on how to do this,
                // please see Scenario 1 of this sample.
                //
                // The user may also block the device via the settings charm while we are syncing (in background task). In order to deal with
                // the user changing permissions, we have to listen for DeviceAccessInformation->AccessChanged events. See EventHandlerForDevice
                // for how to handle DeviceAccessInformation.AccessChanged event.
                OpenDevice();

                // The sample only demonstrates a bulk write for simplicity.
                // IO operations can be done after opening the device.
                // For more information on BackgroundTasks, please see the BackgroundTask sample on MSDN.
                UInt32 bytesWritten = await Task.Run(() =>
                {
                    return WriteToDeviceAsync();
                },
                cancellationTokenSource.Token);

                ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskResult] = bytesWritten;
                ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskStatus] = BackgroundTaskInformation.TaskCompleted;
            }
            catch (OperationCanceledException /*ex*/)
            {
                ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskResult] = 0;
                ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskStatus] = BackgroundTaskInformation.TaskCanceled;
            }
            finally
            {
                // Close the device because we are finished syncing and so that the app may reopen the device
                device.Dispose();

                device = null;
            }

            // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration)
            deferral.Complete();
        }

async Task<UInt32> WriteToDeviceAsync ( ) [inline, private]

This method exists to demonstrate IO with the device since that is what is expected for a sync scenario.

There already exists scenarios in this sample that demonstrate how to properly perform IO with the device, please see those for more information on performing various kinds of IO.

Writes to device's first bulkOut endpoint of the default interface and updates progress per write. When this method finishes, the progress will be 100.

Returns:
Total number of bytes written to the device

Definition at line 133 of file IoSyncBackgroundTask.cs.

        {
            UInt32 totalBytesWritten = 0;

            var firstBulkOutEndpoint = device.DefaultInterface.BulkOutPipes[0];

            // Distributes the remaining progress (out of 100) among each write
            double progressIncreasePerWrite = (100 - backgroundTaskInstance.Progress) / ((double)Sync.NumberOfTimesToWrite);

            // This progress will be incremented by the more accurate progressIncreasePerWrite value and then rounded up before notifying the app
            double syncProgress = backgroundTaskInstance.Progress;

            var dataWriter = new DataWriter(firstBulkOutEndpoint.OutputStream);

            // Create an array, all default initialized to 0, and write it to the buffer
            // The data inside the buffer will be garbage
            var arrayBuffer = new Byte[Sync.BytesToWriteAtATime];

            for (UInt32 timesWritten = 0; timesWritten < Sync.NumberOfTimesToWrite; timesWritten++)
            {
                cancellationTokenSource.Token.ThrowIfCancellationRequested();

                dataWriter.WriteBytes(arrayBuffer);

                totalBytesWritten += await dataWriter.StoreAsync().AsTask(cancellationTokenSource.Token);

                syncProgress += progressIncreasePerWrite;

                // Rounding our value up because backgroundTaskInstance.progress is an unsigned int
                backgroundTaskInstance.Progress = Convert.ToUInt32(Math.Ceiling(syncProgress));
            }

            return totalBytesWritten;
        }

Member Data Documentation

IBackgroundTaskInstance backgroundTaskInstance [private]

Definition at line 27 of file IoSyncBackgroundTask.cs.

CancellationTokenSource cancellationTokenSource [private]

Definition at line 33 of file IoSyncBackgroundTask.cs.

BackgroundTaskDeferral deferral [private]

Definition at line 26 of file IoSyncBackgroundTask.cs.

UsbDevice device [private]

Definition at line 31 of file IoSyncBackgroundTask.cs.

DeviceUseDetails deviceSyncDetails [private]

Definition at line 29 of file IoSyncBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/BackgroundTask/IoSyncBackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocalSettingKeys Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • LocalSettingKeys
Public Attributes

LocalSettingKeys Class Reference

List of all members.

Public Attributes

const String | SyncBackgroundTaskResult = "SyncBackgroundTaskResult"
const String | SyncBackgroundTaskStatus = "SyncBackgroundTaskStatus"

Detailed Description

Definition at line 12 of file Constants.cs.

Member Data Documentation

const String SyncBackgroundTaskResult = "SyncBackgroundTaskResult"

Definition at line 15 of file Constants.cs.

const String SyncBackgroundTaskStatus = "SyncBackgroundTaskStatus"

Definition at line 14 of file Constants.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocationBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • LocationBackgroundTask
Private Member Functions | Private Attributes

LocationBackgroundTask Class Reference

List of all members.

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
async void IBackgroundTask. | Run (IBackgroundTaskInstance taskInstance)
void | WipeGeolocDataFromAppData ()
void | WriteGeolocToAppData (Geoposition pos)
void | WriteStatusToAppData (string status)

Private Attributes

CancellationTokenSource | _cts = null
IDictionary< string, object > | _values = ApplicationData.Current.LocalSettings.Values

Detailed Description

Definition at line 20 of file LocationBackgroundTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 85 of file LocationBackgroundTask.cs.

        {
            if (_cts != null)
            {
                _cts.Cancel();
                _cts = null;
            }
        }

async void IBackgroundTask. Run ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 27 of file LocationBackgroundTask.cs.

        {
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            try
            {
                // Associate a cancellation handler with the background task.
                taskInstance.Canceled += OnCanceled;

                // Get cancellation token
                _cts = new CancellationTokenSource();
                CancellationToken token = _cts.Token;

                // Create geolocator object
                Geolocator geolocator = new Geolocator();

                // Make the request for the current position
                Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);

                WriteStatusToAppData($"Time: {DateTime.Now:G}");
                WriteGeolocToAppData(pos);
            }
            catch (UnauthorizedAccessException)
            {
                WriteStatusToAppData("Disabled");
                WipeGeolocDataFromAppData();
            }
            catch (Exception ex)
            {
                WriteStatusToAppData(ex.ToString());
                WipeGeolocDataFromAppData();
            }
            finally
            {
                _cts = null;
                deferral.Complete();
            }
        }

void WipeGeolocDataFromAppData ( ) [inline, private]

Definition at line 73 of file LocationBackgroundTask.cs.

        {
            _values.Remove("Latitude");
            _values.Remove("Longitude");
            _values.Remove("Accuracy");
        }

void WriteGeolocToAppData ( Geoposition pos ) [inline, private]

Definition at line 66 of file LocationBackgroundTask.cs.

        {
            _values["Latitude"] = pos.Coordinate.Point.Position.Latitude.ToString();
            _values["Longitude"] = pos.Coordinate.Point.Position.Longitude.ToString();
            _values["Accuracy"] = pos.Coordinate.Accuracy.ToString();
        }

void WriteStatusToAppData ( string status ) [inline, private]

Definition at line 80 of file LocationBackgroundTask.cs.

        {
            _values["Status"] = status;
        }

Member Data Documentation

CancellationTokenSource _cts = null [private]

Definition at line 22 of file LocationBackgroundTask.cs.

IDictionary<string, object> _values = ApplicationData.Current.LocalSettings.Values [private]

Definition at line 25 of file LocationBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Tasks/LocationBackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • Scenario1_BackgroundTask
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_BackgroundTask Class Reference

List of all members.

Public Member Functions

void | Dispose ()
void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
void | ReadingChanged (object sender, AccelerometerReadingChangedEventArgs e)

Private Attributes

Accelerometer Accelerometer
BackgroundTaskDeferral | Deferral
ulong | SampleCount

Detailed Description

Definition at line 17 of file Scenario1_BackgroundTask.cs.

Member Function Documentation

void Dispose ( ) [inline]

Frees resources held by this background task.

Definition at line 77 of file Scenario1_BackgroundTask.cs.

        {
        }

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Called when the background task is canceled by the app or by the system.

Parameters:
sender
reason

Definition at line 58 of file Scenario1_BackgroundTask.cs.

        {
            ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = reason.ToString();
            ApplicationData.Current.LocalSettings.Values["SampleCount"] = SampleCount;
            ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;

            if (null != Accelerometer)
            {
                Accelerometer.ReadingChanged -= new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
                Accelerometer.ReportInterval = 0;
            }

            // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
            Deferral.Complete();
        }

void ReadingChanged | ( | object | sender,
 |  | AccelerometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for acceleroemter ReadingChanged events.

Parameters:
sender
e

Definition at line 86 of file Scenario1_BackgroundTask.cs.

        {
            SampleCount++;

            // Save the sample count if the foreground app is visible.
            bool appVisible = (bool)ApplicationData.Current.LocalSettings.Values["IsAppVisible"];
            if (appVisible)
            {
                ApplicationData.Current.LocalSettings.Values["SampleCount"] = SampleCount;
            }
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Background task entry point.

Parameters:
taskInstance

Definition at line 27 of file Scenario1_BackgroundTask.cs.

        {
            Accelerometer = Accelerometer.GetDefault();

            if (null != Accelerometer)
            {
                SampleCount = 0;

                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                uint minReportIntervalMsecs = Accelerometer.MinimumReportInterval;
                Accelerometer.ReportInterval = minReportIntervalMsecs > 16 ? minReportIntervalMsecs : 16;

                // Subscribe to accelerometer ReadingChanged events.
                Accelerometer.ReadingChanged += new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);

                // Take a deferral that is released when the task is completed.
                Deferral = taskInstance.GetDeferral();

                // Get notified when the task is canceled.
                taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

                // Store a setting so that the app knows that the task is running.
                ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = true;
            }
        }

Member Data Documentation

Accelerometer Accelerometer [private]

Definition at line 19 of file Scenario1_BackgroundTask.cs.

BackgroundTaskDeferral Deferral [private]

Definition at line 20 of file Scenario1_BackgroundTask.cs.

ulong SampleCount [private]

Definition at line 21 of file Scenario1_BackgroundTask.cs.

The documentation for this class was generated from the following file:
  • BackgroundSensors/cs/BackgroundTask/Scenario1_BackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "Scenario1_BackgroundTask.h"

List of all members.

Public Member Functions

virtual | ~Scenario1_BackgroundTask ()
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)
Scenario1_BackgroundTask ()

Private Member Functions

void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^sender, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)
void | ReadingChanged (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^e)

Private Attributes

Windows::Devices::Sensors::Accelerometer | _accelerometer
Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral^> 		_deferral
Windows::Foundation::EventRegistrationToken | _readingToken
uint64 | _sampleCount

Detailed Description

Definition at line 8 of file Scenario1_BackgroundTask.h.

Constructor & Destructor Documentation

virtual ~Scenario1_BackgroundTask ( ) [virtual]

Member Function Documentation

void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | reason |
 | ) |  |  | [private]
void ReadingChanged | ( | Windows::Devices::Sensors::Accelerometer^ | sender,
 |  | Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^ | e |
 | ) |  |  | [private]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
Scenario1_BackgroundTask ( )

Member Data Documentation

Windows::Devices::Sensors::Accelerometer _accelerometer [private]

Definition at line 29 of file Scenario1_BackgroundTask.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral^> _deferral [private]

Definition at line 32 of file Scenario1_BackgroundTask.h.

Windows::Foundation::EventRegistrationToken _readingToken [private]

Definition at line 38 of file Scenario1_BackgroundTask.h.

uint64 _sampleCount [private]

Definition at line 35 of file Scenario1_BackgroundTask.h.

The documentation for this class was generated from the following file:
  • BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.h
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Sync Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • Sync
Public Attributes

Sync Class Reference

List of all members.

Public Attributes

const UInt32 | BytesToWriteAtATime = 512
const UInt32 | NumberOfTimesToWrite = 2

Detailed Description

Definition at line 24 of file Constants.cs.

Member Data Documentation

const UInt32 BytesToWriteAtATime = 512

Definition at line 26 of file Constants.cs.

const UInt32 NumberOfTimesToWrite = 2

Definition at line 27 of file Constants.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateMetadataTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • UpdateMetadataTask
Public Member Functions

UpdateMetadataTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 25 of file Tasks.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 27 of file Tasks.cs.

        {
            // A real on-demand hotspot task would contact each hotspot device to
            // obtain this information. This sample doesn't have a real hotspot device,
            // so it just repeats the information set by the UI portion of the app.
            IPropertySet values = ApplicationData.Current.LocalSettings.Values;
            if (!values.TryGetValue("hotspotGuid", out object boxedHotspotGuid))
            {
                // Nothing configured.
                return;
            }

            Guid hotspotGuid = (Guid)boxedHotspotGuid;
            WiFiOnDemandHotspotNetwork network = WiFiOnDemandHotspotNetwork.GetOrCreateById(hotspotGuid);
            WiFiOnDemandHotspotNetworkProperties properties = network.GetProperties();
            properties.Availability = (bool)values["availability"] ? WiFiOnDemandHotspotAvailability.Available : WiFiOnDemandHotspotAvailability.Unavailable;
            properties.DisplayName = (string)values["displayName"];
            properties.CellularBars = (WiFiOnDemandHotspotCellularBars?)(int?)values["bars"];
            properties.RemainingBatteryPercent = (uint?)values["battery"];
            properties.Ssid = (string)values["ssid"];
            properties.Password = new PasswordCredential { Password = (string)values["password"] };
            network.UpdateProperties(properties);
        }

The documentation for this class was generated from the following file:
  • OnDemandHotspot/cs/BackgroundTask/Tasks.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisitBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTask
  • VisitBackgroundTask
Private Member Functions | Private Attributes

VisitBackgroundTask Class Reference

List of all members.

Private Member Functions

string | GenerateVisitDescription (Geovisit visit)
void | ProcessVisitReports (GeovisitTriggerDetails triggerDetails)
void IBackgroundTask. | Run (IBackgroundTaskInstance taskInstance)

Private Attributes

IDictionary< string, object > | _values = ApplicationData.Current.LocalSettings.Values
const int | maxEventDescriptors = 42

Detailed Description

Definition at line 22 of file VisitBackgroundTask.cs.

Member Function Documentation

string GenerateVisitDescription ( Geovisit visit ) [inline, private]

Definition at line 77 of file VisitBackgroundTask.cs.

        {
            string result = $"{visit.Timestamp:G} {visit.StateChange}";

            // Check if the report has a valid position.
            if (visit.Position != null)
            {
                result += $" ({visit.Position.Coordinate.Point.Position.Latitude}, {visit.Position.Coordinate.Point.Position.Longitude})";
            }

            return result;
        }

void ProcessVisitReports ( GeovisitTriggerDetails triggerDetails ) [inline, private]

Definition at line 41 of file VisitBackgroundTask.cs.

        {
            // Load the values saved from last time.
            JsonArray visitBackgroundEvents = Helpers.LoadSavedJson("BackgroundVisitEventCollection");

            // Read reports from the triggerDetails.
            IReadOnlyList<Geovisit> reports = triggerDetails.ReadReports();

            string description = null;

            foreach (Geovisit report in reports)
            {
                description = GenerateVisitDescription(report);

                // Add to the collection, trimming old events if necessary.
                if (visitBackgroundEvents.Count == maxEventDescriptors)
                {
                    visitBackgroundEvents.RemoveAt(maxEventDescriptors - 1);
                }
                visitBackgroundEvents.Insert(0, JsonValue.CreateStringValue(description));
            }

            int numReports = reports.Count;
            if (numReports > 0)
            {
                // Save the modified results for next time.
                _values["BackgroundVisitEventCollection"] = visitBackgroundEvents.Stringify();

                if (numReports > 1)
                {
                    description = $"There are {numReports} new geofence events";
                }
                Helpers.DisplayToast(description);
            }
        }

void IBackgroundTask. Run ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 31 of file VisitBackgroundTask.cs.

        {
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
            GeovisitTriggerDetails triggerDetails = (GeovisitTriggerDetails)taskInstance.TriggerDetails;

            // Handle Visit reports
            ProcessVisitReports(triggerDetails);
            deferral.Complete();
        }

Member Data Documentation

IDictionary<string, object> _values = ApplicationData.Current.LocalSettings.Values [private]

Definition at line 29 of file VisitBackgroundTask.cs.

const int maxEventDescriptors = 42 [private]

Definition at line 26 of file VisitBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Tasks/VisitBackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvertisementPublisherTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • AdvertisementPublisherTask
Public Member Functions | Private Attributes

AdvertisementPublisherTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Attributes

IBackgroundTaskInstance | backgroundTaskInstance

Detailed Description

Definition at line 103 of file AdvertisementBackgroundTasks.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 111 of file AdvertisementBackgroundTasks.cs.

        {
            backgroundTaskInstance = taskInstance;

            var details = taskInstance.TriggerDetails as BluetoothLEAdvertisementPublisherTriggerDetails;

            if (details != null)
            {
                // If the background publisher stopped unexpectedly, an error will be available here.
                var error = details.Error;

                // The status of the publisher is useful to determine whether the advertisement payload is being serviced
                // It is possible for a publisher to stay in a Waiting state while radio resources are in use.
                var status = details.Status;

                // In this example, the background task simply constructs a message communicated
                // to the App. For more interesting applications, a notification can be sent from here instead.
                string eventMessage = "";
                eventMessage += string.Format("Publisher Status: {0}, Error: {1}",
                    status.ToString(),
                    error.ToString());

                // Store the message in a local settings indexed by this task's name so that the foreground App
                // can display this message.
                ApplicationData.Current.LocalSettings.Values[taskInstance.Task.Name] = eventMessage;
            }
        }

Member Data Documentation

IBackgroundTaskInstance backgroundTaskInstance [private]

Definition at line 105 of file AdvertisementBackgroundTasks.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Tasks/AdvertisementBackgroundTasks.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvertisementWatcherTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • AdvertisementWatcherTask
Public Member Functions | Private Attributes

AdvertisementWatcherTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Attributes

IBackgroundTaskInstance | backgroundTaskInstance

Detailed Description

Definition at line 27 of file AdvertisementBackgroundTasks.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 35 of file AdvertisementBackgroundTasks.cs.

        {
            backgroundTaskInstance = taskInstance;

            var details = taskInstance.TriggerDetails as BluetoothLEAdvertisementWatcherTriggerDetails;

            if (details != null)
            {
                // If the background watcher stopped unexpectedly, an error will be available here.
                var error = details.Error;

                // The Advertisements property is a list of all advertisement events received
                // since the last task triggered. The list of advertisements here might be valid even if
                // the Error status is not Success since advertisements are stored until this task is triggered
                IReadOnlyList<BluetoothLEAdvertisementReceivedEventArgs> advertisements = details.Advertisements;

                // The signal strength filter configuration of the trigger is returned such that further
                // processing can be performed here using these values if necessary. They are read-only here.
                var rssiFilter = details.SignalStrengthFilter;

                // In this example, the background task simply constructs a message communicated
                // to the App. For more interesting applications, a notification can be sent from here instead.
                string eventMessage = "";
                eventMessage += string.Format("ErrorStatus: {0}, EventCount: {1}, HighDBm: {2}, LowDBm: {3}, Timeout: {4}, Sampling: {5}",
                    error.ToString(),
                    advertisements.Count.ToString(),
                    rssiFilter.InRangeThresholdInDBm.ToString(),
                    rssiFilter.OutOfRangeThresholdInDBm.ToString(),
                    rssiFilter.OutOfRangeTimeout.GetValueOrDefault().TotalMilliseconds.ToString(),
                    rssiFilter.SamplingInterval.GetValueOrDefault().TotalMilliseconds.ToString());

                // Advertisements can contain multiple events that were aggregated, each represented by
                // a BluetoothLEAdvertisementReceivedEventArgs object.
                foreach (var eventArgs in advertisements)
                {
                    // Check if there are any manufacturer-specific sections.
                    // If there is, print the raw data of the first manufacturer section (if there are multiple).
                    string manufacturerDataString = "";
                    var manufacturerSections = eventArgs.Advertisement.ManufacturerData;
                    if (manufacturerSections.Count > 0)
                    {
                        var manufacturerData = manufacturerSections[0];
                        var data = new byte[manufacturerData.Data.Length];
                        using (var reader = DataReader.FromBuffer(manufacturerData.Data))
                        {
                            reader.ReadBytes(data);
                        }
                        // Print the company ID + the raw data in hex format.
                        manufacturerDataString = string.Format("0x{0}: {1}",
                            manufacturerData.CompanyId.ToString("X"),
                            BitConverter.ToString(data));
                    }
                    eventMessage += string.Format("\n[{0}] [{1}]: Rssi={2}dBm, localName={3}, manufacturerData=[{4}]",
                        eventArgs.Timestamp.ToString("hh\\:mm\\:ss\\.fff"),
                        eventArgs.AdvertisementType.ToString(),
                        eventArgs.RawSignalStrengthInDBm.ToString(),
                        eventArgs.Advertisement.LocalName,
                        manufacturerDataString);
                }

                // Store the message in a local settings indexed by this task's name so that the foreground App
                // can display this message.
                ApplicationData.Current.LocalSettings.Values[taskInstance.Task.Name] = eventMessage;
            }
        }

Member Data Documentation

IBackgroundTaskInstance backgroundTaskInstance [private]

Definition at line 29 of file AdvertisementBackgroundTasks.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Tasks/AdvertisementBackgroundTasks.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BadgeNotificationHistoryChangedTriggerTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • BadgeNotificationHistoryChangedTriggerTask
Public Member Functions

BadgeNotificationHistoryChangedTriggerTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 9 of file BadgeNotificationHistoryChangedTriggerTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 11 of file BadgeNotificationHistoryChangedTriggerTask.cs.

        {
            var details = taskInstance.TriggerDetails as ToastNotificationHistoryChangedTriggerDetail;
            if (details == null)
                return;

            //Update the badge by taking the counter and deleting one
            IReadOnlyList<ToastNotification> TNList = ToastNotificationManager.History.GetHistory();

            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent((uint)TNList.Count);

            // Send the notification to the application’s tile. Name taken from ScenarioPages.Toasts.HistoryChangedTrigger.BadgeControl
            BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile("ScenarioBadgeControl").Update(badgeContent.CreateNotification());

            // We send back the change type, the UI listens to the progress and parses the change type
            taskInstance.Progress = (uint)details.ChangeType;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/BackgroundTasks/BadgeNotificationHistoryChangedTriggerTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BadgeNumericNotificationContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • BadgeNumericNotificationContent
Public Member Functions | Properties | Private Attributes

BadgeNumericNotificationContent Class Reference

Notification content object to display a number on a tile's badge.

List of all members.

Public Member Functions

BadgeNumericNotificationContent (uint number)
BadgeNotification | CreateNotification ()
string | GetContent ()
override string | ToString ()

Properties

uint | Number [get, set]

Private Attributes

uint | m_Number = 0

Detailed Description

Definition at line 32 of file BadgeNotificationHistoryChangedTriggerTask.cs.

Constructor & Destructor Documentation

BadgeNumericNotificationContent ( uint number ) [inline]

Constructor to create a numeric badge content object with a number.

Parameters:
number The number that will appear on the badge. If the number is 0, the badge will be removed. The largest value that will appear on the badge is 99. Numbers greater than 99 are allowed, but will be displayed as "99+".

Definition at line 44 of file BadgeNotificationHistoryChangedTriggerTask.cs.

        {
            m_Number = number;
        }

Member Function Documentation

BadgeNotification CreateNotification ( ) [inline]

Creates a WinRT BadgeNotification object based on the content.

Returns:
A WinRT BadgeNotification object based on the content.

Definition at line 81 of file BadgeNotificationHistoryChangedTriggerTask.cs.

        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(GetContent());
            return new BadgeNotification(xmlDoc);
        }

string GetContent ( ) [inline]

Retrieves the notification Xml content as a string.

Returns:
The notification Xml content as a string.

Definition at line 64 of file BadgeNotificationHistoryChangedTriggerTask.cs.

        {
            return String.Format("<badge version='{0}' value='{1}'/>", Util.NOTIFICATION_CONTENT_VERSION, m_Number);
        }

override string ToString ( ) [inline]

Retrieves the notification Xml content as a string.

Returns:
The notification Xml content as a string.

Definition at line 73 of file BadgeNotificationHistoryChangedTriggerTask.cs.

        {
            return GetContent();
        }

Member Data Documentation

uint m_Number = 0 [private]

Definition at line 35 of file BadgeNotificationHistoryChangedTriggerTask.cs.

Property Documentation

uint Number [get, set]

The number that will appear on the badge.

If the number is 0, the badge will be removed. The largest value that will appear on the badge is 99. Numbers greater than 99 are allowed, but will be displayed as "99+".

Definition at line 55 of file BadgeNotificationHistoryChangedTriggerTask.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/BackgroundTasks/BadgeNotificationHistoryChangedTriggerTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RfcommServerTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • RfcommServerTask
Public Member Functions | Private Member Functions | Private Attributes

RfcommServerTask Class Reference

List of all members.

Public Member Functions

async void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance taskInstance, BackgroundTaskCancellationReason reason)
async void | PeriodicTimerCallback (ThreadPoolTimer timer)
async Task< int > | ReceiveDataAsync ()

Private Attributes

BackgroundTaskCancellationReason | cancelReason = BackgroundTaskCancellationReason.Abort
bool | cancelRequested = false
BackgroundTaskDeferral | deferral = null
ThreadPoolTimer | periodicTimer = null
DataReader | reader = null
BluetoothDevice | remoteDevice = null
StreamSocket | socket = null
IBackgroundTaskInstance | taskInstance = null
DataWriter | writer = null

Detailed Description

Definition at line 26 of file RfcommServerTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | taskInstance,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 90 of file RfcommServerTask.cs.

        {
            cancelReason = reason;
            cancelRequested = true;

            ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = cancelReason.ToString();
            ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
            ApplicationData.Current.LocalSettings.Values["ReceivedMessage"] = "";
            // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
            deferral.Complete();
        }

async void PeriodicTimerCallback ( ThreadPoolTimer timer ) [inline, private]

Periodically check if there's a new message and if there is, send it over the socket.

Parameters:
timer

Definition at line 134 of file RfcommServerTask.cs.

        {
            if (!cancelRequested)
            {
                string message = (string)ApplicationData.Current.LocalSettings.Values["SendMessage"];
                if (!string.IsNullOrEmpty(message))
                {
                    try
                    {
                        // Make sure that the connection is still up and there is a message to send
                        if (socket != null)
                        {
                            writer.WriteUInt32((uint)message.Length);
                            writer.WriteString(message);
                            await writer.StoreAsync();

                            ApplicationData.Current.LocalSettings.Values["SendMessage"] = null;
                        }
                        else
                        {
                            cancelReason = BackgroundTaskCancellationReason.ConditionLoss;
                            deferral.Complete();
                        }
                    }
                    catch (Exception ex)
                    {
                        ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = ex.Message;
                        ApplicationData.Current.LocalSettings.Values["SendMessage"] = null;
                        deferral.Complete();
                    }
                }
            }
            else
            {
                // Timer clean up
                periodicTimer.Cancel();
                //
                // Write to LocalSettings to indicate that this background task ran.
                //
                ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = cancelReason.ToString();
            }
        }

async Task<int> ReceiveDataAsync ( ) [inline, private]

Definition at line 102 of file RfcommServerTask.cs.

        {
            while (true)
            {
                uint readLength = await reader.LoadAsync(sizeof(uint));
                if (readLength < sizeof(uint))
                {
                    ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
                    // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
                    deferral.Complete();
                }
                uint currentLength = reader.ReadUInt32();

                readLength = await reader.LoadAsync(currentLength);
                if (readLength < currentLength)
                {
                    ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
                    // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
                    deferral.Complete();
                }
                string message = reader.ReadString(currentLength);

                ApplicationData.Current.LocalSettings.Values["ReceivedMessage"] = message;
                taskInstance.Progress += 1;
            }
        }

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 44 of file RfcommServerTask.cs.

        {
            // Get the deferral to prevent the task from closing prematurely
            deferral = taskInstance.GetDeferral();

            // Setup our onCanceled callback and progress
            this.taskInstance = taskInstance;
            this.taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
            this.taskInstance.Progress = 0;

            // Store a setting so that the app knows that the task is running.
            ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = true;

            periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(new TimerElapsedHandler(PeriodicTimerCallback), TimeSpan.FromSeconds(1));

            try
            {
                RfcommConnectionTriggerDetails details = (RfcommConnectionTriggerDetails)taskInstance.TriggerDetails;
                if (details != null)
                {
                    socket = details.Socket;
                    remoteDevice = details.RemoteDevice;
                    ApplicationData.Current.LocalSettings.Values["RemoteDeviceName"] = remoteDevice.Name;

                    writer = new DataWriter(socket.OutputStream);
                    reader = new DataReader(socket.InputStream);
                }
                else
                {
                    ApplicationData.Current.LocalSettings.Values["BackgroundTaskStatus"] = "Trigger details returned null";
                    deferral.Complete();
                }

                var result = await ReceiveDataAsync();
            }
            catch (Exception ex)
            {
                reader = null;
                writer = null;
                socket = null;
                deferral.Complete();

                Debug.WriteLine("Exception occurred while initializing the connection, hr = " + ex.HResult.ToString("X"));
            }
        }

Member Data Documentation

BackgroundTaskCancellationReason cancelReason = BackgroundTaskCancellationReason.Abort [private]

Definition at line 36 of file RfcommServerTask.cs.

bool cancelRequested = false [private]

Definition at line 37 of file RfcommServerTask.cs.

BackgroundTaskDeferral deferral = null [private]

Definition at line 34 of file RfcommServerTask.cs.

ThreadPoolTimer periodicTimer = null [private]

Definition at line 39 of file RfcommServerTask.cs.

DataReader reader = null [private]

Definition at line 30 of file RfcommServerTask.cs.

BluetoothDevice remoteDevice = null [private]

Definition at line 32 of file RfcommServerTask.cs.

StreamSocket socket = null [private]

Definition at line 29 of file RfcommServerTask.cs.

IBackgroundTaskInstance taskInstance = null [private]

Definition at line 35 of file RfcommServerTask.cs.

DataWriter writer = null [private]

Definition at line 31 of file RfcommServerTask.cs.

The documentation for this class was generated from the following file:
  • BluetoothRfcommChat/cs/Tasks/RfcommServerTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToastActivationTypeBackgroundClosedTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • ToastActivationTypeBackgroundClosedTask
Public Member Functions

ToastActivationTypeBackgroundClosedTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 7 of file ToastActivationTypeBackgroundClosedTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 9 of file ToastActivationTypeBackgroundClosedTask.cs.

        {
            var details = taskInstance.TriggerDetails as ToastNotificationActionTriggerDetail;
            if (details == null)
            {
                ToastHelper.PopToast("ERROR", "TriggerDetails was not ToastNotificationActionTriggerDetail.");
                return;
            }

            string arguments = details.Argument;

            if (arguments == null || !arguments.Equals("quickReply"))
            {
                ToastHelper.PopToast("ERROR", $"Expected arguments to be 'quickReply' but was '{arguments}'.");
                return;
            }

            var result = details.UserInput;

            if (result.Count != 1)
                ToastHelper.PopToast("ERROR", "ERROR: Expected 1 user input value, but there were " + result.Count);

            else if (!result.ContainsKey("message"))
                ToastHelper.PopToast("ERROR", "ERROR: Expected a user input value for 'message', but there was none.");

            else if (!(result["message"] as string).Equals("Windows 10"))
                ToastHelper.PopToast("ERROR", "ERROR: User input value for 'message' was not 'Windows 10'");

            else
            {
                ToastHelper.PopToast("SUCCESS", "This scenario successfully completed. Please mark it as passed.");
            }
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/BackgroundTasks/ToastActivationTypeBackgroundClosedTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToastNotificationHistoryChangedTriggerTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • ToastNotificationHistoryChangedTriggerTask
Public Member Functions

ToastNotificationHistoryChangedTriggerTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 6 of file ToastNotificationHistoryChangedTriggerTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 8 of file ToastNotificationHistoryChangedTriggerTask.cs.

        {
            var details = taskInstance.TriggerDetails as ToastNotificationHistoryChangedTriggerDetail;
            if (details == null)
                return;

            // We send back the change type, the UI listens to the progress and parses the change type
            taskInstance.Progress = (uint)details.ChangeType;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/BackgroundTasks/ToastNotificationHistoryChangedTriggerTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToastNotificationQuickReplyTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BackgroundTasks
  • ToastNotificationQuickReplyTask
Public Member Functions

ToastNotificationQuickReplyTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 7 of file ToastNotificationQuickReplyTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 9 of file ToastNotificationQuickReplyTask.cs.

        {
            var details = taskInstance.TriggerDetails as ToastNotificationActionTriggerDetail;
            if (details == null)
            {
                BackgroundTaskStorage.PutError("TriggerDetails was not ToastNotificationActionTriggerDetail.");
                return;
            }

            string arguments = details.Argument;

            if (arguments == null || !arguments.Equals("quickReply"))
            {
                BackgroundTaskStorage.PutError($"Expected arguments to be 'quickReply' but was '{arguments}'.");
                return;
            }

            BackgroundTaskStorage.PutAnswer(BackgroundTaskStorage.ConvertValueSetToApplicationDataCompositeValue(details.UserInput));

            //object obj;

            //details.UserInput.TryGetValue("message", out obj);

            //string message = obj as string;

            //if (message == null)
            //{
            //    BackgroundTaskStorage.PutError("Expected there to be a UserInput value at 'message', but there was none.");
            //    return;
            //}

            //BackgroundTaskStorage.PutAnswer(message);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/BackgroundTasks/ToastNotificationQuickReplyTask.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeDecodeTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BarcodeDecoder
  • BarcodeDecodeTask
Public Member Functions | Private Attributes

BarcodeDecodeTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Attributes

Provider | provider = null

Detailed Description

Definition at line 16 of file BarcodeDecoder.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 20 of file BarcodeDecoder.cs.

        {
            provider = new Provider(taskInstance);
        }

Member Data Documentation

Provider provider = null [private]

Definition at line 18 of file BarcodeDecoder.cs.

The documentation for this class was generated from the following file:
  • BarcodeScannerProvider/cs/BarcodeDecoder/BarcodeDecoder.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DecodeEngine Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BarcodeDecoder
  • DecodeEngine
Public Member Functions | Public Attributes | Properties | Private Attributes | Static Private Attributes

DecodeEngine Class Reference

#include "DecodeEngine.h"

List of all members.

Public Member Functions

DecodeEngine ()
async Task< DecodeResult > | DecodeAsync (SoftwareBitmap bitmap)

Public Attributes

internal | __pad0__: DecodeEngine()

Properties

List< uint > | ActiveSymbologies [get, set]
List< uint > | SupportedSymbologies [get, set]

Private Attributes

Windows::Foundation::Collections::IVector
< UINT > 		m_activeSymbologies
Windows::Media::Ocr::OcrEngine | m_ocrEngine = nullptr
Windows::Foundation::Collections::IVector
< UINT > 		m_supportedSymbologies
OcrEngine | ocrEngine = null

Static Private Attributes

static ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings

Detailed Description

Definition at line 50 of file DecodeEngine.h.

Constructor & Destructor Documentation

DecodeEngine ( ) [inline]

Definition at line 53 of file DecodeEngine.cs.

        {
            // Create OCR engine from the language set in scenario 1 configuration.
            string languageTag = localSettings.Values["decoderLanguage"] as string;

            foreach (Language lang in OcrEngine.AvailableRecognizerLanguages)
            {
                if (lang.LanguageTag == languageTag)
                {
                    ocrEngine = OcrEngine.TryCreateFromLanguage(lang);
                    break;
                }
            }

            if (ocrEngine == null)
            {
                ocrEngine = OcrEngine.TryCreateFromUserProfileLanguages();
            }

            SupportedSymbologies = new List<uint> { BarcodeSymbologies.OcrA };
            ActiveSymbologies = SupportedSymbologies;
        }

Member Function Documentation

async Task<DecodeResult> DecodeAsync ( SoftwareBitmap bitmap ) [inline]

Definition at line 76 of file DecodeEngine.cs.

        {
            // The only thing we decode is OCR.
            if (!ActiveSymbologies.Contains(BarcodeSymbologies.OcrA))
            {
                return null;
            }

            OcrResult ocrResult = await ocrEngine.RecognizeAsync(bitmap);

            // Get the text in the first non-empty line as result
            foreach (OcrLine line in ocrResult.Lines)
            {
                if (!string.IsNullOrEmpty(line.Text))
                {
                    return new DecodeResult
                    {
                        Symbology = BarcodeSymbologies.OcrA,
                        Text = line.Text
                    };
                }
            }
            return null;
        }

Member Data Documentation

internal __pad0__

Definition at line 53 of file DecodeEngine.h.

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [static, private]

Definition at line 48 of file DecodeEngine.cs.

Windows::Foundation::Collections::IVector<UINT> m_activeSymbologies [private]

Definition at line 73 of file DecodeEngine.h.

Windows::Media::Ocr::OcrEngine m_ocrEngine = nullptr [private]

Definition at line 71 of file DecodeEngine.h.

Windows::Foundation::Collections::IVector<UINT> m_supportedSymbologies [private]

Definition at line 72 of file DecodeEngine.h.

OcrEngine ocrEngine = null [private]

Definition at line 47 of file DecodeEngine.cs.

Property Documentation

List<uint> ActiveSymbologies [get, set]

Definition at line 51 of file DecodeEngine.cs.

List<uint> SupportedSymbologies [get, set]

Definition at line 50 of file DecodeEngine.cs.

The documentation for this class was generated from the following files:
  • BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.h
  • BarcodeScannerProvider/cs/BarcodeDecoder/DecodeEngine.cs
  • BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.cpp
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DecodeResult Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BarcodeDecoder
  • DecodeResult
Public Member Functions | Public Attributes | Properties

DecodeResult Class Reference

#include "DecodeEngine.h"

List of all members.

Public Member Functions

override bool | Equals (Object obj)
override int | GetHashCode ()

Public Attributes

internal | __pad0__: property UINT Symbology { UINT get() { return m_symboloy
internal | __pad1__: void set(_In_ UINT value) { m_symboloy = value

Properties

Platform::String | m_text
uint | Symbology [get, set]
string | Text [get, set]

Detailed Description

Definition at line 15 of file DecodeEngine.h.

Member Function Documentation

override bool Equals ( Object obj ) [inline]

Definition at line 28 of file DecodeEngine.cs.

        {
            DecodeResult other = obj as DecodeResult;
            if (other == null)
            {
                return false;
            }
            return (Symbology == other.Symbology) && (Text == other.Text);
        }

override int GetHashCode ( ) [inline]

Definition at line 38 of file DecodeEngine.cs.

        {
            return Text.GetHashCode() ^ (int)Symbology;
        }

Member Data Documentation

internal __pad0__

Definition at line 20 of file DecodeEngine.h.

internal __pad1__

Definition at line 22 of file DecodeEngine.h.

Property Documentation

Platform::String m_text

Definition at line 46 of file DecodeEngine.h.

uint Symbology [get, set]

Definition at line 25 of file DecodeEngine.cs.

string Text [get, set]

Definition at line 26 of file DecodeEngine.cs.

The documentation for this class was generated from the following files:
  • BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.h
  • BarcodeScannerProvider/cs/BarcodeDecoder/DecodeEngine.cs
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Provider Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BarcodeDecoder
  • Provider
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Provider Class Reference

List of all members.

Public Member Functions

Provider (IBackgroundTaskInstance backgroundTask)
void | Dispose ()

Static Public Member Functions

static BarcodeScannerReport | CreateBarcodeScannerReportFromString (string scanData, uint symbology)

Protected Member Functions

virtual void | Dispose (bool disposing)

Private Member Functions

~Provider ()
void | BackgroundTask_Canceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
async void | BarcodeScannerProviderConnection_DisableScannerRequested (BarcodeScannerProviderConnection sender, BarcodeScannerDisableScannerRequestEventArgs args)
async void | BarcodeScannerProviderConnection_EnableScannerRequested (BarcodeScannerProviderConnection sender, BarcodeScannerEnableScannerRequestEventArgs args)
async void | BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested (BarcodeScannerProviderConnection sender, BarcodeScannerGetSymbologyAttributesRequestEventArgs args)
async void | BarcodeScannerProviderConnection_HideVideoPreviewRequested (BarcodeScannerProviderConnection sender, BarcodeScannerHideVideoPreviewRequestEventArgs args)
async void | BarcodeScannerProviderConnection_SetActiveSymbologiesRequested (BarcodeScannerProviderConnection sender, BarcodeScannerSetActiveSymbologiesRequestEventArgs args)
async void | BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested (BarcodeScannerProviderConnection sender, BarcodeScannerSetSymbologyAttributesRequestEventArgs args)
async void | BarcodeScannerProviderConnection_StartSoftwareTriggerRequested (BarcodeScannerProviderConnection sender, BarcodeScannerStartSoftwareTriggerRequestEventArgs args)
async void | BarcodeScannerProviderConnection_StopSoftwareTriggerRequested (BarcodeScannerProviderConnection sender, BarcodeScannerStopSoftwareTriggerRequestEventArgs args)
async void | FrameReader_FrameArrived (BarcodeScannerFrameReader sender, BarcodeScannerFrameReaderFrameArrivedEventArgs args)
void | Initialize ()
void | RegisterEventHandlers ()
void | Task_Completed (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)

Private Attributes

IBackgroundTaskInstance | backgroundTask = null
BarcodeScannerProviderConnection | connection = null
DecodeEngine | decodeEngine = null
BackgroundTaskDeferral | deferral = null
bool | disposed = false
readonly int | E_BOUNDS = unchecked((int)0x8000000B)
BarcodeScannerFrameReader | frameReader = null
DecodeResult | previousDecodeResult = null
bool | scannerEnabled = false
Dictionary< uint,
BarcodeSymbologyAttributes > 		symbologyAttributes = new Dictionary<uint, BarcodeSymbologyAttributes>()

Detailed Description

Definition at line 24 of file Provider.cs.

Constructor & Destructor Documentation

Provider ( IBackgroundTaskInstance backgroundTask ) [inline]

Definition at line 38 of file Provider.cs.

        {
            this.backgroundTask = backgroundTask;

            var triggerDetails = (BarcodeScannerProviderTriggerDetails)backgroundTask.TriggerDetails;
            connection = triggerDetails.Connection;

            Initialize();
        }

~Provider ( ) [inline, private]

Definition at line 48 of file Provider.cs.

        {
            Dispose(false);
        }

Member Function Documentation

void BackgroundTask_Canceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 168 of file Provider.cs.

        {
            Dispose();
        }

async void BarcodeScannerProviderConnection_DisableScannerRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerDisableScannerRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 182 of file Provider.cs.

        {
            using (args.GetDeferral())
            {
                scannerEnabled = false;

                // Stop frame reader when disabled
                if (frameReader != null)
                {
                    await frameReader.StopAsync();
                }
                await args.Request.ReportCompletedAsync();
            }
        }

async void BarcodeScannerProviderConnection_EnableScannerRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerEnableScannerRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 173 of file Provider.cs.

        {
            // For BarcodeScannerProviderConnection events,
            // a deferral is not required if the only async operation
            // is ReportCompletedAsync or ReportFailedAsync.
            scannerEnabled = true;
            await args.Request.ReportCompletedAsync();
        }

async void BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerGetSymbologyAttributesRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 197 of file Provider.cs.

        {
            BarcodeSymbologyAttributes attributes;
            if (symbologyAttributes.TryGetValue(args.Request.Symbology, out attributes))
            {
                await args.Request.ReportCompletedAsync(attributes);
            }
            else
            {
                await args.Request.ReportFailedAsync(E_BOUNDS, "The requested symbology is not supported.");
            }
        }

async void BarcodeScannerProviderConnection_HideVideoPreviewRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerHideVideoPreviewRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 320 of file Provider.cs.

        {
            // There is no video preview running as background task. Simply report completed.
            await args.Request.ReportCompletedAsync();
        }

async void BarcodeScannerProviderConnection_SetActiveSymbologiesRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerSetActiveSymbologiesRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 326 of file Provider.cs.

        {
            // Ensure all symbologies being set to active are supported.
            foreach (var symbology in args.Request.Symbologies)
            {
                if (!decodeEngine.SupportedSymbologies.Contains(symbology))
                {
                    // Found invalid symbology.
                    await args.Request.ReportFailedAsync();
                    return;
                }
            }
            decodeEngine.ActiveSymbologies = new List<uint>(args.Request.Symbologies);
            await args.Request.ReportCompletedAsync();
        }

async void BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerSetSymbologyAttributesRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 210 of file Provider.cs.

        {
            // Update the symbology attributes for the specified symbology.
            BarcodeSymbologyAttributes newAttributes = args.Request.Attributes;
            BarcodeSymbologyAttributes existingAttributes;
            if (symbologyAttributes.TryGetValue(args.Request.Symbology, out existingAttributes))
            {
                // Our sample does not support these properties, but we update them for illustration purposes.
                if (existingAttributes.IsDecodeLengthSupported)
                {
                    existingAttributes.DecodeLength1 = newAttributes.DecodeLength1;
                    existingAttributes.DecodeLength2 = newAttributes.DecodeLength2;
                    existingAttributes.DecodeLengthKind = newAttributes.DecodeLengthKind;
                }
                if (existingAttributes.IsCheckDigitTransmissionSupported)
                {
                    existingAttributes.IsCheckDigitTransmissionEnabled = newAttributes.IsCheckDigitTransmissionEnabled;
                }
                if (existingAttributes.IsCheckDigitValidationSupported)
                {
                    existingAttributes.IsCheckDigitValidationEnabled = newAttributes.IsCheckDigitValidationEnabled;
                }
                // If we supported these properties, we would also have to update the parameters of the decoder
                // at this point.
                await args.Request.ReportCompletedAsync();
            }
            else
            {
                await args.Request.ReportFailedAsync(E_BOUNDS, "The requested symbology is not supported.");
            }
        }

async void BarcodeScannerProviderConnection_StartSoftwareTriggerRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerStartSoftwareTriggerRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 279 of file Provider.cs.

        {
            using (args.GetDeferral())
            {
                bool readerStarted = false;

                if (scannerEnabled)
                {
                    if (frameReader == null)
                    {
                        // Create frame reader to read video frames
                        frameReader = await connection.CreateFrameReaderAsync(BitmapPixelFormat.Nv12, new BitmapSize() { Width = 1280, Height = 720 });
                        frameReader.FrameArrived += FrameReader_FrameArrived;
                    }

                    readerStarted = await frameReader.StartAsync();
                }

                if (readerStarted)
                {
                    await args.Request.ReportCompletedAsync();
                }
                else
                {
                    await args.Request.ReportFailedAsync();
                }
            }
        }

async void BarcodeScannerProviderConnection_StopSoftwareTriggerRequested | ( | BarcodeScannerProviderConnection | sender,
 |  | BarcodeScannerStopSoftwareTriggerRequestEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 308 of file Provider.cs.

        {
            using (args.GetDeferral())
            {
                if (frameReader != null)
                {
                    await frameReader.StopAsync();
                }
                await args.Request.ReportCompletedAsync();
            }
        }

static BarcodeScannerReport CreateBarcodeScannerReportFromString | ( | string | scanData,
 |  | uint | symbology |
 | ) |  |  | [inline, static]

Definition at line 81 of file Provider.cs.

        {
            IBuffer scanDataBuffer = CryptographicBuffer.ConvertStringToBinary(scanData, BinaryStringEncoding.Utf8);
            return new BarcodeScannerReport(symbology, scanDataBuffer, scanDataBuffer);
        }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 59 of file Provider.cs.

        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                frameReader?.Dispose();
                frameReader = null;

                connection?.Dispose();
                connection = null;

                deferral?.Complete();
                deferral = null;

                disposed = true;
            }
        }

void Dispose ( ) [inline]

Definition at line 53 of file Provider.cs.

        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

async void FrameReader_FrameArrived | ( | BarcodeScannerFrameReader | sender,
 |  | BarcodeScannerFrameReaderFrameArrivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 242 of file Provider.cs.

        {
            if (!scannerEnabled)
            {
                // Return immediately if decoder is not enabled
                return;
            }

            using (args.GetDeferral())
            {
                SoftwareBitmap bitmap = null;
                using (BarcodeScannerVideoFrame frame = await sender.TryAcquireLatestFrameAsync())
                {
                    if (frame != null)
                    {
                        // Build software bitmap from pixel data
                        bitmap = SoftwareBitmap.CreateCopyFromBuffer(frame.PixelData, frame.Format, (int)frame.Width, (int)frame.Height);
                    }
                }

                if (bitmap != null)
                {
                    DecodeResult decodeResult = await decodeEngine.DecodeAsync(bitmap);

                    bitmap.Dispose();
                    bitmap = null;

                    // Report only if we have a result that is different from previous one.
                    if (decodeResult != null && !decodeResult.Equals(previousDecodeResult))
                    {
                        previousDecodeResult = decodeResult;
                        await connection.ReportScannedDataAsync(CreateBarcodeScannerReportFromString(decodeResult.Text, decodeResult.Symbology));
                    }
                }
            }
        }

void Initialize ( ) [inline, private]

Definition at line 87 of file Provider.cs.

        {
            deferral = backgroundTask.GetDeferral();
            RegisterEventHandlers();

            // Set provider information. This information is localized, so read it from our resources.
            ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse();
            connection.CompanyName = resourceLoader.GetString("Company");
            connection.Name = resourceLoader.GetString("Product");
            connection.Version = resourceLoader.GetString("Version");

            decodeEngine = new DecodeEngine();

            // Our decode engine does not support any of these features.
            var attributesBuilder = new BarcodeSymbologyAttributesBuilder
            {
                IsCheckDigitTransmissionSupported = false,
                IsCheckDigitValidationSupported = false,
                IsDecodeLengthSupported = false,
            };

            // Tell the system which symbologies we support.
            foreach (uint symbology in decodeEngine.SupportedSymbologies)
            {
                connection.SupportedSymbologies.Add(symbology);

                // Populate a dictionary for tracking symbology attributes for each supported symbology.
                // (This step is unnecessary in the case of this sample because none of these properties
                // is marked as supported in our BarcodeSymbologyAttributesBuilder, but we track them
                // in this sample in order to show how it could be done.)
                BarcodeSymbologyAttributes defaultAttributes = attributesBuilder.CreateAttributes();
                if (attributesBuilder.IsDecodeLengthSupported)
                {
                    // These are the default values, but we set them explicitly for demonstration purposes.
                    defaultAttributes.DecodeLength1 = 0;
                    defaultAttributes.DecodeLength2 = 0;
                    defaultAttributes.DecodeLengthKind = BarcodeSymbologyDecodeLengthKind.AnyLength;
                }
                if (attributesBuilder.IsCheckDigitTransmissionSupported)
                {
                    // This is the default value, but we set it explicitly for demonstration purposes.
                    defaultAttributes.IsCheckDigitTransmissionEnabled = false;
                }
                if (attributesBuilder.IsCheckDigitValidationSupported)
                {
                    // This is the default value, but we set it explicitly for demonstration purposes.
                    defaultAttributes.IsCheckDigitValidationEnabled = false;
                }
                symbologyAttributes.Add(symbology, defaultAttributes);
            }

            // Start the connection after
            // 1. Provider information is set
            // 2. Supported symbologies are added
            // 3. All event handlers are registered
            connection.Start();
        }

void RegisterEventHandlers ( ) [inline, private]

Definition at line 145 of file Provider.cs.

        {
            backgroundTask.Canceled += BackgroundTask_Canceled;
            backgroundTask.Task.Completed += Task_Completed;

            connection.EnableScannerRequested += BarcodeScannerProviderConnection_EnableScannerRequested;
            connection.DisableScannerRequested += BarcodeScannerProviderConnection_DisableScannerRequested;

            connection.GetBarcodeSymbologyAttributesRequested += BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested;
            connection.SetBarcodeSymbologyAttributesRequested += BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested;

            connection.StartSoftwareTriggerRequested += BarcodeScannerProviderConnection_StartSoftwareTriggerRequested;
            connection.StopSoftwareTriggerRequested += BarcodeScannerProviderConnection_StopSoftwareTriggerRequested;

            connection.HideVideoPreviewRequested += BarcodeScannerProviderConnection_HideVideoPreviewRequested;
            connection.SetActiveSymbologiesRequested += BarcodeScannerProviderConnection_SetActiveSymbologiesRequested;
        }

void Task_Completed | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 163 of file Provider.cs.

        {
            Dispose();
        }

Member Data Documentation

IBackgroundTaskInstance backgroundTask = null [private]

Definition at line 28 of file Provider.cs.

BarcodeScannerProviderConnection connection = null [private]

Definition at line 34 of file Provider.cs.

DecodeEngine decodeEngine = null [private]

Definition at line 26 of file Provider.cs.

BackgroundTaskDeferral deferral = null [private]

Definition at line 31 of file Provider.cs.

bool disposed = false [private]

Definition at line 33 of file Provider.cs.

readonly int E_BOUNDS = unchecked((int)0x8000000B) [private]

Definition at line 36 of file Provider.cs.

BarcodeScannerFrameReader frameReader = null [private]

Definition at line 32 of file Provider.cs.

DecodeResult previousDecodeResult = null [private]

Definition at line 27 of file Provider.cs.

bool scannerEnabled = false [private]

Definition at line 29 of file Provider.cs.

Dictionary<uint, BarcodeSymbologyAttributes> symbologyAttributes = new Dictionary<uint, BarcodeSymbologyAttributes>() [private]

Definition at line 30 of file Provider.cs.

The documentation for this class was generated from the following files:
  • BarcodeScannerProvider/cs/BarcodeDecoder/Provider.cs
  • BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.cpp
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BarcodeDecoder
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "BarcodeDecoder.h"

List of all members.

Public Member Functions

virtual | ~Provider ()
Provider (Windows::ApplicationModel::Background::IBackgroundTaskInstance^backgroundTask)
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)

Private Member Functions

void | BackgroundTask_Canceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^sender, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason args)
void | BarcodeScannerProviderConnection_DisableScannerRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerDisableScannerRequestEventArgs^args)
void | BarcodeScannerProviderConnection_EnableScannerRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerEnableScannerRequestEventArgs^args)
void | BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerGetSymbologyAttributesRequestEventArgs^args)
void | BarcodeScannerProviderConnection_HideVideoPreviewRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerHideVideoPreviewRequestEventArgs^args)
void | BarcodeScannerProviderConnection_SetActiveSymbologiesRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerSetActiveSymbologiesRequestEventArgs^args)
void | BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerSetSymbologyAttributesRequestEventArgs^args)
void | BarcodeScannerProviderConnection_StartSoftwareTriggerRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerStartSoftwareTriggerRequestEventArgs^args)
void | BarcodeScannerProviderConnection_StopSoftwareTriggerRequested (Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerStopSoftwareTriggerRequestEventArgs^args)
void | CleanUp ()
Windows::Devices::PointOfService::BarcodeScannerReport | CreateBarcodeScannerReportFromString (Platform::String^barcodeString, UINT barcodeSymbology)
void | FrameReader_FrameArrived (Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReader^sender, Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReaderFrameArrivedEventArgs^args)
void | Initialize ()
void | RegisterEventHandlers ()
void | Task_Completed (Windows::ApplicationModel::Background::BackgroundTaskRegistration^sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

Private Attributes

Windows::ApplicationModel::Background::IBackgroundTaskInstance | m_backgroundTask
Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection | m_connection
DecodeEngine m_decodeEngine
Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral > 		m_deferral
Windows::Foundation::EventRegistrationToken | m_disableScannerRequestedToken
Windows::Foundation::EventRegistrationToken | m_enableScannerRequestedToken
Windows::Foundation::EventRegistrationToken | m_frameArrivedToken
Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReader | m_frameReader
Windows::Foundation::EventRegistrationToken | m_getActiveSymbologiesRequestedToken
Windows::Foundation::EventRegistrationToken | m_getBarcodeSymbologyAttributesRequestedToken
Windows::Foundation::EventRegistrationToken | m_hideVideoPreviewRequestedToken
DecodeResult m_previousDecodeResult
bool | m_scannerEnabled = false
Windows::Foundation::EventRegistrationToken | m_setBarcodeSymbologyAttributesRequestedToken
Windows::Foundation::EventRegistrationToken | m_startSoftwareTriggerRequestedToken
Windows::Foundation::EventRegistrationToken | m_stopSoftwareTriggerRequestedToken
std::map< UINT,
Windows::Devices::PointOfService::BarcodeSymbologyAttributes^> 		m_symbologyAttributes

Detailed Description

Definition at line 16 of file BarcodeDecoder.h.

Constructor & Destructor Documentation

virtual ~Provider ( ) [virtual]

Member Function Documentation

void BackgroundTask_Canceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_DisableScannerRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerDisableScannerRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_EnableScannerRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerEnableScannerRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerGetSymbologyAttributesRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_HideVideoPreviewRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerHideVideoPreviewRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_SetActiveSymbologiesRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerSetActiveSymbologiesRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerSetSymbologyAttributesRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_StartSoftwareTriggerRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerStartSoftwareTriggerRequestEventArgs^ | args |
 | ) |  |  | [private]
void BarcodeScannerProviderConnection_StopSoftwareTriggerRequested | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerStopSoftwareTriggerRequestEventArgs^ | args |
 | ) |  |  | [private]
void CleanUp ( ) [private]
Windows::Devices::PointOfService::BarcodeScannerReport CreateBarcodeScannerReportFromString | ( | Platform::String^ | barcodeString,
 |  | UINT | barcodeSymbology |
 | ) |  |  | [private]
void FrameReader_FrameArrived | ( | Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReader^ | sender,
 |  | Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReaderFrameArrivedEventArgs^ | args |
 | ) |  |  | [private]
void Initialize ( ) [private]
Provider ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ backgroundTask )
void RegisterEventHandlers ( ) [private]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
void Task_Completed | ( | Windows::ApplicationModel::Background::BackgroundTaskRegistration^ | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::ApplicationModel::Background::IBackgroundTaskInstance m_backgroundTask [private]

Definition at line 29 of file Provider.h.

Windows::Devices::PointOfService::Provider::BarcodeScannerProviderConnection m_connection [private]

Definition at line 25 of file Provider.h.

DecodeEngine m_decodeEngine [private]

Definition at line 33 of file Provider.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral> m_deferral [private]

Definition at line 30 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_disableScannerRequestedToken [private]

Definition at line 39 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_enableScannerRequestedToken [private]

Definition at line 38 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_frameArrivedToken [private]

Definition at line 37 of file Provider.h.

Windows::Devices::PointOfService::Provider::BarcodeScannerFrameReader m_frameReader [private]

Definition at line 32 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_getActiveSymbologiesRequestedToken [private]

Definition at line 45 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_getBarcodeSymbologyAttributesRequestedToken [private]

Definition at line 40 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_hideVideoPreviewRequestedToken [private]

Definition at line 44 of file Provider.h.

DecodeResult m_previousDecodeResult [private]

Definition at line 35 of file Provider.h.

bool m_scannerEnabled = false [private]

Definition at line 26 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_setBarcodeSymbologyAttributesRequestedToken [private]

Definition at line 41 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_startSoftwareTriggerRequestedToken [private]

Definition at line 42 of file Provider.h.

Windows::Foundation::EventRegistrationToken m_stopSoftwareTriggerRequestedToken [private]

Definition at line 43 of file Provider.h.

std::map<UINT, Windows::Devices::PointOfService::BarcodeSymbologyAttributes^> m_symbologyAttributes [private]

Definition at line 27 of file Provider.h.

The documentation for this class was generated from the following files:
  • BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.h
  • BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.h
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • AppView
Public Member Functions | Private Member Functions | Private Attributes

AppView Class Reference

The IFrameworkView connects the app with Windows and handles application lifecycle events.

List of all members.

Public Member Functions

AppView ()
void | Dispose ()
void | Initialize (CoreApplicationView applicationView)
void | Load (string entryPoint)
void | OnLaunched (LaunchActivatedEventArgs args)
void | Run ()
void | SetWindow (CoreWindow window)
void | Uninitialize ()

Private Member Functions

void | OnKeyPressed (CoreWindow sender, KeyEventArgs args)
void | OnPointerPressed (CoreWindow sender, PointerEventArgs args)
void | OnResuming (object sender, object args)
void | OnSuspending (object sender, SuspendingEventArgs args)
void | OnViewActivated (CoreApplicationView sender, IActivatedEventArgs args)
void | OnVisibilityChanged (CoreWindow sender, VisibilityChangedEventArgs args)
void | OnWindowClosed (CoreWindow sender, CoreWindowEventArgs arg)

Private Attributes

DeviceResources deviceResources
HolographicSpace | holographicSpace = null
HolographicTemplateAppMain main
bool | windowClosed = false
bool | windowVisible = true

Detailed Description

Definition at line 15 of file AppView.cs.

Constructor & Destructor Documentation

AppView ( ) [inline]

Definition at line 26 of file AppView.cs.

        {
            windowVisible = true;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 31 of file AppView.cs.

        {
            if (deviceResources != null)
            {
                deviceResources.Dispose();
                deviceResources = null;
            }

            if (main != null)
            {
                main.Dispose();
                main = null;
            }
        }

void Initialize ( CoreApplicationView applicationView ) [inline]

The first method called when the IFrameworkView is being created.

Use this method to subscribe for Windows shell events and to initialize your app.

Definition at line 52 of file AppView.cs.

        {
            applicationView.Activated += this.OnViewActivated;

            // Register event handlers for app lifecycle.
            CoreApplication.Suspending += this.OnSuspending;
            CoreApplication.Resuming += this.OnResuming;

            // At this point we have access to the device and we can create device-dependent
            // resources.
            deviceResources = new DeviceResources();

            main = new HolographicTemplateAppMain(deviceResources);
        }

void Load ( string entryPoint ) [inline]

The Load method can be used to initialize scene resources or to load a previously saved app state.

Definition at line 104 of file AppView.cs.

        {
        }

void OnKeyPressed | ( | CoreWindow | sender,
 |  | KeyEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 230 of file AppView.cs.

        {
            //
            // TODO: Bluetooth keyboards are supported by HoloLens. You can use this method for
            //       keyboard input if you want to support it as an optional input method for
            //       your holographic app.
            //
        }

void OnLaunched ( LaunchActivatedEventArgs args ) [inline]

Called when the app is prelaunched.Use this method to load resources ahead of time and enable faster launch times.

Definition at line 152 of file AppView.cs.

        {
            if (args.PrelaunchActivated)
            {
                //
                // TODO: Insert code to preload resources here.
                //
            }
        }

void OnPointerPressed | ( | CoreWindow | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 239 of file AppView.cs.

        {
            // Allow the user to interact with the holographic world using the mouse.
            if (null != main)
            {
                main.OnPointerPressed();
            }
        }

void OnResuming | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 196 of file AppView.cs.

        {
            // Restore any data or state that was unloaded on suspend. By default, data
            // and state are persisted when resuming from suspend. Note that this event
            // does not occur if the app was previously terminated.

            if (null != main)
            {
                main.LoadAppState();
            }

            //
            // TODO: Insert code here to load your app state.
            //
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 171 of file AppView.cs.

        {
            // Save app state asynchronously after requesting a deferral. Holding a deferral
            // indicates that the application is busy performing suspending operations. Be
            // aware that a deferral may not be held indefinitely; after about five seconds,
            // the app will be forced to exit.
            var deferral = args.SuspendingOperation.GetDeferral();

            Task.Run(() =>
                {
                    deviceResources.Trim();

                    if (null != main)
                    {
                        main.SaveAppState();
                    }

                    //
                    // TODO: Insert code here to save your app state.
                    //

                    deferral.Complete();
                });
        }

void OnViewActivated | ( | CoreApplicationView | sender,
 |  | IActivatedEventArgs | args |
 | ) |  |  | [inline, private]

Called when the app view is activated.

Activates the app's CoreWindow.

Definition at line 165 of file AppView.cs.

        {
            // Run() won't start until the CoreWindow is activated.
            sender.CoreWindow.Activate();
        }

void OnVisibilityChanged | ( | CoreWindow | sender,
 |  | VisibilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 216 of file AppView.cs.

        {
            windowVisible = args.Visible;
        }

void OnWindowClosed | ( | CoreWindow | sender,
 |  | CoreWindowEventArgs | arg |
 | ) |  |  | [inline, private]

Definition at line 221 of file AppView.cs.

        {
            windowClosed = true;
        }

void Run ( ) [inline]

This method is called after the window becomes active.

It oversees the update, draw, and present loop, and also oversees window message processing.

Definition at line 112 of file AppView.cs.

        {
            while (!windowClosed)
            {
                if (windowVisible && (null != holographicSpace))
                {
                    CoreWindow.GetForCurrentThread().Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessAllIfPresent);

                    HolographicFrame frame = main.Update();

                    if (main.Render(frame))
                    {
                        deviceResources.Present(ref frame);
                    }
                }
                else
                {
                    CoreWindow.GetForCurrentThread().Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessOneAndAllPending);
                }
            }
        }

void SetWindow ( CoreWindow window ) [inline]

Called when the CoreWindow object is created (or re-created).

Definition at line 70 of file AppView.cs.

        {
            // Register for keypress notifications.
            window.KeyDown += this.OnKeyPressed;

            // Register for pointer pressed notifications.
            window.PointerPressed += this.OnPointerPressed;

            // Register for notification that the app window is being closed.
            window.Closed += this.OnWindowClosed;

            // Register for notifications that the app window is losing focus.
            window.VisibilityChanged += this.OnVisibilityChanged;

            // Create a holographic space for the core window for the current view.
            // Presenting holographic frames that are created by this holographic space will put
            // the app into exclusive mode.
            holographicSpace = HolographicSpace.CreateForCoreWindow(window);

            // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
            // space (when available) to create a Direct3D device. The HolographicSpace
            // uses this ID3D11Device to create and manage device-based resources such as
            // swap chains.
            deviceResources.SetHolographicSpace(holographicSpace);

            // The main class uses the holographic space for updates and rendering.
            main.SetHolographicSpace(holographicSpace);
        }

void Uninitialize ( ) [inline]

Terminate events do not cause Uninitialize to be called.

It will be called if your IFrameworkView class is torn down while the app is in the foreground.

Definition at line 140 of file AppView.cs.

        {
        }

Member Data Documentation

DeviceResources deviceResources [private]

Definition at line 19 of file AppView.cs.

HolographicSpace holographicSpace = null [private]

Definition at line 24 of file AppView.cs.

HolographicTemplateAppMain main [private]

Definition at line 17 of file AppView.cs.

bool windowClosed = false [private]

Definition at line 20 of file AppView.cs.

bool windowVisible = true [private]

Definition at line 21 of file AppView.cs.

The documentation for this class was generated from the following files:
  • BasicHologram/cs/AppView.cs
  • BasicHologram/cpp/AppView.cpp
  • BasicHologram/cppwinrt/AppView.cpp
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppViewSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • AppViewSource
Public Member Functions

AppViewSource Class Reference

List of all members.

Public Member Functions

IFrameworkView CreateView ()

Detailed Description

Definition at line 6 of file AppViewSource.cs.

Member Function Documentation

IFrameworkView CreateView ( ) [inline]

Definition at line 8 of file AppViewSource.cs.

        {
            return new AppView();
        }

The documentation for this class was generated from the following files:
  • BasicHologram/cs/AppViewSource.cs
  • BasicHologram/cpp/AppView.cpp
  • BasicHologram/cppwinrt/AppView.cpp
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologramMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • BasicHologramMain
Classes | Public Member Functions | Private Member Functions | Private Attributes

BasicHologramMain Class Reference

#include "BasicHologramMain.h"

List of all members.

Classes

struct | GamepadWithButtonState

Public Member Functions

BasicHologramMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
BasicHologramMain (std::shared_ptr< DX::DeviceResources > const &deviceResources)
~BasicHologramMain ()
~BasicHologramMain ()
void | LoadAppState ()
void | LoadAppState ()
virtual void | OnDeviceLost ()
void | OnDeviceLost () override
void | OnDeviceRestored () override
virtual void | OnDeviceRestored ()
void | OnPointerPressed ()
void | OnPointerPressed ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
bool | Render (winrt::Windows::Graphics::Holographic::HolographicFrame const &holographicFrame)
void | SaveAppState ()
void | SaveAppState ()
void | SetHolographicSpace (winrt::Windows::Graphics::Holographic::HolographicSpace const &holographicSpace)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
winrt::Windows::Graphics::Holographic::HolographicFrame | Update ()
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraAdded (winrt::Windows::Graphics::Holographic::HolographicSpace const &sender, winrt::Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs const &args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnCameraRemoved (winrt::Windows::Graphics::Holographic::HolographicSpace const &sender, winrt::Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs const &args)
void | OnGamepadAdded (Platform::Object^, Windows::Gaming::Input::Gamepad^args)
void | OnGamepadAdded (winrt::Windows::Foundation::IInspectable, winrt::Windows::Gaming::Input::Gamepad const &args)
void | OnGamepadRemoved (Platform::Object^, Windows::Gaming::Input::Gamepad^args)
void | OnGamepadRemoved (winrt::Windows::Foundation::IInspectable, winrt::Windows::Gaming::Input::Gamepad const &args)
void | OnHolographicDisplayIsAvailableChanged (winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable)
void | OnHolographicDisplayIsAvailableChanged (Platform::Object^, Platform::Object^)
void | OnLocatabilityChanged (winrt::Windows::Perception::Spatial::SpatialLocator const &sender, winrt::Windows::Foundation::IInspectable const &args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | UnregisterHolographicEventHandlers ()
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
winrt::event_token | m_cameraAddedToken
winrt::event_token | m_cameraRemovedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
bool | m_canCommitDirect3D11DepthBuffer = false
bool | m_canGetDefaultHolographicDisplay = false
bool | m_canGetHolographicDisplayForCamera = false
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Foundation::EventRegistrationToken | m_gamepadAddedEventToken
winrt::event_token | m_gamepadAddedEventToken
Windows::Foundation::EventRegistrationToken | m_gamepadRemovedEventToken
winrt::event_token | m_gamepadRemovedEventToken
std::vector
< GamepadWithButtonState > 		m_gamepads
Windows::Foundation::EventRegistrationToken | m_holographicDisplayIsAvailableChangedEventToken
winrt::event_token | m_holographicDisplayIsAvailableChangedEventToken
winrt::Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
winrt::event_token | m_locatabilityChangedToken
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
bool | m_pointerPressed = false
Windows::Perception::Spatial::SpatialLocator | m_spatialLocator
winrt::Windows::Perception::Spatial::SpatialLocator | m_spatialLocator = nullptr
winrt::Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_stationaryReferenceFrame = nullptr
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_stationaryReferenceFrame
DX::StepTimer m_timer

Detailed Description

Definition at line 24 of file BasicHologramMain.h.

Constructor & Destructor Documentation

BasicHologramMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 23 of file BasicHologramMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    // If connected, a game controller can also be used for input.
    m_gamepadAddedEventToken = Gamepad::GamepadAdded +=
        ref new EventHandler<Gamepad^>(
            bind(&BasicHologramMain::OnGamepadAdded, this, _1, _2)
            );

    m_gamepadRemovedEventToken = Gamepad::GamepadRemoved +=
        ref new EventHandler<Gamepad^>(
            bind(&BasicHologramMain::OnGamepadRemoved, this, _1, _2)
            );

    for (auto const& gamepad : Gamepad::Gamepads)
    {
        OnGamepadAdded(nullptr, gamepad);
    }

    m_canGetHolographicDisplayForCamera = Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent("Windows.Graphics.Holographic.HolographicCamera", "Display");
    m_canGetDefaultHolographicDisplay = Windows::Foundation::Metadata::ApiInformation::IsMethodPresent("Windows.Graphics.Holographic.HolographicDisplay", "GetDefault");
    m_canCommitDirect3D11DepthBuffer = Windows::Foundation::Metadata::ApiInformation::IsMethodPresent("Windows.Graphics.Holographic.HolographicCameraRenderingParameters", "CommitDirect3D11DepthBuffer");
}

~BasicHologramMain ( )

Definition at line 143 of file BasicHologramMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();

    if (m_gamepadAddedEventToken.Value != 0)
    {
        Gamepad::GamepadAdded -= m_gamepadAddedEventToken;
    }
    if (m_gamepadRemovedEventToken.Value != 0)
    {
        Gamepad::GamepadRemoved -= m_gamepadRemovedEventToken;
    }
    if (m_holographicDisplayIsAvailableChangedEventToken.Value != 0)
    {
        HolographicSpace::IsAvailableChanged -= m_holographicDisplayIsAvailableChangedEventToken;
    }
}

BasicHologramMain ( std::shared_ptr< DX::DeviceResources > const & deviceResources )
~BasicHologramMain ( )

Member Function Documentation

void LoadAppState ( )

Definition at line 395 of file BasicHologramMain.cpp.

{
    //
    // TODO: Insert code here to load your app state.
    //       This method is called when the app resumes.
    //
    //       For example, load information from the SpatialAnchorStore.
    //
}

void LoadAppState ( )
void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraAdded | ( | winrt::Windows::Graphics::Holographic::HolographicSpace const & | sender,
 |  | winrt::Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs const & | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | winrt::Windows::Graphics::Holographic::HolographicSpace const & | sender,
 |  | winrt::Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs const & | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [override]
void OnDeviceLost ( ) [virtual]

Definition at line 412 of file BasicHologramMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_spinningCubeRenderer->ReleaseDeviceDependentResources();
#endif
}

void OnDeviceRestored ( ) [virtual]

Definition at line 421 of file BasicHologramMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_spinningCubeRenderer->CreateDeviceDependentResources();
#endif
}

void OnDeviceRestored ( ) [override]
void OnGamepadAdded | ( | Platform::Object^ | ,
 |  | Windows::Gaming::Input::Gamepad^ | args |
 | ) |  |  | [private]
void OnGamepadAdded | ( | winrt::Windows::Foundation::IInspectable | ,
 |  | winrt::Windows::Gaming::Input::Gamepad const & | args |
 | ) |  |  | [private]
void OnGamepadRemoved | ( | Platform::Object^ | ,
 |  | Windows::Gaming::Input::Gamepad^ | args |
 | ) |  |  | [private]
void OnGamepadRemoved | ( | winrt::Windows::Foundation::IInspectable | ,
 |  | winrt::Windows::Gaming::Input::Gamepad const & | args |
 | ) |  |  | [private]
void OnHolographicDisplayIsAvailableChanged | ( | winrt::Windows::Foundation::IInspectable | ,
 |  | winrt::Windows::Foundation::IInspectable |  |
 | ) |  |  | [private]

Definition at line 488 of file BasicHologramMain.cpp.

{
    // Get the spatial locator for the default HolographicDisplay, if one is available.
    SpatialLocator spatialLocator = nullptr;
    if (m_canGetDefaultHolographicDisplay)
    {
        HolographicDisplay defaultHolographicDisplay = HolographicDisplay::GetDefault();
        if (defaultHolographicDisplay)
        {
            spatialLocator = defaultHolographicDisplay.SpatialLocator();
        }
    }
    else
    {
        spatialLocator = SpatialLocator::GetDefault();
    }

    if (m_spatialLocator != spatialLocator)
    {
        // If the spatial locator is disconnected or replaced, we should discard all state that was
        // based on it.
        if (m_spatialLocator != nullptr)
        {
            m_spatialLocator.LocatabilityChanged(m_locatabilityChangedToken);
            m_spatialLocator = nullptr;
        }

        m_stationaryReferenceFrame = nullptr;

        if (spatialLocator != nullptr)
        {
            // Use the SpatialLocator from the default HolographicDisplay to track the motion of the device.
            m_spatialLocator = spatialLocator;

            // Respond to changes in the positional tracking state.
            m_locatabilityChangedToken = m_spatialLocator.LocatabilityChanged(std::bind(&BasicHologramMain::OnLocatabilityChanged, this, _1, _2));

            // The simplest way to render world-locked holograms is to create a stationary reference frame
            // based on a SpatialLocator. This is roughly analogous to creating a "world" coordinate system
            // with the origin placed at the device's position as the app is launched.
            m_stationaryReferenceFrame = m_spatialLocator.CreateStationaryFrameOfReferenceAtCurrentLocation();
        }
    }
}

void OnHolographicDisplayIsAvailableChanged | ( | Platform::Object^ | ,
 |  | Platform::Object^ |  |
 | ) |  |  | [private]
void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnLocatabilityChanged | ( | winrt::Windows::Perception::Spatial::SpatialLocator const & | sender,
 |  | winrt::Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
void OnPointerPressed ( )

Definition at line 405 of file BasicHologramMain.cpp.

{
    m_pointerPressed = true;
}

void OnPointerPressed ( )
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )
bool Render ( winrt::Windows::Graphics::Holographic::HolographicFrame const & holographicFrame )
void SaveAppState ( )
void SaveAppState ( )

Definition at line 385 of file BasicHologramMain.cpp.

{
    //
    // TODO: Insert code here to save your app state.
    //       This method is called when the app is about to suspend.
    //
    //       For example, store information in the SpatialAnchorStore.
    //
}

void SetHolographicSpace ( winrt::Windows::Graphics::Holographic::HolographicSpace const & holographicSpace )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 118 of file BasicHologramMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_spatialLocator != nullptr)
    {
        m_spatialLocator->LocatabilityChanged -= m_locatabilityChangedToken;
    }
}

void UnregisterHolographicEventHandlers ( ) [private]
winrt::Windows::Graphics::Holographic::HolographicFrame Update ( )
HolographicFrame Update ( )

Definition at line 165 of file BasicHologramMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

#ifdef DRAW_SAMPLE_CONTENT
    if (m_stationaryReferenceFrame != nullptr)
    {
        // Check for new input state since the last frame.
        for (auto& gamepadWithButtonState : m_gamepads)
        {
            bool buttonDownThisUpdate = ((gamepadWithButtonState.gamepad->GetCurrentReading().Buttons & GamepadButtons::A) == GamepadButtons::A);
            if (buttonDownThisUpdate && !gamepadWithButtonState.buttonAWasPressedLastFrame)
            {
                m_pointerPressed = true;
            }
            gamepadWithButtonState.buttonAWasPressedLastFrame = buttonDownThisUpdate;
        }

        SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
        SpatialPointerPose^ pose = nullptr;
        if (pointerState != nullptr)
        {
            pose = pointerState->TryGetPointerPose(m_stationaryReferenceFrame->CoordinateSystem);
        }
        else if (m_pointerPressed)
        {
            pose = SpatialPointerPose::TryGetAtTimestamp(m_stationaryReferenceFrame->CoordinateSystem, prediction->Timestamp);
        }
        m_pointerPressed = false;

        // When a Pressed gesture is detected, the sample hologram will be repositioned
        // two meters in front of the user.
        m_spinningCubeRenderer->PositionHologram(pose);
    }
#endif

    m_timer.Tick([this] ()
    {
        //
        // TODO: Update scene objects.
        //
        // Put time-based updates here. By default this code will run once per frame,
        // but if you change the StepTimer to use a fixed time step this code will
        // run as many times as needed to get to the current step.
        //

#ifdef DRAW_SAMPLE_CONTENT
        m_spinningCubeRenderer->Update(m_timer);
#endif
    });

    if (!m_canCommitDirect3D11DepthBuffer)
    {
        // On versions of the platform that do not support the CommitDirect3D11DepthBuffer API, we can control
        // image stabilization by setting a focus point with optional plane normal and velocity.
        for (auto cameraPose : prediction->CameraPoses)
        {
#ifdef DRAW_SAMPLE_CONTENT
            // The HolographicCameraRenderingParameters class provides access to set
            // the image stabilization parameters.
            HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

            // SetFocusPoint informs the system about a specific point in your scene to
            // prioritize for image stabilization. The focus point is set independently
            // for each holographic camera. When setting the focus point, put it on or
            // near content that the user is looking at.
            // In this example, we put the focus point at the center of the sample hologram.
            // You can also set the relative velocity and facing of the stabilization
            // plane using overloads of this method.
            if (m_stationaryReferenceFrame != nullptr)
            {
                renderingParameters->SetFocusPoint(
                    m_stationaryReferenceFrame->CoordinateSystem,
                    m_spinningCubeRenderer->GetPosition()
                    );
            }
#endif
        }
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 106 of file BasicHologramMain.h.

winrt::event_token m_cameraAddedToken [private]

Definition at line 106 of file BasicHologramMain.h.

winrt::event_token m_cameraRemovedToken [private]

Definition at line 107 of file BasicHologramMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 107 of file BasicHologramMain.h.

bool m_canCommitDirect3D11DepthBuffer = false [private]

Definition at line 138 of file BasicHologramMain.h.

bool m_canGetDefaultHolographicDisplay = false [private]

Definition at line 135 of file BasicHologramMain.h.

bool m_canGetHolographicDisplayForCamera = false [private]

Definition at line 132 of file BasicHologramMain.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 91 of file BasicHologramMain.h.

Windows::Foundation::EventRegistrationToken m_gamepadAddedEventToken [private]

Definition at line 109 of file BasicHologramMain.h.

winrt::event_token m_gamepadAddedEventToken [private]

Definition at line 109 of file BasicHologramMain.h.

Windows::Foundation::EventRegistrationToken m_gamepadRemovedEventToken [private]

Definition at line 110 of file BasicHologramMain.h.

winrt::event_token m_gamepadRemovedEventToken [private]

Definition at line 110 of file BasicHologramMain.h.

std::vector< GamepadWithButtonState > m_gamepads [private]

Definition at line 126 of file BasicHologramMain.h.

Windows::Foundation::EventRegistrationToken m_holographicDisplayIsAvailableChangedEventToken [private]

Definition at line 111 of file BasicHologramMain.h.

winrt::event_token m_holographicDisplayIsAvailableChangedEventToken [private]

Definition at line 111 of file BasicHologramMain.h.

winrt::Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 97 of file BasicHologramMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 97 of file BasicHologramMain.h.

winrt::event_token m_locatabilityChangedToken [private]

Definition at line 108 of file BasicHologramMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 108 of file BasicHologramMain.h.

bool m_pointerPressed = false [private]

Definition at line 129 of file BasicHologramMain.h.

Windows::Perception::Spatial::SpatialLocator m_spatialLocator [private]

Definition at line 100 of file BasicHologramMain.h.

winrt::Windows::Perception::Spatial::SpatialLocator m_spatialLocator = nullptr [private]

Definition at line 100 of file BasicHologramMain.h.

winrt::Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_stationaryReferenceFrame = nullptr [private]

Definition at line 103 of file BasicHologramMain.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_stationaryReferenceFrame [private]

Definition at line 103 of file BasicHologramMain.h.

DX::StepTimer m_timer [private]

Definition at line 94 of file BasicHologramMain.h.

The documentation for this class was generated from the following files:
  • BasicHologram/cpp/BasicHologramMain.h
  • BasicHologram/cppwinrt/BasicHologramMain.h
  • BasicHologram/cpp/BasicHologramMain.cpp
  • BasicHologram/cppwinrt/BasicHologramMain.cpp
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologramMain::GamepadWithButtonState Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • BasicHologramMain
  • BasicHologramMain::GamepadWithButtonState
Public Member Functions | Public Attributes

BasicHologramMain::GamepadWithButtonState Struct Reference

List of all members.

Public Member Functions

GamepadWithButtonState (Windows::Gaming::Input::Gamepad^gamepad, bool buttonAWasPressedLastFrame)

Public Attributes

bool | buttonAWasPressedLastFrame = false
winrt::Windows::Gaming::Input::Gamepad | gamepad
Windows::Gaming::Input::Gamepad | gamepad

Detailed Description

Definition at line 114 of file BasicHologramMain.h.

Constructor & Destructor Documentation

GamepadWithButtonState | ( | Windows::Gaming::Input::Gamepad^ | gamepad,
 |  | bool | buttonAWasPressedLastFrame |
 | ) |  |  | [inline]

Definition at line 116 of file BasicHologramMain.h.

            {
                this->gamepad = gamepad;
                this->buttonAWasPressedLastFrame = buttonAWasPressedLastFrame;
            }

Member Data Documentation

bool buttonAWasPressedLastFrame = false

Definition at line 124 of file BasicHologramMain.h.

winrt::Windows::Gaming::Input::Gamepad gamepad

Definition at line 116 of file BasicHologramMain.h.

Windows::Gaming::Input::Gamepad gamepad

Definition at line 123 of file BasicHologramMain.h.

The documentation for this struct was generated from the following files:
  • BasicHologram/cpp/BasicHologramMain.h
  • BasicHologram/cppwinrt/BasicHologramMain.h
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • CameraResources
Public Member Functions | Properties | Private Attributes

CameraResources Class Reference

Inherits BasicHologram::Common::Disposer.

List of all members.

Public Member Functions

CameraResources (HolographicCamera holographicCamera)
bool | AttachViewProjectionBuffer (DeviceResources deviceResources)
void | CreateResourcesForBackBuffer (DeviceResources deviceResources, ref HolographicCameraRenderingParameters cameraParameters)
void | ReleaseAllDeviceResources (DeviceResources deviceResources)
void | ReleaseResourcesForBackBuffer (DeviceResources deviceResources)
void | UpdateViewProjectionBuffer (DeviceResources deviceResources, HolographicCameraPose cameraPose, SpatialCoordinateSystem coordinateSystem)

Properties

SharpDX.DXGI.Format | BackBufferDxgiFormat [get]
RenderTargetView | BackBufferRenderTargetView [get]
Texture2D | BackBufferTexture2D [get]
Texture2D | DepthBufferTexture2D [get]
DepthStencilView | DepthStencilView [get]
HolographicCamera | HolographicCamera [get]
bool | IsRenderingStereoscopic [get]
Size | RenderTargetSize [get]
RawViewportF | Viewport [get]

Private Attributes

Texture2D | d3dBackBuffer
Texture2D | d3dDepthBuffer
DepthStencilView | d3dDepthStencilView
Size d3dRenderTargetSize
RenderTargetView | d3dRenderTargetView
RawViewportF | d3dViewport
SharpDX.DXGI.Format | dxgiFormat
bool | framePending = false
HolographicCamera | holographicCamera = null
bool | isStereo = false
SharpDX.Direct3D11.Buffer | viewProjectionConstantBuffer

Detailed Description

Definition at line 24 of file CameraResources.cs.

Constructor & Destructor Documentation

CameraResources ( HolographicCamera holographicCamera ) [inline]

Definition at line 49 of file CameraResources.cs.

        {
            this.holographicCamera      = holographicCamera;
            isStereo                    = holographicCamera.IsStereo;
            d3dRenderTargetSize         = holographicCamera.RenderTargetSize;

            d3dViewport.Height          = (float)d3dRenderTargetSize.Height;
            d3dViewport.Width           = (float)d3dRenderTargetSize.Width;
            d3dViewport.X               = 0;
            d3dViewport.Y               = 0;
            d3dViewport.MinDepth        = 0;
            d3dViewport.MaxDepth        = 1;
        }

Member Function Documentation

bool AttachViewProjectionBuffer ( DeviceResources deviceResources ) [inline]

Gets the view-projection constant buffer for the display, and attaches it to the shader pipeline.

Definition at line 252 of file CameraResources.cs.

        {
            // This method uses Direct3D device-based resources.
            var context = deviceResources.D3DDeviceContext;

            // Loading is asynchronous. Resources must be created before they can be updated.
            // Cameras can also be added asynchronously, in which case they must be initialized
            // before they can be used.
            if (context == null || viewProjectionConstantBuffer == null || !framePending)
            {
                return false;
            }

            // Set the viewport for this camera.
            context.Rasterizer.SetViewport(Viewport);

            // Send the constant buffer to the vertex shader.
            context.VertexShader.SetConstantBuffers(1, viewProjectionConstantBuffer);

            // The template includes a pass-through geometry shader that is used by
            // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
            // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
            // will be enabled at run-time on systems that require it.
            // If your app will also use the geometry shader for other tasks and those
            // tasks require the view/projection matrix, uncomment the following line
            // of code to send the constant buffer to the geometry shader as well.
            //context.GeometryShader.SetConstantBuffers(1, viewProjectionConstantBuffer);

            framePending = false;

            return true;
        }

void CreateResourcesForBackBuffer | ( | DeviceResources | deviceResources,
 |  | ref HolographicCameraRenderingParameters | cameraParameters |
 | ) |  |  | [inline]

Updates resources associated with a holographic camera's swap chain.

The app does not access the swap chain directly, but it does create resource views for the back buffer.

Definition at line 68 of file CameraResources.cs.

        {
            var device = deviceResources.D3DDevice;

            // Get the WinRT object representing the holographic camera's back buffer.
            IDirect3DSurface surface = cameraParameters.Direct3D11BackBuffer;

            // Get a DXGI interface for the holographic camera's back buffer.
            // Holographic cameras do not provide the DXGI swap chain, which is owned
            // by the system. The Direct3D back buffer resource is provided using WinRT
            // interop APIs.
            InteropStatics.IDirect3DDxgiInterfaceAccess surfaceDxgiInterfaceAccess = surface as InteropStatics.IDirect3DDxgiInterfaceAccess;
            IntPtr pResource = surfaceDxgiInterfaceAccess.GetInterface(InteropStatics.ID3D11Resource);

            // Determine if the back buffer has changed. If so, ensure that the render target view
            // is for the current back buffer.
            if ((null == d3dBackBuffer) || (d3dBackBuffer.NativePointer != pResource))
            {
                // Clean up references to previous resources.
                this.RemoveAndDispose(ref d3dBackBuffer);
                this.RemoveAndDispose(ref d3dRenderTargetView);

                // This can change every frame as the system moves to the next buffer in the
                // swap chain. This mode of operation will occur when certain rendering modes
                // are activated.
                d3dBackBuffer = this.ToDispose(new SharpDX.Direct3D11.Texture2D(pResource));

                // Create a render target view of the back buffer.
                // Creating this resource is inexpensive, and is better than keeping track of
                // the back buffers in order to pre-allocate render target views for each one.
                d3dRenderTargetView = this.ToDispose(new RenderTargetView(device, d3dBackBuffer));

                // Get the DXGI format for the back buffer.
                // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
                Texture2DDescription backBufferDesc = BackBufferTexture2D.Description;
                dxgiFormat = backBufferDesc.Format;

                // Check for render target size changes.
                Size currentSize = holographicCamera.RenderTargetSize;
                if (d3dRenderTargetSize != currentSize)
                {
                    // Set render target size.
                    d3dRenderTargetSize = HolographicCamera.RenderTargetSize;

                    // A new depth stencil view is also needed.
                    this.RemoveAndDispose(ref d3dDepthStencilView);
                }
            }

            // Refresh depth stencil resources, if needed.
            if (null == DepthStencilView)
            {
                // Create a depth stencil view for use with 3D rendering if needed.
                var depthStencilDesc = new Texture2DDescription
                {
                    Format    = SharpDX.DXGI.Format.R16_Typeless,
                    Width     = (int)RenderTargetSize.Width,
                    Height    = (int)RenderTargetSize.Height,
                    ArraySize = IsRenderingStereoscopic ? 2 : 1, // Create two textures when rendering in stereo.
                    MipLevels = 1, // Use a single mipmap level.
                    BindFlags = BindFlags.DepthStencil | BindFlags.ShaderResource,
                    SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0)
                };

                d3dDepthBuffer = new Texture2D(device, depthStencilDesc);
                if (d3dDepthBuffer != null)
                {
                    var depthStencilViewDesc = new DepthStencilViewDescription();
                    depthStencilViewDesc.Dimension = IsRenderingStereoscopic ? DepthStencilViewDimension.Texture2DArray : DepthStencilViewDimension.Texture2D;
                    depthStencilViewDesc.Texture2DArray.ArraySize = IsRenderingStereoscopic ? 2 : 0;
                    depthStencilViewDesc.Format = SharpDX.DXGI.Format.D16_UNorm;
                    d3dDepthStencilView = this.ToDispose(new DepthStencilView(device, d3dDepthBuffer, depthStencilViewDesc));
                }
            }

            // Create the constant buffer, if needed.
            if (null == viewProjectionConstantBuffer)
            {
                // Create a constant buffer to store view and projection matrices for the camera.
                ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
                viewProjectionConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                    device,
                    BindFlags.ConstantBuffer,
                    ref viewProjectionConstantBufferData));
            }
        }

void ReleaseAllDeviceResources ( DeviceResources deviceResources ) [inline]

Definition at line 176 of file CameraResources.cs.

        {
            ReleaseResourcesForBackBuffer(deviceResources);
            this.RemoveAndDispose(ref viewProjectionConstantBuffer);
        }

void ReleaseResourcesForBackBuffer ( DeviceResources deviceResources ) [inline]

Releases resources associated with a holographic display back buffer.

Definition at line 161 of file CameraResources.cs.

        {
            var context = deviceResources.D3DDeviceContext;

            this.RemoveAndDispose(ref d3dBackBuffer);
            this.RemoveAndDispose(ref d3dDepthBuffer);
            this.RemoveAndDispose(ref d3dRenderTargetView);
            this.RemoveAndDispose(ref d3dDepthStencilView);

            // Ensure system references to the back buffer are released by clearing the render
            // target from the graphics pipeline state, and then flushing the Direct3D context.
            context.OutputMerger.ResetTargets();
            context.Flush();
        }

void UpdateViewProjectionBuffer | ( | DeviceResources | deviceResources,
 |  | HolographicCameraPose | cameraPose,
 |  | SpatialCoordinateSystem | coordinateSystem |
 | ) |  |  | [inline]

Updates the constant buffer for the display with view and projection matrices for the current frame.

Definition at line 186 of file CameraResources.cs.

        {
            // The system changes the viewport on a per-frame basis for system optimizations.
            d3dViewport.X           = (float)cameraPose.Viewport.Left;
            d3dViewport.Y           = (float)cameraPose.Viewport.Top;
            d3dViewport.Width       = (float)cameraPose.Viewport.Width;
            d3dViewport.Height      = (float)cameraPose.Viewport.Height;
            d3dViewport.MinDepth    = 0;
            d3dViewport.MaxDepth    = 1;

            // The projection transform for each frame is provided by the HolographicCameraPose.
            HolographicStereoTransform cameraProjectionTransform = cameraPose.ProjectionTransform;

            // Get a container object with the view and projection matrices for the given
            // pose in the given coordinate system.
            HolographicStereoTransform? viewTransformContainer = cameraPose.TryGetViewTransform(coordinateSystem);

            // If TryGetViewTransform returns null, that means the pose and coordinate system
            // cannot be understood relative to one another; content cannot be rendered in this
            // coordinate system for the duration of the current frame.
            // This usually means that positional tracking is not active for the current frame, in
            // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
            // content that is not world-locked instead.
            ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
            bool viewTransformAcquired = viewTransformContainer.HasValue;
            if (viewTransformAcquired)
            {
                // Otherwise, the set of view transforms can be retrieved.
                HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer.Value;

                // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
                // constantly moving relative to the world. The view matrices need to be updated
                // every frame.
                viewProjectionConstantBufferData.viewProjectionLeft  = Matrix4x4.Transpose(
                    viewCoordinateSystemTransform.Left * cameraProjectionTransform.Left
                    );
                viewProjectionConstantBufferData.viewProjectionRight = Matrix4x4.Transpose(
                    viewCoordinateSystemTransform.Right * cameraProjectionTransform.Right
                    );
            }

            // Use the D3D device context to update Direct3D device-based resources.
            var context = deviceResources.D3DDeviceContext;

            // Loading is asynchronous. Resources must be created before they can be updated.
            if (context == null || viewProjectionConstantBuffer == null || !viewTransformAcquired)
            {
                framePending = false;
            }
            else
            {
                // Update the view and projection matrices.
                context.UpdateSubresource(ref viewProjectionConstantBufferData, viewProjectionConstantBuffer);

                framePending = true;
            }
        }

Member Data Documentation

Texture2D d3dBackBuffer [private]

Definition at line 30 of file CameraResources.cs.

Texture2D d3dDepthBuffer [private]

Definition at line 29 of file CameraResources.cs.

DepthStencilView d3dDepthStencilView [private]

Definition at line 28 of file CameraResources.cs.

Size d3dRenderTargetSize [private]

Definition at line 38 of file CameraResources.cs.

RenderTargetView d3dRenderTargetView [private]

Definition at line 27 of file CameraResources.cs.

RawViewportF d3dViewport [private]

Definition at line 37 of file CameraResources.cs.

SharpDX.DXGI.Format dxgiFormat [private]

Definition at line 36 of file CameraResources.cs.

bool framePending = false [private]

Definition at line 44 of file CameraResources.cs.

HolographicCamera holographicCamera = null [private]

Definition at line 47 of file CameraResources.cs.

bool isStereo = false [private]

Definition at line 41 of file CameraResources.cs.

SharpDX.Direct3D11.Buffer viewProjectionConstantBuffer [private]

Definition at line 33 of file CameraResources.cs.

Property Documentation

SharpDX.DXGI.Format BackBufferDxgiFormat [get]

Definition at line 309 of file CameraResources.cs.

RenderTargetView BackBufferRenderTargetView [get]

Definition at line 287 of file CameraResources.cs.

Texture2D BackBufferTexture2D [get]

Definition at line 295 of file CameraResources.cs.

Texture2D DepthBufferTexture2D [get]

Definition at line 299 of file CameraResources.cs.

DepthStencilView DepthStencilView [get]

Definition at line 291 of file CameraResources.cs.

HolographicCamera HolographicCamera [get]

Definition at line 323 of file CameraResources.cs.

bool IsRenderingStereoscopic [get]

Definition at line 317 of file CameraResources.cs.

Size RenderTargetSize [get]

Definition at line 313 of file CameraResources.cs.

RawViewportF Viewport [get]

Definition at line 305 of file CameraResources.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Common/CameraResources.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • DeviceResources
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

DeviceResources Class Reference

Controls all the DirectX device resources.

Inherits BasicHologram::Common::Disposer.

List of all members.

Public Member Functions

DeviceResources ()
void | AddHolographicCamera (HolographicCamera camera)
void | EnsureCameraResources (HolographicFrame frame, HolographicFramePrediction prediction)
void | HandleDeviceLost ()
void | InitializeUsingHolographicSpace ()
void | Present (ref HolographicFrame frame)
void | RemoveHolographicCamera (HolographicCamera camera)
void | SetHolographicSpace (HolographicSpace holographicSpace)
delegate void | SwapChainAction (Dictionary< uint, CameraResources > cameraResourcesDictionary)
delegate bool | SwapChainActionWithResult (Dictionary< uint, CameraResources > cameraResourcesDictionary)
void | Trim ()
bool | UseHolographicCameraResources (SwapChainActionWithResult callback)
void | UseHolographicCameraResources (SwapChainAction callback)

Properties

SharpDX.Direct2D1.Factory2 | D2DFactory [get]
Device3 | D3DDevice [get]
DeviceContext3 | D3DDeviceContext [get]
SharpDX.Direct3D.FeatureLevel | D3DDeviceFeatureLevel [get]
bool | D3DDeviceSupportsVprt [get]
IDirect3DDevice | D3DInteropDevice [get]
SharpDX.DirectWrite.Factory1 | DWriteFactory [get]
SharpDX.DXGI.Adapter3 | DxgiAdapter [get]
SharpDX.WIC.ImagingFactory2 | WicImagingFactory [get]

Events

EventHandler | DeviceLost
EventHandler | DeviceRestored

Private Member Functions

void | CreateDeviceIndependentResources ()
void | CreateDeviceResources ()
void | DisposeDeviceAndContext ()

Private Attributes

Dictionary< uint, CameraResources > | cameraResourcesDictionary = new Dictionary<uint, CameraResources>()
Object | cameraResourcesLock = new Object()
SharpDX.Direct2D1.Factory2 | d2dFactory
DeviceContext3 | d3dContext
Device3 | d3dDevice
bool | d3dDeviceSupportsVprt = false
FeatureLevel | d3dFeatureLevel = FeatureLevel.Level_10_0
IDirect3DDevice | d3dInteropDevice
SharpDX.DirectWrite.Factory1 | dwriteFactory
SharpDX.DXGI.Adapter3 | dxgiAdapter
HolographicSpace | holographicSpace = null
SharpDX.WIC.ImagingFactory2 | wicFactory

Detailed Description

Definition at line 15 of file DeviceResources.cs.

Constructor & Destructor Documentation

DeviceResources ( ) [inline]

Constructor for DeviceResources.

Definition at line 53 of file DeviceResources.cs.

        {
            CreateDeviceIndependentResources();
        }

Member Function Documentation

void AddHolographicCamera ( HolographicCamera camera ) [inline]

Prepares to allocate resources and adds resource views for a camera.

Locks the set of holographic camera resources until the function exits.

Definition at line 272 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                cameraResourcesDictionary.Add(camera.Id, new CameraResources(camera));
            });
        }

void CreateDeviceIndependentResources ( ) [inline, private]

Configures resources that don't depend on the Direct3D device.

Definition at line 61 of file DeviceResources.cs.

        {
            // Dispose previous references and set to null
            this.RemoveAndDispose(ref d2dFactory);
            this.RemoveAndDispose(ref dwriteFactory);
            this.RemoveAndDispose(ref wicFactory);

            // Initialize Direct2D resources.
            var debugLevel = SharpDX.Direct2D1.DebugLevel.None;
#if DEBUG
            if (DirectXHelper.SdkLayersAvailable())
            {
                debugLevel = SharpDX.Direct2D1.DebugLevel.Information;
            }
#endif

            // Initialize the Direct2D Factory.
            d2dFactory = this.ToDispose(
                new SharpDX.Direct2D1.Factory2(
                    SharpDX.Direct2D1.FactoryType.SingleThreaded,
                    debugLevel
                    )
                );

            // Initialize the DirectWrite Factory.
            dwriteFactory = this.ToDispose(
                new SharpDX.DirectWrite.Factory1(SharpDX.DirectWrite.FactoryType.Shared)
                );

            // Initialize the Windows Imaging Component (WIC) Factory.
            wicFactory = this.ToDispose(
                new SharpDX.WIC.ImagingFactory2()
                );
        }

void CreateDeviceResources ( ) [inline, private]

Configures the Direct3D device, and stores handles to it and the device context.

Definition at line 144 of file DeviceResources.cs.

        {
            DisposeDeviceAndContext();

            // This flag adds support for surfaces with a different color channel ordering
            // than the API default. It is required for compatibility with Direct2D.
            DeviceCreationFlags creationFlags = DeviceCreationFlags.BgraSupport;

#if DEBUG
            if (DirectXHelper.SdkLayersAvailable())
            {
                // If the project is in a debug build, enable debugging via SDK Layers with this flag.
                creationFlags |= DeviceCreationFlags.Debug;
            }
#endif

            // This array defines the set of DirectX hardware feature levels this app will support.
            // Note the ordering should be preserved.
            // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
            // of running on graphics cards starting with feature level 10.0.
            FeatureLevel[] featureLevels =
            {
                FeatureLevel.Level_12_1,
                FeatureLevel.Level_12_0,
                FeatureLevel.Level_11_1,
                FeatureLevel.Level_11_0,
                FeatureLevel.Level_10_1,
                FeatureLevel.Level_10_0
            };

            // Create the Direct3D 11 API device object and a corresponding context.
            try
            {
                if (null != dxgiAdapter)
                {
                    using (var device = new Device(dxgiAdapter, creationFlags, featureLevels))
                    {
                        // Store pointers to the Direct3D 11.1 API device.
                        d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                    }
                }
                else
                {
                    using (var device = new Device(DriverType.Hardware, creationFlags, featureLevels))
                    {
                        // Store a pointer to the Direct3D device.
                        d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                    }
                }
            }
            catch
            {
                // If the initialization fails, fall back to the WARP device.
                // For more information on WARP, see:
                // http://go.microsoft.com/fwlink/?LinkId=286690
                using (var device = new Device(DriverType.Warp, creationFlags, featureLevels))
                {
                    d3dDevice = this.ToDispose(device.QueryInterface<Device3>());
                }
            }

            // Cache the feature level of the device that was created.
            d3dFeatureLevel = d3dDevice.FeatureLevel;

            // Store a pointer to the Direct3D immediate context.
            d3dContext = this.ToDispose(d3dDevice.ImmediateContext3);

            // Acquire the DXGI interface for the Direct3D device.
            using (var dxgiDevice = d3dDevice.QueryInterface<SharpDX.DXGI.Device3>())
            {
                // Wrap the native device using a WinRT interop object.
                IntPtr pUnknown;
                UInt32 hr = InteropStatics.CreateDirect3D11DeviceFromDXGIDevice(dxgiDevice.NativePointer, out pUnknown);
                if (hr == 0)
                {
                    d3dInteropDevice = (IDirect3DDevice)Marshal.GetObjectForIUnknown(pUnknown);
                    Marshal.Release(pUnknown);
                }

                // Store a pointer to the DXGI adapter.
                // This is for the case of no preferred DXGI adapter, or fallback to WARP.
                dxgiAdapter = this.ToDispose(dxgiDevice.Adapter.QueryInterface<SharpDX.DXGI.Adapter3>());
            }

            // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
            var options = d3dDevice.CheckD3D113Features3();
            if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
            {
                d3dDeviceSupportsVprt = true;
            }
        }

void DisposeDeviceAndContext ( ) [inline, private]

Disposes of a device-based resources.

Definition at line 239 of file DeviceResources.cs.

        {
            // Dispose existing references to Direct3D 11 device and context, and set to null.
            this.RemoveAndDispose(ref d3dDevice);
            this.RemoveAndDispose(ref d3dContext);

            // Release the interop device.
            d3dInteropDevice = null;
        }

void EnsureCameraResources | ( | HolographicFrame | frame,
 |  | HolographicFramePrediction | prediction |
 | ) |  |  | [inline]

Validates the back buffer for each HolographicCamera and recreates resources for back buffers that have changed.

Locks the set of holographic camera resources until the function exits.

Definition at line 254 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                foreach (var pose in prediction.CameraPoses)
                {
                    var renderingParameters = frame.GetRenderingParameters(pose);
                    var cameraResources = cameraResourcesDictionary[pose.HolographicCamera.Id];

                    cameraResources.CreateResourcesForBackBuffer(this, ref renderingParameters);
                }
            });
        }

void HandleDeviceLost ( ) [inline]

Recreate all device resources and set them back to the current state.

Locks the set of holographic camera resources until the function exits.

Definition at line 300 of file DeviceResources.cs.

        {
            DeviceLost.Invoke(this, null);

            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                foreach (var pair in cameraResourcesDictionary)
                {
                    CameraResources cameraResources = pair.Value;
                    cameraResources.ReleaseAllDeviceResources(this);
                }
            });

            InitializeUsingHolographicSpace();

            DeviceRestored.Invoke(this, null);
        }

void InitializeUsingHolographicSpace ( ) [inline]

Definition at line 104 of file DeviceResources.cs.

        {
            // The holographic space might need to determine which adapter supports
            // holograms, in which case it will specify a non-zero PrimaryAdapterId.
            int shiftPos = sizeof(uint);
            ulong id = (ulong)holographicSpace.PrimaryAdapterId.LowPart | (((ulong)holographicSpace.PrimaryAdapterId.HighPart) << shiftPos);

            // When a primary adapter ID is given to the app, the app should find
            // the corresponding DXGI adapter and use it to create Direct3D devices
            // and device contexts. Otherwise, there is no restriction on the DXGI
            // adapter the app can use.
            if (id != 0)
            {
                // Create the DXGI factory.
                using (var dxgiFactory4 = new SharpDX.DXGI.Factory4())
                {
                    // Retrieve the adapter specified by the holographic space.
                    IntPtr adapterPtr;
                    dxgiFactory4.EnumAdapterByLuid((long)id, InteropStatics.IDXGIAdapter3, out adapterPtr);

                    if (adapterPtr != IntPtr.Zero)
                    {
                        dxgiAdapter = new SharpDX.DXGI.Adapter3(adapterPtr);
                    }
                }
            }
            else
            {
                this.RemoveAndDispose(ref dxgiAdapter);
            }

            CreateDeviceResources();

            holographicSpace.SetDirect3D11Device(d3dInteropDevice);
        }

void Present ( ref HolographicFrame frame ) [inline]

Present the contents of the swap chain to the screen.

Locks the set of holographic camera resources until the function exits.

Definition at line 336 of file DeviceResources.cs.

        {
            // By default, this API waits for the frame to finish before it returns.
            // Holographic apps should wait for the previous frame to finish before
            // starting work on a new frame. This allows for better results from
            // holographic frame predictions.
            var presentResult = frame.PresentUsingCurrentPrediction(
                HolographicFramePresentWaitBehavior.WaitForFrameToFinish
                );

            // The PresentUsingCurrentPrediction API will detect when the graphics device
            // changes or becomes invalid. When this happens, it is considered a Direct3D
            // device lost scenario.
            if (presentResult == HolographicFramePresentResult.DeviceRemoved)
            {
                // The Direct3D device, context, and resources should be recreated.
                HandleDeviceLost();
            }
        }

void RemoveHolographicCamera ( HolographicCamera camera ) [inline]

Definition at line 282 of file DeviceResources.cs.

        {
            UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
            {
                CameraResources cameraResources = cameraResourcesDictionary[camera.Id];

                if (null != cameraResources)
                {
                    cameraResources.ReleaseResourcesForBackBuffer(this);
                    cameraResourcesDictionary.Remove(camera.Id);
                }
            });
        }

void SetHolographicSpace ( HolographicSpace holographicSpace ) [inline]

Definition at line 96 of file DeviceResources.cs.

        {
            // Cache the holographic space. Used to re-initalize during device-lost scenarios.
            this.holographicSpace = holographicSpace;

            InitializeUsingHolographicSpace();
        }

delegate void SwapChainAction ( Dictionary< uint, CameraResources > cameraResourcesDictionary )
delegate bool SwapChainActionWithResult ( Dictionary< uint, CameraResources > cameraResourcesDictionary )
void Trim ( ) [inline]

Call this method when the app suspends.

It provides a hint to the driver that the app is entering an idle state and that temporary buffers can be reclaimed for use by other apps.

Definition at line 322 of file DeviceResources.cs.

        {
            d3dContext.ClearState();

            using (var dxgiDevice = d3dDevice.QueryInterface<SharpDX.DXGI.Device3>())
            {
                dxgiDevice.Trim();
            }
        }

bool UseHolographicCameraResources ( SwapChainActionWithResult callback ) [inline]

Device-based resources for holographic cameras are stored in a std::map.

Access this list by providing a callback to this function, and the std::map will be guarded from add and remove events until the callback returns. The callback is processed immediately and must not contain any nested calls to UseHolographicCameraResources. The callback takes a parameter of type Dictionary<uint, CameraResources> cameraResourcesDictionary through which the list of cameras will be accessed. The callback also returns a boolean result.

Definition at line 368 of file DeviceResources.cs.

        {
            bool success = false;
            lock(cameraResourcesLock)
            {
                success = callback(cameraResourcesDictionary);
            }
            return success;
        }

void UseHolographicCameraResources ( SwapChainAction callback ) [inline]

Device-based resources for holographic cameras are stored in a std::map.

Access this list by providing a callback to this function, and the std::map will be guarded from add and remove events until the callback returns. The callback is processed immediately and must not contain any nested calls to UseHolographicCameraResources. The callback takes a parameter of type Dictionary<uint, CameraResources> cameraResourcesDictionary through which the list of cameras will be accessed.

Definition at line 386 of file DeviceResources.cs.

        {
            lock(cameraResourcesLock)
            {
                callback(cameraResourcesDictionary);
            }
        }

Member Data Documentation

Dictionary<uint, CameraResources> cameraResourcesDictionary = new Dictionary<uint, CameraResources>() [private]

Definition at line 47 of file DeviceResources.cs.

Object cameraResourcesLock = new Object() [private]

Definition at line 48 of file DeviceResources.cs.

SharpDX.Direct2D1.Factory2 d2dFactory [private]

Definition at line 32 of file DeviceResources.cs.

DeviceContext3 d3dContext [private]

Definition at line 25 of file DeviceResources.cs.

Device3 d3dDevice [private]

Definition at line 24 of file DeviceResources.cs.

bool d3dDeviceSupportsVprt = false [private]

Definition at line 44 of file DeviceResources.cs.

FeatureLevel d3dFeatureLevel = FeatureLevel.Level_10_0 [private]

Definition at line 40 of file DeviceResources.cs.

IDirect3DDevice d3dInteropDevice [private]

Definition at line 29 of file DeviceResources.cs.

SharpDX.DirectWrite.Factory1 dwriteFactory [private]

Definition at line 33 of file DeviceResources.cs.

SharpDX.DXGI.Adapter3 dxgiAdapter [private]

Definition at line 26 of file DeviceResources.cs.

HolographicSpace holographicSpace = null [private]

Definition at line 37 of file DeviceResources.cs.

SharpDX.WIC.ImagingFactory2 wicFactory [private]

Definition at line 34 of file DeviceResources.cs.

Property Documentation

SharpDX.Direct2D1.Factory2 D2DFactory [get]

Definition at line 417 of file DeviceResources.cs.

Device3 D3DDevice [get]

Definition at line 397 of file DeviceResources.cs.

DeviceContext3 D3DDeviceContext [get]

Definition at line 402 of file DeviceResources.cs.

SharpDX.Direct3D.FeatureLevel D3DDeviceFeatureLevel [get]

Definition at line 432 of file DeviceResources.cs.

bool D3DDeviceSupportsVprt [get]

Definition at line 437 of file DeviceResources.cs.

IDirect3DDevice D3DInteropDevice [get]

Definition at line 412 of file DeviceResources.cs.

SharpDX.DirectWrite.Factory1 DWriteFactory [get]

Definition at line 422 of file DeviceResources.cs.

SharpDX.DXGI.Adapter3 DxgiAdapter [get]

Definition at line 407 of file DeviceResources.cs.

SharpDX.WIC.ImagingFactory2 WicImagingFactory [get]

Definition at line 427 of file DeviceResources.cs.

Event Documentation

EventHandler DeviceLost

Definition at line 18 of file DeviceResources.cs.

EventHandler DeviceRestored

Definition at line 21 of file DeviceResources.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Common/DeviceResources.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Disposer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • Disposer
Public Member Functions | Protected Member Functions | Properties

Disposer Class Reference

Inherited by CameraResources, DeviceResources, and SpinningCubeRenderer.

List of all members.

Public Member Functions

void | Dispose ()

Protected Member Functions

internal | Disposer ()
virtual void | Dispose (bool disposeManagedResources)
internal void | RemoveAndDispose< T > (ref T objectToDispose)
internal void | RemoveToDispose< T > (T objectToRemove)
internal T | ToDispose< T > (T objectToDispose)

Properties

SharpDX.DisposeCollector | DisposeCollector [get, set]
internal bool | IsDisposed [get, set]

Detailed Description

Definition at line 7 of file Disposer.cs.

Constructor & Destructor Documentation

internal Disposer ( ) [inline, protected]

Definition at line 28 of file Disposer.cs.

        {
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 14 of file Disposer.cs.

        {
            if (!IsDisposed)
            {
                Dispose(true);
                IsDisposed = true;
            }
        }

virtual void Dispose ( bool disposeManagedResources ) [inline, protected, virtual]

Definition at line 40 of file Disposer.cs.

        {
            // If the DisposeCollector exists, have it dispose of all COM objects.
            if (!IsDisposed && DisposeCollector != null)
            {
                DisposeCollector.Dispose();
            }

            // The DisposeCollector is done, and can be discarded.
            DisposeCollector = null;
        }

internal void RemoveAndDispose< T > ( ref T objectToDispose ) [inline, protected]
internal void RemoveToDispose< T > ( T objectToRemove ) [inline, protected]
internal T ToDispose< T > ( T objectToDispose ) [inline, protected]

Property Documentation

SharpDX.DisposeCollector DisposeCollector [get, set, private]

Definition at line 101 of file Disposer.cs.

internal bool IsDisposed [get, set, protected]

Definition at line 33 of file Disposer.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Common/Disposer.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InteropStatics::IDirect3DDxgiInterfaceAccess Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • InteropStatics
  • InteropStatics::IDirect3DDxgiInterfaceAccess
Public Member Functions

InteropStatics::IDirect3DDxgiInterfaceAccess Interface Reference

List of all members.

Public Member Functions

IntPtr GetInterface ([In] ref Guid iid)

Detailed Description

Definition at line 37 of file InteropStatics.cs.

Member Function Documentation

IntPtr GetInterface ( [In] ref Guid iid )
The documentation for this interface was generated from the following file:
  • BasicHologram/cs/Common/InteropStatics.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • SpatialInputHandler
Public Member Functions | Private Attributes

SpatialInputHandler Class Reference

List of all members.

Public Member Functions

SpatialInputHandler ()
SpatialInteractionSourceState | CheckForInput ()
void | OnSourcePressed (SpatialInteractionManager sender, SpatialInteractionSourceEventArgs args)

Private Attributes

SpatialInteractionManager | interactionManager
SpatialInteractionSourceState | sourceState

Detailed Description

Definition at line 7 of file SpatialInputHandler.cs.

Constructor & Destructor Documentation

SpatialInputHandler ( ) [inline]

Definition at line 16 of file SpatialInputHandler.cs.

        {
            // The interaction manager provides an event that informs the app when
            // spatial interactions are detected.
            interactionManager = SpatialInteractionManager.GetForCurrentView();

            // Bind a handler to the SourcePressed event.
            interactionManager.SourcePressed += this.OnSourcePressed;

            //
            // TODO: Expand this class to use other gesture-based input events as applicable to
            //       your app.
            //
        }

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( ) [inline]

Definition at line 34 of file SpatialInputHandler.cs.

        {
            SpatialInteractionSourceState sourceState = this.sourceState;
            this.sourceState = null;
            return sourceState;
        }

void OnSourcePressed | ( | SpatialInteractionManager | sender,
 |  | SpatialInteractionSourceEventArgs | args |
 | ) |  |  | [inline]

Definition at line 41 of file SpatialInputHandler.cs.

        {
            sourceState = args.State;

            //
            // TODO: In your app or game engine, rewrite this method to queue
            //       input events in your input class or event handler.
            //
        }

Member Data Documentation

SpatialInteractionManager interactionManager [private]

Definition at line 10 of file SpatialInputHandler.cs.

SpatialInteractionSourceState sourceState [private]

Definition at line 13 of file SpatialInputHandler.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Content/SpatialInputHandler.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StepTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • StepTimer
Public Member Functions | Properties | Static Private Member Functions | Private Attributes

StepTimer Class Reference

Helper class for animation and simulation timing.

List of all members.

Public Member Functions

StepTimer ()
void | ResetElapsedTime ()
void | Tick (Action update)

Properties

double | ElapsedSeconds [get]
long | ElapsedTicks [get]
int | FrameCount [get]
int | FramesPerSecond [get]
bool | IsFixedTimeStep [get, set]
double | TargetElapsedSeconds [get, set]
long | TargetElapsedTicks [get, set]
double | TotalSeconds [get]
long | TotalTicks [get]

Static Private Member Functions

static long | SecondsToTicks (double seconds)
static double | TicksToSeconds (long ticks)

Private Attributes

long | elapsedTicks = 0
int | frameCount = 0
int | framesPerSecond = 0
int | framesThisSecond = 0
bool | isFixedTimeStep = false
long | leftOverTicks = 0
long | qpcFrequency
long | qpcLastTime
long | qpcMaxDelta
long | qpcSecondCounter = 0
long | targetElapsedTicks = TicksPerSecond / 60
const long | TicksPerSecond = 10000000
long | totalTicks = 0

Detailed Description

Definition at line 14 of file StepTimer.cs.

Constructor & Destructor Documentation

StepTimer ( ) [inline]

Definition at line 39 of file StepTimer.cs.

        {
            qpcFrequency = Stopwatch.Frequency;
            qpcLastTime = Stopwatch.GetTimestamp();

            // Initialize max delta to 1/10 of a second.
            qpcMaxDelta = qpcFrequency / 10;
        }

Member Function Documentation

void ResetElapsedTime ( ) [inline]

After an intentional timing discontinuity (for instance a blocking IO operation) call this to avoid having the fixed timestep logic attempt a set of catch-up Update calls.

Definition at line 53 of file StepTimer.cs.

        {
            qpcLastTime = Stopwatch.GetTimestamp();

            leftOverTicks    = 0;
            framesPerSecond  = 0;
            framesThisSecond = 0;
            qpcSecondCounter = 0;
        }

static long SecondsToTicks ( double seconds ) [inline, static, private]

Definition at line 221 of file StepTimer.cs.

        {
            return (long)(seconds * TicksPerSecond);
        }

void Tick ( Action update ) [inline]

Update timer state, calling the specified Update function the appropriate number of times.

Definition at line 141 of file StepTimer.cs.

        {
            // Query the current time.
            long currentTime = Stopwatch.GetTimestamp();

            long timeDelta = currentTime - qpcLastTime;

            qpcLastTime = currentTime;
            qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > qpcMaxDelta)
            {
                timeDelta = qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= qpcFrequency;

            long lastFrameCount = frameCount;

            if (isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (Math.Abs(timeDelta - targetElapsedTicks) < (TicksPerSecond / 4000))
                {
                    timeDelta = targetElapsedTicks;
                }

                leftOverTicks += timeDelta;

                while (leftOverTicks >= targetElapsedTicks)
                {
                    elapsedTicks   = targetElapsedTicks;
                    totalTicks    += targetElapsedTicks;
                    leftOverTicks -= targetElapsedTicks;
                    frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                elapsedTicks   = timeDelta;
                totalTicks    += timeDelta;
                leftOverTicks  = 0;
                frameCount++;

                update();
            }

            // Track the current framerate.
            if (frameCount != lastFrameCount)
            {
                framesThisSecond++;
            }

            if (qpcSecondCounter >= qpcFrequency)
            {
                framesPerSecond   = framesThisSecond;
                framesThisSecond  = 0;
                qpcSecondCounter %= qpcFrequency;
            }
        }

static double TicksToSeconds ( long ticks ) [inline, static, private]

Definition at line 216 of file StepTimer.cs.

        {
            return (double)ticks / TicksPerSecond;
        }

Member Data Documentation

long elapsedTicks = 0 [private]

Definition at line 25 of file StepTimer.cs.

int frameCount = 0 [private]

Definition at line 30 of file StepTimer.cs.

int framesPerSecond = 0 [private]

Definition at line 31 of file StepTimer.cs.

int framesThisSecond = 0 [private]

Definition at line 32 of file StepTimer.cs.

bool isFixedTimeStep = false [private]

Definition at line 36 of file StepTimer.cs.

long leftOverTicks = 0 [private]

Definition at line 27 of file StepTimer.cs.

long qpcFrequency [private]

Definition at line 20 of file StepTimer.cs.

long qpcLastTime [private]

Definition at line 21 of file StepTimer.cs.

long qpcMaxDelta [private]

Definition at line 22 of file StepTimer.cs.

long qpcSecondCounter = 0 [private]

Definition at line 33 of file StepTimer.cs.

long targetElapsedTicks = TicksPerSecond / 60 [private]

Definition at line 37 of file StepTimer.cs.

const long TicksPerSecond = 10000000 [private]

Definition at line 17 of file StepTimer.cs.

long totalTicks = 0 [private]

Definition at line 26 of file StepTimer.cs.

Property Documentation

double ElapsedSeconds [get]

Get elapsed time since the previous Update call.

Definition at line 75 of file StepTimer.cs.

long ElapsedTicks [get]

Get elapsed time since the previous Update call.

Definition at line 67 of file StepTimer.cs.

int FrameCount [get]

Get total number of updates since start of the program.

Definition at line 99 of file StepTimer.cs.

int FramesPerSecond [get]

Get the current framerate.

Definition at line 107 of file StepTimer.cs.

bool IsFixedTimeStep [get, set]

Get/Set whether to use fixed or variable timestep mode.

Definition at line 115 of file StepTimer.cs.

double TargetElapsedSeconds [get, set]

Get/Set how often to call Update when in fixed timestep mode.

Definition at line 133 of file StepTimer.cs.

long TargetElapsedTicks [get, set]

Get/Set how often to call Update when in fixed timestep mode.

Definition at line 124 of file StepTimer.cs.

double TotalSeconds [get]

Get total time since the start of the program.

Definition at line 91 of file StepTimer.cs.

long TotalTicks [get]

Get total time since the start of the program.

Definition at line 83 of file StepTimer.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Common/StepTimer.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewProjectionConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Common
  • ViewProjectionConstantBuffer
Public Attributes

ViewProjectionConstantBuffer Struct Reference

Constant buffer used to send hologram position transform to the shader pipeline.

List of all members.

Public Attributes

Matrix4x4 viewProjectionLeft
Matrix4x4 viewProjectionRight

Detailed Description

Definition at line 16 of file CameraResources.cs.

Member Data Documentation

Matrix4x4 viewProjectionLeft

Definition at line 18 of file CameraResources.cs.

Matrix4x4 viewProjectionRight

Definition at line 19 of file CameraResources.cs.

The documentation for this struct was generated from the following file:
  • BasicHologram/cs/Common/CameraResources.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Content
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

Constant buffer used to send hologram position transform to the shader pipeline.

List of all members.

Public Attributes

Matrix4x4 model

Detailed Description

Definition at line 8 of file ShaderStructures.cs.

Member Data Documentation

Matrix4x4 model

Definition at line 10 of file ShaderStructures.cs.

The documentation for this struct was generated from the following file:
  • BasicHologram/cs/Content/ShaderStructures.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpinningCubeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Content
  • SpinningCubeRenderer
Public Member Functions | Properties | Private Attributes

SpinningCubeRenderer Class Reference

This sample renderer instantiates a basic rendering pipeline.

Inherits BasicHologram::Common::Disposer.

List of all members.

Public Member Functions

SpinningCubeRenderer (DeviceResources deviceResources)
async void | CreateDeviceDependentResourcesAsync ()
void | PositionHologram (SpatialPointerPose pointerPose)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Update (StepTimer timer)

Properties

Vector3 | Position [get, set]

Private Attributes

float | degreesPerSecond = 45.0f
DeviceResources deviceResources
SharpDX.Direct3D11.GeometryShader | geometryShader
SharpDX.Direct3D11.Buffer | indexBuffer
int | indexCount = 0
SharpDX.Direct3D11.InputLayout | inputLayout
bool | loadingComplete = false
SharpDX.Direct3D11.Buffer | modelConstantBuffer
ModelConstantBuffer modelConstantBufferData
SharpDX.Direct3D11.PixelShader | pixelShader
Vector3 | position = new Vector3(0.0f, 0.0f, -2.0f)
bool | usingVprtShaders = false
SharpDX.Direct3D11.Buffer | vertexBuffer
SharpDX.Direct3D11.VertexShader | vertexShader

Detailed Description

Definition at line 11 of file SpinningCubeRenderer.cs.

Constructor & Destructor Documentation

SpinningCubeRenderer ( DeviceResources deviceResources ) [inline]

Loads vertex and pixel shaders from files and instantiates the cube geometry.

Definition at line 42 of file SpinningCubeRenderer.cs.

        {
            this.deviceResources  = deviceResources;

            this.CreateDeviceDependentResourcesAsync();
        }

Member Function Documentation

async void CreateDeviceDependentResourcesAsync ( ) [inline]

Creates device-based resources to store a constant buffer, cube geometry, and vertex and pixel shaders.

In some cases this will also store a geometry shader.

Definition at line 171 of file SpinningCubeRenderer.cs.

        {
            ReleaseDeviceDependentResources();

            usingVprtShaders = deviceResources.D3DDeviceSupportsVprt;

            var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;

            // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
            // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
            // we can avoid using a pass-through geometry shader to set the render
            // target array index, thus avoiding any overhead that would be
            // incurred by setting the geometry shader stage.
            var vertexShaderFileName = usingVprtShaders ? "Content\\Shaders\\VPRTVertexShader.cso" : "Content\\Shaders\\VertexShader.cso";

            // Load the compiled vertex shader.
            var vertexShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync(vertexShaderFileName));

            // After the vertex shader file is loaded, create the shader and input layout.
            vertexShader = this.ToDispose(new SharpDX.Direct3D11.VertexShader(
                deviceResources.D3DDevice,
                vertexShaderByteCode));

            SharpDX.Direct3D11.InputElement[] vertexDesc =
            {
                new SharpDX.Direct3D11.InputElement("POSITION", 0, SharpDX.DXGI.Format.R32G32B32_Float,  0, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
                new SharpDX.Direct3D11.InputElement("COLOR",    0, SharpDX.DXGI.Format.R32G32B32_Float, 12, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
            };

            inputLayout = this.ToDispose(new SharpDX.Direct3D11.InputLayout(
                deviceResources.D3DDevice,
                vertexShaderByteCode,
                vertexDesc));

            if (!usingVprtShaders)
            {
                // Load the compiled pass-through geometry shader.
                var geometryShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\GeometryShader.cso"));

                // After the pass-through geometry shader file is loaded, create the shader.
                geometryShader = this.ToDispose(new SharpDX.Direct3D11.GeometryShader(
                    deviceResources.D3DDevice,
                    geometryShaderByteCode));
            }

            // Load the compiled pixel shader.
            var pixelShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\PixelShader.cso"));

            // After the pixel shader file is loaded, create the shader.
            pixelShader = this.ToDispose(new SharpDX.Direct3D11.PixelShader(
                deviceResources.D3DDevice,
                pixelShaderByteCode));

            // Load mesh vertices. Each vertex has a position and a color.
            // Note that the cube size has changed from the default DirectX app
            // template. Windows Holographic is scaled in meters, so to draw the
            // cube at a comfortable size we made the cube width 0.2 m (20 cm).
            VertexPositionColor[] cubeVertices =
            {
                new VertexPositionColor(new Vector3(-0.1f, -0.1f, -0.1f), new Vector3(0.0f, 0.0f, 0.0f)),
                new VertexPositionColor(new Vector3(-0.1f, -0.1f,  0.1f), new Vector3(0.0f, 0.0f, 1.0f)),
                new VertexPositionColor(new Vector3(-0.1f,  0.1f, -0.1f), new Vector3(0.0f, 1.0f, 0.0f)),
                new VertexPositionColor(new Vector3(-0.1f,  0.1f,  0.1f), new Vector3(0.0f, 1.0f, 1.0f)),
                new VertexPositionColor(new Vector3( 0.1f, -0.1f, -0.1f), new Vector3(1.0f, 0.0f, 0.0f)),
                new VertexPositionColor(new Vector3( 0.1f, -0.1f,  0.1f), new Vector3(1.0f, 0.0f, 1.0f)),
                new VertexPositionColor(new Vector3( 0.1f,  0.1f, -0.1f), new Vector3(1.0f, 1.0f, 0.0f)),
                new VertexPositionColor(new Vector3( 0.1f,  0.1f,  0.1f), new Vector3(1.0f, 1.0f, 1.0f)),
            };

            vertexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                deviceResources.D3DDevice,
                SharpDX.Direct3D11.BindFlags.VertexBuffer,
                cubeVertices));

            // Load mesh indices. Each trio of indices represents
            // a triangle to be rendered on the screen.
            // For example: 0,2,1 means that the vertices with indexes
            // 0, 2 and 1 from the vertex buffer compose the
            // first triangle of this mesh.
            ushort[] cubeIndices =
            {
                2,1,0, // -x
                2,3,1,

                6,4,5, // +x
                6,5,7,

                0,1,5, // -y
                0,5,4,

                2,6,7, // +y
                2,7,3,

                0,4,6, // -z
                0,6,2,

                1,3,7, // +z
                1,7,5,
            };

            indexCount = cubeIndices.Length;

            indexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                deviceResources.D3DDevice,
                SharpDX.Direct3D11.BindFlags.IndexBuffer,
                cubeIndices));

            // Create a constant buffer to store the model matrix.
            modelConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
                deviceResources.D3DDevice,
                SharpDX.Direct3D11.BindFlags.ConstantBuffer,
                ref modelConstantBufferData));

            // Once the cube is loaded, the object is ready to be rendered.
            loadingComplete = true;
        }

void PositionHologram ( SpatialPointerPose pointerPose ) [inline]

Definition at line 51 of file SpinningCubeRenderer.cs.

        {
            if (null != pointerPose)
            {
                // Get the gaze direction relative to the given coordinate system.
                Vector3 headPosition        = pointerPose.Head.Position;
                Vector3 headDirection       = pointerPose.Head.ForwardDirection;

                // The hologram is positioned two meters along the user's gaze direction.
                float   distanceFromUser    = 2.0f; // meters
                Vector3 gazeAtTwoMeters     = headPosition + (distanceFromUser * headDirection);

                // This will be used as the translation component of the hologram's
                // model transform.
                this.position = gazeAtTwoMeters;
            }
        }

void ReleaseDeviceDependentResources ( ) [inline]

Releases device-based resources.

Definition at line 291 of file SpinningCubeRenderer.cs.

        {
            loadingComplete = false;
            usingVprtShaders = false;
            this.RemoveAndDispose(ref vertexShader);
            this.RemoveAndDispose(ref inputLayout);
            this.RemoveAndDispose(ref pixelShader);
            this.RemoveAndDispose(ref geometryShader);
            this.RemoveAndDispose(ref modelConstantBuffer);
            this.RemoveAndDispose(ref vertexBuffer);
            this.RemoveAndDispose(ref indexBuffer);
        }

void Render ( ) [inline]

Renders one frame using the vertex and pixel shaders.

On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3:: VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature, a pass-through geometry shader is also used to set the render target array index.

Definition at line 117 of file SpinningCubeRenderer.cs.

        {
            // Loading is asynchronous. Resources must be created before drawing can occur.
            if (!this.loadingComplete)
            {
                return;
            }

            var context = this.deviceResources.D3DDeviceContext;

            // Each vertex is one instance of the VertexPositionColor struct.
            int stride = SharpDX.Utilities.SizeOf<VertexPositionColor>();
            int offset = 0;
            var bufferBinding = new SharpDX.Direct3D11.VertexBufferBinding(this.vertexBuffer, stride, offset);
            context.InputAssembler.SetVertexBuffers(0, bufferBinding);
            context.InputAssembler.SetIndexBuffer(
                this.indexBuffer,
                SharpDX.DXGI.Format.R16_UInt, // Each index is one 16-bit unsigned integer (short).
                0);
            context.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList;
            context.InputAssembler.InputLayout = this.inputLayout;

            // Attach the vertex shader.
            context.VertexShader.SetShader(this.vertexShader, null, 0);
            // Apply the model constant buffer to the vertex shader.
            context.VertexShader.SetConstantBuffers(0, this.modelConstantBuffer);

            if (!this.usingVprtShaders)
            {
                // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
                // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
                // a pass-through geometry shader is used to set the render target
                // array index.
                context.GeometryShader.SetShader(this.geometryShader, null, 0);
            }

            // Attach the pixel shader.
            context.PixelShader.SetShader(this.pixelShader, null, 0);

            // Draw the objects.
            context.DrawIndexedInstanced(
                indexCount,     // Index count per instance.
                2,              // Instance count.
                0,              // Start index location.
                0,              // Base vertex location.
                0               // Start instance location.
                );
        }

void Update ( StepTimer timer ) [inline]

Called once per frame, rotates the cube and calculates the model and view matrices.

Definition at line 72 of file SpinningCubeRenderer.cs.

        {
            // Rotate the cube.
            // Convert degrees to radians, then convert seconds to rotation angle.
            float     radiansPerSecond  = this.degreesPerSecond * ((float)Math.PI / 180.0f);
            double    totalRotation     = timer.TotalSeconds * radiansPerSecond;
            float     radians           = (float)System.Math.IEEERemainder(totalRotation, 2 * Math.PI);
            Matrix4x4 modelRotation     = Matrix4x4.CreateFromAxisAngle(new Vector3(0, 1, 0), -radians);

            // Position the cube.
            Matrix4x4 modelTranslation  = Matrix4x4.CreateTranslation(position);

            // Multiply to get the transform matrix.
            // Note that this transform does not enforce a particular coordinate system. The calling
            // class is responsible for rendering this content in a consistent manner.
            Matrix4x4 modelTransform    = modelRotation * modelTranslation;

            // The view and projection matrices are provided by the system; they are associated
            // with holographic cameras, and updated on a per-camera basis.
            // Here, we provide the model transform for the sample hologram. The model transform
            // matrix is transposed to prepare it for the shader.
            this.modelConstantBufferData.model = Matrix4x4.Transpose(modelTransform);

            // Loading is asynchronous. Resources must be created before they can be updated.
            if (!loadingComplete)
            {
                return;
            }

            // Use the D3D device context to update Direct3D device-based resources.
            var context = this.deviceResources.D3DDeviceContext;

            // Update the model transform buffer for the hologram.
            context.UpdateSubresource(ref this.modelConstantBufferData, this.modelConstantBuffer);
        }

Member Data Documentation

float degreesPerSecond = 45.0f [private]

Definition at line 32 of file SpinningCubeRenderer.cs.

DeviceResources deviceResources [private]

Definition at line 14 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.GeometryShader geometryShader [private]

Definition at line 21 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.Buffer indexBuffer [private]

Definition at line 19 of file SpinningCubeRenderer.cs.

int indexCount = 0 [private]

Definition at line 27 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.InputLayout inputLayout [private]

Definition at line 17 of file SpinningCubeRenderer.cs.

bool loadingComplete = false [private]

Definition at line 31 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.Buffer modelConstantBuffer [private]

Definition at line 23 of file SpinningCubeRenderer.cs.

ModelConstantBuffer modelConstantBufferData [private]

Definition at line 26 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.PixelShader pixelShader [private]

Definition at line 22 of file SpinningCubeRenderer.cs.

Vector3 position = new Vector3(0.0f, 0.0f, -2.0f) [private]

Definition at line 28 of file SpinningCubeRenderer.cs.

bool usingVprtShaders = false [private]

Definition at line 37 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.Buffer vertexBuffer [private]

Definition at line 18 of file SpinningCubeRenderer.cs.

SharpDX.Direct3D11.VertexShader vertexShader [private]

Definition at line 20 of file SpinningCubeRenderer.cs.

Property Documentation

Vector3 Position [get, set]

Definition at line 305 of file SpinningCubeRenderer.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Content/SpinningCubeRenderer.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Content
  • VertexPositionColor
Public Member Functions | Public Attributes

VertexPositionColor Struct Reference

Used to send per-vertex data to the vertex shader.

List of all members.

Public Member Functions

VertexPositionColor (Vector3 pos, Vector3 color)

Public Attributes

Vector3 color
Vector3 pos

Detailed Description

Definition at line 16 of file ShaderStructures.cs.

Constructor & Destructor Documentation

VertexPositionColor | ( | Vector3 | pos,
 |  | Vector3 | color |
 | ) |  |  | [inline]

Definition at line 18 of file ShaderStructures.cs.

        {
            this.pos   = pos;
            this.color = color;
        }

Member Data Documentation

Vector3 color

Definition at line 25 of file ShaderStructures.cs.

Vector3 pos

Definition at line 24 of file ShaderStructures.cs.

The documentation for this struct was generated from the following file:
  • BasicHologram/cs/Content/ShaderStructures.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTemplateAppMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • HolographicTemplateAppMain
Classes | Public Member Functions | Private Member Functions | Private Attributes

HolographicTemplateAppMain Class Reference

Updates, renders, and presents holographic content using Direct3D.

List of all members.

Classes

class | GamepadWithButtonState

Public Member Functions

HolographicTemplateAppMain (DeviceResources deviceResources)
void | Dispose ()
void | LoadAppState ()
void | OnCameraAdded (HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args)
void | OnCameraRemoved (HolographicSpace sender, HolographicSpaceCameraRemovedEventArgs args)
void | OnDeviceLost (Object sender, EventArgs e)
void | OnDeviceRestored (Object sender, EventArgs e)
void | OnGamepadAdded (Object o, Gamepad args)
void | OnGamepadRemoved (Object o, Gamepad args)
void | OnPointerPressed ()
bool | Render (HolographicFrame holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (HolographicSpace holographicSpace)
HolographicFrame | Update ()

Private Member Functions

void | OnHolographicDisplayIsAvailableChanged (Object o, Object args)
void | OnLocatabilityChanged (SpatialLocator sender, Object args)

Private Attributes

bool | canCommitDirect3D11DepthBuffer = false
bool | canGetDefaultHolographicDisplay = false
bool | canGetHolographicDisplayForCamera = false
DeviceResources deviceResources
List< GamepadWithButtonState > | gamepads = new List<GamepadWithButtonState>()
HolographicSpace | holographicSpace
bool | pointerPressed = false
SpatialLocator | spatialLocator
SpatialStationaryFrameOfReference | stationaryReferenceFrame
StepTimer | timer = new StepTimer()

Detailed Description

Definition at line 33 of file BasicHologramMain.cs.

Constructor & Destructor Documentation

HolographicTemplateAppMain ( DeviceResources deviceResources ) [inline]

Loads and initializes application assets when the application is loaded.

Parameters:
deviceResources

Definition at line 90 of file BasicHologramMain.cs.

        {
            this.deviceResources = deviceResources;

            // Register to be notified if the Direct3D device is lost.
            this.deviceResources.DeviceLost     += this.OnDeviceLost;
            this.deviceResources.DeviceRestored += this.OnDeviceRestored;

            // If connected, a game controller can also be used for input.
            Gamepad.GamepadAdded += this.OnGamepadAdded;
            Gamepad.GamepadRemoved += this.OnGamepadRemoved;

            foreach (var gamepad in Gamepad.Gamepads)
            {
                OnGamepadAdded(null, gamepad);
            }

            canGetHolographicDisplayForCamera = Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.Graphics.Holographic.HolographicCamera", "Display");
            canGetDefaultHolographicDisplay = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.Graphics.Holographic.HolographicDisplay", "GetDefault");
            canCommitDirect3D11DepthBuffer = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.Graphics.Holographic.HolographicCameraRenderingParameters", "CommitDirect3D11DepthBuffer");
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 166 of file BasicHologramMain.cs.

        {
#if DRAW_SAMPLE_CONTENT
            if (spinningCubeRenderer != null)
            {
                spinningCubeRenderer.Dispose();
                spinningCubeRenderer = null;
            }
#endif
        }

void LoadAppState ( ) [inline]

Definition at line 419 of file BasicHologramMain.cs.

        {
            //
            // TODO: Insert code here to load your app state.
            //       This method is called when the app resumes.
            //
            //       For example, load information from the SpatialAnchorStore.
            //
        }

void OnCameraAdded | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraAddedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 487 of file BasicHologramMain.cs.

        {
            Deferral deferral = args.GetDeferral();
            HolographicCamera holographicCamera = args.Camera;

            Task task1 = new Task(() =>
            {
                //
                // TODO: Allocate resources for the new camera and load any content specific to
                //       that camera. Note that the render target size (in pixels) is a property
                //       of the HolographicCamera object, and can be used to create off-screen
                //       render targets that match the resolution of the HolographicCamera.
                //

                // Create device-based resources for the holographic camera and add it to the list of
                // cameras used for updates and rendering. Notes:
                //   * Since this function may be called at any time, the AddHolographicCamera function
                //     waits until it can get a lock on the set of holographic camera resources before
                //     adding the new camera. At 60 frames per second this wait should not take long.
                //   * A subsequent Update will take the back buffer from the RenderingParameters of this
                //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
                //     Content can then be rendered for the HolographicCamera.
                deviceResources.AddHolographicCamera(holographicCamera);

                // Holographic frame predictions will not include any information about this camera until
                // the deferral is completed.
                deferral.Complete();
            });
            task1.Start();
        }

void OnCameraRemoved | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraRemovedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 521 of file BasicHologramMain.cs.

        {
            Task task2 = new Task(() =>
            {
                //
                // TODO: Asynchronously unload or deactivate content resources (not back buffer
                //       resources) that are specific only to the camera that was removed.
                //
            });
            task2.Start();

            // Before letting this callback return, ensure that all references to the back buffer
            // are released.
            // Since this function may be called at any time, the RemoveHolographicCamera function
            // waits until it can get a lock on the set of holographic camera resources before
            // deallocating resources for this camera. At 60 frames per second this wait should
            // not take long.
            deviceResources.RemoveHolographicCamera(args.Camera);
        }

void OnDeviceLost | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources need to be released.

Definition at line 437 of file BasicHologramMain.cs.

        {

#if DRAW_SAMPLE_CONTENT
            spinningCubeRenderer.ReleaseDeviceDependentResources();
#endif

        }

void OnDeviceRestored | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources may now be recreated.

Definition at line 449 of file BasicHologramMain.cs.

        {
#if DRAW_SAMPLE_CONTENT
            spinningCubeRenderer.CreateDeviceDependentResourcesAsync();
#endif
        }

void OnGamepadAdded | ( | Object | o,
 |  | Gamepad | args |
 | ) |  |  | [inline]

Definition at line 544 of file BasicHologramMain.cs.

        {
            foreach (var gamepadWithButtonState in gamepads)
            {
                if (args == gamepadWithButtonState.gamepad)
                {
                    // This gamepad is already in the list.
                    return;
                }
            }

            gamepads.Add(new GamepadWithButtonState(args, false));
        }

void OnGamepadRemoved | ( | Object | o,
 |  | Gamepad | args |
 | ) |  |  | [inline]

Definition at line 558 of file BasicHologramMain.cs.

        {
            foreach (var gamepadWithButtonState in gamepads)
            {
                if (args == gamepadWithButtonState.gamepad)
                {
                    // This gamepad is in the list; remove it.
                    gamepads.Remove(gamepadWithButtonState);
                    return;
                }
            }
        }

void OnHolographicDisplayIsAvailableChanged | ( | Object | o,
 |  | Object | args |
 | ) |  |  | [inline, private]

Definition at line 571 of file BasicHologramMain.cs.

        {
            // Get the spatial locator for the default HolographicDisplay, if one is available.
            SpatialLocator spatialLocator = null;
            if (canGetDefaultHolographicDisplay)
            {
                HolographicDisplay defaultHolographicDisplay = HolographicDisplay.GetDefault();
                if (defaultHolographicDisplay != null)
                {
                    spatialLocator = defaultHolographicDisplay.SpatialLocator;
                }
            }
            else
            {
                spatialLocator = SpatialLocator.GetDefault();
            }

            if (this.spatialLocator != spatialLocator)
            {
                // If the spatial locator is disconnected or replaced, we should discard any state that was
                // based on it.
                if (this.spatialLocator != null)
                {
                    this.spatialLocator.LocatabilityChanged -= this.OnLocatabilityChanged;
                    this.spatialLocator = null;
                }

                this.stationaryReferenceFrame = null;

                if (spatialLocator != null)
                {
                    // Use the SpatialLocator from the default HolographicDisplay to track the motion of the device.
                    this.spatialLocator = spatialLocator;

                    // Respond to changes in the positional tracking state.
                    this.spatialLocator.LocatabilityChanged += this.OnLocatabilityChanged;

                    // The simplest way to render world-locked holograms is to create a stationary reference frame
                    // based on a SpatialLocator. This is roughly analogous to creating a "world" coordinate system
                    // with the origin placed at the device's position as the app is launched.
                    this.stationaryReferenceFrame = this.spatialLocator.CreateStationaryFrameOfReferenceAtCurrentLocation();
                }
            }
        }

void OnLocatabilityChanged | ( | SpatialLocator | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Definition at line 456 of file BasicHologramMain.cs.

        {
            switch (sender.Locatability)
            {
                case SpatialLocatability.Unavailable:
                    // Holograms cannot be rendered.
                    {
                        String message = "Warning! Positional tracking is " + sender.Locatability + ".";
                        Debug.WriteLine(message);
                    }
                    break;

                // In the following three cases, it is still possible to place holograms using a
                // SpatialLocatorAttachedFrameOfReference.
                case SpatialLocatability.PositionalTrackingActivating:
                // The system is preparing to use positional tracking.

                case SpatialLocatability.OrientationOnly:
                // Positional tracking has not been activated.

                case SpatialLocatability.PositionalTrackingInhibited:
                    // Positional tracking is temporarily inhibited. User action may be required
                    // in order to restore positional tracking.
                    break;

                case SpatialLocatability.PositionalTrackingActive:
                    // Positional tracking is active. World-locked content can be rendered.
                    break;
            }
        }

void OnPointerPressed ( ) [inline]

Definition at line 429 of file BasicHologramMain.cs.

        {
            this.pointerPressed = true;
        }

bool Render ( HolographicFrame holographicFrame ) [inline]

Renders the current frame to each holographic display, according to the current application and spatial positioning state.

Returns true if the frame was rendered to at least one display.

Definition at line 285 of file BasicHologramMain.cs.

        {
            // Don't try to render anything before the first Update.
            if (timer.FrameCount == 0)
            {
                return false;
            }

            //
            // TODO: Add code for pre-pass rendering here.
            //
            // Take care of any tasks that are not specific to an individual holographic
            // camera. This includes anything that doesn't need the final view or projection
            // matrix, such as lighting maps.
            //

            // Up-to-date frame predictions enhance the effectiveness of image stablization and
            // allow more accurate positioning of holograms.
            holographicFrame.UpdateCurrentPrediction();
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Lock the set of holographic camera resources, then draw to each camera
            // in this frame.
            return deviceResources.UseHolographicCameraResources(
                (Dictionary<uint, CameraResources> cameraResourceDictionary) =>
            {
                bool atLeastOneCameraRendered = false;

                foreach (var cameraPose in prediction.CameraPoses)
                {
                    // This represents the device-based resources for a HolographicCamera.
                    CameraResources cameraResources = cameraResourceDictionary[cameraPose.HolographicCamera.Id];

                    // Get the device context.
                    var context = deviceResources.D3DDeviceContext;
                    var renderTargetView = cameraResources.BackBufferRenderTargetView;
                    var depthStencilView = cameraResources.DepthStencilView;

                    // Set render targets to the current holographic camera.
                    context.OutputMerger.SetRenderTargets(depthStencilView, renderTargetView);

                    // Clear the back buffer and depth stencil view.
                    if (canGetHolographicDisplayForCamera &&
                        cameraPose.HolographicCamera.Display.IsOpaque)
                    {
                        SharpDX.Mathematics.Interop.RawColor4 cornflowerBlue = new SharpDX.Mathematics.Interop.RawColor4(0.392156899f, 0.58431375f, 0.929411829f, 1.0f);
                        context.ClearRenderTargetView(renderTargetView, cornflowerBlue);
                    }
                    else
                    {
                        SharpDX.Mathematics.Interop.RawColor4 transparent = new SharpDX.Mathematics.Interop.RawColor4(0.0f, 0.0f, 0.0f, 0.0f);
                        context.ClearRenderTargetView(renderTargetView, transparent);
                    }
                    context.ClearDepthStencilView(
                        depthStencilView,
                        SharpDX.Direct3D11.DepthStencilClearFlags.Depth | SharpDX.Direct3D11.DepthStencilClearFlags.Stencil,
                        1.0f,
                        0);

                    //
                    // TODO: Replace the sample content with your own content.
                    //
                    // Notes regarding holographic content:
                    //    * For drawing, remember that you have the potential to fill twice as many pixels
                    //      in a stereoscopic render target as compared to a non-stereoscopic render target
                    //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
                    //      and only draw holograms that the user can see.
                    //    * To help occlude hologram geometry, you can create a depth map using geometry
                    //      data obtained via the surface mapping APIs. You can use this depth map to avoid
                    //      rendering holograms that are intended to be hidden behind tables, walls,
                    //      monitors, and so on.
                    //    * On HolographicDisplays that are transparent, black pixels will appear transparent
                    //      to the user. On such devices, you should clear the screen to Transparent as shown
                    //      above. You should still use alpha blending to draw semitransparent holograms.
                    //

                    // The view and projection matrices for each holographic camera will change
                    // every frame. This function refreshes the data in the constant buffer for
                    // the holographic camera indicated by cameraPose.
                    if (stationaryReferenceFrame != null)
                    {
                        cameraResources.UpdateViewProjectionBuffer(deviceResources, cameraPose, stationaryReferenceFrame.CoordinateSystem);
                    }

                    // Attach the view/projection constant buffer for this camera to the graphics pipeline.
                    bool cameraActive = cameraResources.AttachViewProjectionBuffer(deviceResources);

#if DRAW_SAMPLE_CONTENT
                    // Only render world-locked content when positional tracking is active.
                    if (cameraActive)
                    {
                        // Draw the sample hologram.
                        spinningCubeRenderer.Render();

                        if (canCommitDirect3D11DepthBuffer)
                        {
                            // On versions of the platform that support the CommitDirect3D11DepthBuffer API, we can
                            // provide the depth buffer to the system, and it will use depth information to stabilize
                            // the image at a per-pixel level.
                            HolographicCameraRenderingParameters renderingParameters = holographicFrame.GetRenderingParameters(cameraPose);
                            SharpDX.Direct3D11.Texture2D depthBuffer = cameraResources.DepthBufferTexture2D;

                            // Direct3D interop APIs are used to provide the buffer to the WinRT API.
                            SharpDX.DXGI.Resource1 depthStencilResource = depthBuffer.QueryInterface<SharpDX.DXGI.Resource1>();
                            SharpDX.DXGI.Surface2 depthDxgiSurface = new SharpDX.DXGI.Surface2(depthStencilResource, 0);
                            IDirect3DSurface depthD3DSurface = InteropStatics.CreateDirect3DSurface(depthDxgiSurface.NativePointer);
                            if (depthD3DSurface != null)
                            {
                                // Calling CommitDirect3D11DepthBuffer causes the system to queue Direct3D commands to
                                // read the depth buffer. It will then use that information to stabilize the image as
                                // the HolographicFrame is presented.
                                renderingParameters.CommitDirect3D11DepthBuffer(depthD3DSurface);
                            }
                        }
                    }
#endif
                    atLeastOneCameraRendered = true;
                }

                return atLeastOneCameraRendered;
            });
        }

void SaveAppState ( ) [inline]

Definition at line 409 of file BasicHologramMain.cs.

        {
            //
            // TODO: Insert code here to save your app state.
            //       This method is called when the app is about to suspend.
            //
            //       For example, store information in the SpatialAnchorStore.
            //
        }

void SetHolographicSpace ( HolographicSpace holographicSpace ) [inline]

Definition at line 112 of file BasicHologramMain.cs.

        {
            this.holographicSpace = holographicSpace;

            //
            // TODO: Add code here to initialize your content.
            //

#if DRAW_SAMPLE_CONTENT
            // Initialize the sample hologram.
            spinningCubeRenderer = new SpinningCubeRenderer(deviceResources);

            spatialInputHandler = new SpatialInputHandler();
#endif

            if (canGetDefaultHolographicDisplay)
            {
                // Subscribe for notifications about changes to the state of the default HolographicDisplay
                // and its SpatialLocator.
                HolographicSpace.IsAvailableChanged += this.OnHolographicDisplayIsAvailableChanged;
            }

            // Acquire the current state of the default HolographicDisplay and its SpatialLocator.
            OnHolographicDisplayIsAvailableChanged(null, null);

            // Respond to camera added events by creating any resources that are specific
            // to that camera, such as the back buffer render target view.
            // When we add an event handler for CameraAdded, the API layer will avoid putting
            // the new camera in new HolographicFrames until we complete the deferral we created
            // for that handler, or return from the handler without creating a deferral. This
            // allows the app to take more than one frame to finish creating resources and
            // loading assets for the new holographic camera.
            // This function should be registered before the app creates any HolographicFrames.
            holographicSpace.CameraAdded += this.OnCameraAdded;

            // Respond to camera removed events by releasing resources that were created for that
            // camera.
            // When the app receives a CameraRemoved event, it releases all references to the back
            // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
            // The app must also ensure that the back buffer is not attached as a render target, as
            // shown in DeviceResources.ReleaseResourcesForBackBuffer.
            holographicSpace.CameraRemoved += this.OnCameraRemoved;

            // Notes on spatial tracking APIs:
            // * Stationary reference frames are designed to provide a best-fit position relative to the
            //   overall space. Individual positions within that reference frame are allowed to drift slightly
            //   as the device learns more about the environment.
            // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
            //   anchor the individual hologram to a position in the real world - for example, a point the user
            //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
            //   anchor will use the corrected position starting in the next frame after the correction has
            //   occurred.
        }

HolographicFrame Update ( ) [inline]

Updates the application state once per frame.

Definition at line 180 of file BasicHologramMain.cs.

        {
            // Before doing the timer update, there is some work to do per-frame
            // to maintain holographic rendering. First, we will get information
            // about the current frame.

            // The HolographicFrame has information that the app needs in order
            // to update and render the current frame. The app begins each new
            // frame by calling CreateNextFrame.
            HolographicFrame holographicFrame = holographicSpace.CreateNextFrame();

            // Get a prediction of where holographic cameras will be when this frame
            // is presented.
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Back buffers can change from frame to frame. Validate each buffer, and recreate
            // resource views and depth buffers as needed.
            deviceResources.EnsureCameraResources(holographicFrame, prediction);

#if DRAW_SAMPLE_CONTENT
            if (stationaryReferenceFrame != null)
            {
                // Check for new input state since the last frame.
                for (int i = 0; i < gamepads.Count; ++i)
                {
                    bool buttonDownThisUpdate = (gamepads[i].gamepad.GetCurrentReading().Buttons & GamepadButtons.A) == GamepadButtons.A;
                    if (buttonDownThisUpdate && !gamepads[i].buttonAWasPressedLastFrame)
                    {
                        pointerPressed = true;
                    }
                    gamepads[i].buttonAWasPressedLastFrame = buttonDownThisUpdate;
                }

                SpatialInteractionSourceState pointerState = spatialInputHandler.CheckForInput();
                SpatialPointerPose pose = null;
                if (null != pointerState)
                {
                    pose = pointerState.TryGetPointerPose(stationaryReferenceFrame.CoordinateSystem);
                }
                else if (pointerPressed)
                {
                    pose = SpatialPointerPose.TryGetAtTimestamp(stationaryReferenceFrame.CoordinateSystem, prediction.Timestamp);
                }
                pointerPressed = false;

                // When a Pressed gesture is detected, the sample hologram will be repositioned
                // two meters in front of the user.
                spinningCubeRenderer.PositionHologram(pose);
            }
#endif

            timer.Tick(() =>
            {
                //
                // TODO: Update scene objects.
                //
                // Put time-based updates here. By default this code will run once per frame,
                // but if you change the StepTimer to use a fixed time step this code will
                // run as many times as needed to get to the current step.
                //

#if DRAW_SAMPLE_CONTENT
                spinningCubeRenderer.Update(timer);
#endif
            });

            if (!canCommitDirect3D11DepthBuffer)
            {
                // On versions of the platform that do not support the CommitDirect3D11DepthBuffer API, we can control
                // image stabilization by setting a focus point with optional plane normal and velocity.
                foreach (var cameraPose in prediction.CameraPoses)
                {
#if DRAW_SAMPLE_CONTENT
                    // The HolographicCameraRenderingParameters class provides access to set
                    // the image stabilization parameters.
                    HolographicCameraRenderingParameters renderingParameters = holographicFrame.GetRenderingParameters(cameraPose);

                    // SetFocusPoint informs the system about a specific point in your scene to
                    // prioritize for image stabilization. The focus point is set independently
                    // for each holographic camera. When setting the focus point, put it on or
                    // near content that the user is looking at.
                    // In this example, we put the focus point at the center of the sample hologram.
                    // You can also set the relative velocity and facing of the stabilization
                    // plane using overloads of this method.
                    if (stationaryReferenceFrame != null)
                    {
                        renderingParameters.SetFocusPoint(
                            stationaryReferenceFrame.CoordinateSystem,
                            spinningCubeRenderer.Position
                            );
                    }
#endif
                }
            }

            // The holographic frame will be used to get up-to-date view and projection matrices and
            // to present the swap chain.
            return holographicFrame;
        }

Member Data Documentation

bool canCommitDirect3D11DepthBuffer = false [private]

Definition at line 84 of file BasicHologramMain.cs.

bool canGetDefaultHolographicDisplay = false [private]

Definition at line 81 of file BasicHologramMain.cs.

bool canGetHolographicDisplayForCamera = false [private]

Definition at line 78 of file BasicHologramMain.cs.

DeviceResources deviceResources [private]

Definition at line 45 of file BasicHologramMain.cs.

List<GamepadWithButtonState> gamepads = new List<GamepadWithButtonState>() [private]

Definition at line 72 of file BasicHologramMain.cs.

HolographicSpace holographicSpace [private]

Definition at line 51 of file BasicHologramMain.cs.

bool pointerPressed = false [private]

Definition at line 75 of file BasicHologramMain.cs.

SpatialLocator spatialLocator [private]

Definition at line 54 of file BasicHologramMain.cs.

SpatialStationaryFrameOfReference stationaryReferenceFrame [private]

Definition at line 57 of file BasicHologramMain.cs.

StepTimer timer = new StepTimer() [private]

Definition at line 48 of file BasicHologramMain.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/BasicHologramMain.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTemplateAppMain::GamepadWithButtonState Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • HolographicTemplateAppMain
  • HolographicTemplateAppMain::GamepadWithButtonState
Public Member Functions | Public Attributes

HolographicTemplateAppMain::GamepadWithButtonState Class Reference

List of all members.

Public Member Functions

GamepadWithButtonState (Windows.Gaming.Input.Gamepad gamepad, bool buttonAWasPressedLastFrame)

Public Attributes

bool | buttonAWasPressedLastFrame
Windows.Gaming.Input.Gamepad | gamepad

Detailed Description

Definition at line 60 of file BasicHologramMain.cs.

Constructor & Destructor Documentation

GamepadWithButtonState | ( | Windows.Gaming.Input.Gamepad | gamepad,
 |  | bool | buttonAWasPressedLastFrame |
 | ) |  |  | [inline]

Definition at line 64 of file BasicHologramMain.cs.

            {
                this.gamepad = gamepad;
                this.buttonAWasPressedLastFrame = buttonAWasPressedLastFrame;
            }

Member Data Documentation

bool buttonAWasPressedLastFrame

Definition at line 63 of file BasicHologramMain.cs.

Windows.Gaming.Input.Gamepad gamepad

Definition at line 62 of file BasicHologramMain.cs.

The documentation for this class was generated from the following file:
  • BasicHologram/cs/BasicHologramMain.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4X4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following files:
  • BasicHologram/cpp/Content/ShaderStructures.h
  • BasicHologram/cppwinrt/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Program Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • Program
Static Private Member Functions

Program Class Reference

Windows Holographic application using SharpDX.

List of all members.

Static Private Member Functions

static void Main ()

Detailed Description

Definition at line 9 of file Program.cs.

Member Function Documentation

static void Main ( ) [inline, static, private]

Defines the entry point of the application.

Definition at line 15 of file Program.cs.

        {
            var exclusiveViewApplicationSource = new AppViewSource();
            CoreApplication.Run(exclusiveViewApplicationSource);
        }

The documentation for this class was generated from the following file:
  • BasicHologram/cs/Program.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
winrt::Windows::ApplicationModel::Core::IFrameworkView | CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
void | Initialize (winrt::Windows::ApplicationModel::Core::CoreApplicationView const &applicationView)
virtual void | Load (Platform::String^entryPoint)
void | Load (winrt::hstring const &entryPoint)
void | Run ()
virtual void | Run ()
void | SetWindow (winrt::Windows::UI::Core::CoreWindow const &window)
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | Uninitialize ()
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnKeyPressed (winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::KeyEventArgs const &args)
void | OnLaunched (winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &args)
void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args)
void | OnPointerPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::PointerEventArgs^args)
void | OnPointerPressed (winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::PointerEventArgs const &args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnResuming (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::Foundation::IInspectable const &args)
void | OnSuspending (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::ApplicationModel::SuspendingEventArgs const &args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnViewActivated (winrt::Windows::ApplicationModel::Core::CoreApplicationView const &sender, winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs const &args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnVisibilityChanged (winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::VisibilityChangedEventArgs const &args)
void | OnWindowClosed (winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::CoreWindowEventArgs const &args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

AppView holographicView
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
winrt::Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
winrt::event_token | m_keyDownEventToken
std::unique_ptr
< BasicHologramMain > 		m_main
winrt::event_token | m_pointerPressedEventToken
winrt::event_token | m_resumingEventToken
winrt::event_token | m_suspendingEventToken
winrt::event_token | m_visibilityChangedEventToken
bool | m_windowClosed = false
winrt::event_token | m_windowClosedEventToken
bool | m_windowVisible = true

Detailed Description

Definition at line 9 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
winrt::Windows::ApplicationModel::Core::IFrameworkView CreateView ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
void Initialize ( winrt::Windows::ApplicationModel::Core::CoreApplicationView const & applicationView )
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void Load ( winrt::hstring const & entryPoint )
void OnKeyPressed | ( | winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | winrt::Windows::UI::Core::KeyEventArgs const & | args |
 | ) |  |  | [protected]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnLaunched ( winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const & args ) [protected]
void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args ) [protected]
void OnPointerPressed | ( | winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | winrt::Windows::UI::Core::PointerEventArgs const & | args |
 | ) |  |  | [protected]
void OnPointerPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::ApplicationModel::SuspendingEventArgs const & | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | winrt::Windows::ApplicationModel::Core::CoreApplicationView const & | sender,
 |  | winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs const & | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | winrt::Windows::UI::Core::VisibilityChangedEventArgs const & | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | winrt::Windows::UI::Core::CoreWindowEventArgs const & | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
void Run ( )
void SetWindow ( winrt::Windows::UI::Core::CoreWindow const & window )
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
void Uninitialize ( )
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

AppView holographicView [private]

Definition at line 60 of file AppView.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 39 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 44 of file AppView.h.

winrt::Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 50 of file AppView.h.

winrt::event_token m_keyDownEventToken [private]

Definition at line 44 of file AppView.h.

std::unique_ptr< BasicHologramMain > m_main [private]

Definition at line 37 of file AppView.h.

winrt::event_token m_pointerPressedEventToken [private]

Definition at line 45 of file AppView.h.

winrt::event_token m_resumingEventToken [private]

Definition at line 43 of file AppView.h.

winrt::event_token m_suspendingEventToken [private]

Definition at line 42 of file AppView.h.

winrt::event_token m_visibilityChangedEventToken [private]

Definition at line 47 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 40 of file AppView.h.

winrt::event_token m_windowClosedEventToken [private]

Definition at line 46 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 41 of file AppView.h.

The documentation for this class was generated from the following files:
  • BasicHologram/cpp/AppView.h
  • BasicHologram/cppwinrt/AppView.h
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
SpatialInputHandler ()
~SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()
winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
void | OnSourcePressed (winrt::Windows::UI::Input::Spatial::SpatialInteractionManager const &sender, winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs const &args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
winrt::Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager = nullptr
winrt::event_token | m_sourcePressedEventToken
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr
winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 7 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 11 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );

    //
    // TODO: Expand this class to use other gesture-based input events as applicable to
    //       your app.
    //
}

~SpatialInputHandler ( )

Definition at line 30 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

SpatialInputHandler ( )
~SpatialInputHandler ( )

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 39 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState CheckForInput ( )
void OnSourcePressed | ( | winrt::Windows::UI::Input::Spatial::SpatialInteractionManager const & | sender,
 |  | winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs const & | args |
 | ) |  |  | [private]
void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 22 of file SpatialInputHandler.h.

winrt::Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager = nullptr [private]

Definition at line 22 of file SpatialInputHandler.h.

winrt::event_token m_sourcePressedEventToken [private]

Definition at line 25 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 25 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 28 of file SpatialInputHandler.h.

winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 28 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • BasicHologram/cpp/Content/SpatialInputHandler.h
  • BasicHologram/cppwinrt/Content/SpatialInputHandler.h
  • BasicHologram/cpp/Content/SpatialInputHandler.cpp
  • BasicHologram/cppwinrt/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpinningCubeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • SpinningCubeRenderer
Public Member Functions | Private Attributes

SpinningCubeRenderer Class Reference

#include "SpinningCubeRenderer.h"

List of all members.

Public Member Functions

SpinningCubeRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
SpinningCubeRenderer (std::shared_ptr< DX::DeviceResources > const &deviceResources)
void | CreateDeviceDependentResources ()
std::future< void > | CreateDeviceDependentResources ()
winrt::Windows::Foundation::Numerics::float3
const & 		GetPosition ()
Windows::Foundation::Numerics::float3 GetPosition ()
void | PositionHologram (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose)
void | PositionHologram (winrt::Windows::UI::Input::Spatial::SpatialPointerPose const &pointerPose)
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Render ()
void | SetPosition (Windows::Foundation::Numerics::float3 pos)
void | SetPosition (winrt::Windows::Foundation::Numerics::float3 const &pos)
void | Update (DX::StepTimer const &timer)
void | Update (const DX::StepTimer &timer)

Private Attributes

float | m_degreesPerSecond = 45.f
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
uint32_t | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
winrt::Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 10 of file SpinningCubeRenderer.h.

Constructor & Destructor Documentation

SpinningCubeRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 12 of file SpinningCubeRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
}

SpinningCubeRenderer ( std::shared_ptr< DX::DeviceResources > const & deviceResources )

Member Function Documentation

std::future< void > CreateDeviceDependentResources ( )

Definition at line 159 of file SpinningCubeRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
        {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                static_cast<UINT>(vertexDesc.size()),
                fileData.data(),
                static_cast<UINT>(fileData.size()),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
                )
            );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> createCubeTask  = shaderTaskGroup.then([this] ()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the cube size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // cube at a comfortable size we made the cube width 0.2 m (20 cm).
        static const std::array<VertexPositionColor, 8> cubeVertices =
        {{
            { XMFLOAT3(-0.1f, -0.1f, -0.1f), XMFLOAT3(0.0f, 0.0f, 0.0f) },
            { XMFLOAT3(-0.1f, -0.1f,  0.1f), XMFLOAT3(0.0f, 0.0f, 1.0f) },
            { XMFLOAT3(-0.1f,  0.1f, -0.1f), XMFLOAT3(0.0f, 1.0f, 0.0f) },
            { XMFLOAT3(-0.1f,  0.1f,  0.1f), XMFLOAT3(0.0f, 1.0f, 1.0f) },
            { XMFLOAT3( 0.1f, -0.1f, -0.1f), XMFLOAT3(1.0f, 0.0f, 0.0f) },
            { XMFLOAT3( 0.1f, -0.1f,  0.1f), XMFLOAT3(1.0f, 0.0f, 1.0f) },
            { XMFLOAT3( 0.1f,  0.1f, -0.1f), XMFLOAT3(1.0f, 1.0f, 0.0f) },
            { XMFLOAT3( 0.1f,  0.1f,  0.1f), XMFLOAT3(1.0f, 1.0f, 1.0f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem                = cubeVertices.data();
        vertexBufferData.SysMemPitch            = 0;
        vertexBufferData.SysMemSlicePitch       = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionColor) * static_cast<UINT>(cubeVertices.size()), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<unsigned short, 36> cubeIndices =
        {{
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        }};

        m_indexCount = static_cast<unsigned int>(cubeIndices.size());

        D3D11_SUBRESOURCE_DATA indexBufferData  = {0};
        indexBufferData.pSysMem                 = cubeIndices.data();
        indexBufferData.SysMemPitch             = 0;
        indexBufferData.SysMemSlicePitch        = 0;
        CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * static_cast<UINT>(cubeIndices.size()), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    });

    // Once the cube is loaded, the object is ready to be rendered.
    createCubeTask.then([this] ()
    {
        m_loadingComplete = true;
    });
}

std::future<void> CreateDeviceDependentResources ( )
Windows::Foundation::Numerics::float3 GetPosition ( ) [inline]

Definition at line 24 of file SpinningCubeRenderer.h.

{ return m_position; }

winrt::Windows::Foundation::Numerics::float3 const& GetPosition ( ) [inline]

Definition at line 24 of file SpinningCubeRenderer.h.

{ return m_position; }

void PositionHologram ( Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose )
void PositionHologram ( winrt::Windows::UI::Input::Spatial::SpatialPointerPose const & pointerPose )
void ReleaseDeviceDependentResources ( )
void ReleaseDeviceDependentResources ( )

Definition at line 332 of file SpinningCubeRenderer.cpp.

{
    m_loadingComplete  = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
}

void Render ( )

Definition at line 88 of file SpinningCubeRenderer.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void Render ( )
void SetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline]

Definition at line 23 of file SpinningCubeRenderer.h.

{ m_position = pos;  }

void SetPosition ( winrt::Windows::Foundation::Numerics::float3 const & pos ) [inline]

Definition at line 23 of file SpinningCubeRenderer.h.

{ m_position = pos;  }

void Update ( DX::StepTimer const & timer )
void Update ( const DX::StepTimer & timer )

Definition at line 40 of file SpinningCubeRenderer.cpp.

{
    // Rotate the cube.
    // Convert degrees to radians, then convert seconds to rotation angle.
    const float    radiansPerSecond = XMConvertToRadians(m_degreesPerSecond);
    const double   totalRotation    = timer.GetTotalSeconds() * radiansPerSecond;
    const float    radians          = static_cast<float>(fmod(totalRotation, XM_2PI));
    const XMMATRIX modelRotation    = XMMatrixRotationY(-radians);

    // Position the cube.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // Multiply to get the transform matrix.
    // Note that this transform does not enforce a particular coordinate system. The calling
    // class is responsible for rendering this content in a consistent manner.
    const XMMATRIX modelTransform   = XMMatrixMultiply(modelRotation, modelTranslation);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

    // Loading is asynchronous. Resources must be created before they can be updated.
    if (!m_loadingComplete)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );
}

Member Data Documentation

float m_degreesPerSecond = 45.f [private]

Definition at line 45 of file SpinningCubeRenderer.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 28 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11GeometryShader > m_geometryShader [private]

Definition at line 35 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_indexBuffer [private]

Definition at line 33 of file SpinningCubeRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 41 of file SpinningCubeRenderer.h.

uint32_t m_indexCount = 0 [private]

Definition at line 41 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11InputLayout > m_inputLayout [private]

Definition at line 31 of file SpinningCubeRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 44 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_modelConstantBuffer [private]

Definition at line 37 of file SpinningCubeRenderer.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 40 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11PixelShader > m_pixelShader [private]

Definition at line 36 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 46 of file SpinningCubeRenderer.h.

winrt::Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 46 of file SpinningCubeRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 50 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_vertexBuffer [private]

Definition at line 32 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr< ID3D11VertexShader > m_vertexShader [private]

Definition at line 34 of file SpinningCubeRenderer.h.

The documentation for this class was generated from the following files:
  • BasicHologram/cpp/Content/SpinningCubeRenderer.h
  • BasicHologram/cppwinrt/Content/SpinningCubeRenderer.h
  • BasicHologram/cpp/Content/SpinningCubeRenderer.cpp
  • BasicHologram/cppwinrt/Content/SpinningCubeRenderer.cpp
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicHologram
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 16 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 19 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 18 of file ShaderStructures.h.

The documentation for this struct was generated from the following files:
  • BasicHologram/cpp/Content/ShaderStructures.h
  • BasicHologram/cppwinrt/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicLoader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

BasicLoader Class Reference

#include "BasicLoader.h"

List of all members.

Public Member Functions

BasicLoader (_In_ winrt::com_ptr< ID3D11Device3 > d3dDevice, _In_opt_ IWICImagingFactory2 *wicFactory=nullptr)
void | LoadMesh (_In_ Platform::String^filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount)
void | LoadMesh (_In_ winrt::hstring const &filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32_t *vertexCount, _Out_opt_ uint32_t *indexCount)
void | LoadMesh (_In_ Platform::String^filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount)
concurrency::task< void > | LoadMeshAsync (_In_ Platform::String^filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount)
winrt::Windows::Foundation::IAsyncAction | LoadMeshAsync (_In_ winrt::hstring filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32_t *vertexCount, _Out_opt_ uint32_t *indexCount)
concurrency::task< void > | LoadMeshAsync (_In_ Platform::String^filename, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11GeometryShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _Out_ ID3D11HullShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _Out_ ID3D11DomainShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _Out_ ID3D11ComputeShader **shader)
void | LoadShader (_In_ Platform::String^filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[], _In_ uint32 layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11PixelShader **shader)
void | LoadShader (_In_ Platform::String^filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32 numEntries, _In_reads_opt_(numStrides) const uint32 *bufferStrides, _In_ uint32 numStrides, _In_ uint32 rasterizedStream, _Out_ ID3D11GeometryShader **shader)
void | LoadShader (_In_ Platform::String^filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[], _In_ uint32 layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11PixelShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const layoutDesc[], _In_ uint32_t layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11ComputeShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11GeometryShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _Out_ ID3D11PixelShader **shader)
void | LoadShader (_In_ Platform::String^filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32 numEntries, _In_reads_opt_(numStrides) const uint32 *bufferStrides, _In_ uint32 numStrides, _In_ uint32 rasterizedStream, _Out_ ID3D11GeometryShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11HullShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11ComputeShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11DomainShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11HullShader **shader)
void | LoadShader (_In_ Platform::String^filename, _Out_ ID3D11DomainShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _Out_ ID3D11GeometryShader **shader)
void | LoadShader (_In_ winrt::hstring const &filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32_t numEntries, _In_reads_opt_(numStrides) const uint32_t *bufferStrides, _In_ uint32_t numStrides, _In_ uint32_t rasterizedStream, _Out_ ID3D11GeometryShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11ComputeShader **shader)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _Out_ ID3D11DomainShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32 numEntries, _In_reads_opt_(numStrides) const uint32 *bufferStrides, _In_ uint32 numStrides, _In_ uint32 rasterizedStream, _Out_ ID3D11GeometryShader **shader)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _Out_ ID3D11PixelShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32 numEntries, _In_reads_opt_(numStrides) const uint32 *bufferStrides, _In_ uint32 numStrides, _In_ uint32 rasterizedStream, _Out_ ID3D11GeometryShader **shader)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _Out_ ID3D11HullShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11HullShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[], _In_ uint32 layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const layoutDesc[], _In_ uint32_t layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11ComputeShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11GeometryShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11PixelShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11GeometryShader **shader)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY *streamOutDeclaration, _In_ uint32_t numEntries, _In_reads_opt_(numStrides) const uint32_t *bufferStrides, _In_ uint32_t numStrides, _In_ uint32_t rasterizedStream, _Out_ ID3D11GeometryShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11HullShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11DomainShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11DomainShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[], _In_ uint32 layoutDescNumElements, _Out_ ID3D11VertexShader **shader, _Out_opt_ ID3D11InputLayout **layout)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring filename, _Out_ ID3D11GeometryShader **shader)
winrt::Windows::Foundation::IAsyncAction | LoadShaderAsync (_In_ winrt::hstring const filename, _Out_ ID3D11ComputeShader **shader)
concurrency::task< void > | LoadShaderAsync (_In_ Platform::String^filename, _Out_ ID3D11PixelShader **shader)
void | LoadTexture (_In_ Platform::String^filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
void | LoadTexture (_In_ Platform::String^filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
void | LoadTexture (_In_ winrt::hstring const &filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
winrt::Windows::Foundation::IAsyncAction | LoadTextureAsync (_In_ winrt::hstring filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
concurrency::task< void > | LoadTextureAsync (_In_ Platform::String^filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
concurrency::task< void > | LoadTextureAsync (_In_ Platform::String^filename, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)

Public Attributes

internal | __pad0__: BasicLoader( _In_ ID3D11Device* d3dDevice
internal _In_opt_
IWICImagingFactory2 * 		wicFactory

Private Member Functions

void | CreateInputLayout (_In_reads_bytes_(bytecodeSize) byte *bytecode, _In_ uint32 bytecodeSize, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC *layoutDesc, _In_ uint32 layoutDescNumElements, _Out_ ID3D11InputLayout **layout)
void | CreateInputLayout (_In_reads_bytes_(bytecodeSize) const byte *bytecode, _In_ uint32_t bytecodeSize, _In_reads_opt_(layoutDescNumElements) const D3D11_INPUT_ELEMENT_DESC *layoutDesc, _In_ uint32_t layoutDescNumElements, _Out_ ID3D11InputLayout **layout)
void | CreateInputLayout (_In_reads_bytes_(bytecodeSize) byte *bytecode, _In_ uint32 bytecodeSize, _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC *layoutDesc, _In_ uint32 layoutDescNumElements, _Out_ ID3D11InputLayout **layout)
void | CreateMesh (_In_ byte *meshData, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount, _In_opt_ Platform::String^debugName)
void | CreateMesh (_In_ byte *meshData, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32_t *vertexCount, _Out_opt_ uint32_t *indexCount, _In_opt_ winrt::hstring const &debugName)
void | CreateMesh (_In_ byte *meshData, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ uint32 *vertexCount, _Out_opt_ uint32 *indexCount, _In_opt_ Platform::String^debugName)
void | CreateTexture (_In_ bool decodeAsDDS, _In_reads_bytes_(dataSize) byte *data, _In_ uint32 dataSize, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView, _In_opt_ Platform::String^debugName)
void | CreateTexture (_In_ bool decodeAsDDS, _In_reads_bytes_(dataSize) const byte *data, _In_ uint32_t dataSize, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView, _In_opt_ winrt::hstring const &debugName)
void | CreateTexture (_In_ bool decodeAsDDS, _In_reads_bytes_(dataSize) byte *data, _In_ uint32 dataSize, _Out_opt_ ID3D11Texture2D **texture, _Out_opt_ ID3D11ShaderResourceView **textureView, _In_opt_ Platform::String^debugName)
std::wstring | GetExtension (_In_ winrt::hstring const &filename)
Platform::String | GetExtension (_In_ Platform::String^filename)
Platform::String | GetExtension (_In_ Platform::String^filename)
template<class DeviceChildType >
void | SetDebugName (_In_ DeviceChildType *object, _In_ Platform::String^name)
template<class DeviceChildType >
void | SetDebugName (_In_ DeviceChildType *object, _In_ winrt::hstring const &name)
template<class DeviceChildType >
void | SetDebugName (_In_ DeviceChildType *object, _In_ Platform::String^name)

Private Attributes

BasicReaderWriter m_basicReaderWriter
winrt::com_ptr< ID3D11Device > | m_d3dDevice
Microsoft::WRL::ComPtr
< ID3D11Device > 		m_d3dDevice
Microsoft::WRL::ComPtr
< IWICImagingFactory2 > 		m_wicFactory
winrt::com_ptr
< IWICImagingFactory2 > 		m_wicFactory

Detailed Description

Definition at line 14 of file BasicLoader.h.

Constructor & Destructor Documentation

BasicLoader | ( | _In_ winrt::com_ptr< ID3D11Device3 > | d3dDevice,
 |  | _In_opt_ IWICImagingFactory2 * | wicFactory = nullptr
 | ) |  |

Definition at line 14 of file BasicLoader.cpp.

      :
    m_d3dDevice(std::move(d3dDevice))
{
    m_wicFactory.copy_from(wicFactory);
}

Member Function Documentation

void CreateInputLayout | ( | _In_reads_bytes_(bytecodeSize) byte * | bytecode,
 |  | _In_ uint32 | bytecodeSize,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC * | layoutDesc,
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11InputLayout ** | layout |
 | ) |  |  | [private]

Definition at line 271 of file BasicLoader.cpp.

{
    if (layoutDesc == nullptr)
    {
        // If no input layout is specified, use the BasicVertex layout.
        const D3D11_INPUT_ELEMENT_DESC basicVertexLayoutDesc[] =
        {
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0,  D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "NORMAL",   0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        };

        DX::ThrowIfFailed(
            m_d3dDevice->CreateInputLayout(
                basicVertexLayoutDesc,
                ARRAYSIZE(basicVertexLayoutDesc),
                bytecode,
                bytecodeSize,
                layout
                )
            );
    }
    else
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateInputLayout(
                layoutDesc,
                layoutDescNumElements,
                bytecode,
                bytecodeSize,
                layout
                )
            );
    }
}

void CreateInputLayout | ( | _In_reads_bytes_(bytecodeSize) const byte * | bytecode,
 |  | _In_ uint32_t | bytecodeSize,
 |  | _In_reads_opt_(layoutDescNumElements) const D3D11_INPUT_ELEMENT_DESC * | layoutDesc,
 |  | _In_ uint32_t | layoutDescNumElements,
 |  | _Out_ ID3D11InputLayout ** | layout |
 | ) |  |  | [private]

Definition at line 248 of file BasicLoader.cpp.

{
    if (layoutDesc == nullptr)
    {
        // If no input layout is specified, use the BasicVertex layout.
        static constexpr D3D11_INPUT_ELEMENT_DESC basicVertexLayoutDesc[] =
        {
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0,  D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "NORMAL",   0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        };

        winrt::check_hresult(
            m_d3dDevice->CreateInputLayout(
                basicVertexLayoutDesc,
                ARRAYSIZE(basicVertexLayoutDesc),
                bytecode,
                bytecodeSize,
                layout
                )
            );
    }
    else
    {
        winrt::check_hresult(
            m_d3dDevice->CreateInputLayout(
                layoutDesc,
                layoutDescNumElements,
                bytecode,
                bytecodeSize,
                layout
                )
            );
    }
}

void CreateInputLayout | ( | _In_reads_bytes_(bytecodeSize) byte * | bytecode,
 |  | _In_ uint32 | bytecodeSize,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC * | layoutDesc,
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11InputLayout ** | layout |
 | ) |  |  | [private]
void CreateMesh | ( | _In_ byte * | meshData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount,
 |  | _In_opt_ Platform::String^ | debugName |
 | ) |  |  | [private]
void CreateMesh | ( | _In_ byte * | meshData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount,
 |  | _In_opt_ Platform::String^ | debugName |
 | ) |  |  | [private]

Definition at line 313 of file BasicLoader.cpp.

{
    // The first 4 bytes of the BasicMesh format define the number of vertices in the mesh.
    uint32 numVertices = *reinterpret_cast<uint32*>(meshData);

    // The following 4 bytes define the number of indices in the mesh.
    uint32 numIndices = *reinterpret_cast<uint32*>(meshData + sizeof(uint32));

    // The next segment of the BasicMesh format contains the vertices of the mesh.
    BasicVertex* vertices = reinterpret_cast<BasicVertex*>(meshData + sizeof(uint32) * 2);

    // The last segment of the BasicMesh format contains the indices of the mesh.
    uint16* indices = reinterpret_cast<uint16*>(meshData + sizeof(uint32) * 2 + sizeof(BasicVertex) * numVertices);

    // Create the vertex and index buffers with the mesh data.

    D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
    vertexBufferData.pSysMem = vertices;
    vertexBufferData.SysMemPitch = 0;
    vertexBufferData.SysMemSlicePitch = 0;
    CD3D11_BUFFER_DESC vertexBufferDesc(numVertices * sizeof(BasicVertex), D3D11_BIND_VERTEX_BUFFER);
    DX::ThrowIfFailed(
        m_d3dDevice->CreateBuffer(
            &vertexBufferDesc,
            &vertexBufferData,
            vertexBuffer
            )
        );

    D3D11_SUBRESOURCE_DATA indexBufferData = {0};
    indexBufferData.pSysMem = indices;
    indexBufferData.SysMemPitch = 0;
    indexBufferData.SysMemSlicePitch = 0;
    CD3D11_BUFFER_DESC indexBufferDesc(numIndices * sizeof(uint16), D3D11_BIND_INDEX_BUFFER);
    DX::ThrowIfFailed(
        m_d3dDevice->CreateBuffer(
            &indexBufferDesc,
            &indexBufferData,
            indexBuffer
            )
        );

    SetDebugName(*vertexBuffer, Platform::String::Concat(debugName, "_VertexBuffer"));
    SetDebugName(*indexBuffer, Platform::String::Concat(debugName, "_IndexBuffer"));

    if (vertexCount != nullptr)
    {
        *vertexCount = numVertices;
    }
    if (indexCount != nullptr)
    {
        *indexCount = numIndices;
    }
}

void CreateMesh | ( | _In_ byte * | meshData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32_t * | vertexCount,
 |  | _Out_opt_ uint32_t * | indexCount,
 |  | _In_opt_ winrt::hstring const & | debugName |
 | ) |  |  | [private]

Definition at line 290 of file BasicLoader.cpp.

{
    // The first 4 bytes of the BasicMesh format define the number of vertices in the mesh.
    uint32_t numVertices = *reinterpret_cast<uint32_t*>(meshData);

    // The following 4 bytes define the number of indices in the mesh.
    uint32_t numIndices = *reinterpret_cast<uint32_t*>(meshData + sizeof(uint32_t));

    // The next segment of the BasicMesh format contains the vertices of the mesh.
    BasicVertex* vertices = reinterpret_cast<BasicVertex*>(meshData + sizeof(uint32_t) * 2);

    // The last segment of the BasicMesh format contains the indices of the mesh.
    uint16_t* indices = reinterpret_cast<uint16_t*>(meshData + sizeof(uint32_t) * 2 + sizeof(BasicVertex) * numVertices);

    // Create the vertex and index buffers with the mesh data.

    D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
    vertexBufferData.pSysMem = vertices;
    vertexBufferData.SysMemPitch = 0;
    vertexBufferData.SysMemSlicePitch = 0;
    CD3D11_BUFFER_DESC vertexBufferDesc(numVertices * sizeof(BasicVertex), D3D11_BIND_VERTEX_BUFFER);
    winrt::check_hresult(
        m_d3dDevice->CreateBuffer(
            &vertexBufferDesc,
            &vertexBufferData,
            vertexBuffer
            )
        );

    D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
    indexBufferData.pSysMem = indices;
    indexBufferData.SysMemPitch = 0;
    indexBufferData.SysMemSlicePitch = 0;
    CD3D11_BUFFER_DESC indexBufferDesc(numIndices * sizeof(uint16_t), D3D11_BIND_INDEX_BUFFER);
    winrt::check_hresult(
        m_d3dDevice->CreateBuffer(
            &indexBufferDesc,
            &indexBufferData,
            indexBuffer
            )
        );

    SetDebugName(*vertexBuffer, debugName + L"_VertexBuffer");
    SetDebugName(*indexBuffer, debugName + L"_IndexBuffer");

    if (vertexCount != nullptr)
    {
        *vertexCount = numVertices;
    }
    if (indexCount != nullptr)
    {
        *indexCount = numIndices;
    }
}

void CreateTexture | ( | _In_ bool | decodeAsDDS,
 |  | _In_reads_bytes_(dataSize) byte * | data,
 |  | _In_ uint32 | dataSize,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_opt_ Platform::String^ | debugName |
 | ) |  |  | [private]
void CreateTexture | ( | _In_ bool | decodeAsDDS,
 |  | _In_reads_bytes_(dataSize) const byte * | data,
 |  | _In_ uint32_t | dataSize,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_opt_ winrt::hstring const & | debugName |
 | ) |  |  | [private]

Definition at line 82 of file BasicLoader.cpp.

{
    winrt::com_ptr<ID3D11ShaderResourceView> shaderResourceView;
    winrt::com_ptr<ID3D11Texture2D> texture2D;

    if (decodeAsDDS)
    {
        winrt::com_ptr<ID3D11Resource> resource;

        if (textureView == nullptr)
        {
            CreateDDSTextureFromMemory(
                m_d3dDevice.get(),
                data,
                dataSize,
                resource.put(),
                nullptr
                );
        }
        else
        {
            CreateDDSTextureFromMemory(
                m_d3dDevice.get(),
                data,
                dataSize,
                resource.put(),
                shaderResourceView.put()
                );
        }

        texture2D = resource.as<ID3D11Texture2D>();
    }
    else
    {
        if (m_wicFactory.get() == nullptr)
        {
            // A WIC factory object is required in order to load texture
            // assets stored in non-DDS formats. If BasicLoader was not
            // initialized with one, create one as needed.
            winrt::check_hresult(
                CoCreateInstance(
                    CLSID_WICImagingFactory,
                    nullptr,
                    CLSCTX_INPROC_SERVER,
                    IID_PPV_ARGS(&m_wicFactory)
                    )
                );
        }

        winrt::com_ptr<IWICStream> stream;
        winrt::check_hresult(
            m_wicFactory->CreateStream(stream.put())
            );

        winrt::check_hresult(
            stream->InitializeFromMemory(
                const_cast<WICInProcPointer>(data),
                dataSize
                )
            );

        winrt::com_ptr<IWICBitmapDecoder> bitmapDecoder;
        winrt::check_hresult(
            m_wicFactory->CreateDecoderFromStream(
                stream.get(),
                nullptr,
                WICDecodeMetadataCacheOnDemand,
                bitmapDecoder.put()
                )
            );

        winrt::com_ptr<IWICBitmapFrameDecode> bitmapFrame;
        winrt::check_hresult(
            bitmapDecoder->GetFrame(0, bitmapFrame.put())
            );

        winrt::com_ptr<IWICFormatConverter> formatConverter;
        winrt::check_hresult(
            m_wicFactory->CreateFormatConverter(formatConverter.put())
            );

        winrt::check_hresult(
            formatConverter->Initialize(
                bitmapFrame.get(),
                GUID_WICPixelFormat32bppPBGRA,
                WICBitmapDitherTypeNone,
                nullptr,
                0.0,
                WICBitmapPaletteTypeCustom
                )
            );

        uint32_t width;
        uint32_t height;
        winrt::check_hresult(
            bitmapFrame->GetSize(&width, &height)
            );

        std::unique_ptr<byte[]> bitmapPixels(new byte[width * height * 4]);
        winrt::check_hresult(
            formatConverter->CopyPixels(
                nullptr,
                width * 4,
                width * height * 4,
                bitmapPixels.get()
                )
            );

        D3D11_SUBRESOURCE_DATA initialData;
        ZeroMemory(&initialData, sizeof(initialData));
        initialData.pSysMem = bitmapPixels.get();
        initialData.SysMemPitch = width * 4;
        initialData.SysMemSlicePitch = 0;

        CD3D11_TEXTURE2D_DESC textureDesc(
            DXGI_FORMAT_B8G8R8A8_UNORM,
            width,
            height,
            1,
            1
            );

        winrt::check_hresult(
            m_d3dDevice->CreateTexture2D(
                &textureDesc,
                &initialData,
                texture2D.put()
                )
            );

        if (textureView != nullptr)
        {
            CD3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc(
                texture2D.get(),
                D3D11_SRV_DIMENSION_TEXTURE2D
                );

            winrt::check_hresult(
                m_d3dDevice->CreateShaderResourceView(
                    texture2D.get(),
                    &shaderResourceViewDesc,
                    shaderResourceView.put()
                    )
                );
        }
    }

    SetDebugName(texture2D.get(), debugName);

    if (texture != nullptr)
    {
        *texture = texture2D.detach();
    }
    if (textureView != nullptr)
    {
        *textureView = shaderResourceView.detach();
    }
}

void CreateTexture | ( | _In_ bool | decodeAsDDS,
 |  | _In_reads_bytes_(dataSize) byte * | data,
 |  | _In_ uint32 | dataSize,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_opt_ Platform::String^ | debugName |
 | ) |  |  | [private]

Definition at line 103 of file BasicLoader.cpp.

{
    ComPtr<ID3D11ShaderResourceView> shaderResourceView;
    ComPtr<ID3D11Texture2D> texture2D;

    if (decodeAsDDS)
    {
        ComPtr<ID3D11Resource> resource;

        if (textureView == nullptr)
        {
            CreateDDSTextureFromMemory(
                m_d3dDevice.Get(),
                data,
                dataSize,
                &resource,
                nullptr
                );
        }
        else
        {
            CreateDDSTextureFromMemory(
                m_d3dDevice.Get(),
                data,
                dataSize,
                &resource,
                &shaderResourceView
                );
        }

        DX::ThrowIfFailed(
            resource.As(&texture2D)
            );
    }
    else
    {
        if (m_wicFactory.Get() == nullptr)
        {
            // A WIC factory object is required in order to load texture
            // assets stored in non-DDS formats.  If BasicLoader was not
            // initialized with one, create one as needed.
            DX::ThrowIfFailed(
                CoCreateInstance(
                    CLSID_WICImagingFactory,
                    nullptr,
                    CLSCTX_INPROC_SERVER,
                    IID_PPV_ARGS(&m_wicFactory)
                    )
                );
        }

        ComPtr<IWICStream> stream;
        DX::ThrowIfFailed(
            m_wicFactory->CreateStream(&stream)
            );

        DX::ThrowIfFailed(
            stream->InitializeFromMemory(
                data,
                dataSize
                )
            );

        ComPtr<IWICBitmapDecoder> bitmapDecoder;
        DX::ThrowIfFailed(
            m_wicFactory->CreateDecoderFromStream(
                stream.Get(),
                nullptr,
                WICDecodeMetadataCacheOnDemand,
                &bitmapDecoder
                )
            );

        ComPtr<IWICBitmapFrameDecode> bitmapFrame;
        DX::ThrowIfFailed(
            bitmapDecoder->GetFrame(0, &bitmapFrame)
            );

        ComPtr<IWICFormatConverter> formatConverter;
        DX::ThrowIfFailed(
            m_wicFactory->CreateFormatConverter(&formatConverter)
            );

        DX::ThrowIfFailed(
            formatConverter->Initialize(
                bitmapFrame.Get(),
                GUID_WICPixelFormat32bppPBGRA,
                WICBitmapDitherTypeNone,
                nullptr,
                0.0,
                WICBitmapPaletteTypeCustom
                )
            );

        uint32 width;
        uint32 height;
        DX::ThrowIfFailed(
            bitmapFrame->GetSize(&width, &height)
            );

        std::unique_ptr<byte[]> bitmapPixels(new byte[width * height * 4]);
        DX::ThrowIfFailed(
            formatConverter->CopyPixels(
                nullptr,
                width * 4,
                width * height * 4,
                bitmapPixels.get()
                )
            );

        D3D11_SUBRESOURCE_DATA initialData;
        ZeroMemory(&initialData, sizeof(initialData));
        initialData.pSysMem = bitmapPixels.get();
        initialData.SysMemPitch = width * 4;
        initialData.SysMemSlicePitch = 0;

        CD3D11_TEXTURE2D_DESC textureDesc(
            DXGI_FORMAT_B8G8R8A8_UNORM,
            width,
            height,
            1,
            1
            );

        DX::ThrowIfFailed(
            m_d3dDevice->CreateTexture2D(
                &textureDesc,
                &initialData,
                &texture2D
                )
            );

        if (textureView != nullptr)
        {
            CD3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc(
                texture2D.Get(),
                D3D11_SRV_DIMENSION_TEXTURE2D
                );

            DX::ThrowIfFailed(
                m_d3dDevice->CreateShaderResourceView(
                    texture2D.Get(),
                    &shaderResourceViewDesc,
                    &shaderResourceView
                    )
                );
        }
    }

    SetDebugName(texture2D.Get(), debugName);

    if (texture != nullptr)
    {
        *texture = texture2D.Detach();
    }
    if (textureView != nullptr)
    {
        *textureView = shaderResourceView.Detach();
    }
}

Platform::String GetExtension ( _In_ Platform::String^ filename ) [private]
std::wstring GetExtension ( _In_ winrt::hstring const & filename ) [private]

Definition at line 68 of file BasicLoader.cpp.

{
    std::wstring extension;
    auto lastDot = std::find(filename.rbegin(), filename.rend(), L'.');
    if (lastDot != filename.rend())
    {
        std::transform(lastDot.base(), filename.end(), std::back_inserter(extension),
            [](wchar_t c) { return std::towlower(c); });
    }
    return extension;
}

Platform::String GetExtension ( _In_ Platform::String^ filename ) [private]

Definition at line 79 of file BasicLoader.cpp.

{
    int lastDotIndex = -1;
    for (int i = filename->Length() - 1; i >= 0 && lastDotIndex == -1; i--)
    {
        if (*(filename->Data() + i) == '.')
        {
            lastDotIndex = i;
        }
    }
    if (lastDotIndex != -1)
    {
        std::unique_ptr<wchar_t[]> extension(new wchar_t[filename->Length() - lastDotIndex]);
        for (unsigned int i = 0; i < filename->Length() - lastDotIndex; i++)
        {
            extension[i] = tolower(*(filename->Data() + lastDotIndex + 1 + i));
        }
        return ref new Platform::String(extension.get());
    }
    return "";
}

void LoadMesh | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32_t * | vertexCount,
 |  | _Out_opt_ uint32_t * | indexCount
 | ) |  |

Definition at line 755 of file BasicLoader.cpp.

{
    std::vector<byte> meshData{ m_basicReaderWriter.ReadData(filename) };

    CreateMesh(
        meshData.data(),
        vertexBuffer,
        indexBuffer,
        vertexCount,
        indexCount,
        filename
        );
}

void LoadMesh | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount
 | ) |  |

Definition at line 834 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ meshData = m_basicReaderWriter->ReadData(filename);

    CreateMesh(
        meshData->Data,
        vertexBuffer,
        indexBuffer,
        vertexCount,
        indexCount,
        filename
        );
}

void LoadMesh | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount
 | ) |  |
concurrency::task<void> LoadMeshAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount
 | ) |  |
task< void > LoadMeshAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32 * | vertexCount,
 |  | _Out_opt_ uint32 * | indexCount
 | ) |  |

Definition at line 854 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ meshData)
    {
        CreateMesh(
            meshData->Data,
            vertexBuffer,
            indexBuffer,
            vertexCount,
            indexCount,
            filename
            );
    });
}

winrt::Windows::Foundation::IAsyncAction LoadMeshAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ uint32_t * | vertexCount,
 |  | _Out_opt_ uint32_t * | indexCount
 | ) |  |

Definition at line 775 of file BasicLoader.cpp.

{
    auto meshData = co_await m_basicReaderWriter.ReadDataAsync(filename);

    CreateMesh(
        meshData.data(),
        vertexBuffer,
        indexBuffer,
        vertexCount,
        indexCount,
        filename
        );
}

void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 554 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateGeometryShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC | layoutDesc[],
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |

Definition at line 412 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateVertexShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);

    if (layout != nullptr)
    {
        CreateInputLayout(
            bytecode->Data,
            bytecode->Length,
            layoutDesc,
            layoutDescNumElements,
            layout
            );

        SetDebugName(*layout, filename);
    }
}

void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32_t | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32_t * | bufferStrides,
 |  | _In_ uint32_t | numStrides,
 |  | _In_ uint32_t | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 592 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateGeometryShaderWithStreamOutput(
            bytecode.data(),
            bytecode.size(),
            streamOutDeclaration,
            numEntries,
            bufferStrides,
            numStrides,
            rasterizedStream,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |

Definition at line 525 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreatePixelShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |

Definition at line 679 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateHullShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |

Definition at line 717 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateDomainShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32 | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32 * | bufferStrides,
 |  | _In_ uint32 | numStrides,
 |  | _In_ uint32 | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 642 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateGeometryShaderWithStreamOutput(
            bytecode->Data,
            bytecode->Length,
            streamOutDeclaration,
            numEntries,
            bufferStrides,
            numStrides,
            rasterizedStream,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 603 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateGeometryShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |

Definition at line 756 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateHullShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC | layoutDesc[],
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |
void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const | layoutDesc[],
 |  | _In_ uint32_t | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |

Definition at line 387 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateVertexShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);

    if (layout != nullptr)
    {
        CreateInputLayout(
            bytecode.data(),
            bytecode.size(),
            layoutDesc,
            layoutDescNumElements,
            layout
            );

        SetDebugName(*layout, filename);
    }
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |

Definition at line 564 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateComputeShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |

Definition at line 478 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreatePixelShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32 | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32 * | bufferStrides,
 |  | _In_ uint32 | numStrides,
 |  | _In_ uint32 | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |

Definition at line 795 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ bytecode = m_basicReaderWriter->ReadData(filename);

    DX::ThrowIfFailed(
        m_d3dDevice->CreateDomainShader(
            bytecode->Data,
            bytecode->Length,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadShader | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |
void LoadShader | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |

Definition at line 516 of file BasicLoader.cpp.

{
    std::vector<byte> bytecode{ m_basicReaderWriter.ReadData(filename) };

    winrt::check_hresult(
        m_d3dDevice->CreateComputeShader(
            bytecode.data(),
            bytecode.size(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32_t | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32_t * | bufferStrides,
 |  | _In_ uint32_t | numStrides,
 |  | _In_ uint32_t | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 621 of file BasicLoader.cpp.

{
    // This method assumes that the lifetime of input arguments may be shorter
    // than the duration of this coroutine. In order to ensure accurate results, a
    // copy of all arguments passed by pointer must be made. The method then
    // ensures that the lifetime of the copied data exceeds that of the coroutine.

    // Create copies of the streamOutDeclaration array as well as the SemanticName
    // strings, both of which are pointers to data whose lifetimes may be shorter
    // than that of this method's coroutine.
    std::vector<D3D11_SO_DECLARATION_ENTRY> streamOutDeclarationCopy;
    std::vector<std::string> streamOutDeclarationSemanticNamesCopy;
    if (streamOutDeclaration != nullptr)
    {
        streamOutDeclarationCopy = { streamOutDeclaration, streamOutDeclaration + numEntries };
        streamOutDeclarationSemanticNamesCopy.reserve(numEntries);

        for (auto&& desc : streamOutDeclarationCopy)
        {
            desc.SemanticName = streamOutDeclarationSemanticNamesCopy.emplace(streamOutDeclarationSemanticNamesCopy.end(), desc.SemanticName)->c_str();
        }
    }

    // Create a copy of the bufferStrides array, which is a pointer to data
    // whose lifetime may be shorter than that of this method's coroutine.
    std::vector<uint32_t> bufferStridesCopy;
    if (bufferStrides != nullptr)
    {
        bufferStridesCopy = { bufferStrides, bufferStrides + numStrides };
    }

    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateGeometryShaderWithStreamOutput(
            bytecode.data(),
            bytecode.Length(),
            streamOutDeclaration == nullptr ? nullptr : streamOutDeclarationCopy.data(),
            numEntries,
            bufferStrides == nullptr ? nullptr : bufferStridesCopy.data(),
            numStrides,
            rasterizedStream,
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |
task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |

Definition at line 775 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateHullShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |
task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32 | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32 * | bufferStrides,
 |  | _In_ uint32 | numStrides,
 |  | _In_ uint32 | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 671 of file BasicLoader.cpp.

{
    // This method assumes that the lifetime of input arguments may be shorter
    // than the duration of this task.  In order to ensure accurate results, a
    // copy of all arguments passed by pointer must be made.  The method then
    // ensures that the lifetime of the copied data exceeds that of the task.

    // Create copies of the streamOutDeclaration array as well as the SemanticName
    // strings, both of which are pointers to data whose lifetimes may be shorter
    // than that of this method's task.
    shared_ptr<vector<D3D11_SO_DECLARATION_ENTRY>> streamOutDeclarationCopy;
    shared_ptr<vector<string>> streamOutDeclarationSemanticNamesCopy;
    if (streamOutDeclaration != nullptr)
    {
        streamOutDeclarationCopy.reset(
            new vector<D3D11_SO_DECLARATION_ENTRY>(
                streamOutDeclaration,
                streamOutDeclaration + numEntries
                )
            );

        streamOutDeclarationSemanticNamesCopy.reset(
            new vector<string>(numEntries)
            );

        for (uint32 i = 0; i < numEntries; i++)
        {
            streamOutDeclarationSemanticNamesCopy->at(i).assign(streamOutDeclaration[i].SemanticName);
        }
    }

    // Create a copy of the bufferStrides array, which is a pointer to data
    // whose lifetime may be shorter than that of this method's task.
    shared_ptr<vector<uint32>> bufferStridesCopy;
    if (bufferStrides != nullptr)
    {
        bufferStridesCopy.reset(
            new vector<uint32>(
                bufferStrides,
                bufferStrides + numStrides
                )
            );
    }

    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        if (streamOutDeclaration != nullptr)
        {
            // Reassign the SemanticName elements of the streamOutDeclaration array copy to
            // point to the corresponding copied strings. Performing the assignment inside the
            // lambda body ensures that the lambda will take a reference to the shared_ptr
            // that holds the data.  This will guarantee that the data is still valid when
            // CreateGeometryShaderWithStreamOutput is called.
            for (uint32 i = 0; i < numEntries; i++)
            {
                streamOutDeclarationCopy->at(i).SemanticName = streamOutDeclarationSemanticNamesCopy->at(i).c_str();
            }
        }

        DX::ThrowIfFailed(
            m_d3dDevice->CreateGeometryShaderWithStreamOutput(
                bytecode->Data,
                bytecode->Length,
                streamOutDeclaration == nullptr ? nullptr : streamOutDeclarationCopy->data(),
                numEntries,
                bufferStrides == nullptr ? nullptr : bufferStridesCopy->data(),
                numStrides,
                rasterizedStream,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring const | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |

Definition at line 535 of file BasicLoader.cpp.

{
    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateComputeShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC | layoutDesc[],
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |
task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |

Definition at line 583 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateComputeShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |

Definition at line 544 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreatePixelShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC | layoutDesc[],
 |  | _In_ uint32 | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |

Definition at line 447 of file BasicLoader.cpp.

{
    // This method assumes that the lifetime of input arguments may be shorter
    // than the duration of this task.  In order to ensure accurate results, a
    // copy of all arguments passed by pointer must be made.  The method then
    // ensures that the lifetime of the copied data exceeds that of the task.

    // Create copies of the layoutDesc array as well as the SemanticName strings,
    // both of which are pointers to data whose lifetimes may be shorter than that
    // of this method's task.
    shared_ptr<vector<D3D11_INPUT_ELEMENT_DESC>> layoutDescCopy;
    shared_ptr<vector<string>> layoutDescSemanticNamesCopy;
    if (layoutDesc != nullptr)
    {
        layoutDescCopy.reset(
            new vector<D3D11_INPUT_ELEMENT_DESC>(
                layoutDesc,
                layoutDesc + layoutDescNumElements
                )
            );

        layoutDescSemanticNamesCopy.reset(
            new vector<string>(layoutDescNumElements)
            );

        for (uint32 i = 0; i < layoutDescNumElements; i++)
        {
            layoutDescSemanticNamesCopy->at(i).assign(layoutDesc[i].SemanticName);
        }
    }

    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateVertexShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);

        if (layout != nullptr)
        {
            if (layoutDesc != nullptr)
            {
                // Reassign the SemanticName elements of the layoutDesc array copy to point
                // to the corresponding copied strings. Performing the assignment inside the
                // lambda body ensures that the lambda will take a reference to the shared_ptr
                // that holds the data.  This will guarantee that the data is still valid when
                // CreateInputLayout is called.
                for (uint32 i = 0; i < layoutDescNumElements; i++)
                {
                    layoutDescCopy->at(i).SemanticName = layoutDescSemanticNamesCopy->at(i).c_str();
                }
            }

            CreateInputLayout(
                bytecode->Data,
                bytecode->Length,
                layoutDesc == nullptr ? nullptr : layoutDescCopy->data(),
                layoutDescNumElements,
                layout
                );

            SetDebugName(*layout, filename);
        }
    });
}

winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const | layoutDesc[],
 |  | _In_ uint32_t | layoutDescNumElements,
 |  | _Out_ ID3D11VertexShader ** | shader,
 |  | _Out_opt_ ID3D11InputLayout ** | layout
 | ) |  |

Definition at line 422 of file BasicLoader.cpp.

{
    // This method assumes that the lifetime of input arguments may be shorter
    // than the duration of this operation. In order to ensure accurate results, a
    // copy of all arguments passed by pointer must be made. The method then
    // ensures that the lifetime of the copied data exceeds that of the coroutine.

    // Create copies of the layoutDesc array as well as the SemanticName strings,
    // both of which are pointers to data whose lifetimes may be shorter than that
    // of this method's coroutine.
    std::vector<D3D11_INPUT_ELEMENT_DESC> layoutDescCopy;
    std::vector<std::string> layoutDescSemanticNamesCopy;
    if (layoutDesc != nullptr)
    {
        layoutDescCopy = { layoutDesc, layoutDesc + layoutDescNumElements };
        layoutDescSemanticNamesCopy.reserve(layoutDescNumElements);

        for (auto&& desc : layoutDescCopy)
        {
            desc.SemanticName = layoutDescSemanticNamesCopy.emplace(layoutDescSemanticNamesCopy.end(), desc.SemanticName)->c_str();
        }
    }

    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateVertexShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);

    if (layout != nullptr)
    {
        CreateInputLayout(
            bytecode.data(),
            bytecode.Length(),
            layoutDesc == nullptr ? nullptr : layoutDescCopy.data(),
            layoutDescNumElements,
            layout
            );

        SetDebugName(*layout, filename);
    }
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY * | streamOutDeclaration,
 |  | _In_ uint32 | numEntries,
 |  | _In_reads_opt_(numStrides) const uint32 * | bufferStrides,
 |  | _In_ uint32 | numStrides,
 |  | _In_ uint32 | rasterizedStream,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |
winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |

Definition at line 736 of file BasicLoader.cpp.

{
    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateDomainShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 573 of file BasicLoader.cpp.

{
    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateGeometryShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11ComputeShader ** | shader
 | ) |  |
winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_ ID3D11PixelShader ** | shader
 | ) |  |

Definition at line 497 of file BasicLoader.cpp.

{
    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreatePixelShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11DomainShader ** | shader
 | ) |  |

Definition at line 814 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateDomainShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

task< void > LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |

Definition at line 622 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ bytecode)
    {
        DX::ThrowIfFailed(
            m_d3dDevice->CreateGeometryShader(
                bytecode->Data,
                bytecode->Length,
                nullptr,
                shader
                )
            );

        SetDebugName(*shader, filename);
    });
}

concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11GeometryShader ** | shader
 | ) |  |
concurrency::task<void> LoadShaderAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |
winrt::Windows::Foundation::IAsyncAction LoadShaderAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_ ID3D11HullShader ** | shader
 | ) |  |

Definition at line 698 of file BasicLoader.cpp.

{
    auto bytecode = co_await m_basicReaderWriter.ReadDataAsync(filename);

    winrt::check_hresult(
        m_d3dDevice->CreateHullShader(
            bytecode.data(),
            bytecode.Length(),
            nullptr,
            shader
            )
        );

    SetDebugName(*shader, filename);
}

void LoadTexture | ( | _In_ winrt::hstring const & | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |

Definition at line 352 of file BasicLoader.cpp.

{
    auto textureData{ m_basicReaderWriter.ReadData(filename) };

    CreateTexture(
        GetExtension(filename) == L"dds",
        textureData.data(),
        textureData.size(),
        texture,
        textureView,
        filename
        );
}

void LoadTexture | ( | _In_ Platform::String^ | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |
void LoadTexture | ( | _In_ Platform::String^ | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |

Definition at line 375 of file BasicLoader.cpp.

{
    Platform::Array<byte>^ textureData = m_basicReaderWriter->ReadData(filename);

    CreateTexture(
        GetExtension(filename) == "dds",
        textureData->Data,
        textureData->Length,
        texture,
        textureView,
        filename
        );
}

task< void > LoadTextureAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |

Definition at line 393 of file BasicLoader.cpp.

{
    return m_basicReaderWriter->ReadDataAsync(filename).then([=](const Platform::Array<byte>^ textureData)
    {
        CreateTexture(
            GetExtension(filename) == "dds",
            textureData->Data,
            textureData->Length,
            texture,
            textureView,
            filename
            );
    });
}

winrt::Windows::Foundation::IAsyncAction LoadTextureAsync | ( | _In_ winrt::hstring | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |

Definition at line 370 of file BasicLoader.cpp.

{
    auto textureData = co_await m_basicReaderWriter.ReadDataAsync(filename);
    CreateTexture(
        GetExtension(filename) == L"dds",
        textureData.data(),
        textureData.Length(),
        texture,
        textureView,
        filename
        );
}

concurrency::task<void> LoadTextureAsync | ( | _In_ Platform::String^ | filename,
 |  | _Out_opt_ ID3D11Texture2D ** | texture,
 |  | _Out_opt_ ID3D11ShaderResourceView ** | textureView
 | ) |  |
void SetDebugName | ( | _In_ DeviceChildType * | object,
 |  | _In_ Platform::String^ | name |
 | ) |  |  | [inline, private]
void SetDebugName | ( | _In_ DeviceChildType * | object,
 |  | _In_ winrt::hstring const & | name |
 | ) |  |  | [inline, private]

Definition at line 24 of file BasicLoader.cpp.

{
#if defined(_DEBUG)
    // Only assign debug names in debug builds.

    char nameString[1024];
    int nameStringLength = WideCharToMultiByte(
        CP_ACP,
        0,
        name.c_str(),
        -1,
        nameString,
        1024,
        nullptr,
        nullptr
        );

    if (nameStringLength == 0)
    {
        char defaultNameString[] = "BasicLoaderObject";
        winrt::check_hresult(
            object->SetPrivateData(
                WKPDID_D3DDebugObjectName,
                sizeof(defaultNameString) - 1,
                defaultNameString
                )
            );
    }
    else
    {
        winrt::check_hresult(
            object->SetPrivateData(
                WKPDID_D3DDebugObjectName,
                nameStringLength - 1,
                nameString
                )
            );
    }
#endif
}

void SetDebugName | ( | _In_ DeviceChildType * | object,
 |  | _In_ Platform::String^ | name |
 | ) |  |  | [inline, private]

Definition at line 35 of file BasicLoader.cpp.

{
#if defined(_DEBUG)
    // Only assign debug names in debug builds.

    char nameString[1024];
    int nameStringLength = WideCharToMultiByte(
        CP_ACP,
        0,
        name->Data(),
        -1,
        nameString,
        1024,
        nullptr,
        nullptr
        );

    if (nameStringLength == 0)
    {
        char defaultNameString[] = "BasicLoaderObject";
        DX::ThrowIfFailed(
            object->SetPrivateData(
                WKPDID_D3DDebugObjectName,
                sizeof(defaultNameString) - 1,
                defaultNameString
                )
            );
    }
    else
    {
        DX::ThrowIfFailed(
            object->SetPrivateData(
                WKPDID_D3DDebugObjectName,
                nameStringLength - 1,
                nameString
                )
            );
    }
#endif
}

Member Data Documentation

internal __pad0__

Definition at line 18 of file BasicLoader.h.

BasicReaderWriter m_basicReaderWriter [private]

Definition at line 139 of file BasicLoader.h.

winrt::com_ptr<ID3D11Device> m_d3dDevice [private]

Definition at line 137 of file BasicLoader.h.

Microsoft::WRL::ComPtr< ID3D11Device > m_d3dDevice [private]

Definition at line 137 of file BasicLoader.h.

winrt::com_ptr<IWICImagingFactory2> m_wicFactory [private]

Definition at line 138 of file BasicLoader.h.

Microsoft::WRL::ComPtr< IWICImagingFactory2 > m_wicFactory [private]

Definition at line 138 of file BasicLoader.h.

internal _In_opt_ IWICImagingFactory2 * wicFactory
Initial value:
 nullptr
        )

Definition at line 19 of file BasicLoader.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicLoader.h
  • Simple3DGameDX/cppwinrt/Common/BasicLoader.h
  • Simple3DGameXaml/cpp/Common/BasicLoader.h
  • Simple3DGameDX/cpp/Common/BasicLoader.cpp
  • Simple3DGameDX/cppwinrt/Common/BasicLoader.cpp
  • Simple3DGameXaml/cpp/Common/BasicLoader.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicMediaCasting
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | loadButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 23 of file Scenario1_BuiltInCasting.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 27 of file Scenario1_BuiltInCasting.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void loadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario1_BuiltInCasting.xaml.cs.

        {
            //Create a new picker
            FileOpenPicker filePicker = new FileOpenPicker();

            //Add filetype filters.  In this case wmv and mp4.
            filePicker.FileTypeFilter.Add(".wmv");
            filePicker.FileTypeFilter.Add(".mp4");

            //Set picker start location to the video library
            filePicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;

            //Retrieve file from picker
            StorageFile file = await filePicker.PickSingleFileAsync();

            //If we got a file, load it into the media lement
            if (file != null)
            {
                IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
                video.SetSource(stream, file.ContentType);
                rootPage.NotifyUser("Content Selected", NotifyType.StatusMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario1_BuiltInCasting.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 25 of file Scenario1_BuiltInCasting.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicMediaCasting/cs/Scenario1_BuiltInCasting.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicMediaCasting
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | castButton_Click (object sender, RoutedEventArgs e)
async void | Connection_ErrorOccurred (CastingConnection sender, CastingConnectionErrorOccurredEventArgs args)
async void | Connection_StateChanged (CastingConnection sender, object args)
async void | loadButton_Click (object sender, RoutedEventArgs e)
async void | Picker_CastingDeviceSelected (CastingDevicePicker sender, CastingDeviceSelectedEventArgs args)

Private Attributes

CastingDevicePicker | picker
MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario2_CastingDevicePicker.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 31 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            this.InitializeComponent();

            //Initialize our picker object
            picker = new CastingDevicePicker();

            //Set the picker to filter to video capable casting devices
            picker.Filter.SupportsVideo = true;

            //Hook up device selected event
            picker.CastingDeviceSelected += Picker_CastingDeviceSelected;
        }

Member Function Documentation

void castButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            //Retrieve the location of the casting button
            GeneralTransform transform = castButton.TransformToVisual(Window.Current.Content as UIElement);
            Point pt = transform.TransformPoint(new Point(0, 0));

            //Show the picker above our casting button
            picker.Show(new Rect(pt.X, pt.Y, castButton.ActualWidth, castButton.ActualHeight), Windows.UI.Popups.Placement.Above);

            rootPage.NotifyUser("Cast Button Clicked", NotifyType.StatusMessage);
        }

async void Connection_ErrorOccurred | ( | CastingConnection | sender,
 |  | CastingConnectionErrorOccurredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 111 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Casting Error Occured: " + args.Message, NotifyType.ErrorMessage);
            });
        }

async void Connection_StateChanged | ( | CastingConnection | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Casting Connection State Changed: " + sender.State, NotifyType.StatusMessage);
            });
        }

async void loadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            //Create a new picker
            FileOpenPicker filePicker = new FileOpenPicker();

            //Add filetype filters.  In this case wmv and mp4.
            filePicker.FileTypeFilter.Add(".wmv");
            filePicker.FileTypeFilter.Add(".mp4");

            //Set picker start location to the video library
            filePicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;

            //Retrieve file from picker
            StorageFile file = await filePicker.PickSingleFileAsync();

            //If we got a file, load it into the media lement
            if (file != null)
            {
                IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
                video.SetSource(stream, file.ContentType);
                rootPage.NotifyUser("Content Selected", NotifyType.StatusMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Picker_CastingDeviceSelected | ( | CastingDevicePicker | sender,
 |  | CastingDeviceSelectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario2_CastingDevicePicker.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                //Create a casting conneciton from our selected casting device
                CastingConnection connection = args.SelectedCastingDevice.CreateCastingConnection();

                //Hook up the casting events
                connection.ErrorOccurred += Connection_ErrorOccurred;
                connection.StateChanged += Connection_StateChanged;

                //Cast the content loaded in the media element to the selected casting device
                await connection.RequestStartCastingAsync(video.GetAsCastingSource());
            });
        }

Member Data Documentation

CastingDevicePicker picker [private]

Definition at line 29 of file Scenario2_CastingDevicePicker.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file Scenario2_CastingDevicePicker.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicMediaCasting/cs/Scenario2_CastingDevicePicker.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BasicMediaCasting
  • Scenario3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

List of all members.

Public Member Functions

Scenario3 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | castingDevicesList_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | Connection_ErrorOccurred (CastingConnection sender, CastingConnectionErrorOccurredEventArgs args)
async void | Connection_StateChanged (CastingConnection sender, object args)
async void | disconnectButton_Click (object sender, RoutedEventArgs e)
async void | loadButton_Click (object sender, RoutedEventArgs e)
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)
async void | Watcher_EnumerationCompleted (DeviceWatcher sender, object args)
async void | Watcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)
async void | Watcher_Stopped (DeviceWatcher sender, object args)
void | watcherControlButton_Click (object sender, RoutedEventArgs e)

Private Attributes

CastingConnection | connection
MainPage rootPage
DeviceWatcher | watcher

Detailed Description

Definition at line 25 of file Scenario3_CustomPicker.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 31 of file Scenario3_CustomPicker.xaml.cs.

        {
            this.InitializeComponent();

            //Create our watcher and have it find casting devices capable of video casting
            watcher = DeviceInformation.CreateWatcher(CastingDevice.GetDeviceSelector(CastingPlaybackTypes.Video));

            //Register for watcher events
            watcher.Added += Watcher_Added;
            watcher.Removed += Watcher_Removed;
            watcher.Stopped += Watcher_Stopped;
            watcher.EnumerationCompleted += Watcher_EnumerationCompleted;
        }

Member Function Documentation

async void castingDevicesList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario3_CustomPicker.xaml.cs.

        {
            if (castingDevicesList.SelectedItem != null)
            {
                //When a device is selected, first thing we do is stop the watcher so it's search doesn't conflict with streaming
                if (watcher.Status != DeviceWatcherStatus.Stopped)
                {
                    progressText.Text = "";
                    watcher.Stop();
                }

                //Create a new casting connection to the device that's been selected
                connection = ((CastingDevice)castingDevicesList.SelectedItem).CreateCastingConnection();

                //Register for events
                connection.ErrorOccurred += Connection_ErrorOccurred;
                connection.StateChanged += Connection_StateChanged;

                //Cast the loaded video to the selected casting device.
                await connection.RequestStartCastingAsync(video.GetAsCastingSource());
            }
        }

async void Connection_ErrorOccurred | ( | CastingConnection | sender,
 |  | CastingConnectionErrorOccurredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 204 of file Scenario3_CustomPicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //Clear the selection in the listbox on an error
                rootPage.NotifyUser("Casting Error: " + args.Message, NotifyType.ErrorMessage);
                castingDevicesList.SelectedItem = null;
            });
        }

async void Connection_StateChanged | ( | CastingConnection | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 170 of file Scenario3_CustomPicker.xaml.cs.

        {
           await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
           {
               //Update the UX based on the casting state
               if (sender.State == CastingConnectionState.Connected || sender.State == CastingConnectionState.Rendering)
               {
                   disconnectButton.Visibility = Visibility.Visible;
                   progressText.Text = "Connected";
                   progressRing.IsActive = false;
               }
               else if (sender.State == CastingConnectionState.Disconnected)
               {
                   disconnectButton.Visibility = Visibility.Collapsed;
                   castingDevicesList.SelectedItem = null;
                   progressText.Text = "";
                   progressRing.IsActive = false;
               }
               else if (sender.State == CastingConnectionState.Connecting)
               {
                   disconnectButton.Visibility = Visibility.Collapsed;
                   progressText.Text = "Connecting";
                   progressRing.IsActive = true;
               }
               else
               {
                   //Disconnecting is the remaining state
                   disconnectButton.Visibility = Visibility.Collapsed;
                   progressText.Text = "Disconnecting";
                   progressRing.IsActive = true;
               }
           });
        }

async void disconnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 214 of file Scenario3_CustomPicker.xaml.cs.

        {
            if (connection != null)
            {
                //When disconnect is clicked, the casting conneciton is disconnected.  The video should return locally to the media element.
                await connection.DisconnectAsync();
            }
        }

async void loadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario3_CustomPicker.xaml.cs.

        {
            //Create a new picker
            FileOpenPicker filePicker = new FileOpenPicker();

            //Add filetype filters.  In this case wmv and mp4.
            filePicker.FileTypeFilter.Add(".wmv");
            filePicker.FileTypeFilter.Add(".mp4");

            //Set picker start location to the video library
            filePicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;

            //Retrieve file from picker
            StorageFile file = await filePicker.PickSingleFileAsync();

            //If we got a file, load it into the media element
            if (file != null)
            {
                IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
                video.SetSource(stream, file.ContentType);
                rootPage.NotifyUser("Content Selected", NotifyType.StatusMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario3_CustomPicker.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario3_CustomPicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                //Add each discovered device to our listbox
                CastingDevice addedDevice = await CastingDevice.FromIdAsync(args.Id);
                castingDevicesList.Items.Add(addedDevice);
            });
        }

async void Watcher_EnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario3_CustomPicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //If enumeration completes, update UI and transition watcher to the stopped state
                rootPage.NotifyUser("Watcher completed enumeration of devices", NotifyType.StatusMessage);
                progressText.Text = "Enumeration Completed";
                watcher.Stop();
            });
        }

async void Watcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario3_CustomPicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //Remove any removed devices from our listbox
                foreach (CastingDevice currentDevice in castingDevicesList.Items)
                {
                    if (currentDevice.Id == args.Id)
                    {
                        castingDevicesList.Items.Remove(currentDevice);
                        break;
                    }
                }
            });
        }

async void Watcher_Stopped | ( | DeviceWatcher | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 136 of file Scenario3_CustomPicker.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //Update UX when the watcher stops
                rootPage.NotifyUser("Watcher has been stopped", NotifyType.StatusMessage);
                watcherControlButton.Content = "Start Device Watcher";
                progressRing.IsActive = false;
            });
        }

void watcherControlButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario3_CustomPicker.xaml.cs.

        {
            //If the watcher isn't running, start it up
            if (watcher.Status != DeviceWatcherStatus.Started)
            {
                //clear the list as we're starting the watcher over
                castingDevicesList.Items.Clear();

                //start the watcher
                watcher.Start();

                //update the UI to reflect the watcher's state
                rootPage.NotifyUser("Watcher has been started", NotifyType.StatusMessage);
                watcherControlButton.Content = "Stop Device Watcher";
                progressText.Text = "Searching";
                progressRing.IsActive = true;
            }
            else
            {
                //if the watcher is running, stop the watcher and update UI
                progressText.Text = "";
                watcher.Stop();
            }
        }

Member Data Documentation

CastingConnection connection [private]

Definition at line 29 of file Scenario3_CustomPicker.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario3_CustomPicker.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 28 of file Scenario3_CustomPicker.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicMediaCasting/cs/Scenario3_CustomPicker.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicReaderWriter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Member Functions | Private Attributes

BasicReaderWriter Class Reference

#include "BasicReaderWriter.h"

List of all members.

Public Member Functions

BasicReaderWriter ()
BasicReaderWriter (_In_ winrt::Windows::Storage::StorageFolder folder)
std::vector< byte > | ReadData (_In_ winrt::hstring const &filename)
winrt::Windows::Foundation::IAsyncOperation
< winrt::Windows::Storage::Streams::IBuffer > 		ReadDataAsync (_In_ winrt::hstring const &filename)
uint32_t | WriteData (_In_ winrt::hstring const &filename, _In_ std::vector< byte > const &fileData)
winrt::Windows::Foundation::IAsyncAction | WriteDataAsync (_In_ winrt::hstring const &filename, _In_ std::vector< byte > const &fileData)

Private Member Functions

BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
BasicReaderWriter (_In_ Windows::Storage::StorageFolder^folder)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
Platform::Array< byte > | ReadData (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
concurrency::task
< Platform::Array< byte >^> 		ReadDataAsync (_In_ Platform::String^filename)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
uint32 | WriteData (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)
concurrency::task< void > | WriteDataAsync (_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData)

Private Attributes

internal | __pad0__: BasicReaderWriter()
Windows::Storage::StorageFolder | m_location

Detailed Description

Definition at line 18 of file BasicReaderWriter.h.

Constructor & Destructor Documentation

BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]

Definition at line 28 of file BasicReaderWriter.cpp.

{
    m_location = folder;
    Platform::String^ path = m_location->Path;
    if (path->Length() == 0)
    {
        // Applications are not permitted to access certain
        // folders, such as the Documents folder, using this
        // code path.  In such cases, the Path property for
        // the folder will be an empty string.
        throw ref new Platform::FailureException();
    }
}

BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]
BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]
BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]
BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]
BasicReaderWriter ( )

Definition at line 23 of file BasicReaderWriter.cpp.

{
    m_location = Package::Current->InstalledLocation;
}

BasicReaderWriter ( _In_ winrt::Windows::Storage::StorageFolder folder )

Definition at line 20 of file BasicReaderWriter.cpp.

    : m_location(std::move(folder))
{
    winrt::hstring path = m_location.Path();
    if (path.size() == 0)
    {
        // Applications are not permitted to access certain
        // folders, such as the Documents folder, using this
        // code path. In such cases, the Path property for
        // the folder will be an empty string.
        winrt::throw_hresult(E_FAIL);
    }
}

BasicReaderWriter ( _In_ Windows::Storage::StorageFolder^ folder ) [private]

Member Function Documentation

Platform::Array< byte > ReadData ( _In_ Platform::String^ filename ) [private]

Definition at line 44 of file BasicReaderWriter.cpp.

{
    CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
    extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
    extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
    extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
    extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
    extendedParams.lpSecurityAttributes = nullptr;
    extendedParams.hTemplateFile = nullptr;

    Wrappers::FileHandle file(
        CreateFile2(
            filename->Data(),
            GENERIC_READ,
            FILE_SHARE_READ,
            OPEN_EXISTING,
            &extendedParams
            )
        );
    if (file.Get() == INVALID_HANDLE_VALUE)
    {
        throw ref new Platform::FailureException();
    }

    FILE_STANDARD_INFO fileInfo = {0};
    if (!GetFileInformationByHandleEx(
        file.Get(),
        FileStandardInfo,
        &fileInfo,
        sizeof(fileInfo)
        ))
    {
        throw ref new Platform::FailureException();
    }

    if (fileInfo.EndOfFile.HighPart != 0)
    {
        throw ref new Platform::OutOfMemoryException();
    }

    Platform::Array<byte>^ fileData = ref new Platform::Array<byte>(fileInfo.EndOfFile.LowPart);

    if (!ReadFile(
        file.Get(),
        fileData->Data,
        fileData->Length,
        nullptr,
        nullptr
        ))
    {
        throw ref new Platform::FailureException();
    }

    return fileData;
}

Platform::Array<byte> ReadData ( _In_ Platform::String^ filename ) [private]
Platform::Array<byte> ReadData ( _In_ Platform::String^ filename ) [private]
Platform::Array<byte> ReadData ( _In_ Platform::String^ filename ) [private]
std::vector< byte > ReadData ( _In_ winrt::hstring const & filename )

Definition at line 36 of file BasicReaderWriter.cpp.

{
    CREATEFILE2_EXTENDED_PARAMETERS extendedParams = { 0 };
    extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
    extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
    extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
    extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
    extendedParams.lpSecurityAttributes = nullptr;
    extendedParams.hTemplateFile = nullptr;

    winrt::file_handle file{
        CreateFile2(
            filename.c_str(),
            GENERIC_READ,
            FILE_SHARE_READ,
            OPEN_EXISTING,
            &extendedParams
            )
    };
    winrt::check_bool(bool{ file });
    if (file.get() == INVALID_HANDLE_VALUE)
    {
        winrt::throw_hresult(E_FAIL);
    }

    FILE_STANDARD_INFO fileInfo = { 0 };
    if (!GetFileInformationByHandleEx(
        file.get(),
        FileStandardInfo,
        &fileInfo,
        sizeof(fileInfo)
        ))
    {
        winrt::throw_hresult(E_FAIL);
    }

    if (fileInfo.EndOfFile.HighPart != 0)
    {
        winrt::throw_hresult(E_OUTOFMEMORY);
    }

    std::vector<byte> fileData(fileInfo.EndOfFile.LowPart);

    if (!ReadFile(
        file.get(),
        fileData.data(),
        (DWORD)fileData.size(),
        nullptr,
        nullptr
        ))
    {
        winrt::throw_hresult(E_FAIL);
    }

    return fileData;
}

Platform::Array<byte> ReadData ( _In_ Platform::String^ filename ) [private]
Platform::Array<byte> ReadData ( _In_ Platform::String^ filename ) [private]
concurrency::task<Platform::Array<byte>^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]
task< Platform::Array< byte >^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]

Definition at line 102 of file BasicReaderWriter.cpp.

{
    return task<StorageFile^>(m_location->GetFileAsync(filename)).then([=](StorageFile^ file)
    {
        return FileIO::ReadBufferAsync(file);
    }).then([=](IBuffer^ buffer)
    {
        auto fileData = ref new Platform::Array<byte>(buffer->Length);
        DataReader::FromBuffer(buffer)->ReadBytes(fileData);
        return fileData;
    });
}

concurrency::task<Platform::Array<byte>^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]
winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Storage::Streams::IBuffer > ReadDataAsync ( _In_ winrt::hstring const & filename )

Definition at line 95 of file BasicReaderWriter.cpp.

{
    StorageFile file{ co_await m_location.GetFileAsync(filename) };
    co_return co_await FileIO::ReadBufferAsync(file);
}

concurrency::task<Platform::Array<byte>^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]
concurrency::task<Platform::Array<byte>^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]
concurrency::task<Platform::Array<byte>^> ReadDataAsync ( _In_ Platform::String^ filename ) [private]
uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]

Definition at line 117 of file BasicReaderWriter.cpp.

{
    CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
    extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
    extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
    extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
    extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
    extendedParams.lpSecurityAttributes = nullptr;
    extendedParams.hTemplateFile = nullptr;

    Wrappers::FileHandle file(
        CreateFile2(
            filename->Data(),
            GENERIC_WRITE,
            0,
            CREATE_ALWAYS,
            &extendedParams
            )
        );
    if (file.Get() == INVALID_HANDLE_VALUE)
    {
        throw ref new Platform::FailureException();
    }

    DWORD numBytesWritten;
    if (
        !WriteFile(
            file.Get(),
            fileData->Data,
            fileData->Length,
            &numBytesWritten,
            nullptr
            ) ||
        numBytesWritten != fileData->Length
        )
    {
        throw ref new Platform::FailureException();
    }

    return numBytesWritten;
}

uint32_t WriteData | ( | _In_ winrt::hstring const & | filename,
 |  | _In_ std::vector< byte > const & | fileData
 | ) |  |

Definition at line 103 of file BasicReaderWriter.cpp.

{
    CREATEFILE2_EXTENDED_PARAMETERS extendedParams = { 0 };
    extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
    extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
    extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
    extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
    extendedParams.lpSecurityAttributes = nullptr;
    extendedParams.hTemplateFile = nullptr;

    winrt::file_handle file{
        CreateFile2(
            filename.c_str(),
            GENERIC_WRITE,
            0,
            CREATE_ALWAYS,
            &extendedParams
            )
    };
    winrt::check_bool(bool{ file });
    if (file.get() == INVALID_HANDLE_VALUE)
    {
        winrt::throw_hresult(E_FAIL);
    }

    DWORD numBytesWritten{ 0 };
    if (
        !WriteFile(
            file.get(),
            fileData.data(),
            (DWORD)fileData.size(),
            &numBytesWritten,
            nullptr
            ) ||
        numBytesWritten != fileData.size()
        )
    {
        winrt::throw_hresult(E_FAIL);
    }

    return numBytesWritten;
}

uint32 WriteData | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
concurrency::task<void> WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
concurrency::task<void> WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
concurrency::task<void> WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
winrt::Windows::Foundation::IAsyncAction WriteDataAsync | ( | _In_ winrt::hstring const & | filename,
 |  | _In_ std::vector< byte > const & | fileData
 | ) |  |

Definition at line 149 of file BasicReaderWriter.cpp.

{
    StorageFile file{ co_await m_location.CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting) };
    co_await FileIO::WriteBytesAsync(file, fileData);
}

concurrency::task<void> WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
concurrency::task<void> WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]
task< void > WriteDataAsync | ( | _In_ Platform::String^ | filename,
 |  | _In_ const Platform::Array< byte >^ | fileData |
 | ) |  |  | [private]

Definition at line 162 of file BasicReaderWriter.cpp.

{
    return task<StorageFile^>(m_location->CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting)).then([=](StorageFile^ file)
    {
        FileIO::WriteBytesAsync(file, fileData);
    });
}

Member Data Documentation

internal __pad0__ [private]

Definition at line 24 of file BasicReaderWriter.h.

Windows::Storage::StorageFolder m_location [private]

Definition at line 21 of file BasicReaderWriter.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.h
  • D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.h
  • D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.h
  • D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.h
  • Simple3DGameDX/cpp/Common/BasicReaderWriter.h
  • Simple3DGameXaml/cpp/Common/BasicReaderWriter.h
  • Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.cpp
  • D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.cpp
  • D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.cpp
  • D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.cpp
  • Simple3DGameDX/cpp/Common/BasicReaderWriter.cpp
  • Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.cpp
  • Simple3DGameXaml/cpp/Common/BasicReaderWriter.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicShapes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

BasicShapes Class Reference

#include "BasicShapes.h"

List of all members.

Public Member Functions

void | CreateBox (float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateBox (float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateCube (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateCube (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateReferenceAxis (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateReferenceAxis (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateTangentSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateTangentSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)

Public Attributes

internal | __pad0__: BasicShapes(ID3D11Device *d3dDevice)

Private Member Functions

BasicShapes (ID3D11Device *d3dDevice)
void | CreateBox (float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateCube (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateIndexBuffer (_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer)
void | CreateIndexBuffer (_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer)
void | CreateIndexBuffer (_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer)
void | CreateReferenceAxis (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateTangentSphere (_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount)
void | CreateTangentVertexBuffer (_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)
void | CreateTangentVertexBuffer (_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)
void | CreateTangentVertexBuffer (_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)
void | CreateVertexBuffer (_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)
void | CreateVertexBuffer (_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)
void | CreateVertexBuffer (_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11Device > 		m_d3dDevice
winrt::com_ptr< ID3D11Device > | m_d3dDevice

Detailed Description

Definition at line 31 of file BasicShapes.h.

Constructor & Destructor Documentation

BasicShapes ( ID3D11Device * d3dDevice ) [private]

Member Function Documentation

void CreateBox | ( | float3 | radii,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateBox | ( | float3 | radii,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount |
 | ) |  |  | [private]
void CreateBox | ( | float3 | radii,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateCube | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateCube | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount |
 | ) |  |  | [private]
void CreateCube | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateIndexBuffer | ( | _In_ unsigned int | numIndices,
 |  | _In_ unsigned short * | indexData,
 |  | _Out_ ID3D11Buffer ** | indexBuffer |
 | ) |  |  | [private]
void CreateIndexBuffer | ( | _In_ unsigned int | numIndices,
 |  | _In_ unsigned short * | indexData,
 |  | _Out_ ID3D11Buffer ** | indexBuffer |
 | ) |  |  | [private]
void CreateIndexBuffer | ( | _In_ unsigned int | numIndices,
 |  | _In_ unsigned short * | indexData,
 |  | _Out_ ID3D11Buffer ** | indexBuffer |
 | ) |  |  | [private]
void CreateReferenceAxis | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateReferenceAxis | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateReferenceAxis | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount |
 | ) |  |  | [private]
void CreateSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount |
 | ) |  |  | [private]
void CreateSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateTangentSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateTangentSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount
 | ) |  |
void CreateTangentSphere | ( | _Out_ ID3D11Buffer ** | vertexBuffer,
 |  | _Out_ ID3D11Buffer ** | indexBuffer,
 |  | _Out_opt_ unsigned int * | vertexCount,
 |  | _Out_opt_ unsigned int * | indexCount |
 | ) |  |  | [private]
void CreateTangentVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ TangentVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]
void CreateTangentVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ TangentVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]
void CreateTangentVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ TangentVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]
void CreateVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ BasicVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]
void CreateVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ BasicVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]
void CreateVertexBuffer | ( | _In_ unsigned int | numVertices,
 |  | _In_ BasicVertex * | vertexData,
 |  | _Out_ ID3D11Buffer ** | vertexBuffer |
 | ) |  |  | [private]

Member Data Documentation

internal __pad0__

Definition at line 34 of file BasicShapes.h.

winrt::com_ptr<ID3D11Device> m_d3dDevice [private]

Definition at line 68 of file BasicShapes.h.

Microsoft::WRL::ComPtr< ID3D11Device > m_d3dDevice [private]

Definition at line 68 of file BasicShapes.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicShapes.h
  • Simple3DGameDX/cppwinrt/Common/BasicShapes.h
  • Simple3DGameXaml/cpp/Common/BasicShapes.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Private Member Functions | Private Attributes

BasicTimer Class Reference

#include "BasicTimer.h"

List of all members.

Private Member Functions

void | Reset ()
void | Reset ()
void | Update ()
void | Update ()

Private Attributes

internal | __pad0__: BasicTimer()
LARGE_INTEGER m_currentTime
float | m_delta
LARGE_INTEGER m_frequency
LARGE_INTEGER m_lastTime
LARGE_INTEGER m_startTime
float | m_total

Detailed Description

Definition at line 17 of file BasicTimer.h.

Member Function Documentation

void Reset ( ) [private]

Definition at line 24 of file BasicTimer.cpp.

{
    Update();
    m_startTime = m_currentTime;
    m_total = 0.0f;
    m_delta = 1.0f / 60.0f;
}

void Reset ( ) [private]
void Update ( ) [private]
void Update ( ) [private]

Definition at line 32 of file BasicTimer.cpp.

{
    if (!QueryPerformanceCounter(&m_currentTime))
    {
        throw ref new Platform::FailureException();
    }

    m_total = static_cast<float>(
        static_cast<double>(m_currentTime.QuadPart-m_startTime.QuadPart) /
        static_cast<double>(m_frequency.QuadPart)
        );

    if (m_lastTime.QuadPart == m_startTime.QuadPart)
    {
        // If the timer was just reset, report a time delta equivalent to 60Hz frame time.
        m_delta = 1.0f / 60.0f;
    }
    else
    {
        m_delta = static_cast<float>(
            static_cast<double>(m_currentTime.QuadPart-m_lastTime.QuadPart) /
            static_cast<double>(m_frequency.QuadPart)
            );
    }

    m_lastTime = m_currentTime;
}

Member Data Documentation

internal __pad0__ [private]

Definition at line 28 of file BasicTimer.h.

LARGE_INTEGER m_currentTime [private]

Definition at line 21 of file BasicTimer.h.

float m_delta [private]

Definition at line 25 of file BasicTimer.h.

LARGE_INTEGER m_frequency [private]

Definition at line 20 of file BasicTimer.h.

LARGE_INTEGER m_lastTime [private]

Definition at line 23 of file BasicTimer.h.

LARGE_INTEGER m_startTime [private]

Definition at line 22 of file BasicTimer.h.

float m_total [private]

Definition at line 24 of file BasicTimer.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/PixelShader/BasicTimer.h
  • D2DCustomEffects/cpp/VertexShader/BasicTimer.h
  • D2DCustomEffects/cpp/PixelShader/BasicTimer.cpp
  • D2DCustomEffects/cpp/VertexShader/BasicTimer.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicVertex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

BasicVertex Struct Reference

#include "BasicShapes.h"

List of all members.

Public Attributes

float3 norm
float3 pos
float2 tex

Detailed Description

Definition at line 13 of file BasicShapes.h.

Member Data Documentation

float3 norm

Definition at line 16 of file BasicShapes.h.

float3 pos

Definition at line 15 of file BasicShapes.h.

float2 tex

Definition at line 17 of file BasicShapes.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicShapes.h
  • Simple3DGameDX/cppwinrt/Common/BasicShapes.h
  • Simple3DGameXaml/cpp/Common/BasicShapes.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ColorToStringConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BindTestbedModel
  • ColorToStringConverter
Public Member Functions | Static Private Attributes

ColorToStringConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Static Private Attributes

static string[] | colorNames = { "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen" }
static Color[] | colorValues = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen }

Detailed Description

Definition at line 9 of file Converters.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 14 of file Converters.cs.

        {
            Color src = (Color)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorValues[i])
                {
                    return colorNames[i];
                }
            }
            return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", src.A, src.R, src.G, src.B);
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 14 of file Converters.cs.

        {
            Color src = (Color)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorValues[i])
                {
                    return colorNames[i];
                }
            }
            return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", src.A, src.R, src.G, src.B);
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 27 of file Converters.cs.

        {
            string src = (string)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorNames[i])
                {
                    return colorValues[i];
                }
            }
            if (src.StartsWith("#"))
            {
                return Color.FromArgb(Byte.Parse(src.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(5, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(7, 2), System.Globalization.NumberStyles.HexNumber));
            }
            throw new ArgumentException("Cannot parse the color");
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 27 of file Converters.cs.

        {
            string src = (string)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorNames[i])
                {
                    return colorValues[i];
                }
            }
            if (src.StartsWith("#"))
            {
                return Color.FromArgb(Byte.Parse(src.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(5, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(7, 2), System.Globalization.NumberStyles.HexNumber));
            }
            throw new ArgumentException("Cannot parse the color");
        }

Member Data Documentation

string [] colorNames = { "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen" } [static, private]

Definition at line 11 of file Converters.cs.

Color [] colorValues = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen } [static, private]

Definition at line 12 of file Converters.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/Converters.cs
  • XamlBind/cs/xBindSampleModel/Converters.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VeryObservableCollection-g< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BindTestbedModel
  • VeryObservableCollection-g< T >
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

VeryObservableCollection-g< T > Class Template Reference

List of all members.

Public Member Functions

void | Add (T item)
void | Add (T item)
void | Clear ()
void | Clear ()
bool | Contains (T item)
bool | Contains (T item)
void | CopyTo (T[] array, int arrayIndex)
void | CopyTo (T[] array, int arrayIndex)
IEnumerator< T > | GetEnumerator ()
IEnumerator< T > | GetEnumerator ()
int | IndexOf (T item)
int | IndexOf (T item)
void | Insert (int index, T item)
void | Insert (int index, T item)
bool | Remove (T item)
bool | Remove (T item)
void | RemoveAt (int index)
void | RemoveAt (int index)
VeryObservableCollection ()
VeryObservableCollection ()

Properties

int | Count [get]
int ICollection. | Count [get]
bool IList. | IsFixedSize [get]
bool IList. | IsReadOnly [get]
bool | IsReadOnly [get]
bool ICollection. | IsSynchronized [get]
object ICollection. | SyncRoot [get]
object IList. | this [int index] [get, set]
T | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged
VectorChangedEventHandler< T > | VectorChanged

Private Member Functions

int IList. | Add (object item)
int IList. | Add (object item)
void IList. | Clear ()
void IList. | Clear ()
bool IList. | Contains (object item)
bool IList. | Contains (object item)
void ICollection. | CopyTo (Array dest, int index)
void ICollection. | CopyTo (Array dest, int index)
void | Data_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
void | Data_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
IEnumerator IEnumerable. | GetEnumerator ()
IEnumerator IEnumerable. | GetEnumerator ()
int IList. | IndexOf (object item)
int IList. | IndexOf (object item)
void IList. | Insert (int index, object item)
void IList. | Insert (int index, object item)
void IList. | Remove (object item)
void IList. | Remove (object item)
void IList. | RemoveAt (int index)
void IList. | RemoveAt (int index)

Private Attributes

ObservableCollection< T > | data

Detailed Description

template<T>
class BindTestbedModel::VeryObservableCollection-g< T >

Definition at line 13 of file VeryObservableCollection.cs.

Member Function Documentation

void Add ( T item ) [inline]

Definition at line 64 of file VeryObservableCollection.cs.

        {
            data.Add(item);
        }

void Add ( T item ) [inline]

Definition at line 64 of file VeryObservableCollection.cs.

        {
            data.Add(item);
        }

int IList. Add ( object item ) [inline, private]

Definition at line 130 of file VeryObservableCollection.cs.

        {
            data.Add((T)item);
            return data.Count;
        }

int IList. Add ( object item ) [inline, private]

Definition at line 130 of file VeryObservableCollection.cs.

        {
            data.Add((T)item);
            return data.Count;
        }

void IList. Clear ( ) [inline, private]

Definition at line 150 of file VeryObservableCollection.cs.

        {
            data.Clear();
        }

void IList. Clear ( ) [inline, private]

Definition at line 150 of file VeryObservableCollection.cs.

        {
            data.Clear();
        }

void Clear ( ) [inline]

Definition at line 69 of file VeryObservableCollection.cs.

        {
            data.Clear();
        }

void Clear ( ) [inline]

Definition at line 69 of file VeryObservableCollection.cs.

        {
            data.Clear();
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 136 of file VeryObservableCollection.cs.

{ return data.Contains((T)item); }

bool Contains ( T item ) [inline]

Definition at line 74 of file VeryObservableCollection.cs.

        {
            return data.Contains(item);
        }

bool Contains ( T item ) [inline]

Definition at line 74 of file VeryObservableCollection.cs.

        {
            return data.Contains(item);
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 136 of file VeryObservableCollection.cs.

{ return data.Contains((T)item); }

void ICollection. CopyTo | ( | Array | dest,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 160 of file VeryObservableCollection.cs.

        {
            data.CopyTo((T[])dest, index);
        }

void ICollection. CopyTo | ( | Array | dest,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 160 of file VeryObservableCollection.cs.

        {
            data.CopyTo((T[])dest, index);
        }

void CopyTo | ( | T[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 79 of file VeryObservableCollection.cs.

        {
            data.CopyTo(array, arrayIndex);
        }

void CopyTo | ( | T[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 79 of file VeryObservableCollection.cs.

        {
            data.CopyTo(array, arrayIndex);
        }

void Data_CollectionChanged | ( | object | sender,
 |  | NotifyCollectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file VeryObservableCollection.cs.

        {
            if (VectorChanged != null)
            {
                VectorChangedEventAgrs args = new VectorChangedEventAgrs();
                args.CollectionChange = CollectionChange.Reset;
                VectorChanged(this, args);
            }

            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
                CollectionChanged(this, e);
            }
        }

void Data_CollectionChanged | ( | object | sender,
 |  | NotifyCollectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file VeryObservableCollection.cs.

        {
            if (VectorChanged != null)
            {
                VectorChangedEventAgrs args = new VectorChangedEventAgrs();
                args.CollectionChange = CollectionChange.Reset;
                VectorChanged(this, args);
            }

            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
                CollectionChanged(this, e);
            }
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 109 of file VeryObservableCollection.cs.

        {
            return data.GetEnumerator();
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 109 of file VeryObservableCollection.cs.

        {
            return data.GetEnumerator();
        }

IEnumerator<T> GetEnumerator ( ) [inline]

Definition at line 84 of file VeryObservableCollection.cs.

        {
            return data.GetEnumerator();
        }

IEnumerator<T> GetEnumerator ( ) [inline]

Definition at line 84 of file VeryObservableCollection.cs.

        {
            return data.GetEnumerator();
        }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 138 of file VeryObservableCollection.cs.

{ return data.IndexOf((T)item); }

int IndexOf ( T item ) [inline]

Definition at line 89 of file VeryObservableCollection.cs.

        {
            return data.IndexOf(item);
        }

int IndexOf ( T item ) [inline]

Definition at line 89 of file VeryObservableCollection.cs.

        {
            return data.IndexOf(item);
        }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 138 of file VeryObservableCollection.cs.

{ return data.IndexOf((T)item); }

void IList. Insert | ( | int | index,
 |  | object | item |
 | ) |  |  | [inline, private]

Definition at line 141 of file VeryObservableCollection.cs.

        {
            data.Insert(index, (T)item);
        }

void Insert | ( | int | index,
 |  | T | item |
 | ) |  |  | [inline]

Definition at line 94 of file VeryObservableCollection.cs.

        {
            data.Insert(index, item);
        }

void Insert | ( | int | index,
 |  | T | item |
 | ) |  |  | [inline]

Definition at line 94 of file VeryObservableCollection.cs.

        {
            data.Insert(index, item);
        }

void IList. Insert | ( | int | index,
 |  | object | item |
 | ) |  |  | [inline, private]

Definition at line 141 of file VeryObservableCollection.cs.

        {
            data.Insert(index, (T)item);
        }

bool Remove ( T item ) [inline]

Definition at line 99 of file VeryObservableCollection.cs.

        {
            return data.Remove(item);
        }

void IList. Remove ( object item ) [inline, private]

Definition at line 146 of file VeryObservableCollection.cs.

        {
            data.Remove((T)item);
        }

bool Remove ( T item ) [inline]

Definition at line 99 of file VeryObservableCollection.cs.

        {
            return data.Remove(item);
        }

void IList. Remove ( object item ) [inline, private]

Definition at line 146 of file VeryObservableCollection.cs.

        {
            data.Remove((T)item);
        }

void RemoveAt ( int index ) [inline]

Definition at line 104 of file VeryObservableCollection.cs.

        {
            data.RemoveAt(index);
        }

void RemoveAt ( int index ) [inline]

Definition at line 104 of file VeryObservableCollection.cs.

        {
            data.RemoveAt(index);
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 155 of file VeryObservableCollection.cs.

        {
            data.RemoveAt(index);
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 155 of file VeryObservableCollection.cs.

        {
            data.RemoveAt(index);
        }

VeryObservableCollection ( ) [inline]

Definition at line 17 of file VeryObservableCollection.cs.

        {
            data = new ObservableCollection<T>();
            data.CollectionChanged += Data_CollectionChanged;
        }

VeryObservableCollection ( ) [inline]

Definition at line 17 of file VeryObservableCollection.cs.

        {
            data = new ObservableCollection<T>();
            data.CollectionChanged += Data_CollectionChanged;
        }

Member Data Documentation

ObservableCollection< T > data [private]

Definition at line 15 of file VeryObservableCollection.cs.

Property Documentation

int ICollection Count [get]

Definition at line 54 of file VeryObservableCollection.cs.

int ICollection. Count [get, private]

Definition at line 120 of file VeryObservableCollection.cs.

bool IList IsFixedSize [get, private]

Definition at line 116 of file VeryObservableCollection.cs.

bool IList. IsReadOnly [get, private]

Definition at line 118 of file VeryObservableCollection.cs.

bool IList IsReadOnly [get]

Definition at line 57 of file VeryObservableCollection.cs.

bool ICollection IsSynchronized [get, private]

Definition at line 121 of file VeryObservableCollection.cs.

object ICollection SyncRoot [get, private]

Definition at line 123 of file VeryObservableCollection.cs.

object IList. this[int index] [get, set, private]

Definition at line 126 of file VeryObservableCollection.cs.

object IList this [get, set]

Definition at line 49 of file VeryObservableCollection.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 27 of file VeryObservableCollection.cs.

VectorChangedEventHandler< T > VectorChanged

Definition at line 25 of file VeryObservableCollection.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/VeryObservableCollection.cs
  • XamlBind/cs/xBindSampleModel/VeryObservableCollection.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Watcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BluetoothAdvertisement
  • Scenario1_Watcher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Watcher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Watcher ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | App_Resuming (object sender, object e)
void | App_Suspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | OnAdvertisementReceived (BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementReceivedEventArgs eventArgs)
async void | OnAdvertisementWatcherStopped (BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementWatcherStoppedEventArgs eventArgs)
void | RunButton_Click (object sender, RoutedEventArgs e)
void | StopButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage
BluetoothLEAdvertisementWatcher | watcher

Detailed Description

Definition at line 28 of file Scenario1_Watcher.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Watcher ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 40 of file Scenario1_Watcher.xaml.cs.

        {
            this.InitializeComponent();

            // Create and initialize a new watcher instance.
            watcher = new BluetoothLEAdvertisementWatcher();

            // Begin of watcher configuration. Configure the advertisement filter to look for the data advertised by the publisher
            // in Scenario 2 or 4. You need to run Scenario 2 on another Windows platform within proximity of this one for Scenario 1 to
            // take effect. The APIs shown in this Scenario are designed to operate only if the App is in the foreground. For background
            // watcher operation, please refer to Scenario 3.

            // Please comment out this following section (watcher configuration) if you want to remove all filters. By not specifying
            // any filters, all advertisements received will be notified to the App through the event handler. You should comment out the following
            // section if you do not have another Windows platform to run Scenario 2 alongside Scenario 1 or if you want to scan for
            // all LE advertisements around you.

            // For determining the filter restrictions programatically across APIs, use the following properties:
            //      MinSamplingInterval, MaxSamplingInterval, MinOutOfRangeTimeout, MaxOutOfRangeTimeout

            // Part 1A: Configuring the advertisement filter to watch for a particular advertisement payload

            // First, let create a manufacturer data section we wanted to match for. These are the same as the one
            // created in Scenario 2 and 4.
            var manufacturerData = new BluetoothLEManufacturerData();

            // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
            manufacturerData.CompanyId = 0xFFFE;

            // Finally set the data payload within the manufacturer-specific section
            // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
            var writer = new DataWriter();
            writer.WriteUInt16(0x1234);

            // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
            manufacturerData.Data = writer.DetachBuffer();

            // Add the manufacturer data to the advertisement filter on the watcher:
            watcher.AdvertisementFilter.Advertisement.ManufacturerData.Add(manufacturerData);

            // Part 1B: Configuring the signal strength filter for proximity scenarios

            // Configure the signal strength filter to only propagate events when in-range
            // Please adjust these values if you cannot receive any advertisement
            // Set the in-range threshold to -70dBm. This means advertisements with RSSI >= -70dBm
            // will start to be considered "in-range".
            watcher.SignalStrengthFilter.InRangeThresholdInDBm = -70;

            // Set the out-of-range threshold to -75dBm (give some buffer). Used in conjunction with OutOfRangeTimeout
            // to determine when an advertisement is no longer considered "in-range"
            watcher.SignalStrengthFilter.OutOfRangeThresholdInDBm = -75;

            // Set the out-of-range timeout to be 2 seconds. Used in conjunction with OutOfRangeThresholdInDBm
            // to determine when an advertisement is no longer considered "in-range"
            watcher.SignalStrengthFilter.OutOfRangeTimeout = TimeSpan.FromMilliseconds(2000);

            // By default, the sampling interval is set to zero, which means there is no sampling and all
            // the advertisement received is returned in the Received event

            // End of watcher configuration. There is no need to comment out any code beyond this point.
        }

Member Function Documentation

void App_Resuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being resumed.

Parameters:
sender The source of the resume request.
e

Definition at line 177 of file Scenario1_Watcher.xaml.cs.

        {
            watcher.Received += OnAdvertisementReceived;
            watcher.Stopped += OnAdvertisementWatcherStopped;
        }

void App_Suspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 161 of file Scenario1_Watcher.xaml.cs.

        {
            // Make sure to stop the watcher on suspend.
            watcher.Stop();
            // Always unregister the handlers to release the resources to prevent leaks.
            watcher.Received -= OnAdvertisementReceived;
            watcher.Stopped -= OnAdvertisementWatcherStopped;

            rootPage.NotifyUser("App suspending. Watcher stopped.", NotifyType.StatusMessage);
        }

async void OnAdvertisementReceived | ( | BluetoothLEAdvertisementWatcher | watcher,
 |  | BluetoothLEAdvertisementReceivedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Invoked as an event handler when an advertisement is received.

Parameters:
watcher | Instance of watcher that triggered the event.
eventArgs | Event data containing information about the advertisement event.

Definition at line 214 of file Scenario1_Watcher.xaml.cs.

        {
            // We can obtain various information about the advertisement we just received by accessing
            // the properties of the EventArgs class

            // The timestamp of the event
            DateTimeOffset timestamp = eventArgs.Timestamp;

            // The type of advertisement
            BluetoothLEAdvertisementType advertisementType = eventArgs.AdvertisementType;

            // The received signal strength indicator (RSSI)
            Int16 rssi = eventArgs.RawSignalStrengthInDBm;

            // The local name of the advertising device contained within the payload, if any
            string localName = eventArgs.Advertisement.LocalName;

            // Check if there are any manufacturer-specific sections.
            // If there is, print the raw data of the first manufacturer section (if there are multiple).
            string manufacturerDataString = "";
            var manufacturerSections = eventArgs.Advertisement.ManufacturerData;
            if (manufacturerSections.Count > 0)
            {
                // Only print the first one of the list
                var manufacturerData = manufacturerSections[0];
                var data = new byte[manufacturerData.Data.Length];
                using (var reader = DataReader.FromBuffer(manufacturerData.Data))
                {
                    reader.ReadBytes(data);
                }
                // Print the company ID + the raw data in hex format
                manufacturerDataString = string.Format("0x{0}: {1}",
                    manufacturerData.CompanyId.ToString("X"),
                    BitConverter.ToString(data));
            }

            // Serialize UI update to the main UI thread
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                // Display these information on the list
                ReceivedAdvertisementListBox.Items.Add(string.Format("[{0}]: type={1}, rssi={2}, name={3}, manufacturerData=[{4}]",
                    timestamp.ToString("hh\\:mm\\:ss\\.fff"),
                    advertisementType.ToString(),
                    rssi.ToString(),
                    localName,
                    manufacturerDataString));
            });
        }

async void OnAdvertisementWatcherStopped | ( | BluetoothLEAdvertisementWatcher | watcher,
 |  | BluetoothLEAdvertisementWatcherStoppedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Invoked as an event handler when the watcher is stopped or aborted.

Parameters:
watcher | Instance of watcher that triggered the event.
eventArgs | Event data containing information about why the watcher stopped or aborted.

Definition at line 268 of file Scenario1_Watcher.xaml.cs.

        {
            // Notify the user that the watcher was stopped
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(string.Format("Watcher stopped or aborted: {0}", eventArgs.Error.ToString()), NotifyType.StatusMessage);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 110 of file Scenario1_Watcher.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Attach a handler to process the received advertisement.
            // The watcher cannot be started without a Received handler attached
            watcher.Received += OnAdvertisementReceived;

            // Attach a handler to process watcher stopping due to various conditions,
            // such as the Bluetooth radio turning off or the Stop method was called
            watcher.Stopped += OnAdvertisementWatcherStopped;

            // Attach handlers for suspension to stop the watcher when the App is suspended.
            App.Current.Suspending += App_Suspending;
            App.Current.Resuming += App_Resuming;

            rootPage.NotifyUser("Press Run to start watcher.", NotifyType.StatusMessage);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 137 of file Scenario1_Watcher.xaml.cs.

        {
            // Remove local suspension handlers from the App since this page is no longer active.
            App.Current.Suspending -= App_Suspending;
            App.Current.Resuming -= App_Resuming;

            // Make sure to stop the watcher when leaving the context. Even if the watcher is not stopped,
            // scanning will be stopped automatically if the watcher is destroyed.
            watcher.Stop();
            // Always unregister the handlers to release the resources to prevent leaks.
            watcher.Received -= OnAdvertisementReceived;
            watcher.Stopped -= OnAdvertisementWatcherStopped;

            rootPage.NotifyUser("Navigating away. Watcher stopped.", NotifyType.StatusMessage);
            base.OnNavigatingFrom(e);
        }

void RunButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Run button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 188 of file Scenario1_Watcher.xaml.cs.

        {
            // Calling watcher start will start the scanning if not already initiated by another client
            watcher.Start();

            rootPage.NotifyUser("Watcher started.", NotifyType.StatusMessage);
        }

void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Stop button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 201 of file Scenario1_Watcher.xaml.cs.

        {
            // Stopping the watcher will stop scanning if this is the only client requesting scan
            watcher.Stop();

            rootPage.NotifyUser("Watcher stopped.", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 34 of file Scenario1_Watcher.xaml.cs.

BluetoothLEAdvertisementWatcher watcher [private]

Definition at line 31 of file Scenario1_Watcher.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Scenario1_Watcher.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Publisher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BluetoothAdvertisement
  • Scenario2_Publisher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Publisher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_Publisher ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | App_Resuming (object sender, object e)
void | App_Suspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | OnPublisherStatusChanged (BluetoothLEAdvertisementPublisher publisher, BluetoothLEAdvertisementPublisherStatusChangedEventArgs eventArgs)
void | RunButton_Click (object sender, RoutedEventArgs e)
void | StopButton_Click (object sender, RoutedEventArgs e)

Private Attributes

BluetoothLEAdvertisementPublisher | publisher
MainPage rootPage

Detailed Description

Definition at line 29 of file Scenario2_Publisher.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Publisher ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 41 of file Scenario2_Publisher.xaml.cs.

        {
            this.InitializeComponent();

            // Create and initialize a new publisher instance.
            publisher = new BluetoothLEAdvertisementPublisher();

            // We need to add some payload to the advertisement. A publisher without any payload
            // or with invalid ones cannot be started. We only need to configure the payload once
            // for any publisher.

            // Add a manufacturer-specific section:
            // First, let create a manufacturer data section
            var manufacturerData = new BluetoothLEManufacturerData();

            // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
            manufacturerData.CompanyId = 0xFFFE;

            // Finally set the data payload within the manufacturer-specific section
            // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
            var writer = new DataWriter();
            UInt16 uuidData = 0x1234;
            writer.WriteUInt16(uuidData);

            // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
            manufacturerData.Data = writer.DetachBuffer();

            // Add the manufacturer data to the advertisement publisher:
            publisher.Advertisement.ManufacturerData.Add(manufacturerData);

            // Display the information about the published payload
            PublisherPayloadBlock.Text = string.Format("Published payload information: CompanyId=0x{0}, ManufacturerData=0x{1}",
                manufacturerData.CompanyId.ToString("X"),
                uuidData.ToString("X"));

            // Display the current status of the publisher
            PublisherStatusBlock.Text = string.Format("Published Status: {0}, Error: {1}",
                publisher.Status,
                BluetoothError.Success);
        }

Member Function Documentation

void App_Resuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being resumed.

Parameters:
sender The source of the resume request.
e

Definition at line 152 of file Scenario2_Publisher.xaml.cs.

        {
            publisher.StatusChanged += OnPublisherStatusChanged;
        }

void App_Suspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 137 of file Scenario2_Publisher.xaml.cs.

        {
            // Make sure to stop the publisher on suspend.
            publisher.Stop();
            // Always unregister the handlers to release the resources to prevent leaks.
            publisher.StatusChanged -= OnPublisherStatusChanged;

            rootPage.NotifyUser("App suspending. Publisher stopped.", NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 89 of file Scenario2_Publisher.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Attach a event handler to monitor the status of the publisher, which
            // can tell us whether the advertising has been serviced or is waiting to be serviced
            // due to lack of resources. It will also inform us of unexpected errors such as the Bluetooth
            // radio being turned off by the user.
            publisher.StatusChanged += OnPublisherStatusChanged;

            // Attach handlers for suspension to stop the publisher when the App is suspended.
            App.Current.Suspending += App_Suspending;
            App.Current.Resuming += App_Resuming;

            rootPage.NotifyUser("Press Run to start publisher.", NotifyType.StatusMessage);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 114 of file Scenario2_Publisher.xaml.cs.

        {
            // Remove local suspension handlers from the App since this page is no longer active.
            App.Current.Suspending -= App_Suspending;
            App.Current.Resuming -= App_Resuming;

            // Make sure to stop the publisher when leaving the context. Even if the publisher is not stopped,
            // advertising will be stopped automatically if the publisher is destroyed.
            publisher.Stop();
            // Always unregister the handlers to release the resources to prevent leaks.
            publisher.StatusChanged -= OnPublisherStatusChanged;

            rootPage.NotifyUser("Navigating away. Publisher stopped.", NotifyType.StatusMessage);
            base.OnNavigatingFrom(e);
        }

async void OnPublisherStatusChanged | ( | BluetoothLEAdvertisementPublisher | publisher,
 |  | BluetoothLEAdvertisementPublisherStatusChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Invoked as an event handler when the status of the publisher changes.

Parameters:
publisher | Instance of publisher that triggered the event.
eventArgs | Event data containing information about the publisher status change event.

Definition at line 188 of file Scenario2_Publisher.xaml.cs.

        {
            // This event handler can be used to monitor the status of the publisher.
            // We can catch errors if the publisher is aborted by the system
            BluetoothLEAdvertisementPublisherStatus status = eventArgs.Status;
            BluetoothError error = eventArgs.Error;

            // Update the publisher status displayed in the sample
            // Serialize UI update to the main UI thread
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PublisherStatusBlock.Text = string.Format("Published Status: {0}, Error: {1}",
                    status.ToString(),
                    error.ToString());
            });
        }

void RunButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Run button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 162 of file Scenario2_Publisher.xaml.cs.

        {
            // Calling publisher start will start the advertising if resources are available to do so
            publisher.Start();

            rootPage.NotifyUser("Publisher started.", NotifyType.StatusMessage);
        }

void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Stop button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 175 of file Scenario2_Publisher.xaml.cs.

        {
            // Stopping the publisher will stop advertising the published payload
            publisher.Stop();

            rootPage.NotifyUser("Publisher stopped.", NotifyType.StatusMessage);
        }

Member Data Documentation

BluetoothLEAdvertisementPublisher publisher [private]

Definition at line 32 of file Scenario2_Publisher.xaml.cs.

MainPage rootPage [private]

Definition at line 35 of file Scenario2_Publisher.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Scenario2_Publisher.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BluetoothAdvertisement
  • Scenario3_BackgroundWatcher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_BackgroundWatcher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_BackgroundWatcher ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | App_Resuming (object sender, object e)
void | App_Suspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | OnBackgroundTaskCompleted (BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs eventArgs)
async void | RunButton_Click (object sender, RoutedEventArgs e)
void | StopButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage
string | taskEntryPoint = "BackgroundTasks.AdvertisementWatcherTask"
string | taskName = "Scenario3_BackgroundTask"
IBackgroundTaskRegistration | taskRegistration
BluetoothLEAdvertisementWatcherTrigger | trigger

Detailed Description

Definition at line 31 of file Scenario3_BackgroundWatcher.xaml.cs.

Constructor & Destructor Documentation

Scenario3_BackgroundWatcher ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 49 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            this.InitializeComponent();

            // Create and initialize a new trigger to configure it.
            trigger = new BluetoothLEAdvertisementWatcherTrigger();

            // Configure the advertisement filter to look for the data advertised by the publisher in Scenario 2 or 4.
            // You need to run Scenario 2 on another Windows platform within proximity of this one for Scenario 3 to
            // take effect.

            // Unlike the APIs in Scenario 1 which operate in the foreground. This API allows the developer to register a background
            // task to process advertisement packets in the background. It has more restrictions on valid filter configuration.
            // For example, exactly one single matching filter condition is allowed (no more or less) and the sampling interval

            // For determining the filter restrictions programatically across APIs, use the following properties:
            //      MinSamplingInterval, MaxSamplingInterval, MinOutOfRangeTimeout, MaxOutOfRangeTimeout

            // Part 1A: Configuring the advertisement filter to watch for a particular advertisement payload

            // First, let create a manufacturer data section we wanted to match for. These are the same as the one
            // created in Scenario 2 and 4. Note that in the background only a single filter pattern is allowed per trigger.
            var manufacturerData = new BluetoothLEManufacturerData();

            // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
            manufacturerData.CompanyId = 0xFFFE;

            // Finally set the data payload within the manufacturer-specific section
            // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
            DataWriter writer = new DataWriter();
            writer.WriteUInt16(0x1234);

            // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
            manufacturerData.Data = writer.DetachBuffer();

            // Add the manufacturer data to the advertisement filter on the trigger:
            trigger.AdvertisementFilter.Advertisement.ManufacturerData.Add(manufacturerData);

            // Part 1B: Configuring the signal strength filter for proximity scenarios

            // Configure the signal strength filter to only propagate events when in-range
            // Please adjust these values if you cannot receive any advertisement
            // Set the in-range threshold to -70dBm. This means advertisements with RSSI >= -70dBm
            // will start to be considered "in-range".
            trigger.SignalStrengthFilter.InRangeThresholdInDBm = -70;

            // Set the out-of-range threshold to -75dBm (give some buffer). Used in conjunction with OutOfRangeTimeout
            // to determine when an advertisement is no longer considered "in-range"
            trigger.SignalStrengthFilter.OutOfRangeThresholdInDBm = -75;

            // Set the out-of-range timeout to be 2 seconds. Used in conjunction with OutOfRangeThresholdInDBm
            // to determine when an advertisement is no longer considered "in-range"
            trigger.SignalStrengthFilter.OutOfRangeTimeout = TimeSpan.FromMilliseconds(2000);

            // By default, the sampling interval is set to be disabled, or the maximum sampling interval supported.
            // The sampling interval set to MaxSamplingInterval indicates that the event will only trigger once after it comes into range.
            // Here, set the sampling period to 1 second, which is the minimum supported for background.
            trigger.SignalStrengthFilter.SamplingInterval = TimeSpan.FromMilliseconds(1000);
        }

Member Function Documentation

void App_Resuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being resumed.

Parameters:
sender The source of the resume request.
e

Definition at line 192 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            // Get the existing task if already registered
            if (taskRegistration == null)
            {
                // Find the task if we previously registered it
                foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
                {
                    if (task.Name == taskName)
                    {
                        taskRegistration = task;
                        taskRegistration.Completed += OnBackgroundTaskCompleted;
                        break;
                    }
                }
            }
            else
            {
                taskRegistration.Completed += OnBackgroundTaskCompleted;
            }
        }

void App_Suspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 177 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            if (taskRegistration != null)
            {
                // Always unregister the handlers to release the resources to prevent leaks.
                taskRegistration.Completed -= OnBackgroundTaskCompleted;
            }
            rootPage.NotifyUser("App suspending.", NotifyType.StatusMessage);
        }

async void OnBackgroundTaskCompleted | ( | BackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 303 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            // We get the advertisement(s) processed by the background task
            if (ApplicationData.Current.LocalSettings.Values.Keys.Contains(taskName))
            {
                string backgroundMessage = (string) ApplicationData.Current.LocalSettings.Values[taskName];
                // Serialize UI update to the main UI thread
                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    // Display these information on the list
                    ReceivedAdvertisementListBox.Items.Add(backgroundMessage);
                });
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 116 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Get the existing task if already registered
            if (taskRegistration == null)
            {
                // Find the task if we previously registered it
                foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
                {
                    if (task.Name == taskName)
                    {
                        taskRegistration = task;
                        taskRegistration.Completed += OnBackgroundTaskCompleted;
                        break;
                    }
                }
            }
            else
            {
                taskRegistration.Completed += OnBackgroundTaskCompleted;
            }

            // Attach handlers for suspension to stop the watcher when the App is suspended.
            App.Current.Suspending += App_Suspending;
            App.Current.Resuming += App_Resuming;

            rootPage.NotifyUser("Press Run to register watcher.", NotifyType.StatusMessage);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 154 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            // Remove local suspension handlers from the App since this page is no longer active.
            App.Current.Suspending -= App_Suspending;
            App.Current.Resuming -= App_Resuming;

            // Since the watcher is registered in the background, the background task will be triggered when the App is closed
            // or in the background. To unregister the task, press the Stop button.
            if (taskRegistration != null)
            {
                // Always unregister the handlers to release the resources to prevent leaks.
                taskRegistration.Completed -= OnBackgroundTaskCompleted;
            }
            base.OnNavigatingFrom(e);
        }

async void RunButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Run button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 219 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            // Registering a background trigger if it is not already registered. It will start background scanning.
            // First get the existing tasks to see if we already registered for it
            if (taskRegistration != null)
            {
                rootPage.NotifyUser("Background watcher already registered.", NotifyType.StatusMessage);
                return;
            }
            else
            {
                // Applications registering for background trigger must request for permission.
                BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();
                // Here, we do not fail the registration even if the access is not granted. Instead, we allow
                // the trigger to be registered and when the access is granted for the Application at a later time,
                // the trigger will automatically start working again.

                // At this point we assume we haven't found any existing tasks matching the one we want to register
                // First, configure the task entry point, trigger and name
                var builder = new BackgroundTaskBuilder();
                builder.TaskEntryPoint = taskEntryPoint;
                builder.SetTrigger(trigger);
                builder.Name = taskName;

                // Now perform the registration. The registration can throw an exception if the current
                // hardware does not support background advertisement offloading
                try
                {
                    taskRegistration = builder.Register();

                    // For this scenario, attach an event handler to display the result processed from the background task
                    taskRegistration.Completed += OnBackgroundTaskCompleted;

                    // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
                    if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
                    {
                        rootPage.NotifyUser("Background watcher registered.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                    }
                }
                catch (Exception ex)
                {
                    switch ((uint)ex.HResult)
                    {
                        case (0x80070032): // ERROR_NOT_SUPPORTED
                            rootPage.NotifyUser("The hardware does not support background advertisement offload.", NotifyType.ErrorMessage);
                            break;
                        default:
                            throw ex;
                    }
                }
            }
        }

void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Stop button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 281 of file Scenario3_BackgroundWatcher.xaml.cs.

        {
            // Unregistering the background task will stop scanning if this is the only client requesting scan
            // First get the existing tasks to see if we already registered for it
            if (taskRegistration != null)
            {
                taskRegistration.Unregister(true);
                taskRegistration = null;
                rootPage.NotifyUser("Background watcher unregistered.", NotifyType.StatusMessage);
            }
            else
            {
                // At this point we assume we haven't found any existing tasks matching the one we want to unregister
                rootPage.NotifyUser("No registered background watcher found.", NotifyType.StatusMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 43 of file Scenario3_BackgroundWatcher.xaml.cs.

string taskEntryPoint = "BackgroundTasks.AdvertisementWatcherTask" [private]

Definition at line 40 of file Scenario3_BackgroundWatcher.xaml.cs.

string taskName = "Scenario3_BackgroundTask" [private]

Definition at line 38 of file Scenario3_BackgroundWatcher.xaml.cs.

IBackgroundTaskRegistration taskRegistration [private]

Definition at line 34 of file Scenario3_BackgroundWatcher.xaml.cs.

BluetoothLEAdvertisementWatcherTrigger trigger [private]

Definition at line 36 of file Scenario3_BackgroundWatcher.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Scenario3_BackgroundWatcher.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_BackgroundPublisher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • BluetoothAdvertisement
  • Scenario4_BackgroundPublisher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_BackgroundPublisher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_BackgroundPublisher ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | App_Resuming (object sender, object e)
void | App_Suspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | OnBackgroundTaskCompleted (BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs eventArgs)
async void | RunButton_Click (object sender, RoutedEventArgs e)
void | StopButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage
string | taskEntryPoint = "BackgroundTasks.AdvertisementPublisherTask"
string | taskName = "Scenario4_BackgroundTask"
IBackgroundTaskRegistration | taskRegistration
BluetoothLEAdvertisementPublisherTrigger | trigger

Detailed Description

Definition at line 32 of file Scenario4_BackgroundPublisher.xaml.cs.

Constructor & Destructor Documentation

Scenario4_BackgroundPublisher ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 50 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            this.InitializeComponent();

            // Create and initialize a new trigger to configure it.
            trigger = new BluetoothLEAdvertisementPublisherTrigger();

            // We need to add some payload to the advertisement. A publisher without any payload
            // or with invalid ones cannot be started. We only need to configure the payload once
            // for any publisher.

            // Add a manufacturer-specific section:
            // First, create a manufacturer data section
            var manufacturerData = new BluetoothLEManufacturerData();

            // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
            manufacturerData.CompanyId = 0xFFFE;

            // Finally set the data payload within the manufacturer-specific section
            // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
            var writer = new DataWriter();
            UInt16 uuidData = 0x1234;
            writer.WriteUInt16(uuidData);

            // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
            manufacturerData.Data = writer.DetachBuffer();

            // Add the manufacturer data to the advertisement publisher:
            trigger.Advertisement.ManufacturerData.Add(manufacturerData);

            // Display the information about the published payload
            PublisherPayloadBlock.Text = string.Format("Published payload information: CompanyId=0x{0}, ManufacturerData=0x{1}",
                manufacturerData.CompanyId.ToString("X"),
                uuidData.ToString("X"));

            // Reset the displayed status of the publisher
            PublisherStatusBlock.Text = "";
        }

Member Function Documentation

void App_Resuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being resumed.

Parameters:
sender The source of the resume request.
e

Definition at line 172 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            // Get the existing task if already registered
            if (taskRegistration == null)
            {
                // Find the task if we previously registered it
                foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
                {
                    if (task.Name == taskName)
                    {
                        taskRegistration = task;
                        taskRegistration.Completed += OnBackgroundTaskCompleted;
                        break;
                    }
                }
            }
            else
            {
                taskRegistration.Completed += OnBackgroundTaskCompleted;
            }
        }

void App_Suspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 157 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            if (taskRegistration != null)
            {
                // Always unregister the handlers to release the resources to prevent leaks.
                taskRegistration.Completed -= OnBackgroundTaskCompleted;
            }
            rootPage.NotifyUser("App suspending.", NotifyType.StatusMessage);
        }

async void OnBackgroundTaskCompleted | ( | BackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 268 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            // We get the status changed processed by the background task
            if (ApplicationData.Current.LocalSettings.Values.Keys.Contains(taskName))
            {
                string backgroundMessage = (string) ApplicationData.Current.LocalSettings.Values[taskName];
                // Serialize UI update to the main UI thread
                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    // Display the status change
                    PublisherStatusBlock.Text = backgroundMessage;
                });
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 96 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Get the existing task if already registered
            if (taskRegistration == null)
            {
                // Find the task if we previously registered it
                foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
                {
                    if (task.Name == taskName)
                    {
                        taskRegistration = task;
                        taskRegistration.Completed += OnBackgroundTaskCompleted;
                        break;
                    }
                }
            }
            else
            {
                taskRegistration.Completed += OnBackgroundTaskCompleted;
            }

            // Attach handlers for suspension to stop the publisher when the App is suspended.
            App.Current.Suspending += App_Suspending;
            App.Current.Resuming += App_Resuming;

            rootPage.NotifyUser("Press Run to register publisher", NotifyType.StatusMessage);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 134 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            // Remove local suspension handlers from the App since this page is no longer active.
            App.Current.Suspending -= App_Suspending;
            App.Current.Resuming -= App_Resuming;

            // Since the publisher is registered in the background, the background task will be triggered when the App is closed
            // or in the background. To unregister the task, press the Stop button.
            if (taskRegistration != null)
            {
                // Always unregister the handlers to release the resources to prevent leaks.
                taskRegistration.Completed -= OnBackgroundTaskCompleted;
            }
            base.OnNavigatingFrom(e);
        }

async void RunButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Run button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 199 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            // Registering a background trigger if it is not already registered. It will start background advertising.
            // First get the existing tasks to see if we already registered for it
            if (taskRegistration != null)
            {
                rootPage.NotifyUser("Background publisher already registered.", NotifyType.StatusMessage);
                return;
            }
            else
            {
                // Applications registering for background trigger must request for permission.
                BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();
                // Here, we do not fail the registration even if the access is not granted. Instead, we allow
                // the trigger to be registered and when the access is granted for the Application at a later time,
                // the trigger will automatically start working again.

                // At this point we assume we haven't found any existing tasks matching the one we want to register
                // First, configure the task entry point, trigger and name
                var builder = new BackgroundTaskBuilder();
                builder.TaskEntryPoint = taskEntryPoint;
                builder.SetTrigger(trigger);
                builder.Name = taskName;

                // Now perform the registration.
                taskRegistration = builder.Register();

                // For this scenario, attach an event handler to display the result processed from the background task
                taskRegistration.Completed += OnBackgroundTaskCompleted;

                // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
                if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
                {
                    rootPage.NotifyUser("Background publisher registered.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                }
            }
        }

void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked as an event handler when the Stop button is pressed.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 246 of file Scenario4_BackgroundPublisher.xaml.cs.

        {
            // Unregistering the background task will stop advertising if this is the only client requesting
            // First get the existing tasks to see if we already registered for it
            if (taskRegistration != null)
            {
                taskRegistration.Unregister(true);
                taskRegistration = null;
                rootPage.NotifyUser("Background publisher unregistered.", NotifyType.StatusMessage);
            }
            else
            {
                // At this point we assume we haven't found any existing tasks matching the one we want to unregister
                rootPage.NotifyUser("No registered background publisher found.", NotifyType.StatusMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 44 of file Scenario4_BackgroundPublisher.xaml.cs.

string taskEntryPoint = "BackgroundTasks.AdvertisementPublisherTask" [private]

Definition at line 41 of file Scenario4_BackgroundPublisher.xaml.cs.

string taskName = "Scenario4_BackgroundTask" [private]

Definition at line 39 of file Scenario4_BackgroundPublisher.xaml.cs.

IBackgroundTaskRegistration taskRegistration [private]

Definition at line 35 of file Scenario4_BackgroundPublisher.xaml.cs.

BluetoothLEAdvertisementPublisherTrigger trigger [private]

Definition at line 37 of file Scenario4_BackgroundPublisher.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothAdvertisement/cs/Scenario4_BackgroundPublisher.xaml.cs
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Camera Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

Camera Class Reference

#include "Camera.h"

List of all members.

Public Member Functions

Camera ()
Camera (Camera const &)
void | Eye (_In_ DirectX::XMFLOAT3 position)
DirectX::XMFLOAT3 | Eye ()
float | FarClipPlane ()
DirectX::XMMATRIX | LeftEyeProjection ()
DirectX::XMFLOAT3 | LookAt ()
void | LookDirection (_In_ DirectX::XMFLOAT3 lookDirection)
float | NearClipPlane ()
void | operator= (Camera const &)
float | Pitch ()
DirectX::XMMATRIX | Projection ()
DirectX::XMMATRIX | RightEyeProjection ()
void | SetProjParams (_In_ float fieldOfView, _In_ float aspectRatio, _In_ float nearPlane, _In_ float farPlane)
void | SetViewParams (_In_ DirectX::XMFLOAT3 eye, _In_ DirectX::XMFLOAT3 lookAt, _In_ DirectX::XMFLOAT3 up)
DirectX::XMFLOAT3 | Up ()
DirectX::XMMATRIX | View ()
DirectX::XMMATRIX | World ()
float | Yaw ()

Private Attributes

float | m_aspectRatio
float | m_cameraPitchAngle
float | m_cameraYawAngle
DirectX::XMFLOAT3 | m_eye
float | m_farPlane
float | m_fieldOfView
DirectX::XMFLOAT4X4 | m_inverseView
DirectX::XMFLOAT3 | m_lookAt
float | m_nearPlane
DirectX::XMFLOAT4X4 | m_projectionMatrix
DirectX::XMFLOAT4X4 | m_projectionMatrixLeft
DirectX::XMFLOAT4X4 | m_projectionMatrixRight
DirectX::XMFLOAT3 | m_up
DirectX::XMFLOAT4X4 | m_viewMatrix

Detailed Description

Definition at line 19 of file Camera.h.

Constructor & Destructor Documentation

Camera ( )

Definition at line 21 of file Camera.cpp.

{
    // Setup the view matrix.
    SetViewParams(
        XMFLOAT3(0.0f, 0.0f, 0.0f),   // Default eye position.
        XMFLOAT3(0.0f, 0.0f, 1.0f),   // Default look at position.
        XMFLOAT3(0.0f, 1.0f, 0.0f)    // Default up vector.
        );

    // Setup the projection matrix.
    SetProjParams(XM_PI / 4, 1.0f, 1.0f, 1000.0f);
}

Camera ( Camera const & )

Member Function Documentation

void Eye ( _In_ DirectX::XMFLOAT3 position )
DirectX::XMFLOAT3 Eye ( )

Definition at line 159 of file Camera.cpp.

{
    return m_eye;
}

float FarClipPlane ( )

Definition at line 174 of file Camera.cpp.

{
    return m_farPlane;
}

DirectX::XMMATRIX LeftEyeProjection ( )

Definition at line 144 of file Camera.cpp.

{
    return XMLoadFloat4x4(&m_projectionMatrixLeft);
}

DirectX::XMFLOAT3 LookAt ( )

Definition at line 164 of file Camera.cpp.

{
    return m_lookAt;
}

void LookDirection ( _In_ DirectX::XMFLOAT3 lookDirection )
float NearClipPlane ( )

Definition at line 169 of file Camera.cpp.

{
    return m_nearPlane;
}

void operator= ( Camera const & )
float Pitch ( )

Definition at line 179 of file Camera.cpp.

{
    return m_cameraPitchAngle;
}

DirectX::XMMATRIX Projection ( )

Definition at line 139 of file Camera.cpp.

{
    return XMLoadFloat4x4(&m_projectionMatrix);
}

DirectX::XMMATRIX RightEyeProjection ( )

Definition at line 149 of file Camera.cpp.

{
    return XMLoadFloat4x4(&m_projectionMatrixRight);
}

void SetProjParams | ( | _In_ float | fieldOfView,
 |  | _In_ float | aspectRatio,
 |  | _In_ float | nearPlane,
 |  | _In_ float | farPlane
 | ) |  |

Definition at line 83 of file Camera.cpp.

{
    // Set attributes for the projection matrix.
    m_fieldOfView = fieldOfView;
    m_aspectRatio = aspectRatio;
    m_nearPlane = nearPlane;
    m_farPlane = farPlane;
    XMStoreFloat4x4(
        &m_projectionMatrix,
        XMMatrixPerspectiveFovLH(
            m_fieldOfView,
            m_aspectRatio,
            m_nearPlane,
            m_farPlane
            )
        );

    STEREO_PARAMETERS* stereoParams = nullptr;
    // Update the projection matrix.
    XMStoreFloat4x4(
        &m_projectionMatrixLeft,
        MatrixStereoProjectionFovLH(
            stereoParams,
            STEREO_CHANNEL::LEFT,
            m_fieldOfView,
            m_aspectRatio,
            m_nearPlane,
            m_farPlane,
            STEREO_MODE::NORMAL
            )
        );

    XMStoreFloat4x4(
        &m_projectionMatrixRight,
        MatrixStereoProjectionFovLH(
            stereoParams,
            STEREO_CHANNEL::RIGHT,
            m_fieldOfView,
            m_aspectRatio,
            m_nearPlane,
            m_farPlane,
            STEREO_MODE::NORMAL
            )
        );
}

void SetViewParams | ( | _In_ DirectX::XMFLOAT3 | eye,
 |  | _In_ DirectX::XMFLOAT3 | lookAt,
 |  | _In_ DirectX::XMFLOAT3 | up
 | ) |  |
DirectX::XMFLOAT3 Up ( )
DirectX::XMMATRIX View ( )

Definition at line 134 of file Camera.cpp.

{
    return XMLoadFloat4x4(&m_viewMatrix);
}

DirectX::XMMATRIX World ( )

Definition at line 154 of file Camera.cpp.

{
    return XMLoadFloat4x4(&m_inverseView);
}

float Yaw ( )

Definition at line 184 of file Camera.cpp.

{
    return m_cameraYawAngle;
}

Member Data Documentation

float m_aspectRatio [private]

Definition at line 60 of file Camera.h.

float m_cameraPitchAngle [private]

Definition at line 57 of file Camera.h.

float m_cameraYawAngle [private]

Definition at line 56 of file Camera.h.

DirectX::XMFLOAT3 m_eye [private]

Definition at line 53 of file Camera.h.

float m_farPlane [private]

Definition at line 62 of file Camera.h.

float m_fieldOfView [private]

Definition at line 59 of file Camera.h.

DirectX::XMFLOAT4X4 m_inverseView [private]

Definition at line 51 of file Camera.h.

DirectX::XMFLOAT3 m_lookAt [private]

Definition at line 54 of file Camera.h.

float m_nearPlane [private]

Definition at line 61 of file Camera.h.

DirectX::XMFLOAT4X4 m_projectionMatrix [private]

Definition at line 47 of file Camera.h.

DirectX::XMFLOAT4X4 m_projectionMatrixLeft [private]

Definition at line 48 of file Camera.h.

DirectX::XMFLOAT4X4 m_projectionMatrixRight [private]

Definition at line 49 of file Camera.h.

DirectX::XMFLOAT3 m_up [private]

Definition at line 55 of file Camera.h.

DirectX::XMFLOAT4X4 m_viewMatrix [private]

Definition at line 46 of file Camera.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Camera.h
  • Simple3DGameDX/cppwinrt/GameContent/Camera.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCaptureContext Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraAdvancedCapture
  • AdvancedCaptureContext
Public Attributes

AdvancedCaptureContext Class Reference

Helper class to contain the information that describes an advanced capture. More...

#include "MainPage.xaml.h"

List of all members.

Public Attributes

internal | __pad0__: Platform::String^ CaptureFileName
Windows::Storage::FileProperties::PhotoOrientation | CaptureOrientation
Windows::Media::Capture::AdvancedCapturedPhoto | Photo

Detailed Description

Definition at line 30 of file MainPage.xaml.h.

Member Data Documentation

internal __pad0__

Definition at line 33 of file MainPage.xaml.h.

Windows::Storage::FileProperties::PhotoOrientation CaptureOrientation

Definition at line 34 of file MainPage.xaml.h.

Windows::Media::Capture::AdvancedCapturedPhoto Photo

Definition at line 35 of file MainPage.xaml.h.

The documentation for this class was generated from the following file:
  • CameraAdvancedCapture/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraAdvancedCapture
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 23 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 39 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 82 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following files:
  • CameraAdvancedCapture/cs/App.xaml.cs
  • CameraAdvancedCapture/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraAdvancedCapture
  • MainPage
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Classes

class | AdvancedCaptureContext
Helper class to contain the information that describes an Advanced Capture. More...

Public Member Functions

MainPage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | AdvancedCapture_AllPhotosCaptured (AdvancedPhotoCapture sender, object args)
async void | AdvancedCapture_OptionalReferencePhotoCaptured (AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
async Task | CleanSceneAnalysisEffectAsync ()
async Task | CleanupCameraAsync ()
async Task | CleanupUiAsync ()
async Task | CreateSceneAnalysisEffectAsync ()
void | CycleAdvancedCaptureMode ()
async Task | DisableAdvancedCaptureAsync ()
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
async Task | EnableAdvancedCaptureAsync ()
SimpleOrientation | GetCameraOrientation ()
async void | HardwareButtons_CameraPressed (object sender, CameraEventArgs e)
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | OrientationSensor_OrientationChanged (SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
async void | PhotoButton_Click (object sender, RoutedEventArgs e)
void | RegisterEventHandlers ()
async void | SceneAnalysisEffect_SceneAnalyzed (SceneAnalysisEffect sender, SceneAnalyzedEventArgs args)
async Task | SetPreviewRotationAsync ()
async Task | SetupUiAsync ()
async Task | StartPreviewAsync ()
async Task | StopPreviewAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
async Task | TakeAdvancedCapturePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateControlOrientation ()
void | UpdateUi ()

Static Private Member Functions

static int | ConvertDeviceOrientationToDegrees (SimpleOrientation orientation)
static int | ConvertDisplayOrientationToDegrees (DisplayOrientations orientation)
static PhotoOrientation | ConvertOrientationToPhotoOrientation (SimpleOrientation orientation)
static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)
static async Task | ReencodeAndSavePhotoAsync (IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation)

Private Attributes

AdvancedPhotoCapture | _advancedCapture
int | _advancedCaptureMode = -1
StorageFolder | _captureFolder = null
SimpleOrientation | _deviceOrientation = SimpleOrientation.NotRotated
readonly DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
DisplayOrientations | _displayOrientation = DisplayOrientations.Portrait
readonly DisplayRequest | _displayRequest = new DisplayRequest()
bool | _externalCamera
bool | _isInitialized
bool | _isPreviewing
MediaCapture | _mediaCapture
bool | _mirroringPreview
readonly SimpleOrientationSensor | _orientationSensor = SimpleOrientationSensor.GetDefault()
SceneAnalysisEffect | _sceneAnalysisEffect
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()
const double | CERTAINTY_CAP = 0.7

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 42 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 95 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Do not cache the state of the UI when suspending/navigating
            NavigationCacheMode = NavigationCacheMode.Disabled;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;

            // Set the maximum on the progress bar
            HdrImpactBar.Maximum = CERTAINTY_CAP;
        }

Member Function Documentation

void AdvancedCapture_AllPhotosCaptured | ( | AdvancedPhotoCapture | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will be raised when all the necessary captures are completed, and at this point the camera is technically ready to capture again while the processing takes place.

Parameters:
sender | The object raising this event.
args | The event data.

Definition at line 270 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("AdvancedCapture_AllPhotosCaptured");
        }

async void AdvancedCapture_OptionalReferencePhotoCaptured | ( | AdvancedPhotoCapture | sender,
 |  | OptionalReferencePhotoCapturedEventArgs | args |
 | ) |  |  | [inline, private]

This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene without processing, also referred to as "EV0".

Parameters:
sender | The object raising this event.
args | The event data.

Definition at line 246 of file MainPage.xaml.cs.

        {
            // Retrieve the context (i.e. the information about the capture this event belongs to)
            var context = args.Context as AdvancedCaptureContext;

            // Add "_Reference" at the end of the filename to create when saving the reference photo
            var referenceName = context.CaptureFileName.Replace(".jpg", "_Reference.jpg");

            // Hold a reference to the frame before the async file creation operation so it's not cleaned up before ReencodeAndSavePhotoAsync
            using (var frame = args.Frame)
            {
                var file = await _captureFolder.CreateFileAsync(referenceName, CreationCollisionOption.GenerateUniqueName);
                Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for " + context.CaptureFileName + ". Saving to " + file.Path);

                await ReencodeAndSavePhotoAsync(frame, file, context.CaptureOrientation);
            }
        }

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 125 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                await SetupUiAsync();

                await InitializeCameraAsync();
            }
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                await CleanupUiAsync();

                deferral.Complete();
            }
        }

task< void > CleanSceneAnalysisEffectAsync ( ) [inline, private]

Disables and removes the scene analysis effect, and unregisters the event handler for the SceneAnalyzed event of the effect.

Returns:

Definition at line 465 of file MainPage.xaml.cs.

        {
            // Disable detection and unsubscribe from the events
            _sceneAnalysisEffect.HighDynamicRangeAnalyzer.Enabled = false;
            _sceneAnalysisEffect.SceneAnalyzed -= SceneAnalysisEffect_SceneAnalyzed;

            // Remove the effect from the pipeline (see ClearEffectsAsync method to remove all effects from a given stream)
            await _mediaCapture.RemoveEffectAsync(_sceneAnalysisEffect);

            Debug.WriteLine("SA effect removed from pipeline");

            // Clear the member variable that held the effect instance
            _sceneAnalysisEffect = null;
        }

Concurrency::task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 594 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("CleanupCameraAsync");

            if (_isInitialized)
            {
                if (_isPreviewing)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                if (_advancedCapture != null)
                {
                    await DisableAdvancedCaptureAsync();
                }

                if (_sceneAnalysisEffect != null)
                {
                    await CleanSceneAnalysisEffectAsync();
                }

                _isInitialized = false;
            }

            if (_mediaCapture != null)
            {
                _mediaCapture.Failed -= MediaCapture_Failed;
                _mediaCapture.Dispose();
                _mediaCapture = null;
            }
        }

task< void > CleanupUiAsync ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Returns:

Definition at line 667 of file MainPage.xaml.cs.

        {
            UnregisterEventHandlers();

            // Show the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
            }

            // Revert orientation preferences
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
        }

int ConvertDeviceOrientationToDegrees ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the device in space
Returns:
An orientation in degrees

Definition at line 838 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return 90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return 180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return 270;
                case SimpleOrientation.NotRotated:
                default:
                    return 0;
            }
        }

int ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) [inline, static, private]

Converts the given orientation of the app on the screen to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the app on the screen
Returns:
An orientation in degrees

Definition at line 859 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case DisplayOrientations.Portrait:
                    return 90;
                case DisplayOrientations.LandscapeFlipped:
                    return 180;
                case DisplayOrientations.PortraitFlipped:
                    return 270;
                case DisplayOrientations.Landscape:
                default:
                    return 0;
            }
        }

FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the metadata that can be added to captured photos.

Parameters:
orientation The orientation of the device in space
Returns:

Definition at line 880 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return PhotoOrientation.Rotate90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return PhotoOrientation.Rotate180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return PhotoOrientation.Rotate270;
                case SimpleOrientation.NotRotated:
                default:
                    return PhotoOrientation.Normal;
            }
        }

task< void > CreateSceneAnalysisEffectAsync ( ) [inline, private]

Adds scene analysis to the video preview stream, registers for its event, enables it, and gets the effect instance.

Returns:

Definition at line 444 of file MainPage.xaml.cs.

        {
            // Create the definition, which will contain some initialization settings
            var definition = new SceneAnalysisEffectDefinition();

            // Add the effect to the video preview stream
            _sceneAnalysisEffect = (SceneAnalysisEffect)await _mediaCapture.AddVideoEffectAsync(definition, MediaStreamType.VideoPreview);

            Debug.WriteLine("SA effect added to pipeline");

            // Subscribe to notifications about scene information
            _sceneAnalysisEffect.SceneAnalyzed += SceneAnalysisEffect_SceneAnalyzed;

            // Enable HDR analysis
            _sceneAnalysisEffect.HighDynamicRangeAnalyzer.Enabled = true;
        }

void CycleAdvancedCaptureMode ( ) [inline, private]

Configures the AdvancedPhotoControl to the next supported mode.

Note that this method can be safely called regardless of whether the AdvancedPhotoCapture is in the "prepared state" or not. Internal changes to the mode will be applied when calling Prepare, or when calling Capture if the mode has been changed since the call to Prepare. This allows for fast changing of desired capture modes, that can more quickly adapt to rapidly changing shooting conditions.

Definition at line 511 of file MainPage.xaml.cs.

        {
            // Calculate the index for the next supported mode
            _advancedCaptureMode = (_advancedCaptureMode + 1) % _mediaCapture.VideoDeviceController.AdvancedPhotoControl.SupportedModes.Count;

            // Configure the settings object to the mode at the calculated index
            var settings = new AdvancedPhotoCaptureSettings
            {
                Mode = _mediaCapture.VideoDeviceController.AdvancedPhotoControl.SupportedModes[_advancedCaptureMode]
            };

            // Configure the mode on the control
            _mediaCapture.VideoDeviceController.AdvancedPhotoControl.Configure(settings);

            // Update the button text to reflect the current mode
            ModeTextBlock.Text = _mediaCapture.VideoDeviceController.AdvancedPhotoControl.Mode.ToString();
        }

Concurrency::task< void > DisableAdvancedCaptureAsync ( ) [inline, private]

Cleans up the instance of the AdvancedCapture.

Returns:

Definition at line 533 of file MainPage.xaml.cs.

        {
            // No work to be done if there is no AdvancedCapture
            if (_advancedCapture == null) return;

            await _advancedCapture.FinishAsync();
            _advancedCapture = null;

            // Reset the Advanced Capture Mode index
            _advancedCaptureMode = -1;

            Debug.WriteLine("Disabled Advanced Capture");
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will be raised when the page is rotated, when the DisplayInformation.AutoRotationPreferences value set in the SetupUiAsync() method cannot be not honored.

Parameters:
sender | The event source.
args | The event data.

Definition at line 210 of file MainPage.xaml.cs.

        {
            _displayOrientation = sender.CurrentOrientation;

            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateControlOrientation());
        }

Concurrency::task< void > EnableAdvancedCaptureAsync ( ) [inline, private]

Creates an instance of the AdvancedPhotoCapture and registers for its events.

Returns:

Definition at line 484 of file MainPage.xaml.cs.

        {
            // No work to be done if there already is an AdvancedCapture instance
            if (_advancedCapture != null) return;

            // Configure one of the modes in the control
            CycleAdvancedCaptureMode();

            // Prepare for an Advanced Capture
            _advancedCapture = await _mediaCapture.PrepareAdvancedPhotoCaptureAsync(ImageEncodingProperties.CreateJpeg());

            Debug.WriteLine("Enabled Advanced Capture");

            // Register for events published by the AdvancedCapture
            _advancedCapture.AllPhotosCaptured += AdvancedCapture_AllPhotosCaptured;
            _advancedCapture.OptionalReferencePhotoCaptured += AdvancedCapture_OptionalReferencePhotoCaptured;
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed.

Parameters:
desiredPanel The desired panel on which the returned device should be mounted, if available
Returns:

Definition at line 741 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

SimpleOrientation GetCameraOrientation ( ) [inline, private]

Calculates the current camera orientation from the device orientation by taking into account whether the camera is external or facing the user.

Returns:
The camera orientation in space, with an inverted rotation in the case the camera is mounted on the device and is facing the user

Definition at line 787 of file MainPage.xaml.cs.

        {
            if (_externalCamera)
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            var result = _deviceOrientation;

            // Account for the fact that, on portrait-first devices, the camera sensor is mounted at a 90 degree offset to the native orientation
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        result = SimpleOrientation.NotRotated;
                        break;
                    case SimpleOrientation.Rotated180DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated90DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated180DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.NotRotated:
                        result = SimpleOrientation.Rotated270DegreesCounterclockwise;
                        break;
                }
            }

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (_mirroringPreview)
            {
                // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        return SimpleOrientation.Rotated270DegreesCounterclockwise;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        return SimpleOrientation.Rotated90DegreesCounterclockwise;
                }
            }

            return result;
        }

async void HardwareButtons_CameraPressed | ( | object | sender,
 |  | CameraEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 280 of file MainPage.xaml.cs.

        {
            await TakeAdvancedCapturePhotoAsync();
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI.

Returns:

Definition at line 303 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            if (_mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when something goes wrong
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }

                // If initialization succeeded, start the preview, kick off scene analysis, and enable Advanced Capture
                if (_isInitialized)
                {
                    // Figure out where the camera is located to account for mirroring and later adjust rotation accordingly
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();

                    // On successful preview, add a Scene Analysis effect to the pipeline and enter Advanced Capture mode
                    if (_isPreviewing)
                    {
                        await CreateSceneAnalysisEffectAsync();

                        await EnableAdvancedCaptureAsync();
                    }

                }

                // Update the controls to reflect the current state of the app
                UpdateUi();
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 285 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateUi());
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 136 of file MainPage.xaml.cs.

        {
            await SetupUiAsync();

            await InitializeCameraAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 143 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completeness, as it will only trigger when navigating between pages and this sample only includes one page

            await CleanupCameraAsync();

            await CleanupUiAsync();
        }

async void OrientationSensor_OrientationChanged | ( | SimpleOrientationSensor | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Occurs each time the simple orientation sensor reports a new sensor reading.

Parameters:
sender | The event source.
args | The event data.

Definition at line 189 of file MainPage.xaml.cs.

        {
            if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
            {
                // Only update the current orientation if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
                // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
                // either up or down, at the desired subject.
                //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
                //      on other panels, this logic should be adjusted.
                _deviceOrientation = args.Orientation;

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateControlOrientation());
            }
        }

async void PhotoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 275 of file MainPage.xaml.cs.

        {
            await TakeAdvancedCapturePhotoAsync();
        }

static async Task ReencodeAndSavePhotoAsync | ( | IRandomAccessStream | stream,
 |  | StorageFile | file,
 |  | PhotoOrientation | photoOrientation |
 | ) |  |  | [inline, static, private]

Applies the given orientation to a photo stream and saves it as a StorageFile.

Parameters:
stream | The photo stream
file | The StorageFile in which the photo stream will be saved
photoOrientation | The orientation metadata to apply to the photo
Returns:

Definition at line 760 of file MainPage.xaml.cs.

        {
            using (var inputStream = stream)
            {
                var decoder = await BitmapDecoder.CreateAsync(inputStream);

                using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
                {
                    var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);

                    var properties = new BitmapPropertySet { { "System.Photo.Orientation", new BitmapTypedValue(photoOrientation, PropertyType.UInt16) } };

                    await encoder.BitmapProperties.SetPropertiesAsync(properties);
                    await encoder.FlushAsync();
                }
            }
        }

void RegisterEventHandlers ( ) [inline, private]

Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation.

Definition at line 694 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
            }

            // If there is an orientation sensor present on the device, register for notifications
            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;

                // Update orientation of buttons with the current orientation
                UpdateControlOrientation();
            }

            // Have the Advanced Capture button call the method that cycles through the modes
            CycleModeButton.Click += (sender, args) => CycleAdvancedCaptureMode();

            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
        }

async void SceneAnalysisEffect_SceneAnalyzed | ( | SceneAnalysisEffect | sender,
 |  | SceneAnalyzedEventArgs | args |
 | ) |  |  | [inline, private]

This event will be raised every time the effect processes a preview frame, to deliver information about the current scene in the camera preview.

Parameters:
sender | The effect raising the event.
args | The event data.

Definition at line 227 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Update the graphical representation of how much detail could be recovered through an HDR capture, ranging
                // from 0 ("everything is within the dynamic range of the camera") to CERTAINTY_CAP ("at this point the app
                // strongly recommends an HDR capture"), where CERTAINTY_CAP can be any number between 0 and 1 that the app chooses.
                HdrImpactBar.Value = Math.Min(CERTAINTY_CAP, args.ResultFrame.HighDynamicRange.Certainty);

                SceneTypeTextBlock.Text = "Scene: " + args.ResultFrame.AnalysisRecommendation;
            });
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview.

Returns:

Definition at line 399 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Calculate which way and how far to rotate the preview
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties[RotationKey] = rotationDegrees;
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

task< void > SetupUiAsync ( ) [inline, private]

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors.

Returns:

Definition at line 638 of file MainPage.xaml.cs.

            {
                // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
                DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

                // Hide the status bar
                if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                {
                    await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
                }

                // Populate orientation variables with the current state
                _displayOrientation = _displayInformation.CurrentOrientation;
                if (_orientationSensor != null)
                {
                    _deviceOrientation = _orientationSensor.GetCurrentOrientation();
                }

                RegisterEventHandlers();

                var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
                // Fall back to the local app storage if the Pictures Library is not available
                _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
            }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on.

Returns:

Definition at line 376 of file MainPage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _isPreviewing = true;

            // Initialize the preview to the current orientation
            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 423 of file MainPage.xaml.cs.

        {
            // Stop the preview
            _isPreviewing = false;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Cleanup the UI
                PreviewControl.Source = null;

                // Allow the device screen to sleep now that the preview is stopped
                _displayRequest.RequestRelease();
            });
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 163 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

task< void > TakeAdvancedCapturePhotoAsync ( ) [inline, private]

Takes an Advanced Capture photo to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 551 of file MainPage.xaml.cs.

        {
            // Lock the UI as a simple way to prevent reentrancy
            PhotoButton.IsEnabled = false;
            CycleModeButton.IsEnabled = false;

            try
            {
                Debug.WriteLine("Taking Advanced Capture photo...");
                // Read the current orientation of the camera and the capture time
                var photoOrientation = ConvertOrientationToPhotoOrientation(GetCameraOrientation());
                var fileName = String.Format("AdvancedCapturePhoto_{0}.jpg", DateTime.Now.ToString("HHmmss"));

                // Create a context object, to identify the capture later on
                var context = new AdvancedCaptureContext {CaptureFileName = fileName, CaptureOrientation = photoOrientation};

                // Start capture, and pass the context object to get it back in the OptionalReferencePhotoCaptured event
                var capture = await _advancedCapture.CaptureAsync(context);

                using (var frame = capture.Frame)
                {
                    var file = await _captureFolder.CreateFileAsync(fileName, CreationCollisionOption.GenerateUniqueName);
                    Debug.WriteLine("Advanced Capture photo taken! Saving to " + file.Path);

                    await ReencodeAndSavePhotoAsync(frame, file, photoOrientation);
                }
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when taking an Advanced Capture photo: " + ex.ToString());
            }
            finally
            {
                // Re-enable the buttons to reflect the current state of the app
                UpdateUi();
            }
        }

void UnregisterEventHandlers ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors.

Definition at line 720 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
            }

            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged -= OrientationSensor_OrientationChanged;
            }

            _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
        }

void UpdateControlOrientation ( ) [inline, private]

Uses the current device orientation in space and page orientation on the screen to calculate the rotation transformation to apply to the controls.

Definition at line 900 of file MainPage.xaml.cs.

        {
            int device = ConvertDeviceOrientationToDegrees(_deviceOrientation);
            int display = ConvertDisplayOrientationToDegrees(_displayOrientation);

            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                device -= 90;
            }

            // Combine both rotations and make sure that 0 <= result < 360
            var angle = (360 + display + device) % 360;

            // Rotate the buttons in the UI to match the rotation of the device
            var transform = new RotateTransform { Angle = angle };

            // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
            PhotoButton.RenderTransform = transform;
            CycleModeButton.RenderTransform = transform;

            // Adjust which way the progress bar fills so it's always from the user's left->right or bottom->top
            HdrImpactBar.FlowDirection = (angle == 180 || angle == 270) ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
        }

void UpdateUi ( ) [inline, private]

This method will enable/disable the buttons depending on the current state of the app.

Definition at line 684 of file MainPage.xaml.cs.

        {
            // The buttons should only be enabled if the preview started sucessfully
            PhotoButton.IsEnabled = _isPreviewing;
            CycleModeButton.IsEnabled = _isPreviewing;
        }

Member Data Documentation

AdvancedPhotoCapture _advancedCapture [private]

Definition at line 79 of file MainPage.xaml.cs.

int _advancedCaptureMode = -1 [private]

Definition at line 69 of file MainPage.xaml.cs.

StorageFolder _captureFolder = null [private]

Definition at line 55 of file MainPage.xaml.cs.

SimpleOrientation _deviceOrientation = SimpleOrientation.NotRotated [private]

Definition at line 47 of file MainPage.xaml.cs.

readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 45 of file MainPage.xaml.cs.

DisplayOrientations _displayOrientation = DisplayOrientations.Portrait [private]

Definition at line 48 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 58 of file MainPage.xaml.cs.

bool _externalCamera [private]

Definition at line 73 of file MainPage.xaml.cs.

bool _isInitialized [private]

Definition at line 65 of file MainPage.xaml.cs.

bool _isPreviewing [private]

Definition at line 66 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 64 of file MainPage.xaml.cs.

bool _mirroringPreview [private]

Definition at line 72 of file MainPage.xaml.cs.

readonly SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault() [private]

Definition at line 46 of file MainPage.xaml.cs.

SceneAnalysisEffect _sceneAnalysisEffect [private]

Definition at line 80 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 61 of file MainPage.xaml.cs.

const double CERTAINTY_CAP = 0.7 [private]

Definition at line 76 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 52 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraAdvancedCapture/cs/MainPage.xaml.cs
  • CameraAdvancedCapture/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage::AdvancedCaptureContext Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraAdvancedCapture
  • MainPage
  • MainPage::AdvancedCaptureContext
Public Attributes

MainPage::AdvancedCaptureContext Class Reference

Helper class to contain the information that describes an Advanced Capture. More...

List of all members.

Public Attributes

string | CaptureFileName
PhotoOrientation | CaptureOrientation

Detailed Description

Definition at line 86 of file MainPage.xaml.cs.

Member Data Documentation

string CaptureFileName

Definition at line 88 of file MainPage.xaml.cs.

PhotoOrientation CaptureOrientation

Definition at line 89 of file MainPage.xaml.cs.

The documentation for this class was generated from the following file:
  • CameraAdvancedCapture/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraAdvancedCapture
  • sealed
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class.

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~MainPage ()
MainPage ()

Public Attributes

Windows::Graphics::Imaging::BitmapEncoder | Encoder
Windows::Storage::StorageFile | File
Windows::Storage::FileProperties::PhotoOrientation | Orientation

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | AdvancedCapture_AllPhotosCaptured (Windows::Media::Capture::AdvancedPhotoCapture^sender, Object^args)
void | AdvancedCapture_OptionalReferencePhotoCaptured (Windows::Media::Capture::AdvancedPhotoCapture^sender, Windows::Media::Capture::OptionalReferencePhotoCapturedEventArgs^args)
void | Application_Resuming (Object^sender, Object^args)
void | Application_Suspending (Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
Concurrency::task< void > | CleanSceneAnalysisEffectAsync ()
Concurrency::task< void > | CleanupCameraAsync ()
Concurrency::task< void > | CleanupUiAsync ()
int | ConvertDeviceOrientationToDegrees (Windows::Devices::Sensors::SimpleOrientation orientation)
int | ConvertDisplayOrientationToDegrees (Windows::Graphics::Display::DisplayOrientations orientation)
Windows::Storage::FileProperties::PhotoOrientation | ConvertOrientationToPhotoOrientation (Windows::Devices::Sensors::SimpleOrientation orientation)
Concurrency::task< void > | CreateSceneAnalysisEffectAsync ()
void | CycleAdvancedCaptureMode ()
void | CycleModeButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | DisableAdvancedCaptureAsync ()
void | DisplayInformation_OrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Object^args)
Concurrency::task< void > | EmptyTask ()
Concurrency::task< void > | EnableAdvancedCaptureAsync ()
Concurrency::task
< Windows::Devices::Enumeration::DeviceInformation^> 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel panel)
Windows::Devices::Sensors::SimpleOrientation | GetCameraOrientation ()
void | HardwareButtons_CameraPress (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
Concurrency::task< void > | InitializeCameraAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | OrientationSensor_OrientationChanged (Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^)
void | PhotoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | ReencodeAndSavePhotoAsync (Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation)
void | RegisterEventHandlers ()
void | SceneAnalysisEffect_SceneAnalyzed (Windows::Media::Core::SceneAnalysisEffect^sender, Windows::Media::Core::SceneAnalyzedEventArgs^args)
Concurrency::task< void > | SetPreviewRotationAsync ()
Concurrency::task< void > | SetupUiAsync ()
Concurrency::task< void > | StartPreviewAsync ()
Concurrency::task< void > | StopPreviewAsync ()
void | SystemMediaControls_PropertyChanged (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args)
Concurrency::task< void > | TakeAdvancedCapturePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateControlOrientation ()
void | UpdateUi ()
void | WriteException (Platform::Exception^ex)
void | WriteLine (Platform::String^str)

Static Private Member Functions

static Platform::String | GetTimeStr ()
static bool | StringReplace (std::wstring &string, const std::wstring &removalStr, const std::wstring &replacementStr)

Private Attributes

Windows::Media::Capture::AdvancedPhotoCapture | _advancedCapture
int | _advancedCaptureMode = -1
Windows::Foundation::EventRegistrationToken | _allPhotosCapturedEventToken
Windows::Foundation::EventRegistrationToken | _applicationResumingEventToken
Windows::Foundation::EventRegistrationToken | _applicationSuspendingEventToken
Windows::Storage::StorageFolder | _captureFolder
Windows::Devices::Sensors::SimpleOrientation | _deviceOrientation
Windows::Graphics::Display::DisplayInformation | _displayInformation
Windows::Foundation::EventRegistrationToken | _displayInformationEventToken
Windows::Graphics::Display::DisplayOrientations | _displayOrientation
Windows::System::Display::DisplayRequest | _displayRequest
bool | _externalCamera
Windows::Foundation::EventRegistrationToken | _hardwareCameraButtonEventToken
bool | _isInitialized
bool | _isPreviewing
Platform::Agile
< Windows::Media::Capture::MediaCapture^> 		_mediaCapture
Windows::Foundation::EventRegistrationToken | _mediaCaptureFailedEventToken
Windows::Foundation::EventRegistrationToken | _mediaControlPropChangedEventToken
bool | _mirroringPreview
Windows::Foundation::EventRegistrationToken | _optionalRefPhotoCapturedEventToken
Windows::Foundation::EventRegistrationToken | _orientationChangedEventToken
Windows::Devices::Sensors::SimpleOrientationSensor | _orientationSensor
Windows::Media::Core::SceneAnalysisEffect | _sceneAnalysisEffect
Windows::Foundation::EventRegistrationToken | _sceneAnalyzedEventToken
Windows::Media::SystemMediaTransportControls | _systemMediaControls
const double | CERTAINTY_CAP = 0.7
const GUID | RotationKey

Detailed Description

Definition at line 21 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~MainPage ( ) [virtual]

Member Function Documentation

void AdvancedCapture_AllPhotosCaptured | ( | Windows::Media::Capture::AdvancedPhotoCapture^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void AdvancedCapture_OptionalReferencePhotoCaptured | ( | Windows::Media::Capture::AdvancedPhotoCapture^ | sender,
 |  | Windows::Media::Capture::OptionalReferencePhotoCapturedEventArgs^ | args |
 | ) |  |  | [private]
void Application_Resuming | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void Application_Suspending | ( | Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> CleanSceneAnalysisEffectAsync ( ) [private]
Concurrency::task<void> CleanupCameraAsync ( ) [private]
Concurrency::task<void> CleanupUiAsync ( ) [private]
int ConvertDeviceOrientationToDegrees ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
int ConvertDisplayOrientationToDegrees ( Windows::Graphics::Display::DisplayOrientations orientation ) [private]
Windows::Storage::FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
Concurrency::task<void> CreateSceneAnalysisEffectAsync ( ) [private]
void CycleAdvancedCaptureMode ( ) [private]
void CycleModeButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> DisableAdvancedCaptureAsync ( ) [private]
void DisplayInformation_OrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
Concurrency::task<void> EmptyTask ( ) [private]
Concurrency::task<void> EnableAdvancedCaptureAsync ( ) [private]
Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel panel ) [private]
Windows::Devices::Sensors::SimpleOrientation GetCameraOrientation ( ) [private]
static Platform::String GetTimeStr ( ) [static, private]
void HardwareButtons_CameraPress | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
Concurrency::task<void> InitializeCameraAsync ( ) [private]
MainPage ( )
void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture^ | currentCaptureObject,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs^ | errorEventArgs |
 | ) |  |  | [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OrientationSensor_OrientationChanged | ( | Windows::Devices::Sensors::SimpleOrientationSensor^ | ,
 |  | Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^ |  |
 | ) |  |  | [private]
void PhotoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> ReencodeAndSavePhotoAsync | ( | Windows::Storage::Streams::IRandomAccessStream^ | stream,
 |  | Windows::Storage::StorageFile^ | file,
 |  | Windows::Storage::FileProperties::PhotoOrientation | photoOrientation |
 | ) |  |  | [private]
void RegisterEventHandlers ( ) [private]
void SceneAnalysisEffect_SceneAnalyzed | ( | Windows::Media::Core::SceneAnalysisEffect^ | sender,
 |  | Windows::Media::Core::SceneAnalyzedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<void> SetPreviewRotationAsync ( ) [private]
Concurrency::task<void> SetupUiAsync ( ) [private]
Concurrency::task<void> StartPreviewAsync ( ) [private]
Concurrency::task<void> StopPreviewAsync ( ) [private]
static bool StringReplace | ( | std::wstring & | string,
 |  | const std::wstring & | removalStr,
 |  | const std::wstring & | replacementStr |
 | ) |  |  | [static, private]
void SystemMediaControls_PropertyChanged | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<void> TakeAdvancedCapturePhotoAsync ( ) [private]
void UnregisterEventHandlers ( ) [private]
void UpdateControlOrientation ( ) [private]
void UpdateUi ( ) [private]
void WriteException ( Platform::Exception^ ex ) [private]
void WriteLine ( Platform::String^ str ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::Media::Capture::AdvancedPhotoCapture _advancedCapture [private]

Definition at line 76 of file MainPage.xaml.h.

int _advancedCaptureMode = -1 [private]

Definition at line 66 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _allPhotosCapturedEventToken [private]

Definition at line 88 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationResumingEventToken [private]

Definition at line 81 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken [private]

Definition at line 80 of file MainPage.xaml.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 52 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientation _deviceOrientation [private]

Definition at line 44 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayInformation _displayInformation [private]

Definition at line 43 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _displayInformationEventToken [private]

Definition at line 83 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayOrientations _displayOrientation [private]

Definition at line 45 of file MainPage.xaml.h.

Windows::System::Display::DisplayRequest _displayRequest [private]

Definition at line 55 of file MainPage.xaml.h.

bool _externalCamera [private]

Definition at line 69 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken [private]

Definition at line 86 of file MainPage.xaml.h.

bool _isInitialized [private]

Definition at line 62 of file MainPage.xaml.h.

bool _isPreviewing [private]

Definition at line 63 of file MainPage.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 61 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 84 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken [private]

Definition at line 82 of file MainPage.xaml.h.

bool _mirroringPreview [private]

Definition at line 70 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _optionalRefPhotoCapturedEventToken [private]

Definition at line 89 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _orientationChangedEventToken [private]

Definition at line 85 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientationSensor _orientationSensor [private]

Definition at line 42 of file MainPage.xaml.h.

Windows::Media::Core::SceneAnalysisEffect _sceneAnalysisEffect [private]

Definition at line 77 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _sceneAnalyzedEventToken [private]

Definition at line 87 of file MainPage.xaml.h.

Windows::Media::SystemMediaTransportControls _systemMediaControls [private]

Definition at line 58 of file MainPage.xaml.h.

const double CERTAINTY_CAP = 0.7 [private]

Definition at line 73 of file MainPage.xaml.h.

Windows::Graphics::Imaging::BitmapEncoder Encoder

Definition at line 22 of file MainPage.xaml.h.

Windows::Storage::StorageFile File

Definition at line 23 of file MainPage.xaml.h.

Windows::Storage::FileProperties::PhotoOrientation Orientation

Definition at line 24 of file MainPage.xaml.h.

const GUID RotationKey [private]

Definition at line 49 of file MainPage.xaml.h.

The documentation for this class was generated from the following files:
  • CameraAdvancedCapture/cpp/App.xaml.h
  • CameraAdvancedCapture/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraGetPreviewFrame
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 23 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 39 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 82 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following files:
  • CameraGetPreviewFrame/cs/App.xaml.cs
  • CameraGetPreviewFrame/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IMemoryBufferByteAccess Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraGetPreviewFrame
  • IMemoryBufferByteAccess
Public Member Functions

IMemoryBufferByteAccess Interface Reference

List of all members.

Public Member Functions

void GetBuffer (out byte *buffer, out uint capacity)

Detailed Description

Definition at line 39 of file MainPage.xaml.cs.

Member Function Documentation

void GetBuffer | ( | out byte * | buffer,
 |  | out uint | capacity
 | ) |  |
The documentation for this interface was generated from the following file:
  • CameraGetPreviewFrame/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraGetPreviewFrame
  • MainPage
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Public Member Functions

MainPage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
unsafe void | ApplyGreenFilter (SoftwareBitmap bitmap)
async Task | CleanupCameraAsync ()
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
async Task | GetPreviewFrameAsD3DSurfaceAsync ()
async Task | GetPreviewFrameAsSoftwareBitmapAsync ()
async void | GetPreviewFrameButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async Task | SetPreviewRotationAsync ()
async Task | StartPreviewAsync ()
async Task | StopPreviewAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)

Static Private Member Functions

static int | ConvertDisplayOrientationToDegrees (DisplayOrientations orientation)
static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)
static async Task | SaveSoftwareBitmapAsync (SoftwareBitmap bitmap, StorageFile file)

Private Attributes

StorageFolder | _captureFolder = null
readonly DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
DisplayOrientations | _displayOrientation = DisplayOrientations.Portrait
readonly DisplayRequest | _displayRequest = new DisplayRequest()
bool | _externalCamera = false
bool | _isInitialized = false
bool | _isPreviewing = false
MediaCapture | _mediaCapture
bool | _mirroringPreview = false
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()

Static Private Attributes

static readonly SemaphoreSlim | _mediaCaptureLifeLock = new SemaphoreSlim(1)
static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 44 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 75 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Cache the UI to have the checkboxes retain their state, as the enabled/disabled state of the
            // GetPreviewFrameButton is reset in code when suspending/navigating (see Start/StopPreviewAsync)
            NavigationCacheMode = NavigationCacheMode.Required;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;
        }

Member Function Documentation

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 103 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                // Populate orientation variables with the current state and register for future changes
                _displayOrientation = _displayInformation.CurrentOrientation;
                _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;

                await InitializeCameraAsync();
            }
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;

                deferral.Complete();
            }
        }

unsafe void ApplyGreenFilter ( SoftwareBitmap bitmap ) [inline, private]

Applies a basic effect to a Bgra8 SoftwareBitmap in-place.

Parameters:
bitmap SoftwareBitmap that will receive the effect

Definition at line 548 of file MainPage.xaml.cs.

        {
            // Effect is hard-coded to operate on BGRA8 format only
            if (bitmap.BitmapPixelFormat == BitmapPixelFormat.Bgra8)
            {
                // In BGRA8 format, each pixel is defined by 4 bytes
                const int BYTES_PER_PIXEL = 4;

                using (var buffer = bitmap.LockBuffer(BitmapBufferAccessMode.ReadWrite))
                using (var reference = buffer.CreateReference())
                {
                    if (reference is IMemoryBufferByteAccess)
                    {
                        // Get a pointer to the pixel buffer
                        byte* data;
                        uint capacity;
                        ((IMemoryBufferByteAccess)reference).GetBuffer(out data, out capacity);

                        // Get information about the BitmapBuffer
                        var desc = buffer.GetPlaneDescription(0);

                        // Iterate over all pixels
                        for (uint row = 0; row < desc.Height; row++)
                        {
                            for (uint col = 0; col < desc.Width; col++)
                            {
                                // Index of the current pixel in the buffer (defined by the next 4 bytes, BGRA8)
                                var currPixel = desc.StartIndex + desc.Stride * row + BYTES_PER_PIXEL * col;

                                // Read the current pixel information into b,g,r channels (leave out alpha channel)
                                var b = data[currPixel + 0]; // Blue
                                var g = data[currPixel + 1]; // Green
                                var r = data[currPixel + 2]; // Red

                                // Boost the green channel, leave the other two untouched
                                data[currPixel + 0] = b;
                                data[currPixel + 1] = (byte)Math.Min(g + 80, 255);
                                data[currPixel + 2] = r;
                            }
                        }
                    }
                }
            }
        }

task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 450 of file MainPage.xaml.cs.

        {
            await _mediaCaptureLifeLock.WaitAsync();

            try
            {
                if (_isInitialized)
                {
                    if (_isPreviewing)
                    {
                        // The call to stop the preview is included here for completeness, but can be
                        // safely removed if a call to MediaCapture.Dispose() is being made later,
                        // as the preview will be automatically stopped at that point
                        await StopPreviewAsync();
                    }

                    _isInitialized = false;
                }

                if (_mediaCapture != null)
                {
                    _mediaCapture.Failed -= MediaCapture_Failed;
                    _mediaCapture.Dispose();
                    _mediaCapture = null;
                }
            }
            finally
            {
                _mediaCaptureLifeLock.Release();
            }
        }

int ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) [inline, static, private]

Converts the given orientation of the app on the screen to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the app on the screen
Returns:
An orientation in degrees

Definition at line 510 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case DisplayOrientations.Portrait:
                    return 90;
                case DisplayOrientations.LandscapeFlipped:
                    return 180;
                case DisplayOrientations.PortraitFlipped:
                    return 270;
                case DisplayOrientations.Landscape:
                default:
                    return 0;
            }
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will fire when the page is rotated.

Parameters:
sender | The event source.
args | The event data.

Definition at line 171 of file MainPage.xaml.cs.

        {
            _displayOrientation = sender.CurrentOrientation;

            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Queries the available video capture devices to try and find one mounted on the desired panel.

Parameters:
desiredPanel The panel on the device that the desired camera is mounted on
Returns:
A DeviceInformation instance with a reference to the camera mounted on the desired panel if available, any other camera if not, or null if no camera is available.

Definition at line 493 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

task< void > GetPreviewFrameAsD3DSurfaceAsync ( ) [inline, private]

Gets the current preview frame as a Direct3DSurface and displays its properties in a TextBlock.

Returns:

Definition at line 417 of file MainPage.xaml.cs.

        {
            // Capture the preview frame as a D3D surface
            using (var currentFrame = await _mediaCapture.GetPreviewFrameAsync())
            {
                // Check that the Direct3DSurface isn't null. It's possible that the device does not support getting the frame
                // as a D3D surface
                if (currentFrame.Direct3DSurface != null)
                {
                    // Collect the resulting frame
                    var surface = currentFrame.Direct3DSurface;

                    // Show the frame information
                    FrameInfoTextBlock.Text = String.Format("{0}x{1} {2}", surface.Description.Width, surface.Description.Height, surface.Description.Format);
                }
                else // Fall back to software bitmap
                {
                    // Collect the resulting frame
                    SoftwareBitmap previewFrame = currentFrame.SoftwareBitmap;

                    // Show the frame information
                    FrameInfoTextBlock.Text = String.Format("{0}x{1} {2}", previewFrame.PixelWidth, previewFrame.PixelHeight, previewFrame.BitmapPixelFormat);
                }

                // Clear the image
                PreviewFrameImage.Source = null;
            }
        }

task< void > GetPreviewFrameAsSoftwareBitmapAsync ( ) [inline, private]

Gets the current preview frame as a SoftwareBitmap, displays its properties in a TextBlock, and can optionally display the image in the UI and/or save it to disk as a jpg.

Returns:

Definition at line 367 of file MainPage.xaml.cs.

        {
            // Get information about the preview
            var previewProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;

            // Create the video frame to request a SoftwareBitmap preview frame
            var videoFrame = new VideoFrame(BitmapPixelFormat.Bgra8, (int)previewProperties.Width, (int)previewProperties.Height);

            // Capture the preview frame
            using (var currentFrame = await _mediaCapture.GetPreviewFrameAsync(videoFrame))
            {
                // Collect the resulting frame
                SoftwareBitmap previewFrame = currentFrame.SoftwareBitmap;

                // Show the frame information
                FrameInfoTextBlock.Text = String.Format("{0}x{1} {2}", previewFrame.PixelWidth, previewFrame.PixelHeight, previewFrame.BitmapPixelFormat);

                // Add a simple green filter effect to the SoftwareBitmap
                if (GreenEffectCheckBox.IsChecked == true)
                {
                    ApplyGreenFilter(previewFrame);
                }

                // Show the frame (as is, no rotation is being applied)
                if (ShowFrameCheckBox.IsChecked == true)
                {
                    // Create a SoftwareBitmapSource to display the SoftwareBitmap to the user
                    var sbSource = new SoftwareBitmapSource();
                    await sbSource.SetBitmapAsync(previewFrame);

                    // Display it in the Image control
                    PreviewFrameImage.Source = sbSource;
                }

                // Save the frame (as is, no rotation is being applied)
                if (SaveFrameCheckBox.IsChecked == true)
                {
                    var file = await _captureFolder.CreateFileAsync("PreviewFrame.jpg", CreationCollisionOption.GenerateUniqueName);

                    Debug.WriteLine("Saving preview frame to " + file.Path);

                    await SaveSoftwareBitmapAsync(previewFrame, file);
                }
            }
        }

async void GetPreviewFrameButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 181 of file MainPage.xaml.cs.

        {
            // If preview is not running, no preview frames can be acquired
            if (!_isPreviewing) return;

            if ((ShowFrameCheckBox.IsChecked == true) || (SaveFrameCheckBox.IsChecked == true))
            {
                await GetPreviewFrameAsSoftwareBitmapAsync();
            }
            else
            {
                await GetPreviewFrameAsD3DSurfaceAsync();
            }
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.

Returns:

Definition at line 214 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            await _mediaCaptureLifeLock.WaitAsync();

            if (_mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    _mediaCaptureLifeLock.Release();
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when something goes wrong
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }
                finally
                {
                    _mediaCaptureLifeLock.Release();
                }

                // If initialization succeeded, start the preview
                if (_isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();

                    var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
                    // Fall back to the local app storage if the Pictures Library is not available
                    _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
                }
            }
            else
            {
                _mediaCaptureLifeLock.Release();
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 196 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => GetPreviewFrameButton.IsEnabled = _isPreviewing);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 116 of file MainPage.xaml.cs.

        {
            // Populate orientation variables with the current state and register for future changes
            _displayOrientation = _displayInformation.CurrentOrientation;
            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;

            await InitializeCameraAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 125 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completenes, as it will only fire when navigating between pages and this sample only includes one page

            await CleanupCameraAsync();

            _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
        }

static async Task SaveSoftwareBitmapAsync | ( | SoftwareBitmap | bitmap,
 |  | StorageFile | file |
 | ) |  |  | [inline, static, private]

Saves a SoftwareBitmap to the specified StorageFile.

Parameters:
bitmap | SoftwareBitmap to save
file | Target StorageFile to save to
Returns:

Definition at line 532 of file MainPage.xaml.cs.

        {
            using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
            {
                var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, outputStream);

                // Grab the data from the SoftwareBitmap
                encoder.SetSoftwareBitmap(bitmap);
                await encoder.FlushAsync();
            }
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.

Definition at line 321 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Calculate which way and how far to rotate the preview
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, rotationDegrees);
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.

Returns:

Definition at line 290 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("StartPreviewAsync");

            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Register to listen for media property changes
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _isPreviewing = true;

            // Initialize the preview to the current orientation
            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }

            // Enable / disable the button depending on the preview state
            GetPreviewFrameButton.IsEnabled = _isPreviewing;
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI.

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 345 of file MainPage.xaml.cs.

        {
            _isPreviewing = false;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PreviewControl.Source = null;

                // Allow the device to sleep now that the preview is stopped
                _displayRequest.RequestRelease();

                GetPreviewFrameButton.IsEnabled = _isPreviewing;
            });
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 145 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 55 of file MainPage.xaml.cs.

readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 47 of file MainPage.xaml.cs.

DisplayOrientations _displayOrientation = DisplayOrientations.Portrait [private]

Definition at line 48 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 58 of file MainPage.xaml.cs.

bool _externalCamera = false [private]

Definition at line 71 of file MainPage.xaml.cs.

bool _isInitialized = false [private]

Definition at line 65 of file MainPage.xaml.cs.

bool _isPreviewing = false [private]

Definition at line 66 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 64 of file MainPage.xaml.cs.

readonly SemaphoreSlim _mediaCaptureLifeLock = new SemaphoreSlim(1) [static, private]

Definition at line 67 of file MainPage.xaml.cs.

bool _mirroringPreview = false [private]

Definition at line 70 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 61 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 52 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraGetPreviewFrame/cs/MainPage.xaml.cs
  • CameraGetPreviewFrame/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraGetPreviewFrame
  • sealed
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class.

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~MainPage ()
MainPage ()

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | Application_Resuming (Object^sender, Object^args)
void | Application_Suspending (Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | ApplyGreenFilter (Windows::Graphics::Imaging::SoftwareBitmap^bitmap)
Concurrency::task< void > | CleanupCameraAsync ()
int | ConvertDisplayOrientationToDegrees (Windows::Graphics::Display::DisplayOrientations orientation)
void | DisplayInformation_OrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Object^args)
Concurrency::task
< Windows::Devices::Enumeration::DeviceInformation^> 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel panel)
Concurrency::task< void > | GetPreviewFrameAsD3DSurfaceAsync ()
Concurrency::task< void > | GetPreviewFrameAsSoftwareBitmapAsync ()
void | GetPreviewFrameButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | InitializeCameraAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
Concurrency::task< void > | SaveSoftwareBitmapAsync (Windows::Graphics::Imaging::SoftwareBitmap^bitmap)
Concurrency::task< void > | SetPreviewRotationAsync ()
Concurrency::task< void > | StartPreviewAsync ()
Concurrency::task< void > | StopPreviewAsync ()
void | SystemMediaControls_PropertyChanged (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args)
void | WriteException (Platform::Exception^ex)
void | WriteLine (Platform::String^str)

Private Attributes

Windows::Foundation::EventRegistrationToken | _applicationResumingEventToken
Windows::Foundation::EventRegistrationToken | _applicationSuspendingEventToken
Windows::Storage::StorageFolder | _captureFolder
Windows::Graphics::Display::DisplayInformation | _displayInformation
Windows::Foundation::EventRegistrationToken | _displayInformationEventToken
Windows::Graphics::Display::DisplayOrientations | _displayOrientation
Windows::System::Display::DisplayRequest | _displayRequest
bool | _externalCamera
bool | _isInitialized
bool | _isPreviewing
Platform::Agile
< Windows::Media::Capture::MediaCapture^> 		_mediaCapture
Windows::Foundation::EventRegistrationToken | _mediaCaptureFailedEventToken
Windows::Foundation::EventRegistrationToken | _mediaControlPropChangedEventToken
bool | _mirroringPreview
Windows::Media::SystemMediaTransportControls | _systemMediaControls
const GUID | RotationKey

Detailed Description

Definition at line 21 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~MainPage ( ) [virtual]

Member Function Documentation

void Application_Resuming | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void Application_Suspending | ( | Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void ApplyGreenFilter ( Windows::Graphics::Imaging::SoftwareBitmap^ bitmap ) [private]
Concurrency::task<void> CleanupCameraAsync ( ) [private]
int ConvertDisplayOrientationToDegrees ( Windows::Graphics::Display::DisplayOrientations orientation ) [private]
void DisplayInformation_OrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel panel ) [private]
Concurrency::task<void> GetPreviewFrameAsD3DSurfaceAsync ( ) [private]
Concurrency::task<void> GetPreviewFrameAsSoftwareBitmapAsync ( ) [private]
void GetPreviewFrameButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> InitializeCameraAsync ( ) [private]
MainPage ( )
void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture^ | currentCaptureObject,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs^ | errorEventArgs |
 | ) |  |  | [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> SaveSoftwareBitmapAsync ( Windows::Graphics::Imaging::SoftwareBitmap^ bitmap ) [private]
Concurrency::task<void> SetPreviewRotationAsync ( ) [private]
Concurrency::task<void> StartPreviewAsync ( ) [private]
Concurrency::task<void> StopPreviewAsync ( ) [private]
void SystemMediaControls_PropertyChanged | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ | args |
 | ) |  |  | [private]
void WriteException ( Platform::Exception^ ex ) [private]
void WriteLine ( Platform::String^ str ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationResumingEventToken [private]

Definition at line 49 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken [private]

Definition at line 48 of file MainPage.xaml.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 45 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayInformation _displayInformation [private]

Definition at line 22 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _displayInformationEventToken [private]

Definition at line 52 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayOrientations _displayOrientation [private]

Definition at line 23 of file MainPage.xaml.h.

Windows::System::Display::DisplayRequest _displayRequest [private]

Definition at line 26 of file MainPage.xaml.h.

bool _externalCamera [private]

Definition at line 37 of file MainPage.xaml.h.

bool _isInitialized [private]

Definition at line 33 of file MainPage.xaml.h.

bool _isPreviewing [private]

Definition at line 34 of file MainPage.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 32 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 51 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken [private]

Definition at line 50 of file MainPage.xaml.h.

bool _mirroringPreview [private]

Definition at line 38 of file MainPage.xaml.h.

Windows::Media::SystemMediaTransportControls _systemMediaControls [private]

Definition at line 29 of file MainPage.xaml.h.

const GUID RotationKey [private]

Definition at line 42 of file MainPage.xaml.h.

The documentation for this class was generated from the following files:
  • CameraGetPreviewFrame/cpp/App.xaml.h
  • CameraGetPreviewFrame/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraManualControls
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 34 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 40 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 50 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 91 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following file:
  • CameraManualControls/cs/App.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InvertBoolConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraManualControls
  • InvertBoolConverter
Public Member Functions

InvertBoolConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 973 of file MainPage.xaml.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 975 of file MainPage.xaml.cs.

        {
            return !(bool)value;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 980 of file MainPage.xaml.cs.

        {
            return !(bool)value;
        }

The documentation for this class was generated from the following file:
  • CameraManualControls/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraManualControls
  • MainPage
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Public Member Functions

MainPage ()
async Task | TapToFocus (Point position, Size size)

Static Public Member Functions

static Rect | GetPreviewStreamRectInControl (VideoEncodingProperties previewResolution, CaptureElement previewControl, DisplayOrientations displayOrientation)

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
async void | CafFocusRadioButton_Checked (object sender, RoutedEventArgs e)
async Task | CleanupCameraAsync ()
async Task | CleanupUiAsync ()
Rect | ConvertUiTapToPreviewRect (Point tap, Size size, Rect previewRect)
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
async void | EvSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
void | FlashAutoRadioButton_Checked (object sender, RoutedEventArgs e)
void | FlashOffRadioButton_Checked (object sender, RoutedEventArgs e)
void | FlashOnRadioButton_Checked (object sender, RoutedEventArgs e)
async Task
< MediaCaptureFocusState > 		FocusCamera (RegionOfInterest region)
void | FocusLightCheckBox_CheckedChanged (object sender, RoutedEventArgs e)
async void | FocusSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
SimpleOrientation | GetCameraOrientation ()
async void | HardwareButtons_CameraPressed (object sender, CameraEventArgs e)
async Task | InitializeCameraAsync ()
async void | IsoAutoCheckBox_CheckedChanged (object sender, RoutedEventArgs e)
async void | IsoSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
void | ManualControlButton_Click (object sender, RoutedEventArgs e)
async void | ManualFocusRadioButton_Checked (object sender, RoutedEventArgs e)
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | MediaCapture_RecordLimitationExceeded (MediaCapture sender)
async void | OrientationSensor_OrientationChanged (SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
async void | PhotoButton_Click (object sender, RoutedEventArgs e)
void | PreviewControl_ManipulationDelta (object sender, ManipulationDeltaRoutedEventArgs e)
async void | PreviewControl_Tapped (object sender, TappedRoutedEventArgs e)
void | RedEyeFlashCheckBox_CheckedChanged (object sender, RoutedEventArgs e)
void | RegisterEventHandlers ()
async Task | SetPreviewRotationAsync ()
void | SetSingleControl (object activeButton)
async Task | SetupUiAsync ()
void | SetZoomLevel (float level)
async void | ShutterCheckBox_CheckedChanged (object sender, RoutedEventArgs e)
async void | ShutterSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
async Task | StartPreviewAsync ()
async Task | StartRecordingAsync ()
async Task | StopPreviewAsync ()
async Task | StopRecordingAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
void | SystemNavigationManager_BackRequested (object sender, BackRequestedEventArgs e)
async Task | TakePhotoAsync ()
async void | TapFocusRadioButton_Checked (object sender, RoutedEventArgs e)
async Task | TapUnfocus ()
void | TorchCheckBox_CheckedChanged (object sender, RoutedEventArgs e)
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
void | UpdateEvControlCapabilities ()
void | UpdateExposureControlCapabilities ()
void | UpdateFlashControlCapabilities ()
void | UpdateFocusControlCapabilities ()
void | UpdateIsoControlCapabilities ()
void | UpdateManualControlCapabilities ()
void | UpdateWbControlCapabilities ()
void | UpdateZoomControlCapabilities ()
async void | VideoButton_Click (object sender, RoutedEventArgs e)
async void | WbComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | WbSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
void | ZoomSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)

Static Private Member Functions

static int | ConvertDeviceOrientationToDegrees (SimpleOrientation orientation)
static int | ConvertDisplayOrientationToDegrees (DisplayOrientations orientation)
static PhotoOrientation | ConvertOrientationToPhotoOrientation (SimpleOrientation orientation)
static string | EvStepCountToString (int steps, float stepSize)
static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)
static async Task | ReencodeAndSavePhotoAsync (IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation)

Private Attributes

StorageFolder | _captureFolder = null
SimpleOrientation | _deviceOrientation = SimpleOrientation.NotRotated
readonly DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
DisplayOrientations | _displayOrientation = DisplayOrientations.Portrait
readonly DisplayRequest | _displayRequest = new DisplayRequest()
bool | _externalCamera
bool | _isFocused
bool | _isInitialized
bool | _isPreviewing
bool | _isRecording
MediaCapture | _mediaCapture
bool | _mirroringPreview
readonly SimpleOrientationSensor | _orientationSensor = SimpleOrientationSensor.GetDefault()
bool | _settingUpUi
bool | _singleControlMode
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()
readonly SystemNavigationManager | _systemNavigationManager = SystemNavigationManager.GetForCurrentView()

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 23 of file MainPage.ExposureValue.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 88 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Do not cache the state of the UI when navigating
            NavigationCacheMode = NavigationCacheMode.Disabled;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;
        }

Member Function Documentation

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 115 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                await SetupUiAsync();

                await InitializeCameraAsync();
            }
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 100 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                await CleanupUiAsync();

                deferral.Complete();
            }
        }

async void CafFocusRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file MainPage.Focus.xaml.cs.

        {
            // Reset tap-to-focus status
            _isFocused = false;
            FocusRectangle.Visibility = Visibility.Collapsed;

            var focusControl = _mediaCapture.VideoDeviceController.FocusControl;

            await focusControl.UnlockAsync();

            var settings = new FocusSettings { Mode = FocusMode.Continuous, AutoFocusRange = AutoFocusRange.FullRange };
            focusControl.Configure(settings);
            await focusControl.FocusAsync();
        }

async Task CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 514 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("CleanupCameraAsync");

            if (_isInitialized)
            {
                // If a recording is in progress during cleanup, stop it to save the recording
                if (_isRecording)
                {
                    await StopRecordingAsync();
                }

                if (_isPreviewing)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                _isInitialized = false;
            }

            if (_mediaCapture != null)
            {
                _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed -= MediaCapture_Failed;
                _mediaCapture.Dispose();
                _mediaCapture = null;
            }
        }

async Task CleanupUiAsync ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Returns:

Definition at line 581 of file MainPage.xaml.cs.

        {
            UnregisterEventHandlers();

            // Show the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
            }
        }

static int ConvertDeviceOrientationToDegrees ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the device in space
Returns:
An orientation in degrees

Definition at line 829 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return 90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return 180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return 270;
                case SimpleOrientation.NotRotated:
                default:
                    return 0;
            }
        }

static int ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) [inline, static, private]

Converts the given orientation of the app on the screen to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the app on the screen
Returns:
An orientation in degrees

Definition at line 850 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case DisplayOrientations.Portrait:
                    return 90;
                case DisplayOrientations.LandscapeFlipped:
                    return 180;
                case DisplayOrientations.PortraitFlipped:
                    return 270;
                case DisplayOrientations.Landscape:
                default:
                    return 0;
            }
        }

static PhotoOrientation ConvertOrientationToPhotoOrientation ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the metadata that can be added to captured photos.

Parameters:
orientation The orientation of the device in space
Returns:

Definition at line 871 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return PhotoOrientation.Rotate90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return PhotoOrientation.Rotate180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return PhotoOrientation.Rotate270;
                case SimpleOrientation.NotRotated:
                default:
                    return PhotoOrientation.Normal;
            }
        }

Rect ConvertUiTapToPreviewRect | ( | Point | tap,
 |  | Size | size,
 |  | Rect | previewRect |
 | ) |  |  | [inline, private]

Applies the necessary rotation to a tap on a CaptureElement (with Stretch mode set to Uniform) to account for device orientation.

Parameters:
tap | The location, in UI coordinates, of the user tap
size | The size, in UI coordinates, of the desired focus rectangle
previewRect | The area within the CaptureElement that is actively showing the preview, and is not part of the letterboxed area
Returns:
A Rect that can be passed to the MediaCapture Focus and RegionsOfInterest APIs, with normalized bounds in the orientation of the native stream

Definition at line 230 of file MainPage.Focus.xaml.cs.

        {
            // Adjust for the resulting focus rectangle to be centered around the position
            double left = tap.X - size.Width / 2, top = tap.Y - size.Height / 2;

            // Get the information about the active preview area within the CaptureElement (in case it's letterboxed)
            double previewWidth = previewRect.Width, previewHeight = previewRect.Height;
            double previewLeft = previewRect.Left, previewTop = previewRect.Top;

            // Transform the left and top of the tap to account for rotation
            switch (_displayOrientation)
            {
                case DisplayOrientations.Portrait:
                    var tempLeft = left;

                    left = top;
                    top = previewRect.Width - tempLeft;
                    break;
                case DisplayOrientations.LandscapeFlipped:
                    left = previewRect.Width - left;
                    top = previewRect.Height - top;
                    break;
                case DisplayOrientations.PortraitFlipped:
                    var tempTop = top;

                    top = left;
                    left = previewRect.Width - tempTop;
                    break;
            }

            // For portrait orientations, the information about the active preview area needs to be rotated
            if (_displayOrientation == DisplayOrientations.Portrait || _displayOrientation == DisplayOrientations.PortraitFlipped)
            {
                previewWidth = previewRect.Height;
                previewHeight = previewRect.Width;
                previewLeft = previewRect.Top;
                previewTop = previewRect.Left;
            }

            // Normalize width and height of the focus rectangle
            var width = size.Width / previewWidth;
            var height = size.Height / previewHeight;

            // Shift rect left and top to be relative to just the active preview area
            left -= previewLeft;
            top -= previewTop;

            // Normalize left and top
            left /= previewWidth;
            top /= previewHeight;

            // Ensure rectangle is fully contained within the active preview area horizontally
            left = Math.Max(left, 0);
            left = Math.Min(1 - width, left);

            // Ensure rectangle is fully contained within the active preview area vertically
            top = Math.Max(top, 0);
            top = Math.Min(1 - height, top);

            // Create and return resulting rectangle
            return new Rect(left, top, width, height);
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will fire when the page is rotated.

Parameters:
sender | The event source.
args | The event data.

Definition at line 199 of file MainPage.xaml.cs.

        {
            _displayOrientation = sender.CurrentOrientation;

            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
        }

async void EvSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file MainPage.ExposureValue.xaml.cs.

        {
            if (_settingUpUi) return;

            float stepSize = _mediaCapture.VideoDeviceController.ExposureCompensationControl.Step;

            var value = (sender as Slider).Value;
            await _mediaCapture.VideoDeviceController.ExposureCompensationControl.SetValueAsync((float)value * stepSize);

            EvTextBlock.Text = EvStepCountToString((int)Math.Round(value), stepSize);
        }

static string EvStepCountToString | ( | int | steps,
 |  | float | stepSize |
 | ) |  |  | [inline, static, private]

Converts the number of steps into a (mixed) fraction based on the step size, when the value used is steps * stepSize.

Parameters:
steps | Number of steps
stepSize | The size of one step
Returns:

Definition at line 70 of file MainPage.ExposureValue.xaml.cs.

        {
            if (stepSize <= 0) throw new ArgumentOutOfRangeException(nameof(stepSize), "Parameter must be a positive value");

            int stepsPerUnit = (int)Math.Round(1 / stepSize);
            if (steps == 0) return "0";

            string sign = steps < 0 ? "-" : "+";
            int whole = (int)Math.Abs(steps * stepSize);
            int remainder = (stepsPerUnit >= 1) ? Math.Abs(steps) % stepsPerUnit : 0;

            if (remainder == 0) return sign + whole.ToString();

            string fraction = remainder.ToString() + "/" + stepsPerUnit.ToString();

            if (whole == 0) return sign + fraction;
            return sign + whole.ToString() + " " + fraction;
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed.

Parameters:
desiredPanel The desired panel on which the returned device should be mounted, if available
Returns:

Definition at line 679 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

void FlashAutoRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file MainPage.Flash.xaml.cs.

        {
            _mediaCapture.VideoDeviceController.FlashControl.Enabled = true;
            _mediaCapture.VideoDeviceController.FlashControl.Auto = true;
        }

void FlashOffRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file MainPage.Flash.xaml.cs.

        {
            _mediaCapture.VideoDeviceController.FlashControl.Enabled = false;
        }

void FlashOnRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file MainPage.Flash.xaml.cs.

        {
            // Note that the FlashControl only applies to photos. To turn on the light for video recording, use the _mediaCapture.VideoDeviceController.TorchControl

            _mediaCapture.VideoDeviceController.FlashControl.Enabled = true;
            _mediaCapture.VideoDeviceController.FlashControl.Auto = false;
        }

async Task<MediaCaptureFocusState> FocusCamera ( RegionOfInterest region ) [inline, private]

Sets camera to focus on the passed in region of interest.

Parameters:
region The region to focus on, or null to focus on the default region
Returns:

Definition at line 195 of file MainPage.Focus.xaml.cs.

        {
            var roiControl = _mediaCapture.VideoDeviceController.RegionsOfInterestControl;
            var focusControl = _mediaCapture.VideoDeviceController.FocusControl;

            if (region != null)
            {
                // If the call provided a region, then set it
                await roiControl.SetRegionsAsync(new[] { region }, true);

                var focusRange = focusControl.SupportedFocusRanges.Contains(AutoFocusRange.FullRange) ? AutoFocusRange.FullRange : focusControl.SupportedFocusRanges.FirstOrDefault();
                var focusMode = focusControl.SupportedFocusModes.Contains(FocusMode.Single) ? FocusMode.Single : focusControl.SupportedFocusModes.FirstOrDefault();

                var settings = new FocusSettings { Mode = focusMode, AutoFocusRange = focusRange };

                focusControl.Configure(settings);
            }
            else
            {
                // If no region provided, clear any regions and reset focus
                await roiControl.ClearRegionsAsync();
            }

            await focusControl.FocusAsync();

            return focusControl.FocusState;
        }

void FocusLightCheckBox_CheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file MainPage.Focus.xaml.cs.

        {
            var flashControl = _mediaCapture.VideoDeviceController.FlashControl;

            flashControl.AssistantLightEnabled = (FocusLightCheckBox.IsChecked == true);
        }

async void FocusSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file MainPage.Focus.xaml.cs.

        {
            if (_settingUpUi) return;

            var value = (sender as Slider).Value;

            await _mediaCapture.VideoDeviceController.FocusControl.SetValueAsync((uint)value);
        }

SimpleOrientation GetCameraOrientation ( ) [inline, private]

Calculates the current camera orientation from the device orientation by taking into account whether the camera is external or facing the user.

Returns:
The camera orientation in space, with an inverted rotation in the case the camera is mounted on the device and is facing the user

Definition at line 778 of file MainPage.xaml.cs.

        {
            if (_externalCamera)
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            var result = _deviceOrientation;

            // Account for the fact that, on portrait-first devices, the camera sensor is mounted at a 90 degree offset to the native orientation
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        result = SimpleOrientation.NotRotated;
                        break;
                    case SimpleOrientation.Rotated180DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated90DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated180DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.NotRotated:
                        result = SimpleOrientation.Rotated270DegreesCounterclockwise;
                        break;
                }
            }

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (_mirroringPreview)
            {
                // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        return SimpleOrientation.Rotated270DegreesCounterclockwise;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        return SimpleOrientation.Rotated90DegreesCounterclockwise;
                }
            }

            return result;
        }

static Rect GetPreviewStreamRectInControl | ( | VideoEncodingProperties | previewResolution,
 |  | CaptureElement | previewControl,
 |  | DisplayOrientations | displayOrientation |
 | ) |  |  | [inline, static]

Calculates the size and location of the rectangle that contains the preview stream within the preview control, when the scaling mode is Uniform.

Parameters:
previewResolution | The resolution at which the preview is running
previewControl | The control that is displaying the preview using Uniform as the scaling mode
displayOrientation | The orientation of the display, to account for device rotation and changing of the CaptureElement display ratio compared to the camera stream
Returns:

Definition at line 723 of file MainPage.xaml.cs.

        {
            var result = new Rect();

            // In case this function is called before everything is initialized correctly, return an empty result
            if (previewControl == null || previewControl.ActualHeight < 1 || previewControl.ActualWidth < 1 ||
                previewResolution == null || previewResolution.Height == 0 || previewResolution.Width == 0)
            {
                return result;
            }

            var streamWidth = previewResolution.Width;
            var streamHeight = previewResolution.Height;

            // For portrait orientations, the width and height need to be swapped
            if (displayOrientation == DisplayOrientations.Portrait || displayOrientation == DisplayOrientations.PortraitFlipped)
            {
                streamWidth = previewResolution.Height;
                streamHeight = previewResolution.Width;
            }

            // Start by assuming the preview display area in the control spans the entire width and height both (this is corrected in the next if for the necessary dimension)
            result.Width = previewControl.ActualWidth;
            result.Height = previewControl.ActualHeight;

            // If UI is "wider" than preview, letterboxing will be on the sides
            if ((previewControl.ActualWidth / previewControl.ActualHeight > streamWidth / (double)streamHeight))
            {
                var scale = previewControl.ActualHeight / streamHeight;
                var scaledWidth = streamWidth * scale;

                result.X = (previewControl.ActualWidth - scaledWidth) / 2.0;
                result.Width = scaledWidth;
            }
            else // Preview stream is "wider" than UI, so letterboxing will be on the top+bottom
            {
                var scale = previewControl.ActualWidth / streamWidth;
                var scaledHeight = streamHeight * scale;

                result.Y = (previewControl.ActualHeight - scaledHeight) / 2.0;
                result.Height = scaledHeight;
            }

            return result;
        }

async void HardwareButtons_CameraPressed | ( | object | sender,
 |  | CameraEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 231 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

async Task InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI.

Returns:

Definition at line 296 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            if (_mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when video recording has reached the maximum time and when something goes wrong
                _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }

                // If initialization succeeded, start the preview
                if (_isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();

                    UpdateCaptureControls();
                    UpdateManualControlCapabilities();
                }
            }
        }

async void IsoAutoCheckBox_CheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file MainPage.IsoSpeed.xaml.cs.

        {
            var autoIso = (sender as CheckBox).IsChecked == true;

            if (autoIso)
            {
                await _mediaCapture.VideoDeviceController.IsoSpeedControl.SetAutoAsync();
            }
            else
            {
                await _mediaCapture.VideoDeviceController.IsoSpeedControl.SetValueAsync((uint)IsoSlider.Value);
            }
        }

async void IsoSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file MainPage.IsoSpeed.xaml.cs.

        {
            if (_settingUpUi) return;

            var value = (sender as Slider).Value;

            await _mediaCapture.VideoDeviceController.IsoSpeedControl.SetValueAsync((uint)value);
        }

void ManualControlButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 942 of file MainPage.xaml.cs.

        {
            // Toggle single control mode
            SetSingleControl(_singleControlMode ? null : sender);
        }

async void ManualFocusRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file MainPage.Focus.xaml.cs.

        {
            // The below check is necessary because this event triggers during initialization of the page, before the MediaCapture is up
            if (!_isPreviewing) return;

            // Reset tap-to-focus status
            _isFocused = false;
            FocusRectangle.Visibility = Visibility.Collapsed;

            // Lock focus in case Continuous Autofocus was active when switching to Manual
            var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
            await focusControl.LockAsync();
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 278 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

async void MediaCapture_RecordLimitationExceeded ( MediaCapture sender ) [inline, private]

Definition at line 269 of file MainPage.xaml.cs.

        {
            // This is a notification that recording has to stop, and the app is expected to finalize the recording

            await StopRecordingAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 126 of file MainPage.xaml.cs.

        {
            await SetupUiAsync();

            await InitializeCameraAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 133 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completenes, as it will only fire when navigating between pages and this sample only includes one page

            await CleanupCameraAsync();

            await CleanupUiAsync();
        }

async void OrientationSensor_OrientationChanged | ( | SimpleOrientationSensor | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Occurs each time the simple orientation sensor reports a new sensor reading.

Parameters:
sender | The event source.
args | The event data.

Definition at line 179 of file MainPage.xaml.cs.

        {
            if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
            {
                // Only update the current orientation if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
                // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
                // either up or down, at the desired subject.
                //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
                //      on other panels, this logic should be adjusted.
                _deviceOrientation = args.Orientation;

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
            }
        }

async void PhotoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 211 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

void PreviewControl_ManipulationDelta | ( | object | sender,
 |  | ManipulationDeltaRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 257 of file MainPage.xaml.cs.

        {
            // This event handler implements pinch-to-zoom, which should only happen if preview is running
            if (!_isPreviewing) return;

            // Pinch gestures are a delta, so apply them to the current zoom value
            var zoomFactor = ZoomSlider.Value * e.Delta.Scale;

            // Set the value back on the slider, which will make the call to the ZoomControl
            ZoomSlider.Value = zoomFactor;
        }

async void PreviewControl_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 236 of file MainPage.xaml.cs.

        {
            if (!_isPreviewing || (TapFocusRadioButton.IsChecked != true)) return;

            if (!_isFocused && _mediaCapture.VideoDeviceController.FocusControl.FocusState != MediaCaptureFocusState.Searching)
            {
                var smallEdge = Math.Min(Window.Current.Bounds.Width, Window.Current.Bounds.Height);

                // Choose to make the focus rectangle 1/4th the length of the shortest edge of the window
                var size = new Size(smallEdge / 4, smallEdge / 4);
                var position = e.GetPosition(sender as UIElement);

                // Note that at this point, a rect at "position" with size "size" could extend beyond the preview area. The following method will reposition the rect if that is the case
                await TapToFocus(position, size);
            }
            else
            {
                await TapUnfocus();
            }
        }

void RedEyeFlashCheckBox_CheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file MainPage.Flash.xaml.cs.

        {
            _mediaCapture.VideoDeviceController.FlashControl.RedEyeReduction = (RedEyeFlashCheckBox.IsChecked == true);
        }

static async Task ReencodeAndSavePhotoAsync | ( | IRandomAccessStream | stream,
 |  | StorageFile | file,
 |  | PhotoOrientation | photoOrientation |
 | ) |  |  | [inline, static, private]

Applies the given orientation to a photo stream and saves it as a StorageFile.

Parameters:
stream | The photo stream
file | The StorageFile in which the photo stream will be saved
photoOrientation | The orientation metadata to apply to the photo
Returns:

Definition at line 698 of file MainPage.xaml.cs.

        {
            using (var inputStream = stream)
            {
                var decoder = await BitmapDecoder.CreateAsync(inputStream);

                using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
                {
                    var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);

                    var properties = new BitmapPropertySet { { "System.Photo.Orientation", new BitmapTypedValue(photoOrientation, PropertyType.UInt16) } };

                    await encoder.BitmapProperties.SetPropertiesAsync(properties);
                    await encoder.FlushAsync();
                }
            }
        }

void RegisterEventHandlers ( ) [inline, private]

Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation.

Definition at line 621 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
            }

            // If there is an orientation sensor present on the device, register for notifications
            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;

                // Update orientation of buttons with the current orientation
                UpdateButtonOrientation();
            }

            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
            _systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested;
        }

async Task SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.

Definition at line 384 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Calculate which way and how far to rotate the preview
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, rotationDegrees);
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

void SetSingleControl ( object activeButton ) [inline, private]

Definition at line 918 of file MainPage.xaml.cs.

        {
            _singleControlMode = (activeButton != null);

            // If in single control mode, hide all manual control buttons (except for the active button).
            // if not in single control mode, then show all the buttons which are supported.
            foreach (var button in ScenarioControlStackPanel.Children.OfType<Button>())
            {
                if (button != activeButton)
                {
                    // The Tag property of each button stores whether that button is supported.
                    // The value is set in the Update___ControlCapabilities method of each control.
                    button.Visibility = _singleControlMode ? Visibility.Collapsed : (Visibility)button.Tag;
                }
            }

            // Show the container control for manual configuration only when in single control mode
            ManualControlsGrid.Visibility = _singleControlMode ? Visibility.Visible : Visibility.Collapsed;

            // Show the Back button only when in single control mode
            _systemNavigationManager.AppViewBackButtonVisibility = _singleControlMode ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;

        }

async Task SetupUiAsync ( ) [inline, private]

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors.

Returns:

Definition at line 555 of file MainPage.xaml.cs.

        {
            // Hide the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
            }

            // Populate orientation variables with the current state
            _displayOrientation = _displayInformation.CurrentOrientation;
            if (_orientationSensor != null)
            {
                _deviceOrientation = _orientationSensor.GetCurrentOrientation();
            }

            RegisterEventHandlers();

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

void SetZoomLevel ( float level ) [inline, private]

Definition at line 59 of file MainPage.Zoom.xaml.cs.

        {
            var zoomControl = _mediaCapture.VideoDeviceController.ZoomControl;

            // Make sure zoomFactor is within the valid range
            level = Math.Max(Math.Min(level, zoomControl.Max), zoomControl.Min);

            // Make sure zoomFactor is a multiple of Step, snap to the next lower step
            level -= (level % zoomControl.Step);

            var settings = new ZoomSettings { Value = level };

            if (zoomControl.SupportedModes.Contains(ZoomTransitionMode.Smooth))
            {
                // Favor smooth zoom for this sample
                settings.Mode = ZoomTransitionMode.Smooth;
            }
            else
            {
                settings.Mode = zoomControl.SupportedModes.First();
            }

            zoomControl.Configure(settings);
        }

async void ShutterCheckBox_CheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file MainPage.Shutter.xaml.cs.

        {
            var autoShutter = ((sender as CheckBox).IsChecked == true);

            await _mediaCapture.VideoDeviceController.ExposureControl.SetAutoAsync(autoShutter);
        }

async void ShutterSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file MainPage.Shutter.xaml.cs.

        {
            if (_settingUpUi) return;

            var value = TimeSpan.FromTicks((long)(sender as Slider).Value);

            ShutterTextBlock.Text = value.TotalMilliseconds + " ms";

            await _mediaCapture.VideoDeviceController.ExposureControl.SetValueAsync(value);
        }

async Task StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on.

Returns:

Definition at line 361 of file MainPage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // The Canvas containing the FocusRectangle should be mirrored if the CaptureElement is, so taps are shown in the correct position
            FocusCanvas.FlowDirection = PreviewControl.FlowDirection;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _isPreviewing = true;

            // Initialize the preview to the current orientation
            await SetPreviewRotationAsync();
        }

async Task StartRecordingAsync ( ) [inline, private]

Records an MP4 video to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 469 of file MainPage.xaml.cs.

        {
            try
            {
                // Create storage file for the capture
                var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);

                var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

                // Calculate rotation angle, taking mirroring into account if necessary
                var rotationAngle = 360 - ConvertDeviceOrientationToDegrees(GetCameraOrientation());
                encodingProfile.Video.Properties.Add(RotationKey, PropertyValue.CreateInt32(rotationAngle));

                Debug.WriteLine("Starting recording to " + videoFile.Path);

                await _mediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);
                _isRecording = true;

                Debug.WriteLine("Started recording!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
            }
        }

async Task StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 408 of file MainPage.xaml.cs.

        {
            // Stop the preview
            _isPreviewing = false;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Cleanup the UI
                PreviewControl.Source = null;

                // Allow the device screen to sleep now that the preview is stopped
                _displayRequest.RequestRelease();
            });
        }

async Task StopRecordingAsync ( ) [inline, private]

Stops recording a video.

Returns:

Definition at line 500 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("Stopping recording...");

            _isRecording = false;
            await _mediaCapture.StopRecordAsync();

            Debug.WriteLine("Stopped recording!");
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 153 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

void SystemNavigationManager_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 642 of file MainPage.xaml.cs.

        {
            if (_singleControlMode)
            {
                // Exit single control mode
                SetSingleControl(null);

                e.Handled = true;
            }
        }

async Task TakePhotoAsync ( ) [inline, private]

Takes a photo to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 429 of file MainPage.xaml.cs.

        {
            // While taking a photo, keep the video button enabled only if the camera supports simultaneously taking pictures and recording video
            VideoButton.IsEnabled = _mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported;

            // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
            VideoButton.Opacity = VideoButton.IsEnabled ? 1 : 0;

            var stream = new InMemoryRandomAccessStream();

            Debug.WriteLine("Taking photo...");
            await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);

            try
            {
                var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);

                Debug.WriteLine("Photo taken! Saving to " + file.Path);

                var photoOrientation = ConvertOrientationToPhotoOrientation(GetCameraOrientation());

                await ReencodeAndSavePhotoAsync(stream, file, photoOrientation);

                Debug.WriteLine("Photo saved!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when taking a photo: " + ex.ToString());
            }

            // Done taking a photo, so re-enable the button
            VideoButton.IsEnabled = true;
            VideoButton.Opacity = 1;
        }

async void TapFocusRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 116 of file MainPage.Focus.xaml.cs.

        {
            // Lock focus in case Continuous Autofocus was active when switching to Tap-to-focus
            var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
            await focusControl.LockAsync();

            // Wait for user tap, which will be handled in PreviewControl_Tapped
        }

async Task TapToFocus | ( | Point | position,
 |  | Size | size |
 | ) |  |  | [inline]

Focus the camera on the given rectangle of the preview, defined by the position and size parameters, in UI coordinates within the CaptureElement.

Parameters:
position | The position of the tap, to become the center of the focus rectangle
size | the size of the rectangle around the tap
Returns:

Definition at line 131 of file MainPage.Focus.xaml.cs.

        {
            // Transition to the "focused" state
            _isFocused = true;

            var previewEncodingProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
            var previewRect = GetPreviewStreamRectInControl(previewEncodingProperties, PreviewControl, _displayOrientation);

            // Build UI rect that will highlight the tapped area
            FocusRectangle.Width = size.Width;
            FocusRectangle.Height = size.Height;

            // Adjust for the rect to be centered around the tap position
            var left = position.X - FocusRectangle.Width / 2;
            var top = position.Y - FocusRectangle.Height / 2;

            // Move it so it's contained within the preview stream in the UI and doesn't reach into letterboxing area or outside of window bounds

            // The left and right edges should not be outside the active preview area within the CaptureElement
            left = Math.Max(previewRect.Left, left);
            left = Math.Min(previewRect.Width - FocusRectangle.Width + previewRect.Left, left);

            // The top and bottom edges should not be outside the active preview area within the CaptureElement
            top = Math.Max(previewRect.Top, top);
            top = Math.Min(previewRect.Height - FocusRectangle.Height + previewRect.Top, top);

            // Apply the adjusted position to the FocusRectangle
            Canvas.SetLeft(FocusRectangle, left);
            Canvas.SetTop(FocusRectangle, top);

            FocusRectangle.Stroke = new SolidColorBrush(Colors.White);
            FocusRectangle.Visibility = Visibility.Visible;

            // FocusRectangle exists in UI coordinates, need to convert to preview coordinates and adjust for rotation if necessary
            var focusPreview = ConvertUiTapToPreviewRect(position, size, previewRect);

            // Note that this Region Of Interest could be configured to also calculate exposure and white balance within the region
            var regionOfInterest = new RegionOfInterest
            {
                AutoFocusEnabled = true,
                BoundsNormalized = true,
                Bounds = focusPreview,
                Type = RegionOfInterestType.Unknown,
                Weight = 100,
            };

            var result = await FocusCamera(regionOfInterest);

            // Update the UI based on the result of the focusing operation
            FocusRectangle.Stroke = (result == MediaCaptureFocusState.Focused ? new SolidColorBrush(Colors.Lime) : new SolidColorBrush(Colors.Red));
        }

async Task TapUnfocus ( ) [inline, private]

Definition at line 183 of file MainPage.Focus.xaml.cs.

        {
            _isFocused = false;
            FocusRectangle.Visibility = Visibility.Collapsed;
            await FocusCamera(null);
        }

void TorchCheckBox_CheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file MainPage.Flash.xaml.cs.

        {
            _mediaCapture.VideoDeviceController.TorchControl.Enabled = (TorchCheckBox.IsChecked == true);
        }

void UnregisterEventHandlers ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors.

Definition at line 657 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
            }

            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged -= OrientationSensor_OrientationChanged;
            }

            _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
            _systemNavigationManager.BackRequested -= SystemNavigationManager_BackRequested;
        }

void UpdateButtonOrientation ( ) [inline, private]

Uses the current device orientation in space and page orientation on the screen to calculate the rotation transformation to apply to the controls.

Definition at line 891 of file MainPage.xaml.cs.

        {
            int device = ConvertDeviceOrientationToDegrees(_deviceOrientation);
            int display = ConvertDisplayOrientationToDegrees(_displayOrientation);

            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                device -= 90;
            }

            // Combine both rotations and make sure that 0 <= result < 360
            var angle = (360 + display + device) % 360;

            // Rotate the buttons in the UI to match the rotation of the device
            var transform = new RotateTransform { Angle = angle };

            // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
            PhotoButton.RenderTransform = transform;
            VideoButton.RenderTransform = transform;
        }

void UpdateCaptureControls ( ) [inline, private]

This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device.

Definition at line 595 of file MainPage.xaml.cs.

        {
            // The buttons should only be enabled if the preview started sucessfully
            PhotoButton.IsEnabled = _isPreviewing;
            VideoButton.IsEnabled = _isPreviewing;

            // Depending on the preview, hide or show the controls grid which houses the individual control buttons and settings
            CameraControlsGrid.Visibility = _isPreviewing ? Visibility.Visible : Visibility.Collapsed;

            // Update recording button to show "Stop" icon instead of red "Record" icon
            StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
            StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;

            // If the camera doesn't support simultaneosly taking pictures and recording video, disable the photo button on record
            if (_isInitialized && !_mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported)
            {
                PhotoButton.IsEnabled = !_isRecording;

                // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
                PhotoButton.Opacity = PhotoButton.IsEnabled ? 1 : 0;
            }
        }

void UpdateEvControlCapabilities ( ) [inline, private]

Definition at line 26 of file MainPage.ExposureValue.xaml.cs.

        {
            var exposureCompensationControl = _mediaCapture.VideoDeviceController.ExposureCompensationControl;

            if (exposureCompensationControl.Supported)
            {
                EvButton.Tag = Visibility.Visible;

                var value = exposureCompensationControl.Value;

                // The slider will track the number of steps
                var stepSize = exposureCompensationControl.Step;
                EvSlider.Minimum = exposureCompensationControl.Min / stepSize;
                EvSlider.Maximum = exposureCompensationControl.Max / stepSize;
                EvSlider.StepFrequency = 1;
                EvSlider.Value = value / stepSize;

                EvTextBlock.Text = EvStepCountToString((int)Math.Round(value), stepSize);
            }
            else
            {
                EvButton.Visibility = Visibility.Collapsed;
                EvButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateExposureControlCapabilities ( ) [inline, private]

Definition at line 25 of file MainPage.Shutter.xaml.cs.

        {
            var exposureControl = _mediaCapture.VideoDeviceController.ExposureControl;

            if (exposureControl.Supported)
            {
                ShutterButton.Tag = Visibility.Visible;

                ShutterAutoCheckBox.IsChecked = exposureControl.Auto;

                // Unhook the event handler, so that changing properties on the slider won't trigger an API call
                ShutterSlider.ValueChanged -= ShutterSlider_ValueChanged;

                ShutterSlider.Minimum = exposureControl.Min.Ticks;
                ShutterSlider.Maximum = exposureControl.Max.Ticks;
                ShutterSlider.StepFrequency = exposureControl.Step.Ticks;

                var value = exposureControl.Value;
                ShutterTextBlock.Text = value.TotalMilliseconds + " ms";
                ShutterSlider.Value = value.Ticks;

                ShutterSlider.ValueChanged += ShutterSlider_ValueChanged;
            }
            else
            {
                ShutterButton.Visibility = Visibility.Collapsed;
                ShutterButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateFlashControlCapabilities ( ) [inline, private]

Definition at line 26 of file MainPage.Flash.xaml.cs.

        {
            var flashControl = _mediaCapture.VideoDeviceController.FlashControl;

            if (flashControl.Supported)
            {
                FlashButton.Tag = Visibility.Visible;

                FlashAutoRadioButton.IsChecked = true;

                if (flashControl.RedEyeReductionSupported)
                {
                    RedEyeFlashCheckBox.Visibility = Visibility.Visible;
                }

                // Video light is not strictly part of flash, but users might expect to find it there
                if (_mediaCapture.VideoDeviceController.TorchControl.Supported)
                {
                    TorchCheckBox.Visibility = Visibility.Visible;
                }
            }
            else
            {
                FlashButton.Visibility = Visibility.Collapsed;
                FlashButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateFocusControlCapabilities ( ) [inline, private]

Definition at line 33 of file MainPage.Focus.xaml.cs.

        {
            var focusControl = _mediaCapture.VideoDeviceController.FocusControl;

            if (focusControl.Supported)
            {
                FocusButton.Tag = Visibility.Visible;

                // Unhook the event handler, so that changing properties on the slider won't trigger an API call
                FocusSlider.ValueChanged -= FocusSlider_ValueChanged;

                var value = focusControl.Value;
                FocusSlider.Minimum = focusControl.Min;
                FocusSlider.Maximum = focusControl.Max;
                FocusSlider.StepFrequency = focusControl.Step;
                FocusSlider.Value = value;

                FocusSlider.ValueChanged += FocusSlider_ValueChanged;

                CafFocusRadioButton.Visibility = focusControl.SupportedFocusModes.Contains(FocusMode.Continuous) ? Visibility.Visible : Visibility.Collapsed;

                // Tap to focus requires support for RegionsOfInterest
                TapFocusRadioButton.Visibility = (_mediaCapture.VideoDeviceController.RegionsOfInterestControl.AutoFocusSupported &&
                                                  _mediaCapture.VideoDeviceController.RegionsOfInterestControl.MaxRegions > 0) ? Visibility.Visible : Visibility.Collapsed;

                // Show the focus assist light only if the device supports it. Note that it exists under the FlashControl (not the FocusControl), so check for support there first
                FocusLightCheckBox.Visibility = (_mediaCapture.VideoDeviceController.FlashControl.Supported &&
                                                 _mediaCapture.VideoDeviceController.FlashControl.AssistantLightSupported) ? Visibility.Visible : Visibility.Collapsed;

                ManualFocusRadioButton.IsChecked = true;
            }
            else
            {
                FocusButton.Visibility = Visibility.Collapsed;
                FocusButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateIsoControlCapabilities ( ) [inline, private]

Definition at line 25 of file MainPage.IsoSpeed.xaml.cs.

        {
            var isoSpeedControl = _mediaCapture.VideoDeviceController.IsoSpeedControl;

            if (isoSpeedControl.Supported)
            {
                IsoButton.Tag = Visibility.Visible;

                IsoAutoCheckBox.IsChecked = isoSpeedControl.Auto;

                // Unhook the event handler, so that changing properties on the slider won't trigger an API call
                IsoSlider.ValueChanged -= IsoSlider_ValueChanged;

                var value = isoSpeedControl.Value;
                IsoSlider.Minimum = isoSpeedControl.Min;
                IsoSlider.Maximum = isoSpeedControl.Max;
                IsoSlider.StepFrequency = isoSpeedControl.Step;
                IsoSlider.Value = value;

                IsoSlider.ValueChanged += IsoSlider_ValueChanged;
            }
            else
            {
                IsoButton.Visibility = Visibility.Collapsed;
                IsoButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateManualControlCapabilities ( ) [inline, private]

Reflect the capabilities of the device in the UI, and set the initial state for each control.

Definition at line 951 of file MainPage.xaml.cs.

        {
            // Prevent the setup from triggering API calls
            _settingUpUi = true;

            // The implementation of these methods is in the partial classes named MainPage.Control.xaml.cs, where "Control" is the name of the control
            UpdateFlashControlCapabilities();
            UpdateZoomControlCapabilities();
            UpdateFocusControlCapabilities();
            UpdateWbControlCapabilities();
            UpdateIsoControlCapabilities();
            UpdateExposureControlCapabilities();
            UpdateEvControlCapabilities();

            _settingUpUi = false;
        }

void UpdateWbControlCapabilities ( ) [inline, private]

Definition at line 26 of file MainPage.WhiteBalance.xaml.cs.

        {
            var whiteBalanceControl = _mediaCapture.VideoDeviceController.WhiteBalanceControl;

            if (whiteBalanceControl.Supported)
            {
                WbButton.Tag = Visibility.Visible;

                if (WbComboBox.ItemsSource == null)
                {
                    WbComboBox.ItemsSource = Enum.GetValues(typeof(ColorTemperaturePreset)).Cast<ColorTemperaturePreset>();
                }

                WbComboBox.SelectedItem = whiteBalanceControl.Preset;

                if (whiteBalanceControl.Max - whiteBalanceControl.Min > whiteBalanceControl.Step)
                {
                    // Unhook the event handler, so that changing properties on the slider won't trigger an API call
                    WbSlider.ValueChanged -= WbSlider_ValueChanged;

                    var value = whiteBalanceControl.Value;
                    WbSlider.Minimum = whiteBalanceControl.Min;
                    WbSlider.Maximum = whiteBalanceControl.Max;
                    WbSlider.StepFrequency = whiteBalanceControl.Step;
                    WbSlider.Value = value;

                    WbSlider.ValueChanged += WbSlider_ValueChanged;
                }
                else
                {
                    WbSlider.Visibility = Visibility.Collapsed;
                    WbTextBox.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                WbButton.Visibility = Visibility.Collapsed;
                WbButton.Tag = Visibility.Collapsed;
            }
        }

void UpdateZoomControlCapabilities ( ) [inline, private]

Definition at line 26 of file MainPage.Zoom.xaml.cs.

        {
            var zoomControl = _mediaCapture.VideoDeviceController.ZoomControl;

            if (zoomControl.Supported)
            {
                ZoomButton.Tag = Visibility.Visible;

                // Unhook the event handler, so that changing properties on the slider won't trigger an API call
                ZoomSlider.ValueChanged -= ZoomSlider_ValueChanged;

                var value = zoomControl.Value;
                ZoomSlider.Minimum = zoomControl.Min;
                ZoomSlider.Maximum = zoomControl.Max;
                ZoomSlider.StepFrequency = zoomControl.Step;
                ZoomSlider.Value = value;

                ZoomSlider.ValueChanged += ZoomSlider_ValueChanged;
            }
            else
            {
                ZoomButton.Visibility = Visibility.Collapsed;
                ZoomButton.Tag = Visibility.Collapsed;
            }
        }

async void VideoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 216 of file MainPage.xaml.cs.

        {
            if (!_isRecording)
            {
                await StartRecordingAsync();
            }
            else
            {
                await StopRecordingAsync();
            }

            // After starting or stopping video recording, update the UI to reflect the MediaCapture state
            UpdateCaptureControls();
        }

async void WbComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file MainPage.WhiteBalance.xaml.cs.

        {
            var selected = (ColorTemperaturePreset)WbComboBox.SelectedItem;

            WbSlider.IsEnabled = (selected == ColorTemperaturePreset.Manual);

            await _mediaCapture.VideoDeviceController.WhiteBalanceControl.SetPresetAsync(selected);

            // Note: Automatic white balance can be locked to the current value by setting the preset to manual and not passing in a value to the control
        }

async void WbSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file MainPage.WhiteBalance.xaml.cs.

        {
            if (_settingUpUi) return;

            var value = (sender as Slider).Value;

            await _mediaCapture.VideoDeviceController.WhiteBalanceControl.SetValueAsync((uint)value);
        }

void ZoomSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file MainPage.Zoom.xaml.cs.

        {
            if (_settingUpUi) return;

            SetZoomLevel((float)ZoomSlider.Value);
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 58 of file MainPage.xaml.cs.

SimpleOrientation _deviceOrientation = SimpleOrientation.NotRotated [private]

Definition at line 50 of file MainPage.xaml.cs.

readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 48 of file MainPage.xaml.cs.

DisplayOrientations _displayOrientation = DisplayOrientations.Portrait [private]

Definition at line 51 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 61 of file MainPage.xaml.cs.

bool _externalCamera [private]

Definition at line 78 of file MainPage.xaml.cs.

bool _isFocused [private]

Definition at line 74 of file MainPage.xaml.cs.

bool _isInitialized [private]

Definition at line 71 of file MainPage.xaml.cs.

bool _isPreviewing [private]

Definition at line 72 of file MainPage.xaml.cs.

bool _isRecording [private]

Definition at line 73 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 70 of file MainPage.xaml.cs.

bool _mirroringPreview [private]

Definition at line 77 of file MainPage.xaml.cs.

readonly SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault() [private]

Definition at line 49 of file MainPage.xaml.cs.

bool _settingUpUi [private]

Definition at line 84 of file MainPage.xaml.cs.

bool _singleControlMode [private]

Definition at line 81 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 64 of file MainPage.xaml.cs.

readonly SystemNavigationManager _systemNavigationManager = SystemNavigationManager.GetForCurrentView() [private]

Definition at line 67 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 55 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraManualControls/cs/MainPage.ExposureValue.xaml.cs
  • CameraManualControls/cs/MainPage.xaml.cs
  • CameraManualControls/cs/MainPage.Flash.xaml.cs
  • CameraManualControls/cs/MainPage.Focus.xaml.cs
  • CameraManualControls/cs/MainPage.IsoSpeed.xaml.cs
  • CameraManualControls/cs/MainPage.Shutter.xaml.cs
  • CameraManualControls/cs/MainPage.WhiteBalance.xaml.cs
  • CameraManualControls/cs/MainPage.Zoom.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RoundingConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraManualControls
  • RoundingConverter
Public Member Functions

RoundingConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 986 of file MainPage.xaml.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 988 of file MainPage.xaml.cs.

        {
            return Math.Round((double)value, 2);
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 993 of file MainPage.xaml.cs.

        {
            return value;
        }

The documentation for this class was generated from the following file:
  • CameraManualControls/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SetRecordProfile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraProfile
  • Scenario1_SetRecordProfile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_SetRecordProfile Class Reference

SetRecordProfile page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_SetRecordProfile ()
async Task< string > | GetVideoProfileSupportedDeviceIdAsync (Windows.Devices.Enumeration.Panel panel)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | InitCustomProfileBtn_Click (object sender, RoutedEventArgs e)
async void | InitRecordProfileBtn_Click (object sender, RoutedEventArgs e)
async Task | LogStatus (string message, NotifyType type)
async Task | LogStatusToOutputBox (string message)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 29 of file Scenario1_SetRecordProfile.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SetRecordProfile ( ) [inline]

Initializes a new instance of the Scenario1_SetRecordProfile class.

Definition at line 39 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<string> GetVideoProfileSupportedDeviceIdAsync ( Windows.Devices.Enumeration.Panel panel ) [inline]

Helper method to obtain a device Id that supports a Video Profile.

If no Video Profile is found we return empty string indicating that there isn't a device on the desired panel with a supported Video Profile.

Parameters:
panel Contains Device Enumeration information regarding camera panel we are looking for
Returns:
Device Information Id string

Definition at line 172 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            string deviceId = string.Empty;

            // Find all video capture devices
            await LogStatusToOutputBox("Looking for all video capture devices");
            DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of video capture devices found: {0}", devices.Count.ToString()));

            // Loop through devices looking for device that supports Video Profile
            foreach (var device in devices)
            {
                // Check if the device on the requested panel supports Video Profile
                if (MediaCapture.IsVideoProfileSupported(device.Id) && device.EnclosureLocation.Panel == panel)
                {
                    // We've located a device that supports Video Profiles on expected panel
                    deviceId = device.Id;
                    break;
                }
            }

            return deviceId;
        }

async void InitCustomProfileBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Locates a video profile for the back camera and then queries if the discovered profile is a matching custom profile.

If a custom profile is located, we configure media settings to the custom profile. Else we use default profile.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 130 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            MediaCapture mediaCapture = new MediaCapture();
            MediaCaptureInitializationSettings mediaInitSettings = new MediaCaptureInitializationSettings();
            string videoDeviceId = string.Empty;

            // For demonstration purposes, we use the Profile Id from WVGA 640x480 30 FPS profile available
            // on desktop simulator and phone emulators
            string customProfileId = "{A0E517E8-8F8C-4F6F-9A57-46FC2F647EC0},0";

            videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);

            if (string.IsNullOrEmpty(videoDeviceId))
            {
                await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
                return;
            }

            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Found video capture device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
            await LogStatusToOutputBox("Querying device for custom profile support");
            mediaInitSettings.VideoProfile =  (from profile in MediaCapture.FindAllVideoProfiles(videoDeviceId)
                                 where profile.Id == customProfileId
                                 select profile).FirstOrDefault();

            // In the event the profile isn't located, we set Video Profile to the default
            if (mediaInitSettings.VideoProfile == null)
            {
                await LogStatus("Could not locate a matching profile, setting to default recording profile", NotifyType.ErrorMessage);
                mediaInitSettings.VideoProfile = MediaCapture.FindAllVideoProfiles(videoDeviceId).FirstOrDefault();
            }

            await LogStatus(string.Format(CultureInfo.InvariantCulture, "Custom recording profile located: {0}", customProfileId), NotifyType.StatusMessage);
            await mediaCapture.InitializeAsync(mediaInitSettings);
        }

async void InitRecordProfileBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Locates a video profile for the back camera and then queries if the discovered profile supports 640x480 30 FPS recording.

If a supported profile is located, then we configure media settings to the matching profile. Else we use default profile.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 62 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            MediaCapture mediaCapture = new MediaCapture();
            MediaCaptureInitializationSettings mediaInitSettings = new MediaCaptureInitializationSettings();
            string videoDeviceId = string.Empty;

            // Look for a video capture device Id with a video profile matching panel location
            videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);

            if (string.IsNullOrEmpty(videoDeviceId))
            {
                await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
                return;
            }

            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Found video capture device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
            await LogStatusToOutputBox("Retrieving all Video Profiles");
            IReadOnlyList<MediaCaptureVideoProfile> profiles = MediaCapture.FindAllVideoProfiles(videoDeviceId);

            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of Video Profiles found: {0}", profiles.Count));

            // Output all Video Profiles found, frame rate is rounded up for display purposes
            foreach (var profile in profiles)
            {
                var description = profile.SupportedRecordMediaDescription;
                foreach (var desc in description)
                {
                    await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture,
                        "Video Profile Found: Profile Id: {0}\r\n Width: {1} Height: {2} FrameRate: {3}", profile.Id, desc.Width, desc.Height, Math.Round(desc.FrameRate).ToString()));
                }
            }

            // Look for WVGA 30FPS profile
            await LogStatusToOutputBox("Querying for matching WVGA 30FPS Profile");
            var match = (from profile in profiles
                         from desc in profile.SupportedRecordMediaDescription
                         where desc.Width == 640 && desc.Height == 480 && Math.Round(desc.FrameRate) == 30
                         select new { profile, desc }).FirstOrDefault();

            if (match != null)
            {
                mediaInitSettings.VideoProfile = match.profile;
                mediaInitSettings.RecordMediaDescription = match.desc;
                await LogStatus(string.Format(CultureInfo.InvariantCulture,
                        "Matching WVGA 30FPS Video Profile found: \r\n Profile Id: {0}\r\n Width: {1} Height: {2} FrameRate: {3}",
                        mediaInitSettings.VideoProfile.Id, mediaInitSettings.RecordMediaDescription.Width,
                        mediaInitSettings.RecordMediaDescription.Height, Math.Round(mediaInitSettings.RecordMediaDescription.FrameRate).ToString()), NotifyType.StatusMessage);
            }
            else
            {
                // Could not locate a WVGA 30FPS profile, use default video recording profile
                mediaInitSettings.VideoProfile = profiles[0];
                await LogStatus("Could not locate a matching profile, setting to default recording profile", NotifyType.ErrorMessage);
            }

            await mediaCapture.InitializeAsync(mediaInitSettings);
            await LogStatusToOutputBox("Media Capture settings initialized to selected profile");

        }

async Task LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, this method is for important status messages to be displayed at bottom of scenario page.

Parameters:
message | Message to log to the output box
type | Notification Type for status message

Definition at line 217 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBox(message);
        }

async Task LogStatusToOutputBox ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log to the outputBox

Definition at line 201 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Override default OnNavigateTo to initialize the rootPage object for Status message updates.

Parameters:
e Contains state information and event data associated with the event

Definition at line 49 of file Scenario1_SetRecordProfile.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 34 of file Scenario1_SetRecordProfile.xaml.cs.

The documentation for this class was generated from the following file:
  • CameraProfile/cs/Scenario1_SetRecordProfile.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ConcurrentProfile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraProfile
  • Scenario2_ConcurrentProfile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ConcurrentProfile Class Reference

ConcurrenProfile page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_ConcurrentProfile ()
async Task< string > | GetVideoProfileSupportedDeviceIdAsync (Windows.Devices.Enumeration.Panel panel)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CheckConcurrentProfileBtn_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | LogStatus (string message, NotifyType type)
async Task | LogStatusToOutputBox (string message)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 27 of file Scenario2_ConcurrentProfile.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ConcurrentProfile ( ) [inline]

Initializes a new instance of the Scenario2_ConcurrentProfile class.

Definition at line 37 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CheckConcurrentProfileBtn_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Finds the video profile for the front and back camera and queries if both cameras have a matching video recording profile that supports concurrency.

If a matching concurrent profile is supported, then we configure media initialization settings for both cameras to the matching profile.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 60 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            // Initialize our concurrency support flag.
            bool concurrencySupported = false;

            string frontVideoDeviceId = string.Empty;
            string backVideoDeviceId = string.Empty;

            MediaCapture mediaCaptureFront = new MediaCapture();
            MediaCapture mediaCaptureBack = new MediaCapture();

            // Find front and back Device Id of capture device that supports Video Profile
            await LogStatusToOutputBox("Looking for all video capture devices on front panel");
            frontVideoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Front);
            await LogStatusToOutputBox("Looking for all video capture devices on back panel");
            backVideoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);

            // First check if the devices support video profiles, if not there's no reason to proceed
            if (string.IsNullOrEmpty(frontVideoDeviceId) || string.IsNullOrEmpty(backVideoDeviceId))
            {
                await LogStatus("ERROR: A capture device doesn't support Video Profile", NotifyType.ErrorMessage);
                return;
            }

            await LogStatusToOutputBox("Video Profiles are supported on both cameras");

            // Create MediaCaptureInitilization settings for each video capture device
            MediaCaptureInitializationSettings mediaInitSettingsFront = new MediaCaptureInitializationSettings();
            MediaCaptureInitializationSettings mediaInitSettingsBack = new MediaCaptureInitializationSettings();

            mediaInitSettingsFront.VideoDeviceId = frontVideoDeviceId;
            mediaInitSettingsBack.VideoDeviceId = backVideoDeviceId;
            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Front Device Id located: {0}", frontVideoDeviceId.ToString()));
            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Back Device Id located: {0}", backVideoDeviceId.ToString()));

            await LogStatusToOutputBox("Querying for concurrent profile");

            // Acquire concurrent profiles available to front and back capture devices, then locate a concurrent
            // profile Id that matches for both devices
            var concurrentProfile = (from frontProfile in MediaCapture.FindConcurrentProfiles(frontVideoDeviceId)
                                     from backProfile in MediaCapture.FindConcurrentProfiles(backVideoDeviceId)
                                     where frontProfile.Id == backProfile.Id
                                     select new { frontProfile, backProfile }).FirstOrDefault();

            if (concurrentProfile != null)
            {
                mediaInitSettingsFront.VideoProfile = concurrentProfile.frontProfile;
                mediaInitSettingsBack.VideoProfile = concurrentProfile.backProfile;
                concurrencySupported = true;

                await LogStatus("Concurrent profile located, device supports concurrency", NotifyType.StatusMessage);
            }
            else
            {
                // There are no concurrent profiles available on this device, thus
                // there is not profile to select. With a lack of concurrent profile
                // each camera will have to be managed manually and cannot support
                // simultaneous streams. So we set the Video profile to null to
                // indicate that camera must be managed individually.
                mediaInitSettingsFront.VideoProfile = null;
                mediaInitSettingsBack.VideoProfile = null;

                await LogStatus("No Concurrent profiles located, device does not support concurrency", NotifyType.ErrorMessage);
            }

            await LogStatusToOutputBox("Initializing Front camera settings");
            await mediaCaptureFront.InitializeAsync(mediaInitSettingsFront);
            if (concurrencySupported)
            {
                await LogStatusToOutputBox("Device supports concurrency, initializing Back camera settings");

                // Only initialize the back camera if concurrency is available.  Otherwise,
                // we can only use one camera at a time (which in this case will be the front
                // camera).
                await mediaCaptureBack.InitializeAsync(mediaInitSettingsBack);
            }
        }

async Task<string> GetVideoProfileSupportedDeviceIdAsync ( Windows.Devices.Enumeration.Panel panel ) [inline]

Helper method to obtain a device Id that supports a Video Profile.

If no Video Profile is found we return empty string indicating that there isn't a device on the desired panel with a supported Video Profile.

Parameters:
panel Contains Device Enumeration information regarding camera panel we are looking for
Returns:
Device Information Id string

Definition at line 145 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            string deviceId = string.Empty;

            // Finds all video capture devices
            DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of video capture devices found: {0}", devices.Count.ToString()));

            foreach (var device in devices)
            {
                // Check if the device on the requested panel supports Video Profile
                if (MediaCapture.IsVideoProfileSupported(device.Id) && device.EnclosureLocation.Panel == panel)
                {
                    // We've located a device that supports Video Profiles on expected panel
                    deviceId = device.Id;
                    break;
                }
            }

            return deviceId;
        }

async Task LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, this method is for important status messages to be displayed at bottom of scenario page.

Parameters:
message | Message to log to the output box
type | Notification Type for status message

Definition at line 188 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBox(message);
        }

async Task LogStatusToOutputBox ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log to the outputBox

Definition at line 172 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Override default OnNavigateTo to initialize the rootPage object for Status message updates.

Parameters:
e Contains state information and event data associated with the event

Definition at line 47 of file Scenario2_ConcurrentProfile.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 32 of file Scenario2_ConcurrentProfile.xaml.cs.

The documentation for this class was generated from the following file:
  • CameraProfile/cs/Scenario2_ConcurrentProfile.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_EnableHdrProfile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraProfile
  • Scenario3_EnableHdrProfile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_EnableHdrProfile Class Reference

EnableHDRProfile page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_EnableHdrProfile ()
async Task< string > | GetVideoProfileSupportedDeviceIdAsync (Windows.Devices.Enumeration.Panel panel)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CheckHdrSupportBtn_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | LogStatus (string message, NotifyType type)
async Task | LogStatusToOutputBox (string message)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario3_EnableHdrProfile.xaml.cs.

Constructor & Destructor Documentation

Scenario3_EnableHdrProfile ( ) [inline]

Initializes a new instance of the Scenario3_EnableHdrProfile class.

Definition at line 38 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CheckHdrSupportBtn_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Finds the video profiles for the back camera.

Then queries for a profile that supports HDR video recording. If a HDR supported video profile is located, then we configure media settings to the matching profile. Finally we initialize media capture HDR recording mode to auto.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 60 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            string videoDeviceId = string.Empty;
            bool HdrVideoSupported = false;
            MediaCapture mediaCapture = new MediaCapture();
            MediaCaptureInitializationSettings mediaCaptureInitSetttings = new MediaCaptureInitializationSettings();

            // Select the first video capture device found on the back of the device
            await LogStatusToOutputBox("Querying for video capture device on back of the device that supports Video Profile");
            videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);

            if (string.IsNullOrEmpty(videoDeviceId))
            {
                await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
                return;
            }

            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture,
                "Found device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
            IReadOnlyList<MediaCaptureVideoProfile> profiles = MediaCapture.FindKnownVideoProfiles(videoDeviceId, KnownVideoProfile.VideoRecording);

            // Walk through available profiles, look for first profile with HDR supported Video Profile
            foreach (MediaCaptureVideoProfile profile in profiles)
            {
                IReadOnlyList<MediaCaptureVideoProfileMediaDescription> recordMediaDescription = profile.SupportedRecordMediaDescription;
                foreach (MediaCaptureVideoProfileMediaDescription videoProfileMediaDescription in recordMediaDescription)
                {
                    if (videoProfileMediaDescription.IsHdrVideoSupported)
                    {
                        // We've located the profile and description for HDR Video, set profile and flag
                        mediaCaptureInitSetttings.VideoProfile = profile;
                        mediaCaptureInitSetttings.RecordMediaDescription = videoProfileMediaDescription;
                        HdrVideoSupported = true;
                        await LogStatus("HDR supported video profile found, set video profile to current HDR supported profile", NotifyType.StatusMessage);
                        break;
                    }
                }

                if (HdrVideoSupported)
                {
                    break;
                }
            }

            await LogStatusToOutputBox("Initializing Media settings to HDR Supported video profile");
            await mediaCapture.InitializeAsync(mediaCaptureInitSetttings);
            if (HdrVideoSupported)
            {
                await LogStatusToOutputBox("Initializing HDR Video Mode to Auto");
                mediaCapture.VideoDeviceController.HdrVideoControl.Mode = Windows.Media.Devices.HdrVideoMode.Auto;
            }
        }

async Task<string> GetVideoProfileSupportedDeviceIdAsync ( Windows.Devices.Enumeration.Panel panel ) [inline]

Helper method to obtain a device Id that supports a Video Profile.

If no Video Profile is found we return empty string indicating that there isn't a device on the desired panel with a supported Video Profile.

Parameters:
panel Contains Device Enumeration information regarding camera panel we are looking for
Returns:
Device Information Id string

Definition at line 120 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            string deviceId = string.Empty;

            // Finds all video capture devices
            await LogStatusToOutputBox("Looking for all video capture devices");
            DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of video capture devices found: {0}", devices.Count.ToString()));

            foreach (var device in devices)
            {
                // Check if the device on the requested panel supports Video Profile
                if (MediaCapture.IsVideoProfileSupported(device.Id) && device.EnclosureLocation.Panel == panel)
                {
                    // We've located a device that supports Video Profiles on expected panel
                    deviceId = device.Id;
                    break;
                }
            }

            return deviceId;
        }

async Task LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, this method is for important status messages to be displayed at bottom of scenario page.

Parameters:
message | Message to log to the output box
type | Notification Type for status message

Definition at line 164 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBox(message);
        }

async Task LogStatusToOutputBox ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log to the outputBox

Definition at line 148 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Override default OnNavigateTo to initialize the rootPage object for Status message updates.

Parameters:
e Contains state information and event data associated with the event

Definition at line 48 of file Scenario3_EnableHdrProfile.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 33 of file Scenario3_EnableHdrProfile.xaml.cs.

The documentation for this class was generated from the following file:
  • CameraProfile/cs/Scenario3_EnableHdrProfile.xaml.cs
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStarterKit
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 23 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 39 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 82 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following files:
  • CameraStarterKit/cs/App.xaml.cs
  • CameraStarterKit/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraRotationHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStarterKit
  • CameraRotationHelper
Public Member Functions | Static Public Member Functions | Events | Private Member Functions | Static Private Member Functions | Private Attributes

CameraRotationHelper Class Reference

List of all members.

Public Member Functions

CameraRotationHelper (EnclosureLocation cameraEnclosureLocation)
SimpleOrientation | GetCameraCaptureOrientation ()
SimpleOrientation | GetCameraPreviewOrientation ()
SimpleOrientation | GetUIOrientation ()

Static Public Member Functions

static int | ConvertSimpleOrientationToClockwiseDegrees (SimpleOrientation orientation)
static PhotoOrientation | ConvertSimpleOrientationToPhotoOrientation (SimpleOrientation orientation)
static bool | IsEnclosureLocationExternal (EnclosureLocation enclosureLocation)

Events

EventHandler< bool > | OrientationChanged

Private Member Functions

SimpleOrientation | ConvertDisplayOrientationToSimpleOrientation (DisplayOrientations orientation)
void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
SimpleOrientation | GetCameraOrientationRelativeToNativeOrientation ()
bool | ShouldMirrorPreview ()
void | SimpleOrientationSensor_OrientationChanged (SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)

Static Private Member Functions

static SimpleOrientation | AddOrientations (SimpleOrientation a, SimpleOrientation b)
static SimpleOrientation | ConvertClockwiseDegreesToSimpleOrientation (int orientation)
static VideoRotation | ConvertSimpleOrientationToVideoRotation (SimpleOrientation orientation)
static SimpleOrientation | MirrorOrientation (SimpleOrientation orientation)
static SimpleOrientation | SubtractOrientations (SimpleOrientation a, SimpleOrientation b)

Private Attributes

EnclosureLocation | _cameraEnclosureLocation
DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
SimpleOrientationSensor | _orientationSensor = SimpleOrientationSensor.GetDefault()

Detailed Description

Definition at line 10 of file CameraRotationHelper.cs.

Constructor & Destructor Documentation

CameraRotationHelper ( EnclosureLocation cameraEnclosureLocation ) [inline]

Definition at line 21 of file CameraRotationHelper.cs.

        {
            _cameraEnclosureLocation = cameraEnclosureLocation;
            if (!IsEnclosureLocationExternal(_cameraEnclosureLocation) && _orientationSensor != null)
            {
                _orientationSensor.OrientationChanged += SimpleOrientationSensor_OrientationChanged;
            }
            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
        }

Member Function Documentation

SimpleOrientation AddOrientations | ( | SimpleOrientation | a,
 |  | SimpleOrientation | b |
 | ) |  |  | [inline, static, private]

Definition at line 176 of file CameraRotationHelper.cs.

        {
            var aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
            var bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
            var result = (aRot + bRot) % 360;
            return ConvertClockwiseDegreesToSimpleOrientation(result);
        }

SimpleOrientation ConvertClockwiseDegreesToSimpleOrientation ( int orientation ) [inline, static, private]

Definition at line 209 of file CameraRotationHelper.cs.

        {
            switch (orientation)
            {
                case 270:
                    return SimpleOrientation.Rotated90DegreesCounterclockwise;
                case 180:
                    return SimpleOrientation.Rotated180DegreesCounterclockwise;
                case 90:
                    return SimpleOrientation.Rotated270DegreesCounterclockwise;
                case 0:
                default:
                    return SimpleOrientation.NotRotated;
            }
        }

SimpleOrientation ConvertDisplayOrientationToSimpleOrientation ( DisplayOrientations orientation ) [inline, private]

Definition at line 134 of file CameraRotationHelper.cs.

        {
            SimpleOrientation result;
            switch (orientation)
            {
                case DisplayOrientations.Landscape:
                    result = SimpleOrientation.NotRotated;
                    break;
                case DisplayOrientations.PortraitFlipped:
                    result = SimpleOrientation.Rotated90DegreesCounterclockwise;
                    break;
                case DisplayOrientations.LandscapeFlipped:
                    result = SimpleOrientation.Rotated180DegreesCounterclockwise;
                    break;
                case DisplayOrientations.Portrait:
                default:
                    result = SimpleOrientation.Rotated270DegreesCounterclockwise;
                    break;
            }

            // Above assumes landscape; offset is needed if native orientation is portrait
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                result = AddOrientations(result, SimpleOrientation.Rotated90DegreesCounterclockwise);
            }

            return result;
        }

int ConvertSimpleOrientationToClockwiseDegrees ( SimpleOrientation orientation ) [inline, static]

Definition at line 118 of file CameraRotationHelper.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return 270;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return 180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return 90;
                case SimpleOrientation.NotRotated:
                default:
                    return 0;
            }
        }

PhotoOrientation ConvertSimpleOrientationToPhotoOrientation ( SimpleOrientation orientation ) [inline, static]

Definition at line 102 of file CameraRotationHelper.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return PhotoOrientation.Rotate90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return PhotoOrientation.Rotate180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return PhotoOrientation.Rotate270;
                case SimpleOrientation.NotRotated:
                default:
                    return PhotoOrientation.Normal;
            }
        }

VideoRotation ConvertSimpleOrientationToVideoRotation ( SimpleOrientation orientation ) [inline, static, private]

Definition at line 193 of file CameraRotationHelper.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return VideoRotation.Clockwise270Degrees;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return VideoRotation.Clockwise180Degrees;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return VideoRotation.Clockwise90Degrees;
                case SimpleOrientation.NotRotated:
                default:
                    return VideoRotation.None;
            }
        }

void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 238 of file CameraRotationHelper.cs.

        {
            OrientationChanged?.Invoke(this, true);
        }

SimpleOrientation GetCameraCaptureOrientation ( ) [inline]

Gets the rotation of the camera to rotate pictures/videos when saving to file.

Definition at line 59 of file CameraRotationHelper.cs.

        {
            if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            // Get the device orientation offset by the camera hardware offset
            var deviceOrientation = _orientationSensor?.GetCurrentOrientation() ?? SimpleOrientation.NotRotated;
            var result = SubtractOrientations(deviceOrientation, GetCameraOrientationRelativeToNativeOrientation());

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (ShouldMirrorPreview())
            {
                result = MirrorOrientation(result);
            }
            return result;
        }

SimpleOrientation GetCameraOrientationRelativeToNativeOrientation ( ) [inline, private]

Definition at line 249 of file CameraRotationHelper.cs.

        {
            // Get the rotation angle of the camera enclosure as it is mounted in the device hardware
            var enclosureAngle = ConvertClockwiseDegreesToSimpleOrientation((int)_cameraEnclosureLocation.RotationAngleInDegreesClockwise);

            // Account for the fact that, on portrait-first devices, the built in camera sensor is read at a 90 degree offset to the native orientation
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait && !IsEnclosureLocationExternal(_cameraEnclosureLocation))
            {
                enclosureAngle = AddOrientations(SimpleOrientation.Rotated90DegreesCounterclockwise, enclosureAngle);
            }

            return enclosureAngle;
        }

SimpleOrientation GetCameraPreviewOrientation ( ) [inline]

Gets the rotation of the camera to display the camera preview.

Definition at line 82 of file CameraRotationHelper.cs.

        {
            if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            // Get the app display rotation offset by the camera hardware offset
            var result = ConvertDisplayOrientationToSimpleOrientation(_displayInformation.CurrentOrientation);
            result = SubtractOrientations(result, GetCameraOrientationRelativeToNativeOrientation());

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (ShouldMirrorPreview())
            {
                result = MirrorOrientation(result);
            }
            return result;
        }

SimpleOrientation GetUIOrientation ( ) [inline]

Gets the rotation to rotate ui elements.

Gets the rotation to rotate UI elements.

Definition at line 42 of file CameraRotationHelper.cs.

        {
            if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            // Return the difference between the orientation of the device and the orientation of the app display
            var deviceOrientation = _orientationSensor?.GetCurrentOrientation() ?? SimpleOrientation.NotRotated;
            var displayOrientation = ConvertDisplayOrientationToSimpleOrientation(_displayInformation.CurrentOrientation);
            return SubtractOrientations(displayOrientation, deviceOrientation);
        }

static bool IsEnclosureLocationExternal ( EnclosureLocation enclosureLocation ) [inline, static]

Detects whether or not the camera is external to the device.

Definition at line 34 of file CameraRotationHelper.cs.

        {
            return (enclosureLocation == null || enclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown);
        }

SimpleOrientation MirrorOrientation ( SimpleOrientation orientation ) [inline, static, private]

Definition at line 163 of file CameraRotationHelper.cs.

        {
            // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return SimpleOrientation.Rotated270DegreesCounterclockwise;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return SimpleOrientation.Rotated90DegreesCounterclockwise;
            }
            return orientation;
        }

bool ShouldMirrorPreview ( ) [inline, private]

Definition at line 243 of file CameraRotationHelper.cs.

        {
            // It is recommended that applications mirror the preview for front-facing cameras, as it gives users a more natural experience, since it behaves more like a mirror
            return (_cameraEnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
        }

void SimpleOrientationSensor_OrientationChanged | ( | SimpleOrientationSensor | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 225 of file CameraRotationHelper.cs.

        {
            if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
            {
                // Only raise the OrientationChanged event if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
                // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
                // either up or down, at the desired subject.
                //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
                //      on other panels, this logic should be adjusted.
                OrientationChanged?.Invoke(this, false);
            }
        }

SimpleOrientation SubtractOrientations | ( | SimpleOrientation | a,
 |  | SimpleOrientation | b |
 | ) |  |  | [inline, static, private]

Definition at line 184 of file CameraRotationHelper.cs.

        {
            var aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
            var bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
            // Add 360 to ensure the modulus operator does not operate on a negative
            var result = (360 + (aRot - bRot)) % 360;
            return ConvertClockwiseDegreesToSimpleOrientation(result);
        }

Member Data Documentation

EnclosureLocation _cameraEnclosureLocation [private]

Definition at line 12 of file CameraRotationHelper.cs.

DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 13 of file CameraRotationHelper.cs.

SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault() [private]

Definition at line 14 of file CameraRotationHelper.cs.

Event Documentation

EventHandler<bool> OrientationChanged

Occurs each time the simple orientation sensor reports a new sensor reading or when the display's current or native orientation changes.

Definition at line 19 of file CameraRotationHelper.cs.

The documentation for this class was generated from the following files:
  • CameraStarterKit/cs/CameraRotationHelper.cs
  • CameraStarterKit/cpp/CameraRotationHelper.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStarterKit
  • MainPage
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Public Member Functions

MainPage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | Application_Resuming (object sender, object o)
void | Application_Suspending (object sender, SuspendingEventArgs e)
async Task | CleanupCameraAsync ()
async Task | CleanupUiAsync ()
async void | HardwareButtons_CameraPressed (object sender, CameraEventArgs e)
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | MediaCapture_RecordLimitationExceeded (MediaCapture sender)
async void | PhotoButton_Click (object sender, RoutedEventArgs e)
void | RegisterEventHandlers ()
async void | RotationHelper_OrientationChanged (object sender, bool updatePreview)
async Task | SetPreviewRotationAsync ()
async Task | SetUpBasedOnStateAsync ()
async Task | SetupUiAsync ()
async Task | StartPreviewAsync ()
async Task | StartRecordingAsync ()
async Task | StopPreviewAsync ()
async Task | StopRecordingAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
async Task | TakePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
async void | VideoButton_Click (object sender, RoutedEventArgs e)
async void | Window_VisibilityChanged (object sender, VisibilityChangedEventArgs args)

Static Private Member Functions

static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)
static async Task | ReencodeAndSavePhotoAsync (IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation)

Private Attributes

StorageFolder | _captureFolder = null
readonly DisplayRequest | _displayRequest = new DisplayRequest()
bool | _externalCamera
bool | _isActivePage
bool | _isInitialized
bool | _isPreviewing
bool | _isRecording
bool | _isSuspending
bool | _isUIActive
MediaCapture | _mediaCapture
bool | _mirroringPreview
CameraRotationHelper _rotationHelper
Task | _setupTask = Task.CompletedTask
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 38 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 73 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Do not cache the state of the UI when suspending/navigating
            NavigationCacheMode = NavigationCacheMode.Disabled;
        }

Member Function Documentation

void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 93 of file MainPage.xaml.cs.

        {
            _isSuspending = false;

            var task = Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
            {
                await SetUpBasedOnStateAsync();
            });
        }

void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file MainPage.xaml.cs.

        {
            _isSuspending = false;

            var deferral = e.SuspendingOperation.GetDeferral();
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
            {
                await SetUpBasedOnStateAsync();
                deferral.Complete();
            });
        }

Concurrency::task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 451 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("CleanupCameraAsync");

            if (_isInitialized)
            {
                // If a recording is in progress during cleanup, stop it to save the recording
                if (_isRecording)
                {
                    await StopRecordingAsync();
                }

                if (_isPreviewing)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                _isInitialized = false;
            }

            if (_mediaCapture != null)
            {
                _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed -= MediaCapture_Failed;
                _mediaCapture.Dispose();
                _mediaCapture = null;
            }

            if (_rotationHelper != null)
            {
                _rotationHelper.OrientationChanged -= RotationHelper_OrientationChanged;
                _rotationHelper = null;
            }
        }

task< void > CleanupUiAsync ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Returns:

Definition at line 561 of file MainPage.xaml.cs.

        {
            UnregisterEventHandlers();

            // Show the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
            }

            // Revert orientation preferences
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed.

Parameters:
desiredPanel The desired panel on which the returned device should be mounted, if available
Returns:

Definition at line 627 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

async void HardwareButtons_CameraPressed | ( | object | sender,
 |  | CameraEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 181 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI.

Returns:

Definition at line 213 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            if (_mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when video recording has reached the maximum time and when something goes wrong
                _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }

                // If initialization succeeded, start the preview
                if (_isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    // Initialize rotationHelper
                    _rotationHelper = new CameraRotationHelper(cameraDevice.EnclosureLocation);
                    _rotationHelper.OrientationChanged += RotationHelper_OrientationChanged;

                    await StartPreviewAsync();

                    UpdateCaptureControls();
                }
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 195 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

async void MediaCapture_RecordLimitationExceeded ( MediaCapture sender ) [inline, private]

Definition at line 186 of file MainPage.xaml.cs.

        {
            // This is a notification that recording has to stop, and the app is expected to finalize the recording

            await StopRecordingAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 103 of file MainPage.xaml.cs.

        {
            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;
            Window.Current.VisibilityChanged += Window_VisibilityChanged;

            _isActivePage = true;
            await SetUpBasedOnStateAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 114 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completenes, as it will only fire when navigating between pages and this sample only includes one page
            Application.Current.Suspending -= Application_Suspending;
            Application.Current.Resuming -= Application_Resuming;
            Window.Current.VisibilityChanged -= Window_VisibilityChanged;

            _isActivePage = false;
            await SetUpBasedOnStateAsync();
        }

async void PhotoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 161 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

static async Task ReencodeAndSavePhotoAsync | ( | IRandomAccessStream | stream,
 |  | StorageFile | file,
 |  | PhotoOrientation | photoOrientation |
 | ) |  |  | [inline, static, private]

Applies the given orientation to a photo stream and saves it as a StorageFile.

Parameters:
stream | The photo stream
file | The StorageFile in which the photo stream will be saved
photoOrientation | The orientation metadata to apply to the photo
Returns:

Definition at line 646 of file MainPage.xaml.cs.

        {
            using (var inputStream = stream)
            {
                var decoder = await BitmapDecoder.CreateAsync(inputStream);

                using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
                {
                    var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);

                    var properties = new BitmapPropertySet { { "System.Photo.Orientation", new BitmapTypedValue(photoOrientation, PropertyType.UInt16) } };

                    await encoder.BitmapProperties.SetPropertiesAsync(properties);
                    await encoder.FlushAsync();
                }
            }
        }

void RegisterEventHandlers ( ) [inline, private]

Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation.

Definition at line 601 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
            }
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
        }

async void RotationHelper_OrientationChanged | ( | object | sender,
 |  | bool | updatePreview |
 | ) |  |  | [inline, private]

Handles an orientation changed event.

Definition at line 280 of file MainPage.xaml.cs.

        {
            if (updatePreview)
            {
                await SetPreviewRotationAsync();
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview.

Returns:

Definition at line 331 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var rotation = _rotationHelper.GetCameraPreviewOrientation();
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(rotation));
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

Concurrency::task< void > SetUpBasedOnStateAsync ( ) [inline, private]

Initialize or clean up the camera and our UI, depending on the page state.

Returns:

Definition at line 499 of file MainPage.xaml.cs.

        {
            // Avoid reentrancy: Wait until nobody else is in this function.
            while (!_setupTask.IsCompleted)
            {
                await _setupTask;
            }

            // We want our UI to be active if
            // * We are the current active page.
            // * The window is visible.
            // * The app is not suspending.
            bool wantUIActive = _isActivePage && Window.Current.Visible && !_isSuspending;

            if (_isUIActive != wantUIActive)
            {
                _isUIActive = wantUIActive;

                Func<Task> setupAsync = async () =>
                {
                    if (wantUIActive)
                    {
                        await SetupUiAsync();
                        await InitializeCameraAsync();
                    }
                    else
                    {
                        await CleanupCameraAsync();
                        await CleanupUiAsync();
                    }
                };
                _setupTask = setupAsync();
            }

            await _setupTask;
        }

task< void > SetupUiAsync ( ) [inline, private]

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors.

Returns:

Definition at line 540 of file MainPage.xaml.cs.

        {
            // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

            // Hide the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
            }

            RegisterEventHandlers();
            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on.

Returns:

Definition at line 308 of file MainPage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _isPreviewing = true;

            // Initialize the preview to the current orientation
            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

task< void > StartRecordingAsync ( ) [inline, private]

Records an MP4 video to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 406 of file MainPage.xaml.cs.

        {
            try
            {
                // Create storage file for the capture
                var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);

                var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

                // Calculate rotation angle, taking mirroring into account if necessary
                var rotationAngle = CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(_rotationHelper.GetCameraCaptureOrientation());
                encodingProfile.Video.Properties.Add(RotationKey, PropertyValue.CreateInt32(rotationAngle));

                Debug.WriteLine("Starting recording to " + videoFile.Path);

                await _mediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);
                _isRecording = true;

                Debug.WriteLine("Started recording!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
            }
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 347 of file MainPage.xaml.cs.

        {
            // Stop the preview
            _isPreviewing = false;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Cleanup the UI
                PreviewControl.Source = null;

                // Allow the device screen to sleep now that the preview is stopped
                _displayRequest.RequestRelease();
            });
        }

task< void > StopRecordingAsync ( ) [inline, private]

Stops recording a video.

Returns:

Definition at line 437 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("Stopping recording...");

            _isRecording = false;
            await _mediaCapture.StopRecordAsync();

            Debug.WriteLine("Stopped recording!");
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 140 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

task< void > TakePhotoAsync ( ) [inline, private]

Takes a photo to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 368 of file MainPage.xaml.cs.

        {
            // While taking a photo, keep the video button enabled only if the camera supports simultaneously taking pictures and recording video
            VideoButton.IsEnabled = _mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported;

            // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
            VideoButton.Opacity = VideoButton.IsEnabled ? 1 : 0;

            var stream = new InMemoryRandomAccessStream();

            Debug.WriteLine("Taking photo...");
            await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);

            try
            {
                var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);
                Debug.WriteLine("Photo taken! Saving to " + file.Path);

                var photoOrientation = CameraRotationHelper.ConvertSimpleOrientationToPhotoOrientation(_rotationHelper.GetCameraCaptureOrientation());

                await ReencodeAndSavePhotoAsync(stream, file, photoOrientation);
                Debug.WriteLine("Photo saved!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when taking a photo: " + ex.ToString());
            }

            // Done taking a photo, so re-enable the button
            VideoButton.IsEnabled = true;
            VideoButton.Opacity = 1;
        }

void UnregisterEventHandlers ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors.

Definition at line 613 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
            }
            _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
        }

void UpdateButtonOrientation ( ) [inline, private]

Uses the current device orientation in space and page orientation on the screen to calculate the rotation transformation to apply to the controls.

Definition at line 293 of file MainPage.xaml.cs.

        {
            // Rotate the buttons in the UI to match the rotation of the device
            var angle = CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(_rotationHelper.GetUIOrientation());
            var transform = new RotateTransform { Angle = angle };

            // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
            PhotoButton.RenderTransform = transform;
            VideoButton.RenderTransform = transform;
        }

void UpdateCaptureControls ( ) [inline, private]

This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device.

Definition at line 578 of file MainPage.xaml.cs.

        {
            // The buttons should only be enabled if the preview started sucessfully
            PhotoButton.IsEnabled = _isPreviewing;
            VideoButton.IsEnabled = _isPreviewing;

            // Update recording button to show "Stop" icon instead of red "Record" icon
            StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
            StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;

            // If the camera doesn't support simultaneosly taking pictures and recording video, disable the photo button on record
            if (_isInitialized && !_mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported)
            {
                PhotoButton.IsEnabled = !_isRecording;

                // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
                PhotoButton.Opacity = PhotoButton.IsEnabled ? 1 : 0;
            }
        }

async void VideoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 166 of file MainPage.xaml.cs.

        {
            if (!_isRecording)
            {
                await StartRecordingAsync();
            }
            else
            {
                await StopRecordingAsync();
            }

            // After starting or stopping video recording, update the UI to reflect the MediaCapture state
            UpdateCaptureControls();
        }

async void Window_VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 129 of file MainPage.xaml.cs.

        {
            await SetUpBasedOnStateAsync();
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 45 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 47 of file MainPage.xaml.cs.

bool _externalCamera [private]

Definition at line 66 of file MainPage.xaml.cs.

bool _isActivePage [private]

Definition at line 60 of file MainPage.xaml.cs.

bool _isInitialized [private]

Definition at line 54 of file MainPage.xaml.cs.

bool _isPreviewing [private]

Definition at line 55 of file MainPage.xaml.cs.

bool _isRecording [private]

Definition at line 56 of file MainPage.xaml.cs.

bool _isSuspending [private]

Definition at line 59 of file MainPage.xaml.cs.

bool _isUIActive [private]

Definition at line 61 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 53 of file MainPage.xaml.cs.

bool _mirroringPreview [private]

Definition at line 65 of file MainPage.xaml.cs.

CameraRotationHelper _rotationHelper [private]

Definition at line 69 of file MainPage.xaml.cs.

Task _setupTask = Task.CompletedTask [private]

Definition at line 62 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 50 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 42 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraStarterKit/cs/MainPage.xaml.cs
  • CameraStarterKit/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStarterKit
  • sealed
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class.

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~MainPage ()
CameraRotationHelper (EnclosureLocation^cameraEnclosureLocation)
SimpleOrientation | GetCameraCaptureOrientation ()
SimpleOrientation | GetCameraPreviewOrientation ()
SimpleOrientation | GetUIOrientation ()
MainPage ()

Static Public Member Functions

static int | ConvertSimpleOrientationToClockwiseDegrees (SimpleOrientation orientation)
static PhotoOrientation | ConvertSimpleOrientationToPhotoOrientation (SimpleOrientation orientation)
static bool | IsEnclosureLocationExternal (EnclosureLocation^enclosureLocation)

Public Attributes

Windows::Graphics::Imaging::BitmapEncoder | Encoder
Windows::Storage::StorageFile | File
Windows::Storage::FileProperties::PhotoOrientation | Orientation
event EventHandler< bool > | OrientationChanged

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | Application_Resuming (Object^sender, Object^args)
void | Application_Suspending (Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
Concurrency::task< void > | CleanupCameraAsync ()
Concurrency::task< void > | CleanupUiAsync ()
SimpleOrientation | ConvertDisplayOrientationToSimpleOrientation (DisplayOrientations orientation)
void | DisplayInformation_OrientationChanged (DisplayInformation^sender, Object^ref)
Concurrency::task
< Windows::Devices::Enumeration::DeviceInformation^> 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel panel)
SimpleOrientation | GetCameraOrientationRelativeToNativeOrientation ()
void | HardwareButtons_CameraPress (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
void | HardwareButtons_CameraPressed (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
Concurrency::task< void > | InitializeCameraAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)
void | MediaCapture_RecordLimitationExceeded (Windows::Media::Capture::MediaCapture^currentCaptureObject)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | PhotoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | ReencodeAndSavePhotoAsync (Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation)
void | RegisterEventHandlers ()
void | RotationHelper_OrientationChanged (Object^, bool)
Concurrency::task< void > | SetPreviewRotationAsync ()
Concurrency::task< void > | SetUpBasedOnStateAsync ()
Concurrency::task< void > | SetupUiAsync ()
bool | ShouldMirrorPreview ()
void | SimpleOrientationSensor_OrientationChanged (SimpleOrientationSensor^sender, SimpleOrientationSensorOrientationChangedEventArgs^args)
Concurrency::task< void > | StartPreviewAsync ()
Concurrency::task< void > | StartRecordingAsync ()
Concurrency::task< void > | StopPreviewAsync ()
Concurrency::task< void > | StopRecordingAsync ()
void | SystemMediaControls_PropertyChanged (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args)
Concurrency::task< void > | TakePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
void | VideoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Window_VisibilityChanged (Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)
void | WriteException (Platform::Exception^ex)
void | WriteLine (Platform::String^str)

Static Private Member Functions

static SimpleOrientation | AddOrientations (SimpleOrientation a, SimpleOrientation b)
static SimpleOrientation | ConvertClockwiseDegreesToSimpleOrientation (int orientation)
static VideoRotation | ConvertSimpleOrientationToVideoRotation (SimpleOrientation orientation)
static SimpleOrientation | MirrorOrientation (SimpleOrientation orientation)
static SimpleOrientation | SubtractOrientations (SimpleOrientation a, SimpleOrientation b)

Private Attributes

Windows::Foundation::EventRegistrationToken | _applicationResumingEventToken
Windows::Foundation::EventRegistrationToken | _applicationSuspendingEventToken
EnclosureLocation | _cameraEnclosureLocation
Windows::Storage::StorageFolder | _captureFolder
DisplayInformation | _displayInformation
Windows::Foundation::EventRegistrationToken | _displayInformationEventToken
Windows::System::Display::DisplayRequest | _displayRequest
bool | _externalCamera
Windows::Foundation::EventRegistrationToken | _hardwareCameraButtonEventToken
bool | _isActivePage = false
bool | _isInitialized
bool | _isPreviewing
bool | _isRecording
bool | _isSuspending = false
bool | _isUIActive = false
Platform::Agile
< Windows::Media::Capture::MediaCapture^> 		_mediaCapture
Windows::Foundation::EventRegistrationToken | _mediaCaptureFailedEventToken
Windows::Foundation::EventRegistrationToken | _mediaControlPropChangedEventToken
bool | _mirroringPreview
Windows::Foundation::EventRegistrationToken | _orientationChangedEventToken
SimpleOrientationSensor | _orientationSensor
Windows::Foundation::EventRegistrationToken | _recordLimitationExceededEventToken
CameraRotationHelper _rotationHelper
concurrency::task< void > | _setupTask = concurrency::task_from_result()
Windows::Media::SystemMediaTransportControls | _systemMediaControls
Windows::Foundation::EventRegistrationToken | _windowVisibilityChangedEventToken
const GUID | RotationKey

Detailed Description

Definition at line 21 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~MainPage ( ) [virtual]

Member Function Documentation

static SimpleOrientation AddOrientations | ( | SimpleOrientation | a,
 |  | SimpleOrientation | b |
 | ) |  |  | [static, private]
void Application_Resuming | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void Application_Suspending | ( | Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
CameraRotationHelper ( EnclosureLocation^ cameraEnclosureLocation )
Concurrency::task<void> CleanupCameraAsync ( ) [private]
Concurrency::task<void> CleanupUiAsync ( ) [private]
static SimpleOrientation ConvertClockwiseDegreesToSimpleOrientation ( int orientation ) [static, private]
SimpleOrientation ConvertDisplayOrientationToSimpleOrientation ( DisplayOrientations orientation ) [private]
static int ConvertSimpleOrientationToClockwiseDegrees ( SimpleOrientation orientation ) [static]
static PhotoOrientation ConvertSimpleOrientationToPhotoOrientation ( SimpleOrientation orientation ) [static]
static VideoRotation ConvertSimpleOrientationToVideoRotation ( SimpleOrientation orientation ) [static, private]
void DisplayInformation_OrientationChanged | ( | DisplayInformation^ | sender,
 |  | Object^ | ref |
 | ) |  |  | [private]
Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel panel ) [private]
SimpleOrientation GetCameraCaptureOrientation ( )
SimpleOrientation GetCameraOrientationRelativeToNativeOrientation ( ) [private]
SimpleOrientation GetCameraPreviewOrientation ( )
SimpleOrientation GetUIOrientation ( )
void HardwareButtons_CameraPress | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
void HardwareButtons_CameraPressed | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
Concurrency::task<void> InitializeCameraAsync ( ) [private]
static bool IsEnclosureLocationExternal ( EnclosureLocation^ enclosureLocation ) [static]
MainPage ( )
void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture^ | currentCaptureObject,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs^ | errorEventArgs |
 | ) |  |  | [private]
void MediaCapture_RecordLimitationExceeded ( Windows::Media::Capture::MediaCapture^ currentCaptureObject ) [private]
static SimpleOrientation MirrorOrientation ( SimpleOrientation orientation ) [static, private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void PhotoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> ReencodeAndSavePhotoAsync | ( | Windows::Storage::Streams::IRandomAccessStream^ | stream,
 |  | Windows::Storage::StorageFile^ | file,
 |  | Windows::Storage::FileProperties::PhotoOrientation | photoOrientation |
 | ) |  |  | [private]
void RegisterEventHandlers ( ) [private]
void RotationHelper_OrientationChanged | ( | Object^ | ,
 |  | bool |  |
 | ) |  |  | [private]
Concurrency::task<void> SetPreviewRotationAsync ( ) [private]
Concurrency::task<void> SetUpBasedOnStateAsync ( ) [private]
Concurrency::task<void> SetupUiAsync ( ) [private]
bool ShouldMirrorPreview ( ) [private]
void SimpleOrientationSensor_OrientationChanged | ( | SimpleOrientationSensor^ | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<void> StartPreviewAsync ( ) [private]
Concurrency::task<void> StartRecordingAsync ( ) [private]
Concurrency::task<void> StopPreviewAsync ( ) [private]
Concurrency::task<void> StopRecordingAsync ( ) [private]
static SimpleOrientation SubtractOrientations | ( | SimpleOrientation | a,
 |  | SimpleOrientation | b |
 | ) |  |  | [static, private]
void SystemMediaControls_PropertyChanged | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<void> TakePhotoAsync ( ) [private]
void UnregisterEventHandlers ( ) [private]
void UpdateButtonOrientation ( ) [private]
void UpdateCaptureControls ( ) [private]
void VideoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Window_VisibilityChanged | ( | Object^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | e |
 | ) |  |  | [private]
void WriteException ( Platform::Exception^ ex ) [private]
void WriteLine ( Platform::String^ str ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationResumingEventToken [private]

Definition at line 65 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken [private]

Definition at line 64 of file MainPage.xaml.h.

EnclosureLocation _cameraEnclosureLocation [private]

Definition at line 26 of file CameraRotationHelper.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 61 of file MainPage.xaml.h.

DisplayInformation _displayInformation [private]

Definition at line 27 of file CameraRotationHelper.h.

Windows::Foundation::EventRegistrationToken _displayInformationEventToken [private]

Definition at line 68 of file MainPage.xaml.h.

Windows::System::Display::DisplayRequest _displayRequest [private]

Definition at line 35 of file MainPage.xaml.h.

bool _externalCamera [private]

Definition at line 53 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken [private]

Definition at line 72 of file MainPage.xaml.h.

bool _isActivePage = false [private]

Definition at line 48 of file MainPage.xaml.h.

bool _isInitialized [private]

Definition at line 42 of file MainPage.xaml.h.

bool _isPreviewing [private]

Definition at line 43 of file MainPage.xaml.h.

bool _isRecording [private]

Definition at line 44 of file MainPage.xaml.h.

bool _isSuspending = false [private]

Definition at line 47 of file MainPage.xaml.h.

bool _isUIActive = false [private]

Definition at line 49 of file MainPage.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 41 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 70 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken [private]

Definition at line 67 of file MainPage.xaml.h.

bool _mirroringPreview [private]

Definition at line 54 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _orientationChangedEventToken [private]

Definition at line 71 of file MainPage.xaml.h.

SimpleOrientationSensor _orientationSensor [private]

Definition at line 28 of file CameraRotationHelper.h.

Windows::Foundation::EventRegistrationToken _recordLimitationExceededEventToken [private]

Definition at line 69 of file MainPage.xaml.h.

CameraRotationHelper _rotationHelper [private]

Definition at line 32 of file MainPage.xaml.h.

concurrency::task<void> _setupTask = concurrency::task_from_result() [private]

Definition at line 50 of file MainPage.xaml.h.

Windows::Media::SystemMediaTransportControls _systemMediaControls [private]

Definition at line 38 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _windowVisibilityChangedEventToken [private]

Definition at line 66 of file MainPage.xaml.h.

Windows::Graphics::Imaging::BitmapEncoder Encoder

Definition at line 23 of file MainPage.xaml.h.

Windows::Storage::StorageFile File

Definition at line 24 of file MainPage.xaml.h.

Windows::Storage::FileProperties::PhotoOrientation Orientation

Definition at line 25 of file MainPage.xaml.h.

event EventHandler<bool> OrientationChanged

Definition at line 15 of file CameraRotationHelper.h.

const GUID RotationKey [private]

Definition at line 58 of file MainPage.xaml.h.

The documentation for this class was generated from the following files:
  • CameraStarterKit/cpp/App.xaml.h
  • CameraStarterKit/cpp/CameraRotationHelper.h
  • CameraStarterKit/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraCoordinateMapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • CameraCoordinateMapper
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

CameraCoordinateMapper Class Reference

#include "CameraCoordinateMapper.h"

List of all members.

Public Member Functions

CameraCoordinateMapper (std::shared_ptr< DX::DeviceResources > deviceResources, std::shared_ptr< CameraStreamProcessor > colorStreamProcessor, std::shared_ptr< CameraStreamProcessor > depthStreamProcessor)
bool | AreCamerasStreaming () const
void | CreateDeviceDependentResources ()
float | GetTargetAspectRatio () const
ID3D11ShaderResourceView * | GetTargetShaderResourceView () const
void | ReleaseDeviceDependentResources ()
void | RunCoordinateMapping ()
concurrency::task< void > | StartAsync ()
concurrency::task< void > | StopAsync ()
bool | TryAcquireLatestFrameData ()
void | VisualizeCoordinateMapping (ID3D11RenderTargetView *renderTarget, ID3D11DepthStencilView *depthBuffer, const D3D11_VIEWPORT &viewport, const Windows::Foundation::Numerics::float4x4 &worldToView)

Static Public Member Functions

static concurrency::task
< std::shared_ptr
< CameraCoordinateMapper > > 		CreateAndStartAsync (std::shared_ptr< DX::DeviceResources > deviceResources)

Private Member Functions

void | UpdateColorResources (Windows::Media::Capture::Frames::MediaFrameReference^colorFrame)
void | UpdateDepthResources (Windows::Media::Capture::Frames::MediaFrameReference^depthFrame)

Private Attributes

std::shared_ptr
< CameraStreamProcessor > 		m_colorCameraStreamProcessor
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_colorDistortionMapTexture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_colorDistortionMapTextureSRV
std::optional< uint32_t > | m_colorFrameIndex = {}
GpuCoordinateMapper::CameraIntrinsics m_colorIntrinsics = {}
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_colorTexture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_colorTextureSRV
std::shared_ptr
< CameraStreamProcessor > 		m_depthCameraStreamProcessor
std::optional< uint32_t > | m_depthFrameIndex = {}
GpuCoordinateMapper::CameraIntrinsics m_depthIntrinsics = {}
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_depthTexture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_depthTextureSRV
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_depthUnprojectionMapTexture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_depthUnprojectionMapTextureSRV
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< GpuCoordinateMapper > 		m_gpuCoordinateMapper
GpuCoordinateMapper::RasterizedFrameBlob m_rasterizeFrameBlob = {}
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_targetRasterizedDepthTexture
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		m_targetRasterizedDepthTextureDSV
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_targetRasterizedDepthTextureSRV
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_targetTexture
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_targetTextureRTV
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_targetTextureSRV
GpuCoordinateMapper::VisualizeFrameBlob m_visualizeFrameBlob = {}

Detailed Description

Definition at line 29 of file CameraCoordinateMapper.h.

Constructor & Destructor Documentation

CameraCoordinateMapper | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | std::shared_ptr< CameraStreamProcessor > | colorStreamProcessor,
 |  | std::shared_ptr< CameraStreamProcessor > | depthStreamProcessor
 | ) |  |

Definition at line 151 of file CameraCoordinateMapper.cpp.

                                                                                :
    m_deviceResources(std::move(deviceResources)),
    m_colorCameraStreamProcessor(std::move(colorStreamProcessor)),
    m_depthCameraStreamProcessor(std::move(depthStreamProcessor))
{
    m_gpuCoordinateMapper = std::make_unique<GpuCoordinateMapper>(m_deviceResources);
}

Member Function Documentation

bool AreCamerasStreaming ( ) const

Definition at line 342 of file CameraCoordinateMapper.cpp.

{
    const bool colorIsStreaming = m_colorCameraStreamProcessor && m_colorCameraStreamProcessor->IsStreaming();
    const bool depthIsStreaming = m_depthCameraStreamProcessor && m_depthCameraStreamProcessor->IsStreaming();

    return colorIsStreaming && depthIsStreaming;
}

task< std::shared_ptr< CameraCoordinateMapper > > CreateAndStartAsync ( std::shared_ptr< DX::DeviceResources > deviceResources ) [static]

Definition at line 128 of file CameraCoordinateMapper.cpp.

{
    // Future work: Support more color formats
    std::shared_ptr<CameraStreamProcessor> colorStreamProcessor;
    std::shared_ptr<CameraStreamProcessor> depthStreamProcessor;

    // Creating the camera streams is not required to succeed, if there are failures we display an error message to the user
    try
    {
        colorStreamProcessor = co_await CameraStreamProcessor::CreateAndStartAsync(MediaFrameSourceKind::Color, MediaEncodingSubtypes::Bgra8);
        depthStreamProcessor = co_await CameraStreamProcessor::CreateAndStartAsync(MediaFrameSourceKind::Depth, MediaEncodingSubtypes::D16);
    }
    catch (Platform::Exception^ exception)
    {
        OutputDebugString(exception->Message->Data());
    }

    return std::make_shared<CameraCoordinateMapper>(
        std::move(deviceResources),
        std::move(colorStreamProcessor),
        std::move(depthStreamProcessor));
}

void CreateDeviceDependentResources ( )

Definition at line 159 of file CameraCoordinateMapper.cpp.

{
    m_gpuCoordinateMapper->CreateDeviceDependentResources();
}

float GetTargetAspectRatio ( ) const

Definition at line 355 of file CameraCoordinateMapper.cpp.

{
    return static_cast<float>(m_colorIntrinsics.imageWidth) / static_cast<float>(m_colorIntrinsics.imageHeight);
}

ID3D11ShaderResourceView * GetTargetShaderResourceView ( ) const

Definition at line 350 of file CameraCoordinateMapper.cpp.

{
    return m_targetTextureSRV.Get();
}

void ReleaseDeviceDependentResources ( )

Definition at line 164 of file CameraCoordinateMapper.cpp.

{
    m_depthTexture = nullptr;
    m_depthTextureSRV = nullptr;

    m_colorTexture = nullptr;
    m_colorTextureSRV = nullptr;

    m_targetTexture = nullptr;
    m_targetTextureSRV = nullptr;
    m_targetTextureRTV = nullptr;

    m_targetRasterizedDepthTexture = nullptr;
    m_targetRasterizedDepthTextureDSV = nullptr;
    m_targetRasterizedDepthTextureSRV = nullptr;

    m_depthUnprojectionMapTexture = nullptr;
    m_depthUnprojectionMapTextureSRV = nullptr;

    m_colorDistortionMapTexture = nullptr;
    m_colorDistortionMapTextureSRV = nullptr;

    m_rasterizeFrameBlob = {};
    m_visualizeFrameBlob = {};

    m_depthIntrinsics = {};
    m_colorIntrinsics = {};

    m_depthFrameIndex = {};
    m_colorFrameIndex = {};

    m_gpuCoordinateMapper->ReleaseDeviceDependentResources();
}

void RunCoordinateMapping ( )

Definition at line 319 of file CameraCoordinateMapper.cpp.

{
    m_gpuCoordinateMapper->RunCoordinateMapping(m_rasterizeFrameBlob);
}

task< void > StartAsync ( )

Definition at line 198 of file CameraCoordinateMapper.cpp.

{
    if (m_colorCameraStreamProcessor)
    {
        co_await m_colorCameraStreamProcessor->StartAsync();
    }

    if (m_depthCameraStreamProcessor)
    {
        co_await m_depthCameraStreamProcessor->StartAsync();
    }
}

task< void > StopAsync ( )

Definition at line 211 of file CameraCoordinateMapper.cpp.

{
    if (m_colorCameraStreamProcessor)
    {
        co_await m_colorCameraStreamProcessor->StopAsync();
    }

    if (m_depthCameraStreamProcessor)
    {
        co_await m_depthCameraStreamProcessor->StopAsync();
    }
}

bool TryAcquireLatestFrameData ( )

Definition at line 224 of file CameraCoordinateMapper.cpp.

                                                           {

    if (!m_colorCameraStreamProcessor || !m_depthCameraStreamProcessor)
    {
        return false;
    }

    CameraStreamProcessor::FrameData colorFrameBlob = m_colorCameraStreamProcessor->GetLatestFrame();
    CameraStreamProcessor::FrameData depthFrameBlob = m_depthCameraStreamProcessor->GetLatestFrame();

    MediaFrameReference^ colorFrame = colorFrameBlob.frame;
    MediaFrameReference^ depthFrame = depthFrameBlob.frame;

    // Invalid color or depth frame
    if (!IsValidColorFrame(colorFrame) || !IsValidDepthFrame(depthFrame))
    {
        return false;
    }

    const bool sameColorFrame = m_colorFrameIndex.has_value() && colorFrameBlob.index == m_colorFrameIndex.value();
    const bool sameDepthFrame = m_depthFrameIndex.has_value() && depthFrameBlob.index == m_depthFrameIndex.value();

    // Already processed this frame
    if (sameColorFrame && sameDepthFrame)
    {
        return false;
    }

    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    if (!sameColorFrame)
    {
        UpdateColorResources(colorFrame);
        CopySoftwareBitmapToDirect3DTexture(colorFrame->VideoMediaFrame->SoftwareBitmap, context, m_colorTexture.Get());

        m_rasterizeFrameBlob.sourceIntrinsics = m_colorIntrinsics;
        m_rasterizeFrameBlob.targetIntrinsics = m_colorIntrinsics;

        const float4x4 colorProjectionMatrix = colorFrame->VideoMediaFrame->CameraIntrinsics->UndistortedProjectionTransform;

        m_rasterizeFrameBlob.sourceProjectionMatrix = colorProjectionMatrix;
        m_rasterizeFrameBlob.targetProjectionMatrix = colorProjectionMatrix;
        m_rasterizeFrameBlob.sourceImage = m_colorTextureSRV;
        m_rasterizeFrameBlob.sourceDistortionMap = m_colorDistortionMapTextureSRV;
        m_rasterizeFrameBlob.targetImage = m_targetTextureRTV;
        m_rasterizeFrameBlob.targetRasterizedDepth = m_targetRasterizedDepthTextureDSV;
        m_rasterizeFrameBlob.targetDistortionMap = m_colorDistortionMapTextureSRV;

        m_colorFrameIndex = colorFrameBlob.index;
    }

    if (!sameDepthFrame)
    {
        UpdateDepthResources(depthFrame);
        CopySoftwareBitmapToDirect3DTexture(depthFrame->VideoMediaFrame->SoftwareBitmap, context, m_depthTexture.Get());

        const float depthScaleInMeters = static_cast<float>(depthFrame->VideoMediaFrame->DepthMediaFrame->DepthFormat->DepthScaleInMeters);

        m_rasterizeFrameBlob.depthIntrinsics = m_depthIntrinsics;
        m_rasterizeFrameBlob.depthScaleInMeters = depthScaleInMeters;
        m_rasterizeFrameBlob.depthRangeMinimumInMeters = static_cast<float>(depthFrame->VideoMediaFrame->DepthMediaFrame->MinReliableDepth) * depthScaleInMeters;
        m_rasterizeFrameBlob.depthRangeMaximumInMeters = static_cast<float>(depthFrame->VideoMediaFrame->DepthMediaFrame->MaxReliableDepth) * depthScaleInMeters;
        m_rasterizeFrameBlob.depthImage = m_depthTextureSRV;
        m_rasterizeFrameBlob.depthUnprojectionMap = m_depthUnprojectionMapTextureSRV;

        m_depthFrameIndex = depthFrameBlob.index;
    }

    Platform::IBox<float4x4>^ depthToColorRef = depthFrame->CoordinateSystem->TryGetTransformTo(colorFrame->CoordinateSystem);

    if (depthToColorRef)
    {
        static const float4x4 leftToRight = make_float4x4_scale(1, 1, -1);
        static const float4x4 rightToLeft = leftToRight; // inverse is the same

        // Camera coordinate systems are right-handed with -Z pointing forward out from the camera,
        // but camera intrinsics are left-handed with +Z pointing forward out from the camera.
        // Therefore we need to transform left-handed 3D coordinates from the intrinsics to right-handed
        // and back again when applying the coordinate system transforms which expect right-handed coordinates.
        m_rasterizeFrameBlob.depthToSource = leftToRight * depthToColorRef->Value * rightToLeft;
        m_rasterizeFrameBlob.depthToTarget = leftToRight * depthToColorRef->Value * rightToLeft;
    }
    else
    {
        throw std::exception("These camera frames can't be correlated");
    }

    return true;
}
// If we're too slow while processing frames (i.e. running under a debugger), then we may access a VideoMediaFrame that was already closed.
catch (Platform::ObjectDisposedException^)
{
    return false;
}

void UpdateColorResources ( Windows::Media::Capture::Frames::MediaFrameReference^ colorFrame ) [private]

Definition at line 400 of file CameraCoordinateMapper.cpp.

{
    ID3D11Device* device = m_deviceResources->GetD3DDevice();
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    CameraIntrinsics^ colorIntrinsicsRt = colorFrame->VideoMediaFrame->CameraIntrinsics;
    const GpuCoordinateMapper::CameraIntrinsics colorIntrinsics(colorIntrinsicsRt);

    // Only need to update the internal data if the intrinsics have changed
    if (colorIntrinsics != m_colorIntrinsics)
    {
        // Future work: Support more color formats
        if (colorFrame->VideoMediaFrame->VideoFormat->MediaFrameFormat->Subtype != L"ARGB32")
        {
            throw std::invalid_argument("This video format is not yet supported");
        }

        m_colorTexture = DX::CreateTexture(
            device,
            colorIntrinsics.imageWidth,
            colorIntrinsics.imageHeight,
            DXGI_FORMAT_B8G8R8A8_UNORM,
            std::nullopt,
            D3D11_BIND_SHADER_RESOURCE,
            D3D11_USAGE_DYNAMIC,
            D3D11_CPU_ACCESS_WRITE);

        m_colorTextureSRV = DX::CreateShaderResourceView(m_colorTexture.Get());

        m_colorDistortionMapTexture = GenerateIntrinsicsMapping(device, colorIntrinsicsRt,
            [](CameraIntrinsics^ intrinsics, Point point)
        {
            return intrinsics->DistortPoint(point);
        });

        m_colorDistortionMapTextureSRV = DX::CreateShaderResourceView(m_colorDistortionMapTexture.Get());

        m_targetTexture = DX::CreateTexture(
            device,
            colorIntrinsics.imageWidth,
            colorIntrinsics.imageHeight,
            DXGI_FORMAT_B8G8R8A8_UNORM,
            std::nullopt,
            D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);

        m_targetTextureSRV = DX::CreateShaderResourceView(m_targetTexture.Get());
        m_targetTextureRTV = DX::CreateRenderTargetView(m_targetTexture.Get());

        m_targetRasterizedDepthTexture = DX::CreateTexture(
            device,
            colorIntrinsics.imageWidth,
            colorIntrinsics.imageHeight,
            DXGI_FORMAT_R24G8_TYPELESS,
            std::nullopt,
            D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_DEPTH_STENCIL);

        m_targetRasterizedDepthTextureDSV = DX::CreateDepthStencilView(
            m_targetRasterizedDepthTexture.Get(),
            DXGI_FORMAT_D24_UNORM_S8_UINT);

        m_targetRasterizedDepthTextureSRV = DX::CreateShaderResourceView(
            m_targetRasterizedDepthTexture.Get(),
            DXGI_FORMAT_R24_UNORM_X8_TYPELESS);

        m_visualizeFrameBlob.targetImage = m_targetTextureSRV;
        m_visualizeFrameBlob.targetImageDepthBuffer = m_targetRasterizedDepthTextureSRV;

        m_colorIntrinsics = colorIntrinsics;
    }
}

void UpdateDepthResources ( Windows::Media::Capture::Frames::MediaFrameReference^ depthFrame ) [private]

Definition at line 360 of file CameraCoordinateMapper.cpp.

{
    ID3D11Device* device = m_deviceResources->GetD3DDevice();
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    CameraIntrinsics^ depthIntrinsicsRt = depthFrame->VideoMediaFrame->CameraIntrinsics;
    const GpuCoordinateMapper::CameraIntrinsics depthIntrinsics(depthIntrinsicsRt);

    // Only need to update the internal data if the intrinsics have changed
    if (depthIntrinsics != m_depthIntrinsics)
    {
        if (depthFrame->VideoMediaFrame->VideoFormat->MediaFrameFormat->Subtype != Windows::Media::MediaProperties::MediaEncodingSubtypes::D16)
        {
            throw std::invalid_argument("This depth format is not yet supported");
        }

        m_depthTexture = DX::CreateTexture(
            device,
            depthIntrinsics.imageWidth,
            depthIntrinsics.imageHeight,
            DXGI_FORMAT_R16_UNORM,
            std::nullopt,
            D3D11_BIND_SHADER_RESOURCE,
            D3D11_USAGE_DYNAMIC,
            D3D11_CPU_ACCESS_WRITE);

        m_depthTextureSRV = DX::CreateShaderResourceView(m_depthTexture.Get());

        m_depthUnprojectionMapTexture = GenerateIntrinsicsMapping(device, depthIntrinsicsRt,
            [](CameraIntrinsics^ intrinsics, Point point)
        {
            return intrinsics->UnprojectAtUnitDepth(point);
        });

        m_depthUnprojectionMapTextureSRV = DX::CreateShaderResourceView(m_depthUnprojectionMapTexture.Get());

        m_depthIntrinsics = depthIntrinsics;
    }
}

void VisualizeCoordinateMapping | ( | ID3D11RenderTargetView * | renderTarget,
 |  | ID3D11DepthStencilView * | depthBuffer,
 |  | const D3D11_VIEWPORT & | viewport,
 |  | const Windows::Foundation::Numerics::float4x4 & | worldToView
 | ) |  |

Definition at line 324 of file CameraCoordinateMapper.cpp.

{
    const float aspectRatio = float(viewport.Width) / float(viewport.Height);

    const float4x4 viewToProj = make_float4x4_perspective_field_of_view(DirectX::XMConvertToRadians(90.0f), aspectRatio, 0.001f, 100.0f);

    m_visualizeFrameBlob.renderTarget = renderTarget;
    m_visualizeFrameBlob.renderTargetDepthBuffer = depthBuffer;
    m_visualizeFrameBlob.worldToView = worldToView;
    m_visualizeFrameBlob.viewToProj = viewToProj;
    m_visualizeFrameBlob.viewport = viewport;

    m_gpuCoordinateMapper->VisualizeCoordinateMapping(m_rasterizeFrameBlob, m_visualizeFrameBlob);

    m_visualizeFrameBlob.renderTargetDepthBuffer = nullptr;
    m_visualizeFrameBlob.renderTarget = nullptr;
}

Member Data Documentation

std::shared_ptr<CameraStreamProcessor> m_colorCameraStreamProcessor [private]

Definition at line 65 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_colorDistortionMapTexture [private]

Definition at line 86 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_colorDistortionMapTextureSRV [private]

Definition at line 87 of file CameraCoordinateMapper.h.

std::optional<uint32_t> m_colorFrameIndex = {} [private]

Definition at line 96 of file CameraCoordinateMapper.h.

GpuCoordinateMapper::CameraIntrinsics m_colorIntrinsics = {} [private]

Definition at line 93 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_colorTexture [private]

Definition at line 72 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_colorTextureSRV [private]

Definition at line 73 of file CameraCoordinateMapper.h.

std::shared_ptr<CameraStreamProcessor> m_depthCameraStreamProcessor [private]

Definition at line 66 of file CameraCoordinateMapper.h.

std::optional<uint32_t> m_depthFrameIndex = {} [private]

Definition at line 95 of file CameraCoordinateMapper.h.

GpuCoordinateMapper::CameraIntrinsics m_depthIntrinsics = {} [private]

Definition at line 92 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_depthTexture [private]

Definition at line 69 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_depthTextureSRV [private]

Definition at line 70 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_depthUnprojectionMapTexture [private]

Definition at line 83 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_depthUnprojectionMapTextureSRV [private]

Definition at line 84 of file CameraCoordinateMapper.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 63 of file CameraCoordinateMapper.h.

std::unique_ptr<GpuCoordinateMapper> m_gpuCoordinateMapper [private]

Definition at line 67 of file CameraCoordinateMapper.h.

GpuCoordinateMapper::RasterizedFrameBlob m_rasterizeFrameBlob = {} [private]

Definition at line 89 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_targetRasterizedDepthTexture [private]

Definition at line 79 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_targetRasterizedDepthTextureDSV [private]

Definition at line 80 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_targetRasterizedDepthTextureSRV [private]

Definition at line 81 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_targetTexture [private]

Definition at line 75 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_targetTextureRTV [private]

Definition at line 77 of file CameraCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_targetTextureSRV [private]

Definition at line 76 of file CameraCoordinateMapper.h.

GpuCoordinateMapper::VisualizeFrameBlob m_visualizeFrameBlob = {} [private]

Definition at line 90 of file CameraCoordinateMapper.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.h
  • CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapperMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • CameraStreamCoordinateMapperMain
Public Member Functions | Private Attributes

CameraStreamCoordinateMapperMain Class Reference

#include "CameraStreamCoordinateMapperMain.h"

List of all members.

Public Member Functions

CameraStreamCoordinateMapperMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~CameraStreamCoordinateMapperMain ()
concurrency::task< void > | CreateResourcesAsync ()
void | CreateWindowSizeDependentResources ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | OnResuming ()
concurrency::task< void > | OnSuspendingAsync ()
bool | Render ()
void | Update ()

Private Attributes

FirstPersonCamera | m_camera
std::shared_ptr
< CameraCoordinateMapper > 		m_cameraCoordinateMapper
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_freeRoamCameraEnabled = true
std::unique_ptr
< DX::GpuPerformanceTimer > 		m_gpuPerformanceTimer
std::unique_ptr< TextRenderer > | m_helpTextRenderer
std::unique_ptr< QuadRenderer > | m_quadRenderer
bool | m_readyToRender = false
bool | m_showHelpText = false
std::unique_ptr< TextRenderer > | m_statisticsTextRenderer
bool | m_streamingEnabled = true
DX::StepTimer m_timer

Detailed Description

Definition at line 32 of file CameraStreamCoordinateMapperMain.h.

Constructor & Destructor Documentation

CameraStreamCoordinateMapperMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 39 of file CameraStreamCoordinateMapperMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    m_camera = ref new FirstPersonCamera();

    m_gpuPerformanceTimer = std::make_unique<DX::GpuPerformanceTimer>(m_deviceResources);
    m_quadRenderer = std::make_unique<QuadRenderer>(m_deviceResources);
    m_statisticsTextRenderer = std::make_unique<TextRenderer>(m_deviceResources);
    m_helpTextRenderer = std::make_unique<TextRenderer>(m_deviceResources);

    static constexpr const wchar_t* c_HelpTextDisabledStr =
        L"'F1' or 'Gamepad Menu' to toggle help \n";

    static constexpr const wchar_t* c_HelpTextEnabledStr =
        L"'F1' or 'Gamepad Menu' to toggle help \n"
        L"'Space' or 'Gamepad A' to toggle streaming \n"
        L"'R' or 'Left Thumbstick' to reset the camera \n"
        L"'Y' or 'Gamepad Y' to toggle camera mode \n"
        L"'W/A/S/D/Q/E' to translate the free-roam camera \n"
        L"'Left thumbstick' to translate the free-roam camera \n"
        L"'Left mouse button' to rotate the free-roam camera \n"
        L"'Right thumbstick' to rotate the free-roam camera \n";

    m_helpTextRenderer->Update(c_HelpTextDisabledStr);

    CoreWindow::GetForCurrentThread()->KeyDown +=
        ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>([this](CoreWindow^ window, KeyEventArgs^ args)
    {
        if (args->VirtualKey == Windows::System::VirtualKey::Space ||
            args->VirtualKey == Windows::System::VirtualKey::GamepadA)
        {
            m_streamingEnabled = !m_streamingEnabled;
        }

        if (args->VirtualKey == Windows::System::VirtualKey::R ||
            args->VirtualKey == Windows::System::VirtualKey::GamepadLeftThumbstickButton)
        {
            m_camera->Reset();
        }

        if (args->VirtualKey == Windows::System::VirtualKey::Y ||
            args->VirtualKey == Windows::System::VirtualKey::GamepadY)
        {
            m_freeRoamCameraEnabled = !m_freeRoamCameraEnabled;
            m_camera->Reset();
        }

        if (args->VirtualKey == Windows::System::VirtualKey::F1 ||
            args->VirtualKey == Windows::System::VirtualKey::GamepadMenu)
        {
            m_showHelpText = !m_showHelpText;

            if (m_showHelpText)
            {
                m_helpTextRenderer->Update(c_HelpTextEnabledStr);
            }
            else
            {
                m_helpTextRenderer->Update(c_HelpTextDisabledStr);
            }
        }
    });

    CreateResourcesAsync().then([this]
    {
        m_readyToRender = true;
    });

    // Register to be notified if the Device is lost or recreated
    m_deviceResources->RegisterDeviceNotify(this);
}

~CameraStreamCoordinateMapperMain ( )

Definition at line 116 of file CameraStreamCoordinateMapperMain.cpp.

{
    // Deregister device notification
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

task< void > CreateResourcesAsync ( )

Definition at line 111 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_cameraCoordinateMapper = co_await CameraCoordinateMapper::CreateAndStartAsync(m_deviceResources);
}

void CreateWindowSizeDependentResources ( )

Definition at line 123 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_quadRenderer->CreateWindowSizeDependentResources();
}

void OnDeviceLost ( ) [virtual]

Definition at line 241 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_readyToRender = false;

    m_quadRenderer->ReleaseDeviceDependentResources();
    m_statisticsTextRenderer->ReleaseDeviceDependentResources();
    m_helpTextRenderer->ReleaseDeviceDependentResources();
    m_cameraCoordinateMapper->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 252 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_cameraCoordinateMapper->CreateDeviceDependentResources();
    m_helpTextRenderer->CreateDeviceDependentResources();
    m_statisticsTextRenderer->CreateDeviceDependentResources();
    m_quadRenderer->CreateDeviceDependentResources();

    CreateWindowSizeDependentResources();

    m_readyToRender = true;
}

void OnResuming ( )

Definition at line 232 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_cameraCoordinateMapper->StartAsync().then([this]
    {
        m_readyToRender = true;
    });
}

task< void > OnSuspendingAsync ( )

Definition at line 226 of file CameraStreamCoordinateMapperMain.cpp.

{
    m_readyToRender = false;
    return m_cameraCoordinateMapper->StopAsync();
}

bool Render ( )

Definition at line 176 of file CameraStreamCoordinateMapperMain.cpp.

{
    if (!m_readyToRender)
    {
        return false;
    }

    if (m_freeRoamCameraEnabled && m_cameraCoordinateMapper->AreCamerasStreaming())
    {
        m_cameraCoordinateMapper->VisualizeCoordinateMapping(
            m_deviceResources->GetBackBufferRenderTargetView(),
            m_deviceResources->GetDepthStencilView(),
            m_deviceResources->GetScreenViewport(),
            m_camera->GetWorldToCamera());
    }
    else
    {
        ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

        // Reset the viewport to target the whole screen.
        const D3D11_VIEWPORT viewport = m_deviceResources->GetScreenViewport();
        context->RSSetViewports(1, &viewport);

        // Reset render targets to the screen.
        ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetView() };
        context->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());

        // Clear the back imageBuffer and depth stencil view.
        context->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetView(), DirectX::Colors::CornflowerBlue);
        context->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

        if (m_cameraCoordinateMapper->AreCamerasStreaming())
        {
            ID3D11ShaderResourceView* targetTexture = m_cameraCoordinateMapper->GetTargetShaderResourceView();
            const float targetAspectRatio = m_cameraCoordinateMapper->GetTargetAspectRatio();

            // Render the resulting target image as a quad
            if (targetTexture)
            {
                m_quadRenderer->Render(targetTexture, targetAspectRatio);
            }
        }
    }

    m_statisticsTextRenderer->Render(TextRenderer::TextAlignment::BottomRight);
    m_helpTextRenderer->Render(TextRenderer::TextAlignment::TopLeft);

    return true;
}

void Update ( )

Definition at line 129 of file CameraStreamCoordinateMapperMain.cpp.

{
    if (!m_readyToRender)
    {
        return;
    }

    // Update scene objects.
    m_timer.Tick([&]()
    {
        m_camera->Update(static_cast<float>(m_timer.GetElapsedSeconds()));

        if (m_cameraCoordinateMapper->AreCamerasStreaming())
        {
            static wchar_t buffer[256] = {};

            const wchar_t* cameraModeStr = m_freeRoamCameraEnabled ? L"[Free-roam camera]" : L"[Target camera]";
            const wchar_t* streamingModeStr = m_streamingEnabled ? L"[Streaming]" : L"[Paused]";
            const float gpuTime = m_gpuPerformanceTimer->GetAvgFrameTime();

            swprintf_s(buffer, L"%s %s [Gpu time: %.3fms] [FPS: %.4u]", streamingModeStr, cameraModeStr, gpuTime, m_timer.GetFramesPerSecond());

            m_statisticsTextRenderer->Update(buffer);
        }
        else
        {
            m_statisticsTextRenderer->Update(L"No compatible/accessible was camera found\nEnsure the application has permission to access the camera");
        }
    });

    if (!m_streamingEnabled)
    {
        return;
    }

    if (m_cameraCoordinateMapper->TryAcquireLatestFrameData())
    {
        m_gpuPerformanceTimer->StartTimerForFrame();

        m_cameraCoordinateMapper->RunCoordinateMapping();

        m_gpuPerformanceTimer->EndTimerForFrame();
    }
}

Member Data Documentation

FirstPersonCamera m_camera [private]

Definition at line 55 of file CameraStreamCoordinateMapperMain.h.

std::shared_ptr<CameraCoordinateMapper> m_cameraCoordinateMapper [private]

Definition at line 62 of file CameraStreamCoordinateMapperMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 51 of file CameraStreamCoordinateMapperMain.h.

bool m_freeRoamCameraEnabled = true [private]

Definition at line 65 of file CameraStreamCoordinateMapperMain.h.

std::unique_ptr<DX::GpuPerformanceTimer> m_gpuPerformanceTimer [private]

Definition at line 61 of file CameraStreamCoordinateMapperMain.h.

std::unique_ptr<TextRenderer> m_helpTextRenderer [private]

Definition at line 59 of file CameraStreamCoordinateMapperMain.h.

std::unique_ptr<QuadRenderer> m_quadRenderer [private]

Definition at line 57 of file CameraStreamCoordinateMapperMain.h.

bool m_readyToRender = false [private]

Definition at line 67 of file CameraStreamCoordinateMapperMain.h.

bool m_showHelpText = false [private]

Definition at line 66 of file CameraStreamCoordinateMapperMain.h.

std::unique_ptr<TextRenderer> m_statisticsTextRenderer [private]

Definition at line 58 of file CameraStreamCoordinateMapperMain.h.

bool m_streamingEnabled = true [private]

Definition at line 64 of file CameraStreamCoordinateMapperMain.h.

DX::StepTimer m_timer [private]

Definition at line 53 of file CameraStreamCoordinateMapperMain.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.h
  • CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamProcessor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • CameraStreamProcessor
Classes | Public Member Functions | Static Public Member Functions | Private Attributes

CameraStreamProcessor Class Reference

#include "CameraStreamProcessor.h"

List of all members.

Classes

struct | FrameData

Public Member Functions

CameraStreamProcessor (Windows::Media::Capture::Frames::MediaFrameSourceKind sourceKind, Platform::String^format, Windows::Media::Capture::MediaCaptureMemoryPreference memoryPreference)
~CameraStreamProcessor ()
FrameData | GetLatestFrame () const
bool | IsStreaming () const
void | OnFrameArrived (Windows::Media::Capture::Frames::MediaFrameReader^sender, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args)
concurrency::task< void > | StartAsync ()
concurrency::task< void > | StopAsync ()

Static Public Member Functions

static Concurrency::task
< std::shared_ptr
< CameraStreamProcessor > > 		CreateAndStartAsync (Windows::Media::Capture::Frames::MediaFrameSourceKind sourceKind, Platform::String^format, Windows::Media::Capture::MediaCaptureMemoryPreference memoryPreference=Windows::Media::Capture::MediaCaptureMemoryPreference::Cpu)

Private Attributes

Windows::Foundation::EventRegistrationToken | m_frameArrivedToken
uint32_t | m_frameCount = 0u
std::atomic< bool > | m_isStreaming = false
FrameData m_latestFrameData
std::shared_mutex | m_lock
Platform::Agile
< Windows::Media::Capture::MediaCapture > 		m_mediaCapture
Windows::Media::Capture::Frames::MediaFrameReader | m_mediaFrameReader
Windows::Media::Capture::MediaCaptureMemoryPreference | m_memoryPreference
Platform::String | m_sourceFormat
Windows::Media::Capture::Frames::MediaFrameSourceKind | m_sourceKind

Detailed Description

Definition at line 25 of file CameraStreamProcessor.h.

Constructor & Destructor Documentation

CameraStreamProcessor | ( | Windows::Media::Capture::Frames::MediaFrameSourceKind | sourceKind,
 |  | Platform::String^ | format,
 |  | Windows::Media::Capture::MediaCaptureMemoryPreference | memoryPreference
 | ) |  |
~CameraStreamProcessor ( )

Definition at line 49 of file CameraStreamProcessor.cpp.

{
    std::lock_guard<std::shared_mutex> lock(m_lock);
    m_mediaFrameReader->FrameArrived -= m_frameArrivedToken;
}

Member Function Documentation

static Concurrency::task<std::shared_ptr<CameraStreamProcessor> > CreateAndStartAsync | ( | Windows::Media::Capture::Frames::MediaFrameSourceKind | sourceKind,
 |  | Platform::String^ | format,
 |  | Windows::Media::Capture::MediaCaptureMemoryPreference | memoryPreference = Windows::Media::Capture::MediaCaptureMemoryPreference::Cpu |
 | ) |  |  | [static]
CameraStreamProcessor::FrameData GetLatestFrame ( void ) const

Definition at line 55 of file CameraStreamProcessor.cpp.

{
    auto lock = std::shared_lock<std::shared_mutex>(m_lock);
    return m_latestFrameData;
}

bool IsStreaming ( ) const

Definition at line 144 of file CameraStreamProcessor.cpp.

{
    return m_isStreaming;
}

void OnFrameArrived | ( | Windows::Media::Capture::Frames::MediaFrameReader^ | sender,
 |  | Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^ | args
 | ) |  |
task< void > StartAsync ( )

Definition at line 61 of file CameraStreamProcessor.cpp.

{
    IVectorView<MediaFrameSourceGroup^>^ groups = co_await MediaFrameSourceGroup::FindAllAsync();

    MediaFrameSourceGroup^ selectedGroup;
    MediaFrameSourceInfo^ selectedSourceInfo;

    // Pick the first group and first matching source from that group
    for (MediaFrameSourceGroup^ group : groups)
    {
        for (MediaFrameSourceInfo^ sourceInfo : group->SourceInfos)
        {
            if (sourceInfo->SourceKind == m_sourceKind)
            {
                selectedSourceInfo = sourceInfo;
                break;
            }
        }

        if (selectedSourceInfo != nullptr)
        {
            selectedGroup = group;
            break;
        }
    }

    if (selectedGroup == nullptr || selectedSourceInfo == nullptr)
    {
        OutputDebugString(L"Warning: No source found that matched the requested parameters\n");
        co_return;
    }

    MediaCaptureInitializationSettings^ settings = ref new MediaCaptureInitializationSettings();
    settings->MemoryPreference = m_memoryPreference;
    settings->StreamingCaptureMode = StreamingCaptureMode::Video;
    settings->SourceGroup = selectedGroup;
    settings->SharingMode = MediaCaptureSharingMode::SharedReadOnly;

    Platform::Agile<MediaCapture> mediaCapture(ref new MediaCapture());

    co_await mediaCapture->InitializeAsync(settings);

    MediaFrameSource^ selectedSource = mediaCapture->FrameSources->Lookup(selectedSourceInfo->Id);

    MediaFrameReader^ reader = co_await mediaCapture->CreateFrameReaderAsync(selectedSource, m_sourceFormat);

    MediaFrameReaderStartStatus status = co_await reader->StartAsync();

    if (status == MediaFrameReaderStartStatus::Success)
    {
        std::lock_guard<std::shared_mutex> lock(m_lock);

        m_mediaCapture = std::move(mediaCapture);
        m_mediaFrameReader = std::move(reader);

        m_frameArrivedToken = m_mediaFrameReader->FrameArrived +=
            ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(
                std::bind(&CameraStreamProcessor::OnFrameArrived, this, _1, _2));

        m_isStreaming = true;
    }
    else
    {
        OutputDebugString(L"Warning: Reader failed to start\n");
    }
}

task< void > StopAsync ( )

Definition at line 128 of file CameraStreamProcessor.cpp.

{
    m_isStreaming = false;

    std::lock_guard<std::shared_mutex> lock(m_lock);

    m_mediaFrameReader->FrameArrived -= m_frameArrivedToken;
    co_await m_mediaFrameReader->StopAsync();

    m_mediaFrameReader = nullptr;
    m_mediaCapture = nullptr;
    m_latestFrameData = {};
    m_frameArrivedToken = {};
    m_frameCount = 0u;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_frameArrivedToken [private]

Definition at line 72 of file CameraStreamProcessor.h.

uint32_t m_frameCount = 0u [private]

Definition at line 74 of file CameraStreamProcessor.h.

std::atomic<bool> m_isStreaming = false [private]

Definition at line 68 of file CameraStreamProcessor.h.

FrameData m_latestFrameData [private]

Definition at line 70 of file CameraStreamProcessor.h.

std::shared_mutex m_lock [mutable, private]

Definition at line 66 of file CameraStreamProcessor.h.

Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCapture [private]

Definition at line 63 of file CameraStreamProcessor.h.

Windows::Media::Capture::Frames::MediaFrameReader m_mediaFrameReader [private]

Definition at line 64 of file CameraStreamProcessor.h.

Windows::Media::Capture::MediaCaptureMemoryPreference m_memoryPreference [private]

Definition at line 61 of file CameraStreamProcessor.h.

Platform::String m_sourceFormat [private]

Definition at line 60 of file CameraStreamProcessor.h.

Windows::Media::Capture::Frames::MediaFrameSourceKind m_sourceKind [private]

Definition at line 59 of file CameraStreamProcessor.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.h
  • CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamProcessor::FrameData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • CameraStreamProcessor
  • CameraStreamProcessor::FrameData
Public Attributes

CameraStreamProcessor::FrameData Struct Reference

#include "CameraStreamProcessor.h"

List of all members.

Public Attributes

Windows::Media::Capture::Frames::MediaFrameReference | frame
uint32_t | index

Detailed Description

Definition at line 28 of file CameraStreamProcessor.h.

Member Data Documentation

Windows::Media::Capture::Frames::MediaFrameReference frame

Definition at line 30 of file CameraStreamProcessor.h.

uint32_t index

Definition at line 31 of file CameraStreamProcessor.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GpuCoordinateMapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • GpuCoordinateMapper
Classes | Public Member Functions | Private Attributes

GpuCoordinateMapper Class Reference

#include "GpuCoordinateMapper.h"

List of all members.

Classes

struct | CameraIntrinsics
struct | RasterizedFrameBlob
struct | VisualizeFrameBlob

Public Member Functions

GpuCoordinateMapper (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | RunCoordinateMapping (const RasterizedFrameBlob &frameBlob)
void | VisualizeCoordinateMapping (const RasterizedFrameBlob &rasterizedFrameBlob, const VisualizeFrameBlob &visualizeFrameBlob)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_rasterizeDepthMeshConstants
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_rasterizeDepthMeshInputLayout
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_rasterizeDepthMeshPixelShader
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_rasterizeDepthMeshVertexShader
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerState
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
uint32_t | m_vertexCount
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_visualizeDepthMeshConstants
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_visualizeDepthMeshInputLayout
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_visualizeDepthMeshPixelShader
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_visualizeDepthMeshVertexShader

Detailed Description

Definition at line 33 of file GpuCoordinateMapper.h.

Constructor & Destructor Documentation

GpuCoordinateMapper ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 70 of file GpuCoordinateMapper.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 76 of file GpuCoordinateMapper.cpp.

{
    ID3D11Device* device = m_deviceResources->GetD3DDevice();

    static const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
    {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    };

    m_rasterizeDepthMeshVertexShader = DX::CreateVertexShader(
        device,
        g_RasterizeDepthMeshVS,
        _countof(g_RasterizeDepthMeshVS));

    m_rasterizeDepthMeshInputLayout = DX::CreateInputLayout(
        device,
        vertexDesc,
        _countof(vertexDesc),
        g_RasterizeDepthMeshVS,
        _countof(g_RasterizeDepthMeshVS));

    m_rasterizeDepthMeshPixelShader = DX::CreatePixelShader(
        device,
        g_RasterizeDepthMeshPS,
        _countof(g_RasterizeDepthMeshPS));

    m_visualizeDepthMeshVertexShader = DX::CreateVertexShader(
        device,
        g_VisualizeDepthMeshVS,
        _countof(g_VisualizeDepthMeshVS));

    m_visualizeDepthMeshInputLayout = DX::CreateInputLayout(
        device,
        vertexDesc,
        _countof(vertexDesc),
        g_VisualizeDepthMeshVS,
        _countof(g_VisualizeDepthMeshVS));

    m_visualizeDepthMeshPixelShader = DX::CreatePixelShader(
        device,
        g_VisualizeDepthMeshPS,
        _countof(g_VisualizeDepthMeshPS));

    m_rasterizeDepthMeshConstants = DX::CreateBuffer(
        device,
        sizeof(RasterizeDepthMeshConstants_Shader),
        nullptr,
        D3D11_BIND_CONSTANT_BUFFER);

    m_visualizeDepthMeshConstants = DX::CreateBuffer(
        device,
        sizeof(VisualizeDepthMeshConstants_Shader),
        nullptr,
        D3D11_BIND_CONSTANT_BUFFER);

    m_samplerState = DX::CreateSamplerState(device);

    static const float4 quadVertices[] = {
        float4(-1.0f, +1.0f, 0.0f, 1.0f), // top left
        float4(+1.0f, +1.0f, 0.0f, 1.0f), // top right
        float4(-1.0f, -1.0f, 0.0f, 1.0f), // bottom left

        float4(+1.0f, +1.0f, 0.0f, 1.0f), // top right
        float4(+1.0f, -1.0f, 0.0f, 1.0f), // bottom right
        float4(-1.0f, -1.0f, 0.0f, 1.0f), // bottom left
    };

    m_vertexCount = _countof(quadVertices);

    m_vertexBuffer = DX::CreateBuffer(
        device,
        sizeof(quadVertices),
        quadVertices,
        D3D11_BIND_VERTEX_BUFFER);
}

void ReleaseDeviceDependentResources ( )

Definition at line 152 of file GpuCoordinateMapper.cpp.

{
    m_rasterizeDepthMeshVertexShader = nullptr;
    m_rasterizeDepthMeshInputLayout = nullptr;
    m_rasterizeDepthMeshPixelShader = nullptr;

    m_visualizeDepthMeshVertexShader = nullptr;
    m_visualizeDepthMeshInputLayout = nullptr;
    m_visualizeDepthMeshPixelShader = nullptr;

    m_rasterizeDepthMeshConstants = nullptr;
    m_visualizeDepthMeshConstants = nullptr;
    m_vertexBuffer = nullptr;
    m_samplerState = nullptr;
}

void RunCoordinateMapping ( const RasterizedFrameBlob & frameBlob )

Definition at line 184 of file GpuCoordinateMapper.cpp.

{
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    const RasterizeDepthMeshConstants_Shader constants = GetRasterizeDepthMeshConstantsForShader(frameBlob);

    context->UpdateSubresource(m_rasterizeDepthMeshConstants.Get(), 0, nullptr, &constants, 0, 0);

    context->ClearRenderTargetView(frameBlob.targetImage.Get(), DirectX::Colors::Black);
    context->ClearDepthStencilView(frameBlob.targetRasterizedDepth.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0);

    ////////////////////////////////////////////////////////////////////////////////
    // Input Assembler + Rasterizer
    const UINT stride = sizeof(float4);
    const UINT offset = 0;
    context->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_rasterizeDepthMeshInputLayout.Get());

    const D3D11_VIEWPORT viewport = CD3D11_VIEWPORT(
        0.0f,
        0.0f,
        static_cast<float>(frameBlob.targetIntrinsics.imageWidth),
        static_cast<float>(frameBlob.targetIntrinsics.imageHeight)
    );

    context->RSSetViewports(1, &viewport);

    ////////////////////////////////////////////////////////////////////////////////
    // Vertex Shader
    context->VSSetShader(m_rasterizeDepthMeshVertexShader.Get(), nullptr, 0);

    ID3D11Buffer* vertexConstantBuffers[] = {
        m_rasterizeDepthMeshConstants.Get()
    };

    context->VSSetConstantBuffers(0, 1, m_rasterizeDepthMeshConstants.GetAddressOf());

    ID3D11ShaderResourceView* vertexShaderResources[] = {
        frameBlob.depthImage.Get(),           // Depth Texture
        frameBlob.depthUnprojectionMap.Get(), // Depth Unprojection Map
        frameBlob.sourceDistortionMap.Get(),  // Source Distortion Map
        frameBlob.targetDistortionMap.Get()   // Target Distortion Map
    };

    context->VSSetShaderResources(0, _countof(vertexShaderResources), vertexShaderResources);
    context->VSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    ////////////////////////////////////////////////////////////////////////////////
    // Pixel Shader
    context->PSSetShader(m_rasterizeDepthMeshPixelShader.Get(), nullptr, 0);

    ID3D11ShaderResourceView* pixelShaderResources[] = {
        frameBlob.sourceImage.Get() // Source Texture
    };

    context->PSSetShaderResources(0, _countof(pixelShaderResources), pixelShaderResources);
    context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    ////////////////////////////////////////////////////////////////////////////////
    // Output Merger
    ID3D11RenderTargetView* outputRenderTargets[] = {
        frameBlob.targetImage.Get() // Target Texture
    };

    context->OMSetRenderTargets(_countof(outputRenderTargets), outputRenderTargets, frameBlob.targetRasterizedDepth.Get());

    ////////////////////////////////////////////////////////////////////////////////
    // Render
    const uint32_t instanceCount = (frameBlob.depthIntrinsics.imageWidth - 1) * (frameBlob.depthIntrinsics.imageHeight - 1);

    context->DrawInstanced(m_vertexCount, instanceCount, 0, 0);

    ////////////////////////////////////////////////////////////////////////////////
    // Cleanup: Unbind resources that might be used in later passes
    decltype(outputRenderTargets) null_outputRenderTargets = { nullptr };
    context->OMSetRenderTargets(_countof(null_outputRenderTargets), null_outputRenderTargets, nullptr);

    decltype(pixelShaderResources) null_pixelShaderResources = { nullptr };
    context->PSSetShaderResources(0, _countof(null_pixelShaderResources), null_pixelShaderResources);

    decltype(vertexShaderResources) null_vertexShaderResources = { nullptr };
    context->VSSetShaderResources(0, _countof(null_vertexShaderResources), null_vertexShaderResources);
}

void VisualizeCoordinateMapping | ( | const RasterizedFrameBlob & | rasterizedFrameBlob,
 |  | const VisualizeFrameBlob & | visualizeFrameBlob
 | ) |  |

Definition at line 286 of file GpuCoordinateMapper.cpp.

{
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    const RasterizeDepthMeshConstants_Shader rasterizeConstants = GetRasterizeDepthMeshConstantsForShader(rasterizedFrameBlob);
    context->UpdateSubresource(m_rasterizeDepthMeshConstants.Get(), 0, nullptr, &rasterizeConstants, 0, 0);

    const VisualizeDepthMeshConstants_Shader visualizeConstants = GetVisualizeDepthMeshConstantsForShader(visualizeFrameBlob);
    context->UpdateSubresource(m_visualizeDepthMeshConstants.Get(), 0, nullptr, &visualizeConstants, 0, 0);

    context->ClearRenderTargetView(visualizeFrameBlob.renderTarget.Get(), DirectX::Colors::Black);
    context->ClearDepthStencilView(visualizeFrameBlob.renderTargetDepthBuffer.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0);

    ////////////////////////////////////////////////////////////////////////////////
    // Input Assembler + Rasterizer
    const UINT stride = sizeof(float4);
    const UINT offset = 0;
    context->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_rasterizeDepthMeshInputLayout.Get());

    context->RSSetViewports(1, &visualizeFrameBlob.viewport);

    ////////////////////////////////////////////////////////////////////////////////
    // Vertex Shader
    context->VSSetShader(m_visualizeDepthMeshVertexShader.Get(), nullptr, 0);

    ID3D11Buffer* const vertexConstantBuffers[] = {
        m_rasterizeDepthMeshConstants.Get(),
        m_visualizeDepthMeshConstants.Get()
    };

    context->VSSetConstantBuffers(0, _countof(vertexConstantBuffers), vertexConstantBuffers);

    ID3D11ShaderResourceView* const vertexShaderResources[] = {
        rasterizedFrameBlob.depthImage.Get(),           // Depth Texture
        rasterizedFrameBlob.depthUnprojectionMap.Get(), // Depth Unprojection Map
        rasterizedFrameBlob.targetDistortionMap.Get()   // Target Distortion Map
    };

    context->VSSetShaderResources(0, _countof(vertexShaderResources), vertexShaderResources);
    context->VSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    ////////////////////////////////////////////////////////////////////////////////
    // Pixel Shader
    context->PSSetShader(m_visualizeDepthMeshPixelShader.Get(), nullptr, 0);

    ID3D11Buffer* const pixelConstantBuffers[] = {
        m_rasterizeDepthMeshConstants.Get()
    };

    context->PSSetConstantBuffers(0, _countof(pixelConstantBuffers), pixelConstantBuffers);

    ID3D11ShaderResourceView* const pixelShaderResources[] = {
        visualizeFrameBlob.targetImage.Get(),           // Target Texture
        visualizeFrameBlob.targetImageDepthBuffer.Get() // Target Depth Buffer
    };

    context->PSSetShaderResources(0, _countof(pixelShaderResources), pixelShaderResources);
    context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    ////////////////////////////////////////////////////////////////////////////////
    // Output Merger
    ID3D11RenderTargetView* const outputRenderTargets[] = {
        visualizeFrameBlob.renderTarget.Get()
    };

    context->OMSetRenderTargets(_countof(outputRenderTargets), outputRenderTargets, visualizeFrameBlob.renderTargetDepthBuffer.Get());

    ////////////////////////////////////////////////////////////////////////////////
    // Render
    const uint32_t instanceCount = (rasterizedFrameBlob.depthIntrinsics.imageWidth - 1) * (rasterizedFrameBlob.depthIntrinsics.imageHeight - 1);

    context->DrawInstanced(m_vertexCount, instanceCount, 0, 0);

    ////////////////////////////////////////////////////////////////////////////////
    // Cleanup: Unbind resources that might be used in later passes
    decltype(outputRenderTargets) null_outputRenderTargets = { nullptr };
    context->OMSetRenderTargets(_countof(null_outputRenderTargets), null_outputRenderTargets, nullptr);

    decltype(pixelShaderResources) null_pixelShaderResources = { nullptr };
    context->PSSetShaderResources(0, _countof(null_pixelShaderResources), null_pixelShaderResources);

    decltype(vertexShaderResources) null_vertexShaderResources = { nullptr };
    context->VSSetShaderResources(0, _countof(null_vertexShaderResources), null_vertexShaderResources);
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 117 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_rasterizeDepthMeshConstants [private]

Definition at line 127 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_rasterizeDepthMeshInputLayout [private]

Definition at line 120 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_rasterizeDepthMeshPixelShader [private]

Definition at line 121 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_rasterizeDepthMeshVertexShader [private]

Definition at line 119 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState [private]

Definition at line 130 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 129 of file GpuCoordinateMapper.h.

uint32_t m_vertexCount [private]

Definition at line 132 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_visualizeDepthMeshConstants [private]

Definition at line 128 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_visualizeDepthMeshInputLayout [private]

Definition at line 124 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_visualizeDepthMeshPixelShader [private]

Definition at line 125 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_visualizeDepthMeshVertexShader [private]

Definition at line 123 of file GpuCoordinateMapper.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h
  • CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GpuCoordinateMapper::CameraIntrinsics Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • GpuCoordinateMapper
  • GpuCoordinateMapper::CameraIntrinsics
Public Member Functions | Public Attributes

GpuCoordinateMapper::CameraIntrinsics Struct Reference

#include "GpuCoordinateMapper.h"

List of all members.

Public Member Functions

CameraIntrinsics ()
CameraIntrinsics (Windows::Media::Devices::Core::CameraIntrinsics^intrinsics)
bool | operator!= (const CameraIntrinsics &rhs) const

Public Attributes

Windows::Foundation::Numerics::float2 focalLength
uint32_t | imageHeight
uint32_t | imageWidth
Windows::Foundation::Numerics::float2 principalPoint
Windows::Foundation::Numerics::float3 radialDistortion
Windows::Foundation::Numerics::float2 tangentialDistortion

Detailed Description

Definition at line 41 of file GpuCoordinateMapper.h.

Constructor & Destructor Documentation

CameraIntrinsics ( )
CameraIntrinsics ( Windows::Media::Devices::Core::CameraIntrinsics^ intrinsics ) [inline, explicit]

Definition at line 45 of file GpuCoordinateMapper.h.

                                                                                :
                imageWidth(intrinsics->ImageWidth),
                imageHeight(intrinsics->ImageHeight),
                principalPoint(intrinsics->PrincipalPoint),
                focalLength(intrinsics->FocalLength),
                radialDistortion(intrinsics->RadialDistortion),
                tangentialDistortion(intrinsics->TangentialDistortion)
            {}

Member Function Documentation

bool operator!= ( const CameraIntrinsics & rhs ) const [inline]

Definition at line 54 of file GpuCoordinateMapper.h.

            {
                return std::memcmp(this, &rhs, sizeof(CameraIntrinsics)) != 0;
            }

Member Data Documentation

Windows::Foundation::Numerics::float2 focalLength

Definition at line 62 of file GpuCoordinateMapper.h.

uint32_t imageHeight

Definition at line 60 of file GpuCoordinateMapper.h.

uint32_t imageWidth

Definition at line 59 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float2 principalPoint

Definition at line 61 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float3 radialDistortion

Definition at line 63 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float2 tangentialDistortion

Definition at line 64 of file GpuCoordinateMapper.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GpuCoordinateMapper::RasterizedFrameBlob Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • GpuCoordinateMapper
  • GpuCoordinateMapper::RasterizedFrameBlob
Public Attributes

GpuCoordinateMapper::RasterizedFrameBlob Struct Reference

#include "GpuCoordinateMapper.h"

List of all members.

Public Attributes

Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		depthImage
CameraIntrinsics depthIntrinsics
float | depthRangeMaximumInMeters
float | depthRangeMinimumInMeters
float | depthScaleInMeters
Windows::Foundation::Numerics::float4x4 depthToSource
Windows::Foundation::Numerics::float4x4 depthToTarget
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		depthUnprojectionMap
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		sourceDistortionMap
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		sourceImage
CameraIntrinsics sourceIntrinsics
Windows::Foundation::Numerics::float4x4 sourceProjectionMatrix
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		targetDistortionMap
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		targetImage
CameraIntrinsics targetIntrinsics
Windows::Foundation::Numerics::float4x4 targetProjectionMatrix
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		targetRasterizedDepth

Detailed Description

Definition at line 67 of file GpuCoordinateMapper.h.

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> depthImage

Definition at line 78 of file GpuCoordinateMapper.h.

CameraIntrinsics depthIntrinsics

Definition at line 68 of file GpuCoordinateMapper.h.

float depthRangeMaximumInMeters

Definition at line 77 of file GpuCoordinateMapper.h.

float depthRangeMinimumInMeters

Definition at line 76 of file GpuCoordinateMapper.h.

float depthScaleInMeters

Definition at line 75 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 depthToSource

Definition at line 71 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 depthToTarget

Definition at line 72 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> depthUnprojectionMap

Definition at line 79 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> sourceDistortionMap

Definition at line 81 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> sourceImage

Definition at line 80 of file GpuCoordinateMapper.h.

CameraIntrinsics sourceIntrinsics

Definition at line 69 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 sourceProjectionMatrix

Definition at line 73 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> targetDistortionMap

Definition at line 84 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> targetImage

Definition at line 82 of file GpuCoordinateMapper.h.

CameraIntrinsics targetIntrinsics

Definition at line 70 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 targetProjectionMatrix

Definition at line 74 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11DepthStencilView> targetRasterizedDepth

Definition at line 83 of file GpuCoordinateMapper.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GpuCoordinateMapper::VisualizeFrameBlob Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • GpuCoordinateMapper
  • GpuCoordinateMapper::VisualizeFrameBlob
Public Attributes

GpuCoordinateMapper::VisualizeFrameBlob Struct Reference

#include "GpuCoordinateMapper.h"

List of all members.

Public Attributes

Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		renderTarget
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		renderTargetDepthBuffer
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		targetImage
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		targetImageDepthBuffer
D3D11_VIEWPORT viewport
Windows::Foundation::Numerics::float4x4 viewToProj
Windows::Foundation::Numerics::float4x4 worldToView

Detailed Description

Definition at line 87 of file GpuCoordinateMapper.h.

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> renderTarget

Definition at line 92 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11DepthStencilView> renderTargetDepthBuffer

Definition at line 93 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> targetImage

Definition at line 90 of file GpuCoordinateMapper.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> targetImageDepthBuffer

Definition at line 91 of file GpuCoordinateMapper.h.

D3D11_VIEWPORT viewport

Definition at line 94 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 viewToProj

Definition at line 89 of file GpuCoordinateMapper.h.

Windows::Foundation::Numerics::float4x4 worldToView

Definition at line 88 of file GpuCoordinateMapper.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: QuadRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • QuadRenderer
Public Member Functions | Private Attributes

QuadRenderer Class Reference

#include "QuadRenderer.h"

List of all members.

Public Member Functions

QuadRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render (ID3D11ShaderResourceView *texture, float aspectRatio)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_constantBuffer
ModelViewProjectionConstantBuffer | m_constantBufferData
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0u
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerState
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 21 of file QuadRenderer.h.

Constructor & Destructor Documentation

QuadRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 26 of file QuadRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 97 of file QuadRenderer.cpp.

{
    ID3D11Device* device = m_deviceResources->GetD3DDevice();

    m_vertexShader = DX::CreateVertexShader(
        device,
        g_QuadVertexShader,
        _countof(g_QuadVertexShader));

    static const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
    {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    };

    m_inputLayout = DX::CreateInputLayout(
        device,
        vertexDesc,
        _countof(vertexDesc),
        g_QuadVertexShader,
        _countof(g_QuadVertexShader));

    m_pixelShader = DX::CreatePixelShader(
        device,
        g_QuadPixelShader,
        _countof(g_QuadPixelShader));

    m_constantBuffer = DX::CreateBuffer(
        device,
        sizeof(ModelViewProjectionConstantBuffer),
        nullptr,
        D3D11_BIND_CONSTANT_BUFFER);

    m_samplerState = DX::CreateSamplerState(device);

    static const VertexPositionTex quadVertices[] =
    {
        { XMFLOAT3(-1.0f,  1.0f, 0.0f), XMFLOAT2(0.0f, 0.0f) },
        { XMFLOAT3( 1.0f,  1.0f, 0.0f), XMFLOAT2(1.0f, 0.0f) },
        { XMFLOAT3( 1.0f, -1.0f, 0.0f), XMFLOAT2(1.0f, 1.0f) },
        { XMFLOAT3(-1.0f, -1.0f, 0.0f), XMFLOAT2(0.0f, 1.0f) },
    };

    m_vertexBuffer = DX::CreateBuffer(
        device,
        sizeof(quadVertices),
        quadVertices,
        D3D11_BIND_VERTEX_BUFFER);

    static const unsigned short quadIndices [] =
    {
        0,2,3,
        0,1,2,
    };

    m_indexCount = _countof(quadIndices);

    m_indexBuffer = DX::CreateBuffer(
        device,
        sizeof(quadIndices),
        quadIndices,
        D3D11_BIND_INDEX_BUFFER);
}

void CreateWindowSizeDependentResources ( )

Definition at line 34 of file QuadRenderer.cpp.

{
    const Size outputSize = m_deviceResources->GetOutputSize();
    const float aspectRatio = outputSize.Width / outputSize.Height;

    const XMMATRIX projectionMatrix = XMMatrixOrthographicRH(2.0f, 2.0f / aspectRatio, 0.01f, 100.0f);

    XMStoreFloat4x4(&m_constantBufferData.projection, XMMatrixTranspose(projectionMatrix));

    const XMMATRIX viewMatrix = XMMatrixTranslation(0.0f, 0.0f, -1.0f);

    XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(viewMatrix));
}

void ReleaseDeviceDependentResources ( )

Definition at line 161 of file QuadRenderer.cpp.

{
    m_vertexShader = nullptr;
    m_inputLayout = nullptr;
    m_pixelShader = nullptr;
    m_constantBuffer = nullptr;
    m_vertexBuffer = nullptr;
    m_indexBuffer = nullptr;
    m_samplerState = nullptr;
}

void Render | ( | ID3D11ShaderResourceView * | texture,
 |  | float | aspectRatio
 | ) |  |

Definition at line 49 of file QuadRenderer.cpp.

{
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixScaling(1.0f, 1.0f / aspectRatio, 1.0f)));

    context->UpdateSubresource(m_constantBuffer.Get(), 0, nullptr, &m_constantBufferData, 0, 0);

    const UINT stride = sizeof(VertexPositionTex);
    const UINT offset = 0;
    context->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    context->IASetIndexBuffer(m_indexBuffer.Get(), DXGI_FORMAT_R16_UINT, 0);
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    context->VSSetShader(m_vertexShader.Get(), nullptr, 0);

    context->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf());

    context->PSSetShader(m_pixelShader.Get(), nullptr, 0);
    context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    const Size outputSize = m_deviceResources->GetOutputSize();

    const D3D11_VIEWPORT viewport = CD3D11_VIEWPORT(
        0.0f,
        0.0f,
        outputSize.Width,
        outputSize.Height
    );

    context->RSSetViewports(1, &viewport);

    ID3D11ShaderResourceView* textures[] = {
        texture
    };

    context->PSSetShaderResources(0, _countof(textures), textures);

    context->DrawIndexed(m_indexCount, 0, 0);

    ID3D11ShaderResourceView* nullTextures[] = {
        nullptr
    };

    context->PSSetShaderResources(0, _countof(nullTextures), nullTextures);
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer [private]

Definition at line 42 of file QuadRenderer.h.

ModelViewProjectionConstantBuffer m_constantBufferData [private]

Definition at line 46 of file QuadRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 34 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 39 of file QuadRenderer.h.

uint32 m_indexCount = 0u [private]

Definition at line 47 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 37 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 41 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState [private]

Definition at line 43 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 38 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 40 of file QuadRenderer.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.h
  • CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< CameraStreamCoordinateMapperMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 21 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 50 of file App.h.

std::unique_ptr<CameraStreamCoordinateMapperMain> m_main [private]

Definition at line 51 of file App.h.

bool m_windowClosed [private]

Definition at line 52 of file App.h.

bool m_windowVisible [private]

Definition at line 53 of file App.h.

The documentation for this class was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/App.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • TextRenderer
Public Types | Public Member Functions | Private Attributes

TextRenderer Class Reference

#include "TextRenderer.h"

List of all members.

Public Types

enum | TextAlignment { TopLeft, TopRight, BottomLeft, BottomRight }

Public Member Functions

TextRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render (TextAlignment alignment)
void | Update (std::wstring_view text)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormat
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
DWRITE_TEXT_METRICS | m_textMetrics = {}
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 20 of file TextRenderer.h.

Member Enumeration Documentation

enum TextAlignment
Enumerator:
TopLeft
TopRight
BottomLeft
BottomRight

Definition at line 23 of file TextRenderer.h.

        {
            TopLeft, TopRight, BottomLeft, BottomRight
        };

Constructor & Destructor Documentation

TextRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 20 of file TextRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Create device independent resources
    DX::ThrowIfFailed(m_deviceResources->GetDWriteFactory()->CreateTextFormat(
        L"Courier New",
        nullptr,
        DWRITE_FONT_WEIGHT_LIGHT,
        DWRITE_FONT_STYLE_NORMAL,
        DWRITE_FONT_STRETCH_NORMAL,
        24.0f,
        L"en-US",
        &m_textFormat));

    DX::ThrowIfFailed(m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));

    DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock));

    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 122 of file TextRenderer.cpp.

{
    DX::ThrowIfFailed(m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(
        D2D1::ColorF(D2D1::ColorF::White),
        &m_whiteBrush));
}

void ReleaseDeviceDependentResources ( )

Definition at line 128 of file TextRenderer.cpp.

{
    m_whiteBrush = nullptr;
}

void Render ( TextAlignment alignment )

Definition at line 91 of file TextRenderer.cpp.

{
    ID2D1DeviceContext* context = m_deviceResources->GetD2DDeviceContext();
    const Windows::Foundation::Size logicalSize = m_deviceResources->GetLogicalSize();

    context->SaveDrawingState(m_stateBlock.Get());
    context->BeginDraw();

    // Position on the bottom right corner
    const D2D1::Matrix3x2F screenTranslation = GetScreenTranslation(logicalSize, m_textMetrics, alignment);

    context->SetTransform(screenTranslation * m_deviceResources->GetOrientationTransform2D());

    DX::ThrowIfFailed(m_textFormat->SetTextAlignment(GetDwriteTextAlignment(alignment)));

    context->DrawTextLayout(
        D2D1::Point2F(0.f, 0.f),
        m_textLayout.Get(),
        m_whiteBrush.Get());

    // Ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    const HRESULT hr = context->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    context->RestoreDrawingState(m_stateBlock.Get());
}

void Update ( std::wstring_view text )

Definition at line 42 of file TextRenderer.cpp.

{
    DX::ThrowIfFailed(m_deviceResources->GetDWriteFactory()->CreateTextLayout(
        text.data(),
        static_cast<UINT32>(text.length()),
        m_textFormat.Get(),
        1024.0f, // Max width of the input text.
        256.0f, // Max height of the input text.
        &m_textLayout));

    DX::ThrowIfFailed(m_textLayout->GetMetrics(&m_textMetrics));
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 36 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 41 of file TextRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormat [private]

Definition at line 43 of file TextRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 42 of file TextRenderer.h.

DWRITE_TEXT_METRICS m_textMetrics = {} [private]

Definition at line 39 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 40 of file TextRenderer.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Content/TextRenderer.h
  • CameraStreamCoordinateMapper/cpp/Content/TextRenderer.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionTex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraStreamCoordinateMapper
  • VertexPositionTex
Public Attributes

VertexPositionTex Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | pos
DirectX::XMFLOAT2 | tex

Detailed Description

Definition at line 24 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 pos

Definition at line 26 of file ShaderStructures.h.

DirectX::XMFLOAT2 tex

Definition at line 27 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraVideoStabilization
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 23 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 39 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 82 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following files:
  • CameraVideoStabilization/cs/App.xaml.cs
  • CameraVideoStabilization/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraVideoStabilization
  • MainPage
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Public Member Functions

MainPage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
async Task | CleanupCameraAsync ()
async Task | CleanupUiAsync ()
async Task | CleanUpVideoStabilizationEffectAsync ()
async Task | CreateVideoStabilizationEffectAsync ()
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
SimpleOrientation | GetCameraOrientation ()
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | MediaCapture_RecordLimitationExceeded (MediaCapture sender)
async void | OrientationSensor_OrientationChanged (SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
void | RegisterEventHandlers ()
async Task | SetPreviewRotationAsync ()
async Task | SetupUiAsync ()
async Task | SetUpVideoStabilizationRecommendationAsync ()
async Task | StartPreviewAsync ()
async Task | StartRecordingAsync ()
async Task | StopPreviewAsync ()
async Task | StopRecordingAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
async void | VideoButton_Click (object sender, RoutedEventArgs e)
async void | VideoStabilizationEffect_EnabledChanged (VideoStabilizationEffect sender, VideoStabilizationEffectEnabledChangedEventArgs args)
async void | VsToggleButton_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static int | ConvertDeviceOrientationToDegrees (SimpleOrientation orientation)
static int | ConvertDisplayOrientationToDegrees (DisplayOrientations orientation)
static PhotoOrientation | ConvertOrientationToPhotoOrientation (SimpleOrientation orientation)
static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)

Private Attributes

StorageFolder | _captureFolder = null
SimpleOrientation | _deviceOrientation = SimpleOrientation.NotRotated
readonly DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
DisplayOrientations | _displayOrientation = DisplayOrientations.Portrait
readonly DisplayRequest | _displayRequest = new DisplayRequest()
MediaEncodingProfile | _encodingProfile
bool | _externalCamera
VideoEncodingProperties | _inputPropertiesBackup
bool | _isInitialized
bool | _isPreviewing
bool | _isRecording
MediaCapture | _mediaCapture
bool | _mirroringPreview
readonly SimpleOrientationSensor | _orientationSensor = SimpleOrientationSensor.GetDefault()
VideoEncodingProperties | _outputPropertiesBackup
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()
VideoStabilizationEffect | _videoStabilizationEffect

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 41 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 79 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Do not cache the state of the UI when suspending/navigating
            NavigationCacheMode = NavigationCacheMode.Disabled;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;
        }

Member Function Documentation

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 106 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                await SetupUiAsync();

                await InitializeCameraAsync();
            }
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                await CleanupUiAsync();

                deferral.Complete();
            }
        }

Concurrency::task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 608 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("CleanupCameraAsync");

            if (_isInitialized)
            {
                // If a recording is in progress during cleanup, stop it to save the recording
                if (_isRecording)
                {
                    await StopRecordingAsync();
                }

                // Clear the effect if one exists
                if (_videoStabilizationEffect != null)
                {
                    await CleanUpVideoStabilizationEffectAsync();
                }

                if (_isPreviewing)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                _isInitialized = false;
            }

            if (_mediaCapture != null)
            {
                _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed -= MediaCapture_Failed;
                _mediaCapture.Dispose();
                _mediaCapture = null;
            }
        }

task< void > CleanupUiAsync ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Unregisters event handlers for orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Returns:

Definition at line 684 of file MainPage.xaml.cs.

        {
            UnregisterEventHandlers();

            // Show the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
            }

            // Revert orientation preferences
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
        }

task< void > CleanUpVideoStabilizationEffectAsync ( ) [inline, private]

Disables and removes the video stabilization effect, and unregisters the event handler for the EnabledChanged event of the effect.

Returns:

Definition at line 509 of file MainPage.xaml.cs.

        {
            // No work to be done if there is no effect
            if (_videoStabilizationEffect == null) return;

            // Disable the effect
            _videoStabilizationEffect.Enabled = false;

            _videoStabilizationEffect.EnabledChanged -= VideoStabilizationEffect_EnabledChanged;

            // Remove the effect (see ClearEffectsAsync method to remove all effects from a stream)
            await _mediaCapture.RemoveEffectAsync(_videoStabilizationEffect);

            Debug.WriteLine("VS effect removed from pipeline");

            // If backed up settings (stream properties and encoding profile) exist, restore them and clear the backups
            if (_inputPropertiesBackup != null)
            {
                await _mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, _inputPropertiesBackup);
                _inputPropertiesBackup = null;
            }

            if (_outputPropertiesBackup != null)
            {
                _encodingProfile.Video = _outputPropertiesBackup;
                _outputPropertiesBackup = null;
            }

            // Clear the member variable that held the effect instance
            _videoStabilizationEffect = null;
        }

int ConvertDeviceOrientationToDegrees ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the device in space
Returns:
An orientation in degrees

Definition at line 836 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return 90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return 180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return 270;
                case SimpleOrientation.NotRotated:
                default:
                    return 0;
            }
        }

int ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) [inline, static, private]

Converts the given orientation of the app on the screen to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the app on the screen
Returns:
An orientation in degrees

Definition at line 857 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case DisplayOrientations.Portrait:
                    return 90;
                case DisplayOrientations.LandscapeFlipped:
                    return 180;
                case DisplayOrientations.PortraitFlipped:
                    return 270;
                case DisplayOrientations.Landscape:
                default:
                    return 0;
            }
        }

FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the metadata that can be added to captured photos.

Parameters:
orientation The orientation of the device in space
Returns:

Definition at line 878 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return PhotoOrientation.Rotate90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return PhotoOrientation.Rotate180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return PhotoOrientation.Rotate270;
                case SimpleOrientation.NotRotated:
                default:
                    return PhotoOrientation.Normal;
            }
        }

task< void > CreateVideoStabilizationEffectAsync ( ) [inline, private]

Adds video stabilization to the video record stream, registers for its event, enables it, and gets the effect instance.

Returns:

Definition at line 426 of file MainPage.xaml.cs.

        {
            // No work to be done if there already is an effect
            if (_videoStabilizationEffect != null) return;

            // Create the definition, which will contain some initialization settings
            var definition = new VideoStabilizationEffectDefinition();

            // Add the effect to the video record stream
            _videoStabilizationEffect = (VideoStabilizationEffect)await _mediaCapture.AddVideoEffectAsync(definition, MediaStreamType.VideoRecord);

            Debug.WriteLine("VS effect added to pipeline");

            // Subscribe to notifications for changes in the enabled state for the effect
            _videoStabilizationEffect.EnabledChanged += VideoStabilizationEffect_EnabledChanged;

            // Enable the effect
            _videoStabilizationEffect.Enabled = true;

#if (USE_VS_RECOMMENDATION)

            // Configure the pipeline to use the optimal settings for VS
            await SetUpVideoStabilizationRecommendationAsync();

            // At this point, one of two things has happened:
            //
            // a) If a more suitable capture resolution was available:
            //    1. Such resolution will have been set up for video capture ("input")
            //    2. The MediaEncodingProfile ("output") will have been changed to specify dimensions reflecting the amount of cropping
            //       done on said capture resolution (possibly even none if the new resolution offers enough padding)
            // b) If no better suited capture resolution was available:
            //    1. The video capture resolution will not have changed
            //    2. The MediaEncodingProfile will have been changed to specify smaller dimensions than the capture resolution
            //       so that the video isn't scaled back up to the capture resolution after cropping, which could cause a loss in quality
#else
            Debug.WriteLine("Not setting up VS recommendation");

            // Not setting up VS recommendation means that the video will be captured at the desired resolution,
            // then cropped by the VS effect as part of the stabilization process, and then scaled back up to the
            // original capture resolution
#endif
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will fire when the page is rotated, when the DisplayInformation.AutoRotationPreferences value set in the SetupUiAsync() method cannot be not honored.

Parameters:
sender | The event source.
args | The event data.

Definition at line 190 of file MainPage.xaml.cs.

        {
            _displayOrientation = sender.CurrentOrientation;

            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed.

Parameters:
desiredPanel The desired panel on which the returned device should be mounted, if available
Returns:

Definition at line 764 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

SimpleOrientation GetCameraOrientation ( ) [inline, private]

Calculates the current camera orientation from the device orientation by taking into account whether the camera is external or facing the user.

Returns:
The camera orientation in space, with an inverted rotation in the case the camera is mounted on the device and is facing the user

Definition at line 785 of file MainPage.xaml.cs.

        {
            if (_externalCamera)
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            var result = _deviceOrientation;

            // Account for the fact that, on portrait-first devices, the camera sensor is mounted at a 90 degree offset to the native orientation
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        result = SimpleOrientation.NotRotated;
                        break;
                    case SimpleOrientation.Rotated180DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated90DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated180DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.NotRotated:
                        result = SimpleOrientation.Rotated270DegreesCounterclockwise;
                        break;
                }
            }

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (_mirroringPreview)
            {
                // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        return SimpleOrientation.Rotated270DegreesCounterclockwise;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        return SimpleOrientation.Rotated90DegreesCounterclockwise;
                }
            }

            return result;
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI.

Returns:

Definition at line 291 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            if (_mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when video recording has reached the maximum time and when something goes wrong
                _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }

                // Set up the encoding profile for video recording
                _encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

                // If initialization succeeded, start the preview
                if (_isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();

                    UpdateCaptureControls();
                }
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 273 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

async void MediaCapture_RecordLimitationExceeded ( MediaCapture sender ) [inline, private]

Definition at line 264 of file MainPage.xaml.cs.

        {
            // This is a notification that recording has to stop, and the app is expected to finalize the recording

            await StopRecordingAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 117 of file MainPage.xaml.cs.

        {
            await SetupUiAsync();

            await InitializeCameraAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 124 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completeness, as it will only fire when navigating between pages and this sample only includes one page

            await CleanupCameraAsync();

            await CleanupUiAsync();
        }

async void OrientationSensor_OrientationChanged | ( | SimpleOrientationSensor | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Occurs each time the simple orientation sensor reports a new sensor reading.

Parameters:
sender | The event source.
args | The event data.

Definition at line 170 of file MainPage.xaml.cs.

        {
            if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
            {
                // Only update the current orientation if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
                // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
                // either up or down, at the desired subject.
                //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
                //      on other panels, this logic should be adjusted.
                _deviceOrientation = args.Orientation;

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
            }
        }

void RegisterEventHandlers ( ) [inline, private]

Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation.

Definition at line 730 of file MainPage.xaml.cs.

        {
            // If there is an orientation sensor present on the device, register for notifications
            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;

                // Update orientation of buttons with the current orientation
                UpdateButtonOrientation();
            }

            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview.

Returns:

Definition at line 381 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Calculate which way and how far to rotate the preview
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, rotationDegrees);
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

task< void > SetupUiAsync ( ) [inline, private]

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors.

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for orientation sensors.

Returns:

Definition at line 655 of file MainPage.xaml.cs.

        {
            // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

            // Hide the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
            }

            // Populate orientation variables with the current state
            _displayOrientation = _displayInformation.CurrentOrientation;
            if (_orientationSensor != null)
            {
                _deviceOrientation = _orientationSensor.GetCurrentOrientation();
            }

            RegisterEventHandlers();

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

task< void > SetUpVideoStabilizationRecommendationAsync ( ) [inline, private]

Configures the pipeline to use the optimal resolutions for VS based on the settings currently in use.

Returns:

Definition at line 473 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("Setting up VS recommendation...");

            // Get the recommendation from the effect based on our current input and output configuration
            var recommendation = _videoStabilizationEffect.GetRecommendedStreamConfiguration(_mediaCapture.VideoDeviceController, _encodingProfile.Video);

            // Handle the recommendation for the input into the effect, which can contain a larger resolution than currently configured, so cropping is minimized
            if (recommendation.InputProperties != null)
            {
                // Back up the current input properties from before VS was activated
                _inputPropertiesBackup = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoRecord) as VideoEncodingProperties;

                // Set the recommendation from the effect (a resolution higher than the current one to allow for cropping) on the input
                await _mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, recommendation.InputProperties);
                Debug.WriteLine("VS recommendation for the MediaStreamProperties (input) has been applied");
            }

            // Handle the recommendations for the output from the effect
            if (recommendation.OutputProperties != null)
            {
                // Back up the current output properties from before VS was activated
                _outputPropertiesBackup = _encodingProfile.Video;

                // Apply the recommended encoding profile for the output, which will result in a video with the same dimensions as configured
                // before VideoStabilization was added if an appropriate padded capture resolution was available. Otherwise, it will be slightly
                // smaller (due to cropping). This prevents upscaling back to the original size, which can result in a loss of quality
                _encodingProfile.Video = recommendation.OutputProperties;
                Debug.WriteLine("VS recommendation for the MediaEncodingProfile (output) has been applied");
            }
        }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on.

Returns:

Definition at line 358 of file MainPage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _isPreviewing = true;

            // Initialize the preview to the current orientation
            if (_isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

task< void > StartRecordingAsync ( ) [inline, private]

Records an MP4 video to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 545 of file MainPage.xaml.cs.

        {
            try
            {
                // Create storage file for the capture
                var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);

                // Calculate rotation angle, taking mirroring into account if necessary
                var rotationAngle = 360 - ConvertDeviceOrientationToDegrees(GetCameraOrientation());

                // Add it to the encoding profile, or edit the value if the GUID was already a part of the properties
                _encodingProfile.Video.Properties[RotationKey] = PropertyValue.CreateInt32(rotationAngle);

                Debug.WriteLine("Starting recording to " + videoFile.Path);

                await _mediaCapture.StartRecordToStorageFileAsync(_encodingProfile, videoFile);
                _isRecording = true;

                Debug.WriteLine("Started recording to: " + videoFile.Path);
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
            }
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 405 of file MainPage.xaml.cs.

        {
            // Stop the preview
            _isPreviewing = false;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Cleanup the UI
                PreviewControl.Source = null;

                // Allow the device screen to sleep now that the preview is stopped
                _displayRequest.RequestRelease();
            });
        }

task< void > StopRecordingAsync ( ) [inline, private]

Stops recording a video.

Returns:

Definition at line 576 of file MainPage.xaml.cs.

        {
            try
            {
                Debug.WriteLine("Stopping recording...");

                _isRecording = false;
                await _mediaCapture.StopRecordAsync();

                // If VS disabled itself during recording, clean up the effect
                if (_videoStabilizationEffect != null && !_videoStabilizationEffect.Enabled)
                {
                    // Cleaning up the effect here is an implementation choice in this sample, so that, at the end of the recording, it's clearer
                    // to the user that the effect turned itself off. Alternatively, one could try to re-enable the effect (e.g. if the reason
                    // it disabled itself was RunningSlowly, there's a chance it will work next time), and/or prompt the user to choose a lower capture
                    // resolution / framerate instead.
                    await CleanUpVideoStabilizationEffectAsync();
                }

                Debug.WriteLine("Stopped recording!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when stopping video recording: " + ex.ToString());
            }
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 144 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

void UnregisterEventHandlers ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors.

Definition at line 748 of file MainPage.xaml.cs.

        {
            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged -= OrientationSensor_OrientationChanged;
            }

            _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
        }

void UpdateButtonOrientation ( ) [inline, private]

Uses the current device orientation in space and page orientation on the screen to calculate the rotation transformation to apply to the controls.

Definition at line 898 of file MainPage.xaml.cs.

        {
            int device = ConvertDeviceOrientationToDegrees(_deviceOrientation);
            int display = ConvertDisplayOrientationToDegrees(_displayOrientation);

            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                device -= 90;
            }

            // Combine both rotations and make sure that 0 <= result < 360
            var angle = (360 + display + device) % 360;

            // Rotate the buttons in the UI to match the rotation of the device
            var transform = new RotateTransform { Angle = angle };

            // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
            VsToggleButton.RenderTransform = transform;
            VideoButton.RenderTransform = transform;
        }

void UpdateCaptureControls ( ) [inline, private]

This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device.

Definition at line 701 of file MainPage.xaml.cs.

        {
            // The button should only be enabled if the preview started sucessfully
            VideoButton.IsEnabled = _isPreviewing;

            // Allow toggling VS only while not recording or when the effect exists but it has been disabled
            VsToggleButton.IsEnabled = (_isPreviewing && !_isRecording) ||
                                       (_videoStabilizationEffect != null && !_videoStabilizationEffect.Enabled);

            // Update recording button to show "Stop" icon instead of red "Record" icon
            StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
            StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;

            // Show "VS On" icon when effect exists and is enabled, otherwise show "VS Off icon"
            if (_videoStabilizationEffect != null && _videoStabilizationEffect.Enabled)
            {
                VsOnIcon.Visibility = Visibility.Visible;
                VsOffIcon.Visibility = Visibility.Collapsed;
            }
            else
            {
                VsOnIcon.Visibility = Visibility.Collapsed;
                VsOffIcon.Visibility = Visibility.Visible;
            }
        }

async void VideoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 233 of file MainPage.xaml.cs.

        {
            if (!_isRecording)
            {
                await StartRecordingAsync();
            }
            else
            {
                await StopRecordingAsync();
            }

            // After starting or stopping video recording, update the UI to reflect the MediaCapture state
            UpdateCaptureControls();
        }

async void VideoStabilizationEffect_EnabledChanged | ( | VideoStabilizationEffect | sender,
 |  | VideoStabilizationEffectEnabledChangedEventArgs | args |
 | ) |  |  | [inline, private]

Triggers when the Enabled property of the VideoStabilizationEffect changes.

Parameters:
sender | The instance of the effect firing the event.
args | Information about the event.

Definition at line 253 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Debug.WriteLine("VS Enabled: " + sender.Enabled + ". Reason: " + args.Reason);

                // Update buttons to reflect the new state
                UpdateCaptureControls();
            });
        }

async void VsToggleButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 202 of file MainPage.xaml.cs.

        {
            // Note that for the most part, this button is disabled during recording, except when VS is turned off automatically

            if (!_isRecording)
            {
                // While *not* recording, either the effect doesn't exist (and should be created) or it exists and is enabled.
                // This sample doesn't allow the user to disable the effect while recording. For the case that the effect disables
                // itself while recording, StopRecordingAsync() will clean up the effect after the recording session ends.

                if (_videoStabilizationEffect == null)
                {
                    // VS didn't exist, so create and enable the effect
                    await CreateVideoStabilizationEffectAsync();
                }
                else if (_videoStabilizationEffect.Enabled)
                {
                    // VS was enabled, so clean it up and restore any capture settings (MediaStreamType and EncodingProfile)
                    await CleanUpVideoStabilizationEffectAsync();
                }
            }
            else if (!_videoStabilizationEffect.Enabled)
            {
                // While recording this button is diabled. The situation the user is allowed to tap it while recording, is when
                // VS turns itself off (see VideoStabilizationEffect_EnabledChanged), so proceed to re-enable the effect
                _videoStabilizationEffect.Enabled = true;
            }

            UpdateCaptureControls();
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 54 of file MainPage.xaml.cs.

SimpleOrientation _deviceOrientation = SimpleOrientation.NotRotated [private]

Definition at line 46 of file MainPage.xaml.cs.

readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 44 of file MainPage.xaml.cs.

DisplayOrientations _displayOrientation = DisplayOrientations.Portrait [private]

Definition at line 47 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 57 of file MainPage.xaml.cs.

MediaEncodingProfile _encodingProfile [private]

Definition at line 67 of file MainPage.xaml.cs.

bool _externalCamera [private]

Definition at line 71 of file MainPage.xaml.cs.

VideoEncodingProperties _inputPropertiesBackup [private]

Definition at line 74 of file MainPage.xaml.cs.

bool _isInitialized [private]

Definition at line 64 of file MainPage.xaml.cs.

bool _isPreviewing [private]

Definition at line 65 of file MainPage.xaml.cs.

bool _isRecording [private]

Definition at line 66 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 63 of file MainPage.xaml.cs.

bool _mirroringPreview [private]

Definition at line 70 of file MainPage.xaml.cs.

readonly SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault() [private]

Definition at line 45 of file MainPage.xaml.cs.

VideoEncodingProperties _outputPropertiesBackup [private]

Definition at line 75 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 60 of file MainPage.xaml.cs.

VideoStabilizationEffect _videoStabilizationEffect [private]

Definition at line 73 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 51 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraVideoStabilization/cs/MainPage.xaml.cs
  • CameraVideoStabilization/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CameraVideoStabilization
  • sealed
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class.

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~MainPage ()
MainPage ()

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | Application_Resuming (Object^sender, Object^args)
void | Application_Suspending (Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
Concurrency::task< void > | CleanupCameraAsync ()
Concurrency::task< void > | CleanupUiAsync ()
Concurrency::task< void > | CleanUpVideoStabilizationEffectAsync ()
int | ConvertDeviceOrientationToDegrees (Windows::Devices::Sensors::SimpleOrientation orientation)
int | ConvertDisplayOrientationToDegrees (Windows::Graphics::Display::DisplayOrientations orientation)
Windows::Storage::FileProperties::PhotoOrientation | ConvertOrientationToPhotoOrientation (Windows::Devices::Sensors::SimpleOrientation orientation)
Concurrency::task< void > | CreateVideoStabilizationEffectAsync ()
void | DisplayInformation_OrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Object^args)
Concurrency::task< void > | EmptyTask ()
Concurrency::task
< Windows::Devices::Enumeration::DeviceInformation^> 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel panel)
Windows::Devices::Sensors::SimpleOrientation | GetCameraOrientation ()
void | HardwareButtons_CameraPressed (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
Concurrency::task< void > | InitializeCameraAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)
void | MediaCapture_RecordLimitationExceeded (Windows::Media::Capture::MediaCapture^currentCaptureObject)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | OrientationSensor_OrientationChanged (Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^)
void | RegisterEventHandlers ()
Concurrency::task< void > | SetPreviewRotationAsync ()
Concurrency::task< void > | SetupUiAsync ()
Concurrency::task< void > | SetUpVideoStabilizationRecommendationAsync ()
Concurrency::task< void > | StartPreviewAsync ()
Concurrency::task< void > | StartRecordingAsync ()
Concurrency::task< void > | StopPreviewAsync ()
Concurrency::task< void > | StopRecordingAsync ()
void | SystemMediaControls_PropertyChanged (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args)
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
void | VideoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | VideoStabilizationEffect_EnabledChanged (Windows::Media::Core::VideoStabilizationEffect^sender, Windows::Media::Core::VideoStabilizationEffectEnabledChangedEventArgs^args)
void | VsToggleButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | WriteException (Platform::Exception^ex)
void | WriteLine (Platform::String^str)

Private Attributes

Windows::Foundation::EventRegistrationToken | _applicationResumingEventToken
Windows::Foundation::EventRegistrationToken | _applicationSuspendingEventToken
Windows::Storage::StorageFolder | _captureFolder
Windows::Devices::Sensors::SimpleOrientation | _deviceOrientation
Windows::Graphics::Display::DisplayInformation | _displayInformation
Windows::Foundation::EventRegistrationToken | _displayInformationEventToken
Windows::Graphics::Display::DisplayOrientations | _displayOrientation
Windows::System::Display::DisplayRequest | _displayRequest
Windows::Media::MediaProperties::MediaEncodingProfile | _encodingProfile
bool | _externalCamera
Windows::Foundation::EventRegistrationToken | _hardwareCameraButtonEventToken
Windows::Media::MediaProperties::VideoEncodingProperties | _inputPropertiesBackup
bool | _isInitialized
bool | _isPreviewing
bool | _isRecording
Platform::Agile
< Windows::Media::Capture::MediaCapture^> 		_mediaCapture
Windows::Foundation::EventRegistrationToken | _mediaCaptureFailedEventToken
Windows::Foundation::EventRegistrationToken | _mediaControlPropChangedEventToken
bool | _mirroringPreview
Windows::Foundation::EventRegistrationToken | _orientationChangedEventToken
Windows::Devices::Sensors::SimpleOrientationSensor | _orientationSensor
Windows::Media::MediaProperties::VideoEncodingProperties | _outputPropertiesBackup
Windows::Foundation::EventRegistrationToken | _recordLimitationExceededEventToken
Windows::Media::SystemMediaTransportControls | _systemMediaControls
Windows::Media::Core::VideoStabilizationEffect | _videoStabilizationEffect
Windows::Foundation::EventRegistrationToken | _videoStabilizationEnabledToken
const GUID | RotationKey

Detailed Description

Definition at line 21 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~MainPage ( ) [virtual]

Member Function Documentation

void Application_Resuming | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void Application_Suspending | ( | Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> CleanupCameraAsync ( ) [private]
Concurrency::task<void> CleanupUiAsync ( ) [private]
Concurrency::task<void> CleanUpVideoStabilizationEffectAsync ( ) [private]
int ConvertDeviceOrientationToDegrees ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
int ConvertDisplayOrientationToDegrees ( Windows::Graphics::Display::DisplayOrientations orientation ) [private]
Windows::Storage::FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
Concurrency::task<void> CreateVideoStabilizationEffectAsync ( ) [private]
void DisplayInformation_OrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
Concurrency::task<void> EmptyTask ( ) [private]
Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel panel ) [private]
Windows::Devices::Sensors::SimpleOrientation GetCameraOrientation ( ) [private]
void HardwareButtons_CameraPressed | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
Concurrency::task<void> InitializeCameraAsync ( ) [private]
MainPage ( )
void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture^ | currentCaptureObject,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs^ | errorEventArgs |
 | ) |  |  | [private]
void MediaCapture_RecordLimitationExceeded ( Windows::Media::Capture::MediaCapture^ currentCaptureObject ) [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OrientationSensor_OrientationChanged | ( | Windows::Devices::Sensors::SimpleOrientationSensor^ | ,
 |  | Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^ |  |
 | ) |  |  | [private]
void RegisterEventHandlers ( ) [private]
Concurrency::task<void> SetPreviewRotationAsync ( ) [private]
Concurrency::task<void> SetupUiAsync ( ) [private]
Concurrency::task<void> SetUpVideoStabilizationRecommendationAsync ( ) [private]
Concurrency::task<void> StartPreviewAsync ( ) [private]
Concurrency::task<void> StartRecordingAsync ( ) [private]
Concurrency::task<void> StopPreviewAsync ( ) [private]
Concurrency::task<void> StopRecordingAsync ( ) [private]
void SystemMediaControls_PropertyChanged | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ | args |
 | ) |  |  | [private]
void UnregisterEventHandlers ( ) [private]
void UpdateButtonOrientation ( ) [private]
void UpdateCaptureControls ( ) [private]
void VideoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void VideoStabilizationEffect_EnabledChanged | ( | Windows::Media::Core::VideoStabilizationEffect^ | sender,
 |  | Windows::Media::Core::VideoStabilizationEffectEnabledChangedEventArgs^ | args |
 | ) |  |  | [private]
void VsToggleButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void WriteException ( Platform::Exception^ ex ) [private]
void WriteLine ( Platform::String^ str ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationResumingEventToken [private]

Definition at line 57 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken [private]

Definition at line 56 of file MainPage.xaml.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 49 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientation _deviceOrientation [private]

Definition at line 24 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayInformation _displayInformation [private]

Definition at line 23 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _displayInformationEventToken [private]

Definition at line 59 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayOrientations _displayOrientation [private]

Definition at line 25 of file MainPage.xaml.h.

Windows::System::Display::DisplayRequest _displayRequest [private]

Definition at line 28 of file MainPage.xaml.h.

Windows::Media::MediaProperties::MediaEncodingProfile _encodingProfile [private]

Definition at line 38 of file MainPage.xaml.h.

bool _externalCamera [private]

Definition at line 41 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken [private]

Definition at line 63 of file MainPage.xaml.h.

Windows::Media::MediaProperties::VideoEncodingProperties _inputPropertiesBackup [private]

Definition at line 52 of file MainPage.xaml.h.

bool _isInitialized [private]

Definition at line 35 of file MainPage.xaml.h.

bool _isPreviewing [private]

Definition at line 36 of file MainPage.xaml.h.

bool _isRecording [private]

Definition at line 37 of file MainPage.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 34 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 61 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken [private]

Definition at line 58 of file MainPage.xaml.h.

bool _mirroringPreview [private]

Definition at line 42 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _orientationChangedEventToken [private]

Definition at line 62 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientationSensor _orientationSensor [private]

Definition at line 22 of file MainPage.xaml.h.

Windows::Media::MediaProperties::VideoEncodingProperties _outputPropertiesBackup [private]

Definition at line 53 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _recordLimitationExceededEventToken [private]

Definition at line 60 of file MainPage.xaml.h.

Windows::Media::SystemMediaTransportControls _systemMediaControls [private]

Definition at line 31 of file MainPage.xaml.h.

Windows::Media::Core::VideoStabilizationEffect _videoStabilizationEffect [private]

Definition at line 51 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _videoStabilizationEnabledToken [private]

Definition at line 64 of file MainPage.xaml.h.

const GUID RotationKey [private]

Definition at line 46 of file MainPage.xaml.h.

The documentation for this class was generated from the following files:
  • CameraVideoStabilization/cpp/App.xaml.h
  • CameraVideoStabilization/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CardioidSound Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Member Functions | Private Attributes

CardioidSound Class Reference

#include "CardioidSound.h"

List of all members.

Public Member Functions

virtual | ~CardioidSound ()
HRESULT | ConfigureApo (_In_ float scaling, _In_ float order)
HrtfEnvironment | GetEnvironment ()
HRESULT | Initialize (_In_ LPCWSTR filename)
HRESULT | OnUpdate (_In_ float x, _In_ float, _In_ float z, _In_ float pitch, _In_ float yaw, _In_ float roll)
HRESULT | SetEnvironment (_In_ HrtfEnvironment environment)
HRESULT | Start ()
HRESULT | Stop ()

Private Member Functions

HrtfOrientation | OrientationFromAngles (float pitch, float yaw, float roll)

Private Attributes

AudioFileReader _audioFile
HrtfEnvironment | _environment = HrtfEnvironment::Outdoors
ComPtr< IXAPOHrtfParameters > | _hrtfParams
IXAudio2SourceVoice * | _sourceVoice = nullptr
ComPtr< IXAudio2 > | _xaudio2

Detailed Description

Definition at line 17 of file CardioidSound.h.

Constructor & Destructor Documentation

~CardioidSound ( ) [virtual]

Definition at line 30 of file CardioidSound.cpp.

{
    if (_sourceVoice)
    {
        _sourceVoice->DestroyVoice();
    }
}

Member Function Documentation

HRESULT ConfigureApo | ( | _In_ float | scaling,
 |  | _In_ float | order
 | ) |  |
HrtfEnvironment GetEnvironment ( ) [inline]

Definition at line 28 of file CardioidSound.h.

{ return _environment; }

HRESULT Initialize ( _In_ LPCWSTR filename )
HRESULT OnUpdate | ( | _In_ float | x,
 |  | _In_ | float,
 |  | _In_ float | z,
 |  | _In_ float | pitch,
 |  | _In_ float | yaw,
 |  | _In_ float | roll
 | ) |  |
_Use_decl_annotations_ HrtfOrientation OrientationFromAngles | ( | float | pitch,
 |  | float | yaw,
 |  | float | roll |
 | ) |  |  | [private]

Definition at line 143 of file CardioidSound.cpp.

{
    // Negate all angles for right handed coordinate system.
    DirectX::XMFLOAT3 angles{ -pitch, -yaw, -roll };
    DirectX::XMVECTOR vector = DirectX::XMLoadFloat3(&angles);
    DirectX::XMMATRIX rm = DirectX::XMMatrixRotationRollPitchYawFromVector(vector);
    DirectX::XMFLOAT3X3 rm33{};
    DirectX::XMStoreFloat3x3(&rm33, rm);
    return HrtfOrientation{ rm33._11, rm33._12, rm33._13, rm33._21, rm33._22, rm33._23, rm33._31, rm33._32, rm33._33 };
}

HRESULT SetEnvironment ( _In_ HrtfEnvironment environment )
HRESULT Start ( )

Definition at line 101 of file CardioidSound.cpp.

{
    return _sourceVoice->Start();
}

HRESULT Stop ( )

Definition at line 106 of file CardioidSound.cpp.

{
    return _sourceVoice->Stop();
}

Member Data Documentation

AudioFileReader _audioFile [private]

Definition at line 34 of file CardioidSound.h.

HrtfEnvironment _environment = HrtfEnvironment::Outdoors [private]

Definition at line 38 of file CardioidSound.h.

ComPtr<IXAPOHrtfParameters> _hrtfParams [private]

Definition at line 37 of file CardioidSound.h.

IXAudio2SourceVoice* _sourceVoice = nullptr [private]

Definition at line 36 of file CardioidSound.h.

ComPtr<IXAudio2> _xaudio2 [private]

Definition at line 35 of file CardioidSound.h.

The documentation for this class was generated from the following files:
  • SpatialSound/cpp/CardioidSound.h
  • SpatialSound/cpp/CardioidSound.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CAsyncState Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Member Functions

CAsyncState Class Reference

#include "Common.h"

List of all members.

Public Member Functions

CAsyncState (Platform::Array< int, 1 >^data, UINT32 size)

Public Attributes

Platform::Array< int, 1 > | m_Data
UINT32 | m_Size

Private Member Functions

virtual | ~CAsyncState ()

Detailed Description

Definition at line 116 of file Common.h.

Constructor & Destructor Documentation

CAsyncState | ( | Platform::Array< int, 1 >^ | data,
 |  | UINT32 | size |
 | ) |  |  | [inline]

Definition at line 120 of file Common.h.

                                                           :
        m_Data(data),
        m_Size(size)
    {
    };

virtual ~CAsyncState ( ) [inline, private, virtual]

Definition at line 131 of file Common.h.

{};

Member Data Documentation

Platform::Array<int,1> m_Data

Definition at line 124 of file Common.h.

UINT32 m_Size

Definition at line 128 of file Common.h.

The documentation for this class was generated from the following file:
  • WindowsAudioSession/cpp/Common.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMediaStream::CSourceLock Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CMediaStream
  • CMediaStream::CSourceLock
Public Member Functions | Private Attributes

CMediaStream::CSourceLock Class Reference

List of all members.

Public Member Functions

CSourceLock (CMediaSource *pSource)
~CSourceLock ()

Private Attributes

ComPtr< CMediaSource > _spSource

Detailed Description

Definition at line 22 of file StspMediaStream.cpp.

Constructor & Destructor Documentation

CSourceLock ( CMediaSource * pSource ) [inline]

Definition at line 25 of file StspMediaStream.cpp.

        : _spSource(pSource)
    {
        if (_spSource)
        {
            _spSource->Lock();
        }
    }

~CSourceLock ( ) [inline]

Definition at line 34 of file StspMediaStream.cpp.

    {
        if (_spSource)
        {
            _spSource->Unlock();
        }
    }

Member Data Documentation

ComPtr<CMediaSource> _spSource [private]

Definition at line 43 of file StspMediaStream.cpp.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ColorBGRA Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ColorBGRA Struct Reference

List of all members.

Public Attributes

byte | A
byte | B
byte | G
byte | R

Detailed Description

Definition at line 54 of file FrameRenderer.cpp.

Member Data Documentation

byte A

Definition at line 56 of file FrameRenderer.cpp.

byte B

Definition at line 56 of file FrameRenderer.cpp.

byte G

Definition at line 56 of file FrameRenderer.cpp.

byte R

Definition at line 56 of file FrameRenderer.cpp.

The documentation for this struct was generated from the following files:
  • CameraFrames/cpp/FrameRenderer.cpp
  • CameraStreamCorrelation/cpp/FrameRenderer.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISecureInterfaceConsumer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISecureInterfaceConsumer
Public Attributes

ISecureInterfaceConsumer Interface Reference

#include "SecureInterfaceConsumer.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< SecureInterfaceConsumer^,
Platform::Object^> 		IsUpperCaseEnabledChanged

Detailed Description

Definition at line 25 of file SecureInterfaceConsumer.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<SecureInterfaceConsumer^, Platform::Object^> IsUpperCaseEnabledChanged

Definition at line 27 of file SecureInterfaceConsumer.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISecureInterfaceLegacySignals Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISecureInterfaceLegacySignals
Public Attributes

ISecureInterfaceLegacySignals Interface Reference

#include "SecureInterfaceLegacySignals.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< SecureInterfaceLegacySignals^,
SecureInterfaceTextSentReceivedEventArgs^> 		TextSentReceived

Detailed Description

Definition at line 27 of file SecureInterfaceLegacySignals.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^> TextSentReceived

Definition at line 29 of file SecureInterfaceLegacySignals.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISecureInterfaceProducer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISecureInterfaceProducer
Public Attributes

ISecureInterfaceProducer Interface Reference

#include "SecureInterfaceProducer.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< SecureInterfaceProducer^,
Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^> 		SessionLost
event
Windows::Foundation::TypedEventHandler
< SecureInterfaceProducer^,
Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^> 		SessionMemberAdded
event
Windows::Foundation::TypedEventHandler
< SecureInterfaceProducer^,
Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^> 		SessionMemberRemoved
event
Windows::Foundation::TypedEventHandler
< SecureInterfaceProducer^,
Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^> 		Stopped

Detailed Description

Definition at line 29 of file SecureInterfaceProducer.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^> SessionLost

Definition at line 32 of file SecureInterfaceProducer.h.

event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^> SessionMemberAdded

Definition at line 33 of file SecureInterfaceProducer.h.

event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^> SessionMemberRemoved

Definition at line 34 of file SecureInterfaceProducer.h.

event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^> Stopped

Definition at line 31 of file SecureInterfaceProducer.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISecureInterfaceService Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISecureInterfaceService
Public Member Functions

ISecureInterfaceService Interface Reference

#include "ISecureInterfaceService.h"

Inherited by SecureInterfaceService.

List of all members.

Public Member Functions

Windows::Foundation::IAsyncOperation
< SecureInterfaceConcatenateResult^> 		ConcatenateAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2)
Windows::Foundation::IAsyncOperation
< SecureInterfaceGetIsUpperCaseEnabledResult^> 		GetIsUpperCaseEnabledAsync (Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< SecureInterfaceSetIsUpperCaseEnabledResult^> 		SetIsUpperCaseEnabledAsync (Windows::Devices::AllJoyn::AllJoynMessageInfo^info, bool value)

Detailed Description

Definition at line 25 of file ISecureInterfaceService.h.

Member Function Documentation

Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^> ConcatenateAsync | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ Platform::String^ | interfaceMemberInStr1,
 |  | _In_ Platform::String^ | interfaceMemberInStr2
 | ) |  |
Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^> GetIsUpperCaseEnabledAsync ( Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^> SetIsUpperCaseEnabledAsync | ( | Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | bool | value
 | ) |  |
The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/ISecureInterfaceService.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISecureInterfaceSignals Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISecureInterfaceSignals
Public Attributes

ISecureInterfaceSignals Interface Reference

#include "SecureInterfaceSignals.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< SecureInterfaceSignals^,
SecureInterfaceTextSentReceivedEventArgs^> 		TextSentReceived

Detailed Description

Definition at line 27 of file SecureInterfaceSignals.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<SecureInterfaceSignals^, SecureInterfaceTextSentReceivedEventArgs^> TextSentReceived

Definition at line 29 of file SecureInterfaceSignals.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISignalEmitter Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • ISignalEmitter

ISignalEmitter Interface Reference

#include "AllJoynHelpers.h"

Inherited by sealed [private].

Detailed Description

Definition at line 40 of file AllJoynHelpers.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • com
  • microsoft
  • Samples
  • SecureInterface
  • sealed
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

#include "SecureInterfaceConsumer.h"

Inherits com::microsoft::Samples::SecureInterface::ISignalEmitter.

List of all members.

Public Member Functions

virtual | ~SecureInterfaceConsumer ()
virtual | ~SecureInterfaceProducer ()
QStatus | AddSignalHandler (_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
AllJoynMessageArgStructure ()
void | BusAttachmentStateChanged (_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^sender, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^args)
void | CallTextSentReceived (_In_ SecureInterfaceLegacySignals^sender, _In_ SecureInterfaceTextSentReceivedEventArgs^args)
void | CallTextSentReceived (_In_ SecureInterfaceSignals^sender, _In_ SecureInterfaceTextSentReceivedEventArgs^args)
Windows::Foundation::IAsyncOperation
< SecureInterfaceConcatenateResult^> 		ConcatenateAsync (_In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2)
virtual
Windows::Foundation::Collections::IIterator
< Platform::Object^> 		First ()
virtual Platform::Object | GetAt (unsigned int index)
virtual
Windows::Foundation::IAsyncOperation
< SecureInterfaceGetIsUpperCaseEnabledResult^> 		GetIsUpperCaseEnabledAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
QStatus | OnPropertyGet (_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val)
QStatus | OnPropertySet (_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val)
void | OnSessionJoined (_In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner)
void | OnSessionLost (_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
void | OnSessionMemberAdded (_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
void | OnSessionMemberRemoved (_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
int32 | RemoveMemberFromSession (_In_ Platform::String^uniqueName)
SecureInterfaceConcatenateCalledEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2)
SecureInterfaceConsumer (Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
int32 | SecureInterfaceConsumer::Initialize (_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^serviceInfo)
SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
SecureInterfaceProducer (Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ bool value)
virtual
Windows::Foundation::IAsyncOperation
< SecureInterfaceSetIsUpperCaseEnabledResult^> 		SetIsUpperCaseEnabledAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ bool value)
Windows::Foundation::IAsyncOperation
< SecureInterfaceSetIsUpperCaseEnabledResult^> 		SetIsUpperCaseEnabledAsync (_In_ bool value)
void | Start ()
void | Stop ()
void | TextSent (_In_ Platform::String^interfaceMemberMessage)
void | TextSent (_In_ Platform::String^interfaceMemberMessage)

Static Public Member Functions

static void | CallTextSentSignalHandler (_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message)
static
Windows::Foundation::IAsyncOperation
< SecureInterfaceConsumer^> 		FromIdAsync (_In_ Platform::String^deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
static
Windows::Foundation::IAsyncOperation
< SecureInterfaceConsumer^> 		FromIdAsync (_In_ Platform::String^deviceId)
static
Windows::Foundation::IAsyncOperation
< SecureInterfaceConcatenateResult^> 		GetResultAsync (SecureInterfaceConcatenateCalledEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< SecureInterfaceGetIsUpperCaseEnabledResult^> 		GetResultAsync (SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^args)

Properties

internal | __pad0__: bool OnAcceptSessionJoiner(_In_ alljoyn_sessionport sessionPort
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_IsUpperCaseEnabledChanged
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionMemberAdded
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionMemberRemoved
internal _In_ PCSTR | joiner
Windows::Devices::AllJoyn::AllJoynBusAttachment | m_busAttachment
Windows::Devices::AllJoyn::AllJoynBusObject | m_busObject
Platform::String | m_interfaceMemberMessage
static PCSTR | m_interfaceName
alljoyn_busattachment | m_nativeBusAttachment
alljoyn_busobject | m_nativeBusObject
alljoyn_proxybusobject | m_proxyBusObject
Platform::String | m_ServiceObjectPath
Windows::Devices::AllJoyn::AllJoynSession | m_session
alljoyn_sessionlistener | m_sessionListener
SecureInterfaceSignals | m_signals
Platform::WeakReference * | m_weak
internal _In_ PCSTR _In_ const
alljoyn_sessionopts 		opts
static std::map
< alljoyn_interfacedescription,
Platform::WeakReference * > 		SourceInterfaces

Private Member Functions

QStatus | AddMethodHandler (_In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_methodhandler_ptr handler)
QStatus | AddSignalHandler (_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
void | Complete ()
void | Complete ()
void | Complete ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | UnregisterFromBus ()

Static Private Member Functions

static void | CallConcatenateHandler (_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message)
static void | CallTextSentSignalHandler (_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message)

Private Attributes

event
Windows::Foundation::EventHandler
< Platform::Object^> 		_ConcatenateCalled
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_GetIsUpperCaseEnabledRequested
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionLost
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SetIsUpperCaseEnabledRequested
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_Stopped
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_TextSentReceived
Windows::Foundation::EventRegistrationToken | m_busAttachmentStateChangedToken
alljoyn_busobject | m_busObject
int | m_completionsRequired
SecureInterfaceConsumer | m_consumer
ISignalEmitter m_emitter
Platform::String | m_interfaceMemberInStr1
Platform::String | m_interfaceMemberInStr2
Platform::String | m_interfaceMemberOutStr
std::mutex | m_lock
alljoyn_interfacedescription_member | m_memberTextSent
Windows::Devices::AllJoyn::AllJoynMessageInfo | m_messageInfo
bool | m_raised
SecureInterfaceConcatenateResult | m_result
SecureInterfaceSetIsUpperCaseEnabledResult | m_result
SecureInterfaceGetIsUpperCaseEnabledResult | m_result
ISecureInterfaceService m_serviceInterface
alljoyn_sessionid | m_sessionId
alljoyn_sessionport | m_sessionPort
alljoyn_sessionportlistener | m_sessionPortListener
SecureInterfaceLegacySignals | m_signals
int32 | m_status
concurrency::task_completion_event
< SecureInterfaceConcatenateResult^> 		m_tce
concurrency::task_completion_event
< SecureInterfaceGetIsUpperCaseEnabledResult^> 		m_tce
concurrency::task_completion_event
< SecureInterfaceSetIsUpperCaseEnabledResult^> 		m_tce
bool | m_value

Static Private Attributes

static std::map
< alljoyn_busobject,
Platform::WeakReference * > 		SourceObjects

Detailed Description

Definition at line 30 of file SecureInterfaceConsumer.h.

Constructor & Destructor Documentation

virtual ~SecureInterfaceConsumer ( ) [virtual]
virtual ~SecureInterfaceProducer ( ) [virtual]

Member Function Documentation

QStatus AddMethodHandler | ( | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_methodhandler_ptr | handler |
 | ) |  |  | [private]
QStatus AddSignalHandler | ( | _In_ alljoyn_busattachment | busAttachment,
 |  | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_signalhandler_ptr | handler
 | ) |  |
QStatus AddSignalHandler | ( | _In_ alljoyn_busattachment | busAttachment,
 |  | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_signalhandler_ptr | handler |
 | ) |  |  | [private]
AllJoynMessageArgStructure ( ) [inline]

Definition at line 28 of file SecureInterfaceStructures.h.

    {
        m_vector = ref new Platform::Collections::Vector<Platform::Object^>();
    }

void BusAttachmentStateChanged | ( | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | sender,
 |  | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^ | args
 | ) |  |
static void CallConcatenateHandler | ( | _Inout_ alljoyn_busobject | busObject,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
void CallTextSentReceived | ( | _In_ SecureInterfaceSignals^ | sender,
 |  | _In_ SecureInterfaceTextSentReceivedEventArgs^ | args
 | ) |  |
void CallTextSentReceived | ( | _In_ SecureInterfaceLegacySignals^ | sender,
 |  | _In_ SecureInterfaceTextSentReceivedEventArgs^ | args
 | ) |  |
static void CallTextSentSignalHandler | ( | _In_ const alljoyn_interfacedescription_member * | member,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static]
static void CallTextSentSignalHandler | ( | _In_ const alljoyn_interfacedescription_member * | member,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^> ConcatenateAsync | ( | _In_ Platform::String^ | interfaceMemberInStr1,
 |  | _In_ Platform::String^ | interfaceMemberInStr2
 | ) |  |
virtual Windows::Foundation::Collections::IIterator<Platform::Object^> First ( ) [inline, virtual]

Definition at line 33 of file SecureInterfaceStructures.h.

    {
        return m_vector->First();
    }

static Windows::Foundation::IAsyncOperation<SecureInterfaceConsumer^> FromIdAsync ( _In_ Platform::String^ deviceId ) [static]
static Windows::Foundation::IAsyncOperation<SecureInterfaceConsumer^> FromIdAsync | ( | _In_ Platform::String^ | deviceId,
 |  | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment |
 | ) |  |  | [static]
virtual Platform::Object GetAt ( unsigned int index ) [inline, virtual]

Definition at line 38 of file SecureInterfaceStructures.h.

    {
        return m_vector->GetAt(index);
    }

virtual Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^> GetIsUpperCaseEnabledAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
static Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^> GetResultAsync ( SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^ args ) [inline, static]

Definition at line 98 of file SecureInterfaceServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<SecureInterfaceGetIsUpperCaseEnabledResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^> GetResultAsync ( SecureInterfaceConcatenateCalledEventArgs^ args ) [inline, static]

Definition at line 54 of file SecureInterfaceServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<SecureInterfaceConcatenateResult^>
        {
            return t;
        });
    }

void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
QStatus OnPropertyGet | ( | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _Inout_ alljoyn_msgarg | val
 | ) |  |
QStatus OnPropertySet | ( | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | val
 | ) |  |
void OnSessionJoined | ( | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ alljoyn_sessionid | id,
 |  | _In_ PCSTR | joiner
 | ) |  |
void OnSessionLost | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ alljoyn_sessionlostreason | reason
 | ) |  |
void OnSessionMemberAdded | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName
 | ) |  |
void OnSessionMemberRemoved | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName
 | ) |  |
int32 RemoveMemberFromSession ( _In_ Platform::String^ uniqueName )
SecureInterfaceConcatenateCalledEventArgs | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ Platform::String^ | interfaceMemberInStr1,
 |  | _In_ Platform::String^ | interfaceMemberInStr2
 | ) |  |
SecureInterfaceConsumer ( Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment )
int32 SecureInterfaceConsumer::Initialize ( _In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^ serviceInfo )
SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
SecureInterfaceProducer ( Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment )
SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ bool | value
 | ) |  |
virtual Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^> SetIsUpperCaseEnabledAsync | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ bool | value |
 | ) |  |  | [virtual]
Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^> SetIsUpperCaseEnabledAsync ( _In_ bool value )
void Start ( )
void Stop ( )
void TextSent ( _In_ Platform::String^ interfaceMemberMessage )
void TextSent ( _In_ Platform::String^ interfaceMemberMessage )
void UnregisterFromBus ( ) [private]

Member Data Documentation

event Windows::Foundation::EventHandler<Platform::Object^> _ConcatenateCalled [private]

Definition at line 105 of file SecureInterfaceServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _GetIsUpperCaseEnabledRequested [private]

Definition at line 106 of file SecureInterfaceServiceEventAdapter.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> _SessionLost [private]

Definition at line 208 of file SecureInterfaceProducer.h.

event Windows::Foundation::EventHandler<Platform::Object^> _SetIsUpperCaseEnabledRequested [private]

Definition at line 107 of file SecureInterfaceServiceEventAdapter.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> _Stopped [private]

Definition at line 207 of file SecureInterfaceProducer.h.

event Windows::Foundation::EventHandler< Platform::Object^> _TextSentReceived [private]

Definition at line 69 of file SecureInterfaceLegacySignals.h.

Windows::Foundation::EventRegistrationToken m_busAttachmentStateChangedToken [private]

Definition at line 225 of file SecureInterfaceProducer.h.

alljoyn_busobject m_busObject [private]

Definition at line 66 of file SecureInterfaceLegacySignals.h.

int m_completionsRequired [private]

Definition at line 70 of file SecureInterfaceServiceEventArgs.h.

SecureInterfaceConsumer m_consumer [private]

Definition at line 88 of file SecureInterfaceMethodResults.h.

ISignalEmitter m_emitter [private]

Definition at line 66 of file SecureInterfaceSignals.h.

Platform::String m_interfaceMemberInStr1 [private]

Definition at line 75 of file SecureInterfaceServiceEventArgs.h.

Platform::String m_interfaceMemberInStr2 [private]

Definition at line 76 of file SecureInterfaceServiceEventArgs.h.

Platform::String m_interfaceMemberOutStr [private]

Definition at line 66 of file SecureInterfaceMethodResults.h.

std::mutex m_lock [private]

Definition at line 72 of file SecureInterfaceServiceEventArgs.h.

alljoyn_interfacedescription_member m_memberTextSent [private]

Definition at line 71 of file SecureInterfaceLegacySignals.h.

Windows::Devices::AllJoyn::AllJoynMessageInfo m_messageInfo [private]

Definition at line 73 of file SecureInterfaceServiceEventArgs.h.

bool m_raised [private]

Definition at line 69 of file SecureInterfaceServiceEventArgs.h.

SecureInterfaceConcatenateResult m_result [private]

Definition at line 74 of file SecureInterfaceServiceEventArgs.h.

SecureInterfaceGetIsUpperCaseEnabledResult m_result [private]

Definition at line 118 of file SecureInterfaceServiceEventArgs.h.

SecureInterfaceSetIsUpperCaseEnabledResult m_result [private]

Definition at line 166 of file SecureInterfaceServiceEventArgs.h.

ISecureInterfaceService m_serviceInterface [private]

Definition at line 227 of file SecureInterfaceProducer.h.

alljoyn_sessionid m_sessionId [private]

Definition at line 67 of file SecureInterfaceLegacySignals.h.

alljoyn_sessionport m_sessionPort [private]

Definition at line 233 of file SecureInterfaceProducer.h.

alljoyn_sessionportlistener m_sessionPortListener [private]

Definition at line 231 of file SecureInterfaceProducer.h.

SecureInterfaceLegacySignals m_signals [private]

Definition at line 226 of file SecureInterfaceProducer.h.

int32 m_status [private]

Definition at line 62 of file SecureInterfaceMethodResults.h.

concurrency::task_completion_event<SecureInterfaceGetIsUpperCaseEnabledResult^> m_tce [private]

Definition at line 115 of file SecureInterfaceServiceEventArgs.h.

concurrency::task_completion_event<SecureInterfaceSetIsUpperCaseEnabledResult^> m_tce [private]

Definition at line 162 of file SecureInterfaceServiceEventArgs.h.

concurrency::task_completion_event<SecureInterfaceConcatenateResult^> m_tce [private]

Definition at line 71 of file SecureInterfaceServiceEventArgs.h.

bool m_value [private]

Definition at line 129 of file SecureInterfaceMethodResults.h.

std::map<alljoyn_busobject, Platform::WeakReference*> SourceObjects [static, private]

Definition at line 242 of file SecureInterfaceProducer.h.

Property Documentation

internal __pad0__

Definition at line 157 of file SecureInterfaceProducer.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> _IsUpperCaseEnabledChanged

Definition at line 139 of file SecureInterfaceConsumer.h.

event Windows::Foundation::EventHandler< Platform::Object^> _SessionMemberAdded

Definition at line 121 of file SecureInterfaceConsumer.h.

event Windows::Foundation::EventHandler< Platform::Object^> _SessionMemberRemoved

Definition at line 138 of file SecureInterfaceConsumer.h.

internal _In_ PCSTR joiner

Definition at line 157 of file SecureInterfaceProducer.h.

Windows::Devices::AllJoyn::AllJoynBusAttachment m_busAttachment

Definition at line 147 of file SecureInterfaceConsumer.h.

alljoyn_busobject m_busObject

Definition at line 148 of file SecureInterfaceConsumer.h.

Platform::String m_interfaceMemberMessage

Definition at line 44 of file SecureInterfaceEventArgs.h.

PCSTR m_interfaceName [static]

Definition at line 167 of file SecureInterfaceConsumer.h.

alljoyn_busattachment m_nativeBusAttachment

Definition at line 156 of file SecureInterfaceConsumer.h.

alljoyn_busobject m_nativeBusObject

Definition at line 155 of file SecureInterfaceConsumer.h.

alljoyn_proxybusobject m_proxyBusObject

Definition at line 153 of file SecureInterfaceConsumer.h.

Platform::String m_ServiceObjectPath

Definition at line 151 of file SecureInterfaceConsumer.h.

Windows::Devices::AllJoyn::AllJoynSession m_session

Definition at line 149 of file SecureInterfaceConsumer.h.

alljoyn_sessionlistener m_sessionListener

Definition at line 154 of file SecureInterfaceConsumer.h.

SecureInterfaceSignals m_signals

Definition at line 150 of file SecureInterfaceConsumer.h.

Platform::WeakReference * m_weak

Definition at line 159 of file SecureInterfaceConsumer.h.

internal _In_ PCSTR _In_ const alljoyn_sessionopts opts

Definition at line 157 of file SecureInterfaceProducer.h.

static std::map< alljoyn_interfacedescription, Platform::WeakReference * > SourceInterfaces [static]

Definition at line 164 of file SecureInterfaceConsumer.h.

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceEventArgs.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceMethodResults.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.h
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceStructures.h
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComAutoRelease Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

ComAutoRelease Class Reference

#include "LinkList.h"

List of all members.

Public Member Functions

void operator() (IUnknown *p)

Detailed Description

Definition at line 391 of file LinkList.h.

Member Function Documentation

void operator() ( IUnknown * p ) [inline]

Definition at line 394 of file LinkList.h.

    {
        if (p)
        {
            p->Release();
        }
    }

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DynamicCommandBar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • DynamicCommandBar
Static Public Attributes | Protected Member Functions | Properties | Private Attributes

DynamicCommandBar Class Reference

We extend the CommandBar by adding logic to reflow commands as space is reduced. More...

List of all members.

Static Public Attributes

static readonly DependencyProperty | ContentMinWidthProperty

Protected Member Functions

override Size | MeasureOverride (Size availableSize)
override void | OnApplyTemplate ()

Properties

double | ContentMinWidth [get, set]

Private Attributes

Button | moreButton
Stack< Tuple
< ICommandBarElement, double > > 		overflow = new Stack<Tuple<ICommandBarElement, double>>()
Queue< Tuple
< ICommandBarElement, double > > 		separatorQueue = new Queue<Tuple<ICommandBarElement, double>>()
double | separatorQueueWidth = 0.0

Detailed Description

Definition at line 16 of file DynamicCommandBar.cs.

Member Function Documentation

override Size MeasureOverride ( Size availableSize ) [inline, protected]

Definition at line 40 of file DynamicCommandBar.cs.

        {
            var sizeToReport = base.MeasureOverride(availableSize);

            // Account for the size of the Content area
            var contentWidth = this.ContentMinWidth;

            // Account for the size of the More button
            var expandButtonWidth = 0.0;
            if (moreButton != null && moreButton.Visibility == Visibility.Visible)
            {
                expandButtonWidth = moreButton.DesiredSize.Width;
            }

            double requestedWidth = expandButtonWidth + contentWidth;

            // Include the size of all the PrimaryCommands
            foreach (var cmd in this.PrimaryCommands)
            {
                var uie = cmd as UIElement;
                requestedWidth += uie.DesiredSize.Width;
            }

            // First, move items to the overflow until the remaining PrimaryCommands fit
            for (int i = this.PrimaryCommands.Count - 1; i >= 0 && requestedWidth > availableSize.Width; i--)
            {
                var item = this.PrimaryCommands[i];
                var element = item as UIElement;

                if (element == null)
                {
                    continue;
                }

                requestedWidth -= element.DesiredSize.Width;

                if (this.overflow.Count == 0 && this.SecondaryCommands.Count > 0 && !(element is AppBarSeparator))
                {
                    // Insert a separator to differentiate between the items that were already in the overflow versus
                    // those we moved
                    var abs = new AppBarSeparator();
                    abs.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                    this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(abs, abs.DesiredSize.Width));
                    separatorQueueWidth += abs.DesiredSize.Width;
                }

                this.PrimaryCommands.RemoveAt(i);

                // move separators we've queued up
                while (separatorQueue.Count > 0)
                {
                    var next = separatorQueue.Dequeue();
                    separatorQueueWidth -= next.Item2;
                    overflow.Push(next);
                    this.SecondaryCommands.Insert(0, next.Item1);
                }

                // We store the measured size before it moves to overflow and will rely on that value
                // when determining how many items to move back out the overflow.
                overflow.Push(new Tuple<ICommandBarElement, double>(item, element.DesiredSize.Width));

                this.SecondaryCommands.Insert(0, (ICommandBarElement)element);

                // if a separator was adjacent to the one we removed then move the separator to our holding queue so that it doesn't appear without actually separating the content
                var last = this.PrimaryCommands.LastOrDefault() as AppBarSeparator;
                if (last != null)
                {
                    this.PrimaryCommands.RemoveAt(this.PrimaryCommands.Count - 1);
                    this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(last, last.DesiredSize.Width));
                    separatorQueueWidth += last.DesiredSize.Width;
                    requestedWidth -= last.DesiredSize.Width;
                }
            }

            // Next move items out of the overflow if room is available
            while (overflow.Count > 0 && requestedWidth + separatorQueueWidth + overflow.Peek().Item2 <= availableSize.Width)
            {
                var t = overflow.Pop();

                this.SecondaryCommands.RemoveAt(0);

                if (this.overflow.Count == 1 && this.SecondaryCommands.Count > 1)
                {
                    // must be the separator injected earlier
                    overflow.Pop();
                    this.SecondaryCommands.RemoveAt(0);
                }

                if (t.Item1 is AppBarSeparator)
                {
                    this.separatorQueue.Enqueue(t);
                    separatorQueueWidth += t.Item2;
                    continue;
                }
                else
                {
                    while (separatorQueue.Count > 0)
                    {
                        var next = separatorQueue.Dequeue();
                        this.PrimaryCommands.Add(next.Item1);
                        separatorQueueWidth -= next.Item2;
                        requestedWidth += next.Item2;
                    }
                }

                // Sometimes this property is being set to disabled
                ((Control)t.Item1).IsEnabled = true;

                this.PrimaryCommands.Add(t.Item1);
                requestedWidth += t.Item2;

                // check to see if after moving this item we leave a separator at the top of the overflow
                if (this.overflow.Count > 0)
                {
                    var test = this.overflow.Peek();
                    if (test.Item1 is AppBarSeparator)
                    {
                        // we won't leave an orphaned separator
                        this.SecondaryCommands.RemoveAt(0);
                        var top = this.overflow.Pop();

                        var element = top.Item1 as UIElement;
                        element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                        this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(top.Item1, element.DesiredSize.Width));
                        separatorQueueWidth += element.DesiredSize.Width;
                    }
                }
            }

            return sizeToReport;
        }

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 29 of file DynamicCommandBar.cs.

        {
            base.OnApplyTemplate();
            moreButton = this.GetTemplateChild("MoreButton") as Button;
        }

Member Data Documentation

readonly DependencyProperty ContentMinWidthProperty [static]
Initial value:
            DependencyProperty.Register("ContentMinWidth", typeof(double), typeof(DynamicCommandBar), new PropertyMetadata(0.0d))

Definition at line 24 of file DynamicCommandBar.cs.

Button moreButton [private]

Definition at line 28 of file DynamicCommandBar.cs.

Stack<Tuple<ICommandBarElement, double> > overflow = new Stack<Tuple<ICommandBarElement, double>>() [private]

Definition at line 36 of file DynamicCommandBar.cs.

Queue<Tuple<ICommandBarElement, double> > separatorQueue = new Queue<Tuple<ICommandBarElement, double>>() [private]

Definition at line 37 of file DynamicCommandBar.cs.

double separatorQueueWidth = 0.0 [private]

Definition at line 38 of file DynamicCommandBar.cs.

Property Documentation

double ContentMinWidth [get, set]

Definition at line 19 of file DynamicCommandBar.cs.

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/DynamicCommandBar.cs
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario1
Public Member Functions

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Detailed Description

Definition at line 24 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 26 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario2
Public Member Functions

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Detailed Description

Definition at line 21 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 23 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario3
Public Member Functions | Private Member Functions

Scenario3 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3 ()

Private Member Functions

void | CommandBar_Closed (object sender, object e)
void | CommandBar_Closing (object sender, object e)
void | CommandBar_Opened (object sender, object e)
void | CommandBar_Opening (object sender, object e)

Detailed Description

Definition at line 22 of file Scenario3.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 24 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
            MainPage.Current.NotifyUser("CommandBar: Background Opacity at 50%", NotifyType.StatusMessage);
        }

Member Function Documentation

void CommandBar_Closed | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario3.xaml.cs.

        {
            this.translucentBackgroundBrush.Opacity = 0.5;
            MainPage.Current.NotifyUser("CommandBar: CLOSED.  Setting Background Opacity to 50%", NotifyType.StatusMessage);
        }

void CommandBar_Closing | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario3.xaml.cs.

        {
            MainPage.Current.NotifyUser("CommandBar: CLOSING", NotifyType.ErrorMessage);
        }

void CommandBar_Opened | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario3.xaml.cs.

        {
            MainPage.Current.NotifyUser("CommandBar: OPENED", NotifyType.StatusMessage);
        }

void CommandBar_Opening | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario3.xaml.cs.

        {
            this.translucentBackgroundBrush.Opacity = 1.0;
            MainPage.Current.NotifyUser("CommandBar: OPENING.  Setting Background Opacity to 100%", NotifyType.ErrorMessage);
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario3.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario4
Public Member Functions

Scenario4 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4 ()

Detailed Description

Definition at line 21 of file Scenario4.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 23 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario4.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario5
Public Member Functions

Scenario5 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario5 ()

Detailed Description

Definition at line 21 of file Scenario5.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 23 of file Scenario5.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario5.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario6
Public Member Functions

Scenario6 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario6 ()

Detailed Description

Definition at line 21 of file Scenario6.xaml.cs.

Constructor & Destructor Documentation

Scenario6 ( ) [inline]

Definition at line 23 of file Scenario6.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario6.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario7
Public Member Functions | Private Member Functions

Scenario7 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7 ()

Private Member Functions

void | CommandBar_Closed (object sender, object e)
void | CommandBar_Opening (object sender, object e)

Detailed Description

Definition at line 21 of file Scenario7.xaml.cs.

Constructor & Destructor Documentation

Scenario7 ( ) [inline]

Definition at line 23 of file Scenario7.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CommandBar_Closed | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 33 of file Scenario7.xaml.cs.

        {
            this.appbarbutton.IsCompact = !this.appbarbutton.IsCompact;
        }

void CommandBar_Opening | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario7.xaml.cs.

        {
            this.appbarbutton.IsCompact = !this.appbarbutton.IsCompact;
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario7.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Commanding
  • Scenario8
Public Member Functions

Scenario8 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario8 ()

Detailed Description

Definition at line 21 of file Scenario8.xaml.cs.

Constructor & Destructor Documentation

Scenario8 ( ) [inline]

Definition at line 23 of file Scenario8.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlCommanding/cs/Scenario8.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisualProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CompositionVisual
  • VisualProperties
Private Member Functions | Private Attributes

VisualProperties Class Reference

List of all members.

Private Member Functions

Visual | CreateChildElement ()
void IFrameworkView. | Initialize (CoreApplicationView view)
void | InitNewComposition ()
void IFrameworkView. | Load (string unused)
void | OnPointerMoved (CoreWindow window, PointerEventArgs args)
void | OnPointerPressed (CoreWindow window, PointerEventArgs args)
void | OnPointerReleased (CoreWindow window, PointerEventArgs args)
void IFrameworkView. | Run ()
void IFrameworkView. | SetWindow (CoreWindow window)
void IFrameworkView. | Uninitialize ()

Private Attributes

CompositionTarget | _compositionTarget
Compositor | _compositor
ContainerVisual | _currentVisual
bool | _dragging
Vector2 _offsetBias
Random | _random
ContainerVisual | _root
CoreApplicationView | _view
CoreWindow | _window

Detailed Description

Definition at line 30 of file VisualProperties.cs.

Member Function Documentation

Visual CreateChildElement ( ) [inline, private]

Definition at line 297 of file VisualProperties.cs.

        {
            //
            // Each element consists of three visuals, which produce the appearance
            // of a framed rectangle
            //
            var element = _compositor.CreateContainerVisual();
            element.Size = new Vector2(100.0f, 100.0f);

            //
            // Position this visual randomly within our window
            //
            element.Offset = new Vector3((float)(_random.NextDouble() * 400), (float)(_random.NextDouble() * 400), 0.0f);

            //
            // The outer rectangle is always white
            //
            var visual = _compositor.CreateSpriteVisual();
            element.Children.InsertAtTop(visual);
            visual.Brush = _compositor.CreateColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
            visual.Size = new Vector2(100.0f, 100.0f);

            //
            // The inner rectangle is inset from the outer by three pixels all around
            //
            var child = _compositor.CreateSpriteVisual();
            visual.Children.InsertAtTop(child);
            child.Offset = new Vector3(3.0f, 3.0f, 0.0f);
            child.Size = new Vector2(94.0f, 94.0f);

            //
            // Pick a random color for every rectangle
            //
            byte red = (byte)(0xFF * (0.2f + (_random.NextDouble() / 0.8f)));
            byte green = (byte)(0xFF * (0.2f + (_random.NextDouble() / 0.8f)));
            byte blue = (byte)(0xFF * (0.2f + (_random.NextDouble() / 0.8f)));
            child.Brush = _compositor.CreateColorBrush(Color.FromArgb(0xFF, red, green, blue));

            //
            // Make the subtree root visual partially transparent. This will cause each visual in the subtree
            // to render partially transparent, since a visual's opacity is multiplied with its parent's
            // opacity
            //
            element.Opacity = 0.8f;

            return element;
        }

void IFrameworkView. Initialize ( CoreApplicationView view ) [inline, private]

Definition at line 41 of file VisualProperties.cs.

        {
            _view = view;
            _random = new Random();
        }

void InitNewComposition ( ) [inline, private]

Definition at line 264 of file VisualProperties.cs.

        {
            //
            // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
            // the CoreWindow.
            //

            _compositor = new Compositor();

            _root = _compositor.CreateContainerVisual();

            _compositionTarget = _compositor.CreateTargetForCurrentView();
            _compositionTarget.Root = _root;

            //
            // Create a few visuals for our window
            //
            for (int index = 0; index < 20; index++)
            {
                _root.Children.InsertAtTop(CreateChildElement());
            }
        }

void IFrameworkView. Load ( string unused ) [inline, private]

Definition at line 220 of file VisualProperties.cs.

        {

        }

void OnPointerMoved | ( | CoreWindow | window,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 125 of file VisualProperties.cs.

        {
            //
            // If a visual is selected, drag it with the pointer position and
            // make it opaque while we drag it
            //
            if (_currentVisual != null)
            {
                //
                // Set up the properties of the visual the first time it is
                // dragged. This will last for the duration of the drag
                //
                if (!_dragging)
                {
                    _currentVisual.Opacity = 1.0f;

                    //
                    // Transform the first child of the current visual so that
                    // the image is rotated
                    //
                    foreach (var child in _currentVisual.Children)
                    {
                        child.RotationAngleInDegrees = 45.0f;
                        child.CenterPoint = new Vector3(_currentVisual.Size.X / 2, _currentVisual.Size.Y / 2, 0);
                        break;
                    }

                    //
                    // Clip the visual to its original layout rect by using an inset
                    // clip with a one-pixel margin all around
                    //
                    var clip = _compositor.CreateInsetClip();
                    clip.LeftInset = 1.0f;
                    clip.RightInset = 1.0f;
                    clip.TopInset = 1.0f;
                    clip.BottomInset = 1.0f;
                    _currentVisual.Clip = clip;

                    _dragging = true;
                }

                Point position = args.CurrentPoint.Position;
                _currentVisual.Offset = new Vector3((float)(position.X + _offsetBias.X),
                                                    (float)(position.Y + _offsetBias.Y),
                                                    0.0f);
            }
        }

void OnPointerPressed | ( | CoreWindow | window,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 75 of file VisualProperties.cs.

        {
            Point position = args.CurrentPoint.Position;

            //
            // Walk our list of visuals to determine who, if anybody, was selected
            //
            foreach (var child in _root.Children)
            {
                //
                // Did we hit this child?
                //
                Vector3 offset = child.Offset;
                Vector2 size = child.Size;

                if ((position.X >= offset.X) &&
                    (position.X < offset.X + size.X) &&
                    (position.Y >= offset.Y) &&
                    (position.Y < offset.Y + size.Y))
                {
                    //
                    // This child was hit. Since the children are stored back to front,
                    // the last one hit is the front-most one so it wins
                    //
                    _currentVisual = child as ContainerVisual;
                    _offsetBias = new Vector2((float)(offset.X - position.X),
                                              (float)(offset.Y - position.Y));
                }
            }

            //
            // If a visual was hit, bring it to the front of the Z order
            //
            if (_currentVisual != null)
            {
                ContainerVisual parent = _currentVisual.Parent as ContainerVisual;
                parent.Children.Remove(_currentVisual);
                parent.Children.InsertAtTop(_currentVisual);
            }
        }

void OnPointerReleased | ( | CoreWindow | window,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 182 of file VisualProperties.cs.

        {
            //
            // If a visual was selected, make it transparent again when it is
            // released and restore the transform and clip
            //
            if (_currentVisual != null)
            {
                if (_dragging)
                {
                    //
                    // Remove the transform from the first child
                    //
                    foreach (var child in _currentVisual.Children)
                    {
                        child.RotationAngle = 0.0f;
                        child.CenterPoint = new Vector3(0.0f, 0.0f, 0.0f);
                        break;
                    }

                    _currentVisual.Opacity = 0.8f;
                    _currentVisual.Clip = null;
                    _dragging = false;
                }

                _currentVisual = null;
            }
        }

void IFrameworkView. Run ( ) [inline, private]

Definition at line 234 of file VisualProperties.cs.

        {
            _window.Activate();
            _window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit);
        }

void IFrameworkView. SetWindow ( CoreWindow window ) [inline, private]

Definition at line 57 of file VisualProperties.cs.

        {
            _window = window;
            InitNewComposition();
            _window.PointerPressed += OnPointerPressed;
            _window.PointerMoved += OnPointerMoved;
            _window.PointerReleased += OnPointerReleased;
        }

void IFrameworkView. Uninitialize ( ) [inline, private]

Definition at line 249 of file VisualProperties.cs.

        {
            _window = null;
            _view = null;
        }

Member Data Documentation

CompositionTarget _compositionTarget [private]

Definition at line 351 of file VisualProperties.cs.

Compositor _compositor [private]

Definition at line 350 of file VisualProperties.cs.

ContainerVisual _currentVisual [private]

Definition at line 353 of file VisualProperties.cs.

bool _dragging [private]

Definition at line 355 of file VisualProperties.cs.

Vector2 _offsetBias [private]

Definition at line 354 of file VisualProperties.cs.

Random _random [private]

Definition at line 358 of file VisualProperties.cs.

ContainerVisual _root [private]

Definition at line 352 of file VisualProperties.cs.

CoreApplicationView _view [private]

Definition at line 347 of file VisualProperties.cs.

CoreWindow _window [private]

Definition at line 346 of file VisualProperties.cs.

The documentation for this class was generated from the following file:
  • CompositionVisual/cs/VisualProperties.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisualPropertiesFactory Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CompositionVisual
  • VisualPropertiesFactory
Private Member Functions | Static Private Member Functions

VisualPropertiesFactory Class Reference

List of all members.

Private Member Functions

IFrameworkView
IFrameworkViewSource. 		CreateView ()

Static Private Member Functions

static int Main (string[] args)

Detailed Description

Definition at line 362 of file VisualProperties.cs.

Member Function Documentation

IFrameworkView IFrameworkViewSource. CreateView ( ) [inline, private]

Definition at line 373 of file VisualProperties.cs.

        {
            return new VisualProperties();
        }

static int Main ( string[] args ) [inline, static, private]

Definition at line 385 of file VisualProperties.cs.

        {
            CoreApplication.Run(new VisualPropertiesFactory());

            return 0;
        }

The documentation for this class was generated from the following file:
  • CompositionVisual/cs/VisualProperties.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Compression
  • Scenario1
Public Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Private Member Functions

void | CompressAlgorithmComboBox_SelectionChanged (object sender, RoutedEventArgs e)
CompressAlgorithm | CompressAlgorithmFromComboBoxItem (ComboBoxItem item)
async void | CompressFile (CompressAlgorithm?Algorithm, StorageFile originalFile)
void | CompressFileButton_Click (object sender, RoutedEventArgs e)
async void | DoScenario (CompressAlgorithm?Algorithm)
void | UpdateDescriptionVisibility (ComboBoxItem item, Visibility visibility)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 38 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 45 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CompressAlgorithmComboBox_SelectionChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 195 of file Scenario1.xaml.cs.

        {
            var args = e as SelectionChangedEventArgs;

            if (args == null)
            {
                return;
            }
            if (CompressAlgorithmComboBox == null)
            {
                return;
            }

            if (args.AddedItems.Count != 0 && args.RemovedItems.Count == 0)
            {
                ComboBoxItem addedItem = args.AddedItems[0] as ComboBoxItem;
                if (addedItem.Content.Equals("Default"))
                {
                    UpdateDescriptionVisibility(addedItem, Visibility.Visible);
                }

                return;
            }
            else
            {
                Debug.Assert(1 == args.AddedItems.Count && 1 == args.RemovedItems.Count);

                ComboBoxItem addedItem = args.AddedItems[0] as ComboBoxItem;
                ComboBoxItem removedItem = args.RemovedItems[0] as ComboBoxItem;

                Debug.Assert(null != addedItem && null != removedItem);

                UpdateDescriptionVisibility(addedItem, Visibility.Visible);
                UpdateDescriptionVisibility(removedItem, Visibility.Collapsed);
            }
        }

CompressAlgorithm CompressAlgorithmFromComboBoxItem ( ComboBoxItem item ) [inline, private]

Definition at line 232 of file Scenario1.xaml.cs.

        {
            CompressAlgorithm? Algorithm = null;

            if (item == DefaultComboBoxItem)
            {
                Algorithm = null;
            }
            else if (item == XpressComboBoxItem)
            {
                Algorithm = CompressAlgorithm.Xpress;
            }
            else if (item == XpressHuffComboBoxItem)
            {
                Algorithm = CompressAlgorithm.XpressHuff;
            }
            else if (item == MszipComboBoxItem)
            {
                Algorithm = CompressAlgorithm.Mszip;
            }
            else if (item == LzmsComboBoxItem)
            {
                Algorithm = CompressAlgorithm.Lzms;
            }
            else
            {
                Algorithm = CompressAlgorithm.InvalidAlgorithm;
            }

            return Algorithm;
        }

async void CompressFile | ( | CompressAlgorithm? | Algorithm,
 |  | StorageFile | originalFile |
 | ) |  |  | [inline, private]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 94 of file Scenario1.xaml.cs.

        {
            Progress.Text = "";

            try
            {
                Progress.Text += String.Format("\"{0}\" has been picked\n", originalFile.Name);

                var compressedFilename = originalFile.Name + ".compressed";
                var compressedFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(compressedFilename, CreationCollisionOption.GenerateUniqueName);
                Progress.Text += String.Format("\"{0}\" has been created to store compressed data\n", compressedFile.Path);

                // ** DO COMPRESSION **
                // Following code actually performs compression from original file to the newly created
                // compressed file. In order to do so it:
                // 1. Opens input for the original file.
                // 2. Opens output stream on the file to be compressed and wraps it into Compressor object.
                // 3. Copies original stream into Compressor wrapper.
                // 4. Finalizes compressor - it puts termination mark into stream and flushes all intermediate
                //    buffers.
                using (var originalInput = await originalFile.OpenReadAsync())
                using (var compressedOutput = await compressedFile.OpenAsync(FileAccessMode.ReadWrite))
                using (var compressor = !Algorithm.HasValue ?
                    new Compressor(compressedOutput.GetOutputStreamAt(0)) :
                    new Compressor(compressedOutput.GetOutputStreamAt(0), Algorithm.Value, 0))
                {
                    Progress.Text += "All streams wired for compression\n";
                    var bytesCompressed = await RandomAccessStream.CopyAsync(originalInput, compressor);
                    var finished = await compressor.FinishAsync();
                    Progress.Text += String.Format("Compressed {0} bytes into {1}\n", bytesCompressed, compressedOutput.Size);
                }

                var decompressedFilename = originalFile.Name + ".decompressed";
                var decompressedFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(decompressedFilename, CreationCollisionOption.GenerateUniqueName);
                Progress.Text += String.Format("\"{0}\" has been created to store decompressed data\n", decompressedFile.Path);

                // ** DO DECOMPRESSION **
                // Following code performs decompression from the just compressed file to the
                // decompressed file. In order to do so it:
                // 1. Opens input stream on compressed file and wraps it into Decompressor object.
                // 2. Opens output stream from the file that will store decompressed data.
                // 3. Copies data from Decompressor stream into decompressed file stream.
                using (var compressedInput = await compressedFile.OpenSequentialReadAsync())
                using (var decompressor = new Decompressor(compressedInput))
                using (var decompressedOutput = await decompressedFile.OpenAsync(FileAccessMode.ReadWrite))
                {
                    Progress.Text += "All streams wired for decompression\n";
                    var bytesDecompressed = await RandomAccessStream.CopyAsync(decompressor, decompressedOutput);
                    Progress.Text += String.Format("Decompressed {0} bytes of data\n", bytesDecompressed);
                }

                rootPage.NotifyUser("All done", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
            }
        }

void CompressFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 294 of file Scenario1.xaml.cs.

        {
            ComboBoxItem item = CompressAlgorithmComboBox.SelectedItem as ComboBoxItem;

            if (item == null)
            {
                return;
            }

            CompressAlgorithm? Algorithm = CompressAlgorithmFromComboBoxItem(item);

            if (Algorithm == CompressAlgorithm.InvalidAlgorithm)
            {
                return;
            }

            DoScenario(Algorithm);
        }

async void DoScenario ( CompressAlgorithm? Algorithm ) [inline, private]

This is the main scenario worker.

Parameters:
Algorithm Comression algorithm to use. If no value is provided compressor will be created using Compressor(IInputStream) constructor, otherwise extended version will be used: Compressor(IInputStream, CompressAlgorithm, uint)

Definition at line 164 of file Scenario1.xaml.cs.

        {
            try
            {
                rootPage.NotifyUser("Working...", NotifyType.StatusMessage);

#if WINDOWS_PHONE_APP
                ShowFileOpen(Algorithm);
#else
                StorageFile originalFile;

                var picker = new FileOpenPicker();

                picker.FileTypeFilter.Add("*");

                originalFile = await picker.PickSingleFileAsync();
                if (originalFile == null)
                {
                    throw new OperationCanceledException("No file has been selected");
                }

                CompressFile(Algorithm, originalFile);
#endif
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
            }
        }

void UpdateDescriptionVisibility | ( | ComboBoxItem | item,
 |  | Visibility | visibility |
 | ) |  |  | [inline, private]

Definition at line 264 of file Scenario1.xaml.cs.

        {
            TextBlock textBlock = null;

            CompressAlgorithm? Algorithm = CompressAlgorithmFromComboBoxItem(item);

            switch (Algorithm)
            {
            case null:
                textBlock = DefaultTextBlock;
                break;
            case CompressAlgorithm.Xpress:
                textBlock = XpressTextBlock;
                break;
            case CompressAlgorithm.XpressHuff:
                textBlock = XpressHuffTextBlock;
                break;
            case CompressAlgorithm.Mszip:
                textBlock = MszipTextBlock;
                break;
            case CompressAlgorithm.Lzms:
                textBlock = LzmsTextBlock;
                break;
            default:
                return;
            }

            textBlock.Visibility = visibility;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 43 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • Compression/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComPtrList< T, NULLABLE > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Types | Public Member Functions | Protected Member Functions

ComPtrList< T, NULLABLE > Class Template Reference

#include "LinkList.h"

Inherits List< T * >.

List of all members.

Public Types

typedef T * | Ptr

Public Member Functions

~ComPtrList ()
void | Clear ()

Protected Member Functions

HRESULT | GetItem (const Node *pNode, Ptr *ppItem)
HRESULT | InsertAfter (Ptr item, Node *pBefore)
HRESULT | RemoveItem (Node *pNode, Ptr *ppItem)

Detailed Description

template<class T, bool NULLABLE = FALSE>
class ComPtrList< T, NULLABLE >

Definition at line 429 of file LinkList.h.

Member Typedef Documentation

typedef T* Ptr

Definition at line 433 of file LinkList.h.

Constructor & Destructor Documentation

~ComPtrList ( ) [inline]

Definition at line 441 of file LinkList.h.

    {
        Clear();
    }

Member Function Documentation

void Clear ( ) [inline, virtual]

Reimplemented from List< T * >.

Definition at line 435 of file LinkList.h.

    {
        ComAutoRelease car;
        List<Ptr>::Clear(car);
    }

HRESULT GetItem | ( | const Node * | pNode,
 |  | Ptr * | ppItem |
 | ) |  |  | [inline, protected]

Definition at line 468 of file LinkList.h.

    {
        Ptr pItem = nullptr;

        // The base class gives us the pointer without AddRef'ing it.
        // If we return the pointer to the caller, we must AddRef().
        HRESULT hr = List<Ptr>::GetItem(pNode, &pItem);
        if (SUCCEEDED(hr))
        {
            assert(pItem || NULLABLE);
            if (pItem)
            {
                *ppItem = pItem;
                (*ppItem)->AddRef();
            }
        }
        return hr;
    }

HRESULT InsertAfter | ( | Ptr | item,
 |  | Node * | pBefore |
 | ) |  |  | [inline, protected]

Definition at line 447 of file LinkList.h.

    {
        // Do not allow nullptr item pointers unless NULLABLE is true.
        if (item == nullptr && !NULLABLE)
        {
            return E_POINTER;
        }

        if (item)
        {
            item->AddRef();
        }

        HRESULT hr = List<Ptr>::InsertAfter(item, pBefore);
        if (FAILED(hr) && item != nullptr)
        {
            item->Release();
        }
        return hr;
    }

HRESULT RemoveItem | ( | Node * | pNode,
 |  | Ptr * | ppItem |
 | ) |  |  | [inline, protected]

Definition at line 487 of file LinkList.h.

    {
        // ppItem can be nullptr, but we need to get the
        // item so that we can release it.

        // If ppItem is not nullptr, we will AddRef it on the way out.

        Ptr pItem = nullptr;

        HRESULT hr = List<Ptr>::RemoveItem(pNode, &pItem);

        if (SUCCEEDED(hr))
        {
            assert(pItem || NULLABLE);
            if (ppItem && pItem)
            {
                *ppItem = pItem;
                (*ppItem)->AddRef();
            }

            if (pItem)
            {
                pItem->Release();
                pItem = nullptr;
            }
        }

        return hr;
    }

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConstantBufferChangeOnResize Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ConstantBufferChangeOnResize Struct Reference

#include "ConstantBuffers.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 projection

Detailed Description

Definition at line 34 of file ConstantBuffers.h.

Member Data Documentation

DirectX::XMFLOAT4X4 projection

Definition at line 36 of file ConstantBuffers.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConstantBufferChangesEveryFrame Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ConstantBufferChangesEveryFrame Struct Reference

#include "ConstantBuffers.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 view

Detailed Description

Definition at line 39 of file ConstantBuffers.h.

Member Data Documentation

DirectX::XMFLOAT4X4 view

Definition at line 41 of file ConstantBuffers.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConstantBufferChangesEveryPrim Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ConstantBufferChangesEveryPrim Struct Reference

#include "ConstantBuffers.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | diffuseColor
DirectX::XMFLOAT4 | meshColor
DirectX::XMFLOAT4 | specularColor
float | specularPower
DirectX::XMFLOAT4X4 | worldMatrix

Detailed Description

Definition at line 44 of file ConstantBuffers.h.

Member Data Documentation

DirectX::XMFLOAT4 diffuseColor

Definition at line 48 of file ConstantBuffers.h.

DirectX::XMFLOAT4 meshColor

Definition at line 47 of file ConstantBuffers.h.

DirectX::XMFLOAT4 specularColor

Definition at line 49 of file ConstantBuffers.h.

float specularPower

Definition at line 50 of file ConstantBuffers.h.

DirectX::XMFLOAT4X4 worldMatrix

Definition at line 46 of file ConstantBuffers.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConstantBufferNeverChanges Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ConstantBufferNeverChanges Struct Reference

#include "ConstantBuffers.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | lightColor
DirectX::XMFLOAT4 | lightPosition [4]

Detailed Description

Definition at line 28 of file ConstantBuffers.h.

Member Data Documentation

DirectX::XMFLOAT4 lightColor

Definition at line 31 of file ConstantBuffers.h.

DirectX::XMFLOAT4 lightPosition[4]

Definition at line 30 of file ConstantBuffers.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Message Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CredentialPicker
  • Scenario1_Message
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Message Class Reference

List of all members.

Public Member Functions

Scenario1_Message ()

Private Member Functions

async void | Launch_Click (object sender, RoutedEventArgs e)
void | SetError (string err)
void | SetResult (CredentialPickerResults res)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 15 of file Scenario1_Message.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Message ( ) [inline]

Definition at line 21 of file Scenario1_Message.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario1_Message.xaml.cs.

        {
            if ((Target.Text.Length != 0) && (Message.Text.Length != 0))
            {
                try
                {
                    CredentialPickerResults credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(Target.Text, Message.Text);
                    SetResult(credPickerResults);
                }
                catch(Exception ex)
                {
                    SetError(ex.GetType().ToString() + ": " + ex.Message);
                }
            }

        }

void SetError ( string err ) [inline, private]

Definition at line 26 of file Scenario1_Message.xaml.cs.

        {
            rootPage.NotifyUser(err, NotifyType.ErrorMessage);
        }

void SetResult ( CredentialPickerResults res ) [inline, private]

Definition at line 31 of file Scenario1_Message.xaml.cs.

        {
            if (res.ErrorCode == 0)
            {
                Status.Text = String.Format("OK");
            }
            else
            {
                Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
            }
            Domain.Text = res.CredentialDomainName;
            Username.Text = res.CredentialUserName;
            Password.Text = res.CredentialPassword;
            CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
            switch (res.CredentialSaveOption)
            {
                case CredentialSaveOption.Hidden:
                    CheckboxState.Text = "Hidden";
                    break;
                case CredentialSaveOption.Selected:
                    CheckboxState.Text = "Selected";
                    break;
                case CredentialSaveOption.Unselected:
                    CheckboxState.Text = "Unselected";
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 19 of file Scenario1_Message.xaml.cs.

The documentation for this class was generated from the following file:
  • CredentialPicker/cs/Scenario1_Message.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MessageCaption Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CredentialPicker
  • Scenario2_MessageCaption
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_MessageCaption Class Reference

List of all members.

Public Member Functions

Scenario2_MessageCaption ()

Private Member Functions

async void | Launch_Click (object sender, RoutedEventArgs e)
void | SetError (string err)
void | SetResult (CredentialPickerResults res)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 15 of file Scenario2_MessageCaption.xaml.cs.

Constructor & Destructor Documentation

Scenario2_MessageCaption ( ) [inline]

Definition at line 21 of file Scenario2_MessageCaption.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file Scenario2_MessageCaption.xaml.cs.

        {
            if ((Target.Text != "") && (Message.Text != "") && (Caption.Text != ""))
            {
                var credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(Target.Text, Message.Text, Caption.Text);
                SetResult(credPickerResults);
            }
        }

void SetError ( string err ) [inline, private]

Definition at line 26 of file Scenario2_MessageCaption.xaml.cs.

        {
            rootPage.NotifyUser(err, NotifyType.ErrorMessage);
        }

void SetResult ( CredentialPickerResults res ) [inline, private]

Definition at line 31 of file Scenario2_MessageCaption.xaml.cs.

        {
            if (res.ErrorCode == 0)
            {
                Status.Text = String.Format("OK");
            }
            else
            {
                Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
            }

            Domain.Text = res.CredentialDomainName;
            Username.Text = res.CredentialUserName;
            Password.Text = res.CredentialPassword;
            CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
            switch (res.CredentialSaveOption)
            {
                case CredentialSaveOption.Hidden:
                    CheckboxState.Text = "Hidden";
                    break;
                case CredentialSaveOption.Selected:
                    CheckboxState.Text = "Selected";
                    break;
                case CredentialSaveOption.Unselected:
                    CheckboxState.Text = "Unselected";
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 19 of file Scenario2_MessageCaption.xaml.cs.

The documentation for this class was generated from the following file:
  • CredentialPicker/cs/Scenario2_MessageCaption.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CredentialPickerOptions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CredentialPicker
  • Scenario3_CredentialPickerOptions
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_CredentialPickerOptions Class Reference

List of all members.

Public Member Functions

Scenario3_CredentialPickerOptions ()

Private Member Functions

async void | Launch_Click (object sender, RoutedEventArgs e)
void | Protocol_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | SetError (string err)
void | SetPasswordExplainVisibility (bool isShown)
void | SetResult (CredentialPickerResults res)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 15 of file Scenario3_CredentialPickerOptions.xaml.cs.

Constructor & Destructor Documentation

Scenario3_CredentialPickerOptions ( ) [inline]

Definition at line 21 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            if ((Target.Text == "") || (Message.Text == "") || (Caption.Text == ""))
            {
                return;
            }

            CredentialPickerOptions credPickerOptions = new CredentialPickerOptions();
            credPickerOptions.Message = Message.Text;
            credPickerOptions.Caption = Caption.Text;
            credPickerOptions.TargetName = Target.Text;
            credPickerOptions.AlwaysDisplayDialog = (AlwaysShowDialog.IsChecked == true);
            if (ProtocolSelection.SelectedItem == null)
            {
                //default protocol, if no selection
                credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Negotiate;
            }
            else
            {
                string selectedProtocol = ((ComboBoxItem)ProtocolSelection.SelectedItem).Content.ToString();
                if (selectedProtocol.Equals("Kerberos", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Kerberos;
                }
                else if (selectedProtocol.Equals("Negotiate", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Negotiate;
                }
                else if (selectedProtocol.Equals("NTLM", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Ntlm;
                }
                else if (selectedProtocol.Equals("CredSsp", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.CredSsp;
                }
                else if (selectedProtocol.Equals("Basic", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Basic;
                }
                else if (selectedProtocol.Equals("Digest", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Digest;
                }
                else if (selectedProtocol.Equals("Custom", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (CustomProtocol.Text != null && CustomProtocol.Text != String.Empty)
                    {
                        credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Custom;
                        credPickerOptions.CustomAuthenticationProtocol = CustomProtocol.Text;
                    }
                    else
                    {
                        rootPage.NotifyUser("Please enter a custom protocol", NotifyType.ErrorMessage);
                    }
                }
            }

            if (SaveCheckboxSelection.SelectedItem != null)
            {
                string checkboxState = ((ComboBoxItem)SaveCheckboxSelection.SelectedItem).Content.ToString();
                if (checkboxState.Equals("Hidden",StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.CredentialSaveOption = CredentialSaveOption.Hidden;
                }
                else if (checkboxState.Equals("Selected", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.CredentialSaveOption = CredentialSaveOption.Selected;
                }
                else if (checkboxState.Equals("Unselected", StringComparison.CurrentCultureIgnoreCase))
                {
                    credPickerOptions.CredentialSaveOption = CredentialSaveOption.Unselected;
                }
            }

            var credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(credPickerOptions);
            SetResult(credPickerResults);
        }

void Protocol_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 154 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            ComboBox box = sender as ComboBox;
            if (CustomProtocol == null || ProtocolSelection == null || ProtocolSelection.SelectedItem == null)
            {
                //return if this was triggered before all components are initialized
                return;
            }

            string selectedProtocol = ((ComboBoxItem)ProtocolSelection.SelectedItem).Content.ToString();

            if (selectedProtocol.Equals("Custom", StringComparison.CurrentCultureIgnoreCase))
            {
                CustomProtocol.IsEnabled = true;
            }
            else
            {
                CustomProtocol.IsEnabled = false;
                //Basic and Digest return plaintext passwords
                if (selectedProtocol.Equals("Basic",StringComparison.CurrentCultureIgnoreCase))
                {
                    SetPasswordExplainVisibility(false);
                }
                else if (selectedProtocol.Equals("Digest",StringComparison.CurrentCultureIgnoreCase))
                {
                    SetPasswordExplainVisibility(false);
                }
                else
                {
                    SetPasswordExplainVisibility(true);
                }
            }
        }

void SetError ( string err ) [inline, private]

Definition at line 26 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            rootPage.NotifyUser(err, NotifyType.ErrorMessage);
        }

void SetPasswordExplainVisibility ( bool isShown ) [inline, private]

Definition at line 31 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            if (isShown)
            {
                PasswordExplain1.Visibility = Windows.UI.Xaml.Visibility.Visible;
                PasswordExplain2.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                PasswordExplain1.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                PasswordExplain2.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }

void SetResult ( CredentialPickerResults res ) [inline, private]

Definition at line 45 of file Scenario3_CredentialPickerOptions.xaml.cs.

        {
            if (res.ErrorCode == 0)
            {
                Status.Text = String.Format("OK");
            }
            else
            {
                Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
            }

            Domain.Text = res.CredentialDomainName;
            Username.Text = res.CredentialUserName;
            Password.Text = res.CredentialPassword;
            CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
            switch (res.CredentialSaveOption)
            {
                case CredentialSaveOption.Hidden:
                    CheckboxState.Text = "Hidden";
                    break;
                case CredentialSaveOption.Selected:
                    CheckboxState.Text = "Selected";
                    break;
                case CredentialSaveOption.Unselected:
                    CheckboxState.Text = "Unselected";
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 19 of file Scenario3_CredentialPickerOptions.xaml.cs.

The documentation for this class was generated from the following file:
  • CredentialPicker/cs/Scenario3_CredentialPickerOptions.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CritSec Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

CritSec Class Reference

#include "CritSec.h"

List of all members.

Public Member Functions

CritSec ()
~CritSec ()
_Acquires_lock_ (m_criticalSection) void Lock()
_Releases_lock_ (m_criticalSection) void Unlock()

Public Attributes

CRITICAL_SECTION m_criticalSection

Detailed Description

Definition at line 8 of file CritSec.h.

Constructor & Destructor Documentation

CritSec ( ) [inline]

Definition at line 13 of file CritSec.h.

    {
        InitializeCriticalSectionEx(&m_criticalSection, 100, 0);
    }

~CritSec ( ) [inline]

Definition at line 18 of file CritSec.h.

    {
        DeleteCriticalSection(&m_criticalSection);
    }

Member Function Documentation

_Acquires_lock_ ( m_criticalSection ) [inline]

Definition at line 23 of file CritSec.h.

    {
        EnterCriticalSection(&m_criticalSection);
    }

_Releases_lock_ ( m_criticalSection ) [inline]

Definition at line 29 of file CritSec.h.

    {
        LeaveCriticalSection(&m_criticalSection);
    }

Member Data Documentation

CRITICAL_SECTION m_criticalSection

Definition at line 11 of file CritSec.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/CritSec.h
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSampleService Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Member Functions | Private Attributes

CSampleService Class Reference

#include "SampleService.h"

Inherits CServiceBase.

List of all members.

Public Member Functions

CSampleService (PWSTR pszServiceName, BOOL fCanStop=TRUE, BOOL fCanShutdown=TRUE, BOOL fCanPauseContinue=FALSE)
virtual | ~CSampleService (void)
void | ConsoleRun ()
bool | IsConsoleRun ()
void | WriteEventLogEntry (PWSTR pszMessage, BYTE bLevel) override

Protected Member Functions

virtual void | OnStart (DWORD dwArgc, PWSTR *pszArgv) override
virtual void | OnStop () override

Private Attributes

bool | m_runningInConsole = false
PTP_WORK | m_work = nullptr

Detailed Description

Definition at line 21 of file SampleService.h.

Constructor & Destructor Documentation

CSampleService | ( | PWSTR | pszServiceName,
 |  | BOOL | fCanStop = TRUE,
 |  | BOOL | fCanShutdown = TRUE,
 |  | BOOL | fCanPauseContinue = FALSE
 | ) |  |

Definition at line 20 of file SampleService.cpp.

    : CServiceBase(pszServiceName, fCanStop, fCanShutdown, fCanPauseContinue)
{
}

~CSampleService ( void ) [virtual]

Definition at line 38 of file SampleService.cpp.

{
}

Member Function Documentation

void ConsoleRun ( )

Definition at line 120 of file SampleService.cpp.

{
    m_runningInConsole = true;

    WriteEventLogEntry(L"Starting Rpc Server..", TRACE_LEVEL_INFORMATION);
    long status = RpcServerStart();

    if (status)
    {
        printf_s("RpcServerConnect returned: 0x%x\n", status);
        WriteEventLogEntry(L"Starting Rpc Server..", TRACE_LEVEL_INFORMATION);
        exit(static_cast<int>(status));
    }
}

bool IsConsoleRun ( ) [inline]

Definition at line 30 of file SampleService.h.

    {
        return m_runningInConsole;
    }

virtual void OnStart | ( | DWORD | dwArgc,
 |  | PWSTR * | pszArgv |
 | ) |  |  | [override, protected, virtual]

Reimplemented from CServiceBase.

void OnStop ( ) [override, protected, virtual]

Reimplemented from CServiceBase.

Definition at line 147 of file SampleService.cpp.

{
    // Log a service stop message to the Application log.
    WriteEventLogEntry(L"CppWindowsService in OnStop", TRACE_LEVEL_INFORMATION);

    // Instruct server to stop listening to remote procedure calls and
    // unregister rpc interface
    RpcServerDisconnect();
}

void WriteEventLogEntry | ( | PWSTR | pszMessage,
 |  | BYTE | bLevel |
 | ) |  |  | [override, virtual]

Reimplemented from CServiceBase.

Definition at line 29 of file SampleService.cpp.

{
    if (IsConsoleRun())
    {
        wprintf(L"%d: %ls\n", bLevel, pszMessage);
    }
    __super::WriteEventLogEntry(pszMessage, bLevel);
}

Member Data Documentation

bool m_runningInConsole = false [private]

Definition at line 45 of file SampleService.h.

PTP_WORK m_work = nullptr [private]

Definition at line 44 of file SampleService.h.

The documentation for this class was generated from the following files:
  • CustomCapability/Service/Server/SampleService.h
  • CustomCapability/Service/Server/SampleService.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CServiceBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

CServiceBase Class Reference

#include "ServiceBase.h"

Inherited by CSampleService.

List of all members.

Public Member Functions

CServiceBase (PWSTR pszServiceName, BOOL fCanStop=TRUE, BOOL fCanShutdown=TRUE, BOOL fCanPauseContinue=FALSE)
virtual | ~CServiceBase (void)
void | Stop ()

Static Public Member Functions

static BOOL | Run (CServiceBase &service)

Protected Member Functions

virtual void | OnContinue ()
virtual void | OnPause ()
virtual void | OnShutdown ()
virtual void | OnStart (DWORD dwArgc, PWSTR *pszArgv)
virtual void | OnStop ()
void | SetServiceStatus (DWORD dwCurrentState, DWORD dwWin32ExitCode=NO_ERROR, DWORD dwWaitHint=0)
void | WriteErrorLogEntry (PWSTR pszFunction, DWORD dwError=GetLastError())
virtual void | WriteEventLogEntry (PWSTR pszMessage, BYTE bLevel)

Private Member Functions

void | Continue ()
void | Pause ()
void | Shutdown ()
void | Start (DWORD dwArgc, PWSTR *pszArgv)

Static Private Member Functions

static void WINAPI | ServiceCtrlHandler (DWORD dwCtrl)
static void WINAPI | ServiceMain (DWORD dwArgc, LPWSTR *lpszArgv)

Private Attributes

REGHANDLE | m_etwRegHandle
PWSTR | m_name
SERVICE_STATUS | m_status
SERVICE_STATUS_HANDLE | m_statusHandle

Static Private Attributes

static CServiceBase * | s_service = nullptr

Detailed Description

Definition at line 21 of file ServiceBase.h.

Constructor & Destructor Documentation

CServiceBase | ( | PWSTR | pszServiceName,
 |  | BOOL | fCanStop = TRUE,
 |  | BOOL | fCanShutdown = TRUE,
 |  | BOOL | fCanPauseContinue = FALSE
 | ) |  |

fCanShutdown and fCanPauseContinue) allow you to specify whether the

Definition at line 152 of file ServiceBase.cpp.

{
    // Service name must be a valid string and cannot be NULL.
    m_name = (pszServiceName == nullptr) ? L"" : pszServiceName;

    m_statusHandle = nullptr;

    // The service runs in its own process.
    m_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;

    // The service is starting.
    m_status.dwCurrentState = SERVICE_START_PENDING;

    // The accepted commands of the service.
    DWORD dwControlsAccepted = 0;
    if (fCanStop)
        dwControlsAccepted |= SERVICE_ACCEPT_STOP;
    if (fCanShutdown)
        dwControlsAccepted |= SERVICE_ACCEPT_SHUTDOWN;
    if (fCanPauseContinue)
        dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
    m_status.dwControlsAccepted = dwControlsAccepted;

    m_status.dwWin32ExitCode = NO_ERROR;
    m_status.dwServiceSpecificExitCode = 0;
    m_status.dwCheckPoint = 0;
    m_status.dwWaitHint = 0;

    NTSTATUS status = EventRegister(&HSA_SERVICE_PROVIDER_GUID,
        nullptr,
        nullptr,
        &m_etwRegHandle);
    if (ERROR_SUCCESS != status)
    {
        wprintf(L"Provider not registered. EventRegister failed with %d\n", status);
    }
}

~CServiceBase ( void ) [virtual]

Definition at line 200 of file ServiceBase.cpp.

{
    if (m_etwRegHandle != NULL)
    {
        EventUnregister(m_etwRegHandle);
    }
}

Member Function Documentation

void Continue ( ) [private]

Definition at line 395 of file ServiceBase.cpp.

{
    try
    {
        // Tell SCM that the service is resuming.
        SetServiceStatus(SERVICE_CONTINUE_PENDING);

        // Perform service-specific continue operations.
        OnContinue();

        // Tell SCM that the service is running.
        SetServiceStatus(SERVICE_RUNNING);
    }
    catch (DWORD dwError)
    {
        // Log the error.
        WriteErrorLogEntry(L"Service Continue", dwError);

        // Tell SCM that the service is still paused.
        SetServiceStatus(SERVICE_PAUSED);
    }
    catch (...)
    {
        // Log the error.
        WriteEventLogEntry(L"Service failed to resume.", TRACE_LEVEL_ERROR);

        // Tell SCM that the service is still paused.
        SetServiceStatus(SERVICE_PAUSED);
    }
}

void OnContinue ( ) [protected, virtual]

Definition at line 434 of file ServiceBase.cpp.

{
}

void OnPause ( ) [protected, virtual]

Definition at line 381 of file ServiceBase.cpp.

{
}

void OnShutdown ( ) [protected, virtual]

Definition at line 477 of file ServiceBase.cpp.

{
}

void OnStart | ( | DWORD | dwArgc,
 |  | PWSTR * | pszArgv |
 | ) |  |  | [protected, virtual]

Reimplemented in CSampleService.

Definition at line 273 of file ServiceBase.cpp.

{
}

void OnStop ( ) [protected, virtual]

Reimplemented in CSampleService.

Definition at line 328 of file ServiceBase.cpp.

{
}

void Pause ( ) [private]

Definition at line 342 of file ServiceBase.cpp.

{
    try
    {
        // Tell SCM that the service is pausing.
        SetServiceStatus(SERVICE_PAUSE_PENDING);

        // Perform service-specific pause operations.
        OnPause();

        // Tell SCM that the service is paused.
        SetServiceStatus(SERVICE_PAUSED);
    }
    catch (DWORD dwError)
    {
        // Log the error.
        WriteErrorLogEntry(L"Service Pause", dwError);

        // Tell SCM that the service is still running.
        SetServiceStatus(SERVICE_RUNNING);
    }
    catch (...)
    {
        // Log the error.
        WriteEventLogEntry(L"Service failed to pause.", TRACE_LEVEL_ERROR);

        // Tell SCM that the service is still running.
        SetServiceStatus(SERVICE_RUNNING);
    }
}

BOOL Run ( CServiceBase & service ) [static]

Definition at line 50 of file ServiceBase.cpp.

{
    s_service = &service;

    SERVICE_TABLE_ENTRY serviceTable[] =
    {
        { service.m_name, ServiceMain },
        { nullptr, nullptr }
    };

    // Connects the main thread of a service process to the service control
    // manager, which causes the thread to be the service control dispatcher
    // thread for the calling process. This call returns when the service has
    // stopped. The process should simply terminate when the call returns.
    return StartServiceCtrlDispatcher(serviceTable);
}

void WINAPI ServiceCtrlHandler ( DWORD dwCtrl ) [static, private]

Definition at line 119 of file ServiceBase.cpp.

{
    switch (dwCtrl)
    {
    case SERVICE_CONTROL_STOP: s_service->Stop(); break;
    case SERVICE_CONTROL_PAUSE: s_service->Pause(); break;
    case SERVICE_CONTROL_CONTINUE: s_service->Continue(); break;
    case SERVICE_CONTROL_SHUTDOWN: s_service->Shutdown(); break;
    case SERVICE_CONTROL_INTERROGATE: break;
    default: break;
    }
}

static void WINAPI ServiceMain | ( | DWORD | dwArgc,
 |  | LPWSTR * | lpszArgv |
 | ) |  |  | [static, private]
void SetServiceStatus | ( | DWORD | dwCurrentState,
 |  | DWORD | dwWin32ExitCode = NO_ERROR,
 |  | DWORD | dwWaitHint = 0 |
 | ) |  |  | [protected]
void Shutdown ( ) [private]

Definition at line 447 of file ServiceBase.cpp.

{
    try
    {
        // Perform service-specific shutdown operations.
        OnShutdown();

        // Tell SCM that the service is stopped.
        SetServiceStatus(SERVICE_STOPPED);
    }
    catch (DWORD dwError)
    {
        // Log the error.
        WriteErrorLogEntry(L"Service Shutdown", dwError);
    }
    catch (...)
    {
        // Log the error.
        WriteEventLogEntry(L"Service failed to shut down.", TRACE_LEVEL_ERROR);
    }
}

void Start | ( | DWORD | dwArgc,
 |  | PWSTR * | pszArgv |
 | ) |  |  | [private]

Definition at line 225 of file ServiceBase.cpp.

{
    WriteEventLogEntry(L"Service trying to start.", TRACE_LEVEL_ERROR);
    try
    {
        // Tell SCM that the service is starting.
        SetServiceStatus(SERVICE_START_PENDING);

        // Perform service-specific initialization.
        OnStart(dwArgc, pszArgv);

        // Tell SCM that the service is started.
        SetServiceStatus(SERVICE_RUNNING);
    }
    catch (DWORD dwError)
    {
        // Log the error.
        WriteErrorLogEntry(L"Service Start", dwError);

        // Set the service status to be stopped.
        SetServiceStatus(SERVICE_STOPPED, dwError);
    }
    catch (...)
    {
        // Log the error.
        WriteEventLogEntry(L"Service failed to start.", TRACE_LEVEL_ERROR);

        // Set the service status to be stopped.
        SetServiceStatus(SERVICE_STOPPED);
    }
}

void Stop ( )

Definition at line 286 of file ServiceBase.cpp.

{
    DWORD dwOriginalState = m_status.dwCurrentState;
    try
    {
        // Tell SCM that the service is stopping.
        SetServiceStatus(SERVICE_STOP_PENDING);

        // Perform service-specific stop operations.
        OnStop();

        // Tell SCM that the service is stopped.
        SetServiceStatus(SERVICE_STOPPED);
    }
    catch (DWORD dwError)
    {
        // Log the error.
        WriteErrorLogEntry(L"Service Stop", dwError);

        // Set the orginal service status.
        SetServiceStatus(dwOriginalState);
    }
    catch (...)
    {
        // Log the error.
        WriteEventLogEntry(L"Service failed to stop.", TRACE_LEVEL_ERROR);

        // Set the orginal service status.
        SetServiceStatus(dwOriginalState);
    }
}

void WriteErrorLogEntry | ( | PWSTR | pszFunction,
 |  | DWORD | dwError = GetLastError() |
 | ) |  |  | [protected]
virtual void WriteEventLogEntry | ( | PWSTR | pszMessage,
 |  | BYTE | bLevel |
 | ) |  |  | [protected, virtual]

Reimplemented in CSampleService.

Member Data Documentation

REGHANDLE m_etwRegHandle [private]

Definition at line 120 of file ServiceBase.h.

PWSTR m_name [private]

Definition at line 112 of file ServiceBase.h.

SERVICE_STATUS m_status [private]

Definition at line 115 of file ServiceBase.h.

SERVICE_STATUS_HANDLE m_statusHandle [private]

Definition at line 118 of file ServiceBase.h.

CServiceBase * s_service = nullptr [static, private]

Definition at line 109 of file ServiceBase.h.

The documentation for this class was generated from the following files:
  • CustomCapability/Service/Server/ServiceBase.h
  • CustomCapability/Service/Server/ServiceBase.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomComputeShaderMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomComputeShader
  • CustomComputeShaderMain
Public Member Functions | Private Attributes

CustomComputeShaderMain Class Reference

#include "CustomComputeShaderMain.h"

List of all members.

Public Member Functions

CustomComputeShaderMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~CustomComputeShaderMain ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< SampleOverlay > | m_sampleOverlay
std::unique_ptr
< CustomComputeShaderRenderer > 		m_sceneRenderer

Detailed Description

Definition at line 21 of file CustomComputeShaderMain.h.

Constructor & Destructor Documentation

CustomComputeShaderMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file CustomComputeShaderMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    m_sceneRenderer = std::unique_ptr<CustomComputeShaderRenderer>(new CustomComputeShaderRenderer(m_deviceResources));
    m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D Custom Compute Shader Effect"));
}

~CustomComputeShaderMain ( )

Definition at line 34 of file CustomComputeShaderMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void CreateWindowSizeDependentResources ( )

Definition at line 41 of file CustomComputeShaderMain.cpp.

{
    m_sceneRenderer->CreateWindowSizeDependentResources();
    m_sampleOverlay->CreateWindowSizeDependentResources();
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void OnDeviceLost ( ) [virtual]

Definition at line 64 of file CustomComputeShaderMain.cpp.

{
    m_sceneRenderer->ReleaseDeviceDependentResources();
    m_sampleOverlay->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 71 of file CustomComputeShaderMain.cpp.

{
    m_sceneRenderer->CreateDeviceDependentResources();
    m_sampleOverlay->CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

bool Render ( )

Definition at line 55 of file CustomComputeShaderMain.cpp.

{
    m_sceneRenderer->Render();
    m_sampleOverlay->Render();

    return true;
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void Update ( )

Definition at line 47 of file CustomComputeShaderMain.cpp.

{
    // Unlike the pixel and vertex shader effects, the compute shader effect does not animate over time.
    // Therefore, render state is only updated on events such as CreateWindowSizeDependentResources().
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 40 of file CustomComputeShaderMain.h.

std::unique_ptr<SampleOverlay> m_sampleOverlay [private]

Definition at line 43 of file CustomComputeShaderMain.h.

std::unique_ptr<CustomComputeShaderRenderer> m_sceneRenderer [private]

Definition at line 42 of file CustomComputeShaderMain.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.h
  • D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.cpp
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomComputeShaderRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomComputeShader
  • CustomComputeShaderRenderer
Public Member Functions | Private Member Functions | Private Attributes

CustomComputeShaderRenderer Class Reference

#include "CustomComputeShaderRenderer.h"

List of all members.

Public Member Functions

CustomComputeShaderRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()

Private Member Functions

void | UpdateImageScale (float scale)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_dftEffect
Microsoft::WRL::ComPtr
< IWICFormatConverter > 		m_formatConvert
D2D1_SIZE_U | m_imageSize
Microsoft::WRL::ComPtr
< ID2D1ImageSourceFromWic > 		m_imageSource
bool | m_isWindowClosed
float | m_scale
Microsoft::WRL::ComPtr
< ID2D1TransformedImageSource > 		m_transformedImage

Detailed Description

Definition at line 20 of file CustomComputeShaderRenderer.h.

Constructor & Destructor Documentation

CustomComputeShaderRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 25 of file CustomComputeShaderRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 71 of file CustomComputeShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // Load the image from WIC using ImageSource. The image is scaled using
    // ID2D1TransformedImageSource which is dependent on the scale factor.
    DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));

    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_CustomDftEffect, &m_dftEffect));
}

void CreateDeviceIndependentResources ( )

Definition at line 33 of file CustomComputeShaderRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();
    auto d2dFactory = m_deviceResources->GetD2DFactory();

    // Create WIC Decoder to read JPG file.
    ComPtr<IWICBitmapDecoder> decoder;
    DX::ThrowIfFailed(
        wicFactory->CreateDecoderFromFilename(
        L"Assets\\rainier.jpg",
        nullptr,
        GENERIC_READ,
        WICDecodeMetadataCacheOnDemand,
        &decoder
        ));

    ComPtr<IWICBitmapFrameDecode> frame;
    DX::ThrowIfFailed(decoder->GetFrame(0, &frame));

    DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
    DX::ThrowIfFailed(m_formatConvert->Initialize(
        frame.Get(),
        GUID_WICPixelFormat32bppPBGRA, // 32bppPBGRA is used by Direct2D.
        WICBitmapDitherTypeNone,
        nullptr,
        0.0f,
        WICBitmapPaletteTypeCustom
        ));

    UINT width;
    UINT height;
    DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
    m_imageSize = D2D1::SizeU(width, height);

    // Register the custom discrete Fourier transform effect.
    DX::ThrowIfFailed(DftEffect::Register(d2dFactory));
}

void CreateWindowSizeDependentResources ( )

Definition at line 89 of file CustomComputeShaderRenderer.cpp.

{
    // Scale using pixel (not DIPs) because layout calculations are pixel-dependent.
    auto size = m_deviceResources->GetOutputSize();

    m_scale = min(
        (size.Width / m_imageSize.width) / 2.0f,
        (size.Height / m_imageSize.height) / 2.0f
        );

    UpdateImageScale(m_scale);
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state ) [inline]

Definition at line 33 of file CustomComputeShaderRenderer.h.

{};

void ReleaseDeviceDependentResources ( )

Definition at line 82 of file CustomComputeShaderRenderer.cpp.

{
    m_imageSource.Reset();
    m_transformedImage.Reset();
    m_dftEffect.Reset();
}

void Render ( )

Definition at line 126 of file CustomComputeShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto renderTargetSize = m_deviceResources->GetOutputSize();

    d2dContext->BeginDraw();
    m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    // Calculate display positioning for the scaled image and DFT effect.
    float scaledWidth = m_imageSize.width * m_scale;
    float scaledHeight = m_imageSize.height * m_scale;
    float horizontalMargin = ((renderTargetSize.Width / 2 - scaledWidth) / 2.0f);

    // Clip values nearest whole pixel to prevent effect output from being anti-aliased.
    scaledWidth = floor(scaledWidth);
    scaledHeight = floor(scaledHeight);
    horizontalMargin = floor(horizontalMargin);

    // Convert values to DIPs to preserve layout at different DPIs.
    scaledHeight = DX::ConvertPixelsToDips(scaledHeight);
    scaledWidth = DX::ConvertPixelsToDips(scaledWidth);
    horizontalMargin = DX::ConvertPixelsToDips(horizontalMargin);

    // Calculate whole pixel offset of screen midpoint before converting to DIPs to
    // prevent effect output from being antialiased.
    float screenMidpoint = floor(DX::ConvertPixelsToDips(renderTargetSize.Width / 2.0f));

    // Draw the original image on the left side of the window.
    d2dContext->DrawImage(m_transformedImage.Get(), D2D1::Point2F(horizontalMargin, 0.0f));

    // Draw the DFT of the image on the right side of the window.
    // Because image output is fully opaque, it should be blended with BOUNDED_SOURCE_COPY, which allows
    // the compute shader output to be written directly to the render target instead of blended.
    d2dContext->DrawImage(
        m_dftEffect.Get(),
        D2D1::Point2F(screenMidpoint + horizontalMargin, 0.0f),
        D2D1::RectF(0.0f, 0.0f, scaledWidth, scaledHeight),
        D2D1_INTERPOLATION_MODE_LINEAR,
        D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state ) [inline]

Definition at line 32 of file CustomComputeShaderRenderer.h.

{};

void Update ( ) [inline]

Definition at line 28 of file CustomComputeShaderRenderer.h.

{};

void UpdateImageScale ( float scale ) [private]

Definition at line 103 of file CustomComputeShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // When using ID2D1ImageSource, the recommend method of applying a transform
    // is to use ID2D1TransformedImageSource. It is inexpensive to recreate this object.
    D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
    {
        D2D1_ORIENTATION_DEFAULT,
        scale,
        scale,
        D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
        D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE // Does not apply the context's DPI.
    };

    DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
        m_imageSource.Get(),
        &props,
        &m_transformedImage));

    m_dftEffect->SetInput(0, m_transformedImage.Get());
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 40 of file CustomComputeShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_dftEffect [private]

Definition at line 44 of file CustomComputeShaderRenderer.h.

Microsoft::WRL::ComPtr<IWICFormatConverter> m_formatConvert [private]

Definition at line 41 of file CustomComputeShaderRenderer.h.

D2D1_SIZE_U m_imageSize [private]

Definition at line 47 of file CustomComputeShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic> m_imageSource [private]

Definition at line 42 of file CustomComputeShaderRenderer.h.

bool m_isWindowClosed [private]

Definition at line 46 of file CustomComputeShaderRenderer.h.

float m_scale [private]

Definition at line 48 of file CustomComputeShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1TransformedImageSource> m_transformedImage [private]

Definition at line 43 of file CustomComputeShaderRenderer.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.h
  • D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.cpp
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomComputeShader
  • SampleOverlay
Public Member Functions | Private Attributes

SampleOverlay Class Reference

#include "SampleOverlay.h"

List of all members.

Public Member Functions

SampleOverlay (const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
float | GetTitleHeightInDips ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::wstring | m_caption
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawOverlay
UINT | m_idIncrement
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
float | m_overlayWidth
float | m_padding
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_textVerticalOffset
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 21 of file SampleOverlay.h.

Constructor & Destructor Documentation

SampleOverlay | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | const std::wstring & | caption
 | ) |  |

Definition at line 24 of file SampleOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_caption(caption),
    m_drawOverlay(true)
{
    m_padding = 8.0f;
    m_textVerticalOffset = 7.0f;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);
    m_overlayWidth = 0.0f;

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 38 of file SampleOverlay.cpp.

{
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
        );

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
            L"Assets\\storelogo-sdk.png",
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
            )
        );

    double dpiX = 96.0;
    double dpiY = 96.0;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    ComPtr<IDWriteTextFormat> nameTextFormat;
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            36.0f,
            L"en-US",
            &nameTextFormat
            )
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            m_caption.c_str(),
            static_cast<UINT32>(m_caption.size()),
            nameTextFormat.Get(),
            4096.0f,
            4096.0f,
            &m_textLayout
            )
        );

    DWRITE_TEXT_METRICS metrics = {0};
    DX::ThrowIfFailed(
        m_textLayout->GetMetrics(&metrics)
        );

    m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 141 of file SampleOverlay.cpp.

{
    if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
    {
        m_drawOverlay = false;
    }
    else
    {
        m_drawOverlay = true;
    }
}

float GetTitleHeightInDips ( )

Definition at line 192 of file SampleOverlay.cpp.

{
    return m_logoSize.height + m_padding;
}

void ReleaseDeviceDependentResources ( )

Definition at line 155 of file SampleOverlay.cpp.

{
    m_whiteBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( )

Definition at line 161 of file SampleOverlay.cpp.

{
    if (m_drawOverlay)
    {
        m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());

        m_deviceResources->GetD2DDeviceContext()->BeginDraw();
        m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
        m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
            );

        m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
            m_textLayout.Get(),
            m_whiteBrush.Get()
            );

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }

        m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
    }
}

Member Data Documentation

std::wstring m_caption [private]

Definition at line 42 of file SampleOverlay.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 32 of file SampleOverlay.h.

bool m_drawOverlay [private]

Definition at line 41 of file SampleOverlay.h.

UINT m_idIncrement [private]

Definition at line 40 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 37 of file SampleOverlay.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 45 of file SampleOverlay.h.

float m_overlayWidth [private]

Definition at line 46 of file SampleOverlay.h.

float m_padding [private]

Definition at line 43 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 35 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 38 of file SampleOverlay.h.

float m_textVerticalOffset [private]

Definition at line 44 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 34 of file SampleOverlay.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/ComputeShader/SampleOverlay.h
  • D2DCustomEffects/cpp/ComputeShader/SampleOverlay.cpp
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomComputeShader
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< CustomComputeShaderMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 21 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 50 of file App.h.

std::unique_ptr<CustomComputeShaderMain> m_main [private]

Definition at line 51 of file App.h.

bool m_windowClosed [private]

Definition at line 52 of file App.h.

bool m_windowVisible [private]

Definition at line 53 of file App.h.

The documentation for this class was generated from the following file:
  • D2DCustomEffects/cpp/ComputeShader/App.h
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomDecaySound Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

CustomDecaySound Class Reference

#include "CustomDecay.h"

List of all members.

Public Member Functions

virtual | ~CustomDecaySound ()
HrtfEnvironment | GetEnvironment ()
HRESULT | Initialize (_In_ LPCWSTR filename)
HRESULT | OnUpdate (_In_ float x, _In_ float, _In_ float z)
HRESULT | SetEnvironment (_In_ HrtfEnvironment environment)
HRESULT | Start ()
HRESULT | Stop ()

Private Attributes

AudioFileReader _audioFile
HrtfEnvironment | _environment = HrtfEnvironment::Outdoors
ComPtr< IXAPOHrtfParameters > | _hrtfParams
IXAudio2SourceVoice * | _sourceVoice = nullptr
ComPtr< IXAudio2 > | _xaudio2

Detailed Description

Definition at line 18 of file CustomDecay.h.

Constructor & Destructor Documentation

~CustomDecaySound ( ) [virtual]

Definition at line 69 of file CustomDecay.cpp.

{
    if (_sourceVoice)
    {
        _sourceVoice->DestroyVoice();
    }
}

Member Function Documentation

HrtfEnvironment GetEnvironment ( ) [inline]

Definition at line 28 of file CustomDecay.h.

{ return _environment; }

HRESULT Initialize ( _In_ LPCWSTR filename )
HRESULT OnUpdate | ( | _In_ float | x,
 |  | _In_ | float,
 |  | _In_ float | z
 | ) |  |
HRESULT SetEnvironment ( _In_ HrtfEnvironment environment )
HRESULT Start ( )

Definition at line 77 of file CustomDecay.cpp.

{
    return _sourceVoice->Start();
}

HRESULT Stop ( )

Definition at line 82 of file CustomDecay.cpp.

{
    return _sourceVoice->Stop();
}

Member Data Documentation

AudioFileReader _audioFile [private]

Definition at line 31 of file CustomDecay.h.

HrtfEnvironment _environment = HrtfEnvironment::Outdoors [private]

Definition at line 35 of file CustomDecay.h.

ComPtr<IXAPOHrtfParameters> _hrtfParams [private]

Definition at line 34 of file CustomDecay.h.

IXAudio2SourceVoice* _sourceVoice = nullptr [private]

Definition at line 33 of file CustomDecay.h.

ComPtr<IXAudio2> _xaudio2 [private]

Definition at line 32 of file CustomDecay.h.

The documentation for this class was generated from the following files:
  • SpatialSound/cpp/CustomDecay.h
  • SpatialSound/cpp/CustomDecay.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioEchoEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomEffect
  • AudioEchoEffect
Public Member Functions | Properties | Private Attributes

AudioEchoEffect Class Reference

List of all members.

Public Member Functions

AudioEchoEffect ()
void | Close (MediaEffectClosedReason reason)
void | DiscardQueuedFrames ()
unsafe void | ProcessFrame (ProcessAudioFrameContext context)
void | SetEncodingProperties (AudioEncodingProperties encodingProperties)
void | SetProperties (IPropertySet configuration)

Properties

float | Mix [get]
IReadOnlyList
< AudioEncodingProperties > 		SupportedEncodingProperties [get]
bool | UseInputFrameForOutput [get]

Private Attributes

int | currentActiveSampleIndex
AudioEncodingProperties | currentEncodingProperties
float[] | echoBuffer
IPropertySet | propertySet
List< AudioEncodingProperties > | supportedEncodingProperties

Detailed Description

Definition at line 21 of file CustomEffect.cs.

Constructor & Destructor Documentation

AudioEchoEffect ( ) [inline]

Definition at line 47 of file CustomEffect.cs.

        {
            // Support 44.1kHz and 48kHz mono float
            supportedEncodingProperties = new List<AudioEncodingProperties>();
            AudioEncodingProperties encodingProps1 = AudioEncodingProperties.CreatePcm(44100, 1, 32);
            encodingProps1.Subtype = MediaEncodingSubtypes.Float;
            AudioEncodingProperties encodingProps2 = AudioEncodingProperties.CreatePcm(48000, 1, 32);
            encodingProps2.Subtype = MediaEncodingSubtypes.Float;

            supportedEncodingProperties.Add(encodingProps1);
            supportedEncodingProperties.Add(encodingProps2);
        }

Member Function Documentation

void Close ( MediaEffectClosedReason reason ) [inline]

Definition at line 121 of file CustomEffect.cs.

        {
            // Clean-up any effect resources
            // This effect doesn't care about close, so there's nothing to do
        }

void DiscardQueuedFrames ( ) [inline]

Definition at line 127 of file CustomEffect.cs.

        {
            // Reset contents of the samples buffer
            Array.Clear(echoBuffer, 0, echoBuffer.Length - 1);
            currentActiveSampleIndex = 0;
        }

unsafe void ProcessFrame ( ProcessAudioFrameContext context ) [inline]

Definition at line 77 of file CustomEffect.cs.

        {
            AudioFrame inputFrame = context.InputFrame;
            AudioFrame outputFrame = context.OutputFrame;

            using (AudioBuffer inputBuffer = inputFrame.LockBuffer(AudioBufferAccessMode.Read),
                                outputBuffer = outputFrame.LockBuffer(AudioBufferAccessMode.Write))
            using (IMemoryBufferReference inputReference = inputBuffer.CreateReference(),
                                            outputReference = outputBuffer.CreateReference())
            {
                byte* inputDataInBytes;
                byte* outputDataInBytes;
                uint inputCapacity;
                uint outputCapacity;

                ((IMemoryBufferByteAccess)inputReference).GetBuffer(out inputDataInBytes, out inputCapacity);
                ((IMemoryBufferByteAccess)outputReference).GetBuffer(out outputDataInBytes, out outputCapacity);

                float* inputDataInFloat = (float*)inputDataInBytes;
                float* outputDataInFloat = (float*)outputDataInBytes;

                float inputData;
                float echoData;

                // Process audio data
                int dataInFloatLength = (int)inputBuffer.Length / sizeof(float);

                for (int i = 0; i < dataInFloatLength; i++)
                {
                    inputData = inputDataInFloat[i] * (1.0f - this.Mix);
                    echoData = echoBuffer[currentActiveSampleIndex] * this.Mix;
                    outputDataInFloat[i] = inputData + echoData;
                    echoBuffer[currentActiveSampleIndex] = inputDataInFloat[i];
                    currentActiveSampleIndex++;

                    if (currentActiveSampleIndex == echoBuffer.Length)
                    {
                        // Wrap around (after one second of samples)
                        currentActiveSampleIndex = 0;
                    }
                }
            }
        }

void SetEncodingProperties ( AudioEncodingProperties encodingProperties ) [inline]

Definition at line 68 of file CustomEffect.cs.

        {
            currentEncodingProperties = encodingProperties;

            // Create and initialize the echo array
            echoBuffer = new float[encodingProperties.SampleRate]; // exactly one second delay
            currentActiveSampleIndex = 0;
        }

void SetProperties ( IPropertySet configuration ) [inline]

Definition at line 134 of file CustomEffect.cs.

        {
            this.propertySet = configuration;
        }

Member Data Documentation

int currentActiveSampleIndex [private]

Definition at line 27 of file CustomEffect.cs.

AudioEncodingProperties currentEncodingProperties [private]

Definition at line 23 of file CustomEffect.cs.

float [] echoBuffer [private]

Definition at line 26 of file CustomEffect.cs.

IPropertySet propertySet [private]

Definition at line 28 of file CustomEffect.cs.

List<AudioEncodingProperties> supportedEncodingProperties [private]

Definition at line 24 of file CustomEffect.cs.

Property Documentation

float Mix [get, private]

Definition at line 32 of file CustomEffect.cs.

IReadOnlyList<AudioEncodingProperties> SupportedEncodingProperties [get]

Definition at line 61 of file CustomEffect.cs.

bool UseInputFrameForOutput [get]

Definition at line 44 of file CustomEffect.cs.

The documentation for this class was generated from the following file:
  • AudioCreation/cs/CustomEffect/CustomEffect.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IMemoryBufferByteAccess Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomEffect
  • IMemoryBufferByteAccess
Public Member Functions

IMemoryBufferByteAccess Interface Reference

List of all members.

Public Member Functions

void GetBuffer (out byte *buffer, out uint capacity)

Detailed Description

Definition at line 16 of file CustomEffect.cs.

Member Function Documentation

void GetBuffer | ( | out byte * | buffer,
 |  | out uint | capacity
 | ) |  |
The documentation for this interface was generated from the following file:
  • AudioCreation/cs/CustomEffect/CustomEffect.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceConnect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • DeviceConnect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

DeviceConnect Class Reference

Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events. More...

List of all members.

Public Member Functions

DeviceConnect ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | AddDeviceToList (DeviceInformation deviceInformation, String deviceSelector)
void | AddDeviceWatcher (DeviceWatcher deviceWatcher, String deviceSelector)
void | ClearDeviceEntries ()
async void | ConnectToDevice_Click (Object sender, RoutedEventArgs eventArgs)
void | DisconnectFromDevice_Click (Object sender, RoutedEventArgs eventArgs)
DeviceListEntry | FindDevice (String deviceId)
void | InitializeDeviceWatchers ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInformation)
async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
void | OnDeviceConnected (EventHandlerForDevice sender, OnDeviceConnectedEventArgs onDeviceConnectedEventArgs)
async void | OnDeviceEnumerationComplete (DeviceWatcher sender, Object args)
async void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RemoveDeviceFromList (String deviceId)
void | SelectDeviceInList (String deviceIdToSelect)
void | StartDeviceWatchers ()
void | StartHandlingAppEvents ()
void | StopDeviceWatchers ()
void | StopHandlingAppEvents ()
void | UpdateConnectDisconnectButtonsAndList (Boolean enableConnectButton)

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
const String | ButtonNameDisableReconnectToDevice = "Do not reconnect to device"
const String | ButtonNameDisconnectFromDevice = "Disconnect from device"
Boolean | isAllDevicesEnumerated
ObservableCollection
< DeviceListEntry > 		listOfDevices
Dictionary< DeviceWatcher, String > | mapDeviceWatchersToDeviceSelector
MainPage | rootPage = MainPage.Current
Boolean | watchersStarted
Boolean | watchersSuspended

Detailed Description

To use this sample with your device: 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation. 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.

Definition at line 32 of file Scenario1_DeviceConnect.xaml.cs.

Constructor & Destructor Documentation

DeviceConnect ( void ) [inline]

Definition at line 53 of file Scenario1_DeviceConnect.xaml.cs.

        {
            this.InitializeComponent();

            listOfDevices = new ObservableCollection<DeviceListEntry>();

            mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
            watchersStarted = false;
            watchersSuspended = false;

            isAllDevicesEnumerated = false;
        }

Member Function Documentation

void AddDeviceToList | ( | DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Creates a DeviceListEntry for a device and adds it to the list of devices in the UI.

Parameters:
deviceInformation | DeviceInformation on the device to be added to the list
deviceSelector | The AQS used to find this device

Definition at line 262 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // search the device list for a device with a matching interface ID
            var match = FindDevice(deviceInformation.Id);

            // Add the device if it's new
            if (match == null)
            {
                // Create a new element for this device interface, and queue up the query of its
                // device information
                match = new DeviceListEntry(deviceInformation, deviceSelector);

                // Add the new element to the end of the list of devices
                listOfDevices.Add(match);
            }
        }

void AddDeviceWatcher | ( | DeviceWatcher | deviceWatcher,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.

Parameters:
deviceWatcher
deviceSelector The AQS used to create the device watcher

Definition at line 208 of file Scenario1_DeviceConnect.xaml.cs.

        {
            deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
            deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
            deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);

            mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
        }

void ClearDeviceEntries ( void ) [inline, private]

Definition at line 287 of file Scenario1_DeviceConnect.xaml.cs.

        {
            listOfDevices.Clear();
        }

async void ConnectToDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 108 of file Scenario1_DeviceConnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    // Create an EventHandlerForDevice to watch for the device we are connecting to
                    EventHandlerForDevice.CreateNewEventHandlerForDevice();

                    // Get notified when the device was successfully connected to or about to be closed
                    EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                    EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

                    // It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed
                    // on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
                    Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);

                    // Disable connect button if we connected to the device
                    UpdateConnectDisconnectButtonsAndList(!openSuccess);
                }
            }
        }

void DisconnectFromDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 137 of file Scenario1_DeviceConnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            // Prevent auto reconnect because we are voluntarily closing it
            // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
            EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    EventHandlerForDevice.Current.CloseDevice();
                }
            }

            ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

            UpdateConnectDisconnectButtonsAndList(true);
        }

DeviceListEntry FindDevice ( String deviceId ) [inline, private]

Searches through the existing list of devices for the first DeviceListEntry that has the specified device Id.

Parameters:
deviceId Id of the device that is being searched for
Returns:
DeviceListEntry that has the provided Id; else a nullptr

Definition at line 298 of file Scenario1_DeviceConnect.xaml.cs.

        {
            if (deviceId != null)
            {
                foreach (DeviceListEntry entry in listOfDevices)
                {
                    if (entry.DeviceInformation.Id == deviceId)
                    {
                        return entry;
                    }
                }
            }

            return null;
        }

void InitializeDeviceWatchers ( void ) [inline, private]

Initialize device watchers to watch for the SuperMUTT.

Several other ways of using a device selector to get the desired devices (the devices are really DeviceInformation objects): 1) Using only the Usage Page and the Usage Id of the device (enumerates any device with the same usage page and usage id) 2) Using the Usage Page, Usage Id, Vendor Id, Product Id (Same as above except it also matches the VIDs and PIDs)

GetDeviceSelector return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or DeviceInformation.createFromIdAsync().

In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.

Definition at line 172 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // SuperMUTT
            var superMuttSelector = HidDevice.GetDeviceSelector(SuperMutt.Device.UsagePage, SuperMutt.Device.UsageId, SuperMutt.Device.Vid, SuperMutt.Device.Pid);

            // Create a device watcher to look for instances of the SuperMUTT device
            var superMuttWatcher = DeviceInformation.CreateWatcher(superMuttSelector);

            // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
            AddDeviceWatcher(superMuttWatcher, superMuttSelector);
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

See OnAppSuspension for why we are starting the device watchers again.

Parameters:
sender
args

Definition at line 338 of file Scenario1_DeviceConnect.xaml.cs.

        {
            if (watchersSuspended)
            {
                watchersSuspended = false;
                StartDeviceWatchers();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

We must stop the DeviceWatchers because device watchers will continue to raise events even if the app is in suspension, which is not desired (drains battery).

We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 320 of file Scenario1_DeviceConnect.xaml.cs.

        {
            if (watchersStarted)
            {
                watchersSuspended = true;
                StopDeviceWatchers();
            }
            else
            {
                watchersSuspended = false;
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

This function will add the device to the listOfDevices so that it shows up in the UI.

Parameters:
sender
deviceInformation

Definition at line 369 of file Scenario1_DeviceConnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser(deviceInformation.Id + " was added.", NotifyType.StatusMessage);

                    AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
                }));
        }

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

The device was closed.

If we will autoreconnect to the device, reflect that in the UI

Parameters:
sender
deviceInformation

Definition at line 460 of file Scenario1_DeviceConnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    // We were connected to the device that was unplugged, so change the "Disconnect from device" button
                    // to "Do not reconnect to device"
                    if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
                    {
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;

                        UpdateConnectDisconnectButtonsAndList(false);
                    }
                    else
                    {
                        // We don't plan on automatically reconnecting to a device, so enable the connect button
                        UpdateConnectDisconnectButtonsAndList(true);
                    }
                }));
        }

void OnDeviceConnected | ( | EventHandlerForDevice | sender,
 |  | OnDeviceConnectedEventArgs | onDeviceConnectedEventArgs |
 | ) |  |  | [inline, private]

If all the devices have been enumerated, select the device in the list we connected to.

Otherwise let the EnumerationComplete event from the device watcher handle the device selection

Parameters:
sender
onDeviceConnectedEventArgs

Definition at line 430 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Find and select our connected device
            if (isAllDevicesEnumerated)
            {
                ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

                if (onDeviceConnectedEventArgs.IsDeviceSuccessfullyConnected)
                {
                    SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                    UpdateConnectDisconnectButtonsAndList(false);

                    rootPage.NotifyUser("Currently connected to: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                }
                else
                {
                    // Prevent auto reconnect from occuring
                    EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;

                    UpdateConnectDisconnectButtonsAndList(true);
                }
            }
        }

async void OnDeviceEnumerationComplete | ( | DeviceWatcher | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Notify the UI whether or not we are connected to a device.

Parameters:
sender
args

Definition at line 386 of file Scenario1_DeviceConnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    isAllDevicesEnumerated = true;

                    // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
                    // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
                    if (EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                        ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

                        UpdateConnectDisconnectButtonsAndList(false);

                        rootPage.NotifyUser("Currently connected to: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
                    {
                        // We will be reconnecting to a device
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;

                        UpdateConnectDisconnectButtonsAndList(false);

                        rootPage.NotifyUser("Waiting to reconnect to device: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else
                    {
                        // Error occurred. EventHandlerForDevice will automatically prevent future automatic reconnections

                        rootPage.NotifyUser("No devices currently selected", NotifyType.StatusMessage);
                    }
                }));
        }

async void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

We will remove the device from the UI.

Parameters:
sender
deviceInformationUpdate

Definition at line 352 of file Scenario1_DeviceConnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser(deviceInformationUpdate.Id + " was removed.", NotifyType.StatusMessage);

                    RemoveDeviceFromList(deviceInformationUpdate.Id);
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Unregister from App events and DeviceWatcher events because this page will be unloaded.

Parameters:
eventArgs

Definition at line 98 of file Scenario1_DeviceConnect.xaml.cs.

        {
            StopDeviceWatchers();
            StopHandlingAppEvents();

            // We no longer care about the device being connected
            EventHandlerForDevice.Current.OnDeviceConnected = null;
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.

The UI elements are controlled/modified through device watcher events, device opening/closing, and app events

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 75 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Default UI state
            UpdateConnectDisconnectButtonsAndList(true);

            // Register for device events in case we are already watching for a device
            EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
            EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

            // Begin watching out for events
            StartHandlingAppEvents();

            // Initialize the desired device watchers so that we can watch for when devices are connected/removed
            InitializeDeviceWatchers();
            StartDeviceWatchers();

            DeviceListSource.Source = listOfDevices;
        }

void RemoveDeviceFromList ( String deviceId ) [inline, private]

Definition at line 279 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Removes the device entry from the interal list; therefore the UI
            var deviceEntry = FindDevice(deviceId);

            listOfDevices.Remove(deviceEntry);
        }

void SelectDeviceInList ( String deviceIdToSelect ) [inline, private]

Selects the item in the UI's listbox that corresponds to the provided device id.

If there are no matches, we will deselect anything that is selected.

Parameters:
deviceIdToSelect The device id of the device to select on the list box

Definition at line 487 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Don't select anything by default.
            ConnectDevices.SelectedIndex = -1;

            for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
            {
                if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
                {
                    ConnectDevices.SelectedIndex = deviceListIndex;

                    break;
                }
            }
        }

void StartDeviceWatchers ( void ) [inline, private]

Starts all device watchers including ones that have been individually stopped.

Definition at line 220 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Start all device watchers
            watchersStarted = true;
            isAllDevicesEnumerated = false;

            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                    && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Start();
                }
            }
        }

void StartHandlingAppEvents ( void ) [inline, private]

Definition at line 184 of file Scenario1_DeviceConnect.xaml.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void StopDeviceWatchers ( void ) [inline, private]

Stops all device watchers.

Definition at line 239 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // Stop all device watchers
            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                    || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Stop();
                }
            }

            // Clear the list of devices so we don't have potentially disconnected devices around
            ClearDeviceEntries();

            watchersStarted = false;
        }

void StopHandlingAppEvents ( void ) [inline, private]

Definition at line 195 of file Scenario1_DeviceConnect.xaml.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;

            App.Current.Resuming -= appResumeEventHandler;
        }

void UpdateConnectDisconnectButtonsAndList ( Boolean enableConnectButton ) [inline, private]

When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.

Parameters:
enableConnectButton The state of ButtonConnectToDevice

Definition at line 507 of file Scenario1_DeviceConnect.xaml.cs.

        {
            ButtonConnectToDevice.IsEnabled = enableConnectButton;
            ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;

            ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 42 of file Scenario1_DeviceConnect.xaml.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 41 of file Scenario1_DeviceConnect.xaml.cs.

const String ButtonNameDisableReconnectToDevice = "Do not reconnect to device" [private]

Definition at line 35 of file Scenario1_DeviceConnect.xaml.cs.

const String ButtonNameDisconnectFromDevice = "Disconnect from device" [private]

Definition at line 34 of file Scenario1_DeviceConnect.xaml.cs.

Boolean isAllDevicesEnumerated [private]

Definition at line 51 of file Scenario1_DeviceConnect.xaml.cs.

ObservableCollection<DeviceListEntry> listOfDevices [private]

Definition at line 44 of file Scenario1_DeviceConnect.xaml.cs.

Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector [private]

Definition at line 46 of file Scenario1_DeviceConnect.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario1_DeviceConnect.xaml.cs.

Boolean watchersStarted [private]

Definition at line 48 of file Scenario1_DeviceConnect.xaml.cs.

Boolean watchersSuspended [private]

Definition at line 47 of file Scenario1_DeviceConnect.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/Scenario1_DeviceConnect.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • DeviceListEntry
Public Member Functions | Properties | Private Attributes

DeviceListEntry Class Reference

The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

List of all members.

Public Member Functions

DeviceListEntry (Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)

Properties

DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
String | InstanceId [get]

Private Attributes

DeviceInformation | device
String | deviceSelector

Detailed Description

Each instance of this class provides information about a single device.

This class is used by the UI to display device specific information so that the user can identify which device to use.

Definition at line 23 of file DeviceListEntry.cs.

Constructor & Destructor Documentation

DeviceListEntry | ( | Windows.Devices.Enumeration.DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.

Parameters:
deviceInformation
deviceSelector The AQS used to find this device

Definition at line 57 of file DeviceListEntry.cs.

        {
            device = deviceInformation;
            this.deviceSelector = deviceSelector;
        }

Member Data Documentation

DeviceInformation device [private]

Definition at line 25 of file DeviceListEntry.cs.

String deviceSelector [private]

Definition at line 26 of file DeviceListEntry.cs.

Property Documentation

DeviceInformation DeviceInformation [get]

Definition at line 37 of file DeviceListEntry.cs.

String DeviceSelector [get]

Definition at line 45 of file DeviceListEntry.cs.

String InstanceId [get]

Definition at line 29 of file DeviceListEntry.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/DeviceListEntry.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • DeviceProperties
Public Attributes

DeviceProperties Class Reference

List of all members.

Public Attributes

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Detailed Description

Definition at line 76 of file SampleConfiguration.cs.

Member Data Documentation

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Definition at line 78 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EventHandlerForDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • EventHandlerForDevice
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

EventHandlerForDevice Class Reference

The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event is raised (app suspension and resume) or when the device is disconnected. More...

List of all members.

Public Member Functions

void | CloseDevice ()
async Task< Boolean > | OpenDeviceAsync (DeviceInformation deviceInfo, String deviceSelector)

Static Public Member Functions

static void | CreateNewEventHandlerForDevice ()

Properties

static EventHandlerForDevice | Current [get]
HidDevice | Device [get]
DeviceAccessInformation | DeviceAccessInformation [get]
DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
Boolean | IsDeviceConnected [get]
Boolean | IsEnabledAutoReconnect [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceClose [get, set]
TypedEventHandler
< EventHandlerForDevice,
OnDeviceConnectedEventArgs > 		OnDeviceConnected [get, set]

Private Member Functions

EventHandlerForDevice ()
async void | CloseCurrentlyConnectedDevice ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RegisterForAppEvents ()
void | RegisterForDeviceAccessStatusChange ()
void | RegisterForDeviceWatcherEvents ()
void | StartDeviceWatcher ()
void | StopDeviceWatcher ()
void | UnregisterFromAppEvents ()
void | UnregisterFromDeviceAccessStatusChange ()
void | UnregisterFromDeviceWatcherEvents ()

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
HidDevice | device
TypedEventHandler
< DeviceAccessInformation,
DeviceAccessChangedEventArgs > 		deviceAccessEventHandler
DeviceAccessInformation | deviceAccessInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformation > 		deviceAddedEventHandler
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceCloseCallback
TypedEventHandler
< EventHandlerForDevice,
OnDeviceConnectedEventArgs > 		deviceConnectedCallback
DeviceInformation | deviceInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformationUpdate > 		deviceRemovedEventHandler
String | deviceSelector
DeviceWatcher | deviceWatcher
Boolean | isEnabledAutoReconnect
MainPage | rootPage = MainPage.Current
Boolean | watcherStarted
Boolean | watcherSuspended

Static Private Attributes

static EventHandlerForDevice | eventHandlerForDevice
static Object | singletonCreationLock = new Object()

Detailed Description

In addition to handling the HidDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).

This class will also demonstrate how to handle device watcher events.

For simplicity, this class will only allow at most one device to be connected at any given time. In order to make this class support multiple devices, make this class a non-singleton and create multiple instances of this class; each instance should watch one connected device.

Definition at line 34 of file EventHandlerForDevice.cs.

Constructor & Destructor Documentation

EventHandlerForDevice ( void ) [inline, private]

Definition at line 341 of file EventHandlerForDevice.cs.

        {
            watcherStarted = false;
            watcherSuspended = false;
            isEnabledAutoReconnect = true;
        }

Member Function Documentation

async void CloseCurrentlyConnectedDevice ( void ) [inline, private]

This method demonstrates how to close the device properly using the WinRT Hid API.

When the HidDevice is closing, it will cancel all IO operations that are still pending (not complete). The close will not wait for any IO completion callbacks to be called, so the close call may complete before any of the IO completion callbacks are called. The pending IO operations will still call their respective completion callbacks with either a task cancelled error or the operation completed.

Definition at line 357 of file EventHandlerForDevice.cs.

        {
            if (device != null)
            {
                // Notify callback that we're about to close the device
                if (deviceCloseCallback != null)
                {
                    deviceCloseCallback(this, deviceInformation);
                }

                // This closes the handle to the device
                device.Dispose();

                device = null;

                // Save the deviceInformation.Id in case deviceInformation is set to null when closing the
                // device
                String deviceId = deviceInformation.Id;

                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        MainPage.Current.NotifyUser(deviceId + " is closed", NotifyType.StatusMessage);
                    }));
            }
        }

void CloseDevice ( void ) [inline]

Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device was ever connected.

Definition at line 301 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected)
            {
                CloseCurrentlyConnectedDevice();
            }

            if (deviceWatcher != null)
            {
                if (watcherStarted)
                {
                    StopDeviceWatcher();

                    UnregisterFromDeviceWatcherEvents();
                }

                deviceWatcher = null;
            }

            if (deviceAccessInformation != null)
            {
                UnregisterFromDeviceAccessStatusChange();

                deviceAccessInformation = null;
            }

            if (appSuspendEventHandler != null || appResumeEventHandler != null)
            {
                UnregisterFromAppEvents();
            }

            deviceInformation = null;
            deviceSelector = null;

            deviceConnectedCallback= null;
            deviceCloseCallback = null;

            isEnabledAutoReconnect = true;
        }

static void CreateNewEventHandlerForDevice ( ) [inline, static]

Creates a new instance of EventHandlerForDevice, enables auto reconnect, and uses it as the Current instance.

Definition at line 102 of file EventHandlerForDevice.cs.

        {
            eventHandlerForDevice = new EventHandlerForDevice();
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

When resume into the application, we should reopen a handle to the Hid device again.

This will automatically happen when we start the device watcher again; the device will be re-enumerated and we will attempt to reopen it if IsEnabledAutoReconnect property is enabled.

See OnAppSuspension for why we are starting the device watcher again

Parameters:
sender
arg

Definition at line 517 of file EventHandlerForDevice.cs.

        {
            if (watcherSuspended)
            {
                watcherSuspended = false;
                StartDeviceWatcher();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

If a HidDevice object has been instantiated (a handle to the device is opened), we must close it before the app goes into suspension because the API automatically closes it for us if we don't.

When resuming, the API will not reopen the device automatically, so we need to explicitly open the device in the app (Scenario1_DeviceConnect).

Since we have to reopen the device ourselves when the app resumes, it is good practice to explicitly call the close in the app as well (For every open there is a close).

We must stop the DeviceWatcher because it will continue to raise events even if the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 493 of file EventHandlerForDevice.cs.

        {
            if (watcherStarted)
            {
                watcherSuspended = true;
                StopDeviceWatcher();
            }
            else
            {
                watcherSuspended = false;
            }

            CloseCurrentlyConnectedDevice();
        }

async void OnDeviceAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Close the device if the device access was denied by anyone (system or the user) and reopen it if permissions are allowed again.

Parameters:
sender
eventArgs

Definition at line 567 of file EventHandlerForDevice.cs.

        {
            if ((eventArgs.Status == DeviceAccessStatus.DeniedBySystem)
                || (eventArgs.Status == DeviceAccessStatus.DeniedByUser))
            {
                CloseCurrentlyConnectedDevice();
            }
            else if ((eventArgs.Status == DeviceAccessStatus.Allowed) && (deviceInformation != null) && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        // If we failed to reconnect to the device, don't try to connect anymore
                        isEnabledAutoReconnect = await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Open the device that the user wanted to open if it hasn't been opened yet and auto reconnect is enabled.

Parameters:
sender
deviceInfo

Definition at line 546 of file EventHandlerForDevice.cs.

        {
            if ((deviceInformation != null) && (deviceInfo.Id == deviceInformation.Id) && !IsDeviceConnected && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        // If we failed to reconnect to the device, don't try to connect anymore
                        isEnabledAutoReconnect = await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

Close the device that is opened so that all pending operations are canceled properly.

Parameters:
sender
deviceInformationUpdate

Definition at line 531 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
            {
                // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
                // and stop talking to the disconnected device.
                CloseCurrentlyConnectedDevice();
            }
        }

async Task<Boolean> OpenDeviceAsync | ( | DeviceInformation | deviceInfo,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

This method opens the device using the WinRT Hid API.

After the device is opened, save the device so that it can be used across scenarios.

It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed on the UI thread.

This method is used to reopen the device after the device reconnects to the computer and when the app resumes.

Parameters:
deviceInfo | Device information of the device to be opened
deviceSelector | The AQS used to find this device
Returns:
True if the device was successfully opened, false if the device could not be opened for well known reasons. An exception may be thrown if the device could not be opened for extraordinary reasons.

Definition at line 212 of file EventHandlerForDevice.cs.

        {
            // This sample uses FileAccessMode.ReadWrite to open the device because we do not want other apps opening our device and
            // changing the state of our device. FileAccessMode.Read can be used instead.
            device = await HidDevice.FromIdAsync(deviceInfo.Id, FileAccessMode.ReadWrite);

            Boolean successfullyOpenedDevice = false;
            NotifyType notificationStatus;
            String notificationMessage = null;

            // Device could have been blocked by user or the device has already been opened by another app.
            if (device != null)
            {
                successfullyOpenedDevice = true;

                deviceInformation = deviceInfo;
                this.deviceSelector = deviceSelector;

                notificationStatus = NotifyType.StatusMessage;
                notificationMessage = "Device " + deviceInformation.Id + " opened";

                if (appSuspendEventHandler == null || appResumeEventHandler == null)
                {
                    RegisterForAppEvents();
                }

                // User can block the device after it has been opened in the Settings charm. We can detect this by registering for the
                // DeviceAccessInformation.AccessChanged event
                if (deviceAccessEventHandler == null)
                {
                    RegisterForDeviceAccessStatusChange();
                }

                // Create and register device watcher events for the device to be opened unless we're reopening the device
                if (deviceWatcher == null)
                {
                    deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

                    RegisterForDeviceWatcherEvents();
                }

                if (!watcherStarted)
                {
                    // Start the device watcher after we made sure that the device is opened.
                    StartDeviceWatcher();
                }
            }
            else
            {
                successfullyOpenedDevice = false;

                notificationStatus = NotifyType.ErrorMessage;

                var deviceAccessStatus = DeviceAccessInformation.CreateFromId(deviceInfo.Id).CurrentStatus;

                if (deviceAccessStatus == DeviceAccessStatus.DeniedByUser)
                {
                    notificationMessage = "Access to the device was blocked by the user : " + deviceInfo.Id;
                }
                else if (deviceAccessStatus == DeviceAccessStatus.DeniedBySystem)
                {
                    // This status is most likely caused by app permissions (did not declare the device in the app's package.appxmanifest)
                    // This status does not cover the case where the device is already opened by another app.
                    notificationMessage = "Access to the device was blocked by the system : " + deviceInfo.Id;
                }
                else
                {
                    // Most likely the device is opened by another app, but cannot be sure
                    notificationMessage = "Unknown error, possibly opened by another app : " + deviceInfo.Id;
                }
            }

            MainPage.Current.NotifyUser(notificationMessage, notificationStatus);

            // Notify registered callback handle that the device has been opened
            if (deviceConnectedCallback != null)
            {
                var deviceConnectedEventArgs = new OnDeviceConnectedEventArgs(successfullyOpenedDevice, deviceInfo);

                deviceConnectedCallback(this, deviceConnectedEventArgs);
            }

            return successfullyOpenedDevice;
        }

void RegisterForAppEvents ( void ) [inline, private]

Register for app suspension/resume events.

See the comments for the event handlers for more information on what is being done to the device.

We will also register for when the app exists so that we may close the device handle.

Definition at line 391 of file EventHandlerForDevice.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void RegisterForDeviceAccessStatusChange ( ) [inline, private]

Listen for any changed in device access permission.

The user can block access to the device while the device is in use. If the user blocks access to the device while the device is opened, the device's handle will be closed automatically by the system; it is still a good idea to close the device explicitly so that resources are cleaned up.

Note that by the time the AccessChanged event is raised, the device handle may already be closed by the system.

Definition at line 443 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation = DeviceAccessInformation.CreateFromId(deviceInformation.Id);

            deviceAccessEventHandler = new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(this.OnDeviceAccessChanged);
            deviceAccessInformation.AccessChanged += deviceAccessEventHandler;
        }

void RegisterForDeviceWatcherEvents ( void ) [inline, private]

Register for Added and Removed events.

Note that, when disconnecting the device, the device may be closed by the system before the OnDeviceRemoved callback is invoked.

Definition at line 416 of file EventHandlerForDevice.cs.

        {
            deviceAddedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);

            deviceRemovedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);

            deviceWatcher.Added += deviceAddedEventHandler;

            deviceWatcher.Removed += deviceRemovedEventHandler;
        }

void StartDeviceWatcher ( void ) [inline, private]

Definition at line 458 of file EventHandlerForDevice.cs.

        {
            watcherStarted = true;

            if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Start();
            }
        }

void StopDeviceWatcher ( void ) [inline, private]

Definition at line 469 of file EventHandlerForDevice.cs.

        {
            if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Stop();
            }

            watcherStarted = false;
        }

void UnregisterFromAppEvents ( void ) [inline, private]

Definition at line 402 of file EventHandlerForDevice.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;
            appSuspendEventHandler = null;

            App.Current.Resuming -= appResumeEventHandler;
            appResumeEventHandler = null;
        }

void UnregisterFromDeviceAccessStatusChange ( ) [inline, private]

Definition at line 451 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation.AccessChanged -= deviceAccessEventHandler;

            deviceAccessEventHandler = null;
        }

void UnregisterFromDeviceWatcherEvents ( void ) [inline, private]

Definition at line 427 of file EventHandlerForDevice.cs.

        {
            deviceWatcher.Added -= deviceAddedEventHandler;
            deviceAddedEventHandler = null;

            deviceWatcher.Removed -= deviceRemovedEventHandler;
            deviceRemovedEventHandler = null;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 54 of file EventHandlerForDevice.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 53 of file EventHandlerForDevice.cs.

HidDevice device [private]

Definition at line 51 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs> deviceAccessEventHandler [private]

Definition at line 61 of file EventHandlerForDevice.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 50 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformation> deviceAddedEventHandler [private]

Definition at line 59 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceCloseCallback [private]

Definition at line 56 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, OnDeviceConnectedEventArgs> deviceConnectedCallback [private]

Definition at line 57 of file EventHandlerForDevice.cs.

DeviceInformation deviceInformation [private]

Definition at line 49 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformationUpdate> deviceRemovedEventHandler [private]

Definition at line 60 of file EventHandlerForDevice.cs.

String deviceSelector [private]

Definition at line 46 of file EventHandlerForDevice.cs.

DeviceWatcher deviceWatcher [private]

Definition at line 47 of file EventHandlerForDevice.cs.

EventHandlerForDevice eventHandlerForDevice [static, private]

Allows for singleton EventHandlerForDevice.

Definition at line 39 of file EventHandlerForDevice.cs.

Boolean isEnabledAutoReconnect [private]

Definition at line 65 of file EventHandlerForDevice.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 69 of file EventHandlerForDevice.cs.

Object singletonCreationLock = new Object() [static, private]

Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.

Definition at line 44 of file EventHandlerForDevice.cs.

Boolean watcherStarted [private]

Definition at line 64 of file EventHandlerForDevice.cs.

Boolean watcherSuspended [private]

Definition at line 63 of file EventHandlerForDevice.cs.

Property Documentation

EventHandlerForDevice Current [static, get]

Enforces the singleton pattern so that there is only one object handling app events as it relates to the UsbDevice because this sample app only supports communicating with one device at a time.

An instance of EventHandlerForDevice is globally available because the device needs to persist across scenario pages.

If there is no instance of EventHandlerForDevice created before this property is called, an EventHandlerForDevice will be created.

Definition at line 81 of file EventHandlerForDevice.cs.

HidDevice Device [get]

Definition at line 142 of file EventHandlerForDevice.cs.

DeviceAccessInformation DeviceAccessInformation [get]

Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice object.

Definition at line 166 of file EventHandlerForDevice.cs.

DeviceInformation DeviceInformation [get]

This DeviceInformation represents which device is connected or which device will be reconnected when the device is plugged in again (if IsEnabledAutoReconnect is true);.

Definition at line 154 of file EventHandlerForDevice.cs.

String DeviceSelector [get]

DeviceSelector AQS used to find this device.

Definition at line 177 of file EventHandlerForDevice.cs.

Boolean IsDeviceConnected [get]

Definition at line 134 of file EventHandlerForDevice.cs.

Boolean IsEnabledAutoReconnect [get, set]

True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again.

Definition at line 188 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceClose [get, set]

Definition at line 108 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, OnDeviceConnectedEventArgs> OnDeviceConnected [get, set]

Definition at line 121 of file EventHandlerForDevice.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/EventHandlerForDevice.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FeatureReports Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • FeatureReports
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FeatureReports Class Reference

This page demonstrates how to use FeatureReports to communicate with the device. More...

List of all members.

Public Member Functions

FeatureReports ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

async void | GetLedBlinkPattern_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | GetLedBlinkPatternAsync ()
async void | SetLedBlinkPattern_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | SetLedBlinkPatternAsync (Byte pattern)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_FeatureReports.xaml.cs.

Constructor & Destructor Documentation

FeatureReports ( ) [inline]

Definition at line 28 of file Scenario2_FeatureReports.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetLedBlinkPattern_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario2_FeatureReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonGetLedBlinkPattern.IsEnabled = false;

                await GetLedBlinkPatternAsync();

                ButtonGetLedBlinkPattern.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

async Task GetLedBlinkPatternAsync ( void ) [inline, private]

Uses feature report to get the LED blink pattern.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

The simplest way to obtain a byte from the buffer is by using a DataReader. DataReader provides a simple way to read from buffers (e.g. can return bytes, strings, ints).

Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 131 of file Scenario2_FeatureReports.xaml.cs.

        {
            var featureReport = await EventHandlerForDevice.Current.Device.GetFeatureReportAsync(SuperMutt.LedPattern.ReportId);

            if (featureReport.Data.Length == 2)
            {
                var dataReader = DataReader.FromBuffer(featureReport.Data);

                var reportId = dataReader.ReadByte();
                var pattern = dataReader.ReadByte();

                rootPage.NotifyUser("The Led blink pattern is " + pattern.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Expecting 2 bytes, but received " + featureReport.Data.Length, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file Scenario2_FeatureReports.xaml.cs.

        {
            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
        }

async void SetLedBlinkPattern_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario2_FeatureReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonSetLedBlinkPattern.IsEnabled = false;

                Byte pattern = (Byte)LedBlinkPatternInput.SelectedIndex;

                await SetLedBlinkPatternAsync(pattern);

                ButtonSetLedBlinkPattern.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task SetLedBlinkPatternAsync ( Byte pattern ) [inline, private]

Uses a feature report to set the blink pattern on the SuperMutt's LED.

Please note that when we create a FeatureReport, all data is nulled out in the report. Since we will only be modifying data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing ( all bits are zeroed out except for the bits we care about).

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

The SuperMutt has the following patterns: 0 - LED always on 1 - LED flash 2 seconds on, 2 off, repeat 2 - LED flash 2 seconds on, 1 off, 2 on, 4 off, repeat ... 7 - 7 iterations of 2 on, 1 off, followed by 4 off, repeat

Parameters:
pattern A number from 0-7. Each number represents a different blinking pattern
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 104 of file Scenario2_FeatureReports.xaml.cs.

        {
            var featureReport = EventHandlerForDevice.Current.Device.CreateFeatureReport(SuperMutt.LedPattern.ReportId);

            var dataWriter = new DataWriter();

            // First byte is always the report id
            dataWriter.WriteByte((Byte)featureReport.Id);
            dataWriter.WriteByte(pattern);

            featureReport.Data = dataWriter.DetachBuffer();

            await EventHandlerForDevice.Current.Device.SendFeatureReportAsync(featureReport);

            rootPage.NotifyUser("The Led blink pattern is set to " + pattern.ToString(), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario2_FeatureReports.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/Scenario2_FeatureReports.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InputOutputReports Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • InputOutputReports
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

InputOutputReports Class Reference

This scenario demonstrates how to get input reports and how to send output reports. More...

List of all members.

Public Member Functions

InputOutputReports ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

async void | GetBooleanInputReport_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async Task | GetBooleanInputReportAsync (Byte buttonNumber)
async void | GetNumericInputReport_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async Task | GetNumericInputReportAsync ()
async void | SendBooleanOutputReport_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async Task | SendBooleanOutputReportAsync (Boolean bitValue, Byte buttonNumber)
async void | SendNumericOutputReport_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async Task | SendNumericOutputReportAsync (Byte valueToWrite)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario4_InputOutputReports.xaml.cs.

Constructor & Destructor Documentation

InputOutputReports ( ) [inline]

Definition at line 28 of file Scenario4_InputOutputReports.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetBooleanInputReport_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 85 of file Scenario4_InputOutputReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                // Don't allow multiple reads at the same time
                ButtonGetBooleanInputReport.IsEnabled = false;

                // This sample will only demonstrate using the first button
                await GetBooleanInputReportAsync(1);

                ButtonGetBooleanInputReport.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task GetBooleanInputReportAsync ( Byte buttonNumber ) [inline, private]

Uses an input report to get the value that was previously written to the device with output report.

We will be using controls to modify the data buffer. See SendBooleanOutputReportAsync for how to modify the data buffer directly.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
buttonNumber Button to get the value of (1-4)
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 185 of file Scenario4_InputOutputReports.xaml.cs.

        {
            var inputReport = await EventHandlerForDevice.Current.Device.GetInputReportAsync(SuperMutt.ReadWriteBufferControlInformation.ReportId);

            // Use the first button
            var inputReportControl = inputReport.GetBooleanControl(SuperMutt.ReadWriteBufferControlInformation.ButtonUsagePage, SuperMutt.ReadWriteBufferControlInformation.ButtonUsageId[buttonNumber - 1]);

            var value = inputReportControl.IsActive ? "1" : "0";

            rootPage.NotifyUser("Bit value: " + value, NotifyType.StatusMessage);
        }

async void GetNumericInputReport_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario4_InputOutputReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                // Don't allow multiple reads at the same time
                ButtonGetNumericInputReport.IsEnabled = false;

                await GetNumericInputReportAsync();

                ButtonGetNumericInputReport.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task GetNumericInputReportAsync ( void ) [inline, private]

Uses an input report to get the value that was previously written to the device with output report.

We will be using controls to modify the data buffer. See SendNumericOutputReportAsync for how to modify the data buffer directly.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 131 of file Scenario4_InputOutputReports.xaml.cs.

        {
            var inputReport = await EventHandlerForDevice.Current.Device.GetInputReportAsync(SuperMutt.ReadWriteBufferControlInformation.ReportId);

            var inputReportControl = inputReport.GetNumericControl(SuperMutt.ReadWriteBufferControlInformation.VolumeUsagePage, SuperMutt.ReadWriteBufferControlInformation.VolumeUsageId);

            var data = inputReportControl.Value;

            rootPage.NotifyUser("Value read: " + data.ToString(), NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file Scenario4_InputOutputReports.xaml.cs.

        {
            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
        }

async void SendBooleanOutputReport_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario4_InputOutputReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonSendBooleanOutputReport.IsEnabled = false;

                Boolean valueToWrite = BooleanValueToWrite.SelectedIndex == 1 ? true : false;

                // We will only demonstrate modifying button 1
                await SendBooleanOutputReportAsync(valueToWrite, 1);

                ButtonSendBooleanOutputReport.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task SendBooleanOutputReportAsync | ( | Boolean | bitValue,
 |  | Byte | buttonNumber |
 | ) |  |  | [inline, private]

Uses an output report to write data to the device so that it can be read back using input report.

Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing ( all bits are zeroed out except for the bits we care about).

We will modify the data buffer directly. See GetBooleanInputReportAsync for how to use controls.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
bitValue
buttonNumber Button to change value of (1-4)
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 212 of file Scenario4_InputOutputReports.xaml.cs.

        {
            var buttonIndex = buttonNumber - 1;

            var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.ReadWriteBufferControlInformation.ReportId);

            Byte byteToMask = (Byte)(bitValue ? 0xFF : 0x00);
            Byte dataByte = (Byte)(byteToMask & SuperMutt.ReadWriteBufferControlInformation.ButtonDataMask[buttonIndex]);

            var dataWriter = new DataWriter();

            // First byte is always the report id
            dataWriter.WriteByte((Byte)outputReport.Id);
            dataWriter.WriteByte(dataByte);

            outputReport.Data = dataWriter.DetachBuffer();

            UInt32 bytesWritten = await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);

            var valueWritten = bitValue ? "1" : "0";
            rootPage.NotifyUser("Bit value written: " + valueWritten, NotifyType.StatusMessage);
        }

async void SendNumericOutputReport_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario4_InputOutputReports.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonSendNumericOutputReport.IsEnabled = false;

                Byte valueToWrite = (Byte)NumericValueToWrite.SelectedIndex;

                await SendNumericOutputReportAsync(valueToWrite);

                ButtonSendNumericOutputReport.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task SendNumericOutputReportAsync ( Byte valueToWrite ) [inline, private]

Uses an output report to write data to the device so that it can be read back using input report.

Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing ( all bits are zeroed out except for the bits we care about).

We will modify the data buffer directly. See GetNumericInputReportAsync for how to use controls.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
valueToWrite
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 156 of file Scenario4_InputOutputReports.xaml.cs.

        {
            var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.ReadWriteBufferControlInformation.ReportId);

            Byte dataByte = (Byte)(valueToWrite << SuperMutt.ReadWriteBufferControlInformation.VolumeDataStartBit);

            var dataWriter = new DataWriter();

            // First byte is always the report id
            dataWriter.WriteByte((Byte)outputReport.Id);
            dataWriter.WriteByte(dataByte);

            outputReport.Data = dataWriter.DetachBuffer();

            uint bytesWritten = await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);

            rootPage.NotifyUser("Value written: " + valueToWrite, NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario4_InputOutputReports.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/Scenario4_InputOutputReports.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InputReportEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • InputReportEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

InputReportEvents Class Reference

This scenario demonstrates to how register and utilize input reports. More...

List of all members.

Public Member Functions

InputReportEvents ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
async void | OnInputReportEvent (HidDevice sender, HidInputReportReceivedEventArgs eventArgs)
void | RegisterForInputReportEvents ()
void | RegisterForInputReportEvents_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async void | StartSuperMuttInputReports ()
async void | StopSuperMuttInputReports ()
void | UnregisterFromInputReportEvent ()
void | UnregisterFromInputReportEvents_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
void | UpdateRegisterEventButtons ()

Private Attributes

TypedEventHandler< HidDevice,
HidInputReportReceivedEventArgs > 		inputReportEventHandler
Boolean | isRegisteredForInputReportEvents
Boolean | navigatedAway
UInt32 | numInputReportEventsReceived
HidDevice | registeredDevice
MainPage | rootPage = MainPage.Current
UInt32 | totalNumberBytesReceived

Detailed Description

Definition at line 24 of file Scenario3_InputReportEvents.xaml.cs.

Constructor & Destructor Documentation

InputReportEvents ( ) [inline]

Definition at line 41 of file Scenario3_InputReportEvents.xaml.cs.

        {
            numInputReportEventsReceived = 0;
            isRegisteredForInputReportEvents = false;

            this.InitializeComponent();
        }

Member Function Documentation

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario3_InputReportEvents.xaml.cs.

        {
            UnregisterFromInputReportEvent();

            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                UpdateRegisterEventButtons();
            }));
        }

async void OnInputReportEvent | ( | HidDevice | sender,
 |  | HidInputReportReceivedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This callback only increments the total number of events received and prints it.

This method is called whenever the device's state changes and sends a report. Since all input reports share the same event in HidDevice, the app needs to get the HidInputReport from eventArgs.Report and compare report ids and usages with the desired report.

Parameters:
sender | HidDevice that the event is being raised from
eventArgs | Contains the HidInputReport that caused the event to raise

Definition at line 194 of file Scenario3_InputReportEvents.xaml.cs.

        {
            // If we navigated away from this page, we don't need to process this event
            // This also prevents output from spilling into another page
            if (!navigatedAway)
            {
                numInputReportEventsReceived++;

                // The data from the InputReport
                HidInputReport inputReport = eventArgs.Report;
                IBuffer buffer = inputReport.Data;

                totalNumberBytesReceived += buffer.Length;

                // Create a DispatchedHandler for the because we are interracting with the UI directly and the
                // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
                // the UI, an exception is thrown
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        // If we navigated away from this page, do not print anything. The dispatch may be handled after
                        // we move to a different page.
                        if (!navigatedAway)
                        {
                            rootPage.NotifyUser(
                                "Total number of input report events received: " + numInputReportEventsReceived.ToString()
                                + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
                                NotifyType.StatusMessage);
                        }
                    }));
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Reset the device into a known state by undoing everything we did to the device (unregister interrupts and stop the device from creating interrupts).

Parameters:
eventArgs

Definition at line 82 of file Scenario3_InputReportEvents.xaml.cs.

        {
            navigatedAway = true;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UnregisterFromInputReportEvent();

                // Stop interrupts after unregistering so that device interrupts do not effect the scenario (stopping before unregistering
                // will cause events to stop being raised, which will be noticable by the app; we want this to be transparent)
                StopSuperMuttInputReports();
            }

            // We are leaving and no longer care about the device closing
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

The SuperMutt requires an output report to tell the device to start sending interrupts, so we will start it just in case we register for the events. We want this to be transparent because it doesn't demonstrate how to register for events.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 60 of file Scenario3_InputReportEvents.xaml.cs.

        {
            navigatedAway = false;

            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // Get notified when the device is about to be closed so we can unregister events
            EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

            UpdateRegisterEventButtons();
        }

void RegisterForInputReportEvents ( ) [inline, private]

Register for the event that is triggered when the device sends a report to us.

All input reports share the same event in HidDevice, so once we register the event, all HidInputReports (regardless of the report id) will raise the event. Read the comment above OnInputReportEvent for more information on how to distinguish input reports.

The function also saves the event token so that we can unregister from the event later on.

Definition at line 236 of file Scenario3_InputReportEvents.xaml.cs.

        {
            if (!isRegisteredForInputReportEvents)
            {
                inputReportEventHandler = new TypedEventHandler<HidDevice, HidInputReportReceivedEventArgs>(this.OnInputReportEvent);

                // Remember which device we are registering the device with, in case there is a device disconnect and reconnect. We want to avoid unregistering
                // an event handler that is not registered with the device object.
                // Ideally, one should remove the event token (e.g. assign to null) upon the device removal to avoid using it again.
                registeredDevice = EventHandlerForDevice.Current.Device;

                registeredDevice.InputReportReceived += inputReportEventHandler;

                numInputReportEventsReceived = 0;
                totalNumberBytesReceived = 0;

                isRegisteredForInputReportEvents = true;
            }
        }

void RegisterForInputReportEvents_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario3_InputReportEvents.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                // Start the interrupts on the SuperMutt device (by default the device doesn't generate interrupts)
                StartSuperMuttInputReports();

                RegisterForInputReportEvents();

                UpdateRegisterEventButtons();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

async void StartSuperMuttInputReports ( void ) [inline, private]

Tells the SuperMutt device to start creating interrupts.

The app won't get any interrupts until after we register for the event.

We are using an output report to start the interrupts, please go to Scenario4_InputOutputReports for more information on how to use output reports.

Definition at line 149 of file Scenario3_InputReportEvents.xaml.cs.

        {
            var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.DeviceInputReportControlInformation.ReportId);

            var dataWriter = new DataWriter();

            // First byte is always the report id
            dataWriter.WriteByte((Byte)outputReport.Id);
            dataWriter.WriteByte(SuperMutt.DeviceInputReportControlInformation.DataTurnOn);

            outputReport.Data = dataWriter.DetachBuffer();

            await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
        }

async void StopSuperMuttInputReports ( void ) [inline, private]

Tells the SuperMutt device to stop creating interrupts.

The app will stop getting event raises unless we start the interrupts again.

We are using an output report to start the interrupts, please go to Scenario4_InputOutputReports for more information on how to use output reports.

Definition at line 170 of file Scenario3_InputReportEvents.xaml.cs.

        {
            var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.DeviceInputReportControlInformation.ReportId);

            var dataWriter = new DataWriter();

            // First byte is always the report id
            dataWriter.WriteByte((Byte)outputReport.Id);
            dataWriter.WriteByte(SuperMutt.DeviceInputReportControlInformation.DataTurnOff);

            outputReport.Data = dataWriter.DetachBuffer();

            await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
        }

void UnregisterFromInputReportEvent ( void ) [inline, private]

Unregisters from the HidDevice's InputReportReceived event that was registered for in the RegisterForInputReportEvents();.

Definition at line 259 of file Scenario3_InputReportEvents.xaml.cs.

        {
            if (isRegisteredForInputReportEvents)
            {
                // Don't unregister event if the device was removed and reconnected because the endpoint event no longer contains our event handler
                if (registeredDevice == EventHandlerForDevice.Current.Device)
                {
                    registeredDevice.InputReportReceived -= inputReportEventHandler;
                }

                registeredDevice = null;
                isRegisteredForInputReportEvents = false;
            }
        }

void UnregisterFromInputReportEvents_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 127 of file Scenario3_InputReportEvents.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UnregisterFromInputReportEvent();

                StopSuperMuttInputReports();

                UpdateRegisterEventButtons();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void UpdateRegisterEventButtons ( void ) [inline, private]

Definition at line 274 of file Scenario3_InputReportEvents.xaml.cs.

        {
            ButtonRegisterForInputReportEvents.IsEnabled = !isRegisteredForInputReportEvents;
            ButtonUnregisterFromInputReportEvents.IsEnabled = isRegisteredForInputReportEvents;
        }

Member Data Documentation

TypedEventHandler<HidDevice, HidInputReportReceivedEventArgs> inputReportEventHandler [private]

Definition at line 26 of file Scenario3_InputReportEvents.xaml.cs.

Boolean isRegisteredForInputReportEvents [private]

Definition at line 27 of file Scenario3_InputReportEvents.xaml.cs.

Boolean navigatedAway [private]

Definition at line 35 of file Scenario3_InputReportEvents.xaml.cs.

UInt32 numInputReportEventsReceived [private]

Definition at line 28 of file Scenario3_InputReportEvents.xaml.cs.

HidDevice registeredDevice [private]

Definition at line 32 of file Scenario3_InputReportEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario3_InputReportEvents.xaml.cs.

UInt32 totalNumberBytesReceived [private]

Definition at line 29 of file Scenario3_InputReportEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/Scenario3_InputReportEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDeviceConnectedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • OnDeviceConnectedEventArgs
Public Member Functions | Properties | Private Attributes

OnDeviceConnectedEventArgs Class Reference

List of all members.

Public Member Functions

OnDeviceConnectedEventArgs (Boolean isDeviceSuccessfullyConnected, Windows.Devices.Enumeration.DeviceInformation deviceInformation)

Properties

Windows.Devices.Enumeration.DeviceInformation | DeviceInformation [get]
Boolean | IsDeviceSuccessfullyConnected [get]

Private Attributes

Windows.Devices.Enumeration.DeviceInformation | deviceInformation
Boolean | isDeviceSuccessfullyConnected

Detailed Description

Definition at line 48 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

OnDeviceConnectedEventArgs | ( | Boolean | isDeviceSuccessfullyConnected,
 |  | Windows.Devices.Enumeration.DeviceInformation | deviceInformation |
 | ) |  |  | [inline]

Definition at line 53 of file SampleConfiguration.cs.

        {
            this.isDeviceSuccessfullyConnected = isDeviceSuccessfullyConnected;
            this.deviceInformation = deviceInformation;
        }

Member Data Documentation

Windows.Devices.Enumeration.DeviceInformation deviceInformation [private]

Definition at line 51 of file SampleConfiguration.cs.

Boolean isDeviceSuccessfullyConnected [private]

Definition at line 50 of file SampleConfiguration.cs.

Property Documentation

Windows.Devices.Enumeration.DeviceInformation DeviceInformation [get]

Definition at line 68 of file SampleConfiguration.cs.

Boolean IsDeviceSuccessfullyConnected [get]

Definition at line 60 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • SuperMutt
Classes

SuperMutt Class Reference

This is the report descriptor for the support SuperMutt device. More...

Classes

class | Device
class | DeviceInputReportControlInformation
Only available for output reports. More...
class | LedPattern
Only available for Feature Reports. More...
class | ReadWriteBufferControlInformation
Only available for Input/Output Reports. More...

Detailed Description

0x06, 0xAA, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x01, // COLLECTION (Application) 0x85, 0x01, // REPORT_ID (1) 0xa1, 0x00, // COLLECTION (Physical) 0x05, 0x09, // USAGE_PAGE (Button) 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x29, 0x04, // USAGE_MAXIMUM (Button 4) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x04, // REPORT_COUNT (4) 0x81, 0x02, // INPUT (Data,Var,Abs) 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) 0x09, 0xe0, // USAGE (Volume) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x0a, // LOGICAL_MAXIMUM (10) 0x35, 0x00, // PHYSICAL_MINIMUM (0) 0x45, 0x64, // PHYSICAL_MAXIMUM (100) 0x75, 0x04, // REPORT_SIZE (4) 0x95, 0x01, // REPORT_COUNT (1) 0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xa1, 0x00, // COLLECTION (Physical) 0x05, 0x09, // USAGE_PAGE (Button) 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x29, 0x04, // USAGE_MAXIMUM (Button 4) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x04, // REPORT_COUNT (4) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) 0x09, 0xe0, // USAGE (Volume) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x0a, // LOGICAL_MAXIMUM (10) 0x35, 0x00, // PHYSICAL_MINIMUM (0) 0x45, 0x64, // PHYSICAL_MAXIMUM (100) 0x75, 0x04, // REPORT_SIZE (4) 0x95, 0x01, // REPORT_COUNT (1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0x03, // REPORT_ID (3) 0x06, 0xAA, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x01, // REPORT_COUNT (1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x95, 0x07, // REPORT_COUNT (7) 0x91, 0x07, // OUTPUT (Cnst,Var,Rel) 0xc0, // END_COLLECTION 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0x04, // REPORT_ID (4) 0x06, 0xAA, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0xc0, // END_COLLECTION 0x06, 0xDD, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0xff, // REPORT_ID (255) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 // END_COLLECTION

Definition at line 161 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::Device Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • SuperMutt
  • SuperMutt::Device
Public Attributes

SuperMutt::Device Class Reference

List of all members.

Public Attributes

const UInt16 | Pid = 0x0610
const UInt16 | UsageId = 0x01
const UInt16 | UsagePage = 0xFFAA
const UInt16 | Vid = 0x045E

Detailed Description

Definition at line 219 of file SampleConfiguration.cs.

Member Data Documentation

const UInt16 Pid = 0x0610

Definition at line 222 of file SampleConfiguration.cs.

const UInt16 UsageId = 0x01

Definition at line 224 of file SampleConfiguration.cs.

const UInt16 UsagePage = 0xFFAA

Definition at line 223 of file SampleConfiguration.cs.

const UInt16 Vid = 0x045E

Definition at line 221 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::DeviceInputReportControlInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • SuperMutt
  • SuperMutt::DeviceInputReportControlInformation
Public Attributes

SuperMutt::DeviceInputReportControlInformation Class Reference

Only available for output reports. More...

List of all members.

Public Attributes

const Byte | DataTurnOff = 0x00
const Byte | DataTurnOn = 0x01
const UInt16 | ReportId = 0x03
const UInt16 | UsageId = 0x01
const UInt16 | UsagePage = 0xFF00

Detailed Description

The report Id is used to start and stop device input reports. Data: 0x01 will enable input reports

Definition at line 206 of file SampleConfiguration.cs.

Member Data Documentation

const Byte DataTurnOff = 0x00

Definition at line 216 of file SampleConfiguration.cs.

const Byte DataTurnOn = 0x01

Values used to turn on/off the device interrupts.

Definition at line 215 of file SampleConfiguration.cs.

const UInt16 ReportId = 0x03

Definition at line 208 of file SampleConfiguration.cs.

const UInt16 UsageId = 0x01

Definition at line 210 of file SampleConfiguration.cs.

const UInt16 UsagePage = 0xFF00

Definition at line 209 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::LedPattern Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • SuperMutt
  • SuperMutt::LedPattern
Public Attributes

SuperMutt::LedPattern Class Reference

Only available for Feature Reports. More...

List of all members.

Public Attributes

const UInt16 | ReportId = 0x04
const UInt16 | UsageId = 0x01
const UInt16 | UsagePage = 0xFF00

Detailed Description

Definition at line 166 of file SampleConfiguration.cs.

Member Data Documentation

const UInt16 ReportId = 0x04

Definition at line 168 of file SampleConfiguration.cs.

const UInt16 UsageId = 0x01

Definition at line 170 of file SampleConfiguration.cs.

const UInt16 UsagePage = 0xFF00

Definition at line 169 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::ReadWriteBufferControlInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • SuperMutt
  • SuperMutt::ReadWriteBufferControlInformation
Public Attributes | Static Public Attributes

SuperMutt::ReadWriteBufferControlInformation Class Reference

Only available for Input/Output Reports. More...

List of all members.

Public Attributes

const UInt16 | ButtonUsagePage = 0x09
const UInt16 | ReportId = 0x01
const Byte | VolumeDataStartBit = 4
const UInt16 | VolumeUsageId = 0xE0
const UInt16 | VolumeUsagePage = 0x0C

Static Public Attributes

static Byte[] | ButtonDataMask
static UInt16[] | ButtonUsageId = { 1, 2, 3, 4 }

Detailed Description

Definition at line 176 of file SampleConfiguration.cs.

Member Data Documentation

Byte [] ButtonDataMask [static]
Initial value:
 {
                0x01,
                0x02,
                0x04,
                0x08,
            }

Definition at line 192 of file SampleConfiguration.cs.

UInt16 [] ButtonUsageId = { 1, 2, 3, 4 } [static]

Usage id corresponding to each button 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x29, 0x04, // USAGE_MAXIMUM (Button 4).

Definition at line 190 of file SampleConfiguration.cs.

const UInt16 ButtonUsagePage = 0x09

Definition at line 183 of file SampleConfiguration.cs.

const UInt16 ReportId = 0x01

Definition at line 178 of file SampleConfiguration.cs.

const Byte VolumeDataStartBit = 4

Definition at line 181 of file SampleConfiguration.cs.

const UInt16 VolumeUsageId = 0xE0

Definition at line 180 of file SampleConfiguration.cs.

const UInt16 VolumeUsagePage = 0x0C

Definition at line 179 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utilities Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomHidDeviceAccess
  • Utilities
Static Public Member Functions

Utilities Class Reference

List of all members.

Static Public Member Functions

static DeviceType | GetDeviceType (HidDevice device)
static Boolean | IsSuperMuttDevice (HidDevice device)
static void | NotifyDeviceNotConnected ()
static void | SetUpDeviceScenarios (Dictionary< DeviceType, UIElement > scenarios, UIElement scenarioContainer)

Detailed Description

Definition at line 15 of file Utilities.cs.

Member Function Documentation

static DeviceType GetDeviceType ( HidDevice device ) [inline, static]

Device type of the device provided device.

Parameters:
device
Returns:
The DeviceType of the device or DeviceType.None if there are no devices connected or is not recognized

Definition at line 62 of file Utilities.cs.

        {
            if (device != null)
            {
                if (device != null
                    && device.VendorId == SuperMutt.Device.Vid
                    && device.ProductId == SuperMutt.Device.Pid)
                {
                    return DeviceType.SuperMutt;
                }

                return DeviceType.None;
            }

            return DeviceType.None;
        }

static Boolean IsSuperMuttDevice ( HidDevice device ) [inline, static]

Definition at line 79 of file Utilities.cs.

        {
            return (GetDeviceType(device) == DeviceType.SuperMutt);
        }

static void NotifyDeviceNotConnected ( void ) [inline, static]

Prints an error message stating that device is not connected.

Definition at line 87 of file Utilities.cs.

        {
            MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
        }

static void SetUpDeviceScenarios | ( | Dictionary< DeviceType, UIElement > | scenarios,
 |  | UIElement | scenarioContainer |
 | ) |  |  | [inline, static]

Displays the compatible scenarios and hides the non-compatible ones.

If there are no supported devices, the scenarioContainer will be hidden and an error message will be displayed.

Parameters:
scenarios | The key is the device type that the value, scenario, supports.
scenarioContainer | The container that encompasses all the scenarios that are specific to devices

Definition at line 24 of file Utilities.cs.

        {
            UIElement supportedScenario = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                foreach (KeyValuePair<DeviceType, UIElement> deviceScenario in scenarios)
                {
                    // Enable the scenario if it's generic or the device type matches
                    if ((deviceScenario.Key == DeviceType.Any)
                        || (deviceScenario.Key == Utilities.GetDeviceType(EventHandlerForDevice.Current.Device)))
                    {
                        // Make the scenario visible in case other devices use the same scenario and collapsed it.
                        deviceScenario.Value.Visibility = Visibility.Visible;

                        supportedScenario = deviceScenario.Value;
                    }
                    else if (deviceScenario.Value != supportedScenario)    // Don't hide the scenario if it is supported by the current device and is shared by other devices
                    {
                        deviceScenario.Value.Visibility = Visibility.Collapsed;
                    }
                }
            }

            if (supportedScenario == null)
            {
                // Hide the container so that common elements shared across scenarios are also hidden
                scenarioContainer.Visibility = Visibility.Collapsed;

                NotifyDeviceNotConnected();
            }
        }

The documentation for this class was generated from the following file:
  • CustomHidDeviceAccess/cs/Utilities.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomMediaTransportControls
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 25 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Allows tracking page views, exceptions and other telemetry through the Microsoft Application Insights service.

Initializes the singleton application object. This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 35 of file App.xaml.cs.

        {

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 47 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 93 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 105 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

The documentation for this class was generated from the following file:
  • XamlCustomMediaTransportControls/cs/App.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomMediaTransportControls Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomMediaTransportControls
  • CustomMediaTransportControls
Public Member Functions | Protected Member Functions | Events | Private Member Functions

CustomMediaTransportControls Class Reference

List of all members.

Public Member Functions

CustomMediaTransportControls ()

Protected Member Functions

override void | OnApplyTemplate ()

Events

EventHandler< EventArgs > | Liked

Private Member Functions

void | LikeButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 16 of file CustomMediaTransportControls.cs.

Constructor & Destructor Documentation

CustomMediaTransportControls ( ) [inline]

Definition at line 20 of file CustomMediaTransportControls.cs.

        {
            this.DefaultStyleKey = typeof(CustomMediaTransportControls);
        }

Member Function Documentation

void LikeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file CustomMediaTransportControls.cs.

        {
            // Raise an event on the custom control when 'like' is clicked
            Liked?.Invoke(this, EventArgs.Empty);
        }

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 25 of file CustomMediaTransportControls.cs.

        {
            // This is where you would get your custom button and create an event handler for its click method.
            Button likeButton = GetTemplateChild("LikeButton") as Button;
            likeButton.Click += LikeButton_Click;

            base.OnApplyTemplate();
        }

Event Documentation

EventHandler<EventArgs> Liked

Definition at line 18 of file CustomMediaTransportControls.cs.

The documentation for this class was generated from the following file:
  • XamlCustomMediaTransportControls/cs/CustomMediaTransportControls.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomMediaTransportControls
  • MainPage
Public Member Functions | Private Member Functions | Private Attributes

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()

Private Member Functions

async void | CustomMTC_Liked (object sender, EventArgs e)

Private Attributes

int | likes = 0

Detailed Description

Definition at line 25 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 29 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            //This following line is setting the source for the MediaPlayerElement
            this.MainMPE.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/fishes.wmv"));
        }

Member Function Documentation

async void CustomMTC_Liked | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file MainPage.xaml.cs.

        {
            var messageDialog = new MessageDialog("You liked this video " + (++likes) + " times.");
            await messageDialog.ShowAsync();
        }

Member Data Documentation

int likes = 0 [private]

Definition at line 27 of file MainPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlCustomMediaTransportControls/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomPixelShaderMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomPixelShader
  • CustomPixelShaderMain
Public Member Functions | Private Attributes

CustomPixelShaderMain Class Reference

#include "CustomPixelShaderMain.h"

List of all members.

Public Member Functions

CustomPixelShaderMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~CustomPixelShaderMain ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()
void | UpdatePointer (_In_ Windows::UI::Core::PointerEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< SampleOverlay > | m_sampleOverlay
std::unique_ptr
< CustomPixelShaderRenderer > 		m_sceneRenderer

Detailed Description

Definition at line 22 of file CustomPixelShaderMain.h.

Constructor & Destructor Documentation

CustomPixelShaderMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file CustomPixelShaderMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    m_sceneRenderer = std::unique_ptr<CustomPixelShaderRenderer>(new CustomPixelShaderRenderer(m_deviceResources));
    m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D Custom Pixel Shader Effect"));
}

~CustomPixelShaderMain ( )

Definition at line 34 of file CustomPixelShaderMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void CreateWindowSizeDependentResources ( )

Definition at line 41 of file CustomPixelShaderMain.cpp.

{
    m_sceneRenderer->CreateWindowSizeDependentResources();
    m_sampleOverlay->CreateWindowSizeDependentResources();
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void OnDeviceLost ( ) [virtual]

Definition at line 69 of file CustomPixelShaderMain.cpp.

{
    m_sceneRenderer->ReleaseDeviceDependentResources();
    m_sampleOverlay->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 76 of file CustomPixelShaderMain.cpp.

{
    m_sceneRenderer->CreateDeviceDependentResources();
    m_sampleOverlay->CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

bool Render ( )

Definition at line 60 of file CustomPixelShaderMain.cpp.

{
    m_sceneRenderer->Render();
    m_sampleOverlay->Render();

    return true;
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void Update ( )

Definition at line 53 of file CustomPixelShaderMain.cpp.

{
    m_sceneRenderer->Update();
}

void UpdatePointer ( _In_ Windows::UI::Core::PointerEventArgs^ args )

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 42 of file CustomPixelShaderMain.h.

std::unique_ptr<SampleOverlay> m_sampleOverlay [private]

Definition at line 45 of file CustomPixelShaderMain.h.

std::unique_ptr<CustomPixelShaderRenderer> m_sceneRenderer [private]

Definition at line 44 of file CustomPixelShaderMain.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.h
  • D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.cpp
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomPixelShaderRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomPixelShader
  • CustomPixelShaderRenderer
Public Member Functions | Private Member Functions | Private Attributes

CustomPixelShaderRenderer Class Reference

#include "CustomPixelShaderRenderer.h"

List of all members.

Public Member Functions

CustomPixelShaderRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()
void | UpdatePointer (_In_ Windows::UI::Core::PointerEventArgs^args)

Private Member Functions

void | UpdateImageScale (float scale)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< IWICFormatConverter > 		m_formatConvert
D2D1_SIZE_U | m_imageSize
Microsoft::WRL::ComPtr
< ID2D1ImageSourceFromWic > 		m_imageSource
bool | m_isRippleAnimating
bool | m_isWindowClosed
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_rippleEffect
float | m_scale
BasicTimer m_timer
Microsoft::WRL::ComPtr
< ID2D1TransformedImageSource > 		m_transformedImage

Detailed Description

Definition at line 21 of file CustomPixelShaderRenderer.h.

Constructor & Destructor Documentation

CustomPixelShaderRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file CustomPixelShaderRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_isRippleAnimating(false)
{
    m_timer = ref new BasicTimer();

    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 73 of file CustomPixelShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // Load the image from WIC using ImageSource. The image is scaled using
    // ID2D1TransformedImageSource which is dependent on the scale factor.
    DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));

    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_CustomRippleEffect, &m_rippleEffect));
}

void CreateDeviceIndependentResources ( )

Definition at line 35 of file CustomPixelShaderRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();
    auto d2dFactory = m_deviceResources->GetD2DFactory();

    // Create WIC Decoder to read JPG file.
    ComPtr<IWICBitmapDecoder> decoder;
    DX::ThrowIfFailed(
        wicFactory->CreateDecoderFromFilename(
        L"Assets\\rainier.jpg",
        nullptr,
        GENERIC_READ,
        WICDecodeMetadataCacheOnDemand,
        &decoder
        ));

    ComPtr<IWICBitmapFrameDecode> frame;
    DX::ThrowIfFailed(decoder->GetFrame(0, &frame));

    DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
    DX::ThrowIfFailed(m_formatConvert->Initialize(
        frame.Get(),
        GUID_WICPixelFormat32bppPBGRA, // 32bppPBGRA is used by Direct2D.
        WICBitmapDitherTypeNone,
        nullptr,
        0.0f,
        WICBitmapPaletteTypeCustom
        ));

    UINT width;
    UINT height;
    DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
    m_imageSize = D2D1::SizeU(width, height);

    // Register the custom ripple effect.
    DX::ThrowIfFailed(RippleEffect::Register(d2dFactory));
}

void CreateWindowSizeDependentResources ( )

Definition at line 91 of file CustomPixelShaderRenderer.cpp.

{
    auto size = m_deviceResources->GetLogicalSize();
    float scale = size.Width / m_imageSize.width;

    UpdateImageScale(scale);
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state ) [inline]

Definition at line 35 of file CustomPixelShaderRenderer.h.

{};

void ReleaseDeviceDependentResources ( )

Definition at line 84 of file CustomPixelShaderRenderer.cpp.

{
    m_imageSource.Reset();
    m_rippleEffect.Reset();
    m_transformedImage.Reset();
}

void Render ( )

Definition at line 170 of file CustomPixelShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->BeginDraw();
    m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    d2dContext->DrawImage(m_rippleEffect.Get());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state ) [inline]

Definition at line 34 of file CustomPixelShaderRenderer.h.

{};

void Update ( )

Definition at line 142 of file CustomPixelShaderRenderer.cpp.

{
    if (m_isRippleAnimating)
    {
        m_timer->Update();
        float delta = m_timer->Total;

        // Stop animating after four seconds.
        if (delta >= 4)
        {
            delta = 4;
            m_isRippleAnimating = false;
        }

        // Increase the spread over time to make the visible area of the waves spread out.
        DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_SPREAD, 0.01f + delta / 10.0f));

        // Reduce the amplitude over time to make the waves decay in intensity.
        DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_AMPLITUDE, 60.0f - delta * 15.0f));

        // Reduce the frequency over time to make each individual wave spread out.
        DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_FREQUENCY, 140.0f - delta * 30.0f));

        // Change the phase over time to make each individual wave travel away from the center.
        DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_PHASE, -delta * 20.0f));
    }
}

void UpdateImageScale ( float scale ) [private]

Definition at line 100 of file CustomPixelShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // When using ID2D1ImageSource, the recommend method of applying a transform
    // is to use ID2D1TransformedImageSource. It is inexpensive to recreate this object.
    D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
    {
        D2D1_ORIENTATION_DEFAULT,
        scale,
        scale,
        D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
        D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE
    };

    DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
        m_imageSource.Get(),
        &props,
        &m_transformedImage));

    m_rippleEffect->SetInput(0, m_transformedImage.Get());
}

void UpdatePointer ( _In_ Windows::UI::Core::PointerEventArgs^ args )

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 42 of file CustomPixelShaderRenderer.h.

Microsoft::WRL::ComPtr<IWICFormatConverter> m_formatConvert [private]

Definition at line 43 of file CustomPixelShaderRenderer.h.

D2D1_SIZE_U m_imageSize [private]

Definition at line 50 of file CustomPixelShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic> m_imageSource [private]

Definition at line 44 of file CustomPixelShaderRenderer.h.

bool m_isRippleAnimating [private]

Definition at line 49 of file CustomPixelShaderRenderer.h.

bool m_isWindowClosed [private]

Definition at line 48 of file CustomPixelShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_rippleEffect [private]

Definition at line 46 of file CustomPixelShaderRenderer.h.

float m_scale [private]

Definition at line 51 of file CustomPixelShaderRenderer.h.

BasicTimer m_timer [private]

Definition at line 53 of file CustomPixelShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1TransformedImageSource> m_transformedImage [private]

Definition at line 45 of file CustomPixelShaderRenderer.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.h
  • D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.cpp
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomPixelShader
  • SampleOverlay
Public Member Functions | Private Attributes

SampleOverlay Class Reference

#include "SampleOverlay.h"

List of all members.

Public Member Functions

SampleOverlay (const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
float | GetTitleHeightInDips ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::wstring | m_caption
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawOverlay
UINT | m_idIncrement
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
float | m_overlayWidth
float | m_padding
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_textVerticalOffset
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 21 of file SampleOverlay.h.

Constructor & Destructor Documentation

SampleOverlay | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | const std::wstring & | caption
 | ) |  |

Definition at line 24 of file SampleOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_caption(caption),
    m_drawOverlay(true)
{
    m_padding = 8.0f;
    m_textVerticalOffset = 7.0f;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);
    m_overlayWidth = 0.0f;

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 38 of file SampleOverlay.cpp.

{
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
        );

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
            L"Assets\\storelogo-sdk.png",
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
            )
        );

    double dpiX = 96.0;
    double dpiY = 96.0;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    ComPtr<IDWriteTextFormat> nameTextFormat;
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            36.0f,
            L"en-US",
            &nameTextFormat
            )
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            m_caption.c_str(),
            static_cast<UINT32>(m_caption.size()),
            nameTextFormat.Get(),
            4096.0f,
            4096.0f,
            &m_textLayout
            )
        );

    DWRITE_TEXT_METRICS metrics = {0};
    DX::ThrowIfFailed(
        m_textLayout->GetMetrics(&metrics)
        );

    m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 141 of file SampleOverlay.cpp.

{
    if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
    {
        m_drawOverlay = false;
    }
    else
    {
        m_drawOverlay = true;
    }
}

float GetTitleHeightInDips ( )

Definition at line 192 of file SampleOverlay.cpp.

{
    return m_logoSize.height + m_padding;
}

void ReleaseDeviceDependentResources ( )

Definition at line 155 of file SampleOverlay.cpp.

{
    m_whiteBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( )

Definition at line 161 of file SampleOverlay.cpp.

{
    if (m_drawOverlay)
    {
        m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());

        m_deviceResources->GetD2DDeviceContext()->BeginDraw();
        m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
        m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
            );

        m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
            m_textLayout.Get(),
            m_whiteBrush.Get()
            );

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }

        m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
    }
}

Member Data Documentation

std::wstring m_caption [private]

Definition at line 42 of file SampleOverlay.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 32 of file SampleOverlay.h.

bool m_drawOverlay [private]

Definition at line 41 of file SampleOverlay.h.

UINT m_idIncrement [private]

Definition at line 40 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 37 of file SampleOverlay.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 45 of file SampleOverlay.h.

float m_overlayWidth [private]

Definition at line 46 of file SampleOverlay.h.

float m_padding [private]

Definition at line 43 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 35 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 38 of file SampleOverlay.h.

float m_textVerticalOffset [private]

Definition at line 44 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 34 of file SampleOverlay.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/PixelShader/SampleOverlay.h
  • D2DCustomEffects/cpp/PixelShader/SampleOverlay.cpp
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomPixelShader
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnPointerPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::PointerEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< CustomPixelShaderMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 21 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnPointerPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 51 of file App.h.

std::unique_ptr<CustomPixelShaderMain> m_main [private]

Definition at line 52 of file App.h.

bool m_windowClosed [private]

Definition at line 53 of file App.h.

bool m_windowVisible [private]

Definition at line 54 of file App.h.

The documentation for this class was generated from the following file:
  • D2DCustomEffects/cpp/PixelShader/App.h
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSensors
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | OnAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
async void | OnCustomSensorAdded (DeviceWatcher watcher, DeviceInformation customSensorDevice)
async void | OnReadingChanged (object sender, CustomSensorReadingChangedEventArgs e)
void | OnVisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)

Private Attributes

const String | CO2LevelKey = "{74879888-a3cc-45c6-9ea9-058838256433} 1"
CustomSensor | customSensor
uint desiredReportInterval
DeviceAccessInformation | deviceAccessInformation
Guid | GUIDCustomSensorDeviceVendorDefinedTypeID = new Guid("4025a865-638c-43aa-a688-98580961eeae")
MainPage | rootPage = MainPage.Current
DeviceWatcher | watcher

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 47 of file Scenario1_DataEvents.xaml.cs.

        {
            String customSensorSelector = "";

            this.InitializeComponent();

            customSensorSelector = CustomSensor.GetDeviceSelector(GUIDCustomSensorDeviceVendorDefinedTypeID);
            watcher = DeviceInformation.CreateWatcher(customSensorSelector);
            watcher.Added += OnCustomSensorAdded;
            watcher.Start();

            // Register to be notified when the user disables access to the custom sensor through privacy settings.
            deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(GUIDCustomSensorDeviceVendorDefinedTypeID);
            deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(OnAccessChanged);
        }

Member Function Documentation

async void OnAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for AccessChanged events.

Parameters:
sender
e

Definition at line 110 of file Scenario1_DataEvents.xaml.cs.

        {
            var status = e.Status;
            if (status != DeviceAccessStatus.Allowed)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Custom sensor access denied", NotifyType.ErrorMessage);
                    customSensor = null;
                });
            }
        }

async void OnCustomSensorAdded | ( | DeviceWatcher | watcher,
 |  | DeviceInformation | customSensorDevice |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a matching custom sensor device.

Parameters:
watcher | device watcher
customSensorDevice | device information for the custom sensor that was found

Definition at line 68 of file Scenario1_DataEvents.xaml.cs.

        {
            try
            {
                customSensor = await CustomSensor.FromIdAsync(customSensorDevice.Id);
                if (customSensor != null)
                {
                    CustomSensorReading reading = customSensor.GetCurrentReading();
                    if (!reading.Properties.ContainsKey(CO2LevelKey))
                    {
                        rootPage.NotifyUser("The found custom sensor doesn't provide CO2 reading", NotifyType.ErrorMessage);
                        customSensor = null;
                    }
                    else
                    {
                        // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                        // This value will be used later to activate the sensor.
                        // In the case below, we defined a 200ms report interval as being suitable for the purpose of this app.
                        UInt32 minReportInterval = customSensor.MinimumReportInterval;
                        desiredReportInterval = minReportInterval > 200 ? minReportInterval : 200;
                    }

                }
                else
                {
                    rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
                }
            }
            catch(Exception e)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("The user may have denied access to the custom sensor. Error: " + e.Message, NotifyType.ErrorMessage);
                });
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 128 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 142 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(OnVisibilityChanged);

                if (customSensor != null)
                {
                    customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);

                    // Restore the default report interval to release resources while the sensor is not in use
                    customSensor.ReportInterval = 0;
                }
            }

            base.OnNavigatingFrom(e);
        }

async void OnReadingChanged | ( | object | sender,
 |  | CustomSensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 190 of file Scenario1_DataEvents.xaml.cs.

        {
            CustomSensorReading reading = e.Reading;

            string CO2LevelString = String.Format("{0,5:0.00}", reading.Properties[CO2LevelKey]);
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ScenarioOutputCO2Level.Text = CO2LevelString;
            });
        }

void OnVisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 168 of file Scenario1_DataEvents.xaml.cs.

        {
            if (customSensor != null && ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    customSensor.ReadingChanged += new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
                }
            }
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 230 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(OnVisibilityChanged);

            if (customSensor != null)
            {
                customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                customSensor.ReportInterval = 0;
            }

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 206 of file Scenario1_DataEvents.xaml.cs.

        {
            if (customSensor != null)
            {
                // Establish the report interval
                customSensor.ReportInterval = desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(OnVisibilityChanged);
                customSensor.ReadingChanged += new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

const String CO2LevelKey = "{74879888-a3cc-45c6-9ea9-058838256433} 1" [private]

Definition at line 36 of file Scenario1_DataEvents.xaml.cs.

CustomSensor customSensor [private]

Definition at line 42 of file Scenario1_DataEvents.xaml.cs.

uint desiredReportInterval [private]

Definition at line 43 of file Scenario1_DataEvents.xaml.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 45 of file Scenario1_DataEvents.xaml.cs.

Guid GUIDCustomSensorDeviceVendorDefinedTypeID = new Guid("4025a865-638c-43aa-a688-98580961eeae") [private]

Definition at line 29 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 44 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSensors/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSensors
  • Scenario2_Polling
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()
async void | OnCustomSensorAdded (DeviceWatcher watcher, DeviceInformation customSensorDevice)

Private Member Functions

void | GetCO2Level (object sender, RoutedEventArgs e)
async void | OnAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)

Private Attributes

const String | CO2LevelKey = "{74879888-a3cc-45c6-9ea9-058838256433} 1"
CustomSensor | customSensor
DeviceAccessInformation | deviceAccessInformation
Guid | GUIDCustomSensorDeviceVendorDefinedTypeID = new Guid("4025a865-638c-43aa-a688-98580961eeae")
MainPage | rootPage = MainPage.Current
DeviceWatcher | watcher

Detailed Description

Definition at line 23 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 45 of file Scenario2_Polling.xaml.cs.

        {
            String customSensorSelector = "";

            this.InitializeComponent();

            customSensorSelector = CustomSensor.GetDeviceSelector(GUIDCustomSensorDeviceVendorDefinedTypeID);
            watcher = DeviceInformation.CreateWatcher(customSensorSelector);
            watcher.Added += OnCustomSensorAdded;
            watcher.Start();

            // Register to be notified when the user disables access to the custom sensor through privacy settings.
            deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(GUIDCustomSensorDeviceVendorDefinedTypeID);
            deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(OnAccessChanged);
        }

Member Function Documentation

void GetCO2Level | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 117 of file Scenario2_Polling.xaml.cs.

        {
            if (customSensor != null)
            {
                CustomSensorReading reading = customSensor.GetCurrentReading();

                string CO2LevelString = String.Format("{0,5:0.00}", reading.Properties[CO2LevelKey]);
                ScenarioOutputCO2Level.Text = CO2LevelString;
            }
            else
            {
                rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
            }
        }

async void OnAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for AccessChanged events.

Parameters:
sender
e

Definition at line 99 of file Scenario2_Polling.xaml.cs.

        {
            var status = e.Status;
            if (status != DeviceAccessStatus.Allowed)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Custom sensor access denied", NotifyType.ErrorMessage);
                    customSensor = null;
                });
            }
        }

async void OnCustomSensorAdded | ( | DeviceWatcher | watcher,
 |  | DeviceInformation | customSensorDevice |
 | ) |  |  | [inline]

Invoked when the device watcher finds a matching custom sensor device.

Parameters:
watcher | device watcher
customSensorDevice | device information for the custom sensor that was found

Definition at line 66 of file Scenario2_Polling.xaml.cs.

        {
            try
            {
                customSensor = await CustomSensor.FromIdAsync(customSensorDevice.Id);
                if (customSensor != null)
                {
                    CustomSensorReading reading = customSensor.GetCurrentReading();
                    if (!reading.Properties.ContainsKey(CO2LevelKey))
                    {
                        rootPage.NotifyUser("The found custom sensor doesn't provide CO2 reading", NotifyType.ErrorMessage);
                        customSensor = null;
                    }
                }
                else
                {
                    rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
                }
            }
            catch (Exception e)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("The user may have denied access to the custom sensor. Error: " + e.Message, NotifyType.ErrorMessage);
                });
            }
        }

Member Data Documentation

const String CO2LevelKey = "{74879888-a3cc-45c6-9ea9-058838256433} 1" [private]

Definition at line 35 of file Scenario2_Polling.xaml.cs.

CustomSensor customSensor [private]

Definition at line 41 of file Scenario2_Polling.xaml.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 43 of file Scenario2_Polling.xaml.cs.

Guid GUIDCustomSensorDeviceVendorDefinedTypeID = new Guid("4025a865-638c-43aa-a688-98580961eeae") [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario2_Polling.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 42 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSensors/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceConfiguration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • DeviceConfiguration
Public Attributes

DeviceConfiguration Class Reference

List of all members.

Public Attributes

const UInt32 | BaudRate = 115200
const Boolean | BreakSignalState_false = false
const Boolean | BreakSignalState_true = true
const UInt16 | DataBits = 8
const
Windows.Devices.SerialCommunication.SerialHandshake 		Handshake = Windows.Devices.SerialCommunication.SerialHandshake.RequestToSend
const Boolean | IsDataTerminalReady_false = false
const Boolean | IsDataTerminalReady_true = true
const Boolean | IsRequestToSendEnabled_false = false
const Boolean | IsRequestToSendEnabled_true = true
const
Windows.Devices.SerialCommunication.SerialParity 		Parity = Windows.Devices.SerialCommunication.SerialParity.Even
const
Windows.Devices.SerialCommunication.SerialStopBitCount 		StopBits = Windows.Devices.SerialCommunication.SerialStopBitCount.OnePointFive

Detailed Description

Definition at line 28 of file Constants.cs.

Member Data Documentation

const UInt32 BaudRate = 115200

Definition at line 30 of file Constants.cs.

const Boolean BreakSignalState_false = false

Definition at line 40 of file Constants.cs.

const Boolean BreakSignalState_true = true

Definition at line 41 of file Constants.cs.

const UInt16 DataBits = 8

Definition at line 36 of file Constants.cs.

const Windows.Devices.SerialCommunication.SerialHandshake Handshake = Windows.Devices.SerialCommunication.SerialHandshake.RequestToSend

Definition at line 38 of file Constants.cs.

const Boolean IsDataTerminalReady_false = false

Definition at line 43 of file Constants.cs.

const Boolean IsDataTerminalReady_true = true

Definition at line 44 of file Constants.cs.

const Boolean IsRequestToSendEnabled_false = false

Definition at line 46 of file Constants.cs.

const Boolean IsRequestToSendEnabled_true = true

Definition at line 47 of file Constants.cs.

const Windows.Devices.SerialCommunication.SerialParity Parity = Windows.Devices.SerialCommunication.SerialParity.Even

Definition at line 32 of file Constants.cs.

const Windows.Devices.SerialCommunication.SerialStopBitCount StopBits = Windows.Devices.SerialCommunication.SerialStopBitCount.OnePointFive

Definition at line 34 of file Constants.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Constants.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • DeviceListEntry
Public Member Functions | Properties | Private Attributes

DeviceListEntry Class Reference

The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

List of all members.

Public Member Functions

DeviceListEntry (Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)

Properties

DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
String | InstanceId [get]

Private Attributes

DeviceInformation | device
String | deviceSelector

Detailed Description

Each instance of this class provides information about a single device.

This class is used by the UI to display device specific information so that the user can identify which device to use.

Definition at line 29 of file DeviceListEntry.cs.

Constructor & Destructor Documentation

DeviceListEntry | ( | Windows.Devices.Enumeration.DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.

Parameters:
deviceInformation
deviceSelector The AQS used to find this device

Definition at line 63 of file DeviceListEntry.cs.

        {
            device = deviceInformation;
            this.deviceSelector = deviceSelector;
        }

Member Data Documentation

DeviceInformation device [private]

Definition at line 31 of file DeviceListEntry.cs.

String deviceSelector [private]

Definition at line 32 of file DeviceListEntry.cs.

Property Documentation

DeviceInformation DeviceInformation [get]

Definition at line 43 of file DeviceListEntry.cs.

String DeviceSelector [get]

Definition at line 51 of file DeviceListEntry.cs.

String InstanceId [get]

Definition at line 35 of file DeviceListEntry.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/DeviceListEntry.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • DeviceProperties
Public Attributes

DeviceProperties Class Reference

List of all members.

Public Attributes

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Detailed Description

Definition at line 23 of file Constants.cs.

Member Data Documentation

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Definition at line 25 of file Constants.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Constants.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EventHandlerForDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • EventHandlerForDevice
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

EventHandlerForDevice Class Reference

The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

List of all members.

Public Member Functions

void | CloseDevice ()
async Task< Boolean > | OpenDeviceAsync (DeviceInformation deviceInfo, String deviceSelector)

Static Public Member Functions

static void | CreateNewEventHandlerForDevice ()

Properties

static EventHandlerForDevice | Current [get]
SerialDevice | Device [get]
DeviceAccessInformation | DeviceAccessInformation [get]
DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
Boolean | IsDeviceConnected [get]
Boolean | IsEnabledAutoReconnect [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceClose [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceConnected [get, set]

Private Member Functions

EventHandlerForDevice ()
async void | CloseCurrentlyConnectedDevice ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RegisterForAppEvents ()
void | RegisterForDeviceAccessStatusChange ()
void | RegisterForDeviceWatcherEvents ()
void | StartDeviceWatcher ()
void | StopDeviceWatcher ()
void | UnregisterFromAppEvents ()
void | UnregisterFromDeviceAccessStatusChange ()
void | UnregisterFromDeviceWatcherEvents ()

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
SerialDevice | device
TypedEventHandler
< DeviceAccessInformation,
DeviceAccessChangedEventArgs > 		deviceAccessEventHandler
DeviceAccessInformation | deviceAccessInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformation > 		deviceAddedEventHandler
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceCloseCallback
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceConnectedCallback
DeviceInformation | deviceInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformationUpdate > 		deviceRemovedEventHandler
String | deviceSelector
DeviceWatcher | deviceWatcher
Boolean | isEnabledAutoReconnect
MainPage | rootPage = MainPage.Current
Boolean | watcherStarted
Boolean | watcherSuspended

Static Private Attributes

static EventHandlerForDevice | eventHandlerForDevice
static Object | singletonCreationLock = new Object()

Detailed Description

In addition to handling the SerialDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).

This class will also demonstrate how to handle device watcher events.

For simplicity, this class will only allow at most one device to be connected at any given time. In order to make this class support multiple devices, make this class a non-singleton and create multiple instances of this class; each instance should watch one connected device.

Definition at line 42 of file EventHandlerForDevice.cs.

Constructor & Destructor Documentation

EventHandlerForDevice ( void ) [inline, private]

Definition at line 345 of file EventHandlerForDevice.cs.

        {
            watcherStarted = false;
            watcherSuspended = false;
            isEnabledAutoReconnect = true;
        }

Member Function Documentation

async void CloseCurrentlyConnectedDevice ( void ) [inline, private]

This method demonstrates how to close the device properly using the WinRT Serial API.

When the SerialDevice is closing, it will cancel all IO operations that are still pending (not complete). The close will not wait for any IO completion callbacks to be called, so the close call may complete before any of the IO completion callbacks are called. The pending IO operations will still call their respective completion callbacks with either a task cancelled error or the operation completed.

Definition at line 361 of file EventHandlerForDevice.cs.

        {
            if (device != null)
            {
                // Notify callback that we're about to close the device
                if (deviceCloseCallback != null)
                {
                    deviceCloseCallback(this, deviceInformation);
                }

                // This closes the handle to the device
                device.Dispose();

                device = null;

                // Save the deviceInformation.Id in case deviceInformation is set to null when closing the
                // device
                String deviceId = deviceInformation.Id;

                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        MainPage.Current.NotifyUser(deviceId + " is closed", NotifyType.StatusMessage);
                    }));
            }
        }

void CloseDevice ( void ) [inline]

Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device was ever connected.

Definition at line 305 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected)
            {
                CloseCurrentlyConnectedDevice();
            }

            if (deviceWatcher != null)
            {
                if (watcherStarted)
                {
                    StopDeviceWatcher();

                    UnregisterFromDeviceWatcherEvents();
                }

                deviceWatcher = null;
            }

            if (deviceAccessInformation != null)
            {
                UnregisterFromDeviceAccessStatusChange();

                deviceAccessInformation = null;
            }

            if (appSuspendEventHandler != null || appResumeEventHandler != null)
            {
                UnregisterFromAppEvents();
            }

            deviceInformation = null;
            deviceSelector = null;

            deviceConnectedCallback = null;
            deviceCloseCallback = null;

            isEnabledAutoReconnect = true;
        }

static void CreateNewEventHandlerForDevice ( ) [inline, static]

Creates a new instance of EventHandlerForDevice, enables auto reconnect, and uses it as the Current instance.

Definition at line 110 of file EventHandlerForDevice.cs.

        {
            eventHandlerForDevice = new EventHandlerForDevice();
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

When resume into the application, we should reopen a handle to the Serial device again.

This will automatically happen when we start the device watcher again; the device will be re-enumerated and we will attempt to reopen it if IsEnabledAutoReconnect property is enabled.

See OnAppSuspension for why we are starting the device watcher again

Parameters:
sender
arg

Definition at line 523 of file EventHandlerForDevice.cs.

        {
            if (watcherSuspended)
            {
                watcherSuspended = false;
                StartDeviceWatcher();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

If a Serial object has been instantiated (a handle to the device is opened), we must close it before the app goes into suspension because the API automatically closes it for us if we don't.

When resuming, the API will not reopen the device automatically, so we need to explicitly open the device in the app (Scenario1_ConnectDisconnect).

Since we have to reopen the device ourselves when the app resumes, it is good practice to explicitly call the close in the app as well (For every open there is a close).

We must stop the DeviceWatcher because it will continue to raise events even if the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 499 of file EventHandlerForDevice.cs.

        {
            if (watcherStarted)
            {
                watcherSuspended = true;
                StopDeviceWatcher();
            }
            else
            {
                watcherSuspended = false;
            }

            CloseCurrentlyConnectedDevice();
        }

async void OnDeviceAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Close the device if the device access was denied by anyone (system or the user) and reopen it if permissions are allowed again.

Parameters:
sender
eventArgs

Definition at line 572 of file EventHandlerForDevice.cs.

        {
            if ((eventArgs.Status == DeviceAccessStatus.DeniedBySystem)
                || (eventArgs.Status == DeviceAccessStatus.DeniedByUser))
            {
                CloseCurrentlyConnectedDevice();
            }
            else if ((eventArgs.Status == DeviceAccessStatus.Allowed) && (deviceInformation != null) && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Open the device that the user wanted to open if it hasn't been opened yet and auto reconnect is enabled.

Parameters:
sender
deviceInfo

Definition at line 552 of file EventHandlerForDevice.cs.

        {
            if ((deviceInformation != null) && (deviceInfo.Id == deviceInformation.Id) && !IsDeviceConnected && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

Close the device that is opened so that all pending operations are canceled properly.

Parameters:
sender
deviceInformationUpdate

Definition at line 537 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
            {
                // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
                // and stop talking to the disconnected device.
                CloseCurrentlyConnectedDevice();
            }
        }

async Task<Boolean> OpenDeviceAsync | ( | DeviceInformation | deviceInfo,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

This method opens the device using the WinRT Serial API.

After the device is opened, save the device so that it can be used across scenarios.

It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed on the UI thread.

This method is used to reopen the device after the device reconnects to the computer and when the app resumes.

Parameters:
deviceInfo | Device information of the device to be opened
deviceSelector | The AQS used to find this device
Returns:
True if the device was successfully opened, false if the device could not be opened for well known reasons. An exception may be thrown if the device could not be opened for extraordinary reasons.

Definition at line 220 of file EventHandlerForDevice.cs.

        {
            device = await SerialDevice.FromIdAsync(deviceInfo.Id);

            Boolean successfullyOpenedDevice = false;
            NotifyType notificationStatus;
            String notificationMessage = null;

            // Device could have been blocked by user or the device has already been opened by another app.
            if (device != null)
            {
                successfullyOpenedDevice = true;

                deviceInformation = deviceInfo;
                this.deviceSelector = deviceSelector;

                notificationStatus = NotifyType.StatusMessage;
                notificationMessage = "Device " + deviceInformation.Id + " opened";

                // Notify registered callback handle that the device has been opened
                if (deviceConnectedCallback != null)
                {
                    deviceConnectedCallback(this, deviceInformation);
                }

                if (appSuspendEventHandler == null || appResumeEventHandler == null)
                {
                    RegisterForAppEvents();
                }

                // Register for DeviceAccessInformation.AccessChanged event and react to any changes to the
                // user access after the device handle was opened.
                if (deviceAccessEventHandler == null)
                {
                    RegisterForDeviceAccessStatusChange();
                }

                // Create and register device watcher events for the device to be opened unless we're reopening the device
                if (deviceWatcher == null)
                {
                    deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

                    RegisterForDeviceWatcherEvents();
                }

                if (!watcherStarted)
                {
                    // Start the device watcher after we made sure that the device is opened.
                    StartDeviceWatcher();
                }
            }
            else
            {
                successfullyOpenedDevice = false;

                notificationStatus = NotifyType.ErrorMessage;

                var deviceAccessStatus = DeviceAccessInformation.CreateFromId(deviceInfo.Id).CurrentStatus;

                if (deviceAccessStatus == DeviceAccessStatus.DeniedByUser)
                {
                    notificationMessage = "Access to the device was blocked by the user : " + deviceInfo.Id;
                }
                else if (deviceAccessStatus == DeviceAccessStatus.DeniedBySystem)
                {
                    // This status is most likely caused by app permissions (did not declare the device in the app's package.appxmanifest)
                    // This status does not cover the case where the device is already opened by another app.
                    notificationMessage = "Access to the device was blocked by the system : " + deviceInfo.Id;
                }
                else
                {
                    // Most likely the device is opened by another app, but cannot be sure
                    notificationMessage = "Unknown error, possibly opened by another app : " + deviceInfo.Id;
                }
            }

            MainPage.Current.NotifyUser(notificationMessage, notificationStatus);

            return successfullyOpenedDevice;
        }

void RegisterForAppEvents ( void ) [inline, private]

Register for app suspension/resume events.

See the comments for the event handlers for more information on the exact device operation performed.

We will also register for when the app exists so that we may close the device handle.

Definition at line 395 of file EventHandlerForDevice.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void RegisterForDeviceAccessStatusChange ( ) [inline, private]

Listen for any changed in device access permission.

The user can block access to the device while the device is in use. If the user blocks access to the device while the device is opened, the device's handle will be closed automatically by the system; it is still a good idea to close the device explicitly so that resources are cleaned up.

Note that by the time the AccessChanged event is raised, the device handle may already be closed by the system.

Definition at line 447 of file EventHandlerForDevice.cs.

        {
            // Enable the following registration ONLY if the Serial device under test is non-internal.
            //

            //deviceAccessInformation = DeviceAccessInformation.CreateFromId(deviceInformation.Id);
            //deviceAccessEventHandler = new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(this.OnDeviceAccessChanged);
            //deviceAccessInformation.AccessChanged += deviceAccessEventHandler;
        }

void RegisterForDeviceWatcherEvents ( void ) [inline, private]

Register for Added and Removed events.

Note that, when disconnecting the device, the device may be closed by the system before the OnDeviceRemoved callback is invoked.

Definition at line 420 of file EventHandlerForDevice.cs.

        {
            deviceAddedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);

            deviceRemovedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);

            deviceWatcher.Added += deviceAddedEventHandler;

            deviceWatcher.Removed += deviceRemovedEventHandler;
        }

void StartDeviceWatcher ( void ) [inline, private]

Definition at line 464 of file EventHandlerForDevice.cs.

        {
            watcherStarted = true;

            if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Start();
            }
        }

void StopDeviceWatcher ( void ) [inline, private]

Definition at line 475 of file EventHandlerForDevice.cs.

        {
            if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Stop();
            }

            watcherStarted = false;
        }

void UnregisterFromAppEvents ( void ) [inline, private]

Definition at line 406 of file EventHandlerForDevice.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;
            appSuspendEventHandler = null;

            App.Current.Resuming -= appResumeEventHandler;
            appResumeEventHandler = null;
        }

void UnregisterFromDeviceAccessStatusChange ( ) [inline, private]

Definition at line 457 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation.AccessChanged -= deviceAccessEventHandler;

            deviceAccessEventHandler = null;
        }

void UnregisterFromDeviceWatcherEvents ( void ) [inline, private]

Definition at line 431 of file EventHandlerForDevice.cs.

        {
            deviceWatcher.Added -= deviceAddedEventHandler;
            deviceAddedEventHandler = null;

            deviceWatcher.Removed -= deviceRemovedEventHandler;
            deviceRemovedEventHandler = null;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 62 of file EventHandlerForDevice.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 61 of file EventHandlerForDevice.cs.

SerialDevice device [private]

Definition at line 59 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs> deviceAccessEventHandler [private]

Definition at line 69 of file EventHandlerForDevice.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 58 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformation> deviceAddedEventHandler [private]

Definition at line 67 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceCloseCallback [private]

Definition at line 64 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceConnectedCallback [private]

Definition at line 65 of file EventHandlerForDevice.cs.

DeviceInformation deviceInformation [private]

Definition at line 57 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformationUpdate> deviceRemovedEventHandler [private]

Definition at line 68 of file EventHandlerForDevice.cs.

String deviceSelector [private]

Definition at line 54 of file EventHandlerForDevice.cs.

DeviceWatcher deviceWatcher [private]

Definition at line 55 of file EventHandlerForDevice.cs.

EventHandlerForDevice eventHandlerForDevice [static, private]

Allows for singleton EventHandlerForDevice.

Definition at line 47 of file EventHandlerForDevice.cs.

Boolean isEnabledAutoReconnect [private]

Definition at line 73 of file EventHandlerForDevice.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 77 of file EventHandlerForDevice.cs.

Object singletonCreationLock = new Object() [static, private]

Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.

Definition at line 52 of file EventHandlerForDevice.cs.

Boolean watcherStarted [private]

Definition at line 72 of file EventHandlerForDevice.cs.

Boolean watcherSuspended [private]

Definition at line 71 of file EventHandlerForDevice.cs.

Property Documentation

EventHandlerForDevice Current [static, get]

Enforces the singleton pattern so that there is only one object handling app events as it relates to the SerialDevice because this sample app only supports communicating with one device at a time.

An instance of EventHandlerForDevice is globally available because the device needs to persist across scenario pages.

If there is no instance of EventHandlerForDevice created before this property is called, an EventHandlerForDevice will be created.

Definition at line 89 of file EventHandlerForDevice.cs.

SerialDevice Device [get]

Definition at line 150 of file EventHandlerForDevice.cs.

DeviceAccessInformation DeviceAccessInformation [get]

Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice object.

Definition at line 174 of file EventHandlerForDevice.cs.

DeviceInformation DeviceInformation [get]

This DeviceInformation represents which device is connected or which device will be reconnected when the device is plugged in again (if IsEnabledAutoReconnect is true);.

Definition at line 162 of file EventHandlerForDevice.cs.

String DeviceSelector [get]

DeviceSelector AQS used to find this device.

Definition at line 185 of file EventHandlerForDevice.cs.

Boolean IsDeviceConnected [get]

Definition at line 142 of file EventHandlerForDevice.cs.

Boolean IsEnabledAutoReconnect [get, set]

True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again.

Definition at line 196 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceClose [get, set]

Definition at line 116 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceConnected [get, set]

Definition at line 129 of file EventHandlerForDevice.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/EventHandlerForDevice.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConnectDisconnect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • Scenario1_ConnectDisconnect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ConnectDisconnect Class Reference

Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...

List of all members.

Public Member Functions

Scenario1_ConnectDisconnect ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | AddDeviceToList (DeviceInformation deviceInformation, String deviceSelector)
void | AddDeviceWatcher (DeviceWatcher deviceWatcher, String deviceSelector)
void | ClearDeviceEntries ()
async void | ConnectToDevice_Click (Object sender, RoutedEventArgs eventArgs)
void | DisconnectFromDevice_Click (Object sender, RoutedEventArgs eventArgs)
DeviceListEntry | FindDevice (String deviceId)
void | InitializeDeviceWatchers ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInformation)
async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
void | OnDeviceConnected (EventHandlerForDevice sender, DeviceInformation deviceInformation)
async void | OnDeviceEnumerationComplete (DeviceWatcher sender, Object args)
async void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RemoveDeviceFromList (String deviceId)
void | SelectDeviceInList (String deviceIdToSelect)
void | StartDeviceWatchers ()
void | StartHandlingAppEvents ()
void | StopDeviceWatchers ()
void | StopHandlingAppEvents ()
void | UpdateConnectDisconnectButtonsAndList (Boolean enableConnectButton)

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
const String | ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed"
const String | ButtonNameDisconnectFromDevice = "Disconnect from device"
Boolean | isAllDevicesEnumerated
ObservableCollection
< DeviceListEntry > 		listOfDevices
Dictionary< DeviceWatcher, String > | mapDeviceWatchersToDeviceSelector
MainPage | rootPage = MainPage.Current
Boolean | watchersStarted
Boolean | watchersSuspended

Detailed Description

To use this sample with your device: 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation. 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.

Definition at line 42 of file Scenario1_ConnectDisconnect.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ConnectDisconnect ( ) [inline]

Definition at line 62 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            this.InitializeComponent();

            listOfDevices = new ObservableCollection<DeviceListEntry>();

            mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
            watchersStarted = false;
            watchersSuspended = false;

            isAllDevicesEnumerated = false;
        }

Member Function Documentation

void AddDeviceToList | ( | DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Creates a DeviceListEntry for a device and adds it to the list of devices in the UI.

Parameters:
deviceInformation | DeviceInformation on the device to be added to the list
deviceSelector | The AQS used to find this device

Definition at line 289 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // search the device list for a device with a matching interface ID
            var match = FindDevice(deviceInformation.Id);

            // Add the device if it's new
            if (match == null)
            {
                // Create a new element for this device interface, and queue up the query of its
                // device information
                match = new DeviceListEntry(deviceInformation, deviceSelector);

                // Add the new element to the end of the list of devices
                listOfDevices.Add(match);
            }
        }

void AddDeviceWatcher | ( | DeviceWatcher | deviceWatcher,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.

Parameters:
deviceWatcher
deviceSelector The AQS used to create the device watcher

Definition at line 235 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
            deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
            deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);

            mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
        }

void ClearDeviceEntries ( void ) [inline, private]

Definition at line 314 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            listOfDevices.Clear();
        }

async void ConnectToDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    // Create an EventHandlerForDevice to watch for the device we are connecting to
                    EventHandlerForDevice.CreateNewEventHandlerForDevice();

                    // Get notified when the device was successfully connected to or about to be closed
                    EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                    EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

                    // It is important that the FromIdAsync call is made on the UI thread because the consent prompt, when present,
                    // can only be displayed on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
                    Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);

                    // Disable connect button if we connected to the device
                    UpdateConnectDisconnectButtonsAndList(!openSuccess);
                }
            }
        }

void DisconnectFromDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 154 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            // Prevent auto reconnect because we are voluntarily closing it
            // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
            EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    EventHandlerForDevice.Current.CloseDevice();
                }
            }

            UpdateConnectDisconnectButtonsAndList(true);
        }

DeviceListEntry FindDevice ( String deviceId ) [inline, private]

Searches through the existing list of devices for the first DeviceListEntry that has the specified device Id.

Parameters:
deviceId Id of the device that is being searched for
Returns:
DeviceListEntry that has the provided Id; else a nullptr

Definition at line 325 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (deviceId != null)
            {
                foreach (DeviceListEntry entry in listOfDevices)
                {
                    if (entry.DeviceInformation.Id == deviceId)
                    {
                        return entry;
                    }
                }
            }

            return null;
        }

void InitializeDeviceWatchers ( void ) [inline, private]

Initialize device watchers to watch for the Serial Devices.

GetDeviceSelector return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or DeviceInformation.createFromIdAsync().

In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.

Definition at line 184 of file Scenario1_ConnectDisconnect.xaml.cs.

        {

            // Target all Serial Devices present on the system
            var deviceSelector = SerialDevice.GetDeviceSelector();

            // Other variations of GetDeviceSelector() usage are commented for reference
            //
            // Target a specific USB Serial Device using its VID and PID (here Arduino VID/PID is used)
            // var deviceSelector = SerialDevice.GetDeviceSelectorFromUsbVidPid(0x2341, 0x0043);
            //
            // Target a specific Serial Device by its COM PORT Name - "COM3"
            // var deviceSelector = SerialDevice.GetDeviceSelector("COM3");
            //
            // Target a specific UART based Serial Device by its COM PORT Name (usually defined in ACPI) - "UART1"
            // var deviceSelector = SerialDevice.GetDeviceSelector("UART1");
            //

            // Create a device watcher to look for instances of the Serial Device that match the device selector
            // used earlier.

            var deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

            // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
            AddDeviceWatcher(deviceWatcher, deviceSelector);
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

See OnAppSuspension for why we are starting the device watchers again.

Parameters:
sender
args

Definition at line 365 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersSuspended)
            {
                watchersSuspended = false;
                StartDeviceWatchers();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

We must stop the DeviceWatchers because device watchers will continue to raise events even if the app is in suspension, which is not desired (drains battery).

We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 347 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersStarted)
            {
                watchersSuspended = true;
                StopDeviceWatchers();
            }
            else
            {
                watchersSuspended = false;
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

This function will add the device to the listOfDevices so that it shows up in the UI.

Parameters:
sender
deviceInformation

Definition at line 396 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device added - " + deviceInformation.Id, NotifyType.StatusMessage);

                    AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
                }));
        }

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

The device was closed.

If we will autoreconnect to the device, reflect that in the UI

Parameters:
sender
deviceInformation

Definition at line 489 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    // We were connected to the device that was unplugged, so change the "Disconnect from device" button
                    // to "Do not reconnect to device"
                    if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
                    {
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
                    }
                }));
        }

void OnDeviceConnected | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

If all the devices have been enumerated, select the device in the list we connected to.

Otherwise let the EnumerationComplete event from the device watcher handle the device selection

Parameters:
sender
deviceInformation

Definition at line 461 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Find and select our connected device
            if (isAllDevicesEnumerated)
            {
                SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
            }

            if (EventHandlerForDevice.Current.Device.PortName != "")
            {
                rootPage.NotifyUser("Connected to - " +
                                    EventHandlerForDevice.Current.Device.PortName +
                                    " - " +
                                    EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
            } else
            {
                rootPage.NotifyUser("Connected to - " +
                                    EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
            }
        }

async void OnDeviceEnumerationComplete | ( | DeviceWatcher | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Notify the UI whether or not we are connected to a device.

Parameters:
sender
args

Definition at line 413 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    isAllDevicesEnumerated = true;

                    // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
                    // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
                    if (EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                        ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

                        if (EventHandlerForDevice.Current.Device.PortName != "")
                        {
                            rootPage.NotifyUser("Connected to - " +
                                                EventHandlerForDevice.Current.Device.PortName +
                                                " - " +
                                                EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                        } else
                        {
                            rootPage.NotifyUser("Connected to - " +
                                                EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                        }
                    }
                    else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
                    {
                        // We will be reconnecting to a device
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;

                        rootPage.NotifyUser("Waiting to reconnect to device -  " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("No device is currently connected", NotifyType.StatusMessage);
                    }
                }));
        }

async void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

We will remove the device from the UI.

Parameters:
sender
deviceInformationUpdate

Definition at line 379 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device removed - " + deviceInformationUpdate.Id, NotifyType.StatusMessage);

                    RemoveDeviceFromList(deviceInformationUpdate.Id);
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Unregister from App events and DeviceWatcher events because this page will be unloaded.

Parameters:
eventArgs

Definition at line 115 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            StopDeviceWatchers();
            StopHandlingAppEvents();

            // We no longer care about the device being connected
            EventHandlerForDevice.Current.OnDeviceConnected = null;
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 82 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // If we are connected to the device or planning to reconnect, we should disable the list of devices
            // to prevent the user from opening a device without explicitly closing or disabling the auto reconnect
            if (EventHandlerForDevice.Current.IsDeviceConnected
                || (EventHandlerForDevice.Current.IsEnabledAutoReconnect
                && EventHandlerForDevice.Current.DeviceInformation != null))
            {
                UpdateConnectDisconnectButtonsAndList(false);

                // These notifications will occur if we are waiting to reconnect to device when we start the page
                EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
            }
            else
            {
                UpdateConnectDisconnectButtonsAndList(true);
            }

            // Begin watching out for events
            StartHandlingAppEvents();

            // Initialize the desired device watchers so that we can watch for when devices are connected/removed
            InitializeDeviceWatchers();
            StartDeviceWatchers();

            DeviceListSource.Source = listOfDevices;
        }

void RemoveDeviceFromList ( String deviceId ) [inline, private]

Definition at line 306 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Removes the device entry from the interal list; therefore the UI
            var deviceEntry = FindDevice(deviceId);

            listOfDevices.Remove(deviceEntry);
        }

void SelectDeviceInList ( String deviceIdToSelect ) [inline, private]

Selects the item in the UI's listbox that corresponds to the provided device id.

If there are no matches, we will deselect anything that is selected.

Parameters:
deviceIdToSelect The device id of the device to select on the list box

Definition at line 509 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Don't select anything by default.
            ConnectDevices.SelectedIndex = -1;

            for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
            {
                if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
                {
                    ConnectDevices.SelectedIndex = deviceListIndex;

                    break;
                }
            }
        }

void StartDeviceWatchers ( void ) [inline, private]

Starts all device watchers including ones that have been individually stopped.

Definition at line 247 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Start all device watchers
            watchersStarted = true;
            isAllDevicesEnumerated = false;

            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                    && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Start();
                }
            }
        }

void StartHandlingAppEvents ( void ) [inline, private]

Definition at line 211 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void StopDeviceWatchers ( void ) [inline, private]

Stops all device watchers.

Definition at line 266 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Stop all device watchers
            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                    || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Stop();
                }
            }

            // Clear the list of devices so we don't have potentially disconnected devices around
            ClearDeviceEntries();

            watchersStarted = false;
        }

void StopHandlingAppEvents ( void ) [inline, private]

Definition at line 222 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;

            App.Current.Resuming -= appResumeEventHandler;
        }

void UpdateConnectDisconnectButtonsAndList ( Boolean enableConnectButton ) [inline, private]

When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.

Parameters:
enableConnectButton The state of ButtonConnectToDevice

Definition at line 529 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            ButtonConnectToDevice.IsEnabled = enableConnectButton;
            ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;

            ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 51 of file Scenario1_ConnectDisconnect.xaml.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 50 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed" [private]

Definition at line 45 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisconnectFromDevice = "Disconnect from device" [private]

Definition at line 44 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean isAllDevicesEnumerated [private]

Definition at line 60 of file Scenario1_ConnectDisconnect.xaml.cs.

ObservableCollection<DeviceListEntry> listOfDevices [private]

Definition at line 53 of file Scenario1_ConnectDisconnect.xaml.cs.

Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector [private]

Definition at line 55 of file Scenario1_ConnectDisconnect.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 48 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersStarted [private]

Definition at line 57 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersSuspended [private]

Definition at line 56 of file Scenario1_ConnectDisconnect.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ConfigureDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • Scenario2_ConfigureDevice
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ConfigureDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_ConfigureDevice ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | BaudRateSetButton_Click (object sender, RoutedEventArgs e)
void | BreakStateSignalToggleSwitch_Toggled (object sender, RoutedEventArgs e)
void | DataBitsComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | DataTerminalReadyEnabledToggleSwitch_Toggled (object sender, RoutedEventArgs e)
void | HandShakeComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ParityComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | RequestToSendEnabledToggleSwitch_Toggled (object sender, RoutedEventArgs e)
void | StopBitCountComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | UpdateBaudRateView ()
void | UpdateBreakStateSignalView ()
void | UpdateCarrierDetectStateView ()
void | UpdateDataBitsView ()
void | UpdateDataSetReadyStateView ()
void | UpdateDataTerminalReadyEnabledView ()
void | UpdateHandShakeView ()
void | UpdateParityView ()
void | UpdateRequestToSendEnabledView ()
void | UpdateStopBitCountView ()

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario2_ConfigureDevice.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ConfigureDevice ( ) [inline]

Definition at line 33 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BaudRateSetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            uint BaudRateInput = uint.Parse(BaudRateInputValue.Text);
            if (BaudRateInput != 0)
            {
                EventHandlerForDevice.Current.Device.BaudRate = BaudRateInput;
            }
            UpdateBaudRateView();
        }

void BreakStateSignalToggleSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 187 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            EventHandlerForDevice.Current.Device.BreakSignalState = BreakStateSignalToggleSwitch.IsOn;
            UpdateBreakStateSignalView();
        }

void DataBitsComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 267 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            EventHandlerForDevice.Current.Device.DataBits = ushort.Parse(DataBitsComboBox.SelectedValue.ToString());
            UpdateDataBitsView();
        }

void DataTerminalReadyEnabledToggleSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 207 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            EventHandlerForDevice.Current.Device.IsDataTerminalReadyEnabled = DataTerminalReadyEnabledToggleSwitch.IsOn;
            UpdateDataTerminalReadyEnabledView();
        }

void HandShakeComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            if (HandShakeComboBox.SelectedItem.Equals("None"))
            {
                EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.None;
            }
            else if (HandShakeComboBox.SelectedItem.Equals("RequestToSend"))
            {
                EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.RequestToSend;
            }
            else if (HandShakeComboBox.SelectedItem.Equals("XOnXOff"))
            {
                EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.XOnXOff;
            }
            else if (HandShakeComboBox.SelectedItem.Equals("RequestToSendXOnXOff"))
            {
                EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.RequestToSendXOnXOff;
            }
            UpdateHandShakeView();
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario2_ConfigureDevice.xaml.cs.

        {

            if (EventHandlerForDevice.Current.Device == null)
            {
                ConfigureDeviceScrollViewer.Visibility = Visibility.Collapsed;
                MainPage.Current.NotifyUser("Device is not connected", NotifyType.ErrorMessage);
            }
            else
            {
                if (EventHandlerForDevice.Current.Device.PortName != "")
                {
                    MainPage.Current.NotifyUser("Connected to " + EventHandlerForDevice.Current.Device.PortName,
                                                NotifyType.StatusMessage);
                }

                UpdateBaudRateView();
                UpdateParityView();
                UpdateHandShakeView();
                UpdateBreakStateSignalView();
                UpdateCarrierDetectStateView();
                UpdateDataBitsView();
                UpdateDataSetReadyStateView();
                UpdateDataTerminalReadyEnabledView();
                UpdateRequestToSendEnabledView();
                UpdateStopBitCountView();
            }
        }

void ParityComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            if (ParityComboBox.SelectedItem.Equals("None"))
            {
                EventHandlerForDevice.Current.Device.Parity = SerialParity.None;
            }
            else if (ParityComboBox.SelectedItem.Equals("Even"))
            {
                EventHandlerForDevice.Current.Device.Parity = SerialParity.Even;
            }
            else if (ParityComboBox.SelectedItem.Equals("Odd"))
            {
                EventHandlerForDevice.Current.Device.Parity = SerialParity.Odd;
            }
            else if (ParityComboBox.SelectedItem.Equals("Mark"))
            {
                EventHandlerForDevice.Current.Device.Parity = SerialParity.Mark;
            }
            else if (ParityComboBox.SelectedItem.Equals("Space"))
            {
                EventHandlerForDevice.Current.Device.Parity = SerialParity.Space;
            }
            UpdateParityView();
        }

void RequestToSendEnabledToggleSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 227 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            EventHandlerForDevice.Current.Device.IsRequestToSendEnabled = RequestToSendEnabledToggleSwitch.IsOn;
            UpdateRequestToSendEnabledView();
        }

void StopBitCountComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            if (StopBitCountComboBox.SelectedItem.Equals("One"))
            {
                EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.One;
            }
            else if (StopBitCountComboBox.SelectedItem.Equals("OnePointFive"))
            {
                EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.OnePointFive;
            }
            else if (StopBitCountComboBox.SelectedItem.Equals("Two"))
            {
                EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.Two;
            }
            UpdateStopBitCountView();
        }

void UpdateBaudRateView ( ) [inline, private]

Definition at line 74 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            BaudRateValue.Text = EventHandlerForDevice.Current.Device.BaudRate.ToString();
        }

void UpdateBreakStateSignalView ( ) [inline, private]

Definition at line 173 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            bool currentState = EventHandlerForDevice.Current.Device.BreakSignalState;
            if (currentState)
            {
                BreakStateSignalValue.Text = " On";
            }
            else
            {
                BreakStateSignalValue.Text = " Off";
            }
            BreakStateSignalToggleSwitch.IsOn = currentState;
        }

void UpdateCarrierDetectStateView ( ) [inline, private]

Definition at line 233 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            if (EventHandlerForDevice.Current.Device.CarrierDetectState)
            {
                CarrierDetectStateValue.Text = "On";
            }
            else
            {
                CarrierDetectStateValue.Text = "Off";
            }
        }

void UpdateDataBitsView ( ) [inline, private]

Definition at line 257 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            ushort dataBits = EventHandlerForDevice.Current.Device.DataBits;
            DataBitsValue.Text = dataBits.ToString();
            if (dataBits <= 8)
            {
                DataBitsComboBox.SelectedIndex = dataBits;
            }
        }

void UpdateDataSetReadyStateView ( ) [inline, private]

Definition at line 245 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            if (EventHandlerForDevice.Current.Device.DataSetReadyState)
            {
                DataSetReadyStateValue.Text = "On";
            }
            else
            {
                DataSetReadyStateValue.Text = "Off";
            }
        }

void UpdateDataTerminalReadyEnabledView ( ) [inline, private]

Definition at line 193 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            bool currentState = EventHandlerForDevice.Current.Device.IsDataTerminalReadyEnabled;
            if (currentState)
            {
                DataTerminalReadyEnabledValue.Text = "On";
            }
            else
            {
                DataTerminalReadyEnabledValue.Text = "Off";
            }
            DataTerminalReadyEnabledToggleSwitch.IsOn = currentState;
        }

void UpdateHandShakeView ( ) [inline, private]

Definition at line 146 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            HandShakeValue.Text = EventHandlerForDevice.Current.Device.Handshake.ToString();
            HandShakeComboBox.SelectedIndex = HandShakeComboBox.Items.IndexOf(HandShakeValue.Text);
        }

void UpdateParityView ( ) [inline, private]

Definition at line 89 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            ParityValue.Text = EventHandlerForDevice.Current.Device.Parity.ToString();
            ParityComboBox.SelectedIndex = ParityComboBox.Items.IndexOf(ParityValue.Text);
        }

void UpdateRequestToSendEnabledView ( ) [inline, private]

Definition at line 213 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            bool currentState = EventHandlerForDevice.Current.Device.IsRequestToSendEnabled;
            if (currentState)
            {
                RequestToSendEnabledValue.Text = "On";
            }
            else
            {
                RequestToSendEnabledValue.Text = "Off";
            }
            RequestToSendEnabledToggleSwitch.IsOn = currentState;
        }

void UpdateStopBitCountView ( ) [inline, private]

Definition at line 120 of file Scenario2_ConfigureDevice.xaml.cs.

        {
            StopBitCountValue.Text = EventHandlerForDevice.Current.Device.StopBits.ToString();
            if (StopBitCountValue.Text.Equals("None") == false)
            {
                StopBitCountComboBox.SelectedIndex = StopBitCountComboBox.Items.IndexOf(StopBitCountValue.Text);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario2_ConfigureDevice.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Scenario2_ConfigureDevice.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ReadWrite Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • Scenario3_ReadWrite
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ReadWrite Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_ReadWrite ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | CancelAllIoTasks ()
void | CancelReadTask ()
void | CancelWriteTask ()
Boolean | IsPerformingRead ()
Boolean | IsPerformingWrite ()
async void | NotifyReadCancelingTask ()
async void | NotifyReadTaskCanceled ()
async void | NotifyWriteCancelingTask ()
async void | NotifyWriteTaskCanceled ()
async Task | ReadAsync (CancellationToken cancellationToken)
async void | ReadButton_Click (object sender, RoutedEventArgs e)
void | ReadCancelButton_Click (object sender, RoutedEventArgs e)
void | ReadTimeoutButton_Click (object sender, RoutedEventArgs e)
void | ResetReadCancellationTokenSource ()
void | ResetWriteCancellationTokenSource ()
void | UpdateReadButtonStates ()
void | UpdateReadBytesCounterView ()
void | UpdateReadTimeoutView ()
void | UpdateWriteButtonStates ()
void | UpdateWriteBytesCounterView ()
void | UpdateWriteTimeoutView ()
async Task | WriteAsync (CancellationToken cancellationToken)
async void | WriteButton_Click (object sender, RoutedEventArgs e)
void | WriteBytesInputValue_GotFocus (object sender, RoutedEventArgs e)
void | WriteBytesInputValue_TextChanged (object sender, TextChangedEventArgs e)
void | WriteCancelButton_Click (object sender, RoutedEventArgs e)
void | WriteTimeoutButton_Click (object sender, RoutedEventArgs e)

Private Attributes

DataReader | DataReaderObject = null
DataWriter | DataWriteObject = null
Boolean | IsNavigatedAway
Boolean | IsReadTaskPending
Boolean | IsWriteTaskPending
uint | ReadBytesCounter = 0
CancellationTokenSource | ReadCancellationTokenSource
Object | ReadCancelLock = new Object()
MainPage | rootPage = MainPage.Current
bool | WriteBytesAvailable = false
uint | WriteBytesCounter = 0
CancellationTokenSource | WriteCancellationTokenSource
Object | WriteCancelLock = new Object()

Detailed Description

Definition at line 37 of file Scenario3_ReadWrite.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ReadWrite ( ) [inline]

Definition at line 64 of file Scenario3_ReadWrite.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CancelAllIoTasks ( ) [inline, private]

Definition at line 400 of file Scenario3_ReadWrite.xaml.cs.

        {
            CancelReadTask();
            CancelWriteTask();
        }

void CancelReadTask ( ) [inline, private]

It is important to be able to cancel tasks that may take a while to complete.

Cancelling tasks is the only way to stop any pending IO operations asynchronously. If the Serial Device is closed/deleted while there are pending IOs, the destructor will cancel all pending IO operations.

Definition at line 367 of file Scenario3_ReadWrite.xaml.cs.

        {
            lock (ReadCancelLock)
            {
                if (ReadCancellationTokenSource != null)
                {
                    if (!ReadCancellationTokenSource.IsCancellationRequested)
                    {
                        ReadCancellationTokenSource.Cancel();

                        // Existing IO already has a local copy of the old cancellation token so this reset won't affect it
                        ResetReadCancellationTokenSource();
                    }
                }
            }
        }

void CancelWriteTask ( ) [inline, private]

Definition at line 384 of file Scenario3_ReadWrite.xaml.cs.

        {
            lock (WriteCancelLock)
            {
                if (WriteCancellationTokenSource != null)
                {
                    if (!WriteCancellationTokenSource.IsCancellationRequested)
                    {
                        WriteCancellationTokenSource.Cancel();

                        // Existing IO already has a local copy of the old cancellation token so this reset won't affect it
                        ResetWriteCancellationTokenSource();
                    }
                }
            }
        }

void Dispose ( ) [inline]

Definition at line 69 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (ReadCancellationTokenSource != null)
            {
                ReadCancellationTokenSource.Dispose();
                ReadCancellationTokenSource = null;
            }

            if (WriteCancellationTokenSource != null)
            {
                WriteCancellationTokenSource.Dispose();
                WriteCancellationTokenSource = null;
            }
        }

Boolean IsPerformingRead ( ) [inline, private]

Determines if we are reading, writing, or reading and writing.

Returns:
If we are doing any of the above operations, we return true; false otherwise

Definition at line 410 of file Scenario3_ReadWrite.xaml.cs.

        {
            return (IsReadTaskPending);
        }

Boolean IsPerformingWrite ( ) [inline, private]

Definition at line 415 of file Scenario3_ReadWrite.xaml.cs.

        {
            return (IsWriteTaskPending);
        }

async void NotifyReadCancelingTask ( ) [inline, private]

Print a status message saying we are canceling a task and disable all buttons to prevent multiple cancel requests.

Definition at line 441 of file Scenario3_ReadWrite.xaml.cs.

        {
            // Setting the dispatcher priority to high allows the UI to handle disabling of all the buttons
            // before any of the IO completion callbacks get a chance to modify the UI; that way this method
            // will never get the opportunity to overwrite UI changes made by IO callbacks
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                new DispatchedHandler(() =>
                {
                    ReadButton.IsEnabled = false;
                    ReadCancelButton.IsEnabled = false;

                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Canceling Read... Please wait...", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyReadTaskCanceled ( ) [inline, private]

Notifies the UI that the operation has been cancelled.

Definition at line 480 of file Scenario3_ReadWrite.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Read request has been cancelled", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyWriteCancelingTask ( ) [inline, private]

Definition at line 459 of file Scenario3_ReadWrite.xaml.cs.

        {
            // Setting the dispatcher priority to high allows the UI to handle disabling of all the buttons
            // before any of the IO completion callbacks get a chance to modify the UI; that way this method
            // will never get the opportunity to overwrite UI changes made by IO callbacks
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                new DispatchedHandler(() =>
                {
                    WriteButton.IsEnabled = false;
                    WriteCancelButton.IsEnabled = false;

                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Canceling Write... Please wait...", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyWriteTaskCanceled ( ) [inline, private]

Definition at line 492 of file Scenario3_ReadWrite.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Write request has been cancelled", NotifyType.StatusMessage);
                    }
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Cancel any on going tasks when navigating away from the page so the device is in a consistent state throughout all the scenarios.

Parameters:
eventArgs

Definition at line 130 of file Scenario3_ReadWrite.xaml.cs.

        {
            IsNavigatedAway = true;

            CancelAllIoTasks();
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 91 of file Scenario3_ReadWrite.xaml.cs.

        {

            IsNavigatedAway = false;
            if (EventHandlerForDevice.Current.Device == null)
            {
                ReadWriteScollViewer.Visibility = Visibility.Collapsed;
                MainPage.Current.NotifyUser("Device is not connected", NotifyType.ErrorMessage);
            }
            else
            {
                if (EventHandlerForDevice.Current.Device.PortName != "")
                {
                    MainPage.Current.NotifyUser("Connected to " + EventHandlerForDevice.Current.Device.PortName,
                                                NotifyType.StatusMessage);
                }

                // So we can reset future tasks

                ResetReadCancellationTokenSource();
                ResetWriteCancellationTokenSource();

                UpdateReadButtonStates();
                UpdateWriteButtonStates();

                UpdateReadBytesCounterView();
                UpdateReadTimeoutView();

                UpdateWriteBytesCounterView();
                UpdateWriteTimeoutView();

            }
        }

async Task ReadAsync ( CancellationToken cancellationToken ) [inline, private]

Definition at line 292 of file Scenario3_ReadWrite.xaml.cs.

        {

            Task<UInt32> loadAsyncTask;

            uint ReadBufferLength = 1024;

            // Don't start any IO if we canceled the task
            lock (ReadCancelLock)
            {
                cancellationToken.ThrowIfCancellationRequested();

                // Cancellation Token will be used so we can stop the task operation explicitly
                // The completion function should still be called so that we can properly handle a canceled task
                DataReaderObject.InputStreamOptions = InputStreamOptions.Partial;
                loadAsyncTask = DataReaderObject.LoadAsync(ReadBufferLength).AsTask(cancellationToken);
            }

            UInt32 bytesRead = await loadAsyncTask;
            if (bytesRead > 0)
            {
                ReadBytesTextBlock.Text += DataReaderObject.ReadString(bytesRead);
                ReadBytesCounter += bytesRead;
                UpdateReadBytesCounterView();

            }
            rootPage.NotifyUser("Read completed - " + bytesRead.ToString() + " bytes were read", NotifyType.StatusMessage);
        }

async void ReadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Reading...", NotifyType.StatusMessage);

                    // We need to set this to true so that the buttons can be updated to disable the read button. We will not be able to
                    // update the button states until after the read completes.
                    IsReadTaskPending = true;
                    DataReaderObject = new DataReader(EventHandlerForDevice.Current.Device.InputStream);
                    UpdateReadButtonStates();

                    await ReadAsync(ReadCancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*exception*/)
                {
                    NotifyReadTaskCanceled();
                }
                catch (Exception exception)
                {
                    MainPage.Current.NotifyUser(exception.Message.ToString(), NotifyType.ErrorMessage);
                    Debug.WriteLine(exception.Message.ToString());
                }
                finally
                {
                    IsReadTaskPending = false;
                    DataReaderObject.DetachStream();
                    DataReaderObject = null;

                    UpdateReadButtonStates();
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void ReadCancelButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 504 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                CancelReadTask();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void ReadTimeoutButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 157 of file Scenario3_ReadWrite.xaml.cs.

        {
            int ReadTimeoutInput = int.Parse(ReadTimeoutInputValue.Text);
            EventHandlerForDevice.Current.Device.ReadTimeout = new System.TimeSpan(ReadTimeoutInput * 10000);
            UpdateReadTimeoutView();
        }

void ResetReadCancellationTokenSource ( ) [inline, private]

Definition at line 420 of file Scenario3_ReadWrite.xaml.cs.

        {
            // Create a new cancellation token source so that can cancel all the tokens again
            ReadCancellationTokenSource = new CancellationTokenSource();

            // Hook the cancellation callback (called whenever Task.cancel is called)
            ReadCancellationTokenSource.Token.Register(() => NotifyReadCancelingTask());
        }

void ResetWriteCancellationTokenSource ( ) [inline, private]

Definition at line 429 of file Scenario3_ReadWrite.xaml.cs.

        {
            // Create a new cancellation token source so that can cancel all the tokens again
            WriteCancellationTokenSource = new CancellationTokenSource();

            // Hook the cancellation callback (called whenever Task.cancel is called)
            WriteCancellationTokenSource.Token.Register(() => NotifyWriteCancelingTask());
        }

void UpdateReadButtonStates ( ) [inline, private]

Allow for one operation at a time.

Definition at line 254 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (IsPerformingRead())
            {
                ReadButton.IsEnabled = false;
                ReadCancelButton.IsEnabled = true;
                ReadTimeoutButton.IsEnabled = false;
                ReadTimeoutInputValue.IsEnabled = false;
            }
            else
            {
                ReadButton.IsEnabled = true;
                ReadCancelButton.IsEnabled = false;
                ReadTimeoutButton.IsEnabled = true;
                ReadTimeoutInputValue.IsEnabled = true;
            }
        }

void UpdateReadBytesCounterView ( ) [inline, private]

Definition at line 147 of file Scenario3_ReadWrite.xaml.cs.

        {
            ReadBytesCounterValue.Text = " " + ReadBytesCounter.ToString() + " bytes";
        }

void UpdateReadTimeoutView ( ) [inline, private]

Definition at line 152 of file Scenario3_ReadWrite.xaml.cs.

        {
            ReadTimeoutValue.Text = EventHandlerForDevice.Current.Device.ReadTimeout.TotalMilliseconds.ToString();
        }

void UpdateWriteButtonStates ( ) [inline, private]

Definition at line 272 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (IsPerformingWrite())
            {
                WriteButton.IsEnabled = false;
                WriteCancelButton.IsEnabled = true;
                WriteTimeoutButton.IsEnabled = false;
                WriteTimeoutInputValue.IsEnabled = false;
                WriteBytesInputValue.IsEnabled = false;
            }
            else
            {
                WriteButton.IsEnabled = true;
                WriteCancelButton.IsEnabled = false;
                WriteTimeoutButton.IsEnabled = true;
                WriteTimeoutInputValue.IsEnabled = true;
                WriteBytesInputValue.IsEnabled = true;
            }
        }

void UpdateWriteBytesCounterView ( ) [inline, private]

Definition at line 137 of file Scenario3_ReadWrite.xaml.cs.

        {
            WriteBytesCounterValue.Text = " " + WriteBytesCounter.ToString() + " bytes";
        }

void UpdateWriteTimeoutView ( ) [inline, private]

Definition at line 142 of file Scenario3_ReadWrite.xaml.cs.

        {
            WriteTimeoutValue.Text = EventHandlerForDevice.Current.Device.WriteTimeout.TotalMilliseconds.ToString();
        }

async Task WriteAsync ( CancellationToken cancellationToken ) [inline, private]

Definition at line 321 of file Scenario3_ReadWrite.xaml.cs.

        {

            Task<UInt32> storeAsyncTask;

            if ((WriteBytesAvailable) && (WriteBytesInputValue.Text.Length != 0))
            {
                char[] buffer = new char[WriteBytesInputValue.Text.Length];
                WriteBytesInputValue.Text.CopyTo(0, buffer, 0, WriteBytesInputValue.Text.Length);
                String InputString = new string(buffer);
                DataWriteObject.WriteString(InputString);
                WriteBytesInputValue.Text = "";

                // Don't start any IO if we canceled the task
                lock (WriteCancelLock)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    // Cancellation Token will be used so we can stop the task operation explicitly
                    // The completion function should still be called so that we can properly handle a canceled task
                    storeAsyncTask = DataWriteObject.StoreAsync().AsTask(cancellationToken);
                }

                UInt32 bytesWritten = await storeAsyncTask;
                if (bytesWritten > 0)
                {
                    WriteBytesTextBlock.Text += InputString.Substring(0, (int)bytesWritten) + '\n';
                    WriteBytesCounter += bytesWritten;
                    UpdateWriteBytesCounterView();
                }
                rootPage.NotifyUser("Write completed - " + bytesWritten.ToString() + " bytes written", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("No input received to write", NotifyType.StatusMessage);
            }

        }

async void WriteButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 211 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Writing...", NotifyType.StatusMessage);

                    // We need to set this to true so that the buttons can be updated to disable the write button. We will not be able to
                    // update the button states until after the write completes.
                    IsWriteTaskPending = true;
                    DataWriteObject = new DataWriter(EventHandlerForDevice.Current.Device.OutputStream);
                    UpdateWriteButtonStates();

                    await WriteAsync(WriteCancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*exception*/)
                {
                    NotifyWriteTaskCanceled();
                }
                catch (Exception exception)
                {
                    MainPage.Current.NotifyUser(exception.Message.ToString(), NotifyType.ErrorMessage);
                    Debug.WriteLine(exception.Message.ToString());
                }
                finally
                {
                    IsWriteTaskPending = false;
                    DataWriteObject.DetachStream();
                    DataWriteObject = null;

                    UpdateWriteButtonStates();
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void WriteBytesInputValue_GotFocus | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 538 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (WriteBytesAvailable == false)
            {
                WriteBytesInputValue.Text = "";
            }
        }

void WriteBytesInputValue_TextChanged | ( | object | sender,
 |  | TextChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 529 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (WriteBytesAvailable == false)
            {
                WriteBytesInputValue.Text = "";
            }
            WriteBytesAvailable = true;
        }

void WriteCancelButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 517 of file Scenario3_ReadWrite.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                CancelWriteTask();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void WriteTimeoutButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 164 of file Scenario3_ReadWrite.xaml.cs.

        {
            int WriteTimeoutInput = int.Parse(WriteTimeoutInputValue.Text);
            EventHandlerForDevice.Current.Device.WriteTimeout = new System.TimeSpan(WriteTimeoutInput * 10000);
            UpdateWriteTimeoutView();
        }

Member Data Documentation

DataReader DataReaderObject = null [private]

Definition at line 49 of file Scenario3_ReadWrite.xaml.cs.

DataWriter DataWriteObject = null [private]

Definition at line 57 of file Scenario3_ReadWrite.xaml.cs.

Boolean IsNavigatedAway [private]

Definition at line 62 of file Scenario3_ReadWrite.xaml.cs.

Boolean IsReadTaskPending [private]

Definition at line 47 of file Scenario3_ReadWrite.xaml.cs.

Boolean IsWriteTaskPending [private]

Definition at line 55 of file Scenario3_ReadWrite.xaml.cs.

uint ReadBytesCounter = 0 [private]

Definition at line 48 of file Scenario3_ReadWrite.xaml.cs.

CancellationTokenSource ReadCancellationTokenSource [private]

Definition at line 44 of file Scenario3_ReadWrite.xaml.cs.

Object ReadCancelLock = new Object() [private]

Definition at line 45 of file Scenario3_ReadWrite.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 41 of file Scenario3_ReadWrite.xaml.cs.

bool WriteBytesAvailable = false [private]

Definition at line 59 of file Scenario3_ReadWrite.xaml.cs.

uint WriteBytesCounter = 0 [private]

Definition at line 56 of file Scenario3_ReadWrite.xaml.cs.

CancellationTokenSource WriteCancellationTokenSource [private]

Definition at line 52 of file Scenario3_ReadWrite.xaml.cs.

Object WriteCancelLock = new Object() [private]

Definition at line 53 of file Scenario3_ReadWrite.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Scenario3_ReadWrite.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Events Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • Scenario4_Events
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_Events Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_Events ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | ErrorReceivedEvent (SerialDevice sender, ErrorReceivedEventArgs eventArgs)
void | ErrorReceivedToggleSwitch_Toggled (object sender, RoutedEventArgs e)
void | PinChangedEvent (SerialDevice sender, PinChangedEventArgs eventArgs)
void | PinChangedToggleSwitch_Toggled (object sender, RoutedEventArgs e)

Private Attributes

Windows.Foundation.TypedEventHandler
< SerialDevice,
ErrorReceivedEventArgs > 		ErrorReceivedEventHandler
Windows.Foundation.TypedEventHandler
< SerialDevice,
PinChangedEventArgs > 		PinChangedEventHandler
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario4_Events.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Events ( ) [inline]

Definition at line 32 of file Scenario4_Events.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ErrorReceivedEvent | ( | SerialDevice | sender,
 |  | ErrorReceivedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario4_Events.xaml.cs.

        {
            rootPage.NotifyUser("Error Received Event Received", NotifyType.ErrorMessage);
        }

void ErrorReceivedToggleSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario4_Events.xaml.cs.

        {
            if (ErrorReceivedToggleSwitch.IsOn)
            {
                ErrorReceivedEventHandler = new Windows.Foundation.TypedEventHandler<SerialDevice, ErrorReceivedEventArgs>(this.ErrorReceivedEvent);
                rootPage.NotifyUser("Error Received Event registered", NotifyType.StatusMessage);
                EventHandlerForDevice.Current.Device.ErrorReceived += ErrorReceivedEventHandler;
                ErrorReceivedValue.Text = "On";
            }
            else
            {
                rootPage.NotifyUser("Error Received Event unregistered", NotifyType.StatusMessage);
                EventHandlerForDevice.Current.Device.ErrorReceived -= ErrorReceivedEventHandler;
                ErrorReceivedValue.Text = "Off";
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Definition at line 62 of file Scenario4_Events.xaml.cs.

        {
            PinChangedToggleSwitch.IsOn = false;
            ErrorReceivedToggleSwitch.IsOn = false;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario4_Events.xaml.cs.

        {

            if (EventHandlerForDevice.Current.Device == null)
            {
                EventsScrollViewer.Visibility = Visibility.Collapsed;
                MainPage.Current.NotifyUser("Device is not connected", NotifyType.ErrorMessage);
            }
            else
            {
                if (EventHandlerForDevice.Current.Device.PortName != "")
                {
                    MainPage.Current.NotifyUser("Connected to " + EventHandlerForDevice.Current.Device.PortName,
                                                NotifyType.StatusMessage);
                }
            }
        }

void PinChangedEvent | ( | SerialDevice | sender,
 |  | PinChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 71 of file Scenario4_Events.xaml.cs.

        {
            rootPage.NotifyUser("Pin Changed Event Received", NotifyType.StatusMessage);
        }

void PinChangedToggleSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario4_Events.xaml.cs.

        {
            if (PinChangedToggleSwitch.IsOn)
            {
                PinChangedEventHandler = new Windows.Foundation.TypedEventHandler<SerialDevice, PinChangedEventArgs>(this.PinChangedEvent);
                rootPage.NotifyUser("Pin Changed Event registered", NotifyType.StatusMessage);
                EventHandlerForDevice.Current.Device.PinChanged += PinChangedEventHandler;
                PinChangedValue.Text = "On";
            }
            else
            {
                rootPage.NotifyUser("Pin Changed Event unregistered", NotifyType.StatusMessage);
                EventHandlerForDevice.Current.Device.PinChanged += PinChangedEventHandler;
                PinChangedValue.Text = "Off";
            }
        }

Member Data Documentation

Windows.Foundation.TypedEventHandler<SerialDevice, ErrorReceivedEventArgs> ErrorReceivedEventHandler [private]

Definition at line 69 of file Scenario4_Events.xaml.cs.

Windows.Foundation.TypedEventHandler<SerialDevice, PinChangedEventArgs> PinChangedEventHandler [private]

Definition at line 68 of file Scenario4_Events.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario4_Events.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Scenario4_Events.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utilities Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomSerialDeviceAccess
  • Utilities
Static Public Member Functions

Utilities Class Reference

This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages.

List of all members.

Static Public Member Functions

static void NotifyDeviceNotConnected ()

Detailed Description

Definition at line 26 of file Utilities.cs.

Member Function Documentation

static void NotifyDeviceNotConnected ( void ) [inline, static]

Prints an error message stating that device is not connected.

Definition at line 31 of file Utilities.cs.

        {
            MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
        }

The documentation for this class was generated from the following file:
  • CustomSerialDeviceAccess/cs/Utilities.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DescriptorTypeEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • DescriptorTypeEntry
Public Member Functions | Properties | Private Attributes

DescriptorTypeEntry Class Reference

DescriptorTypeEntry is used so that the UI can bind to the list of these entries and display them.

List of all members.

Public Member Functions

DescriptorTypeEntry (String name, Descriptor type)

Properties

Descriptor | DescriptorType [get]
String | EntryName [get]

Private Attributes

Descriptor descriptorType
String | entryName

Detailed Description

Definition at line 28 of file Scenario5_UsbDescriptors.xaml.cs.

Constructor & Destructor Documentation

DescriptorTypeEntry | ( | String | name,
 |  | Descriptor | type |
 | ) |  |  | [inline]

Definition at line 49 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            entryName = name;
            descriptorType = type;
        }

Member Data Documentation

Descriptor descriptorType [private]

Definition at line 31 of file Scenario5_UsbDescriptors.xaml.cs.

String entryName [private]

Definition at line 30 of file Scenario5_UsbDescriptors.xaml.cs.

Property Documentation

Descriptor DescriptorType [get]

Definition at line 42 of file Scenario5_UsbDescriptors.xaml.cs.

String EntryName [get]

Definition at line 34 of file Scenario5_UsbDescriptors.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario5_UsbDescriptors.xaml.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • DeviceListEntry
Public Member Functions | Properties | Private Attributes

DeviceListEntry Class Reference

The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

List of all members.

Public Member Functions

DeviceListEntry (Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)

Properties

DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
String | InstanceId [get]

Private Attributes

DeviceInformation | device
String | deviceSelector

Detailed Description

Each instance of this class provides information about a single device.

This class is used by the UI to display device specific information so that the user can identify which device to use.

Definition at line 29 of file DeviceListEntry.cs.

Constructor & Destructor Documentation

DeviceListEntry | ( | Windows.Devices.Enumeration.DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.

Parameters:
deviceInformation
deviceSelector The AQS used to find this device

Definition at line 63 of file DeviceListEntry.cs.

        {
            device = deviceInformation;
            this.deviceSelector = deviceSelector;
        }

Member Data Documentation

DeviceInformation device [private]

Definition at line 31 of file DeviceListEntry.cs.

String deviceSelector [private]

Definition at line 32 of file DeviceListEntry.cs.

Property Documentation

DeviceInformation DeviceInformation [get]

Definition at line 43 of file DeviceListEntry.cs.

String DeviceSelector [get]

Definition at line 51 of file DeviceListEntry.cs.

String InstanceId [get]

Definition at line 35 of file DeviceListEntry.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/DeviceListEntry.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • DeviceProperties
Public Attributes

DeviceProperties Class Reference

List of all members.

Public Attributes

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Detailed Description

Definition at line 117 of file SampleConfiguration.cs.

Member Data Documentation

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Definition at line 119 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EventHandlerForDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • EventHandlerForDevice
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

EventHandlerForDevice Class Reference

The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

List of all members.

Public Member Functions

void | CloseDevice ()
async Task< Boolean > | OpenDeviceAsync (DeviceInformation deviceInfo, String deviceSelector)

Static Public Member Functions

static void | CreateNewEventHandlerForDevice ()

Properties

static EventHandlerForDevice | Current [get]
UsbDevice | Device [get]
DeviceAccessInformation | DeviceAccessInformation [get]
DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
Boolean | IsDeviceConnected [get]
Boolean | IsEnabledAutoReconnect [get, set]
SuspendingEventHandler | OnAppSuspendCallback [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceClose [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceConnected [get, set]

Private Member Functions

EventHandlerForDevice ()
async void | CloseCurrentlyConnectedDevice ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RegisterForAppEvents ()
void | RegisterForDeviceAccessStatusChange ()
void | RegisterForDeviceWatcherEvents ()
void | StartDeviceWatcher ()
void | StopDeviceWatcher ()
void | UnregisterFromAppEvents ()
void | UnregisterFromDeviceAccessStatusChange ()
void | UnregisterFromDeviceWatcherEvents ()

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendCallback
SuspendingEventHandler | appSuspendEventHandler
UsbDevice | device
TypedEventHandler
< DeviceAccessInformation,
DeviceAccessChangedEventArgs > 		deviceAccessEventHandler
DeviceAccessInformation | deviceAccessInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformation > 		deviceAddedEventHandler
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceCloseCallback
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceConnectedCallback
DeviceInformation | deviceInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformationUpdate > 		deviceRemovedEventHandler
String | deviceSelector
DeviceWatcher | deviceWatcher
Boolean | isEnabledAutoReconnect
MainPage | rootPage = MainPage.Current
Boolean | watcherStarted
Boolean | watcherSuspended

Static Private Attributes

static EventHandlerForDevice | eventHandlerForDevice
static Object | singletonCreationLock = new Object()

Detailed Description

In addition to handling the UsbDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).

This class will also demonstrate how to handle device watcher events.

For simplicity, this class will only allow at most one device to be connected at any given time. In order to make this class support multiple devices, make this class a non-singleton and create multiple instances of this class; each instance should watch one connected device.

Definition at line 42 of file EventHandlerForDevice.cs.

Constructor & Destructor Documentation

EventHandlerForDevice ( void ) [inline, private]

Definition at line 360 of file EventHandlerForDevice.cs.

        {
            watcherStarted = false;
            watcherSuspended = false;
            isEnabledAutoReconnect = true;
        }

Member Function Documentation

async void CloseCurrentlyConnectedDevice ( void ) [inline, private]

This method demonstrates how to close the device properly using the WinRT USB API.

When the UsbDevice is closing, it will cancel all IO operations that are still pending (not complete). The close will not wait for any IO completion callbacks to be called, so the close call may complete before any of the IO completion callbacks are called. The pending IO operations will still call their respective completion callbacks with either a task cancelled error or the operation completed.

Definition at line 376 of file EventHandlerForDevice.cs.

        {
            if (device != null)
            {
                // Notify callback that we're about to close the device
                if (deviceCloseCallback != null)
                {
                    deviceCloseCallback(this, deviceInformation);
                }

                // This closes the handle to the device
                device.Dispose();

                device = null;

                // Save the deviceInformation.Id in case deviceInformation is set to null when closing the
                // device
                String deviceId = deviceInformation.Id;

                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        MainPage.Current.NotifyUser(deviceId + " is closed", NotifyType.StatusMessage);
                    }));
            }
        }

void CloseDevice ( void ) [inline]

Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device was ever connected.

Definition at line 320 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected)
            {
                CloseCurrentlyConnectedDevice();
            }

            if (deviceWatcher != null)
            {
                if (watcherStarted)
                {
                    StopDeviceWatcher();

                    UnregisterFromDeviceWatcherEvents();
                }

                deviceWatcher = null;
            }

            if (deviceAccessInformation != null)
            {
                UnregisterFromDeviceAccessStatusChange();

                deviceAccessInformation = null;
            }

            if (appSuspendEventHandler != null || appResumeEventHandler != null)
            {
                UnregisterFromAppEvents();
            }

            deviceInformation = null;
            deviceSelector = null;

            deviceConnectedCallback = null;
            deviceCloseCallback = null;

            isEnabledAutoReconnect = true;
        }

static void CreateNewEventHandlerForDevice ( ) [inline, static]

Creates a new instance of EventHandlerForDevice, enables auto reconnect, and uses it as the Current instance.

Definition at line 112 of file EventHandlerForDevice.cs.

        {
            eventHandlerForDevice = new EventHandlerForDevice();
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

When resume into the application, we should reopen a handle to the USB device again.

This will automatically happen when we start the device watcher again; the device will be re-enumerated and we will attempt to reopen it if IsEnabledAutoReconnect property is enabled.

See OnAppSuspension for why we are starting the device watcher again

Parameters:
sender
arg

Definition at line 536 of file EventHandlerForDevice.cs.

        {
            if (watcherSuspended)
            {
                watcherSuspended = false;
                StartDeviceWatcher();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

If a UsbDevice object has been instantiated (a handle to the device is opened), we must close it before the app goes into suspension because the API automatically closes it for us if we don't.

When resuming, the API will not reopen the device automatically, so we need to explicitly open the device in the app (Scenario1_ConnectDisconnect_ConnectDisconnect).

Since we have to reopen the device ourselves when the app resumes, it is good practice to explicitly call the close in the app as well (For every open there is a close).

We must stop the DeviceWatcher because it will continue to raise events even if the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 512 of file EventHandlerForDevice.cs.

        {
            if (watcherStarted)
            {
                watcherSuspended = true;
                StopDeviceWatcher();
            }
            else
            {
                watcherSuspended = false;
            }

            CloseCurrentlyConnectedDevice();
        }

async void OnDeviceAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Close the device if the device access was denied by anyone (system or the user) and reopen it if permissions are allowed again.

Parameters:
sender
eventArgs

Definition at line 585 of file EventHandlerForDevice.cs.

        {
            if ((eventArgs.Status == DeviceAccessStatus.DeniedBySystem)
                || (eventArgs.Status == DeviceAccessStatus.DeniedByUser))
            {
                CloseCurrentlyConnectedDevice();
            }
            else if ((eventArgs.Status == DeviceAccessStatus.Allowed) && (deviceInformation != null) && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Open the device that the user wanted to open if it hasn't been opened yet and auto reconnect is enabled.

Parameters:
sender
deviceInfo

Definition at line 565 of file EventHandlerForDevice.cs.

        {
            if ((deviceInformation != null) && (deviceInfo.Id == deviceInformation.Id) && !IsDeviceConnected && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

Close the device that is opened so that all pending operations are canceled properly.

Parameters:
sender
deviceInformationUpdate

Definition at line 550 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
            {
                // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
                // and stop talking to the disconnected device.
                CloseCurrentlyConnectedDevice();
            }
        }

async Task<Boolean> OpenDeviceAsync | ( | DeviceInformation | deviceInfo,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

This method opens the device using the WinRT USB API.

After the device is opened, save the device so that it can be used across scenarios.

It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed on the UI thread.

This method is used to reopen the device after the device reconnects to the computer and when the app resumes.

Parameters:
deviceInfo | Device information of the device to be opened
deviceSelector | The AQS used to find this device
Returns:
True if the device was successfully opened, false if the device could not be opened for well known reasons. An exception may be thrown if the device could not be opened for extraordinary reasons.

Definition at line 235 of file EventHandlerForDevice.cs.

        {
            device = await UsbDevice.FromIdAsync(deviceInfo.Id);

            Boolean successfullyOpenedDevice = false;
            NotifyType notificationStatus;
            String notificationMessage = null;

            // Device could have been blocked by user or the device has already been opened by another app.
            if (device != null)
            {
                successfullyOpenedDevice = true;

                deviceInformation = deviceInfo;
                this.deviceSelector = deviceSelector;

                notificationStatus = NotifyType.StatusMessage;
                notificationMessage = "Device " + deviceInformation.Id + " opened";

                // Notify registered callback handle that the device has been opened
                if (deviceConnectedCallback != null)
                {
                    deviceConnectedCallback(this, deviceInformation);
                }

                if (appSuspendEventHandler == null || appResumeEventHandler == null)
                {
                    RegisterForAppEvents();
                }

                // Register for DeviceAccessInformation.AccessChanged event and react to any changes to the
                // user access after the device handle was opened.
                if (deviceAccessEventHandler == null)
                {
                    RegisterForDeviceAccessStatusChange();
                }

                // Create and register device watcher events for the device to be opened unless we're reopening the device
                if (deviceWatcher == null)
                {
                    deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

                    RegisterForDeviceWatcherEvents();
                }

                if (!watcherStarted)
                {
                    // Start the device watcher after we made sure that the device is opened.
                    StartDeviceWatcher();
                }
            }
            else
            {
                successfullyOpenedDevice = false;

                notificationStatus = NotifyType.ErrorMessage;

                var deviceAccessStatus = DeviceAccessInformation.CreateFromId(deviceInfo.Id).CurrentStatus;

                if (deviceAccessStatus == DeviceAccessStatus.DeniedByUser)
                {
                    notificationMessage = "Access to the device was blocked by the user : " + deviceInfo.Id;
                }
                else if (deviceAccessStatus == DeviceAccessStatus.DeniedBySystem)
                {
                    // This status is most likely caused by app permissions (did not declare the device in the app's package.appxmanifest)
                    // This status does not cover the case where the device is already opened by another app.
                    notificationMessage = "Access to the device was blocked by the system : " + deviceInfo.Id;
                }
                else
                {
                    // Most likely the device is opened by another app, but cannot be sure
                    notificationMessage = "Unknown error, possibly opened by another app : " + deviceInfo.Id;
                }
            }

            MainPage.Current.NotifyUser(notificationMessage, notificationStatus);

            return successfullyOpenedDevice;
        }

void RegisterForAppEvents ( void ) [inline, private]

Register for app suspension/resume events.

See the comments for the event handlers for more information on the exact device operation performed.

We will also register for when the app exists so that we may close the device handle.

Definition at line 410 of file EventHandlerForDevice.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void RegisterForDeviceAccessStatusChange ( ) [inline, private]

Listen for any changed in device access permission.

The user can block access to the device while the device is in use. If the user blocks access to the device while the device is opened, the device's handle will be closed automatically by the system; it is still a good idea to close the device explicitly so that resources are cleaned up.

Note that by the time the AccessChanged event is raised, the device handle may already be closed by the system.

Definition at line 462 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation = DeviceAccessInformation.CreateFromId(deviceInformation.Id);

            deviceAccessEventHandler = new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(this.OnDeviceAccessChanged);
            deviceAccessInformation.AccessChanged += deviceAccessEventHandler;
        }

void RegisterForDeviceWatcherEvents ( void ) [inline, private]

Register for Added and Removed events.

Note that, when disconnecting the device, the device may be closed by the system before the OnDeviceRemoved callback is invoked.

Definition at line 435 of file EventHandlerForDevice.cs.

        {
            deviceAddedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);

            deviceRemovedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);

            deviceWatcher.Added += deviceAddedEventHandler;

            deviceWatcher.Removed += deviceRemovedEventHandler;
        }

void StartDeviceWatcher ( void ) [inline, private]

Definition at line 477 of file EventHandlerForDevice.cs.

        {
            watcherStarted = true;

            if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Start();
            }
        }

void StopDeviceWatcher ( void ) [inline, private]

Definition at line 488 of file EventHandlerForDevice.cs.

        {
            if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Stop();
            }

            watcherStarted = false;
        }

void UnregisterFromAppEvents ( void ) [inline, private]

Definition at line 421 of file EventHandlerForDevice.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;
            appSuspendEventHandler = null;

            App.Current.Resuming -= appResumeEventHandler;
            appResumeEventHandler = null;
        }

void UnregisterFromDeviceAccessStatusChange ( ) [inline, private]

Definition at line 470 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation.AccessChanged -= deviceAccessEventHandler;

            deviceAccessEventHandler = null;
        }

void UnregisterFromDeviceWatcherEvents ( void ) [inline, private]

Definition at line 446 of file EventHandlerForDevice.cs.

        {
            deviceWatcher.Added -= deviceAddedEventHandler;
            deviceAddedEventHandler = null;

            deviceWatcher.Removed -= deviceRemovedEventHandler;
            deviceRemovedEventHandler = null;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 64 of file EventHandlerForDevice.cs.

SuspendingEventHandler appSuspendCallback [private]

Definition at line 61 of file EventHandlerForDevice.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 63 of file EventHandlerForDevice.cs.

UsbDevice device [private]

Definition at line 59 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs> deviceAccessEventHandler [private]

Definition at line 71 of file EventHandlerForDevice.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 58 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformation> deviceAddedEventHandler [private]

Definition at line 69 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceCloseCallback [private]

Definition at line 66 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceConnectedCallback [private]

Definition at line 67 of file EventHandlerForDevice.cs.

DeviceInformation deviceInformation [private]

Definition at line 57 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformationUpdate> deviceRemovedEventHandler [private]

Definition at line 70 of file EventHandlerForDevice.cs.

String deviceSelector [private]

Definition at line 54 of file EventHandlerForDevice.cs.

DeviceWatcher deviceWatcher [private]

Definition at line 55 of file EventHandlerForDevice.cs.

EventHandlerForDevice eventHandlerForDevice [static, private]

Allows for singleton EventHandlerForDevice.

Definition at line 47 of file EventHandlerForDevice.cs.

Boolean isEnabledAutoReconnect [private]

Definition at line 75 of file EventHandlerForDevice.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 79 of file EventHandlerForDevice.cs.

Object singletonCreationLock = new Object() [static, private]

Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.

Definition at line 52 of file EventHandlerForDevice.cs.

Boolean watcherStarted [private]

Definition at line 74 of file EventHandlerForDevice.cs.

Boolean watcherSuspended [private]

Definition at line 73 of file EventHandlerForDevice.cs.

Property Documentation

EventHandlerForDevice Current [static, get]

Enforces the singleton pattern so that there is only one object handling app events as it relates to the UsbDevice because this sample app only supports communicating with one device at a time.

An instance of EventHandlerForDevice is globally available because the device needs to persist across scenario pages.

If there is no instance of EventHandlerForDevice created before this property is called, an EventHandlerForDevice will be created.

Definition at line 91 of file EventHandlerForDevice.cs.

UsbDevice Device [get]

Definition at line 165 of file EventHandlerForDevice.cs.

DeviceAccessInformation DeviceAccessInformation [get]

Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice object.

Definition at line 189 of file EventHandlerForDevice.cs.

DeviceInformation DeviceInformation [get]

This DeviceInformation represents which device is connected or which device will be reconnected when the device is plugged in again (if IsEnabledAutoReconnect is true);.

Definition at line 177 of file EventHandlerForDevice.cs.

String DeviceSelector [get]

DeviceSelector AQS used to find this device.

Definition at line 200 of file EventHandlerForDevice.cs.

Boolean IsDeviceConnected [get]

Definition at line 157 of file EventHandlerForDevice.cs.

Boolean IsEnabledAutoReconnect [get, set]

True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again.

Definition at line 211 of file EventHandlerForDevice.cs.

SuspendingEventHandler OnAppSuspendCallback [get, set]

Definition at line 118 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceClose [get, set]

Definition at line 131 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceConnected [get, set]

Definition at line 144 of file EventHandlerForDevice.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/EventHandlerForDevice.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocalSettingKeys Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • LocalSettingKeys
Public Attributes

LocalSettingKeys Class Reference

List of all members.

Public Attributes

const String | SyncBackgroundTaskResult = "SyncBackgroundTaskResult"
const String | SyncBackgroundTaskStatus = "SyncBackgroundTaskStatus"

Detailed Description

Definition at line 103 of file SampleConfiguration.cs.

Member Data Documentation

const String SyncBackgroundTaskResult = "SyncBackgroundTaskResult"

Definition at line 106 of file SampleConfiguration.cs.

const String SyncBackgroundTaskStatus = "SyncBackgroundTaskStatus"

Definition at line 105 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDeviceConnectedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • OnDeviceConnectedEventArgs
Public Member Functions | Properties | Private Attributes

OnDeviceConnectedEventArgs Class Reference

List of all members.

Public Member Functions

OnDeviceConnectedEventArgs (Boolean isDeviceSuccessfullyConnected, Windows.Devices.Enumeration.DeviceInformation deviceInformation)

Properties

Windows.Devices.Enumeration.DeviceInformation | DeviceInformation [get]
Boolean | IsDeviceSuccessfullyConnected [get]

Private Attributes

Windows.Devices.Enumeration.DeviceInformation | deviceInformation
Boolean | isDeviceSuccessfullyConnected

Detailed Description

Definition at line 75 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

OnDeviceConnectedEventArgs | ( | Boolean | isDeviceSuccessfullyConnected,
 |  | Windows.Devices.Enumeration.DeviceInformation | deviceInformation |
 | ) |  |  | [inline]

Definition at line 80 of file SampleConfiguration.cs.

        {
            this.isDeviceSuccessfullyConnected = isDeviceSuccessfullyConnected;
            this.deviceInformation = deviceInformation;
        }

Member Data Documentation

Windows.Devices.Enumeration.DeviceInformation deviceInformation [private]

Definition at line 78 of file SampleConfiguration.cs.

Boolean isDeviceSuccessfullyConnected [private]

Definition at line 77 of file SampleConfiguration.cs.

Property Documentation

Windows.Devices.Enumeration.DeviceInformation DeviceInformation [get]

Definition at line 95 of file SampleConfiguration.cs.

Boolean IsDeviceSuccessfullyConnected [get]

Definition at line 87 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OsrFx2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • OsrFx2
Classes | Public Attributes | Static Public Attributes

OsrFx2 Class Reference

List of all members.

Classes

class | Pipe
class | VendorCommand

Public Attributes

const UInt16 | DevicePid = 0x1002
const UInt16 | DeviceVid = 0x0547

Static Public Attributes

static Byte[] | SevenLedSegmentMask

Detailed Description

Definition at line 122 of file SampleConfiguration.cs.

Member Data Documentation

const UInt16 DevicePid = 0x1002

Definition at line 156 of file SampleConfiguration.cs.

const UInt16 DeviceVid = 0x0547

Definition at line 155 of file SampleConfiguration.cs.

Byte [] SevenLedSegmentMask [static]
Initial value:
            {
                0xD7,
                0x06,
                0xB3,
                0xA7,
                0x66,
                0xE5,
                0xF4,
                0x07,
                0xF7,
                0x67,
            }

Definition at line 140 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OsrFx2::Pipe Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • OsrFx2
  • OsrFx2::Pipe
Public Attributes

OsrFx2::Pipe Class Reference

List of all members.

Public Attributes

const UInt32 | BulkInPipeIndex = 0
const UInt32 | BulkOutPipeIndex = 0
const UInt32 | InterruptInPipeIndex = 0

Detailed Description

Definition at line 131 of file SampleConfiguration.cs.

Member Data Documentation

const UInt32 BulkInPipeIndex = 0

Definition at line 134 of file SampleConfiguration.cs.

const UInt32 BulkOutPipeIndex = 0

Definition at line 135 of file SampleConfiguration.cs.

const UInt32 InterruptInPipeIndex = 0

Definition at line 133 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConnectDisconnect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario1_ConnectDisconnect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ConnectDisconnect Class Reference

Demonstrates how to connect to a USB Device and respond to device disconnects, app suspending and resuming events. More...

List of all members.

Public Member Functions

Scenario1_ConnectDisconnect ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | AddDeviceToList (DeviceInformation deviceInformation, String deviceSelector)
void | AddDeviceWatcher (DeviceWatcher deviceWatcher, String deviceSelector)
void | ClearDeviceEntries ()
async void | ConnectToDevice_Click (Object sender, RoutedEventArgs eventArgs)
void | DisconnectFromDevice_Click (Object sender, RoutedEventArgs eventArgs)
DeviceListEntry | FindDevice (String deviceId)
void | InitializeDeviceWatchers ()
void | InitializeOsrFx2DeviceWatcher ()
void | InitializeSuperMuttDeviceWatcher ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInformation)
async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
void | OnDeviceConnected (EventHandlerForDevice sender, DeviceInformation deviceInformation)
async void | OnDeviceEnumerationComplete (DeviceWatcher sender, Object args)
async void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RemoveDeviceFromList (String deviceId)
void | SelectDeviceInList (String deviceIdToSelect)
void | StartDeviceWatchers ()
void | StartHandlingAppEvents ()
void | StopDeviceWatchers ()
void | StopHandlingAppEvents ()
void | UpdateConnectDisconnectButtonsAndList (Boolean enableConnectButton)

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
const String | ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed"
const String | ButtonNameDisconnectFromDevice = "Disconnect from device"
Boolean | isAllDevicesEnumerated
ObservableCollection
< DeviceListEntry > 		listOfDevices
Dictionary< DeviceWatcher, String > | mapDeviceWatchersToDeviceSelector
MainPage | rootPage = MainPage.Current
Boolean | watchersStarted
Boolean | watchersSuspended

Detailed Description

To use this sample with your device: 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation. 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.

Definition at line 43 of file Scenario1_ConnectDisconnect.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ConnectDisconnect ( ) [inline]

Definition at line 63 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            this.InitializeComponent();

            listOfDevices = new ObservableCollection<DeviceListEntry>();

            mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
            watchersStarted = false;
            watchersSuspended = false;

            isAllDevicesEnumerated = false;
        }

Member Function Documentation

void AddDeviceToList | ( | DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Creates a DeviceListEntry for a device and adds it to the list of devices in the UI.

Parameters:
deviceInformation | DeviceInformation on the device to be added to the list
deviceSelector | The AQS used to find this device

Definition at line 305 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // search the device list for a device with a matching interface ID
            var match = FindDevice(deviceInformation.Id);

            // Add the device if it's new
            if (match == null)
            {
                // Create a new element for this device interface, and queue up the query of its
                // device information
                match = new DeviceListEntry(deviceInformation, deviceSelector);

                // Add the new element to the end of the list of devices
                listOfDevices.Add(match);
            }
        }

void AddDeviceWatcher | ( | DeviceWatcher | deviceWatcher,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.

Parameters:
deviceWatcher
deviceSelector The AQS used to create the device watcher

Definition at line 251 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
            deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
            deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);

            mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
        }

void ClearDeviceEntries ( void ) [inline, private]

Definition at line 330 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            listOfDevices.Clear();
        }

async void ConnectToDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 126 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    // Create an EventHandlerForDevice to watch for the device we are connecting to
                    EventHandlerForDevice.CreateNewEventHandlerForDevice();

                    // Get notified when the device was successfully connected to or about to be closed
                    EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                    EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

                    // It is important that the FromIdAsync call is made on the UI thread because the consent prompt, when present,
                    // can only be displayed on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
                    Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);

                    // Disable connect button if we connected to the device
                    UpdateConnectDisconnectButtonsAndList(!openSuccess);
                }
            }
        }

void DisconnectFromDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            // Prevent auto reconnect because we are voluntarily closing it
            // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
            EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    EventHandlerForDevice.Current.CloseDevice();
                }
            }

            UpdateConnectDisconnectButtonsAndList(true);
        }

DeviceListEntry FindDevice ( String deviceId ) [inline, private]

Searches through the existing list of devices for the first DeviceListEntry that has the specified device Id.

Parameters:
deviceId Id of the device that is being searched for
Returns:
DeviceListEntry that has the provided Id; else a nullptr

Definition at line 341 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (deviceId != null)
            {
                foreach (DeviceListEntry entry in listOfDevices)
                {
                    if (entry.DeviceInformation.Id == deviceId)
                    {
                        return entry;
                    }
                }
            }

            return null;
        }

void InitializeDeviceWatchers ( void ) [inline, private]

Initialize device watchers to watch for the OSRFX2 and the SuperMUTT.

Several other ways of using a device selector to get the desired devices (the devices are really DeviceInformation objects): 1) Using the interface class guid 2) Using the Vendor Id and the Product Id 3) Using the Device class

GetDeviceClassSelector and GetDeviceSelector both return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or DeviceInformation.createFromIdAsync(). The AQS defines the search parameters so that only our device is queried

In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.

Definition at line 191 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            InitializeOsrFx2DeviceWatcher();
            InitializeSuperMuttDeviceWatcher();
        }

void InitializeOsrFx2DeviceWatcher ( void ) [inline, private]

Please see IntializeDeviceWatchers for more information on using device selectors.

Definition at line 200 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var osrFx2Selector = UsbDevice.GetDeviceSelector(OsrFx2.DeviceVid, OsrFx2.DevicePid);

            // Create a device watcher to look for instances of the OSRFX2 device
            var osrFx2Watcher = DeviceInformation.CreateWatcher(osrFx2Selector);

            // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
            AddDeviceWatcher(osrFx2Watcher, osrFx2Selector);
        }

void InitializeSuperMuttDeviceWatcher ( void ) [inline, private]

Please see IntializeDeviceWatchers for more information on using device selectors.

Definition at line 214 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // SuperMutt's Interface class {875D47FC-D331-4663-B339-624001A2DC5E}
            // This is the most specific type of DeviceSelector.
            var superMuttSelector = UsbDevice.GetDeviceSelector(SuperMutt.DeviceVid, SuperMutt.DevicePid, SuperMutt.DeviceInterfaceClass);

            // Create a device watcher to look for instances of the SuperMUTT device
            var superMuttWatcher = DeviceInformation.CreateWatcher(superMuttSelector);

            // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
            AddDeviceWatcher(superMuttWatcher, superMuttSelector);
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

See OnAppSuspension for why we are starting the device watchers again.

Parameters:
sender
args

Definition at line 381 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersSuspended)
            {
                watchersSuspended = false;
                StartDeviceWatchers();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

We must stop the DeviceWatchers because device watchers will continue to raise events even if the app is in suspension, which is not desired (drains battery).

We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 363 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersStarted)
            {
                watchersSuspended = true;
                StopDeviceWatchers();
            }
            else
            {
                watchersSuspended = false;
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

This function will add the device to the listOfDevices so that it shows up in the UI.

Parameters:
sender
deviceInformation

Definition at line 412 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device added - " + deviceInformation.Id, NotifyType.StatusMessage);

                    AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
                }));
        }

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

The device was closed.

If we will autoreconnect to the device, reflect that in the UI

Parameters:
sender
deviceInformation

Definition at line 487 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    // We were connected to the device that was unplugged, so change the "Disconnect from device" button
                    // to "Do not reconnect to device"
                    if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
                    {
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
                    }
                }));
        }

void OnDeviceConnected | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

If all the devices have been enumerated, select the device in the list we connected to.

Otherwise let the EnumerationComplete event from the device watcher handle the device selection

Parameters:
sender
deviceInformation

Definition at line 468 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Find and select our connected device
            if (isAllDevicesEnumerated)
            {
                SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
            }

            rootPage.NotifyUser("Connected to - " +
                                EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
        }

async void OnDeviceEnumerationComplete | ( | DeviceWatcher | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Notify the UI whether or not we are connected to a device.

Parameters:
sender
args

Definition at line 429 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    isAllDevicesEnumerated = true;

                    // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
                    // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
                    if (EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                        ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

                        rootPage.NotifyUser("Connected to - " +
                                            EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
                    {
                        // We will be reconnecting to a device
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;

                        rootPage.NotifyUser("Waiting to reconnect to device -  " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("No device is currently connected", NotifyType.StatusMessage);
                    }
                }));
        }

async void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

We will remove the device from the UI.

Parameters:
sender
deviceInformationUpdate

Definition at line 395 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device removed - " + deviceInformationUpdate.Id, NotifyType.StatusMessage);

                    RemoveDeviceFromList(deviceInformationUpdate.Id);
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Unregister from App events and DeviceWatcher events because this page will be unloaded.

Parameters:
eventArgs

Definition at line 116 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            StopDeviceWatchers();
            StopHandlingAppEvents();

            // We no longer care about the device being connected
            EventHandlerForDevice.Current.OnDeviceConnected = null;
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 83 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // If we are connected to the device or planning to reconnect, we should disable the list of devices
            // to prevent the user from opening a device without explicitly closing or disabling the auto reconnect
            if (EventHandlerForDevice.Current.IsDeviceConnected
                || (EventHandlerForDevice.Current.IsEnabledAutoReconnect
                && EventHandlerForDevice.Current.DeviceInformation != null))
            {
                UpdateConnectDisconnectButtonsAndList(false);

                // These notifications will occur if we are waiting to reconnect to device when we start the page
                EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
            }
            else
            {
                UpdateConnectDisconnectButtonsAndList(true);
            }

            // Begin watching out for events
            StartHandlingAppEvents();

            // Initialize the desired device watchers so that we can watch for when devices are connected/removed
            InitializeDeviceWatchers();
            StartDeviceWatchers();

            DeviceListSource.Source = listOfDevices;
        }

void RemoveDeviceFromList ( String deviceId ) [inline, private]

Definition at line 322 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Removes the device entry from the interal list; therefore the UI
            var deviceEntry = FindDevice(deviceId);

            listOfDevices.Remove(deviceEntry);
        }

void SelectDeviceInList ( String deviceIdToSelect ) [inline, private]

Selects the item in the UI's listbox that corresponds to the provided device id.

If there are no matches, we will deselect anything that is selected.

Parameters:
deviceIdToSelect The device id of the device to select on the list box

Definition at line 507 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Don't select anything by default.
            ConnectDevices.SelectedIndex = -1;

            for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
            {
                if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
                {
                    ConnectDevices.SelectedIndex = deviceListIndex;

                    break;
                }
            }
        }

void StartDeviceWatchers ( void ) [inline, private]

Starts all device watchers including ones that have been individually stopped.

Definition at line 263 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Start all device watchers
            watchersStarted = true;
            isAllDevicesEnumerated = false;

            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                    && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Start();
                }
            }
        }

void StartHandlingAppEvents ( void ) [inline, private]

Definition at line 227 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void StopDeviceWatchers ( void ) [inline, private]

Stops all device watchers.

Definition at line 282 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Stop all device watchers
            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                    || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Stop();
                }
            }

            // Clear the list of devices so we don't have potentially disconnected devices around
            ClearDeviceEntries();

            watchersStarted = false;
        }

void StopHandlingAppEvents ( void ) [inline, private]

Definition at line 238 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;

            App.Current.Resuming -= appResumeEventHandler;
        }

void UpdateConnectDisconnectButtonsAndList ( Boolean enableConnectButton ) [inline, private]

When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.

Parameters:
enableConnectButton The state of ButtonConnectToDevice

Definition at line 527 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            ButtonConnectToDevice.IsEnabled = enableConnectButton;
            ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;

            ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 52 of file Scenario1_ConnectDisconnect.xaml.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 51 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed" [private]

Definition at line 46 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisconnectFromDevice = "Disconnect from device" [private]

Definition at line 45 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean isAllDevicesEnumerated [private]

Definition at line 61 of file Scenario1_ConnectDisconnect.xaml.cs.

ObservableCollection<DeviceListEntry> listOfDevices [private]

Definition at line 54 of file Scenario1_ConnectDisconnect.xaml.cs.

Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector [private]

Definition at line 56 of file Scenario1_ConnectDisconnect.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 49 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersStarted [private]

Definition at line 58 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersSuspended [private]

Definition at line 57 of file Scenario1_ConnectDisconnect.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ControlTransfer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario2_ControlTransfer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ControlTransfer Class Reference

This page demonstrates how to use control transfers to communicate with the device.

List of all members.

Public Member Functions

Scenario2_ControlTransfer ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

async Task | GetOsrFx2SevenSegmentAsync ()
async void | GetOsrFx2SevenSegmentSetting_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetSuperMuttLedBlinkPattern_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | GetSuperMuttLedBlinkPatternAsync ()
async Task< IBuffer > | SendVendorControlTransferInToDeviceRecipientAsync (Byte vendorCommand, UInt32 dataPacketLength)
async Task | SetOsrFx2SevenSegmentAsync (Byte numericValue)
async void | SetOsrFx2SevenSegmentSetting_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | SetSuperMuttLedBlinkPattern_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | SetSuperMuttLedBlinkPatternAsync (Byte pattern)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario2_ControlTransfer.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ControlTransfer ( ) [inline]

Definition at line 34 of file Scenario2_ControlTransfer.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task GetOsrFx2SevenSegmentAsync ( ) [inline, private]

Gets the current value of the seven segment display on the OSRFX2 device via control transfer.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

When the seven segment hex value is received, we attempt to match it with a known (has a numerical value 0-9) hex value.

Getting Seven Segment LED require setup packet: bmRequestType: type: VENDOR recipient: DEVICE bRequest: 0xD4 wLength: 1

Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 204 of file Scenario2_ControlTransfer.xaml.cs.

        {
            // We expect to receive 1 byte of data with our control transfer, which is the state of the seven segment
            uint receiveDataSize = 1;

            // The Seven Segment display value is only 1 byte
            IBuffer dataBuffer = await SendVendorControlTransferInToDeviceRecipientAsync(OsrFx2.VendorCommand.GetSevenSegment, receiveDataSize);

            if (dataBuffer.Length == receiveDataSize)
            {
                DataReader reader = DataReader.FromBuffer(dataBuffer);

                // The raw hex value representing the seven segment display
                Byte rawValue = reader.ReadByte();

                // The LED can't display the value of 255, so if the value
                // we receive is not a number, we'll know by seeing if this value changed
                Byte readableValue = 255;

                // Find which numeric value has the segment hex value
                for (int i = 0; i < OsrFx2.SevenLedSegmentMask.Length; i += 1)
                {
                    if (rawValue == OsrFx2.SevenLedSegmentMask[i])
                    {
                        readableValue = (Byte)i;

                        break;
                    }
                }

                // Seven Segment cannot display value 255, the value we received isn't a number
                if (readableValue == 255)
                {
                    MainPage.Current.NotifyUser("The segment display is not yet initialized", NotifyType.ErrorMessage);
                }
                else
                {
                    MainPage.Current.NotifyUser("The segment display value is " + readableValue.ToString(), NotifyType.StatusMessage);
                }
            }
            else
            {
                MainPage.Current.NotifyUser(
                    "Expected to read " + receiveDataSize.ToString() + " bytes, but got " + dataBuffer.Length.ToString(),
                    NotifyType.ErrorMessage);
            }
        }

async void GetOsrFx2SevenSegmentSetting_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario2_ControlTransfer.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonGetOsrFx2SevenSegment.IsEnabled = false;

                await GetOsrFx2SevenSegmentAsync();

                ButtonGetOsrFx2SevenSegment.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

async void GetSuperMuttLedBlinkPattern_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario2_ControlTransfer.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonGetSuperMuttLedBlinkPattern.IsEnabled = false;

                await GetSuperMuttLedBlinkPatternAsync();

                ButtonGetSuperMuttLedBlinkPattern.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

async Task GetSuperMuttLedBlinkPatternAsync ( ) [inline, private]

Sets up a UsbSetupPacket that will let the device know that we are trying to get the Led blink pattern on the SuperMutt via control transfer.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

The simplest way to obtain a byte from the buffer is by using a DataReader. DataReader provides a simple way to read from buffers (e.g. can return bytes, strings, ints).

Do note the method that is used to send a control transfer. There are two methods to send a control transfer. One is to send data and the other is to get data.

Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 308 of file Scenario2_ControlTransfer.xaml.cs.

        {
            // The blink pattern is 1 byte long, so we only need to retrieve 1 byte of data
            IBuffer buffer = await SendVendorControlTransferInToDeviceRecipientAsync(SuperMutt.VendorCommand.GetLedBlinkPattern, 1);

            if (buffer.Length > 0)
            {
                // Easiest way to read from a buffer
                DataReader dataReader = DataReader.FromBuffer(buffer);

                Byte pattern = dataReader.ReadByte();

                MainPage.Current.NotifyUser("The Led blink pattern is " + pattern.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                MainPage.Current.NotifyUser("ControlInTransfer returned 0 bytes", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 46 of file Scenario2_ControlTransfer.xaml.cs.

        {
            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.OsrFx2, OsrFx2Scenario);
            deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
        }

async Task<IBuffer> SendVendorControlTransferInToDeviceRecipientAsync | ( | Byte | vendorCommand,
 |  | UInt32 | dataPacketLength |
 | ) |  |  | [inline, private]

Sets up a UsbSetupPacket and sends control transfer that will let the device know that we are trying to retrieve data from the device.

This method only supports vendor commands because the scenario only uses vendor commands.

Do note the method that is used to send a control transfer. There are two methods to send a control transfer. One involves receiving buffer data in the Data stage of the control transfer, and the other involves transmiting the buffer data.

The simplest way to obtain a byte from the buffer is by using a DataReader. DataReader provides a simple way to read from buffers (e.g. can return bytes, strings, ints).

Parameters:
vendorCommand | Command to put into SetupPacket's Request property
dataPacketLength | Number of bytes in the data packet that is sent in the Data Stage
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 341 of file Scenario2_ControlTransfer.xaml.cs.

        {
            // Data will be written to this buffer when we receive it
            var buffer = new Windows.Storage.Streams.Buffer(dataPacketLength);

            UsbSetupPacket setupPacket = new UsbSetupPacket
            {
                RequestType = new UsbControlRequestType
                {
                    Direction = UsbTransferDirection.In,
                    Recipient = UsbControlRecipient.Device,
                    ControlTransferType = UsbControlTransferType.Vendor,
                },
                Request = vendorCommand,
                Length = dataPacketLength
            };
            return await EventHandlerForDevice.Current.Device.SendControlInTransferAsync(setupPacket, buffer);
        }

async Task SetOsrFx2SevenSegmentAsync ( Byte numericValue ) [inline, private]

Sets the seven segment display on the OSRFX2 device via control transfer.

Before sending the data through the control transfer, the numeric value is converted into a hex value that is bit masked. Different sections of the bit mask will turn on a different LEDs. Please refer to the OSRFX2 spec to see the hex values per LED.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Setting Seven Segment LED require setup packet: bmRequestType: type: VENDOR recipient: DEVICE bRequest: 0xDB wLength: 1

The Buffer is used to hold data that is meant to be sent over during the data phase. The easiest way to write data to an IBuffer is to use a DataWriter. The DataWriter, when instantiated, creates a buffer internally. The buffer is of type IBuffer and can be detached from the writer, which gives us the internal IBuffer.

Parameters:
numericValue
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 151 of file Scenario2_ControlTransfer.xaml.cs.

        {
            DataWriter writer = new DataWriter();

            // Convert the numeric value into a 7 segment LED hex value and write it to a buffer.
            writer.WriteByte(OsrFx2.SevenLedSegmentMask[numericValue]);

            // The buffer with the data
            var bufferToSend = writer.DetachBuffer();

            UsbSetupPacket setupPacket = new UsbSetupPacket
            {
                RequestType = new UsbControlRequestType
                {
                    Direction = UsbTransferDirection.Out,
                    Recipient = UsbControlRecipient.Device,
                    ControlTransferType = UsbControlTransferType.Vendor
                },
                Request = OsrFx2.VendorCommand.SetSevenSegment,
                Value = 0,
                Length = bufferToSend.Length
            };

            UInt32 bytesTransferred = await EventHandlerForDevice.Current.Device.SendControlOutTransferAsync(setupPacket, bufferToSend);

            // Make sure we sent the correct number of bytes
            if (bytesTransferred == bufferToSend.Length)
            {
                MainPage.Current.NotifyUser("The segment display value is set to " + numericValue.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                MainPage.Current.NotifyUser(
                    "Error sending data. Sent bytes: " + bytesTransferred.ToString() + "; Tried to send : " + bufferToSend.Length,
                    NotifyType.ErrorMessage);
            }
        }

async void SetOsrFx2SevenSegmentSetting_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario2_ControlTransfer.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonSetOsrFx2SevenSegment.IsEnabled = false;

                Byte numericValue = (Byte)OsrFx2SevenSegmentSettingInput.SelectedIndex;

                await SetOsrFx2SevenSegmentAsync(numericValue);

                ButtonSetOsrFx2SevenSegment.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

async void SetSuperMuttLedBlinkPattern_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario2_ControlTransfer.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                ButtonSetSuperMuttLedBlinkPattern.IsEnabled = false;

                Byte pattern = (Byte)SuperMuttLedBlinkPatternInput.SelectedIndex;

                await SetSuperMuttLedBlinkPatternAsync(pattern);

                ButtonSetSuperMuttLedBlinkPattern.IsEnabled = true;
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task SetSuperMuttLedBlinkPatternAsync ( Byte pattern ) [inline, private]

Initiates a control transfer to set the blink pattern on the SuperMutt's LED.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Setting LED blink pattern require setup packet: bmRequestType: type: VENDOR recipient: DEVICE bRequest: 0x03 wValue: 0-7 (any number in that range, inclusive) wLength: 0

The SuperMutt has the following patterns: 0 - LED always on 1 - LED flash 2 seconds on, 2 off, repeat 2 - LED flash 2 seconds on, 1 off, 2 on, 4 off, repeat ... 7 - 7 iterations of 2 on, 1 off, followed by 4 off, repeat

Parameters:
pattern A number from 0-7. Each number represents a different blinking pattern
Returns:
A task that can be used to chain more methods after completing the scenario

Definition at line 274 of file Scenario2_ControlTransfer.xaml.cs.

        {
            UsbSetupPacket setupPacket = new UsbSetupPacket
            {
                RequestType = new UsbControlRequestType
                {
                    Direction = UsbTransferDirection.Out,
                    Recipient = UsbControlRecipient.Device,
                    ControlTransferType = UsbControlTransferType.Vendor
                },
                Request = SuperMutt.VendorCommand.SetLedBlinkPattern,
                Value = pattern,
                Length = 0
            };

            UInt32 bytesTransferred = await EventHandlerForDevice.Current.Device.SendControlOutTransferAsync(setupPacket);

            MainPage.Current.NotifyUser("The Led blink pattern is set to " + pattern.ToString(), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2_ControlTransfer.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario2_ControlTransfer.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_InterruptPipes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario3_InterruptPipes
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_InterruptPipes Class Reference

This page demonstrates how to use interrupts pipes on a UsbDevice. More...

List of all members.

Public Member Functions

Scenario3_InterruptPipes ()

Static Public Member Functions

static Boolean | CreateBooleanChartInTable (InlineCollection table, List< Boolean > newValues, List< Boolean > oldValues, String trueValue, String falseValue)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | ClearSwitchStateTable ()
async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
async void | OnGeneralInterruptEvent (UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs)
async void | OnOsrFx2SwitchStateChangeEvent (UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs)
void | RegisterForInterruptEvent (UInt32 pipeIndex, TypedEventHandler< UsbInterruptInPipe, UsbInterruptInEventArgs > eventHandler)
void | RegisterOsrFx2InterruptEvent_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
void | RegisterSuperMuttInterruptEvent_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
void | UnregisterFromInterruptEvent ()
void | UnregisterInterruptEvent_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
void | UpdateRegisterEventButton ()
void | UpdateSwitchStateTable (List< Boolean > states)
void | WriteSuperMuttInterruptOut_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
async void | WriteToInterruptOut (UInt32 pipeIndex, UInt32 bytesToWrite)

Private Attributes

TypedEventHandler
< UsbInterruptInPipe,
UsbInterruptInEventArgs > 		interruptEventHandler
Boolean | navigatedAway
UInt32 | numInterruptsReceived
List< Boolean > | previousSwitchStates
Boolean | registeredInterrupt
UInt32 | registeredInterruptPipeIndex
MainPage | rootPage = MainPage.Current
UInt32 | totalNumberBytesReceived
UInt32 | totalNumberBytesWritten

Detailed Description

Definition at line 32 of file Scenario3_InterruptPipes.xaml.cs.

Constructor & Destructor Documentation

Scenario3_InterruptPipes ( ) [inline]

Definition at line 52 of file Scenario3_InterruptPipes.xaml.cs.

        {
            registeredInterruptPipeIndex = 0;
            totalNumberBytesWritten = 0;
            registeredInterrupt = false;
            numInterruptsReceived = 0;
            totalNumberBytesReceived = 0;
            previousSwitchStates = null;

            this.InitializeComponent();
        }

Member Function Documentation

void ClearSwitchStateTable ( ) [inline, private]

Definition at line 421 of file Scenario3_InterruptPipes.xaml.cs.

        {
            SwitchStates.Inlines.Clear();
            previousSwitchStates = null;
        }

static Boolean CreateBooleanChartInTable | ( | InlineCollection | table,
 |  | List< Boolean > | newValues,
 |  | List< Boolean > | oldValues,
 |  | String | trueValue,
 |  | String | falseValue |
 | ) |  |  | [inline, static]

Clears and populates the provided table with rows that have the following syntax: [row #] [state of new value].

If the state of a value has changed, the value will be bolded.

Parameters:
table | Table will be cleared and new rows will populate this table.
newValues | The new boolean values
oldValues | The boolean values that the new ones are being compared to
trueValue | Text if the new value is TRUE
falseValue | Text if the new vlaue is FALSE

Definition at line 464 of file Scenario3_InterruptPipes.xaml.cs.

        {
            Boolean isBooleanChartCreated = false;

            // Make sure there are at least newValues to check or that there are the same number of old values as new values
            if ((newValues != null) && ((oldValues == null) || (newValues.Count == oldValues.Count)))
            {
                table.Clear();

                // Each new value has it's own row
                for (int i = 0; i < (int)newValues.Count; i += 1)
                {
                    var line = new Span();

                    // Row #
                    var block = new Run();
                    block.Text = (i + 1).ToString("D", NumberFormatInfo.InvariantInfo);
                    line.Inlines.Add(block);

                    // Space between row # and the value (simulates a column)
                    block = new Run();
                    block.Text = "    ";
                    line.Inlines.Add(block);

                    // Print the textual form of TRUE/FALSE values
                    block = new Run();
                    block.Text = newValues[i] ? trueValue : falseValue;

                    // Bold values that have changed
                    if ((oldValues != null) && (oldValues[i] != newValues[i]))
                    {
                        var bold = new Bold();
                        bold.Inlines.Add(block);
                        line.Inlines.Add(bold);
                    }
                    else
                    {
                        line.Inlines.Add(block);
                    }

                    line.Inlines.Add(new LineBreak());

                    table.Add(line);
                }

                isBooleanChartCreated = true;
            }

            return isBooleanChartCreated;
        }

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario3_InterruptPipes.xaml.cs.

        {
            UnregisterFromInterruptEvent();

            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    UpdateRegisterEventButton();
                    ClearSwitchStateTable();
                }));
        }

async void OnGeneralInterruptEvent | ( | UsbInterruptInPipe | sender,
 |  | UsbInterruptInEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This callback only increments the total number of interrupts received and prints it.

This method is called whenever the device sends an interrupt on the pipe we registered this callback on.

Parameters:
sender | The interrupt pipe that raised the event (the one that received the interrupt)
eventArgs | Contains the data, in an IBuffer, that was received through the interrupts

Definition at line 355 of file Scenario3_InterruptPipes.xaml.cs.

        {
            // If we navigated away from this page, we don't need to process this event
            // This also prevents output from spilling into another page
            if (!navigatedAway)
            {
                numInterruptsReceived++;

                // The data from the interrupt
                IBuffer buffer = eventArgs.InterruptData;

                totalNumberBytesReceived += buffer.Length;

                // Create a DispatchedHandler for the because we are interracting with the UI directly and the
                // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
                // the UI, an exception is thrown
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        // If we navigated away from this page, do not print anything. The dispatch may be handled after
                        // we move to a different page.
                        if (!navigatedAway)
                        {
                            MainPage.Current.NotifyUser(
                                "Total number of interrupt events received: " + numInterruptsReceived.ToString()
                                + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
                                NotifyType.StatusMessage);
                        }
                    }));
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Definition at line 91 of file Scenario3_InterruptPipes.xaml.cs.

        {
            navigatedAway = true;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UnregisterFromInterruptEvent();
            }

            // We are leaving and no longer care about the device closing
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 71 of file Scenario3_InterruptPipes.xaml.cs.

        {
            navigatedAway = false;
            totalNumberBytesWritten = 0;

            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.OsrFx2, OsrFx2Scenario);
            deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // Get notified when the device is about to be closed so we can unregister events
            EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

            ClearSwitchStateTable();
            UpdateRegisterEventButton();
        }

async void OnOsrFx2SwitchStateChangeEvent | ( | UsbInterruptInPipe | sender,
 |  | UsbInterruptInEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This method is called whenever the device sends an interrupt on the pipe we registered this callback on.

We will read a byte from the buffer that the device sent to us and then look at each bit to determine state of each switch. AFter determining the state of each switch, we will print out a table with each row representing a switch and its state.

Parameters:
sender | The interrupt pipe that raised the event (the one that received the interrupt)
eventArgs | Contains the data, in an IBuffer, that was received through the interrupts

Definition at line 272 of file Scenario3_InterruptPipes.xaml.cs.

        {
            // If we navigated away from this page, we don't need to process this event
            // This also prevents output from spilling into another page
            if (!navigatedAway)
            {
                numInterruptsReceived++;

                // The OSRFX2 gives us 1 byte, each bit representing the state of a switch
                const Byte numberOfSwitches = 8;

                var switchStateList = new List<Boolean>(numberOfSwitches);

                IBuffer buffer = eventArgs.InterruptData;

                if (buffer.Length > 0)
                {
                    totalNumberBytesReceived += buffer.Length;

                    DataReader reader = DataReader.FromBuffer(buffer);

                    byte switchStates = reader.ReadByte();

                    // Loop through each bit of what the device sent us and determine the state of each switch
                    for (int switchIndex = 0; switchIndex < numberOfSwitches; switchIndex++)
                    {
                        int result = (1 << switchIndex) & switchStates;

                        if (result != 0)
                        {
                            switchStateList.Add(true);
                        }
                        else
                        {
                            switchStateList.Add(false);
                        }
                    }

                    // Create a DispatchedHandler for the because we are printing the table to the UI directly and the
                    // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
                    // the UI, an exception is thrown
                    await rootPage.Dispatcher.RunAsync(
                        CoreDispatcherPriority.Normal,
                        new DispatchedHandler(() =>
                        {
                            // If we navigated away from this page, do not print anything. The dispatch may be handled after
                            // we move to a different page.
                            if (!navigatedAway)
                            {
                                rootPage.NotifyUser(
                                    "Total number of interrupt events received: " + numInterruptsReceived.ToString()
                                    + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
                                    NotifyType.StatusMessage);

                                // Print the switch state table
                                UpdateSwitchStateTable(switchStateList);
                            }
                        }));
                }
                else
                {
                    await rootPage.Dispatcher.RunAsync(
                        CoreDispatcherPriority.Normal,
                        new DispatchedHandler(() =>
                        {
                            // If we navigated away from this page, do not print anything. The dispatch may be handled after
                            // we move to a different page.
                            if (!navigatedAway)
                            {
                                rootPage.NotifyUser("Received 0 bytes from interrupt", NotifyType.ErrorMessage);
                            }
                        }));
                }
            }
        }

void RegisterForInterruptEvent | ( | UInt32 | pipeIndex,
 |  | TypedEventHandler< UsbInterruptInPipe, UsbInterruptInEventArgs > | eventHandler |
 | ) |  |  | [inline, private]

Register for the interrupt that is triggered when the device sends an interrupt to us (e.g.

OSRFX2's device's switch state changes or SuperMUTT's software generated interrupts). The DefaultInterface on the the device is the first interface on the device. We navigate to the InterruptInPipes because that collection contains all the interrupt in pipes for the selected interface setting.

Each pipe has a property that links to an EndpointDescriptor. This descriptor can be used to find information about the pipe (e.g. type, id, etc...). The EndpointDescriptor trys to mirror the EndpointDescriptor that is defined in the Usb Spec.

The function also saves the event token so that we can unregister from the even later on.

Parameters:
pipeIndex | The index of the pipe found in UsbInterface.InterruptInPipes. It is not the endpoint number
eventHandler | Event handler that will be called when the event is raised

Definition at line 227 of file Scenario3_InterruptPipes.xaml.cs.

        {
            var interruptInPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptInPipes;

            if (!registeredInterrupt && (pipeIndex < interruptInPipes.Count))
            {
                var interruptInPipe = interruptInPipes[(int)pipeIndex];

                registeredInterrupt = true;
                registeredInterruptPipeIndex = pipeIndex;

                // Save the interrupt handler so we can use it to unregister
                interruptEventHandler = eventHandler;

                interruptInPipe.DataReceived += interruptEventHandler;

                numInterruptsReceived = 0;
                totalNumberBytesReceived = 0;
            }
        }

void RegisterOsrFx2InterruptEvent_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This method will register for events on the correct interrupt in pipe index on the OsrFx2 device.

Parameters:
sender
eventArgs

Definition at line 122 of file Scenario3_InterruptPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UInt32 interruptPipeIndex = OsrFx2.Pipe.InterruptInPipeIndex;
                var interruptEventHandler = new TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs>(this.OnOsrFx2SwitchStateChangeEvent);

                RegisterForInterruptEvent(interruptPipeIndex, interruptEventHandler);

                UpdateRegisterEventButton();
                ClearSwitchStateTable();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

void RegisterSuperMuttInterruptEvent_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This method will register for events on the correct interrupt in pipe index on the SuperMutt device.

Parameters:
sender
eventArgs

Definition at line 146 of file Scenario3_InterruptPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UInt32 interruptPipeIndex = SuperMutt.Pipe.InterruptInPipeIndex;

                var interruptEventHandler = new TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs>(this.OnGeneralInterruptEvent);

                RegisterForInterruptEvent(interruptPipeIndex, interruptEventHandler);

                UpdateRegisterEventButton();
                ClearSwitchStateTable();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }

        }

void UnregisterFromInterruptEvent ( ) [inline, private]

Unregisters from the interrupt event that was registered for in the RegisterForInterruptEvent();.

Definition at line 251 of file Scenario3_InterruptPipes.xaml.cs.

        {
            if (registeredInterrupt)
            {
                // Search for the correct pipe that we know we used to register events
                var interruptInPipe = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptInPipes[(int)registeredInterruptPipeIndex];
                interruptInPipe.DataReceived -= interruptEventHandler;

                registeredInterrupt = false;
            }
        }

void UnregisterInterruptEvent_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 166 of file Scenario3_InterruptPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                UnregisterFromInterruptEvent();

                UpdateRegisterEventButton();
                ClearSwitchStateTable();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void UpdateRegisterEventButton ( ) [inline, private]

Definition at line 446 of file Scenario3_InterruptPipes.xaml.cs.

        {
            ButtonRegisterSuperMuttInterruptEvent.IsEnabled = !registeredInterrupt;
            ButtonRegisterOsrFx2InterruptEvent.IsEnabled = !registeredInterrupt;
            ButtonUnregisterInterruptEvent.IsEnabled = registeredInterrupt;
        }

void UpdateSwitchStateTable ( List< Boolean > states ) [inline, private]

Prints a table in the UI representing the current state of each of the switches on the OSRFX2 board.

The bolded states/switches are the switches that have their states changed.

Note that the OSRFX2 board has the switch states reversed (1 is off and 0 is on)

Parameters:
states Switch states where 0 is off and 1 is on

Definition at line 434 of file Scenario3_InterruptPipes.xaml.cs.

        {
            CreateBooleanChartInTable(
                SwitchStates.Inlines,  // The table will be written directly to the UI's textbox
                states,
                previousSwitchStates,
                "off",
                "on");

            previousSwitchStates = states;
        }

void WriteSuperMuttInterruptOut_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

This scenario is only available on the SuperMutt device because the OSRFX2 doesn't have Out Interrupt Endpoints.

This method will determine the right InterruptOutPipe to use and will call another method to do the actual writing.

Parameters:
sender
eventArgs

Definition at line 188 of file Scenario3_InterruptPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var interruptOutPipeIndex = SuperMutt.Pipe.InterruptOutPipeIndex;
                var interruptOutPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptOutPipes;

                if (interruptOutPipeIndex < interruptOutPipes.Count)
                {
                    // We will write the maximum number of bytes we can per interrupt
                    var bytesToWrite = interruptOutPipes[(int)interruptOutPipeIndex].EndpointDescriptor.MaxPacketSize;

                    WriteToInterruptOut(interruptOutPipeIndex, bytesToWrite);
                }
                else
                {
                    MainPage.Current.NotifyUser("Pipe index provided (" + interruptOutPipeIndex.ToString(NumberFormatInfo.InvariantInfo) + ") is out of range", NotifyType.ErrorMessage);
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async void WriteToInterruptOut | ( | UInt32 | pipeIndex,
 |  | UInt32 | bytesToWrite |
 | ) |  |  | [inline, private]

Will write garbage data to the specified output pipe.

Parameters:
pipeIndex | Index of pipe in the list of Device.DefaultInterface.InterruptOutPipes
bytesToWrite | Bytes of garbage data to write

Definition at line 393 of file Scenario3_InterruptPipes.xaml.cs.

        {
            var interruptOutPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptOutPipes;

            if (pipeIndex < interruptOutPipes.Count)
            {
                // Create an array, all default initialized to 0, and write it to the buffer
                // The data inside the buffer will be garbage
                var arrayBuffer = new Byte[bytesToWrite];

                var pipe = interruptOutPipes[(int)pipeIndex];

                var pipeWriter = new DataWriter(pipe.OutputStream);
                pipeWriter.WriteBytes(arrayBuffer);

                // This is where the data is flushed out to the device.
                UInt32 bytesWritten = await pipeWriter.StoreAsync();

                totalNumberBytesWritten += bytesWritten;

                MainPage.Current.NotifyUser("Total Bytes Written: " + totalNumberBytesWritten.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                MainPage.Current.NotifyUser("Pipe index provided (" + pipeIndex.ToString() + ") is out of range", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs> interruptEventHandler [private]

Definition at line 34 of file Scenario3_InterruptPipes.xaml.cs.

Boolean navigatedAway [private]

Definition at line 43 of file Scenario3_InterruptPipes.xaml.cs.

UInt32 numInterruptsReceived [private]

Definition at line 38 of file Scenario3_InterruptPipes.xaml.cs.

List<Boolean> previousSwitchStates [private]

Definition at line 46 of file Scenario3_InterruptPipes.xaml.cs.

Boolean registeredInterrupt [private]

Definition at line 36 of file Scenario3_InterruptPipes.xaml.cs.

UInt32 registeredInterruptPipeIndex [private]

Definition at line 35 of file Scenario3_InterruptPipes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 50 of file Scenario3_InterruptPipes.xaml.cs.

UInt32 totalNumberBytesReceived [private]

Definition at line 39 of file Scenario3_InterruptPipes.xaml.cs.

UInt32 totalNumberBytesWritten [private]

Definition at line 40 of file Scenario3_InterruptPipes.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario3_InterruptPipes.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_BulkPipes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario4_BulkPipes
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_BulkPipes Class Reference

This page demonstrates how to propertly use bulk pipes to read and write to the device.

List of all members.

Public Member Functions

Scenario4_BulkPipes ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

async void | BulkRead_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | BulkReadAsync (UInt32 bulkPipeIndex, UInt32 bytesToRead, CancellationToken cancellationToken)
async void | BulkReadWrite_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | BulkReadWriteAsync (UInt32 bulkInPipeIndex, UInt32 bulkOutPipeIndex, UInt32 bytesToReadWrite)
async void | BulkWrite_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | BulkWriteAsync (UInt32 bulkPipeIndex, UInt32 bytesToWrite, CancellationToken cancellationToken)
void | CancelAllIoTasks ()
void | CancelAllIoTasks_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
Boolean | IsPerformingIo ()
async void | NotifyCancelingTask ()
async void | NotifyTaskCanceled ()
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
void | OnDeviceConnected (EventHandlerForDevice sender, DeviceInformation onDeviceConnectedEventArgs)
async void | PrintTotalReadWriteBytes ()
void | ResetCancellationTokenSource ()
void | UpdateButtonStates ()

Private Attributes

Object | cancelIoLock = new Object()
CancellationTokenSource | cancellationTokenSource
Boolean | navigatedAway
MainPage | rootPage = MainPage.Current
Boolean | runningReadTask
Boolean | runningReadWriteTask
Boolean | runningWriteTask
UInt32 | totalBytesRead
UInt32 | totalBytesWritten

Detailed Description

Definition at line 33 of file Scenario4_BulkPipes.xaml.cs.

Constructor & Destructor Documentation

Scenario4_BulkPipes ( ) [inline]

Definition at line 53 of file Scenario4_BulkPipes.xaml.cs.

        {
            totalBytesRead = 0;
            totalBytesWritten = 0;
            runningReadTask = false;
            runningWriteTask = false;
            runningReadWriteTask = false;

            this.InitializeComponent();
        }

Member Function Documentation

async void BulkRead_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 141 of file Scenario4_BulkPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Reading...", NotifyType.StatusMessage);

                    // We need to set this to true so that the buttons can be updated to disable the read button. We will not be able to
                    // update the button states until after the read completes.
                    runningReadTask = true;
                    UpdateButtonStates();

                    // Both supported devices have the bulk in pipes on index 0
                    UInt32 bulkInPipeIndex = 0;

                    // Read as much data as possible in one packet
                    UInt32 bytesToRead = 512;

                    await BulkReadAsync(bulkInPipeIndex, bytesToRead, cancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*ex*/)
                {
                    NotifyTaskCanceled();
                }
                finally
                {
                    runningReadTask = false;

                    UpdateButtonStates();
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task BulkReadAsync | ( | UInt32 | bulkPipeIndex,
 |  | UInt32 | bytesToRead,
 |  | CancellationToken | cancellationToken |
 | ) |  |  | [inline, private]

Will read data from the specified input pipe.

The data being read is garbage data because the samples devices are giving us garbage data. We use cancellation tokens to cancel reads that are pending or running.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
pipeIndex | Index of pipe in the list of Device.DefaultInterface.BulkInPipes
bytesToRead | Bytes of garbage data to read
cancellationToken | Cancellation token to associate the task with

Definition at line 372 of file Scenario4_BulkPipes.xaml.cs.

        {
            var stream = EventHandlerForDevice.Current.Device.DefaultInterface.BulkInPipes[(int)bulkPipeIndex].InputStream;

            DataReader reader = new DataReader(stream);

            Task<UInt32> loadAsyncTask;

            // Don't start any IO if we canceled the task
            lock (cancelIoLock)
            {
                cancellationToken.ThrowIfCancellationRequested();

                // Cancellation Token will be used so we can stop the task operation explicitly
                // The completion function should still be called so that we can properly handle a canceled task
                loadAsyncTask = reader.LoadAsync(bytesToRead).AsTask(cancellationToken);
            }

            UInt32 bytesRead = await loadAsyncTask;

            totalBytesRead += bytesRead;

            PrintTotalReadWriteBytes();

            // The data that is read is stored in the reader object
            // e.g. To read a string from the buffer:
            // reader.ReadString(bytesRead);
        }

async void BulkReadWrite_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 217 of file Scenario4_BulkPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Reading/Writing...", NotifyType.StatusMessage);

                    // We need to set this to true so that the buttons can be updated to disable the read and write button,
                    // but enable the individual read/write buttons. We will not be able to update the button states until after the read/write completes.
                    runningReadWriteTask = true;
                    UpdateButtonStates();

                    // Both supported devices have the bulk in/out pipes on index 0
                    UInt32 bulkOutPipeIndex = 0;
                    UInt32 bulkInPipeIndex = 0;

                    // Write as much data as possible in one packet
                    UInt32 bytesToWrite = 512;

                    // Since the read/writes go on indefinitely, we need to be able to cancel both reads and writes at the same time
                    await BulkReadWriteAsync(bulkInPipeIndex, bulkOutPipeIndex, bytesToWrite);

                    // This line should not be reached unless the bulk read write stopped loops because the device was disconnected.
                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                        new DispatchedHandler(() =>
                        {
                            // If we navigated away from this page, do not print anything. The dispatch may be handled after
                            // we move to a different page.
                            if (!navigatedAway)
                            {
                                rootPage.NotifyUser("Device was disconnected before we could read/write to it", NotifyType.StatusMessage);
                            }
                        }));
                }
                catch (OperationCanceledException /*ex*/)
                {
                    NotifyTaskCanceled();
                }
                catch (AggregateException exceptions)
                {
                    // Check to see if the reads and writes were cancelled
                    // If there was an exception other than a cancelled task, pass it up to caller
                    foreach (Exception exception in exceptions.InnerExceptions)
                    {
                        Exception realException;

                        if (exception is AggregateException && (exception.InnerException is OperationCanceledException))
                        {
                            realException = exception.InnerException;
                        }
                        else
                        {
                            realException = exception;
                        }

                        if (realException is OperationCanceledException)
                        {
                            NotifyTaskCanceled();
                        }
                        else
                        {
                            throw;
                        }
                    }
                }
                finally
                {
                    // The read/write operations are no longer running
                    runningReadWriteTask = false;

                    UpdateButtonStates();
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task BulkReadWriteAsync | ( | UInt32 | bulkInPipeIndex,
 |  | UInt32 | bulkOutPipeIndex,
 |  | UInt32 | bytesToReadWrite |
 | ) |  |  | [inline, private]

A read and a write will be initiated simultaneously.

Reads and writes are looped; after each read/write succeeds, another read/write is initiated.

We will check if the task has been canceled and if it is, we'll throw an exception because custom made tasks are expected to do so. We cannot rely on BulkReadAsync and BulkWriteAsync to throw task cancelled exceptions because they may complete before the task cancellation takes place.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
bulkInPipeIndex | Index of pipe in the list of Device.DefaultInterface.BulkInPipes
bulkOutPipeIndex | Index of pipe in the list of Device.DefaultInterface.BulkOutPipes
bytesToReadWrite | Bytes of garbage data to read/write

Definition at line 414 of file Scenario4_BulkPipes.xaml.cs.

        {
            // A parent task that will wait for the read write child tasks to compelete before this task completes
            await Task.Factory.StartNew(() =>
            {
                // Save the cancellation token now in case the cancellationTokenSource is reset while IO is going on.
                var cancellationToken = cancellationTokenSource.Token;

                // Loop reads
                var readTask = Task.Factory.StartNew(() =>
                {
                    // Keep reading until the task is cancelled
                    while (!cancellationTokenSource.IsCancellationRequested && EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        // Read and do not continue until it is finished
                        BulkReadAsync(bulkInPipeIndex, bytesToReadWrite, cancellationToken).Wait();
                    }
                }, cancellationTokenSource.Token, TaskCreationOptions.AttachedToParent, TaskScheduler.Current);

                // loop writes
                var writeTask = Task.Factory.StartNew(() =>
                {
                    // Keep writing until the task is cancelled
                    while (!cancellationTokenSource.IsCancellationRequested && EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        // Write and do not continue until it is finished
                        BulkWriteAsync(bulkOutPipeIndex, bytesToReadWrite, cancellationToken).Wait();
                    }
                }, cancellationTokenSource.Token, TaskCreationOptions.AttachedToParent, TaskScheduler.Current);

            });
        }

async void BulkWrite_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 179 of file Scenario4_BulkPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Writing...", NotifyType.StatusMessage);

                    // We need to set this to true so that the buttons can be updated to disable the write button. We will not be able to
                    // update the button states until after the write completes.
                    runningWriteTask = true;
                    UpdateButtonStates();

                    // Both supported devices have the bulk out pipes on index 0
                    UInt32 bulkOutPipeIndex = 0;

                    // Write as much data as possible in one packet
                    UInt32 bytesToWrite = 512;

                    await BulkWriteAsync(bulkOutPipeIndex, bytesToWrite, cancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*ex*/)
                {
                    NotifyTaskCanceled();
                }
                finally
                {
                    runningWriteTask = false;

                    UpdateButtonStates();
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task BulkWriteAsync | ( | UInt32 | bulkPipeIndex,
 |  | UInt32 | bytesToWrite,
 |  | CancellationToken | cancellationToken |
 | ) |  |  | [inline, private]

Will write garbage data to the specified output pipe.

Since writing to the device may take a while to complete, we provide the write async with a known cancellation token to cancel any pending or running writes.

Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled at the end of the task chain.

Parameters:
pipeIndex | Index of pipe in the list of Device.DefaultInterface.BulkOutPipes
bytesToWrite | Bytes of garbage data to write
cancellationToken | Cancellation token to associate the task with

Definition at line 330 of file Scenario4_BulkPipes.xaml.cs.

        {
            // Create an array, all default initialized to 0, and write it to the buffer
            // The data inside the buffer will be garbage
            var arrayBuffer = new Byte[bytesToWrite];

            var stream = EventHandlerForDevice.Current.Device.DefaultInterface.BulkOutPipes[(int)bulkPipeIndex].OutputStream;

            var writer = new DataWriter(stream);
            writer.WriteBytes(arrayBuffer);

            Task<UInt32> storeAsyncTask;

            // Don't start any IO if we canceled the task
            lock (cancelIoLock)
            {
                cancellationToken.ThrowIfCancellationRequested();

                // This is where the data is flushed out to the device.
                //
                // Cancellation Token will be used so we can stop the task operation explicitly
                // The completion function should still be called so that we can properly handle a canceled task
                storeAsyncTask = writer.StoreAsync().AsTask(cancellationToken);
            }

            UInt32 bytesWritten = await storeAsyncTask;

            totalBytesWritten += bytesWritten;

            PrintTotalReadWriteBytes();
        }

void CancelAllIoTasks ( ) [inline, private]

It is important to be able to cancel tasks that may take a while to complete.

Canceling tasks is the only way to stop any pending IO operations asynchronously. If the UsbDevice is closed/deleted while there are pending IOs, the destructor will cancel all pending IO operations.

Definition at line 452 of file Scenario4_BulkPipes.xaml.cs.

        {
            lock (cancelIoLock)
            {
                if (!cancellationTokenSource.IsCancellationRequested)
                {
                    cancellationTokenSource.Cancel();

                    // Existing IO already has a local copy of the old cancellation token so this reset won't affect it
                    ResetCancellationTokenSource();
                }
            }
        }

void CancelAllIoTasks_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 297 of file Scenario4_BulkPipes.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                CancelAllIoTasks();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void Dispose ( ) [inline]

Definition at line 64 of file Scenario4_BulkPipes.xaml.cs.

        {
            if (cancellationTokenSource != null)
            {
                cancellationTokenSource.Dispose();
                cancellationTokenSource = null;
            }
        }

Boolean IsPerformingIo ( ) [inline, private]

Determines if we are reading, writing, or reading and writing.

Returns:
If we are doing any of the above operations, we return true; false otherwise

Definition at line 470 of file Scenario4_BulkPipes.xaml.cs.

        {
            return (runningReadTask || runningWriteTask || runningReadWriteTask);
        }

async void NotifyCancelingTask ( ) [inline, private]

Print a status message saying we are canceling a task and disable all buttons to prevent multiple cancel requests.

Definition at line 503 of file Scenario4_BulkPipes.xaml.cs.

        {
            // Setting the dispatcher priority to high allows the UI to handle disabling of all the buttons
            // before any of the IO completion callbacks get a chance to modify the UI; that way this method
            // will never get the opportunity to overwrite UI changes made by IO callbacks
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                new DispatchedHandler(() =>
                {
                    ButtonBulkRead.IsEnabled = false;
                    ButtonBulkWrite.IsEnabled = false;
                    ButtonBulkReadWrite.IsEnabled = false;
                    ButtonCancelAllIoTasks.IsEnabled = false;

                    if (!navigatedAway)
                    {
                        rootPage.NotifyUser("Canceling task... Please wait...", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyTaskCanceled ( ) [inline, private]

Notifies the UI that the operation has been cancelled.

Definition at line 526 of file Scenario4_BulkPipes.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    if (!navigatedAway)
                    {
                        rootPage.NotifyUser("The read or write operation has been cancelled", NotifyType.StatusMessage);
                    }
                }));
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

Stop any pending IO operations because the device will be closed when the app suspends.

Parameters:
sender
args

Definition at line 126 of file Scenario4_BulkPipes.xaml.cs.

        {
            CancelAllIoTasks();
        }

void OnDeviceConnected | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | onDeviceConnectedEventArgs |
 | ) |  |  | [inline, private]

Reset the buttons when the device is reopened.

Parameters:
sender
onDeviceConnectedEventArgs

Definition at line 136 of file Scenario4_BulkPipes.xaml.cs.

        {
            UpdateButtonStates();
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Cancel any on going tasks when navigating away from the page so the device is in a consistent state throughout all the scenarios.

Parameters:
eventArgs

Definition at line 110 of file Scenario4_BulkPipes.xaml.cs.

        {
            navigatedAway = true;

            CancelAllIoTasks();

            // We don't need to worry about app suspend for this scenario anymore
            EventHandlerForDevice.Current.OnAppSuspendCallback = null;
            EventHandlerForDevice.Current.OnDeviceConnected = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it. Will will also register a callback for whenever we cancel a task because we want to prevent the user from doing anymore IO (disable buttons to prevent user IO)

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 82 of file Scenario4_BulkPipes.xaml.cs.

        {
            navigatedAway = false;

            // Both the OSRFX2 and the SuperMutt use the same scenario
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.OsrFx2, GeneralScenario);
            deviceScenarios.Add(DeviceType.SuperMutt, GeneralScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // So we can reset future tasks
            ResetCancellationTokenSource();

            EventHandlerForDevice.Current.OnAppSuspendCallback = new SuspendingEventHandler(this.OnAppSuspension);

            // Reset the buttons if the app resumed and the device is reconnected
            EventHandlerForDevice.Current.OnDeviceConnected = new TypedEventHandler<EventHandlerForDevice, DeviceInformation>(this.OnDeviceConnected);

            UpdateButtonStates();
        }

async void PrintTotalReadWriteBytes ( ) [inline, private]

Definition at line 475 of file Scenario4_BulkPipes.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low,
                new DispatchedHandler(() =>
                {
                    // If we navigated away from this page, do not print anything. The dispatch may be handled after
                    // we move to a different page.
                    if (!navigatedAway)
                    {
                        rootPage.NotifyUser(
                            "Total bytes read: " + totalBytesRead.ToString("D", NumberFormatInfo.InvariantInfo) + "; Total bytes written: "
                            + totalBytesWritten.ToString("D", NumberFormatInfo.InvariantInfo), NotifyType.StatusMessage);
                    }
                }));
        }

void ResetCancellationTokenSource ( ) [inline, private]

Definition at line 491 of file Scenario4_BulkPipes.xaml.cs.

        {
            // Create a new cancellation token source so that can cancel all the tokens again
            cancellationTokenSource = new CancellationTokenSource();

            // Hook the cancellation callback (called whenever Task.cancel is called)
            cancellationTokenSource.Token.Register(() => NotifyCancelingTask());
        }

void UpdateButtonStates ( ) [inline, private]

Allow for one operation at a time.

Definition at line 312 of file Scenario4_BulkPipes.xaml.cs.

        {
            ButtonBulkReadWrite.IsEnabled = !IsPerformingIo();
            ButtonBulkRead.IsEnabled = !runningReadWriteTask && !runningReadTask;
            ButtonBulkWrite.IsEnabled = !runningReadWriteTask && !runningWriteTask;
            ButtonCancelAllIoTasks.IsEnabled = IsPerformingIo();
        }

Member Data Documentation

Object cancelIoLock = new Object() [private]

Definition at line 41 of file Scenario4_BulkPipes.xaml.cs.

CancellationTokenSource cancellationTokenSource [private]

Definition at line 39 of file Scenario4_BulkPipes.xaml.cs.

Boolean navigatedAway [private]

Definition at line 48 of file Scenario4_BulkPipes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 37 of file Scenario4_BulkPipes.xaml.cs.

Boolean runningReadTask [private]

Definition at line 43 of file Scenario4_BulkPipes.xaml.cs.

Boolean runningReadWriteTask [private]

Definition at line 45 of file Scenario4_BulkPipes.xaml.cs.

Boolean runningWriteTask [private]

Definition at line 44 of file Scenario4_BulkPipes.xaml.cs.

UInt32 totalBytesRead [private]

Definition at line 51 of file Scenario4_BulkPipes.xaml.cs.

UInt32 totalBytesWritten [private]

Definition at line 50 of file Scenario4_BulkPipes.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario4_BulkPipes.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_UsbDescriptors Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario5_UsbDescriptors
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_UsbDescriptors Class Reference

This scenario demonstrates how get various descriptors from UsbDevice. More...

List of all members.

Public Member Functions

Scenario5_UsbDescriptors ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | Descriptor_SelectChanged (Object sender, RoutedEventArgs eventArgs)
String | GetConfigurationDescriptorAsString ()
String | GetCustomDescriptorsAsString ()
String | GetDeviceDescriptorAsString ()
String | GetEndpointDescriptorsAsString ()
String | GetInterfaceDescriptorsAsString ()
String | GetProductName ()
void | PrintDescriptor (Descriptor descriptorType)

Private Attributes

ObservableCollection
< DescriptorTypeEntry > 		listOfDescriptorTypes
MainPage | rootPage = MainPage.Current

Detailed Description

This scenario can work for any device as long as it is "added" into the sample. For more information on how to add a device to make it compatible with this scenario, please see Scenario1_DeviceConnect.

Definition at line 62 of file Scenario5_UsbDescriptors.xaml.cs.

Constructor & Destructor Documentation

Scenario5_UsbDescriptors ( ) [inline]

Initializes the list of descriptors that can be displayed in the UI.

Definition at line 73 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            this.InitializeComponent();

            listOfDescriptorTypes = new ObservableCollection<DescriptorTypeEntry>();
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("Device Descriptor", Descriptor.Device));
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("Configuration Descriptor", Descriptor.Configuration));
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("All Interface Descriptors", Descriptor.Interface));
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("All Endpoint Descriptors", Descriptor.Endpoint));
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("All Custom Descriptors", Descriptor.Custom));

            // The Product string is not a string descriptors, they are just strings
            // It is marked as String Descriptor because string descriptors are not available in this API explicitly like descriptors are; however, you may use control
            // transfers to obtain them. The recommended approach, at least to get the Product string, is to use the Windows.Devices.Enumeration API.
            //
            // To get the Manufacturer, the Windows.Devices.Enumeration.Pnp API must be used. The usage of PnpObject is similar to that of the Enumeration API. When
            // creating the PnpObject with one of it's static methods, add "System.Devices.Manufacturer" to the list of properties to include. Note that the PnpObjectType
            // must be of type DeviceContainer, otherwise the manufacturer name cannot be obtained.
            // Once the PnpObject for the device has been obtained, use PnpObject.Properties dictionary where the key is "System.Devices.Manufacturer" and the value is
            // the manufacturer name.
            listOfDescriptorTypes.Add(new DescriptorTypeEntry("Product String", Descriptor.String));
        }

Member Function Documentation

void Descriptor_SelectChanged | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

When an entry is selected from the list of available descriptors, we will print out the contents of the descriptor.

Parameters:
sender
eventArgs

Definition at line 125 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var listOfDescriptorTypes = (ListBox)sender;
                var selection = (DescriptorTypeEntry)listOfDescriptorTypes.SelectedValue;
                var descriptorType = selection.DescriptorType;

                PrintDescriptor(descriptorType);
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

String GetConfigurationDescriptorAsString ( ) [inline, private]

Definition at line 200 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var usbConfiguration = EventHandlerForDevice.Current.Device.Configuration;
                var configurationDescriptor = usbConfiguration.ConfigurationDescriptor;

                content = "Configuration Descriptor\n"
                    + "\nNumber of Interfaces : " + usbConfiguration.UsbInterfaces.Count.ToString("D", NumberFormatInfo.InvariantInfo)
                    + "\nConfiguration Value : 0x" + configurationDescriptor.ConfigurationValue.ToString("X2", NumberFormatInfo.InvariantInfo)
                    + "\nSelf Powered : " + configurationDescriptor.SelfPowered.ToString()
                    + "\nRemote Wakeup : " + configurationDescriptor.RemoteWakeup.ToString()
                    + "\nMax Power (milliAmps) : " + configurationDescriptor.MaxPowerMilliamps.ToString("D", NumberFormatInfo.InvariantInfo);
            }

            return content;
        }

String GetCustomDescriptorsAsString ( ) [inline, private]

There are no custom descriptors for the SuperMutt and OSRFX2 devices, however, this method will show you how to navigate through raw descriptors.

The raw descriptors can be found in UsbConfiguration and UsbInterface, and UsbInterfaceSetting. All possible descriptors that you would find in the full Configuration Descriptor are found under UsbConfiguration. All raw descriptors under UsbInterface are constrained only to those that are found under the InterfaceDescriptor that is defined in the Usb spec.

Usb descriptor header (first 2 bytes): bLength Size of descriptor in bytes bDescriptorType The type of descriptor (configuration, interface, endpoint)

Definition at line 329 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                // Descriptor information will be appended to this string and then printed to UI
                content = "Raw Descriptors";

                var configuration = EventHandlerForDevice.Current.Device.Configuration;
                var allRawDescriptors = configuration.Descriptors;

                // Print first 2 bytes of all descriptors within the configuration descriptor
                // because the first 2 bytes are always length and descriptor type
                // the UsbDescriptor's DescriptorType and Length properties, but we will not use these properties
                // in order to demonstrate ReadDescriptorBuffer() and how to parse it.
                foreach (UsbDescriptor descriptor in allRawDescriptors)
                {
                    var descriptorBuffer = new Windows.Storage.Streams.Buffer(descriptor.Length);
                    descriptor.ReadDescriptorBuffer(descriptorBuffer);

                    DataReader reader = DataReader.FromBuffer(descriptorBuffer);

                    // USB data is Little Endian according to the USB spec.
                    reader.ByteOrder = ByteOrder.LittleEndian;

                    // ReadByte has a side effect where it consumes the current byte, so the next ReadByte will read the next character.
                    // Putting multiple ReadByte() on the same line (same variable assignment) may cause the bytes to be read out of order.
                    var length = reader.ReadByte().ToString("D", NumberFormatInfo.InvariantInfo);
                    var type = "0x" + reader.ReadByte().ToString("X2", NumberFormatInfo.InvariantInfo);

                    content += "\n\nDescriptor"
                        + "\nLength : " + length
                        + "\nDescriptorType : " + type;
                }
            }

            return content;
        }

String GetDeviceDescriptorAsString ( ) [inline, private]

Definition at line 180 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var deviceDescriptor = EventHandlerForDevice.Current.Device.DeviceDescriptor;

                content = "Device Descriptor\n"
                    + "\nUsb Spec Number : 0x" + deviceDescriptor.BcdUsb.ToString("X4", NumberFormatInfo.InvariantInfo)
                    + "\nMax Packet Size (Endpoint 0) : " + deviceDescriptor.MaxPacketSize0.ToString("D", NumberFormatInfo.InvariantInfo)
                    + "\nVendor ID : 0x" + deviceDescriptor.VendorId.ToString("X4", NumberFormatInfo.InvariantInfo)
                    + "\nProduct ID : 0x" + deviceDescriptor.ProductId.ToString("X4", NumberFormatInfo.InvariantInfo)
                    + "\nDevice Revision : 0x" + deviceDescriptor.BcdDeviceRevision.ToString("X4", NumberFormatInfo.InvariantInfo)
                    + "\nNumber of Configurations : " + deviceDescriptor.NumberOfConfigurations.ToString("D", NumberFormatInfo.InvariantInfo);
            }

            return content;
        }

String GetEndpointDescriptorsAsString ( ) [inline, private]

We will print all the endpoint descriptors of the default interface.

Definition at line 257 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var usbInterface = EventHandlerForDevice.Current.Device.DefaultInterface;
                var bulkInPipes = usbInterface.BulkInPipes;
                var bulkOutPipes = usbInterface.BulkOutPipes;
                var interruptInPipes = usbInterface.InterruptInPipes;
                var interruptOutPipes = usbInterface.InterruptOutPipes;

                content = "Endpoint Descriptors for open pipes";

                // Print Bulk In Endpoint descriptors
                foreach (UsbBulkInPipe bulkInPipe in bulkInPipes)
                {
                    var endpointDescriptor = bulkInPipe.EndpointDescriptor;

                    content += "\n\nBulk In Endpoint Descriptor"
                        + "\nEndpoint Number : 0x" + endpointDescriptor.EndpointNumber.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nMax Packet Size : " + endpointDescriptor.MaxPacketSize.ToString("D", NumberFormatInfo.InvariantInfo);
                }

                // Print Bulk Out Endpoint descriptors
                foreach (UsbBulkOutPipe bulkOutPipe in bulkOutPipes)
                {
                    var endpointDescriptor = bulkOutPipe.EndpointDescriptor;

                    content += "\n\nBulk Out Endpoint Descriptor"
                        + "\nEndpoint Number : 0x" + endpointDescriptor.EndpointNumber.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nMax Packet Size : " + endpointDescriptor.MaxPacketSize.ToString("D", NumberFormatInfo.InvariantInfo);
                }

                // Print Interrupt In Endpoint descriptors
                foreach (UsbInterruptInPipe interruptInPipe in interruptInPipes)
                {
                    var endpointDescriptor = interruptInPipe.EndpointDescriptor;

                    content += "\n\nInterrupt In Endpoint Descriptor"
                        + "\nEndpoint Number : 0x" + endpointDescriptor.EndpointNumber.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nMax Packet Size : " + endpointDescriptor.MaxPacketSize.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nInterval(milliseconds) : " + endpointDescriptor.Interval.Milliseconds.ToString("D", NumberFormatInfo.InvariantInfo);
                }

                // Print Interrupt Out Endpoint descriptors
                foreach (UsbInterruptOutPipe interruptOutPipe in interruptOutPipes)
                {
                    var endpointDescriptor = interruptOutPipe.EndpointDescriptor;

                    content += "\n\nInterrupt Out Endpoint Descriptor"
                        + "\nEndpoint Number : 0x" + endpointDescriptor.EndpointNumber.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nMax Packet Size : " + endpointDescriptor.MaxPacketSize.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nInterval(milliseconds) : " + endpointDescriptor.Interval.Milliseconds.ToString("D", NumberFormatInfo.InvariantInfo);
                }
            }

            return content;
        }

String GetInterfaceDescriptorsAsString ( ) [inline, private]

Will convert all the interfaces to a human readable format.

Definition at line 223 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var interfaces = EventHandlerForDevice.Current.Device.Configuration.UsbInterfaces;

                content = "Interface Descriptors";

                foreach (UsbInterface usbInterface in interfaces)
                {
                    // Will use class/subclass/protocol values from the first interface setting (usually the selected one)
                    UsbInterfaceDescriptor usbInterfaceDescriptor = usbInterface.InterfaceSettings[0].InterfaceDescriptor;

                    content += "\n\nInterface Number : 0x" + usbInterface.InterfaceNumber.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nClass Code : 0x" + usbInterfaceDescriptor.ClassCode.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nSubclass Code : 0x" + usbInterfaceDescriptor.SubclassCode.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nProtocol Code: 0x" + usbInterfaceDescriptor.ProtocolCode.ToString("X2", NumberFormatInfo.InvariantInfo)
                        + "\nNumber of Interface Settings : " + usbInterface.InterfaceSettings.Count.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nNumber of open Bulk In Endpoints : " + usbInterface.BulkInPipes.Count.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nNumber of open Bulk Out Endpoints : " + usbInterface.BulkOutPipes.Count.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nNumber of open Interrupt In Endpoints : " + usbInterface.InterruptInPipes.Count.ToString("D", NumberFormatInfo.InvariantInfo)
                        + "\nNumber of open Interrupt Out Endpoints : " + usbInterface.InterruptOutPipes.Count.ToString("D", NumberFormatInfo.InvariantInfo);
                }

            }

            return content;
        }

String GetProductName ( ) [inline, private]

It is recommended to obtain the product string by using DeviceInformation.Name.

Definition at line 372 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            String content = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                content = "Product name: " + EventHandlerForDevice.Current.DeviceInformation.Name;
            }

            return content;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 103 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.All, GenericScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // Display list of descriptors that can be printed
            if ((EventHandlerForDevice.Current.IsDeviceConnected) &&
               (Utilities.GetDeviceType(EventHandlerForDevice.Current.Device) != DeviceType.None))
            {
                ListOfDescriptorTypesSource.Source = listOfDescriptorTypes;
            }
        }

void PrintDescriptor ( Descriptor descriptorType ) [inline, private]

Obtains the stringified form of the chosen descriptor and prints it.

Parameters:
descriptorType

Definition at line 145 of file Scenario5_UsbDescriptors.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                String descriptor = null;

                switch (descriptorType)
                {
                    case Descriptor.Device:
                        descriptor = GetDeviceDescriptorAsString();
                        break;
                    case Descriptor.Configuration:
                        descriptor = GetConfigurationDescriptorAsString();
                        break;
                    case Descriptor.Interface:
                        descriptor = GetInterfaceDescriptorsAsString();
                        break;
                    case Descriptor.Endpoint:
                        descriptor = GetEndpointDescriptorsAsString();
                        break;
                    case Descriptor.String:
                        descriptor = GetProductName();
                        break;
                    case Descriptor.Custom:
                        descriptor = GetCustomDescriptorsAsString();
                        break;
                }

                if (descriptor != null)
                {
                    DescriptorOutput.Text = descriptor;
                }
            }
        }

Member Data Documentation

ObservableCollection<DescriptorTypeEntry> listOfDescriptorTypes [private]

Definition at line 64 of file Scenario5_UsbDescriptors.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 68 of file Scenario5_UsbDescriptors.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario5_UsbDescriptors.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_InterfaceSettings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario6_InterfaceSettings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_InterfaceSettings Class Reference

Scenario will demonstrate how to change interface settings (also known as alternate interface setting). More...

List of all members.

Public Member Functions

Scenario6_InterfaceSettings ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | GetInterfaceSetting ()
void | GetInterfaceSetting_Click (Object sender, RoutedEventArgs e)
async void | SetInterfaceSetting (Byte settingNumber)
void | SetSuperMuttInterfaceSetting_Click (Object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

This scenario can work for any device as long as it is "added" into the sample. For more information on how to add a device to make it compatible with this scenario, please see Scenario1_DeviceConnect.

Definition at line 29 of file Scenario6_InterfaceSettings.xaml.cs.

Constructor & Destructor Documentation

Scenario6_InterfaceSettings ( ) [inline]

Definition at line 35 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void GetInterfaceSetting ( ) [inline, private]

Figures out which interface setting is currently selected by checking each interface setting even if the setting cannot be selected by this sample app.

It will print out the selected interface setting number.

Definition at line 137 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var interfaceSettings = EventHandlerForDevice.Current.Device.DefaultInterface.InterfaceSettings;

                foreach (UsbInterfaceSetting interfaceSetting in interfaceSettings)
                {
                    if (interfaceSetting.Selected)
                    {
                        Byte interfaceSettingNumber = interfaceSetting.InterfaceDescriptor.AlternateSettingNumber;

                        MainPage.Current.NotifyUser("Current interface setting : " + interfaceSettingNumber.ToString("D", NumberFormatInfo.InvariantInfo), NotifyType.StatusMessage);

                        break;
                    }
                }
            }
        }

void GetInterfaceSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                GetInterfaceSetting();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

The list of interfaces settings will be hardcoded to be 0 or 1 because those settings on the defaultInterface of the SuperMutt are identical. Changing the setting will not effect the funcitonality of other scenarios.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 51 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            // We will disable the scenario that is not supported by the device.
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.All, GenericScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // Enumerate all the interface settings of the default interface and add them to list for user to choose
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var defaultInterface = EventHandlerForDevice.Current.Device.DefaultInterface;
                for (int settingNumber = 0; settingNumber < defaultInterface.InterfaceSettings.Count; settingNumber++)
                {
                    InterfaceSettingsToChoose.Items.Add(settingNumber.ToString(NumberFormatInfo.InvariantInfo));
                }

                // Default select the first interface setting because it's always going to be available
                InterfaceSettingsToChoose.SelectedIndex = 0;

                // Only allow setting of the interface settings for the SuperMutt device because it will not break the rest of the scenarios
                if (!Utilities.IsSuperMuttDevice(EventHandlerForDevice.Current.Device))
                {
                    ButtonSetSetting.IsEnabled = false;
                }
            }
        }

async void SetInterfaceSetting ( Byte settingNumber ) [inline, private]

Selects the interface setting on the default interface.

The interfaceSetting is 0 based, where setting 0 is the default interfaceSetting.

Parameters:
settingNumber

Definition at line 120 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                var interfaceSetting = EventHandlerForDevice.Current.Device.DefaultInterface.InterfaceSettings[settingNumber];

                await interfaceSetting.SelectSettingAsync();

                MainPage.Current.NotifyUser("Interface Setting is set to " + settingNumber, NotifyType.StatusMessage);
            }
        }

void SetSuperMuttInterfaceSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Determines which item is clicked and what the interfaceSettingNumber that item corresponds to.

Will not allow changing of the interface setting if not a SuperMutt. If it is a SuperMutt, only the first two interface settings can be used because the first two interface settings are identical with respect to the API.

Definition at line 86 of file Scenario6_InterfaceSettings.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                // Since we added the the settings in order, the index of the item clicked will give us the index of the
                // setting in UsbInterface.InterfaceSettings.
                // The number of interface settings is limited by the max value of byte because interface setting number size
                // is a byte (Usb Spec).
                SetInterfaceSetting((byte)InterfaceSettingsToChoose.SelectedIndex);
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario6_InterfaceSettings.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario6_InterfaceSettings.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_SyncDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Scenario7_SyncDevice
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario7_SyncDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7_SyncDevice ()

Static Public Member Functions

static bool | TaskRequiresBackgroundAccess ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CancelSync_Click (object sender, RoutedEventArgs e)
void | CancelSyncWithDevice ()
BackgroundTaskRegistration | FindSyncTask ()
async void | OnSyncWithDeviceCompleted (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
async void | OnSyncWithDeviceProgress (BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args)
async Task | SetupBackgroundTask ()
Task< DeviceTriggerResult > | StartSyncBackgroundTaskAsync ()
async void | Sync_Click (object sender, RoutedEventArgs e)
async Task | SyncWithDeviceAsync ()
void | UpdateButtonStates ()

Private Attributes

BackgroundTaskRegistration | backgroundSyncTaskRegistration
Boolean | isSyncing
Boolean | navigatedAway
MainPage | rootPage = MainPage.Current
DeviceInformation | syncDeviceInformation
String | syncDeviceSelector

Static Private Attributes

static DeviceUseTrigger | syncBackgroundTaskTrigger = null

Detailed Description

Definition at line 29 of file Scenario7_SyncDevice.xaml.cs.

Constructor & Destructor Documentation

Scenario7_SyncDevice ( ) [inline]

Definition at line 59 of file Scenario7_SyncDevice.xaml.cs.

        {
            navigatedAway = false;
            isSyncing = false;

            // Save trigger so that we may start the background task later
            // Only one instance of the trigger can exist at a time. Since the trigger does not implement
            // IDisposable, it may still be in memory when a new trigger is created.
            if (syncBackgroundTaskTrigger == null)
            {
                syncBackgroundTaskTrigger = new DeviceUseTrigger();
            }

            this.InitializeComponent();
        }

Member Function Documentation

void CancelSync_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 348 of file Scenario7_SyncDevice.xaml.cs.

        {
            if (isSyncing)
            {
                CancelSyncWithDevice();

                UpdateButtonStates();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

void CancelSyncWithDevice ( ) [inline, private]

Definition at line 134 of file Scenario7_SyncDevice.xaml.cs.

        {
            if (isSyncing)
            {
                backgroundSyncTaskRegistration.Unregister(true);

                backgroundSyncTaskRegistration = null;

                // We are canceling the task, so we are no longer syncing. If the task is registered but never run,
                // the cancel completion is never called
                isSyncing = false;
            }
        }

BackgroundTaskRegistration FindSyncTask ( ) [inline, private]

Search all the existing background tasks for the sync task.

Returns:
If found, the background task registration for the sync task; else, null.

Definition at line 121 of file Scenario7_SyncDevice.xaml.cs.

        {
            foreach (var backgroundTask in BackgroundTaskRegistration.AllTasks.Values)
            {
                if (backgroundTask.Name == SyncBackgroundTaskInformation.Name)
                {
                    return (BackgroundTaskRegistration)backgroundTask;
                }
            }

            return null;
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Cancel the background task so the device can be reopened.

Parameters:
eventArgs

Definition at line 110 of file Scenario7_SyncDevice.xaml.cs.

        {
            navigatedAway = true;

            CancelSyncWithDevice();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 82 of file Scenario7_SyncDevice.xaml.cs.

        {
            navigatedAway = false;

            // Both the OSRFX2 and the SuperMutt use the same scenario
            // If no devices are connected, none of the scenarios will be shown and an error will be displayed
            Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
            deviceScenarios.Add(DeviceType.OsrFx2, GeneralScenario);
            deviceScenarios.Add(DeviceType.SuperMutt, GeneralScenario);

            Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);

            // Unregister any existing tasks that persisted; there should be none unless the app closed/crashed
            var existingSyncTask = FindSyncTask();
            if (existingSyncTask != null)
            {
                existingSyncTask.Unregister(true);
            }

            isSyncing = false;

            UpdateButtonStates();
        }

async void OnSyncWithDeviceCompleted | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Reopen the device after the background task is done syncing.

Notify the UI of how many bytes we wrote to the device.

Parameters:
sender
args

Definition at line 257 of file Scenario7_SyncDevice.xaml.cs.

        {
            isSyncing = false;

            // Exception may be thrown if an error occurs during running the background task
            args.CheckResult();

            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(async () =>
                {
                    // Reopen the device once the background task is completed
                    // Don't attempt to reconnect if the device failed to connect
                    var isDeviceSuccessfullyConnected = await EventHandlerForDevice.Current.OpenDeviceAsync(syncDeviceInformation, syncDeviceSelector);

                    if (!isDeviceSuccessfullyConnected)
                    {
                        EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
                    }

                    syncDeviceInformation = null;
                    syncDeviceSelector = null;

                    // Since we are navigating away, don't touch the UI; we don't care what the output/result of the background task is
                    if (!navigatedAway)
                    {
                        var taskCompleteStatus = (String)ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskStatus];

                        if (taskCompleteStatus == SyncBackgroundTaskInformation.TaskCompleted)
                        {
                            UInt32 totalBytesWritten = (UInt32)ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskResult];

                            // Set the progress bar to be completely filled in case the progress was not updated (this can happen if the app is suspended)
                            SyncProgressBar.Value = 100;

                            rootPage.NotifyUser("Sync: Wrote " + totalBytesWritten.ToString() + " bytes to the device", NotifyType.StatusMessage);
                        }
                        else if (taskCompleteStatus == SyncBackgroundTaskInformation.TaskCanceled)
                        {
                            // Reset the progress bar in case the progress was not updated (this can happen if the app is suspended)
                            SyncProgressBar.Value = 0;

                            rootPage.NotifyUser("Syncing was canceled", NotifyType.StatusMessage);
                        }

                        UpdateButtonStates();
                    }

                    // Remove all local setting values
                    ApplicationData.Current.LocalSettings.Values.Clear();
                }));

            // Unregister the background task and let the remaining task finish until completion
            if (backgroundSyncTaskRegistration != null)
            {
                backgroundSyncTaskRegistration.Unregister(false);
            }
        }

async void OnSyncWithDeviceProgress | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Updates the UI with the progress of the sync.

Parameters:
sender
args

Definition at line 320 of file Scenario7_SyncDevice.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    SyncProgressBar.Value = args.Progress;
                }));
        }

async Task SetupBackgroundTask ( ) [inline, private]

Registers for background task that will write to the device.

Definition at line 151 of file Scenario7_SyncDevice.xaml.cs.

        {
            if (TaskRequiresBackgroundAccess())
            {
                await BackgroundExecutionManager.RequestAccessAsync();
            }

            // Create background task to write
            var backgroundTaskBuilder = new BackgroundTaskBuilder();

            backgroundTaskBuilder.Name = SyncBackgroundTaskInformation.Name;
            backgroundTaskBuilder.TaskEntryPoint = SyncBackgroundTaskInformation.TaskEntryPoint;
            backgroundTaskBuilder.SetTrigger(syncBackgroundTaskTrigger);
            backgroundSyncTaskRegistration = backgroundTaskBuilder.Register();

            // Make sure we're notified when the task completes or if there is an update
            backgroundSyncTaskRegistration.Completed += new BackgroundTaskCompletedEventHandler(OnSyncWithDeviceCompleted);
            backgroundSyncTaskRegistration.Progress += new BackgroundTaskProgressEventHandler(OnSyncWithDeviceProgress);
        }

Task<DeviceTriggerResult> StartSyncBackgroundTaskAsync ( ) [inline, private]

Starts the background task that syncs with the device.

The trigger.RequestAsync() must be started on the UI thread because of the prompt that appears. The caller of StartSyncBackgroundTaskAsync() is responsible for running this method in the UI thread.

Returns:

Definition at line 178 of file Scenario7_SyncDevice.xaml.cs.

        {
            // Save the current device information so that we can reopen it after syncing
            syncDeviceInformation = EventHandlerForDevice.Current.DeviceInformation;
            syncDeviceSelector = EventHandlerForDevice.Current.DeviceSelector;

            // Allow the background task to open the device and sync with it.
            // We must close the device because Background tasks need to create new handle to the device and cannot reuse the one from this app.
            // Since the device is opened exclusively, the app must close the device before the background task can use the device.
            EventHandlerForDevice.Current.CloseDevice();

            return syncBackgroundTaskTrigger.RequestAsync(syncDeviceInformation.Id).AsTask();
        }

async void Sync_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 329 of file Scenario7_SyncDevice.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                rootPage.NotifyUser("Syncing in the background...", NotifyType.StatusMessage);

                // Reset progress bar
                SyncProgressBar.Value = 0;

                await SyncWithDeviceAsync();

                UpdateButtonStates();
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task SyncWithDeviceAsync ( ) [inline, private]

Starts the background task that will sync with the device.

Returns:

Definition at line 197 of file Scenario7_SyncDevice.xaml.cs.

        {
            await SetupBackgroundTask();

            var deviceTriggerResult = await StartSyncBackgroundTaskAsync();

            // Determine if we are allowed to sync
            String errorMessage = null;

            switch (deviceTriggerResult)
            {
                case DeviceTriggerResult.Allowed:
                    isSyncing = true;
                    break;

                case DeviceTriggerResult.LowBattery:
                    isSyncing = false;
                    errorMessage = "Insufficient battery to start sync";
                    break;

                case DeviceTriggerResult.DeniedByUser:
                    isSyncing = false;
                    errorMessage = "User declined the operation";
                    break;

                case DeviceTriggerResult.DeniedBySystem:
                    isSyncing = false;
                    errorMessage = "Sync operation was denied by the system";
                    break;

                default:
                    isSyncing = false;
                    errorMessage = "Failed to initiate sync";
                    break;
            }

            // Reopen device and print error message
            if (!isSyncing && errorMessage != null)
            {
                // Reopen the device once the background task is completed
                // Don't attempt to reconnect if the device failed to connect
                var isDeviceSuccessfullyConnected = await EventHandlerForDevice.Current.OpenDeviceAsync(syncDeviceInformation, syncDeviceSelector);

                if (!isDeviceSuccessfullyConnected)
                {
                    EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
                }

                syncDeviceInformation = null;
                syncDeviceSelector = null;

                rootPage.NotifyUser("Unable to sync: " + errorMessage, NotifyType.ErrorMessage);
            }
        }

static bool TaskRequiresBackgroundAccess ( ) [inline, static]

Determine if task with given name requires background access.

Windows Phone apps always require special permission to run background tasks.

Definition at line 50 of file Scenario7_SyncDevice.xaml.cs.

        {
#if WINDOWS_PHONE_APP
            return true;
#else
            return false;
#endif
        }

void UpdateButtonStates ( ) [inline, private]

Definition at line 362 of file Scenario7_SyncDevice.xaml.cs.

        {
            ButtonSync.IsEnabled = !isSyncing;
            ButtonCancelSync.IsEnabled = isSyncing;
        }

Member Data Documentation

BackgroundTaskRegistration backgroundSyncTaskRegistration [private]

Definition at line 37 of file Scenario7_SyncDevice.xaml.cs.

Boolean isSyncing [private]

Definition at line 38 of file Scenario7_SyncDevice.xaml.cs.

Boolean navigatedAway [private]

Definition at line 44 of file Scenario7_SyncDevice.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 35 of file Scenario7_SyncDevice.xaml.cs.

DeviceUseTrigger syncBackgroundTaskTrigger = null [static, private]

Definition at line 31 of file Scenario7_SyncDevice.xaml.cs.

DeviceInformation syncDeviceInformation [private]

Definition at line 40 of file Scenario7_SyncDevice.xaml.cs.

String syncDeviceSelector [private]

Definition at line 41 of file Scenario7_SyncDevice.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Scenario7_SyncDevice.xaml.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • SuperMutt
Classes | Public Attributes | Static Public Attributes

SuperMutt Class Reference

List of all members.

Classes

class | Pipe
class | VendorCommand

Public Attributes

const UInt16 | DevicePid = 0x0611
const UInt16 | DeviceVid = 0x045E

Static Public Attributes

static Guid | DeviceInterfaceClass = new Guid("{875d47fc-d331-4663-b339-624001a2dc5e}")

Detailed Description

Definition at line 161 of file SampleConfiguration.cs.

Member Data Documentation

Guid DeviceInterfaceClass = new Guid("{875d47fc-d331-4663-b339-624001a2dc5e}") [static]

Definition at line 179 of file SampleConfiguration.cs.

const UInt16 DevicePid = 0x0611

Definition at line 178 of file SampleConfiguration.cs.

const UInt16 DeviceVid = 0x045E

Definition at line 177 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::Pipe Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • SuperMutt
  • SuperMutt::Pipe
Public Attributes

SuperMutt::Pipe Class Reference

List of all members.

Public Attributes

const UInt32 | BulkInPipeIndex = 0
const UInt32 | BulkOutPipeIndex = 0
const UInt32 | InterruptInPipeIndex = 0
const UInt32 | InterruptOutPipeIndex = 0

Detailed Description

Definition at line 169 of file SampleConfiguration.cs.

Member Data Documentation

const UInt32 BulkInPipeIndex = 0

Definition at line 173 of file SampleConfiguration.cs.

const UInt32 BulkOutPipeIndex = 0

Definition at line 174 of file SampleConfiguration.cs.

const UInt32 InterruptInPipeIndex = 0

Definition at line 171 of file SampleConfiguration.cs.

const UInt32 InterruptOutPipeIndex = 0

Definition at line 172 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuperMutt::VendorCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • SuperMutt
  • SuperMutt::VendorCommand
Public Attributes

SuperMutt::VendorCommand Class Reference

List of all members.

Public Attributes

const Byte | GetLedBlinkPattern = 0x03
const Byte | SetLedBlinkPattern = 0x03

Detailed Description

Definition at line 163 of file SampleConfiguration.cs.

Member Data Documentation

const Byte GetLedBlinkPattern = 0x03

Definition at line 165 of file SampleConfiguration.cs.

const Byte SetLedBlinkPattern = 0x03

Definition at line 166 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SyncBackgroundTaskInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • SyncBackgroundTaskInformation
Public Attributes

SyncBackgroundTaskInformation Class Reference

List of all members.

Public Attributes

const String | Name = "SyncBackgroundTask"
const String | TaskCanceled = "Canceled"
const String | TaskCompleted = "Completed"
const String | TaskEntryPoint = "BackgroundTask.IoSyncBackgroundTask"

Detailed Description

Definition at line 109 of file SampleConfiguration.cs.

Member Data Documentation

const String Name = "SyncBackgroundTask"

Definition at line 111 of file SampleConfiguration.cs.

const String TaskCanceled = "Canceled"

Definition at line 113 of file SampleConfiguration.cs.

const String TaskCompleted = "Completed"

Definition at line 114 of file SampleConfiguration.cs.

const String TaskEntryPoint = "BackgroundTask.IoSyncBackgroundTask"

Definition at line 112 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utilities Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomUsbDeviceAccess
  • Utilities
Static Public Member Functions

Utilities Class Reference

List of all members.

Static Public Member Functions

static DeviceType | GetDeviceType (UsbDevice device)
static Boolean | IsSuperMuttDevice (UsbDevice device)
static void | NotifyDeviceNotConnected ()
static void | SetUpDeviceScenarios (Dictionary< DeviceType, UIElement > scenarios, UIElement scenarioContainer)

Detailed Description

Definition at line 24 of file Utilities.cs.

Member Function Documentation

static DeviceType GetDeviceType ( UsbDevice device ) [inline, static]

Device type of the device provided device.

Parameters:
device
Returns:
The DeviceType of the device or DeviceType.None if there are no devices connected or is not recognized

Definition at line 73 of file Utilities.cs.

        {
            if (device != null)
            {
                if (device.DeviceDescriptor.VendorId == OsrFx2.DeviceVid
                    && device.DeviceDescriptor.ProductId == OsrFx2.DevicePid)
                {
                    return DeviceType.OsrFx2;
                }
                else if (device.DeviceDescriptor.VendorId == SuperMutt.DeviceVid
                    && device.DeviceDescriptor.ProductId == SuperMutt.DevicePid)
                {
                    return DeviceType.SuperMutt;
                }
            }

            return DeviceType.None;
        }

static Boolean IsSuperMuttDevice ( UsbDevice device ) [inline, static]

Definition at line 92 of file Utilities.cs.

        {
            return (GetDeviceType(device) == DeviceType.SuperMutt);
        }

static void NotifyDeviceNotConnected ( void ) [inline, static]

Prints an error message stating that device is not connected.

Definition at line 100 of file Utilities.cs.

        {
            MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
        }

static void SetUpDeviceScenarios | ( | Dictionary< DeviceType, UIElement > | scenarios,
 |  | UIElement | scenarioContainer |
 | ) |  |  | [inline, static]

Displays the compatible scenarios and hides the non-compatible ones.

If there are no supported devices, the scenarioContainer will be hidden and an error message will be displayed.

Parameters:
scenarios | The key is the device type that the value, scenario, supports.
scenarioContainer | The container that encompasses all the scenarios that are specific to devices

Definition at line 33 of file Utilities.cs.

        {
            UIElement supportedScenario = null;

            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                foreach (KeyValuePair<DeviceType, UIElement> deviceScenario in scenarios)
                {
                    // Enable the scenario if it's generic or the device type matches
                    if ((deviceScenario.Key == DeviceType.All)
                        || (deviceScenario.Key == Utilities.GetDeviceType(EventHandlerForDevice.Current.Device)))
                    {
                        // Make the scenario visible in case other devices use the same scenario and collapsed it.
                        deviceScenario.Value.Visibility = Visibility.Visible;

                        supportedScenario = deviceScenario.Value;
                    }
                    else if (deviceScenario.Value != supportedScenario)
                    {
                        // Don't hide the scenario if it is supported by the current device and is shared by other devices

                        deviceScenario.Value.Visibility = Visibility.Collapsed;
                    }
                }
            }

            if (supportedScenario == null)
            {
                // Hide the container so that common elements shared across scenarios are also hidden
                scenarioContainer.Visibility = Visibility.Collapsed;

                NotifyDeviceNotConnected();
            }
        }

The documentation for this class was generated from the following file:
  • CustomUsbDeviceAccess/cs/Utilities.cs
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomVertexShaderMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomVertexShader
  • CustomVertexShaderMain
Public Member Functions | Private Attributes

CustomVertexShaderMain Class Reference

#include "CustomVertexShaderMain.h"

List of all members.

Public Member Functions

CustomVertexShaderMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~CustomVertexShaderMain ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()
void | UpdateManipulationState (_In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< SampleOverlay > | m_sampleOverlay
std::unique_ptr
< CustomVertexShaderRenderer > 		m_sceneRenderer
BasicTimer m_timer

Detailed Description

Definition at line 22 of file CustomVertexShaderMain.h.

Constructor & Destructor Documentation

CustomVertexShaderMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file CustomVertexShaderMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    m_sceneRenderer = std::unique_ptr<CustomVertexShaderRenderer>(new CustomVertexShaderRenderer(m_deviceResources));
    m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D Custom Vertex Shader Effect"));
}

~CustomVertexShaderMain ( )

Definition at line 34 of file CustomVertexShaderMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void CreateWindowSizeDependentResources ( )

Definition at line 41 of file CustomVertexShaderMain.cpp.

{
    m_sceneRenderer->CreateWindowSizeDependentResources();
    m_sampleOverlay->CreateWindowSizeDependentResources();
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void OnDeviceLost ( ) [virtual]

Definition at line 69 of file CustomVertexShaderMain.cpp.

{
    m_sceneRenderer->ReleaseDeviceDependentResources();
    m_sampleOverlay->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 76 of file CustomVertexShaderMain.cpp.

{
    m_sceneRenderer->CreateDeviceDependentResources();
    m_sampleOverlay->CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

bool Render ( )

Definition at line 60 of file CustomVertexShaderMain.cpp.

{
    m_sceneRenderer->Render();
    m_sampleOverlay->Render();

    return true;
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void Update ( )

Definition at line 53 of file CustomVertexShaderMain.cpp.

{
    m_sceneRenderer->Update();
}

void UpdateManipulationState ( _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ args )

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 42 of file CustomVertexShaderMain.h.

std::unique_ptr<SampleOverlay> m_sampleOverlay [private]

Definition at line 45 of file CustomVertexShaderMain.h.

std::unique_ptr<CustomVertexShaderRenderer> m_sceneRenderer [private]

Definition at line 44 of file CustomVertexShaderMain.h.

BasicTimer m_timer [private]

Definition at line 47 of file CustomVertexShaderMain.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.h
  • D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.cpp
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomVertexShaderRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomVertexShader
  • CustomVertexShaderRenderer
Public Member Functions | Private Member Functions | Private Attributes

CustomVertexShaderRenderer Class Reference

#include "CustomVertexShaderRenderer.h"

List of all members.

Public Member Functions

CustomVertexShaderRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateWindowSizeDependentResources ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Update ()
void | UpdateManipulationState (_In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args)

Private Member Functions

void | UpdateImageScale (float scale)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< IWICFormatConverter > 		m_formatConvert
Platform::Agile
< Windows::UI::Input::GestureRecognizer > 		m_gestureRecognizer
D2D1_SIZE_U | m_imageSize
Microsoft::WRL::ComPtr
< ID2D1ImageSourceFromWic > 		m_imageSource
bool | m_isWindowClosed
float | m_skewX
float | m_skewY
BasicTimer m_timer
Microsoft::WRL::ComPtr
< ID2D1TransformedImageSource > 		m_transformedImage
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_waveEffect

Detailed Description

Definition at line 21 of file CustomVertexShaderRenderer.h.

Constructor & Destructor Documentation

CustomVertexShaderRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 22 of file CustomVertexShaderRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    m_timer = ref new BasicTimer();

    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 70 of file CustomVertexShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // Load the image from WIC using ImageSource. The image is scaled using
    // ID2D1TransformedImageSource which is dependent on the scale factor.
    DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));

    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_CustomWaveEffect, &m_waveEffect));
}

void CreateDeviceIndependentResources ( )

Definition at line 32 of file CustomVertexShaderRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();
    auto d2dFactory = m_deviceResources->GetD2DFactory();

    // Create WIC Decoder to read JPG file.
    ComPtr<IWICBitmapDecoder> decoder;
    DX::ThrowIfFailed(
        wicFactory->CreateDecoderFromFilename(
        L"Assets\\rainier.jpg",
        nullptr,
        GENERIC_READ,
        WICDecodeMetadataCacheOnDemand,
        &decoder
        ));

    ComPtr<IWICBitmapFrameDecode> frame;
    DX::ThrowIfFailed(decoder->GetFrame(0, &frame));

    DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
    DX::ThrowIfFailed(m_formatConvert->Initialize(
        frame.Get(),
        GUID_WICPixelFormat32bppPBGRA, // 32bppPBGRA is used by Direct2D.
        WICBitmapDitherTypeNone,
        nullptr,
        0.0f,
        WICBitmapPaletteTypeCustom
        ));

    UINT width;
    UINT height;
    DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
    m_imageSize = D2D1::SizeU(width, height);

    // Register the custom wave effect.
    DX::ThrowIfFailed(WaveEffect::Register(d2dFactory));
}

void CreateWindowSizeDependentResources ( )

Definition at line 88 of file CustomVertexShaderRenderer.cpp.

{
    auto size = m_deviceResources->GetLogicalSize();
    float scale = size.Width / m_imageSize.width;

    UpdateImageScale(scale);
}

void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void ReleaseDeviceDependentResources ( )

Definition at line 81 of file CustomVertexShaderRenderer.cpp.

{
    m_imageSource.Reset();
    m_waveEffect.Reset();
    m_transformedImage.Reset();
}

void Render ( )

Definition at line 139 of file CustomVertexShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->BeginDraw();
    m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    d2dContext->DrawImage(m_waveEffect.Get());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void Update ( )

Definition at line 129 of file CustomVertexShaderRenderer.cpp.

{
    m_timer->Update();

    // The wave ripples over time.
    DX::ThrowIfFailed(
        m_waveEffect->SetValue(WAVE_PROP_OFFSET, m_timer->Total)
        );
}

void UpdateImageScale ( float scale ) [private]

Definition at line 97 of file CustomVertexShaderRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // When using ID2D1ImageSource, the recommend method of applying a transform
    // is to use ID2D1TransformedImageSource. It is inexpensive to recreate this object.
    D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
    {
        D2D1_ORIENTATION_DEFAULT,
        scale,
        scale,
        D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
        D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE
    };

    DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
        m_imageSource.Get(),
        &props,
        &m_transformedImage));

    m_waveEffect->SetInput(0, m_transformedImage.Get());
}

void UpdateManipulationState ( _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ args )

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 42 of file CustomVertexShaderRenderer.h.

Microsoft::WRL::ComPtr<IWICFormatConverter> m_formatConvert [private]

Definition at line 44 of file CustomVertexShaderRenderer.h.

Platform::Agile<Windows::UI::Input::GestureRecognizer> m_gestureRecognizer [private]

Definition at line 43 of file CustomVertexShaderRenderer.h.

D2D1_SIZE_U m_imageSize [private]

Definition at line 49 of file CustomVertexShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic> m_imageSource [private]

Definition at line 45 of file CustomVertexShaderRenderer.h.

bool m_isWindowClosed [private]

Definition at line 53 of file CustomVertexShaderRenderer.h.

float m_skewX [private]

Definition at line 51 of file CustomVertexShaderRenderer.h.

float m_skewY [private]

Definition at line 52 of file CustomVertexShaderRenderer.h.

BasicTimer m_timer [private]

Definition at line 55 of file CustomVertexShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1TransformedImageSource> m_transformedImage [private]

Definition at line 46 of file CustomVertexShaderRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_waveEffect [private]

Definition at line 47 of file CustomVertexShaderRenderer.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.h
  • D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.cpp
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomVertexShader
  • SampleOverlay
Public Member Functions | Private Attributes

SampleOverlay Class Reference

#include "SampleOverlay.h"

List of all members.

Public Member Functions

SampleOverlay (const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
float | GetTitleHeightInDips ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::wstring | m_caption
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawOverlay
UINT | m_idIncrement
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
float | m_overlayWidth
float | m_padding
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_textVerticalOffset
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 21 of file SampleOverlay.h.

Constructor & Destructor Documentation

SampleOverlay | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | const std::wstring & | caption
 | ) |  |

Definition at line 24 of file SampleOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_caption(caption),
    m_drawOverlay(true)
{
    m_padding = 8.0f;
    m_textVerticalOffset = 7.0f;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);
    m_overlayWidth = 0.0f;

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 38 of file SampleOverlay.cpp.

{
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
        );

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
            L"Assets\\storelogo-sdk.png",
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
            )
        );

    double dpiX = 96.0;
    double dpiY = 96.0;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    ComPtr<IDWriteTextFormat> nameTextFormat;
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            36.0f,
            L"en-US",
            &nameTextFormat
            )
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            m_caption.c_str(),
            static_cast<UINT32>(m_caption.size()),
            nameTextFormat.Get(),
            4096.0f,
            4096.0f,
            &m_textLayout
            )
        );

    DWRITE_TEXT_METRICS metrics = {0};
    DX::ThrowIfFailed(
        m_textLayout->GetMetrics(&metrics)
        );

    m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 141 of file SampleOverlay.cpp.

{
    if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
    {
        m_drawOverlay = false;
    }
    else
    {
        m_drawOverlay = true;
    }
}

float GetTitleHeightInDips ( )

Definition at line 192 of file SampleOverlay.cpp.

{
    return m_logoSize.height + m_padding;
}

void ReleaseDeviceDependentResources ( )

Definition at line 155 of file SampleOverlay.cpp.

{
    m_whiteBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( )

Definition at line 161 of file SampleOverlay.cpp.

{
    if (m_drawOverlay)
    {
        m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());

        m_deviceResources->GetD2DDeviceContext()->BeginDraw();
        m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
        m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
            );

        m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
            m_textLayout.Get(),
            m_whiteBrush.Get()
            );

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }

        m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
    }
}

Member Data Documentation

std::wstring m_caption [private]

Definition at line 42 of file SampleOverlay.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 32 of file SampleOverlay.h.

bool m_drawOverlay [private]

Definition at line 41 of file SampleOverlay.h.

UINT m_idIncrement [private]

Definition at line 40 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 37 of file SampleOverlay.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 45 of file SampleOverlay.h.

float m_overlayWidth [private]

Definition at line 46 of file SampleOverlay.h.

float m_padding [private]

Definition at line 43 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 35 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 38 of file SampleOverlay.h.

float m_textVerticalOffset [private]

Definition at line 44 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 34 of file SampleOverlay.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/VertexShader/SampleOverlay.h
  • D2DCustomEffects/cpp/VertexShader/SampleOverlay.cpp
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • CustomVertexShader
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnManipulationUpdated (_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnPointerMoved (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::PointerEventArgs^args)
void | OnPointerPressed (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::PointerEventArgs^args)
void | OnPointerReleased (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::PointerEventArgs^args)
void | OnPointerWheelChanged (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::PointerEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::UI::Input::GestureRecognizer | m_gestureRecognizer
std::unique_ptr
< CustomVertexShaderMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 21 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnManipulationUpdated | ( | _In_ Windows::UI::Input::GestureRecognizer^ | sender,
 |  | _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnPointerMoved | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnPointerPressed | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnPointerReleased | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnPointerWheelChanged | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 76 of file App.h.

Windows::UI::Input::GestureRecognizer m_gestureRecognizer [private]

Definition at line 80 of file App.h.

std::unique_ptr<CustomVertexShaderMain> m_main [private]

Definition at line 77 of file App.h.

bool m_windowClosed [private]

Definition at line 78 of file App.h.

bool m_windowVisible [private]

Definition at line 79 of file App.h.

The documentation for this class was generated from the following file:
  • D2DCustomEffects/cpp/VertexShader/App.h
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Cylinder Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Cylinder Class Reference

#include "Cylinder.h"

Inherits GameObject.

List of all members.

Public Member Functions

Cylinder ()
Cylinder (DirectX::XMFLOAT3 position, float radius, DirectX::XMFLOAT3 direction)
virtual bool | IsTouching (DirectX::XMFLOAT3 point, float radius, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) override

Protected Member Functions

virtual void | UpdatePosition () override

Private Member Functions

void | Initialize (DirectX::XMFLOAT3 position, float radius, DirectX::XMFLOAT3 direction)

Private Attributes

DirectX::XMFLOAT3 | m_axis
float | m_length
float | m_radius
DirectX::XMFLOAT4X4 | m_rotationMatrix

Detailed Description

Definition at line 22 of file Cylinder.h.

Constructor & Destructor Documentation

Cylinder ( )

Definition at line 17 of file Cylinder.cpp.

{
    Initialize(XMFLOAT3(0.0f, 0.0f, 0.0f), 1.0f, XMFLOAT3(0.0f, 0.0f, 1.0f));
}

Cylinder | ( | DirectX::XMFLOAT3 | position,
 |  | float | radius,
 |  | DirectX::XMFLOAT3 | direction
 | ) |  |

Member Function Documentation

void Initialize | ( | DirectX::XMFLOAT3 | position,
 |  | float | radius,
 |  | DirectX::XMFLOAT3 | direction |
 | ) |  |  | [private]
virtual bool IsTouching | ( | DirectX::XMFLOAT3 | point,
 |  | float | radius,
 |  | _Out_ DirectX::XMFLOAT3 * | contact,
 |  | _Out_ DirectX::XMFLOAT3 * | normal |
 | ) |  |  | [override, virtual]

Reimplemented from GameObject.

void UpdatePosition ( ) [override, protected, virtual]

Reimplemented from GameObject.

Definition at line 65 of file Cylinder.cpp.

{
    XMStoreFloat4x4(
        &m_modelMatrix,
        XMMatrixScaling(m_radius, m_radius, m_length) *
        XMLoadFloat4x4(&m_rotationMatrix) *
        XMMatrixTranslation(m_position.x, m_position.y, m_position.z)
        );
}

Member Data Documentation

DirectX::XMFLOAT3 m_axis [private]

Definition at line 49 of file Cylinder.h.

float m_length [private]

Definition at line 50 of file Cylinder.h.

float m_radius [private]

Definition at line 51 of file Cylinder.h.

DirectX::XMFLOAT4X4 m_rotationMatrix [private]

Definition at line 52 of file Cylinder.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Cylinder.h
  • Simple3DGameDX/cppwinrt/GameContent/Cylinder.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CylinderMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

CylinderMesh Class Reference

#include "CylinderMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

CylinderMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device, uint16_t segments)

Detailed Description

Definition at line 22 of file CylinderMesh.h.

Constructor & Destructor Documentation

CylinderMesh | ( | _In_ winrt::com_ptr< ID3D11Device3 > const & | device,
 |  | uint16_t | segments
 | ) |  |

Definition at line 18 of file CylinderMesh.cpp.

{
    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    uint16_t numVertices = 6 * (segments + 1) + 1;
    uint16_t numIndices = 3 * segments * 3 * 2;

    std::vector<PNTVertex> point(numVertices);
    std::vector<uint16_t> index(numIndices);

    uint16_t p = 0;
    // Top center point (multiple points for texture coordinates).
    for (uint16_t a = 0; a <= segments; a++)
    {
        point[p].position = XMFLOAT3(0.0f, 0.0f, 1.0f);
        point[p].normal = XMFLOAT3(0.0f, 0.0f, 1.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 0.0f);
        p++;
    }
    // Top edge of cylinder: Normals point up for lighting of top surface.
    for (uint16_t a = 0; a <= segments; a++)
    {
        float angle = static_cast<float>(a) / static_cast<float>(segments) * XM_2PI;
        point[p].position = XMFLOAT3(cos(angle), sin(angle), 1.0f);
        point[p].normal = XMFLOAT3(0.0f, 0.0f, 1.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 0.0f);
        p++;
    }
    // Top edge of cylinder: Normals point out for lighting of the side surface.
    for (uint16_t a = 0; a <= segments; a++)
    {
        float angle = static_cast<float>(a) / static_cast<float>(segments) * XM_2PI;
        point[p].position = XMFLOAT3(cos(angle), sin(angle), 1.0f);
        point[p].normal = XMFLOAT3(cos(angle), sin(angle), 0.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 0.0f);
        p++;
    }
    // Bottom edge of cylinder: Normals point out for lighting of the side surface.
    for (uint16_t a = 0; a <= segments; a++)
    {
        float angle = static_cast<float>(a) / static_cast<float>(segments) * XM_2PI;
        point[p].position = XMFLOAT3(cos(angle), sin(angle), 0.0f);
        point[p].normal = XMFLOAT3(cos(angle), sin(angle), 0.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 1.0f);
        p++;
    }
    // Bottom edge of cylinder: Normals point down for lighting of the bottom surface.
    for (uint16_t a = 0; a <= segments; a++)
    {
        float angle = static_cast<float>(a) / static_cast<float>(segments) * XM_2PI;
        point[p].position = XMFLOAT3(cos(angle), sin(angle), 0.0f);
        point[p].normal = XMFLOAT3(0.0f, 0.0f, -1.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 1.0f);
        p++;
    }
    // Bottom center of cylinder: Normals point down for lighting on the bottom surface.
    for (uint16_t a = 0; a <= segments; a++)
    {
        point[p].position = XMFLOAT3(0.0f, 0.0f, 0.0f);
        point[p].normal = XMFLOAT3(0.0f, 0.0f, -1.0f);
        point[p].textureCoordinate = XMFLOAT2(static_cast<float>(a) / static_cast<float>(segments), 1.0f);
        p++;
    }
    m_vertexCount = p;

    p = 0;
    for (uint16_t a = 0; a < 6; a += 2)
    {
        uint16_t p1 = a * (segments + 1);
        uint16_t p2 = (a + 1) * (segments + 1);
        for (uint16_t b = 0; b < segments; b++)
        {
            if (a < 4)
            {
                index[p] = b + p1;
                index[p + 1] = b + p2;
                index[p + 2] = b + p2 + 1;
                p = p + 3;
            }
            if (a > 0)
            {
                index[p] = b + p1;
                index[p + 1] = b + p2 + 1;
                index[p + 2] = b + p1 + 1;
                p = p + 3;
            }
        }
    }
    m_indexCount = p;

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = point.data();
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(uint16_t) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = index.data();
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImagesRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DAdvancedColorImages
  • D2DAdvancedColorImagesRenderer
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

D2DAdvancedColorImagesRenderer Class Reference

#include "D2DAdvancedColorImagesRenderer.h"

List of all members.

Public Member Functions

D2DAdvancedColorImagesRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~D2DAdvancedColorImagesRenderer ()
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateImageDependentResources ()
void | CreateWindowSizeDependentResources ()
void | Draw ()
float | FitImageToWindow ()
ImageInfo | LoadImageFromWic (_In_ IStream *imageStream)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | PopulateImageInfoACKind (_Inout_ ImageInfo *info)
void | ReleaseDeviceDependentResources ()
void | ReleaseImageDependentResources ()
void | SetRenderOptions (RenderEffectKind effect, float brightnessAdjustment, Windows::Graphics::Display::AdvancedColorInfo^acInfo)
void | UpdateManipulationState (_In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args)

Private Member Functions

void | ComputeHdrMetadata ()
void | CreateHistogramResources ()
void | EmitHdrMetadata ()
ImageInfo | LoadImageCommon (_In_ IWICBitmapSource *source)
void | UpdateImageColorContext ()
void | UpdateImageTransformState ()
void | UpdateWhiteLevelScale (float brightnessAdjustment, float sdrWhiteLevel)

Static Private Member Functions

static float | Clamp (float v, float bound1, float bound2)

Private Attributes

float | m_brightnessAdjust
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_colorManagementEffect
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Display::AdvancedColorInfo | m_dispInfo
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_filmicEffect
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_finalOutput
Microsoft::WRL::ComPtr
< IWICFormatConverter > 		m_formatConvert
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_heatmapEffect
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_histogramEffect
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_histogramPrescale
ImageInfo m_imageInfo
D2D1_POINT_2F | m_imageOffset
Microsoft::WRL::ComPtr
< ID2D1ImageSourceFromWic > 		m_imageSource
bool | m_isComputeSupported
float | m_maxCLL
float | m_minZoom
D2D1_POINT_2F | m_pointerPos
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_reinhardEffect
RenderEffectKind m_renderEffectKind
Microsoft::WRL::ComPtr
< ID2D1TransformedImageSource > 		m_scaledImage
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_sdrOverlayEffect
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_whiteScaleEffect
Microsoft::WRL::ComPtr
< IWICColorContext > 		m_wicColorContext
float | m_zoom

Detailed Description

Definition at line 33 of file D2DAdvancedColorImagesRenderer.h.

Constructor & Destructor Documentation

D2DAdvancedColorImagesRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 42 of file D2DAdvancedColorImagesRenderer.cpp.

      :
    m_deviceResources(deviceResources),
    m_renderEffectKind(RenderEffectKind::None),
    m_zoom(1.0f),
    m_minZoom(1.0f), // Dynamically calculated on window size.
    m_imageOffset(),
    m_pointerPos(),
    m_maxCLL(-1.0f),
    m_brightnessAdjust(1.0f),
    m_imageInfo{},

~D2DAdvancedColorImagesRenderer ( )

Definition at line 64 of file D2DAdvancedColorImagesRenderer.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

static float Clamp | ( | float | v,
 |  | float | bound1,
 |  | float | bound2 |
 | ) |  |  | [inline, static, private]

Definition at line 70 of file D2DAdvancedColorImagesRenderer.h.

        {
            float low = min(bound1, bound2);
            float high = max(bound1, bound2);
            return (v < low) ? low : (v > high) ? high : v;
        }

void ComputeHdrMetadata ( ) [private]

Definition at line 710 of file D2DAdvancedColorImagesRenderer.cpp.

{
    // Initialize with a sentinel value.
    m_maxCLL = -1.0f;

    // MaxCLL is not meaningful for SDR or WCG images.
    if ((!m_isComputeSupported) ||
        (m_imageInfo.imageKind != AdvancedColorKind::HighDynamicRange))
    {
        return;
    }

    // MaxCLL is nominally calculated for the single brightest pixel in a frame.
    // But we take a slightly more conservative definition that takes the 99.99th percentile
    // to account for extreme outliers in the image.
    float maxCLLPercent = 0.9999f;

    auto ctx = m_deviceResources->GetD2DDeviceContext();

    ctx->BeginDraw();

    ctx->DrawImage(m_histogramEffect.Get());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = ctx->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    float *histogramData = new float[sc_histNumBins];
    DX::ThrowIfFailed(
        m_histogramEffect->GetValue(D2D1_HISTOGRAM_PROP_HISTOGRAM_OUTPUT,
            reinterpret_cast<BYTE*>(histogramData),
            sc_histNumBins * sizeof(float)
            )
        );

    unsigned int maxCLLbin = 0;
    float runningSum = 0.0f; // Cumulative sum of values in histogram is 1.0.
    for (int i = sc_histNumBins - 1; i >= 0; i--)
    {
        runningSum += histogramData[i];
        maxCLLbin = i;

        if (runningSum >= 1.0f - maxCLLPercent)
        {
            break;
        }
    }

    float binNorm = static_cast<float>(maxCLLbin) / static_cast<float>(sc_histNumBins);
    m_maxCLL = powf(binNorm, 1 / sc_histGamma) * sc_histMaxNits;

    // Some drivers have a bug where histogram will always return 0. Treat this as unknown.
    m_maxCLL = (m_maxCLL == 0.0f) ? -1.0f : m_maxCLL;
}

void CreateDeviceDependentResources ( )

Definition at line 90 of file D2DAdvancedColorImagesRenderer.cpp.

{
    // All this app's device-dependent resources also depend on
    // the loaded image, so they are all created in
    // CreateImageDependentResources.
}

void CreateDeviceIndependentResources ( )

Definition at line 70 of file D2DAdvancedColorImagesRenderer.cpp.

{
    // Register the custom render effects.
    DX::ThrowIfFailed(
        ReinhardEffect::Register(m_deviceResources->GetD2DFactory())
        );

    DX::ThrowIfFailed(
        FilmicEffect::Register(m_deviceResources->GetD2DFactory())
        );

    DX::ThrowIfFailed(
        SdrOverlayEffect::Register(m_deviceResources->GetD2DFactory())
        );

    DX::ThrowIfFailed(
        LuminanceHeatmapEffect::Register(m_deviceResources->GetD2DFactory())
        );
}

void CreateHistogramResources ( ) [private]

Definition at line 315 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto context = m_deviceResources->GetD2DDeviceContext();

    // We need to preprocess the image data before running the histogram.
    // 1. Spatial downscale to reduce the amount of processing needed.
    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_D2D1Scale, &m_histogramPrescale)
        );

    DX::ThrowIfFailed(
        m_histogramPrescale->SetValue(D2D1_SCALE_PROP_SCALE, D2D1::Vector2F(0.5f, 0.5f))
        );

    // The right place to compute HDR metadata is after color management to the
    // image's native colorspace but before any tonemapping or adjustments for the display.
    m_histogramPrescale->SetInputEffect(0, m_colorManagementEffect.Get());

    // 2. Convert scRGB data into luminance (nits).
    // 3. Normalize color values. Histogram operates on [0-1] numeric range,
    //    while FP16 can go up to 65504 (5+ million nits).
    // Both steps are performed in the same color matrix.
    ComPtr<ID2D1Effect> histogramMatrix;
    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_D2D1ColorMatrix, &histogramMatrix)
        );

    histogramMatrix->SetInputEffect(0, m_histogramPrescale.Get());

    float scale = sc_histMaxNits / sc_nominalRefWhite;

    D2D1_MATRIX_5X4_F rgbtoYnorm = D2D1::Matrix5x4F(
        0.2126f / scale, 0, 0, 0,
        0.7152f / scale, 0, 0, 0,
        0.0722f / scale, 0, 0, 0,
        0              , 0, 0, 1,
        0              , 0, 0, 0);
    // 1st column: [R] output, contains normalized Y (CIEXYZ).
    // 2nd column: [G] output, unused.
    // 3rd column: [B] output, unused.
    // 4th column: [A] output, alpha passthrough.
    // We explicitly calculate Y; this deviates from the CEA 861.3 definition of MaxCLL
    // which approximates luminance with max(R, G, B).

    DX::ThrowIfFailed(histogramMatrix->SetValue(D2D1_COLORMATRIX_PROP_COLOR_MATRIX, rgbtoYnorm));

    // 4. Apply a gamma to allocate more histogram bins to lower luminance levels.
    ComPtr<ID2D1Effect> histogramGamma;
    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_D2D1GammaTransfer, &histogramGamma)
        );

    histogramGamma->SetInputEffect(0, histogramMatrix.Get());

    // Gamma function offers an acceptable tradeoff between simplicity and efficient bin allocation.
    // A more sophisticated pipeline would use a more perceptually linear function than gamma.
    DX::ThrowIfFailed(histogramGamma->SetValue(D2D1_GAMMATRANSFER_PROP_RED_EXPONENT, sc_histGamma));
    // All other channels are passthrough.
    DX::ThrowIfFailed(histogramGamma->SetValue(D2D1_GAMMATRANSFER_PROP_GREEN_DISABLE, TRUE));
    DX::ThrowIfFailed(histogramGamma->SetValue(D2D1_GAMMATRANSFER_PROP_BLUE_DISABLE, TRUE));
    DX::ThrowIfFailed(histogramGamma->SetValue(D2D1_GAMMATRANSFER_PROP_ALPHA_DISABLE, TRUE));

    // 5. Finally, the histogram itself.
    HRESULT hr = context->CreateEffect(CLSID_D2D1Histogram, &m_histogramEffect);

    if (hr == D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES)
    {
        // The GPU doesn't support compute shaders and we can't run histogram on it.
        m_isComputeSupported = false;
    }
    else
    {
        DX::ThrowIfFailed(hr);
        m_isComputeSupported = true;

        DX::ThrowIfFailed(m_histogramEffect->SetValue(D2D1_HISTOGRAM_PROP_NUM_BINS, sc_histNumBins));

        m_histogramEffect->SetInputEffect(0, histogramGamma.Get());
    }
}

void CreateImageDependentResources ( )

Definition at line 223 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto d2dFactory = m_deviceResources->GetD2DFactory();
    auto context = m_deviceResources->GetD2DDeviceContext();

    // Load the image from WIC using ID2D1ImageSource.
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateImageSourceFromWic(
            m_formatConvert.Get(),
            &m_imageSource
            )
        );

    // Next, configure the app's effect pipeline, consisting of a color management effect
    // followed by a tone mapping effect.

    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_D2D1ColorManagement, &m_colorManagementEffect)
        );

    DX::ThrowIfFailed(
        m_colorManagementEffect->SetValue(
            D2D1_COLORMANAGEMENT_PROP_QUALITY,
            D2D1_COLORMANAGEMENT_QUALITY_BEST   // Required for floating point and DXGI color space support.
            )
        );

    // The color management effect takes a source color space and a destination color space,
    // and performs the appropriate math to convert images between them.
    UpdateImageColorContext();

    // The destination color space is the render target's (swap chain's) color space. This app uses an
    // FP16 swap chain, which requires the colorspace to be scRGB.
    ComPtr<ID2D1ColorContext1> destColorContext;
    DX::ThrowIfFailed(
        context->CreateColorContextFromDxgiColorSpace(
            DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709, // scRGB
            &destColorContext
            )
        );

    DX::ThrowIfFailed(
        m_colorManagementEffect->SetValue(
            D2D1_COLORMANAGEMENT_PROP_DESTINATION_COLOR_CONTEXT,
            destColorContext.Get()
            )
        );

    // White level scale is used to multiply the color values in the image; this allows the user
    // to adjust the brightness of the image on an HDR display.
    DX::ThrowIfFailed(context->CreateEffect(CLSID_D2D1ColorMatrix, &m_whiteScaleEffect));

    // Input to white level scale may be modified in SetRenderOptions.
    m_whiteScaleEffect->SetInputEffect(0, m_colorManagementEffect.Get());

    // Set the actual matrix in SetRenderOptions.

    // Instantiate and cache all of the tonemapping/render effects.
    // Each effect is implemented as a Direct2D custom effect; see the RenderEffects filter in the
    // Solution Explorer.
    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_CustomReinhardEffect, &m_reinhardEffect)
        );

    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_CustomFilmicEffect, &m_filmicEffect)
        );

    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_CustomSdrOverlayEffect, &m_sdrOverlayEffect)
        );

    DX::ThrowIfFailed(
        context->CreateEffect(CLSID_CustomLuminanceHeatmapEffect, &m_heatmapEffect)
        );

    m_reinhardEffect->SetInputEffect(0, m_whiteScaleEffect.Get());
    m_filmicEffect->SetInputEffect(0, m_whiteScaleEffect.Get());

    // For the following effects, we want white level scale to be applied after
    // tonemapping (otherwise brightness adjustments will affect numerical values).
    m_heatmapEffect->SetInputEffect(0, m_colorManagementEffect.Get());
    m_sdrOverlayEffect->SetInputEffect(0, m_colorManagementEffect.Get());

    // The remainder of the Direct2D effect graph is constructed in SetRenderOptions based on the
    // selected RenderEffectKind.

    CreateHistogramResources();
}

void CreateWindowSizeDependentResources ( )

Definition at line 103 of file D2DAdvancedColorImagesRenderer.cpp.

{
    FitImageToWindow();
}

void Draw ( )

Definition at line 821 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->BeginDraw();

    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));

    d2dContext->SetTransform(m_deviceResources->GetOrientationTransform2D());

    if (m_scaledImage)
    {
        d2dContext->DrawImage(m_finalOutput.Get(), m_imageOffset);

        EmitHdrMetadata();
    }

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    m_deviceResources->Present();
}

void EmitHdrMetadata ( ) [private]

Definition at line 770 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto acKind = m_dispInfo ? m_dispInfo->CurrentAdvancedColorKind : AdvancedColorKind::StandardDynamicRange;

    if (acKind == AdvancedColorKind::HighDynamicRange)
    {
        DXGI_HDR_METADATA_HDR10 metadata = {};

        // This sample doesn't do any chrominance (e.g. xy) gamut mapping, so just use default
        // color primaries values; a more sophisticated app will explicitly set these.
        // DXGI_HDR_METADATA_HDR10 defines primaries as 1/50000 of a unit in xy space.
        metadata.RedPrimary[0]   = static_cast<UINT16>(m_dispInfo->RedPrimary.X   * 50000.0f);
        metadata.RedPrimary[1]   = static_cast<UINT16>(m_dispInfo->RedPrimary.Y   * 50000.0f);
        metadata.GreenPrimary[0] = static_cast<UINT16>(m_dispInfo->GreenPrimary.X * 50000.0f);
        metadata.GreenPrimary[1] = static_cast<UINT16>(m_dispInfo->GreenPrimary.Y * 50000.0f);
        metadata.BluePrimary[0]  = static_cast<UINT16>(m_dispInfo->BluePrimary.X  * 50000.0f);
        metadata.BluePrimary[1]  = static_cast<UINT16>(m_dispInfo->BluePrimary.Y  * 50000.0f);
        metadata.WhitePoint[0]   = static_cast<UINT16>(m_dispInfo->WhitePoint.X   * 50000.0f);
        metadata.WhitePoint[1]   = static_cast<UINT16>(m_dispInfo->WhitePoint.Y   * 50000.0f);

        float effectiveMaxCLL = 0;

        switch (m_renderEffectKind)
        {
        // Currently only the "None" render effect results in pixel values that exceed
        // the OS-specified SDR white level, as it just passes through HDR color values.
        case RenderEffectKind::None:
            effectiveMaxCLL = max(m_maxCLL, 0.0f) * m_brightnessAdjust;
            break;

        default:
            effectiveMaxCLL = m_dispInfo->SdrWhiteLevelInNits * m_brightnessAdjust;
            break;
        }

        // DXGI_HDR_METADATA_HDR10 defines MaxCLL in integer nits.
        metadata.MaxContentLightLevel = static_cast<UINT16>(effectiveMaxCLL);

        // The luminance analysis doesn't calculate MaxFrameAverageLightLevel. We also don't have mastering
        // information (i.e. reference display in a studio), so Min/MaxMasteringLuminance is not relevant.
        // Leave these values as 0.

        auto sc = m_deviceResources->GetSwapChain();

        ComPtr<IDXGISwapChain4> sc4;
        DX::ThrowIfFailed(sc->QueryInterface(IID_PPV_ARGS(&sc4)));
        DX::ThrowIfFailed(sc4->SetHDRMetaData(DXGI_HDR_METADATA_TYPE_HDR10, sizeof(metadata), &metadata));
    }
}

float FitImageToWindow ( )

Definition at line 447 of file D2DAdvancedColorImagesRenderer.cpp.

{
    if (m_imageSource)
    {
        Size panelSize = m_deviceResources->GetLogicalSize();

        // Set image to be letterboxed in the window, up to the max allowed scale factor.
        float letterboxZoom = min(
            panelSize.Width / m_imageInfo.size.Width,
            panelSize.Height / m_imageInfo.size.Height);

        m_zoom = min(sc_MaxZoom, letterboxZoom);

        // Center the image.
        m_imageOffset = D2D1::Point2F(
            (panelSize.Width - (m_imageInfo.size.Width * m_zoom)) / 2.0f,
            (panelSize.Height - (m_imageInfo.size.Height * m_zoom)) / 2.0f
            );

        UpdateImageTransformState();

        // HDR metadata is supposed to be independent of any rendering options, but
        // we can't compute it until the full effect graph is hooked up, which is here.
        ComputeHdrMetadata();
    }

    return m_maxCLL;
}

ImageInfo LoadImageCommon ( _In_ IWICBitmapSource * source ) [private]

Definition at line 478 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();
    m_imageInfo = {};

    // Attempt to read the embedded color profile from the image; only valid for WIC images.
    ComPtr<IWICBitmapFrameDecode> frame;
    if (SUCCEEDED(source->QueryInterface(IID_PPV_ARGS(&frame))))
    {
        DX::ThrowIfFailed(
            wicFactory->CreateColorContext(&m_wicColorContext)
            );

        DX::ThrowIfFailed(
            frame->GetColorContexts(
                1,
                m_wicColorContext.GetAddressOf(),
                &m_imageInfo.numProfiles
                )
            );
    }

    // Check whether the image data is natively stored in a floating-point format, and
    // decode to the appropriate WIC pixel format.

    WICPixelFormatGUID pixelFormat;
    DX::ThrowIfFailed(
        source->GetPixelFormat(&pixelFormat)
        );

    ComPtr<IWICComponentInfo> componentInfo;
    DX::ThrowIfFailed(
        wicFactory->CreateComponentInfo(
            pixelFormat,
            &componentInfo
            )
        );

    ComPtr<IWICPixelFormatInfo2> pixelFormatInfo;
    DX::ThrowIfFailed(
        componentInfo.As(&pixelFormatInfo)
        );

    WICPixelFormatNumericRepresentation formatNumber;
    DX::ThrowIfFailed(
        pixelFormatInfo->GetNumericRepresentation(&formatNumber)
        );

    DX::ThrowIfFailed(pixelFormatInfo->GetBitsPerPixel(&m_imageInfo.bitsPerPixel));

    // Calculate the bits per channel (bit depth) using GetChannelMask.
    // This accounts for nonstandard color channel packing and padding, e.g. 32bppRGB.
    unsigned char channelMaskBytes[sc_MaxBytesPerPixel];
    ZeroMemory(channelMaskBytes, ARRAYSIZE(channelMaskBytes));
    unsigned int maskSize;

    DX::ThrowIfFailed(
        pixelFormatInfo->GetChannelMask(
            0,  // Read the first color channel.
            ARRAYSIZE(channelMaskBytes),
            channelMaskBytes,
            &maskSize)
        );

    // Count up the number of bits set in the mask for the first color channel.
    for (unsigned int i = 0; i < maskSize * 8; i++)
    {
        unsigned int byte = i / 8;
        unsigned int bit = i % 8;
        if ((channelMaskBytes[byte] & (1 << bit)) != 0)
        {
            m_imageInfo.bitsPerChannel += 1;
        }
    }

    m_imageInfo.isFloat = (WICPixelFormatNumericRepresentationFloat == formatNumber) ? true : false;

    // When decoding, preserve the numeric representation (float vs. non-float)
    // of the native image data. This avoids WIC performing an implicit gamma conversion
    // which occurs when converting between a fixed-point/integer pixel format (sRGB gamma)
    // and a float-point pixel format (linear gamma). Gamma adjustment, if specified by
    // the ICC profile, will be performed by the Direct2D color management effect.

    WICPixelFormatGUID fmt = {};
    if (m_imageInfo.isFloat)
    {
        fmt = GUID_WICPixelFormat64bppPRGBAHalf; // Equivalent to DXGI_FORMAT_R16G16B16A16_FLOAT.
    }
    else
    {
        fmt = GUID_WICPixelFormat64bppPRGBA; // Equivalent to DXGI_FORMAT_R16G16B16A16_UNORM.
                                             // Many SDR images (e.g. JPEG) use <=32bpp, so it
                                             // is possible to further optimize this for memory usage.
    }

    DX::ThrowIfFailed(
        wicFactory->CreateFormatConverter(&m_formatConvert)
        );

    DX::ThrowIfFailed(
        m_formatConvert->Initialize(
            source,
            fmt,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0f,
            WICBitmapPaletteTypeCustom
            )
        );

    UINT width;
    UINT height;
    DX::ThrowIfFailed(
        m_formatConvert->GetSize(&width, &height)
        );

    m_imageInfo.size = Size(static_cast<float>(width), static_cast<float>(height));

    PopulateImageInfoACKind(&m_imageInfo);

    return m_imageInfo;
}

ImageInfo LoadImageFromWic ( _In_ IStream * imageStream )

Definition at line 169 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();

    // Decode the image using WIC.
    ComPtr<IWICBitmapDecoder> decoder;
    DX::ThrowIfFailed(
        wicFactory->CreateDecoderFromStream(
            imageStream,
            nullptr,
            WICDecodeMetadataCacheOnDemand,
            &decoder
            ));

    ComPtr<IWICBitmapFrameDecode> frame;
    DX::ThrowIfFailed(
        decoder->GetFrame(0, &frame)
        );

    return LoadImageCommon(frame.Get());
}

void OnDeviceLost ( ) [virtual]

Definition at line 850 of file D2DAdvancedColorImagesRenderer.cpp.

{
    ReleaseImageDependentResources();
    ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 857 of file D2DAdvancedColorImagesRenderer.cpp.

{
    CreateDeviceDependentResources();
    CreateImageDependentResources();
    CreateWindowSizeDependentResources();

    Draw();
}

void PopulateImageInfoACKind ( _Inout_ ImageInfo * info )

Definition at line 193 of file D2DAdvancedColorImagesRenderer.cpp.

{
    if (info->bitsPerPixel == 0 ||
        info->bitsPerChannel == 0 ||
        info->size.Width == 0 ||
        info->size.Height == 0)
    {
        DX::ThrowIfFailed(E_INVALIDARG);
    }

    info->imageKind = AdvancedColorKind::StandardDynamicRange;

    // Bit depth > 8bpc or color gamut > sRGB signifies a WCG image.
    // The presence of a color profile is used as an approximation for wide gamut.
    if (info->bitsPerChannel > 8 || info->numProfiles >= 1)
    {
        info->imageKind = AdvancedColorKind::WideColorGamut;
    }

    // This application currently only natively supports HDR images with floating point.
    // An image encoded using the HDR10 colorspace is also HDR, but this
    // is not automatically detected by the application.
    if (info->isFloat == true)
    {
        info->imageKind = AdvancedColorKind::HighDynamicRange;
    }
}

void ReleaseDeviceDependentResources ( )

Definition at line 97 of file D2DAdvancedColorImagesRenderer.cpp.

{
}

void ReleaseImageDependentResources ( )

Definition at line 396 of file D2DAdvancedColorImagesRenderer.cpp.

{
    m_imageSource.Reset();
    m_scaledImage.Reset();
    m_colorManagementEffect.Reset();
    m_whiteScaleEffect.Reset();
    m_reinhardEffect.Reset();
    m_filmicEffect.Reset();
    m_sdrOverlayEffect.Reset();
    m_heatmapEffect.Reset();
    m_histogramPrescale.Reset();
    m_histogramEffect.Reset();
    m_finalOutput.Reset();
}

void SetRenderOptions | ( | RenderEffectKind | effect,
 |  | float | brightnessAdjustment,
 |  | Windows::Graphics::Display::AdvancedColorInfo^ | acInfo
 | ) |  |
void UpdateImageColorContext ( ) [private]

Definition at line 602 of file D2DAdvancedColorImagesRenderer.cpp.

{
    auto context = m_deviceResources->GetD2DDeviceContext();

    ComPtr<ID2D1ColorContext> sourceColorContext;

    // For most image types, automatically derive the color context from the image.
    if (m_imageInfo.numProfiles >= 1)
    {
        DX::ThrowIfFailed(
            context->CreateColorContextFromWicColorContext(
                m_wicColorContext.Get(),
                &sourceColorContext
            )
        );
    }
    else
    {
        // Since no embedded color profile/metadata exists, select a default
        // based on the pixel format: floating point == scRGB, others == sRGB.
        DX::ThrowIfFailed(
            context->CreateColorContext(
                m_imageInfo.isFloat ? D2D1_COLOR_SPACE_SCRGB : D2D1_COLOR_SPACE_SRGB,
                nullptr,
                0,
                &sourceColorContext
            )
        );
    }

    DX::ThrowIfFailed(
        m_colorManagementEffect->SetValue(
            D2D1_COLORMANAGEMENT_PROP_SOURCE_COLOR_CONTEXT,
            sourceColorContext.Get()
        )
    );
}

void UpdateImageTransformState ( ) [private]

Definition at line 680 of file D2DAdvancedColorImagesRenderer.cpp.

{
    if (m_imageSource)
    {
        // When using ID2D1ImageSource, the recommend method of scaling is to use
        // ID2D1TransformedImageSource. It is inexpensive to recreate this object.
        D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
        {
            D2D1_ORIENTATION_DEFAULT,
            m_zoom,
            m_zoom,
            D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
            D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE
        };

        DX::ThrowIfFailed(
            m_deviceResources->GetD2DDeviceContext()->CreateTransformedImageSource(
                m_imageSource.Get(),
                &props,
                &m_scaledImage
                )
            );

        // Set the new image as the new source to the effect pipeline.
        m_colorManagementEffect->SetInput(0, m_scaledImage.Get());
    }
}

void UpdateManipulationState ( _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ args )
void UpdateWhiteLevelScale | ( | float | brightnessAdjustment,
 |  | float | sdrWhiteLevel |
 | ) |  |  | [private]

Definition at line 644 of file D2DAdvancedColorImagesRenderer.cpp.

{
    float scale = 1.0f;

    switch (m_imageInfo.imageKind)
    {
    case AdvancedColorKind::HighDynamicRange:
        // HDR content should not be compensated by the SdrWhiteLevel parameter.
        scale = 1.0f;
        break;

    case AdvancedColorKind::StandardDynamicRange:
    case AdvancedColorKind::WideColorGamut:
    default:
        scale = sdrWhiteLevel / sc_nominalRefWhite;
        break;
    }

    // The user may want to manually adjust brightness specifically for this image, on top of any
    // white level adjustment for SDR/WCG content. Brightness adjustment using a linear gamma scale
    // is mainly useful for HDR displays, but can be useful for HDR content tonemapped to an SDR/WCG display.
    scale *= brightnessAdjustment;

    // SDR white level scaling is performing by multiplying RGB color values in linear gamma.
    // We implement this with a Direct2D matrix effect.
    D2D1_MATRIX_5X4_F matrix = D2D1::Matrix5x4F(
        scale, 0, 0, 0,  // [R] Multiply each color channel
        0, scale, 0, 0,  // [G] by the scale factor in
        0, 0, scale, 0,  // [B] linear gamma space.
        0, 0, 0    , 1,  // [A] Preserve alpha values.
        0, 0, 0    , 0); //     No offset.

    DX::ThrowIfFailed(m_whiteScaleEffect->SetValue(D2D1_COLORMATRIX_PROP_COLOR_MATRIX, matrix));
}

Member Data Documentation

float m_brightnessAdjust [private]

Definition at line 111 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_colorManagementEffect [private]

Definition at line 94 of file D2DAdvancedColorImagesRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 87 of file D2DAdvancedColorImagesRenderer.h.

Windows::Graphics::Display::AdvancedColorInfo m_dispInfo [private]

Definition at line 112 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_filmicEffect [private]

Definition at line 97 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_finalOutput [private]

Definition at line 102 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<IWICFormatConverter> m_formatConvert [private]

Definition at line 90 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_heatmapEffect [private]

Definition at line 99 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_histogramEffect [private]

Definition at line 101 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_histogramPrescale [private]

Definition at line 100 of file D2DAdvancedColorImagesRenderer.h.

ImageInfo m_imageInfo [private]

Definition at line 113 of file D2DAdvancedColorImagesRenderer.h.

D2D1_POINT_2F m_imageOffset [private]

Definition at line 108 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic> m_imageSource [private]

Definition at line 92 of file D2DAdvancedColorImagesRenderer.h.

bool m_isComputeSupported [private]

Definition at line 114 of file D2DAdvancedColorImagesRenderer.h.

float m_maxCLL [private]

Definition at line 110 of file D2DAdvancedColorImagesRenderer.h.

float m_minZoom [private]

Definition at line 107 of file D2DAdvancedColorImagesRenderer.h.

D2D1_POINT_2F m_pointerPos [private]

Definition at line 109 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_reinhardEffect [private]

Definition at line 96 of file D2DAdvancedColorImagesRenderer.h.

RenderEffectKind m_renderEffectKind [private]

Definition at line 105 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1TransformedImageSource> m_scaledImage [private]

Definition at line 93 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_sdrOverlayEffect [private]

Definition at line 98 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_whiteScaleEffect [private]

Definition at line 95 of file D2DAdvancedColorImagesRenderer.h.

Microsoft::WRL::ComPtr<IWICColorContext> m_wicColorContext [private]

Definition at line 91 of file D2DAdvancedColorImagesRenderer.h.

float m_zoom [private]

Definition at line 106 of file D2DAdvancedColorImagesRenderer.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.cpp
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImageInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DAdvancedColorImages
  • ImageInfo
Public Attributes

ImageInfo Struct Reference

#include "D2DAdvancedColorImagesRenderer.h"

List of all members.

Public Attributes

unsigned int | bitsPerChannel
unsigned int | bitsPerPixel
Windows::Graphics::Display::AdvancedColorKind | imageKind
bool | isFloat
unsigned int | numProfiles
Windows::Foundation::Size size

Detailed Description

Definition at line 23 of file D2DAdvancedColorImagesRenderer.h.

Member Data Documentation

unsigned int bitsPerChannel

Definition at line 26 of file D2DAdvancedColorImagesRenderer.h.

unsigned int bitsPerPixel

Definition at line 25 of file D2DAdvancedColorImagesRenderer.h.

Windows::Graphics::Display::AdvancedColorKind imageKind

Definition at line 30 of file D2DAdvancedColorImagesRenderer.h.

bool isFloat

Definition at line 27 of file D2DAdvancedColorImagesRenderer.h.

unsigned int numProfiles

Definition at line 29 of file D2DAdvancedColorImagesRenderer.h.

Windows::Foundation::Size size

Definition at line 28 of file D2DAdvancedColorImagesRenderer.h.

The documentation for this struct was generated from the following file:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.h
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DAdvancedColorImages
  • sealed
Public Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~DirectXPage ()
App ()
void | CheckBoxChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)
void | ComboChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)
Platform::String | ConvertACKindToString (Windows::Graphics::Display::AdvancedColorKind kind)
DirectXPage ()
EffectOption (Platform::String^description, RenderEffectKind kind)
void | LoadDefaultImage ()
void | LoadImage (_In_ Windows::Storage::StorageFile^imageFile)
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | OnAdvancedColorInfoChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnCompositionScaleChanged (_In_ Windows::UI::Xaml::Controls::SwapChainPanel^sender, _In_ Object^args)
void | OnDisplayContentsInvalidated (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnDpiChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
virtual void | OnFileActivated (Windows::ApplicationModel::Activation::FileActivatedEventArgs^e) override
void | OnKeyUp (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::KeyEventArgs^args)
virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
void | OnManipulationCompleted (_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationCompletedEventArgs^args)
void | OnManipulationStarted (_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationStartedEventArgs^args)
void | OnManipulationUpdated (_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args)
void | OnOrientationChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnPointerCanceled (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerMoved (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerPressed (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerReleased (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnPointerWheelChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)
void | OnRendering (_In_ Platform::Object^sender, _In_ Platform::Object^args)
void | OnResizeCompleted (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Platform::Object^args)
void | OnSwapChainPanelSizeChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^e)
void | OnVisibilityChanged (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^args)
RenderOptionsViewModel ()
void | ResetButtonClick (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | SliderChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | UpdateDefaultRenderOptions ()
void | UpdateDisplayACState (_In_ Windows::Graphics::Display::AdvancedColorInfo^info)
void | UpdateRenderOptions ()

Properties

RenderEffectKind kind
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Display::AdvancedColorInfo | m_dispInfo
Windows::UI::Input::GestureRecognizer | m_gestureRecognizer
D2DAdvancedColorImages::ImageInfo m_imageInfo
float | m_imageMaxCLL
bool | m_isImageValid
bool | m_isWindowVisible
std::unique_ptr
< D2DAdvancedColorImagesRenderer > 		m_renderer
RenderOptionsViewModel | m_renderOptionsViewModel

Private Member Functions

void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

Private Attributes

DirectXPage | m_directXPage

Detailed Description

Allows databinding of render options to the UI: image colorspace and render effect/tonemapper.

Associates a effect type used by the renderer to a descriptive string bound to UI.

A page that hosts the Direct2D app in a SwapChainPanel, and app UI in XAML.

Definition at line 22 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~DirectXPage ( ) [virtual]

Member Function Documentation

App ( )
void CheckBoxChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::RoutedEventArgs^ | e
 | ) |  |
void ComboChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | e
 | ) |  |
Platform::String ConvertACKindToString ( Windows::Graphics::Display::AdvancedColorKind kind )
DirectXPage ( )
EffectOption | ( | Platform::String^ | description,
 |  | RenderEffectKind | kind |
 | ) |  |  | [inline]

Definition at line 38 of file RenderOptions.h.

        {
            this->description = description;
            this->kind = kind;
        }

void LoadDefaultImage ( )
void LoadImage ( _In_ Windows::Storage::StorageFile^ imageFile )
void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void OnAdvancedColorInfoChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnCompositionScaleChanged | ( | _In_ Windows::UI::Xaml::Controls::SwapChainPanel^ | sender,
 |  | _In_ Object^ | args
 | ) |  |
void OnDisplayContentsInvalidated | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnDpiChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
virtual void OnFileActivated ( Windows::ApplicationModel::Activation::FileActivatedEventArgs^ e ) [override, virtual]
void OnKeyUp | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::KeyEventArgs^ | args
 | ) |  |
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, virtual]
void OnManipulationCompleted | ( | _In_ Windows::UI::Input::GestureRecognizer^ | sender,
 |  | _In_ Windows::UI::Input::ManipulationCompletedEventArgs^ | args
 | ) |  |
void OnManipulationStarted | ( | _In_ Windows::UI::Input::GestureRecognizer^ | sender,
 |  | _In_ Windows::UI::Input::ManipulationStartedEventArgs^ | args
 | ) |  |
void OnManipulationUpdated | ( | _In_ Windows::UI::Input::GestureRecognizer^ | sender,
 |  | _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ | args
 | ) |  |
void OnOrientationChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnPointerCanceled | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e
 | ) |  |
void OnPointerMoved | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e
 | ) |  |
void OnPointerPressed | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e
 | ) |  |
void OnPointerReleased | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e
 | ) |  |
void OnPointerWheelChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ | e
 | ) |  |
void OnRendering | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnResizeCompleted | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OnSwapChainPanelSizeChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::SizeChangedEventArgs^ | e
 | ) |  |
void OnVisibilityChanged | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::VisibilityChangedEventArgs^ | args
 | ) |  |
RenderOptionsViewModel ( ) [inline]

Definition at line 65 of file RenderOptions.h.

        {
            // The first index is chosen by default. Ensure this is in sync with DirectXPage.
            renderEffects = ref new Platform::Collections::VectorView<EffectOption^>
            {
                ref new EffectOption(L"ACES Filmic Tonemap", RenderEffectKind::FilmicTonemap),
                ref new EffectOption(L"Reinhard Tonemap", RenderEffectKind::ReinhardTonemap),
                ref new EffectOption(L"No effect", RenderEffectKind::None),
                ref new EffectOption(L"Draw SDR as grayscale", RenderEffectKind::SdrOverlay),
                ref new EffectOption(L"Draw luminance as heatmap", RenderEffectKind::LuminanceHeatmap)
            };
        }

void ResetButtonClick | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::RoutedEventArgs^ | e
 | ) |  |
void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void SliderChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e
 | ) |  |
void UpdateDefaultRenderOptions ( )
void UpdateDisplayACState ( _In_ Windows::Graphics::Display::AdvancedColorInfo^ info )
void UpdateRenderOptions ( )

Member Data Documentation

DirectXPage m_directXPage [private]

Definition at line 32 of file App.xaml.h.

Property Documentation

RenderEffectKind kind

Definition at line 55 of file RenderOptions.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources

Definition at line 85 of file DirectXPage.xaml.h.

Windows::Graphics::Display::AdvancedColorInfo m_dispInfo

Definition at line 94 of file DirectXPage.xaml.h.

Windows::UI::Input::GestureRecognizer m_gestureRecognizer

Definition at line 87 of file DirectXPage.xaml.h.

D2DAdvancedColorImages::ImageInfo m_imageInfo

Definition at line 91 of file DirectXPage.xaml.h.

float m_imageMaxCLL

Definition at line 92 of file DirectXPage.xaml.h.

bool m_isImageValid

Definition at line 93 of file DirectXPage.xaml.h.

bool m_isWindowVisible

Definition at line 88 of file DirectXPage.xaml.h.

std::unique_ptr<D2DAdvancedColorImagesRenderer> m_renderer

Definition at line 86 of file DirectXPage.xaml.h.

RenderOptionsViewModel m_renderOptionsViewModel

Definition at line 95 of file DirectXPage.xaml.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/App.xaml.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/RenderOptions.h
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMeshMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DGradientMesh
  • D2DGradientMeshMain
Public Member Functions | Private Attributes

D2DGradientMeshMain Class Reference

#include "D2DGradientMeshMain.h"

List of all members.

Public Member Functions

D2DGradientMeshMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~D2DGradientMeshMain ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render ()
void | UpdateForWindowSizeChange ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< SampleOverlay > | m_sampleOverlay
std::unique_ptr
< D2DGradientMeshRenderer > 		m_sceneRenderer

Detailed Description

Definition at line 17 of file D2DGradientMeshMain.h.

Constructor & Destructor Documentation

D2DGradientMeshMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 17 of file D2DGradientMeshMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    m_sceneRenderer = std::unique_ptr<D2DGradientMeshRenderer>(new D2DGradientMeshRenderer(m_deviceResources));
    m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D Gradient Mesh Sample"));
}

~D2DGradientMeshMain ( )

Definition at line 27 of file D2DGradientMeshMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void OnDeviceLost ( ) [virtual]

Definition at line 52 of file D2DGradientMeshMain.cpp.

{
    m_sceneRenderer->ReleaseDeviceDependentResources();
    m_sampleOverlay->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 59 of file D2DGradientMeshMain.cpp.

{
    m_sceneRenderer->CreateDeviceDependentResources();
    m_sampleOverlay->CreateDeviceDependentResources();
    UpdateForWindowSizeChange();
}

bool Render ( )

Definition at line 42 of file D2DGradientMeshMain.cpp.

{
    // Render the scene objects.
    m_sceneRenderer->Render();
    m_sampleOverlay->Render();

    return true;
}

void UpdateForWindowSizeChange ( )

Definition at line 34 of file D2DGradientMeshMain.cpp.

{
    m_sceneRenderer->CreateWindowSizeDependentResources();
    m_sampleOverlay->CreateWindowSizeDependentResources();
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 31 of file D2DGradientMeshMain.h.

std::unique_ptr<SampleOverlay> m_sampleOverlay [private]

Definition at line 37 of file D2DGradientMeshMain.h.

std::unique_ptr<D2DGradientMeshRenderer> m_sceneRenderer [private]

Definition at line 34 of file D2DGradientMeshMain.h.

The documentation for this class was generated from the following files:
  • D2DGradientMesh/cpp/D2DGradientMeshMain.h
  • D2DGradientMesh/cpp/D2DGradientMeshMain.cpp
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMeshRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DGradientMesh
  • D2DGradientMeshRenderer
Public Member Functions | Private Attributes

D2DGradientMeshRenderer Class Reference

#include "D2DGradientMeshRenderer.h"

List of all members.

Public Member Functions

D2DGradientMeshRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID2D1GradientMesh > 		m_gradientMesh

Detailed Description

Definition at line 15 of file D2DGradientMeshRenderer.h.

Constructor & Destructor Documentation

D2DGradientMeshRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 19 of file D2DGradientMeshRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 27 of file D2DGradientMeshRenderer.cpp.

{
    // Create an array that will hold the patch data. In this case, we have two patches.
    D2D1_GRADIENT_MESH_PATCH patchList[2];

    // Create the first patch data item using the helper function.
    patchList[0] = D2D1::GradientMeshPatch(
        D2D1::Point2F(-210, 90),            // Point00 (bottom left corner)
        D2D1::Point2F(-150, 30),            // Point01
        D2D1::Point2F(-90, 150),            // Point02
        D2D1::Point2F(-30, 90),             // Point03 (bottom right corner)
        D2D1::Point2F(-190, 30),            // Point10
        D2D1::Point2F(-130, 30),            // Point11
        D2D1::Point2F(-70, 30),             // Point12
        D2D1::Point2F(-10, 30),             // Point13
        D2D1::Point2F(-170, -30),           // Point20
        D2D1::Point2F(-110, -30),           // Point21
        D2D1::Point2F(-50, -30),            // Point22
        D2D1::Point2F(10, -30),             // Point23
        D2D1::Point2F(-150, -90),           // Point30 (upper left corner)
        D2D1::Point2F(-90, -150),           // Point31
        D2D1::Point2F(-30, -30),            // Point32
        D2D1::Point2F(30, -90),             // Point33 (upper right corner)
        D2D1::ColorF(D2D1::ColorF::Black),  // Color00 (bottom left corner)
        D2D1::ColorF(D2D1::ColorF::Blue),   // Color03 (bottom right corner)
        D2D1::ColorF(D2D1::ColorF::Purple), // Color30 (upper left corner)
        D2D1::ColorF(D2D1::ColorF::Red),    // Color33 (upper right corner)
        D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Top edge is a boundary of the mesh
        D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Left edge is a boundary of the mesh
        D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Bottom edge is a boundary of the mesh
        D2D1_PATCH_EDGE_MODE_ALIASED        // Right edge is internal to the mesh
        );

    // The second patch is the same as the first but translated by x.
    const int x = 180;

    // Create the second patch data item using the helper function.
    patchList[1] = D2D1::GradientMeshPatch(
        D2D1::Point2F(-210 + x, 90),        // Point00 (bottom left corner)
        D2D1::Point2F(-150 + x, 30),        // Point01
        D2D1::Point2F(-90 + x, 150),        // Point02
        D2D1::Point2F(-30 + x, 90),         // Point03 (bottom right corner)
        D2D1::Point2F(-190 + x, 30),        // Point10
        D2D1::Point2F(-130 + x, 30),        // Point11
        D2D1::Point2F(-70 + x, 30),         // Point12
        D2D1::Point2F(-10 + x, 30),         // Point13
        D2D1::Point2F(-170 + x, -30),       // Point20
        D2D1::Point2F(-110 + x, -30),       // Point21
        D2D1::Point2F(-50 + x, -30),        // Point22
        D2D1::Point2F(10 + x, -30),         // Point23
        D2D1::Point2F(-150 + x, -90),       // Point30 (upper left corner)
        D2D1::Point2F(-90 + x, -150),       // Point31
        D2D1::Point2F(-30 + x, -30),        // Point32
        D2D1::Point2F(30 + x, -90),         // Point33 (upper right corner)
        D2D1::ColorF(D2D1::ColorF::Blue),   // Color00 (bottom left corner)
        D2D1::ColorF(D2D1::ColorF::Yellow), // Color03 (bottom right corner)
        D2D1::ColorF(D2D1::ColorF::Red),    // Color30 (upper left corner)
        D2D1::ColorF(D2D1::ColorF::Green),  // Color33 (upper right corner)
        D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Top edge is a boundary of the mesh
        D2D1_PATCH_EDGE_MODE_ALIASED,       // Left edge is internal to the mesh
        D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Bottom edge is a boundary of the mesh
        D2D1_PATCH_EDGE_MODE_ANTIALIASED    // Right edge is a boundary of the mesh
        );

    // Create the gradient mesh object from the patch data.
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateGradientMesh(
            patchList,
            ARRAYSIZE(patchList),
            &m_gradientMesh
            )
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 102 of file D2DGradientMeshRenderer.cpp.

{
}

void ReleaseDeviceDependentResources ( )

Definition at line 108 of file D2DGradientMeshRenderer.cpp.

{
    m_gradientMesh.Reset();
}

void Render ( )

Definition at line 114 of file D2DGradientMeshRenderer.cpp.

{
    m_deviceResources->GetD2DDeviceContext()->BeginDraw();

    m_deviceResources->GetD2DDeviceContext()->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    Windows::Foundation::Size logicalSize = m_deviceResources->GetLogicalSize();

    // Translate to the center of the window.
    m_deviceResources->GetD2DDeviceContext()->SetTransform(
        D2D1::Matrix3x2F::Translation(logicalSize.Width / 2.0f, logicalSize.Height / 2.0f) *
        m_deviceResources->GetOrientationTransform2D()
        );

    // Draw the gradient mesh.
    m_deviceResources->GetD2DDeviceContext()->DrawGradientMesh(m_gradientMesh.Get());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 26 of file D2DGradientMeshRenderer.h.

Microsoft::WRL::ComPtr<ID2D1GradientMesh> m_gradientMesh [private]

Definition at line 29 of file D2DGradientMeshRenderer.h.

The documentation for this class was generated from the following files:
  • D2DGradientMesh/cpp/D2DGradientMeshRenderer.h
  • D2DGradientMesh/cpp/D2DGradientMeshRenderer.cpp
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DGradientMesh
  • SampleOverlay
Public Member Functions | Private Attributes

SampleOverlay Class Reference

#include "SampleOverlay.h"

List of all members.

Public Member Functions

SampleOverlay (const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
float | GetTitleHeightInDips ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::wstring | m_caption
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawOverlay
UINT | m_idIncrement
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
float | m_overlayWidth
float | m_padding
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_textVerticalOffset
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 17 of file SampleOverlay.h.

Constructor & Destructor Documentation

SampleOverlay | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | const std::wstring & | caption
 | ) |  |

Definition at line 20 of file SampleOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_caption(caption),
    m_drawOverlay(true)
{
    m_padding = 8.0f;
    m_textVerticalOffset = 7.0f;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);
    m_overlayWidth = 0.0f;

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 34 of file SampleOverlay.cpp.

{
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
        );

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
            L"Assets\\storelogo-sdk.png",
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
            )
        );

    double dpiX = 96.0;
    double dpiY = 96.0;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    ComPtr<IDWriteTextFormat> nameTextFormat;
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            36.0f,
            L"en-US",
            &nameTextFormat
            )
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            m_caption.c_str(),
            static_cast<UINT32>(m_caption.size()),
            nameTextFormat.Get(),
            4096.0f,
            4096.0f,
            &m_textLayout
            )
        );

    DWRITE_TEXT_METRICS metrics = {0};
    DX::ThrowIfFailed(
        m_textLayout->GetMetrics(&metrics)
        );

    m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 137 of file SampleOverlay.cpp.

{
    if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
    {
        m_drawOverlay = false;
    }
    else
    {
        m_drawOverlay = true;
    }
}

float GetTitleHeightInDips ( )

Definition at line 188 of file SampleOverlay.cpp.

{
    return m_logoSize.height + m_padding;
}

void ReleaseDeviceDependentResources ( )

Definition at line 151 of file SampleOverlay.cpp.

{
    m_whiteBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( )

Definition at line 157 of file SampleOverlay.cpp.

{
    if (m_drawOverlay)
    {
        m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());

        m_deviceResources->GetD2DDeviceContext()->BeginDraw();
        m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
        m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
            );

        m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
            m_textLayout.Get(),
            m_whiteBrush.Get()
            );

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }

        m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
    }
}

Member Data Documentation

std::wstring m_caption [private]

Definition at line 38 of file SampleOverlay.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 28 of file SampleOverlay.h.

bool m_drawOverlay [private]

Definition at line 37 of file SampleOverlay.h.

UINT m_idIncrement [private]

Definition at line 36 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 33 of file SampleOverlay.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 41 of file SampleOverlay.h.

float m_overlayWidth [private]

Definition at line 42 of file SampleOverlay.h.

float m_padding [private]

Definition at line 39 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 31 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 34 of file SampleOverlay.h.

float m_textVerticalOffset [private]

Definition at line 40 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 30 of file SampleOverlay.h.

The documentation for this class was generated from the following files:
  • D2DGradientMesh/cpp/SampleOverlay.h
  • D2DGradientMesh/cpp/SampleOverlay.cpp
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DGradientMesh
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< D2DGradientMeshMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 17 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 46 of file App.h.

std::unique_ptr<D2DGradientMeshMain> m_main [private]

Definition at line 47 of file App.h.

bool m_windowClosed [private]

Definition at line 48 of file App.h.

bool m_windowVisible [private]

Definition at line 49 of file App.h.

The documentation for this class was generated from the following file:
  • D2DGradientMesh/cpp/App.h
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PhotoAdjustmentProperties Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DPhotoAdjustment
  • PhotoAdjustmentProperties
Public Attributes

PhotoAdjustmentProperties Struct Reference

#include "PhotoAdjustmentProperties.h"

List of all members.

Public Attributes

double | ClarityValue
double | ContrastValue
double | HighlightsValue
double | HsMaskRadiusValue
double | SaturationValue
double | ShadowsValue
double | StraightenValue
double | TemperatureValue
double | TintValue

Detailed Description

Definition at line 18 of file PhotoAdjustmentProperties.h.

Member Data Documentation

double ClarityValue

Definition at line 27 of file PhotoAdjustmentProperties.h.

double ContrastValue

Definition at line 25 of file PhotoAdjustmentProperties.h.

double HighlightsValue

Definition at line 28 of file PhotoAdjustmentProperties.h.

double HsMaskRadiusValue

Definition at line 29 of file PhotoAdjustmentProperties.h.

double SaturationValue

Definition at line 24 of file PhotoAdjustmentProperties.h.

double ShadowsValue

Definition at line 26 of file PhotoAdjustmentProperties.h.

double StraightenValue

Definition at line 21 of file PhotoAdjustmentProperties.h.

double TemperatureValue

Definition at line 22 of file PhotoAdjustmentProperties.h.

double TintValue

Definition at line 23 of file PhotoAdjustmentProperties.h.

The documentation for this struct was generated from the following file:
  • D2DPhotoAdjustment/cpp/PhotoAdjustmentProperties.h
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PhotoAdjustmentRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DPhotoAdjustment
  • PhotoAdjustmentRenderer
Public Member Functions | Private Member Functions | Private Attributes

PhotoAdjustmentRenderer Class Reference

#include "PhotoAdjustmentRenderer.h"

List of all members.

Public Member Functions

PhotoAdjustmentRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~PhotoAdjustmentRenderer ()
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateWindowSizeDependentResources ()
void | Draw ()
void | OnColorProfileChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | ReleaseDeviceDependentResources ()
void | UpdatePhotoAdjustmentValues (PhotoAdjustmentProperties properties)

Private Member Functions

float | ConvertDipProperty (float valueInDips)
void | UpdateDisplayColorContext (_In_ Windows::Storage::Streams::DataReader^colorProfileDataReader)
void | UpdateZoomState ()

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_colorManagement
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_contrast
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< IWICFormatConverter > 		m_formatConvert
Platform::Agile
< Windows::UI::Input::GestureRecognizer > 		m_gestureRecognizer
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_highlightsShadows
float | m_hsMaskRadiusDips
Windows::Foundation::Size m_imageSize
Microsoft::WRL::ComPtr
< ID2D1ImageSourceFromWic > 		m_imageSource
bool | m_isWindowClosed
float | m_maxZoom
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_outputEffect
Windows::Foundation::Size m_panelSize
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_saturation
Microsoft::WRL::ComPtr
< ID2D1TransformedImageSource > 		m_scaledImage
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_straighten
Microsoft::WRL::ComPtr
< ID2D1Effect > 		m_temperatureTint
Microsoft::WRL::ComPtr
< IWICColorContext > 		m_wicColorContext
float | m_zoom

Detailed Description

Definition at line 19 of file PhotoAdjustmentRenderer.h.

Constructor & Destructor Documentation

PhotoAdjustmentRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 30 of file PhotoAdjustmentRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_maxZoom(1.0f), // Never allow upscaling.
    m_imageSize(),
    m_panelSize(),
    m_isWindowClosed(false),
    m_zoom()
{
    // Register to be notified if the GPU device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

~PhotoAdjustmentRenderer ( )

Definition at line 46 of file PhotoAdjustmentRenderer.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

float ConvertDipProperty ( float valueInDips ) [private]

Definition at line 317 of file PhotoAdjustmentRenderer.cpp.

{
    float dpiX, dpiY;
    m_deviceResources->GetD2DDeviceContext()->GetDpi(&dpiX, &dpiY);
    return valueInDips * m_zoom * 96.0f / dpiX;
}

void CreateDeviceDependentResources ( )

Definition at line 98 of file PhotoAdjustmentRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto d2dDevice = m_deviceResources->GetD2DDevice();

    // Load the image from WIC using ID2D1ImageSource. The image source selects optimal image loading
    // and caching behavior for the scenario and also supports greater than max texture size images.
    // Scaling is accomplished using ID2D1TransformedImageSource in UpdateZoomState().
    DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));

    // Create the photo adjustment pipeline.
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1ColorManagement, &m_colorManagement));
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1Straighten, &m_straighten));
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1TemperatureTint, &m_temperatureTint));
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1Saturation, &m_saturation));
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1Contrast, &m_contrast));
    DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_D2D1HighlightsShadows, &m_highlightsShadows));

    // Chain the individual photo adjustment effects together.
    // The input to the first effect (color management) is set during UpdateZoomState.
    m_straighten->SetInputEffect(0, m_colorManagement.Get());
    m_temperatureTint->SetInputEffect(0, m_straighten.Get());
    m_saturation->SetInputEffect(0, m_temperatureTint.Get());
    m_contrast->SetInputEffect(0, m_saturation.Get());
    m_highlightsShadows->SetInputEffect(0, m_contrast.Get());

    // m_outputEffect always points to the photo pipeline output.
    DX::ThrowIfFailed(m_highlightsShadows.CopyTo(&m_outputEffect));

    // Do one-time configuration of the photo pipeline.
    m_straighten->SetValue(D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE, TRUE);

    // Consider using a higher quality mode for offline processing, like saving the image to disk.
    m_colorManagement->SetValue(D2D1_COLORMANAGEMENT_PROP_QUALITY, D2D1_COLORMANAGEMENT_QUALITY_PROOF);

    ComPtr<ID2D1ColorContext> sourceContext;
    DX::ThrowIfFailed(d2dContext->CreateColorContextFromWicColorContext(m_wicColorContext.Get(), &sourceContext));
    m_colorManagement->SetValue(D2D1_COLORMANAGEMENT_PROP_SOURCE_COLOR_CONTEXT, sourceContext.Get());

    // Force loading the current display color context.
    OnColorProfileChanged(DisplayInformation::GetForCurrentView());
}

void CreateDeviceIndependentResources ( )

Definition at line 52 of file PhotoAdjustmentRenderer.cpp.

{
    auto wicFactory = m_deviceResources->GetWicImagingFactory();
    auto d2dFactory = m_deviceResources->GetD2DFactory();

    // Use WIC to decode the JPEG image and load it into Direct2D.
    ComPtr<IWICBitmapDecoder> decoder;
    DX::ThrowIfFailed(wicFactory->CreateDecoderFromFilename(
        L"Assets\\rainier.jpg",
        nullptr,
        GENERIC_READ,
        WICDecodeMetadataCacheOnDemand,
        &decoder
        ));

    ComPtr<IWICBitmapFrameDecode> frame;
    DX::ThrowIfFailed(decoder->GetFrame(0, &frame));

    // Convert the image to a pixel format supported by Direct2D. 32bppPBGRA is
    // guaranteed to be supported on all hardware.
    DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
    DX::ThrowIfFailed(m_formatConvert->Initialize(
        frame.Get(),
        GUID_WICPixelFormat32bppPBGRA,
        WICBitmapDitherTypeNone,
        nullptr,
        0.0f,
        WICBitmapPaletteTypeCustom
        ));

    UINT width;
    UINT height;
    DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
    m_imageSize = Size(static_cast<float>(width), static_cast<float>(height));

    // Attempt to read the embedded color profile from the image; use sRGB if the data doesn't exist.
    UINT actualCount;
    DX::ThrowIfFailed(wicFactory->CreateColorContext(&m_wicColorContext));
    DX::ThrowIfFailed(frame->GetColorContexts(1, m_wicColorContext.GetAddressOf(), &actualCount));

    if (actualCount == 0)
    {
        m_wicColorContext->InitializeFromExifColorSpace(1); // 1 = sRGB.
    }
}

void CreateWindowSizeDependentResources ( )

Definition at line 154 of file PhotoAdjustmentRenderer.cpp.

{
    m_panelSize = m_deviceResources->GetLogicalSize();

    // Scale the image to fill the window, but never exceed max scale.
    m_zoom = min(
        max(
            m_panelSize.Width / m_imageSize.Width,
            m_panelSize.Height / m_imageSize.Height),
        m_maxZoom);

    UpdateZoomState();
}

void Draw ( )

Definition at line 198 of file PhotoAdjustmentRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->BeginDraw();

    // DeviceResources explicitly handles screen rotation by setting the rotation on the swap chain.
    // In order for Direct2D content to appear correctly on this swap chain, the app is responsible for
    // explicitly "prerotating" by setting the appropriate transform before drawing.
    m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    d2dContext->DrawImage(m_outputEffect.Get());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    m_deviceResources->Present();
}

void OnColorProfileChanged ( _In_ Windows::Graphics::Display::DisplayInformation^ sender )
void OnDeviceLost ( ) [virtual]

Definition at line 224 of file PhotoAdjustmentRenderer.cpp.

{
    ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 230 of file PhotoAdjustmentRenderer.cpp.

{
    CreateDeviceDependentResources();
}

void ReleaseDeviceDependentResources ( )

Definition at line 141 of file PhotoAdjustmentRenderer.cpp.

{
    m_imageSource.Reset();
    m_scaledImage.Reset();
    m_colorManagement.Reset();
    m_straighten.Reset();
    m_temperatureTint.Reset();
    m_saturation.Reset();
    m_contrast.Reset();
    m_highlightsShadows.Reset();
    m_outputEffect.Reset();
}

void UpdateDisplayColorContext ( _In_ Windows::Storage::Streams::DataReader^ colorProfileDataReader ) [private]
void UpdatePhotoAdjustmentValues ( PhotoAdjustmentProperties properties )

Definition at line 325 of file PhotoAdjustmentRenderer.cpp.

{
    // Testing for the validity of one of the device-dependent resources is sufficient.
    if (m_imageSource != nullptr)
    {
        DX::ThrowIfFailed(m_straighten->SetValue(
            D2D1_STRAIGHTEN_PROP_ANGLE,
            static_cast<float>(properties.StraightenValue)));

        DX::ThrowIfFailed(m_temperatureTint->SetValue(
            D2D1_TEMPERATUREANDTINT_PROP_TEMPERATURE,
            static_cast<float>(properties.TemperatureValue)));

        DX::ThrowIfFailed(m_temperatureTint->SetValue(
            D2D1_TEMPERATUREANDTINT_PROP_TINT,
            static_cast<float>(properties.TintValue)));

        DX::ThrowIfFailed(m_saturation->SetValue(
            D2D1_SATURATION_PROP_SATURATION,
            static_cast<float>(properties.SaturationValue)));

        DX::ThrowIfFailed(m_contrast->SetValue(
            D2D1_CONTRAST_PROP_CONTRAST,
            static_cast<float>(properties.ContrastValue)));

        DX::ThrowIfFailed(m_highlightsShadows->SetValue(
            D2D1_HIGHLIGHTSANDSHADOWS_PROP_SHADOWS,
            static_cast<float>(properties.ShadowsValue)));

        DX::ThrowIfFailed(m_highlightsShadows->SetValue(
            D2D1_HIGHLIGHTSANDSHADOWS_PROP_CLARITY,
            static_cast<float>(properties.ClarityValue)));

        DX::ThrowIfFailed(m_highlightsShadows->SetValue(
            D2D1_HIGHLIGHTSANDSHADOWS_PROP_HIGHLIGHTS,
            static_cast<float>(properties.HighlightsValue)));

        m_hsMaskRadiusDips = static_cast<float>(properties.HsMaskRadiusValue);
        DX::ThrowIfFailed(m_highlightsShadows->SetValue(
            D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS,
            ConvertDipProperty(m_hsMaskRadiusDips)));
    }
}

void UpdateZoomState ( ) [private]

Definition at line 169 of file PhotoAdjustmentRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // When using ID2D1ImageSource, the recommend method of scaling is to use
    // ID2D1TransformedImageSource. It is inexpensive to recreate this object.
    D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
    {
        D2D1_ORIENTATION_DEFAULT,
        m_zoom,
        m_zoom,
        D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
        D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE
    };

    DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
        m_imageSource.Get(),
        &props,
        &m_scaledImage
        ));

    m_colorManagement->SetInput(0, m_scaledImage.Get());

    // Adjust DIP properties for the new zoom and/or DPI.
    m_highlightsShadows->SetValue(
        D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS,
        ConvertDipProperty(m_hsMaskRadiusDips));
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1Effect> m_colorManagement [private]

Definition at line 54 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_contrast [private]

Definition at line 58 of file PhotoAdjustmentRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 44 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<IWICFormatConverter> m_formatConvert [private]

Definition at line 46 of file PhotoAdjustmentRenderer.h.

Platform::Agile<Windows::UI::Input::GestureRecognizer> m_gestureRecognizer [private]

Definition at line 45 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_highlightsShadows [private]

Definition at line 59 of file PhotoAdjustmentRenderer.h.

float m_hsMaskRadiusDips [private]

Definition at line 69 of file PhotoAdjustmentRenderer.h.

Windows::Foundation::Size m_imageSize [private]

Definition at line 63 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic> m_imageSource [private]

Definition at line 52 of file PhotoAdjustmentRenderer.h.

bool m_isWindowClosed [private]

Definition at line 66 of file PhotoAdjustmentRenderer.h.

float m_maxZoom [private]

Definition at line 72 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_outputEffect [private]

Definition at line 60 of file PhotoAdjustmentRenderer.h.

Windows::Foundation::Size m_panelSize [private]

Definition at line 64 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_saturation [private]

Definition at line 57 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1TransformedImageSource> m_scaledImage [private]

Definition at line 53 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_straighten [private]

Definition at line 55 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Effect> m_temperatureTint [private]

Definition at line 56 of file PhotoAdjustmentRenderer.h.

Microsoft::WRL::ComPtr<IWICColorContext> m_wicColorContext [private]

Definition at line 49 of file PhotoAdjustmentRenderer.h.

float m_zoom [private]

Definition at line 65 of file PhotoAdjustmentRenderer.h.

The documentation for this class was generated from the following files:
  • D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.h
  • D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.cpp
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • D2DPhotoAdjustment
  • sealed
Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~DirectXPage ()
App ()
DirectXPage ()
void | LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | OnColorProfileChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnCompositionScaleChanged (_In_ Windows::UI::Xaml::Controls::SwapChainPanel^sender, _In_ Object^args)
void | OnDisplayContentsInvalidated (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnDpiChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
void | OnOrientationChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)
void | OnPropertyChanged (Platform::String^propertyName)
void | OnRendering (_In_ Platform::Object^sender, _In_ Platform::Object^args)
void | OnSwapChainPanelSizeChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^e)
void | OnVisibilityChanged (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^args)
void | Reset_Click (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)
void | ResetPhotoAdjustmentValues ()
void | SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)
void | Slider_ValueChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | TryUpdateRenderer ()

Public Attributes

virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler 		PropertyChanged

Properties

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_isWindowVisible
PhotoAdjustmentProperties m_properties
std::unique_ptr
< PhotoAdjustmentRenderer > 		m_renderer
bool | m_suppressRendererUpdates

Private Member Functions

void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

Private Attributes

DirectXPage | m_directXPage

Detailed Description

A page that hosts the Direct2D photo editor in a SwapChainPanel, and photo pipeline UI.

Definition at line 22 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~DirectXPage ( ) [virtual]

Member Function Documentation

App ( )
DirectXPage ( )
void LoadInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void OnColorProfileChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnCompositionScaleChanged | ( | _In_ Windows::UI::Xaml::Controls::SwapChainPanel^ | sender,
 |  | _In_ Object^ | args
 | ) |  |
void OnDisplayContentsInvalidated | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnDpiChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, virtual]
void OnOrientationChanged | ( | _In_ Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnPropertyChanged ( Platform::String^ propertyName )
void OnRendering | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Platform::Object^ | args
 | ) |  |
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OnSwapChainPanelSizeChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::SizeChangedEventArgs^ | e
 | ) |  |
void OnVisibilityChanged | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::VisibilityChangedEventArgs^ | args
 | ) |  |
void Reset_Click | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::RoutedEventArgs^ | e
 | ) |  |
void ResetPhotoAdjustmentValues ( )
void SaveInternalState ( _In_ Windows::Foundation::Collections::IPropertySet^ state )
void Slider_ValueChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e
 | ) |  |
void TryUpdateRenderer ( )

Member Data Documentation

DirectXPage m_directXPage [private]

Definition at line 31 of file App.xaml.h.

virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler PropertyChanged

Definition at line 36 of file DirectXPage.xaml.h.

Property Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources

Definition at line 75 of file DirectXPage.xaml.h.

bool m_isWindowVisible

Definition at line 77 of file DirectXPage.xaml.h.

PhotoAdjustmentProperties m_properties

Definition at line 80 of file DirectXPage.xaml.h.

std::unique_ptr<PhotoAdjustmentRenderer> m_renderer

Definition at line 76 of file DirectXPage.xaml.h.

bool m_suppressRendererUpdates

Definition at line 78 of file DirectXPage.xaml.h.

The documentation for this class was generated from the following files:
  • D2DPhotoAdjustment/cpp/App.xaml.h
  • D2DPhotoAdjustment/cpp/DirectXPage.xaml.h
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeneratorIncrementalLoadingClass-g< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataBinding
  • GeneratorIncrementalLoadingClass-g< T >
Public Member Functions | Protected Member Functions | Private Attributes

GeneratorIncrementalLoadingClass-g< T > Class Template Reference

Inherits DataBinding::IncrementalLoadingBase.

List of all members.

Public Member Functions

GeneratorIncrementalLoadingClass (uint maxCount, Func< int, T > generator)

Protected Member Functions

override bool | HasMoreItemsOverride ()
async override Task< IList
< object > > 		LoadMoreItemsOverrideAsync (System.Threading.CancellationToken c, uint count)

Private Attributes

uint | _count = 0
Func< int, T > | _generator
uint _maxCount

Detailed Description

template<T>
class DataBinding::GeneratorIncrementalLoadingClass-g< T >

Definition at line 21 of file GeneratorIncrementalLoadingClass.cs.

Member Function Documentation

GeneratorIncrementalLoadingClass | ( | uint | maxCount,
 |  | Func< int, T > | generator |
 | ) |  |  | [inline]

Definition at line 23 of file GeneratorIncrementalLoadingClass.cs.

        {
            _generator = generator;
            _maxCount = maxCount;
        }

override bool HasMoreItemsOverride ( ) [inline, protected, virtual]

Implements IncrementalLoadingBase.

Definition at line 41 of file GeneratorIncrementalLoadingClass.cs.

        {
            return _count < _maxCount;
        }

async override Task<IList<object> > LoadMoreItemsOverrideAsync | ( | System.Threading.CancellationToken | c,
 |  | uint | count |
 | ) |  |  | [inline, protected]

Definition at line 29 of file GeneratorIncrementalLoadingClass.cs.

        {
            uint toGenerate = System.Math.Min(count, _maxCount - _count);

            // This code simply generates
            var values = from j in Enumerable.Range((int)_count, (int)toGenerate)
                         select (object)_generator(j);
            _count += toGenerate;

            return await Task.FromResult<IList<object>>(values.ToArray());
        }

Member Data Documentation

uint _count = 0 [private]

Definition at line 49 of file GeneratorIncrementalLoadingClass.cs.

Func<int, T> _generator [private]

Definition at line 48 of file GeneratorIncrementalLoadingClass.cs.

uint _maxCount [private]

Definition at line 50 of file GeneratorIncrementalLoadingClass.cs.

The documentation for this class was generated from the following file:
  • MediaImport/cs/DataBinding/GeneratorIncrementalLoadingClass.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IncrementalLoadingBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataBinding
  • IncrementalLoadingBase
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

IncrementalLoadingBase Class Reference

Inherited by GeneratorIncrementalLoadingClass-g< T >.

List of all members.

Public Member Functions

int | Add (object value)
void | Clear ()
bool | Contains (object value)
void | CopyTo (Array array, int index)
IEnumerator | GetEnumerator ()
int | IndexOf (object value)
void | Insert (int index, object value)
Windows.Foundation.IAsyncOperation
< LoadMoreItemsResult > 		LoadMoreItemsAsync (uint count)
void | Remove (object value)
void | RemoveAt (int index)

Protected Member Functions

abstract bool | HasMoreItemsOverride ()
abstract Task< IList< object > > | LoadMoreItemsOverrideAsync (CancellationToken c, uint count)

Properties

int | Count [get]
bool | HasMoreItems [get]
bool | IsFixedSize [get]
bool | IsReadOnly [get]
bool | IsSynchronized [get]
object | SyncRoot [get]
object | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged

Private Member Functions

async Task< LoadMoreItemsResult > | LoadMoreItemsAsync (CancellationToken c, uint count)
void | NotifyOfInsertedItems (int baseIndex, int count)

Private Attributes

bool | _busy = false
List< object > | _storage = new List<object>()

Detailed Description

Definition at line 27 of file IncrementalLoadingBase.cs.

Member Function Documentation

int Add ( object value ) [inline]

Definition at line 31 of file IncrementalLoadingBase.cs.

        {
            throw new NotImplementedException();
        }

void Clear ( ) [inline]

Definition at line 36 of file IncrementalLoadingBase.cs.

        {
            throw new NotImplementedException();
        }

bool Contains ( object value ) [inline]

Definition at line 41 of file IncrementalLoadingBase.cs.

        {
            return _storage.Contains(value);
        }

void CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline]

Definition at line 88 of file IncrementalLoadingBase.cs.

        {
            ((IList)_storage).CopyTo(array, index);
        }

IEnumerator GetEnumerator ( ) [inline]

Definition at line 108 of file IncrementalLoadingBase.cs.

        {
            return _storage.GetEnumerator();
        }

abstract bool HasMoreItemsOverride ( ) [protected, pure virtual]

Implemented in GeneratorIncrementalLoadingClass-g< T >.

int IndexOf ( object value ) [inline]

Definition at line 46 of file IncrementalLoadingBase.cs.

        {
            return _storage.IndexOf(value);
        }

void Insert | ( | int | index,
 |  | object | value |
 | ) |  |  | [inline]

Definition at line 51 of file IncrementalLoadingBase.cs.

        {
            throw new NotImplementedException();
        }

async Task<LoadMoreItemsResult> LoadMoreItemsAsync | ( | CancellationToken | c,
 |  | uint | count |
 | ) |  |  | [inline, private]

Definition at line 144 of file IncrementalLoadingBase.cs.

        {
            try
            {
                var items = await LoadMoreItemsOverrideAsync(c, count);
                var baseIndex = _storage.Count;

                _storage.AddRange(items);

                // Now notify of the new items
                NotifyOfInsertedItems(baseIndex, items.Count);

                return new LoadMoreItemsResult { Count = (uint)items.Count };
            }
            finally
            {
                _busy = false;
            }
        }

Windows.Foundation.IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync ( uint count ) [inline]

Definition at line 122 of file IncrementalLoadingBase.cs.

        {
            if (_busy)
            {
                throw new InvalidOperationException("Only one operation in flight at a time");
            }

            _busy = true;

            return AsyncInfo.Run((c) => LoadMoreItemsAsync(c, count));
        }

abstract Task<IList<object> > LoadMoreItemsOverrideAsync | ( | CancellationToken | c,
 |  | uint | count |
 | ) |  |  | [protected, pure virtual]
void NotifyOfInsertedItems | ( | int | baseIndex,
 |  | int | count |
 | ) |  |  | [inline, private]

Definition at line 164 of file IncrementalLoadingBase.cs.

        {
            if (CollectionChanged == null)
            {
                return;
            }

            for (int i = 0; i < count; i++)
            {
                var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, _storage[i + baseIndex], i + baseIndex);
                CollectionChanged(this, args);
            }
        }

void Remove ( object value ) [inline]

Definition at line 66 of file IncrementalLoadingBase.cs.

        {
            throw new NotImplementedException();
        }

void RemoveAt ( int index ) [inline]

Definition at line 71 of file IncrementalLoadingBase.cs.

        {
            throw new NotImplementedException();
        }

Member Data Documentation

bool _busy = false [private]

Definition at line 190 of file IncrementalLoadingBase.cs.

List<object> _storage = new List<object>() [private]

Definition at line 189 of file IncrementalLoadingBase.cs.

Property Documentation

int Count [get]

Definition at line 94 of file IncrementalLoadingBase.cs.

bool HasMoreItems [get]

Definition at line 118 of file IncrementalLoadingBase.cs.

bool IsFixedSize [get]

Definition at line 57 of file IncrementalLoadingBase.cs.

bool IsReadOnly [get]

Definition at line 62 of file IncrementalLoadingBase.cs.

bool IsSynchronized [get]

Definition at line 99 of file IncrementalLoadingBase.cs.

object SyncRoot [get]

Definition at line 104 of file IncrementalLoadingBase.cs.

object this[int index] [get, set]

Definition at line 77 of file IncrementalLoadingBase.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 138 of file IncrementalLoadingBase.cs.

The documentation for this class was generated from the following file:
  • MediaImport/cs/DataBinding/IncrementalLoadingBase.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocalHostItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • LocalHostItem
Public Member Functions | Properties

LocalHostItem Class Reference

Helper class describing a NetworkAdapter and its associated IP address. More...

List of all members.

Public Member Functions

LocalHostItem (HostName localHostName)

Properties

string | DisplayString [get, set]
HostName | LocalHost [get, set]

Detailed Description

Definition at line 334 of file Scenario1_Start.xaml.cs.

Constructor & Destructor Documentation

LocalHostItem ( HostName localHostName ) [inline]

Definition at line 348 of file Scenario1_Start.xaml.cs.

        {
            if (localHostName == null)
            {
                throw new ArgumentNullException("localHostName");
            }

            if (localHostName.IPInformation == null)
            {
                throw new ArgumentException("Adapter information not found");
            }

            this.LocalHost = localHostName;
            this.DisplayString = "Address: " + localHostName.DisplayName +
                " Adapter: " + localHostName.IPInformation.NetworkAdapter.NetworkAdapterId;
        }

Property Documentation

string DisplayString [get, set]

Definition at line 337 of file Scenario1_Start.xaml.cs.

HostName LocalHost [get, set]

Definition at line 343 of file Scenario1_Start.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario1_Start.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemotePeer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • RemotePeer
Public Member Functions | Properties | Private Attributes

RemotePeer Class Reference

Helper class used to identify and respond to a remote peer. More...

List of all members.

Public Member Functions

RemotePeer (IOutputStream outputStream, HostName hostName, String port)
bool | IsMatching (HostName hostName, String port)
override String | ToString ()

Properties

IOutputStream | OutputStream [get]

Private Attributes

HostName | hostName
IOutputStream | outputStream
String | port

Detailed Description

Definition at line 302 of file Scenario1_Start.xaml.cs.

Constructor & Destructor Documentation

RemotePeer | ( | IOutputStream | outputStream,
 |  | HostName | hostName,
 |  | String | port |
 | ) |  |  | [inline]

Definition at line 308 of file Scenario1_Start.xaml.cs.

        {
            this.outputStream = outputStream;
            this.hostName = hostName;
            this.port = port;
        }

Member Function Documentation

bool IsMatching | ( | HostName | hostName,
 |  | String | port |
 | ) |  |  | [inline]

Definition at line 315 of file Scenario1_Start.xaml.cs.

        {
            return (this.hostName == hostName && this.port == port);
        }

override String ToString ( ) [inline]

Definition at line 325 of file Scenario1_Start.xaml.cs.

        {
            return hostName + port;
        }

Member Data Documentation

HostName hostName [private]

Definition at line 305 of file Scenario1_Start.xaml.cs.

IOutputStream outputStream [private]

Definition at line 304 of file Scenario1_Start.xaml.cs.

String port [private]

Definition at line 306 of file Scenario1_Start.xaml.cs.

Property Documentation

IOutputStream OutputStream [get]

Definition at line 321 of file Scenario1_Start.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario1_Start.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

A page for first scenario.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | BindToAny_Checked (object sender, RoutedEventArgs e)
void | BindToAny_Unchecked (object sender, RoutedEventArgs e)
async void | EchoMessage (RemotePeer peer, DatagramSocketMessageReceivedEventArgs eventArguments)
async void | MessageReceived (DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
void | NotifyUserFromAsyncThread (string strMessage, NotifyType type)
void | PopulateAdapterList ()
async void | StartListener_Click (object sender, RoutedEventArgs e)

Private Attributes

List< LocalHostItem > | localHostItems = new List<LocalHostItem>()
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario1_Start.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 39 of file Scenario1_Start.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BindToAny_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario1_Start.xaml.cs.

        {
            AdapterList.IsEnabled = false;
        }

void BindToAny_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario1_Start.xaml.cs.

        {
            AdapterList.IsEnabled = true;
        }

async void EchoMessage | ( | RemotePeer | peer,
 |  | DatagramSocketMessageReceivedEventArgs | eventArguments |
 | ) |  |  | [inline, private]

Echo the message back to the peer.

Parameters:
peer | The remote peer object
eventArguments | The received message event arguments

Definition at line 235 of file Scenario1_Start.xaml.cs.

        {
            if (!peer.IsMatching(eventArguments.RemoteAddress, eventArguments.RemotePort))
            {
                // In the sample we are communicating with just one peer. To communicate with multiple peers, an
                // application should cache output streams (e.g., by using a hash map), because creating an output
                // stream for each received datagram is costly. Keep in mind though, that every cache requires logic
                // to remove old or unused elements; otherwise, the cache will turn into a memory leaking structure.
                NotifyUserFromAsyncThread(
                    String.Format(
                        "Got datagram from {0}:{1}, but already 'connected' to {2}",
                        eventArguments.RemoteAddress,
                        eventArguments.RemotePort,
                        peer),
                    NotifyType.ErrorMessage);
            }

            try
            {
                await peer.OutputStream.WriteAsync(eventArguments.GetDataReader().DetachBuffer());
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                NotifyUserFromAsyncThread("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

async void MessageReceived | ( | DatagramSocket | socket,
 |  | DatagramSocketMessageReceivedEventArgs | eventArguments |
 | ) |  |  | [inline, private]

Message received handler.

Parameters:
socket | The socket object
eventArguments | The datagram event information

Definition at line 184 of file Scenario1_Start.xaml.cs.

        {
            object outObj;
            if (CoreApplication.Properties.TryGetValue("remotePeer", out outObj))
            {
                EchoMessage((RemotePeer)outObj, eventArguments);
                return;
            }

            // We do not have an output stream yet so create one.
            try
            {
                IOutputStream outputStream = await socket.GetOutputStreamAsync(
                    eventArguments.RemoteAddress,
                    eventArguments.RemotePort);

                // It might happen that the OnMessage was invoked more than once before the GetOutputStreamAsync call
                // completed. In this case we will end up with multiple streams - just keep one of them.
                RemotePeer peer;
                lock (this)
                {
                    if (CoreApplication.Properties.TryGetValue("remotePeer", out outObj))
                    {
                        peer = (RemotePeer)outObj;
                    }
                    else
                    {
                        peer = new RemotePeer(outputStream, eventArguments.RemoteAddress, eventArguments.RemotePort);
                        CoreApplication.Properties.Add("remotePeer", peer);
                    }
                }

                EchoMessage(peer, eventArguments);
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                NotifyUserFromAsyncThread("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

void NotifyUserFromAsyncThread | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Notifies the user from a non-UI thread.

Parameters:
strMessage | The message
type | The type of notification

Definition at line 273 of file Scenario1_Start.xaml.cs.

        {
            var ignore = Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 49 of file Scenario1_Start.xaml.cs.

        {
            BindToAny.IsChecked = true;
            PopulateAdapterList();
        }

void PopulateAdapterList ( ) [inline, private]

Populates the NetworkAdapter list.

Definition at line 282 of file Scenario1_Start.xaml.cs.

        {
            localHostItems.Clear();
            AdapterList.ItemsSource = localHostItems;
            AdapterList.DisplayMemberPath = "DisplayString";

            foreach (HostName localHostInfo in NetworkInformation.GetHostNames())
            {
                if (localHostInfo.IPInformation != null)
                {
                    LocalHostItem adapterItem = new LocalHostItem(localHostInfo);
                    localHostItems.Add(adapterItem);
                }
            }
        }

async void StartListener_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StartListener' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 70 of file Scenario1_Start.xaml.cs.

        {
            if (String.IsNullOrEmpty(ServiceNameForListener.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            if (CoreApplication.Properties.ContainsKey("listener"))
            {
                rootPage.NotifyUser(
                    "This step has already been executed. Please move to the next one.",
                    NotifyType.ErrorMessage);
                return;
            }

            CoreApplication.Properties.Remove("serverAddress");

            DatagramSocket listener = new DatagramSocket();
            listener.MessageReceived += MessageReceived;

            if (!String.IsNullOrWhiteSpace(InboundBufferSize.Text))
            {
                uint inboundBufferSize = 0;
                if (!uint.TryParse(InboundBufferSize.Text, out inboundBufferSize))
                {
                    rootPage.NotifyUser(
                        "Please provide a positive numeric Inbound buffer size.",
                        NotifyType.ErrorMessage);
                    return;
                }

                try
                {
                    // Running both client and server on localhost will most likely not reach the buffer limit.
                    // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
                    listener.Control.InboundBufferSizeInBytes = inboundBufferSize;
                }
                catch (ArgumentException)
                {
                    rootPage.NotifyUser("Please provide a valid Inbound buffer size.", NotifyType.ErrorMessage);
                    return;
                }
            }

            LocalHostItem selectedLocalHost = null;
            if ((BindToAddress.IsChecked == true) || (BindToAdapter.IsChecked == true))
            {
                selectedLocalHost = (LocalHostItem)AdapterList.SelectedItem;
                if (selectedLocalHost == null)
                {
                    rootPage.NotifyUser("Please select an address / adapter.", NotifyType.ErrorMessage);
                    return;
                }

                // The user selected an address. For demo purposes, we ensure that connect will be using the same
                // address.
                CoreApplication.Properties.Add("serverAddress", selectedLocalHost.LocalHost.CanonicalName);
            }

            // Save the socket, so subsequent steps can use it.
            CoreApplication.Properties.Add("listener", listener);

            // Start listen operation.
            try
            {
                if (BindToAny.IsChecked == true)
                {
                    // Don't limit traffic to an address or an adapter.
                    await listener.BindServiceNameAsync(ServiceNameForListener.Text);
                    rootPage.NotifyUser("Listening", NotifyType.StatusMessage);
                }
                else if (BindToAddress.IsChecked == true)
                {
                    // Try to bind to a specific address.
                    await listener.BindEndpointAsync(selectedLocalHost.LocalHost, ServiceNameForListener.Text);
                    rootPage.NotifyUser(
                        "Listening on address " + selectedLocalHost.LocalHost.CanonicalName,
                        NotifyType.StatusMessage);
                }
                else if (BindToAdapter.IsChecked == true)
                {
                    // Try to limit traffic to the selected adapter.
                    // This option will be overriden by interfaces with weak-host or forwarding modes enabled.
                    NetworkAdapter selectedAdapter = selectedLocalHost.LocalHost.IPInformation.NetworkAdapter;

                    await listener.BindServiceNameAsync(ServiceNameForListener.Text, selectedAdapter);

                    rootPage.NotifyUser(
                        "Listening on adapter " + selectedAdapter.NetworkAdapterId,
                        NotifyType.StatusMessage);
                }
            }
            catch (Exception exception)
            {
                CoreApplication.Properties.Remove("listener");

                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser(
                    "Start listening failed with error: " + exception.Message,
                    NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

List<LocalHostItem> localHostItems = new List<LocalHostItem>() [private]

Definition at line 37 of file Scenario1_Start.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario1_Start.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario1_Start.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

A page for second scenario.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ConnectSocket_Click (object sender, RoutedEventArgs e)
void | MessageReceived (DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
void | NotifyUserFromAsyncThread (string strMessage, NotifyType type)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario2_Connect.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 34 of file Scenario2_Connect.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ConnectSocket_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ConnectSocket' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 62 of file Scenario2_Connect.xaml.cs.

        {
            if (String.IsNullOrEmpty(ServiceNameForConnect.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            // By default 'HostNameForConnect' is disabled and host name validation is not required. When enabling the
            // text box validating the host name is required since it was received from an untrusted source (user
            // input). The host name is validated by catching ArgumentExceptions thrown by the HostName constructor for
            // invalid input.
            HostName hostName;
            try
            {
                hostName = new HostName(HostNameForConnect.Text);
            }
            catch (ArgumentException)
            {
                rootPage.NotifyUser("Error: Invalid host name.", NotifyType.ErrorMessage);
                return;
            }

            if (CoreApplication.Properties.ContainsKey("clientSocket"))
            {
                rootPage.NotifyUser(
                    "This step has already been executed. Please move to the next one.",
                    NotifyType.ErrorMessage);
                return;
            }

            DatagramSocket socket = new DatagramSocket();

            if (DontFragment.IsOn)
            {
                // Set the IP DF (Don't Fragment) flag.
                // This won't have any effect when running both client and server on localhost.
                // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
                socket.Control.DontFragment = true;
            }

            socket.MessageReceived += MessageReceived;

            // Save the socket, so subsequent steps can use it.
            CoreApplication.Properties.Add("clientSocket", socket);

            rootPage.NotifyUser("Connecting to: " + HostNameForConnect.Text, NotifyType.StatusMessage);

            try
            {
                // Connect to the server (by default, the listener we created in the previous step).
                await socket.ConnectAsync(hostName, ServiceNameForConnect.Text);

                rootPage.NotifyUser("Connected", NotifyType.StatusMessage);

                // Mark the socket as connected. Set the value to null, as we care only about the fact that the
                // property is set.
                CoreApplication.Properties.Add("connected", null);
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

void MessageReceived | ( | DatagramSocket | socket,
 |  | DatagramSocketMessageReceivedEventArgs | eventArguments |
 | ) |  |  | [inline, private]

Definition at line 133 of file Scenario2_Connect.xaml.cs.

        {
            try
            {
                // Interpret the incoming datagram's entire contents as a string.
                uint stringLength = eventArguments.GetDataReader().UnconsumedBufferLength;
                string receivedMessage = eventArguments.GetDataReader().ReadString(stringLength);

                NotifyUserFromAsyncThread(
                    "Received data from remote peer: \"" +
                    receivedMessage + "\"",
                    NotifyType.StatusMessage);
            }
            catch (Exception exception)
            {
                SocketErrorStatus socketError = SocketError.GetStatus(exception.HResult);
                if (socketError == SocketErrorStatus.ConnectionResetByPeer)
                {
                    // This error would indicate that a previous send operation resulted in an
                    // ICMP "Port Unreachable" message.
                    NotifyUserFromAsyncThread(
                        "Peer does not listen on the specific port. Please make sure that you run step 1 first " +
                        "or you have a server properly working on a remote server.",
                        NotifyType.ErrorMessage);
                }
                else if (socketError != SocketErrorStatus.Unknown)
                {
                    NotifyUserFromAsyncThread(
                        "Error happened when receiving a datagram: " + socketError.ToString(),
                        NotifyType.ErrorMessage);
                }
                else
                {
                    throw;
                }
            }
        }

void NotifyUserFromAsyncThread | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario2_Connect.xaml.cs.

        {
            var ignore = Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario2_Connect.xaml.cs.

        {
            // Make sure we're using the correct server address if an adapter was selected in scenario 1
            object serverAddress;
            if (CoreApplication.Properties.TryGetValue("serverAddress", out serverAddress))
            {
                if (serverAddress is string)
                {
                    HostNameForConnect.Text = serverAddress as string;
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2_Connect.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario2_Connect.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • Scenario3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

A page for third scenario.

List of all members.

Public Member Functions

Scenario3 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | SendHello_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario3_Send.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 34 of file Scenario3_Send.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario3_Send.xaml.cs.

        {
        }

async void SendHello_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'SendHello' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 53 of file Scenario3_Send.xaml.cs.

        {
            if (!CoreApplication.Properties.ContainsKey("connected"))
            {
                rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
                return;
            }

            object outValue;
            DatagramSocket socket;
            if (!CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
            {
                rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
                return;
            }

            socket = (DatagramSocket)outValue;

            // Create a DataWriter if we did not create one yet. Otherwise use one that is already cached.
            DataWriter writer;
            if (!CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
            {
                writer = new DataWriter(socket.OutputStream);
                CoreApplication.Properties.Add("clientDataWriter", writer);
            }
            else
            {
                writer = (DataWriter)outValue;
            }

            // Prepare the message to be sent. Writing data to the writer will just store data in memory.
            string stringToSend = "Hello";
            writer.WriteString(stringToSend);

            // Write the locally buffered data to the network.
            try
            {
                await writer.StoreAsync();
                SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error if fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario3_Send.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario3_Send.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • Scenario4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4 Class Reference

A page for fourth scenario.

List of all members.

Public Member Functions

Scenario4 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CloseSockets_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario4_Close.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 34 of file Scenario4_Close.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CloseSockets_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'CloseSockets' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 53 of file Scenario4_Close.xaml.cs.

        {
            object outValue;
            if (CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
            {
                // Remove the data writer from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("clientDataWriter");
                DataWriter dataWriter = (DataWriter)outValue;

                // To reuse the socket with other data writer, application has to detach the stream from the writer
                // before disposing it. This is added for completeness, as this sample closes the socket in
                // very next block.
                dataWriter.DetachStream();
                dataWriter.Dispose();
            }

            if (CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
            {
                // Remove the socket from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("clientSocket");
                DatagramSocket socket = (DatagramSocket)outValue;

                // DatagramSocket.Close() is exposed through the Dispose() method in C#.
                // The call below explicitly closes the socket.
                socket.Dispose();
            }

            if (CoreApplication.Properties.TryGetValue("listener", out outValue))
            {
                // Remove the listener from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("listener");
                DatagramSocket listener = (DatagramSocket)outValue;

                // DatagramSocket.Close() is exposed through the Dispose() method in C#.
                // The call below explicitly closes the socket.
                listener.Dispose();
            }

            CoreApplication.Properties.Remove("remotePeer");
            CoreApplication.Properties.Remove("connected");
            CoreApplication.Properties.Remove("serverAddress");

            rootPage.NotifyUser("Socket and listener closed", NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario4_Close.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario4_Close.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario4_Close.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DatagramSocketSample
  • Scenario5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5 Class Reference

A page for fifth scenario.

List of all members.

Public Member Functions

Scenario5 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | CloseListener_Click (object sender, RoutedEventArgs e)
void | CloseListenerSocket ()
void | MessageReceived (DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
void | MulticastRadioButton_Checked (object sender, RoutedEventArgs e)
void | MulticastRadioButton_Unchecked (object sender, RoutedEventArgs e)
void | NotifyUserFromAsyncThread (string strMessage, NotifyType type)
async void | SendMessage_Click (object sender, RoutedEventArgs e)
void | SetupBroadcastScenarioUI ()
void | SetupMulticastScenarioUI ()
async void | StartListener_Click (object sender, RoutedEventArgs e)

Private Attributes

DatagramSocket | listenerSocket = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario5_MulticastAndBroadcast.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 38 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CloseListener_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'CloseListener' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 238 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            CloseListenerSocket();

            // Disable scenario steps that require us to have an active listening socket.
            SendMessageButton.IsEnabled = false;
            CloseListenerButton.IsEnabled = false;
            SendOutput.Text = "";

            rootPage.NotifyUser("Listener closed", NotifyType.StatusMessage);
        }

void CloseListenerSocket ( ) [inline, private]

Definition at line 43 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            if (listenerSocket != null)
            {
                // DatagramSocket.Close() is exposed through the Dispose() method in C#.
                // The call below explicitly closes the socket, freeing the UDP port that it is currently bound to.
                listenerSocket.Dispose();
                listenerSocket = null;
            }
        }

void MessageReceived | ( | DatagramSocket | socket,
 |  | DatagramSocketMessageReceivedEventArgs | eventArguments |
 | ) |  |  | [inline, private]

Message received handler.

Parameters:
socket | The socket object
eventArguments | The datagram event information

Definition at line 255 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            try
            {
                // Interpret the incoming datagram's entire contents as a string.
                uint stringLength = eventArguments.GetDataReader().UnconsumedBufferLength;
                string receivedMessage = eventArguments.GetDataReader().ReadString(stringLength);

                NotifyUserFromAsyncThread(
                    "Received data from remote peer (Remote Address: " +
                    eventArguments.RemoteAddress.CanonicalName +
                    ", Remote Port: " +
                    eventArguments.RemotePort + "): \"" +
                     receivedMessage + "\"",
                    NotifyType.StatusMessage);
            }
            catch (Exception exception)
            {
                SocketErrorStatus socketError = SocketError.GetStatus(exception.HResult);

                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser(
                    "Error happened when receiving a datagram:" + exception.Message,
                    NotifyType.ErrorMessage);
            }
        }

void MulticastRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 97 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            CloseListenerSocket();
            SetupMulticastScenarioUI();
        }

void MulticastRadioButton_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            CloseListenerSocket();
            SetupBroadcastScenarioUI();
        }

void NotifyUserFromAsyncThread | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Notifies the user from a non-UI thread.

Parameters:
strMessage | The message
type | The type of notification

Definition at line 291 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            var ignore = Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 59 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            MulticastRadioButton.IsChecked = true;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data representative of the navigation that will unload the current Page.

Definition at line 68 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            CloseListenerSocket();
        }

async void SendMessage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'SendMessage' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 197 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            SendOutput.Text = "";

            try
            {
                IOutputStream outputStream;
                HostName remoteHostname = new HostName(RemoteAddress.Text);

                // GetOutputStreamAsync can be called multiple times on a single DatagramSocket instance to obtain
                // IOutputStreams pointing to various different remote endpoints. The remote hostname given to
                // GetOutputStreamAsync can be a unicast, multicast or broadcast address.
                outputStream = await listenerSocket.GetOutputStreamAsync(remoteHostname, ServiceName.Text);

                // Send out some multicast or broadcast data. Datagrams generated by the IOutputStream will use
                // <source host, source port> information obtained from the parent socket (i.e., 'listenSocket' in
                // this case).
                const string stringToSend = "Hello";
                DataWriter writer = new DataWriter(outputStream);
                writer.WriteString(stringToSend);
                await writer.StoreAsync();

                SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

void SetupBroadcastScenarioUI ( ) [inline, private]

Definition at line 86 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            RemoteAddressLabel.Text = "Broadcast Address:";
            StartListener.Content = "Start listener";
            RemoteAddress.Text = "255.255.255.255";
            RemoteAddress.IsEnabled = false;
            SendMessageButton.IsEnabled = false;
            CloseListenerButton.IsEnabled = false;
            SendOutput.Text = "";
        }

void SetupMulticastScenarioUI ( ) [inline, private]

Definition at line 74 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            RemoteAddressLabel.Text = "Multicast Group:";
            StartListener.Content = "Start listener and join multicast group";
            RemoteAddress.Text = "224.3.0.5";
            RemoteAddress.IsEnabled = false;
            SendMessageButton.IsEnabled = false;
            CloseListenerButton.IsEnabled = false;
            SendOutput.Text = "";
        }

async void StartListener_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StartListener' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 114 of file Scenario5_MulticastAndBroadcast.xaml.cs.

        {
            if (String.IsNullOrEmpty(ServiceName.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            if (listenerSocket != null)
            {
                rootPage.NotifyUser("A listener socket is already set up.", NotifyType.ErrorMessage);
                return;
            }

            bool isMulticastSocket = (MulticastRadioButton.IsChecked == true);
            listenerSocket = new DatagramSocket();
            listenerSocket.MessageReceived += MessageReceived;

            if (isMulticastSocket)
            {
                // DatagramSockets conduct exclusive (SO_EXCLUSIVEADDRUSE) binds by default, effectively blocking
                // any other UDP socket on the system from binding to the same local port. This is done to prevent
                // other applications from eavesdropping or hijacking a DatagramSocket's unicast traffic.
                //
                // Setting the MulticastOnly control option to 'true' enables a DatagramSocket instance to share its
                // local port with any Win32 sockets that are bound using SO_REUSEADDR/SO_REUSE_MULTICASTPORT and
                // with any other DatagramSocket instances that have MulticastOnly set to true. However, note that any
                // attempt to use a multicast-only DatagramSocket instance to send or receive unicast data will result
                // in an exception being thrown.
                //
                // This control option is particularly useful when implementing a well-known multicast-based protocol,
                // such as mDNS and UPnP, since it enables a DatagramSocket instance to coexist with other applications
                // running on the system that also implement that protocol.
                listenerSocket.Control.MulticastOnly = true;
            }

            // Start listen operation.
            try
            {
                await listenerSocket.BindServiceNameAsync(ServiceName.Text);

                if (isMulticastSocket)
                {
                    // Join the multicast group to start receiving datagrams being sent to that group.
                    listenerSocket.JoinMulticastGroup(new HostName(RemoteAddress.Text));

                    rootPage.NotifyUser(
                        "Listening on port " + listenerSocket.Information.LocalPort + " and joined to multicast group",
                        NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser(
                        "Listening on port " + listenerSocket.Information.LocalPort,
                        NotifyType.StatusMessage);
                }

                // Enable scenario steps that require us to have an active listening socket.
                SendMessageButton.IsEnabled = true;
                CloseListenerButton.IsEnabled = true;
            }
            catch (Exception exception)
            {
                listenerSocket.Dispose();
                listenerSocket = null;

                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser(
                    "Start listening failed with error: " + exception.Message,
                    NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

DatagramSocket listenerSocket = null [private]

Definition at line 36 of file Scenario5_MulticastAndBroadcast.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario5_MulticastAndBroadcast.xaml.cs.

The documentation for this class was generated from the following file:
  • DatagramSocket/cs/Scenario5_MulticastAndBroadcast.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CacheChangedEventArgs-g< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • CacheChangedEventArgs-g< T >
Properties

CacheChangedEventArgs-g< T > Class Template Reference

List of all members.

Properties

int | itemIndex [get, set]
T | newItem [get, set]
T | oldItem [get, set]

Detailed Description

template<T>
class DataVirtualizationSample::CacheChangedEventArgs-g< T >

Definition at line 12 of file ItemCacheManager.cs.

Property Documentation

int itemIndex [get, set]

Definition at line 16 of file ItemCacheManager.cs.

T newItem [get, set]

Definition at line 15 of file ItemCacheManager.cs.

T oldItem [get, set]

Definition at line 14 of file ItemCacheManager.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileDataSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • FileDataSource
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

FileDataSource Class Reference

A custom datasource over the file system that supports data virtualization. More...

List of all members.

Public Member Functions

int | Add (object value)
void | Clear ()
bool | Contains (object value)
void | CopyTo (Array array, int index)
void | Dispose ()
System.Collections.IEnumerator | GetEnumerator ()
int | IndexOf (object value)
void | Insert (int index, object value)
void | RangesChanged (ItemIndexRange visibleRange, IReadOnlyList< ItemIndexRange > trackedItems)
void | Remove (object value)
void | RemoveAt (int index)
async Task | SetFolder (StorageFolder folder)

Static Public Member Functions

static async Task< FileDataSource > | GetDataSoure (string path)

Properties

int | Count [get]
bool | IsFixedSize [get]
bool | IsReadOnly [get]
bool | IsSynchronized [get]
object | SyncRoot [get]
object | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged

Private Member Functions

FileDataSource ()
async Task< FileItem[]> | fetchDataCallback (ItemIndexRange batch, CancellationToken ct)
void | ItemCache_CacheChanged (object sender, CacheChangedEventArgs< FileItem > args)
void | QueryResult_ContentsChanged (IStorageQueryResultBase sender, object args)
void | ResetCollection ()
async Task | UpdateCount ()

Private Attributes

int | _count = 1
CoreDispatcher | _dispatcher
StorageFolder | _folder
StorageFileQueryResult | _queryResult
ItemCacheManager< FileItem > | itemCache

Detailed Description

Definition at line 28 of file FileDataSource.cs.

Constructor & Destructor Documentation

FileDataSource ( ) [inline, private]

Definition at line 45 of file FileDataSource.cs.

        {
            //Setup the dispatcher for the UI thread
            _dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;

            // The ItemCacheManager does most of the heavy lifting. We pass it a callback that it will use to actually fetch data, and the max size of a request
            this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
            this.itemCache.CacheChanged += ItemCache_CacheChanged;
        }

Member Function Documentation

int Add ( object value ) [inline]

Definition at line 211 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

void Clear ( ) [inline]

Definition at line 216 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

bool Contains ( object value ) [inline]

Definition at line 125 of file FileDataSource.cs.

        {
            return IndexOf(value) != -1;
        }

void CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline]

Definition at line 245 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

void Dispose ( ) [inline]

Definition at line 155 of file FileDataSource.cs.

        {
            itemCache = null;
        }

async Task<FileItem[]> fetchDataCallback | ( | ItemIndexRange | batch,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, private]

Definition at line 180 of file FileDataSource.cs.

        {
            // Fetch file objects from filesystem
            IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)batch.FirstIndex, Math.Max(batch.Length, 20)).AsTask(ct);
            List<FileItem> files = new List<FileItem>();
            if (results != null)
            {
                for (int i = 0; i < results.Count; i++)
                {
                    // Check if request has been cancelled, if so abort getting additional data
                    ct.ThrowIfCancellationRequested();
                    // Create our FileItem object with the file data and thumbnail
                    FileItem newItem = await FileItem.fromStorageFile(results[i], ct);
                    files.Add(newItem);
                }
            }
            return files.ToArray();
        }

static async Task<FileDataSource> GetDataSoure ( string path ) [inline, static]

Definition at line 57 of file FileDataSource.cs.

        {
            FileDataSource ds = new FileDataSource();
            StorageFolder f = await StorageFolder.GetFolderFromPathAsync(path);
            await ds.SetFolder(f);
            return ds;
        }

System.Collections.IEnumerator GetEnumerator ( ) [inline]

Definition at line 260 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

int IndexOf ( object value ) [inline]

Definition at line 130 of file FileDataSource.cs.

        {
            return (value != null) ? itemCache.IndexOf((FileItem)value) : -1;
        }

void Insert | ( | int | index,
 |  | object | value |
 | ) |  |  | [inline]

Definition at line 221 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ItemCache_CacheChanged | ( | object | sender,
 |  | CacheChangedEventArgs< FileItem > | args |
 | ) |  |  | [inline, private]

Definition at line 201 of file FileDataSource.cs.

        {
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, args.oldItem, args.newItem, args.itemIndex));
            }
        }

void QueryResult_ContentsChanged | ( | IStorageQueryResultBase | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 83 of file FileDataSource.cs.

        {
            // This callback can occur on a different thread so we need to marshal it back to the UI thread
            if (!_dispatcher.HasThreadAccess)
            {
                var t = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, ResetCollection);
            }
            else
            {
                ResetCollection();
            }
        }

void RangesChanged | ( | ItemIndexRange | visibleRange,
 |  | IReadOnlyList< ItemIndexRange > | trackedItems |
 | ) |  |  | [inline]

Primary method for IItemsRangeInfo interface Is called when the list control's view is changed.

Parameters:
visibleRange | The range of items that are actually visible
trackedItems | Additional set of ranges that the list is using, for example the buffer regions and focussed element

Definition at line 166 of file FileDataSource.cs.

        {
#if TRACE_DATASOURCE
            string s = string.Format("* RangesChanged fired: Visible {0}->{1}", visibleRange.FirstIndex, visibleRange.LastIndex);
            foreach (ItemIndexRange r in trackedItems) { s += string.Format(" {0}->{1}", r.FirstIndex, r.LastIndex); }
            Debug.WriteLine(s);
#endif
            // We know that the visible range is included in the broader range so don't need to hand it to the UpdateRanges call
            // Update the cache of items based on the new set of ranges. It will callback for additional data if required
            itemCache.UpdateRanges(trackedItems.ToArray());
        }

void Remove ( object value ) [inline]

Definition at line 236 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

void RemoveAt ( int index ) [inline]

Definition at line 241 of file FileDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ResetCollection ( ) [inline, private]

Definition at line 97 of file FileDataSource.cs.

        {
            // Unhook the old change notification
            if (itemCache != null)
            {
                this.itemCache.CacheChanged -= ItemCache_CacheChanged;
            }

            // Create a new instance of the cache manager
            this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
            this.itemCache.CacheChanged += ItemCache_CacheChanged;
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

async Task SetFolder ( StorageFolder folder ) [inline]

Definition at line 66 of file FileDataSource.cs.

        {
            //unhook the old contents changed event if applicable
            if (_queryResult != null)
            {
                _queryResult.ContentsChanged -= QueryResult_ContentsChanged;
            }
            // Initialize the query and register for changes
            _folder = folder;
            QueryOptions options = new QueryOptions();
            // options.IndexerOption = IndexerOption.DoNotUseIndexer;
            _queryResult = _folder.CreateFileQueryWithOptions(options);
            _queryResult.ContentsChanged += QueryResult_ContentsChanged;
            await UpdateCount();
        }

async Task UpdateCount ( ) [inline, private]

Definition at line 114 of file FileDataSource.cs.

        {
            _count = (int)await _queryResult.GetItemCountAsync();
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

Member Data Documentation

int _count = 1 [private]

Definition at line 41 of file FileDataSource.cs.

CoreDispatcher _dispatcher [private]

Definition at line 35 of file FileDataSource.cs.

StorageFolder _folder [private]

Definition at line 31 of file FileDataSource.cs.

StorageFileQueryResult _queryResult [private]

Definition at line 33 of file FileDataSource.cs.

ItemCacheManager<FileItem> itemCache [private]

Definition at line 38 of file FileDataSource.cs.

Property Documentation

int Count [get]

Definition at line 148 of file FileDataSource.cs.

bool IsFixedSize [get]

Definition at line 227 of file FileDataSource.cs.

bool IsReadOnly [get]

Definition at line 232 of file FileDataSource.cs.

bool IsSynchronized [get]

Definition at line 251 of file FileDataSource.cs.

object SyncRoot [get]

Definition at line 256 of file FileDataSource.cs.

object this[int index] [get, set]

Definition at line 136 of file FileDataSource.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 43 of file FileDataSource.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/FileDataSource.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileDataSource2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • FileDataSource2
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

FileDataSource2 Class Reference

A custom datasource over the file system that supports data virtualization. More...

List of all members.

Public Member Functions

int | Add (object value)
void | Clear ()
bool | Contains (object value)
void | CopyTo (Array array, int index)
void | DeselectRange (ItemIndexRange range)
void | Dispose ()
System.Collections.IEnumerator | GetEnumerator ()
IReadOnlyList< ItemIndexRange > | GetSelectedRanges ()
int | IndexOf (object value)
void | Insert (int index, object value)
bool | IsSelected (int index)
void | RangesChanged (ItemIndexRange visibleRange, IReadOnlyList< ItemIndexRange > trackedItems)
void | Remove (object value)
void | RemoveAt (int index)
async void | ResetCollection ()
void | SelectRange (ItemIndexRange range)
async Task | SetFolder (StorageFolder folder)

Static Public Member Functions

static async Task
< FileDataSource2 > 		GetDataSoure (string path)

Properties

int | Count [get]
bool | IsFixedSize [get]
bool | IsReadOnly [get]
bool | IsSynchronized [get]
object | SyncRoot [get]
object | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged

Private Member Functions

FileDataSource2 ()
async Task< FileItem[]> | fetchDataCallback (ItemIndexRange batch, CancellationToken ct)
async Task< string[]> | fetchSelectionDataCallback (ItemIndexRange batch, CancellationToken ct)
void | ItemCache_CacheChanged (object sender, CacheChangedEventArgs< FileItem > args)
void | QueryResult_ContentsChanged (IStorageQueryResultBase sender, object args)
async Task | RemapSelection ()
async Task | UpdateCount ()

Private Attributes

int | _count = 1
CoreDispatcher | _dispatcher
StorageFolder | _folder
StorageFileQueryResult | _queryResult
ItemCacheManager< FileItem > | itemCache
ItemIndexRangeList | selection = new ItemIndexRangeList()
ItemCacheManager< string > | selectionCache

Detailed Description

Definition at line 27 of file FileDataSource2.cs.

Constructor & Destructor Documentation

FileDataSource2 ( ) [inline, private]

Definition at line 44 of file FileDataSource2.cs.

        {
            //Setup the dispatcher for the UI thread
            _dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;

            // The ItemCacheManager does most of the heavy lifting. We pass it a callback that it will use to actually fetch data, and the max size of a request
            this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
            this.itemCache.CacheChanged += ItemCache_CacheChanged;

            // Create another ItemCacheManager for the keys for selection
            this.selectionCache = new ItemCacheManager<string>(fetchSelectionDataCallback, 50, "selectionCache");
        }

Member Function Documentation

int Add ( object value ) [inline]

Definition at line 347 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

void Clear ( ) [inline]

Definition at line 352 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

bool Contains ( object value ) [inline]

Definition at line 269 of file FileDataSource2.cs.

        {
            return IndexOf(value) != -1;
        }

void CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline]

Definition at line 381 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

void DeselectRange ( ItemIndexRange range ) [inline]

Definition at line 96 of file FileDataSource2.cs.

        {
            selection.Subtract(range);
            selectionCache.UpdateRanges(selection.ToArray());
        }

void Dispose ( ) [inline]

Definition at line 300 of file FileDataSource2.cs.

        {
            itemCache = null;
        }

async Task<FileItem[]> fetchDataCallback | ( | ItemIndexRange | batch,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, private]

Definition at line 325 of file FileDataSource2.cs.

        {
            // Fetch file objects from filesystem
            IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)batch.FirstIndex, Math.Max(batch.Length, 20)).AsTask(ct);
            List<FileItem> files = new List<FileItem>();
            if (results != null)
            {
                for (int i = 0; i < results.Count; i++)
                {
                    ct.ThrowIfCancellationRequested();
                    // Create our FileItem object with the file data and thumbnail
                    FileItem newItem = await FileItem.fromStorageFile(results[i], ct);
                    files.Add(newItem);
                }
            }
            return files.ToArray();
        }

async Task<string[]> fetchSelectionDataCallback | ( | ItemIndexRange | batch,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, private]

Definition at line 120 of file FileDataSource2.cs.

        {
#if TRACE_DATASOURCE
            Debug.WriteLine("# SelectionDataCallback: " + batch.FirstIndex + "->" + batch.LastIndex);
#endif
            // See if we already have the item in the data cache, if so get the key from there so we don't need to go to the filesystem
            var file = itemCache[batch.FirstIndex];
            if (file != null)
            {
                return new string[] { file.Key };
            }

            // Go get the keys from the file system if necessary
            IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)batch.FirstIndex, batch.Length).AsTask(ct);
            List<string> keys = new List<string>();
            if (results != null)
            {
                for (int i = 0; i < results.Count; i++)
                {
                    ct.ThrowIfCancellationRequested();
                    keys.Add(results[i].FolderRelativeId);
                }
            }
            return keys.ToArray();
        }

static async Task<FileDataSource2> GetDataSoure ( string path ) [inline, static]

Definition at line 209 of file FileDataSource2.cs.

        {
            FileDataSource2 ds = new FileDataSource2();
            StorageFolder f = await StorageFolder.GetFolderFromPathAsync(path);
            await ds.SetFolder(f);
            return ds;
        }

System.Collections.IEnumerator GetEnumerator ( ) [inline]

Definition at line 396 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

IReadOnlyList<ItemIndexRange> GetSelectedRanges ( ) [inline]

Definition at line 113 of file FileDataSource2.cs.

        {
            return selection.ToList();
        }

int IndexOf ( object value ) [inline]

Definition at line 274 of file FileDataSource2.cs.

        {
            return (value != null) ? itemCache.IndexOf((FileItem)value) : -1;
        }

void Insert | ( | int | index,
 |  | object | value |
 | ) |  |  | [inline]

Definition at line 357 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

bool IsSelected ( int index ) [inline]

Definition at line 103 of file FileDataSource2.cs.

        {
            foreach (ItemIndexRange range in selection)
            {
                if (index >= range.FirstIndex && index <= range.LastIndex) return true;
            }
            return false;
        }

void ItemCache_CacheChanged | ( | object | sender,
 |  | CacheChangedEventArgs< FileItem > | args |
 | ) |  |  | [inline, private]

Definition at line 258 of file FileDataSource2.cs.

        {
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, args.oldItem, args.newItem, args.itemIndex));
            }
        }

void QueryResult_ContentsChanged | ( | IStorageQueryResultBase | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 235 of file FileDataSource2.cs.

        {
            // This callback can occur on a different thread so we need to marshal it back to the UI thread
            if (!_dispatcher.HasThreadAccess)
            {
                var t = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, ResetCollection);
            }
            else
            {
                ResetCollection();
            }
        }

void RangesChanged | ( | ItemIndexRange | visibleRange,
 |  | IReadOnlyList< ItemIndexRange > | trackedItems |
 | ) |  |  | [inline]

Primary method for IItemsRangeInfo interface Is called when the list control's view is changed.

Parameters:
visibleRange | The range of items that are actually visible
trackedItems | Additional set of ranges that the list is using, for example the buffer regions and focussed element

Definition at line 311 of file FileDataSource2.cs.

        {
#if TRACE_DATASOURCE
            string s = string.Format("* RangesChanged fired: Visible {0}->{1}", visibleRange.FirstIndex, visibleRange.LastIndex);
            foreach (ItemIndexRange r in trackedItems) { s += string.Format(" {0}->{1}", r.FirstIndex, r.LastIndex); }
            Debug.WriteLine(s);
#endif
            // We know that the visible range is included in the broader range so don't need to hand it to the UpdateRanges call
            // Update the cache of items based on the new set of ranges. It will callback for additional data if required
            itemCache.UpdateRanges(trackedItems.ToArray());
        }

async Task RemapSelection ( ) [inline, private]

Definition at line 147 of file FileDataSource2.cs.

        {
            ItemIndexRangeList oldSelection = selection;
            ItemCacheManager<string> oldSelectionCache = selectionCache;
            ItemIndexRangeList newSelection = new ItemIndexRangeList();
            ItemCacheManager<string> newSelectionCache = new ItemCacheManager<string>(fetchSelectionDataCallback, 50, "newSelectionCache");

            foreach (ItemIndexRange r in oldSelection)
            {
                IReadOnlyList<StorageFile> results = null;
                int lastResultOffset = 0, lastResultsItemIndex = 0;
                for (int i = 0; i < r.Length; i++)
                {
                    int origIndex = r.FirstIndex + i;
                    string fileid = oldSelectionCache[origIndex];
                    bool matched = false;

                    // Optimization to be able to work in batches. Once we get a batch of files from the filesystem we use that to hunt
                    // for matches rather than having to go ask for the index of each file
                    if (results != null)
                    {
                        for (int j = lastResultOffset + 1; j < results.Count; j++)
                        {
                            if (results[j].FolderRelativeId == fileid)
                            {
                                lastResultOffset = j;
                                int itemIndex = lastResultsItemIndex + j;
                                newSelection.Add((uint)itemIndex, 1);
                                newSelectionCache[itemIndex] = oldSelectionCache[origIndex];
                                matched = true;
                                break;
                            }
                        }
                    }
                    if (!matched)
                    {
                        // Get a starting point for the index of the file
                        lastResultsItemIndex = (int)(await _queryResult.FindStartIndexAsync(fileid.Substring(fileid.LastIndexOf('\\') + 1)));
                        lastResultOffset = 0;
                        // Get the files at that point and see if the keys actually match
                        results = await _queryResult.GetFilesAsync((uint)lastResultsItemIndex, 50);
                        if (results[lastResultOffset].FolderRelativeId == fileid)
                        {
                            newSelection.Add((uint)lastResultsItemIndex, 1);
                            newSelectionCache[lastResultsItemIndex] = oldSelectionCache[origIndex];
                        }
                        else
                        {
                            // We can't find the item, so its no longer part of the selection
                        }
                    }
                }
            }
            // Update the fields for the new selection
            selection = newSelection;
            selectionCache = newSelectionCache;
        }

void Remove ( object value ) [inline]

Definition at line 372 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

void RemoveAt ( int index ) [inline]

Definition at line 377 of file FileDataSource2.cs.

        {
            throw new NotImplementedException();
        }

async void ResetCollection ( ) [inline]

Definition at line 58 of file FileDataSource2.cs.

        {
            // Update the selection cache to match the filesystem after the updates
            await RemapSelection();

            // Unhook the old change notification
            if (itemCache != null)
            {
                this.itemCache.CacheChanged -= ItemCache_CacheChanged;
            }

            // Create a new instance of the cache manager
            this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
            this.itemCache.CacheChanged += ItemCache_CacheChanged;
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

void SelectRange ( ItemIndexRange range ) [inline]

Definition at line 89 of file FileDataSource2.cs.

        {
            selection.Add(range);
            selectionCache.UpdateRanges(selection.ToArray());
        }

async Task SetFolder ( StorageFolder folder ) [inline]

Definition at line 218 of file FileDataSource2.cs.

        {
            //unhook the old contents changed event if applicable
            if (_queryResult != null)
            {
                _queryResult.ContentsChanged -= QueryResult_ContentsChanged;
            }
            // Initialize the query and register for changes
            _folder = folder;
            QueryOptions options = new QueryOptions();
            // options.IndexerOption = IndexerOption.DoNotUseIndexer;
            _queryResult = _folder.CreateFileQueryWithOptions(options);
            _queryResult.ContentsChanged += QueryResult_ContentsChanged;
            await UpdateCount();
        }

async Task UpdateCount ( ) [inline, private]

Definition at line 247 of file FileDataSource2.cs.

        {
            _count = (int)await _queryResult.GetItemCountAsync();
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

Member Data Documentation

int _count = 1 [private]

Definition at line 40 of file FileDataSource2.cs.

CoreDispatcher _dispatcher [private]

Definition at line 34 of file FileDataSource2.cs.

StorageFolder _folder [private]

Definition at line 30 of file FileDataSource2.cs.

StorageFileQueryResult _queryResult [private]

Definition at line 32 of file FileDataSource2.cs.

ItemCacheManager<FileItem> itemCache [private]

Definition at line 37 of file FileDataSource2.cs.

ItemIndexRangeList selection = new ItemIndexRangeList() [private]

Definition at line 86 of file FileDataSource2.cs.

ItemCacheManager<string> selectionCache [private]

Definition at line 84 of file FileDataSource2.cs.

Property Documentation

int Count [get]

Definition at line 292 of file FileDataSource2.cs.

bool IsFixedSize [get]

Definition at line 363 of file FileDataSource2.cs.

bool IsReadOnly [get]

Definition at line 368 of file FileDataSource2.cs.

bool IsSynchronized [get]

Definition at line 387 of file FileDataSource2.cs.

object SyncRoot [get]

Definition at line 392 of file FileDataSource2.cs.

object this[int index] [get, set]

Definition at line 280 of file FileDataSource2.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 42 of file FileDataSource2.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario2/FileDataSource2.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • FileItem
Static Public Member Functions | Properties | Static Private Attributes

FileItem Class Reference

Represents a file and its properties. More...

List of all members.

Static Public Member Functions

static async Task< FileItem > | fromStorageFile (StorageFile f, CancellationToken ct)

Properties

string | Filename [get, set]
BitmapImage | ImageData [get, set]
string | Key [get, set]
int | Size [get, set]

Static Private Attributes

static SemaphoreSlim | gettingFileProperties = new SemaphoreSlim(1)

Detailed Description

Definition at line 21 of file FileItem.cs.

Member Function Documentation

static async Task<FileItem> fromStorageFile | ( | StorageFile | f,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, static]

Definition at line 33 of file FileItem.cs.

        {
            FileItem item = new FileItem();
            item.Filename = f.DisplayName;

            // Block to make sure we only have one request outstanding
            await gettingFileProperties.WaitAsync();

            BasicProperties bp = null;
            try
            {
                bp = await f.GetBasicPropertiesAsync().AsTask(ct);
            }
            catch (Exception) { }
            finally
            {
                gettingFileProperties.Release();
            }

            ct.ThrowIfCancellationRequested();

            item.Size = (int)bp.Size;
            item.Key = f.FolderRelativeId;

            StorageItemThumbnail thumb = await f.GetThumbnailAsync(ThumbnailMode.SingleItem).AsTask(ct);
            ct.ThrowIfCancellationRequested();
            BitmapImage img = new BitmapImage();
            await img.SetSourceAsync(thumb).AsTask(ct);

            item.ImageData = img;
            return item;
        }

Member Data Documentation

SemaphoreSlim gettingFileProperties = new SemaphoreSlim(1) [static, private]

Definition at line 30 of file FileItem.cs.

Property Documentation

string Filename [get, set]

Definition at line 23 of file FileItem.cs.

BitmapImage ImageData [get, set]

Definition at line 25 of file FileItem.cs.

string Key [get, set]

Definition at line 27 of file FileItem.cs.

int Size [get, set]

Definition at line 24 of file FileItem.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/FileItem.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemCacheManager< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • ItemCacheManager< T >
Classes | Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

ItemCacheManager< T > Class Template Reference

List of all members.

Classes

class | CacheEntryBlock-g

Public Member Functions

async void | fetchData ()
delegate Task< T[]> | fetchDataCallbackHandler (ItemIndexRange range, CancellationToken ct)
ItemIndexRange | GetFirstRequestBlock (int maxsize=50)
int | IndexOf (T value)
ItemCacheManager (fetchDataCallbackHandler callback, int batchsize=50, string debugName="ItemCacheManager")
void | startFetchData ()
void | UpdateRanges (ItemIndexRange[] ranges)

Properties

T | this [int index] [get, set]

Events

TypedEventHandler< object,
CacheChangedEventArgs< T > > 		CacheChanged

Private Member Functions

void | AddOrExtendBlock (int index, T value, int insertBeforeBlock)
bool | HasRangesChanged (ItemIndexRange[] ranges)
ItemIndexRange[] | NormalizeRanges (ItemIndexRange[] ranges)

Private Attributes

List< CacheEntryBlock< T > > | cacheBlocks
ItemIndexRangeList cachedResults
CancellationTokenSource | cancelTokenSource
fetchDataCallbackHandler | fetchDataCallback
int | maxBatchFetchSize
ItemIndexRange | requestInProgress
internal ItemIndexRangeList | requests
Windows.UI.Xaml.DispatcherTimer | timer

Detailed Description

template<T>
class DataVirtualizationSample::ItemCacheManager-g< T >

Definition at line 20 of file ItemCacheManager.cs.

Member Function Documentation

void AddOrExtendBlock | ( | int | index,
 |  | T | value,
 |  | int | insertBeforeBlock |
 | ) |  |  | [inline, private]

Definition at line 116 of file ItemCacheManager.cs.

        {
            if (insertBeforeBlock > 0)
            {
                CacheEntryBlock<T> block = cacheBlocks[insertBeforeBlock - 1];
                if (block.lastIndex == index - 1)
                {
                    T[] newItems = new T[block.Length + 1];
                    Array.Copy(block.Items, newItems, (int)block.Length);
                    newItems[block.Length] = value;
                    block.Length++;
                    block.Items = newItems;
                    return;
                }
            }
            CacheEntryBlock<T> newBlock = new CacheEntryBlock<T>() { FirstIndex = index, Length = 1, Items = new T[] { value } };
            cacheBlocks.Insert(insertBeforeBlock, newBlock);
        }

async void fetchData ( ) [inline]

Definition at line 287 of file ItemCacheManager.cs.

        {
            //Stop the timer so we don't get fired again unless data is requested
            timer.Stop();
            if (this.requestInProgress != null)
            {
                // Verify if an active request is still needed
                if (this.requests.Intersects(requestInProgress))
                {
                    return;
                }
                else
                {
                    // Cancel the existing request
#if TRACE_DATASOURCE
                    Debug.WriteLine(">" + debugName + " Cancelling request: " + requestInProgress.FirstIndex + "->" + requestInProgress.LastIndex);
#endif
                    cancelTokenSource.Cancel();
                }
            }

            ItemIndexRange nextRequest = GetFirstRequestBlock(maxBatchFetchSize);
            if (nextRequest != null)
            {
                cancelTokenSource = new CancellationTokenSource();
                CancellationToken ct = cancelTokenSource.Token;
                requestInProgress = nextRequest;
                T[] data = null;
                try
                {
#if TRACE_DATASOURCE
                    Debug.WriteLine(">" + debugName + " Fetching items " + nextRequest.FirstIndex + "->" + nextRequest.LastIndex);
#endif
                    // Use the callback to get the data, passing in a cancellation token
                    data = await fetchDataCallback(nextRequest, ct);

                    if (!ct.IsCancellationRequested)
                    {
#if TRACE_DATASOURCE
                        Debug.WriteLine(">" + debugName + " Inserting items into cache at: " + nextRequest.FirstIndex + "->" + (nextRequest.FirstIndex + data.Length - 1));
#endif
                        for (int i = 0; i < data.Length; i++)
                        {
                            int cacheIndex = (int)(nextRequest.FirstIndex + i);

                            T oldItem = this[cacheIndex];
                            T newItem = data[i];

                            if (!newItem.Equals(oldItem))
                            {
                                this[cacheIndex] = newItem;

                                // Fire CacheChanged so that the datasource can fire its INCC event, and do other work based on the item having data
                                if (CacheChanged != null)
                                {
                                    CacheChanged(this, new CacheChangedEventArgs<T>() { oldItem = oldItem, newItem = newItem, itemIndex = cacheIndex });
                                }
                            }
                        }
                        requests.Subtract(new ItemIndexRange(nextRequest.FirstIndex, (uint)data.Length));
                    }
                }
                // Try/Catch is needed as cancellation is via an exception
                catch (OperationCanceledException) { }
                finally
                {
                    requestInProgress = null;
                    // Start another request if required
                    fetchData();
                }
            }
        }

delegate Task<T[]> fetchDataCallbackHandler | ( | ItemIndexRange | range,
 |  | CancellationToken | ct
 | ) |  |
ItemIndexRange GetFirstRequestBlock ( int maxsize = 50 ) [inline]

Definition at line 246 of file ItemCacheManager.cs.

        {
            if (this.requests.Count > 0)
            {
                ItemIndexRange range = this.requests[0];
                if (range.Length > 50) range = new ItemIndexRange(range.FirstIndex, 50);
                return range;
            }
            return null;
        }

bool HasRangesChanged ( ItemIndexRange[] ranges ) [inline, private]

Definition at line 227 of file ItemCacheManager.cs.

        {
            if (ranges.Length != cacheBlocks.Count)
            {
                return true;
            }
            for (int i = 0; i < ranges.Length; i++)
            {
                ItemIndexRange r = ranges[i];
                CacheEntryBlock<T> block = this.cacheBlocks[i];
                if (r.FirstIndex != block.FirstIndex || r.LastIndex != block.lastIndex)
                {
                    return true;
                }
            }
            return false;
        }

int IndexOf ( T value ) [inline]

Definition at line 395 of file ItemCacheManager.cs.

        {
            foreach (CacheEntryBlock<T> entry in cacheBlocks)
            {
                int index = Array.IndexOf<T>(entry.Items, value);
                if (index != -1) return index + entry.FirstIndex;
            }
            return -1;
        }

ItemCacheManager | ( | fetchDataCallbackHandler | callback,
 |  | int | batchsize = 50,
 |  | string | debugName = "ItemCacheManager" |
 | ) |  |  | [inline]

Definition at line 45 of file ItemCacheManager.cs.

        {
            cacheBlocks = new List<CacheEntryBlock<T>>();
            requests = new ItemIndexRangeList();
            cachedResults = new ItemIndexRangeList();
            fetchDataCallback = callback;
            maxBatchFetchSize = batchsize;
            //set up a timer that is used to delay fetching data so that we can catch up if the list is scrolling fast
            timer = new Windows.UI.Xaml.DispatcherTimer();
            timer.Tick += (sender, args) =>
            {
                fetchData();
            };
            timer.Interval = new TimeSpan(20 * 10000);

#if DEBUG
            this.debugName = debugName;
#endif
#if TRACE_DATASOURCE
            Debug.WriteLine(debugName + "* Cache initialized/reset");
#endif
        }

ItemIndexRange [] NormalizeRanges ( ItemIndexRange[] ranges ) [inline, private]

Merges a set of ranges to form a new set of non-contiguous ranges.

Parameters:
ranges The list of ranges to merge
Returns:
A smaller set of merged ranges

Definition at line 366 of file ItemCacheManager.cs.

        {
            List<ItemIndexRange> results = new List<ItemIndexRange>();
            foreach (ItemIndexRange range in ranges)
            {
                bool handled = false;
                for (int i = 0; i < results.Count; i++)
                {
                    ItemIndexRange existing = results[i];
                    if (range.ContiguousOrOverlaps(existing))
                    {
                        results[i] = existing.Combine(range);
                        handled = true;
                        break;
                    }
                    else if (range.FirstIndex < existing.FirstIndex)
                    {
                        results.Insert(i, range);
                        handled = true;
                        break;
                    }
                }
                if (!handled) { results.Add(range); }
            }
            return results.ToArray();
        }

void startFetchData ( ) [inline]

Definition at line 260 of file ItemCacheManager.cs.

        {
            // Verify if an active request is still needed
            if (this.requestInProgress != null)
            {
                if (this.requests.Intersects(requestInProgress))
                {
                    return;
                }
                else
                {
                    //cancel the existing request
#if TRACE_DATASOURCE
                    Debug.WriteLine("> " + debugName + " Cancelling request: " + requestInProgress.FirstIndex + "->" + requestInProgress.LastIndex);
#endif
                    cancelTokenSource.Cancel();
                }
            }

            //Using a timer to delay fetching data by 20ms, if another range comes in that time, then the timer is reset.
            timer.Stop();
            timer.Start();
        }

void UpdateRanges ( ItemIndexRange[] ranges ) [inline]

Updates the desired item range of the cache, discarding items that are not needed, and figuring out which items need to be requested.

It will then kick off a fetch if required.

Parameters:
ranges New set of ranges the cache should hold

Definition at line 140 of file ItemCacheManager.cs.

        {
            //Normalize ranges to get a unique set of discontinuous ranges
            ranges = NormalizeRanges(ranges);

            // Fail fast if the ranges haven't changed
            if (!HasRangesChanged(ranges)) { return; }

            //To make the cache update easier, we'll create a new set of CacheEntryBlocks
            List<CacheEntryBlock<T>> newCacheBlocks = new List<CacheEntryBlock<T>>();
            foreach (ItemIndexRange range in ranges)
            {
                CacheEntryBlock<T> newBlock = new CacheEntryBlock<T>() { FirstIndex = range.FirstIndex, Length = range.Length, Items = new T[range.Length] };
                newCacheBlocks.Add(newBlock);
            }

#if TRACE_DATASOURCE
            string s = "┌ " + debugName + ".UpdateRanges: ";
            foreach (ItemIndexRange range in ranges)
            {
                s += range.FirstIndex + "->" + range.LastIndex + " ";
            }
            Debug.WriteLine(s);
#endif
            //Copy over data to the new cache blocks from the old ones where there is overlap
            int lastTransferred = 0;
            for (int i = 0; i < ranges.Length; i++)
            {
                CacheEntryBlock<T> newBlock = newCacheBlocks[i];
                ItemIndexRange range = ranges[i];
                int j = lastTransferred;
                while (j < this.cacheBlocks.Count && this.cacheBlocks[j].FirstIndex <= ranges[i].LastIndex)
                {
                    ItemIndexRange overlap, oldEntryRange;
                    ItemIndexRange[] added, removed;
                    CacheEntryBlock<T> oldBlock = this.cacheBlocks[j];
                    oldEntryRange = new ItemIndexRange(oldBlock.FirstIndex, oldBlock.Length);
                    bool hasOverlap = oldEntryRange.DiffRanges(range, out overlap, out removed, out added);
                    if (hasOverlap)
                    {
                        Array.Copy(oldBlock.Items, overlap.FirstIndex - oldBlock.FirstIndex, newBlock.Items, overlap.FirstIndex - range.FirstIndex, (int)overlap.Length);
#if TRACE_DATASOURCE
                        Debug.WriteLine("│ Transfering cache items " + overlap.FirstIndex + "->" + overlap.LastIndex);
#endif
                    }
                    j++;
                    if (ranges.Length > i + 1 && oldBlock.lastIndex < ranges[i + 1].FirstIndex) { lastTransferred = j; }
                }
            }
            //swap over to the new cache
            this.cacheBlocks = newCacheBlocks;

            //figure out what items need to be fetched because we don't have them in the cache
            this.requests = new ItemIndexRangeList(ranges);
            ItemIndexRangeList newCachedResults = new ItemIndexRangeList();

            // Use the previous knowlege of what we have cached to form the new list
            foreach (ItemIndexRange range in ranges)
            {
                foreach (ItemIndexRange cached in this.cachedResults)
                {
                    ItemIndexRange overlap;
                    ItemIndexRange[] added, removed;
                    bool hasOverlap = cached.DiffRanges(range, out overlap, out removed, out added);
                    if (hasOverlap) { newCachedResults.Add(overlap); }
                }
            }
            // remove the data we know we have cached from the results
            foreach (ItemIndexRange range in newCachedResults)
            {
                this.requests.Subtract(range);
            }
            this.cachedResults = newCachedResults;

            startFetchData();

#if TRACE_DATASOURCE
            s = "└ Pending requests: ";
            foreach (ItemIndexRange range in this.requests)
            {
                s += range.FirstIndex + "->" + range.LastIndex + " ";
            }
            Debug.WriteLine(s);
#endif
        }

Member Data Documentation

List<CacheEntryBlock<T> > cacheBlocks [private]

Definition at line 23 of file ItemCacheManager.cs.

ItemIndexRangeList cachedResults [private]

Definition at line 29 of file ItemCacheManager.cs.

CancellationTokenSource cancelTokenSource [private]

Definition at line 33 of file ItemCacheManager.cs.

fetchDataCallbackHandler fetchDataCallback [private]

Definition at line 35 of file ItemCacheManager.cs.

int maxBatchFetchSize [private]

Definition at line 37 of file ItemCacheManager.cs.

ItemIndexRange requestInProgress [private]

Definition at line 31 of file ItemCacheManager.cs.

internal ItemIndexRangeList requests [private]

Definition at line 26 of file ItemCacheManager.cs.

Windows.UI.Xaml.DispatcherTimer timer [private]

Definition at line 39 of file ItemCacheManager.cs.

Property Documentation

T this[int index] [get, set]

Indexer for access to the item cache.

Parameters:
index Item Index
Returns:

Definition at line 76 of file ItemCacheManager.cs.

Event Documentation

TypedEventHandler<object, CacheChangedEventArgs<T> > CacheChanged

Definition at line 68 of file ItemCacheManager.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • ItemCacheManager< T >
  • ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
Public Attributes | Properties

ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE > Class Template Reference

List of all members.

Public Attributes

int | FirstIndex
ITEMTYPE[] | Items
uint Length

Properties

int | lastIndex [get]

Detailed Description

template<T>
template<ITEMTYPE>
class DataVirtualizationSample::ItemCacheManager-g< T >::CacheEntryBlock-g< ITEMTYPE >

Definition at line 406 of file ItemCacheManager.cs.

Member Data Documentation

int FirstIndex

Definition at line 408 of file ItemCacheManager.cs.

ITEMTYPE [] Items

Definition at line 410 of file ItemCacheManager.cs.

uint Length

Definition at line 409 of file ItemCacheManager.cs.

Property Documentation

int lastIndex [get]

Definition at line 412 of file ItemCacheManager.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemIndexRangeList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • ItemIndexRangeList
Public Member Functions | Properties | Private Member Functions | Private Attributes

ItemIndexRangeList Class Reference

Represents a sorted collection of discontiguous ItemIndexRanges. More...

List of all members.

Public Member Functions

ItemIndexRangeList ()
ItemIndexRangeList (List< ItemIndexRange > ranges)
ItemIndexRangeList (ItemIndexRange[] ranges)
void | Add (ItemIndexRange newrange)
void | Add (uint FirstIndex, uint Length)
void | Clear ()
bool | Contains (ItemIndexRange item)
void | CopyTo (ItemIndexRange[] array, int arrayIndex)
IEnumerator< ItemIndexRange > | GetEnumerator ()
int | IndexOf (ItemIndexRange item)
void | Insert (int index, ItemIndexRange item)
bool | Intersects (ItemIndexRange range)
bool | Remove (ItemIndexRange item)
void | RemoveAt (int index)
void | Subtract (ItemIndexRange range)
void | Subtract (uint FirstIndex, uint Length)
ItemIndexRange[] | ToArray ()
List< ItemIndexRange > | ToList ()

Properties

int | Count [get]
bool | IsReadOnly [get]
ItemIndexRange | this [int index] [get, set]

Private Member Functions

IEnumerator IEnumerable. | GetEnumerator ()
List< ItemIndexRange > | NormalizeRanges (IEnumerable< ItemIndexRange > ranges)

Private Attributes

List< ItemIndexRange > | _ranges

Detailed Description

Definition at line 13 of file ItemIndexRangeList.cs.

Constructor & Destructor Documentation

ItemIndexRangeList ( ) [inline]

Definition at line 18 of file ItemIndexRangeList.cs.

        {
            this._ranges = new List<ItemIndexRange>();
        }

ItemIndexRangeList ( List< ItemIndexRange > ranges ) [inline]

Definition at line 23 of file ItemIndexRangeList.cs.

        {
            this._ranges = NormalizeRanges(ranges);
        }

ItemIndexRangeList ( ItemIndexRange[] ranges ) [inline]

Definition at line 28 of file ItemIndexRangeList.cs.

        {
            this._ranges = NormalizeRanges(ranges);
        }

Member Function Documentation

void Add ( ItemIndexRange newrange ) [inline]

Merges the range into the rangelist, combining with existing ranges if necessary.

Parameters:
newrange Range to merge into the collection

Definition at line 47 of file ItemIndexRangeList.cs.

        {
            for (int i = 0; i < this._ranges.Count; i++)
            {
                ItemIndexRange existing = this._ranges[i];
                if (newrange.ContiguousOrOverlaps(existing))
                {
                    existing = existing.Combine(newrange);
                    for (int j = i + 1; j < this._ranges.Count; j++)
                    {
                        ItemIndexRange next = this._ranges[j];
                        if (existing.ContiguousOrOverlaps(next))
                        {
                            existing = existing.Combine(next);
                            this._ranges.RemoveAt(i + 1);
                        }
                    }
                    this._ranges[i] = existing;
                    return;
                }
                else if (newrange.LastIndex < existing.FirstIndex)
                {
                    this._ranges.Insert(i, newrange);
                    return;
                }
            }
            this._ranges.Add(newrange);
        }

void Add | ( | uint | FirstIndex,
 |  | uint | Length |
 | ) |  |  | [inline]

Merges the range into the rangelist, combining with existing ranges if necessary.

Definition at line 79 of file ItemIndexRangeList.cs.

        {
            this.Add(new ItemIndexRange((int)FirstIndex, Length));
        }

void Clear ( ) [inline]

Definition at line 216 of file ItemIndexRangeList.cs.

        {
            ((IList<ItemIndexRange>)_ranges).Clear();
        }

bool Contains ( ItemIndexRange item ) [inline]

Definition at line 221 of file ItemIndexRangeList.cs.

        {
            return ((IList<ItemIndexRange>)_ranges).Contains(item);
        }

void CopyTo | ( | ItemIndexRange[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 226 of file ItemIndexRangeList.cs.

        {
            ((IList<ItemIndexRange>)_ranges).CopyTo(array, arrayIndex);
        }

IEnumerator<ItemIndexRange> GetEnumerator ( ) [inline]

Definition at line 191 of file ItemIndexRangeList.cs.

        {
            return ((IEnumerable<ItemIndexRange>)_ranges).GetEnumerator();
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 196 of file ItemIndexRangeList.cs.

        {
            return ((IEnumerable<ItemIndexRange>)_ranges).GetEnumerator();
        }

int IndexOf ( ItemIndexRange item ) [inline]

Definition at line 201 of file ItemIndexRangeList.cs.

        {
            return ((IList<ItemIndexRange>)_ranges).IndexOf(item);
        }

void Insert | ( | int | index,
 |  | ItemIndexRange | item |
 | ) |  |  | [inline]

Definition at line 206 of file ItemIndexRangeList.cs.

        {
            ((IList<ItemIndexRange>)_ranges).Insert(index, item);
        }

bool Intersects ( ItemIndexRange range ) [inline]

Definition at line 138 of file ItemIndexRangeList.cs.

        {
            foreach (ItemIndexRange r in this._ranges)
            {
                if (r.Intersects(range))
                {
                    return true;
                }
            }
            return false;
        }

List<ItemIndexRange> NormalizeRanges ( IEnumerable< ItemIndexRange > ranges ) [inline, private]

Definition at line 152 of file ItemIndexRangeList.cs.

        {
            List<ItemIndexRange> results = new List<ItemIndexRange>();
            foreach (ItemIndexRange range in ranges)
            {
                bool handled = false;
                for (int i = 0; i < results.Count; i++)
                {
                    ItemIndexRange existing = results[i];
                    if (range.ContiguousOrOverlaps(existing))
                    {
                        results[i] = existing.Combine(range);
                        handled = true;
                        break;
                    }
                    else if (range.FirstIndex < existing.FirstIndex)
                    {
                        results.Insert(i, range);
                        handled = true;
                        break;
                    }
                }
                if (!handled) results.Add(range);
            }
            return results;
        }

bool Remove ( ItemIndexRange item ) [inline]

Definition at line 231 of file ItemIndexRangeList.cs.

        {
            return ((IList<ItemIndexRange>)_ranges).Remove(item);
        }

void RemoveAt ( int index ) [inline]

Definition at line 211 of file ItemIndexRangeList.cs.

        {
            ((IList<ItemIndexRange>)_ranges).RemoveAt(index);
        }

void Subtract | ( | uint | FirstIndex,
 |  | uint | Length |
 | ) |  |  | [inline]

Definition at line 133 of file ItemIndexRangeList.cs.

        {
            this.Subtract(new ItemIndexRange((int)FirstIndex, Length));
        }

void Subtract ( ItemIndexRange range ) [inline]

Removes a range from the collection, splitting existing ranges if necessary.

Definition at line 87 of file ItemIndexRangeList.cs.

        {
            for (int idx = 0; idx < this._ranges.Count; idx++)
            {
                ItemIndexRange existing = this._ranges[idx];
                if (existing.FirstIndex > range.LastIndex) return;

                int i, j;
                i = Math.Max(existing.FirstIndex, range.FirstIndex);
                j = Math.Min(existing.LastIndex, range.LastIndex);

                if (i <= j)
                {
                    if (existing.FirstIndex < i && existing.LastIndex > j)
                    {
                        //range is in the middle of existing range, so split existing into two
                        this._ranges[idx] = (new ItemIndexRange(existing.FirstIndex, (uint)(i - existing.FirstIndex)));
                        this._ranges.Insert(idx + 1, new ItemIndexRange(j + 1, (uint)(existing.LastIndex - j)));
                        return;
                    }
                    else if (existing.LastIndex > j)
                    {
                        //range ends before existing so trim existing to be the remainder
                        this._ranges[idx] = new ItemIndexRange(j + 1, (uint)(existing.LastIndex - j));
                        return;
                    }
                    else if (existing.FirstIndex < i)
                    {
                        //range starts after existing so trim existing to the part before range
                        this._ranges[idx] = new ItemIndexRange(existing.FirstIndex, (uint)(i - existing.FirstIndex));
                    }
                    else
                    {
                        //existing is overlapped by range, so remove it.
                        this._ranges.RemoveAt(idx);
                    }
                    //trim the subtracted range to the remainder, and exit if complete
                    if (range.LastIndex > j)
                    {
                        range = new ItemIndexRange(j + 1, (uint)(range.LastIndex - j));
                    }
                    else { return; }
                }
            }
        }

ItemIndexRange [] ToArray ( ) [inline]

Definition at line 38 of file ItemIndexRangeList.cs.

        {
            return this._ranges.ToArray();
        }

List<ItemIndexRange> ToList ( ) [inline]

Definition at line 33 of file ItemIndexRangeList.cs.

        {
            return this._ranges;
        }

Member Data Documentation

List<ItemIndexRange> _ranges [private]

Definition at line 15 of file ItemIndexRangeList.cs.

Property Documentation

int Count [get]

Definition at line 180 of file ItemIndexRangeList.cs.

bool IsReadOnly [get]

Definition at line 182 of file ItemIndexRangeList.cs.

ItemIndexRange this[int index] [get, set]

Definition at line 185 of file ItemIndexRangeList.cs.

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/ItemIndexRangeList.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • Scenario1
Public Member Functions | Private Member Functions

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Private Member Functions

void | Grid1_ContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
async void | initdata ()

Detailed Description

Definition at line 26 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 29 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
            Grid1.ContainerContentChanging += Grid1_ContainerContentChanging;
            initdata();
        }

Member Function Documentation

void Grid1_ContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario1.xaml.cs.

        {
            if (!args.InRecycleQueue)
            {
                // Sets a textblock in each item indicating its index
                FrameworkElement ctr = (FrameworkElement)args.ItemContainer.ContentTemplateRoot;
                if (ctr != null)
                {
                    TextBlock t = (TextBlock)ctr.FindName("idx");
                    t.Text = args.ItemIndex.ToString();
                }
            }
        }

async void initdata ( ) [inline, private]

Definition at line 50 of file Scenario1.xaml.cs.

        {
            StorageLibrary pictures = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            string path = pictures.SaveFolder.Path;

            FileDataSource ds = await FileDataSource.GetDataSoure(path);
            if (ds.Count > 0)
            {
                Grid1.ItemsSource = ds;
            }
            else
            {
                MainPage.Current.NotifyUser("Error: The pictures folder doesn't contain any files", NotifyType.ErrorMessage);
            }
        }

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario1/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DataVirtualizationSample
  • Scenario2
Public Member Functions | Private Member Functions

Scenario2 Class Reference

List of all members.

Public Member Functions

Scenario2 ()

Private Member Functions

void | ForceReset_Click (object sender, RoutedEventArgs e)
void | Grid1_ContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
async void | initdata ()

Detailed Description

Definition at line 21 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 23 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
            Grid1.ContainerContentChanging += Grid1_ContainerContentChanging;
            initdata();
        }

Member Function Documentation

void ForceReset_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario2.xaml.cs.

        {
            FileDataSource2 ds = Grid1.ItemsSource as FileDataSource2;
            if (ds != null) ds.ResetCollection();
        }

void Grid1_ContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario2.xaml.cs.

        {
            if (!args.InRecycleQueue)
            {
                FrameworkElement ctr = (FrameworkElement)args.ItemContainer.ContentTemplateRoot;
                if (ctr != null)
                {
                    TextBlock t = (TextBlock)ctr.FindName("idx");
                    t.Text = args.ItemIndex.ToString();
                }
            }
        }

async void initdata ( ) [inline, private]

Definition at line 43 of file Scenario2.xaml.cs.

        {
            StorageLibrary pictures = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            string path = pictures.SaveFolder.Path;

            FileDataSource2 ds = await FileDataSource2.GetDataSoure(path);
            if (ds.Count > 0)
            {
                Grid1.ItemsSource = ds;
            }
            else
            {
                MainPage.Current.NotifyUser("Error: The pictures folder doesn't contain any files", NotifyType.ErrorMessage);
            }
        }

The documentation for this class was generated from the following file:
  • XamlDataVirtualization/cs/Scenario2/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DDS_HEADER Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

DDS_HEADER Struct Reference

List of all members.

Public Attributes

uint32_t | caps
uint32 | caps
uint32_t | caps2
uint32 | caps2
uint32_t | caps3
uint32 | caps3
uint32_t | caps4
uint32 | caps4
DDS_PIXELFORMAT ddspf
uint32 | depth
uint32_t | depth
uint32 | flags
uint32_t | flags
uint32 | height
uint32_t | height
uint32 | mipMapCount
uint32_t | mipMapCount
uint32_t | pitchOrLinearSize
uint32 | pitchOrLinearSize
uint32_t | reserved1 [11]
uint32 | reserved1 [11]
uint32 | reserved2
uint32_t | reserved2
uint32 | size
uint32_t | size
uint32_t | width
uint32 | width

Detailed Description

Definition at line 93 of file DDSTextureLoader.cpp.

Member Data Documentation

uint32 caps

Definition at line 104 of file DDSTextureLoader.cpp.

uint32 caps

Definition at line 122 of file DDSTextureLoader.cpp.

uint32 caps2

Definition at line 105 of file DDSTextureLoader.cpp.

uint32 caps2

Definition at line 123 of file DDSTextureLoader.cpp.

uint32 caps3

Definition at line 106 of file DDSTextureLoader.cpp.

uint32 caps3

Definition at line 124 of file DDSTextureLoader.cpp.

uint32 caps4

Definition at line 107 of file DDSTextureLoader.cpp.

uint32 caps4

Definition at line 125 of file DDSTextureLoader.cpp.

DDS_PIXELFORMAT ddspf

Definition at line 103 of file DDSTextureLoader.cpp.

uint32 depth

Definition at line 118 of file DDSTextureLoader.cpp.

uint32 depth

Definition at line 100 of file DDSTextureLoader.cpp.

uint32 flags

Definition at line 114 of file DDSTextureLoader.cpp.

uint32 flags

Definition at line 96 of file DDSTextureLoader.cpp.

uint32 height

Definition at line 115 of file DDSTextureLoader.cpp.

uint32 height

Definition at line 97 of file DDSTextureLoader.cpp.

uint32 mipMapCount

Definition at line 119 of file DDSTextureLoader.cpp.

uint32 mipMapCount

Definition at line 101 of file DDSTextureLoader.cpp.

uint32 pitchOrLinearSize

Definition at line 99 of file DDSTextureLoader.cpp.

uint32 pitchOrLinearSize

Definition at line 117 of file DDSTextureLoader.cpp.

uint32 reserved1

Definition at line 102 of file DDSTextureLoader.cpp.

uint32 reserved1[11]

Definition at line 120 of file DDSTextureLoader.cpp.

uint32 reserved2

Definition at line 126 of file DDSTextureLoader.cpp.

uint32 reserved2

Definition at line 108 of file DDSTextureLoader.cpp.

uint32 size

Definition at line 113 of file DDSTextureLoader.cpp.

uint32 size

Definition at line 95 of file DDSTextureLoader.cpp.

uint32 width

Definition at line 98 of file DDSTextureLoader.cpp.

uint32 width

Definition at line 116 of file DDSTextureLoader.cpp.

The documentation for this struct was generated from the following files:
  • HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp
  • Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp
  • Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.cpp
  • Simple3DGameXaml/cpp/Common/DDSTextureLoader.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DDS_HEADER_DXT10 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

DDS_HEADER_DXT10 Struct Reference

List of all members.

Public Attributes

uint32_t | arraySize
uint32 | arraySize
DXGI_FORMAT | dxgiFormat
uint32 | miscFlag
uint32_t | miscFlag
uint32_t | miscFlags2
uint32 | miscFlags2
uint32 | resourceDimension
uint32_t | resourceDimension

Detailed Description

Definition at line 111 of file DDSTextureLoader.cpp.

Member Data Documentation

uint32 arraySize

Definition at line 116 of file DDSTextureLoader.cpp.

uint32 arraySize

Definition at line 134 of file DDSTextureLoader.cpp.

DXGI_FORMAT dxgiFormat

Definition at line 113 of file DDSTextureLoader.cpp.

uint32 miscFlag

Definition at line 133 of file DDSTextureLoader.cpp.

uint32 miscFlag

Definition at line 115 of file DDSTextureLoader.cpp.

uint32 miscFlags2

Definition at line 117 of file DDSTextureLoader.cpp.

uint32 miscFlags2

Definition at line 135 of file DDSTextureLoader.cpp.

uint32 resourceDimension

Definition at line 132 of file DDSTextureLoader.cpp.

uint32 resourceDimension

Definition at line 114 of file DDSTextureLoader.cpp.

The documentation for this struct was generated from the following files:
  • HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp
  • Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp
  • Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.cpp
  • Simple3DGameXaml/cpp/Common/DDSTextureLoader.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DDS_PIXELFORMAT Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

DDS_PIXELFORMAT Struct Reference

List of all members.

Public Attributes

uint32_t | ABitMask
uint32 | ABitMask
uint32_t | BBitMask
uint32 | BBitMask
uint32 | flags
uint32_t | flags
uint32_t | fourCC
uint32 | fourCC
uint32_t | GBitMask
uint32 | GBitMask
uint32_t | RBitMask
uint32 | RBitMask
uint32_t | RGBBitCount
uint32 | RGBBitCount
uint32_t | size
uint32 | size

Detailed Description

Definition at line 53 of file DDSTextureLoader.cpp.

Member Data Documentation

uint32 ABitMask

Definition at line 62 of file DDSTextureLoader.cpp.

uint32 ABitMask

Definition at line 58 of file DDSTextureLoader.cpp.

uint32 BBitMask

Definition at line 61 of file DDSTextureLoader.cpp.

uint32 BBitMask

Definition at line 57 of file DDSTextureLoader.cpp.

uint32 flags

Definition at line 52 of file DDSTextureLoader.cpp.

uint32 flags

Definition at line 56 of file DDSTextureLoader.cpp.

uint32 fourCC

Definition at line 57 of file DDSTextureLoader.cpp.

uint32 fourCC

Definition at line 53 of file DDSTextureLoader.cpp.

uint32 GBitMask

Definition at line 60 of file DDSTextureLoader.cpp.

uint32 GBitMask

Definition at line 56 of file DDSTextureLoader.cpp.

uint32 RBitMask

Definition at line 59 of file DDSTextureLoader.cpp.

uint32 RBitMask

Definition at line 55 of file DDSTextureLoader.cpp.

uint32 RGBBitCount

Definition at line 58 of file DDSTextureLoader.cpp.

uint32 RGBBitCount

Definition at line 54 of file DDSTextureLoader.cpp.

uint32 size

Definition at line 55 of file DDSTextureLoader.cpp.

uint32 size

Definition at line 51 of file DDSTextureLoader.cpp.

The documentation for this struct was generated from the following files:
  • HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp
  • Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp
  • Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.cpp
  • Simple3DGameXaml/cpp/Common/DDSTextureLoader.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccessHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Desfire
  • AccessHandler
Public Member Functions | Properties

AccessHandler Class Reference

Access handler class for Desfire based ICC. More...

List of all members.

Public Member Functions

AccessHandler (SmartCardConnection ScConnection)
async Task< CardDetails > | ReadCardDetailsAsync ()
async Task< byte[]> | ReadDataAsync (byte fileNumber, ulong offset, ulong length)
async Task< byte[]> | ReadRecordAsync (byte fileNumber, ulong offset, ulong numberOfRecords)
async Task | SelectApplicationAsync (byte[] aid)

Properties

SmartCardConnection | connectionObject [get, set]
DesfireCommand | desfireCommand [get, set]
DesfireResponse | desfireResponse [get, set]

Detailed Description

It provides wrappers for different Desfire commands

Definition at line 24 of file DesfireAccessHandler.cs.

Constructor & Destructor Documentation

AccessHandler ( SmartCardConnection ScConnection ) [inline]

Class constructor.

Parameters:
ScConnection connection object to a Desfire ICC

Definition at line 44 of file DesfireAccessHandler.cs.

        {
            connectionObject = ScConnection;

            desfireCommand = new DesfireCommand();
        }

Member Function Documentation

async Task<CardDetails> ReadCardDetailsAsync ( ) [inline]

Read card details commands.

Returns:
returns Desfire CardDetails object

Definition at line 56 of file DesfireAccessHandler.cs.

        {
            desfireCommand.Command = (byte) DesfireCommand.CommandType.GetVersion;
            desfireCommand.Data = null;

            DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (!desfireRes.SubsequentFrame || desfireRes.ResponseData.Length != 7)
            {
                return null;
            }

            CardDetails card = new CardDetails();

            card.HardwareVendorID = desfireRes.ResponseData[0];
            card.HardwareType = desfireRes.ResponseData[1];
            card.HardwareSubType = desfireRes.ResponseData[2];
            card.HardwareMajorVersion = desfireRes.ResponseData[3];
            card.HardwareMinorVersion = desfireRes.ResponseData[4];
            card.HardwareStorageSize = desfireRes.ResponseData[5];
            card.HardwareProtocolType = desfireRes.ResponseData[6];

            desfireCommand.Command = (byte)DesfireCommand.CommandType.GetAdditionalFrame;
            desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (!desfireRes.SubsequentFrame || desfireRes.ResponseData.Length != 7)
            {
                // Not expected
                return null;
            }
            card.SoftwareVendorID = desfireRes.ResponseData[0];
            card.SoftwareType = desfireRes.ResponseData[1];
            card.SoftwareSubType = desfireRes.ResponseData[2];
            card.SoftwareMajorVersion = desfireRes.ResponseData[3];
            card.SoftwareMinorVersion = desfireRes.ResponseData[4];
            card.SoftwareStorageSize = desfireRes.ResponseData[5];
            card.SoftwareProtocolType = desfireRes.ResponseData[6];

            desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (!desfireRes.Succeeded || desfireRes.ResponseData.Length != 14)
            {
                // Not expected
                return null;
            }

            card.UID = new byte[7];
            System.Buffer.BlockCopy(desfireRes.ResponseData, 0, card.UID, 0, 7);

            card.ProductionBatchNumber = new byte[5];
            System.Buffer.BlockCopy(desfireRes.ResponseData, 7, card.ProductionBatchNumber, 0, 5);

            card.WeekOfProduction = desfireRes.ResponseData[12];
            card.YearOfProduction = desfireRes.ResponseData[13];

            return card;
        }

async Task<byte[]> ReadDataAsync | ( | byte | fileNumber,
 |  | ulong | offset,
 |  | ulong | length |
 | ) |  |  | [inline]

Read data command.

Parameters:
fileNumber
offset
length
Returns:
byte array of read data

Definition at line 148 of file DesfireAccessHandler.cs.

        {
            var args = new byte[7];
            args[0] = fileNumber;
            args[1] = (byte)(offset & 0xFF);
            args[2] = (byte)((offset >> 8) & 0xFF);
            args[3] = (byte)((offset >> 16) & 0xFF);
            args[4] = (byte)(length & 0xFF);
            args[5] = (byte)((length >> 8) & 0xFF);
            args[6] = (byte)((length >> 16) & 0xFF);

            desfireCommand.Command = (byte)DesfireCommand.CommandType.ReadData;
            desfireCommand.Data = args;

            DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (!desfireRes.Succeeded)
            {
                throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
            }

            return desfireRes.ResponseData;
        }

async Task<byte[]> ReadRecordAsync | ( | byte | fileNumber,
 |  | ulong | offset,
 |  | ulong | numberOfRecords |
 | ) |  |  | [inline]

Read record comand.

Parameters:
fileNumber
offset
numberOfRecords
Returns:
byte array of read data

Definition at line 180 of file DesfireAccessHandler.cs.

        {
            var args = new byte[7];
            args[0] = fileNumber;
            args[1] = (byte)(offset & 0xFF);
            args[2] = (byte)((offset >> 8) & 0xFF);
            args[3] = (byte)((offset >> 16) & 0xFF);
            args[4] = (byte)(numberOfRecords & 0xFF);
            args[5] = (byte)((numberOfRecords >> 8) & 0xFF);
            args[6] = (byte)((numberOfRecords >> 16) & 0xFF);

            desfireCommand.Command = (byte)DesfireCommand.CommandType.ReadRecord;
            desfireCommand.Data = args;

            DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (desfireRes.BoundaryError)
            {
                // Boundary error, the record doesn't exist
                return null;
            }
            if (!desfireRes.Succeeded)
            {
                throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
            }

            return desfireRes.ResponseData;
        }

async Task SelectApplicationAsync ( byte[] aid ) [inline]

Select ICC application by AID.

Parameters:
aid application id

Definition at line 119 of file DesfireAccessHandler.cs.

        {
            if (aid.Length != 3)
            {
                throw new NotSupportedException();
            }

            desfireCommand.Command = (byte)DesfireCommand.CommandType.SelectApplication;
            desfireCommand.Data = aid;

            DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;

            if (!desfireResponse.Succeeded)
            {
                throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
            }
        }

Property Documentation

SmartCardConnection connectionObject [get, set, private]

connection object to smart card

Definition at line 29 of file DesfireAccessHandler.cs.

DesfireCommand desfireCommand [get, set, private]

Desfire command APDU.

Definition at line 33 of file DesfireAccessHandler.cs.

DesfireResponse desfireResponse [get, set, private]

Desfire response APDU.

Definition at line 37 of file DesfireAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/DesfireAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CardDetails Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Desfire
  • CardDetails
Public Member Functions | Properties

CardDetails Class Reference

Class hodls Desfire card details information. More...

List of all members.

Public Member Functions

override string | ToString ()

Properties

byte | HardwareMajorVersion [get, set]
byte | HardwareMinorVersion [get, set]
byte | HardwareProtocolType [get, set]
byte | HardwareStorageSize [get, set]
byte | HardwareSubType [get, set]
byte | HardwareType [get, set]
byte | HardwareVendorID [get, set]
byte[] | ProductionBatchNumber [get, set]
byte | SoftwareMajorVersion [get, set]
byte | SoftwareMinorVersion [get, set]
byte | SoftwareProtocolType [get, set]
byte | SoftwareStorageSize [get, set]
byte | SoftwareSubType [get, set]
byte | SoftwareType [get, set]
byte | SoftwareVendorID [get, set]
byte[] | UID [get, set]
byte | WeekOfProduction [get, set]
byte | YearOfProduction [get, set]

Detailed Description

Definition at line 212 of file DesfireAccessHandler.cs.

Member Function Documentation

override string ToString ( ) [inline]

Definition at line 234 of file DesfireAccessHandler.cs.

        {
            return
                "HardwareVendorID = " + HardwareVendorID.ToString() + Environment.NewLine +
                "HardwareType = " + HardwareType.ToString() + Environment.NewLine +
                "HardwareSubType = " + HardwareSubType.ToString() + Environment.NewLine +
                "HardwareMajorVersion = " + HardwareMajorVersion.ToString() + Environment.NewLine +
                "HardwareMinorVersion = " + HardwareMinorVersion.ToString() + Environment.NewLine +
                "HardwareStorageSize = " + HardwareStorageSize.ToString() + Environment.NewLine +
                "HardwareProtocolType = " + HardwareProtocolType.ToString() + Environment.NewLine +
                "SoftwareVendorID = " + SoftwareVendorID.ToString() + Environment.NewLine +
                "SoftwareType = " + SoftwareType.ToString() + Environment.NewLine +
                "SoftwareSubType = " + SoftwareSubType.ToString() + Environment.NewLine +
                "SoftwareMajorVersion = " + SoftwareMajorVersion.ToString() + Environment.NewLine +
                "SoftwareMinorVersion = " + SoftwareMinorVersion.ToString() + Environment.NewLine +
                "SoftwareStorageSize = " + SoftwareStorageSize.ToString() + Environment.NewLine +
                "SoftwareProtocolType = " + SoftwareProtocolType.ToString() + Environment.NewLine +
                "UID = " + BitConverter.ToString(UID) + Environment.NewLine +
                "ProductionBatchNumber = " + BitConverter.ToString(ProductionBatchNumber) + Environment.NewLine +
                "WeekOfProduction = " + WeekOfProduction.ToString() + Environment.NewLine +
                "YearOfProduction = " + YearOfProduction.ToString() + Environment.NewLine;
        }

Property Documentation

byte HardwareMajorVersion [get, set]

Definition at line 217 of file DesfireAccessHandler.cs.

byte HardwareMinorVersion [get, set]

Definition at line 218 of file DesfireAccessHandler.cs.

byte HardwareProtocolType [get, set]

Definition at line 220 of file DesfireAccessHandler.cs.

byte HardwareStorageSize [get, set]

Definition at line 219 of file DesfireAccessHandler.cs.

byte HardwareSubType [get, set]

Definition at line 216 of file DesfireAccessHandler.cs.

byte HardwareType [get, set]

Definition at line 215 of file DesfireAccessHandler.cs.

byte HardwareVendorID [get, set]

Definition at line 214 of file DesfireAccessHandler.cs.

byte [] ProductionBatchNumber [get, set]

Definition at line 231 of file DesfireAccessHandler.cs.

byte SoftwareMajorVersion [get, set]

Definition at line 224 of file DesfireAccessHandler.cs.

byte SoftwareMinorVersion [get, set]

Definition at line 225 of file DesfireAccessHandler.cs.

byte SoftwareProtocolType [get, set]

Definition at line 227 of file DesfireAccessHandler.cs.

byte SoftwareStorageSize [get, set]

Definition at line 226 of file DesfireAccessHandler.cs.

byte SoftwareSubType [get, set]

Definition at line 223 of file DesfireAccessHandler.cs.

byte SoftwareType [get, set]

Definition at line 222 of file DesfireAccessHandler.cs.

byte SoftwareVendorID [get, set]

Definition at line 221 of file DesfireAccessHandler.cs.

byte [] UID [get, set]

Definition at line 229 of file DesfireAccessHandler.cs.

byte WeekOfProduction [get, set]

Definition at line 232 of file DesfireAccessHandler.cs.

byte YearOfProduction [get, set]

Definition at line 233 of file DesfireAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/DesfireAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DesfireCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Desfire
  • DesfireCommand
Public Types | Public Member Functions | Properties

DesfireCommand Class Reference

Class DesfireCommand extends the Iso7816.ApduCommand and provides mappings to Iso7816 command fields. More...

Inherits Iso7816::ApduCommand.

List of all members.

Public Types

enum CommandType {
GetVersion = 0x60, GetAdditionalFrame = 0xAF, SelectApplication = 0x5A, ReadData = 0xBD,
ReadRecord = 0xBB
}

Public Member Functions

DesfireCommand ()
DesfireCommand (CommandType cmd, byte[] data)

Properties

byte | Command [get, set]
byte[] | Data [get, set]

Detailed Description

Definition at line 18 of file DesfireCommand.cs.

Member Enumeration Documentation

enum CommandType
Enumerator:
GetVersion
GetAdditionalFrame
SelectApplication
ReadData
ReadRecord

Definition at line 30 of file DesfireCommand.cs.

                                : byte
        {
            GetVersion = 0x60,
            GetAdditionalFrame = 0xAF,
            SelectApplication = 0x5A,
            ReadData = 0xBD,
            ReadRecord = 0xBB
        };

Constructor & Destructor Documentation

DesfireCommand ( ) [inline]

Definition at line 39 of file DesfireCommand.cs.

            : base((byte)Iso7816.Cla.ProprietaryCla9x, 0, 0, 0, null, 0)
        {
            ApduResponseType = typeof(Desfire.DesfireResponse);
        }

DesfireCommand | ( | CommandType | cmd,
 |  | byte[] | data |
 | ) |  |  | [inline]

Definition at line 44 of file DesfireCommand.cs.

            : base((byte)Iso7816.Cla.ProprietaryCla9x, (byte)cmd, 0x00, 0x00, data, 0x00)
        {
            ApduResponseType = typeof(Desfire.DesfireResponse);
        }

Property Documentation

byte Command [get, set]

Definition at line 21 of file DesfireCommand.cs.

byte [] Data [get, set]

Definition at line 26 of file DesfireCommand.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/DesfireCommand.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DesfireResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Desfire
  • DesfireResponse
Public Member Functions | Properties

DesfireResponse Class Reference

Class DesfireResponse extends the Iso7816.ApduResponse.

Inherits Iso7816::ApduResponse.

List of all members.

Public Member Functions

DesfireResponse ()

Properties

bool | BoundaryError [get]
bool | SubsequentFrame [get]
override bool | Succeeded [get]
override string | SWTranslation [get]

Detailed Description

Definition at line 53 of file DesfireCommand.cs.

Constructor & Destructor Documentation

DesfireResponse ( ) [inline]

Definition at line 55 of file DesfireCommand.cs.

            : base()
        { }

Property Documentation

bool BoundaryError [get]

Definition at line 94 of file DesfireCommand.cs.

bool SubsequentFrame [get]

Definition at line 87 of file DesfireCommand.cs.

override bool Succeeded [get]

Reimplemented from ApduResponse.

Definition at line 80 of file DesfireCommand.cs.

override string SWTranslation [get]

Reimplemented from ApduResponse.

Definition at line 59 of file DesfireCommand.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/DesfireCommand.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DftEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

DftEffect Class Reference

#include "DftEffect.h"

List of all members.

Public Member Functions

IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pEffectContext, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pTransformGraph)

Static Public Member Functions

static HRESULT __stdcall | Create (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

DftEffect ()

Private Attributes

LONG | m_cRef

Detailed Description

Definition at line 19 of file DftEffect.h.

Constructor & Destructor Documentation

DftEffect ( ) [private]

Definition at line 21 of file DftEffect.cpp.

                     :
    m_cRef(0)
{
}

Member Function Documentation

HRESULT __stdcall Create ( _Outptr_ IUnknown ** ppEffectImpl ) [static]

Definition at line 49 of file DftEffect.cpp.

{
    // Use the nothrow syntax so that we can return an HRESULT in the event of an allocation failure.
    // No try/catch is necessary here since there is no code / no possible exceptions in the constructor.
    *ppEffectImpl = static_cast<ID2D1EffectImpl *>(new (std::nothrow) DftEffect());

    if (*ppEffectImpl == nullptr)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        (*ppEffectImpl)->AddRef();
        return S_OK;
    }
}

IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pEffectContext,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |

Definition at line 67 of file DftEffect.cpp.

{
    // Check for compute shader support - DX Feature Level 10_0 is not guaranteed to support compute shaders.
    // Immediately return if compute is not supported.
    D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS hardwareOptions;
    HRESULT hr = pEffectContext->CheckFeatureSupport(
        D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS,
        &hardwareOptions,
        sizeof(hardwareOptions)
        );

    // As stated above, not all DX Feature Level 10_0 parts support compute shaders. In this sample's case,
    // it checks for compute shader support at device creation in DeviceResources. If support is missing,
    // it uses the WARP software fallback, which is guaranteed to support compute.
    // All effects that use compute shaders should perform this check at instantiation.
    if (SUCCEEDED(hr))
    {
        if (!hardwareOptions.computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x)
        {
            return D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES;
        }
    }
    else
    {
        return hr;
    }

    // Create new Transform nodes. The vertical transform must run after all of the horizontal code
    // has run, so it is performed in its own transform. Smart pointers are used here to avoid memory leaks
    // in the event of a failure.
    Microsoft::WRL::ComPtr<DftTransform> dftHorizontalTransform;
    Microsoft::WRL::ComPtr<DftTransform> dftVerticalTransform;

    if (SUCCEEDED(hr))
    {
        try
        {
            dftHorizontalTransform = new (std::nothrow) DftTransform(pEffectContext, TransformType::Horizontal);
            dftVerticalTransform = new (std::nothrow) DftTransform(pEffectContext, TransformType::Vertical);
            if (dftHorizontalTransform == nullptr || dftVerticalTransform == nullptr)
            {
                return E_OUTOFMEMORY;
            }
        }
        catch (Platform::Exception^ e)
        {
            // Return HRESULT if transform throws exception during creation.
            return e->HResult;
        }
    }

    if (SUCCEEDED(hr))
    {
        // Add horizontal transform node to the graph. Still need to connect its inputs/outputs (done below).
        hr = pTransformGraph->AddNode(dftHorizontalTransform.Get());
    }

    if (SUCCEEDED(hr))
    {
        // Connect the input of this transform node to the parent effect's input.
        hr = pTransformGraph->ConnectToEffectInput(0, dftHorizontalTransform.Get(), 0);
    }

    if (SUCCEEDED(hr))
    {
        // Add vertical transform node to the graph. Still need to connect its inputs/outputs (done below).
        // Logically, this transform relies on the horizontal transform's output, and must be located
        // after it in the effect graph.
        hr = pTransformGraph->AddNode(dftVerticalTransform.Get());
    }

    if (SUCCEEDED(hr))
    {
        // Connects the input of the DFTV transform node to the output of the DFTH transform node.
        hr = pTransformGraph->ConnectNode(dftHorizontalTransform.Get(), dftVerticalTransform.Get(), 0);
    }

    if (SUCCEEDED(hr))
    {
        // Designates the output of the DFTV transform node as the output of the effect.
        hr = pTransformGraph->SetOutputNode(dftVerticalTransform.Get());
    }

    return hr;
}

IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )

Definition at line 172 of file DftEffect.cpp.

{
    return S_OK;
}

IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 202 of file DftEffect.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1EffectImpl))
    {
        *ppOutput = static_cast<ID2D1EffectImpl*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]

Definition at line 27 of file DftEffect.cpp.

{
    PCWSTR pszXml =
        XML(
            <?xml version='1.0'?>
            <Effect>
                <!-- System Properties -->
                <Property name='DisplayName' type='string' value='Sample Discrete Fourier Transform (DFT) Compute Effect'/>
                <Property name='Author' type='string' value='Microsoft Corporation'/>
                <Property name='Category' type='string' value='Transform'/>
                <Property name='Description' type='string'
                    value='A sample compute shader effect that computes the Discrete Fourier Transform of a given input.'/>
                <Inputs>
                    <Input name='Source'/>
                </Inputs>
            </Effect>
            );

    return pFactory->RegisterEffectFromString(CLSID_CustomDftEffect, pszXml, nullptr, 0, Create);
}

IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pTransformGraph )

Definition at line 160 of file DftEffect.cpp.

{
    // Because this effect only has one input, it doesn't need to do anything here.
    return E_NOTIMPL;
}

Member Data Documentation

LONG m_cRef [private]

Definition at line 43 of file DftEffect.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/ComputeShader/DftEffect.h
  • D2DCustomEffects/cpp/ComputeShader/DftEffect.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DftTransform Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

DftTransform Class Reference

#include "DftTransform.h"

List of all members.

Public Member Functions

DftTransform (_In_ ID2D1EffectContext *context, TransformType dftType)
IFACEMETHODIMP | CalculateThreadgroups (_In_ const D2D1_RECT_L *pOutputRect, _Out_ UINT32 *pDimensionX, _Out_ UINT32 *pDimensionY, _Out_ UINT32 *pDimensionZ)
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) const D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) const D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | QueryInterface (REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetComputeInfo (_In_ ID2D1ComputeInfo *pComputeInfo)

Private Attributes

struct {
float magnitudeScale
} m_constantBuffer
LONG | m_cRef
TransformType m_dftType
D2D1_RECT_L | m_inputRect
D3D_FEATURE_LEVEL | m_maxLevelSupported

Detailed Description

Definition at line 26 of file DftTransform.h.

Constructor & Destructor Documentation

DftTransform | ( | _In_ ID2D1EffectContext * | context,
 |  | TransformType | dftType
 | ) |  |

Definition at line 22 of file DftTransform.cpp.

                                                                                :
    m_cRef(0),
    m_dftType(dftType)
{
    // Load the Shader Model 5 shader if the device supports it (DX 11_0), otherwise
    // fall back to Shader Model 4.
    D3D_FEATURE_LEVEL levels[] = { D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_11_0 };
    HRESULT hr = context->GetMaximumSupportedFeatureLevel(levels, ARRAYSIZE(levels), &m_maxLevelSupported);

    if (SUCCEEDED(hr))
    {
        BasicReaderWriter^ reader = ref new BasicReaderWriter();

        GUID shaderGUID;
        Platform::String^ shaderFile = "";

        if (m_maxLevelSupported == D3D_FEATURE_LEVEL_11_0)
        {
            if (dftType == TransformType::Horizontal)
            {
                shaderGUID = GUID_DFT_H_CS5;
                shaderFile = "DFT_H_CS5.cso";
            }
            else
            {
                shaderGUID = GUID_DFT_V_CS5;
                shaderFile = "DFT_V_CS5.cso";
            }
        }
        else if (m_maxLevelSupported == D3D_FEATURE_LEVEL_10_0)
        {
            if (dftType == TransformType::Horizontal)
            {
                shaderGUID = GUID_DFT_H_CS4;
                shaderFile = "DFT_H_CS4.cso";
            }
            else
            {
                shaderGUID = GUID_DFT_V_CS4;
                shaderFile = "DFT_V_CS4.cso";
            }
        }

        auto data = reader->ReadData(shaderFile);
        hr = context->LoadComputeShader(shaderGUID, data->Data, data->Length);
    }

    if (FAILED(hr))
    {
        throw Platform::Exception::CreateException(hr);
    }
}

Member Function Documentation

IFACEMETHODIMP CalculateThreadgroups | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_ UINT32 * | pDimensionX,
 |  | _Out_ UINT32 * | pDimensionY,
 |  | _Out_ UINT32 * | pDimensionZ
 | ) |  |

Definition at line 140 of file DftTransform.cpp.

{
    // The dimensions specified here are what Direct2D uses to calculate how many instances of the shader to
    // call (said another way, which parameters are passed to the Direct3D Dispatch call). NumThreads specifies how many pixels
    // one instance of a shader operates on, while the Dimension parameter here specifies how many instances of the
    // shader to call. In this case we divide the width and height of the image by the corresponding NumThreads
    // to determine how many times we need to call the shader.

    // If the image is not perfectly divisible by the numThreads values,
    // the app should round it up to the next whole number then manually
    // check in the shader when the current thread is outside the image's bounds.
    // If the value is not rounded up, the remainder pixels will not be processed.

    *pDimensionX = 0;
    *pDimensionY = 0;

    if (m_maxLevelSupported == D3D_FEATURE_LEVEL_11_0)
    {
        *pDimensionX = static_cast<UINT32>(ceil((m_inputRect.right - m_inputRect.left) / static_cast<float>(CS5_numThreadsX)));
        *pDimensionY = static_cast<UINT32>(ceil((m_inputRect.bottom - m_inputRect.top) / static_cast<float>(CS5_numThreadsY)));
    }
    else if (m_maxLevelSupported == D3D_FEATURE_LEVEL_10_0)
    {
        *pDimensionX = static_cast<UINT32>(ceil((m_inputRect.right - m_inputRect.left) / static_cast<float>(CS4_numThreadsX)));
        *pDimensionY = static_cast<UINT32>(ceil((m_inputRect.bottom - m_inputRect.top) / static_cast<float>(CS4_numThreadsY)));
    }

    *pDimensionZ = 1;

    return S_OK;
}

IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( UINT32 ) const [inline]

Definition at line 32 of file DftTransform.h.

{ return 1; }

IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) const D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) const D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |

Definition at line 110 of file DftTransform.cpp.

{
    // Return an error if more than one input is specified for transform.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    // The output of the transform will be the same size as the input.
    *pOutputRect = pInputRects[0];

    // Save the size of the input for use in MapOutputRectToInputRects
    // and MapInvalidRect. This represents the size of the entire input.
    m_inputRect = pInputRects[0];

    // Because the effect output is merely a graph with a guaranteed alpha of '1',
    // the effect can mark the entire output as opaque. This does not affect the
    // output image itself, but allows Direct2D to use various optimizations, such
    // as using a more simple blend mode.
    *pOutputOpaqueSubRect = *pOutputRect;

    return S_OK;
}

IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const

Definition at line 75 of file DftTransform.cpp.

{
    // Due to the nature of this effect, any change in the input file will affect the entire
    // output. To implement this, the effect sets the invalidOutputRect to the
    // entire input rect.
    *pInvalidOutputRect = m_inputRect;
    return S_OK;
}

IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const

Definition at line 88 of file DftTransform.cpp.

{
    // Return an error if more than one input specified for transform.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    // Most effects will only need the region of the input that directly corresponds to the output,
    // and will want to set the inputRect accordingly. Due to the nature of this algorithm, the
    // effect needs to process the entire input, even if the output is not completely visible.
    // To do so, it sets the inputRect to be the previously reported input (in MapInputRectsToOutputRect),
    // instead of the requested output.
    pInputRects[0] = m_inputRect;

    return S_OK;
}

IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 255 of file DftTransform.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1ComputeTransform))
    {
        *ppOutput = static_cast<ID2D1ComputeTransform*>(this);
    }
    else if (riid == __uuidof(ID2D1Transform))
    {
        *ppOutput = static_cast<ID2D1Transform*>(this);
    }
    else if (riid == __uuidof(ID2D1TransformNode))
    {
        *ppOutput = static_cast<ID2D1TransformNode*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

IFACEMETHODIMP SetComputeInfo ( _In_ ID2D1ComputeInfo * pComputeInfo )

Definition at line 177 of file DftTransform.cpp.

{
    HRESULT hr = S_OK;

    UINT32 instructionCount = 0;

    if (m_dftType == TransformType::Horizontal)
    {
        // The output of the horizontal shader is best represented as a float. This thus instructs
        // Direct2D to set the type of the output buffer to 32 bit floats.
        hr = pComputeInfo->SetOutputBuffer(D2D1_BUFFER_PRECISION_32BPC_FLOAT, D2D1_CHANNEL_DEPTH_4);

        if (SUCCEEDED(hr))
        {
            if (m_maxLevelSupported == D3D_FEATURE_LEVEL_11_0)
            {
                hr = pComputeInfo->SetComputeShader(GUID_DFT_H_CS5);
            }
            else
            {
                hr = pComputeInfo->SetComputeShader(GUID_DFT_H_CS4);
            }
        }
    }
    else
    {
        // Update constant buffer b1 with the magnitude scale factor of our choosing. Constant
        // buffers can be updated as often as the transform wants, such as on property changes.
        m_constantBuffer.magnitudeScale = 500.0f;
        hr = pComputeInfo->SetComputeShaderConstantBuffer(reinterpret_cast<const BYTE*>(&m_constantBuffer), sizeof(m_constantBuffer));

        if (SUCCEEDED(hr))
        {
            if (m_maxLevelSupported == D3D_FEATURE_LEVEL_11_0)
            {
                hr = pComputeInfo->SetComputeShader(GUID_DFT_V_CS5);
            }
            else
            {
                hr = pComputeInfo->SetComputeShader(GUID_DFT_V_CS4);
            }
        }
    }

    if (SUCCEEDED(hr))
    {
        // Providing this hint allows D2D to optimize performance when processing large images.
        pComputeInfo->SetInstructionCountHint(instructionCount);
    }

    return hr;
}

Member Data Documentation

struct { ... } m_constantBuffer [private]
LONG m_cRef [private]

Definition at line 68 of file DftTransform.h.

TransformType m_dftType [private]

Definition at line 71 of file DftTransform.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 69 of file DftTransform.h.

D3D_FEATURE_LEVEL m_maxLevelSupported [private]

Definition at line 70 of file DftTransform.h.

float magnitudeScale

Definition at line 76 of file DftTransform.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/ComputeShader/DftTransform.h
  • D2DCustomEffects/cpp/ComputeShader/DftTransform.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DirectXApplicationSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

DirectXApplicationSource Class Reference

#include "App.h"

List of all members.

Public Member Functions

virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()

Detailed Description

Definition at line 87 of file App.h.

Member Function Documentation

IFrameworkView CreateView ( ) [virtual]

Definition at line 32 of file App.cpp.

{
    return ref new App();
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/App.h
  • D2DGradientMesh/cpp/App.cpp
  • DWriteColorGlyph/cpp/App.cpp
  • Simple3DGameDX/cpp/App.cpp
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DisplaySizeHelper
  • sealed
Public Member Functions

sealed Class Reference

#include "DisplaySizeClass.h"

List of all members.

Public Member Functions

DisplaySizeClass ()
double GetDisplaySizeInInches ()

Detailed Description

Definition at line 4 of file DisplaySizeClass.h.

Member Function Documentation

DisplaySizeClass ( )
double GetDisplaySizeInInches ( )
The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.h
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DragAndDropSampleManaged
  • Scenario1_ListView
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ListView Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_ListView ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

ObservableCollection< string > | GetSampleData ()
void | SourceListView_DragItemsStarting (object sender, DragItemsStartingEventArgs e)
void | TargetListView_DragItemsCompleted (ListViewBase sender, DragItemsCompletedEventArgs args)
void | TargetListView_DragItemsStarting (object sender, DragItemsStartingEventArgs e)
void | TargetListView_DragOver (object sender, DragEventArgs e)
async void | TargetListView_Drop (object sender, DragEventArgs e)
void | TargetTextBlock_DragEnter (object sender, DragEventArgs e)
async void | TargetTextBlock_Drop (object sender, DragEventArgs e)

Private Attributes

string | _deletedItem
ObservableCollection< string > | _reference
ObservableCollection< string > | _selection
MainPage rootPage

Detailed Description

Definition at line 29 of file Scenario1_ListView.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ListView ( ) [inline]

Definition at line 37 of file Scenario1_ListView.xaml.cs.

        {
            this.InitializeComponent();

            _reference = GetSampleData();
            _selection = new ObservableCollection<string>();
            SourceListView.ItemsSource = _reference;
            TargetListView.ItemsSource = _selection;

        }

Member Function Documentation

ObservableCollection<string> GetSampleData ( ) [inline, private]

Definition at line 47 of file Scenario1_ListView.xaml.cs.

        {
            return new ObservableCollection<string>
            {
                "My Research Paper",
                "Electricity Bill",
                "My To-do list",
                "TV sales receipt",
                "Water Bill",
                "Grocery List",
                "Superbowl schedule",
                "World Cup E-ticket"
            };
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 62 of file Scenario1_ListView.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void SourceListView_DragItemsStarting | ( | object | sender,
 |  | DragItemsStartingEventArgs | e |
 | ) |  |  | [inline, private]

DragItemsStarting is called when the Drag and Drop operation starts We take advantage of it to set the content of the DataPackage as well as indicate which operations are supported.

Parameters:
sender
e

Definition at line 74 of file Scenario1_ListView.xaml.cs.

        {
            // Prepare a string with one dragged item per line
            var items = new StringBuilder();
            foreach (var item in e.Items)
            {
                if (items.Length > 0) items.AppendLine();
                items.Append(item as string);
            }
            // Set the content of the DataPackage
            e.Data.SetText(items.ToString());
            // As we want our Reference list to say intact, we only allow Copy
            e.Data.RequestedOperation = DataPackageOperation.Copy;
        }

void TargetListView_DragItemsCompleted | ( | ListViewBase | sender,
 |  | DragItemsCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Called at the end of the operation, whether it was a reorder or move to trash.

Parameters:
sender
args

Definition at line 154 of file Scenario1_ListView.xaml.cs.

        {
            // args.DropResult is always Move and therefore we have to rely on _deletedItem to distinguish
            // between reorder and move to trash
            // Another solution would be to listen for events in the ObservableCollection
            if (_deletedItem != null)
            {
                _selection.Remove(_deletedItem);
                _deletedItem = null;
            }
        }

void TargetListView_DragItemsStarting | ( | object | sender,
 |  | DragItemsStartingEventArgs | e |
 | ) |  |  | [inline, private]

DragtemsStarting is called for D&D and reorder as the framework does not know wherer the user will drop the items.

Reorder means that the target and the source ListView are the same.

Parameters:
sender
e

Definition at line 136 of file Scenario1_ListView.xaml.cs.

        {
            // The ListView is declared with selection mode set to Single.
            // But we want the code to be robust
            if (e.Items.Count == 1)
            {
                e.Data.SetText(e.Items[0] as string);
                // Reorder or move to trash are always a move
                e.Data.RequestedOperation = DataPackageOperation.Move;
                _deletedItem = null;
            }
        }

void TargetListView_DragOver | ( | object | sender,
 |  | DragEventArgs | e |
 | ) |  |  | [inline, private]

DragOver is called when the dragged pointer moves over a UIElement with AllowDrop=True We need to return an AcceptedOperation != None in either DragOver or DragEnter.

Parameters:
sender
e

Definition at line 95 of file Scenario1_ListView.xaml.cs.

        {
            // Our list only accepts text
            e.AcceptedOperation = (e.DataView.Contains(StandardDataFormats.Text)) ? DataPackageOperation.Copy : DataPackageOperation.None;
        }

async void TargetListView_Drop | ( | object | sender,
 |  | DragEventArgs | e |
 | ) |  |  | [inline, private]

We need to return the effective operation from Drop This is not important for our source ListView, but it might be if the user drags text from another source.

Parameters:
sender
e

Definition at line 108 of file Scenario1_ListView.xaml.cs.

        {
            // This test is in theory not needed as we returned DataPackageOperation.None if
            // the DataPackage did not contained text. However, it is always better if each
            // method is robust by itself
            if (e.DataView.Contains(StandardDataFormats.Text))
            {
                // We need to take a Deferral as we won't be able to confirm the end
                // of the operation synchronously
                var def = e.GetDeferral();
                var s = await e.DataView.GetTextAsync();
                var items = s.Split('\n');
                foreach (var item in items)
                {
                    _selection.Add(item);
                }
                e.AcceptedOperation = DataPackageOperation.Copy;
                def.Complete();
            }
        }

void TargetTextBlock_DragEnter | ( | object | sender,
 |  | DragEventArgs | e |
 | ) |  |  | [inline, private]

Entering the Trash icon.

Parameters:
sender
e

Definition at line 171 of file Scenario1_ListView.xaml.cs.

        {
            // Trash only accepts text
            e.AcceptedOperation = (e.DataView.Contains(StandardDataFormats.Text) ? DataPackageOperation.Move : DataPackageOperation.None);
            // We don't want to show the Move icon
            e.DragUIOverride.IsGlyphVisible = false;
            e.DragUIOverride.Caption = "Drop item here to remove it from selection";
        }

async void TargetTextBlock_Drop | ( | object | sender,
 |  | DragEventArgs | e |
 | ) |  |  | [inline, private]

Drop on the Trash.

Parameters:
sender
e

Definition at line 186 of file Scenario1_ListView.xaml.cs.

        {
            if (e.DataView.Contains(StandardDataFormats.Text))
            {
                // We need to take the deferral as the source will read _deletedItem which
                // we cannot set synchronously
                var def = e.GetDeferral();
                _deletedItem = await e.DataView.GetTextAsync();
                e.AcceptedOperation = DataPackageOperation.Move;
                def.Complete();
            }
        }

Member Data Documentation

string _deletedItem [private]

Definition at line 35 of file Scenario1_ListView.xaml.cs.

ObservableCollection<string> _reference [private]

Definition at line 33 of file Scenario1_ListView.xaml.cs.

ObservableCollection<string> _selection [private]

Definition at line 34 of file Scenario1_ListView.xaml.cs.

MainPage rootPage [private]

Definition at line 31 of file Scenario1_ListView.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlDragAndDrop/cs/Scenario1_ListView.xaml.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DragUICustomization Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DragAndDropSampleManaged
  • Scenario2_DragUICustomization
Public Member Functions | Private Member Functions

Scenario2_DragUICustomization Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_DragUICustomization ()

Private Member Functions

async void | SourceGrid_DragStarting (Windows.UI.Xaml.UIElement sender, Windows.UI.Xaml.DragStartingEventArgs args)
void | TargetTextBox_DragEnter (object sender, Windows.UI.Xaml.DragEventArgs e)
void | TargetTextBox_DragLeave (object sender, Windows.UI.Xaml.DragEventArgs e)
async void | TargetTextBox_Drop (object sender, Windows.UI.Xaml.DragEventArgs e)

Detailed Description

Definition at line 26 of file Scenario2_DragUICustomization.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DragUICustomization ( ) [inline]

Definition at line 28 of file Scenario2_DragUICustomization.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void SourceGrid_DragStarting | ( | Windows.UI.Xaml.UIElement | sender,
 |  | Windows.UI.Xaml.DragStartingEventArgs | args |
 | ) |  |  | [inline, private]

Start of the Drag and Drop operation: we set some content and change the DragUI depending on the selected options.

Parameters:
sender
args

Definition at line 39 of file Scenario2_DragUICustomization.xaml.cs.

        {
            args.Data.SetText(SourceTextBox.Text);
            if ((bool)DataPackageRB.IsChecked)
            {
                // Standard icon will be used as the DragUIContent
                args.DragUI.SetContentFromDataPackage();
            }
            else if ((bool)CustomContentRB.IsChecked)
            {
                // Generate a bitmap with only the TextBox
                // We need to take the deferral as the rendering won't be completed synchronously
                var deferral = args.GetDeferral();
                var rtb = new RenderTargetBitmap();
                await rtb.RenderAsync(SourceTextBox);
                var buffer = await rtb.GetPixelsAsync();
                var bitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer,
                    BitmapPixelFormat.Bgra8,
                    rtb.PixelWidth,
                    rtb.PixelHeight,
                    BitmapAlphaMode.Premultiplied);
                args.DragUI.SetContentFromSoftwareBitmap(bitmap);
                deferral.Complete();
            }
            // else just show the dragged UIElement
        }

void TargetTextBox_DragEnter | ( | object | sender,
 |  | Windows.UI.Xaml.DragEventArgs | e |
 | ) |  |  | [inline, private]

Entering the Target, we'll change its background and optionally change the DragUI as well.

Parameters:
sender
e

Change the background of the target

Definition at line 71 of file Scenario2_DragUICustomization.xaml.cs.

        {
            /// Change the background of the target
            VisualStateManager.GoToState(this, "Inside", true);
            bool hasText = e.DataView.Contains(StandardDataFormats.Text);
            e.AcceptedOperation = hasText ? DataPackageOperation.Copy : DataPackageOperation.None;
            if (hasText)
            {
                e.DragUIOverride.Caption = "Drop here to insert text";
                // Now customize the content
                if ((bool)HideRB.IsChecked)
                {
                    e.DragUIOverride.IsGlyphVisible = false;
                    e.DragUIOverride.IsContentVisible = false;
                }
                else if ((bool)CustomRB.IsChecked)
                {
                    var bitmap = new BitmapImage(new Uri("ms-appx:///Assets/dropcursor.png", UriKind.RelativeOrAbsolute));
                    // Anchor will define how to position the image relative to the pointer
                    Point anchor = new Point(0,52); // lower left corner of the image
                    e.DragUIOverride.SetContentFromBitmapImage(bitmap, anchor);
                    e.DragUIOverride.IsGlyphVisible = false;
                    e.DragUIOverride.IsCaptionVisible = false;
                }
                // else keep the DragUI Content set by the source
            }
        }

void TargetTextBox_DragLeave | ( | object | sender,
 |  | Windows.UI.Xaml.DragEventArgs | e |
 | ) |  |  | [inline, private]

DragLeave: Restore previous background.

Parameters:
sender
e

Definition at line 104 of file Scenario2_DragUICustomization.xaml.cs.

        {
            VisualStateManager.GoToState(this, "Outside", true);
        }

async void TargetTextBox_Drop | ( | object | sender,
 |  | Windows.UI.Xaml.DragEventArgs | e |
 | ) |  |  | [inline, private]

Drop: restore the background and append the dragged text.

Parameters:
sender
e

Definition at line 114 of file Scenario2_DragUICustomization.xaml.cs.

        {
            VisualStateManager.GoToState(this, "Outside", true);
            bool hasText = e.DataView.Contains(StandardDataFormats.Text);
            // if the result of the drop is not too important (and a text copy should have no impact on source)
            // we don't need to take the deferral and this will complete the operation faster
            e.AcceptedOperation = hasText ? DataPackageOperation.Copy : DataPackageOperation.None;
            if (hasText)
            {
                var text = await e.DataView.GetTextAsync();
                TargetTextBox.Text += text;
            }
        }

The documentation for this class was generated from the following file:
  • XamlDragAndDrop/cs/Scenario2_DragUICustomization.xaml.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_StartDragAsync Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DragAndDropSampleManaged
  • Scenario3_StartDragAsync
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_StartDragAsync Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_StartDragAsync ()

Private Member Functions

void | DragCompleted (IAsyncOperation< DataPackageOperation > asyncInfo, AsyncStatus asyncStatus)
void | DropBorder_DragEnter (object sender, Windows.UI.Xaml.DragEventArgs e)
void | DropBorder_Drop (object sender, Windows.UI.Xaml.DragEventArgs e)
void | EndRound (bool hasWon)
bool | IsSymbolTargetBorder (object sender)
void | OnTick (object sender, object args)
async void | Scenario3_StartDragAsync_Loaded (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | SourceTextBlock_DragStarting (Windows.UI.Xaml.UIElement sender, Windows.UI.Xaml.DragStartingEventArgs e)
void | SourceTextBlock_PointerMoved (object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
void | StartButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

IAsyncOperation
< DataPackageOperation > 		_dragOperation
bool | _isActive
Random | _rnd = new Random()
string | _symbol
ObservableCollection< string > | _symbols
DispatcherTimer | _timer

Detailed Description

Definition at line 27 of file Scenario3_StartDragAsync.xaml.cs.

Constructor & Destructor Documentation

Scenario3_StartDragAsync ( ) [inline]

Definition at line 41 of file Scenario3_StartDragAsync.xaml.cs.

        {
            this.InitializeComponent();
            this.Loaded += Scenario3_StartDragAsync_Loaded;
        }

Member Function Documentation

void DragCompleted | ( | IAsyncOperation< DataPackageOperation > | asyncInfo,
 |  | AsyncStatus | asyncStatus |
 | ) |  |  | [inline, private]

Completion callback for the asynchronous call: it is called whether the drop succeeded, or the user released the pointer on a non-target or else we cancelled the operation from the timer's callback.

Parameters:
asyncInfo
asyncStatus

Definition at line 145 of file Scenario3_StartDragAsync.xaml.cs.

        {
            _dragOperation = null;
            if (_timer != null) _timer.Stop();
            EndRound((asyncStatus == AsyncStatus.Completed) && (asyncInfo.GetResults() == DataPackageOperation.Copy));
        }

void DropBorder_DragEnter | ( | object | sender,
 |  | Windows.UI.Xaml.DragEventArgs | e |
 | ) |  |  | [inline, private]

Entering a target: check if this will result in a win.

Parameters:
sender
e

Definition at line 180 of file Scenario3_StartDragAsync.xaml.cs.

        {
            bool win = (_dragOperation != null) && e.DataView.Contains(StandardDataFormats.Text) && IsSymbolTargetBorder(sender);
            e.AcceptedOperation = win ? DataPackageOperation.Copy : DataPackageOperation.None;
            e.DragUIOverride.IsCaptionVisible = false;
        }

void DropBorder_Drop | ( | object | sender,
 |  | Windows.UI.Xaml.DragEventArgs | e |
 | ) |  |  | [inline, private]

Drop: check if this results in a win.

Parameters:
sender
e

Definition at line 192 of file Scenario3_StartDragAsync.xaml.cs.

        {
            bool win = (_dragOperation != null) && e.DataView.Contains(StandardDataFormats.Text) && IsSymbolTargetBorder(sender);
            e.AcceptedOperation = win ? DataPackageOperation.Copy : DataPackageOperation.None;
        }

void EndRound ( bool hasWon ) [inline, private]

Update the user interface when the round is finished.

Parameters:
hasWon

Definition at line 130 of file Scenario3_StartDragAsync.xaml.cs.

        {
            _isActive = false;
            ResultTextBlock.Text = (hasWon ? "You win :-) !!" : "You lose :-( !!");
            StartButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            SourceTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

bool IsSymbolTargetBorder ( object sender ) [inline, private]

Check if the sender is a border AND has the dragged symbol.

Parameters:
sender
Returns:

Definition at line 169 of file Scenario3_StartDragAsync.xaml.cs.

        {
            var border = sender as Border;
            return (border != null) && (border.DataContext as string == _symbol);
        }

void OnTick | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

End of the timer: player lost and we might have to cancel the drag operation.

Parameters:
sender
args

Definition at line 91 of file Scenario3_StartDragAsync.xaml.cs.

        {
            _timer.Stop();
            if (_dragOperation != null)
            {
                // Cancel the drag operation: this is equivalent of the user pressing Escape
                // or releasing the pointer on a non-target
                // DropCompleted event would return DataPackageOperation.None as the result
                _dragOperation.Cancel();
            }
            else
            {
                // We test _isActive just in case the timer expired when we were handling the drop
                if (_isActive)
                {
                    EndRound(false);
                }
            }
        }

async void Scenario3_StartDragAsync_Loaded | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario3_StartDragAsync.xaml.cs.

        {
            // Initialize the symbols from the Text file
            var uri = new Uri("ms-appx:///Assets/Symbols.txt", UriKind.RelativeOrAbsolute);
            var file = await StorageFile.GetFileFromApplicationUriAsync(uri);
            var lines = await FileIO.ReadLinesAsync(file);
            _symbols = new ObservableCollection<string>(lines);
            DropGridView.ItemsSource = _symbols;
        }

void SourceTextBlock_DragStarting | ( | Windows.UI.Xaml.UIElement | sender,
 |  | Windows.UI.Xaml.DragStartingEventArgs | e |
 | ) |  |  | [inline, private]

DragStarting is called even if we are starting the Drag Operation ourselved with StartDragAsync In this sample, we don't really need to handle it.

Parameters:
sender
e

Definition at line 158 of file Scenario3_StartDragAsync.xaml.cs.

        {
            e.Data.RequestedOperation = DataPackageOperation.Copy;
            e.Data.SetText(_symbol);
        }

void SourceTextBlock_PointerMoved | ( | object | sender,
 |  | Windows.UI.Xaml.Input.PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

If the pointer is moved and we are not yet dragging, start a drag operation using StartDragAsync, which will allow a later cancellation.

Parameters:
sender
e

Definition at line 117 of file Scenario3_StartDragAsync.xaml.cs.

        {
            if (_isActive && e.Pointer.IsInContact && (_dragOperation == null))
            {
                _dragOperation = SourceTextBlock.StartDragAsync(e.GetCurrentPoint(SourceTextBlock));
                _dragOperation.Completed = DragCompleted;
            }
        }

void StartButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Start button clicked: select a symbol, update the display and start the timer according to the difficulty level.

Parameters:
sender
e

Definition at line 63 of file Scenario3_StartDragAsync.xaml.cs.

        {
            if (!_isActive)
            {
                int index = _rnd.Next(_symbols.Count);
                _symbol = _symbols[index];
                SourceTextBlock.Text = _symbol;
                ResultTextBlock.Text = string.Empty;
                _isActive = true;

                if (_timer == null)
                {
                    _timer = new DispatcherTimer();
                    _timer.Tick += OnTick;
                }
                bool easy = (EasyRB.IsChecked != null) && EasyRB.IsChecked.Value;
                _timer.Interval = TimeSpan.FromSeconds(easy ? 5.0 : 1.5);
                _timer.Start();
                StartButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                SourceTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

Member Data Documentation

IAsyncOperation<DataPackageOperation> _dragOperation [private]

Definition at line 39 of file Scenario3_StartDragAsync.xaml.cs.

bool _isActive [private]

Definition at line 33 of file Scenario3_StartDragAsync.xaml.cs.

Random _rnd = new Random() [private]

Definition at line 29 of file Scenario3_StartDragAsync.xaml.cs.

string _symbol [private]

Definition at line 35 of file Scenario3_StartDragAsync.xaml.cs.

ObservableCollection<string> _symbols [private]

Definition at line 31 of file Scenario3_StartDragAsync.xaml.cs.

DispatcherTimer _timer [private]

Definition at line 37 of file Scenario3_StartDragAsync.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlDragAndDrop/cs/Scenario3_StartDragAsync.xaml.cs
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTextRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteColorTextRenderer
  • CustomTextRenderer
Public Member Functions | Private Attributes

CustomTextRenderer Class Reference

#include "CustomTextRenderer.h"

List of all members.

Public Member Functions

CustomTextRenderer (Microsoft::WRL::ComPtr< ID2D1Factory > d2dFactory, Microsoft::WRL::ComPtr< ID2D1DeviceContext4 > d2dDeviceContext)
IFACEMETHOD() | DrawGlyphRun (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE measuringMode, _In_ DWRITE_GLYPH_RUN const *glyphRun, _In_ DWRITE_GLYPH_RUN_DESCRIPTION const *glyphRunDescription, IUnknown *clientDrawingEffect)
IFACEMETHOD() | DrawInlineObject (_In_opt_ void *clientDrawingContext, FLOAT originX, FLOAT originY, IDWriteInlineObject *inlineObject, BOOL isSideways, BOOL isRightToLeft, IUnknown *clientDrawingEffect)
IFACEMETHOD() | DrawStrikethrough (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, _In_ DWRITE_STRIKETHROUGH const *strikethrough, IUnknown *clientDrawingEffect)
IFACEMETHOD() | DrawUnderline (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, _In_ DWRITE_UNDERLINE const *underline, IUnknown *clientDrawingEffect)
IFACEMETHOD() | GetCurrentTransform (_In_opt_ void *clientDrawingContext, _Out_ DWRITE_MATRIX *transform)
IFACEMETHOD() | GetPixelsPerDip (_In_opt_ void *clientDrawingContext, _Out_ FLOAT *pixelsPerDip)
IFACEMETHOD_ (unsigned long, Release)()
IFACEMETHOD_ (unsigned long, AddRef)()
IFACEMETHOD() | IsPixelSnappingDisabled (_In_opt_ void *clientDrawingContext, _Out_ BOOL *isDisabled)
IFACEMETHOD() | QueryInterface (IID const &riid, void **ppvObject)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1DeviceContext4 > 		m_d2dDeviceContext
Microsoft::WRL::ComPtr
< ID2D1Factory > 		m_d2dFactory
Microsoft::WRL::ComPtr
< IDWriteFactory4 > 		m_dwriteFactory
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_outlineBrush
unsigned long | m_refCount
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_tempBrush

Detailed Description

Definition at line 17 of file CustomTextRenderer.h.

Constructor & Destructor Documentation

CustomTextRenderer | ( | Microsoft::WRL::ComPtr< ID2D1Factory > | d2dFactory,
 |  | Microsoft::WRL::ComPtr< ID2D1DeviceContext4 > | d2dDeviceContext
 | ) |  |

Member Function Documentation

HRESULT DrawGlyphRun | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | DWRITE_MEASURING_MODE | measuringMode,
 |  | _In_ DWRITE_GLYPH_RUN const * | glyphRun,
 |  | _In_ DWRITE_GLYPH_RUN_DESCRIPTION const * | glyphRunDescription,
 |  | IUnknown * | clientDrawingEffect
 | ) |  |

Definition at line 53 of file CustomTextRenderer.cpp.

{
    HRESULT hr = DWRITE_E_NOCOLOR;

    D2D1_POINT_2F baselineOrigin = D2D1::Point2F(baselineOriginX, baselineOriginY);

    // The list of glyph image formats this renderer is prepared to support.
    DWRITE_GLYPH_IMAGE_FORMATS supportedFormats =
        DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE |
        DWRITE_GLYPH_IMAGE_FORMATS_CFF |
        DWRITE_GLYPH_IMAGE_FORMATS_COLR |
        DWRITE_GLYPH_IMAGE_FORMATS_SVG |
        DWRITE_GLYPH_IMAGE_FORMATS_PNG |
        DWRITE_GLYPH_IMAGE_FORMATS_JPEG |
        DWRITE_GLYPH_IMAGE_FORMATS_TIFF |
        DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8;

    // Determine whether there are any color glyph runs within glyphRun. If
    // there are, glyphRunEnumerator can be used to iterate through them.
    ComPtr<IDWriteColorGlyphRunEnumerator1> glyphRunEnumerator;
    hr = m_dwriteFactory->TranslateColorGlyphRun(
        baselineOrigin,
        glyphRun,
        glyphRunDescription,
        supportedFormats,
        measuringMode,
        nullptr,
        0,
        &glyphRunEnumerator
        );

    if (hr == DWRITE_E_NOCOLOR)
    {
        // Simple case: the run has no color glyphs. Draw the main glyph run
        // using the current text color.
        m_d2dDeviceContext->DrawGlyphRun(
            baselineOrigin,
            glyphRun,
            glyphRunDescription,
            m_outlineBrush.Get(),
            measuringMode
            );
    }
    else
    {
        DX::ThrowIfFailed(hr);

        // Complex case: the run has one or more color runs within it. Iterate
        // over the sub-runs and draw them, depending on their format.
        for (;;)
        {
            BOOL haveRun;
            DX::ThrowIfFailed(glyphRunEnumerator->MoveNext(&haveRun));
            if (!haveRun)
                break;

            DWRITE_COLOR_GLYPH_RUN1 const* colorRun;
            DX::ThrowIfFailed(glyphRunEnumerator->GetCurrentRun(&colorRun));

            D2D1_POINT_2F currentBaselineOrigin = D2D1::Point2F(
                colorRun->baselineOriginX,
                colorRun->baselineOriginY
                );

            switch (colorRun->glyphImageFormat)
            {
            case DWRITE_GLYPH_IMAGE_FORMATS_PNG:
            case DWRITE_GLYPH_IMAGE_FORMATS_JPEG:
            case DWRITE_GLYPH_IMAGE_FORMATS_TIFF:
            case DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8:
            {
                // This run is bitmap glyphs. Use Direct2D to draw them.
                m_d2dDeviceContext->DrawColorBitmapGlyphRun(
                    colorRun->glyphImageFormat,
                    currentBaselineOrigin,
                    &colorRun->glyphRun,
                    measuringMode
                    );
            }
            break;

            case DWRITE_GLYPH_IMAGE_FORMATS_SVG:
            {
                // This run is SVG glyphs. Use Direct2D to draw them.
                m_d2dDeviceContext->DrawSvgGlyphRun(
                    currentBaselineOrigin,
                    &colorRun->glyphRun,
                    m_outlineBrush.Get(),
                    nullptr,                // svgGlyphStyle
                    0,                      // colorPaletteIndex
                    measuringMode
                    );
            }
            break;

            case DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE:
            case DWRITE_GLYPH_IMAGE_FORMATS_CFF:
            case DWRITE_GLYPH_IMAGE_FORMATS_COLR:
            default:
            {
                // This run is solid-color outlines, either from non-color
                // glyphs or from COLR glyph layers. Use Direct2D to draw them.

                ComPtr<ID2D1Brush> layerBrush;
                if (colorRun->paletteIndex == 0xFFFF)
                {
                    // This run uses the current text color.
                    layerBrush = m_outlineBrush;
                }
                else
                {
                    // This run specifies its own color.
                    m_tempBrush->SetColor(colorRun->runColor);
                    layerBrush = m_tempBrush;
                }

                // Draw the run with the selected color.
                m_d2dDeviceContext->DrawGlyphRun(
                    currentBaselineOrigin,
                    &colorRun->glyphRun,
                    colorRun->glyphRunDescription,
                    layerBrush.Get(),
                    measuringMode
                    );
            }
            break;
            }
        }
    }

    return hr;
}

IFACEMETHODIMP DrawInlineObject | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | originX,
 |  | FLOAT | originY,
 |  | IDWriteInlineObject * | inlineObject,
 |  | BOOL | isSideways,
 |  | BOOL | isRightToLeft,
 |  | IUnknown * | clientDrawingEffect
 | ) |  |

Definition at line 218 of file CustomTextRenderer.cpp.

{
    // Not implemented
    return E_NOTIMPL;
}

IFACEMETHODIMP DrawStrikethrough | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | _In_ DWRITE_STRIKETHROUGH const * | strikethrough,
 |  | IUnknown * | clientDrawingEffect
 | ) |  |

Definition at line 206 of file CustomTextRenderer.cpp.

{
    // Not implemented
    return E_NOTIMPL;
}

IFACEMETHODIMP DrawUnderline | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | _In_ DWRITE_UNDERLINE const * | underline,
 |  | IUnknown * | clientDrawingEffect
 | ) |  |

Definition at line 194 of file CustomTextRenderer.cpp.

{
    // Not implemented
    return E_NOTIMPL;
}

IFACEMETHODIMP GetCurrentTransform | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ DWRITE_MATRIX * | transform
 | ) |  |

Definition at line 258 of file CustomTextRenderer.cpp.

{
    // forward the render target's transform
    m_d2dDeviceContext->GetTransform(reinterpret_cast<D2D1_MATRIX_3X2_F*>(transform));
    return S_OK;
}

IFACEMETHODIMP GetPixelsPerDip | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ FLOAT * | pixelsPerDip
 | ) |  |

Definition at line 268 of file CustomTextRenderer.cpp.

{
    float x, yUnused;

    m_d2dDeviceContext.Get()->GetDpi(&x, &yUnused);
    *pixelsPerDip = x / 96.0f;

    return S_OK;
}

IFACEMETHOD_ | ( | unsigned | long,
 |  | AddRef |
 | ) |  |
IFACEMETHOD_ | ( | unsigned | long,
 |  | Release |
 | ) |  |
IFACEMETHODIMP IsPixelSnappingDisabled | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ BOOL * | isDisabled
 | ) |  |

Definition at line 249 of file CustomTextRenderer.cpp.

{
    *isDisabled = FALSE;
    return S_OK;
}

IFACEMETHODIMP QueryInterface | ( | IID const & | riid,
 |  | void ** | ppvObject
 | ) |  |

Definition at line 281 of file CustomTextRenderer.cpp.

{
    if (__uuidof(IDWriteTextRenderer) == riid)
    {
        *ppvObject = this;
    }
    else if (__uuidof(IDWritePixelSnapping) == riid)
    {
        *ppvObject = this;
    }
    else if (__uuidof(IUnknown) == riid)
    {
        *ppvObject = this;
    }
    else
    {
        *ppvObject = nullptr;
        return E_FAIL;
    }

    this->AddRef();

    return S_OK;
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1DeviceContext4> m_d2dDeviceContext [private]

Definition at line 88 of file CustomTextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1Factory> m_d2dFactory [private]

Definition at line 86 of file CustomTextRenderer.h.

Microsoft::WRL::ComPtr<IDWriteFactory4> m_dwriteFactory [private]

Definition at line 87 of file CustomTextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_outlineBrush [private]

Definition at line 89 of file CustomTextRenderer.h.

unsigned long m_refCount [private]

Definition at line 85 of file CustomTextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_tempBrush [private]

Definition at line 90 of file CustomTextRenderer.h.

The documentation for this class was generated from the following files:
  • DWriteColorGlyph/cpp/CustomTextRenderer.h
  • DWriteColorGlyph/cpp/CustomTextRenderer.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorTextRendererMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteColorTextRenderer
  • DWriteColorTextRendererMain
Public Member Functions | Private Attributes

DWriteColorTextRendererMain Class Reference

#include "DWriteColorTextRendererMain.h"

List of all members.

Public Member Functions

DWriteColorTextRendererMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~DWriteColorTextRendererMain ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render ()
void | UpdateForWindowSizeChange ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< SampleOverlay > | m_sampleOverlay
std::unique_ptr
< DWriteColorTextRendererRenderer > 		m_sceneRenderer

Detailed Description

Definition at line 17 of file DWriteColorTextRendererMain.h.

Constructor & Destructor Documentation

DWriteColorTextRendererMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 17 of file DWriteColorTextRendererMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    m_sceneRenderer = std::unique_ptr<DWriteColorTextRendererRenderer>(new DWriteColorTextRendererRenderer(m_deviceResources));
    m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D color fonts sample"));
}

~DWriteColorTextRendererMain ( )

Definition at line 27 of file DWriteColorTextRendererMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void OnDeviceLost ( ) [virtual]

Definition at line 52 of file DWriteColorTextRendererMain.cpp.

{
    m_sceneRenderer->ReleaseDeviceDependentResources();
    m_sampleOverlay->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 59 of file DWriteColorTextRendererMain.cpp.

{
    m_sceneRenderer->CreateDeviceDependentResources();
    m_sampleOverlay->CreateDeviceDependentResources();
    UpdateForWindowSizeChange();
}

bool Render ( )

Definition at line 42 of file DWriteColorTextRendererMain.cpp.

{
    // Render the scene objects.
    m_sceneRenderer->Render();
    m_sampleOverlay->Render();

    return true;
}

void UpdateForWindowSizeChange ( )

Definition at line 34 of file DWriteColorTextRendererMain.cpp.

{
    m_sceneRenderer->CreateWindowSizeDependentResources();
    m_sampleOverlay->CreateWindowSizeDependentResources();
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 31 of file DWriteColorTextRendererMain.h.

std::unique_ptr<SampleOverlay> m_sampleOverlay [private]

Definition at line 37 of file DWriteColorTextRendererMain.h.

std::unique_ptr<DWriteColorTextRendererRenderer> m_sceneRenderer [private]

Definition at line 34 of file DWriteColorTextRendererMain.h.

The documentation for this class was generated from the following files:
  • DWriteColorGlyph/cpp/DWriteColorTextRendererMain.h
  • DWriteColorGlyph/cpp/DWriteColorTextRendererMain.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorTextRendererRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteColorTextRenderer
  • DWriteColorTextRendererRenderer
Public Member Functions | Private Attributes

DWriteColorTextRendererRenderer Class Reference

#include "DWriteColorTextRendererRenderer.h"

List of all members.

Public Member Functions

DWriteColorTextRendererRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_dwriteTextFormat
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_dwriteTextLayout
Microsoft::WRL::ComPtr
< CustomTextRenderer > 		m_textRenderer

Detailed Description

Definition at line 16 of file DWriteColorTextRendererRenderer.h.

Constructor & Destructor Documentation

DWriteColorTextRendererRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 19 of file DWriteColorTextRendererRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Create a DirectWrite text format object.
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI Emoji",
            nullptr,
            DWRITE_FONT_WEIGHT_REGULAR,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            32.0f,
            L"en-US", // locale
            &m_dwriteTextFormat
            )
        );

    // Center the text horizontally.
    DX::ThrowIfFailed(
        m_dwriteTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    // Center the text vertically.
    DX::ThrowIfFailed(
        m_dwriteTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER)
        );

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 51 of file DWriteColorTextRendererRenderer.cpp.

{
    m_textRenderer = new (std::nothrow) CustomTextRenderer(
        m_deviceResources->GetD2DFactory(),
        m_deviceResources->GetD2DDeviceContext()
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 60 of file DWriteColorTextRendererRenderer.cpp.

{
    Platform::String^ text = L"🌂🌃🌄🌅🌆🌇🌈🌉🌊🌋🌍🌎🌏🌒🌓🌔🌕🌖🌗🌘🌝🌞🌱🌲🌳🌴🌷🌹🌻🌽🌾🍅🍆🍇🍈🍉🍌🍍🍎🍏🍐🍑🍒🍓🍔🍕🍖🍗🍘🍛🍜🍝🍟🍠🍡🍢🍣🍤🍥🍦🍧🍨🍩🍪🍫🍬🍭🍮🍯🍰🍱🍲🍳🍵🍹🍺🍻🍼🎂🎃🎄🎅🎆🎇🎉🎊🎋🎌🎍🎎🎐🎑🎓🎠🎡🎢🎣🎤🎦🎨🎯🎰🎱🎳🎴🎻🎼🎾🎿🏀🏁🏂🏄🏇🏊🏡🏤🏦🏧🏩🏫🏬🐌🐓🐝🐠🐡🐢🐣🐳🐵🐶🐸🐹👆👇👈👉👊👒👔👛👝👦👧👨👩👮👯👰👱👲👳👴👵👶👷👸👹👺👼👾💂💄💅💆💇💈💉💊💋💌💐💑💒💘💝💟💨💩💱💹💺💾📈📉📊📌📍📑📓📔📛📝📟📣📵🔞🔫😁😂😃😄😅😆😇😈😉😊😋😌😍😎😏😐😒😓😔😖😘😚😜😝😞😠😡😢😣😤😥😨😩😪😫😭😰😱😲😳😵😶😷🙅🙆🙇🙈🙉🙊🙋🙌🙍🙎🙏🚀🚃🚄🚅🚆🚈🚉🚊🚋🚌🚍🚎🚏🚐";
    auto size = m_deviceResources->GetLogicalSize();

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            text->Data(),                              // Text to be displayed
            text->Length(),                            // Length of the text
            m_dwriteTextFormat.Get(),                  // DirectWrite Text Format object
            size.Width,                                // Width of the Text Layout
            size.Height,                               // Height of the Text Layout
            &m_dwriteTextLayout
            )
        );
}

void ReleaseDeviceDependentResources ( )

Definition at line 79 of file DWriteColorTextRendererRenderer.cpp.

{
    m_textRenderer.Reset();
}

void Render ( )

Definition at line 85 of file DWriteColorTextRendererRenderer.cpp.

{
    m_deviceResources->GetD2DDeviceContext()->BeginDraw();

    m_deviceResources->GetD2DDeviceContext()->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    m_deviceResources->GetD2DDeviceContext()->SetTransform(
        m_deviceResources->GetOrientationTransform2D()
        );

    D2D1_POINT_2F origin = D2D1::Point2F(0.0f, 0.0f);

    DX::ThrowIfFailed(
        m_dwriteTextLayout->Draw(
            m_deviceResources->GetD2DDeviceContext(),
            m_textRenderer.Get(),
            origin.x,
            origin.y
            )
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 27 of file DWriteColorTextRendererRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_dwriteTextFormat [private]

Definition at line 31 of file DWriteColorTextRendererRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_dwriteTextLayout [private]

Definition at line 30 of file DWriteColorTextRendererRenderer.h.

Microsoft::WRL::ComPtr<CustomTextRenderer> m_textRenderer [private]

Definition at line 32 of file DWriteColorTextRendererRenderer.h.

The documentation for this class was generated from the following files:
  • DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.h
  • DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteColorTextRenderer
  • SampleOverlay
Public Member Functions | Private Attributes

SampleOverlay Class Reference

#include "SampleOverlay.h"

List of all members.

Public Member Functions

SampleOverlay (const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption)
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
float | GetTitleHeightInDips ()
void | ReleaseDeviceDependentResources ()
void | Render ()

Private Attributes

std::wstring | m_caption
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawOverlay
UINT | m_idIncrement
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
float | m_overlayWidth
float | m_padding
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock > 		m_stateBlock
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_textVerticalOffset
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 17 of file SampleOverlay.h.

Constructor & Destructor Documentation

SampleOverlay | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | const std::wstring & | caption
 | ) |  |

Definition at line 20 of file SampleOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_caption(caption),
    m_drawOverlay(true)
{
    m_padding = 8.0f;
    m_textVerticalOffset = 7.0f;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);
    m_overlayWidth = 0.0f;

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 34 of file SampleOverlay.cpp.

{
    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
        );

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
            L"Assets\\storelogo-sdk.png",
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
            )
        );

    double dpiX = 96.0;
    double dpiY = 96.0;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    ComPtr<IDWriteTextFormat> nameTextFormat;
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            36.0f,
            L"en-US",
            &nameTextFormat
            )
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );

    DX::ThrowIfFailed(
        nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );

    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextLayout(
            m_caption.c_str(),
            static_cast<UINT32>(m_caption.size()),
            nameTextFormat.Get(),
            4096.0f,
            4096.0f,
            &m_textLayout
            )
        );

    DWRITE_TEXT_METRICS metrics = {0};
    DX::ThrowIfFailed(
        m_textLayout->GetMetrics(&metrics)
        );

    m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;

    DX::ThrowIfFailed(
        m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
        );
}

void CreateWindowSizeDependentResources ( )

Definition at line 137 of file SampleOverlay.cpp.

{
    if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
    {
        m_drawOverlay = false;
    }
    else
    {
        m_drawOverlay = true;
    }
}

float GetTitleHeightInDips ( )

Definition at line 188 of file SampleOverlay.cpp.

{
    return m_logoSize.height + m_padding;
}

void ReleaseDeviceDependentResources ( )

Definition at line 151 of file SampleOverlay.cpp.

{
    m_whiteBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( )

Definition at line 157 of file SampleOverlay.cpp.

{
    if (m_drawOverlay)
    {
        m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());

        m_deviceResources->GetD2DDeviceContext()->BeginDraw();
        m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
        m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
            );

        m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
            m_textLayout.Get(),
            m_whiteBrush.Get()
            );

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }

        m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
    }
}

Member Data Documentation

std::wstring m_caption [private]

Definition at line 38 of file SampleOverlay.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 28 of file SampleOverlay.h.

bool m_drawOverlay [private]

Definition at line 37 of file SampleOverlay.h.

UINT m_idIncrement [private]

Definition at line 36 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 33 of file SampleOverlay.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 41 of file SampleOverlay.h.

float m_overlayWidth [private]

Definition at line 42 of file SampleOverlay.h.

float m_padding [private]

Definition at line 39 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock> m_stateBlock [private]

Definition at line 31 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 34 of file SampleOverlay.h.

float m_textVerticalOffset [private]

Definition at line 40 of file SampleOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 30 of file SampleOverlay.h.

The documentation for this class was generated from the following files:
  • DWriteColorGlyph/cpp/SampleOverlay.h
  • DWriteColorGlyph/cpp/SampleOverlay.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteColorTextRenderer
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr
< DWriteColorTextRendererMain > 		m_main
bool | m_windowClosed
bool | m_windowVisible

Detailed Description

Definition at line 17 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 46 of file App.h.

std::unique_ptr<DWriteColorTextRendererMain> m_main [private]

Definition at line 47 of file App.h.

bool m_windowClosed [private]

Definition at line 48 of file App.h.

bool m_windowVisible [private]

Definition at line 49 of file App.h.

The documentation for this class was generated from the following file:
  • DWriteColorGlyph/cpp/App.h
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FontNameCollector Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteTextLayoutCloudFontImplementation
  • FontNameCollector
Public Member Functions | Private Attributes

FontNameCollector Class Reference

#include "FontNameCollector.h"

List of all members.

Public Member Functions

ULONG STDMETHODCALLTYPE | AddRef (void) override
void | ClearNames ()
HRESULT STDMETHODCALLTYPE | DrawGlyphRun (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE measuringMode, _In_ DWRITE_GLYPH_RUN const *glyphRun, _In_ DWRITE_GLYPH_RUN_DESCRIPTION const *glyphRunDescription, _In_opt_ IUnknown *clientDrawingEffect) override
HRESULT STDMETHODCALLTYPE | DrawInlineObject (_In_opt_ void *clientDrawingContext, FLOAT originX, FLOAT originY, _In_ IDWriteInlineObject *inlineObject, BOOL isSideways, BOOL isRightToLeft, _In_opt_ IUnknown *clientDrawingEffect) override
HRESULT STDMETHODCALLTYPE | DrawStrikethrough (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, _In_ DWRITE_STRIKETHROUGH const *strikethrough, _In_opt_ IUnknown *clientDrawingEffect) override
HRESULT STDMETHODCALLTYPE | DrawUnderline (_In_opt_ void *clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, _In_ DWRITE_UNDERLINE const *underline, _In_opt_ IUnknown *clientDrawingEffect) override
HRESULT STDMETHODCALLTYPE | GetCurrentTransform (_In_opt_ void *clientDrawingContext, _Out_ DWRITE_MATRIX *transform) override
std::wstring | GetFontNames ()
HRESULT STDMETHODCALLTYPE | GetPixelsPerDip (_In_opt_ void *clientDrawingContext, _Out_ FLOAT *pixelsPerDip) override
HRESULT STDMETHODCALLTYPE | IsPixelSnappingDisabled (_In_opt_ void *clientDrawingContext, _Out_ BOOL *isDisabled) override
HRESULT STDMETHODCALLTYPE | QueryInterface (REFIID riid, _COM_Outptr_ void **obj) override
ULONG STDMETHODCALLTYPE | Release (void) override

Private Attributes

uint32 | m_refCount = 0
std::set< std::wstring > | m_uniqueFontNames

Detailed Description

Definition at line 22 of file FontNameCollector.h.

Member Function Documentation

ULONG STDMETHODCALLTYPE AddRef ( void ) [override]

Definition at line 172 of file FontNameCollector.cpp.

{
    return InterlockedIncrement(&m_refCount);
}

void ClearNames ( )

Definition at line 36 of file FontNameCollector.cpp.

{
    // Clear any names to allow the collector to be re-used with a different layout.
    m_uniqueFontNames.clear();
}

HRESULT STDMETHODCALLTYPE DrawGlyphRun | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | DWRITE_MEASURING_MODE | measuringMode,
 |  | _In_ DWRITE_GLYPH_RUN const * | glyphRun,
 |  | _In_ DWRITE_GLYPH_RUN_DESCRIPTION const * | glyphRunDescription,
 |  | _In_opt_ IUnknown * | clientDrawingEffect |
 | ) |  |  | [override]

Definition at line 46 of file FontNameCollector.cpp.

{
    // Since this is a platform callback that doesn't expect exceptions,
    // we shouldn't leave any exceptions unhandled.
    try
    {
        // The glyph run has a font face, which is what we need to get the font
        // name for this run. Specifically, we want an IDWriteFontFace3 object.

        ComPtr<IDWriteFontFace3> fontFace3;
        DX::ThrowIfFailed(glyphRun->fontFace->QueryInterface(fontFace3.GetAddressOf()));

        ComPtr<IDWriteLocalizedStrings> familyNames;
        DX::ThrowIfFailed(fontFace3->GetFamilyNames(&familyNames));

        // There may be family names in multiple languages, and in a different
        // situation we might want to look for a string that matches the app's UI
        // language (using Windows::Globalization::ApplicationLanguages::Languages).
        // For our purposes here, though, we know that the fonts used will have
        // family names for en-US, and that's sufficient since that's what we used
        // when we created the text format used in the layout.

        UINT32 nameStringIndex = 0;
        BOOL exists = false;
        DX::ThrowIfFailed(familyNames->FindLocaleName(L"en-US", &nameStringIndex, &exists));

        // Given the fonts that will be used, exists should always be true. If for
        // some reason it's false, nameStringIndex will be UINT32_MAX. We want to
        // make sure it's 0: If there's no en-US string, we'll just used the first
        // string.)
        if (!exists)
        {
            nameStringIndex = 0;
        }

        // Need a buffer to get the string.
        std::wstring fontName;
        UINT32 length = 0;
        DX::ThrowIfFailed(familyNames->GetStringLength(nameStringIndex, &length));
        fontName.resize(length);

        // Now get the name and add to the set of names.
        DX::ThrowIfFailed(familyNames->GetString(nameStringIndex, &fontName[0], length + 1));
        m_uniqueFontNames.insert(fontName);

        return S_OK;
    }
    catch (Platform::Exception^ e)
    {
        return e->HResult;
    }
    catch (const std::bad_alloc&)
    {
        return E_OUTOFMEMORY;
    }
    catch (...)
    {
        return E_FAIL;
    }
}

HRESULT STDMETHODCALLTYPE DrawInlineObject | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | originX,
 |  | FLOAT | originY,
 |  | _In_ IDWriteInlineObject * | inlineObject,
 |  | BOOL | isSideways,
 |  | BOOL | isRightToLeft,
 |  | _In_opt_ IUnknown * | clientDrawingEffect |
 | ) |  |  | [inline, override]

Definition at line 41 of file FontNameCollector.h.

        {
            return S_OK;
        }

HRESULT STDMETHODCALLTYPE DrawStrikethrough | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | _In_ DWRITE_STRIKETHROUGH const * | strikethrough,
 |  | _In_opt_ IUnknown * | clientDrawingEffect |
 | ) |  |  | [inline, override]

Definition at line 54 of file FontNameCollector.h.

        {
            return S_OK;
        }

HRESULT STDMETHODCALLTYPE DrawUnderline | ( | _In_opt_ void * | clientDrawingContext,
 |  | FLOAT | baselineOriginX,
 |  | FLOAT | baselineOriginY,
 |  | _In_ DWRITE_UNDERLINE const * | underline,
 |  | _In_opt_ IUnknown * | clientDrawingEffect |
 | ) |  |  | [inline, override]

Definition at line 65 of file FontNameCollector.h.

        {
            return S_OK;
        }

HRESULT STDMETHODCALLTYPE GetCurrentTransform | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ DWRITE_MATRIX * | transform |
 | ) |  |  | [override]

Definition at line 119 of file FontNameCollector.cpp.

{
    static const DWRITE_MATRIX identity = {
        1.0f, 0.0f,
        0.0f, 1.0f,
        0.0f, 0.0f
        };
    *transform = identity;
    return S_OK;
}

std::wstring GetFontNames ( )

Definition at line 20 of file FontNameCollector.cpp.

{
    std::wstring result;
    for (auto& name : m_uniqueFontNames)
    {
        if (!result.empty())
        {
            result += L", ";
        }
        result += name;
    }

    return result;
}

HRESULT STDMETHODCALLTYPE GetPixelsPerDip | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ FLOAT * | pixelsPerDip |
 | ) |  |  | [override]

Definition at line 134 of file FontNameCollector.cpp.

{
    *pixelsPerDip = 1.0f;
    return S_OK;
}

HRESULT STDMETHODCALLTYPE IsPixelSnappingDisabled | ( | _In_opt_ void * | clientDrawingContext,
 |  | _Out_ BOOL * | isDisabled |
 | ) |  |  | [override]

Definition at line 144 of file FontNameCollector.cpp.

{
    *isDisabled = false;
    return S_OK;
}

HRESULT STDMETHODCALLTYPE QueryInterface | ( | REFIID | riid,
 |  | _COM_Outptr_ void ** | obj |
 | ) |  |  | [override]

Definition at line 156 of file FontNameCollector.cpp.

{
    *obj = nullptr;
    if (riid == __uuidof(IDWriteTextRenderer) || riid == __uuidof(IDWritePixelSnapping) || riid == __uuidof(IUnknown))
    {
        AddRef();
        *obj = this;
        return S_OK;
    }
    return E_NOINTERFACE;
}

ULONG STDMETHODCALLTYPE Release ( void ) [override]

Definition at line 177 of file FontNameCollector.cpp.

{
    uint32 newCount = InterlockedDecrement(&m_refCount);
    if (newCount == 0)
        delete this;
    return newCount;
}

Member Data Documentation

uint32 m_refCount = 0 [private]

Definition at line 105 of file FontNameCollector.h.

std::set<std::wstring> m_uniqueFontNames [private]

Definition at line 106 of file FontNameCollector.h.

The documentation for this class was generated from the following files:
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Listener Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteTextLayoutCloudFontImplementation
  • Listener
Public Member Functions | Private Attributes

Listener Class Reference

#include "FontDownloadListener.h"

List of all members.

Public Member Functions

ULONG STDMETHODCALLTYPE | AddRef () override
void STDMETHODCALLTYPE | DownloadCompleted (_In_ IDWriteFontDownloadQueue *downloadQueue, _In_opt_ IUnknown *context, HRESULT downloadResult)
HRESULT STDMETHODCALLTYPE | QueryInterface (REFIID riid, _COM_Outptr_ void **obj) override
ULONG STDMETHODCALLTYPE | Release () override

Private Attributes

uint32 | m_refCount = 0

Detailed Description

Definition at line 23 of file FontDownloadListener.h.

Member Function Documentation

ULONG STDMETHODCALLTYPE AddRef ( ) [override]

Definition at line 42 of file FontDownloadListener.cpp.

{
    return InterlockedIncrement(&m_refCount);
}

void STDMETHODCALLTYPE DownloadCompleted | ( | _In_ IDWriteFontDownloadQueue * | downloadQueue,
 |  | _In_opt_ IUnknown * | context,
 |  | HRESULT | downloadResult
 | ) |  |

Definition at line 56 of file FontDownloadListener.cpp.

{
    // Since this is a platform callback that doesn't expect exceptions,
    // we shouldn't leave any exceptions unhandled.
    try
    {
        if (SUCCEEDED(downloadResult))
        {
            // If we had passed a context in the BeginDownload call, we could test
            // for that context now.
            //
            // Note, however: relying on a context isn't useful if the font download
            // queue is shared with other things, such as the XAML framework, that
            // may also be calling BeginDownload. That's because you may do something,
            // such as creating or modifying a text layout, that results in requests
            // being added to the download queue, but XAML may detect that the queue
            // is not empty and call BeginDownload before you do, and it won't pass in
            // the context you'd be expecting.

            FontDownloadListener::RaiseDownloadCompleted();
        }
    }
    catch (...)
    {
        return;
    }
}

HRESULT STDMETHODCALLTYPE QueryInterface | ( | REFIID | riid,
 |  | _COM_Outptr_ void ** | obj |
 | ) |  |  | [override]

Definition at line 26 of file FontDownloadListener.cpp.

{
    *obj = nullptr;
    if (riid == __uuidof(IDWriteFontDownloadListener) || riid == __uuidof(IUnknown))
    {
        AddRef();
        *obj = this;
        return S_OK;
    }
    return E_NOINTERFACE;
}

ULONG STDMETHODCALLTYPE Release ( ) [override]

Definition at line 47 of file FontDownloadListener.cpp.

{
    uint32 newCount = InterlockedDecrement(&m_refCount);
    if (newCount == 0)
        delete this;
    return newCount;
}

Member Data Documentation

uint32 m_refCount = 0 [private]

Definition at line 43 of file FontDownloadListener.h.

The documentation for this class was generated from the following files:
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteTextLayoutCloudFontImplementation
  • sealed
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "FontDownloadListener.h"

List of all members.

Public Member Functions

virtual | ~FontDownloadListener ()
virtual | ~TextLayoutImageSource ()
FontDownloadListener ()
void | GetFontNames ()
void | InvalidateLayout ()
TextLayout (Platform::String^text, Platform::String^languageTag, Platform::String^fontFamily, float fontSize, float width)
TextLayoutImageSource (TextLayout^textLayout, float dpi)
TextLayoutImageSource (TextLayout^textLayout, float dpi, Windows::UI::Color textColor, Windows::UI::Color backgroundColor)

Static Public Member Functions

static void | BeginDownload ()
static void | Initialize ()

Public Attributes

internal | __pad0__: static void RaiseDownloadCompleted()

Static Public Attributes

static event
FontDownloadCompletedHandler 		DownloadCompleted

Properties

Microsoft::WRL::ComPtr
< IDWriteFactory3 > 		m_dwriteFactory
std::wstring | m_fontFamily
Microsoft::WRL::ComPtr
< FontNameCollector > 		m_fontNameCollector
float | m_fontSize
float | m_height
std::wstring | m_languageTag
std::wstring | m_text
Microsoft::WRL::ComPtr
< IDWriteTextLayout3 > 		m_textLayout
std::wstring | m_usedFontNames
float | m_width

Private Member Functions

void | BeginDraw ()
void | Clear ()
void | CreateDeviceResources ()
void | Draw ()
void | DrawText ()
void | EndDraw ()
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | SetTextBackgroundColor (Windows::UI::Color color)
void | SetTextColor (Windows::UI::Color color)

Private Attributes

D2D1_COLOR_F | m_backgroundColor
Microsoft::WRL::ComPtr
< ID2D1DeviceContext > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1Device > 		m_d2dDevice
Microsoft::WRL::ComPtr
< ID3D11Device > 		m_d3dDevice
Microsoft::WRL::ComPtr
< IDWriteFontDownloadQueue > 		m_downloadQueue
float | m_dpi
uint32 | m_pixelHeight
uint32 | m_pixelWidth
Microsoft::WRL::ComPtr< Listener > | m_registeredListener
Windows::Foundation::EventRegistrationToken | m_suspendEventHandlerRegistrationToken
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBackgroundBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBrush
TextLayout | m_textLayout
uint32 | m_token = 0

Detailed Description

Definition at line 49 of file FontDownloadListener.h.

Constructor & Destructor Documentation

virtual ~FontDownloadListener ( ) [virtual]
virtual ~TextLayoutImageSource ( ) [virtual]

Member Function Documentation

static void BeginDownload ( ) [static]
void BeginDraw ( ) [private]
void Clear ( ) [private]
void CreateDeviceResources ( ) [private]
void Draw ( ) [private]
void DrawText ( ) [private]
void EndDraw ( ) [private]
FontDownloadListener ( )
void GetFontNames ( )
static void Initialize ( ) [static]
void InvalidateLayout ( )
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void SetTextBackgroundColor ( Windows::UI::Color color ) [private]
void SetTextColor ( Windows::UI::Color color ) [private]
TextLayout | ( | Platform::String^ | text,
 |  | Platform::String^ | languageTag,
 |  | Platform::String^ | fontFamily,
 |  | float | fontSize,
 |  | float | width
 | ) |  |
TextLayoutImageSource | ( | TextLayout^ | textLayout,
 |  | float | dpi
 | ) |  |
TextLayoutImageSource | ( | TextLayout^ | textLayout,
 |  | float | dpi,
 |  | Windows::UI::Color | textColor,
 |  | Windows::UI::Color | backgroundColor
 | ) |  |

Member Data Documentation

internal __pad0__

Definition at line 61 of file FontDownloadListener.h.

event FontDownloadCompletedHandler DownloadCompleted [static]

Definition at line 55 of file FontDownloadListener.h.

D2D1_COLOR_F m_backgroundColor [private]

Definition at line 55 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext> m_d2dContext [private]

Definition at line 45 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1Device> m_d2dDevice [private]

Definition at line 44 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID3D11Device> m_d3dDevice [private]

Definition at line 41 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<IDWriteFontDownloadQueue> m_downloadQueue [private]

Definition at line 65 of file FontDownloadListener.h.

float m_dpi [private]

Definition at line 50 of file TextLayoutImageSource.h.

uint32 m_pixelHeight [private]

Definition at line 54 of file TextLayoutImageSource.h.

uint32 m_pixelWidth [private]

Definition at line 53 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<Listener> m_registeredListener [private]

Definition at line 64 of file FontDownloadListener.h.

Windows::Foundation::EventRegistrationToken m_suspendEventHandlerRegistrationToken [private]

Definition at line 38 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBackgroundBrush [private]

Definition at line 57 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBrush [private]

Definition at line 56 of file TextLayoutImageSource.h.

TextLayout m_textLayout [private]

Definition at line 48 of file TextLayoutImageSource.h.

uint32 m_token = 0 [private]

Definition at line 66 of file FontDownloadListener.h.

Property Documentation

Microsoft::WRL::ComPtr<IDWriteFactory3> m_dwriteFactory

Definition at line 67 of file TextLayout.h.

std::wstring m_fontFamily

Definition at line 60 of file TextLayout.h.

Microsoft::WRL::ComPtr<FontNameCollector> m_fontNameCollector

Definition at line 69 of file TextLayout.h.

float m_fontSize

Definition at line 61 of file TextLayout.h.

float m_height

Definition at line 63 of file TextLayout.h.

std::wstring m_languageTag

Definition at line 59 of file TextLayout.h.

std::wstring m_text

Definition at line 58 of file TextLayout.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout3> m_textLayout

Definition at line 68 of file TextLayout.h.

std::wstring m_usedFontNames

Definition at line 64 of file TextLayout.h.

float m_width

Definition at line 62 of file TextLayout.h.

The documentation for this class was generated from the following files:
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.h
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DWriteTextLayoutImplementation
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "TextLayout.h"

List of all members.

Public Member Functions

virtual | ~TextLayoutImageSource ()
void | Draw ()
std::vector< DWRITE_LINE_METRICS1 > | GetLineMetrics ()
Platform::Array< LineMetrics^> | GetTextLayoutLineMetrics ()
TextLayout (Platform::String^text, Platform::String^languageTag, Platform::String^fontFamily, float fontSize, uint32 pixelWidth, DWriteTextLayoutImplementation::LineSpacingMethod lineSpacingMethod)
TextLayoutImageSource (TextLayout^textLayout, uint32 pixelWidth, uint32 pixelHeight)
TextLayoutImageSource (TextLayout^textLayout)

Private Member Functions

void | BeginDraw ()
void | BeginDraw (Windows::Foundation::Rect updateRect)
void | Clear ()
void | CreateDeviceResources ()
void | DrawLineMetricsDecorations ()
void | DrawText ()
void | EndDraw ()
void | EnsureCachedLineMetrics ()
void | InvalidateLayout ()
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | SetLineSpacing ()
void | SetLineSpacingDefaults ()
void | UpdateCachedMetrics ()

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_boundsBrush
Microsoft::WRL::ComPtr
< ID2D1StrokeStyle > 		m_boundsStrokeStyle
Microsoft::WRL::ComPtr
< ID2D1DeviceContext > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1Device > 		m_d2dDevice
Microsoft::WRL::ComPtr
< ID3D11Device > 		m_d3dDevice
Microsoft::WRL::ComPtr
< IDWriteFactory3 > 		m_dwriteFactory
std::wstring | m_fontFamily
float | m_fontSize
std::wstring | m_languageTag
std::vector< DWRITE_LINE_METRICS1 > | m_lineMetrics
DWRITE_LINE_SPACING | m_lineSpacing
uint32 | m_pixelHeight
uint32 | m_pixelWidth
Windows::Foundation::EventRegistrationToken | m_suspendEventHandlerRegistrationToken
std::wstring | m_text
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textAscentBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBackgroundBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textDescentBrush
Microsoft::WRL::ComPtr
< IDWriteTextLayout3 > 		m_textLayout
TextLayout | m_textLayout
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textLineGapBrush

Detailed Description

Definition at line 54 of file TextLayout.h.

Constructor & Destructor Documentation

virtual ~TextLayoutImageSource ( ) [virtual]

Member Function Documentation

void BeginDraw ( ) [private]
void BeginDraw ( Windows::Foundation::Rect updateRect ) [private]
void Clear ( ) [private]
void CreateDeviceResources ( ) [private]
void Draw ( )
void DrawLineMetricsDecorations ( ) [private]
void DrawText ( ) [private]
void EndDraw ( ) [private]
void EnsureCachedLineMetrics ( ) [private]
std::vector<DWRITE_LINE_METRICS1> GetLineMetrics ( )
Platform::Array<LineMetrics^> GetTextLayoutLineMetrics ( )
void InvalidateLayout ( ) [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void SetLineSpacing ( ) [private]
void SetLineSpacingDefaults ( ) [private]
TextLayout | ( | Platform::String^ | text,
 |  | Platform::String^ | languageTag,
 |  | Platform::String^ | fontFamily,
 |  | float | fontSize,
 |  | uint32 | pixelWidth,
 |  | DWriteTextLayoutImplementation::LineSpacingMethod | lineSpacingMethod
 | ) |  |
TextLayoutImageSource ( TextLayout^ textLayout )
TextLayoutImageSource | ( | TextLayout^ | textLayout,
 |  | uint32 | pixelWidth,
 |  | uint32 | pixelHeight
 | ) |  |
void UpdateCachedMetrics ( ) [private]

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_boundsBrush [private]

Definition at line 56 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1StrokeStyle> m_boundsStrokeStyle [private]

Definition at line 57 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext> m_d2dContext [private]

Definition at line 44 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1Device> m_d2dDevice [private]

Definition at line 43 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID3D11Device> m_d3dDevice [private]

Definition at line 40 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<IDWriteFactory3> m_dwriteFactory [private]

Definition at line 158 of file TextLayout.h.

std::wstring m_fontFamily [private]

Definition at line 152 of file TextLayout.h.

float m_fontSize [private]

Definition at line 153 of file TextLayout.h.

std::wstring m_languageTag [private]

Definition at line 151 of file TextLayout.h.

std::vector<DWRITE_LINE_METRICS1> m_lineMetrics [private]

Definition at line 180 of file TextLayout.h.

DWRITE_LINE_SPACING m_lineSpacing [private]

Definition at line 170 of file TextLayout.h.

uint32 m_pixelHeight [private]

Definition at line 155 of file TextLayout.h.

uint32 m_pixelWidth [private]

Definition at line 154 of file TextLayout.h.

Windows::Foundation::EventRegistrationToken m_suspendEventHandlerRegistrationToken [private]

Definition at line 37 of file TextLayoutImageSource.h.

std::wstring m_text [private]

Definition at line 150 of file TextLayout.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textAscentBrush [private]

Definition at line 53 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBackgroundBrush [private]

Definition at line 52 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBrush [private]

Definition at line 51 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textDescentBrush [private]

Definition at line 54 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout3> m_textLayout [private]

Definition at line 159 of file TextLayout.h.

TextLayout m_textLayout [private]

Definition at line 47 of file TextLayoutImageSource.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textLineGapBrush [private]

Definition at line 55 of file TextLayoutImageSource.h.

The documentation for this class was generated from the following files:
  • DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayout.h
  • DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.h
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BaseControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • BaseControl
Public Member Functions | Private Member Functions | Private Attributes

BaseControl Class Reference

#include "BaseControl.h"

List of all members.

Public Member Functions

BaseControl (const std::shared_ptr< DX::MeshGeometry > geometry=MeshGeometry::MakeTexturedCube())
void | ApplyShaders ()
void | Initialize ()
bool | IsFocused ()
void | PerformPressedAction ()
void | Render ()
void | SetIsVisible (bool value)
void | SetParentTransform (Windows::Foundation::Numerics::float4x4 transform)
void | SetPosition (Windows::Foundation::Numerics::float3 value)
void | SetRenderElement (std::shared_ptr< DX::FocusableElement > renderItem)
void | SetScale (Windows::Foundation::Numerics::float3 value)
void | SetTextureHeight (UINT height)
void | SetTextureWidth (UINT width)
void | SnapInitialSizeToRootElement ()
void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose)

Private Member Functions

void | AllocateTexture ()
void | ApplyPixelShader ()
virtual void | CalculateInitialSize ()
void | InitializeFocusPoint ()
bool | IsFocusOnControl (const DirectX::XMMATRIX &transform, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose)
void | UploadGeometryAndShaders ()

Private Attributes

float | m_calculateTextureDimensionsFromScale = true
Microsoft::WRL::ComPtr
< ID2D1Image > 		m_d2dContextTargetToRestore
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_focusPointConstantBuffer
_360VideoPlayback::FocusPointConstantBuffer m_focusPointConstantBufferData
std::shared_ptr< MeshGeometry > | m_geometry
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_isFocused
bool | m_isInitialized
bool | m_isUITextureRenderNeeded = true
bool | m_isVisible
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
_360VideoPlayback::ModelConstantBuffer m_modelConstantBufferData
Windows::Foundation::Numerics::float4x4 m_parentTransform
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 m_position
Windows::Foundation::Numerics::float2 m_relativeIntersectionPoint
std::shared_ptr< FocusableElement > | m_renderItem
Windows::Foundation::Numerics::float4 m_rotation
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_sampler
Windows::Foundation::Numerics::float3 m_scale
bool | m_snapSizeToRootElement = false
Microsoft::WRL::ComPtr
< ID2D1DrawingStateBlock1 > 		m_stateBlock
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
UINT | m_textureHeight
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_textureShaderResourceView
Microsoft::WRL::ComPtr
< ID2D1Bitmap1 > 		m_textureTarget
UINT | m_textureWidth
Windows::Foundation::Numerics::float4x4 m_transform
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 13 of file BaseControl.h.

Constructor & Destructor Documentation

BaseControl ( const std::shared_ptr< DX::MeshGeometry > geometry = MeshGeometry::MakeTexturedCube() )

Member Function Documentation

void AllocateTexture ( ) [private]

Definition at line 57 of file BaseControl.cpp.

{
    // Create the texture to render the glyph for this control as well as the glyph for the control.
    // NOTE: If we want visual fidelity that better matches the distance the user is from the button we should
    // have different sizes of textures (and glyphs) depending on how close the user is to the control.
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto d3ddevice = m_deviceResources->GetD3DDevice();
    ComPtr<IDXGISurface> cubeTextureSurface;
    CD3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;
    D3D11_SAMPLER_DESC samplerDescription;
    CD3D11_TEXTURE2D_DESC textureDesc;
    FLOAT dpiX;
    FLOAT dpiY;

    // Create texture for rendering d2d onto
    textureDesc = CD3D11_TEXTURE2D_DESC(
        DXGI_FORMAT_B8G8R8A8_UNORM,
        m_textureWidth,         // Width
        m_textureHeight,        // Height
        1,                      // MipLevels
        1,                      // ArraySize
        D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
    );

    DX::ThrowIfFailed(d3ddevice->CreateTexture2D(
        &textureDesc,
        nullptr,
        &m_texture));
    shaderResourceViewDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(
        m_texture.Get(),
        D3D11_SRV_DIMENSION_TEXTURE2D);
    DX::ThrowIfFailed(d3ddevice->CreateShaderResourceView(
        m_texture.Get(),
        &shaderResourceViewDesc,
        &m_textureShaderResourceView));

    d2dContext->GetDpi(&dpiX, &dpiY);
    D2D1_BITMAP_PROPERTIES1 bitmapProperties =
        D2D1::BitmapProperties1(
            D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
            D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
            dpiX,
            dpiY);
    m_texture.As(&cubeTextureSurface);

    DX::ThrowIfFailed(d2dContext->CreateBitmapFromDxgiSurface(
        cubeTextureSurface.Get(),
        &bitmapProperties,
        &m_textureTarget));

    // create the sampler
    ZeroMemory(&samplerDescription, sizeof(D3D11_SAMPLER_DESC));
    samplerDescription.Filter = D3D11_FILTER_ANISOTROPIC;
    samplerDescription.AddressU = D3D11_TEXTURE_ADDRESS_BORDER;
    samplerDescription.AddressV = D3D11_TEXTURE_ADDRESS_BORDER;
    samplerDescription.AddressW = D3D11_TEXTURE_ADDRESS_BORDER;
    samplerDescription.MipLODBias = 0.0f;
    samplerDescription.MaxAnisotropy = 4;
    samplerDescription.ComparisonFunc = D3D11_COMPARISON_NEVER;
    samplerDescription.BorderColor[0] = defaultGlassColor.x;
    samplerDescription.BorderColor[1] = defaultGlassColor.y;
    samplerDescription.BorderColor[2] = defaultGlassColor.z;
    samplerDescription.BorderColor[3] = defaultGlassColor.w;
    // allow use of all mip levels
    samplerDescription.MinLOD = 0;
    samplerDescription.MaxLOD = D3D11_FLOAT32_MAX;
    DX::ThrowIfFailed(d3ddevice->CreateSamplerState(
        &samplerDescription,
        &m_sampler));
    DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock));
}

void ApplyPixelShader ( ) [private]

Definition at line 224 of file BaseControl.cpp.

{
    m_deviceResources->GetD3DDeviceContext()->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0);

    m_deviceResources->GetD3DDeviceContext()->PSSetConstantBuffers(
        1, /*StartSlot*/
        1, /*NumBuffers*/
        m_focusPointConstantBuffer.GetAddressOf()
    );

    if (m_isUITextureRenderNeeded)
    {
        auto d2dContext = m_deviceResources->GetD2DDeviceContext();
        d2dContext->SaveDrawingState(m_stateBlock.Get());
        d2dContext->GetTarget(m_d2dContextTargetToRestore.GetAddressOf());
        // Set target to current texture
        d2dContext->SetTarget(m_textureTarget.Get());
        d2dContext->BeginDraw();
        ColorF clearColor = D2D1::ColorF(defaultGlassColor.x, defaultGlassColor.y, defaultGlassColor.z, defaultGlassColor.w);
        d2dContext->Clear(clearColor);

        m_renderItem->TryRender();

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        auto endDrawHR = d2dContext->EndDraw();
        if (endDrawHR == D2DERR_RECREATE_TARGET)
        {
            return;
        }
        // We need to restore the previously set d2dContext target so
        // future draw calls draw to the correct place.
        d2dContext->SetTarget(m_d2dContextTargetToRestore.Get());
        d2dContext->RestoreDrawingState(m_stateBlock.Get());
        m_isUITextureRenderNeeded = false;
    }

    // Tell the shader to use the texture
    m_deviceResources->GetD3DDeviceContext()->PSSetShaderResources(
        0,
        1,
        m_textureShaderResourceView.GetAddressOf());

    m_deviceResources->GetD3DDeviceContext()->PSSetSamplers(
        0,
        1,
        m_sampler.GetAddressOf());
}

void ApplyShaders ( )

Definition at line 331 of file BaseControl.cpp.

{
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(L"ms-appx:///GlassVertexShader.cso");
    task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
    {
        std::vector<D3D11_INPUT_ELEMENT_DESC> vertexPositionTextureDesc =
        { {
                { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                } };
        DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateVertexShader(
            fileData.data(),
            fileData.size(),
            nullptr,
            &m_vertexShader));

        DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateInputLayout(
            vertexPositionTextureDesc.data(),
            static_cast<UINT>(vertexPositionTextureDesc.size()),
            fileData.data(),
            fileData.size(),
            &m_inputLayout));
    });

    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///GlassPixelShader.cso");
    task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreatePixelShader(
            fileData.data(),
            fileData.size(),
            nullptr,
            &m_pixelShader));
    });

    task<std::vector<byte>> loadGSTask = DX::ReadDataAsync(L"ms-appx:///GlassGeometryShader.cso");

    task<void> createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateGeometryShader(
            fileData.data(),
            fileData.size(),
            nullptr,
            &m_geometryShader));
    });

    task<void> shaderTaskGroup = (createPSTask && createVSTask && createGSTask);
    task<void> createSphereTask = shaderTaskGroup.then([this]()
    {
    });
}

void CalculateInitialSize ( ) [private, virtual]

Definition at line 387 of file BaseControl.cpp.

{
    // Calculate the geometry scale based on the texture dimensions
    if (m_snapSizeToRootElement)
    {
        m_textureWidth = static_cast<UINT>(m_renderItem->GetElementSize().x);
        if (m_textureWidth == 0)
        {
            m_textureWidth = DEFAULT_TEXTURE_SIZE;
        }
        m_textureHeight = static_cast<UINT>(m_renderItem->GetElementSize().y);
        if (m_textureHeight == 0)
        {
            m_textureHeight = DEFAULT_TEXTURE_SIZE;
        }

        // Scale the geometry so we fit 128 texture pixels per geometry unit.
        float geometryWidth = m_textureWidth / static_cast<float>(DEFAULT_TEXTURE_SIZE);
        float geomeryHeight = m_textureHeight / static_cast<float>(DEFAULT_TEXTURE_SIZE);

        m_scale.x *= geometryWidth;
        m_scale.y *= geomeryHeight;
    }
    else
    {
        // Scale the geometry so we fit 128 texture pixels per geometry unit.
        float geometryWidth = m_textureWidth / static_cast<float>(DEFAULT_TEXTURE_SIZE);
        float geomeryHeight = m_textureHeight / static_cast<float>(DEFAULT_TEXTURE_SIZE);

        m_scale.x *= geometryWidth;
        m_scale.y *= geomeryHeight;
    }
}

void Initialize ( )

Definition at line 39 of file BaseControl.cpp.

{
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(_360VideoPlayback::ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);

    DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateBuffer(
        &constantBufferDesc,
        nullptr,
        &m_modelConstantBuffer));

    CalculateInitialSize();

    AllocateTexture();

    InitializeFocusPoint();

    m_isInitialized = true;
}

void InitializeFocusPoint ( ) [private]

Definition at line 292 of file BaseControl.cpp.

{
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(FocusPointConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_focusPointConstantBuffer));

    m_focusPointConstantBufferData.focusPointIntensity = { constantFocusPointIntensity,  constantFocusPointIntensity,  constantFocusPointIntensity, constantFocusPointIntensity };
    m_focusPointConstantBufferData.focusPointColor = { constantFocusPointColor.x, constantFocusPointColor.y, constantFocusPointColor.z, constantFocusPointColor.w };
    m_focusPointConstantBufferData.focusPointRadius = { constantFocusPointRadius,  constantFocusPointRadius,  constantFocusPointRadius, constantFocusPointRadius };
    m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
        m_focusPointConstantBuffer.Get(),
        0,
        nullptr,
        &m_focusPointConstantBufferData,
        0,
        0
    );
}

bool IsFocused ( ) [inline]

Definition at line 28 of file BaseControl.h.

{ return m_isFocused; };

bool IsFocusOnControl | ( | const DirectX::XMMATRIX & | transform,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [private]
void PerformPressedAction ( )

Definition at line 323 of file BaseControl.cpp.

{
    if (m_renderItem->IsFocused())
    {
        m_renderItem->PerformAction();
    }
}

void Render ( )

Definition at line 165 of file BaseControl.cpp.

{
    if (m_isVisible)
    {
        UploadGeometryAndShaders();
        ApplyPixelShader();
        // At this point everything should be set, so Draw the objects.
        m_deviceResources->GetD3DDeviceContext()->DrawIndexedInstanced(
            m_geometry->IndexCount,  // Index count per instance.
            2,                       // Instance count.
            0,                       // Start index location.
            0,                       // Base vertex location.
            0);                      // Start instance location.
    }
}

void SetIsVisible ( bool value )

Definition at line 314 of file BaseControl.cpp.

{
    m_isVisible = value;
    if (!m_isVisible) // clear focus if you are turned off
    {
        m_isFocused = false;
    }
}

void SetParentTransform ( Windows::Foundation::Numerics::float4x4 transform )
void SetPosition ( Windows::Foundation::Numerics::float3 value )
void SetRenderElement ( std::shared_ptr< DX::FocusableElement > renderItem )
void SetScale ( Windows::Foundation::Numerics::float3 value )
void SetTextureHeight ( UINT height ) [inline]

Definition at line 33 of file BaseControl.h.

{ m_textureHeight = height; m_calculateTextureDimensionsFromScale = false; }

void SetTextureWidth ( UINT width ) [inline]

Definition at line 32 of file BaseControl.h.

{ m_textureWidth = width; m_calculateTextureDimensionsFromScale = false; }

void SnapInitialSizeToRootElement ( )

Definition at line 382 of file BaseControl.cpp.

{
    m_snapSizeToRootElement = true;
}

void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose
 | ) |  |
void UploadGeometryAndShaders ( ) [private]

Definition at line 181 of file BaseControl.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0);

    const UINT stride = m_geometry->VertexStride;
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_geometry->VertexBuffer.GetAddressOf(),
        &stride,
        &offset);
    context->IASetIndexBuffer(
        m_geometry->IndexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0);
    context->IASetPrimitiveTopology(m_geometry->Topology);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr, 0);
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf());
    m_deviceResources->GetD3DDeviceContext()->GSSetShader(
        m_geometryShader.Get(),
        nullptr,
        0);
}

Member Data Documentation

float m_calculateTextureDimensionsFromScale = true [private]

Definition at line 49 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID2D1Image> m_d2dContextTargetToRestore [private]

Definition at line 72 of file BaseControl.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 53 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_focusPointConstantBuffer [private]

Definition at line 47 of file BaseControl.h.

_360VideoPlayback::FocusPointConstantBuffer m_focusPointConstantBufferData [private]

Definition at line 48 of file BaseControl.h.

std::shared_ptr<MeshGeometry> m_geometry [private]

Definition at line 56 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 62 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 60 of file BaseControl.h.

bool m_isFocused [private]

Definition at line 44 of file BaseControl.h.

bool m_isInitialized [private]

Definition at line 43 of file BaseControl.h.

bool m_isUITextureRenderNeeded = true [private]

Definition at line 46 of file BaseControl.h.

bool m_isVisible [private]

Definition at line 45 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 58 of file BaseControl.h.

_360VideoPlayback::ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 57 of file BaseControl.h.

Windows::Foundation::Numerics::float4x4 m_parentTransform [private]

Definition at line 68 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 61 of file BaseControl.h.

Windows::Foundation::Numerics::float3 m_position [private]

Definition at line 65 of file BaseControl.h.

Windows::Foundation::Numerics::float2 m_relativeIntersectionPoint [private]

Definition at line 70 of file BaseControl.h.

std::shared_ptr<FocusableElement> m_renderItem [private]

Definition at line 54 of file BaseControl.h.

Windows::Foundation::Numerics::float4 m_rotation [private]

Definition at line 64 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_sampler [private]

Definition at line 73 of file BaseControl.h.

Windows::Foundation::Numerics::float3 m_scale [private]

Definition at line 63 of file BaseControl.h.

bool m_snapSizeToRootElement = false [private]

Definition at line 55 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock1> m_stateBlock [private]

Definition at line 74 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [private]

Definition at line 75 of file BaseControl.h.

UINT m_textureHeight [private]

Definition at line 51 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureShaderResourceView [private]

Definition at line 77 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_textureTarget [private]

Definition at line 76 of file BaseControl.h.

UINT m_textureWidth [private]

Definition at line 50 of file BaseControl.h.

Windows::Foundation::Numerics::float4x4 m_transform [private]

Definition at line 66 of file BaseControl.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 59 of file BaseControl.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseControl.h
  • 360VideoPlayback/cpp/Common/BaseControl.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BaseElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • BaseElement
Public Member Functions | Protected Member Functions | Protected Attributes

BaseElement Class Reference

#include "BaseElement.h"

Inherited by Ellipse, FilledEllipse, FilledRectangle, FocusableElement, Line, Rectangle, and Text.

List of all members.

Public Member Functions

BaseElement ()
virtual | ~BaseElement ()
void | AddChildElement (const std::shared_ptr< BaseElement > &childElement)
virtual void | ArrangeElements ()
ElementMargin & GetElementMargin ()
Windows::Foundation::Numerics::float2 GetElementSize ()
bool | GetIgnoreLayout ()
bool | GetIsRenderPassNeeded ()
bool | GetIsVisible ()
virtual void | Initialize ()
void | SetBrush (ID2D1SolidColorBrush *brush)
void | SetElementMargin (ElementMargin margin)
void | SetElementSize (Windows::Foundation::Numerics::float2 size)
void | SetIgnoreLayout (bool ignoreLayout)
void | SetIsVisible (bool visible)
void | SetLayoutHorizontal (bool isLayoutHorizontal)
void | SetParentTransform (Windows::Foundation::Numerics::float2 translation)
virtual void | SetTranslation (Windows::Foundation::Numerics::float2 translation)
void | TryRender ()
virtual void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose)

Protected Member Functions

virtual void | Render ()

Protected Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
ElementMargin m_elementMargin
Windows::Foundation::Numerics::float2 m_elementSize
bool | m_ignoreLayout
bool | m_isInitialized
bool | m_isLayoutHorizontal = false
bool | m_isRenderPassNeeded
bool | m_isVisible
Windows::Foundation::Numerics::float2 m_parentTranslation
Windows::Foundation::Numerics::float2 m_transformedTranslation
D2D1::Matrix3x2F | m_transformMatrix = D2D1::Matrix3x2F::Identity()
bool | m_transformRecalculationNeeded
Windows::Foundation::Numerics::float2 m_translation

Detailed Description

Definition at line 35 of file BaseElement.h.

Constructor & Destructor Documentation

BaseElement ( )

Definition at line 17 of file BaseElement.cpp.

                         :
    m_isInitialized(false),
    m_transformRecalculationNeeded(false),
    m_isRenderPassNeeded(true),
    m_isVisible(true),
    m_translation(0.0f, 0.0f),
    m_transformedTranslation(0.0f, 0.0f),
    m_parentTranslation(0.0f, 0.0f),
    m_elementSize(0.0f, 0.0f),
    m_ignoreLayout(true),
    m_brush(nullptr)
{
    m_deviceResources = _360VideoPlaybackMain::GetDeviceResources();
}

virtual ~BaseElement ( ) [virtual]

Member Function Documentation

void AddChildElement ( const std::shared_ptr< BaseElement > & childElement )

Definition at line 193 of file BaseElement.cpp.

{
    childElement->SetParentTransform(m_transformedTranslation);
    m_childElements.push_back(childElement);
}

void ArrangeElements ( ) [virtual]

Reimplemented in Button.

Definition at line 31 of file BaseElement.cpp.

{
    float maxWidth = 0.0f;
    float maxHeight = 0.0f;
    float containerWidth = 0.0f;
    float containerHeight = 0.0f;

    // Arrange Children And Compute whole ContainerSize
    for (const auto& element : m_childElements)
    {
        if (!element->GetIgnoreLayout())
        {
            // Skip stuff that doesn't want to be stacked in its container (like the focus rect).
            continue;
        }

        maxWidth = max(maxWidth, element->GetElementSize().x);
        maxHeight = max(maxHeight, element->GetElementSize().y);

        if (m_isLayoutHorizontal)
        {
            containerWidth += element->GetElementSize().x + element->GetElementMargin().left + element->GetElementMargin().right;
            containerHeight = max(containerHeight, element->GetElementSize().y + element->GetElementMargin().top + element->GetElementMargin().bottom);
        }
        else
        {
            containerWidth = max(containerWidth, element->GetElementSize().x + element->GetElementMargin().left + element->GetElementMargin().right);
            containerHeight = max(containerHeight, element->GetElementSize().y + element->GetElementMargin().top + element->GetElementMargin().bottom);
        }
    }

    float minWidth = m_elementSize.x;
    float minHeight = m_elementSize.y;

    containerWidth = max(minWidth, containerWidth);
    containerHeight = max(minHeight, containerHeight);
    m_elementSize.x = containerWidth;
    m_elementSize.y = containerHeight;

    // Actually position the elements. We need to do this after calculating the container size so we can center the elements.
    float currentStackPosition = 0.0;
    for (const auto& element : m_childElements)
    {
        if (!element->GetIgnoreLayout())
        {
            // Skip stuff that doesn't want to be stacked in its container (like the focus rect).
            continue;
        }

        if (m_isLayoutHorizontal)
        {
            // Position element along the stacking axis
            float elementPositionX = currentStackPosition + element->GetElementMargin().left;

            // Center the element so the stacking axis bisects the element
            float elementPositionY = (containerHeight / 2.0f) - (element->GetElementSize().y / 2.0f);

            // Adjust centered position to respect top margin
            if (elementPositionY < element->GetElementMargin().top)
            {
                elementPositionY = element->GetElementMargin().top;
            }

            // Adjust centered position to respect bottom margin
            if (elementPositionY + element->GetElementSize().y + element->GetElementMargin().bottom > containerHeight)
            {
                elementPositionY = containerHeight - element->GetElementSize().y - element->GetElementMargin().bottom;
            }

            element->SetTranslation({ elementPositionX, elementPositionY });

            currentStackPosition += element->GetElementMargin().left + element->GetElementSize().x + element->GetElementMargin().right;
        }
        else
        {
            float elementPositionX = (containerWidth / 2.0f) - (element->GetElementSize().x / 2.0f);
            float elementPositionY = (containerHeight / 2.0f) - (element->GetElementSize().y / 2.0f);
            element->SetTranslation({ elementPositionX, elementPositionY });
        }
    }
}

ElementMargin& GetElementMargin ( ) [inline]

Definition at line 54 of file BaseElement.h.

{ return m_elementMargin; };

Windows::Foundation::Numerics::float2 GetElementSize ( ) [inline]

Definition at line 47 of file BaseElement.h.

{ return m_elementSize; };

bool GetIgnoreLayout ( ) [inline]

Definition at line 55 of file BaseElement.h.

{ return m_ignoreLayout; };

bool GetIsRenderPassNeeded ( ) [inline]

Definition at line 46 of file BaseElement.h.

{ return m_isRenderPassNeeded; };

bool GetIsVisible ( ) [inline]

Definition at line 44 of file BaseElement.h.

{ return m_isVisible; };

void Initialize ( ) [virtual]

Reimplemented in Ellipse, FilledEllipse, Rectangle, FilledRectangle, Button, PlayPauseButton, ExitButton, and SeekBarElement.

Definition at line 113 of file BaseElement.cpp.

{
    for (const auto& child : m_childElements)
    {
        child->Initialize();
    }
    m_isInitialized = true;
}

void Render ( ) [protected, virtual]

Reimplemented in Text, Line, Ellipse, FilledEllipse, Rectangle, and FilledRectangle.

Definition at line 177 of file BaseElement.cpp.

{
}

void SetBrush ( ID2D1SolidColorBrush * brush )

Definition at line 122 of file BaseElement.cpp.

{
    m_brush = brush;
    m_isRenderPassNeeded = true;
}

void SetElementMargin ( ElementMargin margin ) [inline]

Definition at line 52 of file BaseElement.h.

{ m_elementMargin = margin; };

void SetElementSize ( Windows::Foundation::Numerics::float2 size ) [inline]

Definition at line 45 of file BaseElement.h.

{ m_elementSize = size; }

void SetIgnoreLayout ( bool ignoreLayout ) [inline]

Definition at line 53 of file BaseElement.h.

{ m_ignoreLayout = ignoreLayout; }

void SetIsVisible ( bool visible )

Definition at line 199 of file BaseElement.cpp.

{
    m_isRenderPassNeeded |= (visible != m_isVisible);
    m_isVisible = visible;
};

void SetLayoutHorizontal ( bool isLayoutHorizontal ) [inline]

Definition at line 56 of file BaseElement.h.

{ m_isLayoutHorizontal = isLayoutHorizontal; }

void SetParentTransform ( Windows::Foundation::Numerics::float2 translation )
virtual void SetTranslation ( Windows::Foundation::Numerics::float2 translation ) [virtual]
void TryRender ( )

Definition at line 162 of file BaseElement.cpp.

{
    if (m_isVisible)
    {
        Render();

        for (const auto& child : m_childElements)
        {
            child->TryRender();
        }
    }

    m_isRenderPassNeeded = false;
}

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [virtual]

Reimplemented in FocusableElement, Button, PlayPauseButton, and SeekBarElement.

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [protected]

Definition at line 83 of file BaseElement.h.

ElementMargin m_elementMargin [protected]

Definition at line 81 of file BaseElement.h.

Windows::Foundation::Numerics::float2 m_elementSize [protected]

Definition at line 78 of file BaseElement.h.

bool m_ignoreLayout [protected]

Definition at line 72 of file BaseElement.h.

bool m_isInitialized [protected]

Definition at line 68 of file BaseElement.h.

bool m_isLayoutHorizontal = false [protected]

Definition at line 80 of file BaseElement.h.

bool m_isRenderPassNeeded [protected]

Definition at line 70 of file BaseElement.h.

bool m_isVisible [protected]

Definition at line 71 of file BaseElement.h.

Windows::Foundation::Numerics::float2 m_parentTranslation [protected]

Definition at line 76 of file BaseElement.h.

Windows::Foundation::Numerics::float2 m_transformedTranslation [protected]

Definition at line 75 of file BaseElement.h.

D2D1::Matrix3x2F m_transformMatrix = D2D1::Matrix3x2F::Identity() [protected]

Definition at line 79 of file BaseElement.h.

bool m_transformRecalculationNeeded [protected]

Definition at line 69 of file BaseElement.h.

Windows::Foundation::Numerics::float2 m_translation [protected]

Definition at line 74 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Button Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Button
Public Member Functions | Protected Attributes | Private Attributes

Button Class Reference

#include "Controls.h"

Inherits DX::FocusableElement.

Inherited by ExitButton, and PlayPauseButton.

List of all members.

Public Member Functions

Button (UINT initialSize=BUTTON_SIZE, ButtonShape shape=ButtonShape::Rectangle)
virtual void | ArrangeElements () override
virtual void | FocusUpdate () override
virtual void | Initialize () override
virtual void | PerformAction () override
virtual void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) override

Protected Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_brush
ButtonState | m_buttonState = ButtonState::None
bool | m_forceIconCentered
const float | m_maxSecondsInPressingState = 0.25f
Windows::Foundation::Numerics::float4x4 m_parentControlTransform
float | m_pressingTimeOut
const ButtonShape | m_shape = ButtonShape::Rectangle

Private Attributes

std::shared_ptr< DX::Ellipse > | m_ElliFocusOutline
std::shared_ptr
< DX::FilledEllipse > 		m_ElliPressedBackgroundFill
std::shared_ptr< DX::Rectangle > | m_RectFocusOutline
std::shared_ptr
< DX::FilledRectangle > 		m_RectPressedBackgroundFill

Detailed Description

Definition at line 19 of file Controls.h.

Constructor & Destructor Documentation

Button | ( | UINT | initialSize = BUTTON_SIZE,
 |  | ButtonShape | shape = ButtonShape::Rectangle
 | ) |  |

Definition at line 28 of file Controls.cpp.

                                                  :
    FocusableElement(),
    m_pressingTimeOut(0.0f),
    m_shape(shape)
{
    m_elementSize = float2(static_cast<float>(initialSize));

    // Add the button pressed UI element first so it appears under the focus rect.
    if (m_shape == ButtonShape::Rectangle)
    {
        m_RectPressedBackgroundFill = make_shared<FilledRectangle>(m_elementSize.x, m_elementSize.y, pressedBackgroundFillColor);
        m_RectFocusOutline = make_shared<Rectangle>(m_elementSize.x, m_elementSize.y, 1.5f, focusOutlineColor);
        m_RectPressedBackgroundFill->SetIgnoreLayout(false);
        m_RectFocusOutline->SetIgnoreLayout(false);
        m_RectPressedBackgroundFill->SetIsVisible(false);
        m_RectFocusOutline->SetIsVisible(false);
        this->AddChildElement(m_RectPressedBackgroundFill);
        this->AddChildElement(m_RectFocusOutline);

    }
    else if (m_shape == ButtonShape::Circle)
    {
        m_ElliPressedBackgroundFill = make_shared<FilledEllipse>(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f, pressedBackgroundFillColor);
        m_ElliFocusOutline = make_shared<Ellipse>(m_elementSize.x * 0.5f, m_elementSize.y* 0.5f, 5.0f, focusOutlineColor);
        m_ElliPressedBackgroundFill->SetIgnoreLayout(false);
        m_ElliFocusOutline->SetIgnoreLayout(false);
        m_ElliPressedBackgroundFill->SetIsVisible(false);
        m_ElliFocusOutline->SetIsVisible(false);
        this->AddChildElement(m_ElliPressedBackgroundFill);
        this->AddChildElement(m_ElliFocusOutline);
    }
}

Member Function Documentation

void ArrangeElements ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 61 of file Controls.cpp.

{
    __super::ArrangeElements();

    if (m_shape == ButtonShape::Rectangle)
    {
        // Update the focus rect to be the same size as the button.
        FLOAT selectionBorderStrokeThickness = m_RectFocusOutline->GetStrokeThickness();
        m_RectFocusOutline->SetRect({
    selectionBorderStrokeThickness,
    selectionBorderStrokeThickness,
    m_elementSize.x - selectionBorderStrokeThickness,
    m_elementSize.y - selectionBorderStrokeThickness });

        m_RectPressedBackgroundFill->SetRect({ 0.0f, 0.0f, m_elementSize.x, m_elementSize.y });
    }
    else if (m_shape == ButtonShape::Circle)
    {
        m_ElliFocusOutline->SetRadius(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f);
        m_ElliPressedBackgroundFill->SetRadius(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f);
    }
}

void FocusUpdate ( ) [override, virtual]

Reimplemented from FocusableElement.

Definition at line 137 of file Controls.cpp.

{
    bool update = false;
    if (this->IsFocused())
    {
        update = true;
    }
    (m_shape == ButtonShape::Rectangle) ? m_RectFocusOutline->SetIsVisible(update) : m_ElliFocusOutline->SetIsVisible(update);
}

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Reimplemented in PlayPauseButton, and ExitButton.

Definition at line 84 of file Controls.cpp.

{
    auto d2dcontext = m_deviceResources->GetD2DDeviceContext();

    __super::Initialize();

    // Recreate the brush for the glyphs, font, etc. This is the final brush we want to hold on to in the button
    DX::ThrowIfFailed(
        d2dcontext->CreateSolidColorBrush(
            enabledForegroundColor,
            &m_brush));
}

void PerformAction ( ) [override, virtual]

Reimplemented from FocusableElement.

Reimplemented in PlayPauseButton, and ExitButton.

Definition at line 147 of file Controls.cpp.

{
    // If the user invokes a button we need to trigger the invoked state
    // and give visual feedback to the user that the button has been pressed.
    if (m_buttonState == ButtonState::None)
    {
        m_buttonState = ButtonState::Pressing;
        m_pressingTimeOut = 0.0f;
    }
    else if (m_buttonState == ButtonState::Pressed)
    {
        __super::PerformAction();
        m_buttonState = ButtonState::None;
    }
}

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [override, virtual]

Reimplemented from FocusableElement.

Reimplemented in PlayPauseButton.

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_brush [protected]

Definition at line 34 of file Controls.h.

ButtonState m_buttonState = ButtonState::None [protected]

Definition at line 35 of file Controls.h.

std::shared_ptr<DX::Ellipse> m_ElliFocusOutline [private]

Definition at line 42 of file Controls.h.

std::shared_ptr<DX::FilledEllipse> m_ElliPressedBackgroundFill [private]

Definition at line 43 of file Controls.h.

bool m_forceIconCentered [protected]

Definition at line 32 of file Controls.h.

const float m_maxSecondsInPressingState = 0.25f [protected]

Definition at line 38 of file Controls.h.

Windows::Foundation::Numerics::float4x4 m_parentControlTransform [protected]

Definition at line 33 of file Controls.h.

float m_pressingTimeOut [protected]

Definition at line 36 of file Controls.h.

std::shared_ptr<DX::Rectangle> m_RectFocusOutline [private]

Definition at line 40 of file Controls.h.

std::shared_ptr<DX::FilledRectangle> m_RectPressedBackgroundFill [private]

Definition at line 41 of file Controls.h.

const ButtonShape m_shape = ButtonShape::Rectangle [protected]

Definition at line 37 of file Controls.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/Controls.h
  • 360VideoPlayback/cpp/Common/Controls.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • CameraResources
Public Member Functions | Private Attributes

CameraResources Class Reference

#include "CameraResources.h"

List of all members.

Public Member Functions

CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
CameraResources (winrt::Windows::Graphics::Holographic::HolographicCamera const &holographicCamera)
CameraResources (Windows::Graphics::Holographic::HolographicCamera^holographicCamera)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > &deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
bool | AttachViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, winrt::Windows::Graphics::Holographic::HolographicCameraRenderingParameters const &cameraParameters)
void | CreateResourcesForBackBuffer (DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters)
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
DXGI_FORMAT | GetBackBufferDXGIFormat () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11Texture2D * | GetBackBufferTexture2D () const
ID3D11BlendState * | GetBlendState () const
ID3D11BlendState * | GetBlendState () const
ID3D11Texture2D * | GetDepthBufferTexture2D () const
ID3D11Texture2D * | GetDepthStencilTexture2D () const
ID3D11Texture2D * | GetDepthStencilTexture2D () const
ID3D11Texture2D * | GetDepthStencilTexture2D () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
winrt::Windows::Graphics::Holographic::HolographicCamera
const & 		GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Graphics::Holographic::HolographicCamera | GetHolographicCamera () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
winrt::Windows::Foundation::Size | GetRenderTargetSize () const &
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
D3D11_VIEWPORT | GetViewport () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
bool | IsRenderingStereoscopic () const
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | ReleaseResourcesForBackBuffer (DX::DeviceResources *pDeviceResources)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateViewProjectionBuffer (std::shared_ptr< DX::DeviceResources > deviceResources, winrt::Windows::Graphics::Holographic::HolographicCameraPose const &cameraPose, winrt::Windows::Perception::Spatial::SpatialCoordinateSystem const &coordinateSystem)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11BlendState > 		m_blendState
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_d3dBackBuffer
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_d3dDepthBuffer
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_d3dDepthStencil
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		m_d3dDepthStencilView
winrt::Windows::Foundation::Size m_d3dRenderTargetSize
Windows::Foundation::Size m_d3dRenderTargetSize
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_d3dRenderTargetView
D3D11_VIEWPORT | m_d3dViewport
DXGI_FORMAT | m_dxgiFormat
bool | m_framePending = false
Windows::Graphics::Holographic::HolographicCamera | m_holographicCamera = nullptr
winrt::Windows::Graphics::Holographic::HolographicCamera | m_holographicCamera = nullptr
bool | m_isStereo = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_viewProjectionConstantBuffer

Detailed Description

Definition at line 18 of file CameraResources.h.

Constructor & Destructor Documentation

CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( winrt::Windows::Graphics::Holographic::HolographicCamera const & holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )
CameraResources ( Windows::Graphics::Holographic::HolographicCamera^ holographicCamera )

Member Function Documentation

bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )

Definition at line 233 of file CameraResources.cpp.

{
    // This method uses Direct3D device-based resources.
    const auto context = deviceResources->GetD3DDeviceContext();

    // Loading is asynchronous. Resources must be created before they can be updated.
    // Cameras can also be added asynchronously, in which case they must be initialized
    // before they can be used.
    if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
    {
        return false;
    }

    // Set the viewport for this camera.
    context->RSSetViewports(1, &m_d3dViewport);

    // Send the constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        1,
        1,
        m_viewProjectionConstantBuffer.GetAddressOf()
        );

    // The template includes a pass-through geometry shader that is used by
    // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
    // will be enabled at run-time on systems that require it.
    // If your app will also use the geometry shader for other tasks and those
    // tasks require the view/projection matrix, uncomment the following line
    // of code to send the constant buffer to the geometry shader as well.
    /*context->GSSetConstantBuffers(
        1,
        1,
        m_viewProjectionConstantBuffer.GetAddressOf()
        );*/

    m_framePending = false;

    return true;
}

bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 223 of file CameraResources.cpp.

{
    // This method uses Direct3D device-based resources.
    ID3D11DeviceContext* context = deviceResources->GetD3DDeviceContext();

    // Loading is asynchronous. Resources must be created before they can be updated.
    // Cameras can also be added asynchronously, in which case they must be initialized
    // before they can be used.
    if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
    {
        return false;
    }

    // Set the viewport for this camera.
    context->RSSetViewports(1, &m_d3dViewport);

    // Send the constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        1,
        1,
        m_viewProjectionConstantBuffer.GetAddressOf()
    );

    // The template includes a pass-through geometry shader that is used by
    // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
    // will be enabled at run-time on systems that require it.
    // If your app will also use the geometry shader for other tasks and those
    // tasks require the view/projection matrix, uncomment the following line
    // of code to send the constant buffer to the geometry shader as well.
    /*context->GSSetConstantBuffers(
    1,
    1,
    m_viewProjectionConstantBuffer.GetAddressOf()
    );*/

    m_framePending = false;

    return true;
}

bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
bool AttachViewProjectionBuffer ( std::shared_ptr< DX::DeviceResources > deviceResources )
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | winrt::Windows::Graphics::Holographic::HolographicCameraRenderingParameters const & | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
void CreateResourcesForBackBuffer | ( | DX::DeviceResources * | pDeviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ | cameraParameters
 | ) |  |
DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_dxgiFormat;                }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 55 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 54 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 54 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_dxgiFormat;                    }

DXGI_FORMAT GetBackBufferDXGIFormat ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_dxgiFormat;                    }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 51 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 50 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 50 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get();     }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 40 of file CameraResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();       }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 46 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 53 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11Texture2D* GetBackBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dBackBuffer.Get();           }

ID3D11BlendState* GetBlendState ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_blendState.Get();              }

ID3D11BlendState* GetBlendState ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_blendState.Get();              }

ID3D11Texture2D* GetDepthBufferTexture2D ( ) const [inline]

Definition at line 42 of file CameraResources.h.

{ return m_d3dDepthBuffer.Get();          }

ID3D11Texture2D* GetDepthStencilTexture2D ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dDepthStencil.Get();     }

ID3D11Texture2D* GetDepthStencilTexture2D ( ) const [inline]

Definition at line 47 of file CameraResources.h.

{ return m_d3dDepthStencil.Get();         }

ID3D11Texture2D* GetDepthStencilTexture2D ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dDepthStencil.Get();         }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 45 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 51 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 51 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get();     }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 41 of file CameraResources.h.

{ return m_d3dDepthStencilView.Get(); }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 62 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 56 of file CameraResources.h.

{ return m_holographicCamera; }

winrt::Windows::Graphics::Holographic::HolographicCamera const& GetHolographicCamera ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 61 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 51 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 61 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Graphics::Holographic::HolographicCamera GetHolographicCamera ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_holographicCamera; }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

winrt::Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dRenderTargetSize;      }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 52 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 47 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 57 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 58 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 57 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dRenderTargetSize;           }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_d3dViewport;               }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 53 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 44 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 54 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 53 of file CameraResources.h.

{ return m_d3dViewport;                   }

D3D11_VIEWPORT GetViewport ( ) const [inline]

Definition at line 43 of file CameraResources.h.

{ return m_d3dViewport;                   }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_isStereo;                  }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 53 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 58 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 59 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 58 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 48 of file CameraResources.h.

{ return m_isStereo;                      }

bool IsRenderingStereoscopic ( ) const [inline]

Definition at line 49 of file CameraResources.h.

{ return m_isStereo;                      }

void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )

Definition at line 142 of file CameraResources.cpp.

{
    const auto context = pDeviceResources->GetD3DDeviceContext();

    // Release camera-specific resources.
    m_d3dBackBuffer.Reset();
    m_d3dRenderTargetView.Reset();
    m_d3dDepthStencilView.Reset();
    m_viewProjectionConstantBuffer.Reset();

    // Ensure system references to the back buffer are released by clearing the render
    // target from the graphics pipeline state, and then flushing the Direct3D context.
    ID3D11RenderTargetView* nullViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { nullptr };
    context->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
    context->Flush();
}

void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void ReleaseResourcesForBackBuffer ( DX::DeviceResources * pDeviceResources )
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | winrt::Windows::Graphics::Holographic::HolographicCameraPose const & | cameraPose,
 |  | winrt::Windows::Perception::Spatial::SpatialCoordinateSystem const & | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateViewProjectionBuffer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | Windows::Graphics::Holographic::HolographicCameraPose^ | cameraPose,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |

Member Data Documentation

Microsoft::WRL::ComPtr< ID3D11BlendState > m_blendState [private]

Definition at line 59 of file CameraResources.h.

Microsoft::WRL::ComPtr< ID3D11Texture2D > m_d3dBackBuffer [private]

Definition at line 57 of file CameraResources.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_d3dDepthBuffer [private]

Definition at line 59 of file CameraResources.h.

Microsoft::WRL::ComPtr< ID3D11Texture2D > m_d3dDepthStencil [private]

Definition at line 59 of file CameraResources.h.

Microsoft::WRL::ComPtr< ID3D11DepthStencilView > m_d3dDepthStencilView [private]

Definition at line 56 of file CameraResources.h.

winrt::Windows::Foundation::Size m_d3dRenderTargetSize [private]

Definition at line 66 of file CameraResources.h.

Windows::Foundation::Size m_d3dRenderTargetSize [private]

Definition at line 64 of file CameraResources.h.

Microsoft::WRL::ComPtr< ID3D11RenderTargetView > m_d3dRenderTargetView [private]

Definition at line 55 of file CameraResources.h.

D3D11_VIEWPORT m_d3dViewport [private]

Definition at line 65 of file CameraResources.h.

DXGI_FORMAT m_dxgiFormat [private]

Definition at line 63 of file CameraResources.h.

bool m_framePending = false [private]

Definition at line 71 of file CameraResources.h.

Windows::Graphics::Holographic::HolographicCamera m_holographicCamera = nullptr [private]

Definition at line 74 of file CameraResources.h.

winrt::Windows::Graphics::Holographic::HolographicCamera m_holographicCamera = nullptr [private]

Definition at line 76 of file CameraResources.h.

bool m_isStereo = false [private]

Definition at line 68 of file CameraResources.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_viewProjectionConstantBuffer [private]

Definition at line 60 of file CameraResources.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/CameraResources.h
  • BasicHologram/cpp/Common/CameraResources.h
  • BasicHologram/cppwinrt/Common/CameraResources.h
  • HolographicFaceTracking/cpp/Common/CameraResources.h
  • HolographicMixedRealityCapture/cpp/Common/CameraResources.h
  • HolographicSpatialMapping/cpp/Common/CameraResources.h
  • HolographicSpatialStage/cpp/Common/CameraResources.h
  • HolographicTagAlong/cpp/Common/CameraResources.h
  • HolographicVoiceInput/cpp/Common/CameraResources.h
  • SpatialInteractionSource/cpp/Common/CameraResources.h
  • 360VideoPlayback/cpp/Common/CameraResources.cpp
  • BasicHologram/cpp/Common/CameraResources.cpp
  • BasicHologram/cppwinrt/Common/CameraResources.cpp
  • HolographicFaceTracking/cpp/Common/CameraResources.cpp
  • HolographicMixedRealityCapture/cpp/Common/CameraResources.cpp
  • HolographicSpatialMapping/cpp/Common/CameraResources.cpp
  • HolographicSpatialStage/cpp/Common/CameraResources.cpp
  • HolographicTagAlong/cpp/Common/CameraResources.cpp
  • HolographicVoiceInput/cpp/Common/CameraResources.cpp
  • SpatialInteractionSource/cpp/Common/CameraResources.cpp
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceResources Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • DeviceResources
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

DeviceResources Class Reference

#include "DeviceResources.h"

List of all members.

Public Member Functions

DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources (_In_ bool forceWarpDevice)
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources (Windows::Foundation::Size sizeContent, Windows::Foundation::Size sizeViewport)
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
DeviceResources ()
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (winrt::Windows::Graphics::Holographic::HolographicCamera camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | AddHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
RECT | AdjustUpdateRect (RECT const &updateRect)
void | BeginDraw (_In_opt_ const RECT *pUpdateRect=nullptr)
void | ClearTarget ()
void | CreateDeviceResources ()
void | EndDraw ()
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (winrt::Windows::Graphics::Holographic::HolographicFrame frame, winrt::Windows::Graphics::Holographic::HolographicFramePrediction prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
void | EnsureCameraResources (Windows::Graphics::Holographic::HolographicFrame^frame, Windows::Graphics::Holographic::HolographicFramePrediction^prediction)
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView1 * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetView () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetViewRight () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetViewRight () const
ID3D11RenderTargetView * | GetBackBufferRenderTargetViewRight () const
Windows::Foundation::Size GetContentSize ()
float | GetContentZoomFactor ()
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device5 * | GetD2DDevice () const
ID2D1Device1 * | GetD2DDevice () const
ID2D1Device5 * | GetD2DDevice () const
ID2D1Device1 * | GetD2DDevice () const
ID2D1Device4 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device1 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1Device2 * | GetD2DDevice () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext5 * | GetD2DDeviceContext () const
ID2D1DeviceContext1 * | GetD2DDeviceContext () const
ID2D1DeviceContext5 * | GetD2DDeviceContext () const
ID2D1DeviceContext1 * | GetD2DDeviceContext () const
ID2D1DeviceContext4 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext1 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1DeviceContext2 * | GetD2DDeviceContext () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory6 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory6 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory5 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory2 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Factory3 * | GetD2DFactory () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmap () const
ID2D1Bitmap1 * | GetD2DTargetBitmapRight () const
ID2D1Bitmap1 * | GetD2DTargetBitmapRight () const
ID2D1Bitmap1 * | GetD2DTargetBitmapRight () const
ID3D11Device2 * | GetD3DDevice () const
winrt::com_ptr< ID3D11Device3 >
const & 		GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device3 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device * | GetD3DDevice () const
ID3D11Device4 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11Device3 * | GetD3DDevice () const
ID3D11Device2 * | GetD3DDevice () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext2 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext2 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext2 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
ID3D11DeviceContext2 * | GetD3DDeviceContext () const
ID3D11DeviceContext2 * | GetD3DDeviceContext () const
ID3D11DeviceContext3 * | GetD3DDeviceContext () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | GetD3DInteropDevice () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
ID3D11DepthStencilView * | GetDepthStencilView () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
D3D_FEATURE_LEVEL | GetDeviceFeatureLevel () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
bool | GetDeviceSupportsVprt () const
float | GetDpi () const
float | GetDpi () const
float | GetDPI ()
float | GetDpi () const
float | GetDpi () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory4 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory3 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory3 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory2 * | GetDWriteFactory () const
IDWriteFactory3 * | GetDWriteFactory () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
IDXGIAdapter3 * | GetDXGIAdapter () const
ID3D11GeometryShader * | GetGeometryShader (const GeometryShaderIndex index)
Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource | GetImageSource () const
Microsoft::WRL::ComPtr
< IVirtualSurfaceImageSourceNative > 		GetImageSourceNative () const
ID3D11InputLayout * | GetInputLayout (const VertexShaderIndex index)
Windows::Foundation::Size | GetLogicalSize () const
winrt::Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
Windows::Foundation::Size | GetLogicalSize () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
D2D1::Matrix3x2F | GetOrientationTransform2D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
DirectX::XMFLOAT4X4 | GetOrientationTransform3D () const
Windows::Foundation::Size | GetOutputSize () const
winrt::Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
Windows::Foundation::Size | GetOutputSize () const
ID3D11PixelShader * | GetPixelShader (const PixelShaderIndex index)
Windows::Foundation::Size | GetRenderTargetSize () const
winrt::Windows::Foundation::Size | GetRenderTargetSize () const
Windows::Foundation::Size | GetRenderTargetSize () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
D3D11_VIEWPORT | GetScreenViewport () const
bool | GetStereoState () const
bool | GetStereoState () const
bool | GetStereoState () const
IDXGISwapChain3 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain3 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
IDXGISwapChain1 * | GetSwapChain () const
Windows::UI::Xaml::Controls::SwapChainPanel | GetSwapChainPanel () const
ID3D11Resource * | GetTexture (const TextureIndex index)
void | GetUpdateRects (_Outptr_ RECT **ppUpdateRects, _Out_ ULONG *pUpdateRectsCount)
ID3D11VertexShader * | GetVertexShader (const VertexShaderIndex index)
Windows::Foundation::Size GetViewSize ()
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
IWICImagingFactory2 * | GetWicImagingFactory () const
Windows::UI::Core::CoreWindow | GetWindow () const
Windows::UI::Core::CoreWindow | GetWindow () const
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | HandleDeviceLost ()
void | InvalidateContentRect ()
void | InvalidateRect (RECT const &updateRect)
void | Present ()
void | Present ()
void | Present ()
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | Present ()
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | Present ()
void | Present ()
void | Present (winrt::Windows::Graphics::Holographic::HolographicFrame frame)
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | Present ()
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present (Windows::Graphics::Holographic::HolographicFrame^frame)
void | Present ()
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RegisterDeviceNotify (IDeviceNotify *deviceNotify)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (winrt::Windows::Graphics::Holographic::HolographicCamera camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | RemoveHolographicCamera (Windows::Graphics::Holographic::HolographicCamera^camera)
void | SetCompositionScale (float compositionScaleX, float compositionScaleY)
void | SetCompositionScale (float compositionScaleX, float compositionScaleY)
void | SetCompositionScale (float compositionScaleX, float compositionScaleY)
void | SetCompositionScale (float compositionScaleX, float compositionScaleY)
void | SetCompositionScale (float compositionScaleX, float compositionScaleY)
void | SetContentSize (Windows::Foundation::Size size)
void | SetContentZoomFactor (float contentZoomFactor)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (winrt::Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetCurrentOrientation (Windows::Graphics::Display::DisplayOrientations currentOrientation)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDPI (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetDpi (float dpi)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
Concurrency::task< void > | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetHolographicSpace (winrt::Windows::Graphics::Holographic::HolographicSpace space)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^space)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (winrt::Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetLogicalSize (Windows::Foundation::Size logicalSize)
void | SetSwapChainPanel (Windows::UI::Xaml::Controls::SwapChainPanel^panel)
void | SetSwapChainPanel (Windows::UI::Xaml::Controls::SwapChainPanel^panel)
void | SetSwapChainPanel (Windows::UI::Xaml::Controls::SwapChainPanel^panel)
void | SetSwapChainPanel (Windows::UI::Xaml::Controls::SwapChainPanel^panel)
void | SetSwapChainPanel (Windows::UI::Xaml::Controls::SwapChainPanel^panel)
void | SetViewSize (Windows::Foundation::Size size)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (winrt::Windows::UI::Core::CoreWindow const &window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | SetWindow (Windows::UI::Core::CoreWindow^window)
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | Trim ()
void | UpdateStereoState ()
void | UpdateStereoState ()
void | UpdateStereoState ()
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (LCallback const &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
template<typename RetType , typename LCallback >
RetType | UseHolographicCameraResources (const LCallback &callback)
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | ValidateDevice ()
void | WaitOnSwapChain ()

Public Attributes

Windows::Foundation::Size m_logicalSize

Private Member Functions

void | CheckStereoEnabledStatus ()
void | CheckStereoEnabledStatus ()
void | CheckStereoEnabledStatus ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
DXGI_MODE_ROTATION | ComputeDisplayRotation ()
float | ConvertFromDIPToPixelUnit (float val, bool rounded=true)
float | ConvertFromPixelToDIPUnit (float val, bool rounded=true)
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateDeviceResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InitializeUsingHolographicSpace ()
void | InvalidateAndResizeVSIS ()
Concurrency::task< void > | LoadShaders ()
void | RefreshScaleFactor ()
bool | ShouldApplyContentZoomFactor (float contentZoomFactor)
void | UpdateRenderTargetSize ()

Private Attributes

bool | _beginDrawStarted
Windows::Foundation::Size _contentSize
float | _contentZoomFactor
Microsoft::WRL::ComPtr
< ID2D1DeviceContext > 		_d2dContext
Microsoft::WRL::ComPtr
< ID2D1Device > 		_d2dDevice
Microsoft::WRL::ComPtr
< ID2D1Factory2 > 		_d2dFactory
Microsoft::WRL::ComPtr
< ID3D11DeviceContext2 > 		_d3dContext
Microsoft::WRL::ComPtr
< ID3D11Device > 		_d3dDevice
float | _dpiAdjustmentRatio
float | _logicalDPI
Windows::Foundation::Size _viewSize
Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource | _vsis
Microsoft::WRL::ComPtr
< IVirtualSurfaceImageSourceNative > 		_vsisNative
const float | DEFAULT_DPI = 96.f
std::map< UINT32,
std::unique_ptr
< CameraResources > > 		m_cameraResources
std::mutex | m_cameraResourcesLock
float | m_compositionScaleX
float | m_compositionScaleY
Windows::Graphics::Display::DisplayOrientations | m_currentOrientation
winrt::Windows::Graphics::Display::DisplayOrientations | m_currentOrientation
Microsoft::WRL::ComPtr
< ID2D1DeviceContext4 > 		m_d2dContext
winrt::com_ptr
< ID2D1DeviceContext2 > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1DeviceContext2 > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1DeviceContext1 > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1DeviceContext5 > 		m_d2dContext
Microsoft::WRL::ComPtr
< ID2D1Device4 > 		m_d2dDevice
winrt::com_ptr< ID2D1Device2 > | m_d2dDevice
Microsoft::WRL::ComPtr
< ID2D1Device2 > 		m_d2dDevice
Microsoft::WRL::ComPtr
< ID2D1Device5 > 		m_d2dDevice
Microsoft::WRL::ComPtr
< ID2D1Device1 > 		m_d2dDevice
Microsoft::WRL::ComPtr
< ID2D1Factory3 > 		m_d2dFactory
winrt::com_ptr< ID2D1Factory3 > | m_d2dFactory
Microsoft::WRL::ComPtr
< ID2D1Factory6 > 		m_d2dFactory
Microsoft::WRL::ComPtr
< ID2D1Factory2 > 		m_d2dFactory
Microsoft::WRL::ComPtr
< ID2D1Factory5 > 		m_d2dFactory
winrt::com_ptr< ID2D1Bitmap1 > | m_d2dTargetBitmap
Microsoft::WRL::ComPtr
< ID2D1Bitmap1 > 		m_d2dTargetBitmap
Microsoft::WRL::ComPtr
< ID2D1Bitmap1 > 		m_d2dTargetBitmapRight
winrt::com_ptr< ID2D1Bitmap1 > | m_d2dTargetBitmapRight
winrt::com_ptr
< ID3D11DeviceContext3 > 		m_d3dContext
Microsoft::WRL::ComPtr
< ID3D11DeviceContext3 > 		m_d3dContext
Microsoft::WRL::ComPtr
< ID3D11DeviceContext2 > 		m_d3dContext
winrt::com_ptr
< ID3D11DepthStencilView > 		m_d3dDepthStencilView
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		m_d3dDepthStencilView
Microsoft::WRL::ComPtr
< ID3D11Device3 > 		m_d3dDevice
winrt::com_ptr< ID3D11Device3 > | m_d3dDevice
Microsoft::WRL::ComPtr
< ID3D11Device4 > 		m_d3dDevice
Microsoft::WRL::ComPtr
< ID3D11Device2 > 		m_d3dDevice
D3D_FEATURE_LEVEL | m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | m_d3dInteropDevice
Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice | m_d3dInteropDevice
winrt::Windows::Foundation::Size m_d3dRenderTargetSize
Windows::Foundation::Size m_d3dRenderTargetSize
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView1 > 		m_d3dRenderTargetView
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_d3dRenderTargetView
winrt::com_ptr
< ID3D11RenderTargetView > 		m_d3dRenderTargetView
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_d3dRenderTargetViewRight
winrt::com_ptr
< ID3D11RenderTargetView > 		m_d3dRenderTargetViewRight
IDeviceNotify * | m_deviceNotify = nullptr
float | m_dpi
Microsoft::WRL::ComPtr
< IDWriteFactory2 > 		m_dwriteFactory
Microsoft::WRL::ComPtr
< IDWriteFactory4 > 		m_dwriteFactory
winrt::com_ptr< IDWriteFactory3 > | m_dwriteFactory
Microsoft::WRL::ComPtr
< IDWriteFactory3 > 		m_dwriteFactory
Microsoft::WRL::ComPtr
< IDXGIAdapter3 > 		m_dxgiAdapter
Microsoft::WRL::ComPtr
< IDXGIFactory2 > 		m_dxgiFactory
float | m_effectiveDpi
bool | m_forceWarpDevice
HANDLE | m_frameLatencyWaitableObject
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShaders [GeometryShader_Max]
winrt::Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayouts [VertexShader_Max]
winrt::Windows::Foundation::Size m_logicalSize
winrt::Windows::Graphics::Display::DisplayOrientations | m_nativeOrientation
Windows::Graphics::Display::DisplayOrientations | m_nativeOrientation
D2D1::Matrix3x2F | m_orientationTransform2D
DirectX::XMFLOAT4X4 | m_orientationTransform3D
Windows::Foundation::Size m_outputSize
winrt::Windows::Foundation::Size m_outputSize
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShaders [PixelShader_Max]
D3D11_VIEWPORT | m_screenViewport
bool | m_stereoEnabled
bool | m_supportsVprt = false
Microsoft::WRL::ComPtr
< IDXGISwapChain1 > 		m_swapChain
Microsoft::WRL::ComPtr
< IDXGISwapChain3 > 		m_swapChain
winrt::com_ptr< IDXGISwapChain1 > | m_swapChain
Windows::UI::Xaml::Controls::SwapChainPanel | m_swapChainPanel
Microsoft::WRL::ComPtr
< ID3D11Resource > 		m_textures [Texture_Max]
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShaders [VertexShader_Max]
winrt::com_ptr
< IWICImagingFactory2 > 		m_wicFactory
Microsoft::WRL::ComPtr
< IWICImagingFactory2 > 		m_wicFactory
Platform::Agile
< Windows::UI::Core::CoreWindow > 		m_window

Detailed Description

Definition at line 16 of file DeviceResources.h.

Constructor & Destructor Documentation

DeviceResources ( )

Definition at line 17 of file DeviceResources.cpp.

{
    CreateDeviceIndependentResources();
}

DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources | ( | Windows::Foundation::Size | sizeContent,
 |  | Windows::Foundation::Size | sizeViewport
 | ) |  |

Definition at line 9 of file DeviceResources.cpp.

                                                                                :
    _beginDrawStarted(false),
    _contentZoomFactor(1.0f)
{
    SetContentSize(size);
    SetViewSize(sizeViewport);
    _logicalDPI = Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi;
    _dpiAdjustmentRatio = _logicalDPI / DEFAULT_DPI;
    CreateDeviceResources();
}

DeviceResources ( )
DeviceResources ( )
DeviceResources ( _In_ bool forceWarpDevice )

Definition at line 68 of file DeviceResources.cpp.

                                                            :
    m_screenViewport(),
    m_d3dFeatureLevel(D3D_FEATURE_LEVEL_9_1),
    m_d3dRenderTargetSize(),
    m_outputSize(),
    m_logicalSize(),
    m_nativeOrientation(DisplayOrientations::None),
    m_currentOrientation(DisplayOrientations::None),
    m_dpi(-1.0f),
    m_deviceNotify(nullptr),
    m_forceWarpDevice(forceWarpDevice)
{
    CreateDeviceIndependentResources();
    CreateDeviceResources();
}

DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )
DeviceResources ( )

Member Function Documentation

void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( winrt::Windows::Graphics::Holographic::HolographicCamera camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void AddHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
RECT AdjustUpdateRect ( RECT const & updateRect )

Definition at line 317 of file DeviceResources.cpp.

{
    RECT newUpdateRect = { 0, 0, 0, 0 };
    // Ensure update rect is within content rect's boundary and do DPI adjustment as needed.
    // We also inflate the rect further by rounding down the top/left position and rounding up
    // the bottom/right position.
    newUpdateRect.left = static_cast<long>(ConvertFromDIPToPixelUnit(updateRect.left < 0 ? 0 : static_cast<float>(updateRect.left), false/*rounded*/));
    newUpdateRect.top = static_cast<long>(ConvertFromDIPToPixelUnit(updateRect.top < 0 ? 0 : static_cast<float>(updateRect.top), false/*rounded*/));
    newUpdateRect.right = static_cast<long>(ConvertFromDIPToPixelUnit(updateRect.right > _contentSize.Width ? _contentSize.Width : static_cast<float>(updateRect.right)));
    newUpdateRect.bottom = static_cast<long>(ConvertFromDIPToPixelUnit(updateRect.bottom > _contentSize.Height ? _contentSize.Height : static_cast<float>(updateRect.bottom)));

    return newUpdateRect;
}

void BeginDraw ( _In_opt_ const RECT * pUpdateRect = nullptr )

Definition at line 199 of file DeviceResources.cpp.

{
    assert(_vsisNative != nullptr);
    long pixelViewWidth = static_cast<long>(ConvertFromDIPToPixelUnit(_viewSize.Width));
    long pixelViewHeight = static_cast<long>(ConvertFromDIPToPixelUnit(_viewSize.Height));
    RECT updateRect = { 0, 0, pixelViewWidth, pixelViewHeight };
    RECT emptyRect = { 0, 0, 0, 0 };

    if (pUpdateRect == nullptr)
    {
        RECT visibleRect = {};

        DX::ThrowIfFailed(
            _vsisNative->GetVisibleBounds(&visibleRect)
            );

        if (visibleRect != emptyRect) { updateRect = visibleRect; }
    }
    else
    {
        if (*pUpdateRect != emptyRect)
        {
            updateRect = *pUpdateRect;
        }
    }

    POINT offset;
    ComPtr<IDXGISurface> surface;

    // Returns a target surface and an offset to use as the top left origin when drawing.
    DX::ThrowIfFailed(
        _vsisNative->BeginDraw(updateRect, &surface, &offset)
    );

    // Create render target.
    ComPtr<ID2D1Bitmap1> bitmap;
    DX::ThrowIfFailed(
        _d2dContext->CreateBitmapFromDxgiSurface(
        surface.Get(),
        nullptr,
        &bitmap
        )
        );

    _d2dContext->BeginDraw();

    // Set the context transformation based on the offset (in physical pixel units) returned by VSIS's BeginDraw.
    // Since D2D operates on DIP units, we need to do the inverse DPI adjustment to make the coordinates match.
    // Note that we don't round the return value because D2D will scale everything back up by the DPI scale factor
    // and the result should land on the correct pixel as we operate in physical pixels.
    _d2dContext->SetTransform(
        D2D1::Matrix3x2F::Translation(
        ConvertFromPixelToDIPUnit(static_cast<float>(offset.x - updateRect.left), false/*rounded*/),
        ConvertFromPixelToDIPUnit(static_cast<float>(offset.y - updateRect.top), false/*rounded*/)
        )
        );

    _d2dContext->SetTarget(bitmap.Get());

    _beginDrawStarted = true;
}

void CheckStereoEnabledStatus ( ) [private]

Definition at line 738 of file DeviceResources.cpp.

{
    // first, retrieve the underlying DXGI Device from the D3D Device
    ComPtr<IDXGIDevice1> dxgiDevice;
    DX::ThrowIfFailed(
        m_d3dDevice.As(&dxgiDevice)
        );

    // next, get the associated adapter from the DXGI Device
    ComPtr<IDXGIAdapter> dxgiAdapter;
    DX::ThrowIfFailed(
        dxgiDevice->GetAdapter(&dxgiAdapter)
        );

    // next, get the parent factory from the DXGI adapter
    ComPtr<IDXGIFactory2> dxgiFactory;
    DX::ThrowIfFailed(
        dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
        );

    m_stereoEnabled = dxgiFactory->IsWindowedStereoEnabled() ? true : false;
}

void CheckStereoEnabledStatus ( ) [private]
void CheckStereoEnabledStatus ( ) [private]
void ClearTarget ( )

Definition at line 280 of file DeviceResources.cpp.

{
    // Set the background on which objects will be rendered on top
    Windows::UI::Color color = CanvasBackgroundColor;

    _d2dContext->Clear(D2D1::ColorF(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f));

}

DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]

Definition at line 664 of file DeviceResources.cpp.

{
    DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED;

    // Note: NativeOrientation can only be Landscape or Portrait even though
    // the DisplayOrientations enum has other values.
    switch (m_nativeOrientation)
    {
    case DisplayOrientations::Landscape:
        switch (m_currentOrientation)
        {
        case DisplayOrientations::Landscape:
            rotation = DXGI_MODE_ROTATION_IDENTITY;
            break;

        case DisplayOrientations::Portrait:
            rotation = DXGI_MODE_ROTATION_ROTATE270;
            break;

        case DisplayOrientations::LandscapeFlipped:
            rotation = DXGI_MODE_ROTATION_ROTATE180;
            break;

        case DisplayOrientations::PortraitFlipped:
            rotation = DXGI_MODE_ROTATION_ROTATE90;
            break;
        }
        break;

    case DisplayOrientations::Portrait:
        switch (m_currentOrientation)
        {
        case DisplayOrientations::Landscape:
            rotation = DXGI_MODE_ROTATION_ROTATE90;
            break;

        case DisplayOrientations::Portrait:
            rotation = DXGI_MODE_ROTATION_IDENTITY;
            break;

        case DisplayOrientations::LandscapeFlipped:
            rotation = DXGI_MODE_ROTATION_ROTATE270;
            break;

        case DisplayOrientations::PortraitFlipped:
            rotation = DXGI_MODE_ROTATION_ROTATE180;
            break;
        }
        break;
    }
    return rotation;
}

DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
DXGI_MODE_ROTATION ComputeDisplayRotation ( ) [private]
float ConvertFromDIPToPixelUnit | ( | float | val,
 |  | bool | rounded = true |
 | ) |  |  | [inline, private]

Definition at line 51 of file DeviceResources.h.

                                                                        {
            float pixelVal = val * _dpiAdjustmentRatio;
            return rounded? floorf(pixelVal + 0.5f) : pixelVal;
        };

float ConvertFromPixelToDIPUnit | ( | float | val,
 |  | bool | rounded = true |
 | ) |  |  | [inline, private]

Definition at line 55 of file DeviceResources.h.

                                                                        {
            float dipVal = (_dpiAdjustmentRatio == 0) ? val : val / _dpiAdjustmentRatio;
            return rounded ? floorf(dipVal + 0.5f) : dipVal;
        };

void CreateDeviceIndependentResources ( ) [private]

Definition at line 23 of file DeviceResources.cpp.

{
    // Initialize Direct2D resources.
    D2D1_FACTORY_OPTIONS options{};

#if defined(_DEBUG)
    // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
    options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
#endif

    // Initialize the Direct2D Factory.
    DX::ThrowIfFailed(
        D2D1CreateFactory(
            D2D1_FACTORY_TYPE_SINGLE_THREADED,
            __uuidof(ID2D1Factory2),
            &options,
            &m_d2dFactory
        )
    );

    // Initialize the DirectWrite Factory.
    DX::ThrowIfFailed(
        DWriteCreateFactory(
            DWRITE_FACTORY_TYPE_SHARED,
            __uuidof(IDWriteFactory2),
            &m_dwriteFactory
        )
    );

    // Initialize the Windows Imaging Component (WIC) Factory.
    DX::ThrowIfFailed(
        CoCreateInstance(
            CLSID_WICImagingFactory2,
            nullptr,
            CLSCTX_INPROC_SERVER,
            IID_PPV_ARGS(&m_wicFactory)
        )
    );
}

void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceIndependentResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]

Definition at line 124 of file DeviceResources.cpp.

{
    // This flag adds support for surfaces with a different color channel ordering
    // than the API default. It is required for compatibility with Direct2D.
    UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;

#if defined(_DEBUG)
    if (DX::SdkLayersAvailable())
    {
        // If the project is in a debug build, enable debugging via SDK Layers with this flag.
        creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
    }
#endif

    // This array defines the set of DirectX hardware feature levels this app will support.
    // Note the ordering should be preserved.
    // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
    // of running on graphics cards starting with feature level 10.0.
    D3D_FEATURE_LEVEL featureLevels[] =
    {
        D3D_FEATURE_LEVEL_12_1,
        D3D_FEATURE_LEVEL_12_0,
        D3D_FEATURE_LEVEL_11_1,
        D3D_FEATURE_LEVEL_11_0,
        D3D_FEATURE_LEVEL_10_1,
        D3D_FEATURE_LEVEL_10_0
    };

    D3D11_RASTERIZER_DESC rasterDesc{
            D3D11_FILL_SOLID,
            D3D11_CULL_NONE,
            false,
            0,
            0.0f,
            0.0f,
            true,
            false,
            true,
            true };

    // Create the Direct3D 11 API device object and a corresponding context.
    ComPtr<ID3D11Device> device;
    ComPtr<ID3D11DeviceContext> context;

    const D3D_DRIVER_TYPE driverType = m_dxgiAdapter == nullptr ? D3D_DRIVER_TYPE_HARDWARE : D3D_DRIVER_TYPE_UNKNOWN;
    const HRESULT hr = D3D11CreateDevice(
        m_dxgiAdapter.Get(),        // Either nullptr, or the primary adapter determined by Windows Holographic.
        driverType,                 // Create a device using the hardware graphics driver.
        0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
        creationFlags,              // Set debug and Direct2D compatibility flags.
        featureLevels,              // List of feature levels this app can support.
        ARRAYSIZE(featureLevels),   // Size of the list above.
        D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
        &device,                    // Returns the Direct3D device created.
        &m_d3dFeatureLevel,         // Returns feature level of device created.
        &context                    // Returns the device immediate context.
    );

    if (FAILED(hr))
    {
        // If the initialization fails, fall back to the WARP device.
        // For more information on WARP, see:
        // http://go.microsoft.com/fwlink/?LinkId=286690
        DX::ThrowIfFailed(
            D3D11CreateDevice(
                nullptr,              // Use the default DXGI adapter for WARP.
                D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
                0,
                creationFlags,
                featureLevels,
                ARRAYSIZE(featureLevels),
                D3D11_SDK_VERSION,
                &device,
                &m_d3dFeatureLevel,
                &context
            )
        );
    }

    // Store pointers to the Direct3D device and immediate context.
    DX::ThrowIfFailed(
        device.As(&m_d3dDevice)
    );

    DX::ThrowIfFailed(
        context.As(&m_d3dContext)
    );

    // Acquire the DXGI interface for the Direct3D device.
    ComPtr<IDXGIDevice3> dxgiDevice;
    DX::ThrowIfFailed(
        m_d3dDevice.As(&dxgiDevice)
    );

    // Wrap the native device using a WinRT interop object.
    m_d3dInteropDevice = CreateDirect3DDevice(dxgiDevice.Get());

    // Cache the DXGI adapter.
    // This is for the case of no preferred DXGI adapter, or fallback to WARP.
    ComPtr<IDXGIAdapter> dxgiAdapter;
    DX::ThrowIfFailed(
        dxgiDevice->GetAdapter(&dxgiAdapter)
    );
    DX::ThrowIfFailed(
        dxgiAdapter.As(&m_dxgiAdapter)
    );

    DX::ThrowIfFailed(
        m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
    );

    DX::ThrowIfFailed(
        m_d2dDevice->CreateDeviceContext(
            D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
            &m_d2dContext
        )
    );
    // Set DPI that will be used when drawing to D2D
    m_d2dContext->SetDpi(dxgiDefaultDPI, dxgiDefaultDPI);

    // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
    D3D11_FEATURE_DATA_D3D11_OPTIONS3 options;
    m_d3dDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS3, &options, sizeof(options));
    if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
    {
        m_supportsVprt = true;
    }

    ID3D11RasterizerState* praster;
    DX::ThrowIfFailed(m_d3dDevice->CreateRasterizerState(&rasterDesc, &praster));
    m_d3dContext->RSSetState(praster);

    ComPtr<ID3D10Multithread> spMultithread;
    DX::ThrowIfFailed(
        m_d3dDevice->QueryInterface(IID_PPV_ARGS(&spMultithread))
    );
    spMultithread->SetMultithreadProtected(TRUE);
}

void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( )
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateDeviceResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]

Definition at line 234 of file DeviceResources.cpp.

{
    // Clear the previous window size specific context.
    ID3D11RenderTargetView* nullViews[] = {nullptr};
    m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
    m_d3dRenderTargetView = nullptr;
    m_d2dContext->SetTarget(nullptr);
    m_d2dTargetBitmap = nullptr;
    m_d3dDepthStencilView = nullptr;

    m_d3dContext->ClearState();
    m_d3dContext->Flush1(D3D11_CONTEXT_TYPE_ALL, nullptr);

    UpdateRenderTargetSize();

    // The width and height of the swap chain must be based on the window's
    // natively-oriented width and height. If the window is not in the native
    // orientation, the dimensions must be reversed.
    DXGI_MODE_ROTATION displayRotation = ComputeDisplayRotation();

    bool swapDimensions = displayRotation == DXGI_MODE_ROTATION_ROTATE90 || displayRotation == DXGI_MODE_ROTATION_ROTATE270;
    m_d3dRenderTargetSize.Width = swapDimensions ? m_outputSize.Height : m_outputSize.Width;
    m_d3dRenderTargetSize.Height = swapDimensions ? m_outputSize.Width : m_outputSize.Height;

    if (m_swapChain != nullptr)
    {
        // If the swap chain already exists, resize it.
        HRESULT hr = m_swapChain->ResizeBuffers(
            2, // Double-buffered swap chain.
            lround(m_d3dRenderTargetSize.Width),
            lround(m_d3dRenderTargetSize.Height),
            DXGI_FORMAT_B8G8R8A8_UNORM,
            0
            );

        if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
        {
            // If the device was removed for any reason, a new device and swap chain will need to be created.
            HandleDeviceLost();

            // Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method
            // and correctly set up the new device.
            return;
        }
        else
        {
            DX::ThrowIfFailed(hr);
        }
    }
    else
    {
        // Otherwise, create a new one using the same adapter as the existing Direct3D device.
        DXGI_SCALING scaling = DisplayMetrics::SupportHighResolutions ? DXGI_SCALING_NONE : DXGI_SCALING_STRETCH;
        DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};

        swapChainDesc.Width = lround(m_d3dRenderTargetSize.Width);      // Match the size of the window.
        swapChainDesc.Height = lround(m_d3dRenderTargetSize.Height);
        swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;              // This is the most common swap chain format.
        swapChainDesc.Stereo = false;
        swapChainDesc.SampleDesc.Count = 1;                             // Don't use multi-sampling.
        swapChainDesc.SampleDesc.Quality = 0;
        swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
        swapChainDesc.BufferCount = 2;                                  // Use double-buffering to minimize latency.
        swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;    // All Windows Store apps must use this SwapEffect.
        swapChainDesc.Flags = 0;
        swapChainDesc.Scaling = scaling;
        swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;

        // This sequence obtains the DXGI factory that was used to create the Direct3D device above.
        ComPtr<IDXGIDevice3> dxgiDevice;
        DX::ThrowIfFailed(
            m_d3dDevice.As(&dxgiDevice)
            );

        ComPtr<IDXGIAdapter> dxgiAdapter;
        DX::ThrowIfFailed(
            dxgiDevice->GetAdapter(&dxgiAdapter)
            );

        ComPtr<IDXGIFactory4> dxgiFactory;
        DX::ThrowIfFailed(
            dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
            );

        ComPtr<IDXGISwapChain1> swapChain;
        DX::ThrowIfFailed(
            dxgiFactory->CreateSwapChainForCoreWindow(
                m_d3dDevice.Get(),
                reinterpret_cast<IUnknown*>(m_window.Get()),
                &swapChainDesc,
                nullptr,
                &swapChain
                )
            );
        DX::ThrowIfFailed(
            swapChain.As(&m_swapChain)
            );

        // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
        // ensures that the application will only render after each VSync, minimizing power consumption.
        DX::ThrowIfFailed(
            dxgiDevice->SetMaximumFrameLatency(1)
            );
    }

    // Set the proper orientation for the swap chain, and generate 2D and
    // 3D matrix transformations for rendering to the rotated swap chain.
    // Note the rotation angle for the 2D and 3D transforms are different.
    // This is due to the difference in coordinate spaces.  Additionally,
    // the 3D matrix is specified explicitly to avoid rounding errors.

    switch (displayRotation)
    {
    case DXGI_MODE_ROTATION_IDENTITY:
        m_orientationTransform2D = Matrix3x2F::Identity();
        m_orientationTransform3D = ScreenRotation::Rotation0;
        break;

    case DXGI_MODE_ROTATION_ROTATE90:
        m_orientationTransform2D =
            Matrix3x2F::Rotation(90.0f) *
            Matrix3x2F::Translation(m_logicalSize.Height, 0.0f);
        m_orientationTransform3D = ScreenRotation::Rotation270;
        break;

    case DXGI_MODE_ROTATION_ROTATE180:
        m_orientationTransform2D =
            Matrix3x2F::Rotation(180.0f) *
            Matrix3x2F::Translation(m_logicalSize.Width, m_logicalSize.Height);
        m_orientationTransform3D = ScreenRotation::Rotation180;
        break;

    case DXGI_MODE_ROTATION_ROTATE270:
        m_orientationTransform2D =
            Matrix3x2F::Rotation(270.0f) *
            Matrix3x2F::Translation(0.0f, m_logicalSize.Width);
        m_orientationTransform3D = ScreenRotation::Rotation90;
        break;

    default:
        throw ref new FailureException();
    }

    DX::ThrowIfFailed(
        m_swapChain->SetRotation(displayRotation)
        );

    // Create a render target view of the swap chain back buffer.
    ComPtr<ID3D11Texture2D1> backBuffer;
    DX::ThrowIfFailed(
        m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
        );

    DX::ThrowIfFailed(
        m_d3dDevice->CreateRenderTargetView1(
            backBuffer.Get(),
            nullptr,
            &m_d3dRenderTargetView
            )
        );

    // Create a depth stencil view for use with 3D rendering if needed.
    CD3D11_TEXTURE2D_DESC1 depthStencilDesc(
        DXGI_FORMAT_D24_UNORM_S8_UINT,
        lround(m_d3dRenderTargetSize.Width),
        lround(m_d3dRenderTargetSize.Height),
        1, // This depth stencil view has only one texture.
        1, // Use a single mipmap level.
        D3D11_BIND_DEPTH_STENCIL
        );

    ComPtr<ID3D11Texture2D1> depthStencil;
    DX::ThrowIfFailed(
        m_d3dDevice->CreateTexture2D1(
            &depthStencilDesc,
            nullptr,
            &depthStencil
            )
        );

    CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
    DX::ThrowIfFailed(
        m_d3dDevice->CreateDepthStencilView(
            depthStencil.Get(),
            &depthStencilViewDesc,
            &m_d3dDepthStencilView
            )
        );

    // Set the 3D rendering viewport to target the entire window.
    m_screenViewport = CD3D11_VIEWPORT(
        0.0f,
        0.0f,
        m_d3dRenderTargetSize.Width,
        m_d3dRenderTargetSize.Height
        );

    m_d3dContext->RSSetViewports(1, &m_screenViewport);

    // Create a Direct2D target bitmap associated with the
    // swap chain back buffer and set it as the current target.
    D2D1_BITMAP_PROPERTIES1 bitmapProperties =
        D2D1::BitmapProperties1(
            D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
            D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
            m_dpi,
            m_dpi
            );

    ComPtr<IDXGISurface2> dxgiBackBuffer;
    DX::ThrowIfFailed(
        m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
        );

    DX::ThrowIfFailed(
        m_d2dContext->CreateBitmapFromDxgiSurface(
            dxgiBackBuffer.Get(),
            &bitmapProperties,
            &m_d2dTargetBitmap
            )
        );

    m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
    m_d2dContext->SetDpi(m_effectiveDpi, m_effectiveDpi);

    // Grayscale text anti-aliasing is recommended for all Windows Store apps.
    m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
}

void CreateWindowSizeDependentResources ( ) [private]
void CreateWindowSizeDependentResources ( ) [private]
void EndDraw ( )

Definition at line 261 of file DeviceResources.cpp.

{
    if (_beginDrawStarted)
    {
        _beginDrawStarted = false;

        _d2dContext->SetTarget(nullptr);

        // End the drawing
        DX::ThrowIfFailed(
            _d2dContext->EndDraw()
            );

        DX::ThrowIfFailed(
            _vsisNative->EndDraw()
            );
    }
}

void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | winrt::Windows::Graphics::Holographic::HolographicFrame | frame,
 |  | winrt::Windows::Graphics::Holographic::HolographicFramePrediction | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
void EnsureCameraResources | ( | Windows::Graphics::Holographic::HolographicFrame^ | frame,
 |  | Windows::Graphics::Holographic::HolographicFramePrediction^ | prediction
 | ) |  |
ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dRenderTargetView.get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView1* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetView ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dRenderTargetView.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_d3dRenderTargetViewRight.Get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_d3dRenderTargetViewRight.get(); }

ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d3dRenderTargetViewRight.Get(); }

Windows::Foundation::Size GetContentSize ( ) [inline]

Definition at line 20 of file DeviceResources.h.

{ return _contentSize; };

float GetContentZoomFactor ( ) [inline]

Definition at line 26 of file DeviceResources.h.

{ return _contentZoomFactor; };

ID2D1Device1* GetD2DDevice ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device5* GetD2DDevice ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_d2dDevice.get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device1* GetD2DDevice ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device5* GetD2DDevice ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device4* GetD2DDevice ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device1* GetD2DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1Device* GetD2DDevice ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return _d2dDevice.Get(); }

ID2D1Device2* GetD2DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dDevice.Get(); }

ID2D1DeviceContext1* GetD2DDeviceContext ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext1* GetD2DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext5* GetD2DDeviceContext ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_d2dContext.get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext1* GetD2DDeviceContext ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext5* GetD2DDeviceContext ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext4* GetD2DDeviceContext ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1DeviceContext* GetD2DDeviceContext ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return _d2dContext.Get(); }

ID2D1DeviceContext2* GetD2DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dContext.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory6* GetD2DFactory ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory6* GetD2DFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory5* GetD2DFactory ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 87 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_d2dFactory.get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Factory3* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return _d2dFactory.Get(); }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d2dFactory.Get();      }

ID2D1Factory2* GetD2DFactory ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_d2dFactory.Get();    }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_d2dTargetBitmap.get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmap ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d2dTargetBitmap.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmapRight ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_d2dTargetBitmapRight.Get(); }

ID2D1Bitmap1* GetD2DTargetBitmapRight ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_d2dTargetBitmapRight.get(); }

ID2D1Bitmap1* GetD2DTargetBitmapRight ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_d2dTargetBitmapRight.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device3* GetD3DDevice ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

winrt::com_ptr<ID3D11Device3> const& GetD3DDevice ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dDevice; }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device3* GetD3DDevice ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 78 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get();       }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device* GetD3DDevice ( ) const [inline]

Definition at line 36 of file DeviceResources.h.

{ return _d3dDevice.Get(); }

ID3D11Device2* GetD3DDevice ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_d3dDevice.Get(); }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11Device4* GetD3DDevice ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d3dDevice.Get();     }

ID3D11DeviceContext2* GetD3DDeviceContext ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext2* GetD3DDeviceContext ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dContext.get(); }

ID3D11DeviceContext2* GetD3DDeviceContext ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext2* GetD3DDeviceContext ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 79 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_d3dContext.Get();      }

ID3D11DeviceContext2* GetD3DDeviceContext ( ) const [inline]

Definition at line 37 of file DeviceResources.h.

{ return _d3dContext.Get(); }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

ID3D11DeviceContext3* GetD3DDeviceContext ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d3dContext.Get();    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dInteropDevice; }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 75 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dInteropDevice;      }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice GetD3DInteropDevice ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dInteropDevice;    }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_d3dDepthStencilView.get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

ID3D11DepthStencilView* GetDepthStencilView ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dDepthStencilView.Get(); }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 80 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel;       }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel; }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

D3D_FEATURE_LEVEL GetDeviceFeatureLevel ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_d3dFeatureLevel;     }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_supportsVprt;          }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 81 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_supportsVprt;        }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_supportsVprt; }

bool GetDeviceSupportsVprt ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_supportsVprt;        }

float GetDpi ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_dpi; }

float GetDpi ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_dpi; }

float GetDpi ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_dpi; }

float GetDpi ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_effectiveDpi; }

float GetDPI ( ) [inline]

Definition at line 24 of file DeviceResources.h.

{ return _logicalDPI; };

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_dwriteFactory.Get();  }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory3* GetDWriteFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory3* GetDWriteFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_dwriteFactory.get(); }

IDWriteFactory4* GetDWriteFactory ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory3* GetDWriteFactory ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_dwriteFactory.Get();  }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 88 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_dwriteFactory.Get();  }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_dwriteFactory.Get();  }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_dwriteFactory.Get();   }

IDWriteFactory2* GetDWriteFactory ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_dwriteFactory.Get(); }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 84 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();     }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_dxgiAdapter.Get(); }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

IDXGIAdapter3* GetDXGIAdapter ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_dxgiAdapter.Get();   }

ID3D11GeometryShader* GetGeometryShader ( const GeometryShaderIndex index ) [inline]

Definition at line 95 of file DeviceResources.h.

{ return m_geometryShaders[index].Get(); }

Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource GetImageSource ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return _vsis; }

Microsoft::WRL::ComPtr<IVirtualSurfaceImageSourceNative> GetImageSourceNative ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return _vsisNative; }

ID3D11InputLayout* GetInputLayout ( const VertexShaderIndex index ) [inline]

Definition at line 93 of file DeviceResources.h.

{ return m_inputLayouts[index].Get(); }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 36 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 36 of file DeviceResources.h.

{ return m_logicalSize; }

winrt::Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_logicalSize; }

Windows::Foundation::Size GetLogicalSize ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_logicalSize; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 63 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 66 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_orientationTransform2D; }

D2D1::Matrix3x2F GetOrientationTransform2D ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_orientationTransform2D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 56 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_orientationTransform3D; }

DirectX::XMFLOAT4X4 GetOrientationTransform3D ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_orientationTransform3D; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 35 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 35 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

winrt::Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 39 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 39 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 40 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 41 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 39 of file DeviceResources.h.

{ return m_outputSize; }

Windows::Foundation::Size GetOutputSize ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_outputSize; }

ID3D11PixelShader* GetPixelShader ( const PixelShaderIndex index ) [inline]

Definition at line 94 of file DeviceResources.h.

{ return m_pixelShaders[index].Get(); }

winrt::Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_d3dRenderTargetSize; }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_d3dRenderTargetSize; }

Windows::Foundation::Size GetRenderTargetSize ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_d3dRenderTargetSize; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 51 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 53 of file DeviceResources.h.

{ return m_screenViewport; }

D3D11_VIEWPORT GetScreenViewport ( ) const [inline]

Definition at line 54 of file DeviceResources.h.

{ return m_screenViewport; }

bool GetStereoState ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_stereoEnabled; }

bool GetStereoState ( ) const [inline]

Definition at line 43 of file DeviceResources.h.

{ return m_stereoEnabled; }

bool GetStereoState ( ) const [inline]

Definition at line 44 of file DeviceResources.h.

{ return m_stereoEnabled; }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain3* GetSwapChain ( ) const [inline]

Definition at line 47 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 49 of file DeviceResources.h.

{ return m_swapChain.get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain3* GetSwapChain ( ) const [inline]

Definition at line 48 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 42 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 50 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_swapChain.Get(); }

IDXGISwapChain1* GetSwapChain ( ) const [inline]

Definition at line 46 of file DeviceResources.h.

{ return m_swapChain.Get(); }

Windows::UI::Xaml::Controls::SwapChainPanel GetSwapChainPanel ( ) const [inline]

Definition at line 45 of file DeviceResources.h.

{ return m_swapChainPanel; }

ID3D11Resource* GetTexture ( const TextureIndex index ) [inline]

Definition at line 96 of file DeviceResources.h.

{ return m_textures[index].Get(); }

void GetUpdateRects | ( | _Outptr_ RECT ** | ppUpdateRects,
 |  | _Out_ ULONG * | pUpdateRectsCount
 | ) |  |

Definition at line 158 of file DeviceResources.cpp.

{
    assert(_vsisNative != nullptr);
    *pUpdateRectsCount = 0;

    DX::ThrowIfFailed(
        _vsisNative->GetUpdateRectCount(pUpdateRectsCount)
        );

    *ppUpdateRects = new RECT[*pUpdateRectsCount];

    if (*ppUpdateRects != nullptr)
    {
        DX::ThrowIfFailed(
            _vsisNative->GetUpdateRects(*ppUpdateRects, *pUpdateRectsCount)
            );
    }
    else
    {
        DX::ThrowIfFailed(E_OUTOFMEMORY);
    }
}

ID3D11VertexShader* GetVertexShader ( const VertexShaderIndex index ) [inline]

Definition at line 92 of file DeviceResources.h.

{ return m_vertexShaders[index].Get(); }

Windows::Foundation::Size GetViewSize ( ) [inline]

Definition at line 22 of file DeviceResources.h.

{ return _viewSize; };

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 89 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 60 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 57 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 64 of file DeviceResources.h.

{ return m_wicFactory.get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 52 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 61 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 59 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 62 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 58 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_wicFactory.Get();    }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 65 of file DeviceResources.h.

{ return m_wicFactory.Get(); }

IWICImagingFactory2* GetWicImagingFactory ( ) const [inline]

Definition at line 55 of file DeviceResources.h.

{ return m_wicFactory.Get();      }

Windows::UI::Core::CoreWindow GetWindow ( ) const [inline]

Definition at line 37 of file DeviceResources.h.

{ return m_window.Get(); }

Windows::UI::Core::CoreWindow GetWindow ( ) const [inline]

Definition at line 37 of file DeviceResources.h.

{ return m_window.Get(); }

void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )

Definition at line 313 of file DeviceResources.cpp.

{
    if (m_deviceNotify != nullptr)
    {
        m_deviceNotify->OnDeviceLost();
    }

    UseHolographicCameraResources<void>([this](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
    {
        for (auto& pair : cameraResourceMap)
        {
            CameraResources* pCameraResources = pair.second.get();
            pCameraResources->ReleaseResourcesForBackBuffer(this);
        }
    });

    InitializeUsingHolographicSpace();

    if (m_deviceNotify != nullptr)
    {
        m_deviceNotify->OnDeviceRestored();
    }
}

void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void HandleDeviceLost ( )
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]

Definition at line 71 of file DeviceResources.cpp.

{
    // The holographic space might need to determine which adapter supports
    // holograms, in which case it will specify a non-zero PrimaryAdapterId.
    LUID id =
    {
        m_holographicSpace->PrimaryAdapterId.LowPart,
        m_holographicSpace->PrimaryAdapterId.HighPart
    };

    // When a primary adapter ID is given to the app, the app should find
    // the corresponding DXGI adapter and use it to create Direct3D devices
    // and device contexts. Otherwise, there is no restriction on the DXGI
    // adapter the app can use.
    if ((id.HighPart != 0) || (id.LowPart != 0))
    {
        UINT createFlags = 0;
#ifdef DEBUG
        if (DX::SdkLayersAvailable())
        {
            createFlags |= DXGI_CREATE_FACTORY_DEBUG;
        }
#endif
        // Create the DXGI factory.
        ComPtr<IDXGIFactory1> dxgiFactory;
        DX::ThrowIfFailed(
            CreateDXGIFactory2(
                createFlags,
                IID_PPV_ARGS(&dxgiFactory)
            )
        );
        ComPtr<IDXGIFactory4> dxgiFactory4;
        DX::ThrowIfFailed(dxgiFactory.As(&dxgiFactory4));

        // Retrieve the adapter specified by the holographic space.
        DX::ThrowIfFailed(
            dxgiFactory4->EnumAdapterByLuid(
                id,
                IID_PPV_ARGS(&m_dxgiAdapter)
            )
        );
    }
    else
    {
        m_dxgiAdapter.Reset();
    }

    CreateDeviceResources();

    m_holographicSpace->SetDirect3D11Device(m_d3dInteropDevice);
}

void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InitializeUsingHolographicSpace ( ) [private]
void InvalidateAndResizeVSIS ( ) [private]

Definition at line 295 of file DeviceResources.cpp.

{
    if (_vsisNative != nullptr)
    {
        int pixelWidth = static_cast<int>(ConvertFromDIPToPixelUnit(_contentSize.Width));
        int pixelHeight = static_cast<int>(ConvertFromDIPToPixelUnit(_contentSize.Height));

        DX::ThrowIfFailed(
            _vsisNative->Resize(pixelWidth, pixelHeight)
            );
        RECT rect = { 0, 0, pixelWidth, pixelHeight };
        DX::ThrowIfFailed(
            _vsisNative->Invalidate(rect)
            );
    }
}

void InvalidateContentRect ( )

Definition at line 189 of file DeviceResources.cpp.

{
    long pixelContentWidth = static_cast<long>(ConvertFromDIPToPixelUnit(_contentSize.Width));
    long pixelContentHeight = static_cast<long>(ConvertFromDIPToPixelUnit(_contentSize.Height));
    RECT bounds = {0, 0, pixelContentWidth, pixelContentHeight};
    InvalidateRect(bounds);
}

void InvalidateRect ( RECT const & updateRect )

Definition at line 181 of file DeviceResources.cpp.

{
    assert(_vsisNative != nullptr);
    DX::ThrowIfFailed(
        _vsisNative->Invalidate(updateRect)
        );
}

Concurrency::task< void > LoadShaders ( ) [private]

Definition at line 393 of file DeviceResources.cpp.

{
    std::vector<Concurrency::task<void>> shaderTaskGroup;

    // Load vertex shaders and input layouts
    for (int i = 0; i < VertexShader_Max; i++)
    {
        Concurrency::task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(m_supportsVprt ? s_VprtVertexShaderFiles[i] : s_VertexShaderFiles[i]);

        Concurrency::task<void> createVSTask = loadVSTask.then([this, i](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_d3dDevice->CreateVertexShader(
                    &fileData[0],
                    fileData.size(),
                    nullptr,
                    m_vertexShaders[i].ReleaseAndGetAddressOf()));

            switch (i)
            {
            case VertexShader_Simple:
                {
                    const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
                    {
                        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,                            0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                        { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                    };

                    DX::ThrowIfFailed(
                        m_d3dDevice->CreateInputLayout(
                            vertexDesc,
                            ARRAYSIZE(vertexDesc),
                            &fileData[0],
                            fileData.size(),
                            m_inputLayouts[i].ReleaseAndGetAddressOf()));
                }
                break;
            case VertexShader_Texture:
                {
                    const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
                    {
                        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,                            0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                        { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                    };

                    DX::ThrowIfFailed(
                        m_d3dDevice->CreateInputLayout(
                            vertexDesc,
                            ARRAYSIZE(vertexDesc),
                            &fileData[0],
                            fileData.size(),
                            m_inputLayouts[i].ReleaseAndGetAddressOf()));
                }
                break;
            }
        });

        shaderTaskGroup.push_back(createVSTask);
    }

    // Load pixel shaders
    for (int i = 0; i < PixelShader_Max; i++)
    {
        Concurrency::task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(s_PixelShaderFiles[i]);

        Concurrency::task<void> createPSTask = loadPSTask.then([this, i](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_d3dDevice->CreatePixelShader(
                    &fileData[0],
                    fileData.size(),
                    nullptr,
                    m_pixelShaders[i].ReleaseAndGetAddressOf()));
        });

        shaderTaskGroup.push_back(createPSTask);
    }

    // Load geometry shaders
    for (int i = 0; i < GeometryShader_Max; i++)
    {
        Concurrency::task<std::vector<byte>> loadGSTask = DX::ReadDataAsync(s_GeometryShaderFiles[i]);

        Concurrency::task<void> createGSTask = loadGSTask.then([this, i](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_d3dDevice->CreateGeometryShader(
                    &fileData[0],
                    fileData.size(),
                    nullptr,
                    m_geometryShaders[i].ReleaseAndGetAddressOf()));
        });

        shaderTaskGroup.push_back(createGSTask);
    }

    // Load textures
    for (int i = 0; i < Texture_Max; i++)
    {
        Concurrency::task<std::vector<byte>> loadTextureTask = DX::ReadDataAsync(s_TextureFiles[i]);

        Concurrency::task<void> createTextureTask = loadTextureTask.then([this, i](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                DX::CreateWICTextureFromMemory(
                    m_d3dDevice.Get(),
                    &fileData[0],
                    fileData.size(),
                    m_textures[i].ReleaseAndGetAddressOf(),
                    nullptr));
        });

        shaderTaskGroup.push_back(createTextureTask);
    }

    return when_all(std::begin(shaderTaskGroup), std::end(shaderTaskGroup));
}

void Present ( )
void Present ( )
void Present ( )
void Present ( )
void Present ( )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( )
void Present ( )
void Present ( )
void Present ( winrt::Windows::Graphics::Holographic::HolographicFrame frame )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( )
void Present ( )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( )

Definition at line 633 of file DeviceResources.cpp.

{
    // The first argument instructs DXGI to block until VSync, putting the application
    // to sleep until the next VSync. This ensures we don't waste any cycles rendering
    // frames that will never be displayed to the screen.
    DXGI_PRESENT_PARAMETERS parameters = { 0 };
    HRESULT hr = m_swapChain->Present1(0, 0, &parameters);

    // Discard the contents of the render target.
    // This is a valid operation only when the existing contents will be entirely
    // overwritten. If dirty or scroll rects are used, this call should be removed.
    m_d3dContext->DiscardView1(m_d3dRenderTargetView.Get(), nullptr, 0);

    // Discard the contents of the depth stencil.
    m_d3dContext->DiscardView1(m_d3dDepthStencilView.Get(), nullptr, 0);

    // If the device was removed either by a disconnection or a driver upgrade, we
    // must recreate all device resources.

    if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
    {
        HandleDeviceLost();
    }
    else
    {
        DX::ThrowIfFailed(hr);
    }
}

void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( Windows::Graphics::Holographic::HolographicFrame^ frame )
void Present ( )
void RefreshScaleFactor ( ) [private]

Definition at line 146 of file DeviceResources.cpp.

{
    float logicalDPI = GetDPI() * GetContentZoomFactor();
    _dpiAdjustmentRatio = logicalDPI / DEFAULT_DPI;

    if (_d2dContext != nullptr)
    {
        _d2dContext->SetDpi(logicalDPI, logicalDPI);
        InvalidateAndResizeVSIS();
    }
}

void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RegisterDeviceNotify ( IDeviceNotify * deviceNotify )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( winrt::Windows::Graphics::Holographic::HolographicCamera camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void RemoveHolographicCamera ( Windows::Graphics::Holographic::HolographicCamera^ camera )
void SetCompositionScale | ( | float | compositionScaleX,
 |  | float | compositionScaleY
 | ) |  |
void SetCompositionScale | ( | float | compositionScaleX,
 |  | float | compositionScaleY
 | ) |  |
void SetCompositionScale | ( | float | compositionScaleX,
 |  | float | compositionScaleY
 | ) |  |

Definition at line 554 of file DeviceResources.cpp.

{
    if (m_compositionScaleX != compositionScaleX ||
        m_compositionScaleY != compositionScaleY)
    {
        m_compositionScaleX = compositionScaleX;
        m_compositionScaleY = compositionScaleY;
        CreateWindowSizeDependentResources();
    }
}

void SetCompositionScale | ( | float | compositionScaleX,
 |  | float | compositionScaleY
 | ) |  |
void SetCompositionScale | ( | float | compositionScaleX,
 |  | float | compositionScaleY
 | ) |  |
void SetContentSize ( Windows::Foundation::Size size )

Definition at line 289 of file DeviceResources.cpp.

{
    _contentSize = size;
    InvalidateAndResizeVSIS();
}

void SetContentZoomFactor ( float contentZoomFactor )

Definition at line 128 of file DeviceResources.cpp.

{
    if (ShouldApplyContentZoomFactor(contentZoomFactor))
    {
        _contentZoomFactor = contentZoomFactor;
        RefreshScaleFactor();
    }
}

void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( winrt::Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetCurrentOrientation ( Windows::Graphics::Display::DisplayOrientations currentOrientation )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )

Definition at line 520 of file DeviceResources.cpp.

{
    if (dpi != m_dpi)
    {
        m_dpi = dpi;

        // When the display DPI changes, the logical size of the window (measured in Dips) also changes and needs to be updated.
        m_logicalSize = Windows::Foundation::Size(m_window->Bounds.Width, m_window->Bounds.Height);

        m_d2dContext->SetDpi(m_dpi, m_dpi);
        CreateWindowSizeDependentResources();
    }
}

void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDpi ( float dpi )
void SetDPI ( float dpi )

Definition at line 118 of file DeviceResources.cpp.

{
    if (dpi != _logicalDPI)
    {
        _logicalDPI = dpi;
        RefreshScaleFactor();
    }
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
Concurrency::task<void> SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ space )
void SetHolographicSpace ( winrt::Windows::Graphics::Holographic::HolographicSpace space )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )

Definition at line 510 of file DeviceResources.cpp.

{
    if (m_logicalSize != logicalSize)
    {
        m_logicalSize = logicalSize;
        CreateWindowSizeDependentResources();
    }
}

void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( winrt::Windows::Foundation::Size logicalSize )

Definition at line 480 of file DeviceResources.cpp.

{
    if (m_logicalSize != logicalSize)
    {
        m_logicalSize = logicalSize;
        CreateWindowSizeDependentResources();
    }
}

void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetLogicalSize ( Windows::Foundation::Size logicalSize )
void SetSwapChainPanel ( Windows::UI::Xaml::Controls::SwapChainPanel^ panel )
void SetSwapChainPanel ( Windows::UI::Xaml::Controls::SwapChainPanel^ panel )
void SetSwapChainPanel ( Windows::UI::Xaml::Controls::SwapChainPanel^ panel )
void SetSwapChainPanel ( Windows::UI::Xaml::Controls::SwapChainPanel^ panel )
void SetSwapChainPanel ( Windows::UI::Xaml::Controls::SwapChainPanel^ panel )
void SetViewSize ( Windows::Foundation::Size size )

Definition at line 312 of file DeviceResources.cpp.

{
    _viewSize = size;
}

void SetWindow ( winrt::Windows::UI::Core::CoreWindow const & window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
void SetWindow ( Windows::UI::Core::CoreWindow^ window )
bool ShouldApplyContentZoomFactor ( float contentZoomFactor ) [inline, private]

Definition at line 59 of file DeviceResources.h.

                                                                   {
            return (contentZoomFactor > 0) && (_contentZoomFactor != contentZoomFactor);
        };

void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )

Definition at line 345 of file DeviceResources.cpp.

{
    m_d3dContext->ClearState();

    ComPtr<IDXGIDevice3> dxgiDevice;
    DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
    dxgiDevice->Trim();
}

void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void Trim ( )
void UpdateRenderTargetSize ( ) [private]

Definition at line 464 of file DeviceResources.cpp.

{
    m_effectiveDpi = m_dpi;

    // To improve battery life on high resolution devices, render to a smaller render target
    // and allow the GPU to scale the output when it is presented.
    if (!DisplayMetrics::SupportHighResolutions && m_dpi > DisplayMetrics::DpiThreshold)
    {
        float width = DX::ConvertDipsToPixels(m_logicalSize.Width, m_dpi);
        float height = DX::ConvertDipsToPixels(m_logicalSize.Height, m_dpi);

        // When the device is in portrait orientation, height > width. Compare the
        // larger dimension against the width threshold and the smaller dimension
        // against the height threshold.
        if (std::max(width, height) > DisplayMetrics::WidthThreshold && std::min(width, height) > DisplayMetrics::HeightThreshold)
        {
            // To scale the app we change the effective DPI. Logical size does not change.
            m_effectiveDpi /= 2.0f;
        }
    }

    // Calculate the necessary render target size in pixels.
    m_outputSize.Width = DX::ConvertDipsToPixels(m_logicalSize.Width, m_effectiveDpi);
    m_outputSize.Height = DX::ConvertDipsToPixels(m_logicalSize.Height, m_effectiveDpi);

    // Prevent zero size DirectX content from being created.
    m_outputSize.Width = std::max(m_outputSize.Width, 1.0f);
    m_outputSize.Height = std::max(m_outputSize.Height, 1.0f);
}

void UpdateStereoState ( )
void UpdateStereoState ( )

Definition at line 724 of file DeviceResources.cpp.

{
    bool previousStereoState = m_stereoEnabled;
    CheckStereoEnabledStatus();
    if (previousStereoState != m_stereoEnabled)
    {
        // Swap chain needs to be recreated so release the existing one.
        // The rest of the dependent resources with be released in CreateWindowSizeDependentResources.
        m_swapChain = nullptr;
        CreateWindowSizeDependentResources();
    }

}

void UpdateStereoState ( )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( LCallback const & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )

Definition at line 107 of file DeviceResources.h.

{
    std::lock_guard<std::mutex> guard(m_cameraResourcesLock);
    return callback(m_cameraResources);
}

RetType UseHolographicCameraResources ( const LCallback & callback )
RetType UseHolographicCameraResources ( const LCallback & callback )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )
void ValidateDevice ( )

Definition at line 545 of file DeviceResources.cpp.

{
    // The D3D Device is no longer valid if the default adapter changed since the device
    // was created or if the device has been removed.

    // First, get the information for the default adapter from when the device was created.

    ComPtr<IDXGIDevice3> dxgiDevice;
    DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));

    ComPtr<IDXGIAdapter> deviceAdapter;
    DX::ThrowIfFailed(dxgiDevice->GetAdapter(&deviceAdapter));

    ComPtr<IDXGIFactory4> deviceFactory;
    DX::ThrowIfFailed(deviceAdapter->GetParent(IID_PPV_ARGS(&deviceFactory)));

    ComPtr<IDXGIAdapter1> previousDefaultAdapter;
    DX::ThrowIfFailed(deviceFactory->EnumAdapters1(0, &previousDefaultAdapter));

    DXGI_ADAPTER_DESC1 previousDesc;
    DX::ThrowIfFailed(previousDefaultAdapter->GetDesc1(&previousDesc));

    // Next, get the information for the current default adapter.

    ComPtr<IDXGIFactory4> currentFactory;
    DX::ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&currentFactory)));

    ComPtr<IDXGIAdapter1> currentDefaultAdapter;
    DX::ThrowIfFailed(currentFactory->EnumAdapters1(0, &currentDefaultAdapter));

    DXGI_ADAPTER_DESC1 currentDesc;
    DX::ThrowIfFailed(currentDefaultAdapter->GetDesc1(&currentDesc));

    // If the adapter LUIDs don't match, or if the device reports that it has been removed,
    // a new D3D device must be created.

    if (previousDesc.AdapterLuid.LowPart != currentDesc.AdapterLuid.LowPart ||
        previousDesc.AdapterLuid.HighPart != currentDesc.AdapterLuid.HighPart ||
        FAILED(m_d3dDevice->GetDeviceRemovedReason()))
    {
        // Release references to resources related to the old device.
        dxgiDevice = nullptr;
        deviceAdapter = nullptr;
        deviceFactory = nullptr;
        previousDefaultAdapter = nullptr;

        // Create a new device and swap chain.
        HandleDeviceLost();
    }
}

void ValidateDevice ( )
void ValidateDevice ( )
void WaitOnSwapChain ( )

Definition at line 656 of file DeviceResources.cpp.

{
    DWORD result = WaitForSingleObjectEx(
        m_frameLatencyWaitableObject,
        INFINITE, // Infinite timeout (shouldn't ever occur)
        true
        );
}

Member Data Documentation

bool _beginDrawStarted [private]

Definition at line 87 of file DeviceResources.h.

Windows::Foundation::Size _contentSize [private]

Definition at line 84 of file DeviceResources.h.

float _contentZoomFactor [private]

Definition at line 79 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext> _d2dContext [private]

Definition at line 74 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Device> _d2dDevice [private]

Definition at line 73 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Factory2> _d2dFactory [private]

Definition at line 75 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11DeviceContext2> _d3dContext [private]

Definition at line 70 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11Device> _d3dDevice [private]

Definition at line 69 of file DeviceResources.h.

float _dpiAdjustmentRatio [private]

Definition at line 78 of file DeviceResources.h.

float _logicalDPI [private]

Definition at line 77 of file DeviceResources.h.

Windows::Foundation::Size _viewSize [private]

Definition at line 85 of file DeviceResources.h.

Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource _vsis [private]

Definition at line 82 of file DeviceResources.h.

Microsoft::WRL::ComPtr<IVirtualSurfaceImageSourceNative> _vsisNative [private]

Definition at line 81 of file DeviceResources.h.

const float DEFAULT_DPI = 96.f [private]

Definition at line 66 of file DeviceResources.h.

std::map< UINT32, std::unique_ptr< CameraResources > > m_cameraResources [private]

Definition at line 95 of file DeviceResources.h.

std::mutex m_cameraResourcesLock [private]

Definition at line 96 of file DeviceResources.h.

float m_compositionScaleX [private]

Definition at line 101 of file DeviceResources.h.

float m_compositionScaleY [private]

Definition at line 102 of file DeviceResources.h.

Windows::Graphics::Display::DisplayOrientations m_currentOrientation [private]

Definition at line 100 of file DeviceResources.h.

winrt::Windows::Graphics::Display::DisplayOrientations m_currentOrientation [private]

Definition at line 105 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext4> m_d2dContext [private]

Definition at line 70 of file DeviceResources.h.

winrt::com_ptr<ID2D1DeviceContext2> m_d2dContext [private]

Definition at line 88 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext2> m_d2dContext [private]

Definition at line 84 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID2D1DeviceContext1 > m_d2dContext [private]

Definition at line 77 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1DeviceContext5> m_d2dContext [private]

Definition at line 83 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID2D1Device1 > m_d2dDevice [private]

Definition at line 76 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Device4> m_d2dDevice [private]

Definition at line 69 of file DeviceResources.h.

winrt::com_ptr<ID2D1Device2> m_d2dDevice [private]

Definition at line 87 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Device2> m_d2dDevice [private]

Definition at line 83 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Device5> m_d2dDevice [private]

Definition at line 82 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Factory5> m_d2dFactory [private]

Definition at line 68 of file DeviceResources.h.

winrt::com_ptr<ID2D1Factory3> m_d2dFactory [private]

Definition at line 86 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Factory3> m_d2dFactory [private]

Definition at line 82 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID2D1Factory6> m_d2dFactory [private]

Definition at line 81 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID2D1Factory2 > m_d2dFactory [private]

Definition at line 75 of file DeviceResources.h.

winrt::com_ptr<ID2D1Bitmap1> m_d2dTargetBitmap [private]

Definition at line 89 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID2D1Bitmap1 > m_d2dTargetBitmap [private]

Definition at line 85 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID2D1Bitmap1 > m_d2dTargetBitmapRight [private]

Definition at line 90 of file DeviceResources.h.

winrt::com_ptr<ID2D1Bitmap1> m_d2dTargetBitmapRight [private]

Definition at line 90 of file DeviceResources.h.

winrt::com_ptr<ID3D11DeviceContext3> m_d3dContext [private]

Definition at line 76 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID3D11DeviceContext3 > m_d3dContext [private]

Definition at line 68 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11DeviceContext2> m_d3dContext [private]

Definition at line 64 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID3D11DepthStencilView > m_d3dDepthStencilView [private]

Definition at line 78 of file DeviceResources.h.

winrt::com_ptr<ID3D11DepthStencilView> m_d3dDepthStencilView [private]

Definition at line 82 of file DeviceResources.h.

winrt::com_ptr<ID3D11Device3> m_d3dDevice [private]

Definition at line 75 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11Device3> m_d3dDevice [private]

Definition at line 72 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID3D11Device4 > m_d3dDevice [private]

Definition at line 67 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11Device2> m_d3dDevice [private]

Definition at line 70 of file DeviceResources.h.

D3D_FEATURE_LEVEL m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0 [private]

Definition at line 85 of file DeviceResources.h.

Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice m_d3dInteropDevice [private]

Definition at line 72 of file DeviceResources.h.

winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice m_d3dInteropDevice [private]

Definition at line 69 of file DeviceResources.h.

winrt::Windows::Foundation::Size m_d3dRenderTargetSize [private]

Definition at line 101 of file DeviceResources.h.

Windows::Foundation::Size m_d3dRenderTargetSize [private]

Definition at line 96 of file DeviceResources.h.

winrt::com_ptr<ID3D11RenderTargetView> m_d3dRenderTargetView [private]

Definition at line 80 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID3D11RenderTargetView > m_d3dRenderTargetView [private]

Definition at line 77 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_d3dRenderTargetView [private]

Definition at line 76 of file DeviceResources.h.

winrt::com_ptr<ID3D11RenderTargetView> m_d3dRenderTargetViewRight [private]

Definition at line 81 of file DeviceResources.h.

Microsoft::WRL::ComPtr< ID3D11RenderTargetView > m_d3dRenderTargetViewRight [private]

Definition at line 81 of file DeviceResources.h.

IDeviceNotify * m_deviceNotify = nullptr [private]

Definition at line 88 of file DeviceResources.h.

float m_dpi [private]

Definition at line 101 of file DeviceResources.h.

Microsoft::WRL::ComPtr< IDWriteFactory2 > m_dwriteFactory [private]

Definition at line 78 of file DeviceResources.h.

Microsoft::WRL::ComPtr<IDWriteFactory4> m_dwriteFactory [private]

Definition at line 74 of file DeviceResources.h.

winrt::com_ptr<IDWriteFactory3> m_dwriteFactory [private]

Definition at line 93 of file DeviceResources.h.

Microsoft::WRL::ComPtr<IDWriteFactory3> m_dwriteFactory [private]

Definition at line 88 of file DeviceResources.h.

Microsoft::WRL::ComPtr< IDXGIAdapter3 > m_dxgiAdapter [private]

Definition at line 69 of file DeviceResources.h.

Microsoft::WRL::ComPtr<IDXGIFactory2> m_dxgiFactory [private]

Definition at line 72 of file DeviceResources.h.

float m_effectiveDpi [private]

Definition at line 104 of file DeviceResources.h.

bool m_forceWarpDevice [private]

Definition at line 99 of file DeviceResources.h.

HANDLE m_frameLatencyWaitableObject [private]

Definition at line 95 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShaders[GeometryShader_Max] [private]

Definition at line 138 of file DeviceResources.h.

winrt::Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 77 of file DeviceResources.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 82 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayouts[VertexShader_Max] [private]

Definition at line 135 of file DeviceResources.h.

Windows::Foundation::Size m_logicalSize

Definition at line 58 of file DeviceResources.h.

winrt::Windows::Foundation::Size m_logicalSize [private]

Definition at line 103 of file DeviceResources.h.

Windows::Graphics::Display::DisplayOrientations m_nativeOrientation [private]

Definition at line 99 of file DeviceResources.h.

winrt::Windows::Graphics::Display::DisplayOrientations m_nativeOrientation [private]

Definition at line 104 of file DeviceResources.h.

D2D1::Matrix3x2F m_orientationTransform2D [private]

Definition at line 107 of file DeviceResources.h.

DirectX::XMFLOAT4X4 m_orientationTransform3D [private]

Definition at line 108 of file DeviceResources.h.

Windows::Foundation::Size m_outputSize [private]

Definition at line 97 of file DeviceResources.h.

winrt::Windows::Foundation::Size m_outputSize [private]

Definition at line 102 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShaders[PixelShader_Max] [private]

Definition at line 137 of file DeviceResources.h.

D3D11_VIEWPORT m_screenViewport [private]

Definition at line 79 of file DeviceResources.h.

bool m_stereoEnabled [private]

Definition at line 107 of file DeviceResources.h.

bool m_supportsVprt = false [private]

Definition at line 92 of file DeviceResources.h.

Microsoft::WRL::ComPtr< IDXGISwapChain1 > m_swapChain [private]

Definition at line 74 of file DeviceResources.h.

winrt::com_ptr<IDXGISwapChain1> m_swapChain [private]

Definition at line 77 of file DeviceResources.h.

Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain [private]

Definition at line 71 of file DeviceResources.h.

Windows::UI::Xaml::Controls::SwapChainPanel m_swapChainPanel [private]

Definition at line 91 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11Resource> m_textures[Texture_Max] [private]

Definition at line 139 of file DeviceResources.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShaders[VertexShader_Max] [private]

Definition at line 136 of file DeviceResources.h.

winrt::com_ptr<IWICImagingFactory2> m_wicFactory [private]

Definition at line 94 of file DeviceResources.h.

Microsoft::WRL::ComPtr< IWICImagingFactory2 > m_wicFactory [private]

Definition at line 79 of file DeviceResources.h.

Platform::Agile< Windows::UI::Core::CoreWindow > m_window [private]

Definition at line 92 of file DeviceResources.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/DeviceResources.h
  • BasicHologram/cpp/Common/DeviceResources.h
  • BasicHologram/cppwinrt/Common/DeviceResources.h
  • CameraStreamCoordinateMapper/cpp/Common/DeviceResources.h
  • ComplexInk/cpp/Common/DeviceResources.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.h
  • D2DCustomEffects/cpp/ComputeShader/DeviceResources.h
  • D2DCustomEffects/cpp/PixelShader/DeviceResources.h
  • D2DCustomEffects/cpp/VertexShader/DeviceResources.h
  • D2DGradientMesh/cpp/DeviceResources.h
  • D2DPhotoAdjustment/cpp/Common/DeviceResources.h
  • D2DSvgImage/cpp/Common/DeviceResources.h
  • DWriteColorGlyph/cpp/DeviceResources.h
  • HolographicFaceTracking/cpp/Common/DeviceResources.h
  • HolographicMixedRealityCapture/cpp/Common/DeviceResources.h
  • HolographicSpatialMapping/cpp/Common/DeviceResources.h
  • HolographicSpatialStage/cpp/Common/DeviceResources.h
  • HolographicTagAlong/cpp/Common/DeviceResources.h
  • HolographicVoiceInput/cpp/Common/DeviceResources.h
  • LowLatencyInput/cpp/Common/DeviceResources.h
  • Simple3DGameDX/cpp/Common/DeviceResources.h
  • Simple3DGameDX/cppwinrt/Common/DeviceResources.h
  • Simple3DGameXaml/cpp/Common/DeviceResources.h
  • SpatialInteractionSource/cpp/Common/DeviceResources.h
  • 360VideoPlayback/cpp/Common/DeviceResources.cpp
  • BasicHologram/cpp/Common/DeviceResources.cpp
  • BasicHologram/cppwinrt/Common/DeviceResources.cpp
  • CameraStreamCoordinateMapper/cpp/Common/DeviceResources.cpp
  • ComplexInk/cpp/Common/DeviceResources.cpp
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.cpp
  • D2DCustomEffects/cpp/ComputeShader/DeviceResources.cpp
  • D2DCustomEffects/cpp/PixelShader/DeviceResources.cpp
  • D2DCustomEffects/cpp/VertexShader/DeviceResources.cpp
  • D2DGradientMesh/cpp/DeviceResources.cpp
  • D2DPhotoAdjustment/cpp/Common/DeviceResources.cpp
  • D2DSvgImage/cpp/Common/DeviceResources.cpp
  • DWriteColorGlyph/cpp/DeviceResources.cpp
  • HolographicFaceTracking/cpp/Common/DeviceResources.cpp
  • HolographicMixedRealityCapture/cpp/Common/DeviceResources.cpp
  • HolographicSpatialMapping/cpp/Common/DeviceResources.cpp
  • HolographicSpatialStage/cpp/Common/DeviceResources.cpp
  • HolographicTagAlong/cpp/Common/DeviceResources.cpp
  • HolographicVoiceInput/cpp/Common/DeviceResources.cpp
  • LowLatencyInput/cpp/Common/DeviceResources.cpp
  • Simple3DGameDX/cpp/Common/DeviceResources.cpp
  • Simple3DGameDX/cppwinrt/Common/DeviceResources.cpp
  • Simple3DGameXaml/cpp/Common/DeviceResources.cpp
  • SpatialInteractionSource/cpp/Common/DeviceResources.cpp
Generated on Fri Nov 15 2024 22:23:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ElementMargin Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • ElementMargin
Public Member Functions | Public Attributes

ElementMargin Struct Reference

#include "BaseElement.h"

List of all members.

Public Member Functions

ElementMargin ()
ElementMargin (float l, float t, float r, float b)

Public Attributes

float | bottom = 0.0f
float | left = 0.0f
float | right = 0.0f
float | top = 0.0f

Detailed Description

Definition at line 13 of file BaseElement.h.

Constructor & Destructor Documentation

ElementMargin ( )
ElementMargin | ( | float | l,
 |  | float | t,
 |  | float | r,
 |  | float | b |
 | ) |  |  | [inline]

Definition at line 17 of file BaseElement.h.

                                                          :
            left(l),
            top(t),
            right(r),
            bottom(b)
        {
            _ASSERTE(left >= 0.0f);
            _ASSERTE(top >= 0.0f);
            _ASSERTE(right >= 0.0f);
            _ASSERTE(bottom >= 0.0f);
        }

Member Data Documentation

float bottom = 0.0f

Definition at line 32 of file BaseElement.h.

float left = 0.0f

Definition at line 29 of file BaseElement.h.

float right = 0.0f

Definition at line 31 of file BaseElement.h.

float top = 0.0f

Definition at line 30 of file BaseElement.h.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cpp/Common/BaseElement.h
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Ellipse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Ellipse
Public Member Functions | Protected Member Functions | Private Attributes

Ellipse Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

Ellipse (FLOAT radiusX, FLOAT radiusY, FLOAT strokeThickness, D2D1::ColorF brushColor)
virtual void | Initialize () override
void | SetRadius (FLOAT x, FLOAT y)

Protected Member Functions

virtual void | Render () override

Private Attributes

D2D1::ColorF | m_brushColor
D2D1_ELLIPSE | m_ellipse
FLOAT | m_radiusX
FLOAT | m_radiusY
FLOAT | m_strokeThickness

Detailed Description

Definition at line 151 of file BaseElement.h.

Constructor & Destructor Documentation

Ellipse | ( | FLOAT | radiusX,
 |  | FLOAT | radiusY,
 |  | FLOAT | strokeThickness,
 |  | D2D1::ColorF | brushColor
 | ) |  |

Member Function Documentation

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 362 of file BaseElement.cpp.

{
    if (m_brush == nullptr)
    {
        const auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
        DX::ThrowIfFailed(d2dcontext->CreateSolidColorBrush(
            m_brushColor,
            &m_brush));
    }
    __super::Initialize();
}

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 381 of file BaseElement.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(m_transformMatrix);
    d2dContext->DrawEllipse(m_ellipse, m_brush.Get(), m_strokeThickness);
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetRadius | ( | FLOAT | x,
 |  | FLOAT | y
 | ) |  |

Definition at line 374 of file BaseElement.cpp.

{
    m_radiusX = x; m_radiusY = y;
    m_elementSize = { m_radiusX * 2.0f, m_radiusY * 2.0f };
    m_ellipse = D2D1::Ellipse(D2D1::Point2F(m_radiusX, m_radiusY), m_radiusX, m_radiusY);
}

Member Data Documentation

D2D1::ColorF m_brushColor [private]

Definition at line 162 of file BaseElement.h.

D2D1_ELLIPSE m_ellipse [private]

Definition at line 166 of file BaseElement.h.

FLOAT m_radiusX [private]

Definition at line 164 of file BaseElement.h.

FLOAT m_radiusY [private]

Definition at line 165 of file BaseElement.h.

FLOAT m_strokeThickness [private]

Definition at line 163 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExitButton Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • ExitButton
Public Member Functions | Private Attributes

ExitButton Class Reference

#include "Controls.h"

Inherits DX::Button.

List of all members.

Public Member Functions

ExitButton ()
virtual void | Initialize () override
virtual void | PerformAction () override

Private Attributes

std::shared_ptr< Text > | m_exitText

Detailed Description

Definition at line 59 of file Controls.h.

Constructor & Destructor Documentation

ExitButton ( )

Definition at line 224 of file Controls.cpp.

                       :
    Button(DEFAULT_SIZE)
{
    m_exitText = std::make_shared<Text>(L"Exit Playback", FONT_SIZE * 2, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
    m_exitText->SetElementMargin(TEXT_MARGIN);
    this->AddChildElement(m_exitText);

    this->SetLayoutHorizontal(true);
}

Member Function Documentation

void Initialize ( ) [override, virtual]

Reimplemented from Button.

Definition at line 234 of file Controls.cpp.

{
    __super::Initialize();

    m_exitText->SetBrush(m_brush.Get());

    m_exitText->Initialize();
}

void PerformAction ( ) [override, virtual]

Reimplemented from Button.

Definition at line 243 of file Controls.cpp.

{
    __super::PerformAction();
    ApplicationViewSwitcher::SwitchAsync(VideoGallery::GetMainViewId(), ApplicationView::GetForCurrentView()->Id, ApplicationViewSwitchingOptions::ConsolidateViews);
}

Member Data Documentation

std::shared_ptr<Text> m_exitText [private]

Definition at line 67 of file Controls.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/Controls.h
  • 360VideoPlayback/cpp/Common/Controls.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilledEllipse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • FilledEllipse
Public Member Functions | Protected Member Functions | Private Attributes

FilledEllipse Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

FilledEllipse (FLOAT radiusX, FLOAT radiusY, D2D1::ColorF brushColor)
virtual void | Initialize () override
void | SetRadius (FLOAT x, FLOAT y)

Protected Member Functions

virtual void | Render () override

Private Attributes

D2D1::ColorF | m_brushColor
D2D1_ELLIPSE | m_ellipse
FLOAT | m_radiusX
FLOAT | m_radiusY

Detailed Description

Definition at line 169 of file BaseElement.h.

Constructor & Destructor Documentation

FilledEllipse | ( | FLOAT | radiusX,
 |  | FLOAT | radiusY,
 |  | D2D1::ColorF | brushColor
 | ) |  |

Member Function Documentation

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 405 of file BaseElement.cpp.

{
    if (m_brush == nullptr)
    {
        const auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
        d2dcontext->CreateSolidColorBrush(
            m_brushColor,
            &m_brush);
    }
    __super::Initialize();
}

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 417 of file BaseElement.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(m_transformMatrix);
    d2dContext->FillEllipse(m_ellipse, m_brush.Get());
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetRadius | ( | FLOAT | x,
 |  | FLOAT | y
 | ) |  |

Definition at line 398 of file BaseElement.cpp.

{
    m_radiusX = x; m_radiusY = y;
    m_elementSize = { m_radiusX * 2.0f, m_radiusY * 2.0f };
    m_ellipse = D2D1::Ellipse(D2D1::Point2F(m_radiusX, m_radiusY), m_radiusX, m_radiusY);
}

Member Data Documentation

D2D1::ColorF m_brushColor [private]

Definition at line 180 of file BaseElement.h.

D2D1_ELLIPSE m_ellipse [private]

Definition at line 183 of file BaseElement.h.

FLOAT m_radiusX [private]

Definition at line 181 of file BaseElement.h.

FLOAT m_radiusY [private]

Definition at line 182 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilledRectangle Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • FilledRectangle
Public Member Functions | Protected Member Functions | Private Attributes

FilledRectangle Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

FilledRectangle (FLOAT width, FLOAT height, D2D1::ColorF brushColor)
virtual void | Initialize () override
void | SetRect (const D2D1_RECT_F &rect)

Protected Member Functions

virtual void | Render () override

Private Attributes

D2D1::ColorF | m_brushColor
D2D1_RECT_F | m_rect

Detailed Description

Definition at line 203 of file BaseElement.h.

Constructor & Destructor Documentation

FilledRectangle | ( | FLOAT | width,
 |  | FLOAT | height,
 |  | D2D1::ColorF | brushColor
 | ) |  |

Member Function Documentation

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 461 of file BaseElement.cpp.

{
    if (m_brush == nullptr)
    {
        const auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
        d2dcontext->CreateSolidColorBrush(
            m_brushColor,
            &m_brush
        );
    }
    __super::Initialize();
}

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 474 of file BaseElement.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(m_transformMatrix);
    d2dContext->FillRectangle(m_rect, m_brush.Get());
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetRect ( const D2D1_RECT_F & rect ) [inline]

Definition at line 208 of file BaseElement.h.

{ m_rect = rect; }

Member Data Documentation

D2D1::ColorF m_brushColor [private]

Definition at line 215 of file BaseElement.h.

D2D1_RECT_F m_rect [private]

Definition at line 214 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FocusableElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • FocusableElement
Public Member Functions | Protected Attributes

FocusableElement Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

Inherited by Button, and SeekBarElement.

List of all members.

Public Member Functions

FocusableElement ()
virtual | ~FocusableElement ()
virtual void | FocusUpdate ()
virtual bool | IsFocused ()
virtual void | PerformAction ()
virtual void | SetParentControlInformation (bool focused, Windows::Foundation::Numerics::float2 focusedPosition, UINT parentTextureWidth, UINT parentTextureHeight)
virtual void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) override

Protected Attributes

Windows::Foundation::Numerics::float2 m_elementCoordIntersectionPoint
bool | m_isFocused
bool | m_isFocusIntersectionCalculated
bool | m_isParentFocused
Windows::Foundation::Numerics::float2 m_parentFocusedPosition
UINT | m_parentTextureHeight
UINT | m_parentTextureWidth

Detailed Description

Definition at line 90 of file BaseElement.h.

Constructor & Destructor Documentation

FocusableElement ( )

Definition at line 205 of file BaseElement.cpp.

                                   :
    BaseElement(),
    m_isFocused(false),
    m_isParentFocused(false),
    m_isFocusIntersectionCalculated(false),
    m_elementCoordIntersectionPoint({ 0.0f,0.0f }),

virtual ~FocusableElement ( ) [virtual]

Member Function Documentation

virtual void FocusUpdate ( ) [inline, virtual]

Reimplemented in Button.

Definition at line 99 of file BaseElement.h.

{};

virtual bool IsFocused ( ) [inline, virtual]

Definition at line 96 of file BaseElement.h.

{ return m_isFocused; };

virtual void PerformAction ( ) [inline, virtual]

Reimplemented in Button, PlayPauseButton, ExitButton, and SeekBarElement.

Definition at line 97 of file BaseElement.h.

{};

void SetParentControlInformation | ( | bool | focused,
 |  | Windows::Foundation::Numerics::float2 | focusedPosition,
 |  | UINT | parentTextureWidth,
 |  | UINT | parentTextureHeight |
 | ) |  |  | [virtual]

Definition at line 254 of file BaseElement.cpp.

{
    m_isParentFocused = focused;
    if (!m_isParentFocused)
    {
        if (m_isFocused)
        {
            m_isFocused = false;
            FocusUpdate();
        }
    }
    m_parentFocusedPosition = focusedPosition;
    m_parentTextureWidth = parentTextureWidth;
    m_parentTextureHeight = parentTextureHeight;
}

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [override, virtual]

Reimplemented from BaseElement.

Reimplemented in Button, PlayPauseButton, and SeekBarElement.

Member Data Documentation

Windows::Foundation::Numerics::float2 m_elementCoordIntersectionPoint [protected]

Definition at line 109 of file BaseElement.h.

bool m_isFocused [protected]

Definition at line 99 of file BaseElement.h.

bool m_isFocusIntersectionCalculated [protected]

Definition at line 108 of file BaseElement.h.

bool m_isParentFocused [protected]

Definition at line 102 of file BaseElement.h.

Windows::Foundation::Numerics::float2 m_parentFocusedPosition [protected]

Definition at line 112 of file BaseElement.h.

UINT m_parentTextureHeight [protected]

Definition at line 111 of file BaseElement.h.

UINT m_parentTextureWidth [protected]

Definition at line 110 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GpuPerformanceTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • GpuPerformanceTimer
Public Member Functions | Private Attributes | Static Private Attributes

GpuPerformanceTimer Class Reference

#include "DirectXHelper.h"

List of all members.

Public Member Functions

GpuPerformanceTimer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | EndTimerForFrame ()
float | GetAvgFrameTime () const
float | GetFrameTime () const
float | GetMaxFrameTime () const
float | GetMinFrameTime () const
void | StartTimerForFrame ()

Private Attributes

uint32_t | m_currentFrameIndex = 0u
uint32_t | m_currentQuery = 0u
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11Query > 		m_disjointQuery [QueryCount]
Microsoft::WRL::ComPtr
< ID3D11Query > 		m_endTimestampQuery [QueryCount]
float | m_processingTimeAvgMs = 0.0f
float | m_processingTimeHistory [TimeHistoryCount] = {}
uint32_t | m_processingTimeHistoryIndex = 0u
float | m_processingTimeMaxMs = -std::numeric_limits<float>::infinity()
float | m_processingTimeMinMs = +std::numeric_limits<float>::infinity()
float | m_processingTimeMs = 0.0f
Microsoft::WRL::ComPtr
< ID3D11Query > 		m_startTimestampQuery [QueryCount]

Static Private Attributes

static constexpr uint32_t | QueryCount = 5u
static constexpr uint32_t | TimeHistoryCount = 64u

Detailed Description

Definition at line 132 of file DirectXHelper.h.

Constructor & Destructor Documentation

GpuPerformanceTimer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 205 of file DirectXHelper.cpp.

                                                             :
    m_deviceResources(deviceResources)
{
    ID3D11Device* device = m_deviceResources->GetD3DDevice();

    const D3D11_QUERY_DESC timestampQuery = CD3D11_QUERY_DESC(D3D11_QUERY_TIMESTAMP);
    const D3D11_QUERY_DESC disjointQuery = CD3D11_QUERY_DESC(D3D11_QUERY_TIMESTAMP_DISJOINT);

    for (uint32_t i = 0; i < QueryCount; ++i)
    {
        device->CreateQuery(&timestampQuery, m_startTimestampQuery[i].ReleaseAndGetAddressOf());
        device->CreateQuery(&timestampQuery, m_endTimestampQuery[i].ReleaseAndGetAddressOf());
        device->CreateQuery(&disjointQuery, m_disjointQuery[i].ReleaseAndGetAddressOf());
    }
}

Member Function Documentation

void EndTimerForFrame ( )

Definition at line 276 of file DirectXHelper.cpp.

{
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();
    context->End(m_endTimestampQuery[m_currentQuery].Get());
    context->End(m_disjointQuery[m_currentQuery].Get());
}

float GetAvgFrameTime ( ) const

Definition at line 288 of file DirectXHelper.cpp.

{
    return m_processingTimeAvgMs;
}

float GetFrameTime ( ) const

Definition at line 283 of file DirectXHelper.cpp.

{
    return m_processingTimeMs;
}

float GetMaxFrameTime ( ) const

Definition at line 298 of file DirectXHelper.cpp.

{
    return m_processingTimeMaxMs;
}

float GetMinFrameTime ( ) const

Definition at line 293 of file DirectXHelper.cpp.

{
    return m_processingTimeMinMs;
}

void StartTimerForFrame ( )

Definition at line 222 of file DirectXHelper.cpp.

{
    ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();

    // Just some book-keeping to see how long this algorithm is running
    m_currentQuery = (m_currentQuery + 1) % QueryCount;
    const uint32_t ReadQuery = (m_currentQuery + 1) % QueryCount;

    if (m_currentFrameIndex >= QueryCount)
    {
        D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjointData;
        while (context->GetData(m_disjointQuery[ReadQuery].Get(), &disjointData, sizeof(disjointData), 0) != S_OK);

        if (disjointData.Disjoint == 0)
        {
            uint64_t start;
            while (context->GetData(m_startTimestampQuery[ReadQuery].Get(), &start, sizeof(start), 0) != S_OK);

            uint64_t end;
            while (context->GetData(m_endTimestampQuery[ReadQuery].Get(), &end, sizeof(end), 0) != S_OK);

            constexpr float secondsToMilliseconds = 1000.0f;
            const float ticksToSeconds = 1.0f / static_cast<float>(disjointData.Frequency);
            const uint64_t ticksElapsed = end - start;

            m_processingTimeMs = static_cast<float>(ticksElapsed) * ticksToSeconds * secondsToMilliseconds;

            // Reset every ~10 seconds so the min/max has a chance to update
            if (m_currentFrameIndex % 300 == 0)
            {
                m_processingTimeMinMs = +std::numeric_limits<float>::infinity();
                m_processingTimeMaxMs = -std::numeric_limits<float>::infinity();
            }

            m_processingTimeMinMs = std::min(m_processingTimeMinMs, m_processingTimeMs);
            m_processingTimeMaxMs = std::max(m_processingTimeMaxMs, m_processingTimeMs);
        }
        else
        {
            m_processingTimeMs = std::numeric_limits<float>::quiet_NaN();;
        }

        m_processingTimeHistory[m_processingTimeHistoryIndex] = m_processingTimeMs;
        m_processingTimeHistoryIndex = (m_processingTimeHistoryIndex + 1) % TimeHistoryCount;

        m_processingTimeAvgMs = std::accumulate(m_processingTimeHistory, m_processingTimeHistory + TimeHistoryCount, 0.0f) / static_cast<float>(TimeHistoryCount);
    }

    ++m_currentFrameIndex;

    context->Begin(m_disjointQuery[m_currentQuery].Get());
    context->End(m_startTimestampQuery[m_currentQuery].Get());
}

Member Data Documentation

uint32_t m_currentFrameIndex = 0u [private]

Definition at line 156 of file DirectXHelper.h.

uint32_t m_currentQuery = 0u [private]

Definition at line 155 of file DirectXHelper.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 147 of file DirectXHelper.h.

Microsoft::WRL::ComPtr<ID3D11Query> m_disjointQuery[QueryCount] [private]

Definition at line 153 of file DirectXHelper.h.

Microsoft::WRL::ComPtr<ID3D11Query> m_endTimestampQuery[QueryCount] [private]

Definition at line 152 of file DirectXHelper.h.

float m_processingTimeAvgMs = 0.0f [private]

Definition at line 164 of file DirectXHelper.h.

float m_processingTimeHistory[TimeHistoryCount] = {} [private]

Definition at line 161 of file DirectXHelper.h.

uint32_t m_processingTimeHistoryIndex = 0u [private]

Definition at line 160 of file DirectXHelper.h.

float m_processingTimeMaxMs = -std::numeric_limits<float>::infinity() [private]

Definition at line 166 of file DirectXHelper.h.

float m_processingTimeMinMs = +std::numeric_limits<float>::infinity() [private]

Definition at line 165 of file DirectXHelper.h.

float m_processingTimeMs = 0.0f [private]

Definition at line 163 of file DirectXHelper.h.

Microsoft::WRL::ComPtr<ID3D11Query> m_startTimestampQuery[QueryCount] [private]

Definition at line 151 of file DirectXHelper.h.

constexpr uint32_t QueryCount = 5u [static, private]

Definition at line 149 of file DirectXHelper.h.

constexpr uint32_t TimeHistoryCount = 64u [static, private]

Definition at line 158 of file DirectXHelper.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.h
  • CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Line Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Line
Public Member Functions | Protected Member Functions | Private Attributes

Line Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

Line (FLOAT strokeThickness)
void | SetEndPoint (D2D1_POINT_2F &point)
void | SetStartPoint (D2D1_POINT_2F &point)

Protected Member Functions

virtual void | Render () override

Private Attributes

D2D1_POINT_2F | m_lineEnd
D2D1_POINT_2F | m_lineStart
FLOAT | m_strokeThickness

Detailed Description

Definition at line 135 of file BaseElement.h.

Constructor & Destructor Documentation

Line ( FLOAT strokeThickness )

Definition at line 325 of file BaseElement.cpp.

                                :
    m_strokeThickness(strokeThickness)
{
    m_lineStart = D2D1::Point2F(0.0f, 0.0f);
    m_lineEnd = D2D1::Point2F(1.0f, 0.0f);
}

Member Function Documentation

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 332 of file BaseElement.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(m_transformMatrix);
    d2dContext->DrawLine(m_lineStart, m_lineEnd, m_brush.Get(), m_strokeThickness);
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetEndPoint ( D2D1_POINT_2F & point )

Definition at line 346 of file BaseElement.cpp.

{
    m_transformRecalculationNeeded |= (point.x != m_lineEnd.x || point.y != m_lineEnd.y);
    m_lineEnd = point;
}

void SetStartPoint ( D2D1_POINT_2F & point )

Definition at line 340 of file BaseElement.cpp.

{
    m_transformRecalculationNeeded |= (point.x != m_lineStart.x || point.y != m_lineStart.y);
    m_lineStart = point;
}

Member Data Documentation

D2D1_POINT_2F m_lineEnd [private]

Definition at line 148 of file BaseElement.h.

D2D1_POINT_2F m_lineStart [private]

Definition at line 147 of file BaseElement.h.

FLOAT m_strokeThickness [private]

Definition at line 146 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MeshGeometry Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • MeshGeometry
Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions

MeshGeometry Struct Reference

#include "MeshGeometry.h"

List of all members.

Public Member Functions

MeshGeometry (D3D11_PRIMITIVE_TOPOLOGY topology, const Microsoft::WRL::ComPtr< ID3D11Buffer > &vertexBuffer, const Microsoft::WRL::ComPtr< ID3D11Buffer > &indexBuffer, uint32 vertexStride, uint32 indexCount)

Static Public Member Functions

static std::shared_ptr
< MeshGeometry > 		MakeTexturedCube ()
static std::shared_ptr
< MeshGeometry > 		MakeTexturedCylinder (unsigned short tessellation)

Public Attributes

const Microsoft::WRL::ComPtr
< ID3D11Buffer > 		IndexBuffer
const uint32 | IndexCount
const D3D11_PRIMITIVE_TOPOLOGY | Topology
const Microsoft::WRL::ComPtr
< ID3D11Buffer > 		VertexBuffer
const uint32 | VertexStride

Static Private Member Functions

static Microsoft::WRL::ComPtr
< ID3D11Buffer > 		CreateIndexBuffer (unsigned int numIndices, const unsigned short *indexData)
static Microsoft::WRL::ComPtr
< ID3D11Buffer > 		CreateVertexBuffer (unsigned int numVertices, const _360VideoPlayback::VertexPositionTexture *vertexData)
static std::vector< unsigned
short > 		MakeCylinderFaceIndices (unsigned short tessellation, unsigned short vertexIndexOffset, unsigned short centerVertexIndex, bool isFrontFace)
static std::vector
< _360VideoPlayback::VertexPositionTexture > 		MakeCylinderFaceVertices (unsigned short tessellation, float z, std::function< DirectX::XMFLOAT2(float x, float y)> uvGenerator)
static std::vector< unsigned
short > 		MakeCylinderSideIndices (unsigned short tessellation, unsigned short vertexIndexOffset, unsigned short cylinderFaceVertexStride)

Detailed Description

Definition at line 5 of file MeshGeometry.h.

Constructor & Destructor Documentation

MeshGeometry | ( | D3D11_PRIMITIVE_TOPOLOGY | topology,
 |  | const Microsoft::WRL::ComPtr< ID3D11Buffer > & | vertexBuffer,
 |  | const Microsoft::WRL::ComPtr< ID3D11Buffer > & | indexBuffer,
 |  | uint32 | vertexStride,
 |  | uint32 | indexCount |
 | ) |  |  | [inline]

Definition at line 17 of file MeshGeometry.h.

                               :
                Topology(topology),
                VertexBuffer(vertexBuffer),
                IndexBuffer(indexBuffer),
                VertexStride(vertexStride),
                IndexCount(indexCount)
        {
        }

Member Function Documentation

ComPtr< ID3D11Buffer > CreateIndexBuffer | ( | unsigned int | numIndices,
 |  | const unsigned short * | indexData |
 | ) |  |  | [static, private]

Definition at line 282 of file MeshGeometry.cpp.

{
    ComPtr<ID3D11Buffer> indexBufferInternal;

    D3D11_BUFFER_DESC IndexBufferDesc;
    IndexBufferDesc.ByteWidth = sizeof(unsigned short) * numIndices;
    IndexBufferDesc.Usage = D3D11_USAGE_DEFAULT;
    IndexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
    IndexBufferDesc.CPUAccessFlags = 0;
    IndexBufferDesc.MiscFlags = 0;
    IndexBufferDesc.StructureByteStride = 0;

    D3D11_SUBRESOURCE_DATA IndexBufferData;
    IndexBufferData.pSysMem = indexData;
    IndexBufferData.SysMemPitch = 0;
    IndexBufferData.SysMemSlicePitch = 0;

    DX::ThrowIfFailed(
        _360VideoPlaybackMain::GetDeviceResources()->GetD3DDevice()->CreateBuffer(
            &IndexBufferDesc,
            &IndexBufferData,
            &indexBufferInternal));

    return indexBufferInternal;
}

ComPtr< ID3D11Buffer > CreateVertexBuffer | ( | unsigned int | numVertices,
 |  | const _360VideoPlayback::VertexPositionTexture * | vertexData |
 | ) |  |  | [static, private]

Definition at line 257 of file MeshGeometry.cpp.

{
    ComPtr<ID3D11Buffer> vertexBufferInternal;
    D3D11_BUFFER_DESC VertexBufferDesc;
    VertexBufferDesc.ByteWidth = sizeof(_360VideoPlayback::VertexPositionTexture) * numVertices;
    VertexBufferDesc.Usage = D3D11_USAGE_DEFAULT;
    VertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    VertexBufferDesc.CPUAccessFlags = 0;
    VertexBufferDesc.MiscFlags = 0;
    VertexBufferDesc.StructureByteStride = 0;

    D3D11_SUBRESOURCE_DATA VertexBufferData;
    VertexBufferData.pSysMem = vertexData;
    VertexBufferData.SysMemPitch = 0;
    VertexBufferData.SysMemSlicePitch = 0;

    DX::ThrowIfFailed(
        _360VideoPlaybackMain::GetDeviceResources()->GetD3DDevice()->CreateBuffer(
            &VertexBufferDesc,
            &VertexBufferData,
            &vertexBufferInternal));

    return vertexBufferInternal;
}

vector< unsigned short > MakeCylinderFaceIndices | ( | unsigned short | tessellation,
 |  | unsigned short | vertexIndexOffset,
 |  | unsigned short | centerVertexIndex,
 |  | bool | isFrontFace |
 | ) |  |  | [static, private]

Definition at line 198 of file MeshGeometry.cpp.

{
    vector<unsigned short> indices;
    indices.resize(tessellation * 3);

    for (unsigned short i = 0; i < tessellation; i++)
    {
        // The next 3 vertices are for the i-th triangle
        const int baseTriangleIndex = (i * 3);

        unsigned short currentVertexIndex = vertexIndexOffset + i;
        unsigned short nextVertexIndex = vertexIndexOffset + ((i + 1) % tessellation);

        if (isFrontFace)
        {
            // Clockwise ordering
            indices[baseTriangleIndex] = currentVertexIndex;
            indices[baseTriangleIndex + 1] = centerVertexIndex;
            indices[baseTriangleIndex + 2] = nextVertexIndex;
        }
        else
        {
            // Counter-clockwise ordering
            indices[baseTriangleIndex] = nextVertexIndex;
            indices[baseTriangleIndex + 1] = centerVertexIndex;
            indices[baseTriangleIndex + 2] = currentVertexIndex;
        }
    }

    return indices;
}

static std::vector<_360VideoPlayback::VertexPositionTexture> MakeCylinderFaceVertices | ( | unsigned short | tessellation,
 |  | float | z,
 |  | std::function< DirectX::XMFLOAT2(float x, float y)> | uvGenerator |
 | ) |  |  | [static, private]
vector< unsigned short > MakeCylinderSideIndices | ( | unsigned short | tessellation,
 |  | unsigned short | vertexIndexOffset,
 |  | unsigned short | cylinderFaceVertexStride |
 | ) |  |  | [static, private]

Definition at line 230 of file MeshGeometry.cpp.

{
    vector<unsigned short> indices;
    indices.resize(tessellation * 6);

    for (unsigned short i = 0; i < tessellation; i++)
    {
        // The next 6 vertices are for the i-th quad making up the i-th side of the cylinder
        const int baseTriangleIndex = (i * 6);

        unsigned short currentVertexIndexFrontFace = vertexIndexOffset + i;
        unsigned short currentVertexIndexBackFace = vertexIndexOffset + i + cylinderFaceVertexStride;
        unsigned short nextVertexIndexFrontFace = vertexIndexOffset + ((i + 1) % tessellation);
        unsigned short nextVertexIndexBackFace = vertexIndexOffset + ((i + 1) % tessellation) + cylinderFaceVertexStride;

        indices[baseTriangleIndex] = currentVertexIndexFrontFace;
        indices[baseTriangleIndex + 1] = nextVertexIndexFrontFace;
        indices[baseTriangleIndex + 2] = currentVertexIndexBackFace;

        indices[baseTriangleIndex + 3] = nextVertexIndexFrontFace;
        indices[baseTriangleIndex + 4] = nextVertexIndexBackFace;
        indices[baseTriangleIndex + 5] = currentVertexIndexBackFace;
    }

    return indices;
}

shared_ptr< MeshGeometry > MakeTexturedCube ( ) [static]

Definition at line 15 of file MeshGeometry.cpp.

{
    _360VideoPlayback::VertexPositionTexture cubeVertices[] =
    {
        { XMFLOAT3(-0.5f, 0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) }, // +Y (top face)
        { XMFLOAT3(0.5f, 0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(0.5f, 0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(-0.5f, 0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },

        { XMFLOAT3(-0.5f, -0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) }, // -Y (bottom face)
        { XMFLOAT3(0.5f, -0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },

        { XMFLOAT3(0.5f,  0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) }, // +X (right face)
        { XMFLOAT3(0.5f,  0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(0.5f, -0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },

        { XMFLOAT3(-0.5f,  0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) }, // -X (left face)
        { XMFLOAT3(-0.5f,  0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(-0.5f, -0.5f,  0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },

        { XMFLOAT3(-0.5f,  0.5f, 0.5f), XMFLOAT2(0.0f, 0.0f) }, // +Z (front face)
        { XMFLOAT3(0.5f,  0.5f, 0.5f), XMFLOAT2(1.0f, 0.0f) }, // WARNING: This Front face is tied directly to the DEFAULT_CUBE_BOUNDING_PLANE. If you modify this, update both
        { XMFLOAT3(0.5f, -0.5f, 0.5f), XMFLOAT2(1.0f, 1.0f) },
        { XMFLOAT3(-0.5f, -0.5f, 0.5f), XMFLOAT2(0.0f, 1.0f) },

        { XMFLOAT3(0.5f,  0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) }, // -Z (back face)
        { XMFLOAT3(-0.5f,  0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
        { XMFLOAT3(0.5f, -0.5f, -0.5f), XMFLOAT2(-1.0f, -1.0f) },
    };

    unsigned short cubeIndices[] =
    {
        0, 1, 2,
        0, 2, 3,

        4, 5, 6,
        4, 6, 7,

        8, 9, 10,
        8, 10, 11,

        12, 13, 14,
        12, 14, 15,

        16, 17, 18,
        16, 18, 19,

        20, 21, 22,
        20, 22, 23
    };

    ComPtr<ID3D11Buffer> vertexBuffer = CreateVertexBuffer(ARRAYSIZE(cubeVertices), cubeVertices);
    ComPtr<ID3D11Buffer> indexBuffer = CreateIndexBuffer(ARRAYSIZE(cubeIndices), cubeIndices);

    return make_shared<MeshGeometry>(
        D3D11_PRIMITIVE_TOPOLOGY::D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
        vertexBuffer,
        indexBuffer,
        static_cast<uint32>(sizeof(_360VideoPlayback::VertexPositionTexture)),
        static_cast<uint32>(ARRAYSIZE(cubeIndices))
        );
}

shared_ptr< MeshGeometry > MakeTexturedCylinder ( unsigned short tessellation ) [static]

Definition at line 83 of file MeshGeometry.cpp.

{
    const float frontFaceZ = 0.5f;
    const float backFaceZ = -0.5f;
    vector<VertexPositionTexture> vertices = {
        {{ 0.0f, 0.0f, frontFaceZ }, { 0.5f, 0.5f }}, // Front face center vertex
        {{ 0.0f, 0.0f, backFaceZ },  { 0.0f, 0.0f }}  // Back face center vertex
    };

    const unsigned short frontFaceCenterVertexIndex = 0;
    const unsigned short backFaceCenterVertexIndex = 1;

    unsigned short frontFaceVerticesStartIndex = static_cast<unsigned short>(vertices.size());
    auto frontFaceVertices = MeshGeometry::MakeCylinderFaceVertices(
        tessellation,
        frontFaceZ,
        [](float x, float y) -> XMFLOAT2
    {
        const float u = x + 0.5f;
        const float v = -y + 0.5f;

        return { u, v };
    }
    );
    copy(begin(frontFaceVertices), end(frontFaceVertices), back_inserter(vertices));

    // While the vertex positions of the front face and the "front" side vertices are the same,
    // we want the UV coordinates to be different.
    // So duplicate the vertices and set the UV coordinates to [0,0]
    unsigned short frontFaceSideVerticesStartIndex = static_cast<unsigned short>(vertices.size());
    auto frontFaceSideVertices = MeshGeometry::MakeCylinderFaceVertices(
        tessellation,
        frontFaceZ,
        [](float /*x*/, float /*y*/) -> XMFLOAT2
    {
        return { 0.0f, 0.0f };
    }
    );
    copy(begin(frontFaceSideVertices), end(frontFaceSideVertices), back_inserter(vertices));

    // Shared by the back face and "back" side vertices.
    unsigned short backFaceVerticesStartIndex = static_cast<unsigned short>(vertices.size());
    auto backFaceVertices = MeshGeometry::MakeCylinderFaceVertices(
        tessellation,
        backFaceZ,
        [](float /*x*/, float /*y*/) -> XMFLOAT2
    {
        return { 0.0f, 0.0f };
    }
    );
    copy(begin(backFaceVertices), end(backFaceVertices), back_inserter(vertices));

    // Front face indices
    vector<unsigned short> indices = MeshGeometry::MakeCylinderFaceIndices(
        tessellation,
        /*vertexIndexOffset*/ frontFaceVerticesStartIndex,
        /*centerVertexIndex*/ frontFaceCenterVertexIndex,
        /*isFrontFace*/ true);

    // Back face indices.
    // This may be shown brifly during intro/outro animations so we need to show it.
    vector<unsigned short> backFaceIndices = MeshGeometry::MakeCylinderFaceIndices(
        tessellation,
        /*vertexIndexOffset*/ backFaceVerticesStartIndex,
        /*centerVertexIndex*/ backFaceCenterVertexIndex,
        /*isFrontFace*/ false);
    copy(begin(backFaceIndices), end(backFaceIndices), back_inserter(indices));

    // Side indices
    vector<unsigned short> sideIndices = MeshGeometry::MakeCylinderSideIndices(
        tessellation,
        /*vertexIndexOffset*/ frontFaceSideVerticesStartIndex,
        /*cylinderFaceVertexStride*/ static_cast<unsigned short>(frontFaceSideVertices.size()));
    copy(begin(sideIndices), end(sideIndices), back_inserter(indices));

    ComPtr<ID3D11Buffer> vertexBuffer = CreateVertexBuffer(
        static_cast<unsigned int>(vertices.size()),
        vertices.data()
    );

    ComPtr<ID3D11Buffer> indexBuffer = CreateIndexBuffer(
        static_cast<unsigned int>(indices.size()),
        indices.data());

    return make_shared<MeshGeometry>(
        D3D11_PRIMITIVE_TOPOLOGY::D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
        vertexBuffer,
        indexBuffer,
        static_cast<uint32>(sizeof(VertexPositionTexture)),
        static_cast<uint32>(indices.size())
        );
}

Member Data Documentation

const Microsoft::WRL::ComPtr<ID3D11Buffer> IndexBuffer

Definition at line 10 of file MeshGeometry.h.

const uint32 IndexCount

Definition at line 12 of file MeshGeometry.h.

const D3D11_PRIMITIVE_TOPOLOGY Topology

Definition at line 8 of file MeshGeometry.h.

const Microsoft::WRL::ComPtr<ID3D11Buffer> VertexBuffer

Definition at line 9 of file MeshGeometry.h.

const uint32 VertexStride

Definition at line 11 of file MeshGeometry.h.

The documentation for this struct was generated from the following files:
  • 360VideoPlayback/cpp/Common/MeshGeometry.h
  • 360VideoPlayback/cpp/Common/MeshGeometry.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayPauseButton Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • PlayPauseButton
Public Member Functions | Private Attributes

PlayPauseButton Class Reference

#include "Controls.h"

Inherits DX::Button.

List of all members.

Public Member Functions

PlayPauseButton (UINT buttonSize, UINT iconSize)
virtual void | Initialize () override
virtual void | PerformAction () override
virtual void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) override

Private Attributes

std::shared_ptr< Text > | m_pauseText
std::shared_ptr< Text > | m_playText

Detailed Description

Definition at line 46 of file Controls.h.

Constructor & Destructor Documentation

PlayPauseButton | ( | UINT | buttonSize,
 |  | UINT | iconSize
 | ) |  |

Definition at line 163 of file Controls.cpp.

                                                               :
    Button(iconSize, ButtonShape::Circle)
{
    this->SetElementSize({ static_cast<float>(buttonSize), static_cast<float>(buttonSize) });
    m_playText = std::make_shared<Text>(L"Play", FONT_SIZE * 4, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
    m_playText->SetElementMargin(TEXT_MARGIN);
    this->AddChildElement(m_playText);

    m_pauseText = std::make_shared<Text>(L"Pause", FONT_SIZE * 4, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
    m_pauseText->SetElementMargin(TEXT_MARGIN);
    this->AddChildElement(m_pauseText);

    this->ArrangeElements();
}

Member Function Documentation

void Initialize ( ) [override, virtual]

Reimplemented from Button.

Definition at line 178 of file Controls.cpp.

{
    __super::Initialize();
    m_playText->SetBrush(m_brush.Get());
    m_playText->Initialize();
    m_pauseText->SetBrush(m_brush.Get());
    m_pauseText->Initialize();
}

void PerformAction ( ) [override, virtual]

Reimplemented from Button.

Definition at line 208 of file Controls.cpp.

{
    __super::PerformAction();
    if (AppView::GetMediaPlayer()->PlaybackSession->PlaybackState != MediaPlaybackState::None)
    {
        if (AppView::GetMediaPlayer()->PlaybackSession->PlaybackState == MediaPlaybackState::Playing)
        {
            AppView::GetMediaPlayer()->Pause();
        }
        else
        {
            AppView::GetMediaPlayer()->Play();
        }
    }
}

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [override, virtual]

Reimplemented from Button.

Member Data Documentation

std::shared_ptr<Text> m_pauseText [private]

Definition at line 56 of file Controls.h.

std::shared_ptr<Text> m_playText [private]

Definition at line 55 of file Controls.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/Controls.h
  • 360VideoPlayback/cpp/Common/Controls.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Rectangle Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Rectangle
Public Member Functions | Protected Member Functions | Private Attributes

Rectangle Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

Rectangle (FLOAT width, FLOAT height, FLOAT strokeThickness, D2D1::ColorF brushColor)
FLOAT | GetStrokeThickness ()
virtual void | Initialize () override
void | SetRect (const D2D1_RECT_F &rect)

Protected Member Functions

virtual void | Render () override

Private Attributes

D2D1::ColorF | m_brushColor
D2D1_RECT_F | m_rect
FLOAT | m_strokeThickness

Detailed Description

Definition at line 186 of file BaseElement.h.

Constructor & Destructor Documentation

Rectangle | ( | FLOAT | width,
 |  | FLOAT | height,
 |  | FLOAT | strokeThickness,
 |  | D2D1::ColorF | brushColor
 | ) |  |

Member Function Documentation

FLOAT GetStrokeThickness ( ) [inline]

Definition at line 192 of file BaseElement.h.

{ return m_strokeThickness; };

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 433 of file BaseElement.cpp.

{
    if (m_brush == nullptr)
    {
        const auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
        DX::ThrowIfFailed(d2dcontext->CreateSolidColorBrush(
            m_brushColor,
            &m_brush));
    }

    __super::Initialize();
}

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 446 of file BaseElement.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(m_transformMatrix);
    d2dContext->DrawRectangle(m_rect, m_brush.Get(), m_strokeThickness);
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetRect ( const D2D1_RECT_F & rect ) [inline]

Definition at line 191 of file BaseElement.h.

{ m_rect = rect; }

Member Data Documentation

D2D1::ColorF m_brushColor [private]

Definition at line 200 of file BaseElement.h.

D2D1_RECT_F m_rect [private]

Definition at line 198 of file BaseElement.h.

FLOAT m_strokeThickness [private]

Definition at line 199 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Resource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Resource
Public Member Functions | Protected Attributes

Resource Class Reference

#include "DeviceResources.h"

Inherited by NV12VideoTexture, QuadRenderer, SpinningCubeRenderer, and TextRenderer.

List of all members.

Public Member Functions

Resource (std::shared_ptr< DeviceResources > deviceResources)
virtual | ~Resource ()
virtual concurrency::task< void > | CreateDeviceDependentResourcesAsync ()=0
virtual void | ReleaseDeviceDependentResources ()=0

Protected Attributes

std::shared_ptr< DeviceResources > | m_deviceResources

Detailed Description

Definition at line 105 of file DeviceResources.h.

Constructor & Destructor Documentation

Resource ( std::shared_ptr< DeviceResources > deviceResources ) [inline]

Definition at line 108 of file DeviceResources.h.

            : m_deviceResources(std::move(deviceResources))
        {}

virtual ~Resource ( ) [virtual]

Member Function Documentation

virtual concurrency::task<void> CreateDeviceDependentResourcesAsync ( ) [pure virtual]

Implemented in NV12VideoTexture, QuadRenderer, SpinningCubeRenderer, and TextRenderer.

virtual void ReleaseDeviceDependentResources ( ) [pure virtual]

Implemented in NV12VideoTexture, QuadRenderer, SpinningCubeRenderer, and TextRenderer.

Member Data Documentation

std::shared_ptr<DeviceResources> m_deviceResources [protected]

Definition at line 118 of file DeviceResources.h.

The documentation for this class was generated from the following file:
  • HolographicFaceTracking/cpp/Common/DeviceResources.h
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SeekBarElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • SeekBarElement
Public Member Functions | Private Member Functions | Private Attributes

SeekBarElement Class Reference

#include "SeekBarElement.h"

Inherits DX::FocusableElement.

List of all members.

Public Member Functions

SeekBarElement (float elementWidth, float elementHeight=FONT_SIZE *5.0f, float leftRightPadding=FONT_SIZE *2.0f, float topBottomPadding=FONT_SIZE *2.0f)
virtual void | Initialize () override
virtual void | PerformAction () override
virtual void | Update (const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) override

Private Member Functions

Platform::String | FormatTimeString (int64 intervalValue)
void | UpdateLayoutFromCurrentTime ()
void | UpdateSliderPosition (float position)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_brush
int64 | m_currentPlayPosition
int64 | m_currentVideoDuration
std::wstring | m_elapsedTimeString
std::shared_ptr< Text > | m_elapsedTimeText
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_endSegmentBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_frontSegmentBrush
float | m_leftRightPadding
std::wstring | m_remainingTimeString
std::shared_ptr< Text > | m_remainingTimeText
double | m_secondsElapsedSinceTimeUpdate
std::shared_ptr< Line > | m_sliderFrontSegment
D2D1_POINT_2F | m_sliderFrontSegmentEnd
D2D1_POINT_2F | m_sliderFrontSegmentStart
float | m_sliderHeight
float | m_sliderPosition
std::shared_ptr< Line > | m_sliderRemainingSegment
D2D1_POINT_2F | m_sliderRemainingSegmentEnd
D2D1_POINT_2F | m_sliderRemainingSegmentStart
float | m_sliderWidth
float | m_textSize
float | m_topBottomPadding

Detailed Description

Definition at line 6 of file SeekBarElement.h.

Constructor & Destructor Documentation

SeekBarElement | ( | float | elementWidth,
 |  | float | elementHeight = FONT_SIZE * 5.0f,
 |  | float | leftRightPadding = FONT_SIZE * 2.0f,
 |  | float | topBottomPadding = FONT_SIZE * 2.0f
 | ) |  |

Definition at line 25 of file SeekBarElement.cpp.

                                                                                :
    m_leftRightPadding(leftRightPadding),
    m_topBottomPadding(topBottomPadding),
    m_currentPlayPosition(0),
    m_currentVideoDuration(0),
    m_secondsElapsedSinceTimeUpdate(0.0)
{
    m_isFocusIntersectionCalculated = true;
    m_elementSize = float2(elementWidth, elementHeight);
    m_sliderPosition = 0.0f;
    m_sliderWidth = max((m_elementSize.x - (m_leftRightPadding * 2.0f)), 0.0f);
    m_sliderHeight = max((m_elementSize.y - (m_topBottomPadding * 2.0f)), 0.0f);

    m_sliderFrontSegment = std::make_shared<Line>(m_sliderHeight);
    AddChildElement(m_sliderFrontSegment);

    m_sliderRemainingSegment = std::make_shared<Line>(m_sliderHeight);
    AddChildElement(m_sliderRemainingSegment);

    float seekBarYCoordinate = m_topBottomPadding + (m_sliderHeight * 0.5f);
    m_sliderFrontSegmentStart = D2D1::Point2F(m_leftRightPadding, 0.0f);
    m_sliderFrontSegment->SetStartPoint(m_sliderFrontSegmentStart);
    m_sliderFrontSegment->SetTranslation({ 0.0f, seekBarYCoordinate });

    m_sliderRemainingSegmentEnd = D2D1::Point2F(m_elementSize.x - m_leftRightPadding, 0.0f);
    m_sliderRemainingSegment->SetEndPoint(m_sliderRemainingSegmentEnd);
    m_sliderRemainingSegment->SetTranslation({ 0.0f, seekBarYCoordinate });
    m_textSize = FONT_SIZE * 1.25f;
    m_elapsedTimeText = std::make_shared<Text>(L"", m_textSize, DWRITE_FONT_WEIGHT_NORMAL);
    AddChildElement(m_elapsedTimeText);

    m_remainingTimeText = std::make_shared<Text>(L"", m_textSize, DWRITE_FONT_WEIGHT_NORMAL);
    AddChildElement(m_remainingTimeText);
}

Member Function Documentation

String FormatTimeString ( int64 intervalValue ) [private]

Definition at line 183 of file SeekBarElement.cpp.

{
    String^ formattedTimeSpan;
    std::chrono::milliseconds duration{ intervalValue };
    auto seconds = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::seconds>(duration).count());
    auto minutes = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::minutes>(duration).count());
    seconds -= minutes * 60;
    auto hours = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::hours>(duration).count());
    minutes -= hours * 60;

    DecimalFormatter^ twoDigitNumberFormatter = ref new DecimalFormatter(
        Windows::System::UserProfile::GlobalizationPreferences::Languages,
        Windows::System::UserProfile::GlobalizationPreferences::HomeGeographicRegion);
    twoDigitNumberFormatter->FractionDigits = 0;
    twoDigitNumberFormatter->IsGrouped = false;
    twoDigitNumberFormatter->IntegerDigits = 2;

    if (hours > 0)
    {
        // Display Hours naturally, but display minutes and seconds using 2 digits
        formattedTimeSpan = ref new String(
            (twoDigitNumberFormatter->FormatUInt(hours) + L":" +
                twoDigitNumberFormatter->FormatUInt(minutes) + L":" +
                twoDigitNumberFormatter->FormatUInt(seconds))->Data());
    }
    else
    {
        // If the hour count is 0, then only display minutes and seconds
        formattedTimeSpan = ref new String(
            (twoDigitNumberFormatter->FormatUInt(minutes) + L":" +
                twoDigitNumberFormatter->FormatUInt(seconds))->Data());
    }
    return formattedTimeSpan;
}

void Initialize ( ) [override, virtual]

Reimplemented from BaseElement.

Definition at line 60 of file SeekBarElement.cpp.

{
    auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
    __super::Initialize();

    DX::ThrowIfFailed(
        d2dcontext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White),
            &m_frontSegmentBrush));

    DX::ThrowIfFailed(
        d2dcontext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Gray),
            &m_endSegmentBrush));

    DX::ThrowIfFailed(
        d2dcontext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White),
            &m_brush));

    m_sliderFrontSegment->SetBrush(m_frontSegmentBrush.Get());
    m_sliderFrontSegment->Initialize();

    m_sliderRemainingSegment->SetBrush(m_endSegmentBrush.Get());
    m_sliderRemainingSegment->Initialize();

    m_elapsedTimeText->SetBrush(m_brush.Get());
    m_elapsedTimeText->Initialize();
    m_remainingTimeText->SetBrush(m_brush.Get());
    m_remainingTimeText->Initialize();
    // Text goes below the seekbar
    float startYCoordinateOfText = m_elementSize.y - m_topBottomPadding + 4.0f;
    m_elapsedTimeText->SetTranslation({ m_leftRightPadding, startYCoordinateOfText });
    m_remainingTimeText->SetTranslation({ (m_elementSize.x - m_leftRightPadding - (FONT_SIZE * 3.0f)), startYCoordinateOfText });

    UpdateLayoutFromCurrentTime();
}

void PerformAction ( ) [override, virtual]

Reimplemented from FocusableElement.

Definition at line 153 of file SeekBarElement.cpp.

{
    // Update the Slider's position
    float xIntersectionPoint = m_elementCoordIntersectionPoint.x;
    // Clamp before and after the slider
    // Otherwise compute slider based on relative position
    if (xIntersectionPoint < m_leftRightPadding)
    {
        UpdateSliderPosition(0.0f);
    }
    else if (xIntersectionPoint > (m_leftRightPadding + m_sliderWidth))
    {
        UpdateSliderPosition(1.0f);
    }
    else
    {
        UpdateSliderPosition((xIntersectionPoint - m_leftRightPadding) / m_sliderWidth);
    }

    unsigned int seekTime = static_cast<unsigned int>(m_currentVideoDuration * m_sliderPosition);

    if (seekTime >= (static_cast<unsigned int>(AppView::GetMediaPlayer()->PlaybackSession->NaturalDuration.Duration / s_hnsPerMillisecond)) - END_OF_PLAYBACK_BUFFER_MS)
    {
        seekTime = (static_cast<unsigned int>(AppView::GetMediaPlayer()->PlaybackSession->NaturalDuration.Duration / s_hnsPerMillisecond)) - END_OF_PLAYBACK_BUFFER_MS;
    }
    auto seekTimeSpan = TimeSpan();
    seekTimeSpan.Duration = static_cast<int64>(seekTime) * s_hnsPerMillisecond;
    AppView::GetMediaPlayer()->PlaybackSession->Position = seekTimeSpan;
}

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | cameraPose |
 | ) |  |  | [override, virtual]

Reimplemented from FocusableElement.

void UpdateLayoutFromCurrentTime ( ) [private]

Definition at line 132 of file SeekBarElement.cpp.

{
    m_currentVideoDuration = AppView::GetMediaPlayer()->PlaybackSession->NaturalDuration.Duration / s_hnsPerMillisecond;
    if (m_currentVideoDuration != 0)
    {
        m_currentPlayPosition = AppView::GetMediaPlayer()->PlaybackSession->Position.Duration / s_hnsPerMillisecond;
        if (m_currentPlayPosition > m_currentVideoDuration)
        {
            m_currentVideoDuration = m_currentPlayPosition;
        }
    }
    // Update current and remaining time indicators
    m_elapsedTimeString = FormatTimeString(m_currentPlayPosition)->Data();
    m_remainingTimeString = FormatTimeString(m_currentVideoDuration - m_currentPlayPosition)->Data();
    m_elapsedTimeText->SetText(m_elapsedTimeString);
    m_remainingTimeText->SetText(m_remainingTimeString);

    float currentTimeSliderPosition = static_cast<float>(m_currentVideoDuration) > 0.0f ? static_cast<float>(m_currentPlayPosition) / static_cast<float>(m_currentVideoDuration) : 0.0f;
    UpdateSliderPosition(currentTimeSliderPosition);
}

void UpdateSliderPosition ( float position ) [private]

Definition at line 99 of file SeekBarElement.cpp.

{
    m_sliderPosition = value;
    // Clamp [0,1]
    if (m_sliderPosition < 0.0f)
    {
        m_sliderPosition = 0.0f;
    }
    else if (m_sliderPosition > 1.0f)
    {
        m_sliderPosition = 1.0f;
    }

    float sliderUIPosition = m_sliderPosition > 0.0f ? (m_sliderWidth * m_sliderPosition) + m_leftRightPadding : m_leftRightPadding;
    m_sliderFrontSegmentEnd = D2D1::Point2F(sliderUIPosition, 0.0f);
    m_sliderFrontSegment->SetEndPoint(m_sliderFrontSegmentEnd);
    m_sliderRemainingSegmentStart = D2D1::Point2F(sliderUIPosition, 0.0f);
    m_sliderRemainingSegment->SetStartPoint(m_sliderRemainingSegmentStart);
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_brush [private]

Definition at line 39 of file SeekBarElement.h.

int64 m_currentPlayPosition [private]

Definition at line 41 of file SeekBarElement.h.

int64 m_currentVideoDuration [private]

Definition at line 40 of file SeekBarElement.h.

std::wstring m_elapsedTimeString [private]

Definition at line 42 of file SeekBarElement.h.

std::shared_ptr<Text> m_elapsedTimeText [private]

Definition at line 44 of file SeekBarElement.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_endSegmentBrush [private]

Definition at line 32 of file SeekBarElement.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_frontSegmentBrush [private]

Definition at line 31 of file SeekBarElement.h.

float m_leftRightPadding [private]

Definition at line 29 of file SeekBarElement.h.

std::wstring m_remainingTimeString [private]

Definition at line 43 of file SeekBarElement.h.

std::shared_ptr<Text> m_remainingTimeText [private]

Definition at line 45 of file SeekBarElement.h.

double m_secondsElapsedSinceTimeUpdate [private]

Definition at line 47 of file SeekBarElement.h.

std::shared_ptr<Line> m_sliderFrontSegment [private]

Definition at line 37 of file SeekBarElement.h.

D2D1_POINT_2F m_sliderFrontSegmentEnd [private]

Definition at line 34 of file SeekBarElement.h.

D2D1_POINT_2F m_sliderFrontSegmentStart [private]

Definition at line 33 of file SeekBarElement.h.

float m_sliderHeight [private]

Definition at line 28 of file SeekBarElement.h.

float m_sliderPosition [private]

Definition at line 26 of file SeekBarElement.h.

std::shared_ptr<Line> m_sliderRemainingSegment [private]

Definition at line 38 of file SeekBarElement.h.

D2D1_POINT_2F m_sliderRemainingSegmentEnd [private]

Definition at line 36 of file SeekBarElement.h.

D2D1_POINT_2F m_sliderRemainingSegmentStart [private]

Definition at line 35 of file SeekBarElement.h.

float m_sliderWidth [private]

Definition at line 27 of file SeekBarElement.h.

float m_textSize [private]

Definition at line 46 of file SeekBarElement.h.

float m_topBottomPadding [private]

Definition at line 30 of file SeekBarElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/SeekBarElement.h
  • 360VideoPlayback/cpp/Common/SeekBarElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StepTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • StepTimer
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes

StepTimer Class Reference

#include "StepTimer.h"

List of all members.

Public Member Functions

StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
StepTimer ()
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
double | GetElapsedSeconds () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64_t | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint64 | GetElapsedTicks () const
uint32 | GetFrameCount () const
uint32_t | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFrameCount () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32 | GetFramesPerSecond () const
uint32_t | GetFramesPerSecond () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
double | GetTotalSeconds () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64_t | GetTotalTicks () const
uint64 | GetTotalTicks () const
uint64 | GetTotalTicks () const
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | ResetElapsedTime ()
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetFixedTimeStep (bool isFixedTimestep)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedSeconds (double targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64_t targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
void | SetTargetElapsedTicks (uint64 targetElapsed)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)
template<typename TUpdate >
void | Tick (const TUpdate &update)

Static Public Member Functions

static uint64 | GetPerformanceFrequency ()
static uint64_t | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static uint64 | GetPerformanceFrequency ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static int64_t | GetTicks ()
static int64 | GetTicks ()
static int64 | GetTicks ()
static uint64 | SecondsToTicks (double seconds)
static uint64_t | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static uint64 | SecondsToTicks (double seconds)
static double | TicksToSeconds (uint64_t ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)
static double | TicksToSeconds (uint64 ticks)

Static Public Attributes

static const uint64 | TicksPerSecond = 10'000'000
static const uint64_t | TicksPerSecond = 10'000'000

Private Attributes

uint64 | m_elapsedTicks
uint64_t | m_elapsedTicks
uint32_t | m_frameCount
uint32 | m_frameCount
uint32 | m_framesPerSecond
uint32_t | m_framesPerSecond
uint32 | m_framesThisSecond
uint32_t | m_framesThisSecond
bool | m_isFixedTimeStep
uint64_t | m_leftOverTicks
uint64 | m_leftOverTicks
uint64 | m_qpcFrequency
uint64_t | m_qpcFrequency
LARGE_INTEGER m_qpcFrequency
uint64 | m_qpcLastTime
LARGE_INTEGER m_qpcLastTime
uint64_t | m_qpcLastTime
uint64_t | m_qpcMaxDelta
uint64 | m_qpcMaxDelta
uint64_t | m_qpcSecondCounter
uint64 | m_qpcSecondCounter
uint64 | m_targetElapsedTicks
uint64_t | m_targetElapsedTicks
uint64 | m_totalTicks
uint64_t | m_totalTicks

Detailed Description

Definition at line 6 of file StepTimer.h.

Constructor & Destructor Documentation

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 20 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            if (!QueryPerformanceFrequency(&m_qpcFrequency))
            {
                throw ref new Platform::FailureException();
            }

            if (!QueryPerformanceCounter(&m_qpcLastTime))
            {
                throw ref new Platform::FailureException();
            }

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency.QuadPart / 10;
        }

StepTimer ( ) [inline]

Definition at line 20 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 20 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 20 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 19 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

StepTimer ( ) [inline]

Definition at line 9 of file StepTimer.h.

                    :
            m_elapsedTicks(0),
            m_totalTicks(0),
            m_leftOverTicks(0),
            m_frameCount(0),
            m_framesPerSecond(0),
            m_framesThisSecond(0),
            m_qpcSecondCounter(0),
            m_isFixedTimeStep(false),
            m_targetElapsedTicks(TicksPerSecond / 60)
        {
            m_qpcFrequency = GetPerformanceFrequency();

            // Initialize max delta to 1/10 of a second.
            m_qpcMaxDelta = m_qpcFrequency / 10;
        }

Member Function Documentation

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);                  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 47 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks); }

double GetElapsedSeconds ( ) const [inline]

Definition at line 39 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 39 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 28 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

double GetElapsedSeconds ( ) const [inline]

Definition at line 39 of file StepTimer.h.

{ return TicksToSeconds(m_elapsedTicks);  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 37 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 46 of file StepTimer.h.

{ return m_elapsedTicks; }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint64_t GetElapsedTicks ( ) const [inline]

Definition at line 27 of file StepTimer.h.

{ return m_elapsedTicks;                                  }

uint64 GetElapsedTicks ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_elapsedTicks;                  }

uint32_t GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 45 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 46 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 54 of file StepTimer.h.

{ return m_frameCount; }

uint32 GetFrameCount ( ) const [inline]

Definition at line 35 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 46 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFrameCount ( ) const [inline]

Definition at line 46 of file StepTimer.h.

{ return m_frameCount;                    }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 49 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 48 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32_t GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;                               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 49 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 57 of file StepTimer.h.

{ return m_framesPerSecond; }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 38 of file StepTimer.h.

{ return m_framesPerSecond;               }

uint32 GetFramesPerSecond ( ) const [inline]

Definition at line 49 of file StepTimer.h.

{ return m_framesPerSecond;               }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 66 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 66 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 65 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64_t GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                winrt::throw_last_error();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 66 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static uint64 GetPerformanceFrequency ( ) [inline, static]

Definition at line 55 of file StepTimer.h.

        {
            LARGE_INTEGER freq;
            if (!QueryPerformanceFrequency(&freq))
            {
                throw ref new Platform::FailureException();
            }
            return freq.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 78 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 78 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 77 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64_t GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                winrt::throw_last_error();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 78 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

static int64 GetTicks ( ) [inline, static]

Definition at line 67 of file StepTimer.h.

        {
            LARGE_INTEGER ticks;
            if (!QueryPerformanceCounter(&ticks))
            {
                throw ref new Platform::FailureException();
            }
            return ticks.QuadPart;
        }

double GetTotalSeconds ( ) const [inline]

Definition at line 42 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);                    }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 43 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 51 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks); }

double GetTotalSeconds ( ) const [inline]

Definition at line 32 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 43 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

double GetTotalSeconds ( ) const [inline]

Definition at line 43 of file StepTimer.h.

{ return TicksToSeconds(m_totalTicks);    }

uint64_t GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 41 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 42 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 50 of file StepTimer.h.

{ return m_totalTicks; }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 31 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 42 of file StepTimer.h.

{ return m_totalTicks;                    }

uint64 GetTotalTicks ( ) const [inline]

Definition at line 42 of file StepTimer.h.

{ return m_totalTicks;                    }

void ResetElapsedTime ( ) [inline]

Definition at line 91 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 92 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 92 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 92 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 76 of file StepTimer.h.

        {
            if (!QueryPerformanceCounter(&m_qpcLastTime))
            {
                throw ref new Platform::FailureException();
            }

            m_leftOverTicks = 0;
            m_framesPerSecond = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

void ResetElapsedTime ( ) [inline]

Definition at line 81 of file StepTimer.h.

        {
            m_qpcLastTime = GetTicks();

            m_leftOverTicks    = 0;
            m_framesPerSecond  = 0;
            m_framesThisSecond = 0;
            m_qpcSecondCounter = 0;
        }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 62 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 70 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond); }

static uint64_t SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64_t>(seconds * TicksPerSecond); }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 62 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 62 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 61 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

static uint64 SecondsToTicks ( double seconds ) [inline, static]

Definition at line 51 of file StepTimer.h.

{ return static_cast<uint64>(seconds * TicksPerSecond);   }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 52 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 51 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 60 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep; }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 52 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;                    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 41 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetFixedTimeStep ( bool isFixedTimestep ) [inline]

Definition at line 52 of file StepTimer.h.

{ m_isFixedTimeStep = isFixedTimestep;    }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 56 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 56 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 55 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 64 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed); }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 45 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedSeconds ( double targetElapsed ) [inline]

Definition at line 56 of file StepTimer.h.

{ m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }

void SetTargetElapsedTicks ( uint64_t targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;                   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 54 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 63 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed; }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 55 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 55 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 55 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void SetTargetElapsedTicks ( uint64 targetElapsed ) [inline]

Definition at line 44 of file StepTimer.h.

{ m_targetElapsedTicks = targetElapsed;   }

void Tick ( const TUpdate & update ) [inline]

Definition at line 91 of file StepTimer.h.

        {
            // Query the current time.
            LARGE_INTEGER currentTime;

            if (!QueryPerformanceCounter(&currentTime))
            {
                throw ref new Platform::FailureException();
            }

            uint64 timeDelta = currentTime.QuadPart - m_qpcLastTime.QuadPart;

            m_qpcLastTime = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency.QuadPart;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks = m_targetElapsedTicks;
                    m_totalTicks += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks = timeDelta;
                m_totalTicks += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency.QuadPart))
            {
                m_framesPerSecond = m_framesThisSecond;
                m_framesThisSecond = 0;
                m_qpcSecondCounter %= m_qpcFrequency.QuadPart;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 103 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64_t currentTime = GetTicks();
            uint64_t timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32_t lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64_t>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64_t>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 104 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 104 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 93 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

void Tick ( const TUpdate & update ) [inline]

Definition at line 104 of file StepTimer.h.

        {
            // Query the current time.
            uint64 currentTime = GetTicks();
            uint64 timeDelta   = currentTime - m_qpcLastTime;

            m_qpcLastTime      = currentTime;
            m_qpcSecondCounter += timeDelta;

            // Clamp excessively large time deltas (e.g. after paused in the debugger).
            if (timeDelta > m_qpcMaxDelta)
            {
                timeDelta = m_qpcMaxDelta;
            }

            // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
            timeDelta *= TicksPerSecond;
            timeDelta /= m_qpcFrequency;

            uint32 lastFrameCount = m_frameCount;

            if (m_isFixedTimeStep)
            {
                // Fixed timestep update logic

                // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
                // the clock to exactly match the target value. This prevents tiny and irrelevant errors
                // from accumulating over time. Without this clamping, a game that requested a 60 fps
                // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
                // accumulate enough tiny errors that it would drop a frame. It is better to just round
                // small deviations down to zero to leave things running smoothly.

                if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
                {
                    timeDelta = m_targetElapsedTicks;
                }

                m_leftOverTicks += timeDelta;

                while (m_leftOverTicks >= m_targetElapsedTicks)
                {
                    m_elapsedTicks   = m_targetElapsedTicks;
                    m_totalTicks    += m_targetElapsedTicks;
                    m_leftOverTicks -= m_targetElapsedTicks;
                    m_frameCount++;

                    update();
                }
            }
            else
            {
                // Variable timestep update logic.
                m_elapsedTicks  = timeDelta;
                m_totalTicks   += timeDelta;
                m_leftOverTicks = 0;
                m_frameCount++;

                update();
            }

            // Track the current framerate.
            if (m_frameCount != lastFrameCount)
            {
                m_framesThisSecond++;
            }

            if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
            {
                m_framesPerSecond   = m_framesThisSecond;
                m_framesThisSecond  = 0;
                m_qpcSecondCounter %= m_qpcFrequency;
            }
        }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 61 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 60 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 61 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 69 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond; }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 61 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64_t ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

static double TicksToSeconds ( uint64 ticks ) [inline, static]

Definition at line 50 of file StepTimer.h.

{ return static_cast<double>(ticks) / TicksPerSecond;     }

Member Data Documentation

uint64 m_elapsedTicks [private]

Definition at line 175 of file StepTimer.h.

uint64_t m_elapsedTicks [private]

Definition at line 175 of file StepTimer.h.

uint32 m_frameCount [private]

Definition at line 180 of file StepTimer.h.

uint32_t m_frameCount [private]

Definition at line 180 of file StepTimer.h.

uint32 m_framesPerSecond [private]

Definition at line 181 of file StepTimer.h.

uint32_t m_framesPerSecond [private]

Definition at line 181 of file StepTimer.h.

uint32 m_framesThisSecond [private]

Definition at line 182 of file StepTimer.h.

uint32_t m_framesThisSecond [private]

Definition at line 182 of file StepTimer.h.

bool m_isFixedTimeStep [private]

Definition at line 186 of file StepTimer.h.

uint64_t m_leftOverTicks [private]

Definition at line 177 of file StepTimer.h.

uint64 m_leftOverTicks [private]

Definition at line 177 of file StepTimer.h.

uint64 m_qpcFrequency [private]

Definition at line 170 of file StepTimer.h.

LARGE_INTEGER m_qpcFrequency [private]

Definition at line 173 of file StepTimer.h.

uint64_t m_qpcFrequency [private]

Definition at line 170 of file StepTimer.h.

uint64_t m_qpcLastTime [private]

Definition at line 171 of file StepTimer.h.

LARGE_INTEGER m_qpcLastTime [private]

Definition at line 174 of file StepTimer.h.

uint64 m_qpcLastTime [private]

Definition at line 171 of file StepTimer.h.

uint64_t m_qpcMaxDelta [private]

Definition at line 172 of file StepTimer.h.

uint64 m_qpcMaxDelta [private]

Definition at line 172 of file StepTimer.h.

uint64 m_qpcSecondCounter [private]

Definition at line 183 of file StepTimer.h.

uint64_t m_qpcSecondCounter [private]

Definition at line 183 of file StepTimer.h.

uint64 m_targetElapsedTicks [private]

Definition at line 187 of file StepTimer.h.

uint64_t m_targetElapsedTicks [private]

Definition at line 187 of file StepTimer.h.

uint64_t m_totalTicks [private]

Definition at line 176 of file StepTimer.h.

uint64 m_totalTicks [private]

Definition at line 176 of file StepTimer.h.

const uint64_t TicksPerSecond = 10'000'000 [static]

Definition at line 48 of file StepTimer.h.

static const uint64 TicksPerSecond = 10'000'000 [static]

Definition at line 48 of file StepTimer.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/StepTimer.h
  • BasicHologram/cpp/Common/StepTimer.h
  • BasicHologram/cppwinrt/Common/StepTimer.h
  • CameraStreamCoordinateMapper/cpp/Common/StepTimer.h
  • HolographicFaceTracking/cpp/Common/StepTimer.h
  • HolographicMixedRealityCapture/cpp/Common/StepTimer.h
  • HolographicSpatialMapping/cpp/Common/StepTimer.h
  • HolographicSpatialStage/cpp/Common/StepTimer.h
  • HolographicTagAlong/cpp/Common/StepTimer.h
  • HolographicVoiceInput/cpp/Common/StepTimer.h
  • SpatialInteractionSource/cpp/Common/StepTimer.h
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Text Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • Text
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Text Class Reference

#include "BaseElement.h"

Inherits DX::BaseElement.

List of all members.

Public Member Functions

Text (std::wstring text, FLOAT fontSize, DWRITE_FONT_WEIGHT fontWeight=DWRITE_FONT_WEIGHT_ULTRA_BOLD)
void | SetText (std::wstring text)

Protected Member Functions

virtual void | Render () override

Private Member Functions

void | CreateTextContext ()

Private Attributes

DWRITE_FONT_WEIGHT | m_fontWeight
std::wstring | m_text
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormat
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_textLayout
float | m_transformedFontSize

Detailed Description

Definition at line 115 of file BaseElement.h.

Constructor & Destructor Documentation

Text | ( | std::wstring | text,
 |  | FLOAT | fontSize,
 |  | DWRITE_FONT_WEIGHT | fontWeight = DWRITE_FONT_WEIGHT_ULTRA_BOLD
 | ) |  |

Definition at line 270 of file BaseElement.cpp.

                                                                         :
    m_transformedFontSize(fontSize),
    m_fontWeight(fontWeight)
{
    this->SetText(text);
}

Member Function Documentation

void CreateTextContext ( ) [private]

Definition at line 287 of file BaseElement.cpp.

{
    DX::ThrowIfFailed(m_deviceResources->GetDWriteFactory()->CreateTextFormat(
        L"Segoe UI",
        nullptr,
        m_fontWeight,
        DWRITE_FONT_STYLE_NORMAL,
        DWRITE_FONT_STRETCH_NORMAL,
        m_transformedFontSize,
        Windows::Globalization::ApplicationLanguages::Languages->GetAt(0)->Data(),
        &m_textFormat));

    m_textFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);

    DX::ThrowIfFailed(m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
    DX::ThrowIfFailed(m_deviceResources->GetDWriteFactory()->CreateTextLayout(
        m_text.data(),
        static_cast<UINT32>(m_text.size()),
        m_textFormat.Get(),
        MAX_TEXT_LAYOUT_SIZE,
        MAX_TEXT_LAYOUT_SIZE,
        &m_textLayout));

    DWRITE_TEXT_METRICS textMetrics;
    m_textLayout->GetMetrics(&textMetrics);
    m_elementSize = { textMetrics.width, textMetrics.height };
    m_isRenderPassNeeded = true;
}

void Render ( ) [override, protected, virtual]

Reimplemented from BaseElement.

Definition at line 277 of file BaseElement.cpp.

{
    D2D1_SIZE_F renderTargetSize = m_deviceResources->GetD2DDeviceContext()->GetSize();
    D2D1_POINT_2F textOrigin{ 0.0, 0.0 };
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Translation(m_transformedTranslation.x, m_transformedTranslation.y));
    d2dContext->DrawTextLayout(textOrigin, m_textLayout.Get(), m_brush.Get());
    d2dContext->SetTransform(D2D1::IdentityMatrix());
}

void SetText ( std::wstring text )

Definition at line 316 of file BaseElement.cpp.

{
    if (text != m_text)
    {
        m_text = text;
        this->CreateTextContext();
    }
}

Member Data Documentation

DWRITE_FONT_WEIGHT m_fontWeight [private]

Definition at line 131 of file BaseElement.h.

std::wstring m_text [private]

Definition at line 128 of file BaseElement.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormat [private]

Definition at line 129 of file BaseElement.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_textLayout [private]

Definition at line 130 of file BaseElement.h.

float m_transformedFontSize [private]

Definition at line 132 of file BaseElement.h.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cpp/Common/BaseElement.h
  • 360VideoPlayback/cpp/Common/BaseElement.cpp
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextureData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • TextureData
Public Attributes

TextureData Struct Reference

#include "DirectXHelper.h"

List of all members.

Public Attributes

const void * | buffer
const UINT | bytesPerPixel

Detailed Description

Definition at line 73 of file DirectXHelper.h.

Member Data Documentation

const void* buffer

Definition at line 75 of file DirectXHelper.h.

const UINT bytesPerPixel

Definition at line 76 of file DirectXHelper.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.h
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewProjectionConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • DX
  • ViewProjectionConstantBuffer
Public Attributes

ViewProjectionConstantBuffer Struct Reference

#include "CameraResources.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 | viewProjection [2]
Windows::Foundation::Numerics::float4x4 | viewProjection [2]

Detailed Description

Definition at line 8 of file CameraResources.h.

Member Data Documentation

DirectX::XMFLOAT4X4 viewProjection

Definition at line 10 of file CameraResources.h.

Windows::Foundation::Numerics::float4x4 viewProjection[2]

Definition at line 21 of file CameraResources.h.

The documentation for this struct was generated from the following files:
  • 360VideoPlayback/cpp/Common/CameraResources.h
  • BasicHologram/cpp/Common/CameraResources.h
  • BasicHologram/cppwinrt/Common/CameraResources.h
  • HolographicFaceTracking/cpp/Common/CameraResources.h
  • HolographicMixedRealityCapture/cpp/Common/CameraResources.h
  • HolographicSpatialStage/cpp/Common/CameraResources.h
  • HolographicTagAlong/cpp/Common/CameraResources.h
  • HolographicVoiceInput/cpp/Common/CameraResources.h
  • SpatialInteractionSource/cpp/Common/CameraResources.h
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario1
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Properties

static string | m_enterpriseId [get]

Private Member Functions

void | Setup_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Static Private Attributes

static string | m_EnterpriseId = "microsoft.com"

Detailed Description

Definition at line 25 of file Scenario1_Setup.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 37 of file Scenario1_Setup.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario1_Setup.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Setup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario1_Setup.xaml.cs.

        {
            m_EnterpriseId = EnterpriseIdentity.Text;
            rootPage.NotifyUser("Enterprise Identity is set to: " + m_enterpriseId, NotifyType.StatusMessage);
        }

Member Data Documentation

string m_EnterpriseId = "microsoft.com" [static, private]

Definition at line 28 of file Scenario1_Setup.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario1_Setup.xaml.cs.

Property Documentation

string m_enterpriseId [static, get]

Definition at line 30 of file Scenario1_Setup.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario1_Setup.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10_CpToClipboard Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario10_CpToClipboard
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario10_CpToClipboard Class Reference

List of all members.

Public Member Functions

Scenario10_CpToClipboard ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CopyToClipboard_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 22 of file Scenario10_CpToClipboard.xaml.cs.

Constructor & Destructor Documentation

Scenario10_CpToClipboard ( ) [inline]

Definition at line 26 of file Scenario10_CpToClipboard.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CopyToClipboard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario10_CpToClipboard.xaml.cs.

        {
            var dataPackage = new Windows.ApplicationModel.DataTransfer.DataPackage();
            dataPackage.SetText(InputTxtBox.Text);
            dataPackage.Properties.EnterpriseId = Scenario1.m_enterpriseId;
            Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dataPackage);
            if (dataPackage.Properties.EnterpriseId != Scenario1.m_enterpriseId)
            {
                rootPage.NotifyUser("Failed to mark data package to EnterpiseId=" + Scenario1.m_enterpriseId, NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser("Successfully SetContent to clipboard using EnterpriseId=" + Scenario1.m_enterpriseId, NotifyType.StatusMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario10_CpToClipboard.xaml.cs.

        {
            rootPage = MainPage.Current;
            InputTxtBox.Text = "Text here will be copied to clipboard";
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 24 of file Scenario10_CpToClipboard.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario10_CpToClipboard.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11_CPDNoUI Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario11_CPDNoUI
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario11_CPDNoUI Class Reference

List of all members.

Public Member Functions

Scenario11_CPDNoUI ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Set_ClipboardNoUI (object sender, TextControlPasteEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 23 of file Scenario11_CPDNoUI.xaml.cs.

Constructor & Destructor Documentation

Scenario11_CPDNoUI ( ) [inline]

Definition at line 27 of file Scenario11_CPDNoUI.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario11_CPDNoUI.xaml.cs.

        {
            rootPage = MainPage.Current;

            var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
            protectionPolicyManager.Identity = ""; // personal
            InputTxtBox.PlaceholderText = "Paste any text here";
        }

async void Set_ClipboardNoUI | ( | object | sender,
 |  | TextControlPasteEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario11_CPDNoUI.xaml.cs.

        {
            // Mark the event as handled first. Otherwise, the
            // default paste action will happen, then the custom paste
            // action, and the user will see the text box content change.
            e.Handled = true;

            // Get content from the clipboard.
            var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
            if (dataPackageView.Contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.Text))
            {
                string outputStr = "";

                var policyResult = dataPackageView.UnlockAndAssumeEnterpriseIdentity();
                if (policyResult != ProtectionPolicyEvaluationResult.Allowed)
                {
                    outputStr += "Policy does not allow accessing clipboard";
                }
                var text = await dataPackageView.GetTextAsync();
                var txtBox = sender as TextBox;
                txtBox.Text = text;
                outputStr += text != null ? "Successfully pasted" : "Pasting text failed";
                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 25 of file Scenario11_CPDNoUI.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario11_CPDNoUI.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario12_ShareData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario12_ShareData
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario12_ShareData Class Reference

List of all members.

Public Member Functions

Scenario12_ShareData ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnDataRequested (DataTransferManager sender, DataRequestedEventArgs e)
void | Share_Click (object sender, RoutedEventArgs e)

Private Attributes

DataTransferManager | m_dTransferMgr
string | m_ShareContent = "Content to share from EdpSamples"
MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario12_ShareData.xaml.cs.

Constructor & Destructor Documentation

Scenario12_ShareData ( ) [inline]

Definition at line 31 of file Scenario12_ShareData.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnDataRequested | ( | DataTransferManager | sender,
 |  | DataRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario12_ShareData.xaml.cs.

        {
            DataRequest request = e.Request;
            request.Data.Properties.Title = "EdpSample share";
            request.Data.Properties.Description = "An example of how to share text from an enterprise app";
            request.Data.Properties.EnterpriseId = Scenario1.m_enterpriseId;
            request.Data.SetText(InputTxtBox.Text);
            rootPage.NotifyUser("Set data to share", NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario12_ShareData.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Register the current page as a share source.
            m_dTransferMgr = DataTransferManager.GetForCurrentView();
            m_dTransferMgr.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.OnDataRequested);
            InputTxtBox.Text = m_ShareContent;
        }

void Share_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario12_ShareData.xaml.cs.

        {
            DataTransferManager.ShowShareUI();
        }

Member Data Documentation

DataTransferManager m_dTransferMgr [private]

Definition at line 28 of file Scenario12_ShareData.xaml.cs.

string m_ShareContent = "Content to share from EdpSamples" [private]

Definition at line 29 of file Scenario12_ShareData.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario12_ShareData.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario12_ShareData.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario13_ShareTarget Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario13_ShareTarget
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario13_ShareTarget Class Reference

List of all members.

Public Member Functions

Scenario13_ShareTarget ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddContentValue (string title, string description=null)
void | AddQuickLink_Checked (object sender, RoutedEventArgs e)
void | AddQuickLink_Unchecked (object sender, RoutedEventArgs e)
void | DismissUI_Click (object sender, RoutedEventArgs e)
void | ExpandLongRunningShareSection_Checked (object sender, RoutedEventArgs e)
void | ExpandLongRunningShareSection_Unchecked (object sender, RoutedEventArgs e)
void | LongRunningShareLabel_Tapped (object sender, TappedRoutedEventArgs e)
async void | NotifyUserBackgroundThread (string message, NotifyType type)
void | QuickLinkSectionLabel_Tapped (object sender, TappedRoutedEventArgs e)
async void | ReportCompleted_Click (object sender, RoutedEventArgs e)
void | ReportDataRetrieved_Click (object sender, RoutedEventArgs e)
void | ReportErrorButton_Click (object sender, RoutedEventArgs e)
void | ReportStarted_Click (object sender, RoutedEventArgs e)
void | ReportSubmittedBackgroundTask_Click (object sender, RoutedEventArgs e)

Private Attributes

const string | dataFormatName = "http://schema.org/Book"
Uri | m_sharedApplicationLink
IRandomAccessStreamReference | m_sharedBitmapStreamRef
string | m_sharedCustomData
Uri | m_sharedDataContentSourceApplicationLink
Uri | m_sharedDataContentSourceWebLink
string | m_sharedDataDescription
Color | m_sharedDataLogoBackgroundColor
string | m_sharedDataPackageFamilyName
IRandomAccessStreamReference | m_sharedDataSquare30x30Logo
string | m_sharedDataTitle
string | m_sharedHtmlFormat
IReadOnlyDictionary< string,
RandomAccessStreamReference > 		m_sharedResourceMap
IReadOnlyList< IStorageItem > | m_sharedStorageItems
string | m_sharedText
IRandomAccessStreamReference | m_sharedThumbnailStreamRef
Uri | m_sharedWebLink
ShareOperation | m_shareOperation
MainPage rootPage
string | shareQuickLinkId

Detailed Description

Definition at line 36 of file Scenario13_ShareTarget.xaml.cs.

Constructor & Destructor Documentation

Scenario13_ShareTarget ( ) [inline]

Definition at line 59 of file Scenario13_ShareTarget.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddContentValue | ( | string | title,
 |  | string | description = null |
 | ) |  |  | [inline, private]

Definition at line 446 of file Scenario13_ShareTarget.xaml.cs.

        {
            Run contentType = new Run();
            contentType.FontWeight = FontWeights.Bold;
            contentType.Text = title;
            ContentValue.Inlines.Add(contentType);

            if (description != null)
            {
                Run contentValue = new Run();
                contentValue.Text = description + Environment.NewLine;
                ContentValue.Inlines.Add(contentValue);
            }
        }

void AddQuickLink_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 341 of file Scenario13_ShareTarget.xaml.cs.

        {
            QuickLinkCustomization.Visibility = Visibility.Visible;
        }

void AddQuickLink_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 346 of file Scenario13_ShareTarget.xaml.cs.

        {
            QuickLinkCustomization.Visibility = Visibility.Collapsed;
        }

void DismissUI_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 394 of file Scenario13_ShareTarget.xaml.cs.

        {
            m_shareOperation.DismissUI();
        }

void ExpandLongRunningShareSection_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 405 of file Scenario13_ShareTarget.xaml.cs.

        {
            ExtendedSharingArea.Visibility = Visibility.Visible;
        }

void ExpandLongRunningShareSection_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 410 of file Scenario13_ShareTarget.xaml.cs.

        {
            ExtendedSharingArea.Visibility = Visibility.Collapsed;
        }

void LongRunningShareLabel_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 399 of file Scenario13_ShareTarget.xaml.cs.

        {
            // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
            ExpandLongRunningShareSection.IsChecked = !ExpandLongRunningShareSection.IsChecked;
        }

async void NotifyUserBackgroundThread | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 438 of file Scenario13_ShareTarget.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 64 of file Scenario13_ShareTarget.xaml.cs.

        {
            rootPage = MainPage.Current;

            // It is recommended to only retrieve the m_shareOperation object in the activation handler, return as
            // quickly as possible, and retrieve all data from the share target asynchronously.

            m_shareOperation = (ShareOperation)e.Parameter;
            if (m_shareOperation == null)
            {
                return;
            }

            var result = await ProtectionPolicyManager.RequestAccessAsync(Scenario1.m_enterpriseId,
                                                                             m_shareOperation.Data.Properties.EnterpriseId);
            if (result == ProtectionPolicyEvaluationResult.Blocked)
            {
                rootPage.NotifyUser("\nSharing is blocked by policy from your Enterprise", NotifyType.ErrorMessage);
            }

            await Task.Factory.StartNew(async () =>
            {
                // Retrieve the data package properties.
                m_sharedDataTitle = m_shareOperation.Data.Properties.Title;
                m_sharedDataDescription = m_shareOperation.Data.Properties.Description;
                m_sharedDataPackageFamilyName = m_shareOperation.Data.Properties.PackageFamilyName;
                m_sharedDataContentSourceWebLink = m_shareOperation.Data.Properties.ContentSourceWebLink;
                m_sharedDataContentSourceApplicationLink = m_shareOperation.Data.Properties.ContentSourceApplicationLink;
                m_sharedDataLogoBackgroundColor = m_shareOperation.Data.Properties.LogoBackgroundColor;
                m_sharedDataSquare30x30Logo = m_shareOperation.Data.Properties.Square30x30Logo;
                m_sharedThumbnailStreamRef = m_shareOperation.Data.Properties.Thumbnail;
                shareQuickLinkId = m_shareOperation.QuickLinkId;

                // Retrieve the data package content.
                // The GetWebLinkAsync(), GetTextAsync(), GetStorageItemsAsync(), etc. APIs will throw if there was an error retrieving the data from the source app.
                // In this sample, we just display the error. It is recommended that a share target app handles these in a way appropriate for that particular app.
                if (m_shareOperation.Data.Contains(StandardDataFormats.WebLink))
                {
                    try
                    {
                        m_sharedWebLink = await m_shareOperation.Data.GetWebLinkAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetWebLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(StandardDataFormats.ApplicationLink))
                {
                    try
                    {
                        m_sharedApplicationLink = await m_shareOperation.Data.GetApplicationLinkAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetApplicationLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(StandardDataFormats.Text))
                {
                    try
                    {
                        m_sharedText = await m_shareOperation.Data.GetTextAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetTextAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(StandardDataFormats.StorageItems))
                {
                    try
                    {
                        m_sharedStorageItems = await m_shareOperation.Data.GetStorageItemsAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetStorageItemsAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(dataFormatName))
                {
                    try
                    {
                        m_sharedCustomData = await m_shareOperation.Data.GetTextAsync(dataFormatName);
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetTextAsync(" + dataFormatName + ") - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(StandardDataFormats.Html))
                {
                    try
                    {
                        m_sharedHtmlFormat = await m_shareOperation.Data.GetHtmlFormatAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetHtmlFormatAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }

                    try
                    {
                        m_sharedResourceMap = await m_shareOperation.Data.GetResourceMapAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetResourceMapAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (m_shareOperation.Data.Contains(StandardDataFormats.Bitmap))
                {
                    try
                    {
                        m_sharedBitmapStreamRef = await m_shareOperation.Data.GetBitmapAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetBitmapAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }

                // In this sample, we just display the m_shared data content.

                // Get back to the UI thread using the dispatcher.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                {
                    DataPackageTitle.Text = m_sharedDataTitle;
                    DataPackageDescription.Text = m_sharedDataDescription;
                    DataPackagePackageFamilyName.Text = m_sharedDataPackageFamilyName;
                    if (m_sharedDataContentSourceWebLink != null)
                    {
                        DataPackageContentSourceWebLink.Text = m_sharedDataContentSourceWebLink.AbsoluteUri;
                    }
                    if (m_sharedDataContentSourceApplicationLink != null)
                    {
                        DataPackageContentSourceApplicationLink.Text = m_sharedDataContentSourceApplicationLink.AbsoluteUri;
                    }

                    if (m_sharedDataSquare30x30Logo != null)
                    {
                        IRandomAccessStreamWithContentType logoStream = await m_sharedDataSquare30x30Logo.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(logoStream);
                        LogoHolder.Source = bitmapImage;
                        LogoBackground.Background = new SolidColorBrush(m_sharedDataLogoBackgroundColor);
                        LogoArea.Visibility = Visibility.Visible;
                    }

                    if (!String.IsNullOrEmpty(m_shareOperation.QuickLinkId))
                    {
                        SelectedQuickLinkId.Text = shareQuickLinkId;
                    }

                    if (m_sharedThumbnailStreamRef != null)
                    {
                        IRandomAccessStreamWithContentType thumbnailStream = await m_sharedThumbnailStreamRef.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(thumbnailStream);
                        ThumbnailHolder.Source = bitmapImage;
                        ThumbnailArea.Visibility = Visibility.Visible;
                    }

                    if (m_sharedWebLink != null)
                    {
                        AddContentValue("WebLink: ", m_sharedWebLink.AbsoluteUri);
                    }
                    if (m_sharedApplicationLink != null)
                    {
                        AddContentValue("ApplicationLink: ", m_sharedApplicationLink.AbsoluteUri);
                    }
                    if (m_sharedText != null)
                    {
                        AddContentValue("Text: ", m_sharedText);
                    }
                    if (m_sharedStorageItems != null)
                    {
                        // Display the name of the files being m_shared.
                        StringBuilder fileNames = new StringBuilder();
                        for (int index = 0; index < m_sharedStorageItems.Count; index++)
                        {
                            fileNames.Append(m_sharedStorageItems[index].Name);
                            if (index < m_sharedStorageItems.Count - 1)
                            {
                                fileNames.Append(", ");
                            }
                        }
                        fileNames.Append(".");

                        AddContentValue("StorageItems: ", fileNames.ToString());
                    }
                    if (m_sharedCustomData != null)
                    {
                        // This is an area to be especially careful parsing data from the source app to avoid buffer overruns.
                        // This sample doesn't perform data validation but will catch any exceptions thrown.
                        try
                        {
                            StringBuilder receivedStrings = new StringBuilder();
                            JsonObject customObject = JsonObject.Parse(m_sharedCustomData);
                            if (customObject.ContainsKey("type"))
                            {
                                if (customObject["type"].GetString() == "http://schema.org/Book")
                                {
                                    // This sample expects the custom format to be of type http://schema.org/Book
                                    receivedStrings.AppendLine("Type: " + customObject["type"].Stringify());
                                    JsonObject properties = customObject["properties"].GetObject();
                                    receivedStrings.AppendLine("Image: " + properties["image"].Stringify());
                                    receivedStrings.AppendLine("Name: " + properties["name"].Stringify());
                                    receivedStrings.AppendLine("Book Format: " + properties["bookFormat"].Stringify());
                                    receivedStrings.AppendLine("Author: " + properties["author"].Stringify());
                                    receivedStrings.AppendLine("Number of Pages: " + properties["numberOfPages"].Stringify());
                                    receivedStrings.AppendLine("Publisher: " + properties["publisher"].Stringify());
                                    receivedStrings.AppendLine("Date Published: " + properties["datePublished"].Stringify());
                                    receivedStrings.AppendLine("In Language: " + properties["inLanguage"].Stringify());
                                    receivedStrings.Append("ISBN: " + properties["isbn"].Stringify());

                                    AddContentValue("Custom format data:" + Environment.NewLine, receivedStrings.ToString());
                                }
                                else
                                {
                                    rootPage.NotifyUser("The custom format from the source app is not of type http://schema.org/Book", NotifyType.ErrorMessage);
                                }
                            }
                            else
                            {
                                rootPage.NotifyUser("The custom format from the source app doesn't contain a type", NotifyType.ErrorMessage);
                            }
                        }
                        catch (Exception ex)
                        {
                            rootPage.NotifyUser("Failed to parse the custom data - " + ex.Message, NotifyType.ErrorMessage);
                        }
                    }
                    if (m_sharedHtmlFormat != null)
                    {
                        string htmlFragment = HtmlFormatHelper.GetStaticFragment(m_sharedHtmlFormat);
                        if (!String.IsNullOrEmpty(htmlFragment))
                        {
                            AddContentValue("HTML: ");
                            ShareWebView.Visibility = Visibility.Visible;
                            ShareWebView.NavigateToString("<html><body>" + htmlFragment + "</body></html>");
                        }
                        else
                        {
                            rootPage.NotifyUser("GetStaticFragment failed to parse the HTML from the source app", NotifyType.ErrorMessage);
                        }

                        // Check if there are any local images in the resource map.
                        if (m_sharedResourceMap.Count > 0)
                        {
                            //ResourceMapValue.Text = "";
                            foreach (KeyValuePair<string, RandomAccessStreamReference> item in m_sharedResourceMap)
                            {
                                ResourceMapValue.Text += "\nKey: " + item.Key;
                            }
                            ResourceMapArea.Visibility = Visibility.Visible;
                        }
                    }
                    if (m_sharedBitmapStreamRef != null)
                    {
                        IRandomAccessStreamWithContentType bitmapStream = await m_sharedBitmapStreamRef.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(bitmapStream);
                        ImageHolder.Source = bitmapImage;
                        ImageArea.Visibility = Visibility.Visible;
                    }
                });
            });
        }

void QuickLinkSectionLabel_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 335 of file Scenario13_ShareTarget.xaml.cs.

        {
            // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
            AddQuickLink.IsChecked = !AddQuickLink.IsChecked;
        }

async void ReportCompleted_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 351 of file Scenario13_ShareTarget.xaml.cs.

        {
            if (AddQuickLink.IsChecked.Equals(true))
            {
                QuickLink quickLinkInfo = new QuickLink
                {
                    Id = QuickLinkId.Text,
                    Title = QuickLinkTitle.Text,

                    // For QuickLinks, the supported FileTypes and DataFormats are set independently from the manifest.
                    SupportedFileTypes = { "*" },
                    SupportedDataFormats =
                    {
                        StandardDataFormats.Text,
                        StandardDataFormats.WebLink,
                        StandardDataFormats.ApplicationLink,
                        StandardDataFormats.Bitmap,
                        StandardDataFormats.StorageItems,
                        StandardDataFormats.Html,
                        dataFormatName
                    }
                };

                try
                {
                    StorageFile iconFile = await Package.Current.InstalledLocation.CreateFileAsync("assets\\user.png", CreationCollisionOption.OpenIfExists);
                    quickLinkInfo.Thumbnail = RandomAccessStreamReference.CreateFromFile(iconFile);
                    m_shareOperation.ReportCompleted(quickLinkInfo);
                }
                catch (Exception)
                {
                    // Even if the QuickLink cannot be created it is important to call ReportCompleted. Otherwise, if this is a long-running share,
                    // the app will stick around in the long-running share progress list.
                    m_shareOperation.ReportCompleted();
                    throw;
                }
            }
            else
            {
                m_shareOperation.ReportCompleted();
            }
        }

void ReportDataRetrieved_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 421 of file Scenario13_ShareTarget.xaml.cs.

        {
            m_shareOperation.ReportDataRetrieved();
            rootPage.NotifyUser("Data retrieved...", NotifyType.StatusMessage);
        }

void ReportErrorButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 433 of file Scenario13_ShareTarget.xaml.cs.

        {
            m_shareOperation.ReportError(ReportError.Text);
        }

void ReportStarted_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 415 of file Scenario13_ShareTarget.xaml.cs.

        {
            m_shareOperation.ReportStarted();
            rootPage.NotifyUser("Started...", NotifyType.StatusMessage);
        }

void ReportSubmittedBackgroundTask_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 427 of file Scenario13_ShareTarget.xaml.cs.

        {
            m_shareOperation.ReportSubmittedBackgroundTask();
            rootPage.NotifyUser("Submitted background task...", NotifyType.StatusMessage);
        }

Member Data Documentation

const string dataFormatName = "http://schema.org/Book" [private]

Definition at line 57 of file Scenario13_ShareTarget.xaml.cs.

Uri m_sharedApplicationLink [private]

Definition at line 50 of file Scenario13_ShareTarget.xaml.cs.

IRandomAccessStreamReference m_sharedBitmapStreamRef [private]

Definition at line 55 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedCustomData [private]

Definition at line 52 of file Scenario13_ShareTarget.xaml.cs.

Uri m_sharedDataContentSourceApplicationLink [private]

Definition at line 44 of file Scenario13_ShareTarget.xaml.cs.

Uri m_sharedDataContentSourceWebLink [private]

Definition at line 43 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedDataDescription [private]

Definition at line 41 of file Scenario13_ShareTarget.xaml.cs.

Color m_sharedDataLogoBackgroundColor [private]

Definition at line 45 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedDataPackageFamilyName [private]

Definition at line 42 of file Scenario13_ShareTarget.xaml.cs.

IRandomAccessStreamReference m_sharedDataSquare30x30Logo [private]

Definition at line 46 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedDataTitle [private]

Definition at line 40 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedHtmlFormat [private]

Definition at line 53 of file Scenario13_ShareTarget.xaml.cs.

IReadOnlyDictionary<string, RandomAccessStreamReference> m_sharedResourceMap [private]

Definition at line 54 of file Scenario13_ShareTarget.xaml.cs.

IReadOnlyList<IStorageItem> m_sharedStorageItems [private]

Definition at line 51 of file Scenario13_ShareTarget.xaml.cs.

string m_sharedText [private]

Definition at line 48 of file Scenario13_ShareTarget.xaml.cs.

IRandomAccessStreamReference m_sharedThumbnailStreamRef [private]

Definition at line 56 of file Scenario13_ShareTarget.xaml.cs.

Uri m_sharedWebLink [private]

Definition at line 49 of file Scenario13_ShareTarget.xaml.cs.

ShareOperation m_shareOperation [private]

Definition at line 39 of file Scenario13_ShareTarget.xaml.cs.

MainPage rootPage [private]

Definition at line 38 of file Scenario13_ShareTarget.xaml.cs.

string shareQuickLinkId [private]

Definition at line 47 of file Scenario13_ShareTarget.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario13_ShareTarget.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario14_QueryCpPaste Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario14_QueryCpPaste
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario14_QueryCpPaste Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario14_QueryCpPaste ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

bool | IsClipboardPeekAllowedAsync ()
void | QueryCp_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 30 of file Scenario14_QueryCpPaste.xaml.cs.

Constructor & Destructor Documentation

Scenario14_QueryCpPaste ( ) [inline]

Definition at line 34 of file Scenario14_QueryCpPaste.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

bool IsClipboardPeekAllowedAsync ( ) [inline, private]

Definition at line 44 of file Scenario14_QueryCpPaste.xaml.cs.

        {
            var result = ProtectionPolicyEvaluationResult.Blocked;
            var dataPackageView = Clipboard.GetContent();
            if (dataPackageView.Contains("text"))
            {
                var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
                result = ProtectionPolicyManager.CheckAccess(dataPackageView.Properties.EnterpriseId,
                    protectionPolicyManager.Identity);
            }

            // Since this is a convenience feature to allow a peek of clipboard content,
            // if state is Blocked or ConsentRequired, do not show peek.

            return result == ProtectionPolicyEvaluationResult.Allowed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario14_QueryCpPaste.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void QueryCp_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario14_QueryCpPaste.xaml.cs.

        {
            rootPage.NotifyUser("Check Access for Paste returned: " + IsClipboardPeekAllowedAsync(), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 32 of file Scenario14_QueryCpPaste.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario14_QueryCpPaste.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario15_DPLCreateFileEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario15_DPLCreateFileEvents
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario15_DPLCreateFileEvents Class Reference

Registering a background task and notification channel for raw notifications. More...

List of all members.

Public Member Functions

Scenario15_DPLCreateFileEvents ()

Static Public Member Functions

static BackgroundTaskRegistration | RegisterBackgroundTask (String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OutputToTextBox (String text)
void | Register_Click (object sender, RoutedEventArgs e)
BackgroundTaskRegistration | RegisterBackgroundTask ()
void | UnRegister_Click (object sender, RoutedEventArgs e)
bool | UnregisterBackgroundTask ()
async void | UpdateStatus ()

Private Attributes

MainPage | rootPage = null
const string | SAMPLE_TASK_ENTRY_POINT = "Tasks.EdpBackgroundTask"
const string | SAMPLE_TASK_NAME = "DPLTask"

Detailed Description

Definition at line 31 of file Scenario15_DPLFileCreateEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario15_DPLCreateFileEvents ( ) [inline]

Definition at line 37 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Definition at line 142 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            UpdateStatus();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 148 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
        }

void OutputToTextBox ( String text ) [inline, private]

Definition at line 47 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
        }

void Register_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            bool found = false;

            foreach (var iter in BackgroundTaskRegistration.AllTasks)
            {
                IBackgroundTaskRegistration task = iter.Value;
                if (task.Name == SAMPLE_TASK_NAME)
                {
                    found = true;
                    AttachProgressAndCompletedHandlers(task);
                }
            }

            if (!found)
            {
                BackgroundTaskRegistration task = RegisterBackgroundTask();
                if (task != null)
                {
                    AttachProgressAndCompletedHandlers(task);
                }
            }

            // Remove previous completion status from local settings.
            // Pass Enterprise ID to background task

            var settings = ApplicationData.Current.LocalSettings;
            settings.Values.Remove(SAMPLE_TASK_NAME);
            settings.Values.Add(SAMPLE_TASK_NAME, Scenario1.m_enterpriseId);

            rootPage.NotifyUser("Task registered", NotifyType.StatusMessage);
        }

BackgroundTaskRegistration RegisterBackgroundTask ( ) [inline, private]

Definition at line 96 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            return RegisterBackgroundTask(SAMPLE_TASK_ENTRY_POINT, SAMPLE_TASK_NAME,
                new SystemTrigger(SystemTriggerType.UserAway, false), null);
        }

static BackgroundTaskRegistration RegisterBackgroundTask | ( | String | taskEntryPoint,
 |  | String | name,
 |  | IBackgroundTrigger | trigger,
 |  | IBackgroundCondition | condition |
 | ) |  |  | [inline, static]

Definition at line 103 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            var builder = new BackgroundTaskBuilder();

            builder.Name = name;
            builder.TaskEntryPoint = taskEntryPoint;
            builder.SetTrigger(trigger);

            if (condition != null)
            {
                builder.AddCondition(condition);

                // If the condition changes while the background task is executing then it will
                // be canceled.
                builder.CancelOnConditionLoss = true;
            }

            return builder.Register();
        }

void UnRegister_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            if (UnregisterBackgroundTask())
            {
                rootPage.NotifyUser("Task unregistered", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("No task is registered", NotifyType.ErrorMessage);
            }
        }

bool UnregisterBackgroundTask ( ) [inline, private]

Definition at line 126 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            bool result = false;

            foreach (var iter in BackgroundTaskRegistration.AllTasks)
            {
                IBackgroundTaskRegistration task = iter.Value;
                if (task.Name == SAMPLE_TASK_NAME)
                {
                    task.Unregister(true);
                    result = true;
                }
            }
            return result;
        }

async void UpdateStatus ( ) [inline, private]

Definition at line 157 of file Scenario15_DPLFileCreateEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
               var settings = ApplicationData.Current.LocalSettings;
               rootPage.NotifyUser("CreateProtectedAndOpenAsync status: " + settings.Values[SAMPLE_TASK_NAME], NotifyType.StatusMessage);
            });
        }

Member Data Documentation

MainPage rootPage = null [private]

Definition at line 33 of file Scenario15_DPLFileCreateEvents.xaml.cs.

const string SAMPLE_TASK_ENTRY_POINT = "Tasks.EdpBackgroundTask" [private]

Definition at line 35 of file Scenario15_DPLFileCreateEvents.xaml.cs.

const string SAMPLE_TASK_NAME = "DPLTask" [private]

Definition at line 34 of file Scenario15_DPLFileCreateEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario15_DPLFileCreateEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario16_NetworkResource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario16_NetworkResource
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario16_NetworkResource Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario16_NetworkResource ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CheckUriIdentity_Click (object sender, RoutedEventArgs e)
void | ClientTypeChanged ()
async void | ConnectToUri ()
async void | ConnectUsingBackgroundTransfer (string resourceIdentity, Uri resourceUri)
async void | ConnectUsingNetHttpClient (string resourceIdentity, Uri resourceUri)
async void | ConnectUsingWebHttpClient (string resourceIdentity, Uri resourceUri)
async void | DiscoverActiveDownloadsAsync ()
void | DisplayNetworkIdentity (string resourceIdentity)
async Task | HandleDownloadAsync (DownloadOperation download)

Static Private Member Functions

static T | UsingNetworkContext< T > (string identity, Func< T > lambda)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 31 of file Scenario16_NetworkResource.xaml.cs.

Constructor & Destructor Documentation

Scenario16_NetworkResource ( ) [inline]

Definition at line 35 of file Scenario16_NetworkResource.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CheckUriIdentity_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario16_NetworkResource.xaml.cs.

        {
            Uri resourceUri;
            string resourceIdentity;
            try
            {
                if (!Uri.TryCreate(ResourceUriText.Text.Trim(), UriKind.Absolute, out resourceUri))
                {
                    rootPage.NotifyUser("Invalid URI, please re-enter a valid URI", NotifyType.ErrorMessage);
                    return;
                }
                resourceIdentity = await ProtectionPolicyManager.GetPrimaryManagedIdentityForNetworkEndpointAsync(
                                           new HostName(resourceUri.Host));
                DisplayNetworkIdentity(resourceIdentity);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

void ClientTypeChanged ( ) [inline, private]

Definition at line 267 of file Scenario16_NetworkResource.xaml.cs.

        {
            if (UseWindowsWebHttpClient.IsChecked.Value)
            {
                CredentialsContent.Visibility = Visibility.Collapsed;
            }
            else
            {
                CredentialsContent.Visibility = Visibility.Visible;
            }
        }

async void ConnectToUri ( ) [inline, private]

Definition at line 290 of file Scenario16_NetworkResource.xaml.cs.

        {
            Uri resourceUri;

            if (!Uri.TryCreate(ResourceUriText.Text, UriKind.Absolute, out resourceUri))
            {
                rootPage.NotifyUser("Invalid URI", NotifyType.ErrorMessage);
                return;
            }

            var hostName = new HostName(resourceUri.Host);

            try
            {
                string resourceIdentity = await ProtectionPolicyManager.GetPrimaryManagedIdentityForNetworkEndpointAsync(hostName);
                // if there is no resourceIdentity, then the resource is considered personal, and no thread network context is needed.
                // Otherwise, it requires the enterprise context.
                DisplayNetworkIdentity(resourceIdentity);

                rootPage.NotifyUser("Accessing network resource...", NotifyType.StatusMessage);

                if (UseSystemNetHttpClient.IsChecked.Value)
                {
                    ConnectUsingNetHttpClient(resourceIdentity, resourceUri);
                }
                else if (UseWindowsWebHttpClient.IsChecked.Value)
                {
                    ConnectUsingWebHttpClient(resourceIdentity, resourceUri);
                }
                else if (UseBackgroundTransferButton.IsChecked.Value)
                {
                    ConnectUsingBackgroundTransfer(resourceIdentity, resourceUri);
                }
                else
                {
                    rootPage.NotifyUser("Please select a method to connect.", NotifyType.ErrorMessage);
                }
            }
            catch (Exception ex)
            {
                // Access to the network resource was not successful.
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void ConnectUsingBackgroundTransfer | ( | string | resourceIdentity,
 |  | Uri | resourceUri |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario16_NetworkResource.xaml.cs.

        {
            ThreadNetworkContext context = null;

            try
            {
                // For demonstrational purposes, when "Use personal context" is selected,
                // the resourceIdentity is set to null to force personal context.

                // When using Windows.Networking.BackgroundTransfer, the app is responsible for disallowing connections
                // to enterprise owned URLs when in personal context.
                // Otherwise, the app may inadvertently access cached data for a different context.
                if (UsePersonalContext.IsChecked.Value && !string.IsNullOrEmpty(resourceIdentity))
                {
                    rootPage.NotifyUser("This app does not have access to the specified URL in personal context", NotifyType.ErrorMessage);
                    return;
                }

                rootPage.NotifyUser("Creating file.........", NotifyType.StatusMessage);

                StorageFile resultFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(
                    "ResultFile.txt",
                    CreationCollisionOption.GenerateUniqueName);

                if (!string.IsNullOrEmpty(resourceIdentity))
                {
                    context = ProtectionPolicyManager.CreateCurrentThreadNetworkContext(resourceIdentity);
                }

                rootPage.NotifyUser("Accessing network resource.........", NotifyType.StatusMessage);

                BackgroundDownloader downloader = new BackgroundDownloader();

                if (!string.IsNullOrEmpty(UserNameBox.Text) &&
                    !string.IsNullOrEmpty(Passwordbox.Password))
                {
                    downloader.ServerCredential = new PasswordCredential(
                        resourceUri.AbsoluteUri,
                        UserNameBox.Text,
                        Passwordbox.Password);
                }

                DownloadOperation download = downloader.CreateDownload(resourceUri, resultFile);

                await HandleDownloadAsync(download);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                if (context != null)
                {
                    context.Dispose();
                }
            }
        }

async void ConnectUsingNetHttpClient | ( | string | resourceIdentity,
 |  | Uri | resourceUri |
 | ) |  |  | [inline, private]

Definition at line 197 of file Scenario16_NetworkResource.xaml.cs.

        {
            try
            {
                // Use System.Net.Http.HttpClient to access the resource.
                // The code is identical to a normal resource access, except that we specify a header
                // with the Enterprise ID that will allow us to access enterprise owned URLs.
                // The "X-MS-Windows-HttpClient-EnterpriseId" header is used instead of using ThreadNetworkContext
                // because the thread that ultimately carries out the network-bound operations may be different.

                // For demonstrational purposes, when "Use personal context" is selected,
                // the resourceIdentity is set to null to force personal context.
                if (UsePersonalContext.IsChecked.Value)
                {
                    resourceIdentity = "";
                }

                var httpHandler = new System.Net.Http.HttpClientHandler();
                httpHandler.Credentials = new System.Net.NetworkCredential(UserNameBox.Text, Passwordbox.Password);
                httpHandler.AllowAutoRedirect = true;
                using (var client = new System.Net.Http.HttpClient(httpHandler))
                {
                    var message = new System.Net.Http.HttpRequestMessage(System.Net.Http.HttpMethod.Get, resourceUri);
                    message.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)");
                    client.DefaultRequestHeaders.Add("X-MS-Windows-HttpClient-EnterpriseId", resourceIdentity);
                    System.Net.Http.HttpResponseMessage response = await client.SendAsync(message);
                    rootPage.NotifyUser($"Server response = {(int)response.StatusCode} {response.ReasonPhrase}", NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                // Access to the network resource was not successful.
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void ConnectUsingWebHttpClient | ( | string | resourceIdentity,
 |  | Uri | resourceUri |
 | ) |  |  | [inline, private]

Definition at line 168 of file Scenario16_NetworkResource.xaml.cs.

        {
            try
            {
                // Use Windows.Web.Http.HttpClient to access the resource.
                // The code is identical to a normal resource access, except that we create
                // a ThreadNetworkContext around the client.GetAsync() call.

                using (var client = new Windows.Web.Http.HttpClient())
                {
                    // When using Windows.Web.Http.HttpClient, the app is responsible for disallowing connections
                    // to enterprise owned URLs when in personal context.
                    // Otherwise, the app may inadvertently access cached data for a different context.
                    if (!string.IsNullOrEmpty(resourceIdentity) && UsePersonalContext.IsChecked.Value)
                    {
                        rootPage.NotifyUser("This app does not have access to the specified URL in personal context", NotifyType.ErrorMessage);
                        return;
                    }
                    Windows.Web.Http.HttpResponseMessage response = await UsingNetworkContext(resourceIdentity, () => client.GetAsync(resourceUri));
                    rootPage.NotifyUser($"Server response = {(int)response.StatusCode} {response.ReasonPhrase}", NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                // Access to the network resource was not successful.
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void DiscoverActiveDownloadsAsync ( ) [inline, private]

Definition at line 48 of file Scenario16_NetworkResource.xaml.cs.

        {
            List<DownloadOperation> activeDownloads = new List<DownloadOperation>();

            IReadOnlyList<DownloadOperation> downloads = null;
            try
            {
                downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
            }
            catch (Exception ex)
            {
                // There was a problem with the downloads.
                // Use BackgroundTransferError.GetStatus(ex.HResult) to convert the HResult
                // into something more useful.
                // This sample merely reports the raw error.
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }

            rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
                "Loading background downloads: {0}",
                downloads.Count),
                NotifyType.StatusMessage);

            if (downloads.Count > 0)
            {
                List<Task> tasks = new List<Task>();
                foreach (DownloadOperation download in downloads)
                {
                    rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
                        "Discovered background download: {0}, Status: {1}",
                        download.Guid,
                        download.Progress.Status),
                        NotifyType.StatusMessage);

                    // Attach completion handler.
                    var notAwait = HandleDownloadAsync(download);
                }
            }
        }

void DisplayNetworkIdentity ( string resourceIdentity ) [inline, private]

Definition at line 335 of file Scenario16_NetworkResource.xaml.cs.

        {
            if (string.IsNullOrEmpty(resourceIdentity))
            {
                ActualEnterpriseContextTextBlock.Text = "Network resource is not enterprise protected.";
            }
            else
            {
                ActualEnterpriseContextTextBlock.Text = "Network resource's enterprise identity is " + resourceIdentity;
            }
        }

async Task HandleDownloadAsync ( DownloadOperation download ) [inline, private]

Definition at line 232 of file Scenario16_NetworkResource.xaml.cs.

        {
            try
            {
                // For more advanced Background Transfer features, please take a look at the
                // BackgroundTransfer sample.
                if (download.Progress.Status == BackgroundTransferStatus.Idle)
                {
                    await download.StartAsync();
                }
                else
                {
                    await download.AttachAsync();
                }

                ResponseInformation response = download.GetResponseInformation();

                // GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
                string statusCode = response != null ? response.StatusCode.ToString() : String.Empty;

                rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
                    "Successfully completed background download: {0}, Status Code: {1}",
                    download.Guid,
                    statusCode),
                    NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario16_NetworkResource.xaml.cs.

        {
            rootPage = MainPage.Current;

            DiscoverActiveDownloadsAsync();
        }

static T UsingNetworkContext< T > | ( | string | identity,
 |  | Func< T > | lambda |
 | ) |  |  | [inline, static, private]

Member Data Documentation

MainPage rootPage [private]

Definition at line 33 of file Scenario16_NetworkResource.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario16_NetworkResource.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | IsIdentityManaged_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_scenarioText = "by an enterprise policy."
MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario2_IdManaged.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 36 of file Scenario2_IdManaged.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void IsIdentityManaged_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario2_IdManaged.xaml.cs.

        {
            bool isIdentityManaged = ProtectionPolicyManager.IsIdentityManaged(Scenario1.m_enterpriseId);
            rootPage.NotifyUser("IsIdentityManaged: " + isIdentityManaged, NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario2_IdManaged.xaml.cs.

        {
            ScenarioTextTbl.Text = m_scenarioText;
            rootPage = MainPage.Current;
        }

Member Data Documentation

string m_scenarioText = "by an enterprise policy." [private]

Definition at line 29 of file Scenario2_IdManaged.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file Scenario2_IdManaged.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario2_IdManaged.xaml.cs
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearProcessUIPolicy_Click (object sender, RoutedEventArgs e)
void | TryApplyProcessUIPolicy_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_clearPolicyText = " After pressing the ClearProcessUIPolicy button, copy+paste of the above data to a non-enterprise app should succeed"
string | m_copyPasteScenarioText = "Copying and then pasting of the below data to a non-enterprise app should be blocked after Pressing the TryApplyProcessUIPolicy button "
string | m_testDataToCopy = "copy paste this to non-enterprise app"
MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario3_UIPolicy.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 38 of file Scenario3_UIPolicy.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearProcessUIPolicy_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario3_UIPolicy.xaml.cs.

        {
            ProtectionPolicyManager.ClearProcessUIPolicy();
            rootPage.NotifyUser("Copy+Paste from this app should now succeed", NotifyType.ErrorMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario3_UIPolicy.xaml.cs.

        {
            rootPage = MainPage.Current;
            CopyPasteScenarioText.Text = m_copyPasteScenarioText;
            CopyTestData.Text = m_testDataToCopy;
            ClearUIPolicyLabel.Text = m_clearPolicyText;
        }

void TryApplyProcessUIPolicy_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario3_UIPolicy.xaml.cs.

        {
            bool result = ProtectionPolicyManager.TryApplyProcessUIPolicy(Scenario1.m_enterpriseId);
            rootPage.NotifyUser("TryApplyProcessUIPolicy returned " + result, NotifyType.StatusMessage);
        }

Member Data Documentation

string m_clearPolicyText = " After pressing the ClearProcessUIPolicy button, copy+paste of the above data to a non-enterprise app should succeed" [private]

Definition at line 35 of file Scenario3_UIPolicy.xaml.cs.

string m_copyPasteScenarioText = "Copying and then pasting of the below data to a non-enterprise app should be blocked after Pressing the TryApplyProcessUIPolicy button " [private]

Definition at line 29 of file Scenario3_UIPolicy.xaml.cs.

string m_testDataToCopy = "copy paste this to non-enterprise app" [private]

Definition at line 36 of file Scenario3_UIPolicy.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file Scenario3_UIPolicy.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario3_UIPolicy.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4 ()
async void | CopyProtectionAsync ()
async Task< string > | GetFileStatusStringAsync ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CopyProtectionAsync_Click (object sender, RoutedEventArgs e)
async void | CreateFileAndProtect ()
async void | FilePickerBt_Click (object sender, RoutedEventArgs e)
void | ProtectAsyncFile_Click (object sender, RoutedEventArgs e)
async void | ProtectAsyncFileStatus_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_copyProtectionScenarioDesc = "API to replicate protection from one file to another."
StorageFile | m_file = null
string | m_FileCopyName = "Edpcopy.txt"
string | m_getProtectScenarioDesc = "check the status of the file to see what went wrong.The app calls the GetProtectionInfoAsync API to query the status."
string | m_isRoamableScenarioDesc = "can be roamed.The app calls GetProtectionInfoAsync on the file to retrieve this information."
string | m_protectScenarioDesc = "external resource such as a mailbox"
MainPage rootPage

Detailed Description

Definition at line 30 of file Scenario4_FilePMgr.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 47 of file Scenario4_FilePMgr.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CopyProtectionAsync ( ) [inline]

Definition at line 101 of file Scenario4_FilePMgr.xaml.cs.

        {
            if (m_file != null)
            {
                StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
                StorageFile destFile = await localFolder.CreateFileAsync(m_FileCopyName, CreationCollisionOption.OpenIfExists);

                if (destFile != null)
                {
                    await destFile.DeleteAsync();
                }

                // Recreate file
                destFile = await localFolder.CreateFileAsync(m_FileCopyName, CreationCollisionOption.ReplaceExisting);

                string outputStr = "Copying protection from source: " + m_file.Path + "\nTo destination: " + destFile.Path;
                bool result = await FileProtectionManager.CopyProtectionAsync(m_file, destFile);
                if (!result)
                {
                    rootPage.NotifyUser(outputStr + " Copy protection Failed", NotifyType.ErrorMessage);
                }
                else
                {
                    FileProtectionInfo sourceInfo = await FileProtectionManager.GetProtectionInfoAsync(m_file);
                    FileProtectionInfo destInfo = await FileProtectionManager.GetProtectionInfoAsync(destFile);
                    if (sourceInfo.Status != destInfo.Status)
                    {
                        outputStr += "\nsource and destination don't have same protection source status:" +
                                            sourceInfo.Status + " Destination status:" + destInfo.Status;
                        rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
                    }
                    else
                    {
                        outputStr += "\nCopying protection succeeded";
                        rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser("Please pick a source file", NotifyType.ErrorMessage);
            }
        }

void CopyProtectionAsync_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 195 of file Scenario4_FilePMgr.xaml.cs.

        {
            CopyProtectionAsync();
        }

async void CreateFileAndProtect ( ) [inline, private]

Definition at line 81 of file Scenario4_FilePMgr.xaml.cs.

        {
            string outputStr = "";

            FileProtectionInfo procInfo =  await FileProtectionManager.GetProtectionInfoAsync(m_file);
            if (procInfo.Status != FileProtectionStatus.Protected)
            {
                outputStr += "\nProtecting File: ";
                await FileProtectionManager.ProtectAsync(m_file, Scenario1.m_enterpriseId);
                procInfo =  await FileProtectionManager.GetProtectionInfoAsync(m_file);
                outputStr += "\nProtected File: " + m_file.Path + "Status:" + procInfo.Status;
            }
            else
            {
                outputStr += "\nFile protection status is: " + procInfo.Status;
            }

            rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
        }

async void FilePickerBt_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario4_FilePMgr.xaml.cs.

        {
            string outputStr = "";

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            openPicker.FileTypeFilter.Add("*");
            m_file = await openPicker.PickSingleFileAsync();
            if (m_file != null)
            {
                // Application now has read/write access to the picked file
                outputStr += "\nPicked file: " + m_file.Path;
                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
            else
            {
                outputStr += "\nPlease pick a file";
                rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
            }
        }

async Task<string> GetFileStatusStringAsync ( ) [inline]

Definition at line 145 of file Scenario4_FilePMgr.xaml.cs.

        {
            string outputStr = "";

            FileProtectionInfo protectionInfo = await FileProtectionManager.GetProtectionInfoAsync(m_file);
            if (protectionInfo.Status == FileProtectionStatus.Revoked)
            {
                outputStr += "\nFile " + m_file.Path + " is revoked";
            }
            else
            {
                outputStr += "\nFile protection status of: " + m_file.Path + " is " + protectionInfo.Status;
            }

            if (protectionInfo.IsRoamable)
            {
                outputStr += "\nFile " + m_file.Path + " is roamable";
            }
            else
            {
                outputStr += "\nFile " + m_file.Path + " is not roamable";
            }

            return outputStr;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario4_FilePMgr.xaml.cs.

        {
            ScenarioText.Text = m_protectScenarioDesc + m_getProtectScenarioDesc +
                               m_isRoamableScenarioDesc + m_copyProtectionScenarioDesc;
            rootPage = MainPage.Current;
        }

void ProtectAsyncFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 183 of file Scenario4_FilePMgr.xaml.cs.

        {
            if (m_file != null)
            {
                CreateFileAndProtect();
            }
            else
            {
                rootPage.NotifyUser("Please pick a file", NotifyType.ErrorMessage);
            }
        }

async void ProtectAsyncFileStatus_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario4_FilePMgr.xaml.cs.

        {
            if (m_file != null)
            {
                rootPage.NotifyUser(await GetFileStatusStringAsync(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Please pick a file", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

string m_copyProtectionScenarioDesc = "API to replicate protection from one file to another." [private]

Definition at line 41 of file Scenario4_FilePMgr.xaml.cs.

StorageFile m_file = null [private]

Definition at line 44 of file Scenario4_FilePMgr.xaml.cs.

string m_FileCopyName = "Edpcopy.txt" [private]

Definition at line 45 of file Scenario4_FilePMgr.xaml.cs.

string m_getProtectScenarioDesc = "check the status of the file to see what went wrong.The app calls the GetProtectionInfoAsync API to query the status." [private]

Definition at line 37 of file Scenario4_FilePMgr.xaml.cs.

string m_isRoamableScenarioDesc = "can be roamed.The app calls GetProtectionInfoAsync on the file to retrieve this information." [private]

Definition at line 39 of file Scenario4_FilePMgr.xaml.cs.

string m_protectScenarioDesc = "external resource such as a mailbox" [private]

Definition at line 33 of file Scenario4_FilePMgr.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file Scenario4_FilePMgr.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario4_FilePMgr.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5 Class Reference

List of all members.

Public Member Functions

Scenario5 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ProtectedContentRevoked (Object sender, ProtectedContentRevokedEventArgs args)
void | Revoke_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_revokeEventScenarioText = "When it receives the event, it deletes any metadata associated with the enterprise mailbox which will no longer be required. "
string | m_revokeScenarioTxt = "content protected to the enterprise identity."
MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario5_Revoke.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 37 of file Scenario5_Revoke.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario5_Revoke.xaml.cs.

        {
            RevokeScenarioText.Text = m_revokeScenarioTxt + m_revokeEventScenarioText;

            rootPage = MainPage.Current;
            ProtectionPolicyManager.ProtectedContentRevoked += ProtectedContentRevoked;
        }

void ProtectedContentRevoked | ( | Object | sender,
 |  | ProtectedContentRevokedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario5_Revoke.xaml.cs.

        {
            RevokeEventHdlr.Text = "Content is Revoked event has fired. Do some housekeeping";
        }

void Revoke_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario5_Revoke.xaml.cs.

        {
            ProtectionPolicyManager.RevokeContent(Scenario1.m_enterpriseId);
            rootPage.NotifyUser("RevokeContent executed", NotifyType.StatusMessage);
        }

Member Data Documentation

string m_revokeEventScenarioText = "When it receives the event, it deletes any metadata associated with the enterprise mailbox which will no longer be required. " [private]

Definition at line 34 of file Scenario5_Revoke.xaml.cs.

string m_revokeScenarioTxt = "content protected to the enterprise identity." [private]

Definition at line 28 of file Scenario5_Revoke.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario5_Revoke.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario5_Revoke.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6 Class Reference

List of all members.

Public Member Functions

Scenario6 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | GetBuffersStatus_Click (object sender, RoutedEventArgs e)
async void | ProtectAsyncBuffer_Click (object sender, RoutedEventArgs e)
async void | UnprotectAsyncBuffer_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_protectBufferScenario = "wiping the data when required by the enterprise."
IBuffer | m_protectedBuffer = null
string | m_protectedMessage = "Hello World"
string | m_statusBufferScenario = "check the status of the buffer."
IBuffer | m_unprotectedBuffer = null
MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario6_ProtectBuffer.xaml.cs.

Constructor & Destructor Documentation

Scenario6 ( ) [inline]

Definition at line 42 of file Scenario6_ProtectBuffer.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetBuffersStatus_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario6_ProtectBuffer.xaml.cs.

        {
            string outputStr = "";

            if (m_protectedBuffer != null)
            {
                DataProtectionInfo procStatus = await DataProtectionManager.GetProtectionInfoAsync(m_protectedBuffer);
                outputStr += "\n protection status: " + procStatus.Status;
                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
            else
            {
                outputStr += "\n Buffer is null because Protect API did not run successfully";
                rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario6_ProtectBuffer.xaml.cs.

        {
            ScenarioTxtBlk.Text = m_protectBufferScenario + m_statusBufferScenario;
            rootPage = MainPage.Current;
        }

async void ProtectAsyncBuffer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 92 of file Scenario6_ProtectBuffer.xaml.cs.

        {
            string outputStr = "\n Protecting string:" + m_protectedMessage;
            IBuffer inputBuffer = CryptographicBuffer.ConvertStringToBinary(m_protectedMessage,
                                                                            BinaryStringEncoding.Utf8);
            BufferProtectUnprotectResult procBuffer = await DataProtectionManager.ProtectAsync(inputBuffer, Scenario1.m_enterpriseId);
            m_protectedBuffer = procBuffer.Buffer;
            outputStr += "\n Status: " + procBuffer.ProtectionInfo.Status;
            outputStr += "\n Protected string:";
            outputStr += CryptographicBuffer.EncodeToHexString(m_protectedBuffer).Substring(0, 20);
            rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
        }

async void UnprotectAsyncBuffer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario6_ProtectBuffer.xaml.cs.

        {
            string outputStr = "";
            string plainMessage = "";

            if (m_protectedBuffer != null)
            {
                BufferProtectUnprotectResult unBuffer = await DataProtectionManager.UnprotectAsync(m_protectedBuffer);
                m_unprotectedBuffer = unBuffer.Buffer;
                plainMessage = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8,
                                                                            m_unprotectedBuffer
                                                                            );
                outputStr += "\n Status: " + unBuffer.ProtectionInfo.Status;
                outputStr += "\n Unprotected string:" + plainMessage;
                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Please protect a buffer to unprotect", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

string m_protectBufferScenario = "wiping the data when required by the enterprise." [private]

Definition at line 32 of file Scenario6_ProtectBuffer.xaml.cs.

IBuffer m_protectedBuffer = null [private]

Definition at line 29 of file Scenario6_ProtectBuffer.xaml.cs.

string m_protectedMessage = "Hello World" [private]

Definition at line 28 of file Scenario6_ProtectBuffer.xaml.cs.

string m_statusBufferScenario = "check the status of the buffer." [private]

Definition at line 37 of file Scenario6_ProtectBuffer.xaml.cs.

IBuffer m_unprotectedBuffer = null [private]

Definition at line 30 of file Scenario6_ProtectBuffer.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario6_ProtectBuffer.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario6_ProtectBuffer.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario7
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | GetStreamStatus_Click (object sender, RoutedEventArgs e)
async void | ProtectStreamAsync_Click (object sender, RoutedEventArgs e)
async void | UnprotectAsyncBuffer_Click (object sender, RoutedEventArgs e)

Private Attributes

string | m_getstreamStreamScenario = "if the app is denied access to the stream when unprotecting it, it can check its status."
InMemoryRandomAccessStream | m_protectedStream = null
string | m_protectStreamScenario = "it protects the data to the enterprise identity it belongs to.This allows wiping the data when required by the enterprise."
InMemoryRandomAccessStream | m_unprotectedStream = null
MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario7_ProtectStream.xaml.cs.

Constructor & Destructor Documentation

Scenario7 ( ) [inline]

Definition at line 41 of file Scenario7_ProtectStream.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetStreamStatus_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario7_ProtectStream.xaml.cs.

        {
            if (m_protectedStream != null)
            {
                DataProtectionInfo procStatus = await DataProtectionManager.GetStreamProtectionInfoAsync(m_protectedStream.GetInputStreamAt(0));
                string outputStr = "\n m_protectedStream protection status: " + procStatus.Status;
                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
            else
            {
                string outputStr = "\nStream is null because ProtectStream API did not run successfully";
                rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario7_ProtectStream.xaml.cs.

        {
            ScenarioText.Text = m_protectStreamScenario + m_getstreamStreamScenario;
            rootPage = MainPage.Current;
        }

async void ProtectStreamAsync_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 92 of file Scenario7_ProtectStream.xaml.cs.

        {
            string outputStr = "";
            Byte[] byteStream = { 1, 2, 3, 4, 5 };

            InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
            IOutputStream outputStream = randomAccessStream.GetOutputStreamAt(0);
            var writer = new DataWriter(outputStream);
            writer.WriteBytes(byteStream);
            await writer.StoreAsync();

            IInputStream source = randomAccessStream.GetInputStreamAt(0);
            m_protectedStream = new InMemoryRandomAccessStream();
            IOutputStream destination = m_protectedStream.GetOutputStreamAt(0);

            await DataProtectionManager.ProtectStreamAsync(source, Scenario1.m_enterpriseId, destination);

            var reader = new DataReader(m_protectedStream.GetInputStreamAt(0));
            await reader.LoadAsync((uint)m_protectedStream.Size);
            IBuffer protectedStreamBuffer = reader.ReadBuffer((uint)m_protectedStream.Size);
            outputStr += "\n Protected Stream buffer:" + CryptographicBuffer.EncodeToHexString(protectedStreamBuffer);

            rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
        }

async void UnprotectAsyncBuffer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario7_ProtectStream.xaml.cs.

        {
            string outputStr = "";

            if (m_protectedStream != null)
            {
                IInputStream source = m_protectedStream.GetInputStreamAt(0);
                m_unprotectedStream = new InMemoryRandomAccessStream();
                await DataProtectionManager.UnprotectStreamAsync(source,
                                                                     m_unprotectedStream
                                                                     );
                var unprotectedReader = new DataReader(m_unprotectedStream.GetInputStreamAt(0));
                await unprotectedReader.LoadAsync((uint)m_unprotectedStream.Size);
                IBuffer unprotectedStreamBuffer = unprotectedReader.ReadBuffer((uint)m_unprotectedStream.Size);
                outputStr += "\n UnProtected Stream buffer:" +
                               CryptographicBuffer.EncodeToHexString(unprotectedStreamBuffer);

                rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Please protect a stream to unprotect", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

string m_getstreamStreamScenario = "if the app is denied access to the stream when unprotecting it, it can check its status." [private]

Definition at line 37 of file Scenario7_ProtectStream.xaml.cs.

InMemoryRandomAccessStream m_protectedStream = null [private]

Definition at line 31 of file Scenario7_ProtectStream.xaml.cs.

string m_protectStreamScenario = "it protects the data to the enterprise identity it belongs to.This allows wiping the data when required by the enterprise." [private]

Definition at line 33 of file Scenario7_ProtectStream.xaml.cs.

InMemoryRandomAccessStream m_unprotectedStream = null [private]

Definition at line 32 of file Scenario7_ProtectStream.xaml.cs.

MainPage rootPage [private]

Definition at line 30 of file Scenario7_ProtectStream.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario7_ProtectStream.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_ClipboardSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario8_ClipboardSource
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario8_ClipboardSource Class Reference

List of all members.

Public Member Functions

Scenario8_ClipboardSource ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Set_ClipboardSource (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 21 of file Scenario8_ClipboardSource.xaml.cs.

Constructor & Destructor Documentation

Scenario8_ClipboardSource ( ) [inline]

Definition at line 25 of file Scenario8_ClipboardSource.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario8_ClipboardSource.xaml.cs.

        {
            rootPage = MainPage.Current;
            var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
            protectionPolicyManager.Identity = ""; // personal context
            InputTxtBox.Text = "Copy and paste this text to a non-enterprise app such as notepad";
        }

void Set_ClipboardSource | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario8_ClipboardSource.xaml.cs.

        {
            var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
            protectionPolicyManager.Identity = Scenario1.m_enterpriseId;
            rootPage.NotifyUser("Set ProtectionPolicyManager.Identity to: " + Scenario1.m_enterpriseId, NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 23 of file Scenario8_ClipboardSource.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario8_ClipboardSource.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_ClipboardTarget Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • EdpSample
  • Scenario9_ClipboardTarget
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario9_ClipboardTarget Class Reference

List of all members.

Public Member Functions

Scenario9_ClipboardTarget ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | PasteButton_Click (object sender, TextControlPasteEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 23 of file Scenario9_ClipboardTarget.xaml.cs.

Constructor & Destructor Documentation

Scenario9_ClipboardTarget ( ) [inline]

Definition at line 27 of file Scenario9_ClipboardTarget.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario9_ClipboardTarget.xaml.cs.

        {
            rootPage = MainPage.Current;

            var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
            protectionPolicyManager.Identity = ""; // personal context
            InputTxtBox.PlaceholderText = "Copy Text here from a non-enterprise app";
        }

async void PasteButton_Click | ( | object | sender,
 |  | TextControlPasteEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario9_ClipboardTarget.xaml.cs.

        {
            // Mark the event as handled first. Otherwise, the
            // default paste action will happen, then the custom paste
            // action, and the user will see the text box content change.
            e.Handled = true;

            // Get content from the clipboard.
            var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
            if (dataPackageView.Contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.Text))
            {
                var response = await dataPackageView.RequestAccessAsync();
                if (response == ProtectionPolicyEvaluationResult.Allowed)
                {
                    (sender as TextBox).Text = await dataPackageView.GetTextAsync();
                    string sourceId = dataPackageView.Properties.EnterpriseId != null ? dataPackageView.Properties.EnterpriseId : "<Personal>";
                    string targetId = ProtectionPolicyManager.GetForCurrentView().Identity != null ? dataPackageView.Properties.EnterpriseId : "<Personal>";
                    string message = "Successfully pasted text from EnterpriseId " + sourceId + " to EnterpriseId " + targetId;
                    rootPage.NotifyUser(message, NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("User or policy blocked access", NotifyType.StatusMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 25 of file Scenario9_ClipboardTarget.xaml.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Scenario9_ClipboardTarget.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: unique_bag Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ELS
  • Private
  • unique_bag
Public Member Functions

unique_bag Struct Reference

#include "elsutil.h"

List of all members.

Public Member Functions

unique_bag ()
~unique_bag ()

Detailed Description

Definition at line 18 of file elsutil.h.

Constructor & Destructor Documentation

unique_bag ( ) [inline]

Definition at line 20 of file elsutil.h.

: MAPPING_PROPERTY_BAG{} {}

~unique_bag ( ) [inline]

Definition at line 22 of file elsutil.h.

{ MappingFreePropertyBag(this); }

The documentation for this struct was generated from the following file:
  • LinguisticServices/shared/elsutil.h
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: unique_services Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ELS
  • Private
  • unique_services
Public Member Functions | Public Attributes

unique_services Struct Reference

#include "elsutil.h"

List of all members.

Public Member Functions

unique_services ()
unique_services (unique_services const &)
~unique_services ()
operator MAPPING_SERVICE_INFO * ()
MAPPING_SERVICE_INFO ** | operator& ()

Public Attributes

MAPPING_SERVICE_INFO * | services = nullptr

Detailed Description

Definition at line 8 of file elsutil.h.

Constructor & Destructor Documentation

unique_services ( )
unique_services ( unique_services const & )
~unique_services ( ) [inline]

Definition at line 15 of file elsutil.h.

{ if (services) MappingFreeServices(services); }

Member Function Documentation

operator MAPPING_SERVICE_INFO * ( ) [inline]

Definition at line 10 of file elsutil.h.

{ return services; }

MAPPING_SERVICE_INFO** operator& ( ) [inline]

Definition at line 11 of file elsutil.h.

{ return &services; }

Member Data Documentation

MAPPING_SERVICE_INFO* services = nullptr

Definition at line 12 of file elsutil.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/shared/elsutil.h
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Face Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Face Class Reference

#include "Face.h"

Inherits GameObject.

List of all members.

Public Member Functions

Face ()
Face (DirectX::XMFLOAT3 origin, DirectX::XMFLOAT3 p1, DirectX::XMFLOAT3 p2)
virtual bool | IsTouching (DirectX::XMFLOAT3 point, float radius, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) override
void | SetPlane (DirectX::XMFLOAT3 origin, DirectX::XMFLOAT3 p1, DirectX::XMFLOAT3 p2)

Protected Member Functions

virtual void | UpdatePosition () override

Private Member Functions

void | UpdateMatrix ()

Private Attributes

float | m_height
DirectX::XMFLOAT3 | m_heightVector
DirectX::XMFLOAT3 | m_normal
DirectX::XMFLOAT3 | m_point [4]
DirectX::XMFLOAT4X4 | m_rotationMatrix
float | m_width
DirectX::XMFLOAT3 | m_widthVector

Detailed Description

Definition at line 21 of file Face.h.

Constructor & Destructor Documentation

Face ( )

Definition at line 17 of file Face.cpp.

{
    SetPlane(
        XMFLOAT3(0.0f, 0.0f, 0.0f),
        XMFLOAT3(1.0f, 0.0f, 0.0f),
        XMFLOAT3(0.0f, 1.0f, 0.0f)
        );
}

Face | ( | DirectX::XMFLOAT3 | origin,
 |  | DirectX::XMFLOAT3 | p1,
 |  | DirectX::XMFLOAT3 | p2
 | ) |  |

Member Function Documentation

virtual bool IsTouching | ( | DirectX::XMFLOAT3 | point,
 |  | float | radius,
 |  | _Out_ DirectX::XMFLOAT3 * | contact,
 |  | _Out_ DirectX::XMFLOAT3 * | normal |
 | ) |  |  | [override, virtual]

Reimplemented from GameObject.

void SetPlane | ( | DirectX::XMFLOAT3 | origin,
 |  | DirectX::XMFLOAT3 | p1,
 |  | DirectX::XMFLOAT3 | p2
 | ) |  |
void UpdateMatrix ( ) [private]

Definition at line 184 of file Face.cpp.

{
    // Determine the Model transform for the cannonical face to align with the position
    // and orientation of the defined face. The cannonical face geometry is
    // a rectangle at the origin extending 1 unit in the +X and 1 unit in the +Y direction.

    XMVECTOR w = XMVectorSet(1.0f, 0.0f, 0.0f, 1.0f);
    XMVECTOR h = XMVectorSet(0.0f, 1.0f, 0.0f, 1.0f);
    XMVECTOR epsilon = XMVectorReplicate(0.0001f);
    XMVECTOR width = XMVectorScale(XMLoadFloat3(&m_widthVector), 1.0f / m_width);
    XMVECTOR height = XMVectorScale(XMLoadFloat3(&m_heightVector), 1.0f / m_height);
    XMMATRIX mat1 = XMMatrixIdentity();
    XMMATRIX mat2 = XMMatrixIdentity();

    // Determine the necessary rotation to align the widthVector with the +X axis.
    // Then apply the rotation to the cannonical H vector (+Y).
    if (!XMVector3NearEqual(w, width, epsilon))
    {
        float angle1 = XMVectorGetX(
            XMVector3AngleBetweenVectors(w, width)
            );

        if (XMVector3NearEqual(w, XMVectorNegate(width), epsilon))
        {
            // The angle between w and width is ~180 degrees, so
            // pick a axis of rotation perpendicular to the W vector.
            mat1 = XMMatrixRotationAxis(XMVector3Orthogonal(w), angle1);
            h = XMVector3TransformCoord(h, mat1);
        }
        else if ((angle1 * angle1) > 0.025)
        {
            // Take the cross product between the w and width vectors to
            // determine the axis to rotate that is perpendicular to both vectors.
            XMVECTOR axis1 = XMVector3Cross(w, width);
            mat1 = XMMatrixRotationAxis(axis1, angle1);
            h = XMVector3TransformCoord(h, mat1);
        }
    }

    // Determine the necessary rotation to align the transformed heightVector
    // with the transformed H vector.
    if (!XMVector3NearEqual(h, height, epsilon))
    {
        float angle2 = XMVectorGetX(
            XMVector3AngleBetweenVectors(h, height)
            );

        if (XMVector3NearEqual(h, XMVectorNegate(height), epsilon))
        {
            // The angle between the h' and height vectors is ~180 degrees,
            // so rotate around the width vector to keep it aligned in the right
            // place.
            mat2 = XMMatrixRotationAxis(width, angle2);
        }
        else if ((angle2 * angle2) > 0.025)
        {
            // Take the cross product between the h' and height vectors
            // to determine the axis to rotate that is perpendicular to both vectors.
            XMVECTOR axis2 = XMVector3Cross(h, height);
            mat2 = XMMatrixRotationAxis(axis2, angle2);
        }
    }
    XMStoreFloat4x4(&m_rotationMatrix, mat1 * mat2);

    // Generate the composite matrix to scale, rotate and translate to cannonical
    // face geometry to be positioned correctly in world space.
    XMStoreFloat4x4(
        &m_modelMatrix,
        XMMatrixScaling(m_width, m_height, 1.0f) *
        mat1 *
        mat2 *
        XMMatrixTranslation(m_position.x, m_position.y, m_position.z)
        );
}

void UpdatePosition ( ) [override, protected, virtual]

Reimplemented from GameObject.

Definition at line 65 of file Face.cpp.

{
    m_point[0] = m_position;
    XMStoreFloat3(&m_point[1], XMLoadFloat3(&m_position) + XMLoadFloat3(&m_widthVector));
    XMStoreFloat3(&m_point[3], XMLoadFloat3(&m_position) + XMLoadFloat3(&m_heightVector));
    XMStoreFloat3(&m_point[2], XMLoadFloat3(&m_point[1]) + XMLoadFloat3(&m_heightVector));

    XMStoreFloat4x4(
        &m_modelMatrix,
        XMMatrixScaling(m_width, m_height, 1.0f) *
        XMLoadFloat4x4(&m_rotationMatrix) *
        XMMatrixTranslation(m_position.x, m_position.y, m_position.z)
        );
}

Member Data Documentation

float m_height [private]

Definition at line 55 of file Face.h.

DirectX::XMFLOAT3 m_heightVector [private]

Definition at line 51 of file Face.h.

DirectX::XMFLOAT3 m_normal [private]

Definition at line 52 of file Face.h.

DirectX::XMFLOAT3 m_point[4] [private]

Definition at line 53 of file Face.h.

DirectX::XMFLOAT4X4 m_rotationMatrix [private]

Definition at line 56 of file Face.h.

float m_width [private]

Definition at line 54 of file Face.h.

DirectX::XMFLOAT3 m_widthVector [private]

Definition at line 50 of file Face.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Face.h
  • Simple3DGameDX/cppwinrt/GameContent/Face.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FaceDetection
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)

Detailed Description

Definition at line 23 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 39 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 82 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

The documentation for this class was generated from the following files:
  • CameraFaceDetection/cs/App.xaml.cs
  • CameraFaceDetection/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FaceDetection
  • MainPage
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

List of all members.

Public Member Functions

MainPage ()
Rect | GetPreviewStreamRectInControl (VideoEncodingProperties previewResolution, CaptureElement previewControl)

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
async Task | CleanupCameraAsync ()
async Task | CleanUpFaceDetectionEffectAsync ()
async Task | CleanupUiAsync ()
Rectangle | ConvertPreviewToUiRectangle (BitmapBounds faceBoxInPreviewCoordinates)
async Task | CreateFaceDetectionEffectAsync ()
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
async void | FaceDetectionButton_Click (object sender, RoutedEventArgs e)
async void | FaceDetectionEffect_FaceDetected (FaceDetectionEffect sender, FaceDetectedEventArgs args)
SimpleOrientation | GetCameraOrientation ()
async void | HardwareButtons_CameraPressed (object sender, CameraEventArgs e)
void | HighlightDetectedFaces (IReadOnlyList< DetectedFace > faces)
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | MediaCapture_RecordLimitationExceeded (MediaCapture sender)
async void | OrientationSensor_OrientationChanged (SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
async void | PhotoButton_Click (object sender, RoutedEventArgs e)
void | RegisterEventHandlers ()
void | SetFacesCanvasRotation ()
async Task | SetPreviewRotationAsync ()
async Task | SetupUiAsync ()
async Task | StartPreviewAsync ()
async Task | StartRecordingAsync ()
async Task | StopPreviewAsync ()
async Task | StopRecordingAsync ()
async void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
async Task | TakePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
async void | VideoButton_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static int | ConvertDeviceOrientationToDegrees (SimpleOrientation orientation)
static int | ConvertDisplayOrientationToDegrees (DisplayOrientations orientation)
static PhotoOrientation | ConvertOrientationToPhotoOrientation (SimpleOrientation orientation)
static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)
static async Task | ReencodeAndSavePhotoAsync (IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation)

Private Attributes

StorageFolder | _captureFolder = null
SimpleOrientation | _deviceOrientation = SimpleOrientation.NotRotated
readonly DisplayInformation | _displayInformation = DisplayInformation.GetForCurrentView()
DisplayOrientations | _displayOrientation = DisplayOrientations.Portrait
readonly DisplayRequest | _displayRequest = new DisplayRequest()
bool | _externalCamera
FaceDetectionEffect | _faceDetectionEffect
bool | _isInitialized
bool | _isRecording
MediaCapture | _mediaCapture
bool | _mirroringPreview
readonly SimpleOrientationSensor | _orientationSensor = SimpleOrientationSensor.GetDefault()
IMediaEncodingProperties | _previewProperties
readonly
SystemMediaTransportControls 		_systemMediaControls = SystemMediaTransportControls.GetForCurrentView()

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 46 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 81 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // Do not cache the state of the UI when suspending/navigating
            NavigationCacheMode = NavigationCacheMode.Disabled;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;
        }

Member Function Documentation

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 108 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                await SetupUiAsync();

                await InitializeCameraAsync();
            }
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file MainPage.xaml.cs.

        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                await CleanupUiAsync();

                deferral.Complete();
            }
        }

Concurrency::task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events.

Returns:

Definition at line 545 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("CleanupCameraAsync");

            if (_isInitialized)
            {
                // If a recording is in progress during cleanup, stop it to save the recording
                if (_isRecording)
                {
                    await StopRecordingAsync();
                }

                if (_faceDetectionEffect != null)
                {
                    await CleanUpFaceDetectionEffectAsync();
                }

                if (_previewProperties != null)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                _isInitialized = false;
            }

            if (_mediaCapture != null)
            {
                _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed -= MediaCapture_Failed;
                _mediaCapture.Dispose();
                _mediaCapture = null;
            }
        }

task< void > CleanUpFaceDetectionEffectAsync ( ) [inline, private]

Disables and removes the face detection effect, and unregisters the event handler for face detection.

Returns:

Definition at line 441 of file MainPage.xaml.cs.

        {
            // Disable detection
            _faceDetectionEffect.Enabled = false;

            // Unregister the event handler
            _faceDetectionEffect.FaceDetected -= FaceDetectionEffect_FaceDetected;

            // Remove the effect (see ClearEffectsAsync method to remove all effects from a stream)
            await _mediaCapture.RemoveEffectAsync(_faceDetectionEffect);

            // Clear the member variable that held the effect instance
            _faceDetectionEffect = null;
        }

task< void > CleanupUiAsync ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock.

Returns:

Definition at line 620 of file MainPage.xaml.cs.

        {
            UnregisterEventHandlers();

            // Show the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
            }

            // Revert orientation preferences
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
        }

int ConvertDeviceOrientationToDegrees ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the device in space
Returns:
An orientation in degrees

Definition at line 809 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return 90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return 180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return 270;
                case SimpleOrientation.NotRotated:
                default:
                    return 0;
            }
        }

int ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) [inline, static, private]

Converts the given orientation of the app on the screen to the corresponding rotation in degrees.

Parameters:
orientation The orientation of the app on the screen
Returns:
An orientation in degrees

Definition at line 830 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case DisplayOrientations.Portrait:
                    return 90;
                case DisplayOrientations.LandscapeFlipped:
                    return 180;
                case DisplayOrientations.PortraitFlipped:
                    return 270;
                case DisplayOrientations.Landscape:
                default:
                    return 0;
            }
        }

FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( SimpleOrientation orientation ) [inline, static, private]

Converts the given orientation of the device in space to the metadata that can be added to captured photos.

Parameters:
orientation The orientation of the device in space
Returns:

Definition at line 851 of file MainPage.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    return PhotoOrientation.Rotate90;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    return PhotoOrientation.Rotate180;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    return PhotoOrientation.Rotate270;
                case SimpleOrientation.NotRotated:
                default:
                    return PhotoOrientation.Normal;
            }
        }

Rectangle ConvertPreviewToUiRectangle ( BitmapBounds faceBoxInPreviewCoordinates ) [inline, private]

Takes face information defined in preview coordinates and returns one in UI coordinates, taking into account the position and size of the preview control.

Parameters:
faceBoxInPreviewCoordinates Face coordinates as retried from the FaceBox property of a DetectedFace, in preview coordinates.
Returns:
Rectangle in UI (CaptureElement) coordinates, to be used in a Canvas control.

Definition at line 979 of file MainPage.xaml.cs.

        {
            var result = new Rectangle();
            var previewStream = _previewProperties as VideoEncodingProperties;

            // If there is no available information about the preview, return an empty rectangle, as re-scaling to the screen coordinates will be impossible
            if (previewStream == null) return result;

            // Similarly, if any of the dimensions is zero (which would only happen in an error case) return an empty rectangle
            if (previewStream.Width == 0 || previewStream.Height == 0) return result;

            double streamWidth = previewStream.Width;
            double streamHeight = previewStream.Height;

            // For portrait orientations, the width and height need to be swapped
            if (_displayOrientation == DisplayOrientations.Portrait || _displayOrientation == DisplayOrientations.PortraitFlipped)
            {
                streamHeight = previewStream.Width;
                streamWidth = previewStream.Height;
            }

            // Get the rectangle that is occupied by the actual video feed
            var previewInUI = GetPreviewStreamRectInControl(previewStream, PreviewControl);

            // Scale the width and height from preview stream coordinates to window coordinates
            result.Width = (faceBoxInPreviewCoordinates.Width / streamWidth) * previewInUI.Width;
            result.Height = (faceBoxInPreviewCoordinates.Height / streamHeight) * previewInUI.Height;

            // Scale the X and Y coordinates from preview stream coordinates to window coordinates
            var x = (faceBoxInPreviewCoordinates.X / streamWidth) * previewInUI.Width;
            var y = (faceBoxInPreviewCoordinates.Y / streamHeight) * previewInUI.Height;
            Canvas.SetLeft(result, x);
            Canvas.SetTop(result, y);

            return result;
        }

task< void > CreateFaceDetectionEffectAsync ( ) [inline, private]

Adds face detection to the preview stream, registers for its events, enables it, and gets the FaceDetectionEffect instance.

Returns:

Definition at line 413 of file MainPage.xaml.cs.

        {
            // Create the definition, which will contain some initialization settings
            var definition = new FaceDetectionEffectDefinition();

            // To ensure preview smoothness, do not delay incoming samples
            definition.SynchronousDetectionEnabled = false;

            // In this scenario, choose detection speed over accuracy
            definition.DetectionMode = FaceDetectionMode.HighPerformance;

            // Add the effect to the preview stream
            _faceDetectionEffect = (FaceDetectionEffect)await _mediaCapture.AddVideoEffectAsync(definition, MediaStreamType.VideoPreview);

            // Register for face detection events
            _faceDetectionEffect.FaceDetected += FaceDetectionEffect_FaceDetected;

            // Choose the shortest interval between detection events
            _faceDetectionEffect.DesiredDetectionInterval = TimeSpan.FromMilliseconds(33);

            // Start detecting faces
            _faceDetectionEffect.Enabled = true;
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This event will fire when the page is rotated, when the DisplayInformation.AutoRotationPreferences value set in the SetupUiAsync() method cannot be not honored.

Parameters:
sender | The event source.
args | The event data.

Definition at line 192 of file MainPage.xaml.cs.

        {
            _displayOrientation = sender.CurrentOrientation;

            if (_previewProperties != null)
            {
                await SetPreviewRotationAsync();
            }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
        }

async void FaceDetectionButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 224 of file MainPage.xaml.cs.

        {
            if (_faceDetectionEffect == null || !_faceDetectionEffect.Enabled)
            {
                // Clear any rectangles that may have been left over from a previous instance of the effect
                FacesCanvas.Children.Clear();

                await CreateFaceDetectionEffectAsync();
            }
            else
            {
                await CleanUpFaceDetectionEffectAsync();
            }

            UpdateCaptureControls();
        }

async void FaceDetectionEffect_FaceDetected | ( | FaceDetectionEffect | sender,
 |  | FaceDetectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 264 of file MainPage.xaml.cs.

        {
            // Ask the UI thread to render the face bounding boxes
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => HighlightDetectedFaces(args.ResultFrame.DetectedFaces));
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed.

Parameters:
desiredPanel The desired panel on which the returned device should be mounted, if available
Returns:

Definition at line 712 of file MainPage.xaml.cs.

        {
            // Get available devices for capturing pictures
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

SimpleOrientation GetCameraOrientation ( ) [inline, private]

Calculates the current camera orientation from the device orientation by taking into account whether the camera is external or facing the user.

Returns:
The camera orientation in space, with an inverted rotation in the case the camera is mounted on the device and is facing the user

Definition at line 758 of file MainPage.xaml.cs.

        {
            if (_externalCamera)
            {
                // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
                return SimpleOrientation.NotRotated;
            }

            var result = _deviceOrientation;

            // Account for the fact that, on portrait-first devices, the camera sensor is mounted at a 90 degree offset to the native orientation
            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        result = SimpleOrientation.NotRotated;
                        break;
                    case SimpleOrientation.Rotated180DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated90DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        result = SimpleOrientation.Rotated180DegreesCounterclockwise;
                        break;
                    case SimpleOrientation.NotRotated:
                        result = SimpleOrientation.Rotated270DegreesCounterclockwise;
                        break;
                }
            }

            // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
            if (_mirroringPreview)
            {
                // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
                switch (result)
                {
                    case SimpleOrientation.Rotated90DegreesCounterclockwise:
                        return SimpleOrientation.Rotated270DegreesCounterclockwise;
                    case SimpleOrientation.Rotated270DegreesCounterclockwise:
                        return SimpleOrientation.Rotated90DegreesCounterclockwise;
                }
            }

            return result;
        }

Rect GetPreviewStreamRectInControl | ( | VideoEncodingProperties | previewResolution,
 |  | CaptureElement | previewControl |
 | ) |  |  | [inline]

Calculates the size and location of the rectangle that contains the preview stream within the preview control, when the scaling mode is Uniform.

Parameters:
previewResolution | The resolution at which the preview is running
previewControl | The control that is displaying the preview using Uniform as the scaling mode
Returns:

Definition at line 1022 of file MainPage.xaml.cs.

        {
            var result = new Rect();

            // In case this function is called before everything is initialized correctly, return an empty result
            if (previewControl == null || previewControl.ActualHeight < 1 || previewControl.ActualWidth < 1 ||
                previewResolution == null || previewResolution.Height == 0 || previewResolution.Width == 0)
            {
                return result;
            }

            var streamWidth = previewResolution.Width;
            var streamHeight = previewResolution.Height;

            // For portrait orientations, the width and height need to be swapped
            if (_displayOrientation == DisplayOrientations.Portrait || _displayOrientation == DisplayOrientations.PortraitFlipped)
            {
                streamWidth = previewResolution.Height;
                streamHeight = previewResolution.Width;
            }

            // Start by assuming the preview display area in the control spans the entire width and height both (this is corrected in the next if for the necessary dimension)
            result.Width = previewControl.ActualWidth;
            result.Height = previewControl.ActualHeight;

            // If UI is "wider" than preview, letterboxing will be on the sides
            if ((previewControl.ActualWidth / previewControl.ActualHeight > streamWidth / (double)streamHeight))
            {
                var scale = previewControl.ActualHeight / streamHeight;
                var scaledWidth = streamWidth * scale;

                result.X = (previewControl.ActualWidth - scaledWidth) / 2.0;
                result.Width = scaledWidth;
            }
            else // Preview stream is "wider" than UI, so letterboxing will be on the top+bottom
            {
                var scale = previewControl.ActualWidth / streamWidth;
                var scaledHeight = streamHeight * scale;

                result.Y = (previewControl.ActualHeight - scaledHeight) / 2.0;
                result.Height = scaledHeight;
            }

            return result;
        }

async void HardwareButtons_CameraPressed | ( | object | sender,
 |  | CameraEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 241 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

void HighlightDetectedFaces ( IReadOnlyList< DetectedFace > faces ) [inline, private]

Iterates over all detected faces, creating and adding Rectangles to the FacesCanvas as face bounding boxes.

Parameters:
faces The list of detected faces from the FaceDetected event of the effect

Definition at line 948 of file MainPage.xaml.cs.

        {
            // Remove any existing rectangles from previous events
            FacesCanvas.Children.Clear();

            // For each detected face
            for (int i = 0; i < faces.Count; i++)
            {
                // Face coordinate units are preview resolution pixels, which can be a different scale from our display resolution, so a conversion may be necessary
                Rectangle faceBoundingBox = ConvertPreviewToUiRectangle(faces[i].FaceBox);

                // Set bounding box stroke properties
                faceBoundingBox.StrokeThickness = 2;

                // Highlight the first face in the set
                faceBoundingBox.Stroke = (i == 0 ? new SolidColorBrush(Colors.Blue) : new SolidColorBrush(Colors.DeepSkyBlue));

                // Add grid to canvas containing all face UI objects
                FacesCanvas.Children.Add(faceBoundingBox);
            }

            // Update the face detection bounding box canvas orientation
            SetFacesCanvasRotation();
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI.

Returns:

Definition at line 279 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("InitializeCameraAsync");

            if (_mediaCapture == null)
            {
                // Attempt to get the front camera if one is available, but use any camera device if not
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Front);

                if (cameraDevice == null)
                {
                    Debug.WriteLine("No camera device found!");
                    return;
                }

                // Create MediaCapture and its settings
                _mediaCapture = new MediaCapture();

                // Register for a notification when video recording has reached the maximum time and when something goes wrong
                _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
                _mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await _mediaCapture.InitializeAsync(settings);
                    _isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    Debug.WriteLine("The app was denied access to the camera");
                }

                // If initialization succeeded, start the preview
                if (_isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device
                        _externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device
                        _externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel
                        _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();

                    UpdateCaptureControls();
                }
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Definition at line 255 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);

            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

async void MediaCapture_RecordLimitationExceeded ( MediaCapture sender ) [inline, private]

Definition at line 246 of file MainPage.xaml.cs.

        {
            // This is a notification that recording has to stop, and the app is expected to finalize the recording

            await StopRecordingAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 119 of file MainPage.xaml.cs.

        {
            await SetupUiAsync();

            await InitializeCameraAsync();
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 126 of file MainPage.xaml.cs.

        {
            // Handling of this event is included for completenes, as it will only fire when navigating between pages and this sample only includes one page

            await CleanupCameraAsync();

            await CleanupUiAsync();
        }

async void OrientationSensor_OrientationChanged | ( | SimpleOrientationSensor | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Occurs each time the simple orientation sensor reports a new sensor reading.

Parameters:
sender | The event source.
args | The event data.

Definition at line 172 of file MainPage.xaml.cs.

        {
            if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
            {
                // Only update the current orientation if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
                // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
                // either up or down, at the desired subject.
                //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
                //      on other panels, this logic should be adjusted.
                _deviceOrientation = args.Orientation;

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
            }
        }

async void PhotoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 204 of file MainPage.xaml.cs.

        {
            await TakePhotoAsync();
        }

static async Task ReencodeAndSavePhotoAsync | ( | IRandomAccessStream | stream,
 |  | StorageFile | file,
 |  | PhotoOrientation | photoOrientation |
 | ) |  |  | [inline, static, private]

Applies the given orientation to a photo stream and saves it as a StorageFile.

Parameters:
stream | The photo stream
file | The StorageFile in which the photo stream will be saved
photoOrientation | The orientation metadata to apply to the photo
Returns:

Definition at line 731 of file MainPage.xaml.cs.

        {
            using (var inputStream = stream)
            {
                var decoder = await BitmapDecoder.CreateAsync(inputStream);

                using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
                {
                    var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);

                    var properties = new BitmapPropertySet { { "System.Photo.Orientation", new BitmapTypedValue(photoOrientation, PropertyType.UInt16) } };

                    await encoder.BitmapProperties.SetPropertiesAsync(properties);
                    await encoder.FlushAsync();
                }
            }
        }

void RegisterEventHandlers ( ) [inline, private]

Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation.

Definition at line 668 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
            }

            // If there is an orientation sensor present on the device, register for notifications
            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;

                // Update orientation of buttons with the current orientation
                UpdateButtonOrientation();
            }

            _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
        }

void SetFacesCanvasRotation ( ) [inline, private]

Uses the current display orientation to calculate the rotation transformation to apply to the face detection bounding box canvas and mirrors it if the preview is being mirrored.

Definition at line 899 of file MainPage.xaml.cs.

        {
            // Calculate how much to rotate the canvas
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored, just like in SetPreviewRotationAsync
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Apply the rotation
            var transform = new RotateTransform { Angle = rotationDegrees };
            FacesCanvas.RenderTransform = transform;

            var previewArea = GetPreviewStreamRectInControl(_previewProperties as VideoEncodingProperties, PreviewControl);

            // For portrait mode orientations, swap the width and height of the canvas after the rotation, so the control continues to overlap the preview
            if (_displayOrientation == DisplayOrientations.Portrait || _displayOrientation == DisplayOrientations.PortraitFlipped)
            {
                FacesCanvas.Width = previewArea.Height;
                FacesCanvas.Height = previewArea.Width;

                // The position of the canvas also needs to be adjusted, as the size adjustment affects the centering of the control
                Canvas.SetLeft(FacesCanvas, previewArea.X - (previewArea.Height - previewArea.Width) / 2);
                Canvas.SetTop(FacesCanvas, previewArea.Y - (previewArea.Width - previewArea.Height) / 2);
            }
            else
            {
                FacesCanvas.Width = previewArea.Width;
                FacesCanvas.Height = previewArea.Height;

                Canvas.SetLeft(FacesCanvas, previewArea.X);
                Canvas.SetTop(FacesCanvas, previewArea.Y);
            }

            // Also mirror the canvas if the preview is being mirrored
            FacesCanvas.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview.

Returns:

Definition at line 368 of file MainPage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device
            if (_externalCamera) return;

            // Calculate which way and how far to rotate the preview
            int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);

            // The rotation direction needs to be inverted if the preview is being mirrored
            if (_mirroringPreview)
            {
                rotationDegrees = (360 - rotationDegrees) % 360;
            }

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, rotationDegrees);
            await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

task< void > SetupUiAsync ( ) [inline, private]

Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors.

Returns:

Definition at line 591 of file MainPage.xaml.cs.

        {
            // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

            // Hide the status bar
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
            }

            // Populate orientation variables with the current state
            _displayOrientation = _displayInformation.CurrentOrientation;
            if (_orientationSensor != null)
            {
                _deviceOrientation = _orientationSensor.GetCurrentOrientation();
            }

            RegisterEventHandlers();

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on.

Returns:

Definition at line 343 of file MainPage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running
            _displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary
            PreviewControl.Source = _mediaCapture;
            PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            // Start the preview
            await _mediaCapture.StartPreviewAsync();
            _previewProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);

            // Initialize the preview to the current orientation
            if (_previewProperties != null)
            {
                _displayOrientation = _displayInformation.CurrentOrientation;

                await SetPreviewRotationAsync();
            }
        }

task< void > StartRecordingAsync ( ) [inline, private]

Records an MP4 video to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 500 of file MainPage.xaml.cs.

        {
            try
            {
                // Create storage file for the capture
                var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);

                var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

                // Calculate rotation angle, taking mirroring into account if necessary
                var rotationAngle = 360 - ConvertDeviceOrientationToDegrees(GetCameraOrientation());
                encodingProfile.Video.Properties.Add(RotationKey, PropertyValue.CreateInt32(rotationAngle));

                Debug.WriteLine("Starting recording to " + videoFile.Path);

                await _mediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);
                _isRecording = true;

                Debug.WriteLine("Started recording!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
            }
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes.

Returns:

Definition at line 392 of file MainPage.xaml.cs.

        {
            // Stop the preview
            _previewProperties = null;
            await _mediaCapture.StopPreviewAsync();

            // Use the dispatcher because this method is sometimes called from non-UI threads
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Cleanup the UI
                PreviewControl.Source = null;

                // Allow the device screen to sleep now that the preview is stopped
                _displayRequest.RequestRelease();
            });
        }

task< void > StopRecordingAsync ( ) [inline, private]

Stops recording a video.

Returns:

Definition at line 531 of file MainPage.xaml.cs.

        {
            Debug.WriteLine("Stopping recording...");

            _isRecording = false;
            await _mediaCapture.StopRecordAsync();

            Debug.WriteLine("Stopped recording!");
        }

async void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

In the event of the app being minimized this method handles media property change events.

If the app receives a mute notification, it is no longer in the foregroud.

Parameters:
sender
args

Definition at line 146 of file MainPage.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Only handle this event if this page is currently being displayed
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
                {
                    // Check to see if the app is being muted. If so, it is being minimized.
                    // Otherwise if it is not initialized, it is being brought into focus.
                    if (sender.SoundLevel == SoundLevel.Muted)
                    {
                        await CleanupCameraAsync();
                    }
                    else if (!_isInitialized)
                    {
                        await InitializeCameraAsync();
                    }
                }
            });
        }

task< void > TakePhotoAsync ( ) [inline, private]

Takes a photo to a StorageFile and adds rotation metadata to it.

Returns:

Definition at line 460 of file MainPage.xaml.cs.

        {
            // While taking a photo, keep the video button enabled only if the camera supports simultaneously taking pictures and recording video
            VideoButton.IsEnabled = _mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported;

            // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
            VideoButton.Opacity = VideoButton.IsEnabled ? 1 : 0;

            var stream = new InMemoryRandomAccessStream();

            Debug.WriteLine("Taking photo...");
            await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);

            try
            {
                var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);

                Debug.WriteLine("Photo taken! Saving to " + file.Path);

                var photoOrientation = ConvertOrientationToPhotoOrientation(GetCameraOrientation());

                await ReencodeAndSavePhotoAsync(stream, file, photoOrientation);

                Debug.WriteLine("Photo saved!");
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                Debug.WriteLine("Exception when taking a photo: " + ex.ToString());
            }

            // Done taking a photo, so re-enable the button
            VideoButton.IsEnabled = true;
            VideoButton.Opacity = 1;
        }

void UnregisterEventHandlers ( ) [inline, private]

Unregisters event handlers for hardware buttons and orientation sensors.

Definition at line 691 of file MainPage.xaml.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
            }

            if (_orientationSensor != null)
            {
                _orientationSensor.OrientationChanged -= OrientationSensor_OrientationChanged;
            }

            _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
            _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
        }

void UpdateButtonOrientation ( ) [inline, private]

Uses the current device orientation in space and page orientation on the screen to calculate the rotation transformation to apply to the controls.

Returns:
An angle in degrees to rotate the controls so they remain upright to the user regardless of device and page orientation

Definition at line 873 of file MainPage.xaml.cs.

        {
            int device = ConvertDeviceOrientationToDegrees(_deviceOrientation);
            int display = ConvertDisplayOrientationToDegrees(_displayOrientation);

            if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
            {
                device -= 90;
            }

            // Combine both rotations and make sure that 0 <= result < 360
            var angle = (360 + display + device) % 360;

            // Rotate the buttons in the UI to match the rotation of the device
            var transform = new RotateTransform { Angle = angle };

            // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
            PhotoButton.RenderTransform = transform;
            VideoButton.RenderTransform = transform;
            FaceDetectionButton.RenderTransform = transform;
        }

void UpdateCaptureControls ( ) [inline, private]

This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device.

Definition at line 637 of file MainPage.xaml.cs.

        {
            // The buttons should only be enabled if the preview started sucessfully
            PhotoButton.IsEnabled = _previewProperties != null;
            VideoButton.IsEnabled = _previewProperties != null;
            FaceDetectionButton.IsEnabled = _previewProperties != null;

            // Update the face detection icon depending on whether the effect exists or not
            FaceDetectionDisabledIcon.Visibility = (_faceDetectionEffect == null || !_faceDetectionEffect.Enabled) ? Visibility.Visible : Visibility.Collapsed;
            FaceDetectionEnabledIcon.Visibility = (_faceDetectionEffect != null && _faceDetectionEffect.Enabled) ? Visibility.Visible : Visibility.Collapsed;

            // Hide the face detection canvas and clear it
            FacesCanvas.Visibility = (_faceDetectionEffect != null && _faceDetectionEffect.Enabled) ? Visibility.Visible : Visibility.Collapsed;

            // Update recording button to show "Stop" icon instead of red "Record" icon when recording
            StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
            StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;

            // If the camera doesn't support simultaneosly taking pictures and recording video, disable the photo button on record
            if (_isInitialized && !_mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported)
            {
                PhotoButton.IsEnabled = !_isRecording;

                // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
                PhotoButton.Opacity = PhotoButton.IsEnabled ? 1 : 0;
            }
        }

async void VideoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 209 of file MainPage.xaml.cs.

        {
            if (!_isRecording)
            {
                await StartRecordingAsync();
            }
            else
            {
                await StopRecordingAsync();
            }

            // After starting or stopping video recording, update the UI to reflect the MediaCapture state
            UpdateCaptureControls();
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 59 of file MainPage.xaml.cs.

SimpleOrientation _deviceOrientation = SimpleOrientation.NotRotated [private]

Definition at line 51 of file MainPage.xaml.cs.

readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 49 of file MainPage.xaml.cs.

DisplayOrientations _displayOrientation = DisplayOrientations.Portrait [private]

Definition at line 52 of file MainPage.xaml.cs.

readonly DisplayRequest _displayRequest = new DisplayRequest() [private]

Definition at line 62 of file MainPage.xaml.cs.

bool _externalCamera [private]

Definition at line 75 of file MainPage.xaml.cs.

FaceDetectionEffect _faceDetectionEffect [private]

Definition at line 77 of file MainPage.xaml.cs.

bool _isInitialized [private]

Definition at line 70 of file MainPage.xaml.cs.

bool _isRecording [private]

Definition at line 71 of file MainPage.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 68 of file MainPage.xaml.cs.

bool _mirroringPreview [private]

Definition at line 74 of file MainPage.xaml.cs.

readonly SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault() [private]

Definition at line 50 of file MainPage.xaml.cs.

IMediaEncodingProperties _previewProperties [private]

Definition at line 69 of file MainPage.xaml.cs.

readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView() [private]

Definition at line 65 of file MainPage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 56 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraFaceDetection/cs/MainPage.xaml.cs
  • CameraFaceDetection/cpp/MainPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FaceDetection
  • sealed
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class.

#include "App.xaml.h"

List of all members.

Public Member Functions

virtual | ~MainPage ()
MainPage ()

Public Attributes

Windows::Graphics::Imaging::BitmapEncoder | Encoder
Windows::Storage::StorageFile | File
Windows::Storage::FileProperties::PhotoOrientation | Orientation

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Private Member Functions

void | Application_Resuming (Object^sender, Object^args)
void | Application_Suspending (Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
Concurrency::task< void > | CleanupCameraAsync ()
Concurrency::task< void > | CleanUpFaceDetectionEffectAsync ()
Concurrency::task< void > | CleanupUiAsync ()
int | ConvertDeviceOrientationToDegrees (Windows::Devices::Sensors::SimpleOrientation orientation)
int | ConvertDisplayOrientationToDegrees (Windows::Graphics::Display::DisplayOrientations orientation)
Windows::Storage::FileProperties::PhotoOrientation | ConvertOrientationToPhotoOrientation (Windows::Devices::Sensors::SimpleOrientation orientation)
Windows::UI::Xaml::Shapes::Rectangle | ConvertPreviewToUiRectangle (Windows::Graphics::Imaging::BitmapBounds faceBoxInPreviewCoordinates)
Concurrency::task< void > | CreateFaceDetectionEffectAsync ()
void | DisplayInformation_OrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Object^args)
Concurrency::task< void > | EmptyTask ()
void | FaceDetectionButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | FaceDetectionEffect_FaceDetected (Windows::Media::Core::FaceDetectionEffect^sender, Windows::Media::Core::FaceDetectedEventArgs^args)
Concurrency::task
< Windows::Devices::Enumeration::DeviceInformation^> 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel panel)
Windows::Devices::Sensors::SimpleOrientation | GetCameraOrientation ()
Windows::Foundation::Rect | GetPreviewStreamRectInControl (Windows::Media::MediaProperties::VideoEncodingProperties^previewResolution, Windows::UI::Xaml::Controls::CaptureElement^previewControl)
void | HardwareButtons_CameraPress (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
void | HardwareButtons_CameraPressed (Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^)
void | HighlightDetectedFaces (Windows::Foundation::Collections::IVectorView< Windows::Media::FaceAnalysis::DetectedFace^>^faces)
Concurrency::task< void > | InitializeCameraAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)
void | MediaCapture_RecordLimitationExceeded (Windows::Media::Capture::MediaCapture^currentCaptureObject)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OrientationSensor_OrientationChanged (Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^)
void | PhotoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | ReencodeAndSavePhotoAsync (Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation)
void | RegisterEventHandlers ()
void | SetFacesCanvasRotation ()
Concurrency::task< void > | SetPreviewRotationAsync ()
Concurrency::task< void > | SetupUiAsync ()
Concurrency::task< void > | StartPreviewAsync ()
Concurrency::task< void > | StartRecordingAsync ()
Concurrency::task< void > | StopPreviewAsync ()
Concurrency::task< void > | StopRecordingAsync ()
void | SystemMediaControls_PropertyChanged (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args)
Concurrency::task< void > | TakePhotoAsync ()
void | UnregisterEventHandlers ()
void | UpdateButtonOrientation ()
void | UpdateCaptureControls ()
void | VideoButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | WriteException (Platform::Exception^ex)
void | WriteLine (Platform::String^str)

Private Attributes

Windows::Foundation::EventRegistrationToken | _applicationResumingEventToken
Windows::Foundation::EventRegistrationToken | _applicationSuspendingEventToken
Windows::Storage::StorageFolder | _captureFolder
Windows::Devices::Sensors::SimpleOrientation | _deviceOrientation
Windows::Graphics::Display::DisplayInformation | _displayInformation
Windows::Foundation::EventRegistrationToken | _displayInformationEventToken
Windows::Graphics::Display::DisplayOrientations | _displayOrientation
Windows::System::Display::DisplayRequest | _displayRequest
bool | _externalCamera
Windows::Foundation::EventRegistrationToken | _faceDetectedEventToken
Windows::Media::Core::FaceDetectionEffect | _faceDetectionEffect
Windows::Foundation::EventRegistrationToken | _hardwareCameraButtonEventToken
bool | _isInitialized
bool | _isRecording
Platform::Agile
< Windows::Media::Capture::MediaCapture^> 		_mediaCapture
Windows::Foundation::EventRegistrationToken | _mediaCaptureFailedEventToken
Windows::Foundation::EventRegistrationToken | _mediaControlPropChangedEventToken
bool | _mirroringPreview
Windows::Foundation::EventRegistrationToken | _orientationChangedEventToken
Windows::Devices::Sensors::SimpleOrientationSensor | _orientationSensor
Windows::Media::MediaProperties::IMediaEncodingProperties | _previewProperties
Windows::Foundation::EventRegistrationToken | _recordLimitationExceededEventToken
Windows::Media::SystemMediaTransportControls | _systemMediaControls
const GUID | RotationKey

Detailed Description

Definition at line 21 of file App.xaml.h.

Constructor & Destructor Documentation

virtual ~MainPage ( ) [virtual]

Member Function Documentation

void Application_Resuming | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void Application_Suspending | ( | Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> CleanupCameraAsync ( ) [private]
Concurrency::task<void> CleanUpFaceDetectionEffectAsync ( ) [private]
Concurrency::task<void> CleanupUiAsync ( ) [private]
int ConvertDeviceOrientationToDegrees ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
int ConvertDisplayOrientationToDegrees ( Windows::Graphics::Display::DisplayOrientations orientation ) [private]
Windows::Storage::FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation ( Windows::Devices::Sensors::SimpleOrientation orientation ) [private]
Windows::UI::Xaml::Shapes::Rectangle ConvertPreviewToUiRectangle ( Windows::Graphics::Imaging::BitmapBounds faceBoxInPreviewCoordinates ) [private]
Concurrency::task<void> CreateFaceDetectionEffectAsync ( ) [private]
void DisplayInformation_OrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
Concurrency::task<void> EmptyTask ( ) [private]
void FaceDetectionButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void FaceDetectionEffect_FaceDetected | ( | Windows::Media::Core::FaceDetectionEffect^ | sender,
 |  | Windows::Media::Core::FaceDetectedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel panel ) [private]
Windows::Devices::Sensors::SimpleOrientation GetCameraOrientation ( ) [private]
Windows::Foundation::Rect GetPreviewStreamRectInControl | ( | Windows::Media::MediaProperties::VideoEncodingProperties^ | previewResolution,
 |  | Windows::UI::Xaml::Controls::CaptureElement^ | previewControl |
 | ) |  |  | [private]
void HardwareButtons_CameraPress | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
void HardwareButtons_CameraPressed | ( | Platform::Object^ | ,
 |  | Windows::Phone::UI::Input::CameraEventArgs^ |  |
 | ) |  |  | [private]
void HighlightDetectedFaces ( Windows::Foundation::Collections::IVectorView< Windows::Media::FaceAnalysis::DetectedFace^>^ faces ) [private]
Concurrency::task<void> InitializeCameraAsync ( ) [private]
MainPage ( )
void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture^ | currentCaptureObject,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs^ | errorEventArgs |
 | ) |  |  | [private]
void MediaCapture_RecordLimitationExceeded ( Windows::Media::Capture::MediaCapture^ currentCaptureObject ) [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OrientationSensor_OrientationChanged | ( | Windows::Devices::Sensors::SimpleOrientationSensor^ | ,
 |  | Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^ |  |
 | ) |  |  | [private]
void PhotoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> ReencodeAndSavePhotoAsync | ( | Windows::Storage::Streams::IRandomAccessStream^ | stream,
 |  | Windows::Storage::StorageFile^ | file,
 |  | Windows::Storage::FileProperties::PhotoOrientation | photoOrientation |
 | ) |  |  | [private]
void RegisterEventHandlers ( ) [private]
void SetFacesCanvasRotation ( ) [private]
Concurrency::task<void> SetPreviewRotationAsync ( ) [private]
Concurrency::task<void> SetupUiAsync ( ) [private]
Concurrency::task<void> StartPreviewAsync ( ) [private]
Concurrency::task<void> StartRecordingAsync ( ) [private]
Concurrency::task<void> StopPreviewAsync ( ) [private]
Concurrency::task<void> StopRecordingAsync ( ) [private]
void SystemMediaControls_PropertyChanged | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ | args |
 | ) |  |  | [private]
Concurrency::task<void> TakePhotoAsync ( ) [private]
void UnregisterEventHandlers ( ) [private]
void UpdateButtonOrientation ( ) [private]
void UpdateCaptureControls ( ) [private]
void VideoButton_Click | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void WriteException ( Platform::Exception^ ex ) [private]
void WriteLine ( Platform::String^ str ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationResumingEventToken [private]

Definition at line 63 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken [private]

Definition at line 62 of file MainPage.xaml.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 59 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientation _deviceOrientation [private]

Definition at line 33 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayInformation _displayInformation [private]

Definition at line 32 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _displayInformationEventToken [private]

Definition at line 65 of file MainPage.xaml.h.

Windows::Graphics::Display::DisplayOrientations _displayOrientation [private]

Definition at line 34 of file MainPage.xaml.h.

Windows::System::Display::DisplayRequest _displayRequest [private]

Definition at line 37 of file MainPage.xaml.h.

bool _externalCamera [private]

Definition at line 49 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _faceDetectedEventToken [private]

Definition at line 70 of file MainPage.xaml.h.

Windows::Media::Core::FaceDetectionEffect _faceDetectionEffect [private]

Definition at line 52 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken [private]

Definition at line 69 of file MainPage.xaml.h.

bool _isInitialized [private]

Definition at line 45 of file MainPage.xaml.h.

bool _isRecording [private]

Definition at line 46 of file MainPage.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 43 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 67 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken [private]

Definition at line 64 of file MainPage.xaml.h.

bool _mirroringPreview [private]

Definition at line 50 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _orientationChangedEventToken [private]

Definition at line 68 of file MainPage.xaml.h.

Windows::Devices::Sensors::SimpleOrientationSensor _orientationSensor [private]

Definition at line 31 of file MainPage.xaml.h.

Windows::Media::MediaProperties::IMediaEncodingProperties _previewProperties [private]

Definition at line 44 of file MainPage.xaml.h.

Windows::Foundation::EventRegistrationToken _recordLimitationExceededEventToken [private]

Definition at line 66 of file MainPage.xaml.h.

Windows::Media::SystemMediaTransportControls _systemMediaControls [private]

Definition at line 40 of file MainPage.xaml.h.

Windows::Graphics::Imaging::BitmapEncoder Encoder

Definition at line 22 of file MainPage.xaml.h.

Windows::Storage::StorageFile File

Definition at line 23 of file MainPage.xaml.h.

Windows::Storage::FileProperties::PhotoOrientation Orientation

Definition at line 24 of file MainPage.xaml.h.

const GUID RotationKey [private]

Definition at line 56 of file MainPage.xaml.h.

The documentation for this class was generated from the following files:
  • CameraFaceDetection/cpp/App.xaml.h
  • CameraFaceDetection/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FaceMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

FaceMesh Class Reference

#include "FaceMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

FaceMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device)

Detailed Description

Definition at line 24 of file FaceMesh.h.

Constructor & Destructor Documentation

FaceMesh ( _In_ winrt::com_ptr< ID3D11Device3 > const & device )

Definition at line 18 of file FaceMesh.cpp.

{
    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    PNTVertex target_vertices[] =
    {
        {XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(1.0f, 1.0f)},
        {XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 1.0f)},
        {XMFLOAT3(1.0f, 1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(1.0f, 0.0f)}
    };
    WORD target_indices[] =
    {
        0, 1, 2,
        0, 2, 3,
        0, 2, 1,
        0, 3, 2
    };

    m_vertexCount = 4;
    m_indexCount = 12;

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = target_vertices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(WORD) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = target_indices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/FaceMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/FaceMesh.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccessHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • AccessHandler
Public Member Functions | Properties

AccessHandler Class Reference

Access handler class for Felica based ICC. More...

List of all members.

Public Member Functions

AccessHandler (SmartCardConnection ScConnection)
async Task< byte[]> | GetUidAsync ()
async Task< byte[]> | ReadAsync (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)
async Task< byte[]> | TransparentExchangeAsync (byte[] commandData)
async Task | WriteAsync (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)

Properties

SmartCardConnection | connectionObject [get, set]

Detailed Description

It provides wrappers for different Felica commands

Definition at line 26 of file FelicaAccessHandler.cs.

Constructor & Destructor Documentation

AccessHandler ( SmartCardConnection ScConnection ) [inline]

Class constructor.

Parameters:
ScConnection connection object to a Felica ICC

Definition at line 38 of file FelicaAccessHandler.cs.

        {
            connectionObject = ScConnection;
        }

Member Function Documentation

async Task<byte[]> GetUidAsync ( ) [inline]

Wrapper method get the Felica UID.

Returns:
byte array UID

Definition at line 138 of file FelicaAccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new Felica.GetUid());

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure getting UID of Felica card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> ReadAsync | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList |
 | ) |  |  | [inline]

Wrapper method to read data from the felica card.

Parameters:
serviceCount | The number of service
serviceCodeList | The service code list in little endian format
Parameters:
blockCount The number of blocks to read
Parameters:
blockList The list of blocks to be read. Must be multiples of 2 or 3.
Returns:
byte array of the read data

Definition at line 62 of file FelicaAccessHandler.cs.

        {
            if (serviceCount != 1 || serviceCodeList.Length != 2)
            {
                throw new NotSupportedException();
            }

            var apduRes = await connectionObject.TransceiveAsync(new Felica.Check(serviceCount, serviceCodeList, blockCount, blockList));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure reading Felica card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> TransparentExchangeAsync ( byte[] commandData ) [inline]

Wrapper method to perform transparent transceive data to the felica card.

Parameters:
commandData The command to send to the felica card
Returns:
byte array of the read data

Definition at line 126 of file FelicaAccessHandler.cs.

        {
            byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);

            return responseData;
        }

async Task WriteAsync | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList,
 |  | byte[] | blockData |
 | ) |  |  | [inline]

Wrapper method to write data to the felica card.

Parameters:
serviceCount | The number of service
serviceCodeList | The service code list in little endian format
Parameters:
blockCount The number of blocks to read
Parameters:
blockList The list of blocks to be read. Must be multiples of 2 or 3.

/

Parameters:
blockData The data to write for the corresponding blocks. Must be multiple of 16 of the block count.

Definition at line 98 of file FelicaAccessHandler.cs.

        {
            if (serviceCount != 1 || serviceCodeList.Length != 2)
            {
                throw new NotSupportedException();
            }

            if (blockData.Length != blockCount * 16)
            {
                throw new InvalidOperationException("Invalid blockData size");
            }

            var apduRes = await connectionObject.TransceiveAsync(new Felica.Update(serviceCount, serviceCodeList, blockCount, blockList, blockData));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure writing Felica card, " + apduRes.ToString());
            }
        }

Property Documentation

SmartCardConnection connectionObject [get, set, private]

connection object to smart card

Definition at line 31 of file FelicaAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • ApduResponse
Public Member Functions

ApduResponse Class Reference

Felica response APDU. More...

Inherits Pcsc::ApduResponse.

List of all members.

Public Member Functions

ApduResponse ()

Detailed Description

Definition at line 109 of file FelicaCommands.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Reimplemented from ApduResponse.

Definition at line 111 of file FelicaCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaCommands.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Check Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • Check
Public Member Functions | Properties | Static Private Member Functions

Check Class Reference

Felica Check command when sent to the card the card is expected to read the byte of blocks specified in the block list. More...

Inherits Pcsc::ReadBinary.

List of all members.

Public Member Functions

Check (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)

Properties

byte | BlockCount [get, set]
byte[] | BlockList [get, set]
byte[] | ServiceCodeList [get, set]
byte | ServiceCount [get, set]

Static Private Member Functions

static byte[] | GetDataIn (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)

Detailed Description

The service code should be in little endian format.

Definition at line 22 of file FelicaCommands.cs.

Constructor & Destructor Documentation

Check | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList |
 | ) |  |  | [inline]

Definition at line 30 of file FelicaCommands.cs.

            : base(0, 0)
        {
            ServiceCount = serviceCount;
            ServiceCodeList = serviceCodeList;
            BlockCount = blockCount;
            BlockList = blockList;
            base.CommandData = GetDataIn(serviceCount, serviceCodeList, blockCount, blockList);
        }

Member Function Documentation

static byte [] GetDataIn | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList |
 | ) |  |  | [inline, static, private]

Definition at line 40 of file FelicaCommands.cs.

        {
            DataWriter dataWriter = new DataWriter();

            dataWriter.WriteByte(serviceCount);
            dataWriter.WriteBytes(serviceCodeList);
            dataWriter.WriteByte(blockCount);
            dataWriter.WriteBytes(blockList);

            return dataWriter.DetachBuffer().ToArray();
        }

Property Documentation

byte BlockCount [get, set]

Definition at line 27 of file FelicaCommands.cs.

byte [] BlockList [get, set]

Definition at line 28 of file FelicaCommands.cs.

byte [] ServiceCodeList [get, set]

Definition at line 25 of file FelicaCommands.cs.

byte ServiceCount [get, set]

Definition at line 24 of file FelicaCommands.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaCommands.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetHistoricalBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • GetHistoricalBytes
Public Member Functions

GetHistoricalBytes Class Reference

Felica GetHistoricalBytes command. More...

Inherits Pcsc::GetHistoricalBytes.

List of all members.

Public Member Functions

GetHistoricalBytes ()

Detailed Description

Definition at line 99 of file FelicaCommands.cs.

Constructor & Destructor Documentation

GetHistoricalBytes ( ) [inline]

Reimplemented from GetHistoricalBytes.

Definition at line 101 of file FelicaCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaCommands.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetUid Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • GetUid
Public Member Functions

GetUid Class Reference

Felica GetUid command. More...

Inherits Pcsc::GetUid.

List of all members.

Public Member Functions

GetUid ()

Detailed Description

Definition at line 89 of file FelicaCommands.cs.

Constructor & Destructor Documentation

GetUid ( ) [inline]

Reimplemented from GetUid.

Definition at line 91 of file FelicaCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaCommands.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Update Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Felica
  • Update
Public Member Functions | Properties | Static Private Member Functions

Update Class Reference

Felica Update command when sent to the card the card is expected to write the byte of blocks specified in the block list. More...

Inherits Pcsc::UpdateBinary.

List of all members.

Public Member Functions

Update (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)

Properties

byte | BlockCount [get, set]
byte[] | BlockList [get, set]
byte[] | ServiceCodeList [get, set]
byte | ServiceCount [get, set]

Static Private Member Functions

static byte[] | GetDataIn (byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)

Detailed Description

The service code should be in little endian format.

Definition at line 56 of file FelicaCommands.cs.

Constructor & Destructor Documentation

Update | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList,
 |  | byte[] | blockData |
 | ) |  |  | [inline]

Definition at line 64 of file FelicaCommands.cs.

            : base(0, GetDataIn(serviceCount, serviceCodeList, blockCount, blockList, blockData))
        {
            ServiceCount = serviceCount;
            ServiceCodeList = serviceCodeList;
            BlockCount = blockCount;
            BlockList = blockList;
        }

Member Function Documentation

static byte [] GetDataIn | ( | byte | serviceCount,
 |  | byte[] | serviceCodeList,
 |  | byte | blockCount,
 |  | byte[] | blockList,
 |  | byte[] | blockData |
 | ) |  |  | [inline, static, private]

Definition at line 73 of file FelicaCommands.cs.

        {
            DataWriter dataWriter = new DataWriter();

            dataWriter.WriteByte(serviceCount);
            dataWriter.WriteBytes(serviceCodeList);
            dataWriter.WriteByte(blockCount);
            dataWriter.WriteBytes(blockList);
            dataWriter.WriteBytes(blockData);

            return dataWriter.DetachBuffer().ToArray();
        }

Property Documentation

byte BlockCount [get, set]

Definition at line 61 of file FelicaCommands.cs.

byte [] BlockList [get, set]

Definition at line 62 of file FelicaCommands.cs.

byte [] ServiceCodeList [get, set]

Definition at line 59 of file FelicaCommands.cs.

byte ServiceCount [get, set]

Definition at line 58 of file FelicaCommands.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/FelicaCommands.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CachedFileUpdater_Local Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • CachedFileUpdater_Local
Public Member Functions | Private Member Functions

CachedFileUpdater_Local Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CachedFileUpdater_Local ()

Private Member Functions

void | FileIsCurrentButton_Click (object sender, RoutedEventArgs e)
async void | OutputFileAsync (StorageFile file)
async void | ProvideUpdatedVersionButton_Click (object sender, RoutedEventArgs e)
void | UpdateUI (UIStatus uiStatus)

Detailed Description

Definition at line 24 of file CachedFileUpdater_Local.xaml.cs.

Constructor & Destructor Documentation

CachedFileUpdater_Local ( ) [inline]

Definition at line 26 of file CachedFileUpdater_Local.xaml.cs.

        {
            this.InitializeComponent();
            FileIsCurrentButton.Click += new RoutedEventHandler(FileIsCurrentButton_Click);
            ProvideUpdatedVersionButton.Click += new RoutedEventHandler(ProvideUpdatedVersionButton_Click);
        }

Member Function Documentation

void FileIsCurrentButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file CachedFileUpdater_Local.xaml.cs.

        {
            FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
            FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;

            OutputFileAsync(fileUpdateRequest.File);

            fileUpdateRequest.Status = FileUpdateStatus.Complete;
            fileUpdateRequestDeferral.Complete();

            UpdateUI(CachedFileUpdaterPage.Current.cachedFileUpdaterUI.UIStatus);
        }

async void OutputFileAsync ( StorageFile file ) [inline, private]

Definition at line 33 of file CachedFileUpdater_Local.xaml.cs.

        {
            string fileContent = await FileIO.ReadTextAsync(file);
            OutputFileName.Text = String.Format(@"Received file: {0}", file.Name);
            OutputFileContent.Text = String.Format(@"File content:{0}{1}", System.Environment.NewLine, fileContent);
        }

async void ProvideUpdatedVersionButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file CachedFileUpdater_Local.xaml.cs.

        {
            FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
            FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;

            await FileIO.AppendTextAsync(fileUpdateRequest.File, String.Format(@"{0}New content added @ {1}", System.Environment.NewLine, DateTime.Now.ToString()));
            OutputFileAsync(fileUpdateRequest.File);

            fileUpdateRequest.Status = FileUpdateStatus.Complete;
            fileUpdateRequestDeferral.Complete();

            UpdateUI(CachedFileUpdaterPage.Current.cachedFileUpdaterUI.UIStatus);
        }

void UpdateUI ( UIStatus uiStatus ) [inline, private]

Definition at line 40 of file CachedFileUpdater_Local.xaml.cs.

        {
            if (uiStatus == UIStatus.Complete)
            {
                FileIsCurrentButton.IsEnabled = false;
                ProvideUpdatedVersionButton.IsEnabled = false;
            }
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/CachedFileUpdater_Local.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CachedFileUpdater_Remote Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • CachedFileUpdater_Remote
Public Member Functions | Private Member Functions

CachedFileUpdater_Remote Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CachedFileUpdater_Remote ()

Private Member Functions

async void | OutputFileAsync (StorageFile file)
void | OverwriteButton_Click (object sender, RoutedEventArgs e)
async void | RenameButton_Click (object sender, RoutedEventArgs e)
void | UpdateUI ()

Detailed Description

Definition at line 24 of file CachedFileUpdater_Remote.xaml.cs.

Constructor & Destructor Documentation

CachedFileUpdater_Remote ( ) [inline]

Definition at line 26 of file CachedFileUpdater_Remote.xaml.cs.

        {
            this.InitializeComponent();
            OverwriteButton.Click += new RoutedEventHandler(OverwriteButton_Click);
            RenameButton.Click += new RoutedEventHandler(RenameButton_Click);
        }

Member Function Documentation

async void OutputFileAsync ( StorageFile file ) [inline, private]

Definition at line 33 of file CachedFileUpdater_Remote.xaml.cs.

        {
            string fileContent = await FileIO.ReadTextAsync(file);
            OutputFileName.Text = String.Format(@"File Name: {0}", file.Name);
            OutputFileContent.Text = String.Format(@"File Content:{0}{1}", System.Environment.NewLine, fileContent);
        }

void OverwriteButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file CachedFileUpdater_Remote.xaml.cs.

        {
            FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
            FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;

            // update the remote version of file...
            // Printing the file content
            this.OutputFileAsync(fileUpdateRequest.File);

            fileUpdateRequest.Status = FileUpdateStatus.Complete;
            fileUpdateRequestDeferral.Complete();

            UpdateUI();
        }

async void RenameButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file CachedFileUpdater_Remote.xaml.cs.

        {
            FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
            FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;

            StorageFile file = await fileUpdateRequest.File.CopyAsync(ApplicationData.Current.LocalFolder, fileUpdateRequest.File.Name, NameCollisionOption.GenerateUniqueName);
            CachedFileUpdater.SetUpdateInformation(file, "CachedFile", ReadActivationMode.NotNeeded, WriteActivationMode.AfterWrite, CachedFileOptions.RequireUpdateOnAccess);
            fileUpdateRequest.UpdateLocalFile(file);

            this.OutputFileAsync(file);

            fileUpdateRequest.Status = FileUpdateStatus.CompleteAndRenamed;
            fileUpdateRequestDeferral.Complete();

            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Definition at line 40 of file CachedFileUpdater_Remote.xaml.cs.

        {
            OverwriteButton.IsEnabled = false;
            RenameButton.IsEnabled = false;
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/CachedFileUpdater_Remote.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileOpenPicker_PickAppFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileOpenPicker_PickAppFile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileOpenPicker_PickAppFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileOpenPicker_PickAppFile ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddLocalFileButton_Click (object sender, RoutedEventArgs e)
void | RemoveLocalFileButton_Click (object sender, RoutedEventArgs e)
void | UpdateButtonState (bool fileInBasket)

Private Attributes

CoreDispatcher | dispatcher = Window.Current.Dispatcher
FileOpenPickerUI | fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI
const string | id = "MyLocalFile"

Detailed Description

Definition at line 28 of file FileOpenPicker_PickAppFile.xaml.cs.

Constructor & Destructor Documentation

FileOpenPicker_PickAppFile ( ) [inline]

Definition at line 34 of file FileOpenPicker_PickAppFile.xaml.cs.

        {
            this.InitializeComponent();
            AddLocalFileButton.Click += new RoutedEventHandler(AddLocalFileButton_Click);
            RemoveLocalFileButton.Click += new RoutedEventHandler(RemoveLocalFileButton_Click);
        }

Member Function Documentation

async void AddLocalFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file FileOpenPicker_PickAppFile.xaml.cs.

        {
            StorageFile file = await Package.Current.InstalledLocation.GetFileAsync(@"Assets\squareTile-sdk.png");
            bool inBasket;
            switch (fileOpenPickerUI.AddFile(id, file))
            {
                case AddFileResult.Added:
                case AddFileResult.AlreadyAdded:
                    inBasket = true;
                    OutputTextBlock.Text = Status.FileAdded;
                    break;

                default:
                    inBasket = false;
                    OutputTextBlock.Text = Status.FileAddFailed;
                    break;
            }
            UpdateButtonState(inBasket);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file FileOpenPicker_PickAppFile.xaml.cs.

        {
            UpdateButtonState(fileOpenPickerUI.ContainsFile(id));
        }

void RemoveLocalFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file FileOpenPicker_PickAppFile.xaml.cs.

        {
            if (fileOpenPickerUI.ContainsFile(id))
            {
                fileOpenPickerUI.RemoveFile(id);
                OutputTextBlock.Text = Status.FileRemoved;
            }
            UpdateButtonState(false);
        }

void UpdateButtonState ( bool fileInBasket ) [inline, private]

Definition at line 41 of file FileOpenPicker_PickAppFile.xaml.cs.

        {
            AddLocalFileButton.IsEnabled = !fileInBasket;
            RemoveLocalFileButton.IsEnabled = fileInBasket;
        }

Member Data Documentation

CoreDispatcher dispatcher = Window.Current.Dispatcher [private]

Definition at line 32 of file FileOpenPicker_PickAppFile.xaml.cs.

FileOpenPickerUI fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI [private]

Definition at line 31 of file FileOpenPicker_PickAppFile.xaml.cs.

const string id = "MyLocalFile" [private]

Definition at line 30 of file FileOpenPicker_PickAppFile.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileOpenPicker_PickAppFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileOpenPicker_PickCachedFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileOpenPicker_PickCachedFile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileOpenPicker_PickCachedFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileOpenPicker_PickCachedFile ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddFileButton_Click (object sender, RoutedEventArgs e)
void | RemoveFileButton_Click (object sender, RoutedEventArgs e)
void | UpdateButtonState (bool fileInBasket)

Private Attributes

CoreDispatcher | dispatcher = Window.Current.Dispatcher
FileOpenPickerUI | fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI
const string | id = "MyCachedFile"

Detailed Description

Definition at line 29 of file FileOpenPicker_PickCachedFile.xaml.cs.

Constructor & Destructor Documentation

FileOpenPicker_PickCachedFile ( ) [inline]

Definition at line 35 of file FileOpenPicker_PickCachedFile.xaml.cs.

        {
            this.InitializeComponent();
            AddFileButton.Click += new RoutedEventHandler(AddFileButton_Click);
            RemoveFileButton.Click += new RoutedEventHandler(RemoveFileButton_Click);
        }

Member Function Documentation

async void AddFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file FileOpenPicker_PickCachedFile.xaml.cs.

        {
            StorageFile file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync(@"BeforeAccessConflictingFile.txt", CreationCollisionOption.ReplaceExisting);
            await Windows.Storage.FileIO.WriteTextAsync(file, @"Cached file created...");
            // Note: BeforeAccess triggers CFU activations only for files accessed from the Most Recently Used list and Future Access list.
            CachedFileUpdater.SetUpdateInformation(file, "CachedFile", ReadActivationMode.BeforeAccess, WriteActivationMode.NotNeeded, CachedFileOptions.RequireUpdateOnAccess);

            bool inBasket;
            switch (fileOpenPickerUI.AddFile(id, file))
            {
                case AddFileResult.Added:
                case AddFileResult.AlreadyAdded:
                    inBasket = true;
                    OutputTextBlock.Text = Status.FileAdded;
                    break;

                default:
                    inBasket = false;
                    OutputTextBlock.Text = Status.FileAddFailed;
                    break;
            }
            UpdateButtonState(inBasket);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file FileOpenPicker_PickCachedFile.xaml.cs.

        {
            UpdateButtonState(fileOpenPickerUI.ContainsFile(id));
        }

void RemoveFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file FileOpenPicker_PickCachedFile.xaml.cs.

        {
            if (fileOpenPickerUI.ContainsFile(id))
            {
                fileOpenPickerUI.RemoveFile(id);
                OutputTextBlock.Text = Status.FileRemoved;
            }
            UpdateButtonState(false);
        }

void UpdateButtonState ( bool fileInBasket ) [inline, private]

Definition at line 42 of file FileOpenPicker_PickCachedFile.xaml.cs.

        {
            AddFileButton.IsEnabled = !fileInBasket;
            RemoveFileButton.IsEnabled = fileInBasket;
        }

Member Data Documentation

CoreDispatcher dispatcher = Window.Current.Dispatcher [private]

Definition at line 33 of file FileOpenPicker_PickCachedFile.xaml.cs.

FileOpenPickerUI fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI [private]

Definition at line 32 of file FileOpenPicker_PickCachedFile.xaml.cs.

const string id = "MyCachedFile" [private]

Definition at line 31 of file FileOpenPicker_PickCachedFile.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileOpenPicker_PickCachedFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileOpenPicker_PickURLFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileOpenPicker_PickURLFile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileOpenPicker_PickURLFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileOpenPicker_PickURLFile ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddUriFileButton_Click (object sender, RoutedEventArgs e)
void | RemoveUriFileButton_Click (object sender, RoutedEventArgs e)
void | UpdateButtonState (bool fileInBasket)

Private Attributes

CoreDispatcher | dispatcher = Window.Current.Dispatcher
FileOpenPickerUI | fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI
const string | id = "MyUrlFile"

Detailed Description

Definition at line 28 of file FileOpenPicker_PickURLFile.xaml.cs.

Constructor & Destructor Documentation

FileOpenPicker_PickURLFile ( ) [inline]

Definition at line 34 of file FileOpenPicker_PickURLFile.xaml.cs.

        {
            this.InitializeComponent();
            AddURLFileButton.Click += new RoutedEventHandler(AddUriFileButton_Click);
            RemoveURLFileButton.Click += new RoutedEventHandler(RemoveUriFileButton_Click);
        }

Member Function Documentation

async void AddUriFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file FileOpenPicker_PickURLFile.xaml.cs.

        {
            const string filename = @"URI.png"; // This will be used as the filename of the StorageFile object that references the specified URI

            FileOpenPickerPage.Current.NotifyUser("", NotifyType.StatusMessage);

            Uri uri = null;
            try
            {
                uri = new Uri(URLInput.Text);
            }
            catch (FormatException)
            {
                FileOpenPickerPage.Current.NotifyUser("Please enter a valid URL.", NotifyType.ErrorMessage);
            }

            if (uri != null)
            {
                StorageFile file = await StorageFile.CreateStreamedFileFromUriAsync(filename, uri, RandomAccessStreamReference.CreateFromUri(uri));
                bool inBasket;
                switch (fileOpenPickerUI.AddFile(id, file))
                {
                    case AddFileResult.Added:
                    case AddFileResult.AlreadyAdded:
                        inBasket = true;
                        OutputTextBlock.Text = Status.FileAdded;
                        break;

                    default:
                        inBasket = false;
                        OutputTextBlock.Text = Status.FileAddFailed;
                        break;
                }
                UpdateButtonState(inBasket);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file FileOpenPicker_PickURLFile.xaml.cs.

        {
            UpdateButtonState(fileOpenPickerUI.ContainsFile(id));
        }

void RemoveUriFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 89 of file FileOpenPicker_PickURLFile.xaml.cs.

        {
            if (fileOpenPickerUI.ContainsFile(id))
            {
                fileOpenPickerUI.RemoveFile(id);
                OutputTextBlock.Text = Status.FileRemoved;
            }
            UpdateButtonState(false);
        }

void UpdateButtonState ( bool fileInBasket ) [inline, private]

Definition at line 41 of file FileOpenPicker_PickURLFile.xaml.cs.

        {
            AddURLFileButton.IsEnabled = !fileInBasket;
            RemoveURLFileButton.IsEnabled = fileInBasket;
        }

Member Data Documentation

CoreDispatcher dispatcher = Window.Current.Dispatcher [private]

Definition at line 32 of file FileOpenPicker_PickURLFile.xaml.cs.

FileOpenPickerUI fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI [private]

Definition at line 31 of file FileOpenPicker_PickURLFile.xaml.cs.

const string id = "MyUrlFile" [private]

Definition at line 30 of file FileOpenPicker_PickURLFile.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileOpenPicker_PickURLFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSavePicker_FailToSave Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileSavePicker_FailToSave
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileSavePicker_FailToSave Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileSavePicker_FailToSave ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnTargetFileRequested (FileSavePickerUI sender, TargetFileRequestedEventArgs e)

Private Attributes

CoreDispatcher | dispatcher = Window.Current.Dispatcher
FileSavePickerUI | fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI

Detailed Description

Definition at line 28 of file FileSavePicker_FailToSave.xaml.cs.

Constructor & Destructor Documentation

FileSavePicker_FailToSave ( ) [inline]

Definition at line 33 of file FileSavePicker_FailToSave.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 70 of file FileSavePicker_FailToSave.xaml.cs.

        {
            fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 65 of file FileSavePicker_FailToSave.xaml.cs.

        {
            fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

async void OnTargetFileRequested | ( | FileSavePickerUI | sender,
 |  | TargetFileRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file FileSavePicker_FailToSave.xaml.cs.

        {
            // This scenario demonstrates how the app can go about handling the TargetFileRequested event on the UI thread, from
            // which the app can manipulate the UI, show error dialogs, etc.

            // Requesting a deferral allows the app to return from this event handler and complete the request at a later time.
            // In this case, the deferral is required as the app intends on handling the TargetFileRequested event on the UI thread.
            // Note that the deferral can be requested more than once but calling Complete on the deferral a single time will complete
            // original TargetFileRequested event.
            var deferral = e.Request.GetDeferral();

            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // This method will be called on the app's UI thread, which allows for actions like manipulating
                // the UI or showing error dialogs

                // Display a dialog indicating to the user that a corrective action needs to occur
                var errorDialog = new Windows.UI.Popups.MessageDialog("If the app needs the user to correct a problem before the app can save the file, the app can use a message like this to tell the user about the problem and how to correct it.");
                await errorDialog.ShowAsync();

                // Set the targetFile property to null and complete the deferral to indicate failure once the user has closed the
                // dialog.  This will allow the user to take any neccessary corrective action and click the Save button once again.
                e.Request.TargetFile = null;
                deferral.Complete();
            });
        }

Member Data Documentation

CoreDispatcher dispatcher = Window.Current.Dispatcher [private]

Definition at line 31 of file FileSavePicker_FailToSave.xaml.cs.

FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI [private]

Definition at line 30 of file FileSavePicker_FailToSave.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileSavePicker_FailToSave.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSavePicker_SaveToAppStorage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileSavePicker_SaveToAppStorage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileSavePicker_SaveToAppStorage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileSavePicker_SaveToAppStorage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnTargetFileRequested (FileSavePickerUI sender, TargetFileRequestedEventArgs e)

Private Attributes

FileSavePickerUI | fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI

Detailed Description

Definition at line 26 of file FileSavePicker_SaveToAppStorage.xaml.cs.

Constructor & Destructor Documentation

FileSavePicker_SaveToAppStorage ( ) [inline]

Definition at line 30 of file FileSavePicker_SaveToAppStorage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file FileSavePicker_SaveToAppStorage.xaml.cs.

        {
            fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file FileSavePicker_SaveToAppStorage.xaml.cs.

        {
            fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

async void OnTargetFileRequested | ( | FileSavePickerUI | sender,
 |  | TargetFileRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file FileSavePicker_SaveToAppStorage.xaml.cs.

        {
            // This scenario demonstrates how to handle the TargetFileRequested event on the background thread on which it was raised

            // Requesting a deferral allows the app to call another asynchronous method and complete the request at a later time
            var deferral = e.Request.GetDeferral();

            e.Request.TargetFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(sender.FileName, CreationCollisionOption.GenerateUniqueName);

            // Complete the deferral to let the Picker know the request is finished
            deferral.Complete();
        }

Member Data Documentation

FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI [private]

Definition at line 28 of file FileSavePicker_SaveToAppStorage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileSavePicker_SaveToAppStorage.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSavePicker_SaveToCachedFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • FileSavePicker_SaveToCachedFile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FileSavePicker_SaveToCachedFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileSavePicker_SaveToCachedFile ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnTargetFileRequested (FileSavePickerUI sender, TargetFileRequestedEventArgs e)
async Task | RegisterBackgroundTaskAsync ()
void | Simulate_Update_Collision_Click (object sender, RoutedEventArgs e)

Private Attributes

FileSavePickerUI | fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI
bool | simulateUpdateConflict = false

Detailed Description

Definition at line 29 of file FileSavePicker_SaveToCachedFile.xaml.cs.

Constructor & Destructor Documentation

FileSavePicker_SaveToCachedFile ( ) [inline]

Definition at line 34 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 70 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 64 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            await RegisterBackgroundTaskAsync();
            fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
        }

async void OnTargetFileRequested | ( | FileSavePickerUI | sender,
 |  | TargetFileRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            // This scenario demonstrates how to handle the TargetFileRequested event on the background thread on which it was raised

            // Requesting a deferral allows the app to call another asynchronous method and complete the request at a later time
            var deferral = e.Request.GetDeferral();
            StorageFile file;
            // If the checkbox is checked then the requested file name will be ConflictingFile.txt instead of what was sent to us in sender.name.
            // If background task sees that ConflictingFile is in the name of the file it sets the returned status to FileUpdateStatus.UserInputNeeded.
            // This will cause a prompt for the user to open the app to fix the conflict.
            if (simulateUpdateConflict)
            {
                file = await ApplicationData.Current.LocalFolder.CreateFileAsync("ConflictingFile.txt", CreationCollisionOption.ReplaceExisting);
            }
            else
            {
                file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sender.FileName, CreationCollisionOption.ReplaceExisting);
            }
            CachedFileUpdater.SetUpdateInformation(file, "CachedFile", ReadActivationMode.NotNeeded, WriteActivationMode.AfterWrite, CachedFileOptions.RequireUpdateOnAccess);
            e.Request.TargetFile = file;

            // Complete the deferral to let the Picker know the request is finished
            deferral.Complete();
        }

async Task RegisterBackgroundTaskAsync ( ) [inline, private]

Definition at line 75 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            await BackgroundExecutionManager.RequestAccessAsync();

            string backgroundTaskName = "FilePickerContractsTasks";
            string backgroundTaskEntryPoint = typeof(FilePickerContractsTasks.UpdateFileTask).FullName;

            // Do nothing if the task is already registered.
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == backgroundTaskName)
                {
                    // It is already registered. Don't register it again.
                    return;
                }
            }

            // Register the background task.
            var builder = new BackgroundTaskBuilder();
            builder.Name = backgroundTaskName;
            builder.TaskEntryPoint = backgroundTaskEntryPoint;
            builder.SetTrigger(new CachedFileUpdaterTrigger());
            try
            {
                builder.Register();
            }
            catch (Exception ex) when ((uint)ex.HResult == 0x80040154)
            {
                // REGDB_E_CLASSNOTREG exception is raised if the platform does not
                // support this trigger.
            }
        }

void Simulate_Update_Collision_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file FileSavePicker_SaveToCachedFile.xaml.cs.

        {
            simulateUpdateConflict = SimulateUpdateCollisionCheckBox.IsChecked.HasValue && (bool)SimulateUpdateCollisionCheckBox.IsChecked;
        }

Member Data Documentation

FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI [private]

Definition at line 31 of file FileSavePicker_SaveToCachedFile.xaml.cs.

bool simulateUpdateConflict = false [private]

Definition at line 32 of file FileSavePicker_SaveToCachedFile.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileSavePicker_SaveToCachedFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage_CachedFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • MainPage_CachedFile
Public Member Functions

MainPage_CachedFile Class Reference

List of all members.

Public Member Functions

MainPage_CachedFile ()

Detailed Description

Definition at line 24 of file MainPage_CachedFile.xaml.cs.

Constructor & Destructor Documentation

MainPage_CachedFile ( ) [inline]

Definition at line 26 of file MainPage_CachedFile.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/MainPage_CachedFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage_PickFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • MainPage_PickFile
Public Member Functions | Private Member Functions

MainPage_PickFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage_PickFile ()

Private Member Functions

async void PickFileButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 27 of file MainPage_PickFile.xaml.cs.

Constructor & Destructor Documentation

MainPage_PickFile ( ) [inline]

Definition at line 29 of file MainPage_PickFile.xaml.cs.

        {
            this.InitializeComponent();
            ThisAppTitle.Text = MainPage.APP_TITLE;
            PickFileButton.Click += new RoutedEventHandler(PickFileButton_Click);
        }

Member Function Documentation

async void PickFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file MainPage_PickFile.xaml.cs.

        {
            MainPage page = MainPage.Current;

            //$$page.ResetScenarioOutput(OutputTextBlock);
            // Set up and launch the Open Picker
            FileOpenPicker fileOpenPicker = new FileOpenPicker();
            fileOpenPicker.ViewMode = PickerViewMode.Thumbnail;
            fileOpenPicker.FileTypeFilter.Add(".png");
            fileOpenPicker.FileTypeFilter.Add(".txt");

            IReadOnlyList<StorageFile> files = await fileOpenPicker.PickMultipleFilesAsync();
            StringBuilder fileNames = new StringBuilder();
            foreach (StorageFile file in files)
            {
                // At this point, the app can begin reading from the provided file
                fileNames.AppendLine(file.Name);
            }

            OutputTextBlock.Text = fileNames.ToString();
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/MainPage_PickFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage_SaveFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContracts
  • MainPage_SaveFile
Public Member Functions | Private Member Functions

MainPage_SaveFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage_SaveFile ()

Private Member Functions

async void SaveFileButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 25 of file MainPage_SaveFile.xaml.cs.

Constructor & Destructor Documentation

MainPage_SaveFile ( ) [inline]

Definition at line 27 of file MainPage_SaveFile.xaml.cs.

        {
            this.InitializeComponent();
            ThisAppTitle.Text = MainPage.APP_TITLE;
            SaveFileButton.Click += new RoutedEventHandler(SaveFileButton_Click);
        }

Member Function Documentation

async void SaveFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file MainPage_SaveFile.xaml.cs.

        {
            MainPage page = MainPage.Current;

            //$$page.ResetScenarioOutput(OutputTextBlock);
            // Set up and launch the Save Picker
            FileSavePicker fileSavePicker = new FileSavePicker();
            fileSavePicker.FileTypeChoices.Add("PNG", new string[] { ".png" });

            StorageFile file = await fileSavePicker.PickSaveFileAsync();
            if (file != null)
            {
                // At this point, the app can begin writing to the provided save file
                OutputTextBlock.Text = file.Name;
            }
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/MainPage_SaveFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateFileTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FilePickerContractsTasks
  • UpdateFileTask
Public Member Functions | Private Member Functions

UpdateFileTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | ShowToast (string message)

Detailed Description

Definition at line 9 of file UpdateFileTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 11 of file UpdateFileTask.cs.

        {
            ShowToast("SampleFileProviderBackgroundTask.Run fired ");

            var taskDeferral = taskInstance.GetDeferral();

            CachedFileUpdaterTriggerDetails cachedFileUpdaterTriggerDetails = (CachedFileUpdaterTriggerDetails) taskInstance.TriggerDetails;

            FileUpdateRequest fileUpdateRequest = cachedFileUpdaterTriggerDetails.UpdateRequest;

            if (cachedFileUpdaterTriggerDetails.UpdateRequest.File.Name.Contains("ConflictingFile"))
            {
                fileUpdateRequest.UserInputNeededMessage = "Need to Launch the app to resolve an update conflict.";
                fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
            }
            else
            {
                fileUpdateRequest.Status = FileUpdateStatus.Complete;
            }

            taskDeferral.Complete();
        }

void ShowToast ( string message ) [inline, private]

Definition at line 34 of file UpdateFileTask.cs.

        {
            var toastXmlString = string.Format("<toast><visual version='1'><binding template='ToastText01'><text id='1'>{0}</text></binding></visual></toast>", message);
            var xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();
            xmlDoc.LoadXml(toastXmlString);
            var toast = new ToastNotification(xmlDoc);
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/Tasks/UpdateFileTask.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilmicEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

FilmicEffect Class Reference

#include "FilmicEffect.h"

List of all members.

Public Member Functions

IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pRenderInfo)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pGraph)

Static Public Member Functions

static HRESULT __stdcall | CreateFilmicImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

FilmicEffect ()
HRESULT | UpdateConstants ()

Static Private Member Functions

static float | Clamp (float v, float low, float high)
static float | Round (float v)
static long | SafeAdd (long base, long valueToAdd)

Private Attributes

struct {
float dpi
} m_constants
float | m_dpi
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
Microsoft::WRL::ComPtr
< ID2D1EffectContext > 		m_effectContext
D2D1_RECT_L | m_inputRect
LONG | m_refCount

Detailed Description

Definition at line 17 of file FilmicEffect.h.

Constructor & Destructor Documentation

FilmicEffect ( ) [private]

Definition at line 19 of file FilmicEffect.cpp.

                           :
    m_refCount(1)
{
}

Member Function Documentation

static float Clamp | ( | float | v,
 |  | float | low,
 |  | float | high |
 | ) |  |  | [inline, static, private]

Definition at line 71 of file FilmicEffect.h.

    {
        return (v < low) ? low : (v > high) ? high : v;
    }

HRESULT __stdcall CreateFilmicImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]

Definition at line 24 of file FilmicEffect.cpp.

{
    // Since the object's refcount is initialized to 1, we don't need to AddRef here.
    *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) FilmicEffect());

    if (*ppEffectImpl == nullptr)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return S_OK;
    }
}

IFACEMETHODIMP_ ( UINT32 ) const
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pContextInternal,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |

Definition at line 70 of file FilmicEffect.cpp.

{
    // To maintain consistency across different DPIs, this effect needs to cover more pixels at
    // higher than normal DPIs. The context is saved here so the effect can later retrieve the DPI.
    m_effectContext = pEffectContext;

    BasicReaderWriter^ reader = ref new BasicReaderWriter();
    Platform::Array<unsigned char, 1U>^ data;

    try
    {
        data = reader->ReadData("FilmicEffect.cso");
    }
    catch (Platform::Exception^ e)
    {
        // Return error if file can not be read.
        return e->HResult;
    }

    HRESULT hr = pEffectContext->LoadPixelShader(GUID_FilmicEffectPixelShader, data->Data, data->Length);

    // This loads the shader into the Direct2D image effects system and associates it with the GUID passed in.
    // If this method is called more than once (say by other instances of the effect) with the same GUID,
    // the system will simply do nothing, ensuring that only one instance of a shader is stored regardless of how
    // many time it is used.
    if (SUCCEEDED(hr))
    {
        // The graph consists of a single transform. In fact, this class is the transform,
        // reducing the complexity of implementing an effect when all we need to
        // do is use a single pixel shader.
        hr = pTransformGraph->SetSingleTransformNode(this);
    }

    return hr;
}

IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |

Definition at line 161 of file FilmicEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    *pOutputRect = pInputRects[0];
    m_inputRect = pInputRects[0];

    // Indicate that entire output might contain transparency.
    ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));

    return S_OK;
}

IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const

Definition at line 185 of file FilmicEffect.cpp.

{
    HRESULT hr = S_OK;

    // Indicate that the entire output may be invalid.
    *pInvalidOutputRect = m_inputRect;

    return hr;
}

IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const

Definition at line 140 of file FilmicEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    pInputRects[0].left    = pOutputRect->left;
    pInputRects[0].top     = pOutputRect->top;
    pInputRects[0].right   = pOutputRect->right;
    pInputRects[0].bottom  = pOutputRect->bottom;

    return S_OK;
}

IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )

Definition at line 118 of file FilmicEffect.cpp.

{
    return UpdateConstants();
}

IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 229 of file FilmicEffect.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1EffectImpl))
    {
        *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
    }
    else if (riid == __uuidof(ID2D1DrawTransform))
    {
        *ppOutput = static_cast<ID2D1DrawTransform*>(this);
    }
    else if (riid == __uuidof(ID2D1Transform))
    {
        *ppOutput = static_cast<ID2D1Transform*>(this);
    }
    else if (riid == __uuidof(ID2D1TransformNode))
    {
        *ppOutput = static_cast<ID2D1TransformNode*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]

Definition at line 39 of file FilmicEffect.cpp.

{
    // The inspectable metadata of an effect is defined in XML. This can be passed in from an external source
    // as well, however for simplicity we just inline the XML.
    PCWSTR pszXml =
        XML(
            <?xml version='1.0'?>
            <Effect>
                <!-- System Properties -->
                <Property name='DisplayName' type='string' value='Filmic Tonemapper' />
                <Property name='Author' type='string' value='Microsoft Corporation' />
                <Property name='Category' type='string' value='Stylize' />
                <Property name='Description' type='string' value='Simplified version of the ACES Filmic HDR tonemapper' />
                <Inputs>
                    <Input name='Source' />
                </Inputs>
                <!-- Custom Properties go here -->
            </Effect>
            );

    // This registers the effect with the factory, which will make the effect
    // instantiatable.
    return pFactory->RegisterEffectFromString(
        CLSID_CustomFilmicEffect,
        pszXml,
        nullptr,
        0,
        CreateFilmicImpl
        );
}

static float Round ( float v ) [inline, static, private]

Definition at line 76 of file FilmicEffect.h.

    {
        return floor(v + 0.5f);
    }

static long SafeAdd | ( | long | base,
 |  | long | valueToAdd |
 | ) |  |  | [inline, static, private]

Definition at line 82 of file FilmicEffect.h.

    {
        if (valueToAdd >= 0)
        {
            return ((base + valueToAdd) >= base) ? (base + valueToAdd) : LONG_MAX;
        }
        else
        {
            return ((base + valueToAdd) <= base) ? (base + valueToAdd) : LONG_MIN;
        }
    }

IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pRenderInfo )

Definition at line 132 of file FilmicEffect.cpp.

{
    m_drawInfo = pDrawInfo;

    return m_drawInfo->SetPixelShader(GUID_FilmicEffectPixelShader);
}

IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pGraph )

Definition at line 125 of file FilmicEffect.cpp.

{
    return E_NOTIMPL;
}

HRESULT UpdateConstants ( ) [private]

Definition at line 109 of file FilmicEffect.cpp.

{
    // Update the DPI if it has changed. This allows the effect to scale across different DPIs automatically.
    m_effectContext->GetDpi(&m_dpi, &m_dpi);
    m_constants.dpi = m_dpi;

    return m_drawInfo->SetPixelShaderConstantBuffer(reinterpret_cast<BYTE*>(&m_constants), sizeof(m_constants));
}

Member Data Documentation

float dpi

Definition at line 97 of file FilmicEffect.h.

struct { ... } m_constants [private]
float m_dpi [private]

Definition at line 104 of file FilmicEffect.h.

Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 100 of file FilmicEffect.h.

Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext [private]

Definition at line 101 of file FilmicEffect.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 103 of file FilmicEffect.h.

LONG m_refCount [private]

Definition at line 102 of file FilmicEffect.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomControlUsage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FocusVisualsSample
  • CustomControlUsage
Public Member Functions

CustomControlUsage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CustomControlUsage ()

Detailed Description

Definition at line 21 of file CustomControlUsage.xaml.cs.

Constructor & Destructor Documentation

CustomControlUsage ( ) [inline]

Definition at line 23 of file CustomControlUsage.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlFocusVisuals/cs/Scenarios/CustomControlUsage.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomFocusVisuals Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FocusVisualsSample
  • CustomFocusVisuals
Public Member Functions | Protected Member Functions | Private Attributes

CustomFocusVisuals Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CustomFocusVisuals ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 24 of file CustomFocusVisuals.xaml.cs.

Constructor & Destructor Documentation

CustomFocusVisuals ( ) [inline]

Definition at line 28 of file CustomFocusVisuals.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file CustomFocusVisuals.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 26 of file CustomFocusVisuals.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlFocusVisuals/cs/Scenarios/CustomFocusVisuals.xaml.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocialMediaCounter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • FocusVisualsSample
  • SocialMediaCounter
Public Member Functions | Static Public Attributes | Properties

SocialMediaCounter Class Reference

List of all members.

Public Member Functions

SocialMediaCounter ()

Static Public Attributes

static readonly DependencyProperty | NumOfSharesProperty = DependencyProperty.Register("NumOfShares", typeof(int), typeof(SocialMediaCounter), new PropertyMetadata(0))
static readonly DependencyProperty | ShareImageProperty = DependencyProperty.Register("ShareImage", typeof(ImageSource), typeof(SocialMediaCounter), new PropertyMetadata(null))

Properties

int | NumOfShares [get, set]
ImageSource | ShareImage [get, set]

Detailed Description

Definition at line 16 of file SocialMediaCounter.cs.

Constructor & Destructor Documentation

SocialMediaCounter ( ) [inline]

Definition at line 32 of file SocialMediaCounter.cs.

        {
            this.DefaultStyleKey = typeof(SocialMediaCounter);
        }

Member Data Documentation

readonly DependencyProperty NumOfSharesProperty = DependencyProperty.Register("NumOfShares", typeof(int), typeof(SocialMediaCounter), new PropertyMetadata(0)) [static]

Definition at line 25 of file SocialMediaCounter.cs.

readonly DependencyProperty ShareImageProperty = DependencyProperty.Register("ShareImage", typeof(ImageSource), typeof(SocialMediaCounter), new PropertyMetadata(null)) [static]

Definition at line 18 of file SocialMediaCounter.cs.

Property Documentation

int NumOfShares [get, set]

Definition at line 27 of file SocialMediaCounter.cs.

ImageSource ShareImage [get, set]

Definition at line 20 of file SocialMediaCounter.cs.

The documentation for this class was generated from the following file:
  • XamlFocusVisuals/cs/SocialMediaCounter.cs
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameConfig Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

GameConfig Struct Reference

#include "Simple3DGame.h"

List of all members.

Public Attributes

bool | autoFire
bool | backgroundAvailable [GameConstants::MaxBackgroundTextures]
bool | isTrial

Detailed Description

Definition at line 65 of file Simple3DGame.h.

Member Data Documentation

bool autoFire

Definition at line 68 of file Simple3DGame.h.

bool backgroundAvailable[GameConstants::MaxBackgroundTextures]

Definition at line 69 of file Simple3DGame.h.

bool isTrial

Definition at line 67 of file Simple3DGame.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameXaml/cpp/Simple3DGame.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameHud Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

GameHud Class Reference

#include "GameHud.h"

List of all members.

Public Member Functions

GameHud (_In_ std::shared_ptr< DX::DeviceResources > const &deviceResources, _In_ winrt::hstring const &titleHeader, _In_ winrt::hstring const &titleBody)
GameHud (GameHud const &)
void | CreateDeviceDependentResources ()
void | CreateDeviceDependentResources ()
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | operator= (GameHud const &)
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render (_In_ Simple3DGame^game)
void | Render (_In_ std::shared_ptr< Simple3DGame > const &game)
void | Render (_In_ Simple3DGame^game)
void | SetLicenseInfo (_In_ Platform::String^licenseInfo)

Public Attributes

internal | __pad0__: GameHud( _In_ const std::shared_ptr<DX::DeviceResources>& deviceResources
internal _In_ Platform::String
_In_ Platform::String 		titleBody
internal _In_ Platform::String | titleHeader
internal _In_ Platform::String
_In_ Platform::String _In_
Platform::String 		titleLicenseInfo

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_licenseInfoChanged
winrt::com_ptr< ID2D1Bitmap > | m_logoBitmap
Microsoft::WRL::ComPtr
< ID2D1Bitmap > 		m_logoBitmap
D2D1_SIZE_F | m_logoSize
D2D1_SIZE_F | m_maxTitleSize
bool | m_showTitle
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_textBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBrushGrey
winrt::com_ptr< IDWriteTextFormat > | m_textFormatBody
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatBody
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatBodySymbol
winrt::com_ptr< IDWriteTextFormat > | m_textFormatBodySymbol
winrt::com_ptr< IDWriteTextFormat > | m_textFormatTitleBody
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatTitleBody
winrt::com_ptr< IDWriteTextFormat > | m_textFormatTitleHeader
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatTitleHeader
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatTitleLicense
winrt::hstring | m_titleBody
Platform::String | m_titleBody
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_titleBodyLayout
winrt::com_ptr< IDWriteTextLayout > | m_titleBodyLayout
float | m_titleBodyVerticalOffset
winrt::hstring | m_titleHeader
Platform::String | m_titleHeader
winrt::com_ptr< IDWriteTextLayout > | m_titleHeaderLayout
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_titleHeaderLayout
Platform::String | m_titleLicenseInfo
Microsoft::WRL::ComPtr
< IDWriteTextLayout > 		m_titleLicenseInfoLayout
float | m_titleLicenseVerticalOffset

Detailed Description

Definition at line 25 of file GameHud.h.

Constructor & Destructor Documentation

GameHud | ( | _In_ std::shared_ptr< DX::DeviceResources > const & | deviceResources,
 |  | _In_ winrt::hstring const & | titleHeader,
 |  | _In_ winrt::hstring const & | titleBody
 | ) |  |

Definition at line 20 of file GameHud.cpp.

      :
    m_deviceResources(deviceResources),
    m_titleHeader(titleHeader),
    m_titleBody(titleBody)
{
    m_showTitle = true;
    m_titleBodyVerticalOffset = GameUIConstants::Margin;
    m_logoSize = D2D1::SizeF(0.0f, 0.0f);

    auto dwriteFactory = m_deviceResources->GetDWriteFactory();

    winrt::check_hresult(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameUIConstants::HudBodyPointSize,
            L"en-us",
            m_textFormatBody.put()
            )
        );
    winrt::check_hresult(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI Symbol",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameUIConstants::HudBodyPointSize,
            L"en-us",
            m_textFormatBodySymbol.put()
            )
        );
    winrt::check_hresult(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI Light",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameUIConstants::HudTitleHeaderPointSize,
            L"en-us",
            m_textFormatTitleHeader.put()
            )
        );
    winrt::check_hresult(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI Light",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameUIConstants::HudTitleBodyPointSize,
            L"en-us",
            m_textFormatTitleBody.put()
            )
        );

    winrt::check_hresult(m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
    winrt::check_hresult(m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
    winrt::check_hresult(m_textFormatBodySymbol->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
    winrt::check_hresult(m_textFormatBodySymbol->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
    winrt::check_hresult(m_textFormatTitleHeader->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
    winrt::check_hresult(m_textFormatTitleHeader->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
    winrt::check_hresult(m_textFormatTitleBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
    winrt::check_hresult(m_textFormatTitleBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
}

GameHud ( GameHud const & )

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 104 of file GameHud.cpp.

{
    auto location = Package::Current->InstalledLocation;
    Platform::String^ path = Platform::String::Concat(location->Path, "\\");
    path = Platform::String::Concat(path, "Assets\\windows-sdk.png");

    auto wicFactory = m_deviceResources->GetWicImagingFactory();

    ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
    DX::ThrowIfFailed(
        wicFactory->CreateDecoderFromFilename(
            path->Data(),
            nullptr,
            GENERIC_READ,
            WICDecodeMetadataCacheOnDemand,
            &wicBitmapDecoder
            )
        );

    ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
    DX::ThrowIfFailed(
        wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
        );

    ComPtr<IWICFormatConverter> wicFormatConverter;
    DX::ThrowIfFailed(
        wicFactory->CreateFormatConverter(&wicFormatConverter)
        );

    DX::ThrowIfFailed(
        wicFormatConverter->Initialize(
            wicBitmapFrame.Get(),
            GUID_WICPixelFormat32bppPBGRA,
            WICBitmapDitherTypeNone,
            nullptr,
            0.0,
            WICBitmapPaletteTypeCustom  // The BGRA format has no palette so this value is ignored.
            )
        );

    double dpiX = 96.0f;
    double dpiY = 96.0f;
    DX::ThrowIfFailed(
        wicFormatConverter->GetResolution(&dpiX, &dpiY)
        );

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    // Create D2D Resources
    DX::ThrowIfFailed(
        d2dContext->CreateBitmapFromWicBitmap(
            wicFormatConverter.Get(),
            BitmapProperties(
                PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
                static_cast<float>(dpiX),
                static_cast<float>(dpiY)
                ),
            &m_logoBitmap
            )
        );

    m_logoSize = m_logoBitmap->GetSize();

    DX::ThrowIfFailed(
        d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White),
            &m_textBrush
            )
        );
}

void CreateDeviceDependentResources ( )
void CreateDeviceDependentResources ( )
void CreateWindowSizeDependentResources ( )

Definition at line 177 of file GameHud.cpp.

{
    auto windowBounds = m_deviceResources->GetLogicalSize();

    m_maxTitleSize.width = windowBounds.Width - GameConstants::HudSafeWidth;
    m_maxTitleSize.height = windowBounds.Height;

    float headerWidth = m_maxTitleSize.width - (m_logoSize.width + 2 * GameConstants::Margin);

    if (headerWidth > 0)
    {
        auto dwriteFactory = m_deviceResources->GetDWriteFactory();

        // Only resize the text layout for the Title area when there is enough space.
        m_showTitle = true;

        DX::ThrowIfFailed(
            dwriteFactory->CreateTextLayout(
                m_titleHeader->Data(),
                m_titleHeader->Length(),
                m_textFormatTitleHeader.Get(),
                headerWidth,
                m_maxTitleSize.height,
                &m_titleHeaderLayout
                )
            );

        DWRITE_TEXT_METRICS metrics = {0};
        DX::ThrowIfFailed(
            m_titleHeaderLayout->GetMetrics(&metrics)
            );

        // Compute the vertical size of the laid out Header and logo.  This could change
        // based on the window size and the layout of the text.  In some cases the text
        // may wrap.
        m_titleBodyVerticalOffset = max(m_logoSize.height + GameConstants::Margin * 2, metrics.height + 2 * GameConstants::Margin);

        DX::ThrowIfFailed(
            dwriteFactory->CreateTextLayout(
                m_titleBody->Data(),
                m_titleBody->Length(),
                m_textFormatTitleBody.Get(),
                m_maxTitleSize.width,
                m_maxTitleSize.height - m_titleBodyVerticalOffset,
                &m_titleBodyLayout
                )
            );
    }
    else
    {
        // Not enough horizontal space for the titles so just turn it off.
        m_showTitle = false;
    }
}

void CreateWindowSizeDependentResources ( )
void CreateWindowSizeDependentResources ( )
void operator= ( GameHud const & )
void ReleaseDeviceDependentResources ( )
void ReleaseDeviceDependentResources ( )
void ReleaseDeviceDependentResources ( )

Definition at line 362 of file GameHud.cpp.

{
    m_textBrush.Reset();
    m_logoBitmap.Reset();
}

void Render ( _In_ Simple3DGame^ game )

Definition at line 234 of file GameHud.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto windowBounds = m_deviceResources->GetLogicalSize();

    if (m_showTitle)
    {
        d2dContext->DrawBitmap(
            m_logoBitmap.Get(),
            D2D1::RectF(
                GameConstants::Margin,
                GameConstants::Margin,
                m_logoSize.width + GameConstants::Margin,
                m_logoSize.height + GameConstants::Margin
                )
            );
        d2dContext->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * GameConstants::Margin, GameConstants::Margin),
            m_titleHeaderLayout.Get(),
            m_textBrush.Get()
            );
        d2dContext->DrawTextLayout(
            Point2F(GameConstants::Margin, m_titleBodyVerticalOffset),
            m_titleBodyLayout.Get(),
            m_textBrush.Get()
            );
    }

    if (game != nullptr)
    {
        // This section is only used after the game state has been initialized.
        static const int bufferLength = 256;
        static char16 wsbuffer[bufferLength];
        int length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Hits:\t%10d\nShots:\t%10d\nTime:\t%8.1f",
            game->TotalHits(),
            game->TotalShots(),
            game->TimeRemaining()
            );

        d2dContext->DrawText(
            wsbuffer,
            length,
            m_textFormatBody.Get(),
            D2D1::RectF(
                windowBounds.Width - GameConstants::HudRightOffset,
                GameConstants::HudTopOffset,
                windowBounds.Width,
                GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3
                ),
            m_textBrush.Get()
            );

        // Using the unicode characters starting at 0x2780 ( ➀ ) for the consecutive levels of the game.
        // For completed levels start with 0x278A ( ➊ ) (This is 0x2780 + 10).
        uint32 levelCharacter[6];
        for (uint32 i = 0; i < 6; i++)
        {
            levelCharacter[i] = 0x2780 + i + ((static_cast<uint32>(game->LevelCompleted()) == i) ? 10 : 0);
        }
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"%lc %lc %lc %lc %lc %lc",
            levelCharacter[0],
            levelCharacter[1],
            levelCharacter[2],
            levelCharacter[3],
            levelCharacter[4],
            levelCharacter[5]
            );
        d2dContext->DrawText(
            wsbuffer,
            length,
            m_textFormatBodySymbol.Get(),
            D2D1::RectF(
                windowBounds.Width - GameConstants::HudRightOffset,
                GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3 + GameConstants::Margin,
                windowBounds.Width,
                GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize+ GameConstants::Margin) * 4
                ),
            m_textBrush.Get()
            );

        if (game->IsActivePlay())
        {
            // Draw a rectangle for the touch input for the move control.
            d2dContext->DrawRectangle(
                D2D1::RectF(
                    0.0f,
                    windowBounds.Height - GameConstants::TouchRectangleSize,
                    GameConstants::TouchRectangleSize,
                    windowBounds.Height
                    ),
                m_textBrush.Get()
                );
            // Draw a rectangle for the touch input for the fire control.
            d2dContext->DrawRectangle(
                D2D1::RectF(
                    windowBounds.Width - GameConstants::TouchRectangleSize,
                    windowBounds.Height - GameConstants::TouchRectangleSize,
                    windowBounds.Width,
                    windowBounds.Height
                    ),
                m_textBrush.Get()
                );

            // Draw the cross hairs
            d2dContext->DrawLine(
                D2D1::Point2F(windowBounds.Width / 2.0f - GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
                D2D1::Point2F(windowBounds.Width / 2.0f + GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
                m_textBrush.Get(),
                3.0f
                );
            d2dContext->DrawLine(
                D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f - GameConstants::CrossHairHalfSize),
                D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f + GameConstants::CrossHairHalfSize),
                m_textBrush.Get(),
                3.0f
                );
        }
    }
}

void Render ( _In_ std::shared_ptr< Simple3DGame > const & game )

Definition at line 221 of file GameHud.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto windowBounds = m_deviceResources->GetLogicalSize();

    if (m_showTitle)
    {
        d2dContext->DrawBitmap(
            m_logoBitmap.get(),
            D2D1::RectF(
                GameUIConstants::Margin,
                GameUIConstants::Margin,
                m_logoSize.width + GameUIConstants::Margin,
                m_logoSize.height + GameUIConstants::Margin
                )
            );
        d2dContext->DrawTextLayout(
            Point2F(m_logoSize.width + 2.0f * GameUIConstants::Margin, GameUIConstants::Margin),
            m_titleHeaderLayout.get(),
            m_textBrush.get()
            );
        d2dContext->DrawTextLayout(
            Point2F(GameUIConstants::Margin, m_titleBodyVerticalOffset),
            m_titleBodyLayout.get(),
            m_textBrush.get()
            );
    }

    if (game != nullptr)
    {
        // This section is only used after the game state has been initialized.
        static const int bufferLength = 256;
        static wchar_t wsbuffer[bufferLength];
        int length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Hits:\t%10d\nShots:\t%10d\nTime:\t%8.1f",
            game->TotalHits(),
            game->TotalShots(),
            game->TimeRemaining()
            );

        d2dContext->DrawText(
            wsbuffer,
            length,
            m_textFormatBody.get(),
            D2D1::RectF(
                windowBounds.Width - GameUIConstants::HudRightOffset,
                GameUIConstants::HudTopOffset,
                windowBounds.Width,
                GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 3
                ),
            m_textBrush.get()
            );

        // Using the unicode characters starting at 0x2780 ( ➀ ) for the consecutive levels of the game.
        // For completed levels start with 0x278A ( ➊ ) (This is 0x2780 + 10).
        uint32_t levelCharacter[6];
        for (uint32_t i = 0; i < 6; i++)
        {
            levelCharacter[i] = 0x2780 + i + ((static_cast<uint32_t>(game->LevelCompleted()) == i) ? 10 : 0);
        }
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"%lc %lc %lc %lc %lc %lc",
            levelCharacter[0],
            levelCharacter[1],
            levelCharacter[2],
            levelCharacter[3],
            levelCharacter[4],
            levelCharacter[5]
            );
        d2dContext->DrawText(
            wsbuffer,
            length,
            m_textFormatBodySymbol.get(),
            D2D1::RectF(
                windowBounds.Width - GameUIConstants::HudRightOffset,
                GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 3 + GameUIConstants::Margin,
                windowBounds.Width,
                GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 4
                ),
            m_textBrush.get()
            );

        if (game->IsActivePlay())
        {
            // Draw a rectangle for the touch input for the move control.
            d2dContext->DrawRectangle(
                D2D1::RectF(
                    0.0f,
                    windowBounds.Height - GameUIConstants::TouchRectangleSize,
                    GameUIConstants::TouchRectangleSize,
                    windowBounds.Height
                    ),
                m_textBrush.get()
                );
            // Draw a rectangle for the touch input for the fire control.
            d2dContext->DrawRectangle(
                D2D1::RectF(
                    windowBounds.Width - GameUIConstants::TouchRectangleSize,
                    windowBounds.Height - GameUIConstants::TouchRectangleSize,
                    windowBounds.Width,
                    windowBounds.Height
                    ),
                m_textBrush.get()
                );

            // Draw the cross hairs
            d2dContext->DrawLine(
                D2D1::Point2F(windowBounds.Width / 2.0f - GameUIConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
                D2D1::Point2F(windowBounds.Width / 2.0f + GameUIConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
                m_textBrush.get(),
                3.0f
                );
            d2dContext->DrawLine(
                D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f - GameUIConstants::CrossHairHalfSize),
                D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f + GameUIConstants::CrossHairHalfSize),
                m_textBrush.get(),
                3.0f
                );
        }
    }
}

void Render ( _In_ Simple3DGame^ game )
void SetLicenseInfo ( _In_ Platform::String^ licenseInfo )

Definition at line 275 of file GameHud.cpp.

{
    m_titleLicenseInfo = licenseInfo;
    m_licenseInfoChanged = true;
}

Member Data Documentation

internal __pad0__

Definition at line 29 of file GameHud.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 41 of file GameHud.h.

bool m_licenseInfoChanged [private]

Definition at line 63 of file GameHud.h.

Microsoft::WRL::ComPtr< ID2D1Bitmap > m_logoBitmap [private]

Definition at line 49 of file GameHud.h.

winrt::com_ptr<ID2D1Bitmap> m_logoBitmap [private]

Definition at line 49 of file GameHud.h.

D2D1_SIZE_F m_logoSize [private]

Definition at line 58 of file GameHud.h.

D2D1_SIZE_F m_maxTitleSize [private]

Definition at line 59 of file GameHud.h.

bool m_showTitle [private]

Definition at line 53 of file GameHud.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_textBrush [private]

Definition at line 43 of file GameHud.h.

Microsoft::WRL::ComPtr< ID2D1SolidColorBrush > m_textBrush [private]

Definition at line 43 of file GameHud.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBrushGrey [private]

Definition at line 47 of file GameHud.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatBody [private]

Definition at line 44 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextFormat > m_textFormatBody [private]

Definition at line 44 of file GameHud.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatBodySymbol [private]

Definition at line 45 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextFormat > m_textFormatBodySymbol [private]

Definition at line 45 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextFormat > m_textFormatTitleBody [private]

Definition at line 48 of file GameHud.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatTitleBody [private]

Definition at line 48 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextFormat > m_textFormatTitleHeader [private]

Definition at line 47 of file GameHud.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatTitleHeader [private]

Definition at line 47 of file GameHud.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormatTitleLicense [private]

Definition at line 53 of file GameHud.h.

Platform::String m_titleBody [private]

Definition at line 55 of file GameHud.h.

winrt::hstring m_titleBody [private]

Definition at line 55 of file GameHud.h.

winrt::com_ptr<IDWriteTextLayout> m_titleBodyLayout [private]

Definition at line 51 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextLayout > m_titleBodyLayout [private]

Definition at line 51 of file GameHud.h.

float m_titleBodyVerticalOffset [private]

Definition at line 57 of file GameHud.h.

winrt::hstring m_titleHeader [private]

Definition at line 54 of file GameHud.h.

Platform::String m_titleHeader [private]

Definition at line 54 of file GameHud.h.

winrt::com_ptr<IDWriteTextLayout> m_titleHeaderLayout [private]

Definition at line 50 of file GameHud.h.

Microsoft::WRL::ComPtr< IDWriteTextLayout > m_titleHeaderLayout [private]

Definition at line 50 of file GameHud.h.

Platform::String m_titleLicenseInfo [private]

Definition at line 62 of file GameHud.h.

Microsoft::WRL::ComPtr<IDWriteTextLayout> m_titleLicenseInfoLayout [private]

Definition at line 57 of file GameHud.h.

float m_titleLicenseVerticalOffset [private]

Definition at line 66 of file GameHud.h.

internal _In_ Platform::String _In_ Platform::String titleBody

Definition at line 29 of file GameHud.h.

internal _In_ Platform::String titleHeader

Definition at line 29 of file GameHud.h.

internal _In_ Platform::String _In_ Platform::String _In_ Platform::String titleLicenseInfo

Definition at line 29 of file GameHud.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/GameHud.h
  • Simple3DGameDX/cppwinrt/GameHud.h
  • Simple3DGameXaml/cpp/GameHud.h
  • Simple3DGameDX/cpp/GameHud.cpp
  • Simple3DGameDX/cppwinrt/GameHud.cpp
  • Simple3DGameXaml/cpp/GameHud.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameInfoOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

GameInfoOverlay Class Reference

#include "GameInfoOverlay.h"

Inherits Simple3DGameDX::IGameUIControl, and Simple3DGameDX::IGameUIControl.

List of all members.

Public Member Functions

GameInfoOverlay (std::shared_ptr< DX::DeviceResources > const &deviceResources)
ID2D1Bitmap1 * | Bitmap ()
ID2D1Bitmap1 * | Bitmap ()
void | CreateDeviceDependentResources ()
void | CreateDeviceDependentResources ()
void | CreateWindowSizeDependentResources (D2D_SIZE_F overlaySize)
void | CreateWindowSizeDependentResources (D2D_SIZE_F overlaySize)
virtual void | HideGameInfoOverlay ()
virtual void | HideGameInfoOverlay ()
virtual void | HideTooSmall ()
virtual void | HideTooSmall ()
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
virtual void | SetAction (Simple3DGameDX::GameInfoOverlayCommand action)
virtual void | SetAction (Simple3DGameDX::GameInfoOverlayCommand action)
virtual void | SetGameLoading (uint32_t dots)
virtual void | SetGameLoading (uint32 dots)
virtual void | SetGameOver (bool win, int maxLevel, int hitCount, int shotCount, int highScore)
virtual void | SetGameOver (bool win, int maxLevel, int hitCount, int shotCount, int highScore)
virtual void | SetGameStats (int maxLevel, int hitCount, int shotCount)
virtual void | SetGameStats (int maxLevel, int hitCount, int shotCount)
virtual void | SetLevelStart (int level, Platform::String^objective, float timeLimit, float bonusTime)
virtual void | SetLevelStart (int level, std::wstring const &objective, float timeLimit, float bonusTime)
virtual void | SetPause (int level, int hitCount, int shotCount, float timeRemaining)
virtual void | SetPause (int level, int hitCount, int shotCount, float timeRemaining)
virtual void | ShowGameInfoOverlay ()
virtual void | ShowGameInfoOverlay ()
virtual void | ShowTooSmall ()
virtual void | ShowTooSmall ()
bool | Visible ()
bool | Visible ()

Public Attributes

internal | __pad0__: GameInfoOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_actionBrush
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_actionBrush
D2D1_RECT_F | m_actionRectangle
Platform::String | m_actionString
std::wstring | m_actionString
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_backgroundBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_backgroundBrush
D2D1_RECT_F | m_bodyRectangle
std::wstring | m_bodyString
Platform::String | m_bodyString
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
winrt::com_ptr< ID2D1Bitmap1 > | m_levelBitmap
Microsoft::WRL::ComPtr
< ID2D1Bitmap1 > 		m_levelBitmap
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_textBrush
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_textBrush
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatBody
winrt::com_ptr< IDWriteTextFormat > | m_textFormatBody
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormatTitle
winrt::com_ptr< IDWriteTextFormat > | m_textFormatTitle
D2D1_RECT_F | m_titleRectangle
Platform::String | m_titleString
std::wstring | m_titleString
bool | m_tooSmallActive
winrt::com_ptr< ID2D1Bitmap1 > | m_tooSmallBitmap
Microsoft::WRL::ComPtr
< ID2D1Bitmap1 > 		m_tooSmallBitmap
bool | m_visible

Detailed Description

Definition at line 32 of file GameInfoOverlay.h.

Constructor & Destructor Documentation

GameInfoOverlay ( std::shared_ptr< DX::DeviceResources > const & deviceResources )

Definition at line 30 of file GameInfoOverlay.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_visible(false),
    m_titleString("Title"),
    m_bodyString("Body"),
    m_actionString("Action")
{
    auto dwriteFactory = m_deviceResources->GetDWriteFactory();

    // Create D2D Resources
    DX::ThrowIfFailed(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_MEDIUM,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameInfoOverlayConstant::TitlePointSize,
            L"en-us",   // locale
            &m_textFormatTitle
            )
        );

    DX::ThrowIfFailed(
        dwriteFactory->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            GameInfoOverlayConstant::BodyPointSize,
            L"en-us",   // locale
            &m_textFormatBody
            )
        );

    DX::ThrowIfFailed(
        m_textFormatTitle->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER)
        );
    DX::ThrowIfFailed(
        m_textFormatTitle->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );
    DX::ThrowIfFailed(
        m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
        );
    DX::ThrowIfFailed(
        m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        );
}

Member Function Documentation

ID2D1Bitmap1 * Bitmap ( )

Definition at line 229 of file GameInfoOverlay.cpp.

{
    if (m_tooSmallActive)
    {
        return m_tooSmallBitmap.Get();
    }
    else
    {
        return m_levelBitmap.Get();
    }
}

ID2D1Bitmap1* Bitmap ( )
void CreateDeviceDependentResources ( )
void CreateDeviceDependentResources ( )

Definition at line 82 of file GameInfoOverlay.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    DX::ThrowIfFailed(
        d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White),
            &m_textBrush
            )
        );
    DX::ThrowIfFailed(
        d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Black),
            &m_backgroundBrush
            )
        );
    DX::ThrowIfFailed(
        d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(0xdb7100, 1.0f),
            &m_actionBrush
            )
        );
}

void CreateWindowSizeDependentResources ( D2D_SIZE_F overlaySize )
void CreateWindowSizeDependentResources ( D2D_SIZE_F overlaySize )

Definition at line 108 of file GameInfoOverlay.cpp.

{
    auto dpi = m_deviceResources->GetDpi();
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();
    auto windowSize = m_deviceResources->GetLogicalSize();

    m_levelBitmap = nullptr;
    m_tooSmallBitmap = nullptr;

    m_titleRectangle = D2D1::RectF(
        GameInfoOverlayConstant::SideMargin,
        GameInfoOverlayConstant::TopMargin,
        overlaySize.width - GameInfoOverlayConstant::SideMargin,
        GameInfoOverlayConstant::TopMargin + GameInfoOverlayConstant::TitleHeight
        );
    m_actionRectangle = D2D1::RectF(
        GameInfoOverlayConstant::SideMargin,
        overlaySize.height - (GameInfoOverlayConstant::ActionHeight + GameInfoOverlayConstant::BottomMargin),
        overlaySize.width - GameInfoOverlayConstant::SideMargin,
        overlaySize.height - GameInfoOverlayConstant::BottomMargin
        );
    m_bodyRectangle = D2D1::RectF(
        GameInfoOverlayConstant::SideMargin,
        m_titleRectangle.bottom + GameInfoOverlayConstant::Separator,
        overlaySize.width - GameInfoOverlayConstant::SideMargin,
        m_actionRectangle.top - GameInfoOverlayConstant::Separator
        );

    // Create a D2D Bitmap to be used for Game Info Overlay when waiting to
    // start a level or when display game statistics.
    D2D1_BITMAP_PROPERTIES1 properties;
    properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
    properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
    properties.dpiX = dpi;
    properties.dpiY = dpi;
    properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
    properties.colorContext = nullptr;
    DX::ThrowIfFailed(
        d2dContext->CreateBitmap(
            D2D1::SizeU(
                static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
                static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
                ),
            nullptr,
            0,
            &properties,
            &m_levelBitmap
            )
        );
    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_titleRectangle,
        m_textBrush.Get()
        );
    d2dContext->DrawText(
        m_bodyString->Data(),
        m_bodyString->Length(),
        m_textFormatBody.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );
    d2dContext->DrawText(
        m_actionString->Data(),
        m_actionString->Length(),
        m_textFormatBody.Get(),
        m_actionRectangle,
        m_actionBrush.Get()
        );
    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    // Create the TooSmall Bitmap.
    DX::ThrowIfFailed(
        d2dContext->CreateBitmap(
        D2D1::SizeU(
        static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
        static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
        ),
        nullptr,
        0,
        &properties,
        &m_tooSmallBitmap
        )
        );
    d2dContext->SetTarget(m_tooSmallBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    Platform::String^ string = "Paused";

    d2dContext->DrawText(
        string->Data(),
        string->Length(),
        m_textFormatTitle.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );
    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

virtual void HideGameInfoOverlay ( ) [inline, virtual]

Implements IGameUIControl.

Definition at line 52 of file GameInfoOverlay.h.

{ m_visible = false; };

virtual void HideGameInfoOverlay ( ) [inline, virtual]

Implements IGameUIControl.

Definition at line 53 of file GameInfoOverlay.h.

{ m_visible = false; };

void HideTooSmall ( ) [virtual]

Implements IGameUIControl.

Definition at line 514 of file GameInfoOverlay.cpp.

{
    m_visible = false;
    m_tooSmallActive = false;
}

virtual void HideTooSmall ( ) [virtual]

Implements IGameUIControl.

void ReleaseDeviceDependentResources ( )
void ReleaseDeviceDependentResources ( )

Definition at line 243 of file GameInfoOverlay.cpp.

{
    m_levelBitmap.Reset();
    m_tooSmallBitmap.Reset();
    m_textBrush.Reset();
    m_backgroundBrush.Reset();
    m_actionBrush.Reset();
}

virtual void SetAction ( Simple3DGameDX::GameInfoOverlayCommand action ) [virtual]

Implements IGameUIControl.

void SetAction ( Simple3DGameDX::GameInfoOverlayCommand action ) [virtual]

Implements IGameUIControl.

Definition at line 522 of file GameInfoOverlay.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.Get());

    switch (action)
    {
    case GameInfoOverlayCommand::PlayAgain:
        m_actionString = "Tap to play again ...";
        break;
    case GameInfoOverlayCommand::PleaseWait:
        m_actionString = "Level loading, please wait ...";
        break;
    case GameInfoOverlayCommand::TapToContinue:
        m_actionString = "Tap to continue ...";
        break;
    default:
        m_actionString = "";
        break;
    }
    if (action != GameInfoOverlayCommand::None)
    {
        d2dContext->DrawText(
            m_actionString->Data(),
            m_actionString->Length(),
            m_textFormatBody.Get(),
            m_actionRectangle,
            m_actionBrush.Get()
            );
    }

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SetGameLoading ( uint32_t dots ) [virtual]

Definition at line 236 of file GameInfoOverlay.cpp.

{
    int length;
    m_titleString = L"Loading Resources";
    m_bodyString = L"";

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
    d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.get());

    d2dContext->DrawText(
        m_titleString.c_str(),
        m_titleString.size(),
        m_textFormatTitle.get(),
        m_titleRectangle,
        m_textBrush.get()
        );

    dots = dots % 10;
    for (length = 0; length < 25; length++)
    {
        wsbuffer[length] = L' ';
    }
    for (uint32_t i = 0; i < dots; i++)
    {
        wsbuffer[length++] = 0x25CF;   // This is a Dot character in the font.
        wsbuffer[length++] = L' ';
        wsbuffer[length++] = L' ';
        wsbuffer[length++] = L' ';
    }

    m_bodyString = std::wstring(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString.c_str(),
        m_bodyString.size(),
        m_textFormatBody.get(),
        m_bodyRectangle,
        m_actionBrush.get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        winrt::check_hresult(hr);
    }
}

void SetGameLoading ( uint32 dots ) [virtual]

Implements IGameUIControl.

Definition at line 254 of file GameInfoOverlay.cpp.

{
    int length;
    m_titleString = "Loading Resources";
    m_bodyString = "";

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.Get());

    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_titleRectangle,
        m_textBrush.Get()
        );

    dots = dots % 10;
    for (length = 0; length < 25; length++)
    {
        wsbuffer[length] = L' ';
    }
    for (uint32 i = 0; i < dots; i++)
    {
        wsbuffer[length++] = 0x25CF;   // This is a Dot character in the font.
        wsbuffer[length++] = L' ';
        wsbuffer[length++] = L' ';
        wsbuffer[length++] = L' ';
    }

    m_bodyString = ref new Platform::String(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString->Data(),
        m_bodyString->Length(),
        m_textFormatBody.Get(),
        m_bodyRectangle,
        m_actionBrush.Get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SetGameOver | ( | bool | win,
 |  | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | int | highScore |
 | ) |  |  | [virtual]

Implements IGameUIControl.

Definition at line 358 of file GameInfoOverlay.cpp.

{
    int length;

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    if (win)
    {
        m_titleString = "You WON!";
    }
    else
    {
        m_titleString = "Game Over";
    }
    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_titleRectangle,
        m_textBrush.Get()
        );
    length = swprintf_s(
        wsbuffer,
        bufferLength,
        L"Levels Completed %d\nTotal Points %d\nTotal Shots %d\n\nHigh Score %d\n",
        maxLevel,
        hitCount,
        shotCount,
        highScore
        );
    m_bodyString = ref new Platform::String(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString->Data(),
        m_bodyString->Length(),
        m_textFormatBody.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

virtual void SetGameOver | ( | bool | win,
 |  | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | int | highScore |
 | ) |  |  | [virtual]

Implements IGameUIControl.

void SetGameStats | ( | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount |
 | ) |  |  | [virtual]

Implements IGameUIControl.

Definition at line 310 of file GameInfoOverlay.cpp.

{
    int length;

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    m_titleString = "High Score";

    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_titleRectangle,
        m_textBrush.Get()
        );
    length = swprintf_s(
        wsbuffer,
        bufferLength,
        L"Levels Completed %d\nTotal Points %d\nTotal Shots %d",
        maxLevel,
        hitCount,
        shotCount
        );
    m_bodyString = ref new Platform::String(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString->Data(),
        m_bodyString->Length(),
        m_textFormatBody.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

virtual void SetGameStats | ( | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount |
 | ) |  |  | [virtual]

Implements IGameUIControl.

void SetLevelStart | ( | int | level,
 |  | Platform::String^ | objective,
 |  | float | timeLimit,
 |  | float | bonusTime |
 | ) |  |  | [virtual]

Implements IGameUIControl.

Definition at line 413 of file GameInfoOverlay.cpp.

{
    int length;

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    length = swprintf_s(wsbuffer, bufferLength, L"Level %d", level);
    m_titleString = ref new Platform::String(wsbuffer, length);
    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_titleRectangle,
        m_textBrush.Get()
        );

    if (bonusTime > 0.0f)
    {
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Objective: %ls\nTime  Limit: %6.1f sec\nBonus Time: %6.1f sec\n",
            objective->Data(),
            timeLimit,
            bonusTime
            );
    }
    else
    {
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Objective: %ls\nTime  Limit: %6.1f sec\n",
            objective->Data(),
            timeLimit
            );
    }
    m_bodyString = ref new Platform::String(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString->Data(),
        m_bodyString->Length(),
        m_textFormatBody.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void SetLevelStart | ( | int | level,
 |  | std::wstring const & | objective,
 |  | float | timeLimit,
 |  | float | bonusTime |
 | ) |  |  | [virtual]

Definition at line 389 of file GameInfoOverlay.cpp.

{
    int length;

    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
    length = swprintf_s(wsbuffer, bufferLength, L"Level %d", level);
    m_titleString = std::wstring(wsbuffer, length);
    d2dContext->DrawText(
        m_titleString.c_str(),
        m_titleString.size(),
        m_textFormatTitle.get(),
        m_titleRectangle,
        m_textBrush.get()
        );

    if (bonusTime > 0.0f)
    {
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Objective: %ls\nTime  Limit: %6.1f sec\nBonus Time: %6.1f sec\n",
            objective.c_str(),
            timeLimit,
            bonusTime
            );
    }
    else
    {
        length = swprintf_s(
            wsbuffer,
            bufferLength,
            L"Objective: %ls\nTime  Limit: %6.1f sec\n",
            objective.c_str(),
            timeLimit
            );
    }
    m_bodyString = winrt::hstring(wsbuffer, length);
    d2dContext->DrawText(
        m_bodyString.c_str(),
        m_bodyString.size(),
        m_textFormatBody.get(),
        m_bodyRectangle,
        m_textBrush.get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        winrt::check_hresult(hr);
    }
}

virtual void SetPause | ( | int | level,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | float | timeRemaining |
 | ) |  |  | [virtual]

Implements IGameUIControl.

void SetPause | ( | int | level,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | float | timeRemaining |
 | ) |  |  | [virtual]

Implements IGameUIControl.

Definition at line 475 of file GameInfoOverlay.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    d2dContext->SetTarget(m_levelBitmap.Get());
    d2dContext->BeginDraw();
    d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
    d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
    d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
    m_titleString = "Game Paused";
    m_bodyString = "";

    d2dContext->DrawText(
        m_titleString->Data(),
        m_titleString->Length(),
        m_textFormatTitle.Get(),
        m_bodyRectangle,
        m_textBrush.Get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

virtual void ShowGameInfoOverlay ( ) [inline, virtual]

Implements IGameUIControl.

Definition at line 53 of file GameInfoOverlay.h.

{ m_visible = true; };

virtual void ShowGameInfoOverlay ( ) [inline, virtual]

Implements IGameUIControl.

Definition at line 54 of file GameInfoOverlay.h.

{ m_visible = true; };

void ShowTooSmall ( ) [virtual]

Implements IGameUIControl.

Definition at line 506 of file GameInfoOverlay.cpp.

{
    m_visible = true;
    m_tooSmallActive = true;
}

virtual void ShowTooSmall ( ) [virtual]

Implements IGameUIControl.

bool Visible ( ) [inline]

Definition at line 42 of file GameInfoOverlay.h.

{ return m_visible; };

bool Visible ( ) [inline]

Definition at line 41 of file GameInfoOverlay.h.

{ return m_visible; };

Member Data Documentation

internal __pad0__

Definition at line 35 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_actionBrush [private]

Definition at line 74 of file GameInfoOverlay.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_actionBrush [private]

Definition at line 75 of file GameInfoOverlay.h.

D2D1_RECT_F m_actionRectangle [private]

Definition at line 66 of file GameInfoOverlay.h.

Platform::String m_actionString [private]

Definition at line 77 of file GameInfoOverlay.h.

std::wstring m_actionString [private]

Definition at line 78 of file GameInfoOverlay.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_backgroundBrush [private]

Definition at line 74 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_backgroundBrush [private]

Definition at line 73 of file GameInfoOverlay.h.

D2D1_RECT_F m_bodyRectangle [private]

Definition at line 65 of file GameInfoOverlay.h.

Platform::String m_bodyString [private]

Definition at line 76 of file GameInfoOverlay.h.

std::wstring m_bodyString [private]

Definition at line 77 of file GameInfoOverlay.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 59 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_levelBitmap [private]

Definition at line 68 of file GameInfoOverlay.h.

winrt::com_ptr<ID2D1Bitmap1> m_levelBitmap [private]

Definition at line 69 of file GameInfoOverlay.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_textBrush [private]

Definition at line 73 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_textBrush [private]

Definition at line 72 of file GameInfoOverlay.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatBody [private]

Definition at line 72 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormatBody [private]

Definition at line 71 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormatTitle [private]

Definition at line 70 of file GameInfoOverlay.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormatTitle [private]

Definition at line 71 of file GameInfoOverlay.h.

D2D1_RECT_F m_titleRectangle [private]

Definition at line 64 of file GameInfoOverlay.h.

Platform::String m_titleString [private]

Definition at line 75 of file GameInfoOverlay.h.

std::wstring m_titleString [private]

Definition at line 76 of file GameInfoOverlay.h.

bool m_tooSmallActive [private]

Definition at line 62 of file GameInfoOverlay.h.

winrt::com_ptr<ID2D1Bitmap1> m_tooSmallBitmap [private]

Definition at line 70 of file GameInfoOverlay.h.

Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_tooSmallBitmap [private]

Definition at line 69 of file GameInfoOverlay.h.

bool m_visible [private]

Definition at line 61 of file GameInfoOverlay.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/GameInfoOverlay.h
  • Simple3DGameDX/cppwinrt/GameInfoOverlay.h
  • Simple3DGameDX/cpp/GameInfoOverlay.cpp
  • Simple3DGameDX/cppwinrt/GameInfoOverlay.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Member Functions | Private Attributes

GameMain Class Reference

#include "GameMain.h"

List of all members.

Public Member Functions

GameMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
GameMain (std::shared_ptr< DX::DeviceResources > const &deviceResources)
GameMain (const std::shared_ptr< DX::DeviceResources > &deviceResources, Simple3DGameXaml::IGameUIControl^UIControl)
~GameMain ()
~GameMain ()
~GameMain ()
void | Close ()
void | Close ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CycleBackground ()
Concurrency::critical_section & | GetCriticalSection ()
void | LicenseChanged (Windows::ApplicationModel::Store::ListingInformation^listing, Windows::ApplicationModel::Store::LicenseInformation^license)
virtual void | OnDeviceLost ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
virtual void | OnDeviceRestored ()
virtual void | OnDeviceRestored ()
void | PauseRequested ()
void | PauseRequested ()
void | PauseRequested ()
void | PressComplete ()
void | PressComplete ()
void | PressComplete ()
void | ResetGame ()
void | ResetGame ()
void | ResetGame ()
void | Resume ()
void | Resume ()
void | Resume ()
void | Run ()
void | Run ()
void | SetBackground (unsigned int background)
void | StartRenderLoop ()
void | StopRenderLoop ()
void | Suspend ()
void | Suspend ()
void | Suspend ()
void | Visibility (bool visible)
void | Visibility (bool visible)
void | WindowActivationChanged (Windows::UI::Core::CoreWindowActivationState activationState)
void | WindowActivationChanged (Windows::UI::Core::CoreWindowActivationState activationState)
void | WindowActivationChanged (winrt::Windows::UI::Core::CoreWindowActivationState activationState)

Private Member Functions

winrt::fire_and_forget | ConstructInBackground ()
winrt::fire_and_forget | HandleDeviceRestored ()
void | InitializeGameState ()
void | InitializeGameState ()
void | InitializeGameState ()
void | InitializeLicense ()
void | InitializeLicenseCore ()
winrt::fire_and_forget | LoadAndFinalizeLevelInBackground (bool renderNeeded=false)
void | OnLicenseChanged ()
void | SetGameInfoOverlay (GameControl::GameInfoOverlayState state)
void | SetGameInfoOverlay (GameControl::GameInfoOverlayState state)
void | SetGameInfoOverlay (GameControl::GameInfoOverlayState state)
void | Update ()
void | Update ()
void | Update ()
void | UpdateLayoutState ()
void | UpdateLayoutState ()
void | UpdateLayoutState ()
void | WaitingForResourceLoading ()
void | WaitingForResourceLoading ()

Private Attributes

MoveLookController m_controller
std::shared_ptr
< MoveLookController > 		m_controller
Concurrency::critical_section | m_criticalSection
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Simple3DGame m_game
std::shared_ptr< Simple3DGame > | m_game
Simple3DGameDX::GameInfoOverlayCommand m_gameInfoOverlayCommand
GameControl::GameInfoOverlayState m_gameInfoOverlayState
bool | m_haveFocus
Windows::ApplicationModel::Store::LicenseInformation | m_licenseInformation
Windows::ApplicationModel::Store::ListingInformation | m_listingInformation
uint32 | m_loadingCount
uint32_t | m_loadingCount
bool | m_pauseRequested
bool | m_pressComplete
GameControl::PressResultState m_pressResult
std::shared_ptr< GameRenderer > | m_renderer
GameRenderer m_renderer
Windows::Foundation::IAsyncAction | m_renderLoopWorker
bool | m_renderNeeded
Simple3DGameXaml::IGameUIControl m_uiControl
Simple3DGameDX::IGameUIControl * m_uiControl
Simple3DGameDX::IGameUIControl m_uiControl
GameControl::UpdateEngineState m_updateState
GameControl::UpdateEngineState m_updateStateNext
bool | m_visible
bool | m_windowClosed

Detailed Description

Definition at line 83 of file GameMain.h.

Constructor & Destructor Documentation

GameMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 32 of file GameMain.cpp.

                                                                          :
    m_deviceResources(deviceResources),
    m_windowClosed(false),
    m_haveFocus(false),
    m_gameInfoOverlayCommand(GameInfoOverlayCommand::None),
    m_visible(true),
    m_loadingCount(0),
    m_updateState(UpdateEngineState::WaitingForResources)
{
    m_deviceResources->RegisterDeviceNotify(this);

    m_renderer = ref new GameRenderer(m_deviceResources);
    m_game = ref new Simple3DGame();

    m_uiControl = m_renderer->GameUIControl();

    m_controller = ref new MoveLookController(CoreWindow::GetForCurrentThread());

    auto bounds = m_deviceResources->GetLogicalSize();

    m_controller->SetMoveRect(
        XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
        );
    m_controller->SetFireRect(
        XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(bounds.Width, bounds.Height)
        );

    SetGameInfoOverlay(GameInfoOverlayState::Loading);
    m_uiControl->SetAction(GameInfoOverlayCommand::None);
    m_uiControl->ShowGameInfoOverlay();

    create_task([this]()
    {
        // Asynchronously initialize the game class and load the renderer device resources.
        // By doing all this asynchronously, the game gets to its main loop more quickly
        // and in parallel all the necessary resources are loaded on other threads.
        m_game->Initialize(m_controller, m_renderer);

        return m_renderer->CreateGameDeviceResourcesAsync(m_game);

    }).then([this]()
    {
        // The finalize code needs to run in the same thread context
        // as the m_renderer object was created because the D3D device context
        // can ONLY be accessed on a single thread.
        m_renderer->FinalizeCreateGameDeviceResources();

        InitializeGameState();

        if (m_updateState == UpdateEngineState::WaitingForResources)
        {
            // In the middle of a game so spin up the async task to load the level.
            return m_game->LoadLevelAsync().then([this]()
            {
                // The m_game object may need to deal with D3D device context work so
                // again the finalize code needs to run in the same thread
                // context as the m_renderer object was created because the D3D
                // device context can ONLY be accessed on a single thread.
                m_game->FinalizeLoadLevel();
                m_game->SetCurrentLevelToSavedState();
                m_updateState = UpdateEngineState::ResourcesLoaded;

            }, task_continuation_context::use_current());
        }
        else
        {
            // The game is not in the middle of a level so there aren't any level
            // resources to load.  Creating a no-op task so that in both cases
            // the same continuation logic is used.
            return create_task([]()
            {
            });
        }
    }, task_continuation_context::use_current()).then([this]()
    {
        // Since Game loading is an async task, the app visual state
        // may be too small or not have focus.  Put the state machine
        // into the correct state to reflect these cases.

        if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::TooSmall;
            m_controller->Active(false);
            m_uiControl->HideGameInfoOverlay();
            m_uiControl->ShowTooSmall();
            m_renderNeeded = true;
        }
        else if (!m_haveFocus)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::Deactivated;
            m_controller->Active(false);
            m_uiControl->SetAction(GameInfoOverlayCommand::None);
            m_renderNeeded = true;
        }
    }, task_continuation_context::use_current());
}

~GameMain ( )

Definition at line 135 of file GameMain.cpp.

{
    // Deregister device notification
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

GameMain ( std::shared_ptr< DX::DeviceResources > const & deviceResources )
~GameMain ( )
GameMain | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | Simple3DGameXaml::IGameUIControl^ | UIControl
 | ) |  |

Definition at line 37 of file GameMain.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_uiControl(UIControl)
{
    m_deviceResources->RegisterDeviceNotify(this);

    m_renderer = ref new GameRenderer(m_deviceResources);
    m_game = ref new Simple3DGame();

    m_controller = ref new MoveLookController(Window::Current->CoreWindow, m_deviceResources->GetSwapChainPanel()->Dispatcher);

    m_controller->AutoFire(false);

    auto bounds = m_deviceResources->GetLogicalSize();

    m_controller->SetMoveRect(
        XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
        );
    m_controller->SetFireRect(
        XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(bounds.Width, bounds.Height)
        );

    SetGameInfoOverlay(GameInfoOverlayState::Loading);
    m_uiControl->SetAction(GameInfoOverlayCommand::None);
    m_uiControl->ShowGameInfoOverlay();

    create_task([this]()
    {
        // Asynchronously initialize the game class and load the renderer device resources.
        // By doing all this asynchronously, the game gets to its main loop more quickly
        // and in parallel all the necessary resources are loaded on other threads.
        m_game->Initialize(m_controller, m_renderer);

        return m_renderer->CreateGameDeviceResourcesAsync(m_game);

    }).then([this]()
    {
        // The finalize code needs to run in the same thread context
        // as the m_renderer object was created because the D3D device context
        // can ONLY be accessed on a single thread.
        {
            critical_section::scoped_lock lock(m_criticalSection);
            m_renderer->FinalizeCreateGameDeviceResources();
        }

        InitializeGameState();

        if (m_updateState == UpdateEngineState::WaitingForResources)
        {
            return m_game->LoadLevelAsync().then([this]()
            {
                // The m_game object may need to deal with D3D device context work so
                // again the finalize code needs to run in the same thread
                // context as the m_renderer object was created because the D3D
                // device context can ONLY be accessed on a single thread.
                critical_section::scoped_lock lock(m_criticalSection);
                m_game->FinalizeLoadLevel();
                m_game->SetCurrentLevelToSavedState();
                m_updateState = UpdateEngineState::ResourcesLoaded;

            }, task_continuation_context::use_current());
        }
        else
        {
            // The game is not in the middle of a level so there aren't any level
            // resources to load.  Creating a no-op task so that in both cases
            // the same continuation logic is used.
            return create_task([]()
            {
            });
        }
    }, task_continuation_context::use_current()).then([this]()
    {
        // Since Game loading is an async task, the app visual state
        // may be too small or not have focus.  Put the state machine
        // into the correct state to reflect these cases.

        if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::TooSmall;
            m_controller->Active(false);
            m_uiControl->HideGameInfoOverlay();
            m_uiControl->ShowTooSmall();
        }
        else if (!m_haveFocus)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::Deactivated;
            m_controller->Active(false);
            m_uiControl->SetAction(GameInfoOverlayCommand::None);
        }

        if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
        {
            StartRenderLoop();
        }
    }, task_continuation_context::use_current());
}

~GameMain ( )

Member Function Documentation

void Close ( ) [inline]

Definition at line 93 of file GameMain.h.

{ m_windowClosed = true; }

void Close ( ) [inline]

Definition at line 88 of file GameMain.h.

{ m_windowClosed = true; }

winrt::fire_and_forget ConstructInBackground ( ) [private]

Definition at line 59 of file GameMain.cpp.

{
    auto lifetime = get_strong();

    m_game->Initialize(m_controller, m_renderer);

    co_await m_renderer->CreateGameDeviceResourcesAsync(m_game);

    // The finalize code needs to run in the same thread context
    // as the m_renderer object was created because the D3D device context
    // can ONLY be accessed on a single thread.
    // co_await of an IAsyncAction resumes in the same thread context.
    m_renderer->FinalizeCreateGameDeviceResources();

    InitializeGameState();

    if (m_updateState == UpdateEngineState::WaitingForResources)
    {
        // In the middle of a game so spin up the async task to load the level.
        co_await m_game->LoadLevelAsync();

        // The m_game object may need to deal with D3D device context work so
        // again the finalize code needs to run in the same thread
        // context as the m_renderer object was created because the D3D
        // device context can ONLY be accessed on a single thread.
        m_game->FinalizeLoadLevel();
        m_game->SetCurrentLevelToSavedState();
        m_updateState = UpdateEngineState::ResourcesLoaded;
    }
    else
    {
        // The game is not in the middle of a level so there aren't any level
        // resources to load.
    }

    // Since Game loading is an async task, the app visual state
    // may be too small or not have focus. Put the state machine
    // into the correct state to reflect these cases.

    if (m_deviceResources->GetLogicalSize().Width < GameUIConstants::MinPlayableWidth)
    {
        m_updateStateNext = m_updateState;
        m_updateState = UpdateEngineState::TooSmall;
        m_controller->Active(false);
        m_uiControl->HideGameInfoOverlay();
        m_uiControl->ShowTooSmall();
        m_renderNeeded = true;
    }
    else if (!m_haveFocus)
    {
        m_updateStateNext = m_updateState;
        m_updateState = UpdateEngineState::Deactivated;
        m_controller->Active(false);
        m_uiControl->SetAction(GameInfoOverlayCommand::None);
        m_renderNeeded = true;
    }
}

void CreateWindowSizeDependentResources ( )
void CreateWindowSizeDependentResources ( )
void CreateWindowSizeDependentResources ( )

Definition at line 395 of file GameMain.cpp.

{
    UpdateLayoutState();
    m_renderer->CreateWindowSizeDependentResources();

    // The location of the Control regions may have changed with the size change so update the controller.
    auto bounds = m_deviceResources->GetLogicalSize();

    m_controller->SetMoveRect(
        XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
        );
    m_controller->SetFireRect(
        XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
        XMFLOAT2(bounds.Width, bounds.Height)
        );

    if (m_updateState == UpdateEngineState::WaitingForPress)
    {
        // A side effect of m_renderer->UpdateForWindowSizeChange() is that the GameInfoOverlay rectangle may have
        // changed as a result of layout, so make sure the WaitForPress rectangle is set to the new size.
        m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
    }

    m_renderNeeded = true;
}

void CycleBackground ( )

Definition at line 785 of file GameMain.cpp.

{
    m_game->CycleBackground();

    m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    SetGameInfoOverlay(GameInfoOverlayState::Loading);
    m_updateState = UpdateEngineState::WaitingForResources;

    create_task([this]()
    {
        return m_renderer->LoadLevelResourcesAsync();

    }).then([this]()
    {
        // The finalize code needs to run in the same thread context
        // as the m_renderer object was created because the D3D device context
        // can ONLY be accessed on a single thread.
        critical_section::scoped_lock lock(m_criticalSection);
        m_renderer->FinalizeLoadLevelResources();
        m_updateState = UpdateEngineState::ResourcesLoaded;

    }, task_continuation_context::use_current());

}

Concurrency::critical_section& GetCriticalSection ( ) [inline]

Definition at line 93 of file GameMain.h.

{ return m_criticalSection; }

winrt::fire_and_forget HandleDeviceRestored ( ) [private]

Definition at line 414 of file GameMain.cpp.

{
    auto lifetime = get_strong();

    m_renderer->CreateDeviceDependentResources();
    m_renderer->CreateWindowSizeDependentResources();

    m_loadingCount = 0;
    m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    SetGameInfoOverlay(GameInfoOverlayState::Loading);
    m_updateState = UpdateEngineState::WaitingForResources;
    m_renderNeeded = true;

    co_await m_renderer->CreateGameDeviceResourcesAsync(m_game);

    // The finalize code needs to run in the same thread context
    // as the m_renderer object was created because the D3D device context
    // can ONLY be accessed on a single thread.
    // co_await of an IAsyncAction resumes in the same thread context.
    m_renderer->FinalizeCreateGameDeviceResources();

    // Reset the main state machine based on the current game state now
    // that the device resources have been restored.
    InitializeGameState();

    if (m_updateState == UpdateEngineState::WaitingForResources)
    {
        // In the middle of a game so spin up the async task to load the level.
        co_await m_game->LoadLevelAsync();
        // The m_game object may need to deal with D3D device context work so
        // again the finalize code needs to run in the same thread
        // context as the m_renderer object was created because the D3D
        // device context can be accessed ONLY on a single thread.
    // co_await of an IAsyncAction resumes in the same thread context.
        m_game->FinalizeLoadLevel();
        m_game->SetCurrentLevelToSavedState();
        m_updateState = UpdateEngineState::ResourcesLoaded;
        m_renderNeeded = true;

    }
    else
    {
        // The game is not in the middle of a level so there aren't any level
        // resources to load.
    }

    // Since Device lost is an unexpected event, the app visual state
    // may be TooSmall or not have focus. Put the state machine
    // into the correct state to reflect these cases.
    if (CoreWindow::GetForCurrentThread().Bounds().Width < GameUIConstants::MinPlayableWidth)
    {
        m_updateStateNext = m_updateState;
        m_updateState = UpdateEngineState::TooSmall;
        m_controller->Active(false);
        m_uiControl->HideGameInfoOverlay();
        m_uiControl->ShowTooSmall();
        m_renderNeeded = true;
    }
    else if (!m_haveFocus)
    {
        m_updateStateNext = m_updateState;
        m_updateState = UpdateEngineState::Deactivated;
        m_controller->Active(false);
        m_uiControl->SetAction(GameInfoOverlayCommand::None);
        m_renderNeeded = true;
    }
}

void InitializeGameState ( ) [private]
void InitializeGameState ( ) [private]
void InitializeGameState ( ) [private]

Definition at line 206 of file GameMain.cpp.

{
    // Set up the initial state machine for handling Game playing state.
    if (m_game->GameActive() && m_game->LevelActive())
    {
        // The last time the game terminated it was in the middle
        // of a level.
        // We are waiting for the user to continue the game.
        m_updateState = UpdateEngineState::WaitingForResources;
        m_pressResult = PressResultState::ContinueLevel;
        SetGameInfoOverlay(GameInfoOverlayState::Pause);
        m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    }
    else if (!m_game->GameActive() && (m_game->HighScore().totalHits > 0))
    {
        // The last time the game terminated the game had been completed.
        // Show the high score.
        // We are waiting for the user to acknowledge the high score and start a new game.
        // The level resources for the first level will be loaded later.
        m_updateState = UpdateEngineState::WaitingForPress;
        m_pressResult = PressResultState::LoadGame;
        SetGameInfoOverlay(GameInfoOverlayState::GameStats);
        m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
        m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
    }
    else
    {
        // This is either the first time the game has run or
        // the last time the game terminated the level was completed.
        // We are waiting for the user to begin the next level.
        m_updateState = UpdateEngineState::WaitingForResources;
        m_pressResult = PressResultState::PlayLevel;
        SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
        m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    }
    m_uiControl->ShowGameInfoOverlay();
}

void InitializeLicense ( ) [private]
void InitializeLicenseCore ( ) [private]
void LicenseChanged | ( | Windows::ApplicationModel::Store::ListingInformation^ | listing,
 |  | Windows::ApplicationModel::Store::LicenseInformation^ | license
 | ) |  |
winrt::fire_and_forget LoadAndFinalizeLevelInBackground ( bool renderNeeded = false ) [private]

Definition at line 358 of file GameMain.cpp.

{
    auto lifetime = get_strong();

    co_await m_game->LoadLevelAsync();
    m_game->FinalizeLoadLevel();
    m_updateState = UpdateEngineState::ResourcesLoaded;
    if (renderNeeded)
    {
        m_renderNeeded = true;
    }
}

virtual void OnDeviceLost ( ) [virtual]
virtual void OnDeviceLost ( ) [virtual]
void OnDeviceLost ( ) [virtual]

Definition at line 424 of file GameMain.cpp.

{
    if (m_updateState == UpdateEngineState::Dynamics)
    {
        // Game is in the active game play state, Stop Game Timer and Pause play and save state
        m_game->PauseGame();
    }
    m_renderNeeded = false;
    m_renderer->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 437 of file GameMain.cpp.

{
    m_renderer->CreateDeviceDependentResources();
    m_renderer->CreateWindowSizeDependentResources();

    m_loadingCount = 0;
    m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    SetGameInfoOverlay(GameInfoOverlayState::Loading);
    m_updateState = UpdateEngineState::WaitingForResources;
    m_renderNeeded = true;

    create_task([this]()
    {
        return m_renderer->CreateGameDeviceResourcesAsync(m_game);

    }).then([this]()
    {
        // The finalize code needs to run in the same thread context
        // as the m_renderer object was created because the D3D device context
        // can ONLY be accessed on a single thread.
        m_renderer->FinalizeCreateGameDeviceResources();

        // Reset the main state machine based on the current game state now
        // that the device resources have been restored.
        InitializeGameState();

        if (m_updateState == UpdateEngineState::WaitingForResources)
        {
            // In the middle of a game so spin up the async task to load the level.
            return m_game->LoadLevelAsync().then([this]()
            {
                // The m_game object may need to deal with D3D device context work so
                // again the finalize code needs to run in the same thread
                // context as the m_renderer object was created because the D3D
                // device context can ONLY be accessed on a single thread.
                m_game->FinalizeLoadLevel();
                m_game->SetCurrentLevelToSavedState();
                m_updateState = UpdateEngineState::ResourcesLoaded;
                m_renderNeeded = true;

            }, task_continuation_context::use_current());
        }
        else
        {
            // The game is not in the middle of a level so there aren't any level
            // resources to load.  Creating a no-op task so that in both cases
            // the same continuation logic is used.
            return create_task([]()
            {
            });
        }

    }, task_continuation_context::use_current()).then([this]()
    {
        // Since Device lost is an unexpected event, the app visual state
        // may be TooSmall or not have focus.  Put the state machine
        // into the correct state to reflect these cases.
        if (CoreWindow::GetForCurrentThread()->Bounds.Width < GameConstants::MinPlayableWidth)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::TooSmall;
            m_controller->Active(false);
            m_uiControl->HideGameInfoOverlay();
            m_uiControl->ShowTooSmall();
            m_renderNeeded = true;
        }
        else if (!m_haveFocus)
        {
            m_updateStateNext = m_updateState;
            m_updateState = UpdateEngineState::Deactivated;
            m_controller->Active(false);
            m_uiControl->SetAction(GameInfoOverlayCommand::None);
            m_renderNeeded = true;
        }
    }, task_continuation_context::use_current());
}

virtual void OnDeviceRestored ( ) [virtual]
virtual void OnDeviceRestored ( ) [virtual]
void OnLicenseChanged ( ) [private]
void PauseRequested ( ) [inline]

Definition at line 99 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };

void PauseRequested ( ) [inline]

Definition at line 99 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };

void PauseRequested ( ) [inline]

Definition at line 94 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };

void PressComplete ( ) [inline]

Definition at line 100 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };

void PressComplete ( ) [inline]

Definition at line 100 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };

void PressComplete ( ) [inline]

Definition at line 95 of file GameMain.h.

{ if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };

void ResetGame ( )
void ResetGame ( )
void ResetGame ( )

Definition at line 606 of file GameMain.cpp.

{
    m_updateState = UpdateEngineState::WaitingForResources;
    m_pressResult = PressResultState::PlayLevel;
    m_controller->Active(false);
    m_game->LoadGame();
    m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
    SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
    m_uiControl->ShowGameInfoOverlay();
    m_renderNeeded = true;

    m_game->LoadLevelAsync().then([this]()
    {
        m_game->FinalizeLoadLevel();
        m_updateState = UpdateEngineState::ResourcesLoaded;
        m_renderNeeded = true;

    }, task_continuation_context::use_current());
}

void Resume ( )

Definition at line 775 of file GameMain.cpp.

{
    if (m_haveFocus)
    {
        m_updateState = m_updateStateNext;
    }
    else
    {
        m_updateState = UpdateEngineState::Deactivated;
    }

    if (m_updateState == UpdateEngineState::WaitingForPress)
    {
        m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
        m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
    }
    m_game->OnResuming();
    m_uiControl->ShowGameInfoOverlay();
    m_renderNeeded = true;
}

void Resume ( )
void Resume ( )
void Run ( )

Definition at line 143 of file GameMain.cpp.

{
    while (!m_windowClosed)
    {
        if (m_visible)
        {
            switch (m_updateState)
            {
            case UpdateEngineState::Deactivated:
            case UpdateEngineState::TooSmall:
                if (m_updateStateNext == UpdateEngineState::WaitingForResources)
                {
                    WaitingForResourceLoading();
                    m_renderNeeded = true;
                }
                else if (m_updateStateNext == UpdateEngineState::ResourcesLoaded)
                {
                    // In the device lost case, we transition to the final waiting state
                    // and make sure the display is updated.
                    switch (m_pressResult)
                    {
                    case PressResultState::LoadGame:
                        SetGameInfoOverlay(GameInfoOverlayState::GameStats);
                        break;

                    case PressResultState::PlayLevel:
                        SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
                        break;

                    case PressResultState::ContinueLevel:
                        SetGameInfoOverlay(GameInfoOverlayState::Pause);
                        break;
                    }
                    m_updateStateNext = UpdateEngineState::WaitingForPress;
                    m_uiControl->ShowGameInfoOverlay();
                    m_renderNeeded = true;
                }

                if (!m_renderNeeded)
                {
                    // The App is not currently the active window and not in a transient state so just wait for events.
                    CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
                    break;
                }
                // otherwise fall through and do normal processing to get the rendering handled.
            default:
                CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
                Update();
                m_renderer->Render();
                m_deviceResources->Present();
                m_renderNeeded = false;
            }
        }
        else
        {
            CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
        }
    }
    m_game->OnSuspending();  // exiting due to window close.  Make sure to save state.
}

void Run ( )
void SetBackground ( unsigned int background )

Definition at line 778 of file GameMain.cpp.

{
    m_game->SetBackground(background);
}

void SetGameInfoOverlay ( GameControl::GameInfoOverlayState state ) [private]
void SetGameInfoOverlay ( GameControl::GameInfoOverlayState state ) [private]
void SetGameInfoOverlay ( GameControl::GameInfoOverlayState state ) [private]

Definition at line 628 of file GameMain.cpp.

{
    m_gameInfoOverlayState = state;
    switch (state)
    {
    case GameInfoOverlayState::Loading:
        m_uiControl->SetGameLoading(m_loadingCount);
        break;

    case GameInfoOverlayState::GameStats:
        m_uiControl->SetGameStats(
            m_game->HighScore().levelCompleted + 1,
            m_game->HighScore().totalHits,
            m_game->HighScore().totalShots
            );
        break;

    case GameInfoOverlayState::LevelStart:
        m_uiControl->SetLevelStart(
            m_game->LevelCompleted() + 1,
            m_game->CurrentLevel()->Objective(),
            m_game->CurrentLevel()->TimeLimit(),
            m_game->BonusTime()
            );
        break;

    case GameInfoOverlayState::GameOverCompleted:
        m_uiControl->SetGameOver(
            true,
            m_game->LevelCompleted() + 1,
            m_game->TotalHits(),
            m_game->TotalShots(),
            m_game->HighScore().totalHits
            );
        break;

    case GameInfoOverlayState::GameOverExpired:
        m_uiControl->SetGameOver(
            false,
            m_game->LevelCompleted(),
            m_game->TotalHits(),
            m_game->TotalShots(),
            m_game->HighScore().totalHits
            );
        break;

    case GameInfoOverlayState::Pause:
        m_uiControl->SetPause(
            m_game->LevelCompleted() + 1,
            m_game->TotalHits(),
            m_game->TotalShots(),
            m_game->TimeRemaining()
            );
        break;
    }
}

void StartRenderLoop ( )

Definition at line 149 of file GameMain.cpp.

{
    // If the animation render loop is already running then do not start another thread.
    if (m_renderLoopWorker != nullptr && m_renderLoopWorker->Status == AsyncStatus::Started)
    {
        return;
    }

    // Create a task that will be run on a background thread.
    auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^ action)
    {
        // Calculate the updated frame and render once per vertical blanking interval.
        while (action->Status == AsyncStatus::Started)
        {
            critical_section::scoped_lock lock(m_criticalSection);
            Update();
            m_renderer->Render();
            m_deviceResources->Present();

            if (!m_haveFocus || (m_updateState == UpdateEngineState::TooSmall))
            {
                // The app is in an inactive state so stop rendering
                // This optimizes for power and allows the framework to become more queiecent
                break;
            }
        }
    });

    // Run task on a dedicated high priority background thread.
    m_renderLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
}

void StopRenderLoop ( )

Definition at line 183 of file GameMain.cpp.

{
    m_renderLoopWorker->Cancel();
}

void Suspend ( )

Definition at line 744 of file GameMain.cpp.

{
    // Save application state.
    switch (m_updateState)
    {
    case UpdateEngineState::Dynamics:
        // Game is in the active game play state, Stop Game Timer and Pause play and save state
        m_uiControl->SetAction(GameInfoOverlayCommand::None);
        SetGameInfoOverlay(GameInfoOverlayState::Pause);
        m_updateStateNext = UpdateEngineState::WaitingForPress;
        m_pressResult = PressResultState::ContinueLevel;
        m_game->PauseGame();
        break;

    case UpdateEngineState::WaitingForResources:
    case UpdateEngineState::WaitingForPress:
        m_updateStateNext = m_updateState;
        break;

    default:
        // any other state don't save as next state as they are trancient states and have already set m_updateStateNext
        break;
    }
    m_updateState = UpdateEngineState::Suspended;

    m_controller->Active(false);
    m_game->OnSuspending();
}

void Suspend ( )
void Suspend ( )
void Update ( ) [private]
void Update ( ) [private]

Definition at line 261 of file GameMain.cpp.

{
    m_controller->Update();

    switch (m_updateState)
    {
    case UpdateEngineState::WaitingForResources:
        WaitingForResourceLoading();
        break;

    case UpdateEngineState::ResourcesLoaded:
        switch (m_pressResult)
        {
        case PressResultState::LoadGame:
            SetGameInfoOverlay(GameInfoOverlayState::GameStats);
            break;

        case PressResultState::PlayLevel:
            SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
            break;

        case PressResultState::ContinueLevel:
            SetGameInfoOverlay(GameInfoOverlayState::Pause);
            break;
        }
        m_updateState = UpdateEngineState::WaitingForPress;
        m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
        m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
        m_uiControl->ShowGameInfoOverlay();
        m_renderNeeded = true;
        break;

    case UpdateEngineState::WaitingForPress:
        if (m_controller->IsPressComplete())
        {
            switch (m_pressResult)
            {
            case PressResultState::LoadGame:
                m_updateState = UpdateEngineState::WaitingForResources;
                m_pressResult = PressResultState::PlayLevel;
                m_controller->Active(false);
                m_game->LoadGame();
                m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
                SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
                m_uiControl->ShowGameInfoOverlay();

                m_game->LoadLevelAsync().then([this]()
                {
                    m_game->FinalizeLoadLevel();
                    m_updateState = UpdateEngineState::ResourcesLoaded;
                }, task_continuation_context::use_current());
                break;

            case PressResultState::PlayLevel:
                m_updateState = UpdateEngineState::Dynamics;
                m_uiControl->HideGameInfoOverlay();
                m_controller->Active(true);
                m_game->StartLevel();
                break;

            case PressResultState::ContinueLevel:
                m_updateState = UpdateEngineState::Dynamics;
                m_uiControl->HideGameInfoOverlay();
                m_controller->Active(true);
                m_game->ContinueGame();
                break;
            }
        }
        break;

    case UpdateEngineState::Dynamics:
        if (m_controller->IsPauseRequested())
        {
            m_game->PauseGame();
            SetGameInfoOverlay(GameInfoOverlayState::Pause);
            m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
            m_updateState = UpdateEngineState::WaitingForPress;
            m_pressResult = PressResultState::ContinueLevel;
            m_uiControl->ShowGameInfoOverlay();
        }
        else
        {
            GameState runState = m_game->RunGame();
            switch (runState)
            {
            case GameState::TimeExpired:
                m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
                SetGameInfoOverlay(GameInfoOverlayState::GameOverExpired);
                m_uiControl->ShowGameInfoOverlay();
                m_updateState = UpdateEngineState::WaitingForPress;
                m_pressResult = PressResultState::LoadGame;
                break;

            case GameState::LevelComplete:
                m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
                SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
                m_uiControl->ShowGameInfoOverlay();
                m_updateState = UpdateEngineState::WaitingForResources;
                m_pressResult = PressResultState::PlayLevel;

                m_game->LoadLevelAsync().then([this]()
                {
                    m_game->FinalizeLoadLevel();
                    m_updateState = UpdateEngineState::ResourcesLoaded;

                }, task_continuation_context::use_current());
                break;

            case GameState::GameComplete:
                m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
                SetGameInfoOverlay(GameInfoOverlayState::GameOverCompleted);
                m_uiControl->ShowGameInfoOverlay();
                m_updateState = UpdateEngineState::WaitingForPress;
                m_pressResult = PressResultState::LoadGame;
                break;
            }
        }

        if (m_updateState == UpdateEngineState::WaitingForPress)
        {
            // Transitioning state, so enable waiting for the press event
            m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
        }
        if (m_updateState == UpdateEngineState::WaitingForResources)
        {
            // Transitioning state, so shut down the input controller until resources are loaded
            m_controller->Active(false);
        }
        break;
    }
}

void Update ( ) [private]
void UpdateLayoutState ( ) [private]

Definition at line 516 of file GameMain.cpp.

{
    m_renderNeeded = true;

    if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
    {
        switch (m_updateState)
        {
        case UpdateEngineState::Dynamics:
            // From Dynamic mode, when coming out of TooSmall layout rather than going directly back into game play
            // go to the paused state waiting for user input to continue
            m_updateStateNext = UpdateEngineState::WaitingForPress;
            m_pressResult = PressResultState::ContinueLevel;
            SetGameInfoOverlay(GameInfoOverlayState::Pause);
            m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
            m_game->PauseGame();
            break;

        case UpdateEngineState::WaitingForResources:
            // There is outstanding async loading in progress.  This state change will be picked up after the
            // async task is completed.
            return;

        case UpdateEngineState::WaitingForPress:
            // Avoid corrupting the m_updateStateNext on a transition from TooSmall -> TooSmall.
            // Otherwise just cache the current state and return to it when leaving TooSmall layout

            m_updateStateNext = m_updateState;
            break;

        default:
            break;
        }

        m_updateState = UpdateEngineState::TooSmall;
        m_controller->Active(false);
        m_uiControl->HideGameInfoOverlay();
        m_uiControl->ShowTooSmall();
    }
    else
    {
        if (m_updateState == UpdateEngineState::TooSmall)
        {
            m_uiControl->HideTooSmall();
            m_uiControl->ShowGameInfoOverlay();
            m_renderNeeded = true;

            if (m_haveFocus)
            {
                if (m_updateStateNext == UpdateEngineState::WaitingForPress)
                {
                    m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
                }
                else if (m_updateStateNext == UpdateEngineState::WaitingForResources)
                {
                    m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
                }

                m_updateState = m_updateStateNext;
            }
            else
            {
                m_updateState = UpdateEngineState::Deactivated;
                m_uiControl->SetAction(GameInfoOverlayCommand::None);
            }
        }
        else if (m_updateState == UpdateEngineState::Dynamics)
        {
            // In Dynamic mode, when a resize event happens, go to the paused state waiting for user input to continue.
            m_pressResult = PressResultState::ContinueLevel;
            SetGameInfoOverlay(GameInfoOverlayState::Pause);
            m_game->PauseGame();
            if (m_haveFocus)
            {
                m_updateState = UpdateEngineState::WaitingForPress;
                m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
            }
            else
            {
                m_updateState = UpdateEngineState::Deactivated;
                m_uiControl->SetAction(GameInfoOverlayCommand::None);
            }
            m_uiControl->ShowGameInfoOverlay();
            m_renderNeeded = true;
        }
    }
}

void UpdateLayoutState ( ) [private]
void UpdateLayoutState ( ) [private]
void Visibility ( bool visible )

Definition at line 798 of file GameMain.cpp.

{
    if (visible && !m_visible)
    {
        m_renderNeeded = true;
    }
    m_visible = visible;
}

void Visibility ( bool visible )
void WaitingForResourceLoading ( ) [private]

Definition at line 246 of file GameMain.cpp.

{
    static uint32 loadCount = 0;

    // Waiting for initial load.  Display an update once per 60 updates.
    if (((loadCount++) % 60) == 0)
    {
        m_loadingCount++;
        SetGameInfoOverlay(m_gameInfoOverlayState);
        m_renderNeeded = true;
    }
}

void WaitingForResourceLoading ( ) [private]
void WindowActivationChanged ( Windows::UI::Core::CoreWindowActivationState activationState )
void WindowActivationChanged ( Windows::UI::Core::CoreWindowActivationState activationState )
void WindowActivationChanged ( winrt::Windows::UI::Core::CoreWindowActivationState activationState )

Member Data Documentation

MoveLookController m_controller [private]

Definition at line 123 of file GameMain.h.

std::shared_ptr<MoveLookController> m_controller [private]

Definition at line 121 of file GameMain.h.

Concurrency::critical_section m_criticalSection [private]

Definition at line 143 of file GameMain.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 120 of file GameMain.h.

Simple3DGame m_game [private]

Definition at line 125 of file GameMain.h.

std::shared_ptr<Simple3DGame> m_game [private]

Definition at line 123 of file GameMain.h.

Simple3DGameDX::GameInfoOverlayCommand m_gameInfoOverlayCommand [private]

Definition at line 131 of file GameMain.h.

GameControl::GameInfoOverlayState m_gameInfoOverlayState [private]

Definition at line 130 of file GameMain.h.

bool m_haveFocus [private]

Definition at line 117 of file GameMain.h.

Windows::ApplicationModel::Store::LicenseInformation m_licenseInformation [private]

Definition at line 137 of file GameMain.h.

Windows::ApplicationModel::Store::ListingInformation m_listingInformation [private]

Definition at line 138 of file GameMain.h.

uint32 m_loadingCount [private]

Definition at line 132 of file GameMain.h.

uint32_t m_loadingCount [private]

Definition at line 130 of file GameMain.h.

bool m_pauseRequested [private]

Definition at line 114 of file GameMain.h.

bool m_pressComplete [private]

Definition at line 115 of file GameMain.h.

GameControl::PressResultState m_pressResult [private]

Definition at line 129 of file GameMain.h.

std::shared_ptr<GameRenderer> m_renderer [private]

Definition at line 122 of file GameMain.h.

GameRenderer m_renderer [private]

Definition at line 124 of file GameMain.h.

Windows::Foundation::IAsyncAction m_renderLoopWorker [private]

Definition at line 144 of file GameMain.h.

bool m_renderNeeded [private]

Definition at line 116 of file GameMain.h.

Simple3DGameXaml::IGameUIControl m_uiControl [private]

Definition at line 127 of file GameMain.h.

Simple3DGameDX::IGameUIControl* m_uiControl [private]

Definition at line 119 of file GameMain.h.

Simple3DGameDX::IGameUIControl m_uiControl [private]

Definition at line 121 of file GameMain.h.

GameControl::UpdateEngineState m_updateState [private]

Definition at line 127 of file GameMain.h.

GameControl::UpdateEngineState m_updateStateNext [private]

Definition at line 128 of file GameMain.h.

bool m_visible [private]

Definition at line 118 of file GameMain.h.

bool m_windowClosed [private]

Definition at line 113 of file GameMain.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/GameMain.h
  • Simple3DGameDX/cppwinrt/GameMain.h
  • Simple3DGameXaml/cpp/GameMain.h
  • Simple3DGameDX/cpp/GameMain.cpp
  • Simple3DGameDX/cppwinrt/GameMain.cpp
  • Simple3DGameXaml/cpp/GameMain.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

GameObject Class Reference

#include "GameObject.h"

Inherited by Cylinder, Face, and Sphere.

List of all members.

Public Member Functions

GameObject ()
void | Active (bool active)
bool | Active ()
void | AnimatePosition (_In_ std::shared_ptr< Animate > const &animate)
std::shared_ptr< Animate > | AnimatePosition ()
void | Hit (bool hit)
bool | Hit ()
void | HitMaterial (_In_ std::shared_ptr< Material > const &material)
std::shared_ptr< Material > | HitMaterial ()
void | HitSound (_In_ std::shared_ptr< SoundEffect > const &hitSound)
std::shared_ptr< SoundEffect > | HitSound ()
void | HitTime (float t)
float | HitTime ()
virtual bool | IsTouching (DirectX::XMFLOAT3, float, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal)
void | Mesh (_In_ std::shared_ptr< MeshObject > const &mesh)
DirectX::XMMATRIX | ModelMatrix ()
void | NormalMaterial (_In_ std::shared_ptr< Material > const &material)
std::shared_ptr< Material > | NormalMaterial ()
void | OnGround (bool ground)
bool | OnGround ()
void | PlaySound (float impactSpeed, DirectX::XMFLOAT3 eyePoint)
DirectX::XMFLOAT3 | Position ()
void | Position (DirectX::XMVECTOR position)
void | Position (DirectX::XMFLOAT3 position)
void | Render (_In_ ID3D11DeviceContext *context, _In_ ID3D11Buffer *primitiveConstantBuffer)
void | Target (bool target)
bool | Target ()
int | TargetId ()
void | TargetId (int targetId)
DirectX::XMVECTOR | VectorPosition ()
DirectX::XMVECTOR | VectorVelocity ()
DirectX::XMFLOAT3 | Velocity ()
void | Velocity (DirectX::XMFLOAT3 velocity)
void | Velocity (DirectX::XMVECTOR velocity)

Protected Attributes

DirectX::XMFLOAT4X4 | m_modelMatrix
DirectX::XMFLOAT3 | m_position

Private Member Functions

virtual void | UpdatePosition ()

Private Attributes

bool | m_active
std::shared_ptr< Animate > | m_animatePosition
DirectX::XMFLOAT3 | m_defaultXAxis
DirectX::XMFLOAT3 | m_defaultYAxis
DirectX::XMFLOAT3 | m_defaultZAxis
bool | m_ground
bool | m_hit
std::shared_ptr< Material > | m_hitMaterial
std::shared_ptr< SoundEffect > | m_hitSound
float | m_hitTime
std::shared_ptr< MeshObject > | m_mesh
std::shared_ptr< Material > | m_normalMaterial
bool | m_target
int | m_targetId
DirectX::XMFLOAT3 | m_velocity

Detailed Description

Definition at line 29 of file GameObject.h.

Constructor & Destructor Documentation

GameObject ( )

Definition at line 18 of file GameObject.cpp.

                       :
    m_normalMaterial(nullptr),
    m_hitMaterial(nullptr)
{
    m_active = false;
    m_target = false;
    m_targetId = 0;
    m_hit = false;
    m_ground = true;

    m_position = XMFLOAT3(0.0f, 0.0f, 0.0f);
    m_velocity = XMFLOAT3(0.0f, 0.0f, 0.0f);
    m_defaultXAxis = XMFLOAT3(1.0f, 0.0f, 0.0f);
    m_defaultYAxis = XMFLOAT3(0.0f, 1.0f, 0.0f);
    m_defaultZAxis = XMFLOAT3(0.0f, 0.0f, 1.0f);
    XMStoreFloat4x4(&m_modelMatrix, XMMatrixIdentity());

    m_hitTime = 0.0f;

    m_animatePosition = nullptr;
}

Member Function Documentation

__forceinline void Active ( bool active )

Definition at line 120 of file GameObject.h.

{
    m_active = active;
}

__forceinline bool Active ( )

Definition at line 125 of file GameObject.h.

{
    return m_active;
}

__forceinline std::shared_ptr< Animate > AnimatePosition ( )

Definition at line 231 of file GameObject.h.

{
    return m_animatePosition;
}

__forceinline void AnimatePosition ( _In_ std::shared_ptr< Animate > const & animate )

Definition at line 226 of file GameObject.h.

{
    m_animatePosition = animate;
}

__forceinline bool Hit ( )

Definition at line 145 of file GameObject.h.

{
    return m_hit;
}

__forceinline void Hit ( bool hit )

Definition at line 140 of file GameObject.h.

{
    m_hit = hit;
}

__forceinline void HitMaterial ( _In_ std::shared_ptr< Material > const & material )

Definition at line 246 of file GameObject.h.

{
    m_hitMaterial = material;
}

__forceinline std::shared_ptr< Material > HitMaterial ( )

Definition at line 251 of file GameObject.h.

{
    return m_hitMaterial;
}

__forceinline void HitSound ( _In_ std::shared_ptr< SoundEffect > const & hitSound )

Definition at line 261 of file GameObject.h.

{
    m_hitSound = hitSound;
}

__forceinline std::shared_ptr< SoundEffect > HitSound ( )

Definition at line 266 of file GameObject.h.

{
    return m_hitSound;
}

__forceinline void HitTime ( float t )

Definition at line 170 of file GameObject.h.

{
    m_hitTime = t;
}

__forceinline float HitTime ( )

Definition at line 175 of file GameObject.h.

{
    return m_hitTime;
}

virtual bool IsTouching | ( | DirectX::XMFLOAT3 | ,
 |  | float | ,
 |  | _Out_ DirectX::XMFLOAT3 * | contact,
 |  | _Out_ DirectX::XMFLOAT3 * | normal |
 | ) |  |  | [inline, virtual]

Reimplemented in Cylinder, Face, and Sphere.

Definition at line 35 of file GameObject.h.

    {
        *contact = DirectX::XMFLOAT3(0.0f, 0.0f, 0.0f);
        *normal = DirectX::XMFLOAT3(0.0f, 0.0f, 1.0f);
        return false;
    };

__forceinline void Mesh ( _In_ std::shared_ptr< MeshObject > const & mesh )

Definition at line 256 of file GameObject.h.

{
    m_mesh = mesh;
}

__forceinline DirectX::XMMATRIX ModelMatrix ( )

Definition at line 271 of file GameObject.h.

{
    return DirectX::XMLoadFloat4x4(&m_modelMatrix);
}

__forceinline void NormalMaterial ( _In_ std::shared_ptr< Material > const & material )

Definition at line 236 of file GameObject.h.

{
    m_normalMaterial = material;
}

__forceinline std::shared_ptr< Material > NormalMaterial ( )

Definition at line 241 of file GameObject.h.

{
    return m_normalMaterial;
}

__forceinline void OnGround ( bool ground )

Definition at line 150 of file GameObject.h.

{
    m_ground = ground;
}

__forceinline bool OnGround ( )

Definition at line 155 of file GameObject.h.

{
    return m_ground;
}

void PlaySound | ( | float | impactSpeed,
 |  | DirectX::XMFLOAT3 | eyePoint
 | ) |  |
__forceinline void Position ( DirectX::XMFLOAT3 position )

Reimplemented in Sphere.

Definition at line 180 of file GameObject.h.

{
    m_position = position;
    // Update any internal states that are dependent on the position.
    // UpdatePosition is a virtual function that is specific to the derived class.
    UpdatePosition();
}

__forceinline void Position ( DirectX::XMVECTOR position )

Reimplemented in Sphere.

Definition at line 188 of file GameObject.h.

{
    XMStoreFloat3(&m_position, position);
    // Update any internal states that are dependent on the position.
    // UpdatePosition is a virtual function that is specific to the derived class.
    UpdatePosition();
}

__forceinline DirectX::XMFLOAT3 Position ( )

Definition at line 196 of file GameObject.h.

{
    return m_position;
}

void Render | ( | _In_ ID3D11DeviceContext * | context,
 |  | _In_ ID3D11Buffer * | primitiveConstantBuffer
 | ) |  |

Definition at line 40 of file GameObject.cpp.

{
    if (!m_active || (m_mesh == nullptr) || (m_normalMaterial == nullptr))
    {
        return;
    }

    ConstantBufferChangesEveryPrim constantBuffer;

    XMStoreFloat4x4(
        &constantBuffer.worldMatrix,
        XMMatrixTranspose(ModelMatrix())
        );

    if (m_hit && m_hitMaterial != nullptr)
    {
        m_hitMaterial->RenderSetup(context, &constantBuffer);
    }
    else
    {
        m_normalMaterial->RenderSetup(context, &constantBuffer);
    }
    context->UpdateSubresource(primitiveConstantBuffer, 0, nullptr, &constantBuffer, 0, 0);

    m_mesh->Render(context);
}

__forceinline void Target ( bool target )

Definition at line 130 of file GameObject.h.

{
    m_target = target;
}

__forceinline bool Target ( )

Definition at line 135 of file GameObject.h.

{
    return m_target;
}

__forceinline void TargetId ( int targetId )

Definition at line 160 of file GameObject.h.

{
    m_targetId = targetId;
}

__forceinline int TargetId ( )

Definition at line 165 of file GameObject.h.

{
    return m_targetId;
}

virtual void UpdatePosition ( ) [inline, private, virtual]

Reimplemented in Cylinder, and Face.

Definition at line 95 of file GameObject.h.

{};

__forceinline DirectX::XMVECTOR VectorPosition ( )

Definition at line 201 of file GameObject.h.

{
    return DirectX::XMLoadFloat3(&m_position);
}

__forceinline DirectX::XMVECTOR VectorVelocity ( )

Definition at line 221 of file GameObject.h.

{
    return DirectX::XMLoadFloat3(&m_velocity);
}

__forceinline DirectX::XMFLOAT3 Velocity ( )

Definition at line 216 of file GameObject.h.

{
    return m_velocity;
}

__forceinline void Velocity ( DirectX::XMFLOAT3 velocity )

Definition at line 206 of file GameObject.h.

{
    m_velocity = velocity;
}

__forceinline void Velocity ( DirectX::XMVECTOR velocity )

Definition at line 211 of file GameObject.h.

{
    XMStoreFloat3(&m_velocity, velocity);
}

Member Data Documentation

bool m_active [private]

Definition at line 95 of file GameObject.h.

std::shared_ptr<Animate> m_animatePosition [private]

Definition at line 114 of file GameObject.h.

DirectX::XMFLOAT3 m_defaultXAxis [private]

Definition at line 108 of file GameObject.h.

DirectX::XMFLOAT3 m_defaultYAxis [private]

Definition at line 109 of file GameObject.h.

DirectX::XMFLOAT3 m_defaultZAxis [private]

Definition at line 110 of file GameObject.h.

bool m_ground [private]

Definition at line 101 of file GameObject.h.

bool m_hit [private]

Definition at line 100 of file GameObject.h.

std::shared_ptr<Material> m_hitMaterial [private]

Definition at line 106 of file GameObject.h.

std::shared_ptr<SoundEffect> m_hitSound [private]

Definition at line 117 of file GameObject.h.

float m_hitTime [private]

Definition at line 112 of file GameObject.h.

std::shared_ptr<MeshObject> m_mesh [private]

Definition at line 115 of file GameObject.h.

DirectX::XMFLOAT4X4 m_modelMatrix [protected]

Definition at line 91 of file GameObject.h.

std::shared_ptr<Material> m_normalMaterial [private]

Definition at line 105 of file GameObject.h.

DirectX::XMFLOAT3 m_position [protected]

Definition at line 92 of file GameObject.h.

bool m_target [private]

Definition at line 98 of file GameObject.h.

int m_targetId [private]

Definition at line 99 of file GameObject.h.

DirectX::XMFLOAT3 m_velocity [private]

Definition at line 103 of file GameObject.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/GameObject.h
  • Simple3DGameDX/cppwinrt/GameContent/GameObject.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

GameRenderer Class Reference

#include "GameRenderer.h"

List of all members.

Public Member Functions

GameRenderer (std::shared_ptr< DX::DeviceResources > const &deviceResources)
void | CreateDeviceDependentResources ()
void | CreateDeviceDependentResources ()
void | CreateDeviceDependentResources ()
concurrency::task< void > | CreateGameDeviceResourcesAsync (_In_ Simple3DGame^game)
winrt::Windows::Foundation::IAsyncAction | CreateGameDeviceResourcesAsync (_In_ std::shared_ptr< Simple3DGame > game)
concurrency::task< void > | CreateGameDeviceResourcesAsync (_In_ Simple3DGame^game)
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | CreateWindowSizeDependentResources ()
void | FinalizeCreateGameDeviceResources ()
void | FinalizeCreateGameDeviceResources ()
void | FinalizeCreateGameDeviceResources ()
void | FinalizeLoadLevelResources ()
void | FinalizeLoadLevelResources ()
void | FinalizeLoadLevelResources ()
DirectX::XMFLOAT2 | GameInfoOverlayLowerRight ()
DirectX::XMFLOAT2 | GameInfoOverlayLowerRight ()
DirectX::XMFLOAT2 | GameInfoOverlayUpperLeft ()
DirectX::XMFLOAT2 | GameInfoOverlayUpperLeft ()
bool | GameInfoOverlayVisible ()
bool | GameInfoOverlayVisible ()
Simple3DGameDX::IGameUIControl GameUIControl ()
Simple3DGameDX::IGameUIControl * GameUIControl ()
GameHud Hud ()
concurrency::task< void > | LoadLevelResourcesAsync ()
winrt::Windows::Foundation::IAsyncAction | LoadLevelResourcesAsync ()
concurrency::task< void > | LoadLevelResourcesAsync ()
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Render ()
void | Render ()
void | SetBackground (uint32 background)

Public Attributes

internal | __pad0__: GameRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_ceilingTexture
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_ceilingTexture
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_constantBufferChangeOnResize
winrt::com_ptr< ID3D11Buffer > | m_constantBufferChangeOnResize
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_constantBufferChangesEveryFrame
winrt::com_ptr< ID3D11Buffer > | m_constantBufferChangesEveryFrame
winrt::com_ptr< ID3D11Buffer > | m_constantBufferChangesEveryPrim
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_constantBufferChangesEveryPrim
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_constantBufferNeverChanges
winrt::com_ptr< ID3D11Buffer > | m_constantBufferNeverChanges
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_cylinderTexture
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_cylinderTexture
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_floorTexture
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_floorTexture
std::shared_ptr< Simple3DGame > | m_game
Simple3DGame m_game
GameHud m_gameHud
GameInfoOverlay m_gameInfoOverlay
D2D_RECT_F | m_gameInfoOverlayRect
D2D_SIZE_F | m_gameInfoOverlaySize
bool | m_gameResourcesLoaded
bool | m_initialized
bool | m_levelResourcesLoaded
winrt::com_ptr< ID3D11PixelShader > | m_pixelShader
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
winrt::com_ptr< ID3D11PixelShader > | m_pixelShaderFlat
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShaderFlat
winrt::com_ptr
< ID3D11SamplerState > 		m_samplerLinear
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerLinear
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_sphereTexture
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_sphereTexture
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_vertexLayout
winrt::com_ptr< ID3D11InputLayout > | m_vertexLayout
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader
winrt::com_ptr
< ID3D11VertexShader > 		m_vertexShader
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShaderFlat
winrt::com_ptr
< ID3D11VertexShader > 		m_vertexShaderFlat
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_wallsTexture
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_wallsTexture

Detailed Description

Definition at line 62 of file GameRenderer.h.

Constructor & Destructor Documentation

GameRenderer ( std::shared_ptr< DX::DeviceResources > const & deviceResources )

Definition at line 33 of file GameRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_initialized(false),
    m_gameResourcesLoaded(false),
    m_levelResourcesLoaded(false)
{
    m_gameHud = ref new GameHud(
        deviceResources,
        "Windows platform samples",
        "DirectX first-person game sample"
        );
    m_gameInfoOverlay = ref new GameInfoOverlay(deviceResources);

    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 65 of file GameRenderer.cpp.

{
    m_gameResourcesLoaded = false;
    m_levelResourcesLoaded = false;

    m_gameHud->CreateDeviceDependentResources();
    m_gameInfoOverlay->CreateDeviceDependentResources();
}

void CreateDeviceDependentResources ( )
void CreateDeviceDependentResources ( )
task< void > CreateGameDeviceResourcesAsync ( _In_ Simple3DGame^ game )

Definition at line 152 of file GameRenderer.cpp.

{
    // Create the device dependent game resources.
    // Only the d3dDevice is used in this method.  It is expected
    // to not run on the same thread as the GameRenderer was created.
    // Create methods on the d3dDevice are free-threaded and are safe while any methods
    // in the d3dContext should only be used on a single thread and handled
    // in the FinalizeCreateGameDeviceResources method.
    m_game = game;

    auto d3dDevice = m_deviceResources->GetD3DDevice();

    D3D11_BUFFER_DESC bd;
    ZeroMemory(&bd, sizeof(bd));

    // Create the constant buffers.
    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
    bd.CPUAccessFlags = 0;
    bd.ByteWidth = (sizeof(ConstantBufferNeverChanges) + 15) / 16 * 16;
    DX::ThrowIfFailed(
        d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferNeverChanges)
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangeOnResize) + 15) / 16 * 16;
    DX::ThrowIfFailed(
        d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangeOnResize)
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangesEveryFrame) + 15) / 16 * 16;
    DX::ThrowIfFailed(
        d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangesEveryFrame)
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangesEveryPrim) + 15) / 16 * 16;
    DX::ThrowIfFailed(
        d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangesEveryPrim)
        );

    D3D11_SAMPLER_DESC sampDesc;
    ZeroMemory(&sampDesc, sizeof(sampDesc));

    sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
    sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
    sampDesc.MinLOD = 0;
    sampDesc.MaxLOD = FLT_MAX;
    DX::ThrowIfFailed(
        d3dDevice->CreateSamplerState(&sampDesc, &m_samplerLinear)
        );

    // Start the async tasks to load the shaders and textures.
    BasicLoader^ loader = ref new BasicLoader(d3dDevice);

    std::vector<task<void>> tasks;

    uint32 numElements = ARRAYSIZE(PNTVertexLayout);
    tasks.push_back(loader->LoadShaderAsync("VertexShader.cso", PNTVertexLayout, numElements, &m_vertexShader, &m_vertexLayout));
    tasks.push_back(loader->LoadShaderAsync("VertexShaderFlat.cso", nullptr, numElements, &m_vertexShaderFlat, nullptr));
    tasks.push_back(loader->LoadShaderAsync("PixelShader.cso", &m_pixelShader));
    tasks.push_back(loader->LoadShaderAsync("PixelShaderFlat.cso", &m_pixelShaderFlat));

    // Make sure the previous versions if any of the textures are released.
    m_sphereTexture = nullptr;
    m_cylinderTexture = nullptr;
    m_ceilingTexture = nullptr;
    m_floorTexture = nullptr;
    m_wallsTexture = nullptr;

    // Load Game specific textures.
    tasks.push_back(loader->LoadTextureAsync("Assets\\seafloor.dds", nullptr, &m_sphereTexture));
    tasks.push_back(loader->LoadTextureAsync("Assets\\metal_texture.dds", nullptr, &m_cylinderTexture));
    tasks.push_back(loader->LoadTextureAsync("Assets\\cellceiling.dds", nullptr, &m_ceilingTexture));
    tasks.push_back(loader->LoadTextureAsync("Assets\\cellfloor.dds", nullptr, &m_floorTexture));
    tasks.push_back(loader->LoadTextureAsync("Assets\\cellwall.dds", nullptr, &m_wallsTexture));
    tasks.push_back(create_task([]()
    {
        // Simulate loading additional resources by introducing a delay.
        wait(GameConstants::InitialLoadingDelay);
    }));

    // Return the task group of all the async tasks for loading the shader and texture assets.
    return when_all(tasks.begin(), tasks.end());
}

IAsyncAction CreateGameDeviceResourcesAsync ( _In_ std::shared_ptr< Simple3DGame > game )

Definition at line 132 of file GameRenderer.cpp.

{
    auto lifetime = shared_from_this();

    // Create the device dependent game resources.
    // Only the d3dDevice is used in this method. It is expected
    // to not run on the same thread as the GameRenderer was created.
    // Create methods on the d3dDevice are free-threaded and are safe while any methods
    // in the d3dContext should only be used on a single thread and handled
    // in the FinalizeCreateGameDeviceResources method.
    m_game = game;

    auto d3dDevice = m_deviceResources->GetD3DDevice();

    D3D11_BUFFER_DESC bd;
    ZeroMemory(&bd, sizeof(bd));

    // Create the constant buffers.
    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
    bd.CPUAccessFlags = 0;
    bd.ByteWidth = (sizeof(ConstantBufferNeverChanges) + 15) / 16 * 16;
    m_constantBufferNeverChanges = nullptr;
    winrt::check_hresult(
        d3dDevice->CreateBuffer(&bd, nullptr, m_constantBufferNeverChanges.put())
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangeOnResize) + 15) / 16 * 16;
    m_constantBufferChangeOnResize = nullptr;
    winrt::check_hresult(
        d3dDevice->CreateBuffer(&bd, nullptr, m_constantBufferChangeOnResize.put())
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangesEveryFrame) + 15) / 16 * 16;
    m_constantBufferChangesEveryFrame = nullptr;
    winrt::check_hresult(
        d3dDevice->CreateBuffer(&bd, nullptr, m_constantBufferChangesEveryFrame.put())
        );

    bd.ByteWidth = (sizeof(ConstantBufferChangesEveryPrim) + 15) / 16 * 16;
    m_constantBufferChangesEveryPrim = nullptr;
    winrt::check_hresult(
        d3dDevice->CreateBuffer(&bd, nullptr, m_constantBufferChangesEveryPrim.put())
        );

    D3D11_SAMPLER_DESC sampDesc;
    ZeroMemory(&sampDesc, sizeof(sampDesc));

    sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
    sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
    sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
    sampDesc.MinLOD = 0;
    sampDesc.MaxLOD = FLT_MAX;
    m_samplerLinear = nullptr;
    winrt::check_hresult(
        d3dDevice->CreateSamplerState(&sampDesc, m_samplerLinear.put())
        );

    // Start the async tasks to load the shaders and textures.
    BasicLoader loader{ d3dDevice };

    std::vector<IAsyncAction> tasks;

    uint32_t numElements = ARRAYSIZE(PNTVertexLayout);
    tasks.push_back(loader.LoadShaderAsync(L"VertexShader.cso", PNTVertexLayout, numElements, m_vertexShader.put(), m_vertexLayout.put()));
    tasks.push_back(loader.LoadShaderAsync(L"VertexShaderFlat.cso", nullptr, numElements, m_vertexShaderFlat.put(), nullptr));
    tasks.push_back(loader.LoadShaderAsync(L"PixelShader.cso", m_pixelShader.put()));
    tasks.push_back(loader.LoadShaderAsync(L"PixelShaderFlat.cso", m_pixelShaderFlat.put()));

    // Make sure the previous versions if any of the textures are released.
    m_sphereTexture = nullptr;
    m_cylinderTexture = nullptr;
    m_ceilingTexture = nullptr;
    m_floorTexture = nullptr;
    m_wallsTexture = nullptr;

    // Load Game specific textures.
    tasks.push_back(loader.LoadTextureAsync(L"Assets\\seafloor.dds", nullptr, m_sphereTexture.put()));
    tasks.push_back(loader.LoadTextureAsync(L"Assets\\metal_texture.dds", nullptr, m_cylinderTexture.put()));
    tasks.push_back(loader.LoadTextureAsync(L"Assets\\cellceiling.dds", nullptr, m_ceilingTexture.put()));
    tasks.push_back(loader.LoadTextureAsync(L"Assets\\cellfloor.dds", nullptr, m_floorTexture.put()));
    tasks.push_back(loader.LoadTextureAsync(L"Assets\\cellwall.dds", nullptr, m_wallsTexture.put()));

    // Simulate loading additional resources by introducing a delay.
    tasks.push_back([]() -> IAsyncAction { co_await winrt::resume_after(GameConstants::InitialLoadingDelay); }());

    // Wait for all the tasks to complete.
    for (auto&& task : tasks)
    {
        co_await task;
    }
}

concurrency::task<void> CreateGameDeviceResourcesAsync ( _In_ Simple3DGame^ game )
void CreateWindowSizeDependentResources ( )

Definition at line 76 of file GameRenderer.cpp.

{
    m_gameHud->CreateWindowSizeDependentResources();

    m_gameInfoOverlaySize.height = GameInfoOverlayConstant::Height;
    m_gameInfoOverlaySize.width = GameInfoOverlayConstant::Width;

    auto d3dContext = m_deviceResources->GetD3DDeviceContext();
    auto renderTargetSize = m_deviceResources->GetRenderTargetSize();

    auto bounds = m_deviceResources->GetLogicalSize();
    float hudBottomY = GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 4;
    float topY = (bounds.Height - GameInfoOverlayConstant::Height) / 2.0f;

    // The default position of the GameInfoOverlay is centered in the window.  There are cases where
    // There are cases where this will be adjusted:
    // 1) Shift down to allow the Hud to be visible if possible.
    // 2) Shift up if after 1) the GameInfoOverlay extends below the bottom of the window.
    // 3) Ensure the width of the GameInfoOverlay is not wider than the window, if it is
    //    reduce the width to be the same as the window width.
    if (hudBottomY > topY)
    {
        topY = hudBottomY + GameConstants::Margin;
    }
    if ((topY + m_gameInfoOverlaySize.height) > bounds.Height)
    {
        topY = bounds.Height - m_gameInfoOverlaySize.height;
    }
    if (m_gameInfoOverlaySize.width > bounds.Width)
    {
        m_gameInfoOverlaySize.width = bounds.Width;
    }
    float topX = (bounds.Width - m_gameInfoOverlaySize.width) / 2.0f;

    m_gameInfoOverlayRect = D2D1::RectF(
        topX,
        topY,
        topX + m_gameInfoOverlaySize.width,
        topY + m_gameInfoOverlaySize.height
        );

    m_gameInfoOverlay->CreateWindowSizeDependentResources(m_gameInfoOverlaySize);

    if (m_game != nullptr)
    {
        // Update the Projection Matrix and the associated Constant Buffer.
        m_game->GameCamera()->SetProjParams(
            XM_PI / 2, renderTargetSize.Width / renderTargetSize.Height,
            0.01f,
            100.0f
            );

        XMFLOAT4X4 orientation = m_deviceResources->GetOrientationTransform3D();

        ConstantBufferChangeOnResize changesOnResize;
        XMStoreFloat4x4(
            &changesOnResize.projection,
            XMMatrixMultiply(
                XMMatrixTranspose(m_game->GameCamera()->Projection()),
                XMMatrixTranspose(XMLoadFloat4x4(&orientation))
                )
            );

        d3dContext->UpdateSubresource(
            m_constantBufferChangeOnResize.Get(),
            0,
            nullptr,
            &changesOnResize,
            0,
            0
            );
    }
}

void CreateWindowSizeDependentResources ( )
void CreateWindowSizeDependentResources ( )
void FinalizeCreateGameDeviceResources ( )
void FinalizeCreateGameDeviceResources ( )

Definition at line 241 of file GameRenderer.cpp.

{
    // All asynchronously loaded resources have completed loading.
    // Now associate all the resources with the appropriate game objects.
    // This method is expected to run in the same thread as the GameRenderer
    // was created. All work will happen behind the "Loading ..." screen after the
    // main loop has been entered.

    // Initialize the Constant buffer with the light positions
    // These are handled here to ensure that the d3dContext is only
    // used in one thread.

    auto d3dDevice = m_deviceResources->GetD3DDevice();

    ConstantBufferNeverChanges constantBufferNeverChanges;
    constantBufferNeverChanges.lightPosition[0] = XMFLOAT4( 3.5f, 2.5f,  5.5f, 1.0f);
    constantBufferNeverChanges.lightPosition[1] = XMFLOAT4( 3.5f, 2.5f, -5.5f, 1.0f);
    constantBufferNeverChanges.lightPosition[2] = XMFLOAT4(-3.5f, 2.5f, -5.5f, 1.0f);
    constantBufferNeverChanges.lightPosition[3] = XMFLOAT4( 3.5f, 2.5f,  5.5f, 1.0f);
    constantBufferNeverChanges.lightColor = XMFLOAT4(0.25f, 0.25f, 0.25f, 1.0f);
    m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
        m_constantBufferNeverChanges.Get(),
        0,
        nullptr,
        &constantBufferNeverChanges,
        0,
        0
        );

    // For the targets, there are two unique generated textures.
    // Each texture image includes the number of the texture.
    // Make sure the 2D rendering is occurring on the same thread
    // as the main rendering.

    TargetTexture^ textureGenerator = ref new TargetTexture(
        d3dDevice,
        m_deviceResources->GetD2DFactory(),
        m_deviceResources->GetDWriteFactory(),
        m_deviceResources->GetD2DDeviceContext()
        );

    MeshObject^ cylinderMesh = ref new CylinderMesh(d3dDevice, 26);
    MeshObject^ targetMesh = ref new FaceMesh(d3dDevice);
    MeshObject^ sphereMesh = ref new SphereMesh(d3dDevice, 26);

    Material^ cylinderMaterial = ref new Material(
        XMFLOAT4(0.8f, 0.8f, 0.8f, .5f),
        XMFLOAT4(0.8f, 0.8f, 0.8f, .5f),
        XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f),
        15.0f,
        m_cylinderTexture.Get(),
        m_vertexShader.Get(),
        m_pixelShader.Get()
        );

    Material^ sphereMaterial = ref new Material(
        XMFLOAT4(0.8f, 0.4f, 0.0f, 1.0f),
        XMFLOAT4(0.8f, 0.4f, 0.0f, 1.0f),
        XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f),
        50.0f,
        m_sphereTexture.Get(),
        m_vertexShader.Get(),
        m_pixelShader.Get()
        );

    auto objects = m_game->RenderObjects();

    // Attach the textures to the appropriate game objects.
    for (auto object = objects.begin(); object != objects.end(); object++)
    {
        if ((*object)->TargetId() == GameConstants::WorldFloorId)
        {
            (*object)->NormalMaterial(
                ref new Material(
                    XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
                    XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
                    150.0f,
                    m_floorTexture.Get(),
                    m_vertexShaderFlat.Get(),
                    m_pixelShaderFlat.Get()
                    )
                );
            (*object)->Mesh(ref new WorldFloorMesh(d3dDevice));
        }
        else if ((*object)->TargetId() == GameConstants::WorldCeilingId)
        {
            (*object)->NormalMaterial(
                ref new Material(
                    XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
                    XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
                    150.0f,
                    m_ceilingTexture.Get(),
                    m_vertexShaderFlat.Get(),
                    m_pixelShaderFlat.Get()
                    )
                );
            (*object)->Mesh(ref new WorldCeilingMesh(d3dDevice));
        }
        else if ((*object)->TargetId() == GameConstants::WorldWallsId)
        {
            (*object)->NormalMaterial(
                ref new Material(
                    XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
                    XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
                    150.0f,
                    m_wallsTexture.Get(),
                    m_vertexShaderFlat.Get(),
                    m_pixelShaderFlat.Get()
                    )
                );
            (*object)->Mesh(ref new WorldWallsMesh(d3dDevice));
        }
        else if (Cylinder^ cylinder = dynamic_cast<Cylinder^>(*object))
        {
            cylinder->Mesh(cylinderMesh);
            cylinder->NormalMaterial(cylinderMaterial);
        }
        else if (Face^ target = dynamic_cast<Face^>(*object))
        {
            const int bufferLength = 16;
            char16 str[bufferLength];
            int len = swprintf_s(str, bufferLength, L"%d", target->TargetId());
            Platform::String^ string = ref new Platform::String(str, len);

            ComPtr<ID3D11ShaderResourceView> texture;
            textureGenerator->CreateTextureResourceView(string, &texture);
            target->NormalMaterial(
                ref new Material(
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
                    XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
                    5.0f,
                    texture.Get(),
                    m_vertexShader.Get(),
                    m_pixelShader.Get()
                    )
                );

            textureGenerator->CreateHitTextureResourceView(string, &texture);
            target->HitMaterial(
                ref new Material(
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
                    XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
                    XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
                    5.0f,
                    texture.Get(),
                    m_vertexShader.Get(),
                    m_pixelShader.Get()
                    )
                );

            target->Mesh(targetMesh);
        }
        else if (Sphere^ sphere = dynamic_cast<Sphere^>(*object))
        {
            sphere->Mesh(sphereMesh);
            sphere->NormalMaterial(sphereMaterial);
        }
    }

    // Ensure that the camera has been initialized with the right Projection
    // matrix.  The camera is not created at the time the first window resize event
    // occurs.
    auto renderTargetSize = m_deviceResources->GetRenderTargetSize();
    m_game->GameCamera()->SetProjParams(
        XM_PI / 2,
        renderTargetSize.Width / renderTargetSize.Height,
        0.01f,
        100.0f
        );

    // Make sure that Projection matrix has been set in the constant buffer
    // now that all the resources are loaded.
    // We are handling screen rotations directly to eliminate an unaligned
    // fullscreen copy.  As a result, it is necessary to post multiply the rotationTransform3D
    // matrix to the camera projection matrix.
    // The matrices are transposed due to the shader code expecting the matrices in the opposite
    // row/column order from the DirectX math library.

    auto orientation = m_deviceResources->GetOrientationTransform3D();

    ConstantBufferChangeOnResize changesOnResize;
    XMStoreFloat4x4(
        &changesOnResize.projection,
        XMMatrixMultiply(
            XMMatrixTranspose(m_game->GameCamera()->Projection()),
            XMMatrixTranspose(XMLoadFloat4x4(&orientation))
            )
        );

    m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
        m_constantBufferChangeOnResize.Get(),
        0,
        nullptr,
        &changesOnResize,
        0,
        0
        );

    m_gameResourcesLoaded = true;
}

void FinalizeCreateGameDeviceResources ( )
void FinalizeLoadLevelResources ( )

Definition at line 463 of file GameRenderer.cpp.

{
    // Once the level specific resources had been loaded, this method is
    // where D3D context specific actions would be handled.  This method
    // runs in the same thread context as the GameRenderer was created.

    m_levelResourcesLoaded = true;
}

void FinalizeLoadLevelResources ( )
void FinalizeLoadLevelResources ( )
DirectX::XMFLOAT2 GameInfoOverlayLowerRight ( ) [inline]

Definition at line 71 of file GameRenderer.h.

    {
        return DirectX::XMFLOAT2(m_gameInfoOverlayRect.right, m_gameInfoOverlayRect.bottom);
    };

DirectX::XMFLOAT2 GameInfoOverlayLowerRight ( ) [inline]

Definition at line 83 of file GameRenderer.h.

    {
        return DirectX::XMFLOAT2(m_gameInfoOverlayRect.right, m_gameInfoOverlayRect.bottom);
    };

DirectX::XMFLOAT2 GameInfoOverlayUpperLeft ( ) [inline]

Definition at line 79 of file GameRenderer.h.

    {
        return DirectX::XMFLOAT2(m_gameInfoOverlayRect.left, m_gameInfoOverlayRect.top);
    };

DirectX::XMFLOAT2 GameInfoOverlayUpperLeft ( ) [inline]

Definition at line 67 of file GameRenderer.h.

    {
        return DirectX::XMFLOAT2(m_gameInfoOverlayRect.left, m_gameInfoOverlayRect.top);
    };

bool GameInfoOverlayVisible ( ) [inline]

Definition at line 75 of file GameRenderer.h.

{ return m_gameInfoOverlay.Visible(); }

bool GameInfoOverlayVisible ( ) [inline]

Definition at line 87 of file GameRenderer.h.

{ return m_gameInfoOverlay->Visible(); }

Simple3DGameDX::IGameUIControl* GameUIControl ( ) [inline]

Definition at line 65 of file GameRenderer.h.

{ return &m_gameInfoOverlay; };

Simple3DGameDX::IGameUIControl GameUIControl ( ) [inline]

Definition at line 77 of file GameRenderer.h.

{ return m_gameInfoOverlay; };

GameHud Hud ( ) [inline]

Definition at line 77 of file GameRenderer.h.

{ return m_gameHud; }

concurrency::task<void> LoadLevelResourcesAsync ( )
winrt::Windows::Foundation::IAsyncAction LoadLevelResourcesAsync ( )
task< void > LoadLevelResourcesAsync ( )

Definition at line 448 of file GameRenderer.cpp.

{
    m_levelResourcesLoaded = false;

    return create_task([this]()
    {
        // This is where additional async loading of level specific resources
        // would be done.  Since there aren't any to load, just simulate
        // by delaying for some time.
        wait(GameConstants::LevelLoadingDelay);
    });
}

void ReleaseDeviceDependentResources ( )

Definition at line 52 of file GameRenderer.cpp.

{
    // On device lost all the device resources are invalid.
    // Set the state of the renderer to not have a pointer to the
    // Simple3DGame object.  It will be reset as a part of the
    // game devices resources being recreated.
    m_game = nullptr;
    m_gameHud->ReleaseDeviceDependentResources();
    m_gameInfoOverlay->ReleaseDeviceDependentResources();
}

void ReleaseDeviceDependentResources ( )
void ReleaseDeviceDependentResources ( )
void Render ( )
void Render ( )
void Render ( )

Definition at line 474 of file GameRenderer.cpp.

{
    bool stereoEnabled = m_deviceResources->GetStereoState();

    auto d3dContext = m_deviceResources->GetD3DDeviceContext();
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    int renderingPasses = 1;
    if (stereoEnabled)
    {
        renderingPasses = 2;
    }

    for (int i = 0; i < renderingPasses; i++)
    {
        // Iterate through the number of rendering passes to be completed.
        if (i > 0)
        {
            // Doing the Right Eye View.
            ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetViewRight() };

            d3dContext->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());
            d3dContext->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH, 1.0f, 0);
            d2dContext->SetTarget(m_deviceResources->GetD2DTargetBitmapRight());
        }
        else
        {
            // Doing the Mono or Left Eye View.
            ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetView() };

            d3dContext->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());
            d3dContext->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH, 1.0f, 0);
            d2dContext->SetTarget(m_deviceResources->GetD2DTargetBitmap());
        }

        if (m_game != nullptr && m_gameResourcesLoaded && m_levelResourcesLoaded)
        {
            // This section is only used after the game state has been initialized and all device
            // resources needed for the game have been created and associated with the game objects.
            if (stereoEnabled)
            {
                // When doing stereo, it is necessary to update the projection matrix once per rendering pass.

                auto orientation = m_deviceResources->GetOrientationTransform3D();

                ConstantBufferChangeOnResize changesOnResize;
                XMStoreFloat4x4(
                    &changesOnResize.projection,
                    XMMatrixMultiply(
                        XMMatrixTranspose(
                            i == 0 ?
                            m_game->GameCamera()->LeftEyeProjection() :
                            m_game->GameCamera()->RightEyeProjection()
                            ),
                        XMMatrixTranspose(XMLoadFloat4x4(&orientation))
                        )
                    );

                d3dContext->UpdateSubresource(
                    m_constantBufferChangeOnResize.Get(),
                    0,
                    nullptr,
                    &changesOnResize,
                    0,
                    0
                    );
            }
            // Update variables that change once per frame.

            ConstantBufferChangesEveryFrame constantBufferChangesEveryFrame;
            XMStoreFloat4x4(
                &constantBufferChangesEveryFrame.view,
                XMMatrixTranspose(m_game->GameCamera()->View())
                );
            d3dContext->UpdateSubresource(
                m_constantBufferChangesEveryFrame.Get(),
                0,
                nullptr,
                &constantBufferChangesEveryFrame,
                0,
                0
                );

            // Setup the graphics pipeline. This sample uses the same InputLayout and set of
            // constant buffers for all shaders, so they only need to be set once per frame.

            d3dContext->IASetInputLayout(m_vertexLayout.Get());
            d3dContext->VSSetConstantBuffers(0, 1, m_constantBufferNeverChanges.GetAddressOf());
            d3dContext->VSSetConstantBuffers(1, 1, m_constantBufferChangeOnResize.GetAddressOf());
            d3dContext->VSSetConstantBuffers(2, 1, m_constantBufferChangesEveryFrame.GetAddressOf());
            d3dContext->VSSetConstantBuffers(3, 1, m_constantBufferChangesEveryPrim.GetAddressOf());

            d3dContext->PSSetConstantBuffers(2, 1, m_constantBufferChangesEveryFrame.GetAddressOf());
            d3dContext->PSSetConstantBuffers(3, 1, m_constantBufferChangesEveryPrim.GetAddressOf());
            d3dContext->PSSetSamplers(0, 1, m_samplerLinear.GetAddressOf());

            auto objects = m_game->RenderObjects();
            for (auto object = objects.begin(); object != objects.end(); object++)
            {
                (*object)->Render(d3dContext, m_constantBufferChangesEveryPrim.Get());
            }
        }
        else
        {
            const float ClearColor[4] = {0.5f, 0.5f, 0.8f, 1.0f};

            // Only need to clear the background when not rendering the full 3D scene since
            // the 3D world is a fully enclosed box and the dynamics prevents the camera from
            // moving outside this space.
            if (i > 0)
            {
                // Doing the Right Eye View.
                d3dContext->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetViewRight(), ClearColor);
            }
            else
            {
                // Doing the Mono or Left Eye View.
                d3dContext->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetView(), ClearColor);
            }
        }

        d3dContext->BeginEventInt(L"D2D BeginDraw", 1);
        d2dContext->BeginDraw();

        // To handle the swapchain being pre-rotated, set the D2D transformation to include it.
        d2dContext->SetTransform(m_deviceResources->GetOrientationTransform2D());

        if (m_game != nullptr && m_gameResourcesLoaded)
        {
            // This is only used after the game state has been initialized.
            m_gameHud->Render(m_game);
        }

        if (m_gameInfoOverlay->Visible())
        {
            d2dContext->DrawBitmap(
                m_gameInfoOverlay->Bitmap(),
                m_gameInfoOverlayRect
                );
        }

        // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
        // is lost. It will be handled during the next call to Present.
        HRESULT hr = d2dContext->EndDraw();
        d3dContext->EndEvent();
        if (hr != D2DERR_RECREATE_TARGET)
        {
            DX::ThrowIfFailed(hr);
        }
    }
}

void SetBackground ( uint32 background )

Definition at line 613 of file GameRenderer.cpp.

{
    if (background < GameConstants::MaxBackgroundTextures)
    {
        if (m_ceilingTexture[background] != nullptr &&
            m_floorTexture[background] != nullptr &&
            m_wallsTexture[background] != nullptr)
        {
            auto objects = m_game->RenderObjects();

            // Attach the textures to the appropriate game objects.
            for (auto object = objects.begin(); object != objects.end(); object++)
            {
                if ((*object)->TargetId() == GameConstants::WorldFloorId)
                {
                    (*object)->NormalMaterial()->SetTexture(m_floorTexture[background].Get());
                }
                else if ((*object)->TargetId() == GameConstants::WorldCeilingId)
                {
                    (*object)->NormalMaterial()->SetTexture(m_ceilingTexture[background].Get());
                }
                else if ((*object)->TargetId() == GameConstants::WorldWallsId)
                {
                    (*object)->NormalMaterial()->SetTexture(m_wallsTexture[background].Get());
                }
            }
        }
    }
}

Member Data Documentation

internal __pad0__

Definition at line 65 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > m_ceilingTexture [private]

Definition at line 108 of file GameRenderer.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_ceilingTexture [private]

Definition at line 96 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_constantBufferChangeOnResize [private]

Definition at line 114 of file GameRenderer.h.

winrt::com_ptr<ID3D11Buffer> m_constantBufferChangeOnResize [private]

Definition at line 102 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_constantBufferChangesEveryFrame [private]

Definition at line 115 of file GameRenderer.h.

winrt::com_ptr<ID3D11Buffer> m_constantBufferChangesEveryFrame [private]

Definition at line 103 of file GameRenderer.h.

winrt::com_ptr<ID3D11Buffer> m_constantBufferChangesEveryPrim [private]

Definition at line 104 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_constantBufferChangesEveryPrim [private]

Definition at line 116 of file GameRenderer.h.

winrt::com_ptr<ID3D11Buffer> m_constantBufferNeverChanges [private]

Definition at line 101 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11Buffer > m_constantBufferNeverChanges [private]

Definition at line 113 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > m_cylinderTexture [private]

Definition at line 107 of file GameRenderer.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_cylinderTexture [private]

Definition at line 95 of file GameRenderer.h.

std::shared_ptr< DX::DeviceResources > m_deviceResources [private]

Definition at line 95 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > m_floorTexture [private]

Definition at line 109 of file GameRenderer.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_floorTexture [private]

Definition at line 97 of file GameRenderer.h.

Simple3DGame m_game [private]

Definition at line 102 of file GameRenderer.h.

std::shared_ptr<Simple3DGame> m_game [private]

Definition at line 90 of file GameRenderer.h.

GameHud m_gameHud [private]

Definition at line 101 of file GameRenderer.h.

GameInfoOverlay m_gameInfoOverlay [private]

Definition at line 100 of file GameRenderer.h.

D2D_RECT_F m_gameInfoOverlayRect [private]

Definition at line 103 of file GameRenderer.h.

D2D_SIZE_F m_gameInfoOverlaySize [private]

Definition at line 104 of file GameRenderer.h.

bool m_gameResourcesLoaded [private]

Definition at line 98 of file GameRenderer.h.

bool m_initialized [private]

Definition at line 97 of file GameRenderer.h.

bool m_levelResourcesLoaded [private]

Definition at line 99 of file GameRenderer.h.

winrt::com_ptr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 108 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11PixelShader > m_pixelShader [private]

Definition at line 120 of file GameRenderer.h.

winrt::com_ptr<ID3D11PixelShader> m_pixelShaderFlat [private]

Definition at line 109 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11PixelShader > m_pixelShaderFlat [private]

Definition at line 121 of file GameRenderer.h.

winrt::com_ptr<ID3D11SamplerState> m_samplerLinear [private]

Definition at line 105 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11SamplerState > m_samplerLinear [private]

Definition at line 117 of file GameRenderer.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_sphereTexture [private]

Definition at line 94 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > m_sphereTexture [private]

Definition at line 106 of file GameRenderer.h.

winrt::com_ptr<ID3D11InputLayout> m_vertexLayout [private]

Definition at line 110 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11InputLayout > m_vertexLayout [private]

Definition at line 122 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11VertexShader > m_vertexShader [private]

Definition at line 118 of file GameRenderer.h.

winrt::com_ptr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 106 of file GameRenderer.h.

winrt::com_ptr<ID3D11VertexShader> m_vertexShaderFlat [private]

Definition at line 107 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11VertexShader > m_vertexShaderFlat [private]

Definition at line 119 of file GameRenderer.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_wallsTexture [private]

Definition at line 98 of file GameRenderer.h.

Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > m_wallsTexture [private]

Definition at line 110 of file GameRenderer.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/GameRenderer.h
  • Simple3DGameDX/cppwinrt/GameRenderer.h
  • Simple3DGameXaml/cpp/GameRenderer.h
  • Simple3DGameDX/cpp/GameRenderer.cpp
  • Simple3DGameDX/cppwinrt/GameRenderer.cpp
  • Simple3DGameXaml/cpp/GameRenderer.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameTimer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

GameTimer Class Reference

#include "GameTimer.h"

List of all members.

Public Member Functions

GameTimer ()
bool | Active ()
float | DeltaTime ()
float | PlayingTime ()
void | PlayingTime (float time)
void | Reset ()
void | Start ()
void | Stop ()
void | Update ()

Private Attributes

bool | m_active
LARGE_INTEGER m_baseTime
LARGE_INTEGER m_currentTime
float | m_deltaTime
LARGE_INTEGER m_pausedTime
LARGE_INTEGER m_previousTime
float | m_secondsPerCount
LARGE_INTEGER m_stopTime

Detailed Description

Definition at line 14 of file GameTimer.h.

Constructor & Destructor Documentation

GameTimer ( )

Definition at line 15 of file GameTimer.cpp.

                     :
    m_active(false)
{
    LARGE_INTEGER frequency;
    if (!QueryPerformanceFrequency(&frequency))
    {
        winrt::throw_hresult(E_FAIL);
    }
    m_secondsPerCount = 1.0f / static_cast<float>(frequency.QuadPart);

    Reset();
}

Member Function Documentation

bool Active ( ) [inline]

Definition at line 27 of file GameTimer.h.

{ return m_active; };

float DeltaTime ( )

Definition at line 60 of file GameTimer.cpp.

{
    return m_deltaTime;
}

void PlayingTime ( float time )

Definition at line 48 of file GameTimer.cpp.

{
    // Reset the internal state to reflect a PlayingTime of 'time'
    // Offset the baseTime by this 'time'.
    m_active = false;
    m_stopTime = m_currentTime;
    m_pausedTime.QuadPart = 0;

    m_baseTime.QuadPart = m_stopTime.QuadPart - static_cast<__int64>(time / m_secondsPerCount);
}

float PlayingTime ( )

Definition at line 30 of file GameTimer.cpp.

{
    if (m_active)
    {
        // The distance m_currentTime - m_baseTime includes paused time,
        // which we do not want to count. To correct this, we can subtract
        // the paused time from m_currentTime:
        return static_cast<float>(((m_currentTime.QuadPart - m_pausedTime.QuadPart) - m_baseTime.QuadPart) * m_secondsPerCount);
    }
    else
    {
        // The clock is currently not running so don't count the time since
        // the clock was stopped
        return static_cast<float>(((m_stopTime.QuadPart - m_pausedTime.QuadPart) - m_baseTime.QuadPart) * m_secondsPerCount);
    }
}

void Reset ( )

Definition at line 65 of file GameTimer.cpp.

{
    LARGE_INTEGER currentTime;
    if (!QueryPerformanceCounter(&currentTime))
    {
        winrt::throw_hresult(E_FAIL);
    }
    m_baseTime = currentTime;
    m_previousTime = currentTime;
    m_stopTime = currentTime;
    m_currentTime = currentTime;
    m_pausedTime.QuadPart = 0;
    m_active = false;
}

void Start ( )

Definition at line 80 of file GameTimer.cpp.

{
    LARGE_INTEGER startTime;
    if (!QueryPerformanceCounter(&startTime))
    {
        winrt::throw_hresult(E_FAIL);
    }
    if (!m_active)
    {
        // Accumulate the time elapsed between stop and start pairs.
        m_pausedTime.QuadPart += (startTime.QuadPart - m_stopTime.QuadPart);

        m_previousTime = startTime;
        m_stopTime.QuadPart = 0;
        m_active = true;
    }
}

void Stop ( )

Definition at line 98 of file GameTimer.cpp.

{
    if (m_active)
    {
        // Set the stop time to the time of the last update.
        m_stopTime = m_currentTime;
        m_active = false;
    }
}

void Update ( )

Definition at line 108 of file GameTimer.cpp.

{
    if (!m_active)
    {
        m_deltaTime = 0.0;
        return;
    }

    LARGE_INTEGER currentTime;
    if (!QueryPerformanceCounter(&currentTime))
    {
        winrt::throw_hresult(E_FAIL);
    }
    m_currentTime = currentTime;

    m_deltaTime = (m_currentTime.QuadPart - m_previousTime.QuadPart) * m_secondsPerCount;
    m_previousTime = m_currentTime;

    if (m_deltaTime < 0.0)
    {
        m_deltaTime = 0.0;
    }
}

Member Data Documentation

bool m_active [private]

Definition at line 39 of file GameTimer.h.

LARGE_INTEGER m_baseTime [private]

Definition at line 33 of file GameTimer.h.

LARGE_INTEGER m_currentTime [private]

Definition at line 37 of file GameTimer.h.

float m_deltaTime [private]

Definition at line 31 of file GameTimer.h.

LARGE_INTEGER m_pausedTime [private]

Definition at line 34 of file GameTimer.h.

LARGE_INTEGER m_previousTime [private]

Definition at line 36 of file GameTimer.h.

float m_secondsPerCount [private]

Definition at line 27 of file GameTimer.h.

LARGE_INTEGER m_stopTime [private]

Definition at line 35 of file GameTimer.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/GameTimer.h
  • Simple3DGameDX/cppwinrt/GameContent/GameTimer.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • GyrometerCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, GyrometerReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
Gyrometer | _gyrometer
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 33 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _gyrometer = Gyrometer.GetDefault();
            if (_gyrometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _gyrometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
            }
            else
            {
                rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 56 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 70 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                _gyrometer.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | GyrometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 114 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                GyrometerReading reading = e.Reading;
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 154 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            _gyrometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 130 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_gyrometer != null)
            {
                // Establish the report interval
                _gyrometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _gyrometer.ReadingChanged += new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 92 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _gyrometer.ReadingChanged += new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

Gyrometer _gyrometer [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • Gyrometer/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • GyrometerCS
  • Scenario2_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayCurrentReading (object sender, object args)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
DispatcherTimer | _dispatcherTimer
Gyrometer | _gyrometer
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 34 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _gyrometer = Gyrometer.GetDefault();
            if (_gyrometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _gyrometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
            }
            else
            {
                rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 122 of file Scenario2_Polling.xaml.cs.

        {
            GyrometerReading reading = _gyrometer.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 62 of file Scenario2_Polling.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 76 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

                // Stop the dispatcher
                _dispatcherTimer.Stop();

                // Restore the default report interval to release resources while the sensor is not in use
                _gyrometer.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 162 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _gyrometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 138 of file Scenario2_Polling.xaml.cs.

        {
            if (_gyrometer != null)
            {
                // Set the report interval to enable the sensor for polling
                _gyrometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _dispatcherTimer.Start();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 100 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

DispatcherTimer _dispatcherTimer [private]

Definition at line 32 of file Scenario2_Polling.xaml.cs.

Gyrometer _gyrometer [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • Gyrometer/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Porting Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • GyrometerCS
  • Scenario3_Porting
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Porting Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_Porting ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | GetGyrometerSample (object sender, RoutedEventArgs e)

Private Attributes

Gyrometer | gyrometerWindows
Gyrometer | gyrometerWP
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario3_Porting.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Porting ( ) [inline]

Definition at line 26 of file Scenario3_Porting.xaml.cs.

        {
            this.InitializeComponent();

            // Get two instances of the gyrometer:
            // One that returns the raw gyrometer data
            gyrometerWindows = Gyrometer.GetDefault();
            // Other on which the 'ReadingTransform' is updated so that data returned aligns with the native WP orientation (portrait)
            gyrometerWP = Gyrometer.GetDefault();

            if (gyrometerWP == null || gyrometerWindows == null)
            {
                rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
            }
            else
            {
                // Assumption is that this app has been developed for Windows Phone 8.1 (or earlier)
                // and hence assumes that the sensor returns readings in Portrait Mode, which may
                // not be true when the app or sensor logic is being ported over to a
                // Landscape-First Windows device
                // While we encourage you to re-design your app as a universal app to gain access
                // to many other advantages of developing a universal app, this scenario demonstrates
                // a simple approach to let the runtime honor your assumption on the
                // "native orientation" of the sensor.
                gyrometerWP.ReadingTransform = Windows.Graphics.Display.DisplayOrientations.Portrait;
                // If you were to go the route of universal app, make no assumptions about the
                // native orientation of the device. Instead rely on using a display orientation
                // (absolute or current) to enforce the reference frame for the sensor readings.
                // (which is done by updating 'ReadingTransform' property with the appropriate orientation)
            }
        }

Member Function Documentation

void GetGyrometerSample | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Get Sample' button is pressed.

Parameters:
sender
e

Definition at line 81 of file Scenario3_Porting.xaml.cs.

        {
            GyrometerReading wpReading;
            GyrometerReading windowsReading;
            GetSampleButton.IsEnabled = false;

            // Establish the report interval
            gyrometerWP.ReportInterval = gyrometerWindows.MinimumReportInterval;
            gyrometerWindows.ReportInterval = gyrometerWindows.MinimumReportInterval;

            wpReading = gyrometerWP.GetCurrentReading();
            windowsReading = gyrometerWindows.GetCurrentReading();

            if (null != wpReading)
            {
                ScenarioOutput_X_WP.Text = wpReading.AngularVelocityX.ToString();
                ScenarioOutput_Y_WP.Text = wpReading.AngularVelocityY.ToString();
                ScenarioOutput_Z_WP.Text = wpReading.AngularVelocityZ.ToString();
            }

            if (null != windowsReading)
            {
                ScenarioOutput_X_Windows.Text = windowsReading.AngularVelocityX.ToString();
                ScenarioOutput_Y_Windows.Text = windowsReading.AngularVelocityY.ToString();
                ScenarioOutput_Z_Windows.Text = windowsReading.AngularVelocityZ.ToString();
            }

            gyrometerWP.ReportInterval = 0;
            gyrometerWindows.ReportInterval = 0;

            GetSampleButton.IsEnabled = true;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. This parameter is typically used to configure the page.

Definition at line 63 of file Scenario3_Porting.xaml.cs.

        {
            if (gyrometerWP ==null || gyrometerWindows == null)
            {
                GetSampleButton.IsEnabled = false;
            }
            else
            {
                GetSampleButton.IsEnabled = true;
            }
        }

Member Data Documentation

Gyrometer gyrometerWindows [private]

Definition at line 24 of file Scenario3_Porting.xaml.cs.

Gyrometer gyrometerWP [private]

Definition at line 23 of file Scenario3_Porting.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario3_Porting.xaml.cs.

The documentation for this class was generated from the following file:
  • Gyrometer/cs/Scenario3_Porting.xaml.cs
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HighScoreEntry Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

HighScoreEntry Struct Reference

#include "Simple3DGame.h"

List of all members.

Public Attributes

int | levelCompleted = 0
std::wstring | tag
Platform::String | tag
int | totalHits = 0
int | totalShots = 0

Detailed Description

Definition at line 54 of file Simple3DGame.h.

Member Data Documentation

int levelCompleted = 0

Definition at line 59 of file Simple3DGame.h.

std::wstring tag

Definition at line 51 of file Simple3DGame.h.

Platform::String tag

Definition at line 56 of file Simple3DGame.h.

int totalHits = 0

Definition at line 57 of file Simple3DGame.h.

int totalShots = 0

Definition at line 58 of file Simple3DGame.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Simple3DGame.h
  • Simple3DGameDX/cppwinrt/Simple3DGame.h
  • Simple3DGameXaml/cpp/Simple3DGame.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicApp1Main Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicApp2
  • HolographicApp1Main
Public Member Functions | Private Member Functions | Private Attributes

HolographicApp1Main Class Reference

Updates, renders, and presents holographic content using Direct3D.

List of all members.

Public Member Functions

HolographicApp1Main (DeviceResources deviceResources)
void | CreateVideoShaders ()
void | Dispose ()
void | LoadAppState ()
void | OnCameraAdded (HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args)
void | OnCameraRemoved (HolographicSpace sender, HolographicSpaceCameraRemovedEventArgs args)
void | OnDeviceLost (Object sender, EventArgs e)
void | OnDeviceRestored (Object sender, EventArgs e)
bool | Render (ref HolographicFrame holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (HolographicSpace holographicSpace)
HolographicFrame | Update ()

Private Member Functions

void | OnLocatabilityChanged (SpatialLocator sender, Object args)

Private Attributes

SpatialLocatorAttachedFrameOfReference | attachreferenceFrame
DeviceResources | deviceResources
HolographicSpace | holographicSpace
SpatialLocator | locator
SpatialStationaryFrameOfReference | referenceFrame
StepTimer | timer = new StepTimer()

Detailed Description

Definition at line 32 of file HolographicApp1Main.cs.

Constructor & Destructor Documentation

HolographicApp1Main ( DeviceResources deviceResources ) [inline]

Loads and initializes application assets when the application is loaded.

Parameters:
deviceResources

Definition at line 64 of file HolographicApp1Main.cs.

        {
            this.deviceResources = deviceResources;

            // Register to be notified if the Direct3D device is lost.
            this.deviceResources.DeviceLost     += this.OnDeviceLost;
            this.deviceResources.DeviceRestored += this.OnDeviceRestored;
        }

Member Function Documentation

void CreateVideoShaders ( ) [inline]

Definition at line 466 of file HolographicApp1Main.cs.

        {
            spinningCubeRenderer.CreateDeviceDependentResourcesAsync();
        }

void Dispose ( ) [inline]

Definition at line 129 of file HolographicApp1Main.cs.

        {
#if DRAW_SAMPLE_CONTENT
            if (spinningCubeRenderer != null)
            {
                spinningCubeRenderer.ReleaseDeviceDependentResources();
                spinningCubeRenderer.Dispose();
                spinningCubeRenderer = null;
            }
#endif
        }

void LoadAppState ( ) [inline]

Definition at line 346 of file HolographicApp1Main.cs.

        {
            //
            // TODO: Insert code here to load your app state.
            //       This method is called when the app resumes.
            //
            //       For example, load information from the SpatialAnchorStore.
            //
        }

void OnCameraAdded | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraAddedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 410 of file HolographicApp1Main.cs.

        {
            Deferral deferral = args.GetDeferral();
            HolographicCamera holographicCamera = args.Camera;

            Task task1 = new Task(() =>
            {
                //
                // TODO: Allocate resources for the new camera and load any content specific to
                //       that camera. Note that the render target size (in pixels) is a property
                //       of the HolographicCamera object, and can be used to create off-screen
                //       render targets that match the resolution of the HolographicCamera.
                //

                // Create device-based resources for the holographic camera and add it to the list of
                // cameras used for updates and rendering. Notes:
                //   * Since this function may be called at any time, the AddHolographicCamera function
                //     waits until it can get a lock on the set of holographic camera resources before
                //     adding the new camera. At 60 frames per second this wait should not take long.
                //   * A subsequent Update will take the back buffer from the RenderingParameters of this
                //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
                //     Content can then be rendered for the HolographicCamera.
                deviceResources.AddHolographicCamera(holographicCamera);

                // Holographic frame predictions will not include any information about this camera until
                // the deferral is completed.
                deferral.Complete();
            });
            task1.Start();
        }

void OnCameraRemoved | ( | HolographicSpace | sender,
 |  | HolographicSpaceCameraRemovedEventArgs | args |
 | ) |  |  | [inline]

Definition at line 444 of file HolographicApp1Main.cs.

        {
            Task task2 = new Task(() =>
            {
                //
                // TODO: Asynchronously unload or deactivate content resources (not back buffer
                //       resources) that are specific only to the camera that was removed.
                //
            });
            task2.Start();

            // Before letting this callback return, ensure that all references to the back buffer
            // are released.
            // Since this function may be called at any time, the RemoveHolographicCamera function
            // waits until it can get a lock on the set of holographic camera resources before
            // deallocating resources for this camera. At 60 frames per second this wait should
            // not take long.
            deviceResources.RemoveHolographicCamera(args.Camera);
        }

void OnDeviceLost | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources need to be released.

Definition at line 360 of file HolographicApp1Main.cs.

        {

#if DRAW_SAMPLE_CONTENT
            spinningCubeRenderer.ReleaseDeviceDependentResources();
#endif

        }

void OnDeviceRestored | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline]

Notifies renderers that device resources may now be recreated.

Definition at line 372 of file HolographicApp1Main.cs.

        {
#if DRAW_SAMPLE_CONTENT
            spinningCubeRenderer.CreateDeviceDependentResourcesAsync();
#endif
        }

void OnLocatabilityChanged | ( | SpatialLocator | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Definition at line 379 of file HolographicApp1Main.cs.

        {
            switch (sender.Locatability)
            {
                case SpatialLocatability.Unavailable:
                    // Holograms cannot be rendered.
                    {
                        String message = "Warning! Positional tracking is " + sender.Locatability + ".";
                        Debug.WriteLine(message);
                    }
                    break;

                // In the following three cases, it is still possible to place holograms using a
                // SpatialLocatorAttachedFrameOfReference.
                case SpatialLocatability.PositionalTrackingActivating:
                // The system is preparing to use positional tracking.

                case SpatialLocatability.OrientationOnly:
                // Positional tracking has not been activated.

                case SpatialLocatability.PositionalTrackingInhibited:
                    // Positional tracking is temporarily inhibited. User action may be required
                    // in order to restore positional tracking.
                    break;

                case SpatialLocatability.PositionalTrackingActive:
                    // Positional tracking is active. World-locked content can be rendered.
                    break;
            }
        }

bool Render ( ref HolographicFrame holographicFrame ) [inline]

Renders the current frame to each holographic display, according to the current application and spatial positioning state.

Returns true if the frame was rendered to at least one display.

Definition at line 245 of file HolographicApp1Main.cs.

        {
            // Don't try to render anything before the first Update.
            if (timer.FrameCount == 0)
            {
                return false;
            }

            //
            // TODO: Add code for pre-pass rendering here.
            //
            // Take care of any tasks that are not specific to an individual holographic
            // camera. This includes anything that doesn't need the final view or projection
            // matrix, such as lighting maps.
            //

            // Up-to-date frame predictions enhance the effectiveness of image stablization and
            // allow more accurate positioning of holograms.
            holographicFrame.UpdateCurrentPrediction();
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Lock the set of holographic camera resources, then draw to each camera
            // in this frame.
            return deviceResources.UseHolographicCameraResources(
                (Dictionary<uint, CameraResources> cameraResourceDictionary) =>
            {
                bool atLeastOneCameraRendered = false;

                foreach (var cameraPose in prediction.CameraPoses)
                {
                    // This represents the device-based resources for a HolographicCamera.
                    CameraResources cameraResources = cameraResourceDictionary[cameraPose.HolographicCamera.Id];

                    // Get the device context.
                    var context = deviceResources.D3DDeviceContext;
                    var renderTargetView = cameraResources.BackBufferRenderTargetView;
                    var depthStencilView = cameraResources.DepthStencilView;

                    // Set render targets to the current holographic camera.
                    context.OutputMerger.SetRenderTargets(depthStencilView, renderTargetView);

                    // Clear the back buffer and depth stencil view.
                    SharpDX.Mathematics.Interop.RawColor4 transparent = new SharpDX.Mathematics.Interop.RawColor4(0.0f, 0.0f, 0.0f, 0.0f);
                    context.ClearRenderTargetView(renderTargetView, transparent);
                    context.ClearDepthStencilView(
                        depthStencilView,
                        SharpDX.Direct3D11.DepthStencilClearFlags.Depth | SharpDX.Direct3D11.DepthStencilClearFlags.Stencil,
                        1.0f,
                        0);

                    //
                    // TODO: Replace the sample content with your own content.
                    //
                    // Notes regarding holographic content:
                    //    * For drawing, remember that you have the potential to fill twice as many pixels
                    //      in a stereoscopic render target as compared to a non-stereoscopic render target
                    //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
                    //      and only draw holograms that the user can see.
                    //    * To help occlude hologram geometry, you can create a depth map using geometry
                    //      data obtained via the surface mapping APIs. You can use this depth map to avoid
                    //      rendering holograms that are intended to be hidden behind tables, walls,
                    //      monitors, and so on.
                    //    * Black pixels will appear transparent to the user wearing the device, but you
                    //      should still use alpha blending to draw semitransparent holograms. You should
                    //      also clear the screen to Transparent as shown above.
                    //

                    // The view and projection matrices for each holographic camera will change
                    // every frame. This function refreshes the data in the constant buffer for
                    // the holographic camera indicated by cameraPose.
                    cameraResources.UpdateViewProjectionBuffer(deviceResources, cameraPose, attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp)/*referenceFrame.CoordinateSystem*/);

                    // Attach the view/projection constant buffer for this camera to the graphics pipeline.
                    bool cameraActive = cameraResources.AttachViewProjectionBuffer(deviceResources);

#if DRAW_SAMPLE_CONTENT
                    // Only render world-locked content when positional tracking is active.
                    if (cameraActive)
                    {
                        // Draw the sample hologram.
                        spinningCubeRenderer.Render();
                    }
#endif
                    atLeastOneCameraRendered = true;
                }

                return atLeastOneCameraRendered;
            });
        }

void SaveAppState ( ) [inline]

Definition at line 336 of file HolographicApp1Main.cs.

        {
            //
            // TODO: Insert code here to save your app state.
            //       This method is called when the app is about to suspend.
            //
            //       For example, store information in the SpatialAnchorStore.
            //
        }

void SetHolographicSpace ( HolographicSpace holographicSpace ) [inline]

Definition at line 73 of file HolographicApp1Main.cs.

        {
            this.holographicSpace = holographicSpace;

            //
            // TODO: Add code here to initialize your content.
            //

#if DRAW_SAMPLE_CONTENT
            // Initialize the sample hologram.
            spinningCubeRenderer = new SpinningCubeRenderer(deviceResources);

            spatialInputHandler = new SpatialInputHandler();
#endif

            // Use the default SpatialLocator to track the motion of the device.
            locator = SpatialLocator.GetDefault();

            // Be able to respond to changes in the positional tracking state.
            locator.LocatabilityChanged += this.OnLocatabilityChanged;

            // Respond to camera added events by creating any resources that are specific
            // to that camera, such as the back buffer render target view.
            // When we add an event handler for CameraAdded, the API layer will avoid putting
            // the new camera in new HolographicFrames until we complete the deferral we created
            // for that handler, or return from the handler without creating a deferral. This
            // allows the app to take more than one frame to finish creating resources and
            // loading assets for the new holographic camera.
            // This function should be registered before the app creates any HolographicFrames.
            holographicSpace.CameraAdded += this.OnCameraAdded;

            // Respond to camera removed events by releasing resources that were created for that
            // camera.
            // When the app receives a CameraRemoved event, it releases all references to the back
            // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
            // The app must also ensure that the back buffer is not attached as a render target, as
            // shown in DeviceResources.ReleaseResourcesForBackBuffer.
            holographicSpace.CameraRemoved += this.OnCameraRemoved;

            // The simplest way to render world-locked holograms is to create a stationary reference frame
            // when the app is launched. This is roughly analogous to creating a "world" coordinate system
            // with the origin placed at the device's position as the app is launched.
            referenceFrame = locator.CreateStationaryFrameOfReferenceAtCurrentLocation();
            attachreferenceFrame = locator.CreateAttachedFrameOfReferenceAtCurrentHeading();

            // Notes on spatial tracking APIs:
            // * Stationary reference frames are designed to provide a best-fit position relative to the
            //   overall space. Individual positions within that reference frame are allowed to drift slightly
            //   as the device learns more about the environment.
            // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
            //   anchor the individual hologram to a position in the real world - for example, a point the user
            //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
            //   anchor will use the corrected position starting in the next frame after the correction has
            //   occurred.
        }

HolographicFrame Update ( ) [inline]

Updates the application state once per frame.

Definition at line 144 of file HolographicApp1Main.cs.

        {
            // Before doing the timer update, there is some work to do per-frame
            // to maintain holographic rendering. First, we will get information
            // about the current frame.

            // The HolographicFrame has information that the app needs in order
            // to update and render the current frame. The app begins each new
            // frame by calling CreateNextFrame.
            HolographicFrame holographicFrame = holographicSpace.CreateNextFrame();

            // Get a prediction of where holographic cameras will be when this frame
            // is presented.
            HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;

            // Back buffers can change from frame to frame. Validate each buffer, and recreate
            // resource views and depth buffers as needed.
            deviceResources.EnsureCameraResources(holographicFrame, prediction);

            // Next, we get a coordinate system from the attached frame of reference that is
            // associated with the current frame. Later, this coordinate system is used for
            // for creating the stereo view matrices when rendering the sample content.
            SpatialCoordinateSystem currentCoordinateSystem = attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp);//referenceFrame.CoordinateSystem;

#if DRAW_SAMPLE_CONTENT

            // Check for new input state since the last frame.
            SpatialInteractionSourceState pointerState = spatialInputHandler.CheckForInput();
            if (null != pointerState)
            {
                // When a Pressed gesture is detected, the sample hologram will be repositioned
                // two meters in front of the user.
                spinningCubeRenderer.PositionHologram(
                  //  pointerState.TryGetPointerPose(currentCoordinateSystem)
                    SpatialPointerPose.TryGetAtTimestamp(currentCoordinateSystem, prediction.Timestamp)
                    );
            }

            //var downstate = Windows.UI.Core.CoreVirtualKeyStates.Down;
            //bool rightclick = (Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.Escape) & downstate) == downstate;
            //System.Diagnostics.Debug.WriteLine("Windows.System.VirtualKey.Escape  " + Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.Escape).ToString() + " downstate" + downstate);
            //System.Diagnostics.Debug.WriteLine("Windows.System.VirtualKey.A  " + Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.A).ToString() + " downstate" + downstate);
            //if (rightclick)
            //{
            //    Windows.UI.ViewManagement.ApplicationViewSwitcher.SwitchAsync(VideoGallery.mainId, VideoGallery.appId, Windows.UI.ViewManagement.ApplicationViewSwitchingOptions.ConsolidateViews);
            //}
#endif

            timer.Tick(() =>
            {
                //
                // TODO: Update scene objects.
                //
                // Put time-based updates here. By default this code will run once per frame,
                // but if you change the StepTimer to use a fixed time step this code will
                // run as many times as needed to get to the current step.
                //

#if DRAW_SAMPLE_CONTENT
                spinningCubeRenderer.Update(timer);
#endif
            });

            // We complete the frame update by using information about our content positioning
            // to set the focus point.
            foreach (var cameraPose in prediction.CameraPoses)
            {
#if DRAW_SAMPLE_CONTENT
                // The HolographicCameraRenderingParameters class provides access to set
                // the image stabilization parameters.
                HolographicCameraRenderingParameters renderingParameters = holographicFrame.GetRenderingParameters(cameraPose);

                // SetFocusPoint informs the system about a specific point in your scene to
                // prioritize for image stabilization. The focus point is set independently
                // for each holographic camera.
                // You should set the focus point near the content that the user is looking at.
                // In this example, we put the focus point at the center of the sample hologram,
                // since that is the only hologram available for the user to focus on.
                // You can also set the relative velocity and facing of that content; the sample
                // hologram is at a fixed point so we only need to indicate its position.
                Vector3 position = new Vector3(0.0f, 0.0f, -3.0f);
                    renderingParameters.SetFocusPoint(
                    currentCoordinateSystem, position
                    /*spinningCubeRenderer.Position*/
                    );
#endif
            }

            // The holographic frame will be used to get up-to-date view and projection matrices and
            // to present the swap chain.
            return holographicFrame;
        }

Member Data Documentation

SpatialLocatorAttachedFrameOfReference attachreferenceFrame [private]

Definition at line 58 of file HolographicApp1Main.cs.

DeviceResources deviceResources [private]

Definition at line 44 of file HolographicApp1Main.cs.

HolographicSpace holographicSpace [private]

Definition at line 50 of file HolographicApp1Main.cs.

SpatialLocator locator [private]

Definition at line 53 of file HolographicApp1Main.cs.

SpatialStationaryFrameOfReference referenceFrame [private]

Definition at line 56 of file HolographicApp1Main.cs.

StepTimer timer = new StepTimer() [private]

Definition at line 47 of file HolographicApp1Main.cs.

The documentation for this class was generated from the following file:
  • 360VideoPlayback/cs/HolographicApp1Main.cs
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CubeModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • CubeModelConstantBuffer
Public Attributes

CubeModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::float4x4 model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

Windows::Foundation::Numerics::float4x4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicFaceTracking/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FaceTrackerProcessor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • FaceTrackerProcessor
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

FaceTrackerProcessor Class Reference

#include "FaceTrackerProcessor.h"

List of all members.

Public Member Functions

FaceTrackerProcessor (Windows::Media::FaceAnalysis::FaceTracker^tracker, std::shared_ptr< VideoFrameProcessor > processor)
~FaceTrackerProcessor (void)
std::vector
< Windows::Graphics::Imaging::BitmapBounds > 		GetLatestFaces (void) const
bool | IsTrackingFaces (void) const

Static Public Member Functions

static concurrency::task
< std::shared_ptr
< FaceTrackerProcessor > > 		CreateAsync (std::shared_ptr< VideoFrameProcessor > processor)

Protected Member Functions

void | ProcessFrame (void)

Protected Attributes

Windows::Media::FaceAnalysis::FaceTracker | m_faceTracker
bool | m_isRunning = false
std::vector
< Windows::Graphics::Imaging::BitmapBounds > 		m_latestFaces
uint32_t | m_numFramesWithoutFaces = 0
std::shared_mutex | m_propertiesLock
std::shared_ptr
< VideoFrameProcessor > 		m_videoProcessor
std::thread | m_workerThread

Detailed Description

Definition at line 20 of file FaceTrackerProcessor.h.

Constructor & Destructor Documentation

FaceTrackerProcessor | ( | Windows::Media::FaceAnalysis::FaceTracker^ | tracker,
 |  | std::shared_ptr< VideoFrameProcessor > | processor
 | ) |  |

Definition at line 39 of file FaceTrackerProcessor.cpp.

    : m_faceTracker(std::move(tracker))
    , m_videoProcessor(std::move(processor))
{
    if (m_videoProcessor)
    {
        // Create explicit background thread for FaceTrackingProcessing, as it is an expensive operation.
        m_workerThread = std::thread([this]
        {
            m_isRunning = true;

            while (m_isRunning)
            {
                ProcessFrame();
            }
        });
    }
}

~FaceTrackerProcessor ( void )

Definition at line 58 of file FaceTrackerProcessor.cpp.

{
    m_isRunning = false;
}

Member Function Documentation

task< std::shared_ptr< FaceTrackerProcessor > > CreateAsync ( std::shared_ptr< VideoFrameProcessor > processor ) [static]

Definition at line 27 of file FaceTrackerProcessor.cpp.

{
    return create_task(FaceTracker::CreateAsync())
        .then([=](FaceTracker^ tracker)
    {
        tracker->MinDetectableFaceSize = Windows::Graphics::Imaging::BitmapSize{ 64u, 64u };
        tracker->MaxDetectableFaceSize = Windows::Graphics::Imaging::BitmapSize{ 512u, 512u };

        return std::make_shared<FaceTrackerProcessor>(std::move(tracker), std::move(processor));
    });
}

std::vector< Windows::Graphics::Imaging::BitmapBounds > GetLatestFaces ( void ) const

Definition at line 69 of file FaceTrackerProcessor.cpp.

{
    auto lock = std::shared_lock<std::shared_mutex>(m_propertiesLock);
    return m_latestFaces;
}

bool IsTrackingFaces ( void ) const

Definition at line 63 of file FaceTrackerProcessor.cpp.

{
    auto lock = std::shared_lock<std::shared_mutex>(m_propertiesLock);
    return !m_latestFaces.empty();
}

void ProcessFrame ( void ) [protected]

Definition at line 75 of file FaceTrackerProcessor.cpp.

{
    if (MediaFrameReference^ frame = m_videoProcessor->GetLatestFrame())
    {
        if (VideoMediaFrame^ videoMediaFrame = frame->VideoMediaFrame)
        {
            // Validate that the incoming frame format is compatible with the FaceTracker
            if (videoMediaFrame->SoftwareBitmap && FaceTracker::IsBitmapPixelFormatSupported(videoMediaFrame->SoftwareBitmap->BitmapPixelFormat))
            {
                // Ask the FaceTracker to process this frame asynchronously
                task<IVector<DetectedFace^>^> processFrameTask = create_task(m_faceTracker->ProcessNextFrameAsync(videoMediaFrame->GetVideoFrame()));

                try
                {
                    IVector<DetectedFace^>^ faces = processFrameTask.get();

                    std::lock_guard<std::shared_mutex> lock(m_propertiesLock);

                    if (faces->Size == 0u)
                    {
                        ++m_numFramesWithoutFaces;

                        // The FaceTracker might lose track of faces for a few frames, for example,
                        // if the person momentarily turns their head away from the camera. To smooth out
                        // the tracking, we allow 30 video frames (~1 second) without faces before
                        // we say that we're no longer tracking any faces.
                        if (m_numFramesWithoutFaces > 30u && !m_latestFaces.empty())
                        {
                            m_latestFaces.resize(0u);
                        }
                    }
                    else
                    {
                        m_numFramesWithoutFaces = 0u;
                        m_latestFaces.resize(faces->Size);

                        for (uint32_t i = 0u; i < faces->Size; ++i)
                        {
                            m_latestFaces[i] = faces->GetAt(i)->FaceBox;
                        }
                    }
                }
                catch(task_canceled const&)
                {
                    // The task might be cancelled if the FaceAnalysis failed.
                    return;
                }
            }
        }
    }
}

Member Data Documentation

Windows::Media::FaceAnalysis::FaceTracker m_faceTracker [protected]

Definition at line 38 of file FaceTrackerProcessor.h.

bool m_isRunning = false [protected]

Definition at line 47 of file FaceTrackerProcessor.h.

std::vector<Windows::Graphics::Imaging::BitmapBounds> m_latestFaces [protected]

Definition at line 42 of file FaceTrackerProcessor.h.

uint32_t m_numFramesWithoutFaces = 0 [protected]

Definition at line 44 of file FaceTrackerProcessor.h.

std::shared_mutex m_propertiesLock [mutable, protected]

Definition at line 41 of file FaceTrackerProcessor.h.

std::shared_ptr<VideoFrameProcessor> m_videoProcessor [protected]

Definition at line 39 of file FaceTrackerProcessor.h.

std::thread m_workerThread [protected]

Definition at line 46 of file FaceTrackerProcessor.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.h
  • HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTrackerMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • HolographicFaceTrackerMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicFaceTrackerMain Class Reference

#include "HolographicFaceTrackerMain.h"

List of all members.

Public Member Functions

HolographicFaceTrackerMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicFaceTrackerMain ()
bool | IsReadyToRender (void) const
void | LoadAppState ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | ProcessFaces (std::vector< Windows::Graphics::Imaging::BitmapBounds > const &faces, Windows::Media::Capture::Frames::MediaFrameReference^frame, Windows::Perception::Spatial::SpatialCoordinateSystem^worldCoordSystem)
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::shared_ptr
< FaceTrackerProcessor > 		m_faceTrackerProcessor
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
bool | m_isReadyToRender = false
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
int64_t | m_previousFrameTimestamp = 0
std::shared_ptr< QuadRenderer > | m_quadRenderer
Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference | m_referenceFrame
std::shared_ptr
< SpinningCubeRenderer > 		m_spinningCubeRenderer
std::shared_ptr< TextRenderer > | m_textRenderer
DX::StepTimer m_timer
bool | m_trackingFaces = false
std::shared_ptr
< VideoFrameProcessor > 		m_videoFrameProcessor
std::shared_ptr< NV12VideoTexture > | m_videoTexture

Detailed Description

Definition at line 28 of file HolographicFaceTrackerMain.h.

Constructor & Destructor Documentation

HolographicFaceTrackerMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 46 of file HolographicFaceTrackerMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~HolographicFaceTrackerMain ( )

Definition at line 173 of file HolographicFaceTrackerMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

bool IsReadyToRender ( void ) const [inline]

Definition at line 44 of file HolographicFaceTrackerMain.h.

{ return m_isReadyToRender; }

void LoadAppState ( )

Definition at line 436 of file HolographicFaceTrackerMain.cpp.

{
    // This sample has no state to restore on suspend.
}

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 443 of file HolographicFaceTrackerMain.cpp.

{
    m_isReadyToRender = false;

    m_quadRenderer->ReleaseDeviceDependentResources();
    m_spinningCubeRenderer->ReleaseDeviceDependentResources();
    m_textRenderer->ReleaseDeviceDependentResources();
    m_videoTexture->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 455 of file HolographicFaceTrackerMain.cpp.

{
    auto initTasks = {
        m_quadRenderer->CreateDeviceDependentResourcesAsync(),
        m_spinningCubeRenderer->CreateDeviceDependentResourcesAsync(),
        m_textRenderer->CreateDeviceDependentResourcesAsync(),
        m_videoTexture->CreateDeviceDependentResourcesAsync(),
    };

    when_all(initTasks.begin(), initTasks.end()).then([this] {
        m_isReadyToRender = true;
    });
}

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void ProcessFaces | ( | std::vector< Windows::Graphics::Imaging::BitmapBounds > const & | faces,
 |  | Windows::Media::Capture::Frames::MediaFrameReference^ | frame,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | worldCoordSystem |
 | ) |  |  | [private]
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 363 of file HolographicFaceTrackerMain.cpp.

{
    if (!m_isReadyToRender)
    {
        return false;
    }

    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(holographicFrame->CurrentPrediction->Timestamp);

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame, currentCoordinateSystem](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, currentCoordinateSystem);

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

            // Render world-locked content only when positional tracking is active.
            if (cameraActive)
            {
                // If we are tracking any faces, then we render the cube over their head, and the video image on the quad.
                if (m_trackingFaces)
                {
                    m_spinningCubeRenderer->Render();
                    m_quadRenderer->RenderNV12(m_videoTexture->GetLuminanceTexture(), m_videoTexture->GetChrominanceTexture());
                }
                // Otherwise we render the status message on the quad.
                else
                {
                    m_quadRenderer->RenderRGB(m_textRenderer->GetTexture());
                }
            }

            atLeastOneCameraRendered = true;
        }

        return atLeastOneCameraRendered;
    });
}

void SaveAppState ( )

Definition at line 431 of file HolographicFaceTrackerMain.cpp.

{
    // This sample does not save any state on suspend.
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 148 of file HolographicFaceTrackerMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }
}

HolographicFrame Update ( )

Definition at line 261 of file HolographicFaceTrackerMain.cpp.

{
    if (!m_isReadyToRender)
    {
        return nullptr;
    }

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);

    if (m_videoFrameProcessor && m_faceTrackerProcessor)
    {
        m_trackingFaces = m_faceTrackerProcessor->IsTrackingFaces();

        if (m_trackingFaces)
        {
            if (MediaFrameReference^ frame = m_videoFrameProcessor->GetLatestFrame())
            {
                ProcessFaces(m_faceTrackerProcessor->GetLatestFaces(), frame, currentCoordinateSystem);

                int64_t const currentTimeStamp = frame->SystemRelativeTime->Value.Duration;

                // Copy only new frames to our DirectX texture.
                if (currentTimeStamp > m_previousFrameTimestamp)
                {
                    m_videoTexture->CopyFromVideoMediaFrame(frame->VideoMediaFrame);
                    m_previousFrameTimestamp = currentTimeStamp;
                }
            }
        }
    }

    SpatialPointerPose^ pointerPose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);

    m_timer.Tick([&] {
        m_spinningCubeRenderer->Update(m_timer);

        // If we're tracking faces, then put the quad to the left side of the viewport, 2 meters out.
        if (m_trackingFaces)
        {
            m_quadRenderer->Update(pointerPose, float3{ -0.45f, 0.0f, -2.0f }, m_timer);
        }
        // Otherwise, put the quad centered in the viewport, 2 meters out.
        else
        {
            m_quadRenderer->ResetTexCoordScaleAndOffset();
            m_quadRenderer->Update(pointerPose, float3{ 0.0f, -0.15f, -2.0f }, m_timer);
        }
    });

    // We complete the frame update by using information about our content positioning
    // to set the focus point.
    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.

    for (auto cameraPose : prediction->CameraPoses)
    {
        // The HolographicCameraRenderingParameters class provides access to set
        // the image stabilization parameters.
        HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

        // If we're tracking faces, then put the focus point on the cube
        if (m_trackingFaces)
        {
            renderingParameters->SetFocusPoint(
                currentCoordinateSystem,
                m_spinningCubeRenderer->GetPosition()
            );
        }
        // Otherwise put the focus point on status message quad.
        else
        {
            renderingParameters->SetFocusPoint(
                currentCoordinateSystem,
                m_quadRenderer->GetPosition(),
                m_quadRenderer->GetNormal(),
                m_quadRenderer->GetVelocity()
            );
        }
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 116 of file HolographicFaceTrackerMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 117 of file HolographicFaceTrackerMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 81 of file HolographicFaceTrackerMain.h.

std::shared_ptr<FaceTrackerProcessor> m_faceTrackerProcessor [private]

Definition at line 98 of file HolographicFaceTrackerMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 87 of file HolographicFaceTrackerMain.h.

bool m_isReadyToRender = false [private]

Definition at line 113 of file HolographicFaceTrackerMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 118 of file HolographicFaceTrackerMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 90 of file HolographicFaceTrackerMain.h.

int64_t m_previousFrameTimestamp = 0 [private]

Definition at line 107 of file HolographicFaceTrackerMain.h.

std::shared_ptr<QuadRenderer> m_quadRenderer [private]

Definition at line 101 of file HolographicFaceTrackerMain.h.

Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference m_referenceFrame [private]

Definition at line 93 of file HolographicFaceTrackerMain.h.

std::shared_ptr<SpinningCubeRenderer> m_spinningCubeRenderer [private]

Definition at line 102 of file HolographicFaceTrackerMain.h.

std::shared_ptr<TextRenderer> m_textRenderer [private]

Definition at line 103 of file HolographicFaceTrackerMain.h.

DX::StepTimer m_timer [private]

Definition at line 84 of file HolographicFaceTrackerMain.h.

bool m_trackingFaces = false [private]

Definition at line 110 of file HolographicFaceTrackerMain.h.

std::shared_ptr<VideoFrameProcessor> m_videoFrameProcessor [private]

Definition at line 97 of file HolographicFaceTrackerMain.h.

std::shared_ptr<NV12VideoTexture> m_videoTexture [private]

Definition at line 104 of file HolographicFaceTrackerMain.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/HolographicFaceTrackerMain.h
  • HolographicFaceTracking/cpp/HolographicFaceTrackerMain.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NV12VideoTexture Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • NV12VideoTexture
Public Member Functions | Protected Attributes

NV12VideoTexture Class Reference

#include "NV12VideoTexture.h"

Inherits DX::Resource.

List of all members.

Public Member Functions

NV12VideoTexture (std::shared_ptr< DX::DeviceResources > deviceResources, uint32_t width, uint32_t height)
void | CopyFromVideoMediaFrame (Windows::Media::Capture::Frames::VideoMediaFrame^source)
concurrency::task< void > | CreateDeviceDependentResourcesAsync () override
ID3D11ShaderResourceView * | GetChrominanceTexture (void) const
ID3D11ShaderResourceView * | GetLuminanceTexture (void) const
ID3D11Texture2D * | GetTexture (void) const
void | ReleaseDeviceDependentResources () override

Protected Attributes

Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_chrominanceView
uint32_t const | m_height
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_luminanceView
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
uint32_t const | m_width

Detailed Description

Definition at line 19 of file NV12VideoTexture.h.

Constructor & Destructor Documentation

NV12VideoTexture | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | uint32_t | width,
 |  | uint32_t | height
 | ) |  |

Definition at line 26 of file NV12VideoTexture.cpp.

    : DX::Resource(std::move(deviceResources))
    , m_width(width)
    , m_height(height)
{
}

Member Function Documentation

void CopyFromVideoMediaFrame ( Windows::Media::Capture::Frames::VideoMediaFrame^ source )

Definition at line 34 of file NV12VideoTexture.cpp.

{
    SoftwareBitmap^ softwareBitmap = source->SoftwareBitmap;

    if (softwareBitmap == nullptr)
    {
        OutputDebugString(L"SoftwareBitmap was null\r\n");
        return;
    }

    if (softwareBitmap->BitmapPixelFormat != BitmapPixelFormat::Nv12)
    {
        OutputDebugString(L"BitmapPixelFormat was not NV12\r\n");
        return;
    }

    BitmapBuffer^ bitmapBuffer = softwareBitmap->LockBuffer(BitmapBufferAccessMode::Read);
    IMemoryBufferReference^ bufferRef = bitmapBuffer->CreateReference();

    ComPtr<IMemoryBufferByteAccess> memoryBufferByteAccess;
    if (SUCCEEDED(reinterpret_cast<IInspectable*>(bufferRef)->QueryInterface(IID_PPV_ARGS(&memoryBufferByteAccess))))
    {
        BYTE* pSourceBuffer = nullptr;
        UINT32 sourceCapacity = 0;
        if (SUCCEEDED(memoryBufferByteAccess->GetBuffer(&pSourceBuffer, &sourceCapacity)) && pSourceBuffer)
        {
            auto const context = m_deviceResources->GetD3DDeviceContext();

            // Copy the new video frame over.
            D3D11_MAPPED_SUBRESOURCE subResource;
            if (SUCCEEDED(context->Map(m_texture.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &subResource)))
            {
                std::memcpy(subResource.pData, pSourceBuffer, sourceCapacity);
                context->Unmap(m_texture.Get(), 0);
            }
        }
    }
}

concurrency::task< void > CreateDeviceDependentResourcesAsync ( ) [override, virtual]

Implements Resource.

Definition at line 73 of file NV12VideoTexture.cpp.

{
    return concurrency::create_task([this]
    {
        D3D11_TEXTURE2D_DESC const texDesc = CD3D11_TEXTURE2D_DESC(
            DXGI_FORMAT_NV12,           // HoloLens PV camera format, common for video sources
            m_width,                    // Width of the video frames
            m_height,                   // Height of the video frames
            1,                          // Number of textures in the array
            1,                          // Number of miplevels in each texture
            D3D11_BIND_SHADER_RESOURCE, // We read from this texture in the shader
            D3D11_USAGE_DYNAMIC,        // Because we'll be copying from CPU memory
            D3D11_CPU_ACCESS_WRITE      // We only need to write into the texture
        );

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateTexture2D(
                &texDesc,
                nullptr,
                &m_texture
            )
        );

        // https://msdn.microsoft.com/en-us/library/windows/desktop/bb173059(v=vs.85).aspx
        // To access DXGI_FORMAT_NV12 in the shader, we need to map the luminance channel and the chrominance channels
        // into a format that shaders can understand.
        // In the case of NV12, DirectX understands how the texture is laid out, so we can create these
        // shader resource views which represent the two channels of the NV12 texture.
        // Then inside the shader we convert YUV into RGB so we can render.

        // DirectX specifies the view format to be DXGI_FORMAT_R8_UNORM for NV12 luminance channel.
        // Luminance is 8 bits per pixel. DirectX will handle converting 8-bit integers into normalized
        // floats for use in the shader.
        D3D11_SHADER_RESOURCE_VIEW_DESC const luminancePlaneDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(
            m_texture.Get(),
            D3D11_SRV_DIMENSION_TEXTURE2D,
            DXGI_FORMAT_R8_UNORM
        );

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateShaderResourceView(
                m_texture.Get(),
                &luminancePlaneDesc,
                &m_luminanceView
            )
        );

        // DirectX specifies the view format to be DXGI_FORMAT_R8G8_UNORM for NV12 chrominance channel.
        // Chrominance has 8 bits for U and 8 bits for V per sample (1 sample per 2x2 block of pixels).
        //  DirectX will handle converting 8-bit integers into normalized floats for use in the shader.
        D3D11_SHADER_RESOURCE_VIEW_DESC const chrominancePlaneDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(
            m_texture.Get(),
            D3D11_SRV_DIMENSION_TEXTURE2D,
            DXGI_FORMAT_R8G8_UNORM
        );

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateShaderResourceView(
                m_texture.Get(),
                &chrominancePlaneDesc,
                &m_chrominanceView
            )
        );
    });
}

ID3D11ShaderResourceView* GetChrominanceTexture ( void ) const [inline]

Definition at line 36 of file NV12VideoTexture.h.

{ return m_chrominanceView.Get(); }

ID3D11ShaderResourceView* GetLuminanceTexture ( void ) const [inline]

Definition at line 35 of file NV12VideoTexture.h.

{ return m_luminanceView.Get(); }

ID3D11Texture2D* GetTexture ( void ) const [inline]

Definition at line 34 of file NV12VideoTexture.h.

{ return m_texture.Get(); }

void ReleaseDeviceDependentResources ( ) [override, virtual]

Implements Resource.

Definition at line 139 of file NV12VideoTexture.cpp.

{
    m_chrominanceView.Reset();
    m_luminanceView.Reset();
    m_texture.Reset();
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_chrominanceView [protected]

Definition at line 41 of file NV12VideoTexture.h.

uint32_t const m_height [protected]

Definition at line 44 of file NV12VideoTexture.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_luminanceView [protected]

Definition at line 40 of file NV12VideoTexture.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [protected]

Definition at line 39 of file NV12VideoTexture.h.

uint32_t const m_width [protected]

Definition at line 43 of file NV12VideoTexture.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/NV12VideoTexture.h
  • HolographicFaceTracking/cpp/Content/NV12VideoTexture.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: QuadModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • QuadModelConstantBuffer
Public Attributes

QuadModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::float4x4 model
Windows::Foundation::Numerics::float2 texCoordOffset
Windows::Foundation::Numerics::float2 texCoordScale

Detailed Description

Definition at line 14 of file ShaderStructures.h.

Member Data Documentation

Windows::Foundation::Numerics::float4x4 model

Definition at line 16 of file ShaderStructures.h.

Windows::Foundation::Numerics::float2 texCoordOffset

Definition at line 18 of file ShaderStructures.h.

Windows::Foundation::Numerics::float2 texCoordScale

Definition at line 17 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicFaceTracking/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: QuadRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • QuadRenderer
Public Member Functions | Protected Member Functions | Private Attributes

QuadRenderer Class Reference

#include "QuadRenderer.h"

Inherits DX::Resource.

List of all members.

Public Member Functions

QuadRenderer (std::shared_ptr< DX::DeviceResources > deviceResources)
concurrency::task< void > | CreateDeviceDependentResourcesAsync () override
Windows::Foundation::Numerics::float3
const & 		GetNormal () const
Windows::Foundation::Numerics::float3
const & 		GetPosition () const
Windows::Foundation::Numerics::float3
const & 		GetVelocity () const
void | ReleaseDeviceDependentResources () override
void | RenderNV12 (ID3D11ShaderResourceView *luminanceTexture, ID3D11ShaderResourceView *chrominanceTexture)
void | RenderRGB (ID3D11ShaderResourceView *rgbTexture)
void | ResetTexCoordScaleAndOffset (Windows::Foundation::Numerics::float2 const &texCoordScale={1.0f, 1.0f}, Windows::Foundation::Numerics::float2 const &texCoordOffset={0.0f, 0.0f})
void | SetTexCoordScaleAndOffset (Windows::Foundation::Numerics::float2 const &texCoordScale, Windows::Foundation::Numerics::float2 const &texCoordOffset)
void | Update (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, Windows::Foundation::Numerics::float3 const &offset, DX::StepTimer const &timer)

Protected Member Functions

void | RenderInternal (void)

Private Attributes

const float | c_lerpRate = 6.0f
float | m_degreesPerSecond = 45.f
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
QuadModelConstantBuffer m_modelConstantBufferData
Windows::Foundation::Numerics::float3 | m_normal = { 0.f, 0.f, 1.f }
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShaderNV12
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShaderRGB
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerState
Windows::Foundation::Numerics::float3 | m_targetForward = { 0.f, 0.f, -1.f }
Windows::Foundation::Numerics::float3 | m_targetPosition = { 0.f, 0.f, -2.f }
Windows::Foundation::Numerics::float2 | m_targetTexCoordOffset = { 0.0f, 0.0f }
Windows::Foundation::Numerics::float2 | m_targetTexCoordScale = { 1.0f, 1.0f }
Windows::Foundation::Numerics::float3 | m_targetUp = { 0.f, 1.f, 0.f }
Windows::Foundation::Numerics::float2 | m_texCoordOffset = { 0.0f, 0.0f }
Windows::Foundation::Numerics::float2 | m_texCoordScale = { 1.0f, 1.0f }
bool | m_usingVprtShaders = false
Windows::Foundation::Numerics::float3 | m_velocity = { 0.f, 0.f, 0.f }
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 21 of file QuadRenderer.h.

Constructor & Destructor Documentation

QuadRenderer ( std::shared_ptr< DX::DeviceResources > deviceResources )

Definition at line 23 of file QuadRenderer.cpp.

                                                                           :
    DX::Resource(std::move(deviceResources))
{
}

Member Function Documentation

task< void > CreateDeviceDependentResourcesAsync ( ) [override, virtual]

Implements Resource.

Definition at line 206 of file QuadRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // If the optional VPRT feature is supported by the graphics device, we
    // can avoid using geometry shaders to set the render target array index.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///QuadVPRTVertexShader.cso" : L"ms-appx:///QuadVertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTaskNV12 = DX::ReadDataAsync(L"ms-appx:///QuadPixelShaderNV12.cso");
    task<std::vector<byte>> loadPSTaskRGB = DX::ReadDataAsync(L"ms-appx:///QuadPixelShaderRGB.cso");
    task<std::vector<byte>> loadGSTask;

    if (!m_usingVprtShaders)
    {
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///QuadGeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
        {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexPositionTex, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, offsetof(VertexPositionTex, tex), D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                vertexDesc.size(),
                fileData.data(),
                fileData.size(),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTaskNV12 = loadPSTaskNV12.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShaderNV12
                )
            );
    });

    task<void> createPSTaskRGB = loadPSTaskRGB.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShaderRGB
            )
        );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTaskNV12 && createPSTaskRGB && createVSTask) : (createPSTaskNV12 && createPSTaskRGB && createVSTask && createGSTask);
    task<void> finalLoadingTask = shaderTaskGroup.then([this] ()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the quad size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // quad at a comfortable size we made the quad width 0.2 m (20 cm).
        static const std::array<VertexPositionTex, 4> quadVertices =
        {{
            { float3(-0.5f,  0.5f, 0.f), float2(0.f, 0.f) },
            { float3( 0.5f,  0.5f, 0.f), float2(1.f, 0.f) },
            { float3( 0.5f, -0.5f, 0.f), float2(1.f, 1.f) },
            { float3(-0.5f, -0.5f, 0.f), float2(0.f, 1.f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem                = quadVertices.data();
        vertexBufferData.SysMemPitch            = 0;
        vertexBufferData.SysMemSlicePitch       = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionTex) * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<uint16_t, 12> quadIndices =
        {{
            // -z
            0,2,3,
            0,1,2,

            // +z
            2,0,3,
            1,0,2,
        }};

        m_indexCount = quadIndices.size();

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = quadIndices.data();
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );

        D3D11_SAMPLER_DESC desc = CD3D11_SAMPLER_DESC(CD3D11_DEFAULT());

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateSamplerState(
                &desc,
                &m_samplerState
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(QuadModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
            )
        );
    });

    return finalLoadingTask;
}

Windows::Foundation::Numerics::float3 const& GetNormal ( ) const [inline]

Definition at line 56 of file QuadRenderer.h.

{ return m_normal; }

Windows::Foundation::Numerics::float3 const& GetPosition ( ) const [inline]

Definition at line 54 of file QuadRenderer.h.

{ return m_position; }

Windows::Foundation::Numerics::float3 const& GetVelocity ( ) const [inline]

Definition at line 55 of file QuadRenderer.h.

{ return m_velocity; }

void ReleaseDeviceDependentResources ( ) [override, virtual]

Implements Resource.

Definition at line 380 of file QuadRenderer.cpp.

{
    m_usingVprtShaders = false;

    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShaderRGB.Reset();
    m_pixelShaderNV12.Reset();
    m_geometryShader.Reset();

    m_modelConstantBuffer.Reset();

    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();

    m_samplerState.Reset();
}

void RenderInternal ( void ) [protected]

Definition at line 93 of file QuadRenderer.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionTex struct.
    const UINT stride = sizeof(VertexPositionTex);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
    );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
    );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
    );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
    );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader sets the render target ID.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
        );
    }

    context->PSSetSamplers(
        0,
        1,
        m_samplerState.GetAddressOf()
    );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
    );
}

void RenderNV12 | ( | ID3D11ShaderResourceView * | luminanceTexture,
 |  | ID3D11ShaderResourceView * | chrominanceTexture
 | ) |  |

Definition at line 178 of file QuadRenderer.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Set the NV12 shader.
    context->PSSetShader(
        m_pixelShaderNV12.Get(),
        nullptr,
        0
    );

    // Rendering NV12 requires two resource views, which represent the luminance and chrominance channels of the YUV formatted texture.
    std::array<ID3D11ShaderResourceView*, 2> const textureViews = {
        luminanceTexture,
        chrominanceTexture
    };

    // Bind the NV12 channels to the shader.
    context->PSSetShaderResources(
        0,
        textureViews.size(),
        textureViews.data()
    );

    // Handle the rest of the rendering which is shared by RGB and NV12 rendering.
    RenderInternal();
}

void RenderRGB ( ID3D11ShaderResourceView * rgbTexture )

Definition at line 156 of file QuadRenderer.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Set the RGB shader
    context->PSSetShader(
        m_pixelShaderRGB.Get(),
        nullptr,
        0
    );

    // Bind the RGB texture to the shader.
    context->PSSetShaderResources(
        0,
        1,
        &rgbTexture
    );

    // Handle the rest of the rendering which is shared by RGB and NV12 rendering.
    RenderInternal();
}

void ResetTexCoordScaleAndOffset ( )
void SetTexCoordScaleAndOffset | ( | Windows::Foundation::Numerics::float2 const & | texCoordScale,
 |  | Windows::Foundation::Numerics::float2 const & | texCoordOffset
 | ) |  |
void Update | ( | Windows::UI::Input::Spatial::SpatialPointerPose^ | pointerPose,
 |  | Windows::Foundation::Numerics::float3 const & | offset,
 |  | DX::StepTimer const & | timer
 | ) |  |

Member Data Documentation

const float c_lerpRate = 6.0f [private]

Definition at line 98 of file QuadRenderer.h.

float m_degreesPerSecond = 45.f [private]

Definition at line 80 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 67 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 65 of file QuadRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 77 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 63 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 70 of file QuadRenderer.h.

QuadModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 76 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_normal = { 0.f, 0.f, 1.f } [private]

Definition at line 86 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShaderNV12 [private]

Definition at line 69 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShaderRGB [private]

Definition at line 68 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 84 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState [private]

Definition at line 73 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_targetForward = { 0.f, 0.f, -1.f } [private]

Definition at line 83 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_targetPosition = { 0.f, 0.f, -2.f } [private]

Definition at line 81 of file QuadRenderer.h.

Windows::Foundation::Numerics::float2 m_targetTexCoordOffset = { 0.0f, 0.0f } [private]

Definition at line 89 of file QuadRenderer.h.

Windows::Foundation::Numerics::float2 m_targetTexCoordScale = { 1.0f, 1.0f } [private]

Definition at line 88 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_targetUp = { 0.f, 1.f, 0.f } [private]

Definition at line 82 of file QuadRenderer.h.

Windows::Foundation::Numerics::float2 m_texCoordOffset = { 0.0f, 0.0f } [private]

Definition at line 91 of file QuadRenderer.h.

Windows::Foundation::Numerics::float2 m_texCoordScale = { 1.0f, 1.0f } [private]

Definition at line 90 of file QuadRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 95 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_velocity = { 0.f, 0.f, 0.f } [private]

Definition at line 85 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 64 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 66 of file QuadRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/QuadRenderer.h
  • HolographicFaceTracking/cpp/Content/QuadRenderer.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicFaceTrackerMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 20 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 48 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 53 of file AppView.h.

std::unique_ptr<HolographicFaceTrackerMain> m_main [private]

Definition at line 46 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 49 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 50 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicFaceTracking/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpinningCubeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • SpinningCubeRenderer
Public Member Functions | Private Attributes

SpinningCubeRenderer Class Reference

#include "SpinningCubeRenderer.h"

Inherits DX::Resource.

List of all members.

Public Member Functions

SpinningCubeRenderer (std::shared_ptr< DX::DeviceResources > deviceResources)
concurrency::task< void > | CreateDeviceDependentResourcesAsync () override
Windows::Foundation::Numerics::float3
const & 		GetPosition () const
Windows::Foundation::Numerics::float3
const & 		GetVelocity () const
void | ReleaseDeviceDependentResources () override
void | Render ()
void | SetTargetPosition (Windows::Foundation::Numerics::float3 pos)
void | Update (const DX::StepTimer &timer)

Private Attributes

const float | c_lerpRate = 4.0f
float | m_degreesPerSecond = 45.f
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
CubeModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
Windows::Foundation::Numerics::float3 | m_targetPosition = { 0.f, 0.f, -2.f }
bool | m_usingVprtShaders = false
Windows::Foundation::Numerics::float3 | m_velocity = { 0.f, 0.f, 0.f }
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 21 of file SpinningCubeRenderer.h.

Constructor & Destructor Documentation

SpinningCubeRenderer ( std::shared_ptr< DX::DeviceResources > deviceResources )

Definition at line 22 of file SpinningCubeRenderer.cpp.

                                                                                :
    DX::Resource(std::move(deviceResources))
{
}

Member Function Documentation

task< void > CreateDeviceDependentResourcesAsync ( ) [override, virtual]

Implements Resource.

Definition at line 135 of file SpinningCubeRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///CubeVPRTVertexShader.cso" : L"ms-appx:///CubeVertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///CubePixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///CubeGeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc = {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexPositionColor, pos),   D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexPositionColor, color), D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                vertexDesc.size(),
                fileData.data(),
                fileData.size(),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(CubeModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
                )
            );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    &fileData[0],
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> finalLoadingTask  = shaderTaskGroup.then([this] ()
    {
        static const std::array<VertexPositionColor, 8> cubeVertices =
        {{
            { float3(-0.5f, -0.5f, -0.5f), float3(0.0f, 0.0f, 0.0f) },
            { float3(-0.5f, -0.5f,  0.5f), float3(0.0f, 0.0f, 1.0f) },
            { float3(-0.5f,  0.5f, -0.5f), float3(0.0f, 1.0f, 0.0f) },
            { float3(-0.5f,  0.5f,  0.5f), float3(0.0f, 1.0f, 1.0f) },
            { float3( 0.5f, -0.5f, -0.5f), float3(1.0f, 0.0f, 0.0f) },
            { float3( 0.5f, -0.5f,  0.5f), float3(1.0f, 0.0f, 1.0f) },
            { float3( 0.5f,  0.5f, -0.5f), float3(1.0f, 1.0f, 0.0f) },
            { float3( 0.5f,  0.5f,  0.5f), float3(1.0f, 1.0f, 1.0f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem = cubeVertices.data();
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        constexpr std::array<uint16_t, 36> cubeIndices =
        {{
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        }};

        m_indexCount = cubeIndices.size();

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = cubeIndices.data();
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    });

    return finalLoadingTask;
}

Windows::Foundation::Numerics::float3 const& GetPosition ( ) const [inline]

Definition at line 35 of file SpinningCubeRenderer.h.

{ return m_position; }

Windows::Foundation::Numerics::float3 const& GetVelocity ( ) const [inline]

Definition at line 36 of file SpinningCubeRenderer.h.

{ return m_velocity; }

void ReleaseDeviceDependentResources ( ) [override, virtual]

Implements Resource.

Definition at line 293 of file SpinningCubeRenderer.cpp.

{
    m_usingVprtShaders = false;

    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
}

void Render ( )

Definition at line 70 of file SpinningCubeRenderer.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void SetTargetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline]

Definition at line 33 of file SpinningCubeRenderer.h.

{ m_targetPosition = pos; }

void Update ( const DX::StepTimer & timer )

Definition at line 29 of file SpinningCubeRenderer.cpp.

{
    float const deltaTime = static_cast<float>(timer.GetElapsedSeconds());
    float const lerpDeltaTime = deltaTime * c_lerpRate;

    float3 const prevPosition = m_position;
    m_position = lerp(m_position, m_targetPosition, lerpDeltaTime);

    m_velocity = (prevPosition - m_position) / deltaTime;

    // Rotate the cube.
    // Convert degrees to radians, then convert seconds to rotation angle.
    float const radiansPerSecond = XMConvertToRadians(m_degreesPerSecond);
    float const totalRotation    = static_cast<float>(timer.GetTotalSeconds()) * radiansPerSecond;

    // Scale the cube down to 10cm
    float4x4 const modelScale = make_float4x4_scale({ 0.1f });
    float4x4 const modelRotation = make_float4x4_rotation_y(totalRotation);
    float4x4 const modelTranslation = make_float4x4_translation(m_position);

    m_modelConstantBufferData.model = modelScale * modelRotation * modelTranslation;

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );
}

Member Data Documentation

const float c_lerpRate = 4.0f [private]

Definition at line 63 of file SpinningCubeRenderer.h.

float m_degreesPerSecond = 45.f [private]

Definition at line 53 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 44 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 42 of file SpinningCubeRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 50 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 40 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 46 of file SpinningCubeRenderer.h.

CubeModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 49 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 45 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 55 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_targetPosition = { 0.f, 0.f, -2.f } [private]

Definition at line 54 of file SpinningCubeRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 60 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_velocity = { 0.f, 0.f, 0.f } [private]

Definition at line 56 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 41 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 43 of file SpinningCubeRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.h
  • HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • TextRenderer
Public Member Functions | Private Attributes

TextRenderer Class Reference

#include "TextRenderer.h"

Inherits DX::Resource.

List of all members.

Public Member Functions

TextRenderer (std::shared_ptr< DX::DeviceResources > deviceResources, uint32_t textureWidth, uint32_t textureHeight)
concurrency::task< void > | CreateDeviceDependentResourcesAsync () override
ID3D11SamplerState * | GetSampler () const
ID3D11ShaderResourceView * | GetTexture () const
void | ReleaseDeviceDependentResources () override
void | RenderTextOffscreen (std::wstring const &str)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1RenderTarget > 		m_d2dRenderTarget
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_pointSampler
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_renderTargetView
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_shaderResourceView
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormat
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
const unsigned int | m_textureHeight
const unsigned int | m_textureWidth
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 18 of file TextRenderer.h.

Constructor & Destructor Documentation

TextRenderer | ( | std::shared_ptr< DX::DeviceResources > | deviceResources,
 |  | uint32_t | textureWidth,
 |  | uint32_t | textureHeight
 | ) |  |

Definition at line 19 of file TextRenderer.cpp.

    : DX::Resource(std::move(deviceResources)),
      m_textureWidth(textureWidth),
      m_textureHeight(textureHeight)
{
}

Member Function Documentation

concurrency::task< void > CreateDeviceDependentResourcesAsync ( ) [override, virtual]

Implements Resource.

Definition at line 83 of file TextRenderer.cpp.

{
    return concurrency::create_task([this]
    {
        // Create a default sampler state, which will use point sampling.
        CD3D11_SAMPLER_DESC desc(D3D11_DEFAULT);
        m_deviceResources->GetD3DDevice()->CreateSamplerState(&desc, &m_pointSampler);

        // Create the texture that will be used as the offscreen render target.
        CD3D11_TEXTURE2D_DESC textureDesc(
            DXGI_FORMAT_B8G8R8A8_UNORM,
            m_textureWidth,
            m_textureHeight,
            1,
            1,
            D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
        );
        m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);

        // Create read and write views for the offscreen render target.
        m_deviceResources->GetD3DDevice()->CreateShaderResourceView(m_texture.Get(), nullptr, &m_shaderResourceView);
        m_deviceResources->GetD3DDevice()->CreateRenderTargetView(m_texture.Get(), nullptr, &m_renderTargetView);

        // In this example, we are using D2D and DirectWrite; so, we need to create a D2D render target as well.
        D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(
            D2D1_RENDER_TARGET_TYPE_DEFAULT,
            D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED),
            96,
            96
        );

        // The DXGI surface is used to create the render target.
        Microsoft::WRL::ComPtr<IDXGISurface> dxgiSurface;
        DX::ThrowIfFailed(m_texture.As(&dxgiSurface));
        DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDxgiSurfaceRenderTarget(dxgiSurface.Get(), &props, &m_d2dRenderTarget));

        // Create a solid color brush that will be used to render the text.
        DX::ThrowIfFailed(m_d2dRenderTarget->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Cornsilk), &m_whiteBrush));

        // This is where we format the text that will be written on the render target.
        DX::ThrowIfFailed(
            m_deviceResources->GetDWriteFactory()->CreateTextFormat(
                L"Consolas",
                NULL,
                DWRITE_FONT_WEIGHT_NORMAL,
                DWRITE_FONT_STYLE_NORMAL,
                DWRITE_FONT_STRETCH_NORMAL,
                64.0f,
                L"",
                &m_textFormat
            )
        );
        DX::ThrowIfFailed(m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
        DX::ThrowIfFailed(m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER));
    });
}

ID3D11SamplerState* GetSampler ( ) const [inline]

Definition at line 32 of file TextRenderer.h.

{ return m_pointSampler.Get();         };

ID3D11ShaderResourceView* GetTexture ( ) const [inline]

Definition at line 31 of file TextRenderer.h.

{ return m_shaderResourceView.Get();   };

void ReleaseDeviceDependentResources ( ) [override, virtual]

Implements Resource.

Definition at line 72 of file TextRenderer.cpp.

{
    m_texture.Reset();
    m_shaderResourceView.Reset();
    m_pointSampler.Reset();
    m_renderTargetView.Reset();
    m_d2dRenderTarget.Reset();
    m_whiteBrush.Reset();
    m_textFormat.Reset();
}

void RenderTextOffscreen ( std::wstring const & str )

Definition at line 26 of file TextRenderer.cpp.

{
    // Clear the off-screen render target.
    m_deviceResources->GetD3DDeviceContext()->ClearRenderTargetView(m_renderTargetView.Get(), DirectX::Colors::Transparent);

    // Begin drawing with D2D.
    m_d2dRenderTarget->BeginDraw();

    // Create a text layout to match the screen.
    Microsoft::WRL::ComPtr<IDWriteTextLayout> textLayout;
    m_deviceResources->GetDWriteFactory()->CreateTextLayout(
        str.c_str(),
        static_cast<UINT32>(str.length()),
        m_textFormat.Get(),
        static_cast<float>(m_textureWidth),
        static_cast<float>(m_textureHeight),
        &textLayout
        );

    // Get the text metrics from the text layout.
    DWRITE_TEXT_METRICS metrics;
    DX::ThrowIfFailed(textLayout->GetMetrics(&metrics));

    // In this example, we position the text in the center of the off-screen render target.
    D2D1::Matrix3x2F screenTranslation = D2D1::Matrix3x2F::Translation(
        m_textureWidth * 0.5f,
        m_textureHeight * 0.5f + metrics.height * 0.5f
        );
    m_whiteBrush->SetTransform(screenTranslation);

    // Render the text using DirectWrite.
    m_d2dRenderTarget->DrawTextLayout(
        D2D1::Point2F(0.0f, 0.0f),
        textLayout.Get(),
        m_whiteBrush.Get()
        );

    // End drawing with D2D.
    HRESULT hr = m_d2dRenderTarget->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        // Catch errors from D2D.
        DX::ThrowIfFailed(hr);
    }
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1RenderTarget> m_d2dRenderTarget [private]

Definition at line 40 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_pointSampler [private]

Definition at line 38 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView [private]

Definition at line 39 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shaderResourceView [private]

Definition at line 37 of file TextRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormat [private]

Definition at line 42 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [private]

Definition at line 32 of file TextRenderer.h.

const unsigned int m_textureHeight [private]

Definition at line 46 of file TextRenderer.h.

const unsigned int m_textureWidth [private]

Definition at line 45 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 41 of file TextRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/TextRenderer.h
  • HolographicFaceTracking/cpp/Content/TextRenderer.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::float3 color
Windows::Foundation::Numerics::float3 pos

Detailed Description

Definition at line 25 of file ShaderStructures.h.

Member Data Documentation

Windows::Foundation::Numerics::float3 color

Definition at line 28 of file ShaderStructures.h.

Windows::Foundation::Numerics::float3 pos

Definition at line 27 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicFaceTracking/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionTex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • VertexPositionTex
Public Attributes

VertexPositionTex Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::float3 pos
Windows::Foundation::Numerics::float2 tex

Detailed Description

Definition at line 31 of file ShaderStructures.h.

Member Data Documentation

Windows::Foundation::Numerics::float3 pos

Definition at line 33 of file ShaderStructures.h.

Windows::Foundation::Numerics::float2 tex

Definition at line 34 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicFaceTracking/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoFrameProcessor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicFaceTracker
  • VideoFrameProcessor
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

VideoFrameProcessor Class Reference

#include "VideoFrameProcessor.h"

List of all members.

Public Member Functions

VideoFrameProcessor (Platform::Agile< Windows::Media::Capture::MediaCapture > mediaCapture, Windows::Media::Capture::Frames::MediaFrameReader^reader, Windows::Media::Capture::Frames::MediaFrameSource^source)
Windows::Media::Capture::Frames::VideoMediaFrameFormat | GetCurrentFormat (void) const
Windows::Media::Capture::Frames::MediaFrameReference | GetLatestFrame (void) const

Static Public Member Functions

static Concurrency::task
< std::shared_ptr
< VideoFrameProcessor > > 		CreateAsync (void)

Protected Member Functions

void | OnFrameArrived (Windows::Media::Capture::Frames::MediaFrameReader^sender, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args)

Protected Attributes

Windows::Media::Capture::Frames::MediaFrameReference | m_latestFrame
Platform::Agile
< Windows::Media::Capture::MediaCapture > 		m_mediaCapture
Windows::Media::Capture::Frames::MediaFrameReader | m_mediaFrameReader
Windows::Media::Capture::Frames::MediaFrameSource | m_mediaFrameSource
std::shared_mutex | m_propertiesLock

Detailed Description

Definition at line 17 of file VideoFrameProcessor.h.

Constructor & Destructor Documentation

VideoFrameProcessor | ( | Platform::Agile< Windows::Media::Capture::MediaCapture > | mediaCapture,
 |  | Windows::Media::Capture::Frames::MediaFrameReader^ | reader,
 |  | Windows::Media::Capture::Frames::MediaFrameSource^ | source
 | ) |  |

Member Function Documentation

task< std::shared_ptr< VideoFrameProcessor > > CreateAsync ( void ) [static]

Definition at line 40 of file VideoFrameProcessor.cpp.

{
    return create_task(MediaFrameSourceGroup::FindAllAsync())
        .then([](IVectorView<MediaFrameSourceGroup^>^ groups)
    {
        MediaFrameSourceGroup^ selectedGroup = nullptr;
        MediaFrameSourceInfo^ selectedSourceInfo = nullptr;

        // Pick first color source.
        for (MediaFrameSourceGroup^ sourceGroup : groups)
        {
            for (MediaFrameSourceInfo^ sourceInfo : sourceGroup->SourceInfos)
            {
                if (sourceInfo->SourceKind == MediaFrameSourceKind::Color)
                {
                    selectedSourceInfo = sourceInfo;
                    break;
                }
            }

            if (selectedSourceInfo != nullptr)
            {
                selectedGroup = sourceGroup;
                break;
            }
        }

        // No valid camera was found. This will happen on the emulator.
        if (selectedGroup == nullptr || selectedSourceInfo == nullptr)
        {
            return task_from_result(std::shared_ptr<VideoFrameProcessor>(nullptr));
        }

        MediaCaptureInitializationSettings^ settings = ref new MediaCaptureInitializationSettings();
        settings->MemoryPreference = MediaCaptureMemoryPreference::Cpu; // Need SoftwareBitmaps for FaceAnalysis
        settings->StreamingCaptureMode = StreamingCaptureMode::Video;   // Only need to stream video
        settings->SourceGroup = selectedGroup;

        Platform::Agile<MediaCapture> mediaCapture(ref new MediaCapture());

        return create_task(mediaCapture->InitializeAsync(settings))
            .then([=]
        {
            MediaFrameSource^ selectedSource = mediaCapture->FrameSources->Lookup(selectedSourceInfo->Id);

            return create_task(mediaCapture->CreateFrameReaderAsync(selectedSource))
                .then([=](MediaFrameReader^ reader)
            {
                return create_task(reader->StartAsync())
                    .then([=](MediaFrameReaderStartStatus status)
                {
                    // Only create a VideoFrameProcessor if the reader successfully started
                    if (status == MediaFrameReaderStartStatus::Success)
                    {
                        return std::make_shared<VideoFrameProcessor>(mediaCapture, reader, selectedSource);
                    }
                    else
                    {
                        return std::shared_ptr<VideoFrameProcessor>(nullptr);
                    }
                });
            });
        });
    });
}

Windows::Media::Capture::Frames::VideoMediaFrameFormat GetCurrentFormat ( void ) const

Definition at line 112 of file VideoFrameProcessor.cpp.

{
    return m_mediaFrameSource->CurrentFormat->VideoFormat;
}

Windows::Media::Capture::Frames::MediaFrameReference GetLatestFrame ( void ) const

Definition at line 106 of file VideoFrameProcessor.cpp.

{
    auto lock = std::shared_lock<std::shared_mutex>(m_propertiesLock);
    return m_latestFrame;
}

void OnFrameArrived | ( | Windows::Media::Capture::Frames::MediaFrameReader^ | sender,
 |  | Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^ | args |
 | ) |  |  | [protected]

Member Data Documentation

Windows::Media::Capture::Frames::MediaFrameReference m_latestFrame [protected]

Definition at line 40 of file VideoFrameProcessor.h.

Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCapture [protected]

Definition at line 35 of file VideoFrameProcessor.h.

Windows::Media::Capture::Frames::MediaFrameReader m_mediaFrameReader [protected]

Definition at line 36 of file VideoFrameProcessor.h.

Windows::Media::Capture::Frames::MediaFrameSource m_mediaFrameSource [protected]

Definition at line 39 of file VideoFrameProcessor.h.

std::shared_mutex m_propertiesLock [mutable, protected]

Definition at line 38 of file VideoFrameProcessor.h.

The documentation for this class was generated from the following files:
  • HolographicFaceTracking/cpp/Content/VideoFrameProcessor.h
  • HolographicFaceTracking/cpp/Content/VideoFrameProcessor.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Button Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • Button
Public Member Functions | Protected Member Functions | Private Attributes

Button Class Reference

#include "Button.h"

Inherits HolographicMRCSample::ControlBase.

List of all members.

Public Member Functions

Button (const Windows::Foundation::Numerics::float3 size, const Windows::Foundation::Numerics::float4 color, const Windows::Foundation::Numerics::float4 focusColor, const Windows::Foundation::Numerics::float4 turnedOnColor, const DX::TextureIndex textureId)
bool | GetSwitch ()
void | SetSwitch (const bool isOn)

Protected Member Functions

virtual void | DoCreateDeviceDependentResources ()
virtual void | DoReleaseDeviceDependentResources ()
virtual void | DoRender ()
virtual void | DoUpdate (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)

Private Attributes

Windows::Foundation::Numerics::float4 m_color
Windows::Foundation::Numerics::float4 m_colorFocus
Windows::Foundation::Numerics::float4 m_colorOn
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelColorConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerState
Windows::Foundation::Numerics::float3 m_size
DX::TextureIndex m_textureIndex
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_textureView
bool | m_turnedOn = false
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 8 of file Button.h.

Constructor & Destructor Documentation

Button | ( | const Windows::Foundation::Numerics::float3 | size,
 |  | const Windows::Foundation::Numerics::float4 | color,
 |  | const Windows::Foundation::Numerics::float4 | focusColor,
 |  | const Windows::Foundation::Numerics::float4 | turnedOnColor,
 |  | const DX::TextureIndex | textureId
 | ) |  |

Definition at line 11 of file Button.cpp.

                                               :
    m_size(size),
    m_color(color),
    m_colorFocus(focusColor),
    m_colorOn(turnedOnColor),
    m_textureIndex(textureId)
{
    m_type = Control_Button;
}

Member Function Documentation

void DoCreateDeviceDependentResources ( ) [protected, virtual]

Implements ControlBase.

Definition at line 208 of file Button.cpp.

{
    if (m_loadingComplete)
    {
        return;
    }

    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.

    m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Texture);
    m_inputLayout = m_deviceResources->GetInputLayout(DX::VertexShader_Texture);
    m_pixelShader = m_deviceResources->GetPixelShader(DX::PixelShader_Texture);

    D3D11_TEXTURE2D_DESC texDesc;
    D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
    ZeroMemory(&viewDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Load Pressed Button texture and create resource view
    Microsoft::WRL::ComPtr<ID3D11Resource> spResource;
    Microsoft::WRL::ComPtr<ID3D11Texture2D> spTexture;
    spResource = m_deviceResources->GetTexture(m_textureIndex);
    DX::ThrowIfFailed(spResource.As(&spTexture));

    spTexture->GetDesc(&texDesc);
    viewDesc.Format = texDesc.Format;
    viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
    viewDesc.Texture2D.MostDetailedMip = 0;
    viewDesc.Texture2D.MipLevels = 1;
    DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateShaderResourceView(spResource.Get(), &viewDesc, m_textureView.ReleaseAndGetAddressOf()));

    if (!m_usingVprtShaders)
    {
        // Get the pass-through geometry shader.
        m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Texture);
    }

    // After the pixel shader file is loaded, create the shader and constant buffer.
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelColorConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_modelConstantBuffer));

    // Once all shaders are loaded, create the mesh.
    {
        float halfWidth  = m_size.x * 0.5f;
        float halfHeight = m_size.y * 0.5f;
        float halfDepth  = m_size.z * 0.5f;
        XMFLOAT3 color(m_color.x, m_color.y, m_color.z);

        m_boundingBox = BoundingOrientedBox(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(halfWidth, halfHeight, halfDepth), XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f));

        // Load mesh vertices. Each vertex has a position and a color.
        const VertexPositionTexture cubeVertices[] =
        {
            { XMFLOAT3(-halfWidth, -halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 0
            { XMFLOAT3(-halfWidth, -halfHeight,  halfDepth), XMFLOAT2(0.0f, 1.0f) }, // 1
            { XMFLOAT3(-halfWidth,  halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 2
            { XMFLOAT3(-halfWidth,  halfHeight,  halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 3
            { XMFLOAT3( halfWidth, -halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 4
            { XMFLOAT3( halfWidth, -halfHeight,  halfDepth), XMFLOAT2(1.0f, 1.0f) }, // 5
            { XMFLOAT3( halfWidth,  halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 6
            { XMFLOAT3( halfWidth,  halfHeight,  halfDepth), XMFLOAT2(1.0f, 0.0f) }, // 7
        };

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem = cubeVertices;
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        static const unsigned short cubeIndices [] =
        {
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        };

        m_indexCount = ARRAYSIZE(cubeIndices);

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = cubeIndices;
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    }

    // Create the sample state
    D3D11_SAMPLER_DESC sampDesc;
    ZeroMemory(&sampDesc, sizeof(sampDesc));
    sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
    sampDesc.MaxLOD = D3D11_FLOAT32_MAX;
    sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;

    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateSamplerState(
            &sampDesc,
            m_samplerState.ReleaseAndGetAddressOf()));

    // Once the cube is loaded, the object is ready to be rendered.
    m_loadingComplete = true;
}

void DoReleaseDeviceDependentResources ( ) [protected, virtual]

Implements ControlBase.

Definition at line 357 of file Button.cpp.

{
    m_inputLayout.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
    m_vertexShader.Reset();
    m_geometryShader.Reset();
    m_pixelShader.Reset();
    m_modelConstantBuffer.Reset();
    m_samplerState.Reset();
    m_textureView.Reset();

    m_loadingComplete = false;
    m_usingVprtShaders = false;
}

void DoRender ( ) [protected, virtual]

Implements ControlBase.

Definition at line 121 of file Button.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );

    // Each vertex is one instance of the VertexPositionTexture struct.
    const UINT stride = sizeof(VertexPositionTexture);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Set Texture Resource view
    context->PSSetShaderResources(0, 1, m_textureView.GetAddressOf());

    // Set Sampler
    context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void DoUpdate | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource,
 |  | const DirectX::XMMATRIX & | parentTransform |
 | ) |  |  | [protected, virtual]

Implements ControlBase.

Definition at line 27 of file Button.cpp.

{
    // Rotate the cube.
    const XMMATRIX modelRotation    = XMMatrixRotationRollPitchYawFromVector(XMLoadFloat3(&m_rotation));

    // Position the cube.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // Multiply to get the transform matrix.
    // Note that this transform does not enforce a particular coordinate system. The calling
    // class is responsible for rendering this content in a consistent manner.
    const XMMATRIX modelTransform = modelRotation * modelTranslation * parentTransform;
    XMStoreFloat4x4(&m_transform, modelTransform);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

    auto pointerPose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, holographicFrame->CurrentPrediction->Timestamp);
    if (pointerPose != nullptr)
    {
        // Get the gaze direction relative to the given coordinate system.
        const float3 position = pointerPose->Head->Position;
        const float3 direction = pointerPose->Head->ForwardDirection;

        XMFLOAT3 headPosition = XMFLOAT3(position.x, position.y, position.z);
        XMFLOAT3 headDirection = XMFLOAT3(direction.x, direction.y, direction.z);
        float distance = 0.0f;

        BoundingOrientedBox currentBoundingBox;
        GetBoundingBox(currentBoundingBox);

        m_focused = currentBoundingBox.Intersects(XMLoadFloat3(&headPosition), XMLoadFloat3(&headDirection), distance);
    }

    if (m_enabled)
    {
        if (m_focused)
        {
            m_modelConstantBufferData.color.x = m_colorFocus.x;
            m_modelConstantBufferData.color.y = m_colorFocus.y;
            m_modelConstantBufferData.color.z = m_colorFocus.z;
            m_modelConstantBufferData.color.w = m_colorFocus.w;
        }
        else
        {
            if (m_turnedOn)
            {
                m_modelConstantBufferData.color.x = m_colorOn.x;
                m_modelConstantBufferData.color.y = m_colorOn.y;
                m_modelConstantBufferData.color.z = m_colorOn.z;
                m_modelConstantBufferData.color.w = m_colorOn.w;
            }
            else
            {
                m_modelConstantBufferData.color.x = m_color.x;
                m_modelConstantBufferData.color.y = m_color.y;
                m_modelConstantBufferData.color.z = m_color.z;
                m_modelConstantBufferData.color.w = m_color.w;
            }
        }
    }
    else
    {
        m_modelConstantBufferData.color.x = 0.5f;
        m_modelConstantBufferData.color.y = 0.5f;
        m_modelConstantBufferData.color.z = 0.5f;
        m_modelConstantBufferData.color.w = 1.0f;
    }

    if (interactionSource)
    {
        if (m_focused && m_enabled && interactionSource->IsPressed && m_onAirTapCallback != nullptr)
        {
            Concurrency::task<void> callbackTask = Concurrency::create_task([this]()
            {
                m_onAirTapCallback();
            });
        }
    }
}

bool GetSwitch ( ) [inline]

Definition at line 18 of file Button.h.

{ return m_turnedOn; }

void SetSwitch ( const bool isOn ) [inline]

Definition at line 17 of file Button.h.

{ m_turnedOn = isOn; }

Member Data Documentation

Windows::Foundation::Numerics::float4 m_color [private]

Definition at line 49 of file Button.h.

Windows::Foundation::Numerics::float4 m_colorFocus [private]

Definition at line 50 of file Button.h.

Windows::Foundation::Numerics::float4 m_colorOn [private]

Definition at line 51 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 38 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 36 of file Button.h.

uint32 m_indexCount = 0 [private]

Definition at line 46 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 34 of file Button.h.

bool m_loadingComplete = false [private]

Definition at line 57 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 40 of file Button.h.

ModelColorConstantBuffer m_modelConstantBufferData [private]

Definition at line 45 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 39 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState [private]

Definition at line 41 of file Button.h.

Windows::Foundation::Numerics::float3 m_size [private]

Definition at line 48 of file Button.h.

DX::TextureIndex m_textureIndex [private]

Definition at line 52 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureView [private]

Definition at line 42 of file Button.h.

bool m_turnedOn = false [private]

Definition at line 54 of file Button.h.

bool m_usingVprtShaders = false [private]

Definition at line 61 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 35 of file Button.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 37 of file Button.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/Button.h
  • HolographicMixedRealityCapture/cpp/Content/Button.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ControlBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • ControlBase
Public Member Functions | Protected Member Functions | Protected Attributes

ControlBase Class Reference

#include "ControlBase.h"

Inherits HolographicMRCSample::IControl.

Inherited by Button, and Panel.

List of all members.

Public Member Functions

ControlBase ()
virtual | ~ControlBase ()
virtual void | AddChild (const std::shared_ptr< IControl > &object)
virtual void | CreateDeviceDependentResources ()
virtual void | GetBoundingBox (DirectX::BoundingOrientedBox &boundingBox)
virtual
Windows::Foundation::Numerics::float3 		GetPosition ()
virtual
Windows::Foundation::Numerics::float3 		GetRotation ()
virtual
Windows::Foundation::Numerics::float3 		GetScale ()
virtual void | Initialize (const std::shared_ptr< DX::DeviceResources > &deviceResources)
virtual bool | IsEnabled ()
virtual bool | IsFocused ()
virtual void | ReleaseDeviceDependentResources ()
virtual void | Render ()
virtual void | SetEnabled (const bool enabled)
virtual void | SetOnAirTapCallback (std::function< void()> callback)
virtual void | SetPosition (Windows::Foundation::Numerics::float3 pos)
virtual void | SetRotation (Windows::Foundation::Numerics::float3 rot)
virtual void | SetScale (Windows::Foundation::Numerics::float3 scale)
virtual ControlType | Type ()
virtual void | Update (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource)
virtual void | Update (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)

Protected Member Functions

virtual void | DoCreateDeviceDependentResources ()=0
virtual void | DoReleaseDeviceDependentResources ()=0
virtual void | DoRender ()=0
virtual void | DoUpdate (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)=0

Protected Attributes

DirectX::BoundingOrientedBox | m_boundingBox
std::vector< std::shared_ptr
< IControl > > 		m_children
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_enabled = true
bool | m_focused = false
std::function< void()> | m_onAirTapCallback
Windows::Foundation::Numerics::float3 | m_position = { 0.0f, 0.0f, 0.0f }
Windows::Foundation::Numerics::float3 | m_rotation = { 0.0f, 0.0f, 0.0f }
Windows::Foundation::Numerics::float3 | m_scale = { 1.0f, 1.0f, 1.0f }
DirectX::XMFLOAT4X4 | m_transform
ControlType | m_type = Control_Unknown

Detailed Description

Definition at line 15 of file ControlBase.h.

Constructor & Destructor Documentation

ControlBase ( )

Definition at line 12 of file ControlBase.cpp.

{
}

~ControlBase ( ) [virtual]

Definition at line 23 of file ControlBase.cpp.

{
    m_children.clear();
}

Member Function Documentation

virtual void AddChild ( const std::shared_ptr< IControl > & object ) [inline, virtual]

Implements IControl.

Definition at line 38 of file ControlBase.h.

{ m_children.push_back(object); }

void CreateDeviceDependentResources ( ) [virtual]

Implements IControl.

Definition at line 28 of file ControlBase.cpp.

{
    DoCreateDeviceDependentResources();

    for (auto it = m_children.begin(); it != m_children.end(); it++)
    {
        it->get()->CreateDeviceDependentResources();
    }
}

virtual void DoCreateDeviceDependentResources ( ) [protected, pure virtual]

Implemented in Button, and Panel.

virtual void DoReleaseDeviceDependentResources ( ) [protected, pure virtual]

Implemented in Button, and Panel.

virtual void DoRender ( ) [protected, pure virtual]

Implemented in Button, and Panel.

virtual void DoUpdate | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource,
 |  | const DirectX::XMMATRIX & | parentTransform |
 | ) |  |  | [protected, pure virtual]

Implemented in Button, and Panel.

virtual void GetBoundingBox ( DirectX::BoundingOrientedBox & boundingBox ) [inline, virtual]

Implements IControl.

Definition at line 54 of file ControlBase.h.

        {
            m_boundingBox.Transform(boundingBox, DirectX::XMLoadFloat4x4(&m_transform));
        }

virtual Windows::Foundation::Numerics::float3 GetPosition ( ) [inline, virtual]

Implements IControl.

Definition at line 44 of file ControlBase.h.

{ return m_position; }

virtual Windows::Foundation::Numerics::float3 GetRotation ( ) [inline, virtual]

Implements IControl.

Definition at line 45 of file ControlBase.h.

{ return m_rotation; }

virtual Windows::Foundation::Numerics::float3 GetScale ( ) [inline, virtual]

Implements IControl.

Definition at line 46 of file ControlBase.h.

{ return m_scale; }

void Initialize ( const std::shared_ptr< DX::DeviceResources > & deviceResources ) [virtual]

Implements IControl.

Definition at line 16 of file ControlBase.cpp.

{
    m_deviceResources = deviceResources;

    CreateDeviceDependentResources();
}

virtual bool IsEnabled ( ) [inline, virtual]

Implements IControl.

Definition at line 50 of file ControlBase.h.

{ return m_enabled; }

virtual bool IsFocused ( ) [inline, virtual]

Implements IControl.

Definition at line 49 of file ControlBase.h.

{ return m_focused; }

void ReleaseDeviceDependentResources ( ) [virtual]

Implements IControl.

Definition at line 38 of file ControlBase.cpp.

{
    DoReleaseDeviceDependentResources();

    for (auto it = m_children.begin(); it != m_children.end(); it++)
    {
        it->get()->ReleaseDeviceDependentResources();
    }
}

void Render ( ) [virtual]

Implements IControl.

Definition at line 72 of file ControlBase.cpp.

{
    DoRender();

    for (auto it = m_children.begin(); it != m_children.end(); it++)
    {
        it->get()->Render();
    }
}

virtual void SetEnabled ( const bool enabled ) [inline, virtual]

Implements IControl.

Definition at line 52 of file ControlBase.h.

{ m_enabled = enabled; }

virtual void SetOnAirTapCallback ( std::function< void()> callback ) [inline, virtual]

Implements IControl.

Definition at line 59 of file ControlBase.h.

        {
            m_onAirTapCallback = callback;
        }

virtual void SetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline, virtual]

Implements IControl.

Definition at line 40 of file ControlBase.h.

{ m_position = pos; }

virtual void SetRotation ( Windows::Foundation::Numerics::float3 rot ) [inline, virtual]

Implements IControl.

Definition at line 41 of file ControlBase.h.

{ m_rotation = rot; }

virtual void SetScale ( Windows::Foundation::Numerics::float3 scale ) [inline, virtual]

Implements IControl.

Definition at line 42 of file ControlBase.h.

{ m_scale = scale; }

virtual ControlType Type ( ) [inline, virtual]

Implements IControl.

Definition at line 48 of file ControlBase.h.

{ return m_type; }

void Update | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource,
 |  | const DirectX::XMMATRIX & | parentTransform |
 | ) |  |  | [virtual]

Definition at line 57 of file ControlBase.cpp.

{
    DoUpdate(timer, holographicFrame, currentCoordinateSystem, interactionSource, parentTransform);

    for (auto it = m_children.begin(); it != m_children.end(); it++)
    {
        it->get()->Update(timer, holographicFrame, currentCoordinateSystem, interactionSource, DirectX::XMLoadFloat4x4(&m_transform));
    }
}

void Update | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource |
 | ) |  |  | [virtual]

Definition at line 48 of file ControlBase.cpp.

{
    Update(timer, holographicFrame, currentCoordinateSystem, interactionSource, DirectX::XMMatrixIdentity());
}

Member Data Documentation

DirectX::BoundingOrientedBox m_boundingBox [protected]

Definition at line 94 of file ControlBase.h.

std::vector<std::shared_ptr<IControl> > m_children [protected]

Definition at line 92 of file ControlBase.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [protected]

Definition at line 78 of file ControlBase.h.

bool m_enabled = true [protected]

Definition at line 85 of file ControlBase.h.

bool m_focused = false [protected]

Definition at line 86 of file ControlBase.h.

std::function<void()> m_onAirTapCallback [protected]

Definition at line 88 of file ControlBase.h.

Windows::Foundation::Numerics::float3 m_position = { 0.0f, 0.0f, 0.0f } [protected]

Definition at line 80 of file ControlBase.h.

Windows::Foundation::Numerics::float3 m_rotation = { 0.0f, 0.0f, 0.0f } [protected]

Definition at line 81 of file ControlBase.h.

Windows::Foundation::Numerics::float3 m_scale = { 1.0f, 1.0f, 1.0f } [protected]

Definition at line 82 of file ControlBase.h.

DirectX::XMFLOAT4X4 m_transform [protected]

Definition at line 90 of file ControlBase.h.

ControlType m_type = Control_Unknown [protected]

Definition at line 84 of file ControlBase.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/ControlBase.h
  • HolographicMixedRealityCapture/cpp/Content/ControlBase.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Cursor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • Cursor
Public Member Functions | Private Member Functions | Private Attributes

Cursor Class Reference

#include "Cursor.h"

List of all members.

Public Member Functions

Cursor (const float width, const float height)
void | CreateDeviceDependentResources ()
void | Initialize (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SetDistance (const float distance)
void | Update (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource)

Private Member Functions

void | PositionCursor (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, DirectX::XMMATRIX &modelTransform)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_cursorTextureView
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
float | m_distance = 2.0f
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelColorConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_samplerState
Windows::Foundation::Numerics::float2 m_size
DX::TextureIndex m_textureIndex
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 7 of file Cursor.h.

Constructor & Destructor Documentation

Cursor | ( | const float | width,
 |  | const float | height
 | ) |  |

Definition at line 12 of file Cursor.cpp.

                                                    :
    m_size(float2(width, height)),
    m_textureIndex(DX::Texture_Cursor)
{
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 142 of file Cursor.cpp.

{
    if (m_loadingComplete)
    {
        return;
    }

    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.

    m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Texture);
    m_inputLayout = m_deviceResources->GetInputLayout(DX::VertexShader_Texture);
    m_pixelShader = m_deviceResources->GetPixelShader(DX::PixelShader_Cursor);

    D3D11_TEXTURE2D_DESC texDesc;
    D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
    ZeroMemory(&viewDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Load Pressed Button texture and create resource view
    Microsoft::WRL::ComPtr<ID3D11Resource> spResource;
    Microsoft::WRL::ComPtr<ID3D11Texture2D> spTexture;
    spResource = m_deviceResources->GetTexture(DX::Texture_Cursor);
    DX::ThrowIfFailed(spResource.As(&spTexture));

    spTexture->GetDesc(&texDesc);
    viewDesc.Format = texDesc.Format;
    viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
    viewDesc.Texture2D.MostDetailedMip = 0;
    viewDesc.Texture2D.MipLevels = 1;
    DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateShaderResourceView(spResource.Get(), &viewDesc, m_cursorTextureView.ReleaseAndGetAddressOf()));

    if (!m_usingVprtShaders)
    {
        // Get the pass-through geometry shader.
        m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Texture);
    }

    // After the pixel shader file is loaded, create the shader and constant buffer.
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelColorConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_modelConstantBuffer));

    // Once all shaders are loaded, create the mesh.
    {
        float halfWidth  = m_size.x * 0.5f;
        float halfHeight = m_size.y * 0.5f;

        // Load mesh vertices. Each vertex has a position and a texture UV.
        const VertexPositionTexture cubeVertices[] =
        {
            { XMFLOAT3(-halfWidth, -halfHeight,  0.0f), XMFLOAT2(0.0f, 1.0f) }, // 0 (1)
            { XMFLOAT3(-halfWidth,  halfHeight,  0.0f), XMFLOAT2(0.0f, 0.0f) }, // 1 (3)
            { XMFLOAT3( halfWidth, -halfHeight,  0.0f), XMFLOAT2(1.0f, 1.0f) }, // 2 (5)
            { XMFLOAT3( halfWidth,  halfHeight,  0.0f), XMFLOAT2(1.0f, 0.0f) }, // 3 (7)
        };

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem = cubeVertices;
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        static const unsigned short cubeIndices [] =
        {
            0,1,3,
            0,3,2,
        };

        m_indexCount = ARRAYSIZE(cubeIndices);

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = cubeIndices;
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    }

    // Create the sample state
    D3D11_SAMPLER_DESC sampDesc;
    ZeroMemory(&sampDesc, sizeof(sampDesc));
    sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
    sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
    sampDesc.MaxLOD = D3D11_FLOAT32_MAX;
    sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;

    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateSamplerState(
            &sampDesc,
            m_samplerState.ReleaseAndGetAddressOf()));

    // Once the cube is loaded, the object is ready to be rendered.
    m_loadingComplete = true;
}

void Initialize ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 18 of file Cursor.cpp.

{
    m_deviceResources = deviceResources;

    CreateDeviceDependentResources();
}

void PositionCursor | ( | Windows::UI::Input::Spatial::SpatialPointerPose^ | pointerPose,
 |  | DirectX::XMMATRIX & | modelTransform |
 | ) |  |  | [private]
void ReleaseDeviceDependentResources ( )

Definition at line 268 of file Cursor.cpp.

{
    m_inputLayout.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
    m_vertexShader.Reset();
    m_geometryShader.Reset();
    m_pixelShader.Reset();
    m_modelConstantBuffer.Reset();
    m_samplerState.Reset();
    m_cursorTextureView.Reset();

    m_loadingComplete = false;
    m_usingVprtShaders = false;
}

void Render ( )

Definition at line 55 of file Cursor.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );

    // Each vertex is one instance of the VertexPositionTexture struct.
    const UINT stride = sizeof(VertexPositionTexture);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Set Texture Resource view
    context->PSSetShaderResources(0, 1, m_cursorTextureView.GetAddressOf());

    // Set Sampler
    context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void SetDistance ( const float distance ) [inline]

Definition at line 16 of file Cursor.h.

{ m_distance = distance; }

void Update | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource
 | ) |  |

Definition at line 27 of file Cursor.cpp.

{
    XMMATRIX modelTransform;

    PositionCursor(SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem,
                                                         holographicFrame->CurrentPrediction->Timestamp),
                   modelTransform);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
    m_modelConstantBufferData.color.x = 0.0f;
    m_modelConstantBufferData.color.y = 0.0f;
    m_modelConstantBufferData.color.z = 0.0f;
    m_modelConstantBufferData.color.w = 0.0f;
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_cursorTextureView [private]

Definition at line 41 of file Cursor.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 31 of file Cursor.h.

float m_distance = 2.0f [private]

Definition at line 48 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 37 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 35 of file Cursor.h.

uint32 m_indexCount = 0 [private]

Definition at line 44 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 33 of file Cursor.h.

bool m_loadingComplete = false [private]

Definition at line 51 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 39 of file Cursor.h.

ModelColorConstantBuffer m_modelConstantBufferData [private]

Definition at line 43 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 38 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState [private]

Definition at line 40 of file Cursor.h.

Windows::Foundation::Numerics::float2 m_size [private]

Definition at line 46 of file Cursor.h.

DX::TextureIndex m_textureIndex [private]

Definition at line 47 of file Cursor.h.

bool m_usingVprtShaders = false [private]

Definition at line 55 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 34 of file Cursor.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 36 of file Cursor.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/Cursor.h
  • HolographicMixedRealityCapture/cpp/Content/Cursor.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMRCSampleMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • HolographicMRCSampleMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicMRCSampleMain Class Reference

#include "HolographicMRCSampleMain.h"

List of all members.

Public Member Functions

HolographicMRCSampleMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicMRCSampleMain ()
void | LoadAppState ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | DisableAllButtons ()
void | OnButtonHologramTapped ()
void | OnButtonInitTapped ()
void | OnButtonPhotoTapped ()
void | OnButtonSysAudioTapped ()
void | OnButtonVideoTapped ()
void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
std::unique_ptr
< MediaCaptureManager > 		m_mediaCapture
bool | m_recording
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_referenceFrame
DX::StepTimer m_timer

Detailed Description

Definition at line 29 of file HolographicMRCSampleMain.h.

Constructor & Destructor Documentation

HolographicMRCSampleMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 21 of file HolographicMRCSampleMain.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_recording(false)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~HolographicMRCSampleMain ( )

Definition at line 201 of file HolographicMRCSampleMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

void DisableAllButtons ( ) [private]

Definition at line 617 of file HolographicMRCSampleMain.cpp.

{
    m_initButton->SetEnabled(false);
    m_photoButton->SetEnabled(false);
    m_videoButton->SetEnabled(false);
    m_hologramButton->SetEnabled(false);
    m_sysAudioButton->SetEnabled(false);
}

void LoadAppState ( )

Definition at line 403 of file HolographicMRCSampleMain.cpp.

{
}

void OnButtonHologramTapped ( ) [private]

Definition at line 601 of file HolographicMRCSampleMain.cpp.

{
    // Toggle button switch state
    m_hologramButton->SetSwitch(!m_hologramButton->GetSwitch());

    m_mediaCapture->SetHologramEnabled(m_hologramButton->GetSwitch());
}

void OnButtonInitTapped ( ) [private]

Definition at line 512 of file HolographicMRCSampleMain.cpp.

{
    DisableAllButtons();

    try
    {
        Concurrency::create_task(m_mediaCapture->InitializeAsync()).then([this]()
        {
            m_photoButton->SetEnabled(m_mediaCapture->CanTakePhoto());
            m_videoButton->SetEnabled(m_mediaCapture->CanToggleVideo());
            m_hologramButton->SetEnabled(true);
            m_sysAudioButton->SetEnabled(true);
        });
    }
    catch (Platform::Exception ^e)
    {
        OutputDebugString(e->Message->Data());
    }
}

void OnButtonPhotoTapped ( ) [private]

Definition at line 580 of file HolographicMRCSampleMain.cpp.

{
    DisableAllButtons();

    try
    {
        m_mediaCapture->TakePhotoAsync().then([this]()
        {
            m_initButton->SetEnabled(false);
            m_photoButton->SetEnabled(m_mediaCapture->CanTakePhoto());
            m_videoButton->SetEnabled(m_mediaCapture->CanToggleVideo());
            m_hologramButton->SetEnabled(true);
            m_sysAudioButton->SetEnabled(true);
        });
    }
    catch (Platform::Exception ^e)
    {
        OutputDebugString(e->Message->Data());
    }
}

void OnButtonSysAudioTapped ( ) [private]

Definition at line 609 of file HolographicMRCSampleMain.cpp.

{
    // Toggle button switch state
    m_sysAudioButton->SetSwitch(!m_sysAudioButton->GetSwitch());

    m_mediaCapture->SetSystemAudioEnabled(m_sysAudioButton->GetSwitch());
}

void OnButtonVideoTapped ( ) [private]

Definition at line 532 of file HolographicMRCSampleMain.cpp.

{
    DisableAllButtons();

    if (m_recording)
    {
        try
        {
            // Stop Recording
            m_mediaCapture->StopRecordingAsync().then([this]()
            {
                m_recording = false;

                m_initButton->SetEnabled(false);
                m_photoButton->SetEnabled(m_mediaCapture->CanTakePhoto());
                m_videoButton->SetEnabled(m_mediaCapture->CanToggleVideo());
                m_hologramButton->SetEnabled(true);
                m_sysAudioButton->SetEnabled(true);
            });
        }
        catch (Platform::Exception ^e)
        {
            OutputDebugString(e->Message->Data());
        }
    }
    else
    {
        try
        {
            // Start Recording
            m_mediaCapture->StartRecordingAsync().then([this]()
            {
                m_recording = true;

                m_initButton->SetEnabled(false);
                m_photoButton->SetEnabled(m_mediaCapture->CanTakePhoto());
                m_videoButton->SetEnabled(m_mediaCapture->CanToggleVideo());
                m_hologramButton->SetEnabled(false);
                m_sysAudioButton->SetEnabled(false);
            });
        }
        catch (Platform::Exception ^e)
        {
            OutputDebugString(e->Message->Data());
        }
    }
}

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 409 of file HolographicMRCSampleMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_cube1->ReleaseDeviceDependentResources();
    m_cube2->ReleaseDeviceDependentResources();
    m_cube3->ReleaseDeviceDependentResources();
    m_cube4->ReleaseDeviceDependentResources();

    m_cursor->ReleaseDeviceDependentResources();
    m_mainPanel->ReleaseDeviceDependentResources();
#endif
}

void OnDeviceRestored ( ) [virtual]

Definition at line 424 of file HolographicMRCSampleMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_cube1->CreateDeviceDependentResources();
    m_cube2->CreateDeviceDependentResources();
    m_cube3->CreateDeviceDependentResources();
    m_cube4->CreateDeviceDependentResources();

    m_cursor->CreateDeviceDependentResources();
    m_mainPanel->CreateDeviceDependentResources();
#endif
}

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 326 of file HolographicMRCSampleMain.cpp.

{
    // Don't try to render anything before the first Update.
    if (m_timer.GetFrameCount() == 0)
    {
        return false;
    }

    //
    // Take care of any tasks that are not specific to an individual holographic
    // camera. This includes anything that doesn't need the final view or projection
    // matrix, such as lighting maps.
    //

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();
            const auto blendState = pCameraResources->GetBlendState();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Set blend state
            context->OMSetBlendState(blendState, NULL, 0xffffffff);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->CoordinateSystem);

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

#ifdef DRAW_SAMPLE_CONTENT
            // Only render world-locked content when positional tracking is active.
            if (cameraActive)
            {
                m_cube1->Render();
                m_cube2->Render();
                m_cube3->Render();
                m_cube4->Render();
                m_mainPanel->Render();
                m_cursor->Render();
            }
#endif
            atLeastOneCameraRendered = true;
        }

        return atLeastOneCameraRendered;
    });
}

void SaveAppState ( )

Definition at line 399 of file HolographicMRCSampleMain.cpp.

{
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 176 of file HolographicMRCSampleMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }
}

HolographicFrame Update ( )

Definition at line 210 of file HolographicMRCSampleMain.cpp.

{
    if (m_holographicSpace)
    {
        // Before doing the timer update, there is some work to do per-frame
        // to maintain holographic rendering. First, we will get information
        // about the current frame.

        // The HolographicFrame has information that the app needs in order
        // to update and render the current frame. The app begins each new
        // frame by calling CreateNextFrame.
        HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

        // Get a prediction of where holographic cameras will be when this frame
        // is presented.
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        // Back buffers can change from frame to frame. Validate each buffer, and recreate
        // resource views and depth buffers as needed.
        m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

        // Next, we get a coordinate system from the attached frame of reference that is
        // associated with the current frame. Later, this coordinate system is used for
        // for creating the stereo view matrices when rendering the sample content.
        SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->CoordinateSystem;

#ifdef DRAW_SAMPLE_CONTENT
        // Check for new input state since the last frame.
        SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
#endif

        m_timer.Tick([&]()
        {
            //
            // Update scene objects.
            //
            // Put time-based updates here. By default this code will run once per frame,
            // but if you change the StepTimer to use a fixed time step this code will
            // run as many times as needed to get to the current step.
            //

#ifdef DRAW_SAMPLE_CONTENT
            m_cube1->Update(m_timer);
            m_cube2->Update(m_timer);
            m_cube3->Update(m_timer);
            m_cube4->Update(m_timer);
            m_mainPanel->Update(m_timer, holographicFrame, currentCoordinateSystem, pointerState);

            DirectX::BoundingOrientedBox panelBoundingBox;
            m_mainPanel->GetBoundingBox(panelBoundingBox);

            auto pointerPose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);
            if (pointerPose != nullptr)
            {
                // Get the gaze direction relative to the given coordinate system.
                const float3 position = pointerPose->Head->Position;
                const float3 direction = pointerPose->Head->ForwardDirection;

                DirectX::XMFLOAT3 headPosition = DirectX::XMFLOAT3(position.x, position.y, position.z);
                DirectX::XMFLOAT3 headDirection = DirectX::XMFLOAT3(direction.x, direction.y, direction.z);
                float distance = 0.0f;

                if (panelBoundingBox.Intersects(XMLoadFloat3(&headPosition), XMLoadFloat3(&headDirection), distance))
                {
                    m_cursor->SetDistance(distance - 0.05f);
                }
                else
                {
                    m_cursor->SetDistance(2.0f);
                }
            }
            else
            {
                m_cursor->SetDistance(2.0f);
            }

            m_cursor->Update(m_timer, holographicFrame, currentCoordinateSystem, nullptr);
#endif
        });

        // We complete the frame update by using information about our content positioning
        // to set the focus point.

        for (auto cameraPose : prediction->CameraPoses)
        {
#ifdef DRAW_SAMPLE_CONTENT
            // The HolographicCameraRenderingParameters class provides access to set
            // the image stabilization parameters.
            HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

            // SetFocusPoint informs the system about a specific point in your scene to
            // prioritize for image stabilization. The focus point is set independently
            // for each holographic camera.
            // You should set the focus point near the content that the user is looking at.
            // In this example, we put the focus point at the center of the sample hologram,
            // since that is the only hologram available for the user to focus on.
            // You can also set the relative velocity and facing of that content; the sample
            // hologram is at a fixed point so we only need to indicate its position.
            renderingParameters->SetFocusPoint(
                currentCoordinateSystem,
                m_mainPanel->GetPosition()
            );
#endif
        }

        // The holographic frame will be used to get up-to-date view and projection matrices and
        // to present the swap chain.
        return holographicFrame;
    }

    return nullptr;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 120 of file HolographicMRCSampleMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 121 of file HolographicMRCSampleMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 105 of file HolographicMRCSampleMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 111 of file HolographicMRCSampleMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 122 of file HolographicMRCSampleMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 114 of file HolographicMRCSampleMain.h.

std::unique_ptr<MediaCaptureManager> m_mediaCapture [private]

Definition at line 125 of file HolographicMRCSampleMain.h.

bool m_recording [private]

Definition at line 126 of file HolographicMRCSampleMain.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_referenceFrame [private]

Definition at line 117 of file HolographicMRCSampleMain.h.

DX::StepTimer m_timer [private]

Definition at line 108 of file HolographicMRCSampleMain.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.h
  • HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • IControl
Public Member Functions

IControl Class Reference

#include "IControl.h"

Inherited by ControlBase.

List of all members.

Public Member Functions

virtual void | AddChild (const std::shared_ptr< IControl > &object)=0
virtual void | CreateDeviceDependentResources ()=0
virtual void | GetBoundingBox (DirectX::BoundingOrientedBox &boundingBox)=0
virtual
Windows::Foundation::Numerics::float3 		GetPosition ()=0
virtual
Windows::Foundation::Numerics::float3 		GetRotation ()=0
virtual
Windows::Foundation::Numerics::float3 		GetScale ()=0
virtual void | Initialize (const std::shared_ptr< DX::DeviceResources > &deviceResources)=0
virtual bool | IsEnabled ()=0
virtual bool | IsFocused ()=0
virtual void | ReleaseDeviceDependentResources ()=0
virtual void | Render ()=0
virtual void | SetEnabled (const bool enabled)=0
virtual void | SetOnAirTapCallback (std::function< void()> callback)=0
virtual void | SetPosition (Windows::Foundation::Numerics::float3 pos)=0
virtual void | SetRotation (Windows::Foundation::Numerics::float3 rot)=0
virtual void | SetScale (Windows::Foundation::Numerics::float3 scale)=0
virtual ControlType | Type ()=0
virtual void | Update (const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)=0
virtual void | Update (const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource)=0

Detailed Description

Definition at line 18 of file IControl.h.

Member Function Documentation

virtual void AddChild ( const std::shared_ptr< IControl > & object ) [pure virtual]

Implemented in ControlBase.

virtual void CreateDeviceDependentResources ( ) [pure virtual]

Implemented in ControlBase.

virtual void GetBoundingBox ( DirectX::BoundingOrientedBox & boundingBox ) [pure virtual]

Implemented in ControlBase.

virtual Windows::Foundation::Numerics::float3 GetPosition ( ) [pure virtual]

Implemented in ControlBase.

virtual Windows::Foundation::Numerics::float3 GetRotation ( ) [pure virtual]

Implemented in ControlBase.

virtual Windows::Foundation::Numerics::float3 GetScale ( ) [pure virtual]

Implemented in ControlBase.

virtual void Initialize ( const std::shared_ptr< DX::DeviceResources > & deviceResources ) [pure virtual]

Implemented in ControlBase.

virtual bool IsEnabled ( ) [pure virtual]

Implemented in ControlBase.

virtual bool IsFocused ( ) [pure virtual]

Implemented in ControlBase.

virtual void ReleaseDeviceDependentResources ( ) [pure virtual]

Implemented in ControlBase.

virtual void Render ( ) [pure virtual]

Implemented in ControlBase.

virtual void SetEnabled ( const bool enabled ) [pure virtual]

Implemented in ControlBase.

virtual void SetOnAirTapCallback ( std::function< void()> callback ) [pure virtual]

Implemented in ControlBase.

virtual void SetPosition ( Windows::Foundation::Numerics::float3 pos ) [pure virtual]

Implemented in ControlBase.

virtual void SetRotation ( Windows::Foundation::Numerics::float3 rot ) [pure virtual]

Implemented in ControlBase.

virtual void SetScale ( Windows::Foundation::Numerics::float3 scale ) [pure virtual]

Implemented in ControlBase.

virtual ControlType Type ( ) [pure virtual]

Implemented in ControlBase.

virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::Graphics::Holographic::HolographicFrame^ | holographicFrame,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceState^ | interactionSource,
 |  | const DirectX::XMMATRIX & | parentTransform |
 | ) |  |  | [pure virtual]
virtual void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::Graphics::Holographic::HolographicFrame^ | holographicFrame,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceState^ | interactionSource |
 | ) |  |  | [pure virtual]
The documentation for this class was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/IControl.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaCaptureManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • MediaCaptureManager
Public Member Functions | Private Types | Private Attributes

MediaCaptureManager Class Reference

#include "MediaCaptureManager.h"

List of all members.

Public Member Functions

MediaCaptureManager ()
virtual | ~MediaCaptureManager ()
bool | CanTakePhoto ()
bool | CanToggleVideo ()
Concurrency::task< void > | InitializeAsync (IMFDXGIDeviceManager *pDxgiDeviceManager=nullptr)
bool | IsHologramEnabled ()
bool | IsSystemAudioEnabled ()
void | SetHologramEnabled (const bool enabled)
void | SetSystemAudioEnabled (const bool enabled)
Concurrency::task< void > | StartRecordingAsync ()
Concurrency::task< void > | StopRecordingAsync ()
Concurrency::task< void > | TakePhotoAsync ()

Private Types

enum State {
Unknown = 0, Initialized, StartingRecord, Recording,
StoppingRecord, TakingPhoto
}

Private Attributes

bool | m_audioEffectAdded
State m_currentState
bool | m_hologramEnabled
Microsoft::WRL::Wrappers::SRWLock | m_lock
Platform::Agile
< Windows::Media::Capture::MediaCapture > 		m_mediaCapture
bool | m_photoEffectAdded
Microsoft::WRL::ComPtr
< IMFDXGIDeviceManager > 		m_spMFDXGIDeviceManager
bool | m_sysAudioEnabled
bool | m_videoEffectAdded

Detailed Description

Definition at line 8 of file MediaCaptureManager.h.

Member Enumeration Documentation

enum State [private]
Enumerator:
Unknown
Initialized
StartingRecord
Recording
StoppingRecord
TakingPhoto

Definition at line 11 of file MediaCaptureManager.h.

        {
            Unknown = 0,
            Initialized,
            StartingRecord,
            Recording,
            StoppingRecord,
            TakingPhoto
        } State;

Constructor & Destructor Documentation

MediaCaptureManager ( )

Definition at line 12 of file MediaCaptureManager.cpp.

                                         :
    m_currentState(Unknown),
    m_hologramEnabled(false),
    m_sysAudioEnabled(false),
    m_videoEffectAdded(false),
    m_photoEffectAdded(false),
    m_audioEffectAdded(false)
{
}

~MediaCaptureManager ( ) [virtual]

Definition at line 22 of file MediaCaptureManager.cpp.

{
}

Member Function Documentation

bool CanTakePhoto ( )

Definition at line 318 of file MediaCaptureManager.cpp.

{
    auto lock = m_lock.LockShared();
    bool ret = false;

    if (m_currentState == Initialized)
    {
        ret = true;
    }

    return ret;
}

bool CanToggleVideo ( )

Definition at line 331 of file MediaCaptureManager.cpp.

{
    auto lock = m_lock.LockShared();
    bool ret = false;

    if (m_currentState == Initialized || m_currentState == Recording)
    {
        ret = true;
    }

    return ret;
}

Concurrency::task< void > InitializeAsync ( IMFDXGIDeviceManager * pDxgiDeviceManager = nullptr )

Definition at line 26 of file MediaCaptureManager.cpp.

{
    m_mediaCapture = ref new Windows::Media::Capture::MediaCapture;

    m_mediaCapture->Failed += ref new MediaCaptureFailedEventHandler([](MediaCapture^ sender, MediaCaptureFailedEventArgs ^args)
    {
        // Handle MediaCapture failure notification
        OutputDebugString(args->Message->Data());
    });

    if (pDxgiDeviceManager)
    {
        m_spMFDXGIDeviceManager = pDxgiDeviceManager;
    }

    return Concurrency::create_task(DeviceInformation::FindAllAsync(DeviceClass::VideoCapture)).then([this](DeviceInformationCollection^ devices)
    {
        auto initSetting = ref new Windows::Media::Capture::MediaCaptureInitializationSettings;
        initSetting->StreamingCaptureMode = Windows::Media::Capture::StreamingCaptureMode::AudioAndVideo;
        initSetting->MediaCategory = Windows::Media::Capture::MediaCategory::Media;

        // Select video conferencing profile since it provides better performance on HoloLens 2
        for (auto cameraDeviceInfo : devices)
        {
            auto profiles = m_mediaCapture->FindKnownVideoProfiles(cameraDeviceInfo->Id, KnownVideoProfile::VideoConferencing);
            if (profiles->Size > 0)
            {
                initSetting->VideoProfile = profiles->GetAt(0);
            }
        }

        if (m_spMFDXGIDeviceManager)
        {
            // Optionally, you can put your D3D device into MediaCapture.
            // But, in most case, this is not mandatory.
            Microsoft::WRL::ComPtr<IAdvancedMediaCaptureInitializationSettings> spAdvancedSettings;
            ((IUnknown*)initSetting)->QueryInterface(IID_PPV_ARGS(&spAdvancedSettings));
            spAdvancedSettings->SetDirectxDeviceManager(m_spMFDXGIDeviceManager.Get());
        }

        return Concurrency::create_task(m_mediaCapture->InitializeAsync(initSetting)).then([this]()
        {
            auto lock = m_lock.LockExclusive();

            if (m_mediaCapture->MediaCaptureSettings->AudioDeviceId && m_mediaCapture->MediaCaptureSettings->VideoDeviceId)
            {
                // MediaCapture is initialized with valid audio and video device.
                m_currentState = Initialized;
            }
            else
            {
                OutputDebugString(L"MediaCapture is initialized without valid sources.\n");
            }
        });
    });
}

bool IsHologramEnabled ( ) [inline]

Definition at line 35 of file MediaCaptureManager.h.

{ auto lock = m_lock.LockShared(); return m_hologramEnabled; }

bool IsSystemAudioEnabled ( ) [inline]

Definition at line 36 of file MediaCaptureManager.h.

{ auto lock = m_lock.LockShared(); return m_sysAudioEnabled; }

void SetHologramEnabled ( const bool enabled ) [inline]

Definition at line 32 of file MediaCaptureManager.h.

{ auto lock = m_lock.LockExclusive(); m_hologramEnabled = enabled; }

void SetSystemAudioEnabled ( const bool enabled ) [inline]

Definition at line 33 of file MediaCaptureManager.h.

{ auto lock = m_lock.LockExclusive(); m_sysAudioEnabled = enabled; }

Concurrency::task< void > StartRecordingAsync ( )

Definition at line 83 of file MediaCaptureManager.cpp.

{
    // Lock to check current state
    auto lock = m_lock.LockExclusive();

    if (m_currentState != Initialized)
    {
        OutputDebugString(L"Trying to start recording in invalid state.\n");
        throw ref new Platform::FailureException();
    }

    m_currentState = StartingRecord;

    return Concurrency::create_task(Windows::Storage::KnownFolders::GetFolderForUserAsync(nullptr, Windows::Storage::KnownFolderId::CameraRoll)).then([this](Windows::Storage::StorageFolder ^folder)
    {
        if (!folder)
        {
            OutputDebugString(L"Can't find camera roll folder for this user\n");
            throw ref new Platform::FailureException();
        }

        // Create storage file for video capture
        return Concurrency::create_task(folder->CreateFileAsync(L"MrcVideo.mp4", Windows::Storage::CreationCollisionOption::GenerateUniqueName)).then([this](Windows::Storage::StorageFile ^saveFile)
        {
            if (!saveFile)
            {
                throw ref new Platform::FailureException();
            }

            Concurrency::task<void> addEffectTask;
            auto lock = m_lock.LockShared();

            if (m_hologramEnabled)
            {
                // Add video effect on videoRecord stream
                auto mrcVideoEffectDefinition = ref new MrcEffectDefinitions::MrcVideoEffectDefinition;
                mrcVideoEffectDefinition->StreamType = MediaStreamType::VideoRecord;

                addEffectTask = Concurrency::create_task(m_mediaCapture->AddVideoEffectAsync(mrcVideoEffectDefinition, MediaStreamType::VideoRecord)).then([this](IMediaExtension ^videoExtension)
                {
                    auto lock = m_lock.LockExclusive();
                    OutputDebugString(L"VideoEffect Added\n");
                    m_videoEffectAdded = true;

                    if (m_sysAudioEnabled)
                    {
                        // Add audio effect on audio stream
                        auto mrcAudioEffectDefinition = ref new MrcEffectDefinitions::MrcAudioEffectDefinition;
                        mrcAudioEffectDefinition->MixerMode = MrcEffectDefinitions::AudioMixerMode::MicAndLoopback;

                        auto addAudioEffectTask = Concurrency::create_task(m_mediaCapture->AddAudioEffectAsync(mrcAudioEffectDefinition)).then([this](IMediaExtension^ audioExtension)
                        {
                            auto lock = m_lock.LockExclusive();
                            OutputDebugString(L"AudioEffect Added\n");
                            m_audioEffectAdded = true;
                        });
                    }
                });
            }
            else if (m_sysAudioEnabled)
            {
                // Add audio effect on audio stream
                auto mrcAudioEffectDefinition = ref new MrcEffectDefinitions::MrcAudioEffectDefinition;
                mrcAudioEffectDefinition->MixerMode = MrcEffectDefinitions::AudioMixerMode::MicAndLoopback;

                addEffectTask = Concurrency::create_task(m_mediaCapture->AddAudioEffectAsync(mrcAudioEffectDefinition)).then([this](IMediaExtension^ audioExtension)
                {
                    auto lock = m_lock.LockExclusive();
                    OutputDebugString(L"AudioEffect Added\n");
                    m_audioEffectAdded = true;
                });
            }

            if (m_hologramEnabled || m_sysAudioEnabled)
            {
                return addEffectTask.then([this, saveFile]()
                {
                    // When all effects are added, start video recording
                    auto encodingProperties = MediaProperties::MediaEncodingProfile::CreateMp4(MediaProperties::VideoEncodingQuality::Auto);

                    return Concurrency::create_task(m_mediaCapture->StartRecordToStorageFileAsync(encodingProperties, saveFile)).then([this]()
                    {
                        auto lock = m_lock.LockExclusive();
                        OutputDebugString(L"Recording Started\n");
                        m_currentState = Recording;
                    });
                });
            }
            else
            {
                // Start video recording without any effects
                auto encodingProperties = MediaProperties::MediaEncodingProfile::CreateMp4(MediaProperties::VideoEncodingQuality::Auto);

                return Concurrency::create_task(m_mediaCapture->StartRecordToStorageFileAsync(encodingProperties, saveFile)).then([this]()
                {
                    auto lock = m_lock.LockExclusive();
                    OutputDebugString(L"Recording Started\n");
                    m_currentState = Recording;
                });
            }
        });
    });
}

Concurrency::task< void > StopRecordingAsync ( )

Definition at line 187 of file MediaCaptureManager.cpp.

{
    // Lock to check current state
    auto lock = m_lock.LockExclusive();

    if (m_currentState != Recording)
    {
        OutputDebugString(L"Trying to stop recording in invalid state.\n");
        throw ref new Platform::FailureException();
    }

    m_currentState = StoppingRecord;

    // Stop video recording
    return Concurrency::create_task(m_mediaCapture->StopRecordAsync()).then([this]()
    {
        auto lock = m_lock.LockExclusive();
        OutputDebugString(L"Video Recording Stopped\n");
        m_currentState = Initialized;

        if (m_videoEffectAdded)
        {
            // Clear effects in videoRecord stream
            Concurrency::create_task(m_mediaCapture->ClearEffectsAsync(Windows::Media::Capture::MediaStreamType::VideoRecord)).then([this]()
            {
                auto lock = m_lock.LockExclusive();
                OutputDebugString(L"VideoEffect removed\n");
                m_videoEffectAdded = false;

                if (m_audioEffectAdded)
                {
                    // Clear effects in audio stream
                    Concurrency::create_task(m_mediaCapture->ClearEffectsAsync(Windows::Media::Capture::MediaStreamType::Audio)).then([this]()
                    {
                        auto lock = m_lock.LockExclusive();
                        OutputDebugString(L"AudioEffect removed\n");
                        m_audioEffectAdded = false;
                    });
                }
            });
        }
        else  if (m_audioEffectAdded)
        {
            // Clear effects in audio stream
            Concurrency::create_task(m_mediaCapture->ClearEffectsAsync(Windows::Media::Capture::MediaStreamType::Audio)).then([this]()
            {
                auto lock = m_lock.LockExclusive();
                OutputDebugString(L"AudioEffect removed\n");
                m_audioEffectAdded = false;
            });
        }
    });
}

Concurrency::task< void > TakePhotoAsync ( )

Definition at line 241 of file MediaCaptureManager.cpp.

{
    // Lock to check current state
    auto lock = m_lock.LockExclusive();

    if (m_currentState != Initialized)
    {
        OutputDebugString(L"Trying to take photo in invalid state.\n");
        throw ref new Platform::FailureException();
    }

    m_currentState = TakingPhoto;

    return Concurrency::create_task(Windows::Storage::KnownFolders::GetFolderForUserAsync(nullptr, Windows::Storage::KnownFolderId::CameraRoll)).then([this](Windows::Storage::StorageFolder ^folder)
    {
        if (!folder)
        {
            OutputDebugString(L"Can't find camera roll folder for this user\n");
            throw ref new Platform::FailureException();
        }

        // Create storage file for picture
        return Concurrency::create_task(folder->CreateFileAsync(L"MRCPhoto.jpg", Windows::Storage::CreationCollisionOption::GenerateUniqueName)).then([this](Windows::Storage::StorageFile ^saveFile)
        {
            if (!saveFile)
            {
                OutputDebugString(L"Can't create MRC Photo file\n");
                throw ref new Platform::FailureException();
            }

            auto lock = m_lock.LockShared();

            if (m_hologramEnabled)
            {
                // Add video effect on photo stream
                auto mrcVideoEffectDefinition = ref new MrcEffectDefinitions::MrcVideoEffectDefinition;
                mrcVideoEffectDefinition->StreamType = MediaStreamType::Photo;

                return Concurrency::create_task(m_mediaCapture->AddVideoEffectAsync(mrcVideoEffectDefinition, MediaStreamType::Photo)).then([this, saveFile](IMediaExtension^ videoExtension)
                {
                    OutputDebugString(L"VideoEffect Added\n");
                    m_photoEffectAdded = true;

                    // Taking picture
                    auto encodingProperties = MediaProperties::ImageEncodingProperties::CreateJpeg();

                    return Concurrency::create_task(m_mediaCapture->CapturePhotoToStorageFileAsync(encodingProperties, saveFile)).then([this]()
                    {
                        auto lock = m_lock.LockExclusive();
                        OutputDebugString(L"Photo taken\n");
                        m_currentState = Initialized;

                        return Concurrency::create_task(m_mediaCapture->ClearEffectsAsync(MediaStreamType::Photo)).then([this]()
                        {
                            auto lock = m_lock.LockExclusive();
                            OutputDebugString(L"PhotoEffect removed\n");
                            m_photoEffectAdded = false;
                        });
                    });
                });
            }
            else
            {
                // Taking picture without any effect
                auto encodingProperties = MediaProperties::ImageEncodingProperties::CreateJpeg();

                return Concurrency::create_task(m_mediaCapture->CapturePhotoToStorageFileAsync(encodingProperties, saveFile)).then([this]()
                {
                    auto lock = m_lock.LockExclusive();
                    OutputDebugString(L"Photo taken\n");
                    m_currentState = Initialized;
                });
            }
        });
    });
}

Member Data Documentation

bool m_audioEffectAdded [private]

Definition at line 51 of file MediaCaptureManager.h.

State m_currentState [private]

Definition at line 44 of file MediaCaptureManager.h.

bool m_hologramEnabled [private]

Definition at line 46 of file MediaCaptureManager.h.

Microsoft::WRL::Wrappers::SRWLock m_lock [private]

Definition at line 41 of file MediaCaptureManager.h.

Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCapture [private]

Definition at line 42 of file MediaCaptureManager.h.

bool m_photoEffectAdded [private]

Definition at line 50 of file MediaCaptureManager.h.

Microsoft::WRL::ComPtr<IMFDXGIDeviceManager> m_spMFDXGIDeviceManager [private]

Definition at line 53 of file MediaCaptureManager.h.

bool m_sysAudioEnabled [private]

Definition at line 47 of file MediaCaptureManager.h.

bool m_videoEffectAdded [private]

Definition at line 49 of file MediaCaptureManager.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/MediaCaptureManager.h
  • HolographicMixedRealityCapture/cpp/MediaCaptureManager.cpp
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelColorConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • ModelColorConstantBuffer
Public Attributes

ModelColorConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | color
DirectX::XMFLOAT4X4 | model

Detailed Description

Definition at line 15 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 color

Definition at line 18 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 model

Definition at line 17 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4X4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Panel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • Panel
Public Member Functions | Protected Member Functions | Private Attributes

Panel Class Reference

#include "Panel.h"

Inherits HolographicMRCSample::ControlBase.

List of all members.

Public Member Functions

Panel (const float width, const float height, const float depth, const float red, const float green, const float blue, const float alpha)

Protected Member Functions

virtual void | DoCreateDeviceDependentResources ()
virtual void | DoReleaseDeviceDependentResources ()
virtual void | DoRender ()
virtual void | DoUpdate (const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)

Private Attributes

Windows::Foundation::Numerics::float4 m_color
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 m_size
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 8 of file Panel.h.

Constructor & Destructor Documentation

Panel | ( | const float | width,
 |  | const float | height,
 |  | const float | depth,
 |  | const float | red,
 |  | const float | green,
 |  | const float | blue,
 |  | const float | alpha
 | ) |  |

Definition at line 12 of file Panel.cpp.

                                                                                :
    m_size(Windows::Foundation::Numerics::float3(width, height, depth)),
    m_color(Windows::Foundation::Numerics::float4(red, green, blue, alpha))
{
}

Member Function Documentation

void DoCreateDeviceDependentResources ( ) [protected, virtual]

Implements ControlBase.

Definition at line 133 of file Panel.cpp.

{
    if (m_loadingComplete)
    {
        return;
    }

    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.

    m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Simple);
    m_inputLayout  = m_deviceResources->GetInputLayout(DX::VertexShader_Simple);
    m_pixelShader  = m_deviceResources->GetPixelShader(DX::PixelShader_Simple);

    if (!m_usingVprtShaders)
    {
        // Get the pass-through geometry shader.
        m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Simple);
    }

    // After the pixel shader file is loaded, create the shader and constant buffer.
    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_modelConstantBuffer));

    // Once all shaders are loaded, create the mesh.
    {
        float halfWidth  = m_size.x * 0.5f;
        float halfHeight = m_size.y * 0.5f;
        float halfDepth  = m_size.z * 0.5f;
        XMFLOAT4 color(m_color.x, m_color.y, m_color.z, m_color.w);

        // initiate bounding box
        m_boundingBox = BoundingOrientedBox(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(halfWidth, halfHeight, halfDepth), XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f));

        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the cube size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // cube at a comfortable size we made the cube width 0.2 m (20 cm).
        const VertexPositionColor cubeVertices[] =
        {
            { XMFLOAT3(-halfWidth, -halfHeight, -halfDepth), color },
            { XMFLOAT3(-halfWidth, -halfHeight,  halfDepth), color },
            { XMFLOAT3(-halfWidth,  halfHeight, -halfDepth), color },
            { XMFLOAT3(-halfWidth,  halfHeight,  halfDepth), color },
            { XMFLOAT3( halfWidth, -halfHeight, -halfDepth), color },
            { XMFLOAT3( halfWidth, -halfHeight,  halfDepth), color },
            { XMFLOAT3( halfWidth,  halfHeight, -halfDepth), color },
            { XMFLOAT3( halfWidth,  halfHeight,  halfDepth), color },
        };

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem = cubeVertices;
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        static const unsigned short cubeIndices [] =
        {
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        };

        m_indexCount = ARRAYSIZE(cubeIndices);

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = cubeIndices;
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    }

    // Once the cube is loaded, the object is ready to be rendered.
    m_loadingComplete = true;
}

void DoReleaseDeviceDependentResources ( ) [protected, virtual]

Implements ControlBase.

Definition at line 252 of file Panel.cpp.

{
    m_inputLayout.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
    m_vertexShader.Reset();
    m_geometryShader.Reset();
    m_pixelShader.Reset();
    m_modelConstantBuffer.Reset();

    m_loadingComplete  = false;
    m_usingVprtShaders = false;
}

void DoRender ( ) [protected, virtual]

Implements ControlBase.

Definition at line 52 of file Panel.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void DoUpdate | ( | const DX::StepTimer & | timer,
 |  | HolographicFrame^ | holographicFrame,
 |  | SpatialCoordinateSystem^ | currentCoordinateSystem,
 |  | SpatialInteractionSourceState^ | interactionSource,
 |  | const DirectX::XMMATRIX & | parentTransform |
 | ) |  |  | [protected, virtual]

Implements ControlBase.

Definition at line 21 of file Panel.cpp.

{
    // Rotate the cube.
    const XMMATRIX modelRotation    = XMMatrixRotationRollPitchYawFromVector(XMLoadFloat3(&m_rotation));

    // Position the cube.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // Multiply to get the transform matrix.
    // Note that this transform does not enforce a particular coordinate system. The calling
    // class is responsible for rendering this content in a consistent manner.
    const XMMATRIX modelTransform = modelRotation * modelTranslation * parentTransform;
    XMStoreFloat4x4(&m_transform, modelTransform);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
}

Member Data Documentation

Windows::Foundation::Numerics::float4 m_color [private]

Definition at line 41 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 32 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 30 of file Panel.h.

uint32 m_indexCount = 0 [private]

Definition at line 38 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 28 of file Panel.h.

bool m_loadingComplete = false [private]

Definition at line 44 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 34 of file Panel.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 37 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 33 of file Panel.h.

Windows::Foundation::Numerics::float3 m_size [private]

Definition at line 40 of file Panel.h.

bool m_usingVprtShaders = false [private]

Definition at line 48 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 29 of file Panel.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 31 of file Panel.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/Panel.h
  • HolographicMixedRealityCapture/cpp/Content/Panel.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicMRCSampleMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 9 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 37 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 42 of file AppView.h.

std::unique_ptr<HolographicMRCSampleMain> m_main [private]

Definition at line 35 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 38 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 39 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicMixedRealityCapture/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 7 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 12 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );
}

~SpatialInputHandler ( )

Definition at line 26 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 35 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 22 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 25 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 28 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.h
  • HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpinningCubeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • SpinningCubeRenderer
Public Member Functions | Private Attributes

SpinningCubeRenderer Class Reference

#include "SpinningCubeRenderer.h"

List of all members.

Public Member Functions

SpinningCubeRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
Windows::Foundation::Numerics::float3 GetPosition ()
void | PositionHologram (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SetPosition (Windows::Foundation::Numerics::float3 pos)
void | Update (const DX::StepTimer &timer)

Private Attributes

float | m_degreesPerSecond = 45.f
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 10 of file SpinningCubeRenderer.h.

Constructor & Destructor Documentation

SpinningCubeRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 12 of file SpinningCubeRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 159 of file SpinningCubeRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.

    m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Simple);
    m_inputLayout = m_deviceResources->GetInputLayout(DX::VertexShader_Simple);
    m_pixelShader = m_deviceResources->GetPixelShader(DX::PixelShader_Simple);

    if (!m_usingVprtShaders)
    {
        m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Simple);
    }

    const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &constantBufferDesc,
            nullptr,
            &m_modelConstantBuffer
        )
    );

    // Load mesh vertices. Each vertex has a position and a color.
    // Note that the cube size has changed from the default DirectX app
    // template. Windows Holographic is scaled in meters, so to draw the
    // cube at a comfortable size we made the cube width 0.2 m (20 cm).
    static const VertexPositionColor cubeVertices[] =
    {
        { XMFLOAT3(-0.1f, -0.1f, -0.1f), XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f) },
        { XMFLOAT3(-0.1f, -0.1f,  0.1f), XMFLOAT4(0.0f, 0.0f, 1.0f, 1.0f) },
        { XMFLOAT3(-0.1f,  0.1f, -0.1f), XMFLOAT4(0.0f, 1.0f, 0.0f, 1.0f) },
        { XMFLOAT3(-0.1f,  0.1f,  0.1f), XMFLOAT4(0.0f, 1.0f, 1.0f, 1.0f) },
        { XMFLOAT3( 0.1f, -0.1f, -0.1f), XMFLOAT4(1.0f, 0.0f, 0.0f, 1.0f) },
        { XMFLOAT3( 0.1f, -0.1f,  0.1f), XMFLOAT4(1.0f, 0.0f, 1.0f, 1.0f) },
        { XMFLOAT3( 0.1f,  0.1f, -0.1f), XMFLOAT4(1.0f, 1.0f, 0.0f, 1.0f) },
        { XMFLOAT3( 0.1f,  0.1f,  0.1f), XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f) },
    };

    D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
    vertexBufferData.pSysMem = cubeVertices;
    vertexBufferData.SysMemPitch = 0;
    vertexBufferData.SysMemSlicePitch = 0;
    const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &vertexBufferDesc,
            &vertexBufferData,
            &m_vertexBuffer
            )
        );

    // Load mesh indices. Each trio of indices represents
    // a triangle to be rendered on the screen.
    // For example: 2,1,0 means that the vertices with indexes
    // 2, 1, and 0 from the vertex buffer compose the
    // first triangle of this mesh.
    // Note that the winding order is clockwise by default.
    static const unsigned short cubeIndices [] =
    {
        2,1,0, // -x
        2,3,1,

        6,4,5, // +x
        6,5,7,

        0,1,5, // -y
        0,5,4,

        2,6,7, // +y
        2,7,3,

        0,4,6, // -z
        0,6,2,

        1,3,7, // +z
        1,7,5,
    };

    m_indexCount = ARRAYSIZE(cubeIndices);

    D3D11_SUBRESOURCE_DATA indexBufferData = {0};
    indexBufferData.pSysMem          = cubeIndices;
    indexBufferData.SysMemPitch      = 0;
    indexBufferData.SysMemSlicePitch = 0;
    const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
            &indexBufferDesc,
            &indexBufferData,
            &m_indexBuffer
            )
        );

    // Once the cube is loaded, the object is ready to be rendered.
    m_loadingComplete = true;
}

Windows::Foundation::Numerics::float3 GetPosition ( ) [inline]

Definition at line 24 of file SpinningCubeRenderer.h.

{ return m_position; }

void PositionHologram ( Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose )
void ReleaseDeviceDependentResources ( )

Definition at line 262 of file SpinningCubeRenderer.cpp.

{
    m_loadingComplete  = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
}

void Render ( )

Definition at line 88 of file SpinningCubeRenderer.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void SetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline]

Definition at line 23 of file SpinningCubeRenderer.h.

{ m_position = pos;  }

void Update ( const DX::StepTimer & timer )

Definition at line 40 of file SpinningCubeRenderer.cpp.

{
    // Rotate the cube.
    // Convert degrees to radians, then convert seconds to rotation angle.
    const float    radiansPerSecond = XMConvertToRadians(m_degreesPerSecond);
    const double   totalRotation    = timer.GetTotalSeconds() * radiansPerSecond;
    const float    radians          = static_cast<float>(fmod(totalRotation, XM_2PI));
    const XMMATRIX modelRotation    = XMMatrixRotationY(-radians);

    // Position the cube.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // Multiply to get the transform matrix.
    // Note that this transform does not enforce a particular coordinate system. The calling
    // class is responsible for rendering this content in a consistent manner.
    const XMMATRIX modelTransform   = XMMatrixMultiply(modelRotation, modelTranslation);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

    // Loading is asynchronous. Resources must be created before they can be updated.
    if (!m_loadingComplete)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );
}

Member Data Documentation

float m_degreesPerSecond = 45.f [private]

Definition at line 45 of file SpinningCubeRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 28 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 35 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 33 of file SpinningCubeRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 41 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 31 of file SpinningCubeRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 44 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 37 of file SpinningCubeRenderer.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 40 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 36 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 46 of file SpinningCubeRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 50 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 32 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 34 of file SpinningCubeRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.h
  • HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • VertexPosition
Public Attributes

VertexPosition Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 pos

Detailed Description

Definition at line 25 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 pos

Definition at line 27 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | color
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 30 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 color

Definition at line 33 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 32 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionTexture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicMRCSample
  • VertexPositionTexture
Public Attributes

VertexPositionTexture Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | pos
DirectX::XMFLOAT2 | uv

Detailed Description

Definition at line 36 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 pos

Definition at line 38 of file ShaderStructures.h.

DirectX::XMFLOAT2 uv

Definition at line 39 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClearTool Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • ClearTool
Public Member Functions | Protected Attributes

ClearTool Class Reference

#include "Tool.h"

Inherits HolographicPaint::Tool.

List of all members.

Public Member Functions

ClearTool (Windows::UI::Color color, float diameter)
virtual void | Render (ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override
virtual void | Update (ID3D11DeviceContext *pDeviceContext) override

Protected Attributes

Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
bool | m_resetBuffers = true
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer

Detailed Description

Definition at line 37 of file Tool.h.

Constructor & Destructor Documentation

ClearTool | ( | Windows::UI::Color | color,
 |  | float | diameter
 | ) |  |

Definition at line 59 of file Tool.cpp.

                                                         : Tool(color, diameter)
{}

Member Function Documentation

void Render | ( | ID3D11DeviceContext * | pDeviceContext,
 |  | IRenderer * | pRenderingHelper |
 | ) |  |  | [override, virtual]

Reimplemented from Tool.

Definition at line 154 of file Tool.cpp.

{
    const UINT stride = sizeof(VertexPosition);
    const UINT offset = 0;
    pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
    pDeviceContext->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    pDeviceContext->IASetIndexBuffer(m_indexBuffer.Get(), DX::GetDxgiFormat(), 0);
    pDeviceContext->DrawIndexedInstanced(m_indexCount, 2, 0, 0, 0);
}

void Update ( ID3D11DeviceContext * pDeviceContext ) [override, virtual]

Reimplemented from Tool.

Definition at line 62 of file Tool.cpp.

{
    __super::Update(pDeviceContext);
    if (m_resetBuffers)
    {
        Microsoft::WRL::ComPtr<ID3D11Device> spDevice;
        pDeviceContext->GetDevice(spDevice.ReleaseAndGetAddressOf());
        std::vector<VertexPosition> vertices;

        vertices.push_back({ XMFLOAT3(-0.5f,  0.5f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.0f,  0.5f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.5f,  0.5f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.2f,  0.4f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.2f,  0.4f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.4f,  0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.0f,  0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.4f,  0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.5f,  0.0f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.2f,  0.0f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.2f,  0.0f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.5f,  0.0f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.4f, -0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.0f, -0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.4f, -0.2f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.2f, -0.4f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.2f, -0.4f, -0.5f) });
        vertices.push_back({ XMFLOAT3(-0.5f, -0.5f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.0f, -0.5f, -0.5f) });
        vertices.push_back({ XMFLOAT3( 0.5f, -0.5f, -0.5f) });

        vertices.push_back({ XMFLOAT3(-0.5f,  0.5f,  0.5f) });
        vertices.push_back({ XMFLOAT3( 0.5f,  0.5f,  0.5f) });
        vertices.push_back({ XMFLOAT3( 0.5f, -0.5f,  0.5f) });
        vertices.push_back({ XMFLOAT3(-0.5f, -0.5f,  0.5f) });

        D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
        vertexBufferData.pSysMem = vertices.data();
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPosition) * static_cast<UINT>(vertices.size()), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            spDevice->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                m_vertexBuffer.ReleaseAndGetAddressOf()
            )
        );

        static const VertexIndex_t indices[] =
        {
             0,  1,  3,
             0,  1,  3,
             1,  2,  4,
             0,  3,  5,
             1,  6,  3,
             1,  4,  6,
             2,  7,  4,
             0,  5,  8,
             2, 11,  7,
             8,  5,  9,
             7, 11, 10,
             8,  9, 12,
             8, 12, 17,
            10, 11, 14,
            17, 12, 15,
            18, 15, 18,
            13, 18, 15,
            13, 16, 18,
            16, 19, 18,
            14, 19, 16,
            11, 19, 14,
            17, 15, 18,
        };
        m_indexCount = _countof(indices);

        D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
        indexBufferData.pSysMem = indices;
        indexBufferData.SysMemPitch = 0;
        indexBufferData.SysMemSlicePitch = 0;
        CD3D11_BUFFER_DESC indexBufferDesc(static_cast<UINT>(sizeof(VertexIndex_t) * m_indexCount), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            spDevice->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                m_indexBuffer.ReleaseAndGetAddressOf()
            )
        );
        m_resetBuffers = false;
    }

}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [protected]

Definition at line 48 of file Tool.h.

uint32 m_indexCount = 0 [protected]

Definition at line 49 of file Tool.h.

bool m_resetBuffers = true [protected]

Definition at line 50 of file Tool.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [protected]

Definition at line 47 of file Tool.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/Content/Tool.h
  • SpatialInteractionSource/cpp/Content/Tool.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HandHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • HandHandler
Public Member Functions | Private Member Functions | Private Attributes

HandHandler Class Reference

#include "HandHandler.h"

Inherits HolographicPaint::SourceHandler.

List of all members.

Public Member Functions

HandHandler (Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target)
~HandHandler ()
virtual void | OnInteractionDetected (Windows::UI::Input::Spatial::SpatialInteraction^interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override
virtual void | OnSourceUpdated (Windows::UI::Input::Spatial::SpatialInteractionSourceState^state, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)

Private Member Functions

void | HitTestTargetWithGaze (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose)
void | OnManipulationCanceled (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationCanceledEventArgs^args)
void | OnManipulationCompleted (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationCompletedEventArgs^args)
void | OnManipulationStarted (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationStartedEventArgs^args)
void | OnManipulationUpdated (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationUpdatedEventArgs^args)
void | OnNavigationCompleted (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialNavigationCompletedEventArgs^args)
void | OnNavigationStarted (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialNavigationStartedEventArgs^args)
void | OnTapped (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs^args)

Private Attributes

Windows::Perception::Spatial::SpatialCoordinateSystem | m_coordinateSystem
Windows::UI::Input::Spatial::SpatialGestureRecognizer | m_gestureRecognizer
Windows::Foundation::Numerics::float3 m_initialPosition
Windows::Foundation::EventRegistrationToken | m_manipulationCanceledToken
Windows::Foundation::EventRegistrationToken | m_manipulationCompletedToken
Windows::Foundation::EventRegistrationToken | m_manipulationStartedToken
Windows::Foundation::EventRegistrationToken | m_manipulationUpdatedToken
Windows::Foundation::EventRegistrationToken | m_navigationCompletedToken
Windows::Foundation::EventRegistrationToken | m_navigationStartedToken
Windows::Foundation::EventRegistrationToken | m_tappedToken

Detailed Description

Definition at line 8 of file HandHandler.h.

Constructor & Destructor Documentation

HandHandler | ( | Windows::UI::Input::Spatial::SpatialInteractionSource^ | source,
 |  | ISourceCommandHandler * | eventsHandler,
 |  | std::shared_ptr< Whiteboard > & | target
 | ) |  |
~HandHandler ( )

Definition at line 57 of file HandHandler.cpp.

{
    m_gestureRecognizer->Tapped -= m_tappedToken;
    m_gestureRecognizer->NavigationStarted -= m_navigationStartedToken;
    m_gestureRecognizer->NavigationCompleted -= m_navigationCompletedToken;
    m_gestureRecognizer->ManipulationStarted -= m_manipulationStartedToken;
    m_gestureRecognizer->ManipulationCanceled -= m_manipulationCanceledToken;
    m_gestureRecognizer->ManipulationCompleted -= m_manipulationCompletedToken;
    m_gestureRecognizer->ManipulationUpdated -= m_manipulationUpdatedToken;
}

Member Function Documentation

void HitTestTargetWithGaze ( Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose ) [private]
virtual void OnInteractionDetected | ( | Windows::UI::Input::Spatial::SpatialInteraction^ | interaction,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [override, virtual]

Reimplemented from SourceHandler.

void OnManipulationCanceled | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialManipulationCanceledEventArgs^ | args |
 | ) |  |  | [private]
void OnManipulationCompleted | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialManipulationCompletedEventArgs^ | args |
 | ) |  |  | [private]
void OnManipulationStarted | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialManipulationStartedEventArgs^ | args |
 | ) |  |  | [private]
void OnManipulationUpdated | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialManipulationUpdatedEventArgs^ | args |
 | ) |  |  | [private]
void OnNavigationCompleted | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialNavigationCompletedEventArgs^ | args |
 | ) |  |  | [private]
void OnNavigationStarted | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialNavigationStartedEventArgs^ | args |
 | ) |  |  | [private]
virtual void OnSourceUpdated | ( | Windows::UI::Input::Spatial::SpatialInteractionSourceState^ | state,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [virtual]

Reimplemented from SourceHandler.

void OnTapped | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialTappedEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::Perception::Spatial::SpatialCoordinateSystem m_coordinateSystem [private]

Definition at line 21 of file HandHandler.h.

Windows::UI::Input::Spatial::SpatialGestureRecognizer m_gestureRecognizer [private]

Definition at line 20 of file HandHandler.h.

Windows::Foundation::Numerics::float3 m_initialPosition [private]

Definition at line 22 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_manipulationCanceledToken [private]

Definition at line 29 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_manipulationCompletedToken [private]

Definition at line 28 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_manipulationStartedToken [private]

Definition at line 27 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_manipulationUpdatedToken [private]

Definition at line 30 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_navigationCompletedToken [private]

Definition at line 26 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_navigationStartedToken [private]

Definition at line 25 of file HandHandler.h.

Windows::Foundation::EventRegistrationToken m_tappedToken [private]

Definition at line 24 of file HandHandler.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/HandHandler.h
  • SpatialInteractionSource/cpp/HandHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicPaintMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • HolographicPaintMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicPaintMain Class Reference

#include "HolographicPaintMain.h"

List of all members.

Public Member Functions

HolographicPaintMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicPaintMain ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
virtual void | OnDPadAction (SourceHandler *sender, DPadAction action) override
virtual void | OnEnterToolChoice (SourceHandler *sender, Windows::Perception::PerceptionTimestamp^timestamp) override
virtual void | OnSelectTool (SourceHandler *sender) override
virtual void | OnStrokeAdded (SourceHandler *sender, std::shared_ptr< IBaseRenderedObject > stroke) override
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

size_t | FindToolIndex (unsigned int sourceId)
SourceHandler * | GetSourceHandler (unsigned int sourceId)
void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnInteractionDetected (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionDetectedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | OnSourceDetected (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
void | OnSourceLost (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
void | OnSourceUpdated (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
void | PositionTools (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, HandAssignment side)
void | SetToolByIndex (unsigned int sourceId, size_t toolIndex)
HandAssignment | TryGetHandedness (SourceHandler *sender, Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose)
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
size_t | m_clearToolIndex
ApplicationMode | m_currentMode = ApplicationMode::Drawing
unsigned int | m_currentSourceId = NoSourceId
size_t | m_currentToolIndex
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Foundation::Numerics::float3 | m_focusPoint = { 0.0f, 0.0f, 2.0f }
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Windows::Foundation::EventRegistrationToken | m_interactionDetectedToken
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_referenceFrame
std::unique_ptr< RenderingHelper > | m_renderingHelper
Windows::Foundation::EventRegistrationToken | m_sourceDetectedToken
Windows::Foundation::EventRegistrationToken | m_sourceLostToken
std::map< unsigned int,
std::shared_ptr< SourceHandler > > 		m_sourceMap
Windows::Foundation::EventRegistrationToken | m_sourcePressedToken
std::vector< std::shared_ptr
< SourceHandler > > 		m_sources
Windows::Foundation::EventRegistrationToken | m_sourceUpdatedToken
Windows::UI::Input::Spatial::SpatialInteractionManager | m_spatialInteractionManager
std::vector< std::shared_ptr
< IBaseRenderedObject > > 		m_strokes
DX::StepTimer m_timer
std::vector< std::shared_ptr
< Tool > > 		m_tools
ToolCarousel m_toolsCarousel
std::shared_ptr< Whiteboard > | m_whiteboard

Detailed Description

Definition at line 18 of file HolographicPaintMain.h.

Constructor & Destructor Documentation

HolographicPaintMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 23 of file HolographicPaintMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    // Create a 6m x 2m whiteboard in front of the (initial position of the) user
    m_whiteboard = std::make_shared<Whiteboard>(6.0f, 2.0f, float3(0.0f, 0.0f, -3.0f));

}

~HolographicPaintMain ( )

Definition at line 170 of file HolographicPaintMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

size_t FindToolIndex ( unsigned int sourceId ) [private]

Definition at line 590 of file HolographicPaintMain.cpp.

{
    // Because hands are detected / lost very easily - and in particular during tool detected - they will
    // share the same tool selection
    for (auto& it : m_sources)
    {
        if (it->SourceId() == sourceId)
        {
            Tool* tool = it->GetCurrentTool();
            for (size_t idx = 0; idx < m_tools.size(); ++idx)
            {
                if (m_tools[idx].get() == tool)
                {
                    return idx;
                }
            }
        }
    }
    return static_cast<size_t>(-1);
}

SourceHandler* GetSourceHandler ( unsigned int sourceId ) [inline, private]

Definition at line 79 of file HolographicPaintMain.h.

        {
            auto it = m_sourceMap.find(sourceId);
            return (it == m_sourceMap.end()) ? nullptr : it->second.get();
        }

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 361 of file HolographicPaintMain.cpp.

{
    m_renderingHelper->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 368 of file HolographicPaintMain.cpp.

{
    m_renderingHelper->CreateDeviceDependentResources();
}

void OnDPadAction | ( | SourceHandler * | sender,
 |  | DPadAction | action |
 | ) |  |  | [override, virtual]

Definition at line 639 of file HolographicPaintMain.cpp.

{
    if (ApplicationMode::ChooseTool == m_currentMode)
    {
        if (!m_toolsCarousel.IsRotating() && (sender->SourceId() == m_currentSourceId))
        {
            switch (action)
            {
            case DPadAction::Right:
                m_toolsCarousel.StartRotation(RotationDirection::RotateRight, m_timer);
                break;
            case DPadAction::Left:
                m_toolsCarousel.StartRotation(RotationDirection::RotateLeft, m_timer);
                break;
            }
        }
    }
}

virtual void OnEnterToolChoice | ( | SourceHandler * | sender,
 |  | Windows::Perception::PerceptionTimestamp^ | timestamp |
 | ) |  |  | [override, virtual]
void OnInteractionDetected | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionDetectedEventArgs^ | args |
 | ) |  |  | [private]
void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnSelectTool ( SourceHandler * sender ) [override, virtual]

Definition at line 687 of file HolographicPaintMain.cpp.

{
    if (ApplicationMode::ChooseTool == m_currentMode)
    {
        if (sender != nullptr)
        {
            const unsigned int sourceId = sender->SourceId();
            if (sourceId != m_currentSourceId) return; // Only accept changes from selected source

            if (m_clearToolIndex == m_currentToolIndex)
            {
                // This is a special tool which can not be selected
                m_strokes.clear();
            }
            else
            {
                SetToolByIndex(m_currentSourceId, m_currentToolIndex);
            }
        }

        m_currentMode = ApplicationMode::Drawing;
        m_currentSourceId = NoSourceId;

        for (auto& it : m_sources) it->SetApplicationMode(m_currentMode);
    }
}

void OnSourceDetected | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]
void OnSourceLost | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]
void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]
void OnSourceUpdated | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]
void OnStrokeAdded | ( | SourceHandler * | sender,
 |  | std::shared_ptr< IBaseRenderedObject > | stroke |
 | ) |  |  | [override, virtual]

Definition at line 658 of file HolographicPaintMain.cpp.

{
    if (ApplicationMode::Drawing == m_currentMode)
    {
        m_strokes.push_back(stroke);
        // And set the focus point to the current position of the source
        m_focusPoint = sender->GetToolPosition();
    }
}

void PositionTools | ( | Windows::UI::Input::Spatial::SpatialPointerPose^ | pointerPose,
 |  | HandAssignment | side |
 | ) |  |  | [private]
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 264 of file HolographicPaintMain.cpp.

{
    // Don't try to render anything before the first Update.
    if (m_timer.GetFrameCount() == 0)
    {
        return false;
    }

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();
            const auto blendState = pCameraResources->GetBlendState();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Set blend state
            context->OMSetBlendState(blendState, nullptr, 0xffffffff);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            // Notes regarding holographic content:
            //    * For drawing, remember that you have the potential to fill twice as many pixels
            //      in a stereoscopic render target as compared to a non-stereoscopic render target
            //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
            //      and only draw holograms that the user can see.
            //    * To help occlude hologram geometry, you can create a depth map using geometry
            //      data obtained via the surface mapping APIs. You can use this depth map to avoid
            //      rendering holograms that are intended to be hidden behind tables, walls,
            //      monitors, and so on.
            //    * Black pixels will appear transparent to the user wearing the device, but you
            //      should still use alpha blending to draw semitransparent holograms. You should
            //      also clear the screen to Transparent as shown above.
            //

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->CoordinateSystem);

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

            // Only render world-locked content when positional tracking is active.
            if (cameraActive && m_renderingHelper->PrepareRendering())
            {
                switch (m_currentMode)
                {
                case ApplicationMode::Drawing:
                    m_whiteboard->Render(context, m_renderingHelper.get());

                    for (auto& source : m_sources)
                    {
                        source->Render(context, m_renderingHelper.get());
                    }
                    for (auto& stroke : m_strokes)
                    {
                        stroke->Render(context, m_renderingHelper.get());
                    }
                    break;
                case ApplicationMode::ChooseTool:
                    for (auto& tool : m_tools)
                    {
                        tool->Render(context, m_renderingHelper.get());
                    }
                    break;
                }
            }
            atLeastOneCameraRendered = true;
        }

        return atLeastOneCameraRendered;
    });
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void SetToolByIndex | ( | unsigned int | sourceId,
 |  | size_t | toolIndex |
 | ) |  |  | [private]

Definition at line 611 of file HolographicPaintMain.cpp.

{
    if (toolIndex < m_tools.size())
    {
        // Because hands are detected / lost very easily - and in particular during tool detected - they will
        // share the same tool selection
        for (auto& it : m_sources)
        {
            if (it->SourceId() == sourceId)
            {
                it->SetCurrentTool(m_tools[toolIndex]);
            }
        }
    }
}

HandAssignment TryGetHandedness | ( | SourceHandler * | sender,
 |  | Windows::UI::Input::Spatial::SpatialPointerPose^ | pointerPose |
 | ) |  |  | [private]
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 136 of file HolographicPaintMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }

    if (m_spatialInteractionManager != nullptr)
    {
        m_spatialInteractionManager->SourceDetected -= m_sourceDetectedToken;
        m_spatialInteractionManager->SourceLost -= m_sourceLostToken;
        m_spatialInteractionManager->SourcePressed -= m_sourcePressedToken;
        m_spatialInteractionManager->SourceUpdated -= m_sourceUpdatedToken;
        m_spatialInteractionManager->InteractionDetected -= m_interactionDetectedToken;
    }
}

HolographicFrame Update ( )

Definition at line 179 of file HolographicPaintMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->CoordinateSystem;

    m_timer.Tick([&]()
    {
        if (m_renderingHelper->IsLoadingComplete())
        {
            const auto context = m_deviceResources->GetD3DDeviceContext();
            switch (m_currentMode)
            {
            case ApplicationMode::ChooseTool:
                m_toolsCarousel.Update(m_tools, m_currentToolIndex, m_timer);
                for (auto& tool : m_tools)
                {
                    tool->Update(context);
                }
                break;
            case ApplicationMode::Drawing:
            {

                for (auto& source : m_sources)
                {
                    source->Update(context);

                }
                m_whiteboard->Update(context);
                for (auto& stroke : m_strokes)
                {
                    stroke->Update(context);
                }
            }
            break;
            }
        }
    });

    // We complete the frame update by using information about our content positioning
    // to set the focus point.

    for (auto cameraPose : prediction->CameraPoses)
    {
        // The HolographicCameraRenderingParameters class provides access to set
        // the image stabilization parameters.
        HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

        // SetFocusPoint informs the system about a specific point in your scene to
        // prioritize for image stabilization. The focus point is set independently
        // for each holographic camera.
        // You should set the focus point near the content that the user is looking at.
        // In this example, we put the focus point at the center of the sample hologram,
        // since that is the only hologram available for the user to focus on.
        // You can also set the relative velocity and facing of that content; the sample
        // hologram is at a fixed point so we only need to indicate its position.
        renderingParameters->SetFocusPoint(currentCoordinateSystem, m_focusPoint);
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 107 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 108 of file HolographicPaintMain.h.

size_t m_clearToolIndex [private]

Definition at line 134 of file HolographicPaintMain.h.

ApplicationMode m_currentMode = ApplicationMode::Drawing [private]

Definition at line 121 of file HolographicPaintMain.h.

unsigned int m_currentSourceId = NoSourceId [private]

Definition at line 122 of file HolographicPaintMain.h.

size_t m_currentToolIndex [private]

Definition at line 123 of file HolographicPaintMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 92 of file HolographicPaintMain.h.

Windows::Foundation::Numerics::float3 m_focusPoint = { 0.0f, 0.0f, 2.0f } [private]

Definition at line 118 of file HolographicPaintMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 98 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_interactionDetectedToken [private]

Definition at line 114 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 109 of file HolographicPaintMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 101 of file HolographicPaintMain.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_referenceFrame [private]

Definition at line 104 of file HolographicPaintMain.h.

std::unique_ptr<RenderingHelper> m_renderingHelper [private]

Definition at line 89 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_sourceDetectedToken [private]

Definition at line 110 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_sourceLostToken [private]

Definition at line 111 of file HolographicPaintMain.h.

std::map<unsigned int, std::shared_ptr<SourceHandler> > m_sourceMap [private]

Definition at line 126 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedToken [private]

Definition at line 112 of file HolographicPaintMain.h.

std::vector<std::shared_ptr<SourceHandler> > m_sources [private]

Definition at line 127 of file HolographicPaintMain.h.

Windows::Foundation::EventRegistrationToken m_sourceUpdatedToken [private]

Definition at line 113 of file HolographicPaintMain.h.

Windows::UI::Input::Spatial::SpatialInteractionManager m_spatialInteractionManager [private]

Definition at line 116 of file HolographicPaintMain.h.

std::vector<std::shared_ptr<IBaseRenderedObject> > m_strokes [private]

Definition at line 130 of file HolographicPaintMain.h.

DX::StepTimer m_timer [private]

Definition at line 95 of file HolographicPaintMain.h.

std::vector<std::shared_ptr<Tool> > m_tools [private]

Definition at line 133 of file HolographicPaintMain.h.

ToolCarousel m_toolsCarousel [private]

Definition at line 135 of file HolographicPaintMain.h.

std::shared_ptr<Whiteboard> m_whiteboard [private]

Definition at line 137 of file HolographicPaintMain.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/HolographicPaintMain.h
  • SpatialInteractionSource/cpp/HolographicPaintMain.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IDPadHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • IDPadHelper
Public Member Functions

IDPadHelper Class Reference

#include "DPadHelper.h"

Inherited by ThumbstickDPadHelper, and TouchpadDPadHelper.

List of all members.

Public Member Functions

virtual DPadAction | SourcePressed (Windows::UI::Input::Spatial::SpatialInteractionPressKind pressKind, Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState)
virtual DPadAction | Update (Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState)

Detailed Description

Definition at line 10 of file DPadHelper.h.

Member Function Documentation

virtual DPadAction SourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionPressKind | pressKind,
 |  | Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^ | controllerState |
 | ) |  |  | [inline, virtual]

Reimplemented in TouchpadDPadHelper.

Definition at line 19 of file DPadHelper.h.

        {
            return DPadAction::None;
        }

virtual DPadAction Update ( Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^ controllerState ) [inline, virtual]

Reimplemented in ThumbstickDPadHelper.

Definition at line 14 of file DPadHelper.h.

        {
            return DPadAction::None;
        }

The documentation for this class was generated from the following file:
  • SpatialInteractionSource/cpp/DPadHelper.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | color
DirectX::XMFLOAT4X4 | model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 color

Definition at line 9 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • SpatialInteractionSource/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RenderingHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • RenderingHelper
Public Member Functions | Private Attributes

RenderingHelper Class Reference

#include "RenderingHelper.h"

List of all members.

Public Member Functions

RenderingHelper (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
virtual void | DrawCube () override
bool | IsLoadingComplete () const
bool | PrepareRendering ()
void | ReleaseDeviceDependentResources ()
virtual void | SetConstantBuffer (ModelConstantBuffer *pModelConstantBuffer) override

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
unsigned int | m_indexCount
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 14 of file RenderingHelper.h.

Constructor & Destructor Documentation

RenderingHelper ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 12 of file RenderingHelper.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 75 of file RenderingHelper.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 1> vertexDesc =
        {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                static_cast<UINT>(vertexDesc.size()),
                fileData.data(),
                static_cast<UINT>(fileData.size()),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
                )
            );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> createCubeTask  = shaderTaskGroup.then([this] ()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the cube size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // cube at a comfortable size we made the cube width 0.2 m (20 cm).
        static const std::array<VertexPosition, 8> cubeVertices =
        {{
            { XMFLOAT3(-0.5f, -0.5f, -0.5f) },
            { XMFLOAT3(-0.5f, -0.5f,  0.5f) },
            { XMFLOAT3(-0.5f,  0.5f, -0.5f) },
            { XMFLOAT3(-0.5f,  0.5f,  0.5f) },
            { XMFLOAT3( 0.5f, -0.5f, -0.5f) },
            { XMFLOAT3( 0.5f, -0.5f,  0.5f) },
            { XMFLOAT3( 0.5f,  0.5f, -0.5f) },
            { XMFLOAT3( 0.5f,  0.5f,  0.5f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem                = cubeVertices.data();
        vertexBufferData.SysMemPitch            = 0;
        vertexBufferData.SysMemSlicePitch       = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPosition) * static_cast<UINT>(cubeVertices.size()), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<VertexIndex_t, 36> cubeIndices =
        {{
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        }};

        m_indexCount = static_cast<unsigned int>(cubeIndices.size());

        D3D11_SUBRESOURCE_DATA indexBufferData  = {0};
        indexBufferData.pSysMem                 = cubeIndices.data();
        indexBufferData.SysMemPitch             = 0;
        indexBufferData.SysMemSlicePitch        = 0;
        CD3D11_BUFFER_DESC indexBufferDesc(sizeof(VertexIndex_t) * static_cast<UINT>(cubeIndices.size()), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    });

    // Once the cube is loaded, the object is ready to be rendered.
    createCubeTask.then([this] ()
    {
        m_loadingComplete = true;
    });
}

void DrawCube ( ) [override, virtual]

Definition at line 247 of file RenderingHelper.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();
    const UINT stride = sizeof(VertexPosition);
    const UINT offset = 0;
    context->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    context->IASetIndexBuffer(m_indexBuffer.Get(), DX::GetDxgiFormat(), 0);
    context->DrawIndexedInstanced(m_indexCount, 2, 0, 0, 0);
}

bool IsLoadingComplete ( ) const [inline]

Definition at line 23 of file RenderingHelper.h.

{ return m_loadingComplete; }

bool PrepareRendering ( )

Definition at line 24 of file RenderingHelper.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return false;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPosition struct.
    const UINT stride = sizeof(VertexPosition);
    const UINT offset = 0;
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );
    return true;
}

void ReleaseDeviceDependentResources ( )

Definition at line 257 of file RenderingHelper.cpp.

{
    m_loadingComplete  = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
}

void SetConstantBuffer ( ModelConstantBuffer * pModelConstantBuffer ) [override, virtual]

Definition at line 18 of file RenderingHelper.cpp.

{
    const auto context = m_deviceResources->GetD3DDeviceContext();
    context->UpdateSubresource(m_modelConstantBuffer.Get(), 0, nullptr, pModelConstantBuffer, 0, 0);
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 34 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 41 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 39 of file RenderingHelper.h.

unsigned int m_indexCount [private]

Definition at line 51 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 37 of file RenderingHelper.h.

bool m_loadingComplete = false [private]

Definition at line 45 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 43 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 42 of file RenderingHelper.h.

bool m_usingVprtShaders = false [private]

Definition at line 49 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 38 of file RenderingHelper.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 40 of file RenderingHelper.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/Content/RenderingHelper.h
  • SpatialInteractionSource/cpp/Content/RenderingHelper.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
bool | Intersects (const Windows::Foundation::Numerics::float3 &origin, const Windows::Foundation::Numerics::float3 &direction, float *distance)
bool | IsValidPosition (const Windows::Foundation::Numerics::float3 &position)
virtual void | Load (Platform::String^entryPoint)
virtual void | Render (ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()
virtual void | Update (ID3D11DeviceContext *pDeviceContext) override
Whiteboard (float width, float height, Windows::Foundation::Numerics::float3 position)

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

DirectX::BoundingBox | m_boundingBox
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
float | m_height
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicPaintMain > 		m_main
ModelConstantBuffer m_modelConstantBufferData
Windows::Foundation::Numerics::float3 m_position
float | m_width
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 9 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
bool Intersects | ( | const Windows::Foundation::Numerics::float3 & | origin,
 |  | const Windows::Foundation::Numerics::float3 & | direction,
 |  | float * | distance
 | ) |  |
bool IsValidPosition ( const Windows::Foundation::Numerics::float3 & position )
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Render | ( | ID3D11DeviceContext * | pDeviceContext,
 |  | IRenderer * | pRenderingHelper |
 | ) |  |  | [override, virtual]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]
virtual void Update ( ID3D11DeviceContext * pDeviceContext ) [override, virtual]
Whiteboard | ( | float | width,
 |  | float | height,
 |  | Windows::Foundation::Numerics::float3 | position
 | ) |  |

Member Data Documentation

DirectX::BoundingBox m_boundingBox [private]

Definition at line 26 of file Whiteboard.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 37 of file AppView.h.

float m_height [private]

Definition at line 22 of file Whiteboard.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 42 of file AppView.h.

std::unique_ptr<HolographicPaintMain> m_main [private]

Definition at line 35 of file AppView.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 24 of file Whiteboard.h.

Windows::Foundation::Numerics::float3 m_position [private]

Definition at line 23 of file Whiteboard.h.

float m_width [private]

Definition at line 21 of file Whiteboard.h.

bool m_windowClosed = false [private]

Definition at line 38 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 39 of file AppView.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/AppView.h
  • SpatialInteractionSource/cpp/Content/Whiteboard.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SourceHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • SourceHandler
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

SourceHandler Class Reference

#include "SourceHandler.h"

Inherited by HandHandler, and SpatialControllerHandler.

List of all members.

Classes

struct | PositionInformation

Public Member Functions

Tool * | GetCurrentTool () const
Windows::Foundation::Numerics::float3 | GetPosition () const
Windows::UI::Input::Spatial::SpatialInteractionSourceKind | GetSourceKind () const
virtual
Windows::Foundation::Numerics::float3 		GetToolPosition () const
virtual
Windows::Foundation::Numerics::float3 		GetToolScale () const
bool | IsPositionCurrent () const
virtual void | OnInteractionDetected (Windows::UI::Input::Spatial::SpatialInteraction^interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
virtual void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)
virtual void | OnSourceUpdated (Windows::UI::Input::Spatial::SpatialInteractionSourceState^state, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
virtual void | Render (ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override
void | SetApplicationMode (ApplicationMode newMode)
void | SetCurrentTool (std::shared_ptr< Tool > tool)
unsigned int | SourceId () const
virtual void | Update (ID3D11DeviceContext *pDeviceContext) override

Static Public Member Functions

static bool | Make (std::shared_ptr< SourceHandler > *handler, Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target)

Protected Member Functions

SourceHandler (Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target)
virtual void | ComposeStroke ()
virtual void | TerminateStroke ()

Protected Attributes

ApplicationMode m_currentMode
std::shared_ptr< Stroke > | m_currentStroke
std::shared_ptr< Tool > | m_currentTool
ISourceCommandHandler * | m_eventsHandler = nullptr
ModelConstantBuffer m_modelConstantBufferData
PositionInformation m_position
bool | m_refreshModelConstantBufferData = true
unsigned int | m_sourceId
Windows::UI::Input::Spatial::SpatialInteractionSourceKind | m_sourceKind
std::shared_ptr< Whiteboard > | m_targetBoard
PositionInformation m_toolPosition

Detailed Description

Definition at line 33 of file SourceHandler.h.

Constructor & Destructor Documentation

SourceHandler | ( | Windows::UI::Input::Spatial::SpatialInteractionSource^ | source,
 |  | ISourceCommandHandler * | eventsHandler,
 |  | std::shared_ptr< Whiteboard > & | target |
 | ) |  |  | [protected]

Member Function Documentation

void ComposeStroke ( ) [protected, virtual]

Definition at line 118 of file SourceHandler.cpp.

{
    if (m_currentTool)
    {
        if (!m_currentStroke)
        {
            m_currentStroke = std::make_shared<Stroke>(m_currentTool->GetColor());
            m_eventsHandler->OnStrokeAdded(this, m_currentStroke);
        }
    }
    m_currentStroke->AddPosition(m_toolPosition.Position, m_toolPosition.Orientation, m_currentTool->GetDiameter());
}

Tool* GetCurrentTool ( ) const [inline]

Definition at line 61 of file SourceHandler.h.

{ return m_currentTool.get(); }

Windows::Foundation::Numerics::float3 GetPosition ( ) const [inline]

Definition at line 57 of file SourceHandler.h.

{ return m_position.Position; }

Windows::UI::Input::Spatial::SpatialInteractionSourceKind GetSourceKind ( ) const [inline]

Definition at line 54 of file SourceHandler.h.

{ return m_sourceKind; }

virtual Windows::Foundation::Numerics::float3 GetToolPosition ( ) const [inline, virtual]

Definition at line 63 of file SourceHandler.h.

        {
            return m_toolPosition.Position;
        }

virtual Windows::Foundation::Numerics::float3 GetToolScale ( ) const [inline, virtual]

Reimplemented in SpatialControllerHandler.

Definition at line 68 of file SourceHandler.h.

        {
            return Windows::Foundation::Numerics::float3(m_currentTool == nullptr ? DefaultControllerScale : m_currentTool->GetDiameter());
        }

bool IsPositionCurrent ( ) const [inline]

Definition at line 56 of file SourceHandler.h.

{ return m_position.IsCurrent; }

static bool Make | ( | std::shared_ptr< SourceHandler > * | handler,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSource^ | source,
 |  | ISourceCommandHandler * | eventsHandler,
 |  | std::shared_ptr< Whiteboard > & | target |
 | ) |  |  | [static]
virtual void OnInteractionDetected | ( | Windows::UI::Input::Spatial::SpatialInteraction^ | interaction,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [inline, virtual]

Reimplemented in HandHandler, and SpatialControllerHandler.

Definition at line 50 of file SourceHandler.h.

{}

virtual void OnSourcePressed ( Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args ) [inline, virtual]

Reimplemented in SpatialControllerHandler.

Definition at line 51 of file SourceHandler.h.

{}

virtual void OnSourceUpdated | ( | Windows::UI::Input::Spatial::SpatialInteractionSourceState^ | state,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [virtual]

Reimplemented in HandHandler, and SpatialControllerHandler.

void Render | ( | ID3D11DeviceContext * | pDeviceContext,
 |  | IRenderer * | pRenderingHelper |
 | ) |  |  | [override, virtual]

Definition at line 102 of file SourceHandler.cpp.

{
    // We do not render the controller until it has been displayed at least once
    if (m_toolPosition.HasValue)
    {
        pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
        pRenderingHelper->DrawCube();
    }
}

void SetApplicationMode ( ApplicationMode newMode ) [inline]

Definition at line 73 of file SourceHandler.h.

        {
            m_currentMode = newMode;
        }

void SetCurrentTool ( std::shared_ptr< Tool > tool )

Definition at line 112 of file SourceHandler.cpp.

{
    m_currentTool = tool;
    m_refreshModelConstantBufferData = true;
}

unsigned int SourceId ( ) const [inline]

Definition at line 53 of file SourceHandler.h.

{ return m_sourceId; }

void TerminateStroke ( ) [protected, virtual]

Definition at line 131 of file SourceHandler.cpp.

{
    m_currentStroke.reset();
}

void Update ( ID3D11DeviceContext * pDeviceContext ) [override, virtual]

Definition at line 65 of file SourceHandler.cpp.

{
    if (m_refreshModelConstantBufferData)
    {
        const XMMATRIX modelRotation = XMMatrixRotationQuaternion(XMLoadQuaternion(&m_toolPosition.Orientation));

        const float3 toolScale = GetToolScale();
        const XMMATRIX modelScale = XMMatrixScaling(toolScale.x, toolScale.y, toolScale.z);

        const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_toolPosition.Position));

        // Multiply to get the transform matrix.
        // Note that this transform does not enforce a particular coordinate system. The calling
        // class is responsible for rendering this content in a consistent manner.
        const XMMATRIX modelTransform = modelScale * modelRotation * modelTranslation;

        // The view and projection matrices are provided by the system; they are associated
        // with holographic cameras, and updated on a per-camera basis.
        // Here, we provide the model transform for the sample hologram. The model transform
        // matrix is transposed to prepare it for the shader.
        XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

        m_refreshModelConstantBufferData = false;
    }

    if (m_toolPosition.IsCurrent)
    {
        m_modelConstantBufferData.color = DX::GetDXColor(m_currentTool->GetColor());
    }
    else
    {
        m_modelConstantBufferData.color = XMFLOAT4(1.0f, .3f, .3f, .3f);
    }

}

Member Data Documentation

ApplicationMode m_currentMode [protected]

Definition at line 82 of file SourceHandler.h.

std::shared_ptr<Stroke> m_currentStroke [protected]

Definition at line 116 of file SourceHandler.h.

std::shared_ptr<Tool> m_currentTool [protected]

Definition at line 105 of file SourceHandler.h.

ISourceCommandHandler* m_eventsHandler = nullptr [protected]

Definition at line 111 of file SourceHandler.h.

ModelConstantBuffer m_modelConstantBufferData [protected]

Definition at line 109 of file SourceHandler.h.

PositionInformation m_position [protected]

Definition at line 97 of file SourceHandler.h.

bool m_refreshModelConstantBufferData = true [protected]

Definition at line 108 of file SourceHandler.h.

unsigned int m_sourceId [protected]

Definition at line 79 of file SourceHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceKind m_sourceKind [protected]

Definition at line 80 of file SourceHandler.h.

std::shared_ptr<Whiteboard> m_targetBoard [protected]

Definition at line 118 of file SourceHandler.h.

PositionInformation m_toolPosition [protected]

Definition at line 102 of file SourceHandler.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/SourceHandler.h
  • SpatialInteractionSource/cpp/SourceHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SourceHandler::PositionInformation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • SourceHandler
  • SourceHandler::PositionInformation
Public Member Functions | Public Attributes

SourceHandler::PositionInformation Struct Reference

#include "SourceHandler.h"

List of all members.

Public Member Functions

void | CheckIfObsolete (long long now)

Public Attributes

bool | HasValue = false
bool | IsCurrent = false
long long | LastValueTime = 0
Windows::Foundation::Numerics::quaternion | Orientation = Windows::Foundation::Numerics::quaternion::identity()
Windows::Foundation::Numerics::float3 | Position = Windows::Foundation::Numerics::float3::zero()

Detailed Description

Definition at line 84 of file SourceHandler.h.

Member Function Documentation

void CheckIfObsolete ( long long now )

Definition at line 21 of file SourceHandler.cpp.

{
    if (IsCurrent)
    {
        LastValueTime = now;
    }
    else if (HasValue && (now - LastValueTime > TrackingTimeout))
    {
        HasValue = false;
    }
}

Member Data Documentation

bool HasValue = false

Definition at line 86 of file SourceHandler.h.

bool IsCurrent = false

Definition at line 87 of file SourceHandler.h.

long long LastValueTime = 0

Definition at line 90 of file SourceHandler.h.

Windows::Foundation::Numerics::quaternion Orientation = Windows::Foundation::Numerics::quaternion::identity()

Definition at line 89 of file SourceHandler.h.

Windows::Foundation::Numerics::float3 Position = Windows::Foundation::Numerics::float3::zero()

Definition at line 88 of file SourceHandler.h.

The documentation for this struct was generated from the following files:
  • SpatialInteractionSource/cpp/SourceHandler.h
  • SpatialInteractionSource/cpp/SourceHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialControllerHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • SpatialControllerHandler
Public Member Functions | Protected Member Functions | Protected Attributes

SpatialControllerHandler Class Reference

#include "SpatialControllerHandler.h"

Inherits HolographicPaint::SourceHandler.

List of all members.

Public Member Functions

SpatialControllerHandler (Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target)
~SpatialControllerHandler ()
virtual
Windows::Foundation::Numerics::float3 		GetToolScale () const override
virtual void | OnInteractionDetected (Windows::UI::Input::Spatial::SpatialInteraction^interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override
virtual void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) override
virtual void | OnSourceUpdated (Windows::UI::Input::Spatial::SpatialInteractionSourceState^state, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override
void | TryGetContinousBuzz (Windows::Devices::Haptics::SimpleHapticsController^controller)

Protected Member Functions

void | OnTapped (Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs^args)

Protected Attributes

Windows::UI::Input::Spatial::SpatialGestureRecognizer | m_gestureRecognizer
Windows::Devices::Haptics::SimpleHapticsControllerFeedback | m_hapticsBuzzFeedback
Windows::Devices::Haptics::SimpleHapticsController | m_hapticsController
bool | m_insideTargetBoard = false
std::shared_ptr< IDPadHelper > | m_spDPadHelper
bool | m_strokeInsideTargetBoard = false
Windows::Foundation::EventRegistrationToken | m_tappedToken
bool | m_waitForRelease = false

Detailed Description

Definition at line 7 of file SpatialControllerHandler.h.

Constructor & Destructor Documentation

SpatialControllerHandler | ( | Windows::UI::Input::Spatial::SpatialInteractionSource^ | source,
 |  | ISourceCommandHandler * | eventsHandler,
 |  | std::shared_ptr< Whiteboard > & | target
 | ) |  |
~SpatialControllerHandler ( )

Definition at line 42 of file SpatialControllerHandler.cpp.

{
    m_gestureRecognizer->Tapped -= m_tappedToken;
}

Member Function Documentation

float3 GetToolScale ( ) const [override, virtual]

Reimplemented from SourceHandler.

Definition at line 47 of file SpatialControllerHandler.cpp.

{
    if (m_currentTool == nullptr)
    {
        return float3(DefaultControllerScale);
    }
    // Make the tool almost flat (5mm) as we are joinging squares when drawing
    return float3(m_currentTool->GetDiameter(), 0.005f, m_currentTool->GetDiameter());
}

virtual void OnInteractionDetected | ( | Windows::UI::Input::Spatial::SpatialInteraction^ | interaction,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [override, virtual]

Reimplemented from SourceHandler.

virtual void OnSourcePressed ( Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args ) [override, virtual]

Reimplemented from SourceHandler.

virtual void OnSourceUpdated | ( | Windows::UI::Input::Spatial::SpatialInteractionSourceState^ | state,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem |
 | ) |  |  | [override, virtual]

Reimplemented from SourceHandler.

void OnTapped | ( | Windows::UI::Input::Spatial::SpatialGestureRecognizer^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialTappedEventArgs^ | args |
 | ) |  |  | [protected]
void TryGetContinousBuzz ( Windows::Devices::Haptics::SimpleHapticsController^ controller )

Member Data Documentation

Windows::UI::Input::Spatial::SpatialGestureRecognizer m_gestureRecognizer [protected]

Definition at line 30 of file SpatialControllerHandler.h.

Windows::Devices::Haptics::SimpleHapticsControllerFeedback m_hapticsBuzzFeedback [protected]

Definition at line 28 of file SpatialControllerHandler.h.

Windows::Devices::Haptics::SimpleHapticsController m_hapticsController [protected]

Definition at line 27 of file SpatialControllerHandler.h.

bool m_insideTargetBoard = false [protected]

Definition at line 22 of file SpatialControllerHandler.h.

std::shared_ptr<IDPadHelper> m_spDPadHelper [protected]

Definition at line 26 of file SpatialControllerHandler.h.

bool m_strokeInsideTargetBoard = false [protected]

Definition at line 23 of file SpatialControllerHandler.h.

Windows::Foundation::EventRegistrationToken m_tappedToken [protected]

Definition at line 31 of file SpatialControllerHandler.h.

bool m_waitForRelease = false [protected]

Definition at line 24 of file SpatialControllerHandler.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/SpatialControllerHandler.h
  • SpatialInteractionSource/cpp/SpatialControllerHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Stroke Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • Stroke
Classes | Public Member Functions | Private Attributes

Stroke Class Reference

#include "Stroke.h"

List of all members.

Classes

struct | Square

Public Member Functions

Stroke (Windows::UI::Color color)
void | AddPosition (Windows::Foundation::Numerics::float3 position, Windows::Foundation::Numerics::quaternion orientation, float diameter)
virtual void | Render (ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override
virtual void | Update (ID3D11DeviceContext *pDeviceContext) override

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
ModelConstantBuffer m_modelConstantBufferData
bool | m_resetBuffers = true
std::vector< Square > | m_squares
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer

Detailed Description

Definition at line 11 of file Stroke.h.

Constructor & Destructor Documentation

Stroke ( Windows::UI::Color color )

Definition at line 11 of file Stroke.cpp.

{
    m_modelConstantBufferData.color = DX::GetDXColor(color);
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixIdentity());
}

Member Function Documentation

void AddPosition | ( | Windows::Foundation::Numerics::float3 | position,
 |  | Windows::Foundation::Numerics::quaternion | orientation,
 |  | float | diameter
 | ) |  |
void Render | ( | ID3D11DeviceContext * | pDeviceContext,
 |  | IRenderer * | pRenderingHelper |
 | ) |  |  | [override, virtual]

Definition at line 117 of file Stroke.cpp.

{
    if (m_squares.size() > 0)
    {
        const UINT stride = sizeof(VertexPosition);
        const UINT offset = 0;
        pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
        pDeviceContext->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
        pDeviceContext->IASetIndexBuffer(m_indexBuffer.Get(), DX::GetDxgiFormat(), 0);
        pDeviceContext->DrawIndexedInstanced(m_indexCount, 2, 0, 0, 0);
    }
}

void Update ( ID3D11DeviceContext * pDeviceContext ) [override, virtual]

Definition at line 36 of file Stroke.cpp.

{
    if (m_resetBuffers)
    {
        if (m_squares.size() > 0)
        {
            Microsoft::WRL::ComPtr<ID3D11Device> spDevice;
            pDeviceContext->GetDevice(spDevice.ReleaseAndGetAddressOf());
            std::vector<VertexPosition> vertices;
            for (auto& it : m_squares)
            {
                vertices.push_back({ it.TopLeft });
                vertices.push_back({ it.TopRight });
                vertices.push_back({ it.BottomRight });
                vertices.push_back({ it.BottomLeft });
            }

            D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
            vertexBufferData.pSysMem = vertices.data();
            vertexBufferData.SysMemPitch = 0;
            vertexBufferData.SysMemSlicePitch = 0;
            const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPosition) * static_cast<UINT>(vertices.size()), D3D11_BIND_VERTEX_BUFFER);
            DX::ThrowIfFailed(
                spDevice->CreateBuffer(
                    &vertexBufferDesc,
                    &vertexBufferData,
                    m_vertexBuffer.ReleaseAndGetAddressOf()
                )
            );

            std::vector<VertexIndex_t> indices;
            auto makeSquare = [&indices](VertexIndex_t tl, VertexIndex_t tr, VertexIndex_t br, VertexIndex_t bl)
            {
                indices.push_back(tl); indices.push_back(tr); indices.push_back(br);
                indices.push_back(tl); indices.push_back(br); indices.push_back(bl);
            };
            // Back face
            makeSquare(1, 0, 3, 2);
            // Front face
            VertexIndex_t start = static_cast<VertexIndex_t>(4 * (m_squares.size() - 1));
            makeSquare(start, start + 1, start + 2, start + 3);
            // Now, sides
            unsigned int sidesCount = static_cast<unsigned int>(m_squares.size() - 1);
            for (unsigned int sideIndex = 0; sideIndex < sidesCount; sideIndex++)
            {
                start = static_cast<VertexIndex_t>(4 * sideIndex);
                // +0 = back / top / left
                // +1 = back / top / right
                // +2 = back / bottom / right
                // +3 = back / bottom / left
                // +4 = front / top / left
                // +5 = front / top / right
                // +6 = front / bottom / right
                // +7 = front / bottom / left

                makeSquare(start + 0, start + 1, start + 5, start + 4); // Top
                makeSquare(start + 5, start + 1, start + 2, start + 6); // Right
                makeSquare(start + 0, start + 4, start + 7, start + 3); // Left
                makeSquare(start + 7, start + 6, start + 2, start + 3); // Bottom
            }

            m_indexCount = static_cast<unsigned int>(indices.size());

            D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
            indexBufferData.pSysMem = indices.data();
            indexBufferData.SysMemPitch = 0;
            indexBufferData.SysMemSlicePitch = 0;
            CD3D11_BUFFER_DESC indexBufferDesc(sizeof(VertexIndex_t) * static_cast<UINT>(indices.size()), D3D11_BIND_INDEX_BUFFER);
            DX::ThrowIfFailed(
                spDevice->CreateBuffer(
                    &indexBufferDesc,
                    &indexBufferData,
                    m_indexBuffer.ReleaseAndGetAddressOf()
                )
            );
        }
        m_resetBuffers = false;
    }
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 33 of file Stroke.h.

uint32 m_indexCount = 0 [private]

Definition at line 34 of file Stroke.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 24 of file Stroke.h.

bool m_resetBuffers = true [private]

Definition at line 35 of file Stroke.h.

std::vector<Square> m_squares [private]

Definition at line 31 of file Stroke.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 32 of file Stroke.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/Content/Stroke.h
  • SpatialInteractionSource/cpp/Content/Stroke.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Stroke::Square Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • Stroke
  • Stroke::Square
Public Attributes

Stroke::Square Struct Reference

List of all members.

Public Attributes

DirectX::XMFLOAT3 | BottomLeft
DirectX::XMFLOAT3 | BottomRight
DirectX::XMFLOAT3 | TopLeft
DirectX::XMFLOAT3 | TopRight

Detailed Description

Definition at line 26 of file Stroke.h.

Member Data Documentation

DirectX::XMFLOAT3 BottomLeft

Definition at line 28 of file Stroke.h.

DirectX::XMFLOAT3 BottomRight

Definition at line 28 of file Stroke.h.

DirectX::XMFLOAT3 TopLeft

Definition at line 28 of file Stroke.h.

DirectX::XMFLOAT3 TopRight

Definition at line 28 of file Stroke.h.

The documentation for this struct was generated from the following file:
  • SpatialInteractionSource/cpp/Content/Stroke.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ThumbstickDPadHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • ThumbstickDPadHelper
Public Member Functions | Private Attributes

ThumbstickDPadHelper Class Reference

#include "DPadHelper.h"

Inherits HolographicPaint::IDPadHelper.

List of all members.

Public Member Functions

ThumbstickDPadHelper (double threshold=.5)
virtual DPadAction | Update (Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) override

Private Attributes

double | m_threshold
bool | m_waitForCenter

Detailed Description

Definition at line 25 of file DPadHelper.h.

Constructor & Destructor Documentation

ThumbstickDPadHelper ( double threshold = .5 )

Definition at line 50 of file DPadHelper.cpp.

    : m_threshold(threshold), m_waitForCenter(false)
{
}

Member Function Documentation

virtual DPadAction Update ( Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^ controllerState ) [override, virtual]

Reimplemented from IDPadHelper.

Member Data Documentation

double m_threshold [private]

Definition at line 35 of file DPadHelper.h.

bool m_waitForCenter [private]

Definition at line 34 of file DPadHelper.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/DPadHelper.h
  • SpatialInteractionSource/cpp/DPadHelper.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Tool Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • Tool
Public Member Functions | Protected Attributes

Tool Class Reference

#include "Tool.h"

Inherited by ClearTool.

List of all members.

Public Member Functions

Tool (Windows::UI::Color color, float diameter)
Windows::UI::Color | GetColor () const
float | GetDiameter () const
virtual void | Render (ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override
void | SetOrientation (Windows::Foundation::Numerics::quaternion orientation)
void | SetPosition (Windows::Foundation::Numerics::float3 position)
virtual void | Update (ID3D11DeviceContext *pDeviceContext) override

Protected Attributes

Windows::UI::Color | m_color
float | m_diameter
ModelConstantBuffer m_modelConstantBufferData
Windows::Foundation::Numerics::quaternion | m_orientation
Windows::Foundation::Numerics::float3 m_position
bool | m_refreshModelConstantBufferData = true

Detailed Description

Definition at line 11 of file Tool.h.

Constructor & Destructor Documentation

Tool | ( | Windows::UI::Color | color,
 |  | float | diameter
 | ) |  |

Definition at line 10 of file Tool.cpp.

    : m_color(color), m_diameter(diameter)
{
    m_modelConstantBufferData.color = DX::GetDXColor(color);
}

Member Function Documentation

Windows::UI::Color GetColor ( ) const [inline]

Definition at line 19 of file Tool.h.

{ return m_color; }

float GetDiameter ( ) const [inline]

Definition at line 20 of file Tool.h.

{ return m_diameter; }

void Render | ( | ID3D11DeviceContext * | pDeviceContext,
 |  | IRenderer * | pRenderingHelper |
 | ) |  |  | [override, virtual]

Reimplemented in ClearTool.

Definition at line 53 of file Tool.cpp.

{
    pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
    pRenderingHelper->DrawCube();
}

void SetOrientation ( Windows::Foundation::Numerics::quaternion orientation )
void SetPosition ( Windows::Foundation::Numerics::float3 position )
void Update ( ID3D11DeviceContext * pDeviceContext ) [override, virtual]

Reimplemented in ClearTool.

Definition at line 28 of file Tool.cpp.

{
    if (m_refreshModelConstantBufferData)
    {
        const XMMATRIX modelRotation = XMMatrixRotationQuaternion(XMLoadQuaternion(&m_orientation));

        const XMMATRIX modelScale = XMMatrixScaling(m_diameter, m_diameter, max(m_diameter, .01f));
        // Position the cube.
        const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

        // Multiply to get the transform matrix.
        // Note that this transform does not enforce a particular coordinate system. The calling
        // class is responsible for rendering this content in a consistent manner.
        const XMMATRIX modelTransform = modelScale * modelRotation * modelTranslation;

        // The view and projection matrices are provided by the system; they are associated
        // with holographic cameras, and updated on a per-camera basis.
        // Here, we provide the model transform for the sample hologram. The model transform
        // matrix is transposed to prepare it for the shader.
        XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

        m_refreshModelConstantBufferData = false;
    }
}

Member Data Documentation

Windows::UI::Color m_color [protected]

Definition at line 28 of file Tool.h.

float m_diameter [protected]

Definition at line 27 of file Tool.h.

ModelConstantBuffer m_modelConstantBufferData [protected]

Definition at line 33 of file Tool.h.

Windows::Foundation::Numerics::quaternion m_orientation [protected]

Definition at line 30 of file Tool.h.

Windows::Foundation::Numerics::float3 m_position [protected]

Definition at line 29 of file Tool.h.

bool m_refreshModelConstantBufferData = true [protected]

Definition at line 32 of file Tool.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/Content/Tool.h
  • SpatialInteractionSource/cpp/Content/Tool.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToolCarousel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • ToolCarousel
Public Member Functions | Private Attributes

ToolCarousel Class Reference

#include "ToolCarousel.h"

List of all members.

Public Member Functions

void | ArrangeTools (std::vector< std::shared_ptr< Tool >> &tools, size_t selectedIndex, double baseAngle=0.0)
bool | IsRotating () const
void | SetPosition (Windows::Foundation::Numerics::float3 center, Windows::Foundation::Numerics::float3 radius, Windows::Foundation::Numerics::float3 rotationAxis)
void | StartRotation (RotationDirection rotationDirection, const DX::StepTimer &timer)
void | Update (std::vector< std::shared_ptr< Tool >> &tools, size_t &selectedIndex, const DX::StepTimer &timer)

Private Attributes

Windows::Foundation::Numerics::float3 m_center
bool | m_isRotating = false
Windows::Foundation::Numerics::float3 m_radius
Windows::Foundation::Numerics::float3 m_rotationAxis
RotationDirection m_rotationDirection
double | m_rotationStart = 0.0

Detailed Description

Definition at line 11 of file ToolCarousel.h.

Member Function Documentation

void ArrangeTools | ( | std::vector< std::shared_ptr< Tool >> & | tools,
 |  | size_t | selectedIndex,
 |  | double | baseAngle = 0.0
 | ) |  |

Definition at line 20 of file ToolCarousel.cpp.

{
    const XMVECTOR radiusVector = XMLoadFloat3(&m_radius);
    const XMVECTOR rotationAxisVector = XMLoadFloat3(&m_rotationAxis);

    const size_t toolsCount = tools.size();
    for (size_t idx = 0; idx < toolsCount; ++idx)
    {
        // First controller is oriented towards the user
        const size_t angleIndex = idx + toolsCount - selectedIndex;
        const double angle = baseAngle + M_PI + (2.0 * M_PI * static_cast<double>(angleIndex) / static_cast<double>(toolsCount));

        const XMMATRIX rotationMatrix = XMMatrixRotationAxis(rotationAxisVector, static_cast<float>(angle));

        float3 toolOffset;
        XMStoreFloat3(&toolOffset, XMVector3Transform(radiusVector, rotationMatrix));
        tools[idx]->SetPosition(m_center + toolOffset);
    }
}

bool IsRotating ( ) const [inline]

Definition at line 25 of file ToolCarousel.h.

{ return m_isRotating; }

void SetPosition | ( | Windows::Foundation::Numerics::float3 | center,
 |  | Windows::Foundation::Numerics::float3 | radius,
 |  | Windows::Foundation::Numerics::float3 | rotationAxis
 | ) |  |
void StartRotation | ( | RotationDirection | rotationDirection,
 |  | const DX::StepTimer & | timer
 | ) |  |

Definition at line 40 of file ToolCarousel.cpp.

{
    m_isRotating = true;
    m_rotationStart = timer.GetTotalSeconds();
    m_rotationDirection = rotationDirection;
}

void Update | ( | std::vector< std::shared_ptr< Tool >> & | tools,
 |  | size_t & | selectedIndex,
 |  | const DX::StepTimer & | timer
 | ) |  |

Definition at line 47 of file ToolCarousel.cpp.

{
    if (m_isRotating)
    {
        double elapsed = timer.GetTotalSeconds() - m_rotationStart;
        if (elapsed > RotationTimeInSeconds)
        {
            m_isRotating = false;
            selectedIndex = (selectedIndex + tools.size() + static_cast<int>(m_rotationDirection)) % tools.size();
        }
        else
        {
            double baseAngle = -static_cast<double>(m_rotationDirection) * (elapsed / RotationTimeInSeconds) * (M_PI * 2.0 / static_cast<double>(tools.size()));
            ArrangeTools(tools, selectedIndex, baseAngle);
        }
    }
}

Member Data Documentation

Windows::Foundation::Numerics::float3 m_center [private]

Definition at line 28 of file ToolCarousel.h.

bool m_isRotating = false [private]

Definition at line 32 of file ToolCarousel.h.

Windows::Foundation::Numerics::float3 m_radius [private]

Definition at line 29 of file ToolCarousel.h.

Windows::Foundation::Numerics::float3 m_rotationAxis [private]

Definition at line 30 of file ToolCarousel.h.

RotationDirection m_rotationDirection [private]

Definition at line 33 of file ToolCarousel.h.

double m_rotationStart = 0.0 [private]

Definition at line 34 of file ToolCarousel.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/Content/ToolCarousel.h
  • SpatialInteractionSource/cpp/Content/ToolCarousel.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchpadDPadHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • TouchpadDPadHelper
Public Member Functions | Private Attributes

TouchpadDPadHelper Class Reference

#include "DPadHelper.h"

Inherits HolographicPaint::IDPadHelper.

List of all members.

Public Member Functions

TouchpadDPadHelper (double threshold=.3)
virtual DPadAction | SourcePressed (Windows::UI::Input::Spatial::SpatialInteractionPressKind pressKind, Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) override

Private Attributes

double | m_threshold

Detailed Description

Definition at line 38 of file DPadHelper.h.

Constructor & Destructor Documentation

TouchpadDPadHelper ( double threshold = .3 )

Definition at line 72 of file DPadHelper.cpp.

    : m_threshold(threshold)
{
}

Member Function Documentation

virtual DPadAction SourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionPressKind | pressKind,
 |  | Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^ | controllerState |
 | ) |  |  | [override, virtual]

Reimplemented from IDPadHelper.

Member Data Documentation

double m_threshold [private]

Definition at line 49 of file DPadHelper.h.

The documentation for this class was generated from the following files:
  • SpatialInteractionSource/cpp/DPadHelper.h
  • SpatialInteractionSource/cpp/DPadHelper.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicPaint
  • VertexPosition
Public Attributes

VertexPosition Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 pos

Detailed Description

Definition at line 17 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 pos

Definition at line 19 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • SpatialInteractionSource/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMappingMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialMapping
  • HolographicSpatialMappingMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicSpatialMappingMain Class Reference

#include "HolographicSpatialMappingMain.h"

List of all members.

Public Member Functions

HolographicSpatialMappingMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicSpatialMappingMain ()
void | LoadAppState ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | OnSurfacesChanged (Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver^sender, Platform::Object^args)
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnPositionalTrackingDeactivating (Windows::Perception::Spatial::SpatialLocator^sender, Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs^args)
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_drawWireframe = true
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Windows::Perception::Spatial::SpatialLocator | m_locator
Windows::Foundation::EventRegistrationToken | m_positionalTrackingDeactivatingToken
Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference | m_referenceFrame
bool | m_spatialPerceptionAccessRequested = false
bool | m_surfaceAccessAllowed = false
Windows::Perception::Spatial::Surfaces::SpatialSurfaceMeshOptions | m_surfaceMeshOptions
Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver | m_surfaceObserver
Windows::Foundation::EventRegistrationToken | m_surfacesChangedToken
DX::StepTimer m_timer

Detailed Description

Definition at line 31 of file HolographicSpatialMappingMain.h.

Constructor & Destructor Documentation

HolographicSpatialMappingMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 38 of file HolographicSpatialMappingMain.cpp.

                                                             :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~HolographicSpatialMappingMain ( )

Definition at line 143 of file HolographicSpatialMappingMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

void LoadAppState ( )

Definition at line 436 of file HolographicSpatialMappingMain.cpp.

{
    // This sample does not persist any state between sessions.
}

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 443 of file HolographicSpatialMappingMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_meshRenderer->ReleaseDeviceDependentResources();
#endif
}

void OnDeviceRestored ( ) [virtual]

Definition at line 452 of file HolographicSpatialMappingMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_meshRenderer->CreateDeviceDependentResources();
#endif
}

void OnPositionalTrackingDeactivating | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs^ | args |
 | ) |  |  | [private]
void OnSurfacesChanged | ( | Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver^ | sender,
 |  | Platform::Object^ | args
 | ) |  |
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )
void SaveAppState ( )

Definition at line 431 of file HolographicSpatialMappingMain.cpp.

{
    // This sample does not persist any state between sessions.
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 113 of file HolographicSpatialMappingMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->PositionalTrackingDeactivating -= m_positionalTrackingDeactivatingToken;
    }

    if (m_surfaceObserver != nullptr)
    {
        m_surfaceObserver->ObservedSurfacesChanged -= m_surfacesChangedToken;
    }
}

HolographicFrame Update ( )

Definition at line 194 of file HolographicSpatialMappingMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);

    // Only create a surface observer when you need to - do not create a new one each frame.
    if (m_surfaceObserver == nullptr)
    {
        // Initialize the Surface Observer using a valid coordinate system.
        if (!m_spatialPerceptionAccessRequested)
        {
            // The spatial mapping API reads information about the user's environment. The user must
            // grant permission to the app to use this capability of the Windows Holographic device.
            auto initSurfaceObserverTask = create_task(SpatialSurfaceObserver::RequestAccessAsync());
            initSurfaceObserverTask.then([this, currentCoordinateSystem](Windows::Perception::Spatial::SpatialPerceptionAccessStatus status)
            {
                switch (status)
                {
                case SpatialPerceptionAccessStatus::Allowed:
                    m_surfaceAccessAllowed = true;
                    break;
                default:
                    // Access was denied. This usually happens because your AppX manifest file does not declare the
                    // spatialPerception capability.
                    // For info on what else can cause this, see: http://msdn.microsoft.com/library/windows/apps/mt621422.aspx
                    m_surfaceAccessAllowed = false;
                    break;
                }
            });

            m_spatialPerceptionAccessRequested = true;
        }
    }

    if (m_surfaceAccessAllowed)
    {
        SpatialBoundingBox axisAlignedBoundingBox =
        {
            {  0.f,  0.f, 0.f },
            { 20.f, 20.f, 5.f },
        };
        SpatialBoundingVolume^ bounds = SpatialBoundingVolume::FromBox(currentCoordinateSystem, axisAlignedBoundingBox);

        // If status is Allowed, we can create the surface observer.
        if (m_surfaceObserver == nullptr)
        {
            // First, we'll set up the surface observer to use our preferred data formats.
            // In this example, a "preferred" format is chosen that is compatible with our precompiled shader pipeline.
            m_surfaceMeshOptions = ref new SpatialSurfaceMeshOptions();
            IVectorView<DirectXPixelFormat>^ supportedVertexPositionFormats = m_surfaceMeshOptions->SupportedVertexPositionFormats;
            unsigned int formatIndex = 0;
            if (supportedVertexPositionFormats->IndexOf(DirectXPixelFormat::R16G16B16A16IntNormalized, &formatIndex))
            {
                m_surfaceMeshOptions->VertexPositionFormat = DirectXPixelFormat::R16G16B16A16IntNormalized;
            }
            IVectorView<DirectXPixelFormat>^ supportedVertexNormalFormats = m_surfaceMeshOptions->SupportedVertexNormalFormats;
            if (supportedVertexNormalFormats->IndexOf(DirectXPixelFormat::R8G8B8A8IntNormalized, &formatIndex))
            {
                m_surfaceMeshOptions->VertexNormalFormat = DirectXPixelFormat::R8G8B8A8IntNormalized;
            }

            // If you are using a very high detail setting with spatial mapping, it can be beneficial
            // to use a 32-bit unsigned integer format for indices instead of the default 16-bit.
            // Uncomment the following code to enable 32-bit indices.
            //IVectorView<DirectXPixelFormat>^ supportedTriangleIndexFormats = m_surfaceMeshOptions->SupportedTriangleIndexFormats;
            //if (supportedTriangleIndexFormats->IndexOf(DirectXPixelFormat::R32UInt, &formatIndex))
            //{
            //    m_surfaceMeshOptions->TriangleIndexFormat = DirectXPixelFormat::R32UInt;
            //}

            // Create the observer.
            m_surfaceObserver = ref new SpatialSurfaceObserver();
            if (m_surfaceObserver)
            {
                m_surfaceObserver->SetBoundingVolume(bounds);

                // If the surface observer was successfully created, we can initialize our
                // collection by pulling the current data set.
                auto mapContainingSurfaceCollection = m_surfaceObserver->GetObservedSurfaces();
                for (auto const& pair : mapContainingSurfaceCollection)
                {
                    // Store the ID and metadata for each surface.
                    auto const& id = pair->Key;
                    auto const& surfaceInfo = pair->Value;
                    m_meshRenderer->AddSurface(id, surfaceInfo);
                }

                // We then subcribe to an event to receive up-to-date data.
                m_surfacesChangedToken = m_surfaceObserver->ObservedSurfacesChanged +=
                    ref new TypedEventHandler<SpatialSurfaceObserver^, Platform::Object^>(
                        bind(&HolographicSpatialMappingMain::OnSurfacesChanged, this, _1, _2)
                        );
            }
        }

        // Keep the surface observer positioned at the device's location.
        m_surfaceObserver->SetBoundingVolume(bounds);

        // Note that it is possible to set multiple bounding volumes. Pseudocode:
        //     m_surfaceObserver->SetBoundingVolumes(/* iterable collection of bounding volumes*/);
        //
        // It is also possible to use other bounding shapes - such as a view frustum. Pseudocode:
        //     SpatialBoundingVolume^ bounds = SpatialBoundingVolume::FromFrustum(coordinateSystem, viewFrustum);
        //     m_surfaceObserver->SetBoundingVolume(bounds);
    }

#ifdef DRAW_SAMPLE_CONTENT
    // Check for new input state since the last frame.
    SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
    if (pointerState != nullptr)
    {
        // When a Pressed gesture is detected, the rendering mode will be changed to wireframe.
        m_drawWireframe = !m_drawWireframe;
    }
#endif

    m_timer.Tick([&] ()
    {
#ifdef DRAW_SAMPLE_CONTENT
        m_meshRenderer->Update(m_timer, currentCoordinateSystem);
#endif
    });

    // This sample uses default image stabilization settings, and does not set the focus point.

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 104 of file HolographicSpatialMappingMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 105 of file HolographicSpatialMappingMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 89 of file HolographicSpatialMappingMain.h.

bool m_drawWireframe = true [private]

Definition at line 120 of file HolographicSpatialMappingMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 95 of file HolographicSpatialMappingMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 98 of file HolographicSpatialMappingMain.h.

Windows::Foundation::EventRegistrationToken m_positionalTrackingDeactivatingToken [private]

Definition at line 106 of file HolographicSpatialMappingMain.h.

Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference m_referenceFrame [private]

Definition at line 101 of file HolographicSpatialMappingMain.h.

bool m_spatialPerceptionAccessRequested = false [private]

Definition at line 113 of file HolographicSpatialMappingMain.h.

bool m_surfaceAccessAllowed = false [private]

Definition at line 110 of file HolographicSpatialMappingMain.h.

Windows::Perception::Spatial::Surfaces::SpatialSurfaceMeshOptions m_surfaceMeshOptions [private]

Definition at line 117 of file HolographicSpatialMappingMain.h.

Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver m_surfaceObserver [private]

Definition at line 116 of file HolographicSpatialMappingMain.h.

Windows::Foundation::EventRegistrationToken m_surfacesChangedToken [private]

Definition at line 107 of file HolographicSpatialMappingMain.h.

DX::StepTimer m_timer [private]

Definition at line 92 of file HolographicSpatialMappingMain.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.h
  • HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialMapping
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicSpatialMappingMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 20 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 48 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 53 of file AppView.h.

std::unique_ptr<HolographicSpatialMappingMain> m_main [private]

Definition at line 46 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 49 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 50 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicSpatialMapping/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialMapping
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 18 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 23 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );
}

~SpatialInputHandler ( )

Definition at line 37 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 46 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 33 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 36 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 39 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialMapping/cpp/Content/SpatialInputHandler.h
  • HolographicSpatialMapping/cpp/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStageMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • HolographicSpatialStageMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicSpatialStageMain Class Reference

#include "HolographicSpatialStageMain.h"

List of all members.

Public Member Functions

HolographicSpatialStageMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicSpatialStageMain ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Foundation::EventRegistrationToken | m_gamepadAddedEventToken
Windows::Foundation::EventRegistrationToken | m_gamepadRemovedEventToken
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
std::shared_ptr< SceneController > | m_sceneController
std::shared_ptr
< SpatialStageManager > 		m_spatialStageManager
DX::StepTimer m_timer

Detailed Description

Definition at line 12 of file HolographicSpatialStageMain.h.

Constructor & Destructor Documentation

HolographicSpatialStageMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file HolographicSpatialStageMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~HolographicSpatialStageMain ( )

Definition at line 109 of file HolographicSpatialStageMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 247 of file HolographicSpatialStageMain.cpp.

{
    m_sceneController->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 254 of file HolographicSpatialStageMain.cpp.

{
    m_sceneController->CreateDeviceDependentResources();
}

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 155 of file HolographicSpatialStageMain.cpp.

{
    // Don't try to render anything before the first Update.
    if (m_timer.GetFrameCount() == 0)
    {
        return false;
    }

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            SpatialCoordinateSystem^ currentCoordinateSystem = m_spatialStageManager->GetCoordinateSystemForCurrentStage();
            if (currentCoordinateSystem != nullptr)
            {
                pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, currentCoordinateSystem);
            }

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

            // Only render world-locked content when positional tracking is active.
            if (cameraActive)
            {
                // Draw the sample hologram.
                m_sceneController->Render();

                // We complete the frame by using the depth buffer to optimize image stabilization.
                ComPtr<ID3D11Texture2D> depthBuffer = cameraResourceMap.at(cameraPose->HolographicCamera->Id)->GetDepthBufferTexture2D();

                // The depth buffer might be stereo, so we take the first subresource.
                // This should also work for mono cameras.
                ComPtr<IDXGIResource1> depthStencilResource;
                HRESULT hr = depthBuffer.As(&depthStencilResource);
                ComPtr<IDXGISurface2> depthDxgiSurface;
                if (SUCCEEDED(hr))
                {
                    hr = depthStencilResource->CreateSubresourceSurface(0, &depthDxgiSurface);
                }

                if (SUCCEEDED(hr))
                {
                    IDirect3DSurface^ depthD3DSurface = CreateDirect3DSurface(depthDxgiSurface.Get());
                    auto renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);
                    try
                    {
                        // Provide the depth buffer.
                        renderingParameters->CommitDirect3D11DepthBuffer(depthD3DSurface);
                    }
                    catch (Platform::InvalidArgumentException^ ex)
                    {
                        OutputDebugStringA("Unsupported depth buffer format, invalid properties, or incorrect D3D device.\n");
                    }
                }

                atLeastOneCameraRendered = true;
            }
        }

        return atLeastOneCameraRendered;
    });
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 83 of file HolographicSpatialStageMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    auto locator = SpatialLocator::GetDefault();
    if (locator != nullptr)
    {
        locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }
}

HolographicFrame Update ( )

Definition at line 118 of file HolographicSpatialStageMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem = m_spatialStageManager->GetCoordinateSystemForCurrentStage();

    m_timer.Tick([&]()
    {
        m_sceneController->Update(m_timer, currentCoordinateSystem);
    });

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 67 of file HolographicSpatialStageMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 68 of file HolographicSpatialStageMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 56 of file HolographicSpatialStageMain.h.

Windows::Foundation::EventRegistrationToken m_gamepadAddedEventToken [private]

Definition at line 70 of file HolographicSpatialStageMain.h.

Windows::Foundation::EventRegistrationToken m_gamepadRemovedEventToken [private]

Definition at line 71 of file HolographicSpatialStageMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 64 of file HolographicSpatialStageMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 69 of file HolographicSpatialStageMain.h.

std::shared_ptr<SceneController> m_sceneController [private]

Definition at line 53 of file HolographicSpatialStageMain.h.

std::shared_ptr<SpatialStageManager> m_spatialStageManager [private]

Definition at line 58 of file HolographicSpatialStageMain.h.

DX::StepTimer m_timer [private]

Definition at line 61 of file HolographicSpatialStageMain.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialStage/cpp/HolographicSpatialStageMain.h
  • HolographicSpatialStage/cpp/HolographicSpatialStageMain.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 model

Detailed Description

Definition at line 6 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4X4 model

Definition at line 8 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialStage/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneController Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • SceneController
Public Member Functions | Private Attributes

SceneController Class Reference

#include "SceneController.h"

List of all members.

Public Member Functions

SceneController (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | AddSceneObject (std::shared_ptr< SceneObject > &newObject)
void | ClearSceneObjects ()
void | CreateDeviceDependentResources ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Update (const DX::StepTimer &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^viewCoords)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::vector< std::shared_ptr
< SceneObject > > 		m_sceneObjects

Detailed Description

Definition at line 11 of file SceneController.h.

Constructor & Destructor Documentation

SceneController ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 9 of file SceneController.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
}

Member Function Documentation

void AddSceneObject ( std::shared_ptr< SceneObject > & newObject ) [inline]

Definition at line 20 of file SceneController.h.

{ m_sceneObjects.push_back(newObject); }

void ClearSceneObjects ( ) [inline]

Definition at line 21 of file SceneController.h.

{ m_sceneObjects.clear(); }

void CreateDeviceDependentResources ( )

Definition at line 30 of file SceneController.cpp.

{
    for (auto& object : m_sceneObjects)
    {
        object->CreateDeviceDependentResources();
    }
}

void ReleaseDeviceDependentResources ( )

Definition at line 38 of file SceneController.cpp.

{
    for (auto& object : m_sceneObjects)
    {
        object->ReleaseDeviceDependentResources();
    }
}

void Render ( )

Definition at line 22 of file SceneController.cpp.

{
    for (auto& object : m_sceneObjects)
    {
        object->Render();
    }
}

void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | viewCoords
 | ) |  |

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 25 of file SceneController.h.

std::vector<std::shared_ptr<SceneObject> > m_sceneObjects [private]

Definition at line 26 of file SceneController.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialStage/cpp/Content/SceneController.h
  • HolographicSpatialStage/cpp/Content/SceneController.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • SceneObject
Public Member Functions | Private Attributes

SceneObject Class Reference

#include "SceneObject.h"

List of all members.

Public Member Functions

SceneObject (const std::shared_ptr< DX::DeviceResources > &deviceResources, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
SceneObject (const std::shared_ptr< DX::DeviceResources > &deviceResources, std::vector< DirectX::XMFLOAT3 > const &vertices, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
SceneObject (const std::shared_ptr< DX::DeviceResources > &deviceResources, std::vector< DirectX::XMFLOAT3 > const &vertices, std::vector< unsigned short > const &indices, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | CreateDeviceDependentResources ()
void | EnableWireframe ()
void | ReleaseDeviceDependentResources ()
void | Render ()
void | Update (const DX::StepTimer &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^viewCoords)

Private Attributes

const std::vector< unsigned short > | c_cubeIndices
const std::vector
< DirectX::XMFLOAT3 > 		c_cubeVertices
bool | m_canRenderThisFrame = false
Windows::Perception::Spatial::SpatialCoordinateSystem | m_coordinateSystem
Microsoft::WRL::ComPtr
< ID3D11RasterizerState > 		m_defaultRasterizerState
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
unsigned int | m_indexCount
std::vector< unsigned short > | m_indices
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
bool | m_useWireframe = false
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader
std::vector< VertexPositionColor > | m_vertices
Microsoft::WRL::ComPtr
< ID3D11RasterizerState > 		m_wireframeRasterizerState

Detailed Description

Definition at line 9 of file SceneObject.h.

Constructor & Destructor Documentation

SceneObject | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | DirectX::XMFLOAT3 const & | color,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
SceneObject | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | std::vector< DirectX::XMFLOAT3 > const & | vertices,
 |  | DirectX::XMFLOAT3 const & | color,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
SceneObject | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | std::vector< DirectX::XMFLOAT3 > const & | vertices,
 |  | std::vector< unsigned short > const & | indices,
 |  | DirectX::XMFLOAT3 const & | color,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |

Definition at line 32 of file SceneObject.cpp.

{
    m_coordinateSystem = coordinateSystem;
    m_deviceResources = deviceResources;

    m_vertices.resize(vertices.size());
    for (size_t i = 0; i < vertices.size(); ++i)
    {
        m_vertices[i].pos = vertices[i];
        m_vertices[i].color = color;
    }

    m_indices = indices;
    m_indexCount = unsigned int(m_indices.size());

    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 173 of file SceneObject.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
            )
        );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
            { {
                { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
                { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            } };

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                static_cast<UINT>(vertexDesc.size()),
                fileData.data(),
                static_cast<UINT>(fileData.size()),
                &m_inputLayout
            )
        );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
            )
        );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
            )
        );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                )
            );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> createGeometryTask = shaderTaskGroup.then([this]()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
        vertexBufferData.pSysMem = m_vertices.data();
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(
            sizeof(VertexPositionColor) * static_cast<UINT>(m_vertices.size()),
            D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
            )
        );

        D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
        indexBufferData.pSysMem = m_indices.data();
        indexBufferData.SysMemPitch = 0;
        indexBufferData.SysMemSlicePitch = 0;
        CD3D11_BUFFER_DESC indexBufferDesc(
            sizeof(unsigned short) * static_cast<UINT>(m_indices.size()),
            D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
            )
        );
    });

    // Once the geometry is loaded, the object is ready to be rendered.
    createGeometryTask.then([this]()
    {
        // Create the default rasterizer state.
        D3D11_RASTERIZER_DESC rasterizerDesc = CD3D11_RASTERIZER_DESC(D3D11_DEFAULT);
        m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_defaultRasterizerState.GetAddressOf());

        // Create a wireframe rasterizer state.
        rasterizerDesc.AntialiasedLineEnable = true;
        rasterizerDesc.CullMode = D3D11_CULL_NONE;
        rasterizerDesc.FillMode = D3D11_FILL_WIREFRAME;
        m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_wireframeRasterizerState.GetAddressOf());

        m_loadingComplete = true;
    });
}

void EnableWireframe ( ) [inline]

Definition at line 35 of file SceneObject.h.

{ m_useWireframe = true; }

void ReleaseDeviceDependentResources ( )

Definition at line 316 of file SceneObject.cpp.

{
    m_loadingComplete = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
    m_defaultRasterizerState.Reset();
    m_wireframeRasterizerState.Reset();
}

void Render ( )

Definition at line 90 of file SceneObject.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    // Our coordinate system must also be locatable.
    if (!m_loadingComplete || !m_canRenderThisFrame)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
    );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
    );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    if (m_useWireframe)
    {
        // Use a wireframe rasterizer state.
        m_deviceResources->GetD3DDeviceContext()->RSSetState(m_wireframeRasterizerState.Get());
    }
    else
    {
        // Use the default rasterizer state.
        m_deviceResources->GetD3DDeviceContext()->RSSetState(m_defaultRasterizerState.Get());
    }

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
    );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
    );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
        );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
    );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
    );
}

void Update | ( | const DX::StepTimer & | timer,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | viewCoords
 | ) |  |

Definition at line 55 of file SceneObject.cpp.

{
    if (viewCoords == nullptr)
    {
        return;
    }

    // Try to get transform.
    auto transformContainer = m_coordinateSystem->TryGetTransformTo(viewCoords);
    if (m_canRenderThisFrame = (transformContainer != nullptr))
    {
        const XMMATRIX modelTransform = XMLoadFloat4x4(&transformContainer->Value);
        XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
    }

    // Loading is asynchronous. Resources must be created before they can be updated.
    if (!m_loadingComplete || !m_canRenderThisFrame)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
    );
}

Member Data Documentation

const std::vector<unsigned short> c_cubeIndices [private]
Initial value:
            { {
                2,1,0,
                2,3,1,

                6,4,5,
                6,5,7,

                0,1,5,
                0,5,4,

                2,6,7,
                2,7,3,

                0,4,6,
                0,6,2,

                1,3,7,
                1,7,5,
            } }

Definition at line 85 of file SceneObject.h.

const std::vector<DirectX::XMFLOAT3> c_cubeVertices [private]
Initial value:
            { {
                { DirectX::XMFLOAT3(-0.01f, -0.01f, -0.01f) },
                { DirectX::XMFLOAT3(-0.01f, -0.01f,  0.01f) },
                { DirectX::XMFLOAT3(-0.01f,  0.01f, -0.01f) },
                { DirectX::XMFLOAT3(-0.01f,  0.01f,  0.01f) },
                { DirectX::XMFLOAT3( 0.01f, -0.01f, -0.01f) },
                { DirectX::XMFLOAT3( 0.01f, -0.01f,  0.01f) },
                { DirectX::XMFLOAT3( 0.01f,  0.01f, -0.01f) },
                { DirectX::XMFLOAT3( 0.01f,  0.01f,  0.01f) },
            } }

Definition at line 72 of file SceneObject.h.

bool m_canRenderThisFrame = false [private]

Definition at line 64 of file SceneObject.h.

Windows::Perception::Spatial::SpatialCoordinateSystem m_coordinateSystem [private]

Definition at line 60 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_defaultRasterizerState [private]

Definition at line 51 of file SceneObject.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 39 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 46 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 44 of file SceneObject.h.

unsigned int m_indexCount [private]

Definition at line 58 of file SceneObject.h.

std::vector<unsigned short> m_indices [private]

Definition at line 57 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 42 of file SceneObject.h.

bool m_loadingComplete = false [private]

Definition at line 63 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 48 of file SceneObject.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 55 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 47 of file SceneObject.h.

bool m_useWireframe = false [private]

Definition at line 65 of file SceneObject.h.

bool m_usingVprtShaders = false [private]

Definition at line 69 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 43 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 45 of file SceneObject.h.

std::vector<VertexPositionColor> m_vertices [private]

Definition at line 56 of file SceneObject.h.

Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_wireframeRasterizerState [private]

Definition at line 52 of file SceneObject.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialStage/cpp/Content/SceneObject.h
  • HolographicSpatialStage/cpp/Content/SceneObject.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicSpatialStageMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 9 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args ) [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 35 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 40 of file AppView.h.

std::unique_ptr<HolographicSpatialStageMain> m_main [private]

Definition at line 33 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 36 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 37 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicSpatialStage/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialStageManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • SpatialStageManager
Public Member Functions | Private Member Functions | Private Attributes

SpatialStageManager Class Reference

#include "SpatialStageManager.h"

List of all members.

Public Member Functions

SpatialStageManager (std::shared_ptr< DX::DeviceResources > const &deviceResources, std::shared_ptr< SceneController > const &sceneController)
SpatialStageManager (const SpatialStageManager &)
SpatialStageManager (SpatialStageManager &&)
~SpatialStageManager ()
Windows::Perception::Spatial::SpatialCoordinateSystem | GetCoordinateSystemForCurrentStage ()

Private Member Functions

std::vector
< Windows::Foundation::Numerics::float3 > 		CreateCircle (Windows::Foundation::Numerics::float3 center, float radius, int divisions, float radians)
void | OnCurrentChanged (Platform::Object^)
std::vector< unsigned short > | TriangulatePoints (std::vector< Windows::Foundation::Numerics::float3 > const &vertices)

Private Attributes

Windows::Perception::Spatial::SpatialCoordinateSystem | m_currentCoordinateSystem
Windows::Perception::Spatial::SpatialStageFrameOfReference | m_currentStage
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::shared_ptr< SceneController > | m_sceneController
Windows::Foundation::EventRegistrationToken | m_spatialStageChangedEventToken
std::shared_ptr< SceneObject > | m_stageBoundsShape
std::shared_ptr< SceneObject > | m_stageVisibleAreaIndicatorShape
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_stationaryFrameOfReference

Detailed Description

Definition at line 8 of file SpatialStageManager.h.

Constructor & Destructor Documentation

SpatialStageManager | ( | std::shared_ptr< DX::DeviceResources > const & | deviceResources,
 |  | std::shared_ptr< SceneController > const & | sceneController
 | ) |  |

Definition at line 13 of file SpatialStageManager.cpp.

    : m_deviceResources(deviceResources), m_sceneController(sceneController)
{
    // Get notified when the stage is updated.
    m_spatialStageChangedEventToken = SpatialStageFrameOfReference::CurrentChanged +=
        ref new EventHandler<Object^>(std::bind(&SpatialStageManager::OnCurrentChanged, this, _1));

    // Make sure to get the current spatial stage.
    OnCurrentChanged(nullptr);
}

SpatialStageManager ( const SpatialStageManager & )
SpatialStageManager ( SpatialStageManager && )
~SpatialStageManager ( )

Definition at line 26 of file SpatialStageManager.cpp.

{
    SpatialStageFrameOfReference::CurrentChanged -= m_spatialStageChangedEventToken;
}

Member Function Documentation

std::vector<Windows::Foundation::Numerics::float3> CreateCircle | ( | Windows::Foundation::Numerics::float3 | center,
 |  | float | radius,
 |  | int | divisions,
 |  | float | radians |
 | ) |  |  | [private]
SpatialCoordinateSystem GetCoordinateSystemForCurrentStage ( )

Definition at line 131 of file SpatialStageManager.cpp.

{
    return m_currentCoordinateSystem;
}

void OnCurrentChanged ( Platform::Object^ ) [private]
std::vector<unsigned short> TriangulatePoints ( std::vector< Windows::Foundation::Numerics::float3 > const & vertices ) [private]

Member Data Documentation

Windows::Perception::Spatial::SpatialCoordinateSystem m_currentCoordinateSystem [private]

Definition at line 32 of file SpatialStageManager.h.

Windows::Perception::Spatial::SpatialStageFrameOfReference m_currentStage [private]

Definition at line 33 of file SpatialStageManager.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 24 of file SpatialStageManager.h.

std::shared_ptr<SceneController> m_sceneController [private]

Definition at line 25 of file SpatialStageManager.h.

Windows::Foundation::EventRegistrationToken m_spatialStageChangedEventToken [private]

Definition at line 27 of file SpatialStageManager.h.

std::shared_ptr<SceneObject> m_stageBoundsShape [private]

Definition at line 29 of file SpatialStageManager.h.

std::shared_ptr<SceneObject> m_stageVisibleAreaIndicatorShape [private]

Definition at line 30 of file SpatialStageManager.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_stationaryFrameOfReference [private]

Definition at line 34 of file SpatialStageManager.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialStage/cpp/SpatialStageManager.h
  • HolographicSpatialStage/cpp/SpatialStageManager.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicSpatialStage
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 16 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 19 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 18 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialStage/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DistanceFieldRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • DistanceFieldRenderer
Public Member Functions | Private Attributes

DistanceFieldRenderer Class Reference

#include "DistanceFieldRenderer.h"

List of all members.

Public Member Functions

DistanceFieldRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources, unsigned int const &textureWidth, unsigned int const &textureHeight)
void | CreateDeviceDependentResources ()
unsigned int const & | GetRenderCount () const
ID3D11ShaderResourceView * | GetTexture () const
void | ReleaseDeviceDependentResources ()
void | RenderDistanceField (ID3D11ShaderResourceView *texture)

Private Attributes

Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		m_d3dDepthStencilView
const std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
unsigned int | m_renderCount = 0
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_renderTargetView
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_shaderResourceView
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
const UINT | m_textureHeight
const UINT | m_textureWidth
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader
uint32 | m_vertexStride = 0

Detailed Description

Definition at line 18 of file DistanceFieldRenderer.h.

Constructor & Destructor Documentation

DistanceFieldRenderer | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | unsigned int const & | textureWidth,
 |  | unsigned int const & | textureHeight
 | ) |  |

Definition at line 22 of file DistanceFieldRenderer.cpp.

  : m_deviceResources(deviceResources),
    m_textureWidth(textureWidth),
    m_textureHeight(textureHeight)
{
    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 116 of file DistanceFieldRenderer.cpp.

{
    // Create the texture that will be used as the offscreen render target.
    CD3D11_TEXTURE2D_DESC textureDesc(
        DXGI_FORMAT_R8G8_UNORM,
        m_textureWidth,
        m_textureHeight,
        1,
        1,
        D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
    );
    m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);

    // Create read and write views for the offscreen render target.
    m_deviceResources->GetD3DDevice()->CreateShaderResourceView(m_texture.Get(), nullptr, &m_shaderResourceView);
    m_deviceResources->GetD3DDevice()->CreateRenderTargetView(m_texture.Get(), nullptr, &m_renderTargetView);

    // Create a depth stencil view.
    // NOTE: This is used only for drawing. It could be recycled for additional distance rendering
    //       passes, and discarded after all distance fields have been created (as could the index
    //       and vertex buffers).
    CD3D11_TEXTURE2D_DESC depthStencilDesc(
        DXGI_FORMAT_D16_UNORM,
        m_textureWidth,
        m_textureHeight,
        1, // One array level.
        1, // Use a single mipmap level.
        D3D11_BIND_DEPTH_STENCIL
    );

    Microsoft::WRL::ComPtr<ID3D11Texture2D> depthStencil;
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateTexture2D(
            &depthStencilDesc,
            nullptr,
            &depthStencil
        )
    );

    CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
    DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateDepthStencilView(
            depthStencil.Get(),
            &depthStencilViewDesc,
            &m_d3dDepthStencilView
        )
    );

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(L"ms-appx:///FullscreenQuadVertexShader.cso");
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///CreateDistanceFieldPixelShader.cso");

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
            )
        );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 1> vertexDesc =
            {{
                { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 }
            }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                vertexDesc.size(),
                fileData.data(),
                fileData.size(),
                &m_inputLayout
            )
        );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
            )
        );
    });

    // Once all shaders are loaded, create the mesh.
    task<void> createQuadTask = (createPSTask && createVSTask).then([this]()
    {
        // Load mesh vertices for a full-screen quad.
        static const std::array<XMFLOAT2, 4> quadVertices =
        {{
            { XMFLOAT2(-1.0f,  1.0f) },
            { XMFLOAT2( 1.0f,  1.0f) },
            { XMFLOAT2( 1.0f, -1.0f) },
            { XMFLOAT2(-1.0f, -1.0f) },
        }};

        m_vertexStride = sizeof(XMFLOAT2);

        D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
        vertexBufferData.pSysMem = quadVertices.data();
        vertexBufferData.SysMemPitch = 0;
        vertexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(m_vertexStride * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
            )
        );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<unsigned short, 6> quadIndices =
        {{
            // -z
            0,2,3,
            0,1,2,
        }};

        m_indexCount = quadIndices.size();

        D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
        indexBufferData.pSysMem = quadIndices.data();
        indexBufferData.SysMemPitch = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
            )
        );
    });

    auto loadingCompleteTask = createQuadTask.then([this]() {

        m_loadingComplete = true;
    });
}

unsigned int const& GetRenderCount ( ) const [inline]

Definition at line 29 of file DistanceFieldRenderer.h.

{ return m_renderCount;               };

ID3D11ShaderResourceView* GetTexture ( ) const [inline]

Definition at line 28 of file DistanceFieldRenderer.h.

{ return m_shaderResourceView.Get();  };

void ReleaseDeviceDependentResources ( )

Definition at line 100 of file DistanceFieldRenderer.cpp.

{
    m_loadingComplete = false;

    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();

    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();

    m_texture.Reset();
    m_shaderResourceView.Reset();
    m_renderTargetView.Reset();
}

void RenderDistanceField ( ID3D11ShaderResourceView * texture )

Definition at line 30 of file DistanceFieldRenderer.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Set and clear the off-screen render target.
    ID3D11RenderTargetView *const targets[1] = { m_renderTargetView.Get() };
    context->OMSetRenderTargets(1, targets, m_d3dDepthStencilView.Get());
    context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
    context->ClearDepthStencilView(m_d3dDepthStencilView.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0);

    // Set the viewport to cover the whole texture.
    CD3D11_VIEWPORT viewport = CD3D11_VIEWPORT(
        0.f, 0.f,
        static_cast<float>(m_textureWidth),
        static_cast<float>(m_textureHeight));
    context->RSSetViewports(1, &viewport);

    // Each vertex is one instance of the XMFLOAT2 struct.
    const UINT stride = m_vertexStride;
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
    );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
    );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
    );

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
    );
    context->PSSetShaderResources(
        0,
        1,
        &texture
    );

    // Draw the objects.
    context->DrawIndexed(
        m_indexCount,   // Index count.
        0,              // Start index location.
        0               // Base vertex location.
    );

    ++m_renderCount;
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_d3dDepthStencilView [private]

Definition at line 43 of file DistanceFieldRenderer.h.

const std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 29 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 38 of file DistanceFieldRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 51 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 36 of file DistanceFieldRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 55 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 40 of file DistanceFieldRenderer.h.

unsigned int m_renderCount = 0 [private]

Definition at line 56 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView [private]

Definition at line 44 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shaderResourceView [private]

Definition at line 42 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [private]

Definition at line 41 of file DistanceFieldRenderer.h.

const UINT m_textureHeight [private]

Definition at line 48 of file DistanceFieldRenderer.h.

const UINT m_textureWidth [private]

Definition at line 47 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 37 of file DistanceFieldRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 39 of file DistanceFieldRenderer.h.

uint32 m_vertexStride = 0 [private]

Definition at line 52 of file DistanceFieldRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicTagAlong/cpp/Content/DistanceFieldRenderer.h
  • HolographicTagAlong/cpp/Content/DistanceFieldRenderer.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlongSampleMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • HolographicTagAlongSampleMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicTagAlongSampleMain Class Reference

#include "HolographicTagAlongSampleMain.h"

List of all members.

Public Member Functions

HolographicTagAlongSampleMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicTagAlongSampleMain ()
void | LoadAppState ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | RenderOffscreenTexture ()
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference | m_attachedReferenceFrame
Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_dropHologram = false
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_stationaryReferenceFrame
DX::StepTimer m_timer

Detailed Description

Definition at line 31 of file HolographicTagAlongSampleMain.h.

Constructor & Destructor Documentation

HolographicTagAlongSampleMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 31 of file HolographicTagAlongSampleMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);
}

~HolographicTagAlongSampleMain ( )

Definition at line 152 of file HolographicTagAlongSampleMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

void LoadAppState ( )

Definition at line 357 of file HolographicTagAlongSampleMain.cpp.

{
    // This code sample does not persist any app state between sessions.
}

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 369 of file HolographicTagAlongSampleMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_quadRenderer->ReleaseDeviceDependentResources();
    m_distanceFieldRenderer->ReleaseDeviceDependentResources();
    m_textRenderer->ReleaseDeviceDependentResources();
#endif
}

void OnDeviceRestored ( ) [virtual]

Definition at line 380 of file HolographicTagAlongSampleMain.cpp.

{
#ifdef DRAW_SAMPLE_CONTENT
    m_quadRenderer->CreateDeviceDependentResources();
    m_textRenderer->CreateDeviceDependentResources();
    m_distanceFieldRenderer->CreateDeviceDependentResources();
    RenderOffscreenTexture();
#endif
}

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 277 of file HolographicTagAlongSampleMain.cpp.

{
    // Don't try to render anything before the first Update.
    if (m_timer.GetFrameCount() == 0)
    {
        return false;
    }

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        // Off-screen drawing used by all cameras.
        // The distance function texture only needs to be created once, for a given text string.
        if (m_distanceFieldRenderer->GetRenderCount() == 0)
        {
            m_distanceFieldRenderer->RenderDistanceField(m_textRenderer->GetTexture());

            // The 2048x2048 texture will not be needed again, unless we get hit DeviceLost scenario.
            m_textRenderer->ReleaseDeviceDependentResources();
        }

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            pCameraResources->UpdateViewProjectionBuffer(
                m_deviceResources,
                cameraPose,
                m_dropHologram ? m_stationaryReferenceFrame->CoordinateSystem :
                                 m_attachedReferenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp)
                );

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

#ifdef DRAW_SAMPLE_CONTENT
            // This example content can always be rendered, as long as the content and Direct3D
            // device-based resources are done loading.
            if (cameraActive)
            {
                // Draw the sample hologram.
                m_quadRenderer->Render(m_distanceFieldRenderer->GetTexture());
            }
#endif
            atLeastOneCameraRendered = true;
        }

        return atLeastOneCameraRendered;
    });
}

void RenderOffscreenTexture ( ) [private]

Definition at line 362 of file HolographicTagAlongSampleMain.cpp.

{
    m_textRenderer->RenderTextOffscreen(L"Hello, Hologram!\n");
}

void SaveAppState ( )

Definition at line 352 of file HolographicTagAlongSampleMain.cpp.

{
    // This code sample does not persist any app state between sessions.
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 121 of file HolographicTagAlongSampleMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        // Clear previous event registrations.

        if (m_locatabilityChangedToken.Value != 0)
        {
            m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
            m_locatabilityChangedToken.Value = 0;
        }
    }
}

HolographicFrame Update ( )

Definition at line 161 of file HolographicTagAlongSampleMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem =
        m_attachedReferenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);

    m_timer.Tick([&] ()
    {
#ifdef DRAW_SAMPLE_CONTENT
        // Check for new input state since the last frame.
        SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
        if (pointerState != nullptr)
        {
            // When a Pressed gesture is detected, the hologram is placed or picked up.
            m_dropHologram = !m_dropHologram;

            SpatialCoordinateSystem^ coordinateSystemFrom = nullptr;
            SpatialCoordinateSystem^ coordinateSystemTo = nullptr;

            // Drop the hologram - or pick it up.
            if (m_dropHologram)
            {
                // For comparison, we can also render the hologram in a stationary location.
                m_stationaryReferenceFrame = m_locator->CreateStationaryFrameOfReferenceAtCurrentLocation();

                // Prepare to transform the hologram between coordinate systems.Z
                coordinateSystemFrom = currentCoordinateSystem;
                coordinateSystemTo = m_stationaryReferenceFrame->CoordinateSystem;
            }
            else
            {
                // Prepare to transform the hologram between coordinate systems.Z
                coordinateSystemFrom = m_stationaryReferenceFrame->CoordinateSystem;
                coordinateSystemTo = currentCoordinateSystem;

                // We are done with the stationary reference frame.
                m_stationaryReferenceFrame = nullptr;
            }

            // The position is transformed between reference frames.
            Platform::IBox<float4x4>^ coordinateContainer = coordinateSystemFrom->TryGetTransformTo(coordinateSystemTo);
            if (coordinateContainer != nullptr)
            {
                float4x4 const& coordinateSystemTransform = coordinateContainer->Value;

                float3 stationaryPosition = transform(m_quadRenderer->GetPosition(), coordinateSystemTransform);
                m_quadRenderer->ResetPosition(stationaryPosition);
            }
        }

        if (!m_dropHologram)
        {
            SpatialPointerPose^ pose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);
            m_quadRenderer->UpdateHologramPosition(pose, m_timer);
        }

        m_quadRenderer->Update(m_timer);
#endif
    });

    // We complete the frame update by using information about our content positioning
    // to set the focus point.

    for (auto cameraPose : prediction->CameraPoses)
    {
#ifdef DRAW_SAMPLE_CONTENT
        // The HolographicCameraRenderingParameters class provides access to set
        // the image stabilization parameters.
        HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

        // SetFocusPoint informs the system about a specific point in your scene to
        // prioritize for image stabilization. The focus point is set independently
        // for each holographic camera.
        // In this example, we set position, normal, and velocity for a tag-along quad.
        float3 const& focusPointPosition = m_quadRenderer->GetPosition();
        float3        focusPointNormal = focusPointPosition == float3(0.f) ? float3(0.f, 0.f, 1.f) : -normalize(focusPointPosition);
        float3 const& focusPointVelocity = m_quadRenderer->GetVelocity();

        // Set the focus point.
        SpatialCoordinateSystem^ coordinateSystemToUse = m_dropHologram ? m_stationaryReferenceFrame->CoordinateSystem : currentCoordinateSystem;
        renderingParameters->SetFocusPoint(
            coordinateSystemToUse,
            focusPointPosition,
            focusPointNormal,
            focusPointVelocity
        );
#endif
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference m_attachedReferenceFrame [private]

Definition at line 106 of file HolographicTagAlongSampleMain.h.

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 112 of file HolographicTagAlongSampleMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 113 of file HolographicTagAlongSampleMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 94 of file HolographicTagAlongSampleMain.h.

bool m_dropHologram = false [private]

Definition at line 116 of file HolographicTagAlongSampleMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 100 of file HolographicTagAlongSampleMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 114 of file HolographicTagAlongSampleMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 103 of file HolographicTagAlongSampleMain.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_stationaryReferenceFrame [private]

Definition at line 109 of file HolographicTagAlongSampleMain.h.

DX::StepTimer m_timer [private]

Definition at line 97 of file HolographicTagAlongSampleMain.h.

The documentation for this class was generated from the following files:
  • HolographicTagAlong/cpp/HolographicTagAlongSampleMain.h
  • HolographicTagAlong/cpp/HolographicTagAlongSampleMain.cpp
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | hologramColorFadeMultiplier
DirectX::XMFLOAT4X4 | model

Detailed Description

Definition at line 17 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 hologramColorFadeMultiplier

Definition at line 20 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 model

Definition at line 19 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicTagAlong/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: QuadRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • QuadRenderer
Public Member Functions | Private Attributes

QuadRenderer Class Reference

#include "QuadRenderer.h"

List of all members.

Public Member Functions

QuadRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
const
Windows::Foundation::Numerics::float3 & 		GetPosition () const
const
Windows::Foundation::Numerics::float3 & 		GetVelocity () const
void | ReleaseDeviceDependentResources ()
void | Render (ID3D11ShaderResourceView *texture)
void | Render ()
void | ResetPosition (Windows::Foundation::Numerics::float3 pos)
void | StartFadeIn ()
void | StartFadeOut ()
void | Update (const DX::StepTimer &timer)
void | UpdateHologramPosition (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, const DX::StepTimer &timer)

Private Attributes

const float | c_lerpRate = 4.0f
const float | c_maxFadeTime = 1.f
float | m_degreesPerSecond = 45.f
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
float | m_fadeTime = 0.f
bool | m_fadingIn = false
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
Windows::Foundation::Numerics::float3 | m_lastPosition = { 0.f, 0.f, -2.f }
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
Microsoft::WRL::ComPtr
< ID3D11Resource > 		m_quadTexture
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_quadTextureSamplerState
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_quadTextureView
bool | m_usingVprtShaders = false
Windows::Foundation::Numerics::float3 | m_velocity = { 0.f, 0.f, 0.f }
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 21 of file QuadRenderer.h.

Constructor & Destructor Documentation

QuadRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 24 of file QuadRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    CreateDeviceDependentResources();

    StartFadeIn();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 279 of file QuadRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // If the optional VPRT feature is supported by the graphics device, we
    // can avoid using geometry shaders to set the render target array index.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///UseDistanceFieldPixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 3> vertexDesc =
        {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT,    0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                vertexDesc.size(),
                fileData.data(),
                fileData.size(),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
                )
            );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> finishLoadingTask = shaderTaskGroup.then([this] ()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the quad size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // quad at a comfortable size we made the quad width 0.2 m (20 cm).
        static const std::array<VertexPositionColorTex, 4> quadVertices =
        {{
            { XMFLOAT3(-0.2f,  0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(0.f, 0.f) },
            { XMFLOAT3( 0.2f,  0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(1.f, 0.f) },
            { XMFLOAT3( 0.2f, -0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(1.f, 1.f) },
            { XMFLOAT3(-0.2f, -0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(0.f, 1.f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem                = quadVertices.data();
        vertexBufferData.SysMemPitch            = 0;
        vertexBufferData.SysMemSlicePitch       = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionColorTex) * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<unsigned short, 12> quadIndices =
        {{
            // -z
            0,2,3,
            0,1,2,

            // +z
            2,0,3,
            1,0,2,
        }};

        m_indexCount = quadIndices.size();

        D3D11_SUBRESOURCE_DATA indexBufferData = {0};
        indexBufferData.pSysMem          = quadIndices.data();
        indexBufferData.SysMemPitch      = 0;
        indexBufferData.SysMemSlicePitch = 0;
        const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );

        DX::ThrowIfFailed(CreateDDSTextureFromFile(
                m_deviceResources->GetD3DDevice(),
                L"placeholder.dds",
                m_quadTexture.GetAddressOf(),
                m_quadTextureView.GetAddressOf()
                )
            );

        D3D11_SAMPLER_DESC desc;
        ZeroMemory(&desc, sizeof(D3D11_SAMPLER_DESC));

        desc.Filter         = D3D11_FILTER_ANISOTROPIC;
        desc.AddressU       = D3D11_TEXTURE_ADDRESS_CLAMP;
        desc.AddressV       = D3D11_TEXTURE_ADDRESS_CLAMP;
        desc.AddressW       = D3D11_TEXTURE_ADDRESS_CLAMP;
        desc.MaxAnisotropy  = 3;
        desc.MinLOD         = 0;
        desc.MaxLOD         = 3;
        desc.MipLODBias     = 0.f;
        desc.BorderColor[0] = 0.f;
        desc.BorderColor[1] = 0.f;
        desc.BorderColor[2] = 0.f;
        desc.BorderColor[3] = 0.f;
        desc.ComparisonFunc = D3D11_COMPARISON_NEVER;

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateSamplerState(
                &desc,
                &m_quadTextureSamplerState
                )
            );

        // After the assets are loaded, the quad is ready to be rendered.
        m_loadingComplete = true;
    });
}

const Windows::Foundation::Numerics::float3& GetPosition ( ) const [inline]

Definition at line 42 of file QuadRenderer.h.

{ return m_position; }

const Windows::Foundation::Numerics::float3& GetVelocity ( ) const [inline]

Definition at line 43 of file QuadRenderer.h.

{ return m_velocity; }

void ReleaseDeviceDependentResources ( )

Definition at line 465 of file QuadRenderer.cpp.

{
    m_loadingComplete  = false;
    m_usingVprtShaders = false;

    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();

    m_modelConstantBuffer.Reset();

    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();

    m_quadTexture.Reset();
    m_quadTextureView.Reset();
    m_quadTextureSamplerState.Reset();
}

void Render ( ID3D11ShaderResourceView * texture )

Definition at line 181 of file QuadRenderer.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColorTex);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader sets the render target ID.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );
    context->PSSetShaderResources(
        0,
        1,
        (texture != nullptr) ? &texture : m_quadTextureView.GetAddressOf()
        );
    context->PSSetSamplers(
        0,
        1,
        m_quadTextureSamplerState.GetAddressOf()
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void Render ( )

Definition at line 173 of file QuadRenderer.cpp.

{
    Render(m_quadTextureView.Get());
}

void ResetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline]

Definition at line 38 of file QuadRenderer.h.

                                                                {
            m_lastPosition = pos;
            m_position = pos;
        }

void StartFadeIn ( )

Definition at line 261 of file QuadRenderer.cpp.

{
    if (!m_fadingIn)
    {
        m_fadeTime = c_maxFadeTime;
        m_fadingIn = true;
    }
}

void StartFadeOut ( )

Definition at line 270 of file QuadRenderer.cpp.

{
    if (m_fadingIn)
    {
        m_fadeTime = c_maxFadeTime;
        m_fadingIn = false;
    }
}

void Update ( const DX::StepTimer & timer )

Definition at line 76 of file QuadRenderer.cpp.

{
    // Seconds elapsed since previous frame.
    const float deltaTime = static_cast<float>(timer.GetElapsedSeconds());
    const float oneOverDeltaTime = 1.f / deltaTime;

    // Create a direction normal from the hologram's position to the origin of person space.
    // This is the z-axis of our rotated coordinate system in unrotated space.
    XMVECTOR facingNormal = XMVector3Normalize(-XMLoadFloat3(&m_position));

    // Rotate the x-axis around the y-axis.
    // This rotation is achieved by projecting the normal into the xz-plane.
    // This is the x-axis of our rotated coordinate system in unrotated space.
    XMVECTOR xAxisRotation = XMVector3Normalize(XMVectorSet(XMVectorGetZ(facingNormal), 0.f, -XMVectorGetX(facingNormal), 0.f));

    // Create a third normal to satisfy the conditions of a rotation matrix.
    // The cross product of the other two normals is at a 90-degree angle to
    // both normals. The cross product is normalized to avoid floating-point
    // math errors.
    // Note how the cross product will never be null because the two axis
    // normals we generated above will always be at a 90-degree angle from
    // one another.
    XMVECTOR yAxisRotation = XMVector3Normalize(XMVector3Cross(facingNormal, xAxisRotation));

    // Construct the 4x4 rotation matrix.

    // Rotate the quad to face the user.
    XMMATRIX rotationMatrix = XMMATRIX(
        xAxisRotation,
        yAxisRotation,
        facingNormal,
        XMVectorSet(0.f, 0.f, 0.f, 1.f)
        );

    // Position the quad.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(rotationMatrix * modelTranslation));

    if (m_fadeTime > 0.f)
    {
        // Fade the quad in, or out.
        if (m_fadingIn)
        {
            const float fadeLerp = 1.f - (m_fadeTime / c_maxFadeTime);
            m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(fadeLerp, fadeLerp, fadeLerp, 1.f);
        }
        else
        {
            const float fadeLerp = (m_fadeTime / c_maxFadeTime);
            m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(fadeLerp, fadeLerp, fadeLerp, 1.f);
        }
        m_fadeTime -= deltaTime;
    }
    else
    {
        // Set a value directly.
        if (m_fadingIn)
        {
            m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(1.f, 1.f, 1.f, 1.f);
        }
        else
        {
            m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(0.f, 0.f, 0.f, 0.f);
        }
    }

    // Determine velocity.
    // Even though the motion is spherical, the velocity is still linear
    // for image stabilization.
    const float3 deltaPosition = m_position - m_lastPosition; // meters
    m_velocity = deltaPosition * oneOverDeltaTime; // meters per second

    // Loading is asynchronous. Resources must be created before they can be updated.
    if (!m_loadingComplete)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );
}

void UpdateHologramPosition | ( | Windows::UI::Input::Spatial::SpatialPointerPose^ | pointerPose,
 |  | const DX::StepTimer & | timer
 | ) |  |

Member Data Documentation

const float c_lerpRate = 4.0f [private]

Definition at line 79 of file QuadRenderer.h.

const float c_maxFadeTime = 1.f [private]

Definition at line 82 of file QuadRenderer.h.

float m_degreesPerSecond = 45.f [private]

Definition at line 69 of file QuadRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 47 of file QuadRenderer.h.

float m_fadeTime = 0.f [private]

Definition at line 85 of file QuadRenderer.h.

bool m_fadingIn = false [private]

Definition at line 88 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 54 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 52 of file QuadRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 65 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 50 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_lastPosition = { 0.f, 0.f, -2.f } [private]

Definition at line 71 of file QuadRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 68 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 56 of file QuadRenderer.h.

ModelConstantBuffer m_modelConstantBufferData [private]

Definition at line 64 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 55 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 70 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Resource> m_quadTexture [private]

Definition at line 59 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_quadTextureSamplerState [private]

Definition at line 61 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_quadTextureView [private]

Definition at line 60 of file QuadRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 76 of file QuadRenderer.h.

Windows::Foundation::Numerics::float3 m_velocity = { 0.f, 0.f, 0.f } [private]

Definition at line 72 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 51 of file QuadRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 53 of file QuadRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicTagAlong/cpp/Content/QuadRenderer.h
  • HolographicTagAlong/cpp/Content/QuadRenderer.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicTagAlongSampleMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 20 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 48 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 53 of file AppView.h.

std::unique_ptr<HolographicTagAlongSampleMain> m_main [private]

Definition at line 46 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 49 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 50 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicTagAlong/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 18 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 23 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );
}

~SpatialInputHandler ( )

Definition at line 37 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 46 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 33 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 36 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 39 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • HolographicTagAlong/cpp/Content/SpatialInputHandler.h
  • HolographicTagAlong/cpp/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • TextRenderer
Public Member Functions | Private Attributes

TextRenderer Class Reference

#include "TextRenderer.h"

List of all members.

Public Member Functions

TextRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources, unsigned int const &textureWidth, unsigned int const &textureHeight)
void | CreateDeviceDependentResources ()
ID3D11SamplerState * | GetSampler () const
ID3D11ShaderResourceView * | GetTexture () const
void | ReleaseDeviceDependentResources ()
void | RenderTextOffscreen (const std::wstring &str)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1RenderTarget > 		m_d2dRenderTarget
const std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		m_pointSampler
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		m_renderTargetView
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		m_shaderResourceView
Microsoft::WRL::ComPtr
< IDWriteTextFormat > 		m_textFormat
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		m_texture
const unsigned int | m_textureHeight
const unsigned int | m_textureWidth
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		m_whiteBrush

Detailed Description

Definition at line 18 of file TextRenderer.h.

Constructor & Destructor Documentation

TextRenderer | ( | const std::shared_ptr< DX::DeviceResources > & | deviceResources,
 |  | unsigned int const & | textureWidth,
 |  | unsigned int const & | textureHeight
 | ) |  |

Definition at line 19 of file TextRenderer.cpp.

    : m_deviceResources(deviceResources),
      m_textureWidth(textureWidth),
      m_textureHeight(textureHeight)
{
    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 84 of file TextRenderer.cpp.

{
    // Create a default sampler state, which will use point sampling.
    CD3D11_SAMPLER_DESC desc(D3D11_DEFAULT);
    m_deviceResources->GetD3DDevice()->CreateSamplerState(&desc, &m_pointSampler);

    // Create the texture that will be used as the offscreen render target.
    CD3D11_TEXTURE2D_DESC textureDesc(
        DXGI_FORMAT_B8G8R8A8_UNORM,
        m_textureWidth,
        m_textureHeight,
        1,
        1,
        D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
    );
    m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);

    // Create read and write views for the offscreen render target.
    m_deviceResources->GetD3DDevice()->CreateShaderResourceView(m_texture.Get(), nullptr, &m_shaderResourceView);
    m_deviceResources->GetD3DDevice()->CreateRenderTargetView(m_texture.Get(), nullptr, &m_renderTargetView);

    // In this example, we are using D2D and DirectWrite; so, we need to create a D2D render target as well.
    D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(
        D2D1_RENDER_TARGET_TYPE_DEFAULT,
        D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED),
        96,
        96
    );

    // The DXGI surface is used to create the render target.
    Microsoft::WRL::ComPtr<IDXGISurface> dxgiSurface;
    DX::ThrowIfFailed(m_texture.As(&dxgiSurface));
    DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDxgiSurfaceRenderTarget(dxgiSurface.Get(), &props, &m_d2dRenderTarget));

    // Create a solid color brush that will be used to render the text.
    DX::ThrowIfFailed(m_d2dRenderTarget->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Cornsilk), &m_whiteBrush));

    // This is where we format the text that will be written on the render target.
    DX::ThrowIfFailed(
        m_deviceResources->GetDWriteFactory()->CreateTextFormat(
            L"Consolas",
            NULL,
            DWRITE_FONT_WEIGHT_NORMAL,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            400.0f,
            L"",
            m_textFormat.ReleaseAndGetAddressOf()
        )
    );
    DX::ThrowIfFailed(m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
    DX::ThrowIfFailed(m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER));
}

ID3D11SamplerState* GetSampler ( ) const [inline]

Definition at line 29 of file TextRenderer.h.

{ return m_pointSampler.Get();         };

ID3D11ShaderResourceView* GetTexture ( ) const [inline]

Definition at line 28 of file TextRenderer.h.

{ return m_shaderResourceView.Get();   };

void ReleaseDeviceDependentResources ( )

Definition at line 73 of file TextRenderer.cpp.

{
    m_texture.Reset();
    m_shaderResourceView.Reset();
    m_pointSampler.Reset();
    m_renderTargetView.Reset();
    m_d2dRenderTarget.Reset();
    m_whiteBrush.Reset();
    m_textFormat.Reset();
}

void RenderTextOffscreen ( const std::wstring & str )

Definition at line 27 of file TextRenderer.cpp.

{
    // Clear the off-screen render target.
    m_deviceResources->GetD3DDeviceContext()->ClearRenderTargetView(m_renderTargetView.Get(), DirectX::Colors::Transparent);

    // Begin drawing with D2D.
    m_d2dRenderTarget->BeginDraw();

    // Create a text layout to match the screen.
    Microsoft::WRL::ComPtr<IDWriteTextLayout> textLayout;
    m_deviceResources->GetDWriteFactory()->CreateTextLayout(
        str.c_str(),
        static_cast<UINT32>(str.length()),
        m_textFormat.Get(),
        (float)m_textureWidth,
        (float)m_textureHeight,
        &textLayout
        );

    // Get the text metrics from the text layout.
    DWRITE_TEXT_METRICS metrics;
    DX::ThrowIfFailed(textLayout->GetMetrics(&metrics));

    // In this example, we position the text in the center of the off-screen render target.
    D2D1::Matrix3x2F screenTranslation = D2D1::Matrix3x2F::Translation(
        m_textureWidth * 0.5f,
        m_textureHeight * 0.5f + metrics.height * 0.5f
        );
    m_whiteBrush->SetTransform(screenTranslation);

    // Render the text using DirectWrite.
    m_d2dRenderTarget->DrawTextLayout(
        D2D1::Point2F(0.0f, 0.0f),
        textLayout.Get(),
        m_whiteBrush.Get()
        );

    // End drawing with D2D.
    HRESULT hr = m_d2dRenderTarget->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        // Catch errors from D2D.
        DX::ThrowIfFailed(hr);
    }
}

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1RenderTarget> m_d2dRenderTarget [private]

Definition at line 40 of file TextRenderer.h.

const std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 29 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11SamplerState> m_pointSampler [private]

Definition at line 38 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView [private]

Definition at line 39 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shaderResourceView [private]

Definition at line 37 of file TextRenderer.h.

Microsoft::WRL::ComPtr<IDWriteTextFormat> m_textFormat [private]

Definition at line 42 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture [private]

Definition at line 36 of file TextRenderer.h.

const unsigned int m_textureHeight [private]

Definition at line 46 of file TextRenderer.h.

const unsigned int m_textureWidth [private]

Definition at line 45 of file TextRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 41 of file TextRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicTagAlong/cpp/Content/TextRenderer.h
  • HolographicTagAlong/cpp/Content/TextRenderer.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColorTex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicTagAlongSample
  • VertexPositionColorTex
Public Attributes

VertexPositionColorTex Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | pos
DirectX::XMFLOAT2 | texCoord

Detailed Description

Definition at line 30 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 33 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 32 of file ShaderStructures.h.

DirectX::XMFLOAT2 texCoord

Definition at line 34 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicTagAlong/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInputMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • HolographicVoiceInputMain
Public Member Functions | Private Member Functions | Private Attributes

HolographicVoiceInputMain Class Reference

#include "HolographicVoiceInputMain.h"

List of all members.

Public Member Functions

HolographicVoiceInputMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~HolographicVoiceInputMain ()
void | LoadAppState ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
bool | Render (Windows::Graphics::Holographic::HolographicFrame^holographicFrame)
void | SaveAppState ()
void | SetHolographicSpace (Windows::Graphics::Holographic::HolographicSpace^holographicSpace)
Windows::Graphics::Holographic::HolographicFrame | Update ()

Private Member Functions

void | BeginVoiceUIPrompt ()
void | InitializeSpeechCommandList ()
bool | InitializeSpeechRecognizer ()
void | OnCameraAdded (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args)
void | OnCameraRemoved (Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args)
void | OnLocatabilityChanged (Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args)
void | OnResultGenerated (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^args)
void | OnSpeechQualityDegraded (Windows::Media::SpeechRecognition::SpeechRecognizer^recognizer, Windows::Media::SpeechRecognition::SpeechRecognitionQualityDegradingEventArgs^args)
void | PlayRecognitionBeginSound ()
void | PlayRecognitionSound ()
Concurrency::task< bool > | StartRecognizeSpeechCommands ()
Concurrency::task< void > | StopCurrentRecognizerIfExists ()
void | UnregisterHolographicEventHandlers ()

Private Attributes

Windows::Foundation::EventRegistrationToken | m_cameraAddedToken
Windows::Foundation::EventRegistrationToken | m_cameraRemovedToken
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace
Platform::String | m_lastCommand
bool | m_listening
Windows::Foundation::EventRegistrationToken | m_locatabilityChangedToken
Windows::Perception::Spatial::SpatialLocator | m_locator
OmnidirectionalSound m_recognitionSound
Windows::Perception::Spatial::SpatialStationaryFrameOfReference | m_referenceFrame
float | m_secondsUntilSoundIsComplete = 0.f
std::shared_ptr
< SpatialInputHandler > 		m_spatialInputHandler
Platform::Collections::Map
< Platform::String^,
Windows::Foundation::Numerics::float4 > 		m_speechCommandData
Windows::Foundation::EventRegistrationToken | m_speechRecognitionQualityDegradedToken
Windows::Media::SpeechRecognition::SpeechRecognizer | m_speechRecognizer
Windows::Foundation::EventRegistrationToken | m_speechRecognizerResultEventToken
OmnidirectionalSound m_speechSynthesisSound
std::unique_ptr
< SpinningCubeRenderer > 		m_spinningCubeRenderer
OmnidirectionalSound m_startRecognitionSound
DX::StepTimer m_timer
bool | m_waitingForSpeechCue = false
bool | m_waitingForSpeechPrompt = false

Detailed Description

Definition at line 34 of file HolographicVoiceInputMain.h.

Constructor & Destructor Documentation

HolographicVoiceInputMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 33 of file HolographicVoiceInputMain.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // Register to be notified if the device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    // Initialize the map of speech commands to actions - in this case, color values.
    InitializeSpeechCommandList();

}

~HolographicVoiceInputMain ( )

Definition at line 372 of file HolographicVoiceInputMain.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);

    UnregisterHolographicEventHandlers();
}

Member Function Documentation

void BeginVoiceUIPrompt ( ) [private]

Definition at line 65 of file HolographicVoiceInputMain.cpp.

{
    // RecognizeWithUIAsync provides speech recognition begin and end prompts, but it does not provide
    // synthesized speech prompts. Instead, you should provide your own speech prompts when requesting
    // phrase input.
    // Here is an example of how to do that with a speech synthesizer. You could also use a pre-recorded
    // voice clip, a visual UI, or other indicator of what to say.
    auto speechSynthesizer = ref new Windows::Media::SpeechSynthesis::SpeechSynthesizer();

    StringReference voicePrompt;

    // A command list is used to continuously look for one-word commands.
    // You need some way for the user to know what commands they can say. In this example, we provide
    // verbal instructions; you could also use graphical UI, etc.
    voicePrompt = L"Say the name of a color, at any time, to change the color of the cube.";

    // Kick off speech synthesis.
    create_task(speechSynthesizer->SynthesizeTextToStreamAsync(voicePrompt), task_continuation_context::use_current())
        .then([this, speechSynthesizer](task<Windows::Media::SpeechSynthesis::SpeechSynthesisStream^> synthesisStreamTask)
    {
        try
        {
            // The speech synthesis is sent as a byte stream.
            Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ stream = synthesisStreamTask.get();

            // We can initialize an XAudio2 voice using that byte stream.
            // Here, we use it to play an HRTF audio effect.
            auto hr = m_speechSynthesisSound.Initialize(stream, 0);
            if (SUCCEEDED(hr))
            {
                m_speechSynthesisSound.SetEnvironment(HrtfEnvironment::Small);
                m_speechSynthesisSound.Start();

                // Amount of time to pause after the audio prompt is complete, before listening
                // for speech input.
                static const float bufferTime = 0.15f;

                // Wait until the prompt is done before listening.
                m_secondsUntilSoundIsComplete = m_speechSynthesisSound.GetDuration() + bufferTime;
                m_waitingForSpeechPrompt = true;
            }
        }
        catch (Exception^ exception)
        {
            PrintWstringToDebugConsole(
                std::wstring(L"Exception while trying to synthesize speech: ") +
                exception->Message->Data() +
                L"\n"
            );

            // Handle exceptions here.
        }
    });
}

void InitializeSpeechCommandList ( ) [private]

Definition at line 45 of file HolographicVoiceInputMain.cpp.

{
    m_lastCommand = nullptr;
    m_listening = false;
    m_speechCommandData = ref new Platform::Collections::Map<String^, float4>();

    m_speechCommandData->Insert(L"white", float4(1.0f, 1.0f, 1.0f, 1.f));
    m_speechCommandData->Insert(L"grey", float4(0.5f, 0.5f, 0.5f, 1.f));
    m_speechCommandData->Insert(L"green", float4(0.0f, 1.0f, 0.0f, 1.f));
    m_speechCommandData->Insert(L"black", float4(0.1f, 0.1f, 0.1f, 1.f));
    m_speechCommandData->Insert(L"red", float4(1.0f, 0.0f, 0.0f, 1.f));
    m_speechCommandData->Insert(L"yellow", float4(1.0f, 1.0f, 0.0f, 1.f));
    m_speechCommandData->Insert(L"aquamarine", float4(0.0f, 1.0f, 1.0f, 1.f));
    m_speechCommandData->Insert(L"blue", float4(0.0f, 0.0f, 1.0f, 1.f));
    m_speechCommandData->Insert(L"purple", float4(1.0f, 0.0f, 1.0f, 1.f));

    // You can use non-dictionary words as speech commands.
    m_speechCommandData->Insert(L"SpeechRecognizer", float4(0.5f, 0.1f, 1.f, 1.f));
}

bool InitializeSpeechRecognizer ( ) [private]

Definition at line 170 of file HolographicVoiceInputMain.cpp.

{
    m_speechRecognizer = ref new SpeechRecognizer();

    if (!m_speechRecognizer)
    {
        return false;
    }

    m_speechRecognitionQualityDegradedToken = m_speechRecognizer->RecognitionQualityDegrading +=
        ref new TypedEventHandler<SpeechRecognizer^, SpeechRecognitionQualityDegradingEventArgs^>(
            std::bind(&HolographicVoiceInputMain::OnSpeechQualityDegraded, this, _1, _2)
            );

    m_speechRecognizerResultEventToken = m_speechRecognizer->ContinuousRecognitionSession->ResultGenerated +=
        ref new TypedEventHandler<SpeechContinuousRecognitionSession^, SpeechContinuousRecognitionResultGeneratedEventArgs^>(
            std::bind(&HolographicVoiceInputMain::OnResultGenerated, this, _1, _2)
            );

    return true;
}

void LoadAppState ( )

Definition at line 592 of file HolographicVoiceInputMain.cpp.

{
    //
    // TODO: Insert code here to load your app state.
    //       This method is called when the app resumes.
    //
    //       For example, load information from the SpatialAnchorStore.
    //
}

void OnCameraAdded | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnCameraRemoved | ( | Windows::Graphics::Holographic::HolographicSpace^ | sender,
 |  | Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ | args |
 | ) |  |  | [private]
void OnDeviceLost ( ) [virtual]

Definition at line 604 of file HolographicVoiceInputMain.cpp.

{
    m_spinningCubeRenderer->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 611 of file HolographicVoiceInputMain.cpp.

{
    m_spinningCubeRenderer->CreateDeviceDependentResources();
}

void OnLocatabilityChanged | ( | Windows::Perception::Spatial::SpatialLocator^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnResultGenerated | ( | Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^ | sender,
 |  | Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^ | args |
 | ) |  |  | [private]
void OnSpeechQualityDegraded | ( | Windows::Media::SpeechRecognition::SpeechRecognizer^ | recognizer,
 |  | Windows::Media::SpeechRecognition::SpeechRecognitionQualityDegradingEventArgs^ | args |
 | ) |  |  | [private]

Definition at line 730 of file HolographicVoiceInputMain.cpp.

{
    switch (args->Problem)
    {
    case SpeechRecognitionAudioProblem::TooFast:
        OutputDebugStringW(L"The user spoke too quickly.\n");
        break;

    case SpeechRecognitionAudioProblem::TooSlow:
        OutputDebugStringW(L"The user spoke too slowly.\n");
        break;

    case SpeechRecognitionAudioProblem::TooQuiet:
        OutputDebugStringW(L"The user spoke too softly.\n");
        break;

    case SpeechRecognitionAudioProblem::TooLoud:
        OutputDebugStringW(L"The user spoke too loudly.\n");
        break;

    case SpeechRecognitionAudioProblem::TooNoisy:
        OutputDebugStringW(L"There is too much noise in the signal.\n");
        break;

    case SpeechRecognitionAudioProblem::NoSignal:
        OutputDebugStringW(L"There is no signal.\n");
        break;

    case SpeechRecognitionAudioProblem::None:
    default:
        OutputDebugStringW(L"An error was reported with no information.\n");
        break;
    }
}

void PlayRecognitionBeginSound ( ) [private]

Definition at line 120 of file HolographicVoiceInputMain.cpp.

{
    // The user needs a cue to begin speaking. We will play this sound effect just before starting
    // the recognizer.
    auto hr = m_startRecognitionSound.GetInitializationStatus();
    if (SUCCEEDED(hr))
    {
        m_startRecognitionSound.SetEnvironment(HrtfEnvironment::Small);
        m_startRecognitionSound.Start();

        // Wait until the audible cue is done before starting to listen.
        m_secondsUntilSoundIsComplete = m_startRecognitionSound.GetDuration();
        m_waitingForSpeechCue = true;
    }
}

void PlayRecognitionSound ( ) [private]

Definition at line 136 of file HolographicVoiceInputMain.cpp.

{
    // The user should be given a cue when recognition is complete.
    auto hr = m_recognitionSound.GetInitializationStatus();
    if (SUCCEEDED(hr))
    {
        // re-initialize the sound so it can be replayed.
        m_recognitionSound.Initialize(L"Audio//BasicResultsEarcon.wav", 0);
        m_recognitionSound.SetEnvironment(HrtfEnvironment::Small);

        m_recognitionSound.Start();
    }
}

bool Render ( Windows::Graphics::Holographic::HolographicFrame^ holographicFrame )

Definition at line 499 of file HolographicVoiceInputMain.cpp.

{
    // Don't try to render anything before the first Update.
    if (m_timer.GetFrameCount() == 0)
    {
        return false;
    }

    //
    // TODO: Add code for pre-pass rendering here.
    //
    // Take care of any tasks that are not specific to an individual holographic
    // camera. This includes anything that doesn't need the final view or projection
    // matrix, such as lighting maps.
    //

    // Lock the set of holographic camera resources, then draw to each camera
    // in this frame.
    return m_deviceResources->UseHolographicCameraResources<bool>(
        [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
    {
        // Up-to-date frame predictions enhance the effectiveness of image stablization and
        // allow more accurate positioning of holograms.
        holographicFrame->UpdateCurrentPrediction();
        HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

        bool atLeastOneCameraRendered = false;
        for (auto cameraPose : prediction->CameraPoses)
        {
            // This represents the device-based resources for a HolographicCamera.
            DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

            // Get the device context.
            const auto context = m_deviceResources->GetD3DDeviceContext();
            const auto depthStencilView = pCameraResources->GetDepthStencilView();

            // Set render targets to the current holographic camera.
            ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
            context->OMSetRenderTargets(1, targets, depthStencilView);

            // Clear the back buffer and depth stencil view.
            context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
            context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

            //
            // TODO: Replace the sample content with your own content.
            //
            // Notes regarding holographic content:
            //    * For drawing, remember that you have the potential to fill twice as many pixels
            //      in a stereoscopic render target as compared to a non-stereoscopic render target
            //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
            //      and only draw holograms that the user can see.
            //    * To help occlude hologram geometry, you can create a depth map using geometry
            //      data obtained via the surface mapping APIs. You can use this depth map to avoid
            //      rendering holograms that are intended to be hidden behind tables, walls,
            //      monitors, and so on.
            //    * Black pixels will appear transparent to the user wearing the device, but you
            //      should still use alpha blending to draw semitransparent holograms. You should
            //      also clear the screen to Transparent as shown above.
            //

            // The view and projection matrices for each holographic camera will change
            // every frame. This function refreshes the data in the constant buffer for
            // the holographic camera indicated by cameraPose.
            pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->CoordinateSystem);

            // Attach the view/projection constant buffer for this camera to the graphics pipeline.
            bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);

            // Only render world-locked content when positional tracking is active.
            if (cameraActive)
            {
                // Draw the sample hologram.
                m_spinningCubeRenderer->Render();
            }
            atLeastOneCameraRendered = true;
        }

        return atLeastOneCameraRendered;
    });
}

void SaveAppState ( )

Definition at line 582 of file HolographicVoiceInputMain.cpp.

{
    //
    // TODO: Insert code here to save your app state.
    //       This method is called when the app is about to suspend.
    //
    //       For example, store information in the SpatialAnchorStore.
    //
}

void SetHolographicSpace ( Windows::Graphics::Holographic::HolographicSpace^ holographicSpace )
task< bool > StartRecognizeSpeechCommands ( ) [private]

Definition at line 192 of file HolographicVoiceInputMain.cpp.

{
    return StopCurrentRecognizerIfExists().then([this]()
    {
        if (!InitializeSpeechRecognizer())
        {
            return task_from_result<bool>(false);
        }

        // Here, we compile the list of voice commands by reading them from the map.
        Platform::Collections::Vector<String^>^ speechCommandList = ref new Platform::Collections::Vector<String^>();
        for each (auto pair in m_speechCommandData)
        {
            // The speech command string is what we are looking for here. Later, we can use the
            // recognition result for this string to look up a color value.
            auto command = pair->Key;

            // Add it to the list.
            speechCommandList->Append(command);
        }

        SpeechRecognitionListConstraint^ spConstraint = ref new SpeechRecognitionListConstraint(speechCommandList);
        m_speechRecognizer->Constraints->Clear();
        m_speechRecognizer->Constraints->Append(spConstraint);
        return create_task(m_speechRecognizer->CompileConstraintsAsync()).then([this](task<SpeechRecognitionCompilationResult^> previousTask)
        {
            try
            {
                SpeechRecognitionCompilationResult^ compilationResult = previousTask.get();

                if (compilationResult->Status == SpeechRecognitionResultStatus::Success)
                {
                    // If compilation succeeds, we can start listening for results.
                    return create_task(m_speechRecognizer->ContinuousRecognitionSession->StartAsync()).then([this](task<void> startAsyncTask) {

                        try
                        {
                            // StartAsync may throw an exception if your app doesn't have Microphone permissions.
                            // Make sure they're caught and handled appropriately (otherwise the app may silently not work as expected)
                            startAsyncTask.get();
                            return true;
                        }
                        catch (Exception^ exception)
                        {
                            PrintWstringToDebugConsole(
                                std::wstring(L"Exception while trying to start speech Recognition: ") +
                                exception->Message->Data() +
                                L"\n"
                            );

                            return false;
                        }
                    });
                }
                else
                {
                    OutputDebugStringW(L"Could not initialize constraint-based speech engine!\n");

                    // Handle errors here.
                    return create_task([this] {return false; });
                }
            }
            catch (Exception^ exception)
            {
                // Note that if you get an "Access is denied" exception, you might need to enable the microphone
                // privacy setting on the device and/or add the microphone capability to your app manifest.

                PrintWstringToDebugConsole(
                    std::wstring(L"Exception while trying to initialize speech command list:") +
                    exception->Message->Data() +
                    L"\n"
                );

                // Handle exceptions here.
                return create_task([this] {return false; });
            }
        });
    });
}

Concurrency::task< void > StopCurrentRecognizerIfExists ( ) [private]

Definition at line 150 of file HolographicVoiceInputMain.cpp.

{
    if (m_speechRecognizer != nullptr)
    {
        return create_task(m_speechRecognizer->StopRecognitionAsync()).then([this]()
        {
            m_speechRecognizer->RecognitionQualityDegrading -= m_speechRecognitionQualityDegradedToken;

            if (m_speechRecognizer->ContinuousRecognitionSession != nullptr)
            {
                m_speechRecognizer->ContinuousRecognitionSession->ResultGenerated -= m_speechRecognizerResultEventToken;
            }
        });
    }
    else
    {
        return create_task([this]() { });
    }
}

void UnregisterHolographicEventHandlers ( ) [private]

Definition at line 347 of file HolographicVoiceInputMain.cpp.

{
    if (m_holographicSpace != nullptr)
    {
        // Clear previous event registrations.

        if (m_cameraAddedToken.Value != 0)
        {
            m_holographicSpace->CameraAdded -= m_cameraAddedToken;
            m_cameraAddedToken.Value = 0;
        }

        if (m_cameraRemovedToken.Value != 0)
        {
            m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
            m_cameraRemovedToken.Value = 0;
        }
    }

    if (m_locator != nullptr)
    {
        m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
    }
}

HolographicFrame Update ( )

Definition at line 381 of file HolographicVoiceInputMain.cpp.

{
    // Before doing the timer update, there is some work to do per-frame
    // to maintain holographic rendering. First, we will get information
    // about the current frame.

    // The HolographicFrame has information that the app needs in order
    // to update and render the current frame. The app begins each new
    // frame by calling CreateNextFrame.
    HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();

    // Get a prediction of where holographic cameras will be when this frame
    // is presented.
    HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;

    // Back buffers can change from frame to frame. Validate each buffer, and recreate
    // resource views and depth buffers as needed.
    m_deviceResources->EnsureCameraResources(holographicFrame, prediction);

    // Next, we get a coordinate system from the attached frame of reference that is
    // associated with the current frame. Later, this coordinate system is used for
    // for creating the stereo view matrices when rendering the sample content.
    SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->CoordinateSystem;

    // Check for new input state since the last frame.
    SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
    if (pointerState != nullptr)
    {
        // When a Pressed gesture is detected, the sample hologram will be repositioned
        // two meters in front of the user.
        m_spinningCubeRenderer->PositionHologram(
            pointerState->TryGetPointerPose(currentCoordinateSystem)
            );
    }

    // Check for new speech input since the last frame.
    if (m_lastCommand != nullptr)
    {
        auto command = m_lastCommand;
        m_lastCommand = nullptr;

        // Check to see if the spoken word or phrase, matches up with any of the speech
        // commands in our speech command map.
        for each (auto& iter in m_speechCommandData)
        {
            std::wstring lastCommandString = command->Data();
            std::wstring listCommandString = iter->Key->Data();

            if (lastCommandString.find(listCommandString) != std::wstring::npos)
            {
                // If so, we can set the cube to the color that was spoken.
                m_spinningCubeRenderer->SetColor(iter->Value);
                break;
            }
        }
    }

    m_timer.Tick([&] ()
    {
        //
        // TODO: Update scene objects.
        //
        // Put time-based updates here. By default this code will run once per frame,
        // but if you change the StepTimer to use a fixed time step this code will
        // run as many times as needed to get to the current step.
        //

        m_spinningCubeRenderer->Update(m_timer);

        // Wait to listen for speech input until the audible UI prompts are complete.
        if ((m_waitingForSpeechPrompt == true) &&
            ((m_secondsUntilSoundIsComplete -= static_cast<float>(m_timer.GetElapsedSeconds())) <= 0.f))
        {
            m_waitingForSpeechPrompt = false;
            PlayRecognitionBeginSound();
        }
        else if ((m_waitingForSpeechCue == true) &&
            ((m_secondsUntilSoundIsComplete -= static_cast<float>(m_timer.GetElapsedSeconds())) <= 0.f))
        {
            m_waitingForSpeechCue = false;
            m_secondsUntilSoundIsComplete = 0.f;
            StartRecognizeSpeechCommands();
        }

    });

    // We complete the frame update by using information about our content positioning
    // to set the focus point.

    for (auto cameraPose : prediction->CameraPoses)
    {
        // The HolographicCameraRenderingParameters class provides access to set
        // the image stabilization parameters.
        HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);

        // SetFocusPoint informs the system about a specific point in your scene to
        // prioritize for image stabilization. The focus point is set independently
        // for each holographic camera.
        // You should set the focus point near the content that the user is looking at.
        // In this example, we put the focus point at the center of the sample hologram,
        // since that is the only hologram available for the user to focus on.
        // You can also set the relative velocity and facing of that content; the sample
        // hologram is at a fixed point so we only need to indicate its position.
        renderingParameters->SetFocusPoint(
            currentCoordinateSystem,
            m_spinningCubeRenderer->GetPosition()
            );
    }

    // The holographic frame will be used to get up-to-date view and projection matrices and
    // to present the swap chain.
    return holographicFrame;
}

Member Data Documentation

Windows::Foundation::EventRegistrationToken m_cameraAddedToken [private]

Definition at line 131 of file HolographicVoiceInputMain.h.

Windows::Foundation::EventRegistrationToken m_cameraRemovedToken [private]

Definition at line 132 of file HolographicVoiceInputMain.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 116 of file HolographicVoiceInputMain.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace [private]

Definition at line 122 of file HolographicVoiceInputMain.h.

Platform::String m_lastCommand [private]

Definition at line 148 of file HolographicVoiceInputMain.h.

bool m_listening [private]

Definition at line 138 of file HolographicVoiceInputMain.h.

Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken [private]

Definition at line 133 of file HolographicVoiceInputMain.h.

Windows::Perception::Spatial::SpatialLocator m_locator [private]

Definition at line 125 of file HolographicVoiceInputMain.h.

OmnidirectionalSound m_recognitionSound [private]

Definition at line 152 of file HolographicVoiceInputMain.h.

Windows::Perception::Spatial::SpatialStationaryFrameOfReference m_referenceFrame [private]

Definition at line 128 of file HolographicVoiceInputMain.h.

float m_secondsUntilSoundIsComplete = 0.f [private]

Definition at line 157 of file HolographicVoiceInputMain.h.

std::shared_ptr<SpatialInputHandler> m_spatialInputHandler [private]

Definition at line 113 of file HolographicVoiceInputMain.h.

Platform::Collections::Map<Platform::String^, Windows::Foundation::Numerics::float4> m_speechCommandData [private]

Definition at line 145 of file HolographicVoiceInputMain.h.

Windows::Foundation::EventRegistrationToken m_speechRecognitionQualityDegradedToken [private]

Definition at line 136 of file HolographicVoiceInputMain.h.

Windows::Media::SpeechRecognition::SpeechRecognizer m_speechRecognizer [private]

Definition at line 141 of file HolographicVoiceInputMain.h.

Windows::Foundation::EventRegistrationToken m_speechRecognizerResultEventToken [private]

Definition at line 135 of file HolographicVoiceInputMain.h.

OmnidirectionalSound m_speechSynthesisSound [private]

Definition at line 151 of file HolographicVoiceInputMain.h.

std::unique_ptr<SpinningCubeRenderer> m_spinningCubeRenderer [private]

Definition at line 110 of file HolographicVoiceInputMain.h.

OmnidirectionalSound m_startRecognitionSound [private]

Definition at line 153 of file HolographicVoiceInputMain.h.

DX::StepTimer m_timer [private]

Definition at line 119 of file HolographicVoiceInputMain.h.

bool m_waitingForSpeechCue = false [private]

Definition at line 156 of file HolographicVoiceInputMain.h.

bool m_waitingForSpeechPrompt = false [private]

Definition at line 155 of file HolographicVoiceInputMain.h.

The documentation for this class was generated from the following files:
  • HolographicVoiceInput/cpp/HolographicVoiceInputMain.h
  • HolographicVoiceInput/cpp/HolographicVoiceInputMain.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelColorConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • ModelColorConstantBuffer
Public Attributes

ModelColorConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | color
DirectX::XMFLOAT4X4 | model

Detailed Description

Definition at line 16 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 color

Definition at line 19 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 model

Definition at line 18 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicVoiceInput/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "AppView.h"

List of all members.

Public Member Functions

AppView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnKeyPressed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnViewActivated (Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Windows::Graphics::Holographic::HolographicSpace | m_holographicSpace = nullptr
std::unique_ptr
< HolographicVoiceInputMain > 		m_main
bool | m_windowClosed = false
bool | m_windowVisible = true

Detailed Description

Definition at line 19 of file AppView.h.

Member Function Documentation

AppView ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnKeyPressed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::KeyEventArgs^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnViewActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | sender,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 47 of file AppView.h.

Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr [private]

Definition at line 52 of file AppView.h.

std::unique_ptr<HolographicVoiceInputMain> m_main [private]

Definition at line 45 of file AppView.h.

bool m_windowClosed = false [private]

Definition at line 48 of file AppView.h.

bool m_windowVisible = true [private]

Definition at line 49 of file AppView.h.

The documentation for this class was generated from the following file:
  • HolographicVoiceInput/cpp/AppView.h
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInputHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • SpatialInputHandler
Public Member Functions | Private Member Functions | Private Attributes

SpatialInputHandler Class Reference

#include "SpatialInputHandler.h"

List of all members.

Public Member Functions

SpatialInputHandler ()
~SpatialInputHandler ()
Windows::UI::Input::Spatial::SpatialInteractionSourceState | CheckForInput ()

Private Member Functions

void | OnSourcePressed (Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args)

Private Attributes

Windows::UI::Input::Spatial::SpatialInteractionManager | m_interactionManager
Windows::Foundation::EventRegistrationToken | m_sourcePressedEventToken
Windows::UI::Input::Spatial::SpatialInteractionSourceState | m_sourceState = nullptr

Detailed Description

Definition at line 17 of file SpatialInputHandler.h.

Constructor & Destructor Documentation

SpatialInputHandler ( )

Definition at line 22 of file SpatialInputHandler.cpp.

{
    // The interaction manager provides an event that informs the app when
    // spatial interactions are detected.
    m_interactionManager = SpatialInteractionManager::GetForCurrentView();

    // Bind a handler to the SourcePressed event.
    m_sourcePressedEventToken =
        m_interactionManager->SourcePressed +=
            ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
                bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
                );

    //
    // TODO: Expand this class to use other gesture-based input events as applicable to
    //       your app.
    //
}

~SpatialInputHandler ( )

Definition at line 41 of file SpatialInputHandler.cpp.

{
    // Unregister our handler for the OnSourcePressed event.
    m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
}

Member Function Documentation

SpatialInteractionSourceState CheckForInput ( )

Definition at line 50 of file SpatialInputHandler.cpp.

{
    SpatialInteractionSourceState^ sourceState = m_sourceState;
    m_sourceState = nullptr;
    return sourceState;
}

void OnSourcePressed | ( | Windows::UI::Input::Spatial::SpatialInteractionManager^ | sender,
 |  | Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

Windows::UI::Input::Spatial::SpatialInteractionManager m_interactionManager [private]

Definition at line 32 of file SpatialInputHandler.h.

Windows::Foundation::EventRegistrationToken m_sourcePressedEventToken [private]

Definition at line 35 of file SpatialInputHandler.h.

Windows::UI::Input::Spatial::SpatialInteractionSourceState m_sourceState = nullptr [private]

Definition at line 38 of file SpatialInputHandler.h.

The documentation for this class was generated from the following files:
  • HolographicVoiceInput/cpp/Content/SpatialInputHandler.h
  • HolographicVoiceInput/cpp/Content/SpatialInputHandler.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpinningCubeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • SpinningCubeRenderer
Public Member Functions | Private Attributes

SpinningCubeRenderer Class Reference

#include "SpinningCubeRenderer.h"

List of all members.

Public Member Functions

SpinningCubeRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
Windows::Foundation::Numerics::float3 GetPosition ()
void | PositionHologram (Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | SetColor (Windows::Foundation::Numerics::float4 const &color)
void | SetPosition (Windows::Foundation::Numerics::float3 pos)
void | Update (const DX::StepTimer &timer)

Private Attributes

float | m_degreesPerSecond = 45.f
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_indexBuffer
uint32 | m_indexCount = 0
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
bool | m_loadingComplete = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelConstantBuffer
ModelColorConstantBuffer m_modelConstantBufferData
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_pixelShader
Windows::Foundation::Numerics::float3 | m_position = { 0.f, 0.f, -2.f }
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexBuffer
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 20 of file SpinningCubeRenderer.h.

Constructor & Destructor Documentation

SpinningCubeRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 22 of file SpinningCubeRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources)
{
    // For speech example.
    // Set the initial color to white.
    m_modelConstantBufferData.color = { 1.f, 1.f, 0.f, 1.f };

    CreateDeviceDependentResources();
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 173 of file SpinningCubeRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
        {{
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        }};

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc.data(),
                vertexDesc.size(),
                fileData.data(),
                fileData.size(),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
    {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                fileData.data(),
                fileData.size(),
                nullptr,
                &m_pixelShader
                )
            );

        const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelColorConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &constantBufferDesc,
                nullptr,
                &m_modelConstantBuffer
                )
            );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    fileData.data(),
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
    task<void> createCubeTask  = shaderTaskGroup.then([this] ()
    {
        // Load mesh vertices. Each vertex has a position and a color.
        // Note that the cube size has changed from the default DirectX app
        // template. Windows Holographic is scaled in meters, so to draw the
        // cube at a comfortable size we made the cube width 0.2 m (20 cm).
        static const std::array<VertexPositionColor, 8> cubeVertices =
        {{
            { XMFLOAT3(-0.1f, -0.1f, -0.1f), XMFLOAT3(0.0f, 0.0f, 0.0f) },
            { XMFLOAT3(-0.1f, -0.1f,  0.1f), XMFLOAT3(0.0f, 0.0f, 1.0f) },
            { XMFLOAT3(-0.1f,  0.1f, -0.1f), XMFLOAT3(0.0f, 1.0f, 0.0f) },
            { XMFLOAT3(-0.1f,  0.1f,  0.1f), XMFLOAT3(0.0f, 1.0f, 1.0f) },
            { XMFLOAT3( 0.1f, -0.1f, -0.1f), XMFLOAT3(1.0f, 0.0f, 0.0f) },
            { XMFLOAT3( 0.1f, -0.1f,  0.1f), XMFLOAT3(1.0f, 0.0f, 1.0f) },
            { XMFLOAT3( 0.1f,  0.1f, -0.1f), XMFLOAT3(1.0f, 1.0f, 0.0f) },
            { XMFLOAT3( 0.1f,  0.1f,  0.1f), XMFLOAT3(1.0f, 1.0f, 1.0f) },
        }};

        D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
        vertexBufferData.pSysMem                = cubeVertices.data();
        vertexBufferData.SysMemPitch            = 0;
        vertexBufferData.SysMemSlicePitch       = 0;
        const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionColor) * cubeVertices.size(), D3D11_BIND_VERTEX_BUFFER);
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateBuffer(
                &vertexBufferDesc,
                &vertexBufferData,
                &m_vertexBuffer
                )
            );

        // Load mesh indices. Each trio of indices represents
        // a triangle to be rendered on the screen.
        // For example: 2,1,0 means that the vertices with indexes
        // 2, 1, and 0 from the vertex buffer compose the
        // first triangle of this mesh.
        // Note that the winding order is clockwise by default.
        constexpr std::array<unsigned short, 36> cubeIndices =
        {{
            2,1,0, // -x
            2,3,1,

            6,4,5, // +x
            6,5,7,

            0,1,5, // -y
            0,5,4,

            2,6,7, // +y
            2,7,3,

            0,4,6, // -z
            0,6,2,

            1,3,7, // +z
            1,7,5,
        }};

        m_indexCount = cubeIndices.size();

        D3D11_SUBRESOURCE_DATA indexBufferData  = {0};
        indexBufferData.pSysMem                 = cubeIndices.data();
        indexBufferData.SysMemPitch             = 0;
        indexBufferData.SysMemSlicePitch        = 0;
        CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * cubeIndices.size(), D3D11_BIND_INDEX_BUFFER);
        DX::ThrowIfFailed(
        m_deviceResources->GetD3DDevice()->CreateBuffer(
                &indexBufferDesc,
                &indexBufferData,
                &m_indexBuffer
                )
            );
    });

    // Once the cube is loaded, the object is ready to be rendered.
    createCubeTask.then([this] ()
    {
        m_loadingComplete = true;
    });
}

Windows::Foundation::Numerics::float3 GetPosition ( ) [inline]

Definition at line 34 of file SpinningCubeRenderer.h.

{ return m_position; }

void PositionHologram ( Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose )
void ReleaseDeviceDependentResources ( )

Definition at line 346 of file SpinningCubeRenderer.cpp.

{
    m_loadingComplete  = false;
    m_usingVprtShaders = false;
    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_pixelShader.Reset();
    m_geometryShader.Reset();
    m_modelConstantBuffer.Reset();
    m_vertexBuffer.Reset();
    m_indexBuffer.Reset();
}

void Render ( )

Definition at line 102 of file SpinningCubeRenderer.cpp.

{
    // Loading is asynchronous. Resources must be created before drawing can occur.
    if (!m_loadingComplete)
    {
        return;
    }

    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Each vertex is one instance of the VertexPositionColor struct.
    const UINT stride = sizeof(VertexPositionColor);
    const UINT offset = 0;
    context->IASetVertexBuffers(
        0,
        1,
        m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );
    context->IASetIndexBuffer(
        m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
        0
        );
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach the vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );
    // Apply the model constant buffer to the vertex shader.
    context->VSSetConstantBuffers(
        0,
        1,
        m_modelConstantBuffer.GetAddressOf()
        );

    if (!m_usingVprtShaders)
    {
        // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
        // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
        // a pass-through geometry shader is used to set the render target
        // array index.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    // Attach the pixel shader.
    context->PSSetShader(
        m_pixelShader.Get(),
        nullptr,
        0
        );

    // Draw the objects.
    context->DrawIndexedInstanced(
        m_indexCount,   // Index count per instance.
        2,              // Instance count.
        0,              // Start index location.
        0,              // Base vertex location.
        0               // Start instance location.
        );
}

void SetColor ( Windows::Foundation::Numerics::float4 const & color ) [inline]

Definition at line 37 of file SpinningCubeRenderer.h.

{ m_modelConstantBufferData.color = *reinterpret_cast<DirectX::XMFLOAT4 const*>(&color); }

void SetPosition ( Windows::Foundation::Numerics::float3 pos ) [inline]

Definition at line 33 of file SpinningCubeRenderer.h.

{ m_position = pos;  }

void Update ( const DX::StepTimer & timer )

Definition at line 54 of file SpinningCubeRenderer.cpp.

{
    // Rotate the cube.
    // Convert degrees to radians, then convert seconds to rotation angle.
    const float    radiansPerSecond = XMConvertToRadians(m_degreesPerSecond);
    const double   totalRotation    = timer.GetTotalSeconds() * radiansPerSecond;
    const float    radians          = static_cast<float>(fmod(totalRotation, XM_2PI));
    const XMMATRIX modelRotation    = XMMatrixRotationY(-radians);

    // Position the cube.
    const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));

    // Multiply to get the transform matrix.
    // Note that this transform does not enforce a particular coordinate system. The calling
    // class is responsible for rendering this content in a consistent manner.
    const XMMATRIX modelTransform   = XMMatrixMultiply(modelRotation, modelTranslation);

    // The view and projection matrices are provided by the system; they are associated
    // with holographic cameras, and updated on a per-camera basis.
    // Here, we provide the model transform for the sample hologram. The model transform
    // matrix is transposed to prepare it for the shader.
    XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));

    // Loading is asynchronous. Resources must be created before they can be updated.
    if (!m_loadingComplete)
    {
        return;
    }

    // Use the D3D device context to update Direct3D device-based resources.
    const auto context = m_deviceResources->GetD3DDeviceContext();

    // Update the model transform buffer for the hologram.
    context->UpdateSubresource(
        m_modelConstantBuffer.Get(),
        0,
        nullptr,
        &m_modelConstantBufferData,
        0,
        0
        );
}

Member Data Documentation

float m_degreesPerSecond = 45.f [private]

Definition at line 58 of file SpinningCubeRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 41 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 48 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer [private]

Definition at line 46 of file SpinningCubeRenderer.h.

uint32 m_indexCount = 0 [private]

Definition at line 54 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 44 of file SpinningCubeRenderer.h.

bool m_loadingComplete = false [private]

Definition at line 57 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer [private]

Definition at line 50 of file SpinningCubeRenderer.h.

ModelColorConstantBuffer m_modelConstantBufferData [private]

Definition at line 53 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 49 of file SpinningCubeRenderer.h.

Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f } [private]

Definition at line 59 of file SpinningCubeRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 63 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer [private]

Definition at line 45 of file SpinningCubeRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 47 of file SpinningCubeRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.h
  • HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HolographicVoiceInput
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 27 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 30 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 29 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicVoiceInput/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AuthenticationTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HotspotAuthenticationTask
  • AuthenticationTask
Public Member Functions | Private Member Functions | Private Attributes

AuthenticationTask Class Reference

List of all members.

Public Member Functions

async void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

async Task | AuthenticateInBackgroundAsync ()
void | ContinueAuthenticationInForeground ()
void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
async Task | RunAsync ()

Private Attributes

volatile bool | _cancelRequested = false
HotspotAuthenticationContext | _context
HotspotAuthenticationEventDetails | _details
const string | _foregroundAppId = "HotspotAuthenticationApp.App"

Detailed Description

Definition at line 24 of file BackgroundTask.cs.

Member Function Documentation

async Task AuthenticateInBackgroundAsync ( ) [inline, private]

Definition at line 105 of file BackgroundTask.cs.

        {
            // In case this handler performs more complex tasks, it may get canceled at runtime.
            // Check if task was canceled by now.
            if (_cancelRequested)
            {
                // In case the task handler takes too long to generate credentials and gets canceled,
                // the handler should terminate the authentication by aborting it
                Debug.WriteLine("Aborting authentication");
                _context.AbortAuthentication(ConfigStore.MarkAsManualConnect);
                return;
            }

            if (ConfigStore.UseNativeWISPr)
            {
                // The most common way of handling an authentication attempt is by providing WISPr credentials
                // through the IssueCredentialsAsync API.
                // If the task doesn't take any actions for authentication failures, it can use the
                // IssueCredentials API to just provide credenstials.
                // Alternatively, an application could run its own business logic to authentication with the
                // hotspot. In this case it should call the SkipAuthentication API. Note that it should call
                // SkipAuthentication after it has authenticated to allow Windows to refresh the network connectivity
                // state instantly.
                Debug.WriteLine("Issuing credentials");
                HotspotCredentialsAuthenticationResult result = await _context.IssueCredentialsAsync(
                    ConfigStore.UserName, ConfigStore.Password, ConfigStore.ExtraParameters, ConfigStore.MarkAsManualConnect);
                if (result.ResponseCode == HotspotAuthenticationResponseCode.LoginSucceeded)
                {
                    Debug.WriteLine("Issuing credentials succeeded");
                    Uri logoffUrl = result.LogoffUrl;
                    if (logoffUrl != null)
                    {
                        Debug.WriteLine("The logoff URL is: " + logoffUrl.OriginalString);
                    }
                }
                else
                {
                    Debug.WriteLine("Issuing credentials failed");
                }
            }
            else
            {
                //TODO: Please perform any authentication that is required by your particular scenario.
                // Check _cancelRequested periodically in case the task is canceled.

                // Finally call SkipAuthentication to indicate that we are not doing native WISPr authentication
                // This call also serves the purpose of indicating a successful authentication.
                _context.SkipAuthentication();
            }
        }

void ContinueAuthenticationInForeground ( ) [inline, private]

Definition at line 156 of file BackgroundTask.cs.

        {
            Debug.WriteLine("Triggering foreground application");
            // Pass event token to application
            ConfigStore.AuthenticationToken = _details.EventToken;

            // Trigger notification
            // Since TriggerAttentionRequired function throws NotImplementedException on phone we will be using
            // regular Toast Notification to notify user about the authentication, Tapping on the notification will
            // launch the application where user can complete the authentication
            if (ConfigStore.UseNativeWISPr)
            {
                // The second parameter is used as the activation command line.
                _context.TriggerAttentionRequired(_foregroundAppId, "");
            }
            else
            {
                var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
                toastXml.GetElementsByTagName("text")[0].AppendChild(toastXml.CreateTextNode("Auth by foreground"));
                IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
                ((XmlElement)toastNode).SetAttribute("launch", "AuthByForeground");

                var toast = new ToastNotification(toastXml);
                toast.Tag = "AuthByForeground";
                toast.Group = "HotspotAuthAPI";

                var notification = ToastNotificationManager.CreateToastNotifier();
                notification.Show(toast);
            }
        }

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 188 of file BackgroundTask.cs.

        {
            // Indicate that the background task is canceled.
            _cancelRequested = true;

            Debug.WriteLine("Background " + sender.Task.Name + " cancel requested...");
        }

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 33 of file BackgroundTask.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " starting...");

            // Convert the trigger details to a HotspotAuthenticationEventDetails.
            _details = taskInstance.TriggerDetails as HotspotAuthenticationEventDetails;

            // Associate a cancelation handler with the background task for handlers
            // that may take a considerable time to complete.
            taskInstance.Canceled += OnCanceled;

            // Take a deferral so that we can call asynchronous APIs.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            // The real work happens in RunAsync.
            await RunAsync();

            Debug.WriteLine("Background " + taskInstance.Task.Name + " completed");

            deferral.Complete();
        }

async Task RunAsync ( ) [inline, private]

Definition at line 55 of file BackgroundTask.cs.

        {
            // Do the background task activity. First, get the authentication context.
            Debug.WriteLine("Getting event details");

            if (!HotspotAuthenticationContext.TryGetAuthenticationContext(_details.EventToken, out _context))
            {
                // The event is not targetting this application. There is no further processing to do.
                Debug.WriteLine("Failed to get event context");
                return;
            }

            byte[] ssid = _context.WirelessNetworkId;
            Debug.WriteLine("SSID: " + System.Text.UTF8Encoding.UTF8.GetString(ssid, 0, ssid.Length));

            if (ConfigStore.UseNativeWISPr)
            {
                // Following code can be used if using native WISPr implementation. Please note that
                // following HotspotAuthenticationContext properties only work on windows and not on windows phone.
                // On Windows Phone they return un-useful strings
                // Developers are expected to implement their own WISPr implementation on Phone

                Debug.WriteLine("AuthenticationUrl: " + _context.AuthenticationUrl.OriginalString);
                Debug.WriteLine("RedirectMessageUrl: " + _context.RedirectMessageUrl.OriginalString);
                Debug.WriteLine("RedirectMessageXml: " + _context.RedirectMessageXml.GetXml());

                // In this sample, the AuthenticationUrl is always checked in the background task handler
                // to avoid launching the foreground app in case the authentication host is not trusted.
                if (ConfigStore.AuthenticationHost != _context.AuthenticationUrl.Host)
                {
                    // Hotspot is not using the trusted authentication server.
                    // Abort authentication and disconnect.
                    Debug.WriteLine("Authentication server is untrusted");
                    _context.AbortAuthentication(ConfigStore.MarkAsManualConnect);
                    return;
                }
            }

            // Run the appropriate scenario selected by the foreground app.
            if (ConfigStore.AuthenticateThroughBackgroundTask)
            {
                await AuthenticateInBackgroundAsync();
            }
            else
            {
                ContinueAuthenticationInForeground();
            }
            return;
        }

Member Data Documentation

volatile bool _cancelRequested = false [private]

Definition at line 27 of file BackgroundTask.cs.

HotspotAuthenticationContext _context [private]

Definition at line 30 of file BackgroundTask.cs.

HotspotAuthenticationEventDetails _details [private]

Definition at line 29 of file BackgroundTask.cs.

const string _foregroundAppId = "HotspotAuthenticationApp.App" [private]

Definition at line 26 of file BackgroundTask.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/HotspotAuthenticationTask/BackgroundTask.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConfigStore Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • HotspotAuthenticationTask
  • ConfigStore
Static Public Attributes | Properties | Static Private Member Functions

ConfigStore Class Reference

List of all members.

Static Public Attributes

static string | AuthenticationHost = "login.contoso.com"
static string | ExtraParameters = ""
static bool | MarkAsManualConnect = > false
static string | Password = "MyPassword"
static string | UserName = "MyUserName"

Properties

static bool | AuthenticateThroughBackgroundTask [get, set]
static string | AuthenticationToken [get, set]
static bool | UseNativeWISPr [get, set]

Static Private Member Functions

static T | GetValueWithDefault< T > (string name, T defaultValue)

Detailed Description

Definition at line 23 of file ConfigStore.cs.

Member Function Documentation

static T GetValueWithDefault< T > | ( | string | name,
 |  | T | defaultValue |
 | ) |  |  | [inline, static, private]

Member Data Documentation

string AuthenticationHost = "login.contoso.com" [static]

Definition at line 26 of file ConfigStore.cs.

string ExtraParameters = "" [static]

Definition at line 29 of file ConfigStore.cs.

bool MarkAsManualConnect = > false [static]

Definition at line 30 of file ConfigStore.cs.

string Password = "MyPassword" [static]

Definition at line 28 of file ConfigStore.cs.

string UserName = "MyUserName" [static]

Definition at line 27 of file ConfigStore.cs.

Property Documentation

bool AuthenticateThroughBackgroundTask [static, get, set]

Definition at line 41 of file ConfigStore.cs.

string AuthenticationToken [static, get, set]

Definition at line 49 of file ConfigStore.cs.

bool UseNativeWISPr [static, get, set]

Definition at line 33 of file ConfigStore.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/HotspotAuthenticationTask/ConfigStore.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IMFAsyncCallback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMFAsyncCallback Class Reference

Inherited by AsyncCallback< T >, AsyncCallback< CMediaSource >, AsyncCallback< CStreamSink >, and EmbeddedMFAsyncCallback< Callback >.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/AsyncCB.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IMFAttributes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMFAttributes Class Reference

Inherited by CBaseAttributes<>.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BaseAttributes.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImportableItemWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ImportSample
  • ImportableItemWrapper
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

ImportableItemWrapper Class Reference

Wrapper for the thumbnail and the ImportableItem. More...

List of all members.

Public Member Functions

ImportableItemWrapper (PhotoImportItem importableItem)
async void | LoadThumbnail ()

Properties

PhotoImportItem | ImportableItem [get, set]
BitmapImage | Thumbnail [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyProperty (string propertyName)

Private Attributes

BitmapImage | thumbnail

Detailed Description

Definition at line 17 of file ImportableItemWrapper.cs.

Constructor & Destructor Documentation

ImportableItemWrapper ( PhotoImportItem importableItem ) [inline]

Definition at line 42 of file ImportableItemWrapper.cs.

        {
            ImportableItem = importableItem;
            LoadThumbnail();
        }

Member Function Documentation

async void LoadThumbnail ( ) [inline]

Definition at line 55 of file ImportableItemWrapper.cs.

        {
           var thumbnailResult = await ImportableItem.Thumbnail.OpenReadAsync();

           // if there is contention accessing the device the thumbnail will be null.
           if (thumbnailResult != null)
           {
                var thumb = new BitmapImage();
                thumb.SetSource(thumbnailResult);
                this.Thumbnail = thumb;
           }
        }

void NotifyProperty ( string propertyName ) [inline, private]

Definition at line 50 of file ImportableItemWrapper.cs.

        {
            this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

Member Data Documentation

BitmapImage thumbnail [private]

Definition at line 19 of file ImportableItemWrapper.cs.

Property Documentation

PhotoImportItem ImportableItem [get, set]

Definition at line 37 of file ImportableItemWrapper.cs.

BitmapImage Thumbnail [get, set]

Definition at line 21 of file ImportableItemWrapper.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 48 of file ImportableItemWrapper.cs.

The documentation for this class was generated from the following file:
  • MediaImport/cs/ImportableItemWrapper.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ImportSample
  • Scenario1
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

bool | AppendSessionDateToDestinationFolder [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | CheckBox_Click (object sender, RoutedEventArgs e)
void | DisplayDeletedResults ()
void | DisplayFindItemsResult ()
void | DisplayImportedSummary ()
void | DisplaySourceProperties ()
void | ExifDateSubfolder_checked (object sender, RoutedEventArgs e)
void | FileDateSubfolder_checked (object sender, RoutedEventArgs e)
async void | findItems (PhotoImportContentTypeFilter contentType, PhotoImportItemSelectionMode selectionMode)
void | ImagesAndVideo_Checked (object sender, RoutedEventArgs e)
void | KeepOriginalFolder_checked (object sender, RoutedEventArgs e)
void | NoSubFolder_checked (object sender, RoutedEventArgs e)
void | OnCancelButtonClicked (object sender, RoutedEventArgs e)
async void | OnDeleteButtonClicked (object sender, RoutedEventArgs e)
void | OnFindAllItemsClicked (object sender, RoutedEventArgs e)
void | OnFindNewItemsClicked (object sender, RoutedEventArgs e)
async void | OnFindSourcesClicked (object sender, RoutedEventArgs e)
async void | OnImportButtonClicked (object sender, RoutedEventArgs e)
void | OnlyImages_Checked (object sender, RoutedEventArgs e)
void | OnlyVideo_Checked (object sender, RoutedEventArgs e)
void | OnSelectAllButtonClicked (object sender, RoutedEventArgs e)
async void | OnSelectNewButtonClicked (object sender, RoutedEventArgs e)
void | OnSelectNoneButtonClicked (object sender, RoutedEventArgs e)
void | RaisePropertyChanged (string propName)
void | setButtonState (bool isEnabled)
void | setIncrementalFileList (PhotoImportFindItemsResult list)
void | SourceList_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

DeviceActivatedEventArgs | arguments
PhotoImportContentTypeFilter | contentTypeFilder
CancellationTokenSource | cts
PhotoImportDeleteImportedItemsFromSourceResult | deleteResult
PhotoImportImportItemsResult | importedResult
PhotoImportSource | importSource
PhotoImportFindItemsResult | itemsResult
GeneratorIncrementalLoadingClass
< ImportableItemWrapper > 		itemsToImport = null
MainPage rootPage
PhotoImportSession | session

Detailed Description

Definition at line 34 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 50 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

void CheckBox_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

When a checkbox is clicked, update the UI to the latest selection.

Parameters:
sender | Sender
e | RoutedEventArgs

Definition at line 595 of file Scenario1.xaml.cs.

        {
            // update the result count
            DisplayFindItemsResult();
        }

void DisplayDeletedResults ( ) [inline, private]

Helper method to display the imported files that were deleted.

Definition at line 550 of file Scenario1.xaml.cs.

        {
            if (deleteResult != null)
            {
                StringBuilder deletedResults = new StringBuilder();
                deletedResults.AppendLine(String.Format("Total Photos Deleted:\t{0} ", deleteResult.PhotosCount));
                deletedResults.AppendLine(String.Format("Total Videos Deleted:\t{0} ", deleteResult.VideosCount));
                deletedResults.AppendLine(String.Format("Total Sidecars Deleted:\t{0} ", deleteResult.SidecarsCount));
                deletedResults.AppendLine(String.Format("Total Sibilings Deleted:\t{0} ", deleteResult.SiblingsCount));
                deletedResults.AppendLine(String.Format("Total Files Deleted:\t{0} ", deleteResult.TotalCount));
                deletedResults.AppendLine(String.Format("Total Bytes Deleted:\t{0} ", deleteResult.TotalSizeInBytes));
                rootPage.NotifyUser(deletedResults.ToString(), NotifyType.StatusMessage);
            }
        }

void DisplayFindItemsResult ( ) [inline, private]

Helper method to display the files enumerated from the source.

Definition at line 489 of file Scenario1.xaml.cs.

        {
            if (itemsResult != null)
            {
                StringBuilder findResultProperties = new StringBuilder();
                findResultProperties.AppendLine(String.Format("Photos\t\t\t :  {0} \t\t Selected Photos\t\t:  {1}", itemsResult.PhotosCount, itemsResult.SelectedPhotosCount));
                findResultProperties.AppendLine(String.Format("Videos\t\t\t :  {0} \t\t Selected Videos\t\t:  {1}", itemsResult.VideosCount, itemsResult.SelectedVideosCount));
                findResultProperties.AppendLine(String.Format("SideCars\t\t :  {0} \t\t Selected Sidecars\t:  {1}", itemsResult.SidecarsCount, itemsResult.SelectedSidecarsCount));
                findResultProperties.AppendLine(String.Format("Siblings\t\t\t :  {0} \t\t Selected Sibilings\t:  {1} ", itemsResult.SiblingsCount, itemsResult.SelectedSiblingsCount));
                findResultProperties.AppendLine(String.Format("Total Items Items\t :  {0} \t\t Selected TotalCount \t:  {1}", itemsResult.TotalCount, itemsResult.SelectedTotalCount));

                rootPage.NotifyUser(findResultProperties.ToString(), NotifyType.StatusMessage);
            }
        }

void DisplayImportedSummary ( ) [inline, private]

Helper method to display the files that were imported.

Definition at line 507 of file Scenario1.xaml.cs.

        {
            if (importedResult != null)
            {
                StringBuilder importedSummary = new StringBuilder();
                importedSummary.AppendLine(String.Format("Photos Imported   \t:  {0} ", importedResult.PhotosCount));
                importedSummary.AppendLine(String.Format("Videos Imported    \t:  {0} ", importedResult.VideosCount));
                importedSummary.AppendLine(String.Format("SideCars Imported   \t:  {0} ", importedResult.SidecarsCount));
                importedSummary.AppendLine(String.Format("Siblings Imported   \t:  {0} ", importedResult.SiblingsCount));
                importedSummary.AppendLine(String.Format("Total Items Imported \t:  {0} ", importedResult.TotalCount));
                importedSummary.AppendLine(String.Format("Total Bytes Imported \t:  {0} ", importedResult.TotalSizeInBytes));

                rootPage.NotifyUser(importedSummary.ToString(), NotifyType.StatusMessage);
            }
        }

void DisplaySourceProperties ( ) [inline, private]

Helper method to display the source properties information.

Definition at line 526 of file Scenario1.xaml.cs.

        {
            if (importSource != null)
            {
                StringBuilder sourceProperties = new StringBuilder();
                sourceProperties.AppendLine(String.Format("Description:         {0} ", importSource.Description));
                sourceProperties.AppendLine(String.Format("IsMassStorage:         {0} ", importSource.IsMassStorage));
                sourceProperties.AppendLine(String.Format("Manufacturer:          {0} ", importSource.Manufacturer));

                IReadOnlyList<PhotoImportStorageMedium> sm = importSource.StorageMedia;
                sourceProperties.AppendLine(String.Format("AvailableSpaceInBytes:         {0} ", sm[0].AvailableSpaceInBytes));
                sourceProperties.AppendLine(String.Format("CapacityInBytes:         {0} ", sm[0].CapacityInBytes));
                sourceProperties.AppendLine(String.Format("Name:         {0} ", sm[0].Name));
                sourceProperties.AppendLine(String.Format("SerialNumber:         {0} ", sm[0].SerialNumber));
                sourceProperties.AppendLine(String.Format("StorageMediaType:         {0} ", sm[0].StorageMediumType));
                sourceProperties.AppendLine(String.Format("Id:         {0} ", importSource.Id));

                propertiesTxtBox.Text = sourceProperties.ToString();
            }
        }

void ExifDateSubfolder_checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 796 of file Scenario1.xaml.cs.

        {
            this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.CreateSubfoldersFromExifDate;
        }

void FileDateSubfolder_checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 791 of file Scenario1.xaml.cs.

        {
            this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.CreateSubfoldersFromFileDate;
        }

async void findItems | ( | PhotoImportContentTypeFilter | contentType,
 |  | PhotoImportItemSelectionMode | selectionMode |
 | ) |  |  | [inline, private]

Helper method to Enumerate all importable items.

Parameters:
contentType | the content type
selectionMode | the selection mode

Definition at line 201 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);

            // Disable buttons and lists to prevent unexpected reentrance.
            setButtonState(false);
            this.sourceListBox.IsEnabled = false;

            this.cts = new CancellationTokenSource();

            try
            {
                this.progressRing.IsActive = true;
                this.itemsToImport = null;
                this.fileListView.ItemsSource = null;

                // Dispose any created import session
                if (this.session != null)
                {
                    this.session.Dispose();
                    this.session = null;
                }

                // Create the import session from the source selected
                this.session = importSource.CreateImportSession();

                RaisePropertyChanged("AppendSessionDateToDestinationFolder");

                // Progress handler for FindItemsAsync
                var progress = new Progress<uint>((result) =>
                {
                    rootPage.NotifyUser(String.Format("Found {0} Files", result.ToString()), NotifyType.StatusMessage);
                });

                // Find all items available importable item from our source
                this.itemsResult = await session.FindItemsAsync(contentType, selectionMode).AsTask(cts.Token, progress);

                setIncrementalFileList(this.itemsResult);
                DisplayFindItemsResult();

                if (this.itemsResult.HasSucceeded)
                {
                    // disable Find New , Find All and Delete button.
                    this.findNewItemsButton.IsEnabled = false;
                    this.findAllItemsButton.IsEnabled = false;
                    this.deleteButton.IsEnabled = false;

                    // enable list selection , folder options and import buttons
                    this.selectNewButton.IsEnabled = true;
                    this.selectNoneButton.IsEnabled = true;
                    this.selectAllButton.IsEnabled = true;
                    this.importButton.IsEnabled = true;
                    this.fileListView.IsEnabled = true;
                    this.AddSessionDateFolder.IsEnabled = true;
                    this.NoSubFolder.IsEnabled = true;
                    this.FileDateSubfolder.IsEnabled = true;
                    this.ExifDateSubfolder.IsEnabled = true;
                    this.KeepOriginalFolder.IsEnabled = true;

                }
                else
                {
                    rootPage.NotifyUser("FindItemsAsync did not succeed or was not completed.", NotifyType.StatusMessage);

                    // re-enable Find New and Find All buttons
                    this.findNewItemsButton.IsEnabled = true;
                    this.findAllItemsButton.IsEnabled = true;

                    this.progressRing.IsActive = false;
                }

                this.progressRing.IsActive = false;

                // Set the CancellationTokenSource to null when the work is complete.
                cts = null;
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error: Operation incomplete. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
        }

void ImagesAndVideo_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 777 of file Scenario1.xaml.cs.

        {
            this.contentTypeFilder = PhotoImportContentTypeFilter.ImagesAndVideos;

            // enable find since the filter has changed
            this.findAllItemsButton.IsEnabled = true;
            this.findNewItemsButton.IsEnabled = true;
        }

void KeepOriginalFolder_checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 801 of file Scenario1.xaml.cs.

        {
            this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.KeepOriginalFolderStructure;
        }

void NoSubFolder_checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 786 of file Scenario1.xaml.cs.

        {
            this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.DoNotCreateSubfolders;
        }

void OnCancelButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Cancels an async operation.

Parameters:
sender | Source of the cancel event
e | Details about the cancel event

Definition at line 477 of file Scenario1.xaml.cs.

        {
            if (cts != null)
            {
                cts.Cancel();
                rootPage.NotifyUser("Operation canceled by the Cancel button.", NotifyType.StatusMessage);
            }
        }

async void OnDeleteButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

When a user clicks the delete button, deletes the content that were imported.

Calling DeleteImportedItemsFromSourceAsync does not delete content that were not imported.

Parameters:
sender | Source of the click event
e | Detials about the click event

Definition at line 417 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Deleting items...", NotifyType.StatusMessage);

            // Prevent unexpected reentrance.
            this.deleteButton.IsEnabled = false;

            cts = new CancellationTokenSource();

            try
            {
                if (importedResult == null)
                {
                    rootPage.NotifyUser("Nothing was imported for deletion.", NotifyType.StatusMessage);
                }
                else
                {
                    var progress = new Progress<double>((result) =>
                    {
                        this.progressBar.Value = result;
                    });

                    this.deleteResult = await this.importedResult.DeleteImportedItemsFromSourceAsync().AsTask(cts.Token, progress);

                    DisplayDeletedResults();

                    if (!this.deleteResult.HasSucceeded)
                    {
                        rootPage.NotifyUser("Delete operation did not succeed or was not completed", NotifyType.StatusMessage);
                    }
                }

            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Files could not be Deleted." + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }

            // set the CancellationTokenSource to null when the work is complete.
            cts = null;

            // content is removed, disable the appropriate buttons

            this.findSourceButton.IsEnabled = true;
            this.importButton.IsEnabled = false;
            this.findNewItemsButton.IsEnabled = false;
            this.findAllItemsButton.IsEnabled = false;
            this.selectNewButton.IsEnabled = false;
            this.selectAllButton.IsEnabled = false;
            this.selectNoneButton.IsEnabled = false;
            this.deleteButton.IsEnabled = false;
            this.fileListView.IsEnabled = false;
        }

void OnFindAllItemsClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Enumerate all importable items from the source when FindAllItems button is clicked.

Parameters:
sender | The source of the click event
e | Details about the click event

Definition at line 191 of file Scenario1.xaml.cs.

        {
            findItems(this.contentTypeFilder, PhotoImportItemSelectionMode.SelectAll);
        }

void OnFindNewItemsClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Enumerate new importable items from the source when FindAllItems button is clicked.

Parameters:
sender | The source of the click event
e | Details about the click event

Definition at line 181 of file Scenario1.xaml.cs.

        {
            findItems(this.contentTypeFilder, PhotoImportItemSelectionMode.SelectNew);
        }

async void OnFindSourcesClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Enumerate all PTP / MTP sources when FindAllSources button is clicked.

Parameters:
sender | The source of the click event
e | Details about the click event

Definition at line 85 of file Scenario1.xaml.cs.

        {
            try
            {
                rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);

                // clear our list of items to import
                this.itemsToImport = null;
                this.fileListView.ItemsSource = this.itemsToImport;

                // reset UI elements
                this.progressBar.Value = 0.0;
                this.propertiesTxtBox.Text = "";

                // disable all buttons until source selection is made
                setButtonState(false);

                // reenable source selection
                this.sourceListBox.IsEnabled = true;

                // clear find criteria
                this.OnlyImages.IsChecked = false;
                this.OnlyVideo.IsChecked = false;
                this.ImagesAndVideo.IsChecked = false;

                // Dispose any created import session
                if (this.session != null)
                {
                    this.session.Dispose();
                    this.session = null;
                }

                // Check to ensure API is supported
                bool importSupported = await PhotoImportManager.IsSupportedAsync();

                if (importSupported)
                {
                    // enumerate all available sources to where we can import from
                    sourceListBox.ItemsSource = await PhotoImportManager.FindAllSourcesAsync();
                }
                else
                {
                    rootPage.NotifyUser("Import is not supported.", NotifyType.ErrorMessage);
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("FindAllSourcesAsync Failed. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void OnImportButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Initiate the import operation when the Import button is clicked.

Parameters:
sender | Source of the click event
e | Details about the click event

Definition at line 289 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);

            // disable UI while async operations are running.
            setButtonState(false);
            this.sourceListBox.IsEnabled = false;
            this.progressBar.Value = 0.0;

            cts = new CancellationTokenSource();

            try
            {
                if (itemsResult.SelectedTotalCount <= 0)
                {
                    rootPage.NotifyUser("Nothing Selected for Import.", NotifyType.StatusMessage);
                }
                else
                {
                    var progress = new Progress<PhotoImportProgress>((result) =>
                    {
                        progressBar.Value =  result.ImportProgress;
                    });

                    this.itemsResult.ItemImported += async (s, a) =>
                    {
                        await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            rootPage.NotifyUser(String.Format("Imported: {0}", a.ImportedItem.Name), NotifyType.StatusMessage);
                        });
                    };

                    // import items from the our list of selected items
                    this.importedResult = await this.itemsResult.ImportItemsAsync().AsTask(cts.Token, progress);

                    DisplayImportedSummary();

                    if (!this.importedResult.HasSucceeded)
                    {
                        rootPage.NotifyUser("ImportItemsAsync did not succeed or was not completed", NotifyType.StatusMessage);
                    }
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Files could not be imported. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }

            cts = null;

            // allow the user to find sources and delete the files from the media
            this.findSourceButton.IsEnabled = true;
            this.deleteButton.IsEnabled = true;

            this.importButton.IsEnabled = false;
            this.findNewItemsButton.IsEnabled = false;
            this.findAllItemsButton.IsEnabled = false;
            this.selectNewButton.IsEnabled = false;
            this.selectAllButton.IsEnabled = false;
            this.selectNoneButton.IsEnabled = false;

            this.NoSubFolder.IsChecked = false;
            this.FileDateSubfolder.IsChecked = false;
            this.ExifDateSubfolder.IsChecked = false;
            this.KeepOriginalFolder.IsChecked = false;
        }

void OnlyImages_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 759 of file Scenario1.xaml.cs.

        {
            this.contentTypeFilder = PhotoImportContentTypeFilter.OnlyImages;

            // enable find since the filter has changed
            this.findAllItemsButton.IsEnabled = true;
            this.findNewItemsButton.IsEnabled = true;
        }

void OnlyVideo_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 768 of file Scenario1.xaml.cs.

        {
            this.contentTypeFilder = PhotoImportContentTypeFilter.OnlyVideos;

            // enable find since the filter has changed
            this.findAllItemsButton.IsEnabled = true;
            this.findNewItemsButton.IsEnabled = true;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

<summary This app is registered as a hanlder for WPD event.

When a user connects a WPD device (ie: Camera), OnNavigatedTo is called with DeviceInformationId that we can call FromIdAsync() and preselect the device.

We also need to handle the situation where the client was terminated while an import operation was in flight. Import will continue and we attempt to reconnect back to the session.

Parameters:
e Details about the NavigationEventArgs

Definition at line 610 of file Scenario1.xaml.cs.

        {
            base.OnNavigatedTo(e);
            rootPage = MainPage.Current;
            try
            {
                //An photo import session was in progress
                if (e.Parameter is PhotoImportOperation)
                {
                    PhotoImportOperation op = e.Parameter as PhotoImportOperation;
                    switch (op.Stage)
                    {
                        // file enumeration was running
                        case PhotoImportStage.FindingItems:

                            cts = new CancellationTokenSource();
                            rootPage.NotifyUser("Reconnected back to the file enumeration stage", NotifyType.StatusMessage);

                            // Set up progress handler for existing file enumeration
                            var findAllItemsProgress = new Progress<uint>((result) =>
                            {
                                rootPage.NotifyUser(String.Format("Found {0} Files", result.ToString()), NotifyType.StatusMessage);
                            });

                            // retrieve previous session
                            this.session = op.Session;
                            // get to the operation for the existing FindItemsAsync session
                            this.itemsResult = await op.ContinueFindingItemsAsync.AsTask(cts.Token, findAllItemsProgress);

                            // display the items we found in the previous session
                            setIncrementalFileList(this.itemsResult);
                            this.selectAllButton.IsEnabled = true;
                            this.selectNoneButton.IsEnabled = true;
                            this.selectNewButton.IsEnabled = true;
                            this.importButton.IsEnabled = true;

                            DisplayFindItemsResult();

                            cts = null;
                            break;

                        // Import was running
                        case PhotoImportStage.ImportingItems:

                            rootPage.NotifyUser("Reconnected back to the importing stage.", NotifyType.StatusMessage);

                            setButtonState(false);
                            cts = new CancellationTokenSource();

                            // Set up progress handler for the existing import session

                            var importSelectedItemsProgress = new Progress<PhotoImportProgress>((result) =>
                            {
                                progressBar.Value = result.ImportProgress;
                            });

                            // retrieve the previous operation
                            this.session = op.Session;

                            // get the itemsResult that were found in the previous session
                            this.itemsResult = await op.ContinueFindingItemsAsync.AsTask();

                            // hook up the ItemImported Handler to show progress
                            this.itemsResult.ItemImported += async (s, a) =>
                            {
                                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                                {
                                    rootPage.NotifyUser(String.Format("Imported: {0}", a.ImportedItem.Name), NotifyType.StatusMessage);
                                });
                            };

                            // Get the operation for the import operation that was in flight
                            this.importedResult = await op.ContinueImportingItemsAsync.AsTask(cts.Token, importSelectedItemsProgress);

                            DisplayImportedSummary();

                            this.findSourceButton.IsEnabled = true;
                            this.deleteButton.IsEnabled = true;

                            cts = null;
                            break;

                        // Delete operation is in progress
                        case PhotoImportStage.DeletingImportedItemsFromSource:

                            rootPage.NotifyUser("Reconnected to the deletion stage.",NotifyType.StatusMessage);

                            this.findSourceButton.IsEnabled = false;
                            this.deleteButton.IsEnabled = false;
                            cts = new CancellationTokenSource();

                            var progress = new Progress<double>((result) =>
                            {
                                this.progressBar.Value = result;
                            });

                            // get the operation for the existing delete session
                            this.deleteResult = await op.ContinueDeletingImportedItemsFromSourceAsync.AsTask(cts.Token, progress);

                            DisplayDeletedResults();

                            if (!deleteResult.HasSucceeded)
                            {
                                rootPage.NotifyUser("Deletion did not succeeded or was cancelled.", NotifyType.StatusMessage);
                            }

                            this.findSourceButton.IsEnabled = true;

                            // Set the CancellationTokenSource to null when the work is complete.
                            cts = null;
                            break;

                        // Idle State.
                        case PhotoImportStage.NotStarted:

                            rootPage.NotifyUser("No import tasks was started.", NotifyType.StatusMessage);
                            this.session = op.Session;
                            break;

                        default:
                            break;
                    }
                }

                // Activated by AutoPlay
                if (e.Parameter is DeviceActivatedEventArgs)
                {
                    this.arguments = e.Parameter as DeviceActivatedEventArgs;
                    bool importSupported = await PhotoImportManager.IsSupportedAsync();
                    this.sourceListBox.Items.Clear();

                    List<PhotoImportSource> source = new List<PhotoImportSource>();

                    // Create the source from a device Id
                    source.Add(await PhotoImportSource.FromIdAsync(this.arguments.DeviceInformationId));

                    // bind and preselects source
                    this.sourceListBox.ItemsSource = source;
                    this.sourceListBox.SelectedIndex = 0;

                    rootPage.NotifyUser("Device selected from AutoPlay", NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
        }

void OnSelectAllButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Select all items.

Parameters:
sender | Source of the click event
e | Details about the click event

Definition at line 361 of file Scenario1.xaml.cs.

        {
            // select all items for import
            this.itemsResult.SelectAll();
            setIncrementalFileList(this.itemsResult);
            DisplayFindItemsResult();
        }

async void OnSelectNewButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Select only new items.

Items that have already been imported is not selected.

Parameters:
sender | Source of the click event
e | Details about the click event

Definition at line 374 of file Scenario1.xaml.cs.

        {
            // select only items that new
            await this.itemsResult.SelectNewAsync();
            setIncrementalFileList(this.itemsResult);
            DisplayFindItemsResult();
        }

void OnSelectNoneButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Deselect all items.

Parameters:
sender | Source of the click event
e | Details about the click event

Definition at line 387 of file Scenario1.xaml.cs.

        {
            // deselects all items
            this.itemsResult.SelectNone();
            setIncrementalFileList(this.itemsResult);
            DisplayFindItemsResult();
        }

void RaisePropertyChanged ( string propName ) [inline, private]

Definition at line 808 of file Scenario1.xaml.cs.

        {
            PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }

void setButtonState ( bool isEnabled ) [inline, private]

Helper method to set the state of the button.

Parameters:
isEnabled state of the button

Definition at line 569 of file Scenario1.xaml.cs.

        {
            this.importButton.IsEnabled = isEnabled;
            this.deleteButton.IsEnabled = isEnabled;
            this.findNewItemsButton.IsEnabled = isEnabled;
            this.findAllItemsButton.IsEnabled = isEnabled;
            this.selectNewButton.IsEnabled = isEnabled;
            this.selectAllButton.IsEnabled = isEnabled;
            this.selectNoneButton.IsEnabled = isEnabled;
            this.fileListView.IsEnabled = isEnabled;

            this.OnlyImages.IsEnabled = isEnabled;
            this.OnlyVideo.IsEnabled = isEnabled;
            this.ImagesAndVideo.IsEnabled = isEnabled;
            this.AddSessionDateFolder.IsEnabled = isEnabled;
            this.NoSubFolder.IsEnabled = isEnabled;
            this.FileDateSubfolder.IsEnabled = isEnabled;
            this.ExifDateSubfolder.IsEnabled = isEnabled;
            this.KeepOriginalFolder.IsEnabled = isEnabled;
        }

void setIncrementalFileList ( PhotoImportFindItemsResult list ) [inline, private]

Creates a GeneratorIncrementalLoadingClass and sets the FindItemsResult to the filelist for display.

Parameters:
list PhotoImportFindItemResult list

Definition at line 399 of file Scenario1.xaml.cs.

        {
            // GeneratorIncrementalLoadingClass is used to incrementally load items in the Listview view including thumbnails
            this.itemsToImport = new GeneratorIncrementalLoadingClass<ImportableItemWrapper>(list.TotalCount,
            (int index) =>
            {
                return new ImportableItemWrapper(list.FoundItems[index]);
            });
            this.fileListView.ItemsSource = this.itemsToImport;
        }

void SourceList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Display the source properties when a new source is selected.

Parameters:
sender | The source of the selection changed event
e | Details about the selection chagned event

Definition at line 143 of file Scenario1.xaml.cs.

        {
            // reset any previous items
            this.itemsToImport = null;
            this.fileListView.ItemsSource = null;

            // clear any values in the source properties
            this.propertiesTxtBox.Text = "";

            if (e.AddedItems.Count != 0)
            {
                // enable find options
                this.OnlyImages.IsEnabled = true;
                this.OnlyVideo.IsEnabled = true;
                this.ImagesAndVideo.IsEnabled = true;

                // set the default to find Images and Video
                this.ImagesAndVideo.IsChecked = true;

                this.importSource = e.AddedItems.First() as PhotoImportSource;
                DisplaySourceProperties();

                // enable Find New and Find All buttons, disable the rest
                this.findNewItemsButton.IsEnabled = true;
                this.findAllItemsButton.IsEnabled = true;
                this.selectNewButton.IsEnabled = false;
                this.selectNoneButton.IsEnabled = false;
                this.selectAllButton.IsEnabled = false;
                this.deleteButton.IsEnabled = false;
                this.importButton.IsEnabled = false;
            }
        }

Member Data Documentation

DeviceActivatedEventArgs arguments [private]

Definition at line 43 of file Scenario1.xaml.cs.

PhotoImportContentTypeFilter contentTypeFilder [private]

Definition at line 44 of file Scenario1.xaml.cs.

CancellationTokenSource cts [private]

Definition at line 42 of file Scenario1.xaml.cs.

PhotoImportDeleteImportedItemsFromSourceResult deleteResult [private]

Definition at line 41 of file Scenario1.xaml.cs.

PhotoImportImportItemsResult importedResult [private]

Definition at line 40 of file Scenario1.xaml.cs.

PhotoImportSource importSource [private]

Definition at line 38 of file Scenario1.xaml.cs.

PhotoImportFindItemsResult itemsResult [private]

Definition at line 39 of file Scenario1.xaml.cs.

GeneratorIncrementalLoadingClass<ImportableItemWrapper> itemsToImport = null [private]

Definition at line 48 of file Scenario1.xaml.cs.

MainPage rootPage [private]

Definition at line 36 of file Scenario1.xaml.cs.

PhotoImportSession session [private]

Definition at line 37 of file Scenario1.xaml.cs.

Property Documentation

bool AppendSessionDateToDestinationFolder [get, set]

Definition at line 58 of file Scenario1.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 806 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • MediaImport/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • InclinometerCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, InclinometerReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
Inclinometer | _inclinometer
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 33 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _inclinometer = Inclinometer.GetDefault();
            if (_inclinometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _inclinometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
            }
            else
            {
                rootPage.NotifyUser("No inclinometer found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 56 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 70 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _inclinometer.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                _inclinometer.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | InclinometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 114 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                InclinometerReading reading = e.Reading;
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
                switch (reading.YawAccuracy)
                {
                    case MagnetometerAccuracy.Unknown:
                        ScenarioOutput_YawAccuracy.Text = "Unknown";
                        break;
                    case MagnetometerAccuracy.Unreliable:
                        ScenarioOutput_YawAccuracy.Text = "Unreliable";
                        break;
                    case MagnetometerAccuracy.Approximate:
                        ScenarioOutput_YawAccuracy.Text = "Approximate";
                        break;
                    case MagnetometerAccuracy.High:
                        ScenarioOutput_YawAccuracy.Text = "High";
                        break;
                    default:
                        ScenarioOutput_YawAccuracy.Text = "No data";
                        break;
                }
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 172 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            _inclinometer.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            _inclinometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 148 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_inclinometer != null)
            {
                // Establish the report interval
                _inclinometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _inclinometer.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No inclinometer found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 92 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _inclinometer.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _inclinometer.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

Inclinometer _inclinometer [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • Inclinometer/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • InclinometerCS
  • Scenario2_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayCurrentReading (object sender, object args)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
DispatcherTimer | _dispatcherTimer
Inclinometer | _inclinometer
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 34 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _inclinometer = Inclinometer.GetDefault();
            if (_inclinometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _inclinometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
            }
            else
            {
                rootPage.NotifyUser("No inclinometer found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 122 of file Scenario2_Polling.xaml.cs.

        {
            InclinometerReading reading = _inclinometer.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
                switch (reading.YawAccuracy)
                {
                    case MagnetometerAccuracy.Unknown:
                        ScenarioOutput_YawAccuracy.Text = "Unknown";
                        break;
                    case MagnetometerAccuracy.Unreliable:
                        ScenarioOutput_YawAccuracy.Text = "Unreliable";
                        break;
                    case MagnetometerAccuracy.Approximate:
                        ScenarioOutput_YawAccuracy.Text = "Approximate";
                        break;
                    case MagnetometerAccuracy.High:
                        ScenarioOutput_YawAccuracy.Text = "High";
                        break;
                    default:
                        ScenarioOutput_YawAccuracy.Text = "No data";
                        break;
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 62 of file Scenario2_Polling.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 76 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

                // Stop the dispatcher
                _dispatcherTimer.Stop();

                // Restore the default report interval to release resources while the sensor is not in use
                _inclinometer.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 180 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _inclinometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 156 of file Scenario2_Polling.xaml.cs.

        {
            if (_inclinometer != null)
            {
                // Set the report interval to enable the sensor for polling
                _inclinometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _dispatcherTimer.Start();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No inclinometer found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 100 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

DispatcherTimer _dispatcherTimer [private]

Definition at line 32 of file Scenario2_Polling.xaml.cs.

Inclinometer _inclinometer [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • Inclinometer/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Calibration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • InclinometerCS
  • Scenario3_Calibration
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Calibration Class Reference

List of all members.

Public Member Functions

Scenario3_Calibration ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | OnApproximateAccuracy (object sender, RoutedEventArgs e)
void | OnHighAccuracy (object sender, RoutedEventArgs e)
void | OnUnreliableAccuracy (object sender, RoutedEventArgs e)

Private Attributes

CalibrationBar | calibrationBar = new CalibrationBar()
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario3_Calibration.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Calibration ( ) [inline]

Definition at line 32 of file Scenario3_Calibration.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnApproximateAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for approximate accuracy.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 77 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

void OnHighAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for high accuracy.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 66 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 42 of file Scenario3_Calibration.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 54 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
            base.OnNavigatingFrom(e);
        }

void OnUnreliableAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for unreliable accuracy.

Sensor does not meet accuracy requirements. Request to show the calibration bar per the calibration guidance.

Parameters:
sender
e

Definition at line 88 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.RequestCalibration(MagnetometerAccuracy.Unreliable);
        }

Member Data Documentation

CalibrationBar calibrationBar = new CalibrationBar() [private]

Definition at line 30 of file Scenario3_Calibration.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario3_Calibration.xaml.cs.

The documentation for this class was generated from the following file:
  • Inclinometer/cs/Scenario3_Calibration.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkEventLogger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

InkEventLogger Class Reference

#include "InkEventLogger.h"

List of all members.

Public Member Functions

InkEventLogger ()
void | ClearLog ()
void | EnableLoggingConfiguration (LogEventTypes type, bool addConfig)
std::wstring | GetLog ()
void | Log (LogEventAction eventAction)
void | SetConfiguration (LogEventTypes config)

Private Attributes

unsigned long | _countOfCoalescedIndependentInput
unsigned long | _countOfCoalescedStrokeMessages
unsigned long | _countOfCoalescedUnprocessedInput
LogEventTypes _currentConfig
std::wstring | _log

Detailed Description

Definition at line 7 of file InkEventLogger.h.

Constructor & Destructor Documentation

InkEventLogger ( )

Definition at line 7 of file InkEventLogger.cpp.

{
    _currentConfig = LogEventTypes::EventNone;
    _countOfCoalescedIndependentInput = 0;
    _countOfCoalescedStrokeMessages = 0;
    _countOfCoalescedUnprocessedInput = 0;
}

Member Function Documentation

void ClearLog ( ) [inline]

Definition at line 15 of file InkEventLogger.h.

{ _log = L""; };

void EnableLoggingConfiguration | ( | LogEventTypes | type,
 |  | bool | addConfig
 | ) |  |

Definition at line 20 of file InkEventLogger.cpp.

{
    if (addConfig)
    {
        _currentConfig = (LogEventTypes)(_currentConfig | type);
    }
    else
    {
        _currentConfig = (LogEventTypes)(_currentConfig & ~(type));
    }
}

std::wstring GetLog ( ) [inline]

Definition at line 14 of file InkEventLogger.h.

{ return _log; };

void Log ( LogEventAction eventAction )

Definition at line 32 of file InkEventLogger.cpp.

{
    std::wstring newLogEntry;
    std::wstring messageCount;

    // Filter events
    if ((eventAction >= StrokeCollected && eventAction <= StrokeErased))
    {
        if ((_currentConfig & LogEventTypes::InkingEventType) != LogEventTypes::InkingEventType)
        {
            return;
        }
    }
    else if ((eventAction >= IndependentInputEntered && eventAction <= IndependentInputExited))
    {
        if ((_currentConfig & LogEventTypes::IndependentInputEventType) != LogEventTypes::IndependentInputEventType)
        {
            return;
        }
    }
    else if ((eventAction >= UnprocessedInputEntered && eventAction <= UnprocessedInputExited))
    {
        if ((_currentConfig & LogEventTypes::UnprocessedInputEventType) != LogEventTypes::UnprocessedInputEventType)
        {
            return;
        }
    }
    else if ((eventAction >= StrokeStarted && eventAction <= StrokeCanceled))
    {
        if ((_currentConfig & LogEventTypes::StrokeEventType) != LogEventTypes::StrokeEventType)
        {
            return;
        }
    }
    else
    {
        return;
    }

    switch (eventAction)
    {
    case LogEventAction::IndependentInputEntered:
        newLogEntry = L"Independent Input - Entered";
        _countOfCoalescedIndependentInput = 0;
        break;
    case LogEventAction::IndependentInputExited:
        newLogEntry = L"Independent Input - Exited";
        if (_countOfCoalescedIndependentInput > 0)
        {
            // Coalescing hover and mouse events to avoid excessive logging
            // For hover, count the number of hover messages and display them
            // only when the stylus exits or the sytlus is in contact with the
            // screen.
            messageCount = _countOfCoalescedIndependentInput.ToString()->Data();
            newLogEntry += L"\nIndependent Input - Hover (" + messageCount + L")";
            _countOfCoalescedIndependentInput = 0;
        }
        break;
    case LogEventAction::IndependentInputHover:
        _countOfCoalescedIndependentInput++;
        break;
    case LogEventAction::IndependentInputLost:
        newLogEntry = L"Independent Input - Lost";
        _countOfCoalescedIndependentInput = 0;
        break;
    case LogEventAction::IndependentInputMoved:
        _countOfCoalescedIndependentInput++;
        break;
    case LogEventAction::IndependentInputPressed:
        newLogEntry = L"Independent Input - Pressed";
        if (_countOfCoalescedIndependentInput > 0)
        {
            // This means pen came in range and now it
            // starts inking
            messageCount = _countOfCoalescedIndependentInput.ToString()->Data();
            newLogEntry += L"\nIndependent Input - Hover (" + messageCount + L")";
            _countOfCoalescedUnprocessedInput = 0;
        }
        break;
    case LogEventAction::IndependentInputReleased:
        newLogEntry = L"Independent Input - Released";
        if (_countOfCoalescedIndependentInput > 0)
        {
            messageCount = _countOfCoalescedIndependentInput.ToString()->Data();
            newLogEntry += L"\nIndependent Input - Moved (" + messageCount + L")";
            _countOfCoalescedIndependentInput = 0;
        }
        break;
    case LogEventAction::UnprocessedInputEntered:
        newLogEntry = L"Unprocessed Input - Entered";
        _countOfCoalescedUnprocessedInput = 0;
        break;
    case LogEventAction::UnprocessedInputExited:
        newLogEntry = L"Unprocessed Input - Exited";
        if (_countOfCoalescedUnprocessedInput > 0)
        {
            messageCount = _countOfCoalescedUnprocessedInput.ToString()->Data();
            newLogEntry += L"\nUnprocessed Input - Hover (" + messageCount + L")";
            _countOfCoalescedUnprocessedInput = 0;
        }
        break;
    case LogEventAction::UnprocessedInputHover:
        _countOfCoalescedUnprocessedInput++;
        break;
    case LogEventAction::UnprocessedInputLost:
        newLogEntry = L"Unprocessed Input - Lost";
        _countOfCoalescedUnprocessedInput = 0;
        break;
    case LogEventAction::UnprocessedInputMoved:
        _countOfCoalescedUnprocessedInput++;
        break;
    case LogEventAction::UnprocessedInputPressed:
        newLogEntry = L"Unprocessed Input - Pressed";
        newLogEntry = L"Unprocessed Input - Exited";
        if (_countOfCoalescedUnprocessedInput > 0)
        {
            messageCount = _countOfCoalescedUnprocessedInput.ToString()->Data();
            newLogEntry += L"\nUnprocessed Input - Hover (" + messageCount + L")";
            _countOfCoalescedUnprocessedInput = 0;
        }
        break;
    case LogEventAction::UnprocessedInputReleased:
        newLogEntry = L"Unprocessed Input - Released";
        if (_countOfCoalescedUnprocessedInput > 0)
        {
            messageCount = _countOfCoalescedUnprocessedInput.ToString()->Data();
            newLogEntry += L"\nUnprocessed Input - Moved (" + messageCount + L")";
            _countOfCoalescedUnprocessedInput = 0;
        }
        break;
    case LogEventAction::StrokeCanceled:
        newLogEntry = L"Stroke Canceled";
        _countOfCoalescedStrokeMessages = 0;
        break;
    case LogEventAction::StrokeCollected:
        newLogEntry = L"Stroke Collected";
        break;
    case LogEventAction::StrokeContinued:
        _countOfCoalescedStrokeMessages++;
        break;
    case LogEventAction::StrokeEnded:
        newLogEntry = L"Stroke Ended";
        if (_countOfCoalescedStrokeMessages > 0)
        {
            messageCount = _countOfCoalescedStrokeMessages.ToString()->Data();
            newLogEntry += L"\nStroke Continued (" + messageCount + L")";
            _countOfCoalescedStrokeMessages = 0;
        }
        break;
    case LogEventAction::StrokeErased:
        newLogEntry = L"Stroke Erased";
        break;
    case LogEventAction::StrokeStarted:
        newLogEntry = L"Stroke Started";
        _countOfCoalescedStrokeMessages = 0;
        break;
    default:
        newLogEntry = L"";
        break;
    }

    if (newLogEntry != L"")
    {
        _log = newLogEntry + L"\n" + _log;
    }
}

void SetConfiguration ( LogEventTypes config )

Definition at line 15 of file InkEventLogger.cpp.

{
    _currentConfig = config;
}

Member Data Documentation

unsigned long _countOfCoalescedIndependentInput [private]

Definition at line 21 of file InkEventLogger.h.

unsigned long _countOfCoalescedStrokeMessages [private]

Definition at line 22 of file InkEventLogger.h.

unsigned long _countOfCoalescedUnprocessedInput [private]

Definition at line 23 of file InkEventLogger.h.

LogEventTypes _currentConfig [private]

Definition at line 15 of file InkEventLogger.h.

std::wstring _log [private]

Definition at line 19 of file InkEventLogger.h.

The documentation for this class was generated from the following files:
  • ComplexInk/cpp/Common/InkEventLogger.h
  • ComplexInk/cpp/Common/InkEventLogger.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: int24in32 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

int24in32 Struct Reference

List of all members.

Public Attributes

int value

Detailed Description

Definition at line 39 of file ToneSampleGenerator.cpp.

Member Data Documentation

int value

Definition at line 41 of file ToneSampleGenerator.cpp.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cpp/ToneSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccessHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • AccessHandler
Public Member Functions | Properties

AccessHandler Class Reference

Access handler class for Iso15693 based ICC. More...

List of all members.

Public Member Functions

AccessHandler (SmartCardConnection ScConnection)
async Task< byte[]> | GetUidAsync ()
async Task< byte[]> | ReadAsync (byte blockNumber)
async Task< byte[]> | TransparentExchangeAsync (byte[] commandData)
async Task | WriteAsync (byte blockNumber, byte[] dataToWrite)

Properties

SmartCardConnection | connectionObject [get, set]

Detailed Description

It provides wrappers for different Iso15693 commands

Definition at line 26 of file Iso15693AccessHandler.cs.

Constructor & Destructor Documentation

AccessHandler ( SmartCardConnection ScConnection ) [inline]

Class constructor.

Parameters:
ScConnection connection object to a Iso15693 ICC

Definition at line 38 of file Iso15693AccessHandler.cs.

        {
            connectionObject = ScConnection;
        }

Member Function Documentation

async Task<byte[]> GetUidAsync ( ) [inline]

Wrapper method get the Iso15693 UID.

Returns:
byte array UID

Definition at line 97 of file Iso15693AccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new Iso15693.GetUid());

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure getting UID of Iso15693 card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> ReadAsync ( byte blockNumber ) [inline]

Wrapper method to read data from the Iso15693 card.

Returns:
byte array of the read data

Definition at line 48 of file Iso15693AccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new Iso15693.Read(blockNumber));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure reading Iso15693 card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> TransparentExchangeAsync ( byte[] commandData ) [inline]

Wrapper method to perform transparent transceive data to the Iso15693 card.

Parameters:
commandData The command to send to the Iso15693 card
Returns:
byte array of the read data

Definition at line 85 of file Iso15693AccessHandler.cs.

        {
            byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);

            return responseData;
        }

async Task WriteAsync | ( | byte | blockNumber,
 |  | byte[] | dataToWrite |
 | ) |  |  | [inline]

Wrapper method to write data to the Iso15693 card.

Definition at line 62 of file Iso15693AccessHandler.cs.

        {
            if (dataToWrite.Length != 4)
            {
                throw new InvalidOperationException("Invalid size of data to write");
            }

            var apduRes = await connectionObject.TransceiveAsync(new Iso15693.Write(blockNumber, dataToWrite));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure writing Iso15693 card, " + apduRes.ToString());
            }
        }

Property Documentation

SmartCardConnection connectionObject [get, set, private]

connection object to smart card

Definition at line 31 of file Iso15693AccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693AccessHandler.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • ApduResponse
Public Member Functions

ApduResponse Class Reference

Iso15693 response APDU. More...

Inherits Pcsc::ApduResponse.

List of all members.

Public Member Functions

ApduResponse ()

Detailed Description

Definition at line 61 of file Iso15693Commands.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Reimplemented from ApduResponse.

Definition at line 63 of file Iso15693Commands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693Commands.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetHistoricalBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • GetHistoricalBytes
Public Member Functions

GetHistoricalBytes Class Reference

Iso15693 GetHistoricalBytes command. More...

Inherits Pcsc::GetHistoricalBytes.

List of all members.

Public Member Functions

GetHistoricalBytes ()

Detailed Description

Definition at line 51 of file Iso15693Commands.cs.

Constructor & Destructor Documentation

GetHistoricalBytes ( ) [inline]

Reimplemented from GetHistoricalBytes.

Definition at line 53 of file Iso15693Commands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693Commands.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetUid Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • GetUid
Public Member Functions

GetUid Class Reference

Iso15693 GetUid command. More...

Inherits Pcsc::GetUid.

List of all members.

Public Member Functions

GetUid ()

Detailed Description

Definition at line 41 of file Iso15693Commands.cs.

Constructor & Destructor Documentation

GetUid ( ) [inline]

Reimplemented from GetUid.

Definition at line 43 of file Iso15693Commands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693Commands.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Read Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • Read
Public Member Functions

Read Class Reference

Iso15693 read command. More...

Inherits Pcsc::ReadBinary.

List of all members.

Public Member Functions

Read (ushort blockNumber)

Detailed Description

Definition at line 21 of file Iso15693Commands.cs.

Constructor & Destructor Documentation

Read ( ushort blockNumber ) [inline]

Definition at line 23 of file Iso15693Commands.cs.

            : base((ushort)((blockNumber & 0xff) << 8), 4)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693Commands.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Write Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso15693
  • Write
Public Member Functions

Write Class Reference

Iso15693 write command. More...

Inherits Pcsc::UpdateBinary.

List of all members.

Public Member Functions

Write (ushort blockNumber, byte[] dataToWrite)

Detailed Description

Definition at line 31 of file Iso15693Commands.cs.

Constructor & Destructor Documentation

Write | ( | ushort | blockNumber,
 |  | byte[] | dataToWrite |
 | ) |  |  | [inline]

Definition at line 33 of file Iso15693Commands.cs.

            : base((ushort)((blockNumber & 0xff) << 8), dataToWrite)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso15693Commands.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso7816
  • ApduCommand
Public Member Functions | Properties

ApduCommand Class Reference

Class ApduCommand implments the ISO 7816 apdu commands. More...

Inherited by DesfireCommand, SelectCommand, GeneralAuthenticate, GetData, IncrementDecrement, LoadKeys, ManageSession, ReadBinary, TransparentExchange, and UpdateBinary.

List of all members.

Public Member Functions

ApduCommand (byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le)
IBuffer | GetBuffer ()
override string | ToString ()

Properties

Type | ApduResponseType [get, set]
byte | CLA [get, set]
byte[] | CommandData [get, set]
byte | INS [get, set]
byte | Le [get, set]
byte | P1 [get, set]
byte | P2 [get, set]

Detailed Description

Definition at line 23 of file Iso7816.cs.

Constructor & Destructor Documentation

ApduCommand | ( | byte | cla,
 |  | byte | ins,
 |  | byte | p1,
 |  | byte | p2,
 |  | byte[] | commandData,
 |  | byte? | le |
 | ) |  |  | [inline]

Definition at line 25 of file Iso7816.cs.

        {
            if (commandData != null && commandData.Length > 254)
            {
                throw new NotImplementedException();
            }
            CLA = cla;
            INS = ins;
            P1 = p1;
            P2 = p2;
            CommandData = commandData;
            Le = le;

            ApduResponseType = typeof(Iso7816.ApduResponse);
        }

Member Function Documentation

IBuffer GetBuffer ( ) [inline]

Packs the current command into contiguous buffer bytes.

Returns:
buffer holds the current wire/air format of the command

Definition at line 75 of file Iso7816.cs.

        {
            using (DataWriter writer = new DataWriter())
            {
                writer.WriteByte(CLA);
                writer.WriteByte(INS);
                writer.WriteByte(P1);
                writer.WriteByte(P2);

                if (CommandData != null && CommandData.Length > 0)
                {
                    writer.WriteByte((byte)CommandData.Length);
                    writer.WriteBytes(CommandData);
                }

                if (Le != null)
                {
                    writer.WriteByte((byte)Le);
                }

                return writer.DetachBuffer();
            }
        }

override string ToString ( ) [inline]

Helper method to print the command in a readable format.

Returns:
return string formatted command

Reimplemented in SelectCommand.

Definition at line 104 of file Iso7816.cs.

        {
            return "ApduCommand CLA=" + CLA.ToString("X2") + ",INS=" + INS.ToString("X2") + ",P1=" + P1.ToString("X2") + ",P2=" + P2.ToString("X2") + ((CommandData != null && CommandData.Length > 0) ? (",Data=" + BitConverter.ToString(CommandData).Replace("-", "")) : "");
        }

Property Documentation

Type ApduResponseType [get, set]

Expected response type for this command.

Provides mechanism to bind commands to responses

Definition at line 68 of file Iso7816.cs.

byte CLA [get, set]

Class of instructions.

Definition at line 43 of file Iso7816.cs.

byte [] CommandData [get, set]

Contiguous array of bytes representing commands data.

Definition at line 63 of file Iso7816.cs.

byte INS [get, set]

Instruction code.

Definition at line 47 of file Iso7816.cs.

byte Le [get, set]

Maximum number of bytes expected in the response ot this command.

Definition at line 59 of file Iso7816.cs.

byte P1 [get, set]

Instruction parameter 1.

Definition at line 51 of file Iso7816.cs.

byte P2 [get, set]

Instruction parameter 2.

Definition at line 55 of file Iso7816.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso7816.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso7816
  • ApduResponse
Public Member Functions | Public Attributes | Properties

ApduResponse Class Reference

Class ApduResponse implments handler for the ISO 7816 apdu response. More...

Inherited by DesfireResponse, ApduResponse, ManageSessionResponse, and TransparentExchangeResponse.

List of all members.

Public Member Functions

ApduResponse ()
virtual void | ExtractResponse (IBuffer response)
byte[] | ExtractTlvDataObject (byte[] referenceTag)
override string | ToString ()

Public Attributes

const byte | TAG_COMPREHENSION_MASK = 0x80
const byte | TAG_LENGTH_MULTI_BYTE_MASK = 0x80
const byte | TAG_MULTI_BYTE_MASK = 0x1F

Properties

byte[] | ResponseData [get, set]
virtual bool | Succeeded [get]
ushort | SW [get, set]
byte | SW1 [get, set]
byte | SW2 [get, set]
virtual string | SWTranslation [get]

Detailed Description

Definition at line 112 of file Iso7816.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Class constructor.

Reimplemented in ApduResponse, ApduResponse, ApduResponse, ApduResponse, and ApduResponse.

Definition at line 121 of file Iso7816.cs.

{ }

Member Function Documentation

virtual void ExtractResponse ( IBuffer response ) [inline, virtual]

method to extract the response data, status and qualifier

Parameters:
response

Definition at line 126 of file Iso7816.cs.

        {
            if (response.Length < 2)
            {
                throw new InvalidOperationException("APDU response must be at least 2 bytes");
            }
            using (DataReader reader = DataReader.FromBuffer(response))
            {
                ResponseData = new byte[response.Length - 2];
                reader.ReadBytes(ResponseData);
                SW1 = reader.ReadByte();
                SW2 = reader.ReadByte();
            }
        }

byte [] ExtractTlvDataObject ( byte[] referenceTag ) [inline]

method to extract the matching TLV data object from response data

Definition at line 143 of file Iso7816.cs.

        {
            using (var reader = DataReader.FromBuffer(ResponseData.AsBuffer()))
            {
                byte nextByte;

                while (reader.UnconsumedBufferLength > 0)
                {
                    int lengthLength = 0, valueLength = 0;
                    MemoryStream tag = new MemoryStream(), value = new MemoryStream();

                    nextByte = reader.ReadByte();
                    tag.WriteByte(nextByte);

                    if ((nextByte & TAG_MULTI_BYTE_MASK) == TAG_MULTI_BYTE_MASK)
                    {
                        while (reader.UnconsumedBufferLength > 0)
                        {
                            nextByte = reader.ReadByte();
                            tag.WriteByte(nextByte);

                            if ((nextByte & TAG_COMPREHENSION_MASK) != TAG_COMPREHENSION_MASK)
                                break;
                        }
                    }

                    if (reader.UnconsumedBufferLength == 0)
                        throw new Exception("Invalid length for TLV response");

                    valueLength = reader.ReadByte();
                    lengthLength = 1;

                    if ((valueLength & TAG_LENGTH_MULTI_BYTE_MASK) == TAG_LENGTH_MULTI_BYTE_MASK)
                        lengthLength += (valueLength & ~TAG_LENGTH_MULTI_BYTE_MASK);

                    while (--lengthLength > 0)
                        valueLength = (valueLength << 8) | reader.ReadByte();

                    while (valueLength != 0 && valueLength-- > 0)
                        value.WriteByte(reader.ReadByte());

                    if (referenceTag.SequenceEqual(tag.ToArray()))
                        return value.ToArray();
                }

                throw new Exception("Tag not found in the TLV response");
            }
        }

override string ToString ( ) [inline]

Helper method to print the response in a readable format.

Returns:
return string formatted response

Definition at line 258 of file Iso7816.cs.

        {
            return "ApduResponse SW=" + SW.ToString("X4") + " (" + SWTranslation + ")" + ((ResponseData != null && ResponseData.Length > 0) ? (",Data=" + BitConverter.ToString(ResponseData).Replace("-", "")) : "");
        }

Member Data Documentation

const byte TAG_COMPREHENSION_MASK = 0x80

Definition at line 115 of file Iso7816.cs.

const byte TAG_LENGTH_MULTI_BYTE_MASK = 0x80

Definition at line 116 of file Iso7816.cs.

const byte TAG_MULTI_BYTE_MASK = 0x1F

Definition at line 114 of file Iso7816.cs.

Property Documentation

byte [] ResponseData [get, set]

Response data.

Definition at line 228 of file Iso7816.cs.

virtual bool Succeeded [get]

Detects if the command has succeeded.

Returns:

Reimplemented in DesfireResponse, ManageSessionResponse, and TransparentExchangeResponse.

Definition at line 196 of file Iso7816.cs.

ushort SW [get, set]

Wrapper property to read both response status and qualifer.

Definition at line 214 of file Iso7816.cs.

byte SW1 [get, set]

command processing status

Definition at line 205 of file Iso7816.cs.

byte SW2 [get, set]

command processing qualifier

Definition at line 209 of file Iso7816.cs.

virtual string SWTranslation [get]

Mapping response status and qualifer to human readable format.

Reimplemented in DesfireResponse.

Definition at line 233 of file Iso7816.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso7816.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SelectCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Iso7816
  • SelectCommand
Public Member Functions | Properties

SelectCommand Class Reference

Class that implements select command. More...

Inherits Iso7816::ApduCommand.

List of all members.

Public Member Functions

SelectCommand (byte[] aid, byte?le)
override string | ToString ()

Properties

byte[] | AID [get, set]

Detailed Description

Definition at line 266 of file Iso7816.cs.

Constructor & Destructor Documentation

SelectCommand | ( | byte[] | aid,
 |  | byte? | le |
 | ) |  |  | [inline]

Definition at line 268 of file Iso7816.cs.

            : base((byte)Iso7816.Cla.CompliantCmd0x, (byte)Iso7816.Ins.SelectFile, 0x04, 0x00, aid, le)
        {
        }

Member Function Documentation

override string ToString ( ) [inline]

Reimplemented from ApduCommand.

Definition at line 278 of file Iso7816.cs.

        {
            return "SelectCommand AID=" + BitConverter.ToString(CommandData).Replace("-", "");
        }

Property Documentation

byte [] AID [get, set]

Definition at line 274 of file Iso7816.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Iso7816.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IUIContentRootClone Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IUIContentRootClone Interface Reference

Inherited by MockUIContentRoot.

Detailed Description

Definition at line 29 of file Scenario1_Basic.xaml.cpp.

The documentation for this interface was generated from the following file:
  • ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_GetLamp Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Lamp
  • Scenario1_GetLamp
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_GetLamp Class Reference

Scenario 1 Get Lamp Page. More...

List of all members.

Public Member Functions

Scenario1_GetLamp ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | GetDefaultAsyncBtn_Click (object sender, RoutedEventArgs e)
async void | InitLampBtn_Click (object sender, RoutedEventArgs e)
async Task | LogStatusAsync (string message, NotifyType type)
async Task | LogStatusToOutputBoxAsync (string message)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario1_GetLamp.xaml.cs.

Constructor & Destructor Documentation

Scenario1_GetLamp ( ) [inline]

Initializes a new instance of the Scenario1_GetLamp class.

Definition at line 38 of file Scenario1_GetLamp.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetDefaultAsyncBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Gets the Default Lamp instance, if no instance is found it throws InvalidOperation Exception.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 109 of file Scenario1_GetLamp.xaml.cs.

        {
            try
            {
                await LogStatusToOutputBoxAsync("Initializing lamp");

                // acquiring lamp instance via using statement allows for the
                // object to be automatically disposed once the lamp object
                // goes out of scope releasing native resources
                using (var lamp = await Lamp.GetDefaultAsync())
                {
                    if (lamp == null)
                    {
                        await LogStatusAsync("Error: No Lamp device found", NotifyType.ErrorMessage);
                        return;
                    }

                    await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Default lamp instance acquired, Device Id: {0}", lamp.DeviceId), NotifyType.StatusMessage);
                }

                // Lamp object is automatically Disposed now that it's out of scope
                await LogStatusToOutputBoxAsync("Lamp Disposed");
            }
            catch (InvalidOperationException ex)
            {
                await LogStatusAsync(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void InitLampBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

acquires Lamp instance by getting class selection string for Lamp devices, then selecting the first lamp device on the back of the device

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 61 of file Scenario1_GetLamp.xaml.cs.

        {
            try
            {
                await LogStatusToOutputBoxAsync("Getting class selection string for lamp devices...");

                // Returns class selection string for Lamp devices
                string selectorStr = Lamp.GetDeviceSelector();
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp class selection string:\n {0}", selectorStr));

                await LogStatusToOutputBoxAsync("Finding all lamp devices...");

                // Finds all devices based on lamp class selector string
                DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selectorStr);
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Number of lamp devices found: {0}", devices.Count.ToString()));

                // Select the first lamp device found on the back of the device
                await LogStatusToOutputBoxAsync("Selecting first lamp device found on back of the device");
                DeviceInformation deviceInfo = devices.FirstOrDefault(di => di.EnclosureLocation != null && di.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back);

                if (deviceInfo == null)
                {
                    throw new InvalidOperationException("Error: No lamp device was found");
                }

                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Acquiring Lamp instance from Id:\n {0}", deviceInfo.Id));
                Lamp lamp = await Lamp.FromIdAsync(deviceInfo.Id);
                await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Lamp instance acquired, Device Id:\n {0}", lamp.DeviceId), NotifyType.StatusMessage);

                // Here we must Dispose of the lamp object once we are no longer
                // using it to release any native resources
                await LogStatusToOutputBoxAsync("Disposing of lamp instance");
                lamp.Dispose();
                lamp = null;
                await LogStatusToOutputBoxAsync("Disposed");
            }
            catch(InvalidOperationException eX)
            {
                await LogStatusAsync(eX.Message, NotifyType.ErrorMessage);
            }
        }

async Task LogStatusAsync | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, this method is for important status messages to be displayed at bottom of scenario page.

Parameters:
message | Message to log to the output box
type | Notification Type for status message

Definition at line 159 of file Scenario1_GetLamp.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBoxAsync(message);
        }

async Task LogStatusToOutputBoxAsync ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log to the outputBox

Definition at line 143 of file Scenario1_GetLamp.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Override default OnNavigateTo to initialize the rootPage object for Status message updates.

Parameters:
e

Definition at line 48 of file Scenario1_GetLamp.xaml.cs.

        {
            rootPage = MainPage.Current;
            base.OnNavigatedTo(e);
        }

Member Data Documentation

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 33 of file Scenario1_GetLamp.xaml.cs.

The documentation for this class was generated from the following files:
  • LampDevice/cs/Scenario1_GetLamp.xaml.cs
  • LampDevice/cpp/Scenario1_GetLamp.xaml.cpp
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_EnableSettings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Lamp
  • Scenario2_EnableSettings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_EnableSettings Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_EnableSettings ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | BrightnessBtn_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | ColorLampBtn_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | LogStatusAsync (string message, NotifyType type)
async Task | LogStatusToOutputBoxAsync (string message)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario2_EnableSettings.xaml.cs.

Constructor & Destructor Documentation

Scenario2_EnableSettings ( ) [inline]

Initializes a new instance of the Scenario2_EnableSettings class.

Definition at line 36 of file Scenario2_EnableSettings.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void BrightnessBtn_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Brightness Button Click.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 56 of file Scenario2_EnableSettings.xaml.cs.

        {
            await LogStatusToOutputBoxAsync("Initializing lamp");

            // acquiring lamp instance via using statement allows for the
            // object to be automatically disposed once the lamp object
            // goes out of scope releasing native resources
            using (var lamp = await Lamp.GetDefaultAsync())
            {
                if (lamp == null)
                {
                    await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                    return;
                }

                await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Default lamp instance acquired, Device Id: {0}", lamp.DeviceId), NotifyType.StatusMessage);
                await LogStatusToOutputBoxAsync("Lamp Default settings:");
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}, Brightness: {1}", lamp.IsEnabled, lamp.BrightnessLevel));

                // Set the Brightness Level
                await LogStatusToOutputBoxAsync("Adjusting Brightness");
                lamp.BrightnessLevel = 0.5F;
                await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Settings After Brightness Adjustment: Brightness: {0}", lamp.BrightnessLevel), NotifyType.StatusMessage);

                // Turn Lamp on
                await LogStatusToOutputBoxAsync("Turning Lamp on");
                lamp.IsEnabled = true;
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));

                // Turn Lamp off
                await LogStatusToOutputBoxAsync("Turning Lamp off");
                lamp.IsEnabled = false;
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));

            }

            await LogStatusToOutputBoxAsync("Lamp Disposed");
        }

async void ColorLampBtn_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Color Lamp Button.

Queries the lamp device for color adjustment support and if device supports being color settable, it sets lamp color to blue. Click Event

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Lamp gets disposed automatically when it goes out of scope of using block

Definition at line 102 of file Scenario2_EnableSettings.xaml.cs.

        {
            await LogStatusToOutputBoxAsync("Initializing lamp");

            // Acquiring lamp instance via using statement allows for the
            // object to be automatically disposed once the lamp object
            // goes out of scope releasing native resources
            using (var lamp = await Lamp.GetDefaultAsync())
            {
                if (lamp == null)
                {
                    await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                    return;
                }

                // With Lamp instance required, query for the default settings of the Lamp
                await LogStatusAsync("Default lamp instance acquired", NotifyType.StatusMessage);
                await LogStatusToOutputBoxAsync("Lamp Default settings:");
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}, Is Color Settable: {1}, Color: {2}", lamp.IsEnabled, lamp.IsColorSettable, lamp.Color));

                // If this lamp device is not Color Settable exit color lamp adjustment
                if (lamp.IsColorSettable == false)
                {
                    await LogStatusAsync("Selected Lamp device doesn't support Color lamp adjustment", NotifyType.ErrorMessage);
                    return;
                }

                // Change Lamp Color
                await LogStatusToOutputBoxAsync("Adjusting Color");
                lamp.Color = Colors.Blue;
                await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Settings After Color Adjustment: Color: {0}", lamp.Color), NotifyType.StatusMessage);

                // Turn Lamp on
                await LogStatusToOutputBoxAsync("Turning Lamp on");
                lamp.IsEnabled = true;
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));

                // Turn Lamp off
                await LogStatusToOutputBoxAsync("Turning Lamp off");
                lamp.IsEnabled = false;
                await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));
            }

            /// Lamp gets disposed automatically when it goes out of scope of using block
            await LogStatusToOutputBoxAsync("Lamp Disposed");
        }

async Task LogStatusAsync | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, which shows up in bottom of scenario page status block.

Parameters:
message | Message to log
type | Status Notify Type

Definition at line 169 of file Scenario2_EnableSettings.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBoxAsync(message);
        }

async Task LogStatusToOutputBoxAsync ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log

Definition at line 154 of file Scenario2_EnableSettings.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Event Handler for OnNavigateTo Event.

Parameters:
e

Definition at line 45 of file Scenario2_EnableSettings.xaml.cs.

        {
            rootPage = MainPage.Current;
            base.OnNavigatedTo(e);
        }

Member Data Documentation

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 31 of file Scenario2_EnableSettings.xaml.cs.

The documentation for this class was generated from the following file:
  • LampDevice/cs/Scenario2_EnableSettings.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AvailabilityChanged Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Lamp
  • Scenario3_AvailabilityChanged
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_AvailabilityChanged Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_AvailabilityChanged ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisposeLamp ()
async Task | InitializeLampAsync ()
async void | Lamp_AvailabilityChanged (Lamp sender, LampAvailabilityChangedEventArgs args)
async void | lampToggle_Toggled (object sender, RoutedEventArgs e)
async Task | LogStatusAsync (string message, NotifyType type)
async Task | LogStatusToOutputBoxAsync (string message)
async void | RegisterBtn_Click (object sender, RoutedEventArgs e)
async void | UnRegisterBtn_Click (object sender, RoutedEventArgs e)

Private Attributes

Lamp | lamp
MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario3_AvailabilityChanged.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AvailabilityChanged ( ) [inline]

Initializes a new instance of the Scenario3_AvailabilityChanged( class.

Definition at line 41 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DisposeLamp ( ) [inline, private]

Method to dispose of current Lamp instance and release all resources.

Definition at line 93 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            if (lamp == null)
            {
                return;
            }

            lampToggle.IsEnabled = false;
            lamp.AvailabilityChanged -= Lamp_AvailabilityChanged;
            lamp.IsEnabled = false;
            lamp.Dispose();
            lamp = null;
        }

async Task InitializeLampAsync ( ) [inline, private]

Initialize the lamp acquiring the default instance.

Returns:
async Task

Definition at line 63 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            lamp = await Lamp.GetDefaultAsync();

            if (lamp == null)
            {
                await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                lampToggle.IsEnabled = false;
                return;
            }

            await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Default lamp instance acquired, Device Id: {0}", lamp.DeviceId), NotifyType.StatusMessage);
            lampToggle.IsEnabled = true;
        }

async void Lamp_AvailabilityChanged | ( | Lamp | sender,
 |  | LampAvailabilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

Event Handler for Lamp Availability Changed.

When it fires, we want to update to Lamp toggle UI to show that lamp is available or not

Parameters:
sender | Contains information regarding Lamp object that fired event
e | Contains state information and event data associated with the event

Definition at line 130 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            // Update the Lamp Toggle UI to indicate lamp has been consumed by another application
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (lampToggle.IsOn)
                {
                    lampToggle.IsOn = args.IsAvailable;
                }

                lampToggle.IsEnabled = args.IsAvailable;
            });

            await LogStatusAsync(string.Format(CultureInfo.InvariantCulture,"Lamp Availability Changed Notification has fired, IsAvailable= {0}", args.IsAvailable), NotifyType.StatusMessage);
        }

async void lampToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Lamp Toggle Switch Toggling the switch will turn Lamp on or off.

Parameters:
sender | Contains information regarding toggle switch that fired event
e | Contains state information and event data associated with the event

Definition at line 169 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            if (lamp == null)
            {
                await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                return;
            }

            ToggleSwitch toggleSwitch = sender as ToggleSwitch;
            if (toggleSwitch != null)
            {
                if (toggleSwitch.IsOn)
                {
                    lamp.IsEnabled = true;
                    await LogStatusAsync("Lamp is Enabled", NotifyType.StatusMessage);
                }
                else
                {
                    lamp.IsEnabled = false;
                    await LogStatusAsync("Lamp is Disabled", NotifyType.StatusMessage);
                }
            }
        }

async Task LogStatusAsync | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Method to log Status to Main Status block, this method is for important status messages.

Parameters:
message | Message to log
type | Status notification type

Definition at line 213 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(message, type);
            });
            await LogStatusToOutputBoxAsync(message);
        }

async Task LogStatusToOutputBoxAsync ( string message ) [inline, private]

Marshall log message to the UI thread and update outputBox, this method is for more general messages.

Parameters:
message Message to log

Definition at line 198 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                outputBox.Text += message + "\r\n";
                outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
            });
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Event handler for the OnNavigatedTo event.

In this scenario, we want to get a lamp object for the lifetime of the page, so when we first navigate to the page, we Initialize a private lamp object

Parameters:
e Contains state information and event data associated with the event

Definition at line 52 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            rootPage = MainPage.Current;
            await InitializeLampAsync();
            base.OnNavigatedTo(e);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Event handler for the OnNavigatingFrom event.

Here we want to make sure to release the lamp before exiting this scenario page.

Parameters:
e Contains state information and event data associated with the event

Definition at line 83 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            DisposeLamp();
            base.OnNavigatingFrom(e);
        }

async void RegisterBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for the register button click event.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 112 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            if (lamp == null)
            {
                await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                return;
            }

            lamp.AvailabilityChanged += Lamp_AvailabilityChanged;
            await LogStatusAsync("Registered for Lamp Availability Changed Notification", NotifyType.StatusMessage);
        }

async void UnRegisterBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for the Unregister Availability Event.

Parameters:
sender | Contains information regarding button that fired event
e | Contains state information and event data associated with the event

Definition at line 151 of file Scenario3_AvailabilityChanged.xaml.cs.

        {
            if (lamp == null)
            {
                await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
                return;
            }

            lamp.AvailabilityChanged -= Lamp_AvailabilityChanged;
            await LogStatusAsync("Unregistered for Lamp Availability Changed Notification", NotifyType.StatusMessage);
        }

Member Data Documentation

Lamp lamp [private]

Private lamp object for the page.

Definition at line 36 of file Scenario3_AvailabilityChanged.xaml.cs.

MainPage rootPage [private]

Private MainPage object for status updates.

Definition at line 31 of file Scenario3_AvailabilityChanged.xaml.cs.

The documentation for this class was generated from the following file:
  • LampDevice/cs/Scenario3_AvailabilityChanged.xaml.cs
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LARGE_INTEGER Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

LARGE_INTEGER Struct Reference

List of all members.

Public Attributes

Int32 | HighPart
Int32 | LowPart
Int64 | QuadPart

Detailed Description

Definition at line 21 of file ServiceViewModel.cs.

Member Data Documentation

Int32 HighPart

Definition at line 25 of file ServiceViewModel.cs.

Int32 LowPart

Definition at line 24 of file ServiceViewModel.cs.

Int64 QuadPart

Definition at line 23 of file ServiceViewModel.cs.

The documentation for this struct was generated from the following file:
  • CustomCapability/cs/ServiceViewModel.cs
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Attributes

Level Class Reference

#include "Level.h"

Inherited by Level1, and Level3.

List of all members.

Public Member Functions

virtual void | Initialize (std::vector< std::shared_ptr< GameObject >> const &objects)=0
virtual void | LoadState (PersistentState &state)
std::wstring const & | Objective ()
virtual void | SaveState (PersistentState &state)
float | TimeLimit ()
virtual bool | Update (float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects)

Protected Attributes

std::wstring | m_objective
float | m_timeLimit

Detailed Description

Definition at line 33 of file Level.h.

Member Function Documentation

virtual void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [pure virtual]

Implemented in Level1, Level2, Level3, Level4, and Level5.

void LoadState ( PersistentState & state ) [virtual]

Reimplemented in Level2, and Level4.

Definition at line 45 of file Level.cpp.

{
}

std::wstring const & Objective ( )

Definition at line 49 of file Level.cpp.

{
    return m_objective;
}

void SaveState ( PersistentState & state ) [virtual]

Reimplemented in Level2, and Level4.

Definition at line 41 of file Level.cpp.

{
}

float TimeLimit ( )

Definition at line 54 of file Level.cpp.

{
    return m_timeLimit;
}

bool Update | ( | float | time,
 |  | float | elapsedTime,
 |  | float | timeRemaining,
 |  | std::vector< std::shared_ptr< GameObject >> const & | objects |
 | ) |  |  | [virtual]

Reimplemented in Level2, Level4, and Level6.

Definition at line 15 of file Level.cpp.

{
    int left = 0;

    for (auto&& object : objects)
    {
        if (object->Active() && object->Target())
        {
            if (object->Hit())
            {
                object->Active(false);
            }
            else
            {
                left++;
            }
        }
    }
    return (left == 0);
}

Member Data Documentation

std::wstring m_objective [protected]

Definition at line 54 of file Level.h.

float m_timeLimit [protected]

Definition at line 55 of file Level.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level.h
  • Simple3DGameDX/cppwinrt/GameContent/Level.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

Level1 Class Reference

#include "Level1.h"

Inherits Level.

Inherited by Level2.

List of all members.

Public Member Functions

Level1 ()
virtual void Initialize (std::vector< std::shared_ptr< GameObject >> const &objects) override

Detailed Description

Definition at line 20 of file Level1.h.

Constructor & Destructor Documentation

Level1 ( )

Definition at line 18 of file Level1.cpp.

{
    m_timeLimit = 20.0f;
    m_objective = L"Hit each of the targets before time runs out.\nTouch to aim. Tap in right box to fire. Drag in left box to move.";
}

Member Function Documentation

void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [override, virtual]

Implements Level.

Reimplemented in Level2.

Definition at line 24 of file Level1.cpp.

{
    XMFLOAT3 position[] =
    {
        XMFLOAT3(-2.5f, -1.0f, -1.5f),
        XMFLOAT3(-1.0f,  1.0f, -3.0f),
        XMFLOAT3(1.5f,  0.0f, -3.0f),
        XMFLOAT3(-2.5f, -1.0f, -5.5f),
        XMFLOAT3(0.5f, -2.0f, -5.0f),
        XMFLOAT3(1.5f, -2.0f, -5.5f),
        XMFLOAT3(2.0f,  0.0f,  0.0f),
        XMFLOAT3(0.0f,  0.0f,  0.0f),
        XMFLOAT3(-2.0f,  0.0f,  0.0f)
    };

    int targetCount = 0;
    for (auto&& object : objects)
    {
        if (auto target = dynamic_cast<Face*>(object.get()))
        {
            if (targetCount < 9)
            {
                target->Active(true);
                target->Target(true);
                target->Hit(false);
                target->AnimatePosition(nullptr);
                target->Position(position[targetCount]);
                targetCount++;
            }
            else
            {
                object->Active(false);
            }
        }
        else
        {
            object->Active(false);
        }
    }
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level1.h
  • Simple3DGameDX/cppwinrt/GameContent/Level1.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

Level2 Class Reference

#include "Level2.h"

Inherits Level1.

List of all members.

Public Member Functions

Level2 ()
virtual void | Initialize (std::vector< std::shared_ptr< GameObject >> const &objects) override
virtual void | LoadState (PersistentState &state) override
virtual void | SaveState (PersistentState &state) override
virtual bool | Update (float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) override

Private Attributes

int | m_nextId

Detailed Description

Definition at line 20 of file Level2.h.

Constructor & Destructor Documentation

Level2 ( )

Definition at line 16 of file Level2.cpp.

{
    m_timeLimit = 30.0f;
    m_objective = L"Hit each of the targets in ORDER before time runs out.";
}

Member Function Documentation

void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [override, virtual]

Reimplemented from Level1.

Definition at line 24 of file Level2.cpp.

{
    Level1::Initialize(objects);

    int targetCount = 0;
    for (auto&& object : objects)
    {
        if (auto target = dynamic_cast<Face*>(object.get()))
        {
            if (targetCount < 9)
            {
                target->Target(targetCount == 0 ? true : false);
                targetCount++;
            }
        }
    }
    m_nextId = 1;
}

void LoadState ( PersistentState & state ) [override, virtual]

Reimplemented from Level.

Definition at line 78 of file Level2.cpp.

{
    m_nextId = state.LoadInt32(L":NextTarget", 1);
}

void SaveState ( PersistentState & state ) [override, virtual]

Reimplemented from Level.

Definition at line 73 of file Level2.cpp.

{
    state.SaveInt32(L":NextTarget", m_nextId);
}

bool Update | ( | float | time,
 |  | float | elapsedTime,
 |  | float | timeRemaining,
 |  | std::vector< std::shared_ptr< GameObject >> const & | objects |
 | ) |  |  | [override, virtual]

Reimplemented from Level.

Definition at line 43 of file Level2.cpp.

{
    int left = 0;
    for (auto&& object : objects)
    {
        if (object->Active() && (object->TargetId() > 0))
        {
            if (object->Hit() && (object->TargetId() == m_nextId))
            {
                object->Active(false);
                m_nextId++;
            }
            else
            {
                left++;
            }
        }
        if (object->Active() && (object->TargetId() == m_nextId))
        {
            object->Target(true);
        }
    }
    return (left == 0);
}

Member Data Documentation

int m_nextId [private]

Definition at line 37 of file Level2.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level2.h
  • Simple3DGameDX/cppwinrt/GameContent/Level2.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

Level3 Class Reference

#include "Level3.h"

Inherits Level.

Inherited by Level4, and Level5.

List of all members.

Public Member Functions

Level3 ()
virtual void Initialize (std::vector< std::shared_ptr< GameObject >> const &objects) override

Detailed Description

Definition at line 21 of file Level3.h.

Constructor & Destructor Documentation

Level3 ( )

Definition at line 19 of file Level3.cpp.

{
    m_timeLimit = 30.0f;
    m_objective = L"Hit each of the moving targets before time runs out.";
}

Member Function Documentation

void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [override, virtual]

Implements Level.

Reimplemented in Level4, and Level5.

Definition at line 25 of file Level3.cpp.

{
    static constexpr XMFLOAT3 position[] =
    {
        XMFLOAT3(-2.5f, -1.0f, -1.5f),
        XMFLOAT3(-1.0f,  1.0f, -3.0f),
        XMFLOAT3(1.5f,  0.0f, -5.5f),
        XMFLOAT3(-2.5f, -1.0f, -5.5f),
        XMFLOAT3(0.5f, -2.0f, -5.0f),
        XMFLOAT3(1.5f, -2.0f, -5.5f),
        XMFLOAT3(0.0f, -3.6f,  0.0f),
        XMFLOAT3(0.0f, -3.6f,  0.0f),
        XMFLOAT3(0.0f, -3.6f,  0.0f)
    };
    static constexpr XMFLOAT3 LineList1[] =
    {
        XMFLOAT3(-2.5f, -1.0f, -1.5f),
        XMFLOAT3(-0.5f,  1.0f,  1.0f),
        XMFLOAT3(-0.5f, -2.5f,  1.0f),
        XMFLOAT3(-2.5f, -1.0f, -1.5f),
    };
    static constexpr XMFLOAT3 LineList2[] =
    {
        XMFLOAT3(-1.0f,  1.0f, -3.0f),
        XMFLOAT3(-2.0f,  2.0f, -1.5f),
        XMFLOAT3(-2.0f, -2.5f, -1.5f),
        XMFLOAT3(1.5f, -2.5f, -1.5f),
        XMFLOAT3(1.5f, -2.5f, -3.0f),
        XMFLOAT3(-1.0f,  1.0f, -3.0f),
    };
    static constexpr XMFLOAT3 LineList3[] =
    {
        XMFLOAT3(1.5f,  0.0f, -5.5f),
        XMFLOAT3(1.5f,  1.0f, -5.5f),
        XMFLOAT3(1.5f, -2.5f, -5.5f),
        XMFLOAT3(1.5f,  0.0f, -5.5f),
    };
    static constexpr XMFLOAT3 LineList4[] =
    {
        XMFLOAT3(-2.5f, -1.0f, -5.5f),
        XMFLOAT3(1.0f, -1.0f, -5.5f),
        XMFLOAT3(1.0f,  1.0f, -5.5f),
        XMFLOAT3(-2.5f,  1.0f, -5.5f),
        XMFLOAT3(-2.5f, -1.0f, -5.5f),
    };
    static constexpr XMFLOAT3 LineList5[] =
    {
        XMFLOAT3(0.5f, -2.0f, -5.0f),
        XMFLOAT3(2.0f, -2.0f, -5.0f),
        XMFLOAT3(2.0f,  1.0f, -5.0f),
        XMFLOAT3(-2.5f,  1.0f, -5.0f),
        XMFLOAT3(-2.5f, -2.0f, -5.0f),
        XMFLOAT3(0.5f, -2.0f, -5.0f),
    };
    static constexpr XMFLOAT3 LineList6[] =
    {
        XMFLOAT3(1.5f, -2.0f, -5.5f),
        XMFLOAT3(-2.5f, -2.0f, -5.5f),
        XMFLOAT3(-2.5f,  1.0f, -5.5f),
        XMFLOAT3(1.5f,  1.0f, -5.5f),
        XMFLOAT3(1.5f, -2.0f, -5.5f),
    };

    int targetCount = 0;
    for (auto&& object : objects)
    {
        if (auto target = dynamic_cast<Face*>(object.get()))
        {
            if (targetCount < 9)
            {
                target->Active(true);
                target->Target(true);
                target->Hit(false);
                target->Position(position[targetCount]);
                switch (targetCount)
                {
                case 0:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(4, LineList1, 10.0f, true));
                    break;
                case 1:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(6, LineList2, 15.0f, true));
                    break;
                case 2:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(4, LineList3, 15.0f, true));
                    break;
                case 3:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(5, LineList4, 15.0f, true));
                    break;
                case 4:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(6, LineList5, 15.0f, true));
                    break;
                case 5:
                    target->AnimatePosition(std::make_shared<AnimateLineListPosition>(5, LineList6, 15.0f, true));
                    break;
                case 6:
                    target->AnimatePosition(
                        std::make_shared<AnimateCirclePosition>(
                            XMFLOAT3(0.0f, -2.5f, 0.0f),
                            XMFLOAT3(0.0f, -3.6f, 0.0f),
                            XMFLOAT3(0.0f, 0.0f, 1.0f),
                            9.0f,
                            true,
                            true
                            )
                        );
                    break;
                case 7:
                    target->AnimatePosition(
                        std::make_shared<AnimateCirclePosition>(
                            XMFLOAT3(0.0f, -2.5f, 0.0f),
                            XMFLOAT3(0.0f, -3.6f, 0.0f),
                            XMFLOAT3(0.0f, 0.0f, 1.0f),
                            9.0f,
                            true,
                            true
                            )
                        );
                    target->AnimatePosition()->Start(3.0f);
                    break;
                case 8:
                    target->AnimatePosition(
                        std::make_shared<AnimateCirclePosition>(
                            XMFLOAT3(0.0f, -2.5f, 0.0f),
                            XMFLOAT3(0.0f, -3.6f, 0.0f),
                            XMFLOAT3(0.0f, 0.0f, 1.0f),
                            9.0f,
                            true,
                            true
                            )
                        );
                    target->AnimatePosition()->Start(6.0f);
                    break;
                }
                targetCount++;
            }
            else
            {
                target->Active(false);
            }
        }
        else
        {
            object->Active(false);
        }
    }
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level3.h
  • Simple3DGameDX/cppwinrt/GameContent/Level3.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

Level4 Class Reference

#include "Level4.h"

Inherits Level3.

List of all members.

Public Member Functions

Level4 ()
virtual void | Initialize (std::vector< std::shared_ptr< GameObject >> const &objects) override
virtual void | LoadState (PersistentState &state) override
virtual void | SaveState (PersistentState &state) override
virtual bool | Update (float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) override

Private Attributes

int | m_nextId

Detailed Description

Definition at line 20 of file Level4.h.

Constructor & Destructor Documentation

Level4 ( )

Definition at line 16 of file Level4.cpp.

{
    m_timeLimit = 30.0f;
    m_objective = L"Hit each of the moving targets in ORDER before time runs out.";
}

Member Function Documentation

void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [override, virtual]

Reimplemented from Level3.

Definition at line 22 of file Level4.cpp.

{
    Level3::Initialize(objects);

    int targetCount = 0;
    for (auto&& object : objects)
    {
        if (auto target = dynamic_cast<Face*>(object.get()))
        {
            if (targetCount < 9)
            {
                target->Target(targetCount == 0 ? true : false);
                targetCount++;
            }
        }
    }
    m_nextId = 1;
}

void LoadState ( PersistentState & state ) [override, virtual]

Reimplemented from Level.

Definition at line 76 of file Level4.cpp.

{
    m_nextId = state.LoadInt32(L":NextTarget", 1);
}

void SaveState ( PersistentState & state ) [override, virtual]

Reimplemented from Level.

Definition at line 71 of file Level4.cpp.

{
    state.SaveInt32(L":NextTarget", m_nextId);
}

bool Update | ( | float | time,
 |  | float | elapsedTime,
 |  | float | timeRemaining,
 |  | std::vector< std::shared_ptr< GameObject >> const & | objects |
 | ) |  |  | [override, virtual]

Reimplemented from Level.

Definition at line 41 of file Level4.cpp.

{
    int left = 0;
    for (auto&& object : objects)
    {
        if (object->Active() && (object->TargetId() > 0))
        {
            if (object->Hit() && (object->TargetId() == m_nextId))
            {
                object->Active(false);
                m_nextId++;
            }
            else
            {
                left++;
            }
        }
        if (object->Active() && (object->TargetId() == m_nextId))
        {
            object->Target(true);
        }
    }
    return (left == 0);
}

Member Data Documentation

int m_nextId [private]

Definition at line 37 of file Level4.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level4.h
  • Simple3DGameDX/cppwinrt/GameContent/Level4.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

Level5 Class Reference

#include "Level5.h"

Inherits Level3.

Inherited by Level6.

List of all members.

Public Member Functions

Level5 ()
virtual void Initialize (std::vector< std::shared_ptr< GameObject >> const &objects) override

Detailed Description

Definition at line 21 of file Level5.h.

Constructor & Destructor Documentation

Level5 ( )

Definition at line 19 of file Level5.cpp.

{
    m_timeLimit = 30.0f;
    m_objective = L"Hit each of the moving targets while avoiding the obstacles before time runs out.";
}

Member Function Documentation

void Initialize ( std::vector< std::shared_ptr< GameObject >> const & objects ) [override, virtual]

Reimplemented from Level3.

Definition at line 25 of file Level5.cpp.

{
    Level3::Initialize(objects);

    static constexpr XMFLOAT3 obstacleStartPosition[] =
    {
        XMFLOAT3(-4.5f, -3.0f, 0.0f),
        XMFLOAT3(4.5f, -3.0f, 0.0f),
        XMFLOAT3(0.0f, 3.01f, -2.0f),
        XMFLOAT3(-1.5f, -3.0f, -6.5f),
        XMFLOAT3(1.5f, -3.0f, -6.5f)
    };
    static constexpr XMFLOAT3 obstacleEndPosition[] =
    {
        XMFLOAT3(-2.0f, -3.0f, 0.0f),
        XMFLOAT3(2.0f, -3.0f, 0.0f),
        XMFLOAT3(0.0f, -3.0f, -2.0f),
        XMFLOAT3(-1.5f, -3.0f, -4.0f),
        XMFLOAT3(1.5f, -3.0f, -4.0f)
    };
    static constexpr float obstacleStartTime[] =
    {
        2.0f,
        5.0f,
        8.0f,
        11.0f,
        14.0f
    };

    int obstacleCount = 0;
    for (auto&& object : objects)
    {
        if (auto obstacle = dynamic_cast<Cylinder*>(object.get()))
        {
            if (obstacleCount < 5)
            {
                obstacle->Active(true);
                obstacle->Position(obstacleStartPosition[obstacleCount]);
                obstacle->AnimatePosition(
                    std::make_shared<AnimateLinePosition>(
                        obstacleStartPosition[obstacleCount],
                        obstacleEndPosition[obstacleCount],
                        (float)10.0,
                        false
                        )
                    );
                obstacle->AnimatePosition()->Start(obstacleStartTime[obstacleCount]);
                obstacleCount++;
            }
        }
    }
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level5.h
  • Simple3DGameDX/cppwinrt/GameContent/Level5.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Level6 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

Level6 Class Reference

#include "Level6.h"

Inherits Level5.

List of all members.

Public Member Functions

Level6 ()
virtual bool Update (float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) override

Detailed Description

Definition at line 22 of file Level6.h.

Constructor & Destructor Documentation

Level6 ( )

Definition at line 15 of file Level6.cpp.

{
    m_timeLimit = 20.0f;
    m_objective = L"Hit as many moving targets as possible while avoiding the obstacles before time runs out.";
}

Member Function Documentation

bool Update | ( | float | time,
 |  | float | elapsedTime,
 |  | float | timeRemaining,
 |  | std::vector< std::shared_ptr< GameObject >> const & | objects |
 | ) |  |  | [override, virtual]

Reimplemented from Level.

Definition at line 21 of file Level6.cpp.

{
    for (auto&& object : objects)
    {
        if (object->Active() && object->Target())
        {
            if (object->Hit() && (object->HitTime() < (time - 2.0f)))
            {
                object->Hit(false);
            }
        }
    }
    return ((timeRemaining - elapsedTime) <= 0.0f);
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Level6.h
  • Simple3DGameDX/cppwinrt/GameContent/Level6.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LightSensorCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, LightSensorReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
LightSensor | _sensor
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 33 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _sensor = LightSensor.GetDefault();
            if (_sensor != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _sensor.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 100 ? minReportInterval : 100;
            }
            else
            {
                rootPage.NotifyUser("No light sensor found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 56 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 70 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _sensor.ReadingChanged -= new TypedEventHandler<LightSensor, LightSensorReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                _sensor.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | LightSensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 114 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                LightSensorReading reading = e.Reading;
                ScenarioOutput_LUX.Text = String.Format("{0,5:0.00}", reading.IlluminanceInLux);
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 152 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            _sensor.ReadingChanged -= new TypedEventHandler<LightSensor, LightSensorReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            _sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 128 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_sensor != null)
            {
                // Establish the report interval
                _sensor.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _sensor.ReadingChanged += new TypedEventHandler<LightSensor, LightSensorReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No light sensor found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 92 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _sensor.ReadingChanged += new TypedEventHandler<LightSensor, LightSensorReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _sensor.ReadingChanged -= new TypedEventHandler<LightSensor, LightSensorReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

LightSensor _sensor [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • LightSensor/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LightSensorCS
  • Scenario2_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayCurrentReading (object sender, object args)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint _desiredReportInterval
DispatcherTimer | _dispatcherTimer
LightSensor | _sensor
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 34 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _sensor = LightSensor.GetDefault();
            if (_sensor != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _sensor.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 100 ? minReportInterval : 100;

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
            }
            else
            {
                rootPage.NotifyUser("No light sensor found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 122 of file Scenario2_Polling.xaml.cs.

        {
            LightSensorReading reading = _sensor.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_LUX.Text = String.Format("{0,5:0.00}", reading.IlluminanceInLux);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 62 of file Scenario2_Polling.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 76 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

                // Stop the dispatcher
                _dispatcherTimer.Stop();

                // Restore the default report interval to release resources while the sensor is not in use
                _sensor.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 160 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 136 of file Scenario2_Polling.xaml.cs.

        {
            if (_sensor != null)
            {
                // Set the report interval to enable the sensor for polling
                _sensor.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _dispatcherTimer.Start();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No light sensor found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 100 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

Member Data Documentation

uint _desiredReportInterval [private]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

DispatcherTimer _dispatcherTimer [private]

Definition at line 32 of file Scenario2_Polling.xaml.cs.

LightSensor _sensor [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • LightSensor/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineSegment Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

LineSegment Struct Reference

#include "Animate.h"

List of all members.

Public Attributes

float | length
DirectX::XMFLOAT3 | position
float | uLength
float | uStart

Detailed Description

Definition at line 73 of file Animate.h.

Member Data Documentation

float length

Definition at line 76 of file Animate.h.

DirectX::XMFLOAT3 position

Definition at line 75 of file Animate.h.

float uLength

Definition at line 78 of file Animate.h.

float uStart

Definition at line 77 of file Animate.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/Animate.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: List< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

List< T > Class Template Reference

#include "LinkList.h"

List of all members.

Classes

struct | Node
class | POSITION

Public Member Functions

List ()
virtual | ~List ()
template<class FN >
void | Clear (FN &clear_fn)
virtual void | Clear ()
POSITION | EndPosition () const
POSITION FrontPosition ()
HRESULT | GetBack (T *ppItem)
DWORD | GetCount () const
HRESULT | GetFront (T *ppItem)
HRESULT | GetItemPos (POSITION pos, T *ppItem)
HRESULT | InsertBack (T item)
HRESULT | InsertFront (T item)
HRESULT | InsertPos (POSITION pos, T item)
bool | IsEmpty () const
POSITION | Next (const POSITION pos)
HRESULT | Remove (POSITION &pos, T *ppItem)
HRESULT | RemoveBack (T *ppItem)
HRESULT | RemoveFront (T *ppItem)

Protected Member Functions

Node * | Back () const
Node * | Front () const
virtual HRESULT | GetItem (const Node *pNode, T *ppItem)
virtual HRESULT | InsertAfter (T item, Node *pBefore)
virtual HRESULT | RemoveItem (Node *pNode, T *ppItem)

Protected Attributes

Node m_anchor
DWORD | m_count

Detailed Description

template<class T>
class List< T >

Definition at line 45 of file LinkList.h.

Constructor & Destructor Documentation

List ( ) [inline]

Definition at line 189 of file LinkList.h.

    {
        m_anchor.next = &m_anchor;
        m_anchor.prev = &m_anchor;

        m_count = 0;
    }

virtual ~List ( ) [inline, virtual]

Definition at line 197 of file LinkList.h.

    {
        Clear();
    }

Member Function Documentation

Node* Back ( ) const [inline, protected]

Definition at line 107 of file LinkList.h.

    {
        return m_anchor.prev;
    }

virtual void Clear ( ) [inline, virtual]

Reimplemented in ComPtrList< T, NULLABLE >, ComPtrList< IUnknown, true >, ComPtrList< IMFMediaStream >, ComPtrList< TOperation >, ComPtrList< IUnknown >, ComPtrList< IMFStreamSink >, and ComPtrList< CSourceOperation >.

Definition at line 312 of file LinkList.h.

    {
        NoOp<T> clearOp;
        Clear<>(clearOp);
    }

void Clear ( FN & clear_fn ) [inline]

Definition at line 290 of file LinkList.h.

    {
        Node *n = m_anchor.next;

        // Delete the nodes
        while (n != &m_anchor)
        {
            clear_fn(n->item);

            Node *tmp = n->next;
            delete n;
            n = tmp;
        }

        // Reset the anchor to point at itself
        m_anchor.next = &m_anchor;
        m_anchor.prev = &m_anchor;

        m_count = 0;
    }

POSITION EndPosition ( ) const [inline]

Definition at line 333 of file LinkList.h.

    {
        return POSITION();
    }

Node* Front ( ) const [inline, protected]

Definition at line 102 of file LinkList.h.

    {
        return m_anchor.next;
    }

POSITION FrontPosition ( ) [inline]

Definition at line 321 of file LinkList.h.

    {
        if (IsEmpty())
        {
            return POSITION(nullptr);
        }
        else
        {
            return POSITION(Front());
        }
    }

HRESULT GetBack ( T * ppItem ) [inline]

Definition at line 253 of file LinkList.h.

    {
        if (IsEmpty())
        {
            return E_FAIL;
        }
        else
        {
            return GetItem(Back(), ppItem);
        }
    }

DWORD GetCount ( ) const [inline]

Definition at line 280 of file LinkList.h.

{ return m_count; }

HRESULT GetFront ( T * ppItem ) [inline]

Definition at line 266 of file LinkList.h.

    {
        if (IsEmpty())
        {
            return E_FAIL;
        }
        else
        {
            return GetItem(Front(), ppItem);
        }
    }

virtual HRESULT GetItem | ( | const Node * | pNode,
 |  | T * | ppItem |
 | ) |  |  | [inline, protected, virtual]

Definition at line 138 of file LinkList.h.

    {
        if (pNode == nullptr || ppItem == nullptr)
        {
            return E_POINTER;
        }

        *ppItem = pNode->item;
        return S_OK;
    }

HRESULT GetItemPos | ( | POSITION | pos,
 |  | T * | ppItem |
 | ) |  |  | [inline]

Definition at line 338 of file LinkList.h.

    {
        if (pos.pNode)
        {
            return GetItem(pos.pNode, ppItem);
        }
        else
        {
            return E_FAIL;
        }
    }

virtual HRESULT InsertAfter | ( | T | item,
 |  | Node * | pBefore |
 | ) |  |  | [inline, protected, virtual]

Definition at line 112 of file LinkList.h.

    {
        if (pBefore == nullptr)
        {
            return E_POINTER;
        }

        Node *pNode = new Node(item);
        if (pNode == nullptr)
        {
            return E_OUTOFMEMORY;
        }

        Node *pAfter = pBefore->next;

        pBefore->next = pNode;
        pAfter->prev = pNode;

        pNode->prev = pBefore;
        pNode->next = pAfter;

        m_count++;

        return S_OK;
    }

HRESULT InsertBack ( T item ) [inline]

Definition at line 203 of file LinkList.h.

    {
        return InsertAfter(item, m_anchor.prev);
    }

HRESULT InsertFront ( T item ) [inline]

Definition at line 209 of file LinkList.h.

    {
        return InsertAfter(item, &m_anchor);
    }

HRESULT InsertPos | ( | POSITION | pos,
 |  | T | item |
 | ) |  |  | [inline]

Definition at line 214 of file LinkList.h.

    {
        if (pos.pNode == nullptr)
        {
            return InsertBack(item);
        }

        return InsertAfter(item, pos.pNode->prev);
    }

bool IsEmpty ( ) const [inline]

Definition at line 282 of file LinkList.h.

    {
        return (GetCount() == 0);
    }

POSITION Next ( const POSITION pos ) [inline]

Definition at line 350 of file LinkList.h.

    {
        if (pos.pNode && (pos.pNode->next != &m_anchor))
        {
            return POSITION(pos.pNode->next);
        }
        else
        {
            return POSITION(nullptr);
        }
    }

HRESULT Remove | ( | POSITION & | pos,
 |  | T * | ppItem |
 | ) |  |  | [inline]

Definition at line 365 of file LinkList.h.

    {
        if (pos.pNode)
        {
            // Remove const-ness temporarily...
            Node *pNode = const_cast<Node*>(pos.pNode);

            pos = POSITION();

            return RemoveItem(pNode, ppItem);
        }
        else
        {
            return E_INVALIDARG;
        }
    }

HRESULT RemoveBack ( T * ppItem ) [inline]

Definition at line 226 of file LinkList.h.

    {
        if (IsEmpty())
        {
            return E_FAIL;
        }
        else
        {
            return RemoveItem(Back(), ppItem);
        }
    }

HRESULT RemoveFront ( T * ppItem ) [inline]

Definition at line 240 of file LinkList.h.

    {
        if (IsEmpty())
        {
            return E_FAIL;
        }
        else
        {
            return RemoveItem(Front(), ppItem);
        }
    }

virtual HRESULT RemoveItem | ( | Node * | pNode,
 |  | T * | ppItem |
 | ) |  |  | [inline, protected, virtual]

Definition at line 152 of file LinkList.h.

    {
        if (pNode == nullptr)
        {
            return E_POINTER;
        }

        assert(pNode != &m_anchor); // We should never try to remove the anchor node.
        if (pNode == &m_anchor)
        {
            return E_INVALIDARG;
        }

        T item;

        // The next node's previous is this node's previous.
        pNode->next->prev = pNode->prev;

        // The previous node's next is this node's next.
        pNode->prev->next = pNode->next;

        item = pNode->item;
        delete pNode;

        m_count--;

        if (ppItem)
        {
            *ppItem = item;
        }

        return S_OK;
    }

Member Data Documentation

Node m_anchor [protected]

Definition at line 99 of file LinkList.h.

DWORD m_count [protected]

Definition at line 100 of file LinkList.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: List< T >::Node Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • List< T >
  • List< T >::Node
Public Member Functions | Public Attributes

List< T >::Node Struct Reference

#include "LinkList.h"

List of all members.

Public Member Functions

Node ()
Node (T item)
T | Item () const

Public Attributes

T | item
Node * next
Node * prev

Detailed Description

template<class T>
struct List< T >::Node

Definition at line 50 of file LinkList.h.

Constructor & Destructor Documentation

Node ( ) [inline]

Definition at line 56 of file LinkList.h.

               : prev(nullptr), next(nullptr)
        {
        }

Node ( T item ) [inline]

Definition at line 60 of file LinkList.h.

                     : prev(nullptr), next(nullptr)
        {
            this->item = item;
        }

Member Function Documentation

T Item ( ) const [inline]

Definition at line 65 of file LinkList.h.

{ return item; }

Member Data Documentation

T item

Definition at line 54 of file LinkList.h.

Node* next

Definition at line 53 of file LinkList.h.

Node* prev

Definition at line 52 of file LinkList.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: List< T >::POSITION Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • List< T >
  • List< T >::POSITION
Public Member Functions | Private Member Functions | Private Attributes | Friends

List< T >::POSITION Class Reference

#include "LinkList.h"

List of all members.

Public Member Functions

POSITION ()
bool | operator!= (const POSITION &p) const
bool | operator== (const POSITION &p) const

Private Member Functions

POSITION (Node *p)

Private Attributes

const Node * | pNode

Friends

class | List< T >

Detailed Description

template<class T>
class List< T >::POSITION

Definition at line 71 of file LinkList.h.

Constructor & Destructor Documentation

POSITION ( ) [inline]

Definition at line 76 of file LinkList.h.

                   : pNode(nullptr)
        {
        }

POSITION ( Node * p ) [inline, private]

Definition at line 93 of file LinkList.h.

                          : pNode(p)
        {
        }

Member Function Documentation

bool operator!= ( const POSITION & p ) const [inline]

Definition at line 85 of file LinkList.h.

        {
            return pNode != p.pNode;
        }

bool operator== ( const POSITION & p ) const [inline]

Definition at line 80 of file LinkList.h.

        {
            return pNode == p.pNode;
        }

Friends And Related Function Documentation

friend class List< T > [friend]

Definition at line 73 of file LinkList.h.

Member Data Documentation

const Node* pNode [private]

Definition at line 91 of file LinkList.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ILivePlayer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • ILivePlayer
Public Member Functions

ILivePlayer Interface Reference

Inherited by LiveDashPlayer.

List of all members.

Public Member Functions

void | DesiredLiveOffset (TimeSpan offset)
void | GoToLive ()
Task | Initialize (Uri manifest, MediaElement mediaElement)

Detailed Description

Definition at line 7 of file ILivePlayer.cs.

Member Function Documentation

void DesiredLiveOffset ( TimeSpan offset )

Implemented in LiveDashPlayer.

void GoToLive ( )

Implemented in LiveDashPlayer.

Task Initialize | ( | Uri | manifest,
 |  | MediaElement | mediaElement
 | ) |  |

Implemented in LiveDashPlayer.

The documentation for this interface was generated from the following file:
  • LiveDash/cs/LiveDash/ILivePlayer.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDashPlayer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • LiveDashPlayer
Public Member Functions | Private Attributes

LiveDashPlayer Class Reference

Inherits LiveDash::ILivePlayer.

List of all members.

Public Member Functions

void | Close ()
void | DesiredLiveOffset (TimeSpan offset)
void | GoToLive ()
async Task | Initialize (Uri source, MediaElement mediaElement)

Private Attributes

bool | haveSetLiveOffset
TimeSpan | liveOffset
Player player

Detailed Description

Definition at line 13 of file LiveDashPlayer.cs.

Member Function Documentation

void Close ( ) [inline]

Stops the Timer.

Definition at line 122 of file LiveDashPlayer.cs.

        {
            if (player != null)
            {
                player.Close();
                player = null;
            }
        }

void DesiredLiveOffset ( TimeSpan offset ) [inline]

Sets the offset of where to start playback from the most recent available segment.

Parameters:
offset the offset duration, in hns

Implements ILivePlayer.

Definition at line 24 of file LiveDashPlayer.cs.

        {
            haveSetLiveOffset = true;
            liveOffset = offset;
        }

void GoToLive ( ) [inline]

Goes to the live edge.

This is the most recent available segment minus the desired live offset

Implements ILivePlayer.

Definition at line 34 of file LiveDashPlayer.cs.

        {
            if (player != null)
            {
                if (haveSetLiveOffset)
                {
                    player.HasLiveOffsetValue = true;
                    player.LiveOffset = liveOffset;
                }
                player.GoToLiveEdge();
            }
        }

async Task Initialize | ( | Uri | source,
 |  | MediaElement | mediaElement |
 | ) |  |  | [inline]

Downloads the manifest from the given source, parses the manifest and sets the source on the media element.

Parameters:
source | The URL of the source MPD
mediaElement | The MediaElement to start playback
Returns:

Implements ILivePlayer.

Definition at line 54 of file LiveDashPlayer.cs.

        {
            //1) Download manifest
            var sourceUrlText = source.AbsoluteUri;
            try
            {
                var manifest = new Manifest(sourceUrlText);
                var document = await manifest.LoadManifestAsync(sourceUrlText);

                //2) Parse manifest
                DashManifestParser mpdParser = new DashManifestParser(document, ref manifest);
                if (mpdParser.Parse())
                {

                    if (!manifest.IsSupportedProfile)
                    {
#if DEBUG
                        Logger.Log("The profiles attribute does not contain the \"urn:mpeg:dash:profile:isoff-live:2011\" profile, so it may not work as expected.");
#endif
                    }
                    if (manifest.IsLive)
                    {
                        //3) Play using MSE if it is live
                        MseStreamSource mseSource = new MseStreamSource();
                        player = new Player(mediaElement, mseSource, manifest);
                        if (haveSetLiveOffset && manifest.IsLive)
                        {
                            player.HasLiveOffsetValue = true;
                            player.LiveOffset = liveOffset;
                        }
                        player.Initialize();
                    }
                    else
                    {
                        // Otherwise, use our Adaptive Media Source for on demand content
                        var result = await AdaptiveMediaSource.CreateFromUriAsync(source);
                        if (result.Status != AdaptiveMediaSourceCreationStatus.Success)
                        {
                            throw new Exception("Unable to create media source because: " + result.Status);
                        }
                        var adaptiveSource = result.MediaSource;

                        mediaElement.SetMediaStreamSource(adaptiveSource);
                        mediaElement.Play();
                    }

                }

                else
                {
#if DEBUG
                    Logger.Log("The Parser failed to parse this mpd");
#endif
                    return;
                }
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Exception when initializing player: " + e.Message + " " + Logger.Display(e));
#endif
            }
        }

Member Data Documentation

bool haveSetLiveOffset [private]

Definition at line 16 of file LiveDashPlayer.cs.

TimeSpan liveOffset [private]

Definition at line 17 of file LiveDashPlayer.cs.

Player player [private]

Definition at line 15 of file LiveDashPlayer.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/LiveDashPlayer.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveSourceBufferManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • LiveSourceBufferManager
Protected Member Functions | Properties | Private Member Functions | Private Attributes

LiveSourceBufferManager Class Reference

This class extends a source buffer manager but handles cases for live playback such as setting a live offset and the logic to pick the next segment to play. More...

Inherits LiveDash::SourceBufferManager.

List of all members.

Protected Member Functions

override async void | SendMediaSegment (TimeSpan now)

Properties

ulong | DesiredLiveOffset [get, set]
internal Manifest | Manifest [get, set]
internal int | NextSegmentIndex [get, set]
internal ulong | NextSegmentNumber [get, set]

Private Member Functions

internal | LiveSourceBufferManager (string mimeType, MediaStream stream)
void | DetermineStartingSegmentIndex ()
async Task< int > | GetNewSegmentIndexFromNewStream ()
internal MediaSegment | GetNextSegment ()
internal void | GoToLiveEdge ()
internal void | HandleManifestReload ()
async Task< int > | IterativeSearch (List< MediaSegment > segmentList, int minIndex, int maxIndex, ulong increment, bool isForwardSearch)
async Task< bool > | ReloadManifest ()
async Task< bool > | SearchForSegment ()
async Task< bool > | TryDownloadBuffer (Uri url)
internal override void | UpdateData (TimeSpan now)

Private Attributes

bool | determinedStartingSegmentIndex = false
ulong | hnsDesiredLiveOffset = 300000000
Manifest manifest
int | nextSegmentIndex = 0
ulong | nextSegmentNumber
int | totalSegmentCount

Detailed Description

Definition at line 16 of file LiveSourceBufferManager.cs.

Constructor & Destructor Documentation

internal LiveSourceBufferManager | ( | string | mimeType,
 |  | MediaStream | stream |
 | ) |  |  | [inline, private]

Definition at line 26 of file LiveSourceBufferManager.cs.

                                                                              : base(mimeType, stream)
        {
            isFirstSegment = true;
        }

Member Function Documentation

void DetermineStartingSegmentIndex ( ) [inline, private]

Definition at line 459 of file LiveSourceBufferManager.cs.

        {
            if (!determinedStartingSegmentIndex && !manifest.TreatAsOnDemand && manifest.IsLive)
            {
                //Can't have a live offset lower than 30 seconds
                if (hnsDesiredLiveOffset < 300000000)
                {
                    hnsDesiredLiveOffset = 300000000;
                }
                nextSegmentIndex = stream.GetStartingSegmentIndexForLive(hnsDesiredLiveOffset);
                determinedStartingSegmentIndex = true;
            }
        }

async Task<int> GetNewSegmentIndexFromNewStream ( ) [inline, private]

Definition at line 271 of file LiveSourceBufferManager.cs.

        {
            //Get latest segment info and find out the next segment number
            if (!stream.CanGenerateSegmentsDynamically)
            {
                var nextSegmentnumber = stream.Segments.Last().Number + 1;

                bool reloadAndParseSucceded = await ReloadManifest();

                if (reloadAndParseSucceded)
                {

                    Period selectedPeriod = manifest.GetSelectedPeriod();
                    //CMediaStream newStream = null;
                    if (IsVideo)
                    {
                        stream = selectedPeriod.GetVideoStream();
                    }
                    else if (IsAudio)
                    {
                        stream = selectedPeriod.GetAudioStream();
                    }
                    else
                    {
                        //Is not an audio or video stream...return -1
                        return -1;
                    }
                    for (int i = stream.Segments.Count() - 1; i >= 0; i--)
                    {
                        if (stream.Segments.ElementAt(i).Number == nextSegmentnumber)
                        {
                            return i;
                        }
                    }
                }
            }
            //The segment where we left off at is not on the server
            return -1;
        }

internal MediaSegment GetNextSegment ( ) [inline, private]

Definition at line 201 of file LiveSourceBufferManager.cs.

        {
            DetermineStartingSegmentIndex();
            bool isEndOfStream = false;
            if (manifest.HasPresentationDuration)
            {
                if (isFirstSegment)
                {
                    var segmentInfo = stream.SegmentInformation;
                    var presentationDuration = (ulong)manifest.MediaPresentationDuration.TotalMilliseconds * segmentInfo.Timescale / 1000;

                    var segmentDuration = segmentInfo.Duration;

                    totalSegmentCount = (int)presentationDuration / (int)segmentDuration;
                }
            }

            MediaSegment segment;
            if (stream.CanGenerateSegmentsDynamically && !isEndOfStream)
            {
                //create new segment based on media segment info given
                segment = new MediaSegment();
                var segmentInfo = stream.SegmentInformation;

                var format = segmentInfo.UrlTemplate;
                var bitrate = segmentInfo.Bitrate;
                var repID = segmentInfo.RepresentationID;
                var number = segmentInfo.StartNumber + (ulong)nextSegmentIndex;
                var time = segmentInfo.StartTimestamp + (ulong)nextSegmentIndex;

                string mediaUrl;
                DashManifestParser.ExpandDASHUrlSegmentTemplate(format, manifest.BaseUrl, bitrate, repID, number, time, out mediaUrl);

                segment.Duration = segmentInfo.Duration;
                segment.Number = number;
                segment.Timestamp = time;
                segment.SegmentUrl = mediaUrl;

            }
            else //populated by a list of segments
            {
                segment = stream.Segments.ElementAt(nextSegmentIndex);
            }
            nextSegmentNumber = segment.Number + 1;

            return segment;
        }

internal void GoToLiveEdge ( ) [inline, private]

Definition at line 474 of file LiveSourceBufferManager.cs.

        {
            //m_isFirstSegment = true;
            determinedStartingSegmentIndex = false;
            DetermineStartingSegmentIndex();
        }

internal void HandleManifestReload ( ) [inline, private]

Definition at line 184 of file LiveSourceBufferManager.cs.

        {
            if (!stream.CanGenerateSegmentsDynamically)
            {
                for (int x = 0; x < stream.Segments.Count(); x++)
                {
                    if (stream.Segments.ElementAt(x).Number == nextSegmentNumber)
                    {
                        nextSegmentIndex = x;
                        return;
                    }
                }
                determinedStartingSegmentIndex = false;
                DetermineStartingSegmentIndex();
            }
        }

async Task<int> IterativeSearch | ( | List< MediaSegment > | segmentList,
 |  | int | minIndex,
 |  | int | maxIndex,
 |  | ulong | increment,
 |  | bool | isForwardSearch |
 | ) |  |  | [inline, private]

Definition at line 364 of file LiveSourceBufferManager.cs.

        {
            while (minIndex <= maxIndex)
            {
                int next;
                if (isForwardSearch)
                {
                    next = minIndex + (int)increment;
                }
                else
                {
                    next = maxIndex - (int)increment;
                }

                if (next < minIndex || next > maxIndex)
                {
                    return -1;
                }

                Uri segmentUri = new Uri(segmentList.ElementAt(next).SegmentUrl);
                HttpResponseMessage response = await Downloader.SendHeadRequestAsync(segmentUri);

                if (response.IsSuccessStatusCode)
                {
                    bool downloadSucceeded = await TryDownloadBuffer(segmentUri);
                    return next;
                }
                else
                {
                    if (isForwardSearch)
                    {
                        minIndex = next;
                    }
                    else
                    {
                        maxIndex = next;
                    }
                }
            }
            return -1;
        }

async Task<bool> ReloadManifest ( ) [inline, private]

Definition at line 249 of file LiveSourceBufferManager.cs.

        {
            try
            {
                //Redownload manifest to pick up where it left off
                var mpdUrl = manifest.SourceUrl;
                manifest = new Manifest(mpdUrl);
                var document = await manifest.LoadManifestAsync(mpdUrl);

                DashManifestParser mpdParser = new DashManifestParser(document, ref manifest);

                return mpdParser.Parse();
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Error reloading manifest in the Live Source Buffer: " + e.Message);
#endif
                return false;
            }
        }

async Task<bool> SearchForSegment ( ) [inline, private]

Definition at line 311 of file LiveSourceBufferManager.cs.

        {
            try
            {

                if (stream.CanGenerateSegmentsDynamically)
                {
                    //Does not search for now.
                    return false;
                }
                else
                {
                    var segmentList = stream.Segments;
                    int min = 0;
                    int max = (segmentList.Count()) - 1;

                    //five tries forward and backward?
                    //need to do it in steps of availibilityWindowDuration / 2.
                    ulong increment = ((ulong)max / 2) / 5;

                    int foundIndex = -1;
                    //Forward Search
                    foundIndex = await IterativeSearch(segmentList, nextSegmentIndex, max, increment, true);
                    //Backward Search
                    if (foundIndex == -1)
                    {
                        foundIndex = await IterativeSearch(segmentList, min, nextSegmentIndex, increment, false);
                    }

                    if (foundIndex == -1)
                    {
#if DEBUG
                        Logger.Log("No segment from the manifest was found for stream " + stream.MimeType);
#endif
                        return false;
                    }
                    else
                    {
                        nextSegmentIndex = foundIndex;
                        return true;
                    }

                }
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Exception while searching for available segment: " + Logger.Display(e));
#endif
                return false;
            }
        }

override async void SendMediaSegment ( TimeSpan now ) [inline, protected, virtual]

Reimplemented from SourceBufferManager.

Definition at line 70 of file LiveSourceBufferManager.cs.

        {
            try
            {
                var end = now;

                if (!isInitialized || Appending || isEndOfStream)
                {
                    return;
                }

                //if the next segment is out of range from the manifest, then
                //try to redownload the manifest and pick up where we left off.
                //this is the case where a manifest reload didn't come in time,
                //we don't have a mediaPresentationDuration present, and we cannot generate
                //segments dynamically.the new manifest does not contain the segment,
                //then it is the end of stream.
                if (manifest.HasPresentationDuration && nextSegmentIndex > totalSegmentCount)
                {
                    //nextSegmentIndex = await GetNewSegmentIndexFromNewStream();

                    //if (nextSegmentIndex == -1)
                    //{
                        isEndOfStream = true;
                        return;
                    //}
                }

                foreach (var range in sb.Buffered)
                {
                    if (range.Start <= end + MaxGap && range.End > end)
                    {
                        end = range.End;
                    }
                    else if (range.Start > end)
                    {
                        break;
                    }
                }

                var stream = base.stream;

                MediaSegment segment = GetNextSegment();

                if (now + MaxBuffering <= end)
                {
                    return;
                }

                string url = segment.SegmentUrl;
                internalAppending = true;
#if DEBUG
                Logger.Log("Loading segment url " + url);
#endif
                Uri mediaSegmentUrl = null;
                try
                {
                    mediaSegmentUrl = new Uri(url);
                }
                catch (Exception e)
                {
#if DEBUG
                    Logger.Log("malformed media segment: " + url + Logger.Display(e));
#endif
                }

                bool firstDownloadSucceded = await TryDownloadBuffer(mediaSegmentUrl);
                if (firstDownloadSucceded && isFirstSegment)
                {
                    var bufferedRange = sb.Buffered;

                    TimeSpan startingTimestamp = bufferedRange.First().Start;
                    TimeSpan endingTimestamp = bufferedRange.Last().End;

                    if (sb.Buffered.Count != 0)
                    {
                        sb.Remove(TimeSpan.Zero, endingTimestamp);
#if DEBUG
                        Logger.Log("Removing buffered Range from 0 to " + endingTimestamp);
#endif
                    }
                    sb.TimestampOffset = -startingTimestamp;
#if DEBUG
                    Logger.Log("Setting Timestamp to " + sb.TimestampOffset);
#endif

                    sb.AppendBuffer(activeDownload.Result);
                    isFirstSegment = false;
                }
                else if (!firstDownloadSucceded)
                {
                    bool searchSucceeded = await SearchForSegment();
                    if (!searchSucceeded)
                    {
#if DEBUG
                        Logger.Log("Calling end of stream");
#endif
                        // Failed - should send EndOfStream
                        sb.Abort();
                        isEndOfStream = true;

                    }

                }
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Error when sending media segment: " + e.Message);
#endif
            }

        }

async Task<bool> TryDownloadBuffer ( Uri url ) [inline, private]

Definition at line 406 of file LiveSourceBufferManager.cs.

        {
            bool success = false;
            var activeDownload = Downloader.DownloadBufferAsync(url);
            base.activeDownload = activeDownload;
            await activeDownload.ContinueWith(
            task =>
                 {
                     try
                     {
                         internalAppending = false;
                         bool resultIsPresent = task.Result != null;

                         if (resultIsPresent)
                         {
                             isEndOfStream = false;
                             try
                             {
                                 sb.AppendBuffer(task.Result);
#if DEBUG
                                 Logger.Log("Appended media segment");
#endif
                                 nextSegmentIndex++;
                             }
                             catch (Exception e)
                             {
#if DEBUG
                                 Logger.Log("Append segment exception HRESULT 0x" + e.HResult.ToString("x") + " for the " + mimeType + " source buffer");
#endif
                             }

                             success = true;
                         }
                         else
                         {
                             if (task.Status != TaskStatus.Canceled)
                             {
                                 success = false;
                             }
                         }

                         //m_activeDownload = null;
                     }
                     catch (Exception e)
                     {
#if DEBUG
                         Logger.Log("Error in Trying download HRESULT 0x" + e.HResult.ToString("x") + " for the " + mimeType + " source buffer");
#endif
                     }
                 });
            return success;
        }

internal override void UpdateData ( TimeSpan now ) [inline, private, virtual]

Reimplemented from SourceBufferManager.

Definition at line 59 of file LiveSourceBufferManager.cs.

        {
            if (sb != null)
            {
                SendInitSegment(now);
                CleanBuffer(now);
                SendMediaSegment(now);
            }

        }

Member Data Documentation

bool determinedStartingSegmentIndex = false [private]

Definition at line 18 of file LiveSourceBufferManager.cs.

ulong hnsDesiredLiveOffset = 300000000 [private]

Definition at line 21 of file LiveSourceBufferManager.cs.

Manifest manifest [private]

Definition at line 20 of file LiveSourceBufferManager.cs.

int nextSegmentIndex = 0 [private]

Definition at line 19 of file LiveSourceBufferManager.cs.

ulong nextSegmentNumber [private]

Definition at line 23 of file LiveSourceBufferManager.cs.

int totalSegmentCount [private]

Definition at line 24 of file LiveSourceBufferManager.cs.

Property Documentation

ulong DesiredLiveOffset [get, set]

Definition at line 52 of file LiveSourceBufferManager.cs.

internal Manifest Manifest [get, set, private]

Definition at line 34 of file LiveSourceBufferManager.cs.

internal int NextSegmentIndex [get, set, private]

Definition at line 40 of file LiveSourceBufferManager.cs.

internal ulong NextSegmentNumber [get, set, private]

Definition at line 46 of file LiveSourceBufferManager.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/LiveSourceBufferManager.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Manifest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Models
  • Manifest
Static Public Attributes | Properties | Private Member Functions | Private Attributes

Manifest Class Reference

Represents a DASH manifest of type .mpd. More...

List of all members.

Static Public Attributes

static string | AudioMimeType = "audio/mp4"
static double | MinMinimumUpdatePeriod = 3
static string | VideoMimeType = "video/mp4"

Properties

internal DateTimeOffset | AvailibilityStartTime [get, set]
internal string | BaseUrl [get, set]
internal bool | HasMinimumUpdatePeriod [get, set]
internal bool | HasMultiplePeriods [get, set]
internal bool | HasPresentationDuration [get, set]
internal bool | IsLive [get, set]
internal bool | IsSupportedProfile [get, set]
internal TimeSpan | LastPeriodDuration [get, set]
internal TimeSpan | MediaPresentationDuration [get, set]
internal TimeSpan | MinBufferTime [get, set]
internal TimeSpan | MinimumUpdatePeriod [get, set]
DateTimeOffset | PublishTime [get, set]
internal string | SourceUrl [get]
internal TimeSpan | TimeShiftBufferDepth [get, set]
bool | TreatAsOnDemand [get, set]

Private Member Functions

internal | Manifest (string url)
internal void | AddPeriod (Period period)
internal void | AppendToBaseUrl (string url)
internal Period | GetSelectedPeriod ()
internal async Task
< Windows.Data.Xml.Dom.XmlDocument > 		LoadManifestAsync (string url)
internal void | SetFirstSelectedPeriod ()
internal void | SetNextSelectedPeriod ()

Private Attributes

DateTimeOffset | availabilityStartTime
string | baseUrl
bool | hasMinimumUpdatePeriod
bool | hasMultiplePeriods
bool | hasPresentationDuration
bool | isLive
bool | isSupportedProfile
TimeSpan | lastPeriodDuration
TimeSpan | mediaPresentationDuration
TimeSpan | minBufferTime
TimeSpan | minimumUpdatePeriod
List< Period > periods
DateTimeOffset | publishTime
string | sourceUrl
TimeSpan | timeShiftBufferDepth
bool | treatAsOnDemand

Detailed Description

Definition at line 15 of file Manifest.cs.

Constructor & Destructor Documentation

internal Manifest ( string url ) [inline, private]

Definition at line 39 of file Manifest.cs.

        {
            periods = new List<Period>();
            sourceUrl = url;
            //trim the filename of the url
            int index = url.LastIndexOf("/");
            int lastChunkLength = url.Length - index;
            int baseUrlEndIndex = url.Length - lastChunkLength;
            baseUrl = url.Substring(0, baseUrlEndIndex);
        }

Member Function Documentation

internal void AddPeriod ( Period period ) [inline, private]

Definition at line 155 of file Manifest.cs.

        {
            periods.Add(period);
        }

internal void AppendToBaseUrl ( string url ) [inline, private]

Definition at line 216 of file Manifest.cs.

        {
            if (!baseUrl.EndsWith("/"))
            {
                baseUrl += "/";
            }

            baseUrl += url;
        }

internal Period GetSelectedPeriod ( ) [inline, private]

Definition at line 160 of file Manifest.cs.

        {
            foreach (var period in periods)
            {
                if (period.IsSelected)
                {
                    return period;
                }
            }
            return null;
        }

internal async Task<Windows.Data.Xml.Dom.XmlDocument> LoadManifestAsync ( string url ) [inline, private]

Definition at line 172 of file Manifest.cs.

        {
            Uri uri = null;
            IBuffer buffer = null;
            try
            {
                uri = new Uri(url);
            }
            catch
            {
#if DEBUG
                Logger.Log("Bad url: " + url);
#endif
                throw new Exception("Invalid URL");
            }

            buffer = await Downloader.DownloadBufferAsync(uri);

            if (buffer == null)
            {
#if DEBUG
                Logger.Log("Failed to get buffer of manifest");
#endif
                throw new Exception("Failed to get buffer from url");
            }
            Windows.Data.Xml.Dom.XmlDocument document = new Windows.Data.Xml.Dom.XmlDocument();

            try
            {

                var bufferString = DataReader.FromBuffer(buffer).ReadString(buffer.Length);
                document.LoadXmlFromBuffer(buffer);
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Failed to load XML from buffer = " + Logger.Display(e));
#endif
                throw new Exception("Invalid XML file");
            }

            return document;
        }

internal void SetFirstSelectedPeriod ( ) [inline, private]

Definition at line 226 of file Manifest.cs.

        {
            if (periods.Count() > 0)
            {
                periods.First<Period>().IsSelected = true;
            }
        }

internal void SetNextSelectedPeriod ( ) [inline, private]

Definition at line 234 of file Manifest.cs.

        {
            var periodCount = periods.Count();
            for (int x = 0; x < periodCount; x++)
            {
                if (periods.ElementAt(x).IsSelected && (x + 1) < periodCount)
                {
                    periods.ElementAt(x).IsSelected = false;
                    periods.ElementAt(x + 1).IsSelected = true;
                    return;
                }
            }
            HasMultiplePeriods = false;

        }

Member Data Documentation

string AudioMimeType = "audio/mp4" [static]

Definition at line 35 of file Manifest.cs.

DateTimeOffset availabilityStartTime [private]

Definition at line 19 of file Manifest.cs.

string baseUrl [private]

Definition at line 28 of file Manifest.cs.

bool hasMinimumUpdatePeriod [private]

Definition at line 30 of file Manifest.cs.

bool hasMultiplePeriods [private]

Definition at line 31 of file Manifest.cs.

bool hasPresentationDuration [private]

Definition at line 29 of file Manifest.cs.

bool isLive [private]

Definition at line 17 of file Manifest.cs.

bool isSupportedProfile [private]

Definition at line 18 of file Manifest.cs.

TimeSpan lastPeriodDuration [private]

Definition at line 25 of file Manifest.cs.

TimeSpan mediaPresentationDuration [private]

Definition at line 24 of file Manifest.cs.

TimeSpan minBufferTime [private]

Definition at line 20 of file Manifest.cs.

TimeSpan minimumUpdatePeriod [private]

Definition at line 21 of file Manifest.cs.

double MinMinimumUpdatePeriod = 3 [static]

Definition at line 36 of file Manifest.cs.

List<Period> periods [private]

Definition at line 26 of file Manifest.cs.

DateTimeOffset publishTime [private]

Definition at line 23 of file Manifest.cs.

string sourceUrl [private]

Definition at line 27 of file Manifest.cs.

TimeSpan timeShiftBufferDepth [private]

Definition at line 22 of file Manifest.cs.

bool treatAsOnDemand [private]

Definition at line 32 of file Manifest.cs.

string VideoMimeType = "video/mp4" [static]

Definition at line 34 of file Manifest.cs.

Property Documentation

internal DateTimeOffset AvailibilityStartTime [get, set, private]

Definition at line 77 of file Manifest.cs.

internal string BaseUrl [get, set, private]

Definition at line 52 of file Manifest.cs.

internal bool HasMinimumUpdatePeriod [get, set, private]

Definition at line 98 of file Manifest.cs.

internal bool HasMultiplePeriods [get, set, private]

Definition at line 126 of file Manifest.cs.

internal bool HasPresentationDuration [get, set, private]

Definition at line 133 of file Manifest.cs.

internal bool IsLive [get, set, private]

Definition at line 63 of file Manifest.cs.

internal bool IsSupportedProfile [get, set, private]

Definition at line 70 of file Manifest.cs.

internal TimeSpan LastPeriodDuration [get, set, private]

Definition at line 119 of file Manifest.cs.

internal TimeSpan MediaPresentationDuration [get, set, private]

Definition at line 112 of file Manifest.cs.

internal TimeSpan MinBufferTime [get, set, private]

Definition at line 84 of file Manifest.cs.

internal TimeSpan MinimumUpdatePeriod [get, set, private]

Definition at line 91 of file Manifest.cs.

DateTimeOffset PublishTime [get, set]

Definition at line 140 of file Manifest.cs.

internal string SourceUrl [get, private]

Definition at line 58 of file Manifest.cs.

internal TimeSpan TimeShiftBufferDepth [get, set, private]

Definition at line 105 of file Manifest.cs.

bool TreatAsOnDemand [get, set]

Definition at line 147 of file Manifest.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Models/Manifest.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaSegment Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Models
  • MediaSegment
Properties | Private Member Functions | Private Attributes

MediaSegment Class Reference

Represents a media segment withing a media stream. More...

List of all members.

Properties

internal UInt64 | Duration [get, set]
internal UInt64 | Number [get, set]
internal string | SegmentUrl [get, set]
internal UInt64 | Timestamp [get, set]

Private Member Functions

internal | MediaSegment ()

Private Attributes

UInt64 | d
UInt64 | s
UInt64 | t
string | url

Detailed Description

Definition at line 12 of file MediaSegment.cs.

Constructor & Destructor Documentation

internal MediaSegment ( ) [inline, private]

Definition at line 19 of file MediaSegment.cs.

        {
        }

Member Data Documentation

UInt64 d [private]

Definition at line 15 of file MediaSegment.cs.

UInt64 s [private]

Definition at line 16 of file MediaSegment.cs.

UInt64 t [private]

Definition at line 14 of file MediaSegment.cs.

string url [private]

Definition at line 17 of file MediaSegment.cs.

Property Documentation

internal UInt64 Duration [get, set, private]

Definition at line 31 of file MediaSegment.cs.

internal UInt64 Number [get, set, private]

Definition at line 38 of file MediaSegment.cs.

internal string SegmentUrl [get, set, private]

Definition at line 45 of file MediaSegment.cs.

internal UInt64 Timestamp [get, set, private]

Definition at line 25 of file MediaSegment.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Models/MediaSegment.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaSegmentInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Models
  • MediaSegmentInformation
Properties | Private Attributes

MediaSegmentInformation Class Reference

List of all members.

Properties

internal UInt32 | Bitrate [get, set]
internal UInt64 | Duration [get, set]
internal string | RepresentationID [get, set]
internal UInt64 | StartNumber [get, set]
internal UInt64 | StartTimestamp [get, set]
internal UInt64 | Timescale [get, set]
internal string | UrlTemplate [get, set]

Private Attributes

UInt32 | bitrate
UInt64 | duration
string | mediaUrlTemplate
string | representationID
UInt64 | startNumber
UInt64 | startTimestamp
UInt64 | timescale

Detailed Description

Definition at line 9 of file MediaSegmentInformation.cs.

Member Data Documentation

UInt32 bitrate [private]

Definition at line 15 of file MediaSegmentInformation.cs.

UInt64 duration [private]

Definition at line 14 of file MediaSegmentInformation.cs.

string mediaUrlTemplate [private]

Definition at line 18 of file MediaSegmentInformation.cs.

string representationID [private]

Definition at line 16 of file MediaSegmentInformation.cs.

UInt64 startNumber [private]

Definition at line 12 of file MediaSegmentInformation.cs.

UInt64 startTimestamp [private]

Definition at line 13 of file MediaSegmentInformation.cs.

UInt64 timescale [private]

Definition at line 11 of file MediaSegmentInformation.cs.

Property Documentation

internal UInt32 Bitrate [get, set, private]

Definition at line 51 of file MediaSegmentInformation.cs.

internal UInt64 Duration [get, set, private]

Definition at line 44 of file MediaSegmentInformation.cs.

internal string RepresentationID [get, set, private]

Definition at line 65 of file MediaSegmentInformation.cs.

internal UInt64 StartNumber [get, set, private]

Definition at line 30 of file MediaSegmentInformation.cs.

internal UInt64 StartTimestamp [get, set, private]

Definition at line 37 of file MediaSegmentInformation.cs.

internal UInt64 Timescale [get, set, private]

Definition at line 23 of file MediaSegmentInformation.cs.

internal string UrlTemplate [get, set, private]

Definition at line 58 of file MediaSegmentInformation.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Models/MediaSegmentInformation.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Models
  • MediaStream
Properties | Private Types | Private Member Functions | Private Attributes

MediaStream Class Reference

Represents a stream of data, such as audio or video. More...

List of all members.

Properties

internal bool | CanGenerateSegmentsDynamically [get, set]
internal IBuffer | InitSegmentData [get, set]
internal string | InitSegmentUrl [get, set]
internal bool | isInitSegmentDownloading [get, set]
internal string | Language [get, set]
internal string | MimeType [get, set]
internal MediaSegmentInformation | SegmentInformation [get, set]
internal SegmentInformationType | SegmentInfoType [get, set]
internal List< MediaSegment > | Segments [get]
internal SegmentTemplateIdentifier | SegmentTemplateBase [get, set]

Private Types

enum | SegmentInformationType { Base, Template, List }
enum | SegmentTemplateIdentifier { Number, Time, Other }

Private Member Functions

internal | MediaStream ()
internal int | GetStartingSegmentIndexForLive (ulong hnsDesiredLiveOffset)
internal void | PushBackSegment (MediaSegment segment)
internal void | PushFrontSegment (MediaSegment segment)

Private Attributes

string | initSegmentUrl
string | language
bool | m_canGenerateSegmentsDynamically
IBuffer | m_initSegmentData = null
bool | m_isInitSegmentDownloading = false
MediaSegmentInformation m_segmentInformation
SegmentInformationType m_segmentInfoType
List< MediaSegment > m_segments
SegmentTemplateIdentifier m_segmentTemplateIdentifier
string | mimeType

Detailed Description

Definition at line 13 of file MediaStream.cs.

Member Enumeration Documentation

enum SegmentInformationType [private]
Enumerator:
Base
Template
List

Definition at line 31 of file MediaStream.cs.

        {
            Base,
            Template,
            List
        };

enum SegmentTemplateIdentifier [private]
Enumerator:
Number
Time
Other

Definition at line 38 of file MediaStream.cs.

        {
            Number,
            Time,
            Other
        };

Constructor & Destructor Documentation

internal MediaStream ( ) [inline, private]

Definition at line 45 of file MediaStream.cs.

        {
            m_segments = new List<MediaSegment>();
        }

Member Function Documentation

internal int GetStartingSegmentIndexForLive ( ulong hnsDesiredLiveOffset ) [inline, private]

Definition at line 125 of file MediaStream.cs.

        {
            if (!m_canGenerateSegmentsDynamically)
            {
                int segmentCount = m_segments.Count();

                if (segmentCount > 0)
                {
                    ulong hnsLiveOffset = 0;
                    for (int x = segmentCount - 1; x >= 0; x--)
                    {
                        hnsLiveOffset += m_segments.ElementAt(x).Duration * 10000000 / SegmentInformation.Timescale;
                        if (hnsLiveOffset >= hnsDesiredLiveOffset)
                        {
                            return x;
                        }
                    }
                }
                return 0;
            }
            else
            {
                int x = 0;
                ulong hnsLiveOffset = 0;
                while (hnsLiveOffset < hnsDesiredLiveOffset)
                {
                    hnsLiveOffset += m_segmentInformation.Duration * 10000000 / SegmentInformation.Timescale;
                    x--;
                }
                return x;
            }

        }

internal void PushBackSegment ( MediaSegment segment ) [inline, private]

Definition at line 115 of file MediaStream.cs.

        {
            m_segments.Add(segment);
        }

internal void PushFrontSegment ( MediaSegment segment ) [inline, private]

Definition at line 120 of file MediaStream.cs.

        {
            m_segments.Insert(0, segment);
        }

Member Data Documentation

string initSegmentUrl [private]

Definition at line 17 of file MediaStream.cs.

string language [private]

Definition at line 15 of file MediaStream.cs.

bool m_canGenerateSegmentsDynamically [private]

Definition at line 25 of file MediaStream.cs.

IBuffer m_initSegmentData = null [private]

Definition at line 28 of file MediaStream.cs.

bool m_isInitSegmentDownloading = false [private]

Definition at line 29 of file MediaStream.cs.

MediaSegmentInformation m_segmentInformation [private]

Definition at line 24 of file MediaStream.cs.

SegmentInformationType m_segmentInfoType [private]

Definition at line 19 of file MediaStream.cs.

List<MediaSegment> m_segments [private]

Definition at line 22 of file MediaStream.cs.

SegmentTemplateIdentifier m_segmentTemplateIdentifier [private]

Definition at line 20 of file MediaStream.cs.

string mimeType [private]

Definition at line 16 of file MediaStream.cs.

Property Documentation

internal bool CanGenerateSegmentsDynamically [get, set, private]

Definition at line 108 of file MediaStream.cs.

internal IBuffer InitSegmentData [get, set, private]

Definition at line 78 of file MediaStream.cs.

internal string InitSegmentUrl [get, set, private]

Definition at line 66 of file MediaStream.cs.

internal bool isInitSegmentDownloading [get, set, private]

Definition at line 84 of file MediaStream.cs.

internal string Language [get, set, private]

Definition at line 52 of file MediaStream.cs.

internal string MimeType [get, set, private]

Definition at line 59 of file MediaStream.cs.

internal MediaSegmentInformation SegmentInformation [get, set, private]

Definition at line 102 of file MediaStream.cs.

internal SegmentInformationType SegmentInfoType [get, set, private]

Definition at line 90 of file MediaStream.cs.

internal List<MediaSegment> Segments [get, private]

Definition at line 73 of file MediaStream.cs.

internal SegmentTemplateIdentifier SegmentTemplateBase [get, set, private]

Definition at line 96 of file MediaStream.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Models/MediaStream.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Period Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Models
  • Period
Properties | Private Member Functions | Private Attributes

Period Class Reference

Represents a period within a media presentation description. More...

List of all members.

Properties

internal TimeSpan | Duration [get, set]
internal string | Id [get, set]
internal bool | IsSelected [get, set]
internal TimeSpan | Start [get, set]

Private Member Functions

internal | Period ()
internal void | AddStream (MediaStream stream)
internal MediaStream | GetAudioStream ()
internal MediaStream | GetVideoStream ()

Private Attributes

TimeSpan | duration
string | id
bool | isSelected
List< MediaStream > m_streams
TimeSpan | start

Detailed Description

Definition at line 12 of file Period.cs.

Constructor & Destructor Documentation

internal Period ( ) [inline, private]

Definition at line 21 of file Period.cs.

        {
            m_streams = new List<MediaStream>();
        }

Member Function Documentation

internal void AddStream ( MediaStream stream ) [inline, private]

Definition at line 78 of file Period.cs.

        {
            m_streams.Add(stream);
        }

internal MediaStream GetAudioStream ( ) [inline, private]

Gets the stream with the audio/mp4 mime type and will return null otherwise.

Definition at line 103 of file Period.cs.

        {
            foreach (var stream in m_streams)
            {
                if (stream.MimeType.Equals(Manifest.AudioMimeType))
                {
                    return stream;
                }
            }
            return null;
        }

internal MediaStream GetVideoStream ( ) [inline, private]

Gets the stream with the video/mp4 mime type and will return null otherwise.

Definition at line 87 of file Period.cs.

        {
            foreach (var stream in m_streams)
            {
                if (stream.MimeType.Equals(Manifest.VideoMimeType))
                {
                    return stream;
                }
            }
            return null;
        }

Member Data Documentation

TimeSpan duration [private]

Definition at line 18 of file Period.cs.

string id [private]

Definition at line 16 of file Period.cs.

bool isSelected [private]

Definition at line 17 of file Period.cs.

List<MediaStream> m_streams [private]

Definition at line 14 of file Period.cs.

TimeSpan start [private]

Definition at line 19 of file Period.cs.

Property Documentation

internal TimeSpan Duration [get, set, private]

Definition at line 52 of file Period.cs.

internal string Id [get, set, private]

Definition at line 28 of file Period.cs.

internal bool IsSelected [get, set, private]

Definition at line 40 of file Period.cs.

internal TimeSpan Start [get, set, private]

Definition at line 65 of file Period.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Models/Period.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Player Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Player
Public Member Functions | Properties | Private Member Functions | Private Attributes

Player Class Reference

This class manages the source buffers (audio and video) and takes care of setting the mse stream source on the media element. More...

List of all members.

Public Member Functions

Player (MediaElement vid, MseStreamSource mse, Manifest manifest)

Properties

bool | HasLiveOffsetValue [get, set]
TimeSpan | LiveOffset [get, set]

Private Member Functions

void | AddAudioAndVideoSourceBuffers (Period currentPeriod)
void | CheckForMediaPresentationDuration ()
internal void | Close ()
internal void | ConfigureMse ()
SourceBufferManager GetAudioBuffer ()
SourceBufferManager GetVideoBuffer ()
internal async void | GoToLiveEdge ()
internal void | Initialize ()
void | M_mediaElement_CurrentStateChanged (object sender, RoutedEventArgs e)
void | M_mse_Closed (MseStreamSource sender, object args)
void | M_mse_Opened (MseStreamSource sender, object args)
async Task | ReloadManifest ()
async void | SearchSegmentIfOutsideBuffer ()
internal void | SetLiveOffsetValue ()
void | StartManifestReloadTimer ()
internal void | UpdateData (TimeSpan now)
void | UpdateLiveSourceBuffers ()
void | UpdateLiveSourceBuffersToLiveEdge ()

Private Attributes

bool | hasLiveOffsetValue
bool | isPaused = false
TimeSpan | liveOffset
Manifest manifest
DispatcherTimer | manifestReloadTimer
MediaElement | mediaElement
MseStreamSource | mse
bool | opened = false
DispatcherTimer | playbackTimer
List< SourceBufferManager > sourceBuffers

Detailed Description

Definition at line 19 of file Player.cs.

Constructor & Destructor Documentation

Player | ( | MediaElement | vid,
 |  | MseStreamSource | mse,
 |  | Manifest | manifest |
 | ) |  |  | [inline]

Definition at line 32 of file Player.cs.

        {
            sourceBuffers = new List<SourceBufferManager>();
            playbackTimer = new DispatcherTimer();
            mediaElement = vid;
            this.mse = mse;
            this.manifest = manifest;

            //Add an audio and video source buffer
            AddAudioAndVideoSourceBuffers(this.manifest.GetSelectedPeriod());

            if (this.manifest.IsLive && this.manifest.HasMinimumUpdatePeriod)
            {
                StartManifestReloadTimer();
            }

        }

Member Function Documentation

void AddAudioAndVideoSourceBuffers ( Period currentPeriod ) [inline, private]

Definition at line 71 of file Player.cs.

        {

            var audioStream = currentPeriod.GetAudioStream();
            if (audioStream != null)
            {
                if (manifest.IsLive)
                {
                    sourceBuffers.Add(new LiveSourceBufferManager(Manifest.AudioMimeType, audioStream));
                    mediaElement.TransportControls.IsSeekEnabled = false;
                }
                else
                {
                    sourceBuffers.Add(new SourceBufferManager(Manifest.AudioMimeType, audioStream));
                }
            }

            var vidStream = currentPeriod.GetVideoStream();
            if (vidStream != null)
            {
                if (manifest.IsLive)
                {
                    sourceBuffers.Add(new LiveSourceBufferManager(Manifest.VideoMimeType, vidStream));
                }
                else
                {
                    sourceBuffers.Add(new SourceBufferManager(Manifest.VideoMimeType, vidStream));
                }
            }

        }

void CheckForMediaPresentationDuration ( ) [inline, private]

Definition at line 128 of file Player.cs.

        {
            //Stop reloading the manifest because we know the presentation is about
            //to end
            if (manifest.HasPresentationDuration
                && manifestReloadTimer != null && manifestReloadTimer.IsEnabled)
            {
                manifestReloadTimer.Stop();
            }
        }

internal void Close ( ) [inline, private]

Definition at line 363 of file Player.cs.

        {
            try
            {
                if (manifestReloadTimer != null)
                {
                    manifestReloadTimer.Stop();
                }
                sourceBuffers.Clear();
                mse = null;
                playbackTimer.Stop();
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Exception has been thrown: " + e.Message);
#endif
            }
        }

internal void ConfigureMse ( ) [inline, private]

Definition at line 255 of file Player.cs.

        {
            mse.Opened += M_mse_Opened;

            mse.Closed += M_mse_Closed;
        }

SourceBufferManager GetAudioBuffer ( ) [inline, private]

Definition at line 339 of file Player.cs.

        {
            foreach (var sb in sourceBuffers)
            {
                if (sb.IsAudio)
                {
                    return sb;
                }
            }
            return null;
        }

SourceBufferManager GetVideoBuffer ( ) [inline, private]

Definition at line 351 of file Player.cs.

        {
            foreach (var sb in sourceBuffers)
            {
                if (sb.IsVideo)
                {
                    return sb;
                }
            }
            return null;
        }

internal async void GoToLiveEdge ( ) [inline, private]

Definition at line 383 of file Player.cs.

        {
            await ReloadManifest();

            sourceBuffers.Clear();
            mse.EndOfStream(MseEndOfStreamStatus.Success);

            opened = false;
            mse = new MseStreamSource();
            AddAudioAndVideoSourceBuffers(manifest.GetSelectedPeriod());

            SetLiveOffsetValue();

            ConfigureMse();
            mediaElement.SetMediaStreamSource(mse);

            CheckForMediaPresentationDuration();
            UpdateLiveSourceBuffersToLiveEdge();
            mediaElement.Play();
        }

internal void Initialize ( ) [inline, private]

Definition at line 182 of file Player.cs.

        {
            mediaElement.MediaOpened +=
                (sender1, e1) =>
                {
                    UpdateData(mediaElement.Position);
                };

            ConfigureMse();

            SetLiveOffsetValue();

            //  Create our timer - for the web we could use the timerupdate
            //  method on the mediaelement but that's not available in XAML
            playbackTimer.Interval = TimeSpan.FromSeconds(0.2);
            playbackTimer.Tick +=
                (sender, e) =>
                {
                    UpdateData(mediaElement.Position);
                };
            playbackTimer.Start();

            //  Hook up the stream source
            mediaElement.SetMediaStreamSource(mse);

            mediaElement.CurrentStateChanged += M_mediaElement_CurrentStateChanged;
            mediaElement.Play();
        }

void M_mediaElement_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 211 of file Player.cs.

        {
            if (mediaElement.CurrentState == MediaElementState.Paused &&
                playbackTimer.IsEnabled)
            {
                playbackTimer.Stop();
                isPaused = true;

            }
            else if (mediaElement.CurrentState == MediaElementState.Playing &&
                isPaused)
            {
                if (manifest.IsLive)
                {
                    //Do a head request on the current segment to see if it is on the server
                    //if not we will skip to live edge
                    SearchSegmentIfOutsideBuffer();
                }
                playbackTimer.Start();
                isPaused = false;
            }

        }

void M_mse_Closed | ( | MseStreamSource | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 262 of file Player.cs.

        {
#if DEBUG
            Logger.Log("Closing media source");
#endif
            foreach (var sourceBuffer in sourceBuffers)
            {
                sourceBuffer.Close();
            }

        }

void M_mse_Opened | ( | MseStreamSource | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 274 of file Player.cs.

        {
#if DEBUG
            Logger.Log("Opened Stream Source");
#endif
            if (opened)
            {
                return;
            }
            opened = true;
            foreach (var sourceBuffer in sourceBuffers)
            {
                if (manifest.IsLive)
                {
                    mse.Duration = null;
                }
                sourceBuffer.Initialize(mse);
            }
    }

async Task ReloadManifest ( ) [inline, private]

Definition at line 157 of file Player.cs.

        {
            try
            {
                var sourceUrl = manifest.SourceUrl;
                manifest = new Manifest(sourceUrl);
                var document = await manifest.LoadManifestAsync(sourceUrl);

                DashManifestParser mpdParser = new DashManifestParser(document, ref manifest);
                if (!mpdParser.Parse())
                {
#if DEBUG
                    Logger.Log("The Parser failed to parse this mpd");
#endif
                    return;
                }
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Error occured reloading manifest: " + e.Message);
#endif
            }
        }

async void SearchSegmentIfOutsideBuffer ( ) [inline, private]

Definition at line 236 of file Player.cs.

        {
            LiveSourceBufferManager vidBuffer = (LiveSourceBufferManager)GetVideoBuffer();
            if (vidBuffer == null)
            {
                return;
            }
            MediaSegment segment = vidBuffer.GetNextSegment();
            HttpResponseMessage response = await Downloader.SendHeadRequestAsync(new Uri(segment.SegmentUrl));

            if (response.StatusCode == HttpStatusCode.NotFound)
            {
#if DEBUG
                Logger.Log("Trying to go to Live Edge");
#endif
                GoToLiveEdge();
            }
        }

internal void SetLiveOffsetValue ( ) [inline, private]

Definition at line 404 of file Player.cs.

        {
            if (HasLiveOffsetValue)
            {
                var hnsdesiredLiveOffset = (ulong)(liveOffset.TotalMilliseconds * 10000); //hns
                foreach (var sourcebuffer in sourceBuffers)
                {
                    ((LiveSourceBufferManager)sourcebuffer).DesiredLiveOffset = hnsdesiredLiveOffset;
                }
            }
        }

void StartManifestReloadTimer ( ) [inline, private]

Definition at line 103 of file Player.cs.

        {
            UpdateLiveSourceBuffers();
            manifestReloadTimer = new DispatcherTimer();

            double minUpdatePeriod = manifest.MinimumUpdatePeriod.TotalSeconds;
            if (minUpdatePeriod < Manifest.MinMinimumUpdatePeriod)
            {
                manifestReloadTimer.Interval = TimeSpan.FromSeconds(Manifest.MinMinimumUpdatePeriod);
            }
            else
            {
                manifestReloadTimer.Interval = manifest.MinimumUpdatePeriod;
            }

            manifestReloadTimer.Tick +=
            async (sender, e) =>
                {
                    await ReloadManifest();
                    CheckForMediaPresentationDuration();
                    UpdateLiveSourceBuffers();
                };
            manifestReloadTimer.Start();
        }

internal void UpdateData ( TimeSpan now ) [inline, private]

Definition at line 294 of file Player.cs.

        {
            var eos = true;
            try
            {
                var vidBuffer = GetVideoBuffer();
                var audioBuffer = GetAudioBuffer();

                if (vidBuffer == null && audioBuffer == null)
                {
                    throw new InvalidOperationException("Video or Audio buffer is null");
                }
                if (manifest.IsLive)
                {
                    UpdateLiveSourceBuffers();
                }

                if (vidBuffer != null && !vidBuffer.IsEndOfStream)
                {
                    vidBuffer.UpdateData(now);
                    eos = false;
                }

                if (audioBuffer != null && !audioBuffer.IsEndOfStream)
                {
                    audioBuffer.UpdateData(now);
                    eos = false;
                }
                if (eos)
                {
                    if (mse.ReadyState == MseReadyState.Open)
                    {
#if DEBUG
                        Logger.Log("Calling EndOfStream");
#endif
                        mse.EndOfStream(MseEndOfStreamStatus.Success);
                    }
                }
            }
            catch (Exception)
            {

            }
        }

void UpdateLiveSourceBuffers ( ) [inline, private]

Definition at line 139 of file Player.cs.

        {
            foreach (var sourceBuffer in sourceBuffers)
            {
                ((LiveSourceBufferManager)sourceBuffer).Manifest = manifest;
                ((LiveSourceBufferManager)sourceBuffer).HandleManifestReload();
            }
        }

void UpdateLiveSourceBuffersToLiveEdge ( ) [inline, private]

Definition at line 148 of file Player.cs.

        {
            foreach (var sourceBuffer in sourceBuffers)
            {
                ((LiveSourceBufferManager)sourceBuffer).Manifest = manifest;
                ((LiveSourceBufferManager)sourceBuffer).GoToLiveEdge();
            }
        }

Member Data Documentation

bool hasLiveOffsetValue [private]

Definition at line 29 of file Player.cs.

bool isPaused = false [private]

Definition at line 28 of file Player.cs.

TimeSpan liveOffset [private]

Definition at line 30 of file Player.cs.

Manifest manifest [private]

Definition at line 23 of file Player.cs.

DispatcherTimer manifestReloadTimer [private]

Definition at line 26 of file Player.cs.

MediaElement mediaElement [private]

Definition at line 21 of file Player.cs.

MseStreamSource mse [private]

Definition at line 22 of file Player.cs.

bool opened = false [private]

Definition at line 27 of file Player.cs.

DispatcherTimer playbackTimer [private]

Definition at line 25 of file Player.cs.

List<SourceBufferManager> sourceBuffers [private]

Definition at line 24 of file Player.cs.

Property Documentation

bool HasLiveOffsetValue [get, set]

Definition at line 57 of file Player.cs.

TimeSpan LiveOffset [get, set]

Definition at line 64 of file Player.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Player.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SourceBufferManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • SourceBufferManager
Protected Member Functions | Protected Attributes | Properties | Private Member Functions

SourceBufferManager Class Reference

Handles the source buffer for each stream of data. More...

Inherited by LiveSourceBufferManager.

List of all members.

Protected Member Functions

virtual void | SendMediaSegment (TimeSpan now)

Protected Attributes

Task< IBuffer > | activeDownload = null
bool | internalAppending = false
bool | isEndOfStream = false
bool | isFirstSegment
bool | isInitialized = false
TimeSpan | MaxBuffering = TimeSpan.FromSeconds(5.0)
TimeSpan | MaxGap = TimeSpan.FromSeconds(0.1)
string | mimeType
MseStreamSource | mse
MseSourceBuffer | sb
int | segmentCursor = 0
MediaStream stream

Properties

bool | Appending [get]
bool | IsAudio [get]
bool | IsEndOfStream [get, set]
bool | IsVideo [get]
MseSourceBuffer | MseSourceBuffer [get]

Private Member Functions

internal | SourceBufferManager (string mimeType, MediaStream stream)
void | AbortDownload ()
internal void | CleanBuffer (TimeSpan now)
internal void | Close ()
internal void | Initialize (MseStreamSource mse)
internal void | SendInitSegment (TimeSpan now)
virtual internal void | UpdateData (TimeSpan now)

Detailed Description

Definition at line 18 of file SourceBufferManager.cs.

Constructor & Destructor Documentation

internal SourceBufferManager | ( | string | mimeType,
 |  | MediaStream | stream |
 | ) |  |  | [inline, private]

Definition at line 34 of file SourceBufferManager.cs.

        {
            this.mimeType = mimeType;
            this.stream = stream;

        }

Member Function Documentation

void AbortDownload ( ) [inline, private]

Definition at line 256 of file SourceBufferManager.cs.

        {
            if (activeDownload != null)
            {
                if (activeDownload.Status == TaskStatus.RanToCompletion)
                {
                    activeDownload.AsAsyncAction().Cancel();
                }
            }
        }

internal void CleanBuffer ( TimeSpan now ) [inline, private]

Definition at line 137 of file SourceBufferManager.cs.

        {
            try
            {
                if (isEndOfStream || Appending)
                {
                    return;
                }
                var buffering = sb.Buffered;

                if (buffering.Count > 0)
                {
                    // Keep 5 seconds
                    if (now - TimeSpan.FromSeconds(10) > buffering[0].Start)
                    {
                        sb.Remove(buffering[0].Start, now - TimeSpan.FromSeconds(10));
                    }
                }
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Exception occured when cleaning buffer: " + e.Message + Logger.Display(e));
#endif
            }
        }

internal void Close ( ) [inline, private]

Definition at line 249 of file SourceBufferManager.cs.

        {
            AbortDownload();
            isEndOfStream = true;
            sb = null;
        }

internal void Initialize ( MseStreamSource mse ) [inline, private]

Definition at line 72 of file SourceBufferManager.cs.

        {
            this.mse = mse;
            sb = this.mse.AddSourceBuffer(mimeType);
        }

internal void SendInitSegment ( TimeSpan now ) [inline, private]

Definition at line 88 of file SourceBufferManager.cs.

        {
            if (isInitialized || Appending)
            {
                return;
            }

            if (stream.InitSegmentData == null)
            {
                if (!stream.isInitSegmentDownloading)
                {
                    stream.isInitSegmentDownloading = true;
#if DEBUG
                    Logger.Log("Requesting init url " + stream.InitSegmentUrl);
#endif
                    ((Task<IBuffer>)Downloader.DownloadBufferAsync(new Uri(stream.InitSegmentUrl))).ContinueWith(
                        task =>
                        {
                            stream.InitSegmentData = task.Result;
                            stream.isInitSegmentDownloading = false;
                            if (task.Result != null)
                            {
#if DEBUG
                                Logger.Log("Init URL downloaded");
#endif
                                UpdateData(now);
                            }
                        });
                }
                return;
            }
            isEndOfStream = false;
#if DEBUG
            Logger.Log("Appending init segment");
#endif
            try
            {
                sb.AppendBuffer(stream.InitSegmentData);
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Append init segment exception HRESULT 0x" + e.HResult.ToString("x"));
#endif
            }

            isInitialized = true;
        }

virtual void SendMediaSegment ( TimeSpan now ) [inline, protected, virtual]

Reimplemented in LiveSourceBufferManager.

Definition at line 164 of file SourceBufferManager.cs.

        {
            var end = now;
            if (!isInitialized || Appending || isEndOfStream)
            {
                return;
            }

            if (segmentCursor >= this.stream.Segments.Count)
            {
                isEndOfStream = true;
                return;
            }

            foreach (var range in sb.Buffered)
            {
                if (range.Start <= end + MaxGap && range.End > end)
                {
                    end = range.End;
                }
                else if (range.Start > end)
                {
                    break;
                }
            }

            var stream = this.stream;
            var segment = stream.Segments.ElementAt(segmentCursor);
            ulong endAdjustedToTimescale = (ulong)end.TotalMilliseconds * stream.SegmentInformation.Timescale / 1000;
            if (segment.Timestamp + segment.Duration <= endAdjustedToTimescale)
            {
                segmentCursor++;
                SendMediaSegment(now);
            }
            if (now + MaxBuffering <= end)
            {
                return;
            }

            internalAppending = true;
            string url = stream.Segments.ElementAt(segmentCursor).SegmentUrl;
#if DEBUG
            Logger.Log("Loading segment url " + url);
#endif

            var activeDownload = Downloader.DownloadBufferAsync(new Uri(url));
            if (activeDownload == null)
            {
                sb.Abort();
                isEndOfStream = true;
                return;
            }
            this.activeDownload = activeDownload;
            activeDownload.ContinueWith(
                 task =>
                 {
                     internalAppending = false;
                     if (task.Result != null)
                     {
                         isEndOfStream = false;
                         try
                         {
                             sb.AppendBuffer(task.Result);
                         }
                         catch (Exception e)
                         {
#if DEBUG
                             Logger.Log("Append segment exception HRESULT 0x" + e.HResult.ToString("x"));
#endif
                         }
                         segmentCursor++;
                     }
                     else
                     {
                         if (task.Status != TaskStatus.Canceled)
                         {
                             // Failed - should send EndOfStream
                             sb.Abort();
                             isEndOfStream = true;
                         }
                     }
                     this.activeDownload = null;
                 });
        }

virtual internal void UpdateData ( TimeSpan now ) [inline, private, virtual]

Reimplemented in LiveSourceBufferManager.

Definition at line 78 of file SourceBufferManager.cs.

        {
            if (sb != null)
            {
                SendInitSegment(now);
                CleanBuffer(now);
                SendMediaSegment(now);
            }
        }

Member Data Documentation

Task<IBuffer> activeDownload = null [protected]

Definition at line 24 of file SourceBufferManager.cs.

bool internalAppending = false [protected]

Definition at line 27 of file SourceBufferManager.cs.

bool isEndOfStream = false [protected]

Definition at line 25 of file SourceBufferManager.cs.

bool isFirstSegment [protected]

Definition at line 29 of file SourceBufferManager.cs.

bool isInitialized = false [protected]

Definition at line 26 of file SourceBufferManager.cs.

TimeSpan MaxBuffering = TimeSpan.FromSeconds(5.0) [protected]

Definition at line 32 of file SourceBufferManager.cs.

TimeSpan MaxGap = TimeSpan.FromSeconds(0.1) [protected]

Definition at line 31 of file SourceBufferManager.cs.

string mimeType [protected]

Definition at line 20 of file SourceBufferManager.cs.

MseStreamSource mse [protected]

Definition at line 22 of file SourceBufferManager.cs.

MseSourceBuffer sb [protected]

Definition at line 23 of file SourceBufferManager.cs.

int segmentCursor = 0 [protected]

Definition at line 28 of file SourceBufferManager.cs.

MediaStream stream [protected]

Definition at line 21 of file SourceBufferManager.cs.

Property Documentation

bool Appending [get]

Definition at line 50 of file SourceBufferManager.cs.

bool IsAudio [get]

Definition at line 61 of file SourceBufferManager.cs.

bool IsEndOfStream [get, set]

Definition at line 43 of file SourceBufferManager.cs.

bool IsVideo [get]

Definition at line 56 of file SourceBufferManager.cs.

MseSourceBuffer MseSourceBuffer [get]

Definition at line 66 of file SourceBufferManager.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/SourceBufferManager.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DashManifestParser Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Util
  • DashManifestParser
Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

DashManifestParser Class Reference

List of all members.

Public Member Functions

DashManifestParser (Windows.Data.Xml.Dom.XmlDocument document, ref Manifest manifest)
bool | Parse ()

Public Attributes

const string | LiveProfile = "urn:mpeg:dash:profile:isoff-live:2011"
const int | LiveSegmentCount = int.MaxValue / 2

Private Member Functions

void | CalculateNumberIdentifierForLive (ulong hnsFragmentDuration, ref ulong segmentNumber)
void | DeterminePeriodStart (ulong presentationTimeOffset, IXmlNode periodNode, ref Period period)
IXmlNode | GetLowestBitrateRepresentation (IEnumerable< IXmlNode > representations)
DateTimeOffset | GetWallClockTime ()
void | MakeNumberBaseSegmentInfo (uint bitrate, UInt64 timescale, UInt64 segmentDuration, string repID, uint startNumber, string mediaFormat, ref MediaStream stream)
void | MakeTimelineInfo (IXmlNode segmentTimeline, uint bitrate, ulong timescale, string repID, uint startNumber, ulong presentationTimeOffset, string mediaFormat, ref MediaStream stream)
void | ParseMPDElement ()
void | ParsePeriodElement (IXmlNode periodElement, ref Period period)
void | ParseRepresentationElement (IXmlNode representaion, out uint bitrate, out string repID)
void | ParseSegmentTemplateElement (IXmlNode segmentTemplate, ref UInt64 timescale, ref string initializationFormat, ref string mediaFormat, ref UInt64 duration, ref uint startNumber, ref UInt64 presentationTimeOffset)
void | UpdateBaseUrl ()

Static Private Member Functions

static internal void | ExpandDASHUrlSegmentTemplate (string format, string baseUrl, uint bitrate, string repID, ulong number, ulong time, out string result)
static string | ResolvePadding (string template, string idMatch, ulong value)

Private Attributes

Windows.Data.Xml.Dom.XmlDocument | document
bool | hasPeriodStartAttribute
const string | HttpPrefix = "http://"
const string | HttpsPrefix = "https://"
Manifest manifest
TimeSpan | periodStart

Detailed Description

Definition at line 13 of file DashManifestParser.cs.

Constructor & Destructor Documentation

DashManifestParser | ( | Windows.Data.Xml.Dom.XmlDocument | document,
 |  | ref Manifest | manifest |
 | ) |  |  | [inline]

Definition at line 24 of file DashManifestParser.cs.

        {
            this.document = document;
            this.manifest = manifest;
        }

Member Function Documentation

void CalculateNumberIdentifierForLive | ( | ulong | hnsFragmentDuration,
 |  | ref ulong | segmentNumber |
 | ) |  |  | [inline, private]

Definition at line 460 of file DashManifestParser.cs.

        {
            //This formula is to get the latest segment number.
            DateTimeOffset availStartTime = manifest.AvailibilityStartTime;
            DateTimeOffset now = GetWallClockTime();

            if (manifest.HasPresentationDuration)
            {
                var endOfPresentation = availStartTime.DateTime.AddSeconds(manifest.MediaPresentationDuration.TotalSeconds);

                if (endOfPresentation < now.DateTime)
                {
                    manifest.TreatAsOnDemand = true;
#if DEBUG
                    Logger.Log("The time now is after the end of the presentation. Attempt to start from the beginning " + segmentNumber);
#endif
                    return;
                }
            }

            TimeSpan timeSpanElapsed = now.DateTime - availStartTime.DateTime;
            var hnsTimeElapsed = (ulong)(timeSpanElapsed.TotalMilliseconds * 10000);
            hnsTimeElapsed -= (ulong)(hnsFragmentDuration * 1.5);
            var num = hnsTimeElapsed / hnsFragmentDuration;
#if DEBUG
            Logger.Log("Number for Live Manifest " + num);
#endif
            segmentNumber += num;
        }

void DeterminePeriodStart | ( | ulong | presentationTimeOffset,
 |  | IXmlNode | periodNode,
 |  | ref Period | period |
 | ) |  |  | [inline, private]

Definition at line 185 of file DashManifestParser.cs.

        {
            if (hasPeriodStartAttribute)
            {
                return;
            }
        }

static internal void ExpandDASHUrlSegmentTemplate | ( | string | format,
 |  | string | baseUrl,
 |  | uint | bitrate,
 |  | string | repID,
 |  | ulong | number,
 |  | ulong | time,
 |  | out string | result |
 | ) |  |  | [inline, static, private]

Definition at line 344 of file DashManifestParser.cs.

        {
            result = string.Empty;
            //Use the base url if the template url is not based already
            if (format.StartsWith(HttpPrefix) || format.StartsWith(HttpsPrefix))
            {
                result += format;

            }
            else
            {
                result += baseUrl;

                //Ensure there's one slash (and only one)
                //seperating the base from the template url
                if (!result.EndsWith("/") && !result.EndsWith("&")
                    && !result.EndsWith(";"))
                {
                    result += '/';
                }

                result += format;

            }

            result = result.Replace("$Bandwidth$", bitrate.ToString());
            result = result.Replace("$Number$", number.ToString());
            result = result.Replace("$Time$", time.ToString());
            result = result.Replace("$RepresentationID$", repID.ToString());
        }

IXmlNode GetLowestBitrateRepresentation ( IEnumerable< IXmlNode > representations ) [inline, private]

Definition at line 193 of file DashManifestParser.cs.

        {
            uint minBitrate = uint.MaxValue;
            IXmlNode minBitrateRepresentation = null;
            foreach (var representation in representations)
            {
                var bandwidthNode = representation.Attributes.GetNamedItem("bandwidth");
                if (bandwidthNode != null)
                {
                    uint bitrate = uint.Parse(bandwidthNode.InnerText);
                    if (bitrate < minBitrate)
                    {
                        minBitrateRepresentation = representation;
                        minBitrate = bitrate;
                    }
                }
            }
            return minBitrateRepresentation;
        }

DateTimeOffset GetWallClockTime ( ) [inline, private]

Definition at line 491 of file DashManifestParser.cs.

        {
            //CHANGE HOW TO RETRIEVE THE WALL CLOCK IN THIS LOCATION
            //If an element is present to retrieve from a server, use
            //the time from the server.
            return DateTimeOffset.UtcNow;
        }

void MakeNumberBaseSegmentInfo | ( | uint | bitrate,
 |  | UInt64 | timescale,
 |  | UInt64 | segmentDuration,
 |  | string | repID,
 |  | uint | startNumber,
 |  | string | mediaFormat,
 |  | ref MediaStream | stream |
 | ) |  |  | [inline, private]

Definition at line 388 of file DashManifestParser.cs.

        {
            var hnsPresentationDuration = (Convert.ToUInt64(manifest.MediaPresentationDuration.TotalMilliseconds) * Convert.ToUInt64(10000));
            var hnsFragmentDuration = ((segmentDuration * 10000000) / timescale);
            UInt64 count = (uint)(hnsPresentationDuration / hnsFragmentDuration);
            UInt64 remain = (uint)(hnsPresentationDuration - (hnsFragmentDuration * count));

            if (manifest.IsLive && count == 0)
            {
                if (manifest.TimeShiftBufferDepth.TotalSeconds > 0 && hnsFragmentDuration > 0)
                {
                    var hnsTimeShiftBufferDepth = (ulong)(manifest.TimeShiftBufferDepth.TotalSeconds * 10000000);
                    count = hnsTimeShiftBufferDepth / hnsFragmentDuration;
                }
                else
                {
                    count = LiveSegmentCount;
                }
            }

            UInt64 time = 0;

            UInt64 segmentNumber = startNumber;
            if (manifest.IsLive)
            {
                CalculateNumberIdentifierForLive(hnsFragmentDuration, ref segmentNumber);
            }
            //Since we calculated the latest segment number, we will add to the front of the list
            for (UInt64 i = 0; i < count; i++)
            {
                MediaSegment segment = new MediaSegment();
                segment.Timestamp = time;
                segment.Duration = segmentDuration;
                segment.Number = segmentNumber;

                //Construct the mediaURL
                string mediaSegmentUrl;
                ExpandDASHUrlSegmentTemplate(mediaFormat, manifest.BaseUrl, bitrate,
                    repID, segmentNumber, time, out mediaSegmentUrl);
                segment.SegmentUrl = mediaSegmentUrl;

                stream.PushBackSegment(segment);
                segmentNumber++;
                time += segmentDuration;

            }

            if (remain > 0)
            {
                MediaSegment segment = new MediaSegment();
                segment.Timestamp = time;
                segment.Duration = remain / timescale;
                segment.Number = segmentNumber;

                string mediaSegmentUrl;
                ExpandDASHUrlSegmentTemplate(mediaFormat, manifest.BaseUrl, bitrate,
                    repID, segmentNumber, time, out mediaSegmentUrl);
                segment.SegmentUrl = mediaSegmentUrl;

                stream.PushBackSegment(segment);

#if DEBUG
                Logger.Log("Adding final segment to stream with MimeType:" + stream.MimeType + ". Segment{ Timestamp: " + time + "Duration: "
                        + segmentDuration + "Number: " + startNumber + "}"
                        + "\nURL: " + segment.SegmentUrl);
#endif
                time += segmentDuration;
            }
        }

void MakeTimelineInfo | ( | IXmlNode | segmentTimeline,
 |  | uint | bitrate,
 |  | ulong | timescale,
 |  | string | repID,
 |  | uint | startNumber,
 |  | ulong | presentationTimeOffset,
 |  | string | mediaFormat,
 |  | ref MediaStream | stream |
 | ) |  |  | [inline, private]

Definition at line 499 of file DashManifestParser.cs.

        {
            var timeline = segmentTimeline.ChildNodes.Where(x => x.NodeName == "S");

            uint segmentNumber = startNumber;
            ulong time = 0;
            //Set time equal to the @t attribute of first element, otherwise it is 0.
            //This is to replace the value of $Time$ in the media segment url
            var tAttribute = timeline.First().Attributes.GetNamedItem("t");
            if (tAttribute != null)
            {
                time = ulong.Parse(tAttribute.InnerText);
            }
            foreach (var t in timeline)
            {
                ulong duration = ulong.Parse(t.Attributes.GetNamedItem("d").InnerText);
                var repeatAttribute = t.Attributes.GetNamedItem("r");
                long repeats = 0;
                if (repeatAttribute != null)
                {
                    repeats = long.Parse(repeatAttribute.InnerText);
                }

                for (int i = 0; i < repeats + 1; i++)
                {
                    MediaSegment segment = new MediaSegment();
                    segment.Duration = duration;
                    segment.Timestamp = time - presentationTimeOffset;
                    segment.Number = segmentNumber;

                    //Construct the mediaURL
                    string mediaSegmentUrl;
                    ExpandDASHUrlSegmentTemplate(mediaFormat, manifest.BaseUrl, bitrate,
                        repID, segmentNumber, time, out mediaSegmentUrl);
                    segment.SegmentUrl = mediaSegmentUrl;

                    stream.PushBackSegment(segment);
                    time += duration;
                    segmentNumber++;
                }
            }

            double msStreamDuration = (double)time * (1000) / timescale;
#if DEBUG
            Logger.Log("Found " + stream.Segments.Count() + " segments - Duration: " + msStreamDuration.ToString() + " miliseconds");
#endif

            if (msStreamDuration > manifest.MediaPresentationDuration.TotalMilliseconds)
            {
                manifest.MediaPresentationDuration = TimeSpan.FromMilliseconds(msStreamDuration);
            }
        }

bool Parse ( ) [inline]

Definition at line 29 of file DashManifestParser.cs.

        {
            try
            {
#if DEBUG
                Logger.Log("Begin parsing DASH manifest");
#endif
                ParseMPDElement();
                UpdateBaseUrl();

                var periods = document.DocumentElement.ChildNodes.Where(node => node.NodeName.Equals("Period"));
#if DEBUG
                Logger.Log(periods.Count().ToString() + " Periods found");
#endif
                foreach (var period in periods)
                {
                    Period dashPeriod = new Period();
                    periodStart = TimeSpan.FromSeconds(0);
                    ParsePeriodElement(period, ref dashPeriod);

                    var adaptationSets = period.ChildNodes.Where(node => node.NodeName.Equals("AdaptationSet"));
#if DEBUG
                    Logger.Log(adaptationSets.Count().ToString() + " Adaptation Sets found");
#endif
                    foreach (var adaptationSet in adaptationSets)
                    {
                        MediaStream stream = new MediaStream();

                        if (adaptationSet.Attributes.GetNamedItem("mimeType") != null)
                        {
                            stream.MimeType = adaptationSet.Attributes.GetNamedItem("mimeType").InnerText;
                        }
                        if (adaptationSet.Attributes.GetNamedItem("lang") != null)
                        {
                            stream.Language = adaptationSet.Attributes.GetNamedItem("lang").InnerText.Replace(" ", string.Empty);
                        }

                        var representations = adaptationSet.ChildNodes.Where(node => node.NodeName.Equals("Representation"));
                        //We are only grabbing one Representation in an Adaptation Set (the lowest one, just to be safe)
                        //(No support for adaptive streaming)
                        IXmlNode representation = GetLowestBitrateRepresentation(representations);
#if DEBUG
                        Logger.Log(representations.Count().ToString() + " Representations in " + stream.MimeType + " Adaptation Set with bitrate " + uint.Parse(representation.Attributes.GetNamedItem("bandwidth").InnerText));
#endif

                        //Parse Representation Element
                        uint bitrate;
                        string repID = string.Empty;
                        ParseRepresentationElement(representation,
                            out bitrate,
                            out repID);

                        var segmentTemplateQuery = adaptationSet.ChildNodes.Where(node => node.NodeName.Equals("SegmentTemplate"));
                        var segmentListQuery = adaptationSet.ChildNodes.Where(node => node.NodeName.Equals("SegmentList"));
                        var segmentBaseQuery = adaptationSet.ChildNodes.Where(node => node.NodeName.Equals("SegmentBase"));
                        if (segmentTemplateQuery.Count() != 0)
                        {
                            stream.SegmentInfoType = MediaStream.SegmentInformationType.Template;
                            //Parse Segment Template Element
                            UInt64 timescale = 1;
                            string initializationFormat = string.Empty;
                            string mediaFormat = string.Empty;
                            UInt64 segmentDuration = 0;
                            uint startNumber = 1;
                            UInt64 presentationTimeOffset = 0;
                            var segmentTemplate = segmentTemplateQuery.First();

                            ParseSegmentTemplateElement(segmentTemplate,
                                ref timescale, ref initializationFormat,
                                ref mediaFormat, ref segmentDuration,
                                ref startNumber, ref presentationTimeOffset);

                            DeterminePeriodStart(presentationTimeOffset, period, ref dashPeriod);

                            string initializationUrl;
                            //$Number$ and $Time$ will never be present in the initialization URL
                            ExpandDASHUrlSegmentTemplate(initializationFormat, manifest.BaseUrl,
                                bitrate, repID, 0, 0, out initializationUrl);
                            stream.InitSegmentUrl = initializationUrl;

                            var segmentTimelineQuery = segmentTemplate.ChildNodes.Where(node => node.NodeName.Equals("SegmentTimeline"));

                            MediaSegmentInformation segmentInfo = new MediaSegmentInformation();
                            segmentInfo.Timescale = timescale;
                            segmentInfo.RepresentationID = repID;
                            segmentInfo.Bitrate = bitrate;

                            //No timeline present.
                            //Instead of populating the segments in the stream, we will give just enough information to produce
                            //the information to construct media segment urls on the fly in the SourceBufferManager
                            if (segmentTimelineQuery.Count() == 0)
                            {
#if DEBUG
                                Logger.Log("Making number base segment info from SegmentTemplate");
#endif
                                stream.SegmentTemplateBase = MediaStream.SegmentTemplateIdentifier.Number;

                                segmentInfo.Duration = segmentDuration;
                                segmentInfo.UrlTemplate = mediaFormat;

                                UInt64 segmentNumber = startNumber;
                                if (manifest.IsLive)
                                {
                                    var hnsFragmentDuration = ((segmentDuration * 10000000) / timescale);
                                    CalculateNumberIdentifierForLive(hnsFragmentDuration, ref segmentNumber);
                                }
                                segmentInfo.StartNumber = segmentNumber;

                                segmentInfo.StartTimestamp = segmentDuration * (segmentNumber - 1);

                                stream.CanGenerateSegmentsDynamically = true;
                            }
                            else
                            {
                                stream.SegmentTemplateBase = MediaStream.SegmentTemplateIdentifier.Time;

                                MakeTimelineInfo(segmentTimelineQuery.First(), bitrate, timescale,
                                    repID, startNumber, presentationTimeOffset,
                                    mediaFormat, ref stream);
                            }

                            stream.SegmentInformation = segmentInfo;
                        }
                        else if (segmentListQuery.Count() != 0)
                        {
#if DEBUG
                            Logger.Log("Manifest parsing error: " + "Does not support a SegmentList implementation");
#endif
                            stream.SegmentInfoType = MediaStream.SegmentInformationType.List;
                        }
                        else
                        {
#if DEBUG
                            Logger.Log("Manifest parsing error: " + "Does not support a SegmentBase or BaseUrl implementation");
#endif
                            stream.SegmentInfoType = MediaStream.SegmentInformationType.Base;
                        }

                        dashPeriod.AddStream(stream);
                    } // each adaptation set

                    manifest.AddPeriod(dashPeriod);
                }// each period
                manifest.SetFirstSelectedPeriod();
            }
            catch (Exception e)
            {
#if DEBUG
                Logger.Log("Manifest parsing error " + Logger.Display(e));
#endif
                return false;
            }
            return true;
        }

void ParseMPDElement ( ) [inline, private]

Definition at line 213 of file DashManifestParser.cs.

        {
            Windows.Data.Xml.Dom.XmlElement root = document.DocumentElement;
            if (root.GetAttribute("type").ToLower().Equals("dynamic"))
            {
                manifest.IsLive = true;
            }
            if (root.GetAttribute("profiles").ToLower().Contains(LiveProfile))
            {
                manifest.IsSupportedProfile = true;
            }
            if (!root.GetAttribute("availabilityStartTime").Equals(""))
            {
                string availabilityStartTime = root.GetAttribute("availabilityStartTime");
                manifest.AvailibilityStartTime = XmlConvert.ToDateTimeOffset(availabilityStartTime);
            }
            if (!root.GetAttribute("minBufferTime").Equals(""))
            {
                string minBufferTime = root.GetAttribute("minBufferTime");
                manifest.MinBufferTime = XmlConvert.ToTimeSpan(minBufferTime);
            }
            if (!root.GetAttribute("minimumUpdatePeriod").Equals(""))
            {
                manifest.HasMinimumUpdatePeriod = true;
                string minUpdatePeriod = root.GetAttribute("minimumUpdatePeriod");
                manifest.MinimumUpdatePeriod = XmlConvert.ToTimeSpan(minUpdatePeriod);
            }
            if (!root.GetAttribute("mediaPresentationDuration").Equals(""))
            {
                manifest.HasPresentationDuration = true;
                string mediaPresentationDuration = root.GetAttribute("mediaPresentationDuration");
                manifest.MediaPresentationDuration = XmlConvert.ToTimeSpan(mediaPresentationDuration);
            }
            if (!root.GetAttribute("timeShiftBufferDepth").Equals(""))
            {
                string timeShiftBufferDepth = root.GetAttribute("timeShiftBufferDepth");
                manifest.TimeShiftBufferDepth = XmlConvert.ToTimeSpan(timeShiftBufferDepth);
            }
            if (!root.GetAttribute("publishTime").Equals(""))
            {
                string publishTime = root.GetAttribute("publishTime");
                manifest.PublishTime = XmlConvert.ToDateTimeOffset(publishTime);
            }
            else
            {
                manifest.PublishTime = DateTimeOffset.MinValue;
            }
            Windows.Data.Xml.Dom.XmlNodeList periods = root.GetElementsByTagName("Period");
            if (periods.Count() > 1)
            {
                manifest.HasMultiplePeriods = true;
            }

            IXmlNode lastPeriod = periods.Last<IXmlNode>();
            if (lastPeriod.Attributes.GetNamedItem("duration") != null)
            {
                manifest.LastPeriodDuration = XmlConvert.ToTimeSpan(lastPeriod.Attributes.GetNamedItem("duration").InnerText);
            }
        }

void ParsePeriodElement | ( | IXmlNode | periodElement,
 |  | ref Period | period |
 | ) |  |  | [inline, private]

Definition at line 273 of file DashManifestParser.cs.

        {
            if (periodElement.Attributes.GetNamedItem("id") != null)
            {
                period.Id = periodElement.Attributes.GetNamedItem("id").InnerText;
            }
            if (periodElement.Attributes.GetNamedItem("duration") != null)
            {
                string periodDuration = periodElement.Attributes.GetNamedItem("duration").InnerText;
                period.Duration = XmlConvert.ToTimeSpan(periodDuration);
            }
            if (periodElement.Attributes.GetNamedItem("start") != null)
            {
                string periodStart = periodElement.Attributes.GetNamedItem("start").InnerText;
                period.Start = XmlConvert.ToTimeSpan(periodStart);
                this.periodStart = period.Start;
                hasPeriodStartAttribute = true;
            }
        }

void ParseRepresentationElement | ( | IXmlNode | representaion,
 |  | out uint | bitrate,
 |  | out string | repID |
 | ) |  |  | [inline, private]

Definition at line 293 of file DashManifestParser.cs.

        {
            repID = string.Empty;
            if (representaion.Attributes.GetNamedItem("id") != null)
            {
                repID = representaion.Attributes.GetNamedItem("id").InnerText;
            }

            bitrate = 0;
            if (representaion.Attributes.GetNamedItem("bandwidth") != null)
            {
                string bandwidthText = representaion.Attributes.GetNamedItem("bandwidth").InnerText;
                bitrate = XmlConvert.ToUInt32(bandwidthText);
            }
        }

void ParseSegmentTemplateElement | ( | IXmlNode | segmentTemplate,
 |  | ref UInt64 | timescale,
 |  | ref string | initializationFormat,
 |  | ref string | mediaFormat,
 |  | ref UInt64 | duration,
 |  | ref uint | startNumber,
 |  | ref UInt64 | presentationTimeOffset |
 | ) |  |  | [inline, private]

Definition at line 309 of file DashManifestParser.cs.

        {
            if (segmentTemplate.Attributes.GetNamedItem("duration") != null)
            {
                string durationText = segmentTemplate.Attributes.GetNamedItem("duration").InnerText;
                duration = XmlConvert.ToUInt64(durationText);
            }
            if (segmentTemplate.Attributes.GetNamedItem("initialization") != null)
            {
                initializationFormat = segmentTemplate.Attributes.GetNamedItem("initialization").InnerText;
            }
            if (segmentTemplate.Attributes.GetNamedItem("media") != null)
            {
                mediaFormat = segmentTemplate.Attributes.GetNamedItem("media").InnerText;
            }
            if (segmentTemplate.Attributes.GetNamedItem("startNumber") != null)
            {
                string startNumberText = segmentTemplate.Attributes.GetNamedItem("startNumber").InnerText;
                startNumber = XmlConvert.ToUInt32(startNumberText);
            }
            if (segmentTemplate.Attributes.GetNamedItem("timescale") != null)
            {
                string timescaleText = segmentTemplate.Attributes.GetNamedItem("timescale").InnerText;
                timescale = XmlConvert.ToUInt64(timescaleText);
            }
            if (segmentTemplate.Attributes.GetNamedItem("presentationTimeOffset") != null)
            {
                string presentationTimeOffsetText = segmentTemplate.Attributes.GetNamedItem("presentationTimeOffset").InnerText;
                presentationTimeOffset = XmlConvert.ToUInt64(presentationTimeOffsetText);
            }
        }

static string ResolvePadding | ( | string | template,
 |  | string | idMatch,
 |  | ulong | value |
 | ) |  |  | [inline, static, private]

Definition at line 375 of file DashManifestParser.cs.

        {
            Regex paddingRegex = new Regex("(%\\d+d)+");

            var paddingMatch = paddingRegex.Match(idMatch);

            string temp = String.Format(paddingMatch.Value, value);

            temp = template.Replace(idMatch, temp);

            return temp;
        }

void UpdateBaseUrl ( ) [inline, private]

Definition at line 555 of file DashManifestParser.cs.

        {
            //This does not support all scenarios for the BaseUrl element.
            //It will find the first BaseUrl
            //Element in either the MPD element or the Period Element, top down
            //and append it to the base url of the manifest.
            var mpdBaseUrlElement = document.SelectNodes("*").Where(x => x.NodeName == "BaseURL");
            if (mpdBaseUrlElement.Count() != 0)
            {
                string baseUrlText = mpdBaseUrlElement.First().InnerText;
                if (baseUrlText.ToLower().StartsWith("http") || baseUrlText.ToLower().StartsWith("https"))
                {
                    manifest.BaseUrl = baseUrlText;
                }
                else
                {
                    manifest.AppendToBaseUrl(mpdBaseUrlElement.First().InnerText);
                }
                return;
            }
            var periodBaseUrlElement = document.SelectNodes("*").Where(x => x.NodeName == "BaseURL");
            if (periodBaseUrlElement.Count() != 0)
            {
                string baseUrlText = periodBaseUrlElement.First().InnerText;
                if (baseUrlText.ToLower().StartsWith("http") || baseUrlText.ToLower().StartsWith("https"))
                {
                    manifest.BaseUrl = baseUrlText;
                }
                else
                {
                    manifest.AppendToBaseUrl(periodBaseUrlElement.First().InnerText);
                }
                return;
            }

        }

Member Data Documentation

Windows.Data.Xml.Dom.XmlDocument document [private]

Definition at line 19 of file DashManifestParser.cs.

bool hasPeriodStartAttribute [private]

Definition at line 22 of file DashManifestParser.cs.

const string HttpPrefix = "http://" [private]

Definition at line 16 of file DashManifestParser.cs.

const string HttpsPrefix = "https://" [private]

Definition at line 17 of file DashManifestParser.cs.

const string LiveProfile = "urn:mpeg:dash:profile:isoff-live:2011"

Definition at line 15 of file DashManifestParser.cs.

const int LiveSegmentCount = int.MaxValue / 2

Definition at line 18 of file DashManifestParser.cs.

Manifest manifest [private]

Definition at line 20 of file DashManifestParser.cs.

TimeSpan periodStart [private]

Definition at line 23 of file DashManifestParser.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Util/DashManifestParser.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Downloader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDash
  • Util
  • Downloader
Static Public Member Functions | Static Public Attributes | Private Attributes

Downloader Class Reference

List of all members.

Static Public Member Functions

static async
System.Threading.Tasks.Task
< IBuffer > 		DownloadBufferAsync (Uri url)
static async Task
< HttpResponseMessage > 		SendHeadRequestAsync (Uri url)

Static Public Attributes

static int | RETRIES = 3

Private Attributes

const int | fileNotFound404Hresult = -2145844844

Detailed Description

Definition at line 10 of file Utils.cs.

Member Function Documentation

static async System.Threading.Tasks.Task<IBuffer> DownloadBufferAsync ( Uri url ) [inline, static]

Definition at line 14 of file Utils.cs.

        {
            //Turn off cache for live playback
            var filter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
            filter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
            using (var httpClient = new HttpClient(filter))
            {
                HttpGetBufferResult result = await httpClient.TryGetBufferAsync(url);
                if (result.Succeeded)
                {
#if DEBUG
                    Logger.Log("GetBufferAsync suceeded for url: " + url);
#endif
                    return result.Value;
                }
                else
                {
#if DEBUG
                    Logger.Log("GetBufferAsync exception for url: " + url + " HRESULT 0x" + result.ExtendedError.HResult.ToString("x"));
#endif
                    return null;
                }
            }
        }

static async Task<HttpResponseMessage> SendHeadRequestAsync ( Uri url ) [inline, static]

Definition at line 39 of file Utils.cs.

        {
            var filter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
            filter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
            using (var httpClient = new HttpClient(filter))
            {
                HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Head, url);

                HttpRequestResult result = await httpClient.TrySendRequestAsync(request);
                if (result.Succeeded)
                {
#if DEBUG
                    Logger.Log("Sending head request with: " + url);
#endif
                    return result.ResponseMessage;
                }
                else
                {
#if DEBUG
                    Logger.Log("SendHeadRequestAsync exception for url: " + url + " HRESULT 0x" + result.ExtendedError.HResult.ToString("x"));
#endif
                    return null;
                }
            }
        }

Member Data Documentation

const int fileNotFound404Hresult = -2145844844 [private]

Definition at line 12 of file Utils.cs.

int RETRIES = 3 [static]

Definition at line 13 of file Utils.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDash/Util/Utils.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DASHEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDashApp
  • DASHEntry
Public Member Functions | Properties | Private Attributes

DASHEntry Class Reference

List of all members.

Public Member Functions

DASHEntry (string title, string url)

Properties

string | Title [get]
string | Url [get]

Private Attributes

string | entryTitle
string | sourceUrl

Detailed Description

Definition at line 25 of file LiveDashPlayer.xaml.cs.

Constructor & Destructor Documentation

DASHEntry | ( | string | title,
 |  | string | url |
 | ) |  |  | [inline]

Definition at line 30 of file LiveDashPlayer.xaml.cs.

        {
            entryTitle = title;
            sourceUrl = url;
        }

Member Data Documentation

string entryTitle [private]

Definition at line 27 of file LiveDashPlayer.xaml.cs.

string sourceUrl [private]

Definition at line 28 of file LiveDashPlayer.xaml.cs.

Property Documentation

string Title [get]

Definition at line 37 of file LiveDashPlayer.xaml.cs.

string Url [get]

Definition at line 42 of file LiveDashPlayer.xaml.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDashApp/Views/LiveDashPlayer.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDashPlayer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • LiveDashApp
  • LiveDashPlayer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

LiveDashPlayer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

LiveDashPlayer ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ComboBox_SelectionChanged (object sender, RoutedEventArgs e)
void | gotToLiveButton_Click (object sender, RoutedEventArgs e)
async void | playButton_Click (object sender, RoutedEventArgs e)
void | PopulateComboBox ()
void | setLiveOffsetButton_Click (object sender, RoutedEventArgs e)

Private Attributes

bool | haveSetLiveOffset
bool | haveSetSource
TimeSpan | liveOffset
LiveDash.LiveDashPlayer player
MainPage rootPage

Detailed Description

Definition at line 49 of file LiveDashPlayer.xaml.cs.

Constructor & Destructor Documentation

LiveDashPlayer ( ) [inline]

Definition at line 58 of file LiveDashPlayer.xaml.cs.

        {
            this.InitializeComponent();
            scrollView.HorizontalScrollMode = ScrollMode.Enabled;
            scrollView.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;

            PopulateComboBox();
        }

Member Function Documentation

void ComboBox_SelectionChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 182 of file LiveDashPlayer.xaml.cs.

        {
            var selected = ((ComboBox)sender).SelectedItem;
            sourceUrl.Text = ((DASHEntry)selected).Url;
        }

void gotToLiveButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 153 of file LiveDashPlayer.xaml.cs.

        {
            if (haveSetSource)
            {
                if (haveSetLiveOffset)
                {
                    player.DesiredLiveOffset(liveOffset);
                }
                player.GoToLive();
                rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("You must set the source first before going to live", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 73 of file LiveDashPlayer.xaml.cs.

        {
            if (player != null)
            {
                player.Close();
                player = null;
            }
            haveSetSource = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 68 of file LiveDashPlayer.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void playButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file LiveDashPlayer.xaml.cs.

        {
            // Get URI
            if (player != null)
            {
                player.Close();
                player = null;
            }
            Uri uri;
            try
            {
                uri = new Uri(sourceUrl.Text);
            }
            catch
            {
                rootPage.NotifyUser("Invalid URL given", NotifyType.ErrorMessage);
                return;
            }

            haveSetSource = true;
            player = new LiveDash.LiveDashPlayer();

            if (haveSetLiveOffset)
            {
                player.DesiredLiveOffset(liveOffset);
            }

            await player.Initialize(uri, mediaElement);

            // Clear the status block when you press play
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);

        }

void PopulateComboBox ( ) [inline, private]

Definition at line 169 of file LiveDashPlayer.xaml.cs.

        {
            IList<DASHEntry> dashEntryList = new List<DASHEntry>();
            dashEntryList.Add(new DASHEntry("DASH-IF Live Stream 1 - Counter", "http://54.201.151.65/livesim/testpic_2s/Manifest.mpd"));
            dashEntryList.Add(new DASHEntry("DASH-IF Live Stream 2 - Counter", "http://eu1.eastmark.net/pdash/testpic_6s/Manifest.mpd"));

            //Add urls to list here

            comboBox1.DataContext = dashEntryList;

        }

void setLiveOffsetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file LiveDashPlayer.xaml.cs.

        {
            try
            {
                double liveOffsetDouble = double.Parse(liveOffsetValue.Text);
                TimeSpan offset = TimeSpan.FromSeconds(liveOffsetDouble);
                liveOffset = offset;

                if (liveOffsetDouble < 0)
                {
                    rootPage.NotifyUser("Live offset cannot be negative", NotifyType.ErrorMessage);
                    return;
                }

                if (liveOffsetDouble < 30)
                {
                    rootPage.NotifyUser("Cannot set a live offset less than 30 seconds", NotifyType.ErrorMessage);
                    return;
                }

                if (liveOffsetDouble % 1 != 0)
                {
                    rootPage.NotifyUser("Input must be a whole number (no decimals)", NotifyType.ErrorMessage);
                    return;
                }

                haveSetLiveOffset = true;
                rootPage.NotifyUser("Live offset has been set to " + offset.TotalSeconds + " seconds", NotifyType.StatusMessage);
            }
            catch (Exception)
            {
                rootPage.NotifyUser("Invalid live offset given", NotifyType.ErrorMessage);
            }

        }

Member Data Documentation

bool haveSetLiveOffset [private]

Definition at line 54 of file LiveDashPlayer.xaml.cs.

bool haveSetSource [private]

Definition at line 53 of file LiveDashPlayer.xaml.cs.

TimeSpan liveOffset [private]

Definition at line 55 of file LiveDashPlayer.xaml.cs.

LiveDash.LiveDashPlayer player [private]

Definition at line 52 of file LiveDashPlayer.xaml.cs.

MainPage rootPage [private]

Definition at line 51 of file LiveDashPlayer.xaml.cs.

The documentation for this class was generated from the following file:
  • LiveDash/cs/LiveDashApp/Views/LiveDashPlayer.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LuminanceHeatmapEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

LuminanceHeatmapEffect Class Reference

#include "LuminanceHeatmapEffect.h"

List of all members.

Public Member Functions

IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pRenderInfo)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pGraph)

Static Public Member Functions

static HRESULT __stdcall | CreateLuminanceHeatmapImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

LuminanceHeatmapEffect ()
HRESULT | UpdateConstants ()

Private Attributes

struct {
float dpi
} m_constants
float | m_dpi
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
Microsoft::WRL::ComPtr
< ID2D1EffectContext > 		m_effectContext
D2D1_RECT_L | m_inputRect
LONG | m_refCount

Detailed Description

Definition at line 20 of file LuminanceHeatmapEffect.h.

Constructor & Destructor Documentation

LuminanceHeatmapEffect ( ) [private]

Definition at line 19 of file LuminanceHeatmapEffect.cpp.

                                               :
    m_refCount(1),
    m_constants{}

Member Function Documentation

static HRESULT __stdcall CreateLuminanceHeatmapImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]
IFACEMETHODIMP_ ( UINT32 ) const
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pContextInternal,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |
IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |
IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const
IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const
IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )
IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |
static HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]
IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pRenderInfo )
IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pGraph )
HRESULT UpdateConstants ( ) [private]

Member Data Documentation

float dpi

Definition at line 79 of file LuminanceHeatmapEffect.h.

struct { ... } m_constants [private]
float m_dpi [private]

Definition at line 86 of file LuminanceHeatmapEffect.h.

Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 82 of file LuminanceHeatmapEffect.h.

Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext [private]

Definition at line 83 of file LuminanceHeatmapEffect.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 85 of file LuminanceHeatmapEffect.h.

LONG m_refCount [private]

Definition at line 84 of file LuminanceHeatmapEffect.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BankCards Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MagneticStripeReaderSample
  • Scenario1_BankCards
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_BankCards Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_BankCards ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< bool > | ClaimReader ()
async Task< bool > | CreateDefaultMagneticStripeReaderObject ()
async void | OnBankCardDataReceived (object sender, MagneticStripeReaderBankCardDataReceivedEventArgs args)
void | OnReleaseDeviceRequested (object sender, ClaimedMagneticStripeReader args)
void | ResetTheScenarioState ()
void | ScenarioEndReadButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartReadButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedMagneticStripeReader | _claimedReader = null
MagneticStripeReader | _reader = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario1_BankCards.xaml.cs.

Constructor & Destructor Documentation

Scenario1_BankCards ( ) [inline]

Definition at line 37 of file Scenario1_BankCards.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<bool> ClaimReader ( ) [inline, private]

Claim the magnetic stripe reader.

Returns:
true if claim is successful. Otherwise returns false

Definition at line 65 of file Scenario1_BankCards.xaml.cs.

        {
            if (_claimedReader == null)
            {
                // claim the magnetic stripe reader
                _claimedReader = await _reader.ClaimReaderAsync();

                if (_claimedReader == null)
                {
                    rootPage.NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType.ErrorMessage);
                    return false;
                }
            }
            return true;
        }

async Task<bool> CreateDefaultMagneticStripeReaderObject ( ) [inline, private]

Creates the default magnetic stripe reader.

Returns:
true if magnetic stripe reader is created. Otherwise returns false

Definition at line 46 of file Scenario1_BankCards.xaml.cs.

        {
            if (_reader == null)
            {
                _reader = await DeviceHelpers.GetFirstMagneticStripeReaderAsync();

                if (_reader == null)
                {
                    rootPage.NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType.ErrorMessage);
                    return false;
                }
            }
            return true;
        }

async void OnBankCardDataReceived | ( | object | sender,
 |  | MagneticStripeReaderBankCardDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for the DataReceived event fired when a bank card is read by the magnetic stripe reader.

Parameters:
sender
args Contains the MagneticStripeReaderBankCardDataReceivedEventArgs which contains the data obtained in the scan

Definition at line 143 of file Scenario1_BankCards.xaml.cs.

        {
            // read the data and display
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Got data.", NotifyType.StatusMessage);

                ScenarioOutputAccountNumber.Text = args.AccountNumber;
                ScenarioOutputExpirationDate.Text = args.ExpirationDate;
                ScenarioOutputFirstName.Text = args.FirstName;
                ScenarioOutputMiddleInitial.Text = args.MiddleInitial;
                ScenarioOutputServiceCode.Text = args.ServiceCode;
                ScenarioOutputSuffix.Text = args.Suffix;
                ScenarioOutputSurname.Text = args.Surname;
                ScenarioOutputTitle.Text = args.Title;
            });

        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is no longer displayed.

Parameters:
e

Definition at line 177 of file Scenario1_BankCards.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 167 of file Scenario1_BankCards.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedTo(e);
        }

void OnReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedMagneticStripeReader | args |
 | ) |  |  | [inline, private]

Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application.

Parameters:
sender
args Contains the ClaimedMagneticStripeReader that is sending this request

Definition at line 132 of file Scenario1_BankCards.xaml.cs.

        {
            // let us retain the device always. If it is not retained, this exclusive claim will be lost.
            args.RetainDevice();
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 186 of file Scenario1_BankCards.xaml.cs.

        {
            if (_claimedReader != null)
            {
                // Detach the datareceived event handler and releasedevicerequested event handler
                _claimedReader.BankCardDataReceived -= OnBankCardDataReceived;
                _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;

                // release the Claimed Magnetic Stripe Reader and set to null
                _claimedReader.Dispose();
                _claimedReader = null;
            }

            if (_reader != null)
            {
                // release the Magnetic Stripe Reader and set to null
                _reader.Dispose();
                _reader = null;
            }

            // Reset the strings in the UI
            rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);

            ScenarioOutputAccountNumber.Text = "No data";
            ScenarioOutputExpirationDate.Text = "No data";
            ScenarioOutputFirstName.Text = "No data";
            ScenarioOutputMiddleInitial.Text = "No data";
            ScenarioOutputServiceCode.Text = "No data";
            ScenarioOutputSuffix.Text = "No data";
            ScenarioOutputSurname.Text = "No data";
            ScenarioOutputTitle.Text = "No data";

            // reset the button state
            ScenarioEndReadButton.IsEnabled = false;
            ScenarioStartReadButton.IsEnabled = true;
        }

void ScenarioEndReadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for End button.

Parameters:
sender
e

Definition at line 122 of file Scenario1_BankCards.xaml.cs.

        {
            ResetTheScenarioState();
        }

async void ScenarioStartReadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario1_BankCards.xaml.cs.

        {
            if (await CreateDefaultMagneticStripeReaderObject())
            {
                if (_reader != null)
                {
                    // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
                    if (await ClaimReader())
                    {
                        if (_claimedReader != null)
                        {
                            // It is always a good idea to have a release device requested event handler. If this event is not handled, there is a chance that another app can
                            // claim ownsership of the magnetic stripe reader.
                            _claimedReader.ReleaseDeviceRequested += OnReleaseDeviceRequested;

                            // after successfully claiming and enabling, attach the BankCardDataReceived event handler.
                            // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be of any use because the API will not fire the event
                            // if the claimedScanner has not beed Enabled
                            _claimedReader.BankCardDataReceived += OnBankCardDataReceived;

                            // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
                            _claimedReader.IsDecodeDataEnabled = true;

                            await _claimedReader.EnableAsync();

                            rootPage.NotifyUser("Ready to swipe. Device ID: " + _claimedReader.DeviceId, NotifyType.StatusMessage);

                            // reset the button state
                            ScenarioEndReadButton.IsEnabled = true;
                            ScenarioStartReadButton.IsEnabled = false;
                        }
                    }
                }
            }
        }

Member Data Documentation

ClaimedMagneticStripeReader _claimedReader = null [private]

Definition at line 35 of file Scenario1_BankCards.xaml.cs.

MagneticStripeReader _reader = null [private]

Definition at line 34 of file Scenario1_BankCards.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario1_BankCards.xaml.cs.

The documentation for this class was generated from the following file:
  • MagneticStripeReader/cs/Scenario1_BankCards.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_AamvaCards Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MagneticStripeReaderSample
  • Scenario2_AamvaCards
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_AamvaCards Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_AamvaCards ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< bool > | ClaimReader ()
async Task< bool > | CreateDefaultMagneticStripeReaderObject ()
async void | OnAamvaCardDataReceived (object sender, MagneticStripeReaderAamvaCardDataReceivedEventArgs args)
void | OnReleaseDeviceRequested (object sender, ClaimedMagneticStripeReader args)
void | ResetTheScenarioState ()
void | ScenarioEndReadButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartReadButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedMagneticStripeReader | _claimedReader = null
MagneticStripeReader | _reader = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario2_AamvaCards.xaml.cs.

Constructor & Destructor Documentation

Scenario2_AamvaCards ( ) [inline]

Definition at line 37 of file Scenario2_AamvaCards.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<bool> ClaimReader ( ) [inline, private]

Claim the magnetic stripe reader.

Returns:
true if claim is successful. Otherwise returns false

Definition at line 65 of file Scenario2_AamvaCards.xaml.cs.

        {
            if (_claimedReader == null)
            {
                // claim the magnetic stripe reader
                _claimedReader = await _reader.ClaimReaderAsync();

                if (_claimedReader == null)
                {
                    rootPage.NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType.ErrorMessage);
                    return false;
                }
            }
            return true;
        }

async Task<bool> CreateDefaultMagneticStripeReaderObject ( ) [inline, private]

Creates the default magnetic stripe reader.

Returns:
true if magnetic stripe reader is created. Otherwise returns false

Definition at line 46 of file Scenario2_AamvaCards.xaml.cs.

        {
            if (_reader == null)
            {
                _reader = await DeviceHelpers.GetFirstMagneticStripeReaderAsync();

                if (_reader == null)
                {
                    rootPage.NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType.ErrorMessage);
                    return false;
                }
            }
            return true;
        }

async void OnAamvaCardDataReceived | ( | object | sender,
 |  | MagneticStripeReaderAamvaCardDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for the DataReceived event fired when a AAMVA card is read by the magnetic stripe reader.

Parameters:
sender
args Contains the MagneticStripeReaderAamvaCardDataReceivedEventArgs which contains the data obtained in the scan

Definition at line 143 of file Scenario2_AamvaCards.xaml.cs.

        {
            // read the data and display
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Got data.", NotifyType.StatusMessage);

                ScenarioOutputAddress.Text = args.Address;
                ScenarioOutputBirthDate.Text = args.BirthDate;
                ScenarioOutputCity.Text = args.City;
                ScenarioOutputClass.Text = args.Class;
                ScenarioOutputEndorsements.Text = args.Endorsements;
                ScenarioOutputExpirationDate.Text = args.ExpirationDate;
                ScenarioOutputEyeColor.Text = args.EyeColor;
                ScenarioOutputFirstName.Text = args.FirstName;
                ScenarioOutputGender.Text = args.Gender;
                ScenarioOutputHairColor.Text = args.HairColor;
                ScenarioOutputHeight.Text = args.Height;
                ScenarioOutputLicenseNumber.Text = args.LicenseNumber;
                ScenarioOutputPostalCode.Text = args.PostalCode;
                ScenarioOutputRestrictions.Text = args.Restrictions;
                ScenarioOutputState.Text = args.State;
                ScenarioOutputSuffix.Text = args.Suffix;
                ScenarioOutputSurname.Text = args.Surname;
                ScenarioOutputWeight.Text = args.Weight;
            });

        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is no longer displayed.

Parameters:
e

Definition at line 187 of file Scenario2_AamvaCards.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 177 of file Scenario2_AamvaCards.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedTo(e);
        }

void OnReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedMagneticStripeReader | args |
 | ) |  |  | [inline, private]

Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application.

Parameters:
sender
args Contains the ClaimedMagneticStripeReader that is sending this request

Definition at line 132 of file Scenario2_AamvaCards.xaml.cs.

        {
            // let us retain the device always. If it is not retained, this exclusive claim will be lost.
            args.RetainDevice();
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 196 of file Scenario2_AamvaCards.xaml.cs.

        {
            if (_claimedReader != null)
            {
                // Detach the datareceived event handler and releasedevicerequested event handler
                _claimedReader.AamvaCardDataReceived -= OnAamvaCardDataReceived;
                _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;

                // release the Claimed Magnetic Stripe Reader and set to null
                _claimedReader.Dispose();
                _claimedReader = null;
            }

            if (_reader != null)
            {
                // release the Magnetic Stripe Reader and set to null
                _reader.Dispose();
                _reader = null;
            }

            // Reset the strings in the UI
            rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);

            ScenarioOutputAddress.Text = "No data";
            ScenarioOutputBirthDate.Text = "No data";
            ScenarioOutputCity.Text = "No data";
            ScenarioOutputClass.Text = "No data";
            ScenarioOutputEndorsements.Text = "No data";
            ScenarioOutputExpirationDate.Text = "No data";
            ScenarioOutputEyeColor.Text = "No data";
            ScenarioOutputFirstName.Text = "No data";
            ScenarioOutputGender.Text = "No data";
            ScenarioOutputHairColor.Text = "No data";
            ScenarioOutputHeight.Text = "No data";
            ScenarioOutputLicenseNumber.Text = "No data";
            ScenarioOutputPostalCode.Text = "No data";
            ScenarioOutputRestrictions.Text = "No data";
            ScenarioOutputState.Text = "No data";
            ScenarioOutputSuffix.Text = "No data";
            ScenarioOutputSurname.Text = "No data";
            ScenarioOutputWeight.Text = "No data";

            // reset the button state
            ScenarioEndReadButton.IsEnabled = false;
            ScenarioStartReadButton.IsEnabled = true;
        }

void ScenarioEndReadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for End button.

Parameters:
sender
e

Definition at line 122 of file Scenario2_AamvaCards.xaml.cs.

        {
            ResetTheScenarioState();
        }

async void ScenarioStartReadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario2_AamvaCards.xaml.cs.

        {
            if (await CreateDefaultMagneticStripeReaderObject())
            {
                if (_reader != null)
                {
                    // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
                    if (await ClaimReader())
                    {
                        if (_claimedReader != null)
                        {
                            // It is always a good idea to have a release device requested event handler. If this event is not handled, there is a chance that another app can
                            // claim ownsership of the magnetic stripe reader.
                            _claimedReader.ReleaseDeviceRequested += OnReleaseDeviceRequested;

                            // after successfully claiming and enabling, attach the AamvaCardDataReceived event handler.
                            // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be of any use because the API will not fire the event
                            // if the claimedScanner has not beed Enabled
                            _claimedReader.AamvaCardDataReceived += OnAamvaCardDataReceived;

                            // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
                            _claimedReader.IsDecodeDataEnabled = true;

                            await _claimedReader.EnableAsync();

                            rootPage.NotifyUser("Ready to swipe. Device ID: " + _claimedReader.DeviceId, NotifyType.StatusMessage);

                            // reset the button state
                            ScenarioEndReadButton.IsEnabled = true;
                            ScenarioStartReadButton.IsEnabled = false;
                        }
                    }
                }
            }
        }

Member Data Documentation

ClaimedMagneticStripeReader _claimedReader = null [private]

Definition at line 35 of file Scenario2_AamvaCards.xaml.cs.

MagneticStripeReader _reader = null [private]

Definition at line 34 of file Scenario2_AamvaCards.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2_AamvaCards.xaml.cs.

The documentation for this class was generated from the following file:
  • MagneticStripeReader/cs/Scenario2_AamvaCards.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 25 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 32 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 43 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (rootFrame.Content == null)
                {
                    rootFrame.Navigate(typeof(MasterDetailPage));
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 76 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 88 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();

            deferral.Complete();
        }

The documentation for this class was generated from the following files:
  • XamlMasterDetail/cs/App.xaml.cs
  • XamlMasterDetail/cppwinrt/App.cpp
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Item Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • Data
  • Item
Properties

Item Class Reference

List of all members.

Properties

DateTime | DateCreated [get, set]
int | Id [get, set]
string | Text [get, set]
string | Title [get, set]

Detailed Description

Definition at line 9 of file Item.cs.

Property Documentation

DateTime DateCreated [get, set]

Definition at line 12 of file Item.cs.

int Id [get, set]

Definition at line 11 of file Item.cs.

string Text [get, set]

Definition at line 14 of file Item.cs.

string Title [get, set]

Definition at line 13 of file Item.cs.

The documentation for this class was generated from the following file:
  • XamlMasterDetail/cs/Data/Item.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemsDataSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • Data
  • ItemsDataSource
Static Public Member Functions | Static Private Attributes

ItemsDataSource Class Reference

List of all members.

Static Public Member Functions

static IList< Item > | GetAllItems ()
static Item | GetItemById (int id)

Static Private Attributes

static List< Item > | _items

Detailed Description

Definition at line 9 of file ItemsDataSource.cs.

Member Function Documentation

static IList<Item> GetAllItems ( ) [inline, static]

Definition at line 54 of file ItemsDataSource.cs.

        {
            return _items;
        }

static Item GetItemById ( int id ) [inline, static]

Definition at line 59 of file ItemsDataSource.cs.

        {
            return _items[id];
        }

Member Data Documentation

List<Item> _items [static, private]

Definition at line 11 of file ItemsDataSource.cs.

The documentation for this class was generated from the following file:
  • XamlMasterDetail/cs/Data/ItemsDataSource.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • DetailPage
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Static Private Attributes

DetailPage Class Reference

List of all members.

Public Member Functions

DetailPage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

ItemViewModel | Item [get, set]
static DependencyProperty | ItemProperty [get]

Private Member Functions

void | DetailPage_BackRequested (object sender, BackRequestedEventArgs e)
void | NavigateBackForWideState (bool useTransition)
void | OnBackRequested ()
void | PageRoot_Loaded (object sender, RoutedEventArgs e)
void | PageRoot_Unloaded (object sender, RoutedEventArgs e)
void | ReplaceLastBackStackEntryParameter (object parameter)
bool | ShouldGoToWideState ()
void | Window_SizeChanged (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)

Static Private Attributes

static DependencyProperty | s_itemProperty = DependencyProperty.Register("Item", typeof(ItemViewModel), typeof(DetailPage), new PropertyMetadata(null))

Detailed Description

Definition at line 24 of file DetailPage.xaml.cs.

Constructor & Destructor Documentation

DetailPage ( ) [inline]

Definition at line 40 of file DetailPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DetailPage_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 146 of file DetailPage.xaml.cs.

        {
            // Mark event as handled so we don't get bounced out of the app.
            e.Handled = true;

            OnBackRequested();
        }

void NavigateBackForWideState ( bool useTransition ) [inline, private]

Definition at line 92 of file DetailPage.xaml.cs.

        {
            // Evict this page from the cache as we may not need it again.
            NavigationCacheMode = NavigationCacheMode.Disabled;

            if (useTransition)
            {
                Frame.GoBack(new EntranceNavigationTransitionInfo());
            }
            else
            {
                Frame.GoBack(new SuppressNavigationTransitionInfo());
            }
        }

void OnBackRequested ( ) [inline, private]

Definition at line 69 of file DetailPage.xaml.cs.

        {
            // Page above us will be our master view.
            // Make sure we are using the "drill out" animation in this transition.
            ReplaceLastBackStackEntryParameter(null);
            Frame.GoBack(new DrillInNavigationTransitionInfo());
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 60 of file DetailPage.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested -= DetailPage_BackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file DetailPage.xaml.cs.

        {
            base.OnNavigatedTo(e);

            // Parameter is item ID
            Item = ItemViewModel.FromItem(ItemsDataSource.GetItemById((int)e.Parameter));

            ReplaceLastBackStackEntryParameter(e.Parameter);

            // Register for hardware and software back request from the system
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += DetailPage_BackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }

void PageRoot_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 112 of file DetailPage.xaml.cs.

        {
            if (ShouldGoToWideState())
            {
                // We shouldn't see this page since we are in "wide master-detail" mode.
                // Play a transition as we are navigating from a separate page.
                NavigateBackForWideState(useTransition:true);
            }
            else
            {
                // Realize the main page content.
                FindName("RootPanel");
            }

            Window.Current.SizeChanged += Window_SizeChanged;
        }

void PageRoot_Unloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file DetailPage.xaml.cs.

        {
            Window.Current.SizeChanged -= Window_SizeChanged;
        }

void ReplaceLastBackStackEntryParameter ( object parameter ) [inline, private]

Definition at line 79 of file DetailPage.xaml.cs.

        {
            var backStack = Frame.BackStack;
            var backStackCount = backStack.Count;

            if (backStackCount > 0)
            {
                var entry = backStack[backStackCount - 1];
                backStack[backStackCount - 1] = new PageStackEntry(
                    entry.SourcePageType, parameter, entry.NavigationTransitionInfo);
            }
        }

bool ShouldGoToWideState ( ) [inline, private]

Definition at line 107 of file DetailPage.xaml.cs.

        {
            return Window.Current.Bounds.Width >= 720;
        }

void Window_SizeChanged | ( | object | sender,
 |  | Windows.UI.Core.WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 134 of file DetailPage.xaml.cs.

        {
            if (ShouldGoToWideState())
            {
                // Make sure we are no longer listening to window change events.
                Window.Current.SizeChanged -= Window_SizeChanged;

                // We shouldn't see this page since we are in "wide master-detail" mode.
                NavigateBackForWideState(useTransition:false);
            }
        }

Member Data Documentation

DependencyProperty s_itemProperty = DependencyProperty.Register("Item", typeof(ItemViewModel), typeof(DetailPage), new PropertyMetadata(null)) [static, private]

Definition at line 27 of file DetailPage.xaml.cs.

Property Documentation

ItemViewModel Item [get, set]

Definition at line 35 of file DetailPage.xaml.cs.

DependencyProperty ItemProperty [static, get]

Definition at line 30 of file DetailPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlMasterDetail/cs/DetailPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • MasterDetailPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

MasterDetailPage Class Reference

List of all members.

Public Member Functions

MasterDetailPage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AdaptiveStates_CurrentStateChanged (object sender, VisualStateChangedEventArgs e)
void | DisableContentTransitions ()
void | EnableContentTransitions ()
void | LayoutRoot_Loaded (object sender, RoutedEventArgs e)
void | MasterListView_ItemClick (object sender, ItemClickEventArgs e)
void | UpdateForVisualState (VisualState newState, VisualState oldState=null)

Private Attributes

ItemViewModel _lastSelectedItem

Detailed Description

Definition at line 22 of file MasterDetailPage.xaml.cs.

Constructor & Destructor Documentation

MasterDetailPage ( ) [inline]

Definition at line 26 of file MasterDetailPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AdaptiveStates_CurrentStateChanged | ( | object | sender,
 |  | VisualStateChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file MasterDetailPage.xaml.cs.

        {
            UpdateForVisualState(e.NewState, e.OldState);
        }

void DisableContentTransitions ( ) [inline, private]

Definition at line 119 of file MasterDetailPage.xaml.cs.

        {
            if (DetailContentPresenter != null)
            {
                DetailContentPresenter.ContentTransitions.Clear();
            }
        }

void EnableContentTransitions ( ) [inline, private]

Definition at line 113 of file MasterDetailPage.xaml.cs.

        {
            DetailContentPresenter.ContentTransitions.Clear();
            DetailContentPresenter.ContentTransitions.Add(new EntranceThemeTransition());
        }

void LayoutRoot_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 107 of file MasterDetailPage.xaml.cs.

        {
            // Assure we are displaying the correct item. This is necessary in certain adaptive cases.
            MasterListView.SelectedItem = _lastSelectedItem;
        }

void MasterListView_ItemClick | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 90 of file MasterDetailPage.xaml.cs.

        {
            var clickedItem = (ItemViewModel)e.ClickedItem;
            _lastSelectedItem = clickedItem;

            if (AdaptiveStates.CurrentState == NarrowState)
            {
                // Use "drill in" transition for navigating from master list to detail view
                Frame.Navigate(typeof(DetailPage), clickedItem.ItemId, new DrillInNavigationTransitionInfo());
            }
            else
            {
                // Play a refresh animation when the user switches detail items.
                EnableContentTransitions();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file MasterDetailPage.xaml.cs.

        {
            base.OnNavigatedTo(e);

            var items = MasterListView.ItemsSource as List<ItemViewModel>;

            if (items == null)
            {
                items = new List<ItemViewModel>();

                foreach (var item in ItemsDataSource.GetAllItems())
                {
                    items.Add(ItemViewModel.FromItem(item));
                }

                MasterListView.ItemsSource = items;
            }

            if (e.Parameter != null)
            {
                // Parameter is item ID
                var id = (int)e.Parameter;
                _lastSelectedItem =
                    items.Where((item) => item.ItemId == id).FirstOrDefault();
            }
            else
            {
                _lastSelectedItem = null;
            }

            UpdateForVisualState(AdaptiveStates.CurrentState);

            // Don't play a content transition for first item load.
            // Sometimes, this content will be animated as part of the page transition.
            DisableContentTransitions();
        }

void UpdateForVisualState | ( | VisualState | newState,
 |  | VisualState | oldState = null |
 | ) |  |  | [inline, private]

Definition at line 73 of file MasterDetailPage.xaml.cs.

        {
            var isNarrow = newState == NarrowState;

            if (isNarrow && oldState == DefaultState && _lastSelectedItem != null)
            {
                // Resize down to the detail item. Don't play a transition.
                Frame.Navigate(typeof(DetailPage), _lastSelectedItem.ItemId, new SuppressNavigationTransitionInfo());
            }

            EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow);
            if (DetailContentPresenter != null)
            {
                EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow);
            }
        }

Member Data Documentation

ItemViewModel _lastSelectedItem [private]

Definition at line 24 of file MasterDetailPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlMasterDetail/cs/MasterDetailPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MasterDetailApp
  • ViewModels
  • ItemViewModel
Public Member Functions | Static Public Member Functions | Properties | Private Attributes

ItemViewModel Class Reference

List of all members.

Public Member Functions

ItemViewModel ()

Static Public Member Functions

static ItemViewModel | FromItem (Item item)

Properties

DateTime | DateCreated [get, set]
string | DateCreatedHourMinute [get]
int | ItemId [get]
string | Text [get, set]
string | Title [get, set]

Private Attributes

int | _itemId

Detailed Description

Definition at line 12 of file ItemViewModel.cs.

Constructor & Destructor Documentation

ItemViewModel ( ) [inline]

Definition at line 37 of file ItemViewModel.cs.

        {
        }

Member Function Documentation

static ItemViewModel FromItem ( Item item ) [inline, static]

Definition at line 41 of file ItemViewModel.cs.

        {
            var viewModel = new ItemViewModel();

            viewModel._itemId = item.Id;
            viewModel.DateCreated = item.DateCreated;
            viewModel.Title = item.Title;
            viewModel.Text = item.Text;

            return viewModel;
        }

Member Data Documentation

int _itemId [private]

Definition at line 14 of file ItemViewModel.cs.

Property Documentation

DateTime DateCreated [get, set]

Definition at line 35 of file ItemViewModel.cs.

string DateCreatedHourMinute [get]

Definition at line 25 of file ItemViewModel.cs.

int ItemId [get]

Definition at line 17 of file ItemViewModel.cs.

string Text [get, set]

Definition at line 34 of file ItemViewModel.cs.

string Title [get, set]

Definition at line 33 of file ItemViewModel.cs.

The documentation for this class was generated from the following file:
  • XamlMasterDetail/cs/ViewModels/ItemViewModel.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Material Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

Material Class Reference

#include "Material.h"

List of all members.

Public Member Functions

Material (DirectX::XMFLOAT4 meshColor, DirectX::XMFLOAT4 diffuseColor, DirectX::XMFLOAT4 specularColor, float specularExponent, _In_ ID3D11ShaderResourceView *textureResourceView, _In_ ID3D11VertexShader *vertexShader, _In_ ID3D11PixelShader *pixelShader)
void | RenderSetup (_In_ ID3D11DeviceContext *context, _Inout_ ConstantBufferChangesEveryPrim *constantBuffer)
void | SetTexture (_In_ ID3D11ShaderResourceView *textureResourceView)

Private Attributes

DirectX::XMFLOAT4 | m_diffuseColor
DirectX::XMFLOAT4 | m_hitColor
DirectX::XMFLOAT4 | m_meshColor
winrt::com_ptr< ID3D11PixelShader > | m_pixelShader
DirectX::XMFLOAT4 | m_specularColor
float | m_specularExponent
winrt::com_ptr
< ID3D11ShaderResourceView > 		m_textureRV
winrt::com_ptr
< ID3D11VertexShader > 		m_vertexShader

Detailed Description

Definition at line 25 of file Material.h.

Constructor & Destructor Documentation

Material | ( | DirectX::XMFLOAT4 | meshColor,
 |  | DirectX::XMFLOAT4 | diffuseColor,
 |  | DirectX::XMFLOAT4 | specularColor,
 |  | float | specularExponent,
 |  | _In_ ID3D11ShaderResourceView * | textureResourceView,
 |  | _In_ ID3D11VertexShader * | vertexShader,
 |  | _In_ ID3D11PixelShader * | pixelShader
 | ) |  |

Member Function Documentation

void RenderSetup | ( | _In_ ID3D11DeviceContext * | context,
 |  | _Inout_ ConstantBufferChangesEveryPrim * | constantBuffer
 | ) |  |

Definition at line 37 of file Material.cpp.

{
    constantBuffer->meshColor = m_meshColor;
    constantBuffer->specularColor = m_specularColor;
    constantBuffer->specularPower = m_specularExponent;
    constantBuffer->diffuseColor = m_diffuseColor;

    ID3D11ShaderResourceView* textureRV = m_textureRV.get();
    context->PSSetShaderResources(0, 1, &textureRV);
    context->VSSetShader(m_vertexShader.get(), nullptr, 0);
    context->PSSetShader(m_pixelShader.get(), nullptr, 0);
}

void SetTexture ( _In_ ID3D11ShaderResourceView * textureResourceView ) [inline]

Definition at line 43 of file Material.h.

    {
        m_textureRV.copy_from(textureResourceView);
    }

Member Data Documentation

DirectX::XMFLOAT4 m_diffuseColor [private]

Definition at line 50 of file Material.h.

DirectX::XMFLOAT4 m_hitColor [private]

Definition at line 51 of file Material.h.

DirectX::XMFLOAT4 m_meshColor [private]

Definition at line 49 of file Material.h.

winrt::com_ptr<ID3D11PixelShader> m_pixelShader [private]

Definition at line 56 of file Material.h.

DirectX::XMFLOAT4 m_specularColor [private]

Definition at line 52 of file Material.h.

float m_specularExponent [private]

Definition at line 53 of file Material.h.

winrt::com_ptr<ID3D11ShaderResourceView> m_textureRV [private]

Definition at line 57 of file Material.h.

winrt::com_ptr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 55 of file Material.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Material.h
  • Simple3DGameDX/cppwinrt/GameContent/Material.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Matrix4x4< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

Matrix4x4< T > Struct Template Reference

#include "BasicMath.h"

List of all members.

Public Member Functions

Matrix4x4 (T value=0)
Matrix4x4 (T i11, T i12, T i13, T i14, T i21, T i22, T i23, T i24, T i31, T i32, T i33, T i34, T i41, T i42, T i43, T i44)
Matrix4x4 (T value=0)
Matrix4x4 (T i11, T i12, T i13, T i14, T i21, T i22, T i23, T i24, T i31, T i32, T i33, T i34, T i41, T i42, T i43, T i44)
Matrix4x4 (T i11, T i12, T i13, T i14, T i21, T i22, T i23, T i24, T i31, T i32, T i33, T i34, T i41, T i42, T i43, T i44)
Matrix4x4 (T value=0)
T * | operator[] (unsigned int index)
T * | operator[] (unsigned int index)
T * | operator[] (unsigned int index)

Public Attributes

union {
struct {
T _11
T _12
T _13
T _14
T _21
T _22
T _23
T _24
T _31
T _32
T _33
T _34
T _41
T _42
T _43
T _44
}
struct {
T _m00
T _m01
T _m02
T _m03
T _m10
T _m11
T _m12
T _m13
T _m20
T _m21
T _m22
T _m23
T _m30
T _m31
T _m32
T _m33
}
};
union {
struct {
T _11
T _12
T _13
T _14
T _21
T _22
T _23
T _24
T _31
T _32
T _33
T _34
T _41
T _42
T _43
T _44
} onebased
struct {
T _m00
T _m01
T _m02
T _m03
T _m10
T _m11
T _m12
T _m13
T _m20
T _m21
T _m22
T _m23
T _m30
T _m31
T _m32
T _m33
} zerobased
};
union {
struct {
T _11
T _12
T _13
T _14
T _21
T _22
T _23
T _24
T _31
T _32
T _33
T _34
T _41
T _42
T _43
T _44
}
struct {
T _m00
T _m01
T _m02
T _m03
T _m10
T _m11
T _m12
T _m13
T _m20
T _m21
T _m22
T _m23
T _m30
T _m31
T _m32
T _m33
}
};

Detailed Description

template<class T>
struct Matrix4x4< T >

Definition at line 111 of file BasicMath.h.

Constructor & Destructor Documentation

Matrix4x4 ( T value = 0 ) [inline]

Definition at line 131 of file BasicMath.h.

    {
        _11 = _12 = _13 = _14 = value;
        _21 = _22 = _23 = _24 = value;
        _31 = _32 = _33 = _34 = value;
        _41 = _42 = _43 = _44 = value;
    }

Matrix4x4 | ( | T | i11,
 |  | T | i12,
 |  | T | i13,
 |  | T | i14,
 |  | T | i21,
 |  | T | i22,
 |  | T | i23,
 |  | T | i24,
 |  | T | i31,
 |  | T | i32,
 |  | T | i33,
 |  | T | i34,
 |  | T | i41,
 |  | T | i42,
 |  | T | i43,
 |  | T | i44 |
 | ) |  |  | [inline]

Definition at line 139 of file BasicMath.h.

    {
        _11 = i11; _12 = i12; _13 = i13; _14 = i14;
        _21 = i21; _22 = i22; _23 = i23; _24 = i24;
        _31 = i31; _32 = i32; _33 = i33; _34 = i34;
        _41 = i41; _42 = i42; _43 = i43; _44 = i44;
    }

Matrix4x4 ( T value = 0 ) [inline]

Definition at line 131 of file BasicMath.h.

    {
        onebased._11 = onebased._12 = onebased._13 = onebased._14 = value;
        onebased._21 = onebased._22 = onebased._23 = onebased._24 = value;
        onebased._31 = onebased._32 = onebased._33 = onebased._34 = value;
        onebased._41 = onebased._42 = onebased._43 = onebased._44 = value;
    }

Matrix4x4 | ( | T | i11,
 |  | T | i12,
 |  | T | i13,
 |  | T | i14,
 |  | T | i21,
 |  | T | i22,
 |  | T | i23,
 |  | T | i24,
 |  | T | i31,
 |  | T | i32,
 |  | T | i33,
 |  | T | i34,
 |  | T | i41,
 |  | T | i42,
 |  | T | i43,
 |  | T | i44 |
 | ) |  |  | [inline]

Definition at line 139 of file BasicMath.h.

    {
        _11 = i11; _12 = i12; _13 = i13; _14 = i14;
        _21 = i21; _22 = i22; _23 = i23; _24 = i24;
        _31 = i31; _32 = i32; _33 = i33; _34 = i34;
        _41 = i41; _42 = i42; _43 = i43; _44 = i44;
    }

Matrix4x4 ( T value = 0 ) [inline]

Definition at line 131 of file BasicMath.h.

    {
        _11 = _12 = _13 = _14 = value;
        _21 = _22 = _23 = _24 = value;
        _31 = _32 = _33 = _34 = value;
        _41 = _42 = _43 = _44 = value;
    }

Matrix4x4 | ( | T | i11,
 |  | T | i12,
 |  | T | i13,
 |  | T | i14,
 |  | T | i21,
 |  | T | i22,
 |  | T | i23,
 |  | T | i24,
 |  | T | i31,
 |  | T | i32,
 |  | T | i33,
 |  | T | i34,
 |  | T | i41,
 |  | T | i42,
 |  | T | i43,
 |  | T | i44 |
 | ) |  |  | [inline]

Definition at line 139 of file BasicMath.h.

    {
        _11 = i11; _12 = i12; _13 = i13; _14 = i14;
        _21 = i21; _22 = i22; _23 = i23; _24 = i24;
        _31 = i31; _32 = i32; _33 = i33; _34 = i34;
        _41 = i41; _42 = i42; _43 = i43; _44 = i44;
    }

Member Function Documentation

T* operator[] ( unsigned int index ) [inline]

Definition at line 152 of file BasicMath.h.

    {
        return &(reinterpret_cast<T*>(this)[index*4]);
    }

T* operator[] ( unsigned int index ) [inline]

Definition at line 152 of file BasicMath.h.

    {
        return &(reinterpret_cast<T*>(this)[index*4]);
    }

T* operator[] ( unsigned int index ) [inline]

Definition at line 152 of file BasicMath.h.

    {
        return &(reinterpret_cast<T*>(this)[index * 4]);
    }

Member Data Documentation

union { ... }
union { ... }
union { ... }
T _11

Definition at line 117 of file BasicMath.h.

T _12

Definition at line 117 of file BasicMath.h.

T _13

Definition at line 117 of file BasicMath.h.

T _14

Definition at line 117 of file BasicMath.h.

T _21

Definition at line 118 of file BasicMath.h.

T _22

Definition at line 118 of file BasicMath.h.

T _23

Definition at line 118 of file BasicMath.h.

T _24

Definition at line 118 of file BasicMath.h.

T _31

Definition at line 119 of file BasicMath.h.

T _32

Definition at line 119 of file BasicMath.h.

T _33

Definition at line 119 of file BasicMath.h.

T _34

Definition at line 119 of file BasicMath.h.

T _41

Definition at line 120 of file BasicMath.h.

T _42

Definition at line 120 of file BasicMath.h.

T _43

Definition at line 120 of file BasicMath.h.

T _44

Definition at line 120 of file BasicMath.h.

T _m00

Definition at line 124 of file BasicMath.h.

T _m01

Definition at line 124 of file BasicMath.h.

T _m02

Definition at line 124 of file BasicMath.h.

T _m03

Definition at line 124 of file BasicMath.h.

T _m10

Definition at line 125 of file BasicMath.h.

T _m11

Definition at line 125 of file BasicMath.h.

T _m12

Definition at line 125 of file BasicMath.h.

T _m13

Definition at line 125 of file BasicMath.h.

T _m20

Definition at line 126 of file BasicMath.h.

T _m21

Definition at line 126 of file BasicMath.h.

T _m22

Definition at line 126 of file BasicMath.h.

T _m23

Definition at line 126 of file BasicMath.h.

T _m30

Definition at line 127 of file BasicMath.h.

T _m31

Definition at line 127 of file BasicMath.h.

T _m32

Definition at line 127 of file BasicMath.h.

T _m33

Definition at line 127 of file BasicMath.h.

struct { ... } onebased
struct { ... } zerobased
The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicMath.h
  • Simple3DGameDX/cppwinrt/Common/BasicMath.h
  • Simple3DGameXaml/cpp/Common/BasicMath.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrimAndSaveClip Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MediaEditingSample
  • Scenario1_TrimAndSaveClip
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_TrimAndSaveClip Class Reference

List of all members.

Public Member Functions

Scenario1_TrimAndSaveClip ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ChooseFile_Click (object sender, RoutedEventArgs e)
void | EnableButtons (bool isEnabled)
async void | Save_Click (object sender, RoutedEventArgs e)
async void | TrimClip_Click (object sender, RoutedEventArgs e)

Private Attributes

MediaComposition | composition
MediaStreamSource | mediaStreamSource
StorageFile | pickedFile
MainPage rootPage
StorageItemAccessList | storageItemAccessList

Detailed Description

Definition at line 28 of file Scenario1_TrimAndSaveClip.xaml.cs.

Constructor & Destructor Documentation

Scenario1_TrimAndSaveClip ( ) [inline]

Definition at line 36 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ChooseFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            // Get file
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            pickedFile = await picker.PickSingleFileAsync();
            if (pickedFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            // These files could be picked from a location that we won't have access to later
            // (especially if persisting the MediaComposition to disk and loading it later).
            // Use the StorageItemAccessList in order to keep access permissions to that
            // file for later use. Be aware that this access list needs to be cleared
            // periodically or the app will run out of entries.
            storageItemAccessList.Add(pickedFile);

            mediaElement.SetSource(await pickedFile.OpenReadAsync(), pickedFile.ContentType);
            trimClip.IsEnabled = true;
        }

void EnableButtons ( bool isEnabled ) [inline, private]

Definition at line 152 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            chooseFile.IsEnabled = isEnabled;
            save.IsEnabled = isEnabled;
            trimClip.IsEnabled = isEnabled;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            mediaElement.Source = null;
            mediaStreamSource = null;
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Make sure we don't run out of entries in StoreItemAccessList.
            // As we don't need to persist this across app sessions/pages, clearing
            // every time should be sufficient for us.
            storageItemAccessList = StorageApplicationPermissions.FutureAccessList;
            storageItemAccessList.Clear();
        }

async void Save_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            EnableButtons(false);
            rootPage.NotifyUser("Requesting file to save to", NotifyType.StatusMessage);

            var picker = new Windows.Storage.Pickers.FileSavePicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeChoices.Add("MP4 files", new List<string>() { ".mp4" });
            picker.SuggestedFileName = "TrimmedClip.mp4";

            StorageFile file = await picker.PickSaveFileAsync();
            if (file != null)
            {
                var saveOperation = composition.RenderToFileAsync(file, MediaTrimmingPreference.Precise);
                saveOperation.Progress = new AsyncOperationProgressHandler<TranscodeFailureReason, double>(async (info, progress) =>
                {
                    await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
                    {
                        rootPage.NotifyUser(string.Format("Saving file... Progress: {0:F0}%", progress), NotifyType.StatusMessage);
                    }));
                });
                saveOperation.Completed = new AsyncOperationWithProgressCompletedHandler<TranscodeFailureReason, double>(async (info, status) =>
                {
                    await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
                    {
                        try
                        {
                            var results = info.GetResults();
                            if (results != TranscodeFailureReason.None || status != AsyncStatus.Completed)
                            {
                                rootPage.NotifyUser("Saving was unsuccessful", NotifyType.ErrorMessage);
                            }
                            else
                            {
                                rootPage.NotifyUser("Trimmed clip saved to file", NotifyType.StatusMessage);
                            }
                        }
                        finally
                        {
                            // Remember to re-enable controls on both success and failure
                            EnableButtons(true);
                        }
                    }));
                });
            }
            else
            {
                rootPage.NotifyUser("User cancelled the file selection", NotifyType.StatusMessage);
                EnableButtons(true);
            }
        }

async void TrimClip_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario1_TrimAndSaveClip.xaml.cs.

        {
            // Trim the front and back 25% from the clip
            var clip = await MediaClip.CreateFromFileAsync(pickedFile);
            clip.TrimTimeFromStart = new TimeSpan((long)(clip.OriginalDuration.Ticks * 0.25));
            clip.TrimTimeFromEnd = new TimeSpan((long)(clip.OriginalDuration.Ticks * 0.25));

            // Create a MediaComposition containing the clip and set it on the MediaElement.
            composition = new MediaComposition();
            composition.Clips.Add(clip);
            mediaElement.Position = TimeSpan.Zero;
            mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
            mediaElement.SetMediaStreamSource(mediaStreamSource);
            rootPage.NotifyUser("Clip trimmed", NotifyType.StatusMessage);
            save.IsEnabled = true;
        }

Member Data Documentation

MediaComposition composition [private]

Definition at line 32 of file Scenario1_TrimAndSaveClip.xaml.cs.

MediaStreamSource mediaStreamSource [private]

Definition at line 34 of file Scenario1_TrimAndSaveClip.xaml.cs.

StorageFile pickedFile [private]

Definition at line 33 of file Scenario1_TrimAndSaveClip.xaml.cs.

MainPage rootPage [private]

Definition at line 31 of file Scenario1_TrimAndSaveClip.xaml.cs.

StorageItemAccessList storageItemAccessList [private]

Definition at line 30 of file Scenario1_TrimAndSaveClip.xaml.cs.

The documentation for this class was generated from the following file:
  • MediaEditing/cs/Scenario1_TrimAndSaveClip.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_AppendClips Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MediaEditingSample
  • Scenario2_AppendClips
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_AppendClips Class Reference

List of all members.

Public Member Functions

Scenario2_AppendClips ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AppendVideos_Click (object sender, RoutedEventArgs e)
async void | ChooseFirstVideo_Click (object sender, RoutedEventArgs e)
async void | ChooseSecondVideo_Click (object sender, RoutedEventArgs e)

Private Attributes

MediaComposition | composition
StorageFile | firstVideoFile
MediaStreamSource | mediaStreamSource
MainPage rootPage
StorageFile | secondVideoFile

Detailed Description

Definition at line 23 of file Scenario2_AppendClips.xaml.cs.

Constructor & Destructor Documentation

Scenario2_AppendClips ( ) [inline]

Definition at line 31 of file Scenario2_AppendClips.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AppendVideos_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario2_AppendClips.xaml.cs.

        {
            // Combine two video files together into one
            var firstClip = await MediaClip.CreateFromFileAsync(firstVideoFile);
            var secondClip = await MediaClip.CreateFromFileAsync(secondVideoFile);

            composition = new MediaComposition();
            composition.Clips.Add(firstClip);
            composition.Clips.Add(secondClip);

            // Render to MediaElement.
            mediaElement.Position = TimeSpan.Zero;
            mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
            mediaElement.SetMediaStreamSource(mediaStreamSource);
            rootPage.NotifyUser("Clips appended", NotifyType.StatusMessage);
        }

async void ChooseFirstVideo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario2_AppendClips.xaml.cs.

        {
            // Get first file
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            firstVideoFile = await picker.PickSingleFileAsync();
            if (firstVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            mediaElement.SetSource(await firstVideoFile.OpenReadAsync(), firstVideoFile.ContentType);
            chooseSecondFile.IsEnabled = true;
        }

async void ChooseSecondVideo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario2_AppendClips.xaml.cs.

        {
            // Get second file
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            secondVideoFile = await picker.PickSingleFileAsync();
            if (secondVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            mediaElement.SetSource(await secondVideoFile.OpenReadAsync(), secondVideoFile.ContentType);
            appendFiles.IsEnabled = true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario2_AppendClips.xaml.cs.

        {
            mediaElement.Source = null;
            mediaStreamSource = null;
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario2_AppendClips.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MediaComposition composition [private]

Definition at line 26 of file Scenario2_AppendClips.xaml.cs.

StorageFile firstVideoFile [private]

Definition at line 27 of file Scenario2_AppendClips.xaml.cs.

MediaStreamSource mediaStreamSource [private]

Definition at line 29 of file Scenario2_AppendClips.xaml.cs.

MainPage rootPage [private]

Definition at line 25 of file Scenario2_AppendClips.xaml.cs.

StorageFile secondVideoFile [private]

Definition at line 28 of file Scenario2_AppendClips.xaml.cs.

The documentation for this class was generated from the following file:
  • MediaEditing/cs/Scenario2_AppendClips.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AddAudioTracks Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MediaEditingSample
  • Scenario3_AddAudioTracks
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_AddAudioTracks Class Reference

List of all members.

Public Member Functions

Scenario3_AddAudioTracks ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddAudio_Click (object sender, RoutedEventArgs e)
async void | ChooseVideo_Click (object sender, RoutedEventArgs e)

Private Attributes

MediaComposition | composition
MediaStreamSource | mediaStreamSource
StorageFile | pickedFile
MainPage rootPage

Detailed Description

Definition at line 23 of file Scenario3_AddAudioTracks.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AddAudioTracks ( ) [inline]

Definition at line 30 of file Scenario3_AddAudioTracks.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AddAudio_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario3_AddAudioTracks.xaml.cs.

        {
            // Create the original MediaComposition
            var clip = await MediaClip.CreateFromFileAsync(pickedFile);
            composition = new MediaComposition();
            composition.Clips.Add(clip);

            // Add background audio
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.MusicLibrary;
            picker.FileTypeFilter.Add(".mp3");
            picker.FileTypeFilter.Add(".wav");
            picker.FileTypeFilter.Add(".flac");
            var audioFile = await picker.PickSingleFileAsync();
            if (audioFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            var backgroundTrack = await BackgroundAudioTrack.CreateFromFileAsync(audioFile);
            composition.BackgroundAudioTracks.Add(backgroundTrack);

            // Render to MediaElement
            mediaElement.Position = TimeSpan.Zero;
            mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
            mediaElement.SetMediaStreamSource(mediaStreamSource);

            rootPage.NotifyUser("Background audio added", NotifyType.StatusMessage);
        }

async void ChooseVideo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario3_AddAudioTracks.xaml.cs.

        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            pickedFile = await picker.PickSingleFileAsync();
            if (pickedFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            mediaElement.SetSource(await pickedFile.OpenReadAsync(), pickedFile.ContentType);
            addAudio.IsEnabled = true;

            rootPage.NotifyUser("Video file added", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario3_AddAudioTracks.xaml.cs.

        {
            mediaElement.Source = null;
            mediaStreamSource = null;
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario3_AddAudioTracks.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MediaComposition composition [private]

Definition at line 26 of file Scenario3_AddAudioTracks.xaml.cs.

MediaStreamSource mediaStreamSource [private]

Definition at line 28 of file Scenario3_AddAudioTracks.xaml.cs.

StorageFile pickedFile [private]

Definition at line 27 of file Scenario3_AddAudioTracks.xaml.cs.

MainPage rootPage [private]

Definition at line 25 of file Scenario3_AddAudioTracks.xaml.cs.

The documentation for this class was generated from the following file:
  • MediaEditing/cs/Scenario3_AddAudioTracks.xaml.cs
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_AddOverlays Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MediaEditingSample
  • Scenario4_AddOverlays
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_AddOverlays Class Reference

List of all members.

Public Member Functions

Scenario4_AddOverlays ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ChooseBaseVideo_Click (object sender, RoutedEventArgs e)
async void | ChooseOverlayVideo_Click (object sender, RoutedEventArgs e)
async void | CreateOverlays ()

Private Attributes

StorageFile | baseVideoFile
MediaComposition | composition
MediaStreamSource | mediaStreamSource
StorageFile | overlayVideoFile
MainPage rootPage

Detailed Description

Definition at line 24 of file Scenario4_AddOverlays.xaml.cs.

Constructor & Destructor Documentation

Scenario4_AddOverlays ( ) [inline]

Definition at line 32 of file Scenario4_AddOverlays.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ChooseBaseVideo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario4_AddOverlays.xaml.cs.

        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            baseVideoFile = await picker.PickSingleFileAsync();
            if (baseVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            mediaElement.SetSource(await baseVideoFile.OpenReadAsync(), baseVideoFile.ContentType);
            chooseOverlayVideo.IsEnabled = true;
        }

async void ChooseOverlayVideo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario4_AddOverlays.xaml.cs.

        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            overlayVideoFile = await picker.PickSingleFileAsync();
            if (overlayVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            CreateOverlays();
            rootPage.NotifyUser("Overlay video chosen", NotifyType.StatusMessage);
        }

async void CreateOverlays ( ) [inline, private]

Definition at line 81 of file Scenario4_AddOverlays.xaml.cs.

        {
            var baseVideoClip = await MediaClip.CreateFromFileAsync(baseVideoFile);
            composition = new MediaComposition();
            composition.Clips.Add(baseVideoClip);

            var overlayVideoClip = await MediaClip.CreateFromFileAsync(overlayVideoFile);

            // Overlay video in upper left corner, retain its native aspect ratio
            Rect videoOverlayPosition;
            var encodingProperties = overlayVideoClip.GetVideoEncodingProperties();
            videoOverlayPosition.Height = mediaElement.ActualHeight / 3;
            videoOverlayPosition.Width = (double)encodingProperties.Width / (double)encodingProperties.Height * videoOverlayPosition.Height;
            videoOverlayPosition.X = 0;
            videoOverlayPosition.Y = 0;

            var videoOverlay = new MediaOverlay(overlayVideoClip);
            videoOverlay.Position = videoOverlayPosition;
            videoOverlay.Opacity = 0.75;

            var overlayLayer = new MediaOverlayLayer();
            overlayLayer.Overlays.Add(videoOverlay);
            composition.OverlayLayers.Add(overlayLayer);

            // Render to MediaElement
            mediaElement.Position = TimeSpan.Zero;
            mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
            mediaElement.SetMediaStreamSource(mediaStreamSource);
            rootPage.NotifyUser("Overlays created", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario4_AddOverlays.xaml.cs.

        {
            mediaElement.Source = null;
            mediaStreamSource = null;
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario4_AddOverlays.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

StorageFile baseVideoFile [private]

Definition at line 28 of file Scenario4_AddOverlays.xaml.cs.

MediaComposition composition [private]

Definition at line 27 of file Scenario4_AddOverlays.xaml.cs.

MediaStreamSource mediaStreamSource [private]

Definition at line 30 of file Scenario4_AddOverlays.xaml.cs.

StorageFile overlayVideoFile [private]

Definition at line 29 of file Scenario4_AddOverlays.xaml.cs.

MainPage rootPage [private]

Definition at line 26 of file Scenario4_AddOverlays.xaml.cs.

The documentation for this class was generated from the following file:
  • MediaEditing/cs/Scenario4_AddOverlays.xaml.cs
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaReader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

MediaReader Class Reference

#include "MediaReader.h"

List of all members.

Public Member Functions

MediaReader ()
WAVEFORMATEX * | GetOutputWaveFormatEx ()
std::vector< byte > | LoadMedia (_In_ winrt::hstring const &filename)

Private Attributes

winrt::hstring | m_installedLocationPath
WAVEFORMATEX | m_waveFormat

Detailed Description

Definition at line 19 of file MediaReader.h.

Constructor & Destructor Documentation

MediaReader ( )

Definition at line 17 of file MediaReader.cpp.

{
    ZeroMemory(&m_waveFormat, sizeof(m_waveFormat));
    m_installedLocation = Package::Current().InstalledLocation();
    m_installedLocationPath = m_installedLocation.Path() + L"\\";
}

Member Function Documentation

WAVEFORMATEX * GetOutputWaveFormatEx ( )

Definition at line 24 of file MediaReader.cpp.

{
    return &m_waveFormat;
}

std::vector< byte > LoadMedia ( _In_ winrt::hstring const & filename )

Definition at line 29 of file MediaReader.cpp.

{
    winrt::check_hresult(
        MFStartup(MF_VERSION)
        );

    winrt::com_ptr<IMFSourceReader> reader;
    winrt::check_hresult(
        MFCreateSourceReaderFromURL(
        (m_installedLocationPath + filename).c_str(),
            nullptr,
            reader.put()
            )
        );

    // Set the decoded output format as PCM.
    // XAudio2 on Windows can process PCM and ADPCM-encoded buffers.
    // When using MediaFoundation, this sample always decodes into PCM.
    winrt::com_ptr<IMFMediaType> mediaType;
    winrt::check_hresult(
        MFCreateMediaType(mediaType.put())
        );

    winrt::check_hresult(
        mediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio)
        );

    winrt::check_hresult(
        mediaType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM)
        );

    winrt::check_hresult(
        reader->SetCurrentMediaType(static_cast<uint32_t>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), 0, mediaType.get())
        );

    // Get the complete WAVEFORMAT from the Media Type.
    winrt::com_ptr<IMFMediaType> outputMediaType;
    winrt::check_hresult(
        reader->GetCurrentMediaType(static_cast<uint32_t>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), outputMediaType.put())
        );

    UINT32 size = 0;
    WAVEFORMATEX* waveFormat;
    winrt::check_hresult(
        MFCreateWaveFormatExFromMFMediaType(outputMediaType.get(), &waveFormat, &size)
        );

    CopyMemory(&m_waveFormat, waveFormat, sizeof(m_waveFormat));
    CoTaskMemFree(waveFormat);

    PROPVARIANT propVariant;
    winrt::check_hresult(
        reader->GetPresentationAttribute(static_cast<uint32_t>(MF_SOURCE_READER_MEDIASOURCE), MF_PD_DURATION, &propVariant)
        );
    // 'duration' is in 100ns units; convert to seconds, and round up
    // to the nearest whole byte.
    LONGLONG duration = propVariant.uhVal.QuadPart;
    unsigned int maxStreamLengthInBytes =
        static_cast<unsigned int>(
            ((duration * static_cast<ULONGLONG>(m_waveFormat.nAvgBytesPerSec)) + 10000000) /
            10000000
            );

    std::vector<byte> fileData(maxStreamLengthInBytes);

    winrt::com_ptr<IMFSample> sample;
    winrt::com_ptr<IMFMediaBuffer> mediaBuffer;
    DWORD flags = 0;

    int positionInData = 0;
    bool done = false;
    while (!done)
    {
        sample = nullptr;
        mediaBuffer = nullptr;
        winrt::check_hresult(
            reader->ReadSample(static_cast<uint32_t>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), 0, nullptr, &flags, nullptr, sample.put())
            );

        if (sample != nullptr)
        {
            winrt::check_hresult(
                sample->ConvertToContiguousBuffer(mediaBuffer.put())
                );

            BYTE* audioData = nullptr;
            DWORD sampleBufferLength = 0;
            winrt::check_hresult(
                mediaBuffer->Lock(&audioData, nullptr, &sampleBufferLength)
                );

            for (DWORD i = 0; i < sampleBufferLength; i++)
            {
                fileData[positionInData++] = audioData[i];
            }
        }
        if (flags & MF_SOURCE_READERF_ENDOFSTREAM)
        {
            done = true;
        }
    }

    return fileData;
}

Member Data Documentation

winrt::hstring m_installedLocationPath [private]

Definition at line 28 of file MediaReader.h.

WAVEFORMATEX m_waveFormat [private]

Definition at line 30 of file MediaReader.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/MediaReader.h
  • Simple3DGameDX/cppwinrt/GameContent/MediaReader.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MemDelete Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

MemDelete Class Reference

#include "LinkList.h"

List of all members.

Public Member Functions

void operator() (void *p)

Detailed Description

Definition at line 403 of file LinkList.h.

Member Function Documentation

void operator() ( void * p ) [inline]

Definition at line 406 of file LinkList.h.

    {
        if (p)
        {
            delete p;
        }
    }

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MeshObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Protected Attributes

MeshObject Class Reference

#include "MeshObject.h"

Inherited by CylinderMesh, FaceMesh, SphereMesh, WorldCeilingMesh, WorldFloorMesh, and WorldWallsMesh.

List of all members.

Public Member Functions

MeshObject ()
virtual void | Render (_In_ ID3D11DeviceContext *context)

Protected Attributes

winrt::com_ptr< ID3D11Buffer > | m_indexBuffer
int | m_indexCount
winrt::com_ptr< ID3D11Buffer > | m_vertexBuffer
int | m_vertexCount

Detailed Description

Definition at line 24 of file MeshObject.h.

Constructor & Destructor Documentation

MeshObject ( )

Definition at line 16 of file MeshObject.cpp.

                       :
    m_vertexCount(0),
    m_indexCount(0)
{
}

Member Function Documentation

void Render ( _In_ ID3D11DeviceContext * context ) [virtual]

Definition at line 22 of file MeshObject.cpp.

{
    uint32_t stride{ sizeof(PNTVertex) };
    uint32_t offset{ 0 };

    ID3D11Buffer* vertexBuffer{ m_vertexBuffer.get() };
    context->IASetVertexBuffers(0, 1, &vertexBuffer, &stride, &offset);
    context->IASetIndexBuffer(m_indexBuffer.get(), DXGI_FORMAT_R16_UINT, 0);
    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->DrawIndexed(m_indexCount, 0, 0);
}

Member Data Documentation

winrt::com_ptr<ID3D11Buffer> m_indexBuffer [protected]

Definition at line 35 of file MeshObject.h.

int m_indexCount [protected]

Definition at line 33 of file MeshObject.h.

winrt::com_ptr<ID3D11Buffer> m_vertexBuffer [protected]

Definition at line 34 of file MeshObject.h.

int m_vertexCount [protected]

Definition at line 32 of file MeshObject.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/MeshObject.h
  • Simple3DGameDX/cppwinrt/GameContent/MeshObject.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: METERING_CONTEXT Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

METERING_CONTEXT Struct Reference

#include "RpcServer.h"

List of all members.

Public Attributes

RpcServer::Metering * metering

Detailed Description

Definition at line 7 of file RpcServer.h.

Member Data Documentation

RpcServer::Metering* metering

Definition at line 9 of file RpcServer.h.

The documentation for this struct was generated from the following file:
  • CustomCapability/Service/Server/RpcServer.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PoseTrackingEntityData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MFPoseTrackingPreview
  • PoseTrackingEntityData
Public Attributes

PoseTrackingEntityData Struct Reference

#include "MFPoseTrackingFrame.h"

List of all members.

Public Attributes

uint32_t | DataSizeInBytes
GUID | EntityId
bool | IsTracked
TrackedPose | Poses [1]
uint32_t | PosesCount
GUID | PoseSet

Detailed Description

Definition at line 93 of file MFPoseTrackingFrame.h.

Member Data Documentation

uint32_t DataSizeInBytes

Definition at line 95 of file MFPoseTrackingFrame.h.

GUID EntityId

Definition at line 96 of file MFPoseTrackingFrame.h.

bool IsTracked

Definition at line 99 of file MFPoseTrackingFrame.h.

TrackedPose Poses[1]

Definition at line 100 of file MFPoseTrackingFrame.h.

uint32_t PosesCount

Definition at line 98 of file MFPoseTrackingFrame.h.

GUID PoseSet

Definition at line 97 of file MFPoseTrackingFrame.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/MFPoseTrackingFrame.h
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PoseTrackingFrameHeader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MFPoseTrackingPreview
  • PoseTrackingFrameHeader
Public Attributes

PoseTrackingFrameHeader Struct Reference

#include "MFPoseTrackingFrame.h"

List of all members.

Public Attributes

GUID | CustomDataTypeGuid
uint32_t | EntitiesCount
uint32_t | EntityOffsets [1]

Detailed Description

Definition at line 84 of file MFPoseTrackingFrame.h.

Member Data Documentation

GUID CustomDataTypeGuid

Definition at line 88 of file MFPoseTrackingFrame.h.

uint32_t EntitiesCount

Definition at line 89 of file MFPoseTrackingFrame.h.

uint32_t EntityOffsets[1]

Definition at line 90 of file MFPoseTrackingFrame.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/MFPoseTrackingFrame.h
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TrackedPose Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MFPoseTrackingPreview
  • TrackedPose
Public Attributes

TrackedPose Struct Reference

#include "MFPoseTrackingFrame.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::quaternion Orientation
TrackingStatus OrientationStatus
Windows::Foundation::Numerics::float3 Position
TrackingStatus PositionStatus

Detailed Description

Definition at line 54 of file MFPoseTrackingFrame.h.

Member Data Documentation

Windows::Foundation::Numerics::quaternion Orientation

Definition at line 58 of file MFPoseTrackingFrame.h.

TrackingStatus OrientationStatus

Definition at line 57 of file MFPoseTrackingFrame.h.

Windows::Foundation::Numerics::float3 Position

Definition at line 56 of file MFPoseTrackingFrame.h.

TrackingStatus PositionStatus

Definition at line 55 of file MFPoseTrackingFrame.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/MFPoseTrackingFrame.h
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FxCompile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Build
  • Tasks
  • FxCompile
Public Member Functions | Protected Member Functions | Properties | Private Attributes

FxCompile Class Reference

Task to support Fxc.exe. More...

List of all members.

Public Member Functions

FxCompile ()
FxCompile ()

Protected Member Functions

internal void | AddCommandLineCommands (CommandLineBuilderExtension commandLine)
internal void | AddCommandLineCommands (CommandLineBuilderExtension commandLine)
virtual internal void | AddResponseFileCommands (CommandLineBuilderExtension commandLine)
virtual internal void | AddResponseFileCommands (CommandLineBuilderExtension commandLine)
override string | GenerateCommandLineCommands ()
override string | GenerateCommandLineCommands ()
override string | GenerateFullPathToTool ()
override string | GenerateFullPathToTool ()
override string | GenerateResponseFileCommands ()
override string | GenerateResponseFileCommands ()
internal bool | GetBoolParameterWithDefault (string parameterName, bool defaultValue)
internal bool | GetBoolParameterWithDefault (string parameterName, bool defaultValue)

Properties

virtual string[] | AdditionalIncludeDirectories [get, set]
virtual string | AssemblerOutput [get, set]
virtual string | AssemblerOutputFile [get, set]
internal Hashtable | Bag [get]
virtual bool | DisableOptimizations [get, set]
virtual bool | EnableDebuggingInformation [get, set]
virtual string | EntryPointName [get, set]
virtual string | HeaderFileOutput [get, set]
virtual string | ObjectFileOutput [get, set]
virtual string[] | PreprocessorDefinitions [get, set]
string | SdkToolsPath [get, set]
virtual string | ShaderModel [get, set]
virtual string | ShaderType [get, set]
virtual ITaskItem[] | Source [get, set]
virtual bool | SuppressStartupBanner [get, set]
override string | ToolName [get]
virtual bool | TreatWarningAsError [get, set]
virtual string | VariableName [get, set]

Private Attributes

Hashtable | bag = new Hashtable()

Detailed Description

Definition at line 21 of file FxCompile.cs.

Constructor & Destructor Documentation

FxCompile ( ) [inline]

Constructor.

Definition at line 26 of file FxCompile.cs.

        {
            // Because FxCop wants it this way.
        }

FxCompile ( ) [inline]

Constructor.

Definition at line 26 of file FxCompile.cs.

        {
            // Because FxCop wants it this way.
        }

Member Function Documentation

internal void AddCommandLineCommands ( CommandLineBuilderExtension commandLine ) [inline, protected]

Add Command Line Commands.

Parameters:
commandLine CommandLineBuilderExtension

Definition at line 309 of file FxCompile.cs.

        {
            //// Order of these affect the order of the command line

            commandLine.AppendSwitchIfNotNull("/I ", AdditionalIncludeDirectories, "");
            commandLine.AppendSwitch(SuppressStartupBanner ? "/nologo" : String.Empty);
            commandLine.AppendSwitchIfNotNull("/E", EntryPointName);
            commandLine.AppendSwitch(TreatWarningAsError ? "/WX" : String.Empty);

            // Switch cannot be null
            if (ShaderType != null && ShaderModel != null)
            {
                // shader Model and Type are one switch
                commandLine.AppendSwitch(ShaderType + "_" + ShaderModel);
            }

            commandLine.AppendSwitchIfNotNull("/D ", PreprocessorDefinitions, "");
            commandLine.AppendSwitchIfNotNull("/Fh ", HeaderFileOutput);
            commandLine.AppendSwitchIfNotNull("/Fo ", ObjectFileOutput);

            // Switch cannot be null
            if (AssemblerOutput != null)
            {
                commandLine.AppendSwitchIfNotNull(AssemblerOutput, AssemblerOutputFile);
            }

            commandLine.AppendSwitchIfNotNull("/Vn ", VariableName);
            commandLine.AppendSwitch(DisableOptimizations ? "/Od" : String.Empty);
            commandLine.AppendSwitch(EnableDebuggingInformation ? "/Zi" : String.Empty);

            commandLine.AppendSwitchIfNotNull("", Source, " ");
        }

internal void AddCommandLineCommands ( CommandLineBuilderExtension commandLine ) [inline, protected]

Add Command Line Commands.

Parameters:
commandLine CommandLineBuilderExtension

Definition at line 309 of file FxCompile.cs.

        {
            //// Order of these affect the order of the command line

            commandLine.AppendSwitchIfNotNull("/I ", AdditionalIncludeDirectories, "");
            commandLine.AppendSwitch(SuppressStartupBanner ? "/nologo" : String.Empty);
            commandLine.AppendSwitchIfNotNull("/E", EntryPointName);
            commandLine.AppendSwitch(TreatWarningAsError ? "/WX" : String.Empty);

            // Switch cannot be null
            if (ShaderType != null && ShaderModel != null)
            {
                // shader Model and Type are one switch
                commandLine.AppendSwitch(ShaderType + "_" + ShaderModel);
            }

            commandLine.AppendSwitchIfNotNull("/D ", PreprocessorDefinitions, "");
            commandLine.AppendSwitchIfNotNull("/Fh ", HeaderFileOutput);
            commandLine.AppendSwitchIfNotNull("/Fo ", ObjectFileOutput);

            // Switch cannot be null
            if (AssemblerOutput != null)
            {
                commandLine.AppendSwitchIfNotNull(AssemblerOutput, AssemblerOutputFile);
            }

            commandLine.AppendSwitchIfNotNull("/Vn ", VariableName);
            commandLine.AppendSwitch(DisableOptimizations ? "/Od" : String.Empty);
            commandLine.AppendSwitch(EnableDebuggingInformation ? "/Zi" : String.Empty);

            commandLine.AppendSwitchIfNotNull("", Source, " ");
        }

virtual internal void AddResponseFileCommands ( CommandLineBuilderExtension commandLine ) [inline, protected, virtual]

Fills the provided CommandLineBuilderExtension with those switches and other information that can go into a response file.

Parameters:
commandLine

Definition at line 301 of file FxCompile.cs.

        {
        }

virtual internal void AddResponseFileCommands ( CommandLineBuilderExtension commandLine ) [inline, protected, virtual]

Fills the provided CommandLineBuilderExtension with those switches and other information that can go into a response file.

Parameters:
commandLine

Definition at line 301 of file FxCompile.cs.

        {
        }

override string GenerateCommandLineCommands ( ) [inline, protected]

Returns a string with those switches and other information that can't go into a response file and must go directly onto the command line.

Called after ValidateParameters and SkipTaskExecution

Returns:

Definition at line 276 of file FxCompile.cs.

        {
            CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
            AddCommandLineCommands(commandLineBuilder);
            return commandLineBuilder.ToString();
        }

override string GenerateCommandLineCommands ( ) [inline, protected]

Returns a string with those switches and other information that can't go into a response file and must go directly onto the command line.

Called after ValidateParameters and SkipTaskExecution

Returns:

Definition at line 276 of file FxCompile.cs.

        {
            CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
            AddCommandLineCommands(commandLineBuilder);
            return commandLineBuilder.ToString();
        }

override string GenerateFullPathToTool ( ) [inline, protected]

Fullpath to the fxc.exe.

Returns:
Fullpath to fxc.exe, if found. Otherwise empty or null.

Definition at line 346 of file FxCompile.cs.

        {
            return System.IO.Path.Combine(SdkToolsPath, ToolName);
        }

override string GenerateFullPathToTool ( ) [inline, protected]

Fullpath to the fxc.exe.

Returns:
Fullpath to fxc.exe, if found. Otherwise empty or null.

Definition at line 346 of file FxCompile.cs.

        {
            return System.IO.Path.Combine(SdkToolsPath, ToolName);
        }

override string GenerateResponseFileCommands ( ) [inline, protected]

Returns the command line switch used by the tool executable to specify the response file Will only be called if the task returned a non empty string from GetResponseFileCommands Called after ValidateParameters, SkipTaskExecution and GetResponseFileCommands.

Parameters:
responseFilePath full path to the temporarily created response file
Returns:

Definition at line 290 of file FxCompile.cs.

        {
            CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
            AddResponseFileCommands(commandLineBuilder);
            return commandLineBuilder.ToString();
        }

override string GenerateResponseFileCommands ( ) [inline, protected]

Returns the command line switch used by the tool executable to specify the response file Will only be called if the task returned a non empty string from GetResponseFileCommands Called after ValidateParameters, SkipTaskExecution and GetResponseFileCommands.

Parameters:
responseFilePath full path to the temporarily created response file
Returns:

Definition at line 290 of file FxCompile.cs.

        {
            CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
            AddResponseFileCommands(commandLineBuilder);
            return commandLineBuilder.ToString();
        }

internal bool GetBoolParameterWithDefault | ( | string | parameterName,
 |  | bool | defaultValue |
 | ) |  |  | [inline, protected]

Get a bool parameter and return a default if its not present in the hash table.

Parameters:
parameters
parameterName
defaultValue
Returns:

<owner>JomoF</owner>

Definition at line 360 of file FxCompile.cs.

        {
            object obj = bag[parameterName];
            return (obj == null) ? defaultValue : (bool) obj;
        }

internal bool GetBoolParameterWithDefault | ( | string | parameterName,
 |  | bool | defaultValue |
 | ) |  |  | [inline, protected]

Get a bool parameter and return a default if its not present in the hash table.

Parameters:
parameters
parameterName
defaultValue
Returns:

<owner>JomoF</owner>

Definition at line 360 of file FxCompile.cs.

        {
            object obj = bag[parameterName];
            return (obj == null) ? defaultValue : (bool) obj;
        }

Member Data Documentation

Hashtable bag = new Hashtable() [private]

Definition at line 56 of file FxCompile.cs.

Property Documentation

virtual string [] AdditionalIncludeDirectories [get, set]

Specifies one or more directories to add to the include path; separate with semi-colons if more than one.

(/I[path])

Definition at line 201 of file FxCompile.cs.

string AssemblerOutput [get, set]

AssemblerOutput, requires AssemblerOutputFile Specifies the contents of assembly language output file.

(/Fc, /Fx)

Consider using one of these: "Assembly Code" or "Assembly Code and Hex".

Definition at line 126 of file FxCompile.cs.

string AssemblerOutputFile [get, set]

AssemblerOutputFile, requires AssemblerOutput Specifies file name for assembly code listing file.

Definition at line 156 of file FxCompile.cs.

internal Hashtable Bag [get, protected]

Gets the collection of parameters used by the derived task class.

Parameter bag.

Definition at line 49 of file FxCompile.cs.

bool DisableOptimizations [get, set]

Disable optimizations.

/Od implies /Gfp though output may not be identical to /Od /Gfp.

Definition at line 237 of file FxCompile.cs.

bool EnableDebuggingInformation [get, set]

Enable debugging information.

Definition at line 246 of file FxCompile.cs.

string EntryPointName [get, set]

Specifies the name of the entry point for the shader (/E[name]).

Definition at line 219 of file FxCompile.cs.

string HeaderFileOutput [get, set]

Specifies a name for header file containing object code.

(/Fh [name])

Definition at line 174 of file FxCompile.cs.

string ObjectFileOutput [get, set]

Specifies a name for object file.

(/Fo [name])

Definition at line 183 of file FxCompile.cs.

virtual string [] PreprocessorDefinitions [get, set]

Defines preprocessing symbols for your source file.

Definition at line 192 of file FxCompile.cs.

string SdkToolsPath [get, set]

Path to Windows SDK.

Definition at line 255 of file FxCompile.cs.

string ShaderModel [get, set]

ShaderModel, requires ShaderType Specifies the shader model.

Some shader types can only be used with recent shader models (/T [type]_[model])

Definition at line 115 of file FxCompile.cs.

string ShaderType [get, set]

ShaderType, requires ShaderModel Specifies the type of shader.

(/T [type]_[model])

Consider using one of these: "NotSet", "Effect", "Vertex", "Pixel", "Geometry", "Hull", "Domain", "Compute", or "Texture".

Definition at line 64 of file FxCompile.cs.

virtual ITaskItem [] Source [get, set]

Sources to be compiled.

Required for task to run.

Definition at line 39 of file FxCompile.cs.

bool SuppressStartupBanner [get, set]

Suppresses the display of the startup banner and information message.

(/nologo)

Definition at line 210 of file FxCompile.cs.

override string ToolName [get, protected]

Name to Fxc.exe.

Definition at line 264 of file FxCompile.cs.

bool TreatWarningAsError [get, set]

Treats all compiler warnings as errors.

For a new project, it may be best to use /WX in all compilations; resolving all warnings will ensure the fewest possible hard-to-find code defects.

Definition at line 228 of file FxCompile.cs.

string VariableName [get, set]

Specifies a name for the variable name in the header file (/Vn [name]).

Definition at line 165 of file FxCompile.cs.

The documentation for this class was generated from the following files:
  • 360VideoPlayback/cs/FxCompile.cs
  • BasicHologram/cs/FxCompile.cs
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CBaseAttributes< TBase > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • Common
  • CBaseAttributes< TBase >
Public Member Functions | Protected Member Functions | Protected Attributes

CBaseAttributes< TBase > Class Template Reference

#include "BaseAttributes.h"

List of all members.

Public Member Functions

STDMETHODIMP | Compare (IMFAttributes *pTheirs, MF_ATTRIBUTES_MATCH_TYPE MatchType, BOOL *pbResult)
STDMETHODIMP | CompareItem (REFGUID guidKey, REFPROPVARIANT Value, BOOL *pbResult)
STDMETHODIMP | CopyAllItems (IMFAttributes *pDest)
STDMETHODIMP | DeleteAllItems ()
STDMETHODIMP | DeleteItem (REFGUID guidKey)
HRESULT | DeserializeFromBlob (const UINT8 *pBuffer, UINT cbSize)
HRESULT | DeserializeFromStream (DWORD dwOptions, IStream *pStm)
STDMETHODIMP | GetAllocatedBlob (REFGUID guidKey, UINT8 **ppBuf, UINT32 *pcbSize)
STDMETHODIMP | GetAllocatedString (REFGUID guidKey, LPWSTR *ppwszValue, UINT32 *pcchLength)
STDMETHODIMP | GetBlob (REFGUID guidKey, UINT8 *pBuf, UINT32 cbBufSize, UINT32 *pcbBlobSize)
STDMETHODIMP | GetBlobSize (REFGUID guidKey, UINT32 *pcbBlobSize)
STDMETHODIMP | GetCount (UINT32 *pcItems)
STDMETHODIMP | GetDouble (REFGUID guidKey, double *pfValue)
STDMETHODIMP | GetGUID (REFGUID guidKey, GUID *pguidValue)
STDMETHODIMP | GetItem (REFGUID guidKey, PROPVARIANT *pValue)
STDMETHODIMP | GetItemByIndex (UINT32 unIndex, GUID *pguidKey, PROPVARIANT *pValue)
STDMETHODIMP | GetItemType (REFGUID guidKey, MF_ATTRIBUTE_TYPE *pType)
HRESULT | GetRatio (REFGUID guidKey, UINT32 *pnNumerator, UINT32 *punDenominator)
HRESULT | GetSize (REFGUID guidKey, UINT32 *punWidth, UINT32 *punHeight)
STDMETHODIMP | GetString (REFGUID guidKey, LPWSTR pwszValue, UINT32 cchBufSize, UINT32 *pcchLength)
STDMETHODIMP | GetStringLength (REFGUID guidKey, UINT32 *pcchLength)
STDMETHODIMP | GetUINT32 (REFGUID guidKey, UINT32 *punValue)
STDMETHODIMP | GetUINT64 (REFGUID guidKey, UINT64 *punValue)
STDMETHODIMP | GetUnknown (REFGUID guidKey, REFIID riid, LPVOID *ppv)
STDMETHODIMP | LockStore ()
HRESULT | SerializeToBlob (UINT8 **ppBuffer, UINT *pcbSize)
HRESULT | SerializeToStream (DWORD dwOptions, IStream *pStm)
STDMETHODIMP | SetBlob (REFGUID guidKey, const UINT8 *pBuf, UINT32 cbBufSize)
STDMETHODIMP | SetDouble (REFGUID guidKey, double fValue)
STDMETHODIMP | SetGUID (REFGUID guidKey, REFGUID guidValue)
STDMETHODIMP | SetItem (REFGUID guidKey, REFPROPVARIANT Value)
HRESULT | SetRatio (REFGUID guidKey, UINT32 unNumerator, UINT32 unDenominator)
HRESULT | SetSize (REFGUID guidKey, UINT32 unWidth, UINT32 unHeight)
STDMETHODIMP | SetString (REFGUID guidKey, LPCWSTR wszValue)
STDMETHODIMP | SetUINT32 (REFGUID guidKey, UINT32 unValue)
STDMETHODIMP | SetUINT64 (REFGUID guidKey, UINT64 unValue)
STDMETHODIMP | SetUnknown (REFGUID guidKey, IUnknown *pUnknown)
STDMETHODIMP | UnlockStore ()

Protected Member Functions

CBaseAttributes ()
CBaseAttributes (HRESULT &hr, UINT32 cInitialSize=0)
CBaseAttributes (HRESULT &hr, IUnknown *pUnk)
virtual | ~CBaseAttributes ()
HRESULT | Initialize (UINT32 cInitialSize=0)
HRESULT | Initialize (IUnknown *pUnk)

Protected Attributes

ComPtr< IMFAttributes > | _spAttributes

Detailed Description

template<class TBase = IMFAttributes>
class Microsoft::Samples::Common::CBaseAttributes< TBase >

Definition at line 13 of file BaseAttributes.h.

Constructor & Destructor Documentation

CBaseAttributes ( ) [inline, protected]

Definition at line 19 of file BaseAttributes.h.

        {
        }

CBaseAttributes | ( | HRESULT & | hr,
 |  | UINT32 | cInitialSize = 0 |
 | ) |  |  | [inline, protected]

Definition at line 27 of file BaseAttributes.h.

        {
            hr = Initialize(cInitialSize);
        }

CBaseAttributes | ( | HRESULT & | hr,
 |  | IUnknown * | pUnk |
 | ) |  |  | [inline, protected]

Definition at line 39 of file BaseAttributes.h.

        {
            hr = Initialize(pUnk);
        }

virtual ~CBaseAttributes ( ) [inline, protected, virtual]

Definition at line 44 of file BaseAttributes.h.

        {
        }

Member Function Documentation

STDMETHODIMP Compare | ( | IMFAttributes * | pTheirs,
 |  | MF_ATTRIBUTES_MATCH_TYPE | MatchType,
 |  | BOOL * | pbResult |
 | ) |  |  | [inline]

Definition at line 97 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->Compare(pTheirs, MatchType, pbResult);
        }

STDMETHODIMP CompareItem | ( | REFGUID | guidKey,
 |  | REFPROPVARIANT | Value,
 |  | BOOL * | pbResult |
 | ) |  |  | [inline]

Definition at line 91 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->CompareItem(guidKey, Value, pbResult);
        }

STDMETHODIMP CopyAllItems ( IMFAttributes * pDest ) [inline]

Definition at line 257 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->CopyAllItems(pDest);
        }

STDMETHODIMP DeleteAllItems ( ) [inline]

Definition at line 185 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->DeleteAllItems();
        }

STDMETHODIMP DeleteItem ( REFGUID guidKey ) [inline]

Definition at line 179 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->DeleteItem(guidKey);
        }

HRESULT DeserializeFromBlob | ( | const UINT8 * | pBuffer,
 |  | UINT | cbSize |
 | ) |  |  | [inline]

Definition at line 324 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFInitAttributesFromBlob(_spAttributes.Get(), pBuffer, cbSize);
        }

HRESULT DeserializeFromStream | ( | DWORD | dwOptions,
 |  | IStream * | pStm |
 | ) |  |  | [inline]

Definition at line 272 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFDeserializeAttributesFromStream(_spAttributes.Get(), dwOptions, pStm);
        }

STDMETHODIMP GetAllocatedBlob | ( | REFGUID | guidKey,
 |  | UINT8 ** | ppBuf,
 |  | UINT32 * | pcbSize |
 | ) |  |  | [inline]

Definition at line 161 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetAllocatedBlob(guidKey, ppBuf, pcbSize);
        }

STDMETHODIMP GetAllocatedString | ( | REFGUID | guidKey,
 |  | LPWSTR * | ppwszValue,
 |  | UINT32 * | pcchLength |
 | ) |  |  | [inline]

Definition at line 143 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetAllocatedString(guidKey, ppwszValue, pcchLength);
        }

STDMETHODIMP GetBlob | ( | REFGUID | guidKey,
 |  | UINT8 * | pBuf,
 |  | UINT32 | cbBufSize,
 |  | UINT32 * | pcbBlobSize |
 | ) |  |  | [inline]

Definition at line 155 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetBlob(guidKey, pBuf, cbBufSize, pcbBlobSize);
        }

STDMETHODIMP GetBlobSize | ( | REFGUID | guidKey,
 |  | UINT32 * | pcbBlobSize |
 | ) |  |  | [inline]

Definition at line 149 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetBlobSize(guidKey, pcbBlobSize);
        }

STDMETHODIMP GetCount ( UINT32 * pcItems ) [inline]

Definition at line 245 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetCount(pcItems);
        }

STDMETHODIMP GetDouble | ( | REFGUID | guidKey,
 |  | double * | pfValue |
 | ) |  |  | [inline]

Definition at line 119 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetDouble(guidKey, pfValue);
        }

STDMETHODIMP GetGUID | ( | REFGUID | guidKey,
 |  | GUID * | pguidValue |
 | ) |  |  | [inline]

Definition at line 125 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetGUID(guidKey, pguidValue);
        }

STDMETHODIMP GetItem | ( | REFGUID | guidKey,
 |  | PROPVARIANT * | pValue |
 | ) |  |  | [inline]

Definition at line 79 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetItem(guidKey, pValue);
        }

STDMETHODIMP GetItemByIndex | ( | UINT32 | unIndex,
 |  | GUID * | pguidKey,
 |  | PROPVARIANT * | pValue |
 | ) |  |  | [inline]

Definition at line 251 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetItemByIndex(unIndex, pguidKey, pValue);
        }

STDMETHODIMP GetItemType | ( | REFGUID | guidKey,
 |  | MF_ATTRIBUTE_TYPE * | pType |
 | ) |  |  | [inline]

Definition at line 85 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetItemType(guidKey, pType);
        }

HRESULT GetRatio | ( | REFGUID | guidKey,
 |  | UINT32 * | pnNumerator,
 |  | UINT32 * | punDenominator |
 | ) |  |  | [inline]

Definition at line 330 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFGetAttributeRatio(_spAttributes.Get(), guidKey, pnNumerator, punDenominator);
        }

HRESULT GetSize | ( | REFGUID | guidKey,
 |  | UINT32 * | punWidth,
 |  | UINT32 * | punHeight |
 | ) |  |  | [inline]

Definition at line 343 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFGetAttributeSize(_spAttributes.Get(), guidKey, punWidth, punHeight);
        }

STDMETHODIMP GetString | ( | REFGUID | guidKey,
 |  | LPWSTR | pwszValue,
 |  | UINT32 | cchBufSize,
 |  | UINT32 * | pcchLength |
 | ) |  |  | [inline]

Definition at line 137 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetString(guidKey, pwszValue, cchBufSize, pcchLength);
        }

STDMETHODIMP GetStringLength | ( | REFGUID | guidKey,
 |  | UINT32 * | pcchLength |
 | ) |  |  | [inline]

Definition at line 131 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetStringLength(guidKey, pcchLength);
        }

STDMETHODIMP GetUINT32 | ( | REFGUID | guidKey,
 |  | UINT32 * | punValue |
 | ) |  |  | [inline]

Definition at line 107 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetUINT32(guidKey, punValue);
        }

STDMETHODIMP GetUINT64 | ( | REFGUID | guidKey,
 |  | UINT64 * | punValue |
 | ) |  |  | [inline]

Definition at line 113 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetUINT64(guidKey, punValue);
        }

STDMETHODIMP GetUnknown | ( | REFGUID | guidKey,
 |  | REFIID | riid,
 |  | LPVOID * | ppv |
 | ) |  |  | [inline]

Definition at line 167 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->GetUnknown(guidKey, riid, ppv);
        }

HRESULT Initialize ( IUnknown * pUnk ) [inline, protected]

Definition at line 63 of file BaseAttributes.h.

        {
            if (_spAttributes)
            {
                _spAttributes->Release();
                _spAttributes = NULL;
            }

            return pUnk->QueryInterface(IID_PPV_ARGS(&_spAttributes));
        }

HRESULT Initialize ( UINT32 cInitialSize = 0 ) [inline, protected]

Definition at line 49 of file BaseAttributes.h.

        {
            if (_spAttributes.Get() == nullptr)
            {
                return MFCreateAttributes(&_spAttributes, cInitialSize);
            }
            else
            {
                return S_OK;
            }
        }

STDMETHODIMP LockStore ( ) [inline]

Definition at line 233 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->LockStore();
        }

HRESULT SerializeToBlob | ( | UINT8 ** | ppBuffer,
 |  | UINT * | pcbSize |
 | ) |  |  | [inline]

Definition at line 284 of file BaseAttributes.h.

        {
            assert(_spAttributes);

            if (ppBuffer == NULL)
            {
                return E_POINTER;
            }
            if (pcbSize == NULL)
            {
                return E_POINTER;
            }

            HRESULT hr = S_OK;
            UINT32 cbSize = 0;
            BYTE *pBuffer = NULL;

            CHECK_HR(hr = MFGetAttributesAsBlobSize(_spAttributes.Get(), &cbSize));

            pBuffer = (BYTE*)CoTaskMemAlloc(cbSize);
            if (pBuffer == NULL)
            {
                CHECK_HR(hr = E_OUTOFMEMORY);
            }

            CHECK_HR(hr = MFGetAttributesAsBlob(_spAttributes.Get(), pBuffer, cbSize));

            *ppBuffer = pBuffer;
            *pcbSize = cbSize;

    done:
            if (FAILED(hr))
            {
                *ppBuffer = NULL;
                *pcbSize = 0;
                CoTaskMemFree(pBuffer);
            }
            return hr;
        }

HRESULT SerializeToStream | ( | DWORD | dwOptions,
 |  | IStream * | pStm |
 | ) |  |  | [inline]

Definition at line 265 of file BaseAttributes.h.

                        : Flags from MF_ATTRIBUTE_SERIALIZE_OPTIONS
        {
            assert(_spAttributes);
            return MFSerializeAttributesToStream(_spAttributes.Get(), dwOptions, pStm);
        }

STDMETHODIMP SetBlob | ( | REFGUID | guidKey,
 |  | const UINT8 * | pBuf,
 |  | UINT32 | cbBufSize |
 | ) |  |  | [inline]

Definition at line 221 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetBlob(guidKey, pBuf, cbBufSize);
        }

STDMETHODIMP SetDouble | ( | REFGUID | guidKey,
 |  | double | fValue |
 | ) |  |  | [inline]

Definition at line 203 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetDouble(guidKey, fValue);
        }

STDMETHODIMP SetGUID | ( | REFGUID | guidKey,
 |  | REFGUID | guidValue |
 | ) |  |  | [inline]

Definition at line 209 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetGUID(guidKey, guidValue);
        }

STDMETHODIMP SetItem | ( | REFGUID | guidKey,
 |  | REFPROPVARIANT | Value |
 | ) |  |  | [inline]

Definition at line 173 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetItem(guidKey, Value);
        }

HRESULT SetRatio | ( | REFGUID | guidKey,
 |  | UINT32 | unNumerator,
 |  | UINT32 | unDenominator |
 | ) |  |  | [inline]

Definition at line 336 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFSetAttributeRatio(_spAttributes.Get(), guidKey, unNumerator, unDenominator);
        }

HRESULT SetSize | ( | REFGUID | guidKey,
 |  | UINT32 | unWidth,
 |  | UINT32 | unHeight |
 | ) |  |  | [inline]

Definition at line 350 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return MFSetAttributeSize (_spAttributes.Get(), guidKey, unWidth, unHeight);
        }

STDMETHODIMP SetString | ( | REFGUID | guidKey,
 |  | LPCWSTR | wszValue |
 | ) |  |  | [inline]

Definition at line 215 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetString(guidKey, wszValue);
        }

STDMETHODIMP SetUINT32 | ( | REFGUID | guidKey,
 |  | UINT32 | unValue |
 | ) |  |  | [inline]

Definition at line 191 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetUINT32(guidKey, unValue);
        }

STDMETHODIMP SetUINT64 | ( | REFGUID | guidKey,
 |  | UINT64 | unValue |
 | ) |  |  | [inline]

Definition at line 197 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetUINT64(guidKey, unValue);
        }

STDMETHODIMP SetUnknown | ( | REFGUID | guidKey,
 |  | IUnknown * | pUnknown |
 | ) |  |  | [inline]

Definition at line 227 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->SetUnknown(guidKey, pUnknown);
        }

STDMETHODIMP UnlockStore ( ) [inline]

Definition at line 239 of file BaseAttributes.h.

        {
            assert(_spAttributes);
            return _spAttributes->UnlockStore();
        }

Member Data Documentation

ComPtr<IMFAttributes> _spAttributes [protected]

Definition at line 357 of file BaseAttributes.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BaseAttributes.h
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CalibrationBar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • Devices
  • Sensors
  • Calibration
  • CalibrationBar
Public Member Functions | Private Member Functions | Private Attributes

CalibrationBar Class Reference

List of all members.

Public Member Functions

CalibrationBar ()
void | Hide ()
void | RequestCalibration (MagnetometerAccuracy accuracy)

Private Member Functions

bool | CanShowCalibrationBar (MagnetometerAccuracy accuracy)
void | DismissPopup_Click (object sender, RoutedEventArgs e)
void | HideGuidance ()
void | HideGuidanceButton_Click (object sender, RoutedEventArgs e)
void | InvalidateLayout ()
void | OnAutoDismissTimerExpired (object sender, object e)
void | OnWindowSizeChanged (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
void | ShowGuidance ()
void | ShowGuidanceButton_Click (object sender, RoutedEventArgs e)

Private Attributes

bool | _barDismissed = false
DispatcherTimer | _calibrationTimer
DateTime | _lastCalibrationTime = new DateTime(0)
TimeSpan | CALIBRATION_POPUP_AUTO_DIMSMISS_TIME = new TimeSpan(0, 0, 30)
const double | LAYOUT_WIDTH_768 = 768.0
const double | SUPPRESS_DURATION_APPROXIMATE_MIN = 10.0
const double | SUPPRESS_DURATION_UNRELIABLE_MIN = 5.0

Detailed Description

Definition at line 30 of file CalibrationBar.xaml.cs.

Constructor & Destructor Documentation

CalibrationBar ( ) [inline]

Definition at line 47 of file CalibrationBar.xaml.cs.

        {
            this.InitializeComponent();
            _calibrationTimer = new DispatcherTimer();
            _calibrationTimer.Tick += OnAutoDismissTimerExpired;
            _calibrationTimer.Interval = CALIBRATION_POPUP_AUTO_DIMSMISS_TIME;
        }

Member Function Documentation

bool CanShowCalibrationBar ( MagnetometerAccuracy accuracy ) [inline, private]

Called to determine if sufficient time has passed since the calibration bar was hidden to show the calibration bar again.

This suppression time is dependent on the current sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 132 of file CalibrationBar.xaml.cs.

        {
            bool showBar = false;
            if (!_barDismissed)
            {
                if ((accuracy == MagnetometerAccuracy.Approximate) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_APPROXIMATE_MIN)) >= 0))
                {
                    showBar = true;
                }
                else if ((accuracy == MagnetometerAccuracy.Unreliable) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_UNRELIABLE_MIN)) >= 0))
                {
                    showBar = true;
                }
            }
            return showBar;
        }

void DismissPopup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the dismiss popup button.

It hides the calibration bar and prevents it from being shown again for the lifetime of the app.

Parameters:
sender
e

Definition at line 184 of file CalibrationBar.xaml.cs.

        {
            // Don't show the calibration bar again.
            _barDismissed = true;
            Hide();
        }

void Hide ( ) [inline]

Called when sensor accuracy is sufficient and the application would like to hide the calibration bar.

Definition at line 78 of file CalibrationBar.xaml.cs.

        {
            if (CalibrationPopup.IsOpen)
            {
                // Hide the calibration bar and save the current time.
                _lastCalibrationTime = DateTime.Now;
                HideGuidance();
                CalibrationPopup.IsOpen = false;
                Window.Current.SizeChanged -= OnWindowSizeChanged;
                _calibrationTimer.Stop();
            }
        }

void HideGuidance ( ) [inline, private]

Collapses the calibration bar to hide the calibration image from the user.

Parameters:
sender
e

Definition at line 208 of file CalibrationBar.xaml.cs.

        {
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

void HideGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the hide guidance button.

Parameters:
sender
e

Definition at line 169 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Visible)
            {
                HideGuidance();
            }
        }

void InvalidateLayout ( ) [inline, private]

Updates the calibration bar layout based on the current window width.

Definition at line 104 of file CalibrationBar.xaml.cs.

        {
            CalibrationGrid.Width = Window.Current.Bounds.Width;

            if (CalibrationGrid.Width < LAYOUT_WIDTH_768)
            {
                Grid.SetRow(DismissPopup, 1);
                Grid.SetColumn(DismissPopup, 1);

                CalibrationGridTop.Margin = new Thickness(0, 24, 20, 15);
                DismissPopup.Margin = new Thickness(66, 15, 0, 0);
            }
            else
            {
                Grid.SetRow(DismissPopup, 0);
                Grid.SetColumn(DismissPopup, 2);

                CalibrationGridTop.Margin = new Thickness(0, 19, 66, 19);
                DismissPopup.Margin = new Thickness(66, 0, 0, 0);
            }
        }

void OnAutoDismissTimerExpired | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is the handler for the auto dismiss timer.

After the calibraiton bar has been shown for the maximum time, it is automatically hidden.

Parameters:
sender
e

Definition at line 221 of file CalibrationBar.xaml.cs.

        {
            Hide();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | Windows.UI.Core.WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the window size is updated.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 96 of file CalibrationBar.xaml.cs.

        {
            InvalidateLayout();
        }

void RequestCalibration ( MagnetometerAccuracy accuracy ) [inline]

Called when the application would like to show the calibration bar to the user to improve sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 60 of file CalibrationBar.xaml.cs.

        {
            // Only show the calibration bar if it is hidden and sufficient
            // time has passed since it was last hidden.
            if (!CalibrationPopup.IsOpen && CanShowCalibrationBar(accuracy))
            {
                InvalidateLayout();
                Window.Current.SizeChanged += OnWindowSizeChanged;
                HideGuidance(); // Calibration image hidden by default
                CalibrationPopup.IsOpen = true;
                _calibrationTimer.Start();
            }
        }

void ShowGuidance ( ) [inline, private]

Expands the calibration bar to show the calibration image to the user.

Parameters:
sender
e

Definition at line 196 of file CalibrationBar.xaml.cs.

        {
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }

void ShowGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the show guidance button.

Parameters:
sender
e

Definition at line 156 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Collapsed)
            {
                ShowGuidance();
            }
        }

Member Data Documentation

bool _barDismissed = false [private]

Definition at line 44 of file CalibrationBar.xaml.cs.

DispatcherTimer _calibrationTimer [private]

Definition at line 45 of file CalibrationBar.xaml.cs.

DateTime _lastCalibrationTime = new DateTime(0) [private]

Definition at line 43 of file CalibrationBar.xaml.cs.

TimeSpan CALIBRATION_POPUP_AUTO_DIMSMISS_TIME = new TimeSpan(0, 0, 30) [private]

Definition at line 39 of file CalibrationBar.xaml.cs.

const double LAYOUT_WIDTH_768 = 768.0 [private]

Definition at line 41 of file CalibrationBar.xaml.cs.

const double SUPPRESS_DURATION_APPROXIMATE_MIN = 10.0 [private]

Definition at line 37 of file CalibrationBar.xaml.cs.

const double SUPPRESS_DURATION_UNRELIABLE_MIN = 5.0 [private]

Definition at line 38 of file CalibrationBar.xaml.cs.

The documentation for this class was generated from the following file:
  • Inclinometer/cs/CalibrationBar.xaml.cs
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMarker Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CMarker
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

CMarker Class Reference

#include "Marker.h"

List of all members.

Public Member Functions

IFACEMETHOD() | GetContext (PROPVARIANT *pvar)
IFACEMETHOD() | GetMarkerType (MFSTREAMSINK_MARKER_TYPE *pType)
IFACEMETHOD() | GetMarkerValue (PROPVARIANT *pvar)
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD_ (ULONG, Release)()
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)

Static Public Member Functions

static HRESULT | Create (MFSTREAMSINK_MARKER_TYPE eMarkerType, const PROPVARIANT *pvarMarkerValue, const PROPVARIANT *pvarContextValue, IMarker **ppMarker)

Protected Attributes

MFSTREAMSINK_MARKER_TYPE | _eMarkerType
PROPVARIANT | _varContextValue
PROPVARIANT | _varMarkerValue

Private Member Functions

CMarker (MFSTREAMSINK_MARKER_TYPE eMarkerType)
virtual | ~CMarker ()

Private Attributes

long | _cRef

Detailed Description

Definition at line 12 of file Marker.h.

Constructor & Destructor Documentation

CMarker ( MFSTREAMSINK_MARKER_TYPE eMarkerType ) [private]

Definition at line 23 of file Marker.cpp.

                                                     : _cRef(1), _eMarkerType(eMarkerType)
{
    ZeroMemory(&_varMarkerValue, sizeof(_varMarkerValue));
    ZeroMemory(&_varContextValue, sizeof(_varContextValue));
}

~CMarker ( ) [private, virtual]

Definition at line 29 of file Marker.cpp.

{
    assert(_cRef == 0);

    PropVariantClear(&_varMarkerValue);
    PropVariantClear(&_varContextValue);
}

Member Function Documentation

HRESULT Create | ( | MFSTREAMSINK_MARKER_TYPE | eMarkerType,
 |  | const PROPVARIANT * | pvarMarkerValue,
 |  | const PROPVARIANT * | pvarContextValue,
 |  | IMarker ** | ppMarker |
 | ) |  |  | [static]

Definition at line 38 of file Marker.cpp.

{
    if (ppMarker == nullptr)
    {
        return E_POINTER;
    }

    HRESULT hr = S_OK;
    ComPtr<CMarker> spMarker;

    spMarker.Attach(new (std::nothrow) CMarker(eMarkerType));

    if (spMarker == nullptr)
    {
        hr = E_OUTOFMEMORY;
    }

    // Copy the marker data.
    if (SUCCEEDED(hr))
    {
        if (pvarMarkerValue)
        {
            hr = PropVariantCopy(&spMarker->_varMarkerValue, pvarMarkerValue);
        }
    }

    if (SUCCEEDED(hr))
    {
        if (pvarContextValue)
        {
            hr = PropVariantCopy(&spMarker->_varContextValue, pvarContextValue);
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppMarker = spMarker.Detach();
    }

    return hr;
}

IFACEMETHODIMP GetContext ( PROPVARIANT * pvar )

Definition at line 146 of file Marker.cpp.

{
    if (pvar == NULL)
    {
        return E_POINTER;
    }
    return PropVariantCopy(pvar, &_varContextValue);
}

IFACEMETHODIMP GetMarkerType ( MFSTREAMSINK_MARKER_TYPE * pType )

Definition at line 126 of file Marker.cpp.

{
    if (pType == NULL)
    {
        return E_POINTER;
    }

    *pType = _eMarkerType;
    return S_OK;
}

IFACEMETHODIMP GetMarkerValue ( PROPVARIANT * pvar )

Definition at line 137 of file Marker.cpp.

{
    if (pvar == NULL)
    {
        return E_POINTER;
    }
    return PropVariantCopy(pvar, &_varMarkerValue);

}

IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 103 of file Marker.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown || riid == __uuidof(IMarker))
    {
        (*ppv) = static_cast<IMarker*>(this);
        AddRef();
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    return hr;
}

Member Data Documentation

long _cRef [private]

Definition at line 37 of file Marker.h.

MFSTREAMSINK_MARKER_TYPE _eMarkerType [protected]

Definition at line 32 of file Marker.h.

PROPVARIANT _varContextValue [protected]

Definition at line 34 of file Marker.h.

PROPVARIANT _varMarkerValue [protected]

Definition at line 33 of file Marker.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.cpp
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMediaSink Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CMediaSink
Private Types | Private Member Functions | Private Attributes

CMediaSink Class Reference

#include "StspMediaSink.h"

Inherits CBaseAttributes<>.

List of all members.

Private Types

typedef ComPtrList< IMFStreamSink > | StreamContainer

Private Member Functions

InspectableClass(L"Microsoft::Samples::SimpleCommunication::StspMediaSink",
BaseTrust) public 		~CMediaSink ()
IFACEMETHOD() | AddStreamSink (DWORD dwStreamSinkIdentifier, IMFMediaType *pMediaType, IMFStreamSink **ppStreamSink)
HRESULT | CheckShutdown () const
ComPtr
< Network::IMediaBufferWrapper > 		FillStreamDescription (CStreamSink *pStream, StspStreamDescription *pStreamDescription)
IFACEMETHOD() | GetCharacteristics (DWORD *pdwCharacteristics)
IFACEMETHOD() | GetPresentationClock (IMFPresentationClock **ppPresentationClock)
LONGLONG | GetStartTime () const
IFACEMETHOD() | GetStreamSinkById (DWORD dwIdentifier, IMFStreamSink **ppStreamSink)
IFACEMETHOD() | GetStreamSinkByIndex (DWORD dwIndex, _Outptr_ IMFStreamSink **ppStreamSink)
IFACEMETHOD() | GetStreamSinkCount (_Out_ DWORD *pcStreamSinkCount)
void | HandleError (HRESULT hr)
IFACEMETHOD() | OnClockPause (MFTIME hnsSystemTime)
IFACEMETHOD() | OnClockRestart (MFTIME hnsSystemTime)
IFACEMETHOD() | OnClockSetRate (MFTIME hnsSystemTime, float flRate)
IFACEMETHOD() | OnClockStart (MFTIME hnsSystemTime, LONGLONG llClockStartOffset)
IFACEMETHOD() | OnClockStop (MFTIME hnsSystemTime)
String | PrepareRemoteUrl (StreamSocketInformation^info)
IFACEMETHOD() | RemoveStreamSink (DWORD dwStreamSinkIdentifier)
void | ReportEndOfStream ()
void | ReportFormatChange (DWORD streamId)
HRESULT | RuntimeClassInitialize (ISinkCallback^callback, Windows::Media::MediaProperties::IMediaEncodingProperties^audioEncodingProperties, Windows::Media::MediaProperties::IMediaEncodingProperties^videoEncodingProperties)
void | SendDescription ()
concurrency::task< void > | SendPacket (Network::IBufferPacket *pPacket)
void | SetMediaStreamProperties (Windows::Media::Capture::MediaStreamType MediaStreamType, _In_opt_ Windows::Media::MediaProperties::IMediaEncodingProperties^mediaEncodingProperties)
IFACEMETHOD() | SetPresentationClock (IMFPresentationClock *pPresentationClock)
IFACEMETHOD() | SetProperties (ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration)
IFACEMETHOD() | Shutdown ()
void | StartListening ()
void | StartReceiving (Network::IMediaBufferWrapper *pReceiveBuffer)
void | TriggerAcceptConnection (DWORD connectionId)
void | TriggerRefuseConnection (DWORD connectionId)

Private Attributes

ISinkCallback _callback
long | _cRef
CritSec _critSec
long | _cStreamsEnded
bool | _IsConnected
bool | _IsShutdown
LONGLONG | _llStartTime
Network::INetworkChannel | _networkSender
String | _remoteUrl
ComPtr< IMFPresentationClock > | _spClock
ComPtr
< Network::IMediaBufferWrapper > 		_spReceiveBuffer
StreamContainer _streams
DWORD | _waitingConnectionId

Detailed Description

Definition at line 19 of file StspMediaSink.h.

Member Typedef Documentation

typedef ComPtrList<IMFStreamSink> StreamContainer [private]

Definition at line 77 of file StspMediaSink.h.

Constructor & Destructor Documentation

~CMediaSink ( ) [private]

Definition at line 198 of file StspMediaSink.cpp.

{
    assert(_IsShutdown);
}

Member Function Documentation

IFACEMETHODIMP AddStreamSink | ( | DWORD | dwStreamSinkIdentifier,
 |  | IMFMediaType * | pMediaType,
 |  | IMFStreamSink ** | ppStreamSink |
 | ) |  |  | [private]

Definition at line 350 of file StspMediaSink.cpp.

{
    CStreamSink *pStream = nullptr;
    ComPtr<IMFStreamSink> spMFStream;
    AutoLock lock(_critSec);
    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = GetStreamSinkById(dwStreamSinkIdentifier, &spMFStream);
    }

    if (SUCCEEDED(hr))
    {
        hr = MF_E_STREAMSINK_EXISTS;
    }
    else
    {
        hr = S_OK;
    }

    if (SUCCEEDED(hr))
    {
        pStream = new CStreamSink(dwStreamSinkIdentifier);
        if (pStream == nullptr)
        {
            hr = E_OUTOFMEMORY;
        }
        spMFStream.Attach(pStream);
    }

    // Initialize the stream.
    if (SUCCEEDED(hr))
    {
        hr = pStream->Initialize(this, _networkSender);
    }

    if (SUCCEEDED(hr) && pMediaType != nullptr)
    {
        hr = pStream->SetCurrentMediaType(pMediaType);
    }

    if (SUCCEEDED(hr))
    {
        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION posEnd = _streams.EndPosition();

        // Insert in proper position
        for (; pos != posEnd; pos = _streams.Next(pos))
        {
            DWORD dwCurrId;
            ComPtr<IMFStreamSink> spCurr;
            hr = _streams.GetItemPos(pos, &spCurr);
            if (FAILED(hr))
            {
                break;
            }
            hr = spCurr->GetIdentifier(&dwCurrId);
            if (FAILED(hr))
            {
                break;
            }

            if (dwCurrId > dwStreamSinkIdentifier)
            {
                break;
            }
        }

        if (SUCCEEDED(hr))
        {
            hr = _streams.InsertPos(pos, pStream);
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppStreamSink = spMFStream.Detach();
    }

    TRACEHR_RET(hr);
}

HRESULT CheckShutdown ( ) const [inline, private]

Definition at line 94 of file StspMediaSink.h.

    {
        if (_IsShutdown)
        {
            return MF_E_SHUTDOWN;
        }
        else
        {
            return S_OK;
        }
    }

ComPtr< Network::IMediaBufferWrapper > FillStreamDescription | ( | CStreamSink * | pStream,
 |  | StspStreamDescription * | pStreamDescription |
 | ) |  |  | [private]

Definition at line 965 of file StspMediaSink.cpp.

{
    assert(pStream != nullptr);
    assert(pStreamDescription != nullptr);

    ComPtr<IMFMediaType> spMediaType;

    // Get current media type
    ThrowIfError(pStream->GetCurrentMediaType(&spMediaType));

    return pStream->FillStreamDescription(spMediaType.Get(), pStreamDescription);
}

IFACEMETHODIMP GetCharacteristics ( DWORD * pdwCharacteristics ) [private]

IMFMediaSink.

Definition at line 331 of file StspMediaSink.cpp.

{
    if (pdwCharacteristics == NULL)
    {
        return E_INVALIDARG;
    }
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        // Rateless sink.
        *pdwCharacteristics = MEDIASINK_RATELESS;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetPresentationClock ( IMFPresentationClock ** ppPresentationClock ) [private]

Definition at line 637 of file StspMediaSink.cpp.

{
    if (ppPresentationClock == NULL)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_spClock == NULL)
        {
            hr = MF_E_NO_CLOCK; // There is no presentation clock.
        }
        else
        {
            // Return the pointer to the caller.
            *ppPresentationClock = _spClock.Get();
            (*ppPresentationClock)->AddRef();
        }
    }

    TRACEHR_RET(hr);
}

LONGLONG GetStartTime ( ) const [inline, private]

Definition at line 71 of file StspMediaSink.h.

{return _llStartTime;}

IFACEMETHODIMP GetStreamSinkById | ( | DWORD | dwIdentifier,
 |  | IMFStreamSink ** | ppStreamSink |
 | ) |  |  | [private]

Definition at line 546 of file StspMediaSink.cpp.

{
    if (ppStreamSink == NULL)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);
    HRESULT hr = CheckShutdown();
    ComPtr<IMFStreamSink> spResult;

    if (SUCCEEDED(hr))
    {
        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION endPos = _streams.EndPosition();

        for (;pos != endPos; pos = _streams.Next(pos))
        {
            ComPtr<IMFStreamSink> spStream;
            hr = _streams.GetItemPos(pos, &spStream);
            DWORD dwId;

            if (FAILED(hr))
            {
                break;
            }

            hr = spStream->GetIdentifier(&dwId);
            if (FAILED(hr))
            {
                break;
            }
            else if (dwId == dwStreamSinkIdentifier)
            {
                spResult = spStream;
                break;
            }
        }

        if (pos == endPos)
        {
            hr = MF_E_INVALIDSTREAMNUMBER;
        }
    }

    if (SUCCEEDED(hr))
    {
        assert(spResult);
        *ppStreamSink = spResult.Detach();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetStreamSinkByIndex | ( | DWORD | dwIndex,
 |  | _Outptr_ IMFStreamSink ** | ppStreamSink |
 | ) |  |  | [private]

Definition at line 497 of file StspMediaSink.cpp.

{
    if (ppStreamSink == NULL)
    {
        return E_INVALIDARG;
    }

    ComPtr<IMFStreamSink> spStream;
    AutoLock lock(_critSec);
    DWORD cStreams = _streams.GetCount();

    if (dwIndex >= cStreams)
    {
        return MF_E_INVALIDINDEX;
    }

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION endPos = _streams.EndPosition();
        DWORD dwCurrent = 0;

        for (;pos != endPos && dwCurrent < dwIndex; pos = _streams.Next(pos), ++dwCurrent)
        {
            // Just move to proper position
        }

        if (pos == endPos)
        {
            hr = MF_E_UNEXPECTED;
        }
        else
        {
            hr = _streams.GetItemPos(pos, &spStream);
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppStreamSink = spStream.Detach();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetStreamSinkCount ( _Out_ DWORD * pcStreamSinkCount ) [private]

Definition at line 478 of file StspMediaSink.cpp.

{
    if (pcStreamSinkCount == NULL)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *pcStreamSinkCount = _streams.GetCount();
    }

    TRACEHR_RET(hr);
}

void HandleError ( HRESULT hr ) [private]

Definition at line 978 of file StspMediaSink.cpp.

{
    Shutdown();
}

IFACEMETHODIMP OnClockPause ( MFTIME hnsSystemTime ) [private]

Definition at line 736 of file StspMediaSink.cpp.

{
    return MF_E_INVALID_STATE_TRANSITION;
}

IFACEMETHODIMP OnClockRestart ( MFTIME hnsSystemTime ) [private]

Definition at line 742 of file StspMediaSink.cpp.

{
    return MF_E_INVALID_STATE_TRANSITION;
}

IFACEMETHODIMP OnClockSetRate | ( | MFTIME | hnsSystemTime,
 |  | float | flRate |
 | ) |  |  | [private]

Definition at line 748 of file StspMediaSink.cpp.

{
    return S_OK;
}

IFACEMETHODIMP OnClockStart | ( | MFTIME | hnsSystemTime,
 |  | LONGLONG | llClockStartOffset |
 | ) |  |  | [private]

Definition at line 700 of file StspMediaSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        TRACE(TRACE_LEVEL_LOW, L"OnClockStart ts=%I64d\n", llClockStartOffset);
        // Start each stream.
        _llStartTime = llClockStartOffset;
        hr = ForEach(_streams, StartFunc(llClockStartOffset));
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP OnClockStop ( MFTIME hnsSystemTime ) [private]

Definition at line 719 of file StspMediaSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        // Stop each stream
        hr = ForEach(_streams, StopFunc());
    }

    TRACEHR_RET(hr);
}

String PrepareRemoteUrl ( StreamSocketInformation^ info ) [private]

Definition at line 983 of file StspMediaSink.cpp.

{
    WCHAR szBuffer[MAX_PATH];

    if ( info->RemoteHostName->Type == HostNameType::Ipv4 || info->RemoteHostName->Type == HostNameType::DomainName)
    {
        ThrowIfError(StringCchPrintf(szBuffer, _countof(szBuffer), L"%s://%s", c_szStspScheme, info->RemoteHostName->RawName->Data()));
    }
    else if (info->RemoteHostName->Type == HostNameType::Ipv6)
    {
        ThrowIfError(StringCchPrintf(szBuffer, _countof(szBuffer), L"%s://[%s]", c_szStspScheme, info->RemoteHostName->RawName->Data()));
    }
    else
    {
        throw ref new InvalidArgumentException();
    }

    return ref new String(szBuffer);
}

IFACEMETHODIMP RemoveStreamSink ( DWORD dwStreamSinkIdentifier ) [private]

Definition at line 436 of file StspMediaSink.cpp.

{
    AutoLock lock(_critSec);
    HRESULT hr = CheckShutdown();
    StreamContainer::POSITION pos = _streams.FrontPosition();
    StreamContainer::POSITION endPos = _streams.EndPosition();
    ComPtr<IMFStreamSink> spStream;

    if (SUCCEEDED(hr))
    {
        for (;pos != endPos; pos = _streams.Next(pos))
        {
            hr = _streams.GetItemPos(pos, &spStream);
            DWORD dwId;

            if (FAILED(hr))
            {
                break;
            }

            hr = spStream->GetIdentifier(&dwId);
            if (FAILED(hr) || dwId == dwStreamSinkIdentifier)
            {
                break;
            }
        }

        if (pos == endPos)
        {
            hr = MF_E_INVALIDSTREAMNUMBER;
        }
    }

    if (SUCCEEDED(hr))
    {
        hr = _streams.Remove(pos, nullptr);
        static_cast<CStreamSink *>(spStream.Get())->Shutdown();
    }

    TRACEHR_RET(hr);
}

void ReportEndOfStream ( ) [private]

Definition at line 755 of file StspMediaSink.cpp.

{
    AutoLock lock(_critSec);
    ++_cStreamsEnded;
}

void ReportFormatChange ( DWORD streamId ) [private]
HRESULT RuntimeClassInitialize | ( | ISinkCallback^ | callback,
 |  | Windows::Media::MediaProperties::IMediaEncodingProperties^ | audioEncodingProperties,
 |  | Windows::Media::MediaProperties::IMediaEncodingProperties^ | videoEncodingProperties |
 | ) |  |  | [private]

Definition at line 203 of file StspMediaSink.cpp.

{
    try
    {
        _callback = callback;
        // Create network server
        INetworkServer ^server = CreateNetworkServer(c_wStspDefaultPort);
        _networkSender = safe_cast<INetworkChannel^>(server);

        // Set up media streams
        SetMediaStreamProperties(MediaStreamType::Audio, audioEncodingProperties);
        SetMediaStreamProperties(MediaStreamType::VideoRecord, videoEncodingProperties);

        // Start listening from the connection from the client.
        StartListening();
    }
    catch (Exception ^exc)
    {
        _callback = nullptr;
        if (_networkSender != nullptr)
        {
            _networkSender->Close();
        }
        _networkSender = nullptr;
        return exc->HResult;
    }

    return S_OK;
}

void SendDescription ( ) [private]

Definition at line 877 of file StspMediaSink.cpp.

{
    // Size of the description buffer
    const DWORD c_cStreams = _streams.GetCount();
    const DWORD c_cbDescriptionSize = sizeof(StspDescription) + (c_cStreams-1) * sizeof(StspStreamDescription);
    const DWORD c_cbPacketSize = sizeof(StspOperationHeader) + c_cbDescriptionSize;

    ComPtr<IMediaBufferWrapper> spBuffer;
    ComPtr<IMediaBufferWrapper> *arrspAttributes = new ComPtr<IMediaBufferWrapper>[c_cStreams];
    if (arrspAttributes == nullptr)
    {
        Throw(E_OUTOFMEMORY);
    }

    try
    {
        // Create send buffer
        ThrowIfError(CreateMediaBufferWrapper(c_cbPacketSize, &spBuffer));

        // Prepare operation header
        BYTE *pBuf = spBuffer->GetBuffer();
        StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(pBuf);
        pOpHeader->cbDataSize = c_cbDescriptionSize;
        pOpHeader->eOperation = StspOperation_ServerDescription;

        // Prepare description
        StspDescription *pDescription = reinterpret_cast<StspDescription *>(pBuf + sizeof(StspOperationHeader));
        pDescription->cNumStreams = c_cStreams;

        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION endPos = _streams.EndPosition();
        DWORD nStream = 0;
        for (;pos != endPos; pos = _streams.Next(pos), ++nStream)
        {
            ComPtr<IMFStreamSink> spStream;
            ThrowIfError(_streams.GetItemPos(pos, &spStream));

            // Fill out stream description
            arrspAttributes[nStream] = FillStreamDescription(static_cast<CStreamSink *>(spStream.Get()), &pDescription->aStreams[nStream]);

            // Add size of variable size attribute blob to size of the package.
            pOpHeader->cbDataSize += pDescription->aStreams[nStream].cbAttributesSize;
        }

        // Set length of the packet
        ThrowIfError(spBuffer->SetCurrentLength(c_cbPacketSize));

        // Prepare packet to send
        ComPtr<IBufferPacket> spPacket;

        ThrowIfError(CreateBufferPacket(&spPacket));
        // Add fixed size header and description to the packet
        ThrowIfError(spPacket->AddBuffer(spBuffer.Get()));

        for (DWORD nStream = 0; nStream < c_cStreams; ++nStream)
        {
            // Add variable size attributes.
            ThrowIfError(spPacket->AddBuffer(arrspAttributes[nStream].Get()));
        }

        ComPtr<CMediaSink> spThis = this;
        // Send the data.
        SendPacket(spPacket.Get()).then([this, spThis](concurrency::task<void>& task)
        {
            try
            {
                task.get();
            }
            catch(Exception ^exc)
            {
                AutoLock lock(_critSec);
                HandleError(exc->HResult);
            }
        });

        // Keep receiving
        StartReceiving(_spReceiveBuffer.Get());

        delete[] arrspAttributes;
    }
    catch(Exception ^exc)
    {
        delete[] arrspAttributes;
        throw;
    }
}

concurrency::task< void > SendPacket ( Network::IBufferPacket * pPacket ) [private]

Definition at line 871 of file StspMediaSink.cpp.

{
    return concurrency::create_task(_networkSender->SendAsync(pPacket));
}

void SetMediaStreamProperties | ( | Windows::Media::Capture::MediaStreamType | MediaStreamType,
 |  | _In_opt_ Windows::Media::MediaProperties::IMediaEncodingProperties^ | mediaEncodingProperties |
 | ) |  |  | [private]

Definition at line 237 of file StspMediaSink.cpp.

{
    if (MediaStreamType != MediaStreamType::VideoRecord && MediaStreamType != MediaStreamType::Audio)
    {
        throw ref new InvalidArgumentException();
    }

    RemoveStreamSink(GetStreamId(MediaStreamType));
    const unsigned int streamId = GetStreamId(MediaStreamType);

    if (mediaEncodingProperties != nullptr)
    {
        ComPtr<IMFStreamSink> spStreamSink;
        ComPtr<IMFMediaType> spMediaType;
        ConvertPropertiesToMediaType(mediaEncodingProperties, &spMediaType);
        ThrowIfError(AddStreamSink(streamId, spMediaType.Get(), spStreamSink.GetAddressOf()));
    }
}

IFACEMETHODIMP SetPresentationClock ( IMFPresentationClock * pPresentationClock ) [private]

Definition at line 602 of file StspMediaSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    // If we already have a clock, remove ourselves from that clock's
    // state notifications.
    if (SUCCEEDED(hr))
    {
        if (_spClock)
        {
            hr = _spClock->RemoveClockStateSink(this);
        }
    }

    // Register ourselves to get state notifications from the new clock.
    if (SUCCEEDED(hr))
    {
        if (pPresentationClock)
        {
            hr = pPresentationClock->AddClockStateSink(this);
        }
    }

    if (SUCCEEDED(hr))
    {
        // Release the pointer to the old clock.
        // Store the pointer to the new clock.
        _spClock = pPresentationClock;
    }

    TRACEHR_RET(hr);
}

IFACEMETHOD() SetProperties ( ABI::Windows::Foundation::Collections::IPropertySet * pConfiguration ) [inline, private]

Definition at line 46 of file StspMediaSink.h.

{return S_OK;}

IFACEMETHODIMP Shutdown ( ) [private]

Definition at line 665 of file StspMediaSink.cpp.

{
    ISinkCallback ^callback;
    {
        AutoLock lock(_critSec);

        HRESULT hr = CheckShutdown();

        if (SUCCEEDED(hr))
        {
            ForEach(_streams, ShutdownFunc());
            _streams.Clear();

            if (_networkSender != nullptr)
            {
                _networkSender->Close();
            }

            _networkSender = nullptr;
            _spClock.Reset();

            _IsShutdown = true;
            callback = _callback;
        }
    }

    if (callback != nullptr)
    {
        callback->OnShutdown();
    }

    return S_OK;
}

void StartListening ( ) [private]

Private methods.

Definition at line 763 of file StspMediaSink.cpp.

{
    ComPtr<CMediaSink> spThis = this;
    concurrency::create_task(safe_cast<INetworkServer^>(_networkSender)->AcceptAsync()).then([spThis, this](concurrency::task<StreamSocketInformation^>& acceptTask)
    {
        IncomingConnectionEventArgs ^args;
        ISinkCallback ^callback;
        try
        {
            {
                AutoLock lock(_critSec);
                auto info = acceptTask.get();
                ThrowIfError(CheckShutdown());
                if (_callback == nullptr)
                {
                    Throw(E_UNEXPECTED);
                }
                _remoteUrl = PrepareRemoteUrl(info);

                _waitingConnectionId = LODWORD(GetTickCount64());
                if (_waitingConnectionId == 0)
                {
                    ++_waitingConnectionId;
                }

                args = ref new IncomingConnectionEventArgs(this, _waitingConnectionId, _remoteUrl);
                callback = _callback;
            }

            callback->FireIncomingConnection(args);
        }
        catch(Exception ^exc)
        {
            AutoLock lock(_critSec);
            HandleError(exc->HResult);
        }
    });
}

void StartReceiving ( Network::IMediaBufferWrapper * pReceiveBuffer ) [private]
void TriggerAcceptConnection ( DWORD connectionId ) [private]

Definition at line 259 of file StspMediaSink.cpp.

{
    try
    {
        AutoLock lock(_critSec);
        ThrowIfError(CheckShutdown());

        if (_waitingConnectionId != 0 && connectionId == _waitingConnectionId)
        {
            _waitingConnectionId = 0;
            ComPtr<CMediaSink> spThis = this;
            concurrency::create_task([this, spThis]
            {
                AutoLock lock(_critSec);
                try
                {
                    ThrowIfError(CheckShutdown());

                    // Create receive buffer
                    ThrowIfError(CreateMediaBufferWrapper(c_cbReceiveBuffer, &_spReceiveBuffer));

                    // Start receiving
                    StartReceiving(_spReceiveBuffer.Get());
                }
                catch(Exception ^exc)
                {
                    HandleError(exc->HResult);
                }
            });
        }
    }
    catch(Exception^)
    {
    }
}

void TriggerRefuseConnection ( DWORD connectionId ) [private]

Definition at line 295 of file StspMediaSink.cpp.

{
    try
    {
        AutoLock lock(_critSec);
        ThrowIfError(CheckShutdown());

        if (_waitingConnectionId != 0 && connectionId == _waitingConnectionId)
        {
            _waitingConnectionId = 0;
            ComPtr<CMediaSink> spThis;
            concurrency::create_task([this, spThis]
            {
                AutoLock lock(_critSec);
                try
                {
                    ThrowIfError(CheckShutdown());

                    // Connection refused disconnect current client.
                    _networkSender->Disconnect();

                    StartListening();
                }
                catch(Exception ^exc)
                {
                    HandleError(exc->HResult);
                }
            });
        }
    }
    catch(Exception^)
    {
    }
}

Member Data Documentation

ISinkCallback _callback [private]

Definition at line 116 of file StspMediaSink.h.

long _cRef [private]

Definition at line 107 of file StspMediaSink.h.

CritSec _critSec [private]

Definition at line 108 of file StspMediaSink.h.

long _cStreamsEnded [private]

Definition at line 119 of file StspMediaSink.h.

bool _IsConnected [private]

Definition at line 111 of file StspMediaSink.h.

bool _IsShutdown [private]

Definition at line 110 of file StspMediaSink.h.

LONGLONG _llStartTime [private]

Definition at line 112 of file StspMediaSink.h.

Network::INetworkChannel _networkSender [private]

Definition at line 115 of file StspMediaSink.h.

String _remoteUrl [private]

Definition at line 120 of file StspMediaSink.h.

ComPtr<IMFPresentationClock> _spClock [private]

Definition at line 114 of file StspMediaSink.h.

ComPtr<Network::IMediaBufferWrapper> _spReceiveBuffer [private]

Definition at line 117 of file StspMediaSink.h.

StreamContainer _streams [private]

Definition at line 118 of file StspMediaSink.h.

DWORD _waitingConnectionId [private]

Definition at line 122 of file StspMediaSink.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMediaSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CMediaSource
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

CMediaSource Class Reference

#include "StspMediaSource.h"

Inherits OpQueue< CMediaSource, CSourceOperation >, and CBaseAttributes<>.

List of all members.

Public Member Functions

_Acquires_lock_ (_critSec) HRESULT Lock()
_Releases_lock_ (_critSec) HRESULT Unlock()
IFACEMETHOD() | BeginGetEvent (IMFAsyncCallback *pCallback, IUnknown *punkState)
IFACEMETHOD() | CreatePresentationDescriptor (IMFPresentationDescriptor **ppPresentationDescriptor)
__override HRESULT | DispatchOperation (_In_ CSourceOperation *pOp)
IFACEMETHOD() | EndGetEvent (IMFAsyncResult *pResult, IMFMediaEvent **ppEvent)
IFACEMETHOD() | GetCharacteristics (DWORD *pdwCharacteristics)
IFACEMETHOD() | GetEvent (DWORD dwFlags, IMFMediaEvent **ppEvent)
IFACEMETHOD() | GetRate (_Inout_opt_ BOOL *pfThin, _Inout_opt_ float *pflRate)
IFACEMETHOD() | GetService (_In_ REFGUID guidService, _In_ REFIID riid, _Out_opt_ LPVOID *ppvObject)
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD_ (ULONG, Release)()
concurrency::task< void > | OpenAsync (LPCWSTR pszUrl)
IFACEMETHOD() | Pause ()
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)
IFACEMETHOD() | QueueEvent (MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, const PROPVARIANT *pvValue)
IFACEMETHOD() | SetRate (BOOL fThin, float flRate)
IFACEMETHOD() | Shutdown ()
IFACEMETHOD() | Start (IMFPresentationDescriptor *pPresentationDescriptor, const GUID *pguidTimeFormat, const PROPVARIANT *pvarStartPosition)
IFACEMETHOD() | Stop ()
__override HRESULT | ValidateOperation (_In_ CSourceOperation *pOp)

Static Public Member Functions

static HRESULT | CreateInstance (CMediaSource **ppNetSource)

Protected Member Functions

CMediaSource (void)
~CMediaSource (void)

Private Types

typedef ComPtrList
< IMFMediaStream > 		StreamContainer

Private Member Functions

HRESULT | AddStream (StspStreamDescription *pStreamDesc)
HRESULT | CheckShutdown () const
void | CompleteOpen (HRESULT hResult)
void | DoSetRate (CSetRateOperation *pOp)
void | DoStart (CStartOperation *pOp)
void | DoStop (CSourceOperation *pOp)
HRESULT | GetStreamById (DWORD dwId, CMediaStream **ppStream)
void | HandleError (HRESULT hResult)
void | Initialize ()
void | InitPresentationDescription ()
bool | IsRateSupported (float flRate, float *pflAdjustedRate)
void | ParseCurrentBuffer ()
void | ParseServerUrl (LPCWSTR pszUrl)
void | ProcessPacket (StspOperationHeader *pOpHeader, Network::IBufferPacket *pPacket)
void | ProcessServerDescription (Network::IBufferPacket *pPacket)
void | ProcessServerFormatChange (Network::IBufferPacket *pPacket)
void | ProcessServerSample (Network::IBufferPacket *pPacket)
void | Receive ()
void | SelectStreams (IMFPresentationDescriptor *pPD)
void | SendDescribeRequest ()
concurrency::task< void > | SendRequestAsync (StspOperation eOperation)
void | SendStartRequest ()
HRESULT | ValidatePresentationDescriptor (IMFPresentationDescriptor *pPD)

Private Attributes

long | _cRef
CritSec _critSec
StspOperationHeader _CurrentReceivedOperationHeader
SourceState _eSourceState
float | _flRate
Network::INetworkChannel | _networkSender
concurrency::task_completion_event
< void > 		_openedEvent
String | _serverAddress
WORD | _serverPort
ComPtr
< Network::IMediaBufferWrapper > 		_spCurrentReceiveBuffer
ComPtr< Network::IBufferPacket > | _spCurrentReceivePacket
ComPtr< IMFMediaEventQueue > | _spEventQueue
ComPtr< IMFPresentationDescriptor > | _spPresentationDescriptor
StreamContainer _streams

Detailed Description

Definition at line 80 of file StspMediaSource.h.

Member Typedef Documentation

typedef ComPtrList<IMFMediaStream> StreamContainer [private]

Definition at line 138 of file StspMediaSource.h.

Constructor & Destructor Documentation

CMediaSource ( void ) [protected]

Definition at line 81 of file StspMediaSource.cpp.

: OpQueue<CMediaSource, CSourceOperation>(_critSec.m_criticalSection)
, _cRef(1)
, _eSourceState(SourceState_Invalid)
, _serverPort(0)
, _flRate(1.0f)
{
    ZeroMemory(&_CurrentReceivedOperationHeader, sizeof(_CurrentReceivedOperationHeader));
}

~CMediaSource ( void ) [protected]

Definition at line 91 of file StspMediaSource.cpp.

{
}

Member Function Documentation

_Acquires_lock_ ( _critSec )
_Releases_lock_ ( _critSec )
HRESULT AddStream ( StspStreamDescription * pStreamDesc ) [private]
IFACEMETHODIMP BeginGetEvent | ( | IMFAsyncCallback * | pCallback,
 |  | IUnknown * | punkState
 | ) |  |

Definition at line 183 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->BeginGetEvent(pCallback, punkState);
    }

    TRACEHR_RET(hr);
}

HRESULT CheckShutdown ( ) const [inline, private]

Definition at line 167 of file StspMediaSource.h.

    {
        if (_eSourceState == SourceState_Shutdown)
        {
            return MF_E_SHUTDOWN;
        }
        else
        {
            return S_OK;
        }
    }

void CompleteOpen ( HRESULT hResult ) [private]

Definition at line 703 of file StspMediaSource.cpp.

{
    assert(!_openedEvent._IsTriggered());
    if (FAILED(hResult))
    {
        _openedEvent.set_exception(ref new Exception(hResult));
    }
    else
    {
        _openedEvent.set();
    }
}

HRESULT CreateInstance ( CMediaSource ** ppNetSource ) [static]

Definition at line 95 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;

    try
    {
        if (ppNetSource == nullptr)
        {
            Throw(E_INVALIDARG);
        }

        ComPtr<CMediaSource> spSource;
        spSource.Attach(new (std::nothrow) CMediaSource());
        if (!spSource)
        {
            Throw(E_OUTOFMEMORY);
        }

        spSource->Initialize();

        *ppNetSource = spSource.Detach();
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP CreatePresentationDescriptor ( IMFPresentationDescriptor ** ppPresentationDescriptor )

Definition at line 265 of file StspMediaSource.cpp.

{
    if (ppPresentationDescriptor == NULL)
    {
        return E_POINTER;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr) &&
        (_eSourceState == SourceState_Opening || _eSourceState == SourceState_Invalid || !_spPresentationDescriptor))
    {
        hr = MF_E_NOT_INITIALIZED;
    }

    if (SUCCEEDED(hr))
    {
        hr = _spPresentationDescriptor->Clone(ppPresentationDescriptor);
    }

    return hr;
}

__override HRESULT DispatchOperation ( _In_ CSourceOperation * pOp )

Definition at line 509 of file StspMediaSource.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        switch(pOp->GetOperationType())
        {
        case CSourceOperation::Operation_Start:
            DoStart(static_cast<CStartOperation *>(pOp));
            break;
        case CSourceOperation::Operation_Stop:
            DoStop(pOp);
            break;
        case CSourceOperation::Operation_SetRate:
            DoSetRate(static_cast<CSetRateOperation *>(pOp));
            break;
        default:
            hr = E_UNEXPECTED;
            break;
        }
    }

    TRACEHR_RET(hr);
}

void DoSetRate ( CSetRateOperation * pOp ) [private]

Definition at line 1281 of file StspMediaSource.cpp.

{
    assert(pOp->GetOperationType() == CSourceOperation::Operation_SetRate);

    HRESULT hr = S_OK;
    try
    {
        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION posEnd = _streams.EndPosition();

        for (; pos != posEnd; pos = _streams.Next(pos))
        {
            ComPtr<IMFMediaStream> spStream;
            ThrowIfError(_streams.GetItemPos(pos, &spStream));

            CMediaStream *pStream = static_cast<CMediaStream*>(spStream.Get());

            if (pStream->IsActive())
            {
                ThrowIfError(pStream->Flush());
                ThrowIfError(pStream->SetRate(pOp->GetRate()));
            }
        }

        _flRate = pOp->GetRate();
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }
    // Send the "rate changed" event. This might include a failure code.
    (void)_spEventQueue->QueueEventParamVar(MESourceRateChanged, GUID_NULL, hr, nullptr);
}

void DoStart ( CStartOperation * pOp ) [private]

Definition at line 1230 of file StspMediaSource.cpp.

{
    assert(pOp->GetOperationType() == CSourceOperation::Operation_Start);
    ComPtr<IMFPresentationDescriptor> spPD = pOp->GetPresentationDescriptor();

    try
    {
        SelectStreams(spPD.Get());

        _eSourceState = SourceState_Starting;
        SendStartRequest();

        _eSourceState = SourceState_Started;
        ThrowIfError(_spEventQueue->QueueEventParamVar(MESourceStarted, GUID_NULL, S_OK, &pOp->GetData()));
    }
    catch(Exception ^exc)
    {
        _spEventQueue->QueueEventParamVar(MESourceStarted, GUID_NULL, exc->HResult, nullptr);
    }
}

void DoStop ( CSourceOperation * pOp ) [private]

Definition at line 1251 of file StspMediaSource.cpp.

{
    assert(pOp->GetOperationType() == CSourceOperation::Operation_Stop);

    HRESULT hr = S_OK;
    try
    {
        StreamContainer::POSITION pos = _streams.FrontPosition();
        StreamContainer::POSITION posEnd = _streams.EndPosition();

        for (; pos != posEnd; pos = _streams.Next(pos))
        {
            ComPtr<IMFMediaStream> spStream;
            ThrowIfError(_streams.GetItemPos(pos, &spStream));
            CMediaStream *pStream = static_cast<CMediaStream*>(spStream.Get());
            if (pStream->IsActive())
            {
                ThrowIfError(pStream->Flush());
                ThrowIfError(pStream->Stop());
            }
        }
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }
    // Send the "stopped" event. This might include a failure code.
    (void)_spEventQueue->QueueEventParamVar(MESourceStopped, GUID_NULL, hr, nullptr);
}

IFACEMETHODIMP EndGetEvent | ( | IMFAsyncResult * | pResult,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 199 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->EndGetEvent(pResult, ppEvent);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetCharacteristics ( DWORD * pdwCharacteristics )

Definition at line 292 of file StspMediaSource.cpp.

{
    if (pdwCharacteristics == NULL)
    {
        return E_POINTER;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *pdwCharacteristics = MFMEDIASOURCE_IS_LIVE;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetEvent | ( | DWORD | dwFlags,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 215 of file StspMediaSource.cpp.

{
    // NOTE:
    // GetEvent can block indefinitely, so we don't hold the lock.
    // This requires some juggling with the event queue pointer.

    HRESULT hr = S_OK;

    ComPtr<IMFMediaEventQueue> spQueue;

    {
        AutoLock lock(_critSec);

        // Check shutdown
        hr = CheckShutdown();

        // Get the pointer to the event queue.
        if (SUCCEEDED(hr))
        {
            spQueue = _spEventQueue;
        }
    }

    // Now get the event.
    if (SUCCEEDED(hr))
    {
        hr = spQueue->GetEvent(dwFlags, ppEvent);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetRate | ( | _Inout_opt_ BOOL * | pfThin,
 |  | _Inout_opt_ float * | pflRate
 | ) |  |

Definition at line 495 of file StspMediaSource.cpp.

{
    AutoLock lock(_critSec);
    if (pfThin == nullptr || pflRate == nullptr)
    {
        return E_INVALIDARG;
    }

    *pfThin = FALSE;
    *pflRate = _flRate;

    return S_OK;
}

IFACEMETHODIMP GetService | ( | _In_ REFGUID | guidService,
 |  | _In_ REFIID | riid,
 |  | _Out_opt_ LPVOID * | ppvObject
 | ) |  |

Definition at line 443 of file StspMediaSource.cpp.

{
    HRESULT hr = MF_E_UNSUPPORTED_SERVICE;

    if (ppvObject == nullptr)
    {
        return E_POINTER;
    }

    if (guidService == MF_RATE_CONTROL_SERVICE)
    {
        hr = QueryInterface(riid, ppvObject);
    }

    return hr;
}

HRESULT GetStreamById | ( | DWORD | dwId,
 |  | CMediaStream ** | ppStream |
 | ) |  |  | [private]

Definition at line 643 of file StspMediaSource.cpp.

{
    assert(ppStream);
    HRESULT hr = MF_E_NOT_FOUND;
    StreamContainer::POSITION pos = _streams.FrontPosition();
    StreamContainer::POSITION posEnd = _streams.EndPosition();

    for (; pos != posEnd; pos = _streams.Next(pos))
    {
        ComPtr<IMFMediaStream> spStream;
        HRESULT hErrorCode = _streams.GetItemPos(pos, &spStream);
        if (FAILED(hErrorCode))
        {
            hr = hErrorCode;
            break;
        }
        CMediaStream *pStream = static_cast<CMediaStream*>(spStream.Get());
        if (pStream->GetId() == dwId)
        {
            *ppStream = pStream;
            (*ppStream)->AddRef();
            hr = S_OK;
        }
    }

    TRACEHR_RET(hr);
}

void HandleError ( HRESULT hResult ) [private]

Definition at line 628 of file StspMediaSource.cpp.

{
    if (_eSourceState == SourceState_Opening)
    {
        // If we have an error during opening operation complete it and pass the error to client.
        CompleteOpen(hResult);
    }
    else if (_eSourceState != SourceState_Shutdown)
    {
        // If we received an error at any other time (except shutdown) send MEError event.
        QueueEvent(MEError, GUID_NULL, hResult, nullptr);
    }
}

IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
void Initialize ( ) [private]

Definition at line 604 of file StspMediaSource.cpp.

{
    try
    {
        INetworkClient ^networkClient;

        // Create the event queue helper.
        ThrowIfError(MFCreateEventQueue(&_spEventQueue));

        ThrowIfError(CBaseAttributes<>::Initialize());

        // Create network client
        networkClient = CreateNetworkClient();

        _networkSender = safe_cast<INetworkChannel^>(networkClient);
    }
    catch(Exception^)
    {
        Shutdown();
        throw;
    }
}

void InitPresentationDescription ( ) [private]

Definition at line 1107 of file StspMediaSource.cpp.

{
    ComPtr<IMFPresentationDescriptor> spPresentationDescriptor;
    IMFStreamDescriptor **aStreams = nullptr;

    aStreams = new (std::nothrow) IMFStreamDescriptor*[_streams.GetCount()];
    if (aStreams == nullptr)
    {
        Throw(E_OUTOFMEMORY);
    }

    ZeroMemory(aStreams, sizeof(aStreams[0]) * _streams.GetCount());

    StreamContainer::POSITION pos = _streams.FrontPosition();
    StreamContainer::POSITION posEnd = _streams.EndPosition();

    for (DWORD nStream = 0; pos != posEnd; ++nStream, pos = pos = _streams.Next(pos))
    {
        ComPtr<IMFMediaStream> spStream;
        ThrowIfError(_streams.GetItemPos(pos, &spStream));
        ThrowIfError(spStream->GetStreamDescriptor(&aStreams[nStream]));
    }

    ThrowIfError(MFCreatePresentationDescriptor(_streams.GetCount(), aStreams, &spPresentationDescriptor));

    for (DWORD nStream = 0; nStream < _streams.GetCount(); ++nStream)
    {
        ThrowIfError(spPresentationDescriptor->SelectStream(nStream));
    }

    _spPresentationDescriptor = spPresentationDescriptor;

    if (aStreams != nullptr)
    {
        for (DWORD nStream = 0; nStream < _streams.GetCount(); ++nStream)
        {
            if (aStreams[nStream] != nullptr)
            {
                aStreams[nStream]->Release();
            }
        }

        delete[] aStreams;
    }
}

bool IsRateSupported | ( | float | flRate,
 |  | float * | pflAdjustedRate |
 | ) |  |  | [private]

Definition at line 1315 of file StspMediaSource.cpp.

{
    if (flRate < 0.00001f && flRate > -0.00001f)
    {
        *pflAdjustedRate = 0.0f;
        return true;
    }
    else if(flRate < 1.0001f && flRate > 0.9999f)
    {
        *pflAdjustedRate = 1.0f;
        return true;
    }
    return false;
}

concurrency::task< void > OpenAsync ( LPCWSTR pszUrl )

Definition at line 542 of file StspMediaSource.cpp.

{
    AutoLock lock(_critSec);

    if (_eSourceState != SourceState_Invalid)
    {
        Throw(MF_E_INVALIDREQUEST);
    }

    if (pszUrl == nullptr)
    {
        Throw(E_INVALIDARG);
    }

    // Get network client
    INetworkClient ^networkClient = safe_cast<INetworkClient^>(_networkSender);

    // Parse url (to obtain host name and port)
    ParseServerUrl(pszUrl);

    concurrency::create_task(networkClient->ConnectAsync(_serverAddress, _serverPort)).then([this](concurrency::task<void>& connectTask)
    {
        AutoLock lock(_critSec);
        try
        {
            connectTask.get();
            ThrowIfError(CheckShutdown());
            if (_eSourceState != SourceState_Opening)
            {
                Throw(MF_E_UNEXPECTED);
            }

            SendDescribeRequest();
        }
        catch(Exception ^exc)
        {
            HandleError(exc->HResult);
            Shutdown();
        }
    });

    // If everything is ok now we are waiting for network client to connect.
    // Change state to opening.
    _eSourceState = SourceState_Opening;

    return concurrency::task<void>(_openedEvent);
}

void ParseCurrentBuffer ( ) [private]

Definition at line 825 of file StspMediaSource.cpp.

{
    bool fCompletePackage = false;
    DWORD cbTotalLength = 0;
    // Remember the buffer
    ComPtr<IMediaBufferWrapper> spLastBuffer = _spCurrentReceiveBuffer;

    if (_spCurrentReceivePacket == nullptr)
    {
        // If packet object storing current operation data is not created yet - create it.
        ThrowIfError(CreateBufferPacket(&_spCurrentReceivePacket));
    }

    // Add current receive buffer to the packet.
    ThrowIfError(_spCurrentReceivePacket->AddBuffer(_spCurrentReceiveBuffer.Get()));
    _spCurrentReceiveBuffer.Reset();

    // Parsing new package, we have't read operation just yet
    if (_CurrentReceivedOperationHeader.eOperation == StspOperation_Unknown)
    {
        DWORD cbCurrentLength;
        ThrowIfError(_spCurrentReceivePacket->GetTotalLength(&cbCurrentLength));

        // Check if we have enough data to retrieve operation header
        if(cbCurrentLength >= sizeof(StspOperationHeader))
        {
            ThrowIfError(_spCurrentReceivePacket->MoveLeft(sizeof(_CurrentReceivedOperationHeader), &_CurrentReceivedOperationHeader));
        }
        else
        {
            // We don't have enough data just yet so set data size to maximum packet size (then we will pass validation performed later on)
            _CurrentReceivedOperationHeader.cbDataSize = c_cbMaxPacketSize;
        }
    }

    // Get length of the packet (without operation header which was removed from the packet).
    ThrowIfError(_spCurrentReceivePacket->GetTotalLength(&cbTotalLength));

    if (// packet size is too large
        (c_cbMaxPacketSize < _CurrentReceivedOperationHeader.cbDataSize ||
        // Unrecognized operation
        _CurrentReceivedOperationHeader.eOperation >= StspOperation_Last))
    {
        Throw(MF_E_UNSUPPORTED_FORMAT);
    }

    if (// Size of the package already exceeded value described in operation header
        cbTotalLength > _CurrentReceivedOperationHeader.cbDataSize)
    {
        // Trim the right edge of the packet and get buffer representing trimmed data
        ThrowIfError(spLastBuffer->TrimRight(cbTotalLength - _CurrentReceivedOperationHeader.cbDataSize, &_spCurrentReceiveBuffer));
        // Fix total length
        cbTotalLength = _CurrentReceivedOperationHeader.cbDataSize;
    }

    // We've got a whole packet
    if (cbTotalLength == _CurrentReceivedOperationHeader.cbDataSize)
    {
        // Process packet payload
        ProcessPacket(&_CurrentReceivedOperationHeader, _spCurrentReceivePacket.Get());
        _spCurrentReceivePacket.Reset();
        _CurrentReceivedOperationHeader.eOperation =  StspOperation_Unknown;
    }

    if (_spCurrentReceiveBuffer)
    {
        // We've got a buffer which was left from TrimRight operation above, we can keep parsing.
        ParseCurrentBuffer();
    }
}

void ParseServerUrl ( LPCWSTR pszUrl ) [private]

Definition at line 671 of file StspMediaSource.cpp.

{
    if (pszUrl == nullptr)
    {
        Throw(E_INVALIDARG);
    }

    auto uri = ref new Windows::Foundation::Uri(ref new String(pszUrl));

    String ^scheme = uri->SchemeName;
    // It is not a scheme we support
    if (wcscmp(scheme->Data(), c_szStspScheme) != 0)
    {
        Throw(MF_E_UNSUPPORTED_SCHEME);
    }

    if (uri->Port == 0)
    {
        _serverPort = c_wStspDefaultPort;
    }
    else if (uri->Port < 0 || uri->Port > WORD_MAX)
    {
        Throw(E_UNEXPECTED);
    }
    else
    {
        _serverPort = (WORD)uri->Port;
    }

    _serverAddress = uri->Host;
}

IFACEMETHODIMP Pause ( )

Definition at line 311 of file StspMediaSource.cpp.

{
    return MF_E_INVALID_STATE_TRANSITION;
}

void ProcessPacket | ( | StspOperationHeader * | pOpHeader,
 |  | Network::IBufferPacket * | pPacket |
 | ) |  |  | [private]
void ProcessServerDescription ( Network::IBufferPacket * pPacket ) [private]
void ProcessServerFormatChange ( Network::IBufferPacket * pPacket ) [private]
void ProcessServerSample ( Network::IBufferPacket * pPacket ) [private]
IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 127 of file StspMediaSource.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown ||
        riid == IID_IMFMediaSource ||
        riid == IID_IMFMediaEventGenerator)
    {
        (*ppv) = static_cast<IMFMediaSource*>(this);
        AddRef();
    }
    else if (riid == IID_IMFAttributes)
    {
        (*ppv) = static_cast<IMFAttributes*>(this);
        AddRef();
    }
    else if (riid == IID_IMFGetService)
    {
        (*ppv) = static_cast<IMFGetService*>(this);
        AddRef();
    }
    else if (riid == IID_IMFRateControl)
    {
        (*ppv) = static_cast<IMFRateControl*>(this);
        AddRef();
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    return hr;
}

IFACEMETHODIMP QueueEvent | ( | MediaEventType | met,
 |  | REFGUID | guidExtendedType,
 |  | HRESULT | hrStatus,
 |  | const PROPVARIANT * | pvValue
 | ) |  |

Definition at line 248 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
    }

    TRACEHR_RET(hr);
}

void Receive ( ) [private]

Definition at line 789 of file StspMediaSource.cpp.

{
    // We already during receive operation
    if (_spCurrentReceiveBuffer)
    {
        Throw(MF_E_INVALIDREQUEST);
    }

    ComPtr<IMediaBufferWrapper> spBuffer;
    ThrowIfError(CreateMediaBufferWrapper(c_cbReceiveBufferSize, &spBuffer));

    ComPtr<CMediaSource> spThis = this;
    concurrency::create_task(_networkSender->ReceiveAsync(spBuffer.Get())).then([this, spThis](concurrency::task<void>& task)
    {
        AutoLock lock(_critSec);
        try
        {
            task.get();

            ThrowIfError(CheckShutdown());

            ParseCurrentBuffer();

            // Continue receiving
            Receive();
        }
        catch(Exception ^exc)
        {
            HandleError(exc->HResult);
        }
     });

    _spCurrentReceiveBuffer = spBuffer;
}

void SelectStreams ( IMFPresentationDescriptor * pPD ) [private]

Definition at line 1192 of file StspMediaSource.cpp.

{
    for (DWORD nStream = 0; nStream < _streams.GetCount(); ++nStream)
    {
        ComPtr<IMFStreamDescriptor> spSD;
        ComPtr<CMediaStream> spStream;
        DWORD nStreamId;
        BOOL fSelected;

        // Get next stream descriptor
        ThrowIfError(pPD->GetStreamDescriptorByIndex(nStream, &fSelected, &spSD));

        // Get stream id
        ThrowIfError(spSD->GetStreamIdentifier(&nStreamId));

        // Get simple net media stream
        ThrowIfError(GetStreamById(nStreamId, &spStream));

        // Remember if stream was selected
        bool fWasSelected = spStream->IsActive();
        ThrowIfError(spStream->SetActive(!!fSelected));

        if (fSelected)
        {
            // Choose event type to send
            MediaEventType met = (fWasSelected) ? MEUpdatedStream : MENewStream;
            ComPtr<IUnknown> spStreamUnk;

            spStream.As(&spStreamUnk);

            ThrowIfError(_spEventQueue->QueueEventParamUnk(met, GUID_NULL, S_OK, spStreamUnk.Get()));

            // Start the stream. The stream will send the appropriate event.
            ThrowIfError(spStream->Start());
        }
    }
}

void SendDescribeRequest ( ) [private]

Definition at line 737 of file StspMediaSource.cpp.

{
    _CurrentReceivedOperationHeader.eOperation = StspOperation_Unknown;
    ComPtr<CMediaSource> spThis = this;
    SendRequestAsync(StspOperation_ClientRequestDescription).then([this, spThis](concurrency::task<void>& task)
    {
        AutoLock lock(_critSec);
        try
        {
            task.get();

            ThrowIfError(CheckShutdown());
            if (_eSourceState != SourceState_Opening)
            {
                Throw(MF_E_UNEXPECTED);
            }

            // Start receiving
            Receive();
        }
        catch(Exception ^exc)
        {
            HandleError(exc->HResult);
        }
    });
}

concurrency::task< void > SendRequestAsync ( StspOperation eOperation ) [private]

Definition at line 716 of file StspMediaSource.cpp.

{
    ComPtr<IMediaBufferWrapper> spBuffer;
    ComPtr<IBufferPacket> spPacket;
    // We just send an operation header this operation contains no payload.
    ThrowIfError(CreateMediaBufferWrapper(sizeof(StspOperationHeader), &spBuffer));

    ThrowIfError(CreateBufferPacket(&spPacket));

    // Prepare operation header.
    StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(spBuffer->GetBuffer());
    pOpHeader->cbDataSize = 0;
    pOpHeader->eOperation = eOperation;
    ThrowIfError(spBuffer->SetCurrentLength(sizeof(StspOperationHeader)));

    ThrowIfError(spPacket->AddBuffer(spBuffer.Get()));

    return concurrency::create_task(_networkSender->SendAsync(spPacket.Get()));
}

void SendStartRequest ( ) [private]

Definition at line 764 of file StspMediaSource.cpp.

{
    _CurrentReceivedOperationHeader.eOperation = StspOperation_Unknown;
    ComPtr<CMediaSource> spThis = this;
    SendRequestAsync(StspOperation_ClientRequestStart).then([this, spThis](concurrency::task<void>& task)
    {
        AutoLock lock(_critSec);
        try
        {
            task.get();

            ThrowIfError(CheckShutdown());
            if (_eSourceState != SourceState_Starting && _eSourceState != SourceState_Started)
            {
                Throw(MF_E_UNEXPECTED);
            }
        }
        catch(Exception ^exc)
        {
            HandleError(exc->HResult);
        }
    });
}

IFACEMETHODIMP SetRate | ( | BOOL | fThin,
 |  | float | flRate
 | ) |  |

Definition at line 460 of file StspMediaSource.cpp.

{
    if (fThin)
    {
        return MF_E_THINNING_UNSUPPORTED;
    }
    if (!IsRateSupported(flRate, &flRate))
    {
        return MF_E_UNSUPPORTED_RATE;
    }

    AutoLock lock(_critSec);
    HRESULT hr = S_OK;

    if (flRate == _flRate)
    {
        return S_OK;
    }

    ComPtr<CSourceOperation> spSetRateOp;
    spSetRateOp.Attach(new (std::nothrow) CSetRateOperation(fThin, flRate));
    if (!spSetRateOp)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        // Queue asynchronous stop
        hr = QueueOperation(spSetRateOp.Get());
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP Shutdown ( )

Definition at line 316 of file StspMediaSource.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_spEventQueue != nullptr)
        {
            _spEventQueue->Shutdown();
        }
        if (_networkSender != nullptr)
        {
            _networkSender->Close();
        }

        StreamContainer::POSITION pos = _streams.FrontPosition();
        while (pos != _streams.EndPosition())
        {
            ComPtr<IMFMediaStream> spStream;
            hr = _streams.GetItemPos(pos, &spStream);
            pos = _streams.Next(pos);
            if (SUCCEEDED(hr))
            {
                static_cast<CMediaStream*>(spStream.Get())->Shutdown();
            }
        }

        _eSourceState = SourceState_Shutdown;

        _streams.Clear();

        _spEventQueue.Reset();
        _networkSender = nullptr;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP Start | ( | IMFPresentationDescriptor * | pPresentationDescriptor,
 |  | const GUID * | pguidTimeFormat,
 |  | const PROPVARIANT * | pvarStartPosition
 | ) |  |

Definition at line 356 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;

    // Check parameters.

    // Start position and presentation descriptor cannot be NULL.
    if (pvarStartPos == nullptr || pPresentationDescriptor == nullptr)
    {
        return E_INVALIDARG;
    }

    // Check the time format.
    if ((pguidTimeFormat != nullptr) && (*pguidTimeFormat != GUID_NULL))
    {
        // Unrecognized time format GUID.
        return MF_E_UNSUPPORTED_TIME_FORMAT;
    }

    // Check the data type of the start position.
    if (pvarStartPos->vt != VT_EMPTY && pvarStartPos->vt != VT_I8)
    {
        return MF_E_UNSUPPORTED_TIME_FORMAT;
    }

    AutoLock lock(_critSec);
    ComPtr<CStartOperation> spStartOp;

    if (_eSourceState != SourceState_Stopped &&
        _eSourceState != SourceState_Started)
    {
        hr = MF_E_INVALIDREQUEST;
    }

    if (SUCCEEDED(hr))
    {
        // Check if the presentation description is valid.
        hr = ValidatePresentationDescriptor(pPresentationDescriptor);
    }

    if (SUCCEEDED(hr))
    {
        // Prepare asynchronous operation attributes
        spStartOp.Attach(new (std::nothrow) CStartOperation(pPresentationDescriptor));
        if (!spStartOp)
        {
            hr = E_OUTOFMEMORY;
        }

        if (SUCCEEDED(hr))
        {
            hr = spStartOp->SetData(*pvarStartPos);
        }
    }

    if (SUCCEEDED(hr))
    {
        // Queue asynchronous operation
        hr = QueueOperation(spStartOp.Get());
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP Stop ( )

Definition at line 424 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;
    ComPtr<CSourceOperation> spStopOp;
    spStopOp.Attach(new (std::nothrow) CSourceOperation(CSourceOperation::Operation_Stop));
    if (!spStopOp)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        // Queue asynchronous stop
        hr = QueueOperation(spStopOp.Get());
    }

    TRACEHR_RET(hr);
}

__override HRESULT ValidateOperation ( _In_ CSourceOperation * pOp )

Definition at line 537 of file StspMediaSource.cpp.

{
    return S_OK;
}

HRESULT ValidatePresentationDescriptor ( IMFPresentationDescriptor * pPD ) [private]

Definition at line 1153 of file StspMediaSource.cpp.

{
    HRESULT hr = S_OK;
    BOOL fSelected = FALSE;
    DWORD cStreams = 0;

    if (_streams.GetCount() == 0)
    {
        return E_UNEXPECTED;
    }

    // The caller's PD must have the same number of streams as ours.
    hr = pPD->GetStreamDescriptorCount(&cStreams);

    if (SUCCEEDED(hr))
    {
        if (cStreams != _streams.GetCount())
        {
            hr = E_INVALIDARG;
        }
    }

    // The caller must select at least one stream.
    if (SUCCEEDED(hr))
    {
        for (DWORD i = 0; i < cStreams; i++)
        {
            ComPtr<IMFStreamDescriptor> spSD;
            hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &spSD);
            if (FAILED(hr))
            {
                break;
            }
        }
    }

    TRACEHR_RET(hr);
}

Member Data Documentation

long _cRef [private]

Definition at line 180 of file StspMediaSource.h.

CritSec _critSec [private]

Definition at line 181 of file StspMediaSource.h.

StspOperationHeader _CurrentReceivedOperationHeader [private]

Definition at line 190 of file StspMediaSource.h.

SourceState _eSourceState [private]

Definition at line 182 of file StspMediaSource.h.

float _flRate [private]

Definition at line 198 of file StspMediaSource.h.

Network::INetworkChannel _networkSender [private]

Definition at line 184 of file StspMediaSource.h.

concurrency::task_completion_event<void> _openedEvent [private]

Definition at line 196 of file StspMediaSource.h.

String _serverAddress [private]

Definition at line 185 of file StspMediaSource.h.

WORD _serverPort [private]

Definition at line 186 of file StspMediaSource.h.

ComPtr<Network::IMediaBufferWrapper> _spCurrentReceiveBuffer [private]

Definition at line 189 of file StspMediaSource.h.

ComPtr<Network::IBufferPacket> _spCurrentReceivePacket [private]

Definition at line 188 of file StspMediaSource.h.

ComPtr<IMFMediaEventQueue> _spEventQueue [private]

Definition at line 183 of file StspMediaSource.h.

ComPtr<IMFPresentationDescriptor> _spPresentationDescriptor [private]

Definition at line 192 of file StspMediaSource.h.

StreamContainer _streams [private]

Definition at line 194 of file StspMediaSource.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMediaStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CMediaStream
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CMediaStream Class Reference

#include "StspMediaStream.h"

List of all members.

Classes

class | CSourceLock

Public Member Functions

IFACEMETHOD() | BeginGetEvent (IMFAsyncCallback *pCallback, IUnknown *punkState)
IFACEMETHOD() | DropTime (_In_ LONGLONG hnsAmountToDrop)
IFACEMETHOD() | EndGetEvent (IMFAsyncResult *pResult, IMFMediaEvent **ppEvent)
HRESULT | Flush ()
IFACEMETHOD() | GetDropMode (_Out_ MF_QUALITY_DROP_MODE *peDropMode)
IFACEMETHOD() | GetEvent (DWORD dwFlags, IMFMediaEvent **ppEvent)
DWORD | GetId () const
IFACEMETHOD() | GetMediaSource (IMFMediaSource **ppMediaSource)
IFACEMETHOD() | GetQualityLevel (_Out_ MF_QUALITY_LEVEL *peQualityLevel)
IFACEMETHOD() | GetService (_In_ REFGUID guidService, _In_ REFIID riid, _Out_ LPVOID *ppvObject)
SourceState | GetState () const
IFACEMETHOD() | GetStreamDescriptor (IMFStreamDescriptor **ppStreamDescriptor)
IFACEMETHOD_ (ULONG, Release)()
IFACEMETHOD_ (ULONG, AddRef)()
bool | IsActive () const
IFACEMETHOD() | NotifyQualityEvent (_In_opt_ IMFMediaEvent *pEvent, _Out_ DWORD *pdwFlags)
void | ProcessFormatChange (IMFMediaType *pMediaType)
void | ProcessSample (StspSampleHeader *pSampleHeader, IMFSample *pSample)
IFACEMETHOD() | QueryInterface (REFIID iid, void **ppv)
IFACEMETHOD() | QueueEvent (MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, const PROPVARIANT *pvValue)
IFACEMETHOD() | RequestSample (IUnknown *pToken)
HRESULT | SetActive (bool fActive)
IFACEMETHOD() | SetDropMode (_In_ MF_QUALITY_DROP_MODE eDropMode)
IFACEMETHOD() | SetQualityLevel (_In_ MF_QUALITY_LEVEL eQualityLevel)
HRESULT | SetRate (float flRate)
HRESULT | Shutdown ()
HRESULT | Start ()
HRESULT | Stop ()

Static Public Member Functions

static HRESULT | CreateInstance (StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer, CMediaSource *pSource, CMediaStream **ppStream)

Protected Member Functions

CMediaStream (CMediaSource *pSource)
~CMediaStream (void)

Private Member Functions

HRESULT | CheckShutdown () const
void | CleanSampleQueue ()
void | DeliverSamples ()
void | HandleError (HRESULT hErrorCode)
void | Initialize (StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer)
void | ResetDropTime ()
void | SetSampleAttributes (StspSampleHeader *pSampleHeader, IMFSample *pSample)
bool | ShouldDropSample (IMFSample *pSample)

Private Attributes

long | _cRef
DWORD | _dwId
MF_QUALITY_DROP_MODE | _eDropMode
SourceState _eSourceState
bool | _fActive
bool | _fDiscontinuity
bool | _fDropTime
bool | _fInitDropTime
float | _flRate
bool | _fVideo
bool | _fWaitingForCleanPoint
LONGLONG | _hnsAmountToDrop
LONGLONG | _hnsStartDroppingAt
ComPtrList< IUnknown > | _samples
ComPtr< IMFMediaEventQueue > | _spEventQueue
ComPtr< CMediaSource > | _spSource
ComPtr< IMFStreamDescriptor > | _spStreamDescriptor
ComPtrList< IUnknown, true > | _tokens

Detailed Description

Definition at line 20 of file StspMediaStream.h.

Constructor & Destructor Documentation

CMediaStream ( CMediaSource * pSource ) [protected]

Definition at line 76 of file StspMediaStream.cpp.

    : _cRef(1)
    , _spSource(pSource)
    , _eSourceState(SourceState_Invalid)
    , _fActive(false)
    , _flRate(1.0f)
    , _fVideo(false)
    , _eDropMode(MF_DROP_MODE_NONE)
    , _fDiscontinuity(false)
    , _fDropTime(false)
    , _fInitDropTime(false)
    , _fWaitingForCleanPoint(true)
    , _hnsStartDroppingAt(0)
    , _hnsAmountToDrop(0)
{
}

~CMediaStream ( void ) [protected]

Definition at line 93 of file StspMediaStream.cpp.

{
}

Member Function Documentation

IFACEMETHODIMP BeginGetEvent | ( | IMFAsyncCallback * | pCallback,
 |  | IUnknown * | punkState
 | ) |  |

Definition at line 151 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->BeginGetEvent(pCallback, punkState);
    }

    TRACEHR_RET(hr);
}

HRESULT CheckShutdown ( ) const [inline, private]

Definition at line 86 of file StspMediaStream.h.

        {
            if (_eSourceState == SourceState_Shutdown)
            {
                return MF_E_SHUTDOWN;
            }
            else
            {
                return S_OK;
            }
        }

void CleanSampleQueue ( ) [private]

Definition at line 896 of file StspMediaStream.cpp.

{
    auto pos = _samples.FrontPosition();
    ComPtr<IUnknown> spEntry;
    ComPtr<IMFSample> spSample;

    if (_fVideo)
    {
        // For video streams leave first key frame.
        for (;SUCCEEDED(_samples.GetItemPos(pos, spEntry.ReleaseAndGetAddressOf())); pos = _samples.Next(pos))
        {
            if (SUCCEEDED(spEntry.As(&spSample)) && MFGetAttributeUINT32(spSample.Get(), MFSampleExtension_CleanPoint, 0))
            {
                break;
            }
        }
    }

    _samples.Clear();

    if (spSample != nullptr)
    {
        ThrowIfError(_samples.InsertFront(spSample.Get()));
    }
}

static HRESULT CreateInstance | ( | StspStreamDescription * | pStreamDescription,
 |  | Network::IBufferPacket * | pAttributesBuffer,
 |  | CMediaSource * | pSource,
 |  | CMediaStream ** | ppStream |
 | ) |  |  | [static]
void DeliverSamples ( ) [private]

Definition at line 763 of file StspMediaStream.cpp.

{
    // Check if we have both: samples available in the queue and requests in request list.
    while (!_samples.IsEmpty() && !_tokens.IsEmpty())
    {
        ComPtr<IUnknown> spEntry;
        ComPtr<IMFSample> spSample;
        ComPtr<IUnknown> spToken;
        BOOL fDrop = FALSE;
        // Get the entry
        ThrowIfError(_samples.RemoveFront(&spEntry));

        if (SUCCEEDED(spEntry.As(&spSample)))
        {
            fDrop = ShouldDropSample(spSample.Get());

            if (!fDrop)
            {
                // Get the request token
                ThrowIfError(_tokens.RemoveFront(&spToken));

                if (spToken)
                {
                    // If token was not null set the sample attribute.
                    ThrowIfError(spSample->SetUnknown(MFSampleExtension_Token, spToken.Get()));
                }

                if (_fDiscontinuity)
                {
                    // If token was not null set the sample attribute.
                    ThrowIfError(spSample->SetUINT32(MFSampleExtension_Discontinuity, TRUE));
                    _fDiscontinuity = false;
                }

                // Send a sample event.
                ThrowIfError(_spEventQueue->QueueEventParamUnk(MEMediaSample, GUID_NULL, S_OK, spSample.Get()));
            }
            else
            {
                _fDiscontinuity = true;
            }
        }
        else
        {
            ComPtr<IMFMediaType> spMediaType;
            ThrowIfError(spEntry.As(&spMediaType));
            // Send a sample event.
            ThrowIfError(_spEventQueue->QueueEventParamUnk(MEStreamFormatChanged, GUID_NULL, S_OK, spMediaType.Get()));
        }
    }
}

IFACEMETHODIMP DropTime ( _In_ LONGLONG hnsAmountToDrop )

Definition at line 370 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (hnsAmountToDrop > 0)
        {
            _fDropTime = true;
            _fInitDropTime = true;
            _hnsAmountToDrop = hnsAmountToDrop;
            TRACE(TRACE_LEVEL_NORMAL, L"Dropping time hnsAmountToDrop=%I64d\n", hnsAmountToDrop);
        }
        else if (hnsAmountToDrop == 0)
        {
            // Reset time dropping
            TRACE(TRACE_LEVEL_NORMAL, L"Disabling dropping time\n");
            ResetDropTime();
        }
        else
        {
            hr = E_INVALIDARG;
        }
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP EndGetEvent | ( | IMFAsyncResult * | pResult,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 167 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->EndGetEvent(pResult, ppEvent);
    }

    TRACEHR_RET(hr);
}

HRESULT Flush ( )

Definition at line 578 of file StspMediaStream.cpp.

{
    CSourceLock lock(_spSource.Get());

    _tokens.Clear();
    _samples.Clear();

    _fDiscontinuity = false;
    _eDropMode = MF_DROP_MODE_NONE;
    ResetDropTime();

    return S_OK;
}

IFACEMETHODIMP GetDropMode ( _Out_ MF_QUALITY_DROP_MODE * peDropMode )

Definition at line 342 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;

    if (peDropMode == nullptr)
    {
        return E_POINTER;
    }

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *peDropMode = _eDropMode;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetEvent | ( | DWORD | dwFlags,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 183 of file StspMediaStream.cpp.

{
    // NOTE:
    // GetEvent can block indefinitely, so we don't hold the lock.
    // This requires some juggling with the event queue pointer.

    HRESULT hr = S_OK;

    ComPtr<IMFMediaEventQueue> spQueue;

    {
        CSourceLock lock(_spSource.Get());

        // Check shutdown
        hr = CheckShutdown();

        // Get the pointer to the event queue.
        if (SUCCEEDED(hr))
        {
            spQueue = _spEventQueue;
        }
    }

    // Now get the event.
    if (SUCCEEDED(hr))
    {
        hr = spQueue->GetEvent(dwFlags, ppEvent);
    }

    TRACEHR_RET(hr);
}

DWORD GetId ( ) const [inline]

Definition at line 71 of file StspMediaStream.h.

{return _dwId;}

IFACEMETHODIMP GetMediaSource ( IMFMediaSource ** ppMediaSource )

Definition at line 234 of file StspMediaStream.cpp.

{
    if (ppMediaSource == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *ppMediaSource = _spSource.Get();
        (*ppMediaSource)->AddRef();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetQualityLevel ( _Out_ MF_QUALITY_LEVEL * peQualityLevel )

Definition at line 364 of file StspMediaStream.cpp.

{
    return( E_NOTIMPL );
}

IFACEMETHODIMP GetService | ( | _In_ REFGUID | guidService,
 |  | _In_ REFIID | riid,
 |  | _Out_ LPVOID * | ppvObject
 | ) |  |

Definition at line 463 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    if (ppvObject == nullptr)
    {
        return E_POINTER;
    }
    *ppvObject = NULL;

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if( MF_QUALITY_SERVICES == guidService )
        {
            hr = QueryInterface(riid, ppvObject);
        }
        else
        {
            hr = MF_E_UNSUPPORTED_SERVICE;
        }
    }

    TRACEHR_RET(hr);
}

SourceState GetState ( ) const [inline]

Definition at line 69 of file StspMediaStream.h.

{return _eSourceState;}

IFACEMETHODIMP GetStreamDescriptor ( IMFStreamDescriptor ** ppStreamDescriptor )

Definition at line 256 of file StspMediaStream.cpp.

{
    if (ppStreamDescriptor == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *ppStreamDescriptor = _spStreamDescriptor.Get();
        (*ppStreamDescriptor)->AddRef();
    }

    TRACEHR_RET(hr);
}

void HandleError ( HRESULT hErrorCode ) [private]

Definition at line 815 of file StspMediaStream.cpp.

{
    if (hErrorCode != MF_E_SHUTDOWN)
    {
        // Send MEError to the client
        hErrorCode = QueueEvent(MEError, GUID_NULL, hErrorCode, nullptr);
    }
}

IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
void Initialize | ( | StspStreamDescription * | pStreamDescription,
 |  | Network::IBufferPacket * | pAttributesBuffer |
 | ) |  |  | [private]
bool IsActive ( ) const [inline]

Definition at line 68 of file StspMediaStream.h.

{return _fActive;}

IFACEMETHODIMP NotifyQualityEvent | ( | _In_opt_ IMFMediaEvent * | pEvent,
 |  | _Out_ DWORD * | pdwFlags
 | ) |  |

Definition at line 403 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    if (pdwFlags == nullptr || pEvent == nullptr)
    {
        return E_POINTER;
    }

    *pdwFlags = 0;

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        MediaEventType met;
        hr = pEvent->GetType(&met);

        if (SUCCEEDED(hr) && met == MEQualityNotify)
        {
            GUID guiExtendedType;
            hr = pEvent->GetExtendedType(&guiExtendedType);

            if (SUCCEEDED(hr) && guiExtendedType == MF_QUALITY_NOTIFY_SAMPLE_LAG)
            {
                PROPVARIANT var;
                PropVariantInit(&var);

                hr = pEvent->GetValue(&var);
                LONGLONG hnsSampleLatency = var.hVal.QuadPart;

                if (SUCCEEDED(hr))
                {
                    if (_eDropMode == MF_DROP_MODE_NONE && hnsSampleLatency > 30000000)
                    {
                        TRACE(TRACE_LEVEL_NORMAL, L"Entering drop mode\n");
                        hr = SetDropMode(MF_DROP_MODE_1);
                    }
                    else if (_eDropMode == MF_DROP_MODE_1 && hnsSampleLatency < 0)
                    {
                        TRACE(TRACE_LEVEL_NORMAL, L": Leaving drop mode\n");
                        hr = SetDropMode(MF_DROP_MODE_NONE);
                    }
                    else
                    {
                        TRACE(TRACE_LEVEL_NORMAL, L": Sample latency = %I64d\n", hnsSampleLatency);
                    }
                }

                PropVariantClear(&var);
            }
        }
    }

    TRACEHR_RET(hr);
}

void ProcessFormatChange ( IMFMediaType * pMediaType )

Definition at line 645 of file StspMediaStream.cpp.

{
    assert(pMediaType);

    try
    {
        ThrowIfError(CheckShutdown());

        // Check if we are in proper state if so deliver the sample otherwise just skip it and don't treat it as an error.
        if (_eSourceState == SourceState_Started)
        {
            // Put sample on the list
            ThrowIfError(_samples.InsertBack(pMediaType));
            // Deliver samples
            DeliverSamples();
        }
        else
        {
            Throw(MF_E_UNEXPECTED);
        }
    }
    catch(Exception ^exc)
    {
        HandleError(exc->HResult);
    }
}

void ProcessSample | ( | StspSampleHeader * | pSampleHeader,
 |  | IMFSample * | pSample
 | ) |  |

Definition at line 616 of file StspMediaStream.cpp.

{
    assert(pSample);

    try
    {
        ThrowIfError(CheckShutdown());
        // Set sample attributes
        SetSampleAttributes(pSampleHeader, pSample);

        // Check if we are in propper state if so deliver the sample otherwise just skip it and don't treat it as an error.
        if (_eSourceState == SourceState_Started)
        {
            // Put sample on the list
            ThrowIfError(_samples.InsertBack(pSample));
            // Deliver samples
            DeliverSamples();
        }
        else
        {
            Throw(MF_E_UNEXPECTED);
        }
    }
    catch(Exception ^exc)
    {
        HandleError(exc->HResult);
    }
}

IFACEMETHODIMP QueryInterface | ( | REFIID | iid,
 |  | void ** | ppv
 | ) |  |

Definition at line 99 of file StspMediaStream.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown ||
        riid == IID_IMFMediaStream ||
        riid == IID_IMFMediaEventGenerator)
    {
        (*ppv) = static_cast<IMFMediaStream*>(this);
        AddRef();
    }
    else if (riid == IID_IMFQualityAdvise || riid == IID_IMFQualityAdvise2)
    {
        (*ppv) = static_cast<IMFQualityAdvise2*>(this);
        AddRef();
    }
    else if (riid == IID_IMFGetService)
    {
        (*ppv) = static_cast<IMFGetService*>(this);
        AddRef();
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    return hr;
}

IFACEMETHODIMP QueueEvent | ( | MediaEventType | met,
 |  | REFGUID | guidExtendedType,
 |  | HRESULT | hrStatus,
 |  | const PROPVARIANT * | pvValue
 | ) |  |

Definition at line 216 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;

    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP RequestSample ( IUnknown * pToken )

Definition at line 278 of file StspMediaStream.cpp.

{
    CSourceLock lock(_spSource.Get());

    try
    {
        ThrowIfError(CheckShutdown());

        if (_eSourceState != SourceState_Started)
        {
            // We cannot be asked for a sample unless we are in started state
            Throw(MF_E_INVALIDREQUEST);
        }

        // Put token onto the list to return it when we have a sample ready
        ThrowIfError(_tokens.InsertBack(pToken));

        // Trigger sample delivery
        DeliverSamples();
    }
    catch(Exception ^exc)
    {
        HandleError(exc->HResult);
    }

    TRACEHR_RET(S_OK);
}

void ResetDropTime ( ) [private]

Definition at line 922 of file StspMediaStream.cpp.

{
    _fDropTime = false;
    _fInitDropTime = false;
    _hnsStartDroppingAt = 0;
    _hnsAmountToDrop = 0;
    _fWaitingForCleanPoint = true;
}

HRESULT SetActive ( bool fActive )

Definition at line 672 of file StspMediaStream.cpp.

{
    CSourceLock lock(_spSource.Get());

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_eSourceState != SourceState_Stopped &&
            _eSourceState != SourceState_Started)
        {
            hr = MF_E_INVALIDREQUEST;
        }
    }

    if (SUCCEEDED(hr))
    {
        _fActive = fActive;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP SetDropMode ( _In_ MF_QUALITY_DROP_MODE eDropMode )

Definition at line 308 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    //
    // Only support one drop mode
    //
    if( SUCCEEDED(hr) &&
        ((eDropMode < MF_DROP_MODE_NONE) || (eDropMode >= MF_DROP_MODE_2)))
    {
        hr = MF_E_NO_MORE_DROP_MODES;
    }

    if (SUCCEEDED(hr) && _eDropMode != eDropMode)
    {
        _eDropMode = eDropMode;
        _fWaitingForCleanPoint = true;

        TRACE(TRACE_LEVEL_NORMAL, L"Setting drop mode to %d\n", _eDropMode);
    }

    return( hr );
}

IFACEMETHODIMP SetQualityLevel ( _In_ MF_QUALITY_LEVEL eQualityLevel )

Definition at line 336 of file StspMediaStream.cpp.

{
    return( MF_E_NO_MORE_QUALITY_LEVELS );
}

HRESULT SetRate ( float flRate )

Definition at line 555 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    try
    {
        ThrowIfError(CheckShutdown());

        _flRate = flRate;
        if (_flRate != 1.0f)
        {
            CleanSampleQueue();
        }
    }
    catch(Exception ^exc)
    {
        HandleError(exc->HResult);
    }

    return S_OK;
}

void SetSampleAttributes | ( | StspSampleHeader * | pSampleHeader,
 |  | IMFSample * | pSample |
 | ) |  |  | [private]

Definition at line 824 of file StspMediaStream.cpp.

{
    ThrowIfError(pSample->SetSampleTime(pSampleHeader->ullTimestamp));
    ThrowIfError(pSample->SetSampleDuration(pSampleHeader->ullDuration));

    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, BottomFieldFirst);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, CleanPoint);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, DerivedFromTopField);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Discontinuity);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Interlaced);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, RepeatFirstField);
    SET_SAMPLE_ATTRIBUTE(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, SingleField);

    DWORD cbTotalLen;
    pSample->GetTotalLength(&cbTotalLen);
    TRACE(TRACE_LEVEL_LOW, L"Received sample TS-%I64d Duration-%I64d Length-%d %S\n", pSampleHeader->ullTimestamp, pSampleHeader->ullDuration, cbTotalLen, (pSampleHeader->dwFlags & StspSampleFlag_CleanPoint) ? "key frame" : "");
}

bool ShouldDropSample ( IMFSample * pSample ) [private]

Definition at line 842 of file StspMediaStream.cpp.

{
    if (!_fVideo)
    {
        return false;
    }

    bool fCleanPoint = MFGetAttributeUINT32( pSample, MFSampleExtension_CleanPoint, 0 ) > 0;
    bool fDrop = _flRate != 1.0f && !fCleanPoint;

    LONGLONG hnsTimeStamp = 0;
    ThrowIfError(pSample->GetSampleTime(&hnsTimeStamp));

    if (!fDrop && _fDropTime)
    {
        if (_fInitDropTime)
        {
            _hnsStartDroppingAt = hnsTimeStamp;
            _fInitDropTime = false;
        }

        fDrop = hnsTimeStamp < (_hnsStartDroppingAt + _hnsAmountToDrop);
        if (!fDrop)
        {
            TRACE(TRACE_LEVEL_LOW, L"Ending dropping time on sample ts=%I64d _hnsStartDroppingAt=%I64d _hnsAmountToDrop=%I64d\n",
                hnsTimeStamp, _hnsStartDroppingAt, _hnsAmountToDrop);
            ResetDropTime();
        }
        else
        {
            TRACE(TRACE_LEVEL_LOW, L": Dropping sample ts=%I64d _hnsStartDroppingAt=%I64d _hnsAmountToDrop=%I64d\n",
                hnsTimeStamp, _hnsStartDroppingAt, _hnsAmountToDrop);
        }
    }

    if (!fDrop && (_eDropMode == MF_DROP_MODE_1 || _fWaitingForCleanPoint))
    {
        // Only key frames
        fDrop = !fCleanPoint;
        if (fCleanPoint)
        {
            _fWaitingForCleanPoint = false;
        }

        if (fDrop)
        {
            TRACE(TRACE_LEVEL_LOW, L": Dropping sample ts=%I64d\n",
                hnsTimeStamp, _hnsStartDroppingAt, _hnsAmountToDrop);
        }
    }

    return fDrop;
}

HRESULT Shutdown ( )

Definition at line 592 of file StspMediaStream.cpp.

{
    CSourceLock lock(_spSource.Get());

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        Flush();

        if (_spEventQueue)
        {
            _spEventQueue->Shutdown();
            _spEventQueue.Reset();
        }

        _spStreamDescriptor.Reset();
        _eSourceState = SourceState_Shutdown;
    }

    TRACEHR_RET(hr);
}

HRESULT Start ( )

Definition at line 494 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_eSourceState == SourceState_Stopped ||
            _eSourceState == SourceState_Started)
        {
            _eSourceState = SourceState_Started;
            // Inform the client that we've started
            hr = QueueEvent(MEStreamStarted, GUID_NULL, S_OK, nullptr);
        }
        else
        {
            hr = MF_E_INVALID_STATE_TRANSITION;
        }
    }

    if (FAILED(hr))
    {
        HandleError(hr);
    }

    return S_OK;
}

HRESULT Stop ( )

Definition at line 524 of file StspMediaStream.cpp.

{
    HRESULT hr = S_OK;
    CSourceLock lock(_spSource.Get());

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_eSourceState == SourceState_Started)
        {
            _eSourceState = SourceState_Stopped;
            _tokens.Clear();
            _samples.Clear();
            // Inform the client that we've stopped.
            hr = QueueEvent(MEStreamStopped, GUID_NULL, S_OK, nullptr);
        }
        else
        {
            hr = MF_E_INVALID_STATE_TRANSITION;
        }
    }

    if (FAILED(hr))
    {
        HandleError(hr);
    }

    return S_OK;
}

Member Data Documentation

long _cRef [private]

Definition at line 103 of file StspMediaStream.h.

DWORD _dwId [private]

Definition at line 112 of file StspMediaStream.h.

MF_QUALITY_DROP_MODE _eDropMode [private]

Definition at line 117 of file StspMediaStream.h.

SourceState _eSourceState [private]

Definition at line 104 of file StspMediaStream.h.

bool _fActive [private]

Definition at line 113 of file StspMediaStream.h.

bool _fDiscontinuity [private]

Definition at line 118 of file StspMediaStream.h.

bool _fDropTime [private]

Definition at line 119 of file StspMediaStream.h.

bool _fInitDropTime [private]

Definition at line 120 of file StspMediaStream.h.

float _flRate [private]

Definition at line 115 of file StspMediaStream.h.

bool _fVideo [private]

Definition at line 114 of file StspMediaStream.h.

bool _fWaitingForCleanPoint [private]

Definition at line 121 of file StspMediaStream.h.

LONGLONG _hnsAmountToDrop [private]

Definition at line 123 of file StspMediaStream.h.

LONGLONG _hnsStartDroppingAt [private]

Definition at line 122 of file StspMediaStream.h.

ComPtrList<IUnknown> _samples [private]

Definition at line 109 of file StspMediaStream.h.

ComPtr<IMFMediaEventQueue> _spEventQueue [private]

Definition at line 106 of file StspMediaStream.h.

ComPtr<CMediaSource> _spSource [private]

Definition at line 105 of file StspMediaStream.h.

ComPtr<IMFStreamDescriptor> _spStreamDescriptor [private]

Definition at line 107 of file StspMediaStream.h.

ComPtrList<IUnknown, true> _tokens [private]

Definition at line 110 of file StspMediaStream.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSchemeHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CSchemeHandler
Private Member Functions

CSchemeHandler Class Reference

#include "StspSchemeHandler.h"

List of all members.

Private Member Functions

InspectableClass(L"Microsoft.Samples.SimpleCommunication.StspSchemeHandler",
BaseTrust) public 		~CSchemeHandler (void)
IFACEMETHOD() | BeginCreateObject (_In_ LPCWSTR pwszURL, _In_ DWORD dwFlags, _In_ IPropertyStore *pProps, _COM_Outptr_opt_ IUnknown **ppIUnknownCancelCookie, _In_ IMFAsyncCallback *pCallback, _In_ IUnknown *punkState)
IFACEMETHOD() | CancelObjectCreation (_In_ IUnknown *pIUnknownCancelCookie)
IFACEMETHOD() | EndCreateObject (_In_ IMFAsyncResult *pResult, _Out_ MF_OBJECT_TYPE *pObjectType, _Out_ IUnknown **ppObject)
IFACEMETHOD() | SetProperties (ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration)

Detailed Description

Definition at line 12 of file StspSchemeHandler.h.

Constructor & Destructor Documentation

~CSchemeHandler ( void ) [private]

Definition at line 23 of file StspSchemeHandler.cpp.

{
}

Member Function Documentation

IFACEMETHODIMP BeginCreateObject | ( | _In_ LPCWSTR | pwszURL,
 |  | _In_ DWORD | dwFlags,
 |  | _In_ IPropertyStore * | pProps,
 |  | _COM_Outptr_opt_ IUnknown ** | ppIUnknownCancelCookie,
 |  | _In_ IMFAsyncCallback * | pCallback,
 |  | _In_ IUnknown * | punkState |
 | ) |  |  | [private]

Definition at line 34 of file StspSchemeHandler.cpp.

{
    HRESULT hr = S_OK;
    ComPtr<CMediaSource> spSource;

    try
    {
        if (ppIUnknownCancelCookie != nullptr)
        {
            *ppIUnknownCancelCookie = nullptr;
        }

        if (pwszURL == nullptr || pCallback == nullptr)
        {
            Throw(E_INVALIDARG);
        }

        if ((dwFlags & MF_RESOLUTION_MEDIASOURCE) == 0)
        {
            Throw(E_INVALIDARG);
        }

        ComPtr<IMFAsyncResult> spResult;
        ThrowIfError(CMediaSource::CreateInstance(&spSource));

        ComPtr<IUnknown> spSourceUnk;
        ThrowIfError(spSource.As(&spSourceUnk));
        ThrowIfError(MFCreateAsyncResult(spSourceUnk.Get(), pCallback, punkState, &spResult));

        ComPtr<CSchemeHandler> spThis = this;
        spSource->OpenAsync(pwszURL).then([this, spThis, spResult, spSource](concurrency::task<void>& openTask)
        {
            try
            {
                if (spResult == nullptr)
                {
                    ThrowIfError(MF_E_UNEXPECTED);
                }

                openTask.get();
            }
            catch(Exception ^exc)
            {
                if (spResult != nullptr)
                {
                    spResult->SetStatus(exc->HResult);
                }
            }

            if (spResult != nullptr)
            {
                MFInvokeCallback(spResult.Get());
            }
        });
    }
    catch(Exception ^exc)
    {
        if (spSource != nullptr)
        {
            spSource->Shutdown();
        }
        hr = exc->HResult;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP CancelObjectCreation ( _In_ IUnknown * pIUnknownCancelCookie ) [private]

Definition at line 135 of file StspSchemeHandler.cpp.

{
    return E_NOTIMPL;
}

IFACEMETHODIMP EndCreateObject | ( | _In_ IMFAsyncResult * | pResult,
 |  | _Out_ MF_OBJECT_TYPE * | pObjectType,
 |  | _Out_ IUnknown ** | ppObject |
 | ) |  |  | [private]

Definition at line 107 of file StspSchemeHandler.cpp.

{
    if (pResult == nullptr || pObjectType == nullptr || ppObject == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = pResult->GetStatus();
    *pObjectType = MF_OBJECT_INVALID;
    *ppObject = nullptr;

    if (SUCCEEDED(hr))
    {
        ComPtr<IUnknown> punkSource;
        hr = pResult->GetObject(&punkSource);
        if (SUCCEEDED(hr))
        {
            *pObjectType = MF_OBJECT_MEDIASOURCE;
            *ppObject = punkSource.Detach();
        }
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP SetProperties ( ABI::Windows::Foundation::Collections::IPropertySet * pConfiguration ) [private]

Definition at line 28 of file StspSchemeHandler.cpp.

{
    return S_OK;
}

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSetRateOperation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CSetRateOperation
Public Member Functions | Private Attributes

CSetRateOperation Class Reference

#include "StspMediaSource.h"

Inherits Microsoft::Samples::SimpleCommunication::CSourceOperation.

List of all members.

Public Member Functions

CSetRateOperation (BOOL fThin, float flRate)
~CSetRateOperation ()
float | GetRate () const
BOOL | IsThin () const

Private Attributes

float | _flRate
BOOL | _fThin

Detailed Description

Definition at line 66 of file StspMediaSource.h.

Constructor & Destructor Documentation

CSetRateOperation | ( | BOOL | fThin,
 |  | float | flRate
 | ) |  |

Definition at line 70 of file StspMediaSource.cpp.

: CSourceOperation(CSourceOperation::Operation_SetRate)
, _fThin(fThin)
, _flRate(flRate)
{
}

~CSetRateOperation ( )

Definition at line 77 of file StspMediaSource.cpp.

{
}

Member Function Documentation

float GetRate ( ) const [inline]

Definition at line 73 of file StspMediaSource.h.

{return _flRate;}

BOOL IsThin ( ) const [inline]

Definition at line 72 of file StspMediaSource.h.

{return _fThin;}

Member Data Documentation

float _flRate [private]

Definition at line 77 of file StspMediaSource.h.

BOOL _fThin [private]

Definition at line 76 of file StspMediaSource.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSourceOperation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CSourceOperation
Public Types | Public Member Functions | Private Attributes

CSourceOperation Class Reference

#include "StspMediaSource.h"

Inherited by CSetRateOperation, and CStartOperation.

List of all members.

Public Types

enum | Type { Operation_Start, Operation_Stop, Operation_SetRate }

Public Member Functions

CSourceOperation (Type opType)
virtual | ~CSourceOperation ()
const PROPVARIANT & | GetData () const
Type | GetOperationType () const
IFACEMETHOD_ (ULONG, Release)()
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)
HRESULT | SetData (const PROPVARIANT &varData)

Private Attributes

long | _cRef
PROPVARIANT | _data
Type _opType

Detailed Description

Definition at line 21 of file StspMediaSource.h.

Member Enumeration Documentation

enum Type
Enumerator:
Operation_Start
Operation_Stop
Operation_SetRate

Definition at line 24 of file StspMediaSource.h.

    {
        // Start the source
        Operation_Start,
        // Stop the source
        Operation_Stop,
        // Set rate
        Operation_SetRate,
    };

Constructor & Destructor Documentation

CSourceOperation ( CSourceOperation::Type opType )

Definition at line 22 of file StspMediaSource.cpp.

: _cRef(1)
, _opType(opType)
{
    ZeroMemory(&_data, sizeof(_data));
}

~CSourceOperation ( ) [virtual]

Definition at line 29 of file StspMediaSource.cpp.

{
    PropVariantClear(&_data);
}

Member Function Documentation

const PROPVARIANT& GetData ( ) const [inline]

Definition at line 43 of file StspMediaSource.h.

{ return _data;}

Type GetOperationType ( ) const [inline]

Definition at line 42 of file StspMediaSource.h.

{return _opType;}

IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 35 of file StspMediaSource.cpp.

{
    return E_NOINTERFACE;
}

HRESULT SetData ( const PROPVARIANT & varData )

Definition at line 55 of file StspMediaSource.cpp.

{
    return PropVariantCopy(&_data, &varData);
}

Member Data Documentation

long _cRef [private]

Definition at line 47 of file StspMediaSource.h.

PROPVARIANT _data [private]

Definition at line 49 of file StspMediaSource.h.

Type _opType [private]

Definition at line 48 of file StspMediaSource.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CStartOperation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CStartOperation
Public Member Functions | Private Attributes

CStartOperation Class Reference

#include "StspMediaSource.h"

Inherits Microsoft::Samples::SimpleCommunication::CSourceOperation.

List of all members.

Public Member Functions

CStartOperation (IMFPresentationDescriptor *pPD)
~CStartOperation ()
IMFPresentationDescriptor * | GetPresentationDescriptor ()

Private Attributes

ComPtr< IMFPresentationDescriptor > | _spPD

Detailed Description

Definition at line 53 of file StspMediaSource.h.

Constructor & Destructor Documentation

CStartOperation ( IMFPresentationDescriptor * pPD )

Definition at line 60 of file StspMediaSource.cpp.

: CSourceOperation(CSourceOperation::Operation_Start)
, _spPD(pPD)
{
}

~CStartOperation ( )

Definition at line 66 of file StspMediaSource.cpp.

{
}

Member Function Documentation

IMFPresentationDescriptor* GetPresentationDescriptor ( ) [inline]

Definition at line 59 of file StspMediaSource.h.

{return _spPD.Get();}

Member Data Documentation

ComPtr<IMFPresentationDescriptor> _spPD [private]

Definition at line 62 of file StspMediaSource.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CStreamSink Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CStreamSink
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

CStreamSink Class Reference

#include "StspStreamSink.h"

List of all members.

Classes

class | CAsyncOperation

Public Types

enum State {
State_TypeNotSet = 0, State_Ready, State_Started, State_Stopped,
State_Paused, State_Count
}
enum StreamOperation {
OpSetMediaType = 0, OpStart, OpRestart, OpPause,
OpStop, OpProcessSample, OpPlaceMarker, Op_Count
}

Public Member Functions

CStreamSink (DWORD dwIdentifier)
virtual | ~CStreamSink ()
IFACEMETHOD() | BeginGetEvent (IMFAsyncCallback *pCallback, IUnknown *punkState)
HRESULT | CheckShutdown () const
IFACEMETHOD() | EndGetEvent (IMFAsyncResult *pResult, IMFMediaEvent **ppEvent)
ComPtr
< Network::IMediaBufferWrapper > 		FillStreamDescription (IMFMediaType *pMediaType, StspStreamDescription *pStreamDescription)
IFACEMETHOD() | Flush ()
IFACEMETHOD() | GetCurrentMediaType (IMFMediaType **ppMediaType)
IFACEMETHOD() | GetEvent (DWORD dwFlags, IMFMediaEvent **ppEvent)
IFACEMETHOD() | GetIdentifier (DWORD *pdwIdentifier)
IFACEMETHOD() | GetMajorType (GUID *pguidMajorType)
IFACEMETHOD() | GetMediaSink (IMFMediaSink **ppMediaSink)
IFACEMETHOD() | GetMediaTypeByIndex (DWORD dwIndex, IMFMediaType **ppType)
IFACEMETHOD() | GetMediaTypeCount (DWORD *pdwTypeCount)
IFACEMETHOD() | GetMediaTypeHandler (IMFMediaTypeHandler **ppHandler)
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD_ (ULONG, Release)()
HRESULT | Initialize (CMediaSink *pParent, Network::INetworkChannel^sender)
IFACEMETHOD() | IsMediaTypeSupported (IMFMediaType *pMediaType, IMFMediaType **ppMediaType)
bool | IsVideo () const
HRESULT | Pause ()
IFACEMETHOD() | PlaceMarker (MFSTREAMSINK_MARKER_TYPE eMarkerType, PROPVARIANT const *pvarMarkerValue, PROPVARIANT const *pvarContextValue)
IFACEMETHOD() | ProcessSample (IMFSample *pSample)
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)
IFACEMETHOD() | QueueEvent (MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, PROPVARIANT const *pvValue)
HRESULT | Restart ()
HRESULT | SetConnected (bool fConnected, LONGLONG llCurrentTime)
IFACEMETHOD() | SetCurrentMediaType (IMFMediaType *pMediaType)
HRESULT | Shutdown ()
HRESULT | Start (MFTIME start)
HRESULT | Stop ()

Static Public Attributes

static BOOL | ValidStateMatrix [State_Count][Op_Count]

Private Member Functions

HRESULT | AppendParameterSets (IMFSample *pCopyFrom, Network::IBufferPacket *pPacket)
void | DispatchProcessSample (CAsyncOperation *pOp)
bool | DropSamplesFromQueue ()
void | HandleError (HRESULT hr)
HRESULT | OnDispatchWorkItem (IMFAsyncResult *pAsyncResult)
ComPtr< Network::IBufferPacket > | PrepareFormatChange (IMFMediaType *pMediaType)
ComPtr< Network::IBufferPacket > | PrepareSample (IMFSample *pSample, bool fForce)
void | ProcessFormatChange (IMFMediaType *pMediaType)
bool | ProcessSamplesFromQueue (bool fFlush)
HRESULT | QueueAsyncOperation (StreamOperation op)
bool | SendSampleFromQueue ()
HRESULT | ValidateOperation (StreamOperation op)

Private Attributes

bool | _Connected
long | _cRef
CritSec _critSec
DWORD | _dwIdentifier
bool | _fFirstSampleAfterConnect
bool | _fGetStartTimeFromSample
bool | _fIsVideo
bool | _fWaitingForFirstSample
GUID | _guiCurrentSubtype
bool | _IsShutdown
Network::INetworkChannel | _networkSender
CMediaSink * _pParent
ComPtrList< IUnknown > | _SampleQueue
ComPtr< IMFByteStream > | _spByteStream
ComPtr< IMFMediaType > | _spCurrentType
ComPtr< IMFMediaEventQueue > | _spEventQueue
ComPtr< IMFSample > | _spFirstVideoSample
ComPtr< IUnknown > | _spFTM
ComPtr< IMFMediaSink > | _spSink
MFTIME | _StartTime
State _state
AsyncCallback< CStreamSink > _WorkQueueCB
DWORD | _WorkQueueId

Detailed Description

Definition at line 19 of file StspStreamSink.h.

Member Enumeration Documentation

enum State
Enumerator:
State_TypeNotSet
State_Ready
State_Started
State_Stopped
State_Paused
State_Count

Definition at line 23 of file StspStreamSink.h.

    {
        State_TypeNotSet = 0,    // No media type is set
        State_Ready,             // Media type is set, Start has never been called.
        State_Started,
        State_Stopped,
        State_Paused,
        State_Count              // Number of states
    };

enum StreamOperation
Enumerator:
OpSetMediaType
OpStart
OpRestart
OpPause
OpStop
OpProcessSample
OpPlaceMarker
Op_Count

Definition at line 34 of file StspStreamSink.h.

    {
        OpSetMediaType = 0,
        OpStart,
        OpRestart,
        OpPause,
        OpStop,
        OpProcessSample,
        OpPlaceMarker,

        Op_Count                // Number of operations
    };

Constructor & Destructor Documentation

CStreamSink ( DWORD dwIdentifier )

Definition at line 25 of file StspStreamSink.cpp.

    : _cRef(1)
    , _dwIdentifier(dwIdentifier)
    , _state(State_TypeNotSet)
    , _IsShutdown(false)
    , _Connected(false)
    , _fIsVideo(false)
    , _fGetStartTimeFromSample(false)
    , _fWaitingForFirstSample(false)
    , _fFirstSampleAfterConnect(false)
    , _StartTime(0)
    , _WorkQueueId(0)
    , _pParent(nullptr)
#pragma warning(push)
#pragma warning(disable:4355)
    , _WorkQueueCB(this, &CStreamSink::OnDispatchWorkItem)
#pragma warning(pop)
{
    ZeroMemory(&_guiCurrentSubtype, sizeof(_guiCurrentSubtype));
}

~CStreamSink ( ) [virtual]

Definition at line 46 of file StspStreamSink.cpp.

{
    assert(_IsShutdown);
}

Member Function Documentation

HRESULT AppendParameterSets | ( | IMFSample * | pCopyFrom,
 |  | Network::IBufferPacket * | pPacket |
 | ) |  |  | [private]
IFACEMETHODIMP BeginGetEvent | ( | IMFAsyncCallback * | pCallback,
 |  | IUnknown * | punkState
 | ) |  |

Definition at line 125 of file StspStreamSink.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->BeginGetEvent(pCallback, punkState);
    }

    TRACEHR_RET(hr);
}

HRESULT CheckShutdown ( ) const [inline]

Definition at line 112 of file StspStreamSink.h.

    {
        if (_IsShutdown)
        {
            return MF_E_SHUTDOWN;
        }
        else
        {
            return S_OK;
        }
    }

void DispatchProcessSample ( CAsyncOperation * pOp ) [private]

Definition at line 851 of file StspStreamSink.cpp.

{
    assert(pOp != nullptr);
    bool fRequestMoreSamples = false;
    if (!_Connected)
    {
        fRequestMoreSamples = DropSamplesFromQueue();
    }
    else
    {
        fRequestMoreSamples = SendSampleFromQueue();
    }

    // Ask for another sample
    if (fRequestMoreSamples)
    {
        if (pOp->m_op == OpProcessSample)
        {
            ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
        }
    }
}

bool DropSamplesFromQueue ( ) [private]

Definition at line 875 of file StspStreamSink.cpp.

{
    ProcessSamplesFromQueue(true);

    return true;
}

IFACEMETHODIMP EndGetEvent | ( | IMFAsyncResult * | pResult,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 141 of file StspStreamSink.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->EndGetEvent(pResult, ppEvent);
    }

    TRACEHR_RET(hr);
}

ComPtr< Network::IMediaBufferWrapper > FillStreamDescription | ( | IMFMediaType * | pMediaType,
 |  | StspStreamDescription * | pStreamDescription
 | ) |  |

Definition at line 1151 of file StspStreamSink.cpp.

{
    assert(pStreamDescription != nullptr);

    ComPtr<IMFMediaType> spMediaTypeToSend;

    // Clear the stream descriptor
    ZeroMemory(pStreamDescription, sizeof(*pStreamDescription));

    // Get major type (Audio, Video and so on)
    ThrowIfError(GetMajorType(&pStreamDescription->guiMajorType));

    // Get subtype (format of the stream)
    ThrowIfError(pMediaType->GetGUID(MF_MT_SUBTYPE, &pStreamDescription->guiSubType));

    ThrowIfError(MFCreateMediaType(&spMediaTypeToSend));

    FilterOutputMediaType(pMediaType, spMediaTypeToSend.Get());

    pStreamDescription->dwStreamId = _dwIdentifier;

    ComPtr<IMediaBufferWrapper> spAttributes;
    // Get size of attributes blob
    ThrowIfError(MFGetAttributesAsBlobSize(spMediaTypeToSend.Get(), &pStreamDescription->cbAttributesSize));

    // Prepare a buffer for attribute blob
    ThrowIfError(CreateMediaBufferWrapper(pStreamDescription->cbAttributesSize, &spAttributes));

    // Set length of the buffer
    ThrowIfError(spAttributes->SetCurrentLength(pStreamDescription->cbAttributesSize));

    // Copy attributes to the buffer
    ThrowIfError(MFGetAttributesAsBlob(spMediaTypeToSend.Get(), spAttributes->GetBuffer(), pStreamDescription->cbAttributesSize));

    return spAttributes;
}

IFACEMETHODIMP Flush ( )

Definition at line 363 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);
    HRESULT hr = S_OK;
    try
    {
        ThrowIfError(CheckShutdown());

        // Note: Even though we are flushing data, we still need to send
        // any marker events that were queued.
        DropSamplesFromQueue();
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetCurrentMediaType ( IMFMediaType ** ppMediaType )

Definition at line 540 of file StspStreamSink.cpp.

{
    if (ppMediaType == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        if (_spCurrentType == nullptr)
        {
            hr = MF_E_NOT_INITIALIZED;
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppMediaType = _spCurrentType.Get();
        (*ppMediaType)->AddRef();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetEvent | ( | DWORD | dwFlags,
 |  | IMFMediaEvent ** | ppEvent
 | ) |  |

Definition at line 157 of file StspStreamSink.cpp.

{
    // NOTE:
    // GetEvent can block indefinitely, so we don't hold the lock.
    // This requires some juggling with the event queue pointer.

    HRESULT hr = S_OK;

    ComPtr<IMFMediaEventQueue> spQueue;

    {
        AutoLock lock(_critSec);

        // Check shutdown
        hr = CheckShutdown();

        // Get the pointer to the event queue.
        if (SUCCEEDED(hr))
        {
            spQueue = _spEventQueue;
        }
    }

    // Now get the event.
    if (SUCCEEDED(hr))
    {
        hr = spQueue->GetEvent(dwFlags, ppEvent);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetIdentifier ( DWORD * pdwIdentifier )

Definition at line 226 of file StspStreamSink.cpp.

{
    if (pdwIdentifier == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        *pdwIdentifier = _dwIdentifier;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetMajorType ( GUID * pguidMajorType )

Definition at line 570 of file StspStreamSink.cpp.

{
    if (pguidMajorType == nullptr)
    {
        return E_INVALIDARG;
    }

    if (!_spCurrentType)
    {
        return MF_E_NOT_INITIALIZED;
    }

    *pguidMajorType = (_fIsVideo) ? MFMediaType_Video : MFMediaType_Audio;

    return S_OK;
}

IFACEMETHODIMP GetMediaSink ( IMFMediaSink ** ppMediaSink )

IMFStreamSink methods.

Definition at line 207 of file StspStreamSink.cpp.

{
    if (ppMediaSink == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        _spSink.Get()->QueryInterface(IID_IMFMediaSink, (void**)ppMediaSink);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetMediaTypeByIndex | ( | DWORD | dwIndex,
 |  | IMFMediaType ** | ppType
 | ) |  |

Definition at line 460 of file StspStreamSink.cpp.

{
    if (ppType == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if ( dwIndex > 0 )
    {
        hr = MF_E_NO_MORE_TYPES;
    }
    else
    {
        *ppType = _spCurrentType.Get();
        if (*ppType != nullptr)
        {
            (*ppType)->AddRef();
        }
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetMediaTypeCount ( DWORD * pdwTypeCount )

Definition at line 438 of file StspStreamSink.cpp.

{
    if (pdwTypeCount == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        // We've got only one media type
        *pdwTypeCount = 1;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetMediaTypeHandler ( IMFMediaTypeHandler ** ppHandler )

Definition at line 245 of file StspStreamSink.cpp.

{
    if (ppHandler == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    // This stream object acts as its own type handler, so we QI ourselves.
    if (SUCCEEDED(hr))
    {
        hr = QueryInterface(IID_IMFMediaTypeHandler, (void**)ppHandler);
    }

    TRACEHR_RET(hr);
}

void HandleError ( HRESULT hr ) [private]

Definition at line 1332 of file StspStreamSink.cpp.

{
    if (!_IsShutdown)
    {
        QueueEvent(MEError, GUID_NULL, hr, nullptr);
    }
}

IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
HRESULT Initialize | ( | CMediaSink * | pParent,
 |  | Network::INetworkChannel^ | sender
 | ) |  |
IFACEMETHODIMP IsMediaTypeSupported | ( | IMFMediaType * | pMediaType,
 |  | IMFMediaType ** | ppMediaType
 | ) |  |

IMFMediaTypeHandler methods.

Definition at line 387 of file StspStreamSink.cpp.

{
    if (pMediaType == nullptr)
    {
        return E_INVALIDARG;
    }

    AutoLock lock(_critSec);

    GUID majorType = GUID_NULL;
    UINT cbSize = 0;

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = pMediaType->GetGUID(MF_MT_MAJOR_TYPE, &majorType);
    }

    // First make sure it's video or audio type.
    if (SUCCEEDED(hr))
    {
        if (majorType != MFMediaType_Video && majorType != MFMediaType_Audio)
        {
            hr = MF_E_INVALIDTYPE;
        }
    }

    if (SUCCEEDED(hr) && _spCurrentType != nullptr)
    {
        GUID guiNewSubtype;
        if (FAILED(pMediaType->GetGUID(MF_MT_SUBTYPE, &guiNewSubtype)) ||
            guiNewSubtype != _guiCurrentSubtype)
        {
            hr = MF_E_INVALIDTYPE;
        }
    }

    // We don't return any "close match" types.
    if (ppMediaType)
    {
        *ppMediaType = nullptr;
    }

    TRACEHR_RET(hr);
}

bool IsVideo ( ) const [inline]

Definition at line 130 of file StspStreamSink.h.

{return _fIsVideo;}

HRESULT OnDispatchWorkItem ( IMFAsyncResult * pAsyncResult ) [private]

Definition at line 784 of file StspStreamSink.cpp.

{
    // Called by work queue thread. Need to hold the critical section.
    AutoLock lock(_critSec);

    try
    {
        ComPtr<IUnknown> spState;

        ThrowIfError(pAsyncResult->GetState(&spState));

        // The state object is a CAsncOperation object.
        CAsyncOperation *pOp = static_cast<CAsyncOperation *>(spState.Get());
        StreamOperation op = pOp->m_op;

        switch (op)
        {
        case OpStart:
        case OpRestart:
            // Send MEStreamSinkStarted.
            ThrowIfError(QueueEvent(MEStreamSinkStarted, GUID_NULL, S_OK, nullptr));

            // There might be samples queue from earlier (ie, while paused).
            bool fRequestMoreSamples;
            if (!_Connected)
            {
                // Just drop samples if we are not connected
                fRequestMoreSamples = DropSamplesFromQueue();
            }
            else
            {
                fRequestMoreSamples = SendSampleFromQueue();
            }
            if (fRequestMoreSamples)
            {
                // If false there is no samples in the queue now so request one
                ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
            }
            break;

        case OpStop:
            // Drop samples from queue.
            DropSamplesFromQueue();

            // Send the event even if the previous call failed.
            ThrowIfError(QueueEvent(MEStreamSinkStopped, GUID_NULL, S_OK, nullptr));
            break;

        case OpPause:
            ThrowIfError(QueueEvent(MEStreamSinkPaused, GUID_NULL, S_OK, nullptr));
            break;

        case OpProcessSample:
        case OpPlaceMarker:
        case OpSetMediaType:
            DispatchProcessSample(pOp);
            break;
        }
    }
    catch(Exception ^exc)
    {
        HandleError(exc->HResult);
    }
    return S_OK;
}

HRESULT Pause ( )

Definition at line 662 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = S_OK;

    hr = ValidateOperation(OpPause);

    if (SUCCEEDED(hr))
    {
        _state = State_Paused;
        hr = QueueAsyncOperation(OpPause);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP PlaceMarker | ( | MFSTREAMSINK_MARKER_TYPE | eMarkerType,
 |  | PROPVARIANT const * | pvarMarkerValue,
 |  | PROPVARIANT const * | pvarContextValue
 | ) |  |

Definition at line 322 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = S_OK;
    ComPtr<IMarker> spMarker;

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = ValidateOperation(OpPlaceMarker);
    }

    if (SUCCEEDED(hr))
    {
        hr = CreateMarker(eMarkerType, pvarMarkerValue, pvarContextValue, &spMarker);
    }

    if (SUCCEEDED(hr))
    {
        hr = _SampleQueue.InsertBack(spMarker.Get());
    }

    // Unless we are paused, start an async operation to dispatch the next sample/marker.
    if (SUCCEEDED(hr))
    {
        if (_state != State_Paused)
        {
            // Queue the operation.
            hr = QueueAsyncOperation(OpPlaceMarker); // Increments ref count on pOp.
        }
    }

    TRACEHR_RET(hr);
}

ComPtr< Network::IBufferPacket > PrepareFormatChange ( IMFMediaType * pMediaType ) [private]

Definition at line 1190 of file StspStreamSink.cpp.

{
    const DWORD c_cbPacketSize = sizeof(StspOperationHeader) + sizeof(StspStreamDescription);

    ComPtr<IMediaBufferWrapper> spBuffer;
    ThrowIfError(CreateMediaBufferWrapper(c_cbPacketSize, &spBuffer));

    // Prepare operation header
    BYTE *pBuf = spBuffer->GetBuffer();
    StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(pBuf);
    pOpHeader->cbDataSize = sizeof(StspStreamDescription);
    pOpHeader->eOperation = StspOperation_ServerFormatChange;

    // Prepare description
    StspStreamDescription *pStreamDescription = reinterpret_cast<StspStreamDescription *>(pBuf + sizeof(StspOperationHeader));
    ComPtr<IMediaBufferWrapper> spAttr = FillStreamDescription(pMediaType, pStreamDescription);

    // Add size of variable size attribute blob to size of the package.
    pOpHeader->cbDataSize += pStreamDescription->cbAttributesSize;

    // Set length of the packet
    ThrowIfError(spBuffer->SetCurrentLength(c_cbPacketSize));

    // Prepare packet to send
    ComPtr<IBufferPacket> spPacket;

    ThrowIfError(CreateBufferPacket(&spPacket));
    // Add fixed size header and description to the packet
    ThrowIfError(spPacket->AddBuffer(spBuffer.Get()));
    // Add attributes
    ThrowIfError(spPacket->AddBuffer(spAttr.Get()));

    return spPacket;
}

ComPtr< Network::IBufferPacket > PrepareSample | ( | IMFSample * | pSample,
 |  | bool | fForce |
 | ) |  |  | [private]

Definition at line 1076 of file StspStreamSink.cpp.

{
    assert(pSample);

    ComPtr<IMediaBufferWrapper> spBuffer;
    ComPtr<IBufferPacket> spPacket;
    const size_t c_cbHeaderSize = sizeof(StspOperationHeader) + sizeof(StspSampleHeader);
    DWORD cbTotalSampleLength = 0;
    LONGLONG llSampleTime;

    ThrowIfError(pSample->GetSampleTime(&llSampleTime));
    llSampleTime -= _StartTime;

    if (llSampleTime < 0 && !fForce)
    {
        // Return nullptr;
        return spPacket;
    }

    if (llSampleTime < 0)
    {
        llSampleTime = 0;
    }

    // Create packet and initialize it with current sample
    ThrowIfError(CreateBufferPacketFromMFSample(pSample, &spPacket));
    ThrowIfError(pSample->GetTotalLength(&cbTotalSampleLength));
    ThrowIfError(CreateMediaBufferWrapper(c_cbHeaderSize, &spBuffer));

    // Prepare the headers
    BYTE *pBuf = spBuffer->GetBuffer();
    // Operation header
    StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(pBuf);
    pOpHeader->eOperation = StspOperation_ServerSample;
    pOpHeader->cbDataSize = sizeof(StspSampleHeader) + cbTotalSampleLength;

    // Sample header
    StspSampleHeader *pSampleHeader = reinterpret_cast<StspSampleHeader *>(pBuf + sizeof(StspOperationHeader));
    ZeroMemory(pSampleHeader, sizeof(*pSampleHeader));
    GetIdentifier(&pSampleHeader->dwStreamId);
    if (_fGetStartTimeFromSample)
    {
        pSample->GetSampleTime(&_StartTime);
        _fGetStartTimeFromSample = false;
        llSampleTime = 0;
    }
    pSampleHeader->ullTimestamp = llSampleTime;
    if (FAILED(pSample->GetSampleDuration(&pSampleHeader->ullDuration)))
    {
        pSampleHeader->ullDuration = 0;
    }

    // Set up video samples
    if (IsVideo())
    {
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, BottomFieldFirst);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, CleanPoint);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, DerivedFromTopField);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Discontinuity);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Interlaced);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, RepeatFirstField);
        SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, SingleField);
    }

    ThrowIfError(spBuffer->SetCurrentLength(c_cbHeaderSize));

    // Put headers before sample
    ThrowIfError(spPacket->InsertBuffer(0, spBuffer.Get()));

    _fFirstSampleAfterConnect = false;

    return spPacket;
}

void ProcessFormatChange ( IMFMediaType * pMediaType ) [private]

Definition at line 1008 of file StspStreamSink.cpp.

{
    assert(pMediaType != nullptr);

    // Add the media type to the sample queue.
    ThrowIfError(_SampleQueue.InsertBack(pMediaType));

    // Unless we are paused, start an async operation to dispatch the next sample.
    // Queue the operation.
    ThrowIfError(QueueAsyncOperation(OpSetMediaType));
}

IFACEMETHODIMP ProcessSample ( IMFSample * pSample )

Definition at line 266 of file StspStreamSink.cpp.

{
    if (pSample == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    // Validate the operation.
    if (SUCCEEDED(hr))
    {
        hr = ValidateOperation(OpProcessSample);
    }

    if (SUCCEEDED(hr) && _fWaitingForFirstSample && !_Connected)
    {
        _spFirstVideoSample = pSample;
        _fWaitingForFirstSample = false;

        hr = QueueEvent(MEStreamSinkRequestSample, GUID_NULL, hr, nullptr);
    }
    else if (SUCCEEDED(hr))
    {
        // Add the sample to the sample queue.
        if (SUCCEEDED(hr))
        {
            hr = _SampleQueue.InsertBack(pSample);
        }

        // Unless we are paused, start an async operation to dispatch the next sample.
        if (SUCCEEDED(hr))
        {
            if (_state != State_Paused)
            {
                // Queue the operation.
                hr = QueueAsyncOperation(OpProcessSample);
            }
        }
    }

    TRACEHR_RET(hr);
}

bool ProcessSamplesFromQueue ( bool fFlush ) [private]

Definition at line 888 of file StspStreamSink.cpp.

{
    bool fNeedMoreSamples = false;

    ComPtr<IUnknown> spunkSample;

    bool fSendSamples = true;
    bool fSendEOS = false;

    if (FAILED(_SampleQueue.RemoveFront(&spunkSample)))
    {
        fNeedMoreSamples = true;
        fSendSamples = false;
    }

    while (fSendSamples)
    {
        ComPtr<IMFSample> spSample;
        ComPtr<IBufferPacket> spPacket;
        bool fProcessingSample = false;
        assert(spunkSample);

        // Figure out if this is a marker or a sample.
        // If this is a sample, write it to the file.
        // Now handle the sample/marker appropriately.
        if (SUCCEEDED(spunkSample.As(&spSample)))
        {
            assert(spSample);    // Not a marker, must be a sample

            if (!fFlush)
            {
                // Prepare sample for sending
                spPacket = PrepareSample(spSample.Get(), false);
                fProcessingSample = true;
            }
        }
        else
        {
            ComPtr<IMarker> spMarker;
            // Check if it is a marker
            if (SUCCEEDED(spunkSample.As(&spMarker)))
            {
                MFSTREAMSINK_MARKER_TYPE markerType;
                PROPVARIANT var;
                PropVariantInit(&var);
                ThrowIfError(spMarker->GetMarkerType(&markerType));
                // Get the context data.
                ThrowIfError(spMarker->GetContext(&var));

                HRESULT hr = QueueEvent(MEStreamSinkMarker, GUID_NULL, S_OK, &var);

                PropVariantClear(&var);

                ThrowIfError(hr);

                if (markerType == MFSTREAMSINK_MARKER_ENDOFSEGMENT)
                {
                    fSendEOS = true;
                }
            }
            else
            {
                ComPtr<IMFMediaType> spType;
                ThrowIfError(spunkSample.As(&spType));
                if (!fFlush)
                {
                    spPacket = PrepareFormatChange(spType.Get());
                }
            }
        }

        if (spPacket)
        {
            ComPtr<CStreamSink> spThis = this;
            // Send the sample
            concurrency::create_task(_networkSender->SendAsync(spPacket.Get())).then([this, spThis, fProcessingSample](concurrency::task<void>& sendTask)
            {
                AutoLock lock(_critSec);
                try
                {
                    sendTask.get();
                    ThrowIfError(CheckShutdown());
                    if (_state == State_Started && fProcessingSample)
                    {
                        // If we are still in started state request another sample
                        ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
                    }
                }
                catch(Exception ^exc)
                {
                    HandleError(exc->HResult);
                }
            });
            // We stop if we processed a sample otherwise keep looking
            fSendSamples = !fProcessingSample;
        }

        if (fSendSamples)
        {
            if (FAILED(_SampleQueue.RemoveFront(spunkSample.ReleaseAndGetAddressOf())))
            {
                fNeedMoreSamples = true;
                fSendSamples = false;
            }
        }

    }

    if (fSendEOS)
    {
        ComPtr<CMediaSink> spParent = _pParent;
        concurrency::create_task([spParent](){
            spParent->ReportEndOfStream();
        });
    }

    return fNeedMoreSamples;
}

IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 54 of file StspStreamSink.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown ||
        riid == IID_IMFStreamSink ||
        riid == IID_IMFMediaEventGenerator)
    {
        (*ppv) = static_cast<IMFStreamSink*>(this);
        AddRef();
    }
    else if (riid == IID_IMFMediaTypeHandler)
    {
        (*ppv) = static_cast<IMFMediaTypeHandler*>(this);
        AddRef();
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (FAILED(hr) && riid == IID_IMarshal)
    {
        if (_spFTM == nullptr)
        {
            AutoLock lock(_critSec);
            if (_spFTM == nullptr)
            {
                hr = CoCreateFreeThreadedMarshaler(static_cast<IMFStreamSink*>(this), &_spFTM);
            }
        }

        if (SUCCEEDED(hr))
        {
            if (_spFTM == nullptr)
            {
                hr = E_UNEXPECTED;
            }
            else
            {
                hr = _spFTM.Get()->QueryInterface(riid, ppv);
            }
        }
    }

    return hr;
}

HRESULT QueueAsyncOperation ( StreamOperation op ) [private]

Definition at line 766 of file StspStreamSink.cpp.

{
    HRESULT hr = S_OK;
    ComPtr<CAsyncOperation> spOp;
    spOp.Attach(new CAsyncOperation(op)); // Created with ref count = 1
    if (!spOp)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        hr = MFPutWorkItem2(_WorkQueueId, 0, &_WorkQueueCB, spOp.Get());
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP QueueEvent | ( | MediaEventType | met,
 |  | REFGUID | guidExtendedType,
 |  | HRESULT | hrStatus,
 |  | PROPVARIANT const * | pvValue
 | ) |  |

Definition at line 189 of file StspStreamSink.cpp.

{
    HRESULT hr = S_OK;

    AutoLock lock(_critSec);

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        hr = _spEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
    }

    TRACEHR_RET(hr);
}

HRESULT Restart ( )

Definition at line 680 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = S_OK;

    hr = ValidateOperation(OpRestart);

    if (SUCCEEDED(hr))
    {
        _state = State_Started;
        hr = QueueAsyncOperation(OpRestart);
    }

    TRACEHR_RET(hr);
}

bool SendSampleFromQueue ( ) [private]

Definition at line 883 of file StspStreamSink.cpp.

{
    return ProcessSamplesFromQueue(false);
}

HRESULT SetConnected | ( | bool | fConnected,
 |  | LONGLONG | llCurrentTime
 | ) |  |

Definition at line 1021 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);
    HRESULT hr = S_OK;
    try
    {
        if (_spCurrentType == nullptr)
        {
            Throw(MF_E_NOT_INITIALIZED);
        }

        _StartTime = llCurrentTime;
        _Connected = fConnected;
        if (fConnected)
        {
            if (_spFirstVideoSample)
            {
                ComPtr<IBufferPacket> spPacket = PrepareSample(_spFirstVideoSample.Get(), true);
                _spFirstVideoSample.Reset();

                if (spPacket != nullptr)
                {
                    ComPtr<CStreamSink> spThis = this;
                    // Send the sample
                    concurrency::create_task(_networkSender->SendAsync(spPacket.Get())).then([this, spThis](concurrency::task<void>& sendTask)
                    {
                        AutoLock lock(_critSec);
                        try
                        {
                            sendTask.get();
                            ThrowIfError(CheckShutdown());
                        }
                        catch(Exception ^exc)
                        {
                            HandleError(exc->HResult);
                        }
                    });
                }
            }

            TRACE(TRACE_LEVEL_LOW, L"SetConnected start=%I64d\n", _StartTime);

            _fFirstSampleAfterConnect = true;
        }
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP SetCurrentMediaType ( IMFMediaType * pMediaType )

Definition at line 491 of file StspStreamSink.cpp.

{
    HRESULT hr = S_OK;
    try
    {
        if (pMediaType == nullptr)
        {
            Throw(E_INVALIDARG);
        }
        AutoLock lock(_critSec);

        ThrowIfError(CheckShutdown());

        // We don't allow format changes after streaming starts.
        ThrowIfError(ValidateOperation(OpSetMediaType));

        // We set media type already
        if (_state >= State_Ready)
        {
            ThrowIfError(IsMediaTypeSupported(pMediaType, nullptr));
        }

        GUID guiMajorType;
        pMediaType->GetMajorType(&guiMajorType);
        _fIsVideo = (guiMajorType == MFMediaType_Video);

        ThrowIfError(MFCreateMediaType(_spCurrentType.ReleaseAndGetAddressOf()));
        ThrowIfError(pMediaType->CopyAllItems(_spCurrentType.Get()));
        ThrowIfError(_spCurrentType->GetGUID(MF_MT_SUBTYPE, &_guiCurrentSubtype));
        if (_state < State_Ready)
        {
            _state = State_Ready;
        }
        else if (_state > State_Ready)
        {
            ComPtr<IMFMediaType> spType;
            ThrowIfError(MFCreateMediaType(&spType));
            ThrowIfError(pMediaType->CopyAllItems(spType.Get()));
            ProcessFormatChange(spType.Get());
        }
    }
    catch(Exception ^exc)
    {
        hr = exc->HResult;
    }
    TRACEHR_RET(hr);
}

HRESULT Shutdown ( )

Definition at line 737 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    if (!_IsShutdown)
    {
        if (_spEventQueue)
        {
            _spEventQueue->Shutdown();
        }

        MFUnlockWorkQueue(_WorkQueueId);

        _SampleQueue.Clear();

        _spSink.Reset();
        _spEventQueue.Reset();
        _spByteStream.Reset();
        _spCurrentType.Reset();
        _networkSender = nullptr;

        _IsShutdown = true;
    }

    return S_OK;
}

HRESULT Start ( MFTIME start )

Definition at line 616 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = S_OK;

    hr = ValidateOperation(OpStart);

    if (SUCCEEDED(hr))
    {
        if (start != PRESENTATION_CURRENT_POSITION)
        {
            _StartTime = start;        // Cache the start time.
            _fGetStartTimeFromSample = false;
        }
        else
        {
            _fGetStartTimeFromSample = true;
        }
        _state = State_Started;
        _fWaitingForFirstSample = _fIsVideo;
        hr = QueueAsyncOperation(OpStart);
    }

    TRACEHR_RET(hr);
}

HRESULT Stop ( )

Definition at line 644 of file StspStreamSink.cpp.

{
    AutoLock lock(_critSec);

    HRESULT hr = S_OK;

    hr = ValidateOperation(OpStop);

    if (SUCCEEDED(hr))
    {
        _state = State_Stopped;
        hr = QueueAsyncOperation(OpStop);
    }

    TRACEHR_RET(hr);
}

HRESULT ValidateOperation ( StreamOperation op ) [private]

Definition at line 716 of file StspStreamSink.cpp.

{
    assert(!_IsShutdown);

    HRESULT hr = S_OK;

    if (ValidStateMatrix[_state][op])
    {
        return S_OK;
    }
    else if (_state == State_TypeNotSet)
    {
        return MF_E_NOT_INITIALIZED;
    }
    else
    {
        return MF_E_INVALIDREQUEST;
    }
}

Member Data Documentation

bool _Connected [private]

Definition at line 160 of file StspStreamSink.h.

long _cRef [private]

Definition at line 154 of file StspStreamSink.h.

CritSec _critSec [private]

Definition at line 155 of file StspStreamSink.h.

DWORD _dwIdentifier [private]

Definition at line 157 of file StspStreamSink.h.

bool _fFirstSampleAfterConnect [private]

Definition at line 164 of file StspStreamSink.h.

bool _fGetStartTimeFromSample [private]

Definition at line 161 of file StspStreamSink.h.

bool _fIsVideo [private]

Definition at line 162 of file StspStreamSink.h.

bool _fWaitingForFirstSample [private]

Definition at line 163 of file StspStreamSink.h.

GUID _guiCurrentSubtype [private]

Definition at line 165 of file StspStreamSink.h.

bool _IsShutdown [private]

Definition at line 159 of file StspStreamSink.h.

Network::INetworkChannel _networkSender [private]

Definition at line 181 of file StspStreamSink.h.

CMediaSink* _pParent [private]

Definition at line 171 of file StspStreamSink.h.

ComPtrList<IUnknown> _SampleQueue [private]

Definition at line 178 of file StspStreamSink.h.

ComPtr<IMFByteStream> _spByteStream [private]

Definition at line 174 of file StspStreamSink.h.

ComPtr<IMFMediaType> _spCurrentType [private]

Definition at line 175 of file StspStreamSink.h.

ComPtr<IMFMediaEventQueue> _spEventQueue [private]

Definition at line 173 of file StspStreamSink.h.

ComPtr<IMFSample> _spFirstVideoSample [private]

Definition at line 176 of file StspStreamSink.h.

ComPtr<IUnknown> _spFTM [private]

Definition at line 185 of file StspStreamSink.h.

ComPtr<IMFMediaSink> _spSink [private]

Definition at line 170 of file StspStreamSink.h.

MFTIME _StartTime [private]

Definition at line 168 of file StspStreamSink.h.

State _state [private]

Definition at line 158 of file StspStreamSink.h.

AsyncCallback<CStreamSink> _WorkQueueCB [private]

Definition at line 183 of file StspStreamSink.h.

DWORD _WorkQueueId [private]

Definition at line 167 of file StspStreamSink.h.

BOOL ValidStateMatrix [static]
Initial value:
{

  TRUE,     FALSE,    FALSE,    FALSE,    FALSE,    FALSE,    FALSE,

   TRUE,     TRUE,     FALSE,    TRUE,     TRUE,     FALSE,    TRUE,

   TRUE,     TRUE,     FALSE,    TRUE,     TRUE,     TRUE,     TRUE,

   TRUE,     TRUE,     TRUE,     TRUE,     TRUE,     TRUE,     TRUE,

    TRUE,     TRUE,     FALSE,    FALSE,    TRUE,     FALSE,    TRUE,

}

Definition at line 104 of file StspStreamSink.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CStreamSink::CAsyncOperation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • CStreamSink
  • CStreamSink::CAsyncOperation
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

CStreamSink::CAsyncOperation Class Reference

#include "StspStreamSink.h"

List of all members.

Public Member Functions

CAsyncOperation (StreamOperation op)
STDMETHODIMP | QueryInterface (REFIID iid, void **ppv)
STDMETHODIMP_ (ULONG) AddRef()
STDMETHODIMP_ (ULONG) Release()

Public Attributes

StreamOperation m_op

Private Member Functions

virtual | ~CAsyncOperation ()

Private Attributes

long | _cRef

Detailed Description

Definition at line 52 of file StspStreamSink.h.

Constructor & Destructor Documentation

CAsyncOperation ( StreamOperation op )

Definition at line 1225 of file StspStreamSink.cpp.

    : _cRef(1)
    , m_op(op)
{
}

~CAsyncOperation ( ) [private, virtual]

Definition at line 1231 of file StspStreamSink.cpp.

{
    assert(_cRef == 0);
}

Member Function Documentation

HRESULT QueryInterface | ( | REFIID | iid,
 |  | void ** | ppv
 | ) |  |

Definition at line 1252 of file StspStreamSink.cpp.

{
    if (!ppv)
    {
        return E_POINTER;
    }
    if (iid == IID_IUnknown)
    {
        *ppv = static_cast<IUnknown*>(this);
    }
    else
    {
        *ppv = nullptr;
        return E_NOINTERFACE;
    }
    AddRef();
    return S_OK;
}

STDMETHODIMP_ ( ULONG )
STDMETHODIMP_ ( ULONG )

Member Data Documentation

long _cRef [private]

Definition at line 65 of file StspStreamSink.h.

StreamOperation m_op

Definition at line 57 of file StspStreamSink.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISinkCallback Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • ISinkCallback
Public Member Functions

ISinkCallback Interface Reference

#include "StspMediaSinkProxy.h"

Inherited by sealed::sealed.

List of all members.

Public Member Functions

void | FireIncomingConnection (IncomingConnectionEventArgs^args)
void | OnShutdown ()

Detailed Description

Definition at line 36 of file StspMediaSinkProxy.h.

Member Function Documentation

void FireIncomingConnection ( IncomingConnectionEventArgs^ args )

Implemented in sealed::sealed.

void OnShutdown ( )

Implemented in sealed::sealed.

The documentation for this interface was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: abstract Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • abstract
Public Member Functions | Public Attributes

abstract Class Reference

#include "StspNetwork.h"

List of all members.

Public Member Functions

virtual void | Close ()=0
virtual void | Disconnect ()=0
virtual
Windows::Foundation::IAsyncAction 		ReceiveAsync (_In_ IMediaBufferWrapper *pBuffer)=0

Public Attributes

internal | __pad0__: virtual Windows::Foundation::IAsyncAction ^SendAsync(_In_ IBufferPacket *pPacket) = 0

Detailed Description

Definition at line 52 of file StspNetwork.h.

Member Function Documentation

virtual void Close ( ) [pure virtual]
virtual void Disconnect ( ) [pure virtual]
virtual Windows::Foundation::IAsyncAction ReceiveAsync ( _In_ IMediaBufferWrapper * pBuffer ) [pure virtual]

Member Data Documentation

internal __pad0__

Definition at line 55 of file StspNetwork.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CBufferEnumerator Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • CBufferEnumerator
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes

CBufferEnumerator Class Reference

#include "BufferPacket.h"

List of all members.

Public Member Functions

IFACEMETHOD() | GetCurrent (_Out_ IMediaBufferWrapper **ppBuffer)
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD_ (bool, IsValid)()
IFACEMETHOD_ (ULONG, Release)()
IFACEMETHOD() | MoveNext ()
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)
IFACEMETHOD() | Reset ()

Static Public Member Functions

static HRESULT | CreateInstance (CBufferPacket::Container &container, IUnknown *pParent, IBufferEnumerator **ppEnumerator)

Protected Member Functions

CBufferEnumerator (CBufferPacket::Container &container, IUnknown *pParent)
~CBufferEnumerator ()

Private Attributes

CBufferPacket::Container & _buffers
long | _cRef
CBufferPacket::Iterator _currentIt
ComPtr< IUnknown > | _spParent

Detailed Description

Definition at line 56 of file BufferPacket.h.

Constructor & Destructor Documentation

CBufferEnumerator | ( | CBufferPacket::Container & | container,
 |  | IUnknown * | pParent |
 | ) |  |  | [protected]

Definition at line 513 of file BufferPacket.cpp.

    : _cRef(1)
    , _buffers(container)
    , _spParent(pParent)
    , _currentIt(container.begin())
{
}

~CBufferEnumerator ( ) [protected]

Definition at line 521 of file BufferPacket.cpp.

{
}

Member Function Documentation

HRESULT CreateInstance | ( | CBufferPacket::Container & | container,
 |  | IUnknown * | pParent,
 |  | IBufferEnumerator ** | ppEnumerator |
 | ) |  |  | [static]

Definition at line 490 of file BufferPacket.cpp.

{
    ComPtr<IBufferEnumerator> spResult;

    if (ppEnumerator == nullptr)
    {
        return E_INVALIDARG;
    }

    spResult.Attach(new CBufferEnumerator(container, pParent));

    if (!spResult)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        *ppEnumerator = spResult.Detach();
    }

    return S_OK;
}

IFACEMETHODIMP GetCurrent ( _Out_ IMediaBufferWrapper ** ppBuffer )

Definition at line 569 of file BufferPacket.cpp.

{
    if (ppBuffer == nullptr)
    {
        return E_INVALIDARG;
    }

    if (!IsValid())
    {
        return MF_E_OUT_OF_RANGE;
    }

    *ppBuffer = (*_currentIt).Get();
    (*ppBuffer)->AddRef();

    return S_OK;
}

IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHOD_ | ( | bool | ,
 |  | IsValid |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
IFACEMETHODIMP MoveNext ( )

Definition at line 587 of file BufferPacket.cpp.

{
    if (!IsValid())
    {
        return MF_E_OUT_OF_RANGE;
    }

    ++_currentIt;

    if (!IsValid())
    {
        return MF_E_OUT_OF_RANGE;
    }

    return S_OK;
}

IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 526 of file BufferPacket.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown || riid == __uuidof(IBufferEnumerator))
    {
        (*ppv) = static_cast<IBufferEnumerator*>(this);
        AddRef();
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    return hr;
}

IFACEMETHODIMP Reset ( )

Definition at line 604 of file BufferPacket.cpp.

{
    _currentIt = _buffers.begin();

    if (!IsValid())
    {
        return MF_E_OUT_OF_RANGE;
    }

    return S_OK;
}

Member Data Documentation

CBufferPacket::Container& _buffers [private]

Definition at line 78 of file BufferPacket.h.

long _cRef [private]

Definition at line 77 of file BufferPacket.h.

CBufferPacket::Iterator _currentIt [private]

Definition at line 79 of file BufferPacket.h.

ComPtr<IUnknown> _spParent [private]

Definition at line 80 of file BufferPacket.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CBufferPacket Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • CBufferPacket
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes

CBufferPacket Class Reference

#include "BufferPacket.h"

List of all members.

Public Types

typedef std::list< ComPtr
< IMediaBufferWrapper > > 		Container
typedef std::list< ComPtr
< IMediaBufferWrapper >
>::iterator 		Iterator

Public Member Functions

IFACEMETHOD() | AddBuffer (IMediaBufferWrapper *pBuffer)
IFACEMETHOD() | Clear ()
IFACEMETHOD() | CopyTo (DWORD nOffset, DWORD cbSize, _In_reads_bytes_(cbSize) void *pDest, _Out_ DWORD *pcbCopied)
IFACEMETHOD() | GetEnumerator (_Out_ IBufferEnumerator **ppEnumerator)
IFACEMETHOD() | GetTotalLength (_Out_ DWORD *pcbTotalLength)
IFACEMETHOD_ (ULONG, AddRef)()
IFACEMETHOD_ (size_t, GetBufferCount)() const
IFACEMETHOD_ (ULONG, Release)()
IFACEMETHOD() | InsertBuffer (unsigned int nIndex, IMediaBufferWrapper *pBuffer)
IFACEMETHOD() | MoveLeft (DWORD cbSize, _Out_writes_bytes_(cbSize) void *pDest)
IFACEMETHOD() | QueryInterface (REFIID riid, void **ppv)
IFACEMETHOD() | RemoveBuffer (unsigned int nIndex, IMediaBufferWrapper **ppBuffer)
IFACEMETHOD() | ToMFSample (IMFSample **ppSample)
IFACEMETHOD() | TrimLeft (DWORD cbSize)

Static Public Member Functions

static HRESULT | CreateInstance (IBufferPacket **ppBufferPackage)
static HRESULT | FromMFSample (IMFSample *pSample, IBufferPacket **ppBufferPackage)

Protected Member Functions

CBufferPacket (void)
~CBufferPacket (void)

Private Attributes

Container _buffers
long | _cRef

Detailed Description

Definition at line 14 of file BufferPacket.h.

Member Typedef Documentation

typedef std::list<ComPtr<IMediaBufferWrapper> > Container

Definition at line 17 of file BufferPacket.h.

typedef std::list<ComPtr<IMediaBufferWrapper> >::iterator Iterator

Definition at line 18 of file BufferPacket.h.

Constructor & Destructor Documentation

CBufferPacket ( void ) [protected]

Definition at line 23 of file BufferPacket.cpp.

    : _cRef(1)
{
}

~CBufferPacket ( void ) [protected]

Definition at line 29 of file BufferPacket.cpp.

{
}

Member Function Documentation

IFACEMETHODIMP AddBuffer ( IMediaBufferWrapper * pBuffer )

Definition at line 153 of file BufferPacket.cpp.

{
    _buffers.push_back(pBuffer);

    return S_OK;
}

IFACEMETHODIMP Clear ( )

Definition at line 197 of file BufferPacket.cpp.

{
    _buffers.clear();
    return S_OK;
}

IFACEMETHODIMP CopyTo | ( | DWORD | nOffset,
 |  | DWORD | cbSize,
 |  | _In_reads_bytes_(cbSize) void * | pDest,
 |  | _Out_ DWORD * | pcbCopied
 | ) |  |

Definition at line 304 of file BufferPacket.cpp.

{
    if (pDest == nullptr || pcbCopied == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;
    Iterator it = _buffers.begin();
    Iterator itEnd = _buffers.end();
    DWORD cbSkipped = 0;
    DWORD cbCopied = 0;

    // Skip to the offset
    for (;cbSkipped < nOffset && it != itEnd; ++it)
    {
        DWORD cbLen;
        DWORD nStart = 0;
        DWORD cbCopy = 0;
        hr = (*it)->GetCurrentLength(&cbLen);
        if (FAILED(hr))
        {
            break;
        }
        if (cbSkipped + cbLen <= nOffset)
        {
            cbSkipped += cbLen;
            if (cbSkipped == nOffset)
            {
                break;
            }
            continue;
        }
        else
        {
            nStart = nOffset - cbSkipped;
            cbCopy = min(cbSize, cbLen - nStart);
        }

       CopyMemory(pDest, (*it)->GetBuffer() + nStart, cbCopy);

       cbCopied = cbCopy;
       cbSkipped += nStart;
    }

    if (SUCCEEDED(hr))
    {
        for (;it != itEnd && cbCopied < cbSize; ++it)
        {
            DWORD cbLen;
            hr = (*it)->GetCurrentLength(&cbLen);
            if (FAILED(hr))
            {
                break;
            }
            DWORD cbCopy = min(cbLen, cbSize - cbCopied);

            CopyMemory(static_cast<BYTE *>(pDest) + cbCopied, (*it)->GetBuffer(), cbCopy);

           cbCopied += cbCopy;
        }
    }

    *pcbCopied = cbCopied;

    TRACEHR_RET(hr);
}

HRESULT CreateInstance ( IBufferPacket ** ppBufferPackage ) [static]

Definition at line 127 of file BufferPacket.cpp.

{
    if (ppBufferPacket == nullptr)
    {
        return E_INVALIDARG;
    }

    ComPtr<IBufferPacket> spPacket;
    HRESULT hr = S_OK;

    spPacket.Attach(new CBufferPacket());

    if (!spPacket)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        *ppBufferPacket = spPacket.Detach();
    }

    TRACEHR_RET(hr);
}

HRESULT FromMFSample | ( | IMFSample * | pSample,
 |  | IBufferPacket ** | ppBufferPackage |
 | ) |  |  | [static]

Definition at line 73 of file BufferPacket.cpp.

{
    if (pSample == nullptr || ppBufferPacket == nullptr)
    {
        return E_INVALIDARG;
    }

    ComPtr<IBufferPacket> spPacket;
    DWORD cBuffers = 0;
    HRESULT hr = CBufferPacket::CreateInstance(&spPacket);

    if (SUCCEEDED(hr))
    {
        hr = pSample->GetBufferCount(&cBuffers);
    }

    if (SUCCEEDED(hr))
    {
        for (DWORD nIndex = 0; nIndex < cBuffers; ++nIndex)
        {
            ComPtr<IMFMediaBuffer> spMediaBuffer;
            ComPtr<IMediaBufferWrapper> spBufferWrapper;

            // Get buffer from the sample
            hr = pSample->GetBufferByIndex(nIndex, &spMediaBuffer);
            if (FAILED(hr))
            {
                break;
            }

            // Create buffer wrapper
            hr = CreateMediaBufferWrapper(spMediaBuffer.Get(), &spBufferWrapper);
            if (FAILED(hr))
            {
                break;
            }

            // Add buffer to the package
            hr = spPacket->AddBuffer(spBufferWrapper.Get());
            if (FAILED(hr))
            {
                break;
            }
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppBufferPacket = spPacket.Detach();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetEnumerator ( _Out_ IBufferEnumerator ** ppEnumerator )

Definition at line 485 of file BufferPacket.cpp.

{
    return CBufferEnumerator::CreateInstance(_buffers, this, ppEnumerator);
}

IFACEMETHODIMP GetTotalLength ( _Out_ DWORD * pcbTotalLength )

Definition at line 276 of file BufferPacket.cpp.

{
    if (pcbTotalLength == nullptr)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;
    Iterator it = _buffers.begin();
    Iterator itEnd = _buffers.end();
    DWORD cbSize = 0;

    for (;it != itEnd; ++it)
    {
        DWORD cbLen;
        hr = (*it)->GetCurrentLength(&cbLen);
        if (FAILED(hr))
        {
            break;
        }
        cbSize += cbLen;
    }

    *pcbTotalLength = cbSize;

    TRACEHR_RET(hr);
}

IFACEMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |  |
IFACEMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |  |
IFACEMETHOD_ | ( | size_t | ,
 |  | GetBufferCount |  |
 | ) |  |  | const
IFACEMETHODIMP InsertBuffer | ( | unsigned int | nIndex,
 |  | IMediaBufferWrapper * | pBuffer
 | ) |  |

Definition at line 160 of file BufferPacket.cpp.

{
    if (nIndex > _buffers.size() || pBuffer == nullptr)
    {
        return E_INVALIDARG;
    }

    Iterator it = _buffers.begin();
    Iterator itEnd = _buffers.end();

    for (DWORD nCurrent = 1; nCurrent < nIndex && it != itEnd; ++nCurrent, ++it);

    _buffers.insert(it, pBuffer);

    return S_OK;
}

IFACEMETHODIMP MoveLeft | ( | DWORD | cbSize,
 |  | _Out_writes_bytes_(cbSize) void * | pDest
 | ) |  |

Definition at line 372 of file BufferPacket.cpp.

{
    DWORD cbCopied = 0;
    HRESULT hr = CopyTo(0, cbSize, pDest, &cbCopied);

    if (SUCCEEDED(hr) && cbCopied != cbSize)
    {
        hr = E_INVALIDARG;
    }

    if (SUCCEEDED(hr))
    {
        hr = TrimLeft(cbSize);
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP QueryInterface | ( | REFIID | riid,
 |  | void ** | ppv
 | ) |  |

Definition at line 35 of file BufferPacket.cpp.

{
    if (ppv == nullptr)
    {
        return E_POINTER;
    }
    (*ppv) = nullptr;

    HRESULT hr = S_OK;
    if (riid == IID_IUnknown || riid == __uuidof(IBufferPacket))
    {
        (*ppv) = static_cast<IBufferPacket*>(this);
        AddRef();
        hr = S_OK;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    return hr;
}

IFACEMETHODIMP RemoveBuffer | ( | unsigned int | nIndex,
 |  | IMediaBufferWrapper ** | ppBuffer
 | ) |  |

Definition at line 177 of file BufferPacket.cpp.

{
    if (nIndex > _buffers.size() || ppBuffer == nullptr)
    {
        return E_INVALIDARG;
    }

    Iterator it = _buffers.begin();
    Iterator itEnd = _buffers.end();

    for (DWORD nCurrent = 1; nCurrent < nIndex && it != itEnd; ++nCurrent, ++it);

    *ppBuffer = (*it).Get();
    (*ppBuffer)->AddRef();

    _buffers.erase(it);

    return S_OK;
}

IFACEMETHODIMP ToMFSample ( IMFSample ** ppSample )

Definition at line 431 of file BufferPacket.cpp.

{
    ComPtr<IMFSample> spSample;

    HRESULT hr = MFCreateSample(&spSample);

    if (SUCCEEDED(hr))
    {
        Container::iterator it = _buffers.begin();
        Container::iterator endIt = _buffers.end();

        for(;it != endIt; ++it)
        {
            IMediaBufferWrapper *pBuffer = (*it).Get();
            ComPtr<IMFMediaBuffer> spMediaBuffer;

            if (pBuffer->GetOffset() == 0)
            {
                // If offset is zero we can just use embedded media buffer
                spMediaBuffer = pBuffer->GetMediaBuffer();
            }
            else
            {
                // We have to create MF media buffer wrapper to include offset
                DWORD cbLen;
                hr = pBuffer->GetCurrentLength(&cbLen);
                if (FAILED(hr))
                {
                    break;
                }
                hr = MFCreateMediaBufferWrapper(pBuffer->GetMediaBuffer(), pBuffer->GetOffset(), cbLen, &spMediaBuffer);
                if (FAILED(hr))
                {
                    break;
                }
            }

            // Add media buffer to the sample
            hr = spSample->AddBuffer(spMediaBuffer.Get());
            if (FAILED(hr))
            {
                break;
            }
        }
    }

    if (SUCCEEDED(hr))
    {
        *ppSample = spSample.Detach();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP TrimLeft ( DWORD cbSize )

Definition at line 390 of file BufferPacket.cpp.

{
    DWORD cbTotalLength = 0;
    HRESULT hr = GetTotalLength(&cbTotalLength);

    if (SUCCEEDED(hr) && cbSize > cbTotalLength)
    {
        return E_INVALIDARG;
    }

    Iterator it = _buffers.begin();
    Iterator itEnd = _buffers.end();
    DWORD cbSkipped = 0;

    for (;cbSkipped < cbSize; it = _buffers.begin())
    {
        DWORD cbLen;
        DWORD nStart = 0;
        DWORD cbCopy = 0;
        hr = (*it)->GetCurrentLength(&cbLen);
        if (FAILED(hr))
        {
            break;
        }
        if (cbSkipped + cbLen <= cbSize)
        {
            _buffers.pop_front();
            cbSkipped += cbLen;
        }
        else
        {
            // skip the rest
            hr = (*it)->TrimLeft(cbSize-cbSkipped);
            break;
        }
    }

    TRACEHR_RET(hr);
}

Member Data Documentation

Container _buffers [private]

Definition at line 53 of file BufferPacket.h.

long _cRef [private]

Definition at line 52 of file BufferPacket.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.cpp
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CMediaBufferWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • CMediaBufferWrapper
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CMediaBufferWrapper Class Reference

#include "MediaBufferWrapper.h"

List of all members.

Public Member Functions

CMediaBufferWrapper (void)
~CMediaBufferWrapper (void)
IFACEMETHOD() | Buffer (_Out_ BYTE **ppBuffer)
IFACEMETHOD() | DisconnectObject (DWORD)
IFACEMETHOD() | get_Capacity (UINT *pcbCapacity)
IFACEMETHOD() | get_Length (UINT *pcbLength)
IFACEMETHOD() | GetCurrentLength (DWORD *pcbCurrentLength)
IFACEMETHOD() | GetMarshalSizeMax (REFIID riid, _In_opt_ void *pv, DWORD dwDestContext, _Reserved_ void *pvDestContext, DWORD mshlflags, _Out_ DWORD *pcbSize)
IFACEMETHOD() | GetUnmarshalClass (REFIID riid, _In_opt_ void *pv, DWORD dwDestContext, _Reserved_ void *pvDestContext, DWORD mshlflags, _Out_ CLSID *pclsid)
IFACEMETHOD_ (DWORD, GetOffset)() const
IFACEMETHOD_ (IMFMediaBuffer *, GetMediaBuffer)() const
IFACEMETHOD_ (BYTE *, GetBuffer)() const
IFACEMETHOD() | MarshalInterface (_In_ IStream *pStm, REFIID riid, _In_opt_ void *pv, DWORD dwDestContext, _Reserved_ void *pvDestContext, DWORD mshlflags)
IFACEMETHOD() | put_Length (UINT cbLength)
IFACEMETHOD() | ReleaseMarshalData (_In_ IStream *)
IFACEMETHOD() | Reset ()
HRESULT | RuntimeClassInitialize (IMFMediaBuffer *pMediaBuffer)
IFACEMETHOD() | SetCurrentLength (DWORD cbCurrentLength)
IFACEMETHOD() | SetOffset (DWORD nOffset)
IFACEMETHOD() | TrimLeft (DWORD cbSize)
IFACEMETHOD() | TrimRight (DWORD cbSize, _Out_ IMediaBufferWrapper **pWrapper)
IFACEMETHOD() | UnmarshalInterface (_In_ IStream *, _In_ REFIID, _Outptr_ void **)

Static Public Member Functions

static HRESULT | CreateInstance (DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)
static HRESULT | CreateInstance (_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)

Protected Member Functions

HRESULT | CheckMarshal ()

Private Member Functions

InspectableClass (L"Microsoft.Samples.SimpleCommunication.Buffer", BaseTrust)

Private Attributes

DWORD | _nOffset
BYTE * | _pBuffer
ComPtr< IMF2DBuffer > | _sp2DBuffer
ComPtr< IMarshal > | _spBufferMarshal
ComPtr< IMFMediaBuffer > | _spMediaBuffer

Detailed Description

Definition at line 15 of file MediaBufferWrapper.h.

Constructor & Destructor Documentation

CMediaBufferWrapper ( void )

Definition at line 23 of file MediaBufferWrapper.cpp.

    : _pBuffer(nullptr)
    , _nOffset(0)
{
    TRACE(TRACE_LEVEL_LOW, L"Creating CMediaBufferWrapper %p\n", this);
}

~CMediaBufferWrapper ( void )

Definition at line 30 of file MediaBufferWrapper.cpp.

{
    if (_spMediaBuffer)
    {
        if (_sp2DBuffer)
        {
            _sp2DBuffer->Unlock2D();
        }
        else
        {
            _spMediaBuffer->Unlock();
        }
    }
    TRACE(TRACE_LEVEL_LOW, L"Deleting CMediaBufferWrapper %p\n", this);
}

Member Function Documentation

IFACEMETHODIMP Buffer ( _Out_ BYTE ** ppBuffer )

Definition at line 141 of file MediaBufferWrapper.cpp.

{
    *ppBuffer = GetBuffer();
    return S_OK;
}

HRESULT CheckMarshal ( ) [protected]

Definition at line 341 of file MediaBufferWrapper.cpp.

{
    HRESULT hr = S_OK;
    IMarshal **ppMarshal = _spBufferMarshal.GetAddressOf();
    if (*ppMarshal == nullptr)
    {
        IMarshal *pNewMarshal = nullptr;
        hr = RoGetBufferMarshaler(&pNewMarshal);

        if (SUCCEEDED(hr) &&
            nullptr != InterlockedCompareExchangePointer(reinterpret_cast<PVOID*>(ppMarshal), pNewMarshal, nullptr))
        {
            pNewMarshal->Release();
        }
    }

    return hr;
}

HRESULT CreateInstance | ( | DWORD | dwMaxLength,
 |  | _Outptr_ IMediaBufferWrapper ** | ppMediaBufferWrapper |
 | ) |  |  | [static]

Definition at line 46 of file MediaBufferWrapper.cpp.

{
    ComPtr<IMFMediaBuffer> spMediaBuffer;
    HRESULT hr = MFCreateMemoryBuffer(cbMaxLength, &spMediaBuffer);

    if (SUCCEEDED(hr))
    {
        hr = CMediaBufferWrapper::CreateInstance(spMediaBuffer.Get(), ppMediaBufferWrapper);
    }

    TRACEHR_RET(hr);
}

HRESULT CreateInstance | ( | _In_ IMFMediaBuffer * | pMediaBuffer,
 |  | _Outptr_ IMediaBufferWrapper ** | ppMediaBufferWrapper |
 | ) |  |  | [static]

Definition at line 59 of file MediaBufferWrapper.cpp.

{
    HRESULT hr = S_OK;
    ComPtr<CMediaBufferWrapper> spResult;

    if (pMediaBuffer == nullptr || ppMediaBufferWrapper == nullptr)
    {
        return E_INVALIDARG;
    }

    hr = MakeAndInitialize<CMediaBufferWrapper>(&spResult, pMediaBuffer);

    if (!spResult)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        *ppMediaBufferWrapper = spResult.Detach();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP DisconnectObject ( DWORD )

Definition at line 197 of file MediaBufferWrapper.cpp.

{
    return E_NOTIMPL;
}

IFACEMETHODIMP get_Capacity ( UINT * pcbCapacity )

Definition at line 115 of file MediaBufferWrapper.cpp.

{
    DWORD cbCapacity = 0;
    HRESULT hr = _spMediaBuffer->GetMaxLength(&cbCapacity);

    *pcbCapacity = cbCapacity;

    return hr;
}

IFACEMETHODIMP get_Length ( UINT * pcbLength )

Definition at line 125 of file MediaBufferWrapper.cpp.

{
    DWORD cbLength = 0;
    HRESULT hr = GetCurrentLength(&cbLength);

    *pcbLength = cbLength;

    return hr;
}

IFACEMETHODIMP GetCurrentLength ( DWORD * pcbCurrentLength )

Definition at line 220 of file MediaBufferWrapper.cpp.

{
    if (pcbCurrentLength == nullptr)
    {
        return E_INVALIDARG;
    }
    DWORD cbCurrentLength;

    HRESULT hr = _spMediaBuffer->GetCurrentLength(&cbCurrentLength);

    if (SUCCEEDED(hr))
    {
        if (cbCurrentLength <= _nOffset)
        {
            cbCurrentLength = 0;
        }
        else
        {
            cbCurrentLength -= _nOffset;
        }

        *pcbCurrentLength = cbCurrentLength;
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP GetMarshalSizeMax | ( | REFIID | riid,
 |  | _In_opt_ void * | pv,
 |  | DWORD | dwDestContext,
 |  | _Reserved_ void * | pvDestContext,
 |  | DWORD | mshlflags,
 |  | _Out_ DWORD * | pcbSize
 | ) |  |

Definition at line 161 of file MediaBufferWrapper.cpp.

{
    HRESULT hr = CheckMarshal();

    if (SUCCEEDED(hr))
    {
        hr = _spBufferMarshal->GetMarshalSizeMax(riid, pv, dwDestContext, pvDestContext, mshlflags, pcbSize);
    }

    return hr;
}

IFACEMETHODIMP GetUnmarshalClass | ( | REFIID | riid,
 |  | _In_opt_ void * | pv,
 |  | DWORD | dwDestContext,
 |  | _Reserved_ void * | pvDestContext,
 |  | DWORD | mshlflags,
 |  | _Out_ CLSID * | pclsid
 | ) |  |

Definition at line 148 of file MediaBufferWrapper.cpp.

{
    HRESULT hr = CheckMarshal();

    if (SUCCEEDED(hr))
    {
        hr = _spBufferMarshal->GetUnmarshalClass(riid, pv, dwDestContext, pvDestContext, mshlflags, pclsid);
    }

    return hr;
}

IFACEMETHOD_ | ( | BYTE * | ,
 |  | GetBuffer |  |
 | ) |  |  | const [inline]

Definition at line 55 of file MediaBufferWrapper.h.

{return _pBuffer + _nOffset;}

IFACEMETHOD_ | ( | DWORD | ,
 |  | GetOffset |  |
 | ) |  |  | const [inline]

Definition at line 58 of file MediaBufferWrapper.h.

{return _nOffset;}

IFACEMETHOD_ | ( | IMFMediaBuffer * | ,
 |  | GetMediaBuffer |  |
 | ) |  |  | const [inline]

Definition at line 54 of file MediaBufferWrapper.h.

{return _spMediaBuffer.Get();}

InspectableClass | ( | L"Microsoft.Samples.SimpleCommunication.Buffer" | ,
 |  | BaseTrust |  |
 | ) |  |  | [private]
IFACEMETHODIMP MarshalInterface | ( | _In_ IStream * | pStm,
 |  | REFIID | riid,
 |  | _In_opt_ void * | pv,
 |  | DWORD | dwDestContext,
 |  | _Reserved_ void * | pvDestContext,
 |  | DWORD | mshlflags
 | ) |  |

Definition at line 174 of file MediaBufferWrapper.cpp.

{
    HRESULT hr = CheckMarshal();

    if (SUCCEEDED(hr))
    {
        hr = _spBufferMarshal->MarshalInterface(pStm,riid, pv, dwDestContext, pvDestContext, mshlflags);
    }

    return hr;
}

IFACEMETHODIMP put_Length ( UINT cbLength )

Definition at line 135 of file MediaBufferWrapper.cpp.

{
    return SetCurrentLength(cbLength);
}

IFACEMETHODIMP ReleaseMarshalData ( _In_ IStream * )

Definition at line 192 of file MediaBufferWrapper.cpp.

{
    return E_NOTIMPL;
}

IFACEMETHODIMP Reset ( )

Definition at line 335 of file MediaBufferWrapper.cpp.

{
    _nOffset = 0;
    return _spMediaBuffer->SetCurrentLength(0);
}

HRESULT RuntimeClassInitialize ( IMFMediaBuffer * pMediaBuffer )

Definition at line 84 of file MediaBufferWrapper.cpp.

{
    assert(pMediaBuffer != nullptr);

    DWORD cbMaxLength;
    DWORD cbCurrentLength;
    HRESULT hr = S_OK;
    if (SUCCEEDED(pMediaBuffer->QueryInterface(IID_PPV_ARGS(&_sp2DBuffer))))
    {
        LONG lPitch;
        hr = _sp2DBuffer->Lock2D(&_pBuffer, &lPitch);
        TRACE(TRACE_LEVEL_LOW, L"D3D CMediaBufferWrapper %p\n", this);
    }
    else
    {
        hr = pMediaBuffer->Lock(&_pBuffer, &cbMaxLength, &cbCurrentLength);
    }

    if (SUCCEEDED(hr))
    {
        _spMediaBuffer = pMediaBuffer;
    }
    else
    {
        __debugbreak();
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP SetCurrentLength ( DWORD cbCurrentLength )

Definition at line 247 of file MediaBufferWrapper.cpp.

{
    DWORD cbMaxLen = 0;
    HRESULT hr = _spMediaBuffer->GetMaxLength(&cbMaxLen);

    if (SUCCEEDED(hr))
    {
        if (_nOffset > cbMaxLen)
        {
            _nOffset = cbMaxLen;
        }

        if (cbCurrentLength > (cbMaxLen - _nOffset))
        {
            hr = E_INVALIDARG;
        }
        else
        {
            hr = _spMediaBuffer->SetCurrentLength(cbCurrentLength+_nOffset);
        }
    }
    TRACEHR_RET(hr);
}

IFACEMETHODIMP SetOffset ( DWORD nOffset )

Definition at line 203 of file MediaBufferWrapper.cpp.

{
    DWORD cbCurrentLength;

    HRESULT hr = _spMediaBuffer->GetCurrentLength(&cbCurrentLength);

    if (SUCCEEDED(hr))
    {
        if (cbCurrentLength < nOffset)
        {
            hr = E_INVALIDARG;
        }
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP TrimLeft ( DWORD cbSize )

Definition at line 271 of file MediaBufferWrapper.cpp.

{
    DWORD cbCurrentLen;
    HRESULT hr = GetCurrentLength(&cbCurrentLen);

    if (SUCCEEDED(hr))
    {
        if (cbCurrentLen >= cbSize)
        {
            _nOffset += cbSize;
        }
        else
        {
            hr = E_INVALIDARG;
        }
    }

    TRACEHR_RET(hr);
}

IFACEMETHODIMP TrimRight | ( | DWORD | cbSize,
 |  | _Out_ IMediaBufferWrapper ** | pWrapper
 | ) |  |

Definition at line 292 of file MediaBufferWrapper.cpp.

{
    if (pWrapper == nullptr)
    {
        return E_INVALIDARG;
    }

    ComPtr<IMediaBufferWrapper> spResult;
    DWORD cbCurrentLen;
    HRESULT hr = this->GetCurrentLength(&cbCurrentLen);

    // Offset cannot be larger than current length.
    if (SUCCEEDED(hr) && cbCurrentLen <= cbSize)
    {
        return E_INVALIDARG;
    }

    // Create result buffer representing at the end of the current one
    if (SUCCEEDED(hr))
    {
        ComPtr<IMFMediaBuffer> spMediaBuffer;
        hr = MFCreateMediaBufferWrapper(GetMediaBuffer(), GetOffset() + cbCurrentLen - cbSize, cbSize, &spMediaBuffer);

        if (SUCCEEDED(hr))
        {
            hr = CMediaBufferWrapper::CreateInstance(spMediaBuffer.Get(), &spResult);
        }
    }

    // Change the size of the length of the buffer
    if (SUCCEEDED(hr))
    {
        hr = SetCurrentLength(cbCurrentLen - cbSize);
    }

    if (SUCCEEDED(hr))
    {
        *pWrapper = spResult.Detach();
    }

    return hr;
}

IFACEMETHODIMP UnmarshalInterface | ( | _In_ IStream * | ,
 |  | _In_ | REFIID,
 |  | _Outptr_ void ** |
 | ) |  |

Definition at line 187 of file MediaBufferWrapper.cpp.

{
    return E_NOTIMPL;
}

Member Data Documentation

DWORD _nOffset [private]

Definition at line 75 of file MediaBufferWrapper.h.

BYTE* _pBuffer [private]

Definition at line 74 of file MediaBufferWrapper.h.

ComPtr<IMF2DBuffer> _sp2DBuffer [private]

Definition at line 73 of file MediaBufferWrapper.h.

ComPtr<IMarshal> _spBufferMarshal [private]

Definition at line 76 of file MediaBufferWrapper.h.

ComPtr<IMFMediaBuffer> _spMediaBuffer [private]

Definition at line 72 of file MediaBufferWrapper.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.cpp
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CNetworkChannel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • CNetworkChannel
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes

CNetworkChannel Class Reference

#include "NetworkChannel.h"

Inherited by sealed, and sealed.

List of all members.

Public Member Functions

virtual | ~CNetworkChannel ()
virtual void | Close () override
virtual void | Disconnect () override
virtual
Windows::Foundation::IAsyncAction 		ReceiveAsync (_In_ IMediaBufferWrapper *pBuffer) override
virtual
Windows::Foundation::IAsyncAction 		SendAsync (_In_ IBufferPacket *pPacket) override

Public Attributes

internal | __pad0__: CNetworkChannel()

Protected Member Functions

void | CheckClosed ()
IStreamSocket | GetSocket ()
virtual void | OnClose ()
void | SetSocket (IStreamSocket^socket)

Protected Attributes

CritSec _critSec

Private Attributes

bool | _isClosed
IStreamSocket | _socket

Detailed Description

Definition at line 12 of file NetworkChannel.h.

Constructor & Destructor Documentation

~CNetworkChannel ( ) [virtual]

Definition at line 48 of file NetworkChannel.cpp.

{
    Disconnect();
}

Member Function Documentation

void CheckClosed ( ) [inline, protected]

Definition at line 33 of file NetworkChannel.h.

        {
            if (_isClosed)
            {
                throw ref new Exception(MF_E_SHUTDOWN);
            }
        }

void Close ( ) [override, virtual]

Definition at line 156 of file NetworkChannel.cpp.

{
    AutoLock lock(_critSec);

    Disconnect();

    OnClose();

    _isClosed = true;
}

void Disconnect ( ) [override, virtual]

Definition at line 167 of file NetworkChannel.cpp.

{
    AutoLock lock(_critSec);

    if (_socket != nullptr)
    {
        delete _socket;
        _socket = nullptr;
    }
}

IStreamSocket GetSocket ( ) [inline, protected]

Definition at line 31 of file NetworkChannel.h.

{ return _socket; }

virtual void OnClose ( ) [inline, protected, virtual]

Definition at line 28 of file NetworkChannel.h.

{}

Windows::Foundation::IAsyncAction ReceiveAsync ( _In_ IMediaBufferWrapper * pBuffer ) [override, virtual]

Definition at line 118 of file NetworkChannel.cpp.

{
    if (pBuffer == nullptr)
    {
        throw ref new InvalidArgumentException();
    }
    ComPtr<IMediaBufferWrapper> spBuffer = pBuffer;

    return concurrency::create_async([this, spBuffer](){
        AutoLock lock(_critSec);
        CheckClosed();
        IStreamSocket ^socket = GetSocket();
        IInputStream ^inputStream;
        ComPtr<IInspectable> spInspectable;
        DWORD cbBufferLen = 0;

        if (socket == nullptr)
        {
            Throw(MF_E_NET_NOCONNECTION);
        }

        inputStream = socket->InputStream;

        ThrowIfError(spBuffer->GetMediaBuffer()->GetMaxLength(&cbBufferLen));

        ThrowIfError(spBuffer.As(&spInspectable));

        return concurrency::create_task(inputStream->ReadAsync(safe_cast<IBuffer^>(reinterpret_cast<Object^>(spInspectable.Get())), cbBufferLen, InputStreamOptions::Partial))
            .then([this](IBuffer ^buffer)
        {
            if (buffer->Length  == 0)
            {
                Throw(MF_E_NET_READ);
            }
        });
    });
}

Windows::Foundation::IAsyncAction SendAsync ( _In_ IBufferPacket * pPacket ) [override, virtual]

Definition at line 53 of file NetworkChannel.cpp.

{
    if (pPacket == nullptr)
    {
        throw ref new InvalidArgumentException();
    }

    return concurrency::create_async([this, spPacket = ComPtr<IBufferPacket>(pPacket)](){
        AutoLock lock(_critSec);
        CheckClosed();
        IStreamSocket ^socket = GetSocket();
        if (socket == nullptr)
        {
            throw ref new Exception(MF_E_NET_NOCONNECTION);
        }

        auto outputStream = socket->OutputStream;
        ComPtr<IBufferEnumerator> spEn;
        ThrowIfError(spPacket->GetEnumerator(&spEn));
        if (!spEn->IsValid())
        {
            // Packet is empty
            Throw(E_INVALIDARG);
        }

        std::list<concurrency::task<void>> tasks;
        CSendOperationStatus ^status = ref new CSendOperationStatus();

        for (; spEn->IsValid(); spEn->MoveNext())
        {
            ComPtr<IMediaBufferWrapper> spBuffer;
            ComPtr<IInspectable> spInspectable;
            DWORD dwLen = 0;

            ThrowIfError(spEn->GetCurrent(&spBuffer));

            ThrowIfError(spBuffer.As(&spInspectable));
            IBuffer ^buffer = safe_cast<IBuffer^>(reinterpret_cast<Object^>(spInspectable.Get()));

            ThrowIfError(spBuffer->GetCurrentLength(&dwLen));

            tasks.push_back(concurrency::create_task(outputStream->WriteAsync(buffer)).
                then([this, status](concurrency::task<unsigned int>& task)
                {
                    try
                    {
                        // We want when_all to finish when all task finish so remember error.
                        // Otherwise if any of the tasks throws when_all finishes earlier.
                        task.get();
                    }
                    catch(Exception ^exc)
                    {
                        status->SetException(exc);
                    }
                }));
        }

        return concurrency::when_all(tasks.begin(), tasks.end())
            .then([this, status](concurrency::task<void>& task)
        {
            status->CheckException();
        });
    });
}

void SetSocket ( IStreamSocket^ socket ) [inline, protected]

Definition at line 30 of file NetworkChannel.h.

{ _socket = socket; }

Member Data Documentation

internal __pad0__

Definition at line 18 of file NetworkChannel.h.

CritSec _critSec [protected]

Definition at line 41 of file NetworkChannel.h.

bool _isClosed [private]

Definition at line 44 of file NetworkChannel.h.

IStreamSocket _socket [private]

Definition at line 45 of file NetworkChannel.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.cpp
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: INetworkClient Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • INetworkClient
Public Member Functions

INetworkClient Interface Reference

#include "StspNetwork.h"

Inherited by sealed.

List of all members.

Public Member Functions

Windows::Foundation::IAsyncAction ConnectAsync (String^url, WORD wPort)

Detailed Description

Definition at line 66 of file StspNetwork.h.

Member Function Documentation

Windows::Foundation::IAsyncAction ConnectAsync | ( | String^ | url,
 |  | WORD | wPort
 | ) |  |

Implemented in sealed.

The documentation for this interface was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: INetworkServer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • INetworkServer
Public Member Functions

INetworkServer Interface Reference

#include "StspNetwork.h"

Inherited by sealed.

List of all members.

Public Member Functions

Windows::Foundation::IAsyncOperation
< Windows::Networking::Sockets::StreamSocketInformation^> 		AcceptAsync ()

Detailed Description

Definition at line 61 of file StspNetwork.h.

Member Function Documentation

Windows::Foundation::IAsyncOperation<Windows::Networking::Sockets::StreamSocketInformation^> AcceptAsync ( )
The documentation for this interface was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
  • sealed
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "NetworkClient.h"

Inherits Microsoft::Samples::SimpleCommunication::Network::CNetworkChannel, Microsoft::Samples::SimpleCommunication::Network::INetworkServer, Microsoft::Samples::SimpleCommunication::Network::CNetworkChannel, and Microsoft::Samples::SimpleCommunication::Network::INetworkClient.

List of all members.

Public Member Functions

virtual | ~CAcceptOperation ()
virtual | ~CNetworkClient ()
virtual | ~CNetworkServer ()
concurrency::task< IStreamSocket^> | AcceptAsync (unsigned short port)
virtual
Windows::Foundation::IAsyncOperation
< Windows::Networking::Sockets::StreamSocketInformation^> 		AcceptAsync ()
virtual
Windows::Foundation::IAsyncAction 		ConnectAsync (String^url, WORD wPort)

Public Attributes

internal | __pad0__: CNetworkClient()
internal CritSec & | critSec

Protected Member Functions

virtual void | OnClose () override

Private Member Functions

void | Detach ()
void | OnConnectionReceived (Windows::Networking::Sockets::StreamSocketListener^sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^args)

Private Attributes

CAcceptOperation | _acceptOperation
concurrency::task_completion_event
< IStreamSocket^> 		_completionEvent
Windows::Foundation::EventRegistrationToken | _connectionReceivedToken
CritSec & _critSec
bool | _fAsyncOperationInProgress
IStreamSocketListener | _listener
unsigned short | _listeningPort
CNetworkServer | _parent

Detailed Description

Definition at line 12 of file NetworkClient.h.

Constructor & Destructor Documentation

virtual ~CNetworkClient ( ) [virtual]
virtual ~CNetworkServer ( ) [virtual]
virtual ~CAcceptOperation ( ) [virtual]

Member Function Documentation

virtual Windows::Foundation::IAsyncOperation<Windows::Networking::Sockets::StreamSocketInformation^> AcceptAsync ( ) [virtual]
concurrency::task<IStreamSocket^> AcceptAsync ( unsigned short port )
virtual Windows::Foundation::IAsyncAction ConnectAsync | ( | String^ | url,
 |  | WORD | wPort |
 | ) |  |  | [virtual]

Implements INetworkClient.

void Detach ( ) [private]
virtual void OnClose ( ) [override, protected, virtual]
void OnConnectionReceived | ( | Windows::Networking::Sockets::StreamSocketListener^ | sender,
 |  | Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^ | args |
 | ) |  |  | [private]

Member Data Documentation

internal __pad0__

Definition at line 23 of file NetworkClient.h.

CAcceptOperation _acceptOperation [private]

Definition at line 32 of file NetworkServer.h.

concurrency::task_completion_event<IStreamSocket^> _completionEvent [private]

Definition at line 51 of file NetworkServer.h.

Windows::Foundation::EventRegistrationToken _connectionReceivedToken [private]

Definition at line 52 of file NetworkServer.h.

CritSec& _critSec [private]

Definition at line 49 of file NetworkServer.h.

bool _fAsyncOperationInProgress [private]

Definition at line 54 of file NetworkServer.h.

IStreamSocketListener _listener [private]

Definition at line 50 of file NetworkServer.h.

unsigned short _listeningPort [private]

Definition at line 31 of file NetworkServer.h.

CNetworkServer _parent [private]

Definition at line 53 of file NetworkServer.h.

internal CritSec& critSec

Definition at line 41 of file NetworkServer.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.h
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkServer.h
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • sealed
Classes | Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "StspMediaSinkProxy.h"

List of all members.

Classes

class | sealed

Public Member Functions

virtual | ~StspMediaSinkProxy ()
Windows::Media::IMediaExtension | GetMFExtensions ()
Windows::Foundation::IAsyncOperation
< Windows::Media::IMediaExtension^> 		InitializeAsync (Windows::Media::MediaProperties::IMediaEncodingProperties^audioEncodingProperties, Windows::Media::MediaProperties::IMediaEncodingProperties^videoEncodingProperties)
void | Refuse ()
StspMediaSinkProxy ()

Public Attributes

event
Windows::Foundation::EventHandler
< Object^> 		IncomingConnectionEvent
internal _In_opt_
Windows::Media::MediaProperties::IMediaEncodingProperties 		mediaEncodingProperties

Properties

internal | __pad0__: IncomingConnectionEventArgs(IStspSinkInternal *pSink
internal DWORD | connectionId
internal DWORD String | remoteUrl

Private Member Functions

void | CheckShutdown ()
void | FireIncomingConnection (IncomingConnectionEventArgs^args)
void | OnShutdown ()

Private Attributes

DWORD | _connectionId
CritSec _critSec
bool | _fShutdown
String | _remoteUrl
ComPtr< IMFMediaSink > | _spMediaSink
ComPtr< IStspSinkInternal > | _spSink

Detailed Description

Definition at line 16 of file StspMediaSinkProxy.h.

Constructor & Destructor Documentation

virtual ~StspMediaSinkProxy ( ) [virtual]

Member Function Documentation

void CheckShutdown ( ) [inline, private]

Definition at line 91 of file StspMediaSinkProxy.h.

        {
            if (_fShutdown)
            {
                Throw(MF_E_SHUTDOWN);
            }
        }

void FireIncomingConnection ( IncomingConnectionEventArgs^ args ) [private]
Windows::Media::IMediaExtension GetMFExtensions ( )
Windows::Foundation::IAsyncOperation<Windows::Media::IMediaExtension^> InitializeAsync | ( | Windows::Media::MediaProperties::IMediaEncodingProperties^ | audioEncodingProperties,
 |  | Windows::Media::MediaProperties::IMediaEncodingProperties^ | videoEncodingProperties
 | ) |  |
void OnShutdown ( ) [private]
void Refuse ( )
StspMediaSinkProxy ( )

Member Data Documentation

DWORD _connectionId [private]

Definition at line 32 of file StspMediaSinkProxy.h.

CritSec _critSec [private]

Definition at line 100 of file StspMediaSinkProxy.h.

bool _fShutdown [private]

Definition at line 102 of file StspMediaSinkProxy.h.

String _remoteUrl [private]

Definition at line 31 of file StspMediaSinkProxy.h.

ComPtr<IMFMediaSink> _spMediaSink [private]

Definition at line 101 of file StspMediaSinkProxy.h.

ComPtr<IStspSinkInternal> _spSink [private]

Definition at line 33 of file StspMediaSinkProxy.h.

event Windows::Foundation::EventHandler<Object^> IncomingConnectionEvent

Definition at line 55 of file StspMediaSinkProxy.h.

internal _In_opt_ Windows::Media::MediaProperties::IMediaEncodingProperties mediaEncodingProperties

Definition at line 60 of file StspMediaSinkProxy.h.

Property Documentation

internal __pad0__

Definition at line 28 of file StspMediaSinkProxy.h.

internal DWORD connectionId

Definition at line 28 of file StspMediaSinkProxy.h.

internal DWORD String remoteUrl

Definition at line 28 of file StspMediaSinkProxy.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed::sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • sealed
  • sealed::sealed
Public Member Functions | Public Attributes

sealed::sealed Class Reference

Inherits Microsoft::Samples::SimpleCommunication::ISinkCallback.

List of all members.

Public Member Functions

virtual void | FireIncomingConnection (IncomingConnectionEventArgs^args)
virtual void | OnShutdown ()

Public Attributes

internal | __pad0__: StspSinkCallback(StspMediaSinkProxy ^parent) : _parent(parent) { } private: StspMediaSinkProxy ^_parent

Detailed Description

Definition at line 68 of file StspMediaSinkProxy.h.

Member Function Documentation

virtual void FireIncomingConnection ( IncomingConnectionEventArgs^ args ) [inline, virtual]

Implements ISinkCallback.

Definition at line 71 of file StspMediaSinkProxy.h.

            {
                _parent->FireIncomingConnection(args);
            }

virtual void OnShutdown ( ) [inline, virtual]

Implements ISinkCallback.

Definition at line 76 of file StspMediaSinkProxy.h.

            {
                _parent->OnShutdown();
            }

Member Data Documentation

internal __pad0__

Definition at line 88 of file StspMediaSinkProxy.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StspDescription Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • StspDescription
Public Attributes

StspDescription Struct Reference

#include "StspDefs.h"

List of all members.

Public Attributes

StspStreamDescription | aStreams [1]
UINT32 | cNumStreams

Detailed Description

Definition at line 58 of file StspDefs.h.

Member Data Documentation

StspStreamDescription aStreams[1]

Definition at line 61 of file StspDefs.h.

UINT32 cNumStreams

Definition at line 60 of file StspDefs.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StspOperationHeader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • StspOperationHeader
Public Attributes

StspOperationHeader Struct Reference

#include "StspDefs.h"

List of all members.

Public Attributes

DWORD cbDataSize
StspOperation eOperation

Detailed Description

Definition at line 44 of file StspDefs.h.

Member Data Documentation

DWORD cbDataSize

Definition at line 46 of file StspDefs.h.

StspOperation eOperation

Definition at line 47 of file StspDefs.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StspSampleHeader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • StspSampleHeader
Public Attributes

StspSampleHeader Struct Reference

#include "StspDefs.h"

List of all members.

Public Attributes

DWORD | dwFlagMasks
DWORD | dwFlags
DWORD | dwStreamId
LONGLONG | ullDuration
LONGLONG | ullTimestamp

Detailed Description

Definition at line 75 of file StspDefs.h.

Member Data Documentation

DWORD dwFlagMasks

Definition at line 81 of file StspDefs.h.

DWORD dwFlags

Definition at line 80 of file StspDefs.h.

DWORD dwStreamId

Definition at line 77 of file StspDefs.h.

LONGLONG ullDuration

Definition at line 79 of file StspDefs.h.

LONGLONG ullTimestamp

Definition at line 78 of file StspDefs.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StspStreamDescription Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • StspStreamDescription
Public Attributes

StspStreamDescription Struct Reference

#include "StspDefs.h"

List of all members.

Public Attributes

UINT32 | cbAttributesSize
DWORD | dwStreamId
GUID | guiMajorType
GUID | guiSubType

Detailed Description

Definition at line 50 of file StspDefs.h.

Member Data Documentation

UINT32 cbAttributesSize

Definition at line 55 of file StspDefs.h.

DWORD dwStreamId

Definition at line 54 of file StspDefs.h.

GUID guiMajorType

Definition at line 52 of file StspDefs.h.

GUID guiSubType

Definition at line 53 of file StspDefs.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Bread Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • Bread
Properties | Private Member Functions | Private Attributes

Bread Class Reference

Inherits Microsoft::SDKSamples::Kitchen::IBread.

List of all members.

Properties

String | Flavor [get]

Private Member Functions

internal | Bread (String flavor)

Private Attributes

String | _flavor

Detailed Description

Definition at line 22 of file BreadServer.cs.

Constructor & Destructor Documentation

internal Bread ( String flavor ) [inline, private]

Definition at line 32 of file BreadServer.cs.

        {
            _flavor = flavor;
        }

Member Data Documentation

String _flavor [private]

Definition at line 37 of file BreadServer.cs.

Property Documentation

String Flavor [get]

Implements IBread.

Definition at line 25 of file BreadServer.cs.

The documentation for this class was generated from the following file:
  • ProxyStubsForWinRTComponents/cs/Server/BreadServer.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Dimensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • Dimensions
Public Attributes

Dimensions Struct Reference

#include "BreadTypes.h"

List of all members.

Public Attributes

double | Depth
double | Height
double | Width

Detailed Description

Definition at line 17 of file BreadTypes.h.

Member Data Documentation

double Depth

Definition at line 19 of file BreadTypes.h.

double Height

Definition at line 20 of file BreadTypes.h.

double Width

Definition at line 21 of file BreadTypes.h.

The documentation for this struct was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/Server/BreadTypes.h
  • ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IAppliance Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • IAppliance
Public Member Functions | Properties

IAppliance Interface Reference

#include "OvenServer.h"

Inherited by IOven, and IOven.

List of all members.

Public Member Functions

HRESULT | Volume ([out, retval] double *value)
HRESULT | Volume ([out, retval] double *value)

Properties

double | Volume [get]

Detailed Description

Definition at line 15 of file OvenServer.h.

Member Function Documentation

HRESULT Volume ( [out, retval] double * value ) [get]
HRESULT Volume ( [out, retval] double * value ) [get]

Property Documentation

double Volume [get]

Implemented in Oven.

Definition at line 35 of file OvenServer.cs.

The documentation for this interface was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/Server/OvenServer.h
  • ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IBread Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • IBread
Public Member Functions | Properties

IBread Interface Reference

#include "BreadServer.h"

Inherited by Bread.

List of all members.

Public Member Functions

HRESULT | Flavor ([out, retval] HSTRING *value)
HRESULT | Flavor ([out, retval] HSTRING *value)

Properties

String | Flavor [get]

Detailed Description

Definition at line 13 of file BreadServer.h.

Member Function Documentation

HRESULT Flavor ( [out, retval] HSTRING * value ) [get]
HRESULT Flavor ( [out, retval] HSTRING * value ) [get]

Property Documentation

String Flavor [get]

Implemented in Bread.

Definition at line 19 of file BreadServer.cs.

The documentation for this interface was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/Server/BreadServer.h
  • ProxyStubsForWinRTComponents/cs/Server/BreadServer.cs
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IBreadBakedEventArgs Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • IBreadBakedEventArgs
Public Member Functions

IBreadBakedEventArgs Interface Reference

import "Microsoft.SDKSamples.Kitchen.idl";

List of all members.

Public Member Functions

HRESULT | Bread ([out, retval] Bread **value)
HRESULT | Bread ([out, retval] Bread **value)

Detailed Description

Definition at line 45 of file Microsoft.SDKSamples.Kitchen.idl.

Member Function Documentation

HRESULT Bread ( [out, retval] Bread ** value ) [get]
HRESULT Bread ( [out, retval] Bread ** value ) [get]
The documentation for this interface was generated from the following files:
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOven Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • IOven
Public Member Functions | Public Attributes | Events

IOven Interface Reference

#include "OvenServer.h"

Inherits Microsoft::SDKSamples::Kitchen::IAppliance, and Microsoft::SDKSamples::Kitchen::IAppliance.

Inherited by Oven.

List of all members.

Public Member Functions

void | BakeBread (Platform::String^flavor)
void | BakeBread (String flavor)
HRESULT | BakeBread ([in] HSTRING flavor)
HRESULT | BakeBread ([in] HSTRING flavor)
HRESULT | BreadBaked ([in] EventRegistrationToken token)
HRESULT | BreadBaked ([in] Windows.Foundation.TypedEventHandler< Oven *, BreadBakedEventArgs * > *handler,[out, retval] EventRegistrationToken *token)
HRESULT | BreadBaked ([in] Windows.Foundation.TypedEventHandler< Oven *, BreadBakedEventArgs * > *handler,[out, retval] EventRegistrationToken *token)
HRESULT | BreadBaked ([in] EventRegistrationToken token)
HRESULT | ConfigurePreheatTemperature ([in] OvenTemperature temperature)
void | ConfigurePreheatTemperature (OvenTemperature level)
HRESULT | ConfigurePreheatTemperature ([in] OvenTemperature temperature)
void | ConfigurePreheatTemperature (OvenTemperature temperature)

Public Attributes

event
Windows::Foundation::TypedEventHandler
< Oven^, Bread^> 		BreadBaked

Events

TypedEventHandler< Oven, Bread > | BreadBaked

Detailed Description

Definition at line 25 of file OvenServer.h.

Member Function Documentation

void BakeBread ( Platform::String^ flavor )
void BakeBread ( String flavor )

Implemented in Oven.

HRESULT BakeBread ( [in] HSTRING flavor )
HRESULT BakeBread ( [in] HSTRING flavor )
HRESULT BreadBaked ( [in] EventRegistrationToken token )
HRESULT BreadBaked | ( | [in] Windows.Foundation.TypedEventHandler< Oven *, BreadBakedEventArgs * > * | handler,
 |  | [out, retval] EventRegistrationToken * | token
 | ) |  |
HRESULT BreadBaked | ( | [in] Windows.Foundation.TypedEventHandler< Oven *, BreadBakedEventArgs * > * | handler,
 |  | [out, retval] EventRegistrationToken * | token
 | ) |  |
HRESULT BreadBaked ( [in] EventRegistrationToken token )
HRESULT ConfigurePreheatTemperature ( [in] OvenTemperature temperature )

Implemented in Oven.

void ConfigurePreheatTemperature ( OvenTemperature level )

Implemented in Oven.

HRESULT ConfigurePreheatTemperature ( [in] OvenTemperature temperature )

Implemented in Oven.

void ConfigurePreheatTemperature ( OvenTemperature temperature )

Implemented in Oven.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<Oven^, Bread^> BreadBaked

Implemented in Oven.

Definition at line 30 of file OvenServer.h.

Event Documentation

TypedEventHandler<Oven, Bread> BreadBaked

Implemented in Oven.

Definition at line 44 of file OvenServer.cs.

The documentation for this interface was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/Server/OvenServer.h
  • ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOvenFactory Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • IOvenFactory
Public Member Functions

IOvenFactory Interface Reference

import "Microsoft.SDKSamples.Kitchen.idl";

List of all members.

Public Member Functions

HRESULT | CreateOven ([in] Dimensions dimensions,[out, retval] Oven **result)
HRESULT | CreateOven ([in] Dimensions dimensions,[out, retval] Oven **result)

Detailed Description

Definition at line 61 of file Microsoft.SDKSamples.Kitchen.idl.

Member Function Documentation

HRESULT CreateOven | ( | [in] Dimensions | dimensions,
 |  | [out, retval] Oven ** | result
 | ) |  |
HRESULT CreateOven | ( | [in] Dimensions | dimensions,
 |  | [out, retval] Oven ** | result
 | ) |  |
The documentation for this interface was generated from the following files:
  • WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
  • WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Oven Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • Oven
Public Member Functions | Properties | Events | Private Attributes

Oven Class Reference

Inherits Microsoft::SDKSamples::Kitchen::IOven.

List of all members.

Public Member Functions

Oven (Dimensions dimensions)
Oven ()
void | BakeBread (String flavor)
void | ConfigurePreheatTemperature (OvenTemperature level)

Properties

double | Volume [get]

Events

TypedEventHandler< Oven, Bread > | BreadBaked

Private Attributes

Dimensions _dimensions
OvenTemperature | _temperature = OvenTemperature.Medium

Detailed Description

Definition at line 47 of file OvenServer.cs.

Constructor & Destructor Documentation

Oven ( Dimensions dimensions ) [inline]

Definition at line 49 of file OvenServer.cs.

        {
            _dimensions = dimensions;
        }

Oven ( ) [inline]

Definition at line 54 of file OvenServer.cs.

        {
            _dimensions.Height = 1.0;
            _dimensions.Width = 1.0;
            _dimensions.Depth = 1.0;
        }

Member Function Documentation

void BakeBread ( String flavor ) [inline]

Implements IOven.

Definition at line 71 of file OvenServer.cs.

        {
            TimeSpan preheatTime;

            // Determine how long to wait for the oven to get to temperature
            switch (_temperature)
            {
                case OvenTemperature.Low:
                    // Set the preheat time to 100ms
                    preheatTime = new TimeSpan(1000);
                    break;

                case OvenTemperature.Medium:
                    // Set the preheat time to 200ms
                    preheatTime = new TimeSpan(2000);
                    break;

                case OvenTemperature.High:
                    // Set the preheat time to 300ms
                    preheatTime = new TimeSpan(3000);
                    break;

                default:
                    throw new ArgumentException("Temperature is out of range. The temperature should be low, medium, or high.");
            }

            // Set up a threadpool work item to bake the bread and notify listeners after the oven has preheated
            ThreadPoolTimer.CreateTimer(new TimerElapsedHandler(
                (ThreadPoolTimer timer) =>
                {
                    Bread bread = new Bread(flavor);
                    if (BreadBaked != null)
                    {
                        BreadBaked(this, bread);
                    }
                }),
                preheatTime);
        }

void ConfigurePreheatTemperature ( OvenTemperature level ) [inline]

Implements IOven.

Definition at line 110 of file OvenServer.cs.

        {
            if (level >= OvenTemperature.Low && level <= OvenTemperature.High)
            {
                _temperature = level;
            }
            else
            {
                throw new ArgumentException("Temperature is out of range. The temperature should be low, medium, or high.");
            }
        }

Member Data Documentation

Dimensions _dimensions [private]

Definition at line 122 of file OvenServer.cs.

OvenTemperature _temperature = OvenTemperature.Medium [private]

Definition at line 123 of file OvenServer.cs.

Property Documentation

double Volume [get]

Implements IAppliance.

Definition at line 62 of file OvenServer.cs.

Event Documentation

TypedEventHandler<Oven, Bread> BreadBaked

Implements IOven.

Definition at line 69 of file OvenServer.cs.

The documentation for this class was generated from the following files:
  • ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs
  • ProxyStubsForWinRTComponents/cpp/Server/OvenServer.cpp
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Microsoft
  • SDKSamples
  • Kitchen
  • sealed
Public Member Functions | Public Attributes | Private Attributes

sealed Class Reference

#include "BreadServer.h"

List of all members.

Public Member Functions

virtual void | BakeBread (Platform::String^flavor)
Oven (Dimensions dimensions)
Oven ()

Public Attributes

internal | __pad0__: Bread(Platform::String^ flavor)
virtual event
Windows::Foundation::TypedEventHandler
< Oven^, Bread^> 		BreadBaked

Private Attributes

Dimensions _dims
OvenTemperature _temperature

Detailed Description

Definition at line 21 of file BreadServer.h.

Member Function Documentation

virtual void BakeBread ( Platform::String^ flavor ) [virtual]
Oven ( Dimensions dimensions ) [inline]

Definition at line 37 of file OvenServer.h.

        {
            _dims = dimensions;
        }

Oven ( ) [inline]

Definition at line 42 of file OvenServer.h.

        {
            _dims.Height = 1.0;
            _dims.Width = 1.0;
            _dims.Depth = 1.0;
        }

Member Data Documentation

internal __pad0__

Definition at line 24 of file BreadServer.h.

Dimensions _dims [private]

Definition at line 66 of file OvenServer.h.

OvenTemperature _temperature [private]

Definition at line 67 of file OvenServer.h.

virtual event Windows::Foundation::TypedEventHandler<Oven^, Bread^> BreadBaked

Definition at line 63 of file OvenServer.h.

The documentation for this class was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/Server/BreadServer.h
  • ProxyStubsForWinRTComponents/cpp/Server/OvenServer.h
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RegisterMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • RegisterMessage
Public Attributes

RegisterMessage Class Reference

List of all members.

Public Attributes

string | DeviceName
string | PublicKey
string | UserId

Detailed Description

Definition at line 19 of file Messages.cs.

Member Data Documentation

string DeviceName

Definition at line 23 of file Messages.cs.

string PublicKey

Definition at line 22 of file Messages.cs.

string UserId

Definition at line 21 of file Messages.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/Messages.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SignatureMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • SignatureMessage
Public Attributes

SignatureMessage Class Reference

List of all members.

Public Attributes

string | PublicKeyHint
string | Signature
string | UserId

Detailed Description

Definition at line 32 of file Messages.cs.

Member Data Documentation

string PublicKeyHint

Definition at line 36 of file Messages.cs.

string Signature

Definition at line 35 of file Messages.cs.

string UserId

Definition at line 34 of file Messages.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/Messages.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SubjectPublicKeyInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • SubjectPublicKeyInfo
Classes | Public Member Functions | Private Attributes

SubjectPublicKeyInfo Class Reference

List of all members.

Classes

class | NativeMethods
class | SafeBCryptKeyHandle
class | SafeLocalAllocHandle

Public Member Functions

SubjectPublicKeyInfo (byte[] subjectPublicKeyInfo)
CngKey | GetPublicKey ()

Private Attributes

readonly byte[] | _rawCngPublicKeyBlob
const uint | STATUS_SUCCESS = 0

Detailed Description

Definition at line 25 of file SubjectPublicKeyInfo.cs.

Constructor & Destructor Documentation

SubjectPublicKeyInfo ( byte[] subjectPublicKeyInfo ) [inline]

Definition at line 31 of file SubjectPublicKeyInfo.cs.

        {
            if (subjectPublicKeyInfo == null)
            {
                throw new ArgumentNullException(nameof(subjectPublicKeyInfo));
            }
            if (subjectPublicKeyInfo.Length == 0)
            {
                throw new ArgumentException("Array cannot be empty.", nameof(subjectPublicKeyInfo));
            }

            // const definitions from wincrypt.h and bcrypt.h
            const uint X509_ASN_ENCODING = 0x00000001;
            const uint CRYPT_DECODE_ALLOC_FLAG = 0x8000;
            const int X509_PUBLIC_KEY_INFO = 8;
            const string BCRYPT_PUBLIC_KEY_BLOB = "PUBLICBLOB";

            // The incoming raw public key is an ASN.1-encoded subject public key info

            SafeLocalAllocHandle publicKeyInfoSafeHandle;
            uint cbPublicKeyInfo; // unused
            bool success = NativeMethods.CryptDecodeObjectEx(
                dwCertEncodingType: X509_ASN_ENCODING,
                lpszStructType: (IntPtr)X509_PUBLIC_KEY_INFO,
                pbEncoded: subjectPublicKeyInfo,
                cbEncoded: (uint)subjectPublicKeyInfo.Length,
                dwFlags: CRYPT_DECODE_ALLOC_FLAG,
                pDecodePara: IntPtr.Zero,
                pvStructInfo: out publicKeyInfoSafeHandle,
                pcbStructInfo: out cbPublicKeyInfo);

            if (!success)
            {
                throw new CryptographicException($"CryptDecodeObjectEx failed with error code 0x{Marshal.GetLastWin32Error():X8}.");
            }

            // The CERT_PUBLIC_KEY_INFO struct can be converted to a BCRYPT key handle

            SafeBCryptKeyHandle bcryptKeyHandle;
            success = NativeMethods.CryptImportPublicKeyInfoEx2(
                dwCertEncodingType: X509_ASN_ENCODING,
                pInfo: publicKeyInfoSafeHandle,
                dwFlags: 0,
                pvAuxInfo: IntPtr.Zero,
                phKey: out bcryptKeyHandle);

            if (!success)
            {
                throw new CryptographicException($"CryptImportPublicKeyInfoEx2 failed with error code 0x{Marshal.GetLastWin32Error():X8}.");
            }

            publicKeyInfoSafeHandle.Dispose(); // no longer need this

            // Export the BCRYPT key handle as raw CNG key material

            // first, get the required byte count
            uint numBytesRequired;
            int ntstatus = NativeMethods.BCryptExportKey(
                hKey: bcryptKeyHandle,
                hExportKey: IntPtr.Zero,
                pszBlobType: BCRYPT_PUBLIC_KEY_BLOB,
                pbOutput: null,
                cbOutput: 0,
                pcbResult: out numBytesRequired,
                dwFlags: 0);

            if (ntstatus != STATUS_SUCCESS)
            {
                throw new CryptographicException($"BCryptExportKey failed with error code 0x{ntstatus:X8}.");
            }

            // next, allocate the real buffer and populate it
            byte[] rawCngKey = new byte[checked((int)numBytesRequired)];
            ntstatus = NativeMethods.BCryptExportKey(
                hKey: bcryptKeyHandle,
                hExportKey: IntPtr.Zero,
                pszBlobType: BCRYPT_PUBLIC_KEY_BLOB,
                pbOutput: rawCngKey,
                cbOutput: (uint)rawCngKey.Length,
                pcbResult: out numBytesRequired,
                dwFlags: 0);

            if (ntstatus != STATUS_SUCCESS)
            {
                throw new CryptographicException($"BCryptExportKey failed with error code 0x{ntstatus:X8}.");
            }

            bcryptKeyHandle.Dispose(); // no longer need this

            // resize the CNG key buffer if we overallocated
            if (numBytesRequired != rawCngKey.Length)
            {
                byte[] tempBuffer = new byte[numBytesRequired];
                Buffer.BlockCopy(rawCngKey, 0, tempBuffer, 0, tempBuffer.Length);
                rawCngKey = tempBuffer;
            }

            // finally, set properties
            _rawCngPublicKeyBlob = rawCngKey;
        }

Member Function Documentation

CngKey GetPublicKey ( ) [inline]

Definition at line 132 of file SubjectPublicKeyInfo.cs.

        {
            return CngKey.Import(_rawCngPublicKeyBlob, CngKeyBlobFormat.GenericPublicBlob);
        }

Member Data Documentation

readonly byte [] _rawCngPublicKeyBlob [private]

Definition at line 29 of file SubjectPublicKeyInfo.cs.

const uint STATUS_SUCCESS = 0 [private]

Definition at line 27 of file SubjectPublicKeyInfo.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/SubjectPublicKeyInfo.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SubjectPublicKeyInfo::SafeBCryptKeyHandle Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • SubjectPublicKeyInfo
  • SubjectPublicKeyInfo::SafeBCryptKeyHandle
Protected Member Functions | Private Member Functions

SubjectPublicKeyInfo::SafeBCryptKeyHandle Class Reference

List of all members.

Protected Member Functions

override bool ReleaseHandle ()

Private Member Functions

SafeBCryptKeyHandle ()

Detailed Description

Definition at line 137 of file SubjectPublicKeyInfo.cs.

Constructor & Destructor Documentation

SafeBCryptKeyHandle ( ) [inline, private]

Definition at line 139 of file SubjectPublicKeyInfo.cs.

: base(ownsHandle: true) { }

Member Function Documentation

override bool ReleaseHandle ( ) [inline, protected]

Definition at line 141 of file SubjectPublicKeyInfo.cs.

            {
                return (NativeMethods.BCryptDestroyKey(handle) == STATUS_SUCCESS);
            }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/SubjectPublicKeyInfo.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SubjectPublicKeyInfo::SafeLocalAllocHandle Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • SubjectPublicKeyInfo
  • SubjectPublicKeyInfo::SafeLocalAllocHandle
Static Public Member Functions | Protected Member Functions | Private Member Functions

SubjectPublicKeyInfo::SafeLocalAllocHandle Class Reference

List of all members.

Static Public Member Functions

static SafeLocalAllocHandle | Alloc (int cb)

Protected Member Functions

override bool | ReleaseHandle ()

Private Member Functions

SafeLocalAllocHandle ()
void | AllocCore (int cb)

Detailed Description

Definition at line 147 of file SubjectPublicKeyInfo.cs.

Constructor & Destructor Documentation

SafeLocalAllocHandle ( ) [inline, private]

Definition at line 149 of file SubjectPublicKeyInfo.cs.

: base(ownsHandle: true) { }

Member Function Documentation

static SafeLocalAllocHandle Alloc ( int cb ) [inline, static]

Definition at line 151 of file SubjectPublicKeyInfo.cs.

            {
                SafeLocalAllocHandle handle = new SafeLocalAllocHandle();
                handle.AllocCore(cb);
                return handle;
            }

void AllocCore ( int cb ) [inline, private]

Definition at line 159 of file SubjectPublicKeyInfo.cs.

            {
                SetHandle(Marshal.AllocHGlobal(cb));
            }

override bool ReleaseHandle ( ) [inline, protected]

Definition at line 164 of file SubjectPublicKeyInfo.cs.

            {
                Marshal.FreeHGlobal(handle);
                return true;
            }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/SubjectPublicKeyInfo.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserAndKeyHintMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Models
  • UserAndKeyHintMessage
Public Attributes

UserAndKeyHintMessage Class Reference

List of all members.

Public Attributes

string | PublicKeyHint
string | UserId

Detailed Description

Definition at line 26 of file Messages.cs.

Member Data Documentation

string PublicKeyHint

Definition at line 29 of file Messages.cs.

string UserId

Definition at line 28 of file Messages.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Models/Messages.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AuthenticationController Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • Controllers
  • AuthenticationController
Public Member Functions

AuthenticationController Class Reference

List of all members.

Public Member Functions

bool | Register (RegisterMessage message)
bool | RemoveRegisteredKey (UserAndKeyHintMessage message)
string | RequestChallenge (UserAndKeyHintMessage message)
bool | SubmitResponse (SignatureMessage message)

Detailed Description

Definition at line 26 of file AuthenticationController.cs.

Member Function Documentation

bool Register ( RegisterMessage message ) [inline]

Definition at line 78 of file AuthenticationController.cs.

        {
            bool retval = false;

            if (string.IsNullOrEmpty(message.UserId) ||
                string.IsNullOrEmpty(message.PublicKey))
            {
                return false;
            }

            try
            {
                byte[] publicKeyBuffer = Convert.FromBase64String(message.PublicKey);

                // Hash the public key.
                SHA256 hashalg = SHA256.Create();
                byte[] publicKeyHashBuffer = hashalg.ComputeHash(publicKeyBuffer);

                string publicKeyHash = Convert.ToBase64String(publicKeyHashBuffer);

                retval = DAL.Instance.RegisterUser(message.UserId, publicKeyBuffer, publicKeyHash, message.DeviceName);
            }
            catch (Exception)
            {
            }
            return retval;
        }

bool RemoveRegisteredKey ( UserAndKeyHintMessage message ) [inline]

Definition at line 107 of file AuthenticationController.cs.

        {
            bool retval = false;
            try
            {
                retval = DAL.Instance.RemoveRegisteredKey(message.UserId, message.PublicKeyHint);
            }
            catch (Exception)
            {
            }
            return retval;
        }

string RequestChallenge ( UserAndKeyHintMessage message ) [inline]

Definition at line 29 of file AuthenticationController.cs.

        {
            try
            {
                byte[] challengeBuffer = new byte[16];
                // Generate Random nonce
                RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
                rng.GetBytes(challengeBuffer);

                DAL.Instance.SetActiveChallenge(message.UserId, message.PublicKeyHint, challengeBuffer);
                return Convert.ToBase64String(challengeBuffer);
            }
            catch (Exception)
            {
                return string.Empty;
            }
        }

bool SubmitResponse ( SignatureMessage message ) [inline]

Definition at line 48 of file AuthenticationController.cs.

        {
            bool retval = false;

            try
            {
                // Use the public key hint to identify which public key to use.
                byte[] challenge;
                byte[] publicKey = DAL.Instance.GetPublicKeyForUser(message.UserId, message.PublicKeyHint, out challenge);

                CngKey pubCngKey = new SubjectPublicKeyInfo(publicKey).GetPublicKey();

                // Validate that the original challenge was signed using the corresponding private key.
                using (RSACng pubKey = new RSACng(pubCngKey))
                {
                    byte[] signature = Convert.FromBase64String(message.Signature);
                    retval = pubKey.VerifyData(challenge, signature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
                }
            }
            catch (Exception)
            {
            }

            // Return a boolean response to the client
            // TODO:  What should actually be returned is an authentication token (OAuth or equivalent)
            // that the client uses for subsequent authentication requests
            return retval;
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Controllers/AuthenticationController.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HomeController Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • Controllers
  • HomeController
Public Member Functions

HomeController Class Reference

List of all members.

Public Member Functions

ActionResult Index ()

Detailed Description

Definition at line 21 of file HomeController.cs.

Member Function Documentation

ActionResult Index ( ) [inline]

Definition at line 24 of file HomeController.cs.

        {
            return View();
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Controllers/HomeController.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DAL Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • Data
  • DAL
Classes | Public Member Functions | Properties | Private Member Functions

DAL Class Reference

List of all members.

Classes

class | RegisteredUser

Public Member Functions

byte[] | GetPublicKeyForUser (string userId, string publicKeyHash, out byte[] challenge)
bool | RegisterUser (string userId, byte[] publicKey, string publicKeyHash, string deviceName)
bool | RemoveRegisteredKey (string userId, string publicKeyHash)
bool | SetActiveChallenge (string userId, string publicKeyHash, byte[] challenge)

Properties

static DAL | Instance [get]
List< RegisteredUser > | Users [get]

Private Member Functions

DAL ()

Detailed Description

Definition at line 24 of file DAL.cs.

Constructor & Destructor Documentation

DAL ( ) [inline, private]

Definition at line 41 of file DAL.cs.

        {
        }

Member Function Documentation

byte [] GetPublicKeyForUser | ( | string | userId,
 |  | string | publicKeyHash,
 |  | out byte[] | challenge |
 | ) |  |  | [inline]

Definition at line 63 of file DAL.cs.

        {
            RegisteredUser user = Users.FirstOrDefault(u => u.UserId == userId && u.PublicKeyHash == publicKeyHash);

            // Each challenge is valid only once. Prevent replay attack.
            challenge = user.ActiveChallenge;
            user.ActiveChallenge = null;

            return user.PublicKey;
        }

bool RegisterUser | ( | string | userId,
 |  | byte[] | publicKey,
 |  | string | publicKeyHash,
 |  | string | deviceName |
 | ) |  |  | [inline]

Definition at line 45 of file DAL.cs.

        {
            Users.Add(new RegisteredUser
            {
                UserId = userId,
                PublicKey = publicKey,
                PublicKeyHash = publicKeyHash,
                DeviceName = deviceName
            });
            return true;
        }

bool RemoveRegisteredKey | ( | string | userId,
 |  | string | publicKeyHash |
 | ) |  |  | [inline]

Definition at line 57 of file DAL.cs.

        {
            Users.RemoveAll(u => u.UserId == userId && u.PublicKeyHash == publicKeyHash);
            return true;
        }

bool SetActiveChallenge | ( | string | userId,
 |  | string | publicKeyHash,
 |  | byte[] | challenge |
 | ) |  |  | [inline]

Definition at line 74 of file DAL.cs.

        {
            RegisteredUser user = Users.FirstOrDefault(u => u.UserId == userId && u.PublicKeyHash == publicKeyHash);
            user.ActiveChallenge = challenge;
            return true;
        }

Property Documentation

DAL Instance [static, get]

Definition at line 26 of file DAL.cs.

List<RegisteredUser> Users [get, private]

Definition at line 39 of file DAL.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Data/DAL.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DAL::RegisteredUser Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • Data
  • DAL
  • DAL::RegisteredUser
Public Attributes

DAL::RegisteredUser Class Reference

List of all members.

Public Attributes

byte[] | ActiveChallenge
string | DeviceName
byte[] | PublicKey
string | PublicKeyHash
string | UserId

Detailed Description

Definition at line 31 of file DAL.cs.

Member Data Documentation

byte [] ActiveChallenge

Definition at line 37 of file DAL.cs.

string DeviceName

Definition at line 36 of file DAL.cs.

byte [] PublicKey

Definition at line 34 of file DAL.cs.

string PublicKeyHash

Definition at line 35 of file DAL.cs.

string UserId

Definition at line 33 of file DAL.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Data/DAL.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilterConfig Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • FilterConfig
Static Public Member Functions

FilterConfig Class Reference

List of all members.

Static Public Member Functions

static void RegisterGlobalFilters (GlobalFilterCollection filters)

Detailed Description

Definition at line 6 of file FilterConfig.cs.

Member Function Documentation

static void RegisterGlobalFilters ( GlobalFilterCollection filters ) [inline, static]

Definition at line 8 of file FilterConfig.cs.

        {
            filters.Add(new HandleErrorAttribute());
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/App_Start/FilterConfig.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RouteConfig Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • RouteConfig
Static Public Member Functions

RouteConfig Class Reference

List of all members.

Static Public Member Functions

static void RegisterRoutes (RouteCollection routes)

Detailed Description

Definition at line 6 of file RouteConfig.cs.

Member Function Documentation

static void RegisterRoutes ( RouteCollection routes ) [inline, static]

Definition at line 8 of file RouteConfig.cs.

        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/App_Start/RouteConfig.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebApiApplication Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MicrosoftPassport
  • Server
  • WebApiApplication
Protected Member Functions

WebApiApplication Class Reference

List of all members.

Protected Member Functions

void Application_Start ()

Detailed Description

Definition at line 23 of file Global.asax.cs.

Member Function Documentation

void Application_Start ( ) [inline, protected]

Definition at line 25 of file Global.asax.cs.

        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/Server/Global.asax.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MidiDeviceWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MIDI
  • MidiDeviceWatcher
Private Member Functions | Private Attributes

MidiDeviceWatcher Class Reference

DeviceWatcher class to monitor adding/removing MIDI devices on the fly. More...

List of all members.

Private Member Functions

internal | MidiDeviceWatcher (string midiSelectorString, CoreDispatcher dispatcher, ListBox portListBox)
~MidiDeviceWatcher ()
async void | DeviceWatcher_Added (DeviceWatcher sender, DeviceInformation args)
async void | DeviceWatcher_EnumerationCompleted (DeviceWatcher sender, object args)
async void | DeviceWatcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)
async void | DeviceWatcher_Updated (DeviceWatcher sender, DeviceInformationUpdate args)
internal
DeviceInformationCollection 		GetDeviceInformationCollection ()
internal void | Start ()
internal void | Stop ()
async void | UpdateDevices ()

Private Attributes

CoreDispatcher | coreDispatcher = null
internal
DeviceInformationCollection 		deviceInformationCollection = null
internal DeviceWatcher | deviceWatcher = null
bool | enumerationCompleted = false
string | midiSelector = string.Empty
ListBox | portList = null

Detailed Description

Definition at line 28 of file MidiDeviceWatcher.cs.

Constructor & Destructor Documentation

internal MidiDeviceWatcher | ( | string | midiSelectorString,
 |  | CoreDispatcher | dispatcher,
 |  | ListBox | portListBox |
 | ) |  |  | [inline, private]

Constructor: Initialize and hook up Device Watcher events.

Parameters:
midiSelectorString | MIDI Device Selector
dispatcher | CoreDispatcher instance, to update UI thread
portListBox | The UI element to update with list of devices

Definition at line 43 of file MidiDeviceWatcher.cs.

        {
            this.deviceWatcher = DeviceInformation.CreateWatcher(midiSelectorString);
            this.portList = portListBox;
            this.midiSelector = midiSelectorString;
            this.coreDispatcher = dispatcher;

            this.deviceWatcher.Added += DeviceWatcher_Added;
            this.deviceWatcher.Removed += DeviceWatcher_Removed;
            this.deviceWatcher.Updated += DeviceWatcher_Updated;
            this.deviceWatcher.EnumerationCompleted += DeviceWatcher_EnumerationCompleted;
        }

~MidiDeviceWatcher ( ) [inline, private]

Destructor: Remove Device Watcher events.

Definition at line 59 of file MidiDeviceWatcher.cs.

        {
            this.deviceWatcher.Added -= DeviceWatcher_Added;
            this.deviceWatcher.Removed -= DeviceWatcher_Removed;
            this.deviceWatcher.Updated -= DeviceWatcher_Updated;
            this.deviceWatcher.EnumerationCompleted -= DeviceWatcher_EnumerationCompleted;
        }

Member Function Documentation

async void DeviceWatcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Update UI on device added.

Parameters:
sender | The active DeviceWatcher instance
args | Event arguments

Definition at line 135 of file MidiDeviceWatcher.cs.

        {
            // If all devices have been enumerated
            if (this.enumerationCompleted)
            {
                await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
                {
                    // Update the device list
                    UpdateDevices();
                });
            }
        }

async void DeviceWatcher_EnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Update UI on device enumeration completed.

Parameters:
sender | The active DeviceWatcher instance
args | Event arguments

Definition at line 189 of file MidiDeviceWatcher.cs.

        {
            this.enumerationCompleted = true;
            await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
            {
                // Update the device list
                UpdateDevices();
            });
        }

async void DeviceWatcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Update UI on device removed.

Parameters:
sender | The active DeviceWatcher instance
args | Event arguments

Definition at line 153 of file MidiDeviceWatcher.cs.

        {
            // If all devices have been enumerated
            if (this.enumerationCompleted)
            {
                await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
                {
                    // Update the device list
                    UpdateDevices();
                });
            }
        }

async void DeviceWatcher_Updated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Update UI on device updated.

Parameters:
sender | The active DeviceWatcher instance
args | Event arguments

Definition at line 171 of file MidiDeviceWatcher.cs.

        {
            // If all devices have been enumerated
            if (this.enumerationCompleted)
            {
                await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
                {
                    // Update the device list
                    UpdateDevices();
                });
            }
        }

internal DeviceInformationCollection GetDeviceInformationCollection ( ) [inline, private]

Get the DeviceInformationCollection.

Returns:

Definition at line 93 of file MidiDeviceWatcher.cs.

        {
            return this.deviceInformationCollection;
        }

internal void Start ( ) [inline, private]

Start the Device Watcher.

Definition at line 70 of file MidiDeviceWatcher.cs.

        {
            if(this.deviceWatcher.Status != DeviceWatcherStatus.Started)
            {
                this.deviceWatcher.Start();
            }
        }

internal void Stop ( ) [inline, private]

Stop the Device Watcher.

Definition at line 81 of file MidiDeviceWatcher.cs.

        {
            if(this.deviceWatcher.Status != DeviceWatcherStatus.Stopped)
            {
                this.deviceWatcher.Stop();
            }
        }

async void UpdateDevices ( ) [inline, private]

Add any connected MIDI devices to the list.

Definition at line 101 of file MidiDeviceWatcher.cs.

        {
            // Get a list of all MIDI devices
            this.deviceInformationCollection = await DeviceInformation.FindAllAsync(this.midiSelector);

            // If no devices are found, update the ListBox
            if ((this.deviceInformationCollection == null) || (this.deviceInformationCollection.Count == 0))
            {
                // Start with a clean list
                this.portList.Items.Clear();

                this.portList.Items.Add("No MIDI ports found");
                this.portList.IsEnabled = false;
            }
            // If devices are found, enumerate them and add them to the list
            else
            {
                // Start with a clean list
                this.portList.Items.Clear();

                foreach (var device in deviceInformationCollection)
                {
                    this.portList.Items.Add(device.Name);
                }

                this.portList.IsEnabled = true;
            }
        }

Member Data Documentation

CoreDispatcher coreDispatcher = null [private]

Definition at line 35 of file MidiDeviceWatcher.cs.

internal DeviceInformationCollection deviceInformationCollection = null [private]

Definition at line 31 of file MidiDeviceWatcher.cs.

internal DeviceWatcher deviceWatcher = null [private]

Definition at line 30 of file MidiDeviceWatcher.cs.

bool enumerationCompleted = false [private]

Definition at line 32 of file MidiDeviceWatcher.cs.

string midiSelector = string.Empty [private]

Definition at line 34 of file MidiDeviceWatcher.cs.

ListBox portList = null [private]

Definition at line 33 of file MidiDeviceWatcher.cs.

The documentation for this class was generated from the following file:
  • MIDI/cs/MidiDeviceWatcher.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_MIDIDeviceEnumeration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MIDI
  • Scenario1_MIDIDeviceEnumeration
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_MIDIDeviceEnumeration Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_MIDIDeviceEnumeration ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearAllDeviceValues ()
void | DeviceAutoDetectToggle_Toggled (object sender, RoutedEventArgs e)
void | DisplayDeviceProperties (DeviceInformation devInfo, ListBox propertiesList)
async Task | EnumerateMidiInputDevices ()
async Task | EnumerateMidiOutputDevices ()
void | inputDevices_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | listInputDevicesButton_Click (object sender, RoutedEventArgs e)
async void | listOutputDevicesButton_Click (object sender, RoutedEventArgs e)
void | outputDevices_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

MidiDeviceWatcher midiInDeviceWatcher
MidiDeviceWatcher midiOutDeviceWatcher
MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

Constructor & Destructor Documentation

Scenario1_MIDIDeviceEnumeration ( ) [inline]

Constructor: Empty device lists, start the device watchers and set initial states for buttons.

Definition at line 67 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            this.InitializeComponent();

            // Start with a clean slate
            ClearAllDeviceValues();

            // Ensure Auto-detect devices toggle is on
            this.deviceAutoDetectToggle.IsOn = true;

            // Set up the MIDI input and output device watchers
            this.midiInDeviceWatcher = new MidiDeviceWatcher(MidiInPort.GetDeviceSelector(), Dispatcher, this.inputDevices);
            this.midiOutDeviceWatcher = new MidiDeviceWatcher(MidiOutPort.GetDeviceSelector(), Dispatcher, this.outputDevices);

            // Start watching for devices
            this.midiInDeviceWatcher.Start();
            this.midiOutDeviceWatcher.Start();

            // Disable manual enumeration buttons
            this.listInputDevicesButton.IsEnabled = false;
            this.listOutputDevicesButton.IsEnabled = false;
        }

Member Function Documentation

void ClearAllDeviceValues ( ) [inline, private]

Clear all input and output MIDI device lists and properties.

Definition at line 93 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Clear input devices
            this.inputDevices.Items.Clear();
            this.inputDevices.Items.Add("Click button to list input MIDI devices");
            this.inputDevices.IsEnabled = false;

            // Clear output devices
            this.outputDevices.Items.Clear();
            this.outputDevices.Items.Add("Click button to list output MIDI devices");
            this.outputDevices.IsEnabled = false;

            // Clear input device properties
            this.inputDeviceProperties.Items.Clear();
            this.inputDeviceProperties.Items.Add("Select a MIDI input device to view its properties");
            this.inputDeviceProperties.IsEnabled = false;

            // Clear output device properties
            this.outputDeviceProperties.Items.Clear();
            this.outputDeviceProperties.Items.Add("Select a MIDI output device to view its properties");
            this.outputDeviceProperties.IsEnabled = false;
        }

void DeviceAutoDetectToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Detect the toggle state of the Devicewatcher button.

If auto-detect is on, disable manual enumeration buttons and start device watchers If auto-detect is off, enable manual enumeration buttons and stop device watchers

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 213 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            if (this.deviceAutoDetectToggle.IsOn)
            {
                this.listInputDevicesButton.IsEnabled = false;
                this.listOutputDevicesButton.IsEnabled = false;

                if (this.midiInDeviceWatcher != null)
                {
                    this.midiInDeviceWatcher.Start();
                }
                if (this.midiOutDeviceWatcher != null)
                {
                    this.midiOutDeviceWatcher.Start();
                }
            }
            else
            {
                this.listInputDevicesButton.IsEnabled = true;
                this.listOutputDevicesButton.IsEnabled = true;

                if (this.midiInDeviceWatcher != null)
                {
                    this.midiInDeviceWatcher.Stop();
                }
                if (this.midiOutDeviceWatcher != null)
                {
                    this.midiOutDeviceWatcher.Stop();
                }
            }
        }

void DisplayDeviceProperties | ( | DeviceInformation | devInfo,
 |  | ListBox | propertiesList |
 | ) |  |  | [inline, private]

Display the properties of the MIDI device to the user.

Parameters:
devInfo
propertiesList

Definition at line 342 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            propertiesList.Items.Clear();
            propertiesList.Items.Add("Id: " + devInfo.Id);
            propertiesList.Items.Add("Name: " + devInfo.Name);
            propertiesList.Items.Add("IsDefault: " + devInfo.IsDefault);
            propertiesList.Items.Add("IsEnabled: " + devInfo.IsEnabled);
            propertiesList.Items.Add("EnclosureLocation: " + devInfo.EnclosureLocation);

            // Add device interface information
            propertiesList.Items.Add("----Device Interface----");
            foreach (var deviceProperty in devInfo.Properties)
            {
                propertiesList.Items.Add(deviceProperty.Key + ": " + deviceProperty.Value);
            }

            propertiesList.IsEnabled = true;
        }

async Task EnumerateMidiInputDevices ( ) [inline, private]

Query DeviceInformation class for Midi Input devices.

Definition at line 130 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Clear input devices
            this.inputDevices.Items.Clear();
            this.inputDeviceProperties.Items.Clear();
            this.inputDeviceProperties.IsEnabled = false;

            // Find all input MIDI devices
            string midiInputQueryString = MidiInPort.GetDeviceSelector();
            DeviceInformationCollection midiInputDevices = await DeviceInformation.FindAllAsync(midiInputQueryString);

            // Return if no external devices are connected
            if (midiInputDevices.Count == 0)
            {
                this.inputDevices.Items.Add("No MIDI input devices found!");
                this.inputDevices.IsEnabled = false;

                this.rootPage.NotifyUser("Please connect at least one external MIDI device for this demo to work correctly", NotifyType.ErrorMessage);
                return;
            }

            // Else, add each connected input device to the list
            foreach (DeviceInformation deviceInfo in midiInputDevices)
            {
                this.inputDevices.Items.Add(deviceInfo.Name);
                this.inputDevices.IsEnabled = true;
            }

            this.rootPage.NotifyUser("MIDI Input devices found!", NotifyType.StatusMessage);
        }

async Task EnumerateMidiOutputDevices ( ) [inline, private]

Query DeviceInformation class for Midi Output devices.

Definition at line 175 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Clear output devices
            this.outputDevices.Items.Clear();
            this.outputDeviceProperties.Items.Clear();
            this.outputDeviceProperties.IsEnabled = false;

            // Find all output MIDI devices
            string midiOutputQueryString = MidiOutPort.GetDeviceSelector();
            DeviceInformationCollection midiOutputDevices = await DeviceInformation.FindAllAsync(midiOutputQueryString);

            // Return if no external devices are connected, and GS synth is not detected
            if (midiOutputDevices.Count == 0)
            {
                this.outputDevices.Items.Add("No MIDI output devices found!");
                this.outputDevices.IsEnabled = false;

                this.rootPage.NotifyUser("Please connect at least one external MIDI device for this demo to work correctly", NotifyType.ErrorMessage);
                return;
            }

            // List specific device information for each output device
            foreach (DeviceInformation deviceInfo in midiOutputDevices)
            {
                this.outputDevices.Items.Add(deviceInfo.Name);
                this.outputDevices.IsEnabled = true;
            }

            this.rootPage.NotifyUser("MIDI Output devices found!", NotifyType.StatusMessage);
        }

void inputDevices_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Change the active input MIDI device.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 250 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Get the selected input MIDI device
            int selectedInputDeviceIndex = this.inputDevices.SelectedIndex;

            // Try to display the appropriate device properties
            if (selectedInputDeviceIndex < 0)
            {
                // Clear input device properties
                this.inputDeviceProperties.Items.Clear();
                this.inputDeviceProperties.Items.Add("Select a MIDI input device to view its properties");
                this.inputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Select a MIDI input device to view its properties", NotifyType.StatusMessage);
                return;
            }

            DeviceInformationCollection devInfoCollection = this.midiInDeviceWatcher.GetDeviceInformationCollection();
            if (devInfoCollection == null)
            {
                this.inputDeviceProperties.Items.Clear();
                this.inputDeviceProperties.Items.Add("Device not found!");
                this.inputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            DeviceInformation devInfo = devInfoCollection[selectedInputDeviceIndex];
            if (devInfo == null)
            {
                this.inputDeviceProperties.Items.Clear();
                this.inputDeviceProperties.Items.Add("Device not found!");
                this.inputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            // Display the found properties
            DisplayDeviceProperties(devInfo, this.inputDeviceProperties);
            this.rootPage.NotifyUser("Device information found!", NotifyType.StatusMessage);
        }

async void listInputDevicesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Input button click handler.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 121 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Enumerate input devices
            await EnumerateMidiInputDevices();
        }

async void listOutputDevicesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Output button click handler.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 166 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Enumerate output devices
            await EnumerateMidiOutputDevices();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Stop the device watchers when leaving the scenario.

Parameters:
e Event arguments

Definition at line 54 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            // Stop the input and output device watchers
            this.midiInDeviceWatcher.Stop();
            this.midiOutDeviceWatcher.Stop();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Set the rootpage context when entering the scenario.

Parameters:
e Event arguments

Definition at line 45 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            this.rootPage = MainPage.Current;
        }

void outputDevices_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Change the active output MIDI device.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 296 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

        {
            // Get the selected output MIDI device
            int selectedOutputDeviceIndex = this.outputDevices.SelectedIndex;

            // Try to display the appropriate device properties
            if (selectedOutputDeviceIndex < 0)
            {
                // Clear output device properties
                this.outputDeviceProperties.Items.Clear();
                this.outputDeviceProperties.Items.Add("Select a MIDI output device to view its properties");
                this.outputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Select a MIDI output device to view its properties", NotifyType.StatusMessage);
                return;
            }

            DeviceInformationCollection devInfoCollection = this.midiOutDeviceWatcher.GetDeviceInformationCollection();
            if (devInfoCollection == null)
            {
                this.outputDeviceProperties.Items.Clear();
                this.outputDeviceProperties.Items.Add("Device not found!");
                this.outputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            DeviceInformation devInfo = devInfoCollection[selectedOutputDeviceIndex];
            if (devInfo == null)
            {
                this.outputDeviceProperties.Items.Clear();
                this.outputDeviceProperties.Items.Add("Device not found!");
                this.outputDeviceProperties.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            // Display the found properties
            DisplayDeviceProperties(devInfo, this.outputDeviceProperties);
            this.rootPage.NotifyUser("Device information found!", NotifyType.StatusMessage);
        }

Member Data Documentation

MidiDeviceWatcher midiInDeviceWatcher [private]

Device watchers for MIDI in and out ports.

Definition at line 38 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

MidiDeviceWatcher midiOutDeviceWatcher [private]

Definition at line 39 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

MainPage rootPage [private]

Main Page.

Definition at line 33 of file Scenario1_MIDIDeviceEnumeration.xaml.cs.

The documentation for this class was generated from the following file:
  • MIDI/cs/Scenario1_MIDIDeviceEnumeration.xaml.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ReceiveMIDIMessages Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MIDI
  • Scenario2_ReceiveMIDIMessages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ReceiveMIDIMessages Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_ReceiveMIDIMessages ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | inputDevices_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | MidiInputDevice_MessageReceived (MidiInPort sender, MidiMessageReceivedEventArgs args)

Private Attributes

MidiDeviceWatcher midiInDeviceWatcher
List< MidiInPort > | midiInPorts
MainPage rootPage

Detailed Description

Definition at line 30 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ReceiveMIDIMessages ( ) [inline]

Constructor: Start the device watcher.

Definition at line 78 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the list of active MIDI input devices
            this.midiInPorts = new List<MidiInPort>();

            // Set up the MIDI input device watcher
            this.midiInDeviceWatcher = new MidiDeviceWatcher(MidiInPort.GetDeviceSelector(), Dispatcher, this.inputDevices);

            // Start watching for devices
            this.midiInDeviceWatcher.Start();
        }

Member Function Documentation

async void inputDevices_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Change the input MIDI device from which to receive messages.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 97 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

        {
            // Get the selected input MIDI device
            int selectedInputDeviceIndex = (sender as ListBox).SelectedIndex;

            // Try to create a MidiInPort
            if (selectedInputDeviceIndex < 0)
            {
                // Clear input device messages
                this.inputDeviceMessages.Items.Clear();
                this.inputDeviceMessages.Items.Add("Select a MIDI input device to be able to see its messages");
                this.inputDeviceMessages.IsEnabled = false;
                this.rootPage.NotifyUser("Select a MIDI input device to be able to see its messages", NotifyType.StatusMessage);
                return;
            }

            DeviceInformationCollection devInfoCollection = this.midiInDeviceWatcher.GetDeviceInformationCollection();
            if (devInfoCollection == null)
            {
                this.inputDeviceMessages.Items.Clear();
                this.inputDeviceMessages.Items.Add("Device not found!");
                this.inputDeviceMessages.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            DeviceInformation devInfo = devInfoCollection[selectedInputDeviceIndex];
            if (devInfo == null)
            {
                this.inputDeviceMessages.Items.Clear();
                this.inputDeviceMessages.Items.Add("Device not found!");
                this.inputDeviceMessages.IsEnabled = false;
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            var currentMidiInputDevice = await MidiInPort.FromIdAsync(devInfo.Id);
            if (currentMidiInputDevice == null)
            {
                this.rootPage.NotifyUser("Unable to create MidiInPort from input device", NotifyType.ErrorMessage);
                return;
            }

            // We have successfully created a MidiInPort; add the device to the list of active devices, and set up message receiving
            if (!this.midiInPorts.Contains(currentMidiInputDevice))
            {
                this.midiInPorts.Add(currentMidiInputDevice);
                currentMidiInputDevice.MessageReceived += MidiInputDevice_MessageReceived;
            }

            // Clear any previous input messages
            this.inputDeviceMessages.Items.Clear();
            this.inputDeviceMessages.IsEnabled = true;

            this.rootPage.NotifyUser("Input Device selected successfully! Waiting for messages...", NotifyType.StatusMessage);
        }

async void MidiInputDevice_MessageReceived | ( | MidiInPort | sender,
 |  | MidiMessageReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Display the received MIDI message in a readable format.

Parameters:
sender | Element that fired the event
args | The received message

Definition at line 159 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

        {
            IMidiMessage receivedMidiMessage = args.Message;

            // Build the received MIDI message into a readable format
            StringBuilder outputMessage = new StringBuilder();
            outputMessage.Append(receivedMidiMessage.Timestamp.ToString()).Append(", Type: ").Append(receivedMidiMessage.Type);

            // Add MIDI message parameters to the output, depending on the type of message
            switch (receivedMidiMessage.Type)
            {
                case MidiMessageType.NoteOff:
                    var noteOffMessage = (MidiNoteOffMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(noteOffMessage.Channel).Append(", Note: ").Append(noteOffMessage.Note).Append(", Velocity: ").Append(noteOffMessage.Velocity);
                    break;
                case MidiMessageType.NoteOn:
                    var noteOnMessage = (MidiNoteOnMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(noteOnMessage.Channel).Append(", Note: ").Append(noteOnMessage.Note).Append(", Velocity: ").Append(noteOnMessage.Velocity);
                    break;
                case MidiMessageType.PolyphonicKeyPressure:
                    var polyphonicKeyPressureMessage = (MidiPolyphonicKeyPressureMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(polyphonicKeyPressureMessage.Channel).Append(", Note: ").Append(polyphonicKeyPressureMessage.Note).Append(", Pressure: ").Append(polyphonicKeyPressureMessage.Pressure);
                    break;
                case MidiMessageType.ControlChange:
                    var controlChangeMessage = (MidiControlChangeMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(controlChangeMessage.Channel).Append(", Controller: ").Append(controlChangeMessage.Controller).Append(", Value: ").Append(controlChangeMessage.ControlValue);
                    break;
                case MidiMessageType.ProgramChange:
                    var programChangeMessage = (MidiProgramChangeMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(programChangeMessage.Channel).Append(", Program: ").Append(programChangeMessage.Program);
                    break;
                case MidiMessageType.ChannelPressure:
                    var channelPressureMessage = (MidiChannelPressureMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(channelPressureMessage.Channel).Append(", Pressure: ").Append(channelPressureMessage.Pressure);
                    break;
                case MidiMessageType.PitchBendChange:
                    var pitchBendChangeMessage = (MidiPitchBendChangeMessage)receivedMidiMessage;
                    outputMessage.Append(", Channel: ").Append(pitchBendChangeMessage.Channel).Append(", Bend: ").Append(pitchBendChangeMessage.Bend);
                    break;
                case MidiMessageType.SystemExclusive:
                    var systemExclusiveMessage = (MidiSystemExclusiveMessage)receivedMidiMessage;
                    outputMessage.Append(", ");

                    // Read the SysEx bufffer
                    var sysExDataReader = DataReader.FromBuffer(systemExclusiveMessage.RawData);
                    while (sysExDataReader.UnconsumedBufferLength > 0)
                    {
                        byte byteRead = sysExDataReader.ReadByte();
                        // Pad with leading zero if necessary
                        outputMessage.Append(byteRead.ToString("X2")).Append(" ");
                    }
                    break;
                case MidiMessageType.MidiTimeCode:
                    var timeCodeMessage = (MidiTimeCodeMessage)receivedMidiMessage;
                    outputMessage.Append(", FrameType: ").Append(timeCodeMessage.FrameType).Append(", Values: ").Append(timeCodeMessage.Values);
                    break;
                case MidiMessageType.SongPositionPointer:
                    var songPositionPointerMessage = (MidiSongPositionPointerMessage)receivedMidiMessage;
                    outputMessage.Append(", Beats: ").Append(songPositionPointerMessage.Beats);
                    break;
                case MidiMessageType.SongSelect:
                    var songSelectMessage = (MidiSongSelectMessage)receivedMidiMessage;
                    outputMessage.Append(", Song: ").Append(songSelectMessage.Song);
                    break;
                case MidiMessageType.TuneRequest:
                    var tuneRequestMessage = (MidiTuneRequestMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.TimingClock:
                    var timingClockMessage = (MidiTimingClockMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.Start:
                    var startMessage = (MidiStartMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.Continue:
                    var continueMessage = (MidiContinueMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.Stop:
                    var stopMessage = (MidiStopMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.ActiveSensing:
                    var activeSensingMessage = (MidiActiveSensingMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.SystemReset:
                    var systemResetMessage = (MidiSystemResetMessage)receivedMidiMessage;
                    break;
                case MidiMessageType.None:
                    throw new InvalidOperationException();
                default:
                    break;
            }

            // Use the Dispatcher to update the messages on the UI thread
            await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
            {
                // Skip TimingClock and ActiveSensing messages to avoid overcrowding the list. Commment this check out to see all messages
                if ((receivedMidiMessage.Type != MidiMessageType.TimingClock) && (receivedMidiMessage.Type != MidiMessageType.ActiveSensing))
                {
                    this.inputDeviceMessages.Items.Add(outputMessage + "\n");
                    this.inputDeviceMessages.ScrollIntoView(this.inputDeviceMessages.Items[this.inputDeviceMessages.Items.Count - 1]);
                    this.rootPage.NotifyUser("Message received successfully!", NotifyType.StatusMessage);
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Stop the device watcher when leaving the scenario.

Parameters:
e Event arguments

Definition at line 60 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            // Stop the input device watcher
            this.midiInDeviceWatcher.Stop();

            // Close all MidiInPorts
            foreach (MidiInPort inPort in this.midiInPorts)
            {
                inPort.Dispose();
            }
            this.midiInPorts.Clear();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Set the rootpage context when entering the scenario.

Parameters:
e Event arguments

Definition at line 51 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

        {
            this.rootPage = MainPage.Current;
        }

Member Data Documentation

MidiDeviceWatcher midiInDeviceWatcher [private]

Device watcher for MIDI in ports.

Definition at line 45 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

List<MidiInPort> midiInPorts [private]

Collection of active MidiInPorts.

Definition at line 40 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

MainPage rootPage [private]

Main Page.

Definition at line 35 of file Scenario2_ReceiveMIDIMessages.xaml.cs.

The documentation for this class was generated from the following file:
  • MIDI/cs/Scenario2_ReceiveMIDIMessages.xaml.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SendMIDIMessages Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MIDI
  • Scenario3_SendMIDIMessages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_SendMIDIMessages Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_SendMIDIMessages ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | messageType_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | outputDevices_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | Parameter1_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | Parameter2_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | Parameter3_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | PopulateMessageTypes ()
void | PopulateParameterList (ComboBox list, int numberOfOptions, string listName)
void | resetButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | ResetMessageTypeAndParameters (bool resetMessageType)
void | sendButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | UpdateParameterList1 ()
void | UpdateParameterList2 ()
void | UpdateParameterList3 ()

Private Attributes

MidiMessageType | currentMessageType = MidiMessageType.None
IMidiOutPort | currentMidiOutputDevice
Dictionary< MidiMessageType,
string > 		messageTypes
MidiDeviceWatcher midiOutDeviceWatcher
List< IMidiOutPort > | midiOutPorts
MainPage rootPage

Detailed Description

Definition at line 32 of file Scenario3_SendMIDIMessages.xaml.cs.

Constructor & Destructor Documentation

Scenario3_SendMIDIMessages ( ) [inline]

Constructor: Start the device watcher and populate MIDI message types.

Definition at line 95 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the list of active MIDI output devices
            this.midiOutPorts = new List<IMidiOutPort>();

            // Set up the MIDI output device watcher
            this.midiOutDeviceWatcher = new MidiDeviceWatcher(MidiOutPort.GetDeviceSelector(), Dispatcher, this.outputDevices);

            // Start watching for devices
            this.midiOutDeviceWatcher.Start();

            // Populate message types into list
            PopulateMessageTypes();
        }

Member Function Documentation

void messageType_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Construct a MIDI message possibly with additional parameters, depending on the type of message.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 348 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Find the index of the user's choice
            int messageTypeSelectedIndex = this.messageType.SelectedIndex;

            // Return if reset
            if (messageTypeSelectedIndex == -1)
            {
                return;
            }

            // Clear the UI
            ResetMessageTypeAndParameters(false);

            // Find the key by index; that's our message type
            int count = 0;
            foreach (var messageType in messageTypes)
            {
                if (messageTypeSelectedIndex == count)
                {
                    this.currentMessageType = messageType.Key;
                    break;
                }
                count++;
            }

            // Some MIDI message types don't need additional parameters
            // For them, show the Send button as soon as user selects message type from the list
            switch (this.currentMessageType)
            {
                // SysEx messages need to be in a particular format
                case MidiMessageType.SystemExclusive:
                    this.rawBufferHeader.Visibility = Visibility.Visible;
                    this.sysExMessageContent.Visibility = Visibility.Visible;
                    // Provide start (0xF0) and end (0xF7) of SysEx values
                    sysExMessageContent.Text = "F0 F7";
                    // Let the user know the expected format of the message
                    this.rootPage.NotifyUser("Expecting a string of format 'NN NN NN NN....', where NN is a byte in hex", NotifyType.StatusMessage);
                    this.sendButton.IsEnabled = true;
                    break;

                // These messages do not need additional parameters
                case MidiMessageType.ActiveSensing:
                case MidiMessageType.Continue:
                case MidiMessageType.Start:
                case MidiMessageType.Stop:
                case MidiMessageType.SystemReset:
                case MidiMessageType.TimingClock:
                case MidiMessageType.TuneRequest:
                    this.sendButton.IsEnabled = true;
                    break;

                default:
                    this.sendButton.IsEnabled = false;
                    break;
            }

            // Update the first parameter list depending on the MIDI message type
            // If no further parameters are required, the list is emptied and hidden
            UpdateParameterList1();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Stop the device watcher when leaving the scenario.

Parameters:
e Event arguments

Definition at line 77 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            // Stop the output device watcher
            this.midiOutDeviceWatcher.Stop();

            // Close all MidiOutPorts
            foreach (IMidiOutPort outPort in this.midiOutPorts)
            {
                outPort.Dispose();
            }
            this.midiOutPorts.Clear();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Set the rootpage context when entering the scenario.

Parameters:
e Event arguments

Definition at line 68 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            this.rootPage = MainPage.Current;
        }

async void outputDevices_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Create a new MidiOutPort for the selected device.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 154 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Get the selected output MIDI device
            int selectedOutputDeviceIndex = this.outputDevices.SelectedIndex;

            // Try to create a MidiOutPort
            if (selectedOutputDeviceIndex < 0)
            {
                this.rootPage.NotifyUser("Select a MIDI output device to be able to send messages to it", NotifyType.StatusMessage);
                return;
            }

            DeviceInformationCollection devInfoCollection = this.midiOutDeviceWatcher.GetDeviceInformationCollection();
            if (devInfoCollection == null)
            {
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            DeviceInformation devInfo = devInfoCollection[selectedOutputDeviceIndex];
            if (devInfo == null)
            {
                this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
                return;
            }

            this.currentMidiOutputDevice = await MidiOutPort.FromIdAsync(devInfo.Id);
            if (this.currentMidiOutputDevice == null)
            {
                this.rootPage.NotifyUser("Unable to create MidiOutPort from output device", NotifyType.ErrorMessage);
                return;
            }

            // We have successfully created a MidiOutPort; add the device to the list of active devices
            if (!this.midiOutPorts.Contains(this.currentMidiOutputDevice))
            {
                this.midiOutPorts.Add(this.currentMidiOutputDevice);
            }

            // Enable message type list & reset button
            this.messageType.IsEnabled = true;
            this.resetButton.IsEnabled = true;

            this.rootPage.NotifyUser("Output Device selected successfully! Waiting for message type selection...", NotifyType.StatusMessage);
        }

void Parameter1_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

React to Parameter1 selection change as appropriate.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 476 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Find the index of the user's choice
            int parameter1SelectedIndex = this.parameter1.SelectedIndex;

            // Some MIDI message types don't need additional parameters past parameter 1
            // For them, show the Send button as soon as user selects parameter 1 value from the list
            switch (this.currentMessageType)
            {
                case MidiMessageType.SongPositionPointer:
                case MidiMessageType.SongSelect:

                    if (parameter1SelectedIndex != -1)
                    {
                        this.sendButton.IsEnabled = true;
                    }
                    break;

                default:
                    this.sendButton.IsEnabled = false;
                    break;
            }

            // Update the second parameter list depending on the first parameter selection
            // If no further parameters are required, the list is emptied and hidden
            UpdateParameterList2();
        }

void Parameter2_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

React to Parameter2 selection change as appropriate.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 573 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Find the index of the user's choice
            int parameter2SelectedIndex = this.parameter2.SelectedIndex;

            // Some MIDI message types don't need additional parameters past parameter 2
            // For them, show the Send button as soon as user selects parameter 2 value from the list
            switch (this.currentMessageType)
            {
                case MidiMessageType.ProgramChange:
                case MidiMessageType.ChannelPressure:
                case MidiMessageType.PitchBendChange:
                case MidiMessageType.MidiTimeCode:

                    if (parameter2SelectedIndex != -1)
                    {
                        this.sendButton.IsEnabled = true;
                    }
                    break;

                default:
                    this.sendButton.IsEnabled = false;
                    break;
            }

            // Update the third parameter list depending on the second parameter selection
            // If no further parameters are required, the list is emptied and hidden
            UpdateParameterList3();
        }

void Parameter3_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

React to Parameter3 selection change as appropriate.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 656 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Find the index of the user's choice
            int parameter3SelectedIndex = this.parameter3.SelectedIndex;

            // The last set of MIDI message types don't need additional parameters
            // For them, show the Send button as soon as user selects parameter 3 value from the list
            // Set default to disable Send button for any message types that fall through
            switch (this.currentMessageType)
            {
                case MidiMessageType.NoteOff:
                case MidiMessageType.NoteOn:
                case MidiMessageType.PolyphonicKeyPressure:
                case MidiMessageType.ControlChange:

                    if (parameter3SelectedIndex != -1)
                    {
                        this.sendButton.IsEnabled = true;
                    }
                    break;

                default:
                    this.sendButton.IsEnabled = false;
                    break;
            }
        }

void PopulateMessageTypes ( ) [inline, private]

Add all available MIDI message types to a map (except for MidiMessageType.None) and populate the MIDI message combo box.

Definition at line 116 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Build the list of available MIDI messages for reverse lookup later
            this.messageTypes = new Dictionary<MidiMessageType, string>();
            this.messageTypes.Add(MidiMessageType.ActiveSensing, "Active Sensing");
            this.messageTypes.Add(MidiMessageType.ChannelPressure, "Channel Pressure");
            this.messageTypes.Add(MidiMessageType.Continue, "Continue");
            this.messageTypes.Add(MidiMessageType.ControlChange, "Control Change");
            this.messageTypes.Add(MidiMessageType.MidiTimeCode, "MIDI Time Code");
            this.messageTypes.Add(MidiMessageType.NoteOff, "Note Off");
            this.messageTypes.Add(MidiMessageType.NoteOn, "Note On");
            this.messageTypes.Add(MidiMessageType.PitchBendChange, "Pitch Bend Change");
            this.messageTypes.Add(MidiMessageType.PolyphonicKeyPressure, "Polyphonic Key Pressure");
            this.messageTypes.Add(MidiMessageType.ProgramChange, "Program Change");
            this.messageTypes.Add(MidiMessageType.SongPositionPointer, "Song Position Pointer");
            this.messageTypes.Add(MidiMessageType.SongSelect, "Song Select");
            this.messageTypes.Add(MidiMessageType.Start, "Start");
            this.messageTypes.Add(MidiMessageType.Stop, "Stop");
            this.messageTypes.Add(MidiMessageType.SystemExclusive, "System Exclusive");
            this.messageTypes.Add(MidiMessageType.SystemReset, "System Reset");
            this.messageTypes.Add(MidiMessageType.TimingClock, "Timing Clock");
            this.messageTypes.Add(MidiMessageType.TuneRequest, "Tune Request");

            // Start with a clean slate
            this.messageType.Items.Clear();

            // Add the message types to the list
            foreach (var messageType in this.messageTypes)
            {
                this.messageType.Items.Add(messageType.Value);
            }
        }

void PopulateParameterList | ( | ComboBox | list,
 |  | int | numberOfOptions,
 |  | string | listName |
 | ) |  |  | [inline, private]

Helper function to populate a dropdown lists with options.

Parameters:
list | The parameter list to populate
numberOfOptions | Number of options in the list
listName | The header to display to the user

Definition at line 689 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Start with a clean slate
            list.Items.Clear();

            // Add the options to the list
            for (int i = 0; i < numberOfOptions; i++)
            {
                list.Items.Add(i);
            }

            // Show the list, so that the user can make the next choice
            list.Header = listName;
            list.IsEnabled = true;
            list.Visibility = Visibility.Visible;
        }

void resetButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Reset all input fields, including message type.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 205 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            ResetMessageTypeAndParameters(true);
        }

void ResetMessageTypeAndParameters ( bool resetMessageType ) [inline, private]

Reset all input fields.

Parameters:
resetMessageType If true, reset message type list as well

Definition at line 214 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // If the flag is set, reset the message type list as well
            if (resetMessageType)
            {
                this.messageType.SelectedIndex = -1;
                this.currentMessageType = MidiMessageType.None;
            }

            // Ensure the message type list and reset button are enabled
            this.messageType.IsEnabled = true;
            this.resetButton.IsEnabled = true;

            // Reset selections on parameters
            this.parameter1.SelectedIndex = -1;
            this.parameter2.SelectedIndex = -1;
            this.parameter3.SelectedIndex = -1;

            // New selection values will cause parameter boxes to be hidden and disabled
            UpdateParameterList1();
            UpdateParameterList2();
            UpdateParameterList3();

            // Disable send button & hide/clear the SysEx buffer text
            this.sendButton.IsEnabled = false;
            this.rawBufferHeader.Visibility = Visibility.Collapsed;
            this.sysExMessageContent.Text = "";
            this.sysExMessageContent.Visibility = Visibility.Collapsed;
        }

void sendButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Create a new MIDI message based on the message type and parameter(s) values, and send it to the chosen output device.

Parameters:
sender | Element that fired the event
e | Event arguments

Definition at line 250 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            IMidiMessage midiMessageToSend = null;

            switch (this.currentMessageType)
            {
                case MidiMessageType.NoteOff:
                    midiMessageToSend = new MidiNoteOffMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
                    break;
                case MidiMessageType.NoteOn:
                    midiMessageToSend = new MidiNoteOnMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
                    break;
                case MidiMessageType.PolyphonicKeyPressure:
                    midiMessageToSend = new MidiPolyphonicKeyPressureMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
                    break;
                case MidiMessageType.ControlChange:
                    midiMessageToSend = new MidiControlChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
                    break;
                case MidiMessageType.ProgramChange:
                    midiMessageToSend = new MidiProgramChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
                    break;
                case MidiMessageType.ChannelPressure:
                    midiMessageToSend = new MidiChannelPressureMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
                    break;
                case MidiMessageType.PitchBendChange:
                    midiMessageToSend = new MidiPitchBendChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToUInt16(this.parameter2.SelectedValue));
                    break;
                case MidiMessageType.SystemExclusive:
                    var dataWriter = new DataWriter();
                    var sysExMessage = this.sysExMessageContent.Text;
                    var sysExMessageLength = sysExMessage.Length;

                    // Do not send a blank SysEx message
                    if (sysExMessageLength == 0)
                    {
                        return;
                    }

                    // SysEx messages are two characters long with 1-character space in between them
                    // So we add 1 to the message length, so that it is perfectly divisible by 3
                    // The loop count tracks the number of individual message pieces
                    int loopCount = (sysExMessageLength + 1) / 3;

                    // Expecting a string of format "F0 NN NN NN NN.... F7", where NN is a byte in hex
                    for (int i = 0; i < loopCount; i++)
                    {
                        var messageString = sysExMessage.Substring(3 * i, 2);
                        var messageByte = Convert.ToByte(messageString, 16);
                        dataWriter.WriteByte(messageByte);
                    }
                    midiMessageToSend = new MidiSystemExclusiveMessage(dataWriter.DetachBuffer());
                    break;
                case MidiMessageType.MidiTimeCode:
                    midiMessageToSend = new MidiTimeCodeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
                    break;
                case MidiMessageType.SongPositionPointer:
                    midiMessageToSend = new MidiSongPositionPointerMessage(Convert.ToUInt16(this.parameter1.SelectedValue));
                    break;
                case MidiMessageType.SongSelect:
                    midiMessageToSend = new MidiSongSelectMessage(Convert.ToByte(this.parameter1.SelectedValue));
                    break;
                case MidiMessageType.TuneRequest:
                    midiMessageToSend = new MidiTuneRequestMessage();
                    break;
                case MidiMessageType.TimingClock:
                    midiMessageToSend = new MidiTimingClockMessage();
                    break;
                case MidiMessageType.Start:
                    midiMessageToSend = new MidiStartMessage();
                    break;
                case MidiMessageType.Continue:
                    midiMessageToSend = new MidiContinueMessage();
                    break;
                case MidiMessageType.Stop:
                    midiMessageToSend = new MidiStopMessage();
                    break;
                case MidiMessageType.ActiveSensing:
                    midiMessageToSend = new MidiActiveSensingMessage();
                    break;
                case MidiMessageType.SystemReset:
                    midiMessageToSend = new MidiSystemResetMessage();
                    break;
                case MidiMessageType.None:
                default:
                    return;
            }

            // Send the message
            this.currentMidiOutputDevice.SendMessage(midiMessageToSend);
            this.rootPage.NotifyUser("Message sent successfully", NotifyType.StatusMessage);
        }

void UpdateParameterList1 ( ) [inline, private]

For MIDI message types that need the first parameter, populate the list based on the message type.

For message types that don't need the first parameter, empty and hide it

Definition at line 415 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // The first parameter is different for different message types
            switch (this.currentMessageType)
            {
                // For message types that require a first parameter...
                case MidiMessageType.NoteOff:
                case MidiMessageType.NoteOn:
                case MidiMessageType.PolyphonicKeyPressure:
                case MidiMessageType.ControlChange:
                case MidiMessageType.ProgramChange:
                case MidiMessageType.ChannelPressure:
                case MidiMessageType.PitchBendChange:
                    // This list is for Channels, of which there are 16
                    PopulateParameterList(this.parameter1, 16, "Channel");
                    break;

                case MidiMessageType.MidiTimeCode:
                    // This list is for further Message Types, of which there are 8
                    PopulateParameterList(this.parameter1, 8, "Message Type");
                    break;

                case MidiMessageType.SongPositionPointer:
                    // This list is for Beats, of which there are 16384
                    PopulateParameterList(this.parameter1, 16384, "Beats");
                    break;

                case MidiMessageType.SongSelect:
                    // This list is for Songs, of which there are 128
                    PopulateParameterList(this.parameter1, 128, "Song");
                    break;

                case MidiMessageType.SystemExclusive:
                    // Start with a clean slate
                    this.parameter1.Items.Clear();

                    // Hide the first parameter
                    this.parameter1.Header = "";
                    this.parameter1.IsEnabled = false;
                    this.parameter1.Visibility = Visibility.Collapsed;
                    this.rootPage.NotifyUser("Please edit the message in the textbox by clicking on 'F0 F7'", NotifyType.StatusMessage);
                    break;

                default:
                    // Start with a clean slate
                    this.parameter1.Items.Clear();

                    // Hide the first parameter
                    this.parameter1.Header = "";
                    this.parameter1.IsEnabled = false;
                    this.parameter1.Visibility = Visibility.Collapsed;
                    this.rootPage.NotifyUser("", NotifyType.StatusMessage);
                    break;
            }
        }

void UpdateParameterList2 ( ) [inline, private]

For MIDI message types that need the second parameter, populate the list based on the message type.

For message types that don't need the second parameter, empty and hide it

Definition at line 509 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Do not proceed if Parameter 1 is not chosen
            if (this.parameter1.SelectedIndex == -1)
            {
                this.parameter2.Items.Clear();
                this.parameter2.Header = "";
                this.parameter2.IsEnabled = false;
                this.parameter2.Visibility = Visibility.Collapsed;

                return;
            }

            switch (this.currentMessageType)
            {
                case MidiMessageType.NoteOff:
                case MidiMessageType.NoteOn:
                case MidiMessageType.PolyphonicKeyPressure:
                    // This list is for Notes, of which there are 128
                    PopulateParameterList(this.parameter2, 128, "Note");
                    break;

                case MidiMessageType.ControlChange:
                    // This list is for Controllers, of which there are 128
                    PopulateParameterList(this.parameter2, 128, "Controller");
                    break;

                case MidiMessageType.ProgramChange:
                    // This list is for Program Numbers, of which there are 128
                    PopulateParameterList(this.parameter2, 128, "Program Number");
                    break;

                case MidiMessageType.ChannelPressure:
                    // This list is for Pressure Values, of which there are 128
                    PopulateParameterList(this.parameter2, 128, "Pressure Value");
                    break;

                case MidiMessageType.PitchBendChange:
                    // This list is for Pitch Bend Values, of which there are 16384
                    PopulateParameterList(this.parameter2, 16384, "Pitch Bend Value");
                    break;

                case MidiMessageType.MidiTimeCode:
                    // This list is for Values, of which there are 16
                    PopulateParameterList(this.parameter2, 16, "Value");
                    break;

                default:
                    // Start with a clean slate
                    this.parameter2.Items.Clear();

                    // Hide the first parameter
                    this.parameter2.Header = "";
                    this.parameter2.IsEnabled = false;
                    this.parameter2.Visibility = Visibility.Collapsed;
                    break;
            }
        }

void UpdateParameterList3 ( ) [inline, private]

For MIDI message types that need the third parameter, populate the list based on the message type.

For message types that don't need the third parameter, empty and hide it

Definition at line 608 of file Scenario3_SendMIDIMessages.xaml.cs.

        {
            // Do not proceed if Parameter 2 is not chosen
            if (this.parameter2.SelectedIndex == -1)
            {
                this.parameter3.Items.Clear();
                this.parameter3.Header = "";
                this.parameter3.IsEnabled = false;
                this.parameter3.Visibility = Visibility.Collapsed;

                return;
            }

            switch (this.currentMessageType)
            {
                case MidiMessageType.NoteOff:
                case MidiMessageType.NoteOn:
                    // This list is for Velocity Values, of which there are 128
                    PopulateParameterList(this.parameter3, 128, "Velocity");
                    break;

                case MidiMessageType.PolyphonicKeyPressure:
                    // This list is for Pressure Values, of which there are 128
                    PopulateParameterList(this.parameter3, 128, "Pressure");
                    break;

                case MidiMessageType.ControlChange:
                    // This list is for Values, of which there are 128
                    PopulateParameterList(this.parameter3, 128, "Value");
                    break;

                default:
                    // Start with a clean slate
                    this.parameter3.Items.Clear();

                    // Hide the first parameter
                    this.parameter3.Header = "";
                    this.parameter3.IsEnabled = false;
                    this.parameter3.Visibility = Visibility.Collapsed;
                    break;
            }
        }

Member Data Documentation

MidiMessageType currentMessageType = MidiMessageType.None [private]

Keep track of the type of message the user intends to send.

Definition at line 57 of file Scenario3_SendMIDIMessages.xaml.cs.

IMidiOutPort currentMidiOutputDevice [private]

Keep track of the current output device (which could also be the GS synth).

Definition at line 62 of file Scenario3_SendMIDIMessages.xaml.cs.

Dictionary<MidiMessageType, string> messageTypes [private]

Ordered list to keep track of available MIDI message types.

Definition at line 52 of file Scenario3_SendMIDIMessages.xaml.cs.

MidiDeviceWatcher midiOutDeviceWatcher [private]

Device watcher for MIDI out ports.

Definition at line 47 of file Scenario3_SendMIDIMessages.xaml.cs.

List<IMidiOutPort> midiOutPorts [private]

Collection of active MidiOutPorts.

Definition at line 42 of file Scenario3_SendMIDIMessages.xaml.cs.

MainPage rootPage [private]

Main Page.

Definition at line 37 of file Scenario3_SendMIDIMessages.xaml.cs.

The documentation for this class was generated from the following file:
  • MIDI/cs/Scenario3_SendMIDIMessages.xaml.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccessHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • AccessHandler
Public Member Functions | Properties

AccessHandler Class Reference

Access handler class for Mifare Standard/Classic based ICC commands. More...

List of all members.

Public Member Functions

AccessHandler (SmartCardConnection ScConnection)
async Task< byte[]> | GetUidAsync ()
async Task | LoadKeyAsync (byte[] mifareKey, byte keySlotNumber=0)
async Task< byte[]> | ReadAsync (ushort blockNumber, GeneralAuthenticate.GeneralAuthenticateKeyType keyType, byte keySlotNumber=0)
async Task< byte[]> | TransparentExchangeAsync (byte[] commandData)
async void | WriteAsync (byte blockNumber, byte[] data, GeneralAuthenticate.GeneralAuthenticateKeyType keyType, byte keySlotNumber=0)

Properties

SmartCardConnection | connectionObject [get, set]

Detailed Description

Definition at line 30 of file MifareStandardAccessHandler.cs.

Constructor & Destructor Documentation

AccessHandler ( SmartCardConnection ScConnection ) [inline]

Class constructor.

Parameters:
ScConnection connection object to a Mifare Standard ICC

Definition at line 42 of file MifareStandardAccessHandler.cs.

        {
            connectionObject = ScConnection;
        }

Member Function Documentation

async Task<byte[]> GetUidAsync ( ) [inline]

Wrapper method get the Mifare Standard ICC UID.

Returns:
byte array UID

Definition at line 150 of file MifareStandardAccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new MifareStandard.GetUid());
            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure getting UID of MIFARE Standard card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task LoadKeyAsync | ( | byte[] | mifareKey,
 |  | byte | keySlotNumber = 0 |
 | ) |  |  | [inline]

Wrapper method to read 16 bytes.

Parameters:
pageAddress start page to read
Returns:
byte array of 16 bytes

Definition at line 55 of file MifareStandardAccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new MifareStandard.LoadKey(mifareKey, keySlotNumber));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure loading key for MIFARE Standard card, " + apduRes.ToString());
            }

            return;
        }

async Task<byte[]> ReadAsync | ( | ushort | blockNumber,
 |  | GeneralAuthenticate.GeneralAuthenticateKeyType | keyType,
 |  | byte | keySlotNumber = 0 |
 | ) |  |  | [inline]

Reads 16 bytes.

Parameters:
blockNumber | Block number to read
keyType | Choose MIFARE key A or B
keySlotNumber | Slot where key has previously been stored with a previous call to Load Keys
Returns:
byte array of 16 bytes

Definition at line 81 of file MifareStandardAccessHandler.cs.

        {
            var genAuthRes = await connectionObject.TransceiveAsync(new MifareStandard.GeneralAuthenticate(blockNumber, keySlotNumber, keyType));
            if (!genAuthRes.Succeeded)
            {
                throw new Exception("Failure authenticating to MIFARE Standard card, " + genAuthRes.ToString());
            }

            var readRes = await connectionObject.TransceiveAsync(new MifareStandard.Read(blockNumber));
            if (!readRes.Succeeded)
            {
                throw new Exception("Failure reading MIFARE Standard card, " + readRes.ToString());
            }

            return readRes.ResponseData;
        }

async Task<byte[]> TransparentExchangeAsync ( byte[] commandData ) [inline]

Wrapper method to perform transparent transceive data to the Mifare Standard card.

Parameters:
commandData The command to send to the Mifare Standard card
Returns:
byte array of the read data

Definition at line 138 of file MifareStandardAccessHandler.cs.

        {
            byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);

            return responseData;
        }

async void WriteAsync | ( | byte | blockNumber,
 |  | byte[] | data,
 |  | GeneralAuthenticate.GeneralAuthenticateKeyType | keyType,
 |  | byte | keySlotNumber = 0 |
 | ) |  |  | [inline]

Wrapper method write 16 bytes at the pageAddress Block number

Parameters:
keyType | Choose MIFARE key A or B
keySlotNumber | Slot where key has previously been stored with a previous call to Load Keys

byte array of the data to write

Definition at line 110 of file MifareStandardAccessHandler.cs.

        {
            if (data.Length != 16)
            {
                throw new NotSupportedException();
            }

            var genAuthRes = await connectionObject.TransceiveAsync(new MifareStandard.GeneralAuthenticate(blockNumber, keySlotNumber, keyType));
            if (!genAuthRes.Succeeded)
            {
                throw new Exception("Failure authenticating to MIFARE Standard card, " + genAuthRes.ToString());
            }

            var apduRes = await connectionObject.TransceiveAsync(new MifareStandard.Write(blockNumber, ref data));
            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure writing MIFARE Standard card, " + apduRes.ToString());
            }
        }

Property Documentation

SmartCardConnection connectionObject [get, set, private]

connection object to smart card

Definition at line 35 of file MifareStandardAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • ApduResponse
Public Member Functions

ApduResponse Class Reference

Mifare response APDU. More...

Inherits Pcsc::ApduResponse.

List of all members.

Public Member Functions

ApduResponse ()

Detailed Description

Definition at line 94 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Reimplemented from ApduResponse.

Definition at line 96 of file MifareStandardCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DefaultKeys Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • DefaultKeys
Static Public Attributes

DefaultKeys Class Reference

List of all members.

Static Public Attributes

static readonly byte[] FactoryDefault = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }

Detailed Description

Definition at line 22 of file MifareStandardAccessHandler.cs.

Member Data Documentation

readonly byte [] FactoryDefault = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } [static]

Definition at line 24 of file MifareStandardAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeneralAuthenticate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • GeneralAuthenticate
Public Member Functions

GeneralAuthenticate Class Reference

Mifare Standard GetHistoricalBytes command. More...

Inherits Pcsc::GeneralAuthenticate.

List of all members.

Public Member Functions

GeneralAuthenticate (ushort address, byte keySlotNumber, GeneralAuthenticateKeyType keyType)

Detailed Description

Definition at line 80 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

GeneralAuthenticate | ( | ushort | address,
 |  | byte | keySlotNumber,
 |  | GeneralAuthenticateKeyType | keyType |
 | ) |  |  | [inline]

Definition at line 82 of file MifareStandardCommands.cs.

            : base(GeneralAuthenticateVersionNumber.VersionOne, address, keyType, keySlotNumber)
        {
            if (keyType != GeneralAuthenticateKeyType.MifareKeyA && keyType != GeneralAuthenticateKeyType.PicoTagPassKeyB)
            {
                throw new Exception("Invalid key type for MIFARE Standard General Authenticate");
            }
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetHistoricalBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • GetHistoricalBytes
Public Member Functions

GetHistoricalBytes Class Reference

Mifare Standard GetHistoricalBytes command. More...

Inherits Pcsc::GetHistoricalBytes.

List of all members.

Public Member Functions

GetHistoricalBytes ()

Detailed Description

Definition at line 59 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

GetHistoricalBytes ( ) [inline]

Reimplemented from GetHistoricalBytes.

Definition at line 61 of file MifareStandardCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetUid Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • GetUid
Public Member Functions

GetUid Class Reference

Mifare Standard GetUid command. More...

Inherits Pcsc::GetUid.

List of all members.

Public Member Functions

GetUid ()

Detailed Description

Definition at line 49 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

GetUid ( ) [inline]

Reimplemented from GetUid.

Definition at line 51 of file MifareStandardCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoadKey Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • LoadKey
Public Member Functions

LoadKey Class Reference

Mifare Standard Load Keys commad which stores the supplied key into the specified numbered key slot for subsequent use by the General Authenticate command.

Inherits Pcsc::LoadKeys.

List of all members.

Public Member Functions

LoadKey (byte[] mifareKey, byte keySlotNumber)

Detailed Description

Definition at line 70 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

LoadKey | ( | byte[] | mifareKey,
 |  | byte | keySlotNumber |
 | ) |  |  | [inline]

Definition at line 72 of file MifareStandardCommands.cs.

            : base(LoadKeysKeyType.CardKey, null, LoadKeysTransmissionType.Plain, LoadKeysStorageType.Volatile, keySlotNumber, mifareKey)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Read Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • Read
Public Member Functions

Read Class Reference

Mifare Standard Read commad when sent to the card the card is expected to return 16 bytes. More...

Inherits Pcsc::ReadBinary.

List of all members.

Public Member Functions

Read (ushort address)

Detailed Description

Definition at line 19 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

Read ( ushort address ) [inline]

Definition at line 21 of file MifareStandardCommands.cs.

            : base(address, 16)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Write Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareStandard
  • Write
Public Member Functions | Properties | Static Private Member Functions

Write Class Reference

Mifare Standard Write commad when sent to the card, writes 16 bytes at a time. More...

Inherits Pcsc::UpdateBinary.

List of all members.

Public Member Functions

Write (byte address, ref byte[] data)

Properties

byte[] | Data [get, set]

Static Private Member Functions

static byte[] | ResizeArray (byte[] data, int size)

Detailed Description

Definition at line 29 of file MifareStandardCommands.cs.

Constructor & Destructor Documentation

Write | ( | byte | address,
 |  | ref byte[] | data |
 | ) |  |  | [inline]

Definition at line 41 of file MifareStandardCommands.cs.

            : base(address, ((data.Length != 16) ? ResizeArray(data, 16) : data))
        {
        }

Member Function Documentation

static byte [] ResizeArray | ( | byte[] | data,
 |  | int | size |
 | ) |  |  | [inline, static, private]

Definition at line 36 of file MifareStandardCommands.cs.

        {
            Array.Resize<byte>(ref data, size);
            return data;
        }

Property Documentation

byte [] Data [get, set]

Definition at line 32 of file MifareStandardCommands.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareStandardCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccessHandler Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • AccessHandler
Public Member Functions | Properties

AccessHandler Class Reference

Access handler class for MifareUL based ICC. More...

List of all members.

Public Member Functions

AccessHandler (SmartCardConnection ScConnection)
async Task< byte[]> | GetUidAsync ()
async Task< byte[]> | ReadAsync (byte pageAddress)
async Task< byte[]> | TransparentExchangeAsync (byte[] commandData)
async void | WriteAsync (byte pageAddress, byte[] data)

Properties

SmartCardConnection | connectionObject [get, set]

Detailed Description

It provides wrappers for different MifareUL commands

Definition at line 26 of file MifareUltralightAccessHandler.cs.

Constructor & Destructor Documentation

AccessHandler ( SmartCardConnection ScConnection ) [inline]

Class constructor.

Parameters:
ScConnection connection object to a MifareUL ICC

Definition at line 38 of file MifareUltralightAccessHandler.cs.

        {
            connectionObject = ScConnection;
        }

Member Function Documentation

async Task<byte[]> GetUidAsync ( ) [inline]

Wrapper method get the MifareUL ICC UID.

Returns:
byte array UID

Definition at line 104 of file MifareUltralightAccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new MifareUltralight.GetUid());

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure getting UID of MIFARE Ultralight card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> ReadAsync ( byte pageAddress ) [inline]

Wrapper method to read 16 bytes (4 pages) starting at pageAddress.

Parameters:
pageAddress start page to read
Returns:
byte array of 16 bytes

Definition at line 51 of file MifareUltralightAccessHandler.cs.

        {
            var apduRes = await connectionObject.TransceiveAsync(new MifareUltralight.Read(pageAddress));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure reading MIFARE Ultralight card, " + apduRes.ToString());
            }

            return apduRes.ResponseData;
        }

async Task<byte[]> TransparentExchangeAsync ( byte[] commandData ) [inline]

Wrapper method to perform transparent transceive data to the MifareUL card.

Parameters:
commandData The command to send to the MifareUL card
Returns:
byte array of the read data

Definition at line 92 of file MifareUltralightAccessHandler.cs.

        {
            byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);

            return responseData;
        }

async void WriteAsync | ( | byte | pageAddress,
 |  | byte[] | data |
 | ) |  |  | [inline]

Wrapper method write 4 bytes at the pageAddress page address to write byte array of the data to write

Definition at line 69 of file MifareUltralightAccessHandler.cs.

        {
            if (data.Length != 4)
            {
                throw new NotSupportedException();
            }

            var apduRes = await connectionObject.TransceiveAsync(new MifareUltralight.Write(pageAddress, ref data));

            if (!apduRes.Succeeded)
            {
                throw new Exception("Failure writing MIFARE Ultralight card, " + apduRes.ToString());
            }
        }

Property Documentation

SmartCardConnection connectionObject [get, set, private]

connection object to smart card

Definition at line 31 of file MifareUltralightAccessHandler.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightAccessHandler.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • ApduResponse
Public Member Functions

ApduResponse Class Reference

Mifare response APDU. More...

Inherits Pcsc::ApduResponse.

List of all members.

Public Member Functions

ApduResponse ()

Detailed Description

Definition at line 71 of file MifareUltralightCommands.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Reimplemented from ApduResponse.

Definition at line 73 of file MifareUltralightCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetHistoricalBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • GetHistoricalBytes
Public Member Functions

GetHistoricalBytes Class Reference

Mifare UL GetHistoricalBytes command. More...

Inherits Pcsc::GetHistoricalBytes.

List of all members.

Public Member Functions

GetHistoricalBytes ()

Detailed Description

Definition at line 61 of file MifareUltralightCommands.cs.

Constructor & Destructor Documentation

GetHistoricalBytes ( ) [inline]

Reimplemented from GetHistoricalBytes.

Definition at line 63 of file MifareUltralightCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetUid Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • GetUid
Public Member Functions

GetUid Class Reference

Mifare UL GetUid command. More...

Inherits Pcsc::GetUid.

List of all members.

Public Member Functions

GetUid ()

Detailed Description

Definition at line 51 of file MifareUltralightCommands.cs.

Constructor & Destructor Documentation

GetUid ( ) [inline]

Reimplemented from GetUid.

Definition at line 53 of file MifareUltralightCommands.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Read Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • Read
Public Member Functions

Read Class Reference

Mifare UL Read commad when sent to the card the card is expected to return 16 byte of 4 Mifare pages starting at address addr.

Inherits Pcsc::ReadBinary.

List of all members.

Public Member Functions

Read (byte pageAddress)

Detailed Description

Definition at line 20 of file MifareUltralightCommands.cs.

Constructor & Destructor Documentation

Read ( byte pageAddress ) [inline]

Definition at line 22 of file MifareUltralightCommands.cs.

            : base(pageAddress, 16)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Write Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MifareUltralight
  • Write
Public Member Functions | Properties | Static Private Member Functions

Write Class Reference

Mifare UL Write commad when sent to the card, writes 4 bytes (1 Mifare block) at given block address addr.

Inherits Pcsc::UpdateBinary.

List of all members.

Public Member Functions

Write (byte address, ref byte[] data)

Properties

byte[] | Data [get, set]

Static Private Member Functions

static byte[] | ResizeArray (byte[] data, int size)

Detailed Description

Definition at line 31 of file MifareUltralightCommands.cs.

Constructor & Destructor Documentation

Write | ( | byte | address,
 |  | ref byte[] | data |
 | ) |  |  | [inline]

Definition at line 43 of file MifareUltralightCommands.cs.

            : base(address, ((data.Length != 4) ? ResizeArray(data, 4) : data))
        {
        }

Member Function Documentation

static byte [] ResizeArray | ( | byte[] | data,
 |  | int | size |
 | ) |  |  | [inline, static, private]

Definition at line 38 of file MifareUltralightCommands.cs.

        {
            Array.Resize<byte>(ref data, size);
            return data;
        }

Property Documentation

byte [] Data [get, set]

Definition at line 34 of file MifareUltralightCommands.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/MifareUltralightCommands.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccountWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • AccountWatcher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

AccountWatcher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

AccountWatcher ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisplayWatcherOutputFromCallback (string value)
void | DumpAccountDeviceInformation (StringBuilder message, MobileBroadbandDeviceInformation deviceInformation)
void | DumpAccountNetwork (StringBuilder message, MobileBroadbandNetwork network)
string | DumpPropertyData (string networkAccountId, bool hasDeviceInformationChanged, bool hasNetworkChanged)
string | NetErrorToString (uint netError)
void | PrepScenario2Sample ()
void | StartMonitoring_Click (object sender, RoutedEventArgs e)
void | StopMonitoring_Click (object sender, RoutedEventArgs e)

Private Attributes

MobileBroadbandAccountWatcher | networkAccountWatcher = new MobileBroadbandAccountWatcher()
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file AccountWatcher.xaml.cs.

Constructor & Destructor Documentation

AccountWatcher ( ) [inline]

Definition at line 33 of file AccountWatcher.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DisplayWatcherOutputFromCallback ( string value ) [inline, private]

Definition at line 173 of file AccountWatcher.xaml.cs.

        {
            await Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    WatcherOutput.Text += value + Environment.NewLine;
                });
        }

void DumpAccountDeviceInformation | ( | StringBuilder | message,
 |  | MobileBroadbandDeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

Definition at line 183 of file AccountWatcher.xaml.cs.

        {
            message.AppendLine("NetworkDeviceStatus: " + deviceInformation.NetworkDeviceStatus.ToString());
            message.AppendLine("MobileEquipmentId: " + deviceInformation.MobileEquipmentId);
            message.AppendLine("SubscriberId: " + deviceInformation.SubscriberId);
            message.AppendLine("SimIccId: " + deviceInformation.SimIccId);
            message.AppendLine("DeviceId: " + deviceInformation.DeviceId);
            message.AppendLine("RadioState: " + deviceInformation.CurrentRadioState);
        }

void DumpAccountNetwork | ( | StringBuilder | message,
 |  | MobileBroadbandNetwork | network |
 | ) |  |  | [inline, private]

Definition at line 193 of file AccountWatcher.xaml.cs.

        {
            string accessPointName = network.AccessPointName;
            if (String.IsNullOrEmpty(accessPointName))
            {
                accessPointName = "(not connected)";
            }

            message.AppendLine("NetworkRegistrationState: " + network.NetworkRegistrationState.ToString());
            message.AppendLine("RegistrationNetworkError: " + NetErrorToString(network.RegistrationNetworkError));
            message.AppendLine("PacketAttachNetworkError: " + NetErrorToString(network.PacketAttachNetworkError));
            message.AppendLine("ActivationNetworkError: " + NetErrorToString(network.ActivationNetworkError));
            message.AppendLine("AccessPointName: " + accessPointName);
        }

string DumpPropertyData | ( | string | networkAccountId,
 |  | bool | hasDeviceInformationChanged,
 |  | bool | hasNetworkChanged |
 | ) |  |  | [inline, private]

Definition at line 208 of file AccountWatcher.xaml.cs.

        {
            StringBuilder message = new StringBuilder();

            var account = MobileBroadbandAccount.CreateFromNetworkAccountId(networkAccountId);

            if (hasDeviceInformationChanged)
            {
                DumpAccountDeviceInformation(message, account.CurrentDeviceInformation);
            }

            if (hasNetworkChanged)
            {
                DumpAccountNetwork(message, account.CurrentNetwork);
            }

            return message.ToString();
        }

string NetErrorToString ( uint netError ) [inline, private]

Definition at line 227 of file AccountWatcher.xaml.cs.

        {
            return netError == 0 ? "none" : netError.ToString();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 43 of file AccountWatcher.xaml.cs.

        {
            PrepScenario2Sample();
        }

void PrepScenario2Sample ( ) [inline, private]

Definition at line 96 of file AccountWatcher.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            networkAccountWatcher.AccountAdded +=
                (sender, args) =>
                {
                    string message = "[accountadded] ";

                    try
                    {
                        message += args.NetworkAccountId;

                        var account = MobileBroadbandAccount.CreateFromNetworkAccountId(args.NetworkAccountId);
                        //rootPage.mba = (MobileBroadbandAccount)account;
                        message += ", service provider name: " + account.ServiceProviderName;
                    }
                    catch (Exception ex)
                    {
                        message += ex.Message;
                    }

                    DisplayWatcherOutputFromCallback(message);
                };

            networkAccountWatcher.AccountUpdated +=
                (sender, args) =>
                {
                    string message = "[accountupdated] ";

                    try
                    {
                        message += args.NetworkAccountId + ", (network = " + args.HasNetworkChanged + "; deviceinformation = " + args.HasDeviceInformationChanged + ")" + Environment.NewLine;
                        message += DumpPropertyData(args.NetworkAccountId, args.HasDeviceInformationChanged, args.HasNetworkChanged);
                    }
                    catch (Exception ex)
                    {
                        message += ex.Message;
                    }

                    DisplayWatcherOutputFromCallback(message);
                };

            networkAccountWatcher.AccountRemoved +=
                (sender, args) =>
                {
                    string message = "[accountremoved] ";

                    try
                    {
                        message += args.NetworkAccountId;
                    }
                    catch (Exception ex)
                    {
                        message += ex.Message;
                    }

                    DisplayWatcherOutputFromCallback(message);
                };

            networkAccountWatcher.EnumerationCompleted +=
                (sender, args) =>
                {
                    string message = "[enumerationcompleted]";

                    DisplayWatcherOutputFromCallback(message);
                };

            networkAccountWatcher.Stopped +=
                (sender, args) =>
                {
                    string message = "[stopped] Watcher is stopped successfully";

                    DisplayWatcherOutputFromCallback(message);
                };
        }

void StartMonitoring_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Start' button.

Parameters:
sender
e

Definition at line 53 of file AccountWatcher.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                if ((networkAccountWatcher.Status == MobileBroadbandAccountWatcherStatus.Started) ||
                (networkAccountWatcher.Status == MobileBroadbandAccountWatcherStatus.EnumerationCompleted))
                {
                    rootPage.NotifyUser("Watcher is already started.", NotifyType.StatusMessage);
                }
                else
                {
                    networkAccountWatcher.Start();

                    rootPage.NotifyUser("Watcher is started successfully.", NotifyType.StatusMessage);
                }
            }
        }

void StopMonitoring_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Stop' button.

Parameters:
sender
e

Definition at line 77 of file AccountWatcher.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                if ((networkAccountWatcher.Status == MobileBroadbandAccountWatcherStatus.Started) ||
                (networkAccountWatcher.Status == MobileBroadbandAccountWatcherStatus.EnumerationCompleted))
                {
                    networkAccountWatcher.Stop();

                    rootPage.NotifyUser("Watcher is stopped successfully.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Watcher is already stopped.", NotifyType.StatusMessage);
                }
            }
        }

Member Data Documentation

MobileBroadbandAccountWatcher networkAccountWatcher = new MobileBroadbandAccountWatcher() [private]

Definition at line 31 of file AccountWatcher.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file AccountWatcher.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/AccountWatcher.xaml.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BroadbandDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • BroadbandDevice
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

BroadbandDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

BroadbandDevice ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | GetCurrentDeviceInfo (string accountId)
string | NetErrorToString (uint netError)
void | PrepScenario1Sample ()
void | UpdateData_Click (object sender, RoutedEventArgs e)

Private Attributes

IReadOnlyList< string > | deviceAccountId = null
int | deviceSelected = 0
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file BroadbandDevice.xaml.cs.

Constructor & Destructor Documentation

BroadbandDevice ( ) [inline]

Definition at line 35 of file BroadbandDevice.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void GetCurrentDeviceInfo ( string accountId ) [inline, private]

Definition at line 98 of file BroadbandDevice.xaml.cs.

        {
            try
            {
                // Test touching new TH objectq
                var modem = MobileBroadbandModem.GetDefault();
                var deviceId = modem.DeviceInformation.DeviceId;

                var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(accountId);

                ProviderName.Text = mobileBroadbandAccount.ServiceProviderName;
                ProviderGuid.Text = mobileBroadbandAccount.ServiceProviderGuid.ToString();
                NetworkAccountId.Text = mobileBroadbandAccount.NetworkAccountId;

                var currentNetwork = mobileBroadbandAccount.CurrentNetwork;

                if (currentNetwork != null)
                {
                    string accessPointName = currentNetwork.AccessPointName;
                    if (String.IsNullOrEmpty(accessPointName))
                    {
                        accessPointName = "(not connected)";
                    }

                    NetRegister.Text = currentNetwork.NetworkRegistrationState.ToString();
                    NetRegError.Text = NetErrorToString(currentNetwork.RegistrationNetworkError);
                    PacketAttachError.Text = NetErrorToString(currentNetwork.PacketAttachNetworkError);
                    ActivateError.Text = NetErrorToString(currentNetwork.ActivationNetworkError);
                    AccessPointName.Text = accessPointName;
                    NetworkAdapterId.Text = currentNetwork.NetworkAdapter.NetworkAdapterId.ToString();
                    NetworkType.Text = currentNetwork.NetworkAdapter.NetworkItem.GetNetworkTypes().ToString();
                    RegisteredProviderId.Text = currentNetwork.RegisteredProviderId;
                    RegisteredProviderName.Text = currentNetwork.RegisteredProviderName;
                    RegisteredDataClass.Text = currentNetwork.RegisteredDataClass.ToString();

                }
                else
                {
                    NetRegister.Text = "";
                    NetRegError.Text = "";
                    PacketAttachError.Text = "";
                    ActivateError.Text = "";
                    AccessPointName.Text = "";
                    NetworkAdapterId.Text = "";
                    NetworkType.Text = "";
                    RegisteredProviderId.Text = "";
                    RegisteredProviderName.Text = "";
                    RegisteredDataClass.Text = "";
                }

                var deviceInformation = mobileBroadbandAccount.CurrentDeviceInformation;

                if (deviceInformation != null)
                {
                    string mobileNumber = "";
                    if (deviceInformation.TelephoneNumbers.Count > 0)
                    {
                        mobileNumber = deviceInformation.TelephoneNumbers[0];
                    }

                    DeviceManufacturer.Text = deviceInformation.Manufacturer;
                    DeviceModel.Text = deviceInformation.Model;
                    Firmware.Text = deviceInformation.FirmwareInformation;
                    CellularClasses.Text = deviceInformation.CellularClass.ToString();
                    DataClasses.Text = deviceInformation.DataClasses.ToString();
                    if (deviceInformation.DataClasses.HasFlag(Windows.Networking.NetworkOperators.DataClasses.Custom))
                    {
                        DataClasses.Text += " (custom is " + deviceInformation.CustomDataClass + ")";
                    }
                    MobileNumber.Text = mobileNumber;
                    SimId.Text = deviceInformation.SimIccId;
                    DeviceType.Text = deviceInformation.DeviceType.ToString();
                    DeviceId.Text = deviceInformation.DeviceId.ToString();
                    NetworkDeviceStatus.Text = deviceInformation.NetworkDeviceStatus.ToString();

                    if (deviceInformation.CellularClass == CellularClass.Gsm)
                    {
                        MobEquipIdLabel.Text = "IMEI:";
                        MobEquipIdValue.Text = deviceInformation.MobileEquipmentId;

                        SubIdLabel.Text = "IMSI:";
                        SubIdValue.Text = deviceInformation.SubscriberId;
                    }
                    else if (deviceInformation.CellularClass == CellularClass.Cdma)
                    {
                        MobEquipIdLabel.Text = "ESN/MEID:";
                        MobEquipIdValue.Text = deviceInformation.MobileEquipmentId;

                        SubIdLabel.Text = "MIN/IRM:";
                        SubIdValue.Text = deviceInformation.SubscriberId;
                    }
                    else
                    {
                        MobEquipIdLabel.Text = "";
                        MobEquipIdValue.Text = "";
                        SubIdLabel.Text = "";
                        SubIdValue.Text = "";
                    }
                }
                else
                {
                    DeviceManufacturer.Text = "";
                    DeviceModel.Text = "";
                    Firmware.Text = "";
                    CellularClasses.Text = "";
                    DataClasses.Text = "";
                    MobileNumber.Text = "";
                    SimId.Text = "";
                    DeviceType.Text = "";
                    DeviceId.Text = "";
                    NetworkDeviceStatus.Text = "";
                    MobEquipIdLabel.Text = "";
                    MobEquipIdValue.Text = "";
                    SubIdLabel.Text = "";
                    SubIdValue.Text = "";
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);

                ProviderName.Text = "";
                ProviderGuid.Text = "";
                NetworkAccountId.Text = "";
                NetRegister.Text = "";
                NetRegError.Text = "";
                PacketAttachError.Text = "";
                ActivateError.Text = "";
                AccessPointName.Text = "";
                NetworkAdapterId.Text = "";
                NetworkType.Text = "";
                DeviceManufacturer.Text = "";
                DeviceModel.Text = "";
                Firmware.Text = "";
                CellularClasses.Text = "";
                DataClasses.Text = "";
                MobileNumber.Text = "";
                SimId.Text = "";
                DeviceType.Text = "";
                DeviceId.Text = "";
                NetworkDeviceStatus.Text = "";
                MobEquipIdLabel.Text = "";
                MobEquipIdValue.Text = "";
                SubIdLabel.Text = "";
                SubIdValue.Text = "";
                RegisteredProviderId.Text = "";
                RegisteredProviderName.Text = "";
                RegisteredDataClass.Text = "";
            }
        }

string NetErrorToString ( uint netError ) [inline, private]

Definition at line 249 of file BroadbandDevice.xaml.cs.

        {
            return netError == 0 ? "none" : netError.ToString();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file BroadbandDevice.xaml.cs.

        {
            PrepScenario1Sample();
        }

void PrepScenario1Sample ( ) [inline, private]

Definition at line 69 of file BroadbandDevice.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            try
            {
                deviceSelected = 0;
                deviceAccountId = MobileBroadbandAccount.AvailableNetworkAccountIds;

                if (deviceAccountId.Count != 0)
                {
                    rootPage.NotifyUser("Mobile Broadband Device(s) have been installed that grant access to this application", NotifyType.StatusMessage);

                    NumDevices.Text = "There are " + deviceAccountId.Count + " account(s) installed.";
                    UpdateData.Content = "Get Information for Device #1";
                    UpdateData.IsEnabled = true;
                }
                else
                {
                    UpdateData.Content = "No available accounts detected";
                    UpdateData.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
               rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
            }
        }

void UpdateData_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Get Device Information' button.

Parameters:
sender
e

Definition at line 55 of file BroadbandDevice.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                GetCurrentDeviceInfo(deviceAccountId[deviceSelected]);
                 // increment device count until reach number max number of devices and then start over
                deviceSelected = (deviceSelected + 1) % deviceAccountId.Count;

                // update Button with next device
                UpdateData.Content = "Get Information for Device #" + (deviceSelected + 1);
            }
        }

Member Data Documentation

IReadOnlyList<string> deviceAccountId = null [private]

Definition at line 32 of file BroadbandDevice.xaml.cs.

int deviceSelected = 0 [private]

Definition at line 33 of file BroadbandDevice.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file BroadbandDevice.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/BroadbandDevice.xaml.cs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetConnectionProfiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • GetConnectionProfiles
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

GetConnectionProfiles Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

GetConnectionProfiles ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

string | CostBasedSuggestions (ConnectionCost connectionCost)
string | GetConnectionCostInfo (ConnectionCost connectionCost)
string | GetConnectionProfile (ConnectionProfile connectionProfile)
void | GetConnectionProfilesButton_Click (object sender, RoutedEventArgs e)
string | GetDataPlanStatusInfo (DataPlanStatus dataPlan)
string | GetNetworkSecuritySettingsInfo (NetworkSecuritySettings netSecuritySettings)
string | GetWlanConnectionProfileDetailsInfo (WlanConnectionProfileDetails wlanConnectionProfileDetails)
string | GetWwanConnectionProfileDetailsInfo (WwanConnectionProfileDetails wwanConnectionProfileDetails)
void | PrepareScenario ()
void | PrintConnectionProfiles (IReadOnlyList< ConnectionProfile > connectionProfiles)

Private Attributes

IReadOnlyList< string > | deviceAccountId = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file GetConnectionProfiles.xaml.cs.

Constructor & Destructor Documentation

GetConnectionProfiles ( ) [inline]

Definition at line 35 of file GetConnectionProfiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string CostBasedSuggestions ( ConnectionCost connectionCost ) [inline, private]

Definition at line 254 of file GetConnectionProfiles.xaml.cs.

        {
            string costBasedSuggestions = string.Empty;
            costBasedSuggestions += "Cost Based Suggestions: \n";
            costBasedSuggestions += "====================\n";

            if (connectionCost.Roaming)
            {
                costBasedSuggestions += "Connection is out of MNO's network, using the connection may result in additional charge. Application can implement High Cost behavior in this scenario\n";
            }
            else if (connectionCost.NetworkCostType == NetworkCostType.Variable)
            {
                costBasedSuggestions += "Connection cost is variable, and the connection is charged based on usage, so application can implement the Conservative behavior\n";
            }
            else if (connectionCost.NetworkCostType == NetworkCostType.Fixed)
            {
                if (connectionCost.OverDataLimit || connectionCost.ApproachingDataLimit)
                {
                    costBasedSuggestions += "Connection has exceeded the usage cap limit or is approaching the datalimit, and the application can implement High Cost behavior in this scenario\n";
                }
                else
                {
                    costBasedSuggestions += "Application can implemement the Conservative behavior\n";
                }
            }
            else
            {
                costBasedSuggestions += "Application can implement the Standard behavior\n";
            }
            return costBasedSuggestions;
        }

string GetConnectionCostInfo ( ConnectionCost connectionCost ) [inline, private]

Definition at line 211 of file GetConnectionProfiles.xaml.cs.

        {
            string cost = string.Empty;
            cost += "Connection Cost Information: \n";
            cost += "====================\n";

            if (connectionCost == null)
            {
                cost += "Connection Cost not available\n";
                return cost;
            }

            switch (connectionCost.NetworkCostType)
            {
                case NetworkCostType.Unrestricted:
                    cost += "Cost: Unrestricted";
                    break;
                case NetworkCostType.Fixed:
                    cost += "Cost: Fixed";
                    break;
                case NetworkCostType.Variable:
                    cost += "Cost: Variable";
                    break;
                case NetworkCostType.Unknown:
                    cost += "Cost: Unknown";
                    break;
                default:
                    cost += "Cost: Error";
                    break;
            }
            cost += "\n";
            cost += "Roaming: " + connectionCost.Roaming + "\n";
            cost += "Over Data Limit: " + connectionCost.OverDataLimit + "\n";
            cost += "Approaching Data Limit : " + connectionCost.ApproachingDataLimit + "\n";

            //Display cost based suggestions to the user
            cost += CostBasedSuggestions(connectionCost);
            return cost;
        }

string GetConnectionProfile ( ConnectionProfile connectionProfile ) [inline, private]

Definition at line 129 of file GetConnectionProfiles.xaml.cs.

        {
            string connectionProfileInfo = string.Empty;
            if (connectionProfile != null)
            {
                connectionProfileInfo = "Profile Name : " + connectionProfile.ProfileName + "\n";

                switch (connectionProfile.GetNetworkConnectivityLevel())
                {
                    case NetworkConnectivityLevel.None:
                        connectionProfileInfo += "Connectivity Level : None\n";
                        break;
                    case NetworkConnectivityLevel.LocalAccess:
                        connectionProfileInfo += "Connectivity Level : Local Access\n";
                        break;
                    case NetworkConnectivityLevel.ConstrainedInternetAccess:
                        connectionProfileInfo += "Connectivity Level : Constrained Internet Access\n";
                        break;
                    case NetworkConnectivityLevel.InternetAccess:
                        connectionProfileInfo += "Connectivity Level : Internet Access\n";
                        break;
                }

                switch (connectionProfile.GetDomainConnectivityLevel())
                {
                    case DomainConnectivityLevel.None:
                        connectionProfileInfo += "Domain Connectivity Level : None\n";
                        break;
                    case DomainConnectivityLevel.Unauthenticated:
                        connectionProfileInfo += "Domain Connectivity Level : Unauthenticated\n";
                        break;
                    case DomainConnectivityLevel.Authenticated:
                        connectionProfileInfo += "Domain Connectivity Level : Authenticated\n";
                        break;
                }

                //Get Connection Cost information
                ConnectionCost connectionCost = connectionProfile.GetConnectionCost();
                connectionProfileInfo += GetConnectionCostInfo(connectionCost);

                //Get Dataplan Status information
                DataPlanStatus dataPlanStatus = connectionProfile.GetDataPlanStatus();
                connectionProfileInfo += GetDataPlanStatusInfo(dataPlanStatus);

                //Get Network Security Settings
                NetworkSecuritySettings netSecuritySettings = connectionProfile.NetworkSecuritySettings;
                connectionProfileInfo += GetNetworkSecuritySettingsInfo(netSecuritySettings);

                //Get Wlan Connection Profile Details if this is a Wlan ConnectionProfile
                if (connectionProfile.IsWlanConnectionProfile)
                {
                    WlanConnectionProfileDetails wlanConnectionProfileDetails = connectionProfile.WlanConnectionProfileDetails;
                    connectionProfileInfo += GetWlanConnectionProfileDetailsInfo(wlanConnectionProfileDetails);
                }

                //Get Wwan Connection Profile Details if this is a Wwan ConnectionProfile
                if (connectionProfile.IsWwanConnectionProfile)
                {
                    WwanConnectionProfileDetails wwanConnectionProfileDetails = connectionProfile.WwanConnectionProfileDetails;
                    connectionProfileInfo += GetWwanConnectionProfileDetailsInfo(wwanConnectionProfileDetails);
                }

                //Get the Service Provider GUID
                if (connectionProfile.ServiceProviderGuid.HasValue)
                {
                    connectionProfileInfo += "====================\n";
                    connectionProfileInfo += "Service Provider GUID: " + connectionProfile.ServiceProviderGuid + "\n";
                }

                //Get the number of signal bars
                if (connectionProfile.GetSignalBars().HasValue)
                {
                    connectionProfileInfo += "====================\n";
                    connectionProfileInfo += "Signal Bars: " + connectionProfile.GetSignalBars() + "\n";
                }
            }
            return connectionProfileInfo;
        }

void GetConnectionProfilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Default' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 56 of file GetConnectionProfiles.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                try
                {
                    // For the sake of simplicity, we only get the ConnectionProfiles from the first NetworkAccountId
                    var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(deviceAccountId[0]);
                    PrintConnectionProfiles(mobileBroadbandAccount.GetConnectionProfiles());
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

string GetDataPlanStatusInfo ( DataPlanStatus dataPlan ) [inline, private]

Definition at line 289 of file GetConnectionProfiles.xaml.cs.

        {
            string dataplanStatusInfo = string.Empty;
            dataplanStatusInfo = "Dataplan Status Information:\n";
            dataplanStatusInfo += "====================\n";

            if (dataPlan == null)
            {
                dataplanStatusInfo += "Dataplan Status not available\n";
                return dataplanStatusInfo;
            }

            if (dataPlan.DataPlanUsage != null)
            {
                dataplanStatusInfo += "Usage In Megabytes : " + dataPlan.DataPlanUsage.MegabytesUsed + "\n";
                dataplanStatusInfo += "Last Sync Time : " + dataPlan.DataPlanUsage.LastSyncTime + "\n";
            }
            else
            {
                dataplanStatusInfo += "Usage In Megabytes : Not Defined\n";
            }

            ulong? inboundBandwidth = dataPlan.InboundBitsPerSecond;
            if (inboundBandwidth.HasValue)
            {
                dataplanStatusInfo += "InboundBitsPerSecond : " + inboundBandwidth + "\n";
            }
            else
            {
                dataplanStatusInfo += "InboundBitsPerSecond : Not Defined\n";
            }

            ulong? outboundBandwidth = dataPlan.OutboundBitsPerSecond;
            if (outboundBandwidth.HasValue)
            {
                dataplanStatusInfo += "OutboundBitsPerSecond : " + outboundBandwidth + "\n";
            }
            else
            {
                dataplanStatusInfo += "OutboundBitsPerSecond : Not Defined\n";
            }

            uint? dataLimit = dataPlan.DataLimitInMegabytes;
            if (dataLimit.HasValue)
            {
                dataplanStatusInfo += "DataLimitInMegabytes : " + dataLimit + "\n";
            }
            else
            {
                dataplanStatusInfo += "DataLimitInMegabytes : Not Defined\n";
            }

            System.DateTimeOffset? nextBillingCycle = dataPlan.NextBillingCycle;
            if (nextBillingCycle.HasValue)
            {
                dataplanStatusInfo += "NextBillingCycle : " + nextBillingCycle + "\n";
            }
            else
            {
                dataplanStatusInfo += "NextBillingCycle : Not Defined\n";
            }

            uint? maxTransferSize = dataPlan.MaxTransferSizeInMegabytes;
            if (maxTransferSize.HasValue)
            {
                dataplanStatusInfo += "MaxTransferSizeInMegabytes : " + maxTransferSize + "\n";
            }
            else
            {
                dataplanStatusInfo += "MaxTransferSizeInMegabytes : Not Defined\n";
            }
            return dataplanStatusInfo;
        }

string GetNetworkSecuritySettingsInfo ( NetworkSecuritySettings netSecuritySettings ) [inline, private]

Definition at line 366 of file GetConnectionProfiles.xaml.cs.

        {
            string networkSecurity = string.Empty;
            networkSecurity += "Network Security Settings: \n";
            networkSecurity += "====================\n";

            if (netSecuritySettings == null)
            {
                networkSecurity += "Network Security Settings not available\n";
                return networkSecurity;
            }

            //NetworkAuthenticationType
            switch (netSecuritySettings.NetworkAuthenticationType)
            {
                case NetworkAuthenticationType.None:
                    networkSecurity += "NetworkAuthenticationType: None";
                    break;
                case NetworkAuthenticationType.Unknown:
                    networkSecurity += "NetworkAuthenticationType: Unknown";
                    break;
                case NetworkAuthenticationType.Open80211:
                    networkSecurity += "NetworkAuthenticationType: Open80211";
                    break;
                case NetworkAuthenticationType.SharedKey80211:
                    networkSecurity += "NetworkAuthenticationType: SharedKey80211";
                    break;
                case NetworkAuthenticationType.Wpa:
                    networkSecurity += "NetworkAuthenticationType: Wpa";
                    break;
                case NetworkAuthenticationType.WpaPsk:
                    networkSecurity += "NetworkAuthenticationType: WpaPsk";
                    break;
                case NetworkAuthenticationType.WpaNone:
                    networkSecurity += "NetworkAuthenticationType: WpaNone";
                    break;
                case NetworkAuthenticationType.Rsna:
                    networkSecurity += "NetworkAuthenticationType: Rsna";
                    break;
                case NetworkAuthenticationType.RsnaPsk:
                    networkSecurity += "NetworkAuthenticationType: RsnaPsk";
                    break;
                default:
                    networkSecurity += "NetworkAuthenticationType: Error";
                    break;
            }
            networkSecurity += "\n";

            //NetworkEncryptionType
            switch (netSecuritySettings.NetworkEncryptionType)
            {
                case NetworkEncryptionType.None:
                    networkSecurity += "NetworkEncryptionType: None";
                    break;
                case NetworkEncryptionType.Unknown:
                    networkSecurity += "NetworkEncryptionType: Unknown";
                    break;
                case NetworkEncryptionType.Wep:
                    networkSecurity += "NetworkEncryptionType: Wep";
                    break;
                case NetworkEncryptionType.Wep40:
                    networkSecurity += "NetworkEncryptionType: Wep40";
                    break;
                case NetworkEncryptionType.Wep104:
                    networkSecurity += "NetworkEncryptionType: Wep104";
                    break;
                case NetworkEncryptionType.Tkip:
                    networkSecurity += "NetworkEncryptionType: Tkip";
                    break;
                case NetworkEncryptionType.Ccmp:
                    networkSecurity += "NetworkEncryptionType: Ccmp";
                    break;
                case NetworkEncryptionType.WpaUseGroup:
                    networkSecurity += "NetworkEncryptionType: WpaUseGroup";
                    break;
                case NetworkEncryptionType.RsnUseGroup:
                    networkSecurity += "NetworkEncryptionType: RsnUseGroup";
                    break;
                default:
                    networkSecurity += "NetworkEncryptionType: Error";
                    break;
            }
            networkSecurity += "\n";
            return networkSecurity;
        }

string GetWlanConnectionProfileDetailsInfo ( WlanConnectionProfileDetails wlanConnectionProfileDetails ) [inline, private]

Definition at line 452 of file GetConnectionProfiles.xaml.cs.

        {
            string wlanDetails = string.Empty;
            wlanDetails += "Wireless LAN Connection Profile Details:\n";
            wlanDetails += "====================\n";

            if (wlanConnectionProfileDetails == null)
            {
                wlanDetails += "Wireless LAN connection profile details unavailable.\n";
                return wlanDetails;
            }

            wlanDetails += "Connected SSID: " + wlanConnectionProfileDetails.GetConnectedSsid() + "\n";
            return wlanDetails;
        }

string GetWwanConnectionProfileDetailsInfo ( WwanConnectionProfileDetails wwanConnectionProfileDetails ) [inline, private]

Definition at line 468 of file GetConnectionProfiles.xaml.cs.

        {
            string wwanDetails = string.Empty;
            wwanDetails += "Wireless WAN Connection Profile Details:\n";
            wwanDetails += "====================\n";

            if (wwanConnectionProfileDetails == null)
            {
                wwanDetails += "Wireless WAN connection profile details unavailable.\n";
                return wwanDetails;
            }

            wwanDetails += "Home Provider ID: " + wwanConnectionProfileDetails.HomeProviderId + "\n";
            wwanDetails += "Access Point Name: " + wwanConnectionProfileDetails.AccessPointName + "\n";
            wwanDetails += "Network Registration State: " + wwanConnectionProfileDetails.GetNetworkRegistrationState() + "\n";
            wwanDetails += "Current Data Class: " + wwanConnectionProfileDetails.GetCurrentDataClass() + "\n";

            return wwanDetails;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file GetConnectionProfiles.xaml.cs.

        {
            PrepareScenario();
        }

void PrepareScenario ( ) [inline, private]

Definition at line 75 of file GetConnectionProfiles.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            try
            {
                deviceAccountId = MobileBroadbandAccount.AvailableNetworkAccountIds;

                if (deviceAccountId.Count != 0)
                {
                    GetConnectionProfilesButton.Content = "Get Connection Profiles";
                    GetConnectionProfilesButton.IsEnabled = true;
                }
                else
                {
                    GetConnectionProfilesButton.Content = "No available accounts detected";
                    GetConnectionProfilesButton.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
            }
        }

void PrintConnectionProfiles ( IReadOnlyList< ConnectionProfile > connectionProfiles ) [inline, private]

Definition at line 100 of file GetConnectionProfiles.xaml.cs.

        {
            string connectionProfileList = string.Empty;
            try
            {
                foreach (var connectionProfile in connectionProfiles)
                {
                    //Display Profile information for each of the connection profiles
                    connectionProfileList += GetConnectionProfile(connectionProfile);
                    connectionProfileList += "--------------------------------------------------------------------\n";
                }

                if (connectionProfiles.Count == 0)
                {
                    connectionProfileList += "No Connection Profiles found.\n";
                }

                rootPage.NotifyUser(connectionProfileList, NotifyType.StatusMessage);
            }

            catch (Exception ex)
            {
                rootPage.NotifyUser("Unexpected exception occurred: " + ex.ToString(), NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

IReadOnlyList<string> deviceAccountId = null [private]

Definition at line 33 of file GetConnectionProfiles.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file GetConnectionProfiles.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/GetConnectionProfiles.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModemDeviceServices Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • ModemDeviceServices
Public Member Functions | Private Member Functions | Private Attributes

ModemDeviceServices Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ModemDeviceServices ()

Private Member Functions

void | btnDeviceService_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 39 of file ModemDeviceServices.xaml.cs.

Constructor & Destructor Documentation

ModemDeviceServices ( ) [inline]

Definition at line 42 of file ModemDeviceServices.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void btnDeviceService_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file ModemDeviceServices.xaml.cs.

        {
            var modem = MobileBroadbandModem.GetDefault();
            var deviceService = modem.DeviceServices;
            if (deviceService != null)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var d in deviceService)
                {
                    sb.AppendLine(String.Format("DeviceService ID:{0}, Read Allowed:{1}, Write Allowed:{2}", d.DeviceServiceId.ToString(), d.IsDataReadSupported.ToString(), d.IsDataWriteSupported.ToString()));
                }
                txtModemInformation.Text = sb.ToString();
            }
            else
            {
                rootPage.NotifyUser("No Device Services found.", NotifyType.ErrorMessage);

            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 41 of file ModemDeviceServices.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/ModemDeviceServices.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModemInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • ModemInformation
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ModemInformation Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ModemInformation ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | btnRefresh_Click (object sender, RoutedEventArgs e)
string | CheckForNullOrEmptyField (object input)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 39 of file ModemInformation.xaml.cs.

Constructor & Destructor Documentation

ModemInformation ( ) [inline]

Definition at line 42 of file ModemInformation.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void btnRefresh_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file ModemInformation.xaml.cs.

        {
            try
            {
                var modem = MobileBroadbandModem.GetDefault();
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("Cellular Class: " + modem.DeviceInformation.CellularClass.ToString());
                sb.AppendLine("Current Radio Powerstate: " + modem.DeviceInformation.CurrentRadioState.ToString());
                sb.AppendLine("Custom Data Class: " + modem.DeviceInformation.CustomDataClass.ToString());
                sb.AppendLine("Supported Data Classes: " + modem.DeviceInformation.DataClasses.ToString());
                sb.AppendLine("Device ID: " + modem.DeviceInformation.DeviceId.ToString());
                sb.AppendLine("Device Type: " + modem.DeviceInformation.DeviceType.ToString());
                sb.AppendLine("Firmware Information: " + modem.DeviceInformation.FirmwareInformation);
                sb.AppendLine("Manufacturer: " + modem.DeviceInformation.Manufacturer);
                sb.AppendLine("IMEI (Mobile Equipment ID): " + modem.DeviceInformation.MobileEquipmentId);
                sb.AppendLine("Device Model: " + modem.DeviceInformation.Model);
                sb.AppendLine("Device Status: " + modem.DeviceInformation.NetworkDeviceStatus.ToString());

                sb.AppendLine("Suppported PINs: ");
                var pinTypeList = modem.DeviceInformation.PinManager.SupportedPins;
                foreach (var pinType in pinTypeList)
                {
                    sb.AppendLine(pinType.ToString());
                }

                sb.AppendLine("Revision: " + modem.DeviceInformation.Revision);
                sb.AppendLine("Serial Number: " + modem.DeviceInformation.SerialNumber);
                sb.AppendLine("SIM ICCID: " + modem.DeviceInformation.SimIccId);
                sb.AppendLine("Subscriber ID: " + modem.DeviceInformation.SubscriberId);

                var phoneNumbers = modem.DeviceInformation.TelephoneNumbers;
                foreach (var phoneNumber in phoneNumbers)
                {
                    sb.AppendLine("Telephone Numbers: " + phoneNumber);
                }

                txtModemInformation.Text = sb.ToString();
                rootPage.NotifyUser("Success: Modem information loaded", NotifyType.StatusMessage);

            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
            }
        }

string CheckForNullOrEmptyField ( object input ) [inline, private]

Definition at line 97 of file ModemInformation.xaml.cs.

        {
            string result = "empty";
            switch ((input.GetType().ToString().ToLower()))
            {
                case "string":
                    string val = (string)input;
                    if ((string.IsNullOrEmpty(val))||(string.IsNullOrWhiteSpace(val)))
                    {
                        result =val;
                    }
                    break;
                case "{system._comobject}":
                    break;
                default:
                    break;
            }

            return result;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file ModemInformation.xaml.cs.

        {
            btnRefresh_Click(null, null);
            base.OnNavigatedTo(e);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 41 of file ModemInformation.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/ModemInformation.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShowConnection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • ShowConnection
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShowConnection Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ShowConnection ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | PrepareScenario ()
void | ShowConnectionUI_Click (object sender, RoutedEventArgs e)

Private Attributes

IReadOnlyList< string > | deviceAccountId = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file ShowConnection.xaml.cs.

Constructor & Destructor Documentation

ShowConnection ( ) [inline]

Definition at line 33 of file ShowConnection.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 43 of file ShowConnection.xaml.cs.

        {
            PrepareScenario();
        }

void PrepareScenario ( ) [inline, private]

Definition at line 73 of file ShowConnection.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            try
            {
                deviceAccountId = MobileBroadbandAccount.AvailableNetworkAccountIds;

                if (deviceAccountId.Count != 0)
                {
                    ShowConnectionUI.Content = "Show Connection UI";
                    ShowConnectionUI.IsEnabled = true;
                }
                else
                {
                    ShowConnectionUI.Content = "No available accounts detected";
                    ShowConnectionUI.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
            }
        }

void ShowConnectionUI_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Default' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 55 of file ShowConnection.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                try
                {
                    var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(deviceAccountId[0]);
                    mobileBroadbandAccount.CurrentNetwork.ShowConnectionUI();
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

IReadOnlyList<string> deviceAccountId = null [private]

Definition at line 31 of file ShowConnection.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file ShowConnection.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/ShowConnection.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimCard Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MobileBroadband
  • SimCard
Public Member Functions | Private Member Functions | Private Attributes

SimCard Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

SimCard ()

Private Member Functions

async void | btnGetRecord_Click (object sender, RoutedEventArgs e)
async void | btnGetUICC_Click (object sender, RoutedEventArgs e)
void | listUiccApps_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

MobileBroadbandUiccApp | currentUiccApp = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 38 of file SimCard.xaml.cs.

Constructor & Destructor Documentation

SimCard ( ) [inline]

Definition at line 43 of file SimCard.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void btnGetRecord_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 115 of file SimCard.xaml.cs.

        {
            List<uint> iccidFilePath = new List<uint>{ 0x3F00, 0x2FE2}; // The wellknown file path for IccId
            MobileBroadbandUiccAppRecordDetailsResult recordDetails = await currentUiccApp.GetRecordDetailsAsync(iccidFilePath);
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Record Details");
            sb.AppendLine("Record Type:" + recordDetails.Kind.ToString());
            sb.AppendLine("Record Size:" + recordDetails.RecordSize.ToString());
            sb.AppendLine("Read result:");

            MobileBroadbandUiccAppReadRecordResult readRecord = await currentUiccApp.ReadRecordAsync(iccidFilePath, 1);
            sb.AppendLine(readRecord.Status.ToString());

            if (readRecord.Status == MobileBroadbandUiccAppOperationStatus.Success)
            {
                sb.AppendLine("IccId record content:");
                byte[] iccidByteArray = readRecord.Data.ToArray();
                foreach (var v in iccidByteArray)
                {
                    sb.Append(v.ToString("X") + ", ");
                }
            }

            labelRecordInformation.Text = sb.ToString();
        }

async void btnGetUICC_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file SimCard.xaml.cs.

        {
            try
            {
                var modem = MobileBroadbandModem.GetDefault();
                MobileBroadbandModemConfiguration modemCfg = await modem.GetCurrentConfigurationAsync();
                MobileBroadbandUicc uicc = modemCfg.Uicc;
                if (uicc != null)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine("SIM Card ICCID:" + uicc.SimIccId);

                    MobileBroadbandUiccAppsResult appsResult = await uicc.GetUiccAppsAsync();
                    System.Collections.ObjectModel.ObservableCollection<object> AppList = new System.Collections.ObjectModel.ObservableCollection<object>();
                    foreach (var uiccApp in appsResult.UiccApps)
                    {
                        ListBoxItem item = new ListBoxItem();
                        item.Name = uiccApp.Kind.ToString();
                        item.Content = uiccApp;
                        AppList.Add(item);
                    }

                    listUiccApps.ItemsSource = AppList;
                    if (AppList.Count > 0)
                    {
                        listUiccApps.SelectedIndex = 0;
                    }
                    else
                    {
                        sb.AppendLine("No UICC app found.");
                    }

                    txtUICCInformation.Text = sb.ToString();
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
            }
        }

void listUiccApps_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 90 of file SimCard.xaml.cs.

        {
            if (null != listUiccApps.SelectedItem)
            {
                ListBoxItem item = listUiccApps.SelectedItem as ListBoxItem;
                currentUiccApp = (MobileBroadbandUiccApp)item.Content;
                btnGetRecord.IsEnabled = true;
                byte[] appIdByteBuffer = currentUiccApp.Id.ToArray();
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("AppId:");
                foreach(var v in appIdByteBuffer)
                {
                    sb.Append(v.ToString("X") + ", ");
                }
                txtUICCAppId.Text = sb.ToString();

            }
            else
            {
                btnGetRecord.IsEnabled = false;
            }

            labelRecordInformation.Text = "";
        }

Member Data Documentation

MobileBroadbandUiccApp currentUiccApp = null [private]

Definition at line 41 of file SimCard.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 40 of file SimCard.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileBroadband/cs/SimCard.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MockUIContentRoot Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MockUIContentRoot Class Reference

Inherits IUIContentRootClone.

Detailed Description

Definition at line 36 of file Scenario1_Basic.xaml.cpp.

The documentation for this class was generated from the following file:
  • ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MoveLookController Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Member Functions | Private Attributes

MoveLookController Class Reference

#include "MoveLookController.h"

List of all members.

Public Member Functions

MoveLookController (_In_ winrt::Windows::UI::Core::CoreWindow const &window, _In_ winrt::Windows::UI::Core::CoreDispatcher const &dispatcher)
MoveLookController (_In_ winrt::Windows::UI::Core::CoreWindow const &window)
bool | Active ()
void | Active (_In_ bool active)
bool | AutoFire ()
void | AutoFire (_In_ bool AutoFire)
void | InitWindow (_In_ winrt::Windows::UI::Core::CoreWindow const &window)
bool | IsFiring ()
bool | IsPauseRequested ()
bool | IsPressComplete ()
DirectX::XMFLOAT3 | LookDirection ()
void | Pitch (_In_ float pitch)
float | Pitch ()
void | SetFireRect (_In_ DirectX::XMFLOAT2 upperLeft, _In_ DirectX::XMFLOAT2 lowerRight)
void | SetMoveRect (_In_ DirectX::XMFLOAT2 upperLeft, _In_ DirectX::XMFLOAT2 lowerRight)
void | Update ()
DirectX::XMFLOAT3 | Velocity ()
void | WaitForPress (_In_ DirectX::XMFLOAT2 UpperLeft, _In_ DirectX::XMFLOAT2 LowerRight)
void | WaitForPress ()
float | Yaw ()
void | Yaw (_In_ float yaw)

Private Member Functions

winrt::fire_and_forget | HideCursor ()
void | OnBackRequested (_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::UI::Core::BackRequestedEventArgs const &args)
void | OnGamepadAdded (_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::Gaming::Input::Gamepad const &gamepad)
void | OnGamepadRemoved (_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::Gaming::Input::Gamepad const &gamepad)
void | OnKeyDown (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::KeyEventArgs const &args)
void | OnKeyUp (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::KeyEventArgs const &args)
void | OnMouseMoved (_In_ winrt::Windows::Devices::Input::MouseDevice const &mouseDevice, _In_ winrt::Windows::Devices::Input::MouseEventArgs const &args)
void | OnPointerExited (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args)
void | OnPointerMoved (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args)
void | OnPointerPressed (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args)
void | OnPointerReleased (_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args)
bool | PollingFireInUse ()
void | ResetState ()
winrt::fire_and_forget | ShowCursor ()
void | UpdatePollingDevices ()

Private Attributes

bool | m_autoFire
bool | m_back
bool | m_buttonInUse
DirectX::XMFLOAT2 | m_buttonLowerRight
uint32_t | m_buttonPointerID
bool | m_buttonPressed
DirectX::XMFLOAT2 | m_buttonUpperLeft
bool | m_down
bool | m_fireInUse
DirectX::XMFLOAT2 | m_fireLastPoint
DirectX::XMFLOAT2 | m_fireLowerRight
UINT32 | m_firePointerID
bool | m_firePressed
DirectX::XMFLOAT2 | m_fireUpperLeft
bool | m_forward
std::atomic< bool > | m_gamepadsChanged
bool | m_gamepadStartButtonInUse
bool | m_gamepadTriggerInUse
bool | m_left
bool | m_lookInUse
DirectX::XMFLOAT2 | m_lookLastDelta
DirectX::XMFLOAT2 | m_lookLastPoint
uint32_t | m_lookPointerID
bool | m_mouseInUse
DirectX::XMFLOAT2 | m_mouseLastPoint
bool | m_mouseLeftInUse
uint32_t | m_mousePointerID
bool | m_mouseRightInUse
DirectX::XMFLOAT3 | m_moveCommand
DirectX::XMFLOAT2 | m_moveFirstDown
bool | m_moveInUse
DirectX::XMFLOAT2 | m_moveLowerRight
uint32_t | m_movePointerID
DirectX::XMFLOAT2 | m_movePointerPosition
DirectX::XMFLOAT2 | m_moveUpperLeft
bool | m_pause
bool | m_pausePressed
float | m_pitch
bool | m_right
MoveLookControllerState m_state
bool | m_up
DirectX::XMFLOAT3 | m_velocity
float | m_yaw

Detailed Description

Definition at line 113 of file MoveLookController.h.

Constructor & Destructor Documentation

MoveLookController | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | window,
 |  | _In_ winrt::Windows::UI::Core::CoreDispatcher const & | dispatcher
 | ) |  |
MoveLookController ( _In_ winrt::Windows::UI::Core::CoreWindow const & window )

Member Function Documentation

bool Active ( )

Definition at line 895 of file MoveLookController.cpp.

{
    if (m_state == MoveLookControllerState::Active)
    {
        return true;
    }
    else
    {
        return false;
    }
}

void Active ( _In_ bool active )

Definition at line 875 of file MoveLookController.cpp.

{
    ResetState();
#ifdef MOVELOOKCONTROLLER_TRACE
    DebugTrace(L"Active = %s\n", active ? L"true" : L"false");
#endif

    if (active)
    {
        m_state = MoveLookControllerState::Active;
        HideCursor();

    }
    else
    {
        m_state = MoveLookControllerState::None;
        ShowCursor();
    }
}

bool AutoFire ( )

Definition at line 912 of file MoveLookController.cpp.

{
    return m_autoFire;
}

void AutoFire ( _In_ bool AutoFire )

Definition at line 907 of file MoveLookController.cpp.

{
    m_autoFire = autoFire;
}

winrt::fire_and_forget HideCursor ( ) [private]

Definition at line 765 of file MoveLookController.cpp.

{
    if (m_dispatcher != nullptr)
    {
        // Use the CoreDispatcher to ensure that the pointer is updated on the UI thread.
        // This is needed for XAML updates in a XAML app.
        co_await winrt::resume_foreground(m_dispatcher);
    }

    auto window = CoreWindow::GetForCurrentThread();
    if (window)
    {
        // Protect case where there isn't a window associated with the current thread.
        // This happens on initialization or when being called from a background thread.
        window.PointerCursor(nullptr);
    }
}

void InitWindow ( _In_ winrt::Windows::UI::Core::CoreWindow const & window )
bool IsFiring ( )

Definition at line 112 of file MoveLookController.cpp.

{
    if (m_state == MoveLookControllerState::Active)
    {
        if (m_autoFire)
        {
            return (m_fireInUse || (m_mouseInUse && m_mouseLeftInUse) || PollingFireInUse());
        }
        else
        {
            if (m_firePressed)
            {
                m_firePressed = false;
                return true;
            }
        }
    }
    return false;
}

bool IsPauseRequested ( )

Definition at line 90 of file MoveLookController.cpp.

{
    switch (m_state)
    {
    case MoveLookControllerState::Active:
        UpdatePollingDevices();
        if (m_pausePressed)
        {
#ifdef MOVELOOKCONTROLLER_TRACE
            DebugTrace(L"IsPauseRequested == true\n");
#endif
            m_pausePressed = false;
            return true;
        }
        else
        {
            return false;
        }
    }
    return false;
}

bool IsPressComplete ( )

Definition at line 132 of file MoveLookController.cpp.

{
    switch (m_state)
    {
    case MoveLookControllerState::WaitForInput:
        UpdatePollingDevices();
        if (m_buttonPressed)
        {
#ifdef MOVELOOKCONTROLLER_TRACE
            DebugTrace(L"IsPressComplete == true\n");
#endif
            m_buttonPressed = false;
            return true;
        }
        else
        {
            return false;
        }
        break;
    }

    return false;
}

XMFLOAT3 LookDirection ( )

Definition at line 843 of file MoveLookController.cpp.

{
    XMFLOAT3 lookDirection;

    float r = cosf(m_pitch);              // In the plane.
    lookDirection.y = sinf(m_pitch);      // Vertical.
    lookDirection.z = r * cosf(m_yaw);    // Fwd-back.
    lookDirection.x = r * sinf(m_yaw);    // Left-right.

    return lookDirection;
}

void OnBackRequested | ( | _In_ winrt::Windows::Foundation::IInspectable const & | sender,
 |  | _In_ winrt::Windows::UI::Core::BackRequestedEventArgs const & | args |
 | ) |  |  | [private]
void OnGamepadAdded | ( | _In_ winrt::Windows::Foundation::IInspectable const & | sender,
 |  | _In_ winrt::Windows::Gaming::Input::Gamepad const & | gamepad |
 | ) |  |  | [private]
void OnGamepadRemoved | ( | _In_ winrt::Windows::Foundation::IInspectable const & | sender,
 |  | _In_ winrt::Windows::Gaming::Input::Gamepad const & | gamepad |
 | ) |  |  | [private]
void OnKeyDown | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::KeyEventArgs const & | args |
 | ) |  |  | [private]
void OnKeyUp | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::KeyEventArgs const & | args |
 | ) |  |  | [private]
void OnMouseMoved | ( | _In_ winrt::Windows::Devices::Input::MouseDevice const & | mouseDevice,
 |  | _In_ winrt::Windows::Devices::Input::MouseEventArgs const & | args |
 | ) |  |  | [private]
void OnPointerExited | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::PointerEventArgs const & | args |
 | ) |  |  | [private]
void OnPointerMoved | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::PointerEventArgs const & | args |
 | ) |  |  | [private]
void OnPointerPressed | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::PointerEventArgs const & | args |
 | ) |  |  | [private]
void OnPointerReleased | ( | _In_ winrt::Windows::UI::Core::CoreWindow const & | sender,
 |  | _In_ winrt::Windows::UI::Core::PointerEventArgs const & | args |
 | ) |  |  | [private]
float Pitch ( )

Definition at line 855 of file MoveLookController.cpp.

{
    return m_pitch;
}

void Pitch ( _In_ float pitch )

Definition at line 860 of file MoveLookController.cpp.

{
    m_pitch = pitch;
}

bool PollingFireInUse ( ) [inline, private]

Definition at line 160 of file MoveLookController.h.

{ return m_gamepadTriggerInUse; }

void ResetState ( ) [private]

Definition at line 587 of file MoveLookController.cpp.

{
    // Reset the state of the MoveLookController.
    // Disable any active pointer IDs to stop all interaction.
    m_buttonPressed = false;
    m_pausePressed = false;
    m_buttonInUse = false;
    m_moveInUse = false;
    m_lookInUse = false;
    m_fireInUse = false;
    m_mouseInUse = false;
    m_mouseLeftInUse = false;
    m_mouseRightInUse = false;
    m_movePointerID = 0;
    m_lookPointerID = 0;
    m_firePointerID = 0;
    m_mousePointerID = 0;
    m_velocity = XMFLOAT3(0.0f, 0.0f, 0.0f);
    m_moveCommand = XMFLOAT3(0.0f, 0.0f, 0.0f);
    m_forward = false;
    m_back = false;
    m_left = false;
    m_right = false;
    m_up = false;
    m_down = false;
    m_pause = false;
}

void SetFireRect | ( | _In_ DirectX::XMFLOAT2 | upperLeft,
 |  | _In_ DirectX::XMFLOAT2 | lowerRight
 | ) |  |
void SetMoveRect | ( | _In_ DirectX::XMFLOAT2 | upperLeft,
 |  | _In_ DirectX::XMFLOAT2 | lowerRight
 | ) |  |
winrt::fire_and_forget ShowCursor ( ) [private]

Definition at line 746 of file MoveLookController.cpp.

{
    if (m_dispatcher != nullptr)
    {
        // Use the CoreDispatcher to ensure that the pointer is updated on the UI thread.
        // This is needed for XAML updates in a XAML app.
        co_await winrt::resume_foreground(m_dispatcher);
    }

    auto window = CoreWindow::GetForCurrentThread();
    if (window)
    {
        // Protect case where there isn't a window associated with the current thread.
        // This happens on initialization or when being called from a background thread.
        window.PointerCursor(CoreCursor(CoreCursorType::Arrow, 0));
    }
}

void Update ( )

Definition at line 917 of file MoveLookController.cpp.

{
    UpdatePollingDevices();

    if (m_moveInUse)
    {
        // Move control.
        XMFLOAT2 pointerDelta;

        pointerDelta.x = m_movePointerPosition.x - m_moveFirstDown.x;
        pointerDelta.y = m_movePointerPosition.y - m_moveFirstDown.y;

        // Figure out the command from the virtual joystick.
        XMFLOAT3 commandDirection = XMFLOAT3(0.0f, 0.0f, 0.0f);
        if (fabsf(pointerDelta.x) > 16.0f)         // Leave 32 pixel-wide dead spot for being still.
            m_moveCommand.x -= pointerDelta.x / fabsf(pointerDelta.x);

        if (fabsf(pointerDelta.y) > 16.0f)
            m_moveCommand.y -= pointerDelta.y / fabsf(pointerDelta.y);
    }

    // Poll our state bits set by the keyboard input events.
    if (m_forward)
    {
        m_moveCommand.y += 1.0f;
    }
    if (m_back)
    {
        m_moveCommand.y -= 1.0f;
    }
    if (m_left)
    {
        m_moveCommand.x += 1.0f;
    }
    if (m_right)
    {
        m_moveCommand.x -= 1.0f;
    }
    if (m_up)
    {
        m_moveCommand.z += 1.0f;
    }
    if (m_down)
    {
        m_moveCommand.z -= 1.0f;
    }

    // Make sure that 45deg cases are not faster.
    if (fabsf(m_moveCommand.x) > 0.1f ||
        fabsf(m_moveCommand.y) > 0.1f ||
        fabsf(m_moveCommand.z) > 0.1f)
    {
        XMStoreFloat3(&m_moveCommand, XMVector3Normalize(XMLoadFloat3(&m_moveCommand)));
    }

    // Rotate command to align with our direction (world coordinates).
    XMFLOAT3 wCommand;
    wCommand.x = m_moveCommand.x * cosf(m_yaw) - m_moveCommand.y * sinf(m_yaw);
    wCommand.y = m_moveCommand.x * sinf(m_yaw) + m_moveCommand.y * cosf(m_yaw);
    wCommand.z = m_moveCommand.z;

    // Scale for sensitivity adjustment.
    // Our velocity is based on the command. Y is up.
    m_velocity.x = -wCommand.x * MoveLookConstants::MovementGain;
    m_velocity.z = wCommand.y * MoveLookConstants::MovementGain;
    m_velocity.y = wCommand.z * MoveLookConstants::MovementGain;

    // Clear movement input accumulator for use during next frame.
    m_moveCommand = XMFLOAT3(0.0f, 0.0f, 0.0f);
}

void UpdatePollingDevices ( ) [private]

Definition at line 615 of file MoveLookController.cpp.

{
    if (m_gamepadsChanged)
    {
        m_gamepadsChanged = false;
        uint32_t index = 0;

        // Capture the list of gamepads so it won't change while we are studying it.
        auto gamepads = Gamepad::Gamepads();

        if (gamepads.Size() == 0)
        {
            m_activeGamepad = nullptr;
        }
        // Check if the cached gamepad is still connected.
        else if (!gamepads.IndexOf(m_activeGamepad, index))
        {
            // MoveLookController is intended to handle input for a single player, so it
            // defaults to the first active gamepad.
            m_activeGamepad = gamepads.GetAt(0);
        }
    }

    if (m_activeGamepad == nullptr)
    {
        return;
    }

    GamepadReading reading = m_activeGamepad.GetCurrentReading();

    switch (m_state)
    {
    case MoveLookControllerState::WaitForInput:
        if ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)
        {
            m_gamepadStartButtonInUse = true;
        }
        else if (m_gamepadStartButtonInUse)
        {
            // Trigger once only on button release.
            m_gamepadStartButtonInUse = false;
            m_buttonPressed = true;
        }
        break;

    case MoveLookControllerState::Active:
        if ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)
        {
            m_gamepadStartButtonInUse = true;
        }
        else if (m_gamepadStartButtonInUse)
        {
            // Trigger once only on button release.
            m_gamepadStartButtonInUse = false;
            m_pausePressed = true;
        }
        // Use the left thumbstick on the game controller to control
        // the eye point position control. Thumbstick input is defined from [-1, 1].
        // We use a deadzone in the middle range to avoid drift.
        if (reading.LeftThumbstickX > THUMBSTICK_DEADZONE ||
            reading.LeftThumbstickX < -THUMBSTICK_DEADZONE)
        {
            float x = static_cast<float>(reading.LeftThumbstickX);
            m_moveCommand.x -= (x > 0) ? 1 : -1;
        }

        if (reading.LeftThumbstickY > THUMBSTICK_DEADZONE ||
            reading.LeftThumbstickY < -THUMBSTICK_DEADZONE)
        {
            float y = static_cast<float>(reading.LeftThumbstickY);
            m_moveCommand.y += (y > 0) ? 1 : -1;
        }

        // Use the right thumbstick on the game controller to control
        // the look at control. Thumbstick input is defined from [-1, 1].
        // We use a deadzone in the middle range to avoid drift.
        XMFLOAT2 pointerDelta;
        if (reading.RightThumbstickX > THUMBSTICK_DEADZONE ||
            reading.RightThumbstickX < -THUMBSTICK_DEADZONE)
        {
            float x = static_cast<float>(reading.RightThumbstickX);
            pointerDelta.x = x * x * x;
        }
        else
        {
            pointerDelta.x = 0.0f;
        }

        if (reading.RightThumbstickY > THUMBSTICK_DEADZONE ||
            reading.RightThumbstickY < -THUMBSTICK_DEADZONE)
        {
            float y = static_cast<float>(reading.RightThumbstickY);
            pointerDelta.y = y * y * y;
        }
        else
        {
            pointerDelta.y = 0.0f;
        }

        XMFLOAT2 rotationDelta;
        rotationDelta.x = pointerDelta.x * 0.08f;       // Scale for control sensitivity.
        rotationDelta.y = pointerDelta.y * 0.08f;

        // Update our orientation based on the command.
        m_pitch += rotationDelta.y;
        m_yaw += rotationDelta.x;

        // Limit pitch to straight up or straight down.
        m_pitch = __max(-XM_PI / 2.0f, m_pitch);
        m_pitch = __min(+XM_PI / 2.0f, m_pitch);

        // Check the state of the Right Trigger button. This is used to indicate fire control.

        if (reading.RightTrigger > TRIGGER_DEADZONE)
        {
            if (!m_autoFire && !m_gamepadTriggerInUse)
            {
                m_firePressed = true;
            }

            m_gamepadTriggerInUse = true;
        }
        else
        {
            m_gamepadTriggerInUse = false;
        }
        break;
    }
}

XMFLOAT3 Velocity ( )

Definition at line 838 of file MoveLookController.cpp.

{
    return m_velocity;
}

void WaitForPress | ( | _In_ DirectX::XMFLOAT2 | UpperLeft,
 |  | _In_ DirectX::XMFLOAT2 | LowerRight
 | ) |  |
void WaitForPress ( )

Definition at line 823 of file MoveLookController.cpp.

{
#ifdef MOVELOOKCONTROLLER_TRACE
    DebugTrace(L"WaitForPress (null rect)\n");
#endif

    ResetState();
    m_state = MoveLookControllerState::WaitForInput;
    m_buttonUpperLeft.x = 0.0f;
    m_buttonUpperLeft.y = 0.0f;
    m_buttonLowerRight.x = 0.0f;
    m_buttonLowerRight.y = 0.0f;
    ShowCursor();
}

float Yaw ( )

Definition at line 865 of file MoveLookController.cpp.

{
    return m_yaw;
}

void Yaw ( _In_ float yaw )

Definition at line 870 of file MoveLookController.cpp.

{
    m_yaw = yaw;
}

Member Data Documentation

bool m_autoFire [private]

Definition at line 236 of file MoveLookController.h.

bool m_back [private]

Definition at line 260 of file MoveLookController.h.

bool m_buttonInUse [private]

Definition at line 251 of file MoveLookController.h.

DirectX::XMFLOAT2 m_buttonLowerRight [private]

Definition at line 254 of file MoveLookController.h.

uint32_t m_buttonPointerID [private]

Definition at line 252 of file MoveLookController.h.

bool m_buttonPressed [private]

Definition at line 255 of file MoveLookController.h.

DirectX::XMFLOAT2 m_buttonUpperLeft [private]

Definition at line 253 of file MoveLookController.h.

bool m_down [private]

Definition at line 264 of file MoveLookController.h.

bool m_fireInUse [private]

Definition at line 240 of file MoveLookController.h.

DirectX::XMFLOAT2 m_fireLastPoint [private]

Definition at line 242 of file MoveLookController.h.

DirectX::XMFLOAT2 m_fireLowerRight [private]

Definition at line 239 of file MoveLookController.h.

UINT32 m_firePointerID [private]

Definition at line 241 of file MoveLookController.h.

bool m_firePressed [private]

Definition at line 237 of file MoveLookController.h.

DirectX::XMFLOAT2 m_fireUpperLeft [private]

Definition at line 238 of file MoveLookController.h.

bool m_forward [private]

Definition at line 259 of file MoveLookController.h.

std::atomic<bool> m_gamepadsChanged [private]

Definition at line 268 of file MoveLookController.h.

bool m_gamepadStartButtonInUse [private]

Definition at line 270 of file MoveLookController.h.

bool m_gamepadTriggerInUse [private]

Definition at line 271 of file MoveLookController.h.

bool m_left [private]

Definition at line 261 of file MoveLookController.h.

bool m_lookInUse [private]

Definition at line 230 of file MoveLookController.h.

DirectX::XMFLOAT2 m_lookLastDelta [private]

Definition at line 233 of file MoveLookController.h.

DirectX::XMFLOAT2 m_lookLastPoint [private]

Definition at line 232 of file MoveLookController.h.

uint32_t m_lookPointerID [private]

Definition at line 231 of file MoveLookController.h.

bool m_mouseInUse [private]

Definition at line 245 of file MoveLookController.h.

DirectX::XMFLOAT2 m_mouseLastPoint [private]

Definition at line 247 of file MoveLookController.h.

bool m_mouseLeftInUse [private]

Definition at line 248 of file MoveLookController.h.

uint32_t m_mousePointerID [private]

Definition at line 246 of file MoveLookController.h.

bool m_mouseRightInUse [private]

Definition at line 249 of file MoveLookController.h.

DirectX::XMFLOAT3 m_moveCommand [private]

Definition at line 227 of file MoveLookController.h.

DirectX::XMFLOAT2 m_moveFirstDown [private]

Definition at line 225 of file MoveLookController.h.

bool m_moveInUse [private]

Definition at line 223 of file MoveLookController.h.

DirectX::XMFLOAT2 m_moveLowerRight [private]

Definition at line 222 of file MoveLookController.h.

uint32_t m_movePointerID [private]

Definition at line 224 of file MoveLookController.h.

DirectX::XMFLOAT2 m_movePointerPosition [private]

Definition at line 226 of file MoveLookController.h.

DirectX::XMFLOAT2 m_moveUpperLeft [private]

Definition at line 221 of file MoveLookController.h.

bool m_pause [private]

Definition at line 265 of file MoveLookController.h.

bool m_pausePressed [private]

Definition at line 256 of file MoveLookController.h.

float m_pitch [private]

Definition at line 217 of file MoveLookController.h.

bool m_right [private]

Definition at line 262 of file MoveLookController.h.

MoveLookControllerState m_state [private]

Definition at line 212 of file MoveLookController.h.

bool m_up [private]

Definition at line 263 of file MoveLookController.h.

DirectX::XMFLOAT3 m_velocity [private]

Definition at line 216 of file MoveLookController.h.

float m_yaw [private]

Definition at line 218 of file MoveLookController.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/MoveLookController.h
  • Simple3DGameDX/cppwinrt/GameContent/MoveLookController.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • MrcEffectDefinitions
  • sealed
Public Member Functions | Properties | Private Attributes

sealed Class Reference

#include "MrcAudioEffectDefinition.h"

List of all members.

Public Member Functions

MrcAudioEffectDefinition ()
MrcVideoEffectDefinition ()

Properties

static constexpr bool | DefaultBlankOnProtectedContent = false
static constexpr float | DefaultGlobalOpacityCoefficient = 0.9f
static constexpr bool | DefaultHologramCompositionEnabled = true
static constexpr double | DefaultLoopBackGain = 1.0f
static constexpr double | DefaultMicrophoneGain = 1.0f
static constexpr
MixedRealityCapturePerspective 		DefaultPreferredHologramPerspective = MixedRealityCapturePerspective::PhotoVideoCamera
static constexpr bool | DefaultRecordingIndicatorEnabled = true
static constexpr bool | DefaultShowHiddenMesh = false
static constexpr uint32_t | DefaultVideoStabilizationBufferLength = 0U
static constexpr bool | DefaultVideoStabilizationEnabled = false

Private Attributes

Windows::Foundation::Size | DefaultOutputSize = { 0,0 }
Platform::String | m_activatableClassId = ref new Platform::String(RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT)
Windows::Foundation::Collections::PropertySet | m_propertySet = ref new Windows::Foundation::Collections::PropertySet()

Detailed Description

Definition at line 41 of file MrcAudioEffectDefinition.h.

Member Function Documentation

MrcAudioEffectDefinition ( )
MrcVideoEffectDefinition ( )

Member Data Documentation

Windows::Foundation::Size DefaultOutputSize = { 0,0 } [private]

Definition at line 276 of file MrcVideoEffectDefinition.h.

Platform::String m_activatableClassId = ref new Platform::String(RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT) [private]

Definition at line 112 of file MrcAudioEffectDefinition.h.

Windows::Foundation::Collections::PropertySet m_propertySet = ref new Windows::Foundation::Collections::PropertySet() [private]

Definition at line 113 of file MrcAudioEffectDefinition.h.

Property Documentation

constexpr bool DefaultBlankOnProtectedContent = false [static]

Definition at line 270 of file MrcVideoEffectDefinition.h.

constexpr float DefaultGlobalOpacityCoefficient = 0.9f [static]

Definition at line 269 of file MrcVideoEffectDefinition.h.

constexpr bool DefaultHologramCompositionEnabled = true [static]

Definition at line 265 of file MrcVideoEffectDefinition.h.

constexpr double DefaultLoopBackGain = 1.0f [static]

Definition at line 109 of file MrcAudioEffectDefinition.h.

constexpr double DefaultMicrophoneGain = 1.0f [static]

Definition at line 110 of file MrcAudioEffectDefinition.h.

constexpr MixedRealityCapturePerspective DefaultPreferredHologramPerspective = MixedRealityCapturePerspective::PhotoVideoCamera [static]

Definition at line 272 of file MrcVideoEffectDefinition.h.

constexpr bool DefaultRecordingIndicatorEnabled = true [static]

Definition at line 266 of file MrcVideoEffectDefinition.h.

constexpr bool DefaultShowHiddenMesh = false [static]

Definition at line 271 of file MrcVideoEffectDefinition.h.

constexpr uint32_t DefaultVideoStabilizationBufferLength = 0U [static]

Definition at line 268 of file MrcVideoEffectDefinition.h.

constexpr bool DefaultVideoStabilizationEnabled = false [static]

Definition at line 267 of file MrcVideoEffectDefinition.h.

The documentation for this class was generated from the following files:
  • HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcAudioEffectDefinition.h
  • HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcVideoEffectDefinition.h
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcHceBackgroundTask
  • sealed
Public Member Functions | Private Types | Private Member Functions | Private Attributes

sealed Class Reference

#include "BgTask.h"

List of all members.

Public Member Functions

BgTask ()
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)

Private Types

enum | _LaunchType { Complete, Failed, Denied }
typedef enum
NfcHceBackgroundTask::sealed::_LaunchType 		LaunchType

Private Member Functions

void | ApduReceived (Windows::Devices::SmartCards::SmartCardEmulator^emulator, Windows::Devices::SmartCards::SmartCardEmulatorApduReceivedEventArgs^eventArgs)
void | DebugLog (const wchar_t *pwstrMessage)
void | DebugLogString (Platform::String^message)
void | EndTask ()
void | FlushDebugLog ()
void | HandleHceActivation ()
void | LaunchForegroundApp (LaunchType type, LPWSTR wszMessage)
Windows::Storage::Streams::IBuffer | ProcessCommandApdu (_In_ Windows::Storage::Streams::IBuffer^commandApdu, _Out_ bool *pfComplete)

Private Attributes

Microsoft::WRL::Wrappers::CriticalSection | m_csDebugLog
Microsoft::WRL::Wrappers::CriticalSection | m_csLock
Platform::Guid | m_currentConnectionId
Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral > 		m_deferral
Windows::Devices::SmartCards::SmartCardEmulator | m_emulator
bool | m_fDenyTransactions = false
bool | m_fTaskEnded = false
bool | m_fTransactionCompleted = false
Windows::Devices::SmartCards::SmartCardAppletIdGroupRegistration | m_paymentAidRegistration
LPBYTE | m_pbCurrentAppletId = nullptr
Windows::ApplicationModel::Background::IBackgroundTaskInstance | m_taskInstance
Windows::Devices::SmartCards::SmartCardTriggerDetails | m_triggerDetails
std::wstring | m_wsDebugLog

Detailed Description

Definition at line 17 of file BgTask.h.

Member Typedef Documentation

typedef enum NfcHceBackgroundTask::sealed::_LaunchType LaunchType [private]

Member Enumeration Documentation

enum _LaunchType [private]
Enumerator:
Complete
Failed
Denied

Definition at line 27 of file BgTask.h.

        {
            Complete,
            Failed,
            Denied
        } LaunchType;

Member Function Documentation

void ApduReceived | ( | Windows::Devices::SmartCards::SmartCardEmulator^ | emulator,
 |  | Windows::Devices::SmartCards::SmartCardEmulatorApduReceivedEventArgs^ | eventArgs |
 | ) |  |  | [private]
BgTask ( )
void DebugLog ( const wchar_t * pwstrMessage ) [private]
void DebugLogString ( Platform::String^ message ) [private]
void EndTask ( ) [private]
void FlushDebugLog ( ) [private]
void HandleHceActivation ( ) [private]
void LaunchForegroundApp | ( | LaunchType | type,
 |  | LPWSTR | wszMessage |
 | ) |  |  | [private]
Windows::Storage::Streams::IBuffer ProcessCommandApdu | ( | _In_ Windows::Storage::Streams::IBuffer^ | commandApdu,
 |  | _Out_ bool * | pfComplete |
 | ) |  |  | [private]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]

Member Data Documentation

Microsoft::WRL::Wrappers::CriticalSection m_csDebugLog [private]

Definition at line 69 of file BgTask.h.

Microsoft::WRL::Wrappers::CriticalSection m_csLock [private]

Definition at line 56 of file BgTask.h.

Platform::Guid m_currentConnectionId [private]

Definition at line 63 of file BgTask.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral> m_deferral [private]

Definition at line 58 of file BgTask.h.

Windows::Devices::SmartCards::SmartCardEmulator m_emulator [private]

Definition at line 59 of file BgTask.h.

bool m_fDenyTransactions = false [private]

Definition at line 66 of file BgTask.h.

bool m_fTaskEnded = false [private]

Definition at line 67 of file BgTask.h.

bool m_fTransactionCompleted = false [private]

Definition at line 65 of file BgTask.h.

Windows::Devices::SmartCards::SmartCardAppletIdGroupRegistration m_paymentAidRegistration [private]

Definition at line 61 of file BgTask.h.

LPBYTE m_pbCurrentAppletId = nullptr [private]

Definition at line 64 of file BgTask.h.

Windows::ApplicationModel::Background::IBackgroundTaskInstance m_taskInstance [private]

Definition at line 57 of file BgTask.h.

Windows::Devices::SmartCards::SmartCardTriggerDetails m_triggerDetails [private]

Definition at line 60 of file BgTask.h.

std::wstring m_wsDebugLog [private]

Definition at line 70 of file BgTask.h.

The documentation for this class was generated from the following file:
  • Nfc/NfcHceBackgroundTask/BgTask.h
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvHeader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcProvisioner
  • NfcProvHeader
Public Attributes

NfcProvHeader Struct Reference

The NfcProvHeader is a prefix to each NFC provisioning message which contains information about the protocol version, message index, total message count, and etc.

List of all members.

Public Attributes

byte | index
byte | leading
byte | total
byte | version

Detailed Description

Definition at line 33 of file Scenario1.xaml.cs.

Member Data Documentation

byte index

Definition at line 37 of file Scenario1.xaml.cs.

byte leading

Definition at line 36 of file Scenario1.xaml.cs.

byte total

Definition at line 38 of file Scenario1.xaml.cs.

byte version

Definition at line 35 of file Scenario1.xaml.cs.

The documentation for this struct was generated from the following file:
  • NfcProvisioner/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcProvisioner
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Browse_Click (object sender, RoutedEventArgs e)
void | CancelTransfer_Click (object sender, RoutedEventArgs e)
async Task | InternalTransferHandlerAsync (CancellationToken ct)
async void | Transfer_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static async Task | ConvertToNfcMessageAsync (IBuffer content, ProximityDevice device, Func< ProximityDevice, IBuffer, CancellationToken, Task > messageHandlerAsync, CancellationToken ct)
static byte[] | GetBytes (NfcProvHeader header)
static int | GetNfcProvHeaderSize ()
static async Task | NfcMessageHandlerAsync (ProximityDevice proximityDevice, IBuffer chuckData, CancellationToken ct)

Private Attributes

CancellationTokenSource | currentTransferCancelToken = null
const long | INVALID_PUBLISHED_MESSAGE_ID = -1
const byte | NFC_PROV_MESSAGE_CURRENT_VERSION = 0
const byte | NFC_PROV_MESSAGE_LEADING_BYTE = 0xFF
const string | NFC_PROV_MESSAGE_PROTOCOL_NAME = "Windows.ProvPlugins.Chunk"
IStorageFile | provisioningPackageFile = null
MainPage rootPage

Detailed Description

Definition at line 44 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 55 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Browse_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario1.xaml.cs.

        {
            FileOpenPicker openPicker = new FileOpenPicker();

            // Filter *.ppkg files and only show provisioning package files when opening file picker.
            openPicker.FileTypeFilter.Add(".ppkg");
            provisioningPackageFile = await openPicker.PickSingleFileAsync();

            if (null == provisioningPackageFile)
            {
                rootPage.NotifyUser("No package was selected.", NotifyType.StatusMessage);
                ProvisioningPackagePathText.Text = "";
                TransferButton.Visibility = Visibility.Collapsed;
                CancelTransferButton.Visibility = Visibility.Collapsed;
            }
            else
            {
                rootPage.NotifyUser("One package was selected.", NotifyType.StatusMessage);
                ProvisioningPackagePathText.Text = provisioningPackageFile.Name;
                TransferButton.Visibility = Visibility.Visible;
            }
        }

void CancelTransfer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario1.xaml.cs.

        {
            if (null != currentTransferCancelToken)
            {
                currentTransferCancelToken.Cancel();
            }
        }

static async Task ConvertToNfcMessageAsync | ( | IBuffer | content,
 |  | ProximityDevice | device,
 |  | Func< ProximityDevice, IBuffer, CancellationToken, Task > | messageHandlerAsync,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, static, private]

Function to format provisioning package into chunk data with a NfcProvHeader prefix.

Parameters:
content | IBuffer to the provisioning package content.
device | ProximityDevice instance passed in the messageHandler.
messageHandler | Delegate handler to consume the chunk data.

Definition at line 198 of file Scenario1.xaml.cs.

        {
            var maxMessageSize = device.MaxMessageBytes;
            var headerSize = GetNfcProvHeaderSize();
            uint chunkSize = maxMessageSize - (uint)headerSize;

            // Calculate the chunk count needed for this transfer.
            uint chunks = content.Length / chunkSize;
            if ((content.Length % chunkSize) > 0)
            {
                ++chunks;
            }

            // Loop and compose the payload per chunk data.
            for (uint posToRead = 0; posToRead < content.Length; posToRead += chunkSize)
            {
                var dataWriter = new DataWriter();
                var header = new NfcProvHeader();

                header.version = NFC_PROV_MESSAGE_CURRENT_VERSION;  // Currently the supported version is 0x00.
                header.leading = NFC_PROV_MESSAGE_LEADING_BYTE;     // The leading byte should be always 0xFF.
                header.index = (byte)(posToRead / chunkSize);       // To specify which chunk to this message.
                header.total = (byte)chunks;                        // To specify the total message count for this transfer.

                int bufferSizeToAlloc = (int)maxMessageSize;
                if (header.total == (header.index + 1))
                {
                    bufferSizeToAlloc = headerSize + (int)(content.Length - posToRead);
                }

                // Write the prefix first and the chunk data of the provisioning package.
                dataWriter.WriteBytes(GetBytes(header));
                dataWriter.WriteBuffer(content, posToRead, (uint)(bufferSizeToAlloc - headerSize));

                // Invoke the delegate handler to handle the NFC message.
                await messageHandlerAsync(device, dataWriter.DetachBuffer(), ct);
            }
        }

static byte [] GetBytes ( NfcProvHeader header ) [inline, static, private]

Definition at line 237 of file Scenario1.xaml.cs.

        {
            int size = Marshal.SizeOf(header);
            byte[] arr = new byte[size];
            IntPtr ptr = Marshal.AllocHGlobal(size);

            Marshal.StructureToPtr(header, ptr, true);
            Marshal.Copy(ptr, arr, 0, size);
            Marshal.FreeHGlobal(ptr);

            return arr;
        }

static int GetNfcProvHeaderSize ( ) [inline, static, private]

Definition at line 250 of file Scenario1.xaml.cs.

        {
            var header = new NfcProvHeader();
            return Marshal.SizeOf(header);
        }

async Task InternalTransferHandlerAsync ( CancellationToken ct ) [inline, private]

Function to convert the selected provisioning package into chunk and send it over NFC.

Returns:

Definition at line 126 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Tap device to transfer package.", NotifyType.StatusMessage);

            if (null == provisioningPackageFile)
            {
                rootPage.NotifyUser("Select a package before transferring.", NotifyType.ErrorMessage);
                return;
            }

            IBuffer buffer = await FileIO.ReadBufferAsync(provisioningPackageFile);
            if (null == buffer)
            {
                rootPage.NotifyUser("Something was wrong. Choose another package and retry again.", NotifyType.ErrorMessage);
                return;
            }

            ProximityDevice proximityDevice = ProximityDevice.GetDefault();
            if (null == proximityDevice)
            {
                rootPage.NotifyUser("You'll need to turn on NFC to transfer the package. Go to NFC settings.", NotifyType.ErrorMessage);
                return;
            }

            // Start to format the provisioning package into chunks, and transfer it to another device to be provisioned.
            await ConvertToNfcMessageAsync(buffer, proximityDevice, NfcMessageHandlerAsync, ct);

            rootPage.NotifyUser("Success!", NotifyType.StatusMessage);
        }

static async Task NfcMessageHandlerAsync | ( | ProximityDevice | proximityDevice,
 |  | IBuffer | chuckData,
 |  | CancellationToken | ct |
 | ) |  |  | [inline, static, private]

Function to handle the chunk message and push the NFC message to proximity device.

Parameters:
proximityDevice | ProximityDevice instance to be used.
chuckData | IBuffer to chunk message.

Definition at line 161 of file Scenario1.xaml.cs.

        {
            using (var publishedEvent = new AutoResetEvent(false))
            {
                long publishedMessageId = INVALID_PUBLISHED_MESSAGE_ID;

                publishedMessageId = proximityDevice.PublishBinaryMessage(
                    NFC_PROV_MESSAGE_PROTOCOL_NAME,
                    chuckData, (
                        Windows.Networking.Proximity.ProximityDevice device,
                        long messageId
                    ) =>
                    {
                        publishedEvent.Set();
                    });

                if (INVALID_PUBLISHED_MESSAGE_ID == publishedMessageId)
                {
                    throw new System.ArgumentException("Published message ID returned was invalid.");
                }

                // Wait for the event to be signaled on a threadpool thread so we don't block the UI thread.
                await Task.Run(() =>
                {
                    // Wait for the message transmitted handler to ensure the NFC message has been processed internally.
                    WaitHandle.WaitAny(new WaitHandle[] { publishedEvent, ct.WaitHandle });
                    ct.ThrowIfCancellationRequested();
                });
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 60 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Transfer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario1.xaml.cs.

        {
            TransferButton.IsEnabled = false;
            TransferButton.Visibility = Visibility.Collapsed;
            CancelTransferButton.Visibility = Visibility.Visible;

            try
            {
                currentTransferCancelToken = new CancellationTokenSource();
                await InternalTransferHandlerAsync(currentTransferCancelToken.Token);
                currentTransferCancelToken = null;
            }
            catch (System.OperationCanceledException /*exception*/)
            {
                rootPage.NotifyUser("Transfer has been cancelled.", NotifyType.StatusMessage);
            }
            catch (System.ArgumentException /*exception*/)
            {
                rootPage.NotifyUser("We couldn't finish the transfer. Tap the devices again and keep them close together.", NotifyType.ErrorMessage);
            }

            CancelTransferButton.Visibility = Visibility.Collapsed;
            TransferButton.Visibility = Visibility.Visible;
            TransferButton.IsEnabled = true;
        }

Member Data Documentation

CancellationTokenSource currentTransferCancelToken = null [private]

Definition at line 48 of file Scenario1.xaml.cs.

const long INVALID_PUBLISHED_MESSAGE_ID = -1 [private]

Definition at line 53 of file Scenario1.xaml.cs.

const byte NFC_PROV_MESSAGE_CURRENT_VERSION = 0 [private]

Definition at line 50 of file Scenario1.xaml.cs.

const byte NFC_PROV_MESSAGE_LEADING_BYTE = 0xFF [private]

Definition at line 51 of file Scenario1.xaml.cs.

const string NFC_PROV_MESSAGE_PROTOCOL_NAME = "Windows.ProvPlugins.Chunk" [private]

Definition at line 52 of file Scenario1.xaml.cs.

IStorageFile provisioningPackageFile = null [private]

Definition at line 47 of file Scenario1.xaml.cs.

MainPage rootPage [private]

Definition at line 46 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • NfcProvisioner/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CardReader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcSample
  • CardReader
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CardReader Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CardReader ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | cardReader_CardAdded (SmartCardReader sender, CardAddedEventArgs args)
void | cardReader_CardRemoved (SmartCardReader sender, CardRemovedEventArgs args)
async Task | HandleCard (SmartCard card)

Private Attributes

SmartCardReader | m_cardReader

Detailed Description

Definition at line 30 of file CardReader.xaml.cs.

Constructor & Destructor Documentation

CardReader ( ) [inline]

Definition at line 32 of file CardReader.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void cardReader_CardAdded | ( | SmartCardReader | sender,
 |  | CardAddedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 96 of file CardReader.xaml.cs.

        {
            await HandleCard(args.SmartCard);
        }

void cardReader_CardRemoved | ( | SmartCardReader | sender,
 |  | CardRemovedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 91 of file CardReader.xaml.cs.

        {
            LogMessage("Card removed");
        }

async Task HandleCard ( SmartCard card ) [inline, private]

Sample code to handle a couple of different cards based on the identification process.

Returns:
None

Definition at line 105 of file CardReader.xaml.cs.

        {
            try
            {
                // Clear the messages
                MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

                // Connect to the card
                using (SmartCardConnection connection = await card.ConnectAsync())
                {
                    // Try to identify what type of card it was
                    IccDetection cardIdentification = new IccDetection(card, connection);
                    await cardIdentification.DetectCardTypeAync();
                    LogMessage("Connected to card\r\nPC/SC device class: " + cardIdentification.PcscDeviceClass.ToString());
                    LogMessage("Card name: " + cardIdentification.PcscCardName.ToString());
                    LogMessage("ATR: " + BitConverter.ToString(cardIdentification.Atr));

                    if ((cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass) &&
                        (cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralightC
                        || cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralight
                        || cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralightEV1))
                    {
                        // Handle MIFARE Ultralight
                        MifareUltralight.AccessHandler mifareULAccess = new MifareUltralight.AccessHandler(connection);

                        // Each read should get us 16 bytes/4 blocks, so doing
                        // 4 reads will get us all 64 bytes/16 blocks on the card
                        for (byte i = 0; i < 4; i++)
                        {
                            byte[] response = await mifareULAccess.ReadAsync((byte)(4 * i));
                            LogMessage("Block " + (4 * i).ToString() + " to Block " + (4 * i + 3).ToString() + " " + BitConverter.ToString(response));
                        }

                        byte[] responseUid = await mifareULAccess.GetUidAsync();
                        LogMessage("UID:  " + BitConverter.ToString(responseUid));
                    }
                    else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.MifareDesfire)
                    {
                        // Handle MIFARE DESfire
                        Desfire.AccessHandler desfireAccess = new Desfire.AccessHandler(connection);
                        Desfire.CardDetails desfire = await desfireAccess.ReadCardDetailsAsync();

                        LogMessage("DesFire Card Details:  " + Environment.NewLine + desfire.ToString());
                    }
                    else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
                        && cardIdentification.PcscCardName == Pcsc.CardName.FeliCa)
                    {
                        // Handle Felica
                        LogMessage("Felica card detected");
                        var felicaAccess = new Felica.AccessHandler(connection);
                        var uid = await felicaAccess.GetUidAsync();
                        LogMessage("UID:  " + BitConverter.ToString(uid));
                    }
                    else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
                        && (cardIdentification.PcscCardName == Pcsc.CardName.MifareStandard1K || cardIdentification.PcscCardName == Pcsc.CardName.MifareStandard4K))
                    {
                        // Handle MIFARE Standard/Classic
                        LogMessage("MIFARE Standard/Classic card detected");
                        var mfStdAccess = new MifareStandard.AccessHandler(connection);
                        var uid = await mfStdAccess.GetUidAsync();
                        LogMessage("UID:  " + BitConverter.ToString(uid));

                        ushort maxAddress = 0;
                        switch (cardIdentification.PcscCardName)
                        {
                            case Pcsc.CardName.MifareStandard1K:
                                maxAddress = 0x3f;
                                break;
                            case Pcsc.CardName.MifareStandard4K:
                                maxAddress = 0xff;
                                break;
                        }
                        await mfStdAccess.LoadKeyAsync(MifareStandard.DefaultKeys.FactoryDefault);

                        for (ushort address = 0; address <= maxAddress; address++)
                        {
                            var response = await mfStdAccess.ReadAsync(address, Pcsc.GeneralAuthenticate.GeneralAuthenticateKeyType.MifareKeyA);
                            LogMessage("Block " + address.ToString() + " " + BitConverter.ToString(response));
                        }
                    }
                    else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
                        && (cardIdentification.PcscCardName == Pcsc.CardName.ICODE1 ||
                            cardIdentification.PcscCardName == Pcsc.CardName.ICODESLI ||
                            cardIdentification.PcscCardName == Pcsc.CardName.iCodeSL2))
                    {
                        // Handle ISO15693
                        LogMessage("ISO15693 card detected");
                        var iso15693Access = new Iso15693.AccessHandler(connection);
                        var uid = await iso15693Access.GetUidAsync();
                        LogMessage("UID:  " + BitConverter.ToString(uid));
                    }
                    else
                    {
                        // Unknown card type
                        // Note that when using the XDE emulator the card's ATR and type is not passed through, so we'll
                        // end up here even for known card types if using the XDE emulator

                        // Some cards might still let us query their UID with the PC/SC command, so let's try:
                        var apduRes = await connection.TransceiveAsync(new Pcsc.GetUid());
                        if (!apduRes.Succeeded)
                        {
                            LogMessage("Failure getting UID of card, " + apduRes.ToString());
                        }
                        else
                        {
                            LogMessage("UID:  " + BitConverter.ToString(apduRes.ResponseData));
                        }
                    }
                }
            }
            catch(Exception ex)
            {
                LogMessage("Exception handling card: " + ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file CardReader.xaml.cs.

        {
            // Clear the messages
            MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            // First try to find a reader that advertises as being NFC
            var deviceInfo = await SmartCardReaderUtils.GetFirstSmartCardReaderInfo(SmartCardReaderKind.Nfc);
            if (deviceInfo == null)
            {
                // If we didn't find an NFC reader, let's see if there's a "generic" reader meaning we're not sure what type it is
                deviceInfo = await SmartCardReaderUtils.GetFirstSmartCardReaderInfo(SmartCardReaderKind.Any);
            }

            if (deviceInfo == null)
            {
                LogMessage("NFC card reader mode not supported on this device", NotifyType.ErrorMessage);
                return;
            }

            if (!deviceInfo.IsEnabled)
            {
                var msgbox = new Windows.UI.Popups.MessageDialog("Your NFC proximity setting is turned off, you will be taken to the NFC proximity control panel to turn it on");
                msgbox.Commands.Add(new Windows.UI.Popups.UICommand("OK"));
                await msgbox.ShowAsync();

                // This URI will navigate the user to the NFC proximity control panel
                NfcUtils.LaunchNfcProximitySettingsPage();
                return;
            }

            if (m_cardReader == null)
            {
                m_cardReader = await SmartCardReader.FromIdAsync(deviceInfo.Id);
                m_cardReader.CardAdded += cardReader_CardAdded;
                m_cardReader.CardRemoved += cardReader_CardRemoved;
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 78 of file CardReader.xaml.cs.

        {
            // Clean up
            if (m_cardReader != null)
            {
                m_cardReader.CardAdded -= cardReader_CardAdded;
                m_cardReader.CardRemoved -= cardReader_CardRemoved;
                m_cardReader = null;
            }

            base.OnNavigatingFrom(e);
        }

Member Data Documentation

SmartCardReader m_cardReader [private]

Definition at line 37 of file CardReader.xaml.cs.

The documentation for this class was generated from the following file:
  • Nfc/Nfc/CardReader.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ManageCardScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcSample
  • ManageCardScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ManageCardScenario Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ManageCardScenario ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | btnDebugLog_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | btnDisableCard_Click (object sender, RoutedEventArgs e)
async void | btnEnableCard_Click (object sender, RoutedEventArgs e)
async void | btnForegroundOverrideCard_Click (object sender, RoutedEventArgs e)
async void | btnRegisterBgTask_Click (object sender, RoutedEventArgs e)
async void | btnRegisterSamplePaymentCard_Click (object sender, RoutedEventArgs e)
async void | btnUnregisterCard_Click (object sender, RoutedEventArgs e)
void | chkDenyIfPhoneLocked_Checked (object sender, RoutedEventArgs e)
void | chkDenyIfPhoneLocked_Unchecked (object sender, RoutedEventArgs e)
void | chkLaunchAboveLock_Checked (object sender, RoutedEventArgs e)
void | chkLaunchAboveLock_Unchecked (object sender, RoutedEventArgs e)
void | lstCards_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | ShowDialog (string msg)
async void | Window_VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

bool | isHceSupported
MainPage rootPage

Detailed Description

Definition at line 30 of file ManageCard.xaml.cs.

Constructor & Destructor Documentation

ManageCardScenario ( ) [inline]

Definition at line 35 of file ManageCard.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void btnDebugLog_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 257 of file ManageCard.xaml.cs.

        {
            var debugLogFile = (StorageFile)(await Windows.Storage.ApplicationData.Current.LocalFolder.TryGetItemAsync("DebugLog.txt"));
            if (debugLogFile != null)
            {
                if (txtDebugLog.Visibility == Windows.UI.Xaml.Visibility.Visible)
                {
                    // Log was already displayed, clear it
                    await debugLogFile.DeleteAsync();
                    txtDebugLog.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    btnDebugLog.Content = "Debug Log";
                }
                else
                {
                    // Display the log
                    txtDebugLog.Text = await FileIO.ReadTextAsync(debugLogFile);
                    txtDebugLog.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    btnDebugLog.Content = "Clear Debug Log";
                }
            }
        }

async void btnDisableCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 158 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            var reg = (SmartCardAppletIdGroupRegistration)lstCards.SelectedItem;
            if (reg == null)
            {
                LogMessage("No card selected, must select from listbox", NotifyType.ErrorMessage);
                return;
            }

            await SetCardActivationPolicy(reg, SmartCardAppletIdGroupActivationPolicy.Disabled);

            // Refresh the listbox
            lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
        }

async void btnEnableCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 140 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            var reg = (SmartCardAppletIdGroupRegistration)lstCards.SelectedItem;
            if (reg == null)
            {
                LogMessage("No card selected, must select from listbox", NotifyType.ErrorMessage);
                return;
            }

            await SetCardActivationPolicy(reg, SmartCardAppletIdGroupActivationPolicy.Enabled);

            // Refresh the listbox
            lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
        }

async void btnForegroundOverrideCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 176 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            var reg = (SmartCardAppletIdGroupRegistration)lstCards.SelectedItem;
            if (reg == null)
            {
                LogMessage("No card selected, must select from listbox", NotifyType.ErrorMessage);
                return;
            }

            await SetCardActivationPolicy(reg, SmartCardAppletIdGroupActivationPolicy.ForegroundOverride);

            // Refresh the listbox
            lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
        }

async void btnRegisterBgTask_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            // First check if the device supports NFC/HCE at all
            if (!(await NfcUtils.CheckHceSupport()))
            {
                // HCE not supported
                return;
            }

            // Register the background task which gets launched to handle and respond to incoming APDUs
            await NfcUtils.GetOrRegisterHceBackgroundTask("NFC HCE Sample - Activated", "NfcHceBackgroundTask.BgTask", SmartCardTriggerType.EmulatorHostApplicationActivated);

            // Register the background task which gets launched when our registration state changes (for example the user changes which card is the payment default in the control panel, or another app causes us to be disabled due to an AID conflict)
            await NfcUtils.GetOrRegisterHceBackgroundTask("NFC HCE Sample - Registration Changed", "NfcHceBackgroundTask.BgTask", SmartCardTriggerType.EmulatorAppletIdGroupRegistrationChanged);

            // Register for UICC transaction event
            await NfcUtils.GetOrRegisterHceBackgroundTask("NFC HCE Sample - Transaction", "NfcHceBackgroundTask.BgTask", SmartCardTriggerType.EmulatorTransaction);
        }

async void btnRegisterSamplePaymentCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 115 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            // First check if the device supports NFC/HCE at all
            if (!(await NfcUtils.CheckHceSupport()))
            {
                // HCE not supported
                return;
            }

            // Next check if NFC card emualtion is turned on in the settings control panel
            if ((await SmartCardEmulator.GetDefaultAsync()).EnablementPolicy == SmartCardEmulatorEnablementPolicy.Never)
            {
                await ShowDialog("Your NFC tap+pay setting is turned off, you will be taken to the NFC control panel to turn it on");

                // This URI will navigate the user to the NFC tap+pay control panel
                NfcUtils.LaunchNfcPaymentsSettingsPage();
                return;
            }

            this.Frame.Navigate(typeof(SetCardDataScenario));
        }

async void btnUnregisterCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 194 of file ManageCard.xaml.cs.

        {
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            var reg = (SmartCardAppletIdGroupRegistration)lstCards.SelectedItem;
            if (reg == null)
            {
                LogMessage("No card selected, must select from listbox", NotifyType.ErrorMessage);
                return;
            }

            // Unregister the card
            await SmartCardEmulator.UnregisterAppletIdGroupAsync(reg);

            if (reg.AppletIdGroup.SmartCardEmulationCategory == SmartCardEmulationCategory.Payment
                && reg.AppletIdGroup.SmartCardEmulationType == SmartCardEmulationType.Host)
            {
                // Delete the data file for the card
                await (await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync("ReadRecordResponse-" + reg.Id.ToString("B") + ".dat")).DeleteAsync();
            }

            // Refresh the listbox
            lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();

            LogMessage("AID group successfully unregistered");
        }

void chkDenyIfPhoneLocked_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 222 of file ManageCard.xaml.cs.

        {
            ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"] = true;
        }

void chkDenyIfPhoneLocked_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 227 of file ManageCard.xaml.cs.

        {
            ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"] = false;
        }

void chkLaunchAboveLock_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 232 of file ManageCard.xaml.cs.

        {
            ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"] = true;
        }

void chkLaunchAboveLock_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 237 of file ManageCard.xaml.cs.

        {
            ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"] = false;
        }

void lstCards_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 242 of file ManageCard.xaml.cs.

        {
            var reg = (SmartCardAppletIdGroupRegistration)lstCards.SelectedItem;
            if (reg != null)
            {
                // Clear the messages
                rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
                LogMessage("Selected card is: " + reg.ActivationPolicy.ToString());

                // Setting registration's activation policy from Enabled to ForegroundOverride is
                // not allowed, so disable the button to prevent the user from attempting to do this
                btnForegroundOverrideCard.IsEnabled = (reg.ActivationPolicy != SmartCardAppletIdGroupActivationPolicy.Enabled);
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file ManageCard.xaml.cs.

        {
            rootPage = MainPage.Current;
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            if (!ApplicationData.Current.RoamingSettings.Values.ContainsKey("DenyIfPhoneLocked"))
            {
                ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"] = false;
            }

            if (!ApplicationData.Current.RoamingSettings.Values.ContainsKey("LaunchAboveLock"))
            {
                ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"] = false;
            }

            chkDenyIfPhoneLocked.IsChecked = (bool)ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"];
            chkLaunchAboveLock.IsChecked = (bool)ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"];

            isHceSupported = await CheckHceSupport();
            if (!isHceSupported)
            {
                btnRegisterBgTask.IsEnabled = false;
                btnAddCard.IsEnabled = false;
            }
            else
            {
                lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
            }

            Window.Current.VisibilityChanged += Window_VisibilityChanged;
        }

async Task ShowDialog ( string msg ) [inline, private]

Definition at line 86 of file ManageCard.xaml.cs.

        {
            var msgbox = new Windows.UI.Popups.MessageDialog(msg);
            msgbox.Commands.Add(new Windows.UI.Popups.UICommand("OK"));
            await msgbox.ShowAsync();
        }

async void Window_VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file ManageCard.xaml.cs.

        {
            // Since a registration can change from ForegroundOverride to Disabled when the device
            // is locked, update the registrations when the app window becomes visible
            if (e.Visible && isHceSupported)
            {
                // Clear the messages
                rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

                lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
            }
        }

Member Data Documentation

bool isHceSupported [private]

Definition at line 33 of file ManageCard.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file ManageCard.xaml.cs.

The documentation for this class was generated from the following file:
  • Nfc/Nfc/ManageCard.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcUtils Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcSample
  • NfcUtils
Static Public Member Functions | Static Private Member Functions

NfcUtils Class Reference

List of all members.

Static Public Member Functions

static async Task< bool > | CheckHceSupport ()
static async Task
< SmartCardAppletIdGroupRegistration > 		GetAidGroupById (Guid id)
static async Task
< IBackgroundTaskRegistration > 		GetOrRegisterHceBackgroundTask (string bgTaskName, string taskEntryPoint, SmartCardTriggerType triggerType)
static byte[] | HexStringToBytes (string hexString)
static async void | LaunchNfcPaymentsSettingsPage ()
static async void | LaunchNfcProximitySettingsPage ()
static void | LogMessage (string message, NotifyType type=NotifyType.StatusMessage)
static async Task
< SmartCardAppletIdGroupRegistration > 		RegisterAidGroup (string displayName, IList< IBuffer > appletIds, SmartCardEmulationCategory?emulationCategory, SmartCardEmulationType emulationType, bool automaticEnablement)
static async Task
< SmartCardActivationPolicyChangeResult > 		SetCardActivationPolicy (SmartCardAppletIdGroupRegistration reg, SmartCardAppletIdGroupActivationPolicy policy)

Static Private Member Functions

static void | BgTask_Completed (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
static void | BgTask_Progress (BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args)
static async Task< bool > | DoBackgroundRequestAccess ()

Detailed Description

Definition at line 32 of file NfcUtils.cs.

Member Function Documentation

static void BgTask_Completed | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 102 of file NfcUtils.cs.

        {
            LogMessage("BgTask Completed", NotifyType.StatusMessage);
        }

static void BgTask_Progress | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 97 of file NfcUtils.cs.

        {
            LogMessage("BgTask Progress: " + args.Progress, NotifyType.StatusMessage);
        }

static async Task<bool> CheckHceSupport ( ) [inline, static]

Definition at line 170 of file NfcUtils.cs.

        {
            // Check if the SmartCardEmulator API exists on this currently running SKU of Windows
            if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Devices.SmartCards.SmartCardEmulator"))
            {
                LogMessage("This SKU of Windows does not support NFC card emulation, only phones/mobile devices support NFC card emulation", NotifyType.ErrorMessage);
                return false;
            }

            // Check if any NFC emulation is supported on this device
            var sce = await SmartCardEmulator.GetDefaultAsync();
            if (sce == null)
            {
                LogMessage("NFC card emulation is not supported on this device, probably the device does not have NFC at all", NotifyType.ErrorMessage);
                return false;
            }

            // Check if the NFC emulation support on this device includes HCE
            if (!sce.IsHostCardEmulationSupported())
            {
                LogMessage("This device's NFC does not support HCE-mode", NotifyType.ErrorMessage);
                return false;
            }
            return true;
        }

static async Task<bool> DoBackgroundRequestAccess ( ) [inline, static, private]

Definition at line 74 of file NfcUtils.cs.

        {
            String appVersion = String.Format("{0}.{1}.{2}.{3}",
                    Package.Current.Id.Version.Build,
                    Package.Current.Id.Version.Major,
                    Package.Current.Id.Version.Minor,
                    Package.Current.Id.Version.Revision);

            if ((string)Windows.Storage.ApplicationData.Current.LocalSettings.Values["AppVersion"] != appVersion)
            {
                // Our app has been updated
                Windows.Storage.ApplicationData.Current.LocalSettings.Values["AppVersion"] = appVersion;

                // Call RemoveAccess
                BackgroundExecutionManager.RemoveAccess();
            }

            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            return status == BackgroundAccessStatus.AlwaysAllowed
                || status == BackgroundAccessStatus.AllowedSubjectToSystemPolicy;
        }

static async Task<SmartCardAppletIdGroupRegistration> GetAidGroupById ( Guid id ) [inline, static]

Definition at line 130 of file NfcUtils.cs.

        {
            try
            {
                // Find registration
                var reg = (from r in await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync()
                           where r.Id == id
                           select r).SingleOrDefault();
                if (reg == null)
                {
                    LogMessage("No matching AID group found for specified ID", NotifyType.ErrorMessage);
                }

                return reg;
            }
            catch (Exception ex)
            {
                LogMessage("Failed to get AID group by ID: " + ex.ToString(), NotifyType.StatusMessage);
                throw;
            }
        }

static async Task<IBackgroundTaskRegistration> GetOrRegisterHceBackgroundTask | ( | string | bgTaskName,
 |  | string | taskEntryPoint,
 |  | SmartCardTriggerType | triggerType |
 | ) |  |  | [inline, static]

Definition at line 34 of file NfcUtils.cs.

        {
            try
            {
                // Check if there's an existing background task already registered
                var bgTask = (from t in BackgroundTaskRegistration.AllTasks
                              where t.Value.Name.Equals(bgTaskName)
                              select t.Value).SingleOrDefault();
                if (bgTask != null)
                {
                    LogMessage("Background task already registered", NotifyType.StatusMessage);
                }
                else
                {
                    if (!(await DoBackgroundRequestAccess()))
                    {
                        LogMessage("Background task access denied, task won't fire", NotifyType.ErrorMessage);
                        throw new Exception("Failed to get background access");
                    }

                    var taskBuilder = new BackgroundTaskBuilder();
                    taskBuilder.Name = bgTaskName;
                    taskBuilder.TaskEntryPoint = taskEntryPoint;
                    taskBuilder.SetTrigger(new SmartCardTrigger(triggerType));
                    bgTask = taskBuilder.Register();
                    LogMessage("Background task registered", NotifyType.StatusMessage);
                }

                bgTask.Completed += BgTask_Completed;
                bgTask.Progress += BgTask_Progress;

                return bgTask;
            }
            catch (Exception ex)
            {
                LogMessage("Failed to register background task: " + ex.ToString(), NotifyType.StatusMessage);
                throw;
            }
        }

static byte [] HexStringToBytes ( string hexString ) [inline, static]

Definition at line 206 of file NfcUtils.cs.

        {
            if (hexString.Length % 2 != 0)
            {
                throw new ArgumentException();
            }
            byte[] bytes = new byte[hexString.Length / 2];
            for (int i = 0; i < hexString.Length; i += 2)
            {
                bytes[i / 2] = byte.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber);
            }
            return bytes;
        }

static async void LaunchNfcPaymentsSettingsPage ( ) [inline, static]

Definition at line 196 of file NfcUtils.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-nfctransactions:"));
        }

static async void LaunchNfcProximitySettingsPage ( ) [inline, static]

Definition at line 201 of file NfcUtils.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-proximity:"));
        }

static void LogMessage | ( | string | message,
 |  | NotifyType | type = NotifyType.StatusMessage |
 | ) |  |  | [inline, static]

Definition at line 220 of file NfcUtils.cs.

        {
            Debug.WriteLine(message);
            SDKTemplate.MainPage.Current.NotifyUser(message, type);
        }

static async Task<SmartCardAppletIdGroupRegistration> RegisterAidGroup | ( | string | displayName,
 |  | IList< IBuffer > | appletIds,
 |  | SmartCardEmulationCategory? | emulationCategory,
 |  | SmartCardEmulationType | emulationType,
 |  | bool | automaticEnablement |
 | ) |  |  | [inline, static]

Definition at line 107 of file NfcUtils.cs.

        {
            try
            {
                var cardAidGroup = new SmartCardAppletIdGroup(
                    displayName,
                    appletIds,
                    (SmartCardEmulationCategory)emulationCategory,
                    emulationType);
                cardAidGroup.AutomaticEnablement = automaticEnablement;

                var reg = await SmartCardEmulator.RegisterAppletIdGroupAsync(cardAidGroup);
                LogMessage("AID group successfully registered", NotifyType.StatusMessage);

                return reg;
            }
            catch (Exception ex)
            {
                LogMessage("Failed to register AID group: " + ex.ToString(), NotifyType.StatusMessage);
                throw;
            }
        }

static async Task<SmartCardActivationPolicyChangeResult> SetCardActivationPolicy | ( | SmartCardAppletIdGroupRegistration | reg,
 |  | SmartCardAppletIdGroupActivationPolicy | policy |
 | ) |  |  | [inline, static]

Definition at line 152 of file NfcUtils.cs.

        {
            LogMessage("Previous AID group activation policy: " + reg.ActivationPolicy, NotifyType.StatusMessage);

            // Now try to set the policy on the card, this may pop UI to the user asking them to confirm
            var res = await reg.RequestActivationPolicyChangeAsync(policy);
            if (res == SmartCardActivationPolicyChangeResult.Allowed)
            {
                LogMessage("AID group successfully set to " + policy.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                LogMessage("AID group policy change was disallowed (perhaps due to user declining the UI popup)", NotifyType.ErrorMessage);
            }

            return res;
        }

The documentation for this class was generated from the following file:
  • Nfc/Nfc/NfcUtils.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReceiptView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcSample
  • ReceiptView
Public Member Functions | Protected Member Functions | Private Member Functions

ReceiptView Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ReceiptView ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | btnDebugLog_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | btnMainMenu_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 26 of file ReceiptView.xaml.cs.

Constructor & Destructor Documentation

ReceiptView ( ) [inline]

Definition at line 28 of file ReceiptView.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void btnDebugLog_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file ReceiptView.xaml.cs.

        {
            var debugLogFile = (StorageFile)(await Windows.Storage.ApplicationData.Current.LocalFolder.TryGetItemAsync("DebugLog.txt"));
            if (debugLogFile != null)
            {
                if (txtDebugLog.Visibility == Windows.UI.Xaml.Visibility.Visible)
                {
                    // Log was already displayed, clear it
                    await debugLogFile.DeleteAsync();
                    txtDebugLog.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    btnDebugLog.Content = "Debug Log";
                }
                else
                {
                    // Display the log
                    txtDebugLog.Text = await FileIO.ReadTextAsync(debugLogFile);
                    txtDebugLog.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    btnDebugLog.Content = "Clear Debug Log";
                }
            }
        }

void btnMainMenu_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file ReceiptView.xaml.cs.

        {
            ((Frame)Windows.UI.Xaml.Window.Current.Content).Navigate(typeof(MainPage));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file ReceiptView.xaml.cs.

        {
            lblIcon.Text = "";
            lblStatus.Text = System.DateTime.Now.ToString() + "\r\n";
            lblResult.Text = "";
            if (e.Parameter is string)
            {
                var args = ((string)e.Parameter).Split('^');

                if (args.Length >= 2)
                {
                    lblResult.Text = args[1].ToUpper();
                    if (args[1] == "Failed")
                    {
                        // X
                        lblIcon.Text = "\uE10A";
                        lblIcon.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                    }
                    else if (args[1] == "Complete")
                    {
                        // Checkmark
                        lblIcon.Text = "\uE001";
                        lblIcon.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
                    }
                    else if (args[1] == "Denied")
                    {
                        // !
                        lblIcon.Text = "\uE1DE";
                        lblIcon.Foreground = new SolidColorBrush(Windows.UI.Colors.Orange);
                    }

                    if (args.Length >= 3)
                    {
                        lblStatus.Text += args[2];
                    }
                }
            }
        }

The documentation for this class was generated from the following file:
  • Nfc/Nfc/ReceiptView.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SetCardDataScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • NfcSample
  • SetCardDataScenario
Public Member Functions | Private Member Functions | Static Private Attributes

SetCardDataScenario Class Reference

List of all members.

Public Member Functions

SetCardDataScenario ()
async Task< IBuffer > | ProtectDataAsync (byte[] data, String strDescriptor)

Private Member Functions

async void | btnAddCard_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | btnCancel_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
byte[] | BuildReadRecordResponseMC (string pan, string exp, string serviceCode, string cardholderName, string track1Discretionary, string track2Discretionary)
byte[] | BuildReadRecordResponseV (string track2, string cardholderName, string track1Discretionary)
void | optCardTypeGroup_CheckedUnchecked (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Static Private Attributes

static readonly byte[] | AID_MC
static readonly byte[] | AID_NONPAYMENT
static readonly byte[] | AID_PPSE
static readonly byte[] | AID_V

Detailed Description

Definition at line 27 of file SetCardData.xaml.cs.

Constructor & Destructor Documentation

SetCardDataScenario ( ) [inline]

Definition at line 52 of file SetCardData.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void btnAddCard_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file SetCardData.xaml.cs.

        {
            // Clear the messages
            MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            // Register the AID/applet IDs that this application will handle for our particular card(s)
            SmartCardAppletIdGroupRegistration reg;

            if (optUICC.IsChecked ?? false)
            {
                reg = await NfcUtils.RegisterAidGroup(
                    txtDisplayName.Text,
                    new[] { AID_PPSE.AsBuffer(), AID_V.AsBuffer(), AID_MC.AsBuffer() },
                    SmartCardEmulationCategory.Payment,
                    SmartCardEmulationType.Uicc,
                    (chkAutomaticEnablement.IsChecked ?? false));
            }
            else if (optNonPayment.IsChecked ?? false)
            {
                reg = await NfcUtils.RegisterAidGroup(
                    txtDisplayName.Text,
                    new[] { AID_NONPAYMENT.AsBuffer() },
                    SmartCardEmulationCategory.Other,
                    SmartCardEmulationType.Host,
                    (chkAutomaticEnablement.IsChecked ?? false));

                var rule1 = new SmartCardAutomaticResponseApdu(NfcUtils.HexStringToBytes("0012AABB").AsBuffer(), NfcUtils.HexStringToBytes("AABBCCDDEE9000").AsBuffer());
                rule1.AppletId = AID_NONPAYMENT.AsBuffer();
                await reg.SetAutomaticResponseApdusAsync(new List<SmartCardAutomaticResponseApdu>() { rule1 });
            }
            else
            {
                var aid = (optV.IsChecked ?? false) ? AID_V : AID_MC;
                var aidBuffer = aid.AsBuffer();
                reg = await NfcUtils.RegisterAidGroup(
                    txtDisplayName.Text,
                    new[] { AID_PPSE.AsBuffer(), aidBuffer },
                    SmartCardEmulationCategory.Payment,
                    SmartCardEmulationType.Host,
                    (chkAutomaticEnablement.IsChecked ?? false));

                var rules = new List<SmartCardAutomaticResponseApdu>();

                // Construct SELECT PPSE response and set as auto responder
                rules.Add(new SmartCardAutomaticResponseApdu(
                    new SelectCommand(AID_PPSE, 0x00).GetBuffer(),
                    new TlvEntry(0x6F, new TlvEntry[]
                    {
                        new TlvEntry(0x84, "2PAY.SYS.DDF01"),
                        new TlvEntry(0xA5, new TlvEntry[]
                        {
                            new TlvEntry(0xBF0C,
                                new TlvEntry(0x61, new TlvEntry[]
                                {
                                    new TlvEntry(0x4F, aidBuffer),
                                    new TlvEntry(0x87, new byte[] { 0x01 })
                                }))
                        })
                    }).GetData(0x9000).AsBuffer()));

                if (optV.IsChecked ?? false)
                {
                    rules.Add(new SmartCardAutomaticResponseApdu(
                        new SelectCommand(aid, 0x00).GetBuffer(),
                        new TlvEntry(0x6F, new TlvEntry[]
                        {
                            new TlvEntry(0x84, aidBuffer),
                            new TlvEntry(0xA5, new TlvEntry[]
                            {
                                new TlvEntry(0x50, "CREDIT CARD"),
                                new TlvEntry(0x9F38, new byte[] { 0x9F, 0x66, 0x02 })
                            })
                        }).GetData(0x9000).AsBuffer()));

                    var ruleGpo = new SmartCardAutomaticResponseApdu(
                        NfcUtils.HexStringToBytes("80A80000").AsBuffer(),
                        new TlvEntry(0x80, new byte[] { 0x00, 0x80, 0x08, 0x01, 0x01, 0x00 }).GetData(0x9000).AsBuffer());
                    ruleGpo.AppletId = aidBuffer;
                    ruleGpo.ShouldMatchLength = false;
                    rules.Add(ruleGpo);
                }
                else
                {
                    rules.Add(new SmartCardAutomaticResponseApdu(
                        new SelectCommand(aid, 0x00).GetBuffer(),
                        new TlvEntry(0x6F, new TlvEntry[]
                        {
                            new TlvEntry(0x84, aidBuffer),
                            new TlvEntry(0xA5, new TlvEntry[]
                            {
                                new TlvEntry(0x50, "CREDIT CARD")
                            })
                        }).GetData(0x9000).AsBuffer()));

                    var ruleGpo = new SmartCardAutomaticResponseApdu(
                        NfcUtils.HexStringToBytes("80A80000").AsBuffer(),
                        new TlvEntry(0x77, new TlvEntry[]
                        {
                            new TlvEntry(0x82, new byte[] { 0x00, 0x00 }),
                            new TlvEntry(0x94, new byte[] { 0x08, 0x01, 0x01, 0x00 }),
                            new TlvEntry(0xD7, new byte[] { 0x00, 0x00, 0x80 })
                        }).GetData(0x9000).AsBuffer());
                    ruleGpo.AppletId = aidBuffer;
                    ruleGpo.ShouldMatchLength = false;
                    rules.Add(ruleGpo);
                }

                byte[] record;
                if (optV.IsChecked ?? false)
                {
                    var track2 = txtPAN.Text + "D" + txtExpiryYear.Text + txtExpiryMonth.Text + txtServiceCode.Text + txtTrack2Discretionary.Text;
                    record = BuildReadRecordResponseV(track2, txtCardholderName.Text, txtTrack1Discretionary.Text);
                }
                else
                {
                    record = BuildReadRecordResponseMC(txtPAN.Text, txtExpiryYear.Text + txtExpiryMonth.Text, txtServiceCode.Text, txtCardholderName.Text, txtTrack1Discretionary.Text, txtTrack2Discretionary.Text);
                }

                var encryptedRecord = await ProtectDataAsync(record, "LOCAL=user");

                var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("ReadRecordResponse-" + reg.Id.ToString("B") + ".dat", Windows.Storage.CreationCollisionOption.ReplaceExisting);
                await Windows.Storage.FileIO.WriteBufferAsync(file, encryptedRecord);

                await reg.SetAutomaticResponseApdusAsync(rules);
            }

            LogMessage("Card data saved", NotifyType.StatusMessage);
            this.Frame.GoBack();
        }

void btnCancel_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 124 of file SetCardData.xaml.cs.

        {
            this.Frame.GoBack();
        }

byte [] BuildReadRecordResponseMC | ( | string | pan,
 |  | string | exp,
 |  | string | serviceCode,
 |  | string | cardholderName,
 |  | string | track1Discretionary,
 |  | string | track2Discretionary |
 | ) |  |  | [inline, private]

Definition at line 82 of file SetCardData.xaml.cs.

        {
            var track1 = "B" + pan + "^" + cardholderName + "^" + exp + serviceCode + track1Discretionary;
            var track2 = pan + "D" + exp + serviceCode + track2Discretionary;
            if (track2.Length % 2 != 0)
            {
                track2 += "F";
            }

            return new TlvEntry(0x70, new TlvEntry[] {
                // Magstripe version
                new TlvEntry(0x9F6C, new byte[] { 0x00, 0x01 }),

                // Track 1 data
                new TlvEntry(0x56, System.Text.Encoding.UTF8.GetBytes(track1)),

                // Track 1 bit map for CVC3
                new TlvEntry(0x9F62,  new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E }),

                // Track 1 bit map for UN and ATC
                new TlvEntry(0x9F63, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }),

                // Track 1 number of ATC digits
                new TlvEntry(0x9F64, new byte[] { 0x00 }),

                // Track 2 data
                new TlvEntry(0x9F6B, NfcUtils.HexStringToBytes(track2)),

                // Track 2 bit map for CVC3
                new TlvEntry(0x9F65, new byte[] { 0x00, 0x0E }),

                // Track 2 bit map for UN and ATC
                new TlvEntry(0x9F66,  new byte[] { 0x00, 0x00 }),

                // Track 2 number of ATC digits
                new TlvEntry(0x9F67, new byte[] { 0x00 }),

                // Magstripe CVM list
                new TlvEntry(0x9F68, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x03, 0x42, 0x03, 0x1F, 0x03 }),
                }).GetData(0x9000);
        }

byte [] BuildReadRecordResponseV | ( | string | track2,
 |  | string | cardholderName,
 |  | string | track1Discretionary |
 | ) |  |  | [inline, private]

Definition at line 68 of file SetCardData.xaml.cs.

        {
            if (track2.Length % 2 != 0)
            {
                track2 += "F";
            }

            return new TlvEntry(0x70, new TlvEntry[] {
                new TlvEntry(0x57, NfcUtils.HexStringToBytes(track2)),
                new TlvEntry(0x5F20, cardholderName),
                new TlvEntry(0x9F1F, track1Discretionary),
                }).GetData(0x9000);
        }

void optCardTypeGroup_CheckedUnchecked | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 259 of file SetCardData.xaml.cs.

        {
            if (stackPayment != null)
            {
                if (optNonPayment != null && (optNonPayment.IsChecked ?? false))
                {
                    txtDisplayName.Text = "Sample Other/Non-Payment Card";
                    stackPayment.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
                else if (optUICC != null && (optUICC.IsChecked ?? false))
                {
                    txtDisplayName.Text = "Sample UICC Payment Card";
                    stackPayment.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
                else
                {
                    txtDisplayName.Text = "Sample Payment Card";
                    stackPayment.Visibility = Windows.UI.Xaml.Visibility.Visible;
                }
            }
        }

async Task<IBuffer> ProtectDataAsync | ( | byte[] | data,
 |  | String | strDescriptor |
 | ) |  |  | [inline]

Definition at line 57 of file SetCardData.xaml.cs.

        {
            // Create a DataProtectionProvider object for the specified descriptor.
            DataProtectionProvider Provider = new DataProtectionProvider(strDescriptor);

            // Encrypt the message.
            return await Provider.ProtectAsync(CryptographicBuffer.CreateFromByteArray(data));
        }

Member Data Documentation

readonly byte [] AID_MC [static, private]
Initial value:
        {
            0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10
        }

Definition at line 42 of file SetCardData.xaml.cs.

readonly byte [] AID_NONPAYMENT [static, private]
Initial value:
        {
            0x12, 0x34, 0x56, 0x78, 0x90
        }

Definition at line 47 of file SetCardData.xaml.cs.

readonly byte [] AID_PPSE [static, private]
Initial value:
        {

            (byte)'2', (byte)'P', (byte)'A', (byte)'Y', (byte)'.',
            (byte)'S', (byte)'Y', (byte)'S', (byte)'.',
            (byte)'D', (byte)'D', (byte)'F', (byte)'0', (byte)'1'
        }

Definition at line 29 of file SetCardData.xaml.cs.

readonly byte [] AID_V [static, private]
Initial value:
        {
            0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10
        }

Definition at line 37 of file SetCardData.xaml.cs.

The documentation for this class was generated from the following file:
  • Nfc/Nfc/SetCardData.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NoOp< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

NoOp< T > Struct Template Reference

#include "LinkList.h"

List of all members.

Public Member Functions

void operator() (T &t)

Detailed Description

template<class T>
struct NoOp< T >

Definition at line 37 of file LinkList.h.

Member Function Documentation

void operator() ( T & t ) [inline]

Definition at line 39 of file LinkList.h.

    {
    }

The documentation for this struct was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • App
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Public Attributes

EventHandler< IActivatedEventArgs > | Activated

Static Public Attributes

static IActivatedEventArgs | ActivatedEventArgs
static LaunchActivatedEventArgs | LaunchedEventArgs

Protected Member Functions

override void | OnActivated (IActivatedEventArgs args)
override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

async void | Application_UnhandledException (object sender, UnhandledExceptionEventArgs e)
void | Initialize (IActivatedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 18 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 29 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            this.UnhandledException += Application_UnhandledException;
        }

Member Function Documentation

async void Application_UnhandledException | ( | object | sender,
 |  | UnhandledExceptionEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 137 of file App.xaml.cs.

        {
            e.Handled = true;

            await new MessageDialog(e.Exception.ToString(), "Unknown Error").ShowAsync();
        }

void Initialize ( IActivatedEventArgs e ) [inline, private]

Definition at line 48 of file App.xaml.cs.

        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                if (Settings.ScenarioToOpenWhenLaunchedOrActivated != null)
                {
                    rootFrame.Navigate(typeof(ScenarioPage), Scenarios.MainGroup.FindScenario(Settings.ScenarioToOpenWhenLaunchedOrActivated));
                }

                else
                {

                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage));
                }
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

If the app is closed and something triggers foreground activation, OnLaunched isn't even executed, only OnActivated is executed.

Parameters:
args

Definition at line 101 of file App.xaml.cs.

        {
            ActivatedEventArgs = args;

            if (Activated != null)
            {
                Activated(this, args);
            }

            Initialize(args);
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 41 of file App.xaml.cs.

        {
            LaunchedEventArgs = e;

            Initialize(e);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 118 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 130 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

Member Data Documentation

EventHandler<IActivatedEventArgs> Activated

Definition at line 20 of file App.xaml.cs.

IActivatedEventArgs ActivatedEventArgs [static]

Definition at line 22 of file App.xaml.cs.

LaunchActivatedEventArgs LaunchedEventArgs [static]

Definition at line 23 of file App.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/App.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InstructionControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • InstructionControl
Public Member Functions | Static Public Attributes | Properties

InstructionControl Class Reference

List of all members.

Public Member Functions

InstructionControl ()

Static Public Attributes

static readonly DependencyProperty | InstructionProperty = DependencyProperty.Register("Instruction", typeof(string), typeof(InstructionControl), new PropertyMetadata(null))

Properties

string | Instruction [get, set]

Detailed Description

Definition at line 6 of file InstructionControl.cs.

Constructor & Destructor Documentation

InstructionControl ( ) [inline]

Definition at line 8 of file InstructionControl.cs.

        {
            base.DefaultStyleKey = typeof(InstructionControl);
        }

Member Data Documentation

readonly DependencyProperty InstructionProperty = DependencyProperty.Register("Instruction", typeof(string), typeof(InstructionControl), new PropertyMetadata(null)) [static]

Definition at line 13 of file InstructionControl.cs.

Property Documentation

string Instruction [get, set]

Definition at line 16 of file InstructionControl.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/InstructionControl.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InstructionsControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • InstructionsControl
Public Member Functions

InstructionsControl Class Reference

List of all members.

Public Member Functions

InstructionsControl ()

Detailed Description

Definition at line 5 of file InstructionsControl.cs.

Constructor & Destructor Documentation

InstructionsControl ( ) [inline]

Definition at line 7 of file InstructionsControl.cs.

        {
            this.DefaultStyleKey = typeof(InstructionsControl);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/InstructionsControl.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PopToastControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • PopToastControl
Public Member Functions | Properties | Private Member Functions | Static Private Attributes

PopToastControl Class Reference

List of all members.

Public Member Functions

PopToastControl ()

Properties

string | Payload [get, set]

Private Member Functions

void | ButtonPopToast_Click (object sender, RoutedEventArgs e)
void | ButtonToggleShowPayload_Click (object sender, RoutedEventArgs e)

Static Private Attributes

static readonly DependencyProperty | PayloadProperty = DependencyProperty.Register("Payload", typeof(string), typeof(PopToastControl), new PropertyMetadata(""))

Detailed Description

Definition at line 9 of file PopToastControl.xaml.cs.

Constructor & Destructor Documentation

PopToastControl ( ) [inline]

Definition at line 11 of file PopToastControl.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonPopToast_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 16 of file PopToastControl.xaml.cs.

        {
            ToastHelper.PopCustomToast(TextBoxPayload.Text);
        }

void ButtonToggleShowPayload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file PopToastControl.xaml.cs.

        {
            if (TextBoxPayload.Visibility == Visibility.Visible)
            {
                TextBoxPayload.Visibility = Visibility.Collapsed;
                ButtonToggleShowPayload.Content = "Show Payload";
            }

            else
            {
                TextBoxPayload.Visibility = Visibility.Visible;
                ButtonToggleShowPayload.Content = "Hide Payload";
            }
        }

Member Data Documentation

readonly DependencyProperty PayloadProperty = DependencyProperty.Register("Payload", typeof(string), typeof(PopToastControl), new PropertyMetadata("")) [static, private]

Definition at line 36 of file PopToastControl.xaml.cs.

Property Documentation

string Payload [get, set]

Definition at line 39 of file PopToastControl.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/PopToastControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StepsControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • StepsControl
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions

StepsControl Class Reference

List of all members.

Public Member Functions

StepsControl ()

Static Public Attributes

static readonly DependencyProperty | IsNextEnabledProperty = DependencyProperty.Register("IsNextEnabled", typeof(bool), typeof(StepsControl), new PropertyMetadata(true))
static readonly DependencyProperty | NextButtonVisibilityProperty = DependencyProperty.Register("NextButtonVisibility", typeof(Visibility), typeof(StepsControl), new PropertyMetadata(Visibility.Visible))
static readonly DependencyProperty | StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsControl), new PropertyMetadata(1, OnStepPropertyChanged))

Protected Member Functions

override void | OnApplyTemplate ()

Properties

bool | IsNextEnabled [get, set]
Visibility | NextButtonVisibility [get, set]
int | Step [get, set]

Events

EventHandler< int > | StepChanged = delegate { }

Private Member Functions

void | ButtonNext_Click (object sender, RoutedEventArgs e)
void | Completed_Tapped (object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
StepsHelperControl GetStepsHelperControl ()
void | OnStepPropertyChanged (DependencyPropertyChangedEventArgs e)
void | SetCompleted (bool isCompleted)
void | StepsControl_Loaded (object sender, RoutedEventArgs e)

Static Private Member Functions

static void | OnStepPropertyChanged (DependencyObject sender, DependencyPropertyChangedEventArgs e)

Detailed Description

Definition at line 8 of file StepsControl.cs.

Constructor & Destructor Documentation

StepsControl ( ) [inline]

Definition at line 12 of file StepsControl.cs.

        {
            this.DefaultStyleKey = typeof(StepsControl);
            base.Loaded += StepsControl_Loaded;
        }

Member Function Documentation

void ButtonNext_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file StepsControl.cs.

        {
            Step++;
        }

void Completed_Tapped | ( | object | sender,
 |  | Windows.UI.Xaml.Input.TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file StepsControl.cs.

        {
            Frame frame = Window.Current.Content as Frame;
            if (frame != null)
            {
                if (frame.CanGoBack)
                {
                    e.Handled = true;
                    frame.GoBack();
                    return;
                }
            }
        }

StepsHelperControl GetStepsHelperControl ( ) [inline, private]

Definition at line 61 of file StepsControl.cs.

        {
            return base.ItemsPanelRoot as StepsHelperControl;
        }

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 27 of file StepsControl.cs.

        {
            Button buttonNext = GetTemplateChild("ButtonNext") as Button;
            if (buttonNext == null)
                throw new NullReferenceException("Expected ButtonNext child");

            buttonNext.Click += ButtonNext_Click;

            FrameworkElement completed = GetTemplateChild("Completed") as FrameworkElement;
            if (completed == null)
                throw new NullReferenceException("Expected Completed child");

            completed.Tapped += Completed_Tapped;
        }

void OnStepPropertyChanged ( DependencyPropertyChangedEventArgs e ) [inline, private]

Definition at line 73 of file StepsControl.cs.

        {
            if (Step > base.Items.Count)
                SetCompleted(true);
            else
                SetCompleted(false);

            StepChanged(this, Step);
        }

static void OnStepPropertyChanged | ( | DependencyObject | sender,
 |  | DependencyPropertyChangedEventArgs | e |
 | ) |  |  | [inline, static, private]

Definition at line 68 of file StepsControl.cs.

        {
            (sender as StepsControl).OnStepPropertyChanged(e);
        }

void SetCompleted ( bool isCompleted ) [inline, private]

Definition at line 115 of file StepsControl.cs.

        {
            FrameworkElement normal = GetTemplateChild("Normal") as FrameworkElement;
            if (normal == null)
                return;

            FrameworkElement completed = GetTemplateChild("Completed") as FrameworkElement;
            if (completed == null)
                return;

            if (isCompleted)
            {
                completed.Visibility = Visibility.Visible;
                normal.Visibility = Visibility.Collapsed;
            }

            else
            {
                completed.Visibility = Visibility.Collapsed;
                normal.Visibility = Visibility.Visible;
            }
        }

void StepsControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 18 of file StepsControl.cs.

        {
            StepsHelperControl stepsHelperControl = base.ItemsPanelRoot as StepsHelperControl;
            if (stepsHelperControl == null)
                throw new NullReferenceException("Expected stepsHelperControl as ItemsPanelRoot");

            stepsHelperControl.SetBinding(StepsHelperControl.StepProperty, new Binding() { Path = new PropertyPath("Step"), Source = this });
        }

Member Data Documentation

readonly DependencyProperty IsNextEnabledProperty = DependencyProperty.Register("IsNextEnabled", typeof(bool), typeof(StepsControl), new PropertyMetadata(true)) [static]

Definition at line 138 of file StepsControl.cs.

readonly DependencyProperty NextButtonVisibilityProperty = DependencyProperty.Register("NextButtonVisibility", typeof(Visibility), typeof(StepsControl), new PropertyMetadata(Visibility.Visible)) [static]

Definition at line 146 of file StepsControl.cs.

readonly DependencyProperty StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsControl), new PropertyMetadata(1, OnStepPropertyChanged)) [static]

Definition at line 66 of file StepsControl.cs.

Property Documentation

bool IsNextEnabled [get, set]

Definition at line 141 of file StepsControl.cs.

Visibility NextButtonVisibility [get, set]

Definition at line 149 of file StepsControl.cs.

int Step [get, set]

Definition at line 84 of file StepsControl.cs.

Event Documentation

EventHandler<int> StepChanged = delegate { }

Definition at line 10 of file StepsControl.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/StepsControl.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StepsHelperControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • StepsHelperControl
Static Public Attributes | Protected Member Functions | Properties | Private Member Functions | Static Private Member Functions

StepsHelperControl Class Reference

List of all members.

Static Public Attributes

static readonly DependencyProperty | StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsHelperControl), new PropertyMetadata(1, OnStepChanged))

Protected Member Functions

override Size | ArrangeOverride (Size finalSize)
override Size | MeasureOverride (Size availableSize)

Properties

int | Step [get, set]

Private Member Functions

void | OnStepChanged (DependencyPropertyChangedEventArgs args)
void | UpdateVisibilities ()

Static Private Member Functions

static void | OnStepChanged (object sender, DependencyPropertyChangedEventArgs args)

Detailed Description

Definition at line 7 of file StepsHelperControl.cs.

Member Function Documentation

override Size ArrangeOverride ( Size finalSize ) [inline, protected]

Definition at line 25 of file StepsHelperControl.cs.

        {
            //Clip = new Windows.UI.Xaml.Media.RectangleGeometry() { Rect = new Rect(new Point(), finalSize) };

            for (int i = 0; i < Children.Count; i++)
            {
                Children[i].Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height));
            }

            UpdateVisibilities();

            return finalSize;
        }

override Size MeasureOverride ( Size availableSize ) [inline, protected]

Definition at line 9 of file StepsHelperControl.cs.

        {
            Size resultSize = new Size(availableSize.Width, 0);

            foreach (UIElement child in Children)
            {
                child.Measure(availableSize);

                if (child.DesiredSize.Height > resultSize.Height)
                    resultSize.Height = child.DesiredSize.Height;
            }

            //return availableSize;
            return resultSize;
        }

void OnStepChanged ( DependencyPropertyChangedEventArgs args ) [inline, private]

Definition at line 46 of file StepsHelperControl.cs.

        {
            UpdateVisibilities();
        }

static void OnStepChanged | ( | object | sender,
 |  | DependencyPropertyChangedEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 41 of file StepsHelperControl.cs.

        {
            (sender as StepsHelperControl).OnStepChanged(args);
        }

void UpdateVisibilities ( ) [inline, private]

Definition at line 51 of file StepsHelperControl.cs.

        {
            int adaptedStep = Step - 1;

            for (int i = 0; i < Children.Count; i++)
            {
                Children[i].Visibility = (i == adaptedStep) ? Visibility.Visible : Visibility.Collapsed;
            }
        }

Member Data Documentation

readonly DependencyProperty StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsHelperControl), new PropertyMetadata(1, OnStepChanged)) [static]

Definition at line 39 of file StepsHelperControl.cs.

Property Documentation

int Step [get, set]

Definition at line 62 of file StepsHelperControl.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/StepsHelperControl.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateFourTilesControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Controls
  • UpdateFourTilesControl
Public Member Functions | Private Member Functions

UpdateFourTilesControl Class Reference

List of all members.

Public Member Functions

UpdateFourTilesControl ()
void | SetTilePayload (string xml)

Private Member Functions

async void | ButtonPin_Click (object sender, RoutedEventArgs e)
void | ButtonToggleShowPayload_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 9 of file UpdateFourTilesControl.xaml.cs.

Constructor & Destructor Documentation

UpdateFourTilesControl ( ) [inline]

Definition at line 11 of file UpdateFourTilesControl.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 16 of file UpdateFourTilesControl.xaml.cs.

        {
            ButtonPin.IsEnabled = false;

            await TilesHelper.UpdateTiles(TextBoxPayload.Text);

            ButtonPin.IsEnabled = true;
        }

void ButtonToggleShowPayload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file UpdateFourTilesControl.xaml.cs.

        {
            if (TextBoxPayload.Visibility == Visibility.Visible)
            {
                TextBoxPayload.Visibility = Visibility.Collapsed;
                ButtonToggleShowPayload.Content = "Show Payload";
            }

            else
            {
                TextBoxPayload.Visibility = Visibility.Visible;
                ButtonToggleShowPayload.Content = "Hide Payload";
            }
        }

void SetTilePayload ( string xml ) [inline]

Definition at line 25 of file UpdateFourTilesControl.xaml.cs.

        {
            TextBoxPayload.Text = xml;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Controls/UpdateFourTilesControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TypeToUIElementConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Converters
  • TypeToUIElementConverter
Public Member Functions

TypeToUIElementConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 6 of file TypeToUIElementConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 8 of file TypeToUIElementConverter.cs.

        {
            if (value is Type)
            {
                return Activator.CreateInstance(value as Type);
            }

            return value;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 18 of file TypeToUIElementConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Converters/TypeToUIElementConverter.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocumentToStringConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Converters
  • XmlDocumentToStringConverter
Public Member Functions

XmlDocumentToStringConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 7 of file XmlDocumentToStringConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 9 of file XmlDocumentToStringConverter.cs.

        {
            XmlDocument doc = value as XmlDocument;
            if (doc == null)
                return value;

            return doc.GetXml();
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 18 of file XmlDocumentToStringConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Converters/XmlDocumentToStringConverter.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButtonPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Helpers
  • BackButtonPage
Protected Member Functions | Properties | Private Member Functions

BackButtonPage Class Reference

Inherited by MainPage, and ScenarioPage.

List of all members.

Protected Member Functions

virtual void | OnBackRequested (object sender, BackRequestedEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

AppViewBackButtonVisibility | BackButtonVisibility [get, set]

Private Member Functions

void | BackButtonPage_BackRequested (object sender, BackRequestedEventArgs e)

Detailed Description

Definition at line 7 of file BackButtonPage.cs.

Member Function Documentation

void BackButtonPage_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file BackButtonPage.cs.

        {
            OnBackRequested(sender, e);
        }

virtual void OnBackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

Definition at line 30 of file BackButtonPage.cs.

        {
            if (base.Frame.CanGoBack)
            {
                e.Handled = true;
                base.Frame.GoBack();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Reimplemented in ScenarioPage.

Definition at line 18 of file BackButtonPage.cs.

        {
            base.OnNavigatedFrom(e);

            SystemNavigationManager.GetForCurrentView().BackRequested -= BackButtonPage_BackRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Reimplemented in MainPage, and ScenarioPage.

Definition at line 9 of file BackButtonPage.cs.

        {
            BackButtonVisibility = base.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;

            SystemNavigationManager.GetForCurrentView().BackRequested += BackButtonPage_BackRequested;

            base.OnNavigatedTo(e);
        }

Property Documentation

AppViewBackButtonVisibility BackButtonVisibility [get, set]

Definition at line 40 of file BackButtonPage.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Helpers/BackButtonPage.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BindableBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Helpers
  • BindableBase
Protected Member Functions | Events

BindableBase Class Reference

From http://danrigby.com/2012/04/01/inotifypropertychanged-the-net-4-5-way-revisited/. More...

Inherited by Scenario, and ScenarioGroup.

List of all members.

Protected Member Functions

void | OnPropertyChanged ([CallerMemberName] string propertyName=null)
bool | SetProperty< T > (ref T storage, T value,[CallerMemberName] String propertyName=null)

Events

PropertyChangedEventHandler | PropertyChanged

Detailed Description

Definition at line 10 of file BindableBase.cs.

Member Function Documentation

void OnPropertyChanged ( [CallerMemberName] string propertyName = null ) [inline, protected]

Definition at line 26 of file BindableBase.cs.

        {
            PropertyChangedEventHandler eventHandler = this.PropertyChanged;
            if (eventHandler != null)
            {
                eventHandler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

bool SetProperty< T > | ( | ref T | storage,
 |  | T | value,
 |  | [CallerMemberName] String | propertyName = null |
 | ) |  |  | [inline, protected]

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 12 of file BindableBase.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Helpers/BindableBase.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TilesHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Helpers
  • TilesHelper
Static Public Member Functions

TilesHelper Class Reference

List of all members.

Static Public Member Functions

static async Task< SecondaryTile > | FindExisting (string tileId)
static SecondaryTile | GenerateSecondaryTile (string tileId, string displayName)
static SecondaryTile | GenerateSecondaryTile (string displayName)
static async Task< SecondaryTile > | PinNewSecondaryTile ()
static async Task< SecondaryTile > | PinNewSecondaryTile (string displayName, string xml)
static async Task | UpdateTile (string tileId, XmlDocument doc)
static async Task | UpdateTiles (XmlDocument doc)
static async Task | UpdateTiles (string xml)

Detailed Description

Definition at line 11 of file TilesHelper.cs.

Member Function Documentation

static async Task<SecondaryTile> FindExisting ( string tileId ) [inline, static]

Definition at line 38 of file TilesHelper.cs.

        {
            return (await SecondaryTile.FindAllAsync()).FirstOrDefault(i => i.TileId.Equals(tileId));
        }

static SecondaryTile GenerateSecondaryTile | ( | string | tileId,
 |  | string | displayName |
 | ) |  |  | [inline, static]

Definition at line 22 of file TilesHelper.cs.

        {
            SecondaryTile tile = new SecondaryTile(tileId, displayName, "args", new Uri("ms-appx:///Assets/Logo.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/WideLogo.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/LargeLogo.png");
            tile.VisualElements.Square44x44Logo = new Uri("ms-appx:///Assets/SmallLogo.png"); // Branding logo

            return tile;
        }

static SecondaryTile GenerateSecondaryTile ( string displayName ) [inline, static]

Definition at line 33 of file TilesHelper.cs.

        {
            return GenerateSecondaryTile(DateTime.Now.Ticks.ToString(), displayName);
        }

static async Task<SecondaryTile> PinNewSecondaryTile ( ) [inline, static]

Definition at line 13 of file TilesHelper.cs.

        {
            SecondaryTile tile = GenerateSecondaryTile("Secondary tile");

            await tile.RequestCreateAsync();

            return tile;
        }

static async Task<SecondaryTile> PinNewSecondaryTile | ( | string | displayName,
 |  | string | xml |
 | ) |  |  | [inline, static]

Definition at line 43 of file TilesHelper.cs.

        {
            SecondaryTile tile = GenerateSecondaryTile(displayName);
            await tile.RequestCreateAsync();

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(new TileNotification(doc));

            return tile;
        }

static async Task UpdateTile | ( | string | tileId,
 |  | XmlDocument | doc |
 | ) |  |  | [inline, static]

Definition at line 93 of file TilesHelper.cs.

        {
            if (!SecondaryTile.Exists(tileId))
            {
                SecondaryTile tile = GenerateSecondaryTile(tileId, tileId);
                tile.VisualElements.ShowNameOnSquare310x310Logo = true;
                await tile.RequestCreateAsync();
            }
                //await GenerateSecondaryTile(tileId, tileId).RequestCreateAsync();

            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId).Update(new TileNotification(doc));
        }

static async Task UpdateTiles ( XmlDocument doc ) [inline, static]

Definition at line 75 of file TilesHelper.cs.

        {
            try
            {
                TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(doc));

                await UpdateTile("Small", doc);
                await UpdateTile("Medium", doc);
                await UpdateTile("Wide", doc);
                await UpdateTile("Large", doc);
            }

            catch (Exception ex)
            {
                await new MessageDialog(ex.ToString(), "ERROR: Failed updating tiles").ShowAsync();
            }
        }

static async Task UpdateTiles ( string xml ) [inline, static]

Definition at line 56 of file TilesHelper.cs.

        {
            XmlDocument doc;

            try
            {
                doc = new XmlDocument();
                doc.LoadXml(xml);
            }

            catch (Exception ex)
            {
                await new MessageDialog(ex.ToString(), "ERROR: Invalid XML").ShowAsync();
                return;
            }

            await UpdateTiles(doc);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Helpers/TilesHelper.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • MainPage
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | Private Member Functions

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

Inherits Notifications::Helpers::BackButtonPage.

List of all members.

Public Member Functions

MainPage ()

Static Public Attributes

static readonly DependencyProperty | ScenarioGroupProperty = DependencyProperty.Register("ScenarioGroup", typeof(ScenarioGroup), typeof(MainPage), new PropertyMetadata(null))

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Properties

ScenarioGroup | ScenarioGroup [get, set]

Private Member Functions

async void | Footer_Click (object sender, RoutedEventArgs e)
void | ListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | OpenScenario (IScenario scenario)

Detailed Description

Definition at line 15 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 17 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void ListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file MainPage.xaml.cs.

        {
            ListView lv = sender as ListView;

            // Get the selected scenario, if something's selected
            IScenario scenario = lv.SelectedItem as IScenario;
            if (scenario == null)
                return;

            // Unselect the item so it can be clicked again
            lv.SelectedItem = null;

            OpenScenario(scenario);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Reimplemented from BackButtonPage.

Definition at line 22 of file MainPage.xaml.cs.

        {
            if (e.Parameter is ScenarioGroup)
            {
                ScenarioGroup = e.Parameter as ScenarioGroup;

                if (!base.Frame.CanGoBack && ScenarioGroup != Scenarios.MainGroup)
                    base.Frame.BackStack.Add(new PageStackEntry(typeof(MainPage), Scenarios.MainGroup.FindParent(ScenarioGroup), null));
            }

            else
            {
                ScenarioGroup = Scenarios.MainGroup;
                base.Frame.BackStack.Clear(); //can't go back any further (in case they restored from tombstoning, we don't restore navigation history, so we start fresh)
            }

            base.OnNavigatedTo(e);
        }

void OpenScenario ( IScenario scenario ) [inline, private]

Definition at line 64 of file MainPage.xaml.cs.

        {
            if (scenario == null)
                return;

            // If it's a scenario group, open that group
            if (scenario is ScenarioGroup)
                base.Frame.Navigate(typeof(MainPage), scenario);

            // Otherwise if it's a atomic scenario, open the page for that
            else if (scenario is Scenario)
                base.Frame.Navigate(typeof(ScenarioPage), scenario);

            else
                throw new NotImplementedException("Unknown type of scenario");
        }

Member Data Documentation

readonly DependencyProperty ScenarioGroupProperty = DependencyProperty.Register("ScenarioGroup", typeof(ScenarioGroup), typeof(MainPage), new PropertyMetadata(null)) [static]

Definition at line 41 of file MainPage.xaml.cs.

Property Documentation

ScenarioGroup ScenarioGroup [get, set]

Definition at line 44 of file MainPage.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IScenario Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Model
  • IScenario
Public Member Functions | Properties

IScenario Interface Reference

Inherited by Scenario, and ScenarioGroup.

List of all members.

Public Member Functions

bool | Contains (Type scenarioType)
Scenario | FindScenario (Type scenarioType)

Properties

string | Name [get]

Detailed Description

Definition at line 5 of file IScenario.cs.

Member Function Documentation

bool Contains ( Type scenarioType )

Implemented in Scenario, and ScenarioGroup.

Scenario FindScenario ( Type scenarioType )

Implemented in Scenario, and ScenarioGroup.

Property Documentation

string Name [get]

Implemented in Scenario, and ScenarioGroup.

Definition at line 7 of file IScenario.cs.

The documentation for this interface was generated from the following file:
  • Notifications/cs/Notifications/Model/IScenario.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Model
  • Scenario
Public Member Functions | Properties | Private Attributes

Scenario Class Reference

Inherits Notifications::Helpers::BindableBase, and Notifications::Model::IScenario.

List of all members.

Public Member Functions

Scenario (string name, Type uiElementType)
bool | Contains (Type scenarioType)
Scenario | FindScenario (Type scenarioType)
override string | ToString ()

Properties

string | Id [get]
string | Name [get]
Type | UIElementType [get, set]

Private Attributes

string | _name

Detailed Description

Definition at line 6 of file Scenario.cs.

Constructor & Destructor Documentation

Scenario | ( | string | name,
 |  | Type | uiElementType |
 | ) |  |  | [inline]

Definition at line 24 of file Scenario.cs.

        {
            _name = name;
            UIElementType = uiElementType;
        }

Member Function Documentation

bool Contains ( Type scenarioType ) [inline]

Implements IScenario.

Definition at line 35 of file Scenario.cs.

        {
            return FindScenario(scenarioType) != null;
        }

Scenario FindScenario ( Type scenarioType ) [inline]

Implements IScenario.

Definition at line 40 of file Scenario.cs.

        {
            if (UIElementType == scenarioType)
                return this;

            return null;
        }

override string ToString ( ) [inline]

Definition at line 30 of file Scenario.cs.

        {
            return Name + " - " + Id;
        }

Member Data Documentation

string _name [private]

Definition at line 16 of file Scenario.cs.

Property Documentation

string Id [get]

Simply returns the PageUri, since that's guaranteed to be unique.

Definition at line 12 of file Scenario.cs.

string Name [get]

Implements IScenario.

Definition at line 18 of file Scenario.cs.

Type UIElementType [get, set]

Definition at line 22 of file Scenario.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Model/Scenario.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioGroup Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • Model
  • ScenarioGroup
Public Member Functions | Properties | Private Member Functions | Private Attributes

ScenarioGroup Class Reference

Inherits Notifications::Helpers::BindableBase, and Notifications::Model::IScenario.

List of all members.

Public Member Functions

ScenarioGroup (string name, IEnumerable< IScenario > children)
bool | Contains (Type scenarioType)
ScenarioGroup | FindParent (IScenario ofScenario)
Scenario | FindScenario (Type scenarioType)
List< ScenarioGroup > | GetPathToScenario (Scenario scenario)
override string | ToString ()

Properties

List< IScenario > | Children [get, set]
string | Name [get]

Private Member Functions

void | GetPathToScenarioHelper (Scenario scenario, List< ScenarioGroup > listToAppendTo)

Private Attributes

string | _name

Detailed Description

Definition at line 8 of file ScenarioGroup.cs.

Constructor & Destructor Documentation

ScenarioGroup | ( | string | name,
 |  | IEnumerable< IScenario > | children |
 | ) |  |  | [inline]

Definition at line 23 of file ScenarioGroup.cs.

        {
            _name = name;
            Children = new List<IScenario>(children);
        }

Member Function Documentation

bool Contains ( Type scenarioType ) [inline]

Implements IScenario.

Definition at line 29 of file ScenarioGroup.cs.

        {
            return this.FindScenario(scenarioType) != null;
        }

ScenarioGroup FindParent ( IScenario ofScenario ) [inline]

Definition at line 46 of file ScenarioGroup.cs.

        {
            foreach (var child in Children)
            {
                if (child == ofScenario)
                    return this;

                if (child is ScenarioGroup)
                {
                    ScenarioGroup recursiveFound = (child as ScenarioGroup).FindParent(ofScenario);
                    if (recursiveFound != null)
                        return recursiveFound;
                }
            }

            return null;

        }

Scenario FindScenario ( Type scenarioType ) [inline]

Implements IScenario.

Definition at line 34 of file ScenarioGroup.cs.

        {
            foreach (var child in Children)
            {
                Scenario found = child.FindScenario(scenarioType);
                if (found != null)
                    return found;
            }

            return null;
        }

List<ScenarioGroup> GetPathToScenario ( Scenario scenario ) [inline]

Definition at line 66 of file ScenarioGroup.cs.

        {
            List<ScenarioGroup> answer = new List<ScenarioGroup>() { this };

            GetPathToScenarioHelper(scenario, answer);

            return answer;
        }

void GetPathToScenarioHelper | ( | Scenario | scenario,
 |  | List< ScenarioGroup > | listToAppendTo |
 | ) |  |  | [inline, private]

Definition at line 75 of file ScenarioGroup.cs.

        {
            foreach (Scenario child in Children.OfType<Scenario>())
                if (child == scenario)
                {
                    return;
                }

            foreach (ScenarioGroup groupChild in Children.OfType<ScenarioGroup>())
            {
                if (groupChild.Contains(scenario.UIElementType))
                {
                    listToAppendTo.Add(groupChild);
                    groupChild.GetPathToScenarioHelper(scenario, listToAppendTo);
                }
            }
        }

override string ToString ( ) [inline]

Definition at line 16 of file ScenarioGroup.cs.

        {
            return Name;
        }

Member Data Documentation

string _name [private]

Definition at line 10 of file ScenarioGroup.cs.

Property Documentation

List<IScenario> Children [get, set]

Definition at line 21 of file ScenarioGroup.cs.

string Name [get]

Implements IScenario.

Definition at line 12 of file ScenarioGroup.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/Model/ScenarioGroup.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPage
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | Private Member Functions

ScenarioPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

Inherits Notifications::Helpers::BackButtonPage.

List of all members.

Public Member Functions

ScenarioPage ()

Static Public Attributes

static readonly DependencyProperty | ScenarioProperty = DependencyProperty.Register("Scenario", typeof(Scenario), typeof(ScenarioPage), new PropertyMetadata(null))

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

Scenario | Scenario [get, set]

Private Member Functions

void | ScenarioTestPage_VisibleBoundsChanged (ApplicationView sender, object args)

Detailed Description

Definition at line 14 of file ScenarioPage.xaml.cs.

Constructor & Destructor Documentation

ScenarioPage ( ) [inline]

Definition at line 16 of file ScenarioPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Reimplemented from BackButtonPage.

Definition at line 40 of file ScenarioPage.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            ApplicationView.GetForCurrentView().VisibleBoundsChanged -= ScenarioTestPage_VisibleBoundsChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Reimplemented from BackButtonPage.

Definition at line 21 of file ScenarioPage.xaml.cs.

        {
            Scenario = e.Parameter as Scenario;

            if (!base.Frame.CanGoBack)
                base.Frame.BackStack.Add(new PageStackEntry(typeof(MainPage), Scenario, null));

            if (Scenario == null)
            {
                base.Frame.GoBack();
                return;
            }

            // Handle keyboard showing up
            ApplicationView.GetForCurrentView().VisibleBoundsChanged += ScenarioTestPage_VisibleBoundsChanged;

            base.OnNavigatedTo(e);
        }

void ScenarioTestPage_VisibleBoundsChanged | ( | ApplicationView | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 47 of file ScenarioPage.xaml.cs.

        {
            base.Width = sender.VisibleBounds.Width;
            base.Height = sender.VisibleBounds.Height;
        }

Member Data Documentation

readonly DependencyProperty ScenarioProperty = DependencyProperty.Register("Scenario", typeof(Scenario), typeof(ScenarioPage), new PropertyMetadata(null)) [static]

Definition at line 53 of file ScenarioPage.xaml.cs.

Property Documentation

Scenario Scenario [get, set]

Definition at line 56 of file ScenarioPage.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • ClearBadge
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonClearBadge_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonClearBadge_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Clear();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ClearBadge/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeGlyph
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonUpdateBadgeGlyph_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonUpdateBadgeGlyph_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            string badgeGlyphValue = ComboBoxBadgeGlyph.SelectedItem as string;

            // Get the blank badge XML payload for a badge glyph
            XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);

            // Set the value of the badge in the XML to our glyph value
            XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
            badgeElement.SetAttribute("value", badgeGlyphValue);

            // Create the badge notification
            BadgeNotification badge = new BadgeNotification(badgeXml);

            // Create the badge updater for the application
            BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication();

            // And update the badge
            badgeUpdater.Update(badge);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeGlyph/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeNumber
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void ButtonUpdateBadgeNumber_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 15 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 17 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonUpdateBadgeNumber_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            int num;

            if (!int.TryParse(TextBoxNumber.Text, out num))
            {
                await new MessageDialog("You must provide a valid integer.", "Error").ShowAsync();
                return;
            }

            // Get the blank badge XML payload for a badge number
            XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);

            // Set the value of the badge in the XML to our number
            XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
            badgeElement.SetAttribute("value", num.ToString());

            // Create the badge notification
            BadgeNotification badge = new BadgeNotification(badgeXml);

            // Create the badge updater for the application
            BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication();

            // And update the badge
            badgeUpdater.Update(badge);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeNumber/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • SecondaryTileBadges
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | ButtonClearBadge_Click (object sender, RoutedEventArgs e)
async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)
void | ButtonUpdateBadgeGlyph_Click (object sender, RoutedEventArgs e)
async void | ButtonUpdateBadgeNumber_Click (object sender, RoutedEventArgs e)
async Task< bool > | DoesSecondaryTileExist ()
async void | InitializeScenario ()
void | MoveToBadgeStep ()
void | MoveToSecondaryTileStep ()

Static Private Attributes

static readonly string | SECONDARY_TILE_ID = "badge"

Detailed Description

Definition at line 19 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 81 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            this.InitializeScenario();
        }

Member Function Documentation

void ButtonClearBadge_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 23 of file ScenarioElement.xaml.cs.

        {
            // Clear the badge from the secondary tile
            BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID).Clear();
        }

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file ScenarioElement.xaml.cs.

        {
            // Create and pin new secondary tile for badges
            SecondaryTile tile = new SecondaryTile(SECONDARY_TILE_ID, "Badges", "args", new Uri("ms-appx:///Assets/Logo.png"), TileSize.Default);
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            tile.VisualElements.BackgroundColor = Colors.Blue;
            await tile.RequestCreateAsync();

            // Move to the next step
            MoveToBadgeStep();
        }

void ButtonUpdateBadgeGlyph_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file ScenarioElement.xaml.cs.

        {
            string badgeGlyphValue = ComboBoxBadgeGlyph.SelectedItem as string;

            // Get the blank badge XML payload for a badge glyph
            XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);

            // Set the value of the badge in the XML to our glyph value
            XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
            badgeElement.SetAttribute("value", badgeGlyphValue);

            // Create the badge notification
            BadgeNotification badge = new BadgeNotification(badgeXml);

            // Create the badge updater for our secondary tile, using our tile ID for the secondary tile
            BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID);

            // And update the badge
            badgeUpdater.Update(badge);
        }

async void ButtonUpdateBadgeNumber_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file ScenarioElement.xaml.cs.

        {
            int num;

            if (!int.TryParse(TextBoxBadgeNumber.Text, out num))
            {
                await new MessageDialog("You must provide a valid integer.", "Error").ShowAsync();
                return;
            }

            // Get the blank badge XML payload for a badge number
            XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);

            // Set the value of the badge in the XML to our number
            XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
            badgeElement.SetAttribute("value", num.ToString());

            // Create the badge notification
            BadgeNotification badge = new BadgeNotification(badgeXml);

            // Create the badge updater for our secondary tile, using our tile ID for the secondary tile
            BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID);

            // And update the badge
            badgeUpdater.Update(badge);
        }

async Task<bool> DoesSecondaryTileExist ( ) [inline, private]

Definition at line 101 of file ScenarioElement.xaml.cs.

        {
            var secondaryTiles = await SecondaryTile.FindAllAsync();

            return secondaryTiles.Any(i => i.TileId.Equals(SECONDARY_TILE_ID));
        }

async void InitializeScenario ( ) [inline, private]

Definition at line 88 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            // If secondary tile already exists, we can continue to the next step automatically
            if (await DoesSecondaryTileExist())
                MoveToBadgeStep();
            else
                MoveToSecondaryTileStep();

            base.IsEnabled = true;
        }

void MoveToBadgeStep ( ) [inline, private]

Definition at line 108 of file ScenarioElement.xaml.cs.

        {
            ScrollViewerSecondaryTile.Visibility = Visibility.Collapsed;
            ScrollViewerBadge.Visibility = Visibility.Visible;
        }

void MoveToSecondaryTileStep ( ) [inline, private]

Definition at line 114 of file ScenarioElement.xaml.cs.

        {
            ScrollViewerSecondaryTile.Visibility = Visibility.Visible;
            ScrollViewerBadge.Visibility = Visibility.Collapsed;
        }

Member Data Documentation

readonly string SECONDARY_TILE_ID = "badge" [static, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Badges/Local/SecondaryTileBadges/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Default
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";

            updateFourTilesControl.SetTilePayload($@"
                <tile>
                    <visual>

                        <binding template='TileSmall'>
                            <text>default</text>
                            {fillerText}
                        </binding>

                        <binding template='TileMedium'>
                            <text hint-wrap='true'>branding: default</text>
                            {fillerText}
                        </binding>

                        <binding template='TileWide'>
                            <text hint-wrap='true'>branding: default</text>
                            {fillerText}
                        </binding>

                        <binding template='TileLarge'>
                            <text hint-wrap='true'>branding: default</text>
                            {fillerText}
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Default/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Logo
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";

            updateFourTilesControl.SetTilePayload($@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall' branding='logo'>
                            <text>logo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileMedium' branding='logo'>
                            <text hint-wrap='true'>branding: logo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileWide' branding='logo'>
                            <text hint-wrap='true'>branding: logo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileLarge' branding='logo'>
                            <text hint-wrap='true'>branding: logo</text>
                            {fillerText}
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Logo/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Name
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";

            updateFourTilesControl.SetTilePayload($@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall' branding='name'>
                            <text>name</text>
                            {fillerText}
                        </binding>

                        <binding template='TileMedium' branding='name'>
                            <text hint-wrap='true'>branding: name</text>
                            {fillerText}
                        </binding>

                        <binding template='TileWide' branding='name'>
                            <text hint-wrap='true'>branding: name</text>
                            {fillerText}
                        </binding>

                        <binding template='TileLarge' branding='name'>
                            <text hint-wrap='true'>branding: name</text>
                            {fillerText}
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Name/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • NameAndLogo
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";

            updateFourTilesControl.SetTilePayload($@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall' branding='nameAndLogo'>
                            <text>nameAndLogo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileMedium' branding='nameAndLogo'>
                            <text hint-wrap='true'>nameAndLogo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileWide' branding='nameAndLogo'>
                            <text hint-wrap='true'>branding: nameAndLogo</text>
                            {fillerText}
                        </binding>

                        <binding template='TileLarge' branding='nameAndLogo'>
                            <text hint-wrap='true'>branding: nameAndLogo</text>
                            {fillerText}
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/NameAndLogo/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • None
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";

            updateFourTilesControl.SetTilePayload($@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall' branding='none'>
                            <text>none</text>
                            {fillerText}
                        </binding>

                        <binding template='TileMedium' branding='none'>
                            <text hint-wrap='true'>branding: none</text>
                            {fillerText}
                        </binding>

                        <binding template='TileWide' branding='none'>
                            <text hint-wrap='true'>branding: none</text>
                            {fillerText}
                        </binding>

                        <binding template='TileLarge' branding='none'>
                            <text hint-wrap='true'>branding: none</text>
                            {fillerText}
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/None/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Custom
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPin_Click (object sender, RoutedEventArgs e)
async void | ButtonUpdate_Click (object sender, RoutedEventArgs e)
void | Update (string tileId, XmlDocument doc)

Detailed Description

Definition at line 17 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file ScenarioElement.xaml.cs.

        {
            await TilesHelper.GenerateSecondaryTile("CustomSmall", "Small").RequestCreateAsync();
            await TilesHelper.GenerateSecondaryTile("CustomMedium", "Medium").RequestCreateAsync();
            await TilesHelper.GenerateSecondaryTile("CustomWide", "Wide").RequestCreateAsync();
            await TilesHelper.GenerateSecondaryTile("CustomLarge", "Large").RequestCreateAsync();
        }

async void ButtonUpdate_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(TextBoxTilePayload.Text);

                Update("CustomSmall", doc);
                Update("CustomMedium", doc);
                Update("CustomWide", doc);
                Update("CustomLarge", doc);
            }

            catch (Exception ex)
            {
                await new MessageDialog(ex.ToString(), "ERROR").ShowAsync();
            }
        }

void Update | ( | string | tileId,
 |  | XmlDocument | doc |
 | ) |  |  | [inline, private]

Definition at line 43 of file ScenarioElement.xaml.cs.

        {
            if (SecondaryTile.Exists(tileId))
                TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId).Update(new TileNotification(doc));
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Custom/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Contact
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            updateFourTilesControl.SetTilePayload($@"
                <tile>
                    <visual>

                        <binding template='TileSmall' hint-presentation='contact'>
                            <image src='Assets/Photos/1.jpg'/>
                        </binding>

                        <binding template='TileMedium' hint-presentation='contact'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <text>CONTACT_TEXT01</text>
                            <text>CONTACT_TEXT02</text>
                            <text>CONTACT_TEXT03</text>
                        </binding>

                        <binding template='TileWide' hint-presentation='contact'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <text>CONTACT_TEXT01</text>
                            <text>CONTACT_TEXT02</text>
                            <text>CONTACT_TEXT03</text>
                        </binding>

                        <binding template='TileLarge' hint-presentation='contact'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <text>CONTACT_TEXT01</text>
                            <text>CONTACT_TEXT02</text>
                            <text>CONTACT_TEXT03</text>
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Contact/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • People
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            updateFourTilesControl.SetTilePayload($@"
                <tile>
                    <visual>

                        <binding template='TileMedium' hint-presentation='people'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                        <binding template='TileWide' hint-presentation='people'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                        <binding template='TileLarge' hint-presentation='people'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/People/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Photos
  • ScenarioElement
Public Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
            updateFourTilesControl.SetTilePayload($@"
                <tile>
                    <visual>

                        <binding template='TileMedium' hint-presentation='photos'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                        <binding template='TileWide' hint-presentation='photos'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                        <binding template='TileLarge' hint-presentation='photos'>
                            <image src='Assets/Photos/1.jpg'/>
                            <image src='Assets/Photos/2.jpg'/>
                            <image src='Assets/Photos/3.jpg'/>
                            <image src='Assets/Photos/4.jpg'/>
                            <image src='Assets/Photos/5.jpg'/>
                            <image src='Assets/Photos/6.jpg'/>
                            <image src='Assets/Photos/7.jpg'/>
                            <image src='Assets/Photos/8.jpg'/>
                            <image src='Assets/Photos/9.jpg'/>
                            <image src='Assets/Photos/10.jpg'/>
                        </binding>

                    </visual>
                </tile>");
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Photos/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppData
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPickImage_Click (object sender, RoutedEventArgs e)
async void | ButtonPinTile_Click (object sender, RoutedEventArgs e)

Private Attributes

Uri | _imagePath

Detailed Description

Definition at line 19 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPickImage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file ScenarioElement.xaml.cs.

        {
            FileOpenPicker picker = new FileOpenPicker();
            picker.ViewMode = PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            picker.CommitButtonText = "Open Image";
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".jpeg");
            picker.FileTypeFilter.Add(".png");

            StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                StorageFolder logosFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("TileNotifications", CreationCollisionOption.OpenIfExists);

                // Copy the file to local app data
                StorageFile localFile = await file.CopyAsync(logosFolder, file.Name, NameCollisionOption.GenerateUniqueName);

                _imagePath = new Uri("ms-appdata:///Local/TileNotifications/" + localFile.Name);

                ButtonPinTile.IsEnabled = true;
                ImageLogoPreview.Source = new BitmapImage(_imagePath);
            }
        }

async void ButtonPinTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            string ImageUrl = _imagePath.ToString();

            SecondaryTile tile = TilesHelper.GenerateSecondaryTile("App Package Image");
            await tile.RequestCreateAsync();

            string tileXmlString =
                "<tile>"
                + "<visual>"
                + "<binding template='TileSmall'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileMedium'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileWide'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileLarge'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "</visual>"
                + "</tile>";

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(tileXmlString);
            TileNotification notifyTile = new TileNotification(xmlDoc);
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notifyTile);

            base.IsEnabled = true;
        }

Member Data Documentation

Uri _imagePath [private]

Definition at line 26 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppData/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppPackage
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 16 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 18 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            string ImageUrl = "ms-appx:///Assets/check.png";

            SecondaryTile tile = TilesHelper.GenerateSecondaryTile("App Package Image");
            await tile.RequestCreateAsync();

            string tileXmlString =
                "<tile>"
                + "<visual>"
                + "<binding template='TileSmall'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileMedium'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileWide'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "<binding template='TileLarge'>"
                + "<image src='" + ImageUrl + "' alt='image'/>"
                + "</binding>"
                + "</visual>"
                + "</tile>";

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(tileXmlString);
            TileNotification notifyTile = new TileNotification(xmlDoc);
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notifyTile);

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 23 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppPackage/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromInternet
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 16 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 18 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            string ImageUrl = "http://c.s-microsoft.com/en-us/CMSImages/windows_symbol.png?version=f1f9db81-67ef-8866-1be3-d5b1c1bb0b26";

            SecondaryTile tile = TilesHelper.GenerateSecondaryTile("Web Image");
            await tile.RequestCreateAsync();

            string tileXmlString =
                "<tile>"
                + "<visual>"
                + "<binding template='TileSmall'>"
                + "<image src='" + ImageUrl + "' alt='Web image'/>"
                + "</binding>"
                + "<binding template='TileMedium'>"
                + "<image src='" + ImageUrl + "' alt='Web image'/>"
                + "</binding>"
                + "<binding template='TileWide'>"
                + "<image src='" + ImageUrl + "' alt='Web image'/>"
                + "</binding>"
                + "<binding template='TileLarge'>"
                + "<image src='" + ImageUrl + "' alt='Web image'/>"
                + "</binding>"
                + "</visual>"
                + "</tile>";

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(tileXmlString);
            TileNotification notifyTile = new TileNotification(xmlDoc);
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notifyTile);

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 23 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromInternet/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextStyles
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPin_Click (object sender, RoutedEventArgs e)
async Task | PinTile (string style)

Detailed Description

Definition at line 18 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            ButtonPin.IsEnabled = false;

            await PinTile("caption");
            await PinTile("body");
            await PinTile("base");
            await PinTile("subtitle");
            await PinTile("title");
            await PinTile("subheader");
            await PinTile("header");
            await PinTile("captionsubtle");
            await PinTile("bodysubtle");
            await PinTile("basesubtle");
            await PinTile("subtitlesubtle");
            await PinTile("titlesubtle");
            await PinTile("subheadersubtle");
            await PinTile("headersubtle");
            await PinTile("subheadernumeral");
            await PinTile("headernumeral");

            await new MessageDialog("SUCCESS").ShowAsync();
            ButtonPin.IsEnabled = true;
        }

async Task PinTile ( string style ) [inline, private]

Definition at line 51 of file ScenarioElement.xaml.cs.

        {
            SecondaryTile tile = TilesHelper.GenerateSecondaryTile(style);
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;

            await tile.RequestCreateAsync();

            string xml = $@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall'>
                            <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
                        </binding>

                        <binding template='TileMedium'>
                            <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
                        </binding>

                        <binding template='TileWide'>
                            <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
                        </binding>

                        <binding template='TileLarge'>
                            <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
                        </binding>
                    </visual>
                </tile>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            TileNotification notification = new TileNotification(doc);
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notification);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextStyles/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextWrap
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void ButtonPin_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            ButtonPin.IsEnabled = false;

            string text = "Now, this is the story all about how my tile got text-wrapped upside down. And I'd like to take a minute, just sit right there, I'll tell you how I became the prince of a town called Bellevue. In South Arizona, born and raised, in the mountains is where I spent most of my days, climbin' up, runnin', posin' all cool, and all shootin' some videos outside of school. When a couple of guys who were up to no good, started leavin' trash at the trailhead.";

            await TilesHelper.PinNewSecondaryTile("text wrapping",
                $@"
                <tile version='3'>
                    <visual>

                        <binding template='TileSmall'>
                            <text hint-wrap='true'>{text}</text>
                        </binding>

                        <binding template='TileMedium'>
                            <text hint-wrap='true'>{text}</text>
                        </binding>

                        <binding template='TileWide'>
                            <text hint-wrap='true'>{text}</text>
                        </binding>

                        <binding template='TileLarge'>
                            <text hint-wrap='true'>{text}</text>
                        </binding>

                </visual>
            </tile>");

            await new MessageDialog("SUCCESS").ShowAsync();
            ButtonPin.IsEnabled = true;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextWrap/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Custom
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 23 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(_tileId, "Custom Color", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            tile.VisualElements.BackgroundColor = Color.FromArgb(255, 0, 171, 48);
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 21 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Custom/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • InheritFromPrimary
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(_tileId, "Inherit Primary Color", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 20 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/InheritFromPrimary/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Transparent
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 23 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(_tileId, "Transparent", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            tile.VisualElements.BackgroundColor = Colors.Transparent;
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 21 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Transparent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppData
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPickImage_Click (object sender, RoutedEventArgs e)
async void | ButtonPinTile_Click (object sender, RoutedEventArgs e)

Private Attributes

Uri | _imagePath

Detailed Description

Definition at line 16 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 18 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPickImage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            FileOpenPicker picker = new FileOpenPicker();
            picker.ViewMode = PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            picker.CommitButtonText = "Open Image";
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".jpeg");
            picker.FileTypeFilter.Add(".png");

            StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                StorageFolder logosFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Logos", CreationCollisionOption.OpenIfExists);

                // Copy the file to local app data
                StorageFile localFile = await file.CopyAsync(logosFolder, file.Name, NameCollisionOption.GenerateUniqueName);

                _imagePath = new Uri("ms-appdata:///Local/Logos/" + localFile.Name);

                ButtonPinTile.IsEnabled = true;
                ImageLogoPreview.Source = new BitmapImage(_imagePath);
            }
        }

async void ButtonPinTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            string tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(tileId, "Logo App Data", "args", _imagePath, TileSize.Default);
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

Member Data Documentation

Uri _imagePath [private]

Definition at line 23 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppData/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppPackage
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void ButtonPinTile_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            string tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(tileId, "Logo App Package", "args", new Uri("ms-appx:///Assets/Photos/1.jpg"), TileSize.Default);
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppPackage/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync
  • Visualizer
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | blah ()
async void | ButtonUpdate_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            ButtonUpdate_Click(this, null);
        }

Member Function Documentation

void blah ( ) [inline, private]

Definition at line 28 of file ScenarioElement.xaml.cs.

        {
            SecondaryTile tile = new SecondaryTile();
            tile.DisplayName = "";
            tile.VisualElements.BackgroundColor = Colors.Red;
        }

async void ButtonUpdate_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 23 of file ScenarioElement.xaml.cs.

        {
            ListViewTiles.ItemsSource = await SecondaryTile.FindAllAsync();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/FindAllAsync/Visualizer/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • ExpiringNotification
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)
async void | ButtonSendNotification_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 17 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(_tileId, "Expiring Notification", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

async void ButtonSendNotification_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            try
            {
                if (_tileId == null)
                {
                    await new MessageDialog("No secondary tile was pinned. In the previous step, you had to pin the tile.", "Error").ShowAsync();
                    return;
                }

                SecondaryTile tile = (await SecondaryTile.FindAllAsync()).FirstOrDefault(i => i.TileId.Equals(_tileId));
                if (tile == null)
                {
                    await new MessageDialog("The secondary tile that was previously pinned could not be found. Has it been removed from Start?", "Error").ShowAsync();
                    return;
                }

                // Decide expiration time
                Windows.Globalization.Calendar cal = new Windows.Globalization.Calendar();
                cal.SetToNow();
                cal.AddSeconds(20);

                // Get expiration time and date
                var longTime = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("longtime");
                DateTimeOffset expiryTime = cal.GetDateTime();
                string expiryTimeString = longTime.Format(expiryTime);

                // Create the custom tile that will expire
                string tileXmlString =
                "<tile>"
                + "<visual>"
                + "<binding template='TileMedium'>"
                + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
                + "</binding>"
                + "<binding template='TileWide'>"
                + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
                + "</binding>"
                + "<binding template='TileLarge'>"
                + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
                + "</binding>"
                + "</visual>"
                + "</tile>";

                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(tileXmlString);

                // Create the notification
                TileNotification notifyTile = new TileNotification(xmlDoc);

                // Set expiration time for the notification
                notifyTile.ExpirationTime = expiryTime;

                // And send the notification to the tile
                TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notifyTile);
            }

            catch (Exception ex)
            {
                await new MessageDialog(ex.ToString(), "Error updating tile").ShowAsync();
            }

            finally
            {
                base.IsEnabled = true;
            }
        }

Member Data Documentation

string _tileId [private]

Definition at line 24 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ExpiringNotification/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Clearing
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonClearNotifications_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonClearNotifications_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            TileUpdateManager.CreateTileUpdaterForApplication().Clear();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Clearing/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Sending
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonSendNotification_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 15 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 17 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonSendNotification_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            string xml = $@"
                <tile version='3'>
                    <visual branding='nameAndLogo'>

                        <binding template='TileMedium'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                        <binding template='TileWide'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                        <binding template='TileLarge'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                </visual>
            </tile>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            string nowTimeString = DateTime.Now.ToString();

            // Assign date/time values through XmlDocument to avoid any xml escaping issues
            foreach (XmlElement textEl in doc.SelectNodes("//text").OfType<XmlElement>())
                if (textEl.InnerText.Length == 0)
                    textEl.InnerText = nowTimeString;

            TileNotification notification = new TileNotification(doc);
            TileUpdateManager.CreateTileUpdaterForApplication().Update(notification);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Sending/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • SecondaryTiles
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinTile_Click (object sender, RoutedEventArgs e)
void | ButtonSendNotification_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 17 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = TilesHelper.GenerateSecondaryTile(_tileId, "Secondary notification");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            await tile.RequestCreateAsync();

            stepsControl.Step++;
            base.IsEnabled = true;
        }

void ButtonSendNotification_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            string xml = $@"
                <tile version='3'>
                    <visual branding='nameAndLogo'>

                        <binding template='TileMedium'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                        <binding template='TileWide'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                        <binding template='TileLarge'>
                            <text hint-wrap='true'>New tile notification</text>
                            <text hint-wrap='true' hint-style='captionSubtle'/>
                        </binding>

                </visual>
            </tile>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            string nowTimeString = DateTime.Now.ToString();

            // Assign date/time values through XmlDocument to avoid any xml escaping issues
            foreach (XmlElement textEl in doc.SelectNodes("//text").OfType<XmlElement>())
                if (textEl.InnerText.Length == 0)
                    textEl.InnerText = nowTimeString;

            TileNotification notification = new TileNotification(doc);
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(_tileId).Update(notification);
        }

Member Data Documentation

string _tileId [private]

Definition at line 24 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/SecondaryTiles/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Pinning
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void ButtonPin_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            ButtonPin.IsEnabled = false;

            try
            {
                SecondaryTile tile = new SecondaryTile(DateTime.Now.Ticks.ToString());
                tile.Arguments = "args";

                tile.DisplayName = TextBoxDisplayName.Text;

                if (CheckBoxSquare150x150Logo.IsChecked.Value)
                    tile.VisualElements.Square150x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png");

                if (CheckBoxSquare71x71Logo.IsChecked.Value)
                    tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");

                if (CheckBoxWide310x150Logo.IsChecked.Value)
                    tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");

                if (CheckBoxSquare310x310Logo.IsChecked.Value)
                    tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");

                tile.VisualElements.ShowNameOnSquare150x150Logo = CheckBoxShowNameOnSquare150x150Logo.IsChecked.Value;
                tile.VisualElements.ShowNameOnSquare310x310Logo = CheckBoxShowNameOnSquare310x310Logo.IsChecked.Value;
                tile.VisualElements.ShowNameOnWide310x150Logo = CheckBoxShowNameOnWide310x150Logo.IsChecked.Value;

                await tile.RequestCreateAsync();
            }

            catch (Exception ex)
            {
                await new MessageDialog(ex.ToString(), "Error").ShowAsync();
            }

            ButtonPin.IsEnabled = true;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Pinning/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • UnpinEverything
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void ButtonUnpinEverything_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonUnpinEverything_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            ButtonUnpinEverything.IsEnabled = false;

            // Loop through every secondary tile
            foreach (SecondaryTile tile in await SecondaryTile.FindAllAsync())
            {
                // Unpin each secondary tile
                await tile.RequestDeleteAsync();
            }

            ButtonUnpinEverything.IsEnabled = true;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/UnpinEverything/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Updating
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)
async void | ButtonUpdateTile_Click (object sender, RoutedEventArgs e)
void | stepsControl_StepChanged (object sender, int e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 15 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 17 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            // Generate a unique tile ID for the purposes of the sample
            _tileId = DateTime.Now.Ticks.ToString();

            // Initialize and pin a new secondary tile that we will later update
            SecondaryTile tile = new SecondaryTile(_tileId, "Original", "args", new Uri("ms-appx:///Assets/cancel.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/cancel.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/cancel.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/cancel.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            await tile.RequestCreateAsync();

            // And move to the next step
            stepsControl.Step++;

            base.IsEnabled = true;
        }

async void ButtonUpdateTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            // Grab the existing tile
            SecondaryTile tile = (await SecondaryTile.FindAllAsync()).FirstOrDefault(i => i.TileId.Equals(_tileId));
            if (tile == null)
            {
                await new MessageDialog("The secondary tile that was previously pinned could not be found. Has it been removed from Start?", "Error").ShowAsync();
                return;
            }

            // Change its name and logos
            tile.DisplayName = "Updated";
            tile.VisualElements.Square150x150Logo = new Uri("ms-appx:///Assets/check.png");
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/check.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/check.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/check.png");

            // And request its properties to be updated
            await tile.UpdateAsync();

            stepsControl.Step++;

            base.IsEnabled = true;
        }

void stepsControl_StepChanged | ( | object | sender,
 |  | int | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file ScenarioElement.xaml.cs.

        {
            switch (e)
            {
                case 1:
                    stepsControl.IsNextEnabled = true;
                    break;

                case 2:
                    stepsControl.IsNextEnabled = false;
                    break;

                case 3:
                    stepsControl.IsNextEnabled = true;
                    break;

                case 4:
                    stepsControl.IsNextEnabled = false;
                    break;

                default:
                    stepsControl.IsNextEnabled = true;
                    break;
            }
        }

Member Data Documentation

string _tileId [private]

Definition at line 22 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/Updating/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • QuickReply
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 59 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Set notification payload
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Action - quick reply</text>
                            <text>Make sure the toast has a ""check"" icon button to the right of the input box.</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            placeHolderContent = 'ignore me' />

                        <action
                            content='check'
                            imageUri='Assets/check.png'
                            activationType='foreground'
                            arguments='check'
                            hint-inputId='message'/>

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/QuickReply/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • Text
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 57 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Action - text</text>
                            <text>Make sure left button on the toast has the text ""ok"" on it, and the right button has the text ""cancel"" on it.</text>
                        </binding>
                    </visual>
                    <actions>

                        <action
                            content='ok'
                            activationType='foreground'
                            arguments='check'/>

                        <action
                            content='cancel'
                            activationType='foreground'
                            arguments='cancel'/>

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/Text/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • TextAndImage
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 59 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Action - text and image</text>
                            <text>Make sure the left button has a ""check"" icon with the text ""check"" below it, and the right button has a ""cancel"" icon with the text ""cancel"" below it.</text>
                        </binding>
                    </visual>
                    <actions>

                        <action
                            content='check'
                            imageUri='Assets/check.png'
                            activationType='foreground'
                            arguments='check'/>

                        <action
                            content='cancel'
                            imageUri='Assets/cancel.png'
                            activationType='foreground'
                            arguments='cancel'/>

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/TextAndImage/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • DefaultInput
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 53 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Input Text - Default Input</text>
                            <text>Make sure ""My default input"" is set as the text in the text box on this toast.</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            placeHolderContent = 'FAIL - this is placeholder content'
                            defaultInput = 'My default input' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/DefaultInput/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • PlaceholderContent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 52 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Input Text - Placeholder</text>
                            <text>Make sure ""My placeholder content"" is displayed as the placeholder content of the text box in this toast.</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            placeHolderContent = 'My placeholder content' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/PlaceholderContent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • RetrievingArgs
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | App_Activated (object sender, IActivatedEventArgs e)
async void | Error (string message)
void | Initialize ()
async void | validateStep1 (ValueSet result)

Detailed Description

Definition at line 17 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

async void App_Activated | ( | object | sender,
 |  | IActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file ScenarioElement.xaml.cs.

        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
            {
                var toastArgs = e as ToastNotificationActivatedEventArgs;
                if (toastArgs == null)
                    return;

                string arguments = toastArgs.Argument;

                if (arguments == null || !arguments.Equals("quickReply"))
                {
                    Error($"Expected arguments to be 'quickReply' but was '{arguments}'.");
                    return;
                }

                switch (stepsControl.Step)
                {
                    case 1:
                        validateStep1(toastArgs.UserInput);
                        break;
                }
            });
        }

async void Error ( string message ) [inline, private]

Definition at line 90 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Listen to activation event
            (Application.Current as App).Activated = new EventHandler<IActivatedEventArgs>(App_Activated);

            // Pop notifications
            popToastControlStep1.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Foreground with App Open</text>
                            <text>Make sure ""Windows 10"" is in the text box. Press ""submit"".</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'Message'
                            placeHolderContent = 'Enter ""Windows 10""'
                            defaultInput = 'Windows 10' />

                        <action activationType = 'foreground'
                                arguments = 'quickReply'
                                content = 'submit' />

                        <action activationType = 'foreground'
                                arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";
        }

async void validateStep1 ( ValueSet result ) [inline, private]

Definition at line 95 of file ScenarioElement.xaml.cs.

        {
            if (result.Count != 1)
                await new MessageDialog("ERROR: Expected 1 user input value, but there were " + result.Count).ShowAsync();

            else if (!result.ContainsKey("message"))
                await new MessageDialog("ERROR: Expected a user input value for 'message', but there was none.").ShowAsync();

            else if (!(result["message"] as string).Equals("Windows 10"))
                await new MessageDialog("ERROR: User input value for 'message' was not 'Windows 10'").ShowAsync();

            else
            {
                stepsControl.Step = int.MaxValue;
            }
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/RetrievingArgs/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • Title
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 52 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Input Text - Title</text>
                            <text>Make sure ""My Title"" is displayed as the title of the text box in this toast.</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'My Title' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/Title/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands
  • SnoozeAndDismiss
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 45 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args' scenario='reminder'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>SystemCommands SnoozeAndDismiss</text>
                            <text>Make sure there's a dropbox for selecting snooze interval, a snooze button, and a dismiss button. Actions should be handled by system.</text>
                        </binding>
                    </visual>
                    <actions hint-systemCommands = 'SnoozeAndDismiss' />
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/SystemCommands/SnoozeAndDismiss/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppClosed
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Initialize ()
async Task< bool > | RegisterBackgroundTask ()

Static Private Member Functions

static void | UnregisterBackgroundTask ()

Static Private Attributes

static readonly string | BACKGROUND_ENTRY_POINT = typeof(BackgroundTasks.ToastActivationTypeBackgroundClosedTask).FullName

Detailed Description

Definition at line 16 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

async void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Register background task
            if (!await RegisterBackgroundTask())
            {
                await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
                return;
            }

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='background' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Background with App Closed</text>
                            <text>Ensure the app is closed. Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'Message'
                            placeHolderContent = 'Enter ""Windows 10""'
                            defaultInput = 'Windows 10' />

                        <action activationType = 'background'
                                arguments = 'quickReply'
                                content = 'submit' />

                        <action activationType = 'background'
                                arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";
        }

async Task<bool> RegisterBackgroundTask ( ) [inline, private]

Definition at line 70 of file ScenarioElement.xaml.cs.

        {
            // Unregister any previous exising background task
            UnregisterBackgroundTask();

            // Request access
            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            // If denied
            if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
                return false;

            // Construct the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
            {
                Name = BACKGROUND_ENTRY_POINT,
                TaskEntryPoint = BACKGROUND_ENTRY_POINT
            };

            // Set trigger for Toast History Changed
            builder.SetTrigger(new ToastNotificationActionTrigger());

            // And register the background task
            BackgroundTaskRegistration registration = builder.Register();

            return true;
        }

static void UnregisterBackgroundTask ( ) [inline, static, private]

Definition at line 98 of file ScenarioElement.xaml.cs.

        {
            var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_ENTRY_POINT));

            if (task != null)
                task.Unregister(true);
        }

Member Data Documentation

readonly string BACKGROUND_ENTRY_POINT = typeof(BackgroundTasks.ToastActivationTypeBackgroundClosedTask).FullName [static, private]

Definition at line 18 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppClosed/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppOpen
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | BackgroundTask_Completed (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
async void | Initialize ()
void | OnResultReceived (ApplicationDataCompositeValue result)
async Task< bool > | RegisterBackgroundTask ()
async void | validateStep1 (ApplicationDataCompositeValue result)

Static Private Member Functions

static void | UnregisterBackgroundTask ()

Static Private Attributes

static readonly string | BACKGROUND_ENTRY_POINT = typeof(BackgroundTasks.ToastNotificationQuickReplyTask).FullName

Detailed Description

Definition at line 19 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 23 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

async void BackgroundTask_Completed | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 104 of file ScenarioElement.xaml.cs.

        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
            {
                string error = BackgroundTaskStorage.GetError();

                if (error != null)
                {
                    new MessageDialog(error, "Error").ShowAsync();
                    return;
                }

                ApplicationDataCompositeValue result = (ApplicationDataCompositeValue)BackgroundTaskStorage.GetAnswer();

                OnResultReceived(result);

            });
        }

async void Initialize ( ) [inline, private]

Definition at line 30 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Register background task
            if (!await RegisterBackgroundTask())
            {
                await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
                return;
            }

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='background' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Background with App Open</text>
                            <text>Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'Message'
                            placeHolderContent = 'Enter ""Windows 10""'
                            defaultInput = 'Windows 10' />

                        <action activationType = 'background'
                                arguments = 'quickReply'
                                content = 'submit' />

                        <action activationType = 'background'
                                arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";
        }

void OnResultReceived ( ApplicationDataCompositeValue result ) [inline, private]

Definition at line 123 of file ScenarioElement.xaml.cs.

        {
            switch (stepsControl.Step)
            {
                case 1:
                    validateStep1(result);
                    break;
            }
        }

async Task<bool> RegisterBackgroundTask ( ) [inline, private]

Definition at line 73 of file ScenarioElement.xaml.cs.

        {
            // Unregister any previous exising background task
            UnregisterBackgroundTask();

            // Request access
            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            // If denied
            if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
                return false;

            // Construct the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
            {
                Name = BACKGROUND_ENTRY_POINT,
                TaskEntryPoint = BACKGROUND_ENTRY_POINT
            };

            // Set trigger for Toast History Changed
            builder.SetTrigger(new ToastNotificationActionTrigger());

            // And register the background task
            BackgroundTaskRegistration registration = builder.Register();

            // And then listen for when the background task updates progress (it passes the toast change type)
            registration.Completed += BackgroundTask_Completed;

            return true;
        }

static void UnregisterBackgroundTask ( ) [inline, static, private]

Definition at line 151 of file ScenarioElement.xaml.cs.

        {
            var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_ENTRY_POINT));

            if (task != null)
                task.Unregister(true);
        }

async void validateStep1 ( ApplicationDataCompositeValue result ) [inline, private]

Definition at line 133 of file ScenarioElement.xaml.cs.

        {
            if (result.Count != 1)
                await new MessageDialog("ERROR: Expected 1 user input value, but there were " + result.Count).ShowAsync();

            else if (!result.ContainsKey("message"))
                await new MessageDialog("ERROR: Expected a user input value for 'message', but there was none.").ShowAsync();

            else if (!(result["message"] as string).Equals("Windows 10"))
                await new MessageDialog("ERROR: User input value for 'message' was not 'Windows 10'").ShowAsync();

            else
            {
                stepsControl.Step = int.MaxValue;
                UnregisterBackgroundTask();
            }
        }

Member Data Documentation

readonly string BACKGROUND_ENTRY_POINT = typeof(BackgroundTasks.ToastNotificationQuickReplyTask).FullName [static, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppOpen/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppClosed
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | App_Activated (object sender, IActivatedEventArgs e)
async void | Error (string message)
void | Initialize ()
void | ScenarioElement_Loaded (object sender, RoutedEventArgs e)
void | validateStep1 (ValueSet result)

Detailed Description

Definition at line 18 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            base.Loaded += ScenarioElement_Loaded;
        }

Member Function Documentation

async void App_Activated | ( | object | sender,
 |  | IActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 107 of file ScenarioElement.xaml.cs.

        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
            {
                var toastArgs = e as ToastNotificationActivatedEventArgs;
                if (toastArgs == null)
                    return;

                string arguments = toastArgs.Argument;

                if (arguments == null || !arguments.Equals("quickReply"))
                {
                    Error($"Expected arguments to be 'quickReply' but was '{arguments}'.");
                    return;
                }

                switch (stepsControl.Step)
                {
                    case 1:
                        validateStep1(toastArgs.UserInput);
                        break;
                }
            });
        }

async void Error ( string message ) [inline, private]

Definition at line 132 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 32 of file ScenarioElement.xaml.cs.

        {
            if (Settings.ScenarioToOpenWhenLaunchedOrActivated == this.GetType())
            {
                Settings.ScenarioToOpenWhenLaunchedOrActivated = null;

                if (App.ActivatedEventArgs == null)
                {
                    Error("OnActivated was not triggered.");
                    return;
                }

                if (App.ActivatedEventArgs.Kind != ActivationKind.ToastNotification)
                {
                    Error("Activated args kind was not ActivationKind.ToastNotification");
                    return;
                }

                var toastArgs = App.ActivatedEventArgs as ToastNotificationActivatedEventArgs;
                if (toastArgs == null)
                {
                    Error("Activated args was not of type ToastNotificationActivatedEventArgs.");
                    return;
                }

                string arguments = toastArgs.Argument;

                if (arguments == null || !arguments.Equals("quickReply"))
                {
                    Error($"Expected arguments to be 'quickReply' but was '{arguments}'.");
                    return;
                }

                validateStep1(toastArgs.UserInput);
                return;
            }

            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Foreground with App Closed</text>
                            <text>Close the app. Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'Message'
                            placeHolderContent = 'Enter ""Windows 10""'
                            defaultInput = 'Windows 10' />

                        <action activationType = 'foreground'
                                arguments = 'quickReply'
                                content = 'submit' />

                        <action activationType = 'foreground'
                                arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";

            // Have it open this scenario when the app is launched or activated
            Settings.ScenarioToOpenWhenLaunchedOrActivated = this.GetType();
        }

void ScenarioElement_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

void validateStep1 ( ValueSet result ) [inline, private]

Definition at line 137 of file ScenarioElement.xaml.cs.

        {
            if (result.Count != 1)
                Error("Expected 1 user input value, but there were " + result.Count);

            else if (!result.ContainsKey("message"))
                Error("Expected a user input value for 'message', but there was none.");

            else if (!(result["message"] as string).Equals("Windows 10"))
                Error("User input value for 'message' was not 'Windows 10'");

            else
            {
                stepsControl.Step = int.MaxValue;
            }
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppClosed/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppOpen
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | App_Activated (object sender, IActivatedEventArgs e)
async void | Error (string message)
void | Initialize ()
void | validateStep1 (ValueSet result)

Detailed Description

Definition at line 18 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

async void App_Activated | ( | object | sender,
 |  | IActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file ScenarioElement.xaml.cs.

        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
            {
                if (e.Kind != ActivationKind.ToastNotification)
                    return;

                var toastArgs = e as ToastNotificationActivatedEventArgs;
                if (toastArgs == null)
                {
                    Error("Activation args was not of type ToastNotificationActivatedEventArgs");
                    return;
                }

                string arguments = toastArgs.Argument;

                if (arguments == null || !arguments.Equals("quickReply"))
                {
                    Error($"Expected arguments to be 'quickReply' but was '{arguments}'. User input values...\n{ToastHelper.ToString(toastArgs.UserInput)}");
                    return;
                }

                switch (stepsControl.Step)
                {
                    case 1:
                        validateStep1(toastArgs.UserInput);
                        break;
                }
            });
        }

async void Error ( string message ) [inline, private]

Definition at line 97 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Listen to activation event
            (Application.Current as App).Activated = new EventHandler<IActivatedEventArgs>(App_Activated);

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='foreground' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Foreground with App Open</text>
                            <text>Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
                        </binding>
                    </visual>
                    <actions>

                        <input
                            id = 'message'
                            type = 'text'
                            title = 'Message'
                            placeHolderContent = 'Enter ""Windows 10""'
                            defaultInput = 'Windows 10' />

                        <action activationType = 'foreground'
                                arguments = 'quickReply'
                                content = 'submit' />

                        <action activationType = 'foreground'
                                arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";
        }

void validateStep1 ( ValueSet result ) [inline, private]

Definition at line 102 of file ScenarioElement.xaml.cs.

        {
            if (result.Count != 1)
                Error("Expected 1 user input value, but there were " + result.Count);

            else if (!result.ContainsKey("message"))
                Error("Expected a user input value for 'message', but there was none.");

            else if (!(result["message"] as string).Equals("Windows 10"))
                Error("User input value for 'message' was not 'Windows 10'");

            else
            {
                stepsControl.Step = int.MaxValue;
            }
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppOpen/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • Protocol
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 45 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast activationType='protocol' launch='bingmaps:?q=1+Microsoft+Way,+98052'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Click to launch Bing Maps</text>
                            <text>Searches for ""1 Microsoft Way, 98052""</text>
                        </binding>
                    </visual>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/Protocol/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • AutoContent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 51 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop reminder
            popToastControl.Payload =
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Dismiss (Auto Content)</text>
                            <text>The button for dismissing should be localized in your language, generated by the system when displaying the toast.</text>
                        </binding>
                    </visual>

                    <actions>

                        <action activationType='system' arguments='dismiss' content='' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/AutoContent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • CustomContent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 51 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop reminder
            popToastControl.Payload =
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Dismiss (Custom Content)</text>
                            <text>The button for dismissing should be localized in your language, generated by the system when displaying the toast.</text>
                        </binding>
                    </visual>

                    <actions>

                        <action activationType='system' arguments='dismiss' content='my dismiss' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/CustomContent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • Dismissing
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 51 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop reminder
            popToastControl.Payload =
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Dismiss (Dismissing)</text>
                            <text>Minimize the app/return to Start, click ""dismiss"", and then manually return to the app to continue to the next step.</text>
                        </binding>
                    </visual>

                    <actions>

                        <action activationType='system' arguments='dismiss' content='dismiss' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/Dismissing/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • AutoContent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 59 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop reminder
            popToastControl.Payload =
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Snoozing (Auto Content)</text>
                            <text>The button for snoozing should be localized in your language, generated by the system when displaying the toast.</text>
                        </binding>
                    </visual>

                    <actions>

                        <input id='snoozeTime' type='selection' defaultInput='1'>
                            <selection id='1' content = '1 minute'/>
                            <selection id='2' content = '2 minutes'/>
                            <selection id='5' content = '5 minutes'/>
                        </input>

                        <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content=''/>

                        <action activationType='system' arguments='dismiss' content='dismiss (ignore my text)' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/AutoContent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • CustomContent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 59 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop reminder
            popToastControl.Payload =
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Snoozing (Custom Content)</text>
                            <text>The button for snoozing should have the content ""my snooze"" on it.</text>
                        </binding>
                    </visual>

                    <actions>

                        <input id='snoozeTime' type='selection' defaultInput='1'>
                            <selection id='1' content = '1 minute'/>
                            <selection id='2' content = '2 minutes'/>
                            <selection id='5' content = '5 minutes'/>
                        </input>

                        <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content='my snooze'/>

                        <action activationType='system' arguments='dismiss' content='dismiss (ignore my text)' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/CustomContent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • Snoozing
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | TimerWaitForTwoMins_Tick (object sender, object e)
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 15 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 17 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 102 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 28 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop one to be snoozed for 1 min
            ToastHelper.PopCustomToast(
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Snoozing (1 min)</text>
                            <text>Make sure ""1 minute - PICK ME"" is selected, and click ""snooze"". This was created at {DateTime.Now.ToString("t")}.</text>
                        </binding>
                    </visual>

                    <actions>

                        <input id='snoozeTime' type='selection' defaultInput='1'>
                            <selection id='1' content = '1 minute - PICK ME'/>
                            <selection id='2' content = '2 minutes'/>
                            <selection id='5' content = '5 minutes'/>
                        </input>

                        <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content='snooze' />

                        <action activationType='system' arguments='dismiss' content='dismiss' />

                    </actions>
                </toast>"
                );

            // And another to be snoozed for 2 mins
            ToastHelper.PopCustomToast(
                $@"
                <toast scenario='reminder' launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>System Snoozing (2 min)</text>
                            <text>Make sure ""2 minutes - PICK ME"" is selected, and click ""snooze"". This was created at {DateTime.Now.ToString("t")}</text>
                        </binding>
                    </visual>

                    <actions>

                        <input id='snoozeTime' type='selection' defaultInput='2'>
                            <selection id='1' content = '1 minute'/>
                            <selection id='2' content = '2 minutes -  PICK ME'/>
                            <selection id='5' content = '5 minutes'/>
                        </input>

                        <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content='snooze' />

                        <action activationType='system' arguments='dismiss' content='dismiss' />

                    </actions>
                </toast>"
                );

            DispatcherTimer timerWaitForTwoMins = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMinutes(2)
            };
            timerWaitForTwoMins.Tick += TimerWaitForTwoMins_Tick;
            timerWaitForTwoMins.Start();
        }

void TimerWaitForTwoMins_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file ScenarioElement.xaml.cs.

        {
            (sender as DispatcherTimer).Stop();

            stepsControl.IsNextEnabled = true;
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/Snoozing/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppData
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
async void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Static Private Attributes

static readonly string | ABSOLUTE_FILE_NAME = "ms-appdata:///local/" + FILE_NAME
static readonly string | FILE_NAME = ".jpg"

Detailed Description

Definition at line 16 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 71 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

async void Initialize ( ) [inline, private]

Definition at line 31 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Load the image from our package files
            StorageFile fromPackage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/Image.jpg"));
            if (fromPackage == null)
            {
                Error("Failed to open image from application package. Normally, this would open the image from the app package, and then save it to local app data.");
                return;
            }

            try
            {
                await fromPackage.CopyAsync(ApplicationData.Current.LocalFolder, FILE_NAME, NameCollisionOption.ReplaceExisting);
            }

            catch
            {
                Error("Failed to copy the image from application package to local app data.");
                return;
            }

            image.Source = new BitmapImage(new Uri(ABSOLUTE_FILE_NAME));

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast scenario='reminder'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Image Src - From App Data</text>
                            <text>Make sure an image is displayed below this text.</text>
                            <image src='{ABSOLUTE_FILE_NAME}'/>
                        </binding>
                    </visual>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

Member Data Documentation

readonly string ABSOLUTE_FILE_NAME = "ms-appdata:///local/" + FILE_NAME [static, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

readonly string FILE_NAME = ".jpg" [static, private]

Definition at line 18 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppPackage
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 45 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast scenario='reminder'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Image Src - From App Package</text>
                            <text>Make sure an image is displayed below this text.</text>
                            <image src='ms-appx:///ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppPackage/Image.jpg'/>
                        </binding>
                    </visual>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppPackage/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromInternet
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | Error (string message)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Error ( string message ) [inline, private]

Definition at line 45 of file ScenarioElement.xaml.cs.

        {
            await new MessageDialog(message, "ERROR").ShowAsync();
        }

void Initialize ( ) [inline, private]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop notifications
            popToastControl.Payload =
                $@"
                <toast scenario='reminder'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Image Src - From Internet</text>
                            <text>Make sure an image is displayed below this text.</text>
                            <image src='http://hiking.andrewbares.net/trips/2/images/large/p193jj6k4e58c1c7k1486u8n6vt6.jpg'/>
                        </binding>
                    </visual>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromInternet/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Default
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void Initialize ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            // Specify the toast payload
            popToastControl.Payload =
$@"<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Default Audio Toast</text>
            <text>This toast's audio is not specified, and thus uses the system default.</text>
        </binding>
    </visual>

</toast>";
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Default/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • EmailSound
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void Initialize ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            // Specify the toast payload
            popToastControl.Payload =
$@"<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Email Audio Toast</text>
            <text>This toast's audio uses one of the system-provided sounds: Notification.Mail</text>
        </binding>
    </visual>

    <audio src='ms-winsoundevent:Notification.Mail'/>

</toast>";
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/EmailSound/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Looping
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void Initialize ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            // Specify the toast payload
            popToastControl.Payload =
$@"<toast scenario='incomingCall'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Looping Audio Toast</text>
            <text>This toast uses looping audio, useful for scenarios like phone calls.</text>
        </binding>
    </visual>
    <actions>
        <action arguments = 'answer'
                content = 'answer' />
        <action arguments = 'ignore'
                content = 'ignore' />
    </actions>

    <audio src='ms-winsoundevent:Notification.Looping.Call3' loop='true'/>

</toast>";
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Looping/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Silent
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void Initialize ()

Detailed Description

Definition at line 10 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 12 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            // Specify the toast payload
            popToastControl.Payload =
$@"<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Silent Toast</text>
            <text>This toast's audio is set to silent.</text>
        </binding>
    </visual>

    <audio silent='true'/>

</toast>";
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Silent/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ExpiringToast
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            var longTime = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("longtime");
            DateTimeOffset expiryTime = DateTime.Now.AddSeconds(30);
            string expiryTimeString = longTime.Format(expiryTime);

            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
            //Find the text component of the content
            XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");

            // Set the text on the toast.
            // The first line of text in the ToastText02 template is treated as header text, and will be bold.
            toastTextElements[0].AppendChild(toastXml.CreateTextNode("Expiring Toast"));
            toastTextElements[1].AppendChild(toastXml.CreateTextNode("It will expire at " +  expiryTimeString));

            // Set the duration on the toast
            IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
            ((XmlElement)toastNode).SetAttribute("duration", "long");

            // Create the actual toast object using this toast specification.
            ToastNotification toast = new ToastNotification(toastXml);

            toast.ExpirationTime = expiryTime;

            // Send the toast.
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ExpiringToast/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • GhostToast
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonTriggerGhostToast_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonTriggerGhostToast_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            XmlDocument toastXml = new XmlDocument();
            toastXml.LoadXml($@"
                <toast>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Ghost Toast</text>
                            <text>This toast silently appears into your Action Center.</text>
                        </binding>
                    </visual>
                </toast>");

            ToastNotification toast = new ToastNotification(toastXml)
            {
                SuppressPopup = true
            };
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/GhostToast/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • BadgeControl
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)
async void | Initialize ()
async Task< bool > | RegisterBackgroundTask ()

Static Private Member Functions

static void | UnregisterBackgroundTask ()

Private Attributes

string | _tileId

Static Private Attributes

static readonly string | BACKGROUND_TASK_NAME = "ToastNotificationHistoryChangedTriggerTask"

Detailed Description

Definition at line 21 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            Initialize();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file ScenarioElement.xaml.cs.

        {
            _tileId = "ScenarioBadgeControl";

            SecondaryTile tile = new SecondaryTile(_tileId, "Name 1", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            await tile.RequestCreateAsync();

            //Prepare for next Step:

            // Pop all the notifications
            ToastHelper.PopToast("Toast 1", "Content of Toast 1");
            ToastHelper.PopToast("Toast 2", "Content of Toast 2");
            ToastHelper.PopToast("Toast 3", "Content of Toast 3");

            //Update badge
            IReadOnlyList<ToastNotification> TNList = ToastNotificationManager.History.GetHistory();

            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent((uint)TNList.Count);

            // Send the notification to the application’s tile.
            BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(_tileId).Update(badgeContent.CreateNotification());

            // Move the UI to the next step
            stepsControl.Step++;
            stepsControl.NextButtonVisibility = Visibility.Collapsed;
        }

async void Initialize ( ) [inline, private]

Definition at line 32 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Register background task
            if (!await RegisterBackgroundTask())
            {
                await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
                return;
            }

            base.IsEnabled = true;
        }

async Task<bool> RegisterBackgroundTask ( ) [inline, private]

Definition at line 50 of file ScenarioElement.xaml.cs.

        {
            // Unregister any previous exising background task
            UnregisterBackgroundTask();

            // Request access
            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            // If denied
            if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
                return false;

            // Construct the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
            {
                Name = BACKGROUND_TASK_NAME,
                TaskEntryPoint = "BackgroundTasks.BadgeNotificationHistoryChangedTriggerTask"
            };

            // Set trigger for Toast History Changed
            builder.SetTrigger(new ToastNotificationHistoryChangedTrigger());

            // And register the background task
            BackgroundTaskRegistration registration = builder.Register();

            return true;
        }

static void UnregisterBackgroundTask ( ) [inline, static, private]

Definition at line 78 of file ScenarioElement.xaml.cs.

        {
            var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_TASK_NAME));

            if (task != null)
                task.Unregister(true);
        }

Member Data Documentation

string _tileId [private]

Definition at line 86 of file ScenarioElement.xaml.cs.

readonly string BACKGROUND_TASK_NAME = "ToastNotificationHistoryChangedTriggerTask" [static, private]

Definition at line 23 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/BadgeControl/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • RespondingToToasts
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | _timerStep3_Tick (object sender, object e)
void | BackgroundTask_Progress (BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args)
async void | Initialize ()
async void | OnHistoryChanged (ToastHistoryChangedType changedType)
async Task< bool > | RegisterBackgroundTask ()

Static Private Member Functions

static void | UnregisterBackgroundTask ()

Private Attributes

ObservableCollection
< ToastHistoryChangedType > 		_changeEvents = new ObservableCollection<ToastHistoryChangedType>()
int | _step = 1
DispatcherTimer | _timerStep3

Static Private Attributes

static readonly string | BACKGROUND_TASK_NAME = "ToastNotificationHistoryChangedTriggerTask"

Detailed Description

Definition at line 20 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 26 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            ItemsControlChangeEvents.ItemsSource = _changeEvents;

            Initialize();
        }

Member Function Documentation

void _timerStep3_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 170 of file ScenarioElement.xaml.cs.

        {
            (sender as DispatcherTimer).Stop();

            _step = 4;
            StackPanelStep3.Visibility = Visibility.Collapsed;
            StackPanelStep4.Visibility = Visibility.Visible;
        }

void BackgroundTask_Progress | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 92 of file ScenarioElement.xaml.cs.

        {
            ToastHistoryChangedType changedType = (ToastHistoryChangedType)args.Progress;

            CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
            {
                OnHistoryChanged(changedType);
            });
        }

async void Initialize ( ) [inline, private]

Definition at line 37 of file ScenarioElement.xaml.cs.

        {
            scrollViewer.IsEnabled = false;

            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Register background task
            if (!await RegisterBackgroundTask())
            {
                await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
                return;
            }

            // Pop all the notifications
            ToastHelper.PopToast("ignore me 1", "Content of ignore me 1");
            ToastHelper.PopToast("SWIPE ME", "Swipe me away");
            ToastHelper.PopToast("ignore me 2", "Content of ignore me 2");

            StackPanelStep1.Visibility = Visibility.Visible;

            scrollViewer.IsEnabled = true;
        }

async void OnHistoryChanged ( ToastHistoryChangedType changedType ) [inline, private]

Definition at line 104 of file ScenarioElement.xaml.cs.

        {
            _changeEvents.Add(changedType);

            switch (_step)
            {
                case 1:

                    if (changedType == ToastHistoryChangedType.Removed)
                    {
                        _step = 2;
                        StackPanelStep1.Visibility = Visibility.Collapsed;
                        StackPanelStep2.Visibility = Visibility.Visible;
                    }

                    else
                    {
                        await new MessageDialog("ERROR: Step 1 - expected Removed but was " + changedType).ShowAsync();
                    }

                    break;

                case 2:

                    if (changedType == ToastHistoryChangedType.Removed)
                    {
                        _step = 3;
                        StackPanelStep2.Visibility = Visibility.Collapsed;
                        StackPanelStep3.Visibility = Visibility.Visible;

                        _timerStep3 = new DispatcherTimer()
                        {
                            Interval = TimeSpan.FromSeconds(10)
                        };
                        _timerStep3.Tick += _timerStep3_Tick;
                        _timerStep3.Start();
                    }

                    else
                    {
                        await new MessageDialog("ERROR: Step 2 - expected Removed but was " + changedType).ShowAsync();
                    }

                    break;

                case 3:

                    if (_timerStep3 != null)
                        _timerStep3.Stop();

                    await new MessageDialog("ERROR: Step 3 - wasn't expecting any changes, but received " + changedType).ShowAsync();
                    break;

                case 4:
                    break;

                default:
                    throw new NotImplementedException("Didn't handle step " + _step);

            }
        }

async Task<bool> RegisterBackgroundTask ( ) [inline, private]

Definition at line 61 of file ScenarioElement.xaml.cs.

        {
            // Unregister any previous exising background task
            UnregisterBackgroundTask();

            // Request access
            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            // If denied
            if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
                return false;

            // Construct the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
            {
                Name = BACKGROUND_TASK_NAME,
                TaskEntryPoint = "BackgroundTasks.ToastNotificationHistoryChangedTriggerTask"
            };

            // Set trigger for Toast History Changed
            builder.SetTrigger(new ToastNotificationHistoryChangedTrigger());

            // And register the background task
            BackgroundTaskRegistration registration = builder.Register();

            // And then listen for when the background task updates progress (it passes the toast change type)
            registration.Progress += BackgroundTask_Progress;

            return true;
        }

static void UnregisterBackgroundTask ( ) [inline, static, private]

Definition at line 179 of file ScenarioElement.xaml.cs.

        {
            var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_TASK_NAME));

            if (task != null)
                task.Unregister(true);
        }

Member Data Documentation

ObservableCollection<ToastHistoryChangedType> _changeEvents = new ObservableCollection<ToastHistoryChangedType>() [private]

Definition at line 24 of file ScenarioElement.xaml.cs.

int _step = 1 [private]

Definition at line 35 of file ScenarioElement.xaml.cs.

DispatcherTimer _timerStep3 [private]

Definition at line 102 of file ScenarioElement.xaml.cs.

readonly string BACKGROUND_TASK_NAME = "ToastNotificationHistoryChangedTriggerTask" [static, private]

Definition at line 22 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/RespondingToToasts/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Alarm
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop incoming call notification
            popToastControl.Payload =
                $@"
                <toast launch='args' scenario='alarm'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Alarm</text>
                            <text>Second Line of Text</text>
                        </binding>
                    </visual>
                    <actions>

                        <action arguments = 'snooze'
                                content = 'snooze' />

                        <action arguments = 'dismiss'
                                content = 'dismiss' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Alarm/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Default
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop incoming call notification
            popToastControl.Payload =
                $@"
                <toast launch='args'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Default</text>
                            <text>Second Line of Text</text>
                        </binding>
                    </visual>
                    <actions>

                        <action arguments = 'ok'
                                content = 'ok' />

                        <action arguments = 'cancel'
                                content = 'cancel' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Default/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • IncomingCall
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop incoming call notification
            popToastControl.Payload =
                $@"
                <toast launch='args' scenario='incomingCall'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Incoming Call</text>
                            <text>Second Line of Text</text>
                        </binding>
                    </visual>
                    <actions>

                        <action arguments = 'answer'
                                content = 'answer' />

                        <action arguments = 'ignore'
                                content = 'ignore' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/IncomingCall/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Reminder
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 24 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop incoming call notification
            popToastControl.Payload =
                $@"
                <toast launch='args' scenario='reminder'>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Reminder</text>
                            <text>Second Line of Text</text>
                        </binding>
                    </visual>
                    <actions>

                        <action arguments = 'snooze'
                                content = 'snooze' />

                        <action arguments = 'dismiss'
                                content = 'dismiss' />

                    </actions>
                </toast>";
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Reminder/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • ClearAll
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | ButtonClearAll_Click (object sender, RoutedEventArgs e)
void | ButtonPopToasts_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonClearAll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file ScenarioElement.xaml.cs.

        {
            ButtonClearAll.IsEnabled = false;

            ToastNotificationManager.History.Clear();

            ButtonClearAll.IsEnabled = true;
        }

void ButtonPopToasts_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            ButtonPopToasts.IsEnabled = false;

            ToastHelper.PopToast("First toast", "This is the first toast");
            ToastHelper.PopToast("Second toast", "This is the second toast");
            ToastHelper.PopToast("Third toast", "This is the third toast");

            ButtonPopToasts.IsEnabled = true;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ClearAll/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory
  • Visualizer
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void ButtonUpdate_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 12 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 14 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();

            ButtonUpdate_Click(this, null);
        }

Member Function Documentation

void ButtonUpdate_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file ScenarioElement.xaml.cs.

        {
            var toasts = ToastNotificationManager.History.GetHistory();

            ListViewHistory.ItemsSource = toasts;
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/GetHistory/Visualizer/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTag
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | ButtonRemoveToast2_Click (object sender, RoutedEventArgs e)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 15 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonRemoveToast2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file ScenarioElement.xaml.cs.

        {
            ToastNotificationManager.History.Remove("toast2");
        }

void Initialize ( ) [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop the toasts
            ToastHelper.PopToast("Toast 1", "This is the first toast", "toast1", null);
            ToastHelper.PopToast("Toast 2 - TO BE REMOVED", "This is the second toast, should be removed when you click the button", "toast2", null);
            ToastHelper.PopToast("Toast 3", "This is the third toast", "toast3", null);
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTag/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTagAndGroup
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | ButtonRemoveToast2_Click (object sender, RoutedEventArgs e)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Static Private Attributes

static readonly string | GROUP_1 = "group1"
static readonly string | GROUP_2 = "group2"
static readonly string | TAG_1 = "tag1"
static readonly string | TAG_2 = "tag2"
static readonly string | TAG_3 = "tag3"

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonRemoveToast2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file ScenarioElement.xaml.cs.

        {
            ToastNotificationManager.History.Remove(TAG_2, GROUP_1);
        }

void Initialize ( ) [inline, private]

Definition at line 32 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop the toasts
            ToastHelper.PopToast("Group 1, Toast 1", "This is the first toast in group one", TAG_1, GROUP_1);
            ToastHelper.PopToast("Group 1, Toast 2 - TO BE REMOVED", "This is the second toast in group one, should be removed when you click the button", TAG_2, GROUP_1);
            ToastHelper.PopToast("Group 1, Toast 3", "This is the third toast in group one", TAG_3, GROUP_1);

            ToastHelper.PopToast("Group 2, Toast 1", "This is the first toast in group two", TAG_1, GROUP_2);
            ToastHelper.PopToast("Group 2, Toast 2", "This is the second toast in group two", TAG_2, GROUP_2);
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

Member Data Documentation

readonly string GROUP_1 = "group1" [static, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

readonly string GROUP_2 = "group2" [static, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

readonly string TAG_1 = "tag1" [static, private]

Definition at line 15 of file ScenarioElement.xaml.cs.

readonly string TAG_2 = "tag2" [static, private]

Definition at line 16 of file ScenarioElement.xaml.cs.

readonly string TAG_3 = "tag3" [static, private]

Definition at line 17 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTagAndGroup/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
  • ByGroup
  • ScenarioElement
Public Member Functions | Private Member Functions | Static Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | ButtonRemoveGroup1_Click (object sender, RoutedEventArgs e)
void | Initialize ()
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Static Private Attributes

static readonly string | GROUP_1 = "group1"
static readonly string | GROUP_2 = "group2"
static readonly string | TAG_1 = "tag1"
static readonly string | TAG_2 = "tag2"
static readonly string | TAG_3 = "tag3"

Detailed Description

Definition at line 13 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 22 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonRemoveGroup1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file ScenarioElement.xaml.cs.

        {
            ToastNotificationManager.History.RemoveGroup(GROUP_1);
        }

void Initialize ( ) [inline, private]

Definition at line 32 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            // Pop the toasts
            ToastHelper.PopToast("Group 1, Toast 1 - TO BE REMOVED", "This is the first toast in group one", TAG_1, GROUP_1);
            ToastHelper.PopToast("Group 1, Toast 2 - TO BE REMOVED", "This is the second toast in group one", TAG_2, GROUP_1);
            ToastHelper.PopToast("Group 1, Toast 3 - TO BE REMOVED", "This is the third toast in group one", TAG_3, GROUP_1);

            ToastHelper.PopToast("Group 2, Toast 1", "This is the first toast in group two", TAG_1, GROUP_2);
            ToastHelper.PopToast("Group 2, Toast 2", "This is the second toast in group two", TAG_2, GROUP_2);
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

Member Data Documentation

readonly string GROUP_1 = "group1" [static, private]

Definition at line 19 of file ScenarioElement.xaml.cs.

readonly string GROUP_2 = "group2" [static, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

readonly string TAG_1 = "tag1" [static, private]

Definition at line 15 of file ScenarioElement.xaml.cs.

readonly string TAG_2 = "tag2" [static, private]

Definition at line 16 of file ScenarioElement.xaml.cs.

readonly string TAG_3 = "tag3" [static, private]

Definition at line 17 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ByGroup/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Notifications
  • ScenarioPages
  • Toasts
  • UpdateToast
  • ScenarioElement
Public Member Functions | Private Member Functions

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

void | Initialize ()
void | Replace_Click (object sender, RoutedEventArgs e)
void | UserControl_Loaded (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 16 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Initialize ( ) [inline, private]

Definition at line 25 of file ScenarioElement.xaml.cs.

        {
            // Clear all existing notifications
            ToastNotificationManager.History.Clear();

            string textbox = ToastUpdateText.Text;

            ToastHelper.PopToast("The Textbox says:", textbox, "Replace", "Toast1");
        }

void Replace_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file ScenarioElement.xaml.cs.

        {
            if (String.IsNullOrEmpty(ToastUpdateText.Text))
            {
                return;
            }
            string textbox = ToastUpdateText.Text;
            ToastHelper.PopToast("The Textbox says:", textbox, "Replace", "Toast1");
        }

void UserControl_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file ScenarioElement.xaml.cs.

        {
            Initialize();
        }

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/Toasts/UpdateToast/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OmnidirectionalSound Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Types | Private Member Functions | Private Attributes

OmnidirectionalSound Class Reference

#include "OmnidirectionalSound.h"

List of all members.

Public Member Functions

virtual | ~OmnidirectionalSound ()
virtual | ~OmnidirectionalSound ()
float | GetDuration ()
HrtfEnvironment | GetEnvironment ()
HrtfEnvironment | GetEnvironment ()
HRESULT | GetInitializationStatus ()
HRESULT | Initialize (_In_ LPCWSTR filename, UINT32 const &loopCount)
HRESULT | Initialize (Windows::Media::SpeechSynthesis::SpeechSynthesisStream^stream, UINT32 const &loopCount)
HRESULT | Initialize (_In_ LPCWSTR filename)
HRESULT | OnUpdate (_In_ float angularVelocity, _In_ float height, _In_ float radius)
HRESULT | OnUpdate (_In_ Windows::Foundation::Numerics::float3 transform)
HRESULT | OnUpdate (_In_ float angularVelocity, _In_ float height, _In_ float radius)
HRESULT | SetEnvironment (_In_ HrtfEnvironment environment)
HRESULT | SetEnvironment (_In_ HrtfEnvironment environment)
HRESULT | Start ()
HRESULT | Start ()
HRESULT | Stop ()
HRESULT | Stop ()

Private Types

enum | SoundSourceType { File, Stream }

Private Member Functions

HrtfPosition | ComputePositionInOrbit (_In_ float height, _In_ float radius, _In_ float angle)
HrtfPosition | ComputePositionInOrbit (_In_ float height, _In_ float radius, _In_ float angle)

Private Attributes

float | _angle = 0
AudioFileReader _audioFile
AudioStreamReader _audioStream
float | _duration = 0.f
HrtfEnvironment | _environment = HrtfEnvironment::Outdoors
Microsoft::WRL::ComPtr
< IXAPOHrtfParameters > 		_hrtfParams
ComPtr< IXAPOHrtfParameters > | _hrtfParams
HRESULT | _initStatus
ULONGLONG | _lastTick = 0
SoundSourceType _sourceType
IXAudio2SourceVoice * | _sourceVoice = nullptr
Microsoft::WRL::ComPtr< IXAudio2 > | _xaudio2
ComPtr< IXAudio2 > | _xaudio2

Detailed Description

Definition at line 20 of file OmnidirectionalSound.h.

Member Enumeration Documentation

enum SoundSourceType [private]
Enumerator:
File
Stream

Definition at line 41 of file OmnidirectionalSound.h.

                         {
        File,
        Stream,
    };

Constructor & Destructor Documentation

~OmnidirectionalSound ( ) [virtual]

Definition at line 159 of file OmnidirectionalSound.cpp.

{
    if (_sourceVoice)
    {
        _sourceVoice->DestroyVoice();
    }
}

virtual ~OmnidirectionalSound ( ) [virtual]

Member Function Documentation

HrtfPosition ComputePositionInOrbit | ( | _In_ float | height,
 |  | _In_ float | radius,
 |  | _In_ float | angle |
 | ) |  |  | [private]
HrtfPosition ComputePositionInOrbit | ( | _In_ float | height,
 |  | _In_ float | radius,
 |  | _In_ float | angle |
 | ) |  |  | [private]
float GetDuration ( ) [inline]

Definition at line 34 of file OmnidirectionalSound.h.

{ return _duration; };

HrtfEnvironment GetEnvironment ( ) [inline]

Definition at line 27 of file OmnidirectionalSound.h.

{ return _environment; }

HrtfEnvironment GetEnvironment ( ) [inline]

Definition at line 33 of file OmnidirectionalSound.h.

{ return _environment; }

HRESULT GetInitializationStatus ( ) [inline]

Definition at line 29 of file OmnidirectionalSound.h.

{ return _initStatus; }

HRESULT Initialize | ( | _In_ LPCWSTR | filename,
 |  | UINT32 const & | loopCount
 | ) |  |
HRESULT Initialize | ( | Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ | stream,
 |  | UINT32 const & | loopCount
 | ) |  |
HRESULT Initialize ( _In_ LPCWSTR filename )
HRESULT OnUpdate | ( | _In_ float | angularVelocity,
 |  | _In_ float | height,
 |  | _In_ float | radius
 | ) |  |
HRESULT OnUpdate | ( | _In_ float | angularVelocity,
 |  | _In_ float | height,
 |  | _In_ float | radius
 | ) |  |
HRESULT OnUpdate ( _In_ Windows::Foundation::Numerics::float3 transform )
HRESULT SetEnvironment ( _In_ HrtfEnvironment environment )
HRESULT SetEnvironment ( _In_ HrtfEnvironment environment )
HRESULT Start ( )

Definition at line 167 of file OmnidirectionalSound.cpp.

{
    _lastTick = GetTickCount64();
    return _sourceVoice->Start();
}

HRESULT Start ( )
HRESULT Stop ( )
HRESULT Stop ( )

Definition at line 173 of file OmnidirectionalSound.cpp.

{
    return _sourceVoice->Stop();
}

Member Data Documentation

float _angle = 0 [private]

Definition at line 55 of file OmnidirectionalSound.h.

AudioFileReader _audioFile [private]

Definition at line 48 of file OmnidirectionalSound.h.

AudioStreamReader _audioStream [private]

Definition at line 49 of file OmnidirectionalSound.h.

float _duration = 0.f [private]

Definition at line 56 of file OmnidirectionalSound.h.

HrtfEnvironment _environment = HrtfEnvironment::Outdoors [private]

Definition at line 53 of file OmnidirectionalSound.h.

Microsoft::WRL::ComPtr<IXAPOHrtfParameters> _hrtfParams [private]

Definition at line 52 of file OmnidirectionalSound.h.

ComPtr<IXAPOHrtfParameters> _hrtfParams [private]

Definition at line 36 of file OmnidirectionalSound.h.

HRESULT _initStatus [private]

Definition at line 46 of file OmnidirectionalSound.h.

ULONGLONG _lastTick = 0 [private]

Definition at line 54 of file OmnidirectionalSound.h.

SoundSourceType _sourceType [private]

Definition at line 47 of file OmnidirectionalSound.h.

IXAudio2SourceVoice * _sourceVoice = nullptr [private]

Definition at line 51 of file OmnidirectionalSound.h.

Microsoft::WRL::ComPtr<IXAudio2> _xaudio2 [private]

Definition at line 50 of file OmnidirectionalSound.h.

ComPtr<IXAudio2> _xaudio2 [private]

Definition at line 34 of file OmnidirectionalSound.h.

The documentation for this class was generated from the following files:
  • HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.h
  • SpatialSound/cpp/OmnidirectionalSound.h
  • HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.cpp
  • SpatialSound/cpp/OmnidirectionalSound.cpp
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • App
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Private Attributes

const double | ONEHANDEDSIZE = 7

Detailed Description

Definition at line 25 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 35 of file App.xaml.cs.

        {

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 47 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                //Get the diagonal size of the integrated display
                var dsc = new DisplaySizeHelper.DisplaySizeClass();
                double _actualSizeInInches = dsc.GetDisplaySizeInInches();

                //If the diagonal size is <= 7" use the OneHanded optimized view
                if ( _actualSizeInInches >0 && _actualSizeInInches <= ONEHANDEDSIZE)
                {
                    rootFrame.Navigate(typeof(MainPage_OneHanded), e.Arguments);
                }
                else
                {
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 102 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 114 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

Member Data Documentation

const double ONEHANDEDSIZE = 7 [private]

Allows tracking page views, exceptions and other telemetry through the Microsoft Application Insights service.

Definition at line 30 of file App.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/App.xaml.cs
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • MainPage
Public Member Functions | Private Member Functions

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()

Private Member Functions

void | list_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | MainPage_Loaded (object sender, RoutedEventArgs e)
void | SplitViewButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 24 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 26 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();
            this.Loaded += MainPage_Loaded;
        }

Member Function Documentation

void list_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file MainPage.xaml.cs.

        {
            switch (list.SelectedIndex)
            {
                case 0:
                    mainContentPC.Content = new Collections();
                    break;
                case 1:
                    mainContentPC.Content = new Albums();
                    break;
                case 2:
                    mainContentPC.Content = new Settings();
                    break;
            }
        }

void MainPage_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file MainPage.xaml.cs.

        {
            list.SelectedIndex = 0;
        }

void SplitViewButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file MainPage.xaml.cs.

        {
            mainSplitview.IsPaneOpen = !mainSplitview.IsPaneOpen;
        }

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage_OneHanded Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • MainPage_OneHanded
Public Member Functions

MainPage_OneHanded Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage_OneHanded ()

Detailed Description

Definition at line 23 of file MainPage_OneHanded.xaml.cs.

Constructor & Destructor Documentation

MainPage_OneHanded ( ) [inline]

Definition at line 25 of file MainPage_OneHanded.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage_OneHanded.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Albums Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • UserControls
  • Albums
Public Member Functions | Private Attributes

Albums Class Reference

List of all members.

Public Member Functions

Albums ()

Private Attributes

MainViewModel vm = new MainViewModel()

Detailed Description

Definition at line 21 of file Albums.xaml.cs.

Constructor & Destructor Documentation

Albums ( ) [inline]

Definition at line 24 of file Albums.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = vm.GetAlbums();
        }

Member Data Documentation

MainViewModel vm = new MainViewModel() [private]

Definition at line 23 of file Albums.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Albums.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Collections Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • UserControls
  • Collections
Public Member Functions | Private Attributes

Collections Class Reference

List of all members.

Public Member Functions

Collections ()

Private Attributes

MainViewModel vm = new MainViewModel()

Detailed Description

Definition at line 21 of file Collections.xaml.cs.

Constructor & Destructor Documentation

Collections ( ) [inline]

Definition at line 24 of file Collections.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = vm.GetCollections();
        }

Member Data Documentation

MainViewModel vm = new MainViewModel() [private]

Definition at line 23 of file Collections.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Collections.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Settings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • UserControls
  • Settings
Public Member Functions

Settings Class Reference

List of all members.

Public Member Functions

Settings ()

Detailed Description

Definition at line 20 of file Settings.xaml.cs.

Constructor & Destructor Documentation

Settings ( ) [inline]

Definition at line 22 of file Settings.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Settings.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • ViewModel
  • MainViewModel
Public Member Functions | Properties | Private Attributes

MainViewModel Class Reference

List of all members.

Public Member Functions

ObservableCollection< Model > | GetAlbums ()
ObservableCollection< Model > | GetCollections ()

Properties

ObservableCollection< Model > | AlbumItems [get, set]
ObservableCollection< Model > | CollectionItems [get, set]

Private Attributes

ObservableCollection< Model > | _albumItems
ObservableCollection< Model > | _collectionItems

Detailed Description

Definition at line 10 of file MainViewModel.cs.

Member Function Documentation

ObservableCollection<Model> GetAlbums ( ) [inline]

Definition at line 37 of file MainViewModel.cs.

        {
            AlbumItems = new ObservableCollection<Model>();
            AlbumItems.Clear();
            for (int i = 1; i < 13; i++)
            {
                AlbumItems.Add(new Model { ImageUri = new Uri("ms-appx:///Images/LandscapeImage" + i.ToString() + ".jpg", UriKind.Absolute) });
            }
            return AlbumItems;
        }

ObservableCollection<Model> GetCollections ( ) [inline]

Definition at line 48 of file MainViewModel.cs.

        {
            CollectionItems = new ObservableCollection<Model>();
            CollectionItems.Clear();
            for (int i = 13; i <= 25; i++)
            {
                CollectionItems.Add(new Model { ImageUri = new Uri("ms-appx:///Images/LandscapeImage" + i.ToString() + ".jpg", UriKind.Absolute) });
            }
            return CollectionItems;
        }

Member Data Documentation

ObservableCollection<Model> _albumItems [private]

Definition at line 12 of file MainViewModel.cs.

ObservableCollection<Model> _collectionItems [private]

Definition at line 12 of file MainViewModel.cs.

Property Documentation

ObservableCollection<Model> AlbumItems [get, set]

Definition at line 14 of file MainViewModel.cs.

ObservableCollection<Model> CollectionItems [get, set]

Definition at line 26 of file MainViewModel.cs.

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/MainViewModel.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Model Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneHandedUse_TailoredMultipleViews
  • ViewModel
  • Model
Properties

Model Class Reference

List of all members.

Properties

Uri ImageUri [get, set]

Detailed Description

Definition at line 9 of file Model.cs.

Property Documentation

Uri ImageUri [get, set]

Definition at line 11 of file Model.cs.

The documentation for this class was generated from the following file:
  • XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/Model.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OneNotifications_UWP
  • ScenarioPages
  • LiveTiles
  • BasicState
  • CheckAllPropertiesCorrect
  • ScenarioElement
Public Member Functions | Private Member Functions | Private Attributes

ScenarioElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ScenarioElement ()

Private Member Functions

async void | ButtonPinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

string | _tileId

Detailed Description

Definition at line 27 of file ScenarioElement.xaml.cs.

Constructor & Destructor Documentation

ScenarioElement ( ) [inline]

Definition at line 29 of file ScenarioElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ButtonPinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file ScenarioElement.xaml.cs.

        {
            base.IsEnabled = false;

            _tileId = DateTime.Now.Ticks.ToString();

            SecondaryTile tile = new SecondaryTile(_tileId, "Transparent", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
            tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
            tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
            tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.VisualElements.ShowNameOnSquare310x310Logo = true;
            tile.VisualElements.ShowNameOnWide310x150Logo = true;
            tile.VisualElements.BackgroundColor = Colors.Transparent;
            await tile.RequestCreateAsync();

            base.IsEnabled = true;
        }

Member Data Documentation

string _tileId [private]

Definition at line 34 of file ScenarioElement.xaml.cs.

The documentation for this class was generated from the following file:
  • Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/CheckAllPropertiesCorrect/ScenarioElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • OpenCVBridge
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "OpenCVHelper.h"

List of all members.

Public Member Functions

void | Blur (Windows::Graphics::Imaging::SoftwareBitmap^input, Windows::Graphics::Imaging::SoftwareBitmap^output)
void | Contours (Windows::Graphics::Imaging::SoftwareBitmap^input, Windows::Graphics::Imaging::SoftwareBitmap^output)
void | Histogram (Windows::Graphics::Imaging::SoftwareBitmap^input, Windows::Graphics::Imaging::SoftwareBitmap^output)
void | HoughLines (Windows::Graphics::Imaging::SoftwareBitmap^input, Windows::Graphics::Imaging::SoftwareBitmap^output)
void | MotionDetector (Windows::Graphics::Imaging::SoftwareBitmap^input, Windows::Graphics::Imaging::SoftwareBitmap^output)
OpenCVHelper ()

Private Member Functions

bool | GetPointerToPixelData (Windows::Graphics::Imaging::SoftwareBitmap^bitmap, unsigned char **pPixelData, unsigned int *capacity)
bool | TryConvert (Windows::Graphics::Imaging::SoftwareBitmap^from, cv::Mat &convertedMat)

Private Attributes

cv::Mat | fgMaskMOG2
cv::Ptr< cv::BackgroundSubtractor > | pMOG2

Detailed Description

Definition at line 20 of file OpenCVHelper.h.

Member Function Documentation

void Blur | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | input,
 |  | Windows::Graphics::Imaging::SoftwareBitmap^ | output
 | ) |  |
void Contours | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | input,
 |  | Windows::Graphics::Imaging::SoftwareBitmap^ | output
 | ) |  |
bool GetPointerToPixelData | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | bitmap,
 |  | unsigned char ** | pPixelData,
 |  | unsigned int * | capacity |
 | ) |  |  | [private]
void Histogram | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | input,
 |  | Windows::Graphics::Imaging::SoftwareBitmap^ | output
 | ) |  |
void HoughLines | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | input,
 |  | Windows::Graphics::Imaging::SoftwareBitmap^ | output
 | ) |  |
void MotionDetector | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | input,
 |  | Windows::Graphics::Imaging::SoftwareBitmap^ | output
 | ) |  |
OpenCVHelper ( )
bool TryConvert | ( | Windows::Graphics::Imaging::SoftwareBitmap^ | from,
 |  | cv::Mat & | convertedMat |
 | ) |  |  | [private]

Member Data Documentation

cv::Mat fgMaskMOG2 [private]

Definition at line 43 of file OpenCVHelper.h.

cv::Ptr<cv::BackgroundSubtractor> pMOG2 [private]

Definition at line 44 of file OpenCVHelper.h.

The documentation for this class was generated from the following file:
  • CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OpQueue< T, TOperation > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

OpQueue< T, TOperation > Class Template Reference

#include "OpQueue.h"

List of all members.

Public Types

typedef ComPtrList< TOperation > | OpList

Public Member Functions

HRESULT | QueueOperation (TOperation *pOp)

Protected Member Functions

OpQueue (CRITICAL_SECTION &critsec)
virtual | ~OpQueue ()
virtual HRESULT | DispatchOperation (TOperation *pOp)=0
HRESULT | ProcessQueue ()
HRESULT | ProcessQueueAsync (IMFAsyncResult *pResult)
virtual HRESULT | ValidateOperation (TOperation *pOp)=0

Protected Attributes

CRITICAL_SECTION & | m_critsec
AsyncCallback< T > | m_OnProcessQueue
OpList m_OpQueue

Detailed Description

template<class T, class TOperation>
class OpQueue< T, TOperation >

Definition at line 99 of file OpQueue.h.

Member Typedef Documentation

typedef ComPtrList<TOperation> OpList

Definition at line 100 of file OpQueue.h.

Constructor & Destructor Documentation

OpQueue ( CRITICAL_SECTION & critsec ) [inline, protected]

Definition at line 112 of file OpQueue.h.

        : m_OnProcessQueue(static_cast<T *>(this), &OpQueue::ProcessQueueAsync),

virtual ~OpQueue ( ) [inline, protected, virtual]

Definition at line 118 of file OpQueue.h.

    {
    }

Member Function Documentation

virtual HRESULT DispatchOperation ( TOperation * pOp ) [protected, pure virtual]
HRESULT ProcessQueue ( ) [protected]

Definition at line 164 of file OpQueue.h.

{
    HRESULT hr = S_OK;
    if (m_OpQueue.GetCount() > 0)
    {
        hr = MFPutWorkItem2(
            MFASYNC_CALLBACK_QUEUE_STANDARD,    // Use the standard work queue.
            0,                                  // Default priority
            &m_OnProcessQueue,                  // Callback method.
            nullptr                             // State object.
            );
    }
    return hr;
}

HRESULT ProcessQueueAsync ( IMFAsyncResult * pResult ) [protected]

Definition at line 188 of file OpQueue.h.

{
    HRESULT hr = S_OK;
    TOperation *pOp = nullptr;

    EnterCriticalSection(&m_critsec);

    if (m_OpQueue.GetCount() > 0)
    {
        hr = m_OpQueue.GetFront(&pOp);

        if (SUCCEEDED(hr))
        {
            hr = ValidateOperation(pOp);
        }
        if (SUCCEEDED(hr))
        {
            hr = m_OpQueue.RemoveFront(nullptr);
        }
        if (SUCCEEDED(hr))
        {
            (void)DispatchOperation(pOp);
        }
    }

    if (pOp != nullptr)
    {
        pOp->Release();
    }

    LeaveCriticalSection(&m_critsec);
    return hr;
}

HRESULT QueueOperation ( TOperation * pOp )

Definition at line 139 of file OpQueue.h.

{
    HRESULT hr = S_OK;

    EnterCriticalSection(&m_critsec);

    hr = m_OpQueue.InsertBack(pOp);
    if (SUCCEEDED(hr))
    {
        hr = ProcessQueue();
    }

    LeaveCriticalSection(&m_critsec);
    return hr;
}

virtual HRESULT ValidateOperation ( TOperation * pOp ) [protected, pure virtual]

Member Data Documentation

CRITICAL_SECTION& m_critsec [protected]

Definition at line 124 of file OpQueue.h.

AsyncCallback<T> m_OnProcessQueue [protected]

Definition at line 125 of file OpQueue.h.

OpList m_OpQueue [protected]

Definition at line 123 of file OpQueue.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/OpQueue.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOnboardingConsumer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • IOnboardingConsumer

IOnboardingConsumer Interface Reference

#include "OnboardingConsumer.h"

Detailed Description

Definition at line 25 of file OnboardingConsumer.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOnboardingLegacySignals Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • IOnboardingLegacySignals
Public Attributes

IOnboardingLegacySignals Interface Reference

#include "OnboardingLegacySignals.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< OnboardingLegacySignals^,
OnboardingConnectionResultReceivedEventArgs^> 		ConnectionResultReceived

Detailed Description

Definition at line 27 of file OnboardingLegacySignals.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<OnboardingLegacySignals^, OnboardingConnectionResultReceivedEventArgs^> ConnectionResultReceived

Definition at line 29 of file OnboardingLegacySignals.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOnboardingProducer Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • IOnboardingProducer
Public Attributes

IOnboardingProducer Interface Reference

#include "OnboardingProducer.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< OnboardingProducer^,
Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^> 		SessionLost
event
Windows::Foundation::TypedEventHandler
< OnboardingProducer^,
Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^> 		SessionMemberAdded
event
Windows::Foundation::TypedEventHandler
< OnboardingProducer^,
Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^> 		SessionMemberRemoved
event
Windows::Foundation::TypedEventHandler
< OnboardingProducer^,
Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^> 		Stopped

Detailed Description

Definition at line 29 of file OnboardingProducer.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<OnboardingProducer^, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^> SessionLost

Definition at line 32 of file OnboardingProducer.h.

event Windows::Foundation::TypedEventHandler<OnboardingProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^> SessionMemberAdded

Definition at line 33 of file OnboardingProducer.h.

event Windows::Foundation::TypedEventHandler<OnboardingProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^> SessionMemberRemoved

Definition at line 34 of file OnboardingProducer.h.

event Windows::Foundation::TypedEventHandler<OnboardingProducer^, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^> Stopped

Definition at line 31 of file OnboardingProducer.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOnboardingService Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • IOnboardingService
Public Member Functions

IOnboardingService Interface Reference

#include "IOnboardingService.h"

Inherited by OnboardingService.

List of all members.

Public Member Functions

Windows::Foundation::IAsyncOperation
< OnboardingConfigureWiFiResult^> 		ConfigureWiFiAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
Windows::Foundation::IAsyncOperation
< OnboardingConnectResult^> 		ConnectAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetLastErrorResult^> 		GetLastErrorAsync (Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetScanInfoResult^> 		GetScanInfoAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetStateResult^> 		GetStateAsync (Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetVersionResult^> 		GetVersionAsync (Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingOffboardResult^> 		OffboardAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)

Detailed Description

Definition at line 25 of file IOnboardingService.h.

Member Function Documentation

Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^> ConfigureWiFiAsync | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ Platform::String^ | interfaceMemberSSID,
 |  | _In_ Platform::String^ | interfaceMemberPassphrase,
 |  | _In_ int16 | interfaceMemberAuthType
 | ) |  |
Windows::Foundation::IAsyncOperation<OnboardingConnectResult^> ConnectAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^> GetLastErrorAsync ( Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^> GetScanInfoAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^> GetStateAsync ( Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^> GetVersionAsync ( Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^> OffboardAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/IOnboardingService.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IOnboardingSignals Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • IOnboardingSignals
Public Attributes

IOnboardingSignals Interface Reference

#include "OnboardingSignals.h"

List of all members.

Public Attributes

event
Windows::Foundation::TypedEventHandler
< OnboardingSignals^,
OnboardingConnectionResultReceivedEventArgs^> 		ConnectionResultReceived

Detailed Description

Definition at line 27 of file OnboardingSignals.h.

Member Data Documentation

event Windows::Foundation::TypedEventHandler<OnboardingSignals^, OnboardingConnectionResultReceivedEventArgs^> ConnectionResultReceived

Definition at line 29 of file OnboardingSignals.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ISignalEmitter Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • ISignalEmitter

ISignalEmitter Interface Reference

#include "AllJoynHelpers.h"

Inherited by sealed [private].

Detailed Description

Definition at line 40 of file AllJoynHelpers.h.

The documentation for this interface was generated from the following file:
  • AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • org
  • alljoyn
  • Onboarding
  • sealed
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

#include "OnboardingConsumer.h"

Inherits org::alljoyn::Onboarding::ISignalEmitter.

List of all members.

Public Member Functions

virtual | ~OnboardingConsumer ()
virtual | ~OnboardingProducer ()
QStatus | AddSignalHandler (_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
AllJoynMessageArgStructure ()
void | BusAttachmentStateChanged (_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^sender, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^args)
void | CallConnectionResultReceived (_In_ OnboardingSignals^sender, _In_ OnboardingConnectionResultReceivedEventArgs^args)
void | CallConnectionResultReceived (_In_ OnboardingLegacySignals^sender, _In_ OnboardingConnectionResultReceivedEventArgs^args)
Windows::Foundation::IAsyncOperation
< OnboardingConfigureWiFiResult^> 		ConfigureWiFiAsync (_In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
Windows::Foundation::IAsyncOperation
< OnboardingConnectResult^> 		ConnectAsync ()
virtual
Windows::Foundation::IAsyncOperation
< OnboardingConnectResult^> 		ConnectAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
void | ConnectionResult (_In_ Onboarding^interfaceMemberArg)
void | ConnectionResult (_In_ Onboarding^interfaceMemberArg)
virtual
Windows::Foundation::Collections::IIterator
< Platform::Object^> 		First ()
virtual Platform::Object | GetAt (unsigned int index)
Windows::Foundation::IAsyncOperation
< OnboardingGetLastErrorResult^> 		GetLastErrorAsync ()
virtual
Windows::Foundation::IAsyncOperation
< OnboardingGetLastErrorResult^> 		GetLastErrorAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetScanInfoResult^> 		GetScanInfoAsync ()
virtual
Windows::Foundation::IAsyncOperation
< OnboardingGetScanInfoResult^> 		GetScanInfoAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetStateResult^> 		GetStateAsync ()
virtual
Windows::Foundation::IAsyncOperation
< OnboardingGetStateResult^> 		GetStateAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingGetVersionResult^> 		GetVersionAsync ()
virtual
Windows::Foundation::IAsyncOperation
< OnboardingGetVersionResult^> 		GetVersionAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
virtual
Windows::Foundation::IAsyncOperation
< OnboardingOffboardResult^> 		OffboardAsync (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
Windows::Foundation::IAsyncOperation
< OnboardingOffboardResult^> 		OffboardAsync ()
OnboardingConfigureWiFiCalledEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
OnboardingConnectCalledEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingConsumer (Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
int32 | OnboardingConsumer::Initialize (_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^serviceInfo)
OnboardingGetLastErrorRequestedEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingGetScanInfoCalledEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingGetStateRequestedEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingGetVersionRequestedEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingOffboardCalledEventArgs (_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info)
OnboardingProducer (Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
QStatus | OnPropertyGet (_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val)
QStatus | OnPropertySet (_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val)
void | OnSessionJoined (_In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner)
void | OnSessionLost (_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
void | OnSessionMemberAdded (_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
void | OnSessionMemberRemoved (_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
int32 | RemoveMemberFromSession (_In_ Platform::String^uniqueName)
void | Stop ()

Static Public Member Functions

static void | CallConnectionResultSignalHandler (_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message)
static
Windows::Foundation::IAsyncOperation
< OnboardingConsumer^> 		FromIdAsync (_In_ Platform::String^deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment)
static
Windows::Foundation::IAsyncOperation
< OnboardingConsumer^> 		FromIdAsync (_In_ Platform::String^deviceId)
static
Windows::Foundation::IAsyncOperation
< OnboardingGetVersionResult^> 		GetResultAsync (OnboardingGetVersionRequestedEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingGetScanInfoResult^> 		GetResultAsync (OnboardingGetScanInfoCalledEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingOffboardResult^> 		GetResultAsync (OnboardingOffboardCalledEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingConnectResult^> 		GetResultAsync (OnboardingConnectCalledEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingConfigureWiFiResult^> 		GetResultAsync (OnboardingConfigureWiFiCalledEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingGetStateResult^> 		GetResultAsync (OnboardingGetStateRequestedEventArgs^args)
static
Windows::Foundation::IAsyncOperation
< OnboardingGetLastErrorResult^> 		GetResultAsync (OnboardingGetLastErrorRequestedEventArgs^args)

Properties

internal | __pad0__: bool OnAcceptSessionJoiner(_In_ alljoyn_sessionport sessionPort
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionMemberAdded
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionMemberRemoved
internal _In_ PCSTR | joiner
Windows::Devices::AllJoyn::AllJoynBusAttachment | m_busAttachment
Windows::Devices::AllJoyn::AllJoynBusObject | m_busObject
Onboarding | m_interfaceMemberArg
static PCSTR | m_interfaceName
alljoyn_busattachment | m_nativeBusAttachment
alljoyn_busobject | m_nativeBusObject
alljoyn_proxybusobject | m_proxyBusObject
Platform::String | m_ServiceObjectPath
Windows::Devices::AllJoyn::AllJoynSession | m_session
alljoyn_sessionlistener | m_sessionListener
OnboardingSignals | m_signals
int16 | m_value2
Platform::String | m_value2
Platform::WeakReference * | m_weak
internal _In_ PCSTR _In_ const
alljoyn_sessionopts 		opts
static std::map
< alljoyn_interfacedescription,
Platform::WeakReference * > 		SourceInterfaces

Private Member Functions

QStatus | AddMethodHandler (_In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_methodhandler_ptr handler)
QStatus | AddSignalHandler (_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
void | Complete ()
void | Complete ()
void | Complete ()
void | Complete ()
void | Complete ()
void | Complete ()
void | Complete ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeAllFinished ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | InvokeCompleteHandler ()
void | UnregisterFromBus ()

Static Private Member Functions

static void | CallConfigureWiFiHandler (_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message)
static void | CallConnectHandler (_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message)
static void | CallConnectionResultSignalHandler (_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message)
static void | CallGetScanInfoHandler (_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message)
static void | CallOffboardHandler (_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message)

Private Attributes

event
Windows::Foundation::EventHandler
< Platform::Object^> 		_ConfigureWiFiCalled
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_ConnectCalled
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_ConnectionResultReceived
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_GetLastErrorRequested
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_GetScanInfoCalled
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_GetStateRequested
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_GetVersionRequested
event
Windows::Foundation::EventHandler
< Platform::Object^> 		_OffboardCalled
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_SessionLost
virtual event
Windows::Foundation::EventHandler
< Platform::Object^> 		_Stopped
Windows::Foundation::EventRegistrationToken | m_busAttachmentStateChangedToken
alljoyn_busobject | m_busObject
int | m_completionsRequired
OnboardingConsumer | m_consumer
ISignalEmitter m_emitter
uint16 | m_interfaceMemberAge
int16 | m_interfaceMemberAuthType
Platform::String | m_interfaceMemberPassphrase
Windows::Foundation::Collections::IVector
< OnboardingScanListItem^> 		m_interfaceMemberScanList
Platform::String | m_interfaceMemberSSID
int16 | m_interfaceMemberStatus2
std::mutex | m_lock
alljoyn_interfacedescription_member | m_memberConnectionResult
Windows::Devices::AllJoyn::AllJoynMessageInfo | m_messageInfo
bool | m_raised
OnboardingConfigureWiFiResult | m_result
OnboardingGetLastErrorResult | m_result
OnboardingConnectResult | m_result
OnboardingOffboardResult | m_result
OnboardingGetScanInfoResult | m_result
OnboardingGetVersionResult | m_result
OnboardingGetStateResult | m_result
IOnboardingService m_serviceInterface
alljoyn_sessionid | m_sessionId
alljoyn_sessionport | m_sessionPort
alljoyn_sessionportlistener | m_sessionPortListener
OnboardingLegacySignals | m_signals
int32 | m_status
concurrency::task_completion_event
< OnboardingGetScanInfoResult^> 		m_tce
concurrency::task_completion_event
< OnboardingGetLastErrorResult^> 		m_tce
concurrency::task_completion_event
< OnboardingGetStateResult^> 		m_tce
concurrency::task_completion_event
< OnboardingConnectResult^> 		m_tce
concurrency::task_completion_event
< OnboardingOffboardResult^> 		m_tce
concurrency::task_completion_event
< OnboardingGetVersionResult^> 		m_tce
concurrency::task_completion_event
< OnboardingConfigureWiFiResult^> 		m_tce
int16 | m_value
uint16 | m_value
OnboardingLastError | m_value

Static Private Attributes

static std::map
< alljoyn_busobject,
Platform::WeakReference * > 		SourceObjects

Detailed Description

Definition at line 29 of file OnboardingConsumer.h.

Constructor & Destructor Documentation

virtual ~OnboardingConsumer ( ) [virtual]
virtual ~OnboardingProducer ( ) [virtual]

Member Function Documentation

QStatus AddMethodHandler | ( | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_methodhandler_ptr | handler |
 | ) |  |  | [private]
QStatus AddSignalHandler | ( | _In_ alljoyn_busattachment | busAttachment,
 |  | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_signalhandler_ptr | handler |
 | ) |  |  | [private]
QStatus AddSignalHandler | ( | _In_ alljoyn_busattachment | busAttachment,
 |  | _In_ alljoyn_interfacedescription | interfaceDescription,
 |  | _In_ PCSTR | methodName,
 |  | _In_ alljoyn_messagereceiver_signalhandler_ptr | handler
 | ) |  |
AllJoynMessageArgStructure ( ) [inline]

Definition at line 88 of file OnboardingStructures.h.

    {
        m_vector = ref new Platform::Collections::Vector<Platform::Object^>();
    }

void BusAttachmentStateChanged | ( | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | sender,
 |  | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^ | args
 | ) |  |
static void CallConfigureWiFiHandler | ( | _Inout_ alljoyn_busobject | busObject,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
static void CallConnectHandler | ( | _Inout_ alljoyn_busobject | busObject,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
void CallConnectionResultReceived | ( | _In_ OnboardingSignals^ | sender,
 |  | _In_ OnboardingConnectionResultReceivedEventArgs^ | args
 | ) |  |
void CallConnectionResultReceived | ( | _In_ OnboardingLegacySignals^ | sender,
 |  | _In_ OnboardingConnectionResultReceivedEventArgs^ | args
 | ) |  |
static void CallConnectionResultSignalHandler | ( | _In_ const alljoyn_interfacedescription_member * | member,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static]
static void CallConnectionResultSignalHandler | ( | _In_ const alljoyn_interfacedescription_member * | member,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
static void CallGetScanInfoHandler | ( | _Inout_ alljoyn_busobject | busObject,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
static void CallOffboardHandler | ( | _Inout_ alljoyn_busobject | busObject,
 |  | _In_ alljoyn_message | message |
 | ) |  |  | [static, private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
void Complete ( ) [private]
Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^> ConfigureWiFiAsync | ( | _In_ Platform::String^ | interfaceMemberSSID,
 |  | _In_ Platform::String^ | interfaceMemberPassphrase,
 |  | _In_ int16 | interfaceMemberAuthType
 | ) |  |
virtual Windows::Foundation::IAsyncOperation<OnboardingConnectResult^> ConnectAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
Windows::Foundation::IAsyncOperation<OnboardingConnectResult^> ConnectAsync ( )
void ConnectionResult ( _In_ Onboarding^ interfaceMemberArg )
void ConnectionResult ( _In_ Onboarding^ interfaceMemberArg )
virtual Windows::Foundation::Collections::IIterator<Platform::Object^> First ( ) [inline, virtual]

Definition at line 93 of file OnboardingStructures.h.

    {
        return m_vector->First();
    }

static Windows::Foundation::IAsyncOperation<OnboardingConsumer^> FromIdAsync ( _In_ Platform::String^ deviceId ) [static]
static Windows::Foundation::IAsyncOperation<OnboardingConsumer^> FromIdAsync | ( | _In_ Platform::String^ | deviceId,
 |  | _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ | busAttachment |
 | ) |  |  | [static]
virtual Platform::Object GetAt ( unsigned int index ) [inline, virtual]

Definition at line 98 of file OnboardingStructures.h.

    {
        return m_vector->GetAt(index);
    }

virtual Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^> GetLastErrorAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^> GetLastErrorAsync ( )
static Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^> GetResultAsync ( OnboardingGetStateRequestedEventArgs^ args ) [inline, static]

Definition at line 268 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingGetStateResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^> GetResultAsync ( OnboardingGetLastErrorRequestedEventArgs^ args ) [inline, static]

Definition at line 309 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingGetLastErrorResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^> GetResultAsync ( OnboardingConfigureWiFiCalledEventArgs^ args ) [inline, static]

Definition at line 59 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingConfigureWiFiResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingConnectResult^> GetResultAsync ( OnboardingConnectCalledEventArgs^ args ) [inline, static]

Definition at line 103 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingConnectResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^> GetResultAsync ( OnboardingOffboardCalledEventArgs^ args ) [inline, static]

Definition at line 144 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingOffboardResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^> GetResultAsync ( OnboardingGetScanInfoCalledEventArgs^ args ) [inline, static]

Definition at line 185 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingGetScanInfoResult^>
        {
            return t;
        });
    }

static Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^> GetResultAsync ( OnboardingGetVersionRequestedEventArgs^ args ) [inline, static]

Definition at line 227 of file OnboardingServiceEventArgs.h.

    {
        args->InvokeAllFinished();
        auto t = concurrency::create_task(args->m_tce);
        return concurrency::create_async([t]() -> concurrency::task<OnboardingGetVersionResult^>
        {
            return t;
        });
    }

Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^> GetScanInfoAsync ( )
virtual Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^> GetScanInfoAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^> GetStateAsync ( )
virtual Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^> GetStateAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^> GetVersionAsync ( )
virtual Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^> GetVersionAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeAllFinished ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
void InvokeCompleteHandler ( ) [private]
Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^> OffboardAsync ( )
virtual Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^> OffboardAsync ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info ) [virtual]
OnboardingConfigureWiFiCalledEventArgs | ( | _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ | info,
 |  | _In_ Platform::String^ | interfaceMemberSSID,
 |  | _In_ Platform::String^ | interfaceMemberPassphrase,
 |  | _In_ int16 | interfaceMemberAuthType
 | ) |  |
OnboardingConnectCalledEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingConsumer ( Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment )
int32 OnboardingConsumer::Initialize ( _In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^ serviceInfo )
OnboardingGetLastErrorRequestedEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingGetScanInfoCalledEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingGetStateRequestedEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingGetVersionRequestedEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingOffboardCalledEventArgs ( _In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info )
OnboardingProducer ( Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment )
QStatus OnPropertyGet | ( | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _Inout_ alljoyn_msgarg | val
 | ) |  |
QStatus OnPropertySet | ( | _In_ PCSTR | interfaceName,
 |  | _In_ PCSTR | propertyName,
 |  | _In_ alljoyn_msgarg | val
 | ) |  |
void OnSessionJoined | ( | _In_ alljoyn_sessionport | sessionPort,
 |  | _In_ alljoyn_sessionid | id,
 |  | _In_ PCSTR | joiner
 | ) |  |
void OnSessionLost | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ alljoyn_sessionlostreason | reason
 | ) |  |
void OnSessionMemberAdded | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName
 | ) |  |
void OnSessionMemberRemoved | ( | _In_ alljoyn_sessionid | sessionId,
 |  | _In_ PCSTR | uniqueName
 | ) |  |
int32 RemoveMemberFromSession ( _In_ Platform::String^ uniqueName )
void Stop ( )
void UnregisterFromBus ( ) [private]

Member Data Documentation

event Windows::Foundation::EventHandler<Platform::Object^> _ConfigureWiFiCalled [private]

Definition at line 193 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _ConnectCalled [private]

Definition at line 194 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler< Platform::Object^> _ConnectionResultReceived [private]

Definition at line 69 of file OnboardingLegacySignals.h.

event Windows::Foundation::EventHandler<Platform::Object^> _GetLastErrorRequested [private]

Definition at line 199 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _GetScanInfoCalled [private]

Definition at line 196 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _GetStateRequested [private]

Definition at line 198 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _GetVersionRequested [private]

Definition at line 197 of file OnboardingServiceEventAdapter.h.

event Windows::Foundation::EventHandler<Platform::Object^> _OffboardCalled [private]

Definition at line 195 of file OnboardingServiceEventAdapter.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> _SessionLost [private]

Definition at line 205 of file OnboardingProducer.h.

virtual event Windows::Foundation::EventHandler<Platform::Object^> _Stopped [private]

Definition at line 204 of file OnboardingProducer.h.

Windows::Foundation::EventRegistrationToken m_busAttachmentStateChangedToken [private]

Definition at line 228 of file OnboardingProducer.h.

alljoyn_busobject m_busObject [private]

Definition at line 66 of file OnboardingLegacySignals.h.

int m_completionsRequired [private]

Definition at line 75 of file OnboardingServiceEventArgs.h.

OnboardingConsumer m_consumer [private]

Definition at line 200 of file OnboardingMethodResults.h.

ISignalEmitter m_emitter [private]

Definition at line 66 of file OnboardingSignals.h.

uint16 m_interfaceMemberAge [private]

Definition at line 177 of file OnboardingMethodResults.h.

int16 m_interfaceMemberAuthType [private]

Definition at line 82 of file OnboardingServiceEventArgs.h.

Platform::String m_interfaceMemberPassphrase [private]

Definition at line 81 of file OnboardingServiceEventArgs.h.

Windows::Foundation::Collections::IVector<OnboardingScanListItem^> m_interfaceMemberScanList [private]

Definition at line 178 of file OnboardingMethodResults.h.

Platform::String m_interfaceMemberSSID [private]

Definition at line 80 of file OnboardingServiceEventArgs.h.

int16 m_interfaceMemberStatus2 [private]

Definition at line 66 of file OnboardingMethodResults.h.

std::mutex m_lock [private]

Definition at line 77 of file OnboardingServiceEventArgs.h.

alljoyn_interfacedescription_member m_memberConnectionResult [private]

Definition at line 71 of file OnboardingLegacySignals.h.

Windows::Devices::AllJoyn::AllJoynMessageInfo m_messageInfo [private]

Definition at line 78 of file OnboardingServiceEventArgs.h.

bool m_raised [private]

Definition at line 74 of file OnboardingServiceEventArgs.h.

OnboardingConfigureWiFiResult m_result [private]

Definition at line 79 of file OnboardingServiceEventArgs.h.

OnboardingConnectResult m_result [private]

Definition at line 123 of file OnboardingServiceEventArgs.h.

OnboardingGetLastErrorResult m_result [private]

Definition at line 329 of file OnboardingServiceEventArgs.h.

OnboardingOffboardResult m_result [private]

Definition at line 164 of file OnboardingServiceEventArgs.h.

OnboardingGetScanInfoResult m_result [private]

Definition at line 205 of file OnboardingServiceEventArgs.h.

OnboardingGetVersionResult m_result [private]

Definition at line 247 of file OnboardingServiceEventArgs.h.

OnboardingGetStateResult m_result [private]

Definition at line 288 of file OnboardingServiceEventArgs.h.

IOnboardingService m_serviceInterface [private]

Definition at line 230 of file OnboardingProducer.h.

alljoyn_sessionid m_sessionId [private]

Definition at line 67 of file OnboardingLegacySignals.h.

alljoyn_sessionport m_sessionPort [private]

Definition at line 236 of file OnboardingProducer.h.

alljoyn_sessionportlistener m_sessionPortListener [private]

Definition at line 234 of file OnboardingProducer.h.

OnboardingLegacySignals m_signals [private]

Definition at line 229 of file OnboardingProducer.h.

int32 m_status [private]

Definition at line 62 of file OnboardingMethodResults.h.

concurrency::task_completion_event<OnboardingOffboardResult^> m_tce [private]

Definition at line 161 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingGetStateResult^> m_tce [private]

Definition at line 285 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingConnectResult^> m_tce [private]

Definition at line 120 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingGetVersionResult^> m_tce [private]

Definition at line 244 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingConfigureWiFiResult^> m_tce [private]

Definition at line 76 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingGetLastErrorResult^> m_tce [private]

Definition at line 326 of file OnboardingServiceEventArgs.h.

concurrency::task_completion_event<OnboardingGetScanInfoResult^> m_tce [private]

Definition at line 202 of file OnboardingServiceEventArgs.h.

int16 m_value [private]

Definition at line 282 of file OnboardingMethodResults.h.

uint16 m_value [private]

Definition at line 241 of file OnboardingMethodResults.h.

OnboardingLastError m_value [private]

Definition at line 323 of file OnboardingMethodResults.h.

std::map<alljoyn_busobject, Platform::WeakReference*> SourceObjects [static, private]

Definition at line 245 of file OnboardingProducer.h.

Property Documentation

internal __pad0__

Definition at line 154 of file OnboardingProducer.h.

event Windows::Foundation::EventHandler< Platform::Object^> _SessionMemberAdded

Definition at line 112 of file OnboardingConsumer.h.

event Windows::Foundation::EventHandler< Platform::Object^> _SessionMemberRemoved

Definition at line 129 of file OnboardingConsumer.h.

internal _In_ PCSTR joiner

Definition at line 154 of file OnboardingProducer.h.

Windows::Devices::AllJoyn::AllJoynBusAttachment m_busAttachment

Definition at line 137 of file OnboardingConsumer.h.

alljoyn_busobject m_busObject

Definition at line 138 of file OnboardingConsumer.h.

Onboarding m_interfaceMemberArg

Definition at line 44 of file OnboardingEventArgs.h.

PCSTR m_interfaceName [static]

Definition at line 157 of file OnboardingConsumer.h.

alljoyn_busattachment m_nativeBusAttachment

Definition at line 146 of file OnboardingConsumer.h.

alljoyn_busobject m_nativeBusObject

Definition at line 145 of file OnboardingConsumer.h.

alljoyn_proxybusobject m_proxyBusObject

Definition at line 143 of file OnboardingConsumer.h.

Platform::String m_ServiceObjectPath

Definition at line 141 of file OnboardingConsumer.h.

Windows::Devices::AllJoyn::AllJoynSession m_session

Definition at line 139 of file OnboardingConsumer.h.

alljoyn_sessionlistener m_sessionListener

Definition at line 144 of file OnboardingConsumer.h.

OnboardingSignals m_signals

Definition at line 140 of file OnboardingConsumer.h.

Platform::String m_value2

Definition at line 41 of file OnboardingStructures.h.

Platform::String m_value2

Definition at line 61 of file OnboardingStructures.h.

Platform::WeakReference * m_weak

Definition at line 149 of file OnboardingConsumer.h.

internal _In_ PCSTR _In_ const alljoyn_sessionopts opts

Definition at line 154 of file OnboardingProducer.h.

static std::map< alljoyn_interfacedescription, Platform::WeakReference * > SourceInterfaces [static]

Definition at line 154 of file OnboardingConsumer.h.

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingEventArgs.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingMethodResults.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingStructures.h
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectedTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Osrusbfx2Task
  • ConnectedTask
Public Member Functions

ConnectedTask Class Reference

List of all members.

Public Member Functions

void Run (IBackgroundTaskInstance taskInstance)

Detailed Description

Definition at line 18 of file ConnectedTask.cs.

Member Function Documentation

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 20 of file ConnectedTask.cs.

        {
            string xml = $@"<toast activationType='foreground'>
                              <visual>
                                <binding template='ToastGeneric'>
                                  <text>CustomCapability Sample</text>
                                  <text>Osrfx2usb device connected.</text>
                                </binding>
                              </visual>
                            </toast>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            var toast = new ToastNotification(doc);
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

The documentation for this class was generated from the following file:
  • CustomCapability/Service/Osrusbfx2Task/ConnectedTask.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApduResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • ApduResponse
Public Member Functions

ApduResponse Class Reference

PCSC Apdu response. More...

Inherits Iso7816::ApduResponse.

Inherited by ApduResponse, ApduResponse, ApduResponse, and ApduResponse.

List of all members.

Public Member Functions

ApduResponse ()

Detailed Description

Definition at line 255 of file Pcsc.cs.

Constructor & Destructor Documentation

ApduResponse ( ) [inline]

Reimplemented from ApduResponse.

Reimplemented in ApduResponse, ApduResponse, ApduResponse, and ApduResponse.

Definition at line 257 of file Pcsc.cs.

            : base()
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AtrInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • Common
  • AtrInfo
Public Member Functions | Public Attributes | Properties

AtrInfo Class Reference

List of all members.

Public Member Functions

AtrInfo ()

Public Attributes

const int | MAXIMUM_ATR_CODES = 4

Properties

IBuffer | HistoricalBytes [get, set]
byte[] | ProtocolInterfaceA [get, set]
byte[] | ProtocolInterfaceB [get, set]
byte[] | ProtocolInterfaceC [get, set]
byte[] | ProtocolInterfaceD [get, set]
bool | TckValid [get, set]

Detailed Description

Definition at line 17 of file AtrParser.cs.

Constructor & Destructor Documentation

AtrInfo ( ) [inline]

Helper class that holds information about the ICC Answer-To-Reset (ATR) information such as interface character and offset and length of the historical bytes.

It also hold info about the validity of the TCK byte.

Definition at line 25 of file AtrParser.cs.

        {
            ProtocolInterfaceA = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
            ProtocolInterfaceB = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
            ProtocolInterfaceC = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
            ProtocolInterfaceD = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };

            HistoricalBytes = null;
        }

Member Data Documentation

const int MAXIMUM_ATR_CODES = 4

Definition at line 19 of file AtrParser.cs.

Property Documentation

IBuffer HistoricalBytes [get, set]

Historical bytes if present.

Definition at line 53 of file AtrParser.cs.

byte [] ProtocolInterfaceA [get, set]

Protocol interface characters TAi.

Definition at line 37 of file AtrParser.cs.

byte [] ProtocolInterfaceB [get, set]

Protocol interface characters TBi.

Definition at line 41 of file AtrParser.cs.

byte [] ProtocolInterfaceC [get, set]

Protocol interface characters TCi.

Definition at line 45 of file AtrParser.cs.

byte [] ProtocolInterfaceD [get, set]

Protocol interface characters TDi.

Definition at line 49 of file AtrParser.cs.

bool TckValid [get, set]

Check Byte valid.

Definition at line 57 of file AtrParser.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/AtrParser.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AtrParser Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • Common
  • AtrParser
Static Public Member Functions | Private Types | Static Private Member Functions

AtrParser Class Reference

Helper class that parses the ATR and populate the AtrInfo class. More...

List of all members.

Static Public Member Functions

static AtrInfo | Parse (byte[] atrBytes)

Private Types

enum | AtrHeader { InitialHeader = 0x3B }

Static Private Member Functions

static bool | ValidateTCK (byte[] atr)

Detailed Description

Definition at line 62 of file AtrParser.cs.

Member Enumeration Documentation

enum AtrHeader [private]
Enumerator:
InitialHeader

Definition at line 64 of file AtrParser.cs.

                       : byte
        {
            InitialHeader = 0x3B,
        }

Member Function Documentation

static AtrInfo Parse ( byte[] atrBytes ) [inline, static]

Main parser method that extract information about the ATR byte array.

Returns:
returns AtrInfo object if ATR is valid, null otherwise

Definition at line 74 of file AtrParser.cs.

        {
            AtrInfo atrInfo = new AtrInfo();
            byte initialChar = 0, formatByte = 0;
            int supportedProtocols = 0;

            using (DataReader reader = DataReader.FromBuffer(atrBytes.AsBuffer()))
            {
                initialChar = reader.ReadByte();

                if (initialChar != (byte)AtrHeader.InitialHeader)
                {
                    return null;
                }

                formatByte = reader.ReadByte();
                var interfacePresence = (byte)(formatByte.HiNibble() << 4);

                for (int i = 0; i < AtrInfo.MAXIMUM_ATR_CODES; i++)
                {
                    if ((interfacePresence & 0x10) != 0)
                        atrInfo.ProtocolInterfaceA[i] = reader.ReadByte();

                    if ((interfacePresence & 0x20) != 0)
                        atrInfo.ProtocolInterfaceB[i] = reader.ReadByte();

                    if ((interfacePresence & 0x40) != 0)
                        atrInfo.ProtocolInterfaceC[i] = reader.ReadByte();

                    if ((interfacePresence & 0x80) != 0)
                        atrInfo.ProtocolInterfaceD[i] = reader.ReadByte();
                    else
                        break;

                    interfacePresence = atrInfo.ProtocolInterfaceD[i];
                    supportedProtocols |= (1 << interfacePresence.LowNibble());
                }

                atrInfo.HistoricalBytes = reader.ReadBuffer(formatByte.LowNibble());

                if ((supportedProtocols & ~1) != 0)
                {
                    atrInfo.TckValid = ValidateTCK(atrBytes);
                }

                return atrInfo;
            }
        }

static bool ValidateTCK ( byte[] atr ) [inline, static, private]

Compute the ATR check byte (TCK).

Returns:
return the computed TCK

Definition at line 128 of file AtrParser.cs.

        {
            byte ctk = 0;

            for (byte i = 1; i < atr.Length; i++)
            {
                ctk ^= atr[i];
            }

            return (ctk == 0);
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/AtrParser.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IccDetection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • Common
  • IccDetection
Public Member Functions | Properties | Private Types | Private Member Functions

IccDetection Class Reference

Class used to detect the type of the ICC card detected. More...

List of all members.

Public Member Functions

IccDetection (SmartCard card, SmartCardConnection connection)
async System.Threading.Tasks.Task | DetectCardTypeAync ()

Properties

byte[] | Atr [get, set]
AtrInfo | AtrInformation [get, set]
SmartCardConnection | connectionObject [get, set]
Pcsc.CardName | PcscCardName [get, set]
DeviceClass | PcscDeviceClass [get, set]
SmartCard | smartCard [get, set]

Private Types

enum | CategoryIndicator { StatusInfoPresentAtEnd = 0x00, StatusInfoPresentInTlv = 0x80 }

Private Member Functions

void | DetectCard ()

Detailed Description

It accept a connection object and gets the ATR from the ICC. After the ATR is parsed, the ICC Detection class inspects the historical bytes in order to detect the ICC type as specified by PCSC specification.

Definition at line 27 of file IccDetection.cs.

Member Enumeration Documentation

enum CategoryIndicator [private]

Helper enum to hold various constants.

Enumerator:
StatusInfoPresentAtEnd
StatusInfoPresentInTlv

Definition at line 160 of file IccDetection.cs.

                               : byte
        {
            StatusInfoPresentAtEnd = 0x00,
            StatusInfoPresentInTlv = 0x80
        }

Constructor & Destructor Documentation

IccDetection | ( | SmartCard | card,
 |  | SmartCardConnection | connection |
 | ) |  |  | [inline]

class constructor.

Parameters:
card | smart card object
connection | connection object to the smard card

Definition at line 62 of file IccDetection.cs.

        {
            smartCard = card;
            connectionObject = connection;
            PcscDeviceClass = DeviceClass.Unknown;
            PcscCardName = Pcsc.CardName.Unknown;
        }

Member Function Documentation

void DetectCard ( ) [inline, private]

Internal method that analyzes the ATR Historical Bytes, it populate the object with info about the ICC.

Definition at line 100 of file IccDetection.cs.

        {
            if (AtrInformation.HistoricalBytes.Length > 1)
            {
                byte categoryIndicator;

                using (DataReader reader = DataReader.FromBuffer(AtrInformation.HistoricalBytes))
                {
                    categoryIndicator = reader.ReadByte();

                    if (categoryIndicator == (byte)CategoryIndicator.StatusInfoPresentInTlv)
                    {
                        while (reader.UnconsumedBufferLength > 0)
                        {
                            const byte appIdPresenceIndTag = 0x4F;
                            const byte appIdPresenceIndTagLen = 0x0C;

                            var tagValue = reader.ReadByte();
                            var tagLength = reader.ReadByte();

                            if (tagValue == appIdPresenceIndTag && tagLength == appIdPresenceIndTagLen)
                            {
                                byte[] pcscRid = { 0xA0, 0x00, 0x00, 0x03, 0x06 };
                                byte[] pcscRidRead = new byte[pcscRid.Length];

                                reader.ReadBytes(pcscRidRead);

                                if (pcscRid.SequenceEqual(pcscRidRead))
                                {
                                    byte storageStandard = reader.ReadByte();
                                    ushort cardName = reader.ReadUInt16();

                                    PcscCardName = (Pcsc.CardName)cardName;
                                    PcscDeviceClass = DeviceClass.StorageClass;
                                }

                                reader.ReadBuffer(4); // RFU bytes
                            }
                            else
                            {
                                reader.ReadBuffer(tagLength);
                            }
                        }
                    }
                }
            }
            else
            {
                // Compare with Mifare DesFire card ATR
                byte[] desfireAtr = { 0x3B, 0x81, 0x80, 0x01, 0x80, 0x80 };

                if (Atr.SequenceEqual(desfireAtr))
                {
                    PcscDeviceClass = DeviceClass.MifareDesfire;
                }
            }
        }

async System.Threading.Tasks.Task DetectCardTypeAync ( ) [inline]

Detects the ICC type by parsing, and analyzing the ATR.

Returns:
none

Definition at line 75 of file IccDetection.cs.

        {
            try
            {
                var atrBuffer = await smartCard.GetAnswerToResetAsync();
                Atr = atrBuffer.ToArray();

                Debug.WriteLine("Status: " + (await smartCard.GetStatusAsync()) + "ATR [" + atrBuffer.Length.ToString() + "] = " + BitConverter.ToString(Atr));

                AtrInformation = AtrParser.Parse(Atr);

                if (AtrInformation != null && AtrInformation.HistoricalBytes.Length > 0)
                {
                    DetectCard();
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message + e.StackTrace);
            }
        }

Property Documentation

byte [] Atr [get, set]

ATR byte array.

Definition at line 40 of file IccDetection.cs.

AtrInfo AtrInformation [get, set]

ATR info holds information about the interface character along other info.

Definition at line 44 of file IccDetection.cs.

SmartCardConnection connectionObject [get, set, private]

Smard card connection passed in the constructor.

Definition at line 52 of file IccDetection.cs.

Pcsc.CardName PcscCardName [get, set]

PCSC card name provided in the nn short int.

Definition at line 36 of file IccDetection.cs.

DeviceClass PcscDeviceClass [get, set]

PCSC device type.

Definition at line 32 of file IccDetection.cs.

SmartCard smartCard [get, set, private]

smard card object passed in the constructor

Definition at line 48 of file IccDetection.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/IccDetection.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeneralAuthenticate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • GeneralAuthenticate
Public Types | Public Member Functions | Properties

GeneralAuthenticate Class Reference

PCSC GeneralAuthenticate command. More...

Inherits Iso7816::ApduCommand.

Inherited by GeneralAuthenticate.

List of all members.

Public Types

enum | GeneralAuthenticateKeyType { MifareKeyA = 0x60, PicoTagPassKeyB = 0x61 }
enum | GeneralAuthenticateVersionNumber { VersionOne = 0x01 }

Public Member Functions

GeneralAuthenticate (GeneralAuthenticateVersionNumber version, ushort address, GeneralAuthenticateKeyType keyType, byte keyNo)

Properties

ushort | Address [get, set]
byte | KeyNumber [get, set]
byte | KeyType [get, set]
GeneralAuthenticateVersionNumber | VersionNumber [get, set]

Detailed Description

Definition at line 101 of file Pcsc.cs.

Member Enumeration Documentation

enum GeneralAuthenticateKeyType
Enumerator:
MifareKeyA
PicoTagPassKeyB

Definition at line 103 of file Pcsc.cs.

                                               : byte
        {
            MifareKeyA = 0x60,
            PicoTagPassKeyB = 0x61
        }

enum GeneralAuthenticateVersionNumber
Enumerator:
VersionOne

Definition at line 108 of file Pcsc.cs.

                                                     : byte
        {
            VersionOne = 0x01
        }

Constructor & Destructor Documentation

GeneralAuthenticate | ( | GeneralAuthenticateVersionNumber | version,
 |  | ushort | address,
 |  | GeneralAuthenticateKeyType | keyType,
 |  | byte | keyNo |
 | ) |  |  | [inline]

Definition at line 136 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Pcsc.Ins.GeneralAuthenticate, 0, 0, new byte[5] { (byte)version, (byte)(address >> 8), (byte)(address & 0x00FF), (byte)keyType, keyNo }, null)

Property Documentation

ushort Address [get, set]

Definition at line 118 of file Pcsc.cs.

byte KeyNumber [get, set]

Definition at line 132 of file Pcsc.cs.

byte KeyType [get, set]

Definition at line 127 of file Pcsc.cs.

GeneralAuthenticateVersionNumber VersionNumber [get, set]

Definition at line 113 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • GetData
Public Types | Public Member Functions | Properties

GetData Class Reference

PCSC GetData command. More...

Inherits Iso7816::ApduCommand.

Inherited by GetHistoricalBytes, and GetUid.

List of all members.

Public Types

enum | GetDataDataType { Uid = 0x00, HistoricalBytes = 0x01 }

Public Member Functions

GetData (GetDataDataType type)

Properties

GetDataDataType | Type [get, set]

Detailed Description

Definition at line 20 of file Pcsc.cs.

Member Enumeration Documentation

enum GetDataDataType
Enumerator:
Uid
HistoricalBytes

Definition at line 22 of file Pcsc.cs.

                                    : byte
        {
            Uid = 0x00,
            HistoricalBytes = 0x01 // Returned data excludes CRC
        }

Constructor & Destructor Documentation

GetData ( GetDataDataType type ) [inline]

Definition at line 32 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Pcsc.Ins.GetData, (byte)type, 0, null, 0)
        {
        }

Property Documentation

GetDataDataType Type [get, set]

Definition at line 28 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetHistoricalBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • GetHistoricalBytes
Public Member Functions

GetHistoricalBytes Class Reference

PCSC GetHistoricalBytes command. More...

Inherits Pcsc::GetData.

Inherited by GetHistoricalBytes, GetHistoricalBytes, GetHistoricalBytes, and GetHistoricalBytes.

List of all members.

Public Member Functions

GetHistoricalBytes ()

Detailed Description

Definition at line 196 of file Pcsc.cs.

Constructor & Destructor Documentation

GetHistoricalBytes ( ) [inline]

Reimplemented in GetHistoricalBytes, GetHistoricalBytes, GetHistoricalBytes, and GetHistoricalBytes.

Definition at line 198 of file Pcsc.cs.

            : base(GetData.GetDataDataType.HistoricalBytes)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GetUid Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • GetUid
Public Member Functions

GetUid Class Reference

PCSC GetUid command. More...

Inherits Pcsc::GetData.

Inherited by GetUid, GetUid, GetUid, and GetUid.

List of all members.

Public Member Functions

GetUid ()

Detailed Description

Definition at line 186 of file Pcsc.cs.

Constructor & Destructor Documentation

GetUid ( ) [inline]

Reimplemented in GetUid, GetUid, GetUid, and GetUid.

Definition at line 188 of file Pcsc.cs.

            : base(GetData.GetDataDataType.Uid)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IncrementDecrement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • IncrementDecrement
Public Types | Public Member Functions

IncrementDecrement Class Reference

PCSC IncrementDecrement command. More...

Inherits Iso7816::ApduCommand.

List of all members.

Public Types

enum DataObjectType { Increment = 0xA0, Decrement = 0xA1 }

Public Member Functions

IncrementDecrement (byte[] dataObjects)

Detailed Description

Definition at line 240 of file Pcsc.cs.

Member Enumeration Documentation

enum DataObjectType
Enumerator:
Increment
Decrement

Definition at line 242 of file Pcsc.cs.

        {
            Increment = 0xA0,
            Decrement = 0xA1
        }

Constructor & Destructor Documentation

IncrementDecrement ( byte[] dataObjects ) [inline]

Definition at line 247 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Iso7816.Ins.Envelope, 0x00, 0x03, dataObjects, null)
        {
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoadKeys Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • LoadKeys
Public Types | Public Member Functions | Properties

LoadKeys Class Reference

PCSC LoadKeys command. More...

Inherits Iso7816::ApduCommand.

Inherited by LoadKey.

List of all members.

Public Types

enum | LoadKeysKeyType { CardKey = 0x00, ReaderKey = 0x80, Mask = 0x80 }
enum | LoadKeysStorageType { Volatile = 0x00, NonVolatile = 0x20, Mask = 0x20 }
enum | LoadKeysTransmissionType { Plain = 0x00, Secured = 0x40, Mask = 0x40 }

Public Member Functions

LoadKeys (LoadKeysKeyType keyType, byte?readerKeyNumber, LoadKeysTransmissionType transmissionType, LoadKeysStorageType storageType, byte keyNumber, byte[] keyData)

Properties

byte[] | KeyData [get, set]
byte | KeyNumber [get, set]
LoadKeysKeyType | KeyType [get, set]
byte | ReaderKeyNumber [get, set]
LoadKeysStorageType | StorageType [get, set]
LoadKeysTransmissionType | TransmissionType [get, set]

Detailed Description

Definition at line 40 of file Pcsc.cs.

Member Enumeration Documentation

enum LoadKeysKeyType
Enumerator:
CardKey
ReaderKey
Mask

Definition at line 42 of file Pcsc.cs.

                                    : byte
        {
            CardKey = 0x00,
            ReaderKey = 0x80,

            Mask = 0x80,
        }

enum LoadKeysStorageType
Enumerator:
Volatile
NonVolatile
Mask

Definition at line 56 of file Pcsc.cs.

                                        : byte
        {
            Volatile = 0x00,
            NonVolatile = 0x20,

            Mask = 0x20,
        }

enum LoadKeysTransmissionType
Enumerator:
Plain
Secured
Mask

Definition at line 49 of file Pcsc.cs.

                                             : byte
        {
            Plain = 0x00,
            Secured = 0x40,

            Mask = 0x40,
        }

Constructor & Destructor Documentation

LoadKeys | ( | LoadKeysKeyType | keyType,
 |  | byte? | readerKeyNumber,
 |  | LoadKeysTransmissionType | transmissionType,
 |  | LoadKeysStorageType | storageType,
 |  | byte | keyNumber,
 |  | byte[] | keyData |
 | ) |  |  | [inline]

Definition at line 93 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Pcsc.Ins.LoadKeys, (byte)((byte)keyType | (byte)transmissionType | (byte)storageType | (readerKeyNumber ?? 0)), keyNumber, keyData, null)
        {
        }

Property Documentation

byte [] KeyData [get, set]

Definition at line 89 of file Pcsc.cs.

byte KeyNumber [get, set]

Definition at line 84 of file Pcsc.cs.

LoadKeysKeyType KeyType [get, set]

Definition at line 64 of file Pcsc.cs.

byte ReaderKeyNumber [get, set]

Definition at line 79 of file Pcsc.cs.

LoadKeysStorageType StorageType [get, set]

Definition at line 74 of file Pcsc.cs.

LoadKeysTransmissionType TransmissionType [get, set]

Definition at line 69 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ManageSession Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • ManageSession
Public Types | Public Member Functions

ManageSession Class Reference

PCSC ManageSession command. More...

Inherits Iso7816::ApduCommand.

List of all members.

Public Types

enum DataObjectType { Version = 0x80, StartTransparentSession = 0x81, EndTransparentSession = 0x82, Timer = 0x5F46 }

Public Member Functions

ManageSession (byte[] dataObjects)

Detailed Description

Definition at line 206 of file Pcsc.cs.

Member Enumeration Documentation

enum DataObjectType
Enumerator:
Version
StartTransparentSession
EndTransparentSession
Timer

Definition at line 208 of file Pcsc.cs.

        {
            Version = 0x80,
            StartTransparentSession = 0x81,
            EndTransparentSession = 0x82,
            Timer = 0x5F46,
        }

Constructor & Destructor Documentation

ManageSession ( byte[] dataObjects ) [inline]

Definition at line 215 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Iso7816.Ins.Envelope, 0x00, 0x00, dataObjects, null)
        {
            ApduResponseType = typeof(ManageSessionResponse);
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ManageSessionResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • ManageSessionResponse
Public Types | Public Member Functions | Properties

ManageSessionResponse Class Reference

PCSC ManageSession response. More...

Inherits Iso7816::ApduResponse.

List of all members.

Public Types

enum | DataObjectType { GenericErrorStatus = 0xC0, Version = 0x80 }

Public Member Functions

ManageSessionResponse ()

Properties

override bool | Succeeded [get]
char | Version [get]

Detailed Description

Definition at line 265 of file Pcsc.cs.

Member Enumeration Documentation

enum DataObjectType
Enumerator:
GenericErrorStatus
Version

Definition at line 267 of file Pcsc.cs.

        {
            GenericErrorStatus = 0xC0,
            Version = 0x80,
        }

Constructor & Destructor Documentation

ManageSessionResponse ( ) [inline]

Definition at line 272 of file Pcsc.cs.

            : base()
        {
        }

Property Documentation

override bool Succeeded [get]

Reimplemented from ApduResponse.

Definition at line 277 of file Pcsc.cs.

char Version [get]

Definition at line 294 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReadBinary Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • ReadBinary
Public Member Functions | Properties

ReadBinary Class Reference

PCSC ReadBinary command. More...

Inherits Iso7816::ApduCommand.

Inherited by Check, Read, Read, and Read.

List of all members.

Public Member Functions

ReadBinary (ushort address, byte?expectedReturnBytes)

Properties

ushort Address [get, set]

Detailed Description

Definition at line 144 of file Pcsc.cs.

Constructor & Destructor Documentation

ReadBinary | ( | ushort | address,
 |  | byte? | expectedReturnBytes |
 | ) |  |  | [inline]

Definition at line 146 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Pcsc.Ins.ReadBinary, 0, 0, null, expectedReturnBytes)
        {
            this.Address = address;
        }

Property Documentation

ushort Address [get, set]

Definition at line 153 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCardReaderUtils Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • SmartCardReaderUtils
Static Public Member Functions

SmartCardReaderUtils Class Reference

List of all members.

Static Public Member Functions

static async Task
< DeviceInformation > 		GetFirstSmartCardReaderInfo (SmartCardReaderKind readerKind=SmartCardReaderKind.Any)

Detailed Description

Definition at line 92 of file PcscUtils.cs.

Member Function Documentation

static async Task<DeviceInformation> GetFirstSmartCardReaderInfo ( SmartCardReaderKind readerKind = SmartCardReaderKind.Any ) [inline, static]

Checks whether the device supports smart card reader mode.

Returns:
None

Definition at line 98 of file PcscUtils.cs.

        {
            // Check if the SmartCardConnection API exists on this currently running SKU of Windows
            if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Devices.SmartCards.SmartCardConnection"))
            {
                // This SKU of Windows does not support NFC card reading, only desktop and phones/mobile devices support NFC card reading
                return null;
            }

            // Device selector string is from SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Nfc) except that we remove the conditional
            // about the interface being enabled, since we want to get the device object regardless of whether the user turned it off in the CPL
            string query = "System.Devices.InterfaceClassGuid:=\"{DEEBE6AD-9E01-47E2-A3B2-A66AA2C036C9}\"";
            if (readerKind != SmartCardReaderKind.Any)
            {
                query += " AND System.Devices.SmartCards.ReaderKind:=" + (int)readerKind;
            }

            DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(query);

            // There is a bug on some devices that were updated to WP8.1 where an NFC SmartCardReader is
            // enumerated despite that the device does not support it. As a workaround, we can do an additonal check
            // to ensure the device truly does support it.
            var workaroundDetect = await DeviceInformation.FindAllAsync("System.Devices.InterfaceClassGuid:=\"{50DD5230-BA8A-11D1-BF5D-0000F805F530}\"");

            if (workaroundDetect.Count == 0 || devices.Count == 0)
            {
                // Not supported
                return null;
            }

            // Smart card reader supported, but may be disabled
            return (from d in devices
                          where d.IsEnabled
                          orderby d.IsDefault descending
                          select d).FirstOrDefault();
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/PcscUtils.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TransparentExchange Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • TransparentExchange
Public Types | Public Member Functions

TransparentExchange Class Reference

PCSC TransparentExchange command. More...

Inherits Iso7816::ApduCommand.

List of all members.

Public Types

enum DataObjectType { Transceive = 0x95, Timer = 0x5F46 }

Public Member Functions

TransparentExchange (byte[] dataObjects)

Detailed Description

Definition at line 224 of file Pcsc.cs.

Member Enumeration Documentation

enum DataObjectType
Enumerator:
Transceive
Timer

Definition at line 226 of file Pcsc.cs.

        {
            Transceive = 0x95,
            Timer = 0x5F46,
        }

Constructor & Destructor Documentation

TransparentExchange ( byte[] dataObjects ) [inline]

Definition at line 231 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Iso7816.Ins.Envelope, 0x00, 0x01, dataObjects, null)
        {
            ApduResponseType = typeof(TransparentExchangeResponse);
        }

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TransparentExchangeResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • TransparentExchangeResponse
Public Types | Public Member Functions | Properties

TransparentExchangeResponse Class Reference

PCSC TransparentExchange response. More...

Inherits Iso7816::ApduResponse.

List of all members.

Public Types

enum | DataObjectType { GenericErrorStatus = 0xC0, ResponseStatus = 0x96, IccResponse = 0x97 }

Public Member Functions

TransparentExchangeResponse ()

Properties

byte[] | IccResponse [get]
ushort | ResponseStatus [get]
override bool | Succeeded [get]

Detailed Description

Definition at line 309 of file Pcsc.cs.

Member Enumeration Documentation

enum DataObjectType
Enumerator:
GenericErrorStatus
ResponseStatus
IccResponse

Definition at line 311 of file Pcsc.cs.

        {
            GenericErrorStatus = 0xC0,
            ResponseStatus = 0x96,
            IccResponse = 0x97,
        }

Constructor & Destructor Documentation

TransparentExchangeResponse ( ) [inline]

Definition at line 317 of file Pcsc.cs.

            : base()
        {
        }

Property Documentation

byte [] IccResponse [get]

Definition at line 352 of file Pcsc.cs.

ushort ResponseStatus [get]

Definition at line 339 of file Pcsc.cs.

override bool Succeeded [get]

Reimplemented from ApduResponse.

Definition at line 322 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateBinary Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Pcsc
  • UpdateBinary
Public Member Functions | Properties

UpdateBinary Class Reference

PCSC Updatebinary Command. More...

Inherits Iso7816::ApduCommand.

Inherited by Update, Write, Write, and Write.

List of all members.

Public Member Functions

UpdateBinary (ushort address, byte[] dataToWrite)

Properties

ushort Address [get, set]

Detailed Description

Definition at line 165 of file Pcsc.cs.

Constructor & Destructor Documentation

UpdateBinary | ( | ushort | address,
 |  | byte[] | dataToWrite |
 | ) |  |  | [inline]

Definition at line 167 of file Pcsc.cs.

            : base((byte)Iso7816.Cla.ReservedForPts, (byte)Pcsc.Ins.UpdateBinary, 0, 0, dataToWrite, null)
        {
            this.Address = address;
        }

Property Documentation

ushort Address [get, set]

Definition at line 174 of file Pcsc.cs.

The documentation for this class was generated from the following file:
  • Nfc/PcscSdk/Pcsc.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HistoryRecord Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PedometerCS
  • HistoryRecord
Public Member Functions | Properties | Private Attributes

HistoryRecord Class Reference

Represents a history record object that gets binded to the ListView controller in the XAML. More...

List of all members.

Public Member Functions

HistoryRecord (PedometerReading reading)

Properties

String | StepKind [get]
Int32 | StepsCount [get]
double | StepsDuration [get]
String | TimeStamp [get]

Private Attributes

DateTimeOffset | recordTimestamp
PedometerStepKind | stepKind
Int32 | stepsCount
TimeSpan | stepsDuration

Detailed Description

Definition at line 189 of file Scenario2_History.xaml.cs.

Constructor & Destructor Documentation

HistoryRecord ( PedometerReading reading ) [inline]

Definition at line 240 of file Scenario2_History.xaml.cs.

        {
            stepKind = reading.StepKind;
            stepsCount = reading.CumulativeSteps;
            recordTimestamp = reading.Timestamp;
        }

Member Data Documentation

DateTimeOffset recordTimestamp [private]

Definition at line 247 of file Scenario2_History.xaml.cs.

PedometerStepKind stepKind [private]

Definition at line 248 of file Scenario2_History.xaml.cs.

Int32 stepsCount [private]

Definition at line 249 of file Scenario2_History.xaml.cs.

TimeSpan stepsDuration [private]

Definition at line 250 of file Scenario2_History.xaml.cs.

Property Documentation

String StepKind [get]

Definition at line 201 of file Scenario2_History.xaml.cs.

Int32 StepsCount [get]

Definition at line 225 of file Scenario2_History.xaml.cs.

double StepsDuration [get]

Definition at line 232 of file Scenario2_History.xaml.cs.

String TimeStamp [get]

Definition at line 192 of file Scenario2_History.xaml.cs.

The documentation for this class was generated from the following file:
  • Pedometer/cs/Scenario2_History.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Events Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PedometerCS
  • Scenario1_Events
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Events Class Reference

'Events' scenario page that gets navigated to when the user selected the 'Events' scenario.

List of all members.

Public Member Functions

Scenario1_Events ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
async void | Pedometer_ReadingChanged (Pedometer sender, PedometerReadingChangedEventArgs args)
async void | RegisterButton_Click (object sender, RoutedEventArgs e)

Private Attributes

DeviceAccessInformation | deviceAccessInformation = null
Pedometer | pedometer = null
Guid | PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599")
bool | registeredForEvents = false
MainPage | rootPage = MainPage.Current
Int32 | runningStepCount
Int32 | totalCumulativeSteps
Int32 | unknownStepCount
Int32 | walkingStepCount

Detailed Description

Definition at line 29 of file Scenario1_Events.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Events ( ) [inline]

Definition at line 36 of file Scenario1_Events.xaml.cs.

        {
            this.InitializeComponent();

            // Register for access changed notifications for pedometers
            deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(PedometerClassId);
            deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(AccessChanged);
        }

Member Function Documentation

async void AccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for AccessChanged events.

Parameters:
sender
e

Definition at line 165 of file Scenario1_Events.xaml.cs.

        {
            var status = e.Status;
            if (status != DeviceAccessStatus.Allowed)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Access denied to pedometers", NotifyType.ErrorMessage);
                    pedometer = null;

                    registeredForEvents = false;
                    RegisterButton.Content = "Register ReadingChanged";
                });
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 50 of file Scenario1_Events.xaml.cs.

        {
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario1_Events.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Pedometer_ReadingChanged | ( | Pedometer | sender,
 |  | PedometerReadingChangedEventArgs | args |
 | ) |  |  | [inline, private]

Invoked when the underlying Pedometer sees a change in the step count for a step kind.

Parameters:
sender | unused
args | Pedometer reading that is being notified

Definition at line 108 of file Scenario1_Events.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PedometerReading reading = args.Reading;
                int newCount = 0;

                // update step counts based on the step kind
                switch (reading.StepKind)
                {
                    case PedometerStepKind.Unknown:
                        if (reading.CumulativeSteps < unknownStepCount)
                        {
                            unknownStepCount = 0;
                        }
                        newCount = reading.CumulativeSteps - unknownStepCount;
                        unknownStepCount = reading.CumulativeSteps;
                        ScenarioOutput_UnknownCount.Text = unknownStepCount.ToString();
                        ScenarioOutput_UnknownDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
                        break;
                    case PedometerStepKind.Walking:
                        if (reading.CumulativeSteps < walkingStepCount)
                        {
                            walkingStepCount = 0;
                        }
                        newCount = reading.CumulativeSteps - walkingStepCount;
                        walkingStepCount = reading.CumulativeSteps;
                        ScenarioOutput_WalkingCount.Text = walkingStepCount.ToString();
                        ScenarioOutput_WalkingDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
                        break;
                    case PedometerStepKind.Running:
                        if (reading.CumulativeSteps < runningStepCount)
                        {
                            runningStepCount = 0;
                        }
                        newCount = reading.CumulativeSteps - runningStepCount;
                        runningStepCount = reading.CumulativeSteps;
                        ScenarioOutput_RunningCount.Text = runningStepCount.ToString();
                        ScenarioOutput_RunningDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
                        break;
                    default:
                        break;
                }

                totalCumulativeSteps += newCount;
                ScenarioOutput_TotalStepCount.Text = totalCumulativeSteps.ToString();

                DateTimeFormatter timestampFormatter = new DateTimeFormatter("shortdate longtime");
                ScenarioOutput_Timestamp.Text = timestampFormatter.Format(reading.Timestamp);
            });
        }

async void RegisterButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

'Register ReadingChanged' button click handler.

Registers for the 'ReadingChanged' event of the default pedometer.

Parameters:
sender | unused
e | unused

Definition at line 61 of file Scenario1_Events.xaml.cs.

        {
            // Get the default sensor
            if (!registeredForEvents)
            {
                RegisterButton.IsEnabled = false;
                try
                {
                    pedometer = await Pedometer.GetDefaultAsync();
                    if (null == pedometer)
                    {
                        rootPage.NotifyUser("No pedometer available", NotifyType.ErrorMessage);
                    }
                    else
                    {
                        RegisterButton.Content = "Unregister ReadingChanged";
                        RegisterButton.IsEnabled = true;
                        rootPage.NotifyUser("Registered for step count changes", NotifyType.StatusMessage);
                        pedometer.ReportInterval = pedometer.MinimumReportInterval;
                        pedometer.ReadingChanged += Pedometer_ReadingChanged;
                        registeredForEvents = true;
                    }
                }
                catch (System.UnauthorizedAccessException)
                {
                    rootPage.NotifyUser("Access to the default pedometer is denied", NotifyType.ErrorMessage);
                }
                RegisterButton.IsEnabled = true;
            }
            else
            {
                if (pedometer != null)
                {
                    pedometer.ReadingChanged -= Pedometer_ReadingChanged;
                    pedometer = null;
                    rootPage.NotifyUser("Pedometer available - Not registered for events", NotifyType.StatusMessage);
                }
                RegisterButton.Content = "Register ReadingChanged";
                registeredForEvents = false;
            }
        }

Member Data Documentation

DeviceAccessInformation deviceAccessInformation = null [private]

Definition at line 181 of file Scenario1_Events.xaml.cs.

Pedometer pedometer = null [private]

Definition at line 182 of file Scenario1_Events.xaml.cs.

Guid PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599") [private]

Definition at line 32 of file Scenario1_Events.xaml.cs.

bool registeredForEvents = false [private]

Definition at line 183 of file Scenario1_Events.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario1_Events.xaml.cs.

Int32 runningStepCount [private]

Definition at line 187 of file Scenario1_Events.xaml.cs.

Int32 totalCumulativeSteps [private]

Definition at line 184 of file Scenario1_Events.xaml.cs.

Int32 unknownStepCount [private]

Definition at line 185 of file Scenario1_Events.xaml.cs.

Int32 walkingStepCount [private]

Definition at line 186 of file Scenario1_Events.xaml.cs.

The documentation for this class was generated from the following file:
  • Pedometer/cs/Scenario1_Events.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_History Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PedometerCS
  • Scenario2_History
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_History Class Reference

History Page that gets loaded when 'History' scenario is selected.

List of all members.

Public Member Functions

Scenario2_History ()

Private Member Functions

void | AllHistory_Checked (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetHistory_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | SpecificHistory_Checked (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

bool | getAllHistory = true
ObservableCollection
< HistoryRecord > 		historyRecords
Guid | PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599")
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 29 of file Scenario2_History.xaml.cs.

Constructor & Destructor Documentation

Scenario2_History ( ) [inline]

Definition at line 36 of file Scenario2_History.xaml.cs.

        {
            this.InitializeComponent();
            historyRecords = new ObservableCollection<HistoryRecord>();
            historyRecordsList.DataContext = historyRecords;
        }

Member Function Documentation

void AllHistory_Checked | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario2_History.xaml.cs.

        {
            // Collapse SpanPicker - SpanPicker will not be created yet the first time the page is loading
            if (SpanPicker != null)
            {
                SpanPicker.Visibility = Visibility.Collapsed;
            }
            getAllHistory = true;
            rootPage.NotifyUser("This will retrieve all the step count history available on the system", NotifyType.StatusMessage);
        }

async void GetHistory_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Get History' button is clicked.

Depending on the user selection, this handler uses one of the overloaded 'GetSystemHistoryAsync' APIs to retrieve the pedometer history of the user

Parameters:
sender | unused
e | unused

Definition at line 68 of file Scenario2_History.xaml.cs.

        {
            GetHistory.IsEnabled = false;

            // Determine if we can access pedometers
            var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(PedometerClassId);
            if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                // Determine if a pedometer is present
                // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
                var sensor = await Pedometer.GetDefaultAsync();
                if (sensor != null)
                {
                    IReadOnlyList<PedometerReading> historyReadings = null;
                    var timestampFormatter = new DateTimeFormatter("shortdate longtime");

                    // Disable subsequent history retrieval while the async operation is in progress
                    GetHistory.IsEnabled = false;

                    // clear previous content being displayed
                    historyRecords.Clear();

                    try
                    {
                        if (getAllHistory)
                        {
                            var dt = DateTime.FromFileTimeUtc(0);
                            var fromBeginning = new DateTimeOffset(dt);
                            rootPage.NotifyUser("Retrieving all available History", NotifyType.StatusMessage);
                            historyReadings = await Pedometer.GetSystemHistoryAsync(fromBeginning);
                        }
                        else
                        {
                            String notificationString = "Retrieving history from: ";
                            var calendar = new Calendar();
                            calendar.ChangeClock("24HourClock");

                            // DateTime picker will also include hour, minute and seconds from the the system time.
                            // Decrement the same to be able to correctly add TimePicker values.

                            calendar.SetDateTime(FromDate.Date);
                            calendar.AddNanoseconds(-calendar.Nanosecond);
                            calendar.AddSeconds(-calendar.Second);
                            calendar.AddMinutes(-calendar.Minute);
                            calendar.AddHours(-calendar.Hour);
                            calendar.AddSeconds(Convert.ToInt32(FromTime.Time.TotalSeconds));

                            DateTimeOffset fromTime = calendar.GetDateTime();

                            calendar.SetDateTime(ToDate.Date);
                            calendar.AddNanoseconds(-calendar.Nanosecond);
                            calendar.AddSeconds(-calendar.Second);
                            calendar.AddMinutes(-calendar.Minute);
                            calendar.AddHours(-calendar.Hour);
                            calendar.AddSeconds(Convert.ToInt32(ToTime.Time.TotalSeconds));

                            DateTimeOffset toTime = calendar.GetDateTime();

                            notificationString += timestampFormatter.Format(fromTime);
                            notificationString += " To ";
                            notificationString += timestampFormatter.Format(toTime);

                            if (toTime.ToFileTime() < fromTime.ToFileTime())
                            {
                                rootPage.NotifyUser("Invalid time span. 'To Time' must be equal or more than 'From Time'", NotifyType.ErrorMessage);

                                // Enable subsequent history retrieval while the async operation is in progress
                                GetHistory.IsEnabled = true;
                            }
                            else
                            {
                                TimeSpan span = TimeSpan.FromTicks(toTime.Ticks - fromTime.Ticks);
                                rootPage.NotifyUser(notificationString, NotifyType.StatusMessage);
                                historyReadings = await Pedometer.GetSystemHistoryAsync(fromTime, span);
                            }
                        }

                        if (historyReadings != null)
                        {
                            foreach (PedometerReading reading in historyReadings)
                            {
                                HistoryRecord record = new HistoryRecord(reading);
                                historyRecords.Add(record);

                                // Get at most 100 records (number is arbitrary chosen for demonstration purposes)
                                if (historyRecords.Count == 100)
                                {
                                    break;
                                }
                            }

                            rootPage.NotifyUser("History retrieval completed", NotifyType.StatusMessage);
                        }
                    }
                    catch (UnauthorizedAccessException)
                    {
                        rootPage.NotifyUser("User has denied access to activity history", NotifyType.ErrorMessage);
                    }

                    // Finally, re-enable history retrieval
                    GetHistory.IsEnabled = true;
                }
                else
                {
                    rootPage.NotifyUser("No pedometers found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access to pedometers is denied", NotifyType.ErrorMessage);
            }
        }

void SpecificHistory_Checked | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario2_History.xaml.cs.

        {
            SpanPicker.Visibility = Visibility.Visible;
            getAllHistory = false;
            rootPage.NotifyUser("This will retrieve all the step count history for the selected time span", NotifyType.StatusMessage);
        }

Member Data Documentation

bool getAllHistory = true [private]

Definition at line 182 of file Scenario2_History.xaml.cs.

ObservableCollection<HistoryRecord> historyRecords [private]

Definition at line 181 of file Scenario2_History.xaml.cs.

Guid PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599") [private]

Definition at line 34 of file Scenario2_History.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario2_History.xaml.cs.

The documentation for this class was generated from the following file:
  • Pedometer/cs/Scenario2_History.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CurrentStepCount Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PedometerCS
  • Scenario3_CurrentStepCount
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_CurrentStepCount Class Reference

'Current step count' illustration page More...

List of all members.

Public Member Functions

Scenario3_CurrentStepCount ()

Private Member Functions

async void | GetCurrentButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

Guid | PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599")
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario3_CurrentStepCount.xaml.cs.

Constructor & Destructor Documentation

Scenario3_CurrentStepCount ( ) [inline]

Definition at line 32 of file Scenario3_CurrentStepCount.xaml.cs.

        {
            this.InitializeComponent();
            rootPage.NotifyUser("Hit the 'Get steps count' Button", NotifyType.StatusMessage);
        }

Member Function Documentation

async void GetCurrentButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'GetCurrentButton' is clicked.

'ReadingChanged' will not be fired when there is no activity on the pedometer and hence can't be reliably used to get the current step count. This handler makes use of 'GetCurrentReadings' API to determine the current step count

Definition at line 44 of file Scenario3_CurrentStepCount.xaml.cs.

        {
            // Determine if we can access pedometers
            var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(PedometerClassId);
            if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                // Determine if a pedometer is present
                // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
                var sensor = await Pedometer.GetDefaultAsync();
                if (sensor != null)
                {
                    DateTime dt = DateTime.FromFileTimeUtc(0);
                    int totalStepCount = 0;

                    // Get the current readings to find the current step counters
                    var currentReadings = sensor.GetCurrentReadings();
                    bool updateTimestamp = true;
                    foreach (PedometerStepKind kind in Enum.GetValues(typeof(PedometerStepKind)))
                    {
                        PedometerReading reading;
                        if (currentReadings.TryGetValue(kind, out reading))
                        {
                            totalStepCount += reading.CumulativeSteps;
                        }
                        if (updateTimestamp)
                        {
                            DateTimeFormatter timestampFormatter = new DateTimeFormatter("shortdate longtime");
                            ScenarioOutput_Timestamp.Text = timestampFormatter.Format(reading.Timestamp);
                            updateTimestamp = false;
                        }
                    }

                    ScenarioOutput_TotalStepCount.Text = totalStepCount.ToString();
                    rootPage.NotifyUser("Hit the 'Get steps count' Button", NotifyType.StatusMessage);

                    // Re-enable button
                    GetCurrentButton.IsEnabled = true;
                }
                else
                {
                    rootPage.NotifyUser("No pedometers found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access to pedometers is denied", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

Guid PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599") [private]

Definition at line 30 of file Scenario3_CurrentStepCount.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_CurrentStepCount.xaml.cs.

The documentation for this class was generated from the following file:
  • Pedometer/cs/Scenario3_CurrentStepCount.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_BackgroundPedometer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PedometerCS
  • Scenario4_BackgroundPedometer
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_BackgroundPedometer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_BackgroundPedometer ()

Public Attributes

const string | SampleBackgroundTaskEntryPoint = "Tasks.PedometerBackgroundTask"
const string | SampleBackgroundTaskName = "Scenario4_PedometerBackgroundTask"

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | RegisterBackgroundTask ()
async void | ScenarioRegisterTask_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | ScenarioUnregisterTask_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | UpdateUIAsync (string status)

Private Attributes

bool | backgroundTaskRegistered = false
MainPage | rootPage = MainPage.Current
Pedometer | sensor = null
int | stepCount = 0
int | stepGoal = 0
const int | stepGoalOffset = 50

Detailed Description

Definition at line 31 of file Scenario4_BackgroundTask.xaml.cs.

Constructor & Destructor Documentation

Scenario4_BackgroundPedometer ( ) [inline]

Definition at line 47 of file Scenario4_BackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for background task completion.

Parameters:
task | The task that is reporting completion.
args | The completion report arguments.

Definition at line 150 of file Scenario4_BackgroundTask.xaml.cs.

        {
            string status = "Completed and Unregistered";
            try
            {
                // check for the result from the background task
                args.CheckResult();
            }
            catch (Exception e)
            {
                status = e.Message;
            }
            // Pedometer background triggers are unique in a way as the background
            // events are one-shot - Once the step-goal associated with the original
            // task registration has been reached, that step count is a thing-of-past
            // and shall not fire as the stepcount on that pedometer changes.
            // Unregister the background task or update the step goals here.
            task.Unregister(false);
            backgroundTaskRegistered = false;
            UpdateUIAsync(status);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 57 of file Scenario4_BackgroundTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == Scenario4_BackgroundPedometer.SampleBackgroundTaskName)
                {
                    backgroundTaskRegistered = true;
                    break;
                }
            }
            UpdateUIAsync(backgroundTaskRegistered ? "Registered" : "Unregistered");
        }

void RegisterBackgroundTask ( ) [inline, private]

Registers the pedometer background task with a step goal of 50 steps.

Definition at line 108 of file Scenario4_BackgroundTask.xaml.cs.

        {
            // build the background task with the known entry points for Pedometer background task
            var builder = new BackgroundTaskBuilder()
            {
                Name = SampleBackgroundTaskName,
                TaskEntryPoint = SampleBackgroundTaskEntryPoint
            };

            // Get the current readings to find the current step counters
            var currentReadings = sensor.GetCurrentReadings();
            stepCount = 0;
            foreach (PedometerStepKind kind in Enum.GetValues(typeof(PedometerStepKind)))
            {
                PedometerReading reading;
                if (currentReadings.TryGetValue(kind, out reading))
                {
                    stepCount += reading.CumulativeSteps;
                }
            }

            // set a new step goal
            stepGoal = stepCount + Scenario4_BackgroundPedometer.stepGoalOffset;
            // create a Pedometer data threshold for that step goal
            var threshold = new PedometerDataThreshold(sensor, stepGoal);
            // create a sensor trigger using the above threshold
            var trigger = new SensorDataThresholdTrigger(threshold);

            builder.SetTrigger(trigger);

            BackgroundTaskRegistration task = builder.Register();
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);

            backgroundTaskRegistered = true;
            UpdateUIAsync("Registered");
        }

async void ScenarioRegisterTask_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Register Task' button is clicked.

Attempts to find a default Pedometer and registers a background task with a step goal of 50 steps. Adds a

Definition at line 75 of file Scenario4_BackgroundTask.xaml.cs.

        {
            try
            {
                sensor = await Pedometer.GetDefaultAsync();
                if (sensor != null)
                {
                    var status = await BackgroundExecutionManager.RequestAccessAsync();

                    if ((BackgroundAccessStatus.AlwaysAllowed == status) ||
                        (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == status))
                    {
                        RegisterBackgroundTask();
                    }
                    else
                    {
                        rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("No pedometer sensors found", NotifyType.ErrorMessage);
                }
            }
            catch (UnauthorizedAccessException)
            {
                rootPage.NotifyUser("User has denied access to Pedometer history", NotifyType.ErrorMessage);
            }
        }

void ScenarioUnregisterTask_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Unregister Task' button is clicked.

Definition at line 175 of file Scenario4_BackgroundTask.xaml.cs.

        {
            // Loop through all background tasks and unregister any with SampleBackgroundTaskName
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (SampleBackgroundTaskName == cur.Value.Name)
                {
                    cur.Value.Unregister(true /*cancelTask*/);
                    backgroundTaskRegistered = false;
                    break;
                }
            }

            if (!backgroundTaskRegistered)
            {
                UpdateUIAsync("Unregistered");
            }
        }

async void UpdateUIAsync ( string status ) [inline, private]

Updates the scenario UI.

Parameters:
status The status string to display.

Definition at line 198 of file Scenario4_BackgroundTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ScenarioRegisterTaskButton.IsEnabled = !backgroundTaskRegistered;
                ScenarioUnregisterTaskButton.IsEnabled = backgroundTaskRegistered;
                ScenarioOutput_TaskRegistration.Text = status;

                var settings = ApplicationData.Current.LocalSettings;

                ScenarioOutput_CurrentCount.Text = stepCount.ToString();
                ScenarioOutput_StepGoal.Text = stepGoal.ToString();

                ScenarioOutput_UnknownCount.Text = "0";
                ScenarioOutput_WalkingCount.Text = "0";
                ScenarioOutput_RunningCount.Text = "0";

                Object value;

                if (settings.Values.TryGetValue("ReportCount", out value))
                {
                    ScenarioOutput_ReportCount.Text = value.ToString(); // stored as a string
                }
                if (settings.Values.TryGetValue("TaskStatus", out value))
                {
                    ScenarioOutput_TaskStatus.Text = value.ToString();
                }
                if (settings.Values.TryGetValue("LastTimestamp", out value))
                {
                    ScenarioOutput_LastTimestamp.Text = value.ToString();
                    foreach (PedometerStepKind kind in Enum.GetValues(typeof(PedometerStepKind)))
                    {
                        if (settings.Values.TryGetValue(kind.ToString(), out value))
                        {
                            switch (kind)
                            {
                                case PedometerStepKind.Unknown:
                                    ScenarioOutput_UnknownCount.Text = value.ToString();
                                    break;
                                case PedometerStepKind.Walking:
                                    ScenarioOutput_WalkingCount.Text = value.ToString();
                                    break;
                                case PedometerStepKind.Running:
                                    ScenarioOutput_RunningCount.Text = value.ToString();
                                    break;
                                default:
                                    break;
                            }
                        }
                    }
                }
            });
        }

Member Data Documentation

bool backgroundTaskRegistered = false [private]

Definition at line 40 of file Scenario4_BackgroundTask.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario4_BackgroundTask.xaml.cs.

const string SampleBackgroundTaskEntryPoint = "Tasks.PedometerBackgroundTask"

Definition at line 35 of file Scenario4_BackgroundTask.xaml.cs.

const string SampleBackgroundTaskName = "Scenario4_PedometerBackgroundTask"

Definition at line 34 of file Scenario4_BackgroundTask.xaml.cs.

Pedometer sensor = null [private]

Definition at line 43 of file Scenario4_BackgroundTask.xaml.cs.

int stepCount = 0 [private]

Definition at line 41 of file Scenario4_BackgroundTask.xaml.cs.

int stepGoal = 0 [private]

Definition at line 42 of file Scenario4_BackgroundTask.xaml.cs.

const int stepGoalOffset = 50 [private]

Definition at line 45 of file Scenario4_BackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • Pedometer/cs/Scenario4_BackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersistentState Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

PersistentState Class Reference

#include "PersistentState.h"

List of all members.

Public Member Functions

void | Initialize (_In_ winrt::Windows::Foundation::Collections::IPropertySet settingsValues, _In_ winrt::hstring const &key)
bool | LoadBool (Platform::String^key, bool defaultValue)
bool | LoadBool (winrt::hstring const &key, bool defaultValue)
bool | LoadBool (Platform::String^key, bool defaultValue)
int | LoadInt32 (winrt::hstring const &key, int defaultValue)
int | LoadInt32 (Platform::String^key, int defaultValue)
int | LoadInt32 (Platform::String^key, int defaultValue)
float | LoadSingle (winrt::hstring const &key, float defaultValue)
float | LoadSingle (Platform::String^key, float defaultValue)
float | LoadSingle (Platform::String^key, float defaultValue)
winrt::hstring | LoadString (winrt::hstring const &key, winrt::hstring const &defaultValue)
Platform::String | LoadString (Platform::String^key, Platform::String^defaultValue)
Platform::String | LoadString (Platform::String^key, Platform::String^defaultValue)
DirectX::XMFLOAT3 | LoadXMFLOAT3 (Platform::String^key, DirectX::XMFLOAT3 defaultValue)
DirectX::XMFLOAT3 | LoadXMFLOAT3 (Platform::String^key, DirectX::XMFLOAT3 defaultValue)
DirectX::XMFLOAT3 | LoadXMFLOAT3 (winrt::hstring const &key, DirectX::XMFLOAT3 defaultValue)
void | SaveBool (Platform::String^key, bool value)
void | SaveBool (Platform::String^key, bool value)
void | SaveBool (winrt::hstring const &key, bool value)
void | SaveInt32 (Platform::String^key, int value)
void | SaveInt32 (winrt::hstring const &key, int value)
void | SaveInt32 (Platform::String^key, int value)
void | SaveSingle (winrt::hstring const &key, float value)
void | SaveSingle (Platform::String^key, float value)
void | SaveSingle (Platform::String^key, float value)
void | SaveString (Platform::String^key, Platform::String^string)
void | SaveString (winrt::hstring const &key, winrt::hstring const &string)
void | SaveString (Platform::String^key, Platform::String^string)
void | SaveXMFLOAT3 (winrt::hstring const &key, DirectX::XMFLOAT3 value)
void | SaveXMFLOAT3 (Platform::String^key, DirectX::XMFLOAT3 value)
void | SaveXMFLOAT3 (Platform::String^key, DirectX::XMFLOAT3 value)

Public Attributes

internal | __pad0__: void Initialize( _In_ Windows::Foundation::Collections::IPropertySet^ settingsValues
internal _In_ Platform::String | key

Private Attributes

Platform::String | m_keyName
winrt::hstring | m_keyName
winrt::Windows::Foundation::Collections::IPropertySet | m_settingsValues
Windows::Foundation::Collections::IPropertySet | m_settingsValues

Detailed Description

Definition at line 13 of file PersistentState.h.

Member Function Documentation

void Initialize | ( | _In_ winrt::Windows::Foundation::Collections::IPropertySet | settingsValues,
 |  | _In_ winrt::hstring const & | key
 | ) |  |
bool LoadBool | ( | Platform::String^ | key,
 |  | bool | defaultValue
 | ) |  |

Definition at line 81 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        int state = safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetInt32();
        return state ? true : false;
    }
    return defaultValue;
}

bool LoadBool | ( | winrt::hstring const & | key,
 |  | bool | defaultValue
 | ) |  |

Definition at line 49 of file PersistentState.cpp.

{
    return winrt::unbox_value_or(m_settingsValues.TryLookup(m_keyName + key), defaultValue);
}

bool LoadBool | ( | Platform::String^ | key,
 |  | bool | defaultValue
 | ) |  |
int LoadInt32 | ( | winrt::hstring const & | key,
 |  | int | defaultValue
 | ) |  |

Definition at line 54 of file PersistentState.cpp.

{
    return winrt::unbox_value_or(m_settingsValues.TryLookup(m_keyName + key), defaultValue);
}

int LoadInt32 | ( | Platform::String^ | key,
 |  | int | defaultValue
 | ) |  |

Definition at line 92 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetInt32();
    }
    return defaultValue;
}

int LoadInt32 | ( | Platform::String^ | key,
 |  | int | defaultValue
 | ) |  |
float LoadSingle | ( | winrt::hstring const & | key,
 |  | float | defaultValue
 | ) |  |

Definition at line 59 of file PersistentState.cpp.

{
    return winrt::unbox_value_or(m_settingsValues.TryLookup(m_keyName + key), defaultValue);
}

float LoadSingle | ( | Platform::String^ | key,
 |  | float | defaultValue
 | ) |  |

Definition at line 102 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetSingle();
    }
    return defaultValue;
}

float LoadSingle | ( | Platform::String^ | key,
 |  | float | defaultValue
 | ) |  |
winrt::hstring LoadString | ( | winrt::hstring const & | key,
 |  | winrt::hstring const & | defaultValue
 | ) |  |

Definition at line 76 of file PersistentState.cpp.

{
    return winrt::unbox_value_or<winrt::hstring>(m_settingsValues.TryLookup(m_keyName + key), defaultValue);
}

Platform::String LoadString | ( | Platform::String^ | key,
 |  | Platform::String^ | defaultValue
 | ) |  |

Definition at line 128 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetString();
    }
    return defaultValue;
}

Platform::String LoadString | ( | Platform::String^ | key,
 |  | Platform::String^ | defaultValue
 | ) |  |
XMFLOAT3 LoadXMFLOAT3 | ( | Platform::String^ | key,
 |  | DirectX::XMFLOAT3 | defaultValue
 | ) |  |

Definition at line 112 of file PersistentState.cpp.

{
    XMFLOAT3 value;
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        Platform::Array<float>^ array3;
        safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetSingleArray(&array3);
        value.x = array3[0];
        value.y = array3[1];
        value.z = array3[2];
        return value;
    }
    return defaultValue;
}

DirectX::XMFLOAT3 LoadXMFLOAT3 | ( | Platform::String^ | key,
 |  | DirectX::XMFLOAT3 | defaultValue
 | ) |  |
XMFLOAT3 LoadXMFLOAT3 | ( | winrt::hstring const & | key,
 |  | DirectX::XMFLOAT3 | defaultValue
 | ) |  |

Definition at line 64 of file PersistentState.cpp.

{
    auto propertyValue = winrt::unbox_value_or(m_settingsValues.TryLookup(m_keyName + key), winrt::Windows::Foundation::IPropertyValue{});
    if (propertyValue)
    {
        winrt::com_array<float> array3;
        propertyValue.GetSingleArray(array3);
        return { array3[0], array3[1], array3[2] };
    }
    return defaultValue;
}

void SaveBool | ( | Platform::String^ | key,
 |  | bool | value
 | ) |  |
void SaveBool | ( | Platform::String^ | key,
 |  | bool | value
 | ) |  |

Definition at line 27 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        m_settingsValues->Remove(fullKey);
    }
    m_settingsValues->Insert(fullKey, PropertyValue::CreateInt32(value ? 1 : 0));
}

void SaveBool | ( | winrt::hstring const & | key,
 |  | bool | value
 | ) |  |

Definition at line 24 of file PersistentState.cpp.

{
    m_settingsValues.Insert(m_keyName + key, winrt::box_value(value));
}

void SaveInt32 | ( | Platform::String^ | key,
 |  | int | value
 | ) |  |

Definition at line 37 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        m_settingsValues->Remove(fullKey);
    }
    m_settingsValues->Insert(fullKey, PropertyValue::CreateInt32(value));
}

void SaveInt32 | ( | winrt::hstring const & | key,
 |  | int | value
 | ) |  |

Definition at line 29 of file PersistentState.cpp.

{
    m_settingsValues.Insert(m_keyName + key, winrt::box_value(value));
}

void SaveInt32 | ( | Platform::String^ | key,
 |  | int | value
 | ) |  |
void SaveSingle | ( | winrt::hstring const & | key,
 |  | float | value
 | ) |  |

Definition at line 34 of file PersistentState.cpp.

{
    m_settingsValues.Insert(m_keyName + key, winrt::box_value(value));
}

void SaveSingle | ( | Platform::String^ | key,
 |  | float | value
 | ) |  |
void SaveSingle | ( | Platform::String^ | key,
 |  | float | value
 | ) |  |

Definition at line 47 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        m_settingsValues->Remove(fullKey);
    }
    m_settingsValues->Insert(fullKey, PropertyValue::CreateSingle(value));
}

void SaveString | ( | Platform::String^ | key,
 |  | Platform::String^ | string
 | ) |  |

Definition at line 71 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        m_settingsValues->Remove(fullKey);
    }
    m_settingsValues->Insert(fullKey, PropertyValue::CreateString(string));
}

void SaveString | ( | winrt::hstring const & | key,
 |  | winrt::hstring const & | string
 | ) |  |

Definition at line 44 of file PersistentState.cpp.

{
    m_settingsValues.Insert(m_keyName + key, winrt::box_value(string));
}

void SaveString | ( | Platform::String^ | key,
 |  | Platform::String^ | string
 | ) |  |
void SaveXMFLOAT3 | ( | winrt::hstring const & | key,
 |  | DirectX::XMFLOAT3 | value
 | ) |  |

Definition at line 39 of file PersistentState.cpp.

{
    m_settingsValues.Insert(m_keyName + key, PropertyValue::CreateSingleArray({ value.x, value.y, value.z }));
}

void SaveXMFLOAT3 | ( | Platform::String^ | key,
 |  | DirectX::XMFLOAT3 | value
 | ) |  |

Definition at line 57 of file PersistentState.cpp.

{
    Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
    if (m_settingsValues->HasKey(fullKey))
    {
        m_settingsValues->Remove(fullKey);
    }
    Platform::Array<float>^ array3 = ref new Platform::Array<float>(3);
    array3[0] = value.x;
    array3[1] = value.y;
    array3[2] = value.z;
    m_settingsValues->Insert(fullKey, PropertyValue::CreateSingleArray(array3));
}

void SaveXMFLOAT3 | ( | Platform::String^ | key,
 |  | DirectX::XMFLOAT3 | value
 | ) |  |

Member Data Documentation

internal __pad0__

Definition at line 17 of file PersistentState.h.

internal _In_ Platform::String key

Definition at line 17 of file PersistentState.h.

winrt::hstring m_keyName [private]

Definition at line 35 of file PersistentState.h.

Platform::String m_keyName [private]

Definition at line 34 of file PersistentState.h.

Windows::Foundation::Collections::IPropertySet m_settingsValues [private]

Definition at line 35 of file PersistentState.h.

winrt::Windows::Foundation::Collections::IPropertySet m_settingsValues [private]

Definition at line 36 of file PersistentState.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/Common/PersistentState.h
  • Simple3DGameDX/cppwinrt/Common/PersistentState.h
  • Simple3DGameXaml/cpp/Common/PersistentState.h
  • Simple3DGameDX/cpp/Common/PersistentState.cpp
  • Simple3DGameDX/cppwinrt/Common/PersistentState.cpp
  • Simple3DGameXaml/cpp/Common/PersistentState.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PipeEvents Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

PipeEvents Struct Reference

List of all members.

Public Attributes

task_completion_event< void > | on_read
task_completion_event< IBuffer^> | on_write
unsigned int | read_bytes
unsigned long long | total_pipe_bytes
IBuffer | unread_buffer

Detailed Description

Definition at line 63 of file Scenario1.xaml.cpp.

Member Data Documentation

task_completion_event<void> on_read

Definition at line 65 of file Scenario1.xaml.cpp.

task_completion_event<IBuffer^> on_write

Definition at line 64 of file Scenario1.xaml.cpp.

unsigned int read_bytes

Definition at line 67 of file Scenario1.xaml.cpp.

unsigned long long total_pipe_bytes

Definition at line 68 of file Scenario1.xaml.cpp.

IBuffer unread_buffer

Definition at line 66 of file Scenario1.xaml.cpp.

The documentation for this struct was generated from the following file:
  • Compression/cpp/Scenario1.xaml.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PipeIn Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

PipeIn Class Reference

List of all members.

Public Member Functions

virtual | ~PipeIn ()
virtual
IAsyncOperationWithProgress
< IBuffer^, unsigned int > 		ReadAsync (IBuffer^buf, unsigned int count, InputStreamOptions options)

Public Attributes

internal | __pad0__: PipeIn(shared_ptr<PipeEvents> e) { events = e

Private Attributes

shared_ptr< PipeEvents > | events

Detailed Description

Definition at line 104 of file Scenario1.xaml.cpp.

Constructor & Destructor Documentation

virtual ~PipeIn ( ) [inline, virtual]

Definition at line 138 of file Scenario1.xaml.cpp.

{ }

Member Function Documentation

virtual IAsyncOperationWithProgress<IBuffer^, unsigned int> ReadAsync | ( | IBuffer^ | buf,
 |  | unsigned int | count,
 |  | InputStreamOptions | options |
 | ) |  |  | [inline, virtual]

Definition at line 112 of file Scenario1.xaml.cpp.

    {
        return create_async([this, buf, count](progress_reporter<unsigned int> reporter) -> IBuffer^
        {
            buf->Length = 0;
            while (buf->Length < count)
            {
                if (events->unread_buffer == nullptr)
                {
                    events->unread_buffer = create_task(events->on_write).get();
                    events->on_write = task_completion_event<IBuffer^>();
                    events->read_bytes = 0;
                }
                unsigned int to_copy = min(min(count, buf->Capacity) - buf->Length, events->unread_buffer->Length - events->read_bytes);
                memcpy(GetUnderlyingBuffer(buf) + buf->Length, GetUnderlyingBuffer(events->unread_buffer) + events->read_bytes, to_copy);
                buf->Length += to_copy;
                events->read_bytes += to_copy;
                if (events->read_bytes >= events->unread_buffer->Length)
                {
                    events->unread_buffer = nullptr;
                    events->on_read.set();
                }
            }
            return buf;
        });
    }

Member Data Documentation

internal __pad0__

Definition at line 109 of file Scenario1.xaml.cpp.

shared_ptr<PipeEvents> events [private]

Definition at line 140 of file Scenario1.xaml.cpp.

The documentation for this class was generated from the following file:
  • Compression/cpp/Scenario1.xaml.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PipeOut Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Attributes

PipeOut Class Reference

List of all members.

Public Member Functions

virtual | ~PipeOut ()
virtual IAsyncOperation< bool > | FlushAsync ()
virtual
IAsyncOperationWithProgress
< unsigned int, unsigned int > 		WriteAsync (IBuffer^buf)

Public Attributes

internal | __pad0__: PipeOut(shared_ptr<PipeEvents> e) { events = e

Private Attributes

shared_ptr< PipeEvents > | events

Detailed Description

Definition at line 71 of file Scenario1.xaml.cpp.

Constructor & Destructor Documentation

virtual ~PipeOut ( ) [inline, virtual]

Definition at line 99 of file Scenario1.xaml.cpp.

{ }

Member Function Documentation

virtual IAsyncOperation<bool> FlushAsync ( ) [inline, virtual]

Definition at line 92 of file Scenario1.xaml.cpp.

    {
        return create_async([this]()
        {
            return true;
        });
    }

virtual IAsyncOperationWithProgress<unsigned int, unsigned int> WriteAsync ( IBuffer^ buf ) [inline, virtual]

Definition at line 80 of file Scenario1.xaml.cpp.

    {
        return create_async([this, buf](progress_reporter<unsigned int> reporter) -> unsigned int
        {
            events->total_pipe_bytes += buf->Length;
            events->on_write.set(buf);
            create_task(events->on_read).wait();
            events->on_read = task_completion_event<void>();
            return buf->Length;
        });
    }

Member Data Documentation

internal __pad0__

Definition at line 76 of file Scenario1.xaml.cpp.

shared_ptr<PipeEvents> events [private]

Definition at line 101 of file Scenario1.xaml.cpp.

The documentation for this class was generated from the following file:
  • Compression/cpp/Scenario1.xaml.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleDataModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PivotCS
  • SampleDataModel
Public Member Functions | Static Public Member Functions | Properties

SampleDataModel Class Reference

List of all members.

Public Member Functions

SampleDataModel (string title, string imagePath, bool isNew=false, bool isFlagged=false)
override string | ToString ()

Static Public Member Functions

static ObservableCollection
< SampleDataModel > 		GetSampleData ()

Properties

string | ImagePath [get, set]
bool | IsFlagged [get, set]
bool | IsNew [get, set]
string | Title [get, set]

Detailed Description

Definition at line 10 of file SampleData.cs.

Constructor & Destructor Documentation

SampleDataModel | ( | string | title,
 |  | string | imagePath,
 |  | bool | isNew = false,
 |  | bool | isFlagged = false |
 | ) |  |  | [inline]

Definition at line 17 of file SampleData.cs.

        {
            this.Title = title;
            this.ImagePath = imagePath;
            this.IsNew = isNew;
            this.IsFlagged = isFlagged;
        }

Member Function Documentation

static ObservableCollection<SampleDataModel> GetSampleData ( ) [inline, static]

Definition at line 30 of file SampleData.cs.

        {
            var MyCollection = new ObservableCollection<SampleDataModel>();
            MyCollection.Add(new SampleDataModel("Cliff", "ms-appx:///Assets/cliff.jpg"));
            MyCollection.Add(new SampleDataModel("Grapes", "ms-appx:///Assets/grapes.jpg"));
            MyCollection.Add(new SampleDataModel("Rainier", "ms-appx:///Assets/Rainier.jpg", true));
            MyCollection.Add(new SampleDataModel("Sunset", "ms-appx:///Assets/Sunset.jpg", true, true));
            MyCollection.Add(new SampleDataModel("Treetops", "ms-appx:///Assets/Treetops.jpg", true));
            MyCollection.Add(new SampleDataModel("Valley", "ms-appx:///Assets/Valley.jpg", false, true));
            return MyCollection;
        }

override string ToString ( ) [inline]

Definition at line 25 of file SampleData.cs.

        {
            return this.Title;
        }

Property Documentation

string ImagePath [get, set]

Definition at line 13 of file SampleData.cs.

bool IsFlagged [get, set]

Definition at line 15 of file SampleData.cs.

bool IsNew [get, set]

Definition at line 14 of file SampleData.cs.

string Title [get, set]

Definition at line 12 of file SampleData.cs.

The documentation for this class was generated from the following file:
  • XamlPivot/cs/SampleData.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PivotCS
  • Scenario1
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Public Attributes

List< SampleDataModel > | AllItems = null
List< SampleDataModel > | FlaggedItems = null
List< SampleDataModel > | NewItems = null

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | Scenario2_Click (Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args)
void | Scenario3_Click (Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args)
async void | ShowItem (SampleDataModel model)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 35 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            NewItems = SampleDataModel.GetSampleData().Where(x => x.IsNew).ToList();
            FlaggedItems = SampleDataModel.GetSampleData().Where(x => x.IsFlagged).ToList();
            AllItems = SampleDataModel.GetSampleData().ToList();

            this.DataContext = this;
        }

Member Function Documentation

void ListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario1.xaml.cs.

        {
            SampleDataModel SelectedItem = null;

            if (e.AddedItems.Count >= 1)
            {
                SelectedItem = e.AddedItems[0] as SampleDataModel;
                (sender as ListView).SelectedItem = null;
                ShowItem(SelectedItem);
            }

        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Scenario2_Click | ( | Windows.UI.Xaml.Documents.Hyperlink | sender,
 |  | Windows.UI.Xaml.Documents.HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 87 of file Scenario1.xaml.cs.

        {
            this.Frame.Navigate(typeof(Scenario2));
        }

void Scenario3_Click | ( | Windows.UI.Xaml.Documents.Hyperlink | sender,
 |  | Windows.UI.Xaml.Documents.HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 91 of file Scenario1.xaml.cs.

        {
            this.Frame.Navigate(typeof(Scenario3));
        }

async void ShowItem ( SampleDataModel model ) [inline, private]

Definition at line 64 of file Scenario1.xaml.cs.

        {
            var MyDialog = new ContentDialog();

            if (model != null)
            {
                var MyImage = new Image();
                MyImage.Source = new BitmapImage(new Uri(model.ImagePath));
                MyImage.HorizontalAlignment = HorizontalAlignment.Stretch;
                MyImage.VerticalAlignment = VerticalAlignment.Stretch;
                MyImage.Stretch = Windows.UI.Xaml.Media.Stretch.UniformToFill;
                MyDialog.Title = String.Format("You have selected {0}", model.ToString());
                MyDialog.Content = MyImage;
            }
            else
            {
                MyDialog.Title = "No item found";

            }

            MyDialog.PrimaryButtonText = "OK";
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => await MyDialog.ShowAsync());
        }

Member Data Documentation

List<SampleDataModel> AllItems = null

Definition at line 33 of file Scenario1.xaml.cs.

List<SampleDataModel> FlaggedItems = null

Definition at line 32 of file Scenario1.xaml.cs.

List<SampleDataModel> NewItems = null

Definition at line 31 of file Scenario1.xaml.cs.

MainPage rootPage [private]

Definition at line 30 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlPivot/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PivotCS
  • Scenario2
Public Member Functions | Public Attributes | Properties | Private Member Functions

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Public Attributes

List< SampleDataModel > | AllItems = null
List< SampleDataModel > | FlaggedItems = null
List< SampleDataModel > | NewItems = null

Properties

ObservableCollection
< SampleDataModel > 		Suggestions [get, set]

Private Member Functions

void | AutoSuggestBox_QuerySubmitted (AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
void | AutoSuggestBox_TextChanged (AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
void | BackButton_Click (object sender, RoutedEventArgs e)
void | ListView_ItemClicked (object sender, ItemClickEventArgs e)
async void | ShowItem (SampleDataModel model)

Detailed Description

Definition at line 27 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 34 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
            NewItems = SampleDataModel.GetSampleData().Where(x => x.IsNew).ToList();
            FlaggedItems = SampleDataModel.GetSampleData().Where(x => x.IsFlagged).ToList();
            AllItems = SampleDataModel.GetSampleData().ToList();
            this.Suggestions = new ObservableCollection<SampleDataModel>();

            this.DataContext = this;
        }

Member Function Documentation

void AutoSuggestBox_QuerySubmitted | ( | AutoSuggestBox | sender,
 |  | AutoSuggestBoxQuerySubmittedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario2.xaml.cs.

        {
            SampleDataModel FoundItem = null;

            if (args.ChosenSuggestion != null && args.ChosenSuggestion is SampleDataModel)
            {
                FoundItem = args.ChosenSuggestion as SampleDataModel;
            }
            else if (String.IsNullOrEmpty(args.QueryText) == false)
            {
                foreach (var Item in AllItems)
                {
                    if (Item.Title.Equals(args.QueryText, StringComparison.OrdinalIgnoreCase))
                    {
                        FoundItem = Item;
                        break;
                    }
                }
            }

            ShowItem(FoundItem);
        }

void AutoSuggestBox_TextChanged | ( | AutoSuggestBox | sender,
 |  | AutoSuggestBoxTextChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario2.xaml.cs.

        {
            // TODO: not being called from flyout
            if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                Suggestions.Clear();
                foreach (var Item in AllItems)
                {
                    if (Item.Title.IndexOf(sender.Text, StringComparison.OrdinalIgnoreCase) >= 0)
                    {
                        Suggestions.Add(Item);
                    }
                }
            }
        }

void BackButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario2.xaml.cs.

        {
            if (this.Frame.CanGoBack)
                this.Frame.GoBack();
        }

void ListView_ItemClicked | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 116 of file Scenario2.xaml.cs.

        {
            SampleDataModel SelectedItem = e.ClickedItem as SampleDataModel;
            ShowItem(SelectedItem);
        }

async void ShowItem ( SampleDataModel model ) [inline, private]

Definition at line 92 of file Scenario2.xaml.cs.

        {
            var MyDialog = new ContentDialog();

            if (model != null)
            {
                var MyImage = new Image();
                MyImage.Source = new BitmapImage(new Uri(model.ImagePath));
                MyImage.HorizontalAlignment = HorizontalAlignment.Stretch;
                MyImage.VerticalAlignment = VerticalAlignment.Stretch;
                MyImage.Stretch = Windows.UI.Xaml.Media.Stretch.UniformToFill;
                MyDialog.Title = String.Format("You have selected {0}", model.ToString());
                MyDialog.Content = MyImage;
            }
            else
            {
                MyDialog.Title = "No item found";
            }

            MyDialog.PrimaryButtonText = "OK";
            await MyDialog.ShowAsync();

        }

Member Data Documentation

List<SampleDataModel> AllItems = null

Definition at line 32 of file Scenario2.xaml.cs.

List<SampleDataModel> FlaggedItems = null

Definition at line 31 of file Scenario2.xaml.cs.

List<SampleDataModel> NewItems = null

Definition at line 30 of file Scenario2.xaml.cs.

Property Documentation

ObservableCollection<SampleDataModel> Suggestions [get, set]

Definition at line 29 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlPivot/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PivotCS
  • Scenario3
Public Member Functions

Scenario3 Class Reference

List of all members.

Public Member Functions

Scenario3 ()

Detailed Description

Definition at line 18 of file Scenario3.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 20 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlPivot/cs/Scenario3.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TabHeader Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PivotCS
  • TabHeader
Public Member Functions | Static Public Attributes | Properties

TabHeader Class Reference

List of all members.

Public Member Functions

TabHeader ()

Static Public Attributes

static readonly DependencyProperty | GlyphProperty = DependencyProperty.Register("Glyph", typeof(string), typeof(TabHeader), null)
static readonly DependencyProperty | LabelProperty = DependencyProperty.Register("Label", typeof(string), typeof(TabHeader), null)

Properties

string | Glyph [get, set]
string | Label [get, set]

Detailed Description

Definition at line 20 of file TabHeader.xaml.cs.

Constructor & Destructor Documentation

TabHeader ( ) [inline]

Definition at line 39 of file TabHeader.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Data Documentation

readonly DependencyProperty GlyphProperty = DependencyProperty.Register("Glyph", typeof(string), typeof(TabHeader), null) [static]

Definition at line 22 of file TabHeader.xaml.cs.

readonly DependencyProperty LabelProperty = DependencyProperty.Register("Label", typeof(string), typeof(TabHeader), null) [static]

Definition at line 30 of file TabHeader.xaml.cs.

Property Documentation

string Glyph [get, set]

Definition at line 25 of file TabHeader.xaml.cs.

string Label [get, set]

Definition at line 33 of file TabHeader.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlPivot/cs/TabHeader.xaml.cs
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • PlaybackControl
Public Member Functions | Private Member Functions | Private Attributes

PlaybackControl Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

PlaybackControl ()
async void | Pause ()
async void | Play ()
async void | SelectFile ()
void | SetAudioCategory (AudioCategory category)
void | SetAudioDeviceType (AudioDeviceType devicetype)
async void | Stop ()

Private Member Functions

~PlaybackControl ()
async void | AppMuted ()
async void | AppUnmuted ()
void | Button_Pause_Click (object sender, RoutedEventArgs e)
void | Button_Play_Click (object sender, RoutedEventArgs e)
void | Button_Stop_Click (object sender, RoutedEventArgs e)
async void | DisplayStatus (string text)
string | GetTimeStampedMessage (string eventText)
string | SoundLevelToString (SoundLevel level)
void | SystemMediaControls_ButtonPressed (SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs e)
void | SystemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs e)

Private Attributes

CoreWindow | cw = Window.Current.CoreWindow
bool | IsPlaying = false
MainPage | rootPage = MainPage.Current
SystemMediaTransportControls | systemMediaControls = null

Detailed Description

Definition at line 26 of file PlaybackControl.xaml.cs.

Constructor & Destructor Documentation

PlaybackControl ( ) [inline]

Definition at line 37 of file PlaybackControl.xaml.cs.

        {
            this.InitializeComponent();

            // add new handlers
            systemMediaControls = SystemMediaTransportControls.GetForCurrentView();
            systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
            systemMediaControls.ButtonPressed += SystemMediaControls_ButtonPressed;
            systemMediaControls.IsPlayEnabled = true;
            systemMediaControls.IsPauseEnabled = true;
            systemMediaControls.IsStopEnabled = true;
            systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Closed;
        }

~PlaybackControl ( ) [inline, private]

Definition at line 51 of file PlaybackControl.xaml.cs.

        {
            if (systemMediaControls != null)
            {
                systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
                systemMediaControls.ButtonPressed -= SystemMediaControls_ButtonPressed;
            }
        }

Member Function Documentation

async void AppMuted ( ) [inline, private]

Definition at line 157 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (OutputMedia.CurrentState != MediaElementState.Paused)
                {
                    IsPlaying = true;
                    Pause();
                }
                else
                {
                    IsPlaying = false;
                }
            });
            DisplayStatus(GetTimeStampedMessage("Muted"));
        }

async void AppUnmuted ( ) [inline, private]

Definition at line 174 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (IsPlaying)
                {
                    Play();
                }
            });
            DisplayStatus(GetTimeStampedMessage("Unmuted"));
        }

void Button_Pause_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 233 of file PlaybackControl.xaml.cs.

        {
            Pause();
        }

void Button_Play_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 228 of file PlaybackControl.xaml.cs.

        {
            Play();
        }

void Button_Stop_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 238 of file PlaybackControl.xaml.cs.

        {
            Stop();
        }

async void DisplayStatus ( string text ) [inline, private]

Definition at line 118 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Status.Text += text + "\n";
            });
        }

string GetTimeStampedMessage ( string eventText ) [inline, private]

Definition at line 126 of file PlaybackControl.xaml.cs.

        {
            return eventText + "   " + DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
        }

async void Pause ( ) [inline]

Definition at line 69 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputMedia.Pause();
                systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;
            });
        }

async void Play ( ) [inline]

Definition at line 60 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputMedia.Play();
                systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Playing;
            });
        }

async void SelectFile ( ) [inline]

Definition at line 97 of file PlaybackControl.xaml.cs.

        {
            Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.MusicLibrary;
            picker.FileTypeFilter.Add(".mp3");
            picker.FileTypeFilter.Add(".mp4");
            picker.FileTypeFilter.Add(".m4a");
            picker.FileTypeFilter.Add(".wma");
            picker.FileTypeFilter.Add(".wav");
            Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
                OutputMedia.AutoPlay = false;
                await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    OutputMedia.SetSource(stream, file.ContentType);
                });
            }
        }

void SetAudioCategory ( AudioCategory category ) [inline]

Definition at line 87 of file PlaybackControl.xaml.cs.

        {
            OutputMedia.AudioCategory = category;
        }

void SetAudioDeviceType ( AudioDeviceType devicetype ) [inline]

Definition at line 92 of file PlaybackControl.xaml.cs.

        {
            OutputMedia.AudioDeviceType = devicetype;
        }

string SoundLevelToString ( SoundLevel level ) [inline, private]

Definition at line 135 of file PlaybackControl.xaml.cs.

        {
            string LevelString;

            switch (level)
            {
                case SoundLevel.Muted:
                    LevelString = "Muted";
                    break;
                case SoundLevel.Low:
                    LevelString = "Low";
                    break;
                case SoundLevel.Full:
                    LevelString = "Full";
                    break;
                default:
                    LevelString = "Unknown";
                    break;
            }
            return LevelString;
        }

async void Stop ( ) [inline]

Definition at line 78 of file PlaybackControl.xaml.cs.

        {
            await cw.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputMedia.Stop();
                systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Stopped;
            });
        }

void SystemMediaControls_ButtonPressed | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsButtonPressedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 204 of file PlaybackControl.xaml.cs.

        {
            switch (e.Button)
            {
                case SystemMediaTransportControlsButton.Play:
                    Play();
                    DisplayStatus(GetTimeStampedMessage("Play Pressed"));
                    break;

                case SystemMediaTransportControlsButton.Pause:
                    Pause();
                    DisplayStatus(GetTimeStampedMessage("Pause Pressed"));
                    break;

                case SystemMediaTransportControlsButton.Stop:
                    Stop();
                    DisplayStatus(GetTimeStampedMessage("Stop Pressed"));
                    break;

                default:
                    break;
            }
        }

void SystemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 186 of file PlaybackControl.xaml.cs.

        {
            if (e.Property == SystemMediaTransportControlsProperty.SoundLevel)
            {
                var soundLevelState = sender.SoundLevel;

                DisplayStatus(GetTimeStampedMessage("App sound level is [" + SoundLevelToString(soundLevelState) + "]"));
                if (soundLevelState == SoundLevel.Muted)
                {
                    AppMuted();
                }
                else
                {
                    AppUnmuted();
                }
            }
        }

Member Data Documentation

CoreWindow cw = Window.Current.CoreWindow [private]

Definition at line 32 of file PlaybackControl.xaml.cs.

bool IsPlaying = false [private]

Definition at line 33 of file PlaybackControl.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file PlaybackControl.xaml.cs.

SystemMediaTransportControls systemMediaControls = null [private]

Definition at line 35 of file PlaybackControl.xaml.cs.

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/PlaybackControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario1
Public Member Functions | Private Member Functions

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 27 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario1.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Movie);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario10
Public Member Functions | Private Member Functions

Scenario10 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario10 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario10.xaml.cs.

Constructor & Destructor Documentation

Scenario10 ( ) [inline]

Definition at line 27 of file Scenario10.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario10.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Other);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario10.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario2
Public Member Functions | Private Member Functions

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 27 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario2.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Media);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario3
Public Member Functions | Private Member Functions

Scenario3 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario3.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 27 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario3.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.GameChat);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario3.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario4
Public Member Functions | Private Member Functions

Scenario4 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario4.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 27 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario4.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Speech);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario4.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario5
Public Member Functions | Private Member Functions

Scenario5 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario5 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario5.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 27 of file Scenario5.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario5.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Communications);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario5.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario6
Public Member Functions | Private Member Functions

Scenario6 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario6 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario6.xaml.cs.

Constructor & Destructor Documentation

Scenario6 ( ) [inline]

Definition at line 27 of file Scenario6.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario6.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.Alerts);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario6.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario7
Public Member Functions | Private Member Functions

Scenario7 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario7.xaml.cs.

Constructor & Destructor Documentation

Scenario7 ( ) [inline]

Definition at line 27 of file Scenario7.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario7.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.SoundEffects);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario7.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario8
Public Member Functions | Private Member Functions

Scenario8 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario8 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario8.xaml.cs.

Constructor & Destructor Documentation

Scenario8 ( ) [inline]

Definition at line 27 of file Scenario8.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario8.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.GameEffects);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario8.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PlaybackManager
  • Scenario9
Public Member Functions | Private Member Functions

Scenario9 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario9 ()

Private Member Functions

void Default_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario9.xaml.cs.

Constructor & Destructor Documentation

Scenario9 ( ) [inline]

Definition at line 27 of file Scenario9.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario9.xaml.cs.

        {
            Playback.SetAudioCategory(AudioCategory.GameMedia);
            Playback.SelectFile();
        }

The documentation for this class was generated from the following file:
  • AudioCategory/cs/AudioCategory/Scenario9.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PNTVertex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

PNTVertex Struct Reference

#include "ConstantBuffers.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | normal
DirectX::XMFLOAT3 | position
DirectX::XMFLOAT2 | textureCoordinate

Detailed Description

Definition at line 14 of file ConstantBuffers.h.

Member Data Documentation

DirectX::XMFLOAT3 normal

Definition at line 17 of file ConstantBuffers.h.

DirectX::XMFLOAT3 position

Definition at line 16 of file ConstantBuffers.h.

DirectX::XMFLOAT2 textureCoordinate

Definition at line 18 of file ConstantBuffers.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Print3D Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes | Private Member Functions | Static Private Attributes

Print3D Class Reference

List of all members.

Public Attributes

GameObject ObjectToPrint

Private Member Functions

void | OnGUI ()
void | Start ()
void | StartPrinting ()
void | Update ()

Static Private Attributes

static byte | a
static byte | b
static bool | enableButton = true
static byte | g
static UInt32 | groupId
static uint | indicesCount
static UInt32[] | indicesMaterialPrint
static UInt32[] | indicesPrint
static string | labelText = "Status for printing"
static byte[] | pngBytes
static byte | r
static string | Step1 = "Get mesh/texture from Game Object"
static string | Step2 = "Store into Printing3d API"
static string | Step3 = "Launch printing dialog"
static double[] | uvPrint
static uint | verticesCount
static uint | verticesMaterialCount
static double[] | verticesPrint

Detailed Description

Definition at line 27 of file Print3D.cs.

Member Function Documentation

void OnGUI ( ) [inline, private]

Definition at line 54 of file Print3D.cs.

    {
        GUI.Label(new UnityEngine.Rect(20, 100, 400, 60), labelText, new GUIStyle { fontSize = 36 });

        if (GUI.Button(new UnityEngine.Rect(20, 20, 80, 80), "3D Print"))
        {
            StartPrinting();
        }
    }

void Start ( ) [inline, private]

Definition at line 197 of file Print3D.cs.

    {

    }

void StartPrinting ( ) [inline, private]

Definition at line 64 of file Print3D.cs.

    {
        // ignore button click until launch print dialog
        if (enableButton)
        {
            enableButton = false;
        }
        else
        {
            return;
        }

        labelText = Step1;

        Mesh mesh = null;

        // assign one obj to ObjectToPrint or
        // put this Print3D.cs under model
        if (ObjectToPrint != null)
        {
            var meshFilter = ObjectToPrint.GetComponentInChildren<MeshFilter>();

            var meshRenderer = ObjectToPrint.GetComponentInChildren<MeshRenderer>();

            if (meshRenderer.sharedMaterial.GetTexture("_MainTex") != null)
            {
                // get texture bytes from Unity
                var texture = meshRenderer.sharedMaterial.GetTexture("_MainTex") as Texture2D;
                pngBytes = texture.EncodeToPNG();
            }
            else
            {
                // get color from Unity, convert to byte
                Color color = meshRenderer.sharedMaterial.color;
                a = (byte)(color.a * 255);
                r = (byte)(color.r * 255);
                g = (byte)(color.g * 255);
                b = (byte)(color.b * 255);
            }
            // get mesh information from Unity
            mesh = meshFilter.sharedMesh;
        }
        else
        {
            // get texture bytes from Unity
            var texture = transform.GetComponent<SkinnedMeshRenderer>().material.GetTexture("_MainTex") as Texture2D;
            pngBytes = texture.EncodeToPNG();
            // get mesh information from Unity
            mesh = transform.GetComponent<SkinnedMeshRenderer>().sharedMesh;
        }

        indicesCount = (uint)mesh.triangles.Length / 3;
        verticesCount = (uint)mesh.vertices.Length;
        verticesMaterialCount = (uint)mesh.triangles.Length / 3;

        indicesPrint = new UInt32[mesh.triangles.Length];
        verticesPrint = new double[mesh.vertices.Length * 3];
        indicesMaterialPrint = new UInt32[mesh.triangles.Length / 3 * 4];

        if (pngBytes != null)
        {
      // need UV mapping
            uvPrint = new double[mesh.uv.Length * 2];
        }

        groupId = 1;

        int j = 0;

        labelText = "Getting indices";
        System.Diagnostics.Debug.WriteLine("Getting indices");
        // get indices and indices for material
        for (int i = 0; i < mesh.triangles.Length; i++)
        {
            indicesPrint[i] = (UInt32)mesh.triangles[i];

            // vertex corresponding to uv
            if (i % 3 == 0)
            {
                indicesMaterialPrint[j] = groupId;
                j++;
            }

            if (pngBytes != null)
            {
        // UV mapping indices
                indicesMaterialPrint[j] = (UInt32)mesh.triangles[i];
            }
            else
            {
        // only color color material, index is 0
                indicesMaterialPrint[j] = 0;
            }
            j++;
        }

        labelText = "Getting vertices";
        System.Diagnostics.Debug.WriteLine("Getting vertices");

        // get vertices
        for (int i = 0; i < mesh.vertices.Length; i++)
        {
            verticesPrint[i * 3] = (double)mesh.vertices[i].x;
            verticesPrint[i * 3 + 1] = (double)mesh.vertices[i].y;
            verticesPrint[i * 3 + 2] = (double)mesh.vertices[i].z;
        }

        if (pngBytes != null)
        {
            labelText = "Getting texture coordinates";
            System.Diagnostics.Debug.WriteLine("Getting texture coordinates");
            // get UVs
            for (int i = 0; i < mesh.uv.Length; i++)
            {
                uvPrint[i * 2] = (double)mesh.uv[i].x;
                uvPrint[i * 2 + 1] = (double)mesh.uv[i].y;
            }
        }

        labelText = "Launching 3D Print UI";

        System.Diagnostics.Debug.WriteLine("Launching 3D Print UI.");

#if UNITY_WSA && !UNITY_EDITOR
        // start to pass the mesh/texture into Printing3D API
        // launch the print dialog
        UIThread();
#else
        enableButton = true;
#endif
    }

void Update ( ) [inline, private]

Definition at line 203 of file Print3D.cs.

    {

    }

Member Data Documentation

byte a [static, private]

Definition at line 44 of file Print3D.cs.

byte b [static, private]

Definition at line 44 of file Print3D.cs.

bool enableButton = true [static, private]

Definition at line 34 of file Print3D.cs.

byte g [static, private]

Definition at line 44 of file Print3D.cs.

UInt32 groupId [static, private]

Definition at line 40 of file Print3D.cs.

uint indicesCount [static, private]

Definition at line 46 of file Print3D.cs.

UInt32 [] indicesMaterialPrint [static, private]

Definition at line 38 of file Print3D.cs.

UInt32 [] indicesPrint [static, private]

Definition at line 36 of file Print3D.cs.

string labelText = "Status for printing" [static, private]

Definition at line 32 of file Print3D.cs.

GameObject ObjectToPrint

Definition at line 51 of file Print3D.cs.

byte [] pngBytes [static, private]

Definition at line 43 of file Print3D.cs.

byte r [static, private]

Definition at line 44 of file Print3D.cs.

string Step1 = "Get mesh/texture from Game Object" [static, private]

Definition at line 29 of file Print3D.cs.

string Step2 = "Store into Printing3d API" [static, private]

Definition at line 30 of file Print3D.cs.

string Step3 = "Launch printing dialog" [static, private]

Definition at line 31 of file Print3D.cs.

double [] uvPrint [static, private]

Definition at line 41 of file Print3D.cs.

uint verticesCount [static, private]

Definition at line 47 of file Print3D.cs.

uint verticesMaterialCount [static, private]

Definition at line 48 of file Print3D.cs.

double [] verticesPrint [static, private]

Definition at line 37 of file Print3D.cs.

The documentation for this class was generated from the following file:
  • 3DPrintingFromUnity/Assets/Script/Print3D.cs
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContinuationPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • ContinuationPage
Public Member Functions

ContinuationPage Class Reference

A paged used to flow text from a given text container Usage: Output scenarios 1-4 might not fit entirely on a given "printer page" In that case simply add new continuation pages of the given size until all the content can be displayed. More...

List of all members.

Public Member Functions

ContinuationPage (RichTextBlockOverflow textLinkContainer)

Detailed Description

Definition at line 10 of file ContinuationPage.xaml.cs.

Constructor & Destructor Documentation

ContinuationPage ( RichTextBlockOverflow textLinkContainer ) [inline]

Creates a continuation page and links text-flow to a text flow container.

Parameters:
textLinkContainer Text link container which will flow text into this page

Definition at line 16 of file ContinuationPage.xaml.cs.

        {
            InitializeComponent();
            textLinkContainer.OverflowContentTarget = ContinuationPageLinkedContainer;
        }

The documentation for this class was generated from the following file:
  • Printing/cs/ContinuationPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomOptionsPrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • CustomOptionsPrintHelper
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

CustomOptionsPrintHelper Class Reference

Inherits PrintSample::PrintHelper.

List of all members.

Public Member Functions

CustomOptionsPrintHelper (Page scenarioPage)

Protected Member Functions

override RichTextBlockOverflow | AddOnePrintPreviewPage (RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription)
override void | CreatePrintPreviewPages (object sender, PaginateEventArgs e)
override void | PrintTaskRequested (PrintManager sender, PrintTaskRequestedEventArgs e)

Properties

bool | ShowImage [get]
bool | ShowText [get]

Private Member Functions

async void | printDetailedOptions_OptionChanged (PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)

Private Attributes

internal DisplayContent | imageText = DisplayContent.TextAndImages
Task
< IRandomAccessStreamWithContentType > 		moderateMarginsIconTask
Task
< IRandomAccessStreamWithContentType > 		narrowMarginsIconTask
bool | showHeader = true
Task
< IRandomAccessStreamWithContentType > 		wideMarginsIconTask

Detailed Description

Definition at line 45 of file Scenario3CustomOptions.xaml.cs.

Constructor & Destructor Documentation

CustomOptionsPrintHelper ( Page scenarioPage ) [inline]

Definition at line 74 of file Scenario3CustomOptions.xaml.cs.

                                                           : base(scenarioPage)
        {
            // Start these tasks early because we know we're going to need the
            // streams in PrintTaskRequested.
            RandomAccessStreamReference wideMarginsIconReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/wideMargins.svg"));
            wideMarginsIconTask = wideMarginsIconReference.OpenReadAsync().AsTask();

            RandomAccessStreamReference moderateMarginsIconReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/moderateMargins.svg"));
            moderateMarginsIconTask = moderateMarginsIconReference.OpenReadAsync().AsTask();

            RandomAccessStreamReference narrowMarginsIconReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/narrowMargins.svg"));
            narrowMarginsIconTask = narrowMarginsIconReference.OpenReadAsync().AsTask();
        }

Member Function Documentation

override RichTextBlockOverflow AddOnePrintPreviewPage | ( | RichTextBlockOverflow | lastRTBOAdded,
 |  | PrintPageDescription | printPageDescription |
 | ) |  |  | [inline, protected, virtual]

Reimplemented from PrintHelper.

Definition at line 241 of file Scenario3CustomOptions.xaml.cs.

        {
            // Check if we need to hide/show text & images for this scenario
            // Since all is rulled by the first page (page flow), here is where we must start
            if (lastRTBOAdded == null)
            {
                // Get a refference to page objects
                Grid pageContent = (Grid)firstPage.FindName("PrintableArea");
                Image scenarioImage = (Image)firstPage.FindName("ScenarioImage");
                RichTextBlock mainText = (RichTextBlock)firstPage.FindName("TextContent");
                RichTextBlockOverflow firstLink = (RichTextBlockOverflow)firstPage.FindName("FirstLinkedContainer");
                RichTextBlockOverflow continuationLink = (RichTextBlockOverflow)firstPage.FindName("ContinuationPageLinkedContainer");

                // Hide(collapse) and move elements in different grid cells depending by the viewable content(only text, only pictures)

                scenarioImage.Visibility = ShowImage ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
                firstLink.SetValue(Grid.ColumnSpanProperty, ShowImage ? 1 : 2);

                scenarioImage.SetValue(Grid.RowProperty, ShowText ? 2 : 1);
                scenarioImage.SetValue(Grid.ColumnProperty, ShowText ? 1 : 0);

                pageContent.ColumnDefinitions[0].Width = new GridLength(ShowText ? 6 : 4, GridUnitType.Star);
                pageContent.ColumnDefinitions[1].Width = new GridLength(ShowText ? 4 : 6, GridUnitType.Star);

                // Break the text flow if the app is not printing text in order not to spawn pages with blank content
                mainText.Visibility = ShowText ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
                continuationLink.Visibility = ShowText ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;

                // Hide header if appropriate
                StackPanel header = (StackPanel)firstPage.FindName("Header");
                header.Visibility = showHeader ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
            }

            //Continue with the rest of the base printing layout processing (paper size, printable page size)
            return base.AddOnePrintPreviewPage(lastRTBOAdded, printPageDescription);
        }

override void CreatePrintPreviewPages | ( | object | sender,
 |  | PaginateEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

Reimplemented from PrintHelper.

Definition at line 278 of file Scenario3CustomOptions.xaml.cs.

        {
            // Get PageContent property
            PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(e.PrintTaskOptions);
            string pageContent = (printDetailedOptions.Options["PageContent"].Value as string).ToLowerInvariant();

            // Set the text & image display flag
            imageText = (DisplayContent)((Convert.ToInt32(pageContent.Contains("pictures")) << 1) | Convert.ToInt32(pageContent.Contains("text")));

            base.CreatePrintPreviewPages(sender, e);
        }

async void printDetailedOptions_OptionChanged | ( | PrintTaskOptionDetails | sender,
 |  | PrintTaskOptionChangedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for whenever the user makes changes to the options.

In this case, the options of interest are PageContent, Margins and Header.

Parameters:
sender | PrintTaskOptionDetails
args | PrintTaskOptionChangedEventArgs

Definition at line 175 of file Scenario3CustomOptions.xaml.cs.

        {
            bool invalidatePreview = false;

            string optionId = args.OptionId as string;
            if (string.IsNullOrEmpty(optionId))
            {
                return;
            }

            if (optionId == "PageContent")
            {
                invalidatePreview = true;
            }

            if (optionId == "Margins")
            {
                PrintCustomItemListOptionDetails marginsOption = (PrintCustomItemListOptionDetails)sender.Options["Margins"];
                string marginsValue = marginsOption.Value.ToString();

                switch (marginsValue)
                {
                    case "WideMargins":
                        ApplicationContentMarginTop = 0.2;
                        ApplicationContentMarginLeft = 0.2;
                        break;
                    case "ModerateMargins":
                        ApplicationContentMarginTop = 0.1;
                        ApplicationContentMarginLeft = 0.1;
                        break;
                    case "NarrowMargins":
                        ApplicationContentMarginTop = 0.05;
                        ApplicationContentMarginLeft = 0.05;
                        break;
                }

                if (marginsValue == "NarrowMargins")
                {
                    marginsOption.WarningText = "Narrow margins may not be supported by some printers";
                }
                else
                {
                    marginsOption.WarningText = "";
                }

                invalidatePreview = true;
            }

            if (optionId == "Header")
            {
                PrintCustomToggleOptionDetails headerOption = (PrintCustomToggleOptionDetails)sender.Options["Header"];
                showHeader = (bool)headerOption.Value;
                invalidatePreview = true;
            }

            if (invalidatePreview)
            {
                await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    printDocument.InvalidatePreview();
                });
            }
        }

override void PrintTaskRequested | ( | PrintManager | sender,
 |  | PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

Definition at line 96 of file Scenario3CustomOptions.xaml.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", async sourceRequestedArgs =>
            {
                var deferral = sourceRequestedArgs.GetDeferral();
                PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options);
                IList<string> displayedOptions = printDetailedOptions.DisplayedOptions;

                // Choose the printer options to be shown.
                // The order in which the options are appended determines the order in which they appear in the UI
                displayedOptions.Clear();

                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.ColorMode);

                // Create a new list option
                PrintCustomItemListOptionDetails pageFormat = printDetailedOptions.CreateItemListOption("PageContent", "Pictures");
                pageFormat.AddItem("PicturesText", "Pictures and text");
                pageFormat.AddItem("PicturesOnly", "Pictures only");
                pageFormat.AddItem("TextOnly", "Text only");

                // Add the custom option to the option list
                displayedOptions.Add("PageContent");

                // Create a new toggle option "Show header".
                PrintCustomToggleOptionDetails header = printDetailedOptions.CreateToggleOption("Header", "Show header");

                // App tells the user some more information about what the feature means.
                header.Description = "Display a header on the first page";

                // Set the default value
                header.TrySetValue(showHeader);

                // Add the custom option to the option list
                displayedOptions.Add("Header");

                // Create a new list option
                PrintCustomItemListOptionDetails margins = printDetailedOptions.CreateItemListOption("Margins", "Margins");
                margins.AddItem("WideMargins", "Wide", "Each margin is 20% of the paper size", await wideMarginsIconTask);
                margins.AddItem("ModerateMargins", "Moderate", "Each margin is 10% of the paper size", await moderateMarginsIconTask);
                margins.AddItem("NarrowMargins", "Narrow", "Each margin is 5% of the paper size", await narrowMarginsIconTask);

                // The default is ModerateMargins
                ApplicationContentMarginTop = 0.1;
                ApplicationContentMarginLeft = 0.1;
                margins.TrySetValue("ModerateMargins");

                // App tells the user some more information about what the feature means.
                margins.Description = "The space between the content of your document and the edge of the paper";

                // Add the custom option to the option list
                displayedOptions.Add("Margins");

                printDetailedOptions.OptionChanged += printDetailedOptions_OptionChanged;

                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += (s, args) =>
                {
                    // Notify the user when the print operation fails.
                    if (args.Completion == PrintTaskCompletion.Failed)
                    {
                        MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                    }
                };

                sourceRequestedArgs.SetSource(printDocumentSource);

                deferral.Complete();
            });
        }

Member Data Documentation

internal DisplayContent imageText = DisplayContent.TextAndImages [private]

A flag that determines if text & images are to be shown.

Definition at line 50 of file Scenario3CustomOptions.xaml.cs.

Task<IRandomAccessStreamWithContentType> moderateMarginsIconTask [private]

Definition at line 71 of file Scenario3CustomOptions.xaml.cs.

Task<IRandomAccessStreamWithContentType> narrowMarginsIconTask [private]

Definition at line 72 of file Scenario3CustomOptions.xaml.cs.

bool showHeader = true [private]

Definition at line 68 of file Scenario3CustomOptions.xaml.cs.

Task<IRandomAccessStreamWithContentType> wideMarginsIconTask [private]

Definition at line 70 of file Scenario3CustomOptions.xaml.cs.

Property Documentation

bool ShowImage [get, private]

Helper getter for image showing.

Definition at line 64 of file Scenario3CustomOptions.xaml.cs.

bool ShowText [get, private]

Helper getter for text showing.

Definition at line 56 of file Scenario3CustomOptions.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario3CustomOptions.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablePreviewPrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • DisablePreviewPrintHelper
Public Member Functions | Protected Member Functions | Private Attributes

DisablePreviewPrintHelper Class Reference

This class customizes the standard PrintHelper in order to disable print preview. More...

Inherits PrintSample::PrintHelper.

List of all members.

Public Member Functions

DisablePreviewPrintHelper (Page scenarioPage)

Protected Member Functions

RichTextBlockOverflow | AddOnePrintPage (RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription)
override void | AddPrintPages (object sender, AddPagesEventArgs e)
override void | PrintTaskRequested (PrintManager sender, PrintTaskRequestedEventArgs e)

Private Attributes

internal List< UIElement > | printPages

Detailed Description

The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order to disable print preview. Since print preview is disabled, the Paginate event will not be raised. Instead, the pages to be printed are generated in response to the AddPages event.

Definition at line 35 of file Scenario6DisablePreview.xaml.cs.

Constructor & Destructor Documentation

DisablePreviewPrintHelper ( Page scenarioPage ) [inline]

Definition at line 43 of file Scenario6DisablePreview.xaml.cs.

                                                            : base(scenarioPage) {
            printPages = new List<UIElement>();
        }

Member Function Documentation

RichTextBlockOverflow AddOnePrintPage | ( | RichTextBlockOverflow | lastRTBOAdded,
 |  | PrintPageDescription | printPageDescription |
 | ) |  |  | [inline, protected]

This function creates and adds one print page to the internal cache of print pages pages stored in printPages.

Parameters:
lastRTBOAdded | Last RichTextBlockOverflow element added in the current content
printPageDescription | Printer's page description

Definition at line 134 of file Scenario6DisablePreview.xaml.cs.

        {
            // XAML element that is used to represent to "printing page"
            FrameworkElement page;

            // The link container for text overflowing in this page
            RichTextBlockOverflow textLink;

            // Check if this is the first page ( no previous RichTextBlockOverflow)
            if (lastRTBOAdded == null)
            {
                // If this is the first page add the specific scenario content
                page = firstPage;

                // Hide footer since we don't know yet if it will be displayed (this might not be the last page) - wait for layout
                StackPanel footer = (StackPanel)page.FindName("Footer");
                footer.Visibility = Visibility.Collapsed;
            }
            else
            {
                // Flow content (text) from previous pages
                page = new ContinuationPage(lastRTBOAdded);
            }

            // Set "paper" width
            page.Width = printPageDescription.PageSize.Width;
            page.Height = printPageDescription.PageSize.Height;

            Grid printableArea = (Grid)page.FindName("PrintableArea");

            // Get the margins size
            // If the ImageableRect is smaller than the app provided margins use the ImageableRect
            double marginWidth = Math.Max(printPageDescription.PageSize.Width - printPageDescription.ImageableRect.Width, printPageDescription.PageSize.Width * ApplicationContentMarginLeft * 2);
            double marginHeight = Math.Max(printPageDescription.PageSize.Height - printPageDescription.ImageableRect.Height, printPageDescription.PageSize.Height * ApplicationContentMarginTop * 2);

            // Set-up "printable area" on the "paper"
            printableArea.Width = firstPage.Width - marginWidth;
            printableArea.Height = firstPage.Height - marginHeight;

            // Add the (newly created) page to the print canvas which is part of the visual tree and force it to go
            // through layout so that the linked containers correctly distribute the content inside them.
            PrintCanvas.Children.Add(page);
            PrintCanvas.InvalidateMeasure();
            PrintCanvas.UpdateLayout();

            // Find the last text container and see if the content is overflowing
            textLink = (RichTextBlockOverflow)page.FindName("ContinuationPageLinkedContainer");

            // Check if this is the last page
            if ((!textLink.HasOverflowContent) && (textLink.Visibility == Windows.UI.Xaml.Visibility.Visible))
            {
                StackPanel footer = (StackPanel)page.FindName("Footer");
                footer.Visibility = Visibility.Visible;
                PrintCanvas.UpdateLayout();
            }

            // Add the page to the print page collection
            printPages.Add(page);

            return textLink;
        }

override void AddPrintPages | ( | object | sender,
 |  | AddPagesEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:
sender | PrintDocument
e | Add page event arguments containing a print task options reference

Reimplemented from PrintHelper.

Definition at line 87 of file Scenario6DisablePreview.xaml.cs.

        {
            // Clear the cache of print pages
            printPages.Clear();

            // Clear the print canvas of print pages
            PrintCanvas.Children.Clear();

            // This variable keeps track of the last RichTextBlockOverflow element that was added to a page which will be printed
            RichTextBlockOverflow lastRTBOOnPage;

            // Get the PrintTaskOptions
            PrintTaskOptions printingOptions = ((PrintTaskOptions)e.PrintTaskOptions);

            // Get the page description to deterimine how big the page is
            PrintPageDescription pageDescription = printingOptions.GetPageDescription(0);

            // We know there is at least one page to be printed. passing null as the first parameter to
            // AddOnePrintPage tells the function to add the first page.
            lastRTBOOnPage = AddOnePrintPage(null, pageDescription);

            // We know there are more pages to be added as long as the last RichTextBoxOverflow added to a print
            // page has extra content
            while (lastRTBOOnPage.HasOverflowContent && (lastRTBOOnPage.Visibility == Windows.UI.Xaml.Visibility.Visible))
            {
                lastRTBOOnPage = AddOnePrintPage(lastRTBOOnPage, pageDescription);
            }

            // Loop over all of the pages and add each one to add each page to be printed
            for (int i = 0; i < printPages.Count; i++)
            {
                // We should have all pages ready at this point...
                printDocument.AddPage(printPages[i]);
            }

            PrintDocument printDoc = (PrintDocument)sender;

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }

override void PrintTaskRequested | ( | PrintManager | sender,
 |  | PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

Definition at line 55 of file Scenario6DisablePreview.xaml.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
            {
                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += async (s, args) =>
                {
                    // Notify the user when the print operation fails.
                    if (args.Completion == PrintTaskCompletion.Failed)
                    {
                        await scenarioPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                        });
                    }
                };

                sourceRequestedArgs.SetSource(printDocumentSource);
            });

            // Choose not to show the preview by setting the property on PrintTask
            printTask.IsPreviewEnabled = false;
        }

Member Data Documentation

internal List<UIElement> printPages [private]

A list of UIElements used to store the print pages.

This gives easy access to any desired print page.

Definition at line 41 of file Scenario6DisablePreview.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario6DisablePreview.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InvalidPageException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • InvalidPageException
Public Member Functions

InvalidPageException Class Reference

List of all members.

Public Member Functions

InvalidPageException (string message)

Detailed Description

Definition at line 25 of file Scenario4PageRange.xaml.cs.

Constructor & Destructor Documentation

InvalidPageException ( string message ) [inline]

Definition at line 27 of file Scenario4PageRange.xaml.cs.

            : base(message)
        {
        }

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario4PageRange.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PageDescription Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PageDescription
Public Member Functions | Public Attributes

PageDescription Class Reference

Printable page description. More...

List of all members.

Public Member Functions

bool | Equals (PageDescription other)

Public Attributes

bool | IsContentCropped
Size Margin
Size PageSize
Size PictureViewSize
Size ViewablePageSize

Detailed Description

Definition at line 55 of file Scenario5Photos.xaml.cs.

Member Function Documentation

bool Equals ( PageDescription other ) [inline]

Definition at line 63 of file Scenario5Photos.xaml.cs.

        {
            // Detect if PageSize changed
            bool equal = (Math.Abs(PageSize.Width - other.PageSize.Width) < double.Epsilon) &&
                (Math.Abs(PageSize.Height - other.PageSize.Height) < double.Epsilon);

            // Detect if ViewablePageSize changed
            if (equal)
            {
                equal = (Math.Abs(ViewablePageSize.Width - other.ViewablePageSize.Width) < double.Epsilon) &&
                    (Math.Abs(ViewablePageSize.Height - other.ViewablePageSize.Height) < double.Epsilon);
            }

            // Detect if PictureViewSize changed
            if (equal)
            {
                equal = (Math.Abs(PictureViewSize.Width - other.PictureViewSize.Width) < double.Epsilon) &&
                    (Math.Abs(PictureViewSize.Height - other.PictureViewSize.Height) < double.Epsilon);
            }

            // Detect if cropping changed
            if (equal)
            {
                equal = IsContentCropped == other.IsContentCropped;
            }

            return equal;
        }

Member Data Documentation

bool IsContentCropped

Definition at line 61 of file Scenario5Photos.xaml.cs.

Size Margin

Definition at line 57 of file Scenario5Photos.xaml.cs.

Size PageSize

Definition at line 58 of file Scenario5Photos.xaml.cs.

Size PictureViewSize

Definition at line 60 of file Scenario5Photos.xaml.cs.

Size ViewablePageSize

Definition at line 59 of file Scenario5Photos.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario5Photos.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PageRangePrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PageRangePrintHelper
Public Member Functions | Protected Member Functions | Private Member Functions

PageRangePrintHelper Class Reference

Inherits PrintSample::PrintHelper.

List of all members.

Public Member Functions

PageRangePrintHelper (Page scenarioPage)

Protected Member Functions

override void | AddPrintPages (object sender, AddPagesEventArgs e)
override void | CreatePrintPreviewPages (object sender, PaginateEventArgs e)
override void | PrintTaskRequested (PrintManager sender, PrintTaskRequestedEventArgs e)

Private Member Functions

void | printDetailedOptions_OptionChanged (PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)
void | ValidatePageRangeOption (PrintPageRangeOptionDetails pageRangeOption)

Detailed Description

Definition at line 33 of file Scenario4PageRange.xaml.cs.

Constructor & Destructor Documentation

PageRangePrintHelper ( Page scenarioPage ) [inline]

Definition at line 35 of file Scenario4PageRange.xaml.cs.

                                                       : base(scenarioPage)
        {
            // Use moderate margins to allow the content to span multiple pages
            ApplicationContentMarginTop = 0.1;
            ApplicationContentMarginLeft = 0.1;
        }

Member Function Documentation

override void AddPrintPages | ( | object | sender,
 |  | AddPagesEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:
sender | PrintDocument
e | Add page event arguments containing a print task options reference

Reimplemented from PrintHelper.

Definition at line 116 of file Scenario4PageRange.xaml.cs.

        {
            IList<PrintPageRange> customPageRanges = e.PrintTaskOptions.CustomPageRanges;

            // An empty CustomPageRanges means "All Pages"
            if (customPageRanges.Count == 0)
            {
                // Loop over all of the preview pages and add each one to be printed
                foreach (UIElement previewPage in printPreviewPages)
                {
                    printDocument.AddPage(previewPage);
                }
            }
            else
            {
                // Print only the pages chosen by the user.
                //
                // The "Current page" option is a special case of "Custom set of pages".
                // In case the user selects the "Current page" option, the PrintDialog
                // will turn that into a CustomPageRanges containing the page that the user was looking at.
                // If the user typed in an indefinite range such as "6-", the LastPageNumber value
                // will be whatever this sample app last passed into the PrintDocument.SetPreviewPageCount API.
                foreach (PrintPageRange pageRange in customPageRanges)
                {
                    // The user may type in a page number that is not present in the document.
                    // In this case, we just ignore those pages, hence the checks
                    // (pageRange.FirstPageNumber <= printPreviewPages.Count) and (i <= printPreviewPages.Count).
                    //
                    // If the user types the same page multiple times, it will be printed multiple times
                    // (e.g 3-4;1;1 will print pages 3 and 4 followed by two copies of page 1)
                    if (pageRange.FirstPageNumber <= printPreviewPages.Count)
                    {
                        for (int i = pageRange.FirstPageNumber; (i <= pageRange.LastPageNumber) && (i <= printPreviewPages.Count); i++)
                        {
                            // Subtract 1 because page numbers are 1-based, but our list is 0-based.
                            printDocument.AddPage(printPreviewPages[i - 1]);
                        }
                    }
                }
            }

            PrintDocument printDoc = (PrintDocument)sender;

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }

override void CreatePrintPreviewPages | ( | object | sender,
 |  | PaginateEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.Paginate.

It creates print preview pages for the app.

Parameters:
sender | PrintDocument
e | Paginate Event Arguments

Reimplemented from PrintHelper.

Definition at line 98 of file Scenario4PageRange.xaml.cs.

        {
            base.CreatePrintPreviewPages(sender, e);

            PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(e.PrintTaskOptions);
            PrintPageRangeOptionDetails pageRangeOption = (PrintPageRangeOptionDetails)printDetailedOptions.Options[StandardPrintTaskOptions.CustomPageRanges];

            // The number of pages may have been changed, so validate the Page Ranges again
            ValidatePageRangeOption(pageRangeOption);
        }

void printDetailedOptions_OptionChanged | ( | PrintTaskOptionDetails | sender,
 |  | PrintTaskOptionChangedEventArgs | args |
 | ) |  |  | [inline, private]

Option change event handler.

Parameters:
sender | PrintTaskOptionsDetails object
args | the event arguments containing the changed option id

Definition at line 168 of file Scenario4PageRange.xaml.cs.

        {
            string optionId = args.OptionId as string;
            if (string.IsNullOrEmpty(optionId))
            {
                return;
            }

            // Handle change in Page Range Option
            if (optionId == StandardPrintTaskOptions.CustomPageRanges)
            {
                PrintPageRangeOptionDetails pageRangeOption = (PrintPageRangeOptionDetails)sender.Options[optionId];
                ValidatePageRangeOption(pageRangeOption);
            }
        }

override void PrintTaskRequested | ( | PrintManager | sender,
 |  | PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

Definition at line 50 of file Scenario4PageRange.xaml.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
            {
                PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options);
                IList<string> displayedOptions = printDetailedOptions.DisplayedOptions;

                // Choose the printer options to be shown.
                // The order in which the options are appended determines the order in which they appear in the UI
                displayedOptions.Clear();

                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.CustomPageRanges);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.ColorMode);

                printTask.Options.PageRangeOptions.AllowCurrentPage = true;
                printTask.Options.PageRangeOptions.AllowAllPages = true;
                printTask.Options.PageRangeOptions.AllowCustomSetOfPages = true;

                // Register the handler for the option change event
                printDetailedOptions.OptionChanged += printDetailedOptions_OptionChanged;

                // Register the handler for the PrintTask.Completed event.
                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += async (s, args) =>
                {
                    // Notify the user when the print operation fails.
                    if (args.Completion == PrintTaskCompletion.Failed)
                    {
                        await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                        {
                            MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                        });
                    }
                };

                sourceRequestedArgs.SetSource(printDocumentSource);
            });
        }

void ValidatePageRangeOption ( PrintPageRangeOptionDetails pageRangeOption ) [inline, private]

Deals with validating that the Page Ranges only contain pages that are present in the document.

This is not necessary and some apps don't do this validation. Instead, they just ignore the pages that are not present in the document and simply don't print them.

Parameters:
pageRangeOption The PrintPageRangeOptionDetails option

Definition at line 191 of file Scenario4PageRange.xaml.cs.

        {
            IList<PrintPageRange> pageRanges = ((IList<PrintPageRange>)pageRangeOption.Value).ToImmutableList();

            pageRangeOption.WarningText = "";
            pageRangeOption.ErrorText = "";

            // An empty list means AllPages, in which case we don't need to check the ranges
            if (pageRanges.Count > 0)
            {
                lock (printPreviewPages)
                {
                    // Verify that the page ranges contain at least one printable page
                    bool containsAtLeastOnePrintablePage = false;
                    foreach (PrintPageRange pageRange in pageRanges)
                    {
                        if ((pageRange.FirstPageNumber <= printPreviewPages.Count) || (pageRange.LastPageNumber <= printPreviewPages.Count))
                        {
                            containsAtLeastOnePrintablePage = true;
                            break;
                        }
                    }

                    if (containsAtLeastOnePrintablePage)
                    {
                        // Warn the user in case one of the page ranges contains pages that will not printed. That way, s/he
                        // can fix the page numbers in case they were mistyped.
                        foreach (PrintPageRange pageRange in pageRanges)
                        {
                            if ((pageRange.FirstPageNumber > printPreviewPages.Count) || (pageRange.LastPageNumber > printPreviewPages.Count))
                            {
                                pageRangeOption.WarningText = "One of the ranges contains pages that are not present in the document";
                                break;
                            }
                        }
                    }
                    else
                    {
                        pageRangeOption.ErrorText = "Those pages are not present in the document";
                    }
                }
            }
        }

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario4PageRange.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PageToPrint Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PageToPrint
Public Member Functions | Properties

PageToPrint Class Reference

Page content to send to the printer. More...

List of all members.

Public Member Functions

PageToPrint ()

Properties

RichTextBlock TextContentBlock [get, set]

Detailed Description

Definition at line 9 of file PageToPrint.xaml.cs.

Constructor & Destructor Documentation

PageToPrint ( ) [inline]

Definition at line 13 of file PageToPrint.xaml.cs.

        {
            this.InitializeComponent();
            TextContentBlock = TextContent;
        }

Property Documentation

RichTextBlock TextContentBlock [get, set]

Definition at line 11 of file PageToPrint.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/PageToPrint.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PhotosPrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PhotosPrintHelper
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

PhotosPrintHelper Class Reference

Inherits PrintSample::PrintHelper.

List of all members.

Public Member Functions

PhotosPrintHelper (Page scenarioPage)

Protected Member Functions

override async void | AddPrintPages (object sender, AddPagesEventArgs e)
override void | CreatePrintPreviewPages (object sender, Windows.UI.Xaml.Printing.PaginateEventArgs e)
async override void | GetPrintPreviewPage (object sender, GetPreviewPageEventArgs e)
override void | PrintTaskRequested (Windows.Graphics.Printing.PrintManager sender, Windows.Graphics.Printing.PrintTaskRequestedEventArgs e)

Private Member Functions

void | ClearPageCollection ()
async Task< UIElement > | GeneratePageAsync (int photoNumber, PageDescription pageDescription)
async Task< WriteableBitmap > | LoadBitmapAsync (Uri source, bool landscape)
async void | PrintDetailedOptionsOptionChanged (PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)

Static Private Member Functions

static void | Swap< T > (ref T v1, ref T v2)

Private Attributes

PageDescription currentPageDescription
const int | DPI96 = 96
const int | NumberOfPhotos = 6
Dictionary< int, UIElement > | pageCollection = new Dictionary<int, UIElement>()
Scaling photoScale
PhotoSize photoSize
long | requestCount

Static Private Attributes

static object | printSync = new object()

Detailed Description

Definition at line 93 of file Scenario5Photos.xaml.cs.

Constructor & Destructor Documentation

PhotosPrintHelper ( Page scenarioPage ) [inline]

Definition at line 143 of file Scenario5Photos.xaml.cs.

                                                    : base(scenarioPage)
        {
            photoSize = PhotoSize.SizeFullPage;
            photoScale = Scaling.ShrinkToFit;
        }

Member Function Documentation

override async void AddPrintPages | ( | object | sender,
 |  | AddPagesEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:
sender | The print document.
e | Arguments containing the print task options.

Reimplemented from PrintHelper.

Definition at line 456 of file Scenario5Photos.xaml.cs.

        {
            PrintDocument printDoc = (PrintDocument)sender;

            // Loop over all of the preview pages
            for (int i = 0; i < NumberOfPhotos; i++)
            {
                UIElement page = null;
                bool pageReady = false;

                lock (printSync)
                {
                    pageReady = pageCollection.TryGetValue(i, out page);
                }

                if (!pageReady)
                {
                    // If the page is not ready create a task that will generate its content.
                    page = await GeneratePageAsync(i + 1, currentPageDescription);
                }

                printDoc.AddPage(page);
            }

            // Indicate that all of the print pages have been provided.
            printDoc.AddPagesComplete();

            // Reset the current page description as soon as possible since the PrintTask.Completed event might fire later (long running job)
            currentPageDescription = null;
        }

void ClearPageCollection ( ) [inline, private]

Helper function that clears the page collection and also the pages attached to the "visual root".

Definition at line 490 of file Scenario5Photos.xaml.cs.

        {
            lock (printSync)
            {
                pageCollection.Clear();
                PrintCanvas.Children.Clear();
            }
        }

override void CreatePrintPreviewPages | ( | object | sender,
 |  | Windows.UI.Xaml.Printing.PaginateEventArgs | e |
 | ) |  |  | [inline, protected]

This is the event handler for Pagination.

Parameters:
sender | The document for which pagination occurs.
e | The pagination event arguments containing the print options.

Definition at line 299 of file Scenario5Photos.xaml.cs.

        {

            PrintDocument printDoc = (PrintDocument)sender;

            // A new "session" starts with each paginate event.
            Interlocked.Increment(ref requestCount);

            PageDescription pageDescription = new PageDescription();

            // Get printer's page description.
            PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(e.PrintTaskOptions);
            PrintPageDescription printPageDescription = e.PrintTaskOptions.GetPageDescription(0);

            // Reset the error state
            printDetailedOptions.Options["photoSize"].ErrorText = string.Empty;

            // Compute the printing page description (page size & center printable area)
            pageDescription.PageSize = printPageDescription.PageSize;

            pageDescription.Margin.Width = Math.Max(
                printPageDescription.ImageableRect.Left,
                printPageDescription.ImageableRect.Right - printPageDescription.PageSize.Width);

            pageDescription.Margin.Height = Math.Max(
                printPageDescription.ImageableRect.Top,
                printPageDescription.ImageableRect.Bottom - printPageDescription.PageSize.Height);

            pageDescription.ViewablePageSize.Width = printPageDescription.PageSize.Width - pageDescription.Margin.Width * 2;
            pageDescription.ViewablePageSize.Height = printPageDescription.PageSize.Height - pageDescription.Margin.Height * 2;

            // Compute print photo area.
            switch (photoSize)
            {
                case PhotoSize.Size4x6:
                    pageDescription.PictureViewSize.Width = 4 * DPI96;
                    pageDescription.PictureViewSize.Height = 6 * DPI96;
                    break;
                case PhotoSize.Size5x7:
                    pageDescription.PictureViewSize.Width = 5 * DPI96;
                    pageDescription.PictureViewSize.Height = 7 * DPI96;
                    break;
                case PhotoSize.Size8x10:
                    pageDescription.PictureViewSize.Width = 8 * DPI96;
                    pageDescription.PictureViewSize.Height = 10 * DPI96;
                    break;
                case PhotoSize.SizeFullPage:
                    pageDescription.PictureViewSize.Width = pageDescription.ViewablePageSize.Width;
                    pageDescription.PictureViewSize.Height = pageDescription.ViewablePageSize.Height;
                    break;
            }

            // Try to maximize photo-size based on it's aspect-ratio
            if ((pageDescription.ViewablePageSize.Width > pageDescription.ViewablePageSize.Height) && (photoSize != PhotoSize.SizeFullPage))
            {
                var swap = pageDescription.PictureViewSize.Width;
                pageDescription.PictureViewSize.Width = pageDescription.PictureViewSize.Height;
                pageDescription.PictureViewSize.Height = swap;
            }

            pageDescription.IsContentCropped = photoScale == Scaling.Crop;

            // Recreate content only when :
            // - there is no current page description
            // - the current page description doesn't match the new one
            if (currentPageDescription == null || !currentPageDescription.Equals(pageDescription))
            {
                ClearPageCollection();

                if (pageDescription.PictureViewSize.Width > pageDescription.ViewablePageSize.Width ||
                    pageDescription.PictureViewSize.Height > pageDescription.ViewablePageSize.Height)
                {
                    printDetailedOptions.Options["photoSize"].ErrorText = "Photo doesn’t fit on the selected paper";

                    // Inform preview that it has only 1 page to show.
                    printDoc.SetPreviewPageCount(1, PreviewPageCountType.Intermediate);

                    // Add a custom "preview" unavailable page
                    lock (printSync)
                    {
                        pageCollection[0] = new PreviewUnavailable(pageDescription.PageSize, pageDescription.ViewablePageSize);
                    }
                }
                else
                {
                    // Inform preview that is has #NumberOfPhotos pages to show.
                    printDoc.SetPreviewPageCount(NumberOfPhotos, PreviewPageCountType.Intermediate);
                }

                currentPageDescription = pageDescription;
            }
        }

async Task<UIElement> GeneratePageAsync | ( | int | photoNumber,
 |  | PageDescription | pageDescription |
 | ) |  |  | [inline, private]

Generates a page containing a photo.

The image will be rotated if detected that there is a gain from that regarding size (try to maximize photo size).

Parameters:
photoNumber | The photo number.
pageDescription | The description of the printer page.
Returns:
A task that will return the page.

Definition at line 519 of file Scenario5Photos.xaml.cs.

        {
            Canvas page = new Canvas
            {
                Width = pageDescription.PageSize.Width,
                Height = pageDescription.PageSize.Height
            };

            Canvas viewablePage = new Canvas()
            {
                Width = pageDescription.ViewablePageSize.Width,
                Height = pageDescription.ViewablePageSize.Height
            };

            viewablePage.SetValue(Canvas.LeftProperty, pageDescription.Margin.Width);
            viewablePage.SetValue(Canvas.TopProperty, pageDescription.Margin.Height);

            // The image "frame" which also acts as a viewport
            Grid photoView = new Grid
            {
                Width = pageDescription.PictureViewSize.Width,
                Height = pageDescription.PictureViewSize.Height
            };

            // Center the frame.
            photoView.SetValue(Canvas.LeftProperty, (viewablePage.Width - photoView.Width) / 2);
            photoView.SetValue(Canvas.TopProperty, (viewablePage.Height - photoView.Height) / 2);

            // Return an async task that will complete when the image is fully loaded.
            WriteableBitmap bitmap = await LoadBitmapAsync(
                new Uri(string.Format("ms-appx:///Assets/photo{0}.jpg", photoNumber)),
                pageDescription.PageSize.Width > pageDescription.PageSize.Height);

            if (bitmap != null)
            {
                Image image = new Image
                {
                    Source = bitmap,
                    HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
                    VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center
                };

                // Use the real image size when croping or if the image is smaller then the target area (prevent a scale-up).
                if (photoScale == Scaling.Crop ||
                    (bitmap.PixelWidth <= pageDescription.PictureViewSize.Width &&
                    bitmap.PixelHeight <= pageDescription.PictureViewSize.Height))
                {
                    image.Stretch = Stretch.None;
                    image.Width = bitmap.PixelWidth;
                    image.Height = bitmap.PixelHeight;
                }

                // Add the newly created image to the visual root.
                photoView.Children.Add(image);
                viewablePage.Children.Add(photoView);
                page.Children.Add(viewablePage);
            }

            // Return the page with the image centered.
            return page;
        }

async override void GetPrintPreviewPage | ( | object | sender,
 |  | GetPreviewPageEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.GetPrintPreviewPage.

It provides a specific print page preview, in the form of an UIElement, to an instance of PrintDocument. PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.

Parameters:
sender | The print documet.
e | Arguments containing the requested page preview.

Reimplemented from PrintHelper.

Definition at line 399 of file Scenario5Photos.xaml.cs.

        {
            // Store a local copy of the request count to use later to determine if the computed page is out of date.
            // If the page preview is unavailable an async operation will generate the content.
            // When the operation completes there is a chance that a pagination request was already made therefore making this page obsolete.
            // If the page is obsolete throw away the result (don't call SetPreviewPage) since a new GetPrintPreviewPage will server that request.
            long requestNumber = 0;
            Interlocked.Exchange(ref requestNumber, requestCount);
            int pageNumber = e.PageNumber;

            UIElement page;
            bool pageReady = false;

            // Try to get the page if it was previously generated.
            lock (printSync)
            {
                pageReady = pageCollection.TryGetValue(pageNumber - 1, out page);
            }

            if (!pageReady)
            {
                // The page is not available yet.
                page = await GeneratePageAsync(pageNumber, currentPageDescription);

                // If the ticket changed discard the result since the content is outdated.
                if (Interlocked.CompareExchange(ref requestNumber, requestNumber, requestCount) != requestCount)
                {
                    return;
                }

                // Store the page in the list in case an invalidate happens but the content doesn't need to be regenerated.

                lock (printSync)
                {
                    pageCollection[pageNumber - 1] = page;

                    // Add the newly created page to the printing root which is part of the visual tree and force it to go
                    // through layout so that the linked containers correctly distribute the content inside them.
                    PrintCanvas.Children.Add(page);
                    PrintCanvas.InvalidateMeasure();
                    PrintCanvas.UpdateLayout();
                }
            }

            PrintDocument printDoc = (PrintDocument)sender;

            // Send the page to preview.
            printDoc.SetPreviewPage(pageNumber, page);
        }

async Task<WriteableBitmap> LoadBitmapAsync | ( | Uri | source,
 |  | bool | landscape |
 | ) |  |  | [inline, private]

Loads an image from an uri source and performs a rotation based on the print target aspect.

Parameters:
source | The location of the image.
landscape | A flag that indicates if the target (printer page) is in landscape mode.
Returns:
A task that will return the loaded bitmap.

Definition at line 587 of file Scenario5Photos.xaml.cs.

        {
            var file = await StorageFile.GetFileFromApplicationUriAsync(source);
            using (var stream = await file.OpenAsync(FileAccessMode.Read))
            {
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);

                BitmapTransform transform = new BitmapTransform();
                transform.Rotation = BitmapRotation.None;
                uint width = decoder.PixelWidth;
                uint height = decoder.PixelHeight;

                if (landscape && width < height)
                {
                    transform.Rotation = BitmapRotation.Clockwise270Degrees;
                    Swap(ref width, ref height);
                }
                else if (!landscape && width > height)
                {
                    transform.Rotation = BitmapRotation.Clockwise90Degrees;
                    Swap(ref width, ref height);
                }

                PixelDataProvider pixelData = await decoder.GetPixelDataAsync(
                    BitmapPixelFormat.Bgra8,    // WriteableBitmap uses BGRA format.
                    BitmapAlphaMode.Straight,
                    transform,
                    ExifOrientationMode.IgnoreExifOrientation,    // This sample ignores Exif orientation.
                    ColorManagementMode.DoNotColorManage);

                WriteableBitmap bitmap = new WriteableBitmap((int)width, (int)height);
                var pixelBuffer = pixelData.DetachPixelData();
                using (var pixelStream = bitmap.PixelBuffer.AsStream())
                {
                    pixelStream.Write(pixelBuffer, 0, (int)pixelStream.Length);
                }

                return bitmap;
            }
        }

async void PrintDetailedOptionsOptionChanged | ( | PrintTaskOptionDetails | sender,
 |  | PrintTaskOptionChangedEventArgs | args |
 | ) |  |  | [inline, private]

Option change event handler.

Parameters:
sender | The print task option details for which an option changed.
args | The event arguments containing the id of the changed option.

Definition at line 227 of file Scenario5Photos.xaml.cs.

        {
            bool invalidatePreview = false;

            // For this scenario we are interested only when the 2 custom options change (photoSize & scaling) in order to trigger a preview refresh.
            // Default options that change page aspect will trigger preview invalidation (refresh) automatically.
            // It is safe to ignore verifying other options and(or) combinations here because during Paginate event(CreatePrintPreviewPages) we check if the PageDescription changed.
            if (args.OptionId == null)
            {
                return;
            }

            string optionId = args.OptionId.ToString();

            if (optionId == "photoSize")
            {
                IPrintOptionDetails photoSizeOption = sender.Options[optionId];
                string photoSizeValue = photoSizeOption.Value as string;

                if (!string.IsNullOrEmpty(photoSizeValue))
                {
                    switch (photoSizeValue)
                    {
                        case "SizeFullPage":
                            photoSize = PhotoSize.SizeFullPage;
                            break;
                        case "Size4x6":
                            photoSize = PhotoSize.Size4x6;
                            break;
                        case "Size5x7":
                            photoSize = PhotoSize.Size5x7;
                            break;
                        case "Size8x10":
                            photoSize = PhotoSize.Size8x10;
                            break;
                    }
                    invalidatePreview = true;
                }
            }

            if (optionId == "scaling")
            {
                IPrintOptionDetails scalingOption = sender.Options[optionId];
                string scalingValue = scalingOption.Value as string;

                if (!string.IsNullOrEmpty(scalingValue))
                {
                    switch (scalingValue)
                    {
                        case "Crop":
                            photoScale = Scaling.Crop;
                            break;
                        case "ShrinkToFit":
                            photoScale = Scaling.ShrinkToFit;
                            break;
                    }
                    invalidatePreview = true;
                }
            }

            // Invalidate preview if one of the 2 options (photoSize, scaling) changed.
            if (invalidatePreview)
            {
                await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, printDocument.InvalidatePreview);
            }
        }

override void PrintTaskRequested | ( | Windows.Graphics.Printing.PrintManager | sender,
 |  | Windows.Graphics.Printing.PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | The print manager for which a print task request was made.
e | The print taks request associated arguments.

Definition at line 158 of file Scenario5Photos.xaml.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
            {
                PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options);

                // Choose the printer options to be shown.
                // The order in which the options are appended determines the order in which they appear in the UI
                printDetailedOptions.DisplayedOptions.Clear();
                printDetailedOptions.DisplayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
                printDetailedOptions.DisplayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);

                // Create a new list option.
                PrintCustomItemListOptionDetails photoSize = printDetailedOptions.CreateItemListOption("photoSize", "Photo Size");
                photoSize.AddItem("SizeFullPage", "Full Page");
                photoSize.AddItem("Size4x6", "4 x 6 in");
                photoSize.AddItem("Size5x7", "5 x 7 in");
                photoSize.AddItem("Size8x10", "8 x 10 in");

                // Add the custom option to the option list.
                printDetailedOptions.DisplayedOptions.Add("photoSize");

                PrintCustomItemListOptionDetails scaling = printDetailedOptions.CreateItemListOption("scaling", "Scaling");
                scaling.AddItem("ShrinkToFit", "Shrink To Fit");
                scaling.AddItem("Crop", "Crop");

                // Add the custom option to the option list.
                printDetailedOptions.DisplayedOptions.Add("scaling");

                // Set default orientation to landscape.
                printTask.Options.Orientation = PrintOrientation.Landscape;

                // Register for print task option changed notifications.
                printDetailedOptions.OptionChanged += PrintDetailedOptionsOptionChanged;

                // Register for print task Completed notification.
                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += async (s, args) =>
                {
                    await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        ClearPageCollection();

                        // Reset image options to default values.
                        this.photoScale = Scaling.ShrinkToFit;
                        this.photoSize = PhotoSize.SizeFullPage;

                        // Reset the current page description
                        currentPageDescription = null;

                        // Notify the user when the print operation fails.
                        if (args.Completion == PrintTaskCompletion.Failed)
                        {
                            MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                        }
                    });
                };

                // Set the document source.
                sourceRequestedArgs.SetSource(printDocumentSource);
            });
        }

static void Swap< T > | ( | ref T | v1,
 |  | ref T | v2 |
 | ) |  |  | [inline, static, private]

Generic swap of 2 values.

Template Parameters:
T typename
Parameters:
v1 | Value 1
v2 | Value 2

Member Data Documentation

PageDescription currentPageDescription [private]

The current printer's page description used to create the content (size, margins, printable area).

Definition at line 131 of file Scenario5Photos.xaml.cs.

const int DPI96 = 96 [private]

Constant for 96 DPI.

Definition at line 104 of file Scenario5Photos.xaml.cs.

const int NumberOfPhotos = 6 [private]

The app's number of photos.

Definition at line 99 of file Scenario5Photos.xaml.cs.

Dictionary<int, UIElement> pageCollection = new Dictionary<int, UIElement>() [private]

A map of UIElements used to store the print preview pages.

Definition at line 121 of file Scenario5Photos.xaml.cs.

Scaling photoScale [private]

Current scale settings for the image.

Definition at line 116 of file Scenario5Photos.xaml.cs.

PhotoSize photoSize [private]

Current size settings for the image.

Definition at line 111 of file Scenario5Photos.xaml.cs.

object printSync = new object() [static, private]

Synchronization object used to sync access to pageCollection and the visual root(PrintingRoot).

Definition at line 126 of file Scenario5Photos.xaml.cs.

long requestCount [private]

A request "number" used to describe a Paginate - GetPreviewPage session.

It is used by GetPreviewPage to determine, before calling SetPreviewPage, if the page content is out of date. Flow: Paginate will increment the request count and all subsequent GetPreviewPage calls will store a local copy and verify it before calling SetPreviewPage. If another Paginate event is triggered while some GetPreviewPage workers are still executing asynchronously their results will be discarded(ignored) because their request number is expired (the photo page description changed).

Definition at line 141 of file Scenario5Photos.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario5Photos.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PreviewUnavailable Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PreviewUnavailable
Public Member Functions

PreviewUnavailable Class Reference

Used in scenario 5 to display a custom print preview unavailable page. More...

List of all members.

Public Member Functions

PreviewUnavailable ()
PreviewUnavailable (Size paperSize, Size printableSize)

Detailed Description

Definition at line 9 of file PreviewUnavailable.xaml.cs.

Constructor & Destructor Documentation

PreviewUnavailable ( ) [inline]

Definition at line 11 of file PreviewUnavailable.xaml.cs.

        {
            this.InitializeComponent();
        }

PreviewUnavailable | ( | Size | paperSize,
 |  | Size | printableSize |
 | ) |  |  | [inline]

Preview unavailable page constructor.

Parameters:
paperSize | The printing page paper size
printableSize | The usable/"printable" area on the page

Definition at line 21 of file PreviewUnavailable.xaml.cs.

            : this()
        {
            Page.Width = paperSize.Width;
            Page.Height = paperSize.Height;

            PrintablePage.Width = printableSize.Width;
            PrintablePage.Height = printableSize.Height;
        }

The documentation for this class was generated from the following file:
  • Printing/cs/PreviewUnavailable.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • PrintHelper
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events | Private Attributes

PrintHelper Class Reference

Inherited by CustomOptionsPrintHelper, DisablePreviewPrintHelper, PageRangePrintHelper, PhotosPrintHelper, and StandardOptionsPrintHelper.

List of all members.

Public Member Functions

PrintHelper (Page scenarioPage)
virtual void | PreparePrintContent (Page page)
virtual void | RegisterForPrinting ()
async Task | ShowPrintUIAsync ()
virtual void | UnregisterForPrinting ()

Protected Member Functions

virtual RichTextBlockOverflow | AddOnePrintPreviewPage (RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription)
virtual void | AddPrintPages (object sender, AddPagesEventArgs e)
virtual void | CreatePrintPreviewPages (object sender, PaginateEventArgs e)
virtual void | GetPrintPreviewPage (object sender, GetPreviewPageEventArgs e)
virtual void | PrintTaskRequested (PrintManager sender, PrintTaskRequestedEventArgs e)

Protected Attributes

double | ApplicationContentMarginLeft = 0.075
double | ApplicationContentMarginTop = 0.03
FrameworkElement | firstPage
PrintDocument | printDocument
IPrintDocumentSource | printDocumentSource
Page | scenarioPage

Properties

Canvas | PrintCanvas [get]

Events

EventHandler | PreviewPagesCreated

Private Attributes

internal List< UIElement > | printPreviewPages

Detailed Description

Definition at line 12 of file PrintHelper.cs.

Constructor & Destructor Documentation

PrintHelper ( Page scenarioPage ) [inline]

Constructor.

Parameters:
scenarioPage The scenario page constructing us

Definition at line 70 of file PrintHelper.cs.

        {
            this.scenarioPage = scenarioPage;
            printPreviewPages = new List<UIElement>();
        }

Member Function Documentation

virtual RichTextBlockOverflow AddOnePrintPreviewPage | ( | RichTextBlockOverflow | lastRTBOAdded,
 |  | PrintPageDescription | printPageDescription |
 | ) |  |  | [inline, protected, virtual]

This function creates and adds one print preview page to the internal cache of print preview pages stored in printPreviewPages.

Parameters:
lastRTBOAdded | Last RichTextBlockOverflow element added in the current content
printPageDescription | Printer's page description

Reimplemented in CustomOptionsPrintHelper.

Definition at line 263 of file PrintHelper.cs.

        {
            // XAML element that is used to represent to "printing page"
            FrameworkElement page;

            // The link container for text overflowing in this page
            RichTextBlockOverflow textLink;

            // Check if this is the first page ( no previous RichTextBlockOverflow)
            if (lastRTBOAdded == null)
            {
                // If this is the first page add the specific scenario content
                page = firstPage;

                // Hide footer since we don't know yet if it will be displayed (this might not be the last page) - wait for layout
                StackPanel footer = (StackPanel)page.FindName("Footer");
                footer.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                // Flow content (text) from previous pages
                page = new ContinuationPage(lastRTBOAdded);
            }

            // Set "paper" width
            page.Width = printPageDescription.PageSize.Width;
            page.Height = printPageDescription.PageSize.Height;

            Grid printableArea = (Grid)page.FindName("PrintableArea");

            // Get the margins size
            // If the ImageableRect is smaller than the app provided margins use the ImageableRect
            double marginWidth = Math.Max(printPageDescription.PageSize.Width - printPageDescription.ImageableRect.Width, printPageDescription.PageSize.Width * ApplicationContentMarginLeft * 2);
            double marginHeight = Math.Max(printPageDescription.PageSize.Height - printPageDescription.ImageableRect.Height, printPageDescription.PageSize.Height * ApplicationContentMarginTop * 2);

            // Set-up "printable area" on the "paper"
            printableArea.Width = firstPage.Width - marginWidth;
            printableArea.Height = firstPage.Height - marginHeight;

            // Add the (newley created) page to the print canvas which is part of the visual tree and force it to go
            // through layout so that the linked containers correctly distribute the content inside them.
            PrintCanvas.Children.Add(page);
            PrintCanvas.InvalidateMeasure();
            PrintCanvas.UpdateLayout();

            // Find the last text container and see if the content is overflowing
            textLink = (RichTextBlockOverflow)page.FindName("ContinuationPageLinkedContainer");

            // Check if this is the last page
            if (!textLink.HasOverflowContent && textLink.Visibility == Windows.UI.Xaml.Visibility.Visible)
            {
                StackPanel footer = (StackPanel)page.FindName("Footer");
                footer.Visibility = Windows.UI.Xaml.Visibility.Visible;
                PrintCanvas.UpdateLayout();
            }

            // Add the page to the page preview collection
            printPreviewPages.Add(page);

            return textLink;
        }

virtual void AddPrintPages | ( | object | sender,
 |  | AddPagesEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:
sender | PrintDocument
e | Add page event arguments containing a print task options reference

Reimplemented in PageRangePrintHelper, PhotosPrintHelper, and DisablePreviewPrintHelper.

Definition at line 242 of file PrintHelper.cs.

        {
            // Loop over all of the preview pages and add each one to  add each page to be printied
            for (int i = 0; i < printPreviewPages.Count; i++)
            {
                // We should have all pages ready at this point...
                printDocument.AddPage(printPreviewPages[i]);
            }

            PrintDocument printDoc = (PrintDocument)sender;

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }

virtual void CreatePrintPreviewPages | ( | object | sender,
 |  | PaginateEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.Paginate.

It creates print preview pages for the app.

Parameters:
sender | PrintDocument
e | Paginate Event Arguments

Reimplemented in CustomOptionsPrintHelper, and PageRangePrintHelper.

Definition at line 180 of file PrintHelper.cs.

        {
            lock (printPreviewPages)
            {
                // Clear the cache of preview pages
                printPreviewPages.Clear();

                // Clear the print canvas of preview pages
                PrintCanvas.Children.Clear();

                // This variable keeps track of the last RichTextBlockOverflow element that was added to a page which will be printed
                RichTextBlockOverflow lastRTBOOnPage;

                // Get the PrintTaskOptions
                PrintTaskOptions printingOptions = ((PrintTaskOptions)e.PrintTaskOptions);

                // Get the page description to deterimine how big the page is
                PrintPageDescription pageDescription = printingOptions.GetPageDescription(0);

                // We know there is at least one page to be printed. passing null as the first parameter to
                // AddOnePrintPreviewPage tells the function to add the first page.
                lastRTBOOnPage = AddOnePrintPreviewPage(null, pageDescription);

                // We know there are more pages to be added as long as the last RichTextBoxOverflow added to a print preview
                // page has extra content
                while (lastRTBOOnPage.HasOverflowContent && lastRTBOOnPage.Visibility == Windows.UI.Xaml.Visibility.Visible)
                {
                    lastRTBOOnPage = AddOnePrintPreviewPage(lastRTBOOnPage, pageDescription);
                }

                if (PreviewPagesCreated != null)
                {
                    PreviewPagesCreated.Invoke(printPreviewPages, null);
                }

                PrintDocument printDoc = (PrintDocument)sender;

                // Report the number of preview pages created
                printDoc.SetPreviewPageCount(printPreviewPages.Count, PreviewPageCountType.Intermediate);
            }
        }

virtual void GetPrintPreviewPage | ( | object | sender,
 |  | GetPreviewPageEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintDocument.GetPrintPreviewPage.

It provides a specific print preview page, in the form of an UIElement, to an instance of PrintDocument. PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.

Parameters:
sender | PrintDocument
e | Arguments containing the preview requested page

Reimplemented in PhotosPrintHelper.

Definition at line 229 of file PrintHelper.cs.

        {
            PrintDocument printDoc = (PrintDocument)sender;
            printDoc.SetPreviewPage(e.PageNumber, printPreviewPages[e.PageNumber - 1]);
        }

virtual void PreparePrintContent ( Page page ) [inline, virtual]

Method that will generate print content for the scenario For scenarios 1-4: it will create the first page from which content will flow Scenario 5 uses a different approach.

Parameters:
page The page to print

Definition at line 132 of file PrintHelper.cs.

        {
            if (firstPage == null)
            {
                firstPage = page;
                StackPanel header = (StackPanel)firstPage.FindName("Header");
                header.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }

            // Add the (newly created) page to the print canvas which is part of the visual tree and force it to go
            // through layout so that the linked containers correctly distribute the content inside them.
            PrintCanvas.Children.Add(firstPage);
            PrintCanvas.InvalidateMeasure();
            PrintCanvas.UpdateLayout();
        }

virtual void PrintTaskRequested | ( | PrintManager | sender,
 |  | PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented in StandardOptionsPrintHelper, CustomOptionsPrintHelper, PageRangePrintHelper, and DisablePreviewPrintHelper.

Definition at line 153 of file PrintHelper.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequested =>
            {
                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += async (s, args) =>
                {
                    // Notify the user when the print operation fails.
                    if (args.Completion == PrintTaskCompletion.Failed)
                    {
                        await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                        {
                            MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                        });
                    }
                };

                sourceRequested.SetSource(printDocumentSource);
            });
        }

virtual void RegisterForPrinting ( ) [inline, virtual]

This function registers the app for printing with Windows and sets up the necessary event handlers for the print process.

Definition at line 79 of file PrintHelper.cs.

        {
            printDocument = new PrintDocument();
            printDocumentSource = printDocument.DocumentSource;
            printDocument.Paginate += CreatePrintPreviewPages;
            printDocument.GetPreviewPage += GetPrintPreviewPage;
            printDocument.AddPages += AddPrintPages;

            PrintManager printMan = PrintManager.GetForCurrentView();
            printMan.PrintTaskRequested += PrintTaskRequested;
        }

async Task ShowPrintUIAsync ( ) [inline]

Definition at line 113 of file PrintHelper.cs.

        {
            // Catch and print out any errors reported
            try
            {
                await PrintManager.ShowPrintUIAsync();
            }
            catch (Exception e)
            {
                MainPage.Current.NotifyUser("Error printing: " + e.Message + ", hr=" + e.HResult, NotifyType.ErrorMessage);
            }
        }

virtual void UnregisterForPrinting ( ) [inline, virtual]

This function unregisters the app for printing with Windows.

Definition at line 94 of file PrintHelper.cs.

        {
            if (printDocument == null)
            {
                return;
            }

            printDocument.Paginate -= CreatePrintPreviewPages;
            printDocument.GetPreviewPage -= GetPrintPreviewPage;
            printDocument.AddPages -= AddPrintPages;
            printDocument = null;

            // Remove the handler for printing initialization.
            PrintManager printMan = PrintManager.GetForCurrentView();
            printMan.PrintTaskRequested -= PrintTaskRequested;

            PrintCanvas.Children.Clear();
        }

Member Data Documentation

double ApplicationContentMarginLeft = 0.075 [protected]

The percent of app's margin width, content is set at 85% (0.85) of the area's width.

Definition at line 17 of file PrintHelper.cs.

double ApplicationContentMarginTop = 0.03 [protected]

The percent of app's margin height, content is set at 94% (0.94) of tha area's height.

Definition at line 22 of file PrintHelper.cs.

FrameworkElement firstPage [protected]

First page in the printing-content series From this "virtual sized" paged content is split(text is flowing) to "printing pages".

Definition at line 48 of file PrintHelper.cs.

PrintDocument printDocument [protected]

PrintDocument is used to prepare the pages for printing.

Prepare the pages to print in the handlers for the Paginate, GetPreviewPage, and AddPages events.

Definition at line 28 of file PrintHelper.cs.

IPrintDocumentSource printDocumentSource [protected]

Marker interface for document source.

Definition at line 33 of file PrintHelper.cs.

internal List<UIElement> printPreviewPages [private]

A list of UIElements used to store the print preview pages.

This gives easy access to any desired preview page.

Definition at line 39 of file PrintHelper.cs.

Page scenarioPage [protected]

A reference back to the scenario page used to access XAML elements on the scenario page.

Definition at line 53 of file PrintHelper.cs.

Property Documentation

Canvas PrintCanvas [get, protected]

A hidden canvas used to hold pages we wish to print.

Definition at line 59 of file PrintHelper.cs.

Event Documentation

EventHandler PreviewPagesCreated [protected]

Definition at line 42 of file PrintHelper.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/PrintHelper.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1Basic Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario1Basic
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1Basic Class Reference

Scenario that demonstrates how to invoke the Print UI. More...

List of all members.

Public Member Functions

Scenario1Basic ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

PrintHelper printHelper

Detailed Description

Definition at line 24 of file Scenario1Basic.xaml.cs.

Constructor & Destructor Documentation

Scenario1Basic ( ) [inline]

Definition at line 28 of file Scenario1Basic.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 70 of file Scenario1Basic.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario1Basic.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new PrintHelper(this);
            printHelper.RegisterForPrinting();

            // Initialize print content for this scenario
            printHelper.PreparePrintContent(new PageToPrint());
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 38 of file Scenario1Basic.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

PrintHelper printHelper [private]

Definition at line 26 of file Scenario1Basic.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario1Basic.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2StandardOptions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario2StandardOptions
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2StandardOptions Class Reference

Scenario that demos how to add customizations in the displayed options list.

List of all members.

Public Member Functions

Scenario2StandardOptions ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

StandardOptionsPrintHelper printHelper

Detailed Description

Definition at line 74 of file Scenario2StandardOptons.xaml.cs.

Constructor & Destructor Documentation

Scenario2StandardOptions ( ) [inline]

Definition at line 78 of file Scenario2StandardOptons.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 120 of file Scenario2StandardOptons.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 93 of file Scenario2StandardOptons.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new StandardOptionsPrintHelper(this);
            printHelper.RegisterForPrinting();

            // Initialize print content for this scenario
            printHelper.PreparePrintContent(new PageToPrint());
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 88 of file Scenario2StandardOptons.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

StandardOptionsPrintHelper printHelper [private]

Definition at line 76 of file Scenario2StandardOptons.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario2StandardOptons.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3CustomOptions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario3CustomOptions
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3CustomOptions Class Reference

Scenario that demos how to add custom options (specific for the application). More...

List of all members.

Public Member Functions

Scenario3CustomOptions ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

CustomOptionsPrintHelper printHelper

Detailed Description

Definition at line 297 of file Scenario3CustomOptions.xaml.cs.

Constructor & Destructor Documentation

Scenario3CustomOptions ( ) [inline]

Definition at line 301 of file Scenario3CustomOptions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 343 of file Scenario3CustomOptions.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 316 of file Scenario3CustomOptions.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new CustomOptionsPrintHelper(this);
            printHelper.RegisterForPrinting();

            // Initialize print content for this scenario
            printHelper.PreparePrintContent(new PageToPrint());
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 311 of file Scenario3CustomOptions.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

CustomOptionsPrintHelper printHelper [private]

Definition at line 299 of file Scenario3CustomOptions.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario3CustomOptions.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4PageRange Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario4PageRange
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4PageRange Class Reference

Scenario that demonstrates a page range implementation. More...

List of all members.

Public Member Functions

Scenario4PageRange ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

PageRangePrintHelper printHelper

Detailed Description

Definition at line 239 of file Scenario4PageRange.xaml.cs.

Constructor & Destructor Documentation

Scenario4PageRange ( ) [inline]

Definition at line 243 of file Scenario4PageRange.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 285 of file Scenario4PageRange.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 258 of file Scenario4PageRange.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new PageRangePrintHelper(this);
            printHelper.RegisterForPrinting();

            // Initialize print content for this scenario
            printHelper.PreparePrintContent(new PageToPrint());
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 253 of file Scenario4PageRange.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

PageRangePrintHelper printHelper [private]

Definition at line 241 of file Scenario4PageRange.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario4PageRange.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5Photos Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario5Photos
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5Photos Class Reference

Photo printing scenario. More...

List of all members.

Public Member Functions

Scenario5Photos ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

PhotosPrintHelper printHelper

Detailed Description

Definition at line 632 of file Scenario5Photos.xaml.cs.

Constructor & Destructor Documentation

Scenario5Photos ( ) [inline]

Definition at line 636 of file Scenario5Photos.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 675 of file Scenario5Photos.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 651 of file Scenario5Photos.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new PhotosPrintHelper(this);
            printHelper.RegisterForPrinting();
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 646 of file Scenario5Photos.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

PhotosPrintHelper printHelper [private]

Definition at line 634 of file Scenario5Photos.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario5Photos.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6DisablePreview Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • Scenario6DisablePreview
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6DisablePreview Class Reference

Scenario that demos how to disable the print preview in the Modern Print Dialog window.

List of all members.

Public Member Functions

Scenario6DisablePreview ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnPrintButtonClick (object sender, RoutedEventArgs e)

Private Attributes

DisablePreviewPrintHelper printHelper

Detailed Description

Definition at line 200 of file Scenario6DisablePreview.xaml.cs.

Constructor & Destructor Documentation

Scenario6DisablePreview ( ) [inline]

Definition at line 204 of file Scenario6DisablePreview.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 246 of file Scenario6DisablePreview.xaml.cs.

        {
            if (printHelper != null)
            {
                printHelper.UnregisterForPrinting();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 219 of file Scenario6DisablePreview.xaml.cs.

        {
            if (PrintManager.IsSupported())
            {
                // Tell the user how to print
                MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
            }
            else
            {
                // Remove the print button
                InvokePrintingButton.Visibility = Visibility.Collapsed;

                // Inform user that Printing is not supported
                MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);

                // Printing-related event handlers will never be called if printing
                // is not supported, but it's okay to register for them anyway.
            }

            // Initalize common helper class and register for printing
            printHelper = new DisablePreviewPrintHelper(this);
            printHelper.RegisterForPrinting();

            // Initialize print content for this scenario
            printHelper.PreparePrintContent(new PageToPrint());
        }

async void OnPrintButtonClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Print' button.

Parameters:
sender
e

Definition at line 214 of file Scenario6DisablePreview.xaml.cs.

        {
            await printHelper.ShowPrintUIAsync();
        }

Member Data Documentation

DisablePreviewPrintHelper printHelper [private]

Definition at line 202 of file Scenario6DisablePreview.xaml.cs.

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario6DisablePreview.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StandardOptionsPrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • PrintSample
  • StandardOptionsPrintHelper
Public Member Functions | Protected Member Functions

StandardOptionsPrintHelper Class Reference

Inherits PrintSample::PrintHelper.

List of all members.

Public Member Functions

StandardOptionsPrintHelper (Page scenarioPage)

Protected Member Functions

override void PrintTaskRequested (PrintManager sender, PrintTaskRequestedEventArgs e)

Detailed Description

Definition at line 22 of file Scenario2StandardOptons.xaml.cs.

Constructor & Destructor Documentation

StandardOptionsPrintHelper ( Page scenarioPage ) [inline]

Definition at line 24 of file Scenario2StandardOptons.xaml.cs.

: base(scenarioPage) { }

Member Function Documentation

override void PrintTaskRequested | ( | PrintManager | sender,
 |  | PrintTaskRequestedEventArgs | e |
 | ) |  |  | [inline, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

Definition at line 34 of file Scenario2StandardOptons.xaml.cs.

        {
            PrintTask printTask = null;
            printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
            {
                IList<string> displayedOptions = printTask.Options.DisplayedOptions;

                // Choose the printer options to be shown.
                // The order in which the options are appended determines the order in which they appear in the UI
                displayedOptions.Clear();
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Collation);
                displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Duplex);

                // Preset the default value of the printer option
                printTask.Options.MediaSize = PrintMediaSize.NorthAmericaLegal;

                // Print Task event handler is invoked when the print job is completed.
                printTask.Completed += async (s, args) =>
                {
                    // Notify the user when the print operation fails.
                    if (args.Completion == PrintTaskCompletion.Failed)
                    {
                        await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                        {
                            MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
                        });
                    }
                };

                sourceRequestedArgs.SetSource(printDocumentSource);
            });
        }

The documentation for this class was generated from the following file:
  • Printing/cs/Scenario2StandardOptons.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PropertyGetContext< T > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

PropertyGetContext< T > Class Template Reference

#include "AllJoynHelpers.h"

List of all members.

Public Member Functions

QStatus | GetStatus ()
QStatus | GetStatus ()
T | GetValue ()
T | GetValue ()
void | SetEvent ()
void | SetEvent ()
void | SetStatus (QStatus value)
void | SetStatus (QStatus value)
void | SetValue (T value)
void | SetValue (T value)
void | Wait ()
void | Wait ()

Private Attributes

Concurrency::event | m_event
QStatus | m_status
T | m_value

Detailed Description

template<class T>
class PropertyGetContext< T >

Definition at line 211 of file AllJoynHelpers.h.

Member Function Documentation

QStatus GetStatus ( ) [inline]

Definition at line 224 of file AllJoynHelpers.h.

    {
        return m_status;
    }

QStatus GetStatus ( ) [inline]

Definition at line 224 of file AllJoynHelpers.h.

    {
        return m_status;
    }

T GetValue ( ) [inline]

Definition at line 234 of file AllJoynHelpers.h.

    {
        return m_value;
    }

T GetValue ( ) [inline]

Definition at line 234 of file AllJoynHelpers.h.

    {
        return m_value;
    }

void SetEvent ( ) [inline]

Definition at line 214 of file AllJoynHelpers.h.

    {
        m_event.set();
    }

void SetEvent ( ) [inline]

Definition at line 214 of file AllJoynHelpers.h.

    {
        m_event.set();
    }

void SetStatus ( QStatus value ) [inline]

Definition at line 229 of file AllJoynHelpers.h.

    {
        m_status = value;
    }

void SetStatus ( QStatus value ) [inline]

Definition at line 229 of file AllJoynHelpers.h.

    {
        m_status = value;
    }

void SetValue ( T value ) [inline]

Definition at line 239 of file AllJoynHelpers.h.

    {
        m_value = value;
    }

void SetValue ( T value ) [inline]

Definition at line 239 of file AllJoynHelpers.h.

    {
        m_value = value;
    }

void Wait ( ) [inline]

Definition at line 219 of file AllJoynHelpers.h.

    {
        m_event.wait();
    }

void Wait ( ) [inline]

Definition at line 219 of file AllJoynHelpers.h.

    {
        m_event.wait();
    }

Member Data Documentation

Concurrency::event m_event [private]

Definition at line 245 of file AllJoynHelpers.h.

QStatus m_status [private]

Definition at line 246 of file AllJoynHelpers.h.

T m_value [private]

Definition at line 247 of file AllJoynHelpers.h.

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h
  • AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PropertySetContext Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

PropertySetContext Class Reference

#include "AllJoynHelpers.h"

List of all members.

Public Member Functions

QStatus | GetStatus ()
QStatus | GetStatus ()
void | SetEvent ()
void | SetEvent ()
void | SetStatus (QStatus value)
void | SetStatus (QStatus value)
void | Wait ()
void | Wait ()

Private Attributes

Concurrency::event | m_event
QStatus | m_status

Detailed Description

Definition at line 251 of file AllJoynHelpers.h.

Member Function Documentation

QStatus GetStatus ( ) [inline]

Definition at line 264 of file AllJoynHelpers.h.

    {
        return m_status;
    }

QStatus GetStatus ( ) [inline]

Definition at line 264 of file AllJoynHelpers.h.

    {
        return m_status;
    }

void SetEvent ( ) [inline]

Definition at line 254 of file AllJoynHelpers.h.

    {
        m_event.set();
    }

void SetEvent ( ) [inline]

Definition at line 254 of file AllJoynHelpers.h.

    {
        m_event.set();
    }

void SetStatus ( QStatus value ) [inline]

Definition at line 269 of file AllJoynHelpers.h.

    {
        m_status = value;
    }

void SetStatus ( QStatus value ) [inline]

Definition at line 269 of file AllJoynHelpers.h.

    {
        m_status = value;
    }

void Wait ( ) [inline]

Definition at line 259 of file AllJoynHelpers.h.

    {
        m_event.wait();
    }

void Wait ( ) [inline]

Definition at line 259 of file AllJoynHelpers.h.

    {
        m_event.wait();
    }

Member Data Documentation

Concurrency::event m_event [private]

Definition at line 275 of file AllJoynHelpers.h.

QStatus m_status [private]

Definition at line 276 of file AllJoynHelpers.h.

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h
  • AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProximityCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | OnProximitySensorAdded (DeviceWatcher sender, DeviceInformation device)
async void | ReadingChanged (ProximitySensor sender, ProximitySensorReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current
ProximitySensor | sensor
DeviceWatcher | watcher

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 33 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
            watcher.Added += OnProximitySensorAdded;
            watcher.Start();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 110 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 124 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                sensor.ReadingChanged -= new TypedEventHandler<ProximitySensor, ProximitySensorReadingChangedEventArgs>(ReadingChanged);
            }

            base.OnNavigatingFrom(e);
        }

async void OnProximitySensorAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | device |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a proximity sensor.

Parameters:
sender | The device watcher
device | Device information for the proximity sensor that was found

Definition at line 47 of file Scenario1_DataEvents.xaml.cs.

        {
            if (null == sensor)
            {
                ProximitySensor foundSensor = ProximitySensor.FromId(device.Id);
                if (null != foundSensor)
                {
                    if (null != foundSensor.MaxDistanceInMillimeters)
                    {
                        // Check if this is the sensor that matches our ranges.

                        // TODO: Customize these values to your application's needs.
                        // Here, we are looking for a sensor that can detect close objects
                        // up to 3cm away, so we check the upper bound of the detection range.
                        const uint distanceInMillimetersLValue = 30; // 3 cm
                        const uint distanceInMillimetersRValue = 50; // 5 cm

                        if (foundSensor.MaxDistanceInMillimeters >= distanceInMillimetersLValue &&
                            foundSensor.MaxDistanceInMillimeters <= distanceInMillimetersRValue)
                        {
                            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                            {
                                rootPage.NotifyUser("Found a proximity sensor that meets the detection range", NotifyType.StatusMessage);
                            });
                        }
                        else
                        {
                            // We'll use the sensor anyway, to demonstrate how events work.
                            // Your app may decide not to use the sensor.
                            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                            {
                                rootPage.NotifyUser("Proximity sensor does not meet the detection range, using it anyway", NotifyType.StatusMessage);
                            });
                        }
                    }
                    else
                    {
                        await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            rootPage.NotifyUser("Proximity sensor does not report detection ranges, using it anyway", NotifyType.StatusMessage);
                        });
                    }

                    if (null != foundSensor)
                    {
                        sensor = foundSensor;
                    }
                }
                else
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
                    });
                }
            }
        }

async void ReadingChanged | ( | ProximitySensor | sender,
 |  | ProximitySensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender The proximity sensor that sent the reading change
e

Definition at line 172 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ProximitySensorReading reading = e.Reading;
                if (null != reading)
                {
                    ScenarioOutput_DetectionState.Text = reading.IsDetected ? "Detected" : "Not detected";
                    ScenarioOutput_Timestamp.Text = reading.Timestamp.ToString("u");

                    // Show the detection distance, if available
                    if (null != reading.DistanceInMillimeters)
                    {
                        ScenarioOutput_DetectionDistance.Text = reading.DistanceInMillimeters.ToString();
                    }
                }
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 159 of file Scenario1_DataEvents.xaml.cs.

        {
            sensor.ReadingChanged -= new TypedEventHandler<ProximitySensor, ProximitySensorReadingChangedEventArgs>(ReadingChanged);

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 139 of file Scenario1_DataEvents.xaml.cs.

        {
            if (null != sensor)
            {
                sensor.ReadingChanged += new TypedEventHandler<ProximitySensor, ProximitySensorReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No proximity sensors found", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

ProximitySensor sensor [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • ProximitySensor/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProximityCS
  • Scenario2_Polling
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Private Member Functions

async void | OnProximitySensorAdded (DeviceWatcher sender, DeviceInformation device)
void | ScenarioGetData (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current
ProximitySensor | sensor
DeviceWatcher | watcher

Detailed Description

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 33 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
            watcher.Added += OnProximitySensorAdded;
            watcher.Start();
        }

Member Function Documentation

async void OnProximitySensorAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | device |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a proximity sensor.

Parameters:
sender | The device watcher
device | Device information for the proximity sensor that was found

Definition at line 47 of file Scenario2_Polling.xaml.cs.

        {
            if (null == sensor)
            {
                ProximitySensor foundSensor = ProximitySensor.FromId(device.Id);
                if (null != foundSensor)
                {
                    // Optionally check the ProximitySensor.MaxDistanceInCentimeters/MinDistanceInCentimeters
                    // properties here. Refer to Scenario 1 for details.
                    sensor = foundSensor;
                }
                else
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
                    });
                }
            }
        }

void ScenarioGetData | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'GetData' button.

Parameters:
sender
e

Definition at line 73 of file Scenario2_Polling.xaml.cs.

        {
            if (null != sensor)
            {
                ProximitySensorReading reading = sensor.GetCurrentReading();
                if (null != reading)
                {
                    ScenarioOutput_DetectionState.Text = reading.IsDetected ? "Detected" : "Not detected";
                    ScenarioOutput_Timestamp.Text = reading.Timestamp.ToString("u");

                    // Show the detection distance, if available
                    if (null != reading.DistanceInMillimeters)
                    {
                        ScenarioOutput_DetectionDistance.Text = reading.DistanceInMillimeters.ToString();
                    }
                }
            }
            else
            {
                rootPage.NotifyUser("No proximity sensor found", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

ProximitySensor sensor [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • ProximitySensor/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_DisplayOnOff Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProximityCS
  • Scenario3_DisplayOnOff
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_DisplayOnOff Class Reference

List of all members.

Public Member Functions

Scenario3_DisplayOnOff ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | OnProximitySensorAdded (DeviceWatcher sender, DeviceInformation device)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)

Private Attributes

ProximitySensorDisplayOnOffController | displayController
MainPage | rootPage = MainPage.Current
ProximitySensor | sensor
DeviceWatcher | watcher

Detailed Description

Definition at line 24 of file Scenario3_DisplayOnOff.xaml.cs.

Constructor & Destructor Documentation

Scenario3_DisplayOnOff ( ) [inline]

Definition at line 34 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            this.InitializeComponent();

            watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
            watcher.Added += OnProximitySensorAdded;
            watcher.Start();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 72 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 86 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (null != displayController)
                {
                    displayController.Dispose(); // closes the controller
                    displayController = null;
                }
            }

            base.OnNavigatingFrom(e);
        }

async void OnProximitySensorAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | device |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a proximity sensor.

Parameters:
sender | The device watcher
device | Device information for the proximity sensor that was found

Definition at line 48 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            if (null == sensor)
            {
                ProximitySensor foundSensor = ProximitySensor.FromId(device.Id);
                if (null != foundSensor)
                {
                    sensor = foundSensor;
                }
                else
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
                    });
                }
            }
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 129 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            // Releases the display on/off controller that is previously acquired.
            // This tells the system to stop using the sensor's IsDetected state to
            // turn the screen on or off.  If the display does not support this
            // feature, this code will do nothing.
            if (null != displayController)
            {
                displayController.Dispose(); // closes the controller
                displayController = null;
            }

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 105 of file Scenario3_DisplayOnOff.xaml.cs.

        {
            if (null != sensor)
            {
                // Acquires the display on/off controller for this proximity sensor.
                // This tells the system to use the sensor's IsDetected state to
                // turn the screen on or off.  If the display does not support this
                // feature, this code will do nothing.
                displayController = sensor.CreateDisplayOnOffController();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No proximity sensors found", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ProximitySensorDisplayOnOffController displayController [private]

Definition at line 31 of file Scenario3_DisplayOnOff.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario3_DisplayOnOff.xaml.cs.

ProximitySensor sensor [private]

Definition at line 30 of file Scenario3_DisplayOnOff.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 32 of file Scenario3_DisplayOnOff.xaml.cs.

The documentation for this class was generated from the following file:
  • ProximitySensor/cs/Scenario3_DisplayOnOff.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_BackgroundProximitySensor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProximityCS
  • Scenario4_BackgroundProximitySensor
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_BackgroundProximitySensor Class Reference

List of all members.

Public Member Functions

Scenario4_BackgroundProximitySensor ()

Public Attributes

const string | SampleBackgroundTaskEntryPoint = "Tasks.ProximitySensorBackgroundTask"
const string | SampleBackgroundTaskName = "ProximitySensorBackgroundTask"

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
async void | OnProximitySensorAdded (DeviceWatcher sender, DeviceInformation device)
void | RegisterBackgroundTask ()
async void | ScenarioRegisterTask_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | ScenarioUnregisterTask_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | UpdateUIAsync (string status)

Private Attributes

bool | registered = false
MainPage | rootPage = MainPage.Current
ProximitySensor | sensor = null
DeviceWatcher | watcher = null

Detailed Description

Definition at line 26 of file Scenario4_BackgroundProximitySensor.xaml.cs.

Constructor & Destructor Documentation

Scenario4_BackgroundProximitySensor ( ) [inline]

Definition at line 37 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            this.InitializeComponent();

            watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
            watcher.Added += OnProximitySensorAdded;
            watcher.Start();
        }

Member Function Documentation

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for background task completion.

Parameters:
task | The task that is reporting completion.
args | The completion report arguments.

Definition at line 164 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            string status = "Completed";
            try
            {
                args.CheckResult();
            }
            catch (Exception e)
            {
                status = e.Message;
            }
            UpdateUIAsync(status);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 72 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == Scenario4_BackgroundProximitySensor.SampleBackgroundTaskName)
                {
                    registered = true;
                    break;
                }
            }
            UpdateUIAsync(registered ? "Registered" : "Unregistered");
        }

async void OnProximitySensorAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | device |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a proximity sensor.

Parameters:
sender | The device watcher
device | Device information for the proximity sensor that was found

Definition at line 51 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            if (null == sensor)
            {
                sensor = ProximitySensor.FromId(device.Id);
                if (null == sensor)
                {
                    // failed to find the sensor corresponding to the id
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
                    });
                }
            }
        }

void RegisterBackgroundTask ( ) [inline, private]

Registers the background task.

Definition at line 137 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            var builder = new BackgroundTaskBuilder()
            {
                Name = SampleBackgroundTaskName,
                TaskEntryPoint = SampleBackgroundTaskEntryPoint
            };

            // create a Proximity data threshold
            var threshold = new ProximitySensorDataThreshold(sensor);
            // create a trigger using the threshold
            var trigger = new SensorDataThresholdTrigger(threshold);

            builder.SetTrigger(trigger);

            BackgroundTaskRegistration task = builder.Register();
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);

            registered = true;
            UpdateUIAsync("Registered");
        }

async void ScenarioRegisterTask_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Register Task' button is clicked.

Adds a

Definition at line 89 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            if (sensor != null)
            {
                var status = await BackgroundExecutionManager.RequestAccessAsync();

                if ((BackgroundAccessStatus.AlwaysAllowed == status) ||
                    (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == status))
                {
                    RegisterBackgroundTask();
                }
                else
                {
                    rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No Proximity sensors found", NotifyType.ErrorMessage);
            }
        }

void ScenarioUnregisterTask_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when 'Unregister Task' button is clicked.

Definition at line 115 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            // Loop through all background tasks and unregister any with SampleBackgroundTaskName
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (SampleBackgroundTaskName == cur.Value.Name)
                {
                    cur.Value.Unregister(true /*cancelTask*/);
                    registered = false;
                }
            }

            if (!registered)
            {
                UpdateUIAsync("Unregistered");
            }
        }

async void UpdateUIAsync ( string status ) [inline, private]

Updates the scenario UI.

Parameters:
status The status string to display.

Definition at line 183 of file Scenario4_BackgroundProximitySensor.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ScenarioRegisterTaskButton.IsEnabled = !registered;
                ScenarioUnregisterTaskButton.IsEnabled = registered;
                ScenarioOutput_TaskRegistration.Text = status;

                var settings = ApplicationData.Current.LocalSettings;

                Object value;

                if (settings.Values.TryGetValue("ReportCount", out value))
                {
                    ScenarioOutput_ReportCount.Text = value.ToString(); // stored as a string
                }
                if (settings.Values.TryGetValue("TaskStatus", out value))
                {
                    ScenarioOutput_TaskStatus.Text = value.ToString();
                }
                if (settings.Values.TryGetValue("LastTimestamp", out value))
                {
                    ScenarioOutput_LastTimestamp.Text = value.ToString();
                }
                if (settings.Values.TryGetValue("Detected", out value))
                {
                    ScenarioOutput_Detected.Text = value.ToString();
                }
            });
        }

Member Data Documentation

bool registered = false [private]

Definition at line 33 of file Scenario4_BackgroundProximitySensor.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario4_BackgroundProximitySensor.xaml.cs.

const string SampleBackgroundTaskEntryPoint = "Tasks.ProximitySensorBackgroundTask"

Definition at line 29 of file Scenario4_BackgroundProximitySensor.xaml.cs.

const string SampleBackgroundTaskName = "ProximitySensorBackgroundTask"

Definition at line 28 of file Scenario4_BackgroundProximitySensor.xaml.cs.

ProximitySensor sensor = null [private]

Definition at line 34 of file Scenario4_BackgroundProximitySensor.xaml.cs.

DeviceWatcher watcher = null [private]

Definition at line 35 of file Scenario4_BackgroundProximitySensor.xaml.cs.

The documentation for this class was generated from the following file:
  • ProximitySensor/cs/Scenario4_BackgroundProximitySensor.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProxyStubsForWinRTComponents
  • CustomException
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CustomException Class Reference

List of all members.

Public Member Functions

CustomException ()
CustomException ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Start_Click (object sender, RoutedEventArgs e)
void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 17 of file Scenario2_CustomException.xaml.cs.

Constructor & Destructor Documentation

CustomException ( ) [inline]

Definition at line 23 of file Scenario2_CustomException.xaml.cs.

        {
            this.InitializeComponent();
        }

CustomException ( ) [inline]

Definition at line 23 of file Scenario2_CustomException.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 33 of file Scenario2_CustomException.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 33 of file Scenario2_CustomException.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle a Windows Runtime error originated by the Oven Windows Runtime component.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 42 of file Scenario2_CustomException.xaml.cs.

        {
            Oven myOven = new Oven();

            try
            {
                // Intentionally pass a bad parameter
                myOven.ConfigurePreheatTemperature((OvenTemperature)5);
            }
            catch (System.ArgumentException)
            {
                CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
            }
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle a Windows Runtime error originated by the Oven Windows Runtime component.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 42 of file Scenario2_CustomException.xaml.cs.

        {
            Oven myOven = new Oven();

            try
            {
                // Intentionally pass a bad parameter
                myOven.ConfigurePreheatTemperature((OvenTemperature)5);
            }
            catch (System.ArgumentException)
            {
                CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_CustomException.xaml.cs.

The documentation for this class was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/cs/Scenario2_CustomException.xaml.cs
  • ProxyStubsForWinRTComponents/cs/cs/Scenario2_CustomException.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OvenClient Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ProxyStubsForWinRTComponents
  • OvenClient
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OvenClient Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

OvenClient ()
OvenClient ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | BreadCompletedHandler1 (Oven oven, Bread bread)
async void | BreadCompletedHandler1 (Oven oven, Bread bread)
async void | BreadCompletedHandler2 (Oven oven, Bread bread)
async void | BreadCompletedHandler2 (Oven oven, Bread bread)
async void | BreadCompletedHandler3 (Oven oven, Bread bread)
async void | BreadCompletedHandler3 (Oven oven, Bread bread)
void | Start_Click (object sender, RoutedEventArgs e)
void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario1_OvenClient.xaml.cs.

Constructor & Destructor Documentation

OvenClient ( ) [inline]

Definition at line 27 of file Scenario1_OvenClient.xaml.cs.

        {
            this.InitializeComponent();
        }

OvenClient ( ) [inline]

Definition at line 27 of file Scenario1_OvenClient.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void BreadCompletedHandler1 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 1: Invoked\n";
                    OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
                    OvenClientOutput.Text += "Event Handler 1: Bread flavor is: " + bread.Flavor + "\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

async void BreadCompletedHandler1 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 1: Invoked\n";
                    OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
                    OvenClientOutput.Text += "Event Handler 1: Bread flavor is: " + bread.Flavor + "\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

async void BreadCompletedHandler2 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 2: Invoked\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

async void BreadCompletedHandler2 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 2: Invoked\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

async void BreadCompletedHandler3 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 115 of file Scenario1_OvenClient.xaml.cs.

        {
            // Event handler 3 was removed and will not be invoked
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 3: Invoked\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

async void BreadCompletedHandler3 | ( | Oven | oven,
 |  | Bread | bread |
 | ) |  |  | [inline, private]

Definition at line 115 of file Scenario1_OvenClient.xaml.cs.

        {
            // Event handler 3 was removed and will not be invoked
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 3: Invoked\n";
                };

            if (OvenClientOutput.Dispatcher.HasThreadAccess)
            {
                // If the current thread is the UI thread then execute the lambda.
                updateOutputText();
            }
            else
            {
                // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
                await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 37 of file Scenario1_OvenClient.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 37 of file Scenario1_OvenClient.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Use the custom Oven and Bread Windows Runtime components.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 46 of file Scenario1_OvenClient.xaml.cs.

        {
            Dimensions dimensions;
            dimensions.Width = 2;
            dimensions.Height = 2;
            dimensions.Depth = 2;

            // Component Creation
            Oven myOven = new Oven(dimensions);

            // Getters and setters are accessed using property syntax
            OvenClientOutput.Text += "Oven volume is: " + myOven.Volume.ToString() + "\n";

            // Register even listeners
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler1);
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler2);
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);

            // Unregister from an event using the -= syntax and a delegate instance
            myOven.BreadBaked -= new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);

            // Bake a loaf of bread. This will trigger the BreadBaked event.
            myOven.BakeBread("Sourdough");

            // Trigger the event again with a different preheat time
            myOven.ConfigurePreheatTemperature(OvenTemperature.High);
            myOven.BakeBread("Wheat");
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Use the custom Oven and Bread Windows Runtime components.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 46 of file Scenario1_OvenClient.xaml.cs.

        {
            Dimensions dimensions;
            dimensions.Width = 2;
            dimensions.Height = 2;
            dimensions.Depth = 2;

            // Component Creation
            Oven myOven = new Oven(dimensions);

            // Getters and setters are accessed using property syntax
            OvenClientOutput.Text += "Oven volume is: " + myOven.Volume.ToString() + "\n";

            // Register even listeners
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler1);
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler2);
            myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);

            // Unregister from an event using the -= syntax and a delegate instance
            myOven.BreadBaked -= new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);

            // Bake a loaf of bread. This will trigger the BreadBaked event.
            myOven.BakeBread("Sourdough");

            // Trigger the event again with a different preheat time
            myOven.ConfigurePreheatTemperature(OvenTemperature.High);
            myOven.BakeBread("Wheat");
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_OvenClient.xaml.cs.

The documentation for this class was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/cs/Scenario1_OvenClient.xaml.cs
  • ProxyStubsForWinRTComponents/cs/cs/Scenario1_OvenClient.xaml.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RandomNumberGeneratorTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • RandomNumberService
  • RandomNumberGeneratorTask
Public Member Functions | Private Member Functions | Private Attributes

RandomNumberGeneratorTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

async void | OnRequestReceived (AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
void | OnTaskCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Private Attributes

AppServiceConnection | connection
Random | randomNumberGenerator
BackgroundTaskDeferral | serviceDeferral

Detailed Description

Definition at line 8 of file RandomNumberGeneratorTask.cs.

Member Function Documentation

async void OnRequestReceived | ( | AppServiceConnection | sender,
 |  | AppServiceRequestReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 47 of file RandomNumberGeneratorTask.cs.

        {
            //Get a deferral so we can use an awaitable API to respond to the message
            var messageDeferral = args.GetDeferral();

            try
            {
                var input = args.Request.Message;
                int minValue = (int)input["minvalue"];
                int maxValue = (int)input["maxvalue"];

                //Create the response
                var result = new ValueSet();
                result.Add("result", randomNumberGenerator.Next(minValue, maxValue));

                //Send the response
                await args.Request.SendResponseAsync(result);

            }
            finally
            {
                //Complete the message deferral so the platform knows we're done responding
                messageDeferral.Complete();
            }
        }

void OnTaskCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 31 of file RandomNumberGeneratorTask.cs.

        {
            if (connection != null)
            {
                connection.Dispose();
                connection = null;
            }

            if (serviceDeferral != null)
            {
                //Complete the service deferral
                serviceDeferral.Complete();
                serviceDeferral = null;
            }
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 14 of file RandomNumberGeneratorTask.cs.

        {
            //Take a service deferral so the service isn't terminated
            serviceDeferral = taskInstance.GetDeferral();

            taskInstance.Canceled += OnTaskCanceled;

            //Initialize the random number generator
            randomNumberGenerator = new Random((int)DateTime.Now.Ticks);

            var details = taskInstance.TriggerDetails as AppServiceTriggerDetails;
            connection = details.AppServiceConnection;

            //Listen for incoming app service requests
            connection.RequestReceived += OnRequestReceived;
        }

Member Data Documentation

AppServiceConnection connection [private]

Definition at line 11 of file RandomNumberGeneratorTask.cs.

Random randomNumberGenerator [private]

Definition at line 12 of file RandomNumberGeneratorTask.cs.

BackgroundTaskDeferral serviceDeferral [private]

Definition at line 10 of file RandomNumberGeneratorTask.cs.

The documentation for this class was generated from the following file:
  • AppServices/cs/RandomNumberService/RandomNumberGeneratorTask.cs
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RawSMBIOSData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

RawSMBIOSData Struct Reference

List of all members.

Public Attributes

BYTE | DmiRevision
DWORD | Length
BYTE | SMBIOSMajorVersion
BYTE | SMBIOSMinorVersion
BYTE | SMBIOSTableData [ANYSIZE_ARRAY]
BYTE | Used20CallingMethod

Detailed Description

Definition at line 17 of file smbios.cpp.

Member Data Documentation

BYTE DmiRevision

Definition at line 20 of file smbios.cpp.

DWORD Length

Definition at line 21 of file smbios.cpp.

BYTE SMBIOSMajorVersion

Definition at line 18 of file smbios.cpp.

BYTE SMBIOSMinorVersion

Definition at line 19 of file smbios.cpp.

BYTE SMBIOSTableData[ANYSIZE_ARRAY]

Definition at line 22 of file smbios.cpp.

BYTE Used20CallingMethod

Definition at line 17 of file smbios.cpp.

The documentation for this struct was generated from the following file:
  • CustomCapability/Service/Client/smbios.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RawSMBIOSSystemInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

RawSMBIOSSystemInfo Struct Reference

Inherits RawSMBIOSTable.

List of all members.

Public Attributes

BYTE | Family
BYTE | Manufacturer
BYTE | ProductName
BYTE | SerialNumber
BYTE | SKUNumber
BYTE | UUID [16]
BYTE | Version
BYTE | Wakeup_Type

Detailed Description

Definition at line 34 of file smbios.cpp.

Member Data Documentation

BYTE Family

Definition at line 45 of file smbios.cpp.

BYTE Manufacturer

Definition at line 36 of file smbios.cpp.

BYTE ProductName

Definition at line 37 of file smbios.cpp.

BYTE SerialNumber

Definition at line 39 of file smbios.cpp.

BYTE SKUNumber

Definition at line 44 of file smbios.cpp.

BYTE UUID[16]

Definition at line 41 of file smbios.cpp.

BYTE Version

Definition at line 38 of file smbios.cpp.

BYTE Wakeup_Type

Definition at line 42 of file smbios.cpp.

The documentation for this struct was generated from the following file:
  • CustomCapability/Service/Client/smbios.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RawSMBIOSTable Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

RawSMBIOSTable Struct Reference

Inherited by RawSMBIOSSystemInfo.

List of all members.

Public Attributes

WORD | Handle
BYTE | Length
BYTE | Type

Detailed Description

Definition at line 27 of file smbios.cpp.

Member Data Documentation

WORD Handle

Definition at line 31 of file smbios.cpp.

BYTE Length

Definition at line 30 of file smbios.cpp.

BYTE Type

Definition at line 29 of file smbios.cpp.

The documentation for this struct was generated from the following file:
  • CustomCapability/Service/Client/smbios.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReadStreamTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Classes | Public Member Functions | Private Attributes | Static Private Attributes

ReadStreamTask Class Reference

#include "CompressionUtils.h"

List of all members.

Classes

struct | ReadStreamTaskImpl

Public Member Functions

ReadStreamTask (Windows::Storage::Streams::IInputStream^Stream, std::vector< byte > &Destination)
ReadStreamTask (const ReadStreamTask &Task)
ReadStreamTask & | operator= (const ReadStreamTask &Task)
concurrency::task< size_t > | RunTask ()

Private Attributes

ReadStreamTaskImpl * _Impl

Static Private Attributes

static const unsigned int | MinReadChunkSize = 0x10000

Detailed Description

Definition at line 10 of file CompressionUtils.h.

Constructor & Destructor Documentation

ReadStreamTask | ( | Windows::Storage::Streams::IInputStream^ | Stream,
 |  | std::vector< byte > & | Destination
 | ) |  |
ReadStreamTask ( const ReadStreamTask & Task )

Definition at line 109 of file CompressionUtils.cpp.

                                                         :
    _Impl(Task._Impl)
{
}

Member Function Documentation

ReadStreamTask & operator= ( const ReadStreamTask & Task )

Definition at line 114 of file CompressionUtils.cpp.

{
    _Impl = Task._Impl;
    return *this;
}

task< size_t > RunTask ( )

Definition at line 120 of file CompressionUtils.cpp.

{
    return _Impl->RunTask();
}

Member Data Documentation

ReadStreamTaskImpl* _Impl [private]

Definition at line 22 of file CompressionUtils.h.

const unsigned int MinReadChunkSize = 0x10000 [static, private]

Definition at line 20 of file CompressionUtils.h.

The documentation for this class was generated from the following files:
  • Compression/cpp/CompressionUtils.h
  • Compression/cpp/CompressionUtils.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReadStreamTask::ReadStreamTaskImpl Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ReadStreamTask
  • ReadStreamTask::ReadStreamTaskImpl
Public Member Functions | Public Attributes

ReadStreamTask::ReadStreamTaskImpl Struct Reference

List of all members.

Public Member Functions

ReadStreamTaskImpl (IInputStream^Stream, std::vector< byte > &Destination)
void | ReadChunk ()
task< size_t > | RunTask ()

Public Attributes

task_completion_event< void > | _CompletionEvent
std::vector< byte > & | _Destination
DataReader | _Reader
std::vector< byte > | _StreamData

Detailed Description

Definition at line 15 of file CompressionUtils.cpp.

Constructor & Destructor Documentation

ReadStreamTaskImpl | ( | IInputStream^ | Stream,
 |  | std::vector< byte > & | Destination |
 | ) |  |  | [inline]

Definition at line 16 of file CompressionUtils.cpp.

                                                                           :
        _Destination(Destination),
        _Reader(ref new DataReader(Stream)),
        _CompletionEvent()
    {
    }

Member Function Documentation

void ReadChunk ( ) [inline]

Definition at line 41 of file CompressionUtils.cpp.

    {
        // LoadAsync itself could throw exception if IAsyncOperation couldn't be created with
        // given parameters in a current state
        try
        {
            // Read data into the data reader
            _StreamData.reserve(_StreamData.size() + MinReadChunkSize);
            create_task(_Reader->LoadAsync(static_cast<unsigned int>(_StreamData.capacity() - _StreamData.size())))

            // Then store it to the result vector
            .then([this](task<unsigned int> BytesRead)
            {
                try
                {
                    // exception is thrown here if LoadAsync operation has been completed with an error
                    auto bytesRead = BytesRead.get();
                    if (bytesRead)
                    {
                        // Store chunk of data in the result vector.
                        auto newData = ref new Platform::Array<byte>(bytesRead);
                        _Reader->ReadBytes(newData);

                        _StreamData.insert(_StreamData.end(), newData->begin(), newData->end());

                        // Then recurse to read next chunk.
                        ReadChunk();
                    }
                    else
                    {
                        // End of stream is reached - complete top level task with the data we've read so far

                        // make sure that _CompletionEvent outlives continuation which deletes this ReadStreamTaskImpl
                        auto completionEvent = _CompletionEvent;
                        completionEvent.set();
                    }
                }
                catch (...)
                {
                    // Schedule resource deallocation
                    std::unique_ptr<ReadStreamTaskImpl> thisHolder(this);

                    _CompletionEvent.set_exception(std::current_exception());
                }
            });
        }
        catch (...)
        {
            // Schedule resource deallocation
            std::unique_ptr<ReadStreamTaskImpl> thisHolder(this);

            _CompletionEvent.set_exception(std::current_exception());
        }
    }

task<size_t> RunTask ( ) [inline]

Definition at line 23 of file CompressionUtils.cpp.

    {
        ReadChunk();
        return create_task(_CompletionEvent).then([this]
        {
            // Schedule resource deallocation
            std::unique_ptr<ReadStreamTaskImpl> thisHolder(this);

            // Prevent user provided stream from being closed
            _Reader->DetachStream();

            // Move data out
            _Destination = std::move(_StreamData);

            return _Destination.size();
        });
    }

Member Data Documentation

task_completion_event<void> _CompletionEvent

Definition at line 101 of file CompressionUtils.cpp.

std::vector<byte>& _Destination

Definition at line 97 of file CompressionUtils.cpp.

DataReader _Reader

Definition at line 98 of file CompressionUtils.cpp.

std::vector<byte> _StreamData

Definition at line 99 of file CompressionUtils.cpp.

The documentation for this struct was generated from the following file:
  • Compression/cpp/CompressionUtils.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReinhardEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

ReinhardEffect Class Reference

#include "ReinhardEffect.h"

List of all members.

Public Member Functions

IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pRenderInfo)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pGraph)

Static Public Member Functions

static HRESULT __stdcall | CreateReinhardImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

ReinhardEffect ()
HRESULT | UpdateConstants ()

Static Private Member Functions

static float | Clamp (float v, float low, float high)
static float | Round (float v)
static long | SafeAdd (long base, long valueToAdd)

Private Attributes

struct {
float dpi
} m_constants
float | m_dpi
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
Microsoft::WRL::ComPtr
< ID2D1EffectContext > 		m_effectContext
D2D1_RECT_L | m_inputRect
LONG | m_refCount

Detailed Description

Definition at line 17 of file ReinhardEffect.h.

Constructor & Destructor Documentation

ReinhardEffect ( ) [private]

Definition at line 19 of file ReinhardEffect.cpp.

                               :
    m_refCount(1)
{
}

Member Function Documentation

static float Clamp | ( | float | v,
 |  | float | low,
 |  | float | high |
 | ) |  |  | [inline, static, private]

Definition at line 71 of file ReinhardEffect.h.

    {
        return (v < low) ? low : (v > high) ? high : v;
    }

HRESULT __stdcall CreateReinhardImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]

Definition at line 24 of file ReinhardEffect.cpp.

{
    // Since the object's refcount is initialized to 1, we don't need to AddRef here.
    *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) ReinhardEffect());

    if (*ppEffectImpl == nullptr)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return S_OK;
    }
}

IFACEMETHODIMP_ ( UINT32 ) const
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pContextInternal,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |

Definition at line 70 of file ReinhardEffect.cpp.

{
    // To maintain consistency across different DPIs, this effect needs to cover more pixels at
    // higher than normal DPIs. The context is saved here so the effect can later retrieve the DPI.
    m_effectContext = pEffectContext;
    BasicReaderWriter^ reader = ref new BasicReaderWriter();
    Platform::Array<unsigned char, 1U>^ data;

    try
    {
        data = reader->ReadData("ReinhardEffect.cso");
    }
    catch (Platform::Exception^ e)
    {
        // Return error if file can not be read.
        return e->HResult;
    }

    HRESULT hr = pEffectContext->LoadPixelShader(GUID_ReinhardEffectPixelShader, data->Data, data->Length);

    // This loads the shader into the Direct2D image effects system and associates it with the GUID passed in.
    // If this method is called more than once (say by other instances of the effect) with the same GUID,
    // the system will simply do nothing, ensuring that only one instance of a shader is stored regardless of how
    // many time it is used.
    if (SUCCEEDED(hr))
    {
        // The graph consists of a single transform. In fact, this class is the transform,
        // reducing the complexity of implementing an effect when all we need to
        // do is use a single pixel shader.
        hr = pTransformGraph->SetSingleTransformNode(this);
    }

    return hr;
}

IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |

Definition at line 160 of file ReinhardEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    *pOutputRect = pInputRects[0];
    m_inputRect = pInputRects[0];

    // Indicate that entire output might contain transparency.
    ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));

    return S_OK;
}

IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const

Definition at line 184 of file ReinhardEffect.cpp.

{
    HRESULT hr = S_OK;

    // Indicate that the entire output may be invalid.
    *pInvalidOutputRect = m_inputRect;

    return hr;
}

IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const

Definition at line 139 of file ReinhardEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    pInputRects[0].left    = pOutputRect->left;
    pInputRects[0].top     = pOutputRect->top;
    pInputRects[0].right   = pOutputRect->right;
    pInputRects[0].bottom  = pOutputRect->bottom;

    return S_OK;
}

IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )

Definition at line 117 of file ReinhardEffect.cpp.

{
    return UpdateConstants();
}

IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 228 of file ReinhardEffect.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1EffectImpl))
    {
        *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
    }
    else if (riid == __uuidof(ID2D1DrawTransform))
    {
        *ppOutput = static_cast<ID2D1DrawTransform*>(this);
    }
    else if (riid == __uuidof(ID2D1Transform))
    {
        *ppOutput = static_cast<ID2D1Transform*>(this);
    }
    else if (riid == __uuidof(ID2D1TransformNode))
    {
        *ppOutput = static_cast<ID2D1TransformNode*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]

Definition at line 39 of file ReinhardEffect.cpp.

{
    // The inspectable metadata of an effect is defined in XML. This can be passed in from an external source
    // as well, however for simplicity we just inline the XML.
    PCWSTR pszXml =
        XML(
            <?xml version='1.0'?>
            <Effect>
                <!-- System Properties -->
                <Property name='DisplayName' type='string' value='Reinhard Tonemapper' />
                <Property name='Author' type='string' value='Microsoft Corporation' />
                <Property name='Category' type='string' value='Stylize' />
                <Property name='Description' type='string' value='Simplified (RGB) version of the Reinhard HDR tonemapper' />
                <Inputs>
                    <Input name='Source' />
                </Inputs>
                <!-- Custom Properties go here -->
            </Effect>
            );

    // This registers the effect with the factory, which will make the effect
    // instantiatable.
    return pFactory->RegisterEffectFromString(
        CLSID_CustomReinhardEffect,
        pszXml,
        nullptr,
        0,
        CreateReinhardImpl
        );
}

static float Round ( float v ) [inline, static, private]

Definition at line 76 of file ReinhardEffect.h.

    {
        return floor(v + 0.5f);
    }

static long SafeAdd | ( | long | base,
 |  | long | valueToAdd |
 | ) |  |  | [inline, static, private]

Definition at line 82 of file ReinhardEffect.h.

    {
        if (valueToAdd >= 0)
        {
            return ((base + valueToAdd) >= base) ? (base + valueToAdd) : LONG_MAX;
        }
        else
        {
            return ((base + valueToAdd) <= base) ? (base + valueToAdd) : LONG_MIN;
        }
    }

IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pRenderInfo )

Definition at line 131 of file ReinhardEffect.cpp.

{
    m_drawInfo = pDrawInfo;

    return m_drawInfo->SetPixelShader(GUID_ReinhardEffectPixelShader);
}

IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pGraph )

Definition at line 124 of file ReinhardEffect.cpp.

{
    return E_NOTIMPL;
}

HRESULT UpdateConstants ( ) [private]

Definition at line 108 of file ReinhardEffect.cpp.

{
    // Update the DPI if it has changed. This allows the effect to scale across different DPIs automatically.
    m_effectContext->GetDpi(&m_dpi, &m_dpi);
    m_constants.dpi = m_dpi;

    return m_drawInfo->SetPixelShaderConstantBuffer(reinterpret_cast<BYTE*>(&m_constants), sizeof(m_constants));
}

Member Data Documentation

float dpi

Definition at line 97 of file ReinhardEffect.h.

struct { ... } m_constants [private]
float m_dpi [private]

Definition at line 104 of file ReinhardEffect.h.

Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 100 of file ReinhardEffect.h.

Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext [private]

Definition at line 101 of file ReinhardEffect.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 103 of file ReinhardEffect.h.

LONG m_refCount [private]

Definition at line 102 of file ReinhardEffect.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • RelativeInclinometerCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, InclinometerReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

uint DesiredReportInterval
MainPage | rootPage = MainPage.Current
Inclinometer | Sensor

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 33 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            Sensor = Inclinometer.GetDefaultForRelativeReadings();
            if (Sensor != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = Sensor.MinimumReportInterval;
                DesiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
            }
            else
            {
                rootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 56 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 70 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                Sensor.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | InclinometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 114 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                InclinometerReading reading = e.Reading;
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 154 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            Sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 130 of file Scenario1_DataEvents.xaml.cs.

        {
            if (Sensor != null)
            {
                // Establish the report interval
                Sensor.ReportInterval = DesiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                Sensor.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 92 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    Sensor.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

Member Data Documentation

uint DesiredReportInterval [private]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

Inclinometer Sensor [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • RelativeInclinometer/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • RelativeInclinometerCS
  • Scenario2_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | GetData (object sender, object args)

Private Attributes

MainPage | RootPage = MainPage.Current
Inclinometer | Sensor

Detailed Description

Definition at line 20 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            Sensor = Inclinometer.GetDefaultForRelativeReadings();
            if (Sensor == null)
            {
                RootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
                GetDataButton.IsEnabled = false;
            }
            else
            {
                GetDataButton.IsEnabled = true;
            }
        }

Member Function Documentation

void GetData | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Invoked when a user clicks on the GetDataButton.

Parameters:
sender
args

Definition at line 71 of file Scenario2_Polling.xaml.cs.

        {
            InclinometerReading reading = Sensor.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 49 of file Scenario2_Polling.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 61 of file Scenario2_Polling.xaml.cs.

        {
            base.OnNavigatingFrom(e);
        }

Member Data Documentation

MainPage RootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Inclinometer Sensor [private]

Definition at line 26 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • RelativeInclinometer/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RenderBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

RenderBuffer Struct Reference

#include "Common.h"

List of all members.

Public Member Functions

RenderBuffer ()
~RenderBuffer ()

Public Attributes

BYTE * | Buffer
UINT32 | BufferSize
UINT32 | BytesFilled
RenderBuffer * Next

Detailed Description

Definition at line 134 of file Common.h.

Constructor & Destructor Documentation

RenderBuffer ( ) [inline]

Definition at line 141 of file Common.h.

                   :
        BufferSize(0),
        BytesFilled(0),
        Buffer( nullptr ),
        Next( nullptr )
    {
    }

~RenderBuffer ( ) [inline]

Definition at line 149 of file Common.h.

    {
        SAFE_ARRAYDELETE( Buffer );
    }

Member Data Documentation

BYTE* Buffer

Definition at line 138 of file Common.h.

UINT32 BufferSize

Definition at line 136 of file Common.h.

UINT32 BytesFilled

Definition at line 137 of file Common.h.

RenderBuffer* Next

Definition at line 139 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cpp/Common.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RippleEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

RippleEffect Class Reference

#include "RippleEffect.h"

List of all members.

Public Member Functions

float | GetAmplitude () const
D2D1_POINT_2F | GetCenter () const
float | GetFrequency () const
float | GetPhase () const
float | GetSpread () const
IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
HRESULT | SetAmplitude (float amplitude)
HRESULT | SetCenter (D2D1_POINT_2F center)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pRenderInfo)
HRESULT | SetFrequency (float frequency)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pGraph)
HRESULT | SetPhase (float phase)
HRESULT | SetSpread (float spread)

Static Public Member Functions

static HRESULT __stdcall | CreateRippleImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

RippleEffect ()
HRESULT | UpdateConstants ()

Static Private Member Functions

static float | Clamp (float v, float low, float high)
static float | Round (float v)
static long | SafeAdd (long base, long valueToAdd)

Private Attributes

struct {
float amplitude
D2D1_POINT_2F center
float dpi
float frequency
float phase
float spread
} m_constants
float | m_dpi
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
Microsoft::WRL::ComPtr
< ID2D1EffectContext > 		m_effectContext
D2D1_RECT_L | m_inputRect
LONG | m_refCount

Detailed Description

Definition at line 26 of file RippleEffect.h.

Constructor & Destructor Documentation

RippleEffect ( ) [private]

Definition at line 19 of file RippleEffect.cpp.

                           :
    m_refCount(1)
{
    m_constants.amplitude = 0;
    m_constants.center = D2D1::Point2F(0, 0);
    m_constants.frequency = 0;
    m_constants.phase = 0;
    m_constants.spread = 0;
}

Member Function Documentation

static float Clamp | ( | float | v,
 |  | float | low,
 |  | float | high |
 | ) |  |  | [inline, static, private]

Definition at line 96 of file RippleEffect.h.

    {
        return (v < low) ? low : (v > high) ? high : v;
    }

HRESULT __stdcall CreateRippleImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]

Definition at line 29 of file RippleEffect.cpp.

{
    // Since the object's refcount is initialized to 1, we don't need to AddRef here.
    *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) RippleEffect());

    if (*ppEffectImpl == nullptr)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return S_OK;
    }
}

float GetAmplitude ( ) const

Definition at line 196 of file RippleEffect.cpp.

{
    return m_constants.amplitude;
}

D2D1_POINT_2F GetCenter ( ) const

Definition at line 208 of file RippleEffect.cpp.

{
    return m_constants.center;
}

float GetFrequency ( ) const

Definition at line 160 of file RippleEffect.cpp.

{
    return m_constants.frequency;
}

float GetPhase ( ) const

Definition at line 172 of file RippleEffect.cpp.

{
    return m_constants.phase;
}

float GetSpread ( ) const

Definition at line 184 of file RippleEffect.cpp.

{
    return m_constants.spread;
}

IFACEMETHODIMP_ ( UINT32 ) const
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pContextInternal,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |

Definition at line 114 of file RippleEffect.cpp.

{
    // To maintain consistency across different DPIs, this effect needs to cover more pixels at
    // higher than normal DPIs. The context is saved here so the effect can later retrieve the DPI.
    m_effectContext = pEffectContext;

    BasicReaderWriter^ reader = ref new BasicReaderWriter();
    Platform::Array<unsigned char, 1U>^ data;

    try
    {
        data = reader->ReadData("RippleEffect.cso");
    }
    catch (Platform::Exception^ e)
    {
        // Return error if file can not be read.
        return e->HResult;
    }

    HRESULT hr = pEffectContext->LoadPixelShader(GUID_RipplePixelShader, data->Data, data->Length);

    // This loads the shader into the Direct2D image effects system and associates it with the GUID passed in.
    // If this method is called more than once (say by other instances of the effect) with the same GUID,
    // the system will simply do nothing, ensuring that only one instance of a shader is stored regardless of how
    // many time it is used.
    if (SUCCEEDED(hr))
    {
        // The graph consists of a single transform. In fact, this class is the transform,
        // reducing the complexity of implementing an effect when all we need to
        // do is use a single pixel shader.
        hr = pTransformGraph->SetSingleTransformNode(this);
    }

    return hr;
}

IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |

Definition at line 271 of file RippleEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    *pOutputRect = pInputRects[0];
    m_inputRect = pInputRects[0];

    // Indicate that entire output might contain transparency.
    ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));

    return S_OK;
}

IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const

Definition at line 295 of file RippleEffect.cpp.

{
    HRESULT hr = S_OK;

    // Indicate that the entire output may be invalid.
    *pInvalidOutputRect = m_inputRect;

    return hr;
}

IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const

Definition at line 246 of file RippleEffect.cpp.

{
    // This effect has exactly one input, so if there is more than one input rect,
    // something is wrong.
    if (inputRectCount != 1)
    {
        return E_INVALIDARG;
    }

    long expansion = static_cast<long>(Round(m_constants.amplitude));

    // Expand the rect out by the amplitude of the ripple animation. SafeAdd
    // is a helper function that prevents long over/underflows.
    pInputRects[0].left    = SafeAdd(pOutputRect->left, -expansion);
    pInputRects[0].top     = SafeAdd(pOutputRect->top, -expansion);
    pInputRects[0].right   = SafeAdd(pOutputRect->right, expansion);
    pInputRects[0].bottom  = SafeAdd(pOutputRect->bottom, expansion);

    return S_OK;
}

IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )

Definition at line 222 of file RippleEffect.cpp.

{
    return UpdateConstants();
}

IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 341 of file RippleEffect.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1EffectImpl))
    {
        *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
    }
    else if (riid == __uuidof(ID2D1DrawTransform))
    {
        *ppOutput = static_cast<ID2D1DrawTransform*>(this);
    }
    else if (riid == __uuidof(ID2D1Transform))
    {
        *ppOutput = static_cast<ID2D1Transform*>(this);
    }
    else if (riid == __uuidof(ID2D1TransformNode))
    {
        *ppOutput = static_cast<ID2D1TransformNode*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]

Definition at line 44 of file RippleEffect.cpp.

{
    // The inspectable metadata of an effect is defined in XML. This can be passed in from an external source
    // as well, however for simplicity we just inline the XML.
    PCWSTR pszXml =
        XML(
            <?xml version='1.0'?>
            <Effect>
                <!-- System Properties -->
                <Property name='DisplayName' type='string' value='Ripple'/>
                <Property name='Author' type='string' value='Microsoft Corporation'/>
                <Property name='Category' type='string' value='Stylize'/>
                <Property name='Description' type='string' value='Adds a ripple effect that can be animated'/>
                <Inputs>
                    <Input name='Source'/>
                </Inputs>
                <!-- Custom Properties go here -->
                <Property name='Frequency' type='float'>
                    <Property name='DisplayName' type='string' value='Frequency'/>
                    <Property name='Min' type='float' value='0.0' />
                    <Property name='Max' type='float' value='1000.0' />
                    <Property name='Default' type='float' value='0.0' />
                </Property>
                <Property name='Phase' type='float'>
                    <Property name='DisplayName' type='string' value='Phase'/>
                    <Property name='Min' type='float' value='-100.0' />
                    <Property name='Max' type='float' value='100.0' />
                    <Property name='Default' type='float' value='0.0' />
                </Property>
                <Property name='Amplitude' type='float'>
                    <Property name='DisplayName' type='string' value='Amplitude'/>
                    <Property name='Min' type='float' value='0.0001' />
                    <Property name='Max' type='float' value='1000.0' />
                    <Property name='Default' type='float' value='0.0' />
                </Property>
                <Property name='Spread' type='float'>
                    <Property name='DisplayName' type='string' value='Spread'/>
                    <Property name='Min' type='float' value='0.0001' />
                    <Property name='Max' type='float' value='1000.0' />
                    <Property name='Default' type='float' value='0.0' />
                </Property>
                <Property name='Center' type='vector2'>
                    <Property name='DisplayName' type='string' value='Center'/>
                    <Property name='Default' type='vector2' value='(0.0, 0.0)' />
                </Property>
            </Effect>
            );

    // This defines the bindings from specific properties to the callback functions
    // on the class that ID2D1Effect::SetValue() & GetValue() will call.
    const D2D1_PROPERTY_BINDING bindings[] =
    {
        D2D1_VALUE_TYPE_BINDING(L"Frequency", &SetFrequency, &GetFrequency),
        D2D1_VALUE_TYPE_BINDING(L"Phase", &SetPhase, &GetPhase),
        D2D1_VALUE_TYPE_BINDING(L"Amplitude", &SetAmplitude, &GetAmplitude),
        D2D1_VALUE_TYPE_BINDING(L"Spread", &SetSpread, &GetSpread),
        D2D1_VALUE_TYPE_BINDING(L"Center", &SetCenter, &GetCenter),
    };

    // This registers the effect with the factory, which will make the effect
    // instantiatable.
    return pFactory->RegisterEffectFromString(
        CLSID_CustomRippleEffect,
        pszXml,
        bindings,
        ARRAYSIZE(bindings),
        CreateRippleImpl
        );
}

static float Round ( float v ) [inline, static, private]

Definition at line 101 of file RippleEffect.h.

    {
        return floor(v + 0.5f);
    }

static long SafeAdd | ( | long | base,
 |  | long | valueToAdd |
 | ) |  |  | [inline, static, private]

Definition at line 107 of file RippleEffect.h.

    {
        if (valueToAdd >= 0)
        {
            return ((base + valueToAdd) >= base) ? (base + valueToAdd) : LONG_MAX;
        }
        else
        {
            return ((base + valueToAdd) <= base) ? (base + valueToAdd) : LONG_MIN;
        }
    }

HRESULT SetAmplitude ( float amplitude )

Definition at line 177 of file RippleEffect.cpp.

{
    // Limit to the published possible values in the XML.
    m_constants.amplitude = Clamp(amplitude, 0.0001f, 1000.0f);
    return S_OK;
}

HRESULT SetCenter ( D2D1_POINT_2F center )

Definition at line 201 of file RippleEffect.cpp.

{
    // The valid range is all possible point positions, so no clamping is needed.
    m_constants.center = center;
    return S_OK;
}

IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pRenderInfo )

Definition at line 236 of file RippleEffect.cpp.

{
    m_drawInfo = pDrawInfo;

    return m_drawInfo->SetPixelShader(GUID_RipplePixelShader);
}

HRESULT SetFrequency ( float frequency )

Definition at line 153 of file RippleEffect.cpp.

{
    // Limit to the published possible values in the XML.
    m_constants.frequency = Clamp(frequency, 0.0f, 1000.0f);
    return S_OK;
}

IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pGraph )

Definition at line 229 of file RippleEffect.cpp.

{
    return E_NOTIMPL;
}

HRESULT SetPhase ( float phase )

Definition at line 165 of file RippleEffect.cpp.

{
    // Limit to the published possible values in the XML.
    m_constants.phase = Clamp(phase, -100.0f, 100.0f);
    return S_OK;
}

HRESULT SetSpread ( float spread )

Definition at line 189 of file RippleEffect.cpp.

{
    // Limit to the published possible values in the XML.
    m_constants.spread = Clamp(spread, 0.0001f, 1000.0f);
    return S_OK;
}

HRESULT UpdateConstants ( ) [private]

Definition at line 213 of file RippleEffect.cpp.

{
    // Update the DPI if it has changed. This allows the effect to scale across different DPIs automatically.
    m_effectContext->GetDpi(&m_dpi, &m_dpi);
    m_constants.dpi = m_dpi;

    return m_drawInfo->SetPixelShaderConstantBuffer(reinterpret_cast<BYTE*>(&m_constants), sizeof(m_constants));
}

Member Data Documentation

float amplitude

Definition at line 124 of file RippleEffect.h.

D2D1_POINT_2F center

Definition at line 126 of file RippleEffect.h.

float dpi

Definition at line 127 of file RippleEffect.h.

float frequency

Definition at line 122 of file RippleEffect.h.

struct { ... } m_constants [private]
float m_dpi [private]

Definition at line 134 of file RippleEffect.h.

Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 130 of file RippleEffect.h.

Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext [private]

Definition at line 131 of file RippleEffect.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 133 of file RippleEffect.h.

LONG m_refCount [private]

Definition at line 132 of file RippleEffect.h.

float phase

Definition at line 123 of file RippleEffect.h.

float spread

Definition at line 125 of file RippleEffect.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/PixelShader/RippleEffect.h
  • D2DCustomEffects/cpp/PixelShader/RippleEffect.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Metering Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • RpcServer
  • Metering
Public Member Functions | Private Attributes

Metering Class Reference

#include "Metering.h"

List of all members.

Public Member Functions

Metering (__int64 period)
~Metering ()
__int64 | GetMeteringData () const
void | MeteringWorker ()
void | SetSamplePeriod (__int64 period)
void | StartMetering (__int64 samplePeriod, __int64 context)
void | StopMetering ()
void | WaitForMeteringData () const

Private Attributes

volatile __int64 | _data
HANDLE | event
volatile __int64 | samplePeriod
volatile bool | stopMeteringRequested = false
PTP_TIMER | tpTimer = nullptr

Detailed Description

Definition at line 10 of file Metering.h.

Constructor & Destructor Documentation

Metering ( __int64 period )
~Metering ( )

Definition at line 56 of file Metering.cpp.

{
    if (tpTimer != nullptr)
    {
        // How to close threadpool timer when there are outstanding callbacks:
        // https://msdn.microsoft.com/en-us/library/windows/desktop/ms682040(v=vs.85).aspx
        SetThreadpoolTimer(tpTimer, nullptr, 0, 0);
        WaitForThreadpoolTimerCallbacks(tpTimer, true);
        CloseThreadpoolTimer(tpTimer);
        tpTimer = nullptr;
    }
    CloseHandle(event);
}

Member Function Documentation

__int64 GetMeteringData ( ) const

Definition at line 92 of file Metering.cpp.

{
    return _data;
}

void MeteringWorker ( )

Definition at line 100 of file Metering.cpp.

{
    // Get the value from the imaginary driver and update the data
    _data = GetTickCount();
    SetEvent(event);
}

void SetSamplePeriod ( __int64 period )
void StartMetering | ( | __int64 | samplePeriod,
 |  | __int64 | context
 | ) |  |
void StopMetering ( )

Definition at line 144 of file Metering.cpp.

{
    stopMeteringRequested = true;
}

void WaitForMeteringData ( ) const

Definition at line 110 of file Metering.cpp.

{
    ULARGE_INTEGER ulDueTime;
    FILETIME FileDueTime;
    ulDueTime.QuadPart = static_cast<ULONGLONG>(-(1 * 10 * 1000 * samplePeriod));
    FileDueTime.dwHighDateTime = ulDueTime.HighPart;
    FileDueTime.dwLowDateTime = ulDueTime.LowPart;

    SetThreadpoolTimer(tpTimer,
                       &FileDueTime,
                       0,
                       0);

    WaitForSingleObject(event, INFINITE);
}

Member Data Documentation

volatile __int64 _data [private]

Definition at line 23 of file Metering.h.

HANDLE event [private]

Definition at line 26 of file Metering.h.

volatile __int64 samplePeriod [private]

Definition at line 24 of file Metering.h.

volatile bool stopMeteringRequested = false [private]

Definition at line 27 of file Metering.h.

PTP_TIMER tpTimer = nullptr [private]

Definition at line 25 of file Metering.h.

The documentation for this class was generated from the following files:
  • CustomCapability/Service/Server/Metering.h
  • CustomCapability/Service/Server/Metering.cpp
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RecognizedTextRun Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Sample
  • RecognizedTextRun
Public Attributes

RecognizedTextRun Struct Reference

import "LinguisticServices.idl";

List of all members.

Public Attributes

UInt32 | First
UInt32 | Last
String | Script

Detailed Description

Definition at line 3 of file LinguisticServices.idl.

Member Data Documentation

UInt32 First

Definition at line 5 of file LinguisticServices.idl.

UInt32 Last

Definition at line 6 of file LinguisticServices.idl.

String Script

Definition at line 7 of file LinguisticServices.idl.

The documentation for this struct was generated from the following file:
  • LinguisticServices/RuntimeComponent/LinguisticServices.idl
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioContext Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

ScenarioContext Struct Reference

#include "CompressionUtils.h"

List of all members.

Public Attributes

std::vector< byte > | compressedData
Windows::Storage::Compression::Compressor | compressor
std::vector< byte > | decompressedData
std::vector< byte > | originalData
Windows::Storage::Streams::InMemoryRandomAccessStream | raStream
Windows::Storage::Streams::DataWriter | writer

Detailed Description

Definition at line 27 of file CompressionUtils.h.

Member Data Documentation

std::vector<byte> compressedData

Definition at line 33 of file CompressionUtils.h.

Windows::Storage::Compression::Compressor compressor

Definition at line 30 of file CompressionUtils.h.

std::vector<byte> decompressedData

Definition at line 34 of file CompressionUtils.h.

std::vector<byte> originalData

Definition at line 32 of file CompressionUtils.h.

Windows::Storage::Streams::InMemoryRandomAccessStream raStream

Definition at line 29 of file CompressionUtils.h.

Windows::Storage::Streams::DataWriter writer

Definition at line 31 of file CompressionUtils.h.

The documentation for this struct was generated from the following file:
  • Compression/cpp/CompressionUtils.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnActivated (IActivatedEventArgs args)
override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | Current_UnhandledException (object sender, UnhandledExceptionEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 26 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 32 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

void Current_UnhandledException | ( | object | sender,
 |  | UnhandledExceptionEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file App.xaml.cs.

        {
            Window.Current.Content = new Frame();
            Frame rootFrame = Window.Current.Content as Frame;
            Window.Current.Activate();
            rootFrame.Navigate(typeof(UnhandledExceptionPage));
            ((UnhandledExceptionPage)rootFrame.Content).StatusMessage = e.Exception.Message + e.Exception.StackTrace;
        }

override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

Definition at line 113 of file App.xaml.cs.

        {
            try
            {
                Window.Current.Content = new Frame();
                Frame rootFrame = Window.Current.Content as Frame;
                Window.Current.Activate();

                if (args.Kind == ActivationKind.DialReceiver)
                {
                    rootFrame.Navigate(typeof(MainPage), args);
                }
                else
                {
                    rootFrame.Navigate(typeof(MainPage));
                }
                base.OnActivated(args);
            }
            catch (Exception ex)
            {
                Window.Current.Content = new Frame();
                Frame rootFrame = Window.Current.Content as Frame;
                Window.Current.Activate();
                rootFrame.Navigate(typeof(UnhandledExceptionPage));
                ((UnhandledExceptionPage)rootFrame.Content).StatusMessage = ex.Message + ex.StackTrace;
            }
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 43 of file App.xaml.cs.

        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;

            }

#endif
            Application.Current.UnhandledException += Current_UnhandledException;

            Window.Current.Activate();

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
                Window.Current.Activate();
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                try
                {
                    rootFrame.Navigate(typeof(MainPage), e);
                }
                catch (Exception ex)
                {
                    Window.Current.Content = new Frame();
                    Window.Current.Activate();
                    rootFrame.Navigate(typeof(UnhandledExceptionPage), e.Arguments);
                    ((UnhandledExceptionPage)rootFrame.Content).StatusMessage = ex.Message + ex.StackTrace;
                }

            }

            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 147 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 159 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/App.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTransportControlsWithCustomCastButton Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Controls
  • MediaTransportControlsWithCustomCastButton
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions

MediaTransportControlsWithCustomCastButton Class Reference

List of all members.

Public Member Functions

MediaTransportControlsWithCustomCastButton ()

Protected Member Functions

override void | OnApplyTemplate ()

Properties

Button | CastButton [get]

Events

EventHandler | CastButtonClicked

Private Member Functions

void | CastButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 27 of file MediaTransportControlsWithCustomCastButton.cs.

Constructor & Destructor Documentation

MediaTransportControlsWithCustomCastButton ( ) [inline]

Definition at line 30 of file MediaTransportControlsWithCustomCastButton.cs.

        {
            this.DefaultStyleKey = typeof(MediaTransportControlsWithCustomCastButton);
        }

Member Function Documentation

void CastButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file MediaTransportControlsWithCustomCastButton.cs.

        {
            if (CastButtonClicked != null)
                CastButtonClicked(this, EventArgs.Empty);
        }

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 46 of file MediaTransportControlsWithCustomCastButton.cs.

        {
            base.OnApplyTemplate();

            this.IsCompact = true;

            CastButton.Click += CastButton_Click;
        }

Property Documentation

Button CastButton [get]

Definition at line 43 of file MediaTransportControlsWithCustomCastButton.cs.

Event Documentation

EventHandler CastButtonClicked

Definition at line 35 of file MediaTransportControlsWithCustomCastButton.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Controls/MediaTransportControlsWithCustomCastButton.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProjectedMediaTransportControls Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Controls
  • ProjectedMediaTransportControls
Public Member Functions | Protected Member Functions | Events | Private Member Functions

ProjectedMediaTransportControls Class Reference

List of all members.

Public Member Functions

ProjectedMediaTransportControls ()

Protected Member Functions

override void | OnApplyTemplate ()

Events

EventHandler | StopProjectingButtonClick
EventHandler | SwapViewsButtonClick

Private Member Functions

void | StopProjectingButton_Click (object sender, RoutedEventArgs e)
void | SwapViewsButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 27 of file ProjectedMediaTransportControls.cs.

Constructor & Destructor Documentation

ProjectedMediaTransportControls ( ) [inline]

Definition at line 30 of file ProjectedMediaTransportControls.cs.

        {
            this.DefaultStyleKey = typeof(ProjectedMediaTransportControls);
        }

Member Function Documentation

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 35 of file ProjectedMediaTransportControls.cs.

        {
            base.OnApplyTemplate();

            //Find the Swap Views button and subscribe to the clicked event.
            Button swapViewsButton = GetTemplateChild("SwapViewsButton") as Button;
            swapViewsButton.Click += SwapViewsButton_Click;

            //Find the Stop Projecting button and subscribe to the clicked event.
            Button stopProjectingButton = GetTemplateChild("StopProjectingButton") as Button;
            stopProjectingButton.Click += StopProjectingButton_Click;

            this.IsCompact = true;
        }

void StopProjectingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file ProjectedMediaTransportControls.cs.

        {
            if (StopProjectingButtonClick != null)
                StopProjectingButtonClick(this, EventArgs.Empty);
        }

void SwapViewsButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file ProjectedMediaTransportControls.cs.

        {
            if (SwapViewsButtonClick != null)
                SwapViewsButtonClick(this, EventArgs.Empty);
        }

Event Documentation

EventHandler StopProjectingButtonClick

Definition at line 50 of file ProjectedMediaTransportControls.cs.

EventHandler SwapViewsButtonClick

Definition at line 51 of file ProjectedMediaTransportControls.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Controls/ProjectedMediaTransportControls.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AzureDataProvider Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Data
  • Azure
  • AzureDataProvider
Public Member Functions | Private Attributes | Static Private Attributes

AzureDataProvider Class Reference

Inherits ScreenCasting::Data::Common::ItemsDataProvider.

List of all members.

Public Member Functions

override List< VideoMetaData > | GetAll (int max_results)
override VideoMetaData | GetFromID (string id)
override VideoMetaData | GetRandomVideo ()

Private Attributes

const int | MAX_RESULTS = 10

Static Private Attributes

static Dictionary< string,
VideoMetaData > 		s_metaDataList = null

Detailed Description

Definition at line 22 of file AzureDataProvider.cs.

Member Function Documentation

override List<VideoMetaData> GetAll ( int max_results ) [inline, virtual]

Implements ItemsDataProvider.

Definition at line 34 of file AzureDataProvider.cs.

        {
            if (s_metaDataList == null)
            {
                Dictionary<string, VideoMetaData> l = new Dictionary<string, VideoMetaData>();

                VideoMetaData video1 = new VideoMetaData();
                video1.Id = "AzureMediaServicesOverview";
                video1.PubDate = DateTime.Now;
                video1.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=m3u8-aapl)");
                video1.Title = "Azure Media Services Overview";
                video1.WebPageLink = new Uri("http://amsplayer.azurewebsites.net/amssamples.html");
                video1.License = "(C) Microsoft Coorporation | All Rights Reserved";
                video1.Thumbnail = new Uri("http://t3.gstatic.com/images?q=tbn:ANd9GcRoTu81vs8GuQtJBGUZ0pLEiNHVVx3dFwHsu7JCkvGop8Z-98EsPg");
                l.Add(video1.Id, video1);

                VideoMetaData video2 = new VideoMetaData();
                video2.Id = "BigBuckBunnyTrailer";
                video2.PubDate = DateTime.Now;
                video2.VideoLink = new Uri("http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi");
                video2.Title = "Big Buck Bunny";
                video2.WebPageLink = new Uri("https://peach.blender.org/");
                video2.License = "(CC) Blender Foundation | peach.blender.org";
                video2.Thumbnail = new Uri("http://t0.gstatic.com/images?q=tbn:ANd9GcQT54UKh0zX5OUDNLRyXOOwt3pqj0lpaLCJebucva2LSV49aGjRfg");
                l.Add(video2.Id, video2);

                VideoMetaData video3 = new VideoMetaData();
                video3.Id = "bc57e088-27ec-44e0-ac20-a85ccbcd50da";
                video3.PubDate = DateTime.Now;
                video3.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TearsOfSteel.ism/manifest(format=mpd-time-csf)");
                video3.Title = "Tears of Steel";
                video3.WebPageLink = new Uri("https://mango.blender.org/");
                video3.License = "(CC) Blender Foundation | durian.blender.org/";
                video3.Thumbnail = new Uri("http://t3.gstatic.com/images?q=tbn:ANd9GcQO0MMO_vXf8Q1zjZWLHa1_566Mf_jty6vJKRi9R-C_0W-gXnNOog");
                l.Add(video3.Id, video3);

                //VideoMetaData video4 = new VideoMetaData();
                //video4.Id = "b6822ec8-5c2b-4ae0-a851-fd46a78294e9";
                //video4.PubDate = DateTime.Now;
                //video4.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/b6822ec8-5c2b-4ae0-a851-fd46a78294e9/ElephantsDream.ism/manifest(filtername=FirstFilter,format=mpd-time-csf)");
                //video4.Title = "Elephants Dream";
                //video4.WebPageLink = new Uri("https://orange.blender.org/");
                //video4.License = "(c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org";
                //video4.Thumbnail = new Uri("https://orange.blender.org/wp-content/uploads/2006/05/edscore_cover_l.jpg");
                //l.Add(video4.Id, video4);

                VideoMetaData video5 = new VideoMetaData();
                video5.Id = "49b57c87-f5f3-48b3-ba22-c55cfdffa9cb";
                video5.PubDate = DateTime.Now;
                video5.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/49b57c87-f5f3-48b3-ba22-c55cfdffa9cb/Sintel.ism/manifest(format=m3u8-aapl)");
                video5.Title = "Sintel";
                video5.WebPageLink = new Uri("https://durian.blender.org/");
                video5.License = "© copyright Blender Foundation | www.sintel.org";
                video5.Thumbnail = new Uri("https://durian.blender.org/wp-content/uploads/2010/05/sintel_trailer_1080.jpg");
                l.Add(video5.Id, video5);
                s_metaDataList = l;
            }
            return s_metaDataList.Values.ToList<VideoMetaData>();
        }

override VideoMetaData GetFromID ( string id ) [inline, virtual]

Implements ItemsDataProvider.

Definition at line 95 of file AzureDataProvider.cs.

        {
            if (s_metaDataList == null)
                GetAll(20);

            VideoMetaData video = s_metaDataList[id];

            return video;
        }

override VideoMetaData GetRandomVideo ( ) [inline, virtual]

Implements ItemsDataProvider.

Definition at line 26 of file AzureDataProvider.cs.

        {
            List<VideoMetaData> videos = GetAll(MAX_RESULTS);
            Random indexRandomizer = new Random();

            // Pick a random video
            return videos[indexRandomizer.Next(0, videos.Count - 1)];
        }

Member Data Documentation

const int MAX_RESULTS = 10 [private]

Definition at line 25 of file AzureDataProvider.cs.

Dictionary<string, VideoMetaData> s_metaDataList = null [static, private]

Definition at line 24 of file AzureDataProvider.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Data/Azure/AzureDataProvider.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemsDataProvider Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Data
  • Common
  • ItemsDataProvider
Public Member Functions

ItemsDataProvider Class Reference

Inherited by AzureDataProvider.

List of all members.

Public Member Functions

abstract List< VideoMetaData > | GetAll (int max_results)
abstract VideoMetaData | GetFromID (string ID)
abstract VideoMetaData | GetRandomVideo ()

Detailed Description

Definition at line 20 of file ItemsDataProvider.cs.

Member Function Documentation

abstract List<VideoMetaData> GetAll ( int max_results ) [pure virtual]

Implemented in AzureDataProvider.

abstract VideoMetaData GetFromID ( string ID ) [pure virtual]

Implemented in AzureDataProvider.

abstract VideoMetaData GetRandomVideo ( ) [pure virtual]

Implemented in AzureDataProvider.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Data/Common/ItemsDataProvider.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoMetaData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Data
  • Common
  • VideoMetaData
Properties

VideoMetaData Class Reference

List of all members.

Properties

string | Id [get, set]
string | License [get, set]
DateTime | PubDate [get, set]
Uri | Thumbnail [get, set]
string | Title [get, set]
Uri | VideoLink [get, set]
Uri | WebPageLink [get, set]

Detailed Description

Definition at line 20 of file VideoMetaData.cs.

Property Documentation

string Id [get, set]

Definition at line 22 of file VideoMetaData.cs.

string License [get, set]

Definition at line 25 of file VideoMetaData.cs.

DateTime PubDate [get, set]

Definition at line 24 of file VideoMetaData.cs.

Uri Thumbnail [get, set]

Definition at line 28 of file VideoMetaData.cs.

string Title [get, set]

Definition at line 23 of file VideoMetaData.cs.

Uri VideoLink [get, set]

Definition at line 27 of file VideoMetaData.cs.

Uri WebPageLink [get, set]

Definition at line 26 of file VideoMetaData.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Data/Common/VideoMetaData.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • MainPage
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()
void | NotifyUser (string strMessage, NotifyType type)

Public Attributes

const string | FEATURE_NAME = "ScreenCasting"
ViewLifetimeControl ProjectionViewPageControl

Static Public Attributes

static MainPage | Current

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Properties

List< Scenario > | Scenarios [get]

Private Member Functions

void | Button_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | LoadScenarios ()
internal void | NavigateToScenario (Type scenarioType, object args)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

List< Scenario > scenarios

Detailed Description

Definition at line 30 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 34 of file MainPage.xaml.cs.

        {
            LoadScenarios();

            this.DataContext = this;

            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

Member Function Documentation

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 193 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 188 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void LoadScenarios ( ) [inline, private]

Definition at line 26 of file SampleConfiguration.cs.

        {
            if (ApiInformation.IsTypePresent("Windows.Devices.Enumeration.DevicePicker"))
            {
                scenarios = new List<Scenario>
                {
                    new Scenario() { Title="1 - Media Element Casting 101", ClassType=Type.GetType("ScreenCasting.Scenario01",false)}
                    ,new Scenario() { Title="2 - Casting APIs and a Custom Cast Button", ClassType=Type.GetType("ScreenCasting.Scenario02",false)}
                    ,new Scenario() { Title="3 - DIAL Sender Universal Windows app", ClassType=Type.GetType("ScreenCasting.Scenario03",false)}
                    ,new Scenario() { Title="4 - DIAL Receiver Windows Universal app", ClassType=Type.GetType("ScreenCasting.Scenario04")}
                    ,new Scenario() { Title="5 - Multi-View Media Application", ClassType=Type.GetType("ScreenCasting.Scenario05")}
                    ,new Scenario() { Title="6 - Combine Casting Methods", ClassType=Type.GetType("ScreenCasting.Scenario06")}

              };
            }
            else
            {
                scenarios = new List<Scenario> {
                    new Scenario() { Title="DIAL Receiver Windows Universal Application", ClassType=typeof(Scenario04)}
                };
            }
        }

internal void NavigateToScenario | ( | Type | scenarioType,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 108 of file MainPage.xaml.cs.

        {
            try
            {
                // Clear the status block when navigating scenarios.
                NotifyUser(String.Empty, NotifyType.StatusMessage);

                ListBox scenarioListBox = this.ScenarioControl;

                int selectedIndex = -1;

                this.ScenarioControl.SelectionChanged -= ScenarioControl_SelectionChanged;
                for (int idx = 0; idx < scenarioListBox.Items.Count; idx++)
                {
                    if (((Scenario)scenarioListBox.Items[idx]).ClassType == scenarioType)
                    {
                        selectedIndex = idx;
                        break;
                    }
                }

                if (selectedIndex > -1)
                    scenarioListBox.SelectedIndex = selectedIndex;

                Scenario s = scenarioListBox.SelectedItem as Scenario;

                if (s != null)
                {
                    ScenarioFrame.Navigate(s.ClassType, args);
                    if (Window.Current.Bounds.Width < 640)
                    {
                        Splitter.IsPaneOpen = false;
                        StatusBorder.Visibility = Visibility.Collapsed;
                    }
                    else
                    {
                        Splitter.IsPaneOpen = true;
                        StatusBorder.Visibility = Visibility.Visible;
                    }
                }
                this.ScenarioControl.SelectionChanged += ScenarioControl_SelectionChanged;
            }
            catch(Exception ex)
            {
                Frame rootFrame = Window.Current.Content as Frame;

                Window.Current.Content = new Frame();
                rootFrame.Navigate(typeof(UnhandledExceptionPage), ex.Message);
                ((UnhandledExceptionPage)rootFrame.Content).StatusMessage = ex.Message + ex.StackTrace;
            }
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 171 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file MainPage.xaml.cs.

        {
            ApplicationView.GetForCurrentView().ExitFullScreenMode();
            this.ScenarioControl.SelectionChanged += ScenarioControl_SelectionChanged;

            try
            {
                // Populate the scenario list from the SampleConfiguration.cs file
                ScenarioControl.ItemsSource = Scenarios;

                if (e.Parameter is DialReceiverActivatedEventArgs)
                {
                    NavigateToScenario(typeof(Scenario04), e.Parameter);
                }
                else
                {
                    ScenarioControl.SelectedIndex = 0;
                }

            }
            catch (Exception ex)
            {
                Window.Current.Content = new Frame();
                Frame rootFrame = Window.Current.Content as Frame;
                rootFrame.Navigate(typeof(UnhandledExceptionPage), null);
                ((UnhandledExceptionPage)rootFrame.Content).StatusMessage = ex.Message + ex.StackTrace;
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 83 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = Scenarios[scenarioListBox.SelectedIndex];
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
                else
                {
                    Splitter.IsPaneOpen = true;
                    StatusBorder.Visibility = Visibility.Visible;
                }
            }
        }

Member Data Documentation

MainPage Current [static]

Definition at line 32 of file MainPage.xaml.cs.

const string FEATURE_NAME = "ScreenCasting"

Definition at line 23 of file SampleConfiguration.cs.

ViewLifetimeControl ProjectionViewPageControl

Definition at line 33 of file MainPage.xaml.cs.

List<Scenario> scenarios [private]

Definition at line 24 of file SampleConfiguration.cs.

Property Documentation

List<Scenario> Scenarios [get]

Definition at line 162 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • AdvancedCasting/cs/MainPage.xaml.cs
  • AdvancedCasting/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProjectionViewBroker Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • ProjectionViewBroker
Public Member Functions | Public Attributes | Events

ProjectionViewBroker Class Reference

List of all members.

Public Member Functions

void | NotifyProjectionStopping ()

Public Attributes

CoreDispatcher | MainPageDispatcher
int | MainViewId
ProjectionViewPage ProjectedPage
ViewLifetimeControl ProjectionViewPageControl

Events

EventHandler | ProjectionStopping

Detailed Description

Definition at line 25 of file ProjectionViewBroker.cs.

Member Function Documentation

void NotifyProjectionStopping ( ) [inline]

Definition at line 32 of file ProjectionViewBroker.cs.

        {
            try
            {
                if (ProjectionStopping != null)
                    ProjectionStopping(this, EventArgs.Empty);
            }
            catch { }
        }

Member Data Documentation

CoreDispatcher MainPageDispatcher

Definition at line 27 of file ProjectionViewBroker.cs.

int MainViewId

Definition at line 29 of file ProjectionViewBroker.cs.

ProjectionViewPage ProjectedPage

Definition at line 31 of file ProjectionViewBroker.cs.

ViewLifetimeControl ProjectionViewPageControl

Definition at line 28 of file ProjectionViewBroker.cs.

Event Documentation

EventHandler ProjectionStopping

Definition at line 30 of file ProjectionViewBroker.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Controls/ProjectionViewBroker.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProjectionViewPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • ProjectionViewPage
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

ProjectionViewPage Class Reference

List of all members.

Public Member Functions

ProjectionViewPage ()
async Task< bool > | SetMediaSource (Uri source, TimeSpan position)
async void | StopProjecting ()
async void | SwapViews ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Properties

MediaElement | Player [get]

Private Member Functions

void | Player_MediaOpened (object sender, RoutedEventArgs e)
void | ProjectionViewPage_StopProjectingButtonClick (object sender, EventArgs e)
void | StopProjecting_Click (object sender, RoutedEventArgs e)
void | SwapViews_Click (object sender, RoutedEventArgs e)
async void | thisViewControl_Released (object sender, EventArgs e)

Private Attributes

ProjectionViewBroker | broker = null

Detailed Description

Definition at line 23 of file ProjectionViewPage.xaml.cs.

Constructor & Destructor Documentation

ProjectionViewPage ( ) [inline]

Definition at line 25 of file ProjectionViewPage.xaml.cs.

        {
            this.InitializeComponent();

            ProjectedMediaTransportControls pmtcs = this._player.TransportControls as ProjectedMediaTransportControls;
            if (pmtcs != null)
                pmtcs.StopProjectingButtonClick += ProjectionViewPage_StopProjectingButtonClick;

            this._player.MediaOpened += Player_MediaOpened;
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 66 of file ProjectionViewPage.xaml.cs.

        {
            broker = (ProjectionViewBroker)e.Parameter;
            broker.ProjectedPage = this;

            // Listen for when it's time to close this view
            broker.ProjectionViewPageControl.Released += thisViewControl_Released;
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file ProjectionViewPage.xaml.cs.

        {
            this._player.IsFullWindow = true;
            this._player.AreTransportControlsEnabled = true;
        }

void ProjectionViewPage_StopProjectingButtonClick | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file ProjectionViewPage.xaml.cs.

        {
            this.StopProjecting();
        }

async Task<bool> SetMediaSource | ( | Uri | source,
 |  | TimeSpan | position |
 | ) |  |  | [inline]

Definition at line 49 of file ProjectionViewPage.xaml.cs.

        {
            await this._player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                this._player.Source = source;
                this._player.Position = position;
                this._player.Play();
            });
            return true;
        }

async void StopProjecting ( ) [inline]

Definition at line 109 of file ProjectionViewPage.xaml.cs.

        {
            broker.NotifyProjectionStopping();

            // There may be cases to end the projection from the projected view
            // (e.g. the presentation hosted in that view concludes)
            // broker.ProjectionViewPageControl.StartViewInUse();
            await this._player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                this._player.Stop();
                this._player.Source = null;

                broker.ProjectionViewPageControl.StartViewInUse();

                try
                {
                    await ProjectionManager.StopProjectingAsync(
                        broker.ProjectionViewPageControl.Id,
                        broker.MainViewId
                        );
                }
                catch { }
                Window.Current.Close();

            });

           broker.ProjectionViewPageControl.StopViewInUse();
        }

void StopProjecting_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 137 of file ProjectionViewPage.xaml.cs.

        {
            StopProjecting();
        }

async void SwapViews ( ) [inline]

Definition at line 93 of file ProjectionViewPage.xaml.cs.

        {
            // The view might arrive on the wrong display. The user can
            // easily swap the display on which the view appears
            broker.ProjectionViewPageControl.StartViewInUse();
            await ProjectionManager.SwapDisplaysForViewsAsync(
                ApplicationView.GetForCurrentView().Id,
                broker.MainViewId
            );
            broker.ProjectionViewPageControl.StopViewInUse();
        }

void SwapViews_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file ProjectionViewPage.xaml.cs.

        {
            SwapViews();
        }

async void thisViewControl_Released | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file ProjectionViewPage.xaml.cs.

        {
            // There are two major cases where this event will get invoked:
            // 1. The view goes unused for some time, and the system cleans it up
            // 2. The app calls "StopProjectingAsync"
            broker.ProjectionViewPageControl.Released -= thisViewControl_Released;
            await broker.ProjectionViewPageControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    this.broker.NotifyProjectionStopping();
                    MainPage.Current.ProjectionViewPageControl = null;
                });

            this._player.Stop();
            this._player.Source = null;

            Window.Current.Close();
        }

Member Data Documentation

ProjectionViewBroker broker = null [private]

Definition at line 65 of file ProjectionViewPage.xaml.cs.

Property Documentation

MediaElement Player [get]

Definition at line 61 of file ProjectionViewPage.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/ProjectionViewPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario
Properties

Scenario Class Reference

List of all members.

Properties

Type | ClassType [get, set]
string | Title [get, set]

Detailed Description

Definition at line 50 of file SampleConfiguration.cs.

Property Documentation

Type ClassType [get, set]

Definition at line 53 of file SampleConfiguration.cs.

string Title [get, set]

Definition at line 52 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario01 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario01
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario01 Class Reference

List of all members.

Public Member Functions

Scenario01 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage
VideoMetaData video

Detailed Description

Definition at line 20 of file 01_MediaElement.xaml.cs.

Constructor & Destructor Documentation

Scenario01 ( ) [inline]

Definition at line 24 of file 01_MediaElement.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            // Get a video
            AzureDataProvider dataProvider = new AzureDataProvider();
            video = dataProvider.GetRandomVideo();
            this.player.Source = video.VideoLink;
            this.LicenseText.Text = "License: " + video.License;

            //Set the source on the MediaElement
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);

            // Use the compat version of the transport controls
            this.player.TransportControls.IsCompact = true;
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file 01_MediaElement.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file 01_MediaElement.xaml.cs.

        {
            if (this.player.CurrentState != Windows.UI.Xaml.Media.MediaElementState.Closed)
                rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file 01_MediaElement.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Failed to load '{0}', {1}", video.Title, e.ErrorMessage), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file 01_MediaElement.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 22 of file 01_MediaElement.xaml.cs.

VideoMetaData video [private]

Definition at line 23 of file 01_MediaElement.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/01_MediaElement.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario02 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario02
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario02 Class Reference

List of all members.

Public Member Functions

Scenario02 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Connection_ErrorOccurred (CastingConnection sender, CastingConnectionErrorOccurredEventArgs args)
async void | Connection_StateChanged (CastingConnection sender, object args)
async void | Picker_CastingDevicePickerDismissed (CastingDevicePicker sender, object args)
async void | Picker_CastingDeviceSelected (CastingDevicePicker sender, CastingDeviceSelectedEventArgs args)
void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)
void | TransportControls_CastButtonClicked (object sender, EventArgs e)

Private Attributes

CastingConnection | connection
CastingDevicePicker | picker = null
MainPage rootPage
VideoMetaData | video = null

Detailed Description

Definition at line 28 of file 02_Casting_API_CastButton.xaml.cs.

Constructor & Destructor Documentation

Scenario02 ( ) [inline]

Definition at line 34 of file 02_Casting_API_CastButton.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            // Get an Azure hosted video
            AzureDataProvider dataProvider = new AzureDataProvider();
            video = dataProvider.GetRandomVideo();

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            player.Source = video.VideoLink;
            this.LicenseText.Text = "License: " + video.License;

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            // Instantiate the Device Picker
            picker = new CastingDevicePicker();

            // Generate the filter based on the content in the MediaElement
            picker.Filter.SupportedCastingSources.Add(player.GetAsCastingSource());

            //Hook up device selected event
            picker.CastingDeviceSelected += Picker_CastingDeviceSelected;

            //Hook up device disconnected event
            picker.CastingDevicePickerDismissed += Picker_CastingDevicePickerDismissed;

            //Set the Appearence of the picker
            picker.Appearance.BackgroundColor = Colors.Black;
            picker.Appearance.ForegroundColor = Colors.White;
            picker.Appearance.AccentColor = Colors.Gray;

            picker.Appearance.SelectedAccentColor = Colors.Gray;

            picker.Appearance.SelectedForegroundColor = Colors.White;
            picker.Appearance.SelectedBackgroundColor = Colors.Black;
        }

Member Function Documentation

async void Connection_ErrorOccurred | ( | CastingConnection | sender,
 |  | CastingConnectionErrorOccurredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 169 of file 02_Casting_API_CastButton.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Connection Error Occured: " + args.Message, NotifyType.ErrorMessage);
            });
        }

async void Connection_StateChanged | ( | CastingConnection | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 162 of file 02_Casting_API_CastButton.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Casting Connection State Changed: " + sender.State, NotifyType.StatusMessage);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 196 of file 02_Casting_API_CastButton.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Picker_CastingDevicePickerDismissed | ( | CastingDevicePicker | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 98 of file 02_Casting_API_CastButton.xaml.cs.

        {
            // This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                player.Play();
            });
        }

async void Picker_CastingDeviceSelected | ( | CastingDevicePicker | sender,
 |  | CastingDeviceSelectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 106 of file 02_Casting_API_CastButton.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                    rootPage.NotifyUser(string.Format("Picker DeviceSelected event fired for device '{0}'", args.SelectedCastingDevice.FriendlyName), NotifyType.StatusMessage);

                    //DateTime t1 = DateTime.Now;
                    //DeviceInformation mydevice = await DeviceInformation.CreateFromIdAsync(args.SelectedCastingDevice.Id);
                    //DateTime t2 = DateTime.Now;

                    //TimeSpan ts = new TimeSpan(t2.Ticks - t1.Ticks);

                    //System.Diagnostics.Debug.WriteLine(string.Format("DeviceInformation.CreateFromIdAsync took '{0} seconds'", ts.TotalSeconds));

                    //Create a casting conneciton from our selected casting device
                    rootPage.NotifyUser(string.Format("Creating connection for '{0}'", args.SelectedCastingDevice.FriendlyName), NotifyType.StatusMessage);
                    connection = args.SelectedCastingDevice.CreateCastingConnection();

                    //Hook up the casting events
                    connection.ErrorOccurred += Connection_ErrorOccurred;
                    connection.StateChanged += Connection_StateChanged;

                    // Get the casting source from the MediaElement
                    CastingSource source = null;

                    try
                    {
                        // Get the casting source from the Media Element
                        source = player.GetAsCastingSource();

                        // Start Casting
                        rootPage.NotifyUser(string.Format("Starting casting to '{0}'", args.SelectedCastingDevice.FriendlyName), NotifyType.StatusMessage);
                        CastingConnectionErrorStatus status = await connection.RequestStartCastingAsync(source);

                        if (status == CastingConnectionErrorStatus.Succeeded)
                        {
                            player.Play();
                            rootPage.NotifyUser(string.Format("Starting casting to '{0}'", args.SelectedCastingDevice.FriendlyName), NotifyType.StatusMessage);
                        }

                    }
                    catch
                    {
                        rootPage.NotifyUser(string.Format("Failed to get casting source for video '{0}'", video.Title), NotifyType.ErrorMessage);
                    }
                }
                catch (Exception ex)
                {
                    UnhandledExceptionPage.ShowUnhandledException(ex);
                }
            });
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 181 of file 02_Casting_API_CastButton.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 185 of file 02_Casting_API_CastButton.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 189 of file 02_Casting_API_CastButton.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);
        }

void TransportControls_CastButtonClicked | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file 02_Casting_API_CastButton.xaml.cs.

        {
            rootPage.NotifyUser("Custom Cast Button Clicked", NotifyType.StatusMessage);

            //Pause Current Playback
            player.Pause();

            //Get the custom transport controls
            MediaTransportControlsWithCustomCastButton mtc = (MediaTransportControlsWithCustomCastButton)this.player.TransportControls;

            //Retrieve the location of the casting button
            GeneralTransform transform = mtc.CastButton.TransformToVisual(Window.Current.Content as UIElement);
            Point pt = transform.TransformPoint(new Point(0, 0));

            //Show the picker above our custom cast button
            picker.Show(new Rect(pt.X, pt.Y, mtc.CastButton.ActualWidth, mtc.CastButton.ActualHeight), Windows.UI.Popups.Placement.Above);
        }

Member Data Documentation

CastingConnection connection [private]

Definition at line 33 of file 02_Casting_API_CastButton.xaml.cs.

CastingDevicePicker picker = null [private]

Definition at line 31 of file 02_Casting_API_CastButton.xaml.cs.

MainPage rootPage [private]

Definition at line 30 of file 02_Casting_API_CastButton.xaml.cs.

VideoMetaData video = null [private]

Definition at line 32 of file 02_Casting_API_CastButton.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/02_Casting_API_CastButton.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario03 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario03
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario03 Class Reference

List of all members.

Public Member Functions

Scenario03 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Picker_DevicePickerDismissed (DialDevicePicker sender, object args)
async void | Picker_DeviceSelected (DialDevicePicker sender, DialDeviceSelectedEventArgs args)
async void | Picker_DisconnectButtonClicked (DialDevicePicker sender, DialDisconnectButtonClickedEventArgs args)
void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)
void | TransportControls_CastButtonClicked (object sender, EventArgs e)

Private Attributes

DeviceInformation | activeDeviceInformation = null
DialDevice | activeDialDevice = null
DialDevicePicker | picker = null
MainPage rootPage
VideoMetaData | video = null

Detailed Description

Definition at line 26 of file 03_DIAL_Sender_API.xaml.cs.

Constructor & Destructor Documentation

Scenario03 ( ) [inline]

Definition at line 35 of file 03_DIAL_Sender_API.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            // Get an Azure hosted video
            AzureDataProvider dataProvider = new AzureDataProvider();
            video = dataProvider.GetRandomVideo();

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            this.player.Source = video.VideoLink;

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            //Configure the DIAL launch arguments for the current video
            this.dial_launch_args_textbox.Text = string.Format("v={0}&t=0&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id);

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            // Instantiate the Device Picker
            picker = new DialDevicePicker();

            //Add the DIAL Filter, so that the application only shows DIAL devices that have
            // the application installed or advertise that they can install them.
            picker.Filter.SupportedAppNames.Add(this.dial_appname_textbox.Text);

            //Hook up device selected event
            picker.DialDeviceSelected += Picker_DeviceSelected;

            //Hook up the picker disconnected event
            picker.DisconnectButtonClicked += Picker_DisconnectButtonClicked;

            //Hook up the picker dismissed event
            picker.DialDevicePickerDismissed += Picker_DevicePickerDismissed;
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 269 of file 03_DIAL_Sender_API.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Picker_DevicePickerDismissed | ( | DialDevicePicker | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 108 of file 03_DIAL_Sender_API.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    rootPage.NotifyUser(string.Format("Picker DevicePickerDismissed event fired for device"), NotifyType.StatusMessage);

                    if (activeDialDevice != null)
                    {
                        // Resume video playback
                        this.player.Play();
                    }
                }
                catch (Exception ex)
                {
                    UnhandledExceptionPage.ShowUnhandledException(ex);
                }
            });
        }

async void Picker_DeviceSelected | ( | DialDevicePicker | sender,
 |  | DialDeviceSelectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 187 of file 03_DIAL_Sender_API.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try {
                    rootPage.NotifyUser(string.Format("Picker DeviceSelected event fired"), NotifyType.StatusMessage);

                    // Set the status to connecting
                    picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Connecting);

                    rootPage.NotifyUser(string.Format("Resolving DialDevice'"), NotifyType.StatusMessage);

                    //Get the DialApp object for the specific application on the selected device
                    DialApp app = args.SelectedDialDevice.GetDialApp(this.dial_appname_textbox.Text);

                    if (app == null)
                    {
                        //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
                        //rootPage.NotifyUser(string.Format("'{0}' cannot find app with ID '{1}'", selectedDeviceInformation.Name, this.dial_appname_textbox.Text), NotifyType.StatusMessage);
                        picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Error);
                    }
                    else
                    {
                        rootPage.NotifyUser(string.Format("Attempting to launch '{0}'", app.AppName), NotifyType.StatusMessage);
                        //Launch the application on the 1st screen device
                        DialAppLaunchResult result = await app.RequestLaunchAsync(this.dial_launch_args_textbox.Text);

                        //Verify to see whether the application was launched
                        if (result == DialAppLaunchResult.Launched)
                        {
                            rootPage.NotifyUser(string.Format("Launched '{0}'", app.AppName), NotifyType.StatusMessage);
                            activeDialDevice = args.SelectedDialDevice;
                            DeviceInformation selectedDeviceInformation = await DeviceInformation.CreateFromIdAsync(args.SelectedDialDevice.Id);

                            activeDeviceInformation = selectedDeviceInformation;

                            //This is where you will need to add you application specific communication between your 1st and 2nd screen applications
                            //...
                            //...
                            //...

                            picker.SetDisplayStatus(activeDialDevice, DialDeviceDisplayStatus.Connected);
                            picker.Hide();
                        }
                        else
                        {
                            rootPage.NotifyUser(string.Format("Attempting to launch '{0}'", app.AppName), NotifyType.StatusMessage);
                            picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Error);
                        }
                    }
                }
                catch (Exception ex)
                {
                    UnhandledExceptionPage.ShowUnhandledException(ex);
                }
            });
        }

async void Picker_DisconnectButtonClicked | ( | DialDevicePicker | sender,
 |  | DialDisconnectButtonClickedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 130 of file 03_DIAL_Sender_API.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                    rootPage.NotifyUser(string.Format("Picker DisconnectButtonClicked event fired for device '{0}'", activeDeviceInformation.Name), NotifyType.StatusMessage);

                    // Get the DialDevice instance for the selected device
                    DialDevice selectedDialDevice = await DialDevice.FromIdAsync(args.Device.Id);
                    // Update the picker status
                    picker.SetDisplayStatus(selectedDialDevice, DialDeviceDisplayStatus.Connecting);

                    DialApp app = selectedDialDevice.GetDialApp(this.dial_appname_textbox.Text);

                    //Get the current application state
                    //DialAppStateDetails stateDetails = await app.GetAppStateAsync();

                    DialAppStopResult result = await app.StopAsync();

                    if (result == DialAppStopResult.Stopped)
                    {
                        // In case getting the application state failed because of a network failure, you could add retry logic
                        rootPage.NotifyUser("Application stopped successfully.", NotifyType.StatusMessage);
                        picker.SetDisplayStatus(args.Device, DialDeviceDisplayStatus.Disconnected);
                        activeDialDevice = null;
                        activeDeviceInformation = null;
                        picker.Hide();
                    }
                    else
                    {
                        if (result == DialAppStopResult.StopFailed || result == DialAppStopResult.NetworkFailure)
                        {
                            // In case getting the application state failed because of a network failure, you could add retry logic
                            rootPage.NotifyUser(string.Format("Error occured trying to stop application. Status: '{0}'", result.ToString()), NotifyType.StatusMessage);
                            picker.SetDisplayStatus(args.Device, DialDeviceDisplayStatus.Error);
                        }
                        else //in case of DialAppStopResult.OperationNotSupported, there is not much more you can do. You could implement your own
                             // mechanism to stop the application on that device.
                        {
                            // In case getting the application state failed because of a network failure, you could add retry logic
                            rootPage.NotifyUser(string.Format("Stop is not supported by device: '{0}'", activeDeviceInformation.Name), NotifyType.ErrorMessage);
                            activeDialDevice = null;
                            activeDeviceInformation = null;

                        }
                    }
                }
                catch (Exception ex)
                {
                    UnhandledExceptionPage.ShowUnhandledException(ex);
                }

            });
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 249 of file 03_DIAL_Sender_API.xaml.cs.

        {
            // Update status
            rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 254 of file 03_DIAL_Sender_API.xaml.cs.

        {
            // Update status
            rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 259 of file 03_DIAL_Sender_API.xaml.cs.

        {
            // Update status
            rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);
            // Start playback
            player.Play();
        }

void TransportControls_CastButtonClicked | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file 03_DIAL_Sender_API.xaml.cs.

        {
            rootPage.NotifyUser("Show Device Picker Button Clicked", NotifyType.StatusMessage);

            //Pause Current Playback
            player.Pause();

            //Get the custom transport controls
            MediaTransportControlsWithCustomCastButton mtc = (MediaTransportControlsWithCustomCastButton)this.player.TransportControls;
            //Retrieve the location of the casting button
            GeneralTransform transform = mtc.CastButton.TransformToVisual(Window.Current.Content as UIElement);
            Point pt = transform.TransformPoint(new Point(0, 0));

            //Show the picker above our Show Device Picker button
            picker.Show(new Rect(pt.X, pt.Y, mtc.CastButton.ActualWidth, mtc.CastButton.ActualHeight), Windows.UI.Popups.Placement.Above);

            try
            {
                if (activeDialDevice != null)
                    picker.SetDisplayStatus(activeDialDevice, DialDeviceDisplayStatus.Connected);
            }
            catch (Exception ex)
            {
                UnhandledExceptionPage.ShowUnhandledException(ex);
            }
        }

Member Data Documentation

DeviceInformation activeDeviceInformation = null [private]

Definition at line 32 of file 03_DIAL_Sender_API.xaml.cs.

DialDevice activeDialDevice = null [private]

Definition at line 31 of file 03_DIAL_Sender_API.xaml.cs.

DialDevicePicker picker = null [private]

Definition at line 29 of file 03_DIAL_Sender_API.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file 03_DIAL_Sender_API.xaml.cs.

VideoMetaData video = null [private]

Definition at line 30 of file 03_DIAL_Sender_API.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/03_DIAL_Sender_API.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario04 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario04
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario04 Class Reference

List of all members.

Public Member Functions

Scenario04 ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaEnded (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)
void | RootPage_SizeChanged (object sender, SizeChangedEventArgs e)

Private Attributes

TimeSpan | originalPosition = new TimeSpan(0)
MainPage rootPage
VideoMetaData | video = null

Detailed Description

Definition at line 24 of file 04_DIAL_Receiver_App.xaml.cs.

Constructor & Destructor Documentation

Scenario04 ( ) [inline]

Definition at line 29 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;
            rootPage.SizeChanged += RootPage_SizeChanged;
        }

Member Function Documentation

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;
            player.MediaEnded += Player_MediaEnded;

            if (e.Parameter is DialReceiverActivatedEventArgs)
            {
                DialReceiverActivatedEventArgs activationArgs = (DialReceiverActivatedEventArgs)e.Parameter;

                //Parse the DIAL arguments from the activation arguments
                DialLaunchArguments dialArgs = DialLaunchArguments.Parse(activationArgs.Arguments);

                // Get the list of available Azure videos.
                AzureDataProvider dataProvider = new AzureDataProvider();
                // Get the vide that is playing
                video = dataProvider.GetFromID(dialArgs.VideoId);
                //Set the source on the player
                rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
                this.player.Source = video.VideoLink;
                this.LicenseText.Text = "License: " + video.License;

                player.Position = dialArgs.Position;
            }
            else
            {
                StorageFile localVideo = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/casting.mp4"));
                var stream = await localVideo.OpenAsync(FileAccessMode.Read);
                this.player.SetSource(stream, localVideo.FileType);
            }
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 89 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            if (video == null)
                rootPage.NotifyUser(string.Format("{0}", this.player.CurrentState), NotifyType.StatusMessage);
            else
                rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaEnded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            if (video == null)
            {
                this.player.Position = new TimeSpan(0);
                this.player.Play();
            }
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 97 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            if (video == null)
                rootPage.NotifyUser(string.Format("Failed to load"), NotifyType.ErrorMessage);
            else
                rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            if (video == null)
                rootPage.NotifyUser(string.Format("Openend"), NotifyType.StatusMessage);
            else
                rootPage.NotifyUser(string.Format("Openend '{0}'", "Title"), NotifyType.StatusMessage);

            player.Play();
        }

void RootPage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file 04_DIAL_Receiver_App.xaml.cs.

        {
            this.player.Height = this.Height;
            this.player.Width = this.Width;
        }

Member Data Documentation

TimeSpan originalPosition = new TimeSpan(0) [private]

Definition at line 28 of file 04_DIAL_Receiver_App.xaml.cs.

MainPage rootPage [private]

Definition at line 26 of file 04_DIAL_Receiver_App.xaml.cs.

VideoMetaData video = null [private]

Definition at line 27 of file 04_DIAL_Receiver_App.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/04_DIAL_Receiver_App.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario05 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario05
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario05 Class Reference

List of all members.

Public Member Functions

Scenario05 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Picker_DevicePickerDismissed (DevicePicker sender, object args)
async void | Picker_DeviceSelected (DevicePicker sender, DeviceSelectedEventArgs args)
async void | Picker_DisconnectButtonClicked (DevicePicker sender, DeviceDisconnectButtonClickedEventArgs args)
void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)
async void | Pvb_ProjectionStopping (object sender, EventArgs e)
void | TransportControls_CastButtonClicked (object sender, EventArgs e)

Private Attributes

DeviceInformation | activeDevice = null
DevicePicker | picker
ProjectionViewBroker | pvb = new ProjectionViewBroker()
MainPage rootPage
int | thisViewId
VideoMetaData | video = null

Detailed Description

Definition at line 30 of file 05_Multi_View_Media_Application.xaml.cs.

Constructor & Destructor Documentation

Scenario05 ( ) [inline]

Definition at line 40 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            // Get an Azure hosted video
            AzureDataProvider dataProvider = new AzureDataProvider();
            video = dataProvider.GetRandomVideo();

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            this.player.Source = video.VideoLink;
            this.LicenseText.Text = "License: " + video.License;

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            // Instantiate the Device Picker
            picker = new DevicePicker ();

            // Get the device selecter for Miracast devices
            picker.Filter.SupportedDeviceSelectors.Add(ProjectionManager.GetDeviceSelector());

            //Hook up device selected event
            picker.DeviceSelected += Picker_DeviceSelected;

            //Hook up device disconnected event
            picker.DisconnectButtonClicked += Picker_DisconnectButtonClicked;

            //Hook up picker dismissed event
            picker.DevicePickerDismissed += Picker_DevicePickerDismissed;

            // Hook up the events that are received when projection is stoppped
            pvb.ProjectionStopping += Pvb_ProjectionStopping;
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 264 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Picker_DevicePickerDismissed | ( | DevicePicker | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 189 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (activeDevice == null)
                {
                    player.Play();
                }
            });
        }

async void Picker_DeviceSelected | ( | DevicePicker | sender,
 |  | DeviceSelectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 99 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                // Set status to Connecting
                picker.SetDisplayStatus(args.SelectedDevice, "Connecting", DevicePickerDisplayStatusOptions.ShowProgress);

                // Getting the selected device improves debugging
                DeviceInformation selectedDevice = args.SelectedDevice;

                thisViewId = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Id;

                // If projection is already in progress, then it could be shown on the monitor again
                // Otherwise, we need to create a new view to show the presentation
                if (rootPage.ProjectionViewPageControl == null)
                {
                    // First, create a new, blank view
                    var thisDispatcher = Window.Current.Dispatcher;
                    await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        // ViewLifetimeControl is a wrapper to make sure the view is closed only
                        // when the app is done with it
                        rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                        // Assemble some data necessary for the new page
                        pvb.MainPageDispatcher = thisDispatcher;
                        pvb.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                        pvb.MainViewId = thisViewId;

                        // Display the page in the view. Note that the view will not become visible
                        // until "StartProjectingAsync" is called
                        var rootFrame = new Frame();
                        rootFrame.Navigate(typeof(ProjectionViewPage), pvb);
                        Window.Current.Content = rootFrame;

                        Window.Current.Activate();
                    });
                }

                try
                {
                    // Start/StopViewInUse are used to signal that the app is interacting with the
                    // view, so it shouldn't be closed yet, even if the user loses access to it
                    rootPage.ProjectionViewPageControl.StartViewInUse();

                    try
                    {
                        await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId, selectedDevice);

                    }
                    catch (Exception ex)
                    {
                        if (!ProjectionManager.ProjectionDisplayAvailable || pvb.ProjectedPage == null)
                            throw ex;
                    }

                    // ProjectionManager currently can throw an exception even when projection has started.\
                    // Re-throw the exception when projection has not been started after calling StartProjectingAsync
                    if (ProjectionManager.ProjectionDisplayAvailable && pvb.ProjectedPage != null)
                    {
                        this.player.Pause();
                        await pvb.ProjectedPage.SetMediaSource(this.player.Source, this.player.Position);
                        activeDevice = selectedDevice;
                        // Set status to Connected
                        picker.SetDisplayStatus(args.SelectedDevice, "Connected", DevicePickerDisplayStatusOptions.ShowDisconnectButton);
                        picker.Hide();
                    }
                    else
                    {
                        rootPage.NotifyUser(string.Format("Projection has failed to '{0}'", selectedDevice.Name), NotifyType.ErrorMessage);
                        // Set status to Failed
                        picker.SetDisplayStatus(args.SelectedDevice, "Connection Failed", DevicePickerDisplayStatusOptions.ShowRetryButton);
                    }
                }
                catch (Exception)
                {
                    rootPage.NotifyUser(string.Format("Projection has failed to '{0}'", selectedDevice.Name), NotifyType.ErrorMessage);
                    // Set status to Failed
                    try { picker.SetDisplayStatus(args.SelectedDevice, "Connection Failed", DevicePickerDisplayStatusOptions.ShowRetryButton); } catch { }
                }
                }
                catch (Exception ex)
                {
                    UnhandledExceptionPage.ShowUnhandledException(ex);
                }
            });
        }

async void Picker_DisconnectButtonClicked | ( | DevicePicker | sender,
 |  | DeviceDisconnectButtonClickedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 200 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Disconnect Button clicked", NotifyType.StatusMessage);
                //Update the display status for the selected device.
                sender.SetDisplayStatus(args.Device, "Disconnecting", DevicePickerDisplayStatusOptions.ShowProgress);

                if (this.pvb.ProjectedPage != null)
                    this.pvb.ProjectedPage.StopProjecting();

                //Update the display status for the selected device.
                sender.SetDisplayStatus(args.Device, "Disconnected", DevicePickerDisplayStatusOptions.None);
                rootPage.NotifyUser("Disconnected", NotifyType.StatusMessage);

                // Set the active device variables to null
                activeDevice = null;
            });
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 246 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            // Update status
            rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 251 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 255 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);

            player.Play();
        }

async void Pvb_ProjectionStopping | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 221 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            ProjectionViewBroker broker = sender as ProjectionViewBroker;

            TimeSpan position;
            Uri source = null;

            await broker.ProjectedPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                position = broker.ProjectedPage.Player.Position;
                source = broker.ProjectedPage.Player.Source;
            });

            await rootPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Resuming playback on the first screen", NotifyType.StatusMessage);
                this.player.Source = source;

                this.player.Position = position;
                this.player.Play();
                rootPage.ProjectionViewPageControl = null;
            });
        }

void TransportControls_CastButtonClicked | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file 05_Multi_View_Media_Application.xaml.cs.

        {
            rootPage.NotifyUser("Custom Cast Button Clicked", NotifyType.StatusMessage);

            //Pause Current Playback
            player.Pause();

            //Get the custom transport controls
            MediaTransportControlsWithCustomCastButton mtc = (MediaTransportControlsWithCustomCastButton)this.player.TransportControls;

            //Retrieve the location of the casting button
            GeneralTransform transform = mtc.CastButton.TransformToVisual(Window.Current.Content as UIElement);
            Point pt = transform.TransformPoint(new Point(0, 0));

            //Show the picker above our custom cast button
            picker.Show(new Rect(pt.X, pt.Y, mtc.CastButton.ActualWidth, mtc.CastButton.ActualHeight), Windows.UI.Popups.Placement.Above);
        }

Member Data Documentation

DeviceInformation activeDevice = null [private]

Definition at line 36 of file 05_Multi_View_Media_Application.xaml.cs.

DevicePicker picker [private]

Definition at line 33 of file 05_Multi_View_Media_Application.xaml.cs.

ProjectionViewBroker pvb = new ProjectionViewBroker() [private]

Definition at line 35 of file 05_Multi_View_Media_Application.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file 05_Multi_View_Media_Application.xaml.cs.

int thisViewId [private]

Definition at line 38 of file 05_Multi_View_Media_Application.xaml.cs.

VideoMetaData video = null [private]

Definition at line 34 of file 05_Multi_View_Media_Application.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/05_Multi_View_Media_Application.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario06 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Scenario06
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario06 Class Reference

List of all members.

Public Member Functions

Scenario06 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Connection_ErrorOccurred (CastingConnection sender, CastingConnectionErrorOccurredEventArgs args)
async void | Connection_StateChanged (CastingConnection sender, object args)
async void | Picker_DevicePickerDismissed (DevicePicker sender, object args)
async void | Picker_DeviceSelected (DevicePicker sender, DeviceSelectedEventArgs args)
async void | Picker_DisconnectButtonClicked (DevicePicker sender, DeviceDisconnectButtonClickedEventArgs args)
void | Player_CurrentStateChanged (object sender, RoutedEventArgs e)
void | Player_MediaFailed (object sender, ExceptionRoutedEventArgs e)
void | Player_MediaOpened (object sender, RoutedEventArgs e)
async void | Pvb_ProjectionStopping (object sender, EventArgs e)
void | TransportControls_CastButtonClicked (object sender, EventArgs e)
async Task< bool > | TryCastMediaElementAsync (DeviceInformation device)
async Task< bool > | TryDisconnectCastingSessionAsync (CastingConnection connection)
async Task< bool > | TryLaunchDialAppAsync (DeviceInformation device)
async Task< bool > | TryProjectionManagerCastAsync (DeviceInformation device)
async Task< bool > | TryStopDialAppAsync (DialApp app)
bool | TryStopProjectionManagerAsync (ProjectionViewBroker broker)

Private Attributes

object | activeCastConnectionHandler = null
DeviceInformation | activeDevice = null
const int | MAX_RESULTS = 10
DevicePicker | picker = null
ProjectionViewBroker | pvb = new ProjectionViewBroker()
MainPage rootPage
int | thisViewId
VideoMetaData | video = null

Detailed Description

Definition at line 33 of file 06_Combine_Casting_Tech.xaml.cs.

Constructor & Destructor Documentation

Scenario06 ( ) [inline]

Definition at line 44 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            //Subscribe to player events
            player.MediaOpened += Player_MediaOpened;
            player.MediaFailed += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            // Get an Azure hosted video
            AzureDataProvider dataProvider = new AzureDataProvider();
            video = dataProvider.GetRandomVideo();

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            this.player.Source = video.VideoLink;
            this.LicenseText.Text = "License: " + video.License;

            //Configure the DIAL launch arguments for the current video
            this.dial_launch_args_textbox.Text = string.Format("v={0}&t=0&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id);

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            // Instantiate the Device Picker
            picker = new DevicePicker();

            //Hook up device selected event
            picker.DeviceSelected += Picker_DeviceSelected;

            //Hook up device disconnected event
            picker.DisconnectButtonClicked += Picker_DisconnectButtonClicked;

            //Hook up device disconnected event
            picker.DevicePickerDismissed += Picker_DevicePickerDismissed;

            //Add the DIAL Filter, so that the application only shows DIAL devices that have the application installed or advertise that they can install them.
            //BUG: picker.Filter.SupportedDeviceSelectors.Add(DialDevice.GetDeviceSelector(this.dial_appname_textbox.Text));
            picker.Filter.SupportedDeviceSelectors.Add("System.Devices.DevObjectType:=6 AND System.Devices.AepContainer.ProtocolIds:~~{0E261DE4-12F0-46E6-91BA-428607CCEF64} AND System.Devices.AepContainer.Categories:~~Multimedia.ApplicationLauncher.DIAL");

            //Add the CAST API Filter, so that the application only shows Miracast, Bluetooth, DLNA devices that can render the video
            // BUG: picker.Filter.SupportedDeviceSelectors.Add(await CastingDevice.GetDeviceSelectorFromCastingSourceAsync(player.GetAsCastingSource()));
            // BUG: picker.Filter.SupportedDeviceSelectors.Add(CastingDevice.GetDeviceSelector(CastingPlaybackTypes.Video));
            picker.Filter.SupportedDeviceSelectors.Add("System.Devices.InterfaceClassGuid:=\"{D0875FB4-2196-4c7a-A63D-E416ADDD60A1}\"" + " AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True");

            //Add projection manager filter
            picker.Filter.SupportedDeviceSelectors.Add(ProjectionManager.GetDeviceSelector());

            pvb.ProjectionStopping += Pvb_ProjectionStopping;
        }

Member Function Documentation

async void Connection_ErrorOccurred | ( | CastingConnection | sender,
 |  | CastingConnectionErrorOccurredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 406 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Casting Error Occured: " + args.Message, NotifyType.ErrorMessage);
                activeDevice = null;
                activeCastConnectionHandler = null;
            });
        }

async void Connection_StateChanged | ( | CastingConnection | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 399 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Casting Connection State Changed: " + sender.State, NotifyType.StatusMessage);
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 575 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Picker_DevicePickerDismissed | ( | DevicePicker | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 164 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (activeDevice == null)
                {
                    player.Play();
                }
            });
        }

async void Picker_DeviceSelected | ( | DevicePicker | sender,
 |  | DeviceSelectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 117 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            string deviceId = args.SelectedDevice.Id;

            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                //Update the display status for the selected device to connecting.
                try { picker.SetDisplayStatus(args.SelectedDevice, "Connecting", DevicePickerDisplayStatusOptions.ShowProgress); } catch { }

                //The selectedDeviceInfo instance is needed to be able to update the picker.
                DeviceInformation selectedDeviceInfo = args.SelectedDevice;
#if DEBUG
                // The args.SelectedCastingDevice is proxied from the picker process. The picker process is
                // dismissmed as soon as you break into the debugger. Creating a non-proxied version
                // allows debugging since the proxied version stops working once the picker is dismissed.
                selectedDeviceInfo = await DeviceInformation.CreateFromIdAsync(args.SelectedDevice.Id);
#endif

                bool castSucceeded = false;

                // If the ProjectionManager API did not work and the device id will have 'dial' in it.
                castSucceeded = await TryLaunchDialAppAsync(selectedDeviceInfo);

                // If it doesn't try the ProjectionManager API.
                if (!castSucceeded)
                    castSucceeded = await TryProjectionManagerCastAsync(selectedDeviceInfo);

                //If DIAL and ProjectionManager did not work for the selected device, try the CAST API
                if (!castSucceeded)
                    castSucceeded = await TryCastMediaElementAsync(selectedDeviceInfo);

                if (castSucceeded)
                {
                    //Update the display status for the selected device.  Try Catch in case the picker is not visible anymore.
                    try { picker.SetDisplayStatus(selectedDeviceInfo, "Connected", DevicePickerDisplayStatusOptions.ShowDisconnectButton); } catch { }

                    // Hide the picker now that all the work is completed. Try Catch in case the picker is not visible anymore.
                    try { picker.Hide(); } catch { }
                }
                else
                {
                    //Show a retry button when connecting to the selected device failed.
                    try { picker.SetDisplayStatus(selectedDeviceInfo, "Connecting failed", DevicePickerDisplayStatusOptions.ShowRetryButton); } catch { }
                }
            });
        }

async void Picker_DisconnectButtonClicked | ( | DevicePicker | sender,
 |  | DeviceDisconnectButtonClickedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 175 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                rootPage.NotifyUser("Disconnect Button clicked", NotifyType.StatusMessage);

                //Update the display status for the selected device.
                sender.SetDisplayStatus(args.Device, "Disconnecting", DevicePickerDisplayStatusOptions.ShowProgress);

                bool disconnected = false;
                if (this.activeCastConnectionHandler is ProjectionViewBroker)
                    disconnected = TryStopProjectionManagerAsync((ProjectionViewBroker)activeCastConnectionHandler);
                if (this.activeCastConnectionHandler is DialApp)
                    disconnected = await TryStopDialAppAsync((DialApp)activeCastConnectionHandler);
                if (this.activeCastConnectionHandler is CastingConnection)
                    disconnected = await TryDisconnectCastingSessionAsync((CastingConnection)activeCastConnectionHandler);

                if (disconnected)
                {
                    //Update the display status for the selected device.
                    try { sender.SetDisplayStatus(args.Device, "Disconnected", DevicePickerDisplayStatusOptions.None); } catch { }
                    // Set the active device variables to null
                    activeDevice = null;
                    activeCastConnectionHandler = null;

                    //Hide the picker
                    sender.Hide();
                }
                else
                {
                    //Update the display status for the selected device.
                    sender.SetDisplayStatus(args.Device, "Disconnect failed", DevicePickerDisplayStatusOptions.ShowDisconnectButton);
                }
            });
        }

void Player_CurrentStateChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 558 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            // Update status
            rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
        }

void Player_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 563 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
        }

void Player_MediaOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 567 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);

            player.Play();
        }

async void Pvb_ProjectionStopping | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 296 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            ProjectionViewBroker broker = sender as ProjectionViewBroker;

            TimeSpan position;
            Uri source = null;

            await broker.ProjectedPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                position = broker.ProjectedPage.Player.Position;
                source = broker.ProjectedPage.Player.Source;
            });

            await rootPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Resuming playback on the first screen", NotifyType.StatusMessage);
                this.player.Source = source;
                this.player.Position = position;
                this.player.Play();
                rootPage.ProjectionViewPageControl = null;
            });
        }

void TransportControls_CastButtonClicked | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            //Pause Current Playback
            player.Pause();

            rootPage.NotifyUser("Show Device Picker Button Clicked", NotifyType.StatusMessage);

            //Get the custom transport controls
            MediaTransportControlsWithCustomCastButton mtc = (MediaTransportControlsWithCustomCastButton)this.player.TransportControls;
            //Retrieve the location of the casting button
            GeneralTransform transform = mtc.CastButton.TransformToVisual(Window.Current.Content as UIElement);
            Point pt = transform.TransformPoint(new Point(0, 0));

            //Show the picker above our Show Device Picker button
            picker.Show(new Rect(pt.X, pt.Y, mtc.CastButton.ActualWidth, mtc.CastButton.ActualHeight), Windows.UI.Popups.Placement.Above);
        }

async Task<bool> TryCastMediaElementAsync ( DeviceInformation device ) [inline, private]

Definition at line 323 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            bool castMediaElementSucceeded = false;

            //Verify whether the selected device supports DLNA, Bluetooth, or Miracast.
            rootPage.NotifyUser(string.Format("Checking to see if device {0} supports Miracast, Bluetooth, or DLNA", device.Name), NotifyType.StatusMessage);

            CastingConnection connection = null;

            //Check to see whether we are casting to the same device
            if (activeDevice != null && device.Id == activeDevice.Id)
                connection = activeCastConnectionHandler as CastingConnection;
            else // if not casting to the same device reset the active device related variables.
            {
                activeDevice = null;
                activeCastConnectionHandler = null;
            }

            // If we can re-use the existing connection
            if (connection == null || connection.State == CastingConnectionState.Disconnected || connection.State == CastingConnectionState.Disconnecting)
            {
                CastingDevice castDevice = null;
                activeDevice = null;

                //Try to create a CastingDevice instannce. If it doesn't succeed, the selected device does not support playback of the video source.
                rootPage.NotifyUser(string.Format("Attempting to resolve casting device for '{0}'", device.Name), NotifyType.StatusMessage);
                try { castDevice = await CastingDevice.FromIdAsync(device.Id); } catch { }

                if (castDevice == null)
                {
                    //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
                    rootPage.NotifyUser(string.Format("'{0}' does not support playback of this media", device.Name), NotifyType.StatusMessage);
                }
                else
                {
                    //Create a casting conneciton from our selected casting device
                    rootPage.NotifyUser(string.Format("Creating connection for '{0}'", device.Name), NotifyType.StatusMessage);
                    connection = castDevice.CreateCastingConnection();

                    //Hook up the casting events
                    connection.ErrorOccurred += Connection_ErrorOccurred;
                    connection.StateChanged += Connection_StateChanged;
                }

                //Cast the content loaded in the media element to the selected casting device
                rootPage.NotifyUser(string.Format("Casting to '{0}'", device.Name), NotifyType.StatusMessage);

                CastingSource source = null;
                // Get the casting source
                try { source = player.GetAsCastingSource(); } catch { }

                if (source == null)
                {
                    rootPage.NotifyUser(string.Format("Failed to get casting source for video '{0}'", video.Title), NotifyType.ErrorMessage);
                }
                else
                {
                    CastingConnectionErrorStatus status = await connection.RequestStartCastingAsync(source);

                    if (status == CastingConnectionErrorStatus.Succeeded)
                    {
                        //Remember the device to which casting succeeded
                        activeDevice = device;
                        //Remember the current active connection.
                        activeCastConnectionHandler = connection;
                        castMediaElementSucceeded = true;
                        player.Play();
                    }
                    else
                    {
                        rootPage.NotifyUser(string.Format("Failed to cast to '{0}'", device.Name), NotifyType.ErrorMessage);
                    }
                }
            }
            return castMediaElementSucceeded;
        }

async Task<bool> TryDisconnectCastingSessionAsync ( CastingConnection connection ) [inline, private]

Definition at line 415 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            bool disconnected = false;

            //Disconnect the casting session
            CastingConnectionErrorStatus status = await connection.DisconnectAsync();

            if (status == CastingConnectionErrorStatus.Succeeded)
            {
                rootPage.NotifyUser("Connection disconnected successfully.", NotifyType.StatusMessage);
                disconnected = true;
            }
            else
            {
                rootPage.NotifyUser(string.Format("Failed to disconnect connection with reason {0}.", status.ToString()), NotifyType.ErrorMessage);
            }

            return disconnected;
        }

async Task<bool> TryLaunchDialAppAsync ( DeviceInformation device ) [inline, private]

Definition at line 438 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            bool dialAppLaunchSucceeded = false;

            //Update the launch arguments to include the Position
            this.dial_launch_args_textbox.Text = string.Format("v={0}&t={1}&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id, player.Position.Ticks);

            //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
            rootPage.NotifyUser(string.Format("Checking to see if device {0} supports DIAL", device.Name), NotifyType.StatusMessage);

            DialDevice dialDevice = null;

            //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
            rootPage.NotifyUser(string.Format("Attempting to resolve DIAL device for '{0}'", device.Name), NotifyType.StatusMessage);

            string[] newIds = (string[])device.Properties["{0BBA1EDE-7566-4F47-90EC-25FC567CED2A} 2"];

            if (newIds.Length > 0)
            {
                string deviceId = newIds[0];
                try { dialDevice = await DialDevice.FromIdAsync(deviceId); } catch { }
            }

            if (dialDevice == null)
            {
                //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
                rootPage.NotifyUser(string.Format("'{0}' does not support DIAL", device.Name), NotifyType.StatusMessage);
            }
            else
            {
                //Get the DialApp object for the specific application on the selected device
                DialApp app = dialDevice.GetDialApp(this.dial_appname_textbox.Text);

                if (app == null)
                {
                    //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
                    rootPage.NotifyUser(string.Format("'{0}' cannot find app with ID '{1}'", device.Name, this.dial_appname_textbox.Text), NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser(string.Format("Attempting to launch '{0}'", app.AppName), NotifyType.StatusMessage);
                    //Launch the application on the 1st screen device
                    DialAppLaunchResult result = await app.RequestLaunchAsync(this.dial_launch_args_textbox.Text);

                    //Verify to see whether the application was launched
                    if (result == DialAppLaunchResult.Launched)
                    {
                        //Remember the device to which casting succeeded
                        activeDevice = device;
                        //DIAL is sessionsless but the DIAL app allows us to get the state and "disconnect".
                        //Disconnect in the case of DIAL is equivalenet to stopping the app.
                        activeCastConnectionHandler = app;
                        rootPage.NotifyUser(string.Format("Launched '{0}'", app.AppName), NotifyType.StatusMessage);
                        //This is where you will need to add you application specific communication between your 1st and 2nd screen applications
                        //...

                        dialAppLaunchSucceeded = true;
                    }
                }
            }

            return dialAppLaunchSucceeded;
        }

async Task<bool> TryProjectionManagerCastAsync ( DeviceInformation device ) [inline, private]

Definition at line 215 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            bool projectionManagerCastAsyncSucceeded = false;

            if ((activeDevice ==null && ProjectionManager.ProjectionDisplayAvailable && device == null) || device != null)
            {
                thisViewId = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Id;

                // If projection is already in progress, then it could be shown on the monitor again
                // Otherwise, we need to create a new view to show the presentation
                if (rootPage.ProjectionViewPageControl == null)
                {
                    // First, create a new, blank view
                    var thisDispatcher = Window.Current.Dispatcher;
                    await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        // ViewLifetimeControl is a wrapper to make sure the view is closed only
                        // when the app is done with it
                        rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                        // Assemble some data necessary for the new page
                        pvb.MainPageDispatcher = thisDispatcher;
                        pvb.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                        pvb.MainViewId = thisViewId;

                        // Display the page in the view. Note that the view will not become visible
                        // until "StartProjectingAsync" is called
                        var rootFrame = new Frame();
                        rootFrame.Navigate(typeof(ProjectionViewPage), pvb);
                        Window.Current.Content = rootFrame;
                        Window.Current.Activate();
                    });
                }

                try
                {
                    // Start/StopViewInUse are used to signal that the app is interacting with the
                    // view, so it shouldn't be closed yet, even if the user loses access to it
                    rootPage.ProjectionViewPageControl.StartViewInUse();

                    try
                    {
                        rootPage.NotifyUser(string.Format("Starting projection of '{0}' on a second view '{1}' using ProjectionManager", video.Title, device.Name), NotifyType.StatusMessage);

                        await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId, device);
                    }
                    catch (Exception ex)
                    {
                        if (!ProjectionManager.ProjectionDisplayAvailable)
                            throw ex;
                    }

                    if (pvb.ProjectedPage != null)
                    {
                        this.player.Pause();
                        await pvb.ProjectedPage.SetMediaSource(this.player.Source, this.player.Position);
                    }
                    if (device != null)
                    {
                        activeDevice = device;
                        activeCastConnectionHandler = pvb;
                    }
                    projectionManagerCastAsyncSucceeded = true;

                    rootPage.NotifyUser(string.Format("Displaying '{0}' on a second view '{1}' using ProjectionManager", video.Title, device.Name), NotifyType.StatusMessage);
                }
                catch (Exception)
                {
                    rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
                }
                ApplicationView.GetForCurrentView().ExitFullScreenMode();
            }
                return projectionManagerCastAsyncSucceeded;
        }

async Task<bool> TryStopDialAppAsync ( DialApp app ) [inline, private]

Definition at line 502 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            bool stopped = false;

            //Get the current application state
            DialAppStateDetails stateDetails = await app.GetAppStateAsync();

            switch (stateDetails.State)
            {
                case DialAppState.NetworkFailure:
                    {
                        // In case getting the application state failed because of a network failure, you could add retry logic
                        rootPage.NotifyUser("Network Failure while getting application state", NotifyType.ErrorMessage);
                        break;
                    }
                case DialAppState.Stopped:
                    {
                        stopped = true;
                        // In case getting the application state failed because of a network failure, you could add retry logic
                        rootPage.NotifyUser("Application was already stopped.", NotifyType.StatusMessage);
                        break;
                    }
                default:
                    {
                        DialAppStopResult result = await app.StopAsync();

                        if (result == DialAppStopResult.Stopped)
                        {
                            stopped = true;
                            // In case getting the application state failed because of a network failure, you could add retry logic
                            rootPage.NotifyUser("Application stopped successfully.", NotifyType.StatusMessage);
                        }
                        else
                        {
                            if (result == DialAppStopResult.StopFailed || result == DialAppStopResult.NetworkFailure)
                            {
                                // In case getting the application state failed because of a network failure, you could add retry logic
                                rootPage.NotifyUser(string.Format("Error occured trying to stop application. Status: '{0}'", result.ToString()), NotifyType.StatusMessage);
                            }
                            else //in case of DialAppStopResult.OperationNotSupported, there is not much more you can do. You could implement your own
                            // mechanism to stop the application on that device.
                            {
                                stopped = true;
                                // In case getting the application state failed because of a network failure, you could add retry logic
                                rootPage.NotifyUser(string.Format("Stop is not supported by device: '{0}'", activeDevice.Name), NotifyType.ErrorMessage);
                            }
                        }
                        break;
                    }
            }
            return stopped;
        }

bool TryStopProjectionManagerAsync ( ProjectionViewBroker broker ) [inline, private]

Definition at line 289 of file 06_Combine_Casting_Tech.xaml.cs.

        {
            broker.ProjectedPage.StopProjecting();
            return true;
        }

Member Data Documentation

object activeCastConnectionHandler = null [private]

Definition at line 40 of file 06_Combine_Casting_Tech.xaml.cs.

DeviceInformation activeDevice = null [private]

Definition at line 39 of file 06_Combine_Casting_Tech.xaml.cs.

const int MAX_RESULTS = 10 [private]

Definition at line 35 of file 06_Combine_Casting_Tech.xaml.cs.

DevicePicker picker = null [private]

Definition at line 38 of file 06_Combine_Casting_Tech.xaml.cs.

ProjectionViewBroker pvb = new ProjectionViewBroker() [private]

Definition at line 97 of file 06_Combine_Casting_Tech.xaml.cs.

MainPage rootPage [private]

Definition at line 37 of file 06_Combine_Casting_Tech.xaml.cs.

int thisViewId [private]

Definition at line 42 of file 06_Combine_Casting_Tech.xaml.cs.

VideoMetaData video = null [private]

Definition at line 41 of file 06_Combine_Casting_Tech.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/06_Combine_Casting_Tech.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UnhandledExceptionPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • UnhandledExceptionPage
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties

UnhandledExceptionPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

UnhandledExceptionPage ()

Static Public Member Functions

static void | ShowUnhandledException (Exception ex)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Properties

string | StatusMessage [get, set]

Detailed Description

Definition at line 37 of file UnhandledExceptionPage.xaml.cs.

Constructor & Destructor Documentation

UnhandledExceptionPage ( ) [inline]

Definition at line 61 of file UnhandledExceptionPage.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file UnhandledExceptionPage.xaml.cs.

        {
            base.OnNavigatedTo(e);

            if(e.Parameter is string)
            {
                this.StatusMessage = (string)e.Parameter;
            }
        }

static void ShowUnhandledException ( Exception ex ) [inline, static]

Definition at line 39 of file UnhandledExceptionPage.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
                Window.Current.Activate();
            }

            rootFrame.Navigate(typeof(UnhandledExceptionPage), ex.ToString());
        }

Property Documentation

string StatusMessage [get, set]

Definition at line 67 of file UnhandledExceptionPage.xaml.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/UnhandledExceptionPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApiInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Util
  • ApiInformation
Static Public Member Functions

ApiInformation Class Reference

List of all members.

Static Public Member Functions

static bool IsTypePresent (string typeName)

Detailed Description

Definition at line 20 of file ApiInformation.cs.

Member Function Documentation

static bool IsTypePresent ( string typeName ) [inline, static]

Definition at line 22 of file ApiInformation.cs.

        {
            try
            {
                Windows.Media.Casting.CastingDevicePicker picker = new Windows.Media.Casting.CastingDevicePicker();

                return true;
            }
            catch {
                return false;
            }
        }

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Util/ApiInformation.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomDevicePickerFilter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Util
  • CustomDevicePickerFilter
Public Member Functions | Properties | Private Attributes

CustomDevicePickerFilter Class Reference

List of all members.

Public Member Functions

override string | ToString ()

Properties

IList< string > | SupportedDeviceSelectors [get]

Private Attributes

IList< string > | supportedDeviceSelectors = new List<string>()

Detailed Description

Definition at line 21 of file CustomDevicePickerFilter.cs.

Member Function Documentation

override string ToString ( ) [inline]

Definition at line 29 of file CustomDevicePickerFilter.cs.

        {
            string retval = string.Empty;

            if (supportedDeviceSelectors.Count > 0)
                retval = supportedDeviceSelectors[0];

            if (supportedDeviceSelectors.Count > 1)
                retval = "(" + retval + ")";

            for (int idx = 1; idx < supportedDeviceSelectors.Count; idx++)
                retval = retval + " OR (" + supportedDeviceSelectors[idx] + ")";

            return retval;
        }

Member Data Documentation

IList<string> supportedDeviceSelectors = new List<string>() [private]

Definition at line 23 of file CustomDevicePickerFilter.cs.

Property Documentation

IList<string> SupportedDeviceSelectors [get]

Definition at line 26 of file CustomDevicePickerFilter.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Util/CustomDevicePickerFilter.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DialLaunchArguments Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Util
  • DialLaunchArguments
Static Public Member Functions | Properties | Private Member Functions

DialLaunchArguments Class Reference

List of all members.

Static Public Member Functions

static DialLaunchArguments | Parse (string arguments)

Properties

string | PairingCode [get, set]
TimeSpan | Position [get, set]
string | VideoId [get, set]

Private Member Functions

DialLaunchArguments ()

Detailed Description

Definition at line 20 of file DialLaunchArguments.cs.

Constructor & Destructor Documentation

DialLaunchArguments ( ) [inline, private]

Definition at line 26 of file DialLaunchArguments.cs.

{ }

Member Function Documentation

static DialLaunchArguments Parse ( string arguments ) [inline, static]

Definition at line 28 of file DialLaunchArguments.cs.

        {
            try
            {
                DialLaunchArguments dialLaunchArgs = new DialLaunchArguments();

                string[] argswithkeys = arguments.Split('&');

                foreach (string currentArgWithKey in argswithkeys)
                {
                    string key = currentArgWithKey.Split('=')[0];
                    string val = currentArgWithKey.Split('=')[1];
                    switch (key)
                    {
                        case "v": { dialLaunchArgs.VideoId = val; break; }
                        case "t": { dialLaunchArgs.Position = TimeSpan.FromTicks(long.Parse(val)); break; }
                        case "pairingCode": { dialLaunchArgs.PairingCode = val; break; }
                    }
                }
                return dialLaunchArgs;
            }
            catch (Exception ex){
                throw new ArgumentOutOfRangeException(string.Format("Failed to parse DIAL launch arguments: '{0}'", arguments), ex);
                }
        }

Property Documentation

string PairingCode [get, set]

Definition at line 23 of file DialLaunchArguments.cs.

TimeSpan Position [get, set]

Definition at line 24 of file DialLaunchArguments.cs.

string VideoId [get, set]

Definition at line 22 of file DialLaunchArguments.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Util/DialLaunchArguments.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RequiredDeviceProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Util
  • RequiredDeviceProperties
Static Public Member Functions | Static Public Attributes | Properties | Private Member Functions

RequiredDeviceProperties Class Reference

List of all members.

Static Public Member Functions

static void | AddProps (IList< string > list)

Static Public Attributes

static readonly string | DEVPKEY_AepContainer_Categories = "System.Devices.AepContainer.Categories"
static readonly string | DEVPKEY_AepContainer_FriendlyName = "{0bba1ede-7566-4f47-90ec-25fc567ced2a}, 5"
static readonly string | DEVPKEY_AepContainer_SupportedUriSchemes = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 5"
static readonly string | DEVPKEY_AepContainer_SupportsAudio = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 2"
static readonly string | DEVPKEY_AepContainer_SupportsImages = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 4"
static readonly string | DEVPKEY_AepContainer_SupportsVideo = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 3"
static readonly string | DEVPKEY_Device_ContainerId = "System.Devices.ContainerId"
static readonly string | DEVPKEY_Device_InstanceId = "System.Devices.DeviceInstanceId"
static readonly string | DEVPKEY_DeviceContainer_Manufacturer = "System.Devices.Manufacturer"
static readonly string | DEVPKEY_DeviceContainer_ModelName = "System.Devices.ModelName"

Properties

static List< string > | Props [get]

Private Member Functions

RequiredDeviceProperties ()

Detailed Description

Definition at line 20 of file RequiredDeviceProperties.cs.

Constructor & Destructor Documentation

RequiredDeviceProperties ( ) [inline, private]

Definition at line 33 of file RequiredDeviceProperties.cs.

{ }

Member Function Documentation

static void AddProps ( IList< string > list ) [inline, static]

Definition at line 35 of file RequiredDeviceProperties.cs.

        {
            foreach (string s in Props)
                list.Add(s);
        }

Member Data Documentation

readonly string DEVPKEY_AepContainer_Categories = "System.Devices.AepContainer.Categories" [static]

Definition at line 27 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_AepContainer_FriendlyName = "{0bba1ede-7566-4f47-90ec-25fc567ced2a}, 5" [static]

Definition at line 22 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_AepContainer_SupportedUriSchemes = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 5" [static]

Definition at line 26 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_AepContainer_SupportsAudio = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 2" [static]

Definition at line 23 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_AepContainer_SupportsImages = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 4" [static]

Definition at line 25 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_AepContainer_SupportsVideo = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 3" [static]

Definition at line 24 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_Device_ContainerId = "System.Devices.ContainerId" [static]

Definition at line 30 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_Device_InstanceId = "System.Devices.DeviceInstanceId" [static]

Definition at line 31 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_DeviceContainer_Manufacturer = "System.Devices.Manufacturer" [static]

Definition at line 28 of file RequiredDeviceProperties.cs.

readonly string DEVPKEY_DeviceContainer_ModelName = "System.Devices.ModelName" [static]

Definition at line 29 of file RequiredDeviceProperties.cs.

Property Documentation

List<string> Props [static, get]

Definition at line 41 of file RequiredDeviceProperties.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Util/RequiredDeviceProperties.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewLifetimeControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • ScreenCasting
  • Util
  • ViewLifetimeControl
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

ViewLifetimeControl Class Reference

List of all members.

Public Member Functions

int | StartViewInUse ()
int | StopViewInUse ()

Static Public Member Functions

static ViewLifetimeControl | CreateForCurrentView ()

Properties

bool | Consolidated [get, set]
CoreDispatcher | Dispatcher [get]
int | Id [get]
ViewReleasedHandler | Released
string | Title [get, set]

Events

ViewReleasedHandler | InternalReleased
PropertyChangedEventHandler | PropertyChanged

Private Member Functions

ViewLifetimeControl (CoreWindow newWindow)
void | FinalizeRelease ()
void | RegisterForEvents ()
void | UnregisterForEvents ()
void | ViewConsolidated (ApplicationView sender, ApplicationViewConsolidatedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

bool | consolidated = true
CoreDispatcher | dispatcher
int | refCount = 0
bool | released = false
string | title
int | viewId
CoreWindow | window

Detailed Description

Definition at line 42 of file ViewLifetimeControl.cs.

Constructor & Destructor Documentation

ViewLifetimeControl ( CoreWindow newWindow ) [inline, private]

Definition at line 80 of file ViewLifetimeControl.cs.

        {
            dispatcher = newWindow.Dispatcher;
            window = newWindow;
            viewId = ApplicationView.GetApplicationViewIdForWindow(window);

            // This class will automatically tell the view when its time to close
            // or stay alive in a few cases
            RegisterForEvents();
        }

Member Function Documentation

static ViewLifetimeControl CreateForCurrentView ( ) [inline, static]

Definition at line 154 of file ViewLifetimeControl.cs.

        {
            return new ViewLifetimeControl(CoreWindow.GetForCurrentThread());
        }

void FinalizeRelease ( ) [inline, private]

Definition at line 131 of file ViewLifetimeControl.cs.

        {
            bool justReleased = false;
            lock (this)
            {
                if (refCount == 0)
                {
                    justReleased = true;
                    released = true;
                }
            }

            // This assumes that released will never be made false after it
            // it has been set to true
            if (justReleased)
            {
                UnregisterForEvents();
                InternalReleased(this, null);
            }
        }

void RegisterForEvents ( ) [inline, private]

Definition at line 92 of file ViewLifetimeControl.cs.

        {
            // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
            // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
            // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
            ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
            window.VisibilityChanged += VisibilityChanged;
        }

int StartViewInUse ( ) [inline]

Definition at line 234 of file ViewLifetimeControl.cs.

        {
            bool releasedCopy = false;
            int refCountCopy = 0;

            // This method is called from several different threads
            // (each view lives on its own thread)
            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = ++refCount;
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }

            return refCountCopy;
        }

int StopViewInUse ( ) [inline]

Definition at line 261 of file ViewLifetimeControl.cs.

        {
            int refCountCopy = 0;
            bool releasedCopy = false;

            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = --refCount;
                    if (refCountCopy == 0)
                    {
                        // If no other view is interacting with this view, and
                        // the view isn't accessible to the user, it's appropriate
                        // to close it
                        //
                        // Before actually closing the view, make sure there are no
                        // other important events waiting in the queue (this low-priority item
                        // will run after other events)
                        dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease);
                    }
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }
            return refCountCopy;
        }

void UnregisterForEvents ( ) [inline, private]

Definition at line 102 of file ViewLifetimeControl.cs.

        {
            ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
            window.VisibilityChanged -= VisibilityChanged;
        }

void ViewConsolidated | ( | ApplicationView | sender,
 |  | ApplicationViewConsolidatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 123 of file ViewLifetimeControl.cs.

        {
            Consolidated = true;
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file ViewLifetimeControl.cs.

        {

            if (e.Visible)
            {
                // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
                // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
                // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
                Consolidated = false;
            }
        }

Member Data Documentation

bool consolidated = true [private]

Definition at line 74 of file ViewLifetimeControl.cs.

CoreDispatcher dispatcher [private]

Definition at line 45 of file ViewLifetimeControl.cs.

int refCount = 0 [private]

Definition at line 59 of file ViewLifetimeControl.cs.

bool released = false [private]

Definition at line 68 of file ViewLifetimeControl.cs.

string title [private]

Definition at line 52 of file ViewLifetimeControl.cs.

int viewId [private]

Definition at line 64 of file ViewLifetimeControl.cs.

CoreWindow window [private]

Definition at line 48 of file ViewLifetimeControl.cs.

Property Documentation

bool Consolidated [get, set]

Definition at line 207 of file ViewLifetimeControl.cs.

CoreDispatcher Dispatcher [get]

Definition at line 182 of file ViewLifetimeControl.cs.

int Id [get]

Definition at line 194 of file ViewLifetimeControl.cs.

ViewReleasedHandler Released [add, remove]

Definition at line 297 of file ViewLifetimeControl.cs.

string Title [get, set]

Definition at line 162 of file ViewLifetimeControl.cs.

Event Documentation

ViewReleasedHandler InternalReleased [private]

Definition at line 77 of file ViewLifetimeControl.cs.

PropertyChangedEventHandler PropertyChanged

Definition at line 295 of file ViewLifetimeControl.cs.

The documentation for this class was generated from the following file:
  • AdvancedCasting/cs/Util/ViewLifetimeControl.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • MainPage
Public Attributes

MainPage Class Reference

#include "SampleConfiguration.h"

List of all members.

Public Attributes

internal __pad0__: SecondaryViewsHelpers::ViewLifetimeControl^ ProjectionViewPageControl

Detailed Description

Definition at line 20 of file SampleConfiguration.h.

Member Data Documentation

internal __pad0__

Definition at line 23 of file SampleConfiguration.h.

The documentation for this class was generated from the following files:
  • Projection/cpp/SampleConfiguration.h
  • WindowsAudioSession/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProjectionViewPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • ProjectionViewPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ProjectionViewPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ProjectionViewPage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | StopProjecting_Click (object sender, RoutedEventArgs e)
async void | SwapViews_Click (object sender, RoutedEventArgs e)
async void | thisViewControl_Released (object sender, EventArgs e)

Private Attributes

CoreDispatcher | mainDispatcher
int | mainViewId
ViewLifetimeControl thisViewControl

Detailed Description

Definition at line 28 of file ProjectionViewPage.xaml.cs.

Constructor & Destructor Documentation

ProjectionViewPage ( ) [inline]

Definition at line 34 of file ProjectionViewPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file ProjectionViewPage.xaml.cs.

        {
            var initData = (ProjectionViewPageInitializationData)e.Parameter;

            // The ViewLifetimeControl is a convenient wrapper that ensures the
            // view is closed only when the user is done with it
            thisViewControl = initData.ProjectionViewPageControl;
            mainDispatcher = initData.MainDispatcher;
            mainViewId = initData.MainViewId;

            // Listen for when it's time to close this view
            thisViewControl.Released += thisViewControl_Released;
        }

async void StopProjecting_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file ProjectionViewPage.xaml.cs.

        {
            // There may be cases to end the projection from the projected view
            // (e.g. the presentation hosted in that view concludes)
            thisViewControl.StartViewInUse();
            await ProjectionManager.StopProjectingAsync(
                ApplicationView.GetForCurrentView().Id,
                mainViewId);
            thisViewControl.StopViewInUse();
        }

async void SwapViews_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file ProjectionViewPage.xaml.cs.

        {
            // The view might arrive on the wrong display. The user can
            // easily swap the display on which the view appears
            thisViewControl.StartViewInUse();
            await ProjectionManager.SwapDisplaysForViewsAsync(
                ApplicationView.GetForCurrentView().Id,
                mainViewId
            );
            thisViewControl.StopViewInUse();
        }

async void thisViewControl_Released | ( | object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file ProjectionViewPage.xaml.cs.

        {
            // There are two major cases where this event will get invoked:
            // 1. The view goes unused for some time, and the system cleans it up
            // 2. The app calls "StopProjectingAsync"
            thisViewControl.Released -= thisViewControl_Released;
            await mainDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.ProjectionViewPageControl = null;
            });
            Window.Current.Close();
        }

Member Data Documentation

CoreDispatcher mainDispatcher [private]

Definition at line 31 of file ProjectionViewPage.xaml.cs.

int mainViewId [private]

Definition at line 32 of file ProjectionViewPage.xaml.cs.

ViewLifetimeControl thisViewControl [private]

Definition at line 30 of file ProjectionViewPage.xaml.cs.

The documentation for this class was generated from the following files:
  • Projection/cs/ProjectionViewPage.xaml.cs
  • Projection/cpp/ProjectionViewPage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProjectionViewPageInitializationData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • ProjectionViewPageInitializationData
Public Attributes

ProjectionViewPageInitializationData Class Reference

List of all members.

Public Attributes

CoreDispatcher | MainDispatcher
int | MainViewId
ViewLifetimeControl ProjectionViewPageControl

Detailed Description

Definition at line 25 of file Scenario1.xaml.cs.

Member Data Documentation

CoreDispatcher MainDispatcher

Definition at line 27 of file Scenario1.xaml.cs.

int MainViewId

Definition at line 29 of file Scenario1.xaml.cs.

ViewLifetimeControl ProjectionViewPageControl

Definition at line 28 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • Projection/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • ProxyStubsForWinRTComponents
  • sealed
Public Member Functions | Private Member Functions

sealed Class Reference

#include "Scenario1_OvenClient.xaml.h"

List of all members.

Public Member Functions

CustomException ()
CustomException ()
CustomExceptionWRL ()
CustomExceptionWRL ()
OvenClient ()
OvenClient ()
OvenClientWRL ()
OvenClientWRL ()

Private Member Functions

void | BreadCompletedHandler1 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | BreadCompletedHandler1 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | BreadCompletedHandler2 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | BreadCompletedHandler2 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | BreadCompletedHandler3 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | BreadCompletedHandler3 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Detailed Description

Definition at line 14 of file Scenario1_OvenClient.xaml.h.

Member Function Documentation

void BreadCompletedHandler1 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
void BreadCompletedHandler1 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
void BreadCompletedHandler2 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
void BreadCompletedHandler2 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
void BreadCompletedHandler3 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
void BreadCompletedHandler3 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::Bread^ | bread |
 | ) |  |  | [private]
CustomException ( )
CustomException ( )
CustomExceptionWRL ( )
CustomExceptionWRL ( )
OvenClient ( )
OvenClient ( )
OvenClientWRL ( )
OvenClientWRL ( )
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
The documentation for this class was generated from the following files:
  • ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.h
  • ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.h
  • ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.h
  • ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h
  • ProxyStubsForWinRTComponents/cs/cpp/Scenario1_OvenClient.xaml.h
  • ProxyStubsForWinRTComponents/cs/cpp/Scenario2_OvenClientWRL.xaml.h
  • ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.h
  • ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.h
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • Scenario
Public Attributes

Scenario Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Attributes

Platform::String | ClassName
Platform::String | Title

Detailed Description

Definition at line 45 of file SampleConfiguration.h.

Member Data Documentation

Platform::String ClassName

Definition at line 48 of file SampleConfiguration.h.

Platform::String Title

Definition at line 47 of file SampleConfiguration.h.

The documentation for this struct was generated from the following files:
  • Projection/cpp/SampleConfiguration.h
  • WindowsAudioSession/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • Scenario1
Public Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Private Member Functions

async void | StartProjecting_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current
int | thisViewId

Detailed Description

Definition at line 35 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 40 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
            thisViewId = ApplicationView.GetForCurrentView().Id;
        }

Member Function Documentation

async void StartProjecting_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario1.xaml.cs.

        {
            // If projection is already in progress, then it could be shown on the monitor again
            // Otherwise, we need to create a new view to show the presentation
            if (rootPage.ProjectionViewPageControl == null)
            {
                // First, create a new, blank view
                var thisDispatcher = Window.Current.Dispatcher;
                await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // ViewLifetimeControl is a wrapper to make sure the view is closed only
                    // when the app is done with it
                    rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                    // Assemble some data necessary for the new page
                    var initData = new ProjectionViewPageInitializationData();
                    initData.MainDispatcher = thisDispatcher;
                    initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                    initData.MainViewId = thisViewId;

                    // Display the page in the view. Note that the view will not become visible
                    // until "StartProjectingAsync" is called
                    var rootFrame = new Frame();
                    rootFrame.Navigate(typeof(ProjectionViewPage), initData);
                    Window.Current.Content = rootFrame;

                    // The call to Window.Current.Activate is required starting in Windos 10.
                    // Without it, the view will never appear.
                    Window.Current.Activate();
                });
            }

            try
            {
                // Start/StopViewInUse are used to signal that the app is interacting with the
                // view, so it shouldn't be closed yet, even if the user loses access to it
                rootPage.ProjectionViewPageControl.StartViewInUse();

                // Show the view on a second display (if available) or on the primary display
                await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId);

                rootPage.ProjectionViewPageControl.StopViewInUse();

                rootPage.NotifyUser("Projection started with success", NotifyType.StatusMessage);
            }
            catch (InvalidOperationException)
            {
                rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 37 of file Scenario1.xaml.cs.

int thisViewId [private]

Definition at line 38 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following files:
  • Projection/cs/Scenario1.xaml.cs
  • Projection/cpp/Scenario1.xaml.cpp
  • WindowsAudioSession/cpp/Scenario1.xaml.cpp
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ProjectionManager_ProjectionDisplayAvailableChanged (object sender, object e)
async void | RequestAndStartProjecting_Click (object sender, RoutedEventArgs e)
async void | StartProjecting_Click (object sender, RoutedEventArgs e)
void | UpdateTextBlock (bool screenAvailable)

Private Attributes

CoreDispatcher | dispatcher
MainPage | rootPage = MainPage.Current
int | thisViewId

Detailed Description

Definition at line 30 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 36 of file Scenario2.xaml.cs.

        {
            InitializeComponent();
            thisViewId = ApplicationView.GetForCurrentView().Id;
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario2.xaml.cs.

        {
            ProjectionManager.ProjectionDisplayAvailableChanged -= ProjectionManager_ProjectionDisplayAvailableChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario2.xaml.cs.

        {
            // An app can query if a second display is available...
            UpdateTextBlock(ProjectionManager.ProjectionDisplayAvailable);
            // ...or listen for when a display is attached or detached
            ProjectionManager.ProjectionDisplayAvailableChanged += ProjectionManager_ProjectionDisplayAvailableChanged;
            dispatcher = Window.Current.Dispatcher;
        }

async void ProjectionManager_ProjectionDisplayAvailableChanged | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario2.xaml.cs.

        {
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                UpdateTextBlock(ProjectionManager.ProjectionDisplayAvailable);
            });
        }

async void RequestAndStartProjecting_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 130 of file Scenario2.xaml.cs.

        {
            // If projection is already in progress, then it could be shown on the monitor again
            // Otherwise, we need to create a new view to show the presentation
            if (rootPage.ProjectionViewPageControl == null)
            {
                // First, create a new, blank view
                var thisDispatcher = Window.Current.Dispatcher;
                await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // ViewLifetimeControl is a wrapper to make sure the view is closed only
                    // when the app is done with it
                    rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                    // Assemble some data necessary for the new page
                    var initData = new ProjectionViewPageInitializationData();
                    initData.MainDispatcher = thisDispatcher;
                    initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                    initData.MainViewId = thisViewId;

                    // Display the page in the view. Note that the view will not become visible
                    // until "StartProjectingAsync" is called
                    var rootFrame = new Frame();
                    rootFrame.Navigate(typeof(ProjectionViewPage), initData);
                    Window.Current.Content = rootFrame;
                    Window.Current.Activate();
                });
            }

            try
            {
                // Start/StopViewInUse are used to signal that the app is interacting with the
                // view, so it shouldn't be closed yet, even if the user loses access to it
                rootPage.ProjectionViewPageControl.StartViewInUse();

                // Show the view on a second display (if available) or on the primary display
                Rect pickerLocation = new Rect(470.0, 0.0, 200.0, 300.0);
                await ProjectionManager.RequestStartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId, pickerLocation, Windows.UI.Popups.Placement.Above);

                rootPage.ProjectionViewPageControl.StopViewInUse();

                rootPage.NotifyUser("Projection started with success", NotifyType.StatusMessage);
            }
            catch (InvalidOperationException)
            {
                rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
            }
        }

async void StartProjecting_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file Scenario2.xaml.cs.

        {
            // If projection is already in progress, then it could be shown on the monitor again
            // Otherwise, we need to create a new view to show the presentation
            if (rootPage.ProjectionViewPageControl == null)
            {
                // First, create a new, blank view
                await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // ViewLifetimeControl is a wrapper to make sure the view is closed only
                    // when the app is done with it
                    rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                    // Assemble some data necessary for the new page
                    var initData = new ProjectionViewPageInitializationData();
                    initData.MainDispatcher = dispatcher;
                    initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                    initData.MainViewId = thisViewId;

                    // Display the page in the view. Note that the view will not become visible
                    // until "StartProjectingAsync" is called
                    var rootFrame = new Frame();
                    rootFrame.Navigate(typeof(ProjectionViewPage), initData);
                    Window.Current.Content = rootFrame;

                    // The call to Window.Current.Activate is required starting in Windos 10.
                    // Without it, the view will never appear.
                    Window.Current.Activate();
                });
            }

            try
            {
                // Start/StopViewInUse are used to signal that the app is interacting with the
                // view, so it shouldn't be closed yet, even if the user loses access to it
                rootPage.ProjectionViewPageControl.StartViewInUse();

                // Show the view on a second display (if available) or on the primary display
                await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId);

                rootPage.ProjectionViewPageControl.StopViewInUse();

                rootPage.NotifyUser("Projection started with success", NotifyType.StatusMessage);
            }
            catch (InvalidOperationException)
            {
                rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
            }
        }

void UpdateTextBlock ( bool screenAvailable ) [inline, private]

Definition at line 64 of file Scenario2.xaml.cs.

        {
            if (screenAvailable)
            {
                this.displayAvailableStatus.Text = "Display is available";
                this.startprojecting_button.Visibility = Visibility.Visible;
                this.requestandstartprojecting_button.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.displayAvailableStatus.Text = "Display is not available, select one:";
                this.startprojecting_button.Visibility = Visibility.Collapsed;
                this.requestandstartprojecting_button.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

CoreDispatcher dispatcher [private]

Definition at line 33 of file Scenario2.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2.xaml.cs.

int thisViewId [private]

Definition at line 34 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following files:
  • Projection/cs/Scenario2.xaml.cs
  • Projection/cpp/Scenario2.xaml.cpp
  • WindowsAudioSession/cpp/Scenario2.xaml.cpp
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • Scenario3
Public Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3 ()

Private Member Functions

void | displayList_listview_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | LoadAndDisplayScreens_Click (object sender, RoutedEventArgs e)
async void | StartProjecting (DeviceInformation selectedDisplay)

Private Attributes

MainPage | rootPage = MainPage.Current
int | thisViewId

Detailed Description

Definition at line 29 of file Scenario3.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 34 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
            thisViewId = ApplicationView.GetForCurrentView().Id;
        }

Member Function Documentation

void displayList_listview_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario3.xaml.cs.

        {
            // Get the DeviceInformation object of selected ListView item
            ListView devicesList = (ListView)sender;
            if (devicesList.SelectedItem != null)
            {
                DeviceInformation selectedDevice = (DeviceInformation)devicesList.SelectedItem;

                // Start projecting to the selected display
                StartProjecting(selectedDevice);
            }
            this.displayList_listview.Visibility = Visibility.Collapsed;
        }

async void LoadAndDisplayScreens_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario3.xaml.cs.

        {
            try
            {
                // Use the device selector query of the ProjectionManager to list wired/wireless displays
                String projectorSelectorQuery = ProjectionManager.GetDeviceSelector();

                this.findAndProject_button.IsEnabled = false;

                // Clear the list box
                this.displayList_listview.Items.Clear();
                this.displayList_listview.Visibility = Visibility.Visible;

                rootPage.NotifyUser("Searching for devices...", NotifyType.StatusMessage);

                // Calling the device API to find devices based on the device query
                var outputDevices = await DeviceInformation.FindAllAsync(projectorSelectorQuery);

                // List found devices in the UI
                for (int i = 0; i < outputDevices.Count; i++)
                {
                    var device = outputDevices[i];
                    this.displayList_listview.Items.Add(device);
                }

                this.findAndProject_button.IsEnabled = true;
                rootPage.NotifyUser("Found devices are now listed.", NotifyType.StatusMessage);
            }
            catch (InvalidOperationException)
            {
                rootPage.NotifyUser("An error occured when querying and listing devices.", NotifyType.ErrorMessage);
            }
        }

async void StartProjecting ( DeviceInformation selectedDisplay ) [inline, private]

Definition at line 74 of file Scenario3.xaml.cs.

        {
            // If projection is already in progress, then it could be shown on the monitor again
            // Otherwise, we need to create a new view to show the presentation
            if (rootPage.ProjectionViewPageControl == null)
            {
                // First, create a new, blank view
                var thisDispatcher = Window.Current.Dispatcher;
                await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // ViewLifetimeControl is a wrapper to make sure the view is closed only
                    // when the app is done with it
                    rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();

                    // Assemble some data necessary for the new page
                    var initData = new ProjectionViewPageInitializationData();
                    initData.MainDispatcher = thisDispatcher;
                    initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
                    initData.MainViewId = thisViewId;

                    // Display the page in the view. Note that the view will not become visible
                    // until "StartProjectingAsync" is called
                    var rootFrame = new Frame();
                    rootFrame.Navigate(typeof(ProjectionViewPage), initData);
                    Window.Current.Content = rootFrame;

                    // The call to Window.Current.Activate is required starting in Windos 10.
                    // Without it, the view will never appear.
                    Window.Current.Activate();
                });
            }

            try
            {
                // Start/StopViewInUse are used to signal that the app is interacting with the
                // view, so it shouldn't be closed yet, even if the user loses access to it
                rootPage.ProjectionViewPageControl.StartViewInUse();

                // Show the view on a second display that was selected by the user
                rootPage.NotifyUser("Starting projection on " + selectedDisplay.Name, NotifyType.StatusMessage);
                await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId, selectedDisplay);

                rootPage.NotifyUser("Projection started with success on " + selectedDisplay.Name, NotifyType.StatusMessage);
                rootPage.ProjectionViewPageControl.StopViewInUse();
            }
            catch (InvalidOperationException)
            {
                rootPage.NotifyUser("Start projection failed", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario3.xaml.cs.

int thisViewId [private]

Definition at line 32 of file Scenario3.xaml.cs.

The documentation for this class was generated from the following files:
  • Projection/cs/Scenario3.xaml.cs
  • Projection/cpp/Scenario3.xaml.cpp
  • WindowsAudioSession/cpp/Scenario3.xaml.cpp
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • sealed
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "App.xaml.h"

List of all members.

Public Member Functions

MainPage ()
MainPage ()
ProjectionViewPage ()
Scenario1 ()
Scenario2 ()
Scenario3 ()

Public Attributes

int | MainViewId
SecondaryViewsHelpers::ViewLifetimeControl ProjectionViewPageControl

Protected Member Functions

virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override
virtual void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

Protected Attributes

internal | __pad0__: App()

Properties

Platform::String | Id
Platform::String | Name

Private Member Functions

void | Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | displayList_listview_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)
void | Footer_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Footer_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | LoadAndDisplayScreens_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | NotifyUser (Platform::String^strMessage, NotifyType type)
void | NotifyUser (Platform::String^strMessage, NotifyType type)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)
void | OnProjectionDisplayAvailableChanged (Platform::Object^sender, Platform::Object^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)
void | RequestAndStartProjecting_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ScenarioControl_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)
void | ScenarioControl_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)
void | StartProjecting (Windows::Devices::Enumeration::DeviceInformation^selectedDisplay)
void | StartProjecting_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | StartProjecting_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | StopProjecting_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | SwapViews_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | thisViewControl_Released (Platform::Object^sender, Platform::Object^e)
void | UpdateTextBlock (bool screenAvailable)

Private Attributes

Windows::UI::Core::CoreDispatcher | dispatcher
Windows::Foundation::EventRegistrationToken | displayChangeToken
Windows::UI::Core::CoreDispatcher | mainDispatcher
int | mainViewId
Windows::Foundation::EventRegistrationToken | releasedToken
SDKSample::SecondaryViewsHelpers::ViewLifetimeControl | thisViewControl
int | thisViewId

Detailed Description

An empty page that can be used on its own or navigated to within a Frame.

Definition at line 21 of file App.xaml.h.

Member Function Documentation

void Button_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Button_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void displayList_listview_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | e |
 | ) |  |  | [private]
void Footer_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Footer_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void LoadAndDisplayScreens_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
MainPage ( )
MainPage ( )
void NotifyUser | ( | Platform::String^ | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [private]
void NotifyUser | ( | Platform::String^ | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [private]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnNavigationFailed | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^ | e |
 | ) |  |  | [private]
void OnProjectionDisplayAvailableChanged | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | e |
 | ) |  |  | [private]
ProjectionViewPage ( )
void RequestAndStartProjecting_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
void ScenarioControl_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | e |
 | ) |  |  | [private]
void ScenarioControl_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | e |
 | ) |  |  | [private]
void StartProjecting ( Windows::Devices::Enumeration::DeviceInformation^ selectedDisplay ) [private]
void StartProjecting_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void StartProjecting_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void StopProjecting_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void SwapViews_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void thisViewControl_Released | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | e |
 | ) |  |  | [private]
void UpdateTextBlock ( bool screenAvailable ) [private]

Member Data Documentation

internal __pad0__ [protected]

Definition at line 27 of file App.xaml.h.

Windows::UI::Core::CoreDispatcher dispatcher [private]

Definition at line 34 of file Scenario2.xaml.h.

Windows::Foundation::EventRegistrationToken displayChangeToken [private]

Definition at line 33 of file Scenario2.xaml.h.

Windows::UI::Core::CoreDispatcher mainDispatcher [private]

Definition at line 34 of file ProjectionViewPage.xaml.h.

int mainViewId [private]

Definition at line 35 of file ProjectionViewPage.xaml.h.

int MainViewId

Definition at line 58 of file SampleConfiguration.h.

SecondaryViewsHelpers::ViewLifetimeControl ProjectionViewPageControl

Definition at line 57 of file SampleConfiguration.h.

Windows::Foundation::EventRegistrationToken releasedToken [private]

Definition at line 36 of file ProjectionViewPage.xaml.h.

SDKSample::SecondaryViewsHelpers::ViewLifetimeControl thisViewControl [private]

Definition at line 33 of file ProjectionViewPage.xaml.h.

int thisViewId [private]

Definition at line 27 of file Scenario1.xaml.h.

Property Documentation

Platform::String Id

Definition at line 24 of file Scenario3.xaml.h.

Platform::String Name

Definition at line 23 of file Scenario3.xaml.h.

The documentation for this class was generated from the following files:
  • Projection/cpp/App.xaml.h
  • Projection/cpp/MainPage.xaml.h
  • Projection/cpp/ProjectionViewPage.xaml.h
  • Projection/cpp/SampleConfiguration.h
  • Projection/cpp/Scenario1.xaml.h
  • Projection/cpp/Scenario2.xaml.h
  • Projection/cpp/Scenario3.xaml.h
  • WindowsAudioSession/cpp/App.xaml.h
  • WindowsAudioSession/cpp/MainPage.xaml.h
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • SecondaryViewsHelpers
  • sealed
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "ViewLifetimeControl.h"

List of all members.

Public Member Functions

int | StartViewInUse ()
int | StopViewInUse ()

Static Public Member Functions

static ViewLifetimeControl | CreateForCurrentView ()

Properties

bool | consolidated
Windows::UI::Core::CoreDispatcher | dispatcher
std::mutex | globalMutex
bool | madeVisible
int | refCount
bool | released
Platform::String | title
int | viewId
visibilityToken
Platform::Agile
< Windows::UI::Core::CoreWindow^> 		window

Private Member Functions

void | FinalizeRelease ()
void | RegisterForEvents ()
void | UnregisterForEvents ()
void | ViewConsolidated (Windows::UI::ViewManagement::ApplicationView^sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^e)
ViewLifetimeControl (Windows::UI::Core::CoreWindow^newWindow)
void | VisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

Private Attributes

event ViewReleasedHandler | InternalReleased

Detailed Description

Definition at line 26 of file ViewLifetimeControl.h.

Member Function Documentation

static ViewLifetimeControl CreateForCurrentView ( ) [static]
void FinalizeRelease ( ) [private]
void RegisterForEvents ( ) [private]
int StartViewInUse ( )
int StopViewInUse ( )
void UnregisterForEvents ( ) [private]
void ViewConsolidated | ( | Windows::UI::ViewManagement::ApplicationView^ | sender,
 |  | Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^ | e |
 | ) |  |  | [private]
ViewLifetimeControl ( Windows::UI::Core::CoreWindow^ newWindow ) [private]
void VisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | e |
 | ) |  |  | [private]

Member Data Documentation

event ViewReleasedHandler InternalReleased [private]

Definition at line 63 of file ViewLifetimeControl.h.

Property Documentation

bool consolidated [private]

Definition at line 100 of file ViewLifetimeControl.h.

Windows::UI::Core::CoreDispatcher dispatcher [private]

Definition at line 77 of file ViewLifetimeControl.h.

std::mutex globalMutex [private]

Definition at line 108 of file ViewLifetimeControl.h.

bool madeVisible [private]

Definition at line 106 of file ViewLifetimeControl.h.

int refCount [private]

Definition at line 91 of file ViewLifetimeControl.h.

bool released [private]

Definition at line 100 of file ViewLifetimeControl.h.

Platform::String title [private]

Definition at line 84 of file ViewLifetimeControl.h.

int viewId [private]

Definition at line 96 of file ViewLifetimeControl.h.

visibilityToken [private]

Definition at line 74 of file ViewLifetimeControl.h.

Platform::Agile<Windows::UI::Core::CoreWindow^> window [private]

Definition at line 80 of file ViewLifetimeControl.h.

The documentation for this class was generated from the following file:
  • Projection/cpp/ViewLifetimeControl.h
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CAPTUREDEVICEPROPS Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • CAPTUREDEVICEPROPS
Public Attributes

CAPTUREDEVICEPROPS Struct Reference

#include "WASAPICapture.h"

List of all members.

Public Attributes

Platform::Boolean IsLowLatency

Detailed Description

Definition at line 39 of file WASAPICapture.h.

Member Data Documentation

Platform::Boolean IsLowLatency

Definition at line 41 of file WASAPICapture.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cpp/WASAPICapture.h
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DEVICEPROPS Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • DEVICEPROPS
Public Attributes

DEVICEPROPS Struct Reference

#include "WASAPIRenderer.h"

List of all members.

Public Attributes

IRandomAccessStream | ContentStream
DWORD | Frequency
REFERENCE_TIME | hnsBufferDuration
Platform::Boolean | IsBackground
Platform::Boolean | IsHWOffload
Platform::Boolean | IsLowLatency
Platform::Boolean | IsRawChosen
Platform::Boolean | IsRawSupported
Platform::Boolean | IsTonePlayback

Detailed Description

Definition at line 44 of file WASAPIRenderer.h.

Member Data Documentation

IRandomAccessStream ContentStream

Definition at line 54 of file WASAPIRenderer.h.

DWORD Frequency

Definition at line 53 of file WASAPIRenderer.h.

REFERENCE_TIME hnsBufferDuration

Definition at line 52 of file WASAPIRenderer.h.

Platform::Boolean IsBackground

Definition at line 48 of file WASAPIRenderer.h.

Platform::Boolean IsHWOffload

Definition at line 46 of file WASAPIRenderer.h.

Platform::Boolean IsLowLatency

Definition at line 51 of file WASAPIRenderer.h.

Platform::Boolean IsRawChosen

Definition at line 50 of file WASAPIRenderer.h.

Platform::Boolean IsRawSupported

Definition at line 49 of file WASAPIRenderer.h.

Platform::Boolean IsTonePlayback

Definition at line 47 of file WASAPIRenderer.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cpp/WASAPIRenderer.h
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MFSampleGenerator Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • MFSampleGenerator
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

MFSampleGenerator Class Reference

#include "MFSampleGenerator.h"

List of all members.

Public Types

enum | ReaderState { ReaderStateStopped, ReaderStatePreRoll, ReaderStatePlaying, ReaderStateEOS }

Public Member Functions

MFSampleGenerator ()
HRESULT | FillSampleBuffer (UINT32 BytesToRead, BYTE *Data, UINT32 *cbWritten)
void | Flush ()
HRESULT | Initialize (IRandomAccessStream^stream, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx)
Platform::Boolean | IsEOF ()
void | Shutdown ()
HRESULT | StartSource ()
STDMETHODIMP_ (ULONG) Release()
STDMETHODIMP_ (HRESULT) OnReadSample(_In_ HRESULT hrStatus
STDMETHODIMP_ (HRESULT) QueryInterface(const IID &riid
STDMETHODIMP_ (ULONG) AddRef()
STDMETHODIMP_ (HRESULT) OnFlush(_In_ DWORD dwStreamIndex)
void | StopSource ()

Public Attributes

_In_ DWORD _In_ DWORD | dwStreamFlags
_In_ DWORD | dwStreamIndex
_In_ DWORD _In_ DWORD _In_ LONGLONG | llTimestamp
_In_ DWORD _In_ DWORD _In_
LONGLONG _In_opt_ IMFSample * 		pSample

Private Member Functions

~MFSampleGenerator ()
HRESULT | AddSamplesToQueue (IMFSample *MFSample)
HRESULT | ConfigureStreams ()
HRESULT | CreateAudioType (IMFMediaType **MediaType)
Platform::Boolean | IsPreRollFilled ()

Private Attributes

IMFMediaType * | m_AudioMT
UINT32 | m_BytesPerPeriod
IRandomAccessStream | m_ContentStream
Platform::Boolean | m_IsInitialized
IMFSourceReader * | m_MFSourceReader
WAVEFORMATEX * | m_MixFormat
ReaderState m_ReaderState
volatile ULONG | m_Ref
RenderBuffer * m_SampleQueue
RenderBuffer ** m_SampleQueueTail

Detailed Description

Definition at line 33 of file MFSampleGenerator.h.

Member Enumeration Documentation

enum ReaderState
Enumerator:
ReaderStateStopped
ReaderStatePreRoll
ReaderStatePlaying
ReaderStateEOS

Definition at line 37 of file MFSampleGenerator.h.

            {
                ReaderStateStopped,
                ReaderStatePreRoll,
                ReaderStatePlaying,
                ReaderStateEOS
            };

Constructor & Destructor Documentation

MFSampleGenerator ( )

Definition at line 23 of file MFSampleGenerator.cpp.

                                     :
    m_Ref( 1 ),
    m_IsInitialized( false ),
    m_BytesPerPeriod( 0 ),
    m_ReaderState( ReaderStateStopped ),
    m_MFSourceReader( nullptr ),
    m_AudioMT( nullptr ),
    m_SampleQueue( nullptr ),
    m_SampleQueueTail( &m_SampleQueue )
{
}

~MFSampleGenerator ( ) [private]

Definition at line 38 of file MFSampleGenerator.cpp.

{
    Shutdown();
}

Member Function Documentation

HRESULT AddSamplesToQueue ( IMFSample * MFSample ) [private]

Definition at line 476 of file MFSampleGenerator.cpp.

{
    if (nullptr == MFSample)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;
    IMFMediaBuffer *MediaBuffer = nullptr;
    BYTE *AudioData = nullptr;
    DWORD cbAudioData = 0;

    // Since we are storing the raw byte data, convert this to a single buffer
    hr = MFSample->ConvertToContiguousBuffer( &MediaBuffer );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Lock the sample
    hr = MediaBuffer->Lock( &AudioData, NULL, &cbAudioData );
    if ( (FAILED( hr )) || (cbAudioData == 0) )
    {
        goto exit;
    }

    DWORD cbBytesCopied = 0;

    // First fill up any partial buffers from the previous sample
    if ( (*m_SampleQueueTail != nullptr) &&
         ((*m_SampleQueueTail)->BytesFilled < m_BytesPerPeriod) )
    {
        RenderBuffer *PartialBuffer = *m_SampleQueueTail;

        DWORD cbBytesRemaining = m_BytesPerPeriod - PartialBuffer->BytesFilled;
        DWORD cbBytesToCopy = min( cbAudioData, cbBytesRemaining );

        CopyMemory( PartialBuffer->Buffer + PartialBuffer->BytesFilled, AudioData, cbBytesToCopy );

        PartialBuffer->BytesFilled += cbBytesToCopy;
        cbBytesCopied += cbBytesToCopy;

        // Move the tail pointer only if we have filled the sample
        if (PartialBuffer->BytesFilled == m_BytesPerPeriod)
        {
            m_SampleQueueTail = &PartialBuffer->Next;
        }
    }

    // Create buffers for the remainder of the samples
    while( cbBytesCopied < cbAudioData )
    {
        RenderBuffer *SampleBuffer = new (std::nothrow) RenderBuffer();
        if (nullptr == SampleBuffer)
        {
            hr = E_OUTOFMEMORY;
            goto exit;
        }

        DWORD cbBytesRemaining = cbAudioData - cbBytesCopied;
        DWORD cbBufferLengthInBytes = min( m_BytesPerPeriod, cbBytesRemaining );

        SampleBuffer->Buffer = new (std::nothrow) BYTE[ m_BytesPerPeriod ];
        if (nullptr == SampleBuffer->Buffer)
        {
            SAFE_DELETE( SampleBuffer );
            hr = E_OUTOFMEMORY;
            goto exit;
        }

        SampleBuffer->BufferSize = m_BytesPerPeriod;
        SampleBuffer->BytesFilled = 0;

        ZeroMemory( SampleBuffer->Buffer, m_BytesPerPeriod );
        CopyMemory( SampleBuffer->Buffer, AudioData + cbBytesCopied, cbBufferLengthInBytes );

        SampleBuffer->BytesFilled += cbBufferLengthInBytes;
        cbBytesCopied += cbBufferLengthInBytes;

        *m_SampleQueueTail = SampleBuffer;

        // Move the tail pointer only if we have filled the sample otherwise will get filled the
        // next time we add sample data to the queue
        if (SampleBuffer->BytesFilled == m_BytesPerPeriod)
        {
            m_SampleQueueTail = &SampleBuffer->Next;
        }
    }

exit:
    // Unlock the buffer
    hr = MediaBuffer->Unlock();
    AudioData = nullptr;

    SAFE_RELEASE( MediaBuffer );
    return hr;
}

HRESULT ConfigureStreams ( ) [private]

Definition at line 196 of file MFSampleGenerator.cpp.

{
    HRESULT hr = S_OK;
    IMFMediaType *UncompressedMT = nullptr;
    IMFMediaType *PartialMT = nullptr;

    // Disable all streams
    hr = m_MFSourceReader->SetStreamSelection( MF_SOURCE_READER_ALL_STREAMS, false );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    // Enable first audio stream
    hr = m_MFSourceReader->SetStreamSelection( MF_SOURCE_READER_FIRST_AUDIO_STREAM, true );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    hr = CreateAudioType( &PartialMT );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    // Set type on source reader so necessary converters / decoders will be added
    hr = m_MFSourceReader->SetCurrentMediaType( MF_SOURCE_READER_FIRST_AUDIO_STREAM, nullptr, PartialMT );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    // Verify the media type on stream
    hr = m_MFSourceReader->GetCurrentMediaType( MF_SOURCE_READER_FIRST_AUDIO_STREAM, &UncompressedMT );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    WAVEFORMATEX *pwfx = NULL;
    UINT32 cbFormat = 0;
    hr = MFCreateWaveFormatExFromMFMediaType( UncompressedMT, &pwfx, &cbFormat );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    CoTaskMemFree( pwfx );

    m_AudioMT = UncompressedMT;
    m_AudioMT->AddRef();

exit:
    SAFE_RELEASE( UncompressedMT );
    SAFE_RELEASE( PartialMT );

    return hr;
}

HRESULT CreateAudioType ( IMFMediaType ** MediaType ) [private]

Definition at line 261 of file MFSampleGenerator.cpp.

{
    HRESULT hr = S_OK;
    IMFMediaType *MT = nullptr;

    // Create a partial media type for our mix format (PCM or IEEE Float)
    hr = MFCreateMediaType( &MT );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Set media type attributes
    hr = MT->SetGUID( MF_MT_MAJOR_TYPE, MFMediaType_Audio );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    switch (GetRenderSampleType(m_MixFormat))
    {
    case RenderSampleType::SampleType16BitPCM:
    case RenderSampleType::SampleType24in32BitPCM:
        hr = MT->SetGUID( MF_MT_SUBTYPE, MFAudioFormat_PCM );
        break;
    case RenderSampleType::SampleTypeFloat:
        hr = MT->SetGUID( MF_MT_SUBTYPE, MFAudioFormat_Float );
        break;
    default:
        hr = E_UNEXPECTED;
        break;
    }

    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_AUDIO_NUM_CHANNELS, m_MixFormat->nChannels );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_AUDIO_SAMPLES_PER_SECOND, m_MixFormat->nSamplesPerSec );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_AUDIO_BLOCK_ALIGNMENT, m_MixFormat->nBlockAlign );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_AUDIO_AVG_BYTES_PER_SECOND, m_MixFormat->nAvgBytesPerSec );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_AUDIO_BITS_PER_SAMPLE, m_MixFormat->wBitsPerSample );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = MT->SetUINT32( MF_MT_ALL_SAMPLES_INDEPENDENT, true );
    if (FAILED( hr ))
    {
        goto exit;
    }

    *MediaType = MT;
    (*MediaType)->AddRef();

exit:
    SAFE_RELEASE( MT );
    return hr;
}

HRESULT FillSampleBuffer | ( | UINT32 | BytesToRead,
 |  | BYTE * | Data,
 |  | UINT32 * | cbWritten
 | ) |  |

Definition at line 414 of file MFSampleGenerator.cpp.

{
    HRESULT hr = S_OK;
    *cbWritten = 0;

    if (nullptr == Data)
    {
        return E_POINTER;
    }

    if (!m_IsInitialized)
    {
        return E_UNEXPECTED;
    }

    // Not going to return any data here while in a pre-roll state.
    if (m_ReaderState == ReaderStatePreRoll)
        return S_OK;

    RenderBuffer *SampleBuffer = m_SampleQueue;
    if (nullptr == SampleBuffer)
    {
        if (m_ReaderState == ReaderStateEOS)
        {
            // We are EOS, should be set from OnReadSample() and the client should check for EOS before
            // calling FillSampleBuffer()
            hr = S_FALSE;
        }
        else
        {
            // There shouldn't be a situation where we get here unless the reader has
            // somehow gotten into the wrong state
            hr = E_FAIL;
        }
    }
    else
    {
        if (SampleBuffer->BufferSize > BytesToRead)
        {
            // We don't have enough data in the client audio buffer this pass
            // Do nothing and wait for the next sample period
            hr = S_OK;
        }
        else
        {
            CopyMemory( Data, SampleBuffer->Buffer, SampleBuffer->BufferSize );

            *cbWritten = SampleBuffer->BufferSize;
            m_SampleQueue = m_SampleQueue->Next;
            SAFE_DELETE( SampleBuffer );
            hr = S_OK;
        }
    }

    return hr;
}

void Flush ( )

Definition at line 46 of file MFSampleGenerator.cpp.

{
    while( m_SampleQueue != nullptr )
    {
        RenderBuffer *SampleBuffer = m_SampleQueue;
        m_SampleQueue = SampleBuffer->Next;
        SAFE_DELETE( SampleBuffer );
    }
}

HRESULT Initialize | ( | IRandomAccessStream^ | stream,
 |  | UINT32 | FramesPerPeriod,
 |  | WAVEFORMATEX * | wfx
 | ) |  |

Definition at line 117 of file MFSampleGenerator.cpp.

{
    HRESULT hr = S_OK;

    m_ContentStream = stream;
    m_MixFormat = wfx;
    IMFByteStream *ByteStream = nullptr;
    IMFAttributes *Attributes = nullptr;

    SAFE_RELEASE( m_AudioMT );
    SAFE_RELEASE( m_MFSourceReader );

    hr = MFCreateAttributes( &Attributes, 3 );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Specify Source Reader Attributes
    hr = Attributes->SetUnknown( MF_SOURCE_READER_ASYNC_CALLBACK, static_cast<IMFSourceReaderCallback *>(this) );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = Attributes->SetString( MF_READWRITE_MMCSS_CLASS_AUDIO, L"Audio" );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = Attributes->SetUINT32( MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0 );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Create a stream from IRandomAccessStream
    hr = MFCreateMFByteStreamOnStreamEx( reinterpret_cast<IUnknown*>(m_ContentStream), &ByteStream );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    // Create source reader
    hr = MFCreateSourceReaderFromByteStream( ByteStream, Attributes, &m_MFSourceReader );
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    // Configures media types
    hr = ConfigureStreams();
    if ( FAILED( hr ) )
    {
        goto exit;
    }

    m_BytesPerPeriod = FramesPerPeriod * m_MixFormat->nBlockAlign;
    m_IsInitialized = true;

exit:
    if ( FAILED( hr ) )
    {
        SAFE_RELEASE( m_AudioMT );
        SAFE_RELEASE( m_MFSourceReader );
    }

    SAFE_RELEASE( Attributes );
    SAFE_RELEASE( ByteStream );

    return hr;
}

Platform::Boolean IsEOF ( ) [inline]

Definition at line 94 of file MFSampleGenerator.h.

            {
                if ( ( m_SampleQueue == nullptr ) &&
                     ( m_ReaderState == ReaderStateEOS ) )
                    return true;

                return false;
            }

Platform::Boolean IsPreRollFilled ( ) [private]

Definition at line 579 of file MFSampleGenerator.cpp.

{
    DWORD TotalBytesFilled = 0;

    RenderBuffer *SampleBuffer = m_SampleQueue;
    while( SampleBuffer != nullptr )
    {
        TotalBytesFilled += SampleBuffer->BytesFilled;

        // For uncompressed formats, nAvgBytesPerSec should equal nSamplesPerSecond * nBlockAlign
        if (TotalBytesFilled >= (m_MixFormat->nAvgBytesPerSec * PREROLL_DURATION_SEC))
        {
            return true;
        }

        SampleBuffer = SampleBuffer->Next;
    }

    return false;
}

void Shutdown ( )

Definition at line 59 of file MFSampleGenerator.cpp.

{
    if (m_IsInitialized)
    {
        SAFE_RELEASE( m_AudioMT );
        SAFE_RELEASE( m_MFSourceReader );

        Flush();

        m_IsInitialized = false;
    }
}

HRESULT StartSource ( )

Definition at line 77 of file MFSampleGenerator.cpp.

{
    if (!m_IsInitialized)
        return E_UNEXPECTED;

    // We can be in EOS if this is a resume from pause
    if ( (m_ReaderState == ReaderStatePreRoll) ||
         (m_ReaderState == ReaderStatePlaying) ||
         (m_ReaderState == ReaderStateEOS) )
        return S_FALSE;

    HRESULT hr = S_OK;

    // This will start the source reader and asynchronously call OnReadSample
    hr = m_MFSourceReader->ReadSample( MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, nullptr, nullptr, nullptr, nullptr );
    if (SUCCEEDED( hr ))
    {
        m_ReaderState = ReaderStatePreRoll;
    }

    return hr;
}

STDMETHODIMP_ ( HRESULT )
STDMETHODIMP_ ( HRESULT ) const
STDMETHODIMP_ ( HRESULT )
STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 53 of file MFSampleGenerator.h.

            {
                LONG ref = InterlockedDecrement(&m_Ref);

                if (ref == 0)
                {
                    delete this;
                }

                return ref;
            }

STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 48 of file MFSampleGenerator.h.

            {
                return InterlockedIncrement(&m_Ref);
            }

void StopSource ( )

Definition at line 105 of file MFSampleGenerator.cpp.

{
    // We only really need this if Source is still reading samples, otherwise
    // we should be in an EOS state and parsing existing samples in the queue
    m_ReaderState = ReaderStateStopped;
}

Member Data Documentation

_In_ DWORD _In_ DWORD dwStreamFlags

Definition at line 83 of file MFSampleGenerator.h.

_In_ DWORD dwStreamIndex

Definition at line 83 of file MFSampleGenerator.h.

_In_ DWORD _In_ DWORD _In_ LONGLONG llTimestamp

Definition at line 83 of file MFSampleGenerator.h.

IMFMediaType* m_AudioMT [private]

Definition at line 119 of file MFSampleGenerator.h.

UINT32 m_BytesPerPeriod [private]

Definition at line 115 of file MFSampleGenerator.h.

IRandomAccessStream m_ContentStream [private]

Definition at line 113 of file MFSampleGenerator.h.

Platform::Boolean m_IsInitialized [private]

Definition at line 116 of file MFSampleGenerator.h.

IMFSourceReader* m_MFSourceReader [private]

Definition at line 118 of file MFSampleGenerator.h.

WAVEFORMATEX* m_MixFormat [private]

Definition at line 114 of file MFSampleGenerator.h.

ReaderState m_ReaderState [private]

Definition at line 120 of file MFSampleGenerator.h.

volatile ULONG m_Ref [private]

Definition at line 112 of file MFSampleGenerator.h.

RenderBuffer* m_SampleQueue [private]

Definition at line 122 of file MFSampleGenerator.h.

RenderBuffer** m_SampleQueueTail [private]

Definition at line 123 of file MFSampleGenerator.h.

_In_ DWORD _In_ DWORD _In_ LONGLONG _In_opt_ IMFSample* pSample

Definition at line 83 of file MFSampleGenerator.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cpp/MFSampleGenerator.h
  • WindowsAudioSession/cpp/MFSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • sealed
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "DeviceState.h"

List of all members.

Public Member Functions

DeviceStateChangedEvent ()
DeviceState GetState ()
internal HRESULT | m_hr (hr)
internal UINT32 | m_Size (size)
PlotDataReadyEvent ()
Scenario1 ()
Scenario2 ()
Scenario3 ()
Scenario4 ()

Public Attributes

internal | __pad0__: DeviceStateChangedEventArgs( DeviceState newState
internal HRESULT | hr: m_DeviceState( newState )
internal Platform::Array< int, 1 > | points
internal | points
internal UINT32 | size: m_PointArray( points )

Static Public Attributes

static event
DeviceStateChangedHandler 		StateChangedEvent

Protected Member Functions

virtual void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

Properties

HRESULT | m_hr

Private Member Functions

~Scenario2 ()
~Scenario3 ()
~Scenario4 ()
void | btnFilePicker_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnFilePicker_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPause_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPause_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPlay_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPlay_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPlayPause_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnPlayPause_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnStartCapture_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnStop_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnStop_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | btnStopCapture_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Enumerate_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | EnumerateAudioDevicesAsync ()
void | InitializeCapture (Object^sender, Object^e)
void | InitializeDevice ()
void | InitializeDevice ()
void | MediaButtonPressed (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^e)
void | MediaButtonPressed (Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^e)
void | OnDeviceStateChange (Object^sender, DeviceStateChangedEventArgs^e)
void | OnDeviceStateChange (Object^sender, DeviceStateChangedEventArgs^e)
void | OnDeviceStateChange (Object^sender, DeviceStateChangedEventArgs^e)
void | OnPickFileAsync ()
void | OnPickFileAsync ()
void | OnPlotDataReady (Object^sender, PlotDataReadyEventArgs^e)
void | OnSetVolume (UINT32 volume)
void | OnSetVolume (UINT32 volume)
void | PauseDevice ()
void | PauseDevice ()
void | PlayPauseToggleDevice ()
void | PlayPauseToggleDevice ()
void | radioFile_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | radioFile_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | radioTone_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | radioTone_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ShowStatusMessage (Platform::String^str, NotifyType messageType)
void | ShowStatusMessage (Platform::String^str, NotifyType messageType)
void | ShowStatusMessage (Platform::String^str, NotifyType messageType)
void | ShowStatusMessage (Platform::String^str, NotifyType messageType)
void | sliderFrequency_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | sliderFrequency_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | sliderVolume_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | sliderVolume_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)
void | StartDevice ()
void | StartDevice ()
void | StopCapture (Object^sender, Object^e)
void | StopDevice ()
void | StopDevice ()
void | UpdateContentProps (Platform::String^str)
void | UpdateContentProps (Platform::String^str)
void | UpdateContentUI (Platform::Boolean disableAll)
void | UpdateContentUI (Platform::Boolean disableAll)
void | UpdateMediaControlUI (DeviceState deviceState)
void | UpdateMediaControlUI (DeviceState deviceState)
void | UpdateMediaControlUI (DeviceState deviceState)

Private Attributes

IRandomAccessStream | m_ContentStream
ContentType m_ContentType
Windows::UI::Core::CoreDispatcher | m_CoreDispatcher
Windows::UI::Xaml::Controls::ListBox | m_DevicesList
DeviceState m_DeviceState
Windows::Foundation::EventRegistrationToken | m_deviceStateChangeToken
Platform::Boolean | m_deviceSupportsRawMode
int | m_DiscontinuityCount
Platform::Boolean | m_IsLowLatency
Platform::Boolean | m_IsMFLoaded
Platform::Boolean | m_IsMinimumLatency
Windows::UI::Xaml::Shapes::Polyline | m_Oscilloscope
Windows::Foundation::EventRegistrationToken | m_plotDataReadyToken
Platform::Array< int, 1 > | m_PointArray
UINT32 | m_Size
ComPtr< WASAPICapture > | m_spCapture
ComPtr< WASAPIRenderer > | m_spRenderer
DeviceStateChangedEvent | m_StateChangedEvent
Windows::Media::SystemMediaTransportControls | m_SystemMediaControls
Windows::Foundation::EventRegistrationToken | m_SystemMediaControlsButtonToken
MainPage rootPage

Detailed Description

Definition at line 45 of file DeviceState.h.

Constructor & Destructor Documentation

~Scenario2 ( ) [private]
~Scenario3 ( ) [private]
~Scenario4 ( ) [private]

Member Function Documentation

void btnFilePicker_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnFilePicker_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPause_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPause_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPlay_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPlay_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPlayPause_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnPlayPause_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnStartCapture_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnStop_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnStop_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void btnStopCapture_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
DeviceStateChangedEvent ( ) [inline]

Definition at line 75 of file DeviceState.h.

                                      :
                m_DeviceState( DeviceState::DeviceStateUnInitialized )
            {};

void Enumerate_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void EnumerateAudioDevicesAsync ( ) [private]
DeviceState GetState ( ) [inline]

Definition at line 79 of file DeviceState.h.

{ return m_DeviceState; };

void InitializeCapture | ( | Object^ | sender,
 |  | Object^ | e |
 | ) |  |  | [private]
void InitializeDevice ( ) [private]
void InitializeDevice ( ) [private]
internal HRESULT m_hr ( hr ) [inline]

Definition at line 50 of file DeviceState.h.

            {};

internal UINT32 m_Size ( size ) [inline]

Definition at line 31 of file PlotData.h.

            {};

void MediaButtonPressed | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^ | e |
 | ) |  |  | [private]
void MediaButtonPressed | ( | Windows::Media::SystemMediaTransportControls^ | sender,
 |  | Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^ | e |
 | ) |  |  | [private]
void OnDeviceStateChange | ( | Object^ | sender,
 |  | DeviceStateChangedEventArgs^ | e |
 | ) |  |  | [private]
void OnDeviceStateChange | ( | Object^ | sender,
 |  | DeviceStateChangedEventArgs^ | e |
 | ) |  |  | [private]
void OnDeviceStateChange | ( | Object^ | sender,
 |  | DeviceStateChangedEventArgs^ | e |
 | ) |  |  | [private]
virtual void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
void OnPickFileAsync ( ) [private]
void OnPickFileAsync ( ) [private]
void OnPlotDataReady | ( | Object^ | sender,
 |  | PlotDataReadyEventArgs^ | e |
 | ) |  |  | [private]
void OnSetVolume ( UINT32 volume ) [private]
void OnSetVolume ( UINT32 volume ) [private]
void PauseDevice ( ) [private]
void PauseDevice ( ) [private]
void PlayPauseToggleDevice ( ) [private]
void PlayPauseToggleDevice ( ) [private]
PlotDataReadyEvent ( ) [inline]

Definition at line 56 of file PlotData.h.

{};

void radioFile_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void radioFile_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void radioTone_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void radioTone_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
Scenario4 ( )
void ShowStatusMessage | ( | Platform::String^ | str,
 |  | NotifyType | messageType |
 | ) |  |  | [private]
void ShowStatusMessage | ( | Platform::String^ | str,
 |  | NotifyType | messageType |
 | ) |  |  | [private]
void ShowStatusMessage | ( | Platform::String^ | str,
 |  | NotifyType | messageType |
 | ) |  |  | [private]
void ShowStatusMessage | ( | Platform::String^ | str,
 |  | NotifyType | messageType |
 | ) |  |  | [private]
void sliderFrequency_ValueChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e |
 | ) |  |  | [private]
void sliderFrequency_ValueChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e |
 | ) |  |  | [private]
void sliderVolume_ValueChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e |
 | ) |  |  | [private]
void sliderVolume_ValueChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ | e |
 | ) |  |  | [private]
void StartDevice ( ) [private]
void StartDevice ( ) [private]
void StopCapture | ( | Object^ | sender,
 |  | Object^ | e |
 | ) |  |  | [private]
void StopDevice ( ) [private]
void StopDevice ( ) [private]
void UpdateContentProps ( Platform::String^ str ) [private]
void UpdateContentProps ( Platform::String^ str ) [private]
void UpdateContentUI ( Platform::Boolean disableAll ) [private]
void UpdateContentUI ( Platform::Boolean disableAll ) [private]
void UpdateMediaControlUI ( DeviceState deviceState ) [private]
void UpdateMediaControlUI ( DeviceState deviceState ) [private]
void UpdateMediaControlUI ( DeviceState deviceState ) [private]

Member Data Documentation

internal __pad0__

Definition at line 48 of file DeviceState.h.

internal HRESULT hr

Definition at line 48 of file DeviceState.h.

IRandomAccessStream m_ContentStream [private]

Definition at line 80 of file Scenario2.xaml.h.

ContentType m_ContentType [private]

Definition at line 81 of file Scenario2.xaml.h.

Windows::UI::Core::CoreDispatcher m_CoreDispatcher [private]

Definition at line 74 of file Scenario2.xaml.h.

Windows::UI::Xaml::Controls::ListBox m_DevicesList [private]

Definition at line 47 of file Scenario1.xaml.h.

DeviceState m_DeviceState [private]

Definition at line 99 of file DeviceState.h.

Windows::Foundation::EventRegistrationToken m_deviceStateChangeToken [private]

Definition at line 76 of file Scenario2.xaml.h.

Platform::Boolean m_deviceSupportsRawMode [private]

Definition at line 84 of file Scenario2.xaml.h.

int m_DiscontinuityCount [private]

Definition at line 70 of file Scenario4.xaml.h.

Platform::Boolean m_IsLowLatency [private]

Definition at line 72 of file Scenario4.xaml.h.

Platform::Boolean m_IsMFLoaded [private]

Definition at line 79 of file Scenario2.xaml.h.

Platform::Boolean m_IsMinimumLatency [private]

Definition at line 85 of file Scenario3.xaml.h.

Windows::UI::Xaml::Shapes::Polyline m_Oscilloscope [private]

Definition at line 65 of file Scenario4.xaml.h.

Windows::Foundation::EventRegistrationToken m_plotDataReadyToken [private]

Definition at line 68 of file Scenario4.xaml.h.

Platform::Array<int,1> m_PointArray [private]

Definition at line 32 of file PlotData.h.

UINT32 m_Size [private]

Definition at line 46 of file PlotData.h.

ComPtr<WASAPICapture> m_spCapture [private]

Definition at line 74 of file Scenario4.xaml.h.

ComPtr< WASAPIRenderer > m_spRenderer [private]

Definition at line 83 of file Scenario2.xaml.h.

DeviceStateChangedEvent m_StateChangedEvent [private]

Definition at line 82 of file Scenario2.xaml.h.

Windows::Media::SystemMediaTransportControls m_SystemMediaControls [private]

Definition at line 75 of file Scenario2.xaml.h.

Windows::Foundation::EventRegistrationToken m_SystemMediaControlsButtonToken [private]

Definition at line 77 of file Scenario2.xaml.h.

internal Platform::Array<int, 1> points

Definition at line 56 of file PlotData.h.

internal points

Definition at line 29 of file PlotData.h.

MainPage rootPage [private]

Definition at line 46 of file Scenario1.xaml.h.

internal UINT32 size

Definition at line 29 of file PlotData.h.

event DeviceStateChangedHandler StateChangedEvent [static]

Definition at line 79 of file DeviceState.h.

Property Documentation

HRESULT m_hr

Definition at line 51 of file DeviceState.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cpp/DeviceState.h
  • WindowsAudioSession/cpp/PlotData.h
  • WindowsAudioSession/cpp/Scenario1.xaml.h
  • WindowsAudioSession/cpp/Scenario2.xaml.h
  • WindowsAudioSession/cpp/Scenario3.xaml.h
  • WindowsAudioSession/cpp/Scenario4.xaml.h
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToneSampleGenerator Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • ToneSampleGenerator
Public Member Functions | Private Member Functions | Private Attributes

ToneSampleGenerator Class Reference

#include "ToneSampleGenerator.h"

List of all members.

Public Member Functions

ToneSampleGenerator ()
~ToneSampleGenerator ()
HRESULT | FillSampleBuffer (UINT32 BytesToRead, BYTE *Data)
void | Flush ()
HRESULT | GenerateSampleBuffer (DWORD Frequency, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx)
UINT32 | GetBufferLength ()
Platform::Boolean | IsEOF ()

Private Member Functions

template<typename T >
void | GenerateSineSamples (BYTE *Buffer, size_t BufferLength, DWORD Frequency, WORD ChannelCount, DWORD SamplesPerSecond, double Amplitude, double *InitialTheta)

Private Attributes

RenderBuffer * m_SampleQueue
RenderBuffer ** m_SampleQueueTail

Detailed Description

Definition at line 28 of file ToneSampleGenerator.h.

Constructor & Destructor Documentation

ToneSampleGenerator ( )

Definition at line 53 of file ToneSampleGenerator.cpp.

{
    m_SampleQueue = nullptr;
    m_SampleQueueTail = &m_SampleQueue;
}

~ToneSampleGenerator ( )

Definition at line 62 of file ToneSampleGenerator.cpp.

{
    // Flush unused samples
    Flush();
}

Member Function Documentation

HRESULT FillSampleBuffer | ( | UINT32 | BytesToRead,
 |  | BYTE * | Data
 | ) |  |

Definition at line 164 of file ToneSampleGenerator.cpp.

{
    if (nullptr == Data)
    {
        return E_POINTER;
    }

    RenderBuffer *SampleBuffer = m_SampleQueue;

    if (BytesToRead > SampleBuffer->BufferSize)
    {
        return E_INVALIDARG;
    }

    CopyMemory( Data, SampleBuffer->Buffer, BytesToRead );

    m_SampleQueue = m_SampleQueue->Next;
    SAFE_DELETE(SampleBuffer);

    return S_OK;
}

void Flush ( )

Definition at line 191 of file ToneSampleGenerator.cpp.

{
    while( m_SampleQueue != nullptr )
    {
        RenderBuffer *SampleBuffer = m_SampleQueue;
        m_SampleQueue = SampleBuffer->Next;
        SAFE_DELETE( SampleBuffer );
    }
}

HRESULT GenerateSampleBuffer | ( | DWORD | Frequency,
 |  | UINT32 | FramesPerPeriod,
 |  | WAVEFORMATEX * | wfx
 | ) |  |

Definition at line 73 of file ToneSampleGenerator.cpp.

{
    HRESULT hr = S_OK;

    UINT32 renderBufferSizeInBytes = FramesPerPeriod * wfx->nBlockAlign;
    UINT64 renderDataLength = ( wfx->nSamplesPerSec * TONE_DURATION_SEC * wfx->nBlockAlign ) + ( renderBufferSizeInBytes - 1 );
    UINT64 renderBufferCount = renderDataLength / renderBufferSizeInBytes;

    double theta = 0;

    for( UINT64 i = 0; i < renderBufferCount; i++ )
    {
        RenderBuffer *SampleBuffer = new (std::nothrow) RenderBuffer();
        if (nullptr == SampleBuffer)
        {
            return E_OUTOFMEMORY;
        }

        SampleBuffer->BufferSize = renderBufferSizeInBytes;
        SampleBuffer->BytesFilled = renderBufferSizeInBytes;
        SampleBuffer->Buffer = new (std::nothrow) BYTE[ renderBufferSizeInBytes ];
        if (nullptr == SampleBuffer->Buffer)
        {
            return E_OUTOFMEMORY;
        }

        switch(GetRenderSampleType( wfx ) )
        {
        case RenderSampleType::SampleType16BitPCM:
            GenerateSineSamples<short>( SampleBuffer->Buffer, SampleBuffer->BufferSize, Frequency, wfx->nChannels, wfx->nSamplesPerSec, TONE_AMPLITUDE, &theta);
            break;

        case RenderSampleType::SampleType24in32BitPCM:
            GenerateSineSamples<int24in32>(SampleBuffer->Buffer, SampleBuffer->BufferSize, Frequency, wfx->nChannels, wfx->nSamplesPerSec, TONE_AMPLITUDE, &theta);
            break;

        case RenderSampleType::SampleTypeFloat:
            GenerateSineSamples<float>( SampleBuffer->Buffer, SampleBuffer->BufferSize, Frequency, wfx->nChannels, wfx->nSamplesPerSec, TONE_AMPLITUDE, &theta);
            break;

        default:
            return E_UNEXPECTED;
            break;
        }

        *m_SampleQueueTail = SampleBuffer;
        m_SampleQueueTail = &SampleBuffer->Next;
    }
    return hr;
}

void GenerateSineSamples | ( | BYTE * | Buffer,
 |  | size_t | BufferLength,
 |  | DWORD | Frequency,
 |  | WORD | ChannelCount,
 |  | DWORD | SamplesPerSecond,
 |  | double | Amplitude,
 |  | double * | InitialTheta |
 | ) |  |  | [private]

Definition at line 137 of file ToneSampleGenerator.cpp.

{
    double sampleIncrement = (Frequency * (M_PI*2)) / (double)SamplesPerSecond;
    T *dataBuffer = reinterpret_cast<T *>(Buffer);
    double theta = (InitialTheta != NULL ? *InitialTheta : 0);

    for (size_t i = 0 ; i < BufferLength / sizeof(T) ; i += ChannelCount)
    {
        double sinValue = Amplitude * sin( theta );
        for(size_t j = 0 ;j < ChannelCount; j++)
        {
            dataBuffer[i+j] = Convert<T>(sinValue);
        }
        theta += sampleIncrement;
    }

    if (InitialTheta != NULL)
    {
        *InitialTheta = theta;
    }
}

UINT32 GetBufferLength ( ) [inline]

Definition at line 35 of file ToneSampleGenerator.h.

{ return (m_SampleQueue !=  nullptr ? m_SampleQueue->BufferSize : 0 ); };

Platform::Boolean IsEOF ( ) [inline]

Definition at line 34 of file ToneSampleGenerator.h.

{ return (m_SampleQueue == nullptr);  };

Member Data Documentation

RenderBuffer* m_SampleQueue [private]

Definition at line 46 of file ToneSampleGenerator.h.

RenderBuffer** m_SampleQueueTail [private]

Definition at line 47 of file ToneSampleGenerator.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cpp/ToneSampleGenerator.h
  • WindowsAudioSession/cpp/ToneSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WASAPICapture Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • WASAPICapture
Public Member Functions | Private Member Functions | Private Attributes

WASAPICapture Class Reference

#include "WASAPICapture.h"

List of all members.

Public Member Functions

WASAPICapture ()
STDMETHOD() | ActivateCompleted (IActivateAudioInterfaceAsyncOperation *operation)
HRESULT | FinishCaptureAsync ()
DeviceStateChangedEvent | GetDeviceStateEvent ()
HRESULT | InitializeAudioDeviceAsync ()
METHODASYNCCALLBACK (WASAPICapture, StartCapture, OnStartCapture)
METHODASYNCCALLBACK (WASAPICapture, StopCapture, OnStopCapture)
METHODASYNCCALLBACK (WASAPICapture, SendScopeData, OnSendScopeData)
METHODASYNCCALLBACK (WASAPICapture, SampleReady, OnSampleReady)
METHODASYNCCALLBACK (WASAPICapture, FinishCapture, OnFinishCapture)
HRESULT | SetProperties (CAPTUREDEVICEPROPS props)
HRESULT | StartCaptureAsync ()
HRESULT | StopCaptureAsync ()

Private Member Functions

~WASAPICapture ()
HRESULT | CreateWAVFile ()
HRESULT | FixWAVHeader ()
HRESULT | InitializeScopeData ()
HRESULT | OnAudioSampleRequested (Platform::Boolean IsSilence=false)
HRESULT | OnFinishCapture (IMFAsyncResult *pResult)
HRESULT | OnSampleReady (IMFAsyncResult *pResult)
HRESULT | OnSendScopeData (IMFAsyncResult *pResult)
HRESULT | OnStartCapture (IMFAsyncResult *pResult)
HRESULT | OnStopCapture (IMFAsyncResult *pResult)
HRESULT | ProcessScopeData (BYTE *pData, DWORD cbBytes)

Private Attributes

IAudioCaptureClient * | m_AudioCaptureClient
IAudioClient3 * | m_AudioClient
UINT32 | m_BufferFrames
DWORD | m_cbDataSize
DWORD | m_cbFlushCounter
DWORD | m_cbHeaderSize
IRandomAccessStream | m_ContentStream
UINT32 | m_cPlotDataFilled
UINT32 | m_cPlotDataMax
CRITICAL_SECTION | m_CritSec
UINT32 | m_DefaultPeriodInFrames
Platform::String | m_DeviceIdString
CAPTUREDEVICEPROPS m_DeviceProps
DeviceStateChangedEvent | m_DeviceStateChanged
DWORD | m_dwQueueID
UINT32 | m_FundamentalPeriodInFrames
BOOL | m_fWriting
UINT32 | m_MaxPeriodInFrames
UINT32 | m_MinPeriodInFrames
WAVEFORMATEX * | m_MixFormat
IOutputStream | m_OutputStream
Platform::Array< int, 1 > | m_PlotData
IMFAsyncResult * | m_SampleReadyAsyncResult
HANDLE | m_SampleReadyEvent
MFWORKITEM_KEY | m_SampleReadyKey
DataWriter | m_WAVDataWriter

Detailed Description

Definition at line 45 of file WASAPICapture.h.

Constructor & Destructor Documentation

WASAPICapture ( )

Definition at line 27 of file WASAPICapture.cpp.

                             :
    m_BufferFrames( 0 ),
    m_cbDataSize( 0 ),
    m_cbHeaderSize( 0 ),
    m_cbFlushCounter( 0 ),
    m_dwQueueID( 0 ),
    m_DeviceStateChanged( nullptr ),
    m_AudioClient( nullptr ),
    m_AudioCaptureClient( nullptr ),
    m_SampleReadyAsyncResult( nullptr ),
    m_ContentStream( nullptr ),
    m_OutputStream( nullptr ),
    m_WAVDataWriter( nullptr ),
    m_PlotData( nullptr ),
    m_fWriting( false )
{
    // Create events for sample ready or user stop
    m_SampleReadyEvent = CreateEventEx( nullptr, nullptr, 0, EVENT_ALL_ACCESS );
    if (nullptr == m_SampleReadyEvent)
    {
        ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
    }

    if (!InitializeCriticalSectionEx( &m_CritSec, 0, 0 ))
    {
        ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
    }

    m_DeviceStateChanged = ref new DeviceStateChangedEvent();

    // Register MMCSS work queue
    HRESULT hr = S_OK;
    DWORD dwTaskID = 0;

    hr = MFLockSharedWorkQueue( L"Capture", 0, &dwTaskID, &m_dwQueueID );
    if (FAILED( hr ))
    {
        ThrowIfFailed( hr );
    }

    // Set the capture event work queue to use the MMCSS queue
    m_xSampleReady.SetQueueID( m_dwQueueID );
}

~WASAPICapture ( ) [private]

Definition at line 74 of file WASAPICapture.cpp.

{
    SAFE_RELEASE( m_AudioClient );
    SAFE_RELEASE( m_AudioCaptureClient );
    SAFE_RELEASE( m_SampleReadyAsyncResult );

    if (INVALID_HANDLE_VALUE != m_SampleReadyEvent)
    {
        CloseHandle( m_SampleReadyEvent );
        m_SampleReadyEvent = INVALID_HANDLE_VALUE;
    }

    MFUnlockWorkQueue( m_dwQueueID );
    CoTaskMemFree( m_MixFormat );

    m_DeviceStateChanged = nullptr;
    m_ContentStream = nullptr;
    m_OutputStream = nullptr;
    m_WAVDataWriter = nullptr;

    m_PlotData = nullptr;

    DeleteCriticalSection( &m_CritSec );
}

Member Function Documentation

HRESULT ActivateCompleted ( IActivateAudioInterfaceAsyncOperation * operation )

Definition at line 130 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;
    HRESULT hrActivateResult = S_OK;
    ComPtr<IUnknown> punkAudioInterface;

    // Check for a successful activation result
    hr = operation->GetActivateResult( &hrActivateResult, &punkAudioInterface );
    if (FAILED( hr ))
    {
        goto exit;
    }

    hr = hrActivateResult;
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Get the pointer for the Audio Client
    punkAudioInterface.CopyTo( &m_AudioClient );
    if (nullptr == m_AudioClient)
    {
        hr = E_NOINTERFACE;
        goto exit;
    }

    hr = m_AudioClient->GetMixFormat( &m_MixFormat );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // convert from Float to 16-bit PCM
    switch ( m_MixFormat->wFormatTag )
    {
    case WAVE_FORMAT_PCM:
        // nothing to do
        break;

    case WAVE_FORMAT_IEEE_FLOAT:
        m_MixFormat->wFormatTag = WAVE_FORMAT_PCM;
        m_MixFormat->wBitsPerSample = 16;
        m_MixFormat->nBlockAlign = m_MixFormat->nChannels * m_MixFormat->wBitsPerSample / BITS_PER_BYTE;
        m_MixFormat->nAvgBytesPerSec = m_MixFormat->nSamplesPerSec * m_MixFormat->nBlockAlign;
        break;

    case WAVE_FORMAT_EXTENSIBLE:
        {
            WAVEFORMATEXTENSIBLE *pWaveFormatExtensible = reinterpret_cast<WAVEFORMATEXTENSIBLE *>(m_MixFormat);
            if ( pWaveFormatExtensible->SubFormat == KSDATAFORMAT_SUBTYPE_PCM )
            {
                // nothing to do
            }
            else if ( pWaveFormatExtensible->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT )
            {
                pWaveFormatExtensible->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
                pWaveFormatExtensible->Format.wBitsPerSample = 16;
                pWaveFormatExtensible->Format.nBlockAlign =
                    pWaveFormatExtensible->Format.nChannels *
                    pWaveFormatExtensible->Format.wBitsPerSample /
                    BITS_PER_BYTE;
                pWaveFormatExtensible->Format.nAvgBytesPerSec =
                    pWaveFormatExtensible->Format.nSamplesPerSec *
                    pWaveFormatExtensible->Format.nBlockAlign;
                pWaveFormatExtensible->Samples.wValidBitsPerSample =
                    pWaveFormatExtensible->Format.wBitsPerSample;

                // leave the channel mask as-is
            }
            else
            {
                // we can only handle float or PCM
                hr = HRESULT_FROM_WIN32( ERROR_NOT_FOUND );
            }
            break;
        }

    default:
        // we can only handle float or PCM
        hr = HRESULT_FROM_WIN32( ERROR_NOT_FOUND );
        break;
    }

    if (FAILED( hr ))
    {
        goto exit;
    }

    // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
    // to be the current engine format based on the processing mode for this stream
    hr = m_AudioClient->GetSharedModeEnginePeriod(m_MixFormat, &m_DefaultPeriodInFrames, &m_FundamentalPeriodInFrames, &m_MinPeriodInFrames, &m_MaxPeriodInFrames);
    if (FAILED(hr))
    {
        goto exit;
    }

    // Initialize the AudioClient in Shared Mode with the user specified buffer
    if (m_DeviceProps.IsLowLatency == false)
    {
        hr = m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
            AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
            200000,
            0,
            m_MixFormat,
            nullptr);
    }
    else
    {
        hr = m_AudioClient->InitializeSharedAudioStream(
            AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
            m_MinPeriodInFrames,
            m_MixFormat,
            nullptr);
    }

    if (FAILED( hr ))
    {
        goto exit;
    }

    // Get the maximum size of the AudioClient Buffer
    hr = m_AudioClient->GetBufferSize( &m_BufferFrames );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Get the capture client
    hr = m_AudioClient->GetService( __uuidof(IAudioCaptureClient), (void**) &m_AudioCaptureClient );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Create Async callback for sample events
    hr = MFCreateAsyncResult( nullptr, &m_xSampleReady, nullptr, &m_SampleReadyAsyncResult );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Sets the event handle that the system signals when an audio buffer is ready to be processed by the client
    hr = m_AudioClient->SetEventHandle( m_SampleReadyEvent );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Create the visualization array
    hr = InitializeScopeData();
    if (FAILED( hr ))
    {
        goto exit;
    }

    // Creates the WAV file.  If successful, will set the Initialized event
    hr = CreateWAVFile();
    if (FAILED( hr ))
    {
        goto exit;
    }

exit:
    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
        SAFE_RELEASE( m_AudioClient );
        SAFE_RELEASE( m_AudioCaptureClient );
        SAFE_RELEASE( m_SampleReadyAsyncResult );
    }

    // Need to return S_OK
    return S_OK;
}

HRESULT CreateWAVFile ( ) [private]

Definition at line 312 of file WASAPICapture.cpp.

{
    // Create the WAV file, appending a number if file already exists
    concurrency::task<StorageFile^>( KnownFolders::MusicLibrary->CreateFileAsync( AUDIO_FILE_NAME, CreationCollisionOption::GenerateUniqueName )).then(
        [this]( StorageFile^ file )
    {
        return file->OpenAsync( FileAccessMode::ReadWrite );
    })

    // Then create a RandomAccessStream
    .then([this]( IRandomAccessStream^ stream )
    {
        // Get the OutputStream for the file
        m_ContentStream = stream;
        m_OutputStream = m_ContentStream->GetOutputStreamAt(0);

        // Create the DataWriter
        m_WAVDataWriter = ref new DataWriter( m_OutputStream );

        // Create the WAV header
        DWORD header[] = {
            FCC('RIFF'),        // RIFF header
            0,                  // Total size of WAV (will be filled in later)
            FCC('WAVE'),        // WAVE FourCC
            FCC('fmt '),        // Start of 'fmt ' chunk
            sizeof(WAVEFORMATEX) + m_MixFormat->cbSize      // Size of fmt chunk
        };

        DWORD data[] = { FCC('data'), 0 };  // Start of 'data' chunk

        auto headerBytes = ref new Platform::Array<BYTE>( reinterpret_cast<BYTE*>(header), sizeof(header) );
        auto formatBytes = ref new Platform::Array<BYTE>( reinterpret_cast<BYTE*>(m_MixFormat), sizeof(WAVEFORMATEX) + m_MixFormat->cbSize );
        auto dataBytes = ref new Platform::Array<BYTE>( reinterpret_cast<BYTE*>(data), sizeof(data) );

        if ( (nullptr == headerBytes) || (nullptr == formatBytes) || (nullptr == dataBytes) )
        {
            ThrowIfFailed( E_OUTOFMEMORY );
        }

        // Write the header
        m_WAVDataWriter->WriteBytes( headerBytes );
        m_WAVDataWriter->WriteBytes( formatBytes );
        m_WAVDataWriter->WriteBytes( dataBytes );

        return m_WAVDataWriter->StoreAsync();
    })

    // Wait for file data to be written to file
    .then([this]( unsigned int BytesWritten )
    {
        m_cbHeaderSize = BytesWritten;
        return m_WAVDataWriter->FlushAsync();
    })

    // Our file is ready to go, so we can now signal that initialization is finished
    .then([this]( concurrency::task<bool> previousTask )
    {
        try
        {
            previousTask.get();
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateInitialized, S_OK, true );
        }
        catch (Platform::Exception ^e)
        {
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, e->HResult, true );
        }
    });

    return S_OK;
}

HRESULT FinishCaptureAsync ( )

Definition at line 562 of file WASAPICapture.cpp.

{
    // We should be flushing when this is called
    if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateFlushing)
    {
        return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xFinishCapture, nullptr );
    }

    // We are in the wrong state
    return E_NOT_VALID_STATE;
}

HRESULT FixWAVHeader ( ) [private]

Definition at line 388 of file WASAPICapture.cpp.

{
    auto DataSizeByte = ref new Platform::Array<BYTE>( reinterpret_cast<BYTE*>( &m_cbDataSize ), sizeof(DWORD) );

    // Write the size of the 'data' chunk first
    IOutputStream^ OutputStream = m_ContentStream->GetOutputStreamAt( m_cbHeaderSize - sizeof(DWORD) );
    m_WAVDataWriter = ref new DataWriter( OutputStream );
    m_WAVDataWriter->WriteBytes( DataSizeByte );

    concurrency::task<unsigned int>( m_WAVDataWriter->StoreAsync()).then(
        [this]( unsigned int BytesWritten )
    {
        DWORD cbTotalSize = m_cbDataSize + m_cbHeaderSize - 8;
        auto TotalSizeByte = ref new Platform::Array<BYTE>( reinterpret_cast<BYTE*>( &cbTotalSize ), sizeof(DWORD) );

        // Write the total file size, minus RIFF chunk and size
        IOutputStream^ OutputStream = m_ContentStream->GetOutputStreamAt( sizeof(DWORD) );  // sizeof(DWORD) == sizeof(FOURCC)
        m_WAVDataWriter = ref new DataWriter( OutputStream );
        m_WAVDataWriter->WriteBytes( TotalSizeByte );

        concurrency::task<unsigned int>( m_WAVDataWriter->StoreAsync()).then(
            [this]( unsigned int BytesWritten )
        {
            return m_WAVDataWriter->FlushAsync();
        })

        .then(
            [this]( bool f )
        {
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopped, S_OK, true );
        });
    });

    return S_OK;
}

DeviceStateChangedEvent GetDeviceStateEvent ( ) [inline]

Definition at line 57 of file WASAPICapture.h.

{ return m_DeviceStateChanged; };

HRESULT InitializeAudioDeviceAsync ( )

Definition at line 105 of file WASAPICapture.cpp.

{
    ComPtr<IActivateAudioInterfaceAsyncOperation> asyncOp;
    HRESULT hr = S_OK;

    // Get a string representing the Default Audio Capture Device
    m_DeviceIdString = MediaDevice::GetDefaultAudioCaptureId( Windows::Media::Devices::AudioDeviceRole::Default );

    // This call must be made on the main UI thread.  Async operation will call back to
    // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
    hr = ActivateAudioInterfaceAsync( m_DeviceIdString->Data(), __uuidof(IAudioClient3), nullptr, this, &asyncOp );
    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    return hr;
}

HRESULT InitializeScopeData ( ) [private]

Definition at line 429 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;

    m_cPlotDataFilled = 0;
    m_cPlotDataMax = (MILLISECONDS_TO_VISUALIZE * m_MixFormat->nSamplesPerSec) / 1000;

    m_PlotData = ref new Platform::Array<int, 1>( m_cPlotDataMax + 1 );
    if (nullptr == m_PlotData)
    {
        return E_OUTOFMEMORY;
    }

    // Only Support 16 bit Audio for now
    if (m_MixFormat->wBitsPerSample == 16)
    {
        m_PlotData[ m_cPlotDataMax ] = -32768;  // INT16_MAX
    }
    else
    {
        m_PlotData = nullptr;
        hr = S_FALSE;
    }

    return hr;
}

METHODASYNCCALLBACK | ( | WASAPICapture | ,
 |  | SampleReady | ,
 |  | OnSampleReady |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPICapture | ,
 |  | StopCapture | ,
 |  | OnStopCapture |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPICapture | ,
 |  | FinishCapture | ,
 |  | OnFinishCapture |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPICapture | ,
 |  | SendScopeData | ,
 |  | OnSendScopeData |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPICapture | ,
 |  | StartCapture | ,
 |  | OnStartCapture |
 | ) |  |
HRESULT OnAudioSampleRequested ( Platform::Boolean IsSilence = false ) [private]

Definition at line 618 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;
    UINT32 FramesAvailable = 0;
    BYTE *Data = nullptr;
    DWORD dwCaptureFlags;
    UINT64 u64DevicePosition = 0;
    UINT64 u64QPCPosition = 0;
    DWORD cbBytesToCapture = 0;

    EnterCriticalSection( &m_CritSec );

    // If this flag is set, we have already queued up the async call to finialize the WAV header
    // So we don't want to grab or write any more data that would possibly give us an invalid size
    if ( (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateStopping) ||
         (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateFlushing) )
    {
        goto exit;
    }

    // A word on why we have a loop here;
    // Suppose it has been 10 milliseconds or so since the last time
    // this routine was invoked, and that we're capturing 48000 samples per second.
    //
    // The audio engine can be reasonably expected to have accumulated about that much
    // audio data - that is, about 480 samples.
    //
    // However, the audio engine is free to accumulate this in various ways:
    // a. as a single packet of 480 samples, OR
    // b. as a packet of 80 samples plus a packet of 400 samples, OR
    // c. as 48 packets of 10 samples each.
    //
    // In particular, there is no guarantee that this routine will be
    // run once for each packet.
    //
    // So every time this routine runs, we need to read ALL the packets
    // that are now available;
    //
    // We do this by calling IAudioCaptureClient::GetNextPacketSize
    // over and over again until it indicates there are no more packets remaining.
    for
    (
        hr = m_AudioCaptureClient->GetNextPacketSize(&FramesAvailable);
        SUCCEEDED(hr) && FramesAvailable > 0;
        hr = m_AudioCaptureClient->GetNextPacketSize(&FramesAvailable)
    )
    {
        cbBytesToCapture = FramesAvailable * m_MixFormat->nBlockAlign;

        // WAV files have a 4GB (0xFFFFFFFF) size limit, so likely we have hit that limit when we
        // overflow here.  Time to stop the capture
        if ( (m_cbDataSize + cbBytesToCapture) < m_cbDataSize )
        {
            StopCaptureAsync();
            goto exit;
        }

        // Get sample buffer
        hr = m_AudioCaptureClient->GetBuffer( &Data, &FramesAvailable, &dwCaptureFlags, &u64DevicePosition, &u64QPCPosition );
        if (FAILED( hr ))
        {
            goto exit;
        }

        if (dwCaptureFlags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY)
        {
            // Pass down a discontinuity flag in case the app is interested and reset back to capturing
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateDiscontinuity, S_OK, true );
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateCapturing, S_OK, false );
        }

        // Zero out sample if silence
        if ( (dwCaptureFlags & AUDCLNT_BUFFERFLAGS_SILENT) || IsSilence )
        {
            memset( Data, 0, FramesAvailable * m_MixFormat->nBlockAlign );
        }

        // Store data in array
        auto dataByte = ref new Platform::Array<BYTE, 1>( Data, cbBytesToCapture );

        // Release buffer back
        m_AudioCaptureClient->ReleaseBuffer( FramesAvailable );

        // Update plotter data
        ProcessScopeData( dataByte->Data, dataByte->Length );

        // Write File and async store
        m_WAVDataWriter->WriteBytes( dataByte );

        // Increase the size of our 'data' chunk and flush counter.  m_cbDataSize needs to be accurate
        // Its OK if m_cbFlushCounter is an approximation
        m_cbDataSize += cbBytesToCapture;
        m_cbFlushCounter += cbBytesToCapture;

        if ( (m_cbFlushCounter > ( m_MixFormat->nAvgBytesPerSec * FLUSH_INTERVAL_SEC )) && !m_fWriting )
        {
            // Set this flag when about to commit the async storage operation.  We don't want to
            // accidently call stop and finalize the WAV header or run into a scenario where the
            // store operation takes longer than FLUSH_INTERVAL_SEC as multiple concurrent calls
            // to StoreAsync() can cause an exception
            m_fWriting = true;

            // Reset the counter now since we can process more samples during the async callback
            m_cbFlushCounter = 0;

            concurrency::task<unsigned int>( m_WAVDataWriter->StoreAsync()).then(
                [this]( unsigned int BytesWritten )
            {
                m_fWriting = false;

                // We need to check for StopCapture while we are flusing the file.  If it has come through, then we
                // can go ahead and call FinisheCaptureAsync() to write the WAV header
                if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateStopping)
                {
                    m_DeviceStateChanged->SetState( DeviceState::DeviceStateFlushing, S_OK, true );
                    FinishCaptureAsync();
                }
            });
        }
    }

exit:
    LeaveCriticalSection( &m_CritSec );

    return hr;
}

HRESULT OnFinishCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 580 of file WASAPICapture.cpp.

{
    // FixWAVHeader will set the DeviceStateStopped when all async tasks are complete
    return FixWAVHeader();
}

HRESULT OnSampleReady ( IMFAsyncResult * pResult ) [private]

Definition at line 591 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;

    hr = OnAudioSampleRequested( false );

    if (SUCCEEDED( hr ))
    {
        // Re-queue work item for next sample
        if (m_DeviceStateChanged->GetState() ==  DeviceState::DeviceStateCapturing)
        {
            hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
        }
    }
    else
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    return hr;
}

HRESULT OnSendScopeData ( IMFAsyncResult * pResult ) [private]

Definition at line 797 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;
    CAsyncState *pState = nullptr;

    hr = pResult->GetState( reinterpret_cast<IUnknown**>(&pState) );
    if (SUCCEEDED( hr ))
    {
        PlotDataReadyEvent::SendEvent( reinterpret_cast<Platform::Object^>(this), pState->m_Data , pState->m_Size );
    }

    SAFE_RELEASE( pState );

    return S_OK;
}

HRESULT OnStartCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 481 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;

    // Start the capture
    hr = m_AudioClient->Start();
    if (SUCCEEDED( hr ))
    {
        hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
    }

    if (SUCCEEDED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateCapturing, S_OK, true );
    }
    else
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    return S_OK;
}

HRESULT OnStopCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 527 of file WASAPICapture.cpp.

{
    // Stop capture by cancelling Work Item
    // Cancel the queued work item (if any)
    if (0 != m_SampleReadyKey)
    {
        MFCancelWorkItem( m_SampleReadyKey );
        m_SampleReadyKey = 0;
    }

    m_AudioClient->Stop();
    SAFE_RELEASE( m_SampleReadyAsyncResult );

    // If this is set, it means we writing from the memory buffer to the actual file asynchronously
    // Since a second call to StoreAsync() can cause an exception, don't queue this now, but rather
    // let the async operation completion handle the call.
    if (!m_fWriting)
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateFlushing, S_OK, true );

        concurrency::task<unsigned int>( m_WAVDataWriter->StoreAsync()).then(
            [this]( unsigned int BytesWritten )
        {
            FinishCaptureAsync();
        });
    }

    return S_OK;
}

HRESULT ProcessScopeData | ( | BYTE * | pData,
 |  | DWORD | cbBytes |
 | ) |  |  | [private]

Definition at line 750 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;

    // We don't have a valid pointer array, so return.  This could be the case if we aren't
    // dealing with 16-bit audio
    if (m_PlotData == nullptr)
    {
        return S_FALSE;
    }

    DWORD dwNumPoints = cbBytes / m_MixFormat->nChannels / (m_MixFormat->wBitsPerSample / 8);

    // Read the 16-bit samples from channel 0
    INT16 *pi16 = (INT16*)pData;

    for ( DWORD i = 0; m_cPlotDataFilled < m_cPlotDataMax && i < dwNumPoints; i++ )
    {
        m_PlotData[ m_cPlotDataFilled ] = *pi16;
        pi16 += m_MixFormat->nChannels;

        m_cPlotDataFilled++;
    }

    // Send off the event and get ready for the next set of samples
    if (m_cPlotDataFilled == m_cPlotDataMax)
    {
        ComPtr<IUnknown> spUnknown;
        ComPtr<CAsyncState> spState = Make<CAsyncState>( m_PlotData, m_cPlotDataMax + 1 );

        hr = spState.As( &spUnknown );
        if (SUCCEEDED( hr ))
        {
            MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xSendScopeData, spUnknown.Get() );
        }

        m_cPlotDataFilled = 0;
    }

    return hr;
}

HRESULT SetProperties ( CAPTUREDEVICEPROPS props )

Definition at line 818 of file WASAPICapture.cpp.

{
    m_DeviceProps = props;
    return S_OK;
}

HRESULT StartCaptureAsync ( )

Definition at line 461 of file WASAPICapture.cpp.

{
    HRESULT hr = S_OK;

    // We should be in the initialzied state if this is the first time through getting ready to capture.
    if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateInitialized)
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateStarting, S_OK, true );
        return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStartCapture, nullptr );
    }

    // We are in the wrong state
    return E_NOT_VALID_STATE;
}

HRESULT StopCaptureAsync ( )

Definition at line 509 of file WASAPICapture.cpp.

{
    if ( (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateCapturing) &&
         (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateInError) )
    {
        return E_NOT_VALID_STATE;
    }

    m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopping, S_OK, true );

    return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStopCapture, nullptr );
}

Member Data Documentation

IAudioCaptureClient* m_AudioCaptureClient [private]

Definition at line 105 of file WASAPICapture.h.

IAudioClient3* m_AudioClient [private]

Definition at line 100 of file WASAPICapture.h.

UINT32 m_BufferFrames [private]

Definition at line 85 of file WASAPICapture.h.

DWORD m_cbDataSize [private]

Definition at line 92 of file WASAPICapture.h.

DWORD m_cbFlushCounter [private]

Definition at line 93 of file WASAPICapture.h.

DWORD m_cbHeaderSize [private]

Definition at line 91 of file WASAPICapture.h.

IRandomAccessStream m_ContentStream [private]

Definition at line 96 of file WASAPICapture.h.

UINT32 m_cPlotDataFilled [private]

Definition at line 112 of file WASAPICapture.h.

UINT32 m_cPlotDataMax [private]

Definition at line 111 of file WASAPICapture.h.

CRITICAL_SECTION m_CritSec [private]

Definition at line 88 of file WASAPICapture.h.

UINT32 m_DefaultPeriodInFrames [private]

Definition at line 101 of file WASAPICapture.h.

Platform::String m_DeviceIdString [private]

Definition at line 84 of file WASAPICapture.h.

CAPTUREDEVICEPROPS m_DeviceProps [private]

Definition at line 114 of file WASAPICapture.h.

DeviceStateChangedEvent m_DeviceStateChanged [private]

Definition at line 108 of file WASAPICapture.h.

DWORD m_dwQueueID [private]

Definition at line 89 of file WASAPICapture.h.

UINT32 m_FundamentalPeriodInFrames [private]

Definition at line 102 of file WASAPICapture.h.

BOOL m_fWriting [private]

Definition at line 94 of file WASAPICapture.h.

UINT32 m_MaxPeriodInFrames [private]

Definition at line 103 of file WASAPICapture.h.

UINT32 m_MinPeriodInFrames [private]

Definition at line 104 of file WASAPICapture.h.

WAVEFORMATEX* m_MixFormat [private]

Definition at line 99 of file WASAPICapture.h.

IOutputStream m_OutputStream [private]

Definition at line 97 of file WASAPICapture.h.

Platform::Array<int, 1> m_PlotData [private]

Definition at line 110 of file WASAPICapture.h.

IMFAsyncResult* m_SampleReadyAsyncResult [private]

Definition at line 106 of file WASAPICapture.h.

HANDLE m_SampleReadyEvent [private]

Definition at line 86 of file WASAPICapture.h.

MFWORKITEM_KEY m_SampleReadyKey [private]

Definition at line 87 of file WASAPICapture.h.

DataWriter m_WAVDataWriter [private]

Definition at line 98 of file WASAPICapture.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cpp/WASAPICapture.h
  • WindowsAudioSession/cpp/WASAPICapture.cpp
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WASAPIRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKSample
  • WASAPIAudio
  • WASAPIRenderer
Public Member Functions | Private Member Functions | Private Attributes

WASAPIRenderer Class Reference

#include "WASAPIRenderer.h"

List of all members.

Public Member Functions

WASAPIRenderer ()
STDMETHOD() | ActivateCompleted (IActivateAudioInterfaceAsyncOperation *operation)
DeviceStateChangedEvent | GetDeviceStateEvent ()
HRESULT | InitializeAudioDeviceAsync ()
METHODASYNCCALLBACK (WASAPIRenderer, StartPlayback, OnStartPlayback)
METHODASYNCCALLBACK (WASAPIRenderer, StopPlayback, OnStopPlayback)
METHODASYNCCALLBACK (WASAPIRenderer, PausePlayback, OnPausePlayback)
METHODASYNCCALLBACK (WASAPIRenderer, SampleReady, OnSampleReady)
HRESULT | PausePlaybackAsync ()
HRESULT | SetProperties (DEVICEPROPS props)
HRESULT | SetVolumeOnSession (UINT32 volume)
HRESULT | StartPlaybackAsync ()
HRESULT | StopPlaybackAsync ()

Private Member Functions

~WASAPIRenderer ()
HRESULT | ConfigureDeviceInternal ()
HRESULT | ConfigureSource ()
UINT32 | GetBufferFramesPerPeriod ()
HRESULT | GetMFSample (UINT32 FramesAvailable)
HRESULT | GetToneSample (UINT32 FramesAvailable)
HRESULT | OnAudioSampleRequested (Platform::Boolean IsSilence=false)
HRESULT | OnPausePlayback (IMFAsyncResult *pResult)
HRESULT | OnSampleReady (IMFAsyncResult *pResult)
HRESULT | OnStartPlayback (IMFAsyncResult *pResult)
HRESULT | OnStopPlayback (IMFAsyncResult *pResult)
HRESULT | SetAudioClientChannelVolume ()
HRESULT | ValidateBufferValue ()

Private Attributes

IAudioClient3 * | m_AudioClient
IAudioRenderClient * | m_AudioRenderClient
UINT32 | m_BufferFrames
float | m_ChannelVolume
CRITICAL_SECTION | m_CritSec
UINT32 | m_DefaultPeriodInFrames
Platform::String | m_DeviceIdString
DEVICEPROPS m_DeviceProps
DeviceStateChangedEvent | m_DeviceStateChanged
UINT32 | m_FundamentalPeriodInFrames
UINT32 | m_MaxPeriodInFrames
MFSampleGenerator * m_MFSource
UINT32 | m_MinPeriodInFrames
WAVEFORMATEX * | m_MixFormat
IMFAsyncResult * | m_SampleReadyAsyncResult
HANDLE | m_SampleReadyEvent
MFWORKITEM_KEY | m_SampleReadyKey
ToneSampleGenerator * m_ToneSource

Detailed Description

Definition at line 58 of file WASAPIRenderer.h.

Constructor & Destructor Documentation

WASAPIRenderer ( )

Definition at line 24 of file WASAPIRenderer.cpp.

                               :
    m_BufferFrames( 0 ),
    m_ChannelVolume( 1.0f ),
    m_DeviceStateChanged( nullptr ),
    m_AudioClient( nullptr ),
    m_AudioRenderClient( nullptr ),
    m_SampleReadyAsyncResult( nullptr ),
    m_ToneSource( nullptr ),
    m_MFSource( nullptr )
{
    // Create events for sample ready or user stop
    m_SampleReadyEvent = CreateEventEx( nullptr, nullptr, 0, EVENT_ALL_ACCESS );
    if (nullptr == m_SampleReadyEvent)
    {
        ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
    }

    if (!InitializeCriticalSectionEx( &m_CritSec, 0, 0 ))
    {
        ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
    }

    m_DeviceStateChanged = ref new DeviceStateChangedEvent();
    if (nullptr == m_DeviceStateChanged)
    {
        ThrowIfFailed( E_OUTOFMEMORY );
    }
}

~WASAPIRenderer ( ) [private]

Definition at line 56 of file WASAPIRenderer.cpp.

{
    SAFE_RELEASE( m_AudioClient );
    SAFE_RELEASE( m_AudioRenderClient );
    SAFE_RELEASE( m_SampleReadyAsyncResult );
    SAFE_RELEASE( m_MFSource );
    SAFE_DELETE( m_ToneSource );

    if (INVALID_HANDLE_VALUE != m_SampleReadyEvent)
    {
        CloseHandle( m_SampleReadyEvent );
        m_SampleReadyEvent = INVALID_HANDLE_VALUE;
    }

    DeleteCriticalSection( &m_CritSec );

    CoTaskMemFree( m_MixFormat );

    m_DeviceStateChanged = nullptr;
}

Member Function Documentation

HRESULT ActivateCompleted ( IActivateAudioInterfaceAsyncOperation * operation )

Definition at line 110 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;
    HRESULT hrActivateResult = S_OK;
    IUnknown *punkAudioInterface = nullptr;

    if (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateUnInitialized)
    {
        hr = E_NOT_VALID_STATE;
        goto exit;
    }

    // Check for a successful activation result
    hr = operation->GetActivateResult( &hrActivateResult, &punkAudioInterface );
    if (SUCCEEDED( hr ) && SUCCEEDED( hrActivateResult ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateActivated, S_OK, false );

        // Get the pointer for the Audio Client
        punkAudioInterface->QueryInterface( IID_PPV_ARGS(&m_AudioClient) );
        if( nullptr == m_AudioClient )
        {
            hr = E_FAIL;
            goto exit;
        }

        // Configure user defined properties
        hr = ConfigureDeviceInternal();
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Initialize the AudioClient in Shared Mode with the user specified buffer
        if (!m_DeviceProps.IsLowLatency || m_DeviceProps.IsHWOffload)
        {
            hr = m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                m_DeviceProps.hnsBufferDuration,
                m_DeviceProps.hnsBufferDuration,
                m_MixFormat,
                nullptr);
        }
        else
        {
            hr = m_AudioClient->InitializeSharedAudioStream(
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                m_MinPeriodInFrames,
                m_MixFormat,
                nullptr);
        }
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Get the maximum size of the AudioClient Buffer
        hr = m_AudioClient->GetBufferSize( &m_BufferFrames );
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Get the render client
        hr = m_AudioClient->GetService( __uuidof(IAudioRenderClient), (void**) &m_AudioRenderClient );
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Create Async callback for sample events
        hr = MFCreateAsyncResult( nullptr, &m_xSampleReady, nullptr, &m_SampleReadyAsyncResult );
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Sets the event handle that the system signals when an audio buffer is ready to be processed by the client
        hr = m_AudioClient->SetEventHandle( m_SampleReadyEvent );
        if (FAILED( hr ))
        {
            goto exit;
        }

        // Everything succeeded
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInitialized, S_OK, true );

    }

exit:
    SAFE_RELEASE( punkAudioInterface );

    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
        SAFE_RELEASE( m_AudioClient );
        SAFE_RELEASE( m_AudioRenderClient );
        SAFE_RELEASE( m_SampleReadyAsyncResult );
    }

    // Need to return S_OK
    return S_OK;
}

HRESULT ConfigureDeviceInternal ( ) [private]

Definition at line 261 of file WASAPIRenderer.cpp.

{
    if (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateActivated)
    {
        return E_NOT_VALID_STATE;
    }

    HRESULT hr = S_OK;

    // Opt into HW Offloading.  If the endpoint does not support offload it will return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE
    AudioClientProperties audioProps = {0};
    audioProps.cbSize = sizeof( AudioClientProperties );
    audioProps.bIsOffload = m_DeviceProps.IsHWOffload;
    audioProps.eCategory = AudioCategory_Media;

    if (m_DeviceProps.IsRawChosen && m_DeviceProps.IsRawSupported)
    {
        audioProps.Options = AUDCLNT_STREAMOPTIONS_RAW;
    }

    hr = m_AudioClient->SetClientProperties( &audioProps );
    if (FAILED( hr ))
    {
        return hr;
    }

    // If application already has a preferred source format available,
    // it can test whether the format is supported by the device:
    //
    // WAVEFORMATEX* applicationFormat = ...;
    // if (S_OK == m_AudioClient->IsFormatSupported(applicationFormat))
    // {
    //     m_MixFormat = applicationFormat;
    // }
    // else
    // {
    //     //device does not support the application format, so ask the device what format it prefers
    //     m_AudioClient->GetMixFormat( &m_MixFormat );
    // }

    // In this sample we do not have a format already available, so we go ahead and ask the device which format it prefers
    // This sample opens the device is shared mode so we need to find the supported WAVEFORMATEX mix format
    hr = m_AudioClient->GetMixFormat( &m_MixFormat );
    if (FAILED( hr ))
    {
        return hr;
    }

    if (!audioProps.bIsOffload)
    {
        // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
        // to be the current engine format based on the processing mode for this stream
        hr = m_AudioClient->GetSharedModeEnginePeriod(m_MixFormat, &m_DefaultPeriodInFrames, &m_FundamentalPeriodInFrames, &m_MinPeriodInFrames, &m_MaxPeriodInFrames);
        if (FAILED(hr))
        {
            return hr;
        }
    }

    // Verify the user defined value for hardware buffer
    hr = ValidateBufferValue();

    return hr;
}

HRESULT ConfigureSource ( ) [private]

Definition at line 406 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;
    UINT32 FramesPerPeriod = GetBufferFramesPerPeriod();

    if (m_DeviceProps.IsTonePlayback)
    {
        // Generate the sine wave sample buffer
        m_ToneSource = new ToneSampleGenerator();
        if (m_ToneSource)
        {
            hr = m_ToneSource->GenerateSampleBuffer( m_DeviceProps.Frequency, FramesPerPeriod, m_MixFormat );
        }
        else
        {
            hr = E_OUTOFMEMORY;
        }
    }
    else
    {
        m_MFSource = new MFSampleGenerator();
        if (m_MFSource)
        {
            hr = m_MFSource->Initialize( m_DeviceProps.ContentStream, FramesPerPeriod, m_MixFormat );
        }
        else
        {
            hr = E_OUTOFMEMORY;
        }
    }

    return hr;
}

UINT32 GetBufferFramesPerPeriod ( ) [private]

Definition at line 230 of file WASAPIRenderer.cpp.

{
    REFERENCE_TIME defaultDevicePeriod = 0;
    REFERENCE_TIME minimumDevicePeriod = 0;

    if (m_DeviceProps.IsHWOffload)
    {
        return m_BufferFrames;
    }

    if (m_DeviceProps.IsLowLatency)
    {
        return m_MinPeriodInFrames;
    }

    // Get the audio device period
    HRESULT hr = m_AudioClient->GetDevicePeriod( &defaultDevicePeriod, &minimumDevicePeriod);
    if (FAILED( hr ))
    {
        return 0;
    }

    double devicePeriodInSeconds = defaultDevicePeriod / (10000.0*1000.0);
    return static_cast<UINT32>( m_MixFormat->nSamplesPerSec * devicePeriodInSeconds + 0.5 );
}

DeviceStateChangedEvent GetDeviceStateEvent ( ) [inline]

Definition at line 71 of file WASAPIRenderer.h.

{ return m_DeviceStateChanged; };

HRESULT GetMFSample ( UINT32 FramesAvailable ) [private]

Definition at line 755 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;
    BYTE *Data = nullptr;

    // Post-Roll Silence
    if (m_MFSource->IsEOF())
    {
        hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
        if (SUCCEEDED( hr ))
        {
            // Ignore the return
            hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
        }

        StopPlaybackAsync();
    }
    else
    {
        UINT32 ActualBytesRead = 0;
        UINT32 ActualBytesToRead = FramesAvailable * m_MixFormat->nBlockAlign;

        hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
        if (SUCCEEDED( hr ))
        {
            hr = m_MFSource->FillSampleBuffer( ActualBytesToRead, Data, &ActualBytesRead );
            if (hr == S_FALSE)
            {
                // Hit EOS
                hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
                StopPlaybackAsync();
            }
            else if (SUCCEEDED( hr ))
            {
                // This can happen if we are pre-rolling so just insert silence
                if (0 == ActualBytesRead)
                {
                    hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
                }
                else
                {
                    hr = m_AudioRenderClient->ReleaseBuffer( ( ActualBytesRead / m_MixFormat->nBlockAlign ), 0 );
                }
            }
        }
    }

    return hr;
}

HRESULT GetToneSample ( UINT32 FramesAvailable ) [private]

Definition at line 714 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;
    BYTE *Data;

    // Post-Roll Silence
    if (m_ToneSource->IsEOF())
    {
        hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
        if (SUCCEEDED( hr ))
        {
            // Ignore the return
            hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
        }

        StopPlaybackAsync();
    }
    else if (m_ToneSource->GetBufferLength() <= ( FramesAvailable * m_MixFormat->nBlockAlign ))
    {
        UINT32 ActualFramesToRead = m_ToneSource->GetBufferLength() / m_MixFormat->nBlockAlign;
        UINT32 ActualBytesToRead = ActualFramesToRead * m_MixFormat->nBlockAlign;

        hr = m_AudioRenderClient->GetBuffer( ActualFramesToRead, &Data );
        if (SUCCEEDED( hr ))
        {
            hr = m_ToneSource->FillSampleBuffer( ActualBytesToRead, Data );
            if (SUCCEEDED( hr ))
            {
                hr = m_AudioRenderClient->ReleaseBuffer( ActualFramesToRead, 0 );
            }
        }
    }

    return hr;
}

HRESULT InitializeAudioDeviceAsync ( )

Definition at line 83 of file WASAPIRenderer.cpp.

{
    IActivateAudioInterfaceAsyncOperation *asyncOp;
    HRESULT hr = S_OK;

    // Get a string representing the Default Audio Device Renderer
    m_DeviceIdString = MediaDevice::GetDefaultAudioRenderId( Windows::Media::Devices::AudioDeviceRole::Default );

   // This call must be made on the main UI thread.  Async operation will call back to
    // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
    hr = ActivateAudioInterfaceAsync( m_DeviceIdString->Data(), __uuidof(IAudioClient3), nullptr, this, &asyncOp );
    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    SAFE_RELEASE( asyncOp );

    return hr;
}

METHODASYNCCALLBACK | ( | WASAPIRenderer | ,
 |  | StartPlayback | ,
 |  | OnStartPlayback |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPIRenderer | ,
 |  | StopPlayback | ,
 |  | OnStopPlayback |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPIRenderer | ,
 |  | PausePlayback | ,
 |  | OnPausePlayback |
 | ) |  |
METHODASYNCCALLBACK | ( | WASAPIRenderer | ,
 |  | SampleReady | ,
 |  | OnSampleReady |
 | ) |  |
HRESULT OnAudioSampleRequested ( Platform::Boolean IsSilence = false ) [private]

Definition at line 639 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;
    UINT32 PaddingFrames = 0;
    UINT32 FramesAvailable = 0;

    EnterCriticalSection( &m_CritSec );

    // Get padding in existing buffer
    hr = m_AudioClient->GetCurrentPadding( &PaddingFrames );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // GetCurrentPadding represents the number of queued frames
    // so we can subtract that from the overall number of frames we have
    FramesAvailable = m_BufferFrames - PaddingFrames;

    // Only continue if we have buffer to write data
    if (FramesAvailable > 0)
    {
        if (IsSilence)
        {
            BYTE *Data;

            // Fill the buffer with silence
            hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
            if (FAILED( hr ))
            {
                goto exit;
            }

            hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
            goto exit;
        }

        // Even if we cancel a work item, this may still fire due to the async
        // nature of things.  There should be a queued work item already to handle
        // the process of stopping or stopped
        if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStatePlaying)
        {
            // Fill the buffer with a playback sample
            if (m_DeviceProps.IsTonePlayback)
            {
                hr = GetToneSample( FramesAvailable );
            }
            else
            {
                hr = GetMFSample( FramesAvailable );
            }
        }
    }

exit:
    LeaveCriticalSection( &m_CritSec );

    if (AUDCLNT_E_RESOURCES_INVALIDATED == hr)
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateUnInitialized, hr, false );
        SAFE_RELEASE( m_AudioClient );
        SAFE_RELEASE( m_AudioRenderClient );
        SAFE_RELEASE( m_SampleReadyAsyncResult );

        hr = InitializeAudioDeviceAsync();
    }

    return hr;
}

HRESULT OnPausePlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 600 of file WASAPIRenderer.cpp.

{
    m_AudioClient->Stop();
    m_DeviceStateChanged->SetState( DeviceState::DeviceStatePaused, S_OK, true );
    return S_OK;
}

HRESULT OnSampleReady ( IMFAsyncResult * pResult ) [private]

Definition at line 612 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;

    hr = OnAudioSampleRequested( false );

    if (SUCCEEDED( hr ))
    {
        // Re-queue work item for next sample
        if (m_DeviceStateChanged->GetState() ==  DeviceState::DeviceStatePlaying)
        {
            hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
        }
    }
    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    return hr;
}

HRESULT OnStartPlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 479 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;

    // Pre-Roll the buffer with silence
    hr = OnAudioSampleRequested( true );
    if (FAILED( hr ))
    {
        goto exit;
    }

    // For MF Source playback, need to start the source reader
    if (!m_DeviceProps.IsTonePlayback)
    {
        hr = m_MFSource->StartSource();
        if (FAILED( hr ))
        {
            goto exit;
        }
    }

    // Set the initial volume.
    SetAudioClientChannelVolume();

    // Actually start the playback
    hr = m_AudioClient->Start();
    if (SUCCEEDED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStatePlaying, S_OK, true );
        hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
    }

exit:
    if (FAILED( hr ))
    {
        m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
    }

    return S_OK;
}

HRESULT OnStopPlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 544 of file WASAPIRenderer.cpp.

{
    // Stop playback by cancelling Work Item
    // Cancel the queued work item (if any)
    if (0 != m_SampleReadyKey)
    {
        MFCancelWorkItem( m_SampleReadyKey );
        m_SampleReadyKey = 0;
    }

    // Flush anything left in buffer with silence
    OnAudioSampleRequested( true );

    m_AudioClient->Stop();
    SAFE_RELEASE( m_SampleReadyAsyncResult );

    if (m_DeviceProps.IsTonePlayback)
    {
        // Flush remaining buffers
        m_ToneSource->Flush();
    }
    else
    {
        // Stop Source and Flush remaining buffers
        m_MFSource->StopSource();
        m_MFSource->Shutdown();
    }

    m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopped, S_OK, true );
    return S_OK;
}

HRESULT PausePlaybackAsync ( )

Definition at line 581 of file WASAPIRenderer.cpp.

{
    if ( (m_DeviceStateChanged->GetState() !=  DeviceState::DeviceStatePlaying) &&
         (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateInError) )
    {
        return E_NOT_VALID_STATE;
    }

    // Change state to stop automatic queueing of samples
    m_DeviceStateChanged->SetState( DeviceState::DeviceStatePausing, S_OK, false );
    return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xPausePlayback, nullptr );

}

HRESULT SetAudioClientChannelVolume ( ) [private]

Definition at line 384 of file WASAPIRenderer.cpp.

{
    ISimpleAudioVolume* SessionAudioVolume = nullptr;
    HRESULT hr = m_AudioClient->GetService(__uuidof(ISimpleAudioVolume), reinterpret_cast<void**>(&SessionAudioVolume));
    if (FAILED(hr))
    {
        goto exit;
    }

    // Set the session volume on the endpoint
    hr = SessionAudioVolume->SetMasterVolume( m_ChannelVolume, nullptr );

exit:
    SAFE_RELEASE( SessionAudioVolume );
    return hr;
}

HRESULT SetProperties ( DEVICEPROPS props )

Definition at line 219 of file WASAPIRenderer.cpp.

{
    m_DeviceProps = props;
    return S_OK;
}

HRESULT SetVolumeOnSession ( UINT32 volume )

Definition at line 366 of file WASAPIRenderer.cpp.

{
    if (volume > 100)
    {
        return E_INVALIDARG;
    }

    HRESULT hr = S_OK;
    m_ChannelVolume = volume / (float)100.0;

    // Set the session volume on the endpoint if we have one.
    if (m_AudioClient != nullptr)
    {
        hr = SetAudioClientChannelVolume();
    }
    return hr;
}

HRESULT StartPlaybackAsync ( )

Definition at line 445 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;

    // We should be stopped if the user stopped playback, or we should be
    // initialzied if this is the first time through getting ready to playback.
    if ( (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateStopped) ||
         (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateInitialized) )
    {
        // Setup either ToneGeneration or File Playback
        hr = ConfigureSource();
        if (FAILED( hr ))
        {
            m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
            return hr;
        }

        m_DeviceStateChanged->SetState( DeviceState::DeviceStateStarting, S_OK, true );
        return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStartPlayback, nullptr );
    }
    else if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStatePaused)
    {
        return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStartPlayback, nullptr );
    }

    // Otherwise something else happened
    return E_FAIL;
}

HRESULT StopPlaybackAsync ( )

Definition at line 525 of file WASAPIRenderer.cpp.

{
    if ( (m_DeviceStateChanged->GetState() != DeviceState::DeviceStatePlaying) &&
         (m_DeviceStateChanged->GetState() != DeviceState::DeviceStatePaused) &&
         (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateInError) )
    {
        return E_NOT_VALID_STATE;
    }

    m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopping, S_OK, true );

    return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStopPlayback, nullptr );
}

HRESULT ValidateBufferValue ( ) [private]

Definition at line 331 of file WASAPIRenderer.cpp.

{
    HRESULT hr = S_OK;

    if (!m_DeviceProps.IsHWOffload)
    {
        // If we aren't using HW Offload, set this to 0 to use the default value
        m_DeviceProps.hnsBufferDuration = 0;
        return hr;
    }

    REFERENCE_TIME hnsMinBufferDuration;
    REFERENCE_TIME hnsMaxBufferDuration;

    hr = m_AudioClient->GetBufferSizeLimits( m_MixFormat, true, &hnsMinBufferDuration, &hnsMaxBufferDuration );
    if (SUCCEEDED( hr ))
    {
        if (m_DeviceProps.hnsBufferDuration < hnsMinBufferDuration)
        {
            // using MINIMUM size instead
            m_DeviceProps.hnsBufferDuration = hnsMinBufferDuration;
        }
        else if (m_DeviceProps.hnsBufferDuration > hnsMaxBufferDuration)
        {
            // using MAXIMUM size instead
            m_DeviceProps.hnsBufferDuration = hnsMaxBufferDuration;
        }
    }

    return hr;
}

Member Data Documentation

IAudioClient3* m_AudioClient [private]

Definition at line 113 of file WASAPIRenderer.h.

IAudioRenderClient* m_AudioRenderClient [private]

Definition at line 114 of file WASAPIRenderer.h.

UINT32 m_BufferFrames [private]

Definition at line 101 of file WASAPIRenderer.h.

float m_ChannelVolume [private]

Definition at line 111 of file WASAPIRenderer.h.

CRITICAL_SECTION m_CritSec [private]

Definition at line 104 of file WASAPIRenderer.h.

UINT32 m_DefaultPeriodInFrames [private]

Definition at line 107 of file WASAPIRenderer.h.

Platform::String m_DeviceIdString [private]

Definition at line 100 of file WASAPIRenderer.h.

DEVICEPROPS m_DeviceProps [private]

Definition at line 118 of file WASAPIRenderer.h.

DeviceStateChangedEvent m_DeviceStateChanged [private]

Definition at line 117 of file WASAPIRenderer.h.

UINT32 m_FundamentalPeriodInFrames [private]

Definition at line 108 of file WASAPIRenderer.h.

UINT32 m_MaxPeriodInFrames [private]

Definition at line 109 of file WASAPIRenderer.h.

MFSampleGenerator* m_MFSource [private]

Definition at line 121 of file WASAPIRenderer.h.

UINT32 m_MinPeriodInFrames [private]

Definition at line 110 of file WASAPIRenderer.h.

WAVEFORMATEX* m_MixFormat [private]

Definition at line 106 of file WASAPIRenderer.h.

IMFAsyncResult* m_SampleReadyAsyncResult [private]

Definition at line 115 of file WASAPIRenderer.h.

HANDLE m_SampleReadyEvent [private]

Definition at line 102 of file WASAPIRenderer.h.

MFWORKITEM_KEY m_SampleReadyKey [private]

Definition at line 103 of file WASAPIRenderer.h.

ToneSampleGenerator* m_ToneSource [private]

Definition at line 120 of file WASAPIRenderer.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cpp/WASAPIRenderer.h
  • WindowsAudioSession/cpp/WASAPIRenderer.cpp
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Account Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Account
Properties

Account Class Reference

List of all members.

Properties

string | Email [get, set]
string | Name [get, set]
bool | UsesPassport [get, set]

Detailed Description

Definition at line 9 of file Account.cs.

Property Documentation

string Email [get, set]

Definition at line 12 of file Account.cs.

string Name [get, set]

Definition at line 11 of file Account.cs.

bool UsesPassport [get, set]

Definition at line 13 of file Account.cs.

The documentation for this class was generated from the following file:
  • KeyCredentialManager/cs/Account.cs
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccountOverviewPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AccountOverviewPage
Public Member Functions | Private Member Functions

AccountOverviewPage Class Reference

List of all members.

Public Member Functions

AccountOverviewPage ()

Private Member Functions

void SignOut ()

Detailed Description

Definition at line 22 of file AccountOverviewPage.xaml.cs.

Constructor & Destructor Documentation

AccountOverviewPage ( ) [inline]

Definition at line 24 of file AccountOverviewPage.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void SignOut ( ) [inline, private]

Definition at line 29 of file AccountOverviewPage.xaml.cs.

        {
            while (Frame.CanGoBack)
                Frame.GoBack();
        }

The documentation for this class was generated from the following file:
  • MicrosoftPassport/cs/AccountOverviewPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AccountsHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AccountsHelper
Static Public Member Functions | Private Attributes

AccountsHelper Class Reference

List of all members.

Static Public Member Functions

static List< Account > | DeserializeXmlToAccountList (string listAsXml)
static async Task< List
< Account > > 		LoadAccountList ()
static async void | SaveAccountList (List< Account > accountList)
static string | SerializeAccountListToXml (List< Account > list)

Private Attributes

const string | USER_LIST_FILE_NAME = "accountlist.txt"

Detailed Description

Definition at line 14 of file AccountsHelper.cs.

Member Function Documentation

static List<Account> DeserializeXmlToAccountList ( string listAsXml ) [inline, static]

Takes an XML formatted string representing a list of accounts and returns a list object of accounts.

Parameters:
listAsXml XML formatted list of accounts
Returns:
List object of accounts

Definition at line 75 of file AccountsHelper.cs.

        {
            XmlSerializer xmlizer = new XmlSerializer(typeof(List<Account>));
            List<Account> accounts = new List<Account>();
            TextReader textreader = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(listAsXml)));
            accounts = (xmlizer.Deserialize(textreader)) as List<Account>;
            return accounts;
        }

static async Task<List<Account> > LoadAccountList ( ) [inline, static]

Gets the account list file and deserializes it from XML to a list of accounts object.

Returns:
List of account objects

Definition at line 22 of file AccountsHelper.cs.

        {
            try
            {
                StorageFile accountsFile = await ApplicationData.Current.LocalFolder.GetFileAsync(USER_LIST_FILE_NAME);
                string accountsXml = await Windows.Storage.FileIO.ReadTextAsync(accountsFile);
                return AccountsHelper.DeserializeXmlToAccountList(accountsXml);
            }
            catch (FileNotFoundException e)
            {
                List<Account> emptyAccountList = new List<Account>();
                return emptyAccountList;
            }
        }

static async void SaveAccountList ( List< Account > accountList ) [inline, static]

Takes a list of accounts and create an account list file.

(Replacing the old one)

Parameters:
accountList List object of accounts

Definition at line 41 of file AccountsHelper.cs.

        {
            string accountsXml = SerializeAccountListToXml(accountList);

            try
            {
                StorageFile accountsFile = await ApplicationData.Current.LocalFolder.GetFileAsync(USER_LIST_FILE_NAME);
                await Windows.Storage.FileIO.WriteTextAsync(accountsFile, accountsXml);
            }
            catch (FileNotFoundException e)
            {
                StorageFile accountsFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(USER_LIST_FILE_NAME);
                await Windows.Storage.FileIO.WriteTextAsync(accountsFile, accountsXml);
            }
        }

static string SerializeAccountListToXml ( List< Account > list ) [inline, static]

Takes a list of accounts and returns an XML formatted string representing the list.

Parameters:
list List object of accounts
Returns:
XML formatted list of accounts

Definition at line 62 of file AccountsHelper.cs.

        {
            XmlSerializer xmlizer = new XmlSerializer(typeof(List<Account>));
            StringWriter writer = new StringWriter();
            xmlizer.Serialize(writer, list);
            return writer.ToString();
        }

Member Data Documentation

const string USER_LIST_FILE_NAME = "accountlist.txt" [private]

Definition at line 16 of file AccountsHelper.cs.

The documentation for this class was generated from the following file:
  • KeyCredentialManager/cs/AccountsHelper.cs
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AddAuthorizationHeaderFilter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AddAuthorizationHeaderFilter
Public Member Functions | Properties | Private Attributes

AddAuthorizationHeaderFilter Class Reference

List of all members.

Public Member Functions

AddAuthorizationHeaderFilter (IHttpFilter innerFilter)
void | Dispose ()
IAsyncOperationWithProgress
< HttpResponseMessage,
HttpProgress > 		SendRequestAsync (HttpRequestMessage request)

Properties

string | KeyHost [get, set]

Private Attributes

internal HttpCredentialsHeaderValue | AuthorizationHeader
IHttpFilter | innerFilter

Detailed Description

Definition at line 485 of file Scenario3_RequestModification.xaml.cs.

Constructor & Destructor Documentation

AddAuthorizationHeaderFilter ( IHttpFilter innerFilter ) [inline]

Definition at line 487 of file Scenario3_RequestModification.xaml.cs.

        {
            if (innerFilter == null)
            {
                throw new ArgumentException("innerFilter cannot be null.");
            }
            this.innerFilter = innerFilter;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 513 of file Scenario3_RequestModification.xaml.cs.

        {
        }

IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> SendRequestAsync ( HttpRequestMessage request ) [inline]

Definition at line 502 of file Scenario3_RequestModification.xaml.cs.

        {
            bool isKeyRequest = String.Equals(request.RequestUri.Host, KeyHost, StringComparison.OrdinalIgnoreCase);
            if (isKeyRequest && AuthorizationHeader != null)
            {
                request.Headers.Authorization = AuthorizationHeader;
            }

            return innerFilter.SendRequestAsync(request);
        }

Member Data Documentation

internal HttpCredentialsHeaderValue AuthorizationHeader [private]

Definition at line 496 of file Scenario3_RequestModification.xaml.cs.

IHttpFilter innerFilter [private]

Definition at line 497 of file Scenario3_RequestModification.xaml.cs.

Property Documentation

string KeyHost [get, set]

Definition at line 500 of file Scenario3_RequestModification.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario3_RequestModification.xaml.cs
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • App
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

App Class Reference

Provides application-specific behavior to supplement the default Application class. More...

#include "pch.h"

List of all members.

Public Member Functions

App ()
App ()
App ()
App ()
App ()
App ()
App ()
App ()
App ()
void | OnFileActivated (Windows::ApplicationModel::Activation::FileActivatedEventArgs^args) override
void | Partial_LaunchCompleted (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e)
void | ReduceMemoryUsage (ulong limit)
void | ShowToast (string msg, string subMsg=null)
void | UpdateTitle (String newTitle, int viewId)

Public Attributes

LaunchActivatedEventArgs | LaunchArgs
ObservableCollection
< ViewLifetimeControl > 		SecondaryViews = new ObservableCollection<ViewLifetimeControl>()

Protected Member Functions

override void | OnActivated (IActivatedEventArgs e)
override void | OnActivated (IActivatedEventArgs e)
override void | OnActivated (IActivatedEventArgs args)
override void | OnActivated (IActivatedEventArgs args)
async override void | OnActivated (IActivatedEventArgs args)
void | OnActivated (Windows::ApplicationModel::Activation::IActivatedEventArgs^args) override
override void | OnActivated (IActivatedEventArgs args)
override void | OnActivated (IActivatedEventArgs e)
virtual void | OnBackgroundActivated (Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^args) override
override void | OnBackgroundActivated (BackgroundActivatedEventArgs args)
override void | OnCachedFileUpdaterActivated (CachedFileUpdaterActivatedEventArgs args)
override void | OnFileActivated (FileActivatedEventArgs e)
override void | OnFileActivated (FileActivatedEventArgs args)
override void | OnFileOpenPickerActivated (FileOpenPickerActivatedEventArgs args)
override void | OnFileSavePickerActivated (FileSavePickerActivatedEventArgs args)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override async void | OnLaunched (LaunchActivatedEventArgs e)
override async void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnLaunched (LaunchActivatedEventArgs e)
override void | OnShareTargetActivated (ShareTargetActivatedEventArgs args)

Properties

CoreDispatcher | MainDispatcher [get]
int | MainViewId [get]

Private Member Functions

void | App_BackRequested (object sender, BackRequestedEventArgs e)
void | App_EnteredBackground (object sender, EnteredBackgroundEventArgs e)
void | App_LeavingBackground (object sender, LeavingBackgroundEventArgs e)
void | App_Resuming (object sender, object e)
void | App_Suspending (object sender, SuspendingEventArgs e)
async void | App_UnhandledException (object sender, UnhandledExceptionEventArgs e)
partial void | Construct ()
partial void | Construct ()
partial void | Construct ()
partial void | Construct ()
partial void | Construct ()
partial void | Construct ()
Frame | CreateRootFrame ()
void | CreateRootFrame (ApplicationExecutionState previousExecutionState, string arguments)
string | GetMemoryUsageText ()
void | InitializeMainPage (ApplicationExecutionState previousExecutionState, String arguments)
partial void | InitializeRootFrame (Frame frame)
partial void | InitializeRootFrame (Frame frame)
partial void | LaunchCompleted (LaunchActivatedEventArgs e)
partial void | LaunchCompleted (LaunchActivatedEventArgs e)
void | MemoryManager_AppMemoryUsageIncreased (object sender, object e)
void | MemoryManager_AppMemoryUsageLimitChanging (object sender, AppMemoryUsageLimitChangingEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)
async void | OnSuspending (object sender, SuspendingEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)
async void | OnSuspending (object sender, SuspendingEventArgs e)
partial void | OverrideOnLaunched (LaunchActivatedEventArgs args, ref bool handled)
partial void | OverrideOnLaunched (LaunchActivatedEventArgs args, ref bool handled)
void | Partial_Construct ()
bool | TryFindViewLifetimeControlForViewId (int viewId, out ViewLifetimeControl foundData)

Private Attributes

bool | isInBackgroundMode
CoreDispatcher | mainDispatcher
int | mainViewId
RootFrameNavigationHelper rootFrameNavigationHelper
const string | sessionStateFilename = "_sessionState.xml"

Detailed Description

Provides sample-specific behavior to supplement the default Application class.

Definition at line 74 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 33 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Construct();
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 36 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Construct();
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 25 of file App.xaml.cs.

        {
            this.InitializeComponent();
            SuspensionManager.KnownTypes.AddRange(new[] { typeof(ItemList), typeof(Item) });
            this.Suspending += OnSuspending;
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 32 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 35 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 33 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Construct();
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 34 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            this.UnhandledException += App_UnhandledException;
        }

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 35 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

App ( ) [inline]

Initializes the singleton Application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 44 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

void App_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when a user issues a global back on the device.

If the app has no in-app back stack left for the current view/frame the user may be navigated away back to the previous app in the system's app back stack or to the start screen. In windowed mode on desktop there is no system app back stack and the user will stay in the app even when the in-app back stack is depleted.

Parameters:
sender
e

Definition at line 100 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
                return;

            // If we can go back and the event has not already been handled, do so.
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }

void App_EnteredBackground | ( | object | sender,
 |  | EnteredBackgroundEventArgs | e |
 | ) |  |  | [inline, private]

The application entered the background.

Parameters:
sender
e

Definition at line 145 of file BackgroundApp.cs.

        {
            // Place the application into "background mode" and note the
            // transition with a flag.
            ShowToast("Entered background");
            isInBackgroundMode = true;

            // An application may wish to release views and view data
            // at this point since the UI is no longer visible.
            //
            // As a performance optimization, here we note instead that
            // the app has entered background mode with a boolean and
            // defer unloading views until AppMemoryUsageLimitChanging or
            // AppMemoryUsageIncreased is raised with an indication that
            // the application is under memory pressure.
        }

void App_LeavingBackground | ( | object | sender,
 |  | LeavingBackgroundEventArgs | e |
 | ) |  |  | [inline, private]

The application is leaving the background.

Parameters:
sender
e

Definition at line 167 of file BackgroundApp.cs.

        {
            // Mark the transition out of background mode.
            ShowToast("Leaving background");
            isInBackgroundMode = false;

            // Reastore view content if it was previously unloaded.
            if (Window.Current.Content == null)
            {
                ShowToast("Loading view");
                CreateRootFrame(ApplicationExecutionState.Running, string.Empty);
            }
        }

void App_Resuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Invoked when application execution is resumed.

Parameters:
sender
e

Definition at line 72 of file BackgroundApp.cs.

        {
            ShowToast("Resuming");
        }

void App_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 59 of file BackgroundApp.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            // Optional: Save application state and stop any background activity
            ShowToast("Suspending");
            deferral.Complete();
        }

async void App_UnhandledException | ( | object | sender,
 |  | UnhandledExceptionEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file App.xaml.cs.

        {
            var msgbox = new Windows.UI.Popups.MessageDialog("Unhandled exception: " + e.Exception.ToString());
            msgbox.Commands.Add(new Windows.UI.Popups.UICommand("close"));
            await msgbox.ShowAsync();
        }

partial void Construct ( ) [inline, private]

Register for grouped background task events in the Application constructor.

Definition at line 301 of file SampleConfiguration.cs.

        {
            var group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);
            group.BackgroundActivated += BackgroundActivity.Start;
        }

partial void Construct ( ) [inline, private]

Definition at line 38 of file SampleConfiguration.cs.

        {
            // Setting RequiresPointerMode to WhenRequested sets the default behavior for
            // the entire app to enter mouse mode only when requested. This is typically
            // set in the App.xaml markup, but we do it here explicitly in code so that
            // the step is easier to see.
            this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
        }

partial void Construct ( ) [private]
partial void Construct ( ) [private]
partial void Construct ( ) [private]
partial void Construct ( ) [inline, private]

Called from App.xaml.cs when the application is constructed.

Definition at line 27 of file BackgroundApp.cs.

        {
            // During the transition from foreground to background the
            // memory limit allowed for the application changes. The application
            // has a short time to respond by bringing its memory usage
            // under the new limit.
            MemoryManager.AppMemoryUsageLimitChanging += MemoryManager_AppMemoryUsageLimitChanging;

            // After an application is backgrounded it is expected to stay
            // under a memory target to maintain priority to keep running.
            // Subscribe to the event that informs the app of this change.
            MemoryManager.AppMemoryUsageIncreased += MemoryManager_AppMemoryUsageIncreased;

            // Subscribe to key lifecyle events to know when the app
            // transitions to and from foreground and background.
            // Leaving the background is an important transition
            // because the app may need to restore UI.
            EnteredBackground += App_EnteredBackground;
            LeavingBackground += App_LeavingBackground;

            // Subscribe to regular lifecycle events to display a toast notification
            Suspending += App_Suspending;
            Resuming += App_Resuming;
        }

Frame CreateRootFrame ( ) [inline, private]

Definition at line 83 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
                rootFrame.NavigationFailed += OnNavigationFailed;

                InitializeRootFrame(rootFrame);

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            return rootFrame;
        }

void CreateRootFrame | ( | ApplicationExecutionState | previousExecutionState,
 |  | string | arguments |
 | ) |  |  | [inline, private]

Creates the frame containing the view.

This is the same code that was in OnLaunched() initially. It is moved to a separate method so the view can be restored when leaving the background if it was unloaded when the app entered the background.

Definition at line 72 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                System.Diagnostics.Debug.WriteLine("CreateFrame: Initializing root frame ...");

                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (previousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), arguments);
            }
        }

string GetMemoryUsageText ( ) [inline, private]

Gets a string describing current memory usage.

Returns:
String describing current memory usage

Definition at line 233 of file BackgroundApp.cs.

        {
            return string.Format("[Memory: Level={0}, Usage={1}K, Target={2}K]",
                MemoryManager.AppMemoryUsageLevel, MemoryManager.AppMemoryUsage / 1024, MemoryManager.AppMemoryUsageLimit / 1024);
        }

void InitializeMainPage | ( | ApplicationExecutionState | previousExecutionState,
 |  | String | arguments |
 | ) |  |  | [inline, private]

Definition at line 69 of file App.xaml.cs.

        {
            Frame rootFrame = CreateRootFrame();

            if (rootFrame.Content == null || !string.IsNullOrEmpty(arguments))
            {
                // When the navigation stack isn't restored or there are launch arguments
                // indicating an alternate launch (e.g.: via toast or secondary tile),
                // navigate to the appropriate page, configuring the new page by passing required
                // information as a navigation parameter
                rootFrame.Navigate(typeof(MainPage), arguments);
            }
        }

partial void InitializeRootFrame ( Frame frame ) [private]
partial void InitializeRootFrame ( Frame frame ) [inline, private]

Definition at line 63 of file SampleConfiguration.cs.

        {
            mainDispatcher = Window.Current.Dispatcher;
            mainViewId = ApplicationView.GetForCurrentView().Id;
        }

partial void LaunchCompleted ( LaunchActivatedEventArgs e ) [inline, private]

Definition at line 69 of file SampleConfiguration.cs.

        {
            if (!string.IsNullOrEmpty(e.Arguments))
            {
                MainPage.Current.LaunchParam = "arguments: " + e.Arguments;
            }
        }

partial void LaunchCompleted ( LaunchActivatedEventArgs e ) [inline, private]

Definition at line 23 of file SampleConfiguration.cs.

        {
            MainPage.Current.LaunchParam = e.Arguments;
        }

void MemoryManager_AppMemoryUsageIncreased | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Handle system notifications that the app has increased its memory usage level compared to its current target.

The app may have increased its usage or the app may have moved to the background and the system lowered the target the app is expected to reach. Either way, if the application wants to maintain its priority to avoid being suspended before other apps, it may need to reduce its memory usage.

This is not a replacement for handling AppMemoryUsageLimitChanging which is critical to ensure the app immediately gets below the new limit. However, once the app is allowed to continue running and policy is applied, some apps may wish to continue monitoring usage to ensure they remain below the limit.

Parameters:
sender
e

Definition at line 124 of file BackgroundApp.cs.

        {
            ShowToast("Memory usage increased");

            // Obtain the current usage level
            var level = MemoryManager.AppMemoryUsageLevel;

            // Check the usage level to determine whether reducing memory is necessary.
            // Memory usage may have been fine when initially entering the background but
            // a short time later the app might be using more memory and need to trim back.
            if (level == AppMemoryUsageLevel.OverLimit || level == AppMemoryUsageLevel.High)
            {
                ReduceMemoryUsage(MemoryManager.AppMemoryUsageLimit);
            }
        }

void MemoryManager_AppMemoryUsageLimitChanging | ( | object | sender,
 |  | AppMemoryUsageLimitChangingEventArgs | e |
 | ) |  |  | [inline, private]

Raised when the memory limit for the app is changing, such as when the app enters the background.

If the app is using more than the new limit, it must reduce memory within 2 seconds on some platforms in order to avoid being suspended or terminated.

While some platforms will allow the application to continue running over the limit, reducing usage in the time allotted will enable the best experience across the broadest range of devices.

Parameters:
sender
e

Definition at line 91 of file BackgroundApp.cs.

        {
            ShowToast("Memory usage limit changing from "
                + (e.OldLimit / 1024) + "K to "
                + (e.NewLimit / 1024) + "K");

            // If app memory usage is over the limit about to be enforced,
            // then reduce usage within 2 seconds to avoid suspending.
            if (MemoryManager.AppMemoryUsage >= e.NewLimit)
            {
                ReduceMemoryUsage(e.NewLimit);
            }
        }

void OnActivated ( Windows::ApplicationModel::Activation::IActivatedEventArgs^ args ) [override, protected]
override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

Invoked when the application is launched by a protocol.

Parameters:
args Container for the activation information including the Uri used to activate this app.

Definition at line 26 of file SampleConfiguration.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                rootFrame.Navigate(typeof(MainPage));
                Window.Current.Content = rootFrame;
            }

            // Protocol activation is the only type of activation that this app handles
            if (args.Kind == ActivationKind.Protocol)
            {
                ProtocolActivatedEventArgs protocolArgs = args as ProtocolActivatedEventArgs;
                ((MainPage)rootFrame.Content).LoadScenarioForProtocolActivation(protocolArgs);
            }

            Window.Current.Activate();
        }

override void OnActivated ( IActivatedEventArgs e ) [inline, protected]

Definition at line 46 of file SampleConfiguration.cs.

        {
            if (e.Kind == ActivationKind.Protocol)
            {
                Frame rootFrame = CreateRootFrame();

                if (rootFrame.Content == null)
                {
                    if (!rootFrame.Navigate(typeof(MainPage)))
                    {
                        throw new Exception("Failed to create initial page");
                    }
                }

                var mainPage = rootFrame.Content as MainPage;

                // If no matching page found, then just go to the first scenario.
                Scenario destinationScenario = mainPage.Scenarios[0];

                // Look for a matching scenario page.
                var protocolArgs = (IProtocolActivatedEventArgs)e;
                var query = protocolArgs.Uri.Query;
                if (query.StartsWith("?"))
                {
                    var pageName = query.Substring(1);
                    foreach (var scenario in mainPage.Scenarios)
                    {
                        if (scenario.ClassType.Name == pageName)
                        {
                            destinationScenario = scenario;
                        }
                    }
                }

                mainPage.NavigateToScenarioWithParameter(destinationScenario, $"Activated from URI: {protocolArgs.Uri}");

                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

override void OnActivated ( IActivatedEventArgs e ) [inline, protected]

Definition at line 101 of file SampleConfiguration.cs.

        {
            if (e.Kind == ActivationKind.Protocol)
            {
                Frame rootFrame = CreateRootFrame();

                if (rootFrame.Content == null)
                {
                    if (!rootFrame.Navigate(typeof(MainPage)))
                    {
                        throw new Exception("Failed to create initial page");
                    }
                }

                var p = rootFrame.Content as MainPage;
                p.NavigateToPageWithParameter(3, e);

                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

Definition at line 161 of file App.xaml.cs.

        {
            // AutoPlay scenario: This app is registered for as a hanlder for WPD\ImageSourceAutoPlay event in the Package.appxmanifest
            if (args.Kind == ActivationKind.Device)
            {
                Frame rootFrame = null;
                // Ensure that the current page exists and is activated
                if (Window.Current.Content == null)
                {
                    rootFrame = new Frame();
                    rootFrame.Navigate(typeof(MainPage));
                    Window.Current.Content = rootFrame;
                }
                else
                {
                    rootFrame = Window.Current.Content as Frame;
                }

                // Reference the current page as type MainPage
                 var page = rootFrame.Content as MainPage;

                // Cast the activated event args as DeviceActivatedEventArgs and navigate to scenario1 to preselect the device
                var deviceArgs = args as DeviceActivatedEventArgs;
                page.DeviceEvent = deviceArgs;
                page.NavigateToAutoPlay();

                Window.Current.Activate();
            }

            base.OnActivated(args);
        }

async override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

Definition at line 69 of file SampleConfiguration.cs.

        {
            if (args.Kind == ActivationKind.Protocol)
            {
                var protocolArgs = (ProtocolActivatedEventArgs)args;
                // Find out which window the system chose to display
                // Unless you've set DisableShowingMainViewOnActivation,
                // it will always be your most recent view.
                ViewLifetimeControl ViewLifetimeControl;
                if (TryFindViewLifetimeControlForViewId(protocolArgs.CurrentlyShownApplicationViewId, out ViewLifetimeControl))
                {
                    await ViewLifetimeControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        var currentPage = (SecondaryViewPage)((Frame)Window.Current.Content).Content;
                        currentPage.HandleProtocolLaunch(protocolArgs.Uri);
                        Window.Current.Activate();
                    });
                }
                else
                {
                    // We don't have the specified view in the collection, likely because it's the main view
                    // that got shown. Set up the main view to display.
                    InitializeMainPage(args.PreviousExecutionState, "");
                    var rootPage = (MainPage)((Frame)Window.Current.Content).Content;
                    ((ListBox)rootPage.FindName("Scenarios")).SelectedIndex = 1;
                    rootPage.NotifyUser("Main window was launched with protocol: " + protocolArgs.Uri.AbsoluteUri,
                                        NotifyType.StatusMessage);
                    Window.Current.Activate();
                }
            }
        }

override void OnActivated ( IActivatedEventArgs e ) [inline, protected]

Definition at line 49 of file SampleConfiguration.cs.

        {
            if (e.Kind == ActivationKind.Protocol)
            {
                Frame rootFrame = CreateRootFrame();

                if (rootFrame.Content == null)
                {
                    if (!rootFrame.Navigate(typeof(MainPage)))
                    {
                        throw new Exception("Failed to create initial page");
                    }
                }

                var p = rootFrame.Content as MainPage;
                p.NavigateToPageWithParameter(1, e);

                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

override void OnActivated ( IActivatedEventArgs args ) [inline, protected]

Definition at line 61 of file SampleConfiguration.cs.

        {
            Frame rootFrame = CreateRootFrame();

            switch (args.Kind)
            {
                case ActivationKind.Protocol:
                    {
                        if (rootFrame.Content == null)
                        {
                            rootFrame.Navigate(typeof(MainPage));
                        }

                        // Parse the contact remote ID from the protocol arguments.
                        string contactRemoteId = String.Empty;
                        var protocolArgs = (ProtocolActivatedEventArgs)args;
                        var decoder = new WwwFormUrlDecoder(protocolArgs.Uri.Query);
                        try
                        {
                            contactRemoteId = decoder.GetFirstValueByName("ContactRemoteId");
                        }
                        catch (ArgumentException)
                        {
                            // Value not present in query string.
                        }

                        //  AppContactPanel_LaunchFullAppRequested passed in the remoteId. Display it to the user.
                        MainPage.Current.NotifyUser("Protocol launch with remoteId = " + contactRemoteId, NotifyType.StatusMessage);

                        Window.Current.Activate();
                        break;
                    }

                case ActivationKind.ContactPanel:
                    {
                        if (rootFrame.Content == null)
                        {
                            rootFrame.Navigate(typeof(AppContactPanel));
                        }

                        var appContactPanel = (AppContactPanel)rootFrame.Content;
                        appContactPanel.OnActivated((ContactPanelActivatedEventArgs)args);

                        Window.Current.Activate();
                        break;
                    }
            }
        }

override void OnBackgroundActivated ( BackgroundActivatedEventArgs args ) [inline, protected]

Override the Application.OnBackgroundActivated method to handle background activation in the main process.

This entry point is used when BackgroundTaskBuilder.TaskEntryPoint is not set during background task registration.

Parameters:
args

Definition at line 293 of file SampleConfiguration.cs.

        {
            BackgroundActivity.Start(args.TaskInstance);
        }

virtual void OnBackgroundActivated ( Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^ args ) [override, protected, virtual]

Override the Application OnBackgroundActivated method to handle background activation in the main process.

This entry point is used when BackgroundTaskBuilder TaskEntryPoint is not set during background task registration.

Parameters:
args
override void OnCachedFileUpdaterActivated ( CachedFileUpdaterActivatedEventArgs args ) [inline, protected]

Definition at line 38 of file App.xaml.custom.cs.

        {
            var CachedFileUpdaterPage = new SDKTemplate.CachedFileUpdaterPage();
            CachedFileUpdaterPage.Activate(args);
        }

override void OnFileActivated ( FileActivatedEventArgs e ) [inline, protected]

Definition at line 79 of file SampleConfiguration.cs.

        {
            Frame rootFrame = CreateRootFrame();

            if (rootFrame.Content == null)
            {
                if (!rootFrame.Navigate(typeof(MainPage)))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            var p = rootFrame.Content as MainPage;
            p.NavigateToPageWithParameter(2, e);

            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnFileActivated ( Windows::ApplicationModel::Activation::FileActivatedEventArgs^ args ) [override]
override void OnFileActivated ( FileActivatedEventArgs args ) [inline, protected]

Definition at line 59 of file SampleConfiguration.cs.

        {
            base.OnFileActivated(args);

            if (args.Files.Count == 1)
            {
                MainPage.Current.LaunchParam = "file: " + args.Files[0].Name;
            }
        }

override void OnFileOpenPickerActivated ( FileOpenPickerActivatedEventArgs args ) [inline, protected]

Definition at line 26 of file App.xaml.custom.cs.

        {
            var FileOpenPickerPage = new SDKTemplate.FileOpenPickerPage();
            FileOpenPickerPage.Activate(args);
        }

override void OnFileSavePickerActivated ( FileSavePickerActivatedEventArgs args ) [inline, protected]

Definition at line 32 of file App.xaml.custom.cs.

        {
            var FileSavePickerPage = new SDKTemplate.FileSavePickerPage();
            FileSavePickerPage.Activate(args);
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 55 of file App.xaml.cs.

        {
            if (e.PreviousExecutionState != ApplicationExecutionState.Running)
            {
                bool loadState = (e.PreviousExecutionState == ApplicationExecutionState.Terminated);
                ExtendedSplash extendedSplash = new ExtendedSplash(e.SplashScreen, loadState);
                Window.Current.Content = extendedSplash;
            }

            Window.Current.Activate();
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 53 of file App.xaml.cs.

        {
            this.LaunchArgs = e;
            System.Diagnostics.Debug.WriteLine("OnLaunched Arguments: " + e.Arguments);
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (!string.IsNullOrWhiteSpace(e.Arguments)
                && e.Arguments.StartsWith("Receipt^"))
            {
                // We're being launched/navigated to as a result of a tap, so show the results
                rootFrame.Navigate(typeof(ReceiptView), e.Arguments);
            }
            else if (rootFrame.Content == null
                || rootFrame.Content.GetType() != typeof(MainPage))
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

override async void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 46 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active

            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;
                rootFrame.Navigate(typeof(MainPage));

                // if our app was previous terminated or wasn't running, check if there were pending progress
                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated || e.PreviousExecutionState == ApplicationExecutionState.NotRunning)
                {
                    try
                    {
                        bool isImportSupported = await PhotoImportManager.IsSupportedAsync();
                        if (isImportSupported)
                        {
                            // Determine if there was an in progress session
                            IReadOnlyList<PhotoImportOperation> ops = PhotoImportManager.GetPendingOperations();

                            // If there is at least one session and state isn't idle, restore session state

                            if (ops != null && ops.Count != 0)
                            {
                                var p = rootFrame.Content as MainPage;

                                if (ops.Count > 1)
                                {
                                    // If there is more than one operation, since this app handles single
                                    // download sessions only, the previous session(s) were not properly
                                    // disposed of, do this now.

                                    for (int x = 0; x < ops.Count - 1; x++)
                                    {
                                        ops[x].Session.Dispose();
                                    }
                                }

                                // Take the last operation from the list, and if some task was started, navigate to reconnect to the proper stage.

                                p.ImportOperation = ops[ops.Count - 1];

                                if (p.ImportOperation.Stage != PhotoImportStage.NotStarted)
                                {
                                    p.NavigateToReconnect();
                                }
                                else
                                {
                                    p.ImportOperation.Session.Dispose();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine("Exception: " + ex.Message);
                    }
                }

                // Place the frame in the current Window

                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used when the application is launched to open a specific file, to display search results, and so forth.

Parameters:
e Details about the launch request and process.

Definition at line 45 of file App.xaml.cs.

        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            // A sample can inject code into OnLaunched by implementing OverrideOnLaunched.
            bool handled = false;
            OverrideOnLaunched(e, ref handled);

            if (!handled)
            {
                // We don't have the specified view in the collection, likely because it's the main view
                // that got shown. Set up the main view to display.
                InitializeMainPage(e.PreviousExecutionState, "");

                // This is the usual path at application startup
                Window.Current.Activate();
            }
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 47 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            CreateRootFrame(e.PreviousExecutionState, e.Arguments);

            // Ensure the current window is active
            Window.Current.Activate();
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 44 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }

            // Register a global back event handler. This can be registered on a per-page-bases if you only have a subset of your pages
            // that needs to handle back or if you want to do page-specific logic before deciding to navigate back on those pages.
            SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;

            // Ensure the current window is active
            Window.Current.Activate();
        }

override async void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 37 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                SuspensionManager.RegisterFrame(rootFrame, "AppFrame");

                // Use the RootFrameNavigationHelper to respond to keyboard and mouse shortcuts.
                this.rootFrameNavigationHelper = new RootFrameNavigationHelper(rootFrame);

                rootFrame.NavigationFailed += OnNavigationFailed;

                // If this is not the first time the app is run, then restore from the previous session.
                StorageFile file;
                try
                {
                    file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
                }
                catch (Exception)
                {
                    file = null;
                }

                if (file != null)
                {
                    //Load state from previously suspended application
                    await SuspensionManager.RestoreAsync();
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 43 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 46 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 91 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 112 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 119 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 109 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 72 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 113 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 142 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 94 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 91 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

override void OnShareTargetActivated ( ShareTargetActivatedEventArgs args ) [inline, protected]

Definition at line 41 of file SampleConfiguration.cs.

        {
            var rootFrame = CreateRootFrame();
            rootFrame.Navigate(typeof(ShareTarget), args.ShareOperation);
            Window.Current.Activate();
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 121 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 106 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 154 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

async void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 84 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            await SuspensionManager.SaveAsync();
            deferral.Complete();
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 103 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

async void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 103 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // Save application state and stop any background activity.
            await SuspensionManager.SaveAsync();
            deferral.Complete();
        }

partial void OverrideOnLaunched | ( | LaunchActivatedEventArgs | args,
 |  | ref bool | handled |
 | ) |  |  | [private]
partial void OverrideOnLaunched | ( | LaunchActivatedEventArgs | args,
 |  | ref bool | handled |
 | ) |  |  | [inline, private]

Definition at line 49 of file SampleConfiguration.cs.

        {
            // Check if a secondary view is supposed to be shown
            ViewLifetimeControl ViewLifetimeControl;
            handled = TryFindViewLifetimeControlForViewId(args.CurrentlyShownApplicationViewId, out ViewLifetimeControl);
            if (handled)
            {
                var task = ViewLifetimeControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    Window.Current.Activate();
                });
            }
        }

void Partial_Construct ( ) [private]

Definition at line 245 of file SampleConfiguration.cpp.

{
    auto group = BackgroundTaskSample::GetTaskGroup(BackgroundTaskGroupId, BackgroundTaskGroupFriendlyName);
    group->BackgroundActivated += ref new TypedEventHandler<BackgroundTaskRegistrationGroup ^, BackgroundActivatedEventArgs ^>(&BackgroundActivity::OnStart, CallbackContext::Same);
}

void Partial_LaunchCompleted ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e )
void ReduceMemoryUsage ( ulong limit ) [inline]

Reduces application memory usage.

When the app enters the background, receives a memory limit changing event, or receives a memory usage increased event it can optionally unload cached data or even its view content in order to reduce memory usage and the chance of being suspended.

This must be called from multiple event handlers because an application may already be in a high memory usage state when entering the background or it may be in a low memory usage state with no need to unload resources yet and only enter a higher state later.

Definition at line 195 of file BackgroundApp.cs.

        {
            // If the app has caches or other memory it can free, now is the time.
            // << App can release memory here >>

            // Additionally, if the application is currently
            // in background mode and still has a view with content
            // then the view can be released to save memory and
            // can be recreated again later when leaving the background.
            if (isInBackgroundMode && Window.Current.Content != null)
            {
                ShowToast("Unloading view");

                // Clear the view content. Note that views should rely on
                // events like Page.Unloaded to further release resources. Be careful
                // to also release event handlers in views since references can
                // prevent objects from being collected. C++ developers should take
                // special care to use weak references for event handlers where appropriate.
                Window.Current.Content = null;

                // Finally, clearing the content above and calling GC.Collect() below
                // is what will trigger each Page.Unloaded handler to be called.
                // In order for the resources each page has allocated to be released,
                // it is necessary that each Page also call GC.Collect() from its
                // Page.Unloaded handler.
            }

            // Run the GC to collect released resources, including triggering
            // each Page.Unloaded handler to run.
            GC.Collect();

            ShowToast("Finished reducing memory usage");
        }

void ShowToast | ( | string | msg,
 |  | string | subMsg = null |
 | ) |  |  | [inline]

Sends a toast notification.

Parameters:
msg | Message to send
subMsg | Sub message

Definition at line 244 of file BackgroundApp.cs.

        {
            if (subMsg == null)
                subMsg = GetMemoryUsageText();

            Debug.WriteLine(msg + "\n" + subMsg);

            if (!SettingsService.Instance.ToastOnAppEvents)
                return;

            var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

            var toastTextElements = toastXml.GetElementsByTagName("text");
            toastTextElements[0].AppendChild(toastXml.CreateTextNode(msg));
            toastTextElements[1].AppendChild(toastXml.CreateTextNode(subMsg));

            var toast = new ToastNotification(toastXml);
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

bool TryFindViewLifetimeControlForViewId | ( | int | viewId,
 |  | out ViewLifetimeControl | foundData |
 | ) |  |  | [inline, private]

Definition at line 120 of file SampleConfiguration.cs.

        {
            foreach (var ViewLifetimeControl in SecondaryViews)
            {
                if (ViewLifetimeControl.Id == viewId)
                {
                    foundData = ViewLifetimeControl;
                    return true;
                }
            }
            foundData = null;
            return false;
        }

void UpdateTitle | ( | String | newTitle,
 |  | int | viewId |
 | ) |  |  | [inline]

Definition at line 105 of file SampleConfiguration.cs.

        {
            ViewLifetimeControl foundData;
            if (TryFindViewLifetimeControlForViewId(viewId, out foundData))
            {
                foundData.Title = newTitle;
            }
            else
            {
                throw new KeyNotFoundException("Couldn't find the view ID in the collection");
            }
        }

Member Data Documentation

bool isInBackgroundMode [private]

Flag to indicate whether the app is currently in foreground or background mode.

This is used later to determine when to load / unload UI.

Definition at line 22 of file BackgroundApp.cs.

LaunchActivatedEventArgs LaunchArgs

Definition at line 29 of file App.xaml.cs.

CoreDispatcher mainDispatcher [private]

Definition at line 134 of file SampleConfiguration.cs.

int mainViewId [private]

Definition at line 143 of file SampleConfiguration.cs.

RootFrameNavigationHelper rootFrameNavigationHelper [private]

Definition at line 19 of file App.xaml.cs.

ObservableCollection<ViewLifetimeControl> SecondaryViews = new ObservableCollection<ViewLifetimeControl>()

Definition at line 101 of file SampleConfiguration.cs.

const string sessionStateFilename = "_sessionState.xml" [private]

Definition at line 18 of file App.xaml.cs.

Property Documentation

CoreDispatcher MainDispatcher [get]

Definition at line 136 of file SampleConfiguration.cs.

int MainViewId [get]

Definition at line 145 of file SampleConfiguration.cs.

The documentation for this class was generated from the following files:
  • AssociationLaunching/cs/SampleConfiguration.cs
  • BackgroundMediaPlayback/cs/BackgroundApp.cs
  • BasicSuspension/cs/App.xaml.cs
  • MultipleViews/cs/SampleConfiguration.cs
  • Nfc/Nfc/App.xaml.cs
  • Projection/cs/App.xaml.cs
  • BackButton/cs/App.xaml.cs
  • BackgroundActivation/cpp/pch.h
  • BackgroundActivation/cs/SampleConfiguration.cs
  • BackgroundMediaPlayback/cs/App.xaml.cs
  • ContactCardIntegration/cs/SampleConfiguration.cs
  • ContactPanel/cs/SampleConfiguration.cs
  • FilePickerContracts/cs/App.xaml.cs
  • FilePickerContracts/cs/App.xaml.custom.cs
  • JumpList/cpp/SampleConfiguration.h
  • JumpList/cs/SampleConfiguration.cs
  • MediaImport/cs/App.xaml.cs
  • MultipleViews/cs/App.xaml.cs
  • SecondaryTiles/cs/SampleConfiguration.cs
  • ShareSource/cpp/SampleConfiguration.h
  • ShareSource/cs/SampleConfiguration.cs
  • ShareTarget/cs/SampleConfiguration.cs
  • SplashScreen/cs/App.xaml.cs
  • UserActivity/cs/SampleConfiguration.cs
  • XamlGamepadNavigation/cs/SampleConfiguration.cs
  • BackButton/cpp/App.xaml.cpp
  • BackgroundActivation/cpp/SampleConfiguration.cpp
  • D2DSvgImage/cpp/App.xaml.cpp
  • KeyCredentialManager/cpp/App.xaml.cpp
  • LowLatencyInput/cpp/App.xaml.cpp
  • XamlBind/cpp/App.xaml.cpp
  • XamlCommanding/cpp/App.xaml.cpp
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppContactPanel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AppContactPanel
Public Member Functions | Private Member Functions | Private Attributes

AppContactPanel Class Reference

A page that is hosted within the MyPeople flyout on the taskbar.

List of all members.

Public Member Functions

AppContactPanel ()
async Task< string > | GetRemoteIdForContactAsync (Contact fullContact)
async Task | InitializePageAsync ()
async void | OnActivated (ContactPanelActivatedEventArgs args)

Private Member Functions

async void | AllowAccess_Click (object sender, RoutedEventArgs e)
async void | AppContactPanel_LaunchFullAppRequested (ContactPanel sender, ContactPanelLaunchFullAppRequestedEventArgs args)
async void | OnWindowActivated (object sender, WindowActivatedEventArgs e)

Private Attributes

string | _appContactId = string.Empty
Contact | fullContact = null
Contact | lightContact = null

Detailed Description

Definition at line 26 of file AppContactPanel.xaml.cs.

Constructor & Destructor Documentation

AppContactPanel ( ) [inline]

Definition at line 32 of file AppContactPanel.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AllowAccess_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 127 of file AppContactPanel.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-contacts"));
        }

async void AppContactPanel_LaunchFullAppRequested | ( | ContactPanel | sender,
 |  | ContactPanelLaunchFullAppRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 110 of file AppContactPanel.xaml.cs.

        {
            // callback to relaunch the sample app as a protocol launch with the remoteID for the current
            // contact as a launcher argument.
            args.Handled = true;
            await this.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                async () =>
                {
                    LauncherOptions options = new LauncherOptions();
                    options.TargetApplicationPackageFamilyName = Windows.ApplicationModel.Package.Current.Id.FamilyName;

                    await Launcher.LaunchUriAsync(new Uri($"{Constants.Protocol}:?ContactRemoteId={Uri.EscapeDataString(_appContactId)}"), options);
                    sender.ClosePanel();
                });
        }

async Task<string> GetRemoteIdForContactAsync ( Contact fullContact ) [inline]

Definition at line 96 of file AppContactPanel.xaml.cs.

        {
            var contactAnnotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

            var contactAnnotations = await contactAnnotationStore.FindAnnotationsForContactAsync(fullContact);

            if (contactAnnotations.Count >= 0)
            {
                return contactAnnotations[0].RemoteId;
            }

            return string.Empty;
        }

async Task InitializePageAsync ( ) [inline]

Definition at line 52 of file AppContactPanel.xaml.cs.

        {
            if (fullContact == null)
            {
                ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
                try
                {
                    fullContact = await store.GetContactAsync(lightContact.Id);
                }
                catch
                {
                    // User denied access to the contact database.
                }
            }

            if (fullContact != null)
            {
                // Now that we have a full Contact object, we can do richer operations such as querying the display name
                this.contactName.Text = fullContact.DisplayName;

                // This is the remoteId that your app annotated the contact with on creation
                this.remoteId.Text = _appContactId = await GetRemoteIdForContactAsync(fullContact);

                if (RequestContactAccessPanel.Visibility == Visibility.Visible)
                {
                    Window.Current.Activated -= OnWindowActivated;
                    ContactHistoryPanel.Visibility = Visibility.Visible;
                    RequestContactAccessPanel.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                // Prompt the user to grant access to contacts.
                if (RequestContactAccessPanel.Visibility == Visibility.Collapsed)
                {
                    ContactHistoryPanel.Visibility = Visibility.Collapsed;
                    RequestContactAccessPanel.Visibility = Visibility.Visible;

                    // Re-check each time we regain activation.
                    Window.Current.Activated += OnWindowActivated;
                }
            }
        }

async void OnActivated ( ContactPanelActivatedEventArgs args ) [inline]

Definition at line 37 of file AppContactPanel.xaml.cs.

        {
            // Register the handler for a full app launch from the My People flyout
            args.ContactPanel.LaunchFullAppRequested += AppContactPanel_LaunchFullAppRequested;

            // Apply some customization.
            args.ContactPanel.HeaderColor = Windows.UI.Colors.LightBlue;

            // The Contact object that is passed in with ContactPanelActivatedEventArgs is not very usable,
            // we need to obtain a full contact from the ContactStore in order to do anything interesting.
            lightContact = args.Contact;

            await InitializePageAsync();
        }

async void OnWindowActivated | ( | object | sender,
 |  | WindowActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 132 of file AppContactPanel.xaml.cs.

        {
            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                await InitializePageAsync();
            }
        }

Member Data Documentation

string _appContactId = string.Empty [private]

Definition at line 28 of file AppContactPanel.xaml.cs.

Contact fullContact = null [private]

Definition at line 30 of file AppContactPanel.xaml.cs.

Contact lightContact = null [private]

Definition at line 29 of file AppContactPanel.xaml.cs.

The documentation for this class was generated from the following file:
  • ContactPanel/cs/AppContactPanel.xaml.cs
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AppException
Public Member Functions

AppException Class Reference

List of all members.

Public Member Functions

AppException ()
AppException (string message)

Detailed Description

Definition at line 486 of file LoggingSessionScenario.cs.

Constructor & Destructor Documentation

AppException ( ) [inline]

Definition at line 488 of file LoggingSessionScenario.cs.

        {
        }

AppException ( string message ) [inline]

Definition at line 492 of file LoggingSessionScenario.cs.

            : base(message)
        {
        }

The documentation for this class was generated from the following file:
  • Logging/cs/LoggingSessionScenario.cs
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationTriggerTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ApplicationTriggerTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ApplicationTriggerTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ApplicationTriggerTask ()
ApplicationTriggerTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
async void | SignalBackgroundTask (object sender, RoutedEventArgs e)
async void | SignalBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

MainPage rootPage = MainPage.Current
ApplicationTrigger | trigger = null

Detailed Description

Definition at line 28 of file Scenario5_ApplicationTriggerTask.xaml.cs.

Constructor & Destructor Documentation

ApplicationTriggerTask ( ) [inline]

Definition at line 37 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            this.InitializeComponent();
        }

ApplicationTriggerTask ( ) [inline]

Definition at line 37 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 110 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 111 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 136 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 137 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.ApplicationTriggerTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.ApplicationTriggerTaskName, true);
                    break;
                }
            }

            trigger = new ApplicationTrigger();
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.ApplicationTriggerTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.ApplicationTriggerTaskName, true);
                    break;
                }
            }

            trigger = new ApplicationTrigger();
            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 122 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.ApplicationTriggerTaskProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 121 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.ApplicationTriggerTaskProgress = progress;
                UpdateUI();
            });
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 68 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.ApplicationTriggerTaskName,
                                                                   trigger,
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 68 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
                                                                   BackgroundTaskSample.ApplicationTriggerTaskName,
                                                                   trigger,
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

async void SignalBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Signal a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 95 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            // Reset the completion status
            BackgroundTaskSample.TaskStatuses.Remove(BackgroundTaskSample.ApplicationTriggerTaskName);

            //Signal the ApplicationTrigger
            var result = await trigger.RequestAsync();
            BackgroundTaskSample.ApplicationTriggerTaskResult = "Signal result: " + result.ToString();
            UpdateUI();
        }

async void SignalBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Signal a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 95 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            // Reset the completion status
            var settings = ApplicationData.Current.LocalSettings;
            settings.Values.Remove(BackgroundTaskSample.ApplicationTriggerTaskName);

            //Signal the ApplicationTrigger
            var result = await trigger.RequestAsync();
            BackgroundTaskSample.ApplicationTriggerTaskResult = "Signal result: " + result.ToString();
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 83 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.ApplicationTriggerTaskName);
            BackgroundTaskSample.ApplicationTriggerTaskResult = "";
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a ApplicationTriggerTask.

Parameters:
sender
e

Definition at line 83 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.ApplicationTriggerTaskName);
            BackgroundTaskSample.ApplicationTriggerTaskResult = "";
            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 144 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.ApplicationTriggerTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.ApplicationTriggerTaskRegistered;
                SignalButton.IsEnabled = BackgroundTaskSample.ApplicationTriggerTaskRegistered & (trigger != null);
                Progress.Text = BackgroundTaskSample.ApplicationTriggerTaskProgress;
                Result.Text = BackgroundTaskSample.ApplicationTriggerTaskResult;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.ApplicationTriggerTaskName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 145 of file Scenario5_ApplicationTriggerTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.ApplicationTriggerTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.ApplicationTriggerTaskRegistered;
                SignalButton.IsEnabled = BackgroundTaskSample.ApplicationTriggerTaskRegistered & (trigger != null);
                Progress.Text = BackgroundTaskSample.ApplicationTriggerTaskProgress;
                Result.Text = BackgroundTaskSample.ApplicationTriggerTaskResult;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.ApplicationTriggerTaskName);
            });
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario5_ApplicationTriggerTask.xaml.cs.

ApplicationTrigger trigger = null [private]

Definition at line 35 of file Scenario5_ApplicationTriggerTask.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario5_ApplicationTriggerTask.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cs
  • BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cpp
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCapturePermissions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • AudioCapturePermissions
Static Public Member Functions | Static Private Attributes

AudioCapturePermissions Class Reference

List of all members.

Static Public Member Functions

static async Task< bool > | RequestMicrophonePermission ()

Static Private Attributes

static int | NoCaptureDevicesHResult = -1072845856

Detailed Description

Definition at line 18 of file AudioCapturePermissions.cs.

Member Function Documentation

static async Task<bool> RequestMicrophonePermission ( ) [inline, static]

On desktop/tablet systems, users are prompted to give permission to use capture devices on a per-app basis.

Along with declaring the microphone DeviceCapability in the package manifest, this method tests the privacy setting for microphone access for this application. Note that this only checks the Settings->Privacy->Microphone setting, it does not handle the Cortana/Dictation privacy check, however (Under Settings->Privacy->Speech, Inking and Typing).

Developers should ideally perform a check like this every time their app gains focus, in order to check if the user has changed the setting while the app was suspended or not in focus.

Returns:
true if the microphone can be accessed without any permissions problems.

Definition at line 35 of file AudioCapturePermissions.cs.

        {
            try
            {
                // Request access to the microphone only, to limit the number of capabilities we need
                // to request in the package manifest.
                MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
                settings.StreamingCaptureMode = StreamingCaptureMode.Audio;
                settings.MediaCategory = MediaCategory.Speech;
                MediaCapture capture = new MediaCapture();

                await capture.InitializeAsync(settings);
            }
            catch (TypeLoadException)
            {
                // On SKUs without media player (eg, the N SKUs), we may not have access to the Windows.Media.Capture
                // namespace unless the media player pack is installed. Handle this gracefully.
                var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components are unavailable.");
                await messageDialog.ShowAsync();
                return false;
            }
            catch (UnauthorizedAccessException)
            {
                // The user has turned off access to the microphone. If this occurs, we should show an error, or disable
                // functionality within the app to ensure that further exceptions aren't generated when
                // recognition is attempted.
                return false;
            }
            catch (Exception exception)
            {
                // This can be replicated by using remote desktop to a system, but not redirecting the microphone input.
                // Can also occur if using the virtual machine console tool to access a VM instead of using remote desktop.
                if (exception.HResult == NoCaptureDevicesHResult)
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog("No Audio Capture devices are present on this system.");
                    await messageDialog.ShowAsync();
                    return false;
                }
                else
                {
                    throw;
                }
            }
            return true;
        }

Member Data Documentation

int NoCaptureDevicesHResult = -1072845856 [static, private]

Definition at line 22 of file AudioCapturePermissions.cs.

The documentation for this class was generated from the following file:
  • SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BackgroundActivity
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

BackgroundActivity Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Static Public Member Functions

static void | Start (BackgroundTaskRegistrationGroup sender, BackgroundActivatedEventArgs args)
static void | Start (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
void | PeriodicTimerCallback (ThreadPoolTimer timer)

Private Attributes

BackgroundTaskCancellationReason | _cancelReason = BackgroundTaskCancellationReason.Abort
volatile bool | _cancelRequested = false
BackgroundTaskDeferral | _deferral = null
ThreadPoolTimer | _periodicTimer = null
uint | _progress = 0
IBackgroundTaskInstance | _taskInstance = null

Detailed Description

Definition at line 22 of file BackgroundActivity.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 62 of file BackgroundActivity.cs.

        {
            //
            // Indicate that the background task is canceled.
            //
            _cancelRequested = true;
            _cancelReason = reason;

            Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
        }

void PeriodicTimerCallback ( ThreadPoolTimer timer ) [inline, private]

Definition at line 76 of file BackgroundActivity.cs.

        {
            if ((_cancelRequested == false) && (_progress < 100))
            {
                _progress += 10;
                _taskInstance.Progress = _progress;
            }
            else
            {
                _periodicTimer.Cancel();

                var key = _taskInstance.Task.Name;

                //
                // Record that this background task ran.
                //
                String taskStatus = (_progress < 100) ? "Canceled with reason: " + _cancelReason.ToString() : "Completed";
                BackgroundTaskSample.TaskStatuses[key] = taskStatus;
                Debug.WriteLine("Background " + _taskInstance.Task.Name + taskStatus);

                //
                // Indicate that the background task has completed.
                //
                _deferral.Complete();
            }
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 34 of file BackgroundActivity.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");

            //
            // Query BackgroundWorkCost
            // Guidance: If BackgroundWorkCost is high, then perform only the minimum amount
            // of work in the background task and return immediately.
            //
            var cost = BackgroundWorkCost.CurrentBackgroundWorkCost;

            //
            // Associate a cancellation handler with the background task.
            //
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            //
            // Get the deferral object from the task instance, and take a reference to the taskInstance;
            //
            _deferral = taskInstance.GetDeferral();
            _taskInstance = taskInstance;

            _periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(new TimerElapsedHandler(PeriodicTimerCallback), TimeSpan.FromSeconds(1));
        }

static void Start ( IBackgroundTaskInstance taskInstance ) [inline, static]

Definition at line 108 of file BackgroundActivity.cs.

        {
            // Use the taskInstance.Name and/or taskInstance.InstanceId to determine
            // what background activity to perform. In this sample, all of our
            // background activities are the same, so there is nothing to check.
            var activity = new BackgroundActivity();
            activity.Run(taskInstance);
        }

static void Start | ( | BackgroundTaskRegistrationGroup | sender,
 |  | BackgroundActivatedEventArgs | args |
 | ) |  |  | [inline, static]

Definition at line 103 of file BackgroundActivity.cs.

        {
            Start(args.TaskInstance);
        }

Member Data Documentation

BackgroundTaskCancellationReason _cancelReason = BackgroundTaskCancellationReason.Abort [private]

Definition at line 24 of file BackgroundActivity.cs.

volatile bool _cancelRequested = false [private]

Definition at line 25 of file BackgroundActivity.cs.

BackgroundTaskDeferral _deferral = null [private]

Definition at line 26 of file BackgroundActivity.cs.

ThreadPoolTimer _periodicTimer = null [private]

Definition at line 27 of file BackgroundActivity.cs.

uint _progress = 0 [private]

Definition at line 28 of file BackgroundActivity.cs.

IBackgroundTaskInstance _taskInstance = null [private]

Definition at line 29 of file BackgroundActivity.cs.

The documentation for this class was generated from the following file:
  • BackgroundActivation/cs/BackgroundActivity.cs
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundAuthenticationCompletedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BackgroundAuthenticationCompletedEventArgs
Public Member Functions | Public Attributes | Properties

BackgroundAuthenticationCompletedEventArgs Class Reference

List of all members.

Public Member Functions

BackgroundAuthenticationCompletedEventArgs (Exception exception)

Public Attributes

bool | Succeeded = > ExtendedError == null

Properties

Exception | ExtendedError [get, set]

Detailed Description

Definition at line 20 of file ScenarioCommon.cs.

Constructor & Destructor Documentation

BackgroundAuthenticationCompletedEventArgs ( Exception exception ) [inline]

Definition at line 22 of file ScenarioCommon.cs.

        {
            ExtendedError = exception;
        }

Member Data Documentation

bool Succeeded = > ExtendedError == null

Definition at line 26 of file ScenarioCommon.cs.

Property Documentation

Exception ExtendedError [get, set]

Definition at line 27 of file ScenarioCommon.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/ScenarioCommon.cs
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTaskSample Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BackgroundTaskSample
Static Public Member Functions | Public Attributes | Static Public Attributes

BackgroundTaskSample Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static String | GetBackgroundTaskStatus (String^name)
static String | GetBackgroundTaskStatus (String name)
static String | GetBackgroundTaskStatus (String name)
static String | GetBackgroundTaskStatus (String^name)
static
BackgroundTaskRegistrationGroup 		GetTaskGroup (String^id, String^groupName)
static
BackgroundTaskRegistrationGroup 		GetTaskGroup (String^id, String^groupName)
static
BackgroundTaskRegistrationGroup 		GetTaskGroup (string id, string groupName)
static
BackgroundTaskRegistrationGroup 		GetTaskGroup (string id, string groupName)
static BackgroundTaskRegistration | RegisterBackgroundTask (String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group=null)
static BackgroundTaskRegistration | RegisterBackgroundTask (String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group=null)
static BackgroundTaskRegistration | RegisterBackgroundTask (String^taskEntryPoint, String^name, IBackgroundTrigger^trigger, IBackgroundCondition^condition, BackgroundTaskRegistrationGroup^group=nullptr)
static BackgroundTaskRegistration | RegisterBackgroundTask (String^taskEntryPoint, String^name, IBackgroundTrigger^trigger, IBackgroundCondition^condition, BackgroundTaskRegistrationGroup^group=nullptr)
static void | RemoveBackgroundTaskStatus (String^name)
static bool | TaskRequiresBackgroundAccess (String^name)
static bool | TaskRequiresBackgroundAccess (String name)
static bool | TaskRequiresBackgroundAccess (String name)
static bool | TaskRequiresBackgroundAccess (String^name)
static void | UnregisterBackgroundTasks (String^name, BackgroundTaskRegistrationGroup^group=nullptr)
static void | UnregisterBackgroundTasks (String name, BackgroundTaskRegistrationGroup group=null)
static void | UnregisterBackgroundTasks (String^name, BackgroundTaskRegistrationGroup^group=nullptr)
static void | UnregisterBackgroundTasks (String name, BackgroundTaskRegistrationGroup group=null)
static void | UpdateBackgroundTaskRegistrationStatus (String^name, bool registered)
static void | UpdateBackgroundTaskRegistrationStatus (String name, bool registered)
static void | UpdateBackgroundTaskRegistrationStatus (String^name, bool registered)
static void | UpdateBackgroundTaskRegistrationStatus (String name, bool registered)

Public Attributes

const string | ApplicationTriggerTaskName = "ApplicationTriggerTask"
const string | BackgroundTaskGroupFriendlyName = "Background Task Group"
const string | BackgroundTaskGroupId = "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
const string | GroupedBackgroundTaskName = "GroupedBackgroundTask"
const string | SampleBackgroundTaskEntryPoint = "Tasks.SampleBackgroundTask"
const string | SampleBackgroundTaskName = "SampleBackgroundTask"
const string | SampleBackgroundTaskWithConditionName = "SampleBackgroundTaskWithCondition"
const string | ServicingCompleteTaskEntryPoint = "Tasks.ServicingComplete"
const string | ServicingCompleteTaskName = "ServicingCompleteTask"
const string | TimeTriggeredTaskName = "TimeTriggeredTask"

Static Public Attributes

static String | ApplicationTriggerTaskProgress = ""
static string | ApplicationTriggerTaskProgress = ""
static bool | ApplicationTriggerTaskRegistered = false
static String | ApplicationTriggerTaskResult = ""
static string | ApplicationTriggerTaskResult = ""
static string | GroupedBackgroundTaskProgress = ""
static String | GroupedBackgroundTaskProgress = ""
static bool | GroupedBackgroundTaskRegistered = false
static String | SampleBackgroundTaskProgress = ""
static string | SampleBackgroundTaskProgress = ""
static bool | SampleBackgroundTaskRegistered = false
static string | SampleBackgroundTaskWithConditionProgress = ""
static String | SampleBackgroundTaskWithConditionProgress = ""
static bool | SampleBackgroundTaskWithConditionRegistered = false
static String | ServicingCompleteTaskProgress = ""
static string | ServicingCompleteTaskProgress = ""
static bool | ServicingCompleteTaskRegistered = false
static
Windows::Foundation::Collections::PropertySet 		TaskStatuses = ref new PropertySet()
static PropertySet | TaskStatuses = new PropertySet()
static String | TimeTriggeredTaskProgress = ""
static string | TimeTriggeredTaskProgress = ""
static bool | TimeTriggeredTaskRegistered = false

Detailed Description

Definition at line 62 of file SampleConfiguration.h.

Member Function Documentation

String GetBackgroundTaskStatus ( String^ name ) [static]

Definition at line 56 of file SampleConfiguration.cpp.

{
    auto registered = false;
    if (name == SampleBackgroundTaskName)
    {
        registered = BackgroundTaskSample::SampleBackgroundTaskRegistered;
    }
    else if (name == SampleBackgroundTaskWithConditionName)
    {
        registered = BackgroundTaskSample::SampleBackgroundTaskWithConditionRegistered;
    }
    else if (name == ServicingCompleteTaskName)
    {
        registered = BackgroundTaskSample::ServicingCompleteTaskRegistered;
    }
    else if (name == TimeTriggeredTaskName)
    {
        registered = BackgroundTaskSample::TimeTriggeredTaskRegistered;
    }
    else if (name == ApplicationTriggerTaskName)
    {
        registered = BackgroundTaskSample::ApplicationTriggerTaskRegistered;
    }
    else if (name == GroupedBackgroundTaskName)
    {
        registered = BackgroundTaskSample::GroupedBackgroundTaskRegistered;
    }

    String^ status = registered ? "Registered" : "Unregistered";

    if (TaskStatuses->HasKey(name))
    {
        status += " - " + TaskStatuses->Lookup(name)->ToString();
    }

    return status;
}

static String GetBackgroundTaskStatus ( String name ) [inline, static]

Get the registration / completion status of the background task with given name.

Parameters:
name Name of background task to retreive registration status.

Definition at line 227 of file SampleConfiguration.cs.

        {
            var registered = false;
            switch (name)
            {
                case SampleBackgroundTaskName:
                    registered = SampleBackgroundTaskRegistered;
                    break;
                case SampleBackgroundTaskWithConditionName:
                    registered = SampleBackgroundTaskWithConditionRegistered;
                    break;
                case ServicingCompleteTaskName:
                    registered = ServicingCompleteTaskRegistered;
                    break;
                case TimeTriggeredTaskName:
                    registered = TimeTriggeredTaskRegistered;
                    break;
                case ApplicationTriggerTaskName:
                    registered = ApplicationTriggerTaskRegistered;
                    break;
                case GroupedBackgroundTaskName:
                    registered = GroupedBackgroundTaskRegistered;
                    break;
            }

            var status = registered ? "Registered" : "Unregistered";

            object taskStatus;
            if (TaskStatuses.TryGetValue(name, out taskStatus))
            {
                status += " - " + taskStatus.ToString();
            }

            return status;
        }

static String GetBackgroundTaskStatus ( String name ) [inline, static]

Get the registration / completion status of the background task with given name.

Parameters:
name Name of background task to retreive registration status.

Definition at line 216 of file SampleConfiguration.cs.

        {
            var registered = false;
            switch (name)
            {
                case SampleBackgroundTaskName:
                    registered = SampleBackgroundTaskRegistered;
                    break;
                case SampleBackgroundTaskWithConditionName:
                    registered = SampleBackgroundTaskWithConditionRegistered;
                    break;
                case ServicingCompleteTaskName:
                    registered = ServicingCompleteTaskRegistered;
                    break;
                case TimeTriggeredTaskName:
                    registered = TimeTriggeredTaskRegistered;
                    break;
                case ApplicationTriggerTaskName:
                    registered = ApplicationTriggerTaskRegistered;
                    break;
                case GroupedBackgroundTaskName:
                    registered = GroupedBackgroundTaskRegistered;
                    break;
            }

            var status = registered ? "Registered" : "Unregistered";

            object taskStatus;
            var settings = ApplicationData.Current.LocalSettings;
            if (settings.Values.TryGetValue(name, out taskStatus))
            {
                status += " - " + taskStatus.ToString();
            }

            return status;
        }

static String GetBackgroundTaskStatus ( String^ name ) [static]
BackgroundTaskRegistrationGroup GetTaskGroup | ( | String^ | id,
 |  | String^ | groupName |
 | ) |  |  | [static]

Definition at line 191 of file SampleConfiguration.cpp.

{
    auto group = BackgroundTaskRegistration::GetTaskGroup(id);

    if (group == nullptr)
    {
        group = ref new BackgroundTaskRegistrationGroup(id, groupName);
    }

    return group;
}

static BackgroundTaskRegistrationGroup GetTaskGroup | ( | String^ | id,
 |  | String^ | groupName |
 | ) |  |  | [static]
static BackgroundTaskRegistrationGroup GetTaskGroup | ( | string | id,
 |  | string | groupName |
 | ) |  |  | [inline, static]

Retrieve a registered background task group.

If no group is registered with the given id, then create a new one and return it.

Returns:
The task group associated with the given id

Definition at line 180 of file SampleConfiguration.cs.

        {
            var group = BackgroundTaskRegistration.GetTaskGroup(id);

            if (group == null)
            {
                group = new BackgroundTaskRegistrationGroup(id, groupName);
            }

            return group;
        }

static BackgroundTaskRegistrationGroup GetTaskGroup | ( | string | id,
 |  | string | groupName |
 | ) |  |  | [inline, static]

Retrieve a registered background task group.

If no group is registered with the given id, then create a new one and return it.

Returns:
The task group associated with the given id

Definition at line 169 of file SampleConfiguration.cs.

        {
            var group = BackgroundTaskRegistration.GetTaskGroup(id);

            if (group == null)
            {
                group = new BackgroundTaskRegistrationGroup(id, groupName);
            }

            return group;
        }

static BackgroundTaskRegistration RegisterBackgroundTask | ( | String | taskEntryPoint,
 |  | String | name,
 |  | IBackgroundTrigger | trigger,
 |  | IBackgroundCondition | condition,
 |  | BackgroundTaskRegistrationGroup | group = null |
 | ) |  |  | [inline, static]

Register a background task with the specified taskEntryPoint, name, trigger, and condition (optional).

Parameters:
taskEntryPoint | Task entry point for the background task.
name | A name for the background task.
trigger | The trigger for the background task.
condition | An optional conditional event that must be true for the task to fire.

Definition at line 89 of file SampleConfiguration.cs.

        {
            if (TaskRequiresBackgroundAccess(name))
            {
                // If the user denies access, the task will not run.
                var requestTask = BackgroundExecutionManager.RequestAccessAsync();
            }

            var builder = new BackgroundTaskBuilder();

            builder.Name = name;

            if (taskEntryPoint != null)
            {
                // If you leave the TaskEntryPoint at its default value, then the task runs
                // inside the main process from OnBackgroundActivated rather than as a separate process.
                builder.TaskEntryPoint = taskEntryPoint;
            }

            builder.SetTrigger(trigger);

            if (condition != null)
            {
                builder.AddCondition(condition);

                //
                // If the condition changes while the background task is executing then it will
                // be canceled.
                //
                builder.CancelOnConditionLoss = true;
            }

            if (group != null)
            {
                builder.TaskGroup = group;
            }

            BackgroundTaskRegistration task = builder.Register();

            UpdateBackgroundTaskRegistrationStatus(name, true);

            //
            // Remove previous completion status.
            //
            TaskStatuses.Remove(name);

            return task;
        }

static BackgroundTaskRegistration RegisterBackgroundTask | ( | String | taskEntryPoint,
 |  | String | name,
 |  | IBackgroundTrigger | trigger,
 |  | IBackgroundCondition | condition,
 |  | BackgroundTaskRegistrationGroup | group = null |
 | ) |  |  | [inline, static]

Register a background task with the specified taskEntryPoint, name, trigger, and condition (optional).

Parameters:
taskEntryPoint | Task entry point for the background task.
name | A name for the background task.
trigger | The trigger for the background task.
condition | An optional conditional event that must be true for the task to fire.

Definition at line 84 of file SampleConfiguration.cs.

        {
            if (TaskRequiresBackgroundAccess(name))
            {
                // If the user denies access, the task will not run.
                var requestTask = BackgroundExecutionManager.RequestAccessAsync();
            }

            var builder = new BackgroundTaskBuilder();

            builder.Name = name;
            builder.TaskEntryPoint = taskEntryPoint;
            builder.SetTrigger(trigger);

            if (condition != null)
            {
                builder.AddCondition(condition);

                //
                // If the condition changes while the background task is executing then it will
                // be canceled.
                //
                builder.CancelOnConditionLoss = true;
            }

            if (group != null)
            {
                builder.TaskGroup = group;
            }

            BackgroundTaskRegistration task = builder.Register();

            UpdateBackgroundTaskRegistrationStatus(name, true);

            //
            // Remove previous completion status.
            //
            var settings = ApplicationData.Current.LocalSettings;
            settings.Values.Remove(name);

            return task;
        }

BackgroundTaskRegistration RegisterBackgroundTask | ( | String^ | taskEntryPoint,
 |  | String^ | name,
 |  | IBackgroundTrigger^ | trigger,
 |  | IBackgroundCondition^ | condition,
 |  | BackgroundTaskRegistrationGroup^ | group = nullptr |
 | ) |  |  | [static]

Definition at line 94 of file SampleConfiguration.cpp.

{
    if (TaskRequiresBackgroundAccess(name))
    {
        BackgroundExecutionManager::RequestAccessAsync();
    }

    auto builder = ref new BackgroundTaskBuilder();

    builder->Name = name;

    if (taskEntryPoint != nullptr)
    {
        // If you leave the TaskEntryPoint at its default value, then the task runs
        // inside the main process from OnBackgroundActivated rather than as a separate process.
        builder->TaskEntryPoint = taskEntryPoint;
    }

    builder->SetTrigger(trigger);

    if (condition != nullptr)
    {
        builder->AddCondition(condition);

        //
        // If the condition changes while the background task is executing then it will
        // be canceled.
        //
        builder->CancelOnConditionLoss = true;
    }

    if (group != nullptr)
    {
        builder->TaskGroup = group;
    }

    auto task = builder->Register();

    UpdateBackgroundTaskRegistrationStatus(name, true);

    //
    // Remove previous completion status.
    //
    RemoveBackgroundTaskStatus(name);

    return task;
}

static BackgroundTaskRegistration RegisterBackgroundTask | ( | String^ | taskEntryPoint,
 |  | String^ | name,
 |  | IBackgroundTrigger^ | trigger,
 |  | IBackgroundCondition^ | condition,
 |  | BackgroundTaskRegistrationGroup^ | group = nullptr |
 | ) |  |  | [static]
void RemoveBackgroundTaskStatus ( String^ name ) [static]

Definition at line 232 of file SampleConfiguration.cpp.

{
    if (TaskStatuses->HasKey(name))
    {
        TaskStatuses->Remove(name);
    }
}

static bool TaskRequiresBackgroundAccess ( String^ name ) [static]
static bool TaskRequiresBackgroundAccess ( String name ) [inline, static]

Determine if task with given name requires background access.

Parameters:
name Name of background task to query background access requirement.

Definition at line 257 of file SampleConfiguration.cs.

        {
            if ((name == TimeTriggeredTaskName) ||
                (name == ApplicationTriggerTaskName))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

static bool TaskRequiresBackgroundAccess ( String name ) [inline, static]

Determine if task with given name requires background access.

Parameters:
name Name of background task to query background access requirement.

Definition at line 267 of file SampleConfiguration.cs.

        {
            if ((name == TimeTriggeredTaskName) ||
                (name == ApplicationTriggerTaskName))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

bool TaskRequiresBackgroundAccess ( String^ name ) [static]

Definition at line 142 of file SampleConfiguration.cpp.

{
    if ((name == TimeTriggeredTaskName) ||
        (name == ApplicationTriggerTaskName))
    {
        return true;
    }
    else
    {
        return false;
    }
}

void UnregisterBackgroundTasks | ( | String^ | name,
 |  | BackgroundTaskRegistrationGroup^ | group = nullptr |
 | ) |  |  | [static]

Definition at line 155 of file SampleConfiguration.cpp.

{
    //
    // If the given task group is registered then loop through all background tasks associated with it
    // and unregister any with the name passed into this function.
    //
    if (group != nullptr)
    {
        for (auto pair : group->AllTasks)
        {
            auto task = pair->Value;
            if (task->Name == name)
            {
                task->Unregister(true);
            }
        }
    }
    else
    {
        //
        // Loop through all ungrouped background tasks and unregister any with the name passed into this function.
        //
        for (auto pair : BackgroundTaskRegistration::AllTasks)
        {
            auto task = pair->Value;
            if (task->Name == name)
            {
                task->Unregister(true);
            }
        }
    }

    UpdateBackgroundTaskRegistrationStatus(name, false);
}

static void UnregisterBackgroundTasks | ( | String | name,
 |  | BackgroundTaskRegistrationGroup | group = null |
 | ) |  |  | [inline, static]

Unregister background tasks with specified name.

Parameters:
name Name of the background task to unregister.

Definition at line 142 of file SampleConfiguration.cs.

        {
            //
            // If the given task group is registered then loop through all background tasks associated with it
            // and unregister any with the given name.
            //
            if (group != null)
            {
                foreach (var cur in group.AllTasks)
                {
                    if (cur.Value.Name == name)
                    {
                        cur.Value.Unregister(true);
                    }
                }
            }
            else
            {
                //
                // Loop through all ungrouped background tasks and unregister any with the given name.
                //
                foreach (var cur in BackgroundTaskRegistration.AllTasks)
                {
                    if (cur.Value.Name == name)
                    {
                        cur.Value.Unregister(true);
                    }
                }
            }

            UpdateBackgroundTaskRegistrationStatus(name, false);
        }

static void UnregisterBackgroundTasks | ( | String^ | name,
 |  | BackgroundTaskRegistrationGroup^ | group = nullptr |
 | ) |  |  | [static]
static void UnregisterBackgroundTasks | ( | String | name,
 |  | BackgroundTaskRegistrationGroup | group = null |
 | ) |  |  | [inline, static]

Unregister background tasks with specified name.

Parameters:
name Name of the background task to unregister.

Definition at line 131 of file SampleConfiguration.cs.

        {
            //
            // If the given task group is registered then loop through all background tasks associated with it
            // and unregister any with the given name.
            //
            if (group != null)
            {
                foreach (var cur in group.AllTasks)
                {
                    if (cur.Value.Name == name)
                    {
                        cur.Value.Unregister(true);
                    }
                }
            }
            else
            {
                //
                // Loop through all ungrouped background tasks and unregister any with the given name.
                //
                foreach (var cur in BackgroundTaskRegistration.AllTasks)
                {
                    if (cur.Value.Name == name)
                    {
                        cur.Value.Unregister(true);
                    }
                }
            }

            UpdateBackgroundTaskRegistrationStatus(name, false);
        }

static void UpdateBackgroundTaskRegistrationStatus | ( | String^ | name,
 |  | bool | registered |
 | ) |  |  | [static]
static void UpdateBackgroundTaskRegistrationStatus | ( | String | name,
 |  | bool | registered |
 | ) |  |  | [inline, static]

Store the registration status of a background task with a given name.

Parameters:
name | Name of background task to store registration status for.
registered | TRUE if registered, FALSE if unregistered.

Definition at line 186 of file SampleConfiguration.cs.

        {
            switch (name)
            {
                case SampleBackgroundTaskName:
                    SampleBackgroundTaskRegistered = registered;
                    break;
                case SampleBackgroundTaskWithConditionName:
                    SampleBackgroundTaskWithConditionRegistered = registered;
                    break;
                case ServicingCompleteTaskName:
                    ServicingCompleteTaskRegistered = registered;
                    break;
                case TimeTriggeredTaskName:
                    TimeTriggeredTaskRegistered = registered;
                    break;
                case ApplicationTriggerTaskName:
                    ApplicationTriggerTaskRegistered = registered;
                    break;
                case GroupedBackgroundTaskName:
                    GroupedBackgroundTaskRegistered = registered;
                    break;
            }
        }

void UpdateBackgroundTaskRegistrationStatus | ( | String^ | name,
 |  | bool | registered |
 | ) |  |  | [static]

Definition at line 204 of file SampleConfiguration.cpp.

{
    if (name == SampleBackgroundTaskName)
    {
        BackgroundTaskSample::SampleBackgroundTaskRegistered = registered;
    }
    else if (name == SampleBackgroundTaskWithConditionName)
    {
        BackgroundTaskSample::SampleBackgroundTaskWithConditionRegistered = registered;
    }
    else if (name == ServicingCompleteTaskName)
    {
        BackgroundTaskSample::ServicingCompleteTaskRegistered = registered;
    }
    else if (name == TimeTriggeredTaskName)
    {
        BackgroundTaskSample::TimeTriggeredTaskRegistered = registered;
    }
    else if (name == ApplicationTriggerTaskName)
    {
        BackgroundTaskSample::ApplicationTriggerTaskRegistered = registered;
    }
    else if (name == GroupedBackgroundTaskName)
    {
        BackgroundTaskSample::GroupedBackgroundTaskRegistered = registered;
    }
}

static void UpdateBackgroundTaskRegistrationStatus | ( | String | name,
 |  | bool | registered |
 | ) |  |  | [inline, static]

Store the registration status of a background task with a given name.

Parameters:
name | Name of background task to store registration status for.
registered | TRUE if registered, FALSE if unregistered.

Definition at line 197 of file SampleConfiguration.cs.

        {
            switch (name)
            {
                case SampleBackgroundTaskName:
                    SampleBackgroundTaskRegistered = registered;
                    break;
                case SampleBackgroundTaskWithConditionName:
                    SampleBackgroundTaskWithConditionRegistered = registered;
                    break;
                case ServicingCompleteTaskName:
                    ServicingCompleteTaskRegistered = registered;
                    break;
                case TimeTriggeredTaskName:
                    TimeTriggeredTaskRegistered = registered;
                    break;
                case ApplicationTriggerTaskName:
                    ApplicationTriggerTaskRegistered = registered;
                    break;
                case GroupedBackgroundTaskName:
                    GroupedBackgroundTaskRegistered = registered;
                    break;
            }
        }

Member Data Documentation

const string ApplicationTriggerTaskName = "ApplicationTriggerTask"

Definition at line 66 of file SampleConfiguration.cs.

static string ApplicationTriggerTaskProgress = "" [static]

Definition at line 85 of file SampleConfiguration.h.

string ApplicationTriggerTaskProgress = "" [static]

Definition at line 67 of file SampleConfiguration.cs.

static bool ApplicationTriggerTaskRegistered = false [static]

Definition at line 86 of file SampleConfiguration.h.

static string ApplicationTriggerTaskResult = "" [static]

Definition at line 87 of file SampleConfiguration.h.

string ApplicationTriggerTaskResult = "" [static]

Definition at line 68 of file SampleConfiguration.cs.

const string BackgroundTaskGroupFriendlyName = "Background Task Group"

Definition at line 73 of file SampleConfiguration.cs.

const string BackgroundTaskGroupId = "3F2504E0-5F89-41D3-9A0C-0405E82C3333"

Definition at line 72 of file SampleConfiguration.cs.

const string GroupedBackgroundTaskName = "GroupedBackgroundTask"

Definition at line 71 of file SampleConfiguration.cs.

static string GroupedBackgroundTaskProgress = "" [static]

Definition at line 89 of file SampleConfiguration.h.

string GroupedBackgroundTaskProgress = "" [static]

Definition at line 74 of file SampleConfiguration.cs.

static bool GroupedBackgroundTaskRegistered = false [static]

Definition at line 90 of file SampleConfiguration.h.

const string SampleBackgroundTaskEntryPoint = "Tasks.SampleBackgroundTask"

Definition at line 47 of file SampleConfiguration.cs.

const string SampleBackgroundTaskName = "SampleBackgroundTask"

Definition at line 50 of file SampleConfiguration.cs.

string SampleBackgroundTaskProgress = "" [static]

Definition at line 51 of file SampleConfiguration.cs.

static string SampleBackgroundTaskProgress = "" [static]

Definition at line 73 of file SampleConfiguration.h.

static bool SampleBackgroundTaskRegistered = false [static]

Definition at line 74 of file SampleConfiguration.h.

const string SampleBackgroundTaskWithConditionName = "SampleBackgroundTaskWithCondition"

Definition at line 54 of file SampleConfiguration.cs.

string SampleBackgroundTaskWithConditionProgress = "" [static]

Definition at line 55 of file SampleConfiguration.cs.

static string SampleBackgroundTaskWithConditionProgress = "" [static]

Definition at line 76 of file SampleConfiguration.h.

static bool SampleBackgroundTaskWithConditionRegistered = false [static]

Definition at line 77 of file SampleConfiguration.h.

const string ServicingCompleteTaskEntryPoint = "Tasks.ServicingComplete"

Definition at line 56 of file SampleConfiguration.cs.

const string ServicingCompleteTaskName = "ServicingCompleteTask"

Definition at line 58 of file SampleConfiguration.cs.

string ServicingCompleteTaskProgress = "" [static]

Definition at line 59 of file SampleConfiguration.cs.

static string ServicingCompleteTaskProgress = "" [static]

Definition at line 79 of file SampleConfiguration.h.

static bool ServicingCompleteTaskRegistered = false [static]

Definition at line 80 of file SampleConfiguration.h.

PropertySet TaskStatuses = new PropertySet() [static]

Definition at line 79 of file SampleConfiguration.cs.

PropertySet TaskStatuses = ref new PropertySet() [static]

Definition at line 92 of file SampleConfiguration.h.

const string TimeTriggeredTaskName = "TimeTriggeredTask"

Definition at line 62 of file SampleConfiguration.cs.

string TimeTriggeredTaskProgress = "" [static]

Definition at line 63 of file SampleConfiguration.cs.

static string TimeTriggeredTaskProgress = "" [static]

Definition at line 82 of file SampleConfiguration.h.

static bool TimeTriggeredTaskRegistered = false [static]

Definition at line 83 of file SampleConfiguration.h.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cpp/SampleConfiguration.h
  • BackgroundActivation/cs/SampleConfiguration.cs
  • BackgroundTask/cpp/BackgroundTask/SampleConfiguration.h
  • BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs
  • BackgroundActivation/cpp/SampleConfiguration.cpp
  • BackgroundTask/cpp/BackgroundTask/SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BarcodeScannerInfo
Public Member Functions | Public Attributes | Properties | Private Attributes

BarcodeScannerInfo Class Reference

This class is used for data-binding.

List of all members.

Public Member Functions

BarcodeScannerInfo (String deviceName, String deviceId)

Public Attributes

String | Name = "{DeviceName} ({DeviceId})"

Properties

String | DeviceId [get, set]

Private Attributes

string | DeviceName

Detailed Description

Definition at line 113 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

BarcodeScannerInfo | ( | String | deviceName,
 |  | String | deviceId |
 | ) |  |  | [inline]

Definition at line 115 of file SampleConfiguration.cs.

        {
            DeviceName = deviceName;
            DeviceId = deviceId;
        }

Member Data Documentation

string DeviceName [private]

Definition at line 123 of file SampleConfiguration.cs.

String Name = "{DeviceName} ({DeviceId})"

Definition at line 121 of file SampleConfiguration.cs.

Property Documentation

String DeviceId [get, set]

Definition at line 122 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BindingHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BindingHelpers
Static Public Member Functions

BindingHelpers Class Reference

List of all members.

Static Public Member Functions

static Visibility | CollapsedIf (bool value)
static bool | Not (bool value)

Detailed Description

Definition at line 103 of file SampleConfiguration.cs.

Member Function Documentation

static Visibility CollapsedIf ( bool value ) [static]
static bool Not ( bool value ) [static]
The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BitrateHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BitrateHelper
Public Member Functions | Private Attributes

BitrateHelper Class Reference

List of all members.

Public Member Functions

BitrateHelper (IEnumerable< uint > availableBitRates)
Symbol | GetBitrateSymbol (uint currentBitrate)

Private Attributes

Dictionary< uint, Symbol > | symbolAssignment = new Dictionary<uint, Symbol>()

Detailed Description

Definition at line 50 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

BitrateHelper ( IEnumerable< uint > availableBitRates ) [inline]

Definition at line 57 of file SampleConfiguration.cs.

        {
            uint[] sortedBitRates = availableBitRates.ToArray();
            Array.Sort(sortedBitRates);
            int i = 0;
            while (i < sortedBitRates.Length * 1 / 4)
            {
                symbolAssignment.Add(sortedBitRates[i++], Symbol.OneBar);
            }
            while (i < sortedBitRates.Length * 2 / 4)
            {
                symbolAssignment.Add(sortedBitRates[i++], Symbol.TwoBars);
            }
            while (i < sortedBitRates.Length * 3 / 4)
            {
                symbolAssignment.Add(sortedBitRates[i++], Symbol.ThreeBars);
            }
            while (i < sortedBitRates.Length * 4 / 4)
            {
                symbolAssignment.Add(sortedBitRates[i++], Symbol.FourBars);
            }
        }

Member Function Documentation

Symbol GetBitrateSymbol ( uint currentBitrate ) [inline]

Definition at line 80 of file SampleConfiguration.cs.

        {
            Symbol symbol = Symbol.ZeroBars;
            if (symbolAssignment.TryGetValue(currentBitrate, out symbol))
            {
                return symbol;
            }
            return Symbol.ZeroBars;
        }

Member Data Documentation

Dictionary<uint, Symbol> symbolAssignment = new Dictionary<uint, Symbol>() [private]

Definition at line 55 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BitrateItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BitrateItem
Public Member Functions | Properties

BitrateItem Class Reference

Item which provides a nicer display name for "null" bitrate.

List of all members.

Public Member Functions

BitrateItem (uint?bitrate)
override string | ToString ()

Properties

uint | Bitrate [get, set]

Detailed Description

Definition at line 364 of file Scenario4_Tuning.xaml.cs.

Constructor & Destructor Documentation

BitrateItem ( uint? bitrate ) [inline]

Definition at line 367 of file Scenario4_Tuning.xaml.cs.

        {
            Bitrate = bitrate;
        }

Member Function Documentation

override string ToString ( ) [inline]

Definition at line 372 of file Scenario4_Tuning.xaml.cs.

        {
            return (Bitrate == null) ? "Not set" : Bitrate.ToString();
        }

Property Documentation

uint Bitrate [get, set]

Definition at line 366 of file Scenario4_Tuning.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario4_Tuning.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLEDeviceDisplay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BluetoothLEDeviceDisplay
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions

BluetoothLEDeviceDisplay Class Reference

Display class used to represent a BluetoothLEDevice in the Device list. More...

List of all members.

Public Member Functions

BluetoothLEDeviceDisplay (DeviceInformation deviceInfoIn)
void | Update (DeviceInformationUpdate deviceInfoUpdate)

Public Attributes

string | Id = > DeviceInformation.Id
bool | IsConnectable = "System.Devices.Aep.Bluetooth.Le.IsConnectable"] == true
bool | IsConnected = "System.Devices.Aep.IsConnected"] == true
bool | IsPaired = > DeviceInformation.Pairing.IsPaired
string | Name = > DeviceInformation.Name
IReadOnlyDictionary< string,
object > 		Properties = > DeviceInformation.Properties

Protected Member Functions

void | OnPropertyChanged (string name)

Properties

DeviceInformation | DeviceInformation [get, set]
BitmapImage | GlyphBitmapImage [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

async void | UpdateGlyphBitmapImage ()

Detailed Description

Definition at line 79 of file DisplayHelpers.cs.

Constructor & Destructor Documentation

BluetoothLEDeviceDisplay ( DeviceInformation deviceInfoIn ) [inline]

Definition at line 81 of file DisplayHelpers.cs.

        {
            DeviceInformation = deviceInfoIn;
            UpdateGlyphBitmapImage();
        }

Member Function Documentation

void OnPropertyChanged ( string name ) [inline, protected]

Definition at line 132 of file DisplayHelpers.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }

void Update ( DeviceInformationUpdate deviceInfoUpdate ) [inline]

Definition at line 101 of file DisplayHelpers.cs.

        {
            DeviceInformation.Update(deviceInfoUpdate);

            OnPropertyChanged("Id");
            OnPropertyChanged("Name");
            OnPropertyChanged("DeviceInformation");
            OnPropertyChanged("IsPaired");
            OnPropertyChanged("IsConnected");
            OnPropertyChanged("Properties");
            OnPropertyChanged("IsConnectable");

            UpdateGlyphBitmapImage();
        }

async void UpdateGlyphBitmapImage ( ) [inline, private]

Definition at line 116 of file DisplayHelpers.cs.

        {
            var glyphBitmapImage = new BitmapImage();
            try
            {
                DeviceThumbnail deviceThumbnail = await DeviceInformation.GetGlyphThumbnailAsync();
                await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
            }
            catch (Exception)
            {
                // Something went wrong getting or decoding the device glyph.
            }
            GlyphBitmapImage = glyphBitmapImage;
            OnPropertyChanged("GlyphBitmapImage");
        }

Member Data Documentation

string Id = > DeviceInformation.Id

Definition at line 89 of file DisplayHelpers.cs.

bool IsConnectable = "System.Devices.Aep.Bluetooth.Le.IsConnectable"] == true

Definition at line 93 of file DisplayHelpers.cs.

bool IsConnected = "System.Devices.Aep.IsConnected"] == true

Definition at line 92 of file DisplayHelpers.cs.

bool IsPaired = > DeviceInformation.Pairing.IsPaired

Definition at line 91 of file DisplayHelpers.cs.

string Name = > DeviceInformation.Name

Definition at line 90 of file DisplayHelpers.cs.

IReadOnlyDictionary<string, object> Properties = > DeviceInformation.Properties

Definition at line 95 of file DisplayHelpers.cs.

Property Documentation

DeviceInformation DeviceInformation [get, set]

Definition at line 87 of file DisplayHelpers.cs.

BitmapImage GlyphBitmapImage [get, set]

Definition at line 97 of file DisplayHelpers.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 99 of file DisplayHelpers.cs.

The documentation for this class was generated from the following file:
  • BluetoothLE/cs/DisplayHelpers.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BooleanToVisibilityConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • BooleanToVisibilityConverter
Public Member Functions | Properties

BooleanToVisibilityConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Properties

bool | IsInverse [get, set]

Detailed Description

Definition at line 7 of file BooleanToVisibilityConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 10 of file BooleanToVisibilityConverter.cs.

        {
            bool visibility = (bool)value;
            if (IsInverse)
            {
                visibility = !visibility;
            }

            return visibility ? Visibility.Visible : Visibility.Collapsed;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 21 of file BooleanToVisibilityConverter.cs.

        {
            throw new NotImplementedException();
        }

Property Documentation

bool IsInverse [get, set]

Definition at line 9 of file BooleanToVisibilityConverter.cs.

The documentation for this class was generated from the following file:
  • RemoteSystems/cs/BooleanToVisibilityConverter.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CachedFileUpdaterPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CachedFileUpdaterPage
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Events | Private Member Functions | Private Attributes

CachedFileUpdaterPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

CachedFileUpdaterPage ()
void | Activate (CachedFileUpdaterActivatedEventArgs args)
void | LoadScenario (Type scenarioClass)
void | NotifyUser (string strMessage, NotifyType type)

Public Attributes

const string | FEATURE_NAME = "Cached File Updater Page"
Windows.ApplicationModel.Activation.LaunchActivatedEventArgs | LaunchArgs

Static Public Attributes

static CachedFileUpdaterPage | Current

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Events

EventHandler
< CachedFileUpdaterPageSizeChangedEventArgs > 		CachedFileUpdaterPageResized
System.EventHandler | ScenarioLoaded

Private Member Functions

void | CachedFileUpdaterPage_SizeChanged (object sender, SizeChangedEventArgs e)
void | CachedFileUpdaterUI_FileUpdateRequested (CachedFileUpdaterUI sender, FileUpdateRequestedEventArgs args)
async void | CachedFileUpdaterUI_UIRequested (CachedFileUpdaterUI sender, object args)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | InvalidateLayout ()
void | InvalidateSize ()
void | PopulateScenarios ()
void | Scenarios_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | SetFeatureName (string str)

Private Attributes

internal CachedFileUpdaterUI | cachedFileUpdaterUI = null
CoreDispatcher | dispatcher = Window.Current.Dispatcher
internal FileUpdateRequest | fileUpdateRequest = null
internal FileUpdateRequestDeferral | fileUpdateRequestDeferral = null
Frame | HiddenFrame = null
List< Scenario > | scenarios = null

Detailed Description

Definition at line 28 of file CachedFileUpdaterPage.xaml.cs.

Constructor & Destructor Documentation

CachedFileUpdaterPage ( ) [inline]

Definition at line 132 of file CachedFileUpdaterPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that will allow downstream pages to get
            // a handle to the CachedFileUpdaterPage instance in order to call methods that are in this class.
            Current = this;

            // This frame is hidden, meaning it is never shown.  It is simply used to load
            // each scenario page and then pluck out the input and output sections and
            // place them into the UserControls on the main page.
            HiddenFrame = new Windows.UI.Xaml.Controls.Frame();
            HiddenFrame.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            LayoutRoot.Children.Add(HiddenFrame);

            // Populate the sample title from the constant in the GlobalVariables.cs file.
            SetFeatureName(FEATURE_NAME);

            Scenarios.SelectionChanged += Scenarios_SelectionChanged;
            SizeChanged += CachedFileUpdaterPage_SizeChanged;
        }

Member Function Documentation

void Activate ( CachedFileUpdaterActivatedEventArgs args ) [inline]

Definition at line 48 of file CachedFileUpdaterPage.xaml.cs.

        {
            // cache CachedFileUpdaterUI
            cachedFileUpdaterUI = args.CachedFileUpdaterUI;

            // Currently, the Desktop device family activates the app in the background. Other device families
            // use a background task activation. We need to handle both cases.
            //
            // We can check to see if there is UI on activation to determine which case we are in, because
            // we receive the FileUpdateRequest differently.
            //
            // If activated in the foreground (visible), then the FileUpdateRequest is passed explicitly as
            // part of the activation.
            //
            // If activated in the background (not visible), then we subscribe to the FileUpdateRequested
            // and UIRequest events. The FileUpdateRequest is received as part of the FileUpdatedRequested event,
            // and UIRequested is raised when user input is needed to resolve a conflict.

            bool isForegroundActivated = (cachedFileUpdaterUI.UIStatus == UIStatus.Visible);
            if (isForegroundActivated)
            {
                fileUpdateRequest = cachedFileUpdaterUI.UpdateRequest;
                fileUpdateRequestDeferral = cachedFileUpdaterUI.GetDeferral();
            }
            else
            {
                cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
                cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;
            }

            switch (cachedFileUpdaterUI.UpdateTarget)
            {
                case CachedFileTarget.Local:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
                    break;
                case CachedFileTarget.Remote:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
                    break;
            }

            if (isForegroundActivated)
            {
                Window.Current.Content = this;
                this.OnNavigatedTo(null);
                Window.Current.Activate();
            }
        }

void CachedFileUpdaterPage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 154 of file CachedFileUpdaterPage.xaml.cs.

        {
            InvalidateSize();
            if (CachedFileUpdaterPageResized != null)
            {
                CachedFileUpdaterPageSizeChangedEventArgs args = new CachedFileUpdaterPageSizeChangedEventArgs();
                args.Width = this.ActualWidth;
                CachedFileUpdaterPageResized(this, args);
            }
        }

void CachedFileUpdaterUI_FileUpdateRequested | ( | CachedFileUpdaterUI | sender,
 |  | FileUpdateRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 106 of file CachedFileUpdaterPage.xaml.cs.

        {
            fileUpdateRequest = args.Request;
            fileUpdateRequestDeferral = fileUpdateRequest.GetDeferral();
            switch (cachedFileUpdaterUI.UIStatus)
            {
                case UIStatus.Hidden:
                    if (fileUpdateRequest.File.Name.Contains("ConflictingFile"))
                    {
                        fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
                    }
                    else
                    {
                        fileUpdateRequest.Status = FileUpdateStatus.Complete;
                    }
                    fileUpdateRequestDeferral.Complete();
                    break;
                case UIStatus.Visible:
                    break;
                case UIStatus.Unavailable:
                    fileUpdateRequest.Status = FileUpdateStatus.Failed;
                    fileUpdateRequestDeferral.Complete();
                    break;
            }
        }

async void CachedFileUpdaterUI_UIRequested | ( | CachedFileUpdaterUI | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 96 of file CachedFileUpdaterPage.xaml.cs.

        {
            // The event handler may be invoked on a background thread, so use the Dispatcher to run the UI-related code on the UI thread.
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Window.Current.Content = this;
                this.OnNavigatedTo(null);
            });
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 366 of file CachedFileUpdaterPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void InvalidateLayout ( ) [inline, private]

Definition at line 214 of file CachedFileUpdaterPage.xaml.cs.

        {

            if (this.ActualWidth < 768)
            {
                Grid.SetRow(DescriptionText, 3);
                Grid.SetColumn(DescriptionText, 0);

                Grid.SetRow(InputSection, 4);
                Grid.SetColumn(InputSection, 0);

                Grid.SetRow(FooterPanel, 2);
                Grid.SetColumn(FooterPanel, 0);
            }
            else
            {
                Grid.SetRow(DescriptionText, 1);
                Grid.SetColumn(DescriptionText, 1);

                Grid.SetRow(InputSection, 2);
                Grid.SetColumn(InputSection, 1);

                Grid.SetRow(FooterPanel, 1);
                Grid.SetColumn(FooterPanel, 1);
            }
        }

void InvalidateSize ( ) [inline, private]

Definition at line 176 of file CachedFileUpdaterPage.xaml.cs.

        {
            // Get the window width
            double windowWidth = this.ActualWidth;

            if (windowWidth != 0.0)
            {
                // Get the width of the ListBox.
                double listBoxWidth = Scenarios.ActualWidth;

                // Is the ListBox using any margins that we need to consider?
                double listBoxMarginLeft = Scenarios.Margin.Left;
                double listBoxMarginRight = Scenarios.Margin.Right;

                // Figure out how much room is left after considering the list box width
                double availableWidth = windowWidth - listBoxWidth;

                // Is the top most child using margins?
                double layoutRootMarginLeft = ContentRoot.Margin.Left;
                double layoutRootMarginRight = ContentRoot.Margin.Right;

                // We have different widths to use depending on the view state
                if (this.ActualWidth >= 768)
                {
                    // Make us as big as the the left over space, factoring in the ListBox width, the ListBox margins.
                    // and the LayoutRoot's margins
                    InputSection.Width = ((availableWidth) - (layoutRootMarginLeft + layoutRootMarginRight + listBoxMarginLeft + listBoxMarginRight));
                }
                else
                {
                    // Make us as big as the left over space, factoring in just the LayoutRoot's margins.
                        InputSection.Width = (windowWidth - (layoutRootMarginLeft + layoutRootMarginRight));

                }
            }
            InvalidateLayout();
        }

void LoadScenario ( Type scenarioClass ) [inline]

This method is responsible for loading the individual input and output sections for each scenario.

This is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input and output sections into the respective UserControl on the main page.

Parameters:
scenarioName

Definition at line 267 of file CachedFileUpdaterPage.xaml.cs.

        {

            // Load the ScenarioX.xaml file into the Frame.
            HiddenFrame.Navigate(scenarioClass, this);

            // Get the top element, the Page, so we can look up the elements
            // that represent the input and output sections of the ScenarioX file.
            Page hiddenPage = HiddenFrame.Content as Page;

            // Get each element.
            UIElement input = hiddenPage.FindName("Input") as UIElement;
            UIElement output = hiddenPage.FindName("Output") as UIElement;

            if (input == null)
            {
                // Malformed input section.
                NotifyUser(String.Format(
                    "Cannot load scenario input section for {0}.  Make sure root of input section markup has x:Name of 'Input'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            if (output == null)
            {
                // Malformed output section.
                NotifyUser(String.Format(
                    "Cannot load scenario output section for {0}.  Make sure root of output section markup has x:Name of 'Output'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            // Find the LayoutRoot which parents the input and output sections in the main page.
            Panel panel = hiddenPage.FindName("LayoutRoot") as Panel;

            if (panel != null)
            {
                // Get rid of the content that is currently in the intput and output sections.
                panel.Children.Remove(input);
                panel.Children.Remove(output);

                // Populate the input and output sections with the newly loaded content.
                InputSection.Content = input;
                OutputSection.Content = output;

                if (ScenarioLoaded != null)
                {
                    ScenarioLoaded(this, new EventArgs());
                }
            }
            else
            {
                // Malformed Scenario file.
                NotifyUser(String.Format(
                    "Cannot load scenario: '{0}'.  Make sure root tag in the '{0}' file has an x:Name of 'LayoutRoot'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
            }

        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Definition at line 340 of file CachedFileUpdaterPage.xaml.cs.

        {
            switch (type)
            {
                // Use the status message style.
                case NotifyType.StatusMessage:
                    StatusBlock.Style = Resources["StatusStyle"] as Style;
                    break;
                // Use the error message style.
                case NotifyType.ErrorMessage:
                    StatusBlock.Style = Resources["ErrorStyle"] as Style;
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            if (StatusBlock.Text != String.Empty)
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 170 of file CachedFileUpdaterPage.xaml.cs.

        {
            PopulateScenarios();
            InvalidateLayout();
        }

void PopulateScenarios ( ) [inline, private]

Definition at line 241 of file CachedFileUpdaterPage.xaml.cs.

        {
            System.Collections.ObjectModel.ObservableCollection<object> ScenarioList = new System.Collections.ObjectModel.ObservableCollection<object>();
            int i = 0;

            // Populate the ListBox with the list of scenarios as defined in Constants.cs.
            foreach (Scenario s in scenarios)
            {
                ListBoxItem item = new ListBoxItem();
                s.Title = (++i).ToString() + ") " + s.Title;
                item.Content = s;
                item.Name = s.ClassType.FullName;
                ScenarioList.Add(item);
            }

            // Bind the ListBox to the scenario list.
            Scenarios.ItemsSource = ScenarioList;
            Scenarios.SelectedIndex = 0;
        }

void Scenarios_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 327 of file CachedFileUpdaterPage.xaml.cs.

        {
            if (Scenarios.SelectedItem != null)
            {
                NotifyUser("", NotifyType.StatusMessage);

                ListBoxItem selectedListBoxItem = Scenarios.SelectedItem as ListBoxItem;
                Scenario scenario = selectedListBoxItem.Content as Scenario;
                LoadScenario(scenario.ClassType);
                InvalidateSize();
            }
        }

void SetFeatureName ( string str ) [inline, private]

Definition at line 371 of file CachedFileUpdaterPage.xaml.cs.

        {
            FeatureName.Text = str;
        }

Member Data Documentation

internal CachedFileUpdaterUI cachedFileUpdaterUI = null [private]

Definition at line 38 of file CachedFileUpdaterPage.xaml.cs.

CachedFileUpdaterPage Current [static]

Definition at line 36 of file CachedFileUpdaterPage.xaml.cs.

CoreDispatcher dispatcher = Window.Current.Dispatcher [private]

Definition at line 42 of file CachedFileUpdaterPage.xaml.cs.

const string FEATURE_NAME = "Cached File Updater Page"

Definition at line 30 of file CachedFileUpdaterPage.xaml.cs.

internal FileUpdateRequest fileUpdateRequest = null [private]

Definition at line 39 of file CachedFileUpdaterPage.xaml.cs.

internal FileUpdateRequestDeferral fileUpdateRequestDeferral = null [private]

Definition at line 40 of file CachedFileUpdaterPage.xaml.cs.

Frame HiddenFrame = null [private]

Definition at line 44 of file CachedFileUpdaterPage.xaml.cs.

Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs

Definition at line 34 of file CachedFileUpdaterPage.xaml.cs.

List<Scenario> scenarios = null [private]

Definition at line 46 of file CachedFileUpdaterPage.xaml.cs.

Event Documentation

EventHandler<CachedFileUpdaterPageSizeChangedEventArgs> CachedFileUpdaterPageResized

Definition at line 32 of file CachedFileUpdaterPage.xaml.cs.

System.EventHandler ScenarioLoaded

Definition at line 31 of file CachedFileUpdaterPage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/CachedFileUpdaterPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CachedFileUpdaterPageSizeChangedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CachedFileUpdaterPageSizeChangedEventArgs
Properties | Private Attributes

CachedFileUpdaterPageSizeChangedEventArgs Class Reference

List of all members.

Properties

double | Width [get, set]

Private Attributes

double | width

Detailed Description

Definition at line 377 of file CachedFileUpdaterPage.xaml.cs.

Member Data Documentation

double width [private]

Definition at line 379 of file CachedFileUpdaterPage.xaml.cs.

Property Documentation

double Width [get, set]

Definition at line 382 of file CachedFileUpdaterPage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/CachedFileUpdaterPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CalibrationBar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CalibrationBar
Public Member Functions | Private Member Functions | Private Attributes

CalibrationBar Class Reference

List of all members.

Public Member Functions

CalibrationBar ()
CalibrationBar ()
void | Hide ()
void | Hide ()
void | RequestCalibration (MagnetometerAccuracy accuracy)
void | RequestCalibration (MagnetometerAccuracy accuracy)

Private Member Functions

bool | CanShowCalibrationBar (MagnetometerAccuracy accuracy)
bool | CanShowCalibrationBar (MagnetometerAccuracy accuracy)
void | DismissPopup_Click (object sender, RoutedEventArgs e)
void | DismissPopup_Click (object sender, RoutedEventArgs e)
void | HideGuidance ()
void | HideGuidance ()
void | HideGuidanceButton_Click (object sender, RoutedEventArgs e)
void | HideGuidanceButton_Click (object sender, RoutedEventArgs e)
void | InvalidateLayout ()
void | InvalidateLayout ()
void | OnAutoDismissTimerExpired (object sender, object e)
void | OnAutoDismissTimerExpired (object sender, object e)
void | OnWindowSizeChanged (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
void | OnWindowSizeChanged (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
void | ShowGuidance ()
void | ShowGuidance ()
void | ShowGuidanceButton_Click (object sender, RoutedEventArgs e)
void | ShowGuidanceButton_Click (object sender, RoutedEventArgs e)

Private Attributes

bool | _barDismissed = false
DispatcherTimer | _calibrationTimer
DateTime | _lastCalibrationTime = new DateTime(0)
TimeSpan | CALIBRATION_POPUP_AUTO_DIMSMISS_TIME = new TimeSpan(0, 0, 30)
const double | LAYOUT_WIDTH_768 = 768.0
const double | SUPPRESS_DURATION_APPROXIMATE_MIN = 10.0
const double | SUPPRESS_DURATION_UNRELIABLE_MIN = 5.0

Detailed Description

Definition at line 30 of file CalibrationBar.xaml.cs.

Constructor & Destructor Documentation

CalibrationBar ( ) [inline]

Definition at line 47 of file CalibrationBar.xaml.cs.

        {
            this.InitializeComponent();
            _calibrationTimer = new DispatcherTimer();
            _calibrationTimer.Tick += OnAutoDismissTimerExpired;
            _calibrationTimer.Interval = CALIBRATION_POPUP_AUTO_DIMSMISS_TIME;
        }

CalibrationBar ( ) [inline]

Definition at line 36 of file CalibrationBar.xaml.cs.

        {
            this.InitializeComponent();
            _calibrationTimer = new DispatcherTimer();
            _calibrationTimer.Tick += OnAutoDismissTimerExpired;
            _calibrationTimer.Interval = CALIBRATION_POPUP_AUTO_DIMSMISS_TIME;
        }

Member Function Documentation

bool CanShowCalibrationBar ( MagnetometerAccuracy accuracy ) [inline, private]

Called to determine if sufficient time has passed since the calibration bar was hidden to show the calibration bar again.

This suppression time is dependent on the current sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 132 of file CalibrationBar.xaml.cs.

        {
            bool showBar = false;
            if (!_barDismissed)
            {
                if ((accuracy == MagnetometerAccuracy.Approximate) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_APPROXIMATE_MIN)) >= 0))
                {
                    showBar = true;
                }
                else if ((accuracy == MagnetometerAccuracy.Unreliable) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_UNRELIABLE_MIN)) >= 0))
                {
                    showBar = true;
                }
            }
            return showBar;
        }

bool CanShowCalibrationBar ( MagnetometerAccuracy accuracy ) [inline, private]

Called to determine if sufficient time has passed since the calibration bar was hidden to show the calibration bar again.

This suppression time is dependent on the current sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 121 of file CalibrationBar.xaml.cs.

        {
            bool showBar = false;
            if (!_barDismissed)
            {
                if ((accuracy == MagnetometerAccuracy.Approximate) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_APPROXIMATE_MIN)) >= 0))
                {
                    showBar = true;
                }
                else if ((accuracy == MagnetometerAccuracy.Unreliable) &&
                    (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_UNRELIABLE_MIN)) >= 0))
                {
                    showBar = true;
                }
            }
            return showBar;
        }

void DismissPopup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the dismiss popup button.

It hides the calibration bar and prevents it from being shown again for the lifetime of the app.

Parameters:
sender
e

Definition at line 184 of file CalibrationBar.xaml.cs.

        {
            // Don't show the calibration bar again.
            _barDismissed = true;
            Hide();
        }

void DismissPopup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the dismiss popup button.

It hides the calibration bar and prevents it from being shown again for the lifetime of the app.

Parameters:
sender
e

Definition at line 173 of file CalibrationBar.xaml.cs.

        {
            // Don't show the calibration bar again.
            _barDismissed = true;
            Hide();
        }

void Hide ( ) [inline]

Called when sensor accuracy is sufficient and the application would like to hide the calibration bar.

Definition at line 78 of file CalibrationBar.xaml.cs.

        {
            if (CalibrationPopup.IsOpen)
            {
                // Hide the calibration bar and save the current time.
                _lastCalibrationTime = DateTime.Now;
                HideGuidance();
                CalibrationPopup.IsOpen = false;
                Window.Current.SizeChanged -= OnWindowSizeChanged;
                _calibrationTimer.Stop();
            }
        }

void Hide ( ) [inline]

Called when sensor accuracy is sufficient and the application would like to hide the calibration bar.

Definition at line 67 of file CalibrationBar.xaml.cs.

        {
            if (CalibrationPopup.IsOpen)
            {
                // Hide the calibration bar and save the current time.
                _lastCalibrationTime = DateTime.Now;
                HideGuidance();
                CalibrationPopup.IsOpen = false;
                Window.Current.SizeChanged -= OnWindowSizeChanged;
                _calibrationTimer.Stop();
            }
        }

void HideGuidance ( ) [inline, private]

Collapses the calibration bar to hide the calibration image from the user.

Parameters:
sender
e

Definition at line 208 of file CalibrationBar.xaml.cs.

        {
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

void HideGuidance ( ) [inline, private]

Collapses the calibration bar to hide the calibration image from the user.

Parameters:
sender
e

Definition at line 197 of file CalibrationBar.xaml.cs.

        {
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

void HideGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the hide guidance button.

Parameters:
sender
e

Definition at line 158 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Visible)
            {
                HideGuidance();
            }
        }

void HideGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the hide guidance button.

Parameters:
sender
e

Definition at line 169 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Visible)
            {
                HideGuidance();
            }
        }

void InvalidateLayout ( ) [inline, private]

Updates the calibration bar layout based on the current window width.

Definition at line 104 of file CalibrationBar.xaml.cs.

        {
            CalibrationGrid.Width = Window.Current.Bounds.Width;

            if (CalibrationGrid.Width < LAYOUT_WIDTH_768)
            {
                Grid.SetRow(DismissPopup, 1);
                Grid.SetColumn(DismissPopup, 1);

                CalibrationGridTop.Margin = new Thickness(0, 24, 20, 15);
                DismissPopup.Margin = new Thickness(66, 15, 0, 0);
            }
            else
            {
                Grid.SetRow(DismissPopup, 0);
                Grid.SetColumn(DismissPopup, 2);

                CalibrationGridTop.Margin = new Thickness(0, 19, 66, 19);
                DismissPopup.Margin = new Thickness(66, 0, 0, 0);
            }
        }

void InvalidateLayout ( ) [inline, private]

Updates the calibration bar layout based on the current window width.

Definition at line 93 of file CalibrationBar.xaml.cs.

        {
            CalibrationGrid.Width = Window.Current.Bounds.Width;

            if (CalibrationGrid.Width < LAYOUT_WIDTH_768)
            {
                Grid.SetRow(DismissPopup, 1);
                Grid.SetColumn(DismissPopup, 1);

                CalibrationGridTop.Margin = new Thickness(0, 24, 20, 15);
                DismissPopup.Margin = new Thickness(66, 15, 0, 0);
            }
            else
            {
                Grid.SetRow(DismissPopup, 0);
                Grid.SetColumn(DismissPopup, 2);

                CalibrationGridTop.Margin = new Thickness(0, 19, 66, 19);
                DismissPopup.Margin = new Thickness(66, 0, 0, 0);
            }
        }

void OnAutoDismissTimerExpired | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is the handler for the auto dismiss timer.

After the calibraiton bar has been shown for the maximum time, it is automatically hidden.

Parameters:
sender
e

Definition at line 210 of file CalibrationBar.xaml.cs.

        {
            Hide();
        }

void OnAutoDismissTimerExpired | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is the handler for the auto dismiss timer.

After the calibraiton bar has been shown for the maximum time, it is automatically hidden.

Parameters:
sender
e

Definition at line 221 of file CalibrationBar.xaml.cs.

        {
            Hide();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | Windows.UI.Core.WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the window size is updated.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 96 of file CalibrationBar.xaml.cs.

        {
            InvalidateLayout();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | Windows.UI.Core.WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the window size is updated.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 85 of file CalibrationBar.xaml.cs.

        {
            InvalidateLayout();
        }

void RequestCalibration ( MagnetometerAccuracy accuracy ) [inline]

Called when the application would like to show the calibration bar to the user to improve sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 60 of file CalibrationBar.xaml.cs.

        {
            // Only show the calibration bar if it is hidden and sufficient
            // time has passed since it was last hidden.
            if (!CalibrationPopup.IsOpen && CanShowCalibrationBar(accuracy))
            {
                InvalidateLayout();
                Window.Current.SizeChanged += OnWindowSizeChanged;
                HideGuidance(); // Calibration image hidden by default
                CalibrationPopup.IsOpen = true;
                _calibrationTimer.Start();
            }
        }

void RequestCalibration ( MagnetometerAccuracy accuracy ) [inline]

Called when the application would like to show the calibration bar to the user to improve sensor accuracy.

Parameters:
accuracy Current accuracy of the sensor.

Definition at line 49 of file CalibrationBar.xaml.cs.

        {
            // Only show the calibration bar if it is hidden and sufficient
            // time has passed since it was last hidden.
            if (!CalibrationPopup.IsOpen && CanShowCalibrationBar(accuracy))
            {
                InvalidateLayout();
                Window.Current.SizeChanged += OnWindowSizeChanged;
                HideGuidance(); // Calibration image hidden by default
                CalibrationPopup.IsOpen = true;
                _calibrationTimer.Start();
            }
        }

void ShowGuidance ( ) [inline, private]

Expands the calibration bar to show the calibration image to the user.

Parameters:
sender
e

Definition at line 185 of file CalibrationBar.xaml.cs.

        {
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }

void ShowGuidance ( ) [inline, private]

Expands the calibration bar to show the calibration image to the user.

Parameters:
sender
e

Definition at line 196 of file CalibrationBar.xaml.cs.

        {
            ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
            Guidance.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }

void ShowGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the show guidance button.

Parameters:
sender
e

Definition at line 145 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Collapsed)
            {
                ShowGuidance();
            }
        }

void ShowGuidanceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the show guidance button.

Parameters:
sender
e

Definition at line 156 of file CalibrationBar.xaml.cs.

        {
            if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Collapsed)
            {
                ShowGuidance();
            }
        }

Member Data Documentation

bool _barDismissed = false [private]

Definition at line 44 of file CalibrationBar.xaml.cs.

DispatcherTimer _calibrationTimer [private]

Definition at line 45 of file CalibrationBar.xaml.cs.

DateTime _lastCalibrationTime = new DateTime(0) [private]

Definition at line 43 of file CalibrationBar.xaml.cs.

TimeSpan CALIBRATION_POPUP_AUTO_DIMSMISS_TIME = new TimeSpan(0, 0, 30) [private]

Definition at line 39 of file CalibrationBar.xaml.cs.

const double LAYOUT_WIDTH_768 = 768.0 [private]

Definition at line 41 of file CalibrationBar.xaml.cs.

const double SUPPRESS_DURATION_APPROXIMATE_MIN = 10.0 [private]

Definition at line 37 of file CalibrationBar.xaml.cs.

const double SUPPRESS_DURATION_UNRELIABLE_MIN = 5.0 [private]

Definition at line 38 of file CalibrationBar.xaml.cs.

The documentation for this class was generated from the following files:
  • Compass/cs/CalibrationBar.xaml.cs
  • OrientationSensor/cs/CalibrationBar.xaml.cs
  • Compass/cpp/CalibrationBar.xaml.cpp
  • Inclinometer/cpp/CalibrationBar.xaml.cpp
  • OrientationSensor/cpp/CalibrationBar.xaml.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CalligraphicPen Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CalligraphicPen
Public Member Functions | Protected Member Functions

CalligraphicPen Class Reference

List of all members.

Public Member Functions

CalligraphicPen ()

Protected Member Functions

override InkDrawingAttributes CreateInkDrawingAttributesCore (Brush brush, double strokeWidth)

Detailed Description

Definition at line 24 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

CalligraphicPen ( ) [inline]

Definition at line 26 of file Scenario2.xaml.cs.

        {
        }

Member Function Documentation

override InkDrawingAttributes CreateInkDrawingAttributesCore | ( | Brush | brush,
 |  | double | strokeWidth |
 | ) |  |  | [inline, protected]

Definition at line 30 of file Scenario2.xaml.cs.

        {

            InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes();
            inkDrawingAttributes.PenTip = PenTipShape.Circle;
            inkDrawingAttributes.IgnorePressure = false;
            SolidColorBrush solidColorBrush = (SolidColorBrush)brush;

            if (solidColorBrush != null)
            {
                inkDrawingAttributes.Color = solidColorBrush.Color;
            }

            inkDrawingAttributes.Size = new Size(strokeWidth, 2.0f * strokeWidth);
            inkDrawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.CreateRotation((float)(Math.PI * 45 / 180));

            return inkDrawingAttributes;
        }

The documentation for this class was generated from the following file:
  • SimpleInk/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CancelCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CancelCommand
Public Member Functions | Private Member Functions | Private Attributes

CancelCommand Class Reference

List of all members.

Public Member Functions

CancelCommand ()

Private Member Functions

async void | CancelCommandButton_Click (object sender, RoutedEventArgs e)
void | CommandInvokedHandler (IUICommand command)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file CancelCommand.xaml.cs.

Constructor & Destructor Documentation

CancelCommand ( ) [inline]

Definition at line 24 of file CancelCommand.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CancelCommandButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'CancelCommandButton' button.

Demonstrates setting the command to be invoked when the 'escape' key is pressed. Also demonstrates retrieval of the label of the chosen command and setting a callback to a function. A message will be displayed indicating which command was invoked. In this scenario, 'Try again' is selected as the default choice, and the 'escape' key will invoke the command named 'Close'

Parameters:
sender | The Object that caused this event to be fired.
e | State information and event data associated with the routed event.

Definition at line 38 of file CancelCommand.xaml.cs.

        {
            // Create the message dialog and set its content
            var messageDialog = new MessageDialog("No internet connection has been found.");

            // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
            messageDialog.Commands.Add(new UICommand("Try again", new UICommandInvokedHandler(this.CommandInvokedHandler)));
            messageDialog.Commands.Add(new UICommand("Close", new UICommandInvokedHandler(this.CommandInvokedHandler)));

            // Set the command that will be invoked by default
            messageDialog.DefaultCommandIndex = 0;

            // Set the command to be invoked when escape is pressed
            messageDialog.CancelCommandIndex = 1;

            // Show the message dialog
            await messageDialog.ShowAsync();
        }

void CommandInvokedHandler ( IUICommand command ) [inline, private]

Callback function for the invocation of the dialog commands.

Parameters:
command The command that was invoked.

Definition at line 62 of file CancelCommand.xaml.cs.

        {
            // Display message showing the label of the command that was invoked
            rootPage.NotifyUser("The '" + command.Label + "' command has been selected.", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file CancelCommand.xaml.cs.

The documentation for this class was generated from the following files:
  • MessageDialog/cs/CancelCommand.xaml.cs
  • MessageDialog/cpp/CancelCommand.xaml.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CaptureFailedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CaptureFailedEventArgs
Public Member Functions | Public Attributes | Properties

CaptureFailedEventArgs Class Reference

#include "Utils.h"

List of all members.

Public Member Functions

internal Platform::String | _message (message)

Public Attributes

internal | __pad0__: CaptureFailedEventArgs(HRESULT code
internal Platform::String | message: _code(code)

Properties

Platform::String | _message

Detailed Description

Definition at line 22 of file Utils.h.

Member Function Documentation

internal Platform::String _message ( message ) [inline]

Definition at line 27 of file Utils.h.

        {
        }

Member Data Documentation

internal __pad0__

Definition at line 25 of file Utils.h.

internal Platform::String message

Definition at line 25 of file Utils.h.

Property Documentation

Platform::String _message

Definition at line 42 of file Utils.h.

The documentation for this class was generated from the following file:
  • SimpleCommunication/cpp/Utils.h
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ChatListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ChatListView
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ChatListView Class Reference

This ListView is tailored to a Chat experience where the focus is on the last item in the list and as the user scrolls up the older messages are incrementally loaded. More...

List of all members.

Public Member Functions

ChatListView ()

Protected Member Functions

override Size | ArrangeOverride (Size finalSize)
override void | OnApplyTemplate ()

Private Member Functions

async Task | ProcessDataVirtualizationScrollOffsetsAsync (double actualHeight)
async void | StartProcessingDataVirtualizationScrollOffsets (double actualHeight)
void | UpdateRunningAverageContainerHeight (ListViewBase sender, ContainerContentChangingEventArgs args)

Private Attributes

double | averageContainerHeight
uint itemsSeen
bool | processingScrollOffsets = false
bool | processingScrollOffsetsDeferred = false

Detailed Description

We're performing our own logic to trigger loading more data.

Note: This is just delay loading the data, but isn't true data virtualization. A user that scrolls all the way to the beginning of the list will cause all the data to be loaded.

Definition at line 85 of file Scenario2_Load.xaml.cs.

Constructor & Destructor Documentation

ChatListView ( ) [inline]

Definition at line 92 of file Scenario2_Load.xaml.cs.

        {
            // We'll manually trigger the loading of data incrementally and buffer for 2 pages worth of data
            this.IncrementalLoadingTrigger = IncrementalLoadingTrigger.None;

            // Since we'll have variable sized items we compute a running average of height to help estimate
            // how much data to request for incremental loading
            this.ContainerContentChanging += this.UpdateRunningAverageContainerHeight;
        }

Member Function Documentation

Size ArrangeOverride ( Size finalSize ) [inline, protected]

Definition at line 120 of file Scenario2_Load.xaml.cs.

        {
            // Allow the panel to arrange first
            var result = base.ArrangeOverride(finalSize);

            StartProcessingDataVirtualizationScrollOffsets(finalSize.Height);

            return result;
        }

void OnApplyTemplate ( ) [inline, protected]

Definition at line 102 of file Scenario2_Load.xaml.cs.

        {
            var scrollViewer = this.GetTemplateChild("ScrollViewer") as ScrollViewer;

            if (scrollViewer != null)
            {
                scrollViewer.ViewChanged += (s, a) =>
                {
                    // Check if we should load more data when the scroll position changes.
                    // We only get this once the content/panel is large enough to be scrollable.
                    this.StartProcessingDataVirtualizationScrollOffsets(this.ActualHeight);
                };
            }

            base.OnApplyTemplate();
        }

task< void > ProcessDataVirtualizationScrollOffsetsAsync ( double actualHeight ) [inline, private]

Definition at line 155 of file Scenario2_Load.xaml.cs.

        {
            var panel = this.ItemsPanelRoot as ItemsStackPanel;
            if (panel != null)
            {
                if ((panel.FirstVisibleIndex != -1 && panel.FirstVisibleIndex * this.averageContainerHeight < actualHeight * this.IncrementalLoadingThreshold) ||
                    (Items.Count == 0))
                {
                    var virtualizingDataSource = this.ItemsSource as ISupportIncrementalLoading;
                    if (virtualizingDataSource != null)
                    {
                        if (virtualizingDataSource.HasMoreItems)
                        {
                            uint itemsToLoad;
                            if (this.averageContainerHeight == 0.0)
                            {
                                // We don't have any items yet. Load the first one so we can get an
                                // estimate of the height of one item, and then we can load the rest.
                                itemsToLoad = 1;
                            }
                            else
                            {
                                double avgItemsPerPage = actualHeight / this.averageContainerHeight;
                                // We know there's data to be loaded so load at least one item
                                itemsToLoad = Math.Max((uint)(this.DataFetchSize * avgItemsPerPage), 1);
                            }

                            await virtualizingDataSource.LoadMoreItemsAsync(itemsToLoad);
                        }
                    }
                }
            }
        }

void StartProcessingDataVirtualizationScrollOffsets ( double actualHeight ) [inline, private]

Definition at line 130 of file Scenario2_Load.xaml.cs.

        {
            // Avoid re-entrancy. If we are already processing, then defer this request.
            if (processingScrollOffsets)
            {
                processingScrollOffsetsDeferred = true;
                return;
            }

            this.processingScrollOffsets = true;

            do
            {
                processingScrollOffsetsDeferred = false;
                await ProcessDataVirtualizationScrollOffsetsAsync(actualHeight);

                // If a request to process scroll offsets occurred while we were processing
                // the previous request, then process the deferred request now.
            }
            while (processingScrollOffsetsDeferred);

            // We have finished. Allow new requests to be processed.
            this.processingScrollOffsets = false;
        }

void UpdateRunningAverageContainerHeight | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 189 of file Scenario2_Load.xaml.cs.

        {
            if (args.ItemContainer != null && !args.InRecycleQueue)
            {
                switch (args.Phase)
                {
                    case 0:
                        // use the size of the very first placeholder as a starting point until
                        // we've seen the first item
                        if (this.averageContainerHeight == 0)
                        {
                            this.averageContainerHeight = args.ItemContainer.DesiredSize.Height;
                        }

                        args.RegisterUpdateCallback(1, this.UpdateRunningAverageContainerHeight);
                        args.Handled = true;
                        break;

                    case 1:
                        // set the content
                        args.ItemContainer.Content = args.Item;
                        args.RegisterUpdateCallback(2, this.UpdateRunningAverageContainerHeight);
                        args.Handled = true;
                        break;

                    case 2:
                        // refine the estimate based on the item's DesiredSize
                        this.averageContainerHeight = (this.averageContainerHeight * itemsSeen + args.ItemContainer.DesiredSize.Height) / ++itemsSeen;
                        args.Handled = true;
                        break;
                }
            }
        }

Member Data Documentation

double averageContainerHeight [private]

Definition at line 88 of file Scenario2_Load.xaml.cs.

uint itemsSeen [private]

Definition at line 87 of file Scenario2_Load.xaml.cs.

bool processingScrollOffsets = false [private]

Definition at line 89 of file Scenario2_Load.xaml.cs.

bool processingScrollOffsetsDeferred = false [private]

Definition at line 90 of file Scenario2_Load.xaml.cs.

The documentation for this class was generated from the following files:
  • XamlBottomUpList/cs/Scenario2_Load.xaml.cs
  • XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Cluster Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Cluster
Public Attributes | Properties

Cluster Class Reference

#include "Scenario7.xaml.h"

List of all members.

Public Attributes

PlaceLocation Location
std::vector< PlaceInfo > | Places

Properties

IList< PlaceInfo > | Places [get, set]

Detailed Description

Definition at line 38 of file Scenario7.xaml.h.

Member Data Documentation

PlaceLocation Location [get, set]

Definition at line 40 of file Scenario7.xaml.h.

std::vector<PlaceInfo> Places

Definition at line 41 of file Scenario7.xaml.h.

Property Documentation

IList<PlaceInfo> Places [get, set]

Definition at line 66 of file Scenario7.xaml.cs.

The documentation for this class was generated from the following files:
  • MapControl/cpp/Scenario7.xaml.h
  • MapControl/cs/Scenario7.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoadStateEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • LoadStateEventArgs
Public Member Functions | Properties

LoadStateEventArgs Class Reference

Class used to hold the event data required when a page attempts to load state.

List of all members.

Public Member Functions

LoadStateEventArgs (Object navigationParameter, Dictionary< string, Object > pageState)

Properties

Object | NavigationParameter [get, set]
Dictionary< string, Object > | PageState [get, set]

Detailed Description

Definition at line 322 of file NavigationHelper.cs.

Constructor & Destructor Documentation

LoadStateEventArgs | ( | Object | navigationParameter,
 |  | Dictionary< string, Object > | pageState |
 | ) |  |  | [inline]

Initializes a new instance of the LoadStateEventArgs class.

Parameters:
navigationParameter | The parameter value passed to Frame.Navigate(Type, Object) when this page was initially requested.
pageState | A dictionary of state preserved by this page during an earlier session. This will be null the first time a page is visited.

Definition at line 346 of file NavigationHelper.cs.

            : base()
        {
            this.NavigationParameter = navigationParameter;
            this.PageState = pageState;
        }

Property Documentation

Object NavigationParameter [get, set]

The parameter value passed to Frame.Navigate(Type, Object) when this page was initially requested.

Definition at line 328 of file NavigationHelper.cs.

Dictionary<string, Object> PageState [get, set]

A dictionary of state preserved by this page during an earlier session.

This will be null the first time a page is visited.

Definition at line 333 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NavigationHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • NavigationHelper
Public Member Functions | Properties | Events | Private Attributes

NavigationHelper Class Reference

NavigationHelper aids in navigation between pages. More...

List of all members.

Public Member Functions

NavigationHelper (Page page)
void | OnNavigatedFrom (NavigationEventArgs e)
void | OnNavigatedTo (NavigationEventArgs e)

Properties

Frame | Frame [get]
Page | Page [get, set]

Events

LoadStateEventHandler | LoadState
SaveStateEventHandler | SaveState

Private Attributes

String | _pageKey

Detailed Description

It manages the backstack and integrates SuspensionManager to handle process lifetime management and state management when navigating between pages.

To make use of NavigationHelper, follow these two steps or start with a BasicPage or any other Page item template other than BlankPage.

1) Create an instance of the NavigationHelper somewhere such as in the constructor for the page and register a callback for the LoadState and SaveState events.

            public MyPage()
            {
                this.InitializeComponent();
                this.navigationHelper = new NavigationHelper(this);
                this.navigationHelper.LoadState += navigationHelper_LoadState;
                this.navigationHelper.SaveState += navigationHelper_SaveState;
            }

            private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
            { }
            private void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
            { }

2) Register the page to call into the NavigationManager whenever the page participates in navigation by overriding the Windows.UI.Xaml.Controls.Page.OnNavigatedTo and Windows.UI.Xaml.Controls.Page.OnNavigatedFrom events.

            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                navigationHelper.OnNavigatedTo(e);
            }

            protected override void OnNavigatedFrom(NavigationEventArgs e)
            {
                navigationHelper.OnNavigatedFrom(e);
            }

Definition at line 58 of file NavigationHelper.cs.

Constructor & Destructor Documentation

NavigationHelper ( Page page ) [inline]

Initializes a new instance of the NavigationHelper class.

Parameters:
page A reference to the current page used for navigation. This reference allows for frame manipulation.

Definition at line 68 of file NavigationHelper.cs.

        {
            this.Page = page;
        }

Member Function Documentation

void OnNavigatedFrom ( NavigationEventArgs e ) [inline]

Invoked when this page will no longer be displayed in a Frame.

This method calls SaveState, where all page specific navigation and process lifetime management logic should be placed.

Parameters:
e Event data that describes how this page was reached. The Parameter property provides the group to be displayed.

Definition at line 140 of file NavigationHelper.cs.

        {
            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
            var pageState = new Dictionary<String, Object>();
            if (this.SaveState != null)
            {
                this.SaveState(this, new SaveStateEventArgs(pageState));
            }
            frameState[_pageKey] = pageState;
        }

void OnNavigatedTo ( NavigationEventArgs e ) [inline]

Invoked when this page is about to be displayed in a Frame.

This method calls LoadState, where all page specific navigation and process lifetime management logic should be placed.

Parameters:
e Event data that describes how this page was reached. The Parameter property provides the group to be displayed.

Definition at line 98 of file NavigationHelper.cs.

        {
            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
            this._pageKey = "Page-" + this.Frame.BackStackDepth;

            if (e.NavigationMode == NavigationMode.New)
            {
                // Clear existing state for forward navigation when adding a new page to the
                // navigation stack
                var nextPageKey = this._pageKey;
                int nextPageIndex = this.Frame.BackStackDepth;
                while (frameState.Remove(nextPageKey))
                {
                    nextPageIndex++;
                    nextPageKey = "Page-" + nextPageIndex;
                }

                // Pass the navigation parameter to the new page
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
                }
            }
            else
            {
                // Pass the navigation parameter and preserved page state to the page, using
                // the same strategy for loading suspended state and recreating pages discarded
                // from cache
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary<String, Object>)frameState[this._pageKey]));
                }
            }
        }

Member Data Documentation

String _pageKey [private]

Definition at line 75 of file NavigationHelper.cs.

Property Documentation

Frame Frame [get, private]

Definition at line 61 of file NavigationHelper.cs.

Page Page [get, set, private]

Definition at line 60 of file NavigationHelper.cs.

Event Documentation

LoadStateEventHandler LoadState

Handle this event to populate the page using content passed during navigation as well as any state that was saved by the SaveState event handler.

Definition at line 82 of file NavigationHelper.cs.

SaveStateEventHandler SaveState

Handle this event to save state that can be used by the LoadState event handler.

Save the state in case the application is suspended or the page is discarded from the navigation cache.

Definition at line 89 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RootFrameNavigationHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • RootFrameNavigationHelper
Public Member Functions | Properties | Private Member Functions | Private Attributes

RootFrameNavigationHelper Class Reference

RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...

List of all members.

Public Member Functions

RootFrameNavigationHelper (Frame rootFrame)

Properties

Frame | Frame [get, set]

Private Member Functions

void | CoreDispatcher_AcceleratorKeyActivated (CoreDispatcher sender, AcceleratorKeyEventArgs e)
void | CoreWindow_PointerPressed (CoreWindow sender, PointerEventArgs e)
void | SystemNavigationManager_BackRequested (object sender, BackRequestedEventArgs e)
bool | TryGoBack ()
bool | TryGoForward ()
void | UpdateBackButton ()

Private Attributes

SystemNavigationManager | systemNavigationManager

Detailed Description

There should be only one RootFrameNavigationHelper per view, and it should be associated with the root frame.

To make use of RootFrameNavigationHelper, create an instance of the RootNavigationHelper such as in the constructor of your root page.

            public MyRootPage()
            {
                this.InitializeComponent();
                this.rootNavigationHelper = new RootNavigationHelper(MyFrame);
            }

Definition at line 172 of file NavigationHelper.cs.

Constructor & Destructor Documentation

RootFrameNavigationHelper ( Frame rootFrame ) [inline]

Initializes a new instance of the RootNavigationHelper class.

Parameters:
rootFrame A reference to the top-level frame. This reference allows for frame manipulation and to register navigation handlers.

Definition at line 182 of file NavigationHelper.cs.

        {
            this.Frame = rootFrame;

            // Handle keyboard and mouse navigation requests
            this.systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested;
            UpdateBackButton();

            // Listen to the window directly so we will respond to hotkeys regardless
            // of which element has focus.
            Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
                CoreDispatcher_AcceleratorKeyActivated;
            Window.Current.CoreWindow.PointerPressed +=
                this.CoreWindow_PointerPressed;

            // Update the Back button whenever a navigation occurs.
            this.Frame.Navigated += (s, e) => UpdateBackButton();
        }

Member Function Documentation

void CoreDispatcher_AcceleratorKeyActivated | ( | CoreDispatcher | sender,
 |  | AcceleratorKeyEventArgs | e |
 | ) |  |  | [inline, private]

Invoked on every keystroke, including system keys such as Alt key combinations.

Used to detect keyboard navigation between pages even when the page itself doesn't have focus.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 246 of file NavigationHelper.cs.

        {
            var virtualKey = e.VirtualKey;

            // Only investigate further when Left, Right, or the dedicated Previous or Next keys
            // are pressed
            if ((e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown ||
                e.EventType == CoreAcceleratorKeyEventType.KeyDown) &&
                (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right ||
                (int)virtualKey == 166 || (int)virtualKey == 167))
            {
                var coreWindow = Window.Current.CoreWindow;
                var downState = CoreVirtualKeyStates.Down;
                bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState;
                bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState;
                bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState;
                bool noModifiers = !menuKey && !controlKey && !shiftKey;
                bool onlyAlt = menuKey && !controlKey && !shiftKey;

                if (((int)virtualKey == 166 && noModifiers) ||
                    (virtualKey == VirtualKey.Left && onlyAlt))
                {
                    // When the previous key or Alt+Left are pressed navigate back
                    e.Handled = TryGoBack();
                }
                else if (((int)virtualKey == 167 && noModifiers) ||
                    (virtualKey == VirtualKey.Right && onlyAlt))
                {
                    // When the next key or Alt+Right are pressed navigate forward
                    e.Handled = TryGoForward();
                }
            }
        }

void CoreWindow_PointerPressed | ( | CoreWindow | sender,
 |  | PointerEventArgs | e |
 | ) |  |  | [inline, private]

Invoked on every mouse click, touch screen tap, or equivalent interaction.

Used to detect browser-style next and previous mouse button clicks to navigate between pages.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 288 of file NavigationHelper.cs.

        {
            var properties = e.CurrentPoint.Properties;

            // Ignore button chords with the left, right, and middle buttons
            if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
                properties.IsMiddleButtonPressed)
                return;

            // If back or foward are pressed (but not both) navigate appropriately
            bool backPressed = properties.IsXButton1Pressed;
            bool forwardPressed = properties.IsXButton2Pressed;
            if (backPressed ^ forwardPressed)
            {
                e.Handled = true;
                if (backPressed) this.TryGoBack();
                if (forwardPressed) this.TryGoForward();
            }
        }

void SystemNavigationManager_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 225 of file NavigationHelper.cs.

        {
            if (!e.Handled)
            {
                e.Handled = TryGoBack();
            }
        }

bool TryGoBack ( ) [inline, private]

Definition at line 202 of file NavigationHelper.cs.

        {
            bool navigated = false;
            if (this.Frame.CanGoBack)
            {
                this.Frame.GoBack();
                navigated = true;
            }
            return navigated;
        }

bool TryGoForward ( ) [inline, private]

Definition at line 213 of file NavigationHelper.cs.

        {
            bool navigated = false;
            if (this.Frame.CanGoForward)
            {
                this.Frame.GoForward();
                navigated = true;
            }
            return navigated;
        }

void UpdateBackButton ( ) [inline, private]

Definition at line 233 of file NavigationHelper.cs.

        {
            systemNavigationManager.AppViewBackButtonVisibility =
                this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }

Member Data Documentation

SystemNavigationManager systemNavigationManager [private]

Definition at line 175 of file NavigationHelper.cs.

Property Documentation

Frame Frame [get, set, private]

Definition at line 174 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SaveStateEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • SaveStateEventArgs
Public Member Functions | Properties

SaveStateEventArgs Class Reference

Class used to hold the event data required when a page attempts to save state.

List of all members.

Public Member Functions

SaveStateEventArgs (Dictionary< string, Object > pageState)

Properties

Dictionary< string, Object > PageState [get, set]

Detailed Description

Definition at line 356 of file NavigationHelper.cs.

Constructor & Destructor Documentation

SaveStateEventArgs ( Dictionary< string, Object > pageState ) [inline]

Initializes a new instance of the SaveStateEventArgs class.

Parameters:
pageState An empty dictionary to be populated with serializable state.

Definition at line 367 of file NavigationHelper.cs.

            : base()
        {
            this.PageState = pageState;
        }

Property Documentation

Dictionary<string, Object> PageState [get, set]

An empty dictionary to be populated with serializable state.

Definition at line 361 of file NavigationHelper.cs.

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/Common/NavigationHelper.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuspensionManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • SuspensionManager
Static Public Member Functions | Properties | Static Private Member Functions | Private Attributes | Static Private Attributes

SuspensionManager Class Reference

SuspensionManager captures global session state to simplify process lifetime management for an application. More...

List of all members.

Static Public Member Functions

static void | RegisterFrame (Frame frame, String sessionStateKey, String sessionBaseKey=null)
static void | RegisterFrame (Frame frame, String sessionStateKey, String sessionBaseKey=null)
static async Task | RestoreAsync (String sessionBaseKey=null)
static async Task | RestoreAsync (String sessionBaseKey=null)
static async Task | SaveAsync ()
static async Task | SaveAsync ()
static Dictionary< String, Object > | SessionStateForFrame (Frame frame)
static Dictionary< String, Object > | SessionStateForFrame (Frame frame)
static void | UnregisterFrame (Frame frame)
static void | UnregisterFrame (Frame frame)

Properties

static List< Type > | KnownTypes [get]
static Dictionary< string, object > | SessionState [get]

Static Private Member Functions

static void | RestoreFrameNavigationState (Frame frame)
static void | RestoreFrameNavigationState (Frame frame)
static void | SaveFrameNavigationState (Frame frame)
static void | SaveFrameNavigationState (Frame frame)

Private Attributes

const string | sessionStateFilename = "_sessionState.xml"

Static Private Attributes

static List< Type > | _knownTypes = new List<Type>()
static List< WeakReference
< Frame > > 		_registeredFrames = new List<WeakReference<Frame>>()
static Dictionary< string, object > | _sessionState = new Dictionary<string, object>()
static DependencyProperty | FrameSessionBaseKeyProperty
static DependencyProperty | FrameSessionStateKeyProperty
static DependencyProperty | FrameSessionStateProperty

Detailed Description

Note that session state will be automatically cleared under a variety of conditions and should only be used to store information that would be convenient to carry across sessions, but that should be discarded when an application crashes or is upgraded.

Definition at line 34 of file SuspensionManager.cs.

Member Function Documentation

static void RegisterFrame | ( | Frame | frame,
 |  | String | sessionStateKey,
 |  | String | sessionBaseKey = null |
 | ) |  |  | [inline, static]

Registers a Frame instance to allow its navigation history to be saved to and restored from SessionState.

Frames should be registered once immediately after creation if they will participate in session state management. Upon registration if state has already been restored for the specified key the navigation history will immediately be restored. Subsequent invocations of RestoreAsync will also restore navigation history.

Parameters:
frame | An instance whose navigation history should be managed by SuspensionManager
sessionStateKey | A unique key into SessionState used to store navigation-related information.
sessionBaseKey | An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.

Definition at line 168 of file SuspensionManager.cs.

        {
            if (frame.GetValue(FrameSessionStateKeyProperty) != null)
            {
                throw new InvalidOperationException("Frames can only be registered to one session state key");
            }

            if (frame.GetValue(FrameSessionStateProperty) != null)
            {
                throw new InvalidOperationException("Frames must be either be registered before accessing frame session state, or not registered at all");
            }

            if (!string.IsNullOrEmpty(sessionBaseKey))
            {
                frame.SetValue(FrameSessionBaseKeyProperty, sessionBaseKey);
                sessionStateKey = sessionBaseKey + "_" + sessionStateKey;
            }

            // Use a dependency property to associate the session key with a frame, and keep a list of frames whose
            // navigation state should be managed
            frame.SetValue(FrameSessionStateKeyProperty, sessionStateKey);
            _registeredFrames.Add(new WeakReference<Frame>(frame));

            // Check to see if navigation state can be restored
            RestoreFrameNavigationState(frame);
        }

static void RegisterFrame | ( | Frame | frame,
 |  | String | sessionStateKey,
 |  | String | sessionBaseKey = null |
 | ) |  |  | [inline, static]

Registers a Frame instance to allow its navigation history to be saved to and restored from SessionState.

Frames should be registered once immediately after creation if they will participate in session state management. Upon registration if state has already been restored for the specified key the navigation history will immediately be restored. Subsequent invocations of RestoreAsync will also restore navigation history.

Parameters:
frame | An instance whose navigation history should be managed by SuspensionManager
sessionStateKey | A unique key into SessionState used to store navigation-related information.
sessionBaseKey | An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.

Definition at line 157 of file SuspensionManager.cs.

        {
            if (frame.GetValue(FrameSessionStateKeyProperty) != null)
            {
                throw new InvalidOperationException("Frames can only be registered to one session state key");
            }

            if (frame.GetValue(FrameSessionStateProperty) != null)
            {
                throw new InvalidOperationException("Frames must be either be registered before accessing frame session state, or not registered at all");
            }

            if (!string.IsNullOrEmpty(sessionBaseKey))
            {
                frame.SetValue(FrameSessionBaseKeyProperty, sessionBaseKey);
                sessionStateKey = sessionBaseKey + "_" + sessionStateKey;
            }

            // Use a dependency property to associate the session key with a frame, and keep a list of frames whose
            // navigation state should be managed
            frame.SetValue(FrameSessionStateKeyProperty, sessionStateKey);
            _registeredFrames.Add(new WeakReference<Frame>(frame));

            // Check to see if navigation state can be restored
            RestoreFrameNavigationState(frame);
        }

static async Task RestoreAsync ( String sessionBaseKey = null ) [inline, static]

Restores previously saved SessionState.

Any Frame instances registered with RegisterFrame will also restore their prior navigation state, which in turn gives their active Page an opportunity restore its state.

Parameters:
sessionBaseKey An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.
Returns:
An asynchronous task that reflects when session state has been read. The content of SessionState should not be relied upon until this task completes.

Definition at line 103 of file SuspensionManager.cs.

        {
            _sessionState = new Dictionary<String, Object>();

            try
            {
                // Get the input stream for the SessionState file
                StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
                using (IInputStream inStream = await file.OpenSequentialReadAsync())
                {
                    // Deserialize the Session State
                    DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                    _sessionState = (Dictionary<string, object>)serializer.ReadObject(inStream.AsStreamForRead());
                }

                // Restore any registered frames to their saved state
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame) && (string)frame.GetValue(FrameSessionBaseKeyProperty) == sessionBaseKey)
                    {
                        frame.ClearValue(FrameSessionStateProperty);
                        RestoreFrameNavigationState(frame);
                    }
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static async Task RestoreAsync ( String sessionBaseKey = null ) [inline, static]

Restores previously saved SessionState.

Any Frame instances registered with RegisterFrame will also restore their prior navigation state, which in turn gives their active Page an opportunity restore its state.

Parameters:
sessionBaseKey An optional key that identifies the type of session. This can be used to distinguish between multiple application launch scenarios.
Returns:
An asynchronous task that reflects when session state has been read. The content of SessionState should not be relied upon until this task completes.

Definition at line 114 of file SuspensionManager.cs.

        {
            _sessionState = new Dictionary<String, Object>();

            try
            {
                // Get the input stream for the SessionState file
                StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
                using (IInputStream inStream = await file.OpenSequentialReadAsync())
                {
                    // Deserialize the Session State
                    DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                    _sessionState = (Dictionary<string, object>)serializer.ReadObject(inStream.AsStreamForRead());
                }

                // Restore any registered frames to their saved state
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame) && (string)frame.GetValue(FrameSessionBaseKeyProperty) == sessionBaseKey)
                    {
                        frame.ClearValue(FrameSessionStateProperty);
                        RestoreFrameNavigationState(frame);
                    }
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static void RestoreFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 242 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            if (frameState.ContainsKey("Navigation"))
            {
                frame.SetNavigationState((String)frameState["Navigation"]);
            }
        }

static void RestoreFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 253 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            if (frameState.ContainsKey("Navigation"))
            {
                frame.SetNavigationState((String)frameState["Navigation"]);
            }
        }

static async Task SaveAsync ( ) [inline, static]

Save the current SessionState.

Any Frame instances registered with RegisterFrame will also preserve their current navigation stack, which in turn gives their active Page an opportunity to save its state.

Returns:
An asynchronous task that reflects when session state has been saved.

Definition at line 69 of file SuspensionManager.cs.

        {
            try
            {
                // Save the navigation state for all registered frames
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame))
                    {
                        SaveFrameNavigationState(frame);
                    }
                }

                // Serialize the session state synchronously to avoid asynchronous access to shared
                // state
                MemoryStream sessionData = new MemoryStream();
                DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                serializer.WriteObject(sessionData, _sessionState);

                // Get an output stream for the SessionState file and write the state asynchronously
                StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sessionStateFilename, CreationCollisionOption.ReplaceExisting);
                using (Stream fileStream = await file.OpenStreamForWriteAsync())
                {
                    sessionData.Seek(0, SeekOrigin.Begin);
                    await sessionData.CopyToAsync(fileStream);
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static async Task SaveAsync ( ) [inline, static]

Save the current SessionState.

Any Frame instances registered with RegisterFrame will also preserve their current navigation stack, which in turn gives their active Page an opportunity to save its state.

Returns:
An asynchronous task that reflects when session state has been saved.

Definition at line 58 of file SuspensionManager.cs.

        {
            try
            {
                // Save the navigation state for all registered frames
                foreach (var weakFrameReference in _registeredFrames)
                {
                    Frame frame;
                    if (weakFrameReference.TryGetTarget(out frame))
                    {
                        SaveFrameNavigationState(frame);
                    }
                }

                // Serialize the session state synchronously to avoid asynchronous access to shared
                // state
                MemoryStream sessionData = new MemoryStream();
                DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
                serializer.WriteObject(sessionData, _sessionState);

                // Get an output stream for the SessionState file and write the state asynchronously
                StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sessionStateFilename, CreationCollisionOption.ReplaceExisting);
                using (Stream fileStream = await file.OpenStreamForWriteAsync())
                {
                    sessionData.Seek(0, SeekOrigin.Begin);
                    await sessionData.CopyToAsync(fileStream);
                }
            }
            catch (Exception e)
            {
                throw new SuspensionManagerException(e);
            }
        }

static void SaveFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 251 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            frameState["Navigation"] = frame.GetNavigationState();
        }

static void SaveFrameNavigationState ( Frame frame ) [inline, static, private]

Definition at line 262 of file SuspensionManager.cs.

        {
            var frameState = SessionStateForFrame(frame);
            frameState["Navigation"] = frame.GetNavigationState();
        }

static Dictionary<String, Object> SessionStateForFrame ( Frame frame ) [inline, static]

Provides storage for session state associated with the specified Frame.

Frames that have been previously registered with RegisterFrame have their session state saved and restored automatically as a part of the global SessionState. Frames that are not registered have transient state that can still be useful when restoring pages that have been discarded from the navigation cache.

Apps may choose to rely on NavigationHelper to manage page-specific state instead of working with frame session state directly.

Parameters:
frame The instance for which session state is desired.
Returns:
A collection of state subject to the same serialization mechanism as SessionState.

Definition at line 227 of file SuspensionManager.cs.

        {
            var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);

            if (frameState == null)
            {
                var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
                if (frameSessionKey != null)
                {
                    // Registered frames reflect the corresponding session state
                    if (!_sessionState.ContainsKey(frameSessionKey))
                    {
                        _sessionState[frameSessionKey] = new Dictionary<String, Object>();
                    }
                    frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
                }
                else
                {
                    // Frames that aren't registered have transient state
                    frameState = new Dictionary<String, Object>();
                }
                frame.SetValue(FrameSessionStateProperty, frameState);
            }
            return frameState;
        }

static Dictionary<String, Object> SessionStateForFrame ( Frame frame ) [inline, static]

Provides storage for session state associated with the specified Frame.

Frames that have been previously registered with RegisterFrame have their session state saved and restored automatically as a part of the global SessionState. Frames that are not registered have transient state that can still be useful when restoring pages that have been discarded from the navigation cache.

Apps may choose to rely on NavigationHelper to manage page-specific state instead of working with frame session state directly.

Parameters:
frame The instance for which session state is desired.
Returns:
A collection of state subject to the same serialization mechanism as SessionState.

Definition at line 216 of file SuspensionManager.cs.

        {
            var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);

            if (frameState == null)
            {
                var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
                if (frameSessionKey != null)
                {
                    // Registered frames reflect the corresponding session state
                    if (!_sessionState.ContainsKey(frameSessionKey))
                    {
                        _sessionState[frameSessionKey] = new Dictionary<String, Object>();
                    }
                    frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
                }
                else
                {
                    // Frames that aren't registered have transient state
                    frameState = new Dictionary<String, Object>();
                }
                frame.SetValue(FrameSessionStateProperty, frameState);
            }
            return frameState;
        }

static void UnregisterFrame ( Frame frame ) [inline, static]

Disassociates a Frame previously registered by RegisterFrame from SessionState.

Any navigation state previously captured will be removed.

Parameters:
frame An instance whose navigation history should no longer be managed.

Definition at line 191 of file SuspensionManager.cs.

        {
            // Remove session state and remove the frame from the list of frames whose navigation
            // state will be saved (along with any weak references that are no longer reachable)
            SessionState.Remove((String)frame.GetValue(FrameSessionStateKeyProperty));
            _registeredFrames.RemoveAll((weakFrameReference) =>
            {
                Frame testFrame;
                return !weakFrameReference.TryGetTarget(out testFrame) || testFrame == frame;
            });
        }

static void UnregisterFrame ( Frame frame ) [inline, static]

Disassociates a Frame previously registered by RegisterFrame from SessionState.

Any navigation state previously captured will be removed.

Parameters:
frame An instance whose navigation history should no longer be managed.

Definition at line 202 of file SuspensionManager.cs.

        {
            // Remove session state and remove the frame from the list of frames whose navigation
            // state will be saved (along with any weak references that are no longer reachable)
            SessionState.Remove((String)frame.GetValue(FrameSessionStateKeyProperty));
            _registeredFrames.RemoveAll((weakFrameReference) =>
            {
                Frame testFrame;
                return !weakFrameReference.TryGetTarget(out testFrame) || testFrame == frame;
            });
        }

Member Data Documentation

static List< Type > _knownTypes = new List<Type>() [static, private]

Definition at line 37 of file SuspensionManager.cs.

static List< WeakReference< Frame > > _registeredFrames = new List<WeakReference<Frame>>() [static, private]

Definition at line 152 of file SuspensionManager.cs.

static Dictionary< string, object > _sessionState = new Dictionary<string, object>() [static, private]

Definition at line 36 of file SuspensionManager.cs.

static DependencyProperty FrameSessionBaseKeyProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionBaseKeyParams", typeof(String), typeof(SuspensionManager), null)

Definition at line 148 of file SuspensionManager.cs.

static DependencyProperty FrameSessionStateKeyProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionStateKey", typeof(String), typeof(SuspensionManager), null)

Definition at line 146 of file SuspensionManager.cs.

static DependencyProperty FrameSessionStateProperty [static, private]
Initial value:
            DependencyProperty.RegisterAttached("_FrameSessionState", typeof(Dictionary<String, Object>), typeof(SuspensionManager), null)

Definition at line 150 of file SuspensionManager.cs.

const string sessionStateFilename = "_sessionState.xml" [private]

Definition at line 38 of file SuspensionManager.cs.

Property Documentation

static List< Type > KnownTypes [static, get]

List of custom types provided to the DataContractSerializer when reading and writing session state.

Initially empty, additional types may be added to customize the serialization process.

Definition at line 58 of file SuspensionManager.cs.

static Dictionary< string, object > SessionState [static, get]

Provides access to global session state for the current session.

This state is serialized by SaveAsync and restored by RestoreAsync, so values must be serializable by DataContractSerializer and should be as compact as possible. Strings and other self-contained data types are strongly recommended.

Definition at line 48 of file SuspensionManager.cs.

The documentation for this class was generated from the following files:
  • BasicSuspension/cs/Common/SuspensionManager.cs
  • SplashScreen/cs/common/SuspensionManager.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SuspensionManagerException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Common
  • SuspensionManagerException
Public Member Functions

SuspensionManagerException Class Reference

List of all members.

Public Member Functions

SuspensionManagerException ()
SuspensionManagerException (Exception e)
SuspensionManagerException ()
SuspensionManagerException (Exception e)

Detailed Description

Definition at line 268 of file SuspensionManager.cs.

Constructor & Destructor Documentation

SuspensionManagerException ( ) [inline]

Definition at line 270 of file SuspensionManager.cs.

        {
        }

SuspensionManagerException ( Exception e ) [inline]

Definition at line 274 of file SuspensionManager.cs.

            : base("SuspensionManager failed", e)
        {

        }

SuspensionManagerException ( ) [inline]

Definition at line 259 of file SuspensionManager.cs.

        {
        }

SuspensionManagerException ( Exception e ) [inline]

Definition at line 263 of file SuspensionManager.cs.

            : base("SuspensionManager failed", e)
        {

        }

The documentation for this class was generated from the following files:
  • BasicSuspension/cs/Common/SuspensionManager.cs
  • SplashScreen/cs/common/SuspensionManager.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompletedCallback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CompletedCallback
Public Member Functions | Private Member Functions | Private Attributes

CompletedCallback Class Reference

List of all members.

Public Member Functions

CompletedCallback ()

Private Member Functions

async void CompletedCallbackButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file CompletedCallback.xaml.cs.

Constructor & Destructor Documentation

CompletedCallback ( ) [inline]

Definition at line 24 of file CompletedCallback.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CompletedCallbackButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'CompletedCallbackButton' button.

Demonstrates the use of a message dialog with custom commands and using a completed callback instead of delegates. A message will be displayed indicating which command was invoked on the dialog. In this scenario, 'Install updates' is selected as the default choice.

Parameters:
sender | The Object that caused this event to be fired.
e | State information and event data associated with the routed event.

Definition at line 37 of file CompletedCallback.xaml.cs.

        {
            // Create the message dialog and set its content and title
            var messageDialog = new MessageDialog("New updates have been found for this program. Would you like to install the new updates?", "Updates available");

            // Add commands and set their command ids
            messageDialog.Commands.Add(new UICommand("Don't install", null, 0));
            messageDialog.Commands.Add(new UICommand("Install updates", null, 1));

            // Set the command that will be invoked by default
            messageDialog.DefaultCommandIndex = 1;

            // Show the message dialog and get the event that was invoked via the async operator
            var commandChosen = await messageDialog.ShowAsync();

            // Display message showing the label and id of the command that was invoked
            rootPage.NotifyUser("The '" + commandChosen.Label + "' (" + commandChosen.Id + ") command has been selected.", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file CompletedCallback.xaml.cs.

The documentation for this class was generated from the following files:
  • MessageDialog/cs/CompletedCallback.xaml.cs
  • MessageDialog/cpp/CompletedCallback.xaml.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Compression
  • sealed
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "Scenario1.xaml.h"

List of all members.

Public Member Functions

Scenario1 ()
Scenario2 ()
Scenario3 ()

Protected Member Functions

virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

Private Member Functions

void | CompressAlgorithmComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CompressAlgorithmComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CompressAlgorithmComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
int | CompressAlgorithmFromComboBoxItem (Windows::UI::Xaml::Controls::ComboBoxItem^item)
int | CompressAlgorithmFromComboBoxItem (Windows::UI::Xaml::Controls::ComboBoxItem^item)
int | CompressAlgorithmFromComboBoxItem (Windows::UI::Xaml::Controls::ComboBoxItem^item)
void | CompressFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CompressFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CompressFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DoScenario (Windows::Storage::Compression::CompressAlgorithm Algorithm)
void | DoScenario (Windows::Storage::Compression::CompressAlgorithm Algorithm)
void | DoScenario (Windows::Storage::Compression::CompressAlgorithm Algorithm)
void | UpdateDescriptionVisibility (Windows::UI::Xaml::Controls::ComboBoxItem^item, Windows::UI::Xaml::Visibility visibility)
void | UpdateDescriptionVisibility (Windows::UI::Xaml::Controls::ComboBoxItem^item, Windows::UI::Xaml::Visibility visibility)
void | UpdateDescriptionVisibility (Windows::UI::Xaml::Controls::ComboBoxItem^item, Windows::UI::Xaml::Visibility visibility)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 30 of file Scenario1.xaml.h.

Member Function Documentation

void CompressAlgorithmComboBox_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CompressAlgorithmComboBox_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CompressAlgorithmComboBox_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
int CompressAlgorithmFromComboBoxItem ( Windows::UI::Xaml::Controls::ComboBoxItem^ item ) [private]
int CompressAlgorithmFromComboBoxItem ( Windows::UI::Xaml::Controls::ComboBoxItem^ item ) [private]
int CompressAlgorithmFromComboBoxItem ( Windows::UI::Xaml::Controls::ComboBoxItem^ item ) [private]
void CompressFileButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CompressFileButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CompressFileButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DoScenario ( Windows::Storage::Compression::CompressAlgorithm Algorithm ) [private]
void DoScenario ( Windows::Storage::Compression::CompressAlgorithm Algorithm ) [private]
void DoScenario ( Windows::Storage::Compression::CompressAlgorithm Algorithm ) [private]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
void UpdateDescriptionVisibility | ( | Windows::UI::Xaml::Controls::ComboBoxItem^ | item,
 |  | Windows::UI::Xaml::Visibility | visibility |
 | ) |  |  | [private]
void UpdateDescriptionVisibility | ( | Windows::UI::Xaml::Controls::ComboBoxItem^ | item,
 |  | Windows::UI::Xaml::Visibility | visibility |
 | ) |  |  | [private]
void UpdateDescriptionVisibility | ( | Windows::UI::Xaml::Controls::ComboBoxItem^ | item,
 |  | Windows::UI::Xaml::Visibility | visibility |
 | ) |  |  | [private]

Member Data Documentation

MainPage rootPage [private]

Definition at line 38 of file Scenario1.xaml.h.

The documentation for this class was generated from the following files:
  • Compression/cpp/Scenario1.xaml.h
  • Compression/cpp/Scenario2.xaml.h
  • Compression/cpp/Scenario3.xaml.h
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectedDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ConnectedDevice
Public Member Functions | Properties

ConnectedDevice Class Reference

List of all members.

Public Member Functions

ConnectedDevice (string displayName, WiFiDirectDevice wfdDevice, SocketReaderWriter socketRW)
void | Dispose ()
override string | ToString ()

Properties

string | DisplayName [get]
SocketReaderWriter | SocketRW [get]
WiFiDirectDevice | WfdDevice [get]

Detailed Description

Definition at line 116 of file SocketReaderWriter.cs.

Constructor & Destructor Documentation

ConnectedDevice | ( | string | displayName,
 |  | WiFiDirectDevice | wfdDevice,
 |  | SocketReaderWriter | socketRW |
 | ) |  |  | [inline]

Definition at line 122 of file SocketReaderWriter.cs.

        {
            DisplayName = displayName;
            WfdDevice = wfdDevice;
            SocketRW = socketRW;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 131 of file SocketReaderWriter.cs.

        {
            // Close socket
            SocketRW.Dispose();

            // Close WiFiDirectDevice object
            WfdDevice.Dispose();
        }

override string ToString ( )

Property Documentation

string DisplayName [get]

Definition at line 120 of file SocketReaderWriter.cs.

SocketReaderWriter SocketRW [get]

Definition at line 118 of file SocketReaderWriter.cs.

WiFiDirectDevice WfdDevice [get]

Definition at line 119 of file SocketReaderWriter.cs.

The documentation for this class was generated from the following file:
  • WiFiDirect/cs/SocketReaderWriter.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectionSettingsPanel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ConnectionSettingsPanel
Public Member Functions | Private Member Functions | Private Attributes

ConnectionSettingsPanel Class Reference

List of all members.

Public Member Functions

ConnectionSettingsPanel ()
async Task< bool > | RequestPairDeviceAsync (DeviceInformationPairing pairing)
void | Reset ()

Private Member Functions

void | btnAddConfigMethods_Click (object sender, RoutedEventArgs e)
void | OnPairingRequested (DeviceInformationCustomPairing sender, DevicePairingRequestedEventArgs args)

Private Attributes

List
< WiFiDirectConfigurationMethod > 		_supportedConfigMethods = new List<WiFiDirectConfigurationMethod>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file ConnectionSettingsPanel.xaml.cs.

Constructor & Destructor Documentation

ConnectionSettingsPanel ( ) [inline]

Definition at line 29 of file ConnectionSettingsPanel.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the GroupOwnerIntent combo box.
            // The options are "Default", then values 0 through 15.
            cmbGOIntent.Items.Add(new ComboBoxItem() { Content = "Default" });
            for (int i = 0; i <= 15; i++)
            {
                cmbGOIntent.Items.Add(new ComboBoxItem() { Content = i.ToString(), Tag = (short)i });
            }
            cmbGOIntent.SelectedIndex = 0;
        }

Member Function Documentation

void btnAddConfigMethods_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file ConnectionSettingsPanel.xaml.cs.

        {
            // The configuration methods are added in the order of preference, most preferred first.
            // Save the values here so we can apply them in RequestPairDeviceAsync.
            // In practice, most apps will have a hard-coded preference list.
            WiFiDirectConfigurationMethod method = Utils.GetSelectedItemTag<WiFiDirectConfigurationMethod>(cmbSupportedConfigMethods);
            _supportedConfigMethods.Add(method);
            rootPage.NotifyUser($"Added configuration method {method}", NotifyType.StatusMessage);
        }

void OnPairingRequested | ( | DeviceInformationCustomPairing | sender,
 |  | DevicePairingRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 98 of file ConnectionSettingsPanel.xaml.cs.

        {
            Utils.HandlePairing(Dispatcher, args);
        }

async Task<bool> RequestPairDeviceAsync ( DeviceInformationPairing pairing ) [inline]

Definition at line 58 of file ConnectionSettingsPanel.xaml.cs.

        {
            WiFiDirectConnectionParameters connectionParams = new WiFiDirectConnectionParameters();

            short? groupOwnerIntent = Utils.GetSelectedItemTag<short?>(cmbGOIntent);
            if (groupOwnerIntent.HasValue)
            {
                connectionParams.GroupOwnerIntent = groupOwnerIntent.Value;
            }

            DevicePairingKinds devicePairingKinds = DevicePairingKinds.None;

            // If specific configuration methods were added, then use them.
            if (_supportedConfigMethods.Count > 0)
            {
                foreach (var configMethod in _supportedConfigMethods)
                {
                    connectionParams.PreferenceOrderedConfigurationMethods.Add(configMethod);
                    devicePairingKinds |= WiFiDirectConnectionParameters.GetDevicePairingKinds(configMethod);
                }
            }
            else
            {
                // If specific configuration methods were not added, then we'll use these pairing kinds.
                devicePairingKinds = DevicePairingKinds.ConfirmOnly | DevicePairingKinds.DisplayPin | DevicePairingKinds.ProvidePin;
            }

            connectionParams.PreferredPairingProcedure = Utils.GetSelectedItemTag<WiFiDirectPairingProcedure>(cmbPreferredPairingProcedure);
            DeviceInformationCustomPairing customPairing = pairing.Custom;
            customPairing.PairingRequested += OnPairingRequested;

            DevicePairingResult result = await customPairing.PairAsync(devicePairingKinds, DevicePairingProtectionLevel.Default, connectionParams);
            if (result.Status != DevicePairingResultStatus.Paired)
            {
                rootPage.NotifyUser($"PairAsync failed, Status: {result.Status}", NotifyType.ErrorMessage);
                return false;
            }
            return true;
        }

void Reset ( ) [inline]

Definition at line 43 of file ConnectionSettingsPanel.xaml.cs.

        {
            _supportedConfigMethods.Clear();
        }

Member Data Documentation

List<WiFiDirectConfigurationMethod> _supportedConfigMethods = new List<WiFiDirectConfigurationMethod>() [private]

Definition at line 27 of file ConnectionSettingsPanel.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file ConnectionSettingsPanel.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiDirect/cs/ConnectionSettingsPanel.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Constants Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Constants
Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes

Constants Class Reference

Class containing Attributes and UUIDs that will populate the SDP record.

List of all members.

Public Attributes

const string | SdpServiceName = "Bluetooth Rfcomm Chat Service"
const UInt16 | SdpServiceNameAttributeId = 0x100
const byte | SdpServiceNameAttributeType = (4 << 3) | 5

Static Public Attributes

static readonly Guid | CalcServiceUuid = Guid.Parse("caecface-e1d9-11e6-bf01-fe55135034f0")
static readonly string | ConnectEntryPoint = "BackgroundTask.ConnectTask"
static readonly string | ConnectTaskName = "ConnectTask"
static readonly string | DeviceWatcherTaskName = "DeviceWatcherTask"
static readonly
GattLocalCharacteristicParameters 		gattOperandParameters
static readonly
GattLocalCharacteristicParameters 		gattOperatorParameters
static readonly
GattLocalCharacteristicParameters 		gattResultParameters
static readonly string | MetadataUpdateEntryPoint = "BackgroundTask.UpdateMetadataTask"
static readonly string | MetadataUpdateTaskName = "UpdateMetadataTask"
static readonly Guid | Op1CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f1")
static readonly Guid | Op2CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f2")
static readonly Guid | OperatorCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f3")
static readonly Guid | ResultCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f4")
static readonly Guid | RfcommChatServiceUuid = Guid.Parse("34B1CF4D-1069-4AD6-89B6-E161D79BE4D8")
static readonly Guid | SampleHotspotGuid = new Guid("4c6e8b20-b2de-472e-808b-bd423e168cd0")

Private Attributes

internal const string | ContactEmail = "janedoe@example.com"
internal const string | ContactFirstName = "Jane"
internal const string | ContactLastName = "Doe"
internal const string | ContactListName = "ContactPanelSample"
internal const string | ContactPhone = "4255550123"
internal const string | Protocol = "cpsdkcs"

Static Private Attributes

static internal string | ContactImageSource = "https://docs.microsoft.com/en-us/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png"
static internal string | ContactRemoteId = "ms-{Protocol}:31415"

Detailed Description

Definition at line 7 of file Constants.cs.

Member Data Documentation

readonly Guid CalcServiceUuid = Guid.Parse("caecface-e1d9-11e6-bf01-fe55135034f0") [static]

Definition at line 34 of file Constants.cs.

readonly string ConnectEntryPoint = "BackgroundTask.ConnectTask" [static]

Definition at line 48 of file SampleConfiguration.cs.

readonly string ConnectTaskName = "ConnectTask" [static]

Definition at line 47 of file SampleConfiguration.cs.

internal const string ContactEmail = "janedoe@example.com" [private]

Definition at line 50 of file SampleConfiguration.cs.

internal const string ContactFirstName = "Jane" [private]

Definition at line 52 of file SampleConfiguration.cs.

internal string ContactImageSource = "https://docs.microsoft.com/en-us/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png" [static, private]

Definition at line 54 of file SampleConfiguration.cs.

internal const string ContactLastName = "Doe" [private]

Definition at line 53 of file SampleConfiguration.cs.

internal const string ContactListName = "ContactPanelSample" [private]

Definition at line 49 of file SampleConfiguration.cs.

internal const string ContactPhone = "4255550123" [private]

Definition at line 51 of file SampleConfiguration.cs.

internal string ContactRemoteId = "ms-{Protocol}:31415" [static, private]

Definition at line 48 of file SampleConfiguration.cs.

readonly string DeviceWatcherTaskName = "DeviceWatcherTask" [static]

Definition at line 53 of file SampleConfiguration.cs.

readonly GattLocalCharacteristicParameters gattOperandParameters [static]
Initial value:
 new GattLocalCharacteristicParameters
        {
            CharacteristicProperties = GattCharacteristicProperties.Write |
                                       GattCharacteristicProperties.WriteWithoutResponse,
            WriteProtectionLevel = GattProtectionLevel.Plain,
            UserDescription = "Operand Characteristic"
        }

Definition at line 10 of file Constants.cs.

readonly GattLocalCharacteristicParameters gattOperatorParameters [static]
Initial value:
 new GattLocalCharacteristicParameters
        {
            CharacteristicProperties = GattCharacteristicProperties.Write |
                                       GattCharacteristicProperties.WriteWithoutResponse,
            WriteProtectionLevel = GattProtectionLevel.Plain,
            UserDescription = "Operator Characteristic"
        }

Definition at line 18 of file Constants.cs.

readonly GattLocalCharacteristicParameters gattResultParameters [static]
Initial value:
 new GattLocalCharacteristicParameters
        {
            CharacteristicProperties = GattCharacteristicProperties.Read |
                                       GattCharacteristicProperties.Notify,
            WriteProtectionLevel = GattProtectionLevel.Plain,
            UserDescription = "Result Characteristic"
        }

Definition at line 26 of file Constants.cs.

readonly string MetadataUpdateEntryPoint = "BackgroundTask.UpdateMetadataTask" [static]

Definition at line 43 of file SampleConfiguration.cs.

readonly string MetadataUpdateTaskName = "UpdateMetadataTask" [static]

Definition at line 42 of file SampleConfiguration.cs.

readonly Guid Op1CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f1") [static]

Definition at line 36 of file Constants.cs.

readonly Guid Op2CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f2") [static]

Definition at line 37 of file Constants.cs.

readonly Guid OperatorCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f3") [static]

Definition at line 38 of file Constants.cs.

internal const string Protocol = "cpsdkcs" [private]

Definition at line 41 of file SampleConfiguration.cs.

readonly Guid ResultCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f4") [static]

Definition at line 39 of file Constants.cs.

readonly Guid RfcommChatServiceUuid = Guid.Parse("34B1CF4D-1069-4AD6-89B6-E161D79BE4D8") [static]

Definition at line 54 of file SampleConfiguration.cs.

readonly Guid SampleHotspotGuid = new Guid("4c6e8b20-b2de-472e-808b-bd423e168cd0") [static]

Definition at line 38 of file SampleConfiguration.cs.

const string SdpServiceName = "Bluetooth Rfcomm Chat Service"

Definition at line 66 of file SampleConfiguration.cs.

const UInt16 SdpServiceNameAttributeId = 0x100

Definition at line 57 of file SampleConfiguration.cs.

const byte SdpServiceNameAttributeType = (4 << 3) | 5

Definition at line 63 of file SampleConfiguration.cs.

The documentation for this class was generated from the following files:
  • BluetoothLE/cs/Constants.cs
  • BluetoothRfcommChat/cs/SampleConfiguration.cs
  • ContactPanel/cs/SampleConfiguration.cs
  • OnDemandHotspot/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Contact Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Contact
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Static Private Member Functions | Static Private Attributes

Contact Class Reference

List of all members.

Public Member Functions

Contact ()
override string | ToString ()

Static Public Member Functions

static ObservableCollection
< Contact > 		GetContacts (int numberOfContacts)
static ObservableCollection
< GroupInfoList > 		GetContactsGrouped (int numberOfContacts)
static Contact | GetNewContact ()

Public Attributes

string | Initials = Guid.NewGuid().ToString()> InitialOf(FirstName) + InitialOf(LastName)
string | Name = " " + LastName

Properties

string | Biography = GeneratePhoneNumber() [get]
string | FirstName = GenerateLastName() [get]
string | Id [get]
string | LastName [get]
string | PhoneNumber = GeneratePosition() [get]
string | Position = GenerateFirstName() [get]

Static Private Member Functions

static string | GenerateBiography ()
static string | GenerateFirstName ()
static string | GenerateLastName ()
static string | GeneratePhoneNumber ()
static string | GeneratePosition ()
static string | InitialOf (string word)

Static Private Attributes

static Random | random = new Random()

Detailed Description

Definition at line 18 of file Contact.cs.

Constructor & Destructor Documentation

Contact ( ) [inline]

Definition at line 33 of file Contact.cs.

        {
        }

Member Function Documentation

static string GenerateBiography ( ) [inline, static, private]

Definition at line 89 of file Contact.cs.

        {
            List<string> biographies = new List<string>()
            {
                @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer id facilisis lectus. Cras nec convallis ante, quis pulvinar tellus. Integer dictum accumsan pulvinar. Pellentesque eget enim sodales sapien vestibulum consequat.",
                @"Maecenas eu sapien ac urna aliquam dictum.",
                @"Nullam eget mattis metus. Donec pharetra, tellus in mattis tincidunt, magna ipsum gravida nibh, vitae lobortis ante odio vel quam.",
                @"Quisque accumsan pretium ligula in faucibus. Mauris sollicitudin augue vitae lorem cursus condimentum quis ac mauris. Pellentesque quis turpis non nunc pretium sagittis. Nulla facilisi. Maecenas eu lectus ante. Proin eleifend vel lectus non tincidunt. Fusce condimentum luctus nisi, in elementum ante tincidunt nec.",
                @"Aenean in nisl at elit venenatis blandit ut vitae lectus. Praesent in sollicitudin nunc. Pellentesque justo augue, pretium at sem lacinia, scelerisque semper erat. Ut cursus tortor at metus lacinia dapibus.",
                @"Ut consequat magna luctus justo egestas vehicula. Integer pharetra risus libero, et posuere justo mattis et.",
                @"Proin malesuada, libero vitae aliquam venenatis, diam est faucibus felis, vitae efficitur erat nunc non mauris. Suspendisse at sodales erat.",
                @"Aenean vulputate, turpis non tincidunt ornare, metus est sagittis erat, id lobortis orci odio eget quam. Suspendisse ex purus, lobortis quis suscipit a, volutpat vitae turpis.",
                @"Duis facilisis, quam ut laoreet commodo, elit ex aliquet massa, non varius tellus lectus et nunc. Donec vitae risus ut ante pretium semper. Phasellus consectetur volutpat orci, eu dapibus turpis. Fusce varius sapien eu mattis pharetra.",
                @"Nam vulputate eu erat ornare blandit. Proin eget lacinia erat. Praesent nisl lectus, pretium eget leo et, dapibus dapibus velit. Integer at bibendum mi, et fringilla sem."
            };
            return biographies[random.Next(0, biographies.Count)];
        }

static string GenerateFirstName ( ) [inline, static, private]

Definition at line 111 of file Contact.cs.

        {
            List<string> names = new List<string>() { "Lilly", "Mukhtar", "Sophie", "Femke", "Abdul-Rafi'", "Chirag-ud-D...", "Mariana", "Aarif", "Sara", "Ibadah", "Fakhr", "Ilene", "Sardar", "Hanna", "Julie", "Iain", "Natalia", "Henrik", "Rasa", "Quentin", "Gadi", "Pernille", "Ishtar", "Jimme", "Justina", "Lale", "Elize", "Rand", "Roshanara", "Rajab", "Bijou", "Marcus", "Marcus", "Alima", "Francisco", "Thaqib", "Andreas", "Mariana", "Amalie", "Rodney", "Dena", "Fadl", "Ammar", "Anna", "Nasreen", "Reem", "Tomas", "Filipa", "Frank", "Bari'ah", "Parvaiz", "Jibran", "Tomas", "Elli", "Carlos", "Diego", "Henrik", "Aruna", "Vahid", "Eliana", "Roxane", "Amanda", "Ingrid", "Wander", "Malika", "Basim", "Eisa", "Alina", "Andreas", "Deeba", "Diya", "Parveen", "Bakr", "Celine", "Bakr", "Marcus", "Daniel", "Mathea", "Edmee", "Hedda", "Maria", "Maja", "Alhasan", "Alina", "Hedda", "Victor", "Aaftab", "Guilherme", "Maria", "Kai", "Sabien", "Abdel", "Fadl", "Bahaar", "Vasco", "Jibran", "Parsa", "Catalina", "Fouad", "Colette" };
            return names[random.Next(0, names.Count)];
        }

static string GenerateLastName ( ) [inline, static, private]

Definition at line 117 of file Contact.cs.

        {
            List<string> lastnames = new List<string>() { "Carlson", "Attia", "Quint", "Hollenberg", "Khoury", "Araujo", "Hakimi", "Seegers", "Abadi", "al", "Krommenhoek", "Siavashi", "Kvistad", "Sjo", "Vanderslik", "Fernandes", "Dehli", "Sheibani", "Laamers", "Batlouni", "Lyngvær", "Oveisi", "Veenhuizen", "Gardenier", "Siavashi", "Mutlu", "Karzai", "Mousavi", "Natsheh", "Seegers", "Nevland", "Lægreid", "Bishara", "Cunha", "Hotaki", "Kyvik", "Cardoso", "Pilskog", "Pennekamp", "Nuijten", "Bettar", "Borsboom", "Skistad", "Asef", "Sayegh", "Sousa", "Medeiros", "Kregel", "Shamoun", "Behzadi", "Kuzbari", "Ferreira", "Van", "Barros", "Fernandes", "Formo", "Nolet", "Shahrestaani", "Correla", "Amiri", "Sousa", "Fretheim", "Van", "Hamade", "Baba", "Mustafa", "Bishara", "Formo", "Hemmati", "Nader", "Hatami", "Natsheh", "Langen", "Maloof", "Berger", "Ostrem", "Bardsen", "Kramer", "Bekken", "Salcedo", "Holter", "Nader", "Bettar", "Georgsen", "Cunha", "Zardooz", "Araujo", "Batalha", "Antunes", "Vanderhoorn", "Nader", "Abadi", "Siavashi", "Montes", "Sherzai", "Vanderschans", "Neves", "Sarraf", "Kuiters" };
            return lastnames[random.Next(0, lastnames.Count)];
        }

static string GeneratePhoneNumber ( ) [inline, static, private]

Definition at line 107 of file Contact.cs.

        {
            return string.Format("{0:(###)} {1:###}-{2:####}", random.Next(100, 1000), random.Next(100, 1000), random.Next(1000, 10000));
        }

static string GeneratePosition ( ) [inline, static, private]

Definition at line 84 of file Contact.cs.

        {
            List<string> positions = new List<string>() { "Program Manager", "Developer", "Product Manager", "Evangelist" };
            return positions[random.Next(0, positions.Count)];
        }

static ObservableCollection<Contact> GetContacts ( int numberOfContacts ) [inline, static]

Definition at line 42 of file Contact.cs.

        {
            ObservableCollection<Contact> contacts = new ObservableCollection<Contact>();

            for (int i = 0; i < numberOfContacts; i++)
            {
                contacts.Add(GetNewContact());
            }
            return contacts;
        }

static ObservableCollection<GroupInfoList> GetContactsGrouped ( int numberOfContacts ) [inline, static]

Definition at line 52 of file Contact.cs.

        {
            ObservableCollection<GroupInfoList> groups = new ObservableCollection<GroupInfoList>();

            // Group by uppercase first letter of last name.
            var query = from item in GetContacts(numberOfContacts)
                        group item by item.LastName.Substring(0, 1).ToUpper() into g
                        orderby g.Key
                        select g;

            foreach (var g in query)
            {
                var info = new GroupInfoList();
                info.Key = g.Key;
                info.AddRange(g);
                groups.Add(info);
            }

            return groups;
        }

static Contact GetNewContact ( ) [inline, static]

Definition at line 38 of file Contact.cs.

        {
            return new Contact();
        }

static string InitialOf ( string word ) [inline, static, private]

Definition at line 80 of file Contact.cs.

        {
            return string.IsNullOrEmpty(word) ? string.Empty : word.Substring(0, 1);
        }

override string ToString ( ) [inline]

Definition at line 73 of file Contact.cs.

        {
            return Name;
        }

Member Data Documentation

string Initials = Guid.NewGuid().ToString()> InitialOf(FirstName) + InitialOf(LastName)

Definition at line 24 of file Contact.cs.

string Name = " " + LastName

Definition at line 25 of file Contact.cs.

Random random = new Random() [static, private]

Definition at line 20 of file Contact.cs.

Property Documentation

string Biography = GeneratePhoneNumber() [get]

Definition at line 30 of file Contact.cs.

string FirstName = GenerateLastName() [get]

Definition at line 27 of file Contact.cs.

string Id [get]

Definition at line 23 of file Contact.cs.

string LastName [get]

Definition at line 26 of file Contact.cs.

string PhoneNumber = GeneratePosition() [get]

Definition at line 29 of file Contact.cs.

string Position = GenerateFirstName() [get]

Definition at line 28 of file Contact.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/Contact.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Content Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Content
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Content Class Reference

List of all members.

Public Member Functions

Content ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Button_Forget_Click (object sender, RoutedEventArgs e)
void | Button_Restart_Click (object sender, RoutedEventArgs e)
async Task< bool > | DeletePassportServerSide ()
async void | PassportDelete ()

Private Attributes

Account activeAccount
MainPage rootPage

Detailed Description

Definition at line 14 of file Content.xaml.cs.

Constructor & Destructor Documentation

Content ( ) [inline]

Definition at line 19 of file Content.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Button_Forget_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Content.xaml.cs.

        {
            if (activeAccount.UsesPassport == true)
            {
                PassportDelete();
            }

            UserSelect.accountList.Remove(activeAccount);
            AccountsHelper.SaveAccountList(UserSelect.accountList);

            rootPage.NotifyUser("User " + activeAccount.Email + " deleted.", NotifyType.StatusMessage);
            button_Forget.IsEnabled = false;
            button_Forget.Content = "User Forgotten.";
        }

void Button_Restart_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Content.xaml.cs.

        {
            this.Frame.Navigate(typeof(UserSelect));
        }

bool DeletePassportServerSide ( ) [inline, private]

Function used to unregister user's Passport on the server side.

Returns:

Definition at line 76 of file Content.xaml.cs.

        {
            return true;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 24 of file Content.xaml.cs.

        {
            rootPage = MainPage.Current;
            activeAccount = (Account) e.Parameter;
        }

void PassportDelete ( ) [inline, private]

Checks the KeyCredentialManager to see if there is a Passport for the current user and sends the informaton to the server to unregister it.

Then deletes the local key associated with the Passport.

Definition at line 56 of file Content.xaml.cs.

        {
            KeyCredentialRetrievalResult keyOpenResult = await KeyCredentialManager.OpenAsync(activeAccount.Email);

            if (keyOpenResult.Status == KeyCredentialStatus.Success)
            {
                var userKey = keyOpenResult.Credential;
                var publicKey = userKey.RetrievePublicKey();

                // Send key information to server to unregister it
                DeletePassportServerSide();
            }

            await KeyCredentialManager.DeleteAsync(activeAccount.Email);
        }

Member Data Documentation

Account activeAccount [private]

Definition at line 17 of file Content.xaml.cs.

MainPage rootPage [private]

Definition at line 16 of file Content.xaml.cs.

The documentation for this class was generated from the following files:
  • KeyCredentialManager/cs/Content.xaml.cs
  • KeyCredentialManager/cpp/Content.xaml.cpp
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentSelector Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Controls
  • ContentSelector
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

ContentSelector Class Reference

List of all members.

Public Member Functions

ContentSelector ()
async void | HideLoadUri ()
async void | SetAutoPlay (bool IsChecked)
void | SetSelectedModel (AdaptiveContentModel model)

Public Attributes

MediaPlaybackItem MediaPlaybackItem
HttpClient | optionalHttpClient
AdaptiveContentModel SelectedModel

Private Member Functions

void | AutoPlay_Checked (object sender, RoutedEventArgs e)
async Task | CreateNewMediaPlaybackItem (Uri uri)
void | ForceEquirectangularSphericalVideoFrameFormat ()
internal void | Initialize (MediaPlayer mediaPlayer, IEnumerable< AdaptiveContentModel > adaptiveContentModels, HttpClient optionalHttpClient, LogView loggerControl, Func< Uri, HttpClient, Task< MediaPlaybackItem >> loadSourceFromUriAsync)
async void | LoadId_Click (object sender, RoutedEventArgs e)
async void | LoadUri_Click (object sender, RoutedEventArgs e)
void | SetSource_Click (object sender, RoutedEventArgs e)
async void | SetSourceEnabled (bool SetEnabled)

Private Attributes

IEnumerable< AdaptiveContentModel > | adaptiveContentModels
Func< Uri, HttpClient, Task
< MediaPlaybackItem > > 		CreateMediaPlaybackItem
LogView | loggerControl
MediaPlayer | mediaPlayer

Detailed Description

Definition at line 27 of file ContentSelector.xaml.cs.

Constructor & Destructor Documentation

ContentSelector ( ) [inline]

Definition at line 29 of file ContentSelector.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AutoPlay_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 138 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
                return;

            mediaPlayer.AutoPlay = (bool)(sender as CheckBox).IsChecked;
        }

async Task CreateNewMediaPlaybackItem ( Uri uri ) [inline, private]

Definition at line 118 of file ContentSelector.xaml.cs.

        {
            SetSourceEnabled(false);
            this.MediaPlaybackItem = null;
            this.MediaPlaybackItem = await CreateMediaPlaybackItem(uri, optionalHttpClient);
            if (this.MediaPlaybackItem != null)
            {
                loggerControl.Log($"Loaded Uri: {uri}");
                SetSourceEnabled(true);
            }
        }

void ForceEquirectangularSphericalVideoFrameFormat ( ) [inline, private]

Definition at line 146 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.None ||
                mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Opening)
                return;

            var mpsvp = mediaPlayer.PlaybackSession.SphericalVideoProjection;
            if (mpsvp == null)
                return;

            if (mpsvp.FrameFormat != Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular)
                mpsvp.FrameFormat = Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular;

            if (mpsvp.IsEnabled != true)
                mpsvp.IsEnabled = true;

            mpsvp.HorizontalFieldOfViewInDegrees = 120;
        }

async void HideLoadUri ( ) [inline]

Definition at line 78 of file ContentSelector.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                this.LoadUriPanel.Visibility = Visibility.Collapsed;
            });
        }

internal void Initialize | ( | MediaPlayer | mediaPlayer,
 |  | IEnumerable< AdaptiveContentModel > | adaptiveContentModels,
 |  | HttpClient | optionalHttpClient,
 |  | LogView | loggerControl,
 |  | Func< Uri, HttpClient, Task< MediaPlaybackItem >> | loadSourceFromUriAsync |
 | ) |  |  | [inline, private]

Definition at line 42 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer == null)
                throw new ArgumentNullException("mediaPlayer");
            this.mediaPlayer = mediaPlayer;

            if (adaptiveContentModels == null)
                throw new ArgumentNullException("adaptiveContentModels");
            this.adaptiveContentModels = adaptiveContentModels;

            if (loggerControl == null)
                throw new ArgumentNullException("loggerControl");
            this.loggerControl = loggerControl;

            if (loadSourceFromUriAsync == null)
                throw new ArgumentNullException("loadSourceFromUriAsync");
            this.CreateMediaPlaybackItem = loadSourceFromUriAsync;

            this.optionalHttpClient = optionalHttpClient;

            // Set data context:
            SelectedContent.ItemsSource = this.adaptiveContentModels;
            // Set default item:
            SetSelectedModel(this.adaptiveContentModels.First());
        }

async void LoadId_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
                return;

            this.SelectedModel = (AdaptiveContentModel)SelectedContent.SelectedItem;

            UriBox.Text = SelectedModel.ManifestUri.ToString();
            await CreateNewMediaPlaybackItem(SelectedModel.ManifestUri);
        }

async void LoadUri_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
                return;

            Uri uri;
            if (!Uri.TryCreate(UriBox.Text, UriKind.Absolute, out uri))
            {
                loggerControl.Log("Malformed Uri in Load text box.", SDKTemplate.Logging.LogViewLoggingLevel.Critical);
                return;
            }
            await CreateNewMediaPlaybackItem(uri);
        }

async void SetAutoPlay ( bool IsChecked ) [inline]

Definition at line 85 of file ContentSelector.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AutoPlay.IsChecked = IsChecked;
            });
        }

void SetSelectedModel ( AdaptiveContentModel model ) [inline]

Definition at line 72 of file ContentSelector.xaml.cs.

        {
            SelectedModel = model;
            SelectedContent.SelectedItem = SelectedModel;
        }

void SetSource_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 165 of file ContentSelector.xaml.cs.

        {
            if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
                return;

            // It is at this point that the MediaSource (within a MediaPlaybackItem) will be fully resolved.
            // For an AdaptiveMediaSource, this is the point at which media is first requested and parsed.
            mediaPlayer.Source = this.MediaPlaybackItem;
        }

async void SetSourceEnabled ( bool SetEnabled ) [inline, private]

Definition at line 130 of file ContentSelector.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                SetSource.IsEnabled = SetEnabled;
            });
        }

Member Data Documentation

IEnumerable<AdaptiveContentModel> adaptiveContentModels [private]

Definition at line 35 of file ContentSelector.xaml.cs.

Func<Uri, HttpClient, Task<MediaPlaybackItem> > CreateMediaPlaybackItem [private]

Definition at line 38 of file ContentSelector.xaml.cs.

LogView loggerControl [private]

Definition at line 37 of file ContentSelector.xaml.cs.

MediaPlaybackItem MediaPlaybackItem

Definition at line 39 of file ContentSelector.xaml.cs.

MediaPlayer mediaPlayer [private]

Definition at line 34 of file ContentSelector.xaml.cs.

HttpClient optionalHttpClient

Definition at line 40 of file ContentSelector.xaml.cs.

AdaptiveContentModel SelectedModel

Definition at line 36 of file ContentSelector.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Controls/ContentSelector.xaml.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReadyInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Controls
  • PlayReadyInfo
Public Member Functions

PlayReadyInfo Class Reference

List of all members.

Public Member Functions

PlayReadyInfo ()

Detailed Description

Definition at line 5 of file PlayReadyInfo.xaml.cs.

Constructor & Destructor Documentation

PlayReadyInfo ( ) [inline]

Definition at line 7 of file PlayReadyInfo.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • PlayReady/cs/Controls/PlayReadyInfo.xaml.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Conversation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Conversation
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

Conversation Class Reference

List of all members.

Public Member Functions

Conversation ()
IAsyncOperation
< LoadMoreItemsResult > 		LoadMoreItemsAsync (uint count)

Static Public Member Functions

static string | CreateRandomMessage ()

Properties

bool | HasMoreItems [get]

Private Member Functions

void | CreateMessages (uint count)

Private Attributes

uint | messageCount = 0

Static Private Attributes

static string | fillerText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
static Random | rand = new Random()

Detailed Description

Definition at line 34 of file Scenario2_Load.xaml.cs.

Constructor & Destructor Documentation

Conversation ( ) [inline]

Definition at line 38 of file Scenario2_Load.xaml.cs.

        {
        }

Member Function Documentation

void CreateMessages ( uint count ) [inline, private]

Definition at line 55 of file Scenario2_Load.xaml.cs.

        {
            for (uint i = 0; i < count; i++)
            {
                this.Insert(0, new TextMessage()
                {
                    Body = $"{messageCount}: {CreateRandomMessage()}",
                    IsSent = 0 == messageCount++ % 2,
                    DisplayTime = DateTime.Now.ToString()
                });
            }
        }

static string CreateRandomMessage ( ) [inline, static]

Definition at line 71 of file Scenario2_Load.xaml.cs.

        {
            return fillerText.Substring(0, rand.Next(5, fillerText.Length));
        }

IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync ( uint count ) [inline]

Definition at line 44 of file Scenario2_Load.xaml.cs.

        {
            this.CreateMessages(count);

            return Task.FromResult<LoadMoreItemsResult>(
                new LoadMoreItemsResult()
                {
                    Count = count
                }).AsAsyncOperation();
        }

Member Data Documentation

string fillerText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." [static, private]

Definition at line 69 of file Scenario2_Load.xaml.cs.

uint messageCount = 0 [private]

Definition at line 36 of file Scenario2_Load.xaml.cs.

Random rand = new Random() [static, private]

Definition at line 68 of file Scenario2_Load.xaml.cs.

Property Documentation

bool HasMoreItems [get]

Definition at line 42 of file Scenario2_Load.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBottomUpList/cs/Scenario2_Load.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyFiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CopyFiles
Public Member Functions | Private Member Functions | Private Attributes

CopyFiles Class Reference

List of all members.

Public Member Functions

CopyFiles ()

Private Member Functions

async void | CopyButton_Click (object sender, RoutedEventArgs e)
async void | PasteButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file CopyFiles.xaml.cs.

Constructor & Destructor Documentation

CopyFiles ( ) [inline]

Definition at line 26 of file CopyFiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CopyButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file CopyFiles.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            var filePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.List,
                FileTypeFilter = { "*" }
            };

            var storageItems = await filePicker.PickMultipleFilesAsync();
            if (storageItems.Count > 0)
            {
                var dataPackage = new DataPackage();
                dataPackage.SetStorageItems(storageItems);

                // Request a copy operation from targets that support different file operations, like File Explorer
                dataPackage.RequestedOperation = DataPackageOperation.Copy;
                if (Clipboard.SetContentWithOptions(dataPackage, null))
                {
                    rootPage.NotifyUser($"Storage Items: {storageItems.Count} file(s) are copied into clipboard.", NotifyType.StatusMessage);
                }
                else
                {
                    // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
                    rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
                }
            }
        }

async void PasteButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file CopyFiles.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Get data package from clipboard
            var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
            if (dataPackageView.Contains(StandardDataFormats.StorageItems))
            {
                IReadOnlyList<IStorageItem> storageItems = null;
                try
                {
                    storageItems = await dataPackageView.GetStorageItemsAsync();
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error retrieving file(s) from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
                }

                if (storageItems != null)
                {
                    OutputText.Text = "Pasting following" + storageItems.Count + " file(s) to the folder " + ApplicationData.Current.LocalFolder.Path + Environment.NewLine;
                    var operation = dataPackageView.RequestedOperation;
                    OutputText.Text += "Requested Operation: ";
                    switch (operation)
                    {
                        case DataPackageOperation.Copy:
                            OutputText.Text += "Copy";
                            break;
                        case DataPackageOperation.Link:
                            OutputText.Text += "Link";
                            break;
                        case DataPackageOperation.Move:
                            OutputText.Text += "Move";
                            break;
                        case DataPackageOperation.None:
                            OutputText.Text += "None";
                            break;
                        default:
                            OutputText.Text += "Unknown";
                            break;
                    }
                    OutputText.Text += Environment.NewLine;

                    // Iterate through each item in the collection
                    foreach (var storageItem in storageItems)
                    {
                        var file = storageItem as StorageFile;
                        if (file != null)
                        {
                            // Copy the file
                            var newFile = await file.CopyAsync(ApplicationData.Current.LocalFolder, file.Name, NameCollisionOption.ReplaceExisting);
                            if (newFile != null)
                            {
                                OutputText.Text += file.Name + Environment.NewLine;
                            }
                        }
                        else
                        {
                            var folder = storageItem as StorageFolder;
                            if (folder != null)
                            {
                                // Skipping folders for brevity sake
                                OutputText.Text += folder.Path + " is a folder, skipping" + Environment.NewLine;
                            }
                        }
                    }
                }
            }
            else
            {
                OutputText.Text = "StorageItems format is not available in clipboard";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file CopyFiles.xaml.cs.

The documentation for this class was generated from the following file:
  • Clipboard/cs/CopyFiles.xaml.cs
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CopyImage
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

CopyImage Class Reference

List of all members.

Public Member Functions

CopyImage ()

Private Member Functions

async void | CopyBitmap (bool isDelayRendered)
void | CopyButton_Click (object sender, RoutedEventArgs e)
void | CopyWithDelayedRenderingButton_Click (object sender, RoutedEventArgs e)
async void | PasteButton_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

async static void | OnDeferredImageRequestedHandler (DataProviderRequest request, StorageFile imageFile)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file CopyImage.xaml.cs.

Constructor & Destructor Documentation

CopyImage ( ) [inline]

Definition at line 30 of file CopyImage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CopyBitmap ( bool isDelayRendered ) [inline, private]

Definition at line 114 of file CopyImage.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            var imagePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                FileTypeFilter = { ".jpg", ".png", ".bmp", ".gif", ".tif" }
            };

            var imageFile = await imagePicker.PickSingleFileAsync();
            if (imageFile != null)
            {
                var dataPackage = new DataPackage();

                string message;
                if (isDelayRendered)
                {
                    dataPackage.SetDataProvider(StandardDataFormats.Bitmap, request => OnDeferredImageRequestedHandler(request, imageFile));
                    message = "Image has been copied using delayed rendering";
                }
                else
                {
                    dataPackage.SetBitmap(RandomAccessStreamReference.CreateFromFile(imageFile));
                    message = "Image has been copied";
                }

                if (Clipboard.SetContentWithOptions(dataPackage, null))
                {
                    rootPage.NotifyUser(message, NotifyType.StatusMessage);
                }
                else
                {
                    // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
                    rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
                }
            }
        }

void CopyButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file CopyImage.xaml.cs.

        {
            this.CopyBitmap(false);
        }

void CopyWithDelayedRenderingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file CopyImage.xaml.cs.

        {
            this.CopyBitmap(true);
        }

async static void OnDeferredImageRequestedHandler | ( | DataProviderRequest | request,
 |  | StorageFile | imageFile |
 | ) |  |  | [inline, static, private]

Definition at line 82 of file CopyImage.xaml.cs.

        {
            // Since this method is using "await" prior to setting the data in DataPackage,
            // deferral object must be used
            var deferral = request.GetDeferral();

            // Use try/finally to ensure that we always complete the deferral.
            try
            {
                using (var imageStream = await imageFile.OpenAsync(FileAccessMode.Read))
                {
                    // Decode the image
                    var imageDecoder = await BitmapDecoder.CreateAsync(imageStream);

                    // Re-encode the image at 50% width and height
                    var inMemoryStream = new InMemoryRandomAccessStream();
                    var imageEncoder = await BitmapEncoder.CreateForTranscodingAsync(inMemoryStream, imageDecoder);
                    imageEncoder.BitmapTransform.ScaledWidth = (uint)(imageDecoder.OrientedPixelWidth * 0.5);
                    imageEncoder.BitmapTransform.ScaledHeight = (uint)(imageDecoder.OrientedPixelHeight * 0.5);
                    await imageEncoder.FlushAsync();

                    request.SetData(RandomAccessStreamReference.CreateFromStream(inMemoryStream));
                }
            }
            finally
            {
                deferral.Complete();
            }

            MainPage.DisplayToast("Image has been set via deferral.");
        }

async void PasteButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file CopyImage.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Get the bitmap and display it.
            var dataPackageView = Clipboard.GetContent();
            if (dataPackageView.Contains(StandardDataFormats.Bitmap))
            {
                IRandomAccessStreamReference imageReceived = null;
                try
                {
                    imageReceived = await dataPackageView.GetBitmapAsync();
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error retrieving image from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
                }

                if (imageReceived != null)
                {
                    using (var imageStream = await imageReceived.OpenReadAsync())
                    {
                        var bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(imageStream);
                        OutputImage.Source = bitmapImage;
                        OutputImage.Visibility = Visibility.Visible;
                        OutputText.Text = "Image is retrieved from the clipboard and pasted successfully.";
                    }
                }
            }
            else
            {
                OutputText.Text = "Bitmap format is not available in clipboard";
                OutputImage.Visibility = Visibility.Collapsed;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file CopyImage.xaml.cs.

The documentation for this class was generated from the following file:
  • Clipboard/cs/CopyImage.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CopyText
Public Member Functions | Private Member Functions | Private Attributes

CopyText Class Reference

List of all members.

Public Member Functions

CopyText ()

Private Member Functions

void | CopyButton_Click (object sender, RoutedEventArgs e)
async void | DisplayResourceMapAsync (DataPackageView dataPackageView)
async void | PasteButton_Click (object sender, RoutedEventArgs e)

Private Attributes

string | htmlFragment = "See the Share SDK sample for more information."
const string | imgSrc = "ms-appx-web:///assets/windows-sdk.png"
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file CopyText.xaml.cs.

Constructor & Destructor Documentation

CopyText ( ) [inline]

Definition at line 26 of file CopyText.xaml.cs.

        {
            this.InitializeComponent();
            Description.NavigateToString(this.htmlFragment);
        }

Member Function Documentation

void CopyButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file CopyText.xaml.cs.

        {
            OutputText.Text = "";
            OutputResourceMapKeys.Text = "";
            OutputHtml.NavigateToString("<HTML></HTML>");

            // Set the content to DataPackage as html format
            string htmlFormat = HtmlFormatHelper.CreateHtmlFormat(this.htmlFragment);
            var dataPackage = new DataPackage();
            dataPackage.SetHtmlFormat(htmlFormat);

            // Set the content to DataPackage as (plain) text format
            string plainText = HtmlUtilities.ConvertToText(this.htmlFragment);
            dataPackage.SetText(plainText);

            // Populate resourceMap with StreamReference objects corresponding to local image files embedded in HTML
            var imgUri = new Uri(imgSrc);
            var imgRef = RandomAccessStreamReference.CreateFromUri(imgUri);
            dataPackage.ResourceMap[imgSrc] = imgRef;

            // Set the DataPackage to clipboard.
            if (Clipboard.SetContentWithOptions(dataPackage, null))
            {
                rootPage.NotifyUser("Text and HTML formats have been copied to clipboard.", NotifyType.StatusMessage);
            }
            else
            {
                // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
                rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
            }
        }

async void DisplayResourceMapAsync ( DataPackageView dataPackageView ) [inline, private]

Definition at line 131 of file CopyText.xaml.cs.

        {
            OutputResourceMapKeys.Text = Environment.NewLine + "Resource map: ";
            IReadOnlyDictionary<string, RandomAccessStreamReference> resMap = null;
            try
            {
                resMap = await dataPackageView.GetResourceMapAsync();
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error retrieving Resource map from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
            }

            if (resMap != null)
            {
                if (resMap.Count > 0)
                {
                    foreach (var item in resMap)
                    {
                        OutputResourceMapKeys.Text += Environment.NewLine + "Key: " + item.Key;
                    }
                }
                else
                {
                    OutputResourceMapKeys.Text += Environment.NewLine + "Resource map is empty";
                }
            }
        }

async void PasteButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file CopyText.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            OutputText.Text = "";
            OutputResourceMapKeys.Text = "";
            OutputHtml.NavigateToString("<HTML></HTML>");

            var dataPackageView = Clipboard.GetContent();
            if (dataPackageView.Contains(StandardDataFormats.Text))
            {
                try
                {
                    var text = await dataPackageView.GetTextAsync();
                    OutputText.Text = "Text: " + Environment.NewLine + text;
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error retrieving Text format from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
                }
            }
            else
            {
                OutputText.Text = "Text: " + Environment.NewLine + "Text format is not available in clipboard";
            }

            if (dataPackageView.Contains(StandardDataFormats.Html))
            {
                this.DisplayResourceMapAsync(dataPackageView);

                string htmlFormat = null;
                try
                {
                    htmlFormat = await dataPackageView.GetHtmlFormatAsync();
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Error retrieving HTML format from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
                }

                if (htmlFormat != null)
                {
                    string htmlFragment = HtmlFormatHelper.GetStaticFragment(htmlFormat);
                    OutputHtml.NavigateToString("HTML:<br/ > " + htmlFragment);
                }
            }
            else
            {
                OutputHtml.NavigateToString("HTML:<br/ > HTML format is not available in clipboard");
            }
        }

Member Data Documentation

string htmlFragment = "See the Share SDK sample for more information." [private]

Definition at line 115 of file CopyText.xaml.cs.

const string imgSrc = "ms-appx-web:///assets/windows-sdk.png" [private]

Definition at line 125 of file CopyText.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file CopyText.xaml.cs.

The documentation for this class was generated from the following file:
  • Clipboard/cs/CopyText.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomCommand
Public Member Functions | Private Member Functions | Private Attributes

CustomCommand Class Reference

List of all members.

Public Member Functions

CustomCommand ()

Private Member Functions

async void CustomCommandButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file CustomCommand.xaml.cs.

Constructor & Destructor Documentation

CustomCommand ( ) [inline]

Definition at line 24 of file CustomCommand.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CustomCommandButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'CustomCommandButton' button.

Demonstrates the use of a message dialog with custom commands, command callbacks, and a default command. A message will be displayed indicating which command was invoked on the dialog. In this scenario, 'Install updates' is selected as the default choice.

Parameters:
sender | The Object that caused this event to be fired.
e | State information and event data associated with the routed event.

Definition at line 37 of file CustomCommand.xaml.cs.

        {
            // Create the message dialog and set its content and title
            var messageDialog = new MessageDialog("New updates have been found for this program. Would you like to install the new updates?", "Updates available");

            // Add commands and set their callbacks
            messageDialog.Commands.Add(new UICommand("Don't install", (command) =>
            {
                rootPage.NotifyUser("The 'Don't install' command has been selected.", NotifyType.StatusMessage);
            }));

            messageDialog.Commands.Add(new UICommand("Install updates", (command) =>
            {
                rootPage.NotifyUser("The 'Install updates' command has been selected.", NotifyType.StatusMessage);
            }));

            // Set the command that will be invoked by default
            messageDialog.DefaultCommandIndex = 1;

            // Show the message dialog
            await messageDialog.ShowAsync();
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file CustomCommand.xaml.cs.

The documentation for this class was generated from the following files:
  • MessageDialog/cs/CustomCommand.xaml.cs
  • MessageDialog/cpp/CustomCommand.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomEditControl
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

CustomEditControl Class Reference

List of all members.

Public Member Functions

CustomEditControl ()

Private Member Functions

void | AdjustSelectionEndpoint (int direction)
void | CoreWindow_KeyDown (CoreWindow sender, KeyEventArgs args)
void | CoreWindow_PointerPressed (CoreWindow sender, PointerEventArgs args)
void | EditContext_CompositionCompleted (CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs args)
void | EditContext_CompositionStarted (CoreTextEditContext sender, CoreTextCompositionStartedEventArgs args)
void | EditContext_FocusRemoved (CoreTextEditContext sender, object args)
void | EditContext_FormatUpdating (CoreTextEditContext sender, CoreTextFormatUpdatingEventArgs args)
void | EditContext_LayoutRequested (CoreTextEditContext sender, CoreTextLayoutRequestedEventArgs args)
void | EditContext_SelectionRequested (CoreTextEditContext sender, CoreTextSelectionRequestedEventArgs args)
void | EditContext_SelectionUpdating (CoreTextEditContext sender, CoreTextSelectionUpdatingEventArgs args)
void | EditContext_TextRequested (CoreTextEditContext sender, CoreTextTextRequestedEventArgs args)
void | EditContext_TextUpdating (CoreTextEditContext sender, CoreTextTextUpdatingEventArgs args)
void | Element_Unloaded (object sender, RoutedEventArgs e)
bool | HasSelection ()
void | RemoveInternalFocus ()
void | RemoveInternalFocusWorker ()
void | ReplaceText (CoreTextRange modifiedRange, string text)
void | SetInternalFocus ()
void | SetSelection (CoreTextRange selection)
void | SetSelectionAndNotify (CoreTextRange selection)
void | UpdateFocusUI ()
void | UpdateTextUI ()

Static Private Member Functions

static Rect | GetElementRect (FrameworkElement element)
static string | PreserveTrailingSpaces (string s)
static Rect | ScaleRect (Rect rect, double scale)

Private Attributes

CoreWindow | _coreWindow
CoreTextEditContext | _editContext
bool | _extendingLeft = false
InputPane | _inputPane
bool | _internalFocus = false
CoreTextRange | _selection
string | _text = String.Empty

Detailed Description

Definition at line 20 of file CustomEditControl.xaml.cs.

Constructor & Destructor Documentation

CustomEditControl ( ) [inline]

Definition at line 48 of file CustomEditControl.xaml.cs.

        {
            this.InitializeComponent();

            // The CoreTextEditContext processes text input, but other keys are
            // the apps's responsibility.
            _coreWindow = CoreWindow.GetForCurrentThread();
            _coreWindow.KeyDown += CoreWindow_KeyDown;
            _coreWindow.PointerPressed += CoreWindow_PointerPressed;

            // Create a CoreTextEditContext for our custom edit control.
            CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
            _editContext = manager.CreateEditContext();

            // Get the Input Pane so we can programmatically hide and show it.
            _inputPane = InputPane.GetForCurrentView();

            // For demonstration purposes, this sample sets the Input Pane display policy to Manual
            // so that it can manually show the software keyboard when the control gains focus and
            // dismiss it when the control loses focus. If you leave the policy as Automatic, then
            // the system will hide and show the Input Pane for you. Note that on Desktop, you will
            // need to implement the UIA text pattern to get expected automatic behavior.
            _editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;

            // Set the input scope to Text because this text box is for any text.
            // This also informs software keyboards to show their regular
            // text entry layout.  There are many other input scopes and each will
            // inform a keyboard layout and text behavior.
            _editContext.InputScope = CoreTextInputScope.Text;

            // The system raises this event to request a specific range of text.
            _editContext.TextRequested += EditContext_TextRequested;

            // The system raises this event to request the current selection.
            _editContext.SelectionRequested += EditContext_SelectionRequested;

            // The system raises this event when it wants the edit control to remove focus.
            _editContext.FocusRemoved += EditContext_FocusRemoved;

            // The system raises this event to update text in the edit control.
            _editContext.TextUpdating += EditContext_TextUpdating;

            // The system raises this event to change the selection in the edit control.
            _editContext.SelectionUpdating += EditContext_SelectionUpdating;

            // The system raises this event when it wants the edit control
            // to apply formatting on a range of text.
            _editContext.FormatUpdating += EditContext_FormatUpdating;

            // The system raises this event to request layout information.
            // This is used to help choose a position for the IME candidate window.
            _editContext.LayoutRequested += EditContext_LayoutRequested;

            // The system raises this event to notify the edit control
            // that the string composition has started.
            _editContext.CompositionStarted += EditContext_CompositionStarted;

            // The system raises this event to notify the edit control
            // that the string composition is finished.
            _editContext.CompositionCompleted += EditContext_CompositionCompleted;

            // The system raises this event when the NotifyFocusLeave operation has
            // completed. Our sample does not use this event.
            // _editContext.NotifyFocusLeaveCompleted += EditContext_NotifyFocusLeaveCompleted;

            // Set our initial UI.
            UpdateTextUI();
            UpdateFocusUI();
        }

Member Function Documentation

void AdjustSelectionEndpoint ( int direction ) [inline, private]

Definition at line 501 of file CustomEditControl.xaml.cs.

        {
            CoreTextRange range = _selection;
            if (_extendingLeft)
            {
                range.StartCaretPosition = Math.Max(0, range.StartCaretPosition + direction);
            }
            else
            {
                range.EndCaretPosition = Math.Min(_text.Length, range.EndCaretPosition + direction);
            }

            SetSelectionAndNotify(range);
        }

void CoreWindow_KeyDown | ( | CoreWindow | sender,
 |  | KeyEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 391 of file CustomEditControl.xaml.cs.

        {
            // Do not process keyboard input if the custom edit control does not
            // have focus.
            if (!_internalFocus)
            {
                return;
            }

            // This holds the range we intend to operate on, or which we intend
            // to become the new selection. Start with the current selection.
            CoreTextRange range = _selection;

            // For the purpose of this sample, we will support only the left and right
            // arrow keys and the backspace key. A more complete text edit control
            // would also handle keys like Home, End, and Delete, as well as
            // hotkeys like Ctrl+V to paste.
            //
            // Note that this sample does not properly handle surrogate pairs
            // nor does it handle grapheme clusters.

            switch (args.VirtualKey)
            {
                // Backspace
                case VirtualKey.Back:
                    // If there is a selection, then delete the selection.
                    if (HasSelection())
                    {
                        // Set the text in the selection to nothing.
                        ReplaceText(range, "");
                    }
                    else
                    {
                        // Delete the character to the left of the caret, if one exists,
                        // by creating a range that encloses the character to the left
                        // of the caret, and setting the contents of that range to nothing.
                        range.StartCaretPosition = Math.Max(0, range.StartCaretPosition - 1);
                        ReplaceText(range, "");
                    }
                    break;

                // Left arrow
                case VirtualKey.Left:
                    // If the shift key is down, then adjust the size of the selection.
                    if (_coreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down))
                    {
                        // If this is the start of a selection, then remember which edge we are adjusting.
                        if (!HasSelection())
                        {
                            _extendingLeft = true;
                        }

                        // Adjust the selection and notify CoreTextEditContext.
                        AdjustSelectionEndpoint(-1);
                    }
                    else
                    {
                        // The shift key is not down. If there was a selection, then snap the
                        // caret at the left edge of the selection.
                        if (HasSelection())
                        {
                            range.EndCaretPosition = range.StartCaretPosition;
                            SetSelectionAndNotify(range);
                        }
                        else
                        {
                            // There was no selection. Move the caret left one code unit if possible.
                            range.StartCaretPosition = Math.Max(0, range.StartCaretPosition - 1);
                            range.EndCaretPosition = range.StartCaretPosition;
                            SetSelectionAndNotify(range);
                        }
                    }
                    break;

                // Right arrow
                case VirtualKey.Right:
                    // If the shift key is down, then adjust the size of the selection.
                    if (_coreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down))
                    {
                        // If this is the start of a selection, then remember which edge we are adjusting.
                        if (!HasSelection())
                        {
                            _extendingLeft = false;
                        }

                        // Adjust the selection and notify CoreTextEditContext.
                        AdjustSelectionEndpoint(+1);
                    }
                    else
                    {
                        // The shift key is not down. If there was a selection, then snap the
                        // caret at the right edge of the selection.
                        if (HasSelection())
                        {
                            range.StartCaretPosition = range.EndCaretPosition;
                            SetSelectionAndNotify(range);
                        }
                        else
                        {
                            // There was no selection. Move the caret right one code unit if possible.
                            range.StartCaretPosition = Math.Min(_text.Length, range.StartCaretPosition + 1);
                            range.EndCaretPosition = range.StartCaretPosition;
                            SetSelectionAndNotify(range);
                        }
                    }
                    break;
            }
        }

void CoreWindow_PointerPressed | ( | CoreWindow | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 119 of file CustomEditControl.xaml.cs.

        {
            // See whether the pointer is inside or outside the control.
            Rect contentRect = GetElementRect(BorderPanel);
            if (contentRect.Contains(args.CurrentPoint.Position))
            {
                // The user tapped inside the control. Give it focus.
                SetInternalFocus();

                // Tell XAML that this element has focus, so we don't have two
                // focus elements. That is the extent of our integration with XAML focus.
                Focus(FocusState.Programmatic);

                // A more complete custom control would move the caret to the
                // pointer position. It would also provide some way to select
                // text via touch. We do neither in this sample.

            }
            else
            {
                // The user tapped outside the control. Remove focus.
                RemoveInternalFocus();
            }
        }

void EditContext_CompositionCompleted | ( | CoreTextEditContext | sender,
 |  | CoreTextCompositionCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 387 of file CustomEditControl.xaml.cs.

        {
        }

void EditContext_CompositionStarted | ( | CoreTextEditContext | sender,
 |  | CoreTextCompositionStartedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 383 of file CustomEditControl.xaml.cs.

        {
        }

void EditContext_FocusRemoved | ( | CoreTextEditContext | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 190 of file CustomEditControl.xaml.cs.

        {
            RemoveInternalFocusWorker();
        }

void EditContext_FormatUpdating | ( | CoreTextEditContext | sender,
 |  | CoreTextFormatUpdatingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 296 of file CustomEditControl.xaml.cs.

        {
            // The following code specifies how you would apply any formatting to the specified range of text
            // For this sample, we do not make any changes to the format.

            // Apply text color if specified.
            // A null value indicates that the default should be used.
            if (args.TextColor != null)
            {
                //InternalSetTextColor(args.Range, args.TextColor.Value);
            }
            else
            {
                //InternalSetDefaultTextColor(args.Range);
            }

            // Apply background color if specified.
            // A null value indicates that the default should be used.
            if (args.BackgroundColor != null)
            {
                //InternalSetBackgroundColor(args.Range, args.BackgroundColor.Value);
            }
            else
            {
                //InternalSetDefaultBackgroundColor(args.Range);
            }

            // Apply underline if specified.
            // A null value indicates that the default should be used.
            if (args.UnderlineType != null)
            {
                //TextDecoration underline = new TextDecoration(args.Range,args.UnderlineType.Value,args.UnderlineColor.Value);

                //InternalAddTextDecoration(underline);
            }
            else
            {
                //InternalRemoveTextDecoration(args.Range);
            }
        }

void EditContext_LayoutRequested | ( | CoreTextEditContext | sender,
 |  | CoreTextLayoutRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 346 of file CustomEditControl.xaml.cs.

        {
            CoreTextLayoutRequest request = args.Request;

            // Get the screen coordinates of the entire control and the selected text.
            // This information is used to position the IME candidate window.

            // First, get the coordinates of the edit control and the selection
            // relative to the Window.
            Rect contentRect = GetElementRect(ContentPanel);
            Rect selectionRect = GetElementRect(SelectionText);

            // Next, convert to screen coordinates in view pixels.
            Rect windowBounds = Window.Current.CoreWindow.Bounds;
            contentRect.X += windowBounds.X;
            contentRect.Y += windowBounds.Y;
            selectionRect.X += windowBounds.X;
            selectionRect.Y += windowBounds.Y;

            // Finally, scale up to raw pixels.
            double scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;

            contentRect = ScaleRect(contentRect, scaleFactor);
            selectionRect = ScaleRect(selectionRect, scaleFactor);

            // This is the bounds of the selection.
            // Note: If you return bounds with 0 width and 0 height, candidates will not appear while typing.
            request.LayoutBounds.TextBounds = selectionRect;

            //This is the bounds of the whole control
            request.LayoutBounds.ControlBounds = contentRect;
        }

void EditContext_SelectionRequested | ( | CoreTextEditContext | sender,
 |  | CoreTextSelectionRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 256 of file CustomEditControl.xaml.cs.

        {
            CoreTextSelectionRequest request = args.Request;
            request.Selection = _selection;
        }

void EditContext_SelectionUpdating | ( | CoreTextEditContext | sender,
 |  | CoreTextSelectionUpdatingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 284 of file CustomEditControl.xaml.cs.

        {
            // Set the new selection to the value specified by the system.
            CoreTextRange range = args.Selection;

            // Update the selection of the edit context. There is no need to notify the system
            // because the system itself changed the selection.
            SetSelection(range);
        }

void EditContext_TextRequested | ( | CoreTextEditContext | sender,
 |  | CoreTextTextRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 247 of file CustomEditControl.xaml.cs.

        {
            CoreTextTextRequest request = args.Request;
            request.Text = _text.Substring(
                request.Range.StartCaretPosition,
                Math.Min(request.Range.EndCaretPosition, _text.Length) - request.Range.StartCaretPosition);
        }

void EditContext_TextUpdating | ( | CoreTextEditContext | sender,
 |  | CoreTextTextUpdatingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 262 of file CustomEditControl.xaml.cs.

        {
            CoreTextRange range = args.Range;
            string newText = args.Text;
            CoreTextRange newSelection = args.NewSelection;

            // Modify the internal text store.
            _text = _text.Substring(0, range.StartCaretPosition) +
                newText +
                _text.Substring(Math.Min(_text.Length, range.EndCaretPosition));

            // You can set the proper font or direction for the updated text based on the language by checking
            // args.InputLanguage.  We will not do that in this sample.

            // Modify the current selection.
            newSelection.EndCaretPosition = newSelection.StartCaretPosition;

            // Update the selection of the edit context. There is no need to notify the system
            // because the system itself changed the selection.
            SetSelection(newSelection);
        }

void Element_Unloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 195 of file CustomEditControl.xaml.cs.

        {
            _coreWindow.KeyDown -= CoreWindow_KeyDown;
            _coreWindow.PointerPressed -= CoreWindow_PointerPressed;
        }

static Rect GetElementRect ( FrameworkElement element ) [inline, static, private]

Definition at line 561 of file CustomEditControl.xaml.cs.

        {
            GeneralTransform transform = element.TransformToVisual(null);
            Point point = transform.TransformPoint(new Point());
            return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
        }

bool HasSelection ( ) [inline, private]

Definition at line 223 of file CustomEditControl.xaml.cs.

        {
            return _selection.StartCaretPosition != _selection.EndCaretPosition;
        }

static string PreserveTrailingSpaces ( string s ) [inline, static, private]

Definition at line 520 of file CustomEditControl.xaml.cs.

        {
            return s + "\ufeff";
        }

void RemoveInternalFocus ( ) [inline, private]

Definition at line 166 of file CustomEditControl.xaml.cs.

        {
            if (_internalFocus)
            {
                //Notify the system that this edit context is no longer in focus
                _editContext.NotifyFocusLeave();

                RemoveInternalFocusWorker();
            }
        }

void RemoveInternalFocusWorker ( ) [inline, private]

Definition at line 177 of file CustomEditControl.xaml.cs.

        {
            //Update the internal notion of focus
            _internalFocus = false;

            // Ask the software keyboard to dismiss.
            _inputPane.TryHide();

            // Update our UI.
            UpdateTextUI();
            UpdateFocusUI();
        }

void ReplaceText | ( | CoreTextRange | modifiedRange,
 |  | string | text |
 | ) |  |  | [inline, private]

Definition at line 204 of file CustomEditControl.xaml.cs.

        {
            // Modify the internal text store.
            _text = _text.Substring(0, modifiedRange.StartCaretPosition) +
              text +
              _text.Substring(modifiedRange.EndCaretPosition);

            // Move the caret to the end of the replacement text.
            _selection.StartCaretPosition = modifiedRange.StartCaretPosition + text.Length;
            _selection.EndCaretPosition = _selection.StartCaretPosition;

            // Update the selection of the edit context.  There is no need to notify the system
            // of the selection change because we are going to call NotifyTextChanged soon.
            SetSelection(_selection);

            // Let the CoreTextEditContext know what changed.
            _editContext.NotifyTextChanged(modifiedRange, text.Length, _selection);
        }

static Rect ScaleRect | ( | Rect | rect,
 |  | double | scale |
 | ) |  |  | [inline, static, private]

Definition at line 337 of file CustomEditControl.xaml.cs.

        {
            rect.X *= scale;
            rect.Y *= scale;
            rect.Width *= scale;
            rect.Height *= scale;
            return rect;
        }

void SetInternalFocus ( ) [inline, private]

Definition at line 144 of file CustomEditControl.xaml.cs.

        {
            if (!_internalFocus)
            {
                // Update internal notion of focus.
                _internalFocus = true;

                // Update the UI.
                UpdateTextUI();
                UpdateFocusUI();

                // Notify the CoreTextEditContext that the edit context has focus,
                // so it should start processing text input.
                _editContext.NotifyFocusEnter();
            }

            // Ask the software keyboard to show.  The system will ultimately decide if it will show.
            // For example, it will not show if there is a keyboard attached.
            _inputPane.TryShow();

        }

void SetSelection ( CoreTextRange selection ) [inline, private]

Definition at line 229 of file CustomEditControl.xaml.cs.

        {
            // Modify the internal selection.
            _selection = selection;

            //Update the UI to show the new selection.
            UpdateTextUI();
        }

void SetSelectionAndNotify ( CoreTextRange selection ) [inline, private]

Definition at line 239 of file CustomEditControl.xaml.cs.

        {
            SetSelection(selection);
            _editContext.NotifySelectionChanged(_selection);
        }

void UpdateFocusUI ( ) [inline, private]

Definition at line 525 of file CustomEditControl.xaml.cs.

        {
            BorderPanel.BorderBrush = _internalFocus ? new SolidColorBrush(Windows.UI.Colors.Green) : null;
        }

void UpdateTextUI ( ) [inline, private]

Definition at line 530 of file CustomEditControl.xaml.cs.

        {
            // The raw materials we have are a string (_text) and information about
            // where the caret/selection is (_selection). We can render the control
            // any way we like.

            BeforeSelectionText.Text = PreserveTrailingSpaces(_text.Substring(0, _selection.StartCaretPosition));
            if (HasSelection())
            {
                // There is a selection. Draw that.
                CaretText.Visibility = Visibility.Collapsed;
                SelectionText.Text = PreserveTrailingSpaces(
                    _text.Substring(_selection.StartCaretPosition, _selection.EndCaretPosition - _selection.StartCaretPosition));
            }
            else
            {
                // There is no selection. Remove it.
                SelectionText.Text = "";

                // Draw the caret if we have focus.
                CaretText.Visibility = _internalFocus ? Visibility.Visible : Visibility.Collapsed;
            }

            AfterSelectionText.Text = PreserveTrailingSpaces(_text.Substring(_selection.EndCaretPosition));

            // Update statistics for demonstration purposes.
            FullText.Text = _text;
            SelectionStartIndexText.Text = _selection.StartCaretPosition.ToString();
            SelectionEndIndexText.Text = _selection.EndCaretPosition.ToString();
        }

Member Data Documentation

CoreWindow _coreWindow [private]

Definition at line 46 of file CustomEditControl.xaml.cs.

CoreTextEditContext _editContext [private]

Definition at line 23 of file CustomEditControl.xaml.cs.

bool _extendingLeft = false [private]

Definition at line 39 of file CustomEditControl.xaml.cs.

InputPane _inputPane [private]

Definition at line 43 of file CustomEditControl.xaml.cs.

bool _internalFocus = false [private]

Definition at line 34 of file CustomEditControl.xaml.cs.

CoreTextRange _selection [private]

Definition at line 31 of file CustomEditControl.xaml.cs.

string _text = String.Empty [private]

Definition at line 27 of file CustomEditControl.xaml.cs.

The documentation for this class was generated from the following file:
  • CustomEditControl/cs/CustomEditControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEffectState Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomEffectState
Public Attributes

CustomEffectState Class Reference

List of all members.

Public Attributes

Color | color = Colors.HotPink
int | frameNumber = 0
bool | isColorOn = true
LampArray | lampArray
Color[] | lampColors
float[] | lampNormalizedX

Detailed Description

Definition at line 32 of file Scenario2_Effects.xaml.cs.

Member Data Documentation

Color color = Colors.HotPink

Definition at line 39 of file Scenario2_Effects.xaml.cs.

int frameNumber = 0

Definition at line 35 of file Scenario2_Effects.xaml.cs.

bool isColorOn = true

Definition at line 40 of file Scenario2_Effects.xaml.cs.

LampArray lampArray

Definition at line 34 of file Scenario2_Effects.xaml.cs.

Color [] lampColors

Definition at line 37 of file Scenario2_Effects.xaml.cs.

float [] lampNormalizedX

Definition at line 36 of file Scenario2_Effects.xaml.cs.

The documentation for this class was generated from the following file:
  • LampArray/cs/Scenario2_Effects.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTextBox Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomTextBox
Public Member Functions

CustomTextBox Class Reference

Custom Text box control derived from Textbox class.

List of all members.

Public Member Functions

CustomTextBox ()

Detailed Description

Definition at line 23 of file CustomTextBox.cs.

Constructor & Destructor Documentation

CustomTextBox ( ) [inline]

Definition at line 25 of file CustomTextBox.cs.

        {
            FontFamily = new FontFamily("Times New Roman");
            FontStyle = Windows.UI.Text.FontStyle.Italic;
            BorderThickness = new Thickness(1);
        }

The documentation for this class was generated from the following file:
  • TouchKeyboard/cs/CustomTextBox.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTitleBar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomTitleBar
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

CustomTitleBar Class Reference

List of all members.

Public Member Functions

CustomTitleBar ()
void | EnableControlsInTitleBar (bool enable)
UIElement | SetPageContent (UIElement newContent)

Properties

double | CoreTitleBarHeight [get]
Thickness | CoreTitleBarPadding [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | CustomTitleBar_Loaded (object sender, RoutedEventArgs e)
void | CustomTitleBar_Unloaded (object sender, RoutedEventArgs e)
void | OnIsVisibleChanged (CoreApplicationViewTitleBar sender, object e)
void | OnLayoutMetricsChanged (CoreApplicationViewTitleBar sender, object e)
void | OnWindowSizeChanged (object sender, WindowSizeChangedEventArgs e)
void | UpdateLayoutMetrics ()
void | UpdatePositionAndVisibility ()

Private Attributes

CoreApplicationViewTitleBar | coreTitleBar = CoreApplication.GetCurrentView().TitleBar
UIElement | pageContent = null

Detailed Description

Definition at line 11 of file CustomTitleBar.xaml.cs.

Constructor & Destructor Documentation

CustomTitleBar ( ) [inline]

Definition at line 15 of file CustomTitleBar.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CustomTitleBar_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 20 of file CustomTitleBar.xaml.cs.

        {
            coreTitleBar.LayoutMetricsChanged += OnLayoutMetricsChanged;
            coreTitleBar.IsVisibleChanged += OnIsVisibleChanged;

            // The SizeChanged event is raised when the view enters or exits full screen mode.
            Window.Current.SizeChanged += OnWindowSizeChanged;

            UpdateLayoutMetrics();
            UpdatePositionAndVisibility();
        }

void CustomTitleBar_Unloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file CustomTitleBar.xaml.cs.

        {
            coreTitleBar.LayoutMetricsChanged -= OnLayoutMetricsChanged;
            coreTitleBar.IsVisibleChanged -= OnIsVisibleChanged;
            Window.Current.SizeChanged -= OnWindowSizeChanged;
        }

void EnableControlsInTitleBar ( bool enable ) [inline]

Definition at line 146 of file CustomTitleBar.xaml.cs.

        {
            if (enable)
            {
                TitleBarControl.Visibility = Visibility.Visible;
                // Clicks on the BackgroundElement will be treated as clicks on the title bar.
                Window.Current.SetTitleBar(BackgroundElement);
            }
            else
            {
                TitleBarControl.Visibility = Visibility.Collapsed;
                Window.Current.SetTitleBar(null);
            }
        }

void OnIsVisibleChanged | ( | CoreApplicationViewTitleBar | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file CustomTitleBar.xaml.cs.

        {
            UpdatePositionAndVisibility();
        }

void OnLayoutMetricsChanged | ( | CoreApplicationViewTitleBar | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file CustomTitleBar.xaml.cs.

        {
            UpdateLayoutMetrics();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 58 of file CustomTitleBar.xaml.cs.

        {
            UpdatePositionAndVisibility();
        }

UIElement SetPageContent ( UIElement newContent ) [inline]

Definition at line 98 of file CustomTitleBar.xaml.cs.

        {
            UIElement oldContent = pageContent;
            if (oldContent != null)
            {
                pageContent = null;
                RootGrid.Children.Remove(oldContent);
            }
            pageContent = newContent;
            if (newContent != null)
            {
                RootGrid.Children.Add(newContent);
                // The page content is row 1 in our grid. (See diagram above.)
                Grid.SetRow((FrameworkElement)pageContent, 1);
            }
            return oldContent;
        }

void UpdateLayoutMetrics ( ) [inline, private]

Definition at line 44 of file CustomTitleBar.xaml.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("CoreTitleBarHeight"));
                PropertyChanged(this, new PropertyChangedEventArgs("CoreTitleBarPadding"));
            }
        }

void UpdatePositionAndVisibility ( ) [inline, private]

Definition at line 79 of file CustomTitleBar.xaml.cs.

        {
            if (ApplicationView.GetForCurrentView().IsFullScreenMode)
            {
                // In full screen mode, the title bar overlays the content.
                // and might or might not be visible.
                TitleBar.Visibility = coreTitleBar.IsVisible ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
                Grid.SetRow(TitleBar, 1);
            }
            else
            {
                // When not in full screen mode, the title bar is visible and does not overlay content.
                TitleBar.Visibility = Windows.UI.Xaml.Visibility.Visible;
                Grid.SetRow(TitleBar, 0);
            }
        }

Member Data Documentation

CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar [private]

Definition at line 13 of file CustomTitleBar.xaml.cs.

UIElement pageContent = null [private]

Definition at line 96 of file CustomTitleBar.xaml.cs.

Property Documentation

double CoreTitleBarHeight [get]

Definition at line 138 of file CustomTitleBar.xaml.cs.

Thickness CoreTitleBarPadding [get]

Definition at line 120 of file CustomTitleBar.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 117 of file CustomTitleBar.xaml.cs.

The documentation for this class was generated from the following files:
  • TitleBar/cs/CustomTitleBar.xaml.cs
  • TitleBar/cpp/CustomTitleBar.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • CustomTrigger
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CustomTrigger Class Reference

List of all members.

Public Member Functions

CustomTrigger ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

bool | IsFx2CustomTriggerTaskRegistered ()
void | RegisterCustomTrigger_Click (Object sender, RoutedEventArgs e)
void | UnregisterCustomTrigger_Click (Object sender, RoutedEventArgs e)
void | UnregisterTask ()
void | UpdateUI ()

Private Attributes

const string | customTriggerTaskName = "Osrusbfx2Task.ConnectedTask"
const string | guidCustomSystemEventId_OsrUsbFx2 = "{C7BDD245-5CDA-4BBD-B68D-B5E36F7911A3}"
MainPage rootPage = MainPage.Current
BackgroundTaskRegistration | taskRegistration

Detailed Description

Definition at line 19 of file Scenario6_CustomTrigger.xaml.cs.

Constructor & Destructor Documentation

CustomTrigger ( ) [inline]

Definition at line 28 of file Scenario6_CustomTrigger.xaml.cs.

        {
            this.InitializeComponent();
            UpdateUI();
        }

Member Function Documentation

bool IsFx2CustomTriggerTaskRegistered ( ) [inline, private]

Definition at line 91 of file Scenario6_CustomTrigger.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                string taskName = task.Value.Name;
                if (taskName == customTriggerTaskName)
                {
                    return true;
                }
            }

            return false;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario6_CustomTrigger.xaml.cs.

        {
            UnregisterTask();
        }

void RegisterCustomTrigger_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario6_CustomTrigger.xaml.cs.

        {
            if (IsFx2CustomTriggerTaskRegistered())
            {
                rootPage.NotifyUser("Osrusbfx2.ConnectedTask background task has already been registered", NotifyType.ErrorMessage);
            }

            // Create a new background task builder.
            BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder();

            // Create a new OEM trigger.
            CustomSystemEventTrigger fx2Trigger = new CustomSystemEventTrigger(
                guidCustomSystemEventId_OsrUsbFx2, // Trigger Qualifier
                CustomSystemEventTriggerRecurrence.Once); // One-shot trigger

            // Associate the fx2Trigger trigger with the background task builder.
            taskBuilder.SetTrigger(fx2Trigger);

            // Specify the background task to run when the trigger fires.
            taskBuilder.TaskEntryPoint = customTriggerTaskName;

            // Name the background task.
            taskBuilder.Name = customTriggerTaskName;

            try
            {
                // Register the background task.
                taskRegistration = taskBuilder.Register();
            }
            catch (Exception ex) {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                return;
            }

            UpdateUI();
        }

void UnregisterCustomTrigger_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file Scenario6_CustomTrigger.xaml.cs.

        {
            UnregisterTask();
            UpdateUI();
        }

void UnregisterTask ( ) [inline, private]

Definition at line 45 of file Scenario6_CustomTrigger.xaml.cs.

        {
            if (taskRegistration != null)
            {
                taskRegistration.Unregister(true);
                taskRegistration = null;
            }
        }

void UpdateUI ( ) [inline, private]

Definition at line 39 of file Scenario6_CustomTrigger.xaml.cs.

        {
            RegisterCustomTrigger.IsEnabled = (taskRegistration == null);
            UnregisterCustomTrigger.IsEnabled = (taskRegistration != null);
        }

Member Data Documentation

const string customTriggerTaskName = "Osrusbfx2Task.ConnectedTask" [private]

Definition at line 25 of file Scenario6_CustomTrigger.xaml.cs.

const string guidCustomSystemEventId_OsrUsbFx2 = "{C7BDD245-5CDA-4BBD-B68D-B5E36F7911A3}" [private]

Definition at line 26 of file Scenario6_CustomTrigger.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario6_CustomTrigger.xaml.cs.

BackgroundTaskRegistration taskRegistration [private]

Definition at line 23 of file Scenario6_CustomTrigger.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario6_CustomTrigger.xaml.cs
  • CustomCapability/cpp/Scenario6_CustomTrigger.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImageRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • D2DSvgImageRenderer
Public Member Functions | Private Member Functions | Private Attributes

D2DSvgImageRenderer Class Reference

#include "D2DSvgImageRenderer.h"

List of all members.

Public Member Functions

D2DSvgImageRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~D2DSvgImageRenderer ()
void | CreateDeviceDependentResources ()
void | CreateDeviceIndependentResources ()
void | CreateWindowSizeDependentResources ()
void | Draw ()
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | RecolorSvg (D2D1_COLOR_F newColor)
void | ReleaseDeviceDependentResources ()
void | SetScaleValue (float val)
void | ToggleTongue ()

Private Member Functions

void | RecolorSubtree (ID2D1SvgElement *element, D2D1_COLOR_F newColor)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
bool | m_isWindowClosed
float | m_scaleValue
Microsoft::WRL::ComPtr
< ID2D1SvgDocument > 		m_svgDocument

Detailed Description

Definition at line 18 of file D2DSvgImageRenderer.h.

Constructor & Destructor Documentation

D2DSvgImageRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 33 of file D2DSvgImageRenderer.cpp.

                                                                                :
    m_deviceResources(deviceResources),
    m_scaleValue(1.0f),
    m_isWindowClosed(false)
{
    // Register to be notified if the GPU device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

~D2DSvgImageRenderer ( )

Definition at line 46 of file D2DSvgImageRenderer.cpp.

{
    // Deregister device notification.
    m_deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 56 of file D2DSvgImageRenderer.cpp.

{
    auto d2dContext = m_deviceResources->GetD2DDeviceContext();

    StorageFolder^ packageFolder = Windows::ApplicationModel::Package::Current->InstalledLocation;

    // Retrieve the SVG file from the app package.
    create_task(packageFolder->GetFileAsync("Assets\\drawing.svg")).then([=](StorageFile^ file)
    {
        // Open the SVG file for reading.
        return file->OpenAsync(FileAccessMode::Read);

    }).then([=](IRandomAccessStream^ stream)
    {
        // Wrap the WinRT stream with a COM stream.
        ComPtr<IStream> iStream;
        DX::ThrowIfFailed(
            CreateStreamOverRandomAccessStream(
                stream,
                IID_PPV_ARGS(&iStream)
                )
            );

        // Parse the file stream into an SVG document.
        DX::ThrowIfFailed(
            d2dContext->CreateSvgDocument(
                iStream.Get(),
                D2D1::SizeF(sc_svgSize, sc_svgSize), // Create the document at a size of 500x500 DIPs.
                &m_svgDocument
                )
            );
    });
}

void CreateDeviceIndependentResources ( )

Definition at line 52 of file D2DSvgImageRenderer.cpp.

{
}

void CreateWindowSizeDependentResources ( )

Definition at line 95 of file D2DSvgImageRenderer.cpp.

{
}

void Draw ( )

Definition at line 99 of file D2DSvgImageRenderer.cpp.

{
    ID2D1DeviceContext5* d2dContext = m_deviceResources->GetD2DDeviceContext();
    Size logicalSize = m_deviceResources->GetLogicalSize();

    d2dContext->BeginDraw();

    d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));

    // DeviceResources explicitly handles screen rotation by setting the rotation on the swap chain.
    // In order for Direct2D content to appear correctly on this swap chain, the app is responsible for
    // explicitly "prerotating" by setting the appropriate transform before drawing.
    D2D1_MATRIX_3X2_F transform = m_deviceResources->GetOrientationTransform2D();

    // Also perform a translation to center the SVG image in the window.
    transform = transform * D2D1::Matrix3x2F::Translation(
        (logicalSize.Width - sc_svgSize) / 2.0f,
        (logicalSize.Height - sc_svgSize) / 2.0f
        );

    // Also perform a scale based on the current slider value.
    transform = transform * D2D1::Matrix3x2F::Scale(
        m_scaleValue,
        m_scaleValue,
        D2D1::Point2F(
            logicalSize.Width / 2.0f,
            logicalSize.Height / 2.0f
            )
        );

    m_deviceResources->GetD2DDeviceContext()->SetTransform(transform);

    if (m_svgDocument)
    {
        // Draw the SVG document.
        d2dContext->DrawSvgDocument(m_svgDocument.Get());
    }

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }

    m_deviceResources->Present();
}

void OnDeviceLost ( ) [virtual]

Definition at line 258 of file D2DSvgImageRenderer.cpp.

{
    ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 264 of file D2DSvgImageRenderer.cpp.

{
    CreateDeviceDependentResources();
}

void RecolorSubtree | ( | ID2D1SvgElement * | element,
 |  | D2D1_COLOR_F | newColor |
 | ) |  |  | [private]

Definition at line 166 of file D2DSvgImageRenderer.cpp.

{
    // Check if this SVG element has a "fill" element explicitly specified or inherited.
    if (element->IsAttributeSpecified(L"fill"))
    {
        // Retrieve the value of this element's "fill" attribute, as a paint object.
        ComPtr<ID2D1SvgPaint> paint;
        DX::ThrowIfFailed(element->GetAttributeValue(L"fill", &paint));

        // Check the type of paint object that was set. There are different types of
        // paints, such as plain colors, URLs, or the 'none' type. For this app we
        // only want to modify fills that were set to a specific color.
        D2D1_SVG_PAINT_TYPE paintType = paint->GetPaintType();
        if (paintType == D2D1_SVG_PAINT_TYPE_COLOR)
        {
            // Retrieve the color of this paint.
            D2D1_COLOR_F oldColor;
            paint->GetColor(&oldColor);

            // If the old color not black, change it to newColor.
            if (oldColor.r != 0.0f || oldColor.g != 0.0f || oldColor.b != 0.0f)
            {
                // Attributes that are returned as an interface (such as ID2D1SvgPaint)
                // are returned by reference, rather than by value. This means that
                // modifying them (such as by calling SetColor, below) directly modifies
                // the SVG document, without needing to call SetAttributeValue.
                DX::ThrowIfFailed(paint->SetColor(newColor));
            }
        }
    }

    // Now, iterate through any child nodes of this SVG element and recursively recolor them.

    // Retrieve the first child of the current element, if it has any.
    ComPtr<ID2D1SvgElement> child;
    element->GetFirstChild(&child);

    while (child != nullptr)
    {
        // Recursively recolor the subtree starting with this child node.
        RecolorSubtree(child.Get(), newColor);

        // Retrieve the next child, if any.
        ComPtr<ID2D1SvgElement> nextChild;
        element->GetNextChild(child.Get(), &nextChild);

        // Move to the next child.
        child = nextChild;
    }
}

void RecolorSvg ( D2D1_COLOR_F newColor )

Definition at line 151 of file D2DSvgImageRenderer.cpp.

{
    if (m_svgDocument)
    {
        // Retrieve the root element of the SVG document.
        ComPtr<ID2D1SvgElement> root;
        m_svgDocument->GetRoot(&root);

        // Recursively recolor the tree, beginning at the root.
        RecolorSubtree(root.Get(), newColor);
    }
}

void ReleaseDeviceDependentResources ( )

Definition at line 90 of file D2DSvgImageRenderer.cpp.

{
    m_svgDocument.Reset();
}

void SetScaleValue ( float val )

Definition at line 252 of file D2DSvgImageRenderer.cpp.

{
    m_scaleValue = val;
}

void ToggleTongue ( )

Definition at line 220 of file D2DSvgImageRenderer.cpp.

{
    if (m_svgDocument)
    {
        // Retrieve the SVG element with the identifier "tongue". (Open
        // drawing.svg to see where this is defined by the SVG author.)
        ComPtr<ID2D1SvgElement> tongueElement;
        DX::ThrowIfFailed(m_svgDocument->FindElementById(L"tongue", &tongueElement));

        // Retrieve the value of the element's "display" attribute.
        D2D1_SVG_DISPLAY displayValue;
        DX::ThrowIfFailed(tongueElement->GetAttributeValue(L"display", &displayValue));

        // Invert the value of the retrieved variable.
        if (displayValue == D2D1_SVG_DISPLAY::D2D1_SVG_DISPLAY_NONE)
        {
            displayValue = D2D1_SVG_DISPLAY::D2D1_SVG_DISPLAY_INLINE;
        }
        else
        {
            displayValue = D2D1_SVG_DISPLAY::D2D1_SVG_DISPLAY_NONE;
        }

        // Attributes that are returned as an enum (such as D2D1_SVG_DISPLAY) are
        // returned by value, rather than by reference. This means that in order
        // to change the SVG document itself, we must store the modified variable
        // back into the SVG document using SetAttributeValue. The new value will
        // be used the next time the SVG document is drawn.
        DX::ThrowIfFailed(tongueElement->SetAttributeValue(L"display", displayValue));
    }
}

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 43 of file D2DSvgImageRenderer.h.

bool m_isWindowClosed [private]

Definition at line 49 of file D2DSvgImageRenderer.h.

float m_scaleValue [private]

Definition at line 48 of file D2DSvgImageRenderer.h.

Microsoft::WRL::ComPtr<ID2D1SvgDocument> m_svgDocument [private]

Definition at line 46 of file D2DSvgImageRenderer.h.

The documentation for this class was generated from the following files:
  • D2DSvgImage/cpp/D2DSvgImageRenderer.h
  • D2DSvgImage/cpp/D2DSvgImageRenderer.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DatagramSocketSample
  • sealed
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "Scenario1.xaml.h"

List of all members.

Public Member Functions

Windows::Storage::Streams::DataWriter | GetWriter ()
boolean | IsConnected ()
bool | IsMatching (Windows::Networking::HostName^hostName, Platform::String^port)
ListenerContext (MainPage^rootPage, Windows::Networking::Sockets::DatagramSocket^listener)
LocalHostItem (Windows::Networking::HostName^localHostName)
void | OnMessage (Windows::Networking::Sockets::DatagramSocket^socket, Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^eventArguments)
void | OnMessage (Windows::Networking::Sockets::DatagramSocket^socket, Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^eventArguments)
Scenario1 ()
Scenario2 ()
Scenario3 ()
Scenario4 ()
Scenario5 ()
void | SetConnected ()
SocketContext (MainPage^rootPage, Windows::Networking::Sockets::DatagramSocket^socket)

Protected Member Functions

virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Properties

Windows::Networking::HostName | localHost

Private Member Functions

~ListenerContext ()
~SocketContext ()
void | BindToAny_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | BindToAny_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CloseListener_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CloseListenerSocket ()
void | CloseSockets_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ConnectSocket_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | EchoMessage (Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^eventArguments)
void | MessageReceived (Windows::Networking::Sockets::DatagramSocket^socket, Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^eventArguments)
void | MulticastRadioButton_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | MulticastRadioButton_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | NotifyUserFromAsyncThread (Platform::String^message, NotifyType type)
void | NotifyUserFromAsyncThread (Platform::String^message, NotifyType type)
void | NotifyUserFromAsyncThread (Platform::String^message, NotifyType type)
void | PopulateAdapterList ()
void | SendHello_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | SendMessage_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | SetupBroadcastScenarioUI ()
void | SetupMulticastScenarioUI ()
void | StartListener_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | StartListener_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Private Attributes

boolean | connected
Windows::Networking::HostName | hostName
Windows::Networking::Sockets::DatagramSocket | listener
Windows::Networking::Sockets::DatagramSocket | listenerSocket
Platform::Collections::Vector
< LocalHostItem^> 		localHostItems
CRITICAL_SECTION | lock
Windows::Storage::Streams::IOutputStream | outputStream
Platform::String | port
MainPage rootPage
Windows::Networking::Sockets::DatagramSocket | socket
Windows::Storage::Streams::DataWriter | writer

Detailed Description

Definition at line 31 of file Scenario1.xaml.h.

Constructor & Destructor Documentation

~ListenerContext ( ) [private]
~SocketContext ( ) [private]

Member Function Documentation

void BindToAny_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void BindToAny_Unchecked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CloseListener_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CloseListenerSocket ( ) [private]
void CloseSockets_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void ConnectSocket_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void EchoMessage ( Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ eventArguments ) [private]
Windows::Storage::Streams::DataWriter GetWriter ( )
boolean IsConnected ( )
bool IsMatching | ( | Windows::Networking::HostName^ | hostName,
 |  | Platform::String^ | port
 | ) |  |
ListenerContext | ( | MainPage^ | rootPage,
 |  | Windows::Networking::Sockets::DatagramSocket^ | listener
 | ) |  |
LocalHostItem ( Windows::Networking::HostName^ localHostName )
void MessageReceived | ( | Windows::Networking::Sockets::DatagramSocket^ | socket,
 |  | Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ | eventArguments |
 | ) |  |  | [private]
void MulticastRadioButton_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void MulticastRadioButton_Unchecked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void NotifyUserFromAsyncThread | ( | Platform::String^ | message,
 |  | NotifyType | type |
 | ) |  |  | [private]
void NotifyUserFromAsyncThread | ( | Platform::String^ | message,
 |  | NotifyType | type |
 | ) |  |  | [private]
void NotifyUserFromAsyncThread | ( | Platform::String^ | message,
 |  | NotifyType | type |
 | ) |  |  | [private]
void OnMessage | ( | Windows::Networking::Sockets::DatagramSocket^ | socket,
 |  | Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ | eventArguments
 | ) |  |
void OnMessage | ( | Windows::Networking::Sockets::DatagramSocket^ | socket,
 |  | Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ | eventArguments
 | ) |  |
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void PopulateAdapterList ( ) [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
Scenario4 ( )
Scenario5 ( )
void SendHello_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void SendMessage_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void SetConnected ( )
void SetupBroadcastScenarioUI ( ) [private]
void SetupMulticastScenarioUI ( ) [private]
SocketContext | ( | MainPage^ | rootPage,
 |  | Windows::Networking::Sockets::DatagramSocket^ | socket
 | ) |  |
void StartListener_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void StartListener_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]

Member Data Documentation

boolean connected [private]

Definition at line 60 of file Scenario2.xaml.h.

Windows::Networking::HostName hostName [private]

Definition at line 79 of file Scenario1.xaml.h.

Windows::Networking::Sockets::DatagramSocket listener [private]

Definition at line 77 of file Scenario1.xaml.h.

Windows::Networking::Sockets::DatagramSocket listenerSocket [private]

Definition at line 37 of file Scenario5.xaml.h.

Platform::Collections::Vector<LocalHostItem^> localHostItems [private]

Definition at line 55 of file Scenario1.xaml.h.

CRITICAL_SECTION lock [private]

Definition at line 75 of file Scenario1.xaml.h.

Windows::Storage::Streams::IOutputStream outputStream [private]

Definition at line 78 of file Scenario1.xaml.h.

Platform::String port [private]

Definition at line 80 of file Scenario1.xaml.h.

MainPage rootPage [private]

Definition at line 52 of file Scenario1.xaml.h.

Windows::Networking::Sockets::DatagramSocket socket [private]

Definition at line 58 of file Scenario2.xaml.h.

Windows::Storage::Streams::DataWriter writer [private]

Definition at line 59 of file Scenario2.xaml.h.

Property Documentation

Windows::Networking::HostName localHost

Definition at line 39 of file Scenario1.xaml.h.

The documentation for this class was generated from the following files:
  • DatagramSocket/cpp/Scenario1.xaml.h
  • DatagramSocket/cpp/Scenario2.xaml.h
  • DatagramSocket/cpp/Scenario3.xaml.h
  • DatagramSocket/cpp/Scenario4.xaml.h
  • DatagramSocket/cpp/Scenario5.xaml.h
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DataHelpers
Static Public Member Functions

DataHelpers Class Reference

List of all members.

Static Public Member Functions

static string | GetDataLabelString (IBuffer data, uint scanDataType)
static string | GetDataString (IBuffer data)

Detailed Description

Definition at line 52 of file SampleConfiguration.cs.

Member Function Documentation

static string GetDataLabelString | ( | IBuffer | data,
 |  | uint | scanDataType |
 | ) |  |  | [inline, static]

Definition at line 71 of file SampleConfiguration.cs.

        {
            // Only certain data types contain encoded text.
            // To keep this simple, we'll just decode a few of them.
            if (data == null)
            {
                return "No data";
            }

            // This is not an exhaustive list of symbologies that can be converted to a string.
            if (scanDataType == BarcodeSymbologies.Upca ||
                scanDataType == BarcodeSymbologies.UpcaAdd2 ||
                scanDataType == BarcodeSymbologies.UpcaAdd5 ||
                scanDataType == BarcodeSymbologies.Upce ||
                scanDataType == BarcodeSymbologies.UpceAdd2 ||
                scanDataType == BarcodeSymbologies.UpceAdd5 ||
                scanDataType == BarcodeSymbologies.Ean8 ||
                scanDataType == BarcodeSymbologies.TfStd ||
                scanDataType == BarcodeSymbologies.OcrA ||
                scanDataType == BarcodeSymbologies.OcrB)
            {
                // The UPC, EAN8, and 2 of 5 families encode the digits 0..9
                // which are then sent to the app in a UTF8 string (like "01234").
                return CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, data);
            }

            // Some other symbologies (typically 2-D symbologies) contain binary data that
            // should not be converted to text.
            return string.Format("Decoded data unavailable. Raw label data: {0}", DataHelpers.GetDataString(data));
        }

static string GetDataString ( IBuffer data ) [inline, static]

Definition at line 54 of file SampleConfiguration.cs.

        {
            if (data == null)
            {
                return "No data";
            }

            // Just to show that we have the raw data, we'll print the value of the bytes.
            // Arbitrarily limit the number of bytes printed to 20 so the UI isn't overloaded.
            string result = CryptographicBuffer.EncodeToHexString(data);
            if (result.Length > 40)
            {
                result = result.Substring(0, 40) + "...";
            }
            return result;
        }

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DefaultCloseCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DefaultCloseCommand
Public Member Functions | Private Member Functions | Private Attributes

DefaultCloseCommand Class Reference

List of all members.

Public Member Functions

DefaultCloseCommand ()

Private Member Functions

async void DefaultCloseCommandButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file DefaultCloseCommand.xaml.cs.

Constructor & Destructor Documentation

DefaultCloseCommand ( ) [inline]

Definition at line 25 of file DefaultCloseCommand.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DefaultCloseCommandButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'DefaultCloseCommandButton' button.

Demonstrates showing a message dialog with a default close command and content. A message will be displayed indicating that the dialog has been closed. In this scenario, the only command is the default 'Close' command that is used if no other commands are specified.

Parameters:
sender | The Object that caused this event to be fired.
e | State information and event data associated with the routed event.

Definition at line 38 of file DefaultCloseCommand.xaml.cs.

        {
            // Create the message dialog and set its content; it will get a default "Close" button since there aren't any other buttons being added
            var messageDialog = new MessageDialog("You've exceeded your trial period.");

            // Show the message dialog and wait
            await messageDialog.ShowAsync();
            rootPage.NotifyUser("The dialog has now been closed", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file DefaultCloseCommand.xaml.cs.

The documentation for this class was generated from the following files:
  • MessageDialog/cs/DefaultCloseCommand.xaml.cs
  • MessageDialog/cpp/DefaultCloseCommand.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailsPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DetailsPage
Public Member Functions | Protected Member Functions | Properties | Private Member Functions

DetailsPage Class Reference

List of all members.

Public Member Functions

DetailsPage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

Contact | SelectedContact [get, set]

Private Member Functions

void | DeleteItem (object sender, RoutedEventArgs e)
void | NavigateBackForWideState (bool useTransition)
void | OnBackRequested (object sender, BackRequestedEventArgs e)
void | OnLoaded (object sender, RoutedEventArgs e)
void | OnUnloaded (object sender, RoutedEventArgs e)
void | OnWindowSizeChanged (object sender, WindowSizeChangedEventArgs e)
bool | ShouldGoToWideState ()

Detailed Description

Definition at line 19 of file DetailsPage.xaml.cs.

Constructor & Destructor Documentation

DetailsPage ( ) [inline]

Definition at line 23 of file DetailsPage.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void DeleteItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 98 of file DetailsPage.xaml.cs.

        {
            Frame.Navigate(typeof(Scenario3_MasterDetail), "D" + SelectedContact.Id, new EntranceNavigationTransitionInfo());
        }

void NavigateBackForWideState ( bool useTransition ) [inline, private]

Definition at line 65 of file DetailsPage.xaml.cs.

        {
            // Evict this page from the cache as we may not need it again.
            NavigationCacheMode = NavigationCacheMode.Disabled;

            if (useTransition)
            {
                Frame.GoBack(new EntranceNavigationTransitionInfo());
            }
            else
            {
                Frame.GoBack(new SuppressNavigationTransitionInfo());
            }
        }

void OnBackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file DetailsPage.xaml.cs.

        {
            // Mark event as handled so we don't get bounced out of the app.
            e.Handled = true;
            // Page above us will be our master view.
            // Make sure we are using the "drill out" animation in this transition.
            Frame.Navigate(typeof(Scenario3_MasterDetail), "S" + SelectedContact.Id, new EntranceNavigationTransitionInfo());
        }

void OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file DetailsPage.xaml.cs.

        {
            if (ShouldGoToWideState())
            {
                // We shouldn't see this page since we are in "wide master-detail" mode.
                // Play a transition as we are navigating from a separate page.
                NavigateBackForWideState(useTransition: true);
            }
            else
            {
                // Realize the main page content.
                FindName("RootPanel");
            }

            Window.Current.SizeChanged += OnWindowSizeChanged;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 51 of file DetailsPage.xaml.cs.

        {
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested -= OnBackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file DetailsPage.xaml.cs.

        {
            SelectedContact = e.Parameter as Contact;
            // Register for hardware and software back request from the system
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += OnBackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }

void OnUnloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file DetailsPage.xaml.cs.

        {
            Window.Current.SizeChanged -= OnWindowSizeChanged;
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file DetailsPage.xaml.cs.

        {
            if (ShouldGoToWideState())
            {
                // Make sure we are no longer listening to window change events.
                Window.Current.SizeChanged -= OnWindowSizeChanged;

                // We shouldn't see this page since we are in "wide master-detail" mode.
                NavigateBackForWideState(useTransition: false);
            }
        }

bool ShouldGoToWideState ( ) [inline, private]

Definition at line 79 of file DetailsPage.xaml.cs.

        {
            return Window.Current.Bounds.Width >= 720;
        }

Property Documentation

Contact SelectedContact [get, set, private]

Definition at line 21 of file DetailsPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/DetailsPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceConnect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceConnect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

DeviceConnect Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

DeviceConnect ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CloseFx2Device ()
async void | deviceConnectDevices_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | deviceConnectStart_Click (object sender, RoutedEventArgs e)
void | deviceConnectStop_Click (object sender, RoutedEventArgs e)
async Task | OpenFx2DeviceAsync (string Id)
void | UpdateStartStopButtons ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_DeviceConnect.xaml.cs.

Constructor & Destructor Documentation

DeviceConnect ( void ) [inline]

Definition at line 30 of file Scenario2_DeviceConnect.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CloseFx2Device ( void ) [inline, private]

Definition at line 99 of file Scenario2_DeviceConnect.xaml.cs.

        {
            if (DeviceList.Current.GetSelectedDevice() != null)
            {
                rootPage.NotifyUser($"Fx2 {DeviceList.Current.GetSelectedDeviceId()} closed", NotifyType.StatusMessage);
                DeviceList.Current.ClearSelectedDevice();
            }
        }

async void deviceConnectDevices_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 58 of file Scenario2_DeviceConnect.xaml.cs.

        {
            var entry = (DeviceListEntry)deviceConnectDevices.SelectedItem;
            var currentlySelectedId = DeviceList.Current.GetSelectedDeviceId();
            var newlySelectedId = entry?.Id;

            if (currentlySelectedId != null)
            {
                CloseFx2Device();
            }

            if (newlySelectedId != null)
            {
                await OpenFx2DeviceAsync(newlySelectedId);
            }
        }

void deviceConnectStart_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario2_DeviceConnect.xaml.cs.

        {
            DeviceList.Current.StartFx2Watcher();
            UpdateStartStopButtons();
        }

void deviceConnectStop_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario2_DeviceConnect.xaml.cs.

        {
            DeviceList.Current.StopFx2Watcher();
            UpdateStartStopButtons();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file Scenario2_DeviceConnect.xaml.cs.

        {
            UpdateStartStopButtons();
            listSource.Source = DeviceList.Current.Fx2Devices;
        }

async Task OpenFx2DeviceAsync ( string Id ) [inline, private]

Definition at line 81 of file Scenario2_DeviceConnect.xaml.cs.

        {
            System.Diagnostics.Debug.Assert(DeviceList.Current.GetSelectedDevice() == null);

            try
            {
                var device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
                DeviceList.Current.SetSelectedDevice(Id, device);
            }
            catch (Exception e)
            {
                rootPage.NotifyUser($"Error opening Fx2 device @{Id}: {e.Message}", NotifyType.ErrorMessage);
                return;
            }
            rootPage.NotifyUser($"Fx2 {Id} opened", NotifyType.StatusMessage);
            return;
        }

void UpdateStartStopButtons ( void ) [inline, private]

Definition at line 75 of file Scenario2_DeviceConnect.xaml.cs.

        {
            this.deviceConnectStart.IsEnabled = !DeviceList.Current.WatcherStarted;
            this.deviceConnectStop.IsEnabled = DeviceList.Current.WatcherStarted;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_DeviceConnect.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario2_DeviceConnect.xaml.cs
  • CustomCapability/cpp/Scenario2_DeviceConnect.xaml.cpp
  • CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

DeviceEvents Class Reference

List of all members.

Public Member Functions

DeviceEvents ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearSwitchStateTable ()
void | deviceEventsBegin_Click (object sender, RoutedEventArgs e)
void | deviceEventsCancel_Click (object sender, RoutedEventArgs e)
async void | deviceEventsGet_Click (object sender, RoutedEventArgs e)
async void | ReadInterruptMessagesAsync ()
void | UpdateRegisterButton ()
void | UpdateSwitchStateTable (bool[] switchStateArray)

Static Private Member Functions

static bool[] | CreateSwitchStateArray (byte[] output)

Private Attributes

CancellationTokenSource | cancelSource
bool[] | previousSwitchValues = null
MainPage rootPage = MainPage.Current
byte[] | switchMessageBuffer = new byte[1]

Detailed Description

Definition at line 23 of file Scenario4_DeviceEvents.xaml.cs.

Constructor & Destructor Documentation

DeviceEvents ( ) [inline]

Definition at line 30 of file Scenario4_DeviceEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearSwitchStateTable ( ) [inline, private]

Definition at line 190 of file Scenario4_DeviceEvents.xaml.cs.

        {
            deviceEventsSwitches.Inlines.Clear();
            previousSwitchValues = null;
        }

static bool [] CreateSwitchStateArray ( byte[] output ) [inline, static, private]

Definition at line 87 of file Scenario4_DeviceEvents.xaml.cs.

        {
            var switchStateArray = new bool[8];

            for (int i = 0; i < 8; i += 1)
            {
                switchStateArray[i] = (output[0] & (1 << i)) != 0;
            }

            return switchStateArray;
        }

void deviceEventsBegin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario4_DeviceEvents.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            if (cancelSource == null)
            {
                ReadInterruptMessagesAsync();
            }

            UpdateRegisterButton();
        }

void deviceEventsCancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario4_DeviceEvents.xaml.cs.

        {
            if (cancelSource != null)
            {
                cancelSource.Cancel();
            }
            UpdateRegisterButton();
        }

async void deviceEventsGet_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario4_DeviceEvents.xaml.cs.

        {
            CustomDevice fx2Device = DeviceList.Current.GetSelectedDevice();

            bool[] switchStateArray = new bool[8];

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            var button = (Button)sender;
            button.IsEnabled = false;

            var output = new byte[1];

            try
            {
                uint bytesRead = await fx2Device.SendIOControlAsync(Fx2Driver.ReadSwitches, null, output.AsBuffer());
                if (bytesRead == 0)
                {
                    rootPage.NotifyUser("Fx2 device returned 0 byte interrupt message.  Stopping", NotifyType.ErrorMessage);
                }
                else
                {
                    switchStateArray = CreateSwitchStateArray(output);
                    UpdateSwitchStateTable(switchStateArray);
                }
            }
            catch (Exception exception)
            {
                rootPage.NotifyUser(exception.ToString(), NotifyType.ErrorMessage);
            }
            button.IsEnabled = true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario4_DeviceEvents.xaml.cs.

        {
            if (cancelSource != null)
            {
                cancelSource.Cancel();
                cancelSource = null;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario4_DeviceEvents.xaml.cs.

        {
            ClearSwitchStateTable();
            UpdateRegisterButton();
        }

async void ReadInterruptMessagesAsync ( ) [inline, private]

Definition at line 129 of file Scenario4_DeviceEvents.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();
            var switchMessageBuffer = new byte[1] { 0 };

            cancelSource = new CancellationTokenSource();

            bool failure = false;

            while (!cancelSource.IsCancellationRequested)
            {
                uint bytesRead;

                try
                {
                    bytesRead = await fx2Device.SendIOControlAsync(
                                                    Fx2Driver.GetInterruptMessage,
                                                    null,
                                                    switchMessageBuffer.AsBuffer()
                                                    ).AsTask(cancelSource.Token);
                }
                catch (TaskCanceledException)
                {
                    rootPage.NotifyUser("Pending GetInterruptMessage IO Control cancelled", NotifyType.StatusMessage);
                    failure = false;
                    break;
                }
                catch (Exception e)
                {
                    rootPage.NotifyUser("Error accessing Fx2 device:\n" + e.Message, NotifyType.ErrorMessage);
                    failure = true;
                    break;
                }

                if (bytesRead == 0)
                {
                    rootPage.NotifyUser("Fx2 device returned 0 byte interrupt message.  Stopping\n", NotifyType.ErrorMessage);
                    failure = true;
                    break;
                }

                var switchState = CreateSwitchStateArray(switchMessageBuffer);
                UpdateSwitchStateTable(switchState);

            }

            if (failure)
            {
                ClearSwitchStateTable();
            }

            cancelSource = null;
            UpdateRegisterButton();
        }

void UpdateRegisterButton ( ) [inline, private]

Definition at line 184 of file Scenario4_DeviceEvents.xaml.cs.

        {
            deviceEventsBegin.IsEnabled = (cancelSource == null);
            deviceEventsCancel.IsEnabled = (cancelSource != null);
        }

void UpdateSwitchStateTable ( bool[] switchStateArray ) [inline, private]

Definition at line 196 of file Scenario4_DeviceEvents.xaml.cs.

        {
            var output = deviceEventsSwitches;

            DeviceList.CreateBooleanTable(
                output.Inlines,
                switchStateArray,
                previousSwitchValues,
                "Switch Number",
                "Switch State",
                "off",
                "on"
                );
            previousSwitchValues = switchStateArray;
        }

Member Data Documentation

CancellationTokenSource cancelSource [private]

Definition at line 99 of file Scenario4_DeviceEvents.xaml.cs.

bool [] previousSwitchValues = null [private]

Definition at line 28 of file Scenario4_DeviceEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario4_DeviceEvents.xaml.cs.

byte [] switchMessageBuffer = new byte[1] [private]

Definition at line 100 of file Scenario4_DeviceEvents.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario4_DeviceEvents.xaml.cs
  • CustomCapability/cpp/Scenario4_DeviceEvents.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceHelpers
Static Public Member Functions

DeviceHelpers Class Reference

List of all members.

Static Public Member Functions

static async Task< BarcodeScanner > | GetFirstBarcodeScannerAsync (PosConnectionTypes connectionTypes=PosConnectionTypes.All)
static async Task< CashDrawer > | GetFirstCashDrawerAsync (PosConnectionTypes connectionTypes=PosConnectionTypes.All)
static async Task
< MagneticStripeReader > 		GetFirstMagneticStripeReaderAsync (PosConnectionTypes connectionTypes=PosConnectionTypes.All)

Detailed Description

Definition at line 44 of file SampleConfiguration.cs.

Member Function Documentation

task< BarcodeScanner^> GetFirstBarcodeScannerAsync ( PosConnectionTypes connectionTypes = PosConnectionTypes.All ) [inline, static]

Definition at line 46 of file SampleConfiguration.cs.

        {
            return await DeviceHelpers.GetFirstDeviceAsync(BarcodeScanner.GetDeviceSelector(connectionTypes), async (id) => await BarcodeScanner.FromIdAsync(id));
        }

task< CashDrawer^> GetFirstCashDrawerAsync ( PosConnectionTypes connectionTypes = PosConnectionTypes.All ) [inline, static]

Definition at line 41 of file SampleConfiguration.cs.

        {
            return await DeviceHelpers.GetFirstDeviceAsync(CashDrawer.GetDeviceSelector(connectionTypes), async (id) => await CashDrawer.FromIdAsync(id));
        }

task< MagneticStripeReader^> GetFirstMagneticStripeReaderAsync ( PosConnectionTypes connectionTypes = PosConnectionTypes.All ) [inline, static]

Definition at line 41 of file SampleConfiguration.cs.

        {
            return await DeviceHelpers.GetFirstDeviceAsync(MagneticStripeReader.GetDeviceSelector(connectionTypes), async (id) => await MagneticStripeReader.FromIdAsync(id));
        }

The documentation for this class was generated from the following files:
  • BarcodeScanner/cs/SampleConfiguration.cs
  • CashDrawer/cs/SampleConfiguration.cs
  • MagneticStripeReader/cs/SampleConfiguration.cs
  • BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.cpp
  • CashDrawer/cpp/SampleConfiguration.cpp
  • MagneticStripeReader/cpp/SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceInformationDisplay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceInformationDisplay
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions

DeviceInformationDisplay Class Reference

List of all members.

Public Member Functions

DeviceInformationDisplay (DeviceInformation deviceInfoIn)
string | GetPropertyForDisplay (string key)
void | Update (DeviceInformationUpdate deviceInfoUpdate)

Public Attributes

bool | CanPair = > DeviceInformation.Pairing.CanPair
string | Id = > DeviceInformation.Id
bool | IsPaired = > DeviceInformation.Pairing.IsPaired
DeviceInformationKind | Kind = > DeviceInformation.Kind
string | Name = > DeviceInformation.Name
IReadOnlyDictionary< string,
object > 		Properties = > DeviceInformation.Properties

Protected Member Functions

void | OnPropertyChanged (string name)

Properties

DeviceInformation | DeviceInformation [get, set]
BitmapImage | GlyphBitmapImage [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

async void | UpdateGlyphBitmapImage ()

Detailed Description

Definition at line 247 of file DisplayHelpers.cs.

Constructor & Destructor Documentation

DeviceInformationDisplay ( DeviceInformation deviceInfoIn ) [inline]

Definition at line 249 of file DisplayHelpers.cs.

        {
            DeviceInformation = deviceInfoIn;
            UpdateGlyphBitmapImage();
        }

Member Function Documentation

string GetPropertyForDisplay ( string key )
void OnPropertyChanged ( string name ) [protected]
void Update ( DeviceInformationUpdate deviceInfoUpdate ) [inline]

Definition at line 264 of file DisplayHelpers.cs.

        {
            DeviceInformation.Update(deviceInfoUpdate);

            OnPropertyChanged("Kind");
            OnPropertyChanged("Id");
            OnPropertyChanged("Name");
            OnPropertyChanged("DeviceInformation");
            OnPropertyChanged("CanPair");
            OnPropertyChanged("IsPaired");
            OnPropertyChanged("GetPropertyForDisplay");

            UpdateGlyphBitmapImage();
        }

void UpdateGlyphBitmapImage ( ) [inline, private]

Definition at line 281 of file DisplayHelpers.cs.

        {
            DeviceThumbnail deviceThumbnail = await DeviceInformation.GetGlyphThumbnailAsync();
            BitmapImage glyphBitmapImage = new BitmapImage();
            await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
            GlyphBitmapImage = glyphBitmapImage;
            OnPropertyChanged("GlyphBitmapImage");
        }

Member Data Documentation

bool CanPair = > DeviceInformation.Pairing.CanPair

Definition at line 259 of file DisplayHelpers.cs.

string Id = > DeviceInformation.Id

Definition at line 256 of file DisplayHelpers.cs.

bool IsPaired = > DeviceInformation.Pairing.IsPaired

Definition at line 260 of file DisplayHelpers.cs.

DeviceInformationKind Kind = > DeviceInformation.Kind

Definition at line 255 of file DisplayHelpers.cs.

string Name = > DeviceInformation.Name

Definition at line 257 of file DisplayHelpers.cs.

IReadOnlyDictionary<string, object> Properties = > DeviceInformation.Properties

Definition at line 261 of file DisplayHelpers.cs.

Property Documentation

DeviceInformation DeviceInformation [get, set]

Definition at line 262 of file DisplayHelpers.cs.

BitmapImage GlyphBitmapImage [get, set]

Definition at line 258 of file DisplayHelpers.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 290 of file DisplayHelpers.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/DisplayHelpers.cs
  • DeviceEnumerationAndPairing/cpp/DisplayHelpers.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceInformationKindChoice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceInformationKindChoice
Properties

DeviceInformationKindChoice Struct Reference

List of all members.

Properties

DeviceInformationKind[] | DeviceInformationKinds [get, set]
string | DisplayName [get, set]

Detailed Description

Definition at line 207 of file DisplayHelpers.cs.

Property Documentation

DeviceInformationKind [] DeviceInformationKinds [get, set]

Definition at line 210 of file DisplayHelpers.cs.

string DisplayName [get, set]

Definition at line 209 of file DisplayHelpers.cs.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cs/DisplayHelpers.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceIO Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceIO
Public Member Functions | Private Member Functions | Private Attributes

DeviceIO Class Reference

List of all members.

Public Member Functions

DeviceIO ()

Private Member Functions

async void | DeviceIOGet_Click (object sender, RoutedEventArgs e)
async void | DeviceIOSet_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario3_DeviceIO.xaml.cs.

Constructor & Destructor Documentation

DeviceIO ( ) [inline]

Definition at line 22 of file Scenario3_DeviceIO.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DeviceIOGet_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario3_DeviceIO.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            byte[] outputBuffer = new byte[1];

            try
            {
                await fx2Device.SendIOControlAsync(Fx2Driver.GetSevenSegmentDisplay,
                                                   null,
                                                   outputBuffer.AsBuffer());

                rootPage.NotifyUser($"The segment display value is {Fx2Driver.SevenSegmentToDigit(outputBuffer[0])}", NotifyType.StatusMessage);
            }
            catch (ArgumentException)
            {
                rootPage.NotifyUser("The segment display value is not yet initialized", NotifyType.StatusMessage);
            }
            catch (Exception exception)
            {
                rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
            }
        }

async void DeviceIOSet_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 58 of file Scenario3_DeviceIO.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            byte val = (byte)(DeviceIOSegmentInput.SelectedIndex + 1);

            byte[] input = new byte[] { Fx2Driver.DigitToSevenSegment(val) };

            try
            {
                await fx2Device.SendIOControlAsync(
                                    Fx2Driver.SetSevenSegmentDisplay,
                                    input.AsBuffer(),
                                    null
                                    );

                rootPage.NotifyUser($"The segment display is set to {val}", NotifyType.StatusMessage);
            }
            catch (Exception exception)
            {
                rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario3_DeviceIO.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario3_DeviceIO.xaml.cs
  • CustomCapability/cpp/Scenario3_DeviceIO.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceList
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

DeviceList Class Reference

#include "DeviceList.h"

List of all members.

Public Member Functions

void | ClearSelectedDevice ()
void | ClearSelectedDevice ()
Windows::Devices::Custom::CustomDevice | GetSelectedDevice ()
CustomDevice | GetSelectedDevice ()
Platform::String | GetSelectedDeviceId ()
string | GetSelectedDeviceId ()
void | SetSelectedDevice (string Id, CustomDevice Device)
void | SetSelectedDevice (Platform::String^id, Windows::Devices::Custom::CustomDevice^device)
void | StartFx2Watcher ()
void | StartFx2Watcher ()
void | StopFx2Watcher ()
void | StopFx2Watcher ()

Static Public Member Functions

static void | CreateBooleanTable (Windows::UI::Xaml::Documents::InlineCollection^Table, const Platform::Array< bool >^NewValues, const Platform::Array< bool >^OldValues, Platform::String^IndexTitle, Platform::String^ValueTitle, Platform::String^TrueValue, Platform::String^FalseValue)
static void | CreateBooleanTable (InlineCollection Table, bool[] NewValues, bool[] OldValues, string IndexTitle, string ValueTitle, string TrueValue, string FalseValue)

Public Attributes

ObservableCollection
< DeviceListEntry > 		Fx2Devices = > m_Fx2Devices
bool | WatcherStarted = false

Properties

static DeviceList | Current [get, set]
event DeviceClosingHandler | DeviceClosing

Events

EventHandler | DeviceClosing

Private Member Functions

DeviceList ()
DeviceListEntry | FindDevice (Platform::String^Id)
DeviceListEntry | FindInList (string id)
void | InitDeviceWatcher ()
void | InitDeviceWatcher ()
async void | OnFx2Added (Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformation devInterface)
void | OnFx2Added (Windows::Devices::Enumeration::DeviceWatcher^Sender, Windows::Devices::Enumeration::DeviceInformation^DevInformation)
void | OnFx2EnumerationComplete (Windows::Devices::Enumeration::DeviceWatcher^Sender, Object^Args)
async void | OnFx2EnumerationComplete (Windows.Devices.Enumeration.DeviceWatcher sender, object args)
async void | OnFx2Removed (Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformationUpdate devInformation)
void | OnFx2Removed (Windows::Devices::Enumeration::DeviceWatcher^Sender, Windows::Devices::Enumeration::DeviceInformationUpdate^DevInformation)
void | ResumeDeviceWatcher (object sender, object e)
void | ResumeDeviceWatcher (Object^Sender, Object^Args)
void | SuspendDeviceWatcher (Object^Sender, Windows::ApplicationModel::SuspendingEventArgs^Args)
void | SuspendDeviceWatcher (object sender, SuspendingEventArgs e)

Static Private Member Functions

static | DeviceList ()

Private Attributes

Windows::Devices::Custom::CustomDevice | m_Fx2Device
CustomDevice | m_Fx2Device
Platform::String | m_Fx2DeviceId
string | m_Fx2DeviceId
ObservableCollection
< DeviceListEntry > 		m_Fx2Devices = new ObservableCollection<DeviceListEntry>()
Windows.Devices.Enumeration.DeviceWatcher | m_Fx2Watcher = null
Windows::Devices::Enumeration::DeviceWatcher | m_Fx2Watcher
Platform::Collections::Vector
< DeviceListEntry^> 		m_List
bool | m_WatcherStarted
bool | m_WatcherSuspended = false

Static Private Attributes

static DeviceList | _Current = nullptr

Detailed Description

Definition at line 38 of file DeviceList.h.

Constructor & Destructor Documentation

DeviceList ( ) [private]

Definition at line 30 of file DeviceList.cpp.

                       : m_WatcherStarted(false), m_WatcherSuspended(false)
{
    m_Fx2Watcher = nullptr;
    m_List = ref new Vector<DeviceListEntry^>();
    InitDeviceWatcher();

    // Register for app suspend/resume handlers
    App::Current->Suspending += ref new SuspendingEventHandler(this, &DeviceList::SuspendDeviceWatcher);
    App::Current->Resuming += ref new EventHandler<Object^>(this, &DeviceList::ResumeDeviceWatcher);
}

static DeviceList ( ) [inline, static, private]

Definition at line 58 of file DeviceList.cs.

        {
            DeviceList.Current = new DeviceList();
            DeviceList.Current.InitDeviceWatcher();

            // Register for app suspend/resume handlers
            App.Current.Suspending += new SuspendingEventHandler(DeviceList.Current.SuspendDeviceWatcher);
            App.Current.Resuming += DeviceList.Current.ResumeDeviceWatcher;
        }

Member Function Documentation

void ClearSelectedDevice ( ) [inline]

Definition at line 72 of file DeviceList.h.

        {
            SetSelectedDevice(nullptr, nullptr);
        }

void ClearSelectedDevice ( ) [inline]

Definition at line 100 of file DeviceList.cs.

        {
            SetSelectedDevice(null, null);
        }

static void CreateBooleanTable | ( | InlineCollection | Table,
 |  | bool[] | NewValues,
 |  | bool[] | OldValues,
 |  | string | IndexTitle,
 |  | string | ValueTitle,
 |  | string | TrueValue,
 |  | string | FalseValue |
 | ) |  |  | [inline, static]

Definition at line 131 of file DeviceList.cs.

        {
            Table.Clear();

            for (var i = 0; i < NewValues.Length; i += 1)
            {
                var line = new Span();
                var block = new Run();
                block.Text = (i + 1).ToString("###");
                line.Inlines.Add(block);

                block = new Run();
                block.Text = "    ";
                line.Inlines.Add(block);

                block = new Run();
                block.Text = NewValues[i] ? TrueValue : FalseValue;

                if ((OldValues != null) && (OldValues[i] != NewValues[i]))
                {
                    var bold = new Bold();
                    bold.Inlines.Add(block);
                    line.Inlines.Add(bold);
                }
                else
                {
                    line.Inlines.Add(block);
                }

                line.Inlines.Add(new LineBreak());

                Table.Add(line);
            }
        }

static void CreateBooleanTable | ( | Windows::UI::Xaml::Documents::InlineCollection^ | Table,
 |  | const Platform::Array< bool >^ | NewValues,
 |  | const Platform::Array< bool >^ | OldValues,
 |  | Platform::String^ | IndexTitle,
 |  | Platform::String^ | ValueTitle,
 |  | Platform::String^ | TrueValue,
 |  | Platform::String^ | FalseValue |
 | ) |  |  | [static]
DeviceListEntry FindDevice ( Platform::String^ Id ) [private]
DeviceListEntry FindInList ( string id ) [inline, private]

Definition at line 297 of file DeviceList.cs.

        {
            return m_Fx2Devices.FirstOrDefault(entry => entry.Id == id);
        }

Windows::Devices::Custom::CustomDevice GetSelectedDevice ( ) [inline]

Definition at line 51 of file DeviceList.h.

        {
            return m_Fx2Device;
        }

CustomDevice GetSelectedDevice ( ) [inline]

Definition at line 80 of file DeviceList.cs.

        {
            return m_Fx2Device;
        }

Platform::String GetSelectedDeviceId ( ) [inline]

Definition at line 56 of file DeviceList.h.

        {
            return m_Fx2DeviceId;
        }

string GetSelectedDeviceId ( ) [inline]

Definition at line 85 of file DeviceList.cs.

        {
            return m_Fx2DeviceId;
        }

void InitDeviceWatcher ( ) [private]

Definition at line 41 of file DeviceList.cpp.

{
    // Define the selector to enumerate all of the fx2 device interface class instances.
    // Use the DeviceInterfaceGuid provided by the driver (Fx2Driver, in this case).
    auto selector = CustomDevice::GetDeviceSelector(Fx2Driver::DeviceInterfaceGuid);

    // Set of properties to retrieve
    auto properties = ref new Vector<String^>({ "System.Devices.DeviceInstanceId" });

    // Create a device watcher to look for instances of the fx2 device interface.
    m_Fx2Watcher = DeviceInformation::CreateWatcher(selector, properties);

    m_Fx2Watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(this, &DeviceList::OnFx2Added);
    m_Fx2Watcher->Removed += ref new TypedEventHandler<DeviceWatcher^, DeviceInformationUpdate^>(this, &DeviceList::OnFx2Removed);
    m_Fx2Watcher->EnumerationCompleted += ref new TypedEventHandler<DeviceWatcher^, Object^>(this, &DeviceList::OnFx2EnumerationComplete);
}

void InitDeviceWatcher ( ) [inline, private]

Definition at line 190 of file DeviceList.cs.

        {
            // Define the selector to enumerate all of the fx2 device interface class instances
            var selector = CustomDevice.GetDeviceSelector(Fx2Driver.DeviceInterfaceGuid);

            // Create a device watcher to look for instances of the fx2 device interface
            m_Fx2Watcher = Windows.Devices.Enumeration.DeviceInformation.CreateWatcher(
                            selector,
                            new string[] { "System.Devices.DeviceInstanceId" }
                            );

            m_Fx2Watcher.Added += OnFx2Added;
            m_Fx2Watcher.Removed += OnFx2Removed;
            m_Fx2Watcher.EnumerationCompleted += OnFx2EnumerationComplete;
        }

async void OnFx2Added | ( | Windows.Devices.Enumeration.DeviceWatcher | sender,
 |  | Windows.Devices.Enumeration.DeviceInformation | devInterface |
 | ) |  |  | [inline, private]

Event handler for arrival of Fx2 devices.

Parameters:
sender
devInterface The device interface which was added

Definition at line 211 of file DeviceList.cs.

        {
            await
            MainPage.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    MainPage.Current.NotifyUser(String.Format("OnFx2Added: {0}", devInterface.Id), NotifyType.StatusMessage);

                    // search the device list for a device with a matching interface ID
                    DeviceListEntry match = FindInList(devInterface.Id);

                    // If we found a match then mark it as verified and return
                    if (match != null)
                    {
                        match.Matched = true;
                        return;
                    }

                    // Create a new element for this device interface, and queue up the query of its
                    // device information
                    match = new DeviceListEntry(devInterface);

                    // Add the new element to the end of the list of devices
                    m_Fx2Devices.Add(match);
                }
            );
        }

void OnFx2Added | ( | Windows::Devices::Enumeration::DeviceWatcher^ | Sender,
 |  | Windows::Devices::Enumeration::DeviceInformation^ | DevInformation |
 | ) |  |  | [private]
async void OnFx2EnumerationComplete | ( | Windows.Devices.Enumeration.DeviceWatcher | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Event handler for the end of an enumeration/reenumeration started by calling Start on the device watcher.

This culls out any entries in the list which are no longer matched.

Parameters:
sender
args

Definition at line 275 of file DeviceList.cs.

        {
            await
            MainPage.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    MainPage.Current.NotifyUser(String.Format("OnFx2EnumerationComplete"), NotifyType.StatusMessage);

                    DeviceListEntry removedDevice;

                    while ((removedDevice = m_Fx2Devices.FirstOrDefault(e => !e.Matched)) != null)
                    {
                        MainPage.Current.NotifyUser("OnFx2EnumerationComplete: Removing missing device " + removedDevice.Id, NotifyType.StatusMessage);
                        m_Fx2Devices.Remove(removedDevice);
                    }
                }
            );
        }

void OnFx2EnumerationComplete | ( | Windows::Devices::Enumeration::DeviceWatcher^ | Sender,
 |  | Object^ | Args |
 | ) |  |  | [private]
async void OnFx2Removed | ( | Windows.Devices.Enumeration.DeviceWatcher | sender,
 |  | Windows.Devices.Enumeration.DeviceInformationUpdate | devInformation |
 | ) |  |  | [inline, private]

Event handler for the removal of an Fx2 device.

Parameters:
sender
devInformation The device interface that was removed

Definition at line 246 of file DeviceList.cs.

        {
            await
            MainPage.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    var deviceId = devInformation.Id;
                    MainPage.Current.NotifyUser(String.Format("OnFx2Removed: {0}", deviceId), NotifyType.StatusMessage);

                    // Search the list of devices for one with a matching ID
                    var match = FindInList(deviceId);
                    if (match != null)
                    {
                        // Remove the matched item
                        MainPage.Current.NotifyUser(String.Format("OnFx2Removed: {0} removed", deviceId), NotifyType.StatusMessage);
                        m_Fx2Devices.Remove(match);
                    }
                }
            );
        }

void OnFx2Removed | ( | Windows::Devices::Enumeration::DeviceWatcher^ | Sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate^ | DevInformation |
 | ) |  |  | [private]
void ResumeDeviceWatcher | ( | Object^ | Sender,
 |  | Object^ | Args |
 | ) |  |  | [private]

Definition at line 238 of file DeviceList.cpp.

{
    if (m_WatcherSuspended)
    {
        m_WatcherSuspended = false;
        StartFx2Watcher();
    }
}

void ResumeDeviceWatcher | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 311 of file DeviceList.cs.

        {
            if (m_WatcherSuspended)
            {
                StartFx2Watcher();
                m_WatcherSuspended = false;
            }
        }

void SetSelectedDevice | ( | string | Id,
 |  | CustomDevice | Device |
 | ) |  |  | [inline]

Definition at line 90 of file DeviceList.cs.

        {
            if ((m_Fx2Device != null) && (this.DeviceClosing != null))
            {
                this.DeviceClosing(this, new EventArgs());
            }
            m_Fx2Device = Device;
            m_Fx2DeviceId = Id;
        }

void SetSelectedDevice | ( | Platform::String^ | id,
 |  | Windows::Devices::Custom::CustomDevice^ | device |
 | ) |  |  | [inline]

Definition at line 61 of file DeviceList.h.

        {
            if (m_Fx2Device != nullptr)
            {
                DeviceClosing(this, m_Fx2Device);
            }

            m_Fx2Device = device;
            m_Fx2DeviceId = id;
        }

void StartFx2Watcher ( ) [inline]

Definition at line 110 of file DeviceList.cs.

        {
            MainPage.Current.NotifyUser("starting device watcher", NotifyType.StatusMessage);
            foreach (var entry in m_Fx2Devices)
            {
                entry.Matched = false;
            }

            WatcherStarted = true;
            m_Fx2Watcher.Start();

            return;
        }

void StartFx2Watcher ( )

Definition at line 58 of file DeviceList.cpp.

{
    MainPage::Current->NotifyUser("starting device watcher", NotifyType::StatusMessage);

    std::for_each(
        begin(m_List),
        end(m_List),
        [](DeviceListEntry^ Entry) {
        Entry->Matched = false;
    });

    WatcherStarted = true;
    m_Fx2Watcher->Start();
}

void StopFx2Watcher ( ) [inline]

Definition at line 124 of file DeviceList.cs.

        {
            MainPage.Current.NotifyUser("stopping fx2 watcher", NotifyType.StatusMessage);
            m_Fx2Watcher.Stop();
            WatcherStarted = false;
        }

void StopFx2Watcher ( )

Definition at line 73 of file DeviceList.cpp.

{
    MainPage::Current->NotifyUser("stopping fx2 watcher", NotifyType::StatusMessage);
    m_Fx2Watcher->Stop();
    WatcherStarted = false;
}

void SuspendDeviceWatcher | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 302 of file DeviceList.cs.

        {
            if (WatcherStarted)
            {
                m_WatcherSuspended = WatcherStarted;
                StopFx2Watcher();
            }
        }

void SuspendDeviceWatcher | ( | Object^ | Sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | Args |
 | ) |  |  | [private]

Member Data Documentation

DeviceList _Current = nullptr [static, private]

Definition at line 106 of file DeviceList.h.

ObservableCollection<DeviceListEntry> Fx2Devices = > m_Fx2Devices

List of Fx2 devices currently attached to the system.

This list can be updated by the PNP watcher.

Definition at line 72 of file DeviceList.cs.

Windows::Devices::Custom::CustomDevice m_Fx2Device [private]

Definition at line 111 of file DeviceList.h.

CustomDevice m_Fx2Device [private]

The currently opened Fx2 device.

Definition at line 77 of file DeviceList.cs.

Platform::String m_Fx2DeviceId [private]

Definition at line 112 of file DeviceList.h.

string m_Fx2DeviceId [private]

Definition at line 78 of file DeviceList.cs.

ObservableCollection<DeviceListEntry> m_Fx2Devices = new ObservableCollection<DeviceListEntry>() [private]

Internal list of devices.

Definition at line 188 of file DeviceList.cs.

Windows::Devices::Enumeration::DeviceWatcher m_Fx2Watcher [private]

Definition at line 107 of file DeviceList.h.

Windows.Devices.Enumeration.DeviceWatcher m_Fx2Watcher = null [private]

The device watcher that we setup to look for Fx2 devices.

Definition at line 183 of file DeviceList.cs.

Platform::Collections::Vector<DeviceListEntry^> m_List [private]

Definition at line 109 of file DeviceList.h.

bool m_WatcherStarted [private]

Definition at line 115 of file DeviceList.h.

bool m_WatcherSuspended = false [private]

Definition at line 114 of file DeviceList.h.

bool WatcherStarted = false

Flag to keep track of whether the device watcher has been started.

Definition at line 108 of file DeviceList.cs.

Property Documentation

DeviceList Current [static, get, set]

Definition at line 56 of file DeviceList.cs.

event DeviceClosingHandler DeviceClosing

Definition at line 103 of file DeviceList.h.

Event Documentation

EventHandler DeviceClosing

Definition at line 174 of file DeviceList.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cpp/DeviceList.h
  • CustomCapability/cs/DeviceList.cs
  • CustomCapability/cpp/DeviceList.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceListEntry
Public Member Functions | Public Attributes

DeviceListEntry Class Reference

List of all members.

Public Member Functions

DeviceListEntry (Windows.Devices.Enumeration.DeviceInformation DeviceInterface)

Public Attributes

Windows.Devices.Enumeration.DeviceInformation | Device
string | Id = > Device.Id
string | InstanceId = "System.Devices.DeviceInstanceId"]
bool | Matched = true

Detailed Description

Definition at line 22 of file DeviceList.cs.

Constructor & Destructor Documentation

DeviceListEntry ( Windows.Devices.Enumeration.DeviceInformation DeviceInterface ) [inline]

Constructor.

Parameters:
DeviceInterface The device interface for this entry

Definition at line 48 of file DeviceList.cs.

        {
            this.Device = DeviceInterface;
        }

Member Data Documentation

Windows.Devices.Enumeration.DeviceInformation Device

The DeviceInformation object (device interface) for this Fx2 device.

Definition at line 27 of file DeviceList.cs.

string Id = > Device.Id

The device interface path.

Definition at line 32 of file DeviceList.cs.

string InstanceId = "System.Devices.DeviceInstanceId"]

The device's instance ID.

Definition at line 37 of file DeviceList.cs.

bool Matched = true

Has the device been found during the current enumeration.

Definition at line 42 of file DeviceList.cs.

The documentation for this class was generated from the following file:
  • CustomCapability/cs/DeviceList.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceReadWrite Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceReadWrite
Public Member Functions | Private Member Functions | Private Attributes

DeviceReadWrite Class Reference

List of all members.

Public Member Functions

DeviceReadWrite ()

Private Member Functions

void | LogMessage (string message)
async void | ReadBlock_Click (object sender, RoutedEventArgs e)
async void | WriteBlock_Click (object sender, RoutedEventArgs e)

Private Attributes

int | readCounter = 0
MainPage rootPage = MainPage.Current
int | writeCounter = 0

Detailed Description

Definition at line 20 of file Scenario5_DeviceReadWrite.xaml.cs.

Constructor & Destructor Documentation

DeviceReadWrite ( ) [inline]

Definition at line 24 of file Scenario5_DeviceReadWrite.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void LogMessage ( string message ) [inline, private]

Definition at line 91 of file Scenario5_DeviceReadWrite.xaml.cs.

        {
            var span = new Span();
            var run = new Run();
            run.Text = message;

            span.Inlines.Add(run);
            span.Inlines.Add(new LineBreak());

            OutputText.Inlines.Insert(0, span);
        }

async void ReadBlock_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario5_DeviceReadWrite.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            var button = (Button)sender;
            button.IsEnabled = false;

            var dataReader = new DataReader(fx2Device.InputStream);

            int counter = readCounter++;
            LogMessage($"Read {counter} begin");

            // load the data reader from the stream.  For purposes of this
            // sample, assume all messages read are < 64 bytes

            await dataReader.LoadAsync(64);

            // Get the message string out of the buffer
            var message = dataReader.ReadString(dataReader.UnconsumedBufferLength);

            LogMessage($"Read {counter} end: {message}");

            button.IsEnabled = true;
        }

async void WriteBlock_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario5_DeviceReadWrite.xaml.cs.

        {
            var fx2Device = DeviceList.Current.GetSelectedDevice();

            if (fx2Device == null)
            {
                rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
                return;
            }

            var button = (Button)sender;
            button.IsEnabled = false;

            // Generate a string to write to the device
            var counter = writeCounter++;

            // Use a data writer to convert the string into a buffer
            var dataWriter = new DataWriter();
            var msg = "This is message " + counter;
            dataWriter.WriteString(msg);

            LogMessage($"Write {counter} begin: {msg}");
            var bytesRead = await fx2Device.OutputStream.WriteAsync(dataWriter.DetachBuffer());
            LogMessage($"Write {counter} end: {bytesRead} bytes written");

            button.IsEnabled = true;
        }

Member Data Documentation

int readCounter = 0 [private]

Definition at line 30 of file Scenario5_DeviceReadWrite.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario5_DeviceReadWrite.xaml.cs.

int writeCounter = 0 [private]

Definition at line 29 of file Scenario5_DeviceReadWrite.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario5_DeviceReadWrite.xaml.cs
  • CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceSelectorInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceSelectorInfo
Properties

DeviceSelectorInfo Class Reference

List of all members.

Properties

DeviceClass | DeviceClassSelector [get, set]
string | DisplayName [get, set]
DeviceInformationKind | Kind = DeviceClass.All [get, set]
string | Selector = DeviceInformationKind.Unknown [get, set]

Detailed Description

Definition at line 24 of file DisplayHelpers.cs.

Property Documentation

DeviceClass DeviceClassSelector [get, set]

Definition at line 27 of file DisplayHelpers.cs.

string DisplayName [get, set]

Definition at line 26 of file DisplayHelpers.cs.

DeviceInformationKind Kind = DeviceClass.All [get, set]

Definition at line 28 of file DisplayHelpers.cs.

string Selector = DeviceInformationKind.Unknown [get, set]

Definition at line 29 of file DisplayHelpers.cs.

The documentation for this class was generated from the following file:
  • DeviceEnumerationAndPairing/cs/DisplayHelpers.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceWatcherHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DeviceWatcherHelper
Public Member Functions | Public Attributes | Events | Private Member Functions | Static Private Member Functions | Private Attributes

DeviceWatcherHelper Class Reference

Updates an ObservableCollection based on events from a DeviceWatcher. More...

List of all members.

Public Member Functions

DeviceWatcherHelper (ObservableCollection< DeviceInformationDisplay > resultCollection, CoreDispatcher dispatcher)
delegate void | DeviceChangedHandler (DeviceWatcher deviceWatcher, string id)
bool | IsWatcherRunning ()
void | Reset ()
void | StartWatcher (DeviceWatcher deviceWatcher)
void | StopWatcher ()

Public Attributes

DeviceWatcher DeviceWatcher = > deviceWatcher
bool | UpdateStatus = true

Events

DeviceChangedHandler | DeviceChanged

Private Member Functions

void | RaiseDeviceChanged (DeviceWatcher sender, string id)
async void | Watcher_DeviceAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
async void | Watcher_DeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
async void | Watcher_DeviceUpdated (DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
async void | Watcher_EnumerationCompleted (DeviceWatcher sender, object obj)
async void | Watcher_Stopped (DeviceWatcher sender, object obj)

Static Private Member Functions

static bool | IsWatcherStarted (DeviceWatcher watcher)

Private Attributes

DeviceWatcher | deviceWatcher = null
CoreDispatcher | dispatcher
ObservableCollection
< DeviceInformationDisplay > 		resultCollection

Detailed Description

Encapsulates the work necessary to register for watcher events, start and stop the watcher, handle race conditions, and break cycles.

Definition at line 18 of file DeviceWatcherHelper.cs.

Constructor & Destructor Documentation

DeviceWatcherHelper | ( | ObservableCollection< DeviceInformationDisplay > | resultCollection,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 20 of file DeviceWatcherHelper.cs.

        {
            this.resultCollection = resultCollection;
            this.dispatcher = dispatcher;
        }

Member Function Documentation

delegate void DeviceChangedHandler | ( | DeviceWatcher | deviceWatcher,
 |  | string | id
 | ) |  |
bool IsWatcherRunning ( ) [inline]

Definition at line 82 of file DeviceWatcherHelper.cs.

        {
            if (deviceWatcher == null)
            {
                return false;
            }

            DeviceWatcherStatus status = deviceWatcher.Status;
            return (status == DeviceWatcherStatus.Started) ||
                (status == DeviceWatcherStatus.EnumerationCompleted) ||
                (status == DeviceWatcherStatus.Stopping);
        }

static bool IsWatcherStarted ( DeviceWatcher watcher ) [inline, static, private]

Definition at line 76 of file DeviceWatcherHelper.cs.

        {
            return (watcher.Status == DeviceWatcherStatus.Started) ||
                (watcher.Status == DeviceWatcherStatus.EnumerationCompleted);
        }

void RaiseDeviceChanged | ( | DeviceWatcher | sender,
 |  | string | id |
 | ) |  |  | [inline, private]

Definition at line 172 of file DeviceWatcherHelper.cs.

        {
            if (UpdateStatus)
            {
                // Display a default status message.
                string message = string.Empty;
                switch (sender.Status)
                {
                    case DeviceWatcherStatus.Started:
                        message = $"{resultCollection.Count} devices found.";
                        break;

                    case DeviceWatcherStatus.EnumerationCompleted:
                        message = $"{resultCollection.Count} devices found. Enumeration completed. Watching for updates...";
                        break;

                    case DeviceWatcherStatus.Stopped:
                        message = $"{resultCollection.Count} devices found. Watcher stopped.";
                        break;

                    case DeviceWatcherStatus.Aborted:
                        message = $"{resultCollection.Count} devices found. Watcher aborted.";
                        break;
                }

                if (!string.IsNullOrEmpty(message))
                {
                    MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
                }
            }

            DeviceChanged?.Invoke(sender, id);
        }

void Reset ( ) [inline]

Definition at line 63 of file DeviceWatcherHelper.cs.

        {
            if (deviceWatcher != null)
            {
                StopWatcher();
                deviceWatcher = null;
            }
        }

void StartWatcher ( DeviceWatcher deviceWatcher ) [inline]

Definition at line 34 of file DeviceWatcherHelper.cs.

        {
            this.deviceWatcher = deviceWatcher;

            // Connect events to update our collection as the watcher report results.
            deviceWatcher.Added += Watcher_DeviceAdded;
            deviceWatcher.Updated += Watcher_DeviceUpdated;
            deviceWatcher.Removed += Watcher_DeviceRemoved;
            deviceWatcher.EnumerationCompleted += Watcher_EnumerationCompleted;
            deviceWatcher.Stopped += Watcher_Stopped;

            deviceWatcher.Start();
        }

void StopWatcher ( ) [inline]

Definition at line 48 of file DeviceWatcherHelper.cs.

        {
            // Since the device watcher runs in the background, it is possible that
            // a notification is "in flight" at the time we stop the watcher.
            // In other words, it is possible for the watcher to become stopped while a
            // handler is running, or for a handler to run after the watcher has stopped.

            if (IsWatcherStarted(deviceWatcher))
            {
                // We do not null out the deviceWatcher yet because we want to receive
                // the Stopped event.
                deviceWatcher.Stop();
            }
        }

async void Watcher_DeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Definition at line 95 of file DeviceWatcherHelper.cs.

        {
            // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
            await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                // Watcher may have stopped while we were waiting for our chance to run.
                if (IsWatcherStarted(sender))
                {
                    resultCollection.Add(new DeviceInformationDisplay(deviceInfo));
                    RaiseDeviceChanged(sender, deviceInfo.Id);
                }
            });
        }

async void Watcher_DeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 133 of file DeviceWatcherHelper.cs.

        {
            // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
            await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                // Watcher may have stopped while we were waiting for our chance to run.
                if (IsWatcherStarted(sender))
                {
                    // Find the corresponding DeviceInformation in the collection and remove it
                    foreach (DeviceInformationDisplay deviceInfoDisp in resultCollection)
                    {
                        if (deviceInfoDisp.Id == deviceInfoUpdate.Id)
                        {
                            resultCollection.Remove(deviceInfoDisp);
                            break;
                        }
                    }

                    RaiseDeviceChanged(sender, deviceInfoUpdate.Id);
                }
            });
        }

async void Watcher_DeviceUpdated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 109 of file DeviceWatcherHelper.cs.

        {
            // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
            await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                // Watcher may have stopped while we were waiting for our chance to run.
                if (IsWatcherStarted(sender))
                {
                    // Find the corresponding updated DeviceInformation in the collection and pass the update object
                    // to the Update method of the existing DeviceInformation. This automatically updates the object
                    // for us.
                    foreach (DeviceInformationDisplay deviceInfoDisp in resultCollection)
                    {
                        if (deviceInfoDisp.Id == deviceInfoUpdate.Id)
                        {
                            deviceInfoDisp.Update(deviceInfoUpdate);
                            RaiseDeviceChanged(sender, deviceInfoUpdate.Id);
                            break;
                        }
                    }
                }
            });
        }

async void Watcher_EnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | obj |
 | ) |  |  | [inline, private]

Definition at line 156 of file DeviceWatcherHelper.cs.

        {
            await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                RaiseDeviceChanged(sender, string.Empty);
            });
        }

async void Watcher_Stopped | ( | DeviceWatcher | sender,
 |  | object | obj |
 | ) |  |  | [inline, private]

Definition at line 164 of file DeviceWatcherHelper.cs.

        {
            await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                RaiseDeviceChanged(sender, string.Empty);
            });
        }

Member Data Documentation

DeviceWatcher DeviceWatcher = > deviceWatcher

Definition at line 31 of file DeviceWatcherHelper.cs.

DeviceWatcher deviceWatcher = null [private]

Definition at line 72 of file DeviceWatcherHelper.cs.

CoreDispatcher dispatcher [private]

Definition at line 74 of file DeviceWatcherHelper.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection [private]

Definition at line 73 of file DeviceWatcherHelper.cs.

bool UpdateStatus = true

Definition at line 32 of file DeviceWatcherHelper.cs.

Event Documentation

DeviceChangedHandler DeviceChanged

Definition at line 29 of file DeviceWatcherHelper.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/DeviceWatcherHelper.cs
  • DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DiscoveredDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DiscoveredDevice
Public Member Functions | Public Attributes | Properties | Events

DiscoveredDevice Class Reference

List of all members.

Public Member Functions

DiscoveredDevice (DeviceInformation deviceInfo)
override string | ToString ()
void | UpdateDeviceInfo (DeviceInformationUpdate update)

Public Attributes

string | DisplayName = " - " + (DeviceInfo.Pairing.IsPaired ? "Paired" : "Unpaired")

Properties

DeviceInformation | DeviceInfo [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Detailed Description

Definition at line 95 of file SocketReaderWriter.cs.

Constructor & Destructor Documentation

DiscoveredDevice ( DeviceInformation deviceInfo ) [inline]

Definition at line 99 of file SocketReaderWriter.cs.

        {
            DeviceInfo = deviceInfo;
        }

Member Function Documentation

override string ToString ( )
void UpdateDeviceInfo ( DeviceInformationUpdate update ) [inline]

Definition at line 107 of file SocketReaderWriter.cs.

        {
            DeviceInfo.Update(update);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("DisplayName"));
        }

Member Data Documentation

string DisplayName = " - " + (DeviceInfo.Pairing.IsPaired ? "Paired" : "Unpaired")

Definition at line 104 of file SocketReaderWriter.cs.

Property Documentation

DeviceInformation DeviceInfo [get, set]

Definition at line 97 of file SocketReaderWriter.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 113 of file SocketReaderWriter.cs.

The documentation for this class was generated from the following file:
  • WiFiDirect/cs/SocketReaderWriter.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DownloadOperationItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • DownloadOperationItem
Public Member Functions | Properties | Events | Private Attributes

DownloadOperationItem Class Reference

List of all members.

Public Member Functions

DownloadOperationItem (DownloadOperation download)

Properties

DownloadOperation | download [get]
int | percentComplete [get, set]
string | stateText [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Attributes

DownloadOperation | _download
int | _percentComplete
string | _stateText

Detailed Description

Definition at line 31 of file Scenario7_DownloadReordering.xaml.cs.

Constructor & Destructor Documentation

DownloadOperationItem ( DownloadOperation download ) [inline]

Definition at line 33 of file Scenario7_DownloadReordering.xaml.cs.

        {
            _download = download;
            _percentComplete = 0;
            _stateText = "Idle";
        }

Member Data Documentation

DownloadOperation _download [private]

Definition at line 84 of file Scenario7_DownloadReordering.xaml.cs.

int _percentComplete [private]

Definition at line 85 of file Scenario7_DownloadReordering.xaml.cs.

string _stateText [private]

Definition at line 86 of file Scenario7_DownloadReordering.xaml.cs.

Property Documentation

DownloadOperation download [get]

Definition at line 43 of file Scenario7_DownloadReordering.xaml.cs.

int percentComplete [get, set]

Definition at line 51 of file Scenario7_DownloadReordering.xaml.cs.

string stateText [get, set]

Definition at line 68 of file Scenario7_DownloadReordering.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 40 of file Scenario7_DownloadReordering.xaml.cs.

The documentation for this class was generated from the following file:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdgeTappedListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • EdgeTappedListView
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

EdgeTappedListView Class Reference

List of all members.

Public Member Functions

EdgeTappedListView ()
delegate void | ListViewEdgeTappedEventHandler (ListView sender, ListViewEdgeTappedEventArgs e)

Properties

bool | IsItemLeftEdgeTapEnabled [get, set]
Brush | LeftEdgeBrush [get, set]

Events

ListViewEdgeTappedEventHandler | ItemLeftEdgeTapped

Private Member Functions

void | ClearVisual ()
void | OnContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
void | OnPointerCaptureLost (object sender, PointerRoutedEventArgs e)
void | OnPointerExited (object sender, PointerRoutedEventArgs e)
void | OnPointerPressed (object sender, PointerRoutedEventArgs e)
void | OnPointerReleased (object sender, PointerRoutedEventArgs e)
void | ShowVisual ()

Private Attributes

const double | HIT_TARGET = 32
ListViewItem | listViewItemHighlighted = null
const string | VISUAL_INDICATOR_NAME = "VisualIndicator"
const double | VISUAL_INDICATOR_WIDTH = 12
Rectangle | visualIndicator

Detailed Description

Definition at line 30 of file EdgeTappedListView.cs.

Constructor & Destructor Documentation

EdgeTappedListView ( ) [inline]

Definition at line 43 of file EdgeTappedListView.cs.

        {
            this.ContainerContentChanging += OnContainerContentChanging;
            LeftEdgeBrush = Application.Current.Resources["SystemControlHighlightAltListAccentLowBrush"] as Brush;
        }

Member Function Documentation

void ClearVisual ( ) [inline, private]

Definition at line 147 of file EdgeTappedListView.cs.

        {
            if (listViewItemHighlighted != null)
            {
                if (visualIndicator != null)
                {
                    visualIndicator.Opacity = 0;
                    if (this.ItemLeftEdgeTapped != null)
                    {
                        ItemLeftEdgeTapped(this, new ListViewEdgeTappedEventArgs(listViewItemHighlighted));
                    }
                }
                listViewItemHighlighted = null;
            }
        }

delegate void ListViewEdgeTappedEventHandler | ( | ListView | sender,
 |  | ListViewEdgeTappedEventArgs | e
 | ) |  |
void OnContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 49 of file EdgeTappedListView.cs.

        {
            if (args.InRecycleQueue)
            {
                ListViewItem lvi = (args.ItemContainer as ListViewItem);
                if (lvi != null)
                {
                    UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
                    if (element != null)
                    {
                        element.PointerPressed -= OnPointerPressed;
                        element.PointerReleased -= OnPointerReleased;
                        element.PointerCaptureLost -= OnPointerCaptureLost;
                        element.PointerExited -= OnPointerExited;
                    }
                }
            }
            else if (args.Phase == 0)
            {
                ListViewItem lvi = (args.ItemContainer as ListViewItem);
                if (null != lvi)
                {
                    UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
                    if (null != element)
                    {
                        element.PointerPressed += OnPointerPressed;
                        element.PointerReleased += OnPointerReleased;
                        element.PointerCaptureLost += OnPointerCaptureLost;
                        element.PointerExited += OnPointerExited;
                    }
                }
            }
        }

void OnPointerCaptureLost | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file EdgeTappedListView.cs.

        {
            ClearVisual();
        }

void OnPointerExited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 112 of file EdgeTappedListView.cs.

        {
            ClearVisual();
        }

void OnPointerPressed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file EdgeTappedListView.cs.

        {
            if (IsItemLeftEdgeTapEnabled)
            {
                if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch)
                {
                    UIElement element = (sender as UIElement);
                    if (null != element)
                    {
                        PointerPoint pointerPoint = e.GetCurrentPoint(element);
                        if (pointerPoint.Position.X <= HIT_TARGET)
                        {
                            listViewItemHighlighted = VisualTreeHelper.GetParent(element) as ListViewItem;
                            ShowVisual();
                        }
                    }
                }
            }
        }

void OnPointerReleased | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file EdgeTappedListView.cs.

        {
            if (listViewItemHighlighted != null)
            {
                ClearVisual();
            }
        }

void ShowVisual ( ) [inline, private]

Definition at line 116 of file EdgeTappedListView.cs.

        {
            if (listViewItemHighlighted != null)
            {
                visualIndicator = listViewItemHighlighted.FindName(VISUAL_INDICATOR_NAME) as Rectangle;
                if (visualIndicator == null)
                {
                    visualIndicator = new Rectangle();
                    visualIndicator.Name = VISUAL_INDICATOR_NAME;
                    visualIndicator.Height = listViewItemHighlighted.ActualHeight;
                    visualIndicator.HorizontalAlignment = HorizontalAlignment.Left;
                    visualIndicator.Width = VISUAL_INDICATOR_WIDTH;
                    visualIndicator.Fill = LeftEdgeBrush;
                    visualIndicator.Margin = new Thickness(-(listViewItemHighlighted.Padding.Left), 0, 0, 0);
                    Panel panel = listViewItemHighlighted.ContentTemplateRoot as Panel;
                    if (panel != null)
                    {
                        var grid = panel as Grid;
                        if (grid != null)
                        {
                            visualIndicator.SetValue(Grid.RowSpanProperty, grid.RowDefinitions.Count);
                        }
                        panel.Children.Add(visualIndicator);
                    }
                }
                else
                {
                    visualIndicator.Opacity = 1;
                }
            }
        }

Member Data Documentation

const double HIT_TARGET = 32 [private]

Definition at line 32 of file EdgeTappedListView.cs.

ListViewItem listViewItemHighlighted = null [private]

Definition at line 35 of file EdgeTappedListView.cs.

const string VISUAL_INDICATOR_NAME = "VisualIndicator" [private]

Definition at line 34 of file EdgeTappedListView.cs.

const double VISUAL_INDICATOR_WIDTH = 12 [private]

Definition at line 33 of file EdgeTappedListView.cs.

Rectangle visualIndicator [private]

Definition at line 36 of file EdgeTappedListView.cs.

Property Documentation

bool IsItemLeftEdgeTapEnabled [get, set]

Definition at line 41 of file EdgeTappedListView.cs.

Brush LeftEdgeBrush [get, set]

Definition at line 40 of file EdgeTappedListView.cs.

Event Documentation

ListViewEdgeTappedEventHandler ItemLeftEdgeTapped

Definition at line 39 of file EdgeTappedListView.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/EdgeTappedListView.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnableHelloPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • EnableHelloPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

EnableHelloPage Class Reference

List of all members.

Public Member Functions

EnableHelloPage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< IBuffer > | CreatePassportKeyCredentialAsync ()
async void | LaunchHyperlink (object sender, RoutedEventArgs e)
async Task< bool > | RegisterPassportCredentialWithServerAsync (IBuffer publicKey)
void | SkipSetup ()
async void | StartUsingWindowsHello ()

Private Attributes

string | userId

Detailed Description

Definition at line 34 of file EnableHelloPage.xaml.cs.

Constructor & Destructor Documentation

EnableHelloPage ( ) [inline]

Definition at line 38 of file EnableHelloPage.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async Task<IBuffer> CreatePassportKeyCredentialAsync ( ) [inline, private]

Definition at line 98 of file EnableHelloPage.xaml.cs.

        {
            // Create a new KeyCredential for the user on the device.
            KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync(userId, KeyCredentialCreationOption.ReplaceExisting);
            if (keyCreationResult.Status == KeyCredentialStatus.Success)
            {
                // User has autheniticated with Windows Hello and the key credential is created.
                KeyCredential userKey = keyCreationResult.Credential;
                return userKey.RetrievePublicKey();
            }
            else if (keyCreationResult.Status == KeyCredentialStatus.NotFound)
            {
                MessageDialog message = new MessageDialog("To proceed, Windows Hello needs to be configured in Windows Settings (Accounts -> Sign-in options)");
                await message.ShowAsync();

                return null;
            }
            else if (keyCreationResult.Status == KeyCredentialStatus.UnknownError)
            {
                MessageDialog message = new MessageDialog("The key credential could not be created. Please try again.");
                await message.ShowAsync();

                return null;
            }

            return null;
        }

async void LaunchHyperlink | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 148 of file EnableHelloPage.xaml.cs.

        {
            var element = (FrameworkElement)sender;
            var target = (string)element.Tag;
            await Windows.System.Launcher.LaunchUriAsync(new Uri(target));

        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file EnableHelloPage.xaml.cs.

        {
            userId = e.Parameter.ToString();
            WelcomeUserId.Text = userId;
        }

async Task<bool> RegisterPassportCredentialWithServerAsync ( IBuffer publicKey ) [inline, private]

Definition at line 128 of file EnableHelloPage.xaml.cs.

        {
            // Include the name of the current device for the benefit of the user.
            // The server could support a Web interface that shows the user all the devices they
            // have signed in from and revoke access from devices they have lost.

            var hostNames = NetworkInformation.GetHostNames();
            var localName = hostNames.FirstOrDefault(name => name.DisplayName.Contains(".local"));
            string computerName = localName.DisplayName.Replace(".local", "");

            JsonValue jsonResult = await JsonRequest.Create()
                .AddString("userId", userId)
                .AddString("publicKey", CryptographicBuffer.EncodeToBase64String(publicKey))
                .AddString("deviceName", computerName)
                .PostAsync("api/Authentication/Register");
            bool result = (jsonResult != null) && jsonResult.GetBoolean();

            return result;
        }

void SkipSetup ( ) [inline, private]

Definition at line 49 of file EnableHelloPage.xaml.cs.

        {
            // The user already signed in on the previous page, so we can go directly to the signed-in state.
            Frame.Navigate(typeof(AccountOverviewPage));
        }

async void StartUsingWindowsHello ( ) [inline, private]

Definition at line 55 of file EnableHelloPage.xaml.cs.

        {
            ProgressRing.IsActive = true;
            LaterButton.IsEnabled = false;
            StartUsingWindowsHelloButton.IsEnabled = false;

            // Create the key credential with Passport APIs
            IBuffer publicKey = await CreatePassportKeyCredentialAsync();
            if (publicKey != null)
            {
                // Register the public key and attestation of the key credential with the server
                // In a real-world scenario, this would likely also include:
                // - Certificate chain for attestation endorsement if available
                // - Status code of the Key Attestation result : Included / retrieved later / retry type
                if (await RegisterPassportCredentialWithServerAsync(publicKey))
                {
                    // Remember that this is the user whose credentials have been registered
                    // with the server.
                    ApplicationData.Current.LocalSettings.Values["userId"] = userId;

                    // When communicating with the server in the future, we pass a hash of the
                    // public key in order to identify which key the server should use to verify the challenge.
                    HashAlgorithmProvider hashProvider = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Sha256);
                    IBuffer publicKeyHash = hashProvider.HashData(publicKey);
                    ApplicationData.Current.LocalSettings.Values["publicKeyHint"] = CryptographicBuffer.EncodeToBase64String(publicKeyHash);

                    // Registration successful. Continue to the signed-in state.
                    Frame.Navigate(typeof(AccountOverviewPage));
                }
                else
                {
                    // Delete the failed credentials from the device.
                    await Util.TryDeleteCredentialAccountAsync(userId);

                    MessageDialog message = new MessageDialog("Failed to register with the server.");
                    await message.ShowAsync();
                }
            }
            ProgressRing.IsActive = false;
            LaterButton.IsEnabled = true;
            StartUsingWindowsHelloButton.IsEnabled = true;
        }

Member Data Documentation

string userId [private]

Definition at line 36 of file EnableHelloPage.xaml.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/cs/EnableHelloPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Errors Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Errors
Static Public Attributes

Errors Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Attributes

static Platform::String | Cancel = "No result (operation cancelled, no item selected)"
static readonly string | Cancel = "No result (operation cancelled, no item selected)"
static Platform::String | FileGroupEmpty = "No result (unexpected error: retrieved file group was null)"
static readonly string | FileGroupEmpty = "No result (unexpected error: retrieved file group was null)"
static readonly string | FileGroupLocation = "File groups are only available for library locations, please select a folder from one of your libraries"
static Platform::String | FileGroupLocation = "File groups are only available for library locations, please select a folder from one of your libraries"
static Platform::String | InvalidSize = "Invalid size (specified size must be numerical and greater than zero)"
static readonly string | InvalidSize = "Invalid size (specified size must be numerical and greater than zero)"
static readonly string | NoAlbumArt = "No result (no album art available for this song)"
static Platform::String | NoAlbumArt = "No result (no album art available for this song)"
static readonly string | NoExifThumbnail = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)"
static Platform::String | NoExifThumbnail = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)"
static readonly string | NoIcon = "No result (no icon available for this document type)"
static Platform::String | NoIcon = "No result (no icon available for this document type)"
static readonly string | NoImages = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)"
static Platform::String | NoImages = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)"
static readonly string | NoThumbnail = "No result (no thumbnail could be obtained from the selected file)"
static Platform::String | NoThumbnail = "No result (no thumbnail could be obtained from the selected file)"

Detailed Description

Definition at line 12 of file SampleConfiguration.h.

Member Data Documentation

String Cancel = "No result (operation cancelled, no item selected)" [static]

Definition at line 22 of file SampleConfiguration.h.

readonly string Cancel = "No result (operation cancelled, no item selected)" [static]

Definition at line 37 of file SampleConfiguration.cs.

String FileGroupEmpty = "No result (unexpected error: retrieved file group was null)" [static]

Definition at line 20 of file SampleConfiguration.h.

readonly string FileGroupEmpty = "No result (unexpected error: retrieved file group was null)" [static]

Definition at line 35 of file SampleConfiguration.cs.

readonly string FileGroupLocation = "File groups are only available for library locations, please select a folder from one of your libraries" [static]

Definition at line 36 of file SampleConfiguration.cs.

String FileGroupLocation = "File groups are only available for library locations, please select a folder from one of your libraries" [static]

Definition at line 21 of file SampleConfiguration.h.

String InvalidSize = "Invalid size (specified size must be numerical and greater than zero)" [static]

Definition at line 23 of file SampleConfiguration.h.

readonly string InvalidSize = "Invalid size (specified size must be numerical and greater than zero)" [static]

Definition at line 38 of file SampleConfiguration.cs.

readonly string NoAlbumArt = "No result (no album art available for this song)" [static]

Definition at line 32 of file SampleConfiguration.cs.

String NoAlbumArt = "No result (no album art available for this song)" [static]

Definition at line 17 of file SampleConfiguration.h.

readonly string NoExifThumbnail = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)" [static]

Definition at line 30 of file SampleConfiguration.cs.

String NoExifThumbnail = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)" [static]

Definition at line 15 of file SampleConfiguration.h.

readonly string NoIcon = "No result (no icon available for this document type)" [static]

Definition at line 33 of file SampleConfiguration.cs.

String NoIcon = "No result (no icon available for this document type)" [static]

Definition at line 18 of file SampleConfiguration.h.

readonly string NoImages = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)" [static]

Definition at line 34 of file SampleConfiguration.cs.

String NoImages = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)" [static]

Definition at line 19 of file SampleConfiguration.h.

readonly string NoThumbnail = "No result (no thumbnail could be obtained from the selected file)" [static]

Definition at line 31 of file SampleConfiguration.cs.

String NoThumbnail = "No result (no thumbnail could be obtained from the selected file)" [static]

Definition at line 16 of file SampleConfiguration.h.

The documentation for this class was generated from the following files:
  • FileThumbnails/cpp/SampleConfiguration.h
  • FileThumbnails/cs/SampleConfiguration.cs
  • FileThumbnails/cpp/SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileExtensions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FileExtensions
Static Public Attributes

FileExtensions Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Attributes

static Platform::Array
< Platform::String^> 		Document
static readonly string[] | Document = new string[] { ".doc", ".xls", ".ppt", ".docx", ".xlsx", ".pptx", ".pdf", ".txt", ".rtf" }
static readonly string[] | Image = new string[] { ".jpg", ".png", ".bmp", ".gif", ".tif" }
static Platform::Array
< Platform::String^> 		Image
static Platform::Array
< Platform::String^> 		Music
static readonly string[] | Music = new string[] { ".mp3", ".wma", ".m4a", ".aac" }

Detailed Description

Definition at line 26 of file SampleConfiguration.h.

Member Data Documentation

std::vector< hstring > const & Document [static]
Initial value:
 ref new Array<String^>
{
    ".doc",
    ".docx",
    ".xls",
    ".xlsx",
    ".ppt",
    ".pptx",
    ".pdf",
    ".txt",
    ".rtf",
}

Definition at line 29 of file SampleConfiguration.h.

readonly string [] Document = new string[] { ".doc", ".xls", ".ppt", ".docx", ".xlsx", ".pptx", ".pdf", ".txt", ".rtf" } [static]

Definition at line 23 of file SampleConfiguration.cs.

readonly string [] Image = new string[] { ".jpg", ".png", ".bmp", ".gif", ".tif" } [static]

Definition at line 24 of file SampleConfiguration.cs.

std::vector< hstring > const & Image [static]
Initial value:
 ref new Array<String^>
{
    ".jpg",
    ".png",
    ".bmp",
    ".gif",
    ".tif",
}

Definition at line 30 of file SampleConfiguration.h.

std::vector< hstring > const & Music [static]
Initial value:
 ref new Array<String^>
{
    ".mp3",
    ".wma",
    ".m4a",
    ".aac",
}

Definition at line 31 of file SampleConfiguration.h.

readonly string [] Music = new string[] { ".mp3", ".wma", ".m4a", ".aac" } [static]

Definition at line 25 of file SampleConfiguration.cs.

The documentation for this class was generated from the following files:
  • FileThumbnails/cpp/SampleConfiguration.h
  • FileThumbnails/cs/SampleConfiguration.cs
  • FileThumbnails/cpp/SampleConfiguration.cpp
  • FileThumbnails/cppwinrt/SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileLoggingSessionScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FileLoggingSessionScenario
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes | Static Private Attributes

FileLoggingSessionScenario Class Reference

FileLoggingSessionScenario is a central singleton class which contains the logging-specific sample code.

List of all members.

Public Member Functions

void | Dispose ()
async Task | DoScenarioAsync ()
async Task | PrepareToSuspendAsync ()
void | ResumeLoggingIfApplicable ()
void | StartLogging ()
async Task< bool > | ToggleLoggingEnabledDisabledAsync ()

Public Attributes

const string | DEFAULT_CHANNEL_NAME = "Channel"
const string | DEFAULT_SESSION_NAME = "Session"
const string | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME = "LogFiles"

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

static FileLoggingSessionScenario | Instance [get]
bool | IsBusy [get, set]
bool | IsLoggingEnabled [get]
bool | IsPreparingForSuspend [get, set]
int | LogFileGeneratedCount [get, set]

Events

EventHandler
< LoggingScenarioEventArgs > 		StatusChanged

Private Member Functions

FileLoggingSessionScenario ()
~FileLoggingSessionScenario ()
void | CheckDisposed ()
async Task< string > | CloseSessionSaveFinalLogFile ()
string | GetTimeStamp ()
async void | LogFileGeneratedHandler (IFileLoggingSession sender, LogFileGeneratedEventArgs args)
void | OnAppResuming (object sender, object e)
async void | OnAppSuspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
void | OnChannelLoggingEnabled (ILoggingChannel sender, object args)

Private Attributes

LoggingChannel | channel
LoggingLevel | channelLoggingLevel = LoggingLevel.Verbose
bool | isBusy
bool | isChannelEnabled = false
bool | isDisposed = false
const string | LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME = "LogFileGeneratedBeforeSuspend"
const string | LOGGING_ENABLED_SETTING_KEY_NAME = "LoggingEnabled"
const string | Prefix = "FileLoggingSessionScenario_"
FileLoggingSession | session

Static Private Attributes

static FileLoggingSessionScenario | loggingScenario

Detailed Description

Definition at line 18 of file FileLoggingSessionScenario.cs.

Constructor & Destructor Documentation

FileLoggingSessionScenario ( ) [inline, private]

Disallow creation of instances beyond the one instance for the process.

The one instance is accessible via the Instance property (see below).

Definition at line 416 of file FileLoggingSessionScenario.cs.

        {
            LogFileGeneratedCount = 0;

            // This sample demonstrates LoggingSession using the Windows 8.1 LoggingChannel APIs.
#pragma warning disable 618 // LoggingChannel is obsolete
            channel = new LoggingChannel(DEFAULT_CHANNEL_NAME);
#pragma warning restore

            channel.LoggingEnabled += OnChannelLoggingEnabled;

            App.Current.Suspending += OnAppSuspending;
            App.Current.Resuming += OnAppResuming;

            // If the app is being launched (not resumed), the
            // following call will activate logging if it had been
            // activated during the last suspend.
            ResumeLoggingIfApplicable();
        }

~FileLoggingSessionScenario ( ) [inline, private]

Definition at line 436 of file FileLoggingSessionScenario.cs.

        {
            Dispose(false);
        }

Member Function Documentation

void CheckDisposed ( ) [inline, private]

Helper function for other methods to call to check Dispose() state.

Definition at line 525 of file FileLoggingSessionScenario.cs.

        {
            if (isDisposed)
            {
                throw new ObjectDisposedException("LoggingScenario");
            }
        }

task< StorageFile^> CloseSessionSaveFinalLogFile ( ) [inline, private]

Definition at line 198 of file FileLoggingSessionScenario.cs.

        {
            // Save the final log file before closing the session.
            StorageFile finalFileBeforeSuspend = await session.CloseAndSaveToFileAsync();
            if (finalFileBeforeSuspend != null)
            {
                LogFileGeneratedCount++;
                // Get the the app-defined log file folder.
                StorageFolder sampleAppDefinedLogFolder =
                    await ApplicationData.Current.LocalFolder.CreateFolderAsync(OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
                                                                                CreationCollisionOption.OpenIfExists);
                // Create a new log file name based on a date/time stamp.
                string newLogFileName = "Log-" + GetTimeStamp() + ".etl";
                // Move the final log into the app-defined log file folder.
                await finalFileBeforeSuspend.MoveAsync(sampleAppDefinedLogFolder, newLogFileName);
                // Return the path to the log folder.
                return System.IO.Path.Combine(sampleAppDefinedLogFolder.Path, newLogFileName);
            }
            else
            {
                return null;
            }
        }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 494 of file FileLoggingSessionScenario.cs.

        {
            if (isDisposed == false)
            {
                isDisposed = true;

                if (disposing)
                {
                    if (channel != null)
                    {
                        channel.Dispose();
                        channel = null;
                    }

                    if (session != null)
                    {
                        session.Dispose();
                        session = null;
                    }
                }
            }
        }

void Dispose ( ) [inline]

Definition at line 488 of file FileLoggingSessionScenario.cs.

        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

task< void > DoScenarioAsync ( ) [inline]

The logging scenario.

Log messages in a loop until 3 log files are created.

Returns:
The task.

Definition at line 86 of file FileLoggingSessionScenario.cs.

        {
            CheckDisposed();

            IsBusy = true;

            try
            {
                await Task.Run(async () =>
                {
                    const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;
                    int messageIndex = 0;
                    int startFileCount = LogFileGeneratedCount;

                    //
                    // Log large messages until the current log file hits the maximum size.
                    // When the current log file reaches its maximum size, LogFileGeneratedHandler
                    // will be called.
                    //

                    while (LogFileGeneratedCount - startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
                    {
                        // Since the channel is added to the session at level Warning,
                        // the following is logged because it is logged at level LoggingLevel.Critical.
                        channel.LogMessage(
                            string.Format("Message={0}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ligula nisi, vehicula nec eleifend vel, rutrum non dolor. Vestibulum ante ipsum " +
                                          "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.",
                                          ++messageIndex),
                            LoggingLevel.Critical);

                        // Since the channel is added to the session at level Warning,
                        // the following is *not* logged because it is logged at LoggingLevel.Information.
                        channel.LogMessage(
                            string.Format("Message={0}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ligula nisi, vehicula nec eleifend vel, rutrum non dolor. Vestibulum ante ipsum " +
                                          "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.",
                                          ++messageIndex),
                            LoggingLevel.Information);

                        int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
                        channel.LogMessage("Value #" + messageIndex.ToString() + "  " + value.ToString(), LoggingLevel.Critical); // value is logged as 14 byte wide character string.
                        channel.LogValuePair("Value #" + messageIndex.ToString(), value, LoggingLevel.Critical); // value is logged as a 4-byte integer.

                        //
                        // Pause every once in a while to simulate application
                        // activity outside of logging.
                        //

                        if (messageIndex % 50 == 0)
                        {
                            await Task.Delay(10);
                        }
                    }
                });
            }
            finally
            {
                IsBusy = false;
            }
        }

string GetTimeStamp ( ) [inline, private]

Definition at line 23 of file FileLoggingSessionScenario.cs.

        {
            DateTime now = DateTime.Now;
            return string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                 "{0:D2}{1:D2}{2:D2}-{3:D2}{4:D2}{5:D2}{6:D3}",
                                 now.Year - 2000,
                                 now.Month,
                                 now.Day,
                                 now.Hour,
                                 now.Minute,
                                 now.Second,
                                 now.Millisecond);
        }

async void LogFileGeneratedHandler | ( | IFileLoggingSession | sender,
 |  | LogFileGeneratedEventArgs | args |
 | ) |  |  | [inline, private]
Parameters:
sender | The FileLoggingSession which has generated a new file.
args | Contains a StorageFile field LogFileGeneratedEventArgs.File representing the new log file.

Definition at line 180 of file FileLoggingSessionScenario.cs.

        {
            LogFileGeneratedCount++;
            StorageFolder sampleAppDefinedLogFolder =
                await ApplicationData.Current.LocalFolder.CreateFolderAsync(OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
                                                                            CreationCollisionOption.OpenIfExists);
            string newLogFileName = "Log-" + GetTimeStamp() + ".etl";
            await args.File.MoveAsync(sampleAppDefinedLogFolder, newLogFileName);
            if (IsPreparingForSuspend == false)
            {
                if (StatusChanged != null)
                {
                    string newLogFileFullPathName = System.IO.Path.Combine(sampleAppDefinedLogFolder.Path, newLogFileName);
                    StatusChanged.Invoke(this, new LoggingScenarioEventArgs(LoggingScenarioEventType.LogFileGenerated, newLogFileFullPathName));
                }
            }
        }

void OnAppResuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 456 of file FileLoggingSessionScenario.cs.

        {
            // If logging was active at the last suspend,
            // ResumeLoggingIfApplicable will re-activate
            // logging.
            ResumeLoggingIfApplicable();
        }

async void OnAppSuspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 441 of file FileLoggingSessionScenario.cs.

        {
            // Get a deferral before performing any async operations
            // to avoid suspension prior to LoggingScenario completing
            // PrepareToSuspendAsync().
            var deferral = e.SuspendingOperation.GetDeferral();

            // Prepare logging for suspension.
            await PrepareToSuspendAsync();

            // From LoggingScenario's perspective, it's now okay to
            // suspend, so release the deferral.
            deferral.Complete();
        }

void OnChannelLoggingEnabled | ( | ILoggingChannel | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 243 of file FileLoggingSessionScenario.cs.

        {
            // This method is called when the channel is informing us of channel-related state changes.
            // Save new channel state. These values can be used for advanced logging scenarios where,
            // for example, it's desired to skip blocks of logging code if the channel is not being
            // consumed by any sessions.
            isChannelEnabled = sender.Enabled;
            channelLoggingLevel = sender.Level;
        }

task< void > PrepareToSuspendAsync ( ) [inline]

Prepare this scenario for suspend.

Returns:

Definition at line 274 of file FileLoggingSessionScenario.cs.

        {
            CheckDisposed();

            if (session != null)
            {
                IsPreparingForSuspend = true;

                try
                {
                    // Before suspend, save any final log file.
                    string finalFileBeforeSuspend = await CloseSessionSaveFinalLogFile();
                    session.Dispose();
                    session = null;
                    // Save values used when the app is resumed or started later.
                    // Logging is enabled.
                    ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME] = true;
                    // Save the log file name saved at suspend so the sample UI can be
                    // updated on resume with that information.
                    ApplicationData.Current.LocalSettings.Values[LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME] = finalFileBeforeSuspend;
                }
                finally
                {
                    IsPreparingForSuspend = false;
                }
            }
            else
            {
                // Save values used when the app is resumed or started later.
                // Logging is not enabled and no log file was saved.
                ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME] = false;
                ApplicationData.Current.LocalSettings.Values[LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME] = null;
            }
        }

void ResumeLoggingIfApplicable ( ) [inline]

This is called when the app is either resuming or starting.

It will enable logging if the app has never been started before or if logging had been enabled the last time the app was running.

Definition at line 314 of file FileLoggingSessionScenario.cs.

        {
            CheckDisposed();

            object loggingEnabled;
            if (ApplicationData.Current.LocalSettings.Values.TryGetValue(LOGGING_ENABLED_SETTING_KEY_NAME, out loggingEnabled) == false)
            {
                ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME] = true;
                loggingEnabled = ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME];
            }

            if (loggingEnabled is bool && (bool)loggingEnabled == true)
            {
                StartLogging();
            }

            // When the sample suspends, it retains state as to whether or not it had
            // generated a new log file at the last suspension. This allows any
            // UI to be updated on resume to reflect that fact.
            object LogFileGeneratedBeforeSuspendObject;
            if (ApplicationData.Current.LocalSettings.Values.TryGetValue(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME, out LogFileGeneratedBeforeSuspendObject) &&
                LogFileGeneratedBeforeSuspendObject != null &&
                LogFileGeneratedBeforeSuspendObject is string)
            {
                if (StatusChanged != null)
                {
                    StatusChanged.Invoke(this,
                                         new LoggingScenarioEventArgs(LoggingScenarioEventType.LogFileGeneratedAtSuspend,
                                                                    (string)LogFileGeneratedBeforeSuspendObject));

                }
                ApplicationData.Current.LocalSettings.Values[LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME] = null;
            }
        }

void StartLogging ( ) [inline]

Definition at line 146 of file FileLoggingSessionScenario.cs.

        {
            CheckDisposed();

            // If no session exists, create one.
            // NOTE: There are use cases where an application
            // may want to create only a channel for sessions outside
            // of the application itself. See MSDN for details. This
            // sample is the common scenario of an app logging events
            // which it wants to place in its own log file, so it creates
            // a session and channel as a pair. The channel is created
            // during construction of this LoggingScenario class so
            // it already exsits by the time this function is called.
            if (session == null)
            {
                session = new FileLoggingSession(DEFAULT_SESSION_NAME);
                session.LogFileGenerated += LogFileGeneratedHandler;
            }

            // This sample adds the channel at level "warning" to
            // demonstrated how messages logged at more verbose levels
            // are ignored by the session.
            session.AddLoggingChannel(channel, LoggingLevel.Warning);
        }

task< bool > ToggleLoggingEnabledDisabledAsync ( ) [inline]

Toggle the enabled/disabled status of logging.

Returns:
True if the resulting new status is enabled, else false for disabled.

Definition at line 41 of file FileLoggingSessionScenario.cs.

        {
            CheckDisposed();

            IsBusy = true;

            try
            {
                bool enabled;
                if (session != null)
                {
                    string finalLogFilePath = await CloseSessionSaveFinalLogFile();
                    session.Dispose();
                    session = null;
                    if (StatusChanged != null)
                    {
                        StatusChanged.Invoke(this, new LoggingScenarioEventArgs(LoggingScenarioEventType.LogFileGeneratedAtDisable, finalLogFilePath));
                    }
                    ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME] = false;
                    enabled = false;
                }
                else
                {
                    StartLogging();
                    ApplicationData.Current.LocalSettings.Values[LOGGING_ENABLED_SETTING_KEY_NAME] = true;
                    enabled = true;
                }

                if (StatusChanged != null)
                {
                    StatusChanged.Invoke(this, new LoggingScenarioEventArgs(enabled));
                }

                return enabled;
            }
            finally
            {
                IsBusy = false;
            }
        }

Member Data Documentation

LoggingChannel channel [private]

The sample's one channel.

Definition at line 406 of file FileLoggingSessionScenario.cs.

LoggingLevel channelLoggingLevel = LoggingLevel.Verbose [private]

This is the current maximum level of listeners of the application's channel.

It is adjusted as the channel's LoggingEnabled event is raised. Search for OnChannelLoggingEnabled for more information.

Definition at line 241 of file FileLoggingSessionScenario.cs.

const string DEFAULT_CHANNEL_NAME = "Channel"

Definition at line 389 of file FileLoggingSessionScenario.cs.

const string DEFAULT_SESSION_NAME = "Session"

Definition at line 388 of file FileLoggingSessionScenario.cs.

bool isBusy [private]

Definition at line 355 of file FileLoggingSessionScenario.cs.

bool isChannelEnabled = false [private]

This boolean tracks whether or not there are any sessions listening to the app's channel.

This is adjusted as the channel's LoggingEnabled event is raised. Search for OnChannelLoggingEnabled for more information.

Definition at line 233 of file FileLoggingSessionScenario.cs.

bool isDisposed = false [private]

Set to 'true' if Dispose() has been called.

Definition at line 520 of file FileLoggingSessionScenario.cs.

const string LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME = "LogFileGeneratedBeforeSuspend" [private]

Definition at line 258 of file FileLoggingSessionScenario.cs.

const string LOGGING_ENABLED_SETTING_KEY_NAME = "LoggingEnabled" [private]

Definition at line 257 of file FileLoggingSessionScenario.cs.

FileLoggingSessionScenario loggingScenario [static, private]

The app's one and only LoggingScenario instance.

Definition at line 466 of file FileLoggingSessionScenario.cs.

const string OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME = "LogFiles"

LoggingScenario moves generated logs files into the this folder under the LocalState folder.

Definition at line 395 of file FileLoggingSessionScenario.cs.

const string Prefix = "FileLoggingSessionScenario_" [private]

Definition at line 387 of file FileLoggingSessionScenario.cs.

FileLoggingSession session [private]

The sample's one session.

Definition at line 401 of file FileLoggingSessionScenario.cs.

Property Documentation

FileLoggingSessionScenario Instance [static, get]

A method to allowing callers to access the app's one and only LoggingScenario instance.

Returns:
The logging helper.

Definition at line 473 of file FileLoggingSessionScenario.cs.

bool IsBusy [get, set]

True if the scenario is busy, or false if not busy.

The UI can use this to affect UI controls.

Definition at line 361 of file FileLoggingSessionScenario.cs.

bool IsLoggingEnabled [get]

Definition at line 263 of file FileLoggingSessionScenario.cs.

bool IsPreparingForSuspend [get, set]

Definition at line 260 of file FileLoggingSessionScenario.cs.

int LogFileGeneratedCount [get, set]

The number of times LogFileGeneratedHandler has been called.

Definition at line 381 of file FileLoggingSessionScenario.cs.

Event Documentation

EventHandler<LoggingScenarioEventArgs> StatusChanged

Definition at line 353 of file FileLoggingSessionScenario.cs.

The documentation for this class was generated from the following files:
  • Logging/cs/FileLoggingSessionScenario.cs
  • Logging/cpp/FileLoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileOpenPickerPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FileOpenPickerPage
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

FileOpenPickerPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileOpenPickerPage ()
void | Activate (FileOpenPickerActivatedEventArgs args)
void | LoadScenario (Type scenarioClass)
void | NotifyUser (string strMessage, NotifyType type)

Public Attributes

const string | FEATURE_NAME = "File Open Picker Page"
Windows.ApplicationModel.Activation.LaunchActivatedEventArgs | LaunchArgs

Static Public Attributes

static FileOpenPickerPage | Current

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | FileOpenPickerPage_SizeChanged (object sender, SizeChangedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | InvalidateLayout ()
void | InvalidateSize ()
void | OnScenarioSelectionChanged ()
void | PopulateScenarios ()
void | SetFeatureName (string str)

Private Attributes

internal FileOpenPickerUI | fileOpenPickerUI = null
Frame | HiddenFrame = null
List< Scenario > scenarios

Detailed Description

Definition at line 27 of file FileOpenPickerPage.xaml.cs.

Constructor & Destructor Documentation

FileOpenPickerPage ( ) [inline]

Definition at line 55 of file FileOpenPickerPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that will allow downstream pages to get
            // a handle to the FileOpenPickerPage instance in order to call methods that are in this class.
            Current = this;

            // This frame is hidden, meaning it is never shown.  It is simply used to load
            // each scenario page and then pluck out the input and output sections and
            // place them into the UserControls on the main page.
            HiddenFrame = new Windows.UI.Xaml.Controls.Frame();
            HiddenFrame.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            LayoutRoot.Children.Add(HiddenFrame);

            // Populate the sample title from the constant in this file.
            SetFeatureName(FEATURE_NAME);
        }

Member Function Documentation

void Activate ( FileOpenPickerActivatedEventArgs args ) [inline]

Definition at line 46 of file FileOpenPickerPage.xaml.cs.

        {
            // cache FileOpenPickerUI
            fileOpenPickerUI = args.FileOpenPickerUI;
            Window.Current.Content = this;
            this.OnNavigatedTo(null);
            Window.Current.Activate();
        }

void FileOpenPickerPage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file FileOpenPickerPage.xaml.cs.

        {
            InvalidateSize();
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 260 of file FileOpenPickerPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void InvalidateLayout ( ) [inline, private]

Definition at line 128 of file FileOpenPickerPage.xaml.cs.

        {

            if (this.ActualWidth < 768)
            {
                Grid.SetRow(DescriptionText, 3);
                Grid.SetColumn(DescriptionText, 0);

                Grid.SetRow(InputSection, 4);
                Grid.SetColumn(InputSection, 0);

                Grid.SetRow(FooterPanel, 2);
                Grid.SetColumn(FooterPanel, 0);
            }
            else
            {
                Grid.SetRow(DescriptionText, 1);
                Grid.SetColumn(DescriptionText, 1);

                Grid.SetRow(InputSection, 2);
                Grid.SetColumn(InputSection, 1);

                Grid.SetRow(FooterPanel, 1);
                Grid.SetColumn(FooterPanel, 1);
            }
        }

void InvalidateSize ( ) [inline, private]

Definition at line 90 of file FileOpenPickerPage.xaml.cs.

        {
            // Get the window width
            double windowWidth = this.ActualWidth;

            if (windowWidth != 0.0)
            {
                // Get the width of the ListBox.
                double listBoxWidth = Scenarios.ActualWidth;

                // Is the ListBox using any margins that we need to consider?
                double listBoxMarginLeft = Scenarios.Margin.Left;
                double listBoxMarginRight = Scenarios.Margin.Right;

                // Figure out how much room is left after considering the list box width
                double availableWidth = windowWidth - listBoxWidth;

                // Is the top most child using margins?
                double layoutRootMarginLeft = ContentRoot.Margin.Left;
                double layoutRootMarginRight = ContentRoot.Margin.Right;

                // We have different widths to use depending on the view state
                if (this.ActualWidth >= 768)
                {
                    // Make us as big as the the left over space, factoring in the ListBox width, the ListBox margins.
                    // and the LayoutRoot's margins
                    InputSection.Width = ((availableWidth) - (layoutRootMarginLeft + layoutRootMarginRight + listBoxMarginLeft + listBoxMarginRight));
                }
                else
                {
                    // Make us as big as the left over space, factoring in just the LayoutRoot's margins.
                        InputSection.Width = (windowWidth - (layoutRootMarginLeft + layoutRootMarginRight));

                }
            }
            InvalidateLayout();
        }

void LoadScenario ( Type scenarioClass ) [inline]

This method is responsible for loading the individual input and output sections for each scenario.

This is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input and output sections into the respective UserControl on the main page.

Parameters:
scenarioName

Definition at line 167 of file FileOpenPickerPage.xaml.cs.

        {

            // Load the ScenarioX.xaml file into the Frame.
            HiddenFrame.Navigate(scenarioClass, this);

            // Get the top element, the Page, so we can look up the elements
            // that represent the input and output sections of the ScenarioX file.
            Page hiddenPage = HiddenFrame.Content as Page;

            // Get each element.
            UIElement input = hiddenPage.FindName("Input") as UIElement;
            UIElement output = hiddenPage.FindName("Output") as UIElement;

            if (input == null)
            {
                // Malformed input section.
                NotifyUser(String.Format(
                    "Cannot load scenario input section for {0}.  Make sure root of input section markup has x:Name of 'Input'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            if (output == null)
            {
                // Malformed output section.
                NotifyUser(String.Format(
                    "Cannot load scenario output section for {0}.  Make sure root of output section markup has x:Name of 'Output'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            // Find the LayoutRoot which parents the input and output sections in the main page.
            Panel panel = hiddenPage.FindName("LayoutRoot") as Panel;

            if (panel != null)
            {
                // Get rid of the content that is currently in the intput and output sections.
                panel.Children.Remove(input);
                panel.Children.Remove(output);

                // Populate the input and output sections with the newly loaded content.
                InputSection.Content = input;
                OutputSection.Content = output;
            }
            else
            {
                // Malformed Scenario file.
                NotifyUser(String.Format(
                    "Cannot load scenario: '{0}'.  Make sure root tag in the '{0}' file has an x:Name of 'LayoutRoot'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
            }

        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Definition at line 234 of file FileOpenPickerPage.xaml.cs.

        {
            switch (type)
            {
                // Use the status message style.
                case NotifyType.StatusMessage:
                    StatusBlock.Style = Resources["StatusStyle"] as Style;
                    break;
                // Use the error message style.
                case NotifyType.ErrorMessage:
                    StatusBlock.Style = Resources["ErrorStyle"] as Style;
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            if (StatusBlock.Text != String.Empty)
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 84 of file FileOpenPickerPage.xaml.cs.

        {
            PopulateScenarios();
            InvalidateLayout();
        }

void OnScenarioSelectionChanged ( ) [inline, private]

Definition at line 222 of file FileOpenPickerPage.xaml.cs.

        {
            if (Scenarios.SelectedItem != null)
            {
                NotifyUser("", NotifyType.StatusMessage);

                Scenario scenario = Scenarios.SelectedItem as Scenario;
                LoadScenario(scenario.ClassType);
                InvalidateSize();
            }
        }

void PopulateScenarios ( ) [inline, private]

Definition at line 155 of file FileOpenPickerPage.xaml.cs.

        {
            Scenarios.ItemsSource = scenarios;
            Scenarios.SelectedIndex = 0;
        }

void SetFeatureName ( string str ) [inline, private]

Definition at line 265 of file FileOpenPickerPage.xaml.cs.

        {
            FeatureName.Text = str;
        }

Member Data Documentation

FileOpenPickerPage Current [static]

Definition at line 33 of file FileOpenPickerPage.xaml.cs.

const string FEATURE_NAME = "File Open Picker Page"

Definition at line 29 of file FileOpenPickerPage.xaml.cs.

internal FileOpenPickerUI fileOpenPickerUI = null [private]

Definition at line 37 of file FileOpenPickerPage.xaml.cs.

Frame HiddenFrame = null [private]

Definition at line 35 of file FileOpenPickerPage.xaml.cs.

Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs

Definition at line 31 of file FileOpenPickerPage.xaml.cs.

List<Scenario> scenarios [private]
Initial value:
 new List<Scenario>
        {
            new Scenario() { Title = "1) Pick a file from the application package", ClassType = typeof(FilePickerContracts.FileOpenPicker_PickAppFile) },
            new Scenario() { Title = "2) Pick a file from a URI",           ClassType = typeof(FilePickerContracts.FileOpenPicker_PickURLFile) },
            new Scenario() { Title = "3) Pick cached file",                 ClassType = typeof(FilePickerContracts.FileOpenPicker_PickCachedFile) },
        }

Definition at line 39 of file FileOpenPickerPage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileOpenPickerPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSavePickerPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FileSavePickerPage
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Events | Private Member Functions | Private Attributes

FileSavePickerPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

FileSavePickerPage ()
void | LoadScenario (Type scenarioClass)
void | NotifyUser (string strMessage, NotifyType type)

Public Attributes

const string | FEATURE_NAME = "File Save Picker Page"
Windows.ApplicationModel.Activation.LaunchActivatedEventArgs | LaunchArgs

Static Public Attributes

static FileSavePickerPage | Current

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Events

EventHandler
< FileSavePickerPageSizeChangedEventArgs > 		FileSavePickerPageResized
System.EventHandler | ScenarioLoaded

Private Member Functions

internal void | Activate (FileSavePickerActivatedEventArgs args)
void | FileSavePickerPage_SizeChanged (object sender, SizeChangedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | InvalidateLayout ()
void | InvalidateSize ()
void | PopulateScenarios ()
void | Scenarios_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | SetFeatureName (string str)

Private Attributes

internal FileSavePickerUI | fileSavePickerUI = null
Frame | HiddenFrame = null
List< Scenario > scenarios

Detailed Description

Definition at line 27 of file FileSavePickerPage.xaml.cs.

Constructor & Destructor Documentation

FileSavePickerPage ( ) [inline]

Definition at line 56 of file FileSavePickerPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that will allow downstream pages to get
            // a handle to the FileSavePickerPage instance in order to call methods that are in this class.
            Current = this;

            // This frame is hidden, meaning it is never shown.  It is simply used to load
            // each scenario page and then pluck out the input and output sections and
            // place them into the UserControls on the main page.
            HiddenFrame = new Windows.UI.Xaml.Controls.Frame();
            HiddenFrame.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            LayoutRoot.Children.Add(HiddenFrame);

            // Populate the sample title from the constant in the GlobalVariables.cs file.
            SetFeatureName(FEATURE_NAME);

            Scenarios.SelectionChanged += Scenarios_SelectionChanged;
            SizeChanged += FileSavePickerPage_SizeChanged;
        }

Member Function Documentation

internal void Activate ( FileSavePickerActivatedEventArgs args ) [inline, private]

Definition at line 48 of file FileSavePickerPage.xaml.cs.

        {
            fileSavePickerUI = args.FileSavePickerUI;
            Window.Current.Content = this;
            this.OnNavigatedTo(null);
            Window.Current.Activate();
        }

void FileSavePickerPage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file FileSavePickerPage.xaml.cs.

        {
            InvalidateSize();
            if (FileSavePickerPageResized != null)
            {
                FileSavePickerPageSizeChangedEventArgs args = new FileSavePickerPageSizeChangedEventArgs();
                args.Width = this.ActualWidth;
                FileSavePickerPageResized(this, args);
            }
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 276 of file FileSavePickerPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void InvalidateLayout ( ) [inline, private]

Definition at line 138 of file FileSavePickerPage.xaml.cs.

        {

            if (this.ActualWidth < 768)
            {
                Grid.SetRow(DescriptionText, 3);
                Grid.SetColumn(DescriptionText, 0);

                Grid.SetRow(InputSection, 4);
                Grid.SetColumn(InputSection, 0);

                Grid.SetRow(FooterPanel, 2);
                Grid.SetColumn(FooterPanel, 0);
            }
            else
            {
                Grid.SetRow(DescriptionText, 1);
                Grid.SetColumn(DescriptionText, 1);

                Grid.SetRow(InputSection, 2);
                Grid.SetColumn(InputSection, 1);

                Grid.SetRow(FooterPanel, 1);
                Grid.SetColumn(FooterPanel, 1);
            }
        }

void InvalidateSize ( ) [inline, private]

Definition at line 100 of file FileSavePickerPage.xaml.cs.

        {
            // Get the window width
            double windowWidth = this.ActualWidth;

            if (windowWidth != 0.0)
            {
                // Get the width of the ListBox.
                double listBoxWidth = Scenarios.ActualWidth;

                // Is the ListBox using any margins that we need to consider?
                double listBoxMarginLeft = Scenarios.Margin.Left;
                double listBoxMarginRight = Scenarios.Margin.Right;

                // Figure out how much room is left after considering the list box width
                double availableWidth = windowWidth - listBoxWidth;

                // Is the top most child using margins?
                double layoutRootMarginLeft = ContentRoot.Margin.Left;
                double layoutRootMarginRight = ContentRoot.Margin.Right;

                // We have different widths to use depending on the view state
                if (this.ActualWidth >= 768)
                {
                    // Make us as big as the the left over space, factoring in the ListBox width, the ListBox margins.
                    // and the LayoutRoot's margins
                    InputSection.Width = ((availableWidth) - (layoutRootMarginLeft + layoutRootMarginRight + listBoxMarginLeft + listBoxMarginRight));
                }
                else
                {
                    // Make us as big as the left over space, factoring in just the LayoutRoot's margins.
                        InputSection.Width = (windowWidth - (layoutRootMarginLeft + layoutRootMarginRight));

                }
            }
            InvalidateLayout();
        }

void LoadScenario ( Type scenarioClass ) [inline]

This method is responsible for loading the individual input and output sections for each scenario.

This is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input and output sections into the respective UserControl on the main page.

Parameters:
scenarioName

Definition at line 178 of file FileSavePickerPage.xaml.cs.

        {

            // Load the ScenarioX.xaml file into the Frame.
            HiddenFrame.Navigate(scenarioClass, this);

            // Get the top element, the Page, so we can look up the elements
            // that represent the input and output sections of the ScenarioX file.
            Page hiddenPage = HiddenFrame.Content as Page;

            // Get each element.
            UIElement input = hiddenPage.FindName("Input") as UIElement;
            UIElement output = hiddenPage.FindName("Output") as UIElement;

            if (input == null)
            {
                // Malformed input section.
                NotifyUser(String.Format(
                    "Cannot load scenario input section for {0}.  Make sure root of input section markup has x:Name of 'Input'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            if (output == null)
            {
                // Malformed output section.
                NotifyUser(String.Format(
                    "Cannot load scenario output section for {0}.  Make sure root of output section markup has x:Name of 'Output'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
                return;
            }

            // Find the LayoutRoot which parents the input and output sections in the main page.
            Panel panel = hiddenPage.FindName("LayoutRoot") as Panel;

            if (panel != null)
            {
                // Get rid of the content that is currently in the intput and output sections.
                panel.Children.Remove(input);
                panel.Children.Remove(output);

                // Populate the input and output sections with the newly loaded content.
                InputSection.Content = input;
                OutputSection.Content = output;

                if (ScenarioLoaded != null)
                {
                    ScenarioLoaded(this, new EventArgs());
                }
            }
            else
            {
                // Malformed Scenario file.
                NotifyUser(String.Format(
                    "Cannot load scenario: '{0}'.  Make sure root tag in the '{0}' file has an x:Name of 'LayoutRoot'",
                    scenarioClass.Name), NotifyType.ErrorMessage);
            }

        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Definition at line 250 of file FileSavePickerPage.xaml.cs.

        {
            switch (type)
            {
                // Use the status message style.
                case NotifyType.StatusMessage:
                    StatusBlock.Style = Resources["StatusStyle"] as Style;
                    break;
                // Use the error message style.
                case NotifyType.ErrorMessage:
                    StatusBlock.Style = Resources["ErrorStyle"] as Style;
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            if (StatusBlock.Text != String.Empty)
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 94 of file FileSavePickerPage.xaml.cs.

        {
            PopulateScenarios();
            InvalidateLayout();
        }

void PopulateScenarios ( ) [inline, private]

Definition at line 165 of file FileSavePickerPage.xaml.cs.

        {
            // Bind the ListBox to the scenario list.
            Scenarios.ItemsSource = scenarios;
            Scenarios.SelectedIndex = 0;
        }

void Scenarios_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 238 of file FileSavePickerPage.xaml.cs.

        {
            if (Scenarios.SelectedItem != null)
            {
                NotifyUser("", NotifyType.StatusMessage);

                Scenario scenario = Scenarios.SelectedItem as Scenario;
                LoadScenario(scenario.ClassType);
                InvalidateSize();
            }
        }

void SetFeatureName ( string str ) [inline, private]

Definition at line 281 of file FileSavePickerPage.xaml.cs.

        {
            FeatureName.Text = str;
        }

Member Data Documentation

FileSavePickerPage Current [static]

Definition at line 35 of file FileSavePickerPage.xaml.cs.

const string FEATURE_NAME = "File Save Picker Page"

Definition at line 29 of file FileSavePickerPage.xaml.cs.

internal FileSavePickerUI fileSavePickerUI = null [private]

Definition at line 39 of file FileSavePickerPage.xaml.cs.

Frame HiddenFrame = null [private]

Definition at line 37 of file FileSavePickerPage.xaml.cs.

Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs

Definition at line 33 of file FileSavePickerPage.xaml.cs.

List<Scenario> scenarios [private]
Initial value:
 new List<Scenario>
        {
            new Scenario() { Title = "1) Save a file to app's storage", ClassType = typeof(FilePickerContracts.FileSavePicker_SaveToAppStorage) },
            new Scenario() { Title = "2) Fail to save a file",     ClassType = typeof(FilePickerContracts.FileSavePicker_FailToSave) },
            new Scenario() { Title = "3) Save to cached file",     ClassType = typeof(FilePickerContracts.FileSavePicker_SaveToCachedFile) },
        }

Definition at line 41 of file FileSavePickerPage.xaml.cs.

Event Documentation

EventHandler<FileSavePickerPageSizeChangedEventArgs> FileSavePickerPageResized

Definition at line 31 of file FileSavePickerPage.xaml.cs.

System.EventHandler ScenarioLoaded

Definition at line 30 of file FileSavePickerPage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileSavePickerPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSavePickerPageSizeChangedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FileSavePickerPageSizeChangedEventArgs
Properties | Private Attributes

FileSavePickerPageSizeChangedEventArgs Class Reference

List of all members.

Properties

double | Width [get, set]

Private Attributes

double | width

Detailed Description

Definition at line 287 of file FileSavePickerPage.xaml.cs.

Member Data Documentation

double width [private]

Definition at line 289 of file FileSavePickerPage.xaml.cs.

Property Documentation

double Width [get, set]

Definition at line 292 of file FileSavePickerPage.xaml.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/FileSavePickerPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FirmwareAccess Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FirmwareAccess
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

FirmwareAccess Class Reference

List of all members.

Public Member Functions

FirmwareAccess ()
static int | GetFirmwareEnvironmentVariable (string name, string guid,[Out, MarshalAs(UnmanagedType.LPArray)] char[] lpszBuffer, int size)
static uint | GetLastError ()

Private Member Functions

void | GetManufacturerName_Click (Object sender, RoutedEventArgs e)
void | SecureBootState_Click (Object sender, RoutedEventArgs e)

Static Private Member Functions

static uint | GetManufacturerNameFromSmbios (StringBuilder ManufacturerName, uint Size)
static uint | GetSecureBootEnabledFromUefi ([MarshalAs(UnmanagedType.U1)] ref bool SecureBootEnabled)

Private Attributes

const uint | ERROR_INVALID_FUNCTION = 1
const uint | ERROR_SUCCESS = 0
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario7_FirmwareAccess.xaml.cs.

Constructor & Destructor Documentation

FirmwareAccess ( ) [inline]

Definition at line 24 of file Scenario7_FirmwareAccess.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

static int GetFirmwareEnvironmentVariable | ( | string | name,
 |  | string | guid,
 |  | [Out, MarshalAs(UnmanagedType.LPArray)] char[] | lpszBuffer,
 |  | int | size
 | ) |  |
static uint GetLastError ( )
void GetManufacturerName_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario7_FirmwareAccess.xaml.cs.

        {
            const int maxNameLength = 255;
            StringBuilder name = new StringBuilder(maxNameLength);

            uint error = GetManufacturerNameFromSmbios(name, (uint)name.Capacity);
            if (error == ERROR_SUCCESS)
            {
                ManufacturerName.Text = name.ToString();
            }
            else
            {
                rootPage.NotifyUser($"Failed to retrieve manufacturer name from SMBIOS, error {error}", NotifyType.ErrorMessage);
            }
        }

static uint GetManufacturerNameFromSmbios | ( | StringBuilder | ManufacturerName,
 |  | uint | Size |
 | ) |  |  | [static, private]
static uint GetSecureBootEnabledFromUefi ( [MarshalAs(UnmanagedType.U1)] ref bool SecureBootEnabled ) [static, private]
void SecureBootState_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario7_FirmwareAccess.xaml.cs.

        {
            bool secureBootEnabled = false;

            uint error = GetSecureBootEnabledFromUefi(ref secureBootEnabled);
            switch (error)
            {
                case ERROR_SUCCESS:
                SecureBootState.Text = secureBootEnabled.ToString();
                    break;

                case ERROR_INVALID_FUNCTION:
                    rootPage.NotifyUser("Windows was installed using legacy BIOS", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser($"Failed to retrieve secure boot state from UEFI, error {error}", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

const uint ERROR_INVALID_FUNCTION = 1 [private]

Definition at line 43 of file Scenario7_FirmwareAccess.xaml.cs.

const uint ERROR_SUCCESS = 0 [private]

Definition at line 42 of file Scenario7_FirmwareAccess.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario7_FirmwareAccess.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario7_FirmwareAccess.xaml.cs
  • CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FrameFormatModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FrameFormatModel
Public Member Functions | Properties

FrameFormatModel Class Reference

View model for MediaFrameFormat used in XAML ContentControl.

List of all members.

Public Member Functions

FrameFormatModel (MediaFrameFormat format)
bool | HasSameFormat (MediaFrameFormat otherFormat)
override string | ToString ()

Properties

string | DisplayName [get]
MediaFrameFormat | Format [get]

Detailed Description

Definition at line 79 of file FrameSourceViewModels.cs.

Constructor & Destructor Documentation

FrameFormatModel ( MediaFrameFormat format ) [inline]

Definition at line 85 of file FrameSourceViewModels.cs.

        {
            this.Format = format;
            this.DisplayName = string.Format("{0} | {1} | {2} x {3} | {4:#.##}fps",
                format.MajorType,
                format.Subtype,
                format.VideoFormat?.Width,
                format.VideoFormat?.Height,
                Math.Round((double)format.FrameRate.Numerator / format.FrameRate.Denominator, 2));
        }

Member Function Documentation

bool HasSameFormat ( MediaFrameFormat otherFormat ) [inline]

Compares the Format contained by this view model to the given format for equivalency.

Parameters:
otherFormat The MediaFrameFormat to compare to the MediaFrameFormat in this view model.
Returns:

Definition at line 106 of file FrameSourceViewModels.cs.

        {
            if (otherFormat == null)
            {
                return (Format == null);
            }

            return this.Format.MajorType == otherFormat.MajorType &&
                this.Format.Subtype == otherFormat.Subtype &&
                this.Format.FrameRate.Numerator == otherFormat.FrameRate.Numerator &&
                this.Format.FrameRate.Denominator == otherFormat.FrameRate.Denominator &&
                this.Format.VideoFormat?.Width == otherFormat.VideoFormat?.Width &&
                this.Format.VideoFormat?.Height == otherFormat.VideoFormat?.Height;
        }

override string ToString ( ) [inline]

Definition at line 96 of file FrameSourceViewModels.cs.

        {
            return this.DisplayName;
        }

Property Documentation

string DisplayName [get]

Definition at line 83 of file FrameSourceViewModels.cs.

MediaFrameFormat Format [get]

Definition at line 81 of file FrameSourceViewModels.cs.

The documentation for this class was generated from the following file:
  • CameraFrames/cs/FrameSourceViewModels.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FrameRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FrameRenderer
Public Member Functions | Private Member Functions | Private Attributes

FrameRenderer Class Reference

#include "FrameRenderer.h"

List of all members.

Public Member Functions

FrameRenderer (Windows::UI::Xaml::Controls::Image^image)
void | ProcessColorFrame (Windows::Media::Capture::Frames::MediaFrameReference^colorFrame)
void | ProcessDepthAndColorFrames (Windows::Media::Capture::Frames::MediaFrameReference^colorFrame, Windows::Media::Capture::Frames::MediaFrameReference^depthFrame)

Private Member Functions

void | BufferBitmapForRendering (Windows::Graphics::Imaging::SoftwareBitmap^softwareBitmap)
concurrency::task< void > | FrameRenderer::DrainBackBufferAsync ()
Windows::Graphics::Imaging::SoftwareBitmap | MapDepthToColor (Windows::Media::Capture::Frames::VideoMediaFrame^colorFrame, Windows::Media::Capture::Frames::VideoMediaFrame^depthFrame, Windows::Media::Devices::Core::CameraIntrinsics^colorCameraIntrinsics, Windows::Perception::Spatial::SpatialCoordinateSystem^colorCoordinateSystem, Windows::Media::Devices::Core::DepthCorrelatedCoordinateMapper^coordinateMapper)

Private Attributes

Windows::Graphics::Imaging::SoftwareBitmap | m_backBuffer
Platform::Array
< Windows::Foundation::Point > 		m_colorSpacePoints
Platform::Array
< Windows::Foundation::Numerics::float3 > 		m_depthSpacePoints
Windows::UI::Xaml::Controls::Image | m_imageElement
std::mutex | m_pointBufferMutex
UINT32 | m_previousBufferHeight = 0
UINT32 | m_previousBufferWidth = 0
bool | m_taskRunning = false

Detailed Description

Definition at line 19 of file FrameRenderer.h.

Constructor & Destructor Documentation

FrameRenderer ( Windows::UI::Xaml::Controls::Image^ image )

Member Function Documentation

void BufferBitmapForRendering ( Windows::Graphics::Imaging::SoftwareBitmap^ softwareBitmap ) [private]

Buffer processed bitmap and render on UI.

concurrency::task<void> FrameRenderer::DrainBackBufferAsync ( ) [private]

Keep presenting the m_backBuffer until there are no more.

Windows::Graphics::Imaging::SoftwareBitmap MapDepthToColor | ( | Windows::Media::Capture::Frames::VideoMediaFrame^ | colorFrame,
 |  | Windows::Media::Capture::Frames::VideoMediaFrame^ | depthFrame,
 |  | Windows::Media::Devices::Core::CameraIntrinsics^ | colorCameraIntrinsics,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | colorCoordinateSystem,
 |  | Windows::Media::Devices::Core::DepthCorrelatedCoordinateMapper^ | coordinateMapper |
 | ) |  |  | [private]

Perform mapping of depth pixels to color pixels.

void ProcessColorFrame ( Windows::Media::Capture::Frames::MediaFrameReference^ colorFrame )

Buffer and render color frame.

void ProcessDepthAndColorFrames | ( | Windows::Media::Capture::Frames::MediaFrameReference^ | colorFrame,
 |  | Windows::Media::Capture::Frames::MediaFrameReference^ | depthFrame
 | ) |  |

Buffer and render correlated color and depth frames.

Member Data Documentation

Windows::Graphics::Imaging::SoftwareBitmap m_backBuffer [private]

Definition at line 59 of file FrameRenderer.h.

Platform::Array<Windows::Foundation::Point> m_colorSpacePoints [private]

Definition at line 61 of file FrameRenderer.h.

Platform::Array<Windows::Foundation::Numerics::float3> m_depthSpacePoints [private]

Definition at line 62 of file FrameRenderer.h.

Windows::UI::Xaml::Controls::Image m_imageElement [private]

Definition at line 58 of file FrameRenderer.h.

std::mutex m_pointBufferMutex [private]

Definition at line 70 of file FrameRenderer.h.

UINT32 m_previousBufferHeight = 0 [private]

Definition at line 65 of file FrameRenderer.h.

UINT32 m_previousBufferWidth = 0 [private]

Definition at line 64 of file FrameRenderer.h.

bool m_taskRunning = false [private]

Definition at line 67 of file FrameRenderer.h.

The documentation for this class was generated from the following file:
  • CameraStreamCorrelation/cpp/FrameRenderer.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FrameSourceGroupModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FrameSourceGroupModel
Public Member Functions | Properties

FrameSourceGroupModel Class Reference

View model for MediaFrameSourceGroup used in XAML ContentControl.

List of all members.

Public Member Functions

FrameSourceGroupModel (MediaFrameSourceGroup group)
override string | ToString ()

Properties

string | DisplayName [get]
string | Id [get]
MediaFrameSourceGroup | SourceGroup [get]
IReadOnlyList
< FrameSourceInfoModel > 		SourceInfos [get]

Detailed Description

Definition at line 26 of file FrameSourceViewModels.cs.

Constructor & Destructor Documentation

FrameSourceGroupModel ( MediaFrameSourceGroup group ) [inline]

Definition at line 33 of file FrameSourceViewModels.cs.

        {
            SourceGroup = group;
            this.Id = group.Id;
            this.DisplayName = group.DisplayName;
            this.SourceInfos = group.SourceInfos.Select(
                sourceInfo => new FrameSourceInfoModel(sourceInfo)).ToArray();
        }

Member Function Documentation

override string ToString ( ) [inline]

Definition at line 42 of file FrameSourceViewModels.cs.

        {
            return this.DisplayName;
        }

Property Documentation

string DisplayName [get]

Definition at line 29 of file FrameSourceViewModels.cs.

string Id [get]

Definition at line 28 of file FrameSourceViewModels.cs.

MediaFrameSourceGroup SourceGroup [get]

Definition at line 30 of file FrameSourceViewModels.cs.

IReadOnlyList<FrameSourceInfoModel> SourceInfos [get]

Definition at line 31 of file FrameSourceViewModels.cs.

The documentation for this class was generated from the following file:
  • CameraFrames/cs/FrameSourceViewModels.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FrameSourceInfoModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FrameSourceInfoModel
Public Member Functions | Properties

FrameSourceInfoModel Class Reference

View model for MediaFrameSourceInfo used in XAML ContentControl.

List of all members.

Public Member Functions

FrameSourceInfoModel (MediaFrameSourceInfo sourceInfo)
override string | ToString ()

Properties

string | DisplayName [get]
string | Id [get]
MediaFrameSourceGroup | SourceGroup [get]
MediaFrameSourceInfo | SourceInfo [get]

Detailed Description

Definition at line 51 of file FrameSourceViewModels.cs.

Constructor & Destructor Documentation

FrameSourceInfoModel ( MediaFrameSourceInfo sourceInfo ) [inline]

Definition at line 58 of file FrameSourceViewModels.cs.

        {
            this.SourceInfo = sourceInfo;
            this.SourceGroup = this.SourceInfo.SourceGroup;

            this.Id = sourceInfo.Id;

            var kind = sourceInfo.SourceKind.ToString();
            var type = sourceInfo.MediaStreamType.ToString();
            this.DisplayName = $"{kind} {type}";
        }

Member Function Documentation

override string ToString ( ) [inline]

Definition at line 70 of file FrameSourceViewModels.cs.

        {
            return this.DisplayName;
        }

Property Documentation

string DisplayName [get]

Definition at line 53 of file FrameSourceViewModels.cs.

string Id [get]

Definition at line 54 of file FrameSourceViewModels.cs.

MediaFrameSourceGroup SourceGroup [get]

Definition at line 55 of file FrameSourceViewModels.cs.

MediaFrameSourceInfo SourceInfo [get]

Definition at line 56 of file FrameSourceViewModels.cs.

The documentation for this class was generated from the following file:
  • CameraFrames/cs/FrameSourceViewModels.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FrameSourceState Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • FrameSourceState
Public Attributes

FrameSourceState Struct Reference

#include "Scenario1_CorrelateStreams.xaml.h"

List of all members.

Public Attributes

bool | enabled = false
Windows::Foundation::EventRegistrationToken | frameArrivedEventToken
Windows::Media::Capture::Frames::MediaFrameReference | latestFrame = nullptr
Windows::Media::Capture::Frames::MediaFrameReader | reader = nullptr
Windows::Media::Capture::Frames::MediaFrameSourceInfo | sourceInfo = nullptr

Detailed Description

Definition at line 25 of file Scenario1_CorrelateStreams.xaml.h.

Member Data Documentation

bool enabled = false

Definition at line 27 of file Scenario1_CorrelateStreams.xaml.h.

Windows::Foundation::EventRegistrationToken frameArrivedEventToken

Definition at line 33 of file Scenario1_CorrelateStreams.xaml.h.

Windows::Media::Capture::Frames::MediaFrameReference latestFrame = nullptr

Definition at line 30 of file Scenario1_CorrelateStreams.xaml.h.

Windows::Media::Capture::Frames::MediaFrameReader reader = nullptr

Definition at line 31 of file Scenario1_CorrelateStreams.xaml.h.

Windows::Media::Capture::Frames::MediaFrameSourceInfo sourceInfo = nullptr

Definition at line 29 of file Scenario1_CorrelateStreams.xaml.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Fx2Driver Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Fx2Driver
Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes

Fx2Driver Class Reference

#include "Fx2Driver.h"

List of all members.

Static Public Member Functions

static byte | DigitToSevenSegment (byte value)
static byte | DigitToSevenSegment (byte value)
static byte | SevenSegmentToDigit (byte value)
static byte | SevenSegmentToDigit (byte value)

Public Attributes

internal | __pad0__: static const uint16 DeviceType = 65500U
const ushort | DeviceType = 65500
const ushort | FunctionBase = 0x800

Static Public Attributes

static const Platform::Guid | DeviceInterfaceGuid = Guid(GUID_DEVINTERFACE_OSRUSBFX2)
static readonly Guid | DeviceInterfaceGuid = new Guid("573E8C73-0CB4-4471-A1BF-FAB26C31D384")
static const uint16 | FunctionBase = 0x800
static IOControlCode | GetInterruptMessage
static
Windows::Devices::Custom::IOControlCode 		GetInterruptMessage
static IOControlCode | GetSevenSegmentDisplay
static
Windows::Devices::Custom::IOControlCode 		GetSevenSegmentDisplay
static IOControlCode | ReadSwitches
static
Windows::Devices::Custom::IOControlCode 		ReadSwitches
static
Windows::Devices::Custom::IOControlCode 		SetSevenSegmentDisplay
static IOControlCode | SetSevenSegmentDisplay

Static Private Attributes

static const byte | SevenSegmentValues [10]
static readonly byte[] | SevenSegmentValues

Detailed Description

Definition at line 16 of file Fx2Driver.h.

Member Function Documentation

byte DigitToSevenSegment ( byte value ) [static]

Definition at line 29 of file Fx2Driver.cpp.

{
    return SevenSegmentValues[value];
}

static byte DigitToSevenSegment ( byte value ) [inline, static]

Definition at line 60 of file Fx2Driver.cs.

        {
            return SevenSegmentValues[value];
        }

static byte SevenSegmentToDigit ( byte value ) [inline, static]

Definition at line 66 of file Fx2Driver.cs.

        {
            for (byte i = 0; i < SevenSegmentValues.Length; i += 1)
            {
                if (SevenSegmentValues[i] == value)
                {
                    return i;
                }
            }
            return 0xff;
        }

byte SevenSegmentToDigit ( byte value ) [static]

Definition at line 34 of file Fx2Driver.cpp.

{
    for (byte i = 0; i < ARRAYSIZE(SevenSegmentValues); i += 1)
    {
        if (SevenSegmentValues[i] == value)
        {
            return i;
        }
    }
    return 0xff;
}

Member Data Documentation

internal __pad0__

Definition at line 19 of file Fx2Driver.h.

readonly Guid DeviceInterfaceGuid = new Guid("573E8C73-0CB4-4471-A1BF-FAB26C31D384") [static]

Definition at line 78 of file Fx2Driver.cs.

const Guid DeviceInterfaceGuid = Guid(GUID_DEVINTERFACE_OSRUSBFX2) [static]

Definition at line 27 of file Fx2Driver.h.

const ushort DeviceType = 65500

Definition at line 19 of file Fx2Driver.cs.

const uint16 FunctionBase = 0x800 [static]

Definition at line 20 of file Fx2Driver.h.

const ushort FunctionBase = 0x800

Definition at line 20 of file Fx2Driver.cs.

IOControlCode GetInterruptMessage [static]
Initial value:
 ref new IOControlCode(DeviceType,
                                                                      FunctionBase + 9,
                                                                      IOControlAccessMode::Read,
                                                                      IOControlBufferingMethod::DirectOutput)

Definition at line 25 of file Fx2Driver.h.

IOControlCode GetInterruptMessage [static]
Initial value:
 new IOControlCode(DeviceType,
                                                              FunctionBase + 9,
                                                              IOControlAccessMode.Read,
                                                              IOControlBufferingMethod.DirectOutput)

Definition at line 41 of file Fx2Driver.cs.

IOControlCode GetSevenSegmentDisplay [static]
Initial value:
 new IOControlCode(DeviceType,
                                                                 FunctionBase + 7,
                                                                 IOControlAccessMode.Read,
                                                                 IOControlBufferingMethod.Buffered)

Definition at line 23 of file Fx2Driver.cs.

IOControlCode GetSevenSegmentDisplay [static]
Initial value:
 ref new IOControlCode(DeviceType,
                                                                         FunctionBase + 7,
                                                                         IOControlAccessMode::Read,
                                                                         IOControlBufferingMethod::Buffered)

Definition at line 22 of file Fx2Driver.h.

IOControlCode ReadSwitches [static]
Initial value:
 ref new IOControlCode(DeviceType,
                                                               FunctionBase + 6,
                                                               IOControlAccessMode::Read,
                                                               IOControlBufferingMethod::Buffered)

Definition at line 24 of file Fx2Driver.h.

IOControlCode ReadSwitches [static]
Initial value:
 new IOControlCode(DeviceType,
                                                       FunctionBase + 6,
                                                       IOControlAccessMode.Read,
                                                       IOControlBufferingMethod.Buffered)

Definition at line 35 of file Fx2Driver.cs.

IOControlCode SetSevenSegmentDisplay [static]
Initial value:
 ref new IOControlCode(DeviceType,
                                                                         FunctionBase + 8,
                                                                         IOControlAccessMode::Write,
                                                                         IOControlBufferingMethod::Buffered)

Definition at line 23 of file Fx2Driver.h.

IOControlCode SetSevenSegmentDisplay [static]
Initial value:
 new IOControlCode(DeviceType,
                                                                 FunctionBase + 8,
                                                                 IOControlAccessMode.Write,
                                                                 IOControlBufferingMethod.Buffered)

Definition at line 29 of file Fx2Driver.cs.

const byte SevenSegmentValues [static, private]
Initial value:
 {
    0xD7,
    0x06,
    0xB3,
    0xA7,
    0x66,
    0xE5,
    0xF4,
    0x07,
    0xF7,
    0x67,
}

Definition at line 33 of file Fx2Driver.h.

readonly byte [] SevenSegmentValues [static, private]
Initial value:
 {
                                            0xD7,
                                            0x06,
                                            0xB3,
                                            0xA7,
                                            0x66,
                                            0xE5,
                                            0xF4,
                                            0x07,
                                            0xF7,
                                            0x67,
                                          }

Definition at line 46 of file Fx2Driver.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cpp/Fx2Driver.h
  • CustomCapability/cs/Fx2Driver.cs
  • CustomCapability/cpp/Fx2Driver.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeneratedBitmapState Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • GeneratedBitmapState
Public Attributes

GeneratedBitmapState Class Reference

List of all members.

Public Attributes

int | bitmapHeight
int | bitmapWidth
CanvasDevice | canvasDevice = null
int | frameNumber = 0
CanvasRenderTarget | offscreenCanvas = null
CanvasDrawingSession | offscreenDrawingSession = null
SoftwareBitmap | squareBitmap = null
Windows.Storage.Streams.Buffer | squareBuffer = null
float | squareLength
float | squareY

Detailed Description

Definition at line 44 of file Scenario2_Effects.xaml.cs.

Member Data Documentation

int bitmapHeight

Definition at line 48 of file Scenario2_Effects.xaml.cs.

int bitmapWidth

Definition at line 47 of file Scenario2_Effects.xaml.cs.

CanvasDevice canvasDevice = null

Definition at line 53 of file Scenario2_Effects.xaml.cs.

int frameNumber = 0

Definition at line 51 of file Scenario2_Effects.xaml.cs.

CanvasRenderTarget offscreenCanvas = null

Definition at line 54 of file Scenario2_Effects.xaml.cs.

CanvasDrawingSession offscreenDrawingSession = null

Definition at line 55 of file Scenario2_Effects.xaml.cs.

SoftwareBitmap squareBitmap = null

Definition at line 57 of file Scenario2_Effects.xaml.cs.

Windows.Storage.Streams.Buffer squareBuffer = null

Definition at line 58 of file Scenario2_Effects.xaml.cs.

float squareLength

Definition at line 49 of file Scenario2_Effects.xaml.cs.

float squareY

Definition at line 50 of file Scenario2_Effects.xaml.cs.

The documentation for this class was generated from the following file:
  • LampArray/cs/Scenario2_Effects.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeoEquals Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • GeoEquals
Public Member Functions

GeoEquals Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

bool operator() (const Windows::Devices::Geolocation::BasicGeoposition &left, const Windows::Devices::Geolocation::BasicGeoposition &right) const

Detailed Description

Definition at line 52 of file SampleConfiguration.h.

Member Function Documentation

bool operator() | ( | const Windows::Devices::Geolocation::BasicGeoposition & | left,
 |  | const Windows::Devices::Geolocation::BasicGeoposition & | right |
 | ) |  |  | const [inline]

Definition at line 54 of file SampleConfiguration.h.

        {
            return left.Altitude == right.Altitude && left.Latitude == right.Latitude && left.Longitude == right.Longitude;
        }

The documentation for this struct was generated from the following file:
  • MapControl/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GroupedBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • GroupedBackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

GroupedBackgroundTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

GroupedBackgroundTask ()
GroupedBackgroundTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterGroupedBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterGroupedBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterGroupedTask (object sender, RoutedEventArgs e)
void | UnregisterGroupedTask (object sender, RoutedEventArgs e)
void | UnregisterUngroupedTasks (object sender, RoutedEventArgs e)
void | UnregisterUngroupedTasks (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

BackgroundTaskRegistrationGroup | group
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario6_GroupedTask.xaml.cs.

Constructor & Destructor Documentation

GroupedBackgroundTask ( ) [inline]

Definition at line 34 of file Scenario6_GroupedTask.xaml.cs.

        {
            this.InitializeComponent();
        }

GroupedBackgroundTask ( ) [inline]

Definition at line 34 of file Scenario6_GroupedTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 110 of file Scenario6_GroupedTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 110 of file Scenario6_GroupedTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 136 of file Scenario6_GroupedTask.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 136 of file Scenario6_GroupedTask.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 46 of file Scenario6_GroupedTask.xaml.cs.

        {
            group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);

            foreach (var task in group.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.GroupedBackgroundTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.GroupedBackgroundTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 46 of file Scenario6_GroupedTask.xaml.cs.

        {
            group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);

            foreach (var task in group.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.GroupedBackgroundTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.GroupedBackgroundTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 121 of file Scenario6_GroupedTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.GroupedBackgroundTaskProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 121 of file Scenario6_GroupedTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.GroupedBackgroundTaskProgress = progress;
                UpdateUI();
            });
        }

void RegisterGroupedBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a Grouped Background Task.

Parameters:
sender
e

Definition at line 68 of file Scenario6_GroupedTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.GroupedBackgroundTaskName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   null,
                                                                   group);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterGroupedBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a Grouped Background Task.

Parameters:
sender
e

Definition at line 68 of file Scenario6_GroupedTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
                                                                   BackgroundTaskSample.GroupedBackgroundTaskName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   null,
                                                                   group);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void UnregisterGroupedTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a Grouped Background Task.

Parameters:
sender
e

Definition at line 85 of file Scenario6_GroupedTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.GroupedBackgroundTaskName, group);
            UpdateUI();
        }

void UnregisterGroupedTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a Grouped Background Task.

Parameters:
sender
e

Definition at line 85 of file Scenario6_GroupedTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.GroupedBackgroundTaskName, group);
            UpdateUI();
        }

void UnregisterUngroupedTasks | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregisters all Background Tasks that are not in groups.

This will not impact tasks registered with groups.

Parameters:
sender
e

Definition at line 97 of file Scenario6_GroupedTask.xaml.cs.

        {
            foreach(var cur in BackgroundTaskRegistration.AllTasks)
            {
                cur.Value.Unregister(true);
                BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(cur.Value.Name, false);
            }
        }

void UnregisterUngroupedTasks | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregisters all Background Tasks that are not in groups.

This will not impact tasks registered with groups.

Parameters:
sender
e

Definition at line 97 of file Scenario6_GroupedTask.xaml.cs.

        {
            foreach(var cur in BackgroundTaskRegistration.AllTasks)
            {
                cur.Value.Unregister(true);
                BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(cur.Value.Name, false);
            }
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 144 of file Scenario6_GroupedTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.GroupedBackgroundTaskRegistered;
                UnregisterGroupedButton.IsEnabled = BackgroundTaskSample.GroupedBackgroundTaskRegistered;
                Progress.Text = BackgroundTaskSample.GroupedBackgroundTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.GroupedBackgroundTaskName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 144 of file Scenario6_GroupedTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.GroupedBackgroundTaskRegistered;
                UnregisterGroupedButton.IsEnabled = BackgroundTaskSample.GroupedBackgroundTaskRegistered;
                Progress.Text = BackgroundTaskSample.GroupedBackgroundTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.GroupedBackgroundTaskName);
            });
        }

Member Data Documentation

BackgroundTaskRegistrationGroup group [private]

Definition at line 39 of file Scenario6_GroupedTask.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario6_GroupedTask.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario6_GroupedTask.xaml.cs
  • BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GroupInfoList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • GroupInfoList
Properties

GroupInfoList Class Reference

Inherits List< object >.

List of all members.

Properties

string Key [get, set]

Detailed Description

Definition at line 15 of file GroupInfoList.cs.

Property Documentation

string Key [get, set]

Definition at line 17 of file GroupInfoList.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/GroupInfoList.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GuidComparer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • GuidComparer
Public Member Functions

GuidComparer Struct Reference

#include "Scenario1_Download.xaml.h"

List of all members.

Public Member Functions

bool operator() (const Platform::Guid &, const Platform::Guid &) const

Detailed Description

Definition at line 25 of file Scenario1_Download.xaml.h.

Member Function Documentation

bool operator() | ( | const Platform::Guid & | ,
 |  | const Platform::Guid & |  |
 | ) |  |  | const [inline]

Definition at line 27 of file Scenario1_Download.xaml.h.

        {
            return false;
        }

The documentation for this struct was generated from the following file:
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HelperFunctions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • HelperFunctions
Static Public Member Functions

HelperFunctions Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static void | UpdateCanvasSize (Windows::UI::Xaml::FrameworkElement^root, Windows::UI::Xaml::FrameworkElement^output, Windows::UI::Xaml::FrameworkElement^inkCanvas)
static void | UpdateCanvasSize (FrameworkElement root, FrameworkElement output, FrameworkElement inkCanvas)

Detailed Description

Definition at line 48 of file SampleConfiguration.h.

Member Function Documentation

static void UpdateCanvasSize | ( | Windows::UI::Xaml::FrameworkElement^ | root,
 |  | Windows::UI::Xaml::FrameworkElement^ | output,
 |  | Windows::UI::Xaml::FrameworkElement^ | inkCanvas |
 | ) |  |  | [static]
static void UpdateCanvasSize | ( | FrameworkElement | root,
 |  | FrameworkElement | output,
 |  | FrameworkElement | inkCanvas |
 | ) |  |  | [inline, static]

Definition at line 48 of file SampleConfiguration.cs.

        {
            output.Width = root.ActualWidth;
            output.Height = root.ActualHeight / 2;
            inkCanvas.Width = root.ActualWidth;
            inkCanvas.Height = root.ActualHeight / 2;
        }

The documentation for this class was generated from the following files:
  • SimpleInk/cpp/SampleConfiguration.h
  • SimpleInk/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
Classes | Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes

Helpers Class Reference

List of all members.

Classes

class | BufferConverter
class | sealed
class | ServiceStatusConverter

Static Public Member Functions

static async Task< string > | AddAppContentFilesToIndexedFolder ()
static async Task< string > | AddItemsToIndex (Windows.Storage.Search.ContentIndexer indexer)
static void | AppendLine (TextBlock textBlock, string message)
static string | CreateItemString (string itemKey, IEnumerable< string > propertyKeys, IReadOnlyDictionary< string, object > properties)
static string | CreateItemString (string itemKey, IEnumerable< string > propertyKeys, IDictionary< string, object > properties)
static void | EvaluateAndReportConnectionCost (ConnectionCost connectionCost, TextBlock textBlock)
static async Task | EvaluateCostAndConnectAsync (ConnectionCost connectionCost, bool optedInToCharges, TextBlock textBlock)
static string | GetFriendlyName (TetheringWiFiBand value)
static string | GetFriendlyName (TetheringWiFiAuthenticationKind value)
static T | GetSelectedItemTag< T > (Selector selector)
static void | InitializeRevisionNumber ()
static bool | IsBandSupported (NetworkOperatorTetheringAccessPointConfiguration configuration, TetheringWiFiBand band)
static void | OnIndexerOperationBegin ()
static void | OnIndexerOperationComplete (Windows.Storage.Search.ContentIndexer indexer)
static double | ParseUIntWithFallback (TextBox textBox, double fallback)
static bool | ShouldAttemptToConnectToInternet (NetworkConnectivityLevel connectivityLevel)
static string | StringifyProperty (object property)
static
NetworkOperatorTetheringManager 		TryGetCurrentNetworkOperatorTetheringManager ()

Private Types

enum | CostGuidance { Normal, OptIn, Conservative }

Static Private Member Functions

static internal HttpClient | CreateHttpClientWithPlugIn ()
static internal async Task | DisplayTextResultAsync (HttpResponseMessage response, TextBox output, CancellationToken token)
static internal void | DisplayWebError (MainPage rootPage, Exception exception)
static CostGuidance | GetNetworkCostGuidance (ConnectionCost connectionCost)
static internal void | ReplaceQueryString (TextBox addressField, string newQueryString)
static internal void | ScenarioCompleted (Button startButton, Button cancelButton)
static internal void | ScenarioStarted (Button startButton, Button cancelButton, TextBox outputField)
static async Task< string > | SendHttpGetRequestAsync ()
static internal void | SerializeHeaderCollection (IEnumerable< KeyValuePair< string, string >> headers, StringBuilder output)
static internal string | SerializeHeaders (HttpResponseMessage response)
static internal Uri | TryParseHttpUri (string uriString)

Private Attributes

const int | E_INVALID_STATE = unchecked((int)0x8007139f)

Detailed Description

Definition at line 9 of file Helpers.cs.

Member Enumeration Documentation

enum CostGuidance [private]
Enumerator:
Normal
OptIn
Conservative

Definition at line 26 of file Helpers.cs.

        {
            Normal,
            OptIn,
            Conservative
        }

Member Function Documentation

static async Task<string> AddAppContentFilesToIndexedFolder ( ) [inline, static]

For the purposes of this sample, the appcontent-ms files are stored in an "appcontent-ms" folder in the install directory.

These are then copied into the app's "LocalState\Indexed" folder, which exposes them to the indexer.

Definition at line 116 of file Helpers.cs.

        {
            var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            var installDirectory = Windows.ApplicationModel.Package.Current.InstalledLocation;
            var outputString = "Items added to the \"Indexed\" folder:";
            var appContentFolder = await installDirectory.GetFolderAsync("appcontent-ms");
            var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
            var files = await appContentFolder.GetFilesAsync();
            foreach (var file in files)
            {
                outputString += "\n" + file.DisplayName + file.FileType;
                await file.CopyAsync(indexedFolder, file.Name, Windows.Storage.NameCollisionOption.ReplaceExisting);
            }
            return outputString;
        }

static async Task<string> AddItemsToIndex ( Windows.Storage.Search.ContentIndexer indexer ) [inline, static]

This function inserts three items into the index with generic Key, Name, Keywords, and Comment properties.

Definition at line 86 of file Helpers.cs.

        {
            var content = new Windows.Storage.Search.IndexableContent();
            const int numberOfItemsToIndex = 3;
            for (int i = 0; i < numberOfItemsToIndex; i++)
            {
                content.Properties[Windows.Storage.SystemProperties.ItemNameDisplay] = "Sample Item Name " + i;
                content.Properties[Windows.Storage.SystemProperties.Keywords] = "Sample keyword " + i;
                content.Properties[Windows.Storage.SystemProperties.Comment] = "Sample comment " + i;
                content.Id = "SampleKey" + i;
                OnIndexerOperationBegin();
                await indexer.AddAsync(content);
                OnIndexerOperationComplete(indexer);
            }
            string[] propertiesToQuery =
            {
                Windows.Storage.SystemProperties.ItemNameDisplay,
                Windows.Storage.SystemProperties.Keywords,
                Windows.Storage.SystemProperties.Comment
            };
            var query = indexer.CreateQuery("*", propertiesToQuery);
            uint count = await query.GetCountAsync();
            return "Number of items currently in the index: " + count;
        }

static void AppendLine | ( | TextBlock | textBlock,
 |  | string | message |
 | ) |  |  | [inline, static]

Definition at line 21 of file Helpers.cs.

        {
            textBlock.Text += message + "\n\n";
        }

static internal HttpClient CreateHttpClientWithPlugIn ( ) [inline, static, private]

Definition at line 83 of file Helpers.cs.

        {

            // HttpClient functionality can be extended by plugging multiple filters together and providing
            // HttpClient with the configured filter pipeline.
            IHttpFilter filter = new HttpBaseProtocolFilter();
            filter = new PlugInFilter(filter); // Adds a custom header to every request and response message.
            HttpClient httpClient = new HttpClient(filter);

            // The following line sets a "User-Agent" request header as a default header on the HttpClient instance.
            // Default headers will be sent with every request sent from this HttpClient instance.
            httpClient.DefaultRequestHeaders.UserAgent.Add(new HttpProductInfoHeaderValue("Sample", "v8"));

            return httpClient;
        }

static string CreateItemString | ( | string | itemKey,
 |  | IEnumerable< string > | propertyKeys,
 |  | IReadOnlyDictionary< string, object > | properties |
 | ) |  |  | [inline, static]

Definition at line 63 of file Helpers.cs.

        {
            string itemString = "Key: " + itemKey + "\n";
            foreach (var propertyKey in propertyKeys)
            {
                itemString += propertyKey + ": " + StringifyProperty(properties[propertyKey]) + "\n";
            }
            return itemString;
        }

static string CreateItemString | ( | string | itemKey,
 |  | IEnumerable< string > | propertyKeys,
 |  | IDictionary< string, object > | properties |
 | ) |  |  | [inline, static]

Definition at line 73 of file Helpers.cs.

        {
            string itemString = "Key: " + itemKey + "\n";
            foreach (var propertyKey in propertyKeys)
            {
                itemString += propertyKey + ": " + StringifyProperty(properties[propertyKey]) + "\n";
            }
            return itemString;
        }

static internal async Task DisplayTextResultAsync | ( | HttpResponseMessage | response,
 |  | TextBox | output,
 |  | CancellationToken | token |
 | ) |  |  | [inline, static, private]

Definition at line 28 of file Helpers.cs.

        {
            string responseBodyAsText;
            output.Text += SerializeHeaders(response);
            responseBodyAsText = await response.Content.ReadAsStringAsync().AsTask(token);

            token.ThrowIfCancellationRequested();

            // Insert new lines.
            responseBodyAsText = responseBodyAsText.Replace("<br>", Environment.NewLine);

            output.Text += responseBodyAsText;
        }

static internal void DisplayWebError | ( | MainPage | rootPage,
 |  | Exception | exception |
 | ) |  |  | [inline, static, private]

Definition at line 45 of file Helpers.cs.

        {
            WebErrorStatus webErrorStatus = WebError.GetStatus(exception.HResult);
            if (webErrorStatus == WebErrorStatus.Unknown)
            {
                rootPage.NotifyUser("Unknown Error: " + exception.Message, NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser("Web Error: " + webErrorStatus, NotifyType.ErrorMessage);
            }

        }

static void EvaluateAndReportConnectionCost | ( | ConnectionCost | connectionCost,
 |  | TextBlock | textBlock |
 | ) |  |  | [inline, static]

Definition at line 82 of file Helpers.cs.

        {
            CostGuidance costGuidance = GetNetworkCostGuidance(connectionCost);
            switch (costGuidance)
            {
                // In opt-in scenarios, apps handle cases where the network access cost is significantly higher than the plan cost.
                // For example, when a user is roaming, a mobile carrier may charge a higher rate data usage.
                case CostGuidance.OptIn:
                    AppendLine(textBlock, "Apps should implement opt-in behavior.");
                    break;
                // In conservative scenarios, apps implement restrictions for optimizing network usage to handle transfers over metered networks.
                case CostGuidance.Conservative:
                    AppendLine(textBlock, "Apps should implement conservative behavior.");
                    break;
                // In normal scenarios, apps do not implement restrictions. Apps treat the connection as unlimited in cost.
                case CostGuidance.Normal:
                default:
                    AppendLine(textBlock, "Apps should implement normal behavior.");
                    break;
            }
        }

static async Task EvaluateCostAndConnectAsync | ( | ConnectionCost | connectionCost,
 |  | bool | optedInToCharges,
 |  | TextBlock | textBlock |
 | ) |  |  | [inline, static]

Definition at line 104 of file Helpers.cs.

        {
            CostGuidance costGuidance = GetNetworkCostGuidance(connectionCost);
            switch (costGuidance)
            {
                case CostGuidance.OptIn:
                    {
                        AppendLine(textBlock, "Connecting to the Internet may incur charges.");
                        if (optedInToCharges)
                        {
                            AppendLine(textBlock, "User has opted in to additional network usage charges.");
                            AppendLine(textBlock, await SendHttpGetRequestAsync());
                        }
                        else
                        {
                            AppendLine(textBlock, "User has opted out of additional network usage charges. Not connecting to the Internet.");
                        }
                    }
                    break;
                case CostGuidance.Conservative:
                    AppendLine(textBlock, "Attempting to connect to the Internet, optimizing traffic for conservative network usage.");
                    AppendLine(textBlock, await SendHttpGetRequestAsync());
                    break;
                case CostGuidance.Normal:
                default:
                    AppendLine(textBlock, "Attempting to connect to the Internet.");
                    AppendLine(textBlock, await SendHttpGetRequestAsync());
                    break;
            }
        }

static string GetFriendlyName ( TetheringWiFiBand value ) [inline, static]

Definition at line 99 of file SampleConfiguration.cs.

        {
            switch (value)
            {
                case TetheringWiFiBand.Auto: return "Any available";
                case TetheringWiFiBand.TwoPointFourGigahertz: return "2.4 GHz";
                case TetheringWiFiBand.FiveGigahertz: return "5 Ghz";
                case TetheringWiFiBand.SixGigahertz: return "6 GHz";
                default: return $"Unknown ({(uint)value})";
            }
        }

static string GetFriendlyName ( TetheringWiFiAuthenticationKind value ) [inline, static]

Definition at line 111 of file SampleConfiguration.cs.

        {
            switch (value)
            {
                case TetheringWiFiAuthenticationKind.Wpa2:
                    return "WPA2";
                case TetheringWiFiAuthenticationKind.Wpa3TransitionMode:
                    return "WPA2/WPA3";
                case TetheringWiFiAuthenticationKind.Wpa3:
                    return "WPA3";
                default:
                    return $"Unknown ({(uint)value})";
            }
        }

static CostGuidance GetNetworkCostGuidance ( ConnectionCost connectionCost ) [inline, static, private]

Definition at line 64 of file Helpers.cs.

        {
            CostGuidance costGuidance = CostGuidance.Normal;
            if (connectionCost.Roaming || connectionCost.OverDataLimit)
            {
                costGuidance = CostGuidance.OptIn;
            }
            else if (connectionCost.NetworkCostType == NetworkCostType.Fixed || connectionCost.NetworkCostType == NetworkCostType.Variable)
            {
                costGuidance = CostGuidance.Conservative;
            }
            else
            {
                costGuidance = CostGuidance.Normal;
            }
            return costGuidance;
        }

static T GetSelectedItemTag< T > ( Selector selector ) [inline, static]
static void InitializeRevisionNumber ( ) [inline, static]

Definition at line 11 of file Helpers.cs.

        {
            // This initializes the value used throughout the sample which tracks the expected index revision number. This
            // value is used to check if the app's expected revision number matches the actual index revision number and is
            // stored in the app's local settings to allow it to persist across termination.
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            if (!localSettings.Values.ContainsKey("expectedIndexRevision"))
            {
                localSettings.Values.Add("expectedIndexRevision", (ulong)0);
            }
        }

static bool IsBandSupported | ( | NetworkOperatorTetheringAccessPointConfiguration | configuration,
 |  | TetheringWiFiBand | band |
 | ) |  |  | [inline, static]

Definition at line 131 of file SampleConfiguration.cs.

        {
            // "Auto" mode is always supported even though it is technically not a frequency band.
            if (band == TetheringWiFiBand.Auto)
            {
                return true;
            }

            try
            {
                return configuration.IsBandSupported(band);
            }
            catch (Exception ex) when (ex.HResult == E_INVALID_STATE)
            {
                // The WiFi device has been disconnected. Report that we support nothing.
                return false;
            }
        }

static void OnIndexerOperationBegin ( ) [inline, static]

Definition at line 23 of file Helpers.cs.

        {
            // Update the expected index revision number in expectation of the call that's about to be made
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            var revisionNumber = localSettings.Values["expectedIndexRevision"];
            localSettings.Values["expectedIndexRevision"] = (ulong)((ulong)revisionNumber + 1);
        }

static void OnIndexerOperationComplete ( Windows.Storage.Search.ContentIndexer indexer ) [inline, static]

Definition at line 31 of file Helpers.cs.

        {
            // Set the expectedIndexRevision to be the reported index revision number because the operation
            // has succeeded
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            localSettings.Values["expectedIndexRevision"] = indexer.Revision;
        }

static double ParseUIntWithFallback | ( | TextBox | textBox,
 |  | double | fallback |
 | ) |  |  | [inline, static]

Definition at line 67 of file SampleConfiguration.cs.

        {
            uint value;
            if (uint.TryParse(textBox.Text, out value))
            {
                return value;
            }
            return fallback;
        }

static internal void ReplaceQueryString | ( | TextBox | addressField,
 |  | string | newQueryString |
 | ) |  |  | [inline, static, private]

Definition at line 115 of file Helpers.cs.

        {
            string resourceAddress = addressField.Text;

            // Remove previous query string.
            int questionMarkIndex = resourceAddress.IndexOf("?", StringComparison.Ordinal);
            if (questionMarkIndex != -1)
            {
                resourceAddress = resourceAddress.Substring(0, questionMarkIndex);
            }

            addressField.Text = resourceAddress + newQueryString;
        }

static internal void ScenarioCompleted | ( | Button | startButton,
 |  | Button | cancelButton |
 | ) |  |  | [inline, static, private]

Definition at line 109 of file Helpers.cs.

        {
            startButton.IsEnabled = true;
            cancelButton.IsEnabled = false;
        }

static internal void ScenarioStarted | ( | Button | startButton,
 |  | Button | cancelButton,
 |  | TextBox | outputField |
 | ) |  |  | [inline, static, private]

Definition at line 99 of file Helpers.cs.

        {
            startButton.IsEnabled = false;
            cancelButton.IsEnabled = true;
            if (outputField != null)
            {
                outputField.Text = String.Empty;
            }
        }

static async Task<string> SendHttpGetRequestAsync ( ) [inline, static, private]

Definition at line 44 of file Helpers.cs.

        {
            string message;
            HttpClient httpClient = new HttpClient();
            HttpGetStringResult result = await httpClient.TryGetStringAsync(new Uri("http://www.msftconnecttest.com/connecttest.txt"));
            if (result.Succeeded)
            {
                message = $"Connection to server confirmed: \"{result.Value}\"";
            }
            else if (result.ResponseMessage != null)
            {
                message = $"Cannot connect to server: {result.ResponseMessage.StatusCode}";
            }
            else
            {
                message = $"Cannot connect to server: {result.ExtendedError.Message}";
            }
            return message;
        }

static internal void SerializeHeaderCollection | ( | IEnumerable< KeyValuePair< string, string >> | headers,
 |  | StringBuilder | output |
 | ) |  |  | [inline, static, private]

Definition at line 73 of file Helpers.cs.

        {
            foreach (var header in headers)
            {
                output.Append(header.Key + ": " + header.Value + "\r\n");
            }
        }

static internal string SerializeHeaders ( HttpResponseMessage response ) [inline, static, private]

Definition at line 59 of file Helpers.cs.

        {
            StringBuilder output = new StringBuilder();

            // We cast the StatusCode to an int so we display the numeric value (e.g., "200") rather than the
            // name of the enum (e.g., "OK") which would often be redundant with the ReasonPhrase.
            output.Append(((int)response.StatusCode) + " " + response.ReasonPhrase + "\r\n");

            SerializeHeaderCollection(response.Headers, output);
            SerializeHeaderCollection(response.Content.Headers, output);
            output.Append("\r\n");
            return output.ToString();
        }

static bool ShouldAttemptToConnectToInternet ( NetworkConnectivityLevel connectivityLevel ) [inline, static]

Definition at line 33 of file Helpers.cs.

        {
            bool shouldConnectToInternet = false;
            if (connectivityLevel == NetworkConnectivityLevel.LocalAccess || connectivityLevel == NetworkConnectivityLevel.InternetAccess)
            {
                shouldConnectToInternet = true;
            }

            return shouldConnectToInternet;
        }

static string StringifyProperty ( object property ) [inline, static]

This function takes a string or vector string property value and returns a flattened string representation of it.

Definition at line 42 of file Helpers.cs.

        {
            string propertyString = "";
            if (property != null)
            {
                var vectorProperty = property as IEnumerable<string>;
                if (vectorProperty != null)
                {
                    foreach (var prop in vectorProperty)
                    {
                        propertyString += prop + "; ";
                    }
                }
                else
                {
                    propertyString = property.ToString();
                }
            }
            return propertyString;
        }

static NetworkOperatorTetheringManager TryGetCurrentNetworkOperatorTetheringManager ( ) [inline, static]

Definition at line 41 of file SampleConfiguration.cs.

        {
            // Get the connection profile associated with the internet connection currently used by the local machine.
            ConnectionProfile currentConnectionProfile = NetworkInformation.GetInternetConnectionProfile();
            if (currentConnectionProfile == null)
            {
                MainPage.Current.NotifyUser("System is not connected to the Internet.", NotifyType.ErrorMessage);
                return null;
            }

            TetheringCapability tetheringCapability =
                NetworkOperatorTetheringManager.GetTetheringCapabilityFromConnectionProfile(currentConnectionProfile);

            if (tetheringCapability != TetheringCapability.Enabled)
            {
                string message;
                switch (tetheringCapability)
                {
                    case TetheringCapability.DisabledByGroupPolicy:
                        message = "Tethering is disabled due to group policy.";
                        break;
                    case TetheringCapability.DisabledByHardwareLimitation:
                        message = "Tethering is not available due to hardware limitations.";
                        break;
                    case TetheringCapability.DisabledByOperator:
                        message = "Tethering operations are disabled for this account by the network operator.";
                        break;
                    case TetheringCapability.DisabledByRequiredAppNotInstalled:
                        message = "An application required for tethering operations is not available.";
                        break;
                    case TetheringCapability.DisabledBySku:
                        message = "Tethering is not supported by the current account services.";
                        break;
                    case TetheringCapability.DisabledBySystemCapability:
                        // This will occur if the "wiFiControl" capability is missing from the App.
                        message = "This app is not configured to access Wi-Fi devices on this machine.";
                        break;
                    default:
                        message = $"Tethering is disabled on this machine. (Code {(int)tetheringCapability}).";
                        break;
                }
                MainPage.Current.NotifyUser(message, NotifyType.ErrorMessage);
                return null;
            }

            const int E_NOT_FOUND = unchecked((int)0x80070490); // HRESULT_FROM_WIN32(ERROR_NOT_FOUND)

            try
            {
                return NetworkOperatorTetheringManager.CreateFromConnectionProfile(currentConnectionProfile);
            }
            catch (Exception ex) when (ex.HResult == E_NOT_FOUND)
            {
                MainPage.Current.NotifyUser("System has no Wi-Fi adapters.", NotifyType.ErrorMessage);
                return null;
            }
        }

static internal Uri TryParseHttpUri ( string uriString ) [inline, static, private]

Definition at line 129 of file Helpers.cs.

        {
            // Note that this app has both "Internet (Client)" and "Home and Work Networking" capabilities set,
            // since the user may provide URIs for servers located on the internet or intranet. If apps only
            // communicate with servers on the internet, only the "Internet (Client)" capability should be set.
            // Similarly if an app is only intended to communicate on the intranet, only the "Home and Work
            // Networking" capability should be set.
            Uri uri;
            if (!Uri.TryCreate(uriString.Trim(), UriKind.Absolute, out uri))
            {
                return null;
            }

            if (uri.Scheme != "http" && uri.Scheme != "https")
            {
                return null;
            }

            return uri;
        }

Member Data Documentation

const int E_INVALID_STATE = unchecked((int)0x8007139f) [private]

Definition at line 126 of file SampleConfiguration.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/Helpers.cs
  • NetworkConnectivity/cs/Helpers.cs
  • MobileHotspot/cs/SampleConfiguration.cs
  • HttpClient/cs/Helpers.cs
  • LineDisplay/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers::BufferConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
  • Helpers::BufferConverter
Public Member Functions

Helpers::BufferConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 19 of file BufferConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 21 of file BufferConverter.cs.

        {
            String metadata = String.Empty;
            IBuffer buffer = value as IBuffer;
            if (buffer != null)
            {
                using (var metadataReader = DataReader.FromBuffer(buffer))
                {
                    metadata = metadataReader.ReadString(buffer.Length);
                }
                metadata = String.Format(CultureInfo.InvariantCulture, "({0})", metadata);
            }
            return metadata;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 36 of file BufferConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following file:
  • WiFiDirectServices/cs/Helpers/BufferConverter.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CommonLicenseRequest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
  • CommonLicenseRequest
Public Member Functions | Private Attributes

CommonLicenseRequest Class Reference

List of all members.

Public Member Functions

CommonLicenseRequest (HttpClient client=null)
virtual async Task< HttpContent > | AcquireLicenseAsync (Uri licenseServerUri, HttpContent httpRequestContent)
string | GetLastErrorMessage ()

Private Attributes

HttpClient | httpClient
string | lastErrorMessage

Detailed Description

Definition at line 21 of file CommonLicenseRequest.cs.

Constructor & Destructor Documentation

CommonLicenseRequest ( HttpClient client = null ) [inline]

Definition at line 29 of file CommonLicenseRequest.cs.

        {
            if (client == null)
                httpClient = new HttpClient();
            else
                httpClient = client;
            lastErrorMessage = string.Empty;
        }

Member Function Documentation

virtual async Task<HttpContent> AcquireLicenseAsync | ( | Uri | licenseServerUri,
 |  | HttpContent | httpRequestContent |
 | ) |  |  | [inline, virtual]

Invoked to acquire the PlayReady license.

Parameters:
licenseServerUri | License Server URI to retrieve the PlayReady license.
httpRequestContent | HttpContent including the Challenge transmitted to the PlayReady server.

Definition at line 42 of file CommonLicenseRequest.cs.

        {
            try
            {
                httpClient.DefaultRequestHeaders.Add("msprdrm_server_redirect_compat", "false");
                httpClient.DefaultRequestHeaders.Add("msprdrm_server_exception_compat", "false");

                HttpResponseMessage response = await httpClient.PostAsync(licenseServerUri, httpRequestContent);
                response.EnsureSuccessStatusCode();

                if (response.StatusCode == HttpStatusCode.OK)
                {
                    lastErrorMessage = string.Empty;
                    return response.Content;
                }
                else
                {
                    lastErrorMessage = "AcquireLicense - Http Response Status Code: " + response.StatusCode.ToString();
                }
            }
            catch (Exception exception)
            {
                lastErrorMessage = exception.Message;
                return null;
            }
            return null;
        }

string GetLastErrorMessage ( ) [inline]

Definition at line 25 of file CommonLicenseRequest.cs.

        {
            return lastErrorMessage;
        }

Member Data Documentation

HttpClient httpClient [private]

Definition at line 24 of file CommonLicenseRequest.cs.

string lastErrorMessage [private]

Definition at line 23 of file CommonLicenseRequest.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Helpers/CommonLicenseRequest.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReadyHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
  • PlayReadyHelper
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

PlayReadyHelper Class Reference

Encapsulates all the required calls to setup a MediaProtectionManger within a MediaPlayer for typical PlayReady scenarios. More...

List of all members.

Public Member Functions

PlayReadyHelper (LogView logger=null)
void | SetUpProtectionManager (MediaPlayer mediaPlayer)

Public Attributes

string | playReadyChallengeCustomData = ""
string | playReadyLicenseUrl = ""

Private Member Functions

async void | LicenseAcquisitionRequest (PlayReadyLicenseAcquisitionServiceRequest licenseRequest, MediaProtectionServiceCompletion completionNotifier, string url, string challengeCustomData)
void | Log (string message)
async void | ProactiveIndividualizationRequest ()
void | ProtectionManager_ComponentLoadFailed (MediaProtectionManager sender, ComponentLoadFailedEventArgs e)
async void | ProtectionManager_ServiceRequested (MediaProtectionManager sender, ServiceRequestedEventArgs e)
async Task< bool > | ReactiveIndividualizationRequestAsync (PlayReadyIndividualizationServiceRequest individualizationRequest, MediaProtectionServiceCompletion completionNotifier)

Private Attributes

LogView | logger
KeyValuePair< string, object > | MediaProtectionContainerGuid = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}")
KeyValuePair< string, object > | MediaProtectionSystemId = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}")
const string | MediaProtectionSystemIdMapping = "Windows.Media.Protection.MediaProtectionSystemIdMapping"
const int | MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED = -2147174251
KeyValuePair< string, object > | PlayReadyWinRTTrustedInput = new KeyValuePair<string, object>("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput" )

Detailed Description

It is left to the user of these samples to explore other PlayReady rights management scenarios.

Definition at line 38 of file PlayReadyHelper.cs.

Constructor & Destructor Documentation

PlayReadyHelper ( LogView logger = null ) [inline]

Definition at line 40 of file PlayReadyHelper.cs.

        {
            this.logger = logger;
        }

Member Function Documentation

async void LicenseAcquisitionRequest | ( | PlayReadyLicenseAcquisitionServiceRequest | licenseRequest,
 |  | MediaProtectionServiceCompletion | completionNotifier,
 |  | string | url,
 |  | string | challengeCustomData |
 | ) |  |  | [inline, private]

Invoked to acquire the PlayReady License.

Definition at line 137 of file PlayReadyHelper.cs.

        {
            bool bResult = false;
            string ExceptionMessage = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(url))
                {
                    Log("ProtectionManager PlayReady Manual License Acquisition Service Request in progress - URL: " + url);

                    if (!string.IsNullOrEmpty(challengeCustomData))
                    {
                        var encoding = new UTF8Encoding();
                        byte[] b = encoding.GetBytes(challengeCustomData);
                        licenseRequest.ChallengeCustomData = Convert.ToBase64String(b, 0, b.Length);
                    }

                    PlayReadySoapMessage soapMessage = licenseRequest.GenerateManualEnablingChallenge();

                    byte[] messageBytes = soapMessage.GetMessageBody();
                    HttpContent httpContent = new ByteArrayContent(messageBytes);

                    IPropertySet propertySetHeaders = soapMessage.MessageHeaders;
                    foreach (string strHeaderName in propertySetHeaders.Keys)
                    {
                        string strHeaderValue = propertySetHeaders[strHeaderName].ToString();

                        // The Add method throws an ArgumentException try to set protected headers like "Content-Type"
                        // so set it via "ContentType" property
                        if (strHeaderName.Equals("Content-Type", StringComparison.OrdinalIgnoreCase))
                            httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse(strHeaderValue);
                        else
                            httpContent.Headers.Add(strHeaderName.ToString(), strHeaderValue);
                    }
                    var licenseAcquision = new CommonLicenseRequest();
                    HttpContent responseHttpContent = await licenseAcquision.AcquireLicenseAsync(new Uri(url), httpContent);
                    if (responseHttpContent != null)
                    {
                        Exception exResult = licenseRequest.ProcessManualEnablingResponse(await responseHttpContent.ReadAsByteArrayAsync());
                        if (exResult != null)
                        {
                            throw exResult;
                        }
                        bResult = true;
                    }
                    else
                        ExceptionMessage = licenseAcquision.GetLastErrorMessage();
                }
                else
                {
                    Log("ProtectionManager PlayReady License Acquisition Service Request in progress - URL: " + licenseRequest.Uri.ToString());
                    await licenseRequest.BeginServiceRequest();
                    bResult = true;
                }
            }
            catch (Exception e)
            {
                ExceptionMessage = e.Message;
            }

            if (bResult == true)
                Log(!string.IsNullOrEmpty(url) ? "ProtectionManager Manual PlayReady License Acquisition Service Request successful" :
                    "ProtectionManager PlayReady License Acquisition Service Request successful");
            else
                Log(!string.IsNullOrEmpty(url) ? "ProtectionManager Manual PlayReady License Acquisition Service Request failed: " + ExceptionMessage :
                    "ProtectionManager PlayReady License Acquisition Service Request failed: " + ExceptionMessage);
            completionNotifier.Complete(bResult);
        }

void Log ( string message ) [inline, private]

Definition at line 58 of file PlayReadyHelper.cs.

        {
            if (logger != null)
            {
                logger.Log(message, LogViewLoggingLevel.Information);
            }
            else
            {
                string logEntry = $"{DateTime.Now:HH:mm:ss.fff} - {message}";
                System.Diagnostics.Debug.WriteLine(logEntry);
            }
        }

async void ProactiveIndividualizationRequest ( ) [inline, private]

Proactive Individualization Request.

Definition at line 209 of file PlayReadyHelper.cs.

        {
            var individualizationRequest = new PlayReadyIndividualizationServiceRequest();
            Log("ProtectionManager PlayReady ProActive Individualization Service Request in progress...");
            bool bResultIndiv = await ReactiveIndividualizationRequestAsync(individualizationRequest, null);
            if (bResultIndiv == true)
                Log("ProtectionManager PlayReady ProActive Individualization Service Request successful");
            else
                Log("ProtectionManager PlayReady ProActive Individualization Service Request failed");

        }

void ProtectionManager_ComponentLoadFailed | ( | MediaProtectionManager | sender,
 |  | ComponentLoadFailedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file PlayReadyHelper.cs.

        {
            Log("Enter ProtectionManager_ComponentLoadFailed");
            Log(e.Information.ToString());

            // List the failing components - RevocationAndRenewalInformation
            foreach (var item in e.Information.Items)
            {
                Log(item.Name +
                    "\nReasons=0x" + item.Reasons +
                    "\nRenewal Id=" + item.RenewalId);
            }
            e.Completion.Complete(false);

            Log("Leave ProtectionManager_ComponentLoadFailed");
        }

async void ProtectionManager_ServiceRequested | ( | MediaProtectionManager | sender,
 |  | ServiceRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file PlayReadyHelper.cs.

        {
            Log("Enter ProtectionManager_ServiceRequested");

            if (e.Request is PlayReadyIndividualizationServiceRequest)
            {
                var individualizationRequest = e.Request as PlayReadyIndividualizationServiceRequest;
                bool bResultIndiv = await ReactiveIndividualizationRequestAsync(individualizationRequest, e.Completion);
            }
            else if (e.Request is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = e.Request as PlayReadyLicenseAcquisitionServiceRequest;
                LicenseAcquisitionRequest(licenseRequest, e.Completion, playReadyLicenseUrl, playReadyChallengeCustomData);
            }

            Log("Leave ProtectionManager_ServiceRequested");
        }

async Task<bool> ReactiveIndividualizationRequestAsync | ( | PlayReadyIndividualizationServiceRequest | individualizationRequest,
 |  | MediaProtectionServiceCompletion | completionNotifier |
 | ) |  |  | [inline, private]

Invoked to send the Individualization Request.

Definition at line 223 of file PlayReadyHelper.cs.

        {
            bool bResult = false;
            Log("ProtectionManager PlayReady Individualization Service Request in progress...");
            try
            {
                await individualizationRequest.BeginServiceRequest();
                bResult = true;
            }
            catch (COMException comException) when (comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
            {
                individualizationRequest.NextServiceRequest();
            }
            catch (Exception)
            {
            }

            if (bResult == true)
                Log("ProtectionManager PlayReady Individualization Service Request successful");
            else
                Log("ProtectionManager PlayReady Individualization Service Request failed");
            if (completionNotifier != null) completionNotifier.Complete(bResult);
            return bResult;

        }

void SetUpProtectionManager ( MediaPlayer mediaPlayer ) [inline]

Definition at line 71 of file PlayReadyHelper.cs.

        {
            Log("Enter SetUpProtectionManager");

            if(mediaPlayer == null)
                throw new ArgumentException("SetUpProtectionManager was passed a null MediaPlayer");

            Log("Creating protection system mappings...");
            var protectionManager = new MediaProtectionManager();

            protectionManager.ComponentLoadFailed += new ComponentLoadFailedEventHandler(ProtectionManager_ComponentLoadFailed);
            protectionManager.ServiceRequested += new ServiceRequestedEventHandler(ProtectionManager_ServiceRequested);

            // The code here is mandatory and should be just copied directly over to the app
            // Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa376846%28v=vs.85%29.aspx

            // Setup PlayReady as the ProtectionSystem to use by mediaFoundation:
            var contentProtectionSystems = new PropertySet();
            contentProtectionSystems.Add(PlayReadyWinRTTrustedInput);
            protectionManager.Properties.Add(MediaProtectionSystemIdMapping, contentProtectionSystems);
            protectionManager.Properties.Add(MediaProtectionSystemId);
            protectionManager.Properties.Add(MediaProtectionContainerGuid);

            mediaPlayer.ProtectionManager = protectionManager;

            Log("Leave SetUpProtectionManager");
        }

Member Data Documentation

LogView logger [private]

Definition at line 44 of file PlayReadyHelper.cs.

KeyValuePair<string, object> MediaProtectionContainerGuid = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}") [private]

Definition at line 50 of file PlayReadyHelper.cs.

KeyValuePair<string, object> MediaProtectionSystemId = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}") [private]

Definition at line 49 of file PlayReadyHelper.cs.

const string MediaProtectionSystemIdMapping = "Windows.Media.Protection.MediaProtectionSystemIdMapping" [private]

Definition at line 51 of file PlayReadyHelper.cs.

const int MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED = -2147174251 [private]

Definition at line 47 of file PlayReadyHelper.cs.

string playReadyChallengeCustomData = ""

Definition at line 55 of file PlayReadyHelper.cs.

string playReadyLicenseUrl = ""

Definition at line 54 of file PlayReadyHelper.cs.

KeyValuePair<string, object> PlayReadyWinRTTrustedInput = new KeyValuePair<string, object>("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput" ) [private]

Definition at line 48 of file PlayReadyHelper.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Helpers/PlayReadyHelper.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers::sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
  • Helpers::sealed
Public Member Functions

Helpers::sealed Class Reference

#include "BufferConverter.h"

List of all members.

Public Member Functions

virtual | ~BufferConverter ()
virtual | ~ServiceStatusConverter ()
BufferConverter ()
virtual Platform::Object | Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
virtual Platform::Object | ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)
ServiceStatusConverter ()

Detailed Description

Definition at line 19 of file BufferConverter.h.

Constructor & Destructor Documentation

virtual ~BufferConverter ( ) [inline, virtual]

Definition at line 23 of file BufferConverter.h.

{}

virtual ~ServiceStatusConverter ( ) [inline, virtual]

Definition at line 23 of file ServiceStatusConverter.h.

{}

Member Function Documentation

BufferConverter ( ) [inline]

Definition at line 22 of file BufferConverter.h.

{}

virtual Platform::Object Convert | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [inline, virtual]

Definition at line 25 of file BufferConverter.h.

            {
                Platform::String^ metadata = "";
                Windows::Storage::Streams::IBuffer^ buffer = dynamic_cast<Windows::Storage::Streams::IBuffer^>(value);
                if (buffer != nullptr)
                {
                    auto metadataReader = Windows::Storage::Streams::DataReader::FromBuffer(buffer);
                    metadata = metadataReader->ReadString(buffer->Length);
                    metadata = "(" + metadata + ")";
                }
                return metadata;
            }

virtual Platform::Object Convert | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [inline, virtual]

Definition at line 25 of file ServiceStatusConverter.h.

            {
                return static_cast<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus>(value).ToString();
            }

virtual Platform::Object ConvertBack | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [inline, virtual]

Definition at line 30 of file ServiceStatusConverter.h.

            {
                Platform::String^ statusString = dynamic_cast<Platform::String^>(value);
                if (statusString == Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Available.ToString())
                {
                    return Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Available;
                }
                else if (statusString == Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Busy.ToString())
                {
                    return Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Busy;
                }
                else if (statusString == Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Custom.ToString())
                {
                    return Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Custom;
                }
                else
                {
                    return Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus::Custom;
                }
            }

virtual Platform::Object ConvertBack | ( | Platform::Object^ | value,
 |  | Windows::UI::Xaml::Interop::TypeName | targetType,
 |  | Platform::Object^ | parameter,
 |  | Platform::String^ | language |
 | ) |  |  | [inline, virtual]

Definition at line 38 of file BufferConverter.h.

            {
                throw ref new Platform::NotImplementedException();
            }

ServiceStatusConverter ( ) [inline]

Definition at line 22 of file ServiceStatusConverter.h.

{}

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cpp/Helpers/BufferConverter.h
  • WiFiDirectServices/cpp/Helpers/ServiceStatusConverter.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers::ServiceStatusConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Helpers
  • Helpers::ServiceStatusConverter
Public Member Functions

Helpers::ServiceStatusConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 20 of file ServiceStatusConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Compares the bound value with an enum param.

Returns true when they match.

Definition at line 25 of file ServiceStatusConverter.cs.

        {
            return ((WiFiDirectServiceStatus)value).ToString();
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Converts the boolean back into an enum.

Definition at line 33 of file ServiceStatusConverter.cs.

        {
            return Enum.Parse(typeof(WiFiDirectServiceStatus), (string)value);
        }

The documentation for this class was generated from the following file:
  • WiFiDirectServices/cs/Helpers/ServiceStatusConverter.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HistoryAndRoaming Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • HistoryAndRoaming
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

HistoryAndRoaming Class Reference

List of all members.

Public Member Functions

HistoryAndRoaming ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CheckHistoryAndRoaming ()
async void | CopyButton_Click (object sender, RoutedEventArgs e)
void | OnHistoryEnabledChanged (object sender, object e)
void | OnRoamingEnabledChanged (object sender, object e)

Static Private Member Functions

static void | SelectVisibleElement (UIElement ifTrue, UIElement ifFalse, bool value)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file HistoryAndRoaming.xaml.cs.

Constructor & Destructor Documentation

HistoryAndRoaming ( ) [inline]

Definition at line 27 of file HistoryAndRoaming.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void CheckHistoryAndRoaming ( ) [inline, private]

Definition at line 133 of file HistoryAndRoaming.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                SelectVisibleElement(ClipboardHistoryBlock, ClipboardHistoryUnavailableBlock, Clipboard.IsHistoryEnabled());
                SelectVisibleElement(ClipboardRoamingBlock, ClipboardRoamingUnavailableBlock, Clipboard.IsRoamingEnabled());
            });
        }

async void CopyButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file HistoryAndRoaming.xaml.cs.

        {
            // Generate a bitmap for our clipboard content.
            RenderTargetBitmap target = new RenderTargetBitmap();
            await target.RenderAsync(ClipboardContent);
            IBuffer buffer = await target.GetPixelsAsync();
            SoftwareBitmap bitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer, BitmapPixelFormat.Bgra8, target.PixelWidth, target.PixelHeight, BitmapAlphaMode.Premultiplied);

            // Save the bitmap to a stream.
            InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();
            BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream);
            encoder.SetSoftwareBitmap(bitmap);
            await encoder.FlushAsync();
            stream.Seek(0);

            // Create a DataPackage to hold the bitmap and text.
            var dataPackage = new DataPackage();
            dataPackage.SetBitmap(RandomAccessStreamReference.CreateFromStream(stream));
            dataPackage.SetText(ClipboardContent.Text);

            ClipboardContentOptions options = new ClipboardContentOptions();

            // Customize clipboard history.
            if (IncludeAllInHistory.IsChecked.Value)
            {
                // This is the default, but set it explicitly for expository purposes.
                options.IsAllowedInHistory = true;
            }
            else if (IncludeTextInHistory.IsChecked.Value)
            {
                // This is the default, but set it explicitly for expository purposes.
                options.IsAllowedInHistory = true;
                // Allow only text to go into the history.
                options.HistoryFormats.Add(StandardDataFormats.Text);
            }
            else
            {
                // Exclude from history.
                options.IsAllowedInHistory = false;
            }

            // Customize clipboard roaming.
            if (AllowAllToRoam.IsChecked.Value)
            {
                // This is the default, but set it explicitly for expository purposes.
                options.IsRoamable = true;
            }
            else if (AllowTextToRoam.IsChecked.Value)
            {
                // This is the default, but set it explicitly for expository purposes.
                options.IsRoamable = true;
                // Allow only text to roam.
                options.RoamingFormats.Add(StandardDataFormats.Text);
            }
            else
            {
                // Exclude from roaming.
                options.IsRoamable = false;
            }

            // Set the data package to the clipboard with our custom options.
            if (Clipboard.SetContentWithOptions(dataPackage, options))
            {
                rootPage.NotifyUser("Text and bitmap have been copied to clipboard.", NotifyType.StatusMessage);
            }
            else
            {
                // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
                rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
            }
        }

void OnHistoryEnabledChanged | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file HistoryAndRoaming.xaml.cs.

        {
            CheckHistoryAndRoaming();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file HistoryAndRoaming.xaml.cs.

        {
            Clipboard.HistoryEnabledChanged -= OnHistoryEnabledChanged;
            Clipboard.RoamingEnabledChanged -= OnRoamingEnabledChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file HistoryAndRoaming.xaml.cs.

        {
            Clipboard.HistoryEnabledChanged += OnHistoryEnabledChanged;
            Clipboard.RoamingEnabledChanged += OnRoamingEnabledChanged;
            CheckHistoryAndRoaming();
        }

void OnRoamingEnabledChanged | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 122 of file HistoryAndRoaming.xaml.cs.

        {
            CheckHistoryAndRoaming();
        }

static void SelectVisibleElement | ( | UIElement | ifTrue,
 |  | UIElement | ifFalse,
 |  | bool | value |
 | ) |  |  | [inline, static, private]

Definition at line 127 of file HistoryAndRoaming.xaml.cs.

        {
            ifTrue.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
            ifFalse.Visibility = !value ? Visibility.Visible : Visibility.Collapsed;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file HistoryAndRoaming.xaml.cs.

The documentation for this class was generated from the following file:
  • Clipboard/cs/HistoryAndRoaming.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpJsonContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • HttpJsonContent
Public Member Functions | Properties | Private Member Functions | Private Attributes

HttpJsonContent Class Reference

List of all members.

Public Member Functions

HttpJsonContent (IJsonValue jsonValue)
IAsyncOperationWithProgress
< ulong, ulong > 		BufferAllAsync ()
void | Dispose ()
IAsyncOperationWithProgress
< IBuffer, ulong > 		ReadAsBufferAsync ()
IAsyncOperationWithProgress
< IInputStream, ulong > 		ReadAsInputStreamAsync ()
IAsyncOperationWithProgress
< string, ulong > 		ReadAsStringAsync ()
bool | TryComputeLength (out ulong length)
IAsyncOperationWithProgress
< ulong, ulong > 		WriteToStreamAsync (IOutputStream outputStream)

Properties

HttpContentHeaderCollection | Headers [get]

Private Member Functions

ulong | GetLength ()

Private Attributes

HttpContentHeaderCollection | headers
IJsonValue | jsonValue

Detailed Description

Definition at line 26 of file HttpJsonContent.cs.

Constructor & Destructor Documentation

HttpJsonContent ( IJsonValue jsonValue ) [inline]

Definition at line 39 of file HttpJsonContent.cs.

        {
            if (jsonValue == null)
            {
                throw new ArgumentException("jsonValue cannot be null.");
            }
            this.jsonValue = jsonValue;
            headers = new HttpContentHeaderCollection();
            headers.ContentType = new HttpMediaTypeHeaderValue("application/json");
            headers.ContentType.CharSet = "UTF-8";
        }

Member Function Documentation

IAsyncOperationWithProgress<ulong, ulong> BufferAllAsync ( ) [inline]

Definition at line 51 of file HttpJsonContent.cs.

        {
            return AsyncInfo.Run<ulong, ulong>((cancellationToken, progress) =>
            {
                return Task<ulong>.Run(() =>
                {
                    ulong length = GetLength();

                    // Report progress.
                    progress.Report(length);

                    // Just return the size in bytes.
                    return length;
                });
            });
        }

void Dispose ( ) [inline]

Definition at line 148 of file HttpJsonContent.cs.

        {
        }

ulong GetLength ( ) [inline, private]

Definition at line 152 of file HttpJsonContent.cs.

        {
            DataWriter writer = new DataWriter();
            writer.WriteString(jsonValue.Stringify());

            IBuffer buffer = writer.DetachBuffer();
            return buffer.Length;
        }

IAsyncOperationWithProgress<IBuffer, ulong> ReadAsBufferAsync ( ) [inline]

Definition at line 68 of file HttpJsonContent.cs.

        {
            return AsyncInfo.Run<IBuffer, ulong>((cancellationToken, progress) =>
            {
                return Task<IBuffer>.Run(() =>
                {
                    DataWriter writer = new DataWriter();
                    writer.WriteString(jsonValue.Stringify());

                    // Make sure that the DataWriter destructor does not free the buffer.
                    IBuffer buffer = writer.DetachBuffer();

                    // Report progress.
                    progress.Report(buffer.Length);

                    return buffer;
                });
            });
        }

IAsyncOperationWithProgress<IInputStream, ulong> ReadAsInputStreamAsync ( ) [inline]

Definition at line 88 of file HttpJsonContent.cs.

        {
            return AsyncInfo.Run<IInputStream, ulong>(async (cancellationToken, progress) =>
            {
                InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
                DataWriter writer = new DataWriter(randomAccessStream);
                writer.WriteString(jsonValue.Stringify());

                uint bytesStored = await writer.StoreAsync().AsTask(cancellationToken);

                // Make sure that the DataWriter destructor does not close the stream.
                writer.DetachStream();

                // Report progress.
                progress.Report(randomAccessStream.Size);

                return randomAccessStream.GetInputStreamAt(0);
            });
        }

IAsyncOperationWithProgress<string, ulong> ReadAsStringAsync ( ) [inline]

Definition at line 108 of file HttpJsonContent.cs.

        {
            return AsyncInfo.Run<string, ulong>((cancellationToken, progress) =>
            {
                return Task<string>.Run(() =>
                {
                    string jsonString = jsonValue.Stringify();

                    // Report progress (length of string).
                    progress.Report((ulong)jsonString.Length);

                    return jsonString;
                });
            });
        }

bool TryComputeLength ( out ulong length ) [inline]

Definition at line 124 of file HttpJsonContent.cs.

        {
            length = GetLength();
            return true;
        }

IAsyncOperationWithProgress<ulong, ulong> WriteToStreamAsync ( IOutputStream outputStream ) [inline]

Definition at line 130 of file HttpJsonContent.cs.

        {
            return AsyncInfo.Run<ulong, ulong>(async (cancellationToken, progress) =>
            {
                DataWriter writer = new DataWriter(outputStream);
                writer.WriteString(jsonValue.Stringify());
                uint bytesWritten = await writer.StoreAsync().AsTask(cancellationToken);

                // Make sure that DataWriter destructor does not close the stream.
                writer.DetachStream();

                // Report progress.
                progress.Report(bytesWritten);

                return bytesWritten;
            });
        }

Member Data Documentation

HttpContentHeaderCollection headers [private]

Definition at line 29 of file HttpJsonContent.cs.

IJsonValue jsonValue [private]

Definition at line 28 of file HttpJsonContent.cs.

Property Documentation

HttpContentHeaderCollection Headers [get]

Definition at line 32 of file HttpJsonContent.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/HttpJsonContent.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImagePage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ImagePage
Public Member Functions | Protected Member Functions | Private Member Functions

ImagePage Class Reference

Page2 is simply a blank page with a button to navigate back to the MainPage. More...

List of all members.

Public Member Functions

ImagePage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnBackRequested (object sender, BackRequestedEventArgs e)

Detailed Description

It's purpose is just to reset the list on the main page so that the implementation of ListViewPersistenceHelper can be demonstrated

Definition at line 24 of file ImagePage.xaml.cs.

Constructor & Destructor Documentation

ImagePage ( ) [inline]

Definition at line 26 of file ImagePage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnBackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file ImagePage.xaml.cs.

        {
            // Mark event as handled so we don't leave the app.
            e.Handled = true;
            // Page above us will be our master view.
            // Make sure we are using the "drill out" animation in this transition.
            Frame.GoBack(new DrillInNavigationTransitionInfo());
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file ImagePage.xaml.cs.

        {
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested -= OnBackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file ImagePage.xaml.cs.

        {
            // Register for hardware and software back request from the system
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += OnBackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }

The documentation for this class was generated from the following file:
  • XamlListView/cs/ImagePage.xaml.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • InkRenderer
Public Member Functions | Private Attributes

InkRenderer Class Reference

#include "InkRenderer.h"

List of all members.

Public Member Functions

InkRenderer ()
void | Clear ()
void | ClearStrokeContainerForTemp ()
Windows::Foundation::Rect | DeleteSelectedStrokes ()
void | DrawSelectionRect (Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext, Microsoft::WRL::ComPtr< ID2D1Factory > d2dFactory)
Platform::Collections::Vector
< Windows::UI::Input::Inking::InkStroke^> 		GetSelectedStrokes ()
Windows::Foundation::Rect | GetSelectionRectangle ()
Windows::UI::Input::Inking::InkStrokeContainer | GetStrokeContainer ()
Windows::UI::Input::Inking::InkStrokeContainer | GetStrokeContainerForTemp ()
bool | HasStrokesToErase (Windows::Foundation::Point prevPt, Windows::Foundation::Point currPt)
bool | IsEmptyRect (Windows::Foundation::Rect &updateRect)
void | Render (Platform::Collections::Vector< Windows::UI::Input::Inking::InkStroke^>^, Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext)
void | Select (Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^selectionPoints)
void | UnselectAll ()
void | Update (Windows::UI::Input::Inking::InkStroke^strokeContainer)
void | UpdateSelectionRectangle (Windows::Foundation::Rect newSelectionRect)

Private Attributes

Windows::Foundation::Rect | _selectionRect
Microsoft::WRL::ComPtr
< IInkD2DRenderer > 		_spInkD2DRenderer
Windows::UI::Input::Inking::InkStrokeContainer | _strokeContainer
Windows::UI::Input::Inking::InkStrokeContainer | _StrokeContainerForTemp
Microsoft::WRL::ComPtr
< ID2D1StrokeStyle > 		_strokeStyle

Detailed Description

Definition at line 11 of file InkRenderer.h.

Constructor & Destructor Documentation

InkRenderer ( )

Definition at line 10 of file InkRenderer.cpp.

{
    _strokeContainer = ref new Windows::UI::Input::Inking::InkStrokeContainer();

    _selectionRect = Windows::Foundation::Rect::Empty;

    CoCreateInstance(__uuidof(InkD2DRenderer),
        nullptr,
        CLSCTX_INPROC_SERVER,
        IID_PPV_ARGS(&_spInkD2DRenderer));
}

Member Function Documentation

void Clear ( )

Definition at line 22 of file InkRenderer.cpp.

{
    if (_strokeContainer != nullptr)
    {
        _strokeContainer->Clear();
    }
    _selectionRect = Windows::Foundation::Rect::Empty;
}

void ClearStrokeContainerForTemp ( ) [inline]

Definition at line 32 of file InkRenderer.h.

                                           {
            if (_StrokeContainerForTemp != nullptr)
            {
                _StrokeContainerForTemp->Clear();
            }
        };

Windows::Foundation::Rect DeleteSelectedStrokes ( )

Definition at line 107 of file InkRenderer.cpp.

{
    Windows::Foundation::Rect updateRect = Windows::Foundation::Rect::Empty;
    if (_strokeContainer != nullptr)
    {
        updateRect = _strokeContainer->DeleteSelected();
    }

    return updateRect;
}

void DrawSelectionRect | ( | Microsoft::WRL::ComPtr< ID2D1DeviceContext > | d2dContext,
 |  | Microsoft::WRL::ComPtr< ID2D1Factory > | d2dFactory
 | ) |  |

Definition at line 31 of file InkRenderer.cpp.

{
    if (!_selectionRect.IsEmpty  &&
        _selectionRect.Bottom > _selectionRect.Top &&
        _selectionRect.Right > _selectionRect.Left &&
        d2dContext != nullptr)
    {
        Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> shapeBrush;
        DX::ThrowIfFailed(d2dContext->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Blue, 0.2f), &shapeBrush));

        D2D1_RECT_F rectangle = D2D1::RectF(_selectionRect.Left, _selectionRect.Top, _selectionRect.Right, _selectionRect.Bottom);
        d2dContext->FillRectangle(&rectangle, shapeBrush.Get());

        shapeBrush->SetColor(D2D1::ColorF(D2D1::ColorF::Black, 0.5f));
        d2dContext->DrawRectangle(&rectangle, shapeBrush.Get());
    }
}

Platform::Collections::Vector< Windows::UI::Input::Inking::InkStroke^> GetSelectedStrokes ( )

Definition at line 118 of file InkRenderer.cpp.

{
    Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ strokesInContainer = _strokeContainer->GetStrokes();
    Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>^ strokes = ref new Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>();
    for (unsigned int index = 0; index < strokesInContainer->Size; index++)
    {
        if (strokesInContainer->GetAt(index)->Selected)
        {
            strokes->Append(strokesInContainer->GetAt(index));
        }
    }
    return strokes;
}

Windows::Foundation::Rect GetSelectionRectangle ( ) [inline]

Definition at line 26 of file InkRenderer.h.

{ return _selectionRect; };

Windows::UI::Input::Inking::InkStrokeContainer GetStrokeContainer ( ) [inline]

Definition at line 28 of file InkRenderer.h.

{ return _strokeContainer; };

Windows::UI::Input::Inking::InkStrokeContainer GetStrokeContainerForTemp ( ) [inline]

Definition at line 29 of file InkRenderer.h.

{ return _StrokeContainerForTemp; };

bool HasStrokesToErase | ( | Windows::Foundation::Point | prevPt,
 |  | Windows::Foundation::Point | currPt
 | ) |  |

Definition at line 96 of file InkRenderer.cpp.

{
    Windows::Foundation::Rect updateRect = Windows::Foundation::Rect::Empty;
    if (_strokeContainer != nullptr)
    {
        updateRect = _strokeContainer->SelectWithLine(prevPt, currPt);
    }

    return !IsEmptyRect(updateRect);
}

bool IsEmptyRect ( Windows::Foundation::Rect & updateRect ) [inline]

Definition at line 39 of file InkRenderer.h.

        {
            return updateRect.IsEmpty || (updateRect.X == 0 && updateRect.Y == 0 && updateRect.Width == 0 && updateRect.Height == 0);
        }

void Render | ( | Platform::Collections::Vector< Windows::UI::Input::Inking::InkStroke^>^ | strokes,
 |  | Microsoft::WRL::ComPtr< ID2D1DeviceContext > | d2dContext
 | ) |  |

Definition at line 49 of file InkRenderer.cpp.

{
    HRESULT hr = S_OK;
    if (_spInkD2DRenderer != nullptr)
    {
        if (strokes != nullptr && strokes->Size > 0)
        {
            // Cast the stroke collection into IUnknown to call the Inkd2dRenderer
            ComPtr<IUnknown> spUnkStrokes = reinterpret_cast<IUnknown*>(reinterpret_cast<__abi_IUnknown*>(strokes));
            hr = _spInkD2DRenderer->Draw(d2dContext.Get(), spUnkStrokes.Get(), false);
            if (FAILED(hr))
            {
                DX::ThrowIfFailed(hr);
            }
        }
    }
}

void Select ( Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^ selectionPoints )

Definition at line 69 of file InkRenderer.cpp.

{
    if (selectionPoints != nullptr && _strokeContainer != nullptr)
    {
        _selectionRect = _strokeContainer->SelectWithPolyLine(selectionPoints);

        if (_StrokeContainerForTemp == nullptr && !IsEmptyRect(_selectionRect))
        {
            // Create a stroke container to hold the temporarily created strokes for selection hollow effect
            _StrokeContainerForTemp = ref new Windows::UI::Input::Inking::InkStrokeContainer();
        }
    }
}

void UnselectAll ( )

Definition at line 83 of file InkRenderer.cpp.

{
    if (_strokeContainer != nullptr)
    {
        Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ inkStrokes = _strokeContainer->GetStrokes();
        for (unsigned int i = 0; i < inkStrokes->Size; i++)
        {
            inkStrokes->GetAt(i)->Selected = false;
        }
    }
    _selectionRect = Windows::Foundation::Rect::Empty;
}

void Update ( Windows::UI::Input::Inking::InkStroke^ strokeContainer )

Definition at line 132 of file InkRenderer.cpp.

{
    if (stroke != nullptr && _strokeContainer != nullptr)
    {
        _strokeContainer->AddStroke(stroke);
    }
}

void UpdateSelectionRectangle ( Windows::Foundation::Rect newSelectionRect )

Definition at line 140 of file InkRenderer.cpp.

{
    _selectionRect = newSelectionRect;
}

Member Data Documentation

Windows::Foundation::Rect _selectionRect [private]

Definition at line 49 of file InkRenderer.h.

Microsoft::WRL::ComPtr<IInkD2DRenderer> _spInkD2DRenderer [private]

Definition at line 48 of file InkRenderer.h.

Windows::UI::Input::Inking::InkStrokeContainer _strokeContainer [private]

Definition at line 46 of file InkRenderer.h.

Windows::UI::Input::Inking::InkStrokeContainer _StrokeContainerForTemp [private]

Definition at line 47 of file InkRenderer.h.

Microsoft::WRL::ComPtr<ID2D1StrokeStyle> _strokeStyle [private]

Definition at line 50 of file InkRenderer.h.

The documentation for this class was generated from the following files:
  • ComplexInk/cpp/Renderers/InkRenderer.h
  • ComplexInk/cpp/Renderers/InkRenderer.cpp
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InvalidPageException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • InvalidPageException
Public Member Functions | Private Attributes

InvalidPageException Class Reference

#include "Scenario4PageRange.xaml.h"

List of all members.

Public Member Functions

InvalidPageException (const std::wstring &message)
std::wstring | get_DisplayMessage ()

Private Attributes

std::wstring | m_displayMessage

Detailed Description

Definition at line 10 of file Scenario4PageRange.xaml.h.

Constructor & Destructor Documentation

InvalidPageException ( const std::wstring & message ) [inline]

Definition at line 13 of file Scenario4PageRange.xaml.h.

        {
            m_displayMessage = message;
        }

Member Function Documentation

std::wstring get_DisplayMessage ( ) [inline]

Definition at line 18 of file Scenario4PageRange.xaml.h.

        {
            return m_displayMessage;
        }

Member Data Documentation

std::wstring m_displayMessage [private]

Definition at line 24 of file Scenario4PageRange.xaml.h.

The documentation for this class was generated from the following file:
  • Printing/cpp/Scenario4PageRange.xaml.h
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IsApiPropertyPresentTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • IsApiPropertyPresentTrigger
Properties | Private Member Functions | Private Attributes | Static Private Attributes

IsApiPropertyPresentTrigger Class Reference

List of all members.

Properties

bool | IsPresent [get, set]
string | PropertyName [get, set]
string | TypeName [get, set]

Private Member Functions

void | UpdatePresence ()
void | UpdateState ()

Private Attributes

bool | _isPresent = true
bool | _isPropertyPresent
string | _propertyName
string | _typeName

Static Private Attributes

static ConcurrentDictionary
< Tuple< string, string >
, bool > 		propertyPresence

Detailed Description

Definition at line 20 of file IsApiPropertyPresentTrigger.cs.

Member Function Documentation

void UpdatePresence ( ) [inline, private]

Definition at line 51 of file IsApiPropertyPresentTrigger.cs.

        {
            if (string.IsNullOrEmpty(_typeName) || string.IsNullOrEmpty(_propertyName))
            {
                // State trigger not yet fully initialized.
                return;
            }

            // If the answer is not already cached, then call into
            // ApiInformation method to determine whether property is present.
            _isPropertyPresent = propertyPresence.GetOrAdd(Tuple.Create(_typeName, _propertyName),
               (key) => ApiInformation.IsPropertyPresent(key.Item1, key.Item2));

            UpdateState();
        }

void UpdateState ( ) [inline, private]

Definition at line 67 of file IsApiPropertyPresentTrigger.cs.

        {
            // If the property presence matches _isPresent then the trigger will be activated.
            SetActive(_isPresent == _isPropertyPresent);
        }

Member Data Documentation

bool _isPresent = true [private]

Definition at line 25 of file IsApiPropertyPresentTrigger.cs.

bool _isPropertyPresent [private]

Definition at line 31 of file IsApiPropertyPresentTrigger.cs.

string _propertyName [private]

Definition at line 24 of file IsApiPropertyPresentTrigger.cs.

string _typeName [private]

Definition at line 23 of file IsApiPropertyPresentTrigger.cs.

ConcurrentDictionary<Tuple<string, string>, bool> propertyPresence [static, private]
Initial value:
            new ConcurrentDictionary<Tuple<string, string>, bool>()

Definition at line 28 of file IsApiPropertyPresentTrigger.cs.

Property Documentation

bool IsPresent [get, set]

Definition at line 46 of file IsApiPropertyPresentTrigger.cs.

string PropertyName [get, set]

Definition at line 40 of file IsApiPropertyPresentTrigger.cs.

string TypeName [get, set]

Definition at line 34 of file IsApiPropertyPresentTrigger.cs.

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/IsApiPropertyPresentTrigger.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Item Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Item
Public Member Functions | Static Public Member Functions | Properties | Static Private Member Functions | Static Private Attributes

Item Class Reference

items that are in the observable collection (ItemList) More...

List of all members.

Public Member Functions

override string | ToString ()

Static Public Member Functions

static ObservableCollection< Item > | GetItems (int count)
static Item | GetNewItem (int i, int j)

Properties

string | Id = new BitmapImage() [get, set]
BitmapImage | ImageSource [get, set]
string | Name [get, set]

Static Private Member Functions

static BitmapImage | GenerateImageSource (int i)

Static Private Attributes

static List< BitmapImage > | sources

Detailed Description

Definition at line 173 of file MainPage.xaml.cs.

Member Function Documentation

static BitmapImage GenerateImageSource ( int i ) [inline, static, private]

Definition at line 60 of file Item.cs.

        {
            return sources[i];
        }

static ObservableCollection<Item> GetItems ( int count ) [inline, static]

Definition at line 49 of file Item.cs.

        {
            ObservableCollection<Item> items = new ObservableCollection<Item>();

            for (int i = 0; i < count; i++)
            {
                items.Add(GetNewItem(i, i % 11));
            }
            return items;
        }

static Item GetNewItem | ( | int | i,
 |  | int | j |
 | ) |  |  | [inline, static]

Definition at line 40 of file Item.cs.

        {
            return new Item()
            {
                ImageSource = GenerateImageSource(j),
                Id = i.ToString()
            };
        }

override string ToString ( ) [inline]

Definition at line 176 of file MainPage.xaml.cs.

        {
            return this.Name;
        }

Member Data Documentation

List<BitmapImage> sources [static, private]
Initial value:
 new List<BitmapImage>()
            {
                new BitmapImage(new Uri("ms-appx:///Assets/cliff.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/grapes_background.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage13.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage2.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage24.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage3.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage6.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage7.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/Ring01.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/Ring03Part1.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/Ring03Part3.jpg")),
                new BitmapImage(new Uri("ms-appx:///Assets/sunset.jpg"))
            }

Definition at line 20 of file Item.cs.

Property Documentation

string Id = new BitmapImage() [get, set]

Definition at line 38 of file Item.cs.

BitmapImage ImageSource [get, set]

Definition at line 36 of file Item.cs.

string Name [get, set]

Definition at line 175 of file MainPage.xaml.cs.

The documentation for this class was generated from the following files:
  • BasicSuspension/cs/MainPage.xaml.cs
  • XamlListView/cs/Item.cs
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemDetails Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ItemDetails
Public Member Functions | Public Attributes | Properties

ItemDetails Class Reference

List of all members.

Public Member Functions

ItemDetails (Windows.Services.Store.StoreProduct product)

Public Attributes

string | FormattedTitle = "{Title} ({ProductKind}) {Price}, InUserCollection:{InCollection}"

Properties

bool | InCollection [get, set]
string | Price [get, set]
string | ProductKind [get, set]
string | StoreId [get, set]
string | Title [get, set]

Detailed Description

Definition at line 3 of file ItemsListViewModel.cs.

Constructor & Destructor Documentation

ItemDetails ( Windows.Services.Store.StoreProduct product ) [inline]

Definition at line 12 of file ItemsListViewModel.cs.

        {
            Title = product.Title;
            Price = product.Price.FormattedPrice;
            InCollection = product.IsInUserCollection;
            ProductKind = product.ProductKind;
            StoreId = product.StoreId;
        }

Member Data Documentation

string FormattedTitle = "{Title} ({ProductKind}) {Price}, InUserCollection:{InCollection}"

Definition at line 10 of file ItemsListViewModel.cs.

Property Documentation

bool InCollection [get, set]

Definition at line 7 of file ItemsListViewModel.cs.

string Price [get, set]

Definition at line 6 of file ItemsListViewModel.cs.

string ProductKind [get, set]

Definition at line 8 of file ItemsListViewModel.cs.

string StoreId [get, set]

Definition at line 9 of file ItemsListViewModel.cs.

string Title [get, set]

Definition at line 5 of file ItemsListViewModel.cs.

The documentation for this class was generated from the following file:
  • Store/cs/ItemsListViewModel.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ItemList
Public Member Functions | Static Public Member Functions

ItemList Class Reference

observable collection that will contain the list of items. More...

List of all members.

Public Member Functions

ItemList ()

Static Public Member Functions

static ItemList CreateDefaultItemList ()

Detailed Description

List items are added when page is loaded.

Definition at line 152 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

ItemList ( ) [inline]

Definition at line 154 of file MainPage.xaml.cs.

        {
        }

Member Function Documentation

static ItemList CreateDefaultItemList ( ) [inline, static]

Definition at line 158 of file MainPage.xaml.cs.

        {
            return new ItemList()
            {
                new Item { Name = "Item 1" },
                new Item { Name = "Item 2" },
                new Item { Name = "Item 3" },
                new Item { Name = "Item 4" },
            };
        }

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JsonRequest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • JsonRequest
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes

JsonRequest Class Reference

List of all members.

Public Member Functions

JsonRequest | AddString (string key, string value)
async Task< JsonValue > | PostAsync (string relativeUri)

Static Public Member Functions

static JsonRequest | Create ()

Private Attributes

const int | E_WINHTTP_CANNOT_CONNECT = unchecked((int)0x80072efd)
const int | E_WINHTTP_CONNECTION_ERROR = unchecked((int)0x80072efe)
const int | E_WINHTTP_NAME_NOT_RESOLVED = unchecked((int)0x80072ee7)
const int | E_WINHTTP_TIMEOUT = unchecked((int)0x80072ee2)
JsonObject | message = new JsonObject()

Static Private Attributes

static Uri | serverBaseUri = new Uri("http://localhost:59992/")

Detailed Description

Definition at line 18 of file Util.cs.

Member Function Documentation

JsonRequest AddString | ( | string | key,
 |  | string | value |
 | ) |  |  | [inline]

Definition at line 34 of file Util.cs.

        {
            message.Add(key, JsonValue.CreateStringValue(value));
            return this;
        }

static JsonRequest Create ( ) [inline, static]

Definition at line 29 of file Util.cs.

        {
            return new JsonRequest();
        }

async Task<JsonValue> PostAsync ( string relativeUri ) [inline]

Definition at line 40 of file Util.cs.

        {
            HttpStringContent content = new HttpStringContent(message.Stringify(), UnicodeEncoding.Utf8, "application/json");

            HttpClient httpClient = new HttpClient();
            HttpRequestResult result = await httpClient.TryPostAsync(new Uri(serverBaseUri, relativeUri), content);
            if (result.Succeeded)
            {
                // We assume that if the server responds at all, it responds with valid JSON.
                return JsonValue.Parse(await result.ResponseMessage.Content.ReadAsStringAsync());
            }
            else
            {
                switch (result.ExtendedError.HResult)
                {
                    case E_WINHTTP_TIMEOUT:
                    // The connection to the server timed out.
                    case E_WINHTTP_NAME_NOT_RESOLVED:
                    case E_WINHTTP_CANNOT_CONNECT:
                    case E_WINHTTP_CONNECTION_ERROR:
                    // Unable to connect to the server. Check that you have Internet access.
                    default:
                        // "Unexpected error connecting to server: ex.Message
                        return null;
                }
            }
        }

Member Data Documentation

const int E_WINHTTP_CANNOT_CONNECT = unchecked((int)0x80072efd) [private]

Definition at line 24 of file Util.cs.

const int E_WINHTTP_CONNECTION_ERROR = unchecked((int)0x80072efe) [private]

Definition at line 25 of file Util.cs.

const int E_WINHTTP_NAME_NOT_RESOLVED = unchecked((int)0x80072ee7) [private]

Definition at line 23 of file Util.cs.

const int E_WINHTTP_TIMEOUT = unchecked((int)0x80072ee2) [private]

Definition at line 22 of file Util.cs.

JsonObject message = new JsonObject() [private]

Definition at line 27 of file Util.cs.

Uri serverBaseUri = new Uri("http://localhost:59992/") [static, private]

Definition at line 20 of file Util.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/cs/Util.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeepConnectionOpenScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • KeepConnectionOpenScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

KeepConnectionOpenScenario Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

KeepConnectionOpenScenario ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | CloseConnection_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | Connection_ServiceClosed (AppServiceConnection sender, AppServiceClosedEventArgs args)
async void | GenerateRandomNumber_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | OpenConnection_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

AppServiceConnection | connection
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file KeepConnectionOpenScenario.xaml.cs.

Constructor & Destructor Documentation

KeepConnectionOpenScenario ( ) [inline]

Definition at line 31 of file KeepConnectionOpenScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CloseConnection_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file KeepConnectionOpenScenario.xaml.cs.

        {
            //Is there an open connection?
            if (connection == null)
            {
                rootPage.NotifyUser("There's no open connection to close", NotifyType.ErrorMessage);
                return;
            }

            //Close the open connection
            connection.Dispose();
            connection = null;

            //Let the user know we closed the connection
            rootPage.NotifyUser("Connection is closed", NotifyType.StatusMessage);
        }

async void Connection_ServiceClosed | ( | AppServiceConnection | sender,
 |  | AppServiceClosedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 104 of file KeepConnectionOpenScenario.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //Dispose the connection reference we're holding
                if (connection != null)
                {
                    connection.Dispose();
                    connection = null;
                }
            });
        }

async void GenerateRandomNumber_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 134 of file KeepConnectionOpenScenario.xaml.cs.

        {
            //Is there an open connection?
            if (connection == null)
            {
                rootPage.NotifyUser("You need to open a connection before trying to generate a random number.", NotifyType.ErrorMessage);
                return;
            }

            //Parse user input
            int minValueInput;
            if (!int.TryParse(MinValue.Text, out minValueInput))
            {
                rootPage.NotifyUser("The Minimum Value should be a valid integer", NotifyType.ErrorMessage);
                return;
            }

            int maxValueInput;
            if (!int.TryParse(MaxValue.Text, out maxValueInput))
            {
                rootPage.NotifyUser("The Maximum Value should be a valid integer", NotifyType.ErrorMessage);
                return;
            }

            if (maxValueInput <= minValueInput)
            {
                rootPage.NotifyUser("Maximum Value must be larger than Minimum Value", NotifyType.ErrorMessage);
                return;
            }

            //Send a message to the app service
            var inputs = new ValueSet();
            inputs.Add("minvalue", minValueInput);
            inputs.Add("maxvalue", maxValueInput);
            AppServiceResponse response = await connection.SendMessageAsync(inputs);

            //"connection" may have been nulled out while we were awaiting.
            if (connection == null)
            {
                rootPage.NotifyUser("Connection was closed", NotifyType.ErrorMessage);
                return;
            }

            //If the service responded display the message. We're done!
            if (response.Status == AppServiceResponseStatus.Success)
            {
                if (!response.Message.ContainsKey("result"))
                {
                    rootPage.NotifyUser("The app service response message does not contain a key called \"result\"", NotifyType.StatusMessage);
                    return;
                }

                var resultText = response.Message["result"].ToString();
                if (!string.IsNullOrEmpty(resultText))
                {
                    Result.Text = resultText;
                    rootPage.NotifyUser("App service responded with a result", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("App service did not respond with a result", NotifyType.ErrorMessage);
                }
            }
            else
            {
                //Something went wrong. Show the user a meaningful
                //message depending upon the status
                switch (response.Status)
                {
                    case AppServiceResponseStatus.Failure:
                        rootPage.NotifyUser("The service failed to acknowledge the message we sent it. It may have been terminated because the client was suspended.", NotifyType.ErrorMessage);
                        break;

                    case AppServiceResponseStatus.ResourceLimitsExceeded:
                        rootPage.NotifyUser("The service exceeded the resources allocated to it and had to be terminated.", NotifyType.ErrorMessage);
                        break;

                    default:
                    case AppServiceResponseStatus.Unknown:
                        rootPage.NotifyUser("An unkown error occurred while we were trying to send a message to the service.", NotifyType.ErrorMessage);
                        break;
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file KeepConnectionOpenScenario.xaml.cs.

        {
            //Dispose the connection reference we're holding
            if (connection != null)
            {
                connection.Dispose();
                connection = null;
            }
        }

async void OpenConnection_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file KeepConnectionOpenScenario.xaml.cs.

        {
            //Is a connection already open?
            if (connection != null)
            {
                rootPage.NotifyUser("A connection already exists", NotifyType.ErrorMessage);
                return;
            }

            //Set up a new app service connection
            connection = new AppServiceConnection();
            connection.AppServiceName = "com.microsoft.randomnumbergenerator";
            connection.PackageFamilyName = "Microsoft.SDKSamples.AppServicesProvider.CS_8wekyb3d8bbwe";
            connection.ServiceClosed += Connection_ServiceClosed;
            AppServiceConnectionStatus status = await connection.OpenAsync();

            //"connection" may have been nulled out while we were awaiting.
            if (connection == null)
            {
                rootPage.NotifyUser("Connection was closed", NotifyType.ErrorMessage);
                return;
            }

            //If the new connection opened successfully we're done here
            if (status == AppServiceConnectionStatus.Success)
            {
                rootPage.NotifyUser("Connection is open", NotifyType.StatusMessage);
            }
            else
            {
                //Something went wrong. Lets figure out what it was and show the
                //user a meaningful message
                switch (status)
                {
                    case AppServiceConnectionStatus.AppNotInstalled:
                        rootPage.NotifyUser("The app AppServicesProvider is not installed. Deploy AppServicesProvider to this device and try again.", NotifyType.ErrorMessage);
                        break;

                    case AppServiceConnectionStatus.AppUnavailable:
                        rootPage.NotifyUser("The app AppServicesProvider is not available. This could be because it is currently being updated or was installed to a removable device that is no longer available.", NotifyType.ErrorMessage);
                        break;

                    case AppServiceConnectionStatus.AppServiceUnavailable:
                        rootPage.NotifyUser(string.Format("The app AppServicesProvider is installed but it does not provide the app service {0}.", connection.AppServiceName), NotifyType.ErrorMessage);
                        break;

                    default:
                    case AppServiceConnectionStatus.Unknown:
                        rootPage.NotifyUser("An unknown error occurred while we were trying to open an AppServiceConnection.", NotifyType.ErrorMessage);
                        break;
                }

                //Clean up before we go
                connection.Dispose();
                connection = null;
            }
        }

Member Data Documentation

AppServiceConnection connection [private]

Definition at line 29 of file KeepConnectionOpenScenario.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file KeepConnectionOpenScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • AppServices/cs/AppServicesClient/KeepConnectionOpenScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArrayInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LampArrayInfo
Public Member Functions | Public Attributes

LampArrayInfo Class Reference

List of all members.

Public Member Functions

LampArrayInfo (string id, string displayName, LampArray lampArray)

Public Attributes

readonly string | displayName
readonly string | id
readonly LampArray | lampArray

Detailed Description

Definition at line 36 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

LampArrayInfo | ( | string | id,
 |  | string | displayName,
 |  | LampArray | lampArray |
 | ) |  |  | [inline]

Definition at line 38 of file SampleConfiguration.cs.

        {
            this.id = id;
            this.displayName = displayName;
            this.lampArray = lampArray;
        }

Member Data Documentation

readonly string displayName

Definition at line 46 of file SampleConfiguration.cs.

readonly string id

Definition at line 45 of file SampleConfiguration.cs.

readonly LampArray lampArray

Definition at line 47 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • LampArray/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ListViewEdgeTappedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ListViewEdgeTappedEventArgs
Public Member Functions | Properties | Private Attributes

ListViewEdgeTappedEventArgs Class Reference

List of all members.

Public Member Functions

ListViewEdgeTappedEventArgs (ListViewItem listViewItem)

Properties

ListViewItem | ListViewItem [get]

Private Attributes

ListViewItem | listViewItem

Detailed Description

Definition at line 21 of file EdgeTappedListView.cs.

Constructor & Destructor Documentation

ListViewEdgeTappedEventArgs ( ListViewItem listViewItem ) [inline]

Definition at line 25 of file EdgeTappedListView.cs.

        {
            this.listViewItem = listViewItem;
        }

Member Data Documentation

ListViewItem listViewItem [private]

Definition at line 23 of file EdgeTappedListView.cs.

Property Documentation

ListViewItem ListViewItem [get]

Definition at line 24 of file EdgeTappedListView.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/EdgeTappedListView.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocationTrackingReason Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LocationTrackingReason
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

LocationTrackingReason Class Reference

Page containing the Extended Execution LocationTracking Reason scenario functions.

List of all members.

Public Member Functions

LocationTrackingReason ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | BeginExtendedExecution ()
void | ClearExtendedExecution ()
void | EndExtendedExecution ()
async void | OnTimer (object state)
async void | SessionRevoked (object sender, ExtendedExecutionRevokedEventArgs args)
async Task< Geolocator > | StartLocationTrackingAsync ()
void | UpdateUI ()

Private Attributes

Timer | periodicTimer = null
MainPage rootPage = MainPage.Current
ExtendedExecutionSession | session = null

Detailed Description

Definition at line 27 of file Scenario3_LocationTrackingReason.xaml.cs.

Constructor & Destructor Documentation

LocationTrackingReason ( ) [inline]

Definition at line 34 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BeginExtendedExecution ( ) [inline, private]

Definition at line 105 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            // The previous Extended Execution must be closed before a new one can be requested.
            // This code is redundant here because the sample doesn't allow a new extended
            // execution to begin until the previous one ends, but we leave it here for illustration.
            ClearExtendedExecution();

            var newSession = new ExtendedExecutionSession();
            newSession.Reason = ExtendedExecutionReason.LocationTracking;
            newSession.Description = "Tracking your location";
            newSession.Revoked += SessionRevoked;
            ExtendedExecutionResult result = await newSession.RequestExtensionAsync();

            switch (result)
            {
                case ExtendedExecutionResult.Allowed:
                    rootPage.NotifyUser("Extended execution allowed.", NotifyType.StatusMessage);
                    session = newSession;
                    Geolocator geolocator = await StartLocationTrackingAsync();
                    periodicTimer = new Timer(OnTimer, geolocator, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10));
                    break;

                default:
                case ExtendedExecutionResult.Denied:
                    rootPage.NotifyUser("Extended execution denied.", NotifyType.ErrorMessage);
                    newSession.Dispose();
                    break;
            }
            UpdateUI();
        }

void ClearExtendedExecution ( ) [inline, private]

Definition at line 46 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            if (session != null)
            {
                session.Revoked -= SessionRevoked;
                session.Dispose();
                session = null;
            }

            if (periodicTimer != null)
            {
                periodicTimer.Dispose();
                periodicTimer = null;
            }
        }

void EndExtendedExecution ( ) [inline, private]

Definition at line 160 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            ClearExtendedExecution();
            UpdateUI();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            // End the Extended Execution Session.
            // Only one extended execution session can be held by an application at one time.
            ClearExtendedExecution();
        }

async void OnTimer ( object state ) [inline, private]

Definition at line 136 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            var geolocator = (Geolocator)state;
            string message;
            if (geolocator == null)
            {
                message = "No geolocator";
            }
            else
            {
                Geoposition geoposition = await geolocator.GetGeopositionAsync();
                if (geoposition == null)
                {
                    message = "Cannot get current location";
                }
                else
                {
                    BasicGeoposition basicPosition = geoposition.Coordinate.Point.Position;
                    message = $"Longitude = {basicPosition.Longitude}, Latitude = {basicPosition.Latitude}";
                }
            }
            MainPage.DisplayToast(message);
        }

async void SessionRevoked | ( | object | sender,
 |  | ExtendedExecutionRevokedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 166 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (args.Reason)
                {
                    case ExtendedExecutionRevokedReason.Resumed:
                        rootPage.NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType.StatusMessage);
                        break;

                    case ExtendedExecutionRevokedReason.SystemPolicy:
                        rootPage.NotifyUser("Extended execution revoked due to system policy.", NotifyType.StatusMessage);
                        break;
                }

                EndExtendedExecution();
            });
        }

task< void > StartLocationTrackingAsync ( ) [inline, private]

Definition at line 78 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            Geolocator geolocator = null;

            // Request permission to access location
            var accessStatus = await Geolocator.RequestAccessAsync();

            switch (accessStatus)
            {
                case GeolocationAccessStatus.Allowed:
                    // See the Geolocation sample for more information on using the Geolocator class.
                    geolocator = new Geolocator { ReportInterval = 2000 };
                    break;

                case GeolocationAccessStatus.Denied:
                    rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                    break;

                default:
                case GeolocationAccessStatus.Unspecified:
                    rootPage.NotifyUser("Couldn't access the geolocator.", NotifyType.ErrorMessage);
                    break;
            }

            return geolocator;
        }

void UpdateUI ( ) [inline, private]

Definition at line 62 of file Scenario3_LocationTrackingReason.xaml.cs.

        {
            if (session == null)
            {
                Status.Text = "Not requested";
                RequestButton.IsEnabled = true;
                CloseButton.IsEnabled = false;
            }
            else
            {
                Status.Text = "Requested";
                RequestButton.IsEnabled = false;
                CloseButton.IsEnabled = true;
            }
        }

Member Data Documentation

Timer periodicTimer = null [private]

Definition at line 32 of file Scenario3_LocationTrackingReason.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario3_LocationTrackingReason.xaml.cs.

ExtendedExecutionSession session = null [private]

Definition at line 31 of file Scenario3_LocationTrackingReason.xaml.cs.

The documentation for this class was generated from the following files:
  • ExtendedExecution/cs/Scenario3_LocationTrackingReason.xaml.cs
  • ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.cpp
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingChannelScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LoggingChannelScenario
Public Member Functions | Private Member Functions

LoggingChannelScenario Class Reference

Demonstrate usage of LoggingChannel and LoggingActivity.

List of all members.

Public Member Functions

void | LogWithWin10Constructor ()
void | LogWithWin81Constructor ()

Private Member Functions

string | CollectExpensiveData ()
void | DemonstrateLogging (LoggingChannel channel)
void | DoSomething (ILoggingTarget logger)
void | OnLoggingEnabled (ILoggingChannel sender, object args)

Detailed Description

Definition at line 15 of file LoggingChannelScenario.cs.

Member Function Documentation

String CollectExpensiveData ( ) [inline, private]

Definition at line 297 of file LoggingChannelScenario.cs.

        {
            return "ExpensiveData";
        }

void DemonstrateLogging ( LoggingChannel channel ) [inline, private]

This method demonstrates the LoggingChannel and LoggingActivity APIs.

Parameters:
channel The channel to use for the demonstration. This channel may have been constructed using a Windows 8.1 constructor or a Windows 10 constructor. The same APIs are supported in both cases, but the ETL events will be formatted a bit differently depending on how the channel was constructed.

Definition at line 101 of file LoggingChannelScenario.cs.

        {
            // Whenever any ETW session changes the way it is listening to this
            // channel, the LoggingEnable event is fired. For example, this might
            // be called when a session begins listening, changes the level at
            // which it is listening, or stops listening.
            channel.LoggingEnabled += this.OnLoggingEnabled;

            // Log simple string events
            channel.LogMessage("Simple message"); // default level is Verbose
            channel.LogMessage("Simple error", LoggingLevel.Error);

            // Log simple string + integer events.
            channel.LogValuePair("Simple message", 123); // default level is Verbose
            channel.LogValuePair("Simple error", 456, LoggingLevel.Error);

            // The channel.Name property returns the name that was used when the
            // channel was constructed. When running in Windows 10 mode, the name
            // is already set as the provider name, so no LoggingChannelName is
            // automatically added to the event.
            channel.LogMessage(channel.Name);

            // The channel.Id property is new to Windows 10.
            channel.LogMessage(channel.Id.ToString());

            // If you want to avoid the overhead of collecting data when nobody is
            // listening to your channel, check the Enabled property before logging.
            if (channel.Enabled)
            {
                channel.LogMessage(this.CollectExpensiveData());
            }

            // The IsEnabled() method is exactly the same as the Enabled property,
            // except that it is a new Windows 10 API.
            if (channel.IsEnabled())
            {
                channel.LogMessage(this.CollectExpensiveData());
            }

            // If you want to only collect data if somebody is listening at a specific
            // level, you need to check both Enabled and Level. Note that the value of
            // the Level is unspecified when Enabled is false.
            if (channel.Enabled && channel.Level <= LoggingLevel.Warning)
            {
                channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Warning);
            }

            // The IsEnabled(LoggingLevel) method is a bit nicer than checking both
            // Enabled and Level, but it is only available on Windows 10 or later.
            if (channel.IsEnabled(LoggingLevel.Warning))
            {
                channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Warning);
            }

            // You can also use IsEnabled to check for keywords.
            if (channel.IsEnabled(LoggingLevel.Information, 0x10))
            {
                channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Information);
            }

            // Use LoggingFields with the LogEvent method to write complex events.
            var fields = new LoggingFields();
            fields.AddDouble("pi", 3.14159);
            channel.LogEvent(
                "ComplexEvent",
                fields,
                LoggingLevel.Verbose,
                new LoggingOptions(0x10)); // Keywords = 0x10

            // You can add any number of name-value pairs to a fields object, though
            // you may encounter ETW limitations if you add too many. For example,
            // ETW is limited to a maximum event size of 64KB, and the current
            // TraceLogging decoder can handle no more than 128 fields.

            // Performance optimization: You can reuse a LoggingFields object to
            // avoid unnecessary allocations. Don't forget to call Clear()
            // between uses, and don't try to share a LoggingFields object between
            // threads.
            fields.Clear();
            fields.AddDateTime("Date", DateTimeOffset.Now);
            channel.LogEvent("Now", fields);

            fields.Clear();

            // You can add a formatting hint to affect the way a value is decoded.
            // Not all combinations are useful, and the hint may be ignored.
            // For example, you can encode an MBCS string by writing a byte array
            // with a String hint.
            fields.AddUInt8Array(
                "AnsiString",
                new byte[] { 65, 66, 67, 49, 50, 51 }, // "ABC123"
                LoggingFieldFormat.String);

            // You can add "tag" bits to a field. These are user-defined bits that
            // can be used to communicate with an event processing tool. For example,
            // you might define a tag bit to indicate that a field contains private
            // data that should not be displayed on-screen.
            fields.AddString("Password", "12345", LoggingFieldFormat.Default, 0x10);

            // You can add a "structure" to an event. A structure is a name for a
            // group of fields. Structures can nest. Call BeginStruct to add a level
            // of nesting, and call EndStruct after the last field of the structure.
            fields.BeginStruct("Nested");
                fields.AddInt16("Nested-1", 1);
                fields.AddInt16("Nested-2", 2);
                fields.BeginStruct("Nested-Nested");
                    fields.AddInt16("Nested-Nested-3", 3);
                fields.EndStruct();
                fields.AddInt16("Nested-4", 4);
            fields.EndStruct();

            // Advanced scenarios: you can use a LoggingOptions object to control
            // detailed event settings such as keywords, opcodes, and activity Ids.
            // These have their normal ETW semantics. You can also set event tags,
            // which are bit values that can be used to communicate with the event
            // processor.
            channel.LogEvent(
                "VeryComplexEvent",
                fields,
                LoggingLevel.Information,
                new LoggingOptions { Keywords = 0x123, Tags = 0x10 });

            // Windows 10 introduces the ILoggingTarget interface. LoggingChannel
            // implements this interface. This interface allows components to accept
            // a logger as an parameter.
            this.DoSomething(channel);

            /*
            If a LoggingActivity is created using a LoggingActivity constructor,
            it will use Windows 8.1 semantics:

            - If an activity is destroyed (garbage-collected) without being closed
              and the associated LoggingChannel is still open, the activity will
              write a default Stop event.
            - The default Stop event (written by the destructor or by the Close()
              method) is encoded as a "simple" event.

            The 8.1 semantics are deprecated because the automatic generation of
            a Stop event at garbage-collection can be misleading. The Stop event
            is intended to mark the a precise point at which an activity is
            completed, while the garbage-collection of an abandoned activity is
            inherently imprecise and unpredictable.

            If a LoggingActivity is created using a StartActivity method, it will
            use Windows 10 semantics:

            - If an activity is destroyed (garbage-collected) without being closed,
              there will be no Stop event for the activity.
            - The default Stop event (written by the Close() method) is encoded as
              a TraceLogging event with name "ActivityClosed".
            */

            // This activity is created with Windows 8.1 semantics.
            using (var a1 = new LoggingActivity("Activity1", channel))
            {
                // The activity Start event is written by the LoggingActivity constructor.
                // You would do your activity's work here.
                // The activity Stop event is written when the activity is closed (disposed).

                // The Windows 10 LoggingActivity adds new methods for writing events
                // that are marked as associated with the activity.
                a1.LogEvent("Activity event");

                // LoggingActivity also implements the ILoggingTarget interface, so you can
                // use either a channel or an activity as a logging target.
                this.DoSomething(a1);

                // The Windows 10 LoggingActivity adds new methods for creating nested activities.
                // Note that nested activities are always created with Windows 10 semantics,
                // even when nested under an activity that is using Windows 8.1 semantics.
                using (var a2 = a1.StartActivity("Activity2"))
                {
                    // Nested task occurs here.

                    // The Windows 10 LoggingActivity allows you to customize the Stop event.
                    a2.StopActivity("Activity 2 stop");
                }

                // Because a1 is using Windows 8.1 semantics, if we did not call Dispose(),
                // it would attempt to write a Stop event when it is garbage collected.
                // Writing Stop events during garbage collection is not useful, so be sure
                // to properly stop, close, or dispose activities.
            }

            // The Windows 10 StartActivity method creates a new activity, optionally with
            // specified fields and characteristics.
            // This activity is created with Windows 10 semantics.
            using (var a3 = channel.StartActivity("Activity3"))
            {
                // Because a3 is using Windows 10 semantics, if we did not call Dispose(),
                // there would be no Stop event (not even when the activity is garbage
                // collected). To get a Stop event, be sure to stop, close, or dispose the
                // activity.
            }
        }

void DoSomething ( ILoggingTarget logger ) [inline, private]

Definition at line 302 of file LoggingChannelScenario.cs.

        {
            logger.LogEvent("Did something");
        }

void LogWithWin10Constructor ( ) [inline]

Construct a LoggingChannel with the Windows 10 constructor, then use the LoggingChannel for the scenario.

Also show the use cases for the two Windows 10 constructors. See this sample's README for further discussion.

Also show the use cases for the two Windows 10 constructors.

Definition at line 48 of file LoggingChannelScenario.cs.

        {
            /*
            If a LoggingChannel is used as a local or member variable, it should
            be closed (disposed) when no longer needed. C# will do this automatically
            if you enclose the usage in a using block.
            */

            // The 2-parameter constructor creates a channel with Windows 10 semantics.
            using (var channel = new LoggingChannel(
                "SampleProvider",
                null)) // null means use default options.
            {
                // The Id is generated by hashing the string "SampleProvider".
                // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f

                this.DemonstrateLogging(channel);
            }

            /*
            Demonstrate other (less-common) constructor scenarios:
            */

            // This creates a channel with Windows 10 semantics and declared
            // membership in a provider group.
            using (var channel = new LoggingChannel(
                "SampleProvider",
                new LoggingChannelOptions(new Guid("2e0582f3-d1b6-516a-9de3-9fd79ef952f8")))) // Join a provider group
            {
                // The Id is generated by hashing the string "SampleProvider".
                // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
            }

            // This creates a channel with Windows 10 semantics and a specific
            // provider Id.
            using (var channel = new LoggingChannel(
                "SampleProvider",
                null,
                new Guid("2e0582f3-d1b6-516a-9de3-9fd79ef952f8")))
            {
                // channel.Id == 2e0582f3-d1b6-516a-9de3-9fd79ef952f8
            }
        }

void LogWithWin81Constructor ( ) [inline]

Construct a LoggingChannel with the Windows 8.1 constructor, then use the LoggingChannel for the scenario.

See this sample's README for further discussion.

Definition at line 22 of file LoggingChannelScenario.cs.

        {
            /*
            If a LoggingChannel is used as a local or member variable, it should
            be closed (disposed) when no longer needed. C# will do this automatically
            if you enclose the usage in a using block.
            */

            // The 1-parameter constructor creates a channel with Windows 8.1 semantics.
#pragma warning disable 618 // Disable warning for use of obsolete LoggingChannel constructor.
            using (var channel = new LoggingChannel("SampleProvider"))
            {
                // The Id for a Windows 8.1-mode channel is always the same.
                // channel.Id == 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a

                this.DemonstrateLogging(channel);
            }
#pragma warning restore 618
        }

void OnLoggingEnabled | ( | ILoggingChannel | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 307 of file LoggingChannelScenario.cs.

        {
            // Here, you could note a change in the level or keywords.
        }

The documentation for this class was generated from the following files:
  • Logging/cs/LoggingChannelScenario.cs
  • Logging/cpp/LoggingChannelScenario.cpp
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingScenarioEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LoggingScenarioEventArgs
Public Member Functions | Properties

LoggingScenarioEventArgs Class Reference

List of all members.

Public Member Functions

LoggingScenarioEventArgs (LoggingScenarioEventType type)
LoggingScenarioEventArgs (bool enabled)
LoggingScenarioEventArgs (LoggingScenarioEventType type, string logFilePath)

Properties

bool | Enabled [get, set]
string | LogFilePath [get, set]
LoggingScenarioEventType | Type [get, set]

Detailed Description

Definition at line 24 of file LoggingScenarioEventArgs.cs.

Constructor & Destructor Documentation

LoggingScenarioEventArgs ( LoggingScenarioEventType type ) [inline]

Definition at line 26 of file LoggingScenarioEventArgs.cs.

        {
            Type = type;
        }

LoggingScenarioEventArgs | ( | LoggingScenarioEventType | type,
 |  | string | logFilePath |
 | ) |  |  | [inline]

Definition at line 31 of file LoggingScenarioEventArgs.cs.

        {
            Type = type;
            LogFilePath = logFilePath;
        }

LoggingScenarioEventArgs ( bool enabled ) [inline]

Definition at line 37 of file LoggingScenarioEventArgs.cs.

        {
            Type = LoggingScenarioEventType.LoggingEnabledDisabled;
            Enabled = enabled;
        }

Property Documentation

bool Enabled [get, set]

Definition at line 45 of file LoggingScenarioEventArgs.cs.

string LogFilePath [get, set]

Definition at line 44 of file LoggingScenarioEventArgs.cs.

LoggingScenarioEventType Type [get, set]

Definition at line 43 of file LoggingScenarioEventArgs.cs.

The documentation for this class was generated from the following file:
  • Logging/cs/LoggingScenarioEventArgs.cs
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingSessionScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LoggingSessionScenario
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes | Static Private Attributes

LoggingSessionScenario Class Reference

LoggingSessionScenario is a central singleton class which contains the logging-specific sample code.

List of all members.

Public Member Functions

void | Dispose ()
async Task | DoScenarioAsync ()
void | PrepareToSuspend ()
void | ResumeLoggingIfApplicable ()
void | StartLogging ()
bool | ToggleLoggingEnabledDisabled ()

Public Attributes

const string | DEFAULT_CHANNEL_NAME = "Channel"
const string | DEFAULT_SESSION_NAME = "Session"
const string | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME = "LogFiles"

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

static LoggingSessionScenario | Instance [get]
bool | IsBusy [get, set]
bool | IsLoggingEnabled [get]
int | LogFileGeneratedCount [get, set]

Events

EventHandler
< LoggingScenarioEventArgs > 		StatusChanged

Private Member Functions

LoggingSessionScenario ()
~LoggingSessionScenario ()
void | CheckDisposed ()
string | GetTimeStamp ()
void | OnAppResuming (object sender, object e)
void | OnAppSuspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
void | OnChannelLoggingEnabled (ILoggingChannel sender, object args)
async Task< string > | SaveLogInMemoryToFileAsync ()

Private Attributes

LoggingChannel | channel
LoggingLevel | channelLoggingLevel = LoggingLevel.Verbose
bool | isBusy
bool | isChannelEnabled = false
bool | isDisposed = false
const string | LoggingEnabledKey = "LoggingEnabled"
const string | Prefix = "LoggingSessionScenario_"
LoggingSession | session

Static Private Attributes

static LoggingSessionScenario | loggingSessionScenario

Detailed Description

Definition at line 18 of file LoggingSessionScenario.cs.

Constructor & Destructor Documentation

LoggingSessionScenario ( ) [inline, private]

Disallow creation of instances beyond the one instance for the process.

The one instance is accessible via the Instance property (see below).

Definition at line 366 of file LoggingSessionScenario.cs.

        {
            LogFileGeneratedCount = 0;

            // This sample demonstrates LoggingSession using the Windows 8.1 LoggingChannel APIs.
#pragma warning disable 618 // LoggingChannel is obsolete
            channel = new LoggingChannel(DEFAULT_CHANNEL_NAME);
#pragma warning restore

            channel.LoggingEnabled += OnChannelLoggingEnabled;

            App.Current.Suspending += OnAppSuspending;
            App.Current.Resuming += OnAppResuming;

            // If the app is being launched (not resumed), the
            // following call will activate logging if it had been
            // activated during the last suspend.
            ResumeLoggingIfApplicable();
        }

~LoggingSessionScenario ( ) [inline, private]

Definition at line 386 of file LoggingSessionScenario.cs.

        {
            Dispose(false);
        }

Member Function Documentation

void CheckDisposed ( ) [inline, private]

Helper function for other methods to call to check Dispose() state.

Definition at line 473 of file LoggingSessionScenario.cs.

        {
            if (isDisposed)
            {
                throw new ObjectDisposedException("LoggingSessionScenario");
            }
        }

void Dispose ( ) [inline]

Definition at line 436 of file LoggingSessionScenario.cs.

        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 442 of file LoggingSessionScenario.cs.

        {
            if (isDisposed == false)
            {
                isDisposed = true;

                if (disposing)
                {
                    if (channel != null)
                    {
                        channel.Dispose();
                        channel = null;
                    }

                    if (session != null)
                    {
                        session.Dispose();
                        session = null;
                    }
                }
            }
        }

task< void > DoScenarioAsync ( ) [inline]

The logging scenario.

Log messages in a loop until 3 log files are created.

Returns:
The task.

Definition at line 81 of file LoggingSessionScenario.cs.

        {
            CheckDisposed();

            IsBusy = true;

            try
            {
                await Task.Run(async () =>
                {
                    const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;
                    int messageIndex = 0;
                    int lastDelay = 0;
                    int lastAppError = 0;
                    int startFileCount = LogFileGeneratedCount;

                    //
                    // Log large messages until the current log file hits the maximum size.
                    // When the current log file reaches its maximum size, LogFileGeneratedHandler
                    // will be called.
                    //

                    while (LogFileGeneratedCount - startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
                    {
                        try
                        {
                            // Since the channel is added to the session at level Warning,
                            // the following is logged because it is logged at level LoggingLevel.Critical.
                            channel.LogMessage(
                                string.Format("Message={0}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ligula nisi, vehicula nec eleifend vel, rutrum non dolor. Vestibulum ante ipsum " +
                                              "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.",
                                              ++messageIndex),
                                LoggingLevel.Critical);

                            // Since the channel is added to the session at level Warning,
                            // the following is *not* logged because it is logged at LoggingLevel.Information.
                            channel.LogMessage(
                                string.Format("Message={0}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ligula nisi, vehicula nec eleifend vel, rutrum non dolor. Vestibulum ante ipsum " +
                                              "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.",
                                              ++messageIndex),
                                LoggingLevel.Information);

                            int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
                            channel.LogMessage("Value #" + (++messageIndex).ToString() + "  " + value.ToString(), LoggingLevel.Critical); // value is logged as 14 byte wide character string.
                            channel.LogValuePair("Value #" + (++messageIndex).ToString(), value, LoggingLevel.Critical); // value is logged as a 4-byte integer.

                            //
                            // Pause every once in a while to simulate application
                            // activity outside of logging.
                            //

                            if (messageIndex - lastDelay > 100)
                            {
                                lastDelay = messageIndex;
                                await Task.Delay(10);
                            }

                            //
                            // Every once in a while, simulate an application error
                            // which causes the app to save the current snapshot
                            // of logging events in memory to a disk ETL file.
                            //

                            if (messageIndex - lastAppError >= 25000)
                            {
                                lastAppError = messageIndex;

                                // Before simulating an application error, demonstrate LoggingActivity.
                                // A LoggingActivity outputs a pair of begin and end messages to the channel.
                                using (new LoggingActivity("Add two numbers.", channel, LoggingLevel.Critical))
                                {
                                    int oneNumber = 100;
                                    int anotherNumber = 200;
                                    int total = oneNumber + anotherNumber;
                                    channel.LogMessage(string.Format("Message={0}: The result of adding two numbers: {1}", ++messageIndex, total), LoggingLevel.Critical);
                                } // The LoggingActivity instance will log the second message at this scope exit.

                                // Simulate an application error.
                                throw new AppException("Some bad app error occurred.");
                            }
                        }
                        catch (AppException e)
                        {
                            // Log the exception string.
                            channel.LogMessage("Exception occurrred: " + e.ToString(), LoggingLevel.Error);

                            // Save the memory log buffer to file.
                            Task<string> op = SaveLogInMemoryToFileAsync();
                            op.Wait();
                            if (op.IsFaulted)
                            {
                                throw new Exception("After an app error occurred, there was a failure to save the log file.", op.Exception);
                            }
                            LogFileGeneratedCount++;
                            // For the sample, update the UI to show a log file has been generated.
                            if (StatusChanged != null)
                            {
                                StatusChanged.Invoke(this, new LoggingScenarioEventArgs(LoggingScenarioEventType.LogFileGenerated, op.Result));
                            }
                        }
                    }
                });
            }
            finally
            {
                IsBusy = false;
            }
        }

string GetTimeStamp ( ) [inline, private]

Definition at line 23 of file LoggingSessionScenario.cs.

        {
            DateTime now = DateTime.Now;
            return string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                 "{0:D2}{1:D2}{2:D2}-{3:D2}{4:D2}{5:D2}{6:D3}",
                                 now.Year - 2000,
                                 now.Month,
                                 now.Day,
                                 now.Hour,
                                 now.Minute,
                                 now.Second,
                                 now.Millisecond);
        }

void OnAppResuming | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 404 of file LoggingSessionScenario.cs.

        {
            // If logging was active at the last suspend,
            // ResumeLoggingIfApplicable will re-activate
            // logging.
            ResumeLoggingIfApplicable();
        }

void OnAppSuspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 391 of file LoggingSessionScenario.cs.

        {
            // Get a deferral before performing any async operations
            // to avoid suspension prior to LoggingSessionScenario completing
            // PrepareToSuspendAsync().
            var deferral = e.SuspendingOperation.GetDeferral();
            // Prepare logging for suspension.
            PrepareToSuspend();
            // From LoggingSessionScenario's perspective, it's now okay to
            // suspend, so release the deferral.
            deferral.Complete();
        }

void OnChannelLoggingEnabled | ( | ILoggingChannel | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 252 of file LoggingSessionScenario.cs.

        {
            // This method is called when the channel is informing us of channel-related state changes.
            // Save new channel state. These values can be used for advanced logging scenarios where,
            // for example, it's desired to skip blocks of logging code if the channel is not being
            // consumed by any sessions.
            isChannelEnabled = sender.Enabled;
            channelLoggingLevel = sender.Level;
        }

void PrepareToSuspend ( ) [inline]

Definition at line 276 of file LoggingSessionScenario.cs.

        {
            CheckDisposed();

            ApplicationData.Current.LocalSettings.Values["LoggingEnabled"] = session != null;
        }

void ResumeLoggingIfApplicable ( ) [inline]

Definition at line 283 of file LoggingSessionScenario.cs.

        {
            CheckDisposed();

            object loggingEnabled;
            if (ApplicationData.Current.LocalSettings.Values.TryGetValue("LoggingEnabled", out loggingEnabled) == false)
            {
                ApplicationData.Current.LocalSettings.Values["LoggingEnabled"] = true;
                loggingEnabled = ApplicationData.Current.LocalSettings.Values["LoggingEnabled"];
            }

            if (loggingEnabled is bool && (bool)loggingEnabled == true)
            {
                StartLogging();
            }
        }

task< StorageFile^> SaveLogInMemoryToFileAsync ( ) [inline, private]

Definition at line 214 of file LoggingSessionScenario.cs.

        {
            StorageFolder sampleAppDefinedLogFolder =
                await ApplicationData.Current.LocalFolder.CreateFolderAsync(OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
                                                                            CreationCollisionOption.OpenIfExists);
            string newLogFileName = "Log-" + GetTimeStamp() + ".etl";
            StorageFile newLogFile = await session.SaveToFileAsync(sampleAppDefinedLogFolder, newLogFileName);
            if (newLogFile != null)
            {
                return newLogFile.Path;
            }
            else
            {
                return null;
            }
        }

void StartLogging ( ) [inline]

Definition at line 190 of file LoggingSessionScenario.cs.

        {
            CheckDisposed();

            // If no session exists, create one.
            // NOTE: There are use cases where an application
            // may want to create only a channel for sessions outside
            // of the application itself. See MSDN for details. This
            // sample is the common scenario of an app logging events
            // which it wants to place in its own log file, so it creates
            // a session and channel as a pair. The channel is created
            // during construction of this LoggingSessionScenario class so
            // it already exsits by the time this function is called.
            if (session == null)
            {
                session = new LoggingSession(DEFAULT_SESSION_NAME);
            }

            // This sample adds the channel at level "warning" to
            // demonstrated how messages logged at more verbose levels
            // are ignored by the session.
            session.AddLoggingChannel(channel, LoggingLevel.Warning);
        }

bool ToggleLoggingEnabledDisabled ( ) [inline]

Toggle the enabled/disabled status of logging.

Returns:
True if the resulting new status is enabled, else false for disabled.

Definition at line 41 of file LoggingSessionScenario.cs.

        {
            CheckDisposed();

            IsBusy = true;

            try
            {
                bool enabled;
                if (session != null)
                {
                    session.Dispose();
                    session = null;
                    ApplicationData.Current.LocalSettings.Values["LoggingEnabled"] = false;
                    enabled = false;
                }
                else
                {
                    StartLogging();
                    ApplicationData.Current.LocalSettings.Values["LoggingEnabled"] = true;
                    enabled = true;
                }

                if (StatusChanged != null)
                {
                    StatusChanged.Invoke(this, new LoggingScenarioEventArgs(enabled));
                }

                return enabled;
            }
            finally
            {
                IsBusy = false;
            }
        }

Member Data Documentation

LoggingChannel channel [private]

The sample's one channel.

Definition at line 356 of file LoggingSessionScenario.cs.

LoggingLevel channelLoggingLevel = LoggingLevel.Verbose [private]

This is the current maximum level of listeners of the application's channel.

It is adjusted as the channel's LoggingEnabled event is raised. Search for OnChannelLoggingEnabled for more information.

Definition at line 250 of file LoggingSessionScenario.cs.

const string DEFAULT_CHANNEL_NAME = "Channel"

Definition at line 339 of file LoggingSessionScenario.cs.

const string DEFAULT_SESSION_NAME = "Session"

Definition at line 338 of file LoggingSessionScenario.cs.

bool isBusy [private]

Definition at line 306 of file LoggingSessionScenario.cs.

bool isChannelEnabled = false [private]

This boolean tracks whether or not there are any sessions listening to the app's channel.

This is adjusted as the channel's LoggingEnabled event is raised. Search for OnChannelLoggingEnabled for more information.

Definition at line 242 of file LoggingSessionScenario.cs.

bool isDisposed = false [private]

Set to 'true' if Dispose() has been called.

Definition at line 468 of file LoggingSessionScenario.cs.

const string LoggingEnabledKey = "LoggingEnabled" [private]

Definition at line 266 of file LoggingSessionScenario.cs.

LoggingSessionScenario loggingSessionScenario [static, private]

The app's one and only LoggingSessionScenario instance.

Definition at line 414 of file LoggingSessionScenario.cs.

const string OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME = "LogFiles"

LoggingSessionScenario moves generated logs files into the this folder under the LocalState folder.

Definition at line 345 of file LoggingSessionScenario.cs.

const string Prefix = "LoggingSessionScenario_" [private]

Definition at line 337 of file LoggingSessionScenario.cs.

LoggingSession session [private]

The sample's one session.

Definition at line 351 of file LoggingSessionScenario.cs.

Property Documentation

LoggingSessionScenario Instance [static, get]

A method to allowing callers to access the app's one and only LoggingSessionScenario instance.

Returns:
The logging helper.

Definition at line 421 of file LoggingSessionScenario.cs.

bool IsBusy [get, set]

True if the scenario is busy, or false if not busy.

The UI can use this to affect UI controls.

Definition at line 312 of file LoggingSessionScenario.cs.

bool IsLoggingEnabled [get]

Definition at line 269 of file LoggingSessionScenario.cs.

int LogFileGeneratedCount [get, set]

The number of times LogFileGeneratedHandler has been called.

Definition at line 331 of file LoggingSessionScenario.cs.

Event Documentation

EventHandler<LoggingScenarioEventArgs> StatusChanged

Definition at line 304 of file LoggingSessionScenario.cs.

The documentation for this class was generated from the following files:
  • Logging/cs/LoggingSessionScenario.cs
  • Logging/cpp/LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LookupTable< T, LookupTableSize > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LookupTable< T, LookupTableSize >
Public Types | Public Member Functions | Private Attributes

LookupTable< T, LookupTableSize > Class Template Reference

#include "LookupTable.h"

List of all members.

Public Types

typedef std::function< T(UINT32,
UINT32)> 		LookupTableGenerator

Public Member Functions

LookupTable (LookupTableGenerator Generator)
T | GetValue (float value)

Private Attributes

T | m_lookuptable [LookupTableSize]

Detailed Description

template<typename T, UINT32 LookupTableSize>
class SDKTemplate::LookupTable< T, LookupTableSize >

Definition at line 17 of file LookupTable.h.

Member Typedef Documentation

typedef std::function<T(UINT32, UINT32)> LookupTableGenerator

Definition at line 22 of file LookupTable.h.

Constructor & Destructor Documentation

LookupTable ( LookupTableGenerator Generator ) [inline]

The values of the lookup table are generated using a function passed into the constructor.

Definition at line 27 of file LookupTable.h.

        {
            for (int i = 0; i < LookupTableSize; i++)
            {
                // Generate values for lookup table
                m_lookuptable[i] = Generator(i, LookupTableSize);
            }
        }

Member Function Documentation

T GetValue ( float value ) [inline]

Definition at line 36 of file LookupTable.h.

        {
            int index = static_cast<int>(value * LookupTableSize);
            index = min(max(0, index), LookupTableSize - 1);
            return m_lookuptable[index];
        }

Member Data Documentation

T m_lookuptable[LookupTableSize] [private]

Definition at line 44 of file LookupTable.h.

The documentation for this class was generated from the following file:
  • CameraFrames/cpp/LookupTable.h
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInputMain Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • LowLatencyInputMain
Public Member Functions | Private Member Functions | Private Attributes

LowLatencyInputMain Class Reference

#include "LowLatencyInputMain.h"

List of all members.

Public Member Functions

LowLatencyInputMain (const std::shared_ptr< DX::DeviceResources > &deviceResources)
~LowLatencyInputMain ()
Concurrency::critical_section & | GetCriticalSection ()
bool | HitTest (Windows::Foundation::Point position)
virtual void | OnDeviceLost ()
virtual void | OnDeviceRestored ()
void | ResetRect ()
void | SetBrushColor (D2D1::ColorF color)
void | SetRectSize (float newSize)
void | StartRenderLoop ()
void | StopRenderLoop ()
void | UpdateRectTransform (Windows::Foundation::Point newPosition, Windows::UI::Input::ManipulationDelta newDelta)

Private Member Functions

void | Render ()

Private Attributes

Concurrency::critical_section | criticalSection
std::shared_ptr
< DX::DeviceResources > 		deviceResources
Windows::Foundation::IAsyncAction | renderLoopWorker
std::unique_ptr< RectRenderer > | sceneRenderer

Detailed Description

Definition at line 20 of file LowLatencyInputMain.h.

Constructor & Destructor Documentation

LowLatencyInputMain ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 23 of file LowLatencyInputMain.cpp.

                                                                                :
    deviceResources(deviceResources)
{
    // Register to be notified if the Device is lost or recreated
    deviceResources->RegisterDeviceNotify(this);

    sceneRenderer = std::unique_ptr<RectRenderer>(new RectRenderer(deviceResources));
}

~LowLatencyInputMain ( )

Definition at line 32 of file LowLatencyInputMain.cpp.

{
    // Deregister device notification
    deviceResources->RegisterDeviceNotify(nullptr);
}

Member Function Documentation

Concurrency::critical_section& GetCriticalSection ( ) [inline]

Definition at line 27 of file LowLatencyInputMain.h.

{ return criticalSection; }

bool HitTest ( Windows::Foundation::Point position )

Definition at line 112 of file LowLatencyInputMain.cpp.

{
    return sceneRenderer->HitTest(position);
}

void OnDeviceLost ( ) [virtual]

Definition at line 94 of file LowLatencyInputMain.cpp.

{
    sceneRenderer->ReleaseDeviceDependentResources();
}

void OnDeviceRestored ( ) [virtual]

Definition at line 100 of file LowLatencyInputMain.cpp.

{
    sceneRenderer->CreateDeviceDependentResources();
}

void Render ( ) [private]

Definition at line 73 of file LowLatencyInputMain.cpp.

{
    auto context = deviceResources->GetD3DDeviceContext();

    // Reset the viewport to target the whole screen.
    auto viewport = deviceResources->GetScreenViewport();
    context->RSSetViewports(1, &viewport);

    // Reset render targets to the screen.
    ID3D11RenderTargetView *const targets[1] = { deviceResources->GetBackBufferRenderTargetView() };
    context->OMSetRenderTargets(1, targets, deviceResources->GetDepthStencilView());

    // Clear the back buffer and depth stencil view.
    context->ClearRenderTargetView(deviceResources->GetBackBufferRenderTargetView(), DirectX::Colors::Black);
    context->ClearDepthStencilView(deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

    // Render the scene objects.
    sceneRenderer->Render();
}

void ResetRect ( )

Definition at line 122 of file LowLatencyInputMain.cpp.

{
    sceneRenderer->ResetRect();
}

void SetBrushColor ( D2D1::ColorF color )

Definition at line 127 of file LowLatencyInputMain.cpp.

{
    sceneRenderer->SetBrushColor(color);
}

void SetRectSize ( float newSize )

Definition at line 117 of file LowLatencyInputMain.cpp.

{
    sceneRenderer->SetRectSize(newSize);
}

void StartRenderLoop ( )

Definition at line 38 of file LowLatencyInputMain.cpp.

{
    // If the animation render loop is already running then do not start another thread.
    if (renderLoopWorker != nullptr && renderLoopWorker->Status == AsyncStatus::Started)
    {
        return;
    }

    // Create a task that will be run on a background thread.
    auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^ action)
    {
        // Calculate the updated frame and render once per vertical blanking interval.
        while (action->Status == AsyncStatus::Started)
        {
            critical_section::scoped_lock lock(criticalSection);

            // Block this thread until the swap chain is finished presenting. Note that it is
            // important to call this before the first Present in order to minimize the latency
            // of the swap chain
            deviceResources->WaitOnSwapChain();
            Render();
            deviceResources->Present();
        }
    });

    // Run task on a dedicated high priority background thread.
    renderLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
}

void StopRenderLoop ( )

Definition at line 67 of file LowLatencyInputMain.cpp.

{
    renderLoopWorker->Cancel();
}

void UpdateRectTransform | ( | Windows::Foundation::Point | newPosition,
 |  | Windows::UI::Input::ManipulationDelta | newDelta
 | ) |  |

Member Data Documentation

Concurrency::critical_section criticalSection [private]

Definition at line 48 of file LowLatencyInputMain.h.

std::shared_ptr<DX::DeviceResources> deviceResources [private]

Definition at line 43 of file LowLatencyInputMain.h.

Windows::Foundation::IAsyncAction renderLoopWorker [private]

Definition at line 47 of file LowLatencyInputMain.h.

std::unique_ptr<RectRenderer> sceneRenderer [private]

Definition at line 45 of file LowLatencyInputMain.h.

The documentation for this class was generated from the following files:
  • LowLatencyInput/cpp/LowLatencyInputMain.h
  • LowLatencyInput/cpp/LowLatencyInputMain.cpp
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MainPage
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
MainPage ()
void | AddCustomTitleBar ()
string | BuildClipboardFormatsOutputString ()
async Task< ClaimedLineDisplay > | ClaimScenarioLineDisplayAsync ()
Concurrency::task
< Windows::Devices::PointOfService::ClaimedLineDisplay^> 		ClaimScenarioLineDisplayAsync ()
Contact | CreateContactFromUserInput (TextBox EmailAddress, TextBox PhoneNumber)
bool | EnableClipboardContentChangedNotifications (bool enable)
void | EnsureMediaExtensionManager ()
async Task< SmartCard > | GetSmartCard ()
void | GoToScenario (int index)
void | HandleIoException (Platform::COMException^e, Platform::String^description)
void | HideStatus ()
void | HighlightRanges (TextBlock tb, String TextContent, IReadOnlyList< TextSegment > ranges)
async Task | LoadDataAccountsAsync (ComboBox comboBox)
void | LoadScenarioForProtocolActivation (ProtocolActivatedEventArgs protocolArgs)
void | NavigateToAutoPlay ()
void | NavigateToPageWithParameter (int pageIndex, object parameter)
void | NavigateToPageWithParameter (int pageIndex, object parameter)
void | NavigateToReconnect ()
void | NavigateToScenario (Type type)
void | NavigateToScenarioWithParameter (Scenario scenario, object parameter)
void | NotifyUser (string strMessage, NotifyType type, bool clearPrevious=false)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUser (string strMessage, NotifyType type)
void | NotifyUserFileNotExist ()
async void | NotifyUserFromBackground (string strMessage, NotifyType type)
async Task< Playlist > | PickPlaylistAsync ()
concurrency::task
< Windows::Media::Playlists::Playlist^> 		PickPlaylistAsync ()
void | ReleaseAllPrinters ()
void | ReleaseAllPrinters ()
void | ReleaseClaimedPrinter ()
void | ReleaseClaimedPrinter ()
void | RemoveCustomTitleBar ()
void | RemoveCustomTitleBar ()
void | ResetOutput (Image image, TextBlock output, TextBlock outputDetails=null)
void | SetExtendedSplashInfo (Rect splashRect, bool dismissStat)
void | SubscribeToReleaseDeviceRequested ()
void | SubscribeToReleaseDeviceRequested ()
Uri | TryGetUri (string uriString)
async Task< bool > | TrySavePlaylistAsync (Playlist playlist)
concurrency::task< bool > | TrySavePlaylistAsync (Windows::Media::Playlists::Playlist^playlist)
bool | ValidateTPMSmartCard ()

Static Public Member Functions

static void | ApplyLanguageFont (TextBlock textBlock, LanguageFont languageFont)
static concurrency::task< bool > | AreCertificateAndCertChainValidAsync (Windows::Security::Cryptography::Certificates::Certificate^serverCert, Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate^>^certChain)
static async Task< bool > | AreCertificateAndCertChainValidAsync (Certificate serverCert, IReadOnlyList< Certificate > certChain)
static string | BuildWebSocketError (Exception ex)
static Platform::String | BuildWebSocketError (Platform::Exception^ex)
static async void | CheckBackgroundAndRequestLocationAccess ()
static void | CleanUpMediaPlayerSource (Windows.Media.Playback.MediaPlayer mp)
static
Platform::Collections::Vector
< Windows::UI::Xaml::Controls::Maps::MapElement^> 		CreateCityBuildingsCollection ()
static List< MapElement > | CreateCityBuildingsCollection ()
static
Platform::Collections::Vector
< Windows::UI::Xaml::Controls::Maps::MapElement^> 		CreateCityParksCollection ()
static List< MapElement > | CreateCityParksCollection ()
static FileOpenPicker | CreateFilePicker (string[] extensions)
static void | DisplayResult (Windows::UI::Xaml::Controls::Image^image, Windows::UI::Xaml::Controls::TextBlock^textBlock, Platform::String^thumbnailModeName, size_t size, Windows::Storage::IStorageItem^item, Windows::Storage::FileProperties::StorageItemThumbnail^thumbnail, bool isGroup)
static void | DisplayResult (Image image, TextBlock textBlock, string thumbnailModeName, uint size, IStorageItem item, StorageItemThumbnail thumbnail, bool isGroup)
static ToastNotification | DisplayToast (string content)
static ToastNotification | DisplayToast (string message)
static void | FillItemsFromSavedJson (ItemsControl control, string key)
static AdaptiveContentModel | FindContentById (int id)
static
SimpleHapticsControllerFeedback 		FindSupportedFeedback (SimpleHapticsController hapticsController, ushort waveform)
static
Windows::Storage::Streams::IBuffer 		GetBufferFromString (Platform::String^string)
static string | GetContactResult (Contact contact)
static Point | GetElementLocation (object e)
static Windows::Foundation::Rect | GetElementRect (Windows::UI::Xaml::FrameworkElement^element)
static Rect | GetElementRect (FrameworkElement element)
static Rect | GetElementRect (object e)
static Rect | GetElementRect (Windows.UI.Xaml.FrameworkElement element)
static Platform::String | GetStringFromBuffer (Windows::Storage::Streams::IBuffer^buffer)
static async Task
< ObservableCollection
< UserViewModel > > 		GetUserViewModelsAsync ()
static void | HighlightFaces (WriteableBitmap displaySource, IList< DetectedFace > foundFaces, Canvas canvas, DataTemplate template)
static bool | InitializePasswordVaultInTheBackground ()
static async Task< string > | LoadStringFromPackageFileAsync (string name)
static IBackgroundTaskRegistration | LookupBackgroundTask (string name)
static string | LookupSavedString (string key, string defaultValue="")
static void | ReportSavedStatus ()
static void | RepositionFaces (WriteableBitmap displaySource, Canvas canvas)
static void | SetReadingText (TextBlock textBlock, AccelerometerReading reading)
static void | SetReadingText (TextBlock textBlock, OrientationSensorReading reading)

Public Attributes

internal | __pad0__: static property Platform::String^ FEATURE_NAME { Platform::String^ get() { return "Accelerometer C# Sample"
const int | ADMIN_KEY_LENGTH_IN_BYTES = 24
const string | APP_TITLE = "File Picker Contracts C# Sample"
const string | appbarTileId = "SecondaryTile.AppBar"
Windows::Devices::PointOfService::ClaimedPosPrinter | ClaimedPrinter = nullptr
Windows.Media.Playback.MediaPlayer | commonMediaPlayer = null
Windows::Devices::Enumeration::DeviceInformation | deviceInfo = nullptr
const string | dynamicTileId = "SecondaryTile.LiveTile"
const int | E_NO_UNICODE_TRANSLATION = unchecked((int)0x80070459)
string | falToken = null
const string | FEATURE_NAME = "3D Printing C# Sample"
const string | filename = "sample.dat"
string | index = "index"
bool | initialize = InitializePasswordVaultInTheBackground()
bool | IsAnImportantTransaction = true
Platform::String | launchParam
string | LineDisplayId = null
const string | logoSecondaryTileId = "SecondaryTile.Logo"
const string | MissingTitleError = "Enter a title for what you are sharing and try again."
string | mruToken = null
SecondaryViewsHelpers.ViewLifetimeControl ProjectionViewPageControl
string | SAMPLE_NAME = "x:Bind Sample in C#"
StorageFile | sampleFile = null
string | SelectedBleDeviceId
string | SelectedBleDeviceName = "No device selected"
std::function< void(void)> | StateChanged
ObservableCollection
< RemoteSystem > 		systemList = null
Dictionary< string, RemoteSystem > | systemMap = null

Static Public Attributes

static readonly string[] | audioExtensions = new string[] { ".wma", ".mp3", ".mp2", ".aac", ".adt", ".adts", ".m4a" }
static IReadOnlyList
< AdaptiveContentModel > 		ContentManagementSystemStub = AdaptiveContentModel.GetKnownAzureMediaServicesModels()
static MainPage | Current = nullptr
static
Windows::Media::MediaExtensionManager 		mediaExtensionManager
static readonly string[] | playlistExtensions = new string[] { ".m3u", ".wpl", ".zpl" }
static string | SampleMovieURL = "http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)"
static readonly Geopoint | SeattleGeopoint = new Geopoint(new BasicGeoposition() { Latitude = 47.604, Longitude = -122.329 })
static List< ViewSizePreference > | ViewSizePreferences

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

Windows::Devices::Sensors::AccelerometerReadingType | accelerometerReadingType = Windows::Devices::Sensors::AccelerometerReadingType::Standard
AccelerometerReadingType | AccelerometerReadingType [get, set]
Windows.Storage.Streams.IBuffer | AdminKey [get, set]
bool | areControlsInTitleBar = false
bool | AreControlsInTitleBar [get, set]
Uri | CaptionedMediaUri [get]
CustomTitleBar | customTitleBar = nullptr
ItemList | DefaultViewModel [get]
DeviceActivatedEventArgs | DeviceEvent [get, set]
PhotoImportOperation | ImportOperation [get, set]
bool | IsClipboardContentChangedEnabled [get, set]
Windows.ApplicationModel.Activation.LaunchActivatedEventArgs | LaunchArgs [get]
string | LaunchParam [get, set]
Uri | MultiTrackVideoMediaUri [get]
NavigationHelper | NavigationHelper [get]
BitmapImage | PlaceHolderImage [get]
List< Scenario > | Scenarios [get]
string | SensorDescription = SensorOptimizationGoal.Precision [get]
Windows::Devices::Sensors::SensorOptimizationGoal | sensorOptimizationGoal
SensorOptimizationGoal | SensorOptimizationGoal = SensorReadingType.Absolute [get, set]
Windows::Devices::Sensors::SensorReadingType | sensorReadingType
SensorReadingType | SensorReadingType [get, set]
Uri | SintelMediaUri [get]
String | SmartCardReaderDeviceId [get, set]
Uri | UncaptionedMediaUri [get]
static IReadOnlyDictionary
< string, ushort > 		WaveformNamesMap [get]

Events

internal Action | StateChanged

Private Member Functions

void | AddItem ()
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | ClaimedPrinter_ReleaseDeviceRequested (Windows::Devices::PointOfService::ClaimedPosPrinter^sender, Windows::Devices::PointOfService::PosPrinterReleaseDeviceRequestedEventArgs^args)
async void | ClaimedPrinter_ReleaseDeviceRequested (ClaimedPosPrinter sender, PosPrinterReleaseDeviceRequestedEventArgs args)
void | DisplayChangedFormats ()
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
Windows::UI::Xaml::Media::Imaging::BitmapImage | GetPlaceHolderImage ()
partial void | GetScenarioIdForLaunch (string launchParam, ref int index)
void | HandleClipboardChanged ()
void | ListView_ItemClick (object sender, ItemClickEventArgs e)
void | NavigateToScenario (Type scenario, object param=null)
void | NavigationHelper_Load (object sender, LoadStateEventArgs e)
void | NavigationHelper_Save (object sender, SaveStateEventArgs e)
internal void | NotifyUserFileNotExist ()
void | OnClipboardChanged (Object sender, Object e)
void | OnSignInInfoChanged ()
void | OnWindowActivated (object sender, WindowActivatedEventArgs e)
void | ResetItems ()
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ScenarioControl_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | SignInWithHello ()
async Task< bool > | SignInWithHelloAsync ()
async void | SignInWithPassword ()
async void | Unregister ()
void | UpdateUI ()
internal async void | ValidateFile ()
internal bool | ValidateSystemDiscovery ()

Static Private Member Functions

static void | ApplyScale (FrameworkElement box, double widthScale, double heightScale)
static internal IBuffer | GetBufferFromString (string str)
static internal string | GetStringFromBuffer (IBuffer buffer)
static bool | InitializePasswordVaultInTheBackground ()
static concurrency::task< bool > | IsCertificateValidAsync (Windows::Security::Cryptography::Certificates::Certificate^serverCert)
static async Task< bool > | IsCertificateValidAsync (Certificate serverCert)

Private Attributes

DeviceActivatedEventArgs | _deviceEventArgs = null
PhotoImportOperation | _importOperation = null
Windows::UI::Xaml::Media::Imaging::BitmapImage | _placeholder
BitmapImage | _placeholder
Windows::Storage::Streams::IBuffer | adminkey
internal ClaimedPosPrinter | ClaimedPrinter = null
ItemList defaultViewModel
Platform::String | deviceId
internal DeviceInformation | deviceInfo = null
internal bool | Dismissed
internal bool | IsAnImportantTransaction = true
bool | isApplicationWindowActive = true
string | launchParam
readonly NavigationHelper | navigationHelper
bool | needToPrintClipboardFormat = false
internal PosPrinter | Printer = null
string | publicKeyHint
Windows::Foundation::EventRegistrationToken | releaseDeviceRequestedToken
Windows::Storage::StorageFile | sampleFile
List< Scenario > scenarios
internal Rect | SplashImageRect
string | userId

Static Private Attributes

static Platform::Array
< Platform::String^> 		audioExtensionsInner
static
Windows.Media.MediaExtensionManager 		mediaExtensionMgr
static Platform::Array
< Platform::String^> 		playlistExtensionsInner
static Platform::Array< Scenario > | scenariosInner

Detailed Description

Main Page Class Object.

Definition at line 18 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 32 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;

            // Caching your main page is good practice, this makes it snappy for the user to return to "home" of your app.
            this.NavigationCacheMode = NavigationCacheMode.Required;
        }

MainPage ( ) [inline]

Definition at line 23 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            this.navigationHelper = new NavigationHelper(this);
            this.defaultViewModel = new ItemList();

            this.navigationHelper.LoadState += this.NavigationHelper_Load;
            this.navigationHelper.SaveState += this.NavigationHelper_Save;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 57 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 36 of file MainPage.xaml.cs.

        {
            InitializeComponent();
        }

MainPage ( ) [inline]

Definition at line 40 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 28 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 43 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();
            SampleTitle.Text = FEATURE_NAME;

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

MainPage ( ) [inline]

Definition at line 31 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current = this;
            SampleTitle.Text = FEATURE_NAME;
        }

Member Function Documentation

void AddCustomTitleBar ( ) [inline]

Definition at line 35 of file SampleConfiguration.cs.

        {
            if (customTitleBar == null)
            {
                customTitleBar = new CustomTitleBar();
                customTitleBar.EnableControlsInTitleBar(areControlsInTitleBar);

                // Make the main page's content a child of the title bar,
                // and make the title bar the new page content.
                UIElement mainContent = this.Content;
                this.Content = null;
                customTitleBar.SetPageContent(mainContent);
                this.Content = customTitleBar;
            }
        }

void AddItem ( ) [inline, private]

summary> Resets the item list to the default.

/summary>

Definition at line 66 of file MainPage.xaml.cs.

static void ApplyLanguageFont | ( | TextBlock | textBlock,
 |  | LanguageFont | languageFont |
 | ) |  |  | [inline, static]

Definition at line 30 of file SampleConfiguration.cs.

        {
            FontFamily fontFamily = new FontFamily(languageFont.FontFamily);
            textBlock.FontFamily = fontFamily;
            textBlock.FontWeight = languageFont.FontWeight;
            textBlock.FontStyle = languageFont.FontStyle;
            textBlock.FontStretch = languageFont.FontStretch;
        }

static void ApplyScale | ( | FrameworkElement | box,
 |  | double | widthScale,
 |  | double | heightScale |
 | ) |  |  | [inline, static, private]

Rescale the size and position of the face highlight box to account for the difference between the size of the image and the canvas.

Parameters:
box | The element to rescale
widthScale | Horizontal adjustment factor
heightScale | Vertical adjustment factor

Definition at line 40 of file SampleConfiguration.cs.

        {
            // We saved the original size of the face box in the element's Tag field.
            BitmapBounds faceBox = (BitmapBounds)box.Tag;
            box.Width = faceBox.Width * widthScale;
            box.Height = faceBox.Height * heightScale;
            box.Margin = new Thickness(faceBox.X * widthScale, faceBox.Y * heightScale, 0, 0);
        }

static concurrency::task<bool> AreCertificateAndCertChainValidAsync | ( | Windows::Security::Cryptography::Certificates::Certificate^ | serverCert,
 |  | Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate^>^ | certChain |
 | ) |  |  | [static]
static async Task<bool> AreCertificateAndCertChainValidAsync | ( | Certificate | serverCert,
 |  | IReadOnlyList< Certificate > | certChain |
 | ) |  |  | [inline, static]

Definition at line 93 of file SampleConfiguration.cs.

        {
            foreach (Certificate cert in certChain)
            {
                if (!await IsCertificateValidAsync(cert))
                {
                    return false;
                }
            }
            return await IsCertificateValidAsync(serverCert);
        }

string BuildClipboardFormatsOutputString ( ) [inline]

Definition at line 90 of file SampleConfiguration.cs.

        {
            DataPackageView clipboardContent = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
            StringBuilder output = new StringBuilder();

            if (clipboardContent != null && clipboardContent.AvailableFormats.Count > 0)
            {
                output.Append("Available formats in the clipboard:");
                foreach (var format in clipboardContent.AvailableFormats)
                {
                    output.Append(Environment.NewLine + " * " + format);
                }
            }
            else
            {
                output.Append("The clipboard is empty");
            }
            return output.ToString();
        }

static Platform::String BuildWebSocketError ( Platform::Exception^ ex ) [static]
static string BuildWebSocketError ( Exception ex ) [inline, static]

Definition at line 61 of file SampleConfiguration.cs.

        {
            ex = ex.GetBaseException();

            if ((uint)ex.HResult == 0x800C000EU)
            {
                // INET_E_SECURITY_PROBLEM - our custom certificate validator rejected the request.
                return "Error: Rejected by custom certificate validation.";
            }

            WebErrorStatus status = WebSocketError.GetStatus(ex.HResult);

            // Normally we'd use the HResult and status to test for specific conditions we want to handle.
            // In this sample, we'll just output them for demonstration purposes.
            switch (status)
            {
                case WebErrorStatus.CannotConnect:
                case WebErrorStatus.NotFound:
                case WebErrorStatus.RequestTimeout:
                    return "Cannot connect to the server. Please make sure " +
                        "to run the server setup script before running the sample.";

                case WebErrorStatus.Unknown:
                    return "COM error: " + ex.HResult;

                default:
                    return "Error: " + status;
            }
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 137 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 115 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = !Splitter.IsPaneOpen;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = !Splitter.IsPaneOpen;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = !Splitter.IsPaneOpen;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 85 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 85 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file MainPage.xaml.cs.

        {
            //Splitter.DisplayMode = (Splitter.DisplayMode == SplitViewDisplayMode.Inline) ? SplitViewDisplayMode.CompactInline : SplitViewDisplayMode.Inline;
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 161 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 135 of file MainPage.xaml.cs.

        {
            Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
            StatusBorder.Visibility = Visibility.Collapsed;
        }

static async void CheckBackgroundAndRequestLocationAccess ( ) [inline, static]

Check and report whether the user has granted background execution access.

If so, then also request location access so that the background task can do its work.

Definition at line 83 of file SampleConfiguration.cs.

        {
            // Get permission for a background task from the user. If the user has already answered once,
            // this does nothing and the user must manually update their preference via Settings.
            BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();

            MainPage rootPage = MainPage.Current;

            switch (backgroundAccessStatus)
            {
                case BackgroundAccessStatus.AlwaysAllowed:
                case BackgroundAccessStatus.AllowedSubjectToSystemPolicy:
                    // BackgroundTask is allowed
                    rootPage.NotifyUser("Background task registered.", NotifyType.StatusMessage);

                    // Need to request access to location.
                    // This must be done when we create the background task registration
                    // because the background task cannot display UI.
                    // If the user has already answered once,
                    // this does nothing and the user must manually update their preference via Settings.
                    switch (await Geolocator.RequestAccessAsync())
                    {
                        case GeolocationAccessStatus.Allowed:
                            break;

                        case GeolocationAccessStatus.Denied:
                            rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                            break;

                        case GeolocationAccessStatus.Unspecified:
                            rootPage.NotifyUser("Unspecified error!", NotifyType.ErrorMessage);
                            break;
                    }
                    break;

                default:
                    rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                    break;
            }
        }

void ClaimedPrinter_ReleaseDeviceRequested | ( | Windows::Devices::PointOfService::ClaimedPosPrinter^ | sender,
 |  | Windows::Devices::PointOfService::PosPrinterReleaseDeviceRequestedEventArgs^ | args |
 | ) |  |  | [private]
async void ClaimedPrinter_ReleaseDeviceRequested | ( | ClaimedPosPrinter | sender,
 |  | PosPrinterReleaseDeviceRequestedEventArgs | args |
 | ) |  |  | [inline, private]

If the "Retain device" checkbox is checked, we retain the device.

Otherwise, we allow the other claimant to claim the device.

Definition at line 71 of file SampleConfiguration.cs.

        {
            if (IsAnImportantTransaction)
            {
                await sender.RetainDeviceAsync();
            }
            else
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    NotifyUser("Lost printer claim.", NotifyType.ErrorMessage);
                    ReleaseClaimedPrinter();
                });
            }
        }

Concurrency::task< ClaimedLineDisplay^> ClaimScenarioLineDisplayAsync ( )

Definition at line 35 of file SampleConfiguration.cpp.

{
    ClaimedLineDisplay^ lineDisplay;
    if (LineDisplayId->IsEmpty())
    {
        NotifyUser("You must use scenario 1 to select a line display", NotifyType::ErrorMessage);
    }
    else
    {
        lineDisplay = co_await ClaimedLineDisplay::FromIdAsync(LineDisplayId);
        if (lineDisplay == nullptr)
        {
            NotifyUser("Unable to claim selected LineDisplay from id.", NotifyType::ErrorMessage);
        }
    }
    return lineDisplay;
}

async Task<ClaimedLineDisplay> ClaimScenarioLineDisplayAsync ( ) [inline]

Definition at line 40 of file SampleConfiguration.cs.

        {
            ClaimedLineDisplay lineDisplay = null;
            if (String.IsNullOrEmpty(LineDisplayId))
            {
                NotifyUser("You must use scenario 1 to select a line display", NotifyType.ErrorMessage);
            }
            else
            {
                lineDisplay = await ClaimedLineDisplay.FromIdAsync(LineDisplayId);
                if (lineDisplay == null)
                {
                    NotifyUser("Unable to claim selected LineDisplay from id.", NotifyType.ErrorMessage);
                }
            }
            return lineDisplay;
        }

static void CleanUpMediaPlayerSource ( Windows.Media.Playback.MediaPlayer mp ) [inline, static]

Definition at line 29 of file SampleConfiguration.cs.

        {
            if (mp?.Source != null)
            {
                var source = mp.Source as Windows.Media.Core.MediaSource;
                source?.Dispose();

                var item = mp.Source as Windows.Media.Playback.MediaPlaybackItem;
                item?.Source?.Dispose();

                mp.Source = null;
            };
        }

static List<MapElement> CreateCityBuildingsCollection ( ) [inline, static]

Definition at line 42 of file SampleConfiguration.cs.

        {
            return new List<MapElement>
            {
                new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.603830, Longitude = -122.329900 }), Title = "Seattle City Hall" },
                new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.606709, Longitude = -122.332672 }), Title = "Seattle Public Library" },
                new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.604100, Longitude = -122.329204 }), Title = "Municipal Court of Seattle" },
            };
        }

Vector< MapElement^> CreateCityBuildingsCollection ( ) [static]

Definition at line 39 of file SampleConfiguration.cpp.

{
    auto icon1 = ref new MapIcon();
    icon1->Location = ref new Geopoint({ 47.603830, -122.329900 });
    icon1->Title = "Seattle City Hall";

    auto icon2 = ref new MapIcon();
    icon2->Location = ref new Geopoint({ 47.606709, -122.332672 });
    icon2->Title = "Seattle Public Library";

    auto icon3 = ref new MapIcon();
    icon3->Location = ref new Geopoint({ 47.604100, -122.329204 });
    icon3->Title = "Municipal Court of Seattle";

    return ref new Vector<MapElement^>({ icon1, icon2, icon3 });
}

Vector< MapElement^> CreateCityParksCollection ( ) [static]

Definition at line 56 of file SampleConfiguration.cpp.

{
    auto icon1 = ref new MapIcon();
    icon1->Location = ref new Geopoint({ 47.608313, -122.331218 });
    icon1->Title = "Freeway Park";

    auto icon2 = ref new MapIcon();
    icon2->Location = ref new Geopoint({ 47.602029, -122.333971 });
    icon2->Title = "Pioneer Square";

    auto icon3 = ref new MapIcon();
    icon3->Location = ref new Geopoint({ 47.601990, -122.330681 });
    icon3->Title = "City Hall Park";

    auto icon4 = ref new MapIcon();
    icon4->Location = ref new Geopoint({ 47.600619, -122.324957 });
    icon4->Title = "Kobe Terrace Park";

    return ref new Vector<MapElement^>({ icon1, icon2, icon3, icon4 });
}

static List<MapElement> CreateCityParksCollection ( ) [inline, static]

Definition at line 52 of file SampleConfiguration.cs.

        {
            return new List<MapElement>
            {
                    new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.608313, Longitude = -122.331218 }), Title = "Freeway Park" },
                    new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.602029, Longitude = -122.333971 }), Title = "Pioneer Square" },
                    new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.601990, Longitude = -122.330681 }), Title = "City Hall Park" },
                    new MapIcon { Location = new Geopoint(new BasicGeoposition { Latitude = 47.600619, Longitude = -122.324957 }), Title = "Kobe Terrace Park" },
            };
        }

Contact CreateContactFromUserInput | ( | TextBox | EmailAddress,
 |  | TextBox | PhoneNumber |
 | ) |  |  | [inline]

Definition at line 32 of file SampleConfiguration.cs.

        {
            if (EmailAddress.Text.Length == 0 && PhoneNumber.Text.Length == 0)
            {
                NotifyUser("You must enter an email address and/or phone number.", NotifyType.ErrorMessage);
                return null;
            }

            Contact contact = new Contact();

            // Maximum length for email address is 321, enforced by XAML markup.
            if (EmailAddress.Text.Length > 0)
            {
                ContactEmail email = new ContactEmail() { Address = EmailAddress.Text };
                contact.Emails.Add(email);
            }

            // Maximum length for phone number is 50, enforced by XAML markup.
            if (PhoneNumber.Text.Length > 0)
            {
                ContactPhone phone = new ContactPhone() { Number = PhoneNumber.Text };
                contact.Phones.Add(phone);
            }

            return contact;
        }

static FileOpenPicker CreateFilePicker ( string[] extensions ) [inline, static]

Creates a FileOpenPicker for the specified extensions.

Parameters:
extensions File extensions to pick.
Returns:
FileOpenPicker instance.

Definition at line 50 of file SampleConfiguration.cs.

        {
            FileOpenPicker picker = new FileOpenPicker();
            picker.SuggestedStartLocation = PickerLocationId.MusicLibrary;

            foreach (string extension in extensions)
            {
                picker.FileTypeFilter.Add(extension);
            }

            return picker;
        }

void DisplayChangedFormats ( ) [inline, private]

Definition at line 110 of file SampleConfiguration.cs.

        {
            string output = "Clipboard content has changed!" + Environment.NewLine;
            output += BuildClipboardFormatsOutputString();
            NotifyUser(output, NotifyType.StatusMessage);
        }

static void DisplayResult | ( | Windows::UI::Xaml::Controls::Image^ | image,
 |  | Windows::UI::Xaml::Controls::TextBlock^ | textBlock,
 |  | Platform::String^ | thumbnailModeName,
 |  | size_t | size,
 |  | Windows::Storage::IStorageItem^ | item,
 |  | Windows::Storage::FileProperties::StorageItemThumbnail^ | thumbnail,
 |  | bool | isGroup |
 | ) |  |  | [static]
static void DisplayResult | ( | Image | image,
 |  | TextBlock | textBlock,
 |  | string | thumbnailModeName,
 |  | uint | size,
 |  | IStorageItem | item,
 |  | StorageItemThumbnail | thumbnail,
 |  | bool | isGroup |
 | ) |  |  | [inline, static]

Definition at line 69 of file SampleConfiguration.cs.

        {
            // ErrorMessage.Visibility = Visibility.Collapsed;
            BitmapImage bitmapImage = new BitmapImage();

            bitmapImage.SetSource(thumbnail);
            image.Source = bitmapImage;

            textBlock.Text = String.Format("ThumbnailMode.{0}\n"
                                           + "{1} used: {2}\n"
                                           + "Requested size: {3}\n"
                                           + "Returned size: {4}x{5}",
                                           thumbnailModeName,
                                           isGroup ? "Group" : item.IsOfType(StorageItemTypes.File) ? "File" : "Folder",
                                           item.Name,
                                           size,
                                           thumbnail.OriginalWidth,
                                           thumbnail.OriginalHeight);
        }

static ToastNotification DisplayToast ( string content ) [inline, static]

Definition at line 34 of file SampleConfiguration.cs.

        {
            string xml = $@"<toast activationType='foreground'>
                                            <visual>
                                                <binding template='ToastGeneric'>
                                                    <text>Extended Execution</text>
                                                </binding>
                                            </visual>
                                        </toast>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            var binding = doc.SelectSingleNode("//binding");

            var el = doc.CreateElement("text");
            el.InnerText = content;
            binding.AppendChild(el); //Add content to notification

            var toast = new ToastNotification(doc);

            ToastNotificationManager.CreateToastNotifier().Show(toast); //Show the toast

            return toast;
        }

static ToastNotification DisplayToast ( string message ) [inline, static]

Definition at line 41 of file SampleConfiguration.cs.

        {
            string xml = @"<toast activationType='foreground'>
                                <visual>
                                    <binding template='ToastGeneric'/>
                                </visual>
                            </toast>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            var binding = doc.SelectSingleNode("//binding");

            var el = doc.CreateElement("text");
            el.InnerText = FEATURE_NAME;
            binding.AppendChild(el);

            el = doc.CreateElement("text");
            el.InnerText = message;
            binding.AppendChild(el);

            var toast = new ToastNotification(doc);

            ToastNotificationManager.CreateToastNotifier().Show(toast); //Show the toast

            return toast;
        }

bool EnableClipboardContentChangedNotifications ( bool enable ) [inline]

Definition at line 69 of file SampleConfiguration.cs.

        {
            if (IsClipboardContentChangedEnabled == enable)
            {
                return false;
            }

            IsClipboardContentChangedEnabled = enable;
            if (enable)
            {
                Clipboard.ContentChanged += OnClipboardChanged;
                Window.Current.Activated += OnWindowActivated;
            }
            else
            {
                Clipboard.ContentChanged -= OnClipboardChanged;
                Window.Current.Activated -= OnWindowActivated;
            }
            return true;
        }

void EnsureMediaExtensionManager ( ) [inline]

Definition at line 30 of file SampleConfiguration.cs.

        {
            if (mediaExtensionMgr == null)
            {
                mediaExtensionMgr = new Windows.Media.MediaExtensionManager();
                mediaExtensionMgr.RegisterSchemeHandler("Microsoft.Samples.SimpleCommunication.StspSchemeHandler", "stsp:");
            }
        }

static void FillItemsFromSavedJson | ( | ItemsControl | control,
 |  | string | key |
 | ) |  |  | [inline, static]

Look up a JSON string in the saved LocalSettings and fill the ItemsControl with the strings in it.

Parameters:
control
key

Definition at line 144 of file SampleConfiguration.cs.

        {
            string json = LookupSavedString(key);
            if (!string.IsNullOrEmpty(json))
            {
                // remove all entries and repopulate
                var items = control.Items;
                items.Clear();

                foreach (IJsonValue element in JsonValue.Parse(json).GetArray())
                {
                    items.Add(element.GetString());
                }
            }
        }

static AdaptiveContentModel FindContentById ( int id ) [inline, static]

Definition at line 38 of file SampleConfiguration.cs.

        {
            return ContentManagementSystemStub.First(model => model.Id == id);
        }

static SimpleHapticsControllerFeedback FindSupportedFeedback | ( | SimpleHapticsController | hapticsController,
 |  | ushort | waveform |
 | ) |  |  | [inline, static]

Definition at line 54 of file SampleConfiguration.cs.

        {
            foreach (SimpleHapticsControllerFeedback feedback in hapticsController.SupportedFeedback)
            {
                if (feedback.Waveform == waveform)
                {
                    return feedback;
                }
            }
            return null;
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 132 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 156 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 124 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 103 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 130 of file MainPage.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

static Windows::Storage::Streams::IBuffer GetBufferFromString ( Platform::String^ string ) [static]
static internal IBuffer GetBufferFromString ( string str ) [inline, static, private]

Definition at line 66 of file SampleConfiguration.cs.

        {
            if (String.IsNullOrEmpty(str))
            {
                return new Windows.Storage.Streams.Buffer(0);
            }
            else
            {
                return CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8);
            }
        }

static string GetContactResult ( Contact contact ) [inline, static]

Definition at line 30 of file SampleConfiguration.cs.

        {
            var result = new StringBuilder();
            result.AppendFormat("Display name: {0}", contact.DisplayName);
            result.AppendLine();

            foreach (ContactEmail email in contact.Emails)
            {
                result.AppendFormat("Email address ({0}): {1}", email.Kind, email.Address);
                result.AppendLine();
            }

            foreach (ContactPhone phone in contact.Phones)
            {
                result.AppendFormat("Phone ({0}): {1}", phone.Kind, phone.Number);
                result.AppendLine();
            }

            return result.ToString();
        }

static Point GetElementLocation ( object e ) [inline, static]

Definition at line 50 of file SampleConfiguration.cs.

        {
            var element = (FrameworkElement)e;
            Windows.UI.Xaml.Media.GeneralTransform buttonTransform = element.TransformToVisual(null);

            Point desiredLocation = buttonTransform.TransformPoint(new Point());
            desiredLocation.Y = desiredLocation.Y + element.ActualHeight;

            return desiredLocation;
        }

static Rect GetElementRect ( object e ) [inline, static]

Definition at line 56 of file SampleConfiguration.cs.

        {
            var element = (FrameworkElement)e;
            GeneralTransform buttonTransform = element.TransformToVisual(null);
            return buttonTransform.TransformBounds(new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }

static Windows::Foundation::Rect GetElementRect ( Windows::UI::Xaml::FrameworkElement^ element ) [static]
static Rect GetElementRect ( Windows.UI.Xaml.FrameworkElement element ) [inline, static]

Definition at line 34 of file SampleConfiguration.cs.

        {
            Windows.UI.Xaml.Media.GeneralTransform transform = element.TransformToVisual(null);
            Point point = transform.TransformPoint(new Point());
            return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
        }

static Rect GetElementRect ( FrameworkElement element ) [inline, static]

Definition at line 59 of file SampleConfiguration.cs.

        {
            Windows.UI.Xaml.Media.GeneralTransform buttonTransform = element.TransformToVisual(null);
            Point point = buttonTransform.TransformPoint(new Point());
            return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
        }

BitmapImage GetPlaceHolderImage ( ) [private]

Definition at line 67 of file SampleConfiguration.cpp.

{
    if (_placeholder == nullptr)
    {
        _placeholder = ref new BitmapImage(ref new Uri(BaseUri->AbsoluteUri, "Assets/placeholder-sdk.png"));
    }

    return _placeholder;
}

partial void GetScenarioIdForLaunch | ( | string | launchParam,
 |  | ref int | index |
 | ) |  |  | [private]
task< Windows::Devices::SmartCards::SmartCard^> GetSmartCard ( ) [inline]

Definition at line 42 of file SampleConfiguration.cs.

        {
            SmartCardReader reader = await SmartCardReader.FromIdAsync(SmartCardReaderDeviceId);
            IReadOnlyList<SmartCard> cards = await reader.FindAllCardsAsync();

            if (1 != cards.Count)
            {
                throw new InvalidOperationException("Reader has an unexpected number of cards (" + cards.Count + ")");
            }

            return cards[0];
        }

static internal string GetStringFromBuffer ( IBuffer buffer ) [inline, static, private]

Definition at line 78 of file SampleConfiguration.cs.

        {
            // Throws E_NO_UNICODE_TRANSLATION if the buffer is not properly encoded.
            return CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, buffer);
        }

static Platform::String GetStringFromBuffer ( Windows::Storage::Streams::IBuffer^ buffer ) [static]
static async Task<ObservableCollection<UserViewModel> > GetUserViewModelsAsync ( ) [inline, static]

Definition at line 33 of file SampleConfiguration.cs.

        {
            // Populate the list of users.
            IReadOnlyList<User> users = await User.FindAllAsync();
            var observableUsers = new ObservableCollection<UserViewModel>();
            int userNumber = 1;
            foreach (User user in users)
            {
                string displayName = (string)await user.GetPropertyAsync(KnownUserProperties.DisplayName);

                // Choose a generic name if we do not have access to the actual name.
                if (String.IsNullOrEmpty(displayName))
                {
                    displayName = "User #" + userNumber.ToString();
                    userNumber++;
                }
                observableUsers.Add(new UserViewModel(user.NonRoamableId, displayName));
            }
            return observableUsers;
        }

void GoToScenario ( int index ) [inline]

Definition at line 33 of file SampleConfiguration.cs.

        {
            if (index >= scenarios.Count)
            {
                throw new IndexOutOfRangeException();
            }

            ScenarioControl.SelectedIndex = index;
        }

void HandleClipboardChanged ( ) [inline, private]

Definition at line 117 of file SampleConfiguration.cs.

        {
            if (this.isApplicationWindowActive)
            {
                DisplayChangedFormats();
            }
            else
            {
                // Background applications can't access clipboard
                // Deferring processing of update notification until the application returns to foreground
                this.needToPrintClipboardFormat = true;
            }
        }

void HandleIoException | ( | Platform::COMException^ | e,
 |  | Platform::String^ | description
 | ) |  |

Definition at line 52 of file SampleConfiguration.cpp.

{
    if (e->HResult == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
    {
        NotifyUserFileNotExist();
    }
    else if (e->HResult == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
    {
        NotifyUser("File is not UTF-8 encoded.", NotifyType::ErrorMessage);
    }
    else
    {
        NotifyUser(description + ": " + e->Message, NotifyType::ErrorMessage);
    }
}

void HideStatus ( ) [inline]

Definition at line 105 of file MainPage.xaml.cs.

        {
            this.StatusPanel.Visibility = Visibility.Collapsed;
        }

static void HighlightFaces | ( | WriteableBitmap | displaySource,
 |  | IList< DetectedFace > | foundFaces,
 |  | Canvas | canvas,
 |  | DataTemplate | template |
 | ) |  |  | [inline, static]

Definition at line 49 of file SampleConfiguration.cs.

        {
            double widthScale = canvas.ActualWidth / displaySource.PixelWidth;
            double heightScale = canvas.ActualHeight / displaySource.PixelHeight;

            foreach (DetectedFace face in foundFaces)
            {
                // Create an  element for displaying the face box but since we're using a Canvas
                // we must scale it according to the image's actual size.
                // The original FaceBox values are saved in the element's Tag field so we can update the
                // boxes when the Canvas is resized.
                var box = (FrameworkElement)template.LoadContent();
                box.Tag = face.FaceBox;
                ApplyScale(box, widthScale, heightScale);

                canvas.Children.Add(box);
            }

            string message;
            if (foundFaces.Count == 0)
            {
                message = "Didn't find any human faces in the image";
            }
            else if (foundFaces.Count == 1)
            {
                message = "Found a human face in the image";
            }
            else
            {
                message = "Found " + foundFaces.Count + " human faces in the image";
            }

            MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
        }

void HighlightRanges | ( | TextBlock | tb,
 |  | String | TextContent,
 |  | IReadOnlyList< TextSegment > | ranges |
 | ) |  |  | [inline]

Definition at line 32 of file SampleConfiguration.cs.

        {
            int currentPosition = 0;
            foreach (var range in ranges)
            {
                // Add the next chunk of non-range text
                if (range.StartPosition > currentPosition)
                {
                    int length = (int)range.StartPosition - currentPosition;
                    var subString = TextContent.Substring(currentPosition, length);
                    tb.Inlines.Add(new Run() { Text = subString });
                    currentPosition += length;
                }
                // Add the next range
                var boldString = TextContent.Substring((int)range.StartPosition, (int)range.Length);
                tb.Inlines.Add(new Run() { Text = boldString, FontWeight = FontWeights.Bold });
                currentPosition += (int)range.Length;
            }
            // Add the text after the last matching segment
            if (currentPosition < TextContent.Length)
            {
                var subString = TextContent.Substring(currentPosition);
                tb.Inlines.Add(new Run() { Text = subString });
            }
            tb.Inlines.Add(new Run() { Text = "\r\n" });
        }

bool InitializePasswordVaultInTheBackground ( ) [static]

Definition at line 15 of file SampleConfiguration.cpp.

{
    concurrency::create_async([]()
    {
        // any call to the password vault will load the vault.
        auto vault = ref new Windows::Security::Credentials::PasswordVault();
        vault->RetrieveAll();
    });
    return true;

}

static bool InitializePasswordVaultInTheBackground ( ) [inline, static, private]

Definition at line 33 of file SampleConfiguration.cs.

        {
            // Explicitly place this task on a background thread.
            Task.Factory.StartNew(() =>
            {
                // any call to the password vault will load the vault.
                var vault = new PasswordVault();
                vault.RetrieveAll();
            });
            return true;
        }

static concurrency::task<bool> IsCertificateValidAsync ( Windows::Security::Cryptography::Certificates::Certificate^ serverCert ) [static, private]
static async Task<bool> IsCertificateValidAsync ( Certificate serverCert ) [inline, static, private]

Definition at line 105 of file SampleConfiguration.cs.

        {
            // This is a placeholder call to simulate long-running async calls. Note that this code runs synchronously as part
            // of the SSL/TLS handshake. Avoid performing lengthy operations here - else, the remote server may terminate the
            // connection abruptly.
            await Task.Delay(100);

            // In this sample, we check the issuer of the certificate - this is purely for illustration
            // purposes and should not be considered as a recommendation for certificate validation.
            return serverCert.Issuer == "www.fabrikam.com";
        }

void ListView_ItemClick | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

summary> Adds an item to the list when the app bar button is clicked /summary>

Definition at line 58 of file MainPage.xaml.cs.

async Task LoadDataAccountsAsync ( ComboBox comboBox ) [inline]

Definition at line 33 of file SampleConfiguration.cs.

        {
            // Requires the email, contacts, or appointments capability in the app's manifest.
            UserDataAccountStore store = await UserDataAccountManager.RequestStoreAsync(UserDataAccountStoreAccessType.AllAccountsReadOnly);

            if (store != null)
            {
                IReadOnlyList<UserDataAccount> userDataAccounts = await store.FindAccountsAsync();
                comboBox.DataContext = new ObservableCollection<UserDataAccount>(userDataAccounts);

                if (userDataAccounts.Count > 0)
                {
                    comboBox.SelectedIndex = 0;
                }
            }
            else
            {
                // If the store is null, that means all access to Contacts, Calendar and Email data
                // has been revoked.
                NotifyUser("Access to Contacts, Calendar and Email has been revoked", NotifyType.ErrorMessage);
            }
        }

void LoadScenarioForProtocolActivation ( ProtocolActivatedEventArgs protocolArgs ) [inline]

Selects the scenario corresponding with the Uri used to activate this app via a protocol.

If there is no corresponding scenario then there is no effect.

Parameters:
protocolArgs Container for the protocol activation information which includes the Uri that activated this app

Definition at line 71 of file SampleConfiguration.cs.

        {
            foreach (Scenario scenario in scenarios)
            {
                if (protocolArgs.Uri.Equals(SharePage.GetApplicationLink(scenario.ClassType.Name)))
                {
                    // By setting the selected index, the Scenarios_SelectionChanged(...) method will be called
                    ScenarioControl.SelectedIndex = scenarios.IndexOf(scenario);
                    break;
                }
            }
        }

static async Task<string> LoadStringFromPackageFileAsync ( string name ) [inline, static]

Definition at line 38 of file SampleConfiguration.cs.

        {
            // Using the storage classes to read the content from a file as a string.
            StorageFile f = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///html/{name}"));
            return await FileIO.ReadTextAsync(f);
        }

static IBackgroundTaskRegistration LookupBackgroundTask ( string name ) [inline, static]

Look up a background task by name.

If found, then also report whether the user has granted background execution access.

Definition at line 41 of file SampleConfiguration.cs.

        {
            IBackgroundTaskRegistration found = null;

            // Loop through all background tasks to find one with the matching name
            foreach (var entry in BackgroundTaskRegistration.AllTasks)
            {
                var task = entry.Value;
                if (task.Name == name)
                {
                    found = task;
                    break;
                }
            }

            if (found != null)
            {
                // Check whether the user has already granted background execution access.
                BackgroundAccessStatus backgroundAccessStatus = BackgroundExecutionManager.GetAccessStatus();

                MainPage rootPage = MainPage.Current;
                switch (backgroundAccessStatus)
                {
                    case BackgroundAccessStatus.AlwaysAllowed:
                    case BackgroundAccessStatus.AllowedSubjectToSystemPolicy:
                        rootPage.NotifyUser("Background task is already registered. Waiting for next update...", NotifyType.StatusMessage);
                        break;

                    default:
                        rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                        break;
                }
            }

            return found;

        }

static string LookupSavedString | ( | string | key,
 |  | string | defaultValue = "" |
 | ) |  |  | [inline, static]

Look up a string in the saved LocalSettings, or a default value if no string is found.

Parameters:
key | The key to look up
defaultValue | The fallback value to use if the key is not found or the value is not a string
Returns:

Definition at line 130 of file SampleConfiguration.cs.

        {
            var values = Windows.Storage.ApplicationData.Current.LocalSettings.Values;
            object o;
            values.TryGetValue(key, out o);
            string s = o as string;
            return (s == null) ? defaultValue : s;
        }

void NavigateToAutoPlay ( ) [inline]

Definition at line 47 of file MainPage.xaml.cs.

        {
            ScenarioFrame.Navigate(this.Scenarios[0].ClassType,this.DeviceEvent);
        }

void NavigateToPageWithParameter | ( | int | pageIndex,
 |  | object | parameter |
 | ) |  |  | [inline]

Definition at line 44 of file SampleConfiguration.cs.

        {
            ScenarioControl.SelectedIndex = pageIndex;
            ScenarioFrame.Navigate(scenarios[pageIndex].ClassType, parameter);
        }

void NavigateToPageWithParameter | ( | int | pageIndex,
 |  | object | parameter |
 | ) |  |  | [inline]

Definition at line 30 of file SampleConfiguration.cs.

        {
            ScenarioControl.SelectedIndex = pageIndex;
            ScenarioFrame.Navigate(scenarios[pageIndex].ClassType, parameter);
        }

void NavigateToReconnect ( ) [inline]

Definition at line 52 of file MainPage.xaml.cs.

        {
            ScenarioFrame.Navigate(this.Scenarios[0].ClassType,this.ImportOperation);
        }

void NavigateToScenario ( Type type ) [inline]

Definition at line 28 of file SampleConfiguration.cs.

        {
            for (int index = 0; index < scenarios.Count; index++)
            {
                if (scenarios[index].ClassType == type)
                {
                    ScenarioControl.SelectedIndex = index;
                    break;
                }
            }
        }

void NavigateToScenario | ( | Type | scenario,
 |  | object | param = null |
 | ) |  |  | [inline, private]

Definition at line 92 of file MainPage.xaml.cs.

        {
            ScenarioFrame.Navigate(scenario, param);
            if (Window.Current.Bounds.Width < 640)
            {
                Splitter.IsPaneOpen = false;
                StatusBorder.Visibility = Visibility.Collapsed;
            }

            if (scenario == typeof(CardReader))
            {
                StatusBlockScroller.MaxHeight = Math.Max(300, Window.Current.Bounds.Height - 200);
            }
            else
            {
                StatusBlockScroller.MaxHeight = 300;
            }
        }

void NavigateToScenarioWithParameter | ( | Scenario | scenario,
 |  | object | parameter |
 | ) |  |  | [inline]

Definition at line 31 of file SampleConfiguration.cs.

        {
            ScenarioControl.SelectedIndex = scenarios.IndexOf(scenario);
            ScenarioFrame.Navigate(scenario.ClassType, parameter);
        }

void NavigationHelper_Load | ( | object | sender,
 |  | LoadStateEventArgs | e |
 | ) |  |  | [inline, private]

Populates the page with content passed during navigation.

Any saved state is also provided when recreating a page from a prior session.

Parameters:
sender | The source of the event; typically NavigationHelper.
e | Event data that provides both the navigation parameter passed to Frame.Navigate(Type, Object) when this page was initially requested and a dictionary of state preserved by this page during an earlier session. The state will be null the first time a page is visited.

Definition at line 91 of file MainPage.xaml.cs.

        {
            this.defaultViewModel = null;
            if (SuspensionManager.SessionState.ContainsKey(index))
            {
                this.defaultViewModel = SuspensionManager.SessionState[index] as ItemList;
            }

            if (this.defaultViewModel == null)
            {
                this.defaultViewModel = ItemList.CreateDefaultItemList();
            }

            list.ItemsSource = this.defaultViewModel;
        }

void NavigationHelper_Save | ( | object | sender,
 |  | SaveStateEventArgs | e |
 | ) |  |  | [inline, private]

Preserves state associated with this page in case the application is suspended or the page is discarded from the navigation cache.

Values must conform to the serialization requirements of SuspensionManager.SessionState.

Parameters:
sender | The source of the event; typically NavigationHelper.
e | Event data that provides an empty dictionary to be populated with serializable state.

Definition at line 115 of file MainPage.xaml.cs.

        {
            SuspensionManager.SessionState[index] = defaultViewModel;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 88 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusPanel.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 97 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
            if (StatusBlock.Text != String.Empty)
            {
                StatusBorder.Visibility = Visibility.Visible;
                StatusPanel.Visibility = Visibility.Visible;
            }
            else
            {
                StatusBorder.Visibility = Visibility.Collapsed;
                StatusPanel.Visibility = Visibility.Collapsed;
            }
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 115 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 89 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 82 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusPanel.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type,
 |  | bool | clearPrevious = false |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 121 of file MainPage.xaml.cs.

        {
            if (!this.Dispatcher.HasThreadAccess)
            {
                var ignored = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { NotifyUser(strMessage, type, clearPrevious); });
                return;
            }

            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            if (clearPrevious)
            {
                StatusBlock.Text = strMessage;
            }
            else
            {
                if (StatusBlock.Text != "")
                {
                    StatusBlock.Text += "\r\n";
                }
                StatusBlock.Text += strMessage;
            }
            StatusBlockScroller.ChangeView(0, StatusBlockScroller.ExtentHeight, 1);

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 89 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 89 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 86 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 106 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            if (StatusBlock.Text != String.Empty)
            {
                StatusBorder.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                StatusBorder.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Used to display messages to the user.

Parameters:
strMessage
type

Definition at line 89 of file MainPage.xaml.cs.

        {
            switch (type)
            {
                case NotifyType.StatusMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
                    break;
                case NotifyType.ErrorMessage:
                    StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
                    break;
            }
            StatusBlock.Text = strMessage;

            // Collapse the StatusBlock if it has no text to conserve real estate.
            StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
        }

void NotifyUserFileNotExist ( )

Definition at line 46 of file SampleConfiguration.cpp.

{
    NotifyUser("The file '" + Filename + "' does not exist. Use scenario one to create this file.", NotifyType::ErrorMessage);
}

internal void NotifyUserFileNotExist ( ) [inline, private]

Definition at line 61 of file SampleConfiguration.cs.

        {
            NotifyUser(String.Format("The file '{0}' does not exist. Use scenario one to create this file.", filename), NotifyType.ErrorMessage);
        }

async void NotifyUserFromBackground | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Definition at line 29 of file SampleConfiguration.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                NotifyUser(strMessage, type);
            });
        }

void OnClipboardChanged | ( | Object | sender,
 |  | Object | e |
 | ) |  |  | [inline, private]

Definition at line 142 of file SampleConfiguration.cs.

        {
            DisplayToast("Clipboard changed.");
            HandleClipboardChanged();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 142 of file MainPage.xaml.cs.

        {
            this.navigationHelper.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 50 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }

            if (e.Parameter is string)
            {
                var param = (string)e.Parameter;
                if (!string.IsNullOrWhiteSpace(param))
                {
                    NavigateToScenario(typeof(ReceiptView), param);
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

The methods provided in this section are simply used to allow NavigationHelper to respond to the page's navigation methods.

Page specific logic should be placed in event handlers for the NavigationHelper.LoadState and NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session.

Parameters:
e Provides data for navigation methods and event handlers that cannot cancel the navigation request.

Definition at line 135 of file MainPage.xaml.cs.

        {
            this.navigationHelper.OnNavigatedTo(e);

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            ScenarioControl.SelectedIndex = 0;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;

            // If we have saved state return to the previously selected scenario
            if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex") && String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
            }
            else if (e.Parameter != null && !String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                this.LaunchParam = e.Parameter.ToString();
                int index = 0;
                this.GetScenarioIdForLaunch(this.LaunchParam, ref index);
                ScenarioControl.SelectedIndex = index;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            userId = ApplicationData.Current.LocalSettings.Values["userId"] as string ?? string.Empty;
            publicKeyHint = ApplicationData.Current.LocalSettings.Values["publicKeyHint"] as string ?? string.Empty;

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 67 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }

            // This page is always at the top of our in-app back stack.
            // Once it is reached there is no further back so we can always disable the title bar back UI when navigated here.
            // If you want to you can always to the Frame.CanGoBack check for all your pages and act accordingly.
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;
            if (Window.Current.Bounds.Width < 640)
            {
                ScenarioControl.SelectedIndex = -1;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }

void OnSignInInfoChanged ( ) [inline, private]

Definition at line 95 of file MainPage.xaml.cs.

        {
            SignInWithPasswordButton.IsEnabled = (!string.IsNullOrWhiteSpace(UserNameTextBox.Text) && !string.IsNullOrWhiteSpace(PasswordTextBox.Password));
        }

void OnWindowActivated | ( | object | sender,
 |  | WindowActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 131 of file SampleConfiguration.cs.

        {
            this.isApplicationWindowActive = (e.WindowActivationState != CoreWindowActivationState.Deactivated);
            if (this.needToPrintClipboardFormat)
            {
                // The clipboard was updated while the sample was in the background. If the sample is now in the foreground,
                // display the new content.
                HandleClipboardChanged();
            }
        }

task< Playlist^> PickPlaylistAsync ( )

Definition at line 50 of file SampleConfiguration.cpp.

{
    // Pick a file, then load it as a playlist.
    FileOpenPicker^ picker = MainPage::CreateFilePicker(MainPage::playlistExtensions);
    return create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ file)
    {
        if (file != nullptr)
        {
            return create_task(Playlist::LoadAsync(file)).then([this](task<Playlist^> playlistTask)
            {
                try
                {
                    return playlistTask.get();
                }
                catch (Exception^ ex)
                {
                    NotifyUser(ex->Message, NotifyType::ErrorMessage);
                    return (Playlist^)nullptr;
                }
            });
        }
        else
        {
            NotifyUser("No playlist picked.", NotifyType::ErrorMessage);
            return create_task([]() -> Playlist^ { return nullptr; });
        }
    });
}

async Task<Playlist> PickPlaylistAsync ( ) [inline]

Picks and loads a playlist.

Definition at line 66 of file SampleConfiguration.cs.

        {
            FileOpenPicker picker = CreateFilePicker(MainPage.playlistExtensions);
            StorageFile file = await picker.PickSingleFileAsync();

            if (file == null)
            {
                NotifyUser("No playlist picked.", NotifyType.ErrorMessage);
                return null;
            }

            try
            {
                return await Playlist.LoadAsync(file);
            }
            catch (Exception ex)
            {
                NotifyUser(ex.Message, NotifyType.ErrorMessage);
                return null;
            }
        }

void ReleaseAllPrinters ( )

Definition at line 47 of file SampleConfiguration.cpp.

{
    ReleaseClaimedPrinter();

    if (Printer != nullptr)
    {
        delete Printer;
        Printer = nullptr;
        if (StateChanged) StateChanged();
    }
}

void ReleaseAllPrinters ( ) [inline]

Definition at line 55 of file SampleConfiguration.cs.

        {
            ReleaseClaimedPrinter();

            if (Printer != null)
            {
                Printer.Dispose();
                Printer = null;
                StateChanged?.Invoke();
            }
        }

void ReleaseClaimedPrinter ( ) [inline]

Definition at line 44 of file SampleConfiguration.cs.

        {
            if (ClaimedPrinter != null)
            {
                ClaimedPrinter.ReleaseDeviceRequested -= ClaimedPrinter_ReleaseDeviceRequested;
                ClaimedPrinter.Dispose();
                ClaimedPrinter = null;
                StateChanged?.Invoke();
            }
        }

void ReleaseClaimedPrinter ( )

Definition at line 36 of file SampleConfiguration.cpp.

{
    if (ClaimedPrinter != nullptr)
    {
        ClaimedPrinter->ReleaseDeviceRequested -= releaseDeviceRequestedToken;
        delete ClaimedPrinter;
        ClaimedPrinter = nullptr;
        if (StateChanged) StateChanged();
    }
}

void RemoveCustomTitleBar ( ) [inline]

Definition at line 51 of file SampleConfiguration.cs.

        {
            if (customTitleBar != null)
            {
                // Take the title bar's page content and make it
                // the window content.
                this.Content = customTitleBar.SetPageContent(null);
                customTitleBar = null;
            }
        }

void RemoveCustomTitleBar ( )

Definition at line 48 of file SampleConfiguration.cpp.

{
    if (customTitleBar != nullptr)
    {
        // Take the title bar's page content and make it
        // the window content.
        this->Content = customTitleBar->SetPageContent(nullptr);
        customTitleBar = nullptr;
    }
}

static void ReportSavedStatus ( ) [inline, static]

Look up the "Status" in the saved LocalSettings and display it if present.

Definition at line 163 of file SampleConfiguration.cs.

        {
            string status = LookupSavedString("Status");
            if (!string.IsNullOrEmpty(status))
            {
                MainPage.Current.NotifyUser(status, NotifyType.StatusMessage);
            }
        }

static void RepositionFaces | ( | WriteableBitmap | displaySource,
 |  | Canvas | canvas |
 | ) |  |  | [inline, static]

Definition at line 84 of file SampleConfiguration.cs.

        {
            double widthScale = canvas.ActualWidth / displaySource.PixelWidth;
            double heightScale = canvas.ActualHeight / displaySource.PixelHeight;

            foreach (var item in canvas.Children)
            {
                ApplyScale((FrameworkElement)item, widthScale, heightScale);
            }
        }

void ResetItems ( ) [inline, private]

Definition at line 74 of file MainPage.xaml.cs.

        {
            this.defaultViewModel = ItemList.CreateDefaultItemList();
            list.ItemsSource = this.defaultViewModel;
        }

void ResetOutput | ( | Image | image,
 |  | TextBlock | output,
 |  | TextBlock | outputDetails = null |
 | ) |  |  | [inline]

Definition at line 89 of file SampleConfiguration.cs.

        {
            image.Source = PlaceHolderImage;
            NotifyUser("", NotifyType.ErrorMessage);
            NotifyUser("", NotifyType.StatusMessage);
            output.Text = "";
            if (outputDetails != null)
            {
                outputDetails.Text = "";
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 79 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                SuspensionManager.SessionState["SelectedScenarioIndex"] = scenarioListBox.SelectedIndex;
                ScenarioFrame.Navigate(s.ClassType);
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 87 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 70 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 79 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                NavigateToScenario(s.ClassType);
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 60 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 61 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 54 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListView scenarioListBox = sender as ListView;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void ScenarioControl_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Called whenever the user changes selection in the scenarios list.

This method will navigate to the respective sample scenario page.

Parameters:
sender
e

Definition at line 58 of file MainPage.xaml.cs.

        {
            // Clear the status block when navigating scenarios.
            NotifyUser(String.Empty, NotifyType.StatusMessage);

            ListBox scenarioListBox = sender as ListBox;
            Scenario s = scenarioListBox.SelectedItem as Scenario;
            if (s != null)
            {
                ScenarioFrame.Navigate(s.ClassType);
                if (Window.Current.Bounds.Width < 640)
                {
                    Splitter.IsPaneOpen = false;
                    StatusBorder.Visibility = Visibility.Collapsed;
                }
            }
        }

void SetExtendedSplashInfo | ( | Rect | splashRect,
 |  | bool | dismissStat |
 | ) |  |  | [inline]

Definition at line 31 of file SampleConfiguration.cs.

        {
            SplashImageRect = splashRect;
            Dismissed = dismissStat;
        }

static void SetReadingText | ( | TextBlock | textBlock,
 |  | OrientationSensorReading | reading |
 | ) |  |  | [inline, static]

Definition at line 31 of file SampleConfiguration.cs.

        {
            SensorQuaternion quaternion = reading.Quaternion;    // get a reference to the object to avoid re-creating it for each access
            string quaternionReport = string.Format("W: {0,5:0.00}, X: {1,5:0.00}, Y: {2,5:0.00}, Z: {3,5:0.00}",
                quaternion.W, quaternion.X, quaternion.Y, quaternion.Z);

            SensorRotationMatrix rotationMatrix = reading.RotationMatrix;
            string rotationMatrixReport = string.Format(
                "M11: {0,5:0.00}, M12: {1,5:0.00}, M13: {2,5:0.00}\n" +
                "M21: {3,5:0.00}, M22: {4,5:0.00}, M23: {5,5:0.00}\n" +
                "M31: {6,5:0.00}, M32: {7,5:0.00}, M33: {8,5:0.00}",
                rotationMatrix.M11, rotationMatrix.M12, rotationMatrix.M13,
                rotationMatrix.M21, rotationMatrix.M22, rotationMatrix.M23,
                rotationMatrix.M31, rotationMatrix.M32, rotationMatrix.M33);

            string yawAccuracyReport;
            switch (reading.YawAccuracy)
            {
                case MagnetometerAccuracy.Unknown:
                    yawAccuracyReport = "unknown";
                    break;
                case MagnetometerAccuracy.Unreliable:
                    yawAccuracyReport = "unreliable";
                    break;
                case MagnetometerAccuracy.Approximate:
                    yawAccuracyReport = "approximate";
                    break;
                case MagnetometerAccuracy.High:
                    yawAccuracyReport = "high";
                    break;
                default:
                    yawAccuracyReport = "other";
                    break;
            }

            textBlock.Text = "Quaternion:\n" + quaternionReport + "\n\n" +
                "Rotation Matrix:\n" + rotationMatrixReport + "\n\n" +
                "Yaw Accuracy:\n" + yawAccuracyReport;
        }

static void SetReadingText | ( | TextBlock | textBlock,
 |  | AccelerometerReading | reading |
 | ) |  |  | [inline, static]

Definition at line 33 of file SampleConfiguration.cs.

        {
            textBlock.Text = string.Format("X: {0,5:0.00}, Y: {1,5:0.00}, Z: {2,5:0.00}",
                reading.AccelerationX, reading.AccelerationY, reading.AccelerationZ);
        }

async void SignInWithHello ( ) [inline, private]

Definition at line 176 of file MainPage.xaml.cs.

        {
            ProgressRing.IsActive = true;

            // Don't let the user try a new operation while we are busy with this one.
            SignInWithHelloButton.IsEnabled = false;
            SignInAsSomeoneElseButton.IsEnabled = false;

            bool result = await SignInWithHelloAsync();

            ProgressRing.IsActive = false;
            SignInWithHelloButton.IsEnabled = true;
            SignInAsSomeoneElseButton.IsEnabled = true;

            if (result)
            {
                Frame.Navigate(typeof(AccountOverviewPage));
            }
            else
            {
                MessageDialog message = new MessageDialog("Login with Windows Hello failed.");
                await message.ShowAsync();
            }
        }

async Task<bool> SignInWithHelloAsync ( ) [inline, private]

Definition at line 127 of file MainPage.xaml.cs.

        {
            // Open the existing user key credential.
            KeyCredentialRetrievalResult retrieveResult = await KeyCredentialManager.OpenAsync(userId);

            if (retrieveResult.Status != KeyCredentialStatus.Success)
            {
                return false;
            }

            KeyCredential userCredential = retrieveResult.Credential;

            // Request a challenge from the server.
            JsonValue jsonChallenge = await JsonRequest.Create()
                .AddString("userId", userId)
                .AddString("publicKeyHint", publicKeyHint)
                .PostAsync("api/Authentication/RequestChallenge");
            if (jsonChallenge == null)
            {
                return false;
            }

            // Sign the challenge using the user's KeyCredential.
            IBuffer challengeBuffer = CryptographicBuffer.DecodeFromBase64String(jsonChallenge.GetString());
            KeyCredentialOperationResult opResult = await userCredential.RequestSignAsync(challengeBuffer);

            if (opResult.Status != KeyCredentialStatus.Success)
            {
                return false;
            }

            // Get the signature.
            IBuffer signatureBuffer = opResult.Result;

            // Send the signature back to the server to confirm our identity.
            // The publicKeyHint tells the server which public key to use to verify the signature.
            JsonValue jsonResult = await JsonRequest.Create()
                .AddString("userId", userId)
                .AddString("publicKeyHint", publicKeyHint)
                .AddString("signature", CryptographicBuffer.EncodeToBase64String(signatureBuffer))
                .PostAsync("api/Authentication/SubmitResponse");
            if (jsonResult == null)
            {
                return false;
            }

            return jsonResult.GetBoolean();
        }

async void SignInWithPassword ( ) [inline, private]

Definition at line 100 of file MainPage.xaml.cs.

        {
            string password = PasswordTextBox.Password;

            // Perform traditional standard authentication here.
            // Our sample accepts any userid and password.

            // Next, see if we can offer to switch to Windows Hello sign-in.
            // Check if the device is capable of provisioning Microsoft Passport key credentials and
            // the user has set up Windows Hello with a PIN on the device.
            if (await KeyCredentialManager.IsSupportedAsync())
            {
                // Navigate to Enable Hello Page, passing the account ID (username) as a parameter
                string accountID = UserNameTextBox.Text;
                Frame.Navigate(typeof(EnableHelloPage), accountID);
            }
            else
            {
                // Windows Hello is not available, so go directly to the signed-in state.
                // For the purpose of this sample, we will display a message to indicate
                // that this code path has been reached.
                MessageDialog message = new MessageDialog("Sample note: Since Windows Hello is not set up, we will go directly to the signed-in state.");
                await message.ShowAsync();
                Frame.Navigate(typeof(AccountOverviewPage));
            }
        }

void SubscribeToReleaseDeviceRequested ( )

Definition at line 31 of file SampleConfiguration.cpp.

{
    releaseDeviceRequestedToken = ClaimedPrinter->ReleaseDeviceRequested += ref new TypedEventHandler<ClaimedPosPrinter^, PosPrinterReleaseDeviceRequestedEventArgs^>(this, &MainPage::ClaimedPrinter_ReleaseDeviceRequested);
}

void SubscribeToReleaseDeviceRequested ( ) [inline]

Definition at line 39 of file SampleConfiguration.cs.

        {
            ClaimedPrinter.ReleaseDeviceRequested += ClaimedPrinter_ReleaseDeviceRequested;
        }

Uri TryGetUri ( string uriString ) [inline]

Definition at line 34 of file SampleConfiguration.cs.

        {
            Uri webSocketUri;
            if (!Uri.TryCreate(uriString.Trim(), UriKind.Absolute, out webSocketUri))
            {
                NotifyUser("Error: Invalid URI", NotifyType.ErrorMessage);
                return null;
            }

            // Fragments are not allowed in WebSocket URIs.
            if (!String.IsNullOrEmpty(webSocketUri.Fragment))
            {
                NotifyUser("Error: URI fragments not supported in WebSocket URIs.", NotifyType.ErrorMessage);
                return null;
            }

            // Uri.SchemeName returns the canonicalized scheme name so we can use case-sensitive, ordinal string
            // comparison.
            if ((webSocketUri.Scheme != "ws") && (webSocketUri.Scheme != "wss"))
            {
                NotifyUser("Error: WebSockets only support ws:// and wss:// schemes.", NotifyType.ErrorMessage);
                return null;
            }

            return webSocketUri;
        }

concurrency::task<bool> TrySavePlaylistAsync ( Windows::Media::Playlists::Playlist^ playlist )
async Task<bool> TrySavePlaylistAsync ( Playlist playlist ) [inline]

Definition at line 88 of file SampleConfiguration.cs.

        {
            try
            {
                await playlist.SaveAsync();
                return true;
            }
            catch (Exception ex)
            {
                NotifyUser(ex.Message, NotifyType.ErrorMessage);
                return false;
            }
        }

async void Unregister ( ) [inline, private]

Definition at line 64 of file MainPage.xaml.cs.

        {
            // Don't let the user try a new operation while we are busy with this one.
            SignInWithHelloButton.IsEnabled = false;
            SignInAsSomeoneElseButton.IsEnabled = false;

            // Remove the credential from the key credential manager, to free up space on the device.
            await Util.TryDeleteCredentialAccountAsync(userId);

            // Remove the credential from the server, to free up space on the server.
            JsonValue jsonResult = await JsonRequest.Create()
                .AddString("userId", userId)
                .AddString("publicKeyHint", publicKeyHint)
                .PostAsync("api/Authentication/RemoveRegisteredKey");
            if (jsonResult == null || !jsonResult.GetBoolean())
            {
                // Could not delete from the server. Nothing we can do; just ignore the error.
            }

            // Remove our app's knowledge of the user.
            ApplicationData.Current.LocalSettings.Values.Remove("userId");
            ApplicationData.Current.LocalSettings.Values.Remove("publicKeyHint");
            userId = string.Empty;

            SignInWithHelloButton.IsEnabled = true;
            SignInAsSomeoneElseButton.IsEnabled = true;

            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Definition at line 49 of file MainPage.xaml.cs.

        {
            RegisteredUserName.Text = userId;
            if (userId.Length != 0 && publicKeyHint.Length != 0)
            {
                SignInWithHelloContent.Visibility = Visibility.Visible;
                SignInWithPasswordContent.Visibility = Visibility.Collapsed;
            }
            else
            {
                SignInWithHelloContent.Visibility = Visibility.Collapsed;
                SignInWithPasswordContent.Visibility = Visibility.Visible;
            }
        }

void ValidateFile ( ) [inline, private]

Checks if sample file already exists, if it does assign it to sampleFile.

Definition at line 50 of file SampleConfiguration.cs.

        {
            StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            sampleFile = (await picturesLibrary.TryGetItemAsync(filename)) as StorageFile;
            if (sampleFile == null)
            {
                // If file doesn't exist, indicate users to use scenario 1
                NotifyUserFileNotExist();
            }
        }

internal bool ValidateSystemDiscovery ( ) [inline, private]

Checks if the system discovery has been performed and systems have been found.

Definition at line 39 of file SampleConfiguration.cs.

        {
            if (systemList == null)
            {
                NotifyUser("System discovery has not been performed. Use scenario one to discover systems.", NotifyType.ErrorMessage);
                return false;
            }
            else if (systemList.Count == 0)
            {
                NotifyUser("No systems have been found. Use scenario one to discover systems.", NotifyType.ErrorMessage);
                return false;
            }

            return true;
        }

bool ValidateTPMSmartCard ( ) [inline]

Definition at line 55 of file SampleConfiguration.cs.

        {
            if (string.IsNullOrEmpty(SmartCardReaderDeviceId))
            {
                return false;
            }
            return true;
        }

Member Data Documentation

internal __pad0__

Definition at line 26 of file SampleConfiguration.h.

DeviceActivatedEventArgs _deviceEventArgs = null [private]

Definition at line 33 of file MainPage.xaml.cs.

PhotoImportOperation _importOperation = null [private]

Definition at line 40 of file MainPage.xaml.cs.

Windows::UI::Xaml::Media::Imaging::BitmapImage _placeholder [private]

Definition at line 63 of file SampleConfiguration.h.

BitmapImage _placeholder [private]

Definition at line 55 of file SampleConfiguration.cs.

const int ADMIN_KEY_LENGTH_IN_BYTES = 24

Definition at line 24 of file SampleConfiguration.cs.

Windows::Storage::Streams::IBuffer adminkey [private]

Definition at line 61 of file SampleConfiguration.h.

const string APP_TITLE = "File Picker Contracts C# Sample"

Definition at line 22 of file SampleConfiguration.cs.

const string appbarTileId = "SecondaryTile.AppBar"

Definition at line 37 of file SampleConfiguration.cs.

readonly string [] audioExtensions = new string[] { ".wma", ".mp3", ".mp2", ".aac", ".adt", ".adts", ".m4a" } [static]

Audio file extensions.

Definition at line 38 of file SampleConfiguration.cs.

Array< String^> audioExtensionsInner [static, private]
Initial value:
 ref new Array<String^>
{
    L".wma",  L".mp3",  L".mp2",  L".aac", L".adt", L".adts", L".m4a"
}

Definition at line 49 of file SampleConfiguration.h.

Windows::Devices::PointOfService::ClaimedPosPrinter ClaimedPrinter = nullptr

Definition at line 39 of file SampleConfiguration.h.

internal ClaimedPosPrinter ClaimedPrinter = null [private]

Definition at line 34 of file SampleConfiguration.cs.

Windows.Media.Playback.MediaPlayer commonMediaPlayer = null

Definition at line 35 of file SampleConfiguration.cs.

IReadOnlyList<AdaptiveContentModel> ContentManagementSystemStub = AdaptiveContentModel.GetKnownAzureMediaServicesModels() [static]

Definition at line 37 of file SampleConfiguration.cs.

static MainPage Current = nullptr [static]

Definition at line 30 of file MainPage.xaml.cs.

ItemList defaultViewModel [private]

Definition at line 20 of file MainPage.xaml.cs.

Platform::String deviceId [private]

Definition at line 62 of file SampleConfiguration.h.

Windows::Devices::Enumeration::DeviceInformation deviceInfo = nullptr

Definition at line 40 of file SampleConfiguration.h.

internal DeviceInformation deviceInfo = null [private]

Definition at line 35 of file SampleConfiguration.cs.

internal bool Dismissed [private]

Definition at line 22 of file SampleConfiguration.cs.

const string dynamicTileId = "SecondaryTile.LiveTile"

Definition at line 36 of file SampleConfiguration.cs.

const int E_NO_UNICODE_TRANSLATION = unchecked((int)0x80070459)

Definition at line 45 of file SampleConfiguration.cs.

string falToken = null

Definition at line 44 of file SampleConfiguration.cs.

const string FEATURE_NAME = "3D Printing C# Sample"

Definition at line 20 of file SampleConfiguration.cs.

const string filename = "sample.dat"

Definition at line 41 of file SampleConfiguration.cs.

string index = "index"

Definition at line 21 of file MainPage.xaml.cs.

bool initialize = InitializePasswordVaultInTheBackground()

Definition at line 33 of file SampleConfiguration.h.

bool IsAnImportantTransaction = true

Definition at line 42 of file SampleConfiguration.h.

internal bool IsAnImportantTransaction = true [private]

Definition at line 36 of file SampleConfiguration.cs.

bool isApplicationWindowActive = true [private]

Definition at line 30 of file SampleConfiguration.cs.

string launchParam [private]

Definition at line 33 of file SampleConfiguration.cs.

string launchParam

Definition at line 49 of file SampleConfiguration.h.

string LineDisplayId = null

Definition at line 38 of file SampleConfiguration.cs.

const string logoSecondaryTileId = "SecondaryTile.Logo"

Definition at line 35 of file SampleConfiguration.cs.

Windows::Media::MediaExtensionManager mediaExtensionManager [static]

Definition at line 48 of file SampleConfiguration.h.

Windows.Media.MediaExtensionManager mediaExtensionMgr [static, private]

Definition at line 22 of file SampleConfiguration.cs.

const string MissingTitleError = "Enter a title for what you are sharing and try again."

Definition at line 50 of file SampleConfiguration.cs.

string mruToken = null

Definition at line 43 of file SampleConfiguration.cs.

readonly NavigationHelper navigationHelper [private]

Definition at line 19 of file MainPage.xaml.cs.

bool needToPrintClipboardFormat = false [private]

Definition at line 28 of file SampleConfiguration.cs.

readonly string [] playlistExtensions = new string[] { ".m3u", ".wpl", ".zpl" } [static]

Playlist file extensions.

Definition at line 43 of file SampleConfiguration.cs.

Array< String^> playlistExtensionsInner [static, private]
Initial value:
 ref new Array<String^>
{
    L".m3u", L".wpl", L".zpl"
}

Definition at line 50 of file SampleConfiguration.h.

internal PosPrinter Printer = null [private]

Definition at line 33 of file SampleConfiguration.cs.

SecondaryViewsHelpers.ViewLifetimeControl ProjectionViewPageControl

Definition at line 31 of file SampleConfiguration.cs.

string publicKeyHint [private]

Definition at line 34 of file MainPage.xaml.cs.

Windows::Foundation::EventRegistrationToken releaseDeviceRequestedToken [private]

Definition at line 52 of file SampleConfiguration.h.

string SAMPLE_NAME = "x:Bind Sample in C#"

Definition at line 21 of file SampleConfiguration.cs.

StorageFile sampleFile = null

Definition at line 42 of file SampleConfiguration.cs.

Windows::Storage::StorageFile sampleFile [private]

Definition at line 57 of file SampleConfiguration.h.

string SampleMovieURL = "http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)" [static]

Definition at line 30 of file SampleConfiguration.cs.

List< Scenario > scenarios [private]
Initial value:
 new List<Scenario>
        {
            new Scenario() { Title="Print a model", ClassType=typeof(Scenario1_Print)},
            new Scenario() { Title="Launch 3D Builder", ClassType=typeof(Scenario2_Launch)},
        }

Definition at line 22 of file SampleConfiguration.cs.

Platform::Array< Scenario > scenariosInner [static, private]
Initial value:
 ref new Platform::Array<Scenario>
{
    { "Choose accelerometer", "SDKTemplate.Scenario0_Choose" },
    { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
    { "Shake Events", "SDKTemplate.Scenario2_ShakeEvents" },
    { "Polling", "SDKTemplate.Scenario3_Polling" },
    { "OrientationChanged", "SDKTemplate.Scenario4_OrientationChanged" },
    { "Data Events Batching", "SDKTemplate.Scenario5_DataEventsBatching" }
}

Definition at line 38 of file SampleConfiguration.h.

Geopoint SeattleGeopoint = new Geopoint(new BasicGeoposition() { Latitude = 47.604, Longitude = -122.329 }) [static]

Definition at line 40 of file SampleConfiguration.cs.

string SelectedBleDeviceId

Definition at line 31 of file SampleConfiguration.cs.

string SelectedBleDeviceName = "No device selected"

Definition at line 32 of file SampleConfiguration.cs.

internal Rect SplashImageRect [private]

Definition at line 23 of file SampleConfiguration.cs.

std::function<void(void)> StateChanged

Definition at line 43 of file SampleConfiguration.h.

ObservableCollection<RemoteSystem> systemList = null

Definition at line 33 of file SampleConfiguration.cs.

Dictionary<string, RemoteSystem> systemMap = null

Definition at line 34 of file SampleConfiguration.cs.

string userId [private]

Definition at line 33 of file MainPage.xaml.cs.

List<ViewSizePreference> ViewSizePreferences [static]
Initial value:
 new List<ViewSizePreference>
        {
            ViewSizePreference.Default,
            ViewSizePreference.UseLess,
            ViewSizePreference.UseHalf,
            ViewSizePreference.UseMore,
            ViewSizePreference.UseMinimum,
            ViewSizePreference.UseNone,
        }

Definition at line 34 of file SampleConfiguration.cs.

Property Documentation

Windows::Devices::Sensors::AccelerometerReadingType accelerometerReadingType = Windows::Devices::Sensors::AccelerometerReadingType::Standard

Definition at line 54 of file SampleConfiguration.h.

AccelerometerReadingType AccelerometerReadingType [get, set]

Definition at line 39 of file SampleConfiguration.cs.

Windows.Storage.Streams.IBuffer AdminKey [get, set]

Definition at line 38 of file SampleConfiguration.cs.

bool areControlsInTitleBar = false

Definition at line 53 of file SampleConfiguration.h.

bool AreControlsInTitleBar [get, set]

Definition at line 65 of file SampleConfiguration.cs.

Uri CaptionedMediaUri [get]

Definition at line 38 of file SampleConfiguration.cs.

CustomTitleBar customTitleBar = nullptr

Definition at line 52 of file SampleConfiguration.h.

ItemList DefaultViewModel [get]

Gets the view model for this Page.

This can be changed to a strongly typed view model.summary> Invoked when an item within a section is clicked Only the following types can be serialized by Frame.GetNavigationState: numbers, characters, strings, guids and boolean. A frame that needs to be serialized cannot pass other types as the navigation param in Frame.Navigate. /summary>

Definition at line 49 of file MainPage.xaml.cs.

DeviceActivatedEventArgs DeviceEvent [get, set]

Definition at line 35 of file MainPage.xaml.cs.

PhotoImportOperation ImportOperation [get, set]

Definition at line 42 of file MainPage.xaml.cs.

bool IsClipboardContentChangedEnabled [get, set]

Definition at line 28 of file SampleConfiguration.cs.

Windows ApplicationModel Activation LaunchActivatedEventArgs LaunchArgs [get]

Definition at line 31 of file MainPage.xaml.cs.

string LaunchParam [get, set]

Definition at line 35 of file SampleConfiguration.cs.

Uri MultiTrackVideoMediaUri [get]
Initial value:
            new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/elephantsdream-clip-h264_sd-aac_eng-aac_spa-aac_eng_commentary.mp4")

Definition at line 42 of file SampleConfiguration.cs.

NavigationHelper NavigationHelper [get]

Gets the NavigationHelper associated with this Page.

Definition at line 40 of file MainPage.xaml.cs.

BitmapImage PlaceHolderImage [get, private]

Definition at line 57 of file SampleConfiguration.cs.

List< Scenario > Scenarios [get]

List of Scenarios will be included in this page.

Definition at line 88 of file MainPage.xaml.cs.

string SensorDescription = SensorOptimizationGoal.Precision [get]

Definition at line 76 of file SampleConfiguration.cs.

Windows::Devices::Sensors::SensorOptimizationGoal sensorOptimizationGoal

Definition at line 75 of file SampleConfiguration.h.

SensorOptimizationGoal SensorOptimizationGoal = SensorReadingType.Absolute [get, set]

Definition at line 73 of file SampleConfiguration.cs.

Windows::Devices::Sensors::SensorReadingType sensorReadingType

Definition at line 38 of file SampleConfiguration.h.

SensorReadingType SensorReadingType [get, set]

Definition at line 71 of file SampleConfiguration.cs.

Uri SintelMediaUri [get]
Initial value:
            new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multivideo-with-captions.mkv")

Definition at line 44 of file SampleConfiguration.cs.

String SmartCardReaderDeviceId [get, set]

Definition at line 40 of file SampleConfiguration.cs.

Uri UncaptionedMediaUri [get]
Initial value:
            new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/elephantsdream-clip-h264_sd-aac_eng-aac_spa-aac_eng_commentary-srt_eng-srt_por-srt_swe.mkv")

Definition at line 40 of file SampleConfiguration.cs.

IReadOnlyDictionary<string, ushort> WaveformNamesMap [static, get]

Definition at line 33 of file SampleConfiguration.cs.

Event Documentation

internal Action StateChanged [private]

Definition at line 37 of file SampleConfiguration.cs.

The documentation for this class was generated from the following files:
  • 3DPrinting/cs/SampleConfiguration.cs
  • Accelerometer/cpp/SampleConfiguration.h
  • Accelerometer/cs/SampleConfiguration.cs
  • ActivitySensor/cpp/SampleConfiguration.h
  • ActivitySensor/cs/SampleConfiguration.cs
  • AdaptiveStreaming/cs/SampleConfiguration.cs
  • AllJoyn/ConsumerExperiences/cs/SampleConfiguration.cs
  • AllJoyn/ProducerExperiences/cs/SampleConfiguration.cs
  • Altimeter/cpp/SampleConfiguration.h
  • Altimeter/cs/SampleConfiguration.cs
  • AnimationMetrics/cpp/SampleConfiguration.h
  • AnimationMetrics/cs/SampleConfiguration.cs
  • ApplicationData/cs/SampleConfiguration.cs
  • ApplicationResources/cpp/SampleConfiguration.h
  • ApplicationResources/cs/constants.cs
  • Appointments/cs/SampleConfiguration.cs
  • AppServices/cs/AppServicesClient/SampleConfiguration.cs
  • AppServices/cs/AppServicesProvider/SampleConfiguration.cs
  • AppWindow/cs/SampleConfiguration.cs
  • AssociationLaunching/cs/SampleConfiguration.cs
  • AudioCategory/cs/AudioCategory/SampleConfiguration.cs
  • AudioCreation/cs/AudioCreation/SampleConfiguration.cs
  • BackButton/cpp/SampleConfiguration.h
  • BackButton/cs/MainPage.xaml.cs
  • BackButton/cs/SampleConfiguration.cs
  • BackgroundActivation/cs/SampleConfiguration.cs
  • BackgroundMediaPlayback/cs/SampleConfiguration.cs
  • BackgroundSensors/cpp/SampleConfiguration.h
  • BackgroundSensors/cs/SampleConfiguration.cs
  • BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.h
  • BackgroundTransfer/cs/BackgroundTransfer/SampleConfiguration.cs
  • BarcodeScanner/cs/SampleConfiguration.cs
  • BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h
  • BarcodeScannerProvider/cs/BarcodeScannerProvider/SampleConfiguration.cs
  • Barometer/cpp/SampleConfiguration.h
  • Barometer/cs/SampleConfiguration.cs
  • BasicFaceDetection/cs/SampleConfiguration.cs
  • BasicFaceTracking/cs/SampleConfiguration.cs
  • BasicInput/cpp/SampleConfiguration.h
  • BasicInput/cs/SampleConfiguration.cs
  • BasicMediaCasting/cs/SampleConfiguration.cs
  • BasicSuspension/cs/MainPage.xaml.cs
  • BluetoothAdvertisement/cs/SampleConfiguration.cs
  • BluetoothLE/cs/SampleConfiguration.cs
  • BluetoothRfcommChat/cs/SampleConfiguration.cs
  • Calendar/cpp/SampleConfiguration.h
  • Calendar/cs/SampleConfiguration.cs
  • CameraFrames/cpp/SampleConfiguration.h
  • CameraFrames/cs/SampleConfiguration.cs
  • CameraOpenCV/cs/SampleConfiguration.cs
  • CameraProfile/cpp/SampleConfiguration.h
  • CameraProfile/cs/SampleConfiguration.cs
  • CameraResolution/cpp/SampleConfiguration.h
  • CameraResolution/cs/SampleConfiguration.cs
  • CameraStreamCorrelation/cpp/SampleConfiguration.h
  • Capabilities/cs/SampleConfiguration.cs
  • CashDrawer/cpp/SampleConfiguration.h
  • CashDrawer/cs/SampleConfiguration.cs
  • ClientDeviceInformation/cpp/SampleConfiguration.h
  • ClientDeviceInformation/cs/SampleConfiguration.cs
  • Clipboard/cs/SampleConfiguration.cs
  • Compass/cpp/SampleConfiguration.h
  • Compass/cs/SampleConfiguration.cs
  • ComplexInk/cpp/SampleConfiguration.h
  • Compression/cpp/SampleConfiguration.h
  • Compression/cs/SampleConfiguration.cs
  • ContactCardIntegration/cs/SampleConfiguration.cs
  • ContactCards/cpp/SampleConfiguration.h
  • ContactCards/cs/SampleConfiguration.cs
  • ContactPanel/cs/SampleConfiguration.cs
  • ContactPicker/cpp/SampleConfiguration.h
  • ContactPicker/cs/SampleConfiguration.cs
  • ContentIndexer/cpp/SampleConfiguration.h
  • ContentIndexer/cs/SampleConfiguration.cs
  • ContextMenu/cpp/SampleConfiguration.h
  • ContextMenu/cs/SampleConfiguration.cs
  • CredentialPicker/cpp/SampleConfiguration.h
  • CredentialPicker/cs/SampleConfiguration.cs
  • CustomCapability/cpp/SampleConfiguration.h
  • CustomCapability/cs/SampleConfiguration.cs
  • CustomEditControl/cs/SampleConfiguration.cs
  • CustomHidDeviceAccess/cpp/SampleConfiguration.h
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
  • CustomSensors/cpp/SampleConfiguration.h
  • CustomSensors/cs/SampleConfiguration.cs
  • CustomSerialDeviceAccess/cs/SampleConfiguration.cs
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
  • DatagramSocket/cs/SampleConfiguration.cs
  • DataReaderWriter/cpp/SampleConfiguration.h
  • DataReaderWriter/cs/SampleConfiguration.cs
  • DateTimeFormatting/cpp/SampleConfiguration.h
  • DateTimeFormatting/cs/SampleConfiguration.cs
  • DeviceEnumerationAndPairing/cpp/SampleConfiguration.h
  • DeviceEnumerationAndPairing/cs/SampleConfiguration.cs
  • DisablingScreenCapture/cpp/SampleConfiguration.h
  • DisablingScreenCapture/cs/SampleConfiguration.cs
  • DisplayOrientation/cpp/SampleConfiguration.h
  • DisplayOrientation/cs/SampleConfiguration.cs
  • DpiScaling/cpp/SampleConfiguration.h
  • DpiScaling/cs/SampleConfiguration.cs
  • DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.h
  • EnterpriseDataProtection/cs/SampleConfiguration.cs
  • ExtendedExecution/cpp/SampleConfiguration.h
  • ExtendedExecution/cs/SampleConfiguration.cs
  • FileAccess/cpp/SampleConfiguration.h
  • FileAccess/cs/SampleConfiguration.cs
  • FilePicker/cpp/SampleConfiguration.h
  • FilePicker/cs/SampleConfiguration.cs
  • FilePickerContracts/cs/MainPage.xaml.cs
  • FilePickerContracts/cs/SampleConfiguration.cs
  • FileSearch/cpp/SampleConfiguration.h
  • FileSearch/cs/SampleConfiguration.cs
  • FileThumbnails/cpp/SampleConfiguration.h
  • FileThumbnails/cs/SampleConfiguration.cs
  • FolderEnumeration/cpp/SampleConfiguration.h
  • FolderEnumeration/cs/SampleConfiguration.cs
  • FullScreenMode/cpp/SampleConfiguration.h
  • FullScreenMode/cs/SampleConfiguration.cs
  • Geolocation/cs/SampleConfiguration.cs
  • Geotag/cpp/SampleConfiguration.h
  • Geotag/cs/SampleConfiguration.cs
  • GlobalizationPreferences/cpp/SampleConfiguration.h
  • GlobalizationPreferences/cs/SampleConfiguration.cs
  • Gyrometer/cpp/SampleConfiguration.h
  • Gyrometer/cs/SampleConfiguration.cs
  • HotspotAuthentication/cs/SampleConfiguration.cs
  • HttpClient/cs/SampleConfiguration.cs
  • Inclinometer/cpp/SampleConfiguration.h
  • Inclinometer/cs/SampleConfiguration.cs
  • InkAnalysis/cs/SampleConfiguration.cs
  • IoT-GPIO/cpp/SampleConfiguration.h
  • IoT-GPIO/cs/SampleConfiguration.cs
  • IoT-I2C/cpp/SampleConfiguration.h
  • IoT-I2C/cs/SampleConfiguration.cs
  • IoT-SPI/cpp/SampleConfiguration.h
  • IoT-SPI/cs/SampleConfiguration.cs
  • JapanesePhoneticAnalysis/cpp/SampleConfiguration.h
  • JapanesePhoneticAnalysis/cs/SampleConfiguration.cs
  • Json/cs/SampleConfiguration.cs
  • JumpList/cpp/SampleConfiguration.h
  • JumpList/cs/SampleConfiguration.cs
  • KeyCredentialManager/cpp/SampleConfiguration.h
  • KeyCredentialManager/cs/SampleConfiguration.cs
  • LampArray/cs/SampleConfiguration.cs
  • LampDevice/cpp/SampleConfiguration.h
  • LampDevice/cs/SampleConfiguration.cs
  • LanguageFont/cs/SampleConfiguration.cs
  • LibraryManagement/cpp/SampleConfiguration.h
  • LibraryManagement/cs/SampleConfiguration.cs
  • LightSensor/cpp/SampleConfiguration.h
  • LightSensor/cs/SampleConfiguration.cs
  • LineDisplay/cpp/SampleConfiguration.h
  • LineDisplay/cs/SampleConfiguration.cs
  • LinguisticServices/cs/SampleConfiguration.cs
  • LiveDash/cs/LiveDashApp/MainPage.xaml.cs
  • LiveDash/cs/LiveDashApp/SampleConfiguration.cs
  • LockScreenApps/cs/SampleConfiguration.cs
  • Logging/cpp/SampleConfiguration.h
  • Logging/cs/SampleConfiguration.cs
  • LowLatencyInput/cpp/SampleConfiguration.h
  • MagneticStripeReader/cpp/SampleConfiguration.h
  • MagneticStripeReader/cs/SampleConfiguration.cs
  • Magnetometer/cs/SampleConfiguration.cs
  • MapControl/cpp/SampleConfiguration.h
  • MapControl/cs/SampleConfiguration.cs
  • MediaEditing/cpp/SampleConfiguration.h
  • MediaEditing/cs/SampleConfiguration.cs
  • MediaImport/cs/MainPage.xaml.cs
  • MediaImport/cs/SampleConfiguration.cs
  • MediaTranscoding/cpp/SampleConfiguration.h
  • MediaTranscoding/cs/SampleConfiguration.cs
  • MessageDialog/cpp/SampleConfiguration.h
  • MessageDialog/cs/SampleConfiguration.cs
  • MicrosoftPassport/cs/MainPage.xaml.cs
  • MIDI/cs/SampleConfiguration.cs
  • MixedRealityModel/cs/SampleConfiguration.cs
  • MobileBroadband/cs/SampleConfiguration.cs
  • MobileHotspot/cs/SampleConfiguration.cs
  • MultipleViews/cs/SampleConfiguration.cs
  • NetworkConnectivity/cs/SampleConfiguration.cs
  • Nfc/Nfc/MainPage.xaml.cs
  • Nfc/Nfc/SampleConfiguration.cs
  • NfcProvisioner/cs/SampleConfiguration.cs
  • NumberFormatting/cpp/SampleConfiguration.h
  • NumberFormatting/cs/SampleConfiguration.cs
  • OCR/cpp/SampleConfiguration.h
  • OCR/cs/SampleConfiguration.cs
  • OnDemandHotspot/cs/SampleConfiguration.cs
  • OrientationSensor/cpp/SampleConfiguration.h
  • OrientationSensor/cs/SampleConfiguration.cs
  • Package/cpp/SampleConfiguration.h
  • Package/cs/SampleConfiguration.cs
  • PasswordVault/cpp/SampleConfiguration.h
  • PasswordVault/cs/SampleConfiguration.cs
  • PdfDocument/cpp/SampleConfiguration.h
  • PdfDocument/cs/SampleConfiguration.cs
  • Pedometer/cpp/SampleConfiguration.h
  • Pedometer/cs/SampleConfiguration.cs
  • PenHaptics/cs/SampleConfiguration.cs
  • PersonalDataEncryption/cs/SampleConfiguration.cs
  • Personalization/cpp/SampleConfiguration.h
  • Personalization/cs/SampleConfiguration.cs
  • Playlists/cpp/SampleConfiguration.h
  • Playlists/cs/SampleConfiguration.cs
  • PlayReady/cs/SampleConfiguration.cs
  • PosPrinter/cpp/SampleConfiguration.h
  • PosPrinter/cs/SampleConfiguration.cs
  • PresenceSensor/cs/SampleConfiguration.cs
  • Printing/cpp/SampleConfiguration.h
  • Printing/cs/SampleConfiguration.cs
  • Projection/cs/MainPage.xaml.cs
  • Projection/cs/SampleConfiguration.cs
  • ProximitySensor/cpp/SampleConfiguration.h
  • ProximitySensor/cs/SampleConfiguration.cs
  • ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.h
  • ProxyStubsForWinRTComponents/cpp/cs/SampleConfiguration.cs
  • ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.h
  • ProxyStubsForWinRTComponents/cs/cs/SampleConfiguration.cs
  • RadialController/cpp/SampleConfiguration.h
  • RadialController/cs/SampleConfiguration.cs
  • RadioManager/cs/SampleConfiguration.cs
  • RelativeInclinometer/cpp/SampleConfiguration.h
  • RelativeInclinometer/cs/SampleConfiguration.cs
  • RemoteSystems/cs/SampleConfiguration.cs
  • ResizeAppView/cpp/SampleConfiguration.h
  • ResizeAppView/cs/SampleConfiguration.cs
  • SecondaryTiles/cs/SampleConfiguration.cs
  • SemanticTextQuery/cpp/SampleConfiguration.h
  • SemanticTextQuery/cs/SampleConfiguration.cs
  • SerialArduino/cs/SampleConfiguration.cs
  • ShareSource/cpp/SampleConfiguration.h
  • ShareSource/cs/SampleConfiguration.cs
  • ShareTarget/cs/SampleConfiguration.cs
  • SimpleCommunication/cpp/SampleConfiguration.h
  • SimpleCommunication/cs/SampleConfiguration.cs
  • SimpleImaging/cs/SampleConfiguration.cs
  • SimpleInk/cpp/SampleConfiguration.h
  • SimpleInk/cs/SampleConfiguration.cs
  • SimpleOrientationSensor/cpp/SampleConfiguration.h
  • SimpleOrientationSensor/cs/SampleConfiguration.cs
  • SmartCard/cpp/SampleConfiguration.h
  • SmartCard/cs/SampleConfiguration.cs
  • SmsSendAndReceive/cs/SmsSendAndReceive/SampleConfiguration.cs
  • SocketActivityStreamSocket/cs/Server/SampleConfiguration.cs
  • SocketActivityStreamSocket/cs/SocketActivityStreamSocket/SampleConfiguration.cs
  • SpatialSound/cpp/SampleConfiguration.h
  • SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.h
  • SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs
  • SplashScreen/cs/MainPage.xaml.cs
  • SplashScreen/cs/SampleConfiguration.cs
  • Store/cs/SampleConfiguration.cs
  • StreamSocket/cs/SampleConfiguration.cs
  • Syndication/cpp/SampleConfiguration.h
  • Syndication/cs/SampleConfiguration.cs
  • SystemMediaTransportControls/cs/SampleConfiguration.cs
  • TextSegmentation/cpp/SampleConfiguration.h
  • TextSegmentation/cs/SampleConfiguration.cs
  • TextSuggestion/cpp/SampleConfiguration.h
  • TextSuggestion/cs/SampleConfiguration.cs
  • TitleBar/cpp/SampleConfiguration.h
  • TitleBar/cs/SampleConfiguration.cs
  • TouchKeyboard/cs/SampleConfiguration.cs
  • TouchKeyboardTextInput/cpp/SampleConfiguration.h
  • TouchKeyboardTextInput/cs/SampleConfiguration.cs
  • Unicode/cs/SampleConfiguration.cs
  • UserActivity/cs/SampleConfiguration.cs
  • UserCertificateStore/cs/SampleConfiguration.cs
  • UserConsentVerifier/cpp/SampleConfiguration.h
  • UserConsentVerifier/cs/SampleConfiguration.cs
  • UserDataAccountManager/cpp/SampleConfiguration.h
  • UserDataAccountManager/cs/SampleConfiguration.cs
  • UserInfo/cs/SampleConfiguration.cs
  • UserInteractionMode/cpp/SampleConfiguration.h
  • UserInteractionMode/cs/SampleConfiguration.cs
  • UssdProtcol/cs/SampleConfiguration.cs
  • VersionAdaptiveCode/cs/SampleConfiguration.cs
  • VideoPlayback/cs/SampleConfiguration.cs
  • VideoPlaybackSynchronization/cs/SampleConfiguration.cs
  • WebAccountManagement/cpp/SampleConfiguration.h
  • WebAccountManagement/cs/SampleConfiguration.cs
  • WebAuthenticationBroker/cpp/SampleConfiguration.h
  • WebAuthenticationBroker/cs/SampleConfiguration.cs
  • WebSocket/cpp/SampleConfiguration.h
  • WebSocket/cs/SampleConfiguration.cs
  • WiFiDirect/cpp/SampleConfiguration.h
  • WiFiDirect/cs/SampleConfiguration.cs
  • WiFiDirectServices/cpp/SampleConfiguration.h
  • WiFiDirectServices/cs/SampleConfiguration.cs
  • WiFiScan/cpp/SampleConfiguration.h
  • WiFiScan/cs/SampleConfiguration.cs
  • WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.h
  • WRLInProcessWinRTComponent/cpp/cs/SampleConfiguration.cs
  • WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.h
  • WRLOutOfProcessWinRTComponent/cpp/cs/SampleConfiguration.cs
  • XamlAnimatedGif/cpp/SampleConfiguration.h
  • XamlAnimatedGif/cs/SampleConfiguration.cs
  • XamlBind/cs/MainPage.xaml.cs
  • XamlBind/cs/SampleConfiguration.cs
  • XamlBottomUpList/cpp/SampleConfiguration.h
  • XamlBottomUpList/cs/SampleConfiguration.cs
  • XamlCloudFontIntegration/cpp/SampleConfiguration.h
  • XamlCloudFontIntegration/cs/SampleConfiguration.cs
  • XamlCommanding/cpp/SampleConfiguration.h
  • XamlCommanding/cs/MainPage.xaml.cs
  • XamlCommanding/cs/SampleConfiguration.cs
  • XamlContextMenu/cpp/SampleConfiguration.h
  • XamlContextMenu/cs/SampleConfiguration.cs
  • XamlDataVirtualization/cs/MainPage.xaml.cs
  • XamlDataVirtualization/cs/SampleConfiguration.cs
  • XamlDeferLoadStrategy/cs/MainPage.xaml.cs
  • XamlDeferLoadStrategy/cs/SampleConfiguration.cs
  • XamlDragAndDrop/cpp/SampleConfiguration.h
  • XamlDragAndDrop/cs/SampleConfiguration.cs
  • XamlFocusVisuals/cs/MainPage.xaml.cs
  • XamlFocusVisuals/cs/SampleConfiguration.cs
  • XamlGamepadNavigation/cs/SampleConfiguration.cs
  • XamlListView/cs/SampleConfiguration.cs
  • XamlPivot/cs/MainPage.xaml.cs
  • XamlPivot/cs/SampleConfiguration.cs
  • XamlWebView/cs/SampleConfiguration.cs
  • XmlDocument/cs/SampleConfiguration.cs
  • XmlLite/cpp/SampleConfiguration.h
  • Accelerometer/cpp/SampleConfiguration.cpp
  • ActivitySensor/cpp/SampleConfiguration.cpp
  • Altimeter/cpp/SampleConfiguration.cpp
  • AnimationMetrics/cpp/SampleConfiguration.cpp
  • ApplicationResources/cpp/SampleConfiguration.cpp
  • BackButton/cpp/MainPage.xaml.cpp
  • BackButton/cpp/SampleConfiguration.cpp
  • BackgroundActivation/cpp/SampleConfiguration.cpp
  • BackgroundSensors/cpp/SampleConfiguration.cpp
  • BackgroundTask/cpp/BackgroundTask/SampleConfiguration.cpp
  • BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.cpp
  • BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.cpp
  • Barometer/cpp/SampleConfiguration.cpp
  • BasicInput/cpp/SampleConfiguration.cpp
  • Calendar/cpp/SampleConfiguration.cpp
  • CameraFrames/cpp/SampleConfiguration.cpp
  • CameraProfile/cpp/SampleConfiguration.cpp
  • CameraResolution/cpp/SampleConfiguration.cpp
  • CameraStreamCorrelation/cpp/SampleConfiguration.cpp
  • CashDrawer/cpp/SampleConfiguration.cpp
  • ClientDeviceInformation/cpp/SampleConfiguration.cpp
  • Compass/cpp/SampleConfiguration.cpp
  • ComplexInk/cpp/SampleConfiguration.cpp
  • Compression/cpp/SampleConfiguration.cpp
  • ContactCards/cpp/SampleConfiguration.cpp
  • ContactPicker/cpp/SampleConfiguration.cpp
  • ContentIndexer/cpp/SampleConfiguration.cpp
  • ContextMenu/cpp/SampleConfiguration.cpp
  • CredentialPicker/cpp/SampleConfiguration.cpp
  • CustomCapability/cpp/SampleConfiguration.cpp
  • CustomHidDeviceAccess/cpp/SampleConfiguration.cpp
  • CustomSensors/cpp/SampleConfiguration.cpp
  • DatagramSocket/cpp/SampleConfiguration.cpp
  • DataReaderWriter/cpp/SampleConfiguration.cpp
  • DateTimeFormatting/cpp/SampleConfiguration.cpp
  • DeviceEnumerationAndPairing/cpp/SampleConfiguration.cpp
  • DisablingScreenCapture/cpp/SampleConfiguration.cpp
  • DisplayOrientation/cpp/SampleConfiguration.cpp
  • DpiScaling/cpp/SampleConfiguration.cpp
  • DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.cpp
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.cpp
  • ExtendedExecution/cpp/SampleConfiguration.cpp
  • FileAccess/cpp/SampleConfiguration.cpp
  • FilePicker/cpp/SampleConfiguration.cpp
  • FileSearch/cpp/SampleConfiguration.cpp
  • FileThumbnails/cpp/SampleConfiguration.cpp
  • FolderEnumeration/cpp/SampleConfiguration.cpp
  • FullScreenMode/cpp/SampleConfiguration.cpp
  • Geotag/cpp/SampleConfiguration.cpp
  • GlobalizationPreferences/cpp/SampleConfiguration.cpp
  • Gyrometer/cpp/SampleConfiguration.cpp
  • Inclinometer/cpp/SampleConfiguration.cpp
  • IoT-GPIO/cpp/SampleConfiguration.cpp
  • IoT-I2C/cpp/SampleConfiguration.cpp
  • IoT-SPI/cpp/SampleConfiguration.cpp
  • JapanesePhoneticAnalysis/cpp/SampleConfiguration.cpp
  • JumpList/cpp/SampleConfiguration.cpp
  • KeyCredentialManager/cpp/SampleConfiguration.cpp
  • LampDevice/cpp/SampleConfiguration.cpp
  • LibraryManagement/cpp/SampleConfiguration.cpp
  • LightSensor/cpp/SampleConfiguration.cpp
  • LineDisplay/cpp/SampleConfiguration.cpp
  • Logging/cpp/SampleConfiguration.cpp
  • LowLatencyInput/cpp/SampleConfiguration.cpp
  • MagneticStripeReader/cpp/SampleConfiguration.cpp
  • MapControl/cpp/SampleConfiguration.cpp
  • MediaEditing/cpp/SampleConfiguration.cpp
  • MediaTranscoding/cpp/SampleConfiguration.cpp
  • MessageDialog/cpp/SampleConfiguration.cpp
  • NumberFormatting/cpp/SampleConfiguration.cpp
  • OCR/cpp/SampleConfiguration.cpp
  • OrientationSensor/cpp/SampleConfiguration.cpp
  • Package/cpp/SampleConfiguration.cpp
  • PasswordVault/cpp/SampleConfiguration.cpp
  • PdfDocument/cpp/SampleConfiguration.cpp
  • Pedometer/cpp/SampleConfiguration.cpp
  • Personalization/cpp/SampleConfiguration.cpp
  • Playlists/cpp/SampleConfiguration.cpp
  • PosPrinter/cpp/SampleConfiguration.cpp
  • Printing/cpp/SampleConfiguration.cpp
  • ProximitySensor/cpp/SampleConfiguration.cpp
  • ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.cpp
  • ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.cpp
  • RadialController/cpp/SampleConfiguration.cpp
  • RelativeInclinometer/cpp/SampleConfiguration.cpp
  • ResizeAppView/cpp/SampleConfiguration.cpp
  • SemanticTextQuery/cpp/SampleConfiguration.cpp
  • ShareSource/cpp/SampleConfiguration.cpp
  • SimpleCommunication/cpp/SampleConfiguration.cpp
  • SimpleInk/cpp/SampleConfiguration.cpp
  • SimpleOrientationSensor/cpp/SampleConfiguration.cpp
  • SmartCard/cpp/SampleConfiguration.cpp
  • SpatialSound/cpp/SampleConfiguration.cpp
  • SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp
  • Store/cpp/SampleConfiguration.cpp
  • StreamSocket/cpp/SampleConfiguration.cpp
  • Syndication/cpp/SampleConfiguration.cpp
  • TextSegmentation/cpp/SampleConfiguration.cpp
  • TextSuggestion/cpp/SampleConfiguration.cpp
  • TitleBar/cpp/SampleConfiguration.cpp
  • TouchKeyboardTextInput/cpp/SampleConfiguration.cpp
  • UserConsentVerifier/cpp/SampleConfiguration.cpp
  • UserDataAccountManager/cpp/SampleConfiguration.cpp
  • UserInteractionMode/cpp/SampleConfiguration.cpp
  • WebAccountManagement/cpp/SampleConfiguration.cpp
  • WebAuthenticationBroker/cpp/SampleConfiguration.cpp
  • WebSocket/cpp/SampleConfiguration.cpp
  • WiFiDirect/cpp/SampleConfiguration.cpp
  • WiFiDirectServices/cpp/SampleConfiguration.cpp
  • WiFiScan/cpp/SampleConfiguration.cpp
  • WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp
  • WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp
  • XamlAnimatedGif/cpp/SampleConfiguration.cpp
  • XamlBind/cpp/MainPage.xaml.cpp
  • XamlBind/cpp/SampleConfiguration.cpp
  • XamlBottomUpList/cpp/SampleConfiguration.cpp
  • XamlCloudFontIntegration/cpp/SampleConfiguration.cpp
  • XamlCommanding/cpp/SampleConfiguration.cpp
  • XamlContextMenu/cpp/SampleConfiguration.cpp
  • XamlDragAndDrop/cpp/SampleConfiguration.cpp
  • XmlLite/cpp/SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPageSizeChangedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MainPageSizeChangedEventArgs
Properties | Private Attributes

MainPageSizeChangedEventArgs Class Reference

List of all members.

Properties

double | Width [get, set]

Private Attributes

double | width

Detailed Description

Definition at line 50 of file SampleConfiguration.cs.

Member Data Documentation

double width [private]

Definition at line 52 of file SampleConfiguration.cs.

Property Documentation

double Width [get, set]

Definition at line 55 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • SplashScreen/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ManipulationInputProcessor Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ManipulationInputProcessor
Public Member Functions | Private Member Functions | Private Attributes

ManipulationInputProcessor Class Reference

List of all members.

Public Member Functions

ManipulationInputProcessor (GestureRecognizer gestureRecognizer, UIElement target, UIElement referenceFrame)
void | InitializeTransforms ()
void | LockToXAxis ()
void | LockToYAxis ()
void | MoveOnXAndYAxes ()
void | Reset ()
void | UseInertia (bool inertia)

Private Member Functions

GestureSettings | GenerateDefaultSettings ()
void | OnManipulationCompleted (object sender, ManipulationCompletedEventArgs e)
void | OnManipulationInertiaStarting (object sender, ManipulationInertiaStartingEventArgs e)
void | OnManipulationStarted (object sender, ManipulationStartedEventArgs e)
void | OnManipulationUpdated (object sender, ManipulationUpdatedEventArgs e)
void | OnPointerCanceled (object sender, PointerRoutedEventArgs args)
void | OnPointerMoved (object sender, PointerRoutedEventArgs args)
void | OnPointerPressed (object sender, PointerRoutedEventArgs args)
void | OnPointerReleased (object sender, PointerRoutedEventArgs args)

Private Attributes

TransformGroup | cumulativeTransform
CompositeTransform | deltaTransform
UIElement | element
MatrixTransform | previousTransform
GestureRecognizer | recognizer
UIElement | reference

Detailed Description

Definition at line 86 of file 5-GestureRecognizer.xaml.cs.

Constructor & Destructor Documentation

ManipulationInputProcessor | ( | GestureRecognizer | gestureRecognizer,
 |  | UIElement | target,
 |  | UIElement | referenceFrame |
 | ) |  |  | [inline]

Definition at line 95 of file 5-GestureRecognizer.xaml.cs.

        {
            recognizer = gestureRecognizer;
            element = target;
            reference = referenceFrame;

            // Initialize the transforms that will be used to manipulate the shape
            InitializeTransforms();

            // The GestureSettings property dictates what manipulation events the
            // Gesture Recognizer will listen to.  This will set it to a limited
            // subset of these events.
            recognizer.GestureSettings = GenerateDefaultSettings();

            // Set up pointer event handlers. These receive input events that are used by the gesture recognizer.
            element.PointerPressed += OnPointerPressed;
            element.PointerMoved += OnPointerMoved;
            element.PointerReleased += OnPointerReleased;
            element.PointerCanceled += OnPointerCanceled;

            // Set up event handlers to respond to gesture recognizer output
            recognizer.ManipulationStarted += OnManipulationStarted;
            recognizer.ManipulationUpdated += OnManipulationUpdated;
            recognizer.ManipulationCompleted += OnManipulationCompleted;
            recognizer.ManipulationInertiaStarting += OnManipulationInertiaStarting;
        }

Member Function Documentation

GestureSettings GenerateDefaultSettings ( ) [inline, private]

Definition at line 135 of file 5-GestureRecognizer.xaml.cs.

        {
            return GestureSettings.ManipulationTranslateX |
                GestureSettings.ManipulationTranslateY |
                GestureSettings.ManipulationRotate |
                GestureSettings.ManipulationTranslateInertia |
                GestureSettings.ManipulationRotateInertia;
        }

void InitializeTransforms ( ) [inline]

Definition at line 122 of file 5-GestureRecognizer.xaml.cs.

        {
            cumulativeTransform = new TransformGroup();
            deltaTransform = new CompositeTransform();
            previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };

            cumulativeTransform.Children.Add(previousTransform);
            cumulativeTransform.Children.Add(deltaTransform);

            element.RenderTransform = cumulativeTransform;
        }

void LockToXAxis ( ) [inline]

Definition at line 224 of file 5-GestureRecognizer.xaml.cs.

        {
            recognizer.CompleteGesture();
            recognizer.GestureSettings |= GestureSettings.ManipulationTranslateY | GestureSettings.ManipulationTranslateX;
            recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateY;
        }

void LockToYAxis ( ) [inline]

Definition at line 232 of file 5-GestureRecognizer.xaml.cs.

        {
            recognizer.CompleteGesture();
            recognizer.GestureSettings |= GestureSettings.ManipulationTranslateY | GestureSettings.ManipulationTranslateX;
            recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateX;
        }

void MoveOnXAndYAxes ( ) [inline]

Definition at line 240 of file 5-GestureRecognizer.xaml.cs.

        {
            recognizer.CompleteGesture();
            recognizer.GestureSettings |= GestureSettings.ManipulationTranslateX | GestureSettings.ManipulationTranslateY;
        }

void OnManipulationCompleted | ( | object | sender,
 |  | ManipulationCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 217 of file 5-GestureRecognizer.xaml.cs.

        {
            Border b = element as Border;
            b.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
        }

void OnManipulationInertiaStarting | ( | object | sender,
 |  | ManipulationInertiaStartingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 210 of file 5-GestureRecognizer.xaml.cs.

        {
            Border b = element as Border;
            b.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
        }

void OnManipulationStarted | ( | object | sender,
 |  | ManipulationStartedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 185 of file 5-GestureRecognizer.xaml.cs.

        {
            Border b = element as Border;
            b.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
        }

void OnManipulationUpdated | ( | object | sender,
 |  | ManipulationUpdatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 192 of file 5-GestureRecognizer.xaml.cs.

        {
            previousTransform.Matrix = cumulativeTransform.Value;

            // Get the center point of the manipulation for rotation
            Point center = new Point(e.Position.X, e.Position.Y);
            deltaTransform.CenterX = center.X;
            deltaTransform.CenterY = center.Y;

            // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
            // the rotation, X, and Y changes
            deltaTransform.Rotation = e.Delta.Rotation;
            deltaTransform.TranslateX = e.Delta.Translation.X;
            deltaTransform.TranslateY = e.Delta.Translation.Y;
        }

void OnPointerCanceled | ( | object | sender,
 |  | PointerRoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 177 of file 5-GestureRecognizer.xaml.cs.

        {
            recognizer.CompleteGesture();
            element.ReleasePointerCapture(args.Pointer);
        }

void OnPointerMoved | ( | object | sender,
 |  | PointerRoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 158 of file 5-GestureRecognizer.xaml.cs.

        {
            // Feed the set of points into the gesture recognizer as a move event
            recognizer.ProcessMoveEvents(args.GetIntermediatePoints(reference));
        }

void OnPointerPressed | ( | object | sender,
 |  | PointerRoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 146 of file 5-GestureRecognizer.xaml.cs.

        {
            // Set the pointer capture to the element being interacted with so that only it
            // will fire pointer-related events
            element.CapturePointer(args.Pointer);

            // Feed the current point into the gesture recognizer as a down event
            recognizer.ProcessDownEvent(args.GetCurrentPoint(reference));
        }

void OnPointerReleased | ( | object | sender,
 |  | PointerRoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 166 of file 5-GestureRecognizer.xaml.cs.

        {
            // Feed the current point into the gesture recognizer as an up event
            recognizer.ProcessUpEvent(args.GetCurrentPoint(reference));

            // Release the pointer
            element.ReleasePointerCapture(args.Pointer);
        }

void Reset ( ) [inline]

Definition at line 260 of file 5-GestureRecognizer.xaml.cs.

        {
            element.RenderTransform = null;
            recognizer.CompleteGesture();
            InitializeTransforms();
            recognizer.GestureSettings = GenerateDefaultSettings();
        }

void UseInertia ( bool inertia ) [inline]

Definition at line 247 of file 5-GestureRecognizer.xaml.cs.

        {
            if (!inertia)
            {
                recognizer.CompleteGesture();
                recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateInertia | GestureSettings.ManipulationRotateInertia;
            }
            else
            {
                recognizer.GestureSettings |= GestureSettings.ManipulationTranslateInertia | GestureSettings.ManipulationRotateInertia;
            }
        }

Member Data Documentation

TransformGroup cumulativeTransform [private]

Definition at line 91 of file 5-GestureRecognizer.xaml.cs.

CompositeTransform deltaTransform [private]

Definition at line 93 of file 5-GestureRecognizer.xaml.cs.

UIElement element [private]

Definition at line 89 of file 5-GestureRecognizer.xaml.cs.

MatrixTransform previousTransform [private]

Definition at line 92 of file 5-GestureRecognizer.xaml.cs.

GestureRecognizer recognizer [private]

Definition at line 88 of file 5-GestureRecognizer.xaml.cs.

UIElement reference [private]

Definition at line 90 of file 5-GestureRecognizer.xaml.cs.

The documentation for this class was generated from the following files:
  • BasicInput/cs/5-GestureRecognizer.xaml.cs
  • BasicInput/cpp/5-GestureRecognizer.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaCapturePreviewer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MediaCapturePreviewer
Public Member Functions | Properties | Private Member Functions | Private Attributes

MediaCapturePreviewer Class Reference

List of all members.

Public Member Functions

MediaCapturePreviewer (CaptureElement previewControl, CoreDispatcher dispatcher)
async Task | CleanupCameraAsync ()
async Task | InitializeCameraAsync ()
async Task | SetMediaStreamPropertiesAsync (MediaStreamType streamType, IMediaEncodingProperties encodingProperties)

Properties

bool | IsPreviewing [get, set]
bool | IsRecording [get, set]
MediaCapture | MediaCapture [get, set]

Private Member Functions

void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs e)

Private Attributes

CoreDispatcher | _dispatcher
CaptureElement | _previewControl

Detailed Description

Definition at line 39 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

MediaCapturePreviewer | ( | CaptureElement | previewControl,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 44 of file SampleConfiguration.cs.

        {
            _previewControl = previewControl;
            _dispatcher = dispatcher;
        }

Member Function Documentation

async Task CleanupCameraAsync ( ) [inline]

Definition at line 94 of file SampleConfiguration.cs.

        {
            if (IsRecording)
            {
                await MediaCapture.StopRecordAsync();
                IsRecording = false;
            }

            if (IsPreviewing)
            {
                await MediaCapture.StopPreviewAsync();
                IsPreviewing = false;
            }

            _previewControl.Source = null;

            if (MediaCapture != null)
            {
                MediaCapture.Dispose();
                MediaCapture = null;
            }
        }

async Task InitializeCameraAsync ( ) [inline]

Initializes the MediaCapture, starts preview.

Definition at line 74 of file SampleConfiguration.cs.

        {
            MediaCapture = new MediaCapture();
            MediaCapture.Failed += MediaCapture_Failed;

            try
            {
                await MediaCapture.InitializeAsync();
                _previewControl.Source = MediaCapture;
                await MediaCapture.StartPreviewAsync();
                IsPreviewing = true;
            }
            catch (UnauthorizedAccessException)
            {
                // This can happen if access to the camera has been revoked.
                MainPage.Current.NotifyUser("The app was denied access to the camera", NotifyType.ErrorMessage);
                await CleanupCameraAsync();
            }
        }

void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file SampleConfiguration.cs.

        {
            var task = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                MainPage.Current.NotifyUser("Preview stopped: " + e.Message, NotifyType.ErrorMessage);
                IsRecording = false;
                IsPreviewing = false;
                await CleanupCameraAsync();
            });
        }

async Task SetMediaStreamPropertiesAsync | ( | MediaStreamType | streamType,
 |  | IMediaEncodingProperties | encodingProperties |
 | ) |  |  | [inline]

Sets encoding properties on a camera stream.

Ensures CaptureElement and preview stream are stopped before setting properties.

Definition at line 57 of file SampleConfiguration.cs.

        {
            // Stop preview and unlink the CaptureElement from the MediaCapture object
            await MediaCapture.StopPreviewAsync();
            _previewControl.Source = null;

            // Apply desired stream properties
            await MediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, encodingProperties);

            // Recreate the CaptureElement pipeline and restart the preview
            _previewControl.Source = MediaCapture;
            await MediaCapture.StartPreviewAsync();
        }

Member Data Documentation

CoreDispatcher _dispatcher [private]

Definition at line 41 of file SampleConfiguration.cs.

CaptureElement _previewControl [private]

Definition at line 42 of file SampleConfiguration.cs.

Property Documentation

bool IsPreviewing [get, set]

Definition at line 50 of file SampleConfiguration.cs.

bool IsRecording [get, set]

Definition at line 51 of file SampleConfiguration.cs.

MediaCapture MediaCapture [get, set]

Definition at line 52 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • CameraResolution/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaFoundationConstants Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MediaFoundationConstants
Public Types | Static Public Attributes

MediaFoundationConstants Class Reference

Assorted Media Foundation constants from the Windows SDK C headers. More...

List of all members.

Public Types

enum eAVEncH264VLevel {
eAVEncH264VLevel1 = 10, eAVEncH264VLevel1_b = 11, eAVEncH264VLevel1_1 = 11, eAVEncH264VLevel1_2 = 12,
eAVEncH264VLevel1_3 = 13, eAVEncH264VLevel2 = 20, eAVEncH264VLevel2_1 = 21, eAVEncH264VLevel2_2 = 22,
eAVEncH264VLevel3 = 30, eAVEncH264VLevel3_1 = 31, eAVEncH264VLevel3_2 = 32, eAVEncH264VLevel4 = 40,
eAVEncH264VLevel4_1 = 41, eAVEncH264VLevel4_2 = 42, eAVEncH264VLevel5 = 50, eAVEncH264VLevel5_1 = 51,
eAVEncH264VLevel5_2 = 52
}

Static Public Attributes

static readonly Guid MF_MT_VIDEO_LEVEL = new Guid("{96F66574-11C5-4015-8666-BFF516436DA7}")

Detailed Description

Definition at line 18 of file MediaFoundationConstants.cs.

Member Enumeration Documentation

enum eAVEncH264VLevel
Enumerator:
eAVEncH264VLevel1
eAVEncH264VLevel1_b
eAVEncH264VLevel1_1
eAVEncH264VLevel1_2
eAVEncH264VLevel1_3
eAVEncH264VLevel2
eAVEncH264VLevel2_1
eAVEncH264VLevel2_2
eAVEncH264VLevel3
eAVEncH264VLevel3_1
eAVEncH264VLevel3_2
eAVEncH264VLevel4
eAVEncH264VLevel4_1
eAVEncH264VLevel4_2
eAVEncH264VLevel5
eAVEncH264VLevel5_1
eAVEncH264VLevel5_2

Definition at line 26 of file MediaFoundationConstants.cs.

                                     : UInt32
        {
            eAVEncH264VLevel1 = 10,
            eAVEncH264VLevel1_b = 11,
            eAVEncH264VLevel1_1 = 11,
            eAVEncH264VLevel1_2 = 12,
            eAVEncH264VLevel1_3 = 13,
            eAVEncH264VLevel2 = 20,
            eAVEncH264VLevel2_1 = 21,
            eAVEncH264VLevel2_2 = 22,
            eAVEncH264VLevel3 = 30,
            eAVEncH264VLevel3_1 = 31,
            eAVEncH264VLevel3_2 = 32,
            eAVEncH264VLevel4 = 40,
            eAVEncH264VLevel4_1 = 41,
            eAVEncH264VLevel4_2 = 42,
            eAVEncH264VLevel5 = 50,
            eAVEncH264VLevel5_1 = 51,
            eAVEncH264VLevel5_2 = 52,
        };

Member Data Documentation

readonly Guid MF_MT_VIDEO_LEVEL = new Guid("{96F66574-11C5-4015-8666-BFF516436DA7}") [static]

Definition at line 22 of file MediaFoundationConstants.cs.

The documentation for this class was generated from the following file:
  • MediaTranscoding/cs/MediaFoundationConstants.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MediaModel
Public Member Functions | Properties

MediaModel Class Reference

List of all members.

Public Member Functions

MediaModel (Uri mediaUri)

Properties

Uri | ArtUri [get, set]
MediaPlaybackItem | MediaPlaybackItem [get, set]
string | Title [get, set]

Detailed Description

Definition at line 253 of file Scenario6_PlayingVideoLists.xaml.cs.

Constructor & Destructor Documentation

MediaModel ( Uri mediaUri ) [inline]

Definition at line 255 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            MediaPlaybackItem = new MediaPlaybackItem(MediaSource.CreateFromUri(mediaUri));
        }

Property Documentation

Uri ArtUri [get, set]

Definition at line 261 of file Scenario6_PlayingVideoLists.xaml.cs.

MediaPlaybackItem MediaPlaybackItem [get, set]

Definition at line 262 of file Scenario6_PlayingVideoLists.xaml.cs.

string Title [get, set]

Definition at line 260 of file Scenario6_PlayingVideoLists.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlayback/cs/Scenario6_PlayingVideoLists.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MeteringData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MeteringData
Public Member Functions | Public Attributes

MeteringData Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MeteringData ()
async void | button_Click_StartMetering (Object sender, RoutedEventArgs e)
async void | button_Click_StopMetering (Object sender, RoutedEventArgs e)
void | slider_ValueChanged (Object sender, RangeBaseValueChangedEventArgs e)

Public Attributes

ServiceViewModel ViewModel

Detailed Description

Definition at line 13 of file Scenario1_MeteringData.xaml.cs.

Constructor & Destructor Documentation

MeteringData ( ) [inline]

Definition at line 17 of file Scenario1_MeteringData.xaml.cs.

        {
            InitializeComponent();
            ViewModel = ServiceViewModel.Current;
        }

Member Function Documentation

async void button_Click_StartMetering | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 22 of file Scenario1_MeteringData.xaml.cs.

        {
            await ViewModel.StartMetering((int)SamplePeriodSlider.Value);
        }

async void button_Click_StopMetering | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 27 of file Scenario1_MeteringData.xaml.cs.

        {
            await ViewModel.StopMetering();
        }

void slider_ValueChanged | ( | Object | sender,
 |  | RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 32 of file Scenario1_MeteringData.xaml.cs.

        {
            // Ignore slider value changes prior to ViewModel initialization.
            if (ViewModel != null)
            {
                // Update the sample period in response to slider change.
                ViewModel.SetSamplePeriod((int)SamplePeriodSlider.Value);
            }
        }

Member Data Documentation

ServiceViewModel ViewModel

Definition at line 15 of file Scenario1_MeteringData.xaml.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/Scenario1_MeteringData.xaml.cs
  • CustomCapability/cpp/Scenario1_MeteringData.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MEUserControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MEUserControl
Public Member Functions

MEUserControl Class Reference

List of all members.

Public Member Functions

MEUserControl ()

Detailed Description

Definition at line 19 of file MEUserControl.xaml.cs.

Constructor & Destructor Documentation

MEUserControl ( ) [inline]

Definition at line 21 of file MEUserControl.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/MEUserControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveContentModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Models
  • AdaptiveContentModel
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions

AdaptiveContentModel Class Reference

A list of manifest URLs, both HLS and DASH; clear, encrypted and PlayReady; VOD and Live. More...

List of all members.

Public Member Functions

override string | ToString ()

Static Public Member Functions

static IReadOnlyList
< AdaptiveContentModel > 		GetKnownAzureMediaServicesModels ()

Public Attributes

bool | Aes = false
string | AesToken = ""
string | Captions
string | DisplayName
int | Id
bool | Live = false
Uri | ManifestUri
bool | PlayReady = false
string | Subtitles

Static Public Attributes

static List< AdaptiveContentModel > | knownAzureMediaServiceModels

Private Member Functions

AdaptiveContentModel (int id, string displayName, string manifestUri)

Detailed Description

These are hosted by Azure Media Services, and could expire without notice.

It is left to the users of this sample to replace or update this list as needed.

Definition at line 25 of file AdaptiveContentModel.cs.

Constructor & Destructor Documentation

AdaptiveContentModel | ( | int | id,
 |  | string | displayName,
 |  | string | manifestUri |
 | ) |  |  | [inline, private]

Definition at line 38 of file AdaptiveContentModel.cs.

        {
            Id = id;
            DisplayName = displayName;
            ManifestUri = new Uri(manifestUri);
        }

Member Function Documentation

static IReadOnlyList<AdaptiveContentModel> GetKnownAzureMediaServicesModels ( ) [inline, static]

Definition at line 166 of file AdaptiveContentModel.cs.

        {
            return knownAzureMediaServiceModels.AsReadOnly();
        }

override string ToString ( ) [inline]

Definition at line 45 of file AdaptiveContentModel.cs.

        {
            return $"{Id}: {DisplayName}";
        }

Member Data Documentation

bool Aes = false

Definition at line 34 of file AdaptiveContentModel.cs.

string AesToken = ""

Definition at line 35 of file AdaptiveContentModel.cs.

string Captions

Definition at line 33 of file AdaptiveContentModel.cs.

string DisplayName

Definition at line 28 of file AdaptiveContentModel.cs.

int Id

Definition at line 27 of file AdaptiveContentModel.cs.

List<AdaptiveContentModel> knownAzureMediaServiceModels [static]

Definition at line 50 of file AdaptiveContentModel.cs.

bool Live = false

Definition at line 31 of file AdaptiveContentModel.cs.

Uri ManifestUri

Definition at line 29 of file AdaptiveContentModel.cs.

bool PlayReady = false

Definition at line 36 of file AdaptiveContentModel.cs.

string Subtitles

Definition at line 32 of file AdaptiveContentModel.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Models/AdaptiveContentModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MPEUserControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MPEUserControl
Public Member Functions | Private Member Functions | Private Attributes

MPEUserControl Class Reference

List of all members.

Public Member Functions

MPEUserControl ()

Private Member Functions

void | Control_Loaded (object sender, RoutedEventArgs e)
void | Control_Unloaded (object sender, RoutedEventArgs e)
void | FrameStepBackward_Click (object sender, RoutedEventArgs e)
void | FrameStepForward_Click (object sender, RoutedEventArgs e)

Private Attributes

MediaPlayerElement | MPE

Detailed Description

Definition at line 21 of file MPEUserControl.xaml.cs.

Constructor & Destructor Documentation

MPEUserControl ( ) [inline]

Definition at line 24 of file MPEUserControl.xaml.cs.

        {
            this.InitializeComponent();

            MPE = new MediaPlayerElement();
            MPE.AreTransportControlsEnabled = true;
            MPE.AutoPlay = true;

            MPE.HorizontalAlignment = HorizontalAlignment.Stretch;
            MPE.VerticalAlignment = VerticalAlignment.Stretch;
            MPE.MediaPlayer.IsLoopingEnabled = true;
            RootGrid.Children.Add(MPE);
            MPE.SetValue(Grid.RowProperty, 1);
        }

Member Function Documentation

void Control_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file MPEUserControl.xaml.cs.

        {
            Uri uri = new Uri("ms-appx:///Assets/ladybug.wmv");
            MPE.Source = MediaSource.CreateFromUri(uri);
        }

void Control_Unloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file MPEUserControl.xaml.cs.

        {
            MPE.Source = null;
        }

void FrameStepBackward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file MPEUserControl.xaml.cs.

        {
            MPE.MediaPlayer.StepBackwardOneFrame();
        }

void FrameStepForward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file MPEUserControl.xaml.cs.

        {
            MPE.MediaPlayer.StepForwardOneFrame();
        }

Member Data Documentation

MediaPlayerElement MPE [private]

Definition at line 23 of file MPEUserControl.xaml.cs.

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/MPEUserControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleTasks Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • MultipleTasks
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

MultipleTasks Class Reference

List of all members.

Public Member Functions

MultipleTasks ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | BeginExtendedExecution ()
void | ClearExtendedExecution ()
void | EndExtendedExecution ()
Deferral | GetExecutionDeferral ()
void | OnTaskCompleted ()
async void | RaiseToastAfterDelay (int id, int seconds)
async void | SessionRevoked (object sender, ExtendedExecutionRevokedEventArgs args)
void | UpdateUI ()

Private Attributes

CancellationTokenSource | cancellationTokenSource
MainPage rootPage = MainPage.Current
ExtendedExecutionSession | session = null
int | taskCount = 0

Detailed Description

Definition at line 22 of file Scenario4_MultipleTasks.xaml.cs.

Constructor & Destructor Documentation

MultipleTasks ( ) [inline]

Definition at line 30 of file Scenario4_MultipleTasks.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BeginExtendedExecution ( ) [inline, private]

Definition at line 104 of file Scenario4_MultipleTasks.xaml.cs.

        {
            // The previous Extended Execution must be closed before a new one can be requested.
            // This code is redundant here because the sample doesn't allow a new extended
            // execution to begin until the previous one ends, but we leave it here for illustration.
            ClearExtendedExecution();

            var newSession = new ExtendedExecutionSession();
            newSession.Reason = ExtendedExecutionReason.Unspecified;
            newSession.Description = "Running multiple tasks";
            newSession.Revoked += SessionRevoked;
            ExtendedExecutionResult result = await newSession.RequestExtensionAsync();

            switch (result)
            {
                case ExtendedExecutionResult.Allowed:
                    rootPage.NotifyUser("Extended execution allowed.", NotifyType.StatusMessage);
                    session = newSession;
                    break;

                default:
                case ExtendedExecutionResult.Denied:
                    rootPage.NotifyUser("Extended execution denied.", NotifyType.ErrorMessage);
                    newSession.Dispose();
                    break;
            }
            UpdateUI();

            if (session != null)
            {
                cancellationTokenSource = new CancellationTokenSource();

                // Start up a few tasks that all share this session.
                using (var deferral = GetExecutionDeferral())
                {
                    var random = new Random();
                    for (int i = 0; i < 3; i++)
                    {
                        RaiseToastAfterDelay(i, random.Next(5, 10));
                    }
                }
            }
        }

void ClearExtendedExecution ( ) [inline, private]

Definition at line 42 of file Scenario4_MultipleTasks.xaml.cs.

        {
            // Cancel any outstanding tasks.
            if (cancellationTokenSource != null)
            {
                // Save a copy of cancellationTokenSource because the call
                // to cancellationTokenSource.Cancel() will cause other code
                // to run, which might in turn call ClearExtendedExecution.
                var localCancellationTokenSource = cancellationTokenSource;
                cancellationTokenSource = null;

                localCancellationTokenSource.Cancel();
                localCancellationTokenSource.Dispose();
            }

            // Dispose any outstanding session.
            if (session != null)
            {
                session.Revoked -= SessionRevoked;
                session.Dispose();
                session = null;
            }
        }

void EndExtendedExecution ( ) [inline, private]

Definition at line 164 of file Scenario4_MultipleTasks.xaml.cs.

        {
            ClearExtendedExecution();
            UpdateUI();
        }

Deferral GetExecutionDeferral ( ) [inline, private]

Definition at line 93 of file Scenario4_MultipleTasks.xaml.cs.

        {
            if (session == null)
            {
                throw new InvalidOperationException("No extended execution session is active");
            }

            taskCount++;
            return new Deferral(OnTaskCompleted);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario4_MultipleTasks.xaml.cs.

        {
            // End the Extended Execution Session.
            // Only one extended execution session can be held by an application at one time.
            ClearExtendedExecution();
        }

void OnTaskCompleted ( ) [inline, private]

Definition at line 83 of file Scenario4_MultipleTasks.xaml.cs.

        {
            taskCount--;
            if (taskCount == 0 && session != null)
            {
                EndExtendedExecution();
                MainPage.DisplayToast("All Tasks Completed, ending Extended Execution.");
            }
        }

void RaiseToastAfterDelay | ( | int | id,
 |  | int | seconds |
 | ) |  |  | [inline, private]

Definition at line 148 of file Scenario4_MultipleTasks.xaml.cs.

        {
            using (var deferral = GetExecutionDeferral())
            {
                try
                {
                    await Task.Delay(seconds * 1000, cancellationTokenSource.Token);
                    MainPage.DisplayToast($"Task {id} completed after {seconds} seconds");
                }
                catch (TaskCanceledException)
                {
                    MainPage.DisplayToast($"Task {id} canceled");
                }
            }
        }

async void SessionRevoked | ( | object | sender,
 |  | ExtendedExecutionRevokedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 170 of file Scenario4_MultipleTasks.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (args.Reason)
                {
                    case ExtendedExecutionRevokedReason.Resumed:
                        rootPage.NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType.StatusMessage);
                        break;

                    case ExtendedExecutionRevokedReason.SystemPolicy:
                        rootPage.NotifyUser("Extended execution revoked due to system policy.", NotifyType.StatusMessage);
                        break;
                }

                ClearExtendedExecution();
            });
        }

void UpdateUI ( ) [inline, private]

Definition at line 66 of file Scenario4_MultipleTasks.xaml.cs.

        {
            if (session == null)
            {
                Status.Text = "Not requested";
                RequestButton.IsEnabled = true;
                CloseButton.IsEnabled = false;

            }
            else
            {
                Status.Text = "Requested";
                RequestButton.IsEnabled = false;
                CloseButton.IsEnabled = true;
            }
        }

Member Data Documentation

CancellationTokenSource cancellationTokenSource [private]

Definition at line 27 of file Scenario4_MultipleTasks.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario4_MultipleTasks.xaml.cs.

ExtendedExecutionSession session = null [private]

Definition at line 26 of file Scenario4_MultipleTasks.xaml.cs.

int taskCount = 0 [private]

Definition at line 28 of file Scenario4_MultipleTasks.xaml.cs.

The documentation for this class was generated from the following files:
  • ExtendedExecution/cs/Scenario4_MultipleTasks.xaml.cs
  • ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NegatingBoolConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • NegatingBoolConverter
Public Member Functions

NegatingBoolConverter Class Reference

A value converter which negates a bool. More...

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

This converter is used for the color sliders to bind their enabled state to the negation of the selection state of the default logo radio button.

Definition at line 96 of file ShareApplicationLink.xaml.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 98 of file ShareApplicationLink.xaml.cs.

        {
            return !(bool)value;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 103 of file ShareApplicationLink.xaml.cs.

        {
            return !(bool)value;
        }

The documentation for this class was generated from the following file:
  • ShareSource/cs/ShareApplicationLink.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrCapturedImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • OcrCapturedImage
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

OcrCapturedImage Class Reference

List of all members.

Public Member Functions

OcrCapturedImage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | Application_Resuming (object sender, object o)
async void | Application_Suspending (object sender, SuspendingEventArgs e)
void | CalculatePreviewRotation (out VideoRotation sourceRotation, out int rotationDegrees)
async void | CameraButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | CleanupCameraAsync ()
async void | DisplayInformation_OrientationChanged (DisplayInformation sender, object args)
async void | ExtractButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async Task | InitializeCameraAsync ()
async void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
void | PreviewImage_SizeChanged (object sender, SizeChangedEventArgs e)
async Task | SetPreviewRotationAsync ()
async Task | StartCameraAsync ()
async Task | StartPreviewAsync ()
async Task | StopPreviewAsync ()
void | UpdateWordBoxTransform ()

Static Private Member Functions

static async Task
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows.Devices.Enumeration.Panel desiredPanel)

Private Attributes

readonly DisplayInformation | displayInformation = DisplayInformation.GetForCurrentView()
readonly DisplayRequest | displayRequest = new DisplayRequest()
bool | externalCamera = false
bool | isInitialized = false
bool | isPreviewing = false
MediaCapture | mediaCapture
bool | mirroringPreview = false
Language | ocrLanguage = new Language("en")
MainPage rootPage = MainPage.Current
List< WordOverlay > | wordBoxes = new List<WordOverlay>()

Static Private Attributes

static readonly Guid | RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 36 of file OcrCapturedImage.xaml.cs.

Constructor & Destructor Documentation

OcrCapturedImage ( ) [inline]

Definition at line 67 of file OcrCapturedImage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Application_Resuming | ( | object | sender,
 |  | object | o |
 | ) |  |  | [inline, private]

Occurs on app resuming.

Initializes camera if available.

Parameters:
sender
o

Definition at line 134 of file OcrCapturedImage.xaml.cs.

        {
            displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;

            await StartCameraAsync();
        }

async void Application_Suspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Occurs on app suspending.

Stops camera if initialized.

Parameters:
sender
e

Definition at line 118 of file OcrCapturedImage.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();

            await CleanupCameraAsync();

            displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;

            deferral.Complete();
        }

void CalculatePreviewRotation | ( | out VideoRotation | sourceRotation,
 |  | out int | rotationDegrees |
 | ) |  |  | [inline, private]

Reads the current orientation of the app and calculates the VideoRotation necessary to ensure the preview is rendered in the correct orientation.

Parameters:
sourceRotation | The rotation value to use in MediaCapture.SetPreviewRotation.
rotationDegrees | The accompanying rotation metadata with which to tag the preview stream.

Definition at line 531 of file OcrCapturedImage.xaml.cs.

        {
            // Note that in some cases, the rotation direction needs to be inverted if the preview is being mirrored.

            switch (displayInformation.CurrentOrientation)
            {
                case DisplayOrientations.Portrait:
                    if (mirroringPreview)
                    {
                        rotationDegrees = 270;
                        sourceRotation = VideoRotation.Clockwise270Degrees;
                    }
                    else
                    {
                        rotationDegrees = 90;
                        sourceRotation = VideoRotation.Clockwise90Degrees;
                    }
                    break;

                case DisplayOrientations.LandscapeFlipped:
                    // No need to invert this rotation, as rotating 180 degrees is the same either way.
                    rotationDegrees = 180;
                    sourceRotation = VideoRotation.Clockwise180Degrees;
                    break;

                case DisplayOrientations.PortraitFlipped:
                    if (mirroringPreview)
                    {
                        rotationDegrees = 90;
                        sourceRotation = VideoRotation.Clockwise90Degrees;
                    }
                    else
                    {
                        rotationDegrees = 270;
                        sourceRotation = VideoRotation.Clockwise270Degrees;
                    }
                    break;

                case DisplayOrientations.Landscape:
                default:
                    rotationDegrees = 0;
                    sourceRotation = VideoRotation.None;
                    break;
            }
        }

async void CameraButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is event handler for 'Camera' button.

Clears previous OCR results and starts camera.

Parameters:
sender
e

Definition at line 259 of file OcrCapturedImage.xaml.cs.

        {
            await StartCameraAsync();
        }

task< void > CleanupCameraAsync ( ) [inline, private]

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.

Definition at line 485 of file OcrCapturedImage.xaml.cs.

        {
            if (isInitialized)
            {
                if (isPreviewing)
                {
                    // The call to stop the preview is included here for completeness, but can be
                    // safely removed if a call to MediaCapture.Dispose() is being made later,
                    // as the preview will be automatically stopped at that point
                    await StopPreviewAsync();
                }

                isInitialized = false;
            }

            if (mediaCapture != null)
            {
                mediaCapture.Failed -= MediaCapture_Failed;
                mediaCapture.Dispose();
                mediaCapture = null;
            }
        }

async void DisplayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Occurs when display orientation changes.

Sets camera rotation preview.

Parameters:
sender
args

Definition at line 147 of file OcrCapturedImage.xaml.cs.

        {
            if (isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

async void ExtractButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is event handler for 'Extract' button.

Captures image from camera ,recognizes text and displays it.

Parameters:
sender
e

Definition at line 161 of file OcrCapturedImage.xaml.cs.

        {
            //Get information about the preview.
            var previewProperties = mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
            int videoFrameWidth = (int)previewProperties.Width;
            int videoFrameHeight = (int)previewProperties.Height;

            // In portrait modes, the width and height must be swapped for the VideoFrame to have the correct aspect ratio and avoid letterboxing / black bars.
            if (!externalCamera && (displayInformation.CurrentOrientation == DisplayOrientations.Portrait || displayInformation.CurrentOrientation == DisplayOrientations.PortraitFlipped))
            {
                videoFrameWidth = (int)previewProperties.Height;
                videoFrameHeight = (int)previewProperties.Width;
            }

            // Create the video frame to request a SoftwareBitmap preview frame.
            var videoFrame = new VideoFrame(BitmapPixelFormat.Bgra8, videoFrameWidth, videoFrameHeight);

            // Capture the preview frame.
            using (var currentFrame = await mediaCapture.GetPreviewFrameAsync(videoFrame))
            {
                // Collect the resulting frame.
                SoftwareBitmap bitmap = currentFrame.SoftwareBitmap;

                OcrEngine ocrEngine = OcrEngine.TryCreateFromLanguage(ocrLanguage);

                if (ocrEngine == null)
                {
                    rootPage.NotifyUser(ocrLanguage.DisplayName + " is not supported.", NotifyType.ErrorMessage);

                    return;
                }

                var imgSource = new WriteableBitmap(bitmap.PixelWidth, bitmap.PixelHeight);
                bitmap.CopyToBuffer(imgSource.PixelBuffer);
                PreviewImage.Source = imgSource;

                var ocrResult = await ocrEngine.RecognizeAsync(bitmap);

                // Used for text overlay.
                // Prepare scale transform for words since image is not displayed in original format.
                var scaleTrasform = new ScaleTransform
                {
                    CenterX = 0,
                    CenterY = 0,
                    ScaleX = PreviewControl.ActualWidth / bitmap.PixelWidth,
                    ScaleY = PreviewControl.ActualHeight / bitmap.PixelHeight
                };

                if (ocrResult.TextAngle != null)
                {
                    // If text is detected under some angle in this sample scenario we want to
                    // overlay word boxes over original image, so we rotate overlay boxes.
                    TextOverlay.RenderTransform = new RotateTransform
                    {
                        Angle = (double)ocrResult.TextAngle,
                        CenterX = PreviewImage.ActualWidth / 2,
                        CenterY = PreviewImage.ActualHeight / 2
                    };
                }

                // Iterate over recognized lines of text.
                foreach (var line in ocrResult.Lines)
                {
                    // Iterate over words in line.
                    foreach (var word in line.Words)
                    {
                        WordOverlay wordBoxOverlay = new WordOverlay(word);

                        // Keep references to word boxes.
                        wordBoxes.Add(wordBoxOverlay);

                        // Create a box with the word inside it.
                        var textBlock = new TextBlock()
                        {
                            Text = word.Text,
                            Style = ExtractedWordTextStyle
                        };
                        TextOverlay.Children.Add(wordBoxOverlay.CreateBorder(HighlightedWordBoxHorizontalLineStyle, textBlock));
                    }
                }

                rootPage.NotifyUser("Image processed using " + ocrEngine.RecognizerLanguage.DisplayName + " language.", NotifyType.StatusMessage);
            }

            UpdateWordBoxTransform();

            PreviewControl.Visibility = Visibility.Collapsed;
            Image.Visibility = Visibility.Visible;
            ExtractButton.Visibility = Visibility.Collapsed;
            CameraButton.Visibility = Visibility.Visible;
        }

static async Task<DeviceInformation> FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) [inline, static, private]

Queries the available video capture devices to try and find one mounted on the desired panel.

Parameters:
desiredPanel The panel on the device that the desired camera is mounted on.
Returns:
A DeviceInformation instance with a reference to the camera mounted on the desired panel if available, any other camera if not, or null if no camera is available.

Definition at line 514 of file OcrCapturedImage.xaml.cs.

        {
            // Get available devices for capturing pictures.
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            // Get the desired camera by panel.
            DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);

            // If there is no device mounted on the desired panel, return the first device found.
            return desiredDevice ?? allVideoDevices.FirstOrDefault();
        }

task< void > InitializeCameraAsync ( ) [inline, private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.

Definition at line 340 of file OcrCapturedImage.xaml.cs.

        {
            if (mediaCapture == null)
            {
                // Attempt to get the back camera if one is available, but use any camera device if not.
                var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);

                if (cameraDevice == null)
                {
                    rootPage.NotifyUser("No camera device!", NotifyType.ErrorMessage);

                    return;
                }

                // Create MediaCapture and its settings.
                mediaCapture = new MediaCapture();

                // Register for a notification when something goes wrong
                mediaCapture.Failed += MediaCapture_Failed;

                var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };

                // Initialize MediaCapture
                try
                {
                    await mediaCapture.InitializeAsync(settings);
                    isInitialized = true;
                }
                catch (UnauthorizedAccessException)
                {
                    rootPage.NotifyUser("Denied access to the camera.", NotifyType.ErrorMessage);
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Exception when init MediaCapture. " + ex.Message, NotifyType.ErrorMessage);
                }

                // If initialization succeeded, start the preview.
                if (isInitialized)
                {
                    // Figure out where the camera is located
                    if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
                    {
                        // No information on the location of the camera, assume it's an external camera, not integrated on the device.
                        externalCamera = true;
                    }
                    else
                    {
                        // Camera is fixed on the device.
                        externalCamera = false;

                        // Only mirror the preview if the camera is on the front panel.
                        mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
                    }

                    await StartPreviewAsync();
                }
            }
        }

async void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Handles MediaCapture failures.

Cleans up the camera resources.

Parameters:
sender
errorEventArgs

Definition at line 582 of file OcrCapturedImage.xaml.cs.

        {
            await CleanupCameraAsync();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ExtractButton.Visibility = Visibility.Collapsed;
                CameraButton.Visibility = Visibility.Visible;

                rootPage.NotifyUser("MediaCapture Failed. " + errorEventArgs.Message, NotifyType.ErrorMessage);
            });
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Ckecks if English language is available for OCR on device and starts camera preview..

Parameters:
e

Definition at line 77 of file OcrCapturedImage.xaml.cs.

        {
            displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;

            // Useful to know when to initialize/clean up the camera
            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming += Application_Resuming;

            if (!OcrEngine.IsLanguageSupported(ocrLanguage))
            {
                rootPage.NotifyUser(ocrLanguage.DisplayName + " is not supported.", NotifyType.ErrorMessage);

                return;
            }

            await StartCameraAsync();

            // Update buttons visibility.
            ExtractButton.Visibility = isInitialized ? Visibility.Visible : Visibility.Collapsed;
            CameraButton.Visibility = isInitialized ? Visibility.Collapsed : Visibility.Visible;
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Stops camera if initialized.

Parameters:
e

Definition at line 104 of file OcrCapturedImage.xaml.cs.

        {
            displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
            Application.Current.Suspending -= Application_Suspending;
            Application.Current.Resuming -= Application_Resuming;

            await CleanupCameraAsync();
        }

void PreviewImage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Occurs when displayed image size changes.

Parameters:
sender
e

Definition at line 295 of file OcrCapturedImage.xaml.cs.

        {
            UpdateWordBoxTransform();

            // Update image rotation center.
            var rotate = TextOverlay.RenderTransform as RotateTransform;
            if (rotate != null)
            {
                rotate.CenterX = PreviewImage.ActualWidth / 2;
                rotate.CenterY = PreviewImage.ActualHeight / 2;
            }
        }

task< void > SetPreviewRotationAsync ( ) [inline, private]

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.

Definition at line 433 of file OcrCapturedImage.xaml.cs.

        {
            // Only need to update the orientation if the camera is mounted on the device.
            if (externalCamera) return;

            // Calculate which way and how far to rotate the preview.
            int rotationDegrees;
            VideoRotation sourceRotation;
            CalculatePreviewRotation(out sourceRotation, out rotationDegrees);

            // Set preview rotation in the preview source.
            mediaCapture.SetPreviewRotation(sourceRotation);

            // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
            var props = mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
            props.Properties.Add(RotationKey, rotationDegrees);
            await mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
        }

task< void > StartCameraAsync ( ) [inline, private]

Starts the camera.

Initializes resources and starts preview.

Definition at line 313 of file OcrCapturedImage.xaml.cs.

        {
            if (!isInitialized)
            {
                await InitializeCameraAsync();
            }

            if (isInitialized)
            {
                TextOverlay.Children.Clear();
                wordBoxes.Clear();

                PreviewImage.Source = null;

                PreviewControl.Visibility = Visibility.Visible;
                Image.Visibility = Visibility.Collapsed;

                ExtractButton.Visibility = Visibility.Visible;
                CameraButton.Visibility = Visibility.Collapsed;

                rootPage.NotifyUser("Camera started.", NotifyType.StatusMessage);
            }
        }

task< void > StartPreviewAsync ( ) [inline, private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.

Definition at line 403 of file OcrCapturedImage.xaml.cs.

        {
            // Prevent the device from sleeping while the preview is running.
            displayRequest.RequestActive();

            // Set the preview source in the UI and mirror it if necessary.
            PreviewControl.Source = mediaCapture;
            PreviewControl.FlowDirection = mirroringPreview ? Windows.UI.Xaml.FlowDirection.RightToLeft : Windows.UI.Xaml.FlowDirection.LeftToRight;

            // Start the preview.
            try
            {
                await mediaCapture.StartPreviewAsync();
                isPreviewing = true;
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Exception starting preview." + ex.Message, NotifyType.ErrorMessage);
            }

            // Initialize the preview to the current orientation.
            if (isPreviewing)
            {
                await SetPreviewRotationAsync();
            }
        }

task< void > StopPreviewAsync ( ) [inline, private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI.

Returns:

Definition at line 456 of file OcrCapturedImage.xaml.cs.

        {
            try
            {
                isPreviewing = false;
                await mediaCapture.StopPreviewAsync();
            }
            catch (Exception ex)
            {
                // Use the dispatcher because this method is sometimes called from non-UI threads.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Exception stopping preview. " + ex.Message, NotifyType.ErrorMessage);
                });
            }

            // Use the dispatcher because this method is sometimes called from non-UI threads.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PreviewControl.Source = null;

                // Allow the device to sleep now that the preview is stopped.
                displayRequest.RequestRelease();
            });
        }

void UpdateWordBoxTransform ( ) [inline, private]

Update word box transform to match current UI size.

Definition at line 267 of file OcrCapturedImage.xaml.cs.

        {
            WriteableBitmap bitmap = PreviewImage.Source as WriteableBitmap;

            if (bitmap != null)
            {
                // Used for text overlay.
                // Prepare scale transform for words since image is not displayed in original size.
                ScaleTransform scaleTransform = new ScaleTransform
                {
                    CenterX = 0,
                    CenterY = 0,
                    ScaleX = PreviewImage.ActualWidth / bitmap.PixelWidth,
                    ScaleY = PreviewImage.ActualHeight / bitmap.PixelHeight
                };

                foreach (var item in wordBoxes)
                {
                    item.Transform(scaleTransform);
                }
            }
        }

Member Data Documentation

readonly DisplayInformation displayInformation = DisplayInformation.GetForCurrentView() [private]

Definition at line 49 of file OcrCapturedImage.xaml.cs.

readonly DisplayRequest displayRequest = new DisplayRequest() [private]

Definition at line 56 of file OcrCapturedImage.xaml.cs.

bool externalCamera = false [private]

Definition at line 65 of file OcrCapturedImage.xaml.cs.

bool isInitialized = false [private]

Definition at line 60 of file OcrCapturedImage.xaml.cs.

bool isPreviewing = false [private]

Definition at line 61 of file OcrCapturedImage.xaml.cs.

MediaCapture mediaCapture [private]

Definition at line 59 of file OcrCapturedImage.xaml.cs.

bool mirroringPreview = false [private]

Definition at line 64 of file OcrCapturedImage.xaml.cs.

Language ocrLanguage = new Language("en") [private]

Definition at line 43 of file OcrCapturedImage.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 40 of file OcrCapturedImage.xaml.cs.

readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 53 of file OcrCapturedImage.xaml.cs.

List<WordOverlay> wordBoxes = new List<WordOverlay>() [private]

Definition at line 46 of file OcrCapturedImage.xaml.cs.

The documentation for this class was generated from the following files:
  • OCR/cs/OcrCapturedImage.xaml.cs
  • OCR/cpp/OcrCapturedImage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrFileImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • OcrFileImage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OcrFileImage Class Reference

List of all members.

Public Member Functions

OcrFileImage ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearResults ()
async void | ExtractButton_Click (object sender, RoutedEventArgs e)
void | LanguageList_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | LoadButton_Click (object sender, RoutedEventArgs e)
async Task | LoadImageAsync (StorageFile file)
async Task | LoadSampleImageAsync ()
void | PreviewImage_SizeChanged (object sender, SizeChangedEventArgs e)
async void | SampleButton_Click (object sender, RoutedEventArgs e)
void | UpdateAvailableLanguages ()
void | UpdateWordBoxTransform ()
void | UserLanguageToggle_Toggled (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

SoftwareBitmap | bitmap
MainPage rootPage = MainPage.Current
List< WordOverlay > | wordBoxes = new List<WordOverlay>()

Detailed Description

Definition at line 30 of file OcrFileImage.xaml.cs.

Constructor & Destructor Documentation

OcrFileImage ( ) [inline]

Definition at line 42 of file OcrFileImage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearResults ( ) [inline, private]

Clears extracted text and text overlay from previous OCR.

Definition at line 123 of file OcrFileImage.xaml.cs.

        {
            TextOverlay.RenderTransform = null;
            ExtractedTextBox.Text = String.Empty;
            TextOverlay.Children.Clear();
            wordBoxes.Clear();
        }

async void ExtractButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is event handler for 'Extract' button.

Recognizes text from image and displays it.

Parameters:
sender
e

Definition at line 158 of file OcrFileImage.xaml.cs.

        {
            ClearResults();

            // Check if OcrEngine supports image resolution.
            if (bitmap.PixelWidth > OcrEngine.MaxImageDimension || bitmap.PixelHeight > OcrEngine.MaxImageDimension)
            {
                rootPage.NotifyUser(
                    String.Format("Bitmap dimensions ({0}x{1}) are too big for OCR.", bitmap.PixelWidth, bitmap.PixelHeight) +
                    "Max image dimension is " + OcrEngine.MaxImageDimension + ".",
                    NotifyType.ErrorMessage);

                return;
            }

            OcrEngine ocrEngine = null;

            if (UserLanguageToggle.IsOn)
            {
                // Try to create OcrEngine for first supported language from UserProfile.GlobalizationPreferences.Languages list.
                // If none of the languages are available on device, method returns null.
                ocrEngine = OcrEngine.TryCreateFromUserProfileLanguages();
            }
            else
            {
                // Try to create OcrEngine for specified language.
                // If language is not supported on device, method returns null.
                ocrEngine = OcrEngine.TryCreateFromLanguage(LanguageList.SelectedValue as Language);
            }

            if (ocrEngine != null)
            {
                // Recognize text from image.
                var ocrResult = await ocrEngine.RecognizeAsync(bitmap);

                // Display recognized text.
                ExtractedTextBox.Text = ocrResult.Text;

                if (ocrResult.TextAngle != null)
                {
                    // If text is detected under some angle in this sample scenario we want to
                    // overlay word boxes over original image, so we rotate overlay boxes.
                    TextOverlay.RenderTransform = new RotateTransform
                    {
                        Angle = (double)ocrResult.TextAngle,
                        CenterX = PreviewImage.ActualWidth / 2,
                        CenterY = PreviewImage.ActualHeight / 2
                    };
                }

                // Create overlay boxes over recognized words.
                foreach (var line in ocrResult.Lines)
                {
                    // Determine if line is horizontal or vertical.
                    // Vertical lines are supported only in Chinese Traditional and Japanese languages.
                    Rect lineRect = Rect.Empty;
                    foreach (var word in line.Words)
                    {
                        lineRect.Union(word.BoundingRect);
                    }
                    bool isVerticalLine = lineRect.Height > lineRect.Width;
                    var style = isVerticalLine ? HighlightedWordBoxVerticalLineStyle : HighlightedWordBoxHorizontalLineStyle;

                    foreach (var word in line.Words)
                    {
                        WordOverlay wordBoxOverlay = new WordOverlay(word);

                        // Keep references to word boxes.
                        wordBoxes.Add(wordBoxOverlay);

                        // Create a box to highlight the word.
                        TextOverlay.Children.Add(wordBoxOverlay.CreateBorder(style));
                    }
                }

                // Rescale word boxes to match current UI size.
                UpdateWordBoxTransform();

                rootPage.NotifyUser(
                    "Image is OCRed for " + ocrEngine.RecognizerLanguage.DisplayName + " language.",
                    NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Selected language is not available.", NotifyType.ErrorMessage);
            }
        }

void LanguageList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Occurs when selected language is changed in available languages combo box.

Parameters:
sender
e

Definition at line 303 of file OcrFileImage.xaml.cs.

        {
            ClearResults();
        }

async void LoadButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is event handler for 'Load' button.

It opens file picked and load selected image in UI..

Parameters:
sender
e

Definition at line 277 of file OcrFileImage.xaml.cs.

        {
            var picker = new FileOpenPicker()
            {
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                FileTypeFilter = { ".jpg", ".jpeg", ".png" },
            };

            var file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                ClearResults();

                await LoadImageAsync(file);

                rootPage.NotifyUser(
                    String.Format("Loaded image from file: {0} ({1}x{2}).", file.Name, bitmap.PixelWidth, bitmap.PixelHeight),
                    NotifyType.StatusMessage);
            }
        }

async Task LoadImageAsync ( StorageFile file ) [inline, private]

Loads image from file to bitmap and displays it in UI.

Parameters:
file
Returns:

Definition at line 100 of file OcrFileImage.xaml.cs.

        {
            using (var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
            {
                var decoder = await BitmapDecoder.CreateAsync(stream);

                bitmap = await decoder.GetSoftwareBitmapAsync(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);

                var imgSource = new WriteableBitmap(bitmap.PixelWidth, bitmap.PixelHeight);
                bitmap.CopyToBuffer(imgSource.PixelBuffer);
                PreviewImage.Source = imgSource;
            }
        }

async Task LoadSampleImageAsync ( ) [inline, private]

Definition at line 114 of file OcrFileImage.xaml.cs.

        {
            var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Assets\\splash-sdk.png");
            await LoadImageAsync(file);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Updates OCR available languages and loads sample image.

Parameters:
e

Definition at line 52 of file OcrFileImage.xaml.cs.

        {
            UpdateAvailableLanguages();

            await LoadSampleImageAsync();
        }

void PreviewImage_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Occurs when displayed image size changes.

Parameters:
sender
e

Definition at line 313 of file OcrFileImage.xaml.cs.

        {
            // Update word overlay boxes.
            UpdateWordBoxTransform();

            // Update image rotation center.
            var rotate = TextOverlay.RenderTransform as RotateTransform;
            if (rotate != null)
            {
                rotate.CenterX = PreviewImage.ActualWidth / 2;
                rotate.CenterY = PreviewImage.ActualHeight / 2;
            }
        }

async void SampleButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is event handler for 'Sample' button.

It loads sample image and displays it in UI.

Parameters:
sender
e

Definition at line 262 of file OcrFileImage.xaml.cs.

        {
            ClearResults();

            await LoadSampleImageAsync();

            rootPage.NotifyUser("Loaded sample image.", NotifyType.StatusMessage);
        }

void UpdateAvailableLanguages ( ) [inline, private]

Updates list of ocr languages available on device.

Definition at line 62 of file OcrFileImage.xaml.cs.

        {
            if (!UserLanguageToggle.IsOn)
            {
                // Check if any OCR language is available on device.
                if (OcrEngine.AvailableRecognizerLanguages.Count > 0)
                {
                    LanguageList.DisplayMemberPath = "DisplayName";
                    LanguageList.ItemsSource = OcrEngine.AvailableRecognizerLanguages;
                    LanguageList.SelectedIndex = 0;
                    LanguageList.IsEnabled = true;
                }
                else
                {
                    // Prevent OCR if no OCR languages are available on device.
                    UserLanguageToggle.IsEnabled = false;
                    LanguageList.IsEnabled = false;
                    ExtractButton.IsEnabled = false;

                    rootPage.NotifyUser("No available OCR languages.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                LanguageList.ItemsSource = null;
                LanguageList.IsEnabled = false;

                rootPage.NotifyUser(
                    "Run OCR in first OCR available language from UserProfile.GlobalizationPreferences.Languages list.",
                    NotifyType.StatusMessage);
            }
        }

void UpdateWordBoxTransform ( ) [inline, private]

Update word box transform to match current UI size.

Definition at line 134 of file OcrFileImage.xaml.cs.

        {
            // Used for text overlay.
            // Prepare scale transform for words since image is not displayed in original size.
            ScaleTransform scaleTrasform = new ScaleTransform
            {
                CenterX = 0,
                CenterY = 0,
                ScaleX = PreviewImage.ActualWidth / bitmap.PixelWidth,
                ScaleY = PreviewImage.ActualHeight / bitmap.PixelHeight
            };

            foreach (var item in wordBoxes)
            {
                item.Transform(scaleTrasform);
            }
        }

void UserLanguageToggle_Toggled | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Occurs when user language toggle state is changed.

Parameters:
sender
e

Definition at line 251 of file OcrFileImage.xaml.cs.

        {
            UpdateAvailableLanguages();
        }

Member Data Documentation

SoftwareBitmap bitmap [private]

Definition at line 37 of file OcrFileImage.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file OcrFileImage.xaml.cs.

List<WordOverlay> wordBoxes = new List<WordOverlay>() [private]

Definition at line 40 of file OcrFileImage.xaml.cs.

The documentation for this class was generated from the following files:
  • OCR/cs/OcrFileImage.xaml.cs
  • OCR/cpp/OcrFileImage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OpenCloseConnectionScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • OpenCloseConnectionScenario
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OpenCloseConnectionScenario Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

OpenCloseConnectionScenario ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | GenerateRandomNumber_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 26 of file OpenCloseConnectionScenario.xaml.cs.

Constructor & Destructor Documentation

OpenCloseConnectionScenario ( ) [inline]

Definition at line 30 of file OpenCloseConnectionScenario.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GenerateRandomNumber_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file OpenCloseConnectionScenario.xaml.cs.

        {
            //Parse user input
            int minValueInput = 0;
            bool valueParsed = int.TryParse(MinValue.Text, out minValueInput);
            if (!valueParsed)
            {
                rootPage.NotifyUser("The Minimum Value should be a valid integer", NotifyType.ErrorMessage);
                return;
            }

            int maxValueInput = 0;
            valueParsed = int.TryParse(MaxValue.Text, out maxValueInput);
            if (!valueParsed)
            {
                rootPage.NotifyUser("The Maximum Value should be a valid integer", NotifyType.ErrorMessage);
                return;
            }

            if (maxValueInput <= minValueInput)
            {
                rootPage.NotifyUser("Maximum Value must be larger than Minimum Value", NotifyType.ErrorMessage);
                return;
            }

            using (var connection = new AppServiceConnection())
            {
                //Set up a new app service connection
                connection.AppServiceName = "com.microsoft.randomnumbergenerator";
                connection.PackageFamilyName = "Microsoft.SDKSamples.AppServicesProvider.CS_8wekyb3d8bbwe";
                AppServiceConnectionStatus status = await connection.OpenAsync();

                switch (status)
                {
                    case AppServiceConnectionStatus.Success:
                        // The new connection opened successfully
                        rootPage.NotifyUser("Connection established", NotifyType.StatusMessage);
                        break;

                    case AppServiceConnectionStatus.AppNotInstalled:
                        rootPage.NotifyUser("The app AppServicesProvider is not installed. Deploy AppServicesProvider to this device and try again.", NotifyType.ErrorMessage);
                        return;

                    case AppServiceConnectionStatus.AppUnavailable:
                        rootPage.NotifyUser("The app AppServicesProvider is not available. This could be because it is currently being updated or was installed to a removable device that is no longer available.", NotifyType.ErrorMessage);
                        return;

                    case AppServiceConnectionStatus.AppServiceUnavailable:
                        rootPage.NotifyUser($"The app AppServicesProvider is installed but it does not provide the app service {connection.AppServiceName}", NotifyType.ErrorMessage);
                        return;

                    default:
                    case AppServiceConnectionStatus.Unknown:
                        rootPage.NotifyUser("An unknown error occurred while we were trying to open an AppServiceConnection.", NotifyType.ErrorMessage);
                        return;
                }

                //Set up the inputs and send a message to the service
                var inputs = new ValueSet();
                inputs.Add("minvalue", minValueInput);
                inputs.Add("maxvalue", maxValueInput);
                AppServiceResponse response = await connection.SendMessageAsync(inputs);

                //If the service responded with success display the result and walk away
                if (response.Status == AppServiceResponseStatus.Success &&
                    response.Message.ContainsKey("result"))
                {
                    var resultText = response.Message["result"].ToString();
                    if (!string.IsNullOrEmpty(resultText))
                    {
                        Result.Text = resultText;
                        rootPage.NotifyUser("App service responded with a result", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("App service did not respond with a result", NotifyType.ErrorMessage);
                    }

                    return;
                }

                //Something went wrong while sending a message. Let display
                //a meaningful error message
                switch (response.Status)
                {
                    case AppServiceResponseStatus.Failure:
                        rootPage.NotifyUser("The service failed to acknowledge the message we sent it. It may have been terminated or its RequestReceived handler might not be handling incoming messages correctly.", NotifyType.ErrorMessage);
                        return;

                    case AppServiceResponseStatus.ResourceLimitsExceeded:
                        rootPage.NotifyUser("The service exceeded the resources allocated to it and had to be terminated.", NotifyType.ErrorMessage);
                        return;

                    default:
                    case AppServiceResponseStatus.Unknown:
                        rootPage.NotifyUser("An unknown error occurred while we were trying to send a message to the service.", NotifyType.ErrorMessage);
                        return;
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file OpenCloseConnectionScenario.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 28 of file OpenCloseConnectionScenario.xaml.cs.

The documentation for this class was generated from the following file:
  • AppServices/cs/AppServicesClient/OpenCloseConnectionScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OtherScenarios Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • OtherScenarios
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OtherScenarios Class Reference

List of all members.

Public Member Functions

OtherScenarios ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearOutput ()
void | ClearOutputButton_Click (object sender, RoutedEventArgs e)
void | DisplayFormats ()
void | EmptyClipboardButton_Click (object sender, RoutedEventArgs e)
void | RegisterClipboardContentChanged_Click (object sender, RoutedEventArgs e)
void | ShowFormatButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file OtherScenarios.xaml.cs.

Constructor & Destructor Documentation

OtherScenarios ( ) [inline]

Definition at line 24 of file OtherScenarios.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearOutput ( ) [inline, private]

Definition at line 80 of file OtherScenarios.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            OutputText.Text = "";
        }

void ClearOutputButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file OtherScenarios.xaml.cs.

        {
            this.ClearOutput();
        }

void DisplayFormats ( ) [inline, private]

Definition at line 86 of file OtherScenarios.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            OutputText.Text = rootPage.BuildClipboardFormatsOutputString();
        }

void EmptyClipboardButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file OtherScenarios.xaml.cs.

        {
            try
            {
                Clipboard.Clear();
                OutputText.Text = "Clipboard has been emptied.";
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error emptying Clipboard: " + ex.Message + ". Try again", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file OtherScenarios.xaml.cs.

        {
            RegisterClipboardContentChanged.IsChecked = rootPage.IsClipboardContentChangedEnabled;
        }

void RegisterClipboardContentChanged_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file OtherScenarios.xaml.cs.

        {
            // In this sample, we register for Clipboard update notifications on the MainPage so that we can
            // navigate between scenarios and still receive updates. The sample also registers for window activated
            // notifications since the app needs to be in the foreground to access the clipboard. Once we receive
            // a clipboard update notification, we display the new content (if the app is in the foreground). If the
            // sample is not in the foreground, we defer displaying it until it is.
            bool enable = RegisterClipboardContentChanged.IsChecked.Value;
            if (rootPage.EnableClipboardContentChangedNotifications(enable))
            {
                this.ClearOutput();

                if (enable)
                {
                    OutputText.Text = "Successfully registered for clipboard update notification.";
                }
                else
                {
                    OutputText.Text = "Successfully un-registered for clipboard update notification.";
                }
            }
        }

void ShowFormatButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file OtherScenarios.xaml.cs.

        {
            this.DisplayFormats();
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file OtherScenarios.xaml.cs.

The documentation for this class was generated from the following file:
  • Clipboard/cs/OtherScenarios.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PageDescription Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PageDescription
Public Attributes | Friends

PageDescription Class Reference

Printable page description. More...

#include "Scenario5Photos.xaml.h"

List of all members.

Public Attributes

bool | IsContentCropped
Windows::Foundation::Size Margin
Windows::Foundation::Size PageSize
Windows::Foundation::Size PictureViewSize
Windows::Foundation::Size ViewablePageSize

Friends

bool | operator!= (PageDescription pageDescriptiopn1, PageDescription pageDescription2)
bool | operator== (PageDescription pageDescriptiopn1, PageDescription pageDescription2)

Detailed Description

Definition at line 33 of file Scenario5Photos.xaml.h.

Friends And Related Function Documentation

bool operator!= | ( | PageDescription | pageDescriptiopn1,
 |  | PageDescription | pageDescription2 |
 | ) |  |  | [friend]

Definition at line 71 of file Scenario5Photos.xaml.h.

        {
            return !(pageDescriptiopn1 == pageDescription2);
        }

bool operator== | ( | PageDescription | pageDescriptiopn1,
 |  | PageDescription | pageDescription2 |
 | ) |  |  | [friend]

Definition at line 42 of file Scenario5Photos.xaml.h.

        {
            // Detect if PageSize changed
            bool equal = (std::abs(pageDescriptiopn1.PageSize.Width - pageDescription2.PageSize.Width) < FLT_EPSILON) &&
                (std::abs(pageDescriptiopn1.PageSize.Height - pageDescription2.PageSize.Height) < FLT_EPSILON);

            // Detect if ViewablePageSize changed
            if (equal)
            {
                equal = (std::abs(pageDescriptiopn1.ViewablePageSize.Width - pageDescription2.ViewablePageSize.Width) < FLT_EPSILON) &&
                    (std::abs(pageDescriptiopn1.ViewablePageSize.Height - pageDescription2.ViewablePageSize.Height) < FLT_EPSILON);
            }

            // Detect if PictureViewSize changed
            if (equal)
            {
                equal = (std::abs(pageDescriptiopn1.PictureViewSize.Width - pageDescription2.PictureViewSize.Width) < FLT_EPSILON) &&
                    (std::abs(pageDescriptiopn1.PictureViewSize.Height - pageDescription2.PictureViewSize.Height) < FLT_EPSILON);
            }

            // Detect if cropping changed
            if (equal)
            {
                equal = pageDescriptiopn1.IsContentCropped == pageDescription2.IsContentCropped;
            }

            return equal;
        }

Member Data Documentation

bool IsContentCropped

Definition at line 40 of file Scenario5Photos.xaml.h.

Windows::Foundation::Size Margin

Definition at line 36 of file Scenario5Photos.xaml.h.

Windows::Foundation::Size PageSize

Definition at line 37 of file Scenario5Photos.xaml.h.

Windows::Foundation::Size PictureViewSize

Definition at line 39 of file Scenario5Photos.xaml.h.

Windows::Foundation::Size ViewablePageSize

Definition at line 38 of file Scenario5Photos.xaml.h.

The documentation for this class was generated from the following file:
  • Printing/cpp/Scenario5Photos.xaml.h
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaceInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PlaceInfo
Public Attributes | Properties

PlaceInfo Class Reference

#include "Scenario7.xaml.h"

List of all members.

Public Attributes

PlaceLocation Location
Platform::String | Name

Properties

string | Name [get, set]

Detailed Description

Definition at line 31 of file Scenario7.xaml.h.

Member Data Documentation

PlaceLocation Location [get, set]

Definition at line 34 of file Scenario7.xaml.h.

Platform::String Name

Definition at line 33 of file Scenario7.xaml.h.

Property Documentation

string Name [get, set]

Definition at line 58 of file Scenario7.xaml.cs.

The documentation for this class was generated from the following files:
  • MapControl/cpp/Scenario7.xaml.h
  • MapControl/cs/Scenario7.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaceLocation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PlaceLocation
Public Member Functions | Public Attributes | Properties | Static Private Member Functions

PlaceLocation Struct Reference

#include "Scenario7.xaml.h"

List of all members.

Public Member Functions

PlaceLocation (double latitude, double longitude)
PlaceLocation (double latitude, double longitude)

Public Attributes

Windows::Devices::Geolocation::BasicGeoposition | Geoposition
Windows::Foundation::Point | MapCoordinates

Properties

BasicGeoposition | Geoposition [get]
Point | MapCoordinates [get]

Static Private Member Functions

static Windows::Foundation::Point | GetMapCoordinates (double latitude, double longitude)
static Point | GetMapCoordinates (BasicGeoposition geoposition)

Detailed Description

Definition at line 22 of file Scenario7.xaml.h.

Constructor & Destructor Documentation

PlaceLocation | ( | double | latitude,
 |  | double | longitude
 | ) |  |

Definition at line 30 of file Scenario7.xaml.cpp.

                                                              :
    Geoposition{ latitude, longitude },

PlaceLocation | ( | double | latitude,
 |  | double | longitude |
 | ) |  |  | [inline]

Definition at line 31 of file Scenario7.xaml.cs.

        {
            Geoposition = new BasicGeoposition() { Latitude = latitude, Longitude = longitude };
            MapCoordinates = GetMapCoordinates(Geoposition);
        }

Member Function Documentation

Point GetMapCoordinates | ( | double | latitude,
 |  | double | longitude |
 | ) |  |  | [static, private]

Definition at line 36 of file Scenario7.xaml.cpp.

{
    // This formula comes from https://msdn.microsoft.com/en-us/library/bb259689.aspx

    // Clamp latitude to the range -85.05112878 to 85.05112878.
    // This keeps Y in range and avoids the singularities at the poles.
    latitude = (std::max)((std::min)(latitude, 85.05112878), -85.05112878);

    double sinLatitude = sin(latitude * Pi / 180.0);
    return Point{
        static_cast<float>((longitude + 180.0) / 360.0),
        static_cast<float>(0.5 - log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4 * Pi))
    };
}

static Point GetMapCoordinates ( BasicGeoposition geoposition ) [inline, static, private]

Definition at line 39 of file Scenario7.xaml.cs.

        {
            // This formula comes from https://msdn.microsoft.com/en-us/library/bb259689.aspx

            // Clamp latitude to the range -85.05112878 to 85.05112878.
            // This keeps Y in range and avoids the singularity at the pole.
            double latitude = Math.Max(Math.Min(geoposition.Latitude, 85.05112878), -85.05112878);

            double sinLatitude = Math.Sin(latitude * Math.PI / 180.0);
            return new Point
            {
                X = (geoposition.Longitude + 180.0) / 360.0,
                Y = 0.5 - Math.Log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4 * Math.PI)
            };
        }

Member Data Documentation

Windows::Devices::Geolocation::BasicGeoposition Geoposition

Definition at line 25 of file Scenario7.xaml.h.

Windows::Foundation::Point MapCoordinates

Definition at line 26 of file Scenario7.xaml.h.

Property Documentation

BasicGeoposition Geoposition [get]

Definition at line 36 of file Scenario7.xaml.cs.

Point MapCoordinates [get]

Definition at line 37 of file Scenario7.xaml.cs.

The documentation for this struct was generated from the following files:
  • MapControl/cpp/Scenario7.xaml.h
  • MapControl/cs/Scenario7.xaml.cs
  • MapControl/cpp/Scenario7.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlugInFilter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PlugInFilter
Public Member Functions | Private Attributes

PlugInFilter Class Reference

List of all members.

Public Member Functions

PlugInFilter (IHttpFilter innerFilter)
void | Dispose ()
IAsyncOperationWithProgress
< HttpResponseMessage,
HttpProgress > 		SendRequestAsync (HttpRequestMessage request)

Private Attributes

IHttpFilter | innerFilter

Detailed Description

Definition at line 20 of file PlugInFilter.cs.

Constructor & Destructor Documentation

PlugInFilter ( IHttpFilter innerFilter ) [inline]

Definition at line 24 of file PlugInFilter.cs.

        {
            if (innerFilter == null)
            {
                throw new ArgumentException("innerFilter cannot be null.");
            }
            this.innerFilter = innerFilter;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 47 of file PlugInFilter.cs.

        {
            innerFilter.Dispose();
            GC.SuppressFinalize(this);
        }

IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> SendRequestAsync ( HttpRequestMessage request ) [inline]

Definition at line 33 of file PlugInFilter.cs.

        {
            return AsyncInfo.Run<HttpResponseMessage, HttpProgress>(async (cancellationToken, progress) =>
            {
                request.Headers.Add("Custom-Header", "CustomRequestValue");
                HttpResponseMessage response = await innerFilter.SendRequestAsync(request).AsTask(cancellationToken, progress);

                cancellationToken.ThrowIfCancellationRequested();

                response.Headers.Add("Custom-Header", "CustomResponseValue");
                return response;
            });
        }

Member Data Documentation

IHttpFilter innerFilter [private]

Definition at line 22 of file PlugInFilter.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/PlugInFilter.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PointOfInterest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PointOfInterest
Properties

PointOfInterest Class Reference

List of all members.

Properties

string | DisplayName [get, set]
Uri | ImageSourceUri [get, set]
Geopoint | Location [get, set]
Point | NormalizedAnchorPoint [get, set]

Detailed Description

Definition at line 23 of file Scenario3.xaml.cs.

Property Documentation

string DisplayName [get, set]

Definition at line 25 of file Scenario3.xaml.cs.

Uri ImageSourceUri [get, set]

Definition at line 27 of file Scenario3.xaml.cs.

Geopoint Location [get, set]

Definition at line 26 of file Scenario3.xaml.cs.

Point NormalizedAnchorPoint [get, set]

Definition at line 28 of file Scenario3.xaml.cs.

The documentation for this class was generated from the following file:
  • MapControl/cs/Scenario3.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresentationFormats Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PresentationFormats
Public Types | Public Attributes

PresentationFormats Class Reference

Class containing the details of Gatt characteristics presentation formats. More...

List of all members.

Public Types

enum | NamespaceId { BluetoothSigAssignedNumber = 1, ReservedForFutureUse }
enum Units {
Unitless = 0x2700, LengthMetre = 0x2701, MassKilogram = 0x2702, TimeSecond = 0x2703,
ElectricCurrentAmpere = 0x2704, ThermodynamicTemperatureKelvin = 0x2705, AmountOfSubstanceMole = 0x2706, LuminousIntensityCandela = 0x2707,
AreaSquareMetres = 0x2710, VolumeCubicMetres = 0x2711, VelocityMetresPerSecond = 0x2712, AccelerationMetresPerSecondSquared = 0x2713,
WaveNumberReciprocalMetre = 0x2714, DensityKilogramperCubicMetre = 0x2715, SurfaceDensityKilogramPerSquareMetre = 0x2716, SpecificVolumeCubicMetrePerKilogram = 0x2717,
CurrentDensityAmperePerSquareMetre = 0x2718, MagneticFieldStrengthAmperePerMetre = 0x2719, AmountConcentrationMolePerCubicMetre = 0x271A, MassConcentrationKilogramPerCubicMetre = 0x271B,
LuminanceCandelaPerSquareMetre = 0x271C, RefractiveIndex = 0x271D, RelativePermeability = 0x271E, PlaneAngleRadian = 0x2720,
SolidAngleSteradian = 0x2721, FrequencyHertz = 0x2722, ForceNewton = 0x2723, PressurePascal = 0x2724,
EnergyJoule = 0x2725, PowerWatt = 0x2726, ElectricChargeCoulomb = 0x2727, ElectricPotentialDifferenceVolt = 0x2728,
CapacitanceFarad = 0x2729, ElectricResistanceOhm = 0x272A, ElectricConductanceSiemens = 0x272B, MagneticFluxWeber = 0x272C,
MagneticFluxDensityTesla = 0x272D, InductanceHenry = 0x272E, CelsiusTemperatureDegreeCelsius = 0x272F, LuminousFluxLumen = 0x2730,
IlluminanceLux = 0x2731, ActivityReferredToARadioNuclideBecquerel = 0x2732, AbsorbedDoseGray = 0x2733, DoseEquivalentSievert = 0x2734,
CatalyticActivityKatal = 0x2735, DynamicViscosityPascalSecond = 0x2740, MomentOfForceNewtonMetre = 0x2741, SurfaceTensionNewtonPerMetre = 0x2742,
AngularVelocityRadianPerSecond = 0x2743, AngularAccelerationRadianPerSecondSquared = 0x2744, HeatFluxDensityWattPerSquareMetre = 0x2745, HeatCapacityJoulePerKelvin = 0x2746,
SpecificHeatCapacityJoulePerKilogramKelvin = 0x2747, SpecificEnergyJoulePerKilogram = 0x2748, ThermalConductivityWattPerMetreKelvin = 0x2749, EnergyDensityJoulePerCubicMetre = 0x274A,
ElectricfieldstrengthVoltPerMetre = 0x274B, ElectricchargeDensityCoulombPerCubicMetre = 0x274C, SurfacechargeDensityCoulombPerSquareMetre = 0x274D, ElectricFluxDensityCoulombPerSquareMetre = 0x274E,
PermittivityFaradPerMetre = 0x274F, PermeabilityHenryPerMetre = 0x2750, MolarEnergyJoulePermole = 0x2751, MolarentropyJoulePermoleKelvin = 0x2752,
ExposureCoulombPerKilogram = 0x2753, AbsorbeddoserateGrayPerSecond = 0x2754, RadiantintensityWattPerSteradian = 0x2755, RadianceWattPerSquareMetreSteradian = 0x2756,
CatalyticActivityConcentrationKatalPerCubicMetre = 0x2757, TimeMinute = 0x2760, TimeHour = 0x2761, TimeDay = 0x2762,
PlaneAngleDegree = 0x2763, PlaneAngleMinute = 0x2764, PlaneAngleSecond = 0x2765, AreaHectare = 0x2766,
VolumeLitre = 0x2767, MassTonne = 0x2768, PressureBar = 0x2780, PressureMilliMetreofmercury = 0x2781,
LengthAngstrom = 0x2782, LengthNauticalMile = 0x2783, AreaBarn = 0x2784, VelocityKnot = 0x2785,
LogarithmicRadioQuantityNeper = 0x2786, LogarithmicRadioQuantityBel = 0x2787, LengthYard = 0x27A0, LengthParsec = 0x27A1,
LengthInch = 0x27A2, LengthFoot = 0x27A3, LengthMile = 0x27A4, PressurePoundForcePerSquareinch = 0x27A5,
VelocityKiloMetrePerHour = 0x27A6, VelocityMilePerHour = 0x27A7, AngularVelocityRevolutionPerminute = 0x27A8, EnergyGramcalorie = 0x27A9,
EnergyKilogramcalorie = 0x27AA, EnergyKiloWattHour = 0x27AB, ThermodynamicTemperatureDegreeFahrenheit = 0x27AC, Percentage = 0x27AD,
PerMille = 0x27AE, PeriodBeatsPerMinute = 0x27AF, ElectricchargeAmpereHours = 0x27B0, MassDensityMilligramPerdeciLitre = 0x27B1,
MassDensityMillimolePerLitre = 0x27B2, TimeYear = 0x27B3, TimeMonth = 0x27B4, ConcentrationCountPerCubicMetre = 0x27B5,
IrradianceWattPerSquareMetre = 0x27B6, MilliliterPerKilogramPerminute = 0x27B7, MassPound = 0x27B8
}

Public Attributes

const ushort | Description = 0x0000
const int | Exponent = 0

Detailed Description

Definition at line 11 of file PresentationFormats.cs.

Member Enumeration Documentation

enum NamespaceId

The Name Space field is used to identify the organization that is responsible for defining the enumerations for the description field.

Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml

Enumerator:
BluetoothSigAssignedNumber
ReservedForFutureUse

Definition at line 138 of file PresentationFormats.cs.

        {
            BluetoothSigAssignedNumber = 1,
            ReservedForFutureUse
        }

enum Units

Units are established international standards for the measurement of physical quantities.

Please refer https://www.bluetooth.com/specifications/assigned-numbers/units

Enumerator:
Unitless
LengthMetre
MassKilogram
TimeSecond
ElectricCurrentAmpere
ThermodynamicTemperatureKelvin
AmountOfSubstanceMole
LuminousIntensityCandela
AreaSquareMetres
VolumeCubicMetres
VelocityMetresPerSecond
AccelerationMetresPerSecondSquared
WaveNumberReciprocalMetre
DensityKilogramperCubicMetre
SurfaceDensityKilogramPerSquareMetre
SpecificVolumeCubicMetrePerKilogram
CurrentDensityAmperePerSquareMetre
MagneticFieldStrengthAmperePerMetre
AmountConcentrationMolePerCubicMetre
MassConcentrationKilogramPerCubicMetre
LuminanceCandelaPerSquareMetre
RefractiveIndex
RelativePermeability
PlaneAngleRadian
SolidAngleSteradian
FrequencyHertz
ForceNewton
PressurePascal
EnergyJoule
PowerWatt
ElectricChargeCoulomb
ElectricPotentialDifferenceVolt
CapacitanceFarad
ElectricResistanceOhm
ElectricConductanceSiemens
MagneticFluxWeber
MagneticFluxDensityTesla
InductanceHenry
CelsiusTemperatureDegreeCelsius
LuminousFluxLumen
IlluminanceLux
ActivityReferredToARadioNuclideBecquerel
AbsorbedDoseGray
DoseEquivalentSievert
CatalyticActivityKatal
DynamicViscosityPascalSecond
MomentOfForceNewtonMetre
SurfaceTensionNewtonPerMetre
AngularVelocityRadianPerSecond
AngularAccelerationRadianPerSecondSquared
HeatFluxDensityWattPerSquareMetre
HeatCapacityJoulePerKelvin
SpecificHeatCapacityJoulePerKilogramKelvin
SpecificEnergyJoulePerKilogram
ThermalConductivityWattPerMetreKelvin
EnergyDensityJoulePerCubicMetre
ElectricfieldstrengthVoltPerMetre
ElectricchargeDensityCoulombPerCubicMetre
SurfacechargeDensityCoulombPerSquareMetre
ElectricFluxDensityCoulombPerSquareMetre
PermittivityFaradPerMetre
PermeabilityHenryPerMetre
MolarEnergyJoulePermole
MolarentropyJoulePermoleKelvin
ExposureCoulombPerKilogram
AbsorbeddoserateGrayPerSecond
RadiantintensityWattPerSteradian
RadianceWattPerSquareMetreSteradian
CatalyticActivityConcentrationKatalPerCubicMetre
TimeMinute
TimeHour
TimeDay
PlaneAngleDegree
PlaneAngleMinute
PlaneAngleSecond
AreaHectare
VolumeLitre
MassTonne
PressureBar
PressureMilliMetreofmercury
LengthAngstrom
LengthNauticalMile
AreaBarn
VelocityKnot
LogarithmicRadioQuantityNeper
LogarithmicRadioQuantityBel
LengthYard
LengthParsec
LengthInch
LengthFoot
LengthMile
PressurePoundForcePerSquareinch
VelocityKiloMetrePerHour
VelocityMilePerHour
AngularVelocityRevolutionPerminute
EnergyGramcalorie
EnergyKilogramcalorie
EnergyKiloWattHour
ThermodynamicTemperatureDegreeFahrenheit
Percentage
PerMille
PeriodBeatsPerMinute
ElectricchargeAmpereHours
MassDensityMilligramPerdeciLitre
MassDensityMillimolePerLitre
TimeYear
TimeMonth
ConcentrationCountPerCubicMetre
IrradianceWattPerSquareMetre
MilliliterPerKilogramPerminute
MassPound

Definition at line 17 of file PresentationFormats.cs.

        {
            Unitless = 0x2700,
            LengthMetre = 0x2701,
            MassKilogram = 0x2702,
            TimeSecond = 0x2703,
            ElectricCurrentAmpere = 0x2704,
            ThermodynamicTemperatureKelvin = 0x2705,
            AmountOfSubstanceMole = 0x2706,
            LuminousIntensityCandela = 0x2707,
            AreaSquareMetres = 0x2710,
            VolumeCubicMetres = 0x2711,
            VelocityMetresPerSecond = 0x2712,
            AccelerationMetresPerSecondSquared = 0x2713,
            WaveNumberReciprocalMetre = 0x2714,
            DensityKilogramperCubicMetre = 0x2715,
            SurfaceDensityKilogramPerSquareMetre = 0x2716,
            SpecificVolumeCubicMetrePerKilogram = 0x2717,
            CurrentDensityAmperePerSquareMetre = 0x2718,
            MagneticFieldStrengthAmperePerMetre = 0x2719,
            AmountConcentrationMolePerCubicMetre = 0x271A,
            MassConcentrationKilogramPerCubicMetre = 0x271B,
            LuminanceCandelaPerSquareMetre = 0x271C,
            RefractiveIndex = 0x271D,
            RelativePermeability = 0x271E,
            PlaneAngleRadian = 0x2720,
            SolidAngleSteradian = 0x2721,
            FrequencyHertz = 0x2722,
            ForceNewton = 0x2723,
            PressurePascal = 0x2724,
            EnergyJoule = 0x2725,
            PowerWatt = 0x2726,
            ElectricChargeCoulomb = 0x2727,
            ElectricPotentialDifferenceVolt = 0x2728,
            CapacitanceFarad = 0x2729,
            ElectricResistanceOhm = 0x272A,
            ElectricConductanceSiemens = 0x272B,
            MagneticFluxWeber = 0x272C,
            MagneticFluxDensityTesla = 0x272D,
            InductanceHenry = 0x272E,
            CelsiusTemperatureDegreeCelsius = 0x272F,
            LuminousFluxLumen = 0x2730,
            IlluminanceLux = 0x2731,
            ActivityReferredToARadioNuclideBecquerel = 0x2732,
            AbsorbedDoseGray = 0x2733,
            DoseEquivalentSievert = 0x2734,
            CatalyticActivityKatal = 0x2735,
            DynamicViscosityPascalSecond = 0x2740,
            MomentOfForceNewtonMetre = 0x2741,
            SurfaceTensionNewtonPerMetre = 0x2742,
            AngularVelocityRadianPerSecond = 0x2743,
            AngularAccelerationRadianPerSecondSquared = 0x2744,
            HeatFluxDensityWattPerSquareMetre = 0x2745,
            HeatCapacityJoulePerKelvin = 0x2746,
            SpecificHeatCapacityJoulePerKilogramKelvin = 0x2747,
            SpecificEnergyJoulePerKilogram = 0x2748,
            ThermalConductivityWattPerMetreKelvin = 0x2749,
            EnergyDensityJoulePerCubicMetre = 0x274A,
            ElectricfieldstrengthVoltPerMetre = 0x274B,
            ElectricchargeDensityCoulombPerCubicMetre = 0x274C,
            SurfacechargeDensityCoulombPerSquareMetre = 0x274D,
            ElectricFluxDensityCoulombPerSquareMetre = 0x274E,
            PermittivityFaradPerMetre = 0x274F,
            PermeabilityHenryPerMetre = 0x2750,
            MolarEnergyJoulePermole = 0x2751,
            MolarentropyJoulePermoleKelvin = 0x2752,
            ExposureCoulombPerKilogram = 0x2753,
            AbsorbeddoserateGrayPerSecond = 0x2754,
            RadiantintensityWattPerSteradian = 0x2755,
            RadianceWattPerSquareMetreSteradian = 0x2756,
            CatalyticActivityConcentrationKatalPerCubicMetre = 0x2757,
            TimeMinute = 0x2760,
            TimeHour = 0x2761,
            TimeDay = 0x2762,
            PlaneAngleDegree = 0x2763,
            PlaneAngleMinute = 0x2764,
            PlaneAngleSecond = 0x2765,
            AreaHectare = 0x2766,
            VolumeLitre = 0x2767,
            MassTonne = 0x2768,
            PressureBar = 0x2780,
            PressureMilliMetreofmercury = 0x2781,
            LengthAngstrom = 0x2782,
            LengthNauticalMile = 0x2783,
            AreaBarn = 0x2784,
            VelocityKnot = 0x2785,
            LogarithmicRadioQuantityNeper = 0x2786,
            LogarithmicRadioQuantityBel = 0x2787,
            LengthYard = 0x27A0,
            LengthParsec = 0x27A1,
            LengthInch = 0x27A2,
            LengthFoot = 0x27A3,
            LengthMile = 0x27A4,
            PressurePoundForcePerSquareinch = 0x27A5,
            VelocityKiloMetrePerHour = 0x27A6,
            VelocityMilePerHour = 0x27A7,
            AngularVelocityRevolutionPerminute = 0x27A8,
            EnergyGramcalorie = 0x27A9,
            EnergyKilogramcalorie = 0x27AA,
            EnergyKiloWattHour = 0x27AB,
            ThermodynamicTemperatureDegreeFahrenheit = 0x27AC,
            Percentage = 0x27AD,
            PerMille = 0x27AE,
            PeriodBeatsPerMinute = 0x27AF,
            ElectricchargeAmpereHours = 0x27B0,
            MassDensityMilligramPerdeciLitre = 0x27B1,
            MassDensityMillimolePerLitre = 0x27B2,
            TimeYear = 0x27B3,
            TimeMonth = 0x27B4,
            ConcentrationCountPerCubicMetre = 0x27B5,
            IrradianceWattPerSquareMetre = 0x27B6,
            MilliliterPerKilogramPerminute = 0x27B7,
            MassPound = 0x27B8
        }

Member Data Documentation

const ushort Description = 0x0000

The Description is an enumerated value from the organization identified by the Name Space field.

Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml

Definition at line 150 of file PresentationFormats.cs.

const int Exponent = 0

Exponent value for the characteristics.

Definition at line 155 of file PresentationFormats.cs.

The documentation for this class was generated from the following file:
  • BluetoothLE/cs/PresentationFormats.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PrintHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • PrintHelper
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Attributes

PrintHelper Class Reference

#include "PrintHelper.h"

Inherited by sealed, sealed, sealed, sealed, and sealed.

List of all members.

Public Member Functions

void | PreparePrintContent (Page^page)
void | ShowPrintUIAsync ()
void | UnregisterForPrinting ()

Public Attributes

internal | __pad0__: PrintHelper(Page^ scenarioPage)

Protected Member Functions

virtual RichTextBlockOverflow | AddOnePrintPreviewPage (RichTextBlockOverflow^lastRTBOAdded, Windows::Graphics::Printing::PrintPageDescription printPageDescription)
virtual void | AddPrintPages (Object^sender, AddPagesEventArgs^e)
virtual void | CreatePrintPreviewPages (Object^sender, PaginateEventArgs^e)
virtual void | GetPrintPreviewPage (Object^sender, GetPreviewPageEventArgs^e)
virtual void | OnPreviewPagesCreated (Windows::Graphics::Printing::PrintTaskOptions^printTaskOptions)
virtual void | PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e)

Properties

FrameworkElement | FirstPage

Private Attributes

float | m_applicationContentMarginLeft = 0.075f
float | m_applicationContentMarginTop = 0.03f
PrintDocument | m_printDocument
Windows::Graphics::Printing::IPrintDocumentSource | m_printDocumentSource
std::vector< UIElement^> | m_printPreviewPages
Windows::Foundation::EventRegistrationToken | m_printTaskRequestedEventToken
Page | m_scenarioPage

Detailed Description

Definition at line 14 of file PrintHelper.h.

Member Function Documentation

virtual RichTextBlockOverflow AddOnePrintPreviewPage | ( | RichTextBlockOverflow^ | lastRTBOAdded,
 |  | Windows::Graphics::Printing::PrintPageDescription | printPageDescription |
 | ) |  |  | [protected, virtual]

This function creates and adds one print preview page to the internal cache of print preview pages stored in m_printPreviewPages.

Parameters:
lastRTBOAdded | Last RichTextBlockOverflow element added in the current content
printPageDescription | Printer's page description
void AddPrintPages | ( | Object^ | sender,
 |  | AddPagesEventArgs^ | e |
 | ) |  |  | [protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:
sender
e Add page event arguments containing a print task options reference

Reimplemented in sealed, and sealed.

Definition at line 181 of file PrintHelper.cpp.

{
    PrintDocument^ printDocument = safe_cast<PrintDocument^>(sender);

    // Loop over all of the preview pages and add each one to be printed
    for (UIElement^ previewPage : m_printPreviewPages)
    {
        printDocument->AddPage(previewPage);
    }

    // Indicate that all of the print pages have been provided
    printDocument->AddPagesComplete();
}

void CreatePrintPreviewPages | ( | Object^ | sender,
 |  | PaginateEventArgs^ | e |
 | ) |  |  | [protected, virtual]

This is the event handler for PrintDocument.Paginate.

It creates print preview pages for the app.

Parameters:
sender | PrintDocument
e | Paginate Event Arguments

Reimplemented in sealed.

Definition at line 132 of file PrintHelper.cpp.

{
    // Clear the cache of preview pages
    m_printPreviewPages.clear();

    // Clear the printing root of preview pages
    PrintCanvas->Children->Clear();

    // This variable keeps track of the last RichTextBlockOverflow element that was added to a page which will be printed
    RichTextBlockOverflow^ lastRTBOOnPage;

    // Get the PrintTaskOptions
    PrintTaskOptions^ printingOptions = safe_cast<PrintTaskOptions^>(e->PrintTaskOptions);

    // Get the page description to deterimine how big the page is
    PrintPageDescription pageDescription = printingOptions->GetPageDescription(0);

    // We know there is at least one page to be printed. passing null as the first parameter to
    // AddOnePrintPreviewPage tells the function to add the first page.
    lastRTBOOnPage = AddOnePrintPreviewPage(nullptr, pageDescription);

    // We know there are more pages to be added as long as the last RichTextBoxOverflow added to a print preview
    // page has extra content
    while (lastRTBOOnPage->HasOverflowContent && lastRTBOOnPage->Visibility == Windows::UI::Xaml::Visibility::Visible)
    {
        lastRTBOOnPage = AddOnePrintPreviewPage(lastRTBOOnPage, pageDescription);
    }

    PrintDocument^ printDocument = safe_cast<PrintDocument^>(sender);

    // Report the number of preview pages created
    printDocument->SetPreviewPageCount(static_cast<int>(m_printPreviewPages.size()), PreviewPageCountType::Intermediate);

    OnPreviewPagesCreated(printingOptions);
}

void GetPrintPreviewPage | ( | Object^ | sender,
 |  | GetPreviewPageEventArgs^ | e |
 | ) |  |  | [protected, virtual]

This is the event handler for PrintDocument.GetPrintPreviewPage.

It provides a specific print preview page, in the form of an UIElement, to an instance of PrintDocument. PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.

Parameters:
sender | The Print Document
e | Arguments containing the preview requested page

Reimplemented in sealed.

Definition at line 168 of file PrintHelper.cpp.

{
    PrintDocument^ localprintDocument = safe_cast<PrintDocument^>(sender);
    localprintDocument->SetPreviewPage(e->PageNumber, m_printPreviewPages[e->PageNumber - 1]);
}

virtual void OnPreviewPagesCreated ( Windows::Graphics::Printing::PrintTaskOptions^ printTaskOptions ) [inline, protected, virtual]

This is called after the preview pages have been recreated.

Parameters:
printTaskOptions

Reimplemented in sealed.

Definition at line 202 of file PrintHelper.h.

{};

void PreparePrintContent ( Page^ page )

Definition at line 75 of file PrintHelper.cpp.

{
    PreparePrintContentImpl(page);
}

virtual void PrintTaskRequested | ( | Windows::Graphics::Printing::PrintManager^ | sender,
 |  | Windows::Graphics::Printing::PrintTaskRequestedEventArgs^ | e |
 | ) |  |  | [protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:
sender | PrintManager
e | PrintTaskRequestedEventArgs

Reimplemented in sealed, sealed, sealed, sealed, and sealed.

void ShowPrintUIAsync ( )

Definition at line 53 of file PrintHelper.cpp.

{
    concurrency::create_task(PrintManager::ShowPrintUIAsync()).then([=](bool succeeded)
    {
        if (!succeeded)
        {
            MainPage::Current->NotifyUser("Error showing Print Dialog", NotifyType::ErrorMessage);
        }
    }).then([=](concurrency::task<void> previousTask)
    {
        // Catch and print out any errors reported
        try
        {
            previousTask.get();
        }
        catch (Exception^ e)
        {
            MainPage::Current->NotifyUser("Error showing Print Dialog: " + e->Message + ", hr=" + e->HResult, NotifyType::ErrorMessage);
        }
    });
}

void UnregisterForPrinting ( )

A list of UIElements used to store the print preview pages.

This gives easy access to any desired preview page. This function unregisters the app for printing with Windows.

Definition at line 42 of file PrintHelper.cpp.

{
    m_printDocument = nullptr;

    // Remove the handler for printing initialization.
    PrintManager^ printMan = PrintManager::GetForCurrentView();
    printMan->PrintTaskRequested -= m_printTaskRequestedEventToken;

    PrintCanvas->Children->Clear();
}

Member Data Documentation

internal __pad0__

Reimplemented in sealed.

Definition at line 21 of file PrintHelper.h.

float m_applicationContentMarginLeft = 0.075f [private]

7.5% margin on each side leaves 85% for content.

Definition at line 81 of file PrintHelper.h.

float m_applicationContentMarginTop = 0.03f [private]

3% margin at top and bottom leaves 94% for content.

Definition at line 86 of file PrintHelper.h.

PrintDocument m_printDocument [private]

PrintDocument is used to prepare the pages for printing.

Prepare the pages to print in the handlers for the Paginate, GetPreviewPage, and AddPages events.

Definition at line 65 of file PrintHelper.h.

Windows::Graphics::Printing::IPrintDocumentSource m_printDocumentSource [private]

Marker interface for document source.

Definition at line 70 of file PrintHelper.h.

std::vector<UIElement^> m_printPreviewPages [private]

A list of UIElements used to store the print preview pages.

This gives easy access to any desired preview page.

Definition at line 76 of file PrintHelper.h.

Windows::Foundation::EventRegistrationToken m_printTaskRequestedEventToken [private]

Print task requested event registration token.

Definition at line 54 of file PrintHelper.h.

Page m_scenarioPage [private]

A reference back to the scenario page used to access XAML elements on the scenario page.

Definition at line 59 of file PrintHelper.h.

Property Documentation

FrameworkElement FirstPage [protected]

The percent of app's margin width.

First page in the printing-content series From this "virtual sized" paged content is split(text is flowing) to "printing pages"

Definition at line 141 of file PrintHelper.h.

The documentation for this class was generated from the following files:
  • Printing/cpp/PrintHelper.h
  • Printing/cpp/PrintHelper.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProtectionLevelSelectorInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ProtectionLevelSelectorInfo
Properties

ProtectionLevelSelectorInfo Struct Reference

List of all members.

Properties

string | DisplayName [get, set]
DevicePairingProtectionLevel | ProtectionLevel [get, set]

Detailed Description

Definition at line 229 of file DisplayHelpers.cs.

Property Documentation

string DisplayName [get, set]

Definition at line 231 of file DisplayHelpers.cs.

DevicePairingProtectionLevel ProtectionLevel [get, set]

Definition at line 232 of file DisplayHelpers.cs.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cs/DisplayHelpers.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • RadioModel
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

RadioModel Class Reference

List of all members.

Public Member Functions

RadioModel (Radio radio, CoreDispatcher dispatcher)

Properties

bool | IsEnabled [get, set]
bool | IsRadioOn [get, set]
string | Name [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")
async void | Radio_StateChanged (Radio sender, object args)
async void | SetRadioState (bool isRadioOn)

Private Attributes

CoreDispatcher | dispatcher
bool | isEnabled
Radio | radio

Detailed Description

Definition at line 21 of file RadioModel.cs.

Constructor & Destructor Documentation

RadioModel | ( | Radio | radio,
 |  | CoreDispatcher | dispatcher |
 | ) |  |  | [inline]

Definition at line 27 of file RadioModel.cs.

        {
            this.radio = radio;
            // Controlling the mobile broadband radio requires the cellularDeviceControl restricted capability, which we do not have.
            this.isEnabled = (radio.Kind != RadioKind.MobileBroadband);
            this.dispatcher = dispatcher;
            this.radio.StateChanged += Radio_StateChanged;
        }

Member Function Documentation

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 81 of file RadioModel.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

async void Radio_StateChanged | ( | Radio | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 36 of file RadioModel.cs.

        {
            // The Radio StateChanged event doesn't run from the UI thread, so we must use the dispatcher
            // to run NotifyPropertyChanged
            await this.dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                NotifyPropertyChanged("IsRadioOn");
            });
        }

async void SetRadioState ( bool isRadioOn ) [inline, private]

Definition at line 89 of file RadioModel.cs.

        {
            if (isRadioOn != IsRadioOn)
            {
                var radioState = isRadioOn ? RadioState.On : RadioState.Off;
                IsEnabled = false;
                await this.radio.SetStateAsync(radioState);
                NotifyPropertyChanged("IsRadioOn");
                IsEnabled = true;
            }
        }

Member Data Documentation

CoreDispatcher dispatcher [private]

Definition at line 25 of file RadioModel.cs.

bool isEnabled [private]

Definition at line 24 of file RadioModel.cs.

Radio radio [private]

Definition at line 23 of file RadioModel.cs.

Property Documentation

bool IsEnabled [get, set]

Definition at line 67 of file RadioModel.cs.

bool IsRadioOn [get, set]

Definition at line 55 of file RadioModel.cs.

string Name [get]

Definition at line 47 of file RadioModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 79 of file RadioModel.cs.

The documentation for this class was generated from the following file:
  • RadioManager/cs/RadioModel.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReadBytes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ReadBytes
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ReadBytes Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ReadBytes ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | HexDump (object sender, RoutedEventArgs e)
void | PrintRow (byte[] bytes, uint currByte)

Private Attributes

const int | bytesPerRow = 16
const int | bytesPerSegment = 2
const uint | chunkSize = 4096
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_ReadBytes.xaml.cs.

Constructor & Destructor Documentation

ReadBytes ( ) [inline]

Definition at line 32 of file Scenario2_ReadBytes.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void HexDump | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Hex Dump' button.

Open the image file we want to perform a hex dump on. Then open a sequential-access stream over the file and use ReadBytes() to extract the binary data. Finally, convert each byte to hexadecimal, and display the formatted output in the HexDump textblock.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 54 of file Scenario2_ReadBytes.xaml.cs.

        {
            try
            {
                // Retrieve the uri of the image and use that to load the file.
                Uri uri = new Uri("ms-appx:///assets/microsoft-sdk.png");
                var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(uri);

                // Open a sequential-access stream over the image file.
                using (var inputStream = await file.OpenSequentialReadAsync())
                {
                    // Pass the input stream to the DataReader.
                    using (var dataReader = new Windows.Storage.Streams.DataReader(inputStream))
                    {
                        uint currChunk = 0;
                        uint numBytes;
                        ReadBytesOutput.Text = "";

                        // Create a byte array which can hold enough bytes to populate a row of the hex dump.
                        var bytes = new byte[bytesPerRow];

                        do
                        {
                            // Load the next chunk into the DataReader buffer.
                            numBytes = await dataReader.LoadAsync(chunkSize);

                            // Read and print one row at a time.
                            var numBytesRemaining = numBytes;
                            while (numBytesRemaining >= bytesPerRow)
                            {
                                // Use the DataReader and ReadBytes() to fill the byte array with one row worth of bytes.
                                dataReader.ReadBytes(bytes);

                                PrintRow(bytes, (numBytes - numBytesRemaining) + (currChunk * chunkSize));

                                numBytesRemaining -= bytesPerRow;
                            }

                            // If there are any bytes remaining to be read, allocate a new array that will hold
                            // the remaining bytes read from the DataReader and print the final row.
                            // Note: ReadBytes() fills the entire array so if the array being passed in is larger
                            // than what's remaining in the DataReader buffer, an exception will be thrown.
                            if (numBytesRemaining > 0)
                            {
                                bytes = new byte[numBytesRemaining];

                                // Use the DataReader and ReadBytes() to fill the byte array with the last row worth of bytes.
                                dataReader.ReadBytes(bytes);

                                PrintRow(bytes, (numBytes - numBytesRemaining) + (currChunk * chunkSize));
                            }

                            currChunk++;
                        // If the number of bytes read is anything but the chunk size, then we've just retrieved the last
                        // chunk of data from the stream.  Otherwise, keep loading data into the DataReader buffer.
                        } while (numBytes == chunkSize);
                    }
                }
            }
            catch (Exception ex)
            {
                ReadBytesOutput.Text = ex.Message;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 42 of file Scenario2_ReadBytes.xaml.cs.

        {
        }

void PrintRow | ( | byte[] | bytes,
 |  | uint | currByte |
 | ) |  |  | [inline, private]

Format and print a row of the hex dump using the data retrieved by ReadBytes().

Parameters:
bytes | An array that holds the data we want to format and output.
currByte | Value to be formatted into an address.

Definition at line 124 of file Scenario2_ReadBytes.xaml.cs.

        {
            var rowStr = "";

            // Format the address of byte i to have 8 hexadecimal digits and add the address
            // of the current byte to the output string.
            rowStr += currByte.ToString("x8");

            // Format the output:
            for (int i = 0; i < bytes.Length; i++)
            {
                // If finished with a segment, add a space.
                if (i % bytesPerSegment == 0)
                {
                    rowStr += " ";
                }

                // Convert the current byte value to hex and add it to the output string.
                rowStr += bytes[i].ToString("x2");
            }

            // Append the current row to the HexDump textblock.
            ReadBytesOutput.Text += rowStr + "\n";
        }

Member Data Documentation

const int bytesPerRow = 16 [private]

Definition at line 28 of file Scenario2_ReadBytes.xaml.cs.

const int bytesPerSegment = 2 [private]

Definition at line 29 of file Scenario2_ReadBytes.xaml.cs.

const uint chunkSize = 4096 [private]

Definition at line 30 of file Scenario2_ReadBytes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario2_ReadBytes.xaml.cs.

The documentation for this class was generated from the following files:
  • DataReaderWriter/cs/Scenario2_ReadBytes.xaml.cs
  • DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RectRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • RectRenderer
Public Member Functions | Private Attributes

RectRenderer Class Reference

#include "RectRenderer.h"

List of all members.

Public Member Functions

RectRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | CreateDeviceDependentResources ()
bool | HitTest (Windows::Foundation::Point position)
void | ReleaseDeviceDependentResources ()
void | Render ()
void | ResetRect ()
void | SetBrushColor (D2D1::ColorF newColor)
void | SetRectSize (float newSize)
void | UpdateRectTransform (Windows::Foundation::Point newPosition, Windows::UI::Input::ManipulationDelta newDelta)

Private Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		brush
std::shared_ptr
< DX::DeviceResources > 		deviceResources
D2D1_RECT_F | rect
float | rectSize
D2D1::Matrix3x2F | rectTransform

Detailed Description

Definition at line 20 of file RectRenderer.h.

Constructor & Destructor Documentation

RectRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Definition at line 27 of file RectRenderer.cpp.

                                                                                :
    deviceResources(deviceResources),
    rect(),
    rectTransform()
{
    CreateDeviceDependentResources();

    //Initialize start position and rect size
    rectTransform = D2D1::Matrix3x2F::Identity();
    rectSize = bigRectSize;
}

Member Function Documentation

void CreateDeviceDependentResources ( )

Definition at line 39 of file RectRenderer.cpp.

{
    // Create a brush with which to draw the rect.
    DX::ThrowIfFailed(
        deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::LightSlateGray),
            &brush
            )
        );
}

bool HitTest ( Windows::Foundation::Point position )
void ReleaseDeviceDependentResources ( )

Definition at line 52 of file RectRenderer.cpp.

{
    brush.Reset();
}

void Render ( )

Definition at line 58 of file RectRenderer.cpp.

{
    ComPtr<ID2D1DeviceContext1> deviceContext = deviceResources->GetD2DDeviceContext();

    deviceContext->BeginDraw();

    // Rotate the rendered scene based on the current orientation of the device and rotation of the rect
    deviceContext->SetTransform(rectTransform * deviceResources->GetOrientationTransform2D());

    // Draw the rect at its current position.
    rect = D2D1::RectF(0, 0, rectSize, rectSize);
    deviceContext->FillRectangle(rect, brush.Get());

    // Restore the transform to nothing.
    deviceContext->SetTransform(D2D1::Matrix3x2F::Identity());

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = deviceContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        DX::ThrowIfFailed(hr);
    }
}

void ResetRect ( )

Definition at line 118 of file RectRenderer.cpp.

{
    rectTransform = D2D1::Matrix3x2F::Identity() * D2D1::Matrix3x2F::Translation(0, 0);
}

void SetBrushColor ( D2D1::ColorF newColor )

Definition at line 123 of file RectRenderer.cpp.

{
    brush->SetColor(color);
}

void SetRectSize ( float newSize )

Definition at line 113 of file RectRenderer.cpp.

{
    rectSize = newSize;
}

void UpdateRectTransform | ( | Windows::Foundation::Point | newPosition,
 |  | Windows::UI::Input::ManipulationDelta | newDelta
 | ) |  |

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush [private]

Definition at line 39 of file RectRenderer.h.

std::shared_ptr<DX::DeviceResources> deviceResources [private]

Definition at line 36 of file RectRenderer.h.

D2D1_RECT_F rect [private]

Definition at line 42 of file RectRenderer.h.

float rectSize [private]

Definition at line 45 of file RectRenderer.h.

D2D1::Matrix3x2F rectTransform [private]

Definition at line 48 of file RectRenderer.h.

The documentation for this class was generated from the following files:
  • LowLatencyInput/cpp/Content/RectRenderer.h
  • LowLatencyInput/cpp/Content/RectRenderer.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RfcommChatDeviceDisplay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • RfcommChatDeviceDisplay
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

RfcommChatDeviceDisplay Class Reference

List of all members.

Public Member Functions

RfcommChatDeviceDisplay (DeviceInformation deviceInfoIn)
void | Update (DeviceInformationUpdate deviceInfoUpdate)

Protected Member Functions

void | OnPropertyChanged (string name)

Properties

DeviceInformation | DeviceInformation [get, set]
BitmapImage | GlyphBitmapImage [get, set]
string | Id [get]
string | Name [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

async void | UpdateGlyphBitmapImage ()

Private Attributes

DeviceInformation | deviceInfo

Detailed Description

Definition at line 511 of file Scenario1_ChatClient.xaml.cs.

Constructor & Destructor Documentation

RfcommChatDeviceDisplay ( DeviceInformation deviceInfoIn ) [inline]

Definition at line 515 of file Scenario1_ChatClient.xaml.cs.

        {
            deviceInfo = deviceInfoIn;
            UpdateGlyphBitmapImage();
        }

Member Function Documentation

void OnPropertyChanged ( string name ) [inline, protected]

Definition at line 572 of file Scenario1_ChatClient.xaml.cs.

        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }

void Update ( DeviceInformationUpdate deviceInfoUpdate ) [inline]

Definition at line 556 of file Scenario1_ChatClient.xaml.cs.

        {
            deviceInfo.Update(deviceInfoUpdate);
            UpdateGlyphBitmapImage();
        }

async void UpdateGlyphBitmapImage ( ) [inline, private]

Definition at line 562 of file Scenario1_ChatClient.xaml.cs.

        {
            DeviceThumbnail deviceThumbnail = await deviceInfo.GetGlyphThumbnailAsync();
            BitmapImage glyphBitmapImage = new BitmapImage();
            await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
            GlyphBitmapImage = glyphBitmapImage;
            OnPropertyChanged("GlyphBitmapImage");
        }

Member Data Documentation

DeviceInformation deviceInfo [private]

Definition at line 513 of file Scenario1_ChatClient.xaml.cs.

Property Documentation

DeviceInformation DeviceInformation [get, set]

Definition at line 522 of file Scenario1_ChatClient.xaml.cs.

BitmapImage GlyphBitmapImage [get, set]

Definition at line 551 of file Scenario1_ChatClient.xaml.cs.

string Id [get]

Definition at line 535 of file Scenario1_ChatClient.xaml.cs.

string Name [get]

Definition at line 543 of file Scenario1_ChatClient.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 571 of file Scenario1_ChatClient.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothRfcommChat/cs/Scenario1_ChatClient.xaml.cs
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S1_AddWithAPI Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S1_AddWithAPI
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S1_AddWithAPI Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S1_AddWithAPI ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file S1_AddWithAPI.xaml.cs.

Constructor & Destructor Documentation

S1_AddWithAPI ( ) [inline]

Definition at line 29 of file S1_AddWithAPI.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file S1_AddWithAPI.xaml.cs.

        {
            if (ItemKeyInput.Text == "")
            {
                rootPage.NotifyUser("You must add an item key to insert an item into the index.", NotifyType.ErrorMessage);
            }
            else
            {
                // Write the content property to a stream
                var contentStream = new Windows.Storage.Streams.InMemoryRandomAccessStream();
                var contentWriter = new Windows.Storage.Streams.DataWriter(contentStream);
                contentWriter.WriteString(ContentInput.Text);
                await contentWriter.StoreAsync();
                contentStream.Seek(0);

                // Get the name, keywords, and comment properties, and assign a language to them if provided
                object itemNameValue = NameInput.Text;
                object keywordsValue = KeywordsInput.Text;
                object commentValue = CommentInput.Text;
                if (LanguageInput.Text != "")
                {
                    var itemNameValueAndLanguage = new Windows.Storage.Search.ValueAndLanguage();
                    itemNameValueAndLanguage.Language = LanguageInput.Text;
                    itemNameValueAndLanguage.Value = itemNameValue;
                    itemNameValue = itemNameValueAndLanguage;
                    var keywordsValueAndLanguage = new Windows.Storage.Search.ValueAndLanguage();
                    keywordsValueAndLanguage.Language = LanguageInput.Text;
                    keywordsValueAndLanguage.Value = keywordsValue;
                    keywordsValue = keywordsValueAndLanguage;
                    var commentValueAndLanguage = new Windows.Storage.Search.ValueAndLanguage();
                    commentValueAndLanguage.Language = LanguageInput.Text;
                    commentValueAndLanguage.Value = commentValue;
                    commentValue = commentValueAndLanguage;
                }

                // Create the item to add to the indexer
                var content = new Windows.Storage.Search.IndexableContent();
                content.Id = ItemKeyInput.Text;
                content.Properties.Add(Windows.Storage.SystemProperties.ItemNameDisplay, itemNameValue);
                content.Properties.Add(Windows.Storage.SystemProperties.Keywords, keywordsValue);
                content.Properties.Add(Windows.Storage.SystemProperties.Comment, commentValue);
                content.Stream = contentStream;
                content.StreamContentType = "text/plain";

                // Add the item to the indexer
                Helpers.OnIndexerOperationBegin();
                var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
                await indexer.AddAsync(content);
                Helpers.OnIndexerOperationComplete(indexer);

                // Retrieve the item from the indexer and output its properties
                var retrievedProperties = await indexer.RetrievePropertiesAsync(ItemKeyInput.Text, content.Properties.Keys);
                rootPage.NotifyUser(Helpers.CreateItemString(ItemKeyInput.Text, content.Properties.Keys, retrievedProperties), NotifyType.StatusMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file S1_AddWithAPI.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file S1_AddWithAPI.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S1_AddWithAPI.xaml.cs
  • ContentIndexer/cpp/S1_AddWithAPI.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S2_UpdateAndDeleteWithAPI Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S2_UpdateAndDeleteWithAPI
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S2_UpdateAndDeleteWithAPI Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S2_UpdateAndDeleteWithAPI ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)
void | DeleteAllItems_Click (object sender, RoutedEventArgs e)
delegate IAsyncAction | DeleteFunction (Windows.Storage.Search.ContentIndexer indexer)
async void | DeleteItemsHelper (DeleteFunction deleteFunction)
void | DeleteKeywords_Click (object sender, RoutedEventArgs e)
void | DeleteMultipleItems_Click (object sender, RoutedEventArgs e)
void | DeleteSingleItem_Click (object sender, RoutedEventArgs e)
void | UpdateName_Click (object sender, RoutedEventArgs e)
async void | UpdatePropertyHelper (string itemKey, string propertyKey, string propertyName, object newValue)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

Constructor & Destructor Documentation

S2_UpdateAndDeleteWithAPI ( ) [inline]

Definition at line 30 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
            string outputString = await Helpers.AddItemsToIndex(indexer);
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

void DeleteAllItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes all items added to the index by this app via the ContentIndexer.

Definition at line 150 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            DeleteItemsHelper(indexer => indexer.DeleteAllAsync());
        }

delegate IAsyncAction DeleteFunction ( Windows.Storage.Search.ContentIndexer indexer ) [private]
async void DeleteItemsHelper ( DeleteFunction deleteFunction ) [inline, private]

Definition at line 106 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();

            // Log the original number of items
            string[] propertiesToRetrieve = { Windows.Storage.SystemProperties.ItemNameDisplay };
            var query = indexer.CreateQuery("*", propertiesToRetrieve);
            uint count = await query.GetCountAsync();
            var outputString = "Original number of items: " + count;
            Helpers.OnIndexerOperationBegin();

            // Call the deletion function
            await deleteFunction(indexer);

            // Log the new number of items
            Helpers.OnIndexerOperationComplete(indexer);
            query = indexer.CreateQuery("*", propertiesToRetrieve);
            count = await query.GetCountAsync();
            outputString += "\nNew number of items: " + count;
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

void DeleteKeywords_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes the Keywords property for the indexed item with the key "Sample0.".

Definition at line 99 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            UpdatePropertyHelper("SampleKey0", Windows.Storage.SystemProperties.Keywords, "keywords", null);
        }

void DeleteMultipleItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes the indexed items with the keys "SampleKey1" and "SampleKey2" added to the index by this app via the ContentIndexer.

Definition at line 141 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            string[] keys = { "SampleKey1", "SampleKey2" };
            DeleteItemsHelper(indexer => indexer.DeleteMultipleAsync(keys));
        }

void DeleteSingleItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes the indexed item with the key "SampleKey0" added to the index by this app via the ContentIndexer.

Definition at line 132 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            DeleteItemsHelper(indexer => indexer.DeleteAsync("SampleKey0"));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 41 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
        }

void UpdateName_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function updates the ItemNameDisplay property for the indexed item with the key "Sample 0." The updated ItemNameDisplay property comes from the itemNameInput text box.

Definition at line 91 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            UpdatePropertyHelper("SampleKey0", Windows.Storage.SystemProperties.ItemNameDisplay, "item name", ItemNameInput.Text);
        }

async void UpdatePropertyHelper | ( | string | itemKey,
 |  | string | propertyKey,
 |  | string | propertyName,
 |  | object | newValue |
 | ) |  |  | [inline, private]

Definition at line 52 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
            string[] propertiesToRetrieve = { propertyKey };

            try
            {
                // Log the original value of the property
                var retrievedProperties = await indexer.RetrievePropertiesAsync(itemKey, propertiesToRetrieve);
                var outputString = "Original " + propertyName + ": " + Helpers.StringifyProperty(retrievedProperties[propertyKey]);

                // Create an indexable content item to update the property
                var content = new Windows.Storage.Search.IndexableContent();
                content.Properties.Add(propertyKey, newValue);
                content.Id = itemKey;

                // Update the indexer
                Helpers.OnIndexerOperationBegin();
                await indexer.UpdateAsync(content);
                Helpers.OnIndexerOperationComplete(indexer);

                // Log the new value of the property
                retrievedProperties = await indexer.RetrievePropertiesAsync(itemKey, propertiesToRetrieve);
                outputString += "\nNew " + propertyName + ": " + Helpers.StringifyProperty(retrievedProperties[propertyKey]);
                rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Exception thrown! Did you try to retrieve or update a property on a non-existent item?" +
                                    "\nMessage: " + err.Message +
                                    "\nHRESULT: " + String.Format("{0,8:X}", err.HResult),
                                    NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file S2_UpdateAndDeleteWithAPI.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S2_UpdateAndDeleteWithAPI.xaml.cs
  • ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S3_RetrieveWithAPI Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S3_RetrieveWithAPI
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S3_RetrieveWithAPI Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S3_RetrieveWithAPI ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)
async void | ExecuteQueryHelper (string queryString)
void | RetrieveAllItems_Click (object sender, RoutedEventArgs e)
void | RetrieveMatchingItems_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file S3_RetrieveWithAPI.xaml.cs.

Constructor & Destructor Documentation

S3_RetrieveWithAPI ( ) [inline]

Definition at line 29 of file S3_RetrieveWithAPI.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file S3_RetrieveWithAPI.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
            string outputString = await Helpers.AddItemsToIndex(indexer);
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

async void ExecuteQueryHelper ( string queryString ) [inline, private]

Definition at line 51 of file S3_RetrieveWithAPI.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
            string[] propertyKeys =
            {
                Windows.Storage.SystemProperties.ItemNameDisplay,
                Windows.Storage.SystemProperties.Keywords,
                Windows.Storage.SystemProperties.Comment
            };
            var query = indexer.CreateQuery(queryString, propertyKeys);
            var documents = await query.GetAsync();
            string outputString = "";
            foreach (var document in documents)
            {
                outputString += Helpers.CreateItemString(document.Id, propertyKeys, document.Properties) + "\n";
            }
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file S3_RetrieveWithAPI.xaml.cs.

        {
        }

void RetrieveAllItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function retrieves all items added to the index by this app via the ContentIndexer.

Definition at line 73 of file S3_RetrieveWithAPI.xaml.cs.

        {
            ExecuteQueryHelper("*");
        }

void RetrieveMatchingItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function retrieves all items added to the index by this app via the ContentIndexer which contain the work "0" in either the ItemNameDisplay, Keywords, or Comment properties.

Definition at line 82 of file S3_RetrieveWithAPI.xaml.cs.

        {
            ExecuteQueryHelper("0");
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file S3_RetrieveWithAPI.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S3_RetrieveWithAPI.xaml.cs
  • ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S4_CheckIndexRevision Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S4_CheckIndexRevision
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S4_CheckIndexRevision Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S4_CheckIndexRevision ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CheckIndexRevision_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file S4_CheckIndexRevision.xaml.cs.

Constructor & Destructor Documentation

S4_CheckIndexRevision ( ) [inline]

Definition at line 28 of file S4_CheckIndexRevision.xaml.cs.

        {
            this.InitializeComponent();

            // This initializes the value used throughout the sample which tracks the expected index revision number. This
            // value is used to check if the app's expected revision number matches the actual index revision number and is
            // stored in the app's local settings to allow it to persist across termination.
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            if (!localSettings.Values.ContainsKey("expectedIndexRevision"))
            {
                localSettings.Values.Add("expectedIndexRevision", (ulong)0);
            }
        }

Member Function Documentation

void CheckIndexRevision_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function displays the app's expected index revision number and the actual index revision number reported by the index.

For purposes of this sample, this is done in reaction to a button being pressed. In practice, this should be done when an app is activated. If the reported index revision number is 0, it means the index has been reset and an app should re-push all of its data. If the reported index revision number is not 0, but doesn't match the app's expected index revision number, it indicates that not all of the app's adds/deletes/updates were successfully processed. This should be an edge case, but when hit, the app should re-do the missed operations. Tracking the expected index revision number can be used to create checkpoints in the app so it can only re-do the operations required to match the expected index revision number.

Definition at line 63 of file S4_CheckIndexRevision.xaml.cs.

        {
            var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            var expectedRevisionNumber = localSettings.Values["expectedIndexRevision"];
            string outputString = "Expected Index Revision Number: " + expectedRevisionNumber;
            outputString += "\nReported Index Revision Number: " + indexer.Revision;
            if ((ulong)expectedRevisionNumber != indexer.Revision)
            {
                // There is a mismatch between the expected and reported index revision numbers.
                if (indexer.Revision == 0)
                {
                    // The index has been reset, so code would be added here to re-push all data.
                }
                else
                {
                    // The index hasn't been reset, but it doesn't contain all expected updates, so add code to get the index
                    // back into the expected state.
                }

                // After doing the necessary work to get back to a synchronized state, set the expected index revision number
                // to match the reported revision number.
                localSettings.Values["expectedIndexRevision"] = indexer.Revision;
            }
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file S4_CheckIndexRevision.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file S4_CheckIndexRevision.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S4_CheckIndexRevision.xaml.cs
  • ContentIndexer/cpp/S4_CheckIndexRevision.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S5_AddWithAppContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S5_AddWithAppContent
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S5_AddWithAppContent Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S5_AddWithAppContent ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file S5_AddWithAppContent.xaml.cs.

Constructor & Destructor Documentation

S5_AddWithAppContent ( ) [inline]

Definition at line 28 of file S5_AddWithAppContent.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file S5_AddWithAppContent.xaml.cs.

        {
            var outputString = await Helpers.AddAppContentFilesToIndexedFolder();
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file S5_AddWithAppContent.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file S5_AddWithAppContent.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S5_AddWithAppContent.xaml.cs
  • ContentIndexer/cpp/S5_AddWithAppContent.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S6_DeleteWithAppContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S6_DeleteWithAppContent
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S6_DeleteWithAppContent Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S6_DeleteWithAppContent ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)
async void | DeleteAllItems_Click (object sender, RoutedEventArgs e)
async void | DeleteSingleItem_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file S6_DeleteWithAppContent.xaml.cs.

Constructor & Destructor Documentation

S6_DeleteWithAppContent ( ) [inline]

Definition at line 28 of file S6_DeleteWithAppContent.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file S6_DeleteWithAppContent.xaml.cs.

        {
            var outputString = await Helpers.AddAppContentFilesToIndexedFolder();
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

async void DeleteAllItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes all appcontent-ms files in the "LocalState\Indexed" folder.

Upon deletion, the indexer is notified and the content indexed from these files is removed from the index.

Definition at line 76 of file S6_DeleteWithAppContent.xaml.cs.

        {
            var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
            var files = await indexedFolder.GetFilesAsync();
            var outputString = "Items deleted from the \"Indexed\" folder:";
            foreach (var file in files)
            {
                outputString += "\n" + file.DisplayName;
                await file.DeleteAsync();
            }
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

async void DeleteSingleItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function deletes a single appcontent-ms file, "sample1.appcontent-ms".

Upon deletion, the indexer is notified and the content indexed from this file is removed from the index.

Definition at line 53 of file S6_DeleteWithAppContent.xaml.cs.

        {
            var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
            try
            {
                var file = await indexedFolder.GetFileAsync("sample1.appcontent-ms");
                await file.DeleteAsync();
                rootPage.NotifyUser("Items deleted from the \"Indexed\" folder: " + file.DisplayName, NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Exception thrown! Did you already delete the \"sample1.appcontent-ms\" file?" +
                                    "\nMessage: " + err.Message +
                                    "\nHRESULT: " + String.Format("{0,8:X}", err.HResult),
                                    NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file S6_DeleteWithAppContent.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file S6_DeleteWithAppContent.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S6_DeleteWithAppContent.xaml.cs
  • ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S7_RetrieveWithAppContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • S7_RetrieveWithAppContent
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S7_RetrieveWithAppContent Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S7_RetrieveWithAppContent ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddToIndex_Click (object sender, RoutedEventArgs e)
delegate
Windows.Storage.Search.StorageFileQueryResult 		GetQueryDelegate (Windows.Storage.StorageFolder folder)
void | RetrieveAllItems_Click (object sender, RoutedEventArgs e)
async void | RetrieveAppContentHelper (GetQueryDelegate getQuery)
void | RetrieveMatchedItems_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file S7_RetrieveWithAppContent.xaml.cs.

Constructor & Destructor Documentation

S7_RetrieveWithAppContent ( ) [inline]

Definition at line 28 of file S7_RetrieveWithAppContent.xaml.cs.

        {
            this.InitializeComponent();
            Helpers.InitializeRevisionNumber();
        }

Member Function Documentation

async void AddToIndex_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file S7_RetrieveWithAppContent.xaml.cs.

        {
            var outputString = await Helpers.AddAppContentFilesToIndexedFolder();
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

delegate Windows.Storage.Search.StorageFileQueryResult GetQueryDelegate ( Windows.Storage.StorageFolder folder ) [private]
override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file S7_RetrieveWithAppContent.xaml.cs.

        {
        }

void RetrieveAllItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function retrieves all items added to the index through the app's appcontent-ms files.

Definition at line 78 of file S7_RetrieveWithAppContent.xaml.cs.

        {
            // Query for all files in the "LocalState\Indexed" folder and sort the results by name
            RetrieveAppContentHelper(folder => folder.CreateFileQuery(Windows.Storage.Search.CommonFileQuery.OrderByName));
        }

async void RetrieveAppContentHelper ( GetQueryDelegate getQuery ) [inline, private]

Definition at line 51 of file S7_RetrieveWithAppContent.xaml.cs.

        {
            var indexedFolder = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
            var query = getQuery(indexedFolder);
            var files = await query.GetFilesAsync();
            string[] propertyKeys =
            {
                Windows.Storage.SystemProperties.ItemNameDisplay,
                Windows.Storage.SystemProperties.Keywords,
                Windows.Storage.SystemProperties.Comment,
                Windows.Storage.SystemProperties.Title
            };
            var outputString = "";
            foreach (var file in files)
            {
                var retrievedProperties = await file.Properties.RetrievePropertiesAsync(propertyKeys);
                outputString += "Name: " + Helpers.StringifyProperty(retrievedProperties[Windows.Storage.SystemProperties.ItemNameDisplay]) + "\n";
                outputString += "Keywords: " + Helpers.StringifyProperty(retrievedProperties[Windows.Storage.SystemProperties.Keywords]) + "\n";
                outputString += "Comment: " + Helpers.StringifyProperty(retrievedProperties[Windows.Storage.SystemProperties.Comment]) + "\n";
                outputString += "Title: " + Helpers.StringifyProperty(retrievedProperties[Windows.Storage.SystemProperties.Title]) + "\n\n";
            }
            rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
        }

void RetrieveMatchedItems_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This function retrieves all items added to the index through the app's appcontent-ms files which have an ItemNameDisplay property containing "Sample 1".

Definition at line 88 of file S7_RetrieveWithAppContent.xaml.cs.

        {
            var queryOptions = new Windows.Storage.Search.QueryOptions();
            // Include only items returned via the index in the search results
            queryOptions.IndexerOption = Windows.Storage.Search.IndexerOption.OnlyUseIndexer;
            // Create an AQS (Advanced Query Syntax) query which will look for ItemNameDisplay properties which contain "Sample 1"
            queryOptions.ApplicationSearchFilter = Windows.Storage.SystemProperties.ItemNameDisplay + ":\"Sample 1\"";
            RetrieveAppContentHelper(folder => folder.CreateFileQueryWithOptions(queryOptions));
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file S7_RetrieveWithAppContent.xaml.cs.

The documentation for this class was generated from the following files:
  • ContentIndexer/cs/S7_RetrieveWithAppContent.xaml.cs
  • ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.cpp
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SampleBackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SampleBackgroundTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

SampleBackgroundTask ()
SampleBackgroundTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario1_SampleBackgroundTask.xaml.cs.

Constructor & Destructor Documentation

SampleBackgroundTask ( ) [inline]

Definition at line 34 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

SampleBackgroundTask ( ) [inline]

Definition at line 34 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.SampleBackgroundTaskProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.SampleBackgroundTaskProgress = progress;
                UpdateUI();
            });
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a SampleBackgroundTask.

Parameters:
sender
e

Definition at line 64 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
                                                                   BackgroundTaskSample.SampleBackgroundTaskName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a SampleBackgroundTask.

Parameters:
sender
e

Definition at line 64 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.SampleBackgroundTaskName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a SampleBackgroundTask.

Parameters:
sender
e

Definition at line 79 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskName);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a SampleBackgroundTask.

Parameters:
sender
e

Definition at line 79 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskName);
            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskRegistered;
                Progress.Text = BackgroundTaskSample.SampleBackgroundTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario1_SampleBackgroundTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskRegistered;
                Progress.Text = BackgroundTaskSample.SampleBackgroundTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskName);
            });
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario1_SampleBackgroundTask.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario1_SampleBackgroundTask.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cs
  • BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleBackgroundTaskWithCondition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SampleBackgroundTaskWithCondition
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SampleBackgroundTaskWithCondition Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

SampleBackgroundTaskWithCondition ()
SampleBackgroundTaskWithCondition ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 29 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

Constructor & Destructor Documentation

SampleBackgroundTaskWithCondition ( ) [inline]

Definition at line 35 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            this.InitializeComponent();
        }

SampleBackgroundTaskWithCondition ( ) [inline]

Definition at line 35 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 90 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 90 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 116 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 116 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskWithConditionName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName, true);
                    break;
                }
            }

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskWithConditionName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName, true);
                    break;
                }
            }

            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 101 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 101 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress = progress;
                UpdateUI();
            });
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a SampleBackgroundTaskWithCondition.

Parameters:
sender
e

Definition at line 65 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
                                                                   BackgroundTaskSample.SampleBackgroundTaskWithConditionName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   new SystemCondition(SystemConditionType.InternetAvailable));
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a SampleBackgroundTaskWithCondition.

Parameters:
sender
e

Definition at line 65 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.SampleBackgroundTaskWithConditionName,
                                                                   new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
                                                                   new SystemCondition(SystemConditionType.InternetAvailable));
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a SampleBackgroundTaskWithCondition.

Parameters:
sender
e

Definition at line 80 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a SampleBackgroundTaskWithCondition.

Parameters:
sender
e

Definition at line 80 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 124 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
                Progress.Text = BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 124 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
                Progress.Text = BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
            });
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario2_SampleBackgroundTaskWithCondition.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs
  • BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleConstants Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SampleConstants
Public Attributes | Static Public Attributes

SampleConstants Struct Reference

List of all members.

Public Attributes

const string | Scenario1_DeviceUse_TaskEntryPoint = "BackgroundTask.Scenario1_BackgroundTask"
const string | Scenario1_DeviceUse_TaskName = "Scenario1_DeviceUse BackgroundTask"

Static Public Attributes

static Platform::String | Scenario1_TaskEntryPoint = "BackgroundTask.Scenario1_BackgroundTask"
static Platform::String | Scenario1_TaskName = "Scenario1_BackgroundTask"

Detailed Description

Definition at line 25 of file SampleConfiguration.cs.

Member Data Documentation

const string Scenario1_DeviceUse_TaskEntryPoint = "BackgroundTask.Scenario1_BackgroundTask"

Definition at line 28 of file SampleConfiguration.cs.

const string Scenario1_DeviceUse_TaskName = "Scenario1_DeviceUse BackgroundTask"

Definition at line 27 of file SampleConfiguration.cs.

Platform::String Scenario1_TaskEntryPoint = "BackgroundTask.Scenario1_BackgroundTask" [static]

Definition at line 42 of file SampleConfiguration.h.

Platform::String Scenario1_TaskName = "Scenario1_BackgroundTask" [static]

Definition at line 41 of file SampleConfiguration.h.

The documentation for this struct was generated from the following files:
  • BackgroundSensors/cs/SampleConfiguration.cs
  • BackgroundSensors/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleDataModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SampleDataModel
Public Member Functions | Static Public Member Functions | Properties

SampleDataModel Class Reference

List of all members.

Public Member Functions

SampleDataModel (string title, string imagePath)
override string | ToString ()

Static Public Member Functions

static List< SampleDataModel > | GetSampleData ()

Properties

string | ImagePath [get, set]
string | Title [get, set]

Detailed Description

Definition at line 6 of file SampleData.cs.

Constructor & Destructor Documentation

SampleDataModel | ( | string | title,
 |  | string | imagePath |
 | ) |  |  | [inline]

Definition at line 11 of file SampleData.cs.

        {
            this.Title = title;
            this.ImagePath = imagePath;
        }

Member Function Documentation

static List<SampleDataModel> GetSampleData ( ) [inline, static]

Definition at line 20 of file SampleData.cs.

        {
            return new List<SampleDataModel>() {
                new SampleDataModel("Cliff", "Assets/cliff.jpg"),
                new SampleDataModel("Grapes", "Assets/grapes.jpg"),
                new SampleDataModel("Rainier", "Assets/Rainier.jpg"),
                new SampleDataModel("Sunset", "Assets/Sunset.jpg"),
                new SampleDataModel("Treetops", "Assets/Treetops.jpg"),
                new SampleDataModel("Valley", "Assets/Valley.jpg"),
            };
        }

override string ToString ( )

Property Documentation

string ImagePath [get, set]

Definition at line 9 of file SampleData.cs.

string Title [get, set]

Definition at line 8 of file SampleData.cs.

The documentation for this class was generated from the following file:
  • XamlContextMenu/cs/SampleData.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SavingDataReason Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SavingDataReason
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SavingDataReason Class Reference

Page containing the Extended Execution SavingData Reason scenario functions.

List of all members.

Public Member Functions

SavingDataReason ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ExtendedExecutionSessionRevoked (object sender, ExtendedExecutionRevokedEventArgs args)
async void | OnSuspending (object sender, SuspendingEventArgs args)

Private Attributes

CancellationTokenSource | cancellationTokenSource
MainPage rootPage = MainPage.Current
SuspendingDeferral | suspendDeferral

Detailed Description

Definition at line 28 of file Scenario2_SavingDataReason.xaml.cs.

Constructor & Destructor Documentation

SavingDataReason ( ) [inline]

Definition at line 35 of file Scenario2_SavingDataReason.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ExtendedExecutionSessionRevoked | ( | object | sender,
 |  | ExtendedExecutionRevokedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario2_SavingDataReason.xaml.cs.

        {
            //If session is revoked, make the OnSuspending event handler stop or the application will be terminated
            if (cancellationTokenSource != null){ cancellationTokenSource.Cancel(); }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (args.Reason)
                {
                    case ExtendedExecutionRevokedReason.Resumed:
                        // A resumed app has returned to the foreground
                        rootPage.NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType.StatusMessage);
                        break;

                    case ExtendedExecutionRevokedReason.SystemPolicy:
                        //An app can be in the foreground or background when a revocation due to system policy occurs
                        MainPage.DisplayToast("Extended execution revoked due to system policy.");
                        rootPage.NotifyUser("Extended execution revoked due to system policy.", NotifyType.StatusMessage);
                        break;
                }

                suspendDeferral?.Complete();
                suspendDeferral = null;
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario2_SavingDataReason.xaml.cs.

        {
            // Add a suspension handler in order to request a SavingData Extended Execution.
            App.Current.Suspending += OnSuspending;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario2_SavingDataReason.xaml.cs.

        {
            App.Current.Suspending -= OnSuspending;
        }

async void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario2_SavingDataReason.xaml.cs.

        {
            suspendDeferral = args.SuspendingOperation.GetDeferral();

            rootPage.NotifyUser("", NotifyType.StatusMessage);

            using (var session = new ExtendedExecutionSession())
            {
                session.Reason = ExtendedExecutionReason.SavingData;
                session.Description = "Pretending to save data to slow storage.";
                session.Revoked += ExtendedExecutionSessionRevoked;

                ExtendedExecutionResult result = await session.RequestExtensionAsync();
                switch (result)
                {
                    case ExtendedExecutionResult.Allowed:
                        // We can perform a longer save operation (e.g., upload to the cloud).
                        try
                        {
                            MainPage.DisplayToast("Performing a long save operation.");
                            cancellationTokenSource = new CancellationTokenSource();
                            await Task.Delay(TimeSpan.FromSeconds(10), cancellationTokenSource.Token);
                            MainPage.DisplayToast("Still saving.");
                            await Task.Delay(TimeSpan.FromSeconds(10), cancellationTokenSource.Token);
                            MainPage.DisplayToast("Long save complete.");
                        }
                        catch (TaskCanceledException) { }
                        break;
                    default:
                    case ExtendedExecutionResult.Denied:
                        // We must perform a fast save operation.
                        MainPage.DisplayToast("Performing a fast save operation.");
                        await Task.Delay(TimeSpan.FromSeconds(1));
                        MainPage.DisplayToast("Fast save complete.");
                        break;
                }

                session.Revoked -= ExtendedExecutionSessionRevoked;
            }

            suspendDeferral?.Complete();
            suspendDeferral = null;
        }

Member Data Documentation

CancellationTokenSource cancellationTokenSource [private]

Definition at line 32 of file Scenario2_SavingDataReason.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario2_SavingDataReason.xaml.cs.

SuspendingDeferral suspendDeferral [private]

Definition at line 33 of file Scenario2_SavingDataReason.xaml.cs.

The documentation for this class was generated from the following files:
  • ExtendedExecution/cs/Scenario2_SavingDataReason.xaml.cs
  • ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario
Public Member Functions | Static Public Member Functions | Public Attributes | Properties

Scenario Struct Reference

Scenario Class Object. More...

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()
override string | ToString ()

Static Public Member Functions

static async Task
< Windows.Data.Xml.Dom.XmlDocument > 		LoadXmlFile (String folder, String file)
static void | RichEditBoxSetError (RichEditBox richEditBox, String errorMsg)
static void | RichEditBoxSetMsg (RichEditBox richEditBox, String msg, bool fReadOnly)
static void | RichEditBoxSetText (RichEditBox richEditBox, String msg, Windows.UI.Color color, bool fReadOnly)

Public Attributes

Platform::String | ClassName
String | ClassName
String | Title
Platform::String | Title

Properties

Type | ClassType [get, set]
string | Description [get, set]
string | Title [get, set]

Detailed Description

Definition at line 29 of file SampleConfiguration.cs.

Member Function Documentation

static async Task<Windows.Data.Xml.Dom.XmlDocument> LoadXmlFile | ( | String | folder,
 |  | String | file |
 | ) |  |  | [inline, static]

Definition at line 46 of file SampleConfiguration.cs.

        {
            Windows.Storage.StorageFolder storageFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(folder);
            Windows.Storage.StorageFile storageFile = await storageFolder.GetFileAsync(file);
            Windows.Data.Xml.Dom.XmlLoadSettings loadSettings = new Windows.Data.Xml.Dom.XmlLoadSettings();
            loadSettings.ProhibitDtd = false;
            loadSettings.ResolveExternals = false;
            return await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(storageFile, loadSettings);
        }

static void RichEditBoxSetError | ( | RichEditBox | richEditBox,
 |  | String | errorMsg |
 | ) |  |  | [inline, static]

Definition at line 64 of file SampleConfiguration.cs.

        {
            RichEditBoxSetText(richEditBox, errorMsg, Windows.UI.Colors.Red, true);
        }

static void RichEditBoxSetMsg | ( | RichEditBox | richEditBox,
 |  | String | msg,
 |  | bool | fReadOnly |
 | ) |  |  | [inline, static]

Definition at line 69 of file SampleConfiguration.cs.

        {
            RichEditBoxSetText(richEditBox, msg, Windows.UI.Colors.White, fReadOnly);
        }

static void RichEditBoxSetText | ( | RichEditBox | richEditBox,
 |  | String | msg,
 |  | Windows.UI.Color | color,
 |  | bool | fReadOnly |
 | ) |  |  | [inline, static]

Definition at line 56 of file SampleConfiguration.cs.

        {
            richEditBox.IsReadOnly = false;
            richEditBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, msg);
            richEditBox.Foreground = new SolidColorBrush(color);
            richEditBox.IsReadOnly = fReadOnly;
        }

override string ToString ( ) [inline]

Definition at line 41 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 41 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 124 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 35 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 43 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 47 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 52 of file constants.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 39 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 41 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 43 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 48 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 68 of file SampleConfiguration.cs.

        {
            return Title;
        }

override string ToString ( ) [inline]

Definition at line 44 of file SampleConfiguration.cs.

        {
            return Title;
        }

Member Data Documentation

Platform::String ClassName

Definition at line 60 of file SampleConfiguration.h.

String ClassName

Definition at line 37 of file SampleConfiguration.h.

String Title

Definition at line 36 of file SampleConfiguration.h.

Platform::String Title

Definition at line 59 of file SampleConfiguration.h.

Property Documentation

Type ClassType [get, set]

Definition at line 32 of file SampleConfiguration.cs.

string Description [get, set]

Definition at line 60 of file SampleConfiguration.cs.

Platform::String Title [get, set]

Definition at line 31 of file SampleConfiguration.cs.

The documentation for this struct was generated from the following files:
  • 3DPrinting/cs/SampleConfiguration.cs
  • Accelerometer/cpp/SampleConfiguration.h
  • Accelerometer/cs/SampleConfiguration.cs
  • ActivitySensor/cpp/SampleConfiguration.h
  • ActivitySensor/cs/SampleConfiguration.cs
  • AdaptiveStreaming/cs/SampleConfiguration.cs
  • AllJoyn/ConsumerExperiences/cs/SampleConfiguration.cs
  • AllJoyn/ProducerExperiences/cs/SampleConfiguration.cs
  • Altimeter/cpp/SampleConfiguration.h
  • Altimeter/cs/SampleConfiguration.cs
  • AnimationMetrics/cpp/SampleConfiguration.h
  • AnimationMetrics/cs/SampleConfiguration.cs
  • ApplicationData/cs/SampleConfiguration.cs
  • ApplicationResources/cpp/SampleConfiguration.h
  • ApplicationResources/cs/constants.cs
  • Appointments/cs/SampleConfiguration.cs
  • AppServices/cs/AppServicesClient/SampleConfiguration.cs
  • AppServices/cs/AppServicesProvider/SampleConfiguration.cs
  • AppWindow/cs/SampleConfiguration.cs
  • AssociationLaunching/cs/SampleConfiguration.cs
  • AudioCategory/cs/AudioCategory/SampleConfiguration.cs
  • AudioCreation/cs/AudioCreation/SampleConfiguration.cs
  • BackButton/cpp/SampleConfiguration.h
  • BackButton/cs/SampleConfiguration.cs
  • BackgroundActivation/cpp/SampleConfiguration.h
  • BackgroundActivation/cs/SampleConfiguration.cs
  • BackgroundMediaPlayback/cs/SampleConfiguration.cs
  • BackgroundSensors/cpp/SampleConfiguration.h
  • BackgroundSensors/cs/SampleConfiguration.cs
  • BackgroundTask/cpp/BackgroundTask/SampleConfiguration.h
  • BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.h
  • BackgroundTransfer/cs/BackgroundTransfer/SampleConfiguration.cs
  • BarcodeScanner/cs/SampleConfiguration.cs
  • BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h
  • BarcodeScannerProvider/cs/BarcodeScannerProvider/SampleConfiguration.cs
  • Barometer/cpp/SampleConfiguration.h
  • Barometer/cs/SampleConfiguration.cs
  • BasicFaceDetection/cs/SampleConfiguration.cs
  • BasicFaceTracking/cs/SampleConfiguration.cs
  • BasicInput/cpp/SampleConfiguration.h
  • BasicInput/cs/SampleConfiguration.cs
  • BasicMediaCasting/cs/SampleConfiguration.cs
  • BluetoothAdvertisement/cs/SampleConfiguration.cs
  • BluetoothLE/cs/SampleConfiguration.cs
  • BluetoothRfcommChat/cs/SampleConfiguration.cs
  • Calendar/cpp/SampleConfiguration.h
  • Calendar/cs/SampleConfiguration.cs
  • CameraFrames/cpp/SampleConfiguration.h
  • CameraFrames/cs/SampleConfiguration.cs
  • CameraOpenCV/cs/SampleConfiguration.cs
  • CameraProfile/cpp/SampleConfiguration.h
  • CameraProfile/cs/SampleConfiguration.cs
  • CameraResolution/cpp/SampleConfiguration.h
  • CameraResolution/cs/SampleConfiguration.cs
  • CameraStreamCorrelation/cpp/SampleConfiguration.h
  • Capabilities/cs/SampleConfiguration.cs
  • CashDrawer/cpp/SampleConfiguration.h
  • CashDrawer/cs/SampleConfiguration.cs
  • ClientDeviceInformation/cpp/SampleConfiguration.h
  • ClientDeviceInformation/cs/SampleConfiguration.cs
  • Clipboard/cs/SampleConfiguration.cs
  • Compass/cpp/SampleConfiguration.h
  • Compass/cs/SampleConfiguration.cs
  • ComplexInk/cpp/SampleConfiguration.h
  • Compression/cpp/SampleConfiguration.h
  • Compression/cs/SampleConfiguration.cs
  • ContactCardIntegration/cs/SampleConfiguration.cs
  • ContactCards/cpp/SampleConfiguration.h
  • ContactCards/cs/SampleConfiguration.cs
  • ContactPanel/cs/SampleConfiguration.cs
  • ContactPicker/cpp/SampleConfiguration.h
  • ContactPicker/cs/SampleConfiguration.cs
  • ContentIndexer/cpp/SampleConfiguration.h
  • ContentIndexer/cs/SampleConfiguration.cs
  • ContextMenu/cpp/SampleConfiguration.h
  • ContextMenu/cs/SampleConfiguration.cs
  • CredentialPicker/cpp/SampleConfiguration.h
  • CredentialPicker/cs/SampleConfiguration.cs
  • CustomCapability/cpp/SampleConfiguration.h
  • CustomCapability/cs/SampleConfiguration.cs
  • CustomEditControl/cs/SampleConfiguration.cs
  • CustomHidDeviceAccess/cpp/SampleConfiguration.h
  • CustomHidDeviceAccess/cs/SampleConfiguration.cs
  • CustomSensors/cpp/SampleConfiguration.h
  • CustomSensors/cs/SampleConfiguration.cs
  • CustomSerialDeviceAccess/cs/SampleConfiguration.cs
  • CustomUsbDeviceAccess/cs/SampleConfiguration.cs
  • DatagramSocket/cpp/SampleConfiguration.h
  • DatagramSocket/cs/SampleConfiguration.cs
  • DataReaderWriter/cpp/SampleConfiguration.h
  • DataReaderWriter/cs/SampleConfiguration.cs
  • DateTimeFormatting/cpp/SampleConfiguration.h
  • DateTimeFormatting/cs/SampleConfiguration.cs
  • DeviceEnumerationAndPairing/cpp/SampleConfiguration.h
  • DeviceEnumerationAndPairing/cs/SampleConfiguration.cs
  • DisablingScreenCapture/cpp/SampleConfiguration.h
  • DisablingScreenCapture/cs/SampleConfiguration.cs
  • DisplayOrientation/cpp/SampleConfiguration.h
  • DisplayOrientation/cs/SampleConfiguration.cs
  • DpiScaling/cpp/SampleConfiguration.h
  • DpiScaling/cs/SampleConfiguration.cs
  • DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.h
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.h
  • EnterpriseDataProtection/cs/SampleConfiguration.cs
  • ExtendedExecution/cpp/SampleConfiguration.h
  • ExtendedExecution/cs/SampleConfiguration.cs
  • FileAccess/cpp/SampleConfiguration.h
  • FileAccess/cs/SampleConfiguration.cs
  • FilePicker/cpp/SampleConfiguration.h
  • FilePicker/cs/SampleConfiguration.cs
  • FilePickerContracts/cs/SampleConfiguration.cs
  • FileSearch/cpp/SampleConfiguration.h
  • FileSearch/cs/SampleConfiguration.cs
  • FileThumbnails/cpp/SampleConfiguration.h
  • FileThumbnails/cs/SampleConfiguration.cs
  • FolderEnumeration/cpp/SampleConfiguration.h
  • FolderEnumeration/cs/SampleConfiguration.cs
  • FullScreenMode/cpp/SampleConfiguration.h
  • FullScreenMode/cs/SampleConfiguration.cs
  • Geolocation/cs/SampleConfiguration.cs
  • Geotag/cpp/SampleConfiguration.h
  • Geotag/cs/SampleConfiguration.cs
  • GlobalizationPreferences/cpp/SampleConfiguration.h
  • GlobalizationPreferences/cs/SampleConfiguration.cs
  • Gyrometer/cpp/SampleConfiguration.h
  • Gyrometer/cs/SampleConfiguration.cs
  • HotspotAuthentication/cs/SampleConfiguration.cs
  • HttpClient/cs/SampleConfiguration.cs
  • Inclinometer/cpp/SampleConfiguration.h
  • Inclinometer/cs/SampleConfiguration.cs
  • InkAnalysis/cs/SampleConfiguration.cs
  • IoT-GPIO/cpp/SampleConfiguration.h
  • IoT-GPIO/cs/SampleConfiguration.cs
  • IoT-I2C/cpp/SampleConfiguration.h
  • IoT-I2C/cs/SampleConfiguration.cs
  • IoT-SPI/cpp/SampleConfiguration.h
  • IoT-SPI/cs/SampleConfiguration.cs
  • JapanesePhoneticAnalysis/cpp/SampleConfiguration.h
  • JapanesePhoneticAnalysis/cs/SampleConfiguration.cs
  • Json/cs/SampleConfiguration.cs
  • JumpList/cpp/SampleConfiguration.h
  • JumpList/cs/SampleConfiguration.cs
  • KeyCredentialManager/cpp/SampleConfiguration.h
  • KeyCredentialManager/cs/SampleConfiguration.cs
  • LampArray/cs/SampleConfiguration.cs
  • LampDevice/cpp/SampleConfiguration.h
  • LampDevice/cs/SampleConfiguration.cs
  • LanguageFont/cs/SampleConfiguration.cs
  • LibraryManagement/cpp/SampleConfiguration.h
  • LibraryManagement/cs/SampleConfiguration.cs
  • LightSensor/cpp/SampleConfiguration.h
  • LightSensor/cs/SampleConfiguration.cs
  • LineDisplay/cpp/SampleConfiguration.h
  • LineDisplay/cs/SampleConfiguration.cs
  • LinguisticServices/cs/SampleConfiguration.cs
  • LiveDash/cs/LiveDashApp/SampleConfiguration.cs
  • LockScreenApps/cs/SampleConfiguration.cs
  • Logging/cpp/SampleConfiguration.h
  • Logging/cs/SampleConfiguration.cs
  • LowLatencyInput/cpp/SampleConfiguration.h
  • MagneticStripeReader/cpp/SampleConfiguration.h
  • MagneticStripeReader/cs/SampleConfiguration.cs
  • Magnetometer/cs/SampleConfiguration.cs
  • MapControl/cpp/SampleConfiguration.h
  • MapControl/cs/SampleConfiguration.cs
  • MediaEditing/cpp/SampleConfiguration.h
  • MediaEditing/cs/SampleConfiguration.cs
  • MediaImport/cs/SampleConfiguration.cs
  • MediaTranscoding/cpp/SampleConfiguration.h
  • MediaTranscoding/cs/SampleConfiguration.cs
  • MessageDialog/cpp/SampleConfiguration.h
  • MessageDialog/cs/SampleConfiguration.cs
  • MIDI/cs/SampleConfiguration.cs
  • MixedRealityModel/cs/SampleConfiguration.cs
  • MobileBroadband/cs/SampleConfiguration.cs
  • MobileHotspot/cs/SampleConfiguration.cs
  • MultipleViews/cs/SampleConfiguration.cs
  • NetworkConnectivity/cs/SampleConfiguration.cs
  • Nfc/Nfc/SampleConfiguration.cs
  • NfcProvisioner/cs/SampleConfiguration.cs
  • NumberFormatting/cpp/SampleConfiguration.h
  • NumberFormatting/cs/SampleConfiguration.cs
  • OCR/cpp/SampleConfiguration.h
  • OCR/cs/SampleConfiguration.cs
  • OnDemandHotspot/cs/SampleConfiguration.cs
  • OrientationSensor/cpp/SampleConfiguration.h
  • OrientationSensor/cs/SampleConfiguration.cs
  • Package/cpp/SampleConfiguration.h
  • Package/cs/SampleConfiguration.cs
  • PasswordVault/cpp/SampleConfiguration.h
  • PasswordVault/cs/SampleConfiguration.cs
  • PdfDocument/cpp/SampleConfiguration.h
  • PdfDocument/cs/SampleConfiguration.cs
  • Pedometer/cpp/SampleConfiguration.h
  • Pedometer/cs/SampleConfiguration.cs
  • PenHaptics/cs/SampleConfiguration.cs
  • PersonalDataEncryption/cs/SampleConfiguration.cs
  • Personalization/cpp/SampleConfiguration.h
  • Personalization/cs/SampleConfiguration.cs
  • Playlists/cpp/SampleConfiguration.h
  • Playlists/cs/SampleConfiguration.cs
  • PlayReady/cs/SampleConfiguration.cs
  • PosPrinter/cpp/SampleConfiguration.h
  • PosPrinter/cs/SampleConfiguration.cs
  • PresenceSensor/cs/SampleConfiguration.cs
  • Printing/cpp/SampleConfiguration.h
  • Printing/cs/SampleConfiguration.cs
  • Projection/cs/SampleConfiguration.cs
  • ProximitySensor/cpp/SampleConfiguration.h
  • ProximitySensor/cs/SampleConfiguration.cs
  • ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.h
  • ProxyStubsForWinRTComponents/cpp/cs/SampleConfiguration.cs
  • ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.h
  • ProxyStubsForWinRTComponents/cs/cs/SampleConfiguration.cs
  • RadialController/cpp/SampleConfiguration.h
  • RadialController/cs/SampleConfiguration.cs
  • RadioManager/cs/SampleConfiguration.cs
  • RelativeInclinometer/cpp/SampleConfiguration.h
  • RelativeInclinometer/cs/SampleConfiguration.cs
  • RemoteSystems/cs/SampleConfiguration.cs
  • ResizeAppView/cpp/SampleConfiguration.h
  • ResizeAppView/cs/SampleConfiguration.cs
  • SecondaryTiles/cs/SampleConfiguration.cs
  • SemanticTextQuery/cpp/SampleConfiguration.h
  • SemanticTextQuery/cs/SampleConfiguration.cs
  • SerialArduino/cs/SampleConfiguration.cs
  • ShareSource/cpp/SampleConfiguration.h
  • ShareSource/cs/SampleConfiguration.cs
  • ShareTarget/cs/SampleConfiguration.cs
  • SimpleCommunication/cpp/SampleConfiguration.h
  • SimpleCommunication/cs/SampleConfiguration.cs
  • SimpleImaging/cs/SampleConfiguration.cs
  • SimpleInk/cpp/SampleConfiguration.h
  • SimpleInk/cs/SampleConfiguration.cs
  • SimpleOrientationSensor/cpp/SampleConfiguration.h
  • SimpleOrientationSensor/cs/SampleConfiguration.cs
  • SmartCard/cpp/SampleConfiguration.h
  • SmartCard/cs/SampleConfiguration.cs
  • SmsSendAndReceive/cs/SmsSendAndReceive/SampleConfiguration.cs
  • SocketActivityStreamSocket/cs/Server/SampleConfiguration.cs
  • SocketActivityStreamSocket/cs/SocketActivityStreamSocket/SampleConfiguration.cs
  • SpatialSound/cpp/SampleConfiguration.h
  • SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.h
  • SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs
  • SplashScreen/cs/SampleConfiguration.cs
  • Store/cpp/SampleConfiguration.h
  • Store/cs/SampleConfiguration.cs
  • StreamSocket/cpp/SampleConfiguration.h
  • StreamSocket/cs/SampleConfiguration.cs
  • Syndication/cpp/SampleConfiguration.h
  • Syndication/cs/SampleConfiguration.cs
  • SystemMediaTransportControls/cs/SampleConfiguration.cs
  • TextSegmentation/cpp/SampleConfiguration.h
  • TextSegmentation/cs/SampleConfiguration.cs
  • TextSuggestion/cpp/SampleConfiguration.h
  • TextSuggestion/cs/SampleConfiguration.cs
  • TitleBar/cpp/SampleConfiguration.h
  • TitleBar/cs/SampleConfiguration.cs
  • TouchKeyboard/cs/SampleConfiguration.cs
  • TouchKeyboardTextInput/cpp/SampleConfiguration.h
  • TouchKeyboardTextInput/cs/SampleConfiguration.cs
  • Unicode/cs/SampleConfiguration.cs
  • UserActivity/cs/SampleConfiguration.cs
  • UserCertificateStore/cs/SampleConfiguration.cs
  • UserConsentVerifier/cpp/SampleConfiguration.h
  • UserConsentVerifier/cs/SampleConfiguration.cs
  • UserDataAccountManager/cpp/SampleConfiguration.h
  • UserDataAccountManager/cs/SampleConfiguration.cs
  • UserInfo/cs/SampleConfiguration.cs
  • UserInteractionMode/cpp/SampleConfiguration.h
  • UserInteractionMode/cs/SampleConfiguration.cs
  • UssdProtcol/cs/SampleConfiguration.cs
  • VersionAdaptiveCode/cs/SampleConfiguration.cs
  • VideoPlayback/cs/SampleConfiguration.cs
  • VideoPlaybackSynchronization/cs/SampleConfiguration.cs
  • WebAccountManagement/cpp/SampleConfiguration.h
  • WebAccountManagement/cs/SampleConfiguration.cs
  • WebAuthenticationBroker/cpp/SampleConfiguration.h
  • WebAuthenticationBroker/cs/SampleConfiguration.cs
  • WebSocket/cpp/SampleConfiguration.h
  • WebSocket/cs/SampleConfiguration.cs
  • WiFiDirect/cpp/SampleConfiguration.h
  • WiFiDirect/cs/SampleConfiguration.cs
  • WiFiDirectServices/cpp/SampleConfiguration.h
  • WiFiDirectServices/cs/SampleConfiguration.cs
  • WiFiScan/cpp/SampleConfiguration.h
  • WiFiScan/cs/SampleConfiguration.cs
  • WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.h
  • WRLInProcessWinRTComponent/cpp/cs/SampleConfiguration.cs
  • WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.h
  • WRLOutOfProcessWinRTComponent/cpp/cs/SampleConfiguration.cs
  • XamlAnimatedGif/cpp/SampleConfiguration.h
  • XamlAnimatedGif/cs/SampleConfiguration.cs
  • XamlBind/cs/SampleConfiguration.cs
  • XamlBottomUpList/cpp/SampleConfiguration.h
  • XamlBottomUpList/cs/SampleConfiguration.cs
  • XamlCloudFontIntegration/cpp/SampleConfiguration.h
  • XamlCloudFontIntegration/cs/SampleConfiguration.cs
  • XamlCommanding/cpp/SampleConfiguration.h
  • XamlCommanding/cs/SampleConfiguration.cs
  • XamlContextMenu/cpp/SampleConfiguration.h
  • XamlContextMenu/cs/SampleConfiguration.cs
  • XamlDataVirtualization/cs/SampleConfiguration.cs
  • XamlDeferLoadStrategy/cs/SampleConfiguration.cs
  • XamlDragAndDrop/cpp/SampleConfiguration.h
  • XamlDragAndDrop/cs/SampleConfiguration.cs
  • XamlFocusVisuals/cs/SampleConfiguration.cs
  • XamlGamepadNavigation/cs/SampleConfiguration.cs
  • XamlListView/cs/SampleConfiguration.cs
  • XamlPivot/cs/SampleConfiguration.cs
  • XamlWebView/cs/SampleConfiguration.cs
  • XmlDocument/cs/SampleConfiguration.cs
  • XmlLite/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario01_GetText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario01_GetText
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario01_GetText Class Reference

List of all members.

Public Member Functions

Scenario01_GetText ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | MaxHttpVersionToggle_Toggled (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpBaseProtocolFilter | filter
HttpClient | httpClient
bool | isFilterUsed
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario01_GetText.xaml.cs.

Constructor & Destructor Documentation

Scenario01_GetText ( ) [inline]

Definition at line 33 of file Scenario01_GetText.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 146 of file Scenario01_GetText.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

void MaxHttpVersionToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario01_GetText.xaml.cs.

        {
            HttpVersion httpVersion = HttpVersion.Http11;
            if (MaxHttpVersionToggle.IsOn)
            {
                httpVersion = HttpVersion.Http20;
            }

            // In general, for best memory utilization, HttpBaseProtocolFilter and HttpClient objects should be reused for multiple requests.
            // However, if the user has already used the filter object to send at least one request, the HTTP version of the filter cannot be changed.
            // Hence, we need to create new client and filter objects.
            if (isFilterUsed)
            {
                filter.Dispose();
                httpClient.Dispose();
                filter = new HttpBaseProtocolFilter();
                httpClient = new HttpClient(filter);
                isFilterUsed = false;
            }
            filter.MaxVersion = httpVersion;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario01_GetText.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
            filter.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario01_GetText.xaml.cs.

        {
            // In this scenario we just create an HttpClient instance with default settings. I.e. no custom filters.
            // For examples on how to use custom filters see other scenarios.
            filter = new HttpBaseProtocolFilter();

            // Setting the starting state of the toggle based on the default HTTP version in the OS
            if (filter.MaxVersion == HttpVersion.Http20)
            {
                MaxHttpVersionToggle.IsOn = true;
            }
            else
            {
                MaxHttpVersionToggle.IsOn = false;
            }

            httpClient = new HttpClient(filter);
            cts = new CancellationTokenSource();
            isFilterUsed = false;
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario01_GetText.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            if (ReadDefaultRadio.IsChecked.Value)
            {
                filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.Default;
            }
            else if (ReadMostRecentRadio.IsChecked.Value)
            {
                filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent;
            }
            else if (ReadOnlyFromCacheRadio.IsChecked.Value)
            {
                filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.OnlyFromCache;
            }
            else if (ReadNoCacheRadio.IsChecked.Value)
            {
                filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.NoCache;
            }

            if (WriteDefaultRadio.IsChecked.Value)
            {
                filter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.Default;
            }
            else if (WriteNoCacheRadio.IsChecked.Value)
            {
                filter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;
            }

            // ---------------------------------------------------------------------------
            // WARNING: Only test applications should ignore SSL errors.
            // In real applications, ignoring server certificate errors can lead to MITM
            // attacks (while the connection is secure, the server is not authenticated).
            //
            // The SetupServer script included with this sample creates a server certificate that is self-signed
            // and issued to fabrikam.com, and hence we need to ignore these errors here.
            // ---------------------------------------------------------------------------
            filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
            filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                isFilterUsed = true;
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser(
                        "Completed. Response came from " + result.ResponseMessage.Source + ". HTTP version used: " + result.ResponseMessage.Version.ToString() + ".",
                        NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 30 of file Scenario01_GetText.xaml.cs.

HttpBaseProtocolFilter filter [private]

Definition at line 28 of file Scenario01_GetText.xaml.cs.

HttpClient httpClient [private]

Definition at line 29 of file Scenario01_GetText.xaml.cs.

bool isFilterUsed [private]

Definition at line 31 of file Scenario01_GetText.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario01_GetText.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario01_GetText.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario02_GetStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario02_GetStream
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario02_GetStream Class Reference

List of all members.

Public Member Functions

Scenario02_GetStream ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario02_GetStream.xaml.cs.

Constructor & Destructor Documentation

Scenario02_GetStream ( ) [inline]

Definition at line 33 of file Scenario02_GetStream.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 118 of file Scenario02_GetStream.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario02_GetStream.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario02_GetStream.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario02_GetStream.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, resourceUri);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                // Do not buffer the response.
                HttpRequestResult result = await httpClient.TrySendRequestAsync(
                    request,
                    HttpCompletionOption.ResponseHeadersRead).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    OutputField.Text += Helpers.SerializeHeaders(result.ResponseMessage);

                    StringBuilder responseBody = new StringBuilder();
                    using (Stream responseStream = (await result.ResponseMessage.Content.ReadAsInputStreamAsync()).AsStreamForRead())
                    {
                        int read = 0;
                        byte[] responseBytes = new byte[1000];
                        do
                        {
                            read = await responseStream.ReadAsync(responseBytes, 0, responseBytes.Length);

                            responseBody.AppendFormat("Bytes read from stream: {0}", read);
                            responseBody.AppendLine();

                            // Use the buffer contents for something. We can't safely display it as a string though, since encodings
                            // like UTF-8 and UTF-16 have a variable number of bytes per character and so the last bytes in the buffer
                            // may not contain a whole character. Instead, we'll convert the bytes to hex and display the result.
                            IBuffer responseBuffer = CryptographicBuffer.CreateFromByteArray(responseBytes);
                            responseBuffer.Length = (uint)read;
                            responseBody.AppendFormat(CryptographicBuffer.EncodeToHexString(responseBuffer));
                            responseBody.AppendLine();
                        } while (read != 0);
                    }
                    OutputField.Text += responseBody.ToString();

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 31 of file Scenario02_GetStream.xaml.cs.

HttpClient httpClient [private]

Definition at line 30 of file Scenario02_GetStream.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario02_GetStream.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario02_GetStream.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario03_GetList Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario03_GetList
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario03_GetList Class Reference

List of all members.

Public Member Functions

Scenario03_GetList ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario03_GetList.xaml.cs.

Constructor & Destructor Documentation

Scenario03_GetList ( ) [inline]

Definition at line 31 of file Scenario03_GetList.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 94 of file Scenario03_GetList.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario03_GetList.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario03_GetList.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario03_GetList.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
                    result.ResponseMessage.EnsureSuccessStatusCode();

                    XElement element = XElement.Parse(await result.ResponseMessage.Content.ReadAsStringAsync().AsTask(cts.Token));
                    OutputList.ItemsSource = (
                        from c in element.Elements("item")
                        select c.Attribute("name").Value);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 29 of file Scenario03_GetList.xaml.cs.

HttpClient httpClient [private]

Definition at line 28 of file Scenario03_GetList.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario03_GetList.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario03_GetList.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario04_PostText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario04_PostText
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario04_PostText Class Reference

List of all members.

Public Member Functions

Scenario04_PostText ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario04_PostText.xaml.cs.

Constructor & Destructor Documentation

Scenario04_PostText ( ) [inline]

Definition at line 29 of file Scenario04_PostText.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file Scenario04_PostText.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario04_PostText.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario04_PostText.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario04_PostText.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryPostAsync(resourceUri,
                    new HttpStringContent(RequestBodyField.Text)).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 27 of file Scenario04_PostText.xaml.cs.

HttpClient httpClient [private]

Definition at line 26 of file Scenario04_PostText.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario04_PostText.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario04_PostText.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario05_PostStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario05_PostStream
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario05_PostStream Class Reference

List of all members.

Public Member Functions

Scenario05_PostStream ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static MemoryStream | GenerateSampleStream (int size)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario05_PostStream.xaml.cs.

Constructor & Destructor Documentation

Scenario05_PostStream ( ) [inline]

Definition at line 30 of file Scenario05_PostStream.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario05_PostStream.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

static MemoryStream GenerateSampleStream ( int size ) [inline, static, private]

Definition at line 104 of file Scenario05_PostStream.xaml.cs.

        {
            // Generate sample data.
            byte[] subData = new byte[size];
            for (int i = 0; i < subData.Length; i++)
            {
                subData[i] = 64; // '@'
            }

            return new MemoryStream(subData);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario05_PostStream.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario05_PostStream.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario05_PostStream.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            const int contentLength = 1000;
            Stream stream = GenerateSampleStream(contentLength);
            HttpStreamContent streamContent = new HttpStreamContent(stream.AsInputStream());

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, resourceUri);
            request.Content = streamContent;

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                // Do an asynchronous POST.
                HttpRequestResult result = await httpClient.TrySendRequestAsync(request).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 28 of file Scenario05_PostStream.xaml.cs.

HttpClient httpClient [private]

Definition at line 27 of file Scenario05_PostStream.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario05_PostStream.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario05_PostStream.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario06_PostMultipart Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario06_PostMultipart
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario06_PostMultipart Class Reference

List of all members.

Public Member Functions

Scenario06_PostMultipart ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario06_PostMultipart.xaml.cs.

Constructor & Destructor Documentation

Scenario06_PostMultipart ( ) [inline]

Definition at line 28 of file Scenario06_PostMultipart.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario06_PostMultipart.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario06_PostMultipart.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario06_PostMultipart.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario06_PostMultipart.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            HttpMultipartFormDataContent form = new HttpMultipartFormDataContent();
            form.Add(new HttpStringContent(RequestBodyField.Text), "data");

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryPostAsync(resourceUri, form).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 27 of file Scenario06_PostMultipart.xaml.cs.

HttpClient httpClient [private]

Definition at line 26 of file Scenario06_PostMultipart.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario06_PostMultipart.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario06_PostMultipart.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario07_PostStreamWithProgress Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario07_PostStreamWithProgress
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario07_PostStreamWithProgress Class Reference

List of all members.

Public Member Functions

Scenario07_PostStreamWithProgress ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | ChunkedResponseToggle_Toggled (object sender, RoutedEventArgs e)
void | ProgressHandler (HttpProgress progress)
void | ResetFields ()
async void | Start_Click (object sender, RoutedEventArgs e)
void | UpdateAddressField ()

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario07_PostStreamWithProgress.xaml.cs.

Constructor & Destructor Documentation

Scenario07_PostStreamWithProgress ( ) [inline]

Definition at line 30 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 179 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

void ChunkedResponseToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            UpdateAddressField();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            httpClient = new HttpClient();
            cts = new CancellationTokenSource();
            UpdateAddressField();
        }

void ProgressHandler ( HttpProgress progress ) [inline, private]

Definition at line 127 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            StageField.Text = progress.Stage.ToString();
            RetriesField.Text = progress.Retries.ToString(CultureInfo.InvariantCulture);
            BytesSentField.Text = progress.BytesSent.ToString(CultureInfo.InvariantCulture);
            BytesReceivedField.Text = progress.BytesReceived.ToString(CultureInfo.InvariantCulture);

            ulong totalBytesToSend = 0;
            if (progress.TotalBytesToSend.HasValue)
            {
                totalBytesToSend = progress.TotalBytesToSend.Value;
                TotalBytesToSendField.Text = totalBytesToSend.ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                TotalBytesToSendField.Text = "unknown";
            }

            ulong totalBytesToReceive = 0;
            if (progress.TotalBytesToReceive.HasValue)
            {
                totalBytesToReceive = progress.TotalBytesToReceive.Value;
                TotalBytesToReceiveField.Text = totalBytesToReceive.ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                TotalBytesToReceiveField.Text = "unknown";
            }

            double requestProgress = 0;
            if (progress.Stage == HttpProgressStage.SendingContent && totalBytesToSend > 0)
            {
                    requestProgress = progress.BytesSent * 50 / totalBytesToSend;
            }
            else if (progress.Stage == HttpProgressStage.ReceivingContent)
            {
                // Start with 50 percent, request content was already sent.
                requestProgress += 50;

                if (totalBytesToReceive > 0)
                {
                    requestProgress += progress.BytesReceived * 50 / totalBytesToReceive;
                }
            }
            else
            {
                return;
            }

            RequestProgressBar.Value = requestProgress;
        }

void ResetFields ( ) [inline, private]

Definition at line 116 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            StageField.Text = "";
            RetriesField.Text = "0";
            BytesSentField.Text = "0";
            TotalBytesToSendField.Text = "0";
            BytesReceivedField.Text = "0";
            TotalBytesToReceiveField.Text = "0";
            RequestProgressBar.Value = 0;
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, null);
            ResetFields();
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            const uint streamLength = 100000;
            HttpStreamContent streamContent = new HttpStreamContent(new SlowInputStream(streamLength));

            // If stream length is unknown, the request is chunked transfer encoded.
            if (!ChunkedRequestToggle.IsOn)
            {
                streamContent.Headers.ContentLength = streamLength;
            }

            IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryPostAsync(resourceUri, streamContent).AsTask(cts.Token, progress);

                if (result.Succeeded)
                {
                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            RequestProgressBar.Value = 100;
            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

void UpdateAddressField ( ) [inline, private]

Definition at line 49 of file Scenario07_PostStreamWithProgress.xaml.cs.

        {
            // Tell the server we want a transfer-encoding chunked response.
            string queryString = "";
            if (ChunkedResponseToggle.IsOn)
            {
                queryString = "?chunkedResponse=1";
            }

            Helpers.ReplaceQueryString(AddressField, queryString);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 28 of file Scenario07_PostStreamWithProgress.xaml.cs.

HttpClient httpClient [private]

Definition at line 27 of file Scenario07_PostStreamWithProgress.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario07_PostStreamWithProgress.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario07_PostStreamWithProgress.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario08_PostCustomContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario08_PostCustomContent
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario08_PostCustomContent Class Reference

List of all members.

Public Member Functions

Scenario08_PostCustomContent ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario08_PostCustomContent.xaml.cs.

Constructor & Destructor Documentation

Scenario08_PostCustomContent ( ) [inline]

Definition at line 30 of file Scenario08_PostCustomContent.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 89 of file Scenario08_PostCustomContent.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario08_PostCustomContent.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario08_PostCustomContent.xaml.cs.

        {
            httpClient = new HttpClient();
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario08_PostCustomContent.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            IHttpContent jsonContent = new HttpJsonContent(JsonValue.Parse("{\"score\": 100, \"enabled\": false}"));

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryPostAsync(resourceUri, jsonContent).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 28 of file Scenario08_PostCustomContent.xaml.cs.

HttpClient httpClient [private]

Definition at line 27 of file Scenario08_PostCustomContent.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario08_PostCustomContent.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario08_PostCustomContent.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario09_GetCookie Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario09_GetCookie
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario09_GetCookie Class Reference

List of all members.

Public Member Functions

Scenario09_GetCookie ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | GetCookies_Click (object sender, RoutedEventArgs e)
async void | SendHttpGetButton_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario09_GetCookie.xaml.cs.

Constructor & Destructor Documentation

Scenario09_GetCookie ( ) [inline]

Definition at line 30 of file Scenario09_GetCookie.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario09_GetCookie.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

void GetCookies_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario09_GetCookie.xaml.cs.

        {
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();
                HttpCookieCollection cookieCollection = filter.CookieManager.GetCookies(resourceUri);

                OutputField.Text = cookieCollection.Count + " cookies found.\r\n";
                foreach (HttpCookie cookie in cookieCollection)
                {
                    OutputField.Text += "--------------------\r\n";
                    OutputField.Text += "Name: " + cookie.Name + "\r\n";
                    OutputField.Text += "Domain: " + cookie.Domain + "\r\n";
                    OutputField.Text += "Path: " + cookie.Path + "\r\n";
                    OutputField.Text += "Value: " + cookie.Value + "\r\n";
                    OutputField.Text += "Expires: " + cookie.Expires + "\r\n";
                    OutputField.Text += "Secure: " + cookie.Secure + "\r\n";
                    OutputField.Text += "HttpOnly: " + cookie.HttpOnly + "\r\n";
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario09_GetCookie.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario09_GetCookie.xaml.cs.

        {
            httpClient = Helpers.CreateHttpClientWithPlugIn();
            cts = new CancellationTokenSource();
        }

async void SendHttpGetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario09_GetCookie.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(SendHttpGetButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(SendHttpGetButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 28 of file Scenario09_GetCookie.xaml.cs.

HttpClient httpClient [private]

Definition at line 27 of file Scenario09_GetCookie.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario09_GetCookie.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario09_GetCookie.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario0_Choose Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario0_Choose
Public Member Functions | Protected Member Functions | Private Attributes

Scenario0_Choose Class Reference

List of all members.

Public Member Functions

Scenario0_Choose ()
Scenario0_Choose ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario0_Choose.xaml.cs.

Constructor & Destructor Documentation

Scenario0_Choose ( ) [inline]

Definition at line 28 of file Scenario0_Choose.xaml.cs.

        {
            this.InitializeComponent();
            var readingTypes = new List<AccelerometerReadingType>()
            {
                AccelerometerReadingType.Standard,
                AccelerometerReadingType.Linear,
                AccelerometerReadingType.Gravity,
            };
            ReadingTypeComboBox.ItemsSource = readingTypes;
            ReadingTypeComboBox.SelectedIndex = readingTypes.IndexOf(rootPage.AccelerometerReadingType);
        }

Scenario0_Choose ( ) [inline]

Definition at line 28 of file Scenario0_Choose.xaml.cs.

        {
            this.InitializeComponent();
            var readingTypes = new List<SensorReadingType>()
            {
                SensorReadingType.Absolute,
                SensorReadingType.Relative,
            };
            ReadingTypeComboBox.ItemsSource = readingTypes;
            ReadingTypeComboBox.SelectedIndex = readingTypes.IndexOf(rootPage.SensorReadingType);

            var optimizationGoals = new List<SensorOptimizationGoal>()
            {
                SensorOptimizationGoal.Precision,
                SensorOptimizationGoal.PowerEfficiency,
            };
            OptimizationGoalComboBox.ItemsSource = optimizationGoals;
            OptimizationGoalComboBox.SelectedIndex = optimizationGoals.IndexOf(rootPage.SensorOptimizationGoal);
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario0_Choose.xaml.cs.

        {
            rootPage.AccelerometerReadingType = (AccelerometerReadingType)ReadingTypeComboBox.SelectedValue;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario0_Choose.xaml.cs.

        {
            rootPage.SensorReadingType = (SensorReadingType)ReadingTypeComboBox.SelectedValue;
            rootPage.SensorOptimizationGoal = (SensorOptimizationGoal)OptimizationGoalComboBox.SelectedValue;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario0_Choose.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario0_Choose.xaml.cs
  • OrientationSensor/cs/Scenario0_Choose.xaml.cs
  • Accelerometer/cpp/Scenario0_Choose.xaml.cpp
  • OrientationSensor/cpp/Scenario0_Choose.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()

Static Public Member Functions

static Rect | GetElementRect (FrameworkElement element)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | AddEllipseToCanvas (InkAnalysisInkDrawing shape)
async void | AddFolderButton_Click (object sender, RoutedEventArgs e)
void | AddPolygonToCanvas (InkAnalysisInkDrawing shape)
String | architectureString (Windows.System.ProcessorArchitecture architecture)
async void | AttachmentImage_RightTapped (object sender, RightTappedRoutedEventArgs e)
void | Button_Click (object sender, RoutedEventArgs e)
void | CheckBox_Toggle (object sender, RoutedEventArgs e)
void | ClearButton_Click (object sender, RoutedEventArgs e)
void | ConvertShapes ()
async void | CreateFileButton_Click (object sender, RoutedEventArgs e)
async void | CreateView_Click (object sender, RoutedEventArgs e)
void | DeleteMenuItem_Click (object sender, RoutedEventArgs e)
async void | DispatcherTimer_Tick (object sender, object e)
void | DisplayProperties_DpiChanged (DisplayInformation sender, object args)
void | DoWin10Mode (object sender, RoutedEventArgs e)
void | DoWin81Mode (object sender, RoutedEventArgs e)
void | Find_Click (object sender, RoutedEventArgs e)
List< SizePreferenceString > GenerateSizePreferenceBinding ()
async void | GetFilesAndFoldersButton_Click (object sender, RoutedEventArgs e)
MediaPlaybackType | GetMediaTypeFromFileContentType (StorageFile file)
void | GetPackage_Click (Object sender, RoutedEventArgs e)
async void | GetThumbnailButton_Click (object sender, RoutedEventArgs e)
void | InkPresenter_StrokesCollected (InkPresenter sender, InkStrokesCollectedEventArgs args)
void | InkPresenter_StrokesErased (InkPresenter sender, InkStrokesErasedEventArgs args)
async void | mediaPlayer_MediaEnded (MediaPlayer sender, object e)
async void | mediaPlayer_MediaFailed (MediaPlayer sender, MediaPlayerFailedEventArgs e)
async void | mediaPlayer_MediaOpened (MediaPlayer sender, object e)
async void | mediaPlayer_PlaybackStateChanged (MediaPlaybackSession sender, object e)
void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | MyMap_MapTapped (Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
async void | nextButton_Click (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | OpenMenuItem_Click (object sender, RoutedEventArgs e)
async void | pickFileButton_Click (object sender, RoutedEventArgs e)
void | playPauseButton_Click (object sender, RoutedEventArgs e)
void | positionUpdate_TimerTick (object sender, object e)
async void | previousButton_Click (object sender, RoutedEventArgs e)
void | PrintMenuItem_Click (object sender, RoutedEventArgs e)
void | projectionCombobox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ResetOutput ()
async void | SearchButton_Click (object sender, RoutedEventArgs e)
async void | SelectFilesButton_Click (object sender, RoutedEventArgs e)
void | SetMapProjection ()
void | SetMapStyle ()
async Task | SetNewMediaItem (int newItemIndex)
void | SetupSystemMediaTransportControls ()
async void | ShowAsStandalone_Click (object sender, RoutedEventArgs e)
void | StrokeInput_StrokeStarted (InkStrokeInput sender, PointerEventArgs args)
void | styleCombobox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | SyncPlaybackStatusToMediaPlayerState ()
async void | systemMediaControls_AutoRepeatModeChangeRequested (SystemMediaTransportControls sender, AutoRepeatModeChangeRequestedEventArgs args)
async void | systemMediaControls_ButtonPressed (SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs args)
async void | systemMediaControls_PlaybackPositionChangeRequested (SystemMediaTransportControls sender, PlaybackPositionChangeRequestedEventArgs args)
async void | systemMediaControls_PlaybackRateChangeRequested (SystemMediaTransportControls sender, PlaybackRateChangeRequestedEventArgs args)
async void | systemMediaControls_PropertyChanged (SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
void | target_DoubleTapped (object sender, DoubleTappedRoutedEventArgs e)
void | target_Holding (object sender, HoldingRoutedEventArgs e)
void | target_PointerEntered (object sender, PointerRoutedEventArgs e)
void | target_PointerExited (object sender, PointerRoutedEventArgs e)
void | target_PointerPressed (object sender, PointerRoutedEventArgs e)
void | target_PointerReleased (object sender, PointerRoutedEventArgs e)
void | target_RightTapped (object sender, RightTappedRoutedEventArgs e)
void | target_Tapped (object sender, TappedRoutedEventArgs e)
void | TrafficFlowVisible_Checked (object sender, RoutedEventArgs e)
void | trafficFlowVisibleCheckBox_Unchecked (object sender, RoutedEventArgs e)
void | UpdateCustomTransportControls ()
void | UpdateSmtcPosition ()
async Task | UpdateSystemMediaControlsDisplayAsync (StorageFile mediaFile)
String | versionString (PackageVersion version)

Static Private Member Functions

static double | Distance (Point p0, Point p1)

Private Attributes

int | currentItemIndex = 0
const string | DEFAULT_TITLE = "New window"
DispatcherTimer | dispatcherTimer
const String | imageBase = "http://www.contoso.com/imageScale{0}.png"
InkAnalyzer | inkAnalyzer
InkPresenter | inkPresenter
bool | isInitialized = false
bool | isThisPageActive = false
MediaPlaybackItem | mediaPlaybackItem
MediaPlayer | mediaPlayer
bool | pausedDueToMute = false
IReadOnlyList< StorageFile > | playlist = null
bool | repeatPlaylist = false
MainPage rootPage = MainPage.Current
DispatcherTimer | smtcPositionUpdateTimer = null
SystemMediaTransportControls | systemMediaControls = null

Static Private Attributes

static bool | optedIn = false
static string[] | supportedAudioFormats
static string[] | supportedVideoFormats

Detailed Description

Demonstrates basic video playback using MediaElement.

Page for scenario 1 of our sample.

This page shows the code to enabled the InkToolbar and InkCanvas.

This scenerio demostrates how to do shape recognition with InkAanlyzer.

Creating a file.

Definition at line 22 of file scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 28 of file scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 30 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            // I want this page to be always cached so that we don't have to add logic to save/restore state for the checkbox.
            this.NavigationCacheMode = NavigationCacheMode.Required;
        }

Scenario1 ( ) [inline]

Definition at line 20 of file 1-InputEvents.xaml.cs.

        {
            this.InitializeComponent();

            // pointer press/release handlers
            pressedTarget.PointerPressed += new PointerEventHandler(target_PointerPressed);
            pressedTarget.PointerReleased += new PointerEventHandler(target_PointerReleased);

            // pointer enter/exit handlers
            enterExitTarget.PointerEntered += new PointerEventHandler(target_PointerEntered);
            enterExitTarget.PointerExited += new PointerEventHandler(target_PointerExited);

            // gesture handlers
            tapTarget.Tapped += new TappedEventHandler(target_Tapped);
            tapTarget.DoubleTapped += new DoubleTappedEventHandler(target_DoubleTapped);

            holdTarget.Holding += new HoldingEventHandler(target_Holding);
            holdTarget.RightTapped += new RightTappedEventHandler(target_RightTapped);
        }

Scenario1 ( ) [inline]

Definition at line 28 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 25 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
            DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
            displayInformation.DpiChanged += DisplayProperties_DpiChanged;
        }

Scenario1 ( ) [inline]

Definition at line 27 of file Scenario1_Create.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 28 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 26 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 23 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 37 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            inkPresenter = inkCanvas.InkPresenter;
            inkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
            inkPresenter.StrokesErased += InkPresenter_StrokesErased;
            inkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;
            inkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;

            inkAnalyzer = new InkAnalyzer();

            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += DispatcherTimer_Tick;

            // We perform analysis when there has been a change to the
            // ink presenter and the user has been idle for 200ms.
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(200);
        }

Scenario1 ( ) [inline]

Definition at line 25 of file S1_AddFolder.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 22 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 27 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 36 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            // "UseNone" is not a valid choice for the incoming view, so only include
            // it in the anchor size preference chooser
            var anchorSizeChoices = GenerateSizePreferenceBinding();
            anchorSizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseNone, Title = "UseNone" });
            AnchorSizePreferenceChooser.ItemsSource = anchorSizeChoices;
            AnchorSizePreferenceChooser.SelectedIndex = 0;

            SizePreferenceChooser.ItemsSource = GenerateSizePreferenceBinding();
            SizePreferenceChooser.SelectedIndex = 0;

            // This collection is being bound to the current thread.
            // So, make sure you only update the collection and items
            // contained in it from this thread.
            ViewChooser.ItemsSource = ((App)App.Current).SecondaryViews;
        }

Scenario1 ( ) [inline]

Definition at line 29 of file scenario1_identity.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 33 of file Find.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 28 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes =
                Windows.UI.Core.CoreInputDeviceTypes.Mouse |
                Windows.UI.Core.CoreInputDeviceTypes.Pen;
        }

Scenario1 ( ) [inline]

Definition at line 70 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 29 of file Scenario1_PlayingVideos.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1 ( ) [inline]

Definition at line 28 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddEllipseToCanvas ( InkAnalysisInkDrawing shape ) [inline, private]

Definition at line 176 of file Scenario1.xaml.cs.

        {
            Ellipse ellipse = new Ellipse();

            // Ellipses and circles are reported as four points
            // in clockwise orientation.
            // Points 0 and 2 are the extrema of one axis,
            // and points 1 and 3 are the extrema of the other axis.
            // See Ellipse.svg for a diagram.
            IReadOnlyList<Point> points = shape.Points;

            // Calculate the geometric center of the ellipse.
            var center = new Point((points[0].X + points[2].X) / 2.0, (points[0].Y + points[2].Y) / 2.0);

            // Calculate the length of one axis.
            ellipse.Width = Distance(points[0], points[2]);

            var compositeTransform = new CompositeTransform();
            if(shape.DrawingKind == InkAnalysisDrawingKind.Circle)
            {
                ellipse.Height = ellipse.Width;
            }
            else
            {
                // Calculate the length of the other axis.
                ellipse.Height = Distance(points[1], points[3]);

                // Calculate the amount by which the ellipse has been rotated
                // by looking at the angle our "width" axis has been rotated.
                // Since the Y coordinate is inverted, this calculates the amount
                // by which the ellipse has been rotated clockwise.
                double rotationAngle = Math.Atan2(points[2].Y - points[0].Y, points[2].X - points[0].X);

                RotateTransform rotateTransform = new RotateTransform();
                // Convert radians to degrees.
                compositeTransform.Rotation = rotationAngle * 180.0 / Math.PI;
                compositeTransform.CenterX = ellipse.Width / 2.0;
                compositeTransform.CenterY = ellipse.Height / 2.0;
            }

            compositeTransform.TranslateX = center.X - ellipse.Width / 2.0;
            compositeTransform.TranslateY = center.Y - ellipse.Height / 2.0;

            ellipse.RenderTransform = compositeTransform;

            canvas.Children.Add(ellipse);
        }

async void AddFolderButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Displays the folder Picker to request that the user select a folder that will be added to the Pictures library.

Parameters:
sender
e

Definition at line 45 of file S1_AddFolder.xaml.cs.

        {
            StorageLibrary picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            StorageFolder folderAdded = await picturesLibrary.RequestAddFolderAsync();
            if (folderAdded != null)
            {
                OutputTextBlock.Text = folderAdded.DisplayName + " was added to the Pictures library.";
            }
            else
            {
                OutputTextBlock.Text = "Operation canceled.";
            }
        }

void AddPolygonToCanvas ( InkAnalysisInkDrawing shape ) [inline, private]

Definition at line 156 of file Scenario1.xaml.cs.

        {
            Polygon polygon = new Polygon();

            // The points of the polygon are reported clockwise.
            foreach (var point in shape.Points)
            {
                polygon.Points.Add(point);
            }

            canvas.Children.Add(polygon);
        }

String architectureString ( Windows.System.ProcessorArchitecture architecture ) [inline, private]

Definition at line 40 of file scenario1_identity.xaml.cs.

        {
            switch (architecture)
            {
                case Windows.System.ProcessorArchitecture.X86:
                    return "x86";
                case Windows.System.ProcessorArchitecture.Arm:
                    return "arm";
                case Windows.System.ProcessorArchitecture.X64:
                    return "x64";
                case Windows.System.ProcessorArchitecture.Neutral:
                    return "neutral";
                case Windows.System.ProcessorArchitecture.Unknown:
                    return "unknown";
                default:
                    return "???";
            }
        }

async void AttachmentImage_RightTapped | ( | object | sender,
 |  | RightTappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario1.xaml.cs.

        {
            // Create a menu and add commands specifying a callback delegate for each.
            // Since command delegates are unique, no need to specify command Ids.
            var menu = new PopupMenu();
            menu.Commands.Add(new UICommand("Open with", (command) =>
            {
                OutputTextBlock.Text = "'" + command.Label + "' selected";
            }));
            menu.Commands.Add(new UICommand("Save attachment", (command) =>
            {
                OutputTextBlock.Text = "'" + command.Label + "' selected";
            }));

            // We don't want to obscure content, so pass in a rectangle representing the sender of the context menu event.
            // We registered command callbacks; no need to handle the menu completion event
            OutputTextBlock.Text = "Context menu shown";
            var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
            if (chosenCommand == null) // The command is null if no command was invoked.
            {
                OutputTextBlock.Text = "Context menu dismissed";
            }
        }

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario1.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Navigate to the next page, with info in the parameters whether to enable the title bar UI or not.
            rootFrame.Navigate(typeof(SecondaryPage), optedIn);
        }

void CheckBox_Toggle | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario1.xaml.cs.

        {
            optedIn = !optedIn;
        }

void ClearButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario1.xaml.cs.

        {
            // Don't run analysis when there is nothing to analyze.
            dispatcherTimer.Stop();

            inkPresenter.StrokeContainer.Clear();
            inkAnalyzer.ClearDataForAllStrokes();
            canvas.Children.Clear();
        }

void ConvertShapes ( ) [inline, private]

Definition at line 118 of file Scenario1.xaml.cs.

        {
            IReadOnlyList<IInkAnalysisNode> drawings = inkAnalyzer.AnalysisRoot.FindNodes(InkAnalysisNodeKind.InkDrawing);
            foreach (IInkAnalysisNode drawing in drawings)
            {
                var shape = (InkAnalysisInkDrawing)drawing;
                if (shape.DrawingKind == InkAnalysisDrawingKind.Drawing)
                {
                    // Omit unsupported shape
                    continue;
                }

                if (shape.DrawingKind == InkAnalysisDrawingKind.Circle || shape.DrawingKind == InkAnalysisDrawingKind.Ellipse)
                {
                    // Create a Circle or Ellipse on the canvas.
                    AddEllipseToCanvas(shape);
                }
                else
                {
                    // Create a Polygon on the canvas.
                    AddPolygonToCanvas(shape);
                }

                // Select the strokes that were recognized, so we can delete them.
                // The effect is that the shape added to the canvas replaces the strokes.
                foreach (var strokeId in shape.GetStrokeIds())
                {
                    InkStroke stroke = inkPresenter.StrokeContainer.GetStrokeById(strokeId);
                    stroke.Selected = true;
                }

                // Remove the recognized strokes from the analyzer
                // so it won't re-analyze them.
                inkAnalyzer.RemoveDataForStrokes(shape.GetStrokeIds());
            }
            inkPresenter.StrokeContainer.DeleteSelected();
        }

async void CreateFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario1_Create.xaml.cs.

        {
            StorageFolder storageFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            try
            {
                rootPage.sampleFile = await storageFolder.CreateFileAsync(MainPage.filename, CreationCollisionOption.ReplaceExisting);
                rootPage.NotifyUser($"The file '{rootPage.sampleFile.Name}' was created.", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                // I/O errors are reported as exceptions.
                rootPage.NotifyUser($"Error creating file '{MainPage.filename}': {ex.Message}", NotifyType.ErrorMessage);
            }
        }

async void CreateView_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario1.xaml.cs.

        {
            // Set up the secondary view, but don't show it yet
            ViewLifetimeControl viewControl = null;
            await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // This object is used to keep track of the views and important
                // details about the contents of those views across threads
                // In your app, you would probably want to track information
                // like the open document or page inside that window
                viewControl = ViewLifetimeControl.CreateForCurrentView();
                viewControl.Title = DEFAULT_TITLE;
                // Increment the ref count because we just created the view and we have a reference to it
                viewControl.StartViewInUse();

                var frame = new Frame();
                frame.Navigate(typeof(SecondaryViewPage), viewControl);
                Window.Current.Content = frame;
                // This is a change from 8.1: In order for the view to be displayed later it needs to be activated.
                Window.Current.Activate();
                ApplicationView.GetForCurrentView().Title = viewControl.Title;
            });

            // Be careful! This collection is bound to the current thread,
            // so make sure to update it only from this thread
            ((App)App.Current).SecondaryViews.Add(viewControl);
        }

void DeleteMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Action: Delete", NotifyType.StatusMessage);
        }

async void DispatcherTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario1.xaml.cs.

        {
            dispatcherTimer.Stop();
            if (!inkAnalyzer.IsAnalyzing)
            {
                InkAnalysisResult results = await inkAnalyzer.AnalyzeAsync();
                if (results.Status == InkAnalysisStatus.Updated)
                {
                    ConvertShapes();
                }
            }
            else
            {
                // Ink analyzer is busy. Wait a while and try again.
                dispatcherTimer.Start();
            }
        }

void DisplayProperties_DpiChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario1.xaml.cs.

        {
            ResetOutput();
        }

static double Distance | ( | Point | p0,
 |  | Point | p1 |
 | ) |  |  | [inline, static, private]

Definition at line 169 of file Scenario1.xaml.cs.

        {
            double dX = p1.X - p0.X;
            double dY = p1.Y - p0.Y;
            return Math.Sqrt(dX * dX + dY * dY);
        }

void DoWin10Mode | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This method demonstrates logging with a LoggingChannel constructed in Windows 10 enhanced mode.

Definition at line 46 of file Scenario1.xaml.cs.

        {
            new LoggingChannelScenario().LogWithWin10Constructor();
            this.rootPage.NotifyUser("Complete: Windows 10 mode", NotifyType.StatusMessage);
        }

void DoWin81Mode | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This method demonstrates logging with a LoggingChannel constructed in Windows 8.1 compatibility mode.

Definition at line 36 of file Scenario1.xaml.cs.

        {
            new LoggingChannelScenario().LogWithWin81Constructor();
            this.rootPage.NotifyUser("Complete: Windows 8.1 mode", NotifyType.StatusMessage);
        }

void Find_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Find.xaml.cs.

        {
            ContentTextOutput.Text = "";
            var mySemanticTextQuery = new Windows.Data.Text.SemanticTextQuery(FindQueryText.Text);
            IReadOnlyList<Windows.Data.Text.TextSegment> ranges = mySemanticTextQuery.Find(ContentText.Text);
            rootPage.HighlightRanges(ContentTextOutput, ContentText.Text, ranges);
        }

List<SizePreferenceString> GenerateSizePreferenceBinding ( ) [inline, private]

Definition at line 56 of file Scenario1.xaml.cs.

        {
            var sizeChoices = new List<SizePreferenceString>();
            sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.Default,    Title = "Default" });
            sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseHalf,    Title = "UseHalf" });
            sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseLess,    Title = "UseLess" });
            sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseMinimum, Title = "UseMinimum" });
            sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseMore,    Title = "UseMore" });

            return sizeChoices;
        }

static Rect GetElementRect ( FrameworkElement element ) [inline, static]

Definition at line 33 of file Scenario1.xaml.cs.

        {
            GeneralTransform buttonTransform = element.TransformToVisual(null);
            Point point = buttonTransform.TransformPoint(new Point());
            return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
        }

async void GetFilesAndFoldersButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario1.xaml.cs.

        {
            StorageFolder picturesFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);

            IReadOnlyList<StorageFile> fileList = await picturesFolder.GetFilesAsync();
            IReadOnlyList<StorageFolder> folderList = await picturesFolder.GetFoldersAsync();

            var count = fileList.Count + folderList.Count;
            StringBuilder outputText = new StringBuilder(picturesFolder.Name + " (" + count + ")\n\n");

            foreach (StorageFolder folder in folderList)
            {
                outputText.AppendLine("    " + folder.DisplayName + "\\");
            }

            foreach (StorageFile file in fileList)
            {
                outputText.AppendLine("    " + file.Name);
            }

            OutputTextBlock.Text = outputText.ToString();
        }

MediaPlaybackType GetMediaTypeFromFileContentType ( StorageFile file ) [inline, private]

Returns an appropriate MediaPlaybackType value based on the given StorageFile's ContentType (MIME type).

Returns:
One of the three valid MediaPlaybackType enum values, or MediaPlaybackType.Unknown if the ContentType is not a media type (audio, video, image) or cannot be determined. For use with SystemMediaTransportControlsDisplayUpdater.CopyFromFileAsync() in UpdateSystemMediaControlsDisplayAsync().

Definition at line 647 of file Scenario1.xaml.cs.

        {
            // Determine the appropriate MediaPlaybackType of the media file based on its ContentType (ie. MIME type).
            // The MediaPlaybackType determines the information shown in the system UI for the system media transport
            // controls.  For example, the CopyFromFileAsync() API method will look for different metadata properties
            // from the file to be extracted for eventual display in the system UI, depending on the MediaPlaybackType
            // passed to the method.

            // NOTE: MediaPlaybackType.Unknown is *not* a valid value to use in SystemMediaTransportControls APIs.
            // This method will return MediaPlaybackType.Unknown to indicate no valid MediaPlaybackType exists/can be
            // determined for the given StorageFile.
            MediaPlaybackType mediaPlaybackType = MediaPlaybackType.Unknown;
            string fileMimeType = file.ContentType.ToLowerInvariant();

            if (fileMimeType.StartsWith("audio/"))
            {
                mediaPlaybackType = MediaPlaybackType.Music;
            }
            else if (fileMimeType.StartsWith("video/"))
            {
                mediaPlaybackType = MediaPlaybackType.Video;
            }
            else if (fileMimeType.StartsWith("image/"))
            {
                mediaPlaybackType = MediaPlaybackType.Image;
            }

            return mediaPlaybackType;
        }

void GetPackage_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file scenario1_identity.xaml.cs.

        {
            Package package = Package.Current;
            PackageId packageId = package.Id;

            String output = String.Format("Name: \"{0}\"\n" +
                                          "Version: {1}\n" +
                                          "Architecture: {2}\n" +
                                          "ResourceId: \"{3}\"\n" +
                                          "Publisher: \"{4}\"\n" +
                                          "PublisherId: \"{5}\"\n" +
                                          "FullName: \"{6}\"\n" +
                                          "FamilyName: \"{7}\"\n" +
                                          "IsFramework: {8}\n",
                                          packageId.Name,
                                          versionString(packageId.Version),
                                          architectureString(packageId.Architecture),
                                          packageId.ResourceId,
                                          packageId.Publisher,
                                          packageId.PublisherId,
                                          packageId.FullName,
                                          packageId.FamilyName,
                                          package.IsFramework);
#if WINDOWS_APP
            output += String.Format("IsResourcePackage: {0}\n" +
                                    "IsBundle: {1}\n" +
                                    "IsDevelopmentMode: {2}\n" +
                                    "DisplayName: \"{3}\"\n" +
                                    "PublisherDisplayName: \"{4}\"\n" +
                                    "Description: \"{5}\"\n" +
                                    "Logo: \"{6}\"\n",
                                    package.IsResourcePackage,
                                    package.IsBundle,
                                    package.IsDevelopmentMode,
                                    package.DisplayName,
                                    package.PublisherDisplayName,
                                    package.Description,
                                    package.Logo.AbsoluteUri);
#endif
            OutputTextBlock.Text = output;
        }

async void GetThumbnailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario1.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);

            // Pick a photo
            FileOpenPicker openPicker = new FileOpenPicker();
            foreach (string extension in FileExtensions.Image)
            {
                openPicker.FileTypeFilter.Add(extension);
            }

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                string thumbnailModeName = ((ComboBoxItem)ModeComboBox.SelectedItem).Name;
                ThumbnailMode thumbnailMode = (ThumbnailMode)Enum.Parse(typeof(ThumbnailMode), thumbnailModeName);

                bool fastThumbnail = FastThumbnailCheckBox.IsChecked.Value;
                ThumbnailOptions thumbnailOptions = ThumbnailOptions.UseCurrentScale;
                if (fastThumbnail)
                {
                    thumbnailOptions |= ThumbnailOptions.ReturnOnlyIfCached;
                }

                const uint size = 200;
                using (StorageItemThumbnail thumbnail = await file.GetThumbnailAsync(thumbnailMode, size, thumbnailOptions))
                {
                    if (thumbnail != null)
                    {
                        MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailModeName, size, file, thumbnail, false);
                    }
                    else if (fastThumbnail)
                    {
                        rootPage.NotifyUser(Errors.NoExifThumbnail, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser(Errors.NoThumbnail, NotifyType.StatusMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
            }
        }

void InkPresenter_StrokesCollected | ( | InkPresenter | sender,
 |  | InkStrokesCollectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario1.xaml.cs.

        {
            dispatcherTimer.Stop();
            inkAnalyzer.AddDataForStrokes(args.Strokes);
            dispatcherTimer.Start();
        }

void InkPresenter_StrokesErased | ( | InkPresenter | sender,
 |  | InkStrokesErasedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 90 of file Scenario1.xaml.cs.

        {
            dispatcherTimer.Stop();
            foreach (var stroke in args.Strokes)
            {
                inkAnalyzer.RemoveDataForStroke(stroke.Id);
            }
            dispatcherTimer.Start();
        }

async void mediaPlayer_MediaEnded | ( | MediaPlayer | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 425 of file Scenario1.xaml.cs.

        {
            if (isThisPageActive)
            {
                if (currentItemIndex < playlist.Count - 1)
                {
                    // Current media must've been playing if we received an event about it ending.
                    // The design of this sample scenario is to automatically start playing the next
                    // item in the playlist.  So we'll set the AutoPlay property to true, then in
                    // SetNewMediaItem() when we eventually set Source on the MediaPlayer,
                    // it will automatically playing the new media item.
                    mediaPlayer.AutoPlay = true;
                    await SetNewMediaItem(currentItemIndex + 1);
                }
                else
                {
                    // End of playlist reached.
                    if (repeatPlaylist)
                    {
                        // Playlist repeat was selected so start again.
                        mediaPlayer.AutoPlay = true;
                        await SetNewMediaItem(0);
                        await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => // UI updates must happen on dispatcher thread
                        {
                            rootPage.NotifyUser("end of playlist, starting playback again at beginning of playlist", NotifyType.StatusMessage);
                        });
                    }
                    else
                    {
                        // Repeat wasn't selected so just stop playback.
                        mediaPlayer.AutoPlay = false;
                        mediaPlayer.Pause();
                        mediaPlayer.PlaybackSession.Position = TimeSpan.Zero;
                        await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            rootPage.NotifyUser("end of playlist, stopping playback", NotifyType.StatusMessage);
                        });
                    }
                }
            }
        }

async void mediaPlayer_MediaFailed | ( | MediaPlayer | sender,
 |  | MediaPlayerFailedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 467 of file Scenario1.xaml.cs.

        {
            // UI updates must happen on dispatcher thread
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (isThisPageActive)
                {
                    string errorMessage = String.Format(@"Cannot play {0} [""{1}""]." +
                        "\nPress Next or Previous to continue, or select new files to play.",
                        playlist[currentItemIndex].Name,
                        e.ErrorMessage.Trim());

                    rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
                }
            });
        }

async void mediaPlayer_MediaOpened | ( | MediaPlayer | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 391 of file Scenario1.xaml.cs.

        {
            // UI updates must happen on dispatcher thread
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (isThisPageActive)
                {
                    if (mediaPlaybackItem.AudioTracks.Count == 0)
                    {
                        // Ensure the XAML MediaPlayerElement control has enough height and some reasonable width
                        // to display the build-in transport controls for audio-only playback.
                        mediaPlayerElement.MinWidth = 456;
                        mediaPlayerElement.MinHeight = 120;
                        mediaPlayerElement.MaxHeight = 120;

                        // Force the MediaPlayerElement out of fullscreen mode in case the user was using that
                        // for a video playback but we are now loading audio-only content.  The build-in
                        // transport controls for audio-only playback do not have the button to
                        // enter/exit fullscreen mode.
                        mediaPlayerElement.IsFullWindow = false;
                    }
                    else
                    {
                        // For video playback, let XAML resize MediaPlayerElement control based on the dimensions
                        // of the video, but also have XAML scale it down as necessary (preserving aspect ratio)
                        // to a reasonable maximum height like 300.
                        mediaPlayerElement.MinWidth = 0;
                        mediaPlayerElement.MinHeight = 0;
                        mediaPlayerElement.MaxHeight = 300;
                    }
                }
            });
        }

async void mediaPlayer_PlaybackStateChanged | ( | MediaPlaybackSession | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 549 of file Scenario1.xaml.cs.

        {
            // UI updates must happen on dispatcher thread
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (!isThisPageActive)
                {
                    return;
                }

                // For the design of this sample, the general idea is that if user is playing
                // media when Next/Previous is invoked, we will automatically start playing
                // the new item once it has loaded.  Whereas if the user has paused or stopped
                // media playback when Next/Previous is invoked, we won't automatically start
                // playing the new item.  In other words, we maintain the user's intent to
                // play or not play across changing the media.  This is most easily handled
                // using the AutoPlay property of the MediaPlayer.
                if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
                {
                    mediaPlayer.AutoPlay = true;
                }
                else if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.None ||
                         mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
                {
                    mediaPlayer.AutoPlay = false;
                }

                // Update the playback status tracked by SystemMediaTransportControls.  See comments
                // in SyncPlaybackStatusToMediaPlayerState()'s body for why this is important.
                SyncPlaybackStatusToMediaPlayerState();
            });
        }

void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario1.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 12;
            SetMapStyle();
            SetMapProjection();
        }

void MyMap_MapTapped | ( | Windows.UI.Xaml.Controls.Maps.MapControl | sender,
 |  | Windows.UI.Xaml.Controls.Maps.MapInputEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario1.xaml.cs.

        {
            var tappedGeoPosition = args.Location.Position;
            string status = "MapTapped at \nLatitude:" + tappedGeoPosition.Latitude + "\nLongitude: " + tappedGeoPosition.Longitude;
            rootPage.NotifyUser( status, NotifyType.StatusMessage);
        }

async void nextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle the Custom Transport Controls SkipNext button click.

Parameters:
sender
e

Definition at line 913 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Custom Transport Controls Next pressed", NotifyType.StatusMessage);
            // range-checking will be performed in SetNewMediaItem()
            await SetNewMediaItem(currentItemIndex + 1);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_PlayingVideos.xaml.cs.

        {
            MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when we are about to leave this page.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 127 of file Scenario1.xaml.cs.

        {
            isThisPageActive = false;
            rootPage = null;

            // Because the system media transport control object is associated with the current app view
            // (ie. window), all scenario pages in this sample will be using the same instance. Therefore
            // we need to remove the event handlers specific to this scenario page before
            // user navigates away to another scenario in the sample.
            systemMediaControls.ButtonPressed -= systemMediaControls_ButtonPressed;
            systemMediaControls.PlaybackRateChangeRequested -= systemMediaControls_PlaybackRateChangeRequested;
            systemMediaControls.PlaybackPositionChangeRequested -= systemMediaControls_PlaybackPositionChangeRequested;
            systemMediaControls.AutoRepeatModeChangeRequested -= systemMediaControls_AutoRepeatModeChangeRequested;

            // Perform other cleanup for this scenario page.
            mediaPlayer.Source = null;
            playlist = null;
            currentItemIndex = 0;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario1.xaml.cs.

        {
            ResetOutput();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 57 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 38 of file scenario1.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 106 of file scenario1_identity.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 43 of file Find.xaml.cs.

        {
            FindQueryText.Text = "continent OR can OR rain";
            ContentText.Text = "Mount Rainier is on the North American Continent.";
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 35 of file S1_AddFolder.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 27 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 80 of file Scenario1.xaml.cs.

        {
            // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
            // as NotifyUser()
            rootPage = MainPage.Current;
            isThisPageActive = true;

            // retrieve the SystemMediaTransportControls object, register for its events, and configure it
            // to a disabled state consistent with how this scenario starts off (ie. no media loaded)
            SetupSystemMediaTransportControls();

            if (!isInitialized)
            {
                isInitialized = true;

                // Create a new MediaPlayer and assign it to the element for video rendering
                mediaPlayer = new MediaPlayer();
                mediaPlayerElement.SetMediaPlayer(mediaPlayer);

                // MediaPlayer has automatic integration with SMTC. This sample demonstrates manual
                // integration with SMTC, and so we disable the MediaPlayer's CommandManager.
                // Unless you have a need to manually integrate with SMTC, it is recommended that
                // you use the built-in integration through CommandManager instead of the
                // procedures demonstrated throughout this sample.
                mediaPlayer.CommandManager.IsEnabled = false;

                mediaPlayer.PlaybackSession.PlaybackStateChanged += mediaPlayer_PlaybackStateChanged;
                mediaPlayer.MediaOpened += mediaPlayer_MediaOpened;
                mediaPlayer.MediaEnded += mediaPlayer_MediaEnded;
                mediaPlayer.MediaFailed += mediaPlayer_MediaFailed;

                smtcPositionUpdateTimer = new DispatcherTimer();
                smtcPositionUpdateTimer.Interval = TimeSpan.FromSeconds(5);
                smtcPositionUpdateTimer.Tick += positionUpdate_TimerTick;
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 62 of file Scenario1.xaml.cs.

        {
            dispatcherTimer.Stop();
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void OpenMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 33 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Action: Open", NotifyType.StatusMessage);
        }

async void pickFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles the pick file button click event to load a video.

Definition at line 42 of file Scenario1_PlayingVideos.xaml.cs.

        {
            // Clear previous returned file name, if it exists, between iterations of this scenario
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Create and open the file picker
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            openPicker.FileTypeFilter.Add(".mp4");
            openPicker.FileTypeFilter.Add(".mkv");
            openPicker.FileTypeFilter.Add(".avi");

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                rootPage.NotifyUser("Picked video: " + file.Name, NotifyType.StatusMessage);
                this.mediaPlayerElement.MediaPlayer.Source = MediaSource.CreateFromStorageFile(file);
                this.mediaPlayerElement.MediaPlayer.Play();
            }
            else
            {
                rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);
            }
        }

void playPauseButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle the Custom Transport Controls Play / Pause button being clicked.

Parameters:
sender
e

Definition at line 894 of file Scenario1.xaml.cs.

        {
            if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
            {
                mediaPlayer.Play();
                rootPage.NotifyUser("Custom Transport Controls Play pressed", NotifyType.StatusMessage);
            }
            else
            {
                mediaPlayer.Pause();
                rootPage.NotifyUser("Custom Transport Controls Pause pressed", NotifyType.StatusMessage);
            }
        }

void positionUpdate_TimerTick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file Scenario1.xaml.cs.

        {
            UpdateSmtcPosition();
        }

async void previousButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle the Custom Transport Controls SkipPrevious button click.

Parameters:
sender
e

Definition at line 925 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Custom Transport Controls Previous pressed", NotifyType.StatusMessage);
            // range-checking will be performed in SetNewMediaItem()
            await SetNewMediaItem(currentItemIndex - 1);
        }

void PrintMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Action: Print", NotifyType.StatusMessage);
        }

void projectionCombobox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario1.xaml.cs.

        {
            // Protect against events that are raised before we are fully initialized.
            if (myMap != null)
            {
                SetMapProjection();
            }
        }

void ResetOutput ( ) [inline, private]

Definition at line 32 of file Scenario1.xaml.cs.

        {
            DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
            String scaleValue = (displayInformation.RawPixelsPerViewPixel * 100.0).ToString("F0");
            ScalingText.Text = scaleValue + "%";
            ManualLoadURL.Text = String.Format(imageBase, scaleValue);
            LogicalDPIText.Text = displayInformation.LogicalDpi.ToString() + " DPI";
        }

async void SearchButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 33 of file Scenario1.xaml.cs.

        {
            StorageFolder musicFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.MusicLibrary);

            List<string> fileTypeFilter = new List<string>();
            fileTypeFilter.Add("*");

            QueryOptions queryOptions = new QueryOptions(CommonFileQuery.OrderBySearchRank, fileTypeFilter);
            //use the user's input to make a query
            queryOptions.UserSearchFilter = InputTextBox.Text;
            StorageFileQueryResult queryResult = musicFolder.CreateFileQueryWithOptions(queryOptions);

            StringBuilder outputText = new StringBuilder();

            //find all files that match the query
            IReadOnlyList<StorageFile> files = await queryResult.GetFilesAsync();
            //output how many files that match the query were found
            if (files.Count == 0)
            {
                outputText.Append("No files found for '" + queryOptions.UserSearchFilter + "'");
            }
            else if (files.Count == 1)
            {
                outputText.Append(files.Count + " file found:\n\n");
            }
            else
            {
                outputText.Append(files.Count + " files found:\n\n");
            }

            //output the name of each file that matches the query
            foreach (StorageFile file in files)
            {
                outputText.Append(file.Name + "\n");
            }

            OutputTextBlock.Text = outputText.ToString();
        }

async void SelectFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when user invokes the "Select Files" XAML button in the app.

Launches the Windows File Picker to let user select a list of audio or video files

Definition at line 351 of file Scenario1.xaml.cs.

        {
            FileOpenPicker filePicker = new FileOpenPicker();
            filePicker.ViewMode = PickerViewMode.List;
            filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
            filePicker.CommitButtonText = "Play";
            foreach (string fileExtension in supportedAudioFormats)
            {
                filePicker.FileTypeFilter.Add(fileExtension);
            }
            foreach (string fileExtension in supportedVideoFormats)
            {
                filePicker.FileTypeFilter.Add(fileExtension);
            }

            IReadOnlyList<StorageFile> selectedFiles = await filePicker.PickMultipleFilesAsync();
            if (selectedFiles.Count > 0)
            {
                rootPage.NotifyUser(String.Format("{0} file(s) selected", selectedFiles.Count), NotifyType.StatusMessage);
                playlist = selectedFiles;

                // Now that we have a playlist ready, allow the user to control media playback via system media
                // transport controls.  We enable it now even if one or more files may turn out unable to load
                // into the MediaPlayer, to allow the user to invoke Next/Previous to go to another
                // item in the playlist to try playing.
                systemMediaControls.IsEnabled = true;

                // For the design of this sample scenario, we will always automatically start playback after
                // the user has selected new files to play.  Set AutoPlay to true so the MediaPlayer
                // will automatically start playing after we set Source on it in SetNewMediaItem().
                mediaPlayer.AutoPlay = true;
                await SetNewMediaItem(0);   // Start with first file in the list of picked files.
            }
            else
            {
                // user canceled the file picker
                rootPage.NotifyUser("no files selected", NotifyType.StatusMessage);
            }
        }

void SetMapProjection ( ) [inline, private]

Definition at line 102 of file Scenario1.xaml.cs.

        {
            switch (projectionCombobox.SelectedIndex)
            {
                case 0:
                    myMap.MapProjection = MapProjection.WebMercator;
                    break;
                case 1:
                    myMap.MapProjection = MapProjection.Globe;
                    break;
            }
        }

void SetMapStyle ( ) [inline, private]

Definition at line 71 of file Scenario1.xaml.cs.

        {
            switch(styleCombobox.SelectedIndex)
            {
                case 0:
                    myMap.Style = MapStyle.None;
                    break;
                case 1:
                    myMap.Style = MapStyle.Road;
                    break;
                case 2:
                    myMap.Style = MapStyle.Aerial;
                    break;
                case 3:
                    myMap.Style = MapStyle.AerialWithRoads;
                    break;
                case 4:
                    myMap.Style = MapStyle.Terrain;
                    break;
            }
        }

async Task SetNewMediaItem ( int newItemIndex ) [inline, private]

Performs all necessary actions (including SystemMediaTransportControls related) of loading a new media item in the app for playback.

Parameters:
newItemIndex index in playlist of new item to load for playback, can be out of range.

If the newItemIndex argument is out of range, it will be adjusted accordingly to stay in range.

Definition at line 757 of file Scenario1.xaml.cs.

        {
            // enable Next button unless we're on last item of the playlist
            if (newItemIndex >= playlist.Count - 1)
            {
                systemMediaControls.IsNextEnabled = false;
                newItemIndex = playlist.Count - 1;
            }
            else
            {
                systemMediaControls.IsNextEnabled = true;
            }

            // enable Previous button unless we're on first item of the playlist
            if (newItemIndex <= 0)
            {
                systemMediaControls.IsPreviousEnabled = false;
                newItemIndex = 0;
            }
            else
            {
                systemMediaControls.IsPreviousEnabled = true;
            }

            // note that the Play, Pause and Stop buttons were already enabled via SetupSystemMediaTransportControls()
            // invoked during this scenario page's OnNavigateToHandler()

            currentItemIndex = newItemIndex;
            StorageFile mediaFile = playlist[newItemIndex];
            IRandomAccessStream stream = null;
            try
            {
                stream = await mediaFile.OpenAsync(FileAccessMode.Read);
            }
            catch (Exception e)
            {
                // User may have navigated away from this scenario page to another scenario page
                // before the async operation completed.
                if (isThisPageActive)
                {
                    // If the file can't be opened, for this sample we will behave similar to the case of
                    // setting a corrupted/invalid media file stream on the MediaPlayer (which triggers a
                    // MediaFailed event).  We abort any ongoing playback by nulling the MediaPlayer's
                    // source.  The user must press Next or Previous to move to a different media item,
                    // or use the file picker to load a new set of files to play.
                    mediaPlayer.Source = null;

                    string errorMessage = String.Format(@"Cannot open {0} [""{1}""]." +
                        "\nPress Next or Previous to continue, or select new files to play.",
                        mediaFile.Name,
                        e.Message.Trim());
                    rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
                }
            }

            // User may have navigated away from this scenario page to another scenario page
            // before the async operation completed. Check to make sure page is still active.
            if (!isThisPageActive)
            {
                return;
            }

            if (stream != null)
            {
                // We're about to change the MediaPlayer's source media, so put ourselves into a
                // "changing media" state.  We stay in that state until the new media is playing,
                // loaded (if user has currently paused or stopped playback), or failed to load.
                // At those points we will call OnChangingMediaEnded().
                //
                // Note that the SMTC visual state may not update until assigning a source or
                // beginning playback. If using a different API than MediaPlayer, such as AudioGraph,
                // you will need to begin playing a stream to see SMTC update.
                mediaPlaybackItem = new MediaPlaybackItem(MediaSource.CreateFromStream(stream, mediaFile.ContentType));
                mediaPlayer.Source = mediaPlaybackItem;
            }

            try
            {
                // Updates the system UI for media transport controls to display metadata information
                // reflecting the file we are playing (eg. track title, album art/video thumbnail, etc.)
                // We call this even if the mediaFile can't be opened; in that case the method can still
                // update the system UI to remove any metadata information previously displayed.
                await UpdateSystemMediaControlsDisplayAsync(mediaFile);
            }
            catch (Exception e)
            {
                // Check isThisPageActive as user may have navigated away from this scenario page to
                // another scenario page before the async operations completed.
                if (isThisPageActive)
                {
                    rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
                }
            }
        }

void SetupSystemMediaTransportControls ( ) [inline, private]

Invoked from this scenario page's OnNavigatedTo event handler.

Retrieve and initialize the SystemMediaTransportControls object.

Definition at line 151 of file Scenario1.xaml.cs.

        {
            // Retrieve the SystemMediaTransportControls object associated with the current app view
            // (ie. window).  There is exactly one instance of the object per view, instantiated by
            // the system the first time GetForCurrentView() is called for the view.  All subsequent
            // calls to GetForCurrentView() from the same view (eg. from different scenario pages in
            // this sample) will return the same instance of the object.
            systemMediaControls = SystemMediaTransportControls.GetForCurrentView();

            // This scenario will always start off with no media loaded, so we will start off disabling the
            // system media transport controls.  Doing so will hide the system UI for media transport controls
            // from being displayed, and will prevent the app from receiving any events such as ButtonPressed
            // from it, regardless of the current state of event registrations and button enable/disable states.
            // This makes IsEnabled a handy way to turn system media transport controls off and back on, as you
            // may want to do when the user navigates to and away from certain parts of your app.
            systemMediaControls.IsEnabled = false;

            // To receive notifications for the user pressing media keys (eg. "Stop") on the keyboard, or
            // clicking/tapping on the equivalent software buttons in the system media transport controls UI,
            // all of the following needs to be true:
            //     1. Register for ButtonPressed event on the SystemMediaTransportControls object.
            //     2. IsEnabled property must be true to enable SystemMediaTransportControls itself.
            //        [Note: IsEnabled is initialized to true when the system instantiates the
            //         SystemMediaTransportControls object for the current app view.]
            //     3. For each button you want notifications from, set the corresponding property to true to
            //        enable the button.  For example, set IsPlayEnabled to true to enable the "Play" button
            //        and media key.
            //        [Note: the individual button-enabled properties are initialized to false when the
            //         system instantiates the SystemMediaTransportControls object for the current app view.]
            //
            // Here we'll perform 1, and 3 for the buttons that will always be enabled for this scenario (Play,
            // Pause, Stop).  For 2, we purposely set IsEnabled to false to be consistent with the scenario's
            // initial state of no media loaded.  Later in the code where we handle the loading of media
            // selected by the user, we will enable SystemMediaTransportControls.
            systemMediaControls.ButtonPressed += systemMediaControls_ButtonPressed;

            // Add event handlers to support requests from the system to change our playback state.
            systemMediaControls.PlaybackRateChangeRequested += systemMediaControls_PlaybackRateChangeRequested;
            systemMediaControls.PlaybackPositionChangeRequested += systemMediaControls_PlaybackPositionChangeRequested;
            systemMediaControls.AutoRepeatModeChangeRequested += systemMediaControls_AutoRepeatModeChangeRequested;

            // Subscribe to property changed events to get SoundLevel changes.
            systemMediaControls.PropertyChanged += systemMediaControls_PropertyChanged;

            // Note: one of the prerequisites for an app to be allowed to play audio while in background,
            // is to enable handling Play and Pause ButtonPressed events from SystemMediaTransportControls.
            systemMediaControls.IsPlayEnabled = true;
            systemMediaControls.IsPauseEnabled = true;
            systemMediaControls.IsStopEnabled = true;
            systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Closed;
        }

async void ShowAsStandalone_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario1.xaml.cs.

        {
            var selectedView = ViewChooser.SelectedItem as ViewLifetimeControl;
            var sizePreference = SizePreferenceChooser.SelectedItem as SizePreferenceString;
            var anchorSizePreference = AnchorSizePreferenceChooser.SelectedItem as SizePreferenceString;

            if (selectedView != null && sizePreference != null && anchorSizePreference != null)
            {
                try
                {
                    // Prevent the view from closing while
                    // switching to it
                    selectedView.StartViewInUse();

                    // Show the previously created secondary view, using the size
                    // preferences the user specified. In your app, you should
                    // choose a size that's best for your scenario and code it,
                    // instead of requiring the user to decide.
                    var viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(
                        selectedView.Id,
                        sizePreference.Preference,
                        ApplicationView.GetForCurrentView().Id,
                        anchorSizePreference.Preference);

                    if (!viewShown)
                    {
                        // The window wasn't actually shown, so release the reference to it
                        // This may trigger the window to be destroyed
                        rootPage.NotifyUser("The view was not shown. Make sure it has focus", NotifyType.ErrorMessage);
                    }

                    // Signal that switching has completed and let the view close
                    selectedView.StopViewInUse();
                }
                catch (InvalidOperationException)
                {
                    // The view could be in the process of closing, and
                    // this thread just hasn't updated. As part of being closed,
                    // this thread will be informed to clean up its list of
                    // views (see SecondaryViewPage.xaml.cs)
                }
            }
            else
            {
                rootPage.NotifyUser("Please choose a view to show, a size preference for each view", NotifyType.ErrorMessage);
            }
        }

void StrokeInput_StrokeStarted | ( | InkStrokeInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario1.xaml.cs.

        {
            // Don't perform analysis while a stroke is in progress.
            dispatcherTimer.Stop();
        }

void styleCombobox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file Scenario1.xaml.cs.

        {
            // Protect against events that are raised before we are fully initialized.
            if (myMap != null)
            {
                SetMapStyle();
            }
        }

void SyncPlaybackStatusToMediaPlayerState ( ) [inline, private]

Updates the SystemMediaTransportControls' PlaybackStatus property based on the PlaybackState property of the MediaPlayer.

Invoked mainly from the MediaPlayer's PlaybackStateChanged event handler.

Definition at line 489 of file Scenario1.xaml.cs.

        {
            // Updating PlaybackStatus with accurate information is important; for example, it determines whether the system media
            // transport controls UI will show a play vs pause software button, and whether hitting the play/pause toggle key on
            // the keyboard will translate to a Play vs a Pause ButtonPressed event.
            //
            // Even if your app uses its own custom transport controls in place of the built-in ones from XAML, it is still a good
            // idea to update PlaybackStatus in response to the MediaPlayer's PlaybackStateChanged event.  Windows supports scenarios
            // such as streaming media from a MediaPlayer to a networked device (eg. TV) selected by the user from Devices charm
            // (ie. "Play To"), in which case the user may pause and resume media streaming using a TV remote or similar means.
            // The CurrentStateChanged event may be the only way to get notified of playback status changes in those cases.
            switch (mediaPlayer.PlaybackSession.PlaybackState)
            {
                case MediaPlaybackState.None:
                    systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Closed;
                    break;

                case MediaPlaybackState.Opening:
                    // This state is when new media is being loaded to the MediaPlayer [ie.
                    // Source].  For this sample the design is to maintain the previous playing/pause
                    // state before the new media is being loaded.  So we'll leave the PlaybackStatus alone
                    // during loading.  This keeps the system UI from flickering between displaying a "Play"
                    // vs "Pause" software button during the transition to a new media item.
                    break;

                case MediaPlaybackState.Buffering:
                    // No updates in MediaPlaybackStatus necessary--buffering is just
                    // a transitional state where the system is still working to get
                    // media to start or to continue playing.
                    break;

                case MediaPlaybackState.Paused:
                    if (mediaPlayer.PlaybackSession.Position == TimeSpan.Zero)
                        systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Stopped;
                    else
                        systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;
                    break;

                case MediaPlaybackState.Playing:
                    systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Playing;
                    break;

            }

            // If we started playing start our timer else make sure it's stopped.
            // On state changed always send an update to keep the system in sync.
            if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
            {
                smtcPositionUpdateTimer.Start();
            }
            else
            {
                smtcPositionUpdateTimer.Stop();
            }

            UpdateSmtcPosition();

            UpdateCustomTransportControls();
        }

async void systemMediaControls_AutoRepeatModeChangeRequested | ( | SystemMediaTransportControls | sender,
 |  | AutoRepeatModeChangeRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 234 of file Scenario1.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // MediaPlayer only supports repeating a track, if we want to repeat a list we need to handle it ourselves (or use a MediaPlaybackList)
                switch (args.RequestedAutoRepeatMode)
                {
                    case MediaPlaybackAutoRepeatMode.None:
                        mediaPlayer.IsLoopingEnabled = false;
                        repeatPlaylist = false;
                        break;
                    case MediaPlaybackAutoRepeatMode.List:
                        mediaPlayer.IsLoopingEnabled = false;
                        repeatPlaylist = true;
                        break;
                    case MediaPlaybackAutoRepeatMode.Track:
                        mediaPlayer.IsLoopingEnabled = true;
                        repeatPlaylist = false;
                        break;
                }

                // Report back our new state as whatever was requested, seeing as we always honor it.
                systemMediaControls.AutoRepeatMode = args.RequestedAutoRepeatMode;
                rootPage.NotifyUser("Auto repeat mode change requested", NotifyType.StatusMessage);
            });
        }

async void systemMediaControls_ButtonPressed | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsButtonPressedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 582 of file Scenario1.xaml.cs.

        {
            // The system media transport control's ButtonPressed event may not fire on the app's UI thread.  XAML controls
            // (including the MediaPlayerElement control in our page as well as the scenario page itself) typically can only be
            // safely accessed and manipulated on the UI thread, so here for simplicity, we dispatch our entire event handling
            // code to execute on the UI thread, as our code here primarily deals with updating the UI and the MediaPlayerElement.
            //
            // Depending on how exactly you are handling the different button presses (which for your app may include buttons
            // not used in this sample scenario), you may instead choose to only dispatch certain parts of your app's
            // event handling code (such as those that interact with XAML) to run on UI thread.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Because the handling code is dispatched asynchronously, it is possible the user may have
                // navigated away from this scenario page to another scenario page by the time we are executing here.
                // Check to ensure the page is still active before proceeding.
                if (isThisPageActive)
                {
                    switch (args.Button)
                    {
                        case SystemMediaTransportControlsButton.Play:
                            rootPage.NotifyUser("Play pressed", NotifyType.StatusMessage);
                            mediaPlayer.Play();
                            break;

                        case SystemMediaTransportControlsButton.Pause:
                            rootPage.NotifyUser("Pause pressed", NotifyType.StatusMessage);
                            mediaPlayer.Pause();
                            break;

                        case SystemMediaTransportControlsButton.Stop:
                            rootPage.NotifyUser("Stop pressed", NotifyType.StatusMessage);
                            mediaPlayer.Pause();
                            mediaPlayer.PlaybackSession.Position = TimeSpan.Zero;
                            break;

                        case SystemMediaTransportControlsButton.Next:
                            rootPage.NotifyUser("Next pressed", NotifyType.StatusMessage);
                            // range-checking will be performed in SetNewMediaItem()
                            await SetNewMediaItem(currentItemIndex + 1);
                            break;

                        case SystemMediaTransportControlsButton.Previous:
                            rootPage.NotifyUser("Previous pressed", NotifyType.StatusMessage);
                            // range-checking will be performed in SetNewMediaItem()
                            await SetNewMediaItem(currentItemIndex - 1);
                            break;

                            // Insert additional case statements for other buttons you want to handle in your app.
                            // Remember that you also need to first enable those buttons via the corresponding
                            // Is****Enabled property on the SystemMediaTransportControls object.
                    }
                }
            });
        }

async void systemMediaControls_PlaybackPositionChangeRequested | ( | SystemMediaTransportControls | sender,
 |  | PlaybackPositionChangeRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Handles a request from the System Media Transport Controls to change our current playback position.

Definition at line 290 of file Scenario1.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // First we validate that the requested position falls within the range of the current piece of content we are playing,
                // this should usually be the case but the content may have changed whilst the request was coming in.
                if (args.RequestedPlaybackPosition.Duration() <= mediaPlayer.PlaybackSession.NaturalDuration.Duration() &&
                args.RequestedPlaybackPosition.Duration().TotalSeconds >= 0)
                {
                    // Next we verify that our player is in a state that we think is valid to change the position
                    if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused || mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
                    {
                        // Finally if the above conditions are met we update the position and report the new position back to SMTC.
                        mediaPlayer.PlaybackSession.Position = args.RequestedPlaybackPosition.Duration();
                        UpdateSmtcPosition();
                    }
                }

                rootPage.NotifyUser("Playback position change requested", NotifyType.StatusMessage);
            });
        }

async void systemMediaControls_PlaybackRateChangeRequested | ( | SystemMediaTransportControls | sender,
 |  | PlaybackRateChangeRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Handles a request from the System Media Transport Controls to change our current playback rate.

Definition at line 315 of file Scenario1.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Check to make sure the requested value is in a range we deem appropriate, if so set it on the MediaPlayer.
                // We then need to turn around and update SMTC so that the system knows the new value.
                if (args.RequestedPlaybackRate >= 0 && args.RequestedPlaybackRate <= 2)
                {
                    mediaPlayer.PlaybackSession.PlaybackRate = args.RequestedPlaybackRate;
                    systemMediaControls.PlaybackRate = mediaPlayer.PlaybackSession.PlaybackRate;
                }

                rootPage.NotifyUser("Playback rate change requested", NotifyType.StatusMessage);
            });
        }

async void systemMediaControls_PropertyChanged | ( | SystemMediaTransportControls | sender,
 |  | SystemMediaTransportControlsPropertyChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 203 of file Scenario1.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (args.Property == SystemMediaTransportControlsProperty.SoundLevel)
                {
                    // Check for the new Sound level
                    switch (systemMediaControls.SoundLevel)
                    {
                        case SoundLevel.Full:
                        case SoundLevel.Low:
                            // If we had paused due to system mute, then resume on unmute.
                            if (pausedDueToMute)
                            {
                                mediaPlayer.Play();
                                pausedDueToMute = false;
                            }
                            break;
                        case SoundLevel.Muted:
                            // We've been muted by the system. Pause playback to release resources.
                            if (mediaPlayer != null && mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
                            {
                                mediaPlayer.Pause();
                                pausedDueToMute = true;
                            }
                            break;
                    }
                }
            });
        }

void target_DoubleTapped | ( | object | sender,
 |  | DoubleTappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file 1-InputEvents.xaml.cs.

        {
            tapTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
            tapTargetText.Text = "Double-Tapped";
        }

void target_Holding | ( | object | sender,
 |  | HoldingRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file 1-InputEvents.xaml.cs.

        {
            if (e.HoldingState == Windows.UI.Input.HoldingState.Started)
            {
                holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
                holdTargetText.Text = "Holding";
            }
            else if (e.HoldingState == Windows.UI.Input.HoldingState.Completed)
            {
                holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
                holdTargetText.Text = "Held";
            }
            else
            {
                holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
                holdTargetText.Text = "Hold Canceled";
            }
        }

void target_PointerEntered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 58 of file 1-InputEvents.xaml.cs.

        {
            enterExitTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
            enterExitTargetText.Text = "Pointer Entered";
        }

void target_PointerExited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file 1-InputEvents.xaml.cs.

        {
            enterExitTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
            enterExitTargetText.Text = "Pointer Exited";
        }

void target_PointerPressed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file 1-InputEvents.xaml.cs.

        {
            pressedTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
            pressedTargetText.Text = "Pointer Pressed";
        }

void target_PointerReleased | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file 1-InputEvents.xaml.cs.

        {
            pressedTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
            pressedTargetText.Text = "Pointer Released";
        }

void target_RightTapped | ( | object | sender,
 |  | RightTappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file 1-InputEvents.xaml.cs.

        {
            holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
            holdTargetText.Text = "Right Tapped";
        }

void target_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file 1-InputEvents.xaml.cs.

        {
            tapTarget.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
            tapTargetText.Text = "Tapped";
        }

void TrafficFlowVisible_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario1.xaml.cs.

        {
            myMap.TrafficFlowVisible = true;
        }

void trafficFlowVisibleCheckBox_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario1.xaml.cs.

        {
            myMap.TrafficFlowVisible = false;
        }

void UpdateCustomTransportControls ( ) [inline, private]

Updates the custom transport controls (XAML).

For the sake of clarity in this Sample, we'll handle updating our custom transport controls seperately from updating the SystemMediaTransportControls.

This should be called on the UI thread.

Definition at line 861 of file Scenario1.xaml.cs.

        {
            // Update the custom controls based upon the state of our playlist.
            // We want to match the same state that was previously set on the SystemMediaTransportControls
            nextButton.IsEnabled = systemMediaControls.IsNextEnabled;
            previousButton.IsEnabled = systemMediaControls.IsPreviousEnabled;

            // Update the Play / Pause Toggle button based upon the MediaPlayer's current state
            switch (mediaPlayer.PlaybackSession.PlaybackState)
            {
                case MediaPlaybackState.None:
                    // Revert back to a known play / pause toggle state
                    playPauseButton.Content = new SymbolIcon(Symbol.Play);
                    playPauseButton.IsEnabled = false;
                    break;

                case MediaPlaybackState.Paused:
                    playPauseButton.Content = new SymbolIcon(Symbol.Play);
                    playPauseButton.IsEnabled = true;
                    break;

                case MediaPlaybackState.Playing:
                    playPauseButton.Content = new SymbolIcon(Symbol.Pause);
                    playPauseButton.IsEnabled = true;
                    break;
            }
        }

void UpdateSmtcPosition ( ) [inline, private]

Used to update all position/duration related information to the SystemMediaTransport controls.

Can be used when some state changes (new track, position changed) or periodically (every 5 seconds or so) to keep the system in sync with this apps playback state.

Definition at line 267 of file Scenario1.xaml.cs.

        {
            var timelineProperties = new SystemMediaTransportControlsTimelineProperties();

            // This is a simple scenario that supports seeking, therefore start time and min seek are both 0 and
            // end time and max seek are both the duration. This allows the system to suggest seeking anywhere in the track.
            // Position is the current player position.

            // Note: More complex scenarios may alter more of these values, such as only allowing seeking in a section of the content,
            // by setting min and max seek differently to start and end. For other scenarios such as live playback, end time may be
            // updated frequently too.
            timelineProperties.StartTime = TimeSpan.FromSeconds(0);
            timelineProperties.MinSeekTime = TimeSpan.FromSeconds(0);
            timelineProperties.Position = mediaPlayer.PlaybackSession.Position;
            timelineProperties.MaxSeekTime = mediaPlayer.PlaybackSession.NaturalDuration;
            timelineProperties.EndTime = mediaPlayer.PlaybackSession.NaturalDuration;

            systemMediaControls.UpdateTimelineProperties(timelineProperties);
        }

async Task UpdateSystemMediaControlsDisplayAsync ( StorageFile mediaFile ) [inline, private]

Updates the system UI for media transport controls to display media metadata from the given StorageFile.

Parameters:
mediaFile The media file being loaded. This method will try to extract media metadata from the file for use in the system UI for media transport controls.

Definition at line 684 of file Scenario1.xaml.cs.

        {
            MediaPlaybackType mediaType = GetMediaTypeFromFileContentType(mediaFile);

            bool copyFromFileAsyncSuccessful = false;
            if (MediaPlaybackType.Unknown != mediaType)
            {
                // Use the SystemMediaTransportControlsDisplayUpdater's CopyFromFileAsync() API method to try extracting
                // from the StorageFile the relevant media metadata information (eg. track title, artist and album art
                // for MediaPlaybackType.Music), copying them into properties of DisplayUpdater and related classes.
                //
                // In place of using CopyFromFileAsync() [or, you can't use that method because your app's media playback
                // scenario doesn't involve StorageFiles], you can also use other properties in DisplayUpdater and
                // related classes to explicitly set the MediaPlaybackType and media metadata properties to values of
                // your choosing.
                //
                // Usage notes:
                //     - the first argument cannot be MediaPlaybackType.Unknown
                //     - API method may throw an Exception on certain file errors from the passed in StorageFile, such as
                //       file-not-found error (eg. file was deleted after user had picked it from file picker earlier).
                try
                {
                    copyFromFileAsyncSuccessful = await systemMediaControls.DisplayUpdater.CopyFromFileAsync(mediaType, mediaFile);
                }
                catch (Exception)

                {
                    // For this sample, we will handle this case same as CopyFromFileAsync returning false,
                    // though we could provide our own metadata here.
                }
            }
            else
            {
                // If we are here, it means we are unable to determine a MediaPlaybackType based on the StorageFile's
                // ContentType (MIME type).  CopyFromFileAsync() requires a valid MediaPlaybackType (ie. cannot be
                // MediaPlaybackType.Unknown) for the first argument.  One way to handle this is to just pick a valid
                // MediaPlaybackType value to call CopyFromFileAsync() with, based on what your app does (eg. Music
                // if your app is a music player).  The MediaPlaybackType directs the API to look for particular sets
                // of media metadata information from the StorageFile, and extraction is best-effort so in worst case
                // simply no metadata information are extracted.
                //
                // For this sample, we will handle this case the same way as CopyFromFileAsync() returning false
            }

            if (!isThisPageActive)
            {
                // User may have navigated away from this scenario page to another scenario page
                // before the async operation completed.
                return;
            }

            if (!copyFromFileAsyncSuccessful)
            {
                // For this sample, if CopyFromFileAsync() didn't work for us for whatever reasons, we will just
                // clear DisplayUpdater of all previously set metadata, if any.  This makes sure we don't end up
                // displaying in the system UI for media transport controls any stale metadata from the media item
                // we were previously playing.
                systemMediaControls.DisplayUpdater.ClearAll();
            }

            // Finally update the system UI display for media transport controls with the new values currently
            // set in the DisplayUpdater, be it via CopyFrmoFileAsync(), ClearAll(), etc.
            systemMediaControls.DisplayUpdater.Update();
        }

String versionString ( PackageVersion version ) [inline, private]

Definition at line 34 of file scenario1_identity.xaml.cs.

        {
            return String.Format("{0}.{1}.{2}.{3}",
                                 version.Major, version.Minor, version.Build, version.Revision);
        }

Member Data Documentation

int currentItemIndex = 0 [private]

index to current media item in playlist

Definition at line 53 of file Scenario1.xaml.cs.

const string DEFAULT_TITLE = "New window" [private]

Definition at line 31 of file Scenario1.xaml.cs.

DispatcherTimer dispatcherTimer [private]

Definition at line 35 of file Scenario1.xaml.cs.

const String imageBase = "http://www.contoso.com/imageScale{0}.png" [private]

Definition at line 23 of file Scenario1.xaml.cs.

InkAnalyzer inkAnalyzer [private]

Definition at line 34 of file Scenario1.xaml.cs.

InkPresenter inkPresenter [private]

Definition at line 33 of file Scenario1.xaml.cs.

bool isInitialized = false [private]

Definition at line 39 of file Scenario1.xaml.cs.

bool isThisPageActive = false [private]

Indicates whether this scenario page is still active.

Changes value during navigation to or away from the page.

Definition at line 45 of file Scenario1.xaml.cs.

MediaPlaybackItem mediaPlaybackItem [private]

Definition at line 68 of file Scenario1.xaml.cs.

MediaPlayer mediaPlayer [private]

Definition at line 66 of file Scenario1.xaml.cs.

bool optedIn = false [static, private]

Definition at line 28 of file Scenario1.xaml.cs.

bool pausedDueToMute = false [private]

Definition at line 64 of file Scenario1.xaml.cs.

IReadOnlyList<StorageFile> playlist = null [private]

Definition at line 48 of file Scenario1.xaml.cs.

bool repeatPlaylist = false [private]

Indicates whetehr to stat the playlist again upon reaching the end.

Definition at line 58 of file Scenario1.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file scenario1.xaml.cs.

DispatcherTimer smtcPositionUpdateTimer = null [private]

Definition at line 62 of file Scenario1.xaml.cs.

string [] supportedAudioFormats [static, private]
Initial value:
 new string[]
        {
            ".3g2", ".3gp2", ".3gp", ".3gpp", ".m4a", ".mp4", ".asf", ".wma", ".aac", ".adt", ".adts", ".mp3", ".wav", ".ac3", ".ec3",
        }

Definition at line 336 of file Scenario1.xaml.cs.

string [] supportedVideoFormats [static, private]
Initial value:
 new string[]
        {
            ".3g2", ".3gp2", ".3gp", ".3gpp", ".m4v", ".mp4v", ".mp4", ".mov", ".m2ts", ".asf", ".wmv", ".avi",
        }

Definition at line 341 of file Scenario1.xaml.cs.

SystemMediaTransportControls systemMediaControls = null [private]

Definition at line 60 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario1.xaml.cs
  • BackButton/cs/Scenario1.xaml.cs
  • DpiScaling/cs/Scenario1.xaml.cs
  • FileAccess/cs/Scenario1_Create.xaml.cs
  • FileThumbnails/cs/Scenario1.xaml.cs
  • InkAnalysis/cs/Scenario1.xaml.cs
  • Logging/cs/Scenario1.xaml.cs
  • MapControl/cs/Scenario1.xaml.cs
  • MultipleViews/cs/Scenario1.xaml.cs
  • Package/cs/scenario1_identity.xaml.cs
  • SemanticTextQuery/cs/Find.xaml.cs
  • SystemMediaTransportControls/cs/Scenario1.xaml.cs
  • VideoPlayback/cs/Scenario1_PlayingVideos.xaml.cs
  • XamlContextMenu/cs/Scenario1.xaml.cs
  • BasicInput/cs/1-InputEvents.xaml.cs
  • ContextMenu/cs/Scenario1.xaml.cs
  • FileSearch/cs/Scenario1.xaml.cs
  • FolderEnumeration/cs/Scenario1.xaml.cs
  • LibraryManagement/cs/S1_AddFolder.xaml.cs
  • SimpleInk/cs/Scenario1.xaml.cs
  • ApplicationResources/cpp/scenario1.xaml.cpp
  • BackButton/cpp/Scenario1.xaml.cpp
  • BasicInput/cpp/1-InputEvents.xaml.cpp
  • ContextMenu/cpp/Scenario1.xaml.cpp
  • DatagramSocket/cpp/Scenario1.xaml.cpp
  • DpiScaling/cpp/Scenario1.xaml.cpp
  • FileAccess/cpp/Scenario1_Create.xaml.cpp
  • FileSearch/cpp/Scenario1.xaml.cpp
  • FileThumbnails/cpp/Scenario1.xaml.cpp
  • FolderEnumeration/cpp/Scenario1.xaml.cpp
  • LibraryManagement/cpp/S1_AddFolder.xaml.cpp
  • Logging/cpp/Scenario1.xaml.cpp
  • MapControl/cpp/Scenario1.xaml.cpp
  • Package/cpp/scenario1_identity.xaml.cpp
  • SemanticTextQuery/cpp/Find.xaml.cpp
  • SimpleInk/cpp/Scenario1.xaml.cpp
  • StreamSocket/cpp/Scenario1.xaml.cpp
  • WebSocket/cpp/Scenario1_UTF8.xaml.cpp
  • XamlContextMenu/cpp/Scenario1.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario10
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario10 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario10 ()
Scenario10 ()
Scenario10 ()
Scenario10 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddLayer1 ()
void | AddLayer2 ()
async Task | ColorizeCustomButtonAsync (Windows.UI.Color newColor)
void | CreateLayers ()
async void | DeleteFileButton_Click (object sender, RoutedEventArgs e)
async void | inkToolbar_InkDrawingAttributesChanged (InkToolbar sender, object args)
async void | inkToolbar_Loaded (object sender, RoutedEventArgs e)
void | mapElementsLayer1Button_Click (object sender, RoutedEventArgs e)
void | mapElementsLayer2Button_Click (object sender, RoutedEventArgs e)
void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | Scenario10_SearchMultipleResourceIds (ResourceContext context, string[] resourceIds)
void | Scenario10_ShowCandidates (string resourceId, IReadOnlyList< ResourceCandidate > resourceCandidates)
void | Scenario10Button_Show_Click (object sender, RoutedEventArgs e)
void | SelectLayer (MapElementsLayer selectedLayer)

Private Attributes

MapElementsLayer | myLayer1
MapElementsLayer | myLayer2
IList< MapLayer > | myLayers = new ObservableCollection<MapLayer>()
MainPage rootPage = MainPage.Current

Detailed Description

Deleting a file.

Definition at line 24 of file scenario10.xaml.cs.

Constructor & Destructor Documentation

Scenario10 ( ) [inline]

Definition at line 30 of file scenario10.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario10 ( ) [inline]

Definition at line 28 of file Scenario10_Delete.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario10 ( ) [inline]

Definition at line 29 of file Scenario10.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario10 ( ) [inline]

Definition at line 28 of file Scenario10.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes =
                Windows.UI.Core.CoreInputDeviceTypes.Mouse |
                Windows.UI.Core.CoreInputDeviceTypes.Pen;
        }

Member Function Documentation

void AddLayer1 ( ) [inline, private]

Definition at line 54 of file Scenario10.xaml.cs.

        {
            this.myLayer1 = new MapElementsLayer();
            this.myLayer1.MapElements = MainPage.CreateCityBuildingsCollection();
            this.myLayer1.MapElementClick += (sender, args) => SelectLayer(this.myLayer1);

            this.myLayers.Add(this.myLayer1);
        }

void AddLayer2 ( ) [inline, private]

Definition at line 63 of file Scenario10.xaml.cs.

        {
            this.myLayer2 = new MapElementsLayer();
            this.myLayer2.MapElements = MainPage.CreateCityParksCollection();
            this.myLayer2.MapElementClick += (sender, args) => SelectLayer(this.myLayer2);

            this.myLayers.Add(this.myLayer2);
        }

async Task ColorizeCustomButtonAsync ( Windows.UI.Color newColor ) [inline, private]

Definition at line 38 of file Scenario10.xaml.cs.

        {
            // Get the bitmap from the png
            var sourceUri = new Uri("ms-appx:///Assets/ButtonIconFill.png");
            StorageFile storageFile = await StorageFile.GetFileFromApplicationUriAsync(sourceUri);
            using (IRandomAccessStream readableStream = await storageFile.OpenAsync(FileAccessMode.Read))
            {
                BitmapDecoder bitmapDecoder = await BitmapDecoder.CreateAsync(readableStream);

                // Get the raw pixel data from the bitmap
                var dummyTransform = new BitmapTransform();
                PixelDataProvider pixelDataProvider = await bitmapDecoder.GetPixelDataAsync(
                    BitmapPixelFormat.Bgra8,
                    BitmapAlphaMode.Straight,
                    dummyTransform,
                    ExifOrientationMode.RespectExifOrientation,
                    ColorManagementMode.DoNotColorManage);

                byte[] pixelData = pixelDataProvider.DetachPixelData();

                // We now have direct access to the pixels.
                for (uint row = 0; row < bitmapDecoder.PixelHeight; row++)
                {
                    for (uint col = 0; col < bitmapDecoder.PixelWidth; col++)
                    {
                        var offset = (row * (int)bitmapDecoder.PixelWidth * 4) + (col * 4);

                        // Replace the pixel with newColor if it is our color key.
                        if ((pixelData[offset] <= 0x01) &&
                            (pixelData[offset + 1] <= 0x01) &&
                            (pixelData[offset + 2] <= 0x01) &&
                            (pixelData[offset + 3] != 0x00))
                        {
                            pixelData[offset] = newColor.B;
                            pixelData[offset + 1] = newColor.G;
                            pixelData[offset + 2] = newColor.R;
                            pixelData[offset + 3] = newColor.A;
                        }
                    }
                }

                // Create a bitmap from our modified pixel data.
                var bitmap = new WriteableBitmap((int)bitmapDecoder.PixelWidth, (int)bitmapDecoder.PixelHeight);

                using (Stream pixelStream = bitmap.PixelBuffer.AsStream())
                {
                    await pixelStream.WriteAsync(pixelData, 0, pixelData.Length);
                    pixelStream.Flush();
                    bitmap.Invalidate();
                }

                CustomButtonFill.Source = bitmap;
            }
        }

void CreateLayers ( ) [inline, private]

Definition at line 41 of file Scenario10.xaml.cs.

        {
            // Populate multiple layers containing points and connect up the click to events.
            AddLayer1();
            AddLayer2();

            // Style the layers so that layer 1 is selected and layer 2 is deselected.
            SelectLayer(this.myLayer1);

            // Connect the layers to the map.
            myMap.Layers = this.myLayers;
        }

async void DeleteFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario10_Delete.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    string filename = file.Name;
                    await file.DeleteAsync();
                    rootPage.sampleFile = null;
                    rootPage.NotifyUser($"The file '{filename}' was deleted", NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error deleting file '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

async void inkToolbar_InkDrawingAttributesChanged | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario10.xaml.cs.

        {
            // Change the color of the button icon for the calligraphic pen button
            if (CalligraphicPenButton == inkToolbar.ActiveTool)
            {
                await ColorizeCustomButtonAsync(sender.InkDrawingAttributes.Color);
            }
        }

async void inkToolbar_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario10.xaml.cs.

        {
            var selectedBrush = (SolidColorBrush)CalligraphicPenButton.SelectedBrush;
            await ColorizeCustomButtonAsync(selectedBrush.Color);
        }

void mapElementsLayer1Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file Scenario10.xaml.cs.

        {
            SelectLayer(this.myLayer1);
        }

void mapElementsLayer2Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario10.xaml.cs.

        {
            SelectLayer(this.myLayer2);
        }

void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario10.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 16;
            CreateLayers();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file scenario10.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario10_Delete.xaml.cs.

        {
            rootPage.ValidateFile();
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file Scenario10.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void Scenario10_SearchMultipleResourceIds | ( | ResourceContext | context,
 |  | string[] | resourceIds |
 | ) |  |  | [inline, private]

Definition at line 87 of file scenario10.xaml.cs.

        {
            this.Scenario10TextBlock.Text = "";
            var dimensionMap = ResourceManager.Current.MainResourceMap.GetSubtree("dimensions");

            foreach (var id in resourceIds)
            {
                NamedResource namedResource;
                if (dimensionMap.TryGetValue(id, out namedResource))
                {
                    var resourceCandidates = namedResource.ResolveAll(context);
                    Scenario10_ShowCandidates(id, resourceCandidates);
                }
            }
        }

void Scenario10_ShowCandidates | ( | string | resourceId,
 |  | IReadOnlyList< ResourceCandidate > | resourceCandidates |
 | ) |  |  | [inline, private]

Definition at line 103 of file scenario10.xaml.cs.

        {
            // print 'resourceId', 'found value', 'qualifer info', 'matching condition'
            string outText = "resourceId: dimensions\\" + resourceId + "\r\n";
            int i = 0;
            foreach (var candidate in resourceCandidates)
            {
                var value = candidate.ValueAsString;
                outText += "    Candidate " + i.ToString() + ":" + value + "\r\n";
                int j = 0;
                foreach (var qualifier in candidate.Qualifiers)
                {
                    var qualifierName = qualifier.QualifierName;
                    var qualifierValue = qualifier.QualifierValue;
                    outText += "        Qualifer: " + qualifierName + ": " + qualifierValue + "\r\n";
                    outText += "        Matching: IsMatch (" + qualifier.IsMatch.ToString() + ")  " + "IsDefault (" + qualifier.IsDefault.ToString() + ")" + "\r\n";
                    j++;
                }
                i++;
            }

            this.Scenario10TextBlock.Text += outText + "\r\n";

        }

void Scenario10Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario10Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 50 of file scenario10.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                // use a cloned context for this scenario so that qualifier values set
                // in this scenario don't impact behaviour in other scenarios that
                // use a default context for the view (crossover effects between
                // the scenarios will not be expected)
                var context = ResourceContext.GetForCurrentView().Clone();

                var selectedLanguage = Scenario10ComboBox_Language.SelectedValue;
                var selectedScale = Scenario10ComboBox_Scale.SelectedValue;
                var selectedContrast = Scenario10ComboBox_Contrast.SelectedValue;
                var selectedHomeRegion = Scenario10ComboBox_HomeRegion.SelectedValue;

                if (selectedLanguage != null)
                {
                    context.QualifierValues["language"] = selectedLanguage.ToString();
                }
                if (selectedScale != null)
                {
                    context.QualifierValues["scale"] = selectedScale.ToString();
                }
                if (selectedContrast != null)
                {
                    context.QualifierValues["contrast"] = selectedContrast.ToString();
                }
                if (selectedHomeRegion != null)
                {
                    context.QualifierValues["homeregion"] = selectedHomeRegion.ToString();
                }

                Scenario10_SearchMultipleResourceIds(context, new string[] { "LanguageOnly", "ScaleOnly", "ContrastOnly", "HomeRegionOnly", "MultiDimensional" });
            }
        }

void SelectLayer ( MapElementsLayer selectedLayer ) [inline, private]

Definition at line 82 of file Scenario10.xaml.cs.

        {
            // Ignore layer changes if no layers have been created.
            if (selectedLayer == null) return;

            // The other layer becomes deselected.
            MapElementsLayer deselectedLayer = (selectedLayer == this.myLayer1) ? this.myLayer2 : this.myLayer1;

            // The deselected layer goes to z-index 0, and its elements appear disabled.
            deselectedLayer.ZIndex = 0;
            foreach (MapElement e in deselectedLayer.MapElements)
            {
                e.MapStyleSheetEntryState = MapStyleSheetEntryStates.Disabled;
            }

            // The selected layer goes to z-index 1, and its elements appear normal.
            selectedLayer.ZIndex = 1;
            foreach (MapElement e in selectedLayer.MapElements)
            {
                e.MapStyleSheetEntryState = "";
            }
        }

Member Data Documentation

MapElementsLayer myLayer1 [private]

Definition at line 22 of file Scenario10.xaml.cs.

MapElementsLayer myLayer2 [private]

Definition at line 23 of file Scenario10.xaml.cs.

IList<MapLayer> myLayers = new ObservableCollection<MapLayer>() [private]

Definition at line 24 of file Scenario10.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file scenario10.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario10.xaml.cs
  • FileAccess/cs/Scenario10_Delete.xaml.cs
  • MapControl/cs/Scenario10.xaml.cs
  • SimpleInk/cs/Scenario10.xaml.cs
  • ApplicationResources/cpp/scenario10.xaml.cpp
  • FileAccess/cpp/Scenario10_Delete.xaml.cpp
  • MapControl/cpp/Scenario10.xaml.cpp
  • SimpleInk/cpp/Scenario10.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10_SetCookie Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario10_SetCookie
Public Member Functions | Private Member Functions | Private Attributes

Scenario10_SetCookie Class Reference

List of all members.

Public Member Functions

Scenario10_SetCookie ()

Private Member Functions

void SetCookie_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario10_SetCookie.xaml.cs.

Constructor & Destructor Documentation

Scenario10_SetCookie ( ) [inline]

Definition at line 25 of file Scenario10_SetCookie.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void SetCookie_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario10_SetCookie.xaml.cs.

        {
            if (String.IsNullOrEmpty(NameField.Text) || String.IsNullOrEmpty(DomainField.Text) || String.IsNullOrEmpty(PathField.Text))
            {
                rootPage.NotifyUser("Invalid name, domain, or path value.", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                HttpCookie cookie = new HttpCookie(NameField.Text, DomainField.Text, PathField.Text);
                cookie.Value = ValueField.Text;

                if (NullCheckBox.IsChecked.Value)
                {
                    cookie.Expires = null;
                }
                else
                {
                    cookie.Expires = ExpiresDatePicker.Date + ExpiresTimePicker.Time;
                }

                cookie.Secure = SecureToggle.IsOn;
                cookie.HttpOnly = HttpOnlyToggle.IsOn;

                HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();
                bool replaced = filter.CookieManager.SetCookie(cookie, false);

                if (replaced)
                {
                    rootPage.NotifyUser("Cookie replaced.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Cookie set.", NotifyType.StatusMessage);
                }
            }
            catch (ArgumentException ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario10_SetCookie.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario10_SetCookie.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10_UnviewableContent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario10_UnviewableContent
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario10_UnviewableContent Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario10_UnviewableContent ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | WebViewControl_UnviewableContentIdentified (WebView sender, WebViewUnviewableContentIdentifiedEventArgs args)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario10_UnviewableContent.xaml.cs.

Constructor & Destructor Documentation

Scenario10_UnviewableContent ( ) [inline]

Definition at line 28 of file Scenario10_UnviewableContent.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario10_UnviewableContent.xaml.cs.

        {
            WebViewControl.Navigate(new Uri("https://www.bing.com/search?q=site%3Amicrosoft.com+filetype%3Apdf"));
        }

async void WebViewControl_UnviewableContentIdentified | ( | WebView | sender,
 |  | WebViewUnviewableContentIdentifiedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario10_UnviewableContent.xaml.cs.

        {
            if (args.Uri.AbsolutePath.EndsWith(".pdf"))
            {
                if (await Windows.System.Launcher.LaunchUriAsync(args.Uri))
                {
                    rootPage.NotifyUser($"Launched {args.Uri} with system launcher", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser($"Failed to launch {args.Uri}", NotifyType.ErrorMessage);
                }
            } else
            {
                rootPage.NotifyUser($"Blocked unknown file type of {args.Uri}", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario10_UnviewableContent.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario10_UnviewableContent.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario11
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario11 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario11 ()
Scenario11 ()
Scenario11 ()
Scenario11 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Types

enum | MapIconState { None = 0, Disabled = 1, Hover = 2, Selected = 4 }

Private Member Functions

void | Accessibility_HighContrastChanged (AccessibilitySettings sender, object args)
void | AddLayer1 ()
void | AddLayer2 ()
void | ContrastingColorButtonCheckedChanged (object sender, RoutedEventArgs e)
async void | GetFileButton_Click (object sender, RoutedEventArgs e)
delegate string | MapIconStateToStyleEntryState (MapIconState state)
async void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | Scenario11Button_Show_Click (object sender, RoutedEventArgs e)
void | SetStyleSheetStateCombobox_SelectionChanged (object sender, SelectionChangedEventArgs e)

Static Private Member Functions

static string | ToCustomStyleEntryState (MapIconState state)
static string | ToDefaultStyleEntryState (MapIconState state)
static void | UpdateMapElementOnClick (MapElement mapElement, MapIconStateToStyleEntryState toStyleEntryState)
static void | UpdateMapElementOnPointerEntered (MapElement mapElement, MapIconStateToStyleEntryState toStyleEntryState)
static void | UpdateMapElementOnPointerExited (MapElement mapElement, MapIconStateToStyleEntryState toStyleEntryState)

Private Attributes

AccessibilitySettings | accessibility = new AccessibilitySettings()
MapElementsLayer | myLayer1
MapElementsLayer | myLayer2
IList< MapLayer > | myLayers = new ObservableCollection<MapLayer>()
MainPage rootPage = MainPage.Current

Detailed Description

Attempting to get a file with no error on failure.

Definition at line 23 of file scenario11.xaml.cs.

Member Enumeration Documentation

enum MapIconState [private]
Enumerator:
None
Disabled
Hover
Selected

Definition at line 28 of file Scenario11.xaml.cs.

        {
            None = 0,
            Disabled = 1,
            Hover = 2,
            Selected = 4,
        }

Constructor & Destructor Documentation

Scenario11 ( ) [inline]

Definition at line 29 of file scenario11.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario11 ( ) [inline]

Definition at line 27 of file Scenario11_TryGet.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario11 ( ) [inline]

Definition at line 79 of file Scenario11.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario11 ( ) [inline]

Definition at line 26 of file Scenario11.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes =
                Windows.UI.Core.CoreInputDeviceTypes.Mouse |
                Windows.UI.Core.CoreInputDeviceTypes.Pen;

            ContrastingColorButton.IsChecked = true;
            ContrastingColorButton.Visibility = accessibility.HighContrast ? Visibility.Visible : Visibility.Collapsed;
        }

Member Function Documentation

void Accessibility_HighContrastChanged | ( | AccessibilitySettings | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario11.xaml.cs.

        {
            ContrastingColorButton.Visibility = accessibility.HighContrast ? Visibility.Visible : Visibility.Collapsed;
        }

void AddLayer1 ( ) [inline, private]

Definition at line 108 of file Scenario11.xaml.cs.

        {
            this.myLayer1 = new MapElementsLayer();
            this.myLayer1.MapElements = MainPage.CreateCityBuildingsCollection();
            this.myLayer1.MapElementPointerEntered += (sender, args) => UpdateMapElementOnPointerEntered(args.MapElement, ToDefaultStyleEntryState);
            this.myLayer1.MapElementPointerExited += (sender, args) => UpdateMapElementOnPointerExited(args.MapElement, ToDefaultStyleEntryState);
            this.myLayer1.MapElementClick += (sender, args) => UpdateMapElementOnClick(args.MapElements[0], ToDefaultStyleEntryState);

            this.myLayers.Add(this.myLayer1);
        }

void AddLayer2 ( ) [inline, private]

Definition at line 120 of file Scenario11.xaml.cs.

        {
            this.myLayer2 = new MapElementsLayer();
            this.myLayer2.MapElements = MainPage.CreateCityParksCollection();

            foreach (MapElement element in myLayer2.MapElements)
            {
                element.MapStyleSheetEntry = "myNamespace.myPoi";
            }

            this.myLayer2.MapElementPointerEntered += (sender, args) => UpdateMapElementOnPointerEntered(args.MapElement, ToCustomStyleEntryState);
            this.myLayer2.MapElementPointerExited += (sender, args) => UpdateMapElementOnPointerExited(args.MapElement, ToCustomStyleEntryState);
            this.myLayer2.MapElementClick += (sender, args) => UpdateMapElementOnClick(args.MapElements[0], ToCustomStyleEntryState);

            this.myLayers.Add(this.myLayer2);
        }

void ContrastingColorButtonCheckedChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario11.xaml.cs.

        {
            if (ContrastingColorButton.IsChecked.Value)
            {
                inkCanvas.InkPresenter.HighContrastAdjustment = InkHighContrastAdjustment.UseSystemColorsWhenNecessary;
            }
            else
            {
                inkCanvas.InkPresenter.HighContrastAdjustment = InkHighContrastAdjustment.UseOriginalColors;
            }
        }

async void GetFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario11_TryGet.xaml.cs.

        {
            StorageFolder storageFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            StorageFile file = await storageFolder.TryGetItemAsync("sample.dat") as StorageFile;
            if (file != null)
            {
                rootPage.NotifyUser($"Operation result: {file.Name}", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Operation result: null", NotifyType.StatusMessage);
            }
        }

delegate string MapIconStateToStyleEntryState ( MapIconState state ) [private]
async void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario11.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 16;

            // Specify a style sheet.  It is not strictly necessary to Combine since RoadLight is the default.
            var myStyleSheetFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///StyleSheets/MyCustomStates.json"));
            string myStyleSheetJson = await FileIO.ReadTextAsync(myStyleSheetFile);

            myMap.StyleSheet = MapStyleSheet.Combine(new MapStyleSheet[]
            {
                MapStyleSheet.RoadLight(),
                MapStyleSheet.ParseFromJson(myStyleSheetJson)
            });

            // Populate various layers containing points and connect up states to events.
            AddLayer1();
            AddLayer2();

            // Connect the layers to the map.
            myMap.Layers = this.myLayers;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario11.xaml.cs.

        {
            accessibility.HighContrastChanged += Accessibility_HighContrastChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file scenario11.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario11.xaml.cs.

        {
            accessibility.HighContrastChanged -= Accessibility_HighContrastChanged;
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario11.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void Scenario11Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario11Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 49 of file scenario11.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                var resourceLoader = ResourceLoader.GetForCurrentView();
                this.Scenario11TextBlock.Text = "http://api.contoso.com/Feed?lang=" + resourceLoader.GetString("webservicelang");
            }
        }

void SetStyleSheetStateCombobox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario11.xaml.cs.

        {
            // Protect against events that are raised before we are fully initialized.
            if (this.myLayer1 == null) return;

            string selectedState = string.Empty;
            switch (setStyleSheetStateCombobox.SelectedIndex)
            {
                case 1:
                    selectedState = MapStyleSheetEntryStates.Disabled;
                    break;
                case 2:
                    selectedState = MapStyleSheetEntryStates.Hover;
                    break;
                case 3:
                    selectedState = MapStyleSheetEntryStates.Selected;
                    break;
                case 4:
                    selectedState = "myNamespace.focused";
                    break;
                case 0:
                default:
                    selectedState = "";
                    break;
            }

            foreach (MapElement element in this.myLayer1.MapElements)
            {
                element.MapStyleSheetEntry = selectedState;
            }
        }

Platform::String ToCustomStyleEntryState ( MapIconState state ) [inline, static, private]

Definition at line 59 of file Scenario11.xaml.cs.

        {
            if (state.HasFlag(MapIconState.Disabled))
            {
                return "disabled";
            }
            else if (state.HasFlag(MapIconState.Selected))
            {
                return "myNamespace.selected";
            }
            else if (state.HasFlag(MapIconState.Hover))
            {
                return "myNamespace.hover";
            }
            else
            {
                return string.Empty;
            }
        }

Platform::String ToDefaultStyleEntryState ( MapIconState state ) [inline, static, private]

Definition at line 39 of file Scenario11.xaml.cs.

        {
            if (state.HasFlag(MapIconState.Disabled))
            {
                return MapStyleSheetEntryStates.Disabled;
            }
            else if (state.HasFlag(MapIconState.Selected))
            {
                return MapStyleSheetEntryStates.Selected;
            }
            else if (state.HasFlag(MapIconState.Hover))
            {
                return MapStyleSheetEntryStates.Hover;
            }
            else
            {
                return string.Empty;
            }
        }

static void UpdateMapElementOnClick | ( | MapElement | mapElement,
 |  | MapIconStateToStyleEntryState | toStyleEntryState |
 | ) |  |  | [inline, static, private]

Definition at line 159 of file Scenario11.xaml.cs.

        {
            var state = (MapIconState)(mapElement.Tag ?? MapIconState.None);
            if (!state.HasFlag(MapIconState.Disabled))
            {
                // Toggle Selected flag (clear bit then OR-in toggled value)
                state = (state & ~MapIconState.Selected) | (state ^ MapIconState.Selected);
                mapElement.Tag = state;
                mapElement.MapStyleSheetEntryState = toStyleEntryState(state);
            }
        }

static void UpdateMapElementOnPointerEntered | ( | MapElement | mapElement,
 |  | MapIconStateToStyleEntryState | toStyleEntryState |
 | ) |  |  | [inline, static, private]

Definition at line 137 of file Scenario11.xaml.cs.

        {
            var state = (MapIconState)(mapElement.Tag ?? MapIconState.None);
            if (!state.HasFlag(MapIconState.Hover) && !state.HasFlag(MapIconState.Disabled))
            {
                state |= MapIconState.Hover;
                mapElement.Tag = state;
                mapElement.MapStyleSheetEntryState = toStyleEntryState(state);
            }
        }

static void UpdateMapElementOnPointerExited | ( | MapElement | mapElement,
 |  | MapIconStateToStyleEntryState | toStyleEntryState |
 | ) |  |  | [inline, static, private]

Definition at line 148 of file Scenario11.xaml.cs.

        {
            var state = (MapIconState)(mapElement.Tag ?? MapIconState.None);
            if (state.HasFlag(MapIconState.Hover) && !state.HasFlag(MapIconState.Disabled))
            {
                state &= ~MapIconState.Hover;
                mapElement.Tag = state;
                mapElement.MapStyleSheetEntryState = toStyleEntryState(state);
            }
        }

Member Data Documentation

AccessibilitySettings accessibility = new AccessibilitySettings() [private]

Definition at line 24 of file Scenario11.xaml.cs.

MapElementsLayer myLayer1 [private]

Definition at line 24 of file Scenario11.xaml.cs.

MapElementsLayer myLayer2 [private]

Definition at line 25 of file Scenario11.xaml.cs.

IList<MapLayer> myLayers = new ObservableCollection<MapLayer>() [private]

Definition at line 26 of file Scenario11.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file scenario11.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario11.xaml.cs
  • MapControl/cs/Scenario11.xaml.cs
  • FileAccess/cs/Scenario11_TryGet.xaml.cs
  • SimpleInk/cs/Scenario11.xaml.cs
  • ApplicationResources/cpp/scenario11.xaml.cpp
  • FileAccess/cpp/Scenario11_TryGet.xaml.cpp
  • MapControl/cpp/Scenario11.xaml.cpp
  • SimpleInk/cpp/Scenario11.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11_DeleteCookie Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario11_DeleteCookie
Public Member Functions | Private Member Functions | Private Attributes

Scenario11_DeleteCookie Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario11_DeleteCookie ()

Private Member Functions

void DeleteCookie_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario11_DeleteCookie.xaml.cs.

Constructor & Destructor Documentation

Scenario11_DeleteCookie ( ) [inline]

Definition at line 30 of file Scenario11_DeleteCookie.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DeleteCookie_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario11_DeleteCookie.xaml.cs.

        {
            if (String.IsNullOrEmpty(NameField.Text) || String.IsNullOrEmpty(DomainField.Text) || String.IsNullOrEmpty(PathField.Text))
            {
                rootPage.NotifyUser("Invalid name, domain, or path value.", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                HttpCookie cookie = new HttpCookie(NameField.Text, DomainField.Text, PathField.Text);

                HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();
                filter.CookieManager.DeleteCookie(cookie);

                rootPage.NotifyUser("Cookie deleted.", NotifyType.StatusMessage);
            }
            catch (ArgumentException ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario11_DeleteCookie.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario11_DeleteCookie.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario12 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario12
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario12 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario12 ()
Scenario12 ()
Scenario12 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddAnimatedTilesClick (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | ClearMapClick (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | HttpMapTileDataSourceUriRequested (HttpMapTileDataSource sender, MapTileUriRequestedEventArgs args)
void | MyMapLoaded (object sender, RoutedEventArgs e)
void | OnDrawingAttributesChanged (InkToolbar sender, object args)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | PauseAnimationTapped (object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
void | PlayAnimationTapped (object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
async void | Scenario12Button_Show_Click (object sender, RoutedEventArgs e)
void | StopAnimationTapped (object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)

Private Attributes

MapTileSource | httpTileSource = null
MainPage rootPage = MainPage.Current
string[] | timestamps = { "900913-m50m", "900913-m45m", "900913-m40m", "900913-m35m", "900913-m30m", "900913-m25m", "900913-m20m", "900913-m15m", "900913-m10m", "900913-m05m", "900913" }
string | urlTemplate = "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-{timestamp}/{zoomlevel}/{x}/{y}.png"

Detailed Description

Definition at line 24 of file scenario12.xaml.cs.

Constructor & Destructor Documentation

Scenario12 ( ) [inline]

Definition at line 30 of file scenario12.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario12 ( ) [inline]

Definition at line 31 of file Scenario12.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario12 ( ) [inline]

Definition at line 23 of file Scenario12.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes =
                Windows.UI.Core.CoreInputDeviceTypes.Mouse |
                Windows.UI.Core.CoreInputDeviceTypes.Pen;
        }

Member Function Documentation

void AddAnimatedTilesClick | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario12.xaml.cs.

        {
            if (httpTileSource == null)
            {
                var httpMapTileDataSource = new HttpMapTileDataSource();
                httpMapTileDataSource.UriRequested += HttpMapTileDataSourceUriRequested;
                httpTileSource = new MapTileSource()
                {
                    DataSource = httpMapTileDataSource,
                    FrameCount = timestamps.Length,
                    FrameDuration = TimeSpan.FromMilliseconds(500),
                };

                myMap.TileSources.Add(httpTileSource);
            }
        }

void ClearMapClick | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario12.xaml.cs.

        {
            myMap.TileSources.Clear();
            httpTileSource = null;
        }

void HttpMapTileDataSourceUriRequested | ( | HttpMapTileDataSource | sender,
 |  | MapTileUriRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario12.xaml.cs.

        {
            args.Request.Uri = new Uri(urlTemplate.Replace("{timestamp}", timestamps[args.FrameIndex]));
        }

void MyMapLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario12.xaml.cs.

        {
            myMap.Center = new Geopoint(new BasicGeoposition() { Latitude = 39.1887643719098, Longitude = -92.8261546188403 });
            myMap.ZoomLevel = 5;
        }

void OnDrawingAttributesChanged | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 33 of file Scenario12.xaml.cs.

        {
            // Enable tilt support.
            sender.InkDrawingAttributes.IgnoreTilt = false;
            inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(sender.InkDrawingAttributes);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file scenario12.xaml.cs.

        {
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario12.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void PauseAnimationTapped | ( | object | sender,
 |  | Windows.UI.Xaml.Input.TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file Scenario12.xaml.cs.

        {
            if (httpTileSource != null)
            {
                httpTileSource.Pause();
            }
        }

void PlayAnimationTapped | ( | object | sender,
 |  | Windows.UI.Xaml.Input.TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 70 of file Scenario12.xaml.cs.

        {
            if (httpTileSource != null)
            {
                httpTileSource.Play();
            }
        }

async void Scenario12Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file scenario12.xaml.cs.

        {
            // Two coding patterns will be used:
            //   1. Get a ResourceContext on the UI thread using GetForCurrentView and pass
            //      to the non-UI thread
            //   2. Get a ResourceContext on the non-UI thread using GetForViewIndependentUse
            //
            // Two analogous patterns could be used for ResourceLoader instead of ResourceContext.

            // pattern 1: get a ResourceContext for the UI thread
            ResourceContext defaultContextForUiThread = ResourceContext.GetForCurrentView();

            // pattern 2: we'll create a view-independent context in the non-UI worker thread

            // We need some things in order to display results in the UI (doing that
            // for purposes of this sample, to show that work was actually done in the
            // worker thread):
            List<string> uiDependentResourceList = new List<string>();
            List<string> uiIndependentResourceList = new List<string>();

            // use a worker thread for the heavy lifting so the UI isn't blocked
            await Windows.System.Threading.ThreadPool.RunAsync(
                (source) =>
                {
                    ResourceMap stringResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");

                    // pattern 1: the defaultContextForUiThread variable was created above and is visible here

                    // pattern 2: get a view-independent ResourceContext
                    ResourceContext defaultViewIndependentResourceContext = ResourceContext.GetForViewIndependentUse();

                    // NOTE: The ResourceContext obtained using GetForViewIndependentUse() has no scale qualifier
                    // value set. If this ResourceContext is used in its default state to retrieve a resource, that
                    // will work provided that the resource does not have any scale-qualified variants. But if the
                    // resource has any scale-qualified variants, then that will fail at runtime.
                    //
                    // A scale qualifier value on this ResourceContext can be set programmatically. If that is done,
                    // then the ResourceContext can be used to retrieve a resource that has scale-qualified variants.
                    // But if the scale qualifier is reset (e.g., using the ResourceContext.Reset() method), then
                    // it will return to the default state with no scale qualifier value set, and cannot be used
                    // to retrieve any resource that has scale-qualified variants.

                    // simulate processing a number of items
                    // just using a single string resource: that's sufficient to demonstrate
                    for (var i = 0; i < 4; i++)
                    {
                        // pattern 1: use the ResourceContext from the UI thread
                        string listItem1 = stringResourceMap.GetValue("string1", defaultContextForUiThread).ValueAsString;
                        uiDependentResourceList.Add(listItem1);

                        // pattern 2: use the view-independent ResourceContext
                        string listItem2 = stringResourceMap.GetValue("string1", defaultViewIndependentResourceContext).ValueAsString;
                        uiIndependentResourceList.Add(listItem2);
                    }

                });

            // Display the results in one go. (A more finessed design might add results
            // in the UI asynchronously, but that goes beyond what this sample is
            // demonstrating.)
            ViewDependentResourcesList.ItemsSource = uiDependentResourceList;
            ViewIndependentResourcesList.ItemsSource = uiIndependentResourceList;
        }

void StopAnimationTapped | ( | object | sender,
 |  | Windows.UI.Xaml.Input.TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario12.xaml.cs.

        {
            if (httpTileSource != null)
            {
                httpTileSource.Stop();
            }
        }

Member Data Documentation

MapTileSource httpTileSource = null [private]

Definition at line 29 of file Scenario12.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file scenario12.xaml.cs.

string [] timestamps = { "900913-m50m", "900913-m45m", "900913-m40m", "900913-m35m", "900913-m30m", "900913-m25m", "900913-m20m", "900913-m15m", "900913-m10m", "900913-m05m", "900913" } [private]

Definition at line 28 of file Scenario12.xaml.cs.

string urlTemplate = "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-{timestamp}/{zoomlevel}/{x}/{y}.png" [private]

Definition at line 26 of file Scenario12.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario12.xaml.cs
  • MapControl/cs/Scenario12.xaml.cs
  • SimpleInk/cs/Scenario12.xaml.cs
  • ApplicationResources/cpp/scenario12.xaml.cpp
  • MapControl/cpp/Scenario12.xaml.cpp
  • SimpleInk/cpp/Scenario12.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario12_DisableCookies Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario12_DisableCookies
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario12_DisableCookies Class Reference

List of all members.

Public Member Functions

Scenario12_DisableCookies ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
async void | SendInitialGetButton_Click (object sender, RoutedEventArgs e)
async void | SendNextRequestButton_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpBaseProtocolFilter | filter
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario12_DisableCookies.xaml.cs.

Constructor & Destructor Documentation

Scenario12_DisableCookies ( ) [inline]

Definition at line 31 of file Scenario12_DisableCookies.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 151 of file Scenario12_DisableCookies.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

void Dispose ( ) [inline]

Definition at line 160 of file Scenario12_DisableCookies.xaml.cs.

        {
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario12_DisableCookies.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
            filter.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario12_DisableCookies.xaml.cs.

        {
            filter = new HttpBaseProtocolFilter();
            httpClient = new HttpClient(filter);
            cts = new CancellationTokenSource();
        }

async void SendInitialGetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario12_DisableCookies.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(SendInitialGetButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            try
            {
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    HttpCookieCollection cookieCollection = filter.CookieManager.GetCookies(resourceUri);
                    OutputField.Text = cookieCollection.Count + " cookies found.\r\n";
                    foreach (HttpCookie cookie in cookieCollection)
                    {
                        OutputField.Text += "--------------------\r\n";
                        OutputField.Text += "Name: " + cookie.Name + "\r\n";
                        OutputField.Text += "Domain: " + cookie.Domain + "\r\n";
                        OutputField.Text += "Path: " + cookie.Path + "\r\n";
                        OutputField.Text += "Value: " + cookie.Value + "\r\n";
                        OutputField.Text += "Expires: " + cookie.Expires + "\r\n";
                        OutputField.Text += "Secure: " + cookie.Secure + "\r\n";
                        OutputField.Text += "HttpOnly: " + cookie.HttpOnly + "\r\n";
                    }

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                    SendNextRequestButton.IsEnabled = true;
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(SendInitialGetButton, CancelButton);
        }

async void SendNextRequestButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario12_DisableCookies.xaml.cs.

        {
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);

            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(SendNextRequestButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
            if (CookieUsageBehaviorToggle.IsOn)
            {
                filter.CookieUsageBehavior = HttpCookieUsageBehavior.Default;
            }
            else
            {
                // Disable cookie handling - this will do two things: no cookies are attached to outgoing request, and
                // cookies contained in incoming server responses are not added to the CookieManager of the HttpBaseProtocolFilter.
                filter.CookieUsageBehavior = HttpCookieUsageBehavior.NoCookies;
            }

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed. Response came from " + result.ResponseMessage.Source.ToString() + ".", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(SendNextRequestButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 29 of file Scenario12_DisableCookies.xaml.cs.

HttpBaseProtocolFilter filter [private]

Definition at line 27 of file Scenario12_DisableCookies.xaml.cs.

HttpClient httpClient [private]

Definition at line 28 of file Scenario12_DisableCookies.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario12_DisableCookies.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario12_DisableCookies.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario13 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario13
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario13 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario13 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DXFLOptionCombo_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file scenario13.xaml.cs.

Constructor & Destructor Documentation

Scenario13 ( ) [inline]

Definition at line 32 of file scenario13.xaml.cs.

        {
            this.InitializeComponent();
            DXFLOptionCombo.SelectedIndex = 0;
        }

Member Function Documentation

async void DXFLOptionCombo_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file scenario13.xaml.cs.

        {
            ComboBox combo = sender as ComboBox;

            // Setting the DXFeatureLevel qualifier value on all default contexts. This is needed
            // since the async operation to retrive appdata.dat as a StorageFile object will happen
            // on a background thread. This is the only way to set the qualifier on a default context
            // used in a background  thread.

            // In a different scenario, rather than obtaining a StorageFile object, another approach
            // that could be used would be to use the ResourceMap.GetValue method to get the resolved
            // resource candidate, and from that get the absolute file path. In that approach, the
            // GetValue method takes a ResourceContext parameter, and so it would be possible to set
            // the DXFeatureLevel qualifier value on a specific context rather than setting it in all
            // contexts within the app.

            ResourceContext.SetGlobalQualifierValue("dxfeaturelevel", combo.SelectedValue.ToString());

            // setting up the resource URI -- an ms-appx URI will be used to access the resource using
            // a StorageFile method

            // In a different scenario, rather than obtaining a StorageFile object, the
            // ResourceMap.GetValue method could be used to get the resolved candidate, from which an
            // absolute file path could be obtained. However, resource references used by the APIs in
            // Windows.ApplicationModel.Resources and Windows.ApplicationModel.Resources.Core use
            // ms-resource URIs, not ms-appx URIs. Within a resource map, files are always organized
            // under a "Files" top-level subtree. The ms-resource URI string for the file being accessed
            // here would be "ms-resource:///Files/appdata/appdata.dat".

            // The URI string "ms-appx:///..." is rooted at the app package root.
            Uri uri = new Uri("ms-appx:///appdata/appdata.dat");

            // The resource candidate will be resolved during the call to GetFileFromApplicationUriAsync
            // using the default context from a background thread.

            // File IO uses asynchronous techniques. For more info, see
            // http://msdn.microsoft.com/en-us/library/windows/apps/hh464924.aspx

            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
            string content = await FileIO.ReadTextAsync(file);
            ResultText.Text = content;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 43 of file scenario13.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file scenario13.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario13.xaml.cs
  • ApplicationResources/cpp/scenario13.xaml.cpp
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario13_RetryFilter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario13_RetryFilter
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario13_RetryFilter Class Reference

List of all members.

Public Member Functions

Scenario13_RetryFilter ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | RetryAfterSwitch_Toggled (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)
void | UpdateAddressField ()

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario13_RetryFilter.xaml.cs.

Constructor & Destructor Documentation

Scenario13_RetryFilter ( ) [inline]

Definition at line 31 of file Scenario13_RetryFilter.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 113 of file Scenario13_RetryFilter.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario13_RetryFilter.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario13_RetryFilter.xaml.cs.

        {
            HttpBaseProtocolFilter baseProtocolFilter = new HttpBaseProtocolFilter();
            HttpRetryFilter retryFilter = new HttpRetryFilter(baseProtocolFilter);
            httpClient = new HttpClient(retryFilter);
            cts = new CancellationTokenSource();
            UpdateAddressField();
        }

void RetryAfterSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario13_RetryFilter.xaml.cs.

        {
            UpdateAddressField();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario13_RetryFilter.xaml.cs.

        {
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);

            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

void UpdateAddressField ( ) [inline, private]

Definition at line 52 of file Scenario13_RetryFilter.xaml.cs.

        {
            // Tell the server which type of Retry-After header we would like to receive.
            string queryString = "";
            if (RetryAfterSwitch.IsOn)
            {
                queryString += "?retryAfter=deltaSeconds";
            }
            else
            {
                queryString += "?retryAfter=httpDate";
            }

            Helpers.ReplaceQueryString(AddressField, queryString);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 29 of file Scenario13_RetryFilter.xaml.cs.

HttpClient httpClient [private]

Definition at line 28 of file Scenario13_RetryFilter.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario13_RetryFilter.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario13_RetryFilter.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario14_MeteredConnectionFilter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario14_MeteredConnectionFilter
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario14_MeteredConnectionFilter Class Reference

List of all members.

Public Member Functions

Scenario14_MeteredConnectionFilter ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | OptInSwitch_Toggled (object sender, RoutedEventArgs e)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpClient | httpClient
HttpMeteredConnectionFilter | meteredConnectionFilter
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario14_MeteredConnectionFilter.xaml.cs.

Constructor & Destructor Documentation

Scenario14_MeteredConnectionFilter ( ) [inline]

Definition at line 32 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();
            httpClient.Dispose();
            meteredConnectionFilter.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            HttpBaseProtocolFilter baseProtocolFilter = new HttpBaseProtocolFilter();
            meteredConnectionFilter = new HttpMeteredConnectionFilter(baseProtocolFilter);
            httpClient = new HttpClient(meteredConnectionFilter);
            cts = new CancellationTokenSource();
        }

void OptInSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            meteredConnectionFilter.OptIn = OptInSwitch.IsOn;
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario14_MeteredConnectionFilter.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, resourceUri);

            MeteredConnectionPriority priority = MeteredConnectionPriority.Low;
            if (MediumRadio.IsChecked.Value)
            {
                priority = MeteredConnectionPriority.Medium;
            }
            else if (HighRadio.IsChecked.Value)
            {
                priority = MeteredConnectionPriority.High;
            }
            request.Properties[HttpMeteredConnectionFilter.MeteredConnectionPriorityPropertyName] = priority;

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {
                HttpRequestResult result = await httpClient.TrySendRequestAsync(request).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);

                    rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 30 of file Scenario14_MeteredConnectionFilter.xaml.cs.

HttpClient httpClient [private]

Definition at line 29 of file Scenario14_MeteredConnectionFilter.xaml.cs.

HttpMeteredConnectionFilter meteredConnectionFilter [private]

Definition at line 28 of file Scenario14_MeteredConnectionFilter.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario14_MeteredConnectionFilter.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario14_MeteredConnectionFilter.xaml.cs
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario15_ServerCertificateValidation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario15_ServerCertificateValidation
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario15_ServerCertificateValidation Class Reference

List of all members.

Public Member Functions

Scenario15_ServerCertificateValidation ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Cancel_Click (object sender, RoutedEventArgs e)
void | DefaultAndCustomValidation_Checked (object sender, RoutedEventArgs e)
void | DefaultOSValidation_Checked (object sender, RoutedEventArgs e)
void | IgnoreErrorsAndCustomValidation_Checked (object sender, RoutedEventArgs e)
async Task< bool > | IsCertificateValidAsync (Certificate serverCert)
async void | MyCustomServerCertificateValidator (HttpBaseProtocolFilter sender, HttpServerCustomValidationRequestedEventArgs args)
async void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

CancellationTokenSource | cts
HttpBaseProtocolFilter | filter
HttpClient | httpClient
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario15_ServerCertificateValidation.xaml.cs.

Constructor & Destructor Documentation

Scenario15_ServerCertificateValidation ( ) [inline]

Definition at line 36 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Cancel_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 139 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource.
            cts = new CancellationTokenSource();
        }

void DefaultAndCustomValidation_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 208 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            AddressField.Text = "https://www.microsoft.com";
        }

void DefaultOSValidation_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 203 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            AddressField.Text = "https://www.microsoft.com";
        }

void IgnoreErrorsAndCustomValidation_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 213 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            AddressField.Text = "https://localhost/HttpClientSample/default.aspx";
        }

async Task<bool> IsCertificateValidAsync ( Certificate serverCert ) [inline, private]

Definition at line 179 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            // This is a placeholder call to simulate long-running async calls. Note that this code runs synchronously as part of the SSL/TLS handshake.
            // Avoid performing lengthy operations here - else, the remote server may terminate the connection abruptly.
            await Task.Delay(100);

            // In this sample, we compare the hash code of the certificate to a specific hash - this is purely
            // for illustration purposes and should not be considered as a recommendation for certificate validation.
            var trustedHash = new byte[] {
                0x28, 0xb8, 0x85, 0x04, 0xf6, 0x09, 0xf6, 0x85, 0xf1, 0x68,
                0xb9, 0xa4, 0x9c, 0x8f, 0x0e, 0xc4, 0x9e, 0xad, 0x8b, 0xc2
            };
            if (serverCert.GetHashValue().SequenceEqual(trustedHash))
            {
                // If certificate satisfies the criteria, return true.
                return true;
            }
            else
            {
                // If certificate does not meet the required criteria,return false.
                return false;
            }
        }

async void MyCustomServerCertificateValidator | ( | HttpBaseProtocolFilter | sender,
 |  | HttpServerCustomValidationRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 150 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            // Get the server certificate and certificate chain from the args parameter.
            Certificate serverCert = args.ServerCertificate;
            IReadOnlyList<Certificate> serverCertChain = args.ServerIntermediateCertificates;

            // To illustrate the use of async APIs, we use the IsCertificateValidAsync method.
            // In order to call async APIs in this handler, you must first take a deferral and then
            // release it once you are done with the operation. The "using" statement
            // ensures that the deferral completes when control leaves the method.
            using (Deferral deferral = args.GetDeferral())
            {
                try
                {
                    bool isCertificateValid = await IsCertificateValidAsync(serverCert);
                    if (!isCertificateValid)
                    {
                        args.Reject();
                    }
                }
                catch
                {
                    // If we get an exception from IsCertificateValidAsync, we reject the certificate
                    // (secure by default).
                    args.Reject();
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 50 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            cts.Dispose();
            httpClient.Dispose();
            filter.Dispose();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            // In this scenario we just create an HttpClient instance with default settings. I.e. no custom filters.
            // For examples on how to use custom filters see other scenarios.
            filter = new HttpBaseProtocolFilter();
            httpClient = new HttpClient(filter);
            cts = new CancellationTokenSource();
        }

async void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario15_ServerCertificateValidation.xaml.cs.

        {
            // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
            // valid, absolute URI, we'll notify the user about the incorrect input.
            Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
            if (resourceUri == null)
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            Helpers.ScenarioStarted(StartButton, CancelButton, null);
            rootPage.NotifyUser("In progress", NotifyType.StatusMessage);

            bool isUsingCustomValidation = false;
            if (DefaultOSValidation.IsChecked.Value)
            {
                //Do nothing
            }
            else if (DefaultAndCustomValidation.IsChecked.Value)
            {
                // Add event handler to listen to the ServerCustomValidationRequested event. By default, OS validation
                // will be performed before the event is raised.
                filter.ServerCustomValidationRequested += MyCustomServerCertificateValidator;
                isUsingCustomValidation = true;
            }
            else if (IgnoreErrorsAndCustomValidation.IsChecked.Value)
            {
                // ---------------------------------------------------------------------------
                // WARNING: Only test applications should ignore SSL errors.
                // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
                // attacks (while the connection is secure, the server is not authenticated).
                // Note that not all certificate validation errors can be ignored.
                // ---------------------------------------------------------------------------
                filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
                filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);

                // Add event handler to listen to the ServerCustomValidationRequested event.
                // This event handler must implement the desired custom certificate validation logic.
                filter.ServerCustomValidationRequested += MyCustomServerCertificateValidator;
                isUsingCustomValidation = true;
            }

            // Here, we turn off writing to and reading from the cache to ensure that each request actually
            // hits the network and tries to establish an SSL/TLS connection with the server.
            filter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;
            filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.NoCache;

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, resourceUri);

            // This sample uses a "try" in order to support TaskCanceledException.
            // If you don't need to support cancellation, then the "try" is not needed.
            try
            {

                HttpRequestResult result = await httpClient.TrySendRequestAsync(
                    request,
                    HttpCompletionOption.ResponseHeadersRead).AsTask(cts.Token);

                if (result.Succeeded)
                {
                    rootPage.NotifyUser("Success - response received from server. Server certificate was valid.", NotifyType.StatusMessage);
                }
                else
                {
                    Helpers.DisplayWebError(rootPage, result.ExtendedError);
                }
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
            }

            if (isUsingCustomValidation)
            {
                // Unregister the event handler after we are done validating.
                filter.ServerCustomValidationRequested -= MyCustomServerCertificateValidator;
            }

            Helpers.ScenarioCompleted(StartButton, CancelButton);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 34 of file Scenario15_ServerCertificateValidation.xaml.cs.

HttpBaseProtocolFilter filter [private]

Definition at line 32 of file Scenario15_ServerCertificateValidation.xaml.cs.

HttpClient httpClient [private]

Definition at line 33 of file Scenario15_ServerCertificateValidation.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario15_ServerCertificateValidation.xaml.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/Scenario15_ServerCertificateValidation.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_AddAccount Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_AddAccount
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_AddAccount Class Reference

List of all members.

Public Member Functions

Scenario1_AddAccount ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AddAccount_Click (object sender, RoutedEventArgs e)
async Task | DisplayUserInformationAsync (String id)

Private Attributes

bool | isLaunched
MainPage rootPage

Detailed Description

Definition at line 24 of file Scenario1_AddAccount.xaml.cs.

Constructor & Destructor Documentation

Scenario1_AddAccount ( ) [inline]

Definition at line 29 of file Scenario1_AddAccount.xaml.cs.

        {
            this.InitializeComponent();
            isLaunched = false;
        }

Member Function Documentation

async void AddAccount_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario1_AddAccount.xaml.cs.

        {
            // only one instance of the UserDataAccountManager pane can be launched at once per thread
            if (isLaunched == false)
            {
                isLaunched = true;

                // Allow user to add email, contacts and appointment providing accounts.
                String userDataAccountId = await UserDataAccountManager.ShowAddAccountAsync(UserDataAccountContentKinds.Email | UserDataAccountContentKinds.Appointment | UserDataAccountContentKinds.Contact);

                if (String.IsNullOrEmpty(userDataAccountId))
                {
                    rootPage.NotifyUser("User cancelled or add account failed", NotifyType.StatusMessage);
                }
                else
                {
                    await DisplayUserInformationAsync(userDataAccountId);
                }

                isLaunched = false;
            }
        }

async Task DisplayUserInformationAsync ( String id ) [inline, private]

Definition at line 63 of file Scenario1_AddAccount.xaml.cs.

        {

            // Requires the email, contacts, or appointments in the app's manifest
            UserDataAccountStore store = await UserDataAccountManager.RequestStoreAsync(UserDataAccountStoreAccessType.AllAccountsReadOnly);

            // If the store is null, that means all access to Contacts, Calendar and Email data
            // has been revoked.
            if (store == null)
            {
                rootPage.NotifyUser("Access to Contacts, Calendar and Email has been revoked", NotifyType.ErrorMessage);
                return;
            }

            UserDataAccount account = await store.GetAccountAsync(id);
            rootPage.NotifyUser("Added account: " + account.UserDisplayName, NotifyType.StatusMessage);

        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario1_AddAccount.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

bool isLaunched [private]

Definition at line 27 of file Scenario1_AddAccount.xaml.cs.

MainPage rootPage [private]

Definition at line 26 of file Scenario1_AddAccount.xaml.cs.

The documentation for this class was generated from the following files:
  • UserDataAccountManager/cs/Scenario1_AddAccount.xaml.cs
  • UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Advertiser Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Advertiser
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Advertiser Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Advertiser ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | btnAddIe_Click (object sender, RoutedEventArgs e)
void | btnCloseDevice_Click (object sender, RoutedEventArgs e)
async void | btnSendMessage_Click (object sender, RoutedEventArgs e)
void | btnStartAdvertisement_Click (object sender, RoutedEventArgs e)
void | btnStopAdvertisement_Click (object sender, RoutedEventArgs e)
async Task< bool > | HandleConnectionRequestAsync (WiFiDirectConnectionRequest connectionRequest)
async Task< bool > | IsAepPairedAsync (string deviceId)
async void | OnConnectionRequested (WiFiDirectConnectionListener sender, WiFiDirectConnectionRequestedEventArgs connectionEventArgs)
void | OnConnectionStatusChanged (WiFiDirectDevice sender, object arg)
void | OnSocketConnectionReceived (StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
async void | OnStatusChanged (WiFiDirectAdvertisementPublisher sender, WiFiDirectAdvertisementPublisherStatusChangedEventArgs statusEventArgs)
void | StopAdvertisement ()

Private Attributes

List
< WiFiDirectInformationElement > 		_informationElements = new List<WiFiDirectInformationElement>()
WiFiDirectConnectionListener | _listener
ConcurrentDictionary
< StreamSocketListener,
WiFiDirectDevice > 		_pendingConnections = new ConcurrentDictionary<StreamSocketListener, WiFiDirectDevice>()
WiFiDirectAdvertisementPublisher | _publisher
ObservableCollection
< ConnectedDevice > 		ConnectedDevices = new ObservableCollection<ConnectedDevice>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 35 of file Scenario1_Advertiser.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Advertiser ( ) [inline]

Definition at line 44 of file Scenario1_Advertiser.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void btnAddIe_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario1_Advertiser.xaml.cs.

        {
            WiFiDirectInformationElement informationElement = new WiFiDirectInformationElement();

            // Information element blob
            DataWriter dataWriter = new DataWriter();
            dataWriter.UnicodeEncoding = UnicodeEncoding.Utf8;
            dataWriter.ByteOrder = ByteOrder.LittleEndian;
            dataWriter.WriteUInt32(dataWriter.MeasureString(txtInformationElement.Text));
            dataWriter.WriteString(txtInformationElement.Text);
            informationElement.Value = dataWriter.DetachBuffer();

            // Organizational unit identifier (OUI)
            informationElement.Oui = CryptographicBuffer.CreateFromByteArray(Globals.CustomOui);

            // OUI Type
            informationElement.OuiType = Globals.CustomOuiType;

            // Save this information element so we can add it when we advertise.
            _informationElements.Add(informationElement);

            txtInformationElement.Text = "";
            rootPage.NotifyUser("IE added successfully", NotifyType.StatusMessage);
        }

void btnCloseDevice_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 359 of file Scenario1_Advertiser.xaml.cs.

        {
            var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
            ConnectedDevices.Remove(connectedDevice);

            // Close socket and WiFiDirect object
            connectedDevice.Dispose();
        }

async void btnSendMessage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 353 of file Scenario1_Advertiser.xaml.cs.

        {
            var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
            await connectedDevice.SocketRW.WriteMessageAsync(txtSendMessage.Text);
        }

void btnStartAdvertisement_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario1_Advertiser.xaml.cs.

        {
            _publisher = new WiFiDirectAdvertisementPublisher();
            _publisher.StatusChanged += OnStatusChanged;

            _listener = new WiFiDirectConnectionListener();

            if (chkListener.IsChecked.Value)
            {
                try
                {
                    // This can raise an exception if the machine does not support WiFi. Sorry.
                    _listener.ConnectionRequested += OnConnectionRequested;
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser($"Error preparing Advertisement: {ex}", NotifyType.ErrorMessage);
                    return;
                }
            }

            var discoverability = Utils.GetSelectedItemTag<WiFiDirectAdvertisementListenStateDiscoverability>(cmbListenState);
            _publisher.Advertisement.ListenStateDiscoverability = discoverability;

            _publisher.Advertisement.IsAutonomousGroupOwnerEnabled = chkPreferGroupOwnerMode.IsChecked.Value;

            // Legacy settings are meaningful only if IsAutonomousGroupOwnerEnabled is true.
            if (_publisher.Advertisement.IsAutonomousGroupOwnerEnabled && chkLegacySetting.IsChecked.Value)
            {
                _publisher.Advertisement.LegacySettings.IsEnabled = true;
                if (!String.IsNullOrEmpty(txtPassphrase.Text))
                {
                    var creds = new Windows.Security.Credentials.PasswordCredential();
                    creds.Password = txtPassphrase.Text;
                    _publisher.Advertisement.LegacySettings.Passphrase = creds;
                }

                if (!String.IsNullOrEmpty(txtSsid.Text))
                {
                    _publisher.Advertisement.LegacySettings.Ssid = txtSsid.Text;
                }
            }

            // Add the information elements.
            foreach (WiFiDirectInformationElement informationElement in _informationElements)
            {
                _publisher.Advertisement.InformationElements.Add(informationElement);
            }

            _publisher.Start();

            if (_publisher.Status == WiFiDirectAdvertisementPublisherStatus.Started)
            {
                btnStartAdvertisement.IsEnabled = false;
                btnStopAdvertisement.IsEnabled = true;
                rootPage.NotifyUser("Advertisement started.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser($"Advertisement failed to start. Status is {_publisher.Status}", NotifyType.ErrorMessage);
            }
        }

void btnStopAdvertisement_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 145 of file Scenario1_Advertiser.xaml.cs.

        {
            StopAdvertisement();
            rootPage.NotifyUser("Advertisement stopped successfully", NotifyType.StatusMessage);
        }

async Task<bool> HandleConnectionRequestAsync ( WiFiDirectConnectionRequest connectionRequest ) [inline, private]

Definition at line 165 of file Scenario1_Advertiser.xaml.cs.

        {
            string deviceName = connectionRequest.DeviceInformation.Name;

            bool isPaired = (connectionRequest.DeviceInformation.Pairing?.IsPaired == true) ||
                            (await IsAepPairedAsync(connectionRequest.DeviceInformation.Id));

            // Show the prompt only in case of WiFiDirect reconnection or Legacy client connection.
            if (isPaired || _publisher.Advertisement.LegacySettings.IsEnabled)
            {
                var messageDialog = new MessageDialog($"Connection request received from {deviceName}", "Connection Request");

                // Add two commands, distinguished by their tag.
                // The default command is "Decline", and if the user cancels, we treat it as "Decline".
                messageDialog.Commands.Add(new UICommand("Accept", null, true));
                messageDialog.Commands.Add(new UICommand("Decline", null, null));
                messageDialog.DefaultCommandIndex = 1;
                messageDialog.CancelCommandIndex = 1;

                // Show the message dialog
                var commandChosen = await messageDialog.ShowAsync();

                if (commandChosen.Id == null)
                {
                    return false;
                }
            }

            rootPage.NotifyUser($"Connecting to {deviceName}...", NotifyType.StatusMessage);

            // Pair device if not already paired and not using legacy settings
            if (!isPaired && !_publisher.Advertisement.LegacySettings.IsEnabled)
            {
                if (!await connectionSettingsPanel.RequestPairDeviceAsync(connectionRequest.DeviceInformation.Pairing))
                {
                    return false;
                }
            }

            WiFiDirectDevice wfdDevice = null;
            try
            {
                // IMPORTANT: FromIdAsync needs to be called from the UI thread
                wfdDevice = await WiFiDirectDevice.FromIdAsync(connectionRequest.DeviceInformation.Id);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser($"Exception in FromIdAsync: {ex}", NotifyType.ErrorMessage);
                return false;
            }

            // Register for the ConnectionStatusChanged event handler
            wfdDevice.ConnectionStatusChanged += OnConnectionStatusChanged;

            var listenerSocket = new StreamSocketListener();

            // Save this (listenerSocket, wfdDevice) pair so we can hook it up when the socket connection is made.
            _pendingConnections[listenerSocket] = wfdDevice;

            var EndpointPairs = wfdDevice.GetConnectionEndpointPairs();

            listenerSocket.ConnectionReceived += OnSocketConnectionReceived;
            try
            {
                await listenerSocket.BindEndpointAsync(EndpointPairs[0].LocalHostName, Globals.strServerPort);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser($"Connect operation threw an exception: {ex.Message}", NotifyType.ErrorMessage);
                return false;
            }

            rootPage.NotifyUser($"Devices connected on L2, listening on IP Address: {EndpointPairs[0].LocalHostName}" +
                                $" Port: {Globals.strServerPort}", NotifyType.StatusMessage);
            return true;
        }

async Task<bool> IsAepPairedAsync ( string deviceId ) [inline, private]

Definition at line 258 of file Scenario1_Advertiser.xaml.cs.

        {
            List<string> additionalProperties = new List<string>();
            additionalProperties.Add("System.Devices.Aep.DeviceAddress");
            String deviceSelector = $"System.Devices.Aep.AepId:=\"{deviceId}\"";
            DeviceInformation devInfo = null;

            try
            {
                devInfo = await DeviceInformation.CreateFromIdAsync(deviceId, additionalProperties);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("DeviceInformation.CreateFromIdAsync threw an exception: " + ex.Message, NotifyType.ErrorMessage);
            }

            if (devInfo == null)
            {
                rootPage.NotifyUser("Device Information is null", NotifyType.ErrorMessage);
                return false;
            }

            deviceSelector = $"System.Devices.Aep.DeviceAddress:=\"{devInfo.Properties["System.Devices.Aep.DeviceAddress"]}\"";
            DeviceInformationCollection pairedDeviceCollection = await DeviceInformation.FindAllAsync(deviceSelector, null, DeviceInformationKind.Device);
            return pairedDeviceCollection.Count > 0;
        }

async void OnConnectionRequested | ( | WiFiDirectConnectionListener | sender,
 |  | WiFiDirectConnectionRequestedEventArgs | connectionEventArgs |
 | ) |  |  | [inline, private]

Definition at line 242 of file Scenario1_Advertiser.xaml.cs.

        {
            WiFiDirectConnectionRequest connectionRequest = connectionEventArgs.GetConnectionRequest();
            bool success = await Dispatcher.RunTaskAsync(async () =>
            {
                return await HandleConnectionRequestAsync(connectionRequest);
            });

            if (!success)
            {
                // Decline the connection request
                rootPage.NotifyUserFromBackground($"Connection request from {connectionRequest.DeviceInformation.Name} was declined", NotifyType.ErrorMessage);
                connectionRequest.Dispose();
            }
        }

void OnConnectionStatusChanged | ( | WiFiDirectDevice | sender,
 |  | object | arg |
 | ) |  |  | [inline, private]

Definition at line 342 of file Scenario1_Advertiser.xaml.cs.

        {
            rootPage.NotifyUserFromBackground($"Connection status changed: {sender.ConnectionStatus}", NotifyType.StatusMessage);

            if (sender.ConnectionStatus == WiFiDirectConnectionStatus.Disconnected)
            {
                // TODO: Should we remove this connection from the list?
                // (Yes, probably.)
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario1_Advertiser.xaml.cs.

        {
            if (btnStopAdvertisement.IsEnabled)
            {
                StopAdvertisement();
            }
        }

void OnSocketConnectionReceived | ( | StreamSocketListener | sender,
 |  | StreamSocketListenerConnectionReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 311 of file Scenario1_Advertiser.xaml.cs.

        {
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                rootPage.NotifyUser("Connecting to remote side on L4 layer...", NotifyType.StatusMessage);
                StreamSocket serverSocket = args.Socket;

                // Look up the WiFiDirectDevice associated with this StreamSocketListener.
                WiFiDirectDevice wfdDevice;
                if (!_pendingConnections.TryRemove(sender, out wfdDevice))
                {
                    rootPage.NotifyUser("Unexpected connection ignored.", NotifyType.ErrorMessage);
                    serverSocket.Dispose();
                    return;
                }

                SocketReaderWriter socketRW = new SocketReaderWriter(serverSocket, rootPage);

                // The first message sent is the name of the connection.
                string message = await socketRW.ReadMessageAsync();

                // Add this connection to the list of active connections.
                ConnectedDevices.Add(new ConnectedDevice(message ?? "(unnamed)", wfdDevice, socketRW));

                while (message != null)
                {
                    message = await socketRW.ReadMessageAsync();
                }
            });
        }

async void OnStatusChanged | ( | WiFiDirectAdvertisementPublisher | sender,
 |  | WiFiDirectAdvertisementPublisherStatusChangedEventArgs | statusEventArgs |
 | ) |  |  | [inline, private]

Definition at line 285 of file Scenario1_Advertiser.xaml.cs.

        {
            if (statusEventArgs.Status == WiFiDirectAdvertisementPublisherStatus.Started)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    if (sender.Advertisement.LegacySettings.IsEnabled)
                    {
                        // Show the autogenerated passphrase and SSID.
                        if (String.IsNullOrEmpty(txtPassphrase.Text))
                        {
                            txtPassphrase.Text = _publisher.Advertisement.LegacySettings.Passphrase.Password;
                        }

                        if (String.IsNullOrEmpty(txtSsid.Text))
                        {
                            txtSsid.Text = _publisher.Advertisement.LegacySettings.Ssid;
                        }
                    }
                });
            }

            rootPage.NotifyUserFromBackground($"Advertisement: Status: {statusEventArgs.Status}, Error: {statusEventArgs.Error}", NotifyType.StatusMessage);
            return;
        }

void StopAdvertisement ( ) [inline, private]

Definition at line 151 of file Scenario1_Advertiser.xaml.cs.

        {
            _publisher.Stop();
            _publisher.StatusChanged -= OnStatusChanged;

            _listener.ConnectionRequested -= OnConnectionRequested;

            connectionSettingsPanel.Reset();
            _informationElements.Clear();

            btnStartAdvertisement.IsEnabled = true;
            btnStopAdvertisement.IsEnabled = false;
        }

Member Data Documentation

List<WiFiDirectInformationElement> _informationElements = new List<WiFiDirectInformationElement>() [private]

Definition at line 41 of file Scenario1_Advertiser.xaml.cs.

WiFiDirectConnectionListener _listener [private]

Definition at line 40 of file Scenario1_Advertiser.xaml.cs.

ConcurrentDictionary<StreamSocketListener, WiFiDirectDevice> _pendingConnections = new ConcurrentDictionary<StreamSocketListener, WiFiDirectDevice>() [private]

Definition at line 42 of file Scenario1_Advertiser.xaml.cs.

WiFiDirectAdvertisementPublisher _publisher [private]

Definition at line 39 of file Scenario1_Advertiser.xaml.cs.

ObservableCollection<ConnectedDevice> ConnectedDevices = new ObservableCollection<ConnectedDevice>() [private]

Definition at line 38 of file Scenario1_Advertiser.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 37 of file Scenario1_Advertiser.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirect/cs/Scenario1_Advertiser.xaml.cs
  • WiFiDirect/cpp/Scenario1_Advertiser.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Analyze Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Analyze
Public Member Functions | Private Member Functions

Scenario1_Analyze Class Reference

List of all members.

Public Member Functions

Scenario1_Analyze ()

Private Member Functions

void AnalyzeButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 21 of file Scenario1_Analyze.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Analyze ( ) [inline]

Definition at line 23 of file Scenario1_Analyze.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AnalyzeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario1_Analyze.xaml.cs.

        {
            string input = this.InputTextBox.Text;
            StringBuilder output = new StringBuilder();

            // monoRuby = false means that each element in the result corresponds to a single Japanese word.
            // monoRuby = true means that each element in the result corresponds to one or more characters which are pronounced as a single unit.
            bool monoRuby = MonoRubyRadioButton.IsChecked == true;

            // Analyze the Japanese text according to the specified algorithm.
            // The maximum length of the input string is 100 characters.
            IReadOnlyList<JapanesePhoneme> words = JapanesePhoneticAnalyzer.GetWords(input, monoRuby);
            foreach (JapanesePhoneme word in words)
            {
                // Put each phrase on its own line.
                if (output.Length != 0 && word.IsPhraseStart)
                {
                    output.AppendLine();
                }
                // DisplayText is the display text of the word, which has same characters as the input of GetWords().
                // YomiText is the reading text of the word, as known as Yomi, which typically consists of Hiragana characters.
                // However, please note that the reading can contains some non-Hiragana characters for some display texts such as emoticons or symbols.
                output.AppendFormat("{0}({1})", word.DisplayText, word.YomiText);
            }

            // Display the result.
            string outputString = output.ToString();
            this.OutputTextBlock.Text = outputString;
            if (input != "" && words.Count == 0)
            {
                // If the result from GetWords() is empty but the input is not empty,
                // it means the given input is too long to analyze.
                MainPage.Current.NotifyUser("Failed to get words from the input text.  The input text is too long to analyze.", NotifyType.ErrorMessage);
            }
            else
            {
                // Otherwise, the analysis has been done successfully.
                MainPage.Current.NotifyUser("Got words from the input text successfully.", NotifyType.StatusMessage);
            }
        }

The documentation for this class was generated from the following files:
  • JapanesePhoneticAnalysis/cs/Scenario1_Analyze.xaml.cs
  • JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basic Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Basic
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

Scenario1_Basic Class Reference

List of all members.

Public Member Functions

Scenario1_Basic ()
Scenario1_Basic ()
Scenario1_Basic ()
Scenario1_Basic ()
Scenario1_Basic ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

Style | CheckBoxStyle [get, set]
UserInteractionMode | InteractionMode [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | AddItemToEnd ()
void | AttachRef ()
void | ClickToPlaySource_ImageOpened (object sender, RoutedEventArgs e)
void | DeleteSelectedItem ()
void | OnKeyDown (object sender, KeyRoutedEventArgs e)
void | OnWindowResize (object sender, WindowSizeChangedEventArgs e)
void | OnWindowResize (object sender, WindowSizeChangedEventArgs e)
void | OnWindowSizeChanged (object sender, WindowSizeChangedEventArgs e)
void | ResizeView_Click (object sender, RoutedEventArgs e)
async void | RestoreScrollPosition ()
void | SaveScrollPosition ()
void | SetMinimumSize_Click (object sender, RoutedEventArgs e)
void | ShowStandardSystemOverlaysButton_Click (object sender, RoutedEventArgs e)
void | ToggleFullScreenModeButton_Click (object sender, RoutedEventArgs e)
void | UpdateContent ()
void | UpdateContent ()
void | UpdateContent ()
void | UseMinimalOverlaysCheckBox_Click (object sender, RoutedEventArgs e)

Private Attributes

Style | checkBoxStyle
bool | done = false
UserInteractionMode | interactionMode
bool | isLastKnownFullScreen = ApplicationView.GetForCurrentView().IsFullScreenMode
IMemoryBufferReference | mbrr = null
int | messageNumber = 0
MainPage rootPage
string | savedScrollPosition

Detailed Description

Definition at line 21 of file Scenario1_Basic.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Basic ( ) [inline]

Definition at line 29 of file Scenario1_Basic.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_Basic ( ) [inline]

Definition at line 28 of file Scenario1_Basic.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_Basic ( ) [inline]

Definition at line 25 of file Scenario1_Basic.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_Basic ( ) [inline]

Definition at line 36 of file Scenario1_Basic.xaml.cs.

        {
            InitializeComponent();
        }

Scenario1_Basic ( ) [inline]

Definition at line 29 of file Scenario1_Basic.xaml.cs.

        {
            this.InitializeComponent();

            // Start with one message, so the screen doesn't look empty.
            AddItemToEnd();
        }

Member Function Documentation

void AddItemToEnd ( ) [inline, private]

Definition at line 37 of file Scenario1_Basic.xaml.cs.

        {
            BottomUpList.Items.Add($"{DateTime.Now}: Message {++messageNumber}");
        }

void AttachRef ( ) [inline, private]

Definition at line 49 of file Scenario1_Basic.xaml.cs.

        {
            var buffer = new Windows.Storage.Streams.Buffer(10);
            var memorybuffer = Windows.Storage.Streams.Buffer.CreateMemoryBufferOverIBuffer(buffer);
            memorybuffer.CreateReference().Closed += (s, _) => {
                //mbrr = s;
                var x = 42;
                done = true;
            };
        }

void ClickToPlaySource_ImageOpened | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario1_Basic.xaml.cs.

        {
            // Once ImageOpened is raised, we can query whether an image is animated.
            if (ClickToPlaySource.IsAnimatedBitmap)
            {
                PlaybackButtons.Visibility = Visibility.Visible;
            }
        }

void DeleteSelectedItem ( ) [inline, private]

Definition at line 42 of file Scenario1_Basic.xaml.cs.

        {
            int selectedIndex = BottomUpList.SelectedIndex;
            BottomUpList.Items.Remove(BottomUpList.SelectedItem);
            if (selectedIndex < BottomUpList.Items.Count)
            {
                BottomUpList.SelectedIndex = selectedIndex;
            }
        }

void OnKeyDown | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file Scenario1_Basic.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Escape)
            {
                var view = ApplicationView.GetForCurrentView();
                if (view.IsFullScreenMode)
                {
                    view.ExitFullScreenMode();
                    rootPage.NotifyUser("Exited full screen mode due to keypress", NotifyType.StatusMessage);
                    isLastKnownFullScreen = false;
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario1_Basic.xaml.cs.

        {
            Window.Current.SizeChanged -= OnWindowResize;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario1_Basic.xaml.cs.

        {
            Window.Current.SizeChanged -= OnWindowResize;
            rootPage.KeyDown -= OnKeyDown;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario1_Basic.xaml.cs.

        {
            Window.Current.SizeChanged -= OnWindowSizeChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_Basic.xaml.cs.

        {
            rootPage = MainPage.Current;

            Window.Current.SizeChanged += OnWindowResize;
            rootPage.KeyDown += OnKeyDown;
            UpdateContent();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario1_Basic.xaml.cs.

        {
            rootPage = MainPage.Current;

            // The SizeChanged event is raised when the user interaction mode changes.
            Window.Current.SizeChanged += OnWindowResize;
            UpdateContent();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario1_Basic.xaml.cs.

        {
            rootPage = MainPage.Current;

            Window.Current.SizeChanged += OnWindowSizeChanged;
            UpdateContent();
        }

void OnWindowResize | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario1_Basic.xaml.cs.

        {
            UpdateContent();
        }

void OnWindowResize | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario1_Basic.xaml.cs.

        {
            UpdateContent();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario1_Basic.xaml.cs.

        {
            UpdateContent();
        }

void ResizeView_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            _ = Windows.System.Threading.ThreadPool.RunAsync((o) => {
                AttachRef();
                while (!done)
                {
                    GC.Collect();
                }
                mbrr = null;
                GC.Collect();
            });
        }

void RestoreScrollPosition ( ) [inline, private]

Definition at line 59 of file Scenario1_Basic.xaml.cs.

        {
            if (this.savedScrollPosition != null)
            {
                await ListViewPersistenceHelper.SetRelativeScrollPositionAsync(BottomUpList, this.savedScrollPosition, (s) => Task.FromResult((object)s).AsAsyncOperation());
            }
        }

void SaveScrollPosition ( ) [inline, private]

Definition at line 52 of file Scenario1_Basic.xaml.cs.

        {
            // We let the item be its own key. In a more general program, the item would have
            // a unique ID that identifies it in the list.
            this.savedScrollPosition = ListViewPersistenceHelper.GetRelativeScrollPosition(BottomUpList, (o) => o.ToString());
        }

void SetMinimumSize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            if (SetMinimumSize.IsChecked.Value)
            {
                // If this size is not permitted by the system, the nearest permitted value is used.
                view.SetPreferredMinSize(new Size { Width = 300, Height = 200 });
            }
            else
            {
                // Passing width = height = 0 returns to the default system behavior.
                view.SetPreferredMinSize(new Size());
            }
        }

void ShowStandardSystemOverlaysButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            view.ShowStandardSystemOverlays();
        }

void ToggleFullScreenModeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
                rootPage.NotifyUser("Exiting full screen mode", NotifyType.StatusMessage);
                isLastKnownFullScreen = false;
                // The SizeChanged event will be raised when the exit from full screen mode is complete.
            }
            else
            {
                if (view.TryEnterFullScreenMode())
                {
                    rootPage.NotifyUser("Entering full screen mode", NotifyType.StatusMessage);
                    isLastKnownFullScreen = true;
                    // The SizeChanged event will be raised when the entry to full screen mode is complete.
                }
                else
                {
                    rootPage.NotifyUser("Failed to enter full screen mode", NotifyType.ErrorMessage);
                }
            }
        }

void UpdateContent ( ) [inline, private]

Definition at line 91 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            var isFullScreenMode = view.IsFullScreenMode;
            ToggleFullScreenModeSymbol.Symbol = isFullScreenMode ? Symbol.BackToWindow : Symbol.FullScreen;
            ReportFullScreenMode.Text = isFullScreenMode ? "is in" : "is not in";
            FullScreenOptionsPanel.Visibility = isFullScreenMode ? Visibility.Visible : Visibility.Collapsed;

            // Did the system force a change in full screen mode?
            if (isLastKnownFullScreen != isFullScreenMode)
            {
                isLastKnownFullScreen = isFullScreenMode;
                // Clear any stray messages that talked about the mode we are no longer in.
                rootPage.NotifyUser("", NotifyType.StatusMessage);
            }
        }

void UpdateContent ( ) [inline, private]

Definition at line 91 of file Scenario1_Basic.xaml.cs.

        {
            InteractionMode = UIViewSettings.GetForCurrentView().UserInteractionMode;

            // Update styles
            CheckBoxStyle = InteractionMode == UserInteractionMode.Mouse ? MouseCheckBoxStyle : TouchCheckBoxStyle;
        }

void UpdateContent ( ) [inline, private]

Definition at line 93 of file Scenario1_Basic.xaml.cs.

        {
            Rect bounds = Window.Current.Bounds;
            ReportViewWidth.Text = bounds.Width.ToString();
            ReportViewHeight.Text = bounds.Height.ToString();
        }

void UseMinimalOverlaysCheckBox_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file Scenario1_Basic.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            view.FullScreenSystemOverlayMode = UseMinimalOverlaysCheckBox.IsChecked.Value ? FullScreenSystemOverlayMode.Minimal : FullScreenSystemOverlayMode.Standard;
        }

Member Data Documentation

Style checkBoxStyle [private]

Definition at line 72 of file Scenario1_Basic.xaml.cs.

bool done = false [private]

Definition at line 48 of file Scenario1_Basic.xaml.cs.

UserInteractionMode interactionMode [private]

Definition at line 52 of file Scenario1_Basic.xaml.cs.

bool isLastKnownFullScreen = ApplicationView.GetForCurrentView().IsFullScreenMode [private]

Definition at line 27 of file Scenario1_Basic.xaml.cs.

IMemoryBufferReference mbrr = null [private]

Definition at line 47 of file Scenario1_Basic.xaml.cs.

int messageNumber = 0 [private]

Definition at line 26 of file Scenario1_Basic.xaml.cs.

MainPage rootPage [private]

Definition at line 23 of file Scenario1_Basic.xaml.cs.

string savedScrollPosition [private]

Definition at line 27 of file Scenario1_Basic.xaml.cs.

Property Documentation

Style CheckBoxStyle [get, set]

Definition at line 75 of file Scenario1_Basic.xaml.cs.

UserInteractionMode InteractionMode [get, set]

Definition at line 55 of file Scenario1_Basic.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 49 of file Scenario1_Basic.xaml.cs.

The documentation for this class was generated from the following files:
  • FullScreenMode/cs/Scenario1_Basic.xaml.cs
  • ResizeAppView/cs/Scenario1_Basic.xaml.cs
  • UserInteractionMode/cs/Scenario1_Basic.xaml.cs
  • XamlBottomUpList/cs/Scenario1_Basic.xaml.cs
  • XamlAnimatedGif/cs/Scenario1_Basic.xaml.cs
  • FullScreenMode/cpp/Scenario1_Basic.xaml.cpp
  • ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
  • UserInteractionMode/cpp/Scenario1_Basic.xaml.cpp
  • XamlAnimatedGif/cpp/Scenario1_Basic.xaml.cpp
  • XamlBottomUpList/cpp/Scenario1_Basic.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BasicFunctionality Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_BasicFunctionality
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_BasicFunctionality Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_BasicFunctionality ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | claimedScanner_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (object sender, ClaimedBarcodeScanner e)
void | ResetTheScenarioState ()
void | ScenarioEndScanButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartScanButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartTriggerButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStopTriggerButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedBarcodeScanner | claimedScanner = null
MainPage rootPage = MainPage.Current
BarcodeScanner | scanner = null

Detailed Description

Definition at line 26 of file Scenario1_BasicFunctionality.xaml.cs.

Constructor & Destructor Documentation

Scenario1_BasicFunctionality ( ) [inline]

Definition at line 35 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void claimedScanner_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for the DataReceived event fired when a barcode is scanned by the barcode scanner.

Parameters:
sender
args Contains the BarcodeScannerReport which contains the data obtained in the scan

Definition at line 138 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            // need to update the UI data on the dispatcher thread.
            // update the UI with the data received from the scan.
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                // read the data from the buffer and convert to string.
                ScenarioOutputScanDataLabel.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                ScenarioOutputScanData.Text = DataHelpers.GetDataString(args.Report.ScanData);
                ScenarioOutputScanDataType.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
            });
        }

void claimedScanner_ReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedBarcodeScanner | e |
 | ) |  |  | [inline, private]

Event handler for the Release Device Requested event fired when barcode scanner receives Claim request from another application.

Parameters:
sender
args Contains the ClamiedBarcodeScanner that is sending this request

Definition at line 125 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            // always retain the device
            e.RetainDevice();

            rootPage.NotifyUser("Event ReleaseDeviceRequested received. Retaining the barcode scanner.", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is no longer displayed.

Parameters:
e Event data that describes how this page was exited. The Parameter property is typically used to configure the page.

Definition at line 55 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            ResetTheScenarioState();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            ResetTheScenarioState();
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 154 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            if (claimedScanner != null)
            {
                // Detach the event handlers
                claimedScanner.DataReceived -= claimedScanner_DataReceived;
                claimedScanner.ReleaseDeviceRequested -= claimedScanner_ReleaseDeviceRequested;
                // Release the Barcode Scanner and set to null
                claimedScanner.Dispose();
                claimedScanner = null;
            }

            if (scanner != null)
            {
                scanner.Dispose();
                scanner = null;
            }

            // Reset the UI if we are still the current page.
            if (Frame.Content == this)
            {
                rootPage.NotifyUser("Click the start scanning button to begin.", NotifyType.StatusMessage);
                this.ScenarioOutputScanData.Text = "No data";
                this.ScenarioOutputScanDataLabel.Text = "No data";
                this.ScenarioOutputScanDataType.Text = "No data";

                // reset the button state
                ScenarioEndScanButton.IsEnabled = false;
                ScenarioStartScanButton.IsEnabled = true;
                ScenarioSoftwareTriggerPanel.Visibility = Visibility.Collapsed;
            }
        }

void ScenarioEndScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for End Scan Button Click.

Releases the Barcode Scanner and resets the text in the UI

Parameters:
sender
e

Definition at line 193 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            // reset the scenario state
            this.ResetTheScenarioState();
        }

async void ScenarioStartScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Start Scan Button Click.

Sets up the barcode scanner to be ready to receive the data events from the scan.

Parameters:
sender
e

Definition at line 66 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            ScenarioStartScanButton.IsEnabled = false;

            rootPage.NotifyUser("Acquiring barcode scanner object.", NotifyType.StatusMessage);

            // Acquire the barcode scanner.
            scanner = await DeviceHelpers.GetFirstBarcodeScannerAsync();
            if (scanner != null)
            {
                // after successful creation, claim the scanner for exclusive use and enable it so that data reveived events are received.
                claimedScanner = await scanner.ClaimScannerAsync();

                if (claimedScanner != null)
                {
                    // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
                    // claim ownership of the barcode scanner.
                    claimedScanner.ReleaseDeviceRequested += claimedScanner_ReleaseDeviceRequested;

                    // after successfully claiming, attach the datareceived event handler.
                    claimedScanner.DataReceived += claimedScanner_DataReceived;

                    // Ask the API to decode the data by default. By setting this, API will decode the raw data from the barcode scanner and
                    // send the ScanDataLabel and ScanDataType in the DataReceived event
                    claimedScanner.IsDecodeDataEnabled = true;

                    // enable the scanner.
                    // The scanner must be enabled in order to receive the DataReceived event.
                    await claimedScanner.EnableAsync();

                    rootPage.NotifyUser("Ready to scan. Device ID: " + claimedScanner.DeviceId, NotifyType.StatusMessage);
                    ScenarioEndScanButton.IsEnabled = true;

                    // If the scanner is a software scanner, show the software trigger buttons.
                    if (!string.IsNullOrEmpty(scanner.VideoDeviceId))
                    {
                        ScenarioSoftwareTriggerPanel.Visibility = Visibility.Visible;
                        ScenarioStartTriggerButton.IsEnabled = true;
                        ScenarioStopTriggerButton.IsEnabled = false;
                    }
                }
                else
                {
                    rootPage.NotifyUser("Claim barcode scanner failed.", NotifyType.ErrorMessage);
                    ScenarioStartScanButton.IsEnabled = true;
                }
            }
            else
            {
                rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage);
                ScenarioStartScanButton.IsEnabled = true;
            }
        }

async void ScenarioStartTriggerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Start Software Trigger button click.

Presses the software trigger button.

Definition at line 203 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            ScenarioStartTriggerButton.IsEnabled = false;
            await claimedScanner.StartSoftwareTriggerAsync();
            ScenarioStopTriggerButton.IsEnabled = true;
        }

async void ScenarioStopTriggerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Stop Software Trigger button click.

Releases the software trigger button.

Definition at line 214 of file Scenario1_BasicFunctionality.xaml.cs.

        {
            ScenarioStopTriggerButton.IsEnabled = false;
            await claimedScanner.StopSoftwareTriggerAsync();
            ScenarioStartTriggerButton.IsEnabled = true;
        }

Member Data Documentation

ClaimedBarcodeScanner claimedScanner = null [private]

Definition at line 33 of file Scenario1_BasicFunctionality.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_BasicFunctionality.xaml.cs.

BarcodeScanner scanner = null [private]

Definition at line 32 of file Scenario1_BasicFunctionality.xaml.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/Scenario1_BasicFunctionality.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basics Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Basics
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Basics Class Reference

This page uses methods of the ApiInformation class to detect the presence of types, methods, events, and enumerated values.

List of all members.

Public Member Functions

Scenario1_Basics ()
Scenario1_Basics ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Apply_Clicked (object sender, RoutedEventArgs e)
void | ApplySettingsToLampArray (LampArray lampArray)
async void | CheckBackgroundAccessStatus ()
void | GetOrientationReport ()
void | HardwareButtons_CameraPressed (object sender, CameraEventArgs e)
async void | LampArray_AvailabilityChanged (LampArray sender, object args)
void | SetGradientPatternToLampArray (LampArray lampArray)
void | SetWasdPatternToLampArray (LampArray lampArray)
void | UpdateLampArrayList ()
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)
async void | Watcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)

Private Attributes

int | CameraButtonPressCount = 0
bool | hasAlwaysAllowedAccess
bool | hasCameraButton
bool | hasOrientationWithOptimizationGoal
readonly List< LampArrayInfo > | m_attachedLampArrays = new List<LampArrayInfo>()
DeviceWatcher | m_deviceWatcher
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario1_Basics.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Basics ( ) [inline]

Definition at line 35 of file Scenario1_Basics.xaml.cs.

        {
            InitializeComponent();
        }

Scenario1_Basics ( ) [inline]

Definition at line 46 of file Scenario1_Basics.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Apply_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 118 of file Scenario1_Basics.xaml.cs.

        {
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                ApplySettingsToLampArray(info.lampArray);
            }
        }

void ApplySettingsToLampArray ( LampArray lampArray ) [inline, private]

Definition at line 126 of file Scenario1_Basics.xaml.cs.

        {
            // Apply the light pattern.
            if (OffButton.IsChecked.Value)
            {
                // Set all Lamps on the LampArray to black, turning them off.
                lampArray.SetColor(Colors.Black);
            }
            else if (SetColorButton.IsChecked.Value)
            {
                // Set all Lamps on the LampArray to green.
                lampArray.SetColor(Colors.Green);
            }
            else if (GradientButton.IsChecked.Value)
            {
                SetGradientPatternToLampArray(lampArray);
            }
            else if (WasdButton.IsChecked.Value)
            {
                SetWasdPatternToLampArray(lampArray);
            }

            // Apply the brightness. Convert the percentage value in the slider to the range [0, 1] expected by BrightnessLevel.
            lampArray.BrightnessLevel = BrightnessSlider.Value / BrightnessSlider.Maximum;
        }

async void CheckBackgroundAccessStatus ( ) [inline, private]

Definition at line 106 of file Scenario1_Basics.xaml.cs.

        {
            BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();

            // The Windows 10 Anniversary Update introduced a new background access model.
            if (hasAlwaysAllowedAccess)
            {
                switch (status)
                {
                    case BackgroundAccessStatus.AlwaysAllowed:
                    case BackgroundAccessStatus.AllowedSubjectToSystemPolicy:
                        rootPage.NotifyUser("Background activity is allowed.", NotifyType.StatusMessage);
                        break;

                    case BackgroundAccessStatus.Unspecified:
                    case BackgroundAccessStatus.DeniedByUser:
                    case BackgroundAccessStatus.DeniedBySystemPolicy:
                        rootPage.NotifyUser("Background activity is not allowed.", NotifyType.ErrorMessage);
                        break;
                }
            }
            else
            {
                // Use the background access model from Windows 10 November 2015 Update and earlier.
                switch (status)
                {
                    case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
                    case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
                        rootPage.NotifyUser("Background activity is allowed.", NotifyType.StatusMessage);
                        break;

                    case BackgroundAccessStatus.Unspecified:
                    case BackgroundAccessStatus.Denied:
                        rootPage.NotifyUser("Background activity is not allowed.", NotifyType.ErrorMessage);
                        break;
                }
            }
        }

void GetOrientationReport ( ) [inline, private]

Definition at line 76 of file Scenario1_Basics.xaml.cs.

        {
            OrientationSensor sensor;
            // If there is a version of GetDefault that lets us specify the optimization goal,
            // then use it. Otherwise, use the regular version.
            if (hasOrientationWithOptimizationGoal)
            {
                sensor = OrientationSensor.GetDefault(SensorReadingType.Absolute, SensorOptimizationGoal.PowerEfficiency);
            }
            else
            {
                sensor = OrientationSensor.GetDefault();
            }

            if (sensor != null)
            {
                OrientationSensorReading reading = sensor.GetCurrentReading();
                SensorQuaternion quaternion = reading.Quaternion;
                rootPage.NotifyUser($"X: {quaternion.X}, Y: {quaternion.Y}, Z: {quaternion.Z}, W: {quaternion.W}", NotifyType.StatusMessage);

                // Restore the default report interval to release resources while the sensor is not in use.
                sensor.ReportInterval = 0;
            }
            else
            {
                rootPage.NotifyUser("Sorry, no sensor found", NotifyType.ErrorMessage);
            }
        }

void HardwareButtons_CameraPressed | ( | object | sender,
 |  | CameraEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario1_Basics.xaml.cs.

        {
            CameraButtonPressCount++;
            rootPage.NotifyUser($"Camera button press #{CameraButtonPressCount}", NotifyType.StatusMessage);
        }

async void LampArray_AvailabilityChanged | ( | LampArray | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario1_Basics.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                UpdateLampArrayList();
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file Scenario1_Basics.xaml.cs.

        {
            m_deviceWatcher.Stop();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 60 of file Scenario1_Basics.xaml.cs.

        {
            // If the HardwareButtons.CameraPressed event exists, then unregister our handler.
            if (hasCameraButton)
            {
                HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario1_Basics.xaml.cs.

        {
            UpdateLampArrayList();

            // Start watching for newly attached LampArrays.
            m_deviceWatcher = DeviceInformation.CreateWatcher(LampArray.GetDeviceSelector());

            m_deviceWatcher.Added += Watcher_Added;
            m_deviceWatcher.Removed += Watcher_Removed;

            m_deviceWatcher.Start();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 51 of file Scenario1_Basics.xaml.cs.

        {
            // If the HardwareButtons.CameraPressed event exists, then register a handler for it.
            if (hasCameraButton)
            {
                HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
            }
        }

void SetGradientPatternToLampArray ( LampArray lampArray ) [inline, private]

Definition at line 152 of file Scenario1_Basics.xaml.cs.

        {
            // Create a static gradient on the LampArray from black to red, blending from left to right.

            // For this effect, we want to set the colors of all Lamps. Create an array containing all the Lamp indices
            // and an array of Colors. Both arrays must be of the same length. We will use these for SetColorsForIndices later.
            int[] indices = Enumerable.Range(0, lampArray.LampCount).ToArray();
            var colors = new Color[lampArray.LampCount];

            // A LampArray provides information about its size using a three-dimensional logical bounding box,
            // as well as the location of each of its Lamps within that bounding box.
            // The origin point of the bounding box is the leftmost (X), farthest (Y), uppermost (Z) corner relative to the user.
            // LampArray bounding boxes and Lamp positions are measured in meters.

            // Because our gradient will blend from left to right, we will set the Lamp colors according to each Lamp's X position.
            // We will make two passes over the LampArray. First, calculate the minimum and maximum X position values of all Lamps.
            // This is to "trim" the margins of the bounding box where no Lamps are present.
            double maxX = 0;
            double minX = lampArray.BoundingBox.X;

            foreach (int i in indices)
            {
                LampInfo lampInfo = lampArray.GetLampInfo(i);

                if (lampInfo.Position.X > maxX)
                {
                    maxX = lampInfo.Position.X;
                }

                if (lampInfo.Position.X < minX)
                {
                    minX = lampInfo.Position.X;
                }
            }

            // In the second pass, we will calculate the gradient colors for each Lamp.
            foreach (int i in indices)
            {
                LampInfo lampInfo = lampArray.GetLampInfo(i);

                // Calculate the X position for this Lamp relative to the rightmost Lamp. We will scale the Lamp's color by this relative value below.
                // (We also want to avoid dividing by zero here in case all Lamps share the same X position, including the single-Lamp case.)
                double xProgress = 1.0;
                if (maxX != minX)
                {
                    xProgress = (lampInfo.Position.X - minX) / (maxX - minX);
                }

                // Apply that value to the expected color for the lamp.
                // Maximize the Alpha value to give the color full opacity.
                colors[i].A = byte.MaxValue;

                // Set the color's R value based on the Lamp's X position.
                // As the X position of the Lamp increases (i.e., is further to the right),
                // the Red value of the Lamp's color will also increase.
                // This means that the leftmost Lamp(s) will be black (turned off), and the rightmost Lamp(s) will be the brightest red.
                colors[i].R = (byte)(xProgress * byte.MaxValue);
            }

            // Apply the colors to the LampArray.
            lampArray.SetColorsForIndices(colors, indices);
        }

void SetWasdPatternToLampArray ( LampArray lampArray ) [inline, private]

Definition at line 215 of file Scenario1_Basics.xaml.cs.

        {
            // Set a background color of blue for the whole LampArray.
            lampArray.SetColor(Colors.Blue);

            // Highlight the WASD keys in white, if the LampArray supports addressing its Lamps using a virtual key to Lamp mapping.
            // This is typically found on keyboard LampArrays. Other LampArrays will not usually support virtual key based lighting.
            if (lampArray.SupportsVirtualKeys)
            {
                Color[] colors = Enumerable.Repeat(Colors.White, 4).ToArray();
                VirtualKey[] virtualKeys = { VirtualKey.W, VirtualKey.A, VirtualKey.S, VirtualKey.D };

                lampArray.SetColorsForKeys(colors, virtualKeys);
            }
        }

void UpdateLampArrayList ( ) [inline, private]

Definition at line 107 of file Scenario1_Basics.xaml.cs.

        {
            string message = $"Attached LampArrays: {m_attachedLampArrays.Count}\n";
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                message += $"\t{info.displayName} ({info.lampArray.LampArrayKind.ToString()}, {info.lampArray.LampCount} lamps, " +
                           $"{(info.lampArray.IsAvailable ? "Available" : "Unavailable")})\n";
            }
            LampArraysSummary.Text = message;
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 58 of file Scenario1_Basics.xaml.cs.

        {
            var info = new LampArrayInfo(args.Id, args.Name, await LampArray.FromIdAsync(args.Id));

            // DeviceWatcher events are invoked on a background thread.
            // We need to switch to the foreground thread to update our app UI
            // and access member variables without race conditions.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (info.lampArray == null)
                {
                    // A LampArray was found, but Windows couldn't initialize it.
                    // This suggests a device error.
                    rootPage.NotifyUser($"Problem with LampArray {info.displayName}.", NotifyType.ErrorMessage);
                    return;
                }

                // Set up the AvailabilityChanged event callback for being notified whether this process can control
                // RGB lighting for the newly attached LampArray.
                info.lampArray.AvailabilityChanged += LampArray_AvailabilityChanged;

                // Remember this new LampArray and add it to the list.
                m_attachedLampArrays.Add(info);
                UpdateLampArrayList();
            });
        }

async void Watcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Definition at line 85 of file Scenario1_Basics.xaml.cs.

        {
            // DeviceWatcher events are invoked on a background thread.
            // We need to switch to the foreground thread to update our app UI
            // and access member variables without race conditions.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_attachedLampArrays.RemoveAll(info => info.id == args.Id);
                UpdateLampArrayList();
            });
        }

Member Data Documentation

int CameraButtonPressCount = 0 [private]

Definition at line 29 of file Scenario1_Basics.xaml.cs.

bool hasAlwaysAllowedAccess [private]
Initial value:
            ApiInformation.IsEnumNamedValuePresent("Windows.ApplicationModel.Background.BackgroundAccessStatus", "AlwaysAllowed")

Definition at line 43 of file Scenario1_Basics.xaml.cs.

bool hasCameraButton [private]
Initial value:
            ApiInformation.IsEventPresent("Windows.Phone.UI.Input.HardwareButtons", "CameraPressed")

Definition at line 35 of file Scenario1_Basics.xaml.cs.

bool hasOrientationWithOptimizationGoal [private]
Initial value:
            ApiInformation.IsMethodPresent("Windows.Devices.Sensors.OrientationSensor", "GetDefault", 2)

Definition at line 39 of file Scenario1_Basics.xaml.cs.

readonly List<LampArrayInfo> m_attachedLampArrays = new List<LampArrayInfo>() [private]

Definition at line 33 of file Scenario1_Basics.xaml.cs.

DeviceWatcher m_deviceWatcher [private]

Definition at line 30 of file Scenario1_Basics.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_Basics.xaml.cs.

The documentation for this class was generated from the following files:
  • LampArray/cs/Scenario1_Basics.xaml.cs
  • VersionAdaptiveCode/cs/Scenario1_Basics.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BasicUserActivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_BasicUserActivity
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_BasicUserActivity Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_BasicUserActivity ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateUserActivityAsync ()

Private Attributes

UserActivitySession | _currentSession

Detailed Description

Definition at line 24 of file Scenario1_BasicUserActivity.xaml.cs.

Constructor & Destructor Documentation

Scenario1_BasicUserActivity ( ) [inline]

Definition at line 28 of file Scenario1_BasicUserActivity.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateUserActivityAsync ( ) [inline, private]

Definition at line 46 of file Scenario1_BasicUserActivity.xaml.cs.

        {
            // Get channel and create activity.
            UserActivityChannel channel = UserActivityChannel.GetDefault();
            UserActivity activity = await channel.GetOrCreateUserActivityAsync("Scenario1_BasicUserActivity");

            // Set deep-link and properties.
            activity.ActivationUri = new Uri("useractivitysdkcs:page?Scenario1_BasicUserActivity");
            activity.VisualElements.DisplayText = "User Activity Sample Scenario 1";

            // Save to activity feed.
            await activity.SaveAsync();

            // Create a session, which indicates that the user is engaged
            // in the activity.
            _currentSession = activity.CreateSession();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 64 of file Scenario1_BasicUserActivity.xaml.cs.

        {
            // Dispose the session, which indicates that the user is no longer
            // engaged in the activity.
            _currentSession?.Dispose();
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario1_BasicUserActivity.xaml.cs.

        {
            // If we were activated from a URI, say so.
            // A real app would use the information in the URI to restore state.
            var message = e.Parameter as string;
            if (!String.IsNullOrEmpty(message))
            {
                MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
            }

            await CreateUserActivityAsync();
        }

Member Data Documentation

UserActivitySession _currentSession [private]

Definition at line 26 of file Scenario1_BasicUserActivity.xaml.cs.

The documentation for this class was generated from the following file:
  • UserActivity/cs/Scenario1_BasicUserActivity.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ChatClient Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ChatClient
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario1_ChatClient Class Reference

List of all members.

Public Member Functions

Scenario1_ChatClient ()
void | KeyboardKey_Pressed (object sender, KeyRoutedEventArgs e)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< RfcommChatDeviceDisplay > 		ResultCollection [get, set]

Private Member Functions

void | App_Suspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | ConnectButton_Click (object sender, RoutedEventArgs e)
void | Disconnect (string disconnectReason)
void | DisconnectButton_Click (object sender, RoutedEventArgs e)
async void | ReceiveStringLoop (DataReader chatReader)
async void | RequestAccessButton_Click (object sender, RoutedEventArgs e)
void | ResetMainUI ()
void | ResultsListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | RunButton_Click (object sender, RoutedEventArgs e)
void | SendButton_Click (object sender, RoutedEventArgs e)
async void | SendMessage ()
void | SetChatUI (string serviceName, string deviceName)
void | SetDeviceWatcherUI ()
void | StartUnpairedDeviceWatcher ()
void | StopWatcher ()
void | UpdatePairingButtons ()

Private Attributes

BluetoothDevice | bluetoothDevice
RfcommDeviceService | chatService = null
StreamSocket | chatSocket = null
DataWriter | chatWriter = null
DeviceWatcher | deviceWatcher = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario1_ChatClient.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ChatClient ( ) [inline]

Definition at line 48 of file Scenario1_ChatClient.xaml.cs.

        {
            this.InitializeComponent();
            App.Current.Suspending += App_Suspending;
        }

Member Function Documentation

void App_Suspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario1_ChatClient.xaml.cs.

        {
            // Make sure we clean up resources on suspend.
            Disconnect("App Suspension disconnects");
        }

async void ConnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked once the user has selected the device to connect to.

Once the user has selected the device,

Parameters:
sender
e

Definition at line 218 of file Scenario1_ChatClient.xaml.cs.

        {
            // Make sure user has selected a device first
            if (resultsListView.SelectedItem != null)
            {
                rootPage.NotifyUser("Connecting to remote device. Please wait...", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Please select an item to connect to", NotifyType.ErrorMessage);
                return;
            }

            RfcommChatDeviceDisplay deviceInfoDisp = resultsListView.SelectedItem as RfcommChatDeviceDisplay;

            // Perform device access checks before trying to get the device.
            // First, we check if consent has been explicitly denied by the user.
            DeviceAccessStatus accessStatus = DeviceAccessInformation.CreateFromId(deviceInfoDisp.Id).CurrentStatus;
            if (accessStatus == DeviceAccessStatus.DeniedByUser)
            {
                rootPage.NotifyUser("This app does not have access to connect to the remote device (please grant access in Settings > Privacy > Other Devices", NotifyType.ErrorMessage);
                return;
            }
            // If not, try to get the Bluetooth device
            try
            {
                bluetoothDevice = await BluetoothDevice.FromIdAsync(deviceInfoDisp.Id);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                ResetMainUI();
                return;
            }
            // If we were unable to get a valid Bluetooth device object,
            // it's most likely because the user has specified that all unpaired devices
            // should not be interacted with.
            if (bluetoothDevice == null)
            {
                rootPage.NotifyUser("Bluetooth Device returned null. Access Status = " + accessStatus.ToString(), NotifyType.ErrorMessage);
            }

            // This should return a list of uncached Bluetooth services (so if the server was not active when paired, it will still be detected by this call
            var rfcommServices = await bluetoothDevice.GetRfcommServicesForIdAsync(
                RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid), BluetoothCacheMode.Uncached);

            if (rfcommServices.Services.Count > 0)
            {
                chatService = rfcommServices.Services[0];
            }
            else
            {
                rootPage.NotifyUser(
                   "Could not discover the chat service on the remote device",
                   NotifyType.StatusMessage);
                ResetMainUI();
                return;
            }

            // Do various checks of the SDP record to make sure you are talking to a device that actually supports the Bluetooth Rfcomm Chat Service
            var attributes = await chatService.GetSdpRawAttributesAsync();
            if (!attributes.ContainsKey(Constants.SdpServiceNameAttributeId))
            {
                rootPage.NotifyUser(
                    "The Chat service is not advertising the Service Name attribute (attribute id=0x100). " +
                    "Please verify that you are running the BluetoothRfcommChat server.",
                    NotifyType.ErrorMessage);
                ResetMainUI();
                return;
            }
            var attributeReader = DataReader.FromBuffer(attributes[Constants.SdpServiceNameAttributeId]);
            var attributeType = attributeReader.ReadByte();
            if (attributeType != Constants.SdpServiceNameAttributeType)
            {
                rootPage.NotifyUser(
                    "The Chat service is using an unexpected format for the Service Name attribute. " +
                    "Please verify that you are running the BluetoothRfcommChat server.",
                    NotifyType.ErrorMessage);
                ResetMainUI();
                return;
            }
            var serviceNameLength = attributeReader.ReadByte();

            // The Service Name attribute requires UTF-8 encoding.
            attributeReader.UnicodeEncoding = UnicodeEncoding.Utf8;

            StopWatcher();

            lock (this)
            {
                chatSocket = new StreamSocket();
            }
            try
            {
                await chatSocket.ConnectAsync(chatService.ConnectionHostName, chatService.ConnectionServiceName);

                SetChatUI(attributeReader.ReadString(serviceNameLength), bluetoothDevice.Name);
                chatWriter = new DataWriter(chatSocket.OutputStream);

                DataReader chatReader = new DataReader(chatSocket.InputStream);
                ReceiveStringLoop(chatReader);
            }
            catch (Exception ex) when ((uint)ex.HResult == 0x80070490) // ERROR_ELEMENT_NOT_FOUND
            {
                rootPage.NotifyUser("Please verify that you are running the BluetoothRfcommChat server.", NotifyType.ErrorMessage);
                ResetMainUI();
            }
            catch (Exception ex) when ((uint)ex.HResult == 0x80072740) // WSAEADDRINUSE
            {
                rootPage.NotifyUser("Please verify that there is no other RFCOMM connection to the same device.", NotifyType.ErrorMessage);
                ResetMainUI();
            }
        }

void Disconnect ( string disconnectReason ) [inline, private]

Cleans up the socket and DataWriter and reset the UI.

Parameters:
disconnectReason

Definition at line 451 of file Scenario1_ChatClient.xaml.cs.

        {
            if (chatWriter != null)
            {
                chatWriter.DetachStream();
                chatWriter = null;
            }

            if (chatService != null)
            {
                chatService.Dispose();
                chatService = null;
            }
            lock (this)
            {
                if (chatSocket != null)
                {
                    chatSocket.Dispose();
                    chatSocket = null;
                }
            }

            rootPage.NotifyUser(disconnectReason, NotifyType.StatusMessage);
            ResetMainUI();
        }

void DisconnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 441 of file Scenario1_ChatClient.xaml.cs.

        {
            Disconnect("Disconnected");
        }

void KeyboardKey_Pressed | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 364 of file Scenario1_ChatClient.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                SendMessage();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 61 of file Scenario1_ChatClient.xaml.cs.

        {
            StopWatcher();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 54 of file Scenario1_ChatClient.xaml.cs.

        {
            rootPage = MainPage.Current;
            ResultCollection = new ObservableCollection<RfcommChatDeviceDisplay>();
            DataContext = this;
        }

async void ReceiveStringLoop ( DataReader chatReader ) [inline, private]

Definition at line 398 of file Scenario1_ChatClient.xaml.cs.

        {
            try
            {
                uint size = await chatReader.LoadAsync(sizeof(uint));
                if (size < sizeof(uint))
                {
                    Disconnect("Remote device terminated connection - make sure only one instance of server is running on remote device");
                    return;
                }

                uint stringLength = chatReader.ReadUInt32();
                uint actualStringLength = await chatReader.LoadAsync(stringLength);
                if (actualStringLength != stringLength)
                {
                    // The underlying socket was closed before we were able to read the whole data
                    return;
                }

                ConversationList.Items.Add("Received: " + chatReader.ReadString(stringLength));

                ReceiveStringLoop(chatReader);
            }
            catch (Exception ex)
            {
                lock (this)
                {
                    if (chatSocket == null)
                    {
                        // Do not print anything here -  the user closed the socket.
                        if ((uint)ex.HResult == 0x80072745)
                            rootPage.NotifyUser("Disconnect triggered by remote device", NotifyType.StatusMessage);
                        else if ((uint)ex.HResult == 0x800703E3)
                            rootPage.NotifyUser("The I/O operation has been aborted because of either a thread exit or an application request.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        Disconnect("Read stream failed with error: " + ex.Message);
                    }
                }
            }
        }

async void RequestAccessButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

If you believe the Bluetooth device will eventually be paired with Windows, you might want to pre-emptively get consent to access the device.

An explicit call to RequestAccessAsync() prompts the user for consent. If this is not done, a device that's working before being paired, will no longer work after being paired.

Parameters:
sender
e

Definition at line 341 of file Scenario1_ChatClient.xaml.cs.

        {
            // Make sure user has given consent to access device
            DeviceAccessStatus accessStatus = await bluetoothDevice.RequestAccessAsync();

            if (accessStatus != DeviceAccessStatus.Allowed)
            {
                rootPage.NotifyUser(
                    "Access to the device is denied because the application was not granted access",
                    NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(
                                    "Access granted, you are free to pair devices",
                                    NotifyType.StatusMessage);
            }
        }

void ResetMainUI ( ) [inline, private]

Definition at line 113 of file Scenario1_ChatClient.xaml.cs.

        {
            RunButton.Content = "Start";
            RunButton.IsEnabled = true;
            ConnectButton.Visibility = Visibility.Visible;
            resultsListView.Visibility = Visibility.Visible;
            resultsListView.IsEnabled = true;

            // Re-set device specific UX
            ChatBox.Visibility = Visibility.Collapsed;
            RequestAccessButton.Visibility = Visibility.Collapsed;
            if (ConversationList.Items != null) ConversationList.Items.Clear();
            StopWatcher();
        }

void ResultsListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 491 of file Scenario1_ChatClient.xaml.cs.

        {
            UpdatePairingButtons();
        }

void RunButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

When the user presses the run button, query for all nearby unpaired devices Note that in this case, the other device must be running the Rfcomm Chat Server before being paired.

Parameters:
sender | Instance that triggered the event.
e | Event data describing the conditions that led to the event.

Definition at line 91 of file Scenario1_ChatClient.xaml.cs.

        {
            if (deviceWatcher == null)
            {
                SetDeviceWatcherUI();
                StartUnpairedDeviceWatcher();
            }
            else
            {
                ResetMainUI();
            }
        }

void SendButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 359 of file Scenario1_ChatClient.xaml.cs.

        {
            SendMessage();
        }

async void SendMessage ( ) [inline, private]

Takes the contents of the MessageTextBox and writes it to the outgoing chatWriter.

Definition at line 375 of file Scenario1_ChatClient.xaml.cs.

        {
            try
            {
                if (MessageTextBox.Text.Length != 0)
                {
                    chatWriter.WriteUInt32((uint)MessageTextBox.Text.Length);
                    chatWriter.WriteString(MessageTextBox.Text);

                    ConversationList.Items.Add("Sent: " + MessageTextBox.Text);
                    MessageTextBox.Text = "";
                    await chatWriter.StoreAsync();

                }
            }
            catch (Exception ex) when ((uint)ex.HResult == 0x80072745)
            {
                // The remote device has disconnected the connection
                rootPage.NotifyUser("Remote side disconnect: " + ex.HResult.ToString() + " - " + ex.Message,
                    NotifyType.StatusMessage);
            }
        }

void SetChatUI | ( | string | serviceName,
 |  | string | deviceName |
 | ) |  |  | [inline, private]

Definition at line 478 of file Scenario1_ChatClient.xaml.cs.

        {
            rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
            ServiceName.Text = "Service Name: " + serviceName;
            DeviceName.Text = "Connected to: " + deviceName;
            RunButton.IsEnabled = false;
            ConnectButton.Visibility = Visibility.Collapsed;
            RequestAccessButton.Visibility = Visibility.Visible;
            resultsListView.IsEnabled = false;
            resultsListView.Visibility = Visibility.Collapsed;
            ChatBox.Visibility = Visibility.Visible;
        }

void SetDeviceWatcherUI ( ) [inline, private]

Definition at line 104 of file Scenario1_ChatClient.xaml.cs.

        {
            // Disable the button while we do async operations so the user can't Run twice.
            RunButton.Content = "Stop";
            rootPage.NotifyUser("Device watcher started", NotifyType.StatusMessage);
            resultsListView.Visibility = Visibility.Visible;
            resultsListView.IsEnabled = true;
        }

void StartUnpairedDeviceWatcher ( ) [inline, private]

Definition at line 128 of file Scenario1_ChatClient.xaml.cs.

        {
            // Request additional properties
            string[] requestedProperties = new string[] { "System.Devices.Aep.DeviceAddress", "System.Devices.Aep.IsConnected" };

            deviceWatcher = DeviceInformation.CreateWatcher("(System.Devices.Aep.ProtocolId:=\"{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\")",
                                                            requestedProperties,
                                                            DeviceInformationKind.AssociationEndpoint);

            // Hook up handlers for the watcher events before starting the watcher
            deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(async (watcher, deviceInfo) =>
            {
                // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // Make sure device name isn't blank
                    if(deviceInfo.Name != "")
                    {
                        ResultCollection.Add(new RfcommChatDeviceDisplay(deviceInfo));
                        rootPage.NotifyUser(
                            String.Format("{0} devices found.", ResultCollection.Count),
                            NotifyType.StatusMessage);
                    }

                });
            });

            deviceWatcher.Updated += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(async (watcher, deviceInfoUpdate) =>
            {
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                {
                    foreach (RfcommChatDeviceDisplay rfcommInfoDisp in ResultCollection)
                    {
                        if (rfcommInfoDisp.Id == deviceInfoUpdate.Id)
                        {
                            rfcommInfoDisp.Update(deviceInfoUpdate);
                            break;
                        }
                    }
                });
            });

            deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(async (watcher, obj) =>
            {
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                {
                    rootPage.NotifyUser(
                        String.Format("{0} devices found. Enumeration completed. Watching for updates...", ResultCollection.Count),
                        NotifyType.StatusMessage);
                });
            });

            deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(async (watcher, deviceInfoUpdate) =>
            {
                // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                {
                    // Find the corresponding DeviceInformation in the collection and remove it
                    foreach (RfcommChatDeviceDisplay rfcommInfoDisp in ResultCollection)
                    {
                        if (rfcommInfoDisp.Id == deviceInfoUpdate.Id)
                        {
                            ResultCollection.Remove(rfcommInfoDisp);
                            break;
                        }
                    }

                    rootPage.NotifyUser(
                        String.Format("{0} devices found.", ResultCollection.Count),
                        NotifyType.StatusMessage);
                });
            });

            deviceWatcher.Stopped += new TypedEventHandler<DeviceWatcher, Object>(async (watcher, obj) =>
            {
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                {
                    ResultCollection.Clear();
                });
            });

            deviceWatcher.Start();
        }

void StopWatcher ( ) [inline, private]

Definition at line 66 of file Scenario1_ChatClient.xaml.cs.

        {
            if (null != deviceWatcher)
            {
                if ((DeviceWatcherStatus.Started == deviceWatcher.Status ||
                     DeviceWatcherStatus.EnumerationCompleted == deviceWatcher.Status))
                {
                    deviceWatcher.Stop();
                }
                deviceWatcher = null;
            }
        }

void UpdatePairingButtons ( ) [inline, private]

Definition at line 496 of file Scenario1_ChatClient.xaml.cs.

        {
            RfcommChatDeviceDisplay deviceDisp = (RfcommChatDeviceDisplay)resultsListView.SelectedItem;

            if (null != deviceDisp)
            {
                ConnectButton.IsEnabled = true;
            }
            else
            {
                ConnectButton.IsEnabled = false;
            }
        }

Member Data Documentation

BluetoothDevice bluetoothDevice [private]

Definition at line 46 of file Scenario1_ChatClient.xaml.cs.

RfcommDeviceService chatService = null [private]

Definition at line 45 of file Scenario1_ChatClient.xaml.cs.

StreamSocket chatSocket = null [private]

Definition at line 43 of file Scenario1_ChatClient.xaml.cs.

DataWriter chatWriter = null [private]

Definition at line 44 of file Scenario1_ChatClient.xaml.cs.

DeviceWatcher deviceWatcher = null [private]

Definition at line 42 of file Scenario1_ChatClient.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario1_ChatClient.xaml.cs.

Property Documentation

ObservableCollection<RfcommChatDeviceDisplay> ResultCollection [get, set]

Definition at line 37 of file Scenario1_ChatClient.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothRfcommChat/cs/Scenario1_ChatClient.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Check Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Check
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Check Class Reference

List of all members.

Public Member Functions

Scenario1_Check ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnCapabilityAccessChanged (AppCapability sender, object e)
async Task | StreamLocationAsync ()
async void | StreamLocationButton_Click (object sender, RoutedEventArgs e)
void | UpdateCapabilityStatus ()

Private Attributes

AppCapability | locationCapability = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario1_Check.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Check ( ) [inline]

Definition at line 32 of file Scenario1_Check.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void OnCapabilityAccessChanged | ( | AppCapability | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario1_Check.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCapabilityStatus());
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario1_Check.xaml.cs.

        {
            locationCapability.AccessChanged -= OnCapabilityAccessChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario1_Check.xaml.cs.

        {
            // Specify which capability we want to query/monitor.
            locationCapability = AppCapability.Create("location");

            // Register a handler to be called when access changes.
            locationCapability.AccessChanged += OnCapabilityAccessChanged;

            // Update UI to match current access.
            UpdateCapabilityStatus();
        }

async Task StreamLocationAsync ( ) [inline, private]

Definition at line 90 of file Scenario1_Check.xaml.cs.

        {
            if (await Geolocator.RequestAccessAsync() == GeolocationAccessStatus.Allowed)
            {
                // Need try/catch because we can lose geolocator access at any time.
                try
                {
                    // Specify a message to explain to the user why we are tracking their location.
                    locationCapability.DisplayMessage = "Streaming location";

                    LocationTextBlock.Text = "Finding your current location...";
                    Geolocator geolocator = new Geolocator();

                    for (int i = 0; i < 4; i++)
                    {
                        Geoposition pos = await geolocator.GetGeopositionAsync();

                        if (pos == null)
                        {
                            LocationTextBlock.Text = "Current location unknown.";
                        }
                        else
                        {
                            LocationTextBlock.Text = $"Your location is: Latitude {pos.Coordinate.Point.Position.Latitude:F}, Longitude {pos.Coordinate.Point.Position.Longitude:F}";
                        }

                        await Task.Delay(500);

                        // You can change the message as your app's usage changes.
                        locationCapability.DisplayMessage = "Tracking your current location...";
                    }
                }
                catch (Exception ex) when (ex.HResult == unchecked((int)0x80070005)) // E_ACCESSDENIED
                {
                    // Lost access in the middle of the operation.
                    // AccessChanged event will trigger a recalc.
                }

                LocationTextBlock.Text = "";

                // Even though we clear the message immediately, it will take time before the message
                // disappear from the system. The system has a minimum display time for the message,
                // so that users can observe brief usage.
                locationCapability.DisplayMessage = "";
            }
            else
            {
                // Lost access before operation started.
                // AccessChanged event will trigger a recalc.
            }
        }

async void StreamLocationButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario1_Check.xaml.cs.

        {
            switch (locationCapability.CheckAccess())
            {
                case AppCapabilityAccessStatus.Allowed:
                    // Access was already granted.
                    // AccessChanged event will trigger a recalc.
                    await StreamLocationAsync();
                    break;

                case AppCapabilityAccessStatus.UserPromptRequired:
                    // Request access directly for a better experience than going to Settings.
                    // This is equivalent to calling Geolocator::RequestAccessAsync().
                    if (await locationCapability.RequestAccessAsync() == AppCapabilityAccessStatus.Allowed)
                    {
                        // The user granted access.
                        // AccessChanged event will trigger a recalc.
                        await StreamLocationAsync();
                    }
                    break;

                case AppCapabilityAccessStatus.DeniedByUser:
                case AppCapabilityAccessStatus.DeniedBySystem:
                default:
                    // Send user to Settings to obtain location permission
                    // or explain why access is denied.
                    await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-location"));
                    break;
            }
        }

void UpdateCapabilityStatus ( ) [inline, private]

Definition at line 142 of file Scenario1_Check.xaml.cs.

        {
            AppCapabilityAccessStatus status = locationCapability.CheckAccess();
            if (status == AppCapabilityAccessStatus.Allowed)
            {
                LocationAccessBlock.Visibility = Visibility.Collapsed;
                LocationTextBlock.Visibility = Visibility.Visible;
            }
            else
            {
                LocationTextBlock.Visibility = Visibility.Collapsed;

                switch (status)
                {
                    case AppCapabilityAccessStatus.NotDeclaredByApp:
                        // The app neglected to declare the capability in its manifest.
                        // This is a developer error.
                        LocationAccessBlock.Text = "App misconfiguration error. Contact vendor for support.";
                        LocationAccessBlock.Visibility = Visibility.Visible;
                        break;

                    default:
                    case AppCapabilityAccessStatus.DeniedBySystem:
                        // We can send the user to the Settings page to obtain access
                        // or at least explain why access is denied.
                        LocationAccessBlock.Text = "The system has blocked access to location.";
                        LocationAccessBlock.Visibility = Visibility.Visible;
                        break;

                    case AppCapabilityAccessStatus.DeniedByUser:
                        // We can send the user to the Settings page to obtain access.
                        LocationAccessBlock.Text = "You must enable location access in Settings.";
                        LocationAccessBlock.Visibility = Visibility.Visible;
                        break;

                    case AppCapabilityAccessStatus.UserPromptRequired:
                        // We can prompt the user to give us access.
                        LocationAccessBlock.Visibility = Visibility.Collapsed;
                        break;
                }
            }
        }

Member Data Documentation

AppCapability locationCapability = null [private]

Definition at line 30 of file Scenario1_Check.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario1_Check.xaml.cs.

The documentation for this class was generated from the following file:
  • Capabilities/cs/Scenario1_Check.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CheckConsentAvailability Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_CheckConsentAvailability
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_CheckConsentAvailability Class Reference

List of all members.

Public Member Functions

Scenario1_CheckConsentAvailability ()

Private Member Functions

async void CheckAvailability_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario1_CheckConsentAvailability.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CheckConsentAvailability ( ) [inline]

Definition at line 24 of file Scenario1_CheckConsentAvailability.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CheckAvailability_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario1_CheckConsentAvailability.xaml.cs.

        {
            CheckAvailabilityButton.IsEnabled = false;

            // Check the availability of Windows Hello authentication through User Consent Verifier.
            UserConsentVerifierAvailability consentAvailability = await UserConsentVerifier.CheckAvailabilityAsync();
            switch (consentAvailability)
            {
                case UserConsentVerifierAvailability.Available:
                    rootPage.NotifyUser("User consent verification available!", NotifyType.StatusMessage);
                    break;

                case UserConsentVerifierAvailability.DeviceNotPresent:
                    rootPage.NotifyUser("No PIN or biometric found, please set one up.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("User consent verification is currently unavailable.", NotifyType.ErrorMessage);
                    break;
            }

            CheckAvailabilityButton.IsEnabled = true;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario1_CheckConsentAvailability.xaml.cs.

The documentation for this class was generated from the following files:
  • UserConsentVerifier/cs/Scenario1_CheckConsentAvailability.xaml.cs
  • UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Colors Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Colors
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

Scenario1_Colors Class Reference

List of all members.

Public Member Functions

Scenario1_Colors ()

Properties

ApplicationViewTitleBar | TitleBar [get]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | UpdateColors ()
void | UseCustomColors_Click (object sender, RoutedEventArgs e)

Private Attributes

ApplicationViewTitleBar | titleBar

Detailed Description

Definition at line 20 of file Scenario1_Colors.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Colors ( ) [inline]

Definition at line 22 of file Scenario1_Colors.xaml.cs.

        {
            this.InitializeComponent();
            titleBar = ApplicationView.GetForCurrentView().TitleBar;

            // Infer the radio button selection from the title bar colors.
            if (titleBar.ButtonBackgroundColor == null)
            {
                UseStandardColors.IsChecked = true;
            }
            else if (titleBar.ButtonBackgroundColor.Value.A > 0)
            {
                UseCustomColors.IsChecked = true;
            }
            else
            {
                TransparentWhenExtended.IsChecked = true;
            }
        }

Member Function Documentation

void UpdateColors ( ) [inline, private]

Definition at line 58 of file Scenario1_Colors.xaml.cs.

        {
            if (UseStandardColors.IsChecked.Value)
            {
                // Setting colors to null returns them to system defaults.
                titleBar.BackgroundColor = null;
                titleBar.ForegroundColor = null;
                titleBar.InactiveBackgroundColor = null;
                titleBar.InactiveForegroundColor = null;

                titleBar.ButtonBackgroundColor = null;
                titleBar.ButtonHoverBackgroundColor = null;
                titleBar.ButtonPressedBackgroundColor = null;
                titleBar.ButtonInactiveBackgroundColor = null;

                titleBar.ButtonForegroundColor = null;
                titleBar.ButtonHoverForegroundColor = null;
                titleBar.ButtonPressedForegroundColor = null;
                titleBar.ButtonInactiveForegroundColor = null;
            }
            else
            {
                // Title bar colors. Alpha must be 255.
                titleBar.BackgroundColor = new Color() { A = 255, R = 54, G = 60, B = 116 };
                titleBar.ForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
                titleBar.InactiveBackgroundColor = new Color() { A = 255, R = 135, G = 141, B = 199 };
                titleBar.InactiveForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };

                // Title bar button background colors. Alpha is respected when the view is extended
                // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
                byte buttonAlpha = (byte)(TransparentWhenExtended.IsChecked.Value ? 0 : 255);
                titleBar.ButtonBackgroundColor = new Color() { A = buttonAlpha, R = 54, G = 60, B = 116 };
                titleBar.ButtonHoverBackgroundColor = new Color() { A = buttonAlpha, R = 19, G = 21, B = 40 };
                titleBar.ButtonPressedBackgroundColor = new Color() { A = buttonAlpha, R = 232, G = 211, B = 162 };
                titleBar.ButtonInactiveBackgroundColor = new Color() { A = buttonAlpha, R = 135, G = 141, B = 199 };

                // Title bar button foreground colors. Alpha must be 255.
                titleBar.ButtonForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
                titleBar.ButtonHoverForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
                titleBar.ButtonPressedForegroundColor = new Color() { A = 255, R = 54, G = 60, B = 116 };
                titleBar.ButtonInactiveForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
            }

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("TitleBar"));
            }
        }

void UseCustomColors_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario1_Colors.xaml.cs.

        {
            UpdateColors();
        }

Member Data Documentation

ApplicationViewTitleBar titleBar [private]

Definition at line 45 of file Scenario1_Colors.xaml.cs.

Property Documentation

ApplicationViewTitleBar TitleBar [get]

Definition at line 48 of file Scenario1_Colors.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 43 of file Scenario1_Colors.xaml.cs.

The documentation for this class was generated from the following files:
  • TitleBar/cs/Scenario1_Colors.xaml.cs
  • TitleBar/cpp/Scenario1_Colors.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Configuration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Configuration
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario1_Configuration Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Configuration ()

Private Member Functions

void | LanguageList_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Static Private Attributes

static ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings

Detailed Description

Definition at line 26 of file Scenario1_Configuration.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Configuration ( ) [inline]

Definition at line 34 of file Scenario1_Configuration.xaml.cs.

        {
            this.InitializeComponent();

            IReadOnlyList<Language> availableLanguages = OcrEngine.AvailableRecognizerLanguages;

            LanguageList.ItemsSource = availableLanguages;

            if (availableLanguages.Count > 0)
            {
                // Select the one that the user selected last time, if any.
                if (localSettings.Values["decoderLanguage"] is string languageTag)
                {
                    foreach (Language language in availableLanguages)
                    {
                        if (language.LanguageTag == languageTag)
                        {
                            LanguageList.SelectedItem = language;
                            break;
                        }
                    }
                }

                // If not found (or user had never set a preference), then select the first one.
                if (LanguageList.SelectedIndex < 0)
                {
                    LanguageList.SelectedIndex = 0;
                }
            }
        }

Member Function Documentation

void LanguageList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Occurs when selected language is changed in available languages combo box.

Parameters:
sender
e

Definition at line 70 of file Scenario1_Configuration.xaml.cs.

        {
            var selectedLanguage = LanguageList.SelectedItem as Language;
            if (selectedLanguage != null)
            {
                rootPage.NotifyUser($"Selected decoder language is {selectedLanguage.DisplayName}.", NotifyType.StatusMessage);

                localSettings.Values["decoderLanguage"] = selectedLanguage.LanguageTag;
            }
        }

Member Data Documentation

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [static, private]

Definition at line 32 of file Scenario1_Configuration.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_Configuration.xaml.cs.

The documentation for this class was generated from the following files:
  • BarcodeScannerProvider/cs/BarcodeScannerProvider/Scenario1_Configuration.xaml.cs
  • BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Configure Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Configure
Public Member Functions | Private Member Functions

Scenario1_Configure Class Reference

List of all members.

Public Member Functions

Scenario1_Configure ()

Private Member Functions

async void | OpenAppSettings (object sender, RoutedEventArgs e)
async void | OpenLockscreenSettings (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_Configure.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Configure ( ) [inline]

Definition at line 21 of file Scenario1_Configure.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void OpenAppSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario1_Configure.xaml.cs.

        {
            await Launcher.LaunchUriAsync(new Uri("ms-settings:appsfeatures-app"));
        }

async void OpenLockscreenSettings | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file Scenario1_Configure.xaml.cs.

        {
            await Launcher.LaunchUriAsync(new Uri("ms-settings:lockscreen"));
        }

The documentation for this class was generated from the following file:
  • LockScreenApps/cs/Scenario1_Configure.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConfigureMobileHotspot Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ConfigureMobileHotspot
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ConfigureMobileHotspot Class Reference

List of all members.

Public Member Functions

Scenario1_ConfigureMobileHotspot ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddComboBoxItem (ComboBox comboBox, string name, object value, bool selected)
async void | ApplyChanges_Click (object sender, RoutedEventArgs e)
void | DiscardChanges_Click (object sender, RoutedEventArgs e)
void | InitializeTetheringControls ()

Private Attributes

bool | m_applying = false
NetworkOperatorTetheringManager | m_tetheringManager = null

Detailed Description

Definition at line 20 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ConfigureMobileHotspot ( ) [inline]

Definition at line 25 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddComboBoxItem | ( | ComboBox | comboBox,
 |  | string | name,
 |  | object | value,
 |  | bool | selected |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            var item = new ComboBoxItem { Tag = value, Content = name };
            BandComboBox.Items.Add(item);
            if (selected)
            {
                BandComboBox.SelectedItem = item;
            }
        }

async void ApplyChanges_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            if (m_applying)
            {
                return;

            }
            m_applying = true;

            NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();

            configuration.Ssid = SsidTextBox.Text;
            configuration.Passphrase = PassphraseTextBox.Text;
            configuration.Band = (TetheringWiFiBand)((ComboBoxItem)BandComboBox.SelectedItem).Tag;

            await m_tetheringManager.ConfigureAccessPointAsync(configuration);
            m_applying = false;

            InitializeTetheringControls();
        }

void DiscardChanges_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            InitializeTetheringControls();
        }

void InitializeTetheringControls ( ) [inline, private]

Definition at line 51 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();

            SsidTextBox.Text = configuration.Ssid;
            PassphraseTextBox.Text = configuration.Passphrase;

            // Fill the Band combo box with supported bands, and select the current one.
            TetheringWiFiBand currentBand = configuration.Band;
            BandComboBox.Items.Clear();
            for (TetheringWiFiBand band = TetheringWiFiBand.Auto; band <= TetheringWiFiBand.FiveGigahertz; band++)
            {
                if (Helpers.IsBandSupported(configuration, band))
                {
                    AddComboBoxItem(BandComboBox, Helpers.GetFriendlyName(band), band, band == currentBand);
                }
            }
            if (BandComboBox.SelectedIndex == -1)
            {
                AddComboBoxItem(BandComboBox, Helpers.GetFriendlyName(currentBand), currentBand, true);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

        {
            m_tetheringManager = Helpers.TryGetCurrentNetworkOperatorTetheringManager();

            if (m_tetheringManager != null)
            {
                InitializeTetheringControls();
                HotspotPanel.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

bool m_applying = false [private]

Definition at line 23 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

NetworkOperatorTetheringManager m_tetheringManager = null [private]

Definition at line 22 of file Scenario1_ConfigureMobileHotspot.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileHotspot/cs/Scenario1_ConfigureMobileHotspot.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Create Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Create
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Create Class Reference

List of all members.

Public Member Functions

Scenario1_Create ()

Private Member Functions

async void PickAudioButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario1_Create.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Create ( ) [inline]

Definition at line 27 of file Scenario1_Create.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickAudioButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Creates a playlist with the audio picked by the user in the FilePicker.

Parameters:
sender
e

Definition at line 37 of file Scenario1_Create.xaml.cs.

        {
            FileOpenPicker picker = MainPage.CreateFilePicker(MainPage.audioExtensions);
            IReadOnlyList<StorageFile> files = await picker.PickMultipleFilesAsync();

            if (files.Count > 0)
            {
                Playlist playlist = new Playlist();

                foreach (StorageFile file in files)
                {
                    playlist.Files.Add(file);
                }

                StorageFolder folder = KnownFolders.MusicLibrary;
                string name = "Sample";
                NameCollisionOption collisionOption = NameCollisionOption.ReplaceExisting;
                PlaylistFormat format = PlaylistFormat.WindowsMedia;

                try
                {
                    StorageFile savedFile = await playlist.SaveAsAsync(folder, name, collisionOption, format);
                    this.rootPage.NotifyUser(savedFile.Name + " was created and saved with " + files.Count + " files.", NotifyType.StatusMessage);
                }
                catch (Exception error)
                {
                    rootPage.NotifyUser(error.Message, NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No files picked.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_Create.xaml.cs.

The documentation for this class was generated from the following files:
  • Playlists/cs/Scenario1_Create.xaml.cs
  • Playlists/cpp/Scenario1_Create.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CreateContact Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_CreateContact
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_CreateContact Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_CreateContact ()

Private Member Functions

async Task | AnnotateContactAsync (Contact contact)
async void | Cleanup_Click (object sender, RoutedEventArgs e)
async Task< Contact > | CreateContactAsync ()
async Task< ContactList > | GetContactListAsync ()
async void | Pin_Click (object sender, RoutedEventArgs e)
async Task | PinContactAsync (Contact contact)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_CreateContact.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CreateContact ( ) [inline]

Definition at line 29 of file Scenario1_CreateContact.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task AnnotateContactAsync ( Contact contact ) [inline, private]

Definition at line 89 of file Scenario1_CreateContact.xaml.cs.

        {
            // Annotate this contact with a remote ID, which you can then retrieve when the Contact Panel is activated.
            ContactAnnotation contactAnnotation = new ContactAnnotation
            {
                ContactId = contact.Id,
                RemoteId = Constants.ContactRemoteId,
                SupportedOperations = ContactAnnotationOperations.ContactProfile | ContactAnnotationOperations.Message
            };

            // Annotate that this contact can load this app's Contact Panel.
            var infos = await Windows.System.AppDiagnosticInfo.RequestInfoForAppAsync();
            contactAnnotation.ProviderProperties.Add("ContactPanelAppID", infos[0].AppInfo.AppUserModelId);

            var contactAnnotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);
            var contactAnnotationLists = await contactAnnotationStore.FindAnnotationListsAsync();

            ContactAnnotationList contactAnnotationList = contactAnnotationLists.Count > 0 ? contactAnnotationLists[0] : null;

            if (contactAnnotationList == null)
            {
                contactAnnotationList = await contactAnnotationStore.CreateAnnotationListAsync();
            }

            await contactAnnotationList.TrySaveAnnotationAsync(contactAnnotation);
        }

async void Cleanup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario1_CreateContact.xaml.cs.

        {
            ContactList list = await GetContactListAsync();

            Contact contact = await list.GetContactFromRemoteIdAsync(Constants.ContactRemoteId);

            if (contact != null)
            {
                // Request unpin
                if (!await PinnedContactManager.GetDefault().RequestUnpinContactAsync(contact, PinnedContactSurface.Taskbar))
                {
                    // User decided to keep the contact on the taskbar.
                    // Don't delete the contact after all.
                    return;
                }
            }

            // The contact is unpinned (or doesn't exist). Clean up the contact list.
            await list.DeleteAsync();
        }

async Task<Contact> CreateContactAsync ( ) [inline, private]

Definition at line 64 of file Scenario1_CreateContact.xaml.cs.

        {
            // Get the contact list for this app.
            ContactList list = await GetContactListAsync();

            // Check if the sample contact already exists.
            Contact contact = await list.GetContactFromRemoteIdAsync(Constants.ContactRemoteId);

            if (contact == null)
            {
                // Create the sample contact.
                contact = new Contact();
                contact.FirstName = Constants.ContactFirstName;
                contact.LastName = Constants.ContactLastName;
                contact.RemoteId = Constants.ContactRemoteId;
                contact.Emails.Add(new ContactEmail { Address = Constants.ContactEmail });
                contact.Phones.Add(new ContactPhone { Number = Constants.ContactPhone });
                contact.SourceDisplayPicture = RandomAccessStreamReference.CreateFromUri(new Uri(Constants.ContactImageSource));

                await list.SaveContactAsync(contact);
            }

            return contact;
        }

async Task<ContactList> GetContactListAsync ( ) [inline, private]

Definition at line 138 of file Scenario1_CreateContact.xaml.cs.

        {
            ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);

            // Find the contact list by name. (GetContactListAsync looks up a contact list by its ID.)
            IReadOnlyList<ContactList> lists = await store.FindContactListsAsync();
            ContactList sampleList = null;
            foreach (ContactList list in lists)
            {
                if (list.DisplayName == Constants.ContactListName)
                {
                    sampleList = list;
                    break;
                }
            }

            if (sampleList == null)
            {
                sampleList = await store.CreateContactListAsync(Constants.ContactListName);
            }

            return sampleList;
        }

async void Pin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario1_CreateContact.xaml.cs.

        {
            Contact contact = await CreateContactAsync();

            await AnnotateContactAsync(contact);

            await PinContactAsync(contact);
        }

async Task PinContactAsync ( Contact contact ) [inline, private]

Definition at line 117 of file Scenario1_CreateContact.xaml.cs.

        {
            // Get the PinnedContactManager for the current user.
            PinnedContactManager pinnedContactManager = PinnedContactManager.GetDefault();

            // Check whether pinning to the taskbar is supported.
            if (!pinnedContactManager.IsPinSurfaceSupported(PinnedContactSurface.Taskbar))
            {
                // If not, then there is nothing for this program to do.
                rootPage.NotifyUser("The system does not support pinning contacts to the taskbar.", NotifyType.ErrorMessage);
                return;
            }

            // Pin the contact to the taskbar.
            if (!await pinnedContactManager.RequestPinContactAsync(contact, PinnedContactSurface.Taskbar))
            {
                // Contact was not pinned.
                return;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario1_CreateContact.xaml.cs.

The documentation for this class was generated from the following file:
  • ContactPanel/cs/Scenario1_CreateContact.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CreateContacts Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_CreateContacts
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_CreateContacts Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_CreateContacts ()

Private Member Functions

async Task< ContactAnnotationList > | _GetContactAnnotationList ()
async Task< ContactList > | _GetContactList ()
async void | CreateTestContacts ()
async void | DeleteTestContacts ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_CreateContacts.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CreateContacts ( ) [inline]

Definition at line 29 of file Scenario1_CreateContacts.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<ContactAnnotationList> _GetContactAnnotationList ( ) [inline, private]

Definition at line 57 of file Scenario1_CreateContacts.xaml.cs.

        {
            ContactAnnotationStore annotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);
            if (null == annotationStore)
            {
                rootPage.NotifyUser("Unable to get an annotations store.", NotifyType.ErrorMessage);
                return null;
            }

            ContactAnnotationList annotationList;
            IReadOnlyList<ContactAnnotationList> annotationLists = await annotationStore.FindAnnotationListsAsync();
            if (0 == annotationLists.Count)
            {
                annotationList = await annotationStore.CreateAnnotationListAsync();
            }
            else
            {
                annotationList = annotationLists[0];
            }

            return annotationList;
        }

async Task<ContactList> _GetContactList ( ) [inline, private]

Definition at line 34 of file Scenario1_CreateContacts.xaml.cs.

        {
            ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
            if (null == store)
            {
                rootPage.NotifyUser("Unable to get a contacts store.", NotifyType.ErrorMessage);
                return null;
            }

            ContactList contactList;
            IReadOnlyList<ContactList> contactLists = await store.FindContactListsAsync();
            if (0 == contactLists.Count)
            {
                contactList = await store.CreateContactListAsync("TestContactList");
            }
            else
            {
                contactList = contactLists[0];
            }

            return contactList;
        }

async void CreateTestContacts ( ) [inline, private]

Definition at line 80 of file Scenario1_CreateContacts.xaml.cs.

        {
            //
            // Creating two test contacts with email address and phone number.
            //

            Contact contact1 = new Contact();
            contact1.FirstName = "TestContact1";

            ContactEmail email1 = new ContactEmail();
            email1.Address = "TestContact1@contoso.com";
            contact1.Emails.Add(email1);

            ContactPhone phone1 = new ContactPhone();
            phone1.Number = "4255550100";
            contact1.Phones.Add(phone1);

            Contact contact2 = new Contact();
            contact2.FirstName = "TestContact2";

            ContactEmail email2 = new ContactEmail();
            email2.Address = "TestContact2@contoso.com";
            email2.Kind = ContactEmailKind.Other;
            contact2.Emails.Add(email2);

            ContactPhone phone2 = new ContactPhone();
            phone2.Number = "4255550101";
            phone2.Kind = ContactPhoneKind.Mobile;
            contact2.Phones.Add(phone2);

            // Save the contacts
            ContactList contactList = await _GetContactList();
            if (null == contactList)
            {
                return;
            }

            await contactList.SaveContactAsync(contact1);
            await contactList.SaveContactAsync(contact2);

            //
            // Create annotations for those test contacts.
            // Annotation is the contact meta data that allows People App to generate deep links
            // in the contact card that takes the user back into this app.
            //

            ContactAnnotationList annotationList = await _GetContactAnnotationList();
            if (null == annotationList)
            {
                return;
            }

            ContactAnnotation annotation = new ContactAnnotation();
            annotation.ContactId = contact1.Id;

            // Remote ID: The identifier of the user relevant for this app. When this app is
            // launched into from the People App, this id will be provided as context on which user
            // the operation (e.g. ContactProfile) is for.
            annotation.RemoteId = "user12";

            // The supported operations flags indicate that this app can fulfill these operations
            // for this contact. These flags are read by apps such as the People App to create deep
            // links back into this app. This app must also be registered for the relevant
            // protocols in the Package.appxmanifest (in this case, ms-contact-profile).
            annotation.SupportedOperations = ContactAnnotationOperations.ContactProfile;

            if (!await annotationList.TrySaveAnnotationAsync(annotation))
            {
                rootPage.NotifyUser("Failed to save annotation for TestContact1 to the store.", NotifyType.ErrorMessage);
                return;
            }

            annotation = new ContactAnnotation();
            annotation.ContactId = contact2.Id;
            annotation.RemoteId = "user22";

            // You can also specify multiple supported operations for a contact in a single
            // annotation. In this case, this annotation indicates that the user can be
            // communicated via VOIP call, Video Call, or IM via this application.
            annotation.SupportedOperations = ContactAnnotationOperations.Message |
                ContactAnnotationOperations.AudioCall |
                ContactAnnotationOperations.VideoCall;

            if (!await annotationList.TrySaveAnnotationAsync(annotation))
            {
                rootPage.NotifyUser("Failed to save annotation for TestContact2 to the store.", NotifyType.ErrorMessage);
                return;
            }

            rootPage.NotifyUser("Sample data created successfully.", NotifyType.StatusMessage);
        }

async void DeleteTestContacts ( ) [inline, private]

Definition at line 172 of file Scenario1_CreateContacts.xaml.cs.

        {
            ContactList contactList = null;
            ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
            if (null != store)
            {
                IReadOnlyList<ContactList> contactLists = await store.FindContactListsAsync();
                if (0 < contactLists.Count)
                {
                    contactList = contactLists[0];
                }
            }

            if (null != contactList)
            {
                await contactList.DeleteAsync();
                rootPage.NotifyUser("Sample data deleted.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Could not delete sample data.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario1_CreateContacts.xaml.cs.

The documentation for this class was generated from the following file:
  • ContactCardIntegration/cs/Scenario1_CreateContacts.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CreateTile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_CreateTile
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_CreateTile Class Reference

List of all members.

Public Member Functions

Scenario1_CreateTile ()

Private Member Functions

async void | CreateSecondaryTile ()
string | GenerateTileId ()
void | GetFromFile ()
void | GetFromPackage ()
float | ParseFloatOrDefault (string input)
async void | PickFile ()
void | UpdateSourceRun ()

Private Attributes

string | glbName = string.Empty
Uri | glbUri
string | lastFileName = string.Empty
Uri | lastFileUri
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_CreateTile.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CreateTile ( ) [inline]

Definition at line 34 of file Scenario1_CreateTile.xaml.cs.

        {
            this.InitializeComponent();
            GetFromPackage();
        }

Member Function Documentation

async void CreateSecondaryTile ( ) [inline, private]

Definition at line 116 of file Scenario1_CreateTile.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            if (glbUri == null)
            {
                rootPage.NotifyUser("Please pick content to be shown.", NotifyType.ErrorMessage);
                return;
            }

            // Create a guid to use as a unique tile id
            string tileId = GenerateTileId();

            var logoUri = new Uri("ms-appx:///Assets/squareTile-sdk.png");
            var tile = new SecondaryTile(
                    tileId, // TileId
                    glbName, // Display Name
                    tileId, // Arguments
                    logoUri, // Square150x150Logo
                    TileSize.Square150x150); // DesiredSize

            // Set the mixed reality model properties.
            TileMixedRealityModel model = tile.VisualElements.MixedRealityModel;

            model.Uri = glbUri;

            if (BoundingBoxCheckBox.IsChecked.Value)
            {
                var boundingBox = new SpatialBoundingBox();
                boundingBox.Center = new Vector3(
                    ParseFloatOrDefault(BoundingBoxCenterXTextBox.Text),
                    ParseFloatOrDefault(BoundingBoxCenterYTextBox.Text),
                    ParseFloatOrDefault(BoundingBoxCenterZTextBox.Text));
                boundingBox.Extents = new Vector3(
                    ParseFloatOrDefault(BoundingBoxExtentsXTextBox.Text),
                    ParseFloatOrDefault(BoundingBoxExtentsYTextBox.Text),
                    ParseFloatOrDefault(BoundingBoxExtentsZTextBox.Text));
                model.BoundingBox = boundingBox;
            }

            // Create the tile
            bool created = await tile.RequestCreateAsync();
            if (created)
            {
                // Warn the user that they need to be in the headset for anything interesting to happen.
                if (!HolographicApplicationPreview.IsCurrentViewPresentedOnHolographicDisplay())
                {
                    rootPage.NotifyUser("3D content can be created only while the view is being displayed in a Mixed Reality headset.", NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Could not create secondary tile.", NotifyType.ErrorMessage);
            }
        }

string GenerateTileId ( ) [inline, private]

Definition at line 100 of file Scenario1_CreateTile.xaml.cs.

        {
            // Tile IDs consist of up to 64 alphanumerics, underscore, and period.
            // Create a guid to use as a unique tile id. Use "N" format so it consists
            // solely of hex digits with no extra punctuation.
            Guid guid = Guid.NewGuid();
            return guid.ToString("N");
        }

void GetFromFile ( ) [inline, private]

Definition at line 55 of file Scenario1_CreateTile.xaml.cs.

        {
            glbUri = lastFileUri;
            glbName = lastFileName;
            UpdateSourceRun();
        }

void GetFromPackage ( ) [inline, private]

Definition at line 48 of file Scenario1_CreateTile.xaml.cs.

        {
            glbUri = new Uri("ms-appx:///glb/microsoft-logo.glb");
            glbName = "Microsoft logo";
            UpdateSourceRun();
        }

float ParseFloatOrDefault ( string input ) [inline, private]

Definition at line 109 of file Scenario1_CreateTile.xaml.cs.

        {
            float parsed = 0.0f;
            float.TryParse(input, out parsed);
            return parsed;
        }

async void PickFile ( ) [inline, private]

Definition at line 62 of file Scenario1_CreateTile.xaml.cs.

        {
            var picker = new FileOpenPicker();
            picker.ViewMode = PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = PickerLocationId.Objects3D;
            picker.FileTypeFilter.Add(".glb");

            var file = await picker.PickSingleFileAsync();
            if (file == null)
            {
                return;
            }

            // ms-appdata content must be of the form ms-appdata:///local/...
            // Copy the picked file into our local folder.

            const string SpecialFolder = "tilecontent";
            try
            {
                StorageFolder folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(SpecialFolder,
                    CreationCollisionOption.OpenIfExists);
                file = await file.CopyAsync(folder, file.Name, NameCollisionOption.ReplaceExisting);
            }
            catch
            {
                // File I/O errors are reported as exceptions.
                rootPage.NotifyUser("Could not copy file to local storage.", NotifyType.ErrorMessage);
                return;
            }

            // Escape the file name in case it contains special characters.
            lastFileUri = new Uri($"ms-appdata:///local/{SpecialFolder}/{Uri.EscapeDataString(file.Name)}");
            lastFileName = file.DisplayName;
            glbUri = lastFileUri;
            glbName = lastFileName;
            UpdateSourceRun();
        }

void UpdateSourceRun ( ) [inline, private]

Definition at line 40 of file Scenario1_CreateTile.xaml.cs.

        {
            if (GlbSourceRun != null)
            {
                GlbSourceRun.Text = glbUri == null ? String.Empty : glbUri.OriginalString;
            }
        }

Member Data Documentation

string glbName = string.Empty [private]

Definition at line 28 of file Scenario1_CreateTile.xaml.cs.

Uri glbUri [private]

Definition at line 29 of file Scenario1_CreateTile.xaml.cs.

string lastFileName = string.Empty [private]

Definition at line 31 of file Scenario1_CreateTile.xaml.cs.

Uri lastFileUri [private]

Definition at line 32 of file Scenario1_CreateTile.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario1_CreateTile.xaml.cs.

The documentation for this class was generated from the following file:
  • MixedRealityModel/cs/Scenario1_CreateTile.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CurrentActivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_CurrentActivity
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_CurrentActivity Class Reference

List of all members.

Public Member Functions

Scenario1_CurrentActivity ()

Private Member Functions

async void | ScenarioGetCurrentActivity (object sender, RoutedEventArgs e)

Private Attributes

Guid | ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196")
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario1_CurrentActivity.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CurrentActivity ( ) [inline]

Definition at line 29 of file Scenario1_CurrentActivity.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ScenarioGetCurrentActivity | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Get Current Activity' button.

Parameters:
sender
e

Definition at line 39 of file Scenario1_CurrentActivity.xaml.cs.

        {
            // Reset fields and status
            ScenarioOutput_Activity.Text = "No data";
            ScenarioOutput_Confidence.Text = "No data";
            ScenarioOutput_Timestamp.Text = "No data";
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Determine if we can access activity sensors
            var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
            if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                // Get the default sensor
                var activitySensor = await ActivitySensor.GetDefaultAsync();
                if (activitySensor != null)
                {
                    // Get the current activity reading
                    var reading = await activitySensor.GetCurrentReadingAsync();
                    if (reading != null)
                    {
                        ScenarioOutput_Activity.Text = reading.Activity.ToString();
                        ScenarioOutput_Confidence.Text = reading.Confidence.ToString();
                        ScenarioOutput_Timestamp.Text = reading.Timestamp.ToString("u");
                    }
                }
                else
                {
                    rootPage.NotifyUser("No activity sensor found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196") [private]

Definition at line 27 of file Scenario1_CurrentActivity.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario1_CurrentActivity.xaml.cs.

The documentation for this class was generated from the following files:
  • ActivitySensor/cs/Scenario1_CurrentActivity.xaml.cs
  • ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Data Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Data
Public Member Functions | Private Member Functions

Scenario1_Data Class Reference

List of all members.

Public Member Functions

Scenario1_Data ()

Private Member Functions

string | ReportCalendarData (Calendar calendar, string calendarLabel)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_Data.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Data ( ) [inline]

Definition at line 21 of file Scenario1_Data.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportCalendarData | ( | Calendar | calendar,
 |  | string | calendarLabel |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario1_Data.xaml.cs.

        {
            string results = calendarLabel + ": " + calendar.GetCalendarSystem() + "\n";
            results += "Name of Month: " + calendar.MonthAsSoloString() + "\n";
            results += "Day of Month: " + calendar.DayAsPaddedString(2) + "\n";
            results += "Day of Week: " + calendar.DayOfWeekAsSoloString() + "\n";
            results += "Year: " + calendar.YearAsString() + "\n";
            results += "\n";
            return results;
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario1_Data.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.Calendar class to display the parts of a date.

            // Create Calendar objects using different constructors.
            Calendar calendar = new Calendar();
            Calendar japaneseCalendar = new Calendar(new[] { "ja-JP" }, CalendarIdentifiers.Japanese, ClockIdentifiers.TwelveHour);
            Calendar hebrewCalendar = new Calendar(new[] { "he-IL" }, CalendarIdentifiers.Hebrew, ClockIdentifiers.TwentyFourHour);

            // Display the results
            OutputTextBlock.Text =
                ReportCalendarData(calendar, "User's default calendar system") +
                ReportCalendarData(japaneseCalendar, "Calendar system") +
                ReportCalendarData(hebrewCalendar, "Calendar system");
        }

The documentation for this class was generated from the following files:
  • Calendar/cs/Scenario1_Data.xaml.cs
  • Calendar/cpp/Scenario1_Data.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()
Scenario1_DataEvents ()
Scenario1_DataEvents ()
Scenario1_DataEvents ()
Scenario1_DataEvents ()
Scenario1_DataEvents ()
Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, AccelerometerReadingChangedEventArgs e)
async void | ReadingChanged (object sender, BarometerReadingChangedEventArgs e)
async void | ReadingChanged (object sender, MagnetometerReadingChangedEventArgs e)
async void | ReadingChanged (object sender, OrientationSensorReadingChangedEventArgs e)
async void | ReadingChanged (object sender, AltimeterReadingChangedEventArgs e)
async void | ReadingChanged (HumanPresenceSensor sender, HumanPresenceSensorReadingChangedEventArgs e)
async void | ReadingChanged (object sender, CompassReadingChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioDisable ()
void | ScenarioDisable ()
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | ScenarioEnable ()
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | ScenarioEnable ()
void | ScenarioEnable (object sender, RoutedEventArgs e)
async void | ScenarioGetSensor_Click (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

Accelerometer | _accelerometer
Compass | _compass
uint _desiredReportInterval
Magnetometer | _magnetometer
OrientationSensor | _sensor
uint desiredReportIntervalMs
MainPage rootPage = MainPage.Current
HumanPresenceSensor | sensor
Altimeter | sensor
Barometer | sensor

Detailed Description

Definition at line 21 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 29 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 32 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            sensor = Altimeter.GetDefault();
            if (null != sensor)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportIntervalMs = sensor.MinimumReportInterval;
                desiredReportIntervalMs = minReportIntervalMs > 1000 ? minReportIntervalMs : 1000;
            }
            else
            {
                rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
            }
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 32 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            sensor = Barometer.GetDefault();
            if (null != sensor)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportIntervalMs = sensor.MinimumReportInterval;
                desiredReportIntervalMs = minReportIntervalMs > 1000 ? minReportIntervalMs : 1000;
            }
            else
            {
                rootPage.NotifyUser("No barometer found", NotifyType.ErrorMessage);
            }
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 32 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _compass = Compass.GetDefault();
            if (_compass != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _compass.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
            }
            else
            {
                rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
            }
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 31 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _magnetometer = Magnetometer.GetDefault();
            if (_magnetometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _magnetometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
            }
            else
            {
                rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
            }
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_DataEvents ( ) [inline]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario1_DataEvents.xaml.cs.

        {
            if (sensor != null)
            {
                sensor.ReadingChanged -= ReadingChanged;
                sensor = null;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_DataEvents.xaml.cs.

        {
            _accelerometer = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
            if (_accelerometer != null)
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 55 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 55 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 55 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 54 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario1_DataEvents.xaml.cs.

        {
            _sensor = OrientationSensor.GetDefault(rootPage.SensorReadingType, rootPage.SensorOptimizationGoal);
            if (_sensor != null)
            {
                rootPage.NotifyUser(rootPage.SensorDescription + " is ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.SensorDescription + " not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 69 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                sensor.ReadingChanged -= new TypedEventHandler<Altimeter, AltimeterReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                sensor.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 69 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                _compass.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 68 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= VisibilityChanged;
                _magnetometer.ReadingChanged -= ReadingChanged;

                // Restore the default report interval to release resources while the sensor is not in use
                _magnetometer.ReportInterval = 0;
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 69 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                sensor.ReadingChanged -= new TypedEventHandler<Barometer, BarometerReadingChangedEventArgs>(ReadingChanged);

                // Restore the default report interval to release resources while the sensor is not in use
                sensor.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | AccelerometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 86 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.SetReadingText(ScenarioOutput, e.Reading);
            });
        }

async void ReadingChanged | ( | object | sender,
 |  | BarometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 113 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                BarometerReading reading = e.Reading;
                ScenarioOutput_hPa.Text = String.Format("{0,5:0.00}", reading.StationPressureInHectopascals);
            });
        }

async void ReadingChanged | ( | object | sender,
 |  | OrientationSensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 87 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.SetReadingText(ScenarioOutput, e.Reading);
            });
        }

async void ReadingChanged | ( | HumanPresenceSensor | sender,
 |  | HumanPresenceSensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                HumanPresenceSensorReading reading = e.Reading;
                if (null != reading)
                {
                    if (sensor.IsEngagementSupported)
                    {
                        EngagementStateTextBlock.Text = reading.Engagement.ToString();
                    }
                    else
                    {
                        EngagementStateTextBlock.Text = "Not Supported";
                    }

                    if (sensor.IsPresenceSupported)
                    {
                        DetectionStateTextBlock.Text = reading.Presence.ToString();
                    }
                    else
                    {
                        DetectionStateTextBlock.Text = "Not Supported";
                    }

                    // Show the detection distance, if available
                    DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();

                    TimestampTextBlock.Text = reading.Timestamp.ToString("u");
                }
            });
        }

async void ReadingChanged | ( | object | sender,
 |  | AltimeterReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 113 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AltimeterReading reading = e.Reading;
                ScenarioOutput_M.Text = String.Format("{0,5:0.00}", reading.AltitudeChangeInMeters);
            });
        }

async void ReadingChanged | ( | object | sender,
 |  | CompassReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 113 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                CompassReading reading = e.Reading;
                ScenarioOutput_MagneticNorth.Text = String.Format("{0,5:0.00}", reading.HeadingMagneticNorth);
                if (reading.HeadingTrueNorth != null)
                {
                    ScenarioOutput_TrueNorth.Text = String.Format("{0,5:0.00}", reading.HeadingTrueNorth);
                }
                else
                {
                    ScenarioOutput_TrueNorth.Text = "No data";
                }
                switch (reading.HeadingAccuracy)
                {
                    case MagnetometerAccuracy.Unknown:
                        ScenarioOutput_HeadingAccuracy.Text = "Unknown";
                        break;
                    case MagnetometerAccuracy.Unreliable:
                        ScenarioOutput_HeadingAccuracy.Text = "Unreliable";
                        break;
                    case MagnetometerAccuracy.Approximate:
                        ScenarioOutput_HeadingAccuracy.Text = "Approximate";
                        break;
                    case MagnetometerAccuracy.High:
                        ScenarioOutput_HeadingAccuracy.Text = "High";
                        break;
                    default:
                        ScenarioOutput_HeadingAccuracy.Text = "No data";
                        break;
                }
            });
        }

async void ReadingChanged | ( | object | sender,
 |  | MagnetometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 110 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MagnetometerReading reading = e.Reading;
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.MagneticFieldX);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.MagneticFieldY);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.MagneticFieldZ);
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 151 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            sensor.ReadingChanged -= new TypedEventHandler<Barometer, BarometerReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 113 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;
            _sensor.ReadingChanged -= ReadingChanged;

            // Restore the default report interval to release resources while the sensor is not in use
            _sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 177 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            _compass.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 151 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            sensor.ReadingChanged -= new TypedEventHandler<Altimeter, AltimeterReadingChangedEventArgs>(ReadingChanged);

            // Restore the default report interval to release resources while the sensor is not in use
            sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 112 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;
            _accelerometer.ReadingChanged -= ReadingChanged;

            // Restore the default report interval to release resources while the sensor is not in use
            _accelerometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 150 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;
            _magnetometer.ReadingChanged -= ReadingChanged;

            // Restore the default report interval to release resources while the sensor is not in use
            _magnetometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 97 of file Scenario1_DataEvents.xaml.cs.

        {
            // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
            _accelerometer.ReportInterval = Math.Max(_accelerometer.MinimumReportInterval, 16);

            Window.Current.VisibilityChanged += VisibilityChanged;
            _accelerometer.ReadingChanged += ReadingChanged;

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 153 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_compass != null)
            {
                // Establish the report interval
                _compass.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
            }
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 98 of file Scenario1_DataEvents.xaml.cs.

        {
            // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
            _sensor.ReportInterval = Math.Max(_sensor.MinimumReportInterval, 16);

            Window.Current.VisibilityChanged += VisibilityChanged;
            _sensor.ReadingChanged += ReadingChanged;

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 127 of file Scenario1_DataEvents.xaml.cs.

        {
            if (null != sensor)
            {
                // Establish the report interval
                sensor.ReportInterval = desiredReportIntervalMs;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                sensor.ReadingChanged += new TypedEventHandler<Altimeter, AltimeterReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
            }
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 127 of file Scenario1_DataEvents.xaml.cs.

        {
            if (null != sensor)
            {
                // Establish the report interval
                sensor.ReportInterval = desiredReportIntervalMs;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                sensor.ReadingChanged += new TypedEventHandler<Barometer, BarometerReadingChangedEventArgs>(ReadingChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No barometer found", NotifyType.ErrorMessage);
            }
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 126 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_magnetometer != null)
            {
                // Establish the report interval
                _magnetometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += VisibilityChanged;
                _magnetometer.ReadingChanged += ReadingChanged;

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
            }
        }

async void ScenarioGetSensor_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario1_DataEvents.xaml.cs.

        {
            // Disable the button so the user can't click it again while we are already working.
            GetSensorButton.IsEnabled = false;

            // Clear any previous message.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Try to get the default presence sensor.
            try
            {
                sensor = await HumanPresenceSensor.GetDefaultAsync();
            }
            catch (UnauthorizedAccessException)
            {
                // The user denied this app presence sensor access.
                sensor = null;
            }
            GetSensorButton.IsEnabled = true;

            if (sensor != null)
            {
                VisualStateManager.GoToState(this, "Ready", true);

                // Begin listening for data reports.
                sensor.ReadingChanged += ReadingChanged;
            }
            else
            {
                rootPage.NotifyUser("No presence sensor found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 88 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _magnetometer.ReadingChanged += ReadingChanged;
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _magnetometer.ReadingChanged -= ReadingChanged;
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 91 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    sensor.ReadingChanged += new TypedEventHandler<Barometer, BarometerReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    sensor.ReadingChanged -= new TypedEventHandler<Barometer, BarometerReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 91 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    sensor.ReadingChanged += new TypedEventHandler<Altimeter, AltimeterReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    sensor.ReadingChanged -= new TypedEventHandler<Altimeter, AltimeterReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 91 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 64 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _accelerometer.ReadingChanged += ReadingChanged;
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _accelerometer.ReadingChanged -= ReadingChanged;
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 65 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _sensor.ReadingChanged += ReadingChanged;
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _sensor.ReadingChanged -= ReadingChanged;
                }
            }
        }

Member Data Documentation

Accelerometer _accelerometer [private]

Definition at line 27 of file Scenario1_DataEvents.xaml.cs.

Compass _compass [private]

Definition at line 29 of file Scenario1_DataEvents.xaml.cs.

uint _desiredReportInterval [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

Magnetometer _magnetometer [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

OrientationSensor _sensor [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

uint desiredReportIntervalMs [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_DataEvents.xaml.cs.

HumanPresenceSensor sensor [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

Altimeter sensor [private]

Definition at line 29 of file Scenario1_DataEvents.xaml.cs.

Barometer sensor [private]

Definition at line 29 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario1_DataEvents.xaml.cs
  • Altimeter/cs/Scenario1_DataEvents.xaml.cs
  • Barometer/cs/Scenario1_DataEvents.xaml.cs
  • Compass/cs/Scenario1_DataEvents.xaml.cs
  • Magnetometer/cs/Scenario1_DataEvents.xaml.cs
  • OrientationSensor/cs/Scenario1_DataEvents.xaml.cs
  • PresenceSensor/cs/Scenario1_DataEvents.xaml.cs
  • Accelerometer/cpp/Scenario1_DataEvents.xaml.cpp
  • Altimeter/cpp/Scenario1_DataEvents.xaml.cpp
  • Barometer/cpp/Scenario1_DataEvents.xaml.cpp
  • Compass/cpp/Scenario1_DataEvents.xaml.cpp
  • CustomSensors/cpp/Scenario1_DataEvents.xaml.cpp
  • Gyrometer/cpp/Scenario1_DataEvents.xaml.cpp
  • Inclinometer/cpp/Scenario1_DataEvents.xaml.cpp
  • LightSensor/cpp/Scenario1_DataEvents.xaml.cpp
  • OrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp
  • ProximitySensor/cpp/Scenario1_DataEvents.xaml.cpp
  • RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.cpp
  • SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Default Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Default
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Default Class Reference

List of all members.

Public Member Functions

Scenario1_Default ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisableButtons ()
void | DisableNonSquarePARProfiles ()
async void | EnableButtons ()
void | EnableNonSquarePARProfiles ()
void | GetPresetProfile (ComboBox combobox)
void | InputPauseButton_Click (Object sender, RoutedEventArgs e)
void | InputPlayButton_Click (Object sender, RoutedEventArgs e)
void | InputStopButton_Click (Object sender, RoutedEventArgs e)
void | OnTargetFormatChanged (object sender, SelectionChangedEventArgs e)
async void | OutputPathText (string text)
void | OutputPauseButton_Click (Object sender, RoutedEventArgs e)
void | OutputPlayButton_Click (Object sender, RoutedEventArgs e)
void | OutputStopButton_Click (Object sender, RoutedEventArgs e)
async void | OutputText (string text)
async void | PickFile (object sender, RoutedEventArgs e)
async void | PickOutput (object sender, RoutedEventArgs e)
async void | PlayFile (StorageFile MediaFile)
async void | SetCancelButton (bool isEnabled)
async void | SetOutputFileButton (bool isEnabled)
async void | SetPickFileButton (bool isEnabled)
async void | SetTranscodeButton (bool isEnabled)
async void | StopPlayers ()
async void | TranscodeCancel (object sender, RoutedEventArgs e)
async void | TranscodeComplete ()
async void | TranscodeError (string error)
async void | TranscodeFailure (TranscodeFailureReason reason)
async void | TranscodePreset (Object sender, RoutedEventArgs e)
void | TranscodeProgress (double percent)

Private Attributes

CancellationTokenSource | _cts
CoreDispatcher | _dispatcher = Window.Current.Dispatcher
StorageFile | _InputFile = null
StorageFile | _OutputFile = null
string | _OutputFileExtension = ".mp4"
string | _OutputFileName = "TranscodeSampleOutput"
string | _OutputType = "MP4"
MediaEncodingProfile | _Profile
MediaTranscoder | _Transcoder = new MediaTranscoder()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario1_Default.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Default ( ) [inline]

Definition at line 42 of file Scenario1_Default.xaml.cs.

        {
            this.InitializeComponent();
            _cts = new CancellationTokenSource();

            // Hook up UI
            PickFileButton.Click += new RoutedEventHandler(PickFile);
            SetOutputButton.Click += new RoutedEventHandler(PickOutput);
            TargetFormat.SelectionChanged += new SelectionChangedEventHandler(OnTargetFormatChanged);
            Transcode.Click += new RoutedEventHandler(TranscodePreset);
            Cancel.Click += new RoutedEventHandler(TranscodeCancel);

            // Media Controls
            InputPlayButton.Click += new RoutedEventHandler(InputPlayButton_Click);
            InputPauseButton.Click += new RoutedEventHandler(InputPauseButton_Click);
            InputStopButton.Click += new RoutedEventHandler(InputStopButton_Click);
            OutputPlayButton.Click += new RoutedEventHandler(OutputPlayButton_Click);
            OutputPauseButton.Click += new RoutedEventHandler(OutputPauseButton_Click);
            OutputStopButton.Click += new RoutedEventHandler(OutputStopButton_Click);

            // File is not selected, disable all buttons but PickFileButton
            DisableButtons();
            SetPickFileButton(true);
            SetOutputFileButton(true);
            SetCancelButton(false);
        }

Member Function Documentation

void DisableButtons ( ) [inline, private]

Definition at line 403 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ProfileSelect.IsEnabled = false;
                Transcode.IsEnabled = false;
                PickFileButton.IsEnabled = false;
                SetOutputButton.IsEnabled = false;
                TargetFormat.IsEnabled = false;
                EnableMrfCrf444.IsEnabled = false;
            });
        }

void DisableNonSquarePARProfiles ( ) [inline, private]

Definition at line 422 of file Scenario1_Default.xaml.cs.

        {
            ComboBoxItem_NTSC.IsEnabled = false;
            ComboBoxItem_PAL.IsEnabled = false;

            // Ensure a valid profile is set
            if ((ProfileSelect.SelectedIndex == 3) || (ProfileSelect.SelectedIndex == 4))
            {
                ProfileSelect.SelectedIndex = 2;
            }
        }

void Dispose ( ) [inline]

Definition at line 69 of file Scenario1_Default.xaml.cs.

        {
            _cts.Dispose();
        }

void EnableButtons ( ) [inline, private]

Definition at line 387 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = true;
                SetOutputButton.IsEnabled = true;
                TargetFormat.IsEnabled = true;
                ProfileSelect.IsEnabled = true;
                EnableMrfCrf444.IsEnabled = true;

                // The transcode button's initial state should be disabled until an output
                // file has been set.
                Transcode.IsEnabled = false;
            });
        }

void EnableNonSquarePARProfiles ( ) [inline, private]

Definition at line 416 of file Scenario1_Default.xaml.cs.

        {
            ComboBoxItem_NTSC.IsEnabled = true;
            ComboBoxItem_PAL.IsEnabled = true;
        }

void GetPresetProfile ( ComboBox combobox ) [inline, private]

Definition at line 131 of file Scenario1_Default.xaml.cs.

        {
            _Profile = null;
            VideoEncodingQuality videoEncodingProfile = VideoEncodingQuality.Wvga;
            switch (combobox.SelectedIndex)
            {
                case 0:
                    videoEncodingProfile = VideoEncodingQuality.HD1080p;
                    break;
                case 1:
                    videoEncodingProfile = VideoEncodingQuality.HD720p;
                    break;
                case 2:
                    videoEncodingProfile = VideoEncodingQuality.Wvga;
                    break;
                case 3:
                    videoEncodingProfile = VideoEncodingQuality.Ntsc;
                    break;
                case 4:
                    videoEncodingProfile = VideoEncodingQuality.Pal;
                    break;
                case 5:
                    videoEncodingProfile = VideoEncodingQuality.Vga;
                    break;
                case 6:
                    videoEncodingProfile = VideoEncodingQuality.Qvga;
                    break;
            }

            switch (_OutputType)
            {
                case "AVI":
                    _Profile = MediaEncodingProfile.CreateAvi(videoEncodingProfile);
                    break;
                case "WMV":
                    _Profile = MediaEncodingProfile.CreateWmv(videoEncodingProfile);
                    break;
                default:
                    _Profile = MediaEncodingProfile.CreateMp4(videoEncodingProfile);
                    break;
            }

            /*
            For transcoding to audio profiles, create the encoding profile using one of these APIs:
                MediaEncodingProfile.CreateMp3(audioEncodingProfile)
                MediaEncodingProfile.CreateM4a(audioEncodingProfile)
                MediaEncodingProfile.CreateWma(audioEncodingProfile)
                MediaEncodingProfile.CreateWav(audioEncodingProfile)

            where audioEncodingProfile is one of these presets:
                AudioEncodingQuality.High
                AudioEncodingQuality.Medium
                AudioEncodingQuality.Low
            */
        }

void InputPauseButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 329 of file Scenario1_Default.xaml.cs.

        {
            InputVideo.Pause();
        }

void InputPlayButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 313 of file Scenario1_Default.xaml.cs.

        {
            if (InputVideo.DefaultPlaybackRate == 0)
            {
                InputVideo.DefaultPlaybackRate = 1.0;
                InputVideo.PlaybackRate = 1.0;
            }

            InputVideo.Play();
        }

void InputStopButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 324 of file Scenario1_Default.xaml.cs.

        {
            InputVideo.Stop();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 79 of file Scenario1_Default.xaml.cs.

        {
        }

void OnTargetFormatChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 289 of file Scenario1_Default.xaml.cs.

        {
            switch (TargetFormat.SelectedIndex)
            {
                case 1:
                    _OutputType = "WMV";
                    _OutputFileExtension = ".wmv";
                    EnableNonSquarePARProfiles();
                    break;
                case 2:
                    _OutputType = "AVI";
                    _OutputFileExtension = ".avi";

                    // Disable NTSC and PAL profiles as non-square pixel aspect ratios are not supported by AVI
                    DisableNonSquarePARProfiles();
                    break;
                default:
                    _OutputType = "MP4";
                    _OutputFileExtension = ".mp4";
                    EnableNonSquarePARProfiles();
                    break;
            }
        }

async void OutputPathText ( string text ) [inline, private]

Definition at line 487 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                OutputPath.Text = text;
            });
        }

void OutputPauseButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 350 of file Scenario1_Default.xaml.cs.

        {
            OutputVideo.Pause();
        }

void OutputPlayButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 334 of file Scenario1_Default.xaml.cs.

        {
            if (OutputVideo.DefaultPlaybackRate == 0)
            {
                OutputVideo.DefaultPlaybackRate = 1.0;
                OutputVideo.PlaybackRate = 1.0;
            }

            OutputVideo.Play();
        }

void OutputStopButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 345 of file Scenario1_Default.xaml.cs.

        {
            OutputVideo.Stop();
        }

async void OutputText ( string text ) [inline, private]

Definition at line 478 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                OutputMsg.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
                OutputMsg.Text = text;
            });
        }

async void PickFile | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 253 of file Scenario1_Default.xaml.cs.

        {
            FileOpenPicker picker = new FileOpenPicker();
            picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".wmv");
            picker.FileTypeFilter.Add(".mp4");

            StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);

                _InputFile = file;
                InputVideo.SetSource(stream, file.ContentType);
                InputVideo.Play();

                // Enable buttons
                EnableButtons();
            }
        }

async void PickOutput | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 274 of file Scenario1_Default.xaml.cs.

        {
            FileSavePicker picker = new FileSavePicker();
            picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            picker.SuggestedFileName = _OutputFileName;
            picker.FileTypeChoices.Add(_OutputType, new System.Collections.Generic.List<string>() { _OutputFileExtension });

            _OutputFile = await picker.PickSaveFileAsync();

            if (_OutputFile != null)
            {
                SetTranscodeButton(true);
            }
        }

async void PlayFile ( StorageFile MediaFile ) [inline, private]

Definition at line 449 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                    IRandomAccessStream stream = await MediaFile.OpenAsync(FileAccessMode.Read);
                    OutputVideo.SetSource(stream, MediaFile.ContentType);
                    OutputVideo.Play();
                }
                catch (Exception exception)
                {
                    TranscodeError(exception.Message);
                }
            });
        }

void SetCancelButton ( bool isEnabled ) [inline, private]

Definition at line 379 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Cancel.IsEnabled = isEnabled;
            });
        }

async void SetOutputFileButton ( bool isEnabled ) [inline, private]

Definition at line 363 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                SetOutputButton.IsEnabled = isEnabled;
            });
        }

void SetPickFileButton ( bool isEnabled ) [inline, private]

Definition at line 355 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = isEnabled;
            });
        }

void SetTranscodeButton ( bool isEnabled ) [inline, private]

Definition at line 371 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Transcode.IsEnabled = isEnabled;
            });
        }

void StopPlayers ( ) [inline, private]

Definition at line 434 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (InputVideo.CurrentState != MediaElementState.Paused)
                {
                    InputVideo.Pause();
                }
                if (OutputVideo.CurrentState != MediaElementState.Paused)
                {
                    OutputVideo.Pause();
                }
            });
        }

async void TranscodeCancel | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 206 of file Scenario1_Default.xaml.cs.

        {
            try
            {
                _cts.Cancel();
                _cts.Dispose();
                _cts = new CancellationTokenSource();

                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

async void TranscodeComplete ( ) [inline, private]

Definition at line 192 of file Scenario1_Default.xaml.cs.

        {
            OutputText("Transcode completed.");
            OutputPathText("Output (" + _OutputFile.Path + ")");
            IRandomAccessStream stream = await _OutputFile.OpenAsync(FileAccessMode.Read);
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                OutputVideo.SetSource(stream, _OutputFile.ContentType);
            });

            EnableButtons();
            SetCancelButton(false);
        }

async void TranscodeError ( string error ) [inline, private]

Definition at line 466 of file Scenario1_Default.xaml.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                StatusMessage.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                StatusMessage.Text = error;
            });

            EnableButtons();
            SetCancelButton(false);
        }

void TranscodeFailure ( TranscodeFailureReason reason ) [inline, private]

Definition at line 225 of file Scenario1_Default.xaml.cs.

        {
            try
            {
                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }

            switch (reason)
            {
                case TranscodeFailureReason.CodecNotFound:
                    TranscodeError("Codec not found.");
                    break;
                case TranscodeFailureReason.InvalidProfile:
                    TranscodeError("Invalid profile.");
                    break;
                default:
                    TranscodeError("Unknown failure.");
                    break;
            }
        }

async void TranscodePreset | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario1_Default.xaml.cs.

        {
            StopPlayers();
            DisableButtons();
            GetPresetProfile(ProfileSelect);

            // Clear messages
            StatusMessage.Text = "";

            try
            {
                if ((_InputFile != null) && (_OutputFile != null))
                {
                    var preparedTranscodeResult = await _Transcoder.PrepareFileTranscodeAsync(_InputFile, _OutputFile, _Profile);

                    if (EnableMrfCrf444.IsChecked.HasValue && (bool)EnableMrfCrf444.IsChecked)
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.MrfCrf444;
                    }
                    else
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.Default;
                    }

                    if (preparedTranscodeResult.CanTranscode)
                    {
                        SetCancelButton(true);
                        var progress = new Progress<double>(TranscodeProgress);
                        await preparedTranscodeResult.TranscodeAsync().AsTask(_cts.Token, progress);
                        TranscodeComplete();
                    }
                    else
                    {
                        TranscodeFailure(preparedTranscodeResult.FailureReason);
                    }
                }
            }
            catch (TaskCanceledException)
            {
                OutputText("");
                TranscodeError("Transcode Canceled");
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

void TranscodeProgress ( double percent ) [inline, private]

Definition at line 187 of file Scenario1_Default.xaml.cs.

        {
            OutputText("Progress:  " + percent.ToString().Split('.')[0] + "%");
        }

Member Data Documentation

CancellationTokenSource _cts [private]

Definition at line 33 of file Scenario1_Default.xaml.cs.

CoreDispatcher _dispatcher = Window.Current.Dispatcher [private]

Definition at line 32 of file Scenario1_Default.xaml.cs.

StorageFile _InputFile = null [private]

Definition at line 36 of file Scenario1_Default.xaml.cs.

StorageFile _OutputFile = null [private]

Definition at line 37 of file Scenario1_Default.xaml.cs.

string _OutputFileExtension = ".mp4" [private]

Definition at line 40 of file Scenario1_Default.xaml.cs.

string _OutputFileName = "TranscodeSampleOutput" [private]

Definition at line 34 of file Scenario1_Default.xaml.cs.

string _OutputType = "MP4" [private]

Definition at line 39 of file Scenario1_Default.xaml.cs.

MediaEncodingProfile _Profile [private]

Definition at line 35 of file Scenario1_Default.xaml.cs.

MediaTranscoder _Transcoder = new MediaTranscoder() [private]

Definition at line 38 of file Scenario1_Default.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_Default.xaml.cs.

The documentation for this class was generated from the following files:
  • MediaTranscoding/cs/Scenario1_Default.xaml.cs
  • MediaTranscoding/cpp/Scenario1_Default.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Define Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Define
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Define Class Reference

List of all members.

Public Member Functions

Scenario1_Define ()

Private Member Functions

void | Create_Click (object sender, RoutedEventArgs e)
void | InviteeRadioButton_Checked (object sender, RoutedEventArgs e)
void | OrganizerRadioButton_Checked (object sender, RoutedEventArgs e)
void | ReminderCheckBox_Checked (object sender, RoutedEventArgs e)
void | ReminderCheckBox_UnChecked (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario1_Define.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Define ( ) [inline]

Definition at line 23 of file Scenario1_Define.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Create_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Creates an Appointment based on the input fields and validates it.

Parameters:
sender
e

Definition at line 33 of file Scenario1_Define.xaml.cs.

        {
            string errorMessage = null;
            var appointment = new Windows.ApplicationModel.Appointments.Appointment();

            // StartTime
            var date = StartTimeDatePicker.Date;
            var time = StartTimeTimePicker.Time;
            var timeZoneOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);
            var startTime = new DateTimeOffset(date.Year, date.Month, date.Day, time.Hours, time.Minutes, 0, timeZoneOffset);
            appointment.StartTime = startTime;

            // Subject
            appointment.Subject = SubjectTextBox.Text;

            if (appointment.Subject.Length > 255)
            {
                errorMessage = "The subject cannot be greater than 255 characters.";
            }

            // Location
            appointment.Location = LocationTextBox.Text;

            if (appointment.Location.Length > 32768)
            {
                errorMessage = "The location cannot be greater than 32,768 characters.";
            }

            // Details
            appointment.Details = DetailsTextBox.Text;

            if (appointment.Details.Length > 1073741823)
            {
                errorMessage = "The details cannot be greater than 1,073,741,823 characters.";
            }

            // Duration
            if (DurationComboBox.SelectedIndex == 0)
            {
                // 30 minute duration is selected
                appointment.Duration = TimeSpan.FromMinutes(30);
            }
            else
            {
                // 1 hour duration is selected
                appointment.Duration = TimeSpan.FromHours(1);
            }

            // All Day
            appointment.AllDay = AllDayCheckBox.IsChecked.Value;

            // Reminder
            if (ReminderCheckBox.IsChecked.Value)
            {
                switch (ReminderComboBox.SelectedIndex)
                {
                    case 0:
                        appointment.Reminder = TimeSpan.FromMinutes(15);
                        break;
                    case 1:
                        appointment.Reminder = TimeSpan.FromHours(1);
                        break;
                    case 2:
                        appointment.Reminder = TimeSpan.FromDays(1);
                        break;
                }
            }

            //Busy Status
            switch (BusyStatusComboBox.SelectedIndex)
            {
                case 0:
                    appointment.BusyStatus = Windows.ApplicationModel.Appointments.AppointmentBusyStatus.Busy;
                    break;
                case 1:
                    appointment.BusyStatus = Windows.ApplicationModel.Appointments.AppointmentBusyStatus.Tentative;
                    break;
                case 2:
                    appointment.BusyStatus = Windows.ApplicationModel.Appointments.AppointmentBusyStatus.Free;
                    break;
                case 3:
                    appointment.BusyStatus = Windows.ApplicationModel.Appointments.AppointmentBusyStatus.OutOfOffice;
                    break;
                case 4:
                    appointment.BusyStatus = Windows.ApplicationModel.Appointments.AppointmentBusyStatus.WorkingElsewhere;
                    break;
            }

            // Sensitivity
            switch (SensitivityComboBox.SelectedIndex)
            {
                case 0:
                    appointment.Sensitivity = Windows.ApplicationModel.Appointments.AppointmentSensitivity.Public;
                    break;
                case 1:
                    appointment.Sensitivity = Windows.ApplicationModel.Appointments.AppointmentSensitivity.Private;
                    break;
            }

            // Uri
            if (UriTextBox.Text.Length > 0)
            {
                try
                {
                    appointment.Uri = new System.Uri(UriTextBox.Text);
                }
                catch (Exception)
                {
                    errorMessage = "The Uri provided is invalid.";
                }
            }

            // Organizer
            // Note: Organizer can only be set if there are no invitees added to this appointment.
            if (OrganizerRadioButton.IsChecked.Value)
            {
                var organizer = new Windows.ApplicationModel.Appointments.AppointmentOrganizer();

                // Organizer Display Name
                organizer.DisplayName = OrganizerDisplayNameTextBox.Text;

                if (organizer.DisplayName.Length > 256)
                {
                    errorMessage = "The organizer display name cannot be greater than 256 characters.";
                }
                else
                {
                    // Organizer Address (e.g. Email Address)
                    organizer.Address = OrganizerAddressTextBox.Text;

                    if (organizer.Address.Length > 321)
                    {
                        errorMessage = "The organizer address cannot be greater than 321 characters.";
                    }
                    else if (organizer.Address.Length == 0)
                    {
                        errorMessage = "The organizer address must be greater than 0 characters.";
                    }
                    else
                    {
                        appointment.Organizer = organizer;
                    }
                }
            }

            // Invitees
            // Note: If the size of the Invitees list is not zero, then an Organizer cannot be set.
            if (InviteeRadioButton.IsChecked.Value)
            {
                var invitee = new Windows.ApplicationModel.Appointments.AppointmentInvitee();

                // Invitee Display Name
                invitee.DisplayName = InviteeDisplayNameTextBox.Text;

                if (invitee.DisplayName.Length > 256)
                {
                    errorMessage = "The invitee display name cannot be greater than 256 characters.";
                }
                else
                {
                    // Invitee Address (e.g. Email Address)
                    invitee.Address = InviteeAddressTextBox.Text;

                    if (invitee.Address.Length > 321)
                    {
                        errorMessage = "The invitee address cannot be greater than 321 characters.";
                    }
                    else if (invitee.Address.Length == 0)
                    {
                        errorMessage = "The invitee address must be greater than 0 characters.";
                    }
                    else
                    {
                        // Invitee Role
                        switch (RoleComboBox.SelectedIndex)
                        {
                            case 0:
                                invitee.Role = Windows.ApplicationModel.Appointments.AppointmentParticipantRole.RequiredAttendee;
                                break;
                            case 1:
                                invitee.Role = Windows.ApplicationModel.Appointments.AppointmentParticipantRole.OptionalAttendee;
                                break;
                            case 2:
                                invitee.Role = Windows.ApplicationModel.Appointments.AppointmentParticipantRole.Resource;
                                break;
                        }

                        // Invitee Response
                        switch (ResponseComboBox.SelectedIndex)
                        {
                            case 0:
                                invitee.Response = Windows.ApplicationModel.Appointments.AppointmentParticipantResponse.None;
                                break;
                            case 1:
                                invitee.Response = Windows.ApplicationModel.Appointments.AppointmentParticipantResponse.Tentative;
                                break;
                            case 2:
                                invitee.Response = Windows.ApplicationModel.Appointments.AppointmentParticipantResponse.Accepted;
                                break;
                            case 3:
                                invitee.Response = Windows.ApplicationModel.Appointments.AppointmentParticipantResponse.Declined;
                                break;
                            case 4:
                                invitee.Response = Windows.ApplicationModel.Appointments.AppointmentParticipantResponse.Unknown;
                                break;
                        }

                        appointment.Invitees.Add(invitee);
                    }
                }
            }

            if (errorMessage == null)
            {
                rootPage.NotifyUser("The appointment was created successfully and is valid.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
            }
        }

void InviteeRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Organizer and Invitee properties are mutually exclusive.

This radio button enables the invitees properties while disabling the organizer.

Parameters:
sender
e

Definition at line 273 of file Scenario1_Define.xaml.cs.

        {
            InviteeStackPanel.Visibility = Windows.UI.Xaml.Visibility.Visible;
            OrganizerStackPanel.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

void OrganizerRadioButton_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Organizer and Invitee properties are mutually exclusive.

This radio button enables the organizer properties while disabling the invitees.

Parameters:
sender
e

Definition at line 261 of file Scenario1_Define.xaml.cs.

        {
            OrganizerStackPanel.Visibility = Windows.UI.Xaml.Visibility.Visible;
            InviteeStackPanel.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

void ReminderCheckBox_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Displays the combo box containing various reminder times.

Parameters:
sender
e

Definition at line 284 of file Scenario1_Define.xaml.cs.

        {
            ReminderComboBox.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }

void ReminderCheckBox_UnChecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Hides the combo box containing various reminder times.

Parameters:
sender
e

Definition at line 294 of file Scenario1_Define.xaml.cs.

        {
            ReminderComboBox.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario1_Define.xaml.cs.

The documentation for this class was generated from the following file:
  • Appointments/cs/Scenario1_Define.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DetectInPhoto Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_DetectInPhoto
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DetectInPhoto Class Reference

Page for demonstrating FaceDetection on an image file.

List of all members.

Public Member Functions

Scenario1_DetectInPhoto ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearVisualization ()
BitmapTransform | ComputeScalingTransformForSourceImage (BitmapDecoder sourceDecoder)
async void | OpenFile_Click (object sender, RoutedEventArgs e)
void | PhotoCanvas_SizeChanged (object sender, SizeChangedEventArgs e)
void | SetupVisualization (WriteableBitmap displaySource, IList< DetectedFace > foundFaces)

Private Attributes

readonly SolidColorBrush | fillBrush = new SolidColorBrush(Windows.UI.Colors.Transparent)
readonly SolidColorBrush | lineBrush = new SolidColorBrush(Windows.UI.Colors.Yellow)
readonly double | lineThickness = 2.0
MainPage rootPage
readonly uint | sourceImageHeightLimit = 1280

Detailed Description

Definition at line 31 of file Scenario1_DetectInPhoto.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DetectInPhoto ( ) [inline]

Initializes a new instance of the Scenario1_DetectInPhoto class.

Definition at line 67 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearVisualization ( ) [inline, private]

Clears the display of image and face boxes.

Definition at line 95 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            this.PhotoCanvas.Background = null;
            this.PhotoCanvas.Children.Clear();
            this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }

BitmapTransform ComputeScalingTransformForSourceImage ( BitmapDecoder sourceDecoder ) [inline, private]

Computes a BitmapTransform to downscale the source image if it's too large.

Performance of the FaceDetector degrades significantly with large images, and in most cases it's best to downscale the source bitmaps if they're too large before passing them into FaceDetector. Remember through, your application's performance needs will vary.

Parameters:
sourceDecoder Source image decoder
Returns:
A BitmapTransform object holding scaling values if source image is too large

Definition at line 111 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            BitmapTransform transform = new BitmapTransform();

            if (sourceDecoder.PixelHeight > this.sourceImageHeightLimit)
            {
                float scalingFactor = (float)this.sourceImageHeightLimit / (float)sourceDecoder.PixelHeight;

                transform.ScaledWidth = (uint)Math.Floor(sourceDecoder.PixelWidth * scalingFactor);
                transform.ScaledHeight = (uint)Math.Floor(sourceDecoder.PixelHeight * scalingFactor);
            }

            return transform;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Responds when we navigate to this page.

Parameters:
e Event data

Definition at line 76 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            this.rootPage = MainPage.Current;
        }

async void OpenFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Loads an image file (selected by the user) and runs the FaceDetector on the loaded bitmap.

If successful calls SetupVisualization to display the results.

Parameters:
sender | Button user clicked
e | Event data

Definition at line 131 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            FileOpenPicker photoPicker = new FileOpenPicker();
            photoPicker.ViewMode = PickerViewMode.Thumbnail;
            photoPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            photoPicker.FileTypeFilter.Add(".jpg");
            photoPicker.FileTypeFilter.Add(".jpeg");
            photoPicker.FileTypeFilter.Add(".png");
            photoPicker.FileTypeFilter.Add(".bmp");

            StorageFile photoFile = await photoPicker.PickSingleFileAsync();
            if (photoFile == null)
            {
                return;
            }

            this.ClearVisualization();
            this.rootPage.NotifyUser("Opening...", NotifyType.StatusMessage);

            try
            {
                // Open the image file and decode the bitmap into memory.
                // We'll need to make 2 bitmap copies: one for the FaceDetector and another to display.
                using (IRandomAccessStream fileStream = await photoFile.OpenAsync(Windows.Storage.FileAccessMode.Read))
                {
                    BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);
                    BitmapTransform transform = this.ComputeScalingTransformForSourceImage(decoder);
                    using (SoftwareBitmap originalBitmap = await decoder.GetSoftwareBitmapAsync(decoder.BitmapPixelFormat, BitmapAlphaMode.Ignore, transform, ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage))
                    {
                        // We need to convert the image into a format that's compatible with FaceDetector.
                        // Gray8 should be a good type but verify it against FaceDetector’s supported formats.
                        const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Gray8;
                        if (FaceDetector.IsBitmapPixelFormatSupported(InputPixelFormat))
                        {
                            using (SoftwareBitmap detectorInput = SoftwareBitmap.Convert(originalBitmap, InputPixelFormat))
                            {
                                // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to WriteableBitmap's buffer.
                                WriteableBitmap displaySource = new WriteableBitmap(originalBitmap.PixelWidth, originalBitmap.PixelHeight);
                                originalBitmap.CopyToBuffer(displaySource.PixelBuffer);

                                this.rootPage.NotifyUser("Detecting...", NotifyType.StatusMessage);

                                // Initialize our FaceDetector and execute it against our input image.
                                // NOTE: FaceDetector initialization can take a long time, and in most cases
                                // you should create a member variable and reuse the object.
                                // However, for simplicity in this scenario we instantiate a new instance each time.
                                FaceDetector detector = await FaceDetector.CreateAsync();
                                IList<DetectedFace> faces = await detector.DetectFacesAsync(detectorInput);

                                // Create our display using the available image and face results.
                                this.SetupVisualization(displaySource, faces);
                            }
                        }
                        else
                        {
                            this.rootPage.NotifyUser("PixelFormat '" + InputPixelFormat.ToString() + "' is not supported by FaceDetector", NotifyType.ErrorMessage);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                this.ClearVisualization();
                this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

void PhotoCanvas_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Updates any existing face bounding boxes in response to changes in the size of the Canvas.

Parameters:
sender | Canvas object whose size has changed
e | Event data

Definition at line 203 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            // If the Canvas is resized we must recompute a new scaling factor and
            // apply it to each face box.
            ImageBrush brush = (ImageBrush)this.PhotoCanvas.Background;
            if (brush != null)
            {
                MainPage.RepositionFaces((WriteableBitmap)brush.ImageSource, this.PhotoCanvas);
            }
        }

void SetupVisualization | ( | WriteableBitmap | displaySource,
 |  | IList< DetectedFace > | foundFaces |
 | ) |  |  | [inline, private]

Takes the photo image and FaceDetector results and assembles the visualization onto the Canvas.

Parameters:
displaySource | Bitmap object holding the image we're going to display
foundFaces | List of detected faces; output from FaceDetector

Definition at line 86 of file Scenario1_DetectInPhoto.xaml.cs.

        {
            this.PhotoCanvas.Background = new ImageBrush() { ImageSource = displaySource, Stretch = Stretch.Fill };
            MainPage.HighlightFaces(displaySource, foundFaces, this.PhotoCanvas, this.HighlightedFaceBox);
        }

Member Data Documentation

readonly SolidColorBrush fillBrush = new SolidColorBrush(Windows.UI.Colors.Transparent) [private]

Transparent fill for the bounding box.

Definition at line 46 of file Scenario1_DetectInPhoto.xaml.cs.

readonly SolidColorBrush lineBrush = new SolidColorBrush(Windows.UI.Colors.Yellow) [private]

Brush for drawing the bounding box around each detected face.

Definition at line 36 of file Scenario1_DetectInPhoto.xaml.cs.

readonly double lineThickness = 2.0 [private]

Thickness of the face bounding box lines.

Definition at line 41 of file Scenario1_DetectInPhoto.xaml.cs.

MainPage rootPage [private]

Reference back to the "root" page of the app.

Definition at line 62 of file Scenario1_DetectInPhoto.xaml.cs.

readonly uint sourceImageHeightLimit = 1280 [private]

Limit on the height of the source image (in pixels) passed into FaceDetector for performance considerations.

Images larger that this size will be downscaled proportionally.

This is an arbitrary value that was chosen for this scenario, in which FaceDetector performance isn't too important but face detection accuracy is; a generous size is used. Your application may have different performance and accuracy needs and you'll need to decide how best to control input.

Definition at line 57 of file Scenario1_DetectInPhoto.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicFaceDetection/cs/Scenario1_DetectInPhoto.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DevicePicker Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_DevicePicker
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DevicePicker Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_DevicePicker ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | PickSingleDeviceButton_Click (object sender, RoutedEventArgs e)
async void | ShowDevicePicker (bool pickSingle)
void | ShowDevicePickerButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario1_DevicePicker.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DevicePicker ( ) [inline]

Definition at line 26 of file Scenario1_DevicePicker.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_DevicePicker.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;
            selectorComboBox.ItemsSource = DeviceSelectorChoices.DevicePickerSelectors;
            selectorComboBox.SelectedIndex = 0;
        }

void PickSingleDeviceButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1_DevicePicker.xaml.cs.

        {
            ShowDevicePicker(
                true // pickSingle
                );
        }

void ShowDevicePicker ( bool pickSingle ) [inline, private]

Definition at line 52 of file Scenario1_DevicePicker.xaml.cs.

        {
            showDevicePickerButton.IsEnabled = false;
            resultCollection.Clear();

            var devicePicker = new DevicePicker();

            // First get the device selector chosen by the UI.
            DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;

            if (null == deviceSelectorInfo.Selector)
            {
                // If the a pre-canned device class selector was chosen, call the DeviceClass overload
                devicePicker.Filter.SupportedDeviceClasses.Add(deviceSelectorInfo.DeviceClassSelector);
            }
            else
            {
                // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
                devicePicker.Filter.SupportedDeviceSelectors.Add(deviceSelectorInfo.Selector);
            }

            rootPage.NotifyUser("Showing Device Picker", NotifyType.StatusMessage);

            // Calculate the position to show the picker (right below the buttons)
            GeneralTransform ge = pickSingleDeviceButton.TransformToVisual(null);
            Point point = ge.TransformPoint(new Point());
            Rect rect = new Rect(point, new Point(point.X + pickSingleDeviceButton.ActualWidth, point.Y + pickSingleDeviceButton.ActualHeight));

            if (pickSingle)
            {
                DeviceInformation di = await devicePicker.PickSingleDeviceAsync(rect);
                if (null != di)
                {
                    resultCollection.Add(new DeviceInformationDisplay(di));
                }
                showDevicePickerButton.IsEnabled = true;
            }
            else
            {
                devicePicker.DevicePickerDismissed += new TypedEventHandler<DevicePicker, object>(
                async (picker, obj) =>
                {
                    // Must access UI elements from the UI thread.
                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                    {
                        showDevicePickerButton.IsEnabled = true;
                        rootPage.NotifyUser("Hiding Device Picker", NotifyType.StatusMessage);
                    });
                });

                devicePicker.DeviceSelected += new TypedEventHandler<DevicePicker, DeviceSelectedEventArgs>(
                async (picker, args) =>
                {
                    // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
                    {
                        resultCollection.Clear();
                        resultCollection.Add(new DeviceInformationDisplay(args.SelectedDevice));
                    });
                });

                // Show the picker
                devicePicker.Show(rect);
            }
        }

void ShowDevicePickerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario1_DevicePicker.xaml.cs.

        {
            ShowDevicePicker(
                false // pickSingle
                );
        }

Member Data Documentation

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 24 of file Scenario1_DevicePicker.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario1_DevicePicker.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario1_DevicePicker.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DeviceUse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_DeviceUse
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DeviceUse Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_DeviceUse ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | FindAndCancelExistingBackgroundTask ()
async void | OnBackgroundTaskCompleted (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
void | RefreshTimer_Tick (object sender, object e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
async void | ScenarioEnable (object sender, RoutedEventArgs e)
async Task< bool > | StartSensorBackgroundTaskAsync (String deviceId)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

BackgroundTaskRegistration | _deviceUseBackgroundTaskRegistration
DeviceUseTrigger | _deviceUseTrigger
DispatcherTimer | _refreshTimer
Accelerometer Accelerometer
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario1_DeviceUse.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DeviceUse ( ) [inline]

Definition at line 34 of file Scenario1_DeviceUse.xaml.cs.

        {
            this.InitializeComponent();

            Accelerometer = Accelerometer.GetDefault();
            if (null != Accelerometer)
            {
                // Save trigger so that we may start the background task later.
                // Only one instance of the trigger can exist at a time. Since the trigger does not implement
                // IDisposable, it may still be in memory when a new trigger is created.
                _deviceUseTrigger = new DeviceUseTrigger();

                // Setup a timer to periodically refresh results when the app is visible.
                _refreshTimer = new DispatcherTimer()
                {
                    Interval = new TimeSpan(0, 0, 1) // Refresh once every second
                };
                _refreshTimer.Tick += RefreshTimer_Tick;
            }
            else
            {
                rootPage.NotifyUser("No accelerometer found", NotifyType.StatusMessage);
            }
        }

Member Function Documentation

void FindAndCancelExistingBackgroundTask ( ) [inline, private]

Finds a previously registered background task for this scenario and cancels it (if present).

Definition at line 266 of file Scenario1_DeviceUse.xaml.cs.

        {
            foreach (var backgroundTask in BackgroundTaskRegistration.AllTasks.Values)
            {
                if (SampleConstants.Scenario1_DeviceUse_TaskName == backgroundTask.Name)
                {
                    ((BackgroundTaskRegistration)backgroundTask).Unregister(true);
                    break;
                }
            }
        }

async void OnBackgroundTaskCompleted | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline, private]

This is the background task completion handler.

Parameters:
sender
e

Definition at line 301 of file Scenario1_DeviceUse.xaml.cs.

        {
            // Dispatch to the UI thread to display the output.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // An exception may be thrown if an error occurs in the background task.
                try
                {
                    e.CheckResult();
                    if (ApplicationData.Current.LocalSettings.Values.ContainsKey("TaskCancelationReason"))
                    {
                        string cancelationReason = (string)ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"];
                        rootPage.NotifyUser("Background task was stopped, reason: " + cancelationReason, NotifyType.StatusMessage);
                    }
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser("Exception in background task: " + ex.Message, NotifyType.ErrorMessage);
                }

                _refreshTimer.Stop();
            });

            // Unregister the background task and let the remaining task finish until completion.
            if (null != _deviceUseBackgroundTaskRegistration)
            {
                _deviceUseBackgroundTaskRegistration.Unregister(false);
                _deviceUseBackgroundTaskRegistration = null;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 64 of file Scenario1_DeviceUse.xaml.cs.

        {
            // If the background task is active, start the refresh timer and activate the "Disable" button.
            // The "IsBackgroundTaskActive" state is set by the background task.
            bool isBackgroundTaskActive =
                ApplicationData.Current.LocalSettings.Values.ContainsKey("IsBackgroundTaskActive") &&
                (bool)ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"];

            ScenarioEnableButton.IsEnabled = !isBackgroundTaskActive;
            ScenarioDisableButton.IsEnabled = isBackgroundTaskActive;
            if (isBackgroundTaskActive)
            {
                _refreshTimer.Start();
            }

            // Store a setting for the background task to read
            ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = true;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 91 of file Scenario1_DeviceUse.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = false;

            // The default behavior here is to let the background task continue to run when
            // this scenario exits. The background task can be canceled by clicking on the "Disable"
            // button the next time the app is navigated to.
            // To cancel the background task on scenario exit, uncomment this code.
            // if (null != _deviceUseBackgroundTaskRegistration)
            // {
            //    _deviceUseBackgroundTaskRegistration.Unregister(true);
            //    _deviceUseBackgroundTaskRegistration = null;
            // }

            base.OnNavigatingFrom(e);
        }

void RefreshTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is the tick handler for the Refresh timer.

Parameters:
sender
e

Definition at line 283 of file Scenario1_DeviceUse.xaml.cs.

        {
            if (ApplicationData.Current.LocalSettings.Values.ContainsKey("SampleCount"))
            {
                ulong sampleCount = (ulong)ApplicationData.Current.LocalSettings.Values["SampleCount"];
                ScenarioOutput_SampleCount.Text = sampleCount.ToString(System.Globalization.CultureInfo.CurrentCulture);
            }
            else
            {
                ScenarioOutput_SampleCount.Text = "No data";
            }
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 176 of file Scenario1_DeviceUse.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;

            _refreshTimer.Stop();

            if (null != _deviceUseBackgroundTaskRegistration)
            {
                // Cancel and unregister the background task from the current app session.
                _deviceUseBackgroundTaskRegistration.Unregister(true);
                _deviceUseBackgroundTaskRegistration = null;
            }
            else
            {
                // Cancel and unregister the background task from the previous app session.
                FindAndCancelExistingBackgroundTask();
            }

            rootPage.NotifyUser("Background task was canceled", NotifyType.StatusMessage);
        }

async void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 139 of file Scenario1_DeviceUse.xaml.cs.

        {
            Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);

            if (null != Accelerometer)
            {
                // Make sure this app is allowed to run background tasks.
                // RequestAccessAsync must be called on the UI thread.
                BackgroundAccessStatus accessStatus = await BackgroundExecutionManager.RequestAccessAsync();

                if ((BackgroundAccessStatus.AlwaysAllowed == accessStatus) ||
                    (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == accessStatus))
                {
                    if (await StartSensorBackgroundTaskAsync(Accelerometer.DeviceId))
                    {
                        _refreshTimer.Start();

                        ScenarioEnableButton.IsEnabled = false;
                        ScenarioDisableButton.IsEnabled = true;
                    }
                }
                else
                {
                    rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No accelerometer found", NotifyType.StatusMessage);
            }
        }

async Task<bool> StartSensorBackgroundTaskAsync ( String deviceId ) [inline, private]

Starts the sensor background task.

Parameters:
deviceId Device Id for the sensor to be used by the task.
e
Returns:
True if the task is started successfully.

Definition at line 206 of file Scenario1_DeviceUse.xaml.cs.

        {
            bool started = false;

            // Make sure only 1 task is running.
            FindAndCancelExistingBackgroundTask();

            // Register the background task.
            var backgroundTaskBuilder = new BackgroundTaskBuilder()
            {
                Name = SampleConstants.Scenario1_DeviceUse_TaskName,
                TaskEntryPoint = SampleConstants.Scenario1_DeviceUse_TaskEntryPoint
            };

            backgroundTaskBuilder.SetTrigger(_deviceUseTrigger);
            _deviceUseBackgroundTaskRegistration = backgroundTaskBuilder.Register();

            // Make sure we're notified when the task completes or if there is an update.
            _deviceUseBackgroundTaskRegistration.Completed += new BackgroundTaskCompletedEventHandler(OnBackgroundTaskCompleted);

            try
            {
                // Request a DeviceUse task to use the accelerometer.
                DeviceTriggerResult deviceTriggerResult = await _deviceUseTrigger.RequestAsync(deviceId);

                switch (deviceTriggerResult)
                {
                    case DeviceTriggerResult.Allowed:
                        rootPage.NotifyUser("Background task started", NotifyType.StatusMessage);
                        started = true;
                        break;

                    case DeviceTriggerResult.LowBattery:
                        rootPage.NotifyUser("Insufficient battery to run the background task", NotifyType.ErrorMessage);
                        break;

                    case DeviceTriggerResult.DeniedBySystem:
                        // The system can deny a task request if the system-wide DeviceUse task limit is reached.
                        rootPage.NotifyUser("The system has denied the background task request", NotifyType.ErrorMessage);
                        break;

                    default:
                        rootPage.NotifyUser("Could not start the background task: " + deviceTriggerResult, NotifyType.ErrorMessage);
                        break;
                }
            }
            catch (InvalidOperationException)
            {
                // If toggling quickly between 'Disable' and 'Enable', the previous task
                // could still be in the process of cleaning up.
                rootPage.NotifyUser("A previous background task is still running, please wait for it to exit", NotifyType.ErrorMessage);
                FindAndCancelExistingBackgroundTask();
            }

            return started;
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 117 of file Scenario1_DeviceUse.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = e.Visible;

                if (e.Visible)
                {
                    _refreshTimer.Start();
                }
                else
                {
                    _refreshTimer.Stop();
                }
            }
        }

Member Data Documentation

BackgroundTaskRegistration _deviceUseBackgroundTaskRegistration [private]

Definition at line 29 of file Scenario1_DeviceUse.xaml.cs.

DeviceUseTrigger _deviceUseTrigger [private]

Definition at line 26 of file Scenario1_DeviceUse.xaml.cs.

DispatcherTimer _refreshTimer [private]

Definition at line 32 of file Scenario1_DeviceUse.xaml.cs.

Accelerometer Accelerometer [private]

Definition at line 25 of file Scenario1_DeviceUse.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario1_DeviceUse.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundSensors/cs/Scenario1_DeviceUse.xaml.cs
  • BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.cpp
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Directions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Directions
Public Member Functions

Scenario1_Directions Class Reference

List of all members.

Public Member Functions

Scenario1_Directions ()

Detailed Description

Definition at line 22 of file Scenario1_Directions.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Directions ( ) [inline]

Definition at line 24 of file Scenario1_Directions.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlGamepadNavigation/cs/Scenario1_Directions.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Discovery Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Discovery
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Discovery Class Reference

List of all members.

Public Member Functions

Scenario1_Discovery ()
Scenario1_Discovery ()

Public Attributes

ObservableCollection
< RemoteSystem > 		SystemList = > m_rootPage.systemList

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

List< IRemoteSystemFilter > | BuildFilters ()
async void | DeviceWatcher_Added (DeviceWatcher sender, DeviceInformation deviceInfo)
async void | DeviceWatcher_EnumerationCompleted (DeviceWatcher sender, object e)
async void | DeviceWatcher_Removed (DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
async void | DeviceWatcher_Stopped (DeviceWatcher sender, object e)
async void | DeviceWatcher_Updated (DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
void | EnumerateButton_Click ()
BluetoothLEDeviceDisplay | FindBluetoothLEDeviceDisplay (string id)
DeviceInformation | FindUnknownDevices (string id)
bool | Not (bool value)
async void | PairButton_Click ()
async void | RemoteSystemWatcher_RemoteSystemAdded (RemoteSystemWatcher sender, RemoteSystemAddedEventArgs args)
async void | RemoteSystemWatcher_RemoteSystemRemoved (RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
async void | RemoteSystemWatcher_RemoteSystemUpdated (RemoteSystemWatcher sender, RemoteSystemUpdatedEventArgs args)
async void | Search_Clicked (object sender, RoutedEventArgs e)
async Task | SearchByHostNameAsync ()
void | SearchByRemoteSystemWatcher ()
void | SearchCleanup ()
void | StartBleDeviceWatcher ()
void | StopBleDeviceWatcher ()
void | SystemListBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | UpdateStatus (string status, NotifyType statusType)

Private Attributes

DeviceWatcher | deviceWatcher
bool | isBusy = false
ObservableCollection
< BluetoothLEDeviceDisplay > 		KnownDevices = new ObservableCollection<BluetoothLEDeviceDisplay>()
RemoteSystemWatcher | m_remoteSystemWatcher
MainPage m_rootPage
MainPage rootPage = MainPage.Current
List< DeviceInformation > | UnknownDevices = new List<DeviceInformation>()

Detailed Description

Definition at line 30 of file Scenario1_Discovery.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Discovery ( ) [inline]

Definition at line 40 of file Scenario1_Discovery.xaml.cs.

        {
            InitializeComponent();
        }

Scenario1_Discovery ( ) [inline]

Definition at line 30 of file Scenario1_Discovery.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

List<IRemoteSystemFilter> BuildFilters ( ) [inline, private]

Definition at line 173 of file Scenario1_Discovery.xaml.cs.

        {
            List<IRemoteSystemFilter> filters = new List<IRemoteSystemFilter>();
            RemoteSystemDiscoveryTypeFilter discoveryFilter;
            RemoteSystemAuthorizationKindFilter authorizationKindFilter;
            List<string> kinds = new List<string>();
            RemoteSystemStatusTypeFilter statusFilter;

            if (DiscoveryTypeOptions.IsChecked.Value)
            {
                // Build discovery type filters
                if (ProximalRadioButton.IsChecked.Value)
                {
                    discoveryFilter = new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.Proximal);
                }
                else if (CloudRadioButton.IsChecked.Value)
                {
                    discoveryFilter = new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.Cloud);
                }
                else if (SpatiallyProximalRadioButton.IsChecked.Value)
                {
                    discoveryFilter = new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.SpatiallyProximal);
                }
                else
                {
                    discoveryFilter = new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.Any);
                }
                filters.Add(discoveryFilter);
            }

            if (AuthorizationTypeOptions.IsChecked.Value)
            {
                // Build authorization type filters
                if (AnonymousDiscoveryRadioButton.IsChecked.Value)
                {
                    authorizationKindFilter = new RemoteSystemAuthorizationKindFilter(RemoteSystemAuthorizationKind.Anonymous);
                }
                else
                {
                    authorizationKindFilter = new RemoteSystemAuthorizationKindFilter(RemoteSystemAuthorizationKind.SameUser);
                }
                filters.Add(authorizationKindFilter);
            }

            if (SystemTypeOptions.IsChecked.Value)
            {
                // Build system type filters
                if (DesktopCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Desktop);
                }
                if (TabletCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Tablet);
                }
                if (LaptopCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Laptop);
                }
                if (IotCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Iot);
                }
                if (HolographicCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Holographic);
                }
                if (HubCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Hub);
                }
                if (PhoneCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Phone);
                }
                if (XboxCheckBox.IsChecked.Value)
                {
                    kinds.Add(RemoteSystemKinds.Xbox);
                }
                if (kinds.Count == 0)
                {
                    UpdateStatus("Select a system type filter.", NotifyType.ErrorMessage);
                }
                else
                {
                    RemoteSystemKindFilter kindFilter = new RemoteSystemKindFilter(kinds);
                    filters.Add(kindFilter);
                }
            }

            if (StatusTypeOptions.IsChecked.Value)
            {
                // Build status type filters
                if (AvailableRadioButton.IsChecked.Value)
                {
                    statusFilter = new RemoteSystemStatusTypeFilter(RemoteSystemStatusType.Available);
                }
                else
                {
                    statusFilter = new RemoteSystemStatusTypeFilter(RemoteSystemStatusType.Any);
                }
                filters.Add(statusFilter);
            }

            return filters;
        }

async void DeviceWatcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Definition at line 160 of file Scenario1_Discovery.xaml.cs.

        {
            // We must update the collection on the UI thread because the collection is databound to a UI element.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                lock (this)
                {
                    Debug.WriteLine(String.Format("Added {0}{1}", deviceInfo.Id, deviceInfo.Name));

                    // Protect against race condition if the task runs after the app stopped the deviceWatcher.
                    if (sender == deviceWatcher)
                    {
                        // Make sure device isn't already present in the list.
                        if (FindBluetoothLEDeviceDisplay(deviceInfo.Id) == null)
                        {
                            if (deviceInfo.Name != string.Empty)
                            {
                                // If device has a friendly name display it immediately.
                                KnownDevices.Add(new BluetoothLEDeviceDisplay(deviceInfo));
                            }
                            else
                            {
                                // Add it to a list in case the name gets updated later.
                                UnknownDevices.Add(deviceInfo);
                            }
                        }

                    }
                }
            });
        }

async void DeviceWatcher_EnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 257 of file Scenario1_Discovery.xaml.cs.

        {
            // We must update the collection on the UI thread because the collection is databound to a UI element.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Protect against race condition if the task runs after the app stopped the deviceWatcher.
                if (sender == deviceWatcher)
                {
                    rootPage.NotifyUser($"{KnownDevices.Count} devices found. Enumeration completed.",
                        NotifyType.StatusMessage);
                }
            });
        }

async void DeviceWatcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 228 of file Scenario1_Discovery.xaml.cs.

        {
            // We must update the collection on the UI thread because the collection is databound to a UI element.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                lock (this)
                {
                    Debug.WriteLine(String.Format("Removed {0}{1}", deviceInfoUpdate.Id,""));

                    // Protect against race condition if the task runs after the app stopped the deviceWatcher.
                    if (sender == deviceWatcher)
                    {
                        // Find the corresponding DeviceInformation in the collection and remove it.
                        BluetoothLEDeviceDisplay bleDeviceDisplay = FindBluetoothLEDeviceDisplay(deviceInfoUpdate.Id);
                        if (bleDeviceDisplay != null)
                        {
                            KnownDevices.Remove(bleDeviceDisplay);
                        }

                        DeviceInformation deviceInfo = FindUnknownDevices(deviceInfoUpdate.Id);
                        if (deviceInfo != null)
                        {
                            UnknownDevices.Remove(deviceInfo);
                        }
                    }
                }
            });
        }

async void DeviceWatcher_Stopped | ( | DeviceWatcher | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 271 of file Scenario1_Discovery.xaml.cs.

        {
            // We must update the collection on the UI thread because the collection is databound to a UI element.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Protect against race condition if the task runs after the app stopped the deviceWatcher.
                if (sender == deviceWatcher)
                {
                    rootPage.NotifyUser($"No longer watching for devices.",
                            sender.Status == DeviceWatcherStatus.Aborted ? NotifyType.ErrorMessage : NotifyType.StatusMessage);
                }
            });
        }

async void DeviceWatcher_Updated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 192 of file Scenario1_Discovery.xaml.cs.

        {
            // We must update the collection on the UI thread because the collection is databound to a UI element.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                lock (this)
                {
                    Debug.WriteLine(String.Format("Updated {0}{1}", deviceInfoUpdate.Id, ""));

                    // Protect against race condition if the task runs after the app stopped the deviceWatcher.
                    if (sender == deviceWatcher)
                    {
                        BluetoothLEDeviceDisplay bleDeviceDisplay = FindBluetoothLEDeviceDisplay(deviceInfoUpdate.Id);
                        if (bleDeviceDisplay != null)
                        {
                            // Device is already being displayed - update UX.
                            bleDeviceDisplay.Update(deviceInfoUpdate);
                            return;
                        }

                        DeviceInformation deviceInfo = FindUnknownDevices(deviceInfoUpdate.Id);
                        if (deviceInfo != null)
                        {
                            deviceInfo.Update(deviceInfoUpdate);
                            // If device has been updated with a friendly name it's no longer unknown.
                            if (deviceInfo.Name != String.Empty)
                            {
                                KnownDevices.Add(new BluetoothLEDeviceDisplay(deviceInfo));
                                UnknownDevices.Remove(deviceInfo);
                            }
                        }
                    }
                }
            });
        }

void EnumerateButton_Click ( ) [inline, private]

Definition at line 57 of file Scenario1_Discovery.xaml.cs.

        {
            if (deviceWatcher == null)
            {
                StartBleDeviceWatcher();
                EnumerateButton.Content = "Stop enumerating";
                rootPage.NotifyUser($"Device watcher started.", NotifyType.StatusMessage);
            }
            else
            {
                StopBleDeviceWatcher();
                EnumerateButton.Content = "Start enumerating";
                rootPage.NotifyUser($"Device watcher stopped.", NotifyType.StatusMessage);
            }
        }

BluetoothLEDeviceDisplay FindBluetoothLEDeviceDisplay ( string id ) [inline, private]

Definition at line 136 of file Scenario1_Discovery.xaml.cs.

        {
            foreach (BluetoothLEDeviceDisplay bleDeviceDisplay in KnownDevices)
            {
                if (bleDeviceDisplay.Id == id)
                {
                    return bleDeviceDisplay;
                }
            }
            return null;
        }

DeviceInformation FindUnknownDevices ( string id ) [inline, private]

Definition at line 148 of file Scenario1_Discovery.xaml.cs.

        {
            foreach (DeviceInformation bleDeviceInfo in UnknownDevices)
            {
                if (bleDeviceInfo.Id == id)
                {
                    return bleDeviceInfo;
                }
            }
            return null;
        }

bool Not ( bool value ) [private]
override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario1_Discovery.xaml.cs.

        {
            StopBleDeviceWatcher();

            // Save the selected device's ID for use in other scenarios.
            var bleDeviceDisplay = ResultsListView.SelectedItem as BluetoothLEDeviceDisplay;
            if (bleDeviceDisplay != null)
            {
                rootPage.SelectedBleDeviceId = bleDeviceDisplay.Id;
                rootPage.SelectedBleDeviceName = bleDeviceDisplay.Name;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario1_Discovery.xaml.cs.

        {
            m_rootPage = MainPage.Current;
            m_rootPage.systemList = new ObservableCollection<RemoteSystem>();
            m_rootPage.systemMap = new Dictionary<string, RemoteSystem>();
        }

async void PairButton_Click ( ) [inline, private]

Definition at line 290 of file Scenario1_Discovery.xaml.cs.

        {
            // Do not allow a new Pair operation to start if an existing one is in progress.
            if (isBusy)
            {
                return;
            }

            isBusy = true;

            rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);

            // For more information about device pairing, including examples of
            // customizing the pairing process, see the DeviceEnumerationAndPairing sample.

            // Capture the current selected item in case the user changes it while we are pairing.
            var bleDeviceDisplay = ResultsListView.SelectedItem as BluetoothLEDeviceDisplay;

            // BT_Code: Pair the currently selected device.
            DevicePairingResult result = await bleDeviceDisplay.DeviceInformation.Pairing.PairAsync();
            rootPage.NotifyUser($"Pairing result = {result.Status}",
                result.Status == DevicePairingResultStatus.Paired || result.Status == DevicePairingResultStatus.AlreadyPaired
                    ? NotifyType.StatusMessage
                    : NotifyType.ErrorMessage);

            isBusy = false;
        }

async void RemoteSystemWatcher_RemoteSystemAdded | ( | RemoteSystemWatcher | sender,
 |  | RemoteSystemAddedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 163 of file Scenario1_Discovery.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_rootPage.systemList.Add(args.RemoteSystem);
                m_rootPage.systemMap.Add(args.RemoteSystem.Id, args.RemoteSystem);
                UpdateStatus(string.Format("Found {0} systems.", m_rootPage.systemList.Count), NotifyType.StatusMessage);
            });
        }

async void RemoteSystemWatcher_RemoteSystemRemoved | ( | RemoteSystemWatcher | sender,
 |  | RemoteSystemRemovedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 150 of file Scenario1_Discovery.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (m_rootPage.systemMap.ContainsKey(args.RemoteSystemId))
                {
                    m_rootPage.systemList.Remove(m_rootPage.systemMap[args.RemoteSystemId]);
                    UpdateStatus(m_rootPage.systemMap[args.RemoteSystemId].DisplayName + " removed.", NotifyType.StatusMessage);
                    m_rootPage.systemMap.Remove(args.RemoteSystemId);
                }
            });
        }

async void RemoteSystemWatcher_RemoteSystemUpdated | ( | RemoteSystemWatcher | sender,
 |  | RemoteSystemUpdatedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 135 of file Scenario1_Discovery.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (m_rootPage.systemMap.ContainsKey(args.RemoteSystem.Id))
                {
                    m_rootPage.systemList.Remove(m_rootPage.systemMap[args.RemoteSystem.Id]);
                    m_rootPage.systemMap.Remove(args.RemoteSystem.Id);
                }
                m_rootPage.systemList.Add(args.RemoteSystem);
                m_rootPage.systemMap.Add(args.RemoteSystem.Id, args.RemoteSystem);
                UpdateStatus("System updated with Id = " + args.RemoteSystem.Id, NotifyType.StatusMessage);
            });
        }

async void Search_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario1_Discovery.xaml.cs.

        {
            // Disable the Search button while watcher is being started to avoid a potential
            // race condition of having two RemoteSystemWatchers running in parallel.
            Button searchButton = sender as Button;
            searchButton.IsHitTestVisible = false;

            // Cleaning up any existing systems from previous searches.
            SearchCleanup();

            // Verify access for Remote Systems.
            // Note: RequestAccessAsync needs to called from the UI thread.
            RemoteSystemAccessStatus accessStatus = await RemoteSystem.RequestAccessAsync();

            if (accessStatus == RemoteSystemAccessStatus.Allowed)
            {
                if (HostNameSearch.IsChecked.Value)
                {
                    await SearchByHostNameAsync();
                }
                else
                {
                    SearchByRemoteSystemWatcher();
                }
            }
            else
            {
                UpdateStatus("Access to Remote Systems is " + accessStatus.ToString(), NotifyType.ErrorMessage);
            }

            searchButton.IsHitTestVisible = true;
            DeviceInfoTextBlock.Visibility = Visibility.Visible;
        }

async Task SearchByHostNameAsync ( ) [inline, private]

Definition at line 79 of file Scenario1_Discovery.xaml.cs.

        {
            if (!string.IsNullOrWhiteSpace(HostNameTextBox.Text))
            {
                // Build hostname object.
                HostName hostName = new HostName(HostNameTextBox.Text);

                // Get Remote System from HostName.
                RemoteSystem remoteSystem = await RemoteSystem.FindByHostNameAsync(hostName);

                if (remoteSystem != null)
                {
                    m_rootPage.systemList.Add(remoteSystem);
                    SystemListBox.Visibility = Visibility.Visible;
                    UpdateStatus("Found system - " + remoteSystem.DisplayName, NotifyType.StatusMessage);
                }
                else
                {
                    UpdateStatus("Unable to find the system.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                UpdateStatus("Enter a valid host name", NotifyType.ErrorMessage);
            }
        }

void SearchByRemoteSystemWatcher ( ) [inline, private]

Definition at line 106 of file Scenario1_Discovery.xaml.cs.

        {
            if (FilterSearch.IsChecked.Value)
            {
                // Build a watcher to continuously monitor for filtered remote systems.
                m_remoteSystemWatcher = RemoteSystem.CreateWatcher(BuildFilters());
            }
            else
            {
                // Build a watcher to continuously monitor for all remote systems.
                m_remoteSystemWatcher = RemoteSystem.CreateWatcher();
            }

            // Subscribing to the event that will be raised when a new remote system is found by the watcher.
            m_remoteSystemWatcher.RemoteSystemAdded += RemoteSystemWatcher_RemoteSystemAdded;

            // Subscribing to the event that will be raised when a previously found remote system is no longer available.
            m_remoteSystemWatcher.RemoteSystemRemoved += RemoteSystemWatcher_RemoteSystemRemoved;

            // Subscribing to the event that will be raised when a previously found remote system is updated.
            m_remoteSystemWatcher.RemoteSystemUpdated += RemoteSystemWatcher_RemoteSystemUpdated;

            // Start the watcher.
            m_remoteSystemWatcher.Start();

            UpdateStatus("Searching for systems...", NotifyType.StatusMessage);
            SystemListBox.Visibility = Visibility.Visible;
        }

void SearchCleanup ( ) [inline, private]

Definition at line 280 of file Scenario1_Discovery.xaml.cs.

        {
            if (m_remoteSystemWatcher != null)
            {
                m_remoteSystemWatcher.Stop();
                m_remoteSystemWatcher = null;
            }
            m_rootPage.systemList.Clear();
            m_rootPage.systemMap.Clear();
            DeviceInfoTextBlock.Visibility = Visibility.Collapsed;
            DeviceInfoTextBlock.Text = "Select a device from the list to see its properties.";
        }

void StartBleDeviceWatcher ( ) [inline, private]

Starts a device watcher that looks for all nearby Bluetooth devices (paired or unpaired).

Attaches event handlers to populate the device collection.

Definition at line 83 of file Scenario1_Discovery.xaml.cs.

        {
            // Additional properties we would like about the device.
            // Property strings are documented here https://msdn.microsoft.com/en-us/library/windows/desktop/ff521659(v=vs.85).aspx
            string[] requestedProperties = { "System.Devices.Aep.DeviceAddress", "System.Devices.Aep.IsConnected", "System.Devices.Aep.Bluetooth.Le.IsConnectable" };

            // BT_Code: Example showing paired and non-paired in a single query.
            string aqsAllBluetoothLEDevices = "(System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\")";

            deviceWatcher =
                    DeviceInformation.CreateWatcher(
                        aqsAllBluetoothLEDevices,
                        requestedProperties,
                        DeviceInformationKind.AssociationEndpoint);

            // Register event handlers before starting the watcher.
            deviceWatcher.Added += DeviceWatcher_Added;
            deviceWatcher.Updated += DeviceWatcher_Updated;
            deviceWatcher.Removed += DeviceWatcher_Removed;
            deviceWatcher.EnumerationCompleted += DeviceWatcher_EnumerationCompleted;
            deviceWatcher.Stopped += DeviceWatcher_Stopped;

            // Start over with an empty collection.
            KnownDevices.Clear();

            // Start the watcher. Active enumeration is limited to approximately 30 seconds.
            // This limits power usage and reduces interference with other Bluetooth activities.
            // To monitor for the presence of Bluetooth LE devices for an extended period,
            // use the BluetoothLEAdvertisementWatcher runtime class. See the BluetoothAdvertisement
            // sample for an example.
            deviceWatcher.Start();
        }

void StopBleDeviceWatcher ( ) [inline, private]

Stops watching for all nearby Bluetooth devices.

Definition at line 119 of file Scenario1_Discovery.xaml.cs.

        {
            if (deviceWatcher != null)
            {
                // Unregister the event handlers.
                deviceWatcher.Added -= DeviceWatcher_Added;
                deviceWatcher.Updated -= DeviceWatcher_Updated;
                deviceWatcher.Removed -= DeviceWatcher_Removed;
                deviceWatcher.EnumerationCompleted -= DeviceWatcher_EnumerationCompleted;
                deviceWatcher.Stopped -= DeviceWatcher_Stopped;

                // Stop the watcher.
                deviceWatcher.Stop();
                deviceWatcher = null;
            }
        }

void SystemListBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 298 of file Scenario1_Discovery.xaml.cs.

        {
            RemoteSystem selectedRemoteSystem = ((sender as ListBox).SelectedItem as RemoteSystem);

            if (selectedRemoteSystem != null)
            {
                DeviceInfoTextBlock.Text = Environment.NewLine + "Manufacturer: " + selectedRemoteSystem.ManufacturerDisplayName + Environment.NewLine + "Model: " + selectedRemoteSystem.ModelDisplayName + Environment.NewLine;
            }
        }

void UpdateStatus | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 293 of file Scenario1_Discovery.xaml.cs.

        {
            m_rootPage.NotifyUser(status, statusType);
        }

Member Data Documentation

DeviceWatcher deviceWatcher [private]

Definition at line 37 of file Scenario1_Discovery.xaml.cs.

bool isBusy = false [private]

Definition at line 288 of file Scenario1_Discovery.xaml.cs.

ObservableCollection<BluetoothLEDeviceDisplay> KnownDevices = new ObservableCollection<BluetoothLEDeviceDisplay>() [private]

Definition at line 34 of file Scenario1_Discovery.xaml.cs.

RemoteSystemWatcher m_remoteSystemWatcher [private]

Definition at line 28 of file Scenario1_Discovery.xaml.cs.

MainPage m_rootPage [private]

Definition at line 27 of file Scenario1_Discovery.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario1_Discovery.xaml.cs.

ObservableCollection<RemoteSystem> SystemList = > m_rootPage.systemList

Definition at line 43 of file Scenario1_Discovery.xaml.cs.

List<DeviceInformation> UnknownDevices = new List<DeviceInformation>() [private]

Definition at line 35 of file Scenario1_Discovery.xaml.cs.

The documentation for this class was generated from the following files:
  • BluetoothLE/cs/Scenario1_Discovery.xaml.cs
  • RemoteSystems/cs/Scenario1_Discovery.xaml.cs
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DisplayDepthColorIR Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_DisplayDepthColorIR
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DisplayDepthColorIR Class Reference

List of all members.

Public Member Functions

Scenario1_DisplayDepthColorIR ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CleanupMediaCaptureAsync ()
void | FrameReader_FrameArrived (MediaFrameReader sender, MediaFrameArrivedEventArgs args)
async Task | InitializeMediaCaptureAsync (MediaFrameSourceGroup sourceGroup)
async void | NextButton_Click (object eventSender, RoutedEventArgs eventArgs)
async Task | PickNextMediaSourceAsync ()
async Task | PickNextMediaSourceWorkerAsync ()

Private Attributes

IReadOnlyDictionary
< MediaFrameSourceKind,
FrameRenderer > 		_frameRenderers
int | _groupSelectionIndex
readonly SimpleLogger | _logger
MediaCapture | _mediaCapture
List< MediaFrameReader > | _sourceReaders = new List<MediaFrameReader>()

Detailed Description

Definition at line 24 of file Scenario1_DisplayDepthColorIR.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DisplayDepthColorIR ( ) [inline]

Definition at line 34 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            InitializeComponent();
            _logger = new SimpleLogger(outputTextBlock);

            // This sample reads three kinds of frames: Color, Depth, and Infrared.
            _frameRenderers = new Dictionary<MediaFrameSourceKind, FrameRenderer>()
            {
                { MediaFrameSourceKind.Color, new FrameRenderer(colorPreviewImage) },
                { MediaFrameSourceKind.Depth, new FrameRenderer(depthPreviewImage)},
                { MediaFrameSourceKind.Infrared, new FrameRenderer(infraredPreviewImage)},
            };
        }

Member Function Documentation

task< void > CleanupMediaCaptureAsync ( ) [inline, private]

Unregisters FrameArrived event handlers, stops and disposes frame readers and disposes the MediaCapture object.

Definition at line 204 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            if (_mediaCapture != null)
            {
                using (var mediaCapture = _mediaCapture)
                {
                    _mediaCapture = null;

                    foreach (var reader in _sourceReaders)
                    {
                        if (reader != null)
                        {
                            reader.FrameArrived -= FrameReader_FrameArrived;
                            await reader.StopAsync();
                            reader.Dispose();
                        }
                    }
                    _sourceReaders.Clear();
                }
            }
        }

void FrameReader_FrameArrived | ( | MediaFrameReader | sender,
 |  | MediaFrameArrivedEventArgs | args |
 | ) |  |  | [inline, private]

Handles a frame arrived event and renders the frame to the screen.

Definition at line 229 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
            // This can return null if there is no such frame, or if the reader is not in the
            // "Started" state. The latter can occur if a FrameArrived event was in flight
            // when the reader was stopped.
            using (var frame = sender.TryAcquireLatestFrame())
            {
                if (frame != null)
                {
                    var renderer = _frameRenderers[frame.SourceKind];
                    renderer.ProcessFrame(frame);
                }
            }
        }

async Task InitializeMediaCaptureAsync ( MediaFrameSourceGroup sourceGroup ) [inline, private]

Initializes the MediaCapture object with the given source group.

Parameters:
sourceGroup SourceGroup with which to initialize.

Definition at line 172 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            if (_mediaCapture != null)
            {
                return;
            }

            // Initialize mediacapture with the source group.
            _mediaCapture = new MediaCapture();
            var settings = new MediaCaptureInitializationSettings
            {
                SourceGroup = sourceGroup,

                // This media capture can share streaming with other apps.
                SharingMode = MediaCaptureSharingMode.SharedReadOnly,

                // Only stream video and don't initialize audio capture devices.
                StreamingCaptureMode = StreamingCaptureMode.Video,

                // Set to CPU to ensure frames always contain CPU SoftwareBitmap images
                // instead of preferring GPU D3DSurface images.
                MemoryPreference = MediaCaptureMemoryPreference.Cpu
            };

            await _mediaCapture.InitializeAsync(settings);
            _logger.Log("MediaCapture is successfully initialized in shared mode.");
        }

async void NextButton_Click | ( | object | eventSender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 58 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            await PickNextMediaSourceAsync();
        }

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 53 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            await CleanupMediaCaptureAsync();
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            await PickNextMediaSourceAsync();
        }

task< void > PickNextMediaSourceAsync ( ) [inline, private]

Disables the "Next Group" button while we switch to the next camera source and start reading frames.

Definition at line 67 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            try
            {
                this.NextButton.IsEnabled = false;
                await PickNextMediaSourceWorkerAsync();
            }
            finally
            {
                this.NextButton.IsEnabled = true;
            }
        }

task< void > PickNextMediaSourceWorkerAsync ( ) [inline, private]

Switches to the next camera source and starts reading frames.

Definition at line 83 of file Scenario1_DisplayDepthColorIR.xaml.cs.

        {
            await CleanupMediaCaptureAsync();

            var allGroups = await MediaFrameSourceGroup.FindAllAsync();

            if (allGroups.Count == 0)
            {
                _logger.Log("No source groups found.");
                return;
            }

            // Pick next group in the array after each time the Next button is clicked.
            _groupSelectionIndex = (_groupSelectionIndex + 1) % allGroups.Count;
            var selectedGroup = allGroups[_groupSelectionIndex];

            _logger.Log($"Found {allGroups.Count} groups and selecting index [{_groupSelectionIndex}]: {selectedGroup.DisplayName}");

            try
            {
                // Initialize MediaCapture with selected group.
                // This can raise an exception if the source no longer exists,
                // or if the source could not be initialized.
                await InitializeMediaCaptureAsync(selectedGroup);
            }
            catch (Exception exception)
            {
                _logger.Log($"MediaCapture initialization error: {exception.Message}");
                await CleanupMediaCaptureAsync();
                return;
            }

            // Set up frame readers, register event handlers and start streaming.
            var startedKinds = new HashSet<MediaFrameSourceKind>();
            foreach (MediaFrameSource source in _mediaCapture.FrameSources.Values)
            {
                MediaFrameSourceKind kind = source.Info.SourceKind;

                // Ignore this source if we already have a source of this kind.
                if (startedKinds.Contains(kind))
                {
                    continue;
                }

                // Look for a format which the FrameRenderer can render.
                string requestedSubtype = null;
                foreach (MediaFrameFormat format in source.SupportedFormats)
                {
                    requestedSubtype = FrameRenderer.GetSubtypeForFrameReader(kind, format);
                    if (requestedSubtype != null)
                    {
                        // Tell the source to use the format we can render.
                        await source.SetFormatAsync(format);
                        break;
                    }
                }
                if (requestedSubtype == null)
                {
                    // No acceptable format was found. Ignore this source.
                    continue;
                }

                MediaFrameReader frameReader = await _mediaCapture.CreateFrameReaderAsync(source, requestedSubtype);

                frameReader.FrameArrived += FrameReader_FrameArrived;
                _sourceReaders.Add(frameReader);

                MediaFrameReaderStartStatus status = await frameReader.StartAsync();
                if (status == MediaFrameReaderStartStatus.Success)
                {
                    _logger.Log($"Started {kind} reader.");
                    startedKinds.Add(kind);
                }
                else
                {
                    _logger.Log($"Unable to start {kind} reader. Error: {status}");
                }
            }

            if (startedKinds.Count == 0)
            {
                _logger.Log($"No eligible sources in {selectedGroup.DisplayName}.");
            }
        }

Member Data Documentation

IReadOnlyDictionary<MediaFrameSourceKind, FrameRenderer> _frameRenderers [private]

Definition at line 29 of file Scenario1_DisplayDepthColorIR.xaml.cs.

int _groupSelectionIndex [private]

Definition at line 31 of file Scenario1_DisplayDepthColorIR.xaml.cs.

readonly SimpleLogger _logger [private]

Definition at line 32 of file Scenario1_DisplayDepthColorIR.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 26 of file Scenario1_DisplayDepthColorIR.xaml.cs.

List<MediaFrameReader> _sourceReaders = new List<MediaFrameReader>() [private]

Definition at line 28 of file Scenario1_DisplayDepthColorIR.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraFrames/cs/Scenario1_DisplayDepthColorIR.xaml.cs
  • CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Download Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Download
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Download Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Download ()
void | Dispose ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CancelAll_Click (object sender, RoutedEventArgs e)
async Task | DiscoverActiveDownloadsAsync ()
void | DownloadProgress (DownloadOperation download)
async Task | HandleDownloadAsync (DownloadOperation download, bool start)
bool | IsExceptionHandled (string title, Exception ex, DownloadOperation download=null)
void | Log (string message)
void | LogStatus (string message, NotifyType type)
void | MarshalLog (string value)
void | PauseAll_Click (object sender, RoutedEventArgs e)
void | ResumeAll_Click (object sender, RoutedEventArgs e)
async void | StartDownload (BackgroundTransferPriority priority)
void | StartDownload_Click (object sender, RoutedEventArgs e)
void | StartHighPriorityDownload_Click (object sender, RoutedEventArgs e)

Private Attributes

List< DownloadOperation > | activeDownloads
CancellationTokenSource | cts
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario1_Download.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Download ( ) [inline]

Definition at line 39 of file Scenario1_Download.xaml.cs.

        {
            cts = new CancellationTokenSource();

            this.InitializeComponent();
        }

Member Function Documentation

void CancelAll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 220 of file Scenario1_Download.xaml.cs.

        {
            Log("Canceling Downloads: " + activeDownloads.Count);

            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource and activeDownloads for future downloads.
            cts = new CancellationTokenSource();
            activeDownloads = new List<DownloadOperation>();
        }

async Task DiscoverActiveDownloadsAsync ( ) [inline, private]

Definition at line 73 of file Scenario1_Download.xaml.cs.

        {
            activeDownloads = new List<DownloadOperation>();

            IReadOnlyList<DownloadOperation> downloads = null;
            try
            {
                downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Discovery error", ex))
                {
                    throw;
                }
                return;
            }

            Log("Loading background downloads: " + downloads.Count);

            if (downloads.Count > 0)
            {
                List<Task> tasks = new List<Task>();
                foreach (DownloadOperation download in downloads)
                {
                    Log(String.Format(CultureInfo.CurrentCulture,
                        "Discovered background download: {0}, Status: {1}", download.Guid,
                        download.Progress.Status));

                    // Attach progress and completion handlers.
                    tasks.Add(HandleDownloadAsync(download, false));
                }

                // Don't await HandleDownloadAsync() in the foreach loop since we would attach to the second
                // download only when the first one completed; attach to the third download when the second one
                // completes etc. We want to attach to all downloads immediately.
                // If there are actions that need to be taken once downloads complete, await tasks here, outside
                // the loop.
                await Task.WhenAll(tasks);
            }
        }

void Dispose ( ) [inline]

Definition at line 46 of file Scenario1_Download.xaml.cs.

        {
            if (cts != null)
            {
                cts.Dispose();
                cts = null;
            }

            GC.SuppressFinalize(this);
        }

void DownloadProgress ( DownloadOperation download ) [inline, private]

Definition at line 233 of file Scenario1_Download.xaml.cs.

        {
            // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
            // we must make a local copy so that we can have a consistent view of that ever-changing state
            // throughout this method's lifetime.
            BackgroundDownloadProgress currentProgress = download.Progress;

            MarshalLog(String.Format(CultureInfo.CurrentCulture, "Progress: {0}, Status: {1}", download.Guid,
                currentProgress.Status));

            double percent = 100;
            if (currentProgress.TotalBytesToReceive > 0)
            {
                percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
            }

            MarshalLog(String.Format(
                CultureInfo.CurrentCulture,
                " - Transferred bytes: {0} of {1}, {2}%",
                currentProgress.BytesReceived,
                currentProgress.TotalBytesToReceive,
                percent));

            if (currentProgress.HasRestarted)
            {
                MarshalLog(" - Download restarted");
            }

            if (currentProgress.HasResponseChanged)
            {
                // We have received new response headers from the server.
                // Be aware that GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
                ResponseInformation response = download.GetResponseInformation();
                int headersCount = response != null ? response.Headers.Count : 0;

                MarshalLog(" - Response updated; Header count: " + headersCount);

                // If you want to stream the response data this is a good time to start.
                // download.GetResultStreamAt(0);
            }
        }

async Task HandleDownloadAsync | ( | DownloadOperation | download,
 |  | bool | start |
 | ) |  |  | [inline, private]

Definition at line 275 of file Scenario1_Download.xaml.cs.

        {
            try
            {
                LogStatus("Running: " + download.Guid, NotifyType.StatusMessage);

                // Store the download so we can pause/resume.
                activeDownloads.Add(download);

                Progress<DownloadOperation> progressCallback = new Progress<DownloadOperation>(DownloadProgress);
                if (start)
                {
                    // Start the download and attach a progress handler.
                    await download.StartAsync().AsTask(cts.Token, progressCallback);
                }
                else
                {
                    // The download was already running when the application started, re-attach the progress handler.
                    await download.AttachAsync().AsTask(cts.Token, progressCallback);
                }

                ResponseInformation response = download.GetResponseInformation();

                // GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
                string statusCode = response != null ? response.StatusCode.ToString() : String.Empty;

                LogStatus(
                    String.Format(
                        CultureInfo.CurrentCulture,
                        "Completed: {0}, Status Code: {1}",
                        download.Guid,
                        statusCode),
                    NotifyType.StatusMessage);
            }
            catch (TaskCanceledException)
            {
                LogStatus("Canceled: " + download.Guid, NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Execution error", ex, download))
                {
                    throw;
                }
            }
            finally
            {
                activeDownloads.Remove(download);
            }
        }

bool IsExceptionHandled | ( | string | title,
 |  | Exception | ex,
 |  | DownloadOperation | download = null |
 | ) |  |  | [inline, private]

Definition at line 326 of file Scenario1_Download.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            if (error == WebErrorStatus.Unknown)
            {
                return false;
            }

            if (download == null)
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0}: {1}", title, error),
                    NotifyType.ErrorMessage);
            }
            else
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0} - {1}: {2}", download.Guid, title,
                    error), NotifyType.ErrorMessage);
            }

            return true;
        }

void Log ( string message ) [inline, private]

Definition at line 357 of file Scenario1_Download.xaml.cs.

        {
            outputField.Text += message + "\r\n";
        }

void LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 362 of file Scenario1_Download.xaml.cs.

        {
            rootPage.NotifyUser(message, type);
            Log(message);
        }

void MarshalLog ( string value ) [inline, private]

Definition at line 349 of file Scenario1_Download.xaml.cs.

        {
            var ignore = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Log(value);
            });
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 62 of file Scenario1_Download.xaml.cs.

        {
            // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
            // Typically this can be done in the App class by overriding OnLaunched() and checking for
            // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
            // We do it here in the sample to keep the sample code consolidated.
            await DiscoverActiveDownloadsAsync();
        }

void PauseAll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 172 of file Scenario1_Download.xaml.cs.

        {
            Log("Downloads: " + activeDownloads.Count);

            foreach (DownloadOperation download in activeDownloads)
            {
                // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
                // we must make a local copy so that we can have a consistent view of that ever-changing state
                // throughout this method's lifetime.
                BackgroundDownloadProgress currentProgress = download.Progress;

                if (currentProgress.Status == BackgroundTransferStatus.Running)
                {
                    download.Pause();
                    Log("Paused: " + download.Guid);
                }
                else
                {
                    Log(String.Format(CultureInfo.CurrentCulture, "Skipped: {0}, Status: {1}", download.Guid,
                        currentProgress.Status));
                }
            }
        }

void ResumeAll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 196 of file Scenario1_Download.xaml.cs.

        {
            Log("Downloads: " + activeDownloads.Count);

            foreach (DownloadOperation download in activeDownloads)
            {
                // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
                // we must make a local copy so that we can have a consistent view of that ever-changing state
                // throughout this method's lifetime.
                BackgroundDownloadProgress currentProgress = download.Progress;

                if (currentProgress.Status == BackgroundTransferStatus.PausedByApplication)
                {
                    download.Resume();
                    Log("Resumed: " + download.Guid);
                }
                else
                {
                    Log(String.Format(CultureInfo.CurrentCulture, "Skipped: {0}, Status: {1}", download.Guid,
                        currentProgress.Status));
                }
            }
        }

void StartDownload ( BackgroundTransferPriority priority ) [inline, private]

Definition at line 115 of file Scenario1_Download.xaml.cs.

        {
            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Private Networks (Client and Server)" capability.
            Uri source;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out source))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            string destination = fileNameField.Text.Trim();

            if (string.IsNullOrWhiteSpace(destination))
            {
                rootPage.NotifyUser("A local file name is required.", NotifyType.ErrorMessage);
                return;
            }

            StorageFile destinationFile;
            try
            {
                StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
                destinationFile = await picturesLibrary.CreateFileAsync(
                    destination,
                    CreationCollisionOption.GenerateUniqueName);
            }
            catch (FileNotFoundException ex)
            {
                rootPage.NotifyUser("Error while creating file: " + ex.Message, NotifyType.ErrorMessage);
                return;
            }

            BackgroundDownloader downloader = new BackgroundDownloader();
            DownloadOperation download = downloader.CreateDownload(source, destinationFile);

            Log(String.Format(CultureInfo.CurrentCulture, "Downloading {0} to {1} with {2} priority, {3}",
                source.AbsoluteUri, destinationFile.Name, priority, download.Guid));

            download.Priority = priority;

            // Attach progress and completion handlers.
            await HandleDownloadAsync(download, true);
        }

void StartDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 162 of file Scenario1_Download.xaml.cs.

        {
            StartDownload(BackgroundTransferPriority.Default);
        }

void StartHighPriorityDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 167 of file Scenario1_Download.xaml.cs.

        {
            StartDownload(BackgroundTransferPriority.High);
        }

Member Data Documentation

List<DownloadOperation> activeDownloads [private]

Definition at line 36 of file Scenario1_Download.xaml.cs.

CancellationTokenSource cts [private]

Definition at line 37 of file Scenario1_Download.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario1_Download.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario1_Download.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Enable Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Enable
Public Member Functions

Scenario1_Enable Class Reference

List of all members.

Public Member Functions

Scenario1_Enable ()

Detailed Description

Definition at line 16 of file Scenario1_Enable.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Enable ( ) [inline]

Definition at line 18 of file Scenario1_Enable.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following files:
  • DisablingScreenCapture/cs/Scenario1_Enable.xaml.cs
  • DisablingScreenCapture/cpp/Scenario1_Enable.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_EventAndMenuHookup Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_EventAndMenuHookup
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_EventAndMenuHookup Class Reference

List of all members.

Public Member Functions

Scenario1_EventAndMenuHookup ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddCustomIconItems ()
void | AddFontGlyphItems ()
void | AddItem (object sender, RoutedEventArgs e)
void | AddKnownIconItems ()
void | Controller_ButtonClicked (RadialController sender, RadialControllerButtonClickedEventArgs args)
void | Controller_ControlAcquired (RadialController sender, RadialControllerControlAcquiredEventArgs args)
void | Controller_ControlLost (RadialController sender, object args)
void | Controller_RotationChanged (RadialController sender, RadialControllerRotationChangedEventArgs args)
void | Controller_ScreenContactContinued (RadialController sender, RadialControllerScreenContactContinuedEventArgs args)
void | Controller_ScreenContactEnded (RadialController sender, object args)
void | Controller_ScreenContactStarted (RadialController sender, RadialControllerScreenContactStartedEventArgs args)
void | CreateMenuItems ()
RadialControllerMenuItem | GetRadialControllerMenuItemFromSender (object sender)
void | InitializeController ()
void | LogContactInfo (RadialControllerScreenContact contact)
void | OnItemInvoked (int selectedItemIndex)
void | OnLogSizeChanged (object sender, object e)
void | PrintSelectedItem ()
void | PrintSelectedItem (object sender, RoutedEventArgs e)
void | RemoveItem (object sender, RoutedEventArgs e)
void | SelectItem (object sender, RoutedEventArgs e)
void | SelectPreviouslySelectedItem (object sender, RoutedEventArgs e)
void | ToggleMenuSuppression (Object sender, RoutedEventArgs args)

Private Attributes

int | activeItemIndex
RadialController | Controller
List< RadialControllerMenuItem > | menuItems = new List<RadialControllerMenuItem>()
MainPage rootPage
List< Slider > | sliders = new List<Slider>()
List< ToggleSwitch > | toggles = new List<ToggleSwitch>()

Detailed Description

Definition at line 24 of file Scenario1_EventAndMenuHookup.xaml.cs.

Constructor & Destructor Documentation

Scenario1_EventAndMenuHookup ( ) [inline]

Definition at line 34 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            this.InitializeComponent();

            InitializeController();
            CreateMenuItems();
        }

Member Function Documentation

void AddCustomIconItems ( ) [inline, private]

Definition at line 97 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item2", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item2.png"))));
            sliders.Add(slider2);
            toggles.Add(toggle2);

            menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item3", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item3.png"))));
            sliders.Add(slider3);
            toggles.Add(toggle3);
        }

void AddFontGlyphItems ( ) [inline, private]

Definition at line 108 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            // Using system font
            menuItems.Add(RadialControllerMenuItem.CreateFromFontGlyph("Item4", "\x2764", "Segoe UI Emoji"));
            sliders.Add(slider4);
            toggles.Add(toggle4);

            // Using custom font
            menuItems.Add(RadialControllerMenuItem.CreateFromFontGlyph("Item5", "\ue102", "Symbols", new Uri("ms-appx:///Assets/Symbols.ttf")));
            sliders.Add(slider5);
            toggles.Add(toggle5);
        }

void AddItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 130 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);

            if (!Controller.Menu.Items.Contains(radialControllerMenuItem))
            {
                Controller.Menu.Items.Add(radialControllerMenuItem);
                log.Text += "\n Added : " + radialControllerMenuItem.DisplayText;
            }
        }

void AddKnownIconItems ( ) [inline, private]

Definition at line 86 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            menuItems.Add(RadialControllerMenuItem.CreateFromKnownIcon("Item0", RadialControllerMenuKnownIcon.InkColor));
            sliders.Add(slider0);
            toggles.Add(toggle0);

            menuItems.Add(RadialControllerMenuItem.CreateFromKnownIcon("Item1", RadialControllerMenuKnownIcon.NextPreviousTrack));
            sliders.Add(slider1);
            toggles.Add(toggle1);
        }

void Controller_ButtonClicked | ( | RadialController | sender,
 |  | RadialControllerButtonClickedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 248 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Button Clicked ";
            LogContactInfo(args.Contact);

            ToggleSwitch toggle = toggles[activeItemIndex];
            toggle.IsOn = !toggle.IsOn;
        }

void Controller_ControlAcquired | ( | RadialController | sender,
 |  | RadialControllerControlAcquiredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 207 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Control Acquired";
            LogContactInfo(args.Contact);
        }

void Controller_ControlLost | ( | RadialController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 213 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Control Lost";
        }

void Controller_RotationChanged | ( | RadialController | sender,
 |  | RadialControllerRotationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 257 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Rotation Changed Delta = " + args.RotationDeltaInDegrees;
            LogContactInfo(args.Contact);

            sliders[activeItemIndex].Value += args.RotationDeltaInDegrees;
        }

void Controller_ScreenContactContinued | ( | RadialController | sender,
 |  | RadialControllerScreenContactContinuedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 224 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {

            log.Text += "\n Contact Continued ";
            LogContactInfo(args.Contact);
        }

void Controller_ScreenContactEnded | ( | RadialController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 231 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Contact Ended";
        }

void Controller_ScreenContactStarted | ( | RadialController | sender,
 |  | RadialControllerScreenContactStartedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 218 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            log.Text += "\n Contact Started ";
            LogContactInfo(args.Contact);
        }

void CreateMenuItems ( ) [inline, private]

Definition at line 70 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            AddKnownIconItems();
            AddCustomIconItems();
            AddFontGlyphItems();

            // Set the invoked callbacks for each menu item
            for (int i = 0; i < menuItems.Count; ++i)
            {
                RadialControllerMenuItem radialControllerItem = menuItems[i];
                int index = i;

                radialControllerItem.Invoked += (sender, args) => { OnItemInvoked(index); };
            }
        }

RadialControllerMenuItem GetRadialControllerMenuItemFromSender ( object sender ) [inline, private]

Definition at line 169 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            Button button = sender as Button;
            int index = Convert.ToInt32(button.CommandParameter);

            return menuItems[index];
        }

void InitializeController ( ) [inline, private]

Definition at line 55 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            Controller = RadialController.CreateForCurrentView();
            Controller.RotationResolutionInDegrees = 1;

            // Wire events
            Controller.RotationChanged += Controller_RotationChanged;
            Controller.ButtonClicked += Controller_ButtonClicked;
            Controller.ScreenContactStarted += Controller_ScreenContactStarted;
            Controller.ScreenContactContinued += Controller_ScreenContactContinued;
            Controller.ScreenContactEnded += Controller_ScreenContactEnded;
            Controller.ControlAcquired += Controller_ControlAcquired;
            Controller.ControlLost += Controller_ControlLost;
        }

void LogContactInfo ( RadialControllerScreenContact contact ) [inline, private]

Definition at line 265 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            if (contact != null)
            {
                log.Text += "\n Bounds = " + contact.Bounds.ToString();
                log.Text += "\n Position = " + contact.Position.ToString();
            }
        }

void OnItemInvoked ( int selectedItemIndex ) [inline, private]

Definition at line 121 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            if (activeItemIndex != selectedItemIndex)
            {
                activeItemIndex = selectedItemIndex;
                PrintSelectedItem();
            }
        }

void OnLogSizeChanged | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 202 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            logViewer.ChangeView(null, logViewer.ExtentHeight, null);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            if (Controller != null)
            {
                Controller.Menu.Items.Clear();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void PrintSelectedItem ( ) [inline, private]

Definition at line 182 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            RadialControllerMenuItem selectedMenuItem = Controller.Menu.GetSelectedMenuItem();
            string itemName = string.Empty;

            if (selectedMenuItem == menuItems[activeItemIndex])
            {
                itemName = selectedMenuItem.DisplayText;
            }
            else if (selectedMenuItem == null)
            {
                itemName = "System Item";
            }

            if (itemName != string.Empty)
            {
                log.Text += "\n Selected : " + itemName;
            }
        }

void PrintSelectedItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 177 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            PrintSelectedItem();
        }

void RemoveItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 141 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);

            if (Controller.Menu.Items.Contains(radialControllerMenuItem))
            {
                Controller.Menu.Items.Remove(radialControllerMenuItem);
                log.Text += "\n Removed : " + radialControllerMenuItem.DisplayText;
            }
        }

void SelectItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);

            if (Controller.Menu.Items.Contains(radialControllerMenuItem))
            {
                Controller.Menu.SelectMenuItem(radialControllerMenuItem);
                PrintSelectedItem();
            }
        }

void SelectPreviouslySelectedItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 163 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            Controller.Menu.TrySelectPreviouslySelectedMenuItem();
            PrintSelectedItem();
        }

void ToggleMenuSuppression | ( | Object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 236 of file Scenario1_EventAndMenuHookup.xaml.cs.

        {
            RadialControllerConfiguration radialControllerConfig = RadialControllerConfiguration.GetForCurrentView();

            if (MenuSuppressionToggleSwitch.IsOn)
            {
                radialControllerConfig.ActiveControllerWhenMenuIsSuppressed = Controller;
            }

            radialControllerConfig.IsMenuSuppressed = MenuSuppressionToggleSwitch.IsOn;
        }

Member Data Documentation

int activeItemIndex [private]

Definition at line 29 of file Scenario1_EventAndMenuHookup.xaml.cs.

RadialController Controller [private]

Definition at line 27 of file Scenario1_EventAndMenuHookup.xaml.cs.

List<RadialControllerMenuItem> menuItems = new List<RadialControllerMenuItem>() [private]

Definition at line 30 of file Scenario1_EventAndMenuHookup.xaml.cs.

MainPage rootPage [private]

Definition at line 26 of file Scenario1_EventAndMenuHookup.xaml.cs.

List<Slider> sliders = new List<Slider>() [private]

Definition at line 31 of file Scenario1_EventAndMenuHookup.xaml.cs.

List<ToggleSwitch> toggles = new List<ToggleSwitch>() [private]

Definition at line 32 of file Scenario1_EventAndMenuHookup.xaml.cs.

The documentation for this class was generated from the following files:
  • RadialController/cs/Scenario1_EventAndMenuHookup.xaml.cs
  • RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ExampleOperations Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ExampleOperations
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario1_ExampleOperations Class Reference

Scenario that illustrates using OpenCV along with camera frames.

List of all members.

Public Member Functions

Scenario1_ExampleOperations ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs args)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum OperationType {
Blur = 0, HoughLines, Contours, Histogram,
MotionDetector
}

Private Member Functions

async Task | CleanupMediaCaptureAsync ()
void | ColorFrameReader_FrameArrivedAsync (MediaFrameReader sender, MediaFrameArrivedEventArgs args)
async Task | InitializeMediaCaptureAsync (MediaFrameSourceGroup sourceGroup)
void | OperationComboBox_SelectionChanged (object sender, RoutedEventArgs e)
void | UpdateFPS (object sender, object e)

Private Attributes

DispatcherTimer | _FPSTimer = null
int | _frameCount = 0
OpenCVHelper | _helper
MediaCapture | _mediaCapture = null
FrameRenderer | _outputRenderer = null
FrameRenderer | _previewRenderer = null
MediaFrameReader | _reader = null
OperationType currentOperation
const int | IMAGE_COLS = 640
const int | IMAGE_ROWS = 480
MainPage rootPage

Detailed Description

Definition at line 30 of file Scenario1_ExampleOperations.xaml.cs.

Member Enumeration Documentation

enum OperationType [private]
Enumerator:
Blur
HoughLines
Contours
Histogram
MotionDetector

Definition at line 48 of file Scenario1_ExampleOperations.xaml.cs.

        {
            Blur = 0,
            HoughLines,
            Contours,
            Histogram,
            MotionDetector
        }

Constructor & Destructor Documentation

Scenario1_ExampleOperations ( ) [inline]

Definition at line 58 of file Scenario1_ExampleOperations.xaml.cs.

        {
            this.InitializeComponent();
            _previewRenderer = new FrameRenderer(PreviewImage);
            _outputRenderer = new FrameRenderer(OutputImage);

            _helper = new OpenCVHelper();

            _FPSTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            _FPSTimer.Tick += UpdateFPS;
        }

Member Function Documentation

async Task CleanupMediaCaptureAsync ( ) [inline, private]

Unregisters FrameArrived event handlers, stops and disposes frame readers and disposes the MediaCapture object.

Definition at line 99 of file Scenario1_ExampleOperations.xaml.cs.

        {
            if (_mediaCapture != null)
            {
                await _reader.StopAsync();
                _reader.FrameArrived -= ColorFrameReader_FrameArrivedAsync;
                _reader.Dispose();
                _mediaCapture = null;
            }
        }

void ColorFrameReader_FrameArrivedAsync | ( | MediaFrameReader | sender,
 |  | MediaFrameArrivedEventArgs | args |
 | ) |  |  | [inline, private]

Handles a frame arrived event and renders the frame to the screen.

Definition at line 175 of file Scenario1_ExampleOperations.xaml.cs.

        {
            var frame = sender.TryAcquireLatestFrame();
            if (frame != null)
            {
                SoftwareBitmap originalBitmap = null;
                var inputBitmap = frame.VideoMediaFrame?.SoftwareBitmap;
                if (inputBitmap != null)
                {
                    // The XAML Image control can only display images in BRGA8 format with premultiplied or no alpha
                    // The frame reader as configured in this sample gives BGRA8 with straight alpha, so need to convert it
                    originalBitmap = SoftwareBitmap.Convert(inputBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);

                    SoftwareBitmap outputBitmap = new SoftwareBitmap(BitmapPixelFormat.Bgra8, originalBitmap.PixelWidth, originalBitmap.PixelHeight, BitmapAlphaMode.Premultiplied);

                    // Operate on the image in the manner chosen by the user.
                    if (currentOperation == OperationType.Blur)
                    {
                        _helper.Blur(originalBitmap, outputBitmap);
                    }
                    else if (currentOperation == OperationType.HoughLines)
                    {
                        _helper.HoughLines(originalBitmap, outputBitmap);
                    }
                    else if (currentOperation == OperationType.Contours)
                    {
                        _helper.Contours(originalBitmap, outputBitmap);
                    }
                    else if (currentOperation == OperationType.Histogram)
                    {
                        _helper.Histogram(originalBitmap, outputBitmap);
                    }
                    else if (currentOperation == OperationType.MotionDetector)
                    {
                        _helper.MotionDetector(originalBitmap, outputBitmap);
                    }

                    // Display both the original bitmap and the processed bitmap.
                    _previewRenderer.RenderFrame(originalBitmap);
                    _outputRenderer.RenderFrame(outputBitmap);
                }

                Interlocked.Increment(ref _frameCount);
            }
        }

async Task InitializeMediaCaptureAsync ( MediaFrameSourceGroup sourceGroup ) [inline, private]

Initializes the MediaCapture object with the given source group.

Parameters:
sourceGroup SourceGroup with which to initialize.

Definition at line 77 of file Scenario1_ExampleOperations.xaml.cs.

        {
            if (_mediaCapture != null)
            {
                return;
            }

            _mediaCapture = new MediaCapture();
            var settings = new MediaCaptureInitializationSettings()
            {
                SourceGroup = sourceGroup,
                SharingMode = MediaCaptureSharingMode.ExclusiveControl,
                StreamingCaptureMode = StreamingCaptureMode.Video,
                MemoryPreference = MediaCaptureMemoryPreference.Cpu
            };
            await _mediaCapture.InitializeAsync(settings);
        }

override async void OnNavigatedFrom ( NavigationEventArgs args ) [inline, protected]

Definition at line 166 of file Scenario1_ExampleOperations.xaml.cs.

        {
            _FPSTimer.Stop();
            await CleanupMediaCaptureAsync();
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 116 of file Scenario1_ExampleOperations.xaml.cs.

        {
            rootPage = MainPage.Current;

            // setting up the combobox, and default operation
            OperationComboBox.ItemsSource = Enum.GetValues(typeof(OperationType));
            OperationComboBox.SelectedIndex = 0;
            currentOperation = OperationType.Blur;

            // Find the sources
            var allGroups = await MediaFrameSourceGroup.FindAllAsync();
            var sourceGroups = allGroups.Select(g => new
            {
                Group = g,
                SourceInfo = g.SourceInfos.FirstOrDefault(i => i.SourceKind == MediaFrameSourceKind.Color)
            }).Where(g => g.SourceInfo != null).ToList();

            if (sourceGroups.Count == 0)
            {
                // No camera sources found
                return;
            }
            var selectedSource = sourceGroups.FirstOrDefault();

            // Initialize MediaCapture
            try
            {
                await InitializeMediaCaptureAsync(selectedSource.Group);
            }
            catch (Exception exception)
            {
                Debug.WriteLine("MediaCapture initialization error: " + exception.Message);
                await CleanupMediaCaptureAsync();
                return;
            }

            // Create the frame reader
            MediaFrameSource frameSource = _mediaCapture.FrameSources[selectedSource.SourceInfo.Id];
            BitmapSize size = new BitmapSize() // Choose a lower resolution to make the image processing more performant
            {
                Height = IMAGE_ROWS,
                Width = IMAGE_COLS
            };
            _reader = await _mediaCapture.CreateFrameReaderAsync(frameSource, MediaEncodingSubtypes.Bgra8, size);
            _reader.FrameArrived += ColorFrameReader_FrameArrivedAsync;
            await _reader.StartAsync();

            _FPSTimer.Start();
        }

void OperationComboBox_SelectionChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 221 of file Scenario1_ExampleOperations.xaml.cs.

        {
            currentOperation = (OperationType)((sender as ComboBox).SelectedItem);
            if (OperationType.Blur == currentOperation)
            {
                this.CurrentOperationTextBlock.Text = "Current: Blur";
            }
            else if (OperationType.Contours == currentOperation)
            {
                this.CurrentOperationTextBlock.Text = "Current: Contours";
            }
            else if (OperationType.Histogram == currentOperation)
            {
                this.CurrentOperationTextBlock.Text = "Current: Histogram of RGB channels";
            }
            else if (OperationType.HoughLines == currentOperation)
            {
                this.CurrentOperationTextBlock.Text = "Current: Line detection";
            }
            else if (OperationType.MotionDetector == currentOperation)
            {
                this.CurrentOperationTextBlock.Text = "Current: Motion detection";
            }
            else
            {
                this.CurrentOperationTextBlock.Text = string.Empty;
            }
        }

void UpdateFPS | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario1_ExampleOperations.xaml.cs.

        {
            var frameCount = Interlocked.Exchange(ref _frameCount, 0);
            this.FPSMonitor.Text = "FPS: " + frameCount;
        }

Member Data Documentation

DispatcherTimer _FPSTimer = null [private]

Definition at line 46 of file Scenario1_ExampleOperations.xaml.cs.

int _frameCount = 0 [private]

Definition at line 39 of file Scenario1_ExampleOperations.xaml.cs.

OpenCVHelper _helper [private]

Definition at line 44 of file Scenario1_ExampleOperations.xaml.cs.

MediaCapture _mediaCapture = null [private]

Definition at line 34 of file Scenario1_ExampleOperations.xaml.cs.

FrameRenderer _outputRenderer = null [private]

Definition at line 37 of file Scenario1_ExampleOperations.xaml.cs.

FrameRenderer _previewRenderer = null [private]

Definition at line 36 of file Scenario1_ExampleOperations.xaml.cs.

MediaFrameReader _reader = null [private]

Definition at line 35 of file Scenario1_ExampleOperations.xaml.cs.

OperationType currentOperation [private]

Definition at line 56 of file Scenario1_ExampleOperations.xaml.cs.

const int IMAGE_COLS = 640 [private]

Definition at line 42 of file Scenario1_ExampleOperations.xaml.cs.

const int IMAGE_ROWS = 480 [private]

Definition at line 41 of file Scenario1_ExampleOperations.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file Scenario1_ExampleOperations.xaml.cs.

The documentation for this class was generated from the following file:
  • CameraOpenCV/cs/Scenario1_ExampleOperations.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ExtractTextSegments Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ExtractTextSegments
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_ExtractTextSegments Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_ExtractTextSegments ()

Private Member Functions

void | SelectionSegmentsButton_Click (object sender, RoutedEventArgs e)
void | WordSegmentsButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario1_ExtractTextSegments.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ExtractTextSegments ( ) [inline]

Definition at line 28 of file Scenario1_ExtractTextSegments.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void SelectionSegmentsButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Selection Segments' button.

When this button is activated, the Text Segmentation API will calculate the selection segments from the given input string and language tag, and then print out the word and alternate-form segments for that language.

Selection segments differ from word segments in that they describe the bounds between active-selection snapping behavior.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 117 of file Scenario1_ExtractTextSegments.xaml.cs.

        {
            // Initialize and obtain input values
            StringBuilder notifyText = new StringBuilder();

            // Obtain the input string value, check for non-emptiness
            String inputStringText = inputStringBox.Text;
            if (String.IsNullOrEmpty(inputStringText))
            {
                notifyText = new StringBuilder("Cannot compute selection segments: input string is empty.");
                rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                return;
            }

            // Obtain the language tag value, check for non-emptiness
            // Ex. Valid Values:
            //     "en-US" (English (United States))
            //     "fr-FR" (French (France))
            //     "de-DE" (German (Germany))
            //     "ja-JP" (Japanese (Japan))
            //     "ar-SA" (Arabic (Saudi Arabia))
            //     "zh-CN" (China (PRC))
            String languageTagText = languageTagBox.Text;
            if (String.IsNullOrEmpty(languageTagText))
            {
                notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
                languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
            }
            else
            {
                if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
                {
                    notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Notify that we are going to calculate selection segments
            notifyText.AppendLine("\nCalculating selection segments ...\n");
            notifyText.AppendLine("Input: \"" + inputStringText + "\"");
            notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");

            // Construct the SelectableWordsSegmenter instance
            var segmenter = new Windows.Data.Text.SelectableWordsSegmenter(languageTagText);
            var selectionSegments = segmenter.GetTokens(inputStringText);

            // Iterate over the tokenized segments
            foreach (var selectionSegment in selectionSegments)
            {
                notifyText.AppendLine("\tWord---->\"" + selectionSegment.Text + "\"");
            }

            // Set output box text to the contents of the StringBuilder instance
            rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
        }

void WordSegmentsButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Word Segments' button.

When this button is activated, the Text Segmentation API will calculate the word segments from the given input string and language tag, and then print out the word and alternate-form segments for that language.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 43 of file Scenario1_ExtractTextSegments.xaml.cs.

        {
            // Initialize and obtain input values
            StringBuilder notifyText = new StringBuilder();

            // Obtain the input string value, check for non-emptiness
            String inputStringText = inputStringBox.Text;
            if (String.IsNullOrEmpty(inputStringText))
            {
                notifyText = new StringBuilder("Cannot compute word segments: input string is empty.");
                rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                return;
            }

            // Obtain the language tag value, check for non-emptiness
            // Ex. Valid Values:
            //     "en-US" (English (United States))
            //     "fr-FR" (French (France))
            //     "de-DE" (German (Germany))
            //     "ja-JP" (Japanese (Japan))
            //     "ar-SA" (Arabic (Saudi Arabia))
            //     "zh-CN" (China (PRC))
            String languageTagText = languageTagBox.Text;
            if (String.IsNullOrEmpty(languageTagText))
            {
                notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
                languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
            }
            else
            {
                if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
                {
                    notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Notify that we are going to calculate word segments
            notifyText.AppendLine("\nCalculating word segments ...\n");
            notifyText.AppendLine("Input: \"" + inputStringText + "\"");
            notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");

            // Construct the WordsSegmenter instance
            var segmenter = new Windows.Data.Text.WordsSegmenter(languageTagText);
            var wordSegments = segmenter.GetTokens(inputStringText);

            // Iterate over the tokenized segments
            foreach (var wordSegment in wordSegments)
            {
                notifyText.AppendLine("\tWord---->\"" + wordSegment.Text + "\"");
                foreach (var alternateForm in wordSegment.AlternateForms)
                {
                    notifyText.AppendLine("\t\tAlternate---->\"" + alternateForm.AlternateText + "\"");
                }
            }

            // send notifyText to the output pane
            rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario1_ExtractTextSegments.xaml.cs.

The documentation for this class was generated from the following files:
  • TextSegmentation/cs/Scenario1_ExtractTextSegments.xaml.cs
  • TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Files Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Files
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Files Class Reference

List of all members.

Public Member Functions

Scenario1_Files ()
Scenario1_Files ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ChooseFile_Click (object sender, RoutedEventArgs e)
async void | ChooseFolder_Click (object sender, RoutedEventArgs e)
void | DisplayOutput ()
async void | Increment_Local_Click (Object sender, RoutedEventArgs e)
async void | Increment_LocalCache_Click (Object sender, RoutedEventArgs e)
async void | Increment_Temporary_Click (Object sender, RoutedEventArgs e)
async void | ProtectL1_Click (object sender, RoutedEventArgs e)
async void | ProtectL2_Click (object sender, RoutedEventArgs e)
async void | Read_Local_Counter ()
async void | Read_LocalCache_Counter ()
async void | Read_Temporary_Counter ()
void | ReportStatus (string operation, UserDataStorageItemProtectionStatus status)
async void | Unprotect_Click (object sender, RoutedEventArgs e)
void | UpdateItem (IStorageItem item)

Private Attributes

const string | filename = "sampleFile.txt"
int | localCacheCounter = 0
StorageFolder | localCacheFolder = ApplicationData.Current.LocalCacheFolder
int | localCounter = 0
StorageFolder | localFolder = ApplicationData.Current.LocalFolder
MainPage rootPage = MainPage.Current
IStorageItem | selectedItem = null
int | temporaryCounter = 0
StorageFolder | temporaryFolder = ApplicationData.Current.TemporaryFolder
UserDataProtectionManager | userDataProtectionManager = null

Detailed Description

Definition at line 19 of file Scenario1_Files.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Files ( ) [inline]

Definition at line 30 of file Scenario1_Files.xaml.cs.

        {
            InitializeComponent();
        }

Scenario1_Files ( ) [inline]

Definition at line 29 of file Scenario1_Files.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ChooseFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario1_Files.xaml.cs.

        {
            var picker = new FileOpenPicker();
            picker.FileTypeFilter.Add("*");
            UpdateItem(await picker.PickSingleFileAsync());
        }

async void ChooseFolder_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario1_Files.xaml.cs.

        {
            var picker = new FolderPicker();
            UpdateItem(await picker.PickSingleFolderAsync());
        }

void DisplayOutput ( ) [inline, private]

Definition at line 136 of file Scenario1_Files.xaml.cs.

        {
            Read_Local_Counter();
            Read_LocalCache_Counter();
            Read_Temporary_Counter();
        }

async void Increment_Local_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario1_Files.xaml.cs.

        {
            localCounter++;

            StorageFile file = await localFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
            await FileIO.WriteTextAsync(file, localCounter.ToString());

            Read_Local_Counter();
        }

async void Increment_LocalCache_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario1_Files.xaml.cs.

        {
            localCacheCounter++;

            StorageFile file = await localCacheFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
            await FileIO.WriteTextAsync(file, localCacheCounter.ToString());

            Read_LocalCache_Counter();
        }

async void Increment_Temporary_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario1_Files.xaml.cs.

        {
            temporaryCounter++;

            StorageFile file = await temporaryFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
            await FileIO.WriteTextAsync(file, temporaryCounter.ToString());

            Read_Temporary_Counter();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 143 of file Scenario1_Files.xaml.cs.

        {
            DisplayOutput();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_Files.xaml.cs.

        {
            userDataProtectionManager = UserDataProtectionManager.TryGetDefault();
            if (userDataProtectionManager != null)
            {
                AvailablePanel.Visibility = Visibility.Visible;
                UnavailablePanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                AvailablePanel.Visibility = Visibility.Collapsed;
                UnavailablePanel.Visibility = Visibility.Visible;
            }
        }

async void ProtectL1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 76 of file Scenario1_Files.xaml.cs.

        {
            UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.AfterFirstUnlock);
            ReportStatus("Protect L1", status);
        }

async void ProtectL2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario1_Files.xaml.cs.

        {
            UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.WhileUnlocked);
            ReportStatus("Protect L2", status);
        }

async void Read_Local_Counter ( ) [inline, private]

Definition at line 65 of file Scenario1_Files.xaml.cs.

        {
            StorageFile file = (await localFolder.TryGetItemAsync(filename)) as StorageFile;
            if (file != null)
            {
                string text = await FileIO.ReadTextAsync(file);

                LocalOutputTextBlock.Text = "Local Counter: " + text;

                localCounter = int.Parse(text);
            }
            else
            {
                LocalOutputTextBlock.Text = "Local Counter: <not found>";
            }
        }

async void Read_LocalCache_Counter ( ) [inline, private]

Definition at line 92 of file Scenario1_Files.xaml.cs.

        {
            StorageFile file = (await localCacheFolder.TryGetItemAsync(filename)) as StorageFile;
            if (file != null)
            {
                string text = await FileIO.ReadTextAsync(file);

                LocalCacheOutputTextBlock.Text = "LocalCache Counter: " + text;

                localCacheCounter = int.Parse(text);
            }
            else
            {
                LocalCacheOutputTextBlock.Text = "LocalCache Counter: <not found>";
            }
        }

async void Read_Temporary_Counter ( ) [inline, private]

Definition at line 119 of file Scenario1_Files.xaml.cs.

        {
            StorageFile file = (await temporaryFolder.TryGetItemAsync(filename)) as StorageFile;
            if (file != null)
            {
                string text = await FileIO.ReadTextAsync(file);

                TemporaryOutputTextBlock.Text = "Temporary Counter: " + text;

                temporaryCounter = int.Parse(text);
            }
            else
            {
                TemporaryOutputTextBlock.Text = "Temporary Counter: <not found>";
            }
        }

void ReportStatus | ( | string | operation,
 |  | UserDataStorageItemProtectionStatus | status |
 | ) |  |  | [inline, private]

Definition at line 94 of file Scenario1_Files.xaml.cs.

        {
            switch (status)
            {
                case UserDataStorageItemProtectionStatus.Succeeded:
                    rootPage.NotifyUser(operation + " succeeded", NotifyType.StatusMessage);
                    break;

                case UserDataStorageItemProtectionStatus.NotProtectable:
                    rootPage.NotifyUser(operation + " failed: Not protectable", NotifyType.ErrorMessage);
                    break;

                case UserDataStorageItemProtectionStatus.DataUnavailable:
                    rootPage.NotifyUser(operation + " failed: Data unavailable", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser(operation + " failed: Unknown failure", NotifyType.ErrorMessage);
                    break;
            }
        }

async void Unprotect_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario1_Files.xaml.cs.

        {
            UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.Always);
            ReportStatus("Unprotect", status);
        }

void UpdateItem ( IStorageItem item ) [inline, private]

Definition at line 62 of file Scenario1_Files.xaml.cs.

        {
            selectedItem = item;
            if (selectedItem != null)
            {
                ItemOperationsPanel.Visibility = Visibility.Visible;
                ItemNameBlock.Text = item.Path;
            }
            else
            {
                ItemOperationsPanel.Visibility = Visibility.Collapsed;
            }
        }

Member Data Documentation

const string filename = "sampleFile.txt" [private]

Definition at line 28 of file Scenario1_Files.xaml.cs.

int localCacheCounter = 0 [private]

Definition at line 24 of file Scenario1_Files.xaml.cs.

StorageFolder localCacheFolder = ApplicationData.Current.LocalCacheFolder [private]

Definition at line 23 of file Scenario1_Files.xaml.cs.

int localCounter = 0 [private]

Definition at line 22 of file Scenario1_Files.xaml.cs.

StorageFolder localFolder = ApplicationData.Current.LocalFolder [private]

Definition at line 21 of file Scenario1_Files.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_Files.xaml.cs.

IStorageItem selectedItem = null [private]

Definition at line 27 of file Scenario1_Files.xaml.cs.

int temporaryCounter = 0 [private]

Definition at line 26 of file Scenario1_Files.xaml.cs.

StorageFolder temporaryFolder = ApplicationData.Current.TemporaryFolder [private]

Definition at line 25 of file Scenario1_Files.xaml.cs.

UserDataProtectionManager userDataProtectionManager = null [private]

Definition at line 26 of file Scenario1_Files.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationData/cs/Scenario1_Files.xaml.cs
  • PersonalDataEncryption/cs/Scenario1_Files.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindClaimEnable Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_FindClaimEnable
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_FindClaimEnable Class Reference

List of all members.

Public Member Functions

Scenario1_FindClaimEnable ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ClaimAndEnable_Click ()
async void | FindPrinter_Click ()
void | IsImportantTransaction_Click ()
void | ReleaseAll_Click ()
void | ReleaseClaim_Click ()
void | UpdateButtons ()

Private Attributes

bool | isBusy = false
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_FindClaimEnable.xaml.cs.

Constructor & Destructor Documentation

Scenario1_FindClaimEnable ( ) [inline]

Definition at line 29 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClaimAndEnable_Click ( ) [inline, private]

Definition at line 119 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            isBusy = true;
            UpdateButtons();
            rootPage.ClaimedPrinter = await rootPage.Printer.ClaimPrinterAsync();
            if (rootPage.ClaimedPrinter == null)
            {
                rootPage.NotifyUser("Unable to claim printer", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser("Claimed printer", NotifyType.StatusMessage);

                // Register for the ReleaseDeviceRequested event so we know when somebody
                // wants to claim the printer away from us.
                rootPage.SubscribeToReleaseDeviceRequested();

                if (await rootPage.ClaimedPrinter.EnableAsync())
                {
                    rootPage.NotifyUser("Enabled printer.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Could not enable printer", NotifyType.ErrorMessage);
                    rootPage.ReleaseClaimedPrinter();
                }
            }

            isBusy = false;
            UpdateButtons();
        }

void FindPrinter_Click ( ) [inline, private]

Definition at line 80 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            isBusy = true;
            UpdateButtons();
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            rootPage.ReleaseAllPrinters();

            // Select a PosPrinter device using the Device Picker.
            DevicePicker devicePicker = new DevicePicker();
            devicePicker.Filter.SupportedDeviceSelectors.Add(PosPrinter.GetDeviceSelector());

            // Anchor the picker on the Find button.
            GeneralTransform ge = FindButton.TransformToVisual(Window.Current.Content as UIElement);
            Rect rect = ge.TransformBounds(new Rect(0, 0, FindButton.ActualWidth, FindButton.ActualHeight));

            DeviceInformation deviceInfo = await devicePicker.PickSingleDeviceAsync(rect);
            rootPage.deviceInfo = deviceInfo;
            PosPrinter printer = null;
            if (deviceInfo != null)
            {
                printer = await PosPrinter.FromIdAsync(deviceInfo.Id);
            }
            if (printer != null && printer.Capabilities.Receipt.IsPrinterPresent)
            {
                rootPage.Printer = printer;
                rootPage.NotifyUser("Found receipt printer.", NotifyType.StatusMessage);
            }
            else
            {
                // Get rid of the printer we can't use.
                printer?.Dispose();
                rootPage.NotifyUser("Please select a device whose printer is present.", NotifyType.ErrorMessage);
            }

            isBusy = false;
            UpdateButtons();
        }

void IsImportantTransaction_Click ( ) [inline, private]

Definition at line 151 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            rootPage.IsAnImportantTransaction = RetainDeviceCheckBox.IsChecked.Value;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            rootPage.StateChanged -= UpdateButtons;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            RetainDeviceCheckBox.IsChecked = rootPage.IsAnImportantTransaction;
            rootPage.StateChanged += UpdateButtons;
            UpdateButtons();
        }

void ReleaseAll_Click ( ) [inline, private]

Definition at line 161 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            rootPage.ReleaseAllPrinters();
        }

void ReleaseClaim_Click ( ) [inline, private]

Definition at line 156 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            rootPage.ReleaseClaimedPrinter();
        }

void UpdateButtons ( ) [inline, private]

Definition at line 46 of file Scenario1_FindClaimEnable.xaml.cs.

        {
            PrinterNameRun.Text = (rootPage.Printer == null) ? "None" : rootPage.deviceInfo.Name + " (" + rootPage.Printer.DeviceId + ")";
            if (isBusy)
            {
                FindButton.IsEnabled = false;
                ClaimAndEnableButton.IsEnabled = false;
                ReleaseClaimedPrinterButton.IsEnabled = false;
                ReleaseAllPrintersButton.IsEnabled = false;
            }
            else if (rootPage.Printer == null)
            {
                FindButton.IsEnabled = true;
                ClaimAndEnableButton.IsEnabled = false;
                ReleaseClaimedPrinterButton.IsEnabled = false;
                ReleaseAllPrintersButton.IsEnabled = false;
            }
            else
            {
                FindButton.IsEnabled = false;
                ReleaseAllPrintersButton.IsEnabled = true;
                if (rootPage.ClaimedPrinter == null)
                {
                    ClaimAndEnableButton.IsEnabled = true;
                    ReleaseClaimedPrinterButton.IsEnabled = false;
                }
                else
                {
                    ClaimAndEnableButton.IsEnabled = false;
                    ReleaseClaimedPrinterButton.IsEnabled = true;
                }
            }
        }

Member Data Documentation

bool isBusy = false [private]

Definition at line 27 of file Scenario1_FindClaimEnable.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario1_FindClaimEnable.xaml.cs.

The documentation for this class was generated from the following files:
  • PosPrinter/cs/Scenario1_FindClaimEnable.xaml.cs
  • PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindId Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_FindId
Public Member Functions | Private Member Functions

Scenario1_FindId Class Reference

List of all members.

Public Member Functions

Scenario1_FindId ()

Private Member Functions

void | Default_Click (object sender, RoutedEventArgs e)
List< String > | FindIdsInString (String inputString)

Detailed Description

Definition at line 24 of file Scenario1_FindId.xaml.cs.

Constructor & Destructor Documentation

Scenario1_FindId ( ) [inline]

Definition at line 26 of file Scenario1_FindId.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Default_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Extract Identifiers' button.

It relies on the FindIdsInString method to implement the logic.

Parameters:
sender
e

Definition at line 114 of file Scenario1_FindId.xaml.cs.

        {
            var results = FindIdsInString(TextInput.Text);
            TextOutput.Text = String.Join(", ", results);
        }

List<String> FindIdsInString ( String inputString ) [inline, private]
Parameters:
inputString String from which to extract ids
Returns:
List of individual ids found in the input string

Definition at line 38 of file Scenario1_FindId.xaml.cs.

        {
            // List where we maintain the ids found in the input string
            List<String> idList = new List<String>();

            // Maintains the beginning index of the id found in the input string
            int indexIdStart = -1;

            // Iterate through each of the characters in the string
            int i = 0;
            while (i < inputString.Length)
            {
                int nextIndex;
                uint codepoint = inputString[i];

                if (UnicodeCharacters.IsHighSurrogate(codepoint))
                {
                    // If the character is a high surrogate, then the next characters must be a low surrogate.
                    if ((i < inputString.Length) && (UnicodeCharacters.IsLowSurrogate(inputString[i+1])))
                    {
                        // Update the code point with the surrogate pair.
                        codepoint = UnicodeCharacters.GetCodepointFromSurrogatePair(codepoint, inputString[i+1]);
                        nextIndex = i + 2;
                    }
                    else
                    {
                        // Warning: High surrogate not followed by low surrogate.
                        codepoint = 0;
                        nextIndex = i + 1;
                    }
                }
                else
                {
                    // Not a surrogate pair.
                    nextIndex = i + 1;
                }

                if (indexIdStart == -1)
                {
                    // Not in an id. Have we found an id start?
                    if (UnicodeCharacters.IsIdStart(codepoint))
                    {
                        indexIdStart = i;
                    }
                }
                else if (!UnicodeCharacters.IsIdContinue(codepoint))
                {
                    // We have not found an id continue, so the id is complete.  We need to
                    // create the identifier string
                    idList.Add(inputString.Substring(indexIdStart, i - indexIdStart));

                    // Reset back the index start and re-examine the current code point
                    // in next iteration
                    indexIdStart = -1;
                    nextIndex = i;
                }
                i = nextIndex;
            }

            // Do we have a pending id at the end of the string?
            if (indexIdStart != -1)
            {
                //  We need to create the identifier string
                idList.Add(inputString.Substring(indexIdStart, i - indexIdStart));
            }

            // Return the list of identifiers found in the string
            return idList;
        }

The documentation for this class was generated from the following file:
  • Unicode/cs/Scenario1_FindId.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindUsers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_FindUsers
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_FindUsers Class Reference

List of all members.

Public Member Functions

Scenario1_FindUsers ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ShowProperties ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario1_FindUsers.xaml.cs.

Constructor & Destructor Documentation

Scenario1_FindUsers ( ) [inline]

Definition at line 29 of file Scenario1_FindUsers.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_FindUsers.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Populate the list of users.
            var observableUsers = await MainPage.GetUserViewModelsAsync();
            UserList.DataContext = observableUsers;
            if (observableUsers.Count > 0)
            {
                UserList.SelectedIndex = 0;
            }
        }

async void ShowProperties ( ) [inline, private]

Definition at line 47 of file Scenario1_FindUsers.xaml.cs.

        {
            var selectedUser = (UserViewModel)UserList.SelectedValue;
            if (selectedUser != null)
            {
                ResultsText.Text = "";
                ProfileImage.Source = null;
                rootPage.NotifyUser("", NotifyType.StatusMessage);
                try
                {
                    User user = User.GetFromId(selectedUser.UserId);

                    // Start with some fixed properties.
                    String result = "NonRoamableId: " + user.NonRoamableId + "\n";
                    result += "Type: " + user.Type.ToString() + "\n";
                    result += "AuthenticationStatus: " + user.AuthenticationStatus.ToString() + "\n";

                    // Build a list of all the properties we want.
                    String[] desiredProperties = new String[]
                    {
                        KnownUserProperties.FirstName,
                        KnownUserProperties.LastName,
                        KnownUserProperties.ProviderName,
                        KnownUserProperties.AccountName,
                        KnownUserProperties.GuestHost,
                        KnownUserProperties.PrincipalName,
                        KnownUserProperties.DomainName,
                        KnownUserProperties.SessionInitiationProtocolUri,
                    };
                    // Issue a bulk query for all of the properties.
                    IPropertySet values = await user.GetPropertiesAsync(desiredProperties);

                    // Add those properties to our results.
                    foreach (String property in desiredProperties)
                    {
                        result += property + ": " + values[property] + "\n";
                    }
                    ResultsText.Text = result;

                    // Get the user's picture.
                    IRandomAccessStreamReference streamReference = await user.GetPictureAsync(UserPictureSize.Size64x64);
                    if (streamReference != null)
                    {
                        IRandomAccessStream stream = await streamReference.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(stream);
                        ProfileImage.Source = bitmapImage;
                    }
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 27 of file Scenario1_FindUsers.xaml.cs.

The documentation for this class was generated from the following file:
  • UserInfo/cs/Scenario1_FindUsers.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Geotag Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Geotag
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Geotag Class Reference

List of all members.

Public Member Functions

Scenario1_Geotag ()

Private Member Functions

async void | ChooseFileButton_Click ()
async void | GetGeotagButton_Click ()
async void | SetGeotagButton_Click ()
async void | SetGeotagFromGeolocatorButton_Click ()

Private Attributes

StorageFile | file = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario1_Geotag.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Geotag ( ) [inline]

Definition at line 28 of file Scenario1_Geotag.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ChooseFileButton_Click ( ) [inline, private]

Definition at line 33 of file Scenario1_Geotag.xaml.cs.

        {
            var picker = new FileOpenPicker();
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".jpeg");
            picker.FileTypeFilter.Add(".mp4");
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                FileDisplayName.Text = file.DisplayName;
                FileOperationsPanel.Visibility = Visibility.Visible;
            }
            else
            {
                FileOperationsPanel.Visibility = Visibility.Collapsed;
            }
        }

void GetGeotagButton_Click ( ) [inline, private]

Definition at line 52 of file Scenario1_Geotag.xaml.cs.

        {
            Geopoint geopoint = await GeotagHelper.GetGeotagAsync(file);
            if (geopoint != null)
            {
                rootPage.NotifyUser($"Latitude = {geopoint.Position.Latitude}, Longitude = {geopoint.Position.Longitude}", NotifyType.StatusMessage);
            }
            else
            {
                // File I/O errors are converted to "No information".
                rootPage.NotifyUser("No location information available", NotifyType.ErrorMessage);
            }
        }

void SetGeotagButton_Click ( ) [inline, private]

Definition at line 94 of file Scenario1_Geotag.xaml.cs.

        {
            // Set the approximate position of the observation deck of the Seattle Space Needle.
            BasicGeoposition position = new BasicGeoposition();
            position.Latitude = 47.620491;
            position.Longitude = -122.349319;
            position.Altitude = 158.12;
            Geopoint geopoint = new Geopoint(position);

            try
            {
                await GeotagHelper.SetGeotagAsync(file, geopoint);
                rootPage.NotifyUser("Geolocation set to Seattle Space Needle", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions
                rootPage.NotifyUser("Exception: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

void SetGeotagFromGeolocatorButton_Click ( ) [inline, private]

Definition at line 66 of file Scenario1_Geotag.xaml.cs.

        {
            // Call RequestAccessAsync from the UI thread to get user permission on location usage.
            // Otherwise SetGeotagFromGeolocator will fail.
            GeolocationAccessStatus status = await Geolocator.RequestAccessAsync();
            if (status != GeolocationAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Location access is not allowed", NotifyType.ErrorMessage);
                return;
            }

            Geolocator geolocator = new Geolocator();
            geolocator.DesiredAccuracy = PositionAccuracy.High;

            try
            {
                await GeotagHelper.SetGeotagFromGeolocatorAsync(file, geolocator);
                rootPage.NotifyUser("Geolocation set to current location", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                // File I/O errors are reported as exceptions.
                // AccessDeniedExcetion can be raised if the user revoked location access
                // after RequestAccessAsync completed.
                rootPage.NotifyUser("Exception: " + ex.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

StorageFile file = null [private]

Definition at line 26 of file Scenario1_Geotag.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_Geotag.xaml.cs.

The documentation for this class was generated from the following files:
  • Geotag/cs/Scenario1_Geotag.xaml.cs
  • Geotag/cpp/Scenario1_Geotag.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_GetAndSetPin Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_GetAndSetPin
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_GetAndSetPin Class Reference

List of all members.

Public Member Functions

Scenario1_GetAndSetPin ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | GetPinValue_Click (object sender, RoutedEventArgs e)
void | SetPinHigh_Click (object sender, RoutedEventArgs e)
void | SetPinLow_Click (object sender, RoutedEventArgs e)
void | StartScenario ()
void | StartStopScenario_Click (object sender, RoutedEventArgs e)
void | StopScenario ()

Private Attributes

const int | LED_PIN = 5
GpioPin | pin

Detailed Description

Definition at line 20 of file Scenario1_GetAndSetPin.xaml.cs.

Constructor & Destructor Documentation

Scenario1_GetAndSetPin ( ) [inline]

Definition at line 26 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void GetPinValue_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            // Change the GUI to reflect the current pin value.
            CurrentPinValue.Text = pin.Read().ToString();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            StopScenario();
        }

void SetPinHigh_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            // Set the pin value to High.
            pin.Write(GpioPinValue.High);
        }

void SetPinLow_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            // Set the pin value to Low.
            pin.Write(GpioPinValue.Low);
        }

void StartScenario ( ) [inline, private]

Definition at line 36 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            var gpio = GpioController.GetDefault();

            // Set up our GPIO pin for setting values.
            // If this next line crashes with a NullReferenceException,
            // then the problem is that there is no GPIO controller on the device.
            pin = gpio.OpenPin(LED_PIN);

            // Configure pin for output.
            pin.SetDriveMode(GpioPinDriveMode.Output);
        }

void StartStopScenario_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            if (pin != null)
            {
                StopScenario();
                StartStopButton.Content = "Start";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                StartScenario();
                StartStopButton.Content = "Stop";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

void StopScenario ( ) [inline, private]

Definition at line 49 of file Scenario1_GetAndSetPin.xaml.cs.

        {
            // Release the GPIO pin.
            if (pin != null)
            {
                pin.Dispose();
                pin = null;
            }
        }

Member Data Documentation

const int LED_PIN = 5 [private]

Definition at line 23 of file Scenario1_GetAndSetPin.xaml.cs.

GpioPin pin [private]

Definition at line 24 of file Scenario1_GetAndSetPin.xaml.cs.

The documentation for this class was generated from the following files:
  • IoT-GPIO/cs/Scenario1_GetAndSetPin.xaml.cs
  • IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_GetDeviceInformation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_GetDeviceInformation
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_GetDeviceInformation Class Reference

List of all members.

Public Member Functions

Scenario1_GetDeviceInformation ()

Private Member Functions

void | Launch_Click (object sender, RoutedEventArgs e)
void | Reset_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario1_GetDeviceInformation.xaml.cs.

Constructor & Destructor Documentation

Scenario1_GetDeviceInformation ( ) [inline]

Definition at line 23 of file Scenario1_GetDeviceInformation.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario1_GetDeviceInformation.xaml.cs.

        {
            try
            {
                EasClientDeviceInformation CurrentDeviceInfor = new EasClientDeviceInformation();
                DeviceID.Text = CurrentDeviceInfor.Id.ToString();
                OperatingSystem.Text = CurrentDeviceInfor.OperatingSystem;
                FriendlyName.Text = CurrentDeviceInfor.FriendlyName;
                SystemManufacturer.Text = CurrentDeviceInfor.SystemManufacturer;
                SystemProductName.Text = CurrentDeviceInfor.SystemProductName;
                SystemSku.Text = CurrentDeviceInfor.SystemSku;
            }
            catch (Exception Error)
            {
                rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
            }
        }

void Reset_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario1_GetDeviceInformation.xaml.cs.

        {
            DeviceID.Text = "";
            OperatingSystem.Text = "";
            FriendlyName.Text = "";
            SystemManufacturer.Text = "";
            SystemProductName.Text = "";
            SystemSku.Text = "";
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario1_GetDeviceInformation.xaml.cs.

The documentation for this class was generated from the following files:
  • ClientDeviceInformation/cs/Scenario1_GetDeviceInformation.xaml.cs
  • ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Initialization Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Initialization
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Initialization Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Initialization ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ProvisionButton_Click (object sender, RoutedEventArgs e)
void | RegisterButton_Click (object sender, RoutedEventArgs e)
bool | UnregisterBackgroundTask ()
void | UnregisterButton_Click (object sender, RoutedEventArgs e)
void | UpdateButtonState (bool registered)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_Initialization.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Initialization ( ) [inline]

Definition at line 29 of file Scenario1_Initialization.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_Initialization.xaml.cs.

        {
            ConfigStore.UseNativeWISPr = true;

            // Configure background task handler to perform authentication as default
            ConfigStore.AuthenticateThroughBackgroundTask = true;

            // Setup completion handler
            var isTaskRegistered = ScenarioCommon.Instance.RegisteredCompletionHandlerForBackgroundTask();

            // Initialize button state
            UpdateButtonState(isTaskRegistered);

        }

async void ProvisionButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario1_Initialization.xaml.cs.

        {
            ProvisionButton.IsEnabled = false;

            // Open the installation folder
            var installLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;

            // Access the provisioning file
            var provisioningFile = await installLocation.GetFileAsync("ProvisioningData.xml");

            // Load with XML parser
            var xmlDocument = await XmlDocument.LoadFromFileAsync(provisioningFile);

            // Get raw XML
            var provisioningXml = xmlDocument.GetXml();

            // Create ProvisiongAgent Object
            var provisioningAgent = new ProvisioningAgent();

            try
            {
                // Create ProvisionFromXmlDocumentResults Object
                var result = await provisioningAgent.ProvisionFromXmlDocumentAsync(provisioningXml);

                if (result.AllElementsProvisioned)
                {
                    rootPage.NotifyUser("Provisioning was successful", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Provisioning result: " + result.ProvisionResultsXml, NotifyType.ErrorMessage);
                }
            }
            catch (System.Exception ex)
            {
                // See https://docs.microsoft.com/en-us/uwp/api/windows.networking.networkoperators.provisioningagent.provisionfromxmldocumentasync
                // for list of possible exceptions.
                rootPage.NotifyUser($"Unable to provision: {ex}", NotifyType.ErrorMessage);
            }

            ProvisionButton.IsEnabled = true;
        }

void RegisterButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 92 of file Scenario1_Initialization.xaml.cs.

        {
            // Create a new background task builder.
            var taskBuilder = new BackgroundTaskBuilder();

            // Create a new NetworkOperatorHotspotAuthentication trigger.
            var trigger = new NetworkOperatorHotspotAuthenticationTrigger();

            // Associate the NetworkOperatorHotspotAuthentication trigger with the background task builder.
            taskBuilder.SetTrigger(trigger);

            // Specify the background task to run when the trigger fires.
            taskBuilder.TaskEntryPoint = ScenarioCommon.BackgroundTaskEntryPoint;

            // Name the background task.
            taskBuilder.Name = ScenarioCommon.BackgroundTaskName;

            try
            {
                // Register the background task.
                var task = taskBuilder.Register();

                // Associate progress and completed event handlers with the new background task.
                task.Completed += ScenarioCommon.Instance.OnBackgroundTaskCompleted;

                UpdateButtonState(true);

                rootPage.NotifyUser("Register was successful", NotifyType.StatusMessage);
            }
            catch (System.Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

bool UnregisterBackgroundTask ( ) [inline, private]

Definition at line 141 of file Scenario1_Initialization.xaml.cs.

        {
            bool unregister = false;
            // Loop through all background tasks and unregister any.
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (cur.Value.Name == ScenarioCommon.BackgroundTaskName)
                {
                    cur.Value.Unregister(true);
                    unregister = true;
                }
            }
            return unregister;

        }

void UnregisterButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 127 of file Scenario1_Initialization.xaml.cs.

        {
            if (UnregisterBackgroundTask())
            {
                UpdateButtonState(false);
                rootPage.NotifyUser("Unregister was successful.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(String.Format("Background {0} task is not registered", ScenarioCommon.BackgroundTaskName), NotifyType.StatusMessage);
            }

        }

void UpdateButtonState ( bool registered ) [inline, private]

Enables or disables register and unregister buttons.

Parameters:
registered True if background task is registered, false otherwise

Definition at line 161 of file Scenario1_Initialization.xaml.cs.

        {
            if (registered)
            {
                RegisterButton.IsEnabled = false;
                UnregisterButton.IsEnabled = true;
            }
            else
            {
                RegisterButton.IsEnabled = true;
                UnregisterButton.IsEnabled = false;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario1_Initialization.xaml.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/Scenario1_Initialization.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_InkCanvasTactileFeedback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_InkCanvasTactileFeedback
Public Member Functions | Private Member Functions

Scenario1_InkCanvasTactileFeedback Class Reference

List of all members.

Public Member Functions

Scenario1_InkCanvasTactileFeedback ()

Private Member Functions

void OnSizeChanged (object sender, SizeChangedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario1_InkCanvasTactileFeedback.xaml.cs.

Constructor & Destructor Documentation

Scenario1_InkCanvasTactileFeedback ( ) [inline]

Definition at line 23 of file Scenario1_InkCanvasTactileFeedback.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario1_InkCanvasTactileFeedback.xaml.cs.

        {
            outputGrid.Width = RootGrid.ActualWidth;
            outputGrid.Height = RootGrid.ActualHeight / 2;
        }

The documentation for this class was generated from the following file:
  • PenHaptics/cs/Scenario1_InkCanvasTactileFeedback.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Input Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Input
Public Member Functions | Protected Member Functions

Scenario1_Input Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Input ()

Protected Member Functions

override void OnNavigatingFrom (NavigatingCancelEventArgs e)

Detailed Description

Definition at line 27 of file Scenario1_Input.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Input ( ) [inline]

Definition at line 29 of file Scenario1_Input.xaml.cs.

        {
            this.InitializeComponent();
#if x
            // Handle touch event to manage focus.
            CoreWindow.GetForCurrentThread().PointerPressed += Page_PointerPressed;
#endif
        }

Member Function Documentation

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 57 of file Scenario1_Input.xaml.cs.

        {
#if x
            //Destroy the pointer pressed handlers when navigating to another page.
            CoreWindow.GetForCurrentThread().PointerPressed -= Page_PointerPressed;
            _textEditContext.ShutDown();
            base.OnNavigatingFrom(e);
#endif
        }

The documentation for this class was generated from the following file:
  • CustomEditControl/cs/Scenario1_Input.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LanguageDetection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_LanguageDetection
Public Member Functions

Scenario1_LanguageDetection Class Reference

List of all members.

Public Member Functions

Scenario1_LanguageDetection ()
void Go_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_LanguageDetection.xaml.cs.

Constructor & Destructor Documentation

Scenario1_LanguageDetection ( ) [inline]

Definition at line 21 of file Scenario1_LanguageDetection.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void Go_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 26 of file Scenario1_LanguageDetection.xaml.cs.

        {
            StringBuilder output = new StringBuilder();
            foreach (string language in LinguisticServices.RecognizeTextLanguages(TextInput.Text))
            {
                output.AppendLine(language);
            }
            TextOutput.Text = output.ToString();
        }

The documentation for this class was generated from the following file:
  • LinguisticServices/cs/Scenario1_LanguageDetection.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launch Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Launch
Public Member Functions

Scenario1_Launch Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_Launch ()

Detailed Description

Definition at line 21 of file Scenario1_Launch.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Launch ( ) [inline]

Definition at line 23 of file Scenario1_Launch.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • TouchKeyboard/cs/Scenario1_Launch.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launched Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Launched
Public Member Functions | Protected Member Functions

Scenario1_Launched Class Reference

List of all members.

Public Member Functions

Scenario1_Launched ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 17 of file Scenario1_Launched.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Launched ( ) [inline]

Definition at line 19 of file Scenario1_Launched.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 24 of file Scenario1_Launched.xaml.cs.

        {
            if (!string.IsNullOrEmpty(MainPage.Current.LaunchParam))
            {
                ActivatedBy.Text = MainPage.Current.LaunchParam;
            }
            else
            {
                ActivatedBy.Text = "manual navigation.";
            }
            MainPage.Current.LaunchParam = null;
        }

The documentation for this class was generated from the following files:
  • JumpList/cs/Scenario1_Launched.xaml.cs
  • JumpList/cpp/Scenario1_Launched.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LaunchFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_LaunchFile
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_LaunchFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_LaunchFile ()

Private Member Functions

async Task< StorageFile > | GetFileToLaunch ()
Windows.Foundation.Point | GetOpenWithPosition (FrameworkElement element)
async void | LaunchFileDefault ()
async void | LaunchFileOpenWith (object sender, RoutedEventArgs e)
async void | LaunchFileSplitScreen ()
async void | LaunchFileWithWarning ()
async void | PickAndLaunchFile ()

Private Attributes

string | fileToLaunch = @"Assets\microsoft-sdk.png"
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario1_LaunchFile.xaml.cs.

Constructor & Destructor Documentation

Scenario1_LaunchFile ( ) [inline]

Definition at line 34 of file Scenario1_LaunchFile.xaml.cs.

        {
            this.InitializeComponent();
            ViewPreference.ItemsSource = MainPage.ViewSizePreferences;
            ViewPreference.SelectedIndex = 0;
        }

Member Function Documentation

async Task<StorageFile> GetFileToLaunch ( ) [inline, private]

Definition at line 41 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get the image file from the package's image directory.
            var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(fileToLaunch);

            //Can't launch files directly from install folder so copy it over
            //to temporary folder first
            file = await file.CopyAsync(ApplicationData.Current.TemporaryFolder, "filetolaunch.png", NameCollisionOption.ReplaceExisting);

            return file;
        }

Windows.Foundation.Point GetOpenWithPosition ( FrameworkElement element ) [inline, private]

Definition at line 189 of file Scenario1_LaunchFile.xaml.cs.

        {
            Windows.UI.Xaml.Media.GeneralTransform buttonTransform = element.TransformToVisual(null);

            Point desiredLocation = buttonTransform.TransformPoint(new Point());
            desiredLocation.Y = desiredLocation.Y + element.ActualHeight;

            return desiredLocation;
        }

async void LaunchFileDefault ( ) [inline, private]

Definition at line 56 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get the image file from the package's image directory.
            var file = await GetFileToLaunch();

            // Next, launch the file.
            bool success = await Launcher.LaunchFileAsync(file);
            if (success)
            {
                rootPage.NotifyUser("File launched: " + file.Name, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("File launch failed.", NotifyType.ErrorMessage);
            }
        }

async void LaunchFileOpenWith | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get the image file from the package's image directory.
            var file = await GetFileToLaunch();

            // Calculate the position for the Open With dialog.
            // An alternative to using the point is to set the rect of the UI element that triggered the launch.
            Point openWithPosition = MainPage.GetElementLocation(sender);

            // Next, configure the Open With dialog.
            var options = new LauncherOptions();
            options.DisplayApplicationPicker = true;
            options.UI.InvocationPoint = openWithPosition;
            options.UI.PreferredPlacement = Windows.UI.Popups.Placement.Below;

            // Finally, launch the file.
            bool success = await Launcher.LaunchFileAsync(file, options);
            if (success)
            {
                rootPage.NotifyUser("File launched: " + file.Name, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("File launch failed.", NotifyType.ErrorMessage);
            }
        }

async void LaunchFileSplitScreen ( ) [inline, private]

Definition at line 129 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get a file via the picker.
            var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
            openPicker.FileTypeFilter.Add("*");

            Windows.Storage.StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                // Configure the request for split screen launch.
                var options = new LauncherOptions() { DesiredRemainingView = (ViewSizePreference)ViewPreference.SelectedValue };

                // Next, launch the file.
                bool success = await Launcher.LaunchFileAsync(file, options);
                if (success)
                {
                    rootPage.NotifyUser("File launched: " + file.Name, NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("File launch failed.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No file was picked.", NotifyType.ErrorMessage);
            }
        }

async void LaunchFileWithWarning ( ) [inline, private]

Definition at line 76 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get the image file from the package's image directory.
            var file = await GetFileToLaunch();

            // Next, configure the warning prompt.
            var options = new LauncherOptions() { TreatAsUntrusted = true };

            // Finally, launch the file.
            bool success = await Launcher.LaunchFileAsync(file, options);
            if (success)
            {
                rootPage.NotifyUser("File launched: " + file.Name, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("File launch failed.", NotifyType.ErrorMessage);
            }
        }

async void PickAndLaunchFile ( ) [inline, private]

Definition at line 161 of file Scenario1_LaunchFile.xaml.cs.

        {
            // First, get a file via the picker.
            var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
            openPicker.FileTypeFilter.Add("*");
            Windows.Storage.StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                // Next, launch the file.
                bool success = await Launcher.LaunchFileAsync(file);
                if (success)
                {
                    rootPage.NotifyUser("File launched: " + file.Name, NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("File launch failed.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No file was picked.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

string fileToLaunch = @"Assets\microsoft-sdk.png" [private]

Definition at line 32 of file Scenario1_LaunchFile.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_LaunchFile.xaml.cs.

The documentation for this class was generated from the following file:
  • AssociationLaunching/cs/Scenario1_LaunchFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LongAndShortFormats Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_LongAndShortFormats
Public Member Functions | Private Member Functions

Scenario1_LongAndShortFormats Class Reference

List of all members.

Public Member Functions

Scenario1_LongAndShortFormats ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 25 of file Scenario1_LongAndShortFormats.xaml.cs.

Constructor & Destructor Documentation

Scenario1_LongAndShortFormats ( ) [inline]

Definition at line 27 of file Scenario1_LongAndShortFormats.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 35 of file Scenario1_LongAndShortFormats.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
            // in order to display dates and times using basic formatters.

            // We keep results in this variable
            StringBuilder results = new StringBuilder();
            results.AppendLine("Current application context language: " + ApplicationLanguages.Languages[0]);
            results.AppendLine();

            // Create basic date/time formatters.
            DateTimeFormatter[] basicFormatters = new[]
            {
                // Default date formatters
                new DateTimeFormatter("shortdate"),
                new DateTimeFormatter("longdate"),

                // Default time formatters
                new DateTimeFormatter("shorttime"),
                new DateTimeFormatter("longtime"),
             };

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // Format and display date/time. Calendar will always support Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in basicFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario1_LongAndShortFormats.xaml.cs
  • DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ManageHotspot Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ManageHotspot
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario1_ManageHotspot Class Reference

List of all members.

Public Member Functions

Scenario1_ManageHotspot ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | RegisterTasks_Click (object sender, RoutedEventArgs e)
bool | SavePropertiesForBackgroundTask ()
void | UnregisterTasks_Click (object sender, RoutedEventArgs e)
void | UpdateNowButton_Click (object sender, RoutedEventArgs e)
void | UpdateOnDemandButton_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static bool | IsBackgroundTaskName (string name)

Private Attributes

WiFiOnDemandHotspotNetwork | m_network
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_ManageHotspot.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ManageHotspot ( ) [inline]

Definition at line 30 of file Scenario1_ManageHotspot.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

static bool IsBackgroundTaskName ( string name ) [inline, static, private]

Definition at line 35 of file Scenario1_ManageHotspot.xaml.cs.

        {
            return name == Constants.MetadataUpdateTaskName ||
                name == Constants.DeviceWatcherTaskName ||
                name == Constants.ConnectTaskName;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario1_ManageHotspot.xaml.cs.

        {
            m_network = WiFiOnDemandHotspotNetwork.GetOrCreateById(Constants.SampleHotspotGuid);

            // Copy the values from the network properties into our UI.
            WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
            DisplayNameText.Text = properties.DisplayName;
            AvailableToggle.IsOn = properties.Availability == WiFiOnDemandHotspotAvailability.Available;
            WiFiOnDemandHotspotCellularBars? bars = properties.CellularBars;
            CellularBarsToggle.IsOn = bars.HasValue;
            Debug.Assert(0 == (int)WiFiOnDemandHotspotCellularBars.ZeroBars);
            Debug.Assert(1 == (int)WiFiOnDemandHotspotCellularBars.OneBar);
            Debug.Assert(2 == (int)WiFiOnDemandHotspotCellularBars.TwoBars);
            Debug.Assert(3 == (int)WiFiOnDemandHotspotCellularBars.ThreeBars);
            Debug.Assert(4 == (int)WiFiOnDemandHotspotCellularBars.FourBars);
            Debug.Assert(5 == (int)WiFiOnDemandHotspotCellularBars.FiveBars);
            CellularBarsSlider.Value = (int)(bars ?? WiFiOnDemandHotspotCellularBars.ZeroBars);
            uint? batteryPercent = properties.RemainingBatteryPercent;
            BatteryPercentageToggle.IsOn = batteryPercent.HasValue;
            BatteryPercentageSlider.Value = (int)(batteryPercent ?? 0);
            SsidText.Text = properties.Ssid;
            PasswordText.Password = properties.Password?.Password ?? String.Empty;

            // Determine whether the background tasks are registered.
            bool isRegistered = false;
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (IsBackgroundTaskName(cur.Value.Name))
                {
                    isRegistered = true;
                    break;
                }
            }

            VisualStateManager.GoToState(this, isRegistered ? "Registered" : "NotRegistered", false);
        }

void RegisterTasks_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario1_ManageHotspot.xaml.cs.

        {
            // Register the background task which updates the hotspot metadata when the system
            // shows a list of Wi-Fi networks.
            var updateMetadataTrigger = new WiFiOnDemandHotspotUpdateMetadataTrigger();
            var backgroundTaskBuilder = new BackgroundTaskBuilder();
            backgroundTaskBuilder.Name = Constants.MetadataUpdateTaskName;
            backgroundTaskBuilder.TaskEntryPoint = Constants.MetadataUpdateEntryPoint;
            backgroundTaskBuilder.SetTrigger(updateMetadataTrigger);
            BackgroundTaskRegistration updateMetadataRegistration = backgroundTaskBuilder.Register();

            // Register the background task which turns on the on-demand hotspot when the user
            // selects it.
            var connectTrigger = new WiFiOnDemandHotspotConnectTrigger();
            backgroundTaskBuilder.Name = Constants.ConnectTaskName;
            backgroundTaskBuilder.TaskEntryPoint = Constants.ConnectEntryPoint;
            backgroundTaskBuilder.SetTrigger(connectTrigger);
            BackgroundTaskRegistration connectRegistration = backgroundTaskBuilder.Register();

            // In practice, you will monitor when an on-demand hotspot comes into range or goes
            // of range so you can update the Availability. This sample does not have a physical
            // hotspot device, but we leave the code here as a demonstration.
#if false
            DeviceWatcher deviceWatcher = DeviceInformation.CreateWatcher(Contoso.Devices.OnDemandHotSpot.GetDeviceSelector());
            var triggerEventKinds = new List<DeviceWatcherEventKind> { DeviceWatcherEventKind.Add, DeviceWatcherEventKind.Remove, DeviceWatcherEventKind.Update };
            DeviceWatcherTrigger watcherTrigger = deviceWatcher.GetBackgroundTrigger(triggerEventKinds);
            backgroundTaskBuilder.Name = Constants.DeviceWatcherTaskName;
            backgroundTaskBuilder.TaskEntryPoint = Constants.DeviceWatcherEntryPoint;
            backgroundTaskBuilder.SetTrigger(watcherTrigger);
            BackgroundTaskRegistration deviceWatcherRegistration = backgroundTaskBuilder.Register();
#endif

            VisualStateManager.GoToState(this, "Registered", false);
        }

bool SavePropertiesForBackgroundTask ( ) [inline, private]

Definition at line 127 of file Scenario1_ManageHotspot.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            if (AvailableToggle.IsOn && String.IsNullOrEmpty(DisplayNameText.Text))
            {
                rootPage.NotifyUser("An Available network must have a name.", NotifyType.ErrorMessage);
                return false;
            }

            if (String.IsNullOrEmpty(SsidText.Text))
            {
                rootPage.NotifyUser("You must provide an SSID for the Wi-Fi network.", NotifyType.ErrorMessage);
                return false;
            }

            if (String.IsNullOrEmpty(PasswordText.Password))
            {
                rootPage.NotifyUser("You must provide a password for the Wi-Fi network.", NotifyType.ErrorMessage);
                return false;
            }

            IPropertySet values = ApplicationData.Current.LocalSettings.Values;
            values["availability"] = AvailableToggle.IsOn;
            values["displayName"] = DisplayNameText.Text;
            values["bars"] = CellularBarsToggle.IsOn ? (int?)CellularBarsSlider.Value : null;
            values["battery"] = BatteryPercentageToggle.IsOn ? (uint?)BatteryPercentageSlider.Value : null;
            values["ssid"] = SsidText.Text;
            values["password"] = PasswordText.Password;
            values["hotspotGuid"] = Constants.SampleHotspotGuid;

            return true;
        }

void UnregisterTasks_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario1_ManageHotspot.xaml.cs.

        {
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (IsBackgroundTaskName(cur.Value.Name))
                {
                    cur.Value.Unregister(true);
                }
            }

            VisualStateManager.GoToState(this, "NotRegistered", false);
        }

void UpdateNowButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 162 of file Scenario1_ManageHotspot.xaml.cs.

        {
            if (SavePropertiesForBackgroundTask())
            {
                // Copy the properties from the UI into the system network properties
                // to configure how the on-demand hotspot appears in the system Wi-Fi list.
                WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
                properties.Availability = AvailableToggle.IsOn ? WiFiOnDemandHotspotAvailability.Available : WiFiOnDemandHotspotAvailability.Unavailable;
                properties.DisplayName = DisplayNameText.Text;
                properties.CellularBars = CellularBarsToggle.IsOn ? (WiFiOnDemandHotspotCellularBars?)(int?)CellularBarsSlider.Value : null;
                properties.RemainingBatteryPercent = BatteryPercentageToggle.IsOn ? (uint?)BatteryPercentageSlider.Value : null;
                properties.Ssid = SsidText.Text;
                properties.Password = new PasswordCredential { Password = PasswordText.Password };
                m_network.UpdateProperties(properties);
            }
        }

void UpdateOnDemandButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 179 of file Scenario1_ManageHotspot.xaml.cs.

        {
            SavePropertiesForBackgroundTask();
        }

Member Data Documentation

WiFiOnDemandHotspotNetwork m_network [private]

Definition at line 27 of file Scenario1_ManageHotspot.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_ManageHotspot.xaml.cs.

The documentation for this class was generated from the following file:
  • OnDemandHotspot/cs/Scenario1_ManageHotspot.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Metrics Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Metrics
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Metrics Class Reference

List of all members.

Public Member Functions

Scenario1_Metrics ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Animations_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | DisplayMetrics (AnimationEffect effect, AnimationEffectTarget target)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 19 of file Scenario1_Metrics.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Metrics ( ) [inline]

Definition at line 23 of file Scenario1_Metrics.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Animations_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When the selection changes, update the output window.

Parameters:
sender
e

Definition at line 121 of file Scenario1_Metrics.xaml.cs.

        {
            ListBox lb = sender as ListBox;
            if (lb != null)
            {
                object selectedListBoxItem = lb.SelectedItem;
                if (selectedListBoxItem == AddToListAdded)
                {
                    DisplayMetrics(AnimationEffect.AddToList, AnimationEffectTarget.Added);
                }
                else if (selectedListBoxItem == AddToListAffected)
                {
                    DisplayMetrics(AnimationEffect.AddToList, AnimationEffectTarget.Affected);
                }
                else if (selectedListBoxItem == EnterPage)
                {
                    DisplayMetrics(AnimationEffect.EnterPage, AnimationEffectTarget.Primary);
                }
            }
        }

void DisplayMetrics | ( | AnimationEffect | effect,
 |  | AnimationEffectTarget | target |
 | ) |  |  | [inline, private]

Retrieves the specified metrics and displays them in textual form.

Parameters:
effect | The AnimationEffect whose metrics are to be displayed.
target | The AnimationEffecTarget whose metrics are to be displayed.

Definition at line 38 of file Scenario1_Metrics.xaml.cs.

        {
            var s = new System.Text.StringBuilder();
            AnimationDescription animationDescription = new AnimationDescription(effect, target);
            s.AppendFormat("Stagger delay = {0}ms", animationDescription.StaggerDelay.TotalMilliseconds);
            s.AppendLine();
            s.AppendFormat("Stagger delay factor = {0}", animationDescription.StaggerDelayFactor);
            s.AppendLine();
            s.AppendFormat("Delay limit = {0}ms", animationDescription.DelayLimit.TotalMilliseconds);
            s.AppendLine();
            s.AppendFormat("ZOrder = {0}", animationDescription.ZOrder);
            s.AppendLine();
            s.AppendLine();

            int animationIndex = 0;
            foreach (var animation in animationDescription.Animations)
            {
                s.AppendFormat("Animation #{0}:", ++animationIndex);
                s.AppendLine();

                switch (animation.Type)
                {
                    case PropertyAnimationType.Scale:
                        {
                            ScaleAnimation scale = animation as ScaleAnimation;
                            s.AppendLine("Type = Scale");
                            if (scale.InitialScaleX.HasValue)
                            {
                                s.AppendFormat("InitialScaleX = {0}", scale.InitialScaleX.Value);
                                s.AppendLine();
                            }
                            if (scale.InitialScaleY.HasValue)
                            {
                                s.AppendFormat("InitialScaleY = {0}", scale.InitialScaleY.Value);
                                s.AppendLine();
                            }
                            s.AppendFormat("FinalScaleX = {0}", scale.FinalScaleX);
                            s.AppendLine();
                            s.AppendFormat("FinalScaleY = {0}", scale.FinalScaleY);
                            s.AppendLine();
                            s.AppendFormat("Origin = {0}, {1}", scale.NormalizedOrigin.X, scale.NormalizedOrigin.Y);
                            s.AppendLine();
                        }
                        break;
                    case PropertyAnimationType.Translation:
                        s.AppendLine("Type = Translation");
                        break;
                    case PropertyAnimationType.Opacity:
                        {
                            OpacityAnimation opacity = animation as OpacityAnimation;
                            s.AppendLine("Type = Opacity");
                            if (opacity.InitialOpacity.HasValue)
                            {
                                s.AppendFormat("InitialOpacity = {0}", opacity.InitialOpacity.Value);
                                s.AppendLine();
                            }
                            s.AppendFormat("FinalOpacity = {0}", opacity.FinalOpacity);
                            s.AppendLine();
                        }
                        break;
                }

                s.AppendFormat("Delay = {0}ms", animation.Delay.TotalMilliseconds);
                s.AppendLine();
                s.AppendFormat("Duration = {0}ms", animation.Duration.TotalMilliseconds);
                s.AppendLine();
                s.AppendFormat("Cubic Bezier control points");
                s.AppendLine();
                s.AppendFormat("    X1 = {0}, Y1 = {1}", animation.Control1.X, animation.Control1.Y);
                s.AppendLine();
                s.AppendFormat("    X2 = {0}, Y2 = {1}", animation.Control2.X, animation.Control2.Y);
                s.AppendLine();
                s.AppendLine();
            }

            Metrics.Text = s.ToString();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 28 of file Scenario1_Metrics.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 21 of file Scenario1_Metrics.xaml.cs.

The documentation for this class was generated from the following files:
  • AnimationMetrics/cs/Scenario1_Metrics.xaml.cs
  • AnimationMetrics/cpp/Scenario1_Metrics.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Mini Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Mini
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Mini Class Reference

List of all members.

Public Member Functions

Scenario1_Mini ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ShowContactCard_Click (object sender, RoutedEventArgs e)
void | ShowContactCardWithOptions_Click (object sender, RoutedEventArgs e)
void | ShowContactCardWithPlacement_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario1_Mini.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Mini ( ) [inline]

Definition at line 25 of file Scenario1_Mini.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario1_Mini.xaml.cs.

        {
            if (!ContactManager.IsShowContactCardSupported())
            {
                NotSupportedWarning.Visibility = Visibility.Visible;
            }
        }

void ShowContactCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1_Mini.xaml.cs.

        {
            Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
            if (contact != null)
            {
                // Show the contact card next to the button.
                Rect rect = MainPage.GetElementRect(sender as FrameworkElement);

                // Show with default placement.
                ContactManager.ShowContactCard(contact, rect);
            }
        }

void ShowContactCardWithOptions_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario1_Mini.xaml.cs.

        {
            Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
            if (contact != null)
            {
                // Show the contact card next to the button.
                Rect rect = MainPage.GetElementRect(sender as FrameworkElement);

                // Ask for the initial tab to be Phone.
                ContactCardOptions options = new ContactCardOptions() { InitialTabKind = ContactCardTabKind.Phone };

                // Show with default placement.
                ContactManager.ShowContactCard(contact, rect, Placement.Default, options);
            }
        }

void ShowContactCardWithPlacement_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario1_Mini.xaml.cs.

        {
            Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
            if (contact != null)
            {
                // Show the contact card next to the button.
                Rect rect = MainPage.GetElementRect(sender as FrameworkElement);

                // Show with preferred placement to the right.
                ContactManager.ShowContactCard(contact, rect, Placement.Right);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario1_Mini.xaml.cs.

The documentation for this class was generated from the following files:
  • ContactCards/cs/Scenario1_Mini.xaml.cs
  • ContactCards/cpp/Scenario1_Mini.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_MoveCertificate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_MoveCertificate
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario1_MoveCertificate Class Reference

List of all members.

Public Member Functions

Scenario1_MoveCertificate ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | MoveAppCertificateToUserCertificateStore (object sender, RoutedEventArgs e)
async void | MoveUserCertificateToAppCertificateStore (object sender, RoutedEventArgs e)

Static Private Member Functions

static void | MoveItemBetweenListViews (ListViewItem item, ListView source, ListView destination)

Private Attributes

CertificateStore | appStore = CertificateStores.GetStoreByName(StandardCertificateStoreNames.Personal)
UserCertificateStore | userStore = CertificateStores.GetUserStoreByName(StandardCertificateStoreNames.Personal)

Detailed Description

Definition at line 24 of file Scenario1_MoveCertificate.xaml.cs.

Constructor & Destructor Documentation

Scenario1_MoveCertificate ( ) [inline]

Definition at line 29 of file Scenario1_MoveCertificate.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void MoveAppCertificateToUserCertificateStore | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 85 of file Scenario1_MoveCertificate.xaml.cs.

        {
            var item = (ListViewItem)AppCertificateListView.SelectedItem;
            if (item != null)
            {
                var certificate = (Certificate)item.Tag;
                if (await userStore.RequestAddAsync(certificate))
                {
                    appStore.Delete(certificate);
                    MoveItemBetweenListViews(item, AppCertificateListView, UserCertificateListView);
                }
            }
        }

static void MoveItemBetweenListViews | ( | ListViewItem | item,
 |  | ListView | source,
 |  | ListView | destination |
 | ) |  |  | [inline, static, private]

Definition at line 57 of file Scenario1_MoveCertificate.xaml.cs.

        {
            source.Items.Remove(item);

            destination.Items.Add(item);
            destination.SelectedItem = item;
            destination.ScrollIntoView(item);
        }

async void MoveUserCertificateToAppCertificateStore | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario1_MoveCertificate.xaml.cs.

        {
            var item = (ListViewItem)UserCertificateListView.SelectedItem;
            if (item != null)
            {
                var certificate = (Certificate)item.Tag;
                appStore.Add(certificate);

                if (await userStore.RequestDeleteAsync(certificate))
                {
                    MoveItemBetweenListViews(item, UserCertificateListView, AppCertificateListView);
                }
                else
                {
                    appStore.Delete(certificate);
                }
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario1_MoveCertificate.xaml.cs.

        {
            IReadOnlyList<Certificate> certificates = await CertificateStores.FindAllAsync();

            foreach (Certificate certificate in certificates)
            {
                var item = new ListViewItem
                {
                    Content = $"Subject: {certificate.Subject}, Serial Number: {CryptographicBuffer.EncodeToHexString(CryptographicBuffer.CreateFromByteArray(certificate.SerialNumber))}",
                    Tag = certificate
                };

                if (certificate.IsPerUser)
                {
                    UserCertificateListView.Items.Add(item);
                }
                else
                {
                    AppCertificateListView.Items.Add(item);
                }
            }
        }

Member Data Documentation

CertificateStore appStore = CertificateStores.GetStoreByName(StandardCertificateStoreNames.Personal) [private]

Definition at line 26 of file Scenario1_MoveCertificate.xaml.cs.

UserCertificateStore userStore = CertificateStores.GetUserStoreByName(StandardCertificateStoreNames.Personal) [private]

Definition at line 27 of file Scenario1_MoveCertificate.xaml.cs.

The documentation for this class was generated from the following file:
  • UserCertificateStore/cs/Scenario1_MoveCertificate.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_MultiVideoPlayback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_MultiVideoPlayback
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_MultiVideoPlayback Class Reference

Multi-video playback control.

List of all members.

Public Member Functions

Scenario1_MultiVideoPlayback ()

Private Member Functions

void | EnablePlaybackControls (bool enabled)
void | Load_Click (object sender, RoutedEventArgs e)
void | MediaPlayer_MediaOpened (MediaPlayer sender, object args)
void | MediaTimelineController_PositionChanged (MediaTimelineController sender, object args)
async void | MediaTimelineController_StateChanged (MediaTimelineController sender, object args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | Page_OnUnloaded (object sender, RoutedEventArgs e)
void | PlayPause_Click (object sender, RoutedEventArgs e)
void | Seek10SecondsBack_Click (object sender, RoutedEventArgs e)
void | Seek10SecondsForward_Click (object sender, RoutedEventArgs e)

Private Attributes

TimeSpan | maxNaturalDurationForController = TimeSpan.Zero
List< MediaPlayerElement > | mediaPlayerElements
Uri[] | mediaUris
MainPage rootPage = MainPage.Current
MediaTimelineController | timelineController = null

Detailed Description

Definition at line 27 of file Scenario1_MultiVideoPlayback.xaml.cs.

Constructor & Destructor Documentation

Scenario1_MultiVideoPlayback ( ) [inline]

Definition at line 45 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            this.InitializeComponent();
            mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeTL, mpeTR, mpeBL, mpeBR };

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                // Create a corresponding MediaPlayer for each MediaPlayerElement.
                mpe.SetMediaPlayer(new MediaPlayer());
            }
        }

Member Function Documentation

void EnablePlaybackControls ( bool enabled ) [inline, private]

Definition at line 143 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            Seek10SecondsBack.IsEnabled = enabled;
            PlayPause.IsEnabled = enabled;
            Seek10SecondsForward.IsEnabled = enabled;
        }

void Load_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Sets the content on the MediaPlayers.

Definition at line 153 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            EnablePlaybackControls(false);

            // First reset the max duration, as the content is about to change.
            maxNaturalDurationForController = TimeSpan.Zero;

            for (int i = 0; i < mediaUris.Length; i++)
            {
                MediaPlayer mp = mediaPlayerElements[i].MediaPlayer;

                // Set the Source property to a MediaSource, MediaPlaybackItem or MediaPlaybackList.
                mp.Source = MediaSource.CreateFromUri(mediaUris[i]);

                // In this demo, all of the videos has the same audio track, so mute all but the first one.
                mp.IsMuted = (i != 0);
            }

            // Enable our custom playback controls now that everything is set up.
            EnablePlaybackControls(true);
        }

void MediaPlayer_MediaOpened | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Maintain maxNaturalDurationForController so it is as long as the longest media source.
            var naturalDurationForController = sender.PlaybackSession.NaturalDuration - sender.TimelineControllerPositionOffset;
            if (naturalDurationForController > maxNaturalDurationForController)
            {
                maxNaturalDurationForController = naturalDurationForController;
            }
        }

void MediaTimelineController_PositionChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 134 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Pause when playback reaches the maximum duration.
            if (sender.Position > maxNaturalDurationForController)
            {
                sender.Pause();
            }
        }

async void MediaTimelineController_StateChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Update the Play/Pause button based on the new state.
            Symbol newSymbol;
            switch (sender.State)
            {
                case MediaTimelineControllerState.Paused:
                    newSymbol = Symbol.Play;
                    break;

                case MediaTimelineControllerState.Running:
                    newSymbol = Symbol.Pause;
                    break;

                default:
                    return;
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Create a single MediaTimelineController which will control all of the MediaPlayers.
            timelineController = new MediaTimelineController();

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;

                // The CommandManager object must be disabled when attaching a MediaTimelineController.
                // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
                // and apply additional business logic.
                // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
                mp.CommandManager.IsEnabled = false;
                // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
                mp.TimelineController = timelineController;

                // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
                // To avoid confusing the user, it is best to turn them off.
                mpe.AreTransportControlsEnabled = false;

                // MediaOpened is the right time to find the highest natural duration.
                mp.MediaOpened += MediaPlayer_MediaOpened;
            }

            // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
            timelineController.StateChanged += MediaTimelineController_StateChanged;

            // Since this is a sample of video on demand, constrain the MediaTimelineController
            // to pause when it reaches the natural end of the last video.
            timelineController.PositionChanged += MediaTimelineController_PositionChanged;

            // We are now set up to load content.
            Load.IsEnabled = true;
        }

void Page_OnUnloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 57 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Dispose the MediaPlayer objects so they will stop streaming.
            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;
                mp.MediaOpened -= MediaPlayer_MediaOpened;
                mp.Dispose();
            }
        }

void PlayPause_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 175 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            if (timelineController.State == MediaTimelineControllerState.Paused)
            {
                timelineController.Resume();
            }
            else if (timelineController.State == MediaTimelineControllerState.Running)
            {
                timelineController.Pause();
            }
        }

void Seek10SecondsBack_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 201 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            timelineController.Position -= TimeSpan.FromSeconds(10);
        }

void Seek10SecondsForward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 187 of file Scenario1_MultiVideoPlayback.xaml.cs.

        {
            // Go forward 10 seconds, but not beyond our maximum value.
            var requestedPosition = timelineController.Position + TimeSpan.FromSeconds(10);
            if (requestedPosition <= maxNaturalDurationForController)
            {
                timelineController.Position = requestedPosition;
            }
            else
            {
                timelineController.Position = maxNaturalDurationForController;
            }
        }

Member Data Documentation

TimeSpan maxNaturalDurationForController = TimeSpan.Zero [private]

Definition at line 33 of file Scenario1_MultiVideoPlayback.xaml.cs.

List<MediaPlayerElement> mediaPlayerElements [private]

Definition at line 31 of file Scenario1_MultiVideoPlayback.xaml.cs.

Uri [] mediaUris [private]
Initial value:
 new Uri[5]
        {
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right.mp4"),
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-back-high.mp4"),
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-back-low.mp4"),
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back.mp4"),
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-shoulder.mp4"),
        }

Definition at line 36 of file Scenario1_MultiVideoPlayback.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario1_MultiVideoPlayback.xaml.cs.

MediaTimelineController timelineController = null [private]

Definition at line 32 of file Scenario1_MultiVideoPlayback.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlaybackSynchronization/cs/Scenario1_MultiVideoPlayback.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_NavToUrl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_NavToUrl
Public Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario1_NavToUrl Class Reference

List of all members.

Public Member Functions

Scenario1_NavToUrl ()

Properties

bool | pageIsLoading [get, set]

Private Member Functions

void | Address_KeyUp (object sender, KeyRoutedEventArgs e)
void | AppendLog (string logEntry)
void | GoButton_Click ()
void | NavigateBackward_Click ()
void | NavigateForward_Click ()
void | NavigateWebview (string url)
void | WebViewControl_ContentLoading (WebView sender, WebViewContentLoadingEventArgs args)
void | WebViewControl_DOMContentLoaded (WebView sender, WebViewDOMContentLoadedEventArgs args)
void | WebViewControl_NavigationCompleted (WebView sender, WebViewNavigationCompletedEventArgs args)
void | WebViewControl_NavigationStarting (WebView sender, WebViewNavigationStartingEventArgs args)
void | WebViewControl_UnviewableContentIdentified (WebView sender, WebViewUnviewableContentIdentifiedEventArgs args)

Static Private Member Functions

static string | UriToString (Uri uri)

Private Attributes

bool | _pageIsLoading

Detailed Description

Definition at line 20 of file Scenario1_NavToUrl.xaml.cs.

Constructor & Destructor Documentation

Scenario1_NavToUrl ( ) [inline]

Definition at line 22 of file Scenario1_NavToUrl.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Address_KeyUp | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline, private]

This handles the enter key in the url address box.

Parameters:
sender
e

Definition at line 96 of file Scenario1_NavToUrl.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                NavigateWebview(AddressBox.Text);
            }
        }

void AppendLog ( string logEntry ) [inline, private]

Helper for logging.

Parameters:
logEntry

Definition at line 193 of file Scenario1_NavToUrl.xaml.cs.

        {
            logResults.Inlines.Add(new Run { Text = logEntry + "\n" });
            logScroller.ChangeView(0, logScroller.ScrollableHeight, null);
        }

void GoButton_Click ( ) [inline, private]

This is the click handler for the "Go" button.

Parameters:
sender
e

Definition at line 37 of file Scenario1_NavToUrl.xaml.cs.

        {
            if (!pageIsLoading)
            {
                NavigateWebview(AddressBox.Text);
            }
            else
            {
                WebViewControl.Stop();
                pageIsLoading = false;
            }
        }

void NavigateBackward_Click ( ) [inline, private]

Handler for the NavigateBackward button.

Parameters:
sender
e

Definition at line 76 of file Scenario1_NavToUrl.xaml.cs.

        {
            if (WebViewControl.CanGoBack) WebViewControl.GoBack();
        }

void NavigateForward_Click ( ) [inline, private]

Handler for the GoForward button.

Parameters:
sender
e

Definition at line 86 of file Scenario1_NavToUrl.xaml.cs.

        {
            if (WebViewControl.CanGoForward) WebViewControl.GoForward();
        }

void NavigateWebview ( string url ) [inline, private]

Helper to perform the navigation in webview.

Parameters:
url

Definition at line 108 of file Scenario1_NavToUrl.xaml.cs.

        {
            try
            {
                Uri targetUri = new Uri(url);
                WebViewControl.Navigate(targetUri);
            }
            catch (UriFormatException ex)
            {
                // Bad address
                AppendLog($"Address is invalid, try again. Error: {ex.Message}.");
            }
        }

static string UriToString ( Uri uri ) [inline, static, private]

Definition at line 27 of file Scenario1_NavToUrl.xaml.cs.

        {
            return (uri != null) ? uri.ToString() : "";
        }

void WebViewControl_ContentLoading | ( | WebView | sender,
 |  | WebViewContentLoadingEventArgs | args |
 | ) |  |  | [inline, private]

Handle the event that indicates that WebView has resolved the URI, and that it is loading HTML content.

Parameters:
sender
args

Definition at line 154 of file Scenario1_NavToUrl.xaml.cs.

        {
            AppendLog($"Loading content for \"{UriToString(args.Uri)}\".");
        }

void WebViewControl_DOMContentLoaded | ( | WebView | sender,
 |  | WebViewDOMContentLoadedEventArgs | args |
 | ) |  |  | [inline, private]

Handle the event that indicates that the WebView content is fully loaded.

If you need to invoke script, it is best to wait for this event.

Parameters:
sender
args

Definition at line 166 of file Scenario1_NavToUrl.xaml.cs.

        {
            AppendLog($"Content for \"{UriToString(args.Uri)}\" has finished loading.");
        }

void WebViewControl_NavigationCompleted | ( | WebView | sender,
 |  | WebViewNavigationCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Event to indicate webview has completed the navigation, either with success or failure.

Parameters:
sender
args

Definition at line 176 of file Scenario1_NavToUrl.xaml.cs.

        {
            pageIsLoading = false;
            if (args.IsSuccess)
            {
                AppendLog($"Navigation to \"{UriToString(args.Uri)}\" completed successfully.");
            }
            else
            {
                AppendLog($"Navigation to: \"{UriToString(args.Uri)}\" failed with error {args.WebErrorStatus}.");
            }
        }

void WebViewControl_NavigationStarting | ( | WebView | sender,
 |  | WebViewNavigationStartingEventArgs | args |
 | ) |  |  | [inline, private]

Handle the event that indicates that WebView is starting a navigation.

Parameters:
sender
args

Definition at line 127 of file Scenario1_NavToUrl.xaml.cs.

        {
            string url = UriToString(args.Uri);
            AddressBox.Text = url;
            AppendLog($"Starting navigation to: \"{url}\".");
            pageIsLoading = true;
        }

void WebViewControl_UnviewableContentIdentified | ( | WebView | sender,
 |  | WebViewUnviewableContentIdentifiedEventArgs | args |
 | ) |  |  | [inline, private]

Handle the event that indicates that the WebView content is not a web page.

For example, it may be a file download.

Parameters:
sender
args

Definition at line 141 of file Scenario1_NavToUrl.xaml.cs.

        {
            AppendLog($"Content for \"{UriToString(args.Uri)}\" cannot be loaded into webview.");
            // We throw away the request. See the "Unviewable content" scenario for other
            // ways of handling the event.
            pageIsLoading = false;
        }

Member Data Documentation

bool _pageIsLoading [private]

Property to control the "Go" button text, forward/backward buttons and progress ring.

Definition at line 53 of file Scenario1_NavToUrl.xaml.cs.

Property Documentation

bool pageIsLoading [get, set, private]

Definition at line 55 of file Scenario1_NavToUrl.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario1_NavToUrl.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_NetworkConnectivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_NetworkConnectivity
Public Member Functions | Private Member Functions

Scenario1_NetworkConnectivity Class Reference

List of all members.

Public Member Functions

Scenario1_NetworkConnectivity ()

Private Member Functions

async void QueryCurrentNetworkConnectivityButton_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 18 of file Scenario1_NetworkConnectivity.xaml.cs.

Constructor & Destructor Documentation

Scenario1_NetworkConnectivity ( ) [inline]

Definition at line 20 of file Scenario1_NetworkConnectivity.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void QueryCurrentNetworkConnectivityButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file Scenario1_NetworkConnectivity.xaml.cs.

        {
            ResultsText.Text = string.Empty;

            ConnectionProfile profile = NetworkInformation.GetInternetConnectionProfile();
            NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel.None;
            if (profile != null)
            {
                // It can take the system a few moments to detect a change in network connectivity,
                // so it's possible that the value returned is slightly out of date.
                // Scenario3_NetworkConnectivityChanges shows how to be notified when the system
                // detects connectivity changes.
                connectivityLevel = profile.GetNetworkConnectivityLevel();
            }

            Helpers.AppendLine(ResultsText, $"Current connectivity is {connectivityLevel}.");

            if (Helpers.ShouldAttemptToConnectToInternet(connectivityLevel))
            {
                await Helpers.EvaluateCostAndConnectAsync(profile.GetConnectionCost(), OptedInToNetworkUsageToggle.IsOn, ResultsText);
            }
            else
            {
                Helpers.AppendLine(ResultsText, "Not attempting to connect to the Internet.");
            }
        }

The documentation for this class was generated from the following file:
  • NetworkConnectivity/cs/Scenario1_NetworkConnectivity.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_OpenDrawer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_OpenDrawer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_OpenDrawer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_OpenDrawer ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< bool > | ClaimCashDrawer ()
async Task< bool > | CreateDefaultCashDrawerObject ()
async Task< bool > | EnableCashDrawer ()
async void | InitDrawerButton_Click (object sender, RoutedEventArgs e)
async Task< bool > | OpenCashDrawer ()
async void | OpenDrawerButton_Click (object sender, RoutedEventArgs e)
void | ResetScenarioState ()

Private Attributes

ClaimedCashDrawer | claimedDrawer = null
CashDrawer | drawer = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario1_OpenDrawer.xaml.cs.

Constructor & Destructor Documentation

Scenario1_OpenDrawer ( ) [inline]

Definition at line 36 of file Scenario1_OpenDrawer.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

task< bool > ClaimCashDrawer ( ) [inline, private]

Attempt to claim the connected cash drawer.

Returns:
True if the cash drawer was successfully claimed, false otherwise.
Returns:
True if the operation succeeds, false otherwise.

Definition at line 131 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (drawer == null)
                return false;

            if (claimedDrawer == null)
            {
                claimedDrawer = await drawer.ClaimDrawerAsync();
                if (claimedDrawer == null)
                    return false;
            }

            return true;
        }

task< bool > CreateDefaultCashDrawerObject ( ) [inline, private]

Creates the default cash drawer.

Returns:
True if the cash drawer was created, false otherwise.

Definition at line 113 of file Scenario1_OpenDrawer.xaml.cs.

        {
            rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage);

            if (drawer == null)
            {
                drawer = await DeviceHelpers.GetFirstCashDrawerAsync();
                if (drawer == null)
                    return false;
            }

            return true;
        }

async Task<bool> EnableCashDrawer ( ) [inline, private]

Attempt to enabled the claimed cash drawer.

Returns:
True if the cash drawer was successfully enabled, false otherwise.

Definition at line 150 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (claimedDrawer == null)
                return false;

            if (claimedDrawer.IsEnabled)
                return true;

            return await claimedDrawer.EnableAsync();
        }

async void InitDrawerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Initialize Drawer button.

Claims and enables the default cash drawer.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 67 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (await CreateDefaultCashDrawerObject())
            {
                if (await ClaimCashDrawer())
                {
                    if (await EnableCashDrawer())
                    {
                        InitDrawerButton.IsEnabled = false;
                        OpenDrawerButton.IsEnabled = true;

                        rootPage.NotifyUser("Successfully enabled cash drawer. Device ID: " + claimedDrawer.DeviceId, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Failed to enable cash drawer.", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("Failed to claim cash drawer.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Cash drawer not found. Please connect a cash drawer.", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked before the page is unloaded and is no longer the current source of a Frame.

Parameters:
e Event data describing the navigation that was requested.

Definition at line 55 of file Scenario1_OpenDrawer.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached.

Definition at line 45 of file Scenario1_OpenDrawer.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedTo(e);
        }

async Task<bool> OpenCashDrawer ( ) [inline, private]

Attempt to open the claimed cash drawer.

Returns:
True if the cash drawer was successfully opened, false otherwise.

Definition at line 165 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (claimedDrawer == null || !claimedDrawer.IsEnabled)
                return false;

            return await claimedDrawer.OpenDrawerAsync();
        }

async void OpenDrawerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Open the cash drawer.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 101 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (await OpenCashDrawer())
                rootPage.NotifyUser("Cash drawer open succeeded.", NotifyType.StatusMessage);
            else
                rootPage.NotifyUser("Cash drawer open failed.", NotifyType.ErrorMessage);
        }

void ResetScenarioState ( ) [inline, private]

Reset the scenario to its initial state.

Definition at line 176 of file Scenario1_OpenDrawer.xaml.cs.

        {
            if (claimedDrawer != null)
            {
                claimedDrawer.Dispose();
                claimedDrawer = null;
            }

            if (drawer != null)
            {
                drawer.Dispose();
                drawer = null;
            }

            InitDrawerButton.IsEnabled = true;
            OpenDrawerButton.IsEnabled = false;

            rootPage.NotifyUser("Click the init drawer button to begin.", NotifyType.StatusMessage);
        }

Member Data Documentation

ClaimedCashDrawer claimedDrawer = null [private]

Definition at line 33 of file Scenario1_OpenDrawer.xaml.cs.

CashDrawer drawer = null [private]

Definition at line 32 of file Scenario1_OpenDrawer.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_OpenDrawer.xaml.cs.

The documentation for this class was generated from the following files:
  • CashDrawer/cs/Scenario1_OpenDrawer.xaml.cs
  • CashDrawer/cpp/Scenario1_OpenDrawer.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Orientation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Orientation
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Orientation Class Reference

List of all members.

Public Member Functions

Scenario1_Orientation ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ApplyRotationLock_Click (object sender, RoutedEventArgs e)
void | OnOrientationChanged (DisplayInformation sender, object e)
void | UpdateContent ()

Private Attributes

DisplayInformation | displayInfo

Detailed Description

Definition at line 22 of file Scenario1_Orientation.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Orientation ( ) [inline]

Definition at line 26 of file Scenario1_Orientation.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ApplyRotationLock_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario1_Orientation.xaml.cs.

        {
            DisplayOrientations orientations = DisplayOrientations.None;
            if (PreferLandscape.IsChecked.Value)
            {
                orientations |= DisplayOrientations.Landscape;
            }
            if (PreferPortrait.IsChecked.Value)
            {
                orientations |= DisplayOrientations.Portrait;
            }
            if (PreferLandscapeFlipped.IsChecked.Value)
            {
                orientations |= DisplayOrientations.LandscapeFlipped;
            }
            if (PreferPortraitFlipped.IsChecked.Value)
            {
                orientations |= DisplayOrientations.PortraitFlipped;
            }
            DisplayInformation.AutoRotationPreferences = orientations;
            UpdateContent();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario1_Orientation.xaml.cs.

        {
            displayInfo.OrientationChanged -= OnOrientationChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_Orientation.xaml.cs.

        {
            displayInfo = DisplayInformation.GetForCurrentView();
            displayInfo.OrientationChanged += OnOrientationChanged;
            UpdateContent();
        }

void OnOrientationChanged | ( | DisplayInformation | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario1_Orientation.xaml.cs.

        {
            UpdateContent();
        }

void UpdateContent ( ) [inline, private]

Definition at line 48 of file Scenario1_Orientation.xaml.cs.

        {
            NativeOrientationTextBlock.Text = displayInfo.NativeOrientation.ToString();
            CurrentOrientationTextBlock.Text = displayInfo.CurrentOrientation.ToString();
            AutoRotationPreferencesTextBlock.Text = DisplayInformation.AutoRotationPreferences.ToString();
        }

Member Data Documentation

DisplayInformation displayInfo [private]

Definition at line 24 of file Scenario1_Orientation.xaml.cs.

The documentation for this class was generated from the following files:
  • DisplayOrientation/cs/Scenario1_Orientation.xaml.cs
  • DisplayOrientation/cpp/Scenario1_Orientation.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ParseAndStringify Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ParseAndStringify
Public Member Functions | Properties | Private Member Functions | Private Attributes

Scenario1_ParseAndStringify Class Reference

List of all members.

Public Member Functions

Scenario1_ParseAndStringify ()

Properties

User | CurrentUser [get, set]

Private Member Functions

void | Add_Click (object sender, RoutedEventArgs e)
void | DeleteSchool_Click (object sender, RoutedEventArgs e)
bool | IsExceptionHandled (Exception ex)
void | Parse_Click (object sender, RoutedEventArgs e)
void | Stringify_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario1_ParseAndStringify.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ParseAndStringify ( ) [inline]

Definition at line 29 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            this.InitializeComponent();
            CurrentUser = new User(JsonInput.Text);
        }

Member Function Documentation

void Add_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            CurrentUser.Education.Add(new School());
            rootPage.NotifyUser("New row added.", NotifyType.StatusMessage);
        }

void DeleteSchool_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            var school = (School)((FrameworkElement)sender).DataContext;
            CurrentUser.Education.Remove(school);
        }

bool IsExceptionHandled ( Exception ex ) [inline, private]

Definition at line 67 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            if (ex.HResult == unchecked((int)0x8000000E)) // E_ILLEGAL_METHOD_CALL
            {
                rootPage.NotifyUser("JSON did not match expected schema: " + ex.Message, NotifyType.ErrorMessage);
                return true;
            }

            JsonErrorStatus error = JsonError.GetJsonStatus(ex.HResult);
            if (error == JsonErrorStatus.Unknown)
            {
                return false;
            }

            rootPage.NotifyUser(error + ": " + ex.Message, NotifyType.ErrorMessage);
            return true;
        }

void Parse_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            try
            {
                CurrentUser = new User(JsonInput.Text);
                rootPage.NotifyUser("JSON string parsed successfully.", NotifyType.StatusMessage);
            }
            catch (Exception ex) when (IsExceptionHandled(ex))
            {
            }
        }

void Stringify_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario1_ParseAndStringify.xaml.cs.

        {
            JsonInput.Text = "";

            JsonInput.Text = CurrentUser.Stringify();
            rootPage.NotifyUser("JSON object serialized to string successfully.", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario1_ParseAndStringify.xaml.cs.

Property Documentation

User CurrentUser [get, set, private]

Definition at line 24 of file Scenario1_ParseAndStringify.xaml.cs.

The documentation for this class was generated from the following file:
  • Json/cs/Scenario1_ParseAndStringify.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PercentPermilleFormatting Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_PercentPermilleFormatting
Public Member Functions | Private Member Functions

Scenario1_PercentPermilleFormatting Class Reference

List of all members.

Public Member Functions

Scenario1_PercentPermilleFormatting ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_PercentPermilleFormatting.xaml.cs.

Constructor & Destructor Documentation

Scenario1_PercentPermilleFormatting ( ) [inline]

Definition at line 21 of file Scenario1_PercentPermilleFormatting.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 31 of file Scenario1_PercentPermilleFormatting.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.NumberFormatting.PercentFormatter and
            // the Windows.Globalization.NumberFormatting.PermilleFormatter classes to format numbers
            // as a percent or a permille.

            // Keep results of the scenario in a StringBuilder
            StringBuilder results = new StringBuilder();

            // Create numbers to format.
            double randomNumber = new Random().NextDouble();
            ulong fixedNumber = 500;

            // Create percent formatters.
            PercentFormatter defaultPercentFormatter = new PercentFormatter();
            PercentFormatter frPercentFormatter = new PercentFormatter(new[] { "fr-FR" }, "ZZ");
            PercentFormatter arPercentFormatter = new PercentFormatter(new[] { "ar" }, "ZZ");

            // Create permille formatters.
            PermilleFormatter defaultPermilleFormatter = new PermilleFormatter();
            PermilleFormatter arPermilleFormatter = new PermilleFormatter(new[] { "ar" }, "ZZ");

            // Format random numbers as percent or permille.
            results.AppendLine("Random number (" + randomNumber + ")");
            results.AppendLine("Percent formatted: " + defaultPercentFormatter.Format(randomNumber));
            results.AppendLine("Permille formatted: " + defaultPermilleFormatter.Format(randomNumber));
            results.AppendLine();
            results.AppendLine("Language-specific percent formatted: " + frPercentFormatter.Format(randomNumber));
            results.AppendLine("Language-specific permille formatted: " + arPermilleFormatter.Format(randomNumber));
            results.AppendLine();
            results.AppendLine("Fixed number (" + fixedNumber + ")");

            // Format fixed number with grouping.
            defaultPercentFormatter.IsGrouped = true;
            results.AppendLine("Percent formatted (grouped): " + defaultPercentFormatter.Format(fixedNumber));

            //Format with grouping using French language.
            frPercentFormatter.IsGrouped = true;
            results.AppendLine("Percent formatted (grouped as fr-FR): " + frPercentFormatter.Format(fixedNumber));

            // Format with grouping using Arabic.
            results.AppendLine("Percent formatted (grouped w/digits as ar): " + arPercentFormatter.Format(fixedNumber));

            // Format with no fraction digits.
            defaultPercentFormatter.FractionDigits = 0;
            defaultPercentFormatter.IsGrouped = false;
            results.AppendLine("Percent formatted (no fractional digits): " + defaultPercentFormatter.Format(fixedNumber));

            // Format always with a decimal point.
            defaultPercentFormatter.IsDecimalPointAlwaysDisplayed = true;
            defaultPercentFormatter.IsGrouped = false;
            results.AppendLine("Percent formatted (always with a decimal point): " + defaultPercentFormatter.Format(fixedNumber));

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario1_PercentPermilleFormatting.xaml.cs
  • NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PinTile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_PinTile
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_PinTile Class Reference

List of all members.

Public Member Functions

Scenario1_PinTile ()

Private Member Functions

async void PinButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario1_PinTile.xaml.cs.

Constructor & Destructor Documentation

Scenario1_PinTile ( ) [inline]

Definition at line 22 of file Scenario1_PinTile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PinButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario1_PinTile.xaml.cs.

        {
            // Prepare package images for the tile sizes in our tile to be pinned as well as for the square30x30 logo used in the Apps view.
            Uri square150x150Logo = new Uri("ms-appx:///Assets/square150x150Tile-sdk.png");
            Uri wide310x150Logo = new Uri("ms-appx:///Assets/wide310x150Tile-sdk.png");
            Uri square310x310Logo = new Uri("ms-appx:///Assets/square310x310Tile-sdk.png");

            // During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation,
            // so that the app knows which tile the user is launching. In this sample, we'll pass in the date and time the secondary tile was pinned.
            string tileActivationArguments = MainPage.logoSecondaryTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();

            // Create a Secondary tile with all the required arguments.
            // Note the last argument specifies what size the Secondary tile should show up as by default in the Pin to start fly out.
            // It can be set to TileSize.Square150x150, TileSize.Wide310x150, or TileSize.Default.
            // If set to TileSize.Wide310x150, then the asset for the wide size must be supplied as well.
            // TileSize.Default will default to the wide size if a wide size is provided, and to the medium size otherwise.
            SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId,
                                                            "Title text shown on the tile",
                                                            tileActivationArguments,
                                                            square150x150Logo,
                                                            TileSize.Square150x150);

            secondaryTile.VisualElements.Wide310x150Logo = wide310x150Logo;
            secondaryTile.VisualElements.Square310x310Logo = square310x310Logo;

            // The display of the secondary tile name can be controlled for each tile size.
            // The default is false.
            secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;
            secondaryTile.VisualElements.ShowNameOnWide310x150Logo = true;
            secondaryTile.VisualElements.ShowNameOnSquare310x310Logo = true;

            // Specify a foreground text value.
            // The tile background color is inherited from the parent unless a separate value is specified.
            secondaryTile.VisualElements.ForegroundText = ForegroundText.Dark;

            // Set this to false if roaming doesn't make sense for the secondary tile.
            // The default is true.
            secondaryTile.RoamingEnabled = false;

            // The tile is created and we can now attempt to pin the tile.
            // Note that the status message is updated when the async operation to pin the tile completes.
            bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Below);

            if (isPinned)
            {
                rootPage.NotifyUser("Secondary tile successfully pinned.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Secondary tile not pinned.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario1_PinTile.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario1_PinTile.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Prefs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Prefs
Public Member Functions | Private Member Functions

Scenario1_Prefs Class Reference

List of all members.

Public Member Functions

Scenario1_Prefs ()

Private Member Functions

void ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_Prefs.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Prefs ( ) [inline]

Definition at line 21 of file Scenario1_Prefs.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario1_Prefs.xaml.cs.

        {
            // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
            // obtain the user's globalization preferences.
            OutputTextBlock.Text = "Languages: " + string.Join(", ", GlobalizationPreferences.Languages) + "\n" +
                "Home Region: " + GlobalizationPreferences.HomeGeographicRegion + "\n" +
                "Calendar System: " + string.Join(", ", GlobalizationPreferences.Calendars) + "\n" +
                "Clock: " + string.Join(", ", GlobalizationPreferences.Clocks) + "\n" +
                "First Day of the Week: " + GlobalizationPreferences.WeekStartsOn.ToString();
        }

The documentation for this class was generated from the following files:
  • GlobalizationPreferences/cs/Scenario1_Prefs.xaml.cs
  • GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PreviewSettings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_PreviewSettings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_PreviewSettings Class Reference

Scenario 1 Change camera preview settings. More...

List of all members.

Public Member Functions

Scenario1_PreviewSettings ()

Protected Member Functions

override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ComboBoxSettings_Changed (object sender, RoutedEventArgs e)
async void | InitializeCameraButton_Click (object sender, RoutedEventArgs e)
void | PopulateSettingsComboBox ()

Private Attributes

MediaCapturePreviewer | _previewer = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario1_PreviewSettings.xaml.cs.

Constructor & Destructor Documentation

Scenario1_PreviewSettings ( ) [inline]

Initializes a new instance of the Scenario1_PreviewSettings class.

Definition at line 36 of file Scenario1_PreviewSettings.xaml.cs.

        {
            this.InitializeComponent();
            _previewer = new MediaCapturePreviewer(PreviewControl, Dispatcher);
        }

Member Function Documentation

async void ComboBoxSettings_Changed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Preview settings combo box.

Updates stream resolution based on the selection.

Parameters:
sender
e

Definition at line 76 of file Scenario1_PreviewSettings.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
                var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
                await _previewer.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, encodingProperties);
            }
        }

async void InitializeCameraButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Initializes the camera and populates the UI.

Parameters:
sender
e

Definition at line 52 of file Scenario1_PreviewSettings.xaml.cs.

        {
            var button = sender as Button;

            // Clear any previous message.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            button.IsEnabled = false;
            await _previewer.InitializeCameraAsync();
            button.IsEnabled = true;

            if (_previewer.IsPreviewing)
            {
                button.Visibility = Visibility.Collapsed;
                PreviewControl.Visibility = Visibility.Visible;
                PopulateSettingsComboBox();
            }
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario1_PreviewSettings.xaml.cs.

        {
            await _previewer.CleanupCameraAsync();
        }

void PopulateSettingsComboBox ( ) [inline, private]

Populates the combo box with all possible combinations of settings returned by the camera driver.

Definition at line 89 of file Scenario1_PreviewSettings.xaml.cs.

        {
            // Query all properties of the device
            IEnumerable<StreamResolution> allProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoPreview).Select(x => new StreamResolution(x));

            // Order them by resolution then frame rate
            allProperties = allProperties.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);

            // Populate the combo box with the entries
            foreach (var property in allProperties)
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Content = property.GetFriendlyName();
                comboBoxItem.Tag = property;
                CameraSettings.Items.Add(comboBoxItem);
            }
        }

Member Data Documentation

MediaCapturePreviewer _previewer = null [private]

Definition at line 31 of file Scenario1_PreviewSettings.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_PreviewSettings.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraResolution/cs/Scenario1_PreviewSettings.xaml.cs
  • CameraResolution/cpp/Scenario1_PreviewSettings.xaml.cpp
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Print Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Print
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario1_Print Class Reference

List of all members.

Public Member Functions

Scenario1_Print ()

Private Member Functions

async void | CreateFromXml_Click (object sender, RoutedEventArgs e)
async void | CreateProgrammatically_Click (object sender, RoutedEventArgs e)
void | EnablePackageOperationButtons ()
async void | LoadPackageFromFile_Click (object sender, RoutedEventArgs e)
void | OnTaskRequested (Print3DManager sender, Print3DTaskRequestedEventArgs args)
async void | PrintPackage_Click (object sender, RoutedEventArgs e)
async void | SavePackage_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static async Task
< Printing3D3MFPackage > 		CreatePackageAsync ()
static async Task
< Printing3D3MFPackage > 		CreatePackageFromXmlAsync (string rawXml)
static async Task | FixTextureContentTypeAsync (Printing3D3MFPackage package)
static async Task | SetMaterialIndicesAsync (Printing3DMesh mesh)
static async Task | SetTriangleIndicesAsync (Printing3DMesh mesh)
static async Task | SetVerticesAsync (Printing3DMesh mesh)
static async Task
< IRandomAccessStream > 		StringToStreamAsync (string data)

Private Attributes

Printing3D3MFPackage | currentPackage
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 31 of file Scenario1_Print.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Print ( ) [inline]

Definition at line 36 of file Scenario1_Print.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CreateFromXml_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 329 of file Scenario1_Print.xaml.cs.

        {
            var rawXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "<model unit=\"millimeter\" xml:lang=\"en-US\" xmlns=\"http://schemas.microsoft.com/3dmanufacturing/2013/01\">" +
            "<resources><object id=\"0\" type=\"model\"><mesh><vertices>" +
            "<vertex x=\"0.000000\" y=\"0.000000\" z=\"10.000000\" />" +
            "<vertex x=\"0.000000\" y=\"10.000000\" z=\"10.000000\" />" +
            "<vertex x=\"0.000000\" y=\"0.000000\" z=\"0.000000\" />" +
            "<vertex x=\"0.000000\" y=\"10.000000\" z=\"0.000000\" />" +
            "<vertex x=\"10.000000\" y=\"0.000000\" z=\"10.000000\" />" +
            "<vertex x=\"10.000000\" y=\"10.000000\" z=\"10.000000\" />" +
            "<vertex x=\"10.000000\" y=\"0.000000\" z=\"0.000000\" />" +
            "<vertex x=\"10.000000\" y=\"10.000000\" z=\"0.000000\" />" +
            "</vertices><triangles>" +
            "<triangle v1=\"0\" v2=\"1\" v3=\"2\" />" +
            "<triangle v1=\"2\" v2=\"1\" v3=\"3\" />" +
            "<triangle v1=\"0\" v2=\"4\" v3=\"5\" />" +
            "<triangle v1=\"1\" v2=\"0\" v3=\"5\" />" +
            "<triangle v1=\"2\" v2=\"6\" v3=\"4\" />" +
            "<triangle v1=\"0\" v2=\"2\" v3=\"4\" />" +
            "<triangle v1=\"3\" v2=\"7\" v3=\"2\" />" +
            "<triangle v1=\"2\" v2=\"7\" v3=\"6\" />" +
            "<triangle v1=\"1\" v2=\"5\" v3=\"3\" />" +
            "<triangle v1=\"3\" v2=\"5\" v3=\"7\" />" +
            "<triangle v1=\"6\" v2=\"7\" v3=\"5\" />" +
            "<triangle v1=\"4\" v2=\"6\" v3=\"5\" />" +
            "</triangles></mesh></object></resources>" +
            "<build><item objectid=\"0\" transform=\"10 0 0 0 10 0 0 0 10 0 0 0\" /></build></model>";
            currentPackage = await CreatePackageFromXmlAsync(rawXml);
            rootPage.NotifyUser("Package created from XML.", NotifyType.StatusMessage);
            EnablePackageOperationButtons();
        }

static async Task<Printing3D3MFPackage> CreatePackageAsync ( ) [inline, static, private]

Definition at line 55 of file Scenario1_Print.xaml.cs.

        {
            var package = new Printing3D3MFPackage();

            var model = new Printing3DModel();
            model.Unit = Printing3DModelUnit.Millimeter;

            // Material indices start at 1. (0 is reserved.)

            #region Color materials
            // Create color materials.
            var colorMaterial1 = new Printing3DColorMaterial { Color = Color.FromArgb(255, 20, 20, 90) };
            var colorMaterial2 = new Printing3DColorMaterial { Color = Color.FromArgb(255, 250, 120, 45) };

            // Create a color group with id 1 and add the colors to it.
            var colorGroup = new Printing3DColorMaterialGroup(1);
            colorGroup.Colors.Add(colorMaterial1);
            colorGroup.Colors.Add(colorMaterial2);

            // add the color group to the model.
            model.Material.ColorGroups.Add(colorGroup);
            #endregion

            #region Base materials
            // Create base materials.
            var material1 = new Printing3DBaseMaterial { Name = Printing3DBaseMaterial.Pla, Color = colorMaterial1 };
            var material2 = new Printing3DBaseMaterial { Name = Printing3DBaseMaterial.Abs, Color = colorMaterial2 };

            // Create a new base material group with id 2 and add the base materials to it.
            var materialGroup = new Printing3DBaseMaterialGroup(2);
            materialGroup.Bases.Add(material1);
            materialGroup.Bases.Add(material2);

            // Add the material group to the base groups on the model.
            model.Material.BaseGroups.Add(materialGroup);

            #endregion

            #region Composite material groups
            // Create a composite material group with id 3.
            var compositeMaterialGroup = new Printing3DCompositeMaterialGroup(3);

            // Add it to the metadata.
            // The key is the string "composite" followed by the composite material group id.
            // The value specifies that the default base material group to use is id 2.
            model.Metadata.Add("composite3", "2");

            // The indices are relative to the material indices that will be set by SetMaterialIndicesAsync.
            compositeMaterialGroup.MaterialIndices.Add(0);
            compositeMaterialGroup.MaterialIndices.Add(1);

            // Create new composite materials.
            // The Values correspond to the materials added in the compositeMaterialGroup,
            // and they must sum to 1.0.

            // Composite material 1 consists of 20% material1 and 80% material2.
            var compositeMaterial1 = new Printing3DCompositeMaterial();
            compositeMaterial1.Values.Add(0.2);
            compositeMaterial1.Values.Add(0.8);

            // Composite material 2 consists of 50% material1 and 50% material2.
            var compositeMaterial2 = new Printing3DCompositeMaterial();
            compositeMaterial2.Values.Add(0.5);
            compositeMaterial2.Values.Add(0.5);

            // Composite material 3 consists of 80% material1 and 20% material2.
            var compositeMaterial3 = new Printing3DCompositeMaterial();
            compositeMaterial3.Values.Add(0.8);
            compositeMaterial3.Values.Add(0.2);

            // Composite material 4 consists of 40% material1 and 60% material2.
            var compositeMaterial4 = new Printing3DCompositeMaterial();
            compositeMaterial4.Values.Add(0.4);
            compositeMaterial4.Values.Add(0.6);

            // Add the composite materials to the compositeMaterialGroup.
            compositeMaterialGroup.Composites.Add(compositeMaterial1);
            compositeMaterialGroup.Composites.Add(compositeMaterial2);
            compositeMaterialGroup.Composites.Add(compositeMaterial3);
            compositeMaterialGroup.Composites.Add(compositeMaterial4);

            // Add the composite material group to the model.
            model.Material.CompositeGroups.Add(compositeMaterialGroup);
            #endregion

            #region Texture resource
            Printing3DTextureResource textureResource = new Printing3DTextureResource();

            // Set the texture path in the 3MF file.
            textureResource.Name = "/3D/Texture/msLogo.png";

            // Load the texture from our package.
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/msLogo.png"));
            textureResource.TextureData = await file.OpenReadAsync();

            package.Textures.Add(textureResource);
            #endregion

            #region 2D texture materials
            // Create a texture material group with id 4.
            var texture2CoordGroup = new Printing3DTexture2CoordMaterialGroup(4);

            // Add it to the metadata.
            // The key is the string "tex" followed by the texture material group id.
            // The value is the name of the texture resource (see textureResource.Name above).
            model.Metadata.Add("tex4", "/3D/Texture/msLogo.png");

            // Create texture materials and add them to the group.
            texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 0.0, V = 1.0 });
            texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 1.0, V = 1.0 });
            texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 0.0, V = 0.0 });
            texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 1.0, V = 0.0 });

            // Add the texture material group to the model.
            model.Material.Texture2CoordGroups.Add(texture2CoordGroup);
            #endregion

            #region Mesh
            var mesh = new Printing3DMesh();

            await SetVerticesAsync(mesh);
            await SetTriangleIndicesAsync(mesh);
            await SetMaterialIndicesAsync(mesh);

            // add the mesh to the model
            model.Meshes.Add(mesh);
            #endregion

            #region Adding a component to the build
            // create a component.
            Printing3DComponent component = new Printing3DComponent();

            // assign the mesh to the component's mesh.
            component.Mesh = mesh;

            // Add the component to the model. A model can have multiple components.
            model.Components.Add(component);

            // The world matrix for the component is the identity matrix.
            var componentWithMatrix = new Printing3DComponentWithMatrix() { Component = component, Matrix = Matrix4x4.Identity };

            // add the componentWithMatrix to the build.
            // The build defines what is to be printed from within a Printing3DModel.
            // If you leave a mesh out of the build, it will not be printed.
            model.Build.Components.Add(componentWithMatrix);
            #endregion

            // Save the completed model into a package.
            await package.SaveModelToPackageAsync(model);

            // fix any textures in the model file.
            await FixTextureContentTypeAsync(package);

            return package;
        }

static async Task<Printing3D3MFPackage> CreatePackageFromXmlAsync ( string rawXml ) [inline, static, private]

Definition at line 362 of file Scenario1_Print.xaml.cs.

        {
            var package = new Printing3D3MFPackage();
            package.ModelPart = await StringToStreamAsync(rawXml);
            return package;
        }

async void CreateProgrammatically_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario1_Print.xaml.cs.

        {
            currentPackage = await CreatePackageAsync();
            rootPage.NotifyUser("Package created programmatically.", NotifyType.StatusMessage);
            EnablePackageOperationButtons();
        }

void EnablePackageOperationButtons ( ) [inline, private]

Definition at line 41 of file Scenario1_Print.xaml.cs.

        {
            SaveButton.IsEnabled = true;
            PrintButton.IsEnabled = true;
        }

static async Task FixTextureContentTypeAsync ( Printing3D3MFPackage package ) [inline, static, private]

Definition at line 464 of file Scenario1_Print.xaml.cs.

        {
            XDocument xmldoc = XDocument.Load(package.ModelPart.AsStreamForRead());
            XNamespace ns3d = "http://schemas.microsoft.com/3dmanufacturing/material/2015/02";

            foreach (var node in xmldoc.Descendants(ns3d + "texture2d"))
            {
                var contentType = node.Attribute("contenttype");
                if (contentType.Value == "")
                {
                    if (node.Attribute("path").Value.EndsWith(".png"))
                    {
                        contentType.Value = "image/png";
                    }
                    else
                    {
                        contentType.Value = "image/jpg";
                    }
                }
            }

            // Update the model with the repaired XML.
            package.ModelPart = await StringToStreamAsync(xmldoc.ToString());
        }

async void LoadPackageFromFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 369 of file Scenario1_Print.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            openPicker.FileTypeFilter.Add(".3mf");

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file == null)
            {
                return;
            }

            rootPage.NotifyUser("Loading...", NotifyType.StatusMessage);

            var package = new Printing3D3MFPackage();
            using (var fileStream = await file.OpenAsync(FileAccessMode.Read))
            {
                var model = await package.LoadModelFromPackageAsync(fileStream);
                rootPage.NotifyUser("Repairing...", NotifyType.StatusMessage);
                await model.RepairAsync();
                rootPage.NotifyUser("Saving...", NotifyType.StatusMessage);
                await package.SaveModelToPackageAsync(model);
                await FixTextureContentTypeAsync(package);
            }

            currentPackage = package;
            rootPage.NotifyUser("Package created from file.", NotifyType.StatusMessage);
            EnablePackageOperationButtons();
        }

void OnTaskRequested | ( | Print3DManager | sender,
 |  | Print3DTaskRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 443 of file Scenario1_Print.xaml.cs.

        {
            Print3DTask print3dTask = args.Request.CreateTask("Sample Model", "Default", (e) => e.SetSource(currentPackage));

            // Optional notification handlers.
            print3dTask.Completed += (s, e) => rootPage.NotifyUser("Printing completed.", NotifyType.StatusMessage);
            print3dTask.Submitting += (s, e) => rootPage.NotifyUser("Submitting print job.", NotifyType.StatusMessage);
        }

async void PrintPackage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 430 of file Scenario1_Print.xaml.cs.

        {
            // register the PrintTaskRequest callback to get the Printing3D3MFPackage.
            var print3DManager = Print3DManager.GetForCurrentView();
            print3DManager.TaskRequested += OnTaskRequested;

            // show the PrintUI
            var result = await Print3DManager.ShowPrintUIAsync();

            // Remove the print task request after the dialog is complete.
            print3DManager.TaskRequested -= OnTaskRequested;
        }

async void SavePackage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 402 of file Scenario1_Print.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            FileSavePicker savePicker = new FileSavePicker();
            savePicker.DefaultFileExtension = ".3mf";
            savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            savePicker.FileTypeChoices.Add("3MF File", new[] { ".3mf" });
            var storageFile = await savePicker.PickSaveFileAsync();
            if (storageFile == null)
            {
                return;
            }

            using (var stream = await currentPackage.SaveAsync())
            {
                stream.Seek(0);
                using (var dataReader = new DataReader(stream))
                {
                    await dataReader.LoadAsync((uint)stream.Size);
                    var buffer = dataReader.ReadBuffer((uint)stream.Size);
                    await FileIO.WriteBufferAsync(storageFile, buffer);
                }
            }

            rootPage.NotifyUser("Saved", NotifyType.StatusMessage);
        }

static async Task SetMaterialIndicesAsync ( Printing3DMesh mesh ) [inline, static, private]

Definition at line 283 of file Scenario1_Print.xaml.cs.

        {
            Printing3DBufferDescription description;
            description.Format = Printing3DBufferFormat.Printing3DUInt;
            description.Stride = 4; // 4 indices per material
            mesh.IndexCount = 12; // 12 triangles with material
            mesh.TriangleMaterialIndicesDescription = description;

            // Create the buffer into which we will write the material indices.
            mesh.CreateTriangleMaterialIndices(sizeof(UInt32) * description.Stride * mesh.IndexCount);

            // Fill the buffer with material indices.
            using (var stream = mesh.GetTriangleMaterialIndices().AsStream())
            {
                UInt32[] indices =
                {
                    // base materials:
                    // in  the BaseMaterialGroup, the BaseMaterial with id=0 will be applied to these triangle vertices
                    2, 0, 0, 0,
                    2, 0, 0, 0,
                    // color materials:
                    // in the ColorMaterialGroup, the ColorMaterials with these ids will be applied to these triangle vertices
                    1, 1, 1, 1,
                    1, 1, 1, 1,
                    1, 0, 0, 0,
                    1, 0, 0, 0,
                    1, 0, 1, 0,
                    1, 0, 1, 1,
                    // composite materials:
                    // in the CompositeMaterialGroup, the CompositeMaterial with id=0 will be applied to these triangles
                    3,0,0,0,
                    3,0,0,0,
                    // texture materials:
                    // in the Texture2CoordMaterialGroup, each texture coordinate is mapped to the appropriate vertex on these
                    // two adjacent triangle faces, so that the square face they create displays the original rectangular image
                    4, 0, 3, 1,
                    4, 2, 3, 0,
                };

                var vertexData = indices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();
                await stream.WriteAsync(vertexData, 0, vertexData.Length);
            }
        }

static async Task SetTriangleIndicesAsync ( Printing3DMesh mesh ) [inline, static, private]

Definition at line 247 of file Scenario1_Print.xaml.cs.

        {
            Printing3DBufferDescription description;
            description.Format = Printing3DBufferFormat.Printing3DUInt;
            description.Stride = 3; // 3 vertex position indices per triangle
            mesh.IndexCount = 12; // 12 triangles in the cube
            mesh.TriangleIndicesDescription = description;

            // Create the buffer into which we will write the triangle vertex indices.
            mesh.CreateTriangleIndices(sizeof(UInt32) * description.Stride * mesh.IndexCount);

            // Fill the buffer with triangle vertex indices.
            using (var stream = mesh.GetTriangleIndices().AsStream())
            {
                UInt32[] indices =
                {
                    1, 0, 2,
                    1, 2, 3,
                    0, 1, 5,
                    0, 5, 4,
                    1, 3, 7,
                    1, 7, 5,
                    2, 7, 3,
                    2, 6, 7,
                    0, 6, 2,
                    0, 4, 6,
                    6, 5, 7,
                    4, 5, 6,
                };

                var vertexData = indices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();
                await stream.WriteAsync(vertexData, 0, vertexData.Length);
            }
        }

static async Task SetVerticesAsync ( Printing3DMesh mesh ) [inline, static, private]

Definition at line 214 of file Scenario1_Print.xaml.cs.

        {
            Printing3DBufferDescription description;
            description.Format = Printing3DBufferFormat.Printing3DDouble;
            description.Stride = 3; // Three values per vertex (x, y, z).
            mesh.VertexPositionsDescription = description;
            mesh.VertexCount = 8; // 8 total vertices in the cube

            // Create the buffer into which we will write the vertex positions.
            mesh.CreateVertexPositions(sizeof(double) * description.Stride * mesh.VertexCount);

            // Fill the buffer with vertex coordinates.
            using (var stream = mesh.GetVertexPositions().AsStream())
            {
                double[] vertices =
                {
                    0, 0, 0,
                    10, 0, 0,
                    0, 10, 0,
                    10, 10, 0,
                    0, 0, 10,
                    10, 0, 10,
                    0, 10, 10,
                    10, 10, 10,
                };

                byte[] vertexData = vertices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();

                await stream.WriteAsync(vertexData, 0, vertexData.Length);
            }
        }

static async Task<IRandomAccessStream> StringToStreamAsync ( string data ) [inline, static, private]

Definition at line 452 of file Scenario1_Print.xaml.cs.

        {
            var buffer = CryptographicBuffer.ConvertStringToBinary(data, BinaryStringEncoding.Utf8);
            var outputStream = new InMemoryRandomAccessStream();
            await outputStream.WriteAsync(buffer);
            return outputStream;
        }

Member Data Documentation

Printing3D3MFPackage currentPackage [private]

Definition at line 34 of file Scenario1_Print.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario1_Print.xaml.cs.

The documentation for this class was generated from the following file:
  • 3DPrinting/cs/Scenario1_Print.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ProvisionTPM Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ProvisionTPM
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_ProvisionTPM Class Reference

List of all members.

Public Member Functions

Scenario1_ProvisionTPM ()

Private Member Functions

async void | Create_Click (object sender, RoutedEventArgs e)
void | HandleCardAdded (SmartCardReader sender, CardAddedEventArgs args)
SmartCardPinPolicy | ParsePinPolicy ()

Private Attributes

const int | NTE_DEVICE_NOT_FOUND = unchecked((int)0x80090035)
const int | NTE_DEVICE_NOT_READY = unchecked((int)0x80090030)
const String | pinPolicyAllowed = "Allowed"
const String | pinPolicyDisallowed = "Disallowed"
const String | pinPolicyRequireOne = "Require At Least One"
SmartCardReader | reader = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario1_ProvisionTPM.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ProvisionTPM ( ) [inline]

Definition at line 35 of file Scenario1_ProvisionTPM.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Create_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'create' button.

Parameters:
sender
e

Definition at line 45 of file Scenario1_ProvisionTPM.xaml.cs.

        {
            Button b = sender as Button;
            b.IsEnabled = false;
            rootPage.NotifyUser("Creating TPM virtual smart card...", NotifyType.StatusMessage);

            try
            {
                SmartCardPinPolicy pinPolicy = ParsePinPolicy();

                IBuffer adminkey = CryptographicBuffer.GenerateRandom(MainPage.ADMIN_KEY_LENGTH_IN_BYTES);

                SmartCardProvisioning provisioning = await SmartCardProvisioning.RequestVirtualSmartCardCreationAsync(FriendlyName.Text, adminkey, pinPolicy);

                // If card creation is cancelled by the user,
                // RequestVirtualSmartCard will return null instead of a
                // SmartCardProvisioning object.
                if (null == provisioning)
                {
                    rootPage.NotifyUser("TPM virtual smart card creation was canceled by the user.", NotifyType.StatusMessage);
                    b.IsEnabled = true;
                    return;
                }

                // The following two lines are not directly related to TPM virtual
                // smart card creation, but are used to demonstrate how to handle
                // CardAdded events by registering an event handler with a
                // SmartCardReader object.  Since we are using a TPM virtual smart
                // card in this case, the card cannot actually be added to or
                // removed from the reader, but a CardAdded event will fire as
                // soon as the event handler is added, since the card is already
                // inserted.
                //
                // We must retain a reference to the SmartCardReader object to
                // which we are adding the event handler.  Hence we assign the
                // reader object associated with the SmartCardProvisioning we
                // received from RequestVirtualSmartCardCreationAsync to the
                // class's "reader" member.  Then, we use += to add the
                // HandleCardAdded method as an event handler.  The function
                // will be automatically boxed in a TypedEventHandler, but
                // the function signature match the template arguments for
                // the specific event - in this case,
                // <SmartCardReader, CardAddedEventArgs>
                reader = provisioning.SmartCard.Reader;
                reader.CardAdded += HandleCardAdded;

                // Store the reader's device ID and admin key to enable the
                // following scenarios in the sample.
                rootPage.SmartCardReaderDeviceId = provisioning.SmartCard.Reader.DeviceId;
                rootPage.AdminKey = adminkey;

                // Once RequestVirtualSmartCardCreationAsync has returned, the card
                // is already provisioned and ready to use.  Therefore, the steps
                // in this using block are not actually necessary at this point.
                // However, should you want to re-provision the card in the future,
                // you would follow this sequence: acquire a challenge context,
                // calculate a response, and then call ProvisionAsync on the
                // challenge context with the calculated response.
                using (var context = await provisioning.GetChallengeContextAsync())
                {
                    IBuffer response = ChallengeResponseAlgorithm.CalculateResponse(context.Challenge, adminkey);
                    await context.ProvisionAsync(response, true);
                }

                rootPage.NotifyUser("TPM virtual smart card is provisioned and ready for use.", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                // Two potentially common error scenarios when creating a TPM
                // virtual smart card are that the user's machine may not have
                // a TPM, or the TPM may not be ready for use.  It is important
                // to explicitly check for these scenarios by checking the
                // HResult of any exceptions thrown by
                // RequestVirtualSmartCardCreationAsync and gracefully
                // providing a suitable message to the user.
                if (NTE_DEVICE_NOT_FOUND == ex.HResult)
                {
                    rootPage.NotifyUser("We were unable to find a Trusted Platform Module on your machine. A TPM is required to use a TPM Virtual Smart Card.", NotifyType.ErrorMessage);
                }
                else if (NTE_DEVICE_NOT_READY == ex.HResult)
                {
                    rootPage.NotifyUser("Your Trusted Platform Module is not ready for use. Please contact your administrator for assistance with initializing your TPM.", NotifyType.ErrorMessage);
                }
                else
                {
                    rootPage.NotifyUser("TPM virtual smart card creation failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
                }
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

void HandleCardAdded | ( | SmartCardReader | sender,
 |  | CardAddedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 139 of file Scenario1_ProvisionTPM.xaml.cs.

        {
            // Note that this event is raised from a background thread.
            // However, the NotifyUser method is safe to call from background threads.
            rootPage.NotifyUser("Card added to reader " + reader.Name + ".", NotifyType.StatusMessage);
        }

SmartCardPinPolicy ParsePinPolicy ( ) [inline, private]

Definition at line 146 of file Scenario1_ProvisionTPM.xaml.cs.

        {
            SmartCardPinPolicy pinPolicy = new SmartCardPinPolicy();
            pinPolicy.MinLength = uint.Parse(PinMinLength.Text);
            pinPolicy.MaxLength = uint.Parse(PinMaxLength.Text);

            switch (PinUppercase.SelectedValue.ToString())
            {
                case pinPolicyDisallowed:
                    pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.Disallow;
                    break;
                case pinPolicyAllowed:
                    pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.Allow;
                    break;
                case pinPolicyRequireOne:
                    pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
                    break;
                default:
                    throw new InvalidOperationException();
            }

            switch (PinLowercase.SelectedValue.ToString())
            {
                case pinPolicyDisallowed:
                    pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.Disallow;
                    break;
                case pinPolicyAllowed:
                    pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.Allow;
                    break;
                case pinPolicyRequireOne:
                    pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
                    break;
                default:
                    throw new InvalidOperationException();
            }

            switch (PinDigits.SelectedValue.ToString())
            {
                case pinPolicyDisallowed:
                    pinPolicy.Digits = SmartCardPinCharacterPolicyOption.Disallow;
                    break;
                case pinPolicyAllowed:
                    pinPolicy.Digits = SmartCardPinCharacterPolicyOption.Allow;
                    break;
                case pinPolicyRequireOne:
                    pinPolicy.Digits = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
                    break;
                default:
                    throw new InvalidOperationException();
            }

            switch (PinSpecial.SelectedValue.ToString())
            {
                case pinPolicyDisallowed:
                    pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.Disallow;
                    break;
                case pinPolicyAllowed:
                    pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.Allow;
                    break;
                case pinPolicyRequireOne:
                    pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
                    break;
                default:
                    throw new InvalidOperationException();
            }

            return pinPolicy;
        }

Member Data Documentation

const int NTE_DEVICE_NOT_FOUND = unchecked((int)0x80090035) [private]

Definition at line 27 of file Scenario1_ProvisionTPM.xaml.cs.

const int NTE_DEVICE_NOT_READY = unchecked((int)0x80090030) [private]

Definition at line 26 of file Scenario1_ProvisionTPM.xaml.cs.

const String pinPolicyAllowed = "Allowed" [private]

Definition at line 30 of file Scenario1_ProvisionTPM.xaml.cs.

const String pinPolicyDisallowed = "Disallowed" [private]

Definition at line 29 of file Scenario1_ProvisionTPM.xaml.cs.

const String pinPolicyRequireOne = "Require At Least One" [private]

Definition at line 31 of file Scenario1_ProvisionTPM.xaml.cs.

SmartCardReader reader = null [private]

Definition at line 33 of file Scenario1_ProvisionTPM.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario1_ProvisionTPM.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario1_ProvisionTPM.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ReactiveRequest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ReactiveRequest
Public Member Functions

Scenario1_ReactiveRequest Class Reference

This Scenario demonstrates simple Reactive license Acquisition. More...

List of all members.

Public Member Functions

Scenario1_ReactiveRequest ()

Detailed Description

Definition at line 20 of file Scenario1_ReactiveRequest.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ReactiveRequest ( ) [inline]

Definition at line 22 of file Scenario1_ReactiveRequest.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = new ReactiveViewModel(mediaElement);
        }

The documentation for this class was generated from the following file:
  • PlayReady/cs/Scenario1_ReactiveRequest.xaml.cs
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ReadData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_ReadData
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ReadData Class Reference

List of all members.

Public Member Functions

Scenario1_ReadData ()
Scenario1_ReadData ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async Task | StartScenarioAsync ()
async Task | StartScenarioAsync ()
async void | StartStopScenario_Click (object sender, RoutedEventArgs e)
async void | StartStopScenario_Click (object sender, RoutedEventArgs e)
void | StopScenario ()
void | StopScenario ()
void | Timer_Tick (object sender, object e)
void | Timer_Tick (object sender, object e)

Private Attributes

SpiDevice | adxl345Sensor
I2cDevice | htu21dSensor
DispatcherTimer | timer

Detailed Description

Definition at line 25 of file Scenario1_ReadData.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ReadData ( ) [inline]

Definition at line 30 of file Scenario1_ReadData.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario1_ReadData ( ) [inline]

Definition at line 28 of file Scenario1_ReadData.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario1_ReadData.xaml.cs.

        {
            StopScenario();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario1_ReadData.xaml.cs.

        {
            StopScenario();
        }

task< void > StartScenarioAsync ( ) [inline, private]

Definition at line 40 of file Scenario1_ReadData.xaml.cs.

        {
            string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
            IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(i2cDeviceSelector);

            // 0x40 was determined by looking at the datasheet for the HTU21D sensor.
            var HTU21D_settings = new I2cConnectionSettings(0x40);

            // If this next line crashes with an ArgumentOutOfRangeException,
            // then the problem is that no I2C devices were found.
            //
            // If the next line crashes with Access Denied, then the problem is
            // that access to the I2C device (HTU21D) is denied.
            //
            // The call to FromIdAsync will also crash if the settings are invalid.
            //
            // FromIdAsync produces null if there is a sharing violation on the device.
            // This will result in a NullReferenceException in Timer_Tick below.
            htu21dSensor = await I2cDevice.FromIdAsync(devices[0].Id, HTU21D_settings);

            // Start the polling timer.
            timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(500) };
            timer.Tick += Timer_Tick;
            timer.Start();
        }

async Task StartScenarioAsync ( ) [inline, private]

Definition at line 38 of file Scenario1_ReadData.xaml.cs.

        {
            String spiDeviceSelector = SpiDevice.GetDeviceSelector();
            IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(spiDeviceSelector);

            // 0 = Chip select line to use.
            var ADXL345_Settings = new SpiConnectionSettings(0);

            // 5MHz is the rated speed of the ADXL345 accelerometer.
            ADXL345_Settings.ClockFrequency = 5000000;

            // The accelerometer expects an idle-high clock polarity.
            // We use Mode3 to set the clock polarity and phase to: CPOL = 1, CPHA = 1.
            ADXL345_Settings.Mode = SpiMode.Mode3;

            // If this next line crashes with an ArgumentOutOfRangeException,
            // then the problem is that no SPI devices were found.
            //
            // If the next line crashes with Access Denied, then the problem is
            // that access to the SPI device (ADXL345) is denied.
            //
            // The call to FromIdAsync will also crash if the settings are invalid.
            //
            // FromIdAsync produces null if there is a sharing violation on the device.
            // This will result in a NullReferenceException a few lines later.
            adxl345Sensor = await SpiDevice.FromIdAsync(devices[0].Id, ADXL345_Settings);

            //
            // Initialize the accelerometer:
            //
            // For this device, we create 2-byte write buffers:
            // The first byte is the register address we want to write to.
            // The second byte is the contents that we want to write to the register.
            //

            // 0x31 is address of data format register, 0x01 sets range to +- 4Gs.
            byte[] WriteBuf_DataFormat = new byte[] { 0x31, 0x01 };

            // 0x2D is address of power control register, 0x08 puts the accelerometer into measurement mode.
            byte[] WriteBuf_PowerControl = new byte[] { 0x2D, 0x08 };

            // Write the register settings.
            //
            // If this next line crashes with a NullReferenceException, then
            // there was a sharing violation on the device.
            // (See comment earlier in this function.)
            //
            // If this next line crashes for some other reason, then there was
            // an error communicating with the device.

            adxl345Sensor.Write(WriteBuf_DataFormat);
            adxl345Sensor.Write(WriteBuf_PowerControl);

            // Start the polling timer.
            timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(100) };
            timer.Tick += Timer_Tick;
            timer.Start();
        }

async void StartStopScenario_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario1_ReadData.xaml.cs.

        {
            if (timer != null)
            {
                StopScenario();
                StartStopButton.Content = "Start";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                StartStopButton.IsEnabled = false;
                await StartScenarioAsync();
                StartStopButton.IsEnabled = true;
                StartStopButton.Content = "Stop";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

async void StartStopScenario_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario1_ReadData.xaml.cs.

        {
            if (timer != null)
            {
                StopScenario();
                StartStopButton.Content = "Start";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                StartStopButton.IsEnabled = false;
                await StartScenarioAsync();
                StartStopButton.IsEnabled = true;
                StartStopButton.Content = "Stop";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

void StopScenario ( ) [inline, private]

Definition at line 66 of file Scenario1_ReadData.xaml.cs.

        {
            if (timer != null)
            {
                timer.Tick -= Timer_Tick;
                timer.Stop();
                timer = null;
            }

            // Release the I2C sensor.
            if (htu21dSensor != null)
            {
                htu21dSensor.Dispose();
                htu21dSensor = null;
            }
        }

void StopScenario ( ) [inline, private]

Definition at line 97 of file Scenario1_ReadData.xaml.cs.

        {
            if (timer != null)
            {
                timer.Tick -= Timer_Tick;
                timer.Stop();
                timer = null;
            }

            // Release the SPI sensor.
            if (adxl345Sensor != null)
            {
                adxl345Sensor.Dispose();
                adxl345Sensor = null;
            }
        }

void Timer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 132 of file Scenario1_ReadData.xaml.cs.

        {
            const byte ACCEL_SPI_RW_BIT = 0x80; // Bit used in SPI transactions to indicate read/write
            const byte ACCEL_SPI_MB_BIT = 0x40; // Bit used to indicate multi-byte SPI transactions
            const byte ACCEL_REG_X = 0x32;      // Address of the X Axis data register
            const int ACCEL_RES = 1024;         // The ADXL345 has 10 bit resolution giving 1024 unique values
            const int ACCEL_DYN_RANGE_G = 8;    // The ADXL345 had a total dynamic range of 8G, since we're configuring it to +-4G
            const int UNITS_PER_G = ACCEL_RES / ACCEL_DYN_RANGE_G;  // Ratio of raw int values to G units

            byte[] ReadBuf = new byte[6 + 1];    // Read buffer of size 6 bytes (2 bytes * 3 axes) + 1 byte padding
            byte[] RegAddrBuf = new byte[1 + 6]; // Register address buffer of size 1 byte + 6 bytes padding

            // Register address we want to read from with read and multi-byte bit set
            RegAddrBuf[0] = ACCEL_REG_X | ACCEL_SPI_RW_BIT | ACCEL_SPI_MB_BIT;

            // If this next line crashes, then there was an error communicating with the device.
            adxl345Sensor.TransferFullDuplex(RegAddrBuf, ReadBuf);

            // In order to get the raw 16-bit data values, we need to concatenate two 8-bit bytes for each axis
            short AccelerationRawX = BitConverter.ToInt16(ReadBuf, 1);
            short AccelerationRawY = BitConverter.ToInt16(ReadBuf, 3);
            short AccelerationRawZ = BitConverter.ToInt16(ReadBuf, 5);

            // Convert raw values to G's and display them.
            X.Text = ((double)AccelerationRawX / UNITS_PER_G).ToString();
            Y.Text = ((double)AccelerationRawY / UNITS_PER_G).ToString();
            Z.Text = ((double)AccelerationRawZ / UNITS_PER_G).ToString();
        }

void Timer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario1_ReadData.xaml.cs.

        {
            // Read data from I2C.
            var command = new byte[1];
            var humidityData = new byte[2];
            var temperatureData = new byte[2];

            // Read humidity.
            command[0] = 0xE5;

            // If this next line crashes with a NullReferenceException, then
            // there was a sharing violation on the device. (See StartScenarioAsync above.)
            //
            // If this next line crashes for some other reason, then there was
            // an error accessing the device.
            htu21dSensor.WriteRead(command, humidityData);

            // Read temperature.
            command[0] = 0xE3;
            // If this next line crashes, then there was an error accessing the sensor.
            htu21dSensor.WriteRead(command, temperatureData);

            // Calculate and report the humidity.
            var rawHumidityReading = humidityData[0] << 8 | humidityData[1];
            var humidityRatio = rawHumidityReading / (float)65536;
            double humidity = -6 + (125 * humidityRatio);
            CurrentHumidity.Text = humidity.ToString();

            // Calculate and report the temperature.
            var rawTempReading = temperatureData[0] << 8 | temperatureData[1];
            var tempRatio = rawTempReading / (float)65536;
            double temperature = (-46.85 + (175.72 * tempRatio)) * 9 / 5 + 32;
            CurrentTemp.Text = temperature.ToString();
        }

Member Data Documentation

SpiDevice adxl345Sensor [private]

Definition at line 25 of file Scenario1_ReadData.xaml.cs.

I2cDevice htu21dSensor [private]

Definition at line 27 of file Scenario1_ReadData.xaml.cs.

DispatcherTimer timer [private]

Definition at line 28 of file Scenario1_ReadData.xaml.cs.

The documentation for this class was generated from the following files:
  • IoT-I2C/cs/Scenario1_ReadData.xaml.cs
  • IoT-SPI/cs/Scenario1_ReadData.xaml.cs
  • IoT-I2C/cpp/Scenario1_ReadData.xaml.cpp
  • IoT-SPI/cpp/Scenario1_ReadData.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Render Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Render
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Render Class Reference

List of all members.

Public Member Functions

Scenario1_Render ()

Private Member Functions

async void | LoadDocument (object sender, RoutedEventArgs args)
async void | ViewPage (object sender, RoutedEventArgs args)

Private Attributes

const int | GenericFail = unchecked((int)0x80004005)
PdfDocument | pdfDocument
MainPage rootPage = MainPage.Current
const int | WrongPassword = unchecked((int)0x8007052b)

Detailed Description

Definition at line 25 of file Scenario1_Render.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Render ( ) [inline]

Definition at line 33 of file Scenario1_Render.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void LoadDocument | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1_Render.xaml.cs.

        {
            LoadButton.IsEnabled = false;

            pdfDocument = null;
            Output.Source = null;
            PageNumberBox.Text = "1";
            RenderingPanel.Visibility = Visibility.Collapsed;

            var picker = new FileOpenPicker();
            picker.FileTypeFilter.Add(".pdf");
            StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                ProgressControl.Visibility = Visibility.Visible;
                try
                {
                    pdfDocument = await PdfDocument.LoadFromFileAsync(file, PasswordBox.Password);
                }
                catch (Exception ex)
                {
                    switch (ex.HResult)
                    {
                        case WrongPassword:
                            rootPage.NotifyUser("Document is password-protected and password is incorrect.", NotifyType.ErrorMessage);
                            break;

                        case GenericFail:
                            rootPage.NotifyUser("Document is not a valid PDF.", NotifyType.ErrorMessage);
                            break;

                        default:
                            // File I/O errors are reported as exceptions.
                            rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                            break;
                    }
                }

                if (pdfDocument != null)
                {
                    RenderingPanel.Visibility = Visibility.Visible;
                    if (pdfDocument.IsPasswordProtected)
                    {
                        rootPage.NotifyUser("Document is password protected.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Document is not password protected.", NotifyType.StatusMessage);
                    }
                    PageCountText.Text = pdfDocument.PageCount.ToString();
                }
                ProgressControl.Visibility = Visibility.Collapsed;
            }
            LoadButton.IsEnabled = true;
        }

async void ViewPage | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 94 of file Scenario1_Render.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            uint pageNumber;
            if (!uint.TryParse(PageNumberBox.Text, out pageNumber) || (pageNumber < 1) || (pageNumber > pdfDocument.PageCount))
            {
                rootPage.NotifyUser("Invalid page number.", NotifyType.ErrorMessage);
                return;
            }

            Output.Source = null;
            ProgressControl.Visibility = Visibility.Visible;

            // Convert from 1-based page number to 0-based page index.
            uint pageIndex = pageNumber - 1;

            using (PdfPage page = pdfDocument.GetPage(pageIndex))
            {
                var stream = new InMemoryRandomAccessStream();
                switch (Options.SelectedIndex)
                {
                    // View actual size.
                    case 0:
                        await page.RenderToStreamAsync(stream);
                        break;

                    // View half size on beige background.
                    case 1:
                        var options1 = new PdfPageRenderOptions();
                        options1.BackgroundColor = Windows.UI.Colors.Beige;
                        options1.DestinationHeight = (uint)(page.Size.Height / 2);
                        options1.DestinationWidth = (uint)(page.Size.Width / 2);
                        await page.RenderToStreamAsync(stream, options1);
                        break;

                    // Crop to center.
                    case 2:
                        var options2 = new PdfPageRenderOptions();
                        var rect = page.Dimensions.TrimBox;
                        options2.SourceRect = new Rect(rect.X + rect.Width / 4, rect.Y + rect.Height / 4, rect.Width / 2, rect.Height / 2);
                        await page.RenderToStreamAsync(stream, options2);
                        break;
                }
                BitmapImage src = new BitmapImage();
                Output.Source = src;
                await src.SetSourceAsync(stream);
            }
            ProgressControl.Visibility = Visibility.Collapsed;
        }

Member Data Documentation

const int GenericFail = unchecked((int)0x80004005) [private]

Definition at line 31 of file Scenario1_Render.xaml.cs.

PdfDocument pdfDocument [private]

Definition at line 28 of file Scenario1_Render.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario1_Render.xaml.cs.

const int WrongPassword = unchecked((int)0x8007052b) [private]

Definition at line 30 of file Scenario1_Render.xaml.cs.

The documentation for this class was generated from the following files:
  • PdfDocument/cs/Scenario1_Render.xaml.cs
  • PdfDocument/cpp/Scenario1_Render.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Save Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Save
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Save Class Reference

List of all members.

Public Member Functions

Scenario1_Save ()

Private Member Functions

void SaveCredential_Click (Object sender, RoutedEventArgs args)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario1_Save.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Save ( ) [inline]

Definition at line 25 of file Scenario1_Save.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void SaveCredential_Click | ( | Object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario1_Save.xaml.cs.

        {
            var resource = InputResourceValue.Text;
            var userName = InputUserNameValue.Text;
            var password = InputPasswordValue.Password;

            if (resource  == "" || userName == "" || password == "")
            {
                rootPage.NotifyUser("All fields are required when saving a credential.", NotifyType.ErrorMessage);
            }
            else
            {
                // Add a credential to PasswordVault with provided resource, user name, and password.
                // Replaces any existing credential with the same resource and user name.
                var vault = new PasswordVault();
                var cred = new PasswordCredential(resource, userName, password);
                vault.Add(cred);

                rootPage.NotifyUser("Credential saved successfully. Resource: " + cred.Resource + " Username: " + cred.UserName + " Password: " + cred.Password, NotifyType.StatusMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario1_Save.xaml.cs.

The documentation for this class was generated from the following files:
  • PasswordVault/cs/Scenario1_Save.xaml.cs
  • PasswordVault/cpp/Scenario1_Save.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SecondaryWindow Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SecondaryWindow
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_SecondaryWindow Class Reference

List of all members.

Public Member Functions

Scenario1_SecondaryWindow ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | Button_Click (object sender, RoutedEventArgs e)

Private Attributes

AppWindow | appWindow
Frame | appWindowFrame = new Frame()

Detailed Description

Definition at line 21 of file Scenario1_SecondaryWindow.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SecondaryWindow ( ) [inline]

Definition at line 26 of file Scenario1_SecondaryWindow.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario1_SecondaryWindow.xaml.cs.

        {
            showWindowBtn.IsEnabled = false;

            // Only ever create one window. If the AppWindow already exists call TryShow on it to bring it to foreground.
            if (appWindow == null)
            {
                // Create a new window
                appWindow = await AppWindow.TryCreateAsync();
                // Make sure we release the reference to this window, and release XAML resources, when it's closed
                appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
                // Navigate the frame to the page we want to show in the new window
                appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
                // Attach the XAML content to our window
                ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
            }

            // Now show the window
            await appWindow.TryShowAsync();

            showWindowBtn.IsEnabled = true;
        }

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_SecondaryWindow.xaml.cs.

        {
            if (appWindow != null)
            {
                await appWindow.CloseAsync();
            }
        }

Member Data Documentation

AppWindow appWindow [private]

Definition at line 23 of file Scenario1_SecondaryWindow.xaml.cs.

Frame appWindowFrame = new Frame() [private]

Definition at line 24 of file Scenario1_SecondaryWindow.xaml.cs.

The documentation for this class was generated from the following file:
  • AppWindow/cs/Scenario1_SecondaryWindow.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SelectDisplay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SelectDisplay
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_SelectDisplay Class Reference

List of all members.

Public Member Functions

Scenario1_SelectDisplay ()
bool | IsNonNull (object item)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | RefreshButton_Click (object sender, RoutedEventArgs e)
void | RestartWatcher ()
async void | SelectButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation deviceInfo)
void | Watcher_EnumerationCompleted (DeviceWatcher sender, object e)

Private Attributes

MainPage rootPage = MainPage.Current
DeviceWatcher | watcher

Detailed Description

Definition at line 23 of file Scenario1_SelectDisplay.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SelectDisplay ( ) [inline]

Definition at line 28 of file Scenario1_SelectDisplay.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

bool IsNonNull ( object item )
override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario1_SelectDisplay.xaml.cs.

        {
            StopWatcher();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario1_SelectDisplay.xaml.cs.

        {
            RestartWatcher();
        }

void RefreshButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file Scenario1_SelectDisplay.xaml.cs.

        {
            RestartWatcher();
        }

void RestartWatcher ( ) [inline, private]

Definition at line 43 of file Scenario1_SelectDisplay.xaml.cs.

        {
            StopWatcher();

            // Clear any old LineDisplay devices from the list box.
            DisplaysListBox.Items.Clear();

            // Enumerate the LineDisplay devices and put them in our list box.
            watcher = DeviceInformation.CreateWatcher(LineDisplay.GetDeviceSelector(PosConnectionTypes.All));
            watcher.Added += Watcher_Added;
            watcher.EnumerationCompleted += Watcher_EnumerationCompleted;
            watcher.Start();
        }

async void SelectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario1_SelectDisplay.xaml.cs.

        {
            var item = (ListBoxItem)DisplaysListBox.SelectedValue;
            SelectButton.IsEnabled = false;

            var name = (string)item.Content;
            var deviceId = (string)item.Tag;
            using (ClaimedLineDisplay lineDisplay = await ClaimedLineDisplay.FromIdAsync(deviceId))
                {
                    if (lineDisplay != null)
                    {
                        await lineDisplay.DefaultWindow.TryClearTextAsync();
                        rootPage.NotifyUser($"Selected: {name}", NotifyType.StatusMessage);

                        // Save this device ID for other scenarios.
                        rootPage.LineDisplayId = deviceId;
                    }
                    else
                    {
                        rootPage.NotifyUser("Unable to claim the Line Display", NotifyType.ErrorMessage);
                    }

                SelectButton.IsEnabled = true;
            }
        }

void StopWatcher ( ) [inline, private]

Definition at line 57 of file Scenario1_SelectDisplay.xaml.cs.

        {
            if (watcher != null && (watcher.Status == DeviceWatcherStatus.Started))
            {
                watcher.Stop();
            }
            watcher = null;
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario1_SelectDisplay.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var item = new ListBoxItem();
                item.Content = deviceInfo.Name;
                item.Tag = deviceInfo.Id;
                DisplaysListBox.Items.Add(item);
            });
        }

void Watcher_EnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario1_SelectDisplay.xaml.cs.

        {
            sender.Stop();
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_SelectDisplay.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 26 of file Scenario1_SelectDisplay.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario1_SelectDisplay.xaml.cs
  • LineDisplay/cpp/Scenario1_SelectDisplay.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SimpleListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SimpleListView
Public Member Functions

Scenario1_SimpleListView Class Reference

List of all members.

Public Member Functions

Scenario1_SimpleListView ()

Detailed Description

Definition at line 17 of file Scenario1_SimpleListView.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SimpleListView ( ) [inline]

Definition at line 19 of file Scenario1_SimpleListView.xaml.cs.

        {
            InitializeComponent();
            ContactsCVS.Source = Contact.GetContactsGrouped(250);
        }

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario1_SimpleListView.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SimplestAdaptiveStreaming Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SimplestAdaptiveStreaming
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario1_SimplestAdaptiveStreaming Class Reference

See the README.md for discussion of this scenario.

List of all members.

Public Member Functions

Scenario1_SimplestAdaptiveStreaming ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | Load_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 24 of file Scenario1_SimplestAdaptiveStreaming.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SimplestAdaptiveStreaming ( ) [inline]

Definition at line 26 of file Scenario1_SimplestAdaptiveStreaming.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Load_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario1_SimplestAdaptiveStreaming.xaml.cs.

        {
            // NOTE: Change this to 115 to see DASH with PlayReady scenario
            const int contentIdForCMS = 1;

            AdaptiveContentModel adaptiveContentModel = MainPage.FindContentById(contentIdForCMS);

            if (adaptiveContentModel.PlayReady)
            {
                // For PlayReady, we need to create and setup MediaPlayer.MediaProtectionManager
                // All scenarios use a helper class to do this, see Helpers\PlayReadyHelper.cs
                var mp = new MediaPlayer();
                var prHelper = new PlayReadyHelper(); // From SDKTemplate.Helpers.PlayReadyHelper
                prHelper.SetUpProtectionManager(mp);
                mediaPlayerElement.SetMediaPlayer(mp);
            }

            mediaPlayerElement.Source = MediaSource.CreateFromUri(adaptiveContentModel.ManifestUri);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_SimplestAdaptiveStreaming.xaml.cs.

        {
            var mp = mediaPlayerElement.MediaPlayer;
            if (mp != null)
            {
                // Ensure MediaPlayerElement drops its reference to MediaPlayer.
                mediaPlayerElement.SetMediaPlayer(null);

                // Finally the app can also explicitly clean up the MediaPlayer.
                mp.Dispose();
            }
        }

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario1_SimplestAdaptiveStreaming.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Single Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Single
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Single Class Reference

List of all members.

Public Member Functions

Scenario1_Single ()

Private Member Functions

void | ClearOutputs ()
async void | PickContactEmail ()
async void | PickContactPhone ()
void | ReportContactResult (Contact contact)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_Single.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Single ( ) [inline]

Definition at line 28 of file Scenario1_Single.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearOutputs ( ) [inline, private]

Definition at line 33 of file Scenario1_Single.xaml.cs.

        {
            // Reset the output fields.
            OutputText.Text = "";
            rootPage.NotifyUser("", NotifyType.StatusMessage);
        }

void PickContactEmail ( ) [inline, private]

Definition at line 52 of file Scenario1_Single.xaml.cs.

        {
            ClearOutputs();

            // Ask the user to pick a contact email address.
            var contactPicker = new ContactPicker();
            contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.Email);

            Contact contact = await contactPicker.PickContactAsync();

            ReportContactResult(contact);
        }

void PickContactPhone ( ) [inline, private]

Definition at line 65 of file Scenario1_Single.xaml.cs.

        {
            ClearOutputs();

            // Ask the user to pick a contact phone number.
            var contactPicker = new ContactPicker();
            contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);

            Contact contact = await contactPicker.PickContactAsync();

            ReportContactResult(contact);
        }

void ReportContactResult ( Contact contact ) [inline, private]

Definition at line 40 of file Scenario1_Single.xaml.cs.

        {
            if (contact != null)
            {
                OutputText.Text = MainPage.GetContactResult(contact);
            }
            else
            {
                rootPage.NotifyUser("No contact was selected.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario1_Single.xaml.cs.

The documentation for this class was generated from the following files:
  • ContactPicker/cs/Scenario1_Single.xaml.cs
  • ContactPicker/cpp/Scenario1_Single.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SingleFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SingleFile
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_SingleFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_SingleFile ()

Private Member Functions

async void PickAFileButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_SingleFile.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SingleFile ( ) [inline]

Definition at line 28 of file Scenario1_SingleFile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickAFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 33 of file Scenario1_SingleFile.xaml.cs.

        {
            // Clear previous returned file name, if it exists, between iterations of this scenario
            OutputTextBlock.Text = "";

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            openPicker.FileTypeFilter.Add(".jpg");
            openPicker.FileTypeFilter.Add(".jpeg");
            openPicker.FileTypeFilter.Add(".png");
            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                // The StorageFile has read/write access to the picked file.
                // See the FileAccess sample for code that uses a StorageFile to read and write.
                OutputTextBlock.Text = "Picked photo: " + file.Name;
            }
            else
            {
                OutputTextBlock.Text = "Operation cancelled.";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario1_SingleFile.xaml.cs.

The documentation for this class was generated from the following files:
  • FilePicker/cs/Scenario1_SingleFile.xaml.cs
  • FilePicker/cpp/Scenario1_SingleFile.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SpellingTextSuggestions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_SpellingTextSuggestions
Public Member Functions

Scenario1_SpellingTextSuggestions Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_SpellingTextSuggestions ()

Detailed Description

Definition at line 24 of file Scenario1_SpellingTextSuggestions.xaml.cs.

Constructor & Destructor Documentation

Scenario1_SpellingTextSuggestions ( ) [inline]

Definition at line 26 of file Scenario1_SpellingTextSuggestions.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following files:
  • TouchKeyboardTextInput/cs/Scenario1_SpellingTextSuggestions.xaml.cs
  • TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Toggle Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Toggle
Public Member Functions | Protected Member Functions | Private Attributes

Scenario1_Toggle Class Reference

List of all members.

Public Member Functions

Scenario1_Toggle ()

Protected Member Functions

override async void OnNavigatedTo (NavigationEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario1_Toggle.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Toggle ( ) [inline]

Definition at line 24 of file Scenario1_Toggle.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario1_Toggle.xaml.cs.

        {
            // RequestAccessAsync must be called at least once from the UI thread
            var accessLevel = await Radio.RequestAccessAsync();
            if (accessLevel != RadioAccessStatus.Allowed)
            {
                rootPage.NotifyUser("App is not allowed to control radios.", NotifyType.ErrorMessage);
            }
            else
            {
                // An alternative to Radio.GetRadiosAsync is to use the Windows.Devices.Enumeration pattern,
                // passing Radio.GetDeviceSelector as the AQS string
                foreach (var radio in await Radio.GetRadiosAsync())
                {
                    RadioSwitchList.Items.Add(new RadioModel(radio, this.Dispatcher));
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario1_Toggle.xaml.cs.

The documentation for this class was generated from the following file:
  • RadioManager/cs/Scenario1_Toggle.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackInWebcam Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_TrackInWebcam
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario1_TrackInWebcam Class Reference

Page for demonstrating FaceTracking.

List of all members.

Public Member Functions

Scenario1_TrackInWebcam ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | ScenarioState { Idle, Streaming }

Private Member Functions

void | AbandonStreaming ()
async void | CameraStreamingButton_Click (object sender, RoutedEventArgs e)
async Task | ChangeScenarioStateAsync (ScenarioState newState)
void | MediaCapture_CameraStreamFailed (MediaCapture sender, object args)
async void | OnSuspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
async void | ProcessCurrentVideoFrame (ThreadPoolTimer timer)
async Task | ProcessCurrentVideoFrameAsync ()
void | SetupVisualization (Windows.Foundation.Size framePixelSize, IList< DetectedFace > foundFaces)
async Task | ShutdownWebcamAsync ()
async Task< bool > | StartWebcamStreamingAsync ()

Private Attributes

int | busy = 0
ScenarioState | currentState = ScenarioState.Idle
FaceTracker | faceTracker
ThreadPoolTimer | frameProcessingTimer
MediaCapture | mediaCapture
MainPage rootPage = MainPage.Current
VideoEncodingProperties | videoProperties

Detailed Description

Definition at line 35 of file Scenario1_TrackInWebcam.xaml.cs.

Member Enumeration Documentation

enum ScenarioState [private]

Values for identifying and controlling scenario states.

Enumerator:
Idle

Display is blank - default state.

Streaming

Webcam is actively engaged and a live video stream is displayed.

Definition at line 83 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            /// <summary>
            /// Display is blank - default state.
            /// </summary>
            Idle,

            /// <summary>
            /// Webcam is actively engaged and a live video stream is displayed.
            /// </summary>
            Streaming
        }

Constructor & Destructor Documentation

Scenario1_TrackInWebcam ( ) [inline]

Initializes a new instance of the Scenario1_TrackInWebcam class.

Definition at line 75 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AbandonStreaming ( ) [inline, private]

Definition at line 364 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
            // and instead need to schedule the state change on the UI thread.
            var ignored = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                await ChangeScenarioStateAsync(ScenarioState.Idle);
            });
        }

async void CameraStreamingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles "streaming" button clicks to start/stop webcam streaming.

Parameters:
sender | Button user clicked
e | Event data

Definition at line 389 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            if (this.currentState == ScenarioState.Streaming)
            {
                this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
                await this.ChangeScenarioStateAsync(ScenarioState.Idle);
            }
            else
            {
                this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
                await this.ChangeScenarioStateAsync(ScenarioState.Streaming);
            }
        }

async Task ChangeScenarioStateAsync ( ScenarioState newState ) [inline, private]

Manages the scenario's internal state.

Invokes the internal methods and updates the UI according to the passed in state value. Handles failures and resets the state if necessary.

Parameters:
newState State to switch to

Definition at line 332 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            // Disable UI while state change is in progress
            this.CameraStreamingButton.IsEnabled = false;

            switch (newState)
            {
                case ScenarioState.Idle:

                    this.currentState = newState;
                    await this.ShutdownWebcamAsync();

                    this.VisualizationCanvas.Children.Clear();
                    this.CameraStreamingButton.Content = "Start Streaming";
                    break;

                case ScenarioState.Streaming:

                    if (!await this.StartWebcamStreamingAsync())
                    {
                        await this.ChangeScenarioStateAsync(ScenarioState.Idle);
                        break;
                    }

                    this.VisualizationCanvas.Children.Clear();
                    this.CameraStreamingButton.Content = "Stop Streaming";
                    this.currentState = newState;
                    this.CameraStreamingButton.IsEnabled = true;
                    break;
            }
        }

void MediaCapture_CameraStreamFailed | ( | MediaCapture | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Handles MediaCapture stream failures by shutting down streaming and returning to Idle state.

Parameters:
sender | The source of the event, i.e. our MediaCapture object
args | Event data

Definition at line 379 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            AbandonStreaming();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Responds when we navigate away from this page.

Parameters:
e Event data

Definition at line 109 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            App.Current.Suspending -= this.OnSuspending;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Responds when we navigate to this page.

Parameters:
e Event data

Definition at line 100 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            App.Current.Suspending += this.OnSuspending;
        }

async void OnSuspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Responds to App Suspend event to stop/release MediaCapture object if it's running and return to Idle state.

Parameters:
sender | The source of the Suspending event
e | Event data

Definition at line 119 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            if (this.currentState == ScenarioState.Streaming)
            {
                var deferral = e.SuspendingOperation.GetDeferral();
                try
                {
                    await this.ChangeScenarioStateAsync(ScenarioState.Idle);
                }
                finally
                {
                    deferral.Complete();
                }
            }
        }

async void ProcessCurrentVideoFrame ( ThreadPoolTimer timer ) [inline, private]

This method is invoked by a ThreadPoolTimer to execute the FaceTracker and Visualization logic.

Parameters:
timer Timer object invoking this call

Definition at line 221 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            if (this.currentState != ScenarioState.Streaming)
            {
                return;
            }

            // If busy is already 1, then the previous frame is still being processed,
            // in which case we skip the current frame.
            if (Interlocked.CompareExchange(ref busy, 1, 0) != 0)
            {
                return;
            }

            await ProcessCurrentVideoFrameAsync();
            Interlocked.Exchange(ref busy, 0);
        }

async Task ProcessCurrentVideoFrameAsync ( ) [inline, private]

This method is called to execute the FaceTracker and Visualization logic at each timer tick.

Keep in mind this method is called from a Timer and not synchronized with the camera stream. Also, the processing time of FaceTracker will vary depending on the size of each frame and the number of faces being tracked. That is, a large image with several tracked faces may take longer to process.

Definition at line 247 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
            // GetPreviewFrame will convert the native webcam frame into this format.
            const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
            using (VideoFrame previewFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width, (int)this.videoProperties.Height))
            {
                try
                {
                    await this.mediaCapture.GetPreviewFrameAsync(previewFrame);
                }
                catch (UnauthorizedAccessException)
                {
                    // Lost access to the camera.
                    AbandonStreaming();
                    return;
                }
                catch (Exception)
                {
                    this.rootPage.NotifyUser($"PreviewFrame with format '{InputPixelFormat}' is not supported by your Webcam", NotifyType.ErrorMessage);
                    return;
                }

                // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
                if (!FaceDetector.IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap.BitmapPixelFormat))
                {
                    this.rootPage.NotifyUser($"PixelFormat '{previewFrame.SoftwareBitmap.BitmapPixelFormat}' is not supported by FaceDetector", NotifyType.ErrorMessage);
                    return;
                }

                IList<DetectedFace> faces;
                try
                {
                    faces = await this.faceTracker.ProcessNextFrameAsync(previewFrame);
                }
                catch (Exception ex)
                {
                    this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                    return;
                }

                // Create our visualization using the frame dimensions and face results but run it on the UI thread.
                var previewFrameSize = new Windows.Foundation.Size(previewFrame.SoftwareBitmap.PixelWidth, previewFrame.SoftwareBitmap.PixelHeight);
                var ignored = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    this.SetupVisualization(previewFrameSize, faces);
                });
            }
        }

void SetupVisualization | ( | Windows.Foundation.Size | framePixelSize,
 |  | IList< DetectedFace > | foundFaces |
 | ) |  |  | [inline, private]

Takes the webcam image and FaceTracker results and assembles the visualization onto the Canvas.

Parameters:
framePizelSize | Width and height (in pixels) of the video capture frame
foundFaces | List of detected faces; output from FaceTracker

Definition at line 302 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            this.VisualizationCanvas.Children.Clear();

            if (this.currentState == ScenarioState.Streaming && framePixelSize.Width != 0.0 && framePixelSize.Height != 0.0)
            {
                double widthScale = this.VisualizationCanvas.ActualWidth / framePixelSize.Width;
                double heightScale = this.VisualizationCanvas.ActualHeight / framePixelSize.Height;

                foreach (DetectedFace face in foundFaces)
                {
                    // Create a rectangle element for displaying the face box but since we're using a Canvas
                    // we must scale the rectangles according to the frames's actual size.
                    Rectangle box = new Rectangle()
                    {
                        Width = face.FaceBox.Width * widthScale,
                        Height = face.FaceBox.Height * heightScale,
                        Margin = new Thickness(face.FaceBox.X * widthScale, face.FaceBox.Y * heightScale, 0, 0),
                        Style = HighlightedFaceBoxStyle
                    };
                    this.VisualizationCanvas.Children.Add(box);
                }
            }
        }

async Task ShutdownWebcamAsync ( ) [inline, private]

Safely stops webcam streaming (if running) and releases MediaCapture object.

Definition at line 188 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            if(this.frameProcessingTimer != null)
            {
                this.frameProcessingTimer.Cancel();
            }

            if (this.mediaCapture != null)
            {
                if (this.mediaCapture.CameraStreamState == Windows.Media.Devices.CameraStreamState.Streaming)
                {
                    try
                    {
                        await this.mediaCapture.StopPreviewAsync();
                    }
                    catch(Exception)
                    {
                        ;   // Since we're going to destroy the MediaCapture object there's nothing to do here
                    }
                }
                this.mediaCapture.Dispose();
            }

            this.frameProcessingTimer = null;
            this.CamPreview.Source = null;
            this.mediaCapture = null;
            this.CameraStreamingButton.IsEnabled = true;
        }

async Task<bool> StartWebcamStreamingAsync ( ) [inline, private]

Creates the FaceTracker object which we will use for face detection and tracking.

Initializes a new MediaCapture instance and starts the Preview streaming to the CamPreview UI element.

Returns:
Async Task object returning true if initialization and streaming were successful and false if an exception occurred.

Definition at line 140 of file Scenario1_TrackInWebcam.xaml.cs.

        {
            bool successful = false;

            faceTracker = await FaceTracker.CreateAsync();

            try
            {
                this.mediaCapture = new MediaCapture();

                // For this scenario, we only need Video (not microphone) so specify this in the initializer.
                // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
                // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
                MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
                settings.StreamingCaptureMode = StreamingCaptureMode.Video;
                await this.mediaCapture.InitializeAsync(settings);
                this.mediaCapture.Failed += this.MediaCapture_CameraStreamFailed;

                // Cache the media properties as we'll need them later.
                var deviceController = this.mediaCapture.VideoDeviceController;
                this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;

                // Immediately start streaming to our CaptureElement UI.
                // NOTE: CaptureElement's Source must be set before streaming is started.
                this.CamPreview.Source = this.mediaCapture;
                await this.mediaCapture.StartPreviewAsync();

                // Run the timer at 66ms, which is approximately 15 frames per second.
                TimeSpan timerInterval = TimeSpan.FromMilliseconds(66);
                this.frameProcessingTimer = ThreadPoolTimer.CreatePeriodicTimer(ProcessCurrentVideoFrame, timerInterval);
                successful = true;
            }
            catch (System.UnauthorizedAccessException)
            {
                // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
                this.rootPage.NotifyUser("Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType.ErrorMessage);
            }
            catch (Exception ex)
            {
                this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }

            return successful;
        }

Member Data Documentation

int busy = 0 [private]

Flag to ensure FaceTracking logic only executes one at a time.

Definition at line 70 of file Scenario1_TrackInWebcam.xaml.cs.

ScenarioState currentState = ScenarioState.Idle [private]

Holds the current scenario state value.

Definition at line 45 of file Scenario1_TrackInWebcam.xaml.cs.

FaceTracker faceTracker [private]

References a FaceTracker instance.

Definition at line 60 of file Scenario1_TrackInWebcam.xaml.cs.

ThreadPoolTimer frameProcessingTimer [private]

A periodic timer to execute FaceTracker on preview frames.

Definition at line 65 of file Scenario1_TrackInWebcam.xaml.cs.

MediaCapture mediaCapture [private]

References a MediaCapture instance; is null when not in Streaming state.

Definition at line 50 of file Scenario1_TrackInWebcam.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Reference back to the "root" page of the app.

Definition at line 40 of file Scenario1_TrackInWebcam.xaml.cs.

VideoEncodingProperties videoProperties [private]

Cache of properties from the current MediaCapture device which is used for capturing the preview frame.

Definition at line 55 of file Scenario1_TrackInWebcam.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicFaceTracking/cs/Scenario1_TrackInWebcam.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackPosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_TrackPosition
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_TrackPosition Class Reference

List of all members.

Public Member Functions

Scenario1_TrackPosition ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | OnPositionChanged (Geolocator sender, PositionChangedEventArgs e)
async void | OnStatusChanged (Geolocator sender, StatusChangedEventArgs e)
async void | StartTracking (object sender, RoutedEventArgs e)
void | StopTracking (object sender, RoutedEventArgs e)
void | UpdateLocationData (Geoposition position)

Private Attributes

Geolocator | _geolocator = null
MainPage _rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario1_TrackPosition.xaml.cs.

Constructor & Destructor Documentation

Scenario1_TrackPosition ( ) [inline]

Definition at line 30 of file Scenario1_TrackPosition.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario1_TrackPosition.xaml.cs.

        {
            if (_geolocator != null)
            {
                _geolocator.PositionChanged -= OnPositionChanged;
                _geolocator.StatusChanged -= OnStatusChanged;
            }
        }

async void OnPositionChanged | ( | Geolocator | sender,
 |  | PositionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for PositionChanged events.

It is raised when a location is available for the tracking session specified.

Parameters:
sender | Geolocator instance
e | Position data

Definition at line 114 of file Scenario1_TrackPosition.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _rootPage.NotifyUser("Location updated.", NotifyType.StatusMessage);
                UpdateLocationData(e.Position);
            });
        }

async void OnStatusChanged | ( | Geolocator | sender,
 |  | StatusChangedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for StatusChanged events.

It is raised when the location status in the system changes.

Parameters:
sender | Geolocator instance
e | Statu data

Definition at line 129 of file Scenario1_TrackPosition.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Show the location setting message only if status is disabled.
                LocationDisabledMessage.Visibility = Visibility.Collapsed;

                switch (e.Status)
                {
                    case PositionStatus.Ready:
                        // Location platform is providing valid data.
                        ScenarioOutput_Status.Text = "Ready";
                        _rootPage.NotifyUser("Location platform is ready.", NotifyType.StatusMessage);
                        break;

                    case PositionStatus.Initializing:
                        // Location platform is attempting to acquire a fix.
                        ScenarioOutput_Status.Text = "Initializing";
                        _rootPage.NotifyUser("Location platform is attempting to obtain a position.", NotifyType.StatusMessage);
                        break;

                    case PositionStatus.NoData:
                        // Location platform could not obtain location data.
                        ScenarioOutput_Status.Text = "No data";
                        _rootPage.NotifyUser("Not able to determine the location.", NotifyType.ErrorMessage);
                        break;

                    case PositionStatus.Disabled:
                        // The permission to access location data is denied by the user or other policies.
                        ScenarioOutput_Status.Text = "Disabled";
                        _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);

                        // Show message to the user to go to location settings
                        LocationDisabledMessage.Visibility = Visibility.Visible;

                        // Clear cached location data if any
                        UpdateLocationData(null);
                        break;

                    case PositionStatus.NotInitialized:
                        // The location platform is not initialized. This indicates that the application
                        // has not made a request for location data.
                        ScenarioOutput_Status.Text = "Not initialized";
                        _rootPage.NotifyUser("No request for location is made yet.", NotifyType.StatusMessage);
                        break;

                    case PositionStatus.NotAvailable:
                        // The location platform is not available on this version of the OS.
                        ScenarioOutput_Status.Text = "Not available";
                        _rootPage.NotifyUser("Location is not available on this version of the OS.", NotifyType.ErrorMessage);
                        break;

                    default:
                        ScenarioOutput_Status.Text = "Unknown";
                        _rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
                        break;
                }
            });
        }

async void StartTracking | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StartTracking' button.

Parameters:
sender
e

Definition at line 49 of file Scenario1_TrackPosition.xaml.cs.

        {
            // Request permission to access location
            var accessStatus = await Geolocator.RequestAccessAsync();

            switch (accessStatus)
            {
                case GeolocationAccessStatus.Allowed:
                    // You should set MovementThreshold for distance-based tracking
                    // or ReportInterval for periodic-based tracking before adding event
                    // handlers. If none is set, a ReportInterval of 1 second is used
                    // as a default and a position will be returned every 1 second.
                    //
                    // Value of 2000 milliseconds (2 seconds)
                    // isn't a requirement, it is just an example.
                    _geolocator = new Geolocator { ReportInterval = 2000 };

                    // Subscribe to PositionChanged event to get updated tracking positions
                    _geolocator.PositionChanged += OnPositionChanged;

                    // Subscribe to StatusChanged event to get updates of location status changes
                    _geolocator.StatusChanged += OnStatusChanged;

                    _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);
                    LocationDisabledMessage.Visibility = Visibility.Collapsed;
                    StartTrackingButton.IsEnabled = false;
                    StopTrackingButton.IsEnabled = true;
                    break;

                case GeolocationAccessStatus.Denied:
                    _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                    LocationDisabledMessage.Visibility = Visibility.Visible;
                    break;

                case GeolocationAccessStatus.Unspecified:
                    _rootPage.NotifyUser("Unspecificed error!", NotifyType.ErrorMessage);
                    LocationDisabledMessage.Visibility = Visibility.Collapsed;
                    break;
            }
        }

void StopTracking | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StopTracking' button.

Parameters:
sender
e

Definition at line 95 of file Scenario1_TrackPosition.xaml.cs.

        {
            _geolocator.PositionChanged -= OnPositionChanged;
            _geolocator.StatusChanged -= OnStatusChanged;
            _geolocator = null;

            StartTrackingButton.IsEnabled = true;
            StopTrackingButton.IsEnabled = false;

            // Clear status
            _rootPage.NotifyUser("", NotifyType.StatusMessage);
        }

void UpdateLocationData ( Geoposition position ) [inline, private]

Updates the user interface with the Geoposition data provided.

Parameters:
position Geoposition to display its details

Definition at line 193 of file Scenario1_TrackPosition.xaml.cs.

        {
            if (position == null)
            {
                ScenarioOutput_Latitude.Text = "No data";
                ScenarioOutput_Longitude.Text = "No data";
                ScenarioOutput_Accuracy.Text = "No data";
                ScenarioOutput_Source.Text = "No data";
                ScenarioOutput_IsRemoteSource.Text = "No data";
            }
            else
            {
                ScenarioOutput_Latitude.Text = position.Coordinate.Point.Position.Latitude.ToString();
                ScenarioOutput_Longitude.Text = position.Coordinate.Point.Position.Longitude.ToString();
                ScenarioOutput_Accuracy.Text = position.Coordinate.Accuracy.ToString();
                ScenarioOutput_Source.Text = position.Coordinate.PositionSource.ToString();
                ScenarioOutput_IsRemoteSource.Text = position.Coordinate.IsRemoteSource.ToString();
            }
        }

Member Data Documentation

Geolocator _geolocator = null [private]

Definition at line 25 of file Scenario1_TrackPosition.xaml.cs.

MainPage _rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_TrackPosition.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario1_TrackPosition.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrialMode Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_TrialMode
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_TrialMode Class Reference

List of all members.

Public Member Functions

Scenario1_TrialMode ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async Task | GetLicenseState ()
void | OfflineLicensesChanged (StoreContext sender, object args)
async void | PurchaseFullLicense ()
async void | ShowTrialPeriodInformation ()

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = null

Detailed Description

Definition at line 21 of file Scenario1_TrialMode.xaml.cs.

Constructor & Destructor Documentation

Scenario1_TrialMode ( ) [inline]

Definition at line 26 of file Scenario1_TrialMode.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void GetLicenseState ( ) [inline, private]

Definition at line 58 of file Scenario1_TrialMode.xaml.cs.

        {
            StoreAppLicense license = await storeContext.GetAppLicenseAsync();

            if (license.IsActive)
            {
                if (license.IsTrial)
                {
                    LicenseMode.Text = "Trial license";
                }
                else
                {
                    LicenseMode.Text = "Full license";
                }
            }
            else
            {
                LicenseMode.Text = "Inactive license";
            }
        }

void OfflineLicensesChanged | ( | StoreContext | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario1_TrialMode.xaml.cs.

        {
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                await GetLicenseState();
            });
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario1_TrialMode.xaml.cs.

        {
            storeContext = StoreContext.GetDefault();
            storeContext.OfflineLicensesChanged += OfflineLicensesChanged;

            StoreProductResult result = await storeContext.GetStoreProductForCurrentAppAsync();
            if (result.ExtendedError == null)
            {
                PurchasePrice.Text = result.Product.Price.FormattedPrice;
            }

            await GetLicenseState();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario1_TrialMode.xaml.cs.

        {
            storeContext.OfflineLicensesChanged -= OfflineLicensesChanged;
        }

void PurchaseFullLicense ( ) [inline, private]

Invoked when the user asks purchase the app.

Definition at line 106 of file Scenario1_TrialMode.xaml.cs.

        {
            // Get app store product details
            StoreProductResult productResult = await storeContext.GetStoreProductForCurrentAppAsync();
            if (productResult.ExtendedError != null)
            {
                // The user may be offline or there might be some other server failure
                rootPage.NotifyUser($"ExtendedError: {productResult.ExtendedError.Message}", NotifyType.ErrorMessage);
                return;
            }

            rootPage.NotifyUser("Buying the full license...", NotifyType.StatusMessage);
            StoreAppLicense license = await storeContext.GetAppLicenseAsync();
            if (license.IsTrial)
            {
                StorePurchaseResult result = await productResult.Product.RequestPurchaseAsync();
                if (result.ExtendedError != null)
                {
                    rootPage.NotifyUser($"Purchase failed: ExtendedError: {result.ExtendedError.Message}", NotifyType.ErrorMessage);
                    return;
                }

                switch (result.Status)
                {
                    case StorePurchaseStatus.AlreadyPurchased:
                        rootPage.NotifyUser($"You already bought this app and have a fully-licensed version.", NotifyType.ErrorMessage);
                        break;

                    case StorePurchaseStatus.Succeeded:
                        // License will refresh automatically using the StoreContext.OfflineLicensesChanged event
                        break;

                    case StorePurchaseStatus.NotPurchased:
                        rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
                        break;

                    case StorePurchaseStatus.NetworkError:
                        rootPage.NotifyUser("Product was not purchased due to a Network Error.", NotifyType.ErrorMessage);
                        break;

                    case StorePurchaseStatus.ServerError:
                        rootPage.NotifyUser("Product was not purchased due to a Server Error.", NotifyType.ErrorMessage);
                        break;

                    default:
                        rootPage.NotifyUser("Product was not purchased due to an Unknown Error.", NotifyType.ErrorMessage);
                        break;
                }
            }
            else
            {
                rootPage.NotifyUser("You already bought this app and have a fully-licensed version.", NotifyType.ErrorMessage);
            }
        }

void ShowTrialPeriodInformation ( ) [inline, private]

Invoked when the user asks to see trial period information.

Definition at line 82 of file Scenario1_TrialMode.xaml.cs.

        {
            StoreAppLicense license = await storeContext.GetAppLicenseAsync();
            if (license.IsActive)
            {
                if (license.IsTrial)
                {
                    int remainingTrialTime = (license.ExpirationDate - DateTime.Now).Days;
                    rootPage.NotifyUser($"You can use this app for {remainingTrialTime} more days before the trial period ends.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("You have a full license. The trial time is not meaningful.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("You don't have a license. The trial time can't be determined.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario1_TrialMode.xaml.cs.

StoreContext storeContext = null [private]

Definition at line 24 of file Scenario1_TrialMode.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario1_TrialMode.xaml.cs
  • Store/cpp/Scenario1_TrialMode.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UIFonts Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_UIFonts
Public Member Functions | Private Member Functions

Scenario1_UIFonts Class Reference

List of all members.

Public Member Functions

Scenario1_UIFonts ()

Private Member Functions

void ApplyFonts_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_UIFonts.xaml.cs.

Constructor & Destructor Documentation

Scenario1_UIFonts ( ) [inline]

Definition at line 21 of file Scenario1_UIFonts.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ApplyFonts_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario1_UIFonts.xaml.cs.

        {
            var languageFontGroup = new LanguageFontGroup("ja-JP");

            // Change the Font value with selected font from LanguageFontGroup API
            MainPage.ApplyLanguageFont(HeadingTextBlock, languageFontGroup.UIHeadingFont);
            MainPage.ApplyLanguageFont(BodyTextBlock, languageFontGroup.UITextFont);
        }

The documentation for this class was generated from the following file:
  • LanguageFont/cs/Scenario1_UIFonts.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UTF8 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_UTF8
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_UTF8 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1_UTF8 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | AppendOutputLine (string value)
void | CloseSocket ()
async Task | ConnectAsync ()
void | MessageReceived (MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
async void | OnClosed (IWebSocket sender, WebSocketClosedEventArgs args)
async void | OnConnect (object sender, RoutedEventArgs args)
void | OnDisconnect (object sender, RoutedEventArgs args)
async void | OnSend (object sender, RoutedEventArgs args)
async void | OnServerCustomValidationRequested (MessageWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args)
async Task | SendAsync ()
void | SetBusy (bool value)
void | UpdateVisualState ()

Private Attributes

bool | busy
MessageWebSocket | messageWebSocket
DataWriter | messageWriter
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario1_UTF8.xaml.cs.

Constructor & Destructor Documentation

Scenario1_UTF8 ( ) [inline]

Definition at line 38 of file Scenario1_UTF8.xaml.cs.

        {
            this.InitializeComponent();
            UpdateVisualState();
        }

Member Function Documentation

void AppendOutputLine ( string value ) [inline, private]

Definition at line 292 of file Scenario1_UTF8.xaml.cs.

        {
            OutputField.Text += value + "\r\n";
        }

void CloseSocket ( ) [inline, private]

Definition at line 263 of file Scenario1_UTF8.xaml.cs.

        {
            if (messageWriter != null)
            {
                // In order to reuse the socket with another DataWriter, the socket's output stream needs to be detached.
                // Otherwise, the DataWriter's destructor will automatically close the stream and all subsequent I/O operations
                // invoked on the socket's output stream will fail with ObjectDisposedException.
                //
                // This is only added for completeness, as this sample closes the socket in the very next code block.
                messageWriter.DetachStream();
                messageWriter.Dispose();
                messageWriter = null;
            }

            if (messageWebSocket != null)
            {
                try
                {
                    messageWebSocket.Close(1000, "Closed due to user request.");
                }
                catch (Exception ex)
                {
                    AppendOutputLine(MainPage.BuildWebSocketError(ex));
                    AppendOutputLine(ex.Message);
                }
                messageWebSocket = null;
            }
        }

async Task ConnectAsync ( ) [inline, private]

Definition at line 75 of file Scenario1_UTF8.xaml.cs.

        {
            if (String.IsNullOrEmpty(InputField.Text))
            {
                rootPage.NotifyUser("Please specify text to send", NotifyType.ErrorMessage);
                return;
            }

            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling TryGetUri() that will return null for strings that are not
            // valid WebSocket URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet
            // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
            // "Internet (Client)" capability respectively.
            Uri server = rootPage.TryGetUri(ServerAddressField.Text);
            if (server == null)
            {
                return;
            }

            messageWebSocket = new MessageWebSocket();
            messageWebSocket.Control.MessageType = SocketMessageType.Utf8;
            messageWebSocket.MessageReceived += MessageReceived;
            messageWebSocket.Closed += OnClosed;

            // If we are connecting to wss:// endpoint, by default, the OS performs validation of
            // the server certificate based on well-known trusted CAs. We can perform additional custom
            // validation if needed.
            if (SecureWebSocketCheckBox.IsChecked == true)
            {
                // WARNING: Only test applications should ignore SSL errors.
                // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
                // attacks. (Although the connection is secure, the server is not authenticated.)
                // Note that not all certificate validation errors can be ignored.
                // In this case, we are ignoring these errors since the certificate assigned to the localhost
                // URI is self-signed and has subject name = fabrikam.com
                messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
                messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);

                // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
                // custom validation of the server certificate. The event handler must implement the desired
                // custom certificate validation logic.
                messageWebSocket.ServerCustomValidationRequested += OnServerCustomValidationRequested;

                // Certificate validation occurs only for secure connections.
                if (server.Scheme != "wss")
                {
                    AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
                }
            }

            AppendOutputLine($"Connecting to {server}...");
            try
            {
                await messageWebSocket.ConnectAsync(server);
            }
            catch (Exception ex) // For debugging
            {
                // Error happened during connect operation.
                messageWebSocket.Dispose();
                messageWebSocket = null;

                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }

            // The default DataWriter encoding is Utf8.
            messageWriter = new DataWriter(messageWebSocket.OutputStream);
            rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
        }

void MessageReceived | ( | MessageWebSocket | sender,
 |  | MessageWebSocketMessageReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 214 of file Scenario1_UTF8.xaml.cs.

        {
            // Dispatch the event to the UI thread so we can update UI.
            var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Message Received; Type: " + args.MessageType);
                using (DataReader reader = args.GetDataReader())
                {
                    reader.UnicodeEncoding = UnicodeEncoding.Utf8;

                    try
                    {
                        string read = reader.ReadString(reader.UnconsumedBufferLength);
                        AppendOutputLine(read);
                    }
                    catch (Exception ex)
                    {
                        AppendOutputLine(MainPage.BuildWebSocketError(ex));
                        AppendOutputLine(ex.Message);
                    }
                }
            });
        }

async void OnClosed | ( | IWebSocket | sender,
 |  | WebSocketClosedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 248 of file Scenario1_UTF8.xaml.cs.

        {
            // Dispatch the event to the UI thread so we do not need to synchronize access to messageWebSocket.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

                if (messageWebSocket == sender)
                {
                    CloseSocket();
                    UpdateVisualState();
                }
            });
        }

async void OnConnect | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario1_UTF8.xaml.cs.

        {
            SetBusy(true);
            await ConnectAsync();
            SetBusy(false);
        }

void OnDisconnect | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 238 of file Scenario1_UTF8.xaml.cs.

        {
            SetBusy(true);
            rootPage.NotifyUser("Closing", NotifyType.StatusMessage);
            CloseSocket();
            SetBusy(false);
            rootPage.NotifyUser("Closed", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario1_UTF8.xaml.cs.

        {
            CloseSocket();
        }

async void OnSend | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 178 of file Scenario1_UTF8.xaml.cs.

        {
            SetBusy(true);
            await SendAsync();
            SetBusy(false);
        }

async void OnServerCustomValidationRequested | ( | MessageWebSocket | sender,
 |  | WebSocketServerCustomValidationRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario1_UTF8.xaml.cs.

        {
            // In order to call async APIs in this handler, you must first take a deferral and then
            // release it once you are done with the operation. The "using" statement
            // ensures that the deferral completes when control leaves the block.
            bool isValid;
            using (Deferral deferral = args.GetDeferral())
            {
                // Get the server certificate and certificate chain from the args parameter.
                isValid = await MainPage.AreCertificateAndCertChainValidAsync(args.ServerCertificate, args.ServerIntermediateCertificates);

                if (!isValid)
                {
                    args.Reject();
                }
            }

            // Continue on the UI thread so we can update UI.
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (isValid)
                {
                    AppendOutputLine("Custom validation of server certificate passed.");
                }
                else
                {
                    AppendOutputLine("Custom validation of server certificate failed.");
                }
            });
        }

async Task SendAsync ( ) [inline, private]

Definition at line 185 of file Scenario1_UTF8.xaml.cs.

        {
            string message = InputField.Text;
            if (String.IsNullOrEmpty(message))
            {
                rootPage.NotifyUser("Please specify text to send", NotifyType.ErrorMessage);
                return;
            }

            AppendOutputLine("Sending Message: " + message);

            // Buffer any data we want to send.
            messageWriter.WriteString(message);

            try
            {
                // Send the data as one complete message.
                await messageWriter.StoreAsync();
            }
            catch (Exception ex)
            {
                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }

            rootPage.NotifyUser("Send Complete", NotifyType.StatusMessage);
        }

void SetBusy ( bool value ) [inline, private]

Definition at line 62 of file Scenario1_UTF8.xaml.cs.

        {
            busy = value;
            UpdateVisualState();
        }

void UpdateVisualState ( ) [inline, private]

Definition at line 49 of file Scenario1_UTF8.xaml.cs.

        {
            if (busy)
            {
                VisualStateManager.GoToState(this, "Busy", false);
            }
            else
            {
                bool connected = (messageWebSocket != null);
                VisualStateManager.GoToState(this, connected ? "Connected" : "Disconnected", false);
            }
        }

Member Data Documentation

bool busy [private]

Definition at line 36 of file Scenario1_UTF8.xaml.cs.

MessageWebSocket messageWebSocket [private]

Definition at line 34 of file Scenario1_UTF8.xaml.cs.

DataWriter messageWriter [private]

Definition at line 35 of file Scenario1_UTF8.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario1_UTF8.xaml.cs.

The documentation for this class was generated from the following file:
  • WebSocket/cs/Scenario1_UTF8.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Welcome Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario1_Welcome
Public Member Functions | Private Attributes

Scenario1_Welcome Class Reference

List of all members.

Public Member Functions

Scenario1_Welcome ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 19 of file Scenario1_Welcome.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Welcome ( ) [inline]

Definition at line 23 of file Scenario1_Welcome.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 21 of file Scenario1_Welcome.xaml.cs.

The documentation for this class was generated from the following file:
  • ShareTarget/cs/Scenario1_Welcome.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
async Task | AddLogFileMessageDispatch (string message, string path)
void | AddMessage (string message)
async Task | AddMessageDispatch (string message)

Public Attributes

List< SampleDataModel > | AllItems = SampleDataModel.GetSampleData()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Properties

internal LoggingSessionScenario | LoggingSessionScenario [get]

Private Member Functions

void | ClearButton_Click (object sender, RoutedEventArgs e)
void | ClearDrawnBoundingRect ()
void | ClearSelection ()
TextBlock | CreateHeaderTextBlock (string contents)
TextBlock | CreateLineItemTextBlock (string contents)
void | CreateOrUpdatePropertyPopUp (Windows.UI.Input.PointerPoint currentPoint)
void | CurrentToolChanged (InkToolbar sender, object args)
void | DeleteMenuItem_Click (object sender, RoutedEventArgs e)
async void | DispatcherTimer_Tick (object sender, object e)
void | DisplayProperties_DpiChanged (DisplayInformation sender, object args)
async void | DoScenario (object sender, RoutedEventArgs e)
void | DrawBoundingRect ()
void | EnableDisableLogging (object sender, RoutedEventArgs e)
string | ExtractTextFromParagraph (InkAnalysisParagraph paragraph)
void | Find_Click (object sender, RoutedEventArgs e)
InkAnalysisParagraph | FindHitParagraph (Point pt)
ScrollViewer | FindScrollViewer (DependencyObject depObject)
SampleDataModel GetDataModelForCurrentListViewFlyout ()
String | GetDeviceSpecificProperties (Windows.UI.Input.PointerPoint currentPoint)
void | GetInstalledLocation_Click (Object sender, RoutedEventArgs e)
String | GetMouseProperties (Windows.UI.Input.PointerPoint currentPoint)
async void | GetParent_Click (object sender, RoutedEventArgs e)
String | GetPenProperties (Windows.UI.Input.PointerPoint currentPoint)
String | GetPointerProperties (Windows.UI.Input.PointerPoint currentPoint)
Rect | GetTextboxSelectionRect (TextBox textbox)
async void | GetThumbnailButton_Click (object sender, RoutedEventArgs e)
String | GetTouchProperties (Windows.UI.Input.PointerPoint currentPoint)
async Task | GroupByHelperAsync (QueryOptions queryOptions)
async void | GroupByMonthButton_Click (object sender, RoutedEventArgs e)
async void | GroupByRatingButton_Click (object sender, RoutedEventArgs e)
async void | GroupByTagButton_Click (object sender, RoutedEventArgs e)
void | HidePropertyPopUp (Windows.UI.Input.PointerPoint currentPoint)
void | InkCanvas_DoubleTapped (object sender, DoubleTappedRoutedEventArgs e)
void | InkCanvas_Tapped (object sender, TappedRoutedEventArgs e)
void | InkPresenter_StrokesCollected (InkPresenter sender, InkStrokesCollectedEventArgs args)
void | InkPresenter_StrokesErased (InkPresenter sender, InkStrokesErasedEventArgs args)
void | InkPresenter_StrokesErased (InkPresenter sender, InkStrokesErasedEventArgs args)
async void | ListFoldersButton_Click (object sender, RoutedEventArgs e)
async void | LoggingSessionScenario_StatusChanged (object sender, LoggingScenarioEventArgs e)
void | mapBillboardAddButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | mapClearButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | mapElement3DAddButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | mapIconAddButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | mapPolygonAddButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | mapPolylineAddButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | OnCopy (object sender, RoutedEventArgs e)
void | OnCut (object sender, RoutedEventArgs e)
void | OnPaste (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | OpenMenuItem_Click (object sender, RoutedEventArgs e)
void | OutputSettings (double rawPixelsPerViewPixel, FrameworkElement rectangle, TextBlock viewPxText, TextBlock rawPxText, TextBlock fontTextBlock)
void | Pointer_Entered (object sender, PointerRoutedEventArgs e)
void | Pointer_Moved (object sender, PointerRoutedEventArgs e)
void | Pointer_Pressed (object sender, PointerRoutedEventArgs e)
void | Pointer_Released (object sender, PointerRoutedEventArgs e)
void | Pointer_Wheel_Changed (object sender, PointerRoutedEventArgs e)
void | PrintMenuItem_Click (object sender, RoutedEventArgs e)
double | PtFromPx (double pixel)
double | PxFromPt (double pt)
async void | ReadOnlyTextBox_ContextMenuOpening (object sender, ContextMenuEventArgs e)
void | RenderPropertyPopUp (String pointerProperties, String deviceSpecificProperties, Windows.UI.Input.PointerPoint currentPoint)
void | ResetOutput ()
void | StrokeInput_StrokeStarted (InkStrokeInput sender, PointerEventArgs args)
void | StrokeInput_StrokeStarted (InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
void | Toggle_Custom (object sender, RoutedEventArgs e)
void | ToolButton_Lasso (object sender, RoutedEventArgs e)
void | UnprocessedInput_PointerMoved (InkUnprocessedInput sender, PointerEventArgs args)
void | UnprocessedInput_PointerPressed (InkUnprocessedInput sender, PointerEventArgs args)
void | UnprocessedInput_PointerReleased (InkUnprocessedInput sender, PointerEventArgs args)
void | UpdateControls ()
void | UpdateHeaderText ()

Private Attributes

Rect | boundingRect
DispatcherTimer | dispatcherTimer
InkAnalyzer | inkAnalyzer
InkPresenter | inkPresenter
bool | isBoundRect
Polyline | lasso
Symbol | LassoSelect = (Symbol)0xEF20
RandomAccessStreamReference | mapBillboardStreamReference
RandomAccessStreamReference | mapIconStreamReference
RandomAccessStreamReference | mapModelStreamReference
MediaPlaybackItemLogger | mpiLogger
MediaSourceLogger | msLogger
InkAnalysisParagraph | paragraphSelected
StorageLibrary | picturesLibrary
Dictionary< uint, StackPanel > | popups
MainPage rootPage = MainPage.Current
Symbol | TouchWriting = (Symbol)0xED5F

Detailed Description

Demonstrates closed captions delivered in-band, specifically SRT in an MKV.

This page shows the code to configure the InkToolbar.

UI for the LoggingSession sample.

This scenario demostrates text recognition with InkAnalyzer.

Getting a file's parent folder.

Definition at line 22 of file scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 28 of file scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 24 of file 2-PointerPointProperties.xaml.cs.

        {
            this.InitializeComponent();

            // Contact tracking for UI popups
            popups = new Dictionary<uint, StackPanel>();

            // Add event handlers
            mainCanvas.PointerPressed += new PointerEventHandler(Pointer_Pressed);
            mainCanvas.PointerMoved += new PointerEventHandler(Pointer_Moved);
            mainCanvas.PointerReleased += new PointerEventHandler(Pointer_Released);
            mainCanvas.PointerExited += new PointerEventHandler(Pointer_Released);
            mainCanvas.PointerEntered += new PointerEventHandler(Pointer_Entered);
            mainCanvas.PointerWheelChanged += new PointerEventHandler(Pointer_Wheel_Changed);
        }

Scenario2 ( ) [inline]

Definition at line 29 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 23 of file Scenario2.xaml.cs.

        {
            InitializeComponent();
            DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
            displayInformation.DpiChanged += DisplayProperties_DpiChanged;
            DefaultLayoutText.FontSize = PxFromPt(20);  // xaml fontsize is in pixels.
        }

Scenario2 ( ) [inline]

Definition at line 29 of file Scenario2_GetParent.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 26 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 25 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 36 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();

            inkPresenter = inkCanvas.InkPresenter;
            inkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
            inkPresenter.StrokesErased += InkPresenter_StrokesErased;
            inkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;

            // We exclude CoreInputDeviceTypes.Touch because we use touch to select paragraphs.
            inkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Mouse;

            inkCanvas.Tapped += InkCanvas_Tapped;
            inkCanvas.DoubleTapped += InkCanvas_DoubleTapped;

            inkAnalyzer = new InkAnalyzer();
            paragraphSelected = null;

            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += DispatcherTimer_Tick;

            // We perform analysis when there has been a change to the
            // ink presenter and the user has been idle for 1 second.
            dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
        }

Scenario2 ( ) [inline]

Definition at line 29 of file S2_ListFolders.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 31 of file Scenario2.xaml.cs.

        {
            // This sample UI is interested in events from
            // the LoggingSessionScenario class so the UI can be updated.
            LoggingSessionScenario.StatusChanged += LoggingSessionScenario_StatusChanged;
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 33 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();

            mapIconStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/MapPin.png"));
            mapBillboardStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/billboard.jpg"));
            mapModelStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/box.3mf"));
        }

Scenario2 ( ) [inline]

Definition at line 29 of file scenario2_installedlocation.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 33 of file FindInProperty.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 63 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
        }

Scenario2 ( ) [inline]

Definition at line 31 of file Scenario2_DisplayingInBandClosedCaptions.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2 ( ) [inline]

Definition at line 29 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task AddLogFileMessageDispatch | ( | string | message,
 |  | string | path |
 | ) |  |  | [inline]

Dispatch to the UI thread and add a message to the UI control which displays status while the sample is running.

Parameters:
message The message to append to the UI log.

Definition at line 106 of file Scenario2.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
            {
                string finalMessage;
                if (path != null && path.Length > 0)
                {
                    var fileName = System.IO.Path.GetFileName(path);
                    var directoryName = System.IO.Path.GetDirectoryName(path);
                    finalMessage = message + ": " + fileName;
                    ViewLogInfo.Text =
                        $"Log folder: \"{directoryName}\"\r\n" +
                        $"- To view with tracerpt: tracerpt.exe \"{path}\" -of XML -o LogFile.xml\r\n" +
                        $"- To view with Windows Performance Toolkit (WPT):\r\n" +
                        $"   xperf -merge \"{path}\" merged.etl\r\n" +
                        $"   wpa.exe merged.etl";
                }
                else
                {
                    finalMessage = string.Format("{0}: none, nothing logged since saving the last file.", message);
                }
                AddMessage(finalMessage);
            }).AsTask();
        }

void AddMessage ( string message ) [inline]

Add a message to the UI control which displays status while the sample is running.

Parameters:
message The message to append to the UI log.

Definition at line 90 of file Scenario2.xaml.cs.

        {
            StatusMessageList.Text += message + "\r\n";
            StatusMessageList.Select(StatusMessageList.Text.Length, 0);

            ScrollViewer svFind = FindScrollViewer(StatusMessageList);
            if (svFind != null)
            {
                svFind.ChangeView(null, StatusMessageList.ActualHeight, null);
            }
        }

async Task AddMessageDispatch ( string message ) [inline]

Dispatch to the UI thread and add a message to the UI log.

Parameters:
message The message to appened to the UI log.
Returns:
The task.

Definition at line 136 of file Scenario2.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
            {
                AddMessage(message);
            }).AsTask();
        }

void ClearButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario2.xaml.cs.

        {
            // Don't run analysis when there is nothing to analyze.
            dispatcherTimer.Stop();

            inkPresenter.StrokeContainer.Clear();
            inkAnalyzer.ClearDataForAllStrokes();
            canvas.Children.Clear();
            canvas.Children.Add(SelectionRect);
            SelectionRect.Visibility = Visibility.Collapsed;
        }

void ClearDrawnBoundingRect ( ) [inline, private]

Definition at line 189 of file Scenario2.xaml.cs.

        {
            if (selectionCanvas.Children.Count > 0)
            {
                selectionCanvas.Children.Clear();
                boundingRect = Rect.Empty;
            }
        }

void ClearSelection ( ) [inline, private]

Definition at line 222 of file Scenario2.xaml.cs.

        {
            var strokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
            foreach (var stroke in strokes)
            {
                stroke.Selected = false;
            }
            ClearDrawnBoundingRect();
        }

TextBlock CreateHeaderTextBlock ( string contents ) [inline, private]

Definition at line 76 of file Scenario2.xaml.cs.

        {
            TextBlock textBlock = new TextBlock();
            textBlock.Text = contents;
            textBlock.Style = (Style)Application.Current.Resources["SampleHeaderTextStyle"];
            textBlock.TextWrapping = TextWrapping.Wrap;
            return textBlock;
        }

TextBlock CreateLineItemTextBlock ( string contents ) [inline, private]

Definition at line 85 of file Scenario2.xaml.cs.

        {
            TextBlock textBlock = new TextBlock();
            textBlock.Text = contents;
            textBlock.Style = (Style)Application.Current.Resources["BasicTextStyle"];
            textBlock.TextWrapping = TextWrapping.Wrap;
            Thickness margin = textBlock.Margin;
            margin.Left = 20;
            textBlock.Margin = margin;
            return textBlock;
        }

void CreateOrUpdatePropertyPopUp ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 96 of file 2-PointerPointProperties.xaml.cs.

        {
            // Retrieve the properties that are common to all pointers
            String pointerProperties = GetPointerProperties(currentPoint);

            // Retrieve the properties that are specific to the device type associated
            // with the current PointerPoint
            String deviceSpecificProperties = GetDeviceSpecificProperties(currentPoint);

            RenderPropertyPopUp(pointerProperties, deviceSpecificProperties, currentPoint);
        }

void CurrentToolChanged | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 232 of file Scenario2.xaml.cs.

        {
            bool enabled = sender.ActiveTool.Equals(toolButtonLasso);

            ButtonCut.IsEnabled = enabled;
            ButtonCopy.IsEnabled = enabled;
            ButtonPaste.IsEnabled = enabled;
        }

void DeleteMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario2.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Delete", NotifyType.StatusMessage);
        }

async void DispatcherTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 90 of file Scenario2.xaml.cs.

        {
            dispatcherTimer.Stop();
            if (!inkAnalyzer.IsAnalyzing)
            {
                var result = await inkAnalyzer.AnalyzeAsync();
            }
            else
            {
                // Ink analyzer is busy. Wait a while and try again.
                dispatcherTimer.Start();
            }
        }

void DisplayProperties_DpiChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario2.xaml.cs.

        {
            ResetOutput();
        }

async void DoScenario | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Run a sample scenario which logs lots of messages to produce several log files.

Parameters:
sender | The sender.
e | The event args.

Definition at line 228 of file Scenario2.xaml.cs.

        {
            DoScenarioButton.IsEnabled = false;
            rootPage.NotifyUser("Scenario running...", NotifyType.StatusMessage);
            await LoggingSessionScenario.DoScenarioAsync();
            rootPage.NotifyUser("Scenario finished.", NotifyType.StatusMessage);
            DoScenarioButton.IsEnabled = true;
        }

void DrawBoundingRect ( ) [inline, private]

Definition at line 154 of file Scenario2.xaml.cs.

        {
            selectionCanvas.Children.Clear();

            if (boundingRect.Width <= 0 || boundingRect.Height <= 0)
            {
                return;
            }

            var rectangle = new Rectangle()
            {
                Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
                StrokeThickness = 1,
                StrokeDashArray = new DoubleCollection() { 5, 2 },
                Width = boundingRect.Width,
                Height = boundingRect.Height
            };

            Canvas.SetLeft(rectangle, boundingRect.X);
            Canvas.SetTop(rectangle, boundingRect.Y);

            selectionCanvas.Children.Add(rectangle);
        }

void EnableDisableLogging | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Enabled/disabled logging.

Parameters:
sender | The sender.
e | The event arguments.

Definition at line 196 of file Scenario2.xaml.cs.

        {
            LoggingSessionScenario loggingSessionScenario = LoggingSessionScenario.Instance;

            if (loggingSessionScenario.IsLoggingEnabled)
            {
                rootPage.NotifyUser("Disabling logging...", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Enabling logging...", NotifyType.StatusMessage);
            }

            LoggingSessionScenario.Instance.ToggleLoggingEnabledDisabled();

            if (loggingSessionScenario.IsLoggingEnabled)
            {
                rootPage.NotifyUser("Logging enabled.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Logging disabled.", NotifyType.StatusMessage);
            }

            UpdateControls();
        }

string ExtractTextFromParagraph ( InkAnalysisParagraph paragraph ) [inline, private]

Definition at line 179 of file Scenario2.xaml.cs.

        {
            // The paragraph.RecognizedText property also returns the text,
            // but manually walking through the lines allows us to preserve
            // line breaks.
            var lines = new List<string>();
            foreach (var child in paragraph.Children)
            {
                if (child.Kind == InkAnalysisNodeKind.Line)
                {
                    var line = (InkAnalysisLine)child;
                    lines.Add(line.RecognizedText);
                }
                else if (child.Kind == InkAnalysisNodeKind.ListItem)
                {
                    var listItem = (InkAnalysisListItem)child;
                    lines.Add(listItem.RecognizedText);
                }
            }
            return String.Join("\n", lines);
        }

void Find_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file FindInProperty.xaml.cs.

        {
            ContentTextOutput.Text = "";
            TitleTextOutput.Text = "";
            var mySemanticTextQuery = new Windows.Data.Text.SemanticTextQuery(FindQueryText.Text);
            IReadOnlyList<Windows.Data.Text.TextSegment> ranges = mySemanticTextQuery.FindInProperty(ContentText.Text, "System.Search.Contents");
            rootPage.HighlightRanges(ContentTextOutput, ContentText.Text, ranges);
            IReadOnlyList<Windows.Data.Text.TextSegment> rangesTitle = mySemanticTextQuery.FindInProperty(TitleText.Text, "System.Title");
            rootPage.HighlightRanges(TitleTextOutput, TitleText.Text, rangesTitle);
        }

InkAnalysisParagraph FindHitParagraph ( Point pt ) [inline, private]

Definition at line 201 of file Scenario2.xaml.cs.

        {
            var paragraphs = inkAnalyzer.AnalysisRoot.FindNodes(InkAnalysisNodeKind.Paragraph);
            foreach (var paragraph in paragraphs)
            {
                // To support ink written with angle, RotatedBoundingRect should be used in hit testing.
                if (RectHelper.Contains(paragraph.BoundingRect, pt))
                {
                    return (InkAnalysisParagraph)paragraph;
                }
            }
            return null;
        }

ScrollViewer FindScrollViewer ( DependencyObject depObject ) [inline, private]

Definition at line 55 of file Scenario2.xaml.cs.

        {
            if (depObject == null)
            {
                return null;
            }

            int countThisLevel = Windows.UI.Xaml.Media.VisualTreeHelper.GetChildrenCount(depObject);
            if (countThisLevel <= 0)
            {
                return null;
            }

            for (int childIndex = 0; childIndex < countThisLevel; childIndex++)
            {
                DependencyObject childDepObject = Windows.UI.Xaml.Media.VisualTreeHelper.GetChild(depObject, childIndex);
                if (childDepObject is ScrollViewer)
                {
                    return (ScrollViewer)childDepObject;
                }

                ScrollViewer svFromChild = FindScrollViewer(childDepObject);
                if (svFromChild != null)
                {
                    return svFromChild;
                }
            }

            return null;
        }

SampleDataModel GetDataModelForCurrentListViewFlyout ( ) [inline, private]

Definition at line 34 of file Scenario2.xaml.cs.

        {
            // Obtain the ListViewItem for which the user requested a context menu.
            var listViewItem = SharedFlyout.Target;

            // Get the data model for the ListViewItem.
            return (SampleDataModel)ItemListView.ItemFromContainer(listViewItem);
        }

String GetDeviceSpecificProperties ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 121 of file 2-PointerPointProperties.xaml.cs.

        {
            String deviceSpecificProperties = "";

            // Detect the type of device being used by examining PointerDeviceType
            // to distinguish between mouse, touch, and pen
            switch (currentPoint.PointerDevice.PointerDeviceType)
            {
                case Windows.Devices.Input.PointerDeviceType.Mouse:
                    deviceSpecificProperties = GetMouseProperties(currentPoint);
                    break;
                case Windows.Devices.Input.PointerDeviceType.Pen:
                    deviceSpecificProperties = GetPenProperties(currentPoint);
                    break;
                case Windows.Devices.Input.PointerDeviceType.Touch:
                    deviceSpecificProperties = GetTouchProperties(currentPoint);
                    break;
            }

            return deviceSpecificProperties;
        }

void GetInstalledLocation_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file scenario2_installedlocation.xaml.cs.

        {
            // This will give the Installed Location.  You can use this location to access files, if you need them.
            Windows.Storage.StorageFolder installedLocation = Package.Current.InstalledLocation;

            OutputTextBlock.Text = String.Format("Installed Location: {0}", installedLocation.Path); ;
        }

String GetMouseProperties ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 144 of file 2-PointerPointProperties.xaml.cs.

        {
            Windows.UI.Input.PointerPointProperties pointerProperties = currentPoint.Properties;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("Left button: " + pointerProperties.IsLeftButtonPressed);
            sb.Append("\nRight button: " + pointerProperties.IsRightButtonPressed);
            sb.Append("\nMiddle button: " + pointerProperties.IsMiddleButtonPressed);
            sb.Append("\nX1 button: " + pointerProperties.IsXButton1Pressed);
            sb.Append("\nX2 button: " + pointerProperties.IsXButton2Pressed);
            sb.Append("\nMouse wheel delta: " + pointerProperties.MouseWheelDelta);

            return sb.ToString();
        }

async void GetParent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario2_GetParent.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    StorageFolder parentFolder = await file.GetParentAsync();
                    if (parentFolder != null)
                    {
                        StringBuilder outputText = new StringBuilder();
                        outputText.AppendLine($"Item: {file.Name} ({file.Path})");
                        outputText.Append($"Parent: {parentFolder.Name} ({parentFolder.Path})");

                        rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
                    }
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

String GetPenProperties ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 174 of file 2-PointerPointProperties.xaml.cs.

        {
            Windows.UI.Input.PointerPointProperties pointerProperties = currentPoint.Properties;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("Barrel button: " + pointerProperties.IsBarrelButtonPressed);
            sb.Append("\nEraser: " + pointerProperties.IsEraser);
            sb.Append("\nPressure: " + pointerProperties.Pressure);

            return sb.ToString();
        }

String GetPointerProperties ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 109 of file 2-PointerPointProperties.xaml.cs.

        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("ID: " + currentPoint.PointerId);
            sb.Append("\nX: " + currentPoint.Position.X);
            sb.Append("\nY: " + currentPoint.Position.Y);
            sb.Append("\nContact: " + currentPoint.IsInContact + "\n");

            return sb.ToString(); ;
        }

Rect GetTextboxSelectionRect ( TextBox textbox ) [inline, private]

Definition at line 37 of file Scenario2.xaml.cs.

        {
            Rect rectFirst, rectLast;
            if (textbox.SelectionStart == textbox.Text.Length)
            {
                rectFirst = textbox.GetRectFromCharacterIndex(textbox.SelectionStart - 1, true);
            }
            else
            {
                rectFirst = textbox.GetRectFromCharacterIndex(textbox.SelectionStart, false);
            }

            int lastIndex = textbox.SelectionStart + textbox.SelectionLength;
            if (lastIndex == textbox.Text.Length)
            {
                rectLast = textbox.GetRectFromCharacterIndex(lastIndex - 1, true);
            }
            else
            {
                rectLast = textbox.GetRectFromCharacterIndex(lastIndex, false);
            }

            rectFirst.Union(rectLast);

            GeneralTransform transform = textbox.TransformToVisual(null);
            return transform.TransformBounds(rectFirst);
        }

async void GetThumbnailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario2.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);

            // Pick a music file
            FileOpenPicker openPicker = new FileOpenPicker();
            foreach (string extension in FileExtensions.Music)
            {
                openPicker.FileTypeFilter.Add(extension);
            }

            StorageFile file = await openPicker.PickSingleFileAsync();

            if (file != null)
            {
                const ThumbnailMode thumbnailMode = ThumbnailMode.MusicView;
                const uint size = 100;
                using (StorageItemThumbnail thumbnail = await file.GetThumbnailAsync(thumbnailMode, size))
                {
                    // Also verify the type is ThumbnailType.Image (album art) instead of ThumbnailType.Icon
                    // (which may be returned as a fallback if the file does not provide album art)
                    if (thumbnail != null && thumbnail.Type == ThumbnailType.Image)
                    {
                        // Display the thumbnail
                        MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, file, thumbnail, false);
                    }
                    else
                    {
                        rootPage.NotifyUser(Errors.NoAlbumArt, NotifyType.StatusMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
            }
        }

String GetTouchProperties ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 160 of file 2-PointerPointProperties.xaml.cs.

        {
            Windows.UI.Input.PointerPointProperties pointerProperties = currentPoint.Properties;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("Contact Rect X: " + pointerProperties.ContactRect.X);
            sb.Append("\nContact Rect Y: " + pointerProperties.ContactRect.Y);
            sb.Append("\nContact Rect Width: " + pointerProperties.ContactRect.Width);
            sb.Append("\nContact Rect Height: " + pointerProperties.ContactRect.Height);

            return sb.ToString(); ;
        }

async Task GroupByHelperAsync ( QueryOptions queryOptions ) [inline, private]

helper for all list by functions

Definition at line 57 of file Scenario2.xaml.cs.

        {
            OutputPanel.Children.Clear();

            StorageFolder picturesFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            StorageFolderQueryResult queryResult = picturesFolder.CreateFolderQueryWithOptions(queryOptions);

            IReadOnlyList<StorageFolder> folderList = await queryResult.GetFoldersAsync();
            foreach (StorageFolder folder in folderList)
            {
                IReadOnlyList<StorageFile> fileList = await folder.GetFilesAsync();
                OutputPanel.Children.Add(CreateHeaderTextBlock(folder.Name + " (" + fileList.Count + ")"));
                foreach (StorageFile file in fileList)
                {
                    OutputPanel.Children.Add(CreateLineItemTextBlock(file.Name));
                }
            }
        }

async void GroupByMonthButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

list all the files and folders in Pictures library by month

Definition at line 33 of file Scenario2.xaml.cs.

        {
            await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByMonth));
        }

async void GroupByRatingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

list all the files and folders in Pictures library by rating

Definition at line 41 of file Scenario2.xaml.cs.

        {
            await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByRating));
        }

async void GroupByTagButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

list all the files and folders in Pictures library by tag

Definition at line 49 of file Scenario2.xaml.cs.

        {
            await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByTag));
        }

void HidePropertyPopUp ( Windows.UI.Input.PointerPoint currentPoint ) [inline, private]

Definition at line 234 of file 2-PointerPointProperties.xaml.cs.

        {
            if (popups.ContainsKey(currentPoint.PointerId))
            {
                mainCanvas.Children.Remove(popups[currentPoint.PointerId]);
                popups[currentPoint.PointerId] = null;
                popups.Remove(currentPoint.PointerId);
            }
        }

void InkCanvas_DoubleTapped | ( | object | sender,
 |  | DoubleTappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 140 of file Scenario2.xaml.cs.

        {
            // Convert the selected paragraph or list item
            if (paragraphSelected != null)
            {
                Rect rect = paragraphSelected.BoundingRect;
                var text = ExtractTextFromParagraph(paragraphSelected);

                if ((rect.X > 0) && (rect.Y > 0) && (text != string.Empty))
                {
                    // Create text box with recognized text
                    var textBlock = new TextBlock();
                    textBlock.Text = text;
                    textBlock.MaxWidth = rect.Width;
                    textBlock.MaxHeight = rect.Height;
                    Canvas.SetLeft(textBlock, rect.X);
                    Canvas.SetTop(textBlock, rect.Y);

                    // Remove strokes from InkPresenter
                    IReadOnlyList<uint> strokeIds = paragraphSelected.GetStrokeIds();
                    foreach (var strokeId in strokeIds)
                    {
                        var stroke = inkPresenter.StrokeContainer.GetStrokeById(strokeId);
                        stroke.Selected = true;
                    }
                    inkPresenter.StrokeContainer.DeleteSelected();

                    // Remove strokes from InkAnalyzer
                    inkAnalyzer.RemoveDataForStrokes(strokeIds);

                    // Hide the SelectionRect
                    SelectionRect.Visibility = Visibility.Collapsed;

                    canvas.Children.Add(textBlock);
                    paragraphSelected = null;
                }
            }
        }

void InkCanvas_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 116 of file Scenario2.xaml.cs.

        {
            var position = e.GetPosition(inkCanvas);

            var paragraph = FindHitParagraph(position);
            if (paragraph == null)
            {
                // Did not tap on a paragraph.
                SelectionRect.Visibility = Visibility.Collapsed;
            }
            else
            {
                // Show the selection rect at the paragraph's bounding rect.
                Rect rect = paragraph.BoundingRect;
                SelectionRect.Width = rect.Width;
                SelectionRect.Height = rect.Height;
                Canvas.SetLeft(SelectionRect, rect.Left);
                Canvas.SetTop(SelectionRect, rect.Top);

                SelectionRect.Visibility = Visibility.Visible;
            }
            paragraphSelected = paragraph;
        }

void InkPresenter_StrokesCollected | ( | InkPresenter | sender,
 |  | InkStrokesCollectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario2.xaml.cs.

        {
            dispatcherTimer.Stop();
            inkAnalyzer.AddDataForStrokes(args.Strokes);
            dispatcherTimer.Start();
        }

void InkPresenter_StrokesErased | ( | InkPresenter | sender,
 |  | InkStrokesErasedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario2.xaml.cs.

        {
            dispatcherTimer.Stop();
            foreach (var stroke in args.Strokes)
            {
                inkAnalyzer.RemoveDataForStroke(stroke.Id);
            }
            dispatcherTimer.Start();
        }

void InkPresenter_StrokesErased | ( | InkPresenter | sender,
 |  | InkStrokesErasedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario2.xaml.cs.

        {
            ClearSelection();
            inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
            inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
            inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
        }

async void ListFoldersButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Obtains the list of folders that make up the Pictures library and binds the FoldersListView to this list.

Parameters:
sender
e

Definition at line 49 of file S2_ListFolders.xaml.cs.

        {
            ListFoldersButton.IsEnabled = false;
            picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);

            // Bind the FoldersListView to the list of folders that make up the library
            FoldersListView.ItemsSource = picturesLibrary.Folders;

            // Register for the DefinitionChanged event to be notified if other apps modify the library
            picturesLibrary.DefinitionChanged += async (StorageLibrary innerSender, object innerEvent) =>
                {
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        UpdateHeaderText();
                    });
                };
            UpdateHeaderText();
        }

async void LoggingSessionScenario_StatusChanged | ( | object | sender,
 |  | LoggingScenarioEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario2.xaml.cs.

        {
            if (e.Type == LoggingScenarioEventType.BusyStatusChanged)
            {
                UpdateControls();
            }
            else if (e.Type == LoggingScenarioEventType.LogFileGenerated)
            {
                await AddLogFileMessageDispatch("LogFileGenerated", e.LogFilePath);
            }
            else if (e.Type == LoggingScenarioEventType.LoggingEnabledDisabled)
            {
                await AddMessageDispatch(string.Format("Logging has been {0}.", e.Enabled ? "enabled" : "disabled"));
            }
        }

void mapBillboardAddButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This method will create a new billboard at the center of the map with the current camera as reference.

Definition at line 68 of file Scenario2.xaml.cs.

        {
            // MapBillboard scales with respect to the perspective projection of the 3D camera.
            // The reference camera determines at what view distance the billboard image appears at 1x scale.
            MapBillboard mapBillboard = new MapBillboard(myMap.ActualCamera);
            mapBillboard.Location = myMap.Center;
            mapBillboard.NormalizedAnchorPoint = new Point(0.5, 1.0);
            mapBillboard.Image = mapBillboardStreamReference;
            myMap.MapElements.Add(mapBillboard);
        }

void mapClearButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario2.xaml.cs.

        {
            myMap.MapElements.Clear();
        }

async void mapElement3DAddButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario2.xaml.cs.

        {
            // Compensate for 3D Model's local coordinate system and scale
            const float AltitudeOffset = 45.0f;
            const float HeadingOffset = -90.0f;
            const float ScaleOffset = 0.1f;

            MapModel3D model = await MapModel3D.CreateFrom3MFAsync(mapModelStreamReference, MapModel3DShadingOption.Smooth);
            if (model != null)
            {
                var center = new BasicGeoposition()
                {
                    Latitude = myMap.Center.Position.Latitude,
                    Longitude = myMap.Center.Position.Longitude,
                    Altitude = AltitudeOffset,
                };

                // MapElement3D scales with respect to the perspective projection of the 3D camera
                MapElement3D mapElement3D = new MapElement3D();
                mapElement3D.Location = new Geopoint(center, AltitudeReferenceSystem.Terrain);
                mapElement3D.Model = model;
                mapElement3D.Heading = HeadingOffset + 180;
                mapElement3D.Scale = new Vector3(ScaleOffset, ScaleOffset, ScaleOffset);
                myMap.MapElements.Add(mapElement3D);
            }
        }

void mapIconAddButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario2.xaml.cs.

        {
            MapIcon mapIcon1 = new MapIcon();
            mapIcon1.Location = myMap.Center;
            mapIcon1.NormalizedAnchorPoint = new Point(0.5, 1.0);
            mapIcon1.Title = "My Friend";
            mapIcon1.Image = mapIconStreamReference;
            mapIcon1.ZIndex = 0;
            myMap.MapElements.Add(mapIcon1);
        }

void mapPolygonAddButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This method will draw a blue rectangle around the center of the map.

Definition at line 109 of file Scenario2.xaml.cs.

        {
            double centerLatitude = myMap.Center.Position.Latitude;
            double centerLongitude = myMap.Center.Position.Longitude;
            MapPolygon mapPolygon = new MapPolygon();
            mapPolygon.Path = new Geopath(new List<BasicGeoposition>() {
                new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude-0.001 },
                new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude-0.001 },
                new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude+0.001 },
                new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude+0.001 },
            });

            mapPolygon.ZIndex = 1;
            mapPolygon.FillColor = Colors.Red;
            mapPolygon.StrokeColor = Colors.Blue;
            mapPolygon.StrokeThickness = 3;
            mapPolygon.StrokeDashed = false;
            myMap.MapElements.Add(mapPolygon);
        }

void mapPolylineAddButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file Scenario2.xaml.cs.

        {
            double centerLatitude = myMap.Center.Position.Latitude;
            double centerLongitude = myMap.Center.Position.Longitude;
            MapPolyline mapPolyline = new MapPolyline();
            mapPolyline.Path = new Geopath(new List<BasicGeoposition>() {
                new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude-0.001 },
                new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude+0.001 },
            });

            mapPolyline.StrokeColor = Colors.Black;
            mapPolyline.StrokeThickness = 3;
            mapPolyline.StrokeDashed = true;
            myMap.MapElements.Add(mapPolyline);
        }

void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario2.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 17;
            myMap.DesiredPitch = 45;
        }

void OnCopy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 198 of file Scenario2.xaml.cs.

        {
            inkCanvas.InkPresenter.StrokeContainer.CopySelectedToClipboard();
        }

void OnCut | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 203 of file Scenario2.xaml.cs.

        {
            inkCanvas.InkPresenter.StrokeContainer.CopySelectedToClipboard();
            inkCanvas.InkPresenter.StrokeContainer.DeleteSelected();
            ClearDrawnBoundingRect();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 66 of file Scenario2_DisplayingInBandClosedCaptions.xaml.cs.

        {
            msLogger?.Dispose();
            msLogger = null;
            mpiLogger?.Dispose();
            mpiLogger = null;
            MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 43 of file FindInProperty.xaml.cs.

        {
            FindQueryText.Text = "Title:Good OR Content:Tree";
            TitleText.Text = "These are Good Times";
            ContentText.Text = "There are many good times to be had. Go for a walk among the trees.";
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 71 of file Scenario2.xaml.cs.

        {
            // Registering handlers to clear the selection when inking or erasing is detected
            inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;
            inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario2_DisplayingInBandClosedCaptions.xaml.cs.

        {
            // Create the playback item
            var source = MediaSource.CreateFromUri(rootPage.CaptionedMediaUri);
            msLogger = new MediaSourceLogger(LoggerControl, source);
            var playbackItem = new MediaPlaybackItem(source);
            mpiLogger = new MediaPlaybackItemLogger(LoggerControl, playbackItem);

            // Turn on English captions by default
            playbackItem.TimedMetadataTracksChanged += (item, args) =>
            {
                if (args.CollectionChange == CollectionChange.ItemInserted)
                {
                    LoggerControl.Log($"TimedMetadataTracksChanged, Number of tracks: {item.TimedMetadataTracks.Count}");

                    uint changedTrackIndex = args.Index;
                    TimedMetadataTrack changedTrack = playbackItem.TimedMetadataTracks[(int)changedTrackIndex];

                    if (changedTrack.Language == "en")
                    {
                        playbackItem.TimedMetadataTracks.SetPresentationMode(changedTrackIndex, TimedMetadataTrackPresentationMode.PlatformPresented);
                    }
                }
            };

            // Set the source to begin playback of the item
            this.mediaPlayerElement.Source = playbackItem;
            LoggerControl.Log($"Loaded: {rootPage.CaptionedMediaUri}");
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file S2_ListFolders.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 79 of file Scenario2.xaml.cs.

        {
            ResetOutput();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_GetParent.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 38 of file scenario2.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario2.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 186 of file Scenario2.xaml.cs.

        {
            UpdateControls();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file scenario2_installedlocation.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 62 of file Scenario2.xaml.cs.

        {
            dispatcherTimer.Stop();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 78 of file Scenario2.xaml.cs.

        {
            // Unregistering handlers to clear the selection when inking or erasing is detected
            inkCanvas.InkPresenter.StrokeInput.StrokeStarted -= StrokeInput_StrokeStarted;
            inkCanvas.InkPresenter.StrokesErased -= InkPresenter_StrokesErased;
        }

void OnPaste | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 210 of file Scenario2.xaml.cs.

        {
            if (inkCanvas.InkPresenter.StrokeContainer.CanPasteFromClipboard())
            {
                inkCanvas.InkPresenter.StrokeContainer.PasteFromClipboard(new Point((scrollViewer.HorizontalOffset + 10) / scrollViewer.ZoomFactor, (scrollViewer.VerticalOffset + 10) / scrollViewer.ZoomFactor));
            }
            else
            {
                rootPage.NotifyUser("Cannot paste from clipboard.", NotifyType.ErrorMessage);
            }
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario2.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void OpenMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario2.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Open", NotifyType.StatusMessage);
        }

void OutputSettings | ( | double | rawPixelsPerViewPixel,
 |  | FrameworkElement | rectangle,
 |  | TextBlock | viewPxText,
 |  | TextBlock | rawPxText,
 |  | TextBlock | fontTextBlock |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario2.xaml.cs.

        {
            // Get the size of the rectangle in view pixels and calulate the size in raw pixels.
            double sizeInViewPx = rectangle.Width;
            double sizeInRawPx = sizeInViewPx * rawPixelsPerViewPixel;

            viewPxText.Text = sizeInViewPx.ToString("F1") + " view px";
            rawPxText.Text = sizeInRawPx.ToString("F0") + " raw px";

            double fontSize = PtFromPx(fontTextBlock.FontSize);
            fontTextBlock.Text = fontSize.ToString("F0") + "pt";
        }

void Pointer_Entered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file 2-PointerPointProperties.xaml.cs.

        {
            Windows.UI.Input.PointerPoint currentPoint = e.GetCurrentPoint(mainCanvas);

            // Determine if the point that entered the canvas is "in contact" with the
            // screen (mouse button pressed, finger down, or pen down).
            // This will be encountered if the user touches down in the app surface,
            // drags their finger off of the app, and drags it back onto the app without
            // lifting their finger.
            if (currentPoint.IsInContact)
            {
                CreateOrUpdatePropertyPopUp(currentPoint);
            }
        }

void Pointer_Moved | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file 2-PointerPointProperties.xaml.cs.

        {
            // Retrieve the point associated with the current event
            Windows.UI.Input.PointerPoint currentPoint = e.GetCurrentPoint(mainCanvas);

            // Create a popup if the pointer being moved is in contact with the screen
            if (currentPoint.IsInContact)
            {
                CreateOrUpdatePropertyPopUp(currentPoint);
            }
        }

void Pointer_Pressed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file 2-PointerPointProperties.xaml.cs.

        {
            Windows.UI.Input.PointerPoint currentPoint = e.GetCurrentPoint(mainCanvas);

            // Retrieve the properties for the curret PointerPoint and display
            // them alongside the pointer's location on screen
            CreateOrUpdatePropertyPopUp(currentPoint);
        }

void Pointer_Released | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 76 of file 2-PointerPointProperties.xaml.cs.

        {
            // Retrieve the point associated with the current event
            Windows.UI.Input.PointerPoint currentPoint = e.GetCurrentPoint(mainCanvas);

            // Remove the popup corresponding to the pointer
            HidePropertyPopUp(currentPoint);
        }

void Pointer_Wheel_Changed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 85 of file 2-PointerPointProperties.xaml.cs.

        {
            // Retrieve the point associated with the current event and record the
            // mouse wheel delta
            Windows.UI.Input.PointerPoint currentPoint = e.GetCurrentPoint(mainCanvas);
            if (currentPoint.IsInContact)
            {
                CreateOrUpdatePropertyPopUp(currentPoint);
            }
        }

void PrintMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario2.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Print", NotifyType.StatusMessage);
        }

double PtFromPx ( double pixel ) [inline, private]

Definition at line 32 of file Scenario2.xaml.cs.

        {
            return pixel * 72 / 96;
        }

double PxFromPt ( double pt ) [inline, private]

Definition at line 37 of file Scenario2.xaml.cs.

        {
            return pt * 96 / 72;
        }

async void ReadOnlyTextBox_ContextMenuOpening | ( | object | sender,
 |  | ContextMenuEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario2.xaml.cs.

        {
            e.Handled = true;
            TextBox textbox = (TextBox)sender;
            if (textbox.SelectionLength > 0)
            {
                // Create a menu and add commands specifying an id value for each instead of a delegate.
                var menu = new PopupMenu();
                menu.Commands.Add(new UICommand("Copy", null, 1));
                menu.Commands.Add(new UICommandSeparator());
                menu.Commands.Add(new UICommand("Highlight", null, 2));
                menu.Commands.Add(new UICommand("Look up", null, 3));

                // We don't want to obscure content, so pass in a rectangle representing the selection area.
                // NOTE: this code only handles textboxes with a single line. If a textbox has multiple lines,
                //       then the context menu should be placed at cursor/pointer location by convention.
                OutputTextBlock.Text = "Context menu shown";
                Rect rect = GetTextboxSelectionRect(textbox);
                var chosenCommand = await menu.ShowForSelectionAsync(rect);
                if (chosenCommand != null)
                {
                    switch ((int)chosenCommand.Id)
                    {
                        case 1:
                            String selectedText = ((TextBox)sender).SelectedText;
                            var dataPackage = new DataPackage();
                            dataPackage.SetText(selectedText);
                            Clipboard.SetContent(dataPackage);
                            OutputTextBlock.Text = "'" + chosenCommand.Label + "'(" + chosenCommand.Id.ToString() + ") selected; '" + selectedText + "' copied to clipboard";
                            break;

                        case 2:
                            OutputTextBlock.Text = "'" + chosenCommand.Label + "'(" + chosenCommand.Id.ToString() + ") selected";
                            break;

                        case 3:
                            OutputTextBlock.Text = "'" + chosenCommand.Label + "'(" + chosenCommand.Id.ToString() + ") selected";
                            break;
                    }
                }
                else
                {
                    OutputTextBlock.Text = "Context menu dismissed";
                }
            }
            else
            {
                OutputTextBlock.Text = "Context menu not shown because there is no text selected";
            }
        }

void RenderPropertyPopUp | ( | String | pointerProperties,
 |  | String | deviceSpecificProperties,
 |  | Windows.UI.Input.PointerPoint | currentPoint |
 | ) |  |  | [inline, private]

Definition at line 189 of file 2-PointerPointProperties.xaml.cs.

        {
            if (popups.ContainsKey(currentPoint.PointerId))
            {
                TextBlock pointerText = (TextBlock)popups[currentPoint.PointerId].Children[0];
                pointerText.Text = pointerProperties;
                TextBlock deviceSpecificText = (TextBlock)popups[currentPoint.PointerId].Children[1];
                deviceSpecificText.Text = deviceSpecificProperties;
            }
            else
            {
                StackPanel pointerPanel = new StackPanel();
                TextBlock pointerText = new TextBlock();
                pointerText.Text = pointerProperties;
                pointerPanel.Children.Add(pointerText);

                TextBlock deviceSpecificText = new TextBlock();
                deviceSpecificText.Text = deviceSpecificProperties;

                // Detect the type of device being used by examining PointerDeviceType
                // to distinguish between mouse, touch, and pen
                switch (currentPoint.PointerDevice.PointerDeviceType)
                {
                    case Windows.Devices.Input.PointerDeviceType.Mouse:
                        deviceSpecificText.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                        break;

                    case Windows.Devices.Input.PointerDeviceType.Touch:
                        deviceSpecificText.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
                        break;

                    case Windows.Devices.Input.PointerDeviceType.Pen:
                        deviceSpecificText.Foreground = new SolidColorBrush(Windows.UI.Colors.Yellow);
                        break;
                }
                pointerPanel.Children.Add(deviceSpecificText);
                popups[currentPoint.PointerId] = pointerPanel;
                mainCanvas.Children.Add(popups[currentPoint.PointerId]);
            }
            TranslateTransform transform = new TranslateTransform();
            transform.X = currentPoint.Position.X + 24;
            transform.Y = currentPoint.Position.Y + 24;
            popups[currentPoint.PointerId].RenderTransform = transform;
        }

void ResetOutput ( ) [inline, private]

Definition at line 55 of file Scenario2.xaml.cs.

        {
            ResolutionTextBlock.Text = Window.Current.Bounds.Width.ToString("F1") + "x" + Window.Current.Bounds.Height.ToString("F1");

            DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
            double rawPixelsPerViewPixel = displayInformation.RawPixelsPerViewPixel;

            // Set the override rectangle size and override text font size by taking our desired
            // size in raw pixels and converting it to view pixels.
            const double rectSizeInRawPx = 100;
            double rectSizeInViewPx = rectSizeInRawPx / rawPixelsPerViewPixel;
            OverrideLayoutRect.Width = rectSizeInViewPx;
            OverrideLayoutRect.Height = rectSizeInViewPx;

            double fontSizeInRawPx = PxFromPt(20);
            double fontSizeInViewPx = fontSizeInRawPx / rawPixelsPerViewPixel;
            OverrideLayoutText.FontSize = fontSizeInViewPx;

            // Output settings for controls with default scaling behavior.
            OutputSettings(rawPixelsPerViewPixel, DefaultLayoutRect, DefaultRelativePx, DefaultPhysicalPx, DefaultLayoutText);
            // Output settings for override controls.
            OutputSettings(rawPixelsPerViewPixel, OverrideLayoutRect, OverrideRelativePx, OverridePhysicalPx, OverrideLayoutText);
        }

void StrokeInput_StrokeStarted | ( | InkStrokeInput | sender,
 |  | Windows.UI.Core.PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario2.xaml.cs.

        {
            // Don't perform analysis while a stroke is in progress.
            dispatcherTimer.Stop();
        }

void StrokeInput_StrokeStarted | ( | InkStrokeInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 85 of file Scenario2.xaml.cs.

        {
            ClearSelection();
            inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
            inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
            inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
        }

void Toggle_Custom | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file Scenario2.xaml.cs.

        {
            if (toggleButton.IsChecked == true)
            {
                inkCanvas.InkPresenter.InputDeviceTypes |= CoreInputDeviceTypes.Touch;
            }
            else
            {
                inkCanvas.InkPresenter.InputDeviceTypes &= ~CoreInputDeviceTypes.Touch;
            }
        }

void ToolButton_Lasso | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 178 of file Scenario2.xaml.cs.

        {
            // By default, pen barrel button or right mouse button is processed for inking
            // Set the configuration to instead allow processing these input on the UI thread
            inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = InkInputRightDragAction.LeaveUnprocessed;

            inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed;
            inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved;
            inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased;
        }

void UnprocessedInput_PointerMoved | ( | InkUnprocessedInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 137 of file Scenario2.xaml.cs.

        {
            if (isBoundRect)
            {
                lasso.Points.Add(args.CurrentPoint.RawPosition);
            }
        }

void UnprocessedInput_PointerPressed | ( | InkUnprocessedInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 123 of file Scenario2.xaml.cs.

        {
            lasso = new Polyline()
            {
                Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
                StrokeThickness = 1,
                StrokeDashArray = new DoubleCollection() { 5, 2 },
            };

            lasso.Points.Add(args.CurrentPoint.RawPosition);
            selectionCanvas.Children.Add(lasso);
            isBoundRect = true;
        }

void UnprocessedInput_PointerReleased | ( | InkUnprocessedInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 145 of file Scenario2.xaml.cs.

        {
            lasso.Points.Add(args.CurrentPoint.RawPosition);

            boundingRect = inkCanvas.InkPresenter.StrokeContainer.SelectWithPolyLine(lasso.Points);
            isBoundRect = false;
            DrawBoundingRect();
        }

void UpdateControls ( ) [inline, private]

Adjust UI controls based on what the sample is doing.

Definition at line 147 of file Scenario2.xaml.cs.

        {
            if (LoggingSessionScenario.Instance.IsLoggingEnabled)
            {
                InputTextBlock1.Text = "Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.";
                EnableDisableLoggingButton.Content = "Disable Logging";

                if (LoggingSessionScenario.Instance.IsBusy)
                {
                    DoScenarioButton.IsEnabled = false;
                    EnableDisableLoggingButton.IsEnabled = false;
                }
                else
                {
                    DoScenarioButton.IsEnabled = true;
                    EnableDisableLoggingButton.IsEnabled = true;
                }
            }
            else
            {
                InputTextBlock1.Text = "Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.";
                EnableDisableLoggingButton.Content = "Enable Logging";
                DoScenarioButton.IsEnabled = false;
                if (LoggingSessionScenario.Instance.IsBusy)
                {
                    EnableDisableLoggingButton.IsEnabled = false;
                }
                else
                {
                    EnableDisableLoggingButton.IsEnabled = true;
                }
            }
        }

void UpdateHeaderText ( ) [inline, private]

Updates the FoldersListHeaderTextBlock with the count of folders in the Pictures library.

Definition at line 71 of file S2_ListFolders.xaml.cs.

        {
            FoldersListHeaderTextBlock.Text = "Pictures library (" + picturesLibrary.Folders.Count + " folders)";
        }

Member Data Documentation

List<SampleDataModel> AllItems = SampleDataModel.GetSampleData()

Definition at line 27 of file Scenario2.xaml.cs.

Rect boundingRect [private]

Definition at line 56 of file Scenario2.xaml.cs.

DispatcherTimer dispatcherTimer [private]

Definition at line 34 of file Scenario2.xaml.cs.

InkAnalyzer inkAnalyzer [private]

Definition at line 32 of file Scenario2.xaml.cs.

InkPresenter inkPresenter [private]

Definition at line 31 of file Scenario2.xaml.cs.

bool isBoundRect [private]

Definition at line 58 of file Scenario2.xaml.cs.

Polyline lasso [private]

Definition at line 55 of file Scenario2.xaml.cs.

Symbol LassoSelect = (Symbol)0xEF20 [private]

Definition at line 60 of file Scenario2.xaml.cs.

RandomAccessStreamReference mapBillboardStreamReference [private]

Definition at line 30 of file Scenario2.xaml.cs.

RandomAccessStreamReference mapIconStreamReference [private]

Definition at line 29 of file Scenario2.xaml.cs.

RandomAccessStreamReference mapModelStreamReference [private]

Definition at line 31 of file Scenario2.xaml.cs.

MediaPlaybackItemLogger mpiLogger [private]

Definition at line 28 of file Scenario2_DisplayingInBandClosedCaptions.xaml.cs.

MediaSourceLogger msLogger [private]

Definition at line 29 of file Scenario2_DisplayingInBandClosedCaptions.xaml.cs.

InkAnalysisParagraph paragraphSelected [private]

Definition at line 33 of file Scenario2.xaml.cs.

StorageLibrary picturesLibrary [private]

Definition at line 27 of file S2_ListFolders.xaml.cs.

Dictionary<uint, StackPanel> popups [private]

Definition at line 22 of file 2-PointerPointProperties.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file scenario2.xaml.cs.

Symbol TouchWriting = (Symbol)0xED5F [private]

Definition at line 61 of file Scenario2.xaml.cs.

Property Documentation

internal LoggingSessionScenario LoggingSessionScenario [get, private]

Definition at line 29 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario2.xaml.cs
  • BasicInput/cs/2-PointerPointProperties.xaml.cs
  • FileAccess/cs/Scenario2_GetParent.xaml.cs
  • FileThumbnails/cs/Scenario2.xaml.cs
  • InkAnalysis/cs/Scenario2.xaml.cs
  • LibraryManagement/cs/S2_ListFolders.xaml.cs
  • Logging/cs/Scenario2.xaml.cs
  • MapControl/cs/Scenario2.xaml.cs
  • Package/cs/scenario2_installedlocation.xaml.cs
  • SemanticTextQuery/cs/FindInProperty.xaml.cs
  • SimpleInk/cs/Scenario2.xaml.cs
  • VideoPlayback/cs/Scenario2_DisplayingInBandClosedCaptions.xaml.cs
  • XamlContextMenu/cs/Scenario2.xaml.cs
  • ContextMenu/cs/Scenario2.xaml.cs
  • DpiScaling/cs/Scenario2.xaml.cs
  • FolderEnumeration/cs/Scenario2.xaml.cs
  • ApplicationResources/cpp/scenario2.xaml.cpp
  • BasicInput/cpp/2-PointerPointProperties.xaml.cpp
  • ContextMenu/cpp/Scenario2.xaml.cpp
  • DatagramSocket/cpp/Scenario2.xaml.cpp
  • DpiScaling/cpp/Scenario2.xaml.cpp
  • FileAccess/cpp/Scenario2_GetParent.xaml.cpp
  • FileThumbnails/cpp/Scenario2.xaml.cpp
  • FolderEnumeration/cpp/Scenario2.xaml.cpp
  • LibraryManagement/cpp/S2_ListFolders.xaml.cpp
  • Logging/cpp/Scenario2.xaml.cpp
  • MapControl/cpp/Scenario2.xaml.cpp
  • Package/cpp/scenario2_installedlocation.xaml.cpp
  • SemanticTextQuery/cpp/FindInProperty.xaml.cpp
  • SimpleInk/cpp/Scenario2.xaml.cpp
  • StreamSocket/cpp/Scenario2.xaml.cpp
  • WebSocket/cpp/Scenario2_Binary.xaml.cpp
  • XamlContextMenu/cpp/Scenario2.xaml.cpp
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Add Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Add
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Add Class Reference

List of all members.

Public Member Functions

Scenario2_Add ()

Private Member Functions

async void Add_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario2_Add.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Add ( ) [inline]

Definition at line 23 of file Scenario2_Add.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Add_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Adds an appointment to the default appointment provider app.

Parameters:
sender
e

Definition at line 33 of file Scenario2_Add.xaml.cs.

        {
            // Create an Appointment that should be added the user's appointments provider app.
            var appointment = new Windows.ApplicationModel.Appointments.Appointment();

            // Get the selection rect of the button pressed to add this appointment
            var rect = MainPage.GetElementRect(sender as FrameworkElement);

            // ShowAddAppointmentAsync returns an appointment id if the appointment given was added to the user's calendar.
            // This value should be stored in app data and roamed so that the appointment can be replaced or removed in the future.
            // An empty string return value indicates that the user canceled the operation before the appointment was added.
            String appointmentId = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowAddAppointmentAsync(appointment, rect, Windows.UI.Popups.Placement.Default);
            if (appointmentId != String.Empty)
            {
                rootPage.NotifyUser("Appointment Id: " + appointmentId, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Appointment not added.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_Add.xaml.cs.

The documentation for this class was generated from the following file:
  • Appointments/cs/Scenario2_Add.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_AdvancedUserActivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_AdvancedUserActivity
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_AdvancedUserActivity Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_AdvancedUserActivity ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateUserActivityAsync ()

Private Attributes

UserActivitySession | _currentSession

Detailed Description

Definition at line 24 of file Scenario2_AdvancedUserActivity.xaml.cs.

Constructor & Destructor Documentation

Scenario2_AdvancedUserActivity ( ) [inline]

Definition at line 28 of file Scenario2_AdvancedUserActivity.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateUserActivityAsync ( ) [inline, private]

Definition at line 46 of file Scenario2_AdvancedUserActivity.xaml.cs.

        {
            // Get channel and create activity.
            UserActivityChannel channel = UserActivityChannel.GetDefault();
            UserActivity activity = await channel.GetOrCreateUserActivityAsync("Scenario2_AdvancedUserActivity");

            // Set deep-link and properties.
            activity.ActivationUri = new Uri("sdkUserActivitySample:page?Scenario2_AdvancedUserActivity");
            activity.VisualElements.DisplayText = "README.md";

            // Add advanced properties.
            activity.ContentUri = new Uri("https://raw.githubusercontent.com/Microsoft/Windows-universal-samples/master/README.md");
            activity.FallbackUri = new Uri("http://go.microsoft.com/fwlink/p/?LinkId=873257");

            activity.VisualElements.Attribution = new UserActivityAttribution()
            {

                IconUri = new Uri("https://raw.githubusercontent.com/Microsoft/Windows-universal-samples/master/SharedContent/media/storelogo-sdk.png"),
                AlternateText = "Windows SDK Samples",
                AddImageQuery = false
            };

            activity.VisualElements.BackgroundColor = Color.FromArgb(0xFF, 0x00, 0xb2, 0xf0);
            activity.VisualElements.Description = "https://raw.githubusercontent.com/Microsoft/Windows-universal-samples/master/README.md";

            // Save to activity feed.
            await activity.SaveAsync();

            // Create a session, which indicates that the user is engaged
            // in the activity.
            _currentSession = activity.CreateSession();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 79 of file Scenario2_AdvancedUserActivity.xaml.cs.

        {
            // Dispose the session, which indicates that the user is no longer
            // engaged in the activity.
            _currentSession?.Dispose();
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario2_AdvancedUserActivity.xaml.cs.

        {
            // If we were activated from a URI, say so.
            // A real app would use the information in the URI to restore state.
            var message = e.Parameter as string;
            if (!String.IsNullOrEmpty(message))
            {
                MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
            }

            await CreateUserActivityAsync();
        }

Member Data Documentation

UserActivitySession _currentSession [private]

Definition at line 26 of file Scenario2_AdvancedUserActivity.xaml.cs.

The documentation for this class was generated from the following file:
  • UserActivity/cs/Scenario2_AdvancedUserActivity.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_BackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_BackgroundTask
Public Member Functions | Protected Member Functions | Private Attributes

Scenario2_BackgroundTask Class Reference

This page is used to handle authentication by background task scenario. More...

List of all members.

Public Member Functions

Scenario2_BackgroundTask ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_BackgroundTask.xaml.cs.

Constructor & Destructor Documentation

Scenario2_BackgroundTask ( ) [inline]

Definition at line 25 of file Scenario2_BackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 35 of file Scenario2_BackgroundTask.xaml.cs.

        {
            // Configure background task handler to perform authentication
            ConfigStore.AuthenticateThroughBackgroundTask = true;

            // Setup completion handler
            ScenarioCommon.Instance.RegisteredCompletionHandlerForBackgroundTask();
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_BackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/Scenario2_BackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Binary Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Binary
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Binary Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_Binary ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | AppendOutputLine (string value)
void | CloseSocket ()
async void | OnClosed (IWebSocket sender, WebSocketClosedEventArgs args)
async void | OnServerCustomValidationRequested (StreamWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args)
async void | OnStart (object sender, RoutedEventArgs args)
void | OnStop (object sender, RoutedEventArgs args)
async Task | ReceiveDataAsync (StreamWebSocket activeSocket)
async Task | SendDataAsync (StreamWebSocket activeSocket)
void | SetBusy (bool value)
async Task | StartAsync ()
void | UpdateVisualState ()

Private Attributes

bool | busy
MainPage rootPage = MainPage.Current
StreamWebSocket | streamWebSocket

Detailed Description

Definition at line 30 of file Scenario2_Binary.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Binary ( ) [inline]

Definition at line 39 of file Scenario2_Binary.xaml.cs.

        {
            this.InitializeComponent();
            UpdateVisualState();
        }

Member Function Documentation

void AppendOutputLine ( string value ) [inline, private]

Definition at line 313 of file Scenario2_Binary.xaml.cs.

        {
            OutputField.Text += value + "\r\n";
        }

void CloseSocket ( ) [inline, private]

Definition at line 296 of file Scenario2_Binary.xaml.cs.

        {
            if (streamWebSocket != null)
            {
                try
                {
                    streamWebSocket.Close(1000, "Closed due to user request.");
                }
                catch (Exception ex)
                {
                    AppendOutputLine(MainPage.BuildWebSocketError(ex));
                    AppendOutputLine(ex.Message);
                }
                streamWebSocket = null;
            }
        }

async void OnClosed | ( | IWebSocket | sender,
 |  | WebSocketClosedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 281 of file Scenario2_Binary.xaml.cs.

        {
            // Dispatch the event to the UI thread so we do not need to synchronize access to streamWebSocket.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

                if (streamWebSocket == sender)
                {
                    CloseSocket();
                    UpdateVisualState();
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 45 of file Scenario2_Binary.xaml.cs.

        {
            CloseSocket();
        }

async void OnServerCustomValidationRequested | ( | StreamWebSocket | sender,
 |  | WebSocketServerCustomValidationRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 142 of file Scenario2_Binary.xaml.cs.

        {
            // In order to call async APIs in this handler, you must first take a deferral and then
            // release it once you are done with the operation. The "using" statement
            // ensures that the deferral completes when control leaves the block.
            bool isValid;
            using (Deferral deferral = args.GetDeferral())
            {
                // Get the server certificate and certificate chain from the args parameter.
                isValid = await MainPage.AreCertificateAndCertChainValidAsync(args.ServerCertificate, args.ServerIntermediateCertificates);

                if (!isValid)
                {
                    args.Reject();
                }
            }

            // Continue on the UI thread so we can update UI.
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (isValid)
                {
                    AppendOutputLine("Custom validation of server certificate passed.");
                }
                else
                {
                    AppendOutputLine("Custom validation of server certificate failed.");
                }
            });
        }

async void OnStart | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario2_Binary.xaml.cs.

        {
            SetBusy(true);
            await StartAsync();
            SetBusy(false);
        }

void OnStop | ( | object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 271 of file Scenario2_Binary.xaml.cs.

        {
            SetBusy(true);
            rootPage.NotifyUser("Stopping", NotifyType.StatusMessage);
            CloseSocket();
            SetBusy(false);
            rootPage.NotifyUser("Stopped", NotifyType.StatusMessage);
        }

async Task ReceiveDataAsync ( StreamWebSocket activeSocket ) [inline, private]

Definition at line 225 of file Scenario2_Binary.xaml.cs.

        {
            Stream readStream = streamWebSocket.InputStream.AsStreamForRead();
            int bytesReceived = 0;
            try
            {
                AppendOutputLine("Background read starting.");

                byte[] readBuffer = new byte[1000];

                while (true)
                {
                    if (streamWebSocket != activeSocket)
                    {
                        // Our socket is no longer active. Stop reading.
                        AppendOutputLine("Background read stopped.");
                        return;
                    }

                    int read = await readStream.ReadAsync(readBuffer, 0, readBuffer.Length);

                    // Do something with the data.
                    // This sample merely reports that the data was received.

                    bytesReceived += read;
                    DataReceivedField.Text = bytesReceived.ToString();
                }
            }
            catch (Exception ex)
            {
                WebErrorStatus status = WebSocketError.GetStatus(ex.GetBaseException().HResult);

                switch (status)
                {
                    case WebErrorStatus.OperationCanceled:
                        AppendOutputLine("Background read canceled.");
                        break;

                    default:
                        AppendOutputLine("Error: " + status);
                        AppendOutputLine(ex.Message);
                        break;
                }
            }
        }

async Task SendDataAsync ( StreamWebSocket activeSocket ) [inline, private]

Definition at line 176 of file Scenario2_Binary.xaml.cs.

        {
            int bytesSent = 0;
            byte[] data = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };

            AppendOutputLine($"Background sending data in {data.Length} byte chunks each second.");

            try
            {
                // Send until the socket gets closed/stopped
                while (true)
                {
                    if (streamWebSocket != activeSocket)
                    {
                        // Our socket is no longer active. Stop sending.
                        AppendOutputLine("Background write stopped.");
                        return;
                    }

                    await activeSocket.OutputStream.WriteAsync(data.AsBuffer());

                    bytesSent += data.Length;
                    DataSentField.Text = bytesSent.ToString();

                    // Delay so the user can watch what's going on.
                    await Task.Delay(TimeSpan.FromSeconds(1));
                }
            }
            catch (Exception ex)
            {
                WebErrorStatus status = WebSocketError.GetStatus(ex.GetBaseException().HResult);

                switch (status)
                {
                    case WebErrorStatus.OperationCanceled:
                        AppendOutputLine("Background write canceled.");
                        break;

                    default:
                        AppendOutputLine("Error: " + status);
                        AppendOutputLine(ex.Message);
                        break;
                }
            }
        }

void SetBusy ( bool value ) [inline, private]

Definition at line 63 of file Scenario2_Binary.xaml.cs.

        {
            busy = value;
            UpdateVisualState();
        }

async Task StartAsync ( ) [inline, private]

Definition at line 76 of file Scenario2_Binary.xaml.cs.

        {
            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling TryGetUri() that will return null for strings that are not
            // valid WebSocket URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet
            // or intErnet. In these cases the app requires the "Home or Work Networking" or
            // "Internet (Client)" capability respectively.
            Uri server = rootPage.TryGetUri(ServerAddressField.Text);
            if (server == null)
            {
                return;
            }

            streamWebSocket = new StreamWebSocket();
            streamWebSocket.Closed += OnClosed;

            // If we are connecting to wss:// endpoint, by default, the OS performs validation of
            // the server certificate based on well-known trusted CAs. We can perform additional custom
            // validation if needed.
            if (SecureWebSocketCheckBox.IsChecked == true)
            {
                // WARNING: Only test applications should ignore SSL errors.
                // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
                // attacks. (Although the connection is secure, the server is not authenticated.)
                // Note that not all certificate validation errors can be ignored.
                // In this case, we are ignoring these errors since the certificate assigned to the localhost
                // URI is self-signed and has subject name = fabrikam.com
                streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
                streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);

                // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
                // custom validation of the server certificate. The event handler must implement the desired
                // custom certificate validation logic.
                streamWebSocket.ServerCustomValidationRequested += OnServerCustomValidationRequested;

                // Certificate validation is meaningful only for secure connections.
                if (server.Scheme != "wss")
                {
                    AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
                }
            }

            AppendOutputLine($"Connecting to {server}...");
            try
            {
                await streamWebSocket.ConnectAsync(server);
            }
            catch (Exception ex) // For debugging
            {
                streamWebSocket.Dispose();
                streamWebSocket = null;

                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }
            rootPage.NotifyUser("Connected", NotifyType.StatusMessage);

            // Start a task to continuously read for incoming data
            Task receiving = ReceiveDataAsync(streamWebSocket);

            // Start a task to continuously write outgoing data
            Task sending = SendDataAsync(streamWebSocket);
        }

void UpdateVisualState ( ) [inline, private]

Definition at line 50 of file Scenario2_Binary.xaml.cs.

        {
            if (busy)
            {
                VisualStateManager.GoToState(this, "Busy", false);
            }
            else
            {
                bool connected = (streamWebSocket != null);
                VisualStateManager.GoToState(this, connected ? "Connected" : "Disconnected", false);
            }
        }

Member Data Documentation

bool busy [private]

Definition at line 37 of file Scenario2_Binary.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario2_Binary.xaml.cs.

StreamWebSocket streamWebSocket [private]

Definition at line 36 of file Scenario2_Binary.xaml.cs.

The documentation for this class was generated from the following file:
  • WebSocket/cs/Scenario2_Binary.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ChangePIN Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ChangePIN
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_ChangePIN Class Reference

List of all members.

Public Member Functions

Scenario2_ChangePIN ()

Private Member Functions

async void ChangePin_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario2_ChangePIN.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ChangePIN ( ) [inline]

Definition at line 23 of file Scenario2_ChangePIN.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ChangePin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'ChangePin' button.

Parameters:
sender
e

Definition at line 33 of file Scenario2_ChangePIN.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;

            try
            {
                SmartCard card = await rootPage.GetSmartCard();
                SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);

                rootPage.NotifyUser("Changing smart card PIN...", NotifyType.StatusMessage);

                bool result = await provisioning.RequestPinChangeAsync();

                if (result)
                {
                    rootPage.NotifyUser("Smart card change PIN operation completed.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Smart card change PIN operation was canceled by the user.", NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Changing smart card PIN failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_ChangePIN.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario2_ChangePIN.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ChatServer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ChatServer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ChatServer Class Reference

List of all members.

Public Member Functions

Scenario2_ChatServer ()
void | KeyboardKey_Pressed (object sender, KeyRoutedEventArgs e)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Disconnect ()
void | DisconnectButton_Click (object sender, RoutedEventArgs e)
async void | InitializeRfcommServer ()
void | InitializeServiceSdpAttributes (RfcommServiceProvider rfcommProvider)
void | ListenButton_Click (object sender, RoutedEventArgs e)
async void | OnConnectionReceived (StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
void | SendButton_Click (object sender, RoutedEventArgs e)
async void | SendMessage ()

Private Attributes

RfcommServiceProvider | rfcommProvider
MainPage rootPage
StreamSocket | socket
StreamSocketListener | socketListener
DataWriter | writer

Detailed Description

Definition at line 24 of file Scenario2_ChatServer.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ChatServer ( ) [inline]

Definition at line 34 of file Scenario2_ChatServer.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Disconnect ( ) [inline, private]

Definition at line 173 of file Scenario2_ChatServer.xaml.cs.

        {
            if (rfcommProvider != null)
            {
                rfcommProvider.StopAdvertising();
                rfcommProvider = null;
            }

            if (socketListener != null)
            {
                socketListener.Dispose();
                socketListener = null;
            }

            if (writer != null)
            {
                writer.DetachStream();
                writer = null;
            }

            if (socket != null)
            {
                socket.Dispose();
                socket = null;
            }
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                ListenButton.IsEnabled = true;
                DisconnectButton.IsEnabled = false;
                ConversationListBox.Items.Clear();
            });
        }

void DisconnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 167 of file Scenario2_ChatServer.xaml.cs.

        {
            Disconnect();
            rootPage.NotifyUser("Disconnected.", NotifyType.StatusMessage);
        }

async void InitializeRfcommServer ( ) [inline, private]

Initializes the server using RfcommServiceProvider to advertise the Chat Service UUID and start listening for incoming connections.

Definition at line 58 of file Scenario2_ChatServer.xaml.cs.

        {
            ListenButton.IsEnabled = false;
            DisconnectButton.IsEnabled = true;

            try
            {
                rfcommProvider = await RfcommServiceProvider.CreateAsync(RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid));
            }
            // Catch exception HRESULT_FROM_WIN32(ERROR_DEVICE_NOT_AVAILABLE).
            catch (Exception ex) when ((uint)ex.HResult == 0x800710DF)
            {
                // The Bluetooth radio may be off.
                rootPage.NotifyUser("Make sure your Bluetooth Radio is on: " + ex.Message, NotifyType.ErrorMessage);
                ListenButton.IsEnabled = true;
                DisconnectButton.IsEnabled = false;
                return;
            }

            // Create a listener for this service and start listening
            socketListener = new StreamSocketListener();
            socketListener.ConnectionReceived += OnConnectionReceived;
            var rfcomm = rfcommProvider.ServiceId.AsString();

            await socketListener.BindServiceNameAsync(rfcommProvider.ServiceId.AsString(),
                SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);

            // Set the SDP attributes and start Bluetooth advertising
            InitializeServiceSdpAttributes(rfcommProvider);

            try
            {
                rfcommProvider.StartAdvertising(socketListener, true);
            }
            catch (Exception e)
            {
                // If you aren't able to get a reference to an RfcommServiceProvider, tell the user why.  Usually throws an exception if user changed their privacy settings to prevent Sync w/ Devices.
                rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
                ListenButton.IsEnabled = true;
                DisconnectButton.IsEnabled = false;
                return;
            }

            rootPage.NotifyUser("Listening for incoming connections", NotifyType.StatusMessage);
        }

void InitializeServiceSdpAttributes ( RfcommServiceProvider rfcommProvider ) [inline, private]

Creates the SDP record that will be revealed to the Client device when pairing occurs.

Parameters:
rfcommProvider The RfcommServiceProvider that is being used to initialize the server

Definition at line 109 of file Scenario2_ChatServer.xaml.cs.

        {
            var sdpWriter = new DataWriter();

            // Write the Service Name Attribute.
            sdpWriter.WriteByte(Constants.SdpServiceNameAttributeType);

            // The length of the UTF-8 encoded Service Name SDP Attribute.
            sdpWriter.WriteByte((byte)Constants.SdpServiceName.Length);

            // The UTF-8 encoded Service Name value.
            sdpWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
            sdpWriter.WriteString(Constants.SdpServiceName);

            // Set the SDP Attribute on the RFCOMM Service Provider.
            rfcommProvider.SdpRawAttributes.Add(Constants.SdpServiceNameAttributeId, sdpWriter.DetachBuffer());
        }

void KeyboardKey_Pressed | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 132 of file Scenario2_ChatServer.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                SendMessage();
            }
        }

void ListenButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario2_ChatServer.xaml.cs.

        {
            InitializeRfcommServer();
        }

async void OnConnectionReceived | ( | StreamSocketListener | sender,
 |  | StreamSocketListenerConnectionReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Invoked when the socket listener accepts an incoming Bluetooth connection.

Parameters:
sender | The socket listener that accepted the connection.
args | The connection accept parameters, which contain the connected socket.

Definition at line 211 of file Scenario2_ChatServer.xaml.cs.

        {
            // Don't need the listener anymore
            socketListener.Dispose();
            socketListener = null;

            try
            {
                socket = args.Socket;
            }
            catch (Exception e)
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
                });
                Disconnect();
                return;
            }

            // Note - this is the supported way to get a Bluetooth device from a given socket
            var remoteDevice = await BluetoothDevice.FromHostNameAsync(socket.Information.RemoteHostName);

            writer = new DataWriter(socket.OutputStream);
            var reader = new DataReader(socket.InputStream);
            bool remoteDisconnection = false;

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Connected to Client: " + remoteDevice.Name, NotifyType.StatusMessage);
            });

            // Infinite read buffer loop
            while (true)
            {
                try
                {
                    // Based on the protocol we've defined, the first uint is the size of the message
                    uint readLength = await reader.LoadAsync(sizeof(uint));

                    // Check if the size of the data is expected (otherwise the remote has already terminated the connection)
                    if (readLength < sizeof(uint))
                    {
                        remoteDisconnection = true;
                        break;
                    }
                    uint currentLength = reader.ReadUInt32();

                    // Load the rest of the message since you already know the length of the data expected.
                    readLength = await reader.LoadAsync(currentLength);

                    // Check if the size of the data is expected (otherwise the remote has already terminated the connection)
                    if (readLength < currentLength)
                    {
                        remoteDisconnection = true;
                        break;
                    }
                    string message = reader.ReadString(currentLength);

                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        ConversationListBox.Items.Add("Received: " + message);
                    });
                }
                // Catch exception HRESULT_FROM_WIN32(ERROR_OPERATION_ABORTED).
                catch (Exception ex) when ((uint)ex.HResult == 0x800703E3)
                {
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Client Disconnected Successfully", NotifyType.StatusMessage);
                    });
                    break;
                }
            }

            reader.DetachStream();
            if (remoteDisconnection)
            {
                Disconnect();
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Client disconnected",NotifyType.StatusMessage);
                });
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario2_ChatServer.xaml.cs.

        {
            Disconnect();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_ChatServer.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void SendButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 127 of file Scenario2_ChatServer.xaml.cs.

        {
            SendMessage();
        }

async void SendMessage ( ) [inline, private]

Definition at line 140 of file Scenario2_ChatServer.xaml.cs.

        {
            // There's no need to send a zero length message
            if (MessageTextBox.Text.Length != 0)
            {
                // Make sure that the connection is still up and there is a message to send
                if (socket != null)
                {
                    string message = MessageTextBox.Text;
                    writer.WriteUInt32((uint)message.Length);
                    writer.WriteString(message);

                    ConversationListBox.Items.Add("Sent: " + message);
                    // Clear the messageTextBox for a new message
                    MessageTextBox.Text = "";

                    await writer.StoreAsync();

                }
                else
                {
                    rootPage.NotifyUser("No clients connected, please wait for a client to connect before attempting to send a message", NotifyType.StatusMessage);
                }
            }
        }

Member Data Documentation

RfcommServiceProvider rfcommProvider [private]

Definition at line 28 of file Scenario2_ChatServer.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file Scenario2_ChatServer.xaml.cs.

StreamSocket socket [private]

Definition at line 26 of file Scenario2_ChatServer.xaml.cs.

StreamSocketListener socketListener [private]

Definition at line 29 of file Scenario2_ChatServer.xaml.cs.

DataWriter writer [private]

Definition at line 27 of file Scenario2_ChatServer.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothRfcommChat/cs/Scenario2_ChatServer.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Client Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Client
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario2_Client Class Reference

List of all members.

Public Member Functions

Scenario2_Client ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddValueChangedHandler ()
async void | Characteristic_ValueChanged (GattCharacteristic sender, GattValueChangedEventArgs args)
async void | CharacteristicList_SelectionChanged ()
async void | CharacteristicReadButton_Click ()
async void | CharacteristicWriteButton_Click ()
async void | CharacteristicWriteButtonInt_Click ()
async Task< bool > | ClearBluetoothLEDeviceAsync ()
async void | ConnectButton_Click ()
void | EnableCharacteristicPanels (GattCharacteristicProperties properties)
string | FormatValueByPresentation (IBuffer buffer, GattPresentationFormat format)
void | RemoveValueChangedHandler ()
async void | ServiceList_SelectionChanged ()
void | SetVisibility (UIElement element, bool visible)
async void | ValueChangedSubscribeToggle_Click ()
async Task< bool > | WriteBufferToSelectedCharacteristicAsync (IBuffer buffer)

Static Private Member Functions

static ushort | ParseHeartRateValue (byte[] data)

Private Attributes

BluetoothLEDevice | bluetoothLeDevice = null
readonly int | E_ACCESSDENIED = unchecked((int)0x80070005)
readonly int | E_BLUETOOTH_ATT_INVALID_PDU = unchecked((int)0x80650004)
readonly int | E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED = unchecked((int)0x80650003)
readonly int | E_DEVICE_NOT_AVAILABLE = unchecked((int)0x800710df)
GattPresentationFormat | presentationFormat
GattCharacteristic | registeredCharacteristic
MainPage rootPage = MainPage.Current
GattCharacteristic | selectedCharacteristic
bool | subscribedForNotifications = false

Detailed Description

Definition at line 34 of file Scenario2_Client.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Client ( ) [inline]

Definition at line 53 of file Scenario2_Client.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void AddValueChangedHandler ( ) [inline, private]

Definition at line 208 of file Scenario2_Client.xaml.cs.

        {
            ValueChangedSubscribeToggle.Content = "Unsubscribe from value changes";
            if (!subscribedForNotifications)
            {
                registeredCharacteristic = selectedCharacteristic;
                registeredCharacteristic.ValueChanged += Characteristic_ValueChanged;
                subscribedForNotifications = true;
            }
        }

async void Characteristic_ValueChanged | ( | GattCharacteristic | sender,
 |  | GattValueChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 443 of file Scenario2_Client.xaml.cs.

        {
            // BT_Code: An Indicate or Notify reported that the value has changed.
            // Display the new value with a timestamp.
            var newValue = FormatValueByPresentation(args.CharacteristicValue, presentationFormat);
            var message = $"Value at {DateTime.Now:hh:mm:ss.FFF}: {newValue}";
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                () => CharacteristicLatestValue.Text = message);
        }

async void CharacteristicList_SelectionChanged ( ) [inline, private]

Definition at line 230 of file Scenario2_Client.xaml.cs.

        {
            selectedCharacteristic = (GattCharacteristic)((ComboBoxItem)CharacteristicList.SelectedItem)?.Tag;
            if (selectedCharacteristic == null)
            {
                EnableCharacteristicPanels(GattCharacteristicProperties.None);
                rootPage.NotifyUser("No characteristic selected", NotifyType.ErrorMessage);
                return;
            }

            // Get all the child descriptors of a characteristics. Use the cache mode to specify uncached descriptors only
            // and the new Async functions to get the descriptors of unpaired devices as well.
            var result = await selectedCharacteristic.GetDescriptorsAsync(BluetoothCacheMode.Uncached);
            if (result.Status != GattCommunicationStatus.Success)
            {
                rootPage.NotifyUser("Descriptor read failure: " + result.Status.ToString(), NotifyType.ErrorMessage);
            }

            // BT_Code: There's no need to access presentation format unless there's at least one.
            presentationFormat = null;
            if (selectedCharacteristic.PresentationFormats.Count > 0)
            {

                if (selectedCharacteristic.PresentationFormats.Count.Equals(1))
                {
                    // Get the presentation format since there's only one way of presenting it
                    presentationFormat = selectedCharacteristic.PresentationFormats[0];
                }
                else
                {
                    // It's difficult to figure out how to split up a characteristic and encode its different parts properly.
                    // In this case, we'll just encode the whole thing to a string to make it easy to print out.
                }
            }

            // Enable/disable operations based on the GattCharacteristicProperties.
            EnableCharacteristicPanels(selectedCharacteristic.CharacteristicProperties);
        }

async void CharacteristicReadButton_Click ( ) [inline, private]

Definition at line 289 of file Scenario2_Client.xaml.cs.

        {
            // BT_Code: Read the actual value from the device by using Uncached.
            GattReadResult result = await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached);
            if (result.Status == GattCommunicationStatus.Success)
            {
                string formattedResult = FormatValueByPresentation(result.Value, presentationFormat);
                rootPage.NotifyUser($"Read result: {formattedResult}", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser($"Read failed: {result.Status}", NotifyType.ErrorMessage);
            }
        }

async void CharacteristicWriteButton_Click ( ) [inline, private]

Definition at line 304 of file Scenario2_Client.xaml.cs.

        {
            if (!String.IsNullOrEmpty(CharacteristicWriteValue.Text))
            {
                var writeBuffer = CryptographicBuffer.ConvertStringToBinary(CharacteristicWriteValue.Text,
                    BinaryStringEncoding.Utf8);

                var writeSuccessful = await WriteBufferToSelectedCharacteristicAsync(writeBuffer);
            }
            else
            {
                rootPage.NotifyUser("No data to write to device", NotifyType.ErrorMessage);
            }
        }

async void CharacteristicWriteButtonInt_Click ( ) [inline, private]

Definition at line 319 of file Scenario2_Client.xaml.cs.

        {
            if (!String.IsNullOrEmpty(CharacteristicWriteValue.Text))
            {
                var isValidValue = Int32.TryParse(CharacteristicWriteValue.Text, out int readValue);
                if (isValidValue)
                {
                    var writer = new DataWriter();
                    writer.ByteOrder = ByteOrder.LittleEndian;
                    writer.WriteInt32(readValue);

                    var writeSuccessful = await WriteBufferToSelectedCharacteristicAsync(writer.DetachBuffer());
                }
                else
                {
                    rootPage.NotifyUser("Data to write has to be an int32", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No data to write to device", NotifyType.ErrorMessage);
            }
        }

async Task<bool> ClearBluetoothLEDeviceAsync ( ) [inline, private]

Definition at line 78 of file Scenario2_Client.xaml.cs.

        {
            if (subscribedForNotifications)
            {
                // Need to clear the CCCD from the remote device so we stop receiving notifications
                var result = await registeredCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.None);
                if (result != GattCommunicationStatus.Success)
                {
                    return false;
                }
                else
                {
                    selectedCharacteristic.ValueChanged -= Characteristic_ValueChanged;
                    subscribedForNotifications = false;
                }
            }
            bluetoothLeDevice?.Dispose();
            bluetoothLeDevice = null;
            return true;
        }

async void ConnectButton_Click ( ) [inline, private]

Definition at line 99 of file Scenario2_Client.xaml.cs.

        {
            ConnectButton.IsEnabled = false;

            if (!await ClearBluetoothLEDeviceAsync())
            {
                rootPage.NotifyUser("Error: Unable to reset state, try again.", NotifyType.ErrorMessage);
                ConnectButton.IsEnabled = true;
                return;
            }

            try
            {
                // BT_Code: BluetoothLEDevice.FromIdAsync must be called from a UI thread because it may prompt for consent.
                bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(rootPage.SelectedBleDeviceId);

                if (bluetoothLeDevice == null)
                {
                    rootPage.NotifyUser("Failed to connect to device.", NotifyType.ErrorMessage);
                }
            }
            catch (Exception ex) when (ex.HResult == E_DEVICE_NOT_AVAILABLE)
            {
                rootPage.NotifyUser("Bluetooth radio is not on.", NotifyType.ErrorMessage);
            }

            if (bluetoothLeDevice != null)
            {
                // Note: BluetoothLEDevice.GattServices property will return an empty list for unpaired devices. For all uses we recommend using the GetGattServicesAsync method.
                // BT_Code: GetGattServicesAsync returns a list of all the supported services of the device (even if it's not paired to the system).
                // If the services supported by the device are expected to change during BT usage, subscribe to the GattServicesChanged event.
                GattDeviceServicesResult result = await bluetoothLeDevice.GetGattServicesAsync(BluetoothCacheMode.Uncached);

                if (result.Status == GattCommunicationStatus.Success)
                {
                    var services = result.Services;
                    rootPage.NotifyUser(String.Format("Found {0} services", services.Count), NotifyType.StatusMessage);
                    foreach (var service in services)
                    {
                        ServiceList.Items.Add(new ComboBoxItem { Content = DisplayHelpers.GetServiceName(service), Tag = service });
                    }
                    ConnectButton.Visibility = Visibility.Collapsed;
                    ServiceList.Visibility = Visibility.Visible;
                }
                else
                {
                    rootPage.NotifyUser("Device unreachable", NotifyType.ErrorMessage);
                }
            }
            ConnectButton.IsEnabled = true;
        }

void EnableCharacteristicPanels ( GattCharacteristicProperties properties ) [inline, private]

Definition at line 274 of file Scenario2_Client.xaml.cs.

        {
            // BT_Code: Hide the controls which do not apply to this characteristic.
            SetVisibility(CharacteristicReadButton, properties.HasFlag(GattCharacteristicProperties.Read));

            SetVisibility(CharacteristicWritePanel,
                properties.HasFlag(GattCharacteristicProperties.Write) ||
                properties.HasFlag(GattCharacteristicProperties.WriteWithoutResponse));
            CharacteristicWriteValue.Text = "";

            SetVisibility(ValueChangedSubscribeToggle, properties.HasFlag(GattCharacteristicProperties.Indicate) ||
                                                       properties.HasFlag(GattCharacteristicProperties.Notify));

        }

string FormatValueByPresentation | ( | IBuffer | buffer,
 |  | GattPresentationFormat | format |
 | ) |  |  | [inline, private]

Definition at line 453 of file Scenario2_Client.xaml.cs.

        {
            // BT_Code: For the purpose of this sample, this function converts only UInt32 and
            // UTF-8 buffers to readable text. It can be extended to support other formats if your app needs them.
            byte[] data;
            CryptographicBuffer.CopyToByteArray(buffer, out data);
            if (format != null)
            {
                if (format.FormatType == GattPresentationFormatTypes.UInt32 && data.Length >= 4)
                {
                    return BitConverter.ToInt32(data, 0).ToString();
                }
                else if (format.FormatType == GattPresentationFormatTypes.Utf8)
                {
                    try
                    {
                        return Encoding.UTF8.GetString(data);
                    }
                    catch (ArgumentException)
                    {
                        return "(error: Invalid UTF-8 string)";
                    }
                }
                else
                {
                    // Add support for other format types as needed.
                    return "Unsupported format: " + CryptographicBuffer.EncodeToHexString(buffer);
                }
            }
            else if (data != null)
            {
                // We don't know what format to use. Let's try some well-known profiles, or default back to UTF-8.
                if (selectedCharacteristic.Uuid.Equals(GattCharacteristicUuids.HeartRateMeasurement))
                {
                    try
                    {
                        return "Heart Rate: " + ParseHeartRateValue(data).ToString();
                    }
                    catch (ArgumentException)
                    {
                        return "Heart Rate: (unable to parse)";
                    }
                }
                else if (selectedCharacteristic.Uuid.Equals(GattCharacteristicUuids.BatteryLevel))
                {
                    try
                    {
                        // battery level is encoded as a percentage value in the first byte according to
                        // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.battery_level.xml
                        return "Battery Level: " + data[0].ToString() + "%";
                    }
                    catch (ArgumentException)
                    {
                        return "Battery Level: (unable to parse)";
                    }
                }
                // This is our custom calc service Result UUID. Format it like an Int
                else if (selectedCharacteristic.Uuid.Equals(Constants.ResultCharacteristicUuid))
                {
                    return BitConverter.ToInt32(data, 0).ToString();
                }
                // No guarantees on if a characteristic is registered for notifications.
                else if (registeredCharacteristic != null)
                {
                    // This is our custom calc service Result UUID. Format it like an Int
                    if (registeredCharacteristic.Uuid.Equals(Constants.ResultCharacteristicUuid))
                    {
                        return BitConverter.ToInt32(data, 0).ToString();
                    }
                }
                else
                {
                    try
                    {
                        return "Unknown format: " + Encoding.UTF8.GetString(data);
                    }
                    catch (ArgumentException)
                    {
                        return "Unknown format";
                    }
                }
            }
            else
            {
                return "Empty data received";
            }
            return "Unknown format";
        }

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 67 of file Scenario2_Client.xaml.cs.

        {
            var success = await ClearBluetoothLEDeviceAsync();
            if (!success)
            {
                rootPage.NotifyUser("Error: Unable to reset app state", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 58 of file Scenario2_Client.xaml.cs.

        {
            SelectedDeviceRun.Text = rootPage.SelectedBleDeviceName;
            if (string.IsNullOrEmpty(rootPage.SelectedBleDeviceId))
            {
                ConnectButton.IsEnabled = false;
            }
        }

static ushort ParseHeartRateValue ( byte[] data ) [inline, static, private]

Process the raw data received from the device into application usable data, according the the Bluetooth Heart Rate Profile.

https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml&u=org.bluetooth.characteristic.heart_rate_measurement.xml This function throws an exception if the data cannot be parsed.

Parameters:
data Raw data received from the heart rate monitor.
Returns:
The heart rate measurement value.

Definition at line 550 of file Scenario2_Client.xaml.cs.

        {
            // Heart Rate profile defined flag values
            const byte heartRateValueFormat = 0x01;

            byte flags = data[0];
            bool isHeartRateValueSizeLong = ((flags & heartRateValueFormat) != 0);

            if (isHeartRateValueSizeLong)
            {
                return BitConverter.ToUInt16(data, 1);
            }
            else
            {
                return data[1];
            }
        }

void RemoveValueChangedHandler ( ) [inline, private]

Definition at line 219 of file Scenario2_Client.xaml.cs.

        {
            ValueChangedSubscribeToggle.Content = "Subscribe to value changes";
            if (subscribedForNotifications)
            {
                registeredCharacteristic.ValueChanged -= Characteristic_ValueChanged;
                registeredCharacteristic = null;
                subscribedForNotifications = false;
            }
        }

async void ServiceList_SelectionChanged ( ) [inline, private]

Definition at line 153 of file Scenario2_Client.xaml.cs.

        {
            var service = (GattDeviceService)((ComboBoxItem)ServiceList.SelectedItem)?.Tag;

            CharacteristicList.Items.Clear();
            RemoveValueChangedHandler();

            IReadOnlyList<GattCharacteristic> characteristics = null;
            try
            {
                // Ensure we have access to the device.
                var accessStatus = await service.RequestAccessAsync();
                if (accessStatus == DeviceAccessStatus.Allowed)
                {
                    // BT_Code: Get all the child characteristics of a service. Use the cache mode to specify uncached characterstics only
                    // and the new Async functions to get the characteristics of unpaired devices as well.
                    var result = await service.GetCharacteristicsAsync(BluetoothCacheMode.Uncached);
                    if (result.Status == GattCommunicationStatus.Success)
                    {
                        characteristics = result.Characteristics;
                    }
                    else
                    {
                        rootPage.NotifyUser("Error accessing service.", NotifyType.ErrorMessage);

                        // On error, act as if there are no characteristics.
                        characteristics = new List<GattCharacteristic>();
                    }
                }
                else
                {
                    // Not granted access
                    rootPage.NotifyUser("Error accessing service.", NotifyType.ErrorMessage);

                    // On error, act as if there are no characteristics.
                    characteristics = new List<GattCharacteristic>();

                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Restricted service. Can't read characteristics: " + ex.Message,
                    NotifyType.ErrorMessage);
                // On error, act as if there are no characteristics.
                characteristics = new List<GattCharacteristic>();
            }

            foreach (GattCharacteristic c in characteristics)
            {
                CharacteristicList.Items.Add(new ComboBoxItem { Content = DisplayHelpers.GetCharacteristicName(c), Tag = c });
            }
            CharacteristicList.Visibility = Visibility.Visible;
        }

void SetVisibility | ( | UIElement | element,
 |  | bool | visible |
 | ) |  |  | [inline, private]

Definition at line 269 of file Scenario2_Client.xaml.cs.

        {
            element.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
        }

async void ValueChangedSubscribeToggle_Click ( ) [inline, private]

Definition at line 375 of file Scenario2_Client.xaml.cs.

        {
            if (!subscribedForNotifications)
            {
                // initialize status
                GattCommunicationStatus status = GattCommunicationStatus.Unreachable;
                var cccdValue = GattClientCharacteristicConfigurationDescriptorValue.None;
                if (selectedCharacteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Indicate))
                {
                    cccdValue = GattClientCharacteristicConfigurationDescriptorValue.Indicate;
                }

                else if (selectedCharacteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Notify))
                {
                    cccdValue = GattClientCharacteristicConfigurationDescriptorValue.Notify;
                }

                try
                {
                    // BT_Code: Must write the CCCD in order for server to send indications.
                    // We receive them in the ValueChanged event handler.
                    status = await selectedCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(cccdValue);

                    if (status == GattCommunicationStatus.Success)
                    {
                        AddValueChangedHandler();
                        rootPage.NotifyUser("Successfully subscribed for value changes", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser($"Error registering for value changes: {status}", NotifyType.ErrorMessage);
                    }
                }
                catch (UnauthorizedAccessException ex)
                {
                    // This usually happens when a device reports that it support indicate, but it actually doesn't.
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
            else
            {
                try
                {
                    // BT_Code: Must write the CCCD in order for server to send notifications.
                    // We receive them in the ValueChanged event handler.
                    // Note that this sample configures either Indicate or Notify, but not both.
                    var result = await
                            selectedCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
                                GattClientCharacteristicConfigurationDescriptorValue.None);
                    if (result == GattCommunicationStatus.Success)
                    {
                        subscribedForNotifications = false;
                        RemoveValueChangedHandler();
                        rootPage.NotifyUser("Successfully un-registered for notifications", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser($"Error un-registering for notifications: {result}", NotifyType.ErrorMessage);
                    }
                }
                catch (UnauthorizedAccessException ex)
                {
                    // This usually happens when a device reports that it support notify, but it actually doesn't.
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

async Task<bool> WriteBufferToSelectedCharacteristicAsync ( IBuffer buffer ) [inline, private]

Definition at line 343 of file Scenario2_Client.xaml.cs.

        {
            try
            {
                // BT_Code: Writes the value from the buffer to the characteristic.
                var result = await selectedCharacteristic.WriteValueWithResultAsync(buffer);

                if (result.Status == GattCommunicationStatus.Success)
                {
                    rootPage.NotifyUser("Successfully wrote value to device", NotifyType.StatusMessage);
                    return true;
                }
                else
                {
                    rootPage.NotifyUser($"Write failed: {result.Status}", NotifyType.ErrorMessage);
                    return false;
                }
            }
            catch (Exception ex) when (ex.HResult == E_BLUETOOTH_ATT_INVALID_PDU)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                return false;
            }
            catch (Exception ex) when (ex.HResult == E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED || ex.HResult == E_ACCESSDENIED)
            {
                // This usually happens when a device reports that it support writing, but it actually doesn't.
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                return false;
            }
        }

Member Data Documentation

BluetoothLEDevice bluetoothLeDevice = null [private]

Definition at line 38 of file Scenario2_Client.xaml.cs.

readonly int E_ACCESSDENIED = unchecked((int)0x80070005) [private]

Definition at line 48 of file Scenario2_Client.xaml.cs.

readonly int E_BLUETOOTH_ATT_INVALID_PDU = unchecked((int)0x80650004) [private]

Definition at line 47 of file Scenario2_Client.xaml.cs.

readonly int E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED = unchecked((int)0x80650003) [private]

Definition at line 46 of file Scenario2_Client.xaml.cs.

readonly int E_DEVICE_NOT_AVAILABLE = unchecked((int)0x800710df) [private]

Definition at line 49 of file Scenario2_Client.xaml.cs.

GattPresentationFormat presentationFormat [private]

Definition at line 43 of file Scenario2_Client.xaml.cs.

GattCharacteristic registeredCharacteristic [private]

Definition at line 42 of file Scenario2_Client.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 36 of file Scenario2_Client.xaml.cs.

GattCharacteristic selectedCharacteristic [private]

Definition at line 39 of file Scenario2_Client.xaml.cs.

bool subscribedForNotifications = false [private]

Definition at line 374 of file Scenario2_Client.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothLE/cs/Scenario2_Client.xaml.cs
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_CloseDrawer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_CloseDrawer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_CloseDrawer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_CloseDrawer ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< bool > | ClaimCashDrawer ()
async Task< bool > | CreateDefaultCashDrawerObject ()
async void | drawer_AlarmExpired (CashDrawerCloseAlarm alarm, object sender)
async void | drawer_StatusUpdated (CashDrawer drawer, CashDrawerStatusUpdatedEventArgs e)
async Task< bool > | EnableCashDrawer ()
async void | InitDrawerButton_Click (object sender, RoutedEventArgs e)
void | ResetScenarioState ()
void | UpdateStatusOutput (CashDrawerStatusKind status)
async void | WaitForDrawerCloseButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedCashDrawer | claimedDrawer = null
CashDrawer | drawer = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario2_CloseDrawer.xaml.cs.

Constructor & Destructor Documentation

Scenario2_CloseDrawer ( ) [inline]

Definition at line 36 of file Scenario2_CloseDrawer.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

task< bool > ClaimCashDrawer ( ) [inline, private]

Attempt to claim the connected cash drawer.

Returns:
True if the cash drawer was successfully claimed, false otherwise.
Returns:
True if the operation succeeds, false otherwise.

Definition at line 163 of file Scenario2_CloseDrawer.xaml.cs.

        {
            if (drawer == null)
                return false;

            if (claimedDrawer == null)
            {
                claimedDrawer = await drawer.ClaimDrawerAsync();
                if (claimedDrawer == null)
                    return false;
            }

            return true;
        }

task< bool > CreateDefaultCashDrawerObject ( ) [inline, private]

Creates the default cash drawer.

Returns:
True if the cash drawer was created, false otherwise.

Definition at line 145 of file Scenario2_CloseDrawer.xaml.cs.

        {
            rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage);

            if (drawer == null)
            {
                drawer = await DeviceHelpers.GetFirstCashDrawerAsync();
                if (drawer == null)
                    return false;
            }

            return true;
        }

async void drawer_AlarmExpired | ( | CashDrawerCloseAlarm | alarm,
 |  | object | sender |
 | ) |  |  | [inline, private]

Event callback for the alarm expiring.

Parameters:
alarm | CashDrawerCloseAlarm that has expired.
sender | Unused by AlarmTimeoutExpired events.

Definition at line 212 of file Scenario2_CloseDrawer.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Alarm expired.  Still waiting for drawer to be closed.", NotifyType.StatusMessage);
            });
        }

async void drawer_StatusUpdated | ( | CashDrawer | drawer,
 |  | CashDrawerStatusUpdatedEventArgs | e |
 | ) |  |  | [inline, private]

Event callback for device status updates.

Parameters:
drawer | CashDrawer object sending the status update event.
e | Event data associated with the status update.

Definition at line 198 of file Scenario2_CloseDrawer.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                UpdateStatusOutput(e.Status.StatusKind);
                rootPage.NotifyUser("Status updated event: " + e.Status.StatusKind.ToString(), NotifyType.StatusMessage);
            });
        }

async Task<bool> EnableCashDrawer ( ) [inline, private]

Attempt to enabled the claimed cash drawer.

Returns:
True if the cash drawer was successfully enabled, false otherwise.

Definition at line 182 of file Scenario2_CloseDrawer.xaml.cs.

        {
            if (claimedDrawer == null)
                return false;

            if (claimedDrawer.IsEnabled)
                return true;

            return await claimedDrawer.EnableAsync();
        }

async void InitDrawerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Initialize Drawer button.

Claims and enables the default cash drawer.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 67 of file Scenario2_CloseDrawer.xaml.cs.

        {
            if (await CreateDefaultCashDrawerObject())
            {
                if (await ClaimCashDrawer())
                {
                    if (await EnableCashDrawer())
                    {
                        drawer.StatusUpdated += drawer_StatusUpdated;

                        InitDrawerButton.IsEnabled = false;
                        DrawerWaitButton.IsEnabled = true;

                        UpdateStatusOutput(drawer.Status.StatusKind);
                        rootPage.NotifyUser("Successfully enabled cash drawer. Device ID: " + claimedDrawer.DeviceId, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Failed to enable cash drawer.", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("Failed to claim cash drawer.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Cash drawer not found. Please connect a cash drawer.", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked before the page is unloaded and is no longer the current source of a Frame.

Parameters:
e Event data describing the navigation that was requested.

Definition at line 55 of file Scenario2_CloseDrawer.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached.

Definition at line 45 of file Scenario2_CloseDrawer.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedTo(e);
        }

void ResetScenarioState ( ) [inline, private]

Reset the scenario to its initial state.

Definition at line 223 of file Scenario2_CloseDrawer.xaml.cs.

        {
            if (claimedDrawer != null)
            {
                claimedDrawer.Dispose();
                claimedDrawer = null;
            }

            if (drawer != null)
            {
                drawer.Dispose();
                drawer = null;
            }

            UpdateStatusOutput(CashDrawerStatusKind.Offline);

            InitDrawerButton.IsEnabled = true;
            DrawerWaitButton.IsEnabled = false;

            rootPage.NotifyUser("Click the init drawer button to begin.", NotifyType.StatusMessage);
        }

void UpdateStatusOutput ( CashDrawerStatusKind status ) [inline, private]

Update the cash drawer text block.

Parameters:
status Cash drawer status to be displayed.

Definition at line 249 of file Scenario2_CloseDrawer.xaml.cs.

        {
            DrawerStatusBlock.Text = status.ToString();
        }

async void WaitForDrawerCloseButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Set up an alarm and wait for the drawer to close.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 104 of file Scenario2_CloseDrawer.xaml.cs.

        {
            if (claimedDrawer == null)
            {
                rootPage.NotifyUser("Drawer must be initialized.", NotifyType.ErrorMessage);
                return;
            }

            var alarm = claimedDrawer.CloseAlarm;
            if (alarm == null)
            {
                rootPage.NotifyUser("Failed to create drawer alarm.", NotifyType.ErrorMessage);
                return;
            }

            if (!claimedDrawer.IsDrawerOpen)
            {
                rootPage.NotifyUser("Drawer is already closed.", NotifyType.StatusMessage);
            }
            else
            {
                // TimeSpan specifies a time period as (hours, minutes, seconds)
                alarm.AlarmTimeout = new TimeSpan(0, 0, 30);
                alarm.BeepDelay = new TimeSpan(0, 0, 3);
                alarm.BeepDuration = new TimeSpan(0, 0, 1);
                alarm.BeepFrequency = 700;
                alarm.AlarmTimeoutExpired += drawer_AlarmExpired;

                rootPage.NotifyUser("Waiting for drawer to close.", NotifyType.StatusMessage);

                if (await alarm.StartAsync())
                    rootPage.NotifyUser("Successfully waited for drawer close.", NotifyType.StatusMessage);
                else
                    rootPage.NotifyUser("Failed to wait for drawer close.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ClaimedCashDrawer claimedDrawer = null [private]

Definition at line 33 of file Scenario2_CloseDrawer.xaml.cs.

CashDrawer drawer = null [private]

Definition at line 32 of file Scenario2_CloseDrawer.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario2_CloseDrawer.xaml.cs.

The documentation for this class was generated from the following files:
  • CashDrawer/cs/Scenario2_CloseDrawer.xaml.cs
  • CashDrawer/cpp/Scenario2_CloseDrawer.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Conditional Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Conditional
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Conditional Class Reference

This page shows how to use the ApiInformation class in app code to. More...

List of all members.

Public Member Functions

Scenario2_Conditional ()
void | SetupBlur ()
void | SetupDestinationEffect (Compositor compositor)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Flyout_Closed (object sender, object e)
void | Flyout_Opened (object sender, object e)

Private Attributes

Compositor | _compositor
bool | _destinationEffectsPresent = false
SpriteVisual | _destVisual
Visual | _rootVisual
MainPage rootPage

Detailed Description

Definition at line 28 of file Scenario2_Conditional.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Conditional ( ) [inline]

Definition at line 37 of file Scenario2_Conditional.xaml.cs.

        {
            this.InitializeComponent();

            SetupBlur();
        }

Member Function Documentation

void Flyout_Closed | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario2_Conditional.xaml.cs.

        {
            BlurRect.IsHitTestVisible = false;
            if (_destVisual != null)
            {
                _destVisual.Size = new Vector2(0, 0);
            }
        }

void Flyout_Opened | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario2_Conditional.xaml.cs.

        {
            BlurRect.IsHitTestVisible = true;
            if (_destVisual != null)
            {
                _destVisual.Size = new Vector2((float)BlurRect.ActualWidth, (float)BlurRect.ActualHeight);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 90 of file Scenario2_Conditional.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void SetupBlur ( ) [inline]

Definition at line 44 of file Scenario2_Conditional.xaml.cs.

        {
            _rootVisual = ElementCompositionPreview.GetElementVisual(this as UIElement);
            _compositor = _rootVisual.Compositor;

            // If the Compositor.CreateBackdropBrush method exists, then set up the blur.
            if (ApiInformation.IsMethodPresent(_compositor.GetType().ToString(), "CreateBackdropBrush"))
            {
                _destinationEffectsPresent = true;
                SetupDestinationEffect(_compositor);
            }
        }

void SetupDestinationEffect ( Compositor compositor ) [inline]

Definition at line 57 of file Scenario2_Conditional.xaml.cs.

        {
            // Create SpriteVisual for blur effect
            _destVisual = compositor.CreateSpriteVisual();
            _destVisual.Size = new Vector2(0, 0);

            // Create graphics effect for blur
            var graphicsEffect = new GaussianBlurEffect
            {
                Name = "GB",
                Source = new CompositionEffectSourceParameter("destinationSource"),
                BlurAmount = 10f,
                BorderMode = EffectBorderMode.Hard,
                Optimization = EffectOptimization.Balanced

            };

            var effectFactory = compositor.CreateEffectFactory(graphicsEffect);

            var blurEffect = effectFactory.CreateBrush();
            var destinationBrush = compositor.CreateBackdropBrush();

            blurEffect.SetSourceParameter("destinationSource", destinationBrush);

            // Set the SpriteVisual's brush as blur effect
            _destVisual.Brush = blurEffect;

            // Insert the destination visual as child of the BlurRect UIElement.
            // Since the BlurRect is between the text of the flyout and the content of the page,
            // the destination visual will blur the content of the page.
            ElementCompositionPreview.SetElementChildVisual(BlurRect, _destVisual);
        }

Member Data Documentation

Compositor _compositor [private]

Definition at line 33 of file Scenario2_Conditional.xaml.cs.

bool _destinationEffectsPresent = false [private]

Definition at line 34 of file Scenario2_Conditional.xaml.cs.

SpriteVisual _destVisual [private]

Definition at line 32 of file Scenario2_Conditional.xaml.cs.

Visual _rootVisual [private]

Definition at line 35 of file Scenario2_Conditional.xaml.cs.

MainPage rootPage [private]

Definition at line 30 of file Scenario2_Conditional.xaml.cs.

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/Scenario2_Conditional.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Connector Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Connector
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario2_Connector Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_Connector ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Properties

ObservableCollection
< ConnectedDevice > 		ConnectedDevices = new ObservableCollection<DiscoveredDevice>() [get]
ObservableCollection
< DiscoveredDevice > 		DiscoveredDevices [get]

Private Member Functions

void | btnClose_Click (object sender, RoutedEventArgs e)
async void | btnFromId_Click (object sender, RoutedEventArgs e)
void | btnIe_Click (object sender, RoutedEventArgs e)
async void | btnSendMessage_Click (object sender, RoutedEventArgs e)
async void | btnUnpair_Click (object sender, RoutedEventArgs e)
void | btnWatcher_Click (object sender, RoutedEventArgs e)
void | OnConnectionStatusChanged (WiFiDirectDevice sender, object arg)
async void | OnDeviceAdded (DeviceWatcher deviceWatcher, DeviceInformation deviceInfo)
async void | OnDeviceRemoved (DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
async void | OnDeviceUpdated (DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
void | OnEnumerationCompleted (DeviceWatcher deviceWatcher, object o)
void | OnStopped (DeviceWatcher deviceWatcher, object o)
void | StopWatcher ()

Private Attributes

DeviceWatcher | _deviceWatcher = null
bool | _fWatcherStarted = false
WiFiDirectAdvertisementPublisher | _publisher = new WiFiDirectAdvertisementPublisher()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 37 of file Scenario2_Connector.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Connector ( ) [inline]

Definition at line 47 of file Scenario2_Connector.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void btnClose_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 317 of file Scenario2_Connector.xaml.cs.

        {
            var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
            ConnectedDevices.Remove(connectedDevice);

            // Close socket and WiFiDirect object
            connectedDevice.Dispose();
        }

async void btnFromId_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 234 of file Scenario2_Connector.xaml.cs.

        {
            var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;

            if (discoveredDevice == null)
            {
                rootPage.NotifyUser("No device selected, please select one.", NotifyType.ErrorMessage);
                return;
            }

            rootPage.NotifyUser($"Connecting to {discoveredDevice.DeviceInfo.Name}...", NotifyType.StatusMessage);

            if (!discoveredDevice.DeviceInfo.Pairing.IsPaired)
            {
                if (!await connectionSettingsPanel.RequestPairDeviceAsync(discoveredDevice.DeviceInfo.Pairing))
                {
                    return;
                }
            }

            WiFiDirectDevice wfdDevice = null;
            try
            {
                // IMPORTANT: FromIdAsync needs to be called from the UI thread
                wfdDevice = await WiFiDirectDevice.FromIdAsync(discoveredDevice.DeviceInfo.Id);
            }
            catch (TaskCanceledException)
            {
                rootPage.NotifyUser("FromIdAsync was canceled by user", NotifyType.ErrorMessage);
                return;
            }

            // Register for the ConnectionStatusChanged event handler
            wfdDevice.ConnectionStatusChanged += OnConnectionStatusChanged;

            IReadOnlyList<EndpointPair> endpointPairs = wfdDevice.GetConnectionEndpointPairs();
            HostName remoteHostName = endpointPairs[0].RemoteHostName;

            rootPage.NotifyUser($"Devices connected on L2 layer, connecting to IP Address: {remoteHostName} Port: {Globals.strServerPort}",
                NotifyType.StatusMessage);

            // Wait for server to start listening on a socket
            await Task.Delay(2000);

            // Connect to Advertiser on L4 layer
            StreamSocket clientSocket = new StreamSocket();
            try
{
                await clientSocket.ConnectAsync(remoteHostName, Globals.strServerPort);
                rootPage.NotifyUser("Connected with remote side on L4 layer", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser($"Connect operation threw an exception: {ex.Message}", NotifyType.ErrorMessage);
                return;
            }

            SocketReaderWriter socketRW = new SocketReaderWriter(clientSocket, rootPage);

            string sessionId = Path.GetRandomFileName();
            ConnectedDevice connectedDevice = new ConnectedDevice(sessionId, wfdDevice, socketRW);
            ConnectedDevices.Add(connectedDevice);

            // The first message sent over the socket is the name of the connection.
            await socketRW.WriteMessageAsync(sessionId);

            while (await socketRW.ReadMessageAsync() != null)
            {
                // Keep reading messages
            }
        }

void btnIe_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 166 of file Scenario2_Connector.xaml.cs.

        {
            var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;

            IList<WiFiDirectInformationElement> informationElements = null;
            try
            {
                informationElements = WiFiDirectInformationElement.CreateFromDeviceInformation(discoveredDevice.DeviceInfo);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("No Information element found: " + ex.Message, NotifyType.ErrorMessage);
            }

            if (informationElements != null)
            {
                StringWriter message = new StringWriter();

                foreach (WiFiDirectInformationElement informationElement in informationElements)
                {
                    string ouiName = CryptographicBuffer.EncodeToHexString(informationElement.Oui);
                    string value = string.Empty;
                    Byte[] bOui = informationElement.Oui.ToArray();

                    if (bOui.SequenceEqual(Globals.MsftOui))
                    {
                        // The format of Microsoft information elements is documented here:
                        // https://msdn.microsoft.com/en-us/library/dn392651.aspx
                        // with errata here:
                        // https://msdn.microsoft.com/en-us/library/mt242386.aspx
                        ouiName += " (Microsoft)";
                    }
                    else if (bOui.SequenceEqual(Globals.WfaOui))
                    {
                        ouiName += " (WFA)";
                    }
                    else if (bOui.SequenceEqual(Globals.CustomOui))
                    {
                        ouiName += " (Custom)";

                        if (informationElement.OuiType == Globals.CustomOuiType)
                        {
                            DataReader dataReader = DataReader.FromBuffer(informationElement.Value);
                            dataReader.UnicodeEncoding = UnicodeEncoding.Utf8;
                            dataReader.ByteOrder = ByteOrder.LittleEndian;

                            // Read the string.
                            try
                            {
                                string data = dataReader.ReadString(dataReader.ReadUInt32());
                                value = $"Data: {data}";
                            }
                            catch (Exception)
                            {
                                value = "(Unable to parse)";
                            }
                        }
                    }

                    message.WriteLine($"OUI {ouiName}, Type {informationElement.OuiType} {value}");
                }

                message.Write($"Information elements found: {informationElements.Count}");

                rootPage.NotifyUser(message.ToString(), NotifyType.StatusMessage);
            }
        }

async void btnSendMessage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 311 of file Scenario2_Connector.xaml.cs.

        {
            var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
            await connectedDevice.SocketRW.WriteMessageAsync(txtSendMessage.Text);
        }

async void btnUnpair_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 326 of file Scenario2_Connector.xaml.cs.

        {
            var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;

            DeviceUnpairingResult result = await discoveredDevice.DeviceInfo.Pairing.UnpairAsync();
            rootPage.NotifyUser($"Unpair result: {result.Status}", NotifyType.StatusMessage);
        }

void btnWatcher_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario2_Connector.xaml.cs.

        {
            if (_deviceWatcher == null)
            {
                _publisher.Start();

                if (_publisher.Status != WiFiDirectAdvertisementPublisherStatus.Started)
                {
                    rootPage.NotifyUser("Failed to start advertisement.", NotifyType.ErrorMessage);
                    return;
                }

                DiscoveredDevices.Clear();
                rootPage.NotifyUser("Finding Devices...", NotifyType.StatusMessage);

                String deviceSelector = WiFiDirectDevice.GetDeviceSelector(
                    Utils.GetSelectedItemTag<WiFiDirectDeviceSelectorType>(cmbDeviceSelector));

                _deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector, new string[] { "System.Devices.WiFiDirect.InformationElements" });

                _deviceWatcher.Added += OnDeviceAdded;
                _deviceWatcher.Removed += OnDeviceRemoved;
                _deviceWatcher.Updated += OnDeviceUpdated;
                _deviceWatcher.EnumerationCompleted += OnEnumerationCompleted;
                _deviceWatcher.Stopped += OnStopped;

                _deviceWatcher.Start();

                btnWatcher.Content = "Stop Watcher";
                _fWatcherStarted = true;
            }
            else
            {
                _publisher.Stop();

                btnWatcher.Content = "Start Watcher";

                StopWatcher();

                rootPage.NotifyUser("Device watcher stopped.", NotifyType.StatusMessage);
            }
        }

void OnConnectionStatusChanged | ( | WiFiDirectDevice | sender,
 |  | object | arg |
 | ) |  |  | [inline, private]

Definition at line 306 of file Scenario2_Connector.xaml.cs.

        {
            rootPage.NotifyUserFromBackground($"Connection status changed: {sender.ConnectionStatus}", NotifyType.StatusMessage);
        }

async void OnDeviceAdded | ( | DeviceWatcher | deviceWatcher,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Definition at line 117 of file Scenario2_Connector.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DiscoveredDevices.Add(new DiscoveredDevice(deviceInfo));
            });
        }

async void OnDeviceRemoved | ( | DeviceWatcher | deviceWatcher,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario2_Connector.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                foreach (DiscoveredDevice discoveredDevice in DiscoveredDevices)
                {
                    if (discoveredDevice.DeviceInfo.Id == deviceInfoUpdate.Id)
                    {
                        DiscoveredDevices.Remove(discoveredDevice);
                        break;
                    }
                }
            });
        }

async void OnDeviceUpdated | ( | DeviceWatcher | deviceWatcher,
 |  | DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [inline, private]

Definition at line 140 of file Scenario2_Connector.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                foreach (DiscoveredDevice discoveredDevice in DiscoveredDevices)
                {
                    if (discoveredDevice.DeviceInfo.Id == deviceInfoUpdate.Id)
                    {
                        discoveredDevice.UpdateDeviceInfo(deviceInfoUpdate);
                        break;
                    }
                }
            });
        }

void OnEnumerationCompleted | ( | DeviceWatcher | deviceWatcher,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario2_Connector.xaml.cs.

        {
            rootPage.NotifyUserFromBackground("DeviceWatcher enumeration completed", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario2_Connector.xaml.cs.

        {
            if (_deviceWatcher != null)
            {
                StopWatcher();
            }
        }

void OnStopped | ( | DeviceWatcher | deviceWatcher,
 |  | object | o |
 | ) |  |  | [inline, private]

Definition at line 160 of file Scenario2_Connector.xaml.cs.

        {
            rootPage.NotifyUserFromBackground("DeviceWatcher stopped", NotifyType.StatusMessage);
        }

void StopWatcher ( ) [inline, private]

Definition at line 60 of file Scenario2_Connector.xaml.cs.

        {
            _deviceWatcher.Added -= OnDeviceAdded;
            _deviceWatcher.Removed -= OnDeviceRemoved;
            _deviceWatcher.Updated -= OnDeviceUpdated;
            _deviceWatcher.EnumerationCompleted -= OnEnumerationCompleted;
            _deviceWatcher.Stopped -= OnStopped;

            _deviceWatcher.Stop();

            _deviceWatcher = null;
        }

Member Data Documentation

DeviceWatcher _deviceWatcher = null [private]

Definition at line 40 of file Scenario2_Connector.xaml.cs.

bool _fWatcherStarted = false [private]

Definition at line 41 of file Scenario2_Connector.xaml.cs.

WiFiDirectAdvertisementPublisher _publisher = new WiFiDirectAdvertisementPublisher() [private]

Definition at line 42 of file Scenario2_Connector.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario2_Connector.xaml.cs.

Property Documentation

ObservableCollection<ConnectedDevice> ConnectedDevices = new ObservableCollection<DiscoveredDevice>() [get]

Definition at line 45 of file Scenario2_Connector.xaml.cs.

ObservableCollection<DiscoveredDevice> DiscoveredDevices [get]

Definition at line 44 of file Scenario2_Connector.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirect/cs/Scenario2_Connector.xaml.cs
  • WiFiDirect/cpp/Scenario2_Connector.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Custom Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Custom
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Custom Class Reference

List of all members.

Public Member Functions

Scenario2_Custom ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisableButtons ()
async void | EnableButtons ()
void | GetCustomProfile ()
void | InputPauseButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | InputPlayButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | InputStopButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | OnTargetFormatChanged (object sender, SelectionChangedEventArgs e)
async void | OutputPathText (string text)
void | OutputPauseButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | OutputPlayButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | OutputStopButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | OutputText (string text)
async void | PickFile (object sender, RoutedEventArgs e)
async void | PickOutput (object sender, RoutedEventArgs e)
async void | PlayFile (Windows.Storage.StorageFile MediaFile)
async void | SetCancelButton (bool isEnabled)
async void | SetOutputFileButton (bool isEnabled)
async void | SetPickFileButton (bool isEnabled)
async void | SetTranscodeButton (bool isEnabled)
async void | StopPlayers ()
async void | TranscodeCancel (object sender, RoutedEventArgs e)
async void | TranscodeComplete ()
async void | TranscodeCustom (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | TranscodeError (string error)
async void | TranscodeFailure (TranscodeFailureReason reason)
void | TranscodeProgress (double percent)

Private Attributes

CancellationTokenSource | _cts
Windows.UI.Core.CoreDispatcher | _dispatcher = Window.Current.Dispatcher
Windows.Storage.StorageFile | _InputFile = null
Windows.Storage.StorageFile | _OutputFile = null
string | _OutputFileExtension = ".mp4"
string | _OutputFileName = "TranscodeSampleOutput"
string | _OutputType = "MP4"
Windows.Media.MediaProperties.MediaEncodingProfile | _Profile
Windows.Media.Transcoding.MediaTranscoder | _Transcoder = new Windows.Media.Transcoding.MediaTranscoder()
bool | _UseMp4 = true
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario2_Custom.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Custom ( ) [inline]

Definition at line 41 of file Scenario2_Custom.xaml.cs.

        {
            this.InitializeComponent();
            _cts = new CancellationTokenSource();

            // Hook up UI
            PickFileButton.Click += new RoutedEventHandler(PickFile);
            SetOutputButton.Click += new RoutedEventHandler(PickOutput);
            TargetFormat.SelectionChanged += new SelectionChangedEventHandler(OnTargetFormatChanged);
            Transcode.Click += new RoutedEventHandler(TranscodeCustom);
            Cancel.Click += new RoutedEventHandler(TranscodeCancel);

            // Media Controls
            InputPlayButton.Click += new RoutedEventHandler(InputPlayButton_Click);
            InputPauseButton.Click += new RoutedEventHandler(InputPauseButton_Click);
            InputStopButton.Click += new RoutedEventHandler(InputStopButton_Click);
            OutputPlayButton.Click += new RoutedEventHandler(OutputPlayButton_Click);
            OutputPauseButton.Click += new RoutedEventHandler(OutputPauseButton_Click);
            OutputStopButton.Click += new RoutedEventHandler(OutputStopButton_Click);

            // Initialize UI with default settings
            MediaEncodingProfile defaultProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Wvga);
            VideoW.Text = defaultProfile.Video.Width.ToString();
            VideoH.Text = defaultProfile.Video.Height.ToString();
            VideoBR.Text = defaultProfile.Video.Bitrate.ToString();
            VideoFR.Text = defaultProfile.Video.FrameRate.Numerator.ToString();
            AudioBPS.Text = defaultProfile.Audio.BitsPerSample.ToString();
            AudioCC.Text = defaultProfile.Audio.ChannelCount.ToString();
            AudioBR.Text = defaultProfile.Audio.Bitrate.ToString();
            AudioSR.Text = defaultProfile.Audio.SampleRate.ToString();

            // File is not selected, disable all buttons but PickFileButton
            DisableButtons();
            SetPickFileButton(true);
            SetOutputFileButton(false);
            SetCancelButton(false);
        }

Member Function Documentation

void DisableButtons ( ) [inline, private]

Definition at line 397 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Transcode.IsEnabled = false;
                PickFileButton.IsEnabled = false;
                SetOutputButton.IsEnabled = false;
                TargetFormat.IsEnabled = false;
                EnableMrfCrf444.IsEnabled = false;
            });
        }

void Dispose ( ) [inline]

Definition at line 79 of file Scenario2_Custom.xaml.cs.

        {
            _cts.Dispose();
        }

void EnableButtons ( ) [inline, private]

Definition at line 382 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = true;
                SetOutputButton.IsEnabled = true;
                TargetFormat.IsEnabled = true;
                EnableMrfCrf444.IsEnabled = true;

                // The transcode button's initial state should be disabled until an output
                // file has been set.
                Transcode.IsEnabled = false;
            });
        }

void GetCustomProfile ( ) [inline, private]

Definition at line 141 of file Scenario2_Custom.xaml.cs.

        {
            if (_UseMp4)
            {
                _Profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Wvga);
            }
            else
            {
                _Profile = MediaEncodingProfile.CreateWmv(VideoEncodingQuality.Wvga);
            }

            try
            {
                _Profile.Video.Width = UInt32.Parse(VideoW.Text);
                _Profile.Video.Height = UInt32.Parse(VideoH.Text);
                _Profile.Video.Bitrate = UInt32.Parse(VideoBR.Text);
                _Profile.Video.FrameRate.Numerator = UInt32.Parse(VideoFR.Text);
                _Profile.Video.FrameRate.Denominator = 1;
                _Profile.Audio.BitsPerSample = UInt32.Parse(AudioBPS.Text);
                _Profile.Audio.ChannelCount = UInt32.Parse(AudioCC.Text);
                _Profile.Audio.Bitrate = UInt32.Parse(AudioBR.Text);
                _Profile.Audio.SampleRate = UInt32.Parse(AudioSR.Text);

                // Video sources providing more than about 250 megapixels per second require the
                // H.264 encoder to be set to level 5.2. Information about H.264 encoding levels:
                // https://en.wikipedia.org/wiki/Advanced_Video_Coding#Levels
                // Windows doesn't always set the higher level automatically so it should be set
                // explicitly to avoid encoding failures. Constants needed to set the encoding level:
                // https://docs.microsoft.com/en-us/windows/win32/medfound/mf-mt-video-level
                // https://docs.microsoft.com/en-us/windows/win32/api/codecapi/ne-codecapi-eavench264vlevel
                if (_UseMp4)
                {
                    const int c_PixelsPerSecondRequiringLevel52 = 250000000;
                    if (_Profile.Video.Width * _Profile.Video.Height *
                        _Profile.Video.FrameRate.Numerator / _Profile.Video.FrameRate.Denominator >
                        c_PixelsPerSecondRequiringLevel52)
                    {
                        _Profile.Video.Properties[MediaFoundationConstants.MF_MT_VIDEO_LEVEL] =
                            (UInt32)MediaFoundationConstants.eAVEncH264VLevel.eAVEncH264VLevel5_2;
                    }
                }

            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
                _Profile = null;
            }
        }

void InputPauseButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 324 of file Scenario2_Custom.xaml.cs.

        {
            InputVideo.Pause();
        }

void InputPlayButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 308 of file Scenario2_Custom.xaml.cs.

        {
            if (InputVideo.DefaultPlaybackRate == 0)
            {
                InputVideo.DefaultPlaybackRate = 1.0;
                InputVideo.PlaybackRate = 1.0;
            }

            InputVideo.Play();
        }

void InputStopButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 319 of file Scenario2_Custom.xaml.cs.

        {
            InputVideo.Stop();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 89 of file Scenario2_Custom.xaml.cs.

        {
        }

void OnTargetFormatChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 292 of file Scenario2_Custom.xaml.cs.

        {
            if (TargetFormat.SelectedIndex > 0)
            {
                _OutputFileExtension = ".wmv";
                _OutputType = "WMV";
                _UseMp4 = false;
            }
            else
            {
                _OutputFileExtension = ".mp4";
                _OutputType = "MP4";
                _UseMp4 = true;
            }
        }

async void OutputPathText ( string text ) [inline, private]

Definition at line 462 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputPath.Text = text;
            });
        }

void OutputPauseButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 345 of file Scenario2_Custom.xaml.cs.

        {
            OutputVideo.Pause();
        }

void OutputPlayButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 329 of file Scenario2_Custom.xaml.cs.

        {
            if (OutputVideo.DefaultPlaybackRate == 0)
            {
                OutputVideo.DefaultPlaybackRate = 1.0;
                OutputVideo.PlaybackRate = 1.0;
            }

            OutputVideo.Play();
        }

void OutputStopButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 340 of file Scenario2_Custom.xaml.cs.

        {
            OutputVideo.Stop();
        }

async void OutputText ( string text ) [inline, private]

Definition at line 453 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputMsg.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green);
                OutputMsg.Text = text;
            });
        }

async void PickFile | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 257 of file Scenario2_Custom.xaml.cs.

        {
            Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".wmv");
            picker.FileTypeFilter.Add(".mp4");

            Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

                _InputFile = file;
                InputVideo.SetSource(stream, file.ContentType);
                InputVideo.Play();

                // Enable buttons
                EnableButtons();
            }
        }

async void PickOutput | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 278 of file Scenario2_Custom.xaml.cs.

        {
            FileSavePicker picker = new FileSavePicker();
            picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            picker.SuggestedFileName = _OutputFileName;
            picker.FileTypeChoices.Add(_OutputType, new System.Collections.Generic.List<string>() { _OutputFileExtension });

            _OutputFile = await picker.PickSaveFileAsync();

            if (_OutputFile != null)
            {
                SetTranscodeButton(true);
            }
        }

async void PlayFile ( Windows.Storage.StorageFile MediaFile ) [inline, private]

Definition at line 424 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                    Windows.Storage.Streams.IRandomAccessStream stream = await MediaFile.OpenAsync(FileAccessMode.Read);
                    OutputVideo.SetSource(stream, MediaFile.ContentType);
                    OutputVideo.Play();
                }
                catch (Exception exception)
                {
                    TranscodeError(exception.Message);
                }
            });
        }

void SetCancelButton ( bool isEnabled ) [inline, private]

Definition at line 374 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Cancel.IsEnabled = isEnabled;
            });
        }

void SetOutputFileButton ( bool isEnabled ) [inline, private]

Definition at line 358 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                SetOutputButton.IsEnabled = isEnabled;
            });
        }

void SetPickFileButton ( bool isEnabled ) [inline, private]

Definition at line 350 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = isEnabled;
            });
        }

void SetTranscodeButton ( bool isEnabled ) [inline, private]

Definition at line 366 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Transcode.IsEnabled = isEnabled;
            });
        }

void StopPlayers ( ) [inline, private]

Definition at line 409 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (InputVideo.CurrentState != MediaElementState.Paused)
                {
                    InputVideo.Pause();
                }
                if (OutputVideo.CurrentState != MediaElementState.Paused)
                {
                    OutputVideo.Pause();
                }
            });
        }

async void TranscodeCancel | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 210 of file Scenario2_Custom.xaml.cs.

        {
            try
            {
                _cts.Cancel();
                _cts.Dispose();
                _cts = new CancellationTokenSource();

                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

async void TranscodeComplete ( ) [inline, private]

Definition at line 196 of file Scenario2_Custom.xaml.cs.

        {
            OutputText("Transcode completed.");
            OutputPathText("Output (" + _OutputFile.Path + ")");
            Windows.Storage.Streams.IRandomAccessStream stream = await _OutputFile.OpenAsync(Windows.Storage.FileAccessMode.Read);
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputVideo.SetSource(stream, _OutputFile.ContentType);
            });

            EnableButtons();
            SetCancelButton(false);
        }

async void TranscodeCustom | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario2_Custom.xaml.cs.

        {
            StopPlayers();
            DisableButtons();
            GetCustomProfile();

            // Clear messages
            StatusMessage.Text = "";

            try
            {
                if (_InputFile != null && _Profile != null && _OutputFile != null)
                {
                    var preparedTranscodeResult = await _Transcoder.PrepareFileTranscodeAsync(_InputFile, _OutputFile, _Profile);

                    if (EnableMrfCrf444.IsChecked.HasValue && (bool)EnableMrfCrf444.IsChecked)
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.MrfCrf444;
                    }
                    else
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.Default;
                    }

                    if (preparedTranscodeResult.CanTranscode)
                    {
                        SetCancelButton(true);
                        var progress = new Progress<double>(TranscodeProgress);
                        await preparedTranscodeResult.TranscodeAsync().AsTask(_cts.Token, progress);
                        TranscodeComplete();
                    }
                    else
                    {
                        TranscodeFailure(preparedTranscodeResult.FailureReason);
                    }
                }
            }
            catch (TaskCanceledException)
            {
                OutputText("");
                TranscodeError("Transcode Canceled");
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

async void TranscodeError ( string error ) [inline, private]

Definition at line 441 of file Scenario2_Custom.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                StatusMessage.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Red);
                StatusMessage.Text = error;
            });

            EnableButtons();
            SetCancelButton(false);
        }

void TranscodeFailure ( TranscodeFailureReason reason ) [inline, private]

Definition at line 229 of file Scenario2_Custom.xaml.cs.

        {
            try
            {
                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }

            switch (reason)
            {
                case TranscodeFailureReason.CodecNotFound:
                    TranscodeError("Codec not found.");
                    break;
                case TranscodeFailureReason.InvalidProfile:
                    TranscodeError("Invalid profile.");
                    break;
                default:
                    TranscodeError("Unknown failure.");
                    break;
            }
        }

void TranscodeProgress ( double percent ) [inline, private]

Definition at line 191 of file Scenario2_Custom.xaml.cs.

        {
            OutputText("Progress:  " + percent.ToString().Split('.')[0] + "%");
        }

Member Data Documentation

CancellationTokenSource _cts [private]

Definition at line 31 of file Scenario2_Custom.xaml.cs.

Windows.UI.Core.CoreDispatcher _dispatcher = Window.Current.Dispatcher [private]

Definition at line 30 of file Scenario2_Custom.xaml.cs.

Windows.Storage.StorageFile _InputFile = null [private]

Definition at line 36 of file Scenario2_Custom.xaml.cs.

Windows.Storage.StorageFile _OutputFile = null [private]

Definition at line 37 of file Scenario2_Custom.xaml.cs.

string _OutputFileExtension = ".mp4" [private]

Definition at line 33 of file Scenario2_Custom.xaml.cs.

string _OutputFileName = "TranscodeSampleOutput" [private]

Definition at line 32 of file Scenario2_Custom.xaml.cs.

string _OutputType = "MP4" [private]

Definition at line 34 of file Scenario2_Custom.xaml.cs.

Windows.Media.MediaProperties.MediaEncodingProfile _Profile [private]

Definition at line 35 of file Scenario2_Custom.xaml.cs.

Windows.Media.Transcoding.MediaTranscoder _Transcoder = new Windows.Media.Transcoding.MediaTranscoder() [private]

Definition at line 38 of file Scenario2_Custom.xaml.cs.

bool _UseMp4 = true [private]

Definition at line 39 of file Scenario2_Custom.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Custom.xaml.cs.

The documentation for this class was generated from the following files:
  • MediaTranscoding/cs/Scenario2_Custom.xaml.cs
  • MediaTranscoding/cpp/Scenario2_Custom.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DecimalFormatting Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DecimalFormatting
Public Member Functions | Private Member Functions

Scenario2_DecimalFormatting Class Reference

List of all members.

Public Member Functions

Scenario2_DecimalFormatting ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario2_DecimalFormatting.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DecimalFormatting ( ) [inline]

Definition at line 21 of file Scenario2_DecimalFormatting.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 31 of file Scenario2_DecimalFormatting.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.NumberFormatting.DecimalFormatter class
            // to format a number.

            // Keep results of the scenario in a StringBuilder
            StringBuilder results = new StringBuilder();

            // Create formatter initialized using the current user's preference settings.
            DecimalFormatter decimalFormat = new Windows.Globalization.NumberFormatting.DecimalFormatter();

            // Make a random number.
            double randomNumber = (new Random().NextDouble() * 100000);

            // Format with the user's default preferences.
            String decimalCurrent = decimalFormat.Format(randomNumber);

            // Format with grouping.
            DecimalFormatter decimalFormat1 = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            decimalFormat1.IsGrouped = true;
            String decimal1 = decimalFormat1.Format(randomNumber);

            // Format with grouping using French.
            DecimalFormatter decimalFormatFR = new Windows.Globalization.NumberFormatting.DecimalFormatter(new string[] { "fr-FR" }, "ZZ");
            decimalFormatFR.IsGrouped = true;
            String decimalFR = decimalFormatFR.Format(randomNumber);

            // Illustrate how automatic digit substitution works
            DecimalFormatter decimalFormatAR = new Windows.Globalization.NumberFormatting.DecimalFormatter(new string[] { "ar" }, "ZZ");
            decimalFormatAR.IsGrouped = true;
            String decimalAR = decimalFormatAR.Format(randomNumber);

            // Get a fixed number.
            ulong fixedNumber = 500;

            // Format with the user's default preferences.
            String decimal2 = decimalFormat.Format(fixedNumber);

            // Format always with a decimal point.
            DecimalFormatter decimalFormat3 = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            decimalFormat3.IsDecimalPointAlwaysDisplayed = true;
            decimalFormat3.FractionDigits = 0;
            String decimal3 = decimalFormat3.Format(fixedNumber);

            // Format with no fractional digits or decimal point.
            DecimalFormatter decimalFormat4 = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            decimalFormat4.FractionDigits = 0;
            String decimal4 = decimalFormat4.Format(fixedNumber);

            // Display the results.
            results.AppendLine("Random number (" + randomNumber + ")");
            results.AppendLine("With current user preferences: " + decimalCurrent);
            results.AppendLine("With grouping separators: " + decimal1);
            results.AppendLine("With grouping separators (fr-FR): " + decimalFR);
            results.AppendLine("With digit substitution (ar): " + decimalAR);
            results.AppendLine();
            results.AppendLine("Fixed number (" + fixedNumber + ")");
            results.AppendLine("With current user preferences: " + decimal2);
            results.AppendLine("Always with a decimal point: " + decimal3);
            results.AppendLine("With no fraction digits or decimal points: " + decimal4);

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario2_DecimalFormatting.xaml.cs
  • NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DelayMini Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DelayMini
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario2_DelayMini Class Reference

List of all members.

Public Member Functions

Scenario2_DelayMini ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< Contact > | DownloadContactDataAsync (Contact contact)
async void | ShowContactCard_Click (object sender, RoutedEventArgs e)

Static Private Member Functions

static Contact | CreatePlaceholderContact ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_DelayMini.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DelayMini ( ) [inline]

Definition at line 26 of file Scenario2_DelayMini.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

Contact CreatePlaceholderContact ( ) [inline, static, private]

Definition at line 39 of file Scenario2_DelayMini.xaml.cs.

        {
            // Create contact object with small set of initial data to display.
            Contact contact = new Contact();
            contact.FirstName = "Kim";
            contact.LastName = "Abercrombie";

            ContactEmail email = new ContactEmail();
            email.Address = "kim@contoso.com";
            contact.Emails.Add(email);

            return contact;
        }

async Task<Contact> DownloadContactDataAsync ( Contact contact ) [inline, private]

Definition at line 53 of file Scenario2_DelayMini.xaml.cs.

        {
            // Simulate the download latency by delaying the execution by 2 seconds.
            await Task.Delay(2000);

            if (!DownloadSucceeded.IsChecked.Value)
            {
                return null;
            }

            // Add more data to the contact object.
            ContactEmail workEmail = new ContactEmail();
            workEmail.Address = "kim@example.com";
            workEmail.Kind = ContactEmailKind.Work;
            contact.Emails.Add(workEmail);

            ContactPhone homePhone = new ContactPhone();
            homePhone.Number = "(444) 555-0101";
            homePhone.Kind = ContactPhoneKind.Home;
            contact.Phones.Add(homePhone);

            ContactPhone workPhone = new ContactPhone();
            workPhone.Number = "(245) 555-0123";
            workPhone.Kind = ContactPhoneKind.Work;
            contact.Phones.Add(workPhone);

            ContactPhone mobilePhone = new ContactPhone();
            mobilePhone.Number = "(921) 555-0187";
            mobilePhone.Kind = ContactPhoneKind.Mobile;
            contact.Phones.Add(mobilePhone);

            ContactAddress address = new ContactAddress();
            address.StreetAddress = "123 Main St";
            address.Locality = "Redmond";
            address.Region = "WA";
            address.Country = "USA";
            address.PostalCode = "00000";
            address.Kind = ContactAddressKind.Home;
            contact.Addresses.Add(address);

            return contact;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario2_DelayMini.xaml.cs.

        {
            if (!ContactManager.IsShowDelayLoadedContactCardSupported())
            {
                NotSupportedWarning.Visibility = Visibility.Visible;
            }
        }

async void ShowContactCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario2_DelayMini.xaml.cs.

        {
            Contact contact = CreatePlaceholderContact();

            // Show the contact card next to the button.
            Rect rect = MainPage.GetElementRect(sender as FrameworkElement);

            // The contact card placement can change when it is updated with more data. For improved user experience, specify placement
            // of the card so that it has space to grow and will not need to be repositioned. In this case, default placement first places
            // the card above the button because the card is small, but after the card is updated with more data, the operating system moves
            // the card below the button to fit the card's expanded size. Specifying that the contact card is placed below at the beginning
            // avoids this repositioning.
            Placement placement = Placement.Below;

            // For demonstration purposes, we ask for the Enterprise contact card.
            ContactCardOptions options = new ContactCardOptions() { HeaderKind = ContactCardHeaderKind.Enterprise };

            using (ContactCardDelayedDataLoader dataLoader = ContactManager.ShowDelayLoadedContactCard(contact, rect, placement, options))
            {
                if (dataLoader != null)
                {
                    // Simulate downloading more data from the network for the contact.
                    this.rootPage.NotifyUser("Simulating download...", NotifyType.StatusMessage);

                    Contact fullContact = await DownloadContactDataAsync(contact);
                    if (fullContact != null)
                    {
                        // Update the contact card with the full set of contact data.
                        dataLoader.SetData(fullContact);
                        this.rootPage.NotifyUser("Contact has been updated with downloaded data.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        this.rootPage.NotifyUser("No further information available.", NotifyType.StatusMessage);
                    }
                }
                else
                {
                    this.rootPage.NotifyUser("ShowDelayLoadedContactCard is not supported by this device.", NotifyType.ErrorMessage);
                }
                // The "using" statement will dispose the dataLoader for us.
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_DelayMini.xaml.cs.

The documentation for this class was generated from the following files:
  • ContactCards/cs/Scenario2_DelayMini.xaml.cs
  • ContactCards/cpp/Scenario2_DelayMini.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DetectInWebcam Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DetectInWebcam
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario2_DetectInWebcam Class Reference

Page for demonstrating FaceDetection on a webcam snapshot.

List of all members.

Public Member Functions

Scenario2_DetectInWebcam ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | ScenarioState { Idle, Streaming, Snapshot }

Private Member Functions

async void | CameraSnapshotButton_Click (object sender, RoutedEventArgs e)
async void | CameraStreamingButton_Click (object sender, RoutedEventArgs e)
async Task | ChangeScenarioStateAsync (ScenarioState newState)
async void | MediaCapture_CameraStreamStateChanged (MediaCapture sender, object args)
async void | OnSuspending (object sender, Windows.ApplicationModel.SuspendingEventArgs e)
void | SetupVisualization (WriteableBitmap displaySource, IList< DetectedFace > foundFaces)
async Task | ShutdownWebcamAsync ()
void | SnapshotCanvas_SizeChanged (object sender, SizeChangedEventArgs e)
async Task< bool > | StartWebcamStreamingAsync ()
async Task< bool > | TakeSnapshotAndFindFacesAsync ()

Private Attributes

ScenarioState currentState
FaceDetector | faceDetector
MediaCapture | mediaCapture
MainPage rootPage = MainPage.Current
VideoEncodingProperties | videoProperties

Detailed Description

Definition at line 32 of file Scenario2_DetectInWebcam.xaml.cs.

Member Enumeration Documentation

enum ScenarioState [private]

Values for identifying and controlling scenario states.

Enumerator:
Idle

Display is blank - default state.

Streaming

Webcam is actively engaged and a live video stream is displayed.

Snapshot

Snapshot image has been captured and is being displayed along with detected faces; webcam is not active.

Definition at line 72 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            /// <summary>
            /// Display is blank - default state.
            /// </summary>
            Idle,

            /// <summary>
            /// Webcam is actively engaged and a live video stream is displayed.
            /// </summary>
            Streaming,

            /// <summary>
            /// Snapshot image has been captured and is being displayed along with detected faces; webcam is not active.
            /// </summary>
            Snapshot
        }

Constructor & Destructor Documentation

Scenario2_DetectInWebcam ( ) [inline]

Initializes a new instance of the Scenario2_DetectInWebcam class.

Definition at line 62 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            this.InitializeComponent();

            this.currentState = ScenarioState.Idle;
        }

Member Function Documentation

async void CameraSnapshotButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles "snapshot" button clicks to take a snapshot or clear the current display.

Parameters:
sender | Button user clicked
e | Event data

Definition at line 354 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
            if (this.currentState == ScenarioState.Streaming)
            {
                await this.ChangeScenarioStateAsync(ScenarioState.Snapshot);
            }
            else
            {
                await this.ChangeScenarioStateAsync(ScenarioState.Idle);
            }
        }

async void CameraStreamingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles "streaming" button clicks to start/stop webcam streaming.

Parameters:
sender | Button user clicked
e | Event data

Definition at line 336 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
            if (this.currentState == ScenarioState.Streaming)
            {
                await this.ChangeScenarioStateAsync(ScenarioState.Idle);
            }
            else
            {
                await this.ChangeScenarioStateAsync(ScenarioState.Streaming);
            }
        }

async Task ChangeScenarioStateAsync ( ScenarioState newState ) [inline, private]

Manages the scenario's internal state.

Invokes the internal methods and updates the UI according to the passed in state value. Handles failures and resets the state if necessary.

Parameters:
newState State to switch to

Definition at line 266 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            switch (newState)
            {
                case ScenarioState.Idle:

                    this.CameraSnapshotButton.IsEnabled = false;
                    await this.ShutdownWebcamAsync();

                    this.SnapshotCanvas.Background = null;
                    this.SnapshotCanvas.Children.Clear();
                    this.CameraStreamingButton.Content = "Start Streaming";
                    this.CameraSnapshotButton.Content = "Take Snapshot";
                    this.currentState = newState;
                    break;

                case ScenarioState.Streaming:

                    if (!await this.StartWebcamStreamingAsync())
                    {
                        await this.ChangeScenarioStateAsync(ScenarioState.Idle);
                        break;
                    }

                    this.SnapshotCanvas.Background = null;
                    this.SnapshotCanvas.Children.Clear();
                    this.CameraSnapshotButton.IsEnabled = true;
                    this.CameraStreamingButton.Content = "Stop Streaming";
                    this.CameraSnapshotButton.Content = "Take Snapshot";
                    this.currentState = newState;
                    break;

                case ScenarioState.Snapshot:

                    if (!await this.TakeSnapshotAndFindFacesAsync())
                    {
                        await this.ChangeScenarioStateAsync(ScenarioState.Idle);
                        break;
                    }

                    await this.ShutdownWebcamAsync();

                    this.CameraSnapshotButton.IsEnabled = true;
                    this.CameraStreamingButton.Content = "Start Streaming";
                    this.CameraSnapshotButton.Content = "Clear Display";
                    this.currentState = newState;
                    break;
            }
        }

async void MediaCapture_CameraStreamStateChanged | ( | MediaCapture | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Handles MediaCapture changes by shutting down streaming and returning to Idle state.

Parameters:
sender | The source of the event, i.e. our MediaCapture object
args | Event data

Definition at line 321 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
            // and instead need to schedule the state change on the UI thread.
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                await ChangeScenarioStateAsync(ScenarioState.Idle);
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Called when we navigate away from this page.

Parameters:
e Event data

Definition at line 103 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            App.Current.Suspending -= this.OnSuspending;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Called when we navigate to this page.

Parameters:
e Event data

Definition at line 94 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            App.Current.Suspending += this.OnSuspending;
        }

async void OnSuspending | ( | object | sender,
 |  | Windows.ApplicationModel.SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Responds to App Suspend event to stop/release MediaCapture object if it's running and return to Idle state.

Parameters:
sender | The source of the Suspending event
e | Event data

Definition at line 113 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            if (this.currentState == ScenarioState.Streaming)
            {
                var deferral = e.SuspendingOperation.GetDeferral();
                try
                {
                    await this.ChangeScenarioStateAsync(ScenarioState.Idle);
                }
                finally
                {
                    deferral.Complete();
                }
            }
        }

void SetupVisualization | ( | WriteableBitmap | displaySource,
 |  | IList< DetectedFace > | foundFaces |
 | ) |  |  | [inline, private]

Takes the webcam image and FaceDetector results and assembles the visualization onto the Canvas.

Parameters:
displaySource | Bitmap object holding the image we're going to display
foundFaces | List of detected faces; output from FaceDetector

Definition at line 255 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            this.SnapshotCanvas.Background = new ImageBrush() { ImageSource = displaySource, Stretch = Stretch.Fill };
            MainPage.HighlightFaces(displaySource, foundFaces, this.SnapshotCanvas, this.HighlightedFaceBox);
        }

async Task ShutdownWebcamAsync ( ) [inline, private]

Safely stops webcam streaming (if running) and releases MediaCapture object.

Definition at line 178 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            if (this.mediaCapture != null)
            {
                if (this.mediaCapture.CameraStreamState == Windows.Media.Devices.CameraStreamState.Streaming)
                {
                    await this.mediaCapture.StopPreviewAsync();
                }

                this.mediaCapture.Dispose();
            }

            this.CamPreview.Source = null;
            this.mediaCapture = null;
        }

void SnapshotCanvas_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Updates any existing face bounding boxes in response to changes in the size of the Canvas.

Parameters:
sender | Canvas whose size has changed
e | Event data

Definition at line 372 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            // If the Canvas is resized we must recompute a new scaling factor and
            // apply it to each face box.
            ImageBrush brush = (ImageBrush)this.SnapshotCanvas.Background;
            if (brush != null)
            {
                MainPage.RepositionFaces((WriteableBitmap)brush.ImageSource, this.SnapshotCanvas);
            }
        }

async Task<bool> StartWebcamStreamingAsync ( ) [inline, private]

Initializes a new MediaCapture instance and starts the Preview streaming to the CamPreview UI element.

Returns:
Async Task object returning true if initialization and streaming were successful and false if an exception occurred.

Definition at line 133 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            bool successful = false;

            this.faceDetector = await FaceDetector.CreateAsync();

            try
            {
                this.mediaCapture = new MediaCapture();

                // For this scenario, we only need Video (not microphone) so specify this in the initializer.
                // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
                // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
                MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
                settings.StreamingCaptureMode = StreamingCaptureMode.Video;
                await this.mediaCapture.InitializeAsync(settings);
                this.mediaCapture.CameraStreamStateChanged += this.MediaCapture_CameraStreamStateChanged;

                // Cache the media properties as we'll need them later.
                var deviceController = this.mediaCapture.VideoDeviceController;
                this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;

                // Immediately start streaming to our CaptureElement UI.
                // NOTE: CaptureElement's Source must be set before streaming is started.
                this.CamPreview.Source = this.mediaCapture;
                await this.mediaCapture.StartPreviewAsync();

                successful = true;
            }
            catch (System.UnauthorizedAccessException)
            {
                // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
                this.rootPage.NotifyUser("Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType.ErrorMessage);
            }
            catch (Exception ex)
            {
                this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }

            return successful;
        }

async Task<bool> TakeSnapshotAndFindFacesAsync ( ) [inline, private]

Captures a single frame from the running webcam stream and executes the FaceDetector on the image.

If successful calls SetupVisualization to display the results.

Returns:
Async Task object returning true if the capture was successful and false if an exception occurred.

Definition at line 198 of file Scenario2_DetectInWebcam.xaml.cs.

        {
            if (this.currentState != ScenarioState.Streaming)
            {
                return false;
            }

            bool successful = false;

            try
            {
                // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
                // GetPreviewFrame will convert the native webcam frame into this format.
                const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
                using (VideoFrame previewFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width, (int)this.videoProperties.Height))
                {
                    await this.mediaCapture.GetPreviewFrameAsync(previewFrame);

                    // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
                    if (FaceDetector.IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap.BitmapPixelFormat))
                    {
                        IList<DetectedFace> faces = await this.faceDetector.DetectFacesAsync(previewFrame.SoftwareBitmap);

                        // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to wb's buffer.
                        // Note that WriteableBitmap doesn't support NV12 and we have to convert it to 32-bit BGRA.
                        WriteableBitmap displaySource;
                        using (SoftwareBitmap convertedSource = SoftwareBitmap.Convert(previewFrame.SoftwareBitmap, BitmapPixelFormat.Bgra8))
                        {
                            displaySource = new WriteableBitmap(convertedSource.PixelWidth, convertedSource.PixelHeight);
                            convertedSource.CopyToBuffer(displaySource.PixelBuffer);
                        }

                        // Create our display using the available image and face results.
                        this.SetupVisualization(displaySource, faces);

                        successful = true;
                    }
                    else
                    {
                        this.rootPage.NotifyUser("PixelFormat '" + InputPixelFormat.ToString() + "' is not supported by FaceDetector", NotifyType.ErrorMessage);
                    }
                }
            }
            catch (Exception ex)
            {
                this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                successful = false;
            }

            return successful;
        }

Member Data Documentation

ScenarioState currentState [private]

Holds the current scenario state value.

Definition at line 42 of file Scenario2_DetectInWebcam.xaml.cs.

FaceDetector faceDetector [private]

References a FaceDetector instance.

Definition at line 57 of file Scenario2_DetectInWebcam.xaml.cs.

MediaCapture mediaCapture [private]

References a MediaCapture instance; is null when not in Streaming state.

Definition at line 47 of file Scenario2_DetectInWebcam.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Reference back to the "root" page of the app.

Definition at line 37 of file Scenario2_DetectInWebcam.xaml.cs.

VideoEncodingProperties videoProperties [private]

Cache of properties from the current MediaCapture device which is used for capturing the preview frame.

Definition at line 52 of file Scenario2_DetectInWebcam.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicFaceDetection/cs/Scenario2_DetectInWebcam.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DeviceWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DeviceWatcher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_DeviceWatcher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_DeviceWatcher ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | StartWatcher ()
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)

Private Attributes

DeviceWatcherHelper deviceWatcherHelper
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario2_DeviceWatcher.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DeviceWatcher ( ) [inline]

Definition at line 27 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            this.InitializeComponent();

            deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            deviceWatcherHelper.Reset();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;
            selectorComboBox.ItemsSource = DeviceSelectorChoices.DeviceWatcherSelectors;
            selectorComboBox.SelectedIndex = 0;
        }

void StartWatcher ( ) [inline, private]

Definition at line 56 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            startWatcherButton.IsEnabled = false;
            resultCollection.Clear();

            // First get the device selector chosen by the UI.
            DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;

            DeviceWatcher deviceWatcher;
            if (null == deviceSelectorInfo.Selector)
            {
                // If the a pre-canned device class selector was chosen, call the DeviceClass overload
                deviceWatcher = DeviceInformation.CreateWatcher(deviceSelectorInfo.DeviceClassSelector);
            }
            else if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
            {
                // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
                // Kind will be determined by the selector
                deviceWatcher = DeviceInformation.CreateWatcher(
                    deviceSelectorInfo.Selector,
                    null // don't request additional properties for this sample
                    );
            }
            else
            {
                // Kind is specified in the selector info
                deviceWatcher = DeviceInformation.CreateWatcher(
                    deviceSelectorInfo.Selector,
                    null, // don't request additional properties for this sample
                    deviceSelectorInfo.Kind);
            }

            rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
            deviceWatcherHelper.StartWatcher(deviceWatcher);
            stopWatcherButton.IsEnabled = true;
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            StartWatcher();
        }

void StopWatcher ( ) [inline, private]

Definition at line 93 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            stopWatcherButton.IsEnabled = false;
            deviceWatcherHelper.StopWatcher();
            startWatcherButton.IsEnabled = true;
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario2_DeviceWatcher.xaml.cs.

        {
            StopWatcher();
        }

Member Data Documentation

DeviceWatcherHelper deviceWatcherHelper [private]

Definition at line 23 of file Scenario2_DeviceWatcher.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 25 of file Scenario2_DeviceWatcher.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_DeviceWatcher.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario2_DeviceWatcher.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Disable Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Disable
Public Member Functions | Protected Member Functions

Scenario2_Disable Class Reference

List of all members.

Public Member Functions

Scenario2_Disable ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 17 of file Scenario2_Disable.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Disable ( ) [inline]

Definition at line 19 of file Scenario2_Disable.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario2_Disable.xaml.cs.

        {
            // Re-enable screen capture when the user navigates away from this page.
            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = true;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 24 of file Scenario2_Disable.xaml.cs.

        {
            // Disable screen capture when the user navigates to this page.
            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
        }

The documentation for this class was generated from the following files:
  • DisablingScreenCapture/cs/Scenario2_Disable.xaml.cs
  • DisablingScreenCapture/cpp/Scenario2_Disable.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Display Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Display
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Display Class Reference

List of all members.

Public Member Functions

Scenario2_Display ()

Private Member Functions

async void PickPlaylistButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario2_Display.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Display ( ) [inline]

Definition at line 27 of file Scenario2_Display.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickPlaylistButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Displays the playlist picked by the user in the FilePicker.

Parameters:
sender
e

Definition at line 37 of file Scenario2_Display.xaml.cs.

        {
            this.rootPage.NotifyUser("", NotifyType.StatusMessage);
            Playlist playlist = await this.rootPage.PickPlaylistAsync();

            if (playlist != null)
            {
                string result = "Songs in playlist: " + playlist.Files.Count.ToString() + "\n";

                foreach (StorageFile file in playlist.Files)
                {
                    MusicProperties properties = await file.Properties.GetMusicPropertiesAsync();
                    result += "\n";
                    result += "File: " + file.Path + "\n";
                    result += "Title: " + properties.Title + "\n";
                    result += "Album: " + properties.Album + "\n";
                    result += "Artist: " + properties.Artist + "\n";
                }

                this.OutputStatus.Text = result;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario2_Display.xaml.cs.

The documentation for this class was generated from the following files:
  • Playlists/cs/Scenario2_Display.xaml.cs
  • Playlists/cpp/Scenario2_Display.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DisplayRegion Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DisplayRegion
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_DisplayRegion Class Reference

List of all members.

Public Member Functions

Scenario2_DisplayRegion ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Button_Click (object sender, RoutedEventArgs e)
DisplayRegion | GetOtherDisplayRegion (DisplayRegion currentAppDisplayRegion)
int | NumberOfAvailableDisplayRegions ()

Private Attributes

AppWindow | appWindow
Frame | appWindowFrame = new Frame()

Detailed Description

Definition at line 23 of file Scenario2_DisplayRegion.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DisplayRegion ( ) [inline]

Definition at line 28 of file Scenario2_DisplayRegion.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario2_DisplayRegion.xaml.cs.

        {
            showWindowBtn.IsEnabled = false;

            // Only ever create and show one window. If the AppWindow exists call TryShow on it to bring it to foreground.
            if (appWindow == null)
            {
                // Create a new window
                appWindow = await AppWindow.TryCreateAsync();
                // Make sure we release the reference to this window, and release XAML resources, when it's closed
                appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
                // Navigate the frame to the page we want to show in the new window
                appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
                // Attach the XAML content to our window
                ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
            }

            // Get DisplayRegion to position our window on
            DisplayRegion secondaryDisplayRegion = GetOtherDisplayRegion(ApplicationView.GetForCurrentView().GetDisplayRegions()[0]);
            if (secondaryDisplayRegion != null)
            {
                appWindow.RequestMoveToDisplayRegion(secondaryDisplayRegion);
            }

            // If the window is not visible, show it and/or bring it to foreground
            if (!appWindow.IsVisible)
            {
                await appWindow.TryShowAsync();
            }

            showWindowBtn.IsEnabled = true;
        }

DisplayRegion GetOtherDisplayRegion ( DisplayRegion currentAppDisplayRegion ) [inline, private]

Definition at line 64 of file Scenario2_DisplayRegion.xaml.cs.

        {
            // Get the list of all DisplayRegions defined for the WindowingEnvironment that our application is currently in
            IReadOnlyList<DisplayRegion> displayRegions = ApplicationView.GetForCurrentView().WindowingEnvironment.GetDisplayRegions();
            foreach (DisplayRegion displayRegion in displayRegions)
            {
                if (displayRegion != currentAppDisplayRegion && displayRegion.IsVisible)
                {
                    return displayRegion;
                }
            }

            return null;
        }

int NumberOfAvailableDisplayRegions ( ) [inline, private]

Definition at line 47 of file Scenario2_DisplayRegion.xaml.cs.

        {
            // Get the list of all DisplayRegions defined for the WindowingEnvironment that our application is currently in
            IReadOnlyList<DisplayRegion> displayRegions = ApplicationView.GetForCurrentView().WindowingEnvironment.GetDisplayRegions();

            int availableDisplayRegions = 0;
            // count all the DisplayRegions that are marked as available to the app for use.
            foreach (DisplayRegion displayregion in displayRegions)
            {
                if (displayregion.IsVisible)
                {
                    availableDisplayRegions++;
                }
            }
            return availableDisplayRegions;
        }

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_DisplayRegion.xaml.cs.

        {
            if (appWindow != null)
            {
                await appWindow.CloseAsync();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario2_DisplayRegion.xaml.cs.

        {
            // Check to see if we have more than one DisplayRegion, if not we disable the button since the scenario will not work
            showWindowBtn.IsEnabled = NumberOfAvailableDisplayRegions() > 1;
        }

Member Data Documentation

AppWindow appWindow [private]

Definition at line 25 of file Scenario2_DisplayRegion.xaml.cs.

Frame appWindowFrame = new Frame() [private]

Definition at line 26 of file Scenario2_DisplayRegion.xaml.cs.

The documentation for this class was generated from the following file:
  • AppWindow/cs/Scenario2_DisplayRegion.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DisplayText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DisplayText
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_DisplayText Class Reference

List of all members.

Public Member Functions

Scenario2_DisplayText ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisplayTextButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeAsync ()

Private Attributes

ClaimedLineDisplay | lineDisplay
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_DisplayText.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DisplayText ( ) [inline]

Definition at line 27 of file Scenario2_DisplayText.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DisplayTextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file Scenario2_DisplayText.xaml.cs.

        {
            string text = "Hello from UWP";

            var position = new Point(0, 0);
            if (CenterCheckBox.IsChecked.Value)
            {
                var length = text.Length;
                if (length < lineDisplay.DefaultWindow.SizeInCharacters.Width)
                {
                    position.X = ((int)lineDisplay.DefaultWindow.SizeInCharacters.Width - length) / 2;
                }
            }

            LineDisplayTextAttribute attribute = LineDisplayTextAttribute.Normal;

            if (BlinkCheckBox.IsChecked.Value)
            {
                attribute = LineDisplayTextAttribute.Blink;
            }

            if (await lineDisplay.DefaultWindow.TryClearTextAsync() &&
                await lineDisplay.DefaultWindow.TryDisplayTextAsync(text, attribute, position))
            {
                rootPage.NotifyUser("Text displayed successfully", NotifyType.StatusMessage);
            }
            else
            {
                // We probably lost our claim.
                rootPage.NotifyUser("Unable to display text", NotifyType.ErrorMessage);
            }
        }

task< void > InitializeAsync ( ) [inline, private]

Definition at line 43 of file Scenario2_DisplayText.xaml.cs.

        {
            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();
            BlinkCheckBox.IsEnabled = (lineDisplay != null) && (lineDisplay.Capabilities.CanBlink != LineDisplayTextAttributeGranularity.NotSupported);
            DisplayTextButton.IsEnabled = (lineDisplay != null);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario2_DisplayText.xaml.cs.

        {
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario2_DisplayText.xaml.cs.

        {
            await InitializeAsync();
        }

Member Data Documentation

ClaimedLineDisplay lineDisplay [private]

Definition at line 25 of file Scenario2_DisplayText.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_DisplayText.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario2_DisplayText.xaml.cs
  • LineDisplay/cpp/Scenario2_DisplayText.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DocumentFonts Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_DocumentFonts
Public Member Functions | Private Member Functions

Scenario2_DocumentFonts Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_DocumentFonts ()

Private Member Functions

void ApplyFonts_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 27 of file Scenario2_DocumentFonts.xaml.cs.

Constructor & Destructor Documentation

Scenario2_DocumentFonts ( ) [inline]

Definition at line 29 of file Scenario2_DocumentFonts.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ApplyFonts_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario2_DocumentFonts.xaml.cs.

        {
            var languageFontGroup = new LanguageFontGroup("hi");

            MainPage.ApplyLanguageFont(HeadingTextBlock, languageFontGroup.DocumentHeadingFont);

            // Not all scripts have recommended fonts for "document alternate"
            // categories, so need to verify before using it. Note that Hindi does
            // have document alternate fonts, so in this case the fallback logic is
            // unnecessary, but (for example) Japanese does not have recommendations
            // for the document alternate 2 category.
            MainPage.ApplyLanguageFont(DocumentTextBlock,
                languageFontGroup.DocumentAlternate2Font ??
                languageFontGroup.DocumentAlternate1Font ??
                languageFontGroup.ModernDocumentFont);
        }

The documentation for this class was generated from the following file:
  • LanguageFont/cs/Scenario2_DocumentFonts.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Effects Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Effects
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

Scenario2_Effects Class Reference

List of all members.

Public Member Functions

Scenario2_Effects ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CleanupPreviousEffect ()
void | CustomEffectButton_Click (object sender, RoutedEventArgs e)
void | CycleButton_Click (object sender, RoutedEventArgs e)
void | FadeButton_Click (object sender, RoutedEventArgs e)
void | GeneratedBitmapButton_Click (object sender, RoutedEventArgs e)
async void | LampArray_AvailabilityChanged (LampArray sender, object args)
void | PauseButton_Click (object sender, RoutedEventArgs e)
void | PlayButton_Click (object sender, RoutedEventArgs e)
async void | StaticBitmapButton_Click (object sender, RoutedEventArgs e)
void | StopButton_Click (object sender, RoutedEventArgs e)
void | UpdateLampArrayList ()
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)
async void | Watcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)

Static Private Member Functions

static void | CustomEffect_UpdateRequested (CustomEffectState state, LampArrayUpdateRequestedEventArgs args)
static void | GeneratedBitmapEffect_UpdateRequested (GeneratedBitmapState state, LampArrayBitmapRequestedEventArgs args)
static int[] | GetLampArrayIndices (LampArray lampArray)
static void | StaticBitmapEffect_BitmapRequested (SoftwareBitmap bitmap, LampArrayBitmapRequestedEventArgs args)

Private Attributes

readonly List< LampArrayInfo > | m_attachedLampArrays = new List<LampArrayInfo>()
DeviceWatcher | m_deviceWatcher
readonly IReadOnlyList
< LampArrayEffectPlaylist > 		m_emptyList = new List<LampArrayEffectPlaylist>()
Random | m_random = new Random()
IReadOnlyList
< LampArrayEffectPlaylist > 		m_readyPlaylists
MainPage rootPage = MainPage.Current

Static Private Attributes

static readonly TimeSpan | ColorRampDuration = TimeSpan.FromMilliseconds(500)
static readonly int | CustomEffectFrameCount = 30
static readonly TimeSpan | EffectUpdateInterval = TimeSpan.FromMilliseconds(33)
static readonly int | GeneratedBitmapEffectFrameCount = 60

Detailed Description

Definition at line 61 of file Scenario2_Effects.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Effects ( ) [inline]

Definition at line 81 of file Scenario2_Effects.xaml.cs.

        {
            InitializeComponent();
            m_readyPlaylists = m_emptyList;
        }

Member Function Documentation

void CleanupPreviousEffect ( ) [inline, private]

Definition at line 173 of file Scenario2_Effects.xaml.cs.

        {
            // Clear the bitmap image in the app UI, as it is no longer current.
            ImageBitmap.Source = null;

            // Passing all the playlists to a single call to StopAll will stop them
            // simultaneously across all attached LampArrays.
            LampArrayEffectPlaylist.StopAll(m_readyPlaylists);
            m_readyPlaylists = m_emptyList;
        }

static void CustomEffect_UpdateRequested | ( | CustomEffectState | state,
 |  | LampArrayUpdateRequestedEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 405 of file Scenario2_Effects.xaml.cs.

        {
            // Update the Lamp colors for the current frame. Start by calculating how far into the current iteration we are.
            // We will use this to mark how far across the LampArray bounding box the effect has reached.
            double effectProgress = (state.frameNumber + 1) / (double)CustomEffectFrameCount;

            // If Lamps were being turned off in the previous iteration, turn them on now, and vice versa.
            Color color = state.isColorOn ? state.color : Colors.Black;

            for (int i = 0; i < state.lampNormalizedX.Length; i++)
            {
                // All Lamps that are to the left of our marker (normalized to the LampArray bounding box width)
                // should have their states updated.
                if (state.lampNormalizedX[i] <= effectProgress)
                {
                    state.lampColors[i] = color;
                }
            }

            // Apply the Lamp states to the LampArray.
            args.SetColorsForIndices(state.lampColors, GetLampArrayIndices(state.lampArray));

            // Increment our frame counter, with wraparound if we've reached the frame limit.
            // Also update whether the lamps should be turned on or off for the next iteration.
            if (++state.frameNumber == CustomEffectFrameCount)
            {
                state.frameNumber = 0;
                state.isColorOn = !state.isColorOn;
            }
        }

void CustomEffectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 332 of file Scenario2_Effects.xaml.cs.

        {
            CleanupPreviousEffect();

            // This effect will use LampArrayCustomEffect to create a wave-like animation.
            // Lamps will turn on from left to right across the LampArray, then turn off in a similar manner.

            // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
            var playlists = new List<LampArrayEffectPlaylist>();

            // Create the effect playlist for each LampArray and add it to the collection.
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                LampArray lampArray = info.lampArray;
                int[] indices = GetLampArrayIndices(lampArray);
                float boundingBoxWidth = lampArray.BoundingBox.X;
                // Avoid division by zero when calculating normalized positions.
                if (boundingBoxWidth == 0.0f)
                {
                    boundingBoxWidth = 1.0f;
                }
                CustomEffectState state = new CustomEffectState()
                {
                    lampArray = lampArray,
                    lampNormalizedX = new float[lampArray.LampCount],
                    lampColors = new Color[lampArray.LampCount]
                };

                // Calculate each lamp's normalized X position relative to the width of the bounding box.
                // (zero will be the leftmost edge of the bounding box, and 1 will be the rightmost edge).
                for (int i = 0; i < state.lampNormalizedX.Length; i++)
                {
                    LampInfo lampInfo = lampArray.GetLampInfo(i);
                    state.lampNormalizedX[i] = lampInfo.Position.X / boundingBoxWidth;
                }

                var customEffect = new LampArrayCustomEffect(lampArray, indices)
                {
                    // We want to run this effect until is stopped. For the purposes of this sample,
                    // set the effect Duration to run as long as possible.
                    Duration = TimeSpan.MaxValue,

                    // The UpdateInterval specifies how frequently we want to receive our callback function.
                    // For our animation, set this interval to 33 milliseconds, which equates to approximately 30 frames per second.
                    UpdateInterval = EffectUpdateInterval
                };

                // This list will track the colors to be applied to each Lamp in the effect callback function.
                // The list is ordered by Lamp index. The ordering does not reflect positions of any Lamp.
                state.lampColors = Enumerable.Repeat(Colors.Black, state.lampArray.LampCount).ToArray();

                // This event handler will be called on every frame to update the animation.
                customEffect.UpdateRequested += (_, args) => CustomEffect_UpdateRequested(state, args);

                // Create a playlist consisting of our wave effect.
                var playlist = new LampArrayEffectPlaylist();
                playlist.Append(customEffect);

                // Add it to the list of playlists to start simultaneously.
                playlists.Add(playlist);
            }

            // Start the newly created effect playlists.
            LampArrayEffectPlaylist.StartAll(playlists);

            // Remember the playlists so we can stop them later.
            m_readyPlaylists = playlists;
        }

void CycleButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 539 of file Scenario2_Effects.xaml.cs.

        {
            CleanupPreviousEffect();

            // This effect uses LampArrayColorRampEffect to perform a rainbow cycle pattern on all Lamps.
            // We do this for each LampArray by creating a LampArrayEffectPlaylist containing four LampArrayColorRampEffects.
            // Each effect will blend from the previously set color to a new color over a 500ms interval.

            // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
            var playlists = new List<LampArrayEffectPlaylist>();

            // Create the effect playlist for each LampArray and add it to the collection.
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                var playlist = new LampArrayEffectPlaylist()
                {
                    EffectStartMode = LampArrayEffectStartMode.Sequential,
                    RepetitionMode = LampArrayRepetitionMode.Forever,
                };

                playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    Color = Colors.Red,
                    RampDuration = ColorRampDuration,
                    CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
                });

                playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    Color = Colors.Yellow,
                    RampDuration = ColorRampDuration,
                    CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
                });

                playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    Color = Colors.Green,
                    RampDuration = ColorRampDuration,
                    CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
                });

                playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    Color = Colors.Blue,
                    RampDuration = ColorRampDuration,
                    CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
                });

                // Add it to the list of playlists to start simultaneously.
                playlists.Add(playlist);
            }

            // Start the newly created effect playlists.
            LampArrayEffectPlaylist.StartAll(playlists);

            // Remember the playlists so we can stop them later.
            m_readyPlaylists = playlists;
        }

void FadeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 257 of file Scenario2_Effects.xaml.cs.

        {
            CleanupPreviousEffect();

            // This effect will set each Lamp to a random color and blink all Lamps simultaneously.
            // LampArrayBlinkEffect only supports a single color at a time. To create the desired effect with
            // different colors for each Lamp, we will create a separate LampArrayBlinkEffect for each Lamp,
            // specifying that we only want the effect to apply to a single Lamp index.
            // We will then add each Lamp effect to the playlist for its corresponding LampArray and configure the
            // playlist to run its effects simultaneously instead of sequentially.

            // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
            var playlists = new List<LampArrayEffectPlaylist>();

            // Create the effect playlist for each LampArray and add it to the collection.
            foreach (LampArrayInfo context in m_attachedLampArrays)
            {
                var playlist = new LampArrayEffectPlaylist();

                // Configure the playlist to run the effects simultaneously.
                // This will result in all Lamps for this LampArray blinking in unison,
                // even though their colors will be different.
                playlist.EffectStartMode = LampArrayEffectStartMode.Simultaneous;

                for (int i = 0; i < context.lampArray.LampCount; i++)
                {
                    // Generate a color for each Lamp by choosing a random Red/Green/Blue combination.
                    var color = new Color
                    {
                        A = byte.MaxValue, // Maximum alpha makes it opaque
                        R = (byte)(m_random.Next(byte.MaxValue + 1)),
                        G = (byte)(m_random.Next(byte.MaxValue + 1)),
                        B = (byte)(m_random.Next(byte.MaxValue + 1)),
                    };

                    // Create the effect and apply it to a single Lamp.
                    playlist.Append(new LampArrayBlinkEffect(context.lampArray, new[] { i })
                    {
                        Color = color,

                        // We can adjust the timing of the LampArrayBlinkEffect using these properties.
                        // Specify how long it should take for the full color to fade in from off/Black to peak intensity.
                        AttackDuration = TimeSpan.FromMilliseconds(300),

                        // Specify how long to display the color at peak intensity.
                        SustainDuration = TimeSpan.FromMilliseconds(500),

                        // Specify how long it should take for the full color to fade out from peak intensity to off/Black.
                        DecayDuration = TimeSpan.FromMilliseconds(800),

                        // Specify how long the Lamps should stay dark between blink repetitions.
                        RepetitionDelay = TimeSpan.FromMilliseconds(100),

                        // Repeat the blink sequence indefinitely until the effect playlist is stopped.
                        RepetitionMode = LampArrayRepetitionMode.Forever
                    });
                }

                // Add it to the list of playlists to start simultaneously.
                playlists.Add(playlist);
            }

            // Start the newly created effect playlists simultaneously.
            LampArrayEffectPlaylist.StartAll(playlists);

            // Remember the playlists so we can stop them later.
            m_readyPlaylists = playlists;
        }

void GeneratedBitmapButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 442 of file Scenario2_Effects.xaml.cs.

        {
            CleanupPreviousEffect();

            // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
            var playlists = new List<LampArrayEffectPlaylist>();

            // Create the effect playlist for each LampArray and add it to the collection.
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                GeneratedBitmapState state = new GeneratedBitmapState();

                var generatedBitmapEffect = new LampArrayBitmapEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    // We want to run this effect until is stopped. For the purposes of this sample,
                    // set the effect Duration to run as long as possible.
                    Duration = TimeSpan.MaxValue,

                    // The UpdateInterval specifies how frequently we want to receive our callback function.
                    // For our animation, set this interval to 33 milliseconds, which equates to approximately 30 frames per second.
                    UpdateInterval = EffectUpdateInterval
                };

                state.bitmapWidth = (int)generatedBitmapEffect.SuggestedBitmapSize.Width;
                state.bitmapHeight = (int)generatedBitmapEffect.SuggestedBitmapSize.Height;

                // The size of the square is half the height or half the width, whichever is smaller.
                state.squareLength = Math.Min(state.bitmapHeight, state.bitmapWidth) / 2.0f;

                // Vertically center the square.
                state.squareY = (state.bitmapHeight - state.squareLength) / 2.0f;

                // Setup our Win2D helper objects.
                state.canvasDevice = CanvasDevice.GetSharedDevice();

                state.offscreenCanvas = new CanvasRenderTarget(state.canvasDevice, state.bitmapWidth, state.bitmapHeight, 96);

                state.offscreenDrawingSession = state.offscreenCanvas.CreateDrawingSession();

                // The generated bitmap encompasses the entire LampArray
                state.squareBitmap = new SoftwareBitmap(BitmapPixelFormat.Bgra8, state.bitmapWidth, state.bitmapHeight, BitmapAlphaMode.Premultiplied);

                state.squareBuffer = new Windows.Storage.Streams.Buffer((uint)(state.bitmapWidth * state.bitmapHeight * 4));

                // This event handler will be called on every frame to update the bitmap to display on the device.
                generatedBitmapEffect.BitmapRequested += (_, args) => GeneratedBitmapEffect_UpdateRequested(state, args);

                // Create a playlist consisting of our bitmap effect.
                var playlist = new LampArrayEffectPlaylist();
                playlist.Append(generatedBitmapEffect);

                // Add it to the list of playlists to start simultaneously.
                playlists.Add(playlist);
            }

            // Start the newly created effect playlists.
            LampArrayEffectPlaylist.StartAll(playlists);

            // Remember the playlists so we can stop them later.
            m_readyPlaylists = playlists;
        }

static void GeneratedBitmapEffect_UpdateRequested | ( | GeneratedBitmapState | state,
 |  | LampArrayBitmapRequestedEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 511 of file Scenario2_Effects.xaml.cs.

        {
            // Draw a red rectangle on a blue background.
            state.offscreenDrawingSession.Clear(Colors.Blue);

            // The rectangle starts out just beyond the left edge of the keyboard,
            // then moves to the right until it just leaves the keyboard,
            // and then repeats.
            float squareX = (state.frameNumber * (state.bitmapWidth + state.squareLength) / GeneratedBitmapEffectFrameCount) - state.squareLength;
            state.offscreenDrawingSession.FillRectangle(squareX, state.squareY, state.squareLength, state.squareLength, Colors.Red);

            state.offscreenDrawingSession.Flush();

            // Apply the generated bitmap to the LampArray.
            state.offscreenCanvas.GetPixelBytes(state.squareBuffer);
            state.squareBitmap.CopyFromBuffer(state.squareBuffer);

            args.UpdateBitmap(state.squareBitmap);

            // Advance to the next frame for the next iteration.
            if (++state.frameNumber == GeneratedBitmapEffectFrameCount)
            {
                state.frameNumber = 0;
            }
        }

static int [] GetLampArrayIndices ( LampArray lampArray ) [inline, static, private]

Definition at line 616 of file Scenario2_Effects.xaml.cs.

        {
            return Enumerable.Range(0, lampArray.LampCount).ToArray();
        }

async void LampArray_AvailabilityChanged | ( | LampArray | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario2_Effects.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                UpdateLampArrayList();
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 100 of file Scenario2_Effects.xaml.cs.

        {
            m_deviceWatcher.Stop();

            // When changing scenarios, stop our effects to prevent them from interfering with the new scenario.
            CleanupPreviousEffect();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 87 of file Scenario2_Effects.xaml.cs.

        {
            UpdateLampArrayList();

            // Start watching for newly attached LampArrays.
            m_deviceWatcher = DeviceInformation.CreateWatcher(LampArray.GetDeviceSelector());

            m_deviceWatcher.Added += Watcher_Added;
            m_deviceWatcher.Removed += Watcher_Removed;

            m_deviceWatcher.Start();
        }

void PauseButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 599 of file Scenario2_Effects.xaml.cs.

        {
            LampArrayEffectPlaylist.PauseAll(m_readyPlaylists);
        }

void PlayButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 604 of file Scenario2_Effects.xaml.cs.

        {
            LampArrayEffectPlaylist.StartAll(m_readyPlaylists);
        }

async void StaticBitmapButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 185 of file Scenario2_Effects.xaml.cs.

        {
            CleanupPreviousEffect();

            // This effect will display a specified bitmap image on all connected LampArrays.
            // The image will be stretched and scaled to fit the Lamp dimensions of each LampArray.

            // First, open the desired bitmap file and convert it to a SoftwareBitmap
            Uri bitmapUri = new Uri("ms-appx:///Assets/grapes.jpg");
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(bitmapUri);
            SoftwareBitmap bitmap;
            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
            {
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
                bitmap = await decoder.GetSoftwareBitmapAsync();
            }

            // Show our bitmap image in the app UI
            ImageBitmap.Source = new BitmapImage(bitmapUri);

            // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
            var playlists = new List<LampArrayEffectPlaylist>();

            // Create the effect playlist for each LampArray and add it to the collection.
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                var bitmapEffect = new LampArrayBitmapEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
                {
                    // We want to run this effect until is stopped. For the purposes of this sample,
                    // set the effect Duration to run as long as possible.
                    Duration = TimeSpan.MaxValue,

                    // The UpdateInterval specifies how frequently we want to receive our callback function.
                    // Since this effect will display a static image, we only need to update once per effect iteration.
                    // Set this interval to be the same as the effect duration.
                    UpdateInterval = TimeSpan.MaxValue
                };

                // Set the event handler for our effect. Use a helper function to
                // to specify a bitmap to display on the device.
                bitmapEffect.BitmapRequested += (_, args) => StaticBitmapEffect_BitmapRequested(bitmap, args);

                // Create a playlist consisting of our static bitmap effect.
                var playlist = new LampArrayEffectPlaylist();
                playlist.Append(bitmapEffect);

                // Add it to the list of playlists to start simultaneously.
                playlists.Add(playlist);
            }

            // Start the newly created effect playlists simultaneously.
            LampArrayEffectPlaylist.StartAll(playlists);

            // Remember the playlists so we can stop them later.
            m_readyPlaylists = playlists;
        }

static void StaticBitmapEffect_BitmapRequested | ( | SoftwareBitmap | bitmap,
 |  | LampArrayBitmapRequestedEventArgs | args |
 | ) |  |  | [inline, static, private]

Definition at line 248 of file Scenario2_Effects.xaml.cs.

        {
            // In a BitmapRequested handler, we can change the bitmap here to produce animations.
            // For the static bitmap effect, show the same image each time.
            args.UpdateBitmap(bitmap);
        }

void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 609 of file Scenario2_Effects.xaml.cs.

        {
                LampArrayEffectPlaylist.StopAll(m_readyPlaylists);
        }

void UpdateLampArrayList ( ) [inline, private]

Definition at line 160 of file Scenario2_Effects.xaml.cs.

        {
            string message = $"Attached LampArrays: {m_attachedLampArrays.Count}\n";
            foreach (LampArrayInfo info in m_attachedLampArrays)
            {
                message += $"\t{info.displayName} ({info.lampArray.LampArrayKind.ToString()}, {info.lampArray.LampCount} lamps, " +
                           $"{(info.lampArray.IsAvailable ? "Available" : "Unavailable")})\n";
            }
            LampArraysSummary.Text = message;
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 108 of file Scenario2_Effects.xaml.cs.

        {
            var info = new LampArrayInfo(args.Id, args.Name, await LampArray.FromIdAsync(args.Id));

            // DeviceWatcher events are invoked on a background thread.
            // We need to switch to the foreground thread to update our app UI
            // and access member variables without race conditions.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (info.lampArray == null)
                {
                    // A LampArray was found, but Windows couldn't initialize it.
                    // This suggests a device error.
                    rootPage.NotifyUser($"Problem with LampArray {info.displayName}.", NotifyType.ErrorMessage);
                    return;
                }

                // Initial condition for the new LampArray is all lights off.
                info.lampArray.SetColor(Colors.Black);

                // Set up the AvailabilityChanged event callback for being notified whether this process can control
                // RGB lighting for the newly attached LampArray.
                info.lampArray.AvailabilityChanged += LampArray_AvailabilityChanged;

                m_attachedLampArrays.Add(info);

                UpdateLampArrayList();
            });
        }

async void Watcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Definition at line 138 of file Scenario2_Effects.xaml.cs.

        {
            // DeviceWatcher events are invoked on a background thread.
            // We need to switch to the foreground thread to update our app UI
            // and access member variables without race conditions.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                m_attachedLampArrays.RemoveAll(info => info.id == args.Id);
                UpdateLampArrayList();
            });
        }

Member Data Documentation

readonly TimeSpan ColorRampDuration = TimeSpan.FromMilliseconds(500) [static, private]

Definition at line 64 of file Scenario2_Effects.xaml.cs.

readonly int CustomEffectFrameCount = 30 [static, private]

Definition at line 65 of file Scenario2_Effects.xaml.cs.

readonly TimeSpan EffectUpdateInterval = TimeSpan.FromMilliseconds(33) [static, private]

Definition at line 63 of file Scenario2_Effects.xaml.cs.

readonly int GeneratedBitmapEffectFrameCount = 60 [static, private]

Definition at line 66 of file Scenario2_Effects.xaml.cs.

readonly List<LampArrayInfo> m_attachedLampArrays = new List<LampArrayInfo>() [private]

Definition at line 71 of file Scenario2_Effects.xaml.cs.

DeviceWatcher m_deviceWatcher [private]

Definition at line 68 of file Scenario2_Effects.xaml.cs.

readonly IReadOnlyList<LampArrayEffectPlaylist> m_emptyList = new List<LampArrayEffectPlaylist>() [private]

Definition at line 73 of file Scenario2_Effects.xaml.cs.

Random m_random = new Random() [private]

Definition at line 77 of file Scenario2_Effects.xaml.cs.

IReadOnlyList<LampArrayEffectPlaylist> m_readyPlaylists [private]

Definition at line 75 of file Scenario2_Effects.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 79 of file Scenario2_Effects.xaml.cs.

The documentation for this class was generated from the following file:
  • LampArray/cs/Scenario2_Effects.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Engage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Engage
Public Member Functions

Scenario2_Engage Class Reference

List of all members.

Public Member Functions

Scenario2_Engage ()

Detailed Description

Definition at line 19 of file Scenario2_Engage.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Engage ( ) [inline]

Definition at line 21 of file Scenario2_Engage.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlGamepadNavigation/cs/Scenario2_Engage.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_EventHandlers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_EventHandlers
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_EventHandlers Class Reference

See the README.md for discussion of this scenario.

List of all members.

Public Member Functions

Scenario2_EventHandlers ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | DownloadBitrateChanged (AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadBitrateChangedEventArgs args)
async void | HideDescriptionOnSmallScreen ()
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
async void | PlaybackBitrateChanged (AdaptiveMediaSource sender, AdaptiveMediaSourcePlaybackBitrateChangedEventArgs args)
void | RegisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
void | UnregisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
void | UnregisterHandlers (MediaPlayer mediaPlayer)
async Task | UpdateDownloadBitrateAsync (uint downloadBitrate)
async Task | UpdatePlaybackBitrateAsync (uint playbackBitrate)

Private Attributes

AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
BitrateHelper bitrateHelper
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger

Detailed Description

Definition at line 30 of file Scenario2_EventHandlers.xaml.cs.

Constructor & Destructor Documentation

Scenario2_EventHandlers ( ) [inline]

Definition at line 34 of file Scenario2_EventHandlers.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DownloadBitrateChanged | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourceDownloadBitrateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 228 of file Scenario2_EventHandlers.xaml.cs.

        {
            uint downloadBitrate = args.NewValue;
            await UpdateDownloadBitrateAsync(downloadBitrate);
        }

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 201 of file Scenario2_EventHandlers.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 132 of file Scenario2_EventHandlers.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                var adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                // In addition to logging, we use the callbacks to update some UI elements in this scenario:
                RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);

                // At this point, we have read the manifest of the media source, and all bitrates are known.
                bitrateHelper = new BitrateHelper(adaptiveMediaSource.AvailableBitrates);

                // The AdaptiveMediaSource chooses initial playback and download bitrates.
                // See the Tuning scenario for examples of customizing these bitrates.
                await UpdatePlaybackBitrateAsync(adaptiveMediaSource.CurrentPlaybackBitrate);
                await UpdateDownloadBitrateAsync(adaptiveMediaSource.CurrentDownloadBitrate);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);

            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");

                // In this scenario, we make a second attempt to load any URI that is
                // not adaptive streaming as a progressive download URI:
                Log($"Attempting to create a MediaSource from uri: {uri}");
                source = MediaSource.CreateFromUri(uri);
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // You can save additional information in the CustomPropertySet for future retrieval.
            // Note: MediaSource.CustomProperties is a ValueSet and therefore can store
            // only serializable types.

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = Guid.NewGuid().ToString();

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 261 of file Scenario2_EventHandlers.xaml.cs.

        {
            LoggerControl.Log(message);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_EventHandlers.xaml.cs.

        {
            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario2_EventHandlers.xaml.cs.

        {
            // Explicitly create the instance of MediaPlayer if you need to register for its events
            // (like MediaOpened / MediaFailed) prior to setting an IMediaPlaybackSource.
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
            var prHelper = new PlayReadyHelper(LoggerControl);
            prHelper.SetUpProtectionManager(mediaPlayer);
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            // This Scenario focuses on event handling, mostly via the "Logger" helper classes
            // in the Shared folder.
            //
            // In addition, the App can also insert an IHttpFilter into the Windows.Web.Http stack
            // which is used by the AdaptiveMediaSource.  To do so, it must derive a class from
            // IHttpFilter, provide the HttpBaseProtocolFilter to that class to execute requests,
            // then use the derived filter as the constructor for the HttpClient.
            //
            // The HttpClient is then used in the constructor of the AdaptiveMediaSource.
            // The App should explicitly set:
            //   CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache
            // When passing an HttpClient into the constructor of AdpativeMediaSource,
            // set this on the HttpBaseProtocolFilter.
            //
            // More than one IHttpFilter can be nested, for example, an App might
            // use a filter to modify web requests: see Scenario3 for details.
            //
            // In this scenario, we add an AdaptiveMediaSourceHttpFilterLogger to provide additional
            // verbose logging details for each request.
            var baseProtocolFilter = new HttpBaseProtocolFilter();
            baseProtocolFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;  // Always set WriteBehavior = NoCache
            var fistLevelFilter = new AdaptiveMediaSourceHttpFilterLogger(LoggerControl, baseProtocolFilter);
            var httpClient = new HttpClient(fistLevelFilter);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
                httpClient,
                LoggerControl,
                LoadSourceFromUriAsync);
        }

async void PlaybackBitrateChanged | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourcePlaybackBitrateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 243 of file Scenario2_EventHandlers.xaml.cs.

        {
            uint playbackBitrate = args.NewValue;
            await UpdatePlaybackBitrateAsync(playbackBitrate);
        }

void RegisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 214 of file Scenario2_EventHandlers.xaml.cs.

        {
            adaptiveMediaSource.DownloadBitrateChanged += DownloadBitrateChanged;
            adaptiveMediaSource.PlaybackBitrateChanged += PlaybackBitrateChanged;
        }

void UnregisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 220 of file Scenario2_EventHandlers.xaml.cs.

        {
            if (adaptiveMediaSource != null)
            {
                adaptiveMediaSource.DownloadBitrateChanged -= DownloadBitrateChanged;
                adaptiveMediaSource.PlaybackBitrateChanged -= PlaybackBitrateChanged;
            }
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 56 of file Scenario2_EventHandlers.xaml.cs.

        {
            AdaptiveMediaSource adaptiveMediaSource = null;
            MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
            if (mpItem != null)
            {
                adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
            }
            MediaSource source = mediaPlayer.Source as MediaSource;
            if (source != null)
            {
                adaptiveMediaSource = source.AdaptiveMediaSource;
            }

            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;

            UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
        }

async Task UpdateDownloadBitrateAsync ( uint downloadBitrate ) [inline, private]

Definition at line 234 of file Scenario2_EventHandlers.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                iconDownloadBitrate.Symbol = bitrateHelper.GetBitrateSymbol(downloadBitrate);
                txtDownloadBitrate.Text = downloadBitrate.ToString();
            }));
        }

async Task UpdatePlaybackBitrateAsync ( uint playbackBitrate ) [inline, private]

Definition at line 249 of file Scenario2_EventHandlers.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                iconPlaybackBitrate.Symbol = bitrateHelper.GetBitrateSymbol(playbackBitrate);
                txtPlaybackBitrate.Text = playbackBitrate.ToString();
            }));
        }

Member Data Documentation

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 268 of file Scenario2_EventHandlers.xaml.cs.

BitrateHelper bitrateHelper [private]

Definition at line 32 of file Scenario2_EventHandlers.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 267 of file Scenario2_EventHandlers.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 265 of file Scenario2_EventHandlers.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 266 of file Scenario2_EventHandlers.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario2_EventHandlers.xaml.cs
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Extend Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Extend
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Extend Class Reference

List of all members.

Public Member Functions

Scenario2_Extend ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | EnableControls_Click (object sender, RoutedEventArgs e)
void | ExtendView_Click (object sender, RoutedEventArgs e)
void | OnWindowSizeChanged (object sender, WindowSizeChangedEventArgs e)
void | ToggleFullScreenModeButton_Click (object sender, RoutedEventArgs e)
void | UpdateFullScreenModeStatus ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_Extend.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Extend ( ) [inline]

Definition at line 25 of file Scenario2_Extend.xaml.cs.

        {
            this.InitializeComponent();
            ExtendView.IsChecked = CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar;
            EnableControls.Visibility = ExtendView.IsChecked.Value ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
            EnableControls.IsChecked = rootPage.AreControlsInTitleBar;

        }

Member Function Documentation

void EnableControls_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario2_Extend.xaml.cs.

        {
            rootPage.AreControlsInTitleBar = EnableControls.IsChecked.Value;
        }

void ExtendView_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario2_Extend.xaml.cs.

        {
            bool extend = ExtendView.IsChecked.Value;
            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = extend;
            EnableControls.Visibility = extend ? Visibility.Visible : Visibility.Collapsed;
            if (extend)
            {
                rootPage.AddCustomTitleBar();
            }
            else
            {
                rootPage.RemoveCustomTitleBar();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario2_Extend.xaml.cs.

        {
            Window.Current.SizeChanged -= OnWindowSizeChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_Extend.xaml.cs.

        {
            rootPage = MainPage.Current;

            // The SizeChanged event is raised when full screen mode changes.
            Window.Current.SizeChanged += OnWindowSizeChanged;
            UpdateFullScreenModeStatus();
        }

void OnWindowSizeChanged | ( | object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 89 of file Scenario2_Extend.xaml.cs.

        {
            UpdateFullScreenModeStatus();
        }

void ToggleFullScreenModeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario2_Extend.xaml.cs.

        {
            var view = ApplicationView.GetForCurrentView();
            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
                rootPage.NotifyUser("Exited full screen mode", NotifyType.StatusMessage);
            }
            else
            {
                if (view.TryEnterFullScreenMode())
                {
                    rootPage.NotifyUser("Entered full screen mode", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Failed to enter full screen mode", NotifyType.ErrorMessage);
                }
            }
        }

void UpdateFullScreenModeStatus ( ) [inline, private]

Definition at line 94 of file Scenario2_Extend.xaml.cs.

        {
            bool isFullScreenMode = ApplicationView.GetForCurrentView().IsFullScreenMode;
            ToggleFullScreenModeSymbol.Symbol = isFullScreenMode ? Symbol.BackToWindow : Symbol.FullScreen;
            ReportFullScreenMode.Text = isFullScreenMode ? "is in" : "is not in";
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario2_Extend.xaml.cs.

The documentation for this class was generated from the following files:
  • TitleBar/cs/Scenario2_Extend.xaml.cs
  • TitleBar/cpp/Scenario2_Extend.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_FindAvailableSourceGroups Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_FindAvailableSourceGroups
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_FindAvailableSourceGroups Class Reference

List of all members.

Public Member Functions

Scenario2_FindAvailableSourceGroups ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | ChangeMediaFormatAsync (FrameFormatModel format)
async Task | CreateReaderAsync ()
void | DisposeMediaCapture ()
async void | FormatComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | GroupComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | InitializeCaptureAsync ()
void | Reader_FrameArrived (MediaFrameReader sender, MediaFrameArrivedEventArgs args)
async void | SourceComboBox_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | StartButton_Click (object sender, RoutedEventArgs e)
async Task | StartReaderAsync ()
async void | StopButton_Click (object sender, RoutedEventArgs e)
async Task | StopReaderAsync ()
async Task | UpdateButtonStateAsync ()
void | UpdateFrameSource ()

Private Attributes

FrameRenderer _frameRenderer
SourceGroupCollection _groupCollection
readonly SimpleLogger | _logger
MediaCapture | _mediaCapture
MediaFrameReader | _reader
MediaFrameSource | _source
bool | _streaming = false

Detailed Description

Definition at line 24 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

Constructor & Destructor Documentation

Scenario2_FindAvailableSourceGroups ( ) [inline]

Definition at line 35 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            InitializeComponent();
            _logger = new SimpleLogger(outputTextBlock);
            _frameRenderer = new FrameRenderer(PreviewImage);
        }

Member Function Documentation

async Task ChangeMediaFormatAsync ( FrameFormatModel format ) [inline, private]

Sets the frame format of the current frame source.

Definition at line 252 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            if (_source == null)
            {
                _logger.Log("Unable to set format when source is not set.");
                return;
            }

            // Set the source format if the selected one is different from the current one.
            if (format != null && !format.HasSameFormat(_source.CurrentFormat))
            {
                await _source.SetFormatAsync(format.Format);
                _logger.Log($"Format set to {format.DisplayName}");
            }
        }

task< void > CreateReaderAsync ( ) [inline, private]

Creates a frame reader from the current frame source and registers to handle its frame events.

Definition at line 155 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await InitializeCaptureAsync();

            UpdateFrameSource();

            if (_source != null)
            {
                // Ask the MediaFrameReader to use a subtype that we can render.
                string requestedSubtype = FrameRenderer.GetSubtypeForFrameReader(_source.Info.SourceKind, _source.CurrentFormat);
                if (requestedSubtype != null)
                {
                    _reader = await _mediaCapture.CreateFrameReaderAsync(_source, requestedSubtype);

                    _reader.FrameArrived += Reader_FrameArrived;

                    _logger.Log($"Reader created on source: {_source.Info.Id}");
                }
                else
                {
                    _logger.Log($"Cannot render current format on source: {_source.Info.Id}");
                }
            }
        }

void DisposeMediaCapture ( ) [inline, private]

Disposes of the MediaCapture object and clears the items from the Format and Source ComboBoxes.

Definition at line 69 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            FormatComboBox.ItemsSource = null;
            SourceComboBox.ItemsSource = null;

            _source = null;

            _mediaCapture?.Dispose();
            _mediaCapture = null;
        }

async void FormatComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Sets the video format for the current frame source.

Definition at line 126 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            var format = FormatComboBox.SelectedItem as FrameFormatModel;
            await ChangeMediaFormatAsync(format);
        }

async void GroupComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Stops reading from the previous selection and starts reading frames from the newly selected source group.

Definition at line 83 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await StopReaderAsync();
            DisposeMediaCapture();

            var group = GroupComboBox.SelectedItem as FrameSourceGroupModel;
            if (group != null)
            {
                await InitializeCaptureAsync();

                SourceComboBox.ItemsSource = group.SourceInfos;
                SourceComboBox.SelectedIndex = 0;
            }
        }

async Task InitializeCaptureAsync ( ) [inline, private]

Initializes the MediaCapture object with the current source group.

Definition at line 209 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            var groupModel = GroupComboBox.SelectedItem as FrameSourceGroupModel;
            if (_mediaCapture == null && groupModel != null)
            {
                // Create a new media capture object.
                _mediaCapture = new MediaCapture();

                var settings = new MediaCaptureInitializationSettings()
                {
                    // Select the source we will be reading from.
                    SourceGroup = groupModel.SourceGroup,

                    // This media capture has exclusive control of the source.
                    SharingMode = MediaCaptureSharingMode.ExclusiveControl,

                    // Set to CPU to ensure frames always contain CPU SoftwareBitmap images,
                    // instead of preferring GPU D3DSurface images.
                    MemoryPreference = MediaCaptureMemoryPreference.Cpu,

                    // Capture only video. Audio device will not be initialized.
                    StreamingCaptureMode = StreamingCaptureMode.Video,
                };

                try
                {
                    // Initialize MediaCapture with the specified group.
                    // This can raise an exception if the source no longer exists,
                    // or if the source could not be initialized.
                    await _mediaCapture.InitializeAsync(settings);
                    _logger.Log($"Successfully initialized MediaCapture for {groupModel.DisplayName}");
                }
                catch (Exception exception)
                {
                    _logger.Log(exception.Message);
                    DisposeMediaCapture();
                }
            }
        }

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 50 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            _groupCollection?.Dispose();
            await StopReaderAsync();
            DisposeMediaCapture();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

SourceGroupCollection will setup device watcher to monitor SourceGroup devices enabled or disabled from the system.

Definition at line 42 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            /// SourceGroupCollection will setup device watcher to monitor
            /// SourceGroup devices enabled or disabled from the system.
            _groupCollection = new SourceGroupCollection(this.Dispatcher);
            GroupComboBox.ItemsSource = _groupCollection.FrameSourceGroups;
        }

void Reader_FrameArrived | ( | MediaFrameReader | sender,
 |  | MediaFrameArrivedEventArgs | args |
 | ) |  |  | [inline, private]

Handles the frame arrived event by converting the frame to a displayable format and rendering it to the screen.

Definition at line 308 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
            // This can return null if there is no such frame, or if the reader is not in the
            // "Started" state. The latter can occur if a FrameArrived event was in flight
            // when the reader was stopped.
            using (var frame = sender.TryAcquireLatestFrame())
            {
                _frameRenderer.ProcessFrame(frame);
            }
        }

async void SourceComboBox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Starts reading from the newly selected source.

Definition at line 101 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await StopReaderAsync();

            if (SourceComboBox.SelectedItem != null)
            {
                await StartReaderAsync();

                // Get the formats supported by the selected source into the FormatComboBox.
                IEnumerable<FrameFormatModel> formats = null;
                if (_mediaCapture != null && _source != null)
                {
                    // Limit ourselves to formats that we can render.
                    formats = _source.SupportedFormats
                        .Where(format => FrameRenderer.GetSubtypeForFrameReader(_source.Info.SourceKind, format) != null)
                        .Select(format => new FrameFormatModel(format));
                }

                FormatComboBox.ItemsSource = formats;
            }
        }

async void StartButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Bound to the click of the Start button.

Definition at line 291 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await StartReaderAsync();
        }

task< void > StartReaderAsync ( ) [inline, private]

Starts reading frames from the current reader.

Definition at line 135 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await CreateReaderAsync();

            if (_reader != null && !_streaming)
            {
                MediaFrameReaderStartStatus result = await _reader.StartAsync();
                _logger.Log($"Start reader with result: {result}");

                if (result == MediaFrameReaderStartStatus.Success)
                {
                    _streaming = true;
                    await UpdateButtonStateAsync();
                }
            }
        }

async void StopButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Bound to the click of the Stop button.

Definition at line 299 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await StopReaderAsync();
        }

task< void > StopReaderAsync ( ) [inline, private]

Stops reading from the frame reader, disposes of the reader and updates the button state.

Definition at line 271 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            _streaming = false;

            if (_reader != null)
            {
                await _reader.StopAsync();
                _reader.FrameArrived -= Reader_FrameArrived;
                _reader.Dispose();
                _reader = null;

                _logger.Log("Reader stopped.");
            }

            await UpdateButtonStateAsync();
        }

task< void > UpdateButtonStateAsync ( ) [inline, private]

Definition at line 57 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                StartButton.IsEnabled = _source != null && !_streaming;
                StopButton.IsEnabled = _source != null && _streaming;
            });
        }

void UpdateFrameSource ( ) [inline, private]

Updates the current frame source to the one corresponding to the user's selection.

Definition at line 183 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

        {
            var info = SourceComboBox.SelectedItem as FrameSourceInfoModel;
            if (_mediaCapture != null && info != null && info.SourceGroup != null)
            {
                var groupModel = GroupComboBox.SelectedItem as FrameSourceGroupModel;
                if (groupModel == null || groupModel.Id != info.SourceGroup.Id)
                {
                    SourceComboBox.SelectedItem = null;
                    return;
                }

                if (_source == null || _source.Info.Id != info.SourceInfo.Id)
                {
                    _mediaCapture.FrameSources.TryGetValue(info.SourceInfo.Id, out _source);
                }
            }
            else
            {
                _source = null;
            }
        }

Member Data Documentation

FrameRenderer _frameRenderer [private]

Definition at line 29 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

SourceGroupCollection _groupCollection [private]

Definition at line 32 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

readonly SimpleLogger _logger [private]

Definition at line 33 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

MediaCapture _mediaCapture [private]

Definition at line 26 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

MediaFrameReader _reader [private]

Definition at line 28 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

MediaFrameSource _source [private]

Definition at line 27 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

bool _streaming = false [private]

Definition at line 30 of file Scenario2_FindAvailableSourceGroups.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraFrames/cs/Scenario2_FindAvailableSourceGroups.xaml.cs
  • CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.cpp
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetCurrentTextSegmentFromIndex Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_GetCurrentTextSegmentFromIndex
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_GetCurrentTextSegmentFromIndex Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_GetCurrentTextSegmentFromIndex ()

Private Member Functions

void | SelectionSegmentButton_Click (object sender, RoutedEventArgs e)
void | WordSegmentButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs.

Constructor & Destructor Documentation

Scenario2_GetCurrentTextSegmentFromIndex ( ) [inline]

Definition at line 28 of file Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void SelectionSegmentButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Selection Segment' button.

When this button is activated, the Text Segmentation API will calculate the selection segment from the given input string and character index for that string, and return the SelectableWordSegment object that contains the index within its text bounds. Segment breaking behavior is based off of the language-tag input, which defines which language rules to use.

Selection segments differ from word segments in that they describe the bounds between active-selection snapping behavior.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 149 of file Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs.

        {
            // Initialize and obtain input values
            StringBuilder notifyText = new StringBuilder();

            // Obtain the input string value, check for non-emptiness
            String inputStringText = inputStringBox.Text;
            if (String.IsNullOrEmpty(inputStringText))
            {
                notifyText = new StringBuilder("Cannot compute selection segments: input string is empty.");
                rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                return;
            }

            // Obtain the language tag value, check for non-emptiness
            // Ex. Valid Values:
            //     "en-US" (English (United States))
            //     "fr-FR" (French (France))
            //     "de-DE" (German (Germany))
            //     "ja-JP" (Japanese (Japan))
            //     "ar-SA" (Arabic (Saudi Arabia))
            //     "zh-CN" (China (PRC))
            String languageTagText = languageTagBox.Text;
            if (String.IsNullOrEmpty(languageTagText))
            {
                notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
                languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
            }
            else
            {
                if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
                {
                    notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Obtain the input Index
            String inputIndexString = indexBox.Text;
            uint inputIndex = 0;
            if (String.IsNullOrEmpty(inputIndexString))
            {
                notifyText.AppendLine("No input index provided ... using first segment reference (index = 0) as default.");
            }
            else
            {
                try
                {
                    inputIndex = Convert.ToUInt32(indexBox.Text);
                }
                catch (FormatException)
                {
                    notifyText = new StringBuilder("Invalid index supplied.\n\nPlease check that this value is valid, and non-negative.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
                catch (OverflowException)
                {
                    notifyText = new StringBuilder("Invalid index supplied: Negative-valued index.\n\nPlease check that this value is valid, and non-negative.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }

                if ((inputIndex < 0) || (inputIndex >= inputStringText.Length))
                {
                    notifyText = new StringBuilder("Invalid index supplied ... cannot use a negative index, or an index that is out of bounds of the input string.\n\nPlease re-check the index value, and try again.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Notify that we are going to calculate selection segment
            notifyText.AppendLine("\nFinding the selection segment for the given index ...\n");
            notifyText.AppendLine("Input: \"" + inputStringText + "\"");
            notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
            notifyText.AppendLine("Index: " + inputIndex + "\n");

            // Construct the SelectableWordsSegmenter instance
            var segmenter = new Windows.Data.Text.SelectableWordsSegmenter(languageTagText);

            // Obtain the token segment
            var tokenSegment = segmenter.GetTokenAt(inputStringText, inputIndex);
            notifyText.AppendLine("Indexed segment: \"" + tokenSegment.Text + "\"");

            // Set output box text to the contents of the StringBuilder instance
            rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
        }

void WordSegmentButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Word Segments' button.

When this button is activated, the Text Segmentation API will calculate the word segment from the given input string and character index for that string, and return the WordSegment object that contains the index within its text bounds. Segment breaking behavior is based off of the language-tag input, which defines which language rules to use.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 45 of file Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs.

        {
            // Initialize and obtain input values
            StringBuilder notifyText = new StringBuilder();

            // Obtain the input string value, check for non-emptiness
            String inputStringText = inputStringBox.Text;
            if (String.IsNullOrEmpty(inputStringText))
            {
                notifyText = new StringBuilder("Cannot compute word segments: input string is empty.");
                rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                return;
            }

            // Obtain the language tag value, check for non-emptiness
            // Ex. Valid Values:
            //     "en-US" (English (United States))
            //     "fr-FR" (French (France))
            //     "de-DE" (German (Germany))
            //     "ja-JP" (Japanese (Japan))
            //     "ar-SA" (Arabic (Saudi Arabia))
            //     "zh-CN" (China (PRC))
            String languageTagText = languageTagBox.Text;
            if (String.IsNullOrEmpty(languageTagText))
            {
                notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
                languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
            }
            else
            {
                if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
                {
                    notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Obtain the input Index
            String inputIndexString = indexBox.Text;
            uint inputIndex = 0;
            if (String.IsNullOrEmpty(inputIndexString))
            {
                notifyText.AppendLine("No input index provided ... using first segment reference (index = 0) as default.");
            }
            else
            {
                try
                {
                    inputIndex = Convert.ToUInt32(indexBox.Text);
                }
                catch (FormatException)
                {
                    notifyText = new StringBuilder("Invalid index supplied.\n\nPlease check that this value is valid, and non-negative.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
                catch (OverflowException)
                {
                    notifyText = new StringBuilder("Invalid index supplied: Negative-valued index.\n\nPlease check that this value is valid, and non-negative.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }

                if ((inputIndex < 0) || (inputIndex >= inputStringText.Length))
                {
                    notifyText = new StringBuilder("Invalid index supplied ... cannot use a negative index, or an index that is out of bounds of the input string.\n\nPlease re-check the index value, and try again.");
                    rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
                    return;
                }
            }

            // Notify that we are going to calculate word segment
            notifyText.AppendLine("\nFinding the word segment for the given index ...\n");
            notifyText.AppendLine("Input: \"" + inputStringText + "\"");
            notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
            notifyText.AppendLine("Index: " + inputIndex + "\n");

            // Construct the WordsSegmenter instance
            var segmenter = new Windows.Data.Text.WordsSegmenter(languageTagText);

            // Obtain the token segment
            var tokenSegment = segmenter.GetTokenAt(inputStringText, inputIndex);
            notifyText.AppendLine("Indexed segment: \"" + tokenSegment.Text + "\"");

            // Set output box text to the contents of the StringBuilder instance
            rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs.

The documentation for this class was generated from the following files:
  • TextSegmentation/cs/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs
  • TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetPosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_GetPosition
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_GetPosition Class Reference

List of all members.

Public Member Functions

Scenario2_GetPosition ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | CancelGetGeolocationButtonClicked (object sender, RoutedEventArgs e)
async void | GetGeolocationButtonClicked (object sender, RoutedEventArgs e)
void | ShowSatelliteData (bool isVisible)
void | UpdateLocationData (Geoposition position)

Private Attributes

CancellationTokenSource | _cts = null
MainPage _rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_GetPosition.xaml.cs.

Constructor & Destructor Documentation

Scenario2_GetPosition ( ) [inline]

Definition at line 29 of file Scenario2_GetPosition.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CancelGetGeolocationButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'CancelGetGeolocation' button.

Parameters:
sender
e

Definition at line 115 of file Scenario2_GetPosition.xaml.cs.

        {
            if (_cts != null)
            {
                _cts.Cancel();
                _cts = null;
            }

            GetGeolocationButton.IsEnabled = true;
            CancelGetGeolocationButton.IsEnabled = false;
        }

async void GetGeolocationButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'getGeolocation' button.

Parameters:
sender
e

Definition at line 48 of file Scenario2_GetPosition.xaml.cs.

        {
            GetGeolocationButton.IsEnabled = false;
            CancelGetGeolocationButton.IsEnabled = true;
            LocationDisabledMessage.Visibility = Visibility.Collapsed;

            try
            {
                // Request permission to access location
                var accessStatus = await Geolocator.RequestAccessAsync();

                switch (accessStatus)
                {
                    case GeolocationAccessStatus.Allowed:

                        // Get cancellation token
                        _cts = new CancellationTokenSource();
                        CancellationToken token = _cts.Token;

                        _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);

                        // If DesiredAccuracy or DesiredAccuracyInMeters are not set (or value is 0), DesiredAccuracy.Default is used.
                        uint desiredAccuracyInMetersValue;
                        uint.TryParse(DesiredAccuracyInMeters.Text, out desiredAccuracyInMetersValue);
                        Geolocator geolocator = new Geolocator { DesiredAccuracyInMeters = desiredAccuracyInMetersValue };

                        // Carry out the operation
                        Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);

                        UpdateLocationData(pos);
                        _rootPage.NotifyUser("Location updated.", NotifyType.StatusMessage);
                        break;

                    case GeolocationAccessStatus.Denied:
                        _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                        LocationDisabledMessage.Visibility = Visibility.Visible;
                        UpdateLocationData(null);
                        break;

                    case GeolocationAccessStatus.Unspecified:
                        _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
                        UpdateLocationData(null);
                        break;
                }
            }
            catch (TaskCanceledException)
            {
                _rootPage.NotifyUser("Canceled.", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                _cts = null;
            }

            GetGeolocationButton.IsEnabled = true;
            CancelGetGeolocationButton.IsEnabled = false;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_GetPosition.xaml.cs.

        {
            if (_cts != null)
            {
                _cts.Cancel();
                _cts = null;
            }
        }

void ShowSatelliteData ( bool isVisible ) [inline, private]

Definition at line 168 of file Scenario2_GetPosition.xaml.cs.

        {
            var visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
            ScenarioOutput_PosPrecision.Visibility = visibility;
            ScenarioOutput_HorzPrecision.Visibility = visibility;
            ScenarioOutput_VertPrecision.Visibility = visibility;
            ScenarioOutput_GeomPrecision.Visibility = visibility;
            ScenarioOutput_TimePrecision.Visibility = visibility;
        }

void UpdateLocationData ( Geoposition position ) [inline, private]

Updates the user interface with the Geoposition data provided.

Parameters:
position Geoposition to display its details

Definition at line 131 of file Scenario2_GetPosition.xaml.cs.

        {
            if (position == null)
            {
                ScenarioOutput_Latitude.Text = "No data";
                ScenarioOutput_Longitude.Text = "No data";
                ScenarioOutput_Accuracy.Text = "No data";
                ScenarioOutput_Source.Text = "No data";
                ScenarioOutput_IsRemoteSource.Text = "No data";
                ShowSatelliteData(false);
            }
            else
            {
                ScenarioOutput_Latitude.Text = position.Coordinate.Point.Position.Latitude.ToString();
                ScenarioOutput_Longitude.Text = position.Coordinate.Point.Position.Longitude.ToString();
                ScenarioOutput_Accuracy.Text = position.Coordinate.Accuracy.ToString();
                ScenarioOutput_Source.Text = position.Coordinate.PositionSource.ToString();
                ScenarioOutput_IsRemoteSource.Text = position.Coordinate.IsRemoteSource.ToString();

                if (position.Coordinate.PositionSource == PositionSource.Satellite)
                {
                    // Show labels and satellite data when available
                    ScenarioOutput_PosPrecision.Text = position.Coordinate.SatelliteData.PositionDilutionOfPrecision.ToString();
                    ScenarioOutput_HorzPrecision.Text = position.Coordinate.SatelliteData.HorizontalDilutionOfPrecision.ToString();
                    ScenarioOutput_VertPrecision.Text = position.Coordinate.SatelliteData.VerticalDilutionOfPrecision.ToString();
                    ScenarioOutput_GeomPrecision.Text = position.Coordinate.SatelliteData.GeometricDilutionOfPrecision.ToString();
                    ScenarioOutput_TimePrecision.Text = position.Coordinate.SatelliteData.TimeDilutionOfPrecision.ToString();
                    ShowSatelliteData(true);
                }
                else
                {
                    // Hide labels and satellite data
                    ShowSatelliteData(false);
                }
            }
        }

Member Data Documentation

CancellationTokenSource _cts = null [private]

Definition at line 24 of file Scenario2_GetPosition.xaml.cs.

MainPage _rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario2_GetPosition.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario2_GetPosition.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_History Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_History
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_History Class Reference

List of all members.

Public Member Functions

Scenario2_History ()

Private Member Functions

async void | ScenarioGetActivityHistory (object sender, RoutedEventArgs e)

Private Attributes

Guid | ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196")
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_History.xaml.cs.

Constructor & Destructor Documentation

Scenario2_History ( ) [inline]

Definition at line 30 of file Scenario2_History.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ScenarioGetActivityHistory | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Get Activity History' button.

Parameters:
sender
e

Definition at line 40 of file Scenario2_History.xaml.cs.

        {
            // Reset fields and status
            ScenarioOutput_Count.Text = "No data";
            ScenarioOutput_Activity1.Text = "No data";
            ScenarioOutput_Confidence1.Text = "No data";
            ScenarioOutput_Timestamp1.Text = "No data";
            ScenarioOutput_ActivityN.Text = "No data";
            ScenarioOutput_ConfidenceN.Text = "No data";
            ScenarioOutput_TimestampN.Text = "No data";
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Determine if we can access activity sensors
            var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
            if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                // Determine if an activity sensor is present
                // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
                var activitySensor = await ActivitySensor.GetDefaultAsync();
                if (activitySensor != null)
                {
                    var calendar = new Calendar();
                    calendar.SetToNow();
                    calendar.AddDays(-1);
                    var yesterday = calendar.GetDateTime();

                    // Get history from yesterday onwards
                    var history = await ActivitySensor.GetSystemHistoryAsync(yesterday);

                    ScenarioOutput_Count.Text = history.Count.ToString();
                    if (history.Count > 0)
                    {
                        var reading1 = history[0];
                        ScenarioOutput_Activity1.Text = reading1.Activity.ToString();
                        ScenarioOutput_Confidence1.Text = reading1.Confidence.ToString();
                        ScenarioOutput_Timestamp1.Text = reading1.Timestamp.ToString("u");

                        var readingN = history[history.Count - 1];
                        ScenarioOutput_ActivityN.Text = readingN.Activity.ToString();
                        ScenarioOutput_ConfidenceN.Text = readingN.Confidence.ToString();
                        ScenarioOutput_TimestampN.Text = readingN.Timestamp.ToString("u");
                    }
                }
                else
                {
                    rootPage.NotifyUser("No activity sensors found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access to activity sensors is denied", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196") [private]

Definition at line 28 of file Scenario2_History.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario2_History.xaml.cs.

The documentation for this class was generated from the following files:
  • ActivitySensor/cs/Scenario2_History.xaml.cs
  • ActivitySensor/cpp/Scenario2_History.xaml.cpp
  • Pedometer/cpp/Scenario2_History.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_InAppPurchase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_InAppPurchase
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_InAppPurchase Class Reference

List of all members.

Public Member Functions

Scenario2_InAppPurchase ()

Private Member Functions

async void | GetAssociatedProductsButton_Click (object sender, RoutedEventArgs e)
async void | PurchaseAddOnButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()

Detailed Description

Definition at line 19 of file Scenario2_InAppPurchase.xaml.cs.

Constructor & Destructor Documentation

Scenario2_InAppPurchase ( ) [inline]

Definition at line 24 of file Scenario2_InAppPurchase.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetAssociatedProductsButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario2_InAppPurchase.xaml.cs.

        {
            // Create a filtered list of the product AddOns I care about
            string[] filterList = new string[] { "Consumable", "Durable", "UnmanagedConsumable" };

            // Get list of Add Ons this app can sell, filtering for the types we know about
            StoreProductQueryResult addOns = await storeContext.GetAssociatedStoreProductsAsync(filterList);

            ProductsListView.ItemsSource = Utils.CreateProductListFromQueryResult(addOns, "Add-Ons");
        }

async void PurchaseAddOnButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario2_InAppPurchase.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            StorePurchaseResult result = await storeContext.RequestPurchaseAsync(item.StoreId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StorePurchaseStatus.AlreadyPurchased:
                    rootPage.NotifyUser($"You already bought this AddOn.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.Succeeded:
                    rootPage.NotifyUser($"You bought {item.Title}.", NotifyType.StatusMessage);
                    break;

                case StorePurchaseStatus.NotPurchased:
                    rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.NetworkError:
                    rootPage.NotifyUser("Product was not purchased due to a network error.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.ServerError:
                    rootPage.NotifyUser("Product was not purchased due to a server error.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Product was not purchased due to an unknown error.", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_InAppPurchase.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 22 of file Scenario2_InAppPurchase.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario2_InAppPurchase.xaml.cs
  • Store/cpp/Scenario2_InAppPurchase.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Lang Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Lang
Public Member Functions | Private Member Functions

Scenario2_Lang Class Reference

List of all members.

Public Member Functions

Scenario2_Lang ()

Private Member Functions

string | ReportLanguageData (Language lang)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario2_Lang.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Lang ( ) [inline]

Definition at line 21 of file Scenario2_Lang.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportLanguageData ( Language lang ) [inline, private]

Definition at line 26 of file Scenario2_Lang.xaml.cs.

        {
            return "Display Name: " + lang.DisplayName + "\n" +
                "Language Tag: " + lang.LanguageTag + "\n" +
                "Native Name: " + lang.NativeName + "\n" +
                "Script Code: " + lang.Script + "\n\n";
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario2_Lang.xaml.cs.

        {
            // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
            // obtain the user's preferred language characteristics.
            var topUserLanguage = Windows.System.UserProfile.GlobalizationPreferences.Languages[0];
            var userLanguage = new Language(topUserLanguage);

            // This obtains the language characteristics by providing a BCP47 tag.
            var exampleLanguage = new Language("ja");

            // Display the results
            OutputTextBlock.Text = "User's Preferred Language\n" + ReportLanguageData(userLanguage) +
                "Example Language by BCP47 tag (ja)\n" + ReportLanguageData(exampleLanguage);
        }

The documentation for this class was generated from the following files:
  • GlobalizationPreferences/cs/Scenario2_Lang.xaml.cs
  • GlobalizationPreferences/cpp/Scenario2_Lang.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Launch Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Launch
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario2_Launch Class Reference

List of all members.

Public Member Functions

Scenario2_Launch ()
Scenario2_Launch ()
Scenario2_Launch ()

Private Member Functions

async void | CheckIf3DBuilderIsInstalled_Click (object sender, RoutedEventArgs e)
void | LaunchAtSize_Click (object sender, RoutedEventArgs e)
async void | LaunchFileIn3DBuilder_Click (object sender, RoutedEventArgs e)
void | LaunchInFullScreenModeCheckBox_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Static Private Attributes

static string | PackageFamilyName3DBuilder = "Microsoft.3DBuilder_8wekyb3d8bbwe"

Detailed Description

Definition at line 25 of file Scenario2_Launch.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Launch ( ) [inline]

Definition at line 31 of file Scenario2_Launch.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2_Launch ( ) [inline]

Definition at line 20 of file Scenario2_Launch.xaml.cs.

        {
            this.InitializeComponent();
            LaunchInFullScreenModeCheckBox.IsChecked = ApplicationView.PreferredLaunchWindowingMode == ApplicationViewWindowingMode.FullScreen;
        }

Scenario2_Launch ( ) [inline]

Definition at line 21 of file Scenario2_Launch.xaml.cs.

        {
            this.InitializeComponent();
            LaunchAtSize.IsChecked = ApplicationView.PreferredLaunchWindowingMode != ApplicationViewWindowingMode.Auto;
        }

Member Function Documentation

async void CheckIf3DBuilderIsInstalled_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario2_Launch.xaml.cs.

        {
            IReadOnlyList<AppInfo> handlers = await Launcher.FindFileHandlersAsync(".3mf");
            if (handlers.Any(info => info.PackageFamilyName == PackageFamilyName3DBuilder))
            {
                rootPage.NotifyUser("3D Builder is installed", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("3D Builder is not installed", NotifyType.ErrorMessage);
            }
        }

void LaunchAtSize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario2_Launch.xaml.cs.

        {
            if (LaunchAtSize.IsChecked.Value)
            {
                // For best results, set the PreferredLaunchViewSize before setting
                // the PreferredLaunchWindowingMode.
                ApplicationView.PreferredLaunchViewSize = new Size { Width = 600, Height = 500 };
                ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
            }
            else
            {
                ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
            }
        }

async void LaunchFileIn3DBuilder_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario2_Launch.xaml.cs.

        {
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            openPicker.FileTypeFilter.Add(".3mf");
            openPicker.FileTypeFilter.Add(".stl");

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file == null)
            {
                return;
            }

            var options = new LauncherOptions();

            // The target application is 3D Builder.
            options.TargetApplicationPackageFamilyName = PackageFamilyName3DBuilder;

            // If 3D Builder is not installed, redirect the user to the Store to install it.
            options.FallbackUri = new Uri("ms-windows-store:PDP?PFN=" + PackageFamilyName3DBuilder);

            await Launcher.LaunchFileAsync(file, options);
        }

void LaunchInFullScreenModeCheckBox_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario2_Launch.xaml.cs.

        {
            ApplicationView.PreferredLaunchWindowingMode = LaunchInFullScreenModeCheckBox.IsChecked.Value ? ApplicationViewWindowingMode.FullScreen : ApplicationViewWindowingMode.Auto;
        }

Member Data Documentation

string PackageFamilyName3DBuilder = "Microsoft.3DBuilder_8wekyb3d8bbwe" [static, private]

Definition at line 27 of file Scenario2_Launch.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario2_Launch.xaml.cs.

The documentation for this class was generated from the following files:
  • 3DPrinting/cs/Scenario2_Launch.xaml.cs
  • FullScreenMode/cs/Scenario2_Launch.xaml.cs
  • ResizeAppView/cs/Scenario2_Launch.xaml.cs
  • FullScreenMode/cpp/Scenario2_Launch.xaml.cpp
  • ResizeAppView/cpp/Scenario2_Launch.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_LaunchUri Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_LaunchUri
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_LaunchUri Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_LaunchUri ()
Scenario2_LaunchUri ()

Public Attributes

ObservableCollection
< RemoteSystem > 		SystemList = > m_rootPage.systemList

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Launch_Clicked (object sender, RoutedEventArgs e)
async void | LaunchUriDefault ()
async void | LaunchUriOpenWith (object sender, RoutedEventArgs e)
async void | LaunchUriSplitScreen ()
async void | LaunchUriWithWarning ()
void | UpdateStatus (string status, NotifyType statusType)

Private Attributes

MainPage m_rootPage
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario2_LaunchUri.xaml.cs.

Constructor & Destructor Documentation

Scenario2_LaunchUri ( ) [inline]

Definition at line 30 of file Scenario2_LaunchUri.xaml.cs.

        {
            this.InitializeComponent();
            ViewPreference.ItemsSource = MainPage.ViewSizePreferences;
            ViewPreference.SelectedIndex = 0;
        }

Scenario2_LaunchUri ( ) [inline]

Definition at line 26 of file Scenario2_LaunchUri.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

async void Launch_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario2_LaunchUri.xaml.cs.

        {
            RemoteSystem selectedSystem = SystemListComboBox.SelectedItem as RemoteSystem;
            if (selectedSystem != null)
            {
                Uri uri;
                if (Uri.TryCreate(UriTextBox.Text, UriKind.Absolute, out uri))
                {
                    UpdateStatus("LaunchUriAsync called. Waiting for response...", NotifyType.StatusMessage);

                    // Launch URI on the remote system.
                    // Note: LaunchUriAsync needs to called from the UI thread.
                    RemoteLaunchUriStatus launchUriStatus = await RemoteLauncher.LaunchUriAsync(new RemoteSystemConnectionRequest(selectedSystem), uri);

                    UpdateStatus("LaunchUriStatus = " + launchUriStatus.ToString(), launchUriStatus == RemoteLaunchUriStatus.Success ? NotifyType.StatusMessage : NotifyType.ErrorMessage);
                }
                else
                {
                    UpdateStatus("Please enter a valid URI.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                UpdateStatus("Please select a system.", NotifyType.ErrorMessage);
            }
        }

async void LaunchUriDefault ( ) [inline, private]

Definition at line 40 of file Scenario2_LaunchUri.xaml.cs.

        {
            // Create the URI to launch from a string.
            var uri = new Uri(UriToLaunch.Text);

            // Launch the URI.
            bool success = await Launcher.LaunchUriAsync(uri);
            if (success)
            {
                rootPage.NotifyUser("URI launched: " + uri.AbsoluteUri, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("URI launch failed.", NotifyType.ErrorMessage);
            }
        }

async void LaunchUriOpenWith | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario2_LaunchUri.xaml.cs.

        {
            // Create the URI to launch from a string.
            var uri = new Uri(UriToLaunch.Text);

            // Calulcate the position for the Open With dialog.
            // An alternative to using the point is to set the rect of the UI element that triggered the launch.
            Point openWithPosition = MainPage.GetElementLocation(sender);

            // Next, configure the Open With dialog.
            var options = new LauncherOptions();
            options.DisplayApplicationPicker = true;
            options.UI.InvocationPoint = openWithPosition;
            options.UI.PreferredPlacement = Windows.UI.Popups.Placement.Below;

            // Launch the URI.
            bool success = await Launcher.LaunchUriAsync(uri, options);
            if (success)
            {
                rootPage.NotifyUser("URI launched: " + uri.AbsoluteUri, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("URI launch failed.", NotifyType.ErrorMessage);
            }
        }

async void LaunchUriSplitScreen ( ) [inline, private]

Definition at line 113 of file Scenario2_LaunchUri.xaml.cs.

        {
            // Create the URI to launch from a string.
            var uri = new Uri(UriToLaunch.Text);

            // Configure the request for split screen launch.
            var options = new LauncherOptions() { DesiredRemainingView = (ViewSizePreference)ViewPreference.SelectedValue };

            // Launch the URI.
            bool success = await Launcher.LaunchUriAsync(uri, options);
            if (success)
            {
                rootPage.NotifyUser("URI launched: " + uri.AbsoluteUri, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("URI launch failed.", NotifyType.ErrorMessage);
            }
        }

async void LaunchUriWithWarning ( ) [inline, private]

Definition at line 60 of file Scenario2_LaunchUri.xaml.cs.

        {
            // Create the URI to launch from a string.
            var uri = new Uri(UriToLaunch.Text);

            // Configure the warning prompt.
            var options = new LauncherOptions() { TreatAsUntrusted = true };

            // Launch the URI.
            bool success = await Launcher.LaunchUriAsync(uri, options);
            if (success)
            {
                rootPage.NotifyUser("URI launched: " + uri.AbsoluteUri, NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("URI launch failed.", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario2_LaunchUri.xaml.cs.

        {
            m_rootPage = MainPage.Current;
            m_rootPage.ValidateSystemDiscovery();
        }

void UpdateStatus | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario2_LaunchUri.xaml.cs.

        {
            m_rootPage.NotifyUser(status, statusType);
        }

Member Data Documentation

MainPage m_rootPage [private]

Definition at line 24 of file Scenario2_LaunchUri.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_LaunchUri.xaml.cs.

ObservableCollection<RemoteSystem> SystemList = > m_rootPage.systemList

Definition at line 38 of file Scenario2_LaunchUri.xaml.cs.

The documentation for this class was generated from the following files:
  • AssociationLaunching/cs/Scenario2_LaunchUri.xaml.cs
  • RemoteSystems/cs/Scenario2_LaunchUri.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Listen Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Listen
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Listen Class Reference

Scenario describing how to listen for changes to a GPIO pin value. More...

List of all members.

Public Member Functions

Scenario2_Listen ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | Pin_ValueChanged (GpioPin sender, GpioPinValueChangedEventArgs e)
void | StartScenario ()
void | StartStopScenario_Click (object sender, RoutedEventArgs e)
void | StopScenario ()
void | Timer_Tick (object sender, object e)

Private Attributes

GpioPinValue | currentValue = GpioPinValue.High
const int | LISTEN_PIN = 6
GpioPin | listenPin
const int | SET_PIN = 5
GpioPin | setPin
DispatcherTimer | timer

Detailed Description

Definition at line 24 of file Scenario2_Listen.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Listen ( ) [inline]

Definition at line 37 of file Scenario2_Listen.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario2_Listen.xaml.cs.

        {
            StopScenario();
        }

void Pin_ValueChanged | ( | GpioPin | sender,
 |  | GpioPinValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 113 of file Scenario2_Listen.xaml.cs.

        {
            // Report the change in pin value.
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                CurrentPinValue.Text = listenPin.Read().ToString();
            });
        }

void StartScenario ( ) [inline, private]

Definition at line 47 of file Scenario2_Listen.xaml.cs.

        {
            // Initialize the GPIO objects.
            var gpio = GpioController.GetDefault();

            // Set up our GPIO pin for setting values.
            // If this next line crashes with a NullReferenceException,
            // then the problem is that there is no GPIO controller on the device.
            setPin = gpio.OpenPin(SET_PIN);

            // Establish initial value and configure pin for output.
            setPin.Write(currentValue);
            setPin.SetDriveMode(GpioPinDriveMode.Output);

            // Set up our GPIO pin for listening for value changes.
            listenPin = gpio.OpenPin(LISTEN_PIN);

            // Configure pin for input and add ValueChanged listener.
            listenPin.SetDriveMode(GpioPinDriveMode.Input);
            listenPin.ValueChanged += Pin_ValueChanged;

            // Start toggling the pin value every 500ms.
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(500);
            timer.Tick += Timer_Tick;
            timer.Start();
        }

void StartStopScenario_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 98 of file Scenario2_Listen.xaml.cs.

        {
            if (timer != null)
            {
                StopScenario();
                StartStopButton.Content = "Start";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                StartScenario();
                StartStopButton.Content = "Stop";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

void StopScenario ( ) [inline, private]

Definition at line 75 of file Scenario2_Listen.xaml.cs.

        {
            // Stop the timer.
            if (timer != null)
            {
                timer.Stop();
                timer = null;
            }

            // Release the GPIO pins.
            if (setPin != null)
            {
                setPin.Dispose();
                setPin = null;
            }
            if (listenPin != null)
            {
                listenPin.ValueChanged -= Pin_ValueChanged;
                listenPin.Dispose();
                listenPin = null;
            }
        }

void Timer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 122 of file Scenario2_Listen.xaml.cs.

        {
            // Toggle the existing pin value.
            currentValue = (currentValue == GpioPinValue.High) ? GpioPinValue.Low : GpioPinValue.High;
            setPin.Write(currentValue);
        }

Member Data Documentation

GpioPinValue currentValue = GpioPinValue.High [private]

Definition at line 34 of file Scenario2_Listen.xaml.cs.

const int LISTEN_PIN = 6 [private]

Definition at line 31 of file Scenario2_Listen.xaml.cs.

GpioPin listenPin [private]

Definition at line 32 of file Scenario2_Listen.xaml.cs.

const int SET_PIN = 5 [private]

Definition at line 27 of file Scenario2_Listen.xaml.cs.

GpioPin setPin [private]

Definition at line 28 of file Scenario2_Listen.xaml.cs.

DispatcherTimer timer [private]

Definition at line 35 of file Scenario2_Listen.xaml.cs.

The documentation for this class was generated from the following files:
  • IoT-GPIO/cs/Scenario2_Listen.xaml.cs
  • IoT-GPIO/cpp/Scenario2_Listen.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Load Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Load
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Load Class Reference

List of all members.

Public Member Functions

Scenario2_Load ()

Private Member Functions

void | MessageTextBox_KeyUp (object sender, KeyRoutedEventArgs e)
void | OnChatViewContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
async void | SendTextMessage ()

Private Attributes

readonly Conversation | conversation = new Conversation()

Detailed Description

Definition at line 224 of file Scenario2_Load.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Load ( ) [inline]

Definition at line 228 of file Scenario2_Load.xaml.cs.

        {
            this.InitializeComponent();

            chatView.ItemsSource = this.conversation;

            chatView.ContainerContentChanging += OnChatViewContainerContentChanging;
        }

Member Function Documentation

void MessageTextBox_KeyUp | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 268 of file Scenario2_Load.xaml.cs.

        {
            if (e.Key == VirtualKey.Enter)
            {
                this.SendTextMessage();
            }
        }

void OnChatViewContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 261 of file Scenario2_Load.xaml.cs.

        {
            if (args.InRecycleQueue) return;
            TextMessage message = (TextMessage)args.Item;
            args.ItemContainer.HorizontalAlignment = message.IsSent ? Windows.UI.Xaml.HorizontalAlignment.Right : Windows.UI.Xaml.HorizontalAlignment.Left;
        }

void SendTextMessage ( ) [inline, private]

Definition at line 237 of file Scenario2_Load.xaml.cs.

        {
            if (MessageTextBox.Text.Length > 0)
            {
                this.conversation.Add(new TextMessage
                {
                    Body = MessageTextBox.Text,
                    DisplayTime = DateTime.Now.ToString(),
                    IsSent = true
                });
                MessageTextBox.Text = string.Empty;

                // Send a simulated reply after a brief delay.
                await Task.Delay(TimeSpan.FromSeconds(2));

                this.conversation.Add(new TextMessage
                {
                    Body = Conversation.CreateRandomMessage(),
                    DisplayTime = DateTime.Now.ToString(),
                    IsSent = false
                });
            }
        }

Member Data Documentation

readonly Conversation conversation = new Conversation() [private]

Definition at line 226 of file Scenario2_Load.xaml.cs.

The documentation for this class was generated from the following files:
  • XamlBottomUpList/cs/Scenario2_Load.xaml.cs
  • XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Manage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Manage
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Manage Class Reference

List of all members.

Public Member Functions

Scenario2_Manage ()

Private Member Functions

void | RemoveCredentials_Click (Object sender, RoutedEventArgs args)
void | RetrieveCredentials_Click (Object sender, RoutedEventArgs args)
void | RevealPasswords_Click (Object sender, RoutedEventArgs args)

Private Attributes

const int | ElementNotFound = unchecked((int)0x80070490)
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_Manage.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Manage ( ) [inline]

Definition at line 27 of file Scenario2_Manage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void RemoveCredentials_Click | ( | Object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 143 of file Scenario2_Manage.xaml.cs.

        {
            IList<object> selectedItems = RetrievedCredentials.SelectedItems;
            if (selectedItems.Count > 0)
            {
                var vault = new PasswordVault();
                int removedCount = 0;

                // Take a snapshot of the selectedOptions collection because we will be
                // changing the collection during the loop.
                var snapshot = new List<object>(selectedItems);

                foreach (object o in snapshot)
                {
                    TextBlock item = (TextBlock)o;
                    PasswordCredential cred = (PasswordCredential)item.DataContext;
                    RetrievedCredentials.Items.Remove(o);

                    try
                    {
                        vault.Remove(cred);
                        removedCount++;
                    }
                    catch (Exception e)
                    {
                        // Ignore exception if the credential was already removed.
                        if (e.HResult != ElementNotFound)
                        {
                            throw;
                        }
                    }
                }
                rootPage.NotifyUser("Credentials removed: " + removedCount.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("No credentials selected", NotifyType.ErrorMessage);
            }
        }

void RetrieveCredentials_Click | ( | Object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario2_Manage.xaml.cs.

        {
            var resource = InputResourceValue.Text;
            var userName = InputUserNameValue.Text;

            // Clear previous output.
            RetrievedCredentials.Items.Clear();
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            var vault = new PasswordVault();
            IReadOnlyList<PasswordCredential> creds = null;

            // The credential retrieval functions raise an "Element not found"
            // exception if there were no matches.
            try
            {
                // Perform the desired queryuserName
                if (resource == "" && userName == "")
                {
                    // Both resource and user name are empty: Use retrieveAll().
                    creds = vault.RetrieveAll();
                }
                else if (userName == "")
                {
                    // Resource is provided but no user name: Use findAllByResource().
                    creds = vault.FindAllByResource(resource);
                }
                else if (resource == "")
                {
                    // User name is provided but no resource: Use findByUserName().
                    creds = vault.FindAllByUserName(userName);
                }
                else
                {
                    // Both resource and user name are provided: Use retrieve().
                    PasswordCredential cred = vault.Retrieve(resource, userName);
                    // Add it to our results if the retrieval was successful.
                    if (cred != null)
                    {
                        creds = new List<PasswordCredential>() { cred };
                    }
                }
            }
            catch (Exception e)
            {
                if (e.HResult != ElementNotFound)
                {
                    throw;
                }
            }

            // Display the results. Note that the password field is initially blank.
            // You must call retrievePassword() to get the password.

            if (creds == null || creds.Count == 0)
            {
                rootPage.NotifyUser("No matching credentials", NotifyType.ErrorMessage);
            }
            else
            {
                ItemCollection items = RetrievedCredentials.Items;
                foreach (PasswordCredential cred in creds)
                {
                    var item = new TextBlock();
                    item.DataContext = cred;
                    item.Text = cred.Resource + ": " + cred.UserName;
                    items.Add(item);
                }
                rootPage.NotifyUser("Credentials found: " + items.Count.ToString(), NotifyType.StatusMessage);
            }
        }

void RevealPasswords_Click | ( | Object | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario2_Manage.xaml.cs.

        {
            IList<Object> selectedItems = RetrievedCredentials.SelectedItems;
            if (selectedItems.Count > 0)
            {
                int retrievedCount = 0;
                foreach (object o in selectedItems)
                {
                    TextBlock item = (TextBlock)o;
                    PasswordCredential cred = (PasswordCredential)item.DataContext;

                    // The credential retrieval functions raise an "Element not found"
                    // exception if the credential is no longer in the PasswordVault.
                    // (For example, if the user manually removed the credential via the
                    // Control Panel.)
                    try
                    {
                        cred.RetrievePassword();
                        item.Text = cred.Resource + ": " + cred.UserName + " (" + cred.Password + ")";
                        retrievedCount++;
                    }
                    catch (Exception e)
                    {
                        if (e.HResult != ElementNotFound)
                        {
                            throw;
                        }
                        item.Text = cred.Resource + ": " + cred.UserName + " (password unavailable)";
                    }

                }
                rootPage.NotifyUser("Passwords retrieved: " + retrievedCount.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("No credentials selected", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

const int ElementNotFound = unchecked((int)0x80070490) [private]

Definition at line 25 of file Scenario2_Manage.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario2_Manage.xaml.cs.

The documentation for this class was generated from the following files:
  • PasswordVault/cs/Scenario2_Manage.xaml.cs
  • PasswordVault/cpp/Scenario2_Manage.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ManageAccount Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ManageAccount
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ManageAccount Class Reference

List of all members.

Public Member Functions

Scenario2_ManageAccount ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Manage_Click (object sender, RoutedEventArgs e)

Private Attributes

bool | isLaunched = false
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_ManageAccount.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ManageAccount ( ) [inline]

Definition at line 29 of file Scenario2_ManageAccount.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Manage_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario2_ManageAccount.xaml.cs.

        {
            // only one instance of the UserDataAccountManager pane can be launched at once per thread
            if (isLaunched == false)
            {
                isLaunched = true;

                var selectedAccount = (UserDataAccount)AccountsListComboBox.SelectedValue;
                if (selectedAccount != null)
                {
                    await UserDataAccountManager.ShowAccountSettingsAsync(selectedAccount.Id);

                    // User may have deleted the account
                    await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
                }

                isLaunched = false;
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_ManageAccount.xaml.cs.

        {
            await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
        }

Member Data Documentation

bool isLaunched = false [private]

Definition at line 27 of file Scenario2_ManageAccount.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario2_ManageAccount.xaml.cs.

The documentation for this class was generated from the following files:
  • UserDataAccountManager/cs/Scenario2_ManageAccount.xaml.cs
  • UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Memory Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Memory
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Memory Class Reference

List of all members.

Public Member Functions

Scenario2_Memory ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ProtectL1_Click (object sender, RoutedEventArgs e)
async void | ProtectL2_Click (object sender, RoutedEventArgs e)
void | ReportProtectedBuffer (IBuffer buffer)
async void | Unprotect_Click (object sender, RoutedEventArgs e)

Private Attributes

IBuffer | protectedBuffer = null
MainPage rootPage = MainPage.Current
UserDataProtectionManager | userDataProtectionManager = null

Detailed Description

Definition at line 25 of file Scenario2_Memory.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Memory ( ) [inline]

Definition at line 31 of file Scenario2_Memory.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario2_Memory.xaml.cs.

        {
            userDataProtectionManager = UserDataProtectionManager.TryGetDefault();
            if (userDataProtectionManager != null)
            {
                AvailablePanel.Visibility = Visibility.Visible;
                UnavailablePanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                AvailablePanel.Visibility = Visibility.Collapsed;
                UnavailablePanel.Visibility = Visibility.Visible;
            }
        }

async void ProtectL1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario2_Memory.xaml.cs.

        {
            string text = DataTextBox.Text;
            if (text.Length == 0)
            {
                // Cannot protect a zero-length buffer.
                rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
                return;
            }

            IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);

            IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.AfterFirstUnlock);
            ReportProtectedBuffer(result);
        }

async void ProtectL2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario2_Memory.xaml.cs.

        {
            string text = DataTextBox.Text;
            if (text.Length == 0)
            {
                // Cannot protect a zero-length buffer.
                rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
                return;
            }

            IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);

            IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.WhileUnlocked);
            ReportProtectedBuffer(result);
        }

void ReportProtectedBuffer ( IBuffer buffer ) [inline, private]

Definition at line 83 of file Scenario2_Memory.xaml.cs.

        {
            protectedBuffer = buffer;
            ProtectedDataTextBlock.Text = CryptographicBuffer.EncodeToHexString(buffer);
            UnprotectPanel.Visibility = Visibility.Visible;
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }

async void Unprotect_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file Scenario2_Memory.xaml.cs.

        {
            UnprotectedDataTextBlock.Text = string.Empty;
            UserDataBufferUnprotectResult result = await userDataProtectionManager.UnprotectBufferAsync(protectedBuffer);
            switch (result.Status)
            {
                case UserDataBufferUnprotectStatus.Succeeded:
                    rootPage.NotifyUser("Unprotected successfully", NotifyType.StatusMessage);
                    UnprotectedDataTextBlock.Text = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, result.UnprotectedBuffer);
                    break;

                case UserDataBufferUnprotectStatus.Unavailable:
                    rootPage.NotifyUser("Unable to unprotect: Unavailable", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Unable to unprotect: Unknown error", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

IBuffer protectedBuffer = null [private]

Definition at line 29 of file Scenario2_Memory.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario2_Memory.xaml.cs.

UserDataProtectionManager userDataProtectionManager = null [private]

Definition at line 28 of file Scenario2_Memory.xaml.cs.

The documentation for this class was generated from the following file:
  • PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultiFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_MultiFile
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_MultiFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_MultiFile ()

Private Member Functions

async void PickFilesButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario2_MultiFile.xaml.cs.

Constructor & Destructor Documentation

Scenario2_MultiFile ( ) [inline]

Definition at line 30 of file Scenario2_MultiFile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario2_MultiFile.xaml.cs.

        {
            // Clear any previously returned files between iterations of this scenario
            OutputTextBlock.Text = "";

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.List;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            openPicker.FileTypeFilter.Add("*");
            IReadOnlyList<StorageFile> files = await openPicker.PickMultipleFilesAsync();
            if (files.Count > 0)
            {
                StringBuilder output = new StringBuilder("Picked files:\n");
                // The StorageFiles have read/write access to the picked files.
                // See the FileAccess sample for code that uses a StorageFile to read and write.
                foreach (StorageFile file in files)
                {
                    output.Append(file.Name + "\n");
                }
                OutputTextBlock.Text = output.ToString();
            }
            else
            {
                OutputTextBlock.Text = "Operation cancelled.";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_MultiFile.xaml.cs.

The documentation for this class was generated from the following files:
  • FilePicker/cs/Scenario2_MultiFile.xaml.cs
  • FilePicker/cpp/Scenario2_MultiFile.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Multiple Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Multiple
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Multiple Class Reference

List of all members.

Public Member Functions

Scenario2_Multiple ()

Private Member Functions

void | ClearOutputs ()
async void | PickContactsEmail ()
async void | PickContactsPhone ()
void | ReportContactResults (IList< Contact > contacts)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_Multiple.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Multiple ( ) [inline]

Definition at line 28 of file Scenario2_Multiple.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearOutputs ( ) [inline, private]

Definition at line 33 of file Scenario2_Multiple.xaml.cs.

        {
            // Reset the output fields.
            OutputText.Text = "";
            rootPage.NotifyUser("", NotifyType.StatusMessage);
        }

void PickContactsEmail ( ) [inline, private]

Definition at line 56 of file Scenario2_Multiple.xaml.cs.

        {
            ClearOutputs();

            var contactPicker = new ContactPicker();
            // Ask the user to pick contact email addresses.
            contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.Email);
            var contacts = await contactPicker.PickContactsAsync();

            ReportContactResults(contacts);
        }

void PickContactsPhone ( ) [inline, private]

Definition at line 68 of file Scenario2_Multiple.xaml.cs.

        {
            ClearOutputs();

            var contactPicker = new ContactPicker();
            // Ask the user to pick contact phone numbers.
            contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
            var contacts = await contactPicker.PickContactsAsync();

            ReportContactResults(contacts);
        }

void ReportContactResults ( IList< Contact > contacts ) [inline, private]

Definition at line 40 of file Scenario2_Multiple.xaml.cs.

        {
            if (contacts != null && contacts.Count > 0)
            {
                foreach (Contact contact in contacts)
                {
                    OutputText.Text += MainPage.GetContactResult(contact) + "\n";
                }
            }
            else
            {
                rootPage.NotifyUser("No contacts were selected.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario2_Multiple.xaml.cs.

The documentation for this class was generated from the following files:
  • ContactPicker/cs/Scenario2_Multiple.xaml.cs
  • ContactPicker/cpp/Scenario2_Multiple.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultipleScanners Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_MultipleScanners
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario2_MultipleScanners Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_MultipleScanners ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | BarcodeScannerInstance { Instance1, Instance2 }

Private Member Functions

void | ButtonEndScanningInstance1_Click (object sender, RoutedEventArgs e)
void | ButtonEndScanningInstance2_Click (object sender, RoutedEventArgs e)
async void | ButtonStartScanningInstance1_Click (object sender, RoutedEventArgs e)
async void | ButtonStartScanningInstance2_Click (object sender, RoutedEventArgs e)
async Task< bool > | ClaimBarcodeScannerAsync (BarcodeScannerInstance instance)
async void | claimedBarcodeScannerInstance1_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
async void | claimedBarcodeScannerInstance1_ReleaseDeviceRequested (object sender, ClaimedBarcodeScanner e)
async void | claimedBarcodeScannerInstance2_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
async void | claimedBarcodeScannerInstance2_ReleaseDeviceRequested (object sender, ClaimedBarcodeScanner e)
async Task< bool > | CreateDefaultScannerObjectAsync (BarcodeScannerInstance instance)
async Task< bool > | EnableBarcodeScannerAsync (BarcodeScannerInstance instance)
void | ResetTheScenarioState ()
void | ResetUI ()
void | SetUI (BarcodeScannerInstance instance)

Private Attributes

BarcodeScanner | barcodeScannerInstance1 = null
BarcodeScanner | barcodeScannerInstance2 = null
ClaimedBarcodeScanner | claimedBarcodeScannerInstance1 = null
ClaimedBarcodeScanner | claimedBarcodeScannerInstance2 = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario2_MultipleScanners.xaml.cs.

Member Enumeration Documentation

enum BarcodeScannerInstance [private]

Enumerator for current active Instance.

Enumerator:
Instance1
Instance2

Definition at line 48 of file Scenario2_MultipleScanners.xaml.cs.

        {
            Instance1,
            Instance2
        }

Constructor & Destructor Documentation

Scenario2_MultipleScanners ( ) [inline]

Definition at line 40 of file Scenario2_MultipleScanners.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ButtonEndScanningInstance1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ScenarioEndScanningInstance1' button.

Initiates the disposal of scanner instance 1.

Parameters:
sender
e

Definition at line 240 of file Scenario2_MultipleScanners.xaml.cs.

        {
            if (claimedBarcodeScannerInstance1 != null)
            {
                //remove the event handlers
                claimedBarcodeScannerInstance1.DataReceived -= claimedBarcodeScannerInstance1_DataReceived;
                claimedBarcodeScannerInstance1.ReleaseDeviceRequested -= claimedBarcodeScannerInstance1_ReleaseDeviceRequested;

                //dispose the instance
                claimedBarcodeScannerInstance1.Dispose();
                claimedBarcodeScannerInstance1 = null;
            }

            if (barcodeScannerInstance1 != null)
            {
                barcodeScannerInstance1.Dispose();
                barcodeScannerInstance1 = null;
            }

            //reset the UI

            ResetUI();

            rootPage.NotifyUser("Click a start scanning button to begin.", NotifyType.StatusMessage);
        }

void ButtonEndScanningInstance2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ScenarioEndScanningInstance2' button.

Initiates the disposal fo scanner instance 2.

Parameters:
sender
e

Definition at line 272 of file Scenario2_MultipleScanners.xaml.cs.

        {
            if (claimedBarcodeScannerInstance2 != null)
            {
                //remove the event handlers
                claimedBarcodeScannerInstance2.DataReceived -= claimedBarcodeScannerInstance2_DataReceived;
                claimedBarcodeScannerInstance2.ReleaseDeviceRequested -= claimedBarcodeScannerInstance2_ReleaseDeviceRequested;

                //dispose the instance
                claimedBarcodeScannerInstance2.Dispose();
                claimedBarcodeScannerInstance2 = null;
            }

            if (barcodeScannerInstance2 != null)
            {
                barcodeScannerInstance2.Dispose();
                barcodeScannerInstance2 = null;
            }

            //reset the UI
            ResetUI();

            rootPage.NotifyUser("Click a start scanning button to begin.", NotifyType.StatusMessage);
        }

async void ButtonStartScanningInstance1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ScenarioStartScanningInstance1' button.

It initiates creation of scanner instance 1.

Parameters:
sender
e

Definition at line 81 of file Scenario2_MultipleScanners.xaml.cs.

        {
            //Get the handle to the default scanner
            if (await CreateDefaultScannerObjectAsync(BarcodeScannerInstance.Instance1))
            {
                //Claim the scanner
                if (await ClaimBarcodeScannerAsync(BarcodeScannerInstance.Instance1))
                {
                    //add the event handlers
                    claimedBarcodeScannerInstance1.ReleaseDeviceRequested += claimedBarcodeScannerInstance1_ReleaseDeviceRequested;
                    claimedBarcodeScannerInstance1.DataReceived += claimedBarcodeScannerInstance1_DataReceived;
                    claimedBarcodeScannerInstance1.IsDecodeDataEnabled = true;

                    //Enable the Scanner
                    if (await EnableBarcodeScannerAsync(BarcodeScannerInstance.Instance1))
                    {
                        //Set the UI state
                        ResetUI();
                        SetUI(BarcodeScannerInstance.Instance1);
                    }
                }
                else
                {
                    if (barcodeScannerInstance1 != null)
                    {
                        barcodeScannerInstance1.Dispose();
                        barcodeScannerInstance1 = null;
                    }
                }
            }
        }

async void ButtonStartScanningInstance2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ScenarioStartScanningInstance2' button.

Initiates creation of scanner instance 2

Parameters:
sender
e

Definition at line 159 of file Scenario2_MultipleScanners.xaml.cs.

        {
            //Get the handle to the default scanner
            if (await CreateDefaultScannerObjectAsync(BarcodeScannerInstance.Instance2))
            {
                //Claim the scanner
                if (await ClaimBarcodeScannerAsync(BarcodeScannerInstance.Instance2))
                {
                    //set the handlers
                    claimedBarcodeScannerInstance2.ReleaseDeviceRequested += claimedBarcodeScannerInstance2_ReleaseDeviceRequested;
                    claimedBarcodeScannerInstance2.DataReceived += claimedBarcodeScannerInstance2_DataReceived;

                    //enable the scanner to decode the scanned data
                    claimedBarcodeScannerInstance2.IsDecodeDataEnabled = true;

                    //Enable the Scanner
                    if (await EnableBarcodeScannerAsync(BarcodeScannerInstance.Instance2))
                    {
                        //Set the UI state
                        ResetUI();
                        SetUI(BarcodeScannerInstance.Instance2);
                    }
                }
                else
                {
                    if (barcodeScannerInstance2 != null)
                    {
                        barcodeScannerInstance2.Dispose();
                        barcodeScannerInstance2 = null;
                    }
                }
            }
        }

async Task<bool> ClaimBarcodeScannerAsync ( BarcodeScannerInstance instance ) [inline, private]

This method claims the connected scanner.

Returns:
a boolean based on whether it was able to claim the scanner.

Definition at line 331 of file Scenario2_MultipleScanners.xaml.cs.

        {
            bool bClaimAsyncStatus = false;
            //select the instance to claim
            switch (instance)
            {
                case BarcodeScannerInstance.Instance1:

                    claimedBarcodeScannerInstance1 = await barcodeScannerInstance1.ClaimScannerAsync();
                    if (claimedBarcodeScannerInstance1 == null)
                        rootPage.NotifyUser("Instance 1 claim barcode scanner failed.", NotifyType.ErrorMessage);
                    else
                        bClaimAsyncStatus = true;
                    break;

                case BarcodeScannerInstance.Instance2:

                    claimedBarcodeScannerInstance2 = await barcodeScannerInstance2.ClaimScannerAsync();
                    if (claimedBarcodeScannerInstance2 == null)
                        rootPage.NotifyUser("Instance 2 claim barcode scanner failed.", NotifyType.ErrorMessage);
                    else
                        bClaimAsyncStatus = true;
                    break;

                default:
                    return bClaimAsyncStatus;
            }
            return bClaimAsyncStatus;
        }

async void claimedBarcodeScannerInstance1_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

This is an event handler for the claimed scanner Instance 1 when it scans and recieves data.

Parameters:
sender
args

Definition at line 470 of file Scenario2_MultipleScanners.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    ScanDataType1.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
                    DataLabel1.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                    ScanData1.Text = DataHelpers.GetDataString(args.Report.ScanData);

                    rootPage.NotifyUser("Instance 1 received data from the barcode scanner.", NotifyType.StatusMessage);
                }
            );
        }

async void claimedBarcodeScannerInstance1_ReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedBarcodeScanner | e |
 | ) |  |  | [inline, private]

This method is called upon when a claim request is made on instance 1.

If a retain request was placed on the device it rejects the new claim.

Parameters:
instance
Returns:

Definition at line 118 of file Scenario2_MultipleScanners.xaml.cs.

        {
            await Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    //check if the instance wants to retain the device
                    if (Retain1.IsChecked == true)
                    {
                        try
                        {
                            //Retain the device
                            claimedBarcodeScannerInstance1.RetainDevice();
                        }
                        catch (Exception exception)
                        {
                            rootPage.NotifyUser("Retain instance 1 failed: " + exception.Message, NotifyType.ErrorMessage);
                        }
                    }
                    //Release the device
                    else
                    {
                        claimedBarcodeScannerInstance1.Dispose();
                        claimedBarcodeScannerInstance1 = null;

                        if (barcodeScannerInstance1 != null)
                        {
                            barcodeScannerInstance1.Dispose();
                            barcodeScannerInstance1 = null;
                        }
                    }
                }
            );
        }

async void claimedBarcodeScannerInstance2_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

This is an event handler for the claimed scanner Instance 2 when it scans and recieves data.

Parameters:
sender
args

Definition at line 490 of file Scenario2_MultipleScanners.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    ScanDataType2.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
                    DataLabel2.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                    ScanData2.Text = DataHelpers.GetDataString(args.Report.ScanData);

                    rootPage.NotifyUser("Instance 2 received data from the barcode scanner.", NotifyType.StatusMessage);
                }
            );
        }

async void claimedBarcodeScannerInstance2_ReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedBarcodeScanner | e |
 | ) |  |  | [inline, private]

This method is called upon when a claim request is made on instance 2.

If a retain request was placed on the device it rejects the new claim.

Parameters:
instance
Returns:

Definition at line 198 of file Scenario2_MultipleScanners.xaml.cs.

        {
            await Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                () =>
                {
                    //check if the instance wants to retain the device
                    if (Retain2.IsChecked == true)
                    {
                        try
                        {
                            //Retain the device
                            claimedBarcodeScannerInstance2.RetainDevice();
                        }
                        catch (Exception exception)
                        {
                            rootPage.NotifyUser("Retain instance 2 failed: " + exception.Message, NotifyType.ErrorMessage);
                        }
                    }
                    //Release the device
                    else
                    {
                        claimedBarcodeScannerInstance2.Dispose();
                        claimedBarcodeScannerInstance2 = null;

                        if (barcodeScannerInstance2 != null)
                        {
                            barcodeScannerInstance2.Dispose();
                            barcodeScannerInstance2 = null;
                        }
                    }

                }
            );
        }

async Task<bool> CreateDefaultScannerObjectAsync ( BarcodeScannerInstance instance ) [inline, private]

This method returns the first available Barcode Scanner.

To enumerate and find a particular device use the device enumeration code.

Returns:
a boolean value based on whether it found a compatible scanner connected

Definition at line 301 of file Scenario2_MultipleScanners.xaml.cs.

        {
            BarcodeScanner scanner = null;
            scanner = await DeviceHelpers.GetFirstBarcodeScannerAsync();

            if (scanner == null)
            {
                rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage);
                return false;
            }

            switch (instance)
            {
                case BarcodeScannerInstance.Instance1:
                    barcodeScannerInstance1 = scanner;
                    break;
                case BarcodeScannerInstance.Instance2:
                    barcodeScannerInstance2 = scanner;
                    break;
                default:
                    return false;
            }

            return true;
        }

async Task<bool> EnableBarcodeScannerAsync ( BarcodeScannerInstance instance ) [inline, private]

This method enables the connected scanner.

Returns:
a boolean based on whether it was able to enable the scanner.

Definition at line 365 of file Scenario2_MultipleScanners.xaml.cs.

        {
            switch (instance)
            {
                case BarcodeScannerInstance.Instance1:
                    await claimedBarcodeScannerInstance1.EnableAsync();
                    rootPage.NotifyUser("Instance 1 ready to scan. Device ID: " + claimedBarcodeScannerInstance1.DeviceId, NotifyType.StatusMessage);
                    break;
                case BarcodeScannerInstance.Instance2:
                    await claimedBarcodeScannerInstance2.EnableAsync();
                    rootPage.NotifyUser("Instance 2 ready to scan. Device ID: " + claimedBarcodeScannerInstance2.DeviceId, NotifyType.StatusMessage);
                    break;
                default:
                    return false;
            }
            return true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is no longer displayed.

Parameters:
e Event data that describes how this page was exited. The Parameter property is typically used to configure the page.

Definition at line 70 of file Scenario2_MultipleScanners.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 59 of file Scenario2_MultipleScanners.xaml.cs.

        {
            ResetTheScenarioState();
            base.OnNavigatedTo(e);
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 386 of file Scenario2_MultipleScanners.xaml.cs.

        {
            if (claimedBarcodeScannerInstance1 != null)
            {
                claimedBarcodeScannerInstance1.Dispose();
                claimedBarcodeScannerInstance1 = null;
            }

            if (barcodeScannerInstance1 != null)
            {
                barcodeScannerInstance1.Dispose();
                barcodeScannerInstance1 = null;
            }

            if (claimedBarcodeScannerInstance2 != null)
            {
                claimedBarcodeScannerInstance2.Dispose();
                claimedBarcodeScannerInstance2 = null;
            }

            if (barcodeScannerInstance2 != null)
            {
                barcodeScannerInstance2.Dispose();
                barcodeScannerInstance2 = null;
            }

            ResetUI();
        }

void ResetUI ( ) [inline, private]

Resets the display Elements to original state.

Definition at line 418 of file Scenario2_MultipleScanners.xaml.cs.

        {
            Instance1Border.BorderBrush = new SolidColorBrush(Colors.Gray);
            Instance2Border.BorderBrush = new SolidColorBrush(Colors.Gray);

            ScanDataType1.Text = String.Format("No data");
            ScanData1.Text = String.Format("No data");
            DataLabel1.Text = String.Format("No data");
            ScanDataType2.Text = String.Format("No data");
            ScanData2.Text = String.Format("No data");
            DataLabel2.Text = String.Format("No data");

            ScenarioStartScanningInstance1.IsEnabled = true;
            ScenarioStartScanningInstance2.IsEnabled = true;
            ScenarioEndScanningInstance1.IsEnabled = false;
            ScenarioEndScanningInstance2.IsEnabled = false;
        }

void SetUI ( BarcodeScannerInstance instance ) [inline, private]

Sets the UI elements to a state corresponding to the current active Instance.

Parameters:
instance Corresponds to the current active instance

Definition at line 440 of file Scenario2_MultipleScanners.xaml.cs.

        {
            Instance1Border.BorderBrush = new SolidColorBrush(Colors.Gray);
            Instance2Border.BorderBrush = new SolidColorBrush(Colors.Gray);

            switch (instance)
            {
                case BarcodeScannerInstance.Instance1:
                    ScenarioStartScanningInstance1.IsEnabled = false;
                    ScenarioStartScanningInstance2.IsEnabled = true;
                    ScenarioEndScanningInstance1.IsEnabled = true;
                    ScenarioEndScanningInstance2.IsEnabled = false;
                    Instance1Border.BorderBrush = new SolidColorBrush(Colors.DarkBlue);
                    break;

                case BarcodeScannerInstance.Instance2:
                    ScenarioStartScanningInstance1.IsEnabled = true;
                    ScenarioStartScanningInstance2.IsEnabled = false;
                    ScenarioEndScanningInstance1.IsEnabled = false;
                    ScenarioEndScanningInstance2.IsEnabled = true;
                    Instance2Border.BorderBrush = new SolidColorBrush(Colors.DarkBlue);
                    break;
            }
        }

Member Data Documentation

BarcodeScanner barcodeScannerInstance1 = null [private]

Definition at line 34 of file Scenario2_MultipleScanners.xaml.cs.

BarcodeScanner barcodeScannerInstance2 = null [private]

Definition at line 35 of file Scenario2_MultipleScanners.xaml.cs.

ClaimedBarcodeScanner claimedBarcodeScannerInstance1 = null [private]

Definition at line 36 of file Scenario2_MultipleScanners.xaml.cs.

ClaimedBarcodeScanner claimedBarcodeScannerInstance2 = null [private]

Definition at line 37 of file Scenario2_MultipleScanners.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2_MultipleScanners.xaml.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/Scenario2_MultipleScanners.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_NavToString Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_NavToString
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario2_NavToString Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_NavToString ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | LoadAsHtml ()

Detailed Description

Definition at line 23 of file Scenario2_NavToString.xaml.cs.

Constructor & Destructor Documentation

Scenario2_NavToString ( ) [inline]

Definition at line 25 of file Scenario2_NavToString.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void LoadAsHtml ( ) [inline, private]

Definition at line 35 of file Scenario2_NavToString.xaml.cs.

        {
            // Grab the HTML from the text box and load it into the WebView
            WebViewControl.NavigateToString(HtmlBox.Text);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario2_NavToString.xaml.cs.

        {
            HtmlBox.Text = await MainPage.LoadStringFromPackageFileAsync("html_example.html");
        }

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario2_NavToString.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_NetworkCost Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_NetworkCost
Public Member Functions | Private Member Functions

Scenario2_NetworkCost Class Reference

List of all members.

Public Member Functions

Scenario2_NetworkCost ()

Private Member Functions

void GetNetworkCost_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 18 of file Scenario2_NetworkCost.xaml.cs.

Constructor & Destructor Documentation

Scenario2_NetworkCost ( ) [inline]

Definition at line 20 of file Scenario2_NetworkCost.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void GetNetworkCost_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 25 of file Scenario2_NetworkCost.xaml.cs.

        {
            ResultsText.Text = string.Empty;

            ConnectionProfile profile = NetworkInformation.GetInternetConnectionProfile();
            if (profile != null)
            {
                ConnectionCost connectionCost = profile.GetConnectionCost();
                Helpers.AppendLine(ResultsText, $"Network cost is {connectionCost.NetworkCostType}.");

                Helpers.EvaluateAndReportConnectionCost(connectionCost, ResultsText);
            }
            else
            {
                Helpers.AppendLine(ResultsText, "No internet connection profile.");
            }
        }

The documentation for this class was generated from the following file:
  • NetworkConnectivity/cs/Scenario2_NetworkCost.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Notifications Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Notifications
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Notifications Class Reference

List of all members.

Public Member Functions

Scenario2_Notifications ()

Private Member Functions

void | ClearBadge_Click (object sender, RoutedEventArgs e)
void | ClearTile_Click (object sender, RoutedEventArgs e)
void | SendBadge_Click (object sender, RoutedEventArgs e)
void | SendBadgeWithStringManipulation_Click (object sender, RoutedEventArgs e)
void | SendTile_Click (object sender, RoutedEventArgs e)
void | SendTileWithStringManipulation_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_Notifications.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Notifications ( ) [inline]

Definition at line 26 of file Scenario2_Notifications.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void ClearBadge_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file Scenario2_Notifications.xaml.cs.

        {
            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Clear();
            rootPage.NotifyUser("Badge notification cleared", NotifyType.StatusMessage);
        }

void ClearTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario2_Notifications.xaml.cs.

        {
            TileUpdateManager.CreateTileUpdaterForApplication().Clear();
            rootPage.NotifyUser("Tile notification cleared", NotifyType.StatusMessage);
        }

void SendBadge_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario2_Notifications.xaml.cs.

        {
            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(6);
            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(new BadgeNotification(badgeContent.GetXml()));
            rootPage.NotifyUser("Badge notification sent", NotifyType.StatusMessage);
        }

void SendBadgeWithStringManipulation_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario2_Notifications.xaml.cs.

        {
            string badgeXmlString = "<badge value='6'/>";
            XmlDocument badgeDOM = new XmlDocument();
            badgeDOM.LoadXml(badgeXmlString);
            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(new BadgeNotification(badgeDOM));
            rootPage.NotifyUser("Badge notification sent", NotifyType.StatusMessage);
        }

void SendTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario2_Notifications.xaml.cs.

        {
            var tileDOM = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150SmallImageAndText03);
            tileDOM.SelectSingleNode("//image[@id=1]/@src").NodeValue = "'ms-appx:///Assets/tile-sdk.png";
            tileDOM.SelectSingleNode("//text[@id=1]").InnerText = "This tile notification has an image, but it won't be displayed on the lock screen";

            TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(tileDOM));

            rootPage.NotifyUser("Tile notification sent", NotifyType.StatusMessage);
        }

void SendTileWithStringManipulation_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario2_Notifications.xaml.cs.

        {
            string tileXmlString = "<tile>"
                                 + "<visual version='2'>"
                                 + "<binding template='TileWide310x150SmallImageAndText03' fallback='TileWideSmallImageAndText03'>"
                                 + "<image id='1' src='ms-appx:///Assets/tile-sdk.png'/>"
                                 + "<text id='1'>This tile notification has an image, but it won't be displayed on the lock screen</text>"
                                 + "</binding>"
                                 + "</visual>"
                                 + "</tile>";

            XmlDocument tileDOM = new XmlDocument();
            tileDOM.LoadXml(tileXmlString);
            TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(tileDOM));
            rootPage.NotifyUser("Tile notification sent", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_Notifications.xaml.cs.

The documentation for this class was generated from the following file:
  • LockScreenApps/cs/Scenario2_Notifications.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_PhotoSettings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_PhotoSettings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_PhotoSettings Class Reference

Scenario 2 Change camera preview and photo settings. More...

List of all members.

Public Member Functions

Scenario2_PhotoSettings ()
void | CheckIfStreamsAreIdentical ()

Protected Member Functions

override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | InitializeCameraButton_Click (object sender, RoutedEventArgs e)
async void | PhotoButton_Click (object sender, RoutedEventArgs e)
async void | PhotoSettings_Changed (object sender, RoutedEventArgs e)
void | PopulateComboBox (MediaStreamType streamType, ComboBox comboBox, bool showFrameRate=true)
async void | PreviewSettings_Changed (object sender, RoutedEventArgs e)

Private Attributes

StorageFolder | _captureFolder = null
MediaCapturePreviewer | _previewer = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario2_PhotoSettings.xaml.cs.

Constructor & Destructor Documentation

Scenario2_PhotoSettings ( ) [inline]

Initializes a new instance of the Scenario2_PhotoSettings class.

Initializes a new instance of the Scenario2_EnableSettings class.

Definition at line 44 of file Scenario2_PhotoSettings.xaml.cs.

        {
            this.InitializeComponent();
            _previewer = new MediaCapturePreviewer(PreviewControl, Dispatcher);
        }

Member Function Documentation

void CheckIfStreamsAreIdentical ( ) [inline]

On some devices there may not be seperate streams for preview/photo/video.

In this case, changing any of them will change all of them since they are the same stream

Definition at line 59 of file Scenario2_PhotoSettings.xaml.cs.

        {
            if (_previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.AllStreamsIdentical ||
                _previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.PreviewPhotoStreamsIdentical)
            {
                rootPage.NotifyUser("Warning: Preview and photo streams for this device are identical, changing one will affect the other", NotifyType.ErrorMessage);
            }
        }

async void InitializeCameraButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Initializes the camera and populates the UI.

Parameters:
sender
e

Definition at line 73 of file Scenario2_PhotoSettings.xaml.cs.

        {
            var button = sender as Button;

            // Clear any previous message.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            button.IsEnabled = false;
            await _previewer.InitializeCameraAsync();
            button.IsEnabled = true;

            if (_previewer.IsPreviewing)
            {
                button.Visibility = Visibility.Collapsed;
                PreviewControl.Visibility = Visibility.Visible;
                CheckIfStreamsAreIdentical();
                PopulateComboBox(MediaStreamType.VideoPreview, PreviewSettings);
                PopulateComboBox(MediaStreamType.Photo, PhotoSettings, false);
                PhotoButton.IsEnabled = true;
            }

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 50 of file Scenario2_PhotoSettings.xaml.cs.

        {
            await _previewer.CleanupCameraAsync();
        }

async void PhotoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Takes a photo to and saves to a StorageFile.

Parameters:
sender
e

Definition at line 134 of file Scenario2_PhotoSettings.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                // Disable the photo button while taking a photo
                PhotoButton.IsEnabled = false;

                var stream = new InMemoryRandomAccessStream();

                try
                {
                    // Take and save the photo
                    var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);
                    await _previewer.MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties.CreateJpeg(), file);
                    rootPage.NotifyUser("Photo taken, saved to: " + file.Path, NotifyType.StatusMessage);
                }
                catch (Exception ex)
                {
                    // File I/O errors are reported as exceptions.
                    rootPage.NotifyUser("Exception when taking a photo: " + ex.Message, NotifyType.ErrorMessage);
                }

                // Done taking a photo, so re-enable the button
                PhotoButton.IsEnabled = true;
            }
        }

async void PhotoSettings_Changed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Photo settings combo box.

Updates stream resolution based on the selection.

Parameters:
sender
e

Definition at line 119 of file Scenario2_PhotoSettings.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
                var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
                await _previewer.MediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, encodingProperties);
            }
        }

void PopulateComboBox | ( | MediaStreamType | streamType,
 |  | ComboBox | comboBox,
 |  | bool | showFrameRate = true |
 | ) |  |  | [inline, private]

Populates the given combo box with all possible combinations of the given stream type settings returned by the camera driver.

Parameters:
streamType
comboBox

Definition at line 166 of file Scenario2_PhotoSettings.xaml.cs.

        {
            // Query all preview properties of the device
            IEnumerable<StreamResolution> allStreamProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(streamType).Select(x => new StreamResolution(x));
            // Order them by resolution then frame rate
            allStreamProperties = allStreamProperties.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);

            // Populate the combo box with the entries
            foreach (var property in allStreamProperties)
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Content = property.GetFriendlyName(showFrameRate);
                comboBoxItem.Tag = property;
                comboBox.Items.Add(comboBoxItem);
            }
        }

async void PreviewSettings_Changed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Preview settings combo box.

Updates stream resolution based on the selection.

Parameters:
sender
e

Definition at line 104 of file Scenario2_PhotoSettings.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
                var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
                await _previewer.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, encodingProperties);
            }
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 39 of file Scenario2_PhotoSettings.xaml.cs.

MediaCapturePreviewer _previewer = null [private]

Definition at line 36 of file Scenario2_PhotoSettings.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario2_PhotoSettings.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraResolution/cs/Scenario2_PhotoSettings.xaml.cs
  • CameraResolution/cpp/Scenario2_PhotoSettings.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()
Scenario2_Polling ()
Scenario2_Polling ()
Scenario2_Polling ()
Scenario2_Polling ()
Scenario2_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayCurrentReading (object sender, object args)
void | DisplayCurrentReading (object sender, object args)
void | DisplayCurrentReading (object sender, object args)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioDisable ()
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | ScenarioEnable ()
void | ScenarioGetData (object sender, RoutedEventArgs e)
void | ScenarioGetData (object sender, RoutedEventArgs e)
void | ScenarioGetData_Click (object sender, RoutedEventArgs e)
async void | ScenarioGetSensor_Click (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

Compass | _compass
uint _desiredReportInterval
DispatcherTimer | _dispatcherTimer
Magnetometer | _magnetometer
OrientationSensor | _sensor
MainPage rootPage = MainPage.Current
HumanPresenceSensor | sensor
Altimeter | sensor
Barometer | sensor

Detailed Description

Definition at line 23 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            sensor = Altimeter.GetDefault();
            if (null == sensor)
            {
                rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
            }
        }

Scenario2_Polling ( ) [inline]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            sensor = Barometer.GetDefault();
            if (null == sensor)
            {
                rootPage.NotifyUser("No barometer found", NotifyType.ErrorMessage);
            }
        }

Scenario2_Polling ( ) [inline]

Definition at line 33 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _compass = Compass.GetDefault();
            if (_compass != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _compass.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
            }
            else
            {
                rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
            }
        }

Scenario2_Polling ( ) [inline]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _magnetometer = Magnetometer.GetDefault();
            if (_magnetometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                uint minReportInterval = _magnetometer.MinimumReportInterval;
                _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
            }
            else
            {
                rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
            }
        }

Scenario2_Polling ( ) [inline]

Definition at line 34 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario2_Polling ( ) [inline]

Definition at line 27 of file Scenario2_Polling.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 121 of file Scenario2_Polling.xaml.cs.

        {
            CompassReading reading = _compass.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_MagneticNorth.Text = String.Format("{0,5:0.00}", reading.HeadingMagneticNorth);
                if (reading.HeadingTrueNorth != null)
                {
                    ScenarioOutput_TrueNorth.Text = String.Format("{0,5:0.00}", reading.HeadingTrueNorth);
                }
                else
                {
                    ScenarioOutput_TrueNorth.Text = "No data";
                }
                switch (reading.HeadingAccuracy)
                {
                    case MagnetometerAccuracy.Unknown:
                        ScenarioOutput_HeadingAccuracy.Text = "Unknown";
                        break;
                    case MagnetometerAccuracy.Unreliable:
                        ScenarioOutput_HeadingAccuracy.Text = "Unreliable";
                        break;
                    case MagnetometerAccuracy.Approximate:
                        ScenarioOutput_HeadingAccuracy.Text = "Approximate";
                        break;
                    case MagnetometerAccuracy.High:
                        ScenarioOutput_HeadingAccuracy.Text = "High";
                        break;
                    default:
                        ScenarioOutput_HeadingAccuracy.Text = "No data";
                        break;
                }
            }
        }

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 100 of file Scenario2_Polling.xaml.cs.

        {
            OrientationSensorReading reading = _sensor.GetCurrentReading();
            if (reading != null)
            {
                MainPage.SetReadingText(ScenarioOutput, reading);
            }
        }

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 119 of file Scenario2_Polling.xaml.cs.

        {
            MagnetometerReading reading = _magnetometer.GetCurrentReading();
            if (reading != null)
            {
                ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.MagneticFieldX);
                ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.MagneticFieldY);
                ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.MagneticFieldZ);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 59 of file Scenario2_Polling.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 61 of file Scenario2_Polling.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_Polling.xaml.cs.

        {
            _sensor = OrientationSensor.GetDefault(rootPage.SensorReadingType, rootPage.SensorOptimizationGoal);
            if (_sensor != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                _desiredReportInterval = Math.Max(_sensor.MinimumReportInterval, 16);

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = TimeSpan.FromMilliseconds(_desiredReportInterval);

                rootPage.NotifyUser(rootPage.SensorDescription + " is ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.SensorDescription + " not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 62 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 75 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

                // Stop the dispatcher
                _dispatcherTimer.Stop();

                // Restore the default report interval to release resources while the sensor is not in use
                _compass.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 73 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= VisibilityChanged;

                // Stop the dispatcher
                _dispatcherTimer.Stop();

                // Restore the default report interval to release resources while the sensor is not in use
                _magnetometer.ReportInterval = 0;
            }

            base.OnNavigatingFrom(e);
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 185 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _compass.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 127 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _sensor.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 159 of file Scenario2_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _magnetometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 112 of file Scenario2_Polling.xaml.cs.

        {
            // Set the report interval to enable the sensor for polling
            _sensor.ReportInterval = _desiredReportInterval;

            Window.Current.VisibilityChanged += VisibilityChanged;
            _dispatcherTimer.Start();

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 135 of file Scenario2_Polling.xaml.cs.

        {
            if (_magnetometer != null)
            {
                // Set the report interval to enable the sensor for polling
                _magnetometer.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += VisibilityChanged;
                _dispatcherTimer.Start();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
            }
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 161 of file Scenario2_Polling.xaml.cs.

        {
            if (_compass != null)
            {
                // Set the report interval to enable the sensor for polling
                _compass.ReportInterval = _desiredReportInterval;

                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _dispatcherTimer.Start();

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
            }
        }

void ScenarioGetData | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'GetData' button.

Parameters:
sender
e

Definition at line 47 of file Scenario2_Polling.xaml.cs.

        {
            if (null != sensor)
            {
                BarometerReading reading = sensor.GetCurrentReading();
                if (null != reading)
                {
                    ScenarioOutput_hPa.Text = String.Format("{0,5:0.00}", reading.StationPressureInHectopascals);
                }
            }
            else
            {
                rootPage.NotifyUser("No barometer found", NotifyType.ErrorMessage);
            }
        }

void ScenarioGetData | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'GetData' button.

Parameters:
sender
e

Definition at line 47 of file Scenario2_Polling.xaml.cs.

        {
            if (null != sensor)
            {
                AltimeterReading reading = sensor.GetCurrentReading();
                if (null != reading)
                {
                    ScenarioOutput_M.Text = String.Format("{0,5:0.00}", reading.AltitudeChangeInMeters);
                }
            }
            else
            {
                rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
            }
        }

void ScenarioGetData_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario2_Polling.xaml.cs.

        {
            HumanPresenceSensorReading reading;
            try
            {
                reading = sensor.GetCurrentReading();
            }
            catch (UnauthorizedAccessException)
            {
                // The user denied this app presence sensor access.
                reading = null;
            }

            if (reading != null)
            {
                if (sensor.IsEngagementSupported)
                {
                    EngagementStateTextBlock.Text = reading.Engagement.ToString();
                }
                else
                {
                    EngagementStateTextBlock.Text = "Not Supported";
                }

                if (sensor.IsPresenceSupported)
                {
                    DetectionStateTextBlock.Text = reading.Presence.ToString();
                }
                else
                {
                    DetectionStateTextBlock.Text = "Not Supported";
                }

                // Show the detection distance, if available
                DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();

                TimestampTextBlock.Text = reading.Timestamp.ToString("u");
            }
        }

async void ScenarioGetSensor_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario2_Polling.xaml.cs.

        {
            // This scenario uses DeviceInformation.FindAllAsync to find all
            // HumanPresenceSensor devices. This allows the app to choose a sensor
            // which best fits its requirements.
            //
            // Scenario 1 shows how to get the default HumanPresenceSensor device.

            // Disable the button so the user can't click it again while we are already working.
            GetSensorButton.IsEnabled = false;

            // Clear any previous message.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            string selector = HumanPresenceSensor.GetDeviceSelector();
            DeviceInformationCollection deviceInfos = await DeviceInformation.FindAllAsync(selector);
            foreach (DeviceInformation deviceInfo in deviceInfos)
            {
                HumanPresenceSensor foundSensor = null;
                try
                {
                    foundSensor = await HumanPresenceSensor.FromIdAsync(deviceInfo.Id);
                }
                catch (UnauthorizedAccessException)
                {
                    // The user denied this app presence sensor access.
                    foundSensor = null;
                }

                if (foundSensor != null)
                {
                    if (null != foundSensor.MaxDetectableDistanceInMillimeters)
                    {
                        // Check if this is the sensor that matches our ranges.
                        // TODO: Customize these values to your application's needs.
                        const uint distanceInMillimetersLValue = 200; // 0.2m
                        const uint distanceInMillimetersRValue = 1200; // 1.2m
                        if (foundSensor.MinDetectableDistanceInMillimeters <= distanceInMillimetersLValue &&
                            foundSensor.MaxDetectableDistanceInMillimeters >= distanceInMillimetersRValue)
                        {
                            rootPage.NotifyUser("Found a presence sensor that meets the detection range", NotifyType.StatusMessage);
                            sensor = foundSensor;
                        }
                        else
                        {
                            rootPage.NotifyUser("Presence sensor does not meet the detection range, using it anyway", NotifyType.StatusMessage);
                            // We'll use the sensor anyway, to demonstrate how events work.
                            // Your app may decide not to use this sensor and keep looking for another.
                            sensor = foundSensor;
                        }
                    }
                    else
                    {
                        rootPage.NotifyUser("Presence sensor does not report detection ranges, using it anyway", NotifyType.StatusMessage);
                        sensor = foundSensor;
                    }
                }

                if (sensor != null)
                {
                    // We found a sensor we like. We can stop looking now.
                    break;
                }
            }

            GetSensorButton.IsEnabled = true;

            if (sensor != null)
            {
                VisualStateManager.GoToState(this, "Ready", true);
            }
            else
            {
                rootPage.NotifyUser("No presence sensor found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 78 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 97 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 99 of file Scenario2_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

Member Data Documentation

Compass _compass [private]

Definition at line 29 of file Scenario2_Polling.xaml.cs.

uint _desiredReportInterval [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

DispatcherTimer _dispatcherTimer [private]

Definition at line 31 of file Scenario2_Polling.xaml.cs.

Magnetometer _magnetometer [private]

Definition at line 27 of file Scenario2_Polling.xaml.cs.

OrientationSensor _sensor [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario2_Polling.xaml.cs.

HumanPresenceSensor sensor [private]

Definition at line 25 of file Scenario2_Polling.xaml.cs.

Altimeter sensor [private]

Definition at line 29 of file Scenario2_Polling.xaml.cs.

Barometer sensor [private]

Definition at line 29 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following files:
  • Altimeter/cs/Scenario2_Polling.xaml.cs
  • Barometer/cs/Scenario2_Polling.xaml.cs
  • Compass/cs/Scenario2_Polling.xaml.cs
  • Magnetometer/cs/Scenario2_Polling.xaml.cs
  • OrientationSensor/cs/Scenario2_Polling.xaml.cs
  • PresenceSensor/cs/Scenario2_Polling.xaml.cs
  • Altimeter/cpp/Scenario2_Polling.xaml.cpp
  • Barometer/cpp/Scenario2_Polling.xaml.cpp
  • Compass/cpp/Scenario2_Polling.xaml.cpp
  • CustomSensors/cpp/Scenario2_Polling.xaml.cpp
  • Gyrometer/cpp/Scenario2_Polling.xaml.cpp
  • Inclinometer/cpp/Scenario2_Polling.xaml.cpp
  • LightSensor/cpp/Scenario2_Polling.xaml.cpp
  • OrientationSensor/cpp/Scenario2_Polling.xaml.cpp
  • ProximitySensor/cpp/Scenario2_Polling.xaml.cpp
  • RelativeInclinometer/cpp/Scenario2_Polling.xaml.cpp
  • SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_PrintReceipt Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_PrintReceipt
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

Scenario2_PrintReceipt Class Reference

List of all members.

Public Member Functions

Scenario2_PrintReceipt ()

Static Public Member Functions

static async Task< BitmapFrame > | LoadLogoBitmapAsync ()

Private Member Functions

async Task< bool > | ExecuteJobAndReportResultAsync (ReceiptPrintJob job)
string | GetCustomerFooter ()
string | GetMerchantFooter ()
bool | IsPrinterClaimed ()
async void | PrintBarcode_Click ()
async void | PrintBitmap_Click ()
async void | PrintLine_Click ()
void | PrintLineFeedAndCutPaper (ReceiptPrintJob job, string receipt)
async void | PrintReceipt_Click ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario2_PrintReceipt.xaml.cs.

Constructor & Destructor Documentation

Scenario2_PrintReceipt ( ) [inline]

Definition at line 26 of file Scenario2_PrintReceipt.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<bool> ExecuteJobAndReportResultAsync ( ReceiptPrintJob job ) [inline, private]

Definition at line 46 of file Scenario2_PrintReceipt.xaml.cs.

        {
            bool success = await job.ExecuteAsync();
            if (success)
            {
                rootPage.NotifyUser("Printing complete.", NotifyType.StatusMessage);
            }
            else
            {

                ClaimedReceiptPrinter receiptPrinter = rootPage.ClaimedPrinter.Receipt;
                string reason;
                if (receiptPrinter.IsCartridgeEmpty)
                {
                    reason = "Printer is out of ink. Please replace cartridge.";
                }
                else if (receiptPrinter.IsCartridgeRemoved)
                {
                    reason = "Printer cartridge is missing. Please replace cartridge.";
                }
                else if (receiptPrinter.IsCoverOpen)
                {
                    reason = "Printer cover is open. Please close it.";
                }
                else if (receiptPrinter.IsHeadCleaning)
                {
                    reason = "Printer is currently cleaning the cartridge. Please wait until cleaning has completed.";
                }
                else if (receiptPrinter.IsPaperEmpty)
                {
                    reason = "Printer is out of paper. Please insert a new roll.";
                }
                else
                {
                    reason = "Unable to print.";
                }
                rootPage.NotifyUser(reason, NotifyType.ErrorMessage);
            }
            return success;
        }

Platform::String GetCustomerFooter ( ) [inline, private]

Definition at line 142 of file Scenario2_PrintReceipt.xaml.cs.

        {
            return "\n" +
                   "Customer Copy\n";
        }

Platform::String GetMerchantFooter ( ) [inline, private]

Definition at line 133 of file Scenario2_PrintReceipt.xaml.cs.

        {
            return "\n" +
                   "______________________\n" +
                   "Signature\n" +
                   "\n" +
                   "Merchant Copy\n";
        }

bool IsPrinterClaimed ( ) [inline, private]

Definition at line 31 of file Scenario2_PrintReceipt.xaml.cs.

        {
            if (rootPage.ClaimedPrinter != null)
            {
                rootPage.NotifyUser("", NotifyType.StatusMessage);
                return true;
            }
            else
            {
                rootPage.NotifyUser("Use scenario 1 to find, claim, and enable a receipt printer.", NotifyType.ErrorMessage);
                return false;
            }
        }

task< BitmapFrame^> LoadLogoBitmapAsync ( ) [inline, static]

Definition at line 181 of file Scenario2_PrintReceipt.xaml.cs.

        {
            var uri = new Uri("ms-appx:///Assets/coffee-logo.png");
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
            using (var readStream = await file.OpenReadAsync())
            {
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(readStream);
                return await decoder.GetFrameAsync(0);
            }
        }

void PrintBarcode_Click ( ) [inline, private]

Definition at line 194 of file Scenario2_PrintReceipt.xaml.cs.

        {
            if (!IsPrinterClaimed())
            {
                return;
            }

            rootPage.ClaimedPrinter.Receipt.IsLetterQuality = true;
            ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
            job.PrintBarcode(BarcodeText.Text, BarcodeSymbologies.Upca, 60, 3, PosPrinterBarcodeTextPosition.Below, PosPrinterAlignment.Center);
            await ExecuteJobAndReportResultAsync(job);
        }

void PrintBitmap_Click ( ) [inline, private]

Definition at line 168 of file Scenario2_PrintReceipt.xaml.cs.

        {
            if (!IsPrinterClaimed())
            {
                return;
            }
            rootPage.ClaimedPrinter.Receipt.IsLetterQuality = true;
            ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
            BitmapFrame logoFrame = await LoadLogoBitmapAsync();
            job.PrintBitmap(logoFrame, PosPrinterAlignment.Center);
            await ExecuteJobAndReportResultAsync(job);
        }

void PrintLine_Click ( ) [inline, private]

Prints the line that is in the textbox.

Definition at line 91 of file Scenario2_PrintReceipt.xaml.cs.

        {
            if (!IsPrinterClaimed())
            {
                return;
            }

            ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
            job.PrintLine(PrintLineTextBox.Text);
            await ExecuteJobAndReportResultAsync(job);
        }

void PrintLineFeedAndCutPaper | ( | ReceiptPrintJob | job,
 |  | string | receipt |
 | ) |  |  | [inline, private]

Definition at line 149 of file Scenario2_PrintReceipt.xaml.cs.

        {
            // Passing a multi-line string to the Print method results in
            // smoother paper feeding than sending multiple single-line strings
            // to PrintLine.
            string feedString = "";
            for (uint n = 0; n < rootPage.ClaimedPrinter.Receipt.LinesToPaperCut; n++)
            {
                feedString += "\n";
            }
            job.Print(receipt + feedString);
            if (rootPage.Printer.Capabilities.Receipt.CanCutPaper)
            {
                job.CutPaper();
            }
        }

void PrintReceipt_Click ( ) [inline, private]

Definition at line 105 of file Scenario2_PrintReceipt.xaml.cs.

        {
            if (!IsPrinterClaimed())
            {
                return;
            }

            string receiptString = "======================\n" +
                                   "|   Sample Header    |\n" +
                                   "======================\n" +
                                   "Item             Price\n" +
                                   "----------------------\n" +
                                   "Books            10.40\n" +
                                   "Games             9.60\n" +
                                   "----------------------\n" +
                                   "Total            20.00\n";

            rootPage.NotifyUser("Printing receipt...", NotifyType.StatusMessage);

            // The job consists of two receipts, one for the merchant and one
            // for the customer.
            ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
            PrintLineFeedAndCutPaper(job, receiptString + GetMerchantFooter());
            PrintLineFeedAndCutPaper(job, receiptString + GetCustomerFooter());

            await ExecuteJobAndReportResultAsync(job);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_PrintReceipt.xaml.cs.

The documentation for this class was generated from the following files:
  • PosPrinter/cs/Scenario2_PrintReceipt.xaml.cs
  • PosPrinter/cpp/Scenario2_PrintReceipt.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ProactiveRequest Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ProactiveRequest
Public Member Functions

Scenario2_ProactiveRequest Class Reference

List of all members.

Public Member Functions

Scenario2_ProactiveRequest ()

Detailed Description

Definition at line 17 of file Scenario2_ProactiveRequest.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ProactiveRequest ( ) [inline]

Definition at line 19 of file Scenario2_ProactiveRequest.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = new ProactiveViewModel(mediaElement);
        }

The documentation for this class was generated from the following file:
  • PlayReady/cs/Scenario2_ProactiveRequest.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ReceiveContact Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ReceiveContact
Public Member Functions | Protected Member Functions

Scenario2_ReceiveContact Class Reference

Page to handle the protocol activation. More...

List of all members.

Public Member Functions

Scenario2_ReceiveContact ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

In this case we simply show the URI and the parameters passed to it.

Definition at line 25 of file Scenario2_ReceiveContact.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ReceiveContact ( ) [inline]

Definition at line 27 of file Scenario2_ReceiveContact.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario2_ReceiveContact.xaml.cs.

        {
            base.OnNavigatedTo(e);

            var args = e.Parameter as ProtocolActivatedEventArgs;
            // Display the result of the protocol activation if we got here as a result of being activated for a protocol.
            if (args != null)
            {
                // Parse the URI to extract the protocol and the contact ids
                Uri uri = args.Uri;

                MainPage.Current.NotifyUser("Activated with protocol = " + uri.Scheme + ", parameters = " + uri.Query, NotifyType.StatusMessage);
            }
        }

The documentation for this class was generated from the following file:
  • ContactCardIntegration/cs/Scenario2_ReceiveContact.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Remove Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Remove
Public Member Functions | Private Member Functions

Scenario2_Remove Class Reference

List of all members.

Public Member Functions

Scenario2_Remove ()

Private Member Functions

async void RemoveJumpList_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario2_Remove.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Remove ( ) [inline]

Definition at line 21 of file Scenario2_Remove.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void RemoveJumpList_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario2_Remove.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();
            jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
            jumpList.Items.Clear();
            await jumpList.SaveAsync();
        }

The documentation for this class was generated from the following files:
  • JumpList/cs/Scenario2_Remove.xaml.cs
  • JumpList/cpp/Scenario2_Remove.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestConsent Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_RequestConsent
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_RequestConsent Class Reference

List of all members.

Public Member Functions

Scenario2_RequestConsent ()

Private Member Functions

async void RequestConsent_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario2_RequestConsent.xaml.cs.

Constructor & Destructor Documentation

Scenario2_RequestConsent ( ) [inline]

Definition at line 24 of file Scenario2_RequestConsent.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void RequestConsent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario2_RequestConsent.xaml.cs.

        {
            RequestConsentButton.IsEnabled = false;

            // Request the user's consent using Windows Hello via biometric verification or a PIN.
            string message = "Please confirm your identity to complete this (pretend) in-app purchase.";
            UserConsentVerificationResult consentResult = await UserConsentVerifier.RequestVerificationAsync(message);
            switch (consentResult)
            {
                case UserConsentVerificationResult.Verified:
                    rootPage.NotifyUser("Pretend in-app purchase was successful.", NotifyType.StatusMessage);
                    break;

                case UserConsentVerificationResult.DeviceNotPresent:
                    rootPage.NotifyUser("No PIN or biometric found, please set one up.", NotifyType.ErrorMessage);
                    break;

                case UserConsentVerificationResult.Canceled:
                    rootPage.NotifyUser("User consent verification canceled.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("User consent verification is currently unavailable.", NotifyType.ErrorMessage);
                    break;
            }
            RequestConsentButton.IsEnabled = true;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario2_RequestConsent.xaml.cs.

The documentation for this class was generated from the following files:
  • UserConsentVerifier/cs/Scenario2_RequestConsent.xaml.cs
  • UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestMany Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_RequestMany
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_RequestMany Class Reference

List of all members.

Public Member Functions

Scenario2_RequestMany ()

Private Member Functions

async void RequestAccessButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_RequestMany.xaml.cs.

Constructor & Destructor Documentation

Scenario2_RequestMany ( ) [inline]

Definition at line 25 of file Scenario2_RequestMany.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void RequestAccessButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario2_RequestMany.xaml.cs.

        {
            // This will prompt for any capabilities whose current status is UserPromptRequired.
            IReadOnlyDictionary<string, AppCapabilityAccessStatus> result =
                await AppCapability.RequestAccessForCapabilitiesAsync(new[] { "location", "webcam" });
            string locationMessage;
            if (result["location"] == AppCapabilityAccessStatus.Allowed)
            {
                locationMessage = "Location access is granted. ";
            }
            else
            {
                // We could inspect the specific status to provide better feedback,
                // but for the purpose of this sample, we merely report whether access was granted
                // and do not study the reason why.
                locationMessage = "Location access is not granted. ";
            }
            string webcamMessage;
            if (result["webcam"] == AppCapabilityAccessStatus.Allowed)
            {
                webcamMessage = "Webcam access is granted. ";
            }
            else
            {
                // We could inspect the specific status to provide better feedback,
                // but for the purpose of this sample, we merely report whether access was granted
                // and do not study the reason why.
                webcamMessage = "Webcam access is not granted. ";
            }
            rootPage.NotifyUser(locationMessage + webcamMessage, NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario2_RequestMany.xaml.cs.

The documentation for this class was generated from the following file:
  • Capabilities/cs/Scenario2_RequestMany.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ScopedViews Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ScopedViews
Public Member Functions

Scenario2_ScopedViews Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_ScopedViews ()

Detailed Description

Definition at line 21 of file Scenario2_ScopedViews.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ScopedViews ( ) [inline]

Definition at line 23 of file Scenario2_ScopedViews.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following files:
  • TouchKeyboardTextInput/cs/Scenario2_ScopedViews.xaml.cs
  • TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ScriptDetection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ScriptDetection
Public Member Functions | Private Attributes

Scenario2_ScriptDetection Class Reference

List of all members.

Public Member Functions

Scenario2_ScriptDetection ()
void Go_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario2_ScriptDetection.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ScriptDetection ( ) [inline]

Definition at line 23 of file Scenario2_ScriptDetection.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void Go_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 28 of file Scenario2_ScriptDetection.xaml.cs.

        {
            StringBuilder output = new StringBuilder();
            foreach (RecognizedTextRun run in LinguisticServices.RecognizeTextScripts(TextInput.Text))
            {
                output.AppendLine($"Range from {run.First} to {run.Last}: {run.Script} script");
            }
            TextOutput.Text = output.ToString();

        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_ScriptDetection.xaml.cs.

The documentation for this class was generated from the following file:
  • LinguisticServices/cs/Scenario2_ScriptDetection.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Settings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Settings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Settings Class Reference

List of all members.

Public Member Functions

Scenario2_Settings ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | DeleteSetting_Click (Object sender, RoutedEventArgs e)
void | DisplayOutput ()
void | WriteSetting_Click (Object sender, RoutedEventArgs e)

Private Attributes

ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings
const string | SettingName = "exampleSetting"

Detailed Description

Definition at line 19 of file Scenario2_Settings.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Settings ( ) [inline]

Definition at line 25 of file Scenario2_Settings.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void DeleteSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario2_Settings.xaml.cs.

        {
            localSettings.Values.Remove(SettingName);

            DisplayOutput();
        }

void DisplayOutput ( ) [inline, private]

Definition at line 59 of file Scenario2_Settings.xaml.cs.

        {
            Object value = localSettings.Values[SettingName];

            OutputTextBlock.Text = String.Format("Setting: {0}", (value == null ? "<empty>" : ("\"" + value + "\"")));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 66 of file Scenario2_Settings.xaml.cs.

        {
            DisplayOutput();
        }

void WriteSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario2_Settings.xaml.cs.

        {
            localSettings.Values[SettingName] = "Hello World"; // example value

            DisplayOutput();
        }

Member Data Documentation

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [private]

Definition at line 21 of file Scenario2_Settings.xaml.cs.

const string SettingName = "exampleSetting" [private]

Definition at line 23 of file Scenario2_Settings.xaml.cs.

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario2_Settings.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ShakeEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ShakeEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ShakeEvents Class Reference

List of all members.

Public Member Functions

Scenario2_ShakeEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | ScenarioDisable ()
void | ScenarioEnable ()
async void | Shaken (object sender, AccelerometerShakenEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

Accelerometer | _accelerometer
ushort | _shakeCount = 0
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario2_ShakeEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ShakeEvents ( ) [inline]

Definition at line 30 of file Scenario2_ShakeEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario2_ShakeEvents.xaml.cs.

        {
            _accelerometer = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
            if (_accelerometer != null)
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario2_ShakeEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 110 of file Scenario2_ShakeEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;
            _accelerometer.Shaken -= Shaken;
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 99 of file Scenario2_ShakeEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged += VisibilityChanged;
            _accelerometer.Shaken += Shaken;
            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

async void Shaken | ( | object | sender,
 |  | AccelerometerShakenEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for Shaken events.

Parameters:
sender
e

Definition at line 87 of file Scenario2_ShakeEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _shakeCount++;
                ScenarioOutputText.Text = _shakeCount.ToString();
            });
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 65 of file Scenario2_ShakeEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input
                    _accelerometer.Shaken += Shaken;
                }
                else
                {
                    // Disable sensor input
                    _accelerometer.Shaken -= Shaken;
                }
            }
        }

Member Data Documentation

Accelerometer _accelerometer [private]

Definition at line 23 of file Scenario2_ShakeEvents.xaml.cs.

ushort _shakeCount = 0 [private]

Definition at line 24 of file Scenario2_ShakeEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_ShakeEvents.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario2_ShakeEvents.xaml.cs
  • Accelerometer/cpp/Scenario2_ShakeEvents.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ShowHideEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ShowHideEvents
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario2_ShowHideEvents Class Reference

Sample page to subscribe show/hide event of Touch Keyboard.

List of all members.

Public Member Functions

Scenario2_ShowHideEvents ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnHiding (InputPane sender, InputPaneVisibilityEventArgs e)
void | OnShowing (InputPane sender, InputPaneVisibilityEventArgs e)

Detailed Description

Definition at line 23 of file Scenario2_ShowHideEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ShowHideEvents ( ) [inline]

Definition at line 25 of file Scenario2_ShowHideEvents.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnHiding | ( | InputPane | sender,
 |  | InputPaneVisibilityEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario2_ShowHideEvents.xaml.cs.

        {
            LastInputPaneEventRun.Text = "Hiding";
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_ShowHideEvents.xaml.cs.

        {
            InputPane currentInputPane = InputPane.GetForCurrentView();

            // Unsubscribe from Showing/Hiding events
            currentInputPane.Showing -= OnShowing;
            currentInputPane.Hiding -= OnHiding;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario2_ShowHideEvents.xaml.cs.

        {
            InputPane currentInputPane = InputPane.GetForCurrentView();

            // Subscribe to Showing/Hiding events
            currentInputPane.Showing += OnShowing;
            currentInputPane.Hiding += OnHiding;
        }

void OnShowing | ( | InputPane | sender,
 |  | InputPaneVisibilityEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario2_ShowHideEvents.xaml.cs.

        {
            LastInputPaneEventRun.Text = "Showing";
        }

The documentation for this class was generated from the following file:
  • TouchKeyboard/cs/Scenario2_ShowHideEvents.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SimpleGridView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_SimpleGridView
Public Member Functions

Scenario2_SimpleGridView Class Reference

List of all members.

Public Member Functions

Scenario2_SimpleGridView ()

Detailed Description

Definition at line 16 of file Scenario2_SimpleGridView.xaml.cs.

Constructor & Destructor Documentation

Scenario2_SimpleGridView ( ) [inline]

Definition at line 18 of file Scenario2_SimpleGridView.xaml.cs.

        {
            InitializeComponent();
            ContactsCVS.Source = Contact.GetContactsGrouped(250);
        }

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario2_SimpleGridView.xaml.cs
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Stats Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Stats
Public Member Functions | Private Member Functions

Scenario2_Stats Class Reference

List of all members.

Public Member Functions

Scenario2_Stats ()

Private Member Functions

string | ReportCalendarData (Calendar calendar, string calendarLabel)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario2_Stats.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Stats ( ) [inline]

Definition at line 21 of file Scenario2_Stats.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportCalendarData | ( | Calendar | calendar,
 |  | string | calendarLabel |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario2_Stats.xaml.cs.

        {
            string results = calendarLabel + ": " + calendar.GetCalendarSystem() + "\n";
            results += "Months in this Year: " + calendar.NumberOfMonthsInThisYear + "\n";
            results += "Days in this Month: " + calendar.NumberOfDaysInThisMonth + "\n";
            results += "Hours in this Period: " + calendar.NumberOfHoursInThisPeriod + "\n";
            results += "Era: " + calendar.EraAsString() + "\n";
            results += "\n";
            return results;
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario2_Stats.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.Calendar class to display the calendar
            // system statistics.

            // Create Calendar objects using different constructors.
            Calendar calendar = new Calendar();
            Calendar japaneseCalendar = new Calendar(new[] { "ja-JP" }, CalendarIdentifiers.Japanese, ClockIdentifiers.TwelveHour);
            Calendar hebrewCalendar = new Calendar(new[] { "he-IL" }, CalendarIdentifiers.Hebrew, ClockIdentifiers.TwentyFourHour);

            // Display results
            OutputTextBlock.Text =
                ReportCalendarData(calendar, "User's default calendar system") +
                ReportCalendarData(japaneseCalendar, "Calendar system") +
                ReportCalendarData(hebrewCalendar, "Calendar system");
        }

The documentation for this class was generated from the following files:
  • Calendar/cs/Scenario2_Stats.xaml.cs
  • Calendar/cpp/Scenario2_Stats.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_StringTemplate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_StringTemplate
Public Member Functions | Private Member Functions

Scenario2_StringTemplate Class Reference

List of all members.

Public Member Functions

Scenario2_StringTemplate ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 24 of file Scenario2_StringTemplate.xaml.cs.

Constructor & Destructor Documentation

Scenario2_StringTemplate ( ) [inline]

Definition at line 26 of file Scenario2_StringTemplate.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 34 of file Scenario2_StringTemplate.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
            // to format a date/time via a string template.  Note that the order specifed in the string pattern does
            // not determine the order of the parts of the formatted string.  The user's language and region preferences will
            // determine the pattern of the date returned based on the specified parts.

            // Create template-based date/time formatters.
            DateTimeFormatter[] dateFormatters = new[]
            {
                // Formatters for dates.
                new DateTimeFormatter("month day"),
                new DateTimeFormatter("month year"),
                new DateTimeFormatter("month day year"),
                new DateTimeFormatter("month day dayofweek year"),
                new DateTimeFormatter("dayofweek.abbreviated"),
                new DateTimeFormatter("month.abbreviated"),
                new DateTimeFormatter("year.abbreviated")
            };

            // Create template-based date/time formatters.
            DateTimeFormatter[] timeFormatters = new[]
            {
                // Formatters for time.
                new DateTimeFormatter("hour minute"),
                new DateTimeFormatter("hour minute second"),
                new DateTimeFormatter("hour")
            };

            // Create template-based date/time formatters.
            DateTimeFormatter[] timeZoneFormatters = new[]
            {
                // Formatters for time zone.
                new DateTimeFormatter("timezone"),
                new DateTimeFormatter("timezone.full"),
                new DateTimeFormatter("timezone.abbreviated")
            };

            // Create template-based date/time formatters.
            DateTimeFormatter[] combinationFormatters = new[]
            {
                // Formatters for combinations.
                new DateTimeFormatter("hour minute second timezone.full"),
                new DateTimeFormatter("day month year hour minute timezone"),
                new DateTimeFormatter("dayofweek day month year hour minute second"),
                new DateTimeFormatter("dayofweek.abbreviated day month hour minute"),
                new DateTimeFormatter("dayofweek day month year hour minute second timezone.abbreviated"),
             };

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // We keep results in this variable
            StringBuilder results = new StringBuilder();
            results.AppendLine("Current application context language: " + ApplicationLanguages.Languages[0]);
            results.AppendLine();
            results.AppendLine("Dates:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in dateFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            results.AppendLine();
            results.AppendLine("Times:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in timeFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            results.AppendLine();
            results.AppendLine("Time zones:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in timeZoneFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            results.AppendLine();
            results.AppendLine("Date and time combinations:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in combinationFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario2_StringTemplate.xaml.cs
  • DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.cpp
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SupportedTactileFeedback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_SupportedTactileFeedback
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_SupportedTactileFeedback Class Reference

List of all members.

Public Member Functions

Scenario2_SupportedTactileFeedback ()

Private Member Functions

void | Pointer_Entered (object sender, PointerRoutedEventArgs e)
void | Pointer_Exited (object sender, PointerRoutedEventArgs e)

Private Attributes

SimpleHapticsController | hapticsController
PenDevice | penDevice

Detailed Description

Definition at line 22 of file Scenario2_SupportedTactileFeedback.xaml.cs.

Constructor & Destructor Documentation

Scenario2_SupportedTactileFeedback ( ) [inline]

Definition at line 27 of file Scenario2_SupportedTactileFeedback.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void Pointer_Entered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario2_SupportedTactileFeedback.xaml.cs.

        {
            // If the current Pointer device is not a pen, exit
            if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
            {
                supportedFeatures.Text = "";
                supportedFeedback.Text = "";
                return;
            }

            // Attempt to retrieve the PenDevice from the current PointerId
            penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);

            // If a PenDevice cannot be retrieved based on the PointerId, it does not support
            // advanced pen features, such as tactile feedback
            if (penDevice == null)
            {
                statusText.Text = "Advanced pen features not supported";
                supportedFeatures.Text = "";
                supportedFeedback.Text = "";
                return;
            }

            // Check to see if the current PenDevice supports tactile feedback by seeing if it
            // has a SimpleHapticsController
            hapticsController = penDevice.SimpleHapticsController;
            if (hapticsController == null)
            {
                statusText.Text = "This pen does not provide tactile feedback";
                return;
            }

            // Check which tactile feedback features are supported
            supportedFeatures.Text = "Supported Haptics Features:\n";
            if (hapticsController.IsIntensitySupported)
            {
                supportedFeatures.Text += "Intensity\n";
            }
            if (hapticsController.IsPlayCountSupported)
            {
                supportedFeatures.Text += "PlayCount\n";
            }
            if (hapticsController.IsPlayDurationSupported)
            {
                supportedFeatures.Text += "PlayDuration\n";
            }
            if (hapticsController.IsReplayPauseIntervalSupported)
            {
                supportedFeatures.Text += "ReplayPauseInterval\n";
            }

            // Check which feedback waveforms are supported
            supportedFeedback.Text = "Supported Feedback:\n";
            foreach (SimpleHapticsControllerFeedback feedback in hapticsController.SupportedFeedback)
            {
                ushort waveform = feedback.Waveform;
                foreach (KeyValuePair<string, ushort> entry in MainPage.WaveformNamesMap)
                {
                    if (entry.Value == waveform)
                    {
                        supportedFeedback.Text += entry.Key + "\n";
                        break;
                    }
                }
            }
            statusText.Text = "";
        }

void Pointer_Exited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario2_SupportedTactileFeedback.xaml.cs.

        {
            penDevice = null;
            hapticsController = null;
        }

Member Data Documentation

SimpleHapticsController hapticsController [private]

Definition at line 24 of file Scenario2_SupportedTactileFeedback.xaml.cs.

PenDevice penDevice [private]

Definition at line 25 of file Scenario2_SupportedTactileFeedback.xaml.cs.

The documentation for this class was generated from the following file:
  • PenHaptics/cs/Scenario2_SupportedTactileFeedback.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SynchronizingPlayers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_SynchronizingPlayers
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_SynchronizingPlayers Class Reference

Multi-video playback syncronization using TimelineControllerPositionOffset.

List of all members.

Public Member Functions

Scenario2_SynchronizingPlayers ()

Private Member Functions

void | EnablePlaybackControls (bool enabled)
void | Load_Click (object sender, RoutedEventArgs e)
void | MediaPlayer_MediaOpened (MediaPlayer sender, object args)
void | MediaTimelineController_PositionChanged (MediaTimelineController sender, object args)
async void | MediaTimelineController_StateChanged (MediaTimelineController sender, object args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | Page_OnUnloaded (object sender, RoutedEventArgs e)
void | PlayPause_Click (object sender, RoutedEventArgs e)
void | Seek2SecondsBack_Click (object sender, RoutedEventArgs e)
void | Seek2SecondsForward_Click (object sender, RoutedEventArgs e)

Private Attributes

TimeSpan | maxNaturalDurationForController = TimeSpan.Zero
List< MediaPlayerElement > | mediaPlayerElements
Uri[] | mediaUris
MediaTimelineController | timelineController = null

Detailed Description

Definition at line 27 of file Scenario2_SynchronizingPlayers.xaml.cs.

Constructor & Destructor Documentation

Scenario2_SynchronizingPlayers ( ) [inline]

Definition at line 40 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            this.InitializeComponent();

            mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeCopy };

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                // Create a corresponding MediaPlayer for each MediaPlayerElement.
                mpe.SetMediaPlayer(new MediaPlayer());
            }
        }

Member Function Documentation

void EnablePlaybackControls ( bool enabled ) [inline, private]

Definition at line 139 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            Seek2SecondsBack.IsEnabled = enabled;
            PlayPause.IsEnabled = enabled;
            Seek2SecondsForward.IsEnabled = enabled;
        }

void Load_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Sets the content on the MediaPlayers.

Definition at line 149 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            EnablePlaybackControls(false);

            // First reset the max duration, as the content is about to change.
            maxNaturalDurationForController = TimeSpan.Zero;

            // Correct for offset between the two videos.
            // Do this before setting the Source on the MediaPlayer to avoid a visible seek on MediaOpened.
            mediaPlayerElements[1].MediaPlayer.TimelineControllerPositionOffset = TimeSpan.FromSeconds(5.1);

            for (int i = 0; i < mediaUris.Length; i++)
            {
                MediaPlayer mp = mediaPlayerElements[i].MediaPlayer;

                // Set the Source property to a MediaSource, MediaPlaybackItem or MediaPlaybackList.
                mp.Source = MediaSource.CreateFromUri(mediaUris[i]);

                // In this demo, all of the videos has the same audio track, so mute all but the first one.
                mp.IsMuted = (i != 0);
            }

            // Enable our custom playback controls now that everything is set up.
            EnablePlaybackControls(true);
        }

void MediaPlayer_MediaOpened | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Maintain maxNaturalDurationForController so it is as long as the longest media source.
            var naturalDurationForController = sender.PlaybackSession.NaturalDuration - sender.TimelineControllerPositionOffset;
            if (naturalDurationForController > maxNaturalDurationForController)
            {
                maxNaturalDurationForController = naturalDurationForController;
            }
        }

void MediaTimelineController_PositionChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 130 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Pause when playback reaches the maximum duration.
            if (sender.Position > maxNaturalDurationForController)
            {
                sender.Pause();
            }
        }

async void MediaTimelineController_StateChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Update the Play/Pause button based on the new state.
            Symbol newSymbol;
            switch (sender.State)
            {
                case MediaTimelineControllerState.Paused:
                    newSymbol = Symbol.Play;
                    break;

                case MediaTimelineControllerState.Running:
                    newSymbol = Symbol.Pause;
                    break;

                default:
                    return;
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Create a single MediaTimelineController which will control all of the MediaPlayers.
            timelineController = new MediaTimelineController();

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;

                // The CommandManager object must be disabled when attaching a MediaTimelineController.
                // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
                // and apply additional business logic.
                // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
                mp.CommandManager.IsEnabled = false;
                // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
                mp.TimelineController = timelineController;

                // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
                // To avoid confusing the user, it is best to turn them off.
                mpe.AreTransportControlsEnabled = false;

                // MediaOpened is the right time to find the highest natural duration.
                mp.MediaOpened += MediaPlayer_MediaOpened;
            }

            // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
            timelineController.StateChanged += MediaTimelineController_StateChanged;

            // Since this is a sample of video on demand, constrain the MediaTimelineController
            // to pause when it reaches the natural end of the last video.
            timelineController.PositionChanged += MediaTimelineController_PositionChanged;

            // We are now set up to load content.
            Load.IsEnabled = true;
        }

void Page_OnUnloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Dispose the MediaPlayer objects so they will stop streaming.
            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;
                mp.MediaOpened -= MediaPlayer_MediaOpened;
                mp.Dispose();
            }
        }

void PlayPause_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 175 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            if (timelineController.State == MediaTimelineControllerState.Paused)
            {
                timelineController.Resume();
            }
            else if (timelineController.State == MediaTimelineControllerState.Running)
            {
                timelineController.Pause();
            }
        }

void Seek2SecondsBack_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 201 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            timelineController.Position -= TimeSpan.FromSeconds(2);
        }

void Seek2SecondsForward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 187 of file Scenario2_SynchronizingPlayers.xaml.cs.

        {
            // Go forward 2 seconds, but not beyond our maximum value.
            var requestedPosition = timelineController.Position + TimeSpan.FromSeconds(2);
            if (requestedPosition <= maxNaturalDurationForController)
            {
                timelineController.Position = requestedPosition;
            }
            else
            {
                timelineController.Position = maxNaturalDurationForController;
            }
        }

Member Data Documentation

TimeSpan maxNaturalDurationForController = TimeSpan.Zero [private]

Definition at line 31 of file Scenario2_SynchronizingPlayers.xaml.cs.

List<MediaPlayerElement> mediaPlayerElements [private]

Definition at line 29 of file Scenario2_SynchronizingPlayers.xaml.cs.

Uri [] mediaUris [private]
Initial value:
 new Uri[2]
        {
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back.mp4"),
                new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back-offset-5-seconds.mp4"),
        }

Definition at line 34 of file Scenario2_SynchronizingPlayers.xaml.cs.

MediaTimelineController timelineController = null [private]

Definition at line 30 of file Scenario2_SynchronizingPlayers.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlaybackSynchronization/cs/Scenario2_SynchronizingPlayers.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SystemDefaultMenu Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_SystemDefaultMenu
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_SystemDefaultMenu Class Reference

List of all members.

Public Member Functions

Scenario2_SystemDefaultMenu ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | AddCustomItem (object sender, RoutedEventArgs e)
void | Controller_RotationChanged (RadialController sender, RadialControllerRotationChangedEventArgs args)
void | ModifySystemDefaults (object sender, RoutedEventArgs e)
void | OnLogSizeChanged (object sender, object e)
void | PrintSelectedItem ()
void | Remove_Defaults (object sender, RoutedEventArgs e)
void | RemoveCustomItem (object sender, RoutedEventArgs e)
void | Reset_ToDefault (object sender, RoutedEventArgs e)
void | Select_Volume (object sender, RoutedEventArgs e)
void | SelectCustomItem (object sender, RoutedEventArgs e)
void | SelectPreviouslySelectedItem (object sender, RoutedEventArgs e)

Private Attributes

RadialControllerConfiguration | config
RadialController | controller
RadialControllerMenuItem | customItem

Detailed Description

Definition at line 21 of file Scenario2_SystemDefaultMenu.xaml.cs.

Constructor & Destructor Documentation

Scenario2_SystemDefaultMenu ( ) [inline]

Definition at line 27 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            this.InitializeComponent();

            controller = RadialController.CreateForCurrentView();
            controller.RotationChanged += Controller_RotationChanged;

            customItem = RadialControllerMenuItem.CreateFromKnownIcon("Item1", RadialControllerMenuKnownIcon.InkColor);
        }

Member Function Documentation

void AddCustomItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            if (!controller.Menu.Items.Contains(customItem))
            {
                controller.Menu.Items.Add(customItem);
            }
        }

void Controller_RotationChanged | ( | RadialController | sender,
 |  | RadialControllerRotationChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            log.Text += "\nRotation Changed Delta = " + args.RotationDeltaInDegrees;
            if (args.Contact != null)
            {
                log.Text += "\nBounds = " + args.Contact.Bounds.ToString();
                log.Text += "\nPosition = " + args.Contact.Position.ToString();
            }

            slider1.Value += args.RotationDeltaInDegrees;
        }

void ModifySystemDefaults | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            config = RadialControllerConfiguration.GetForCurrentView();
            config.SetDefaultMenuItems(new[] { RadialControllerSystemMenuItemKind.Volume, RadialControllerSystemMenuItemKind.Scroll });
        }

void OnLogSizeChanged | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            logViewer.ChangeView(null, logViewer.ExtentHeight, null);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            controller.Menu.Items.Clear();
        }

void PrintSelectedItem ( ) [inline, private]

Definition at line 79 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            RadialControllerMenuItem selectedMenuItem = controller.Menu.GetSelectedMenuItem();

            if (selectedMenuItem == customItem)
            {
                log.Text += "\n Selected : " + selectedMenuItem.DisplayText;
            }
            else
            {
                log.Text += "\n Selected System Item";
            }
        }

void Remove_Defaults | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 123 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            config = RadialControllerConfiguration.GetForCurrentView();
            config.SetDefaultMenuItems(new RadialControllerSystemMenuItemKind[] { });
        }

void RemoveCustomItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 107 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            if (controller.Menu.Items.Contains(customItem))
            {
                controller.Menu.Items.Remove(customItem);
            }
        }

void Reset_ToDefault | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            config = RadialControllerConfiguration.GetForCurrentView();
            config.ResetToDefaultMenuItems();
        }

void Select_Volume | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            config = RadialControllerConfiguration.GetForCurrentView();
            config.TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind.Volume);
        }

void SelectCustomItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 115 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            if (controller.Menu.Items.Contains(customItem))
            {
                controller.Menu.SelectMenuItem(customItem);
            }
        }

void SelectPreviouslySelectedItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario2_SystemDefaultMenu.xaml.cs.

        {
            if (controller.Menu.TrySelectPreviouslySelectedMenuItem())
            {
                PrintSelectedItem();
            }
        }

Member Data Documentation

RadialControllerConfiguration config [private]

Definition at line 23 of file Scenario2_SystemDefaultMenu.xaml.cs.

RadialController controller [private]

Definition at line 24 of file Scenario2_SystemDefaultMenu.xaml.cs.

RadialControllerMenuItem customItem [private]

Definition at line 25 of file Scenario2_SystemDefaultMenu.xaml.cs.

The documentation for this class was generated from the following file:
  • RadialController/cs/Scenario2_SystemDefaultMenu.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ToggleMobileHotspot Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_ToggleMobileHotspot
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_ToggleMobileHotspot Class Reference

List of all members.

Public Member Functions

Scenario2_ToggleMobileHotspot ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | MobileHotspotToggle_Toggled (object sender, RoutedEventArgs e)

Private Attributes

NetworkOperatorTetheringManager | m_tetheringManager = null
bool | m_toggling = false

Detailed Description

Definition at line 20 of file Scenario2_ToggleMobileHotspot.xaml.cs.

Constructor & Destructor Documentation

Scenario2_ToggleMobileHotspot ( ) [inline]

Definition at line 25 of file Scenario2_ToggleMobileHotspot.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void MobileHotspotToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario2_ToggleMobileHotspot.xaml.cs.

        {
            if (m_toggling)
            {
                return;
            }
            MainPage.Current.NotifyUser("", NotifyType.StatusMessage);

            bool isTethered = m_tetheringManager.TetheringOperationalState == TetheringOperationalState.On;
            if (MobileHotspotToggle.IsOn == isTethered)
            {
                // Already in desired state.
                return;
            }

            // Switch to opposite state.
            m_toggling = true;

            NetworkOperatorTetheringOperationResult result;
            if (isTethered)
            {
                result = await m_tetheringManager.StopTetheringAsync();
            }
            else
            {
                result = await m_tetheringManager.StartTetheringAsync();
            }

            if (result.Status == TetheringOperationStatus.Success)
            {
                // Change to new state.
                MobileHotspotToggle.IsOn = !isTethered;
            }
            else
            {
                // Return to old state.
                MobileHotspotToggle.IsOn = isTethered;

                switch (result.Status)
                {
                    case TetheringOperationStatus.WiFiDeviceOff:
                        MainPage.Current.NotifyUser(
                            "Wi-Fi adapter is either turned off or missing.",
                            NotifyType.ErrorMessage);
                        break;

                    default:
                        MainPage.Current.NotifyUser(
                            $"Unhandled result while toggling Mobile Hotspot: {result.Status}",
                            NotifyType.ErrorMessage);
                        break;
                }
            }
            m_toggling = false;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario2_ToggleMobileHotspot.xaml.cs.

        {
            MainPage.Current.NotifyUser("", NotifyType.StatusMessage);

            m_tetheringManager = Helpers.TryGetCurrentNetworkOperatorTetheringManager();

            if (m_tetheringManager != null)
            {
                NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();
                SsidRun.Text = configuration.Ssid;
                PasswordRun.Text = configuration.Passphrase;
                BandRun.Text = Helpers.GetFriendlyName(configuration.Band);

                m_toggling = true;
                bool isTethered = m_tetheringManager.TetheringOperationalState == TetheringOperationalState.On;
                MobileHotspotToggle.IsOn = isTethered;
                m_toggling = false;

                HotspotPanel.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

NetworkOperatorTetheringManager m_tetheringManager = null [private]

Definition at line 22 of file Scenario2_ToggleMobileHotspot.xaml.cs.

bool m_toggling = false [private]

Definition at line 23 of file Scenario2_ToggleMobileHotspot.xaml.cs.

The documentation for this class was generated from the following file:
  • MobileHotspot/cs/Scenario2_ToggleMobileHotspot.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_UnpinTile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_UnpinTile
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_UnpinTile Class Reference

List of all members.

Public Member Functions

Scenario2_UnpinTile ()

Private Member Functions

async void UnpinSecondaryTile_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario2_UnpinTile.xaml.cs.

Constructor & Destructor Documentation

Scenario2_UnpinTile ( ) [inline]

Definition at line 22 of file Scenario2_UnpinTile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void UnpinSecondaryTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario2_UnpinTile.xaml.cs.

        {
            if (SecondaryTile.Exists(MainPage.logoSecondaryTileId))
            {
                // First prepare the tile to be unpinned
                SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId);
                // Now make the delete request.
                bool isUnpinned = await secondaryTile.RequestDeleteForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Below);
                if (isUnpinned)
                {
                    rootPage.NotifyUser("Secondary tile successfully unpinned.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Secondary tile not unpinned.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is not currently pinned.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario2_UnpinTile.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario2_UnpinTile.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Upload Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_Upload
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Upload Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2_Upload ()
void | Dispose ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CancelAll_Click (object sender, RoutedEventArgs e)
async Task | DiscoverActiveUploadsAsync ()
async Task | HandleUploadAsync (UploadOperation upload, bool start)
bool | IsExceptionHandled (string title, Exception ex, UploadOperation upload=null)
void | Log (string message)
void | LogStatus (string message, NotifyType type)
void | MarshalLog (string value)
void | StartMultipartUpload_Click (object sender, RoutedEventArgs e)
async void | StartMultipleFilesUpload (FileOpenPicker picker, Uri uri)
async void | StartSingleFileUpload (FileOpenPicker picker, Uri uri)
void | StartUpload_Click (object sender, RoutedEventArgs e)
async void | UploadMultipleFiles (Uri uri, IReadOnlyList< StorageFile > files)
void | UploadProgress (UploadOperation upload)
async void | UploadSingleFile (Uri uri, StorageFile file)

Private Attributes

CancellationTokenSource | cts
const int | maxUploadFileSize = 100 * 1024 * 1024
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 31 of file Scenario2_Upload.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Upload ( ) [inline]

Definition at line 41 of file Scenario2_Upload.xaml.cs.

        {
            cts = new CancellationTokenSource();

            this.InitializeComponent();
        }

Member Function Documentation

void CancelAll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 239 of file Scenario2_Upload.xaml.cs.

        {
            Log("Canceling all active uploads");

            cts.Cancel();
            cts.Dispose();

            // Re-create the CancellationTokenSource and activeUploads for future uploads.
            cts = new CancellationTokenSource();
        }

async Task DiscoverActiveUploadsAsync ( ) [inline, private]

Definition at line 74 of file Scenario2_Upload.xaml.cs.

        {
            IReadOnlyList<UploadOperation> uploads = null;
            try
            {
                uploads = await BackgroundUploader.GetCurrentUploadsAsync();
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Discovery error", ex))
                {
                    throw;
                }
                return;
            }

            Log("Loading background uploads: " + uploads.Count);

            if (uploads.Count > 0)
            {
                List<Task> tasks = new List<Task>();
                foreach (UploadOperation upload in uploads)
                {
                    Log(String.Format(CultureInfo.CurrentCulture, "Discovered background upload: {0}, Status: {1}",
                        upload.Guid, upload.Progress.Status));

                    // Attach progress and completion handlers.
                    tasks.Add(HandleUploadAsync(upload, false));
                }

                // Don't await HandleUploadAsync() in the foreach loop since we would attach to the second
                // upload only when the first one completed; attach to the third upload when the second one
                // completes etc. We want to attach to all uploads immediately.
                // If there are actions that need to be taken once uploads complete, await tasks here, outside
                // the loop.
                await Task.WhenAll(tasks);
            }
        }

void Dispose ( ) [inline]

Definition at line 48 of file Scenario2_Upload.xaml.cs.

        {
            if (cts != null)
            {
                cts.Dispose();
                cts = null;
            }

            GC.SuppressFinalize(this);
        }

async Task HandleUploadAsync | ( | UploadOperation | upload,
 |  | bool | start |
 | ) |  |  | [inline, private]

Definition at line 286 of file Scenario2_Upload.xaml.cs.

        {
            try
            {
                LogStatus("Running: " + upload.Guid, NotifyType.StatusMessage);

                Progress<UploadOperation> progressCallback = new Progress<UploadOperation>(UploadProgress);
                if (start)
                {
                    // Start the upload and attach a progress handler.
                    await upload.StartAsync().AsTask(cts.Token, progressCallback);
                }
                else
                {
                    // The upload was already running when the application started, re-attach the progress handler.
                    await upload.AttachAsync().AsTask(cts.Token, progressCallback);
                }

                ResponseInformation response = upload.GetResponseInformation();

                LogStatus(String.Format(CultureInfo.CurrentCulture, "Completed: {0}, Status Code: {1}", upload.Guid,
                    response.StatusCode), NotifyType.StatusMessage);
            }
            catch (TaskCanceledException)
            {
                LogStatus("Canceled: " + upload.Guid, NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Error", ex, upload))
                {
                    throw;
                }
            }
        }

bool IsExceptionHandled | ( | string | title,
 |  | Exception | ex,
 |  | UploadOperation | upload = null |
 | ) |  |  | [inline, private]

Definition at line 322 of file Scenario2_Upload.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            if (error == WebErrorStatus.Unknown)
            {
                return false;
            }

            if (upload == null)
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0}: {1}", title, error),
                    NotifyType.ErrorMessage);
            }
            else
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0} - {1}: {2}", upload.Guid, title,
                    error), NotifyType.ErrorMessage);
            }

            return true;
        }

void Log ( string message ) [inline, private]

Definition at line 353 of file Scenario2_Upload.xaml.cs.

        {
            outputField.Text += message + "\r\n";
        }

void LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 358 of file Scenario2_Upload.xaml.cs.

        {
            rootPage.NotifyUser(message, type);
            Log(message);
        }

void MarshalLog ( string value ) [inline, private]

Definition at line 345 of file Scenario2_Upload.xaml.cs.

        {
            var ignore = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Log(value);
            });
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 64 of file Scenario2_Upload.xaml.cs.

        {
            // An application must enumerate uploads when it gets started to prevent stale downloads/uploads.
            // Typically this can be done in the App class by overriding OnLaunched() and checking for
            // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
            // We do it here in the sample to keep the sample code consolidated.
            await DiscoverActiveUploadsAsync();
        }

void StartMultipartUpload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 160 of file Scenario2_Upload.xaml.cs.

        {
            // By default 'serverAddressField' is disabled and URI validation is not required. When enabling the text
            // box validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Private Networks (Client and Server)" capability.
            Uri uri;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            FileOpenPicker picker = new FileOpenPicker();
            picker.FileTypeFilter.Add("*");

            StartMultipleFilesUpload(picker, uri);
        }

async void StartMultipleFilesUpload | ( | FileOpenPicker | picker,
 |  | Uri | uri |
 | ) |  |  | [inline, private]

Definition at line 186 of file Scenario2_Upload.xaml.cs.

        {
            IReadOnlyList<StorageFile> files = await picker.PickMultipleFilesAsync();
            UploadMultipleFiles(uri, files);
        }

async void StartSingleFileUpload | ( | FileOpenPicker | picker,
 |  | Uri | uri |
 | ) |  |  | [inline, private]

Definition at line 180 of file Scenario2_Upload.xaml.cs.

        {
            StorageFile file = await picker.PickSingleFileAsync();
            UploadSingleFile(uri, file);
        }

void StartUpload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 113 of file Scenario2_Upload.xaml.cs.

        {
            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Private Networks (Client and Server)" capability.
            Uri uri;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            FileOpenPicker picker = new FileOpenPicker();
            picker.FileTypeFilter.Add("*");

            StartSingleFileUpload(picker, uri);
        }

async void UploadMultipleFiles | ( | Uri | uri,
 |  | IReadOnlyList< StorageFile > | files |
 | ) |  |  | [inline, private]

Definition at line 192 of file Scenario2_Upload.xaml.cs.

        {
            if (files.Count == 0)
            {
                rootPage.NotifyUser("No file selected.", NotifyType.ErrorMessage);
                return;
            }

            ulong totalFileSize = 0;
            for (int i = 0; i < files.Count; i++)
            {
                BasicProperties properties = await files[i].GetBasicPropertiesAsync();
                totalFileSize += properties.Size;

                if (totalFileSize > maxUploadFileSize)
                {
                    rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
                        "Size of selected files exceeds max. upload file size ({0} MB).",
                        maxUploadFileSize / (1024 * 1024)), NotifyType.ErrorMessage);
                    return;
                }
            }

            List<BackgroundTransferContentPart> parts = new List<BackgroundTransferContentPart>();
            for (int i = 0; i < files.Count; i++)
            {
                BackgroundTransferContentPart part = new BackgroundTransferContentPart("File" + i, files[i].Name);
                part.SetFile(files[i]);
                parts.Add(part);
            }

            BackgroundUploader uploader = new BackgroundUploader();
            UploadOperation upload = await uploader.CreateUploadAsync(uri, parts);

            String fileNames = files[0].Name;
            for (int i = 1; i < files.Count; i++)
            {
                fileNames += ", " + files[i].Name;
            }

            Log(String.Format(CultureInfo.CurrentCulture, "Uploading {0} to {1}, {2}", fileNames, uri.AbsoluteUri,
                upload.Guid));

            // Attach progress and completion handlers.
            await HandleUploadAsync(upload, true);
        }

void UploadProgress ( UploadOperation upload ) [inline, private]

Definition at line 251 of file Scenario2_Upload.xaml.cs.

        {
            // UploadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
            // we must make a local copy so that we can have a consistent view of that ever-changing state
            // throughout this method's lifetime.
            BackgroundUploadProgress currentProgress = upload.Progress;

            MarshalLog(String.Format(CultureInfo.CurrentCulture, "Progress: {0}, Status: {1}", upload.Guid,
                currentProgress.Status));

            double percentSent = 100;
            if (currentProgress.TotalBytesToSend > 0)
            {
                percentSent = currentProgress.BytesSent * 100 / currentProgress.TotalBytesToSend;
            }

            MarshalLog(String.Format(CultureInfo.CurrentCulture,
                " - Sent bytes: {0} of {1} ({2}%), Received bytes: {3} of {4}", currentProgress.BytesSent,
                currentProgress.TotalBytesToSend, percentSent, currentProgress.BytesReceived, currentProgress.TotalBytesToReceive));

            if (currentProgress.HasRestarted)
            {
                MarshalLog(" - Upload restarted");
            }

            if (currentProgress.HasResponseChanged)
            {
                // We've received new response headers from the server.
                MarshalLog(" - Response updated; Header count: " + upload.GetResponseInformation().Headers.Count);

                // If you want to stream the response data this is a good time to start.
                // upload.GetResultStreamAt(0);
            }
        }

async void UploadSingleFile | ( | Uri | uri,
 |  | StorageFile | file |
 | ) |  |  | [inline, private]

Definition at line 132 of file Scenario2_Upload.xaml.cs.

        {
            if (file == null)
            {
                rootPage.NotifyUser("No file selected.", NotifyType.ErrorMessage);
                return;
            }

            BasicProperties properties = await file.GetBasicPropertiesAsync();
            if (properties.Size > maxUploadFileSize)
            {
                rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
                    "Selected file exceeds max. upload file size ({0} MB).", maxUploadFileSize / (1024 * 1024)),
                    NotifyType.ErrorMessage);
                return;
            }

            BackgroundUploader uploader = new BackgroundUploader();
            uploader.SetRequestHeader("Filename", file.Name);

            UploadOperation upload = uploader.CreateUpload(uri, file);
            Log(String.Format(CultureInfo.CurrentCulture, "Uploading {0} to {1}, {2}", file.Name, uri.AbsoluteUri,
                upload.Guid));

            // Attach progress and completion handlers.
            await HandleUploadAsync(upload, true);
        }

Member Data Documentation

CancellationTokenSource cts [private]

Definition at line 37 of file Scenario2_Upload.xaml.cs.

const int maxUploadFileSize = 100 * 1024 * 1024 [private]

Definition at line 39 of file Scenario2_Upload.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 35 of file Scenario2_Upload.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario2_Upload.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_WatchUsers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario2_WatchUsers
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_WatchUsers Class Reference

List of all members.

Public Member Functions

Scenario2_WatchUsers ()

Public Attributes

ObservableCollection
< UserViewModel > 		Users = new ObservableCollection<UserViewModel>()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

UserViewModel | FindModelByUserId (string userId)
async Task< String > | GetDisplayNameOrGenericNameAsync (User user)
async void | OnEnumerationCompleted (UserWatcher sender, Object e)
async void | OnUserAdded (UserWatcher sender, UserChangedEventArgs e)
async void | OnUserRemoved (UserWatcher sender, UserChangedEventArgs e)
async void | OnUserUpdated (UserWatcher sender, UserChangedEventArgs e)
async void | OnWatcherStopped (UserWatcher sender, Object e)
void | StartWatching ()
void | StopWatching ()

Private Attributes

MainPage rootPage = MainPage.Current
int | userNumber = 1
UserWatcher | userWatcher = null

Detailed Description

Definition at line 22 of file Scenario2_WatchUsers.xaml.cs.

Constructor & Destructor Documentation

Scenario2_WatchUsers ( ) [inline]

Definition at line 29 of file Scenario2_WatchUsers.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

UserViewModel FindModelByUserId ( string userId ) [inline, private]

Definition at line 80 of file Scenario2_WatchUsers.xaml.cs.

        {
            foreach (UserViewModel model in Users)
            {
                if (model.UserId == userId)
                {
                    return model;
                }
            }
            return null;
        }

async Task<String> GetDisplayNameOrGenericNameAsync ( User user ) [inline, private]

Definition at line 92 of file Scenario2_WatchUsers.xaml.cs.

        {
            // Try to get the display name.
            string displayName = (string)await user.GetPropertyAsync(KnownUserProperties.DisplayName);

            // Choose a generic name if we do not have access to the actual name.
            if (String.IsNullOrEmpty(displayName))
            {
                displayName = "User #" + userNumber.ToString();
                userNumber++;
            }
            return displayName;
        }

async void OnEnumerationCompleted | ( | UserWatcher | sender,
 |  | Object | e |
 | ) |  |  | [inline, private]

Definition at line 156 of file Scenario2_WatchUsers.xaml.cs.

        {
            // UI work must happen on the UI thread.
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                rootPage.NotifyUser("Enumeration complete. Watching for changes...", NotifyType.StatusMessage);
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario2_WatchUsers.xaml.cs.

        {
            StopWatching();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario2_WatchUsers.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void OnUserAdded | ( | UserWatcher | sender,
 |  | UserChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file Scenario2_WatchUsers.xaml.cs.

        {
            User user = e.User;

            // UI work must happen on the UI thread.
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, async () =>
            {
                // Create the user with "..." as the temporary display name.
                // Add it right away, because it might get removed while the
                // "await GetDisplayNameOrGenericNameAsync()" is running.
                var model = new UserViewModel(user.NonRoamableId, "\u2026");
                Users.Add(model);

                // Try to get the display name.
                model.DisplayName = await GetDisplayNameOrGenericNameAsync(user);
            });
        }

async void OnUserRemoved | ( | UserWatcher | sender,
 |  | UserChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 140 of file Scenario2_WatchUsers.xaml.cs.

        {
            User user = e.User;

            // UI work must happen on the UI thread.
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                // Look for the user in our collection and remove it.
                UserViewModel model = FindModelByUserId(user.NonRoamableId);
                if (model != null)
                {
                    Users.Remove(model);
                }
            });
        }

async void OnUserUpdated | ( | UserWatcher | sender,
 |  | UserChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 124 of file Scenario2_WatchUsers.xaml.cs.

        {
            User user = e.User;

            // UI work must happen on the UI thread.
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, async () =>
            {
                // Look for the user in our collection and update the display name.
                UserViewModel model = FindModelByUserId(user.NonRoamableId);
                if (model != null)
                {
                    model.DisplayName = await GetDisplayNameOrGenericNameAsync(user);
                }
            });
        }

async void OnWatcherStopped | ( | UserWatcher | sender,
 |  | Object | e |
 | ) |  |  | [inline, private]

Definition at line 165 of file Scenario2_WatchUsers.xaml.cs.

        {
            // UI work must happen on the UI thread.
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                StopWatching();
            });
        }

void StartWatching ( ) [inline, private]

Definition at line 44 of file Scenario2_WatchUsers.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            userNumber = 1;
            Users.Clear();
            userWatcher = User.CreateWatcher();
            userWatcher.Added += OnUserAdded;
            userWatcher.Updated += OnUserUpdated;
            userWatcher.Removed += OnUserRemoved;
            userWatcher.EnumerationCompleted += OnEnumerationCompleted;
            userWatcher.Stopped += OnWatcherStopped;
            userWatcher.Start();
            StartButton.IsEnabled = false;
            StopButton.IsEnabled = true;
        }

void StopWatching ( ) [inline, private]

Definition at line 62 of file Scenario2_WatchUsers.xaml.cs.

        {
            if (userWatcher != null)
            {
                // Unregister all event handlers in case events are in flight.
                userWatcher.Added -= OnUserAdded;
                userWatcher.Updated -= OnUserUpdated;
                userWatcher.Removed -= OnUserRemoved;
                userWatcher.EnumerationCompleted -= OnEnumerationCompleted;
                userWatcher.Stopped -= OnWatcherStopped;
                userWatcher.Stop();
                userWatcher = null;
                Users.Clear();
                StartButton.IsEnabled = true;
                StopButton.IsEnabled = false;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario2_WatchUsers.xaml.cs.

int userNumber = 1 [private]

Definition at line 26 of file Scenario2_WatchUsers.xaml.cs.

ObservableCollection<UserViewModel> Users = new ObservableCollection<UserViewModel>()

Definition at line 25 of file Scenario2_WatchUsers.xaml.cs.

UserWatcher userWatcher = null [private]

Definition at line 27 of file Scenario2_WatchUsers.xaml.cs.

The documentation for this class was generated from the following file:
  • UserInfo/cs/Scenario2_WatchUsers.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario3 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
async Task | AddLogFileMessageDispatch (string message, string path)
void | AddMessage (string message)
async Task | AddMessageDispatch (string message)

Public Attributes

List< SampleDataModel > | AllItems = SampleDataModel.GetSampleData()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Properties

internal FileLoggingSessionScenario | LoggingScenario [get]

Private Member Functions

void | addXamlChildrenButton_Click (object sender, RoutedEventArgs e)
async void | AnimatedSwitch_Click (object sender, RoutedEventArgs e)
TextBlock | CreateHeaderTextBlock (string contents)
TextBlock | CreateLineItemTextBlock (string contents)
void | Current_VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | DeleteMenuItem_Click (object sender, RoutedEventArgs e)
async void | DoScenario (object sender, RoutedEventArgs e)
async void | EnableDisableLogging (object sender, RoutedEventArgs e)
void | ErasingModeCheckBox_Checked (object sender, RoutedEventArgs e)
void | ErasingModeCheckBox_Unchecked (object sender, RoutedEventArgs e)
void | Fade_Completed (object sender, object e)
Task< bool > | FadeOutContents ()
void | FillComboBox ()
async void | Find_Click (object sender, RoutedEventArgs e)
ScrollViewer | FindScrollViewer (DependencyObject depObject)
SampleDataModel GetDataModelForCurrentListViewFlyout ()
void | GetDependencies_Click (Object sender, RoutedEventArgs e)
async void | GetFilesButton_Click (object sender, RoutedEventArgs e)
async void | GetPicturesLibrary ()
string | GetPropertyDisplayValue (object property)
async void | GetThumbnailButton_Click (object sender, RoutedEventArgs e)
void | InkPresenter_StrokesCollected (InkPresenter sender, InkStrokesCollectedEventArgs args)
void | InkPresenter_StrokesErased (InkPresenter sender, InkStrokesErasedEventArgs args)
void | ListView_ContextCanceled (UIElement sender, RoutedEventArgs args)
void | ListView_ContextRequested (UIElement sender, ContextRequestedEventArgs e)
async void | LoggingScenario_StatusChanged (object sender, LoggingScenarioEventArgs e)
void | mapItemButton_Click (object sender, RoutedEventArgs e)
void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | OnClear (object sender, RoutedEventArgs e)
async void | OnLoadAsync (object sender, RoutedEventArgs e)
void | OnPenColorChanged (object sender, RoutedEventArgs e)
void | OnPenThicknessChanged (object sender, RoutedEventArgs e)
void | OnPenTypeChanged (object sender, RoutedEventArgs e)
async void | OnSaveAsync (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | OpenMenuItem_Click (object sender, RoutedEventArgs e)
void | PrintMenuItem_Click (object sender, RoutedEventArgs e)
async void | ReadTextButton_Click (object sender, RoutedEventArgs e)
async void | RemoveFolderButton_Click (object sender, RoutedEventArgs e)
void | Scenario3Button_Show_Click (object sender, RoutedEventArgs e)
void | TouchInkingCheckBox_Checked (object sender, RoutedEventArgs e)
void | TouchInkingCheckBox_Unchecked (object sender, RoutedEventArgs e)
void | Tts_Resolved (TimedTextSource sender, TimedTextSourceResolveResultEventArgs args)
void | UpdateControls ()
void | UpdateControls ()
async void | WriteTextButton_Click (object sender, RoutedEventArgs e)

Private Attributes

TaskCompletionSource< bool > | animationTask
const string | ColorSpaceProperty = "System.Image.ColorSpace"
const string | CopyrightProperty = "System.Copyright"
Storyboard | fadeOutStoryboard = new Storyboard()
DateTime | lastFadeOutTime = DateTime.Now
const int | minPenSize = 2
MediaPlaybackItemLogger | mpiLogger
MediaSourceLogger | msLogger
int | penSize
const int | penSizeIncrement = 2
StorageLibrary | picturesLibrary
MainPage rootPage = MainPage.Current
MenuFlyout | sharedFlyout
const int | TIMEOUT_LENGTH = 500
Dictionary< TimedTextSource, Uri > | ttsMap = new Dictionary<TimedTextSource, Uri>()

Detailed Description

Demonstrates playing media with closed captions delivered out-of-band, specifically an MP4 video supplemented by external SRT files.

This page demonstrates the usage of the InkPresenter APIs.

UI for the FileLoggingSession sample.

Writing and reading text in a file.

It shows the following functionality:

  • Load/Save ink files
  • Usage of drawing attributes
  • Input type switching to enable/disable touch
  • Pen tip transform, highlighter, pencil, and different pen colors and sizes

Definition at line 23 of file scenario3.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 29 of file scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 19 of file 3-DeviceCapabilities.xaml.cs.

        {
            this.InitializeComponent();

            // Retrieve information about whether or not a keyboard is present
            Windows.Devices.Input.KeyboardCapabilities kbdCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
            keyboardText.Text = "Keyboard present = " + kbdCapabilities.KeyboardPresent.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not a mouse is present
            // - The number of buttons on the mouse
            // - Whether or not the mouse has a vertical scroll wheel
            // - Whether or not the mouse has a horizontal scroll wheel
            // - Whether or not the user has elected to swap the mouse buttons, causing
            //   the right mouse button to be the primary button
            Windows.Devices.Input.MouseCapabilities mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("Mouse present = " + mouseCapabilities.MousePresent.ToString() + "\n");
            sb.Append("Number of buttons = " + mouseCapabilities.NumberOfButtons.ToString() + "\n");
            sb.Append("Vertical wheel present = " + mouseCapabilities.VerticalWheelPresent.ToString() + "\n");
            sb.Append("Horizontal wheel present = " + mouseCapabilities.HorizontalWheelPresent.ToString() + "\n");
            sb.Append("Buttons swapped = " + mouseCapabilities.SwapButtons.ToString());
            mouseText.Text = sb.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not the device supports touch
            // - The supported number of simultaneous touch contacts
            Windows.Devices.Input.TouchCapabilities touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
            sb = new System.Text.StringBuilder();
            sb.Append("Touch present = " + touchCapabilities.TouchPresent.ToString() + "\n");
            sb.Append("Touch contacts supported = " + touchCapabilities.Contacts.ToString());
            touchText.Text = sb.ToString();
        }

Scenario3 ( ) [inline]

Definition at line 28 of file Scenario3_Text.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 26 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 26 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 29 of file S3_RemoveFolder.xaml.cs.

        {
            this.InitializeComponent();
            this.GetPicturesLibrary();
        }

Scenario3 ( ) [inline]

Definition at line 31 of file Scenario3.xaml.cs.

        {
            // This sample UI is interested in events from
            // the LoggingScenario class so the UI can be updated.
            LoggingScenario.StatusChanged += LoggingScenario_StatusChanged;
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 35 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 34 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
            ViewChooser.ItemsSource = ((App)App.Current).SecondaryViews;

            var fadeOut = new FadeOutThemeAnimation();
            fadeOutStoryboard.Children.Add(fadeOut);

            // Normally you can point directly to an object named in your XAML. Since
            // the sample hosts multiple pages, it's convenient for this scenario to
            // get the root element
            Storyboard.SetTarget(fadeOut, (DependencyObject) ((FrameworkElement)rootPage.Content).FindName("Splitter"));
        }

Scenario3 ( ) [inline]

Definition at line 30 of file scenario3_dependencies.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 34 of file GetMatchingPropertiesWithRanges.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 40 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();

            penSize = minPenSize + penSizeIncrement * PenThickness.SelectedIndex;

            InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
            drawingAttributes.Color = Windows.UI.Colors.Red;
            drawingAttributes.Size = new Size(penSize, penSize);
            drawingAttributes.IgnorePressure = false;
            drawingAttributes.FitToCurve = true;

            inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
        }

Scenario3 ( ) [inline]

Definition at line 35 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3 ( ) [inline]

Definition at line 32 of file Scenario3.xaml.cs.

        {
            this.InitializeComponent();
            sharedFlyout = (MenuFlyout)Resources["SampleContextMenu"];
        }

Member Function Documentation

async Task AddLogFileMessageDispatch | ( | string | message,
 |  | string | path |
 | ) |  |  | [inline]

Dispatch to the UI thread and add a message to the UI control which displays status while the sample is running.

Parameters:
message The message to append to the UI log.

Definition at line 115 of file Scenario3.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
            {
                string finalMessage;
                if (path != null && path.Length > 0)
                {
                    var directoryName = System.IO.Path.GetDirectoryName(path);
                    var fileName = System.IO.Path.GetFileName(path);
                    finalMessage = string.Format("{0}: {1}", message, fileName);
                    ViewLogInfo.Text =
                       $"Log folder: \"{directoryName}\"\r\n" +
                       $"- To view with tracerpt: tracerpt.exe \"{path}\" -of XML -o LogFile.xml\r\n" +
                       $"- To view with Windows Performance Toolkit (WPT):\r\n" +
                       $"   xperf -merge \"{path}\" merged.etl\r\n" +
                       $"   wpa.exe merged.etl";
                }
                else
                {
                    finalMessage = string.Format("{0}: none, nothing logged since saving the last file.", message);
                }
                AddMessage(finalMessage);
            }).AsTask();
        }

void AddMessage ( string message ) [inline]

Add a message to the UI control which displays status while the sample is running.

Parameters:
message The message to append to the UI log.

Definition at line 98 of file Scenario3.xaml.cs.

        {
            string messageToAdd = message + "\r\n";
            StatusMessageList.Text += messageToAdd;
            StatusMessageList.Select(StatusMessageList.Text.Length, 0);

            ScrollViewer svFind = FindScrollViewer(StatusMessageList);
            if (svFind != null)
            {
                svFind.ChangeView(null, StatusMessageList.ActualHeight, null);
            }
        }

async Task AddMessageDispatch ( string message ) [inline]

Dispatch to the UI thread and add a message to the UI log.

Parameters:
message The message to appened to the UI log.
Returns:
The task.

Definition at line 145 of file Scenario3.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
            {
                AddMessage(message);
            }).AsTask();
        }

void addXamlChildrenButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario3.xaml.cs.

        {
            BasicGeoposition center = myMap.Center.Position;
            var pinUri = new Uri("ms-appx:///Assets/MapPin.png");
            MapItems.ItemsSource = new List<PointOfInterest>()
            {
                new PointOfInterest()
                {
                    DisplayName = "Place One",
                    ImageSourceUri = pinUri,
                    NormalizedAnchorPoint = new Point(0.5, 1),
                    Location = new Geopoint(new BasicGeoposition()
                    {
                        Latitude = center.Latitude + 0.001,
                        Longitude = center.Longitude - 0.001
                    })
                },
                new PointOfInterest()
                {
                    DisplayName = "Place Two",
                    ImageSourceUri = pinUri,
                    NormalizedAnchorPoint = new Point(0.5, 1),
                    Location = new Geopoint(new BasicGeoposition()
                    {
                        Latitude = center.Latitude + 0.001,
                        Longitude = center.Longitude + 0.001
                    })
                },
                new PointOfInterest()
                {
                    DisplayName = "Place Three",
                    ImageSourceUri = pinUri,
                    NormalizedAnchorPoint = new Point(0.5, 1),
                    Location = new Geopoint(new BasicGeoposition()
                    {
                        Latitude = center.Latitude - 0.001,
                        Longitude = center.Longitude - 0.001
                    })
                },
                new PointOfInterest()
                {
                    DisplayName = "Place Four",
                    ImageSourceUri = pinUri,
                    NormalizedAnchorPoint = new Point(0.5, 1),
                    Location = new Geopoint(new BasicGeoposition()
                    {
                        Latitude = center.Latitude - 0.001,
                        Longitude = center.Longitude + 0.001
                    })
                }
            };
        }

async void AnimatedSwitch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario3.xaml.cs.

        {
            // The sample demonstrates a general strategy for doing custom animations when switching view
            // It's technically only possible to animate the contents of a particular view. But, it is possible
            // to animate the outgoing view to some common visual (like a blank background), have the incoming
            // view draw that same visual, switch in the incoming window (which will be imperceptible to the
            // user since both windows will be showing the same thing), then animate the contents of the incoming
            // view in from the common visual.
            var selectedItem = ViewChooser.SelectedItem as ViewLifetimeControl;
            if (selectedItem != null)
            {
                try
                {
                    // Prevent the view from being closed while switching to it
                    selectedItem.StartViewInUse();

                    // Signal that the window is about to be switched to
                    // If the view is already shown to the user, then the app
                    // shouldn't run any extra animations
                    var currentId = ApplicationView.GetForCurrentView().Id;

                    bool isViewVisible;
                    try
                    {
                        isViewVisible = await ApplicationViewSwitcher.PrepareForCustomAnimatedSwitchAsync(
                            selectedItem.Id,
                            currentId,
                            ApplicationViewSwitchingOptions.SkipAnimation);
                    }
                    catch (NotImplementedException)
                    {
                        // The device family does not support PrepareForCustomAnimatedSwitchAsync.
                        // Fall back to switching with standard animation.
                        isViewVisible = true;
                        await ApplicationViewSwitcher.SwitchAsync(selectedItem.Id, currentId);
                    }

                    // The view may already be on screen, in which case there's no need to animate its
                    // contents (or animate out the contents of the current window)
                    if (!isViewVisible)
                    {
                        // The view isn't visible, so animate it on screen
                        lastFadeOutTime = DateTime.Now;

                        // Make the current view totally blank. The incoming view is also
                        // going to be totally blank when the two windows switch
                        await FadeOutContents();
                        // Once the current view is blank, switch in the other window
                        await selectedItem.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            var currentPage = (SecondaryViewPage)((Frame)Window.Current.Content).Content;
                            // More details are in SecondaryViewPage.xaml.cs
                            // This function makes the view totally blank, swaps the two view (which
                            // is not apparent to the user since both windows are blank), then animates
                            // in the content of newly visible view
                            currentPage.SwitchAndAnimate(currentId);
                        });
                    }
                    selectedItem.StopViewInUse();
                }
                catch (InvalidOperationException)
                {
                    // The view could be in the process of closing, and
                    // this thread just hasn't updated. As part of being closed,
                    // this thread will be informed to clean up its list of
                    // views (see SecondaryViewPage.xaml.cs)
                }
                catch (TaskCanceledException)
                {
                    rootPage.NotifyUser("The animation was canceled. It may have timed out", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Select a window to see a switch animation. You can create a window in scenario 1", NotifyType.ErrorMessage);
            }
        }

TextBlock CreateHeaderTextBlock ( string contents ) [inline, private]

Definition at line 105 of file Scenario3.xaml.cs.

        {
            TextBlock textBlock = new TextBlock();
            textBlock.Text = contents;
            textBlock.Style = (Style)Application.Current.Resources["SampleHeaderTextStyle"];
            textBlock.TextWrapping = TextWrapping.Wrap;
            return textBlock;
        }

TextBlock CreateLineItemTextBlock ( string contents ) [inline, private]

Definition at line 114 of file Scenario3.xaml.cs.

        {
            TextBlock textBlock = new TextBlock();
            textBlock.Text = contents;
            textBlock.Style = (Style)Application.Current.Resources["BasicTextStyle"];
            textBlock.TextWrapping = TextWrapping.Wrap;
            Thickness margin = textBlock.Margin;
            margin.Left = 20;
            textBlock.Margin = margin;
            return textBlock;
        }

void Current_VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario3.xaml.cs.

        {
            // Timeout the animation if the secondary window fails to respond in 500
            // ms. Since this animation clears out the main view of the app, it's not desirable
            // to leave it unusable
            if (e.Visible || (DateTime.Now - lastFadeOutTime).TotalMilliseconds > TIMEOUT_LENGTH)
            {

                // This event always fires on the UI thread, along with Fade_Completed,
                // so there is no race condition with the two methods both changing this
                // value
                if (animationTask != null)
                {
                    animationTask.TrySetCanceled();
                    animationTask = null;
                }
                fadeOutStoryboard.Stop();
            }
        }

void DeleteMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 94 of file Scenario3.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Delete", NotifyType.StatusMessage);
        }

async void DoScenario | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Run a sample scenario which logs lots of messages to produce several log files.

Parameters:
sender | The sender.
e | The event args.

Definition at line 236 of file Scenario3.xaml.cs.

        {
            DoScenarioButton.IsEnabled = false;
            rootPage.NotifyUser("Scenario running...", NotifyType.StatusMessage);
            await LoggingScenario.DoScenarioAsync();
            rootPage.NotifyUser("Scenario finished.", NotifyType.StatusMessage);
            DoScenarioButton.IsEnabled = true;
        }

async void EnableDisableLogging | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Enabled/disabled logging.

Parameters:
sender | The sender.
e | The event arguments.

Definition at line 204 of file Scenario3.xaml.cs.

        {
            FileLoggingSessionScenario loggingScenario = FileLoggingSessionScenario.Instance;

            if (loggingScenario.IsLoggingEnabled)
            {
                rootPage.NotifyUser("Disabling logging...", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Enabling logging...", NotifyType.StatusMessage);
            }

            await FileLoggingSessionScenario.Instance.ToggleLoggingEnabledDisabledAsync();

            if (loggingScenario.IsLoggingEnabled)
            {
                rootPage.NotifyUser("Logging enabled.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Logging disabled.", NotifyType.StatusMessage);
            }

            UpdateControls();
        }

void ErasingModeCheckBox_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 267 of file Scenario3.xaml.cs.

        {
            inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Erasing;
            rootPage.NotifyUser("Enable Erasing Mode", NotifyType.StatusMessage);
        }

void ErasingModeCheckBox_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 273 of file Scenario3.xaml.cs.

        {
            inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Inking;
            rootPage.NotifyUser("Disable Erasing Mode", NotifyType.StatusMessage);
        }

void Fade_Completed | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario3.xaml.cs.

        {
            // This event always fires on the UI thread, along with Current_VisibilityChanged,
            // so there is no race condition with the two methods both changing this
            // value
            if (animationTask != null)
            {
                animationTask.TrySetResult(true);
            }
            animationTask = null;
        }

Task<bool> FadeOutContents ( ) [inline, private]

Definition at line 60 of file Scenario3.xaml.cs.

        {
            if (animationTask != null)
            {
                animationTask.TrySetCanceled();
            }
            animationTask = new TaskCompletionSource<bool>();
            fadeOutStoryboard.Begin();
            return animationTask.Task;
        }

void FillComboBox ( ) [inline, private]

Definition at line 87 of file S3_RemoveFolder.xaml.cs.

        {
            FoldersComboBox.ItemsSource = null;
            FoldersComboBox.ItemsSource = picturesLibrary.Folders;
        }

async void Find_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file GetMatchingPropertiesWithRanges.xaml.cs.

        {
            ContentTextOutput.Text = "";
            if (FindQueryText.Text == "")
            {
                return;
            }

            List<string> propertyNames = new List<string>();
            propertyNames.Add("System.FileName");
            var queryOptions = new Windows.Storage.Search.QueryOptions();
            queryOptions.IndexerOption = Windows.Storage.Search.IndexerOption.OnlyUseIndexer;
            queryOptions.UserSearchFilter = FindQueryText.Text;
            queryOptions.SetPropertyPrefetch(Windows.Storage.FileProperties.PropertyPrefetchOptions.DocumentProperties, propertyNames);

            // Query the Pictures library.
            StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            StorageFileQueryResult queryResult = picturesLibrary.CreateFileQueryWithOptions(queryOptions);
            IReadOnlyList<StorageFile> files = await queryResult.GetFilesAsync(0, 20); // limit to 20 results
            foreach (StorageFile file in files)
            {
                IDictionary<String, IReadOnlyList<Windows.Data.Text.TextSegment>> fileRangeProperties = queryResult.GetMatchingPropertiesWithRanges(file);
                if (fileRangeProperties.ContainsKey("System.FileName"))
                {
                    IReadOnlyList<Windows.Data.Text.TextSegment> ranges;
                    fileRangeProperties.TryGetValue("System.FileName", out ranges);
                    rootPage.HighlightRanges(ContentTextOutput, file.DisplayName, ranges);
                }
                // Note: You can continue looking for other properties you would like to highlight on the file here.
            }
            if (files.Count == 0)
            {
                ContentTextOutput.Text = "There were no matching files in your Pictures Library";
            }
        }

ScrollViewer FindScrollViewer ( DependencyObject depObject ) [inline, private]

Definition at line 63 of file Scenario3.xaml.cs.

        {
            if (depObject == null)
            {
                return null;
            }

            int countThisLevel = Windows.UI.Xaml.Media.VisualTreeHelper.GetChildrenCount(depObject);
            if (countThisLevel <= 0)
            {
                return null;
            }

            for (int childIndex = 0; childIndex < countThisLevel; childIndex++)
            {
                DependencyObject childDepObject = Windows.UI.Xaml.Media.VisualTreeHelper.GetChild(depObject, childIndex);
                if (childDepObject is ScrollViewer)
                {
                    return (ScrollViewer)childDepObject;
                }

                ScrollViewer svFromChild = FindScrollViewer(childDepObject);
                if (svFromChild != null)
                {
                    return svFromChild;
                }
            }

            return null;
        }

SampleDataModel GetDataModelForCurrentListViewFlyout ( ) [inline, private]

Definition at line 73 of file Scenario3.xaml.cs.

        {
            // Obtain the ListViewItem for which the user requested a context menu.
            var listViewItem = sharedFlyout.Target;

            // Get the data model for the ListViewItem.
            return (SampleDataModel)ItemListView.ItemFromContainer(listViewItem);
        }

void GetDependencies_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file scenario3_dependencies.xaml.cs.

        {
            IReadOnlyList<Windows.ApplicationModel.Package> dependencies = Package.Current.Dependencies;

            String output = String.Format("Count: {0}", dependencies.Count.ToString());
            for (int i = 0; i < dependencies.Count; i++)
            {
                Package dependency = dependencies[i];
                output += String.Format("\n[{0}]: {1}", i.ToString(), dependency.Id.FullName);
            }

            OutputTextBlock.Text = output;
        }

async void GetFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario3.xaml.cs.

        {
            // Reset output.
            OutputPanel.Children.Clear();

            // Set up file type filter.
            List<string> fileTypeFilter = new List<string>();
            fileTypeFilter.Add(".jpg");
            fileTypeFilter.Add(".png");
            fileTypeFilter.Add(".bmp");
            fileTypeFilter.Add(".gif");

            // Create query options.
            var queryOptions = new QueryOptions(CommonFileQuery.OrderByName, fileTypeFilter);

            // Set up property prefetch - use the PropertyPrefetchOptions for top-level properties
            // and a list for additional properties.
            List<string> propertyNames = new List<string>();
            propertyNames.Add(CopyrightProperty);
            propertyNames.Add(ColorSpaceProperty);
            queryOptions.SetPropertyPrefetch(PropertyPrefetchOptions.ImageProperties, propertyNames);

            // Set up thumbnail prefetch if needed, e.g. when creating a picture gallery view.
            /*
            const uint requestedSize = 190;
            const ThumbnailMode thumbnailMode = ThumbnailMode.PicturesView;
            const ThumbnailOptions thumbnailOptions = ThumbnailOptions.UseCurrentScale;
            queryOptions.SetThumbnailPrefetch(thumbnailMode, requestedSize, thumbnailOptions);
            */

            // Set up the query and retrieve files.
            StorageFolder picturesFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            var query = picturesFolder.CreateFileQueryWithOptions(queryOptions);
            IReadOnlyList<StorageFile> fileList = await query.GetFilesAsync();
            foreach (StorageFile file in fileList)
            {
                OutputPanel.Children.Add(CreateHeaderTextBlock(file.Name));

                // GetImagePropertiesAsync will return synchronously when prefetching has been able to
                // retrieve the properties in advance.
                var properties = await file.Properties.GetImagePropertiesAsync();
                OutputPanel.Children.Add(CreateLineItemTextBlock("Dimensions: " + properties.Width + "x" + properties.Height));

                // Similarly, extra properties are retrieved asynchronously but may
                // return immediately when prefetching has fulfilled its task.
                IDictionary<string, object> extraProperties = await file.Properties.RetrievePropertiesAsync(propertyNames);
                var propValue = extraProperties[CopyrightProperty];
                OutputPanel.Children.Add(CreateLineItemTextBlock("Copyright: " + GetPropertyDisplayValue(propValue)));
                propValue = extraProperties[ColorSpaceProperty];
                OutputPanel.Children.Add(CreateLineItemTextBlock("Color space: " + GetPropertyDisplayValue(propValue)));

                // Thumbnails can also be retrieved and used.
                // var thumbnail = await file.GetThumbnailAsync(thumbnailMode, requestedSize, thumbnailOptions);
            }
        }

void GetPicturesLibrary ( ) [inline, private]

Gets the Pictures library and sets up the FoldersComboBox to list its folders.

Definition at line 65 of file S3_RemoveFolder.xaml.cs.

        {
            picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);

            // Bind the ComboBox to the list of folders currently in the library
            FoldersComboBox.ItemsSource = picturesLibrary.Folders;

            // Update the states of our controls when the list of folders changes
            picturesLibrary.DefinitionChanged += async (StorageLibrary sender, object e) =>
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        UpdateControls();
                    });
                };

            UpdateControls();
        }

string GetPropertyDisplayValue ( object property ) [inline, private]

Definition at line 34 of file Scenario3.xaml.cs.

        {
            string value;
            if (property == null || string.IsNullOrEmpty(property.ToString()))
            {
                value = "none";
            }
            else
            {
                value = property.ToString();
            }

            return value;
        }

async void GetThumbnailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario3.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);

            // Pick a document
            FileOpenPicker openPicker = new FileOpenPicker();
            foreach (string extension in FileExtensions.Document)
            {
                openPicker.FileTypeFilter.Add(extension);
            }

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                const ThumbnailMode thumbnailMode = ThumbnailMode.DocumentsView;
                const uint size = 100;
                using (StorageItemThumbnail thumbnail = await file.GetThumbnailAsync(thumbnailMode, size))
                {
                    if (thumbnail != null)
                    {
                        MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, file, thumbnail, false);
                    }
                    else
                    {
                        rootPage.NotifyUser(Errors.NoIcon, NotifyType.StatusMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
            }

        }

void InkPresenter_StrokesCollected | ( | InkPresenter | sender,
 |  | InkStrokesCollectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario3.xaml.cs.

        {
            rootPage.NotifyUser(args.Strokes.Count + " stroke(s) collected!", NotifyType.StatusMessage);
        }

void InkPresenter_StrokesErased | ( | InkPresenter | sender,
 |  | InkStrokesErasedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 76 of file Scenario3.xaml.cs.

        {
            rootPage.NotifyUser(args.Strokes.Count + " stroke(s) erased!", NotifyType.StatusMessage);
        }

void ListView_ContextCanceled | ( | UIElement | sender,
 |  | RoutedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario3.xaml.cs.

        {
            sharedFlyout.Hide();
        }

void ListView_ContextRequested | ( | UIElement | sender,
 |  | ContextRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario3.xaml.cs.

        {
            // Walk up the tree to find the ListViewItem.
            // There may not be one if the click wasn't on an item.
            var requestedElement = (FrameworkElement)e.OriginalSource;
            while ((requestedElement != sender) && !(requestedElement is ListViewItem))
            {
                requestedElement = (FrameworkElement)VisualTreeHelper.GetParent(requestedElement);
            }
            if (requestedElement != sender)
            {
                // The context menu request was indeed for a ListViewItem.
                var model = (SampleDataModel)ItemListView.ItemFromContainer(requestedElement);
                Point point;
                if (e.TryGetPosition(requestedElement, out point))
                {
                    rootPage.NotifyUser($"Showing flyout for {model.Title} at {point}", NotifyType.StatusMessage);
                    sharedFlyout.ShowAt(requestedElement, point);
                }
                else
                {
                    // Not invoked via pointer, so let XAML choose a default location.
                    rootPage.NotifyUser($"Showing flyout for {model.Title} at default location", NotifyType.StatusMessage);
                    sharedFlyout.ShowAt(requestedElement);
                }

                e.Handled = true;
            }
        }

async void LoggingScenario_StatusChanged | ( | object | sender,
 |  | LoggingScenarioEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario3.xaml.cs.

        {
            if (e.Type == LoggingScenarioEventType.BusyStatusChanged)
            {
                UpdateControls();
            }
            else if (e.Type == LoggingScenarioEventType.LogFileGenerated)
            {
                await AddLogFileMessageDispatch("LogFileGenerated", e.LogFilePath);
            }
            else if (e.Type == LoggingScenarioEventType.LogFileGeneratedAtSuspend)
            {
                await AddLogFileMessageDispatch("Log file at suspend", e.LogFilePath);
            }
            else if (e.Type == LoggingScenarioEventType.LogFileGeneratedAtDisable)
            {
                await AddLogFileMessageDispatch("Log file at disable", e.LogFilePath);
            }
            else if (e.Type == LoggingScenarioEventType.LoggingEnabledDisabled)
            {
                await AddMessageDispatch(string.Format("Logging has been {0}.", e.Enabled ? "enabled" : "disabled"));
            }
        }

void mapItemButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario3.xaml.cs.

        {
            var buttonSender = sender as Button;
            PointOfInterest poi = buttonSender.DataContext as PointOfInterest;
            rootPage.NotifyUser("PointOfInterest clicked = " + poi.DisplayName, NotifyType.StatusMessage);
        }

void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario3.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 16;
        }

void OnClear | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 186 of file Scenario3.xaml.cs.

        {
            inkCanvas.InkPresenter.StrokeContainer.Clear();
            rootPage.NotifyUser("Cleared Canvas", NotifyType.StatusMessage);
        }

async void OnLoadAsync | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 229 of file Scenario3.xaml.cs.

        {
            var openPicker = new FileOpenPicker();
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            openPicker.FileTypeFilter.Add(".gif");
            openPicker.FileTypeFilter.Add(".isf");
            StorageFile file = await openPicker.PickSingleFileAsync();
            if (null != file)
            {
                try
                {
                    using (var stream = await file.OpenSequentialReadAsync())
                    {
                        await inkCanvas.InkPresenter.StrokeContainer.LoadAsync(stream);
                    }

                    rootPage.NotifyUser(inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count + " stroke(s) loaded!", NotifyType.StatusMessage);
                }
                catch (Exception ex)
                {
                    // Report I/O errors during load.
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 77 of file Scenario3.xaml.cs.

        {
            Window.Current.VisibilityChanged -= Current_VisibilityChanged;
            fadeOutStoryboard.Completed -= Fade_Completed;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 82 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

        {
            msLogger?.Dispose();
            msLogger = null;
            mpiLogger?.Dispose();
            mpiLogger = null;
            MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 194 of file Scenario3.xaml.cs.

        {
            UpdateControls();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 54 of file scenario3_dependencies.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file GetMatchingPropertiesWithRanges.xaml.cs.

        {
            FindQueryText.Text = "a AND datemodified:>2/1/2013";
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario3_Text.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 56 of file Scenario3.xaml.cs.

        {
            // Registering handlers for when inking or erasing is detected
            inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
            inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file S3_RemoveFolder.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario3.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

        {
            // Create the media source and supplement with external timed text sources.
            var source = MediaSource.CreateFromUri(rootPage.UncaptionedMediaUri);
            msLogger = new MediaSourceLogger(LoggerControl, source);

            var ttsEnUri = new Uri("ms-appx:///Assets/Media/ElephantsDream-Clip-SRT_en.srt");
            var ttsEn = TimedTextSource.CreateFromUri(ttsEnUri);
            ttsMap[ttsEn] = ttsEnUri;

            var ttsPtUri = new Uri("ms-appx:///Assets/Media/ElephantsDream-Clip-SRT_pt.srt");
            var ttsPt = TimedTextSource.CreateFromUri(ttsPtUri);
            ttsMap[ttsPt] = ttsPtUri;

            var ttsSvUri = new Uri("ms-appx:///Assets/Media/ElephantsDream-Clip-SRT_sv.srt");
            var ttsSv = TimedTextSource.CreateFromUri(ttsSvUri);
            ttsMap[ttsSv] = ttsSvUri;

            ttsEn.Resolved += Tts_Resolved;
            ttsPt.Resolved += Tts_Resolved;
            ttsSv.Resolved += Tts_Resolved;

            source.ExternalTimedTextSources.Add(ttsEn);
            source.ExternalTimedTextSources.Add(ttsPt);
            source.ExternalTimedTextSources.Add(ttsSv);

            // Create the playback item from the source
            var playbackItem = new MediaPlaybackItem(source);
            mpiLogger = new MediaPlaybackItemLogger(LoggerControl, playbackItem);

            // Present the first track
            playbackItem.TimedMetadataTracksChanged += (item, args) =>
            {
                LoggerControl.Log($"TimedMetadataTracksChanged, Number of tracks: {item.TimedMetadataTracks.Count}");
                playbackItem.TimedMetadataTracks.SetPresentationMode(0, TimedMetadataTrackPresentationMode.PlatformPresented);
            };

            // Set the source to start playback of the item
            this.mediaPlayerElement.Source = playbackItem;
            LoggerControl.Log($"Loaded: {rootPage.UncaptionedMediaUri}");
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 71 of file Scenario3.xaml.cs.

        {
            Window.Current.VisibilityChanged += Current_VisibilityChanged;
            fadeOutStoryboard.Completed += Fade_Completed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file scenario3.xaml.cs.

        {
            this.Scenario3TextBlock.Text = "";
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 63 of file Scenario3.xaml.cs.

        {
            // Unregistering handlers for when inking or erasing is detected
            inkCanvas.InkPresenter.StrokesCollected -= InkPresenter_StrokesCollected;
            inkCanvas.InkPresenter.StrokesErased -= InkPresenter_StrokesErased;
        }

void OnPenColorChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario3.xaml.cs.

        {
            if (inkCanvas != null)
            {
                InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();

                // Use button's background to set new pen's color
                var btnSender = sender as Button;
                var brush = btnSender.Background as Windows.UI.Xaml.Media.SolidColorBrush;

                drawingAttributes.Color = brush.Color;
                inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
            }
        }

void OnPenThicknessChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario3.xaml.cs.

        {
            if (inkCanvas != null)
            {
                InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
                penSize = minPenSize + penSizeIncrement * PenThickness.SelectedIndex;
                string value = ((ComboBoxItem)PenType.SelectedItem).Content.ToString();
                if (value == "Highlighter" || value == "Calligraphy")
                {
                    // Make the pen tip rectangular for highlighter and calligraphy pen
                    drawingAttributes.Size = new Size(penSize, penSize * 2);
                }
                else
                {
                    // Otherwise, use a square pen tip.
                    drawingAttributes.Size = new Size(penSize, penSize);
                }
                inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
            }
        }

void OnPenTypeChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 122 of file Scenario3.xaml.cs.

        {
            if (inkCanvas != null)
            {
                InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
                string value = ((ComboBoxItem)PenType.SelectedItem).Content.ToString();

                if (value == "Ballpoint")
                {
                    if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
                    {
                        var newDrawingAttributes = new InkDrawingAttributes();
                        newDrawingAttributes.Color = drawingAttributes.Color;
                        drawingAttributes = newDrawingAttributes;
                    }
                    drawingAttributes.Size = new Size(penSize, penSize);
                    drawingAttributes.PenTip = PenTipShape.Circle;
                    drawingAttributes.DrawAsHighlighter = false;
                    drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity;
                }
                else if (value == "Highlighter")
                {
                    if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
                    {
                        var newDrawingAttributes = new InkDrawingAttributes();
                        newDrawingAttributes.Color = drawingAttributes.Color;
                        drawingAttributes = newDrawingAttributes;
                    }
                    // Make the pen rectangular for highlighter
                    drawingAttributes.Size = new Size(penSize, penSize * 2);
                    drawingAttributes.PenTip = PenTipShape.Rectangle;
                    drawingAttributes.DrawAsHighlighter = true;
                    drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity;
                }
                else if (value == "Calligraphy")
                {
                    if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
                    {
                        var newDrawingAttributes = new InkDrawingAttributes();
                        newDrawingAttributes.Color = drawingAttributes.Color;
                        drawingAttributes = newDrawingAttributes;
                    }
                    drawingAttributes.Size = new Size(penSize, penSize * 2);
                    drawingAttributes.PenTip = PenTipShape.Rectangle;
                    drawingAttributes.DrawAsHighlighter = false;

                    // Set a 45 degree rotation on the pen tip
                    double radians = 45.0 * Math.PI / 180;
                    drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.CreateRotation((float)radians);
                }
                else if (value == "Pencil")
                {
                    if (drawingAttributes.Kind != InkDrawingAttributesKind.Pencil)
                    {
                        var newDrawingAttributes = InkDrawingAttributes.CreateForPencil();
                        newDrawingAttributes.Color = drawingAttributes.Color;
                        newDrawingAttributes.Size = drawingAttributes.Size;
                        drawingAttributes = newDrawingAttributes;
                    }
                }
                inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
            }
        }

async void OnSaveAsync | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 192 of file Scenario3.xaml.cs.

        {
            // We don't want to save an empty file
            if (inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count > 0)
            {
                var savePicker = new FileSavePicker();
                savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
                savePicker.FileTypeChoices.Add("Gif with embedded ISF", new[] { ".gif" });

                StorageFile file = await savePicker.PickSaveFileAsync();
                if (null != file)
                {
                    try
                    {
                        using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.ReadWrite))
                        {
                            // Truncate any existing stream in case the new file
                            // is smaller than the old file.
                            stream.Size = 0;

                            await inkCanvas.InkPresenter.StrokeContainer.SaveAsync(stream);
                        }
                        rootPage.NotifyUser(inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count + " stroke(s) saved!", NotifyType.StatusMessage);
                    }
                    catch (Exception ex)
                    {
                        // Report I/O errors during save.
                        rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser("There is no ink to save.", NotifyType.ErrorMessage);
            }
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 70 of file Scenario3.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void OpenMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario3.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Open", NotifyType.StatusMessage);
        }

void PrintMenuItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario3.xaml.cs.

        {
            SampleDataModel model = GetDataModelForCurrentListViewFlyout();
            rootPage.NotifyUser($"Item: {model.Title}, Action: Print", NotifyType.StatusMessage);
        }

async void ReadTextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario3_Text.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    string fileContent = await FileIO.ReadTextAsync(file);
                    rootPage.NotifyUser($"The following text was read from '{file.Name}':\n{fileContent}", NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex) when (ex.HResult == MainPage.E_NO_UNICODE_TRANSLATION)
                {
                    rootPage.NotifyUser("Could not decode file to Unicode.", NotifyType.ErrorMessage);
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error reading from '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

async void RemoveFolderButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Requests the user's permission to remove the selected location from the Pictures library.

Parameters:
sender
e

Definition at line 49 of file S3_RemoveFolder.xaml.cs.

        {
            var folderToRemove = (StorageFolder)FoldersComboBox.SelectedItem;
            if (await picturesLibrary.RequestRemoveFolderAsync(folderToRemove))
            {
                OutputTextBlock.Text = folderToRemove.DisplayName + " was removed from the Pictures library.";
            }
            else
            {
                OutputTextBlock.Text = "Operation canceled.";
            }
        }

void Scenario3Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario3Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 50 of file scenario3.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                var resourceLoader = ResourceLoader.GetForCurrentView();
                this.Scenario3TextBlock.Text = resourceLoader.GetString("string1");
            }
        }

void TouchInkingCheckBox_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 255 of file Scenario3.xaml.cs.

        {
            inkCanvas.InkPresenter.InputDeviceTypes |= CoreInputDeviceTypes.Touch;
            rootPage.NotifyUser("Enable Touch Inking", NotifyType.StatusMessage);
        }

void TouchInkingCheckBox_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 261 of file Scenario3.xaml.cs.

        {
            inkCanvas.InkPresenter.InputDeviceTypes &= ~CoreInputDeviceTypes.Touch;
            rootPage.NotifyUser("Disable Touch Inking", NotifyType.StatusMessage);
        }

void Tts_Resolved | ( | TimedTextSource | sender,
 |  | TimedTextSourceResolveResultEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 91 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

        {
            var ttsUri = ttsMap[sender];

            // Handle errors
            if(args.Error != null)
            {
                var ignoreAwaitWarning = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    LoggerControl.Log("Error resolving track " + ttsUri + " due to error " + args.Error.ErrorCode, LogViewLoggingLevel.Error);
                });
                return;
            }
            LoggerControl.Log($"Resolved: {ttsUri}");

            // Update label manually since the external SRT does not contain it
            var ttsUriString = ttsUri.AbsoluteUri;
            if (ttsUriString.Contains("_en"))
                args.Tracks[0].Label = "English";
            else if (ttsUriString.Contains("_pt"))
                args.Tracks[0].Label = "Portuguese";
            else if (ttsUriString.Contains("_sv"))
                args.Tracks[0].Label = "Swedish";
        }

void UpdateControls ( ) [inline, private]

Adjust UI controls based on what the sample is doing.

Definition at line 156 of file Scenario3.xaml.cs.

        {
            if (FileLoggingSessionScenario.Instance.IsLoggingEnabled)
            {
                InputTextBlock1.Text = "Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.";
                EnableDisableLoggingButton.Content = "Disable Logging";
                if (FileLoggingSessionScenario.Instance.IsBusy)
                {
                    DoScenarioButton.IsEnabled = false;
                    EnableDisableLoggingButton.IsEnabled = false;
                }
                else
                {
                    DoScenarioButton.IsEnabled = true;
                    EnableDisableLoggingButton.IsEnabled = true;
                }
            }
            else
            {
                InputTextBlock1.Text = "Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.";
                EnableDisableLoggingButton.Content = "Enable Logging";
                DoScenarioButton.IsEnabled = false;
                if (FileLoggingSessionScenario.Instance.IsBusy)
                {
                    EnableDisableLoggingButton.IsEnabled = false;
                }
                else
                {
                    EnableDisableLoggingButton.IsEnabled = true;
                }
            }
        }

void UpdateControls ( ) [inline, private]

Updates the Visibility and IsEnabled properties of UI controls that depend upon the Pictures library having at least one folder in its Folders list.

Definition at line 97 of file S3_RemoveFolder.xaml.cs.

        {
            FillComboBox();
            bool libraryHasFolders = (picturesLibrary.Folders.Count > 0);
            FoldersComboBox.SelectedIndex = libraryHasFolders ? 0 : -1;
            FoldersComboBox.Visibility = libraryHasFolders ? Visibility.Visible : Visibility.Collapsed;
            LibraryEmptyTextBlock.Visibility = libraryHasFolders ? Visibility.Collapsed : Visibility.Visible;
            RemoveFolderButton.IsEnabled = libraryHasFolders;
        }

async void WriteTextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario3_Text.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    string userContent = InputTextBox.Text;
                    await FileIO.WriteTextAsync(file, userContent);
                    rootPage.NotifyUser($"The following text was written to '{file.Name}':\n{userContent}", NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error writing to '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

Member Data Documentation

List<SampleDataModel> AllItems = SampleDataModel.GetSampleData()

Definition at line 29 of file Scenario3.xaml.cs.

TaskCompletionSource<bool> animationTask [private]

Definition at line 31 of file Scenario3.xaml.cs.

String ColorSpaceProperty = "System.Image.ColorSpace" [private]

Definition at line 32 of file Scenario3.xaml.cs.

String CopyrightProperty = "System.Copyright" [private]

Definition at line 31 of file Scenario3.xaml.cs.

Storyboard fadeOutStoryboard = new Storyboard() [private]

Definition at line 29 of file Scenario3.xaml.cs.

DateTime lastFadeOutTime = DateTime.Now [private]

Definition at line 30 of file Scenario3.xaml.cs.

const int minPenSize = 2 [private]

Definition at line 36 of file Scenario3.xaml.cs.

MediaPlaybackItemLogger mpiLogger [private]

Definition at line 29 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

MediaSourceLogger msLogger [private]

Definition at line 30 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

int penSize [private]

Definition at line 38 of file Scenario3.xaml.cs.

const int penSizeIncrement = 2 [private]

Definition at line 37 of file Scenario3.xaml.cs.

StorageLibrary picturesLibrary [private]

Definition at line 27 of file S3_RemoveFolder.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file scenario3.xaml.cs.

MenuFlyout sharedFlyout [private]

Definition at line 30 of file Scenario3.xaml.cs.

const int TIMEOUT_LENGTH = 500 [private]

Definition at line 32 of file Scenario3.xaml.cs.

Dictionary<TimedTextSource, Uri> ttsMap = new Dictionary<TimedTextSource, Uri>() [private]

Definition at line 33 of file Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs.

Property Documentation

internal FileLoggingSessionScenario LoggingScenario [get, private]

Definition at line 29 of file Scenario3.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario3.xaml.cs
  • FileAccess/cs/Scenario3_Text.xaml.cs
  • FileThumbnails/cs/Scenario3.xaml.cs
  • FolderEnumeration/cs/Scenario3.xaml.cs
  • LibraryManagement/cs/S3_RemoveFolder.xaml.cs
  • Logging/cs/Scenario3.xaml.cs
  • MapControl/cs/Scenario3.xaml.cs
  • MultipleViews/cs/Scenario3.xaml.cs
  • Package/cs/scenario3_dependencies.xaml.cs
  • SemanticTextQuery/cs/GetMatchingPropertiesWithRanges.xaml.cs
  • SimpleInk/cs/Scenario3.xaml.cs
  • VideoPlayback/cs/Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs
  • XamlContextMenu/cs/Scenario3.xaml.cs
  • BasicInput/cs/3-DeviceCapabilities.xaml.cs
  • ApplicationResources/cpp/scenario3.xaml.cpp
  • BasicInput/cpp/3-DeviceCapabilities.xaml.cpp
  • DatagramSocket/cpp/Scenario3.xaml.cpp
  • FileAccess/cpp/Scenario3_Text.xaml.cpp
  • FileThumbnails/cpp/Scenario3.xaml.cpp
  • FolderEnumeration/cpp/Scenario3.xaml.cpp
  • LibraryManagement/cpp/S3_RemoveFolder.xaml.cpp
  • Logging/cpp/Scenario3.xaml.cpp
  • MapControl/cpp/Scenario3.xaml.cpp
  • Package/cpp/scenario3_dependencies.xaml.cpp
  • SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.cpp
  • SimpleInk/cpp/Scenario3.xaml.cpp
  • WebSocket/cpp/Scenario3_ClientAuthentication.xaml.cpp
  • XamlContextMenu/cpp/Scenario3.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ActiveSymbologies Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ActiveSymbologies
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ActiveSymbologies Class Reference

List of all members.

Public Member Functions

Scenario3_ActiveSymbologies ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | claimedScanner_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (object sender, ClaimedBarcodeScanner e)
void | ResetTheScenarioState ()
void | ScenarioEndScanButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartScanButton_Click (object sender, RoutedEventArgs e)
async void | SetActiveSymbologies_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedBarcodeScanner | claimedScanner = null
ObservableCollection
< SymbologyListEntry > 		listOfSymbologies = null
MainPage rootPage = MainPage.Current
BarcodeScanner | scanner = null

Detailed Description

Definition at line 24 of file Scenario3_ActiveSymbologies.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ActiveSymbologies ( ) [inline]

Definition at line 32 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            this.InitializeComponent();

            listOfSymbologies = new ObservableCollection<SymbologyListEntry>();
            SymbologyListSource.Source = listOfSymbologies;
        }

Member Function Documentation

async void claimedScanner_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for the DataReceived event fired when a barcode is scanned by the barcode scanner.

Parameters:
sender
args Contains the BarcodeScannerReport which contains the data obtained in the scan

Definition at line 142 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            // need to update the UI data on the dispatcher thread.
            // update the UI with the data received from the scan.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // read the data from the buffer and convert to string.
                ScenarioOutputScanDataLabel.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                ScenarioOutputScanData.Text = DataHelpers.GetDataString(args.Report.ScanData);
                ScenarioOutputScanDataType.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
            });
        }

void claimedScanner_ReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedBarcodeScanner | e |
 | ) |  |  | [inline, private]

Event handler for the Release Device Requested event fired when barcode scanner receives Claim request from another application.

Parameters:
sender
args Contains the ClamiedBarcodeScanner that is sending this request

Definition at line 130 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            // always retain the device
            e.RetainDevice();
            rootPage.NotifyUser("Event ReleaseDeviceRequested received. Retaining the barcode scanner.", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is no longer displayed.

Parameters:
e Event data that describes how this page was exited. The Parameter property is typically used to configure the page.

Definition at line 55 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            ResetTheScenarioState();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            ResetTheScenarioState();
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 158 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            if (claimedScanner != null)
            {
                // Detach the event handlers
                claimedScanner.DataReceived -= claimedScanner_DataReceived;
                claimedScanner.ReleaseDeviceRequested -= claimedScanner_ReleaseDeviceRequested;
                // Release the Barcode Scanner and set to null
                claimedScanner.Dispose();
                claimedScanner = null;
            }

            if (scanner != null)
            {
                scanner.Dispose();
                scanner = null;
            }

            // Reset the UI if we are still the current page.
            if (Frame.Content == this)
            {
                rootPage.NotifyUser("Click the start scanning button to begin.", NotifyType.StatusMessage);
                this.ScenarioOutputScanData.Text = "No data";
                this.ScenarioOutputScanDataLabel.Text = "No data";
                this.ScenarioOutputScanDataType.Text = "No data";

                // reset the button state
                SetActiveSymbologiesButton.IsEnabled = false;
                ScenarioEndScanButton.IsEnabled = false;
                ScenarioStartScanButton.IsEnabled = true;

                // reset symbology list
                listOfSymbologies.Clear();
            }
        }

void ScenarioEndScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for End Scan Button Click.

Releases the Barcode Scanner and resets the text in the UI

Parameters:
sender
e

Definition at line 200 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            ResetTheScenarioState();
        }

async void ScenarioStartScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Start Scan Button Click.

Sets up the barcode scanner to be ready to receive the data events from the scan.

Parameters:
sender
e

Definition at line 66 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            ScenarioStartScanButton.IsEnabled = false;

            rootPage.NotifyUser("Acquiring barcode scanner object.", NotifyType.StatusMessage);

            // create the barcode scanner.
            scanner = await DeviceHelpers.GetFirstBarcodeScannerAsync();

            if (scanner != null)
            {
                // Claim the scanner for exclusive use and enable it so raises DataReceived events.
                claimedScanner = await scanner.ClaimScannerAsync();
                if (claimedScanner != null)
                {
                    // It is always a good idea to have a release device requested event handler.
                    // If this event is not handled, then another app can claim ownership of the barcode scanner.
                    claimedScanner.ReleaseDeviceRequested += claimedScanner_ReleaseDeviceRequested;

                    // after successfully claiming, attach the datareceived event handler.
                    claimedScanner.DataReceived += claimedScanner_DataReceived;

                    // Ask the platform to decode the data by default. When this is set, the platform
                    // will decode the raw data from the barcode scanner and include in the
                    // BarcodeScannerReport.ScanDataLabel and ScanDataType in the DataReceived event.
                    claimedScanner.IsDecodeDataEnabled = true;

                    // Enable the scanner so it raises DataReceived events.
                    // Do this after adding the DataReceived event handler.
                    await claimedScanner.EnableAsync();

                    // after successful claim, list supported symbologies
                    IReadOnlyList<uint> supportedSymbologies = await scanner.GetSupportedSymbologiesAsync();
                    foreach (uint symbology in supportedSymbologies)
                    {
                        listOfSymbologies.Add(new SymbologyListEntry(symbology));
                    }

                    // reset the button state
                    ScenarioEndScanButton.IsEnabled = true;
                    SetActiveSymbologiesButton.IsEnabled = true;

                    rootPage.NotifyUser("Ready to scan. Device ID: " + claimedScanner.DeviceId, NotifyType.StatusMessage);
                }
                else
                {
                    scanner.Dispose();
                    scanner = null;
                    ScenarioStartScanButton.IsEnabled = true;
                    rootPage.NotifyUser("Claim barcode scanner failed.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                ScenarioStartScanButton.IsEnabled = true;
                rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage);
            }
        }

async void SetActiveSymbologies_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 205 of file Scenario3_ActiveSymbologies.xaml.cs.

        {
            if (claimedScanner != null)
            {
                var symbologyList = new List<uint>();
                foreach (var symbologyListEntry in listOfSymbologies)
                {
                    if (symbologyListEntry.IsEnabled)
                    {
                        symbologyList.Add(symbologyListEntry.Id);
                    }
                }
                await claimedScanner.SetActiveSymbologiesAsync(symbologyList);
            }
        }

Member Data Documentation

ClaimedBarcodeScanner claimedScanner = null [private]

Definition at line 28 of file Scenario3_ActiveSymbologies.xaml.cs.

ObservableCollection<SymbologyListEntry> listOfSymbologies = null [private]

Definition at line 30 of file Scenario3_ActiveSymbologies.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario3_ActiveSymbologies.xaml.cs.

BarcodeScanner scanner = null [private]

Definition at line 27 of file Scenario3_ActiveSymbologies.xaml.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/Scenario3_ActiveSymbologies.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AdaptiveCard Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_AdaptiveCard
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_AdaptiveCard Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_AdaptiveCard ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CreateUserActivityAsync ()

Private Attributes

UserActivitySession | _currentSession

Detailed Description

Definition at line 25 of file Scenario3_AdaptiveCard.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AdaptiveCard ( ) [inline]

Definition at line 29 of file Scenario3_AdaptiveCard.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task CreateUserActivityAsync ( ) [inline, private]

Definition at line 47 of file Scenario3_AdaptiveCard.xaml.cs.

        {
            // Get channel and create activity.
            UserActivityChannel channel = UserActivityChannel.GetDefault();
            UserActivity activity = await channel.GetOrCreateUserActivityAsync("Scenario3_AdaptiveCard");

            // Set deep-link and properties.
            activity.ActivationUri = new Uri("sdkUserActivitySample:page?Scenario3_AdaptiveCard");
            activity.VisualElements.DisplayText = "User Activity with Adaptive Card";

            // Sreate and set Adaptive Card.
            StorageFile cardFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/UserActivityCard.json"));
            string cardText = await FileIO.ReadTextAsync(cardFile);
            activity.VisualElements.Content = AdaptiveCardBuilder.CreateAdaptiveCardFromJson(cardText);

            // Save to activity feed.
            await activity.SaveAsync();

            // Create a session, which indicates that the user is engaged
            // in the activity.
            _currentSession = activity.CreateSession();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 70 of file Scenario3_AdaptiveCard.xaml.cs.

        {
            // Dispose the session, which indicates that the user is no longer
            // engaged in the activity.
            _currentSession?.Dispose();
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario3_AdaptiveCard.xaml.cs.

        {
            // If we were activated from a URI, say so.
            // A real app would use the information in the URI to restore state.
            var message = e.Parameter as string;
            if (!String.IsNullOrEmpty(message))
            {
                MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
            }

            await CreateUserActivityAsync();
        }

Member Data Documentation

UserActivitySession _currentSession [private]

Definition at line 27 of file Scenario3_AdaptiveCard.xaml.cs.

The documentation for this class was generated from the following file:
  • UserActivity/cs/Scenario3_AdaptiveCard.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AdaptiveSync Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_AdaptiveSync
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_AdaptiveSync Class Reference

Multi-video live playback synchronization using an AdaptiveMediaSource. More...

List of all members.

Public Member Functions

Scenario3_AdaptiveSync ()

Private Member Functions

void | EnablePlaybackControls (bool enabled)
void | Load_Click (object sender, RoutedEventArgs e)
async void | MediaPlayer_MediaOpened (MediaPlayer mediaPlayer, object args)
async void | MediaTimelineController_PositionChanged (MediaTimelineController sender, object args)
async void | MediaTimelineController_StateChanged (MediaTimelineController sender, object args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | Page_OnUnloaded (object sender, RoutedEventArgs e)
void | PlayPause_Click (object sender, RoutedEventArgs e)
void | Seek2SecondsBack_Click (object sender, RoutedEventArgs e)
void | Seek2SecondsForward_Click (object sender, RoutedEventArgs e)
void | Seek30SecondsBack_Click (object sender, RoutedEventArgs e)
void | Seek30SecondsForward_Click (object sender, RoutedEventArgs e)
void | SeekDelta (TimeSpan amount)

Private Attributes

TimeSpan | LastPositionUpdate = TimeSpan.Zero
TimeSpan | maxNaturalDurationForController = TimeSpan.Zero
List< MediaPlayerElement > | mediaPlayerElements
int | openedMediaCount = 0
TimeSpan | PositionChangeThreshold = TimeSpan.FromSeconds(1)
MainPage rootPage = MainPage.Current
MediaTimelineController | timelineController = null

Detailed Description

Live sync has not been extensively tested for this release. There are limitations on the seekable and buffered ranges of data that are available to the MediaTimelineController. Exceeding these limits can cause stuttering or buffering. This scenario is provided as a technology demonstration and is not intended for production use.

Definition at line 31 of file Scenario3_AdaptiveSync.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AdaptiveSync ( ) [inline]

Definition at line 40 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            this.InitializeComponent();

            mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeCopy };

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                // Create a corresponding MediaPlayer for each MediaPlayerElement.
                mpe.SetMediaPlayer(new MediaPlayer());
            }
        }

Member Function Documentation

void EnablePlaybackControls ( bool enabled ) [inline, private]

Definition at line 143 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            Seek30SecondsBack.IsEnabled = enabled;
            Seek2SecondsBack.IsEnabled = enabled;
            PlayPause.IsEnabled = enabled;
            Seek2SecondsForward.IsEnabled = enabled;
            Seek30SecondsForward.IsEnabled = enabled;
        }

void Load_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Sets the content on the MediaPlayers.

Definition at line 155 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            EnablePlaybackControls(false);

            // First reset some app logic.
            timelineController.Pause();
            maxNaturalDurationForController = TimeSpan.Zero;
            openedMediaCount = 0;
            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MainPage.CleanUpMediaPlayerSource(mpe.MediaPlayer);
            }
            timelineController.Position = TimeSpan.Zero;

            // Apply any requested for offset between two videos.
            // Do this before setting the Source on the MediaPlayer to avoid a visible seek on MediaOpened.
            double d = 0.0;
            if (Double.TryParse(mpeCopyOffset.Text, out d))
            {
                mpeCopy.MediaPlayer.TimelineControllerPositionOffset = TimeSpan.FromSeconds(d);
            }
            else
            {
                mpeCopy.MediaPlayer.TimelineControllerPositionOffset = TimeSpan.Zero;
                mpeCopyOffset.Text = "0.0";
            }

            // Set the sources. For this demonstration, we play audio only from the first video.
            Uri uri;
            if (!Uri.TryCreate(mpeMainUri.Text, UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Invalid URI for first source.", NotifyType.ErrorMessage);
                return;
            }
            mpeMain.MediaPlayer.Source = MediaSource.CreateFromUri(uri);
            mpeMain.MediaPlayer.IsMuted = false;

            if (!Uri.TryCreate(mpeCopyUri.Text, UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Invalid URI for second source.", NotifyType.ErrorMessage);
                return;
            }
            mpeCopy.MediaPlayer.Source = MediaSource.CreateFromUri(uri);
            mpeMain.MediaPlayer.IsMuted = true;

            // Enable our custom playback controls now that everything is set up.
            EnablePlaybackControls(true);
        }

async void MediaPlayer_MediaOpened | ( | MediaPlayer | mediaPlayer,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            // maxNaturalDurationForController is the longest media source of fixed duration.
            if (mediaPlayer.PlaybackSession.NaturalDuration != TimeSpan.MaxValue)
            {
                var naturalDurationForController = mediaPlayer.PlaybackSession.NaturalDuration - mediaPlayer.TimelineControllerPositionOffset;
                if (naturalDurationForController > maxNaturalDurationForController)
                {
                    maxNaturalDurationForController = naturalDurationForController;
                }
            }

            // If both media sources have resolved, update our UI with the duration information.
            if (System.Threading.Interlocked.Increment(ref openedMediaCount) == 2)
            {
                string message =
                    (maxNaturalDurationForController == TimeSpan.Zero) ?
                    " (live stream)" :
                    $" / {(int)maxNaturalDurationForController.TotalSeconds}";
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => NaturalDuration.Text = message);
            }
        }

async void MediaTimelineController_PositionChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 220 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            if (Math.Abs(sender.Position.Ticks - LastPositionUpdate.Ticks) > PositionChangeThreshold.Ticks)
            {
                LastPositionUpdate = sender.Position;
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => SeekPosition.Text = $"{(int)LastPositionUpdate.TotalSeconds}");
            }

            // Pause when playback reaches the maximum duration, if there is one.
            if (maxNaturalDurationForController != TimeSpan.Zero && sender.Position > maxNaturalDurationForController)
            {
                sender.Pause();
            }
        }

async void MediaTimelineController_StateChanged | ( | MediaTimelineController | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 123 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            // Update the Play/Pause button based on the new state.
            Symbol newSymbol;
            switch (sender.State)
            {
                case MediaTimelineControllerState.Paused:
                    newSymbol = Symbol.Play;
                    break;

                case MediaTimelineControllerState.Running:
                    newSymbol = Symbol.Pause;
                    break;

                default:
                    return;
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            // Create a single MediaTimelineController which will control all of the MediaPlayers.
            timelineController = new MediaTimelineController();

            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;

                // The CommandManager object must be disabled when attaching a MediaTimelineController.
                // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
                // and apply additional business logic.
                // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
                mp.CommandManager.IsEnabled = false;
                // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
                mp.TimelineController = timelineController;

                // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
                // To avoid confusing the user, it is best to turn them off.
                mpe.AreTransportControlsEnabled = false;

                // MediaOpened is the right time to find the highest natural duration.
                mp.MediaOpened += MediaPlayer_MediaOpened;
            }

            // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
            timelineController.StateChanged += MediaTimelineController_StateChanged;

            // Since this is a sample of video on demand, constrain the MediaTimelineController
            // to pause when it reaches the natural end of the last video.
            timelineController.PositionChanged += MediaTimelineController_PositionChanged;

            // We are now set up to load content.
            Load.IsEnabled = true;
        }

void Page_OnUnloaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            // Dispose the MediaPlayer objects so they will stop streaming.
            foreach (MediaPlayerElement mpe in mediaPlayerElements)
            {
                MediaPlayer mp = mpe.MediaPlayer;
                mp.MediaOpened -= MediaPlayer_MediaOpened;
                mp.Dispose();
            }
        }

void PlayPause_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 204 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            if (timelineController.State == MediaTimelineControllerState.Paused)
            {
                timelineController.Resume();
            }
            else if (timelineController.State == MediaTimelineControllerState.Running)
            {
                timelineController.Pause();
            }
        }

void Seek2SecondsBack_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 244 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            SeekDelta(TimeSpan.FromSeconds(-2));
        }

void Seek2SecondsForward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 235 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            SeekDelta(TimeSpan.FromSeconds(2));
        }

void Seek30SecondsBack_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 249 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            SeekDelta(TimeSpan.FromSeconds(-30));
        }

void Seek30SecondsForward_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 239 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            SeekDelta(TimeSpan.FromSeconds(30));
        }

void SeekDelta ( TimeSpan amount ) [inline, private]

Definition at line 254 of file Scenario3_AdaptiveSync.xaml.cs.

        {
            var requestedPosition = timelineController.Position + amount;
            if (maxNaturalDurationForController > TimeSpan.Zero)
            {
                if (requestedPosition <= maxNaturalDurationForController)
                {
                    timelineController.Position = requestedPosition;
                }
                else
                {
                    timelineController.Position = maxNaturalDurationForController;
                }
            }
            else
            {
                timelineController.Position = requestedPosition;
            }
        }

Member Data Documentation

TimeSpan LastPositionUpdate = TimeSpan.Zero [private]

Definition at line 218 of file Scenario3_AdaptiveSync.xaml.cs.

TimeSpan maxNaturalDurationForController = TimeSpan.Zero [private]

Definition at line 37 of file Scenario3_AdaptiveSync.xaml.cs.

List<MediaPlayerElement> mediaPlayerElements [private]

Definition at line 35 of file Scenario3_AdaptiveSync.xaml.cs.

int openedMediaCount = 0 [private]

Definition at line 38 of file Scenario3_AdaptiveSync.xaml.cs.

TimeSpan PositionChangeThreshold = TimeSpan.FromSeconds(1) [private]

Definition at line 219 of file Scenario3_AdaptiveSync.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario3_AdaptiveSync.xaml.cs.

MediaTimelineController timelineController = null [private]

Definition at line 36 of file Scenario3_AdaptiveSync.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlaybackSynchronization/cs/Scenario3_AdaptiveSync.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Add Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Add
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_Add Class Reference

List of all members.

Public Member Functions

Scenario3_Add ()

Private Member Functions

async void | PickAudioButton_Click (object sender, RoutedEventArgs e)
async void | PickPlaylistButton_Click (object sender, RoutedEventArgs e)

Private Attributes

Playlist | playlist = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario3_Add.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Add ( ) [inline]

Definition at line 28 of file Scenario3_Add.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickAudioButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Adds a file to the end of the playlist loaded in PickPlaylistButton_Click.

Parameters:
sender
e

Definition at line 58 of file Scenario3_Add.xaml.cs.

        {
            FileOpenPicker picker = MainPage.CreateFilePicker(MainPage.audioExtensions);
            IReadOnlyList<StorageFile> files = await picker.PickMultipleFilesAsync();

            if (files.Count > 0)
            {
                foreach (StorageFile file in files)
                {
                    this.playlist.Files.Add(file);
                }

                if (await rootPage.TrySavePlaylistAsync(playlist))
                {
                    rootPage.NotifyUser(files.Count + " files added to playlist.", NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("No files picked.", NotifyType.ErrorMessage);
            }
        }

async void PickPlaylistButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Loads a playlist picked by the user in the FilePicker.

Parameters:
sender
e

Definition at line 38 of file Scenario3_Add.xaml.cs.

        {
            PickAudioButton.IsEnabled = false;

            this.playlist = await rootPage.PickPlaylistAsync();

            if (this.playlist != null)
            {
                rootPage.NotifyUser("Playlist loaded.", NotifyType.StatusMessage);
            }

            PickAudioButton.IsEnabled = (this.playlist != null);

        }

Member Data Documentation

Playlist playlist = null [private]

Definition at line 26 of file Scenario3_Add.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario3_Add.xaml.cs.

The documentation for this class was generated from the following files:
  • Playlists/cs/Scenario3_Add.xaml.cs
  • Playlists/cpp/Scenario3_Add.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AppCapture Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_AppCapture
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_AppCapture Class Reference

List of all members.

Public Member Functions

Scenario3_AppCapture ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | AllowAppCaptureCheckBox_Toggled (object sender, RoutedEventArgs e)
void | AppCapture_CapturingChanged (AppCapture sender, object e)
void | UpdateCaptureStatus ()

Private Attributes

AppCapture | appCapture
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario3_AppCapture.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AppCapture ( ) [inline]

Definition at line 25 of file Scenario3_AppCapture.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AllowAppCaptureCheckBox_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario3_AppCapture.xaml.cs.

        {
            ToggleSwitch toggleSwitch = (ToggleSwitch)sender;
            await AppCapture.SetAllowedAsync(toggleSwitch.IsOn);
        }

void AppCapture_CapturingChanged | ( | AppCapture | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario3_AppCapture.xaml.cs.

        {
            UpdateCaptureStatus();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario3_AppCapture.xaml.cs.

        {
            appCapture.CapturingChanged -= AppCapture_CapturingChanged;

            // Re-enable app capture when navigating away.
            var task = AppCapture.SetAllowedAsync(true);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario3_AppCapture.xaml.cs.

        {
            appCapture = AppCapture.GetForCurrentView();
            appCapture.CapturingChanged += AppCapture_CapturingChanged;
            UpdateCaptureStatus();
        }

void UpdateCaptureStatus ( ) [inline, private]

Definition at line 56 of file Scenario3_AppCapture.xaml.cs.

        {
            string audioStatus = appCapture.IsCapturingAudio ? "Audio is being captured." : "Audio is not being captured.";
            string videoStatus = appCapture.IsCapturingVideo ? "Video is being captured." : "Video is not being captured.";
            rootPage.NotifyUser(audioStatus + "\n" + videoStatus, NotifyType.StatusMessage);
        }

Member Data Documentation

AppCapture appCapture [private]

Definition at line 22 of file Scenario3_AppCapture.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario3_AppCapture.xaml.cs.

The documentation for this class was generated from the following file:
  • DisablingScreenCapture/cs/Scenario3_AppCapture.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AspectRatio Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_AspectRatio
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_AspectRatio Class Reference

Scenario 3 keep aspect ratios the same. More...

List of all members.

Public Member Functions

Scenario3_AspectRatio ()

Protected Member Functions

override async void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | CheckIfStreamsAreIdentical ()
async void | InitializeCameraButton_Click (object sender, RoutedEventArgs e)
void | MatchPreviewAspectRatio ()
void | PopulateComboBoxes ()
async void | PreviewSettings_Changed (object sender, RoutedEventArgs e)
async void | VideoButton_Click (object sender, RoutedEventArgs e)
async void | VideoSettings_Changed (object sender, RoutedEventArgs e)

Private Attributes

StorageFolder | _captureFolder = null
MediaCapturePreviewer | _previewer = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario3_AspectRatio.xaml.cs.

Constructor & Destructor Documentation

Scenario3_AspectRatio ( ) [inline]

Initializes a new instance of the Scenario1_PreviewSettings class.

Initializes a new instance of the Scenario3_AspectRatio class.

Definition at line 42 of file Scenario3_AspectRatio.xaml.cs.

        {
            this.InitializeComponent();
            _previewer = new MediaCapturePreviewer(PreviewControl, Dispatcher);
        }

Member Function Documentation

void CheckIfStreamsAreIdentical ( ) [inline, private]

On some devices there may not be seperate streams for preview/photo/video.

In this case, changing any of them will change all of them since they are the same stream

Definition at line 57 of file Scenario3_AspectRatio.xaml.cs.

        {
            if (_previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.AllStreamsIdentical ||
                _previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.PreviewRecordStreamsIdentical)
            {
                rootPage.NotifyUser("Warning: Preview and video streams for this device are identical, changing one will affect the other", NotifyType.ErrorMessage);
            }
        }

async void InitializeCameraButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Initializes the camera and populates the UI.

Parameters:
sender
e

Definition at line 71 of file Scenario3_AspectRatio.xaml.cs.

        {
            var button = sender as Button;

            // Clear any previous message.
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            button.IsEnabled = false;
            await _previewer.InitializeCameraAsync();
            button.IsEnabled = true;

            if (_previewer.IsPreviewing)
            {
                if (string.IsNullOrEmpty(_previewer.MediaCapture.MediaCaptureSettings.AudioDeviceId))
                {
                    rootPage.NotifyUser("No audio device available. Cannot capture.", NotifyType.ErrorMessage);
                }
                else
                {
                    button.Visibility = Visibility.Collapsed;
                    PreviewControl.Visibility = Visibility.Visible;
                    CheckIfStreamsAreIdentical();
                    PopulateComboBoxes();
                    VideoButton.IsEnabled = true;
                }
            }

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
            // Fall back to the local app storage if the Pictures Library is not available
            _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
        }

void MatchPreviewAspectRatio ( ) [inline, private]

Finds all the available video resolutions that match the aspect ratio of the preview stream Note: This should also be done with photos as well.

This same method can be modified for photos by changing the MediaStreamType from VideoPreview to Photo.

Definition at line 210 of file Scenario3_AspectRatio.xaml.cs.

        {
            // Query all properties of the device
            IEnumerable<StreamResolution> allVideoProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoRecord).Select(x => new StreamResolution(x));

            // Query the current preview settings
            StreamResolution previewProperties = new StreamResolution(_previewer.MediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview));

            // Get all formats that have the same-ish aspect ratio as the preview
            // Allow for some tolerance in the aspect ratio comparison
            const double ASPECT_RATIO_TOLERANCE = 0.015;
            var matchingFormats = allVideoProperties.Where(x => Math.Abs(x.AspectRatio - previewProperties.AspectRatio) < ASPECT_RATIO_TOLERANCE);

            // Order them by resolution then frame rate
            allVideoProperties = matchingFormats.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);

            // Clear out old entries and populate the video combo box with new matching entries
            VideoSettings.Items.Clear();
            foreach (var property in allVideoProperties)
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Content = property.GetFriendlyName();
                comboBoxItem.Tag = property;
                VideoSettings.Items.Add(comboBoxItem);
            }
            VideoSettings.SelectedIndex = -1;
        }

override async void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario3_AspectRatio.xaml.cs.

        {
            await _previewer.CleanupCameraAsync();
        }

void PopulateComboBoxes ( ) [inline, private]

Populates the combo boxes with preview settings and matching ratio settings for the video stream.

Definition at line 184 of file Scenario3_AspectRatio.xaml.cs.

        {
            // Query all properties of the device
            IEnumerable<StreamResolution> allPreviewProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoPreview).Select(x => new StreamResolution(x));
            // Order them by resolution then frame rate
            allPreviewProperties = allPreviewProperties.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);

            // Populate the preview combo box with the entries
            foreach (var property in allPreviewProperties)
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Content = property.GetFriendlyName() +
                    String.Format(" A. Ratio: {0}", property.AspectRatio.ToString("#.##"));
                comboBoxItem.Tag = property;
                PreviewSettings.Items.Add(comboBoxItem);
            }

            // Keep the same aspect ratio with the video stream
            MatchPreviewAspectRatio();
        }

async void PreviewSettings_Changed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Preview settings combo box.

Updates stream resolution based on the selection.

Parameters:
sender
e

Definition at line 108 of file Scenario3_AspectRatio.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
                var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
                await _previewer.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, encodingProperties);

                // The preview just changed, update the video combo box
                MatchPreviewAspectRatio();
            }
        }

async void VideoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Records an MP4 video to a StorageFile.

Definition at line 142 of file Scenario3_AspectRatio.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                if (!_previewer.IsRecording)
                {
                    try
                    {
                        // Create storage file in Video Library
                        var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);
                        var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

                        await _previewer.MediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);

                        // Reflect changes in the UI
                        VideoButton.Content = "Stop Video";
                        _previewer.IsRecording = true;

                        rootPage.NotifyUser("Recording file, saving to: " + videoFile.Path, NotifyType.StatusMessage);
                    }
                    catch (Exception ex)
                    {
                        // File I/O errors are reported as exceptions.
                        rootPage.NotifyUser("Exception when starting video recording: " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    // Reflect the changes in UI and stop recording
                    VideoButton.Content = "Record Video";
                    _previewer.IsRecording = false;

                    await _previewer.MediaCapture.StopRecordAsync();

                    rootPage.NotifyUser("Stopped recording!", NotifyType.StatusMessage);
                }
            }
        }

async void VideoSettings_Changed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for Video settings combo box.

Updates stream resolution based on the selection.

Parameters:
sender
e

Definition at line 126 of file Scenario3_AspectRatio.xaml.cs.

        {
            if (_previewer.IsPreviewing)
            {
                if (VideoSettings.SelectedIndex > -1)
                {
                    var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
                    var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
                    await _previewer.MediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, encodingProperties);
                }
            }
        }

Member Data Documentation

StorageFolder _captureFolder = null [private]

Definition at line 37 of file Scenario3_AspectRatio.xaml.cs.

MediaCapturePreviewer _previewer = null [private]

Definition at line 34 of file Scenario3_AspectRatio.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario3_AspectRatio.xaml.cs.

The documentation for this class was generated from the following files:
  • CameraResolution/cs/Scenario3_AspectRatio.xaml.cs
  • CameraResolution/cpp/Scenario3_AspectRatio.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundDeviceWatcher Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_BackgroundDeviceWatcher
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_BackgroundDeviceWatcher Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_BackgroundDeviceWatcher ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnTaskCompleted (BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | RegisterBackgroundTask (DeviceWatcherTrigger deviceWatcherTrigger)
void | StartWatcher ()
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (IBackgroundTaskRegistration taskReg)

Private Attributes

string | backgroundTaskName = "DeviceEnumerationCs_BackgroundTaskName"
IBackgroundTaskRegistration | backgroundTaskRegistration = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

Constructor & Destructor Documentation

Scenario3_BackgroundDeviceWatcher ( ) [inline]

Definition at line 26 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            if (backgroundTaskRegistration != null)
            {
                backgroundTaskRegistration.Completed -= OnTaskCompleted;
                backgroundTaskRegistration = null;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            selectorComboBox.ItemsSource = DeviceSelectorChoices.BackgroundDeviceWatcherSelectors;
            selectorComboBox.SelectedIndex = 0;

            // Determine if the background task is already active
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (backgroundTaskName == task.Value.Name)
                {
                    backgroundTaskRegistration = task.Value;
                    startWatcherButton.IsEnabled = false;
                    stopWatcherButton.IsEnabled = true;
                    break;
                }
            }
        }

async void OnTaskCompleted | ( | BackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 137 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Background task completed", NotifyType.StatusMessage);
            });
        }

void RegisterBackgroundTask ( DeviceWatcherTrigger deviceWatcherTrigger ) [inline, private]

Definition at line 113 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            BackgroundTaskBuilder taskBuilder;

            // First see if we already have this background task registered. If so, unregister
            // it before we register it with the new trigger.

            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (backgroundTaskName == task.Value.Name)
                {
                    UnregisterBackgroundTask(task.Value);
                }
            }

            taskBuilder = new BackgroundTaskBuilder();
            taskBuilder.Name = backgroundTaskName;
            taskBuilder.TaskEntryPoint = "BackgroundDeviceWatcherTaskCs.BackgroundDeviceWatcher";
            taskBuilder.SetTrigger(deviceWatcherTrigger);

            backgroundTaskRegistration = taskBuilder.Register();
            backgroundTaskRegistration.Completed += OnTaskCompleted;
        }

void StartWatcher ( ) [inline, private]

Definition at line 68 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            DeviceWatcherEventKind[] triggerEventKinds = { DeviceWatcherEventKind.Add, DeviceWatcherEventKind.Remove, DeviceWatcherEventKind.Update };
            DeviceWatcher deviceWatcher = null;

            startWatcherButton.IsEnabled = false;

            // First get the device selector chosen by the UI.
            DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;

            if (null == deviceSelectorInfo.Selector)
            {
                // If the a pre-canned device class selector was chosen, call the DeviceClass overload
                deviceWatcher = DeviceInformation.CreateWatcher(deviceSelectorInfo.DeviceClassSelector);
            }
            else if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
            {
                // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
                // Kind will be determined by the selector
                deviceWatcher = DeviceInformation.CreateWatcher(
                    deviceSelectorInfo.Selector,
                    null // don't request additional properties for this sample
                    );
            }
            else
            {
                // Kind is specified in the selector info
                deviceWatcher = DeviceInformation.CreateWatcher(
                    deviceSelectorInfo.Selector,
                    null, // don't request additional properties for this sample
                    deviceSelectorInfo.Kind);
            }

            // Get the background trigger for this watcher
            DeviceWatcherTrigger deviceWatcherTrigger = deviceWatcher.GetBackgroundTrigger(triggerEventKinds);

            rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);

            // Register this trigger for our background task
            RegisterBackgroundTask(deviceWatcherTrigger);

            stopWatcherButton.IsEnabled = true;
            rootPage.NotifyUser("Watcher started...", NotifyType.StatusMessage);
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 58 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            StartWatcher();
        }

void StopWatcher ( ) [inline, private]

Definition at line 145 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            stopWatcherButton.IsEnabled = false;
            if (null != backgroundTaskRegistration)
            {
                UnregisterBackgroundTask(backgroundTaskRegistration);
            }
            startWatcherButton.IsEnabled = true;
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            StopWatcher();
        }

void UnregisterBackgroundTask ( IBackgroundTaskRegistration taskReg ) [inline, private]

Definition at line 155 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

        {
            taskReg.Unregister(true);
            ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
            settings.Values["eventCount"] = (uint)0;
        }

Member Data Documentation

string backgroundTaskName = "DeviceEnumerationCs_BackgroundTaskName" [private]

Definition at line 23 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

IBackgroundTaskRegistration backgroundTaskRegistration = null [private]

Definition at line 24 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario3_BackgroundDeviceWatcher.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario3_BackgroundDeviceWatcher.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_BackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_BackgroundTask Class Reference

List of all members.

Public Member Functions

Scenario3_BackgroundTask ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnCompleted (IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UpdateButtonStates ()

Private Attributes

IBackgroundTaskRegistration | _geolocTask = null
MainPage _rootPage = MainPage.Current
const string | BackgroundTaskEntryPoint = "BackgroundTask.LocationBackgroundTask"
const string | BackgroundTaskName = "SampleLocationBackgroundTask"

Detailed Description

Definition at line 24 of file Scenario3_BackgroundTask.xaml.cs.

Constructor & Destructor Documentation

Scenario3_BackgroundTask ( ) [inline]

Definition at line 35 of file Scenario3_BackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void OnCompleted | ( | IBackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler called when the background task is completed.

Parameters:
sender
e

Definition at line 124 of file Scenario3_BackgroundTask.xaml.cs.

        {
            // Update the UI with progress reported by the background task
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    // Rethrow any exception that occurred in the background task.
                    e.CheckResult();

                    // Update the UI with the completion status of the background task
                    // The Run method of the background task sets this status.
                    MainPage.ReportSavedStatus();

                    // Extract and display location data set by the background task if not null
                    ScenarioOutput_Latitude.Text = MainPage.LookupSavedString("Latitude", "No data");
                    ScenarioOutput_Longitude.Text = MainPage.LookupSavedString("Longitude", "No data");
                    ScenarioOutput_Accuracy.Text = MainPage.LookupSavedString("Accuracy", "No data");
                }
                catch (Exception ex)
                {
                    // The background task had an error
                    _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 58 of file Scenario3_BackgroundTask.xaml.cs.

        {
            if (_geolocTask != null)
            {
                // Remove the event handler
                _geolocTask.Completed -= OnCompleted;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario3_BackgroundTask.xaml.cs.

        {
            // See if our background task is already registered.
            _geolocTask = MainPage.LookupBackgroundTask(BackgroundTaskName);

            if (_geolocTask != null)
            {
                // Associate an event handler with the existing background task
                _geolocTask.Completed += OnCompleted;
            }
            UpdateButtonStates();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Register' button.

Parameters:
sender
e

Definition at line 72 of file Scenario3_BackgroundTask.xaml.cs.

        {
            // Register the background task without checking whether the user has enabled background execution.
            // If it's disabled, and then the user later enables background execution, the background task will be ready to run.
            // Create a new background task builder
            BackgroundTaskBuilder geolocTaskBuilder = new BackgroundTaskBuilder();

            geolocTaskBuilder.Name = BackgroundTaskName;
            geolocTaskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;

            // Create a new timer triggering at a 15 minute interval
            var trigger = new TimeTrigger(15, false);

            // Associate the timer trigger with the background task builder
            geolocTaskBuilder.SetTrigger(trigger);

            // Register the background task
            _geolocTask = geolocTaskBuilder.Register();

            // Associate an event handler with the new background task
            _geolocTask.Completed += OnCompleted;

            UpdateButtonStates();
            MainPage.CheckBackgroundAndRequestLocationAccess();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Unregister' button.

Parameters:
sender
e

Definition at line 103 of file Scenario3_BackgroundTask.xaml.cs.

        {
            // Unregister the background task
            if (null != _geolocTask)
            {
                _geolocTask.Unregister(true);
                _geolocTask = null;
            }

            ScenarioOutput_Latitude.Text = "No data";
            ScenarioOutput_Longitude.Text = "No data";
            ScenarioOutput_Accuracy.Text = "No data";
            UpdateButtonStates();
            _rootPage.NotifyUser("Background task unregistered", NotifyType.StatusMessage);
        }

void UpdateButtonStates ( ) [inline, private]

Update the enable state of the register/unregister buttons.

Definition at line 154 of file Scenario3_BackgroundTask.xaml.cs.

        {
            bool registered = (_geolocTask != null);
            RegisterBackgroundTaskButton.IsEnabled = !registered;
            UnregisterBackgroundTaskButton.IsEnabled = registered;
        }

Member Data Documentation

IBackgroundTaskRegistration _geolocTask = null [private]

Definition at line 30 of file Scenario3_BackgroundTask.xaml.cs.

MainPage _rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario3_BackgroundTask.xaml.cs.

const string BackgroundTaskEntryPoint = "BackgroundTask.LocationBackgroundTask" [private]

Definition at line 28 of file Scenario3_BackgroundTask.xaml.cs.

const string BackgroundTaskName = "SampleLocationBackgroundTask" [private]

Definition at line 27 of file Scenario3_BackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario3_BackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BgChatServer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_BgChatServer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_BgChatServer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_BgChatServer ()
void | KeyboardKey_Pressed (object sender, KeyRoutedEventArgs e)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
async void | Disconnect ()
void | DisconnectButton_Click (object sender, RoutedEventArgs e)
async void | ListenButton_Click (object sender, RoutedEventArgs e)
async void | OnCompleted (BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
async void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | SendButton_Click (object sender, RoutedEventArgs e)
void | SendMessage ()

Private Attributes

MainPage rootPage = MainPage.Current
byte[] | sdpRecordBlob
string | taskEntryPoint = "BackgroundTasks.RfcommServerTask"
string | taskName = "Scenario3_BackgroundTask"
IBackgroundTaskRegistration | taskRegistration
RfcommConnectionTrigger | trigger

Detailed Description

Definition at line 27 of file Scenario3_BgChatServer.xaml.cs.

Constructor & Destructor Documentation

Scenario3_BgChatServer ( ) [inline]

Definition at line 69 of file Scenario3_BgChatServer.xaml.cs.

        {
            this.InitializeComponent();
            trigger = new RfcommConnectionTrigger();

            // Local service Id is the only mandatory field that should be used to filter a known service UUID.
            trigger.InboundConnection.LocalServiceId = RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid);

            // The SDP record is nice in order to populate optional name and description fields
            trigger.InboundConnection.SdpRecord = sdpRecordBlob.AsBuffer();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Definition at line 276 of file Scenario3_BgChatServer.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

async void Disconnect ( ) [inline, private]

Handles UX changes and task registration changes when socket is disconnected.

Definition at line 226 of file Scenario3_BgChatServer.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                ListenButton.IsEnabled = true;
                DisconnectButton.IsEnabled = false;
                ConversationListBox.Items.Clear();

                // Unregistering the background task will remove the Rfcomm Chat Service from the SDP record and stop listening for incoming connections
                // First get the existing tasks to see if we already registered for it
                if (taskRegistration != null)
                {
                    taskRegistration.Unregister(true);
                    taskRegistration = null;
                    rootPage.NotifyUser("Background watcher unregistered.", NotifyType.StatusMessage);
                }
                else
                {
                    // At this point we assume we haven't found any existing tasks matching the one we want to unregister
                    rootPage.NotifyUser("No registered background watcher found.", NotifyType.StatusMessage);
                }
            });

        }

void DisconnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 184 of file Scenario3_BgChatServer.xaml.cs.

        {
            Disconnect();
        }

void KeyboardKey_Pressed | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 152 of file Scenario3_BgChatServer.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                SendMessage();
            }
        }

async void ListenButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 92 of file Scenario3_BgChatServer.xaml.cs.

        {
            ListenButton.IsEnabled = false;
            DisconnectButton.IsEnabled = true;

            // Registering a background trigger if it is not already registered. Rfcomm Chat Service will now be advertised in the SDP record
            // First get the existing tasks to see if we already registered for it

            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == taskName)
                {
                    taskRegistration = task.Value;
                    break;
                }
            }

            if (taskRegistration != null)
            {
                rootPage.NotifyUser("Background watcher already registered.", NotifyType.StatusMessage);
                return;
            }
            else
            {
                // Applications registering for background trigger must request for permission.
                BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();

                var builder = new BackgroundTaskBuilder();
                builder.TaskEntryPoint = taskEntryPoint;
                builder.SetTrigger(trigger);
                builder.Name = taskName;

                try
                {
                    taskRegistration = builder.Register();
                    AttachProgressAndCompletedHandlers(taskRegistration);

                    // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
                    if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
                    {
                        rootPage.NotifyUser("Background watcher registered.", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                    }
                }
                catch (Exception)
                {
                    rootPage.NotifyUser("Background task not registered",
                            NotifyType.ErrorMessage);
                }
            }
        }

async void OnCompleted | ( | BackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Called when background task defferal is completed.

This can happen for a number of reasons (both expected and unexpected). IF this is expected, we'll notify the user. If it's not, we'll show that this is an error. Finally, clean up the connection by calling Disconnect().

Parameters:
sender
args

Definition at line 195 of file Scenario3_BgChatServer.xaml.cs.

        {
            var settings = ApplicationData.Current.LocalSettings;
            if (settings.Values.ContainsKey("TaskCancelationReason"))
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Task cancelled unexpectedly - reason: " + settings.Values["TaskCancelationReason"].ToString(), NotifyType.ErrorMessage);
                });
            }
            else
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Background task completed", NotifyType.StatusMessage);
                });
            }
            try
            {
                args.CheckResult();
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
            }
            Disconnect();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 81 of file Scenario3_BgChatServer.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == taskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                }
            }
        }

async void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

The background task updates the progress counter.

When that happens, this event handler gets invoked When the handler is invoked, we will display the value stored in local settings to the user.

Parameters:
task
args

Definition at line 257 of file Scenario3_BgChatServer.xaml.cs.

        {

            if (ApplicationData.Current.LocalSettings.Values.Keys.Contains("ReceivedMessage"))
            {
                string backgroundMessage = (string)ApplicationData.Current.LocalSettings.Values["ReceivedMessage"];
                string remoteDeviceName = (string)ApplicationData.Current.LocalSettings.Values["RemoteDeviceName"];

                if(!backgroundMessage.Equals(""))
                {
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Client Connected: " + remoteDeviceName, NotifyType.StatusMessage);
                        ConversationListBox.Items.Add("Received: " + backgroundMessage);
                    });
                }
            }
        }

void SendButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario3_BgChatServer.xaml.cs.

        {
            SendMessage();
        }

void SendMessage ( ) [inline, private]

Sends the current message in MessageTextBox.

Also makes sure the text is not empty and updates the conversation list.

Definition at line 163 of file Scenario3_BgChatServer.xaml.cs.

        {
            var message = MessageTextBox.Text;
            var previousMessage = (string)ApplicationData.Current.LocalSettings.Values["SendMessage"];

            // Make sure previous message has been sent
            if ( previousMessage == null || previousMessage == "")
            {
                // Save the current message to local settings so the background task can pick it up.
                ApplicationData.Current.LocalSettings.Values["SendMessage"] = message;

                // Clear the messageTextBox for a new message
                MessageTextBox.Text = "";
                ConversationListBox.Items.Add("Sent: " + message);
            }
            else
            {
                // Do nothing until previous message has been sent.
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 68 of file Scenario3_BgChatServer.xaml.cs.

byte [] sdpRecordBlob [private]
Initial value:
 new byte[]
        {
            0x35, 0x4a,

            0x09, 0x01, 0x00,
            0x25, 0x1d,
                0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x20,
                0x52, 0x66, 0x63, 0x6f, 0x6d, 0x6d, 0x20,
                0x43, 0x68, 0x61, 0x74, 0x20,
                0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,

            0x09, 0x01, 0x01,
            0x25, 0x23,
                0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x20,
                0x52, 0x66, 0x63, 0x6f, 0x6d, 0x6d, 0x20,
                0x43, 0x68, 0x61, 0x74, 0x20,
                0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20,
                0x69, 0x6e, 0x20, 0x43, 0x23

        }

Definition at line 40 of file Scenario3_BgChatServer.xaml.cs.

string taskEntryPoint = "BackgroundTasks.RfcommServerTask" [private]

Definition at line 36 of file Scenario3_BgChatServer.xaml.cs.

string taskName = "Scenario3_BackgroundTask" [private]

Definition at line 34 of file Scenario3_BgChatServer.xaml.cs.

IBackgroundTaskRegistration taskRegistration [private]

Definition at line 30 of file Scenario3_BgChatServer.xaml.cs.

RfcommConnectionTrigger trigger [private]

Definition at line 32 of file Scenario3_BgChatServer.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothRfcommChat/cs/Scenario3_BgChatServer.xaml.cs
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Calibration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Calibration
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Calibration Class Reference

List of all members.

Public Member Functions

Scenario3_Calibration ()
Scenario3_Calibration ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | OnApproximateAccuracy (object sender, RoutedEventArgs e)
void | OnApproximateAccuracy ()
void | OnHighAccuracy (object sender, RoutedEventArgs e)
void | OnHighAccuracy ()
void | OnUnreliableAccuracy (object sender, RoutedEventArgs e)
void | OnUnreliableAccuracy ()

Private Attributes

CalibrationBar | calibrationBar = new CalibrationBar()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario3_Calibration.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Calibration ( ) [inline]

Definition at line 29 of file Scenario3_Calibration.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario3_Calibration ( ) [inline]

Definition at line 26 of file Scenario3_Calibration.xaml.cs.

        {
            this.InitializeComponent();

            if (rootPage.SensorReadingType == SensorReadingType.Relative)
            {
                EnabledContent.Visibility = Visibility.Collapsed;
                DisabledContent.Visibility = Visibility.Visible;
            }
        }

Member Function Documentation

void OnApproximateAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for approximate accuracy.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 74 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

void OnApproximateAccuracy ( ) [inline, private]

This is the click handler for approximate accuracy.

Acceptable accuracy met, so hide the calibration bar.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 55 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

void OnHighAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for high accuracy.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 63 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

void OnHighAccuracy ( ) [inline, private]

This is the click handler for high accuracy.

Acceptable accuracy met, so hide the calibration bar.

Acceptable accuracy met, so hide the calibration bar.

Parameters:
sender
e

Definition at line 46 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file Scenario3_Calibration.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 51 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
            base.OnNavigatingFrom(e);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.Hide();
        }

void OnUnreliableAccuracy ( ) [inline, private]

This is the click handler for unreliable accuracy.

Sensor does not meet accuracy requirements. Request to show the calibration bar per the calibration guidance.

Sensor does not meet accuracy requirements. Request to show the calibration bar per the calibration guidance.

Parameters:
sender
e

Definition at line 64 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.RequestCalibration(MagnetometerAccuracy.Unreliable);
        }

void OnUnreliableAccuracy | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for unreliable accuracy.

Sensor does not meet accuracy requirements. Request to show the calibration bar per the calibration guidance.

Parameters:
sender
e

Definition at line 85 of file Scenario3_Calibration.xaml.cs.

        {
            calibrationBar.RequestCalibration(MagnetometerAccuracy.Unreliable);
        }

Member Data Documentation

CalibrationBar calibrationBar = new CalibrationBar() [private]

Definition at line 27 of file Scenario3_Calibration.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario3_Calibration.xaml.cs.

The documentation for this class was generated from the following files:
  • Compass/cs/Scenario3_Calibration.xaml.cs
  • OrientationSensor/cs/Scenario3_Calibration.xaml.cs
  • Compass/cpp/Scenario3_Calibration.xaml.cpp
  • Inclinometer/cpp/Scenario3_Calibration.xaml.cpp
  • OrientationSensor/cpp/Scenario3_Calibration.xaml.cpp
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ChangeEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ChangeEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ChangeEvents Class Reference

List of all members.

Public Member Functions

Scenario3_ChangeEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | AccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
async void | ReadingChanged (object sender, ActivitySensorReadingChangedEventArgs e)
void | ScenarioDisableReadingChanged (object sender, RoutedEventArgs e)
async void | ScenarioEnableReadingChanged (object sender, RoutedEventArgs e)

Private Attributes

ActivitySensor | _activitySensor
DeviceAccessInformation | _deviceAccessInformation
Guid | ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196")
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario3_ChangeEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ChangeEvents ( ) [inline]

Definition at line 35 of file Scenario3_ChangeEvents.xaml.cs.

        {
            this.InitializeComponent();
            _activitySensor = null;

            // Register for access changed notifications for activity sensors
            _deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
            _deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(AccessChanged);
        }

Member Function Documentation

async void AccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for AccessChanged events.

Parameters:
sender
e

Definition at line 152 of file Scenario3_ChangeEvents.xaml.cs.

        {
            var status = e.Status;
            if (status != DeviceAccessStatus.Allowed)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
                    _activitySensor = null;

                    ScenarioEnableReadingChangedButton.IsEnabled = true;
                    ScenarioDisableReadingChangedButton.IsEnabled = false;
                });
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 50 of file Scenario3_ChangeEvents.xaml.cs.

        {
            ScenarioEnableReadingChangedButton.IsEnabled = true;
            ScenarioDisableReadingChangedButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 64 of file Scenario3_ChangeEvents.xaml.cs.

        {
            if (ScenarioDisableReadingChangedButton.IsEnabled && _activitySensor != null)
            {
                _activitySensor.ReadingChanged -= new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);
            }

            base.OnNavigatingFrom(e);
        }

async void ReadingChanged | ( | object | sender,
 |  | ActivitySensorReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 79 of file Scenario3_ChangeEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ActivitySensorReading reading = e.Reading;
                ScenarioOutput_Activity.Text = reading.Activity.ToString();
                ScenarioOutput_Confidence.Text = reading.Confidence.ToString();
                ScenarioOutput_ReadingTimestamp.Text = reading.Timestamp.ToString("u");
            });
        }

void ScenarioDisableReadingChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Reading Changed Off' button.

Parameters:
sender
e

Definition at line 135 of file Scenario3_ChangeEvents.xaml.cs.

        {
            if (_activitySensor != null)
            {
                _activitySensor.ReadingChanged -= new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);
                rootPage.NotifyUser("Unsubscribed from reading changes", NotifyType.StatusMessage);
            }

            ScenarioEnableReadingChangedButton.IsEnabled = true;
            ScenarioDisableReadingChangedButton.IsEnabled = false;
        }

async void ScenarioEnableReadingChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Reading Changed On' button.

Parameters:
sender
e

Definition at line 95 of file Scenario3_ChangeEvents.xaml.cs.

        {
            // Determine if we can access activity sensors
            if (_deviceAccessInformation.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                if (_activitySensor == null)
                {
                    _activitySensor = await ActivitySensor.GetDefaultAsync();
                }

                if (_activitySensor != null)
                {
                    _activitySensor.SubscribedActivities.Add(ActivityType.Walking);
                    _activitySensor.SubscribedActivities.Add(ActivityType.Running);
                    _activitySensor.SubscribedActivities.Add(ActivityType.InVehicle);
                    _activitySensor.SubscribedActivities.Add(ActivityType.Biking);
                    _activitySensor.SubscribedActivities.Add(ActivityType.Fidgeting);

                    _activitySensor.ReadingChanged += new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);

                    ScenarioEnableReadingChangedButton.IsEnabled = false;
                    ScenarioDisableReadingChangedButton.IsEnabled = true;
                    rootPage.NotifyUser("Subscribed to reading changes", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("No activity sensor found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ActivitySensor _activitySensor [private]

Definition at line 33 of file Scenario3_ChangeEvents.xaml.cs.

DeviceAccessInformation _deviceAccessInformation [private]

Definition at line 32 of file Scenario3_ChangeEvents.xaml.cs.

Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196") [private]

Definition at line 30 of file Scenario3_ChangeEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_ChangeEvents.xaml.cs.

The documentation for this class was generated from the following files:
  • ActivitySensor/cs/Scenario3_ChangeEvents.xaml.cs
  • ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CheckUserConsentGroup Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_CheckUserConsentGroup
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario3_CheckUserConsentGroup Class Reference

List of all members.

Public Member Functions

Scenario3_CheckUserConsentGroup ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ShowConsentGroups (object sender, RoutedEventArgs e)

Static Private Member Functions

static string | EvaluateConsentResult (UserAgeConsentResult consentResult)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario3_CheckUserConsentGroup.xaml.cs.

Constructor & Destructor Documentation

Scenario3_CheckUserConsentGroup ( ) [inline]

Definition at line 29 of file Scenario3_CheckUserConsentGroup.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

static string EvaluateConsentResult ( UserAgeConsentResult consentResult ) [inline, static, private]

Definition at line 45 of file Scenario3_CheckUserConsentGroup.xaml.cs.

        {
            switch (consentResult)
            {
                case UserAgeConsentResult.Included:
                case UserAgeConsentResult.NotEnforced:
                    return "Allowed.";
                case UserAgeConsentResult.NotIncluded:
                    return "Not allowed.";
                case UserAgeConsentResult.Unknown:
                    return "Cannot determine. Default to app specific age unknown behavior.";
                default:
                case UserAgeConsentResult.Ambiguous:
                    return "Age regulations have changed, the app needs to be updated to reflect new catagories.";
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario3_CheckUserConsentGroup.xaml.cs.

        {
            // Populate the list of users.
            var observableUsers = await MainPage.GetUserViewModelsAsync();
            UserList.DataContext = observableUsers;
            if (observableUsers.Count > 0)
            {
                UserList.SelectedIndex = 0;
            }
        }

async void ShowConsentGroups | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file Scenario3_CheckUserConsentGroup.xaml.cs.

        {
            var selectedUser = (UserViewModel)UserList.SelectedValue;
            if (selectedUser != null)
            {
                ResultsText.Text = "";

                rootPage.NotifyUser("", NotifyType.StatusMessage);
                try
                {
                    User user = User.GetFromId(selectedUser.UserId);

                    String result = "";

                    UserAgeConsentResult canShowChildContent = await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup.Child);
                    result += "Child content: " + EvaluateConsentResult(canShowChildContent) + "\n";

                    UserAgeConsentResult canShowMinorContent = await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup.Minor);
                    result += "Minor content: " + EvaluateConsentResult(canShowMinorContent) + "\n";

                    UserAgeConsentResult canShowAdultContent = await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup.Adult);
                    result += "Adult content: " + EvaluateConsentResult(canShowAdultContent) + "\n";

                    ResultsText.Text = result;
                }
                catch (Exception ex)
                {
                    // Operations on the "User" object fail if the user signs out.
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_CheckUserConsentGroup.xaml.cs.

The documentation for this class was generated from the following file:
  • UserInfo/cs/Scenario3_CheckUserConsentGroup.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ChooseControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ChooseControl
Public Member Functions

Scenario3_ChooseControl Class Reference

This scenario shows how to choose a user control based on whether a class is present. More...

List of all members.

Public Member Functions

Scenario3_ChooseControl ()

Detailed Description

You can create two implementations of a user control, one that relies on a new feature, and one that does not, and choose the control to use at runtime.

Definition at line 23 of file Scenario3_ChooseControl.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ChooseControl ( ) [inline]

Definition at line 25 of file Scenario3_ChooseControl.xaml.cs.

        {
            this.InitializeComponent();

            UserControl mediaControl;

            // If the MediaPlayerElement class is available, then create a user control that uses it.
            // Otherwise, create a user control that uses the older MediaElement control.
            if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Controls.MediaPlayerElement"))
            {
                mediaControl = new MPEUserControl();
            }
            else
            {
                mediaControl = new MEUserControl();
            }

            // Insert the control into our page.
            MediaPlayerPlacement.Children.Add(mediaControl);
        }

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/Scenario3_ChooseControl.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Choosing Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Choosing
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Choosing Class Reference

List of all members.

Public Member Functions

Scenario3_Choosing ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | OnHumanPresenceSensorAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
async void | OnHumanPresenceSensorEnumerationCompleted (DeviceWatcher sender, object e)
async void | OnHumanPresenceSensorRemoved (DeviceWatcher sender, DeviceInformationUpdate update)
async void | OnHumanPresenceSensorUpdated (DeviceWatcher sender, DeviceInformationUpdate update)
async Task | ReadOneReadingFromSensorAsync (DeviceInformation deviceInfo)
async void | ScenarioPick_Click (object sender, RoutedEventArgs e)
async void | ScenarioReadSelected_Click (object sender, RoutedEventArgs e)
void | ScenarioStart_Click (object sender, RoutedEventArgs e)
void | ScenarioStop_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current
DeviceWatcher | watcher = null

Detailed Description

Definition at line 26 of file Scenario3_Choosing.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Choosing ( ) [inline]

Definition at line 34 of file Scenario3_Choosing.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void OnHumanPresenceSensorAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Invoked when the device watcher finds a presence sensor.

Parameters:
sender | The device watcher
device | Device information for the presence sensor that was found

Definition at line 69 of file Scenario3_Choosing.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // The app can optionally ignore sensors which do not satisfy desired criteria.
                // This sample does not apply any filter. See the DeviceEnumerationAndPairing sample
                // for more advanced ways of presenting a list of devices.

                ListBoxItem item = new ListBoxItem() { Content = deviceInfo.Name, Tag = deviceInfo };
                SensorsList.Items.Add(item);
            });
        }

async void OnHumanPresenceSensorEnumerationCompleted | ( | DeviceWatcher | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 133 of file Scenario3_Choosing.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("All sensors found. Monitoring for changes...", NotifyType.StatusMessage);
            });
        }

async void OnHumanPresenceSensorRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | update |
 | ) |  |  | [inline, private]

Invoked when a presence sensor is removed from the system.

Parameters:
sender | The device watcher
device | Device information for the presence sensor that was removed

Definition at line 87 of file Scenario3_Choosing.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Look for the sensor that was removed from the system and erase it from the ListBox.
                string removedId = update.Id;

                foreach (ListBoxItem item in SensorsList.Items)
                {
                    DeviceInformation itemDeviceInfo = (DeviceInformation)item.Tag;
                    if (itemDeviceInfo.Id == removedId)
                    {
                        SensorsList.Items.Remove(item);
                        break;
                    }
                }
            });
        }

async void OnHumanPresenceSensorUpdated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | update |
 | ) |  |  | [inline, private]

Invoked when a presence sensor's properties change.

Parameters:
sender | The device watcher
device | Device information for the presence sensor that changed

Definition at line 111 of file Scenario3_Choosing.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Look for the sensor that was updated.
                string updatedId = update.Id;

                foreach (ListBoxItem item in SensorsList.Items)
                {
                    DeviceInformation itemDeviceInfo = (DeviceInformation)item.Tag;
                    if (itemDeviceInfo.Id == updatedId)
                    {
                        // Update the DeviceInformation for the sensor that updated.
                        itemDeviceInfo.Update(update);
                        // Refresh the device name, in case it changed.
                        item.Content = itemDeviceInfo.Name;
                        break;
                    }
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario3_Choosing.xaml.cs.

        {
            if (watcher != null)
            {
                watcher.Stop();
            }
        }

async Task ReadOneReadingFromSensorAsync ( DeviceInformation deviceInfo ) [inline, private]

Definition at line 185 of file Scenario3_Choosing.xaml.cs.

        {
            HumanPresenceSensor sensor;
            try
            {
                sensor = await HumanPresenceSensor.FromIdAsync(deviceInfo.Id);
            }
            catch (UnauthorizedAccessException)
            {
                // The user denied this app presence sensor access.
                sensor = null;
            }

            EngagementStateTextBlock.Text = "No data";
            DetectionStateTextBlock.Text = "No data";
            TimestampTextBlock.Text = "No data";
            DetectionDistanceTextBlock.Text = "No data";

            if (sensor != null)
            {
                HumanPresenceSensorReading reading;
                try
                {
                    reading = sensor.GetCurrentReading();
                }
                catch (UnauthorizedAccessException)
                {
                    // The user denied this app presence sensor access.
                    reading = null;
                }

                if (reading != null)
                {
                    if (sensor.IsEngagementSupported)
                    {
                        EngagementStateTextBlock.Text = reading.Engagement.ToString();
                    }
                    else
                    {
                        EngagementStateTextBlock.Text = "Not Supported";
                    }

                    if (sensor.IsPresenceSupported)
                    {
                        DetectionStateTextBlock.Text = reading.Presence.ToString();
                    }
                    else
                    {
                        DetectionStateTextBlock.Text = "Not Supported";
                    }

                    // Show the detection distance, if available
                    DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();

                    TimestampTextBlock.Text = reading.Timestamp.ToString("u");
                }
            }
            else
            {
                rootPage.NotifyUser($"Could not access sensor {deviceInfo.Name}", NotifyType.ErrorMessage);
            }
        }

async void ScenarioPick_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario3_Choosing.xaml.cs.

        {
            DevicePicker picker = new DevicePicker();
            picker.Appearance.Title = "Select a presence sensor from which to read data";
            picker.Filter.SupportedDeviceSelectors.Add(HumanPresenceSensor.GetDeviceSelector());

            // Calculate the position of the button next to which we will place the picker.
            GeneralTransform transform = ScenarioPickButton.TransformToVisual(null);
            Rect rect = transform.TransformBounds(new Rect(0.0, 0.0, ScenarioPickButton.ActualWidth, ScenarioPickButton.ActualHeight));

            DeviceInformation deviceInfo = await picker.PickSingleDeviceAsync(rect);
            if (deviceInfo != null)
            {
                await ReadOneReadingFromSensorAsync(deviceInfo);
            }
        }

async void ScenarioReadSelected_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 169 of file Scenario3_Choosing.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            ListBoxItem item = (ListBoxItem)SensorsList.SelectedItem;
            if (item == null)
            {
                rootPage.NotifyUser("No sensor is selected.", NotifyType.ErrorMessage);
                return;
            }

            DeviceInformation selectedInfo = (DeviceInformation)item.Tag;
            await ReadOneReadingFromSensorAsync(selectedInfo);
        }

void ScenarioStart_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 141 of file Scenario3_Choosing.xaml.cs.

        {
            SensorsList.Items.Clear();

            watcher = DeviceInformation.CreateWatcher(HumanPresenceSensor.GetDeviceSelector());
            watcher.Added += OnHumanPresenceSensorAdded;
            watcher.Removed += OnHumanPresenceSensorRemoved;
            watcher.Updated += OnHumanPresenceSensorUpdated;
            watcher.EnumerationCompleted += OnHumanPresenceSensorEnumerationCompleted;
            watcher.Start();

            rootPage.NotifyUser("Looking for sensors...", NotifyType.StatusMessage);

            ScenarioStartButton.IsEnabled = false;
            ScenarioStopButton.IsEnabled = true;
        }

void ScenarioStop_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 158 of file Scenario3_Choosing.xaml.cs.

        {
            watcher.Stop();
            watcher = null;

            rootPage.NotifyUser("", NotifyType.StatusMessage);

            ScenarioStartButton.IsEnabled = true;
            ScenarioStopButton.IsEnabled = false;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario3_Choosing.xaml.cs.

DeviceWatcher watcher = null [private]

Definition at line 32 of file Scenario3_Choosing.xaml.cs.

The documentation for this class was generated from the following file:
  • PresenceSensor/cs/Scenario3_Choosing.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ClientAuthentication Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ClientAuthentication
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario3_ClientAuthentication Class Reference

List of all members.

Public Member Functions

Scenario3_ClientAuthentication ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | AppendOutputLine (string value)
void | CloseSocket ()
async Task | ConnectWebSocketAsync ()
async Task< Certificate > | FindCertificateFromStoreAsync ()
async Task< Certificate > | GetClientCertificateAsync ()
async Task< Certificate > | InstallClientCertificateAsync ()
async void | OnClosed (IWebSocket sender, WebSocketClosedEventArgs args)
async void | OnConnect (object sender, RoutedEventArgs e)
void | OnDisconnect (object sender, RoutedEventArgs e)
void | SetBusy (bool value)
void | UpdateVisualState ()

Private Attributes

bool | busy
MainPage rootPage = MainPage.Current
StreamWebSocket | streamWebSocket

Static Private Attributes

static readonly string | ClientCertFriendlyName = "WebSocketSampleClientCert"
static readonly string | ClientCertIssuerName = "www.contoso.com"
static readonly string | ClientCertPassword = "1234"
static readonly string | ClientCertUriPath = "ms-appx:///Assets/clientCert.pfx"

Detailed Description

Definition at line 26 of file Scenario3_ClientAuthentication.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ClientAuthentication ( ) [inline]

Definition at line 33 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            this.InitializeComponent();
            UpdateVisualState();
        }

Member Function Documentation

void AppendOutputLine ( string value ) [inline, private]

Definition at line 263 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            OutputField.Text += value + "\r\n";
        }

void CloseSocket ( ) [inline, private]

Definition at line 245 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            if (streamWebSocket != null)
            {
                try
                {
                    streamWebSocket.Close(1000, "Closed due to user request.");
                }
                catch (Exception ex)
                {
                    AppendOutputLine(MainPage.BuildWebSocketError(ex));
                    AppendOutputLine(ex.Message);
                }

                streamWebSocket = null;
            }
        }

async Task ConnectWebSocketAsync ( ) [inline, private]

Definition at line 162 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling TryGetUri() that will return null for strings that are not
            // valid WebSocket URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet
            // or intErnet. In these cases the app requires the "Home or Work Networking" or
            // "Internet (Client)" capability respectively.
            Uri server = rootPage.TryGetUri(ServerAddressField.Text);
            if (server == null)
            {
                return;
            }

            // Certificate validation is meaningful only for secure connections.
            if (server.Scheme != "wss")
            {
                AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
            }

            streamWebSocket = new StreamWebSocket();
            streamWebSocket.Closed += OnClosed;

            // It is okay to set the ClientCertificate property even if GetClientCertificateAsync returns null.
            streamWebSocket.Control.ClientCertificate = await GetClientCertificateAsync();

            // When connecting to wss:// endpoint, the OS by default performs validation of
            // the server certificate based on well-known trusted CAs. For testing purposes, we are ignoring
            // SSL errors.
            // WARNING: Only test applications should ignore SSL errors.
            // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
            // attacks. (Although the connection is secure, the server is not authenticated.)
            // Note that not all certificate validation errors can be ignored.
            // In this case, we are ignoring these errors since the certificate assigned to the localhost
            // URI is self-signed and has subject name = fabrikam.com
            streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
            streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);

            AppendOutputLine($"Connecting to {server}...");

            try
            {
                await streamWebSocket.ConnectAsync(server);
            }
            catch (Exception ex) // For debugging
            {
                streamWebSocket.Dispose();
                streamWebSocket = null;

                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }

            rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
            AppendOutputLine("Connected to WebSocket Server.");
        }

async Task<Certificate> FindCertificateFromStoreAsync ( ) [inline, private]

Definition at line 74 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            // Find the client certificate for authentication. If not found, it means it has not been installed.
            CertificateQuery query = new CertificateQuery();
            query.IssuerName = ClientCertIssuerName;
            query.FriendlyName = ClientCertFriendlyName;

            IReadOnlyList<Certificate> certs = await CertificateStores.FindAllAsync(query);
            if (certs.Count == 0)
            {
                return null;
            }

            // This sample installs only one certificate, so if we find one, it must be ours.
            return certs[0];
        }

async Task<Certificate> GetClientCertificateAsync ( ) [inline, private]

Definition at line 148 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            // The client certificate could be installed already (if this scenario has been run before),
            // try finding it from the store.
            Certificate cert = await FindCertificateFromStoreAsync();
            if (cert != null)
            {
                return cert;
            }

            // If the client certificate is not already installed, install it.
            return await InstallClientCertificateAsync();
        }

async Task<Certificate> InstallClientCertificateAsync ( ) [inline, private]

Definition at line 91 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            // Load the certificate from the clientCert.pfx file packaged with this sample.
            // This certificate has been signed with a trusted root certificate installed on the server.
            // The installation is done by running the setupServer.ps1 file, which should have been done
            // before running the app.
            // WARNING: Including a pfx file in the app package violates the Windows Store
            // certification requirements. We are shipping the pfx file with the package for demonstrating
            // the usage of client certificates. Apps that will be published through Windows Store
            // need to use other approaches to obtain a client certificate.
            StorageFile clientCertFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(ClientCertUriPath));

            IBuffer buffer = await FileIO.ReadBufferAsync(clientCertFile);
            AppendOutputLine("Reading certificate succeeded.");

            string clientCertData = Windows.Security.Cryptography.CryptographicBuffer.EncodeToBase64String(buffer);

            try
            {
                // Install the certificate to the app's certificate store.
                // The app certificate store is removed when the app is uninstalled.

                //To install a certificate to the CurrentUser\MY store, which is not app specific,
                // you need to use CertificateEnrollmentManager.UserCertificateEnrollmentManager.ImportPfxDataAsync().
                // In order to call that method, an app must have the "sharedUserCertificates" capability.
                // There are two ways to add this capability:
                //
                // 1. You can double click on the Package.appxmanifest file from the
                // solution explorer, select the "Capabilities" tab in the opened page, and then check the
                // "Shared User Certificates" box from the capabilities list.
                // 2. You can right click on the Package.appxmanifest file from the
                // solution explorer, select "View Code", and add "sharedUserCertificates" under the <Capabilities>
                // element directly.
                // Package.appxmanifest in this sample shows this capability commented out.
                //
                // The certificate will remain even when the app is uninstalled.
                await CertificateEnrollmentManager.ImportPfxDataAsync(
                    clientCertData,
                    ClientCertPassword,
                    ExportOption.Exportable,
                    KeyProtectionLevel.NoConsent,
                    InstallOptions.DeleteExpired,
                    ClientCertFriendlyName);

                AppendOutputLine("Installing certificate succeeded.");

                // Return the certificate we just installed.
                return await FindCertificateFromStoreAsync();
            }
            catch (Exception ex)
            {
                // This can happen if the certificate has already expired.
                AppendOutputLine("Installing certificate failed with " + ex.Message);
                return null;
            }
        }

async void OnClosed | ( | IWebSocket | sender,
 |  | WebSocketClosedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 230 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            // Dispatch the event to the UI thread so we do not need to synchronize access to streamWebSocket.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

                if (streamWebSocket == sender)
                {
                    CloseSocket();
                    UpdateVisualState();
                }
            });
        }

async void OnConnect | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            SetBusy(true);
            await ConnectWebSocketAsync();
            SetBusy(false);
        }

void OnDisconnect | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 220 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            SetBusy(true);
            rootPage.NotifyUser("Closing", NotifyType.StatusMessage);
            CloseSocket();
            SetBusy(false);
            rootPage.NotifyUser("Closed", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            CloseSocket();
        }

void SetBusy ( bool value ) [inline, private]

Definition at line 61 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            busy = value;
            UpdateVisualState();
        }

void UpdateVisualState ( ) [inline, private]

Definition at line 49 of file Scenario3_ClientAuthentication.xaml.cs.

        {
            if (busy)
            {
                VisualStateManager.GoToState(this, "Busy", false);
            }
            else
            {
                VisualStateManager.GoToState(this, streamWebSocket != null ? "Connected" : "Disconnected", false);
            }
        }

Member Data Documentation

bool busy [private]

Definition at line 42 of file Scenario3_ClientAuthentication.xaml.cs.

readonly string ClientCertFriendlyName = "WebSocketSampleClientCert" [static, private]

Definition at line 30 of file Scenario3_ClientAuthentication.xaml.cs.

readonly string ClientCertIssuerName = "www.contoso.com" [static, private]

Definition at line 31 of file Scenario3_ClientAuthentication.xaml.cs.

readonly string ClientCertPassword = "1234" [static, private]

Definition at line 29 of file Scenario3_ClientAuthentication.xaml.cs.

readonly string ClientCertUriPath = "ms-appx:///Assets/clientCert.pfx" [static, private]

Definition at line 28 of file Scenario3_ClientAuthentication.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 39 of file Scenario3_ClientAuthentication.xaml.cs.

StreamWebSocket streamWebSocket [private]

Definition at line 41 of file Scenario3_ClientAuthentication.xaml.cs.

The documentation for this class was generated from the following file:
  • WebSocket/cs/Scenario3_ClientAuthentication.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CurrencyFormatting Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_CurrencyFormatting
Public Member Functions | Private Member Functions

Scenario3_CurrencyFormatting Class Reference

List of all members.

Public Member Functions

Scenario3_CurrencyFormatting ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario3_CurrencyFormatting.xaml.cs.

Constructor & Destructor Documentation

Scenario3_CurrencyFormatting ( ) [inline]

Definition at line 22 of file Scenario3_CurrencyFormatting.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 32 of file Scenario3_CurrencyFormatting.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.NumberFormatting.CurrencyFormatter class
            // to format a number as a currency.

            // Keep results of the scenario in a StringBuilder
            StringBuilder results = new StringBuilder();

            // Determine the current user's default currency.
            string currency = GlobalizationPreferences.Currencies[0];

            // Generate numbers used for formatting.
            ulong wholeNumber = 12345;
            double fractionalNumber = 12345.67;

            // Create currency formatter initialized with current number formatting preferences.
            CurrencyFormatter defaultCurrencyFormatter = new CurrencyFormatter(currency);

            CurrencyFormatter usdCurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.USD);
            CurrencyFormatter eurFRCurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.EUR, new[] { "fr-FR" }, "FR");
            CurrencyFormatter eurIECurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.EUR, new[] { "gd-IE" }, "IE");
            CurrencyFormatter currencyFormatEuroModeSwitch = new CurrencyFormatter(CurrencyIdentifiers.EUR);

            // Format numbers as currency.
            results.AppendLine("Fixed number (" + fractionalNumber + ")");
            results.AppendLine("With user's default currency: " + defaultCurrencyFormatter.Format(fractionalNumber));
            results.AppendLine("Formatted US Dollar: " + usdCurrencyFormatter.Format(fractionalNumber));
            results.AppendLine("Formatted Euro (fr-FR defaults): " + eurFRCurrencyFormatter.Format(fractionalNumber));
            results.AppendLine("Formatted Euro (gd-IE defaults): " + eurIECurrencyFormatter.Format(fractionalNumber));

            // Format currency with fraction digits always included.
            usdCurrencyFormatter.FractionDigits = 2;
            results.AppendLine("Formatted US Dollar (with fractional digits): " + usdCurrencyFormatter.Format(wholeNumber));

            // Format currenccy with grouping.
            usdCurrencyFormatter.IsGrouped = true;
            results.AppendLine("Formatted US Dollar (with grouping separators): " + usdCurrencyFormatter.Format(fractionalNumber));

            // Format using currency code instead of currency symbol
            currencyFormatEuroModeSwitch.Mode = CurrencyFormatterMode.UseCurrencyCode;
            results.AppendLine("Formatted Euro (as currency code): " + currencyFormatEuroModeSwitch.Format(fractionalNumber));

            // Switch so we can now format using currency symbol
            currencyFormatEuroModeSwitch.Mode = CurrencyFormatterMode.UseSymbol;
            results.AppendLine("Formatted Euro (as symbol): " + currencyFormatEuroModeSwitch.Format(fractionalNumber));

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario3_CurrencyFormatting.xaml.cs
  • NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CustomItems Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_CustomItems
Public Member Functions | Private Member Functions

Scenario3_CustomItems Class Reference

List of all members.

Public Member Functions

Scenario3_CustomItems ()

Private Member Functions

async void | AddToJumpList_Click (object sender, RoutedEventArgs e)
void | DescriptionLocalizedResource_Click (object sender, RoutedEventArgs e)
void | DisplayNameLocalizedResource_Click (object sender, RoutedEventArgs e)
void | GroupNameLocalizedResource_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario3_CustomItems.xaml.cs.

Constructor & Destructor Documentation

Scenario3_CustomItems ( ) [inline]

Definition at line 21 of file Scenario3_CustomItems.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void AddToJumpList_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario3_CustomItems.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();

            var item = JumpListItem.CreateWithArguments(Arguments.Text, DisplayName.Text);
            item.Description = Description.Text;
            item.GroupName = GroupName.Text;
            item.Logo = new Uri("ms-appx:///Assets/smalltile-sdk.png");

            jumpList.Items.Add(item);

            await jumpList.SaveAsync();
        }

void DescriptionLocalizedResource_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario3_CustomItems.xaml.cs.

        {
            Description.IsEnabled = !(bool)DescriptionLocalizedResource.IsChecked;
            Description.Text = "ms-resource:///Resources/CustomJumpListItemDescription";
        }

void DisplayNameLocalizedResource_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario3_CustomItems.xaml.cs.

        {
            DisplayName.IsEnabled = !(bool)DisplayNameLocalizedResource.IsChecked;
            DisplayName.Text = "ms-resource:///Resources/CustomJumpListItemDisplayName";
        }

void GroupNameLocalizedResource_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario3_CustomItems.xaml.cs.

        {
            GroupName.IsEnabled = !(bool)GroupNameLocalizedResource.IsChecked;
            GroupName.Text = "ms-resource:///Resources/CustomJumpListGroupName";
        }

The documentation for this class was generated from the following files:
  • JumpList/cs/Scenario3_CustomItems.xaml.cs
  • JumpList/cpp/Scenario3_CustomItems.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Enum Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Enum
Public Member Functions | Private Member Functions

Scenario3_Enum Class Reference

List of all members.

Public Member Functions

Scenario3_Enum ()

Private Member Functions

void ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 22 of file Scenario3_Enum.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Enum ( ) [inline]

Definition at line 24 of file Scenario3_Enum.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario3_Enum.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.Calendar class to enumerate through a calendar and
            // perform calendar math
            StringBuilder results = new StringBuilder();

            results.AppendLine("The number of years in each era of the Japanese era calendar is not regular. " +
                               "It is determined by the length of the given imperial era:");
            results.AppendLine();

            // Create Japanese calendar.
            Calendar calendar = new Calendar(new[] { "en-US" }, CalendarIdentifiers.Japanese, ClockIdentifiers.TwentyFourHour);

            // Enumerate all supported years in all supported Japanese eras.
            for (calendar.Era = calendar.FirstEra; true; calendar.AddYears(1))
            {
                // Process current era.
                results.AppendLine("Era " + calendar.EraAsString() + " contains " + calendar.NumberOfYearsInThisEra + " year(s)");

                // Enumerate all years in this era.
                for (calendar.Year = calendar.FirstYearInThisEra; true; calendar.AddYears(1))
                {
                    // Begin sample processing of current year.

                    // Move to first day of year. Change of month can affect day so order of assignments is important.
                    calendar.Month = calendar.FirstMonthInThisYear;
                    calendar.Day = calendar.FirstDayInThisMonth;

                    // Set time to midnight (local).
                    calendar.Period = calendar.FirstPeriodInThisDay;    // All days have 1 or 2 periods depending on clock type
                    calendar.Hour = calendar.FirstHourInThisPeriod;     // Hours start from 12 or 0 depending on clock type
                    calendar.Minute = 0;
                    calendar.Second = 0;
                    calendar.Nanosecond = 0;

                    if (calendar.Year % 1000 == 0)
                    {
                        results.AppendLine();
                    }
                    else if (calendar.Year % 10 == 0)
                    {
                        results.Append(".");
                    }

                    // End sample processing of current year.

                    // Break after processing last year.
                    if (calendar.Year == calendar.LastYearInThisEra)
                    {
                        break;
                    }
                }
                results.AppendLine();

                // Break after processing last era.
                if (calendar.Era == calendar.LastEra)
                {
                    break;
                }
            }
            results.AppendLine();

            // This section shows enumeration through the hours in a day to demonstrate that the number of time units in a given period (hours in a day, minutes in an hour, etc.)
            // should not be regarded as fixed. With Daylight Saving Time and other local calendar adjustments, a given day may have not have 24 hours, and
            // a given hour may not have 60 minutes, etc.
            results.AppendLine("The number of hours in a day is not constant. " +
                               "The US calendar transitions from daylight saving time to standard time on 4 November 2012:\n");

            // Create a DateTimeFormatter to display dates
            DateTimeFormatter displayDate = new DateTimeFormatter("longdate");

            // Create a gregorian calendar for the US with 12-hour clock format
            Calendar currentCal = new Windows.Globalization.Calendar(new string[] { "en-US" }, CalendarIdentifiers.Gregorian, ClockIdentifiers.TwentyFourHour, "America/Los_Angeles");

            // Set the calendar to a the date of the Daylight Saving Time-to-Standard Time transition for the US in 2012.
            // DST ends in the America/Los_Angeles time zone at 4 November 2012 02:00 PDT = 4 November 2012 09:00 UTC.
            DateTime dstDate = new DateTime(2012, 11, 4, 9, 0, 0, DateTimeKind.Utc);
            currentCal.SetDateTime(dstDate);

            // Set the current calendar to one day before DST change. Create a second calendar for comparision and set it to one day after DST change.
            Calendar endDate = currentCal.Clone();
            currentCal.AddDays(-1);
            endDate.AddDays(1);

            // Enumerate the day before, the day of, and the day after the 2012 DST-to-Standard time transition
            while (currentCal.Day <= endDate.Day)
            {
                // Process current day.
                DateTimeOffset date = currentCal.GetDateTime();
                results.AppendFormat("{0} contains {1} hour(s)\n", displayDate.Format(date), currentCal.NumberOfHoursInThisPeriod);

                // Enumerate all hours in this day.
                // Create a calendar to represent the following day.
                Calendar nextDay = currentCal.Clone();
                nextDay.AddDays(1);
                for (currentCal.Hour = currentCal.FirstHourInThisPeriod; true; currentCal.AddHours(1))
                {
                    // Display the hour for each hour in the day.
                    results.AppendFormat("{0} ", currentCal.HourAsPaddedString(2));

                    // Break upon reaching the next period (i.e. the first period in the following day).
                    if (currentCal.Day == nextDay.Day && currentCal.Period == nextDay.Period)
                    {
                        break;
                    }
                }
                results.AppendLine();
            }

            // Display results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • Calendar/cs/Scenario3_Enum.xaml.cs
  • Calendar/cpp/Scenario3_Enum.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_EnumerateTiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_EnumerateTiles
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_EnumerateTiles Class Reference

List of all members.

Public Member Functions

Scenario3_EnumerateTiles ()

Private Member Functions

async void EnumerateSecondaryTiles_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario3_EnumerateTiles.xaml.cs.

Constructor & Destructor Documentation

Scenario3_EnumerateTiles ( ) [inline]

Definition at line 24 of file Scenario3_EnumerateTiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void EnumerateSecondaryTiles_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario3_EnumerateTiles.xaml.cs.

        {
            // Get secondary tile ids for this package
            IReadOnlyList<SecondaryTile> tilelist = await SecondaryTile.FindAllAsync();
            if (tilelist.Count > 0)
            {
                StringBuilder outputText = new StringBuilder();
                foreach (var tile in tilelist)
                {
                    outputText.AppendLine($"Tile \"{tile.TileId}\", Display name = \"{tile.DisplayName}\"");
                }
                rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("No secondary tiles are available for this appId.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario3_EnumerateTiles.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario3_EnumerateTiles.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_FixAccount Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_FixAccount
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_FixAccount Class Reference

List of all members.

Public Member Functions

Scenario3_FixAccount ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Fix_Click (object sender, RoutedEventArgs e)
async Task< bool > | IsFixNeededAsync (UserDataAccount selectedAccount)

Private Attributes

bool | isLaunched = false
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario3_FixAccount.xaml.cs.

Constructor & Destructor Documentation

Scenario3_FixAccount ( ) [inline]

Definition at line 32 of file Scenario3_FixAccount.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Fix_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario3_FixAccount.xaml.cs.

        {
            // only one instance of the UserDataAccountManager pane can be launched at once per thread
            if (isLaunched == false)
            {
                isLaunched = true;
                rootPage.NotifyUser("", NotifyType.StatusMessage);

                var selectedAccount = (UserDataAccount)AccountsListComboBox.SelectedValue;
                if (selectedAccount != null)
                {
                    if (await IsFixNeededAsync(selectedAccount))
                    {
                        await UserDataAccountManager.ShowAccountErrorResolverAsync(selectedAccount.Id);
                    }
                    else
                    {
                        rootPage.NotifyUser("Account is not in an error state", NotifyType.ErrorMessage);
                    }

                    await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
                }

                isLaunched = false;
            }
        }

async Task<bool> IsFixNeededAsync ( UserDataAccount selectedAccount ) [inline, private]

Check the mailboxes, calendars, and contact lists for sync errors.

Parameters:
selectedAccount
Returns:
True if there is an sync error for email, calendar, or contacts. False if nothing is syncing or everything is syncing correctly

Definition at line 74 of file Scenario3_FixAccount.xaml.cs.

        {
            foreach (EmailMailbox mailbox in await selectedAccount.FindEmailMailboxesAsync())
            {
                if (mailbox.SyncManager != null)
                {
                    switch (mailbox.SyncManager.Status)
                    {
                        case EmailMailboxSyncStatus.AuthenticationError:
                        case EmailMailboxSyncStatus.PolicyError:
                        case EmailMailboxSyncStatus.UnknownError:
                            return true;
                    }
                }
            }

            foreach (AppointmentCalendar calendar in await selectedAccount.FindAppointmentCalendarsAsync())
            {
                if (calendar.SyncManager != null)
                {
                    switch (calendar.SyncManager.Status)
                    {
                        case AppointmentCalendarSyncStatus.AuthenticationError:
                        case AppointmentCalendarSyncStatus.PolicyError:
                        case AppointmentCalendarSyncStatus.UnknownError:
                            return true;
                    }
                }
            }

            foreach (ContactList contactList in await selectedAccount.FindContactListsAsync())
            {
                if (contactList.SyncManager != null)
                {
                    switch (contactList.SyncManager.Status)
                    {
                        case ContactListSyncStatus.AuthenticationError:
                        case ContactListSyncStatus.PolicyError:
                        case ContactListSyncStatus.UnknownError:
                            return true;
                    }
                }
            }

            return false;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario3_FixAccount.xaml.cs.

        {
            await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
        }

Member Data Documentation

bool isLaunched = false [private]

Definition at line 30 of file Scenario3_FixAccount.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario3_FixAccount.xaml.cs.

The documentation for this class was generated from the following files:
  • UserDataAccountManager/cs/Scenario3_FixAccount.xaml.cs
  • UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ForegroundApp Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ForegroundApp
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ForegroundApp Class Reference

The page is used to handle authenticate by foreground app scenario. More...

List of all members.

Public Member Functions

Scenario3_ForegroundApp ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AbortButton_Click (object sender, RoutedEventArgs e)
async void | AuthenticateButton_Click (object sender, RoutedEventArgs e)
void | ClearAuthenticationToken ()
void | InitializeForegroundAppAuthentication ()
async void | OnBackgroundAuthenticationCompleted (ScenarioCommon sender, BackgroundAuthenticationCompletedEventArgs e)
void | SkipButton_Click (object sender, RoutedEventArgs e)

Private Attributes

HotspotAuthenticationContext | authenticationContext
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario3_ForegroundApp.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ForegroundApp ( ) [inline]

Definition at line 31 of file Scenario3_ForegroundApp.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AbortButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file Scenario3_ForegroundApp.xaml.cs.

        {
            authenticationContext.AbortAuthentication(ConfigStore.MarkAsManualConnect);
            rootPage.NotifyUser("Authentication aborted", NotifyType.StatusMessage);
            ClearAuthenticationToken();
        }

async void AuthenticateButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario3_ForegroundApp.xaml.cs.

        {
            AuthenticateButton.IsEnabled = false;

            HotspotCredentialsAuthenticationResult result = await authenticationContext.IssueCredentialsAsync(
                ConfigStore.UserName, ConfigStore.Password, ConfigStore.ExtraParameters, ConfigStore.MarkAsManualConnect);
            if (result.ResponseCode == HotspotAuthenticationResponseCode.LoginSucceeded)
            {
                rootPage.NotifyUser("Issuing credentials succeeded", NotifyType.StatusMessage);
                Uri logoffUrl = result.LogoffUrl;
                if (logoffUrl != null)
                {
                    rootPage.NotifyUser("The logoff URL is: " + logoffUrl.OriginalString, NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Issuing credentials failed", NotifyType.ErrorMessage);
            }
            AuthenticateButton.IsEnabled = true;
        }

void ClearAuthenticationToken ( ) [inline, private]

Clear the authentication token in the application storage and update the UI.

Definition at line 144 of file Scenario3_ForegroundApp.xaml.cs.

        {
            ConfigStore.AuthenticationToken = "";
            AuthenticateButton.IsEnabled = false;
            SkipButton.IsEnabled = false;
            AbortButton.IsEnabled = false;
        }

void InitializeForegroundAppAuthentication ( ) [inline, private]

Query authentication token from application storage and update the UI.

The token gets passed from the background task handler.

Definition at line 122 of file Scenario3_ForegroundApp.xaml.cs.

        {
            string token = ConfigStore.AuthenticationToken;
            if (String.IsNullOrEmpty(token))
            {
                return; // no token found
            }
            if (!HotspotAuthenticationContext.TryGetAuthenticationContext(token, out authenticationContext))
            {
                rootPage.NotifyUser("TryGetAuthenticationContext failed", NotifyType.ErrorMessage);
                return;
            }

            AuthenticateButton.IsEnabled = true;
            SkipButton.IsEnabled = true;
            AbortButton.IsEnabled = true;
        }

async void OnBackgroundAuthenticationCompleted | ( | ScenarioCommon | sender,
 |  | BackgroundAuthenticationCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Handle authentication event triggered by background task.

Parameters:
sender
e

Definition at line 66 of file Scenario3_ForegroundApp.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (e.Succeeded)
                {
                    InitializeForegroundAppAuthentication();
                }
                else
                {
                    rootPage.NotifyUser($"Background task encountered exception: {e.ExtendedError}", NotifyType.ErrorMessage);
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 56 of file Scenario3_ForegroundApp.xaml.cs.

        {
            ScenarioCommon.Instance.BackgroundAuthenticationCompleted -= OnBackgroundAuthenticationCompleted;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 41 of file Scenario3_ForegroundApp.xaml.cs.

        {
            // Configure background task handler to trigger foregound app for authentication
            ConfigStore.AuthenticateThroughBackgroundTask = false;

            // Setup completion handler
            ScenarioCommon.Instance.RegisteredCompletionHandlerForBackgroundTask();

            // Register event to update UI state on authentication event
            ScenarioCommon.Instance.BackgroundAuthenticationCompleted += OnBackgroundAuthenticationCompleted;

            // Check current authentication state
            InitializeForegroundAppAuthentication();
        }

void SkipButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario3_ForegroundApp.xaml.cs.

        {
            // Here you can implement custom authentication.
            authenticationContext.SkipAuthentication();
            rootPage.NotifyUser("Authentication skipped", NotifyType.StatusMessage);
            ClearAuthenticationToken();
        }

Member Data Documentation

HotspotAuthenticationContext authenticationContext [private]

Definition at line 29 of file Scenario3_ForegroundApp.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_ForegroundApp.xaml.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/Scenario3_ForegroundApp.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Full Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Full
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_Full Class Reference

List of all members.

Public Member Functions

Scenario3_Full ()

Private Member Functions

void ShowContactCard_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario3_Full.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Full ( ) [inline]

Definition at line 25 of file Scenario3_Full.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ShowContactCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 30 of file Scenario3_Full.xaml.cs.

        {
            Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
            if (contact != null)
            {
                // Try to share the screen half/half with the full contact card.
                FullContactCardOptions options = new FullContactCardOptions();
                options.DesiredRemainingView = ViewSizePreference.UseHalf;

                // Show the full contact card.
                ContactManager.ShowFullContactCard(contact, options);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario3_Full.xaml.cs.

The documentation for this class was generated from the following files:
  • ContactCards/cs/Scenario3_Full.xaml.cs
  • ContactCards/cpp/Scenario3_Full.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_HardwareDRM Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_HardwareDRM
Public Member Functions

Scenario3_HardwareDRM Class Reference

List of all members.

Public Member Functions

Scenario3_HardwareDRM ()

Detailed Description

Definition at line 17 of file Scenario3_HardwareDRM.xaml.cs.

Constructor & Destructor Documentation

Scenario3_HardwareDRM ( ) [inline]

Definition at line 19 of file Scenario3_HardwareDRM.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = new HardwareDRMViewModel(mediaElement);
        }

The documentation for this class was generated from the following file:
  • PlayReady/cs/Scenario3_HardwareDRM.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_InkingFeedback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_InkingFeedback
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_InkingFeedback Class Reference

List of all members.

Public Member Functions

Scenario3_InkingFeedback ()

Private Member Functions

SimpleHapticsControllerFeedback | GetSelectedFeedbackOrFallback (out string message)
void | HapticCanvas_Entered (object sender, PointerRoutedEventArgs e)
void | HapticCanvas_Exited (object sender, PointerRoutedEventArgs e)

Private Attributes

SimpleHapticsControllerFeedback | currentFeedback
SimpleHapticsController | hapticsController
PenDevice | penDevice

Detailed Description

Definition at line 22 of file Scenario3_InkingFeedback.xaml.cs.

Constructor & Destructor Documentation

Scenario3_InkingFeedback ( ) [inline]

Definition at line 28 of file Scenario3_InkingFeedback.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback ( out string message ) [inline, private]

Definition at line 109 of file Scenario3_InkingFeedback.xaml.cs.

        {
            // Look up the waveform the user selected.
            string name = (string)waveformComboBox.SelectionBoxItem;
            ushort waveform = MainPage.WaveformNamesMap[name];

            // See if the haptics controller supports the selected waveform.
            SimpleHapticsControllerFeedback feedback = MainPage.FindSupportedFeedback(hapticsController, waveform);
            if (feedback != null)
            {
                message = "Waveform set to " + name;
                return feedback;
            }

            // It does not. Use InkContinuous as a fallback.
            message = name + " is not supported by this pen, so falling back to InkContinuous";
            return MainPage.FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms.InkContinuous);
        }

void HapticCanvas_Entered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario3_InkingFeedback.xaml.cs.

        {
            // If the current Pointer device is not a pen, exit
            if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
            {
                return;
            }

            // Attempt to retrieve the PenDevice from the current PointerId
            penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);

            // If a PenDevice cannot be retrieved based on the PointerId, it does not support
            // advanced pen features, such as tactile feedback
            if (penDevice == null)
            {
                statusText.Text = "Advanced pen features not supported";
                return;
            }

            // Check to see if the current PenDevice supports tactile feedback by seeing if it
            // has a SimpleHapticsController
            hapticsController = penDevice.SimpleHapticsController;
            if (hapticsController == null)
            {
                statusText.Text = "This pen does not provide tactile feedback";
                return;
            }

            // Get feedback based on the user's selected waveform
            currentFeedback = GetSelectedFeedbackOrFallback(out string message);

            // Send the current feedback to the PenDevice's SimpleHapticsController.
            // Once sent, inking tactile feedback will be triggered as soon as the pen tip touches
            // the screen and will be stopped once the pen tip is lifted from the screen.
            // Also, check to see if the current PenDevice's SimpleHapticsController supports
            // setting the intensity value of the tactile feedback.  If so, set it based
            // on the slider.  If not, send the waveform without custom intensity.
            if (hapticsController.IsIntensitySupported)
            {
                hapticsController.SendHapticFeedback(currentFeedback, intensitySlider.Value / 100);
                message += "\nIntensity set to " + intensitySlider.Value + "%";
            }
            else
            {
                hapticsController.SendHapticFeedback(currentFeedback);
                message += "\nSetting intensity is not supported by this pen";
            }
            statusText.Text = message;
        }

void HapticCanvas_Exited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 90 of file Scenario3_InkingFeedback.xaml.cs.

        {
            penDevice = null;
            statusText.Text = "";
            if (hapticsController != null)
            {
                hapticsController.StopFeedback();
                hapticsController = null;
                currentFeedback = null;
            }
        }

Member Data Documentation

SimpleHapticsControllerFeedback currentFeedback [private]

Definition at line 26 of file Scenario3_InkingFeedback.xaml.cs.

SimpleHapticsController hapticsController [private]

Definition at line 24 of file Scenario3_InkingFeedback.xaml.cs.

PenDevice penDevice [private]

Definition at line 25 of file Scenario3_InkingFeedback.xaml.cs.

The documentation for this class was generated from the following file:
  • PenHaptics/cs/Scenario3_InkingFeedback.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_InvokeScript Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_InvokeScript
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_InvokeScript Class Reference

List of all members.

Public Member Functions

Scenario3_InvokeScript ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | InvokeScript ()
void | LoadHtml ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario3_InvokeScript.xaml.cs.

Constructor & Destructor Documentation

Scenario3_InvokeScript ( ) [inline]

Definition at line 22 of file Scenario3_InvokeScript.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void InvokeScript ( ) [inline, private]

Definition at line 38 of file Scenario3_InvokeScript.xaml.cs.

        {
            // Invoke the javascript function called 'doSomething' that is loaded into the WebView.
            try
            {
                string result = await WebViewControl.InvokeScriptAsync("doSomething", null);
                rootPage.NotifyUser($"Script returned \"{result}\"", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                string errorText = null;
                switch (ex.HResult)
                {
                    case unchecked((int)0x80020006):
                        errorText = "There is no function called doSomething";
                        break;
                    case unchecked((int)0x80020101):
                        errorText = "A JavaScript error or exception occured while executing the function doSomething";
                        break;

                    case unchecked((int)0x800a138a):
                        errorText = "doSomething is not a function";
                        break;
                    default:
                        // Some other error occurred.
                        errorText = ex.Message;
                        break;
                }
                rootPage.NotifyUser(errorText, NotifyType.ErrorMessage);
            }
        }

void LoadHtml ( ) [inline, private]

Definition at line 32 of file Scenario3_InvokeScript.xaml.cs.

        {
            // Grab the HTML from the text box and load it into the WebView.
            WebViewControl.NavigateToString(HtmlBox.Text);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 27 of file Scenario3_InvokeScript.xaml.cs.

        {
            HtmlBox.Text = await MainPage.LoadStringFromPackageFileAsync("script_example.html");
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario3_InvokeScript.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario3_InvokeScript.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_LaunchAppServices Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_LaunchAppServices
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_LaunchAppServices Class Reference

List of all members.

Public Member Functions

Scenario3_LaunchAppServices ()

Public Attributes

ObservableCollection
< RemoteSystem > 		SystemList = > m_rootPage.systemList

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | ConnectToRemoteAppServiceAsync ()
async void | GenerateRandomNumber_Clicked (object sender, RoutedEventArgs e)
async Task | SendMessageToRemoteAppServiceAsync (AppServiceConnection connection)
void | UpdateStatus (string status, NotifyType statusType)
bool | ValidateInput ()

Private Attributes

int | m_maximumValue
int | m_minimumValue
MainPage m_rootPage

Detailed Description

Definition at line 24 of file Scenario3_LaunchAppServices.xaml.cs.

Constructor & Destructor Documentation

Scenario3_LaunchAppServices ( ) [inline]

Definition at line 30 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

async Task ConnectToRemoteAppServiceAsync ( ) [inline, private]

Definition at line 77 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            RemoteSystem selectedSystem = SystemListComboBox.SelectedItem as RemoteSystem;
            if (selectedSystem != null)
            {
                // Create a remote system connection request.
                RemoteSystemConnectionRequest connectionRequest = new RemoteSystemConnectionRequest(selectedSystem);

                // Set up a new app service connection. The following app service name and package family name
                // are used in this sample to work with AppServices provider SDK sample on a remote system.
                using (AppServiceConnection connection = new AppServiceConnection
                {
                    AppServiceName = "com.microsoft.randomnumbergenerator",
                    PackageFamilyName = "Microsoft.SDKSamples.AppServicesProvider.CS_8wekyb3d8bbwe"
                })
                {
                    UpdateStatus("Opening connection to remote app service...", NotifyType.StatusMessage);
                    AppServiceConnectionStatus status = await connection.OpenRemoteAsync(connectionRequest);

                    if (status == AppServiceConnectionStatus.Success)
                    {
                        UpdateStatus("Successfully connected to remote app service.", NotifyType.StatusMessage);
                        await SendMessageToRemoteAppServiceAsync(connection);
                    }
                    else
                    {
                        UpdateStatus("Attempt to open a remote app service connection failed with error - " + status.ToString(), NotifyType.ErrorMessage);
                    }
                }
            }
            else
            {
                UpdateStatus("Select a system for remote connection.", NotifyType.ErrorMessage);
            }
        }

async void GenerateRandomNumber_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            // Validate minimum and maximum input values.
            if (ValidateInput())
            {
                // Connect to app service running on the selected system.
                await ConnectToRemoteAppServiceAsync();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            m_rootPage = MainPage.Current;
            m_rootPage.ValidateSystemDiscovery();
        }

async Task SendMessageToRemoteAppServiceAsync ( AppServiceConnection connection ) [inline, private]

Definition at line 113 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            // Send message if connection to the remote app service is open.
            if (connection != null)
            {
                //Set up the inputs and send a message to the service.
                ValueSet inputs = new ValueSet();
                inputs.Add("minvalue", m_minimumValue);
                inputs.Add("maxvalue", m_maximumValue);
                UpdateStatus("Sent message to remote app service. Waiting for a response...", NotifyType.StatusMessage);
                AppServiceResponse response = await connection.SendMessageAsync(inputs);

                if (response.Status == AppServiceResponseStatus.Success)
                {
                    if (response.Message.ContainsKey("result"))
                    {
                        string resultText = response.Message["result"].ToString();
                        if (string.IsNullOrEmpty(resultText))
                        {
                            UpdateStatus("Remote app service did not respond with a result.", NotifyType.ErrorMessage);
                        }
                        else
                        {
                            UpdateStatus("Result = " + resultText, NotifyType.StatusMessage);
                        }
                    }
                    else
                    {
                        UpdateStatus("Response from remote app service does not contain a result.", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    UpdateStatus("Sending message to remote app service failed with error - " + response.Status.ToString(), NotifyType.ErrorMessage);
                }
            }
            else
            {
                UpdateStatus("Not connected to any app service. Select a system to open a connection.", NotifyType.ErrorMessage);
            }
        }

void UpdateStatus | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            m_rootPage.NotifyUser(status, statusType);
        }

bool ValidateInput ( ) [inline, private]

Definition at line 54 of file Scenario3_LaunchAppServices.xaml.cs.

        {
            if (!int.TryParse(MinValue.Text, out m_minimumValue))
            {
                UpdateStatus("The Minimum Value should be a valid integer.", NotifyType.ErrorMessage);
                return false;
            }

            if (!int.TryParse(MaxValue.Text, out m_maximumValue))
            {
                UpdateStatus("The Maximum Value should be a valid integer.", NotifyType.ErrorMessage);
                return false;
            }

            if (m_maximumValue <= m_minimumValue)
            {
                UpdateStatus("Maximum Value must be larger than Minimum Value", NotifyType.ErrorMessage);
                return false;
            }

            return true;
        }

Member Data Documentation

int m_maximumValue [private]

Definition at line 28 of file Scenario3_LaunchAppServices.xaml.cs.

int m_minimumValue [private]

Definition at line 27 of file Scenario3_LaunchAppServices.xaml.cs.

MainPage m_rootPage [private]

Definition at line 26 of file Scenario3_LaunchAppServices.xaml.cs.

ObservableCollection<RemoteSystem> SystemList = > m_rootPage.systemList

Definition at line 42 of file Scenario3_LaunchAppServices.xaml.cs.

The documentation for this class was generated from the following file:
  • RemoteSystems/cs/Scenario3_LaunchAppServices.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Legacy Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Legacy
Public Member Functions | Private Member Functions

Scenario3_Legacy Class Reference

List of all members.

Public Member Functions

Scenario3_Legacy ()

Private Member Functions

void LegacyControl_KeyUp (object sender, KeyRoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario3_Legacy.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Legacy ( ) [inline]

Definition at line 21 of file Scenario3_Legacy.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void LegacyControl_KeyUp | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario3_Legacy.xaml.cs.

        {
            // If the user presses and releases the "B" button when focus is on the legacy
            // control, then remove focus engagement.
            if (e.OriginalKey == Windows.System.VirtualKey.GamepadB)
            {
                e.Handled = true;
                ((Control)sender).RemoveFocusEngagement();
            }
        }

The documentation for this class was generated from the following file:
  • XamlGamepadNavigation/cs/Scenario3_Legacy.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_MasterDetail Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_MasterDetail
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_MasterDetail Class Reference

List of all members.

Public Member Functions

Scenario3_MasterDetail ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddItem (object sender, RoutedEventArgs e)
void | CancelSelection (object sender, RoutedEventArgs e)
void | DeleteItem (object sender, RoutedEventArgs e)
void | DeleteItems (object sender, RoutedEventArgs e)
void | EnableContentTransitions ()
void | OnCurrentStateChanged (object sender, VisualStateChangedEventArgs e)
void | OnItemClick (object sender, ItemClickEventArgs e)
void | OnLoaded (object sender, RoutedEventArgs e)
void | OnSelectionChanged (object sender, SelectionChangedEventArgs e)
void | SelectItems (object sender, RoutedEventArgs e)
void | SelectSomethingIfPossible ()

Private Attributes

ObservableCollection< Contact > | Contacts

Detailed Description

Definition at line 24 of file Scenario3_MasterDetail.xaml.cs.

Constructor & Destructor Documentation

Scenario3_MasterDetail ( ) [inline]

Definition at line 28 of file Scenario3_MasterDetail.xaml.cs.

        {
            InitializeComponent();

            // Generate the list of contacts.
            // Remember to enable the NavigationCacheMode of this Page to avoid
            // loading the data every time user navigates back and forward.
            Contacts = Contact.GetContacts(140);
            if (Contacts.Count > 0)
            {
                MasterListView.ItemsSource = Contacts;
            }
        }

Member Function Documentation

void AddItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 146 of file Scenario3_MasterDetail.xaml.cs.

        {
            Contacts.Add(Contact.GetNewContact());

            // Select this item if the list had been empty.
            if (MasterListView.SelectedIndex == -1)
            {
                MasterListView.SelectedIndex = 0;
                // Details view might be collapsed if there were no items.
                // Show it now.
                DetailContentPresenter.Visibility = Visibility.Visible;
            }
        }

void CancelSelection | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 197 of file Scenario3_MasterDetail.xaml.cs.

        {
            if (PageSizeStatesGroup.CurrentState == NarrowState)
            {
                VisualStateManager.GoToState(this, MasterState.Name, true);
            }
            else
            {
                VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
            }
        }

void DeleteItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario3_MasterDetail.xaml.cs.

        {
            int index = MasterListView.SelectedIndex;
            if (index != -1)
            {
                Contacts.RemoveAt(index);
            }
            MasterListView.SelectedIndex = Math.Min(index, Contacts.Count - 1);
        }

void DeleteItems | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 181 of file Scenario3_MasterDetail.xaml.cs.

        {
            int index;
            while ((index = MasterListView.SelectedIndex) != -1)
            {
                Contacts.RemoveAt(index);
            }
        }

void EnableContentTransitions ( ) [inline, private]

Definition at line 140 of file Scenario3_MasterDetail.xaml.cs.

        {
            DetailContentPresenter.ContentTransitions.Clear();
            DetailContentPresenter.ContentTransitions.Add(new EntranceThemeTransition());
        }

void OnCurrentStateChanged | ( | object | sender,
 |  | VisualStateChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario3_MasterDetail.xaml.cs.

        {
            bool isNarrow = e.NewState == NarrowState;
            if (isNarrow)
            {
                Frame.Navigate(typeof(DetailsPage), MasterListView.SelectedItem, new SuppressNavigationTransitionInfo());
            }
            else
            {
                VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
                MasterListView.SelectionMode = ListViewSelectionMode.Extended;
            }

            EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow);
            if (DetailContentPresenter != null)
            {
                EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow);
            }
        }

void OnItemClick | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file Scenario3_MasterDetail.xaml.cs.

        {
            // The clicked item it is the new selected contact
            var selectedContact = (Contact)e.ClickedItem;
            MasterListView.SelectedItem = selectedContact;
            if (PageSizeStatesGroup.CurrentState == NarrowState)
            {
                // Go to the details page and display the item
                Frame.Navigate(typeof(DetailsPage), selectedContact, new DrillInNavigationTransitionInfo());
            }
        }

void OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file Scenario3_MasterDetail.xaml.cs.

        {
            if (MasterListView.SelectedItem == null && Contacts.Count > 0)
            {
                MasterListView.SelectedIndex = 0;
            }
            // If the app starts in narrow mode - showing only the Master listView -
            // it is necessary to set the commands and the selection mode.
            if (PageSizeStatesGroup.CurrentState == NarrowState)
            {
                VisualStateManager.GoToState(this, MasterState.Name, true);
            }
            else if (PageSizeStatesGroup.CurrentState == WideState)
            {
                // In this case, the app starts is wide mode, Master/Details view.
                // Preserve selection across the state change.
                var item = MasterListView.SelectedItem;
                VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
                MasterListView.SelectedItem = item;
            }
            else
            {
                throw new InvalidOperationException();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario3_MasterDetail.xaml.cs.

        {
            // Details view can request an action on return.
            // S<id> = select this contact
            // D<id> = delete this contact
            var param = e.Parameter as string;
            if (param != null)
            {
                string id = param.Substring(1);
                Contact contact = Contacts.FirstOrDefault(c => c.Id == id);
                if (contact != null)
                {
                    MasterListView.SelectedItem = contact;
                    if (param[0] == 'D')
                    {
                        DeleteItem(null, null);
                    }
                }
            }
        }

void OnSelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file Scenario3_MasterDetail.xaml.cs.

        {
            if (PageSizeStatesGroup.CurrentState == WideState)
            {
                if (MasterListView.SelectedItems.Count == 1)
                {
                    EnableContentTransitions();
                }
                // Entering in Extended selection
                else if (MasterListView.SelectedItems.Count > 1
                     && MasterDetailsStatesGroup.CurrentState == MasterDetailsState)
                {
                    VisualStateManager.GoToState(this, ExtendedSelectionState.Name, true);
                }
            }
            // Exiting Extended selection
            if (MasterDetailsStatesGroup.CurrentState == ExtendedSelectionState &&
                MasterListView.SelectedItems.Count == 1)
            {
                VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
            }
        }

void SelectItems | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 190 of file Scenario3_MasterDetail.xaml.cs.

        {
            if (MasterListView.Items.Count > 0)
            {
                VisualStateManager.GoToState(this, MultipleSelectionState.Name, true);
            }
        }

void SelectSomethingIfPossible ( ) [inline, private]

Definition at line 159 of file Scenario3_MasterDetail.xaml.cs.

        {
            if (Contacts.Count > 0)
            {
                MasterListView.SelectedIndex = 0;
            }
            else
            {
                // Collapse the Details view if there are no items.
                DetailContentPresenter.Visibility = Visibility.Collapsed;
            }
        }

Member Data Documentation

ObservableCollection<Contact> Contacts [private]

Definition at line 26 of file Scenario3_MasterDetail.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario3_MasterDetail.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_MultipleClaims Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_MultipleClaims
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_MultipleClaims Class Reference

List of all members.

Public Member Functions

Scenario3_MultipleClaims ()

Private Member Functions

async void ClaimSamePrinter_Click ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario3_MultipleClaims.xaml.cs.

Constructor & Destructor Documentation

Scenario3_MultipleClaims ( ) [inline]

Definition at line 22 of file Scenario3_MultipleClaims.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClaimSamePrinter_Click ( ) [inline, private]

Definition at line 27 of file Scenario3_MultipleClaims.xaml.cs.

        {
            ClaimResultText.Text = "";
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            if (rootPage.Printer == null)
            {
                rootPage.NotifyUser("Use scenario 1 to find a printer first.", NotifyType.ErrorMessage);
                return;
            }

            using (var printer = await PosPrinter.FromIdAsync(rootPage.Printer.DeviceId))
            {
                if (printer == null)
                {
                    rootPage.NotifyUser("Cannot create same printer as scenario 1.", NotifyType.ErrorMessage);
                }

                using (var claimedPrinter = await printer.ClaimPrinterAsync())
                {
                    if (claimedPrinter != null)
                    {
                        ClaimResultText.Text = "Claimed the printer.";

                        // This scenario doesn't do anything with the printer aside from claim it.
                        // The "using" statement will dispose the claimed printer.
                    }
                    else
                    {
                        ClaimResultText.Text = "Did not claim the printer.";
                    }
                }
                // The "using" statement will dispose the duplicate printer.
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario3_MultipleClaims.xaml.cs.

The documentation for this class was generated from the following files:
  • PosPrinter/cs/Scenario3_MultipleClaims.xaml.cs
  • PosPrinter/cpp/Scenario3_MultipleClaims.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_MultipleDrawers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_MultipleDrawers
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario3_MultipleDrawers Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_MultipleDrawers ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | CashDrawerInstance { Instance1, Instance2 }

Private Member Functions

async void | ClaimButton1_Click (object sender, RoutedEventArgs e)
async void | ClaimButton2_Click (object sender, RoutedEventArgs e)
async Task< bool > | ClaimCashDrawer (CashDrawerInstance instance)
async void | claimedCashDrawerInstance1_ReleaseDeviceRequested (ClaimedCashDrawer sender, object e)
async void | claimedCashDrawerInstance2_ReleaseDeviceRequested (ClaimedCashDrawer drawer, object e)
async Task< bool > | CreateDefaultCashDrawerObject (CashDrawerInstance instance)
void | ReleaseButton1_Click (object sender, RoutedEventArgs e)
void | ReleaseButton2_Click (object sender, RoutedEventArgs e)
void | ResetScenarioState ()
void | SetClaimedUI (CashDrawerInstance instance)
void | SetReleasedUI (CashDrawerInstance instance)

Private Attributes

CashDrawer | cashDrawerInstance1 = null
CashDrawer | cashDrawerInstance2 = null
ClaimedCashDrawer | claimedCashDrawerInstance1 = null
ClaimedCashDrawer | claimedCashDrawerInstance2 = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario3_MultipleDrawers.xaml.cs.

Member Enumeration Documentation

enum CashDrawerInstance [private]

Enumerator for current active Instance.

Enumerator:
Instance1
Instance2

Definition at line 47 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            Instance1,
            Instance2
        }

Constructor & Destructor Documentation

Scenario3_MultipleDrawers ( ) [inline]

Definition at line 39 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ClaimButton1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event callback for claim instance 1 button.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 157 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            if (await CreateDefaultCashDrawerObject(CashDrawerInstance.Instance1))
            {
                if (await ClaimCashDrawer(CashDrawerInstance.Instance1))
                {
                    claimedCashDrawerInstance1.ReleaseDeviceRequested += claimedCashDrawerInstance1_ReleaseDeviceRequested;
                    SetClaimedUI(CashDrawerInstance.Instance1);
                }
                else
                {
                    cashDrawerInstance2 = null;
                }
            }
        }

async void ClaimButton2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event callback for claim instance 2 button.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 178 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            if (await CreateDefaultCashDrawerObject(CashDrawerInstance.Instance2))
            {
                if (await ClaimCashDrawer(CashDrawerInstance.Instance2))
                {
                    claimedCashDrawerInstance2.ReleaseDeviceRequested += claimedCashDrawerInstance2_ReleaseDeviceRequested;
                    SetClaimedUI(CashDrawerInstance.Instance2);
                }
                else
                {
                    cashDrawerInstance2 = null;
                }
            }
        }

task< bool > ClaimCashDrawer ( CashDrawerInstance instance ) [inline, private]

Attempt to claim the connected cash drawer.

Parameters:
instance Specifies the cash drawer instance that should be used.
Returns:
True if the cash drawer was successfully claimed, false otherwise.

Definition at line 111 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            bool claimAsyncStatus = false;

            switch (instance)
            {
                case CashDrawerInstance.Instance1:

                    claimedCashDrawerInstance1 = await cashDrawerInstance1.ClaimDrawerAsync();
                    if (claimedCashDrawerInstance1 != null)
                    {
                        rootPage.NotifyUser("Successfully claimed instance 1.", NotifyType.StatusMessage);
                        claimAsyncStatus = true;
                    }
                    else
                    {
                        rootPage.NotifyUser("Failed to claim instance 1.", NotifyType.ErrorMessage);
                    }
                    break;

                case CashDrawerInstance.Instance2:

                    claimedCashDrawerInstance2 = await cashDrawerInstance2.ClaimDrawerAsync();
                    if (claimedCashDrawerInstance2 != null)
                    {
                        rootPage.NotifyUser("Successfully claimed instance 2.", NotifyType.StatusMessage);
                        claimAsyncStatus = true;
                    }
                    else
                    {
                        rootPage.NotifyUser("Failed to claim instance 2.", NotifyType.ErrorMessage);
                    }
                    break;

                default:
                    break;
            }

            return claimAsyncStatus;
        }

async void claimedCashDrawerInstance1_ReleaseDeviceRequested | ( | ClaimedCashDrawer | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Event callback for a release device request for instance 1.

Parameters:
sender | The drawer receiving the release device request.
e | Unused for ReleaseDeviceRequested events.

Definition at line 247 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                rootPage.NotifyUser("Release instance 1 requested.", NotifyType.StatusMessage);

                if (RetainCheckBox1.IsChecked == true)
                {
                    if (await claimedCashDrawerInstance1.RetainDeviceAsync() == false)
                        rootPage.NotifyUser("Cash drawer instance 1 retain failed.", NotifyType.ErrorMessage);
                }
                else
                {
                    claimedCashDrawerInstance1.Dispose();
                    claimedCashDrawerInstance1 = null;

                    if (cashDrawerInstance1 != null)
                    {
                        cashDrawerInstance1.Dispose();
                        cashDrawerInstance1 = null;
                    }

                    SetReleasedUI(CashDrawerInstance.Instance1);
                }
            });
        }

async void claimedCashDrawerInstance2_ReleaseDeviceRequested | ( | ClaimedCashDrawer | drawer,
 |  | object | e |
 | ) |  |  | [inline, private]

Event callback for a release device request for instance 2.

Parameters:
sender | The drawer receiving the release device request.
e | Unused for ReleaseDeviceRequested events.

Definition at line 279 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                rootPage.NotifyUser("Release instance 2 requested.", NotifyType.StatusMessage);

                if (RetainCheckBox2.IsChecked == true)
                {
                    if (await claimedCashDrawerInstance2.RetainDeviceAsync() == false)
                        rootPage.NotifyUser("Cash drawer instance 2 retain failed.", NotifyType.ErrorMessage);
                }
                else
                {
                    claimedCashDrawerInstance2.Dispose();
                    claimedCashDrawerInstance2 = null;

                    if (cashDrawerInstance2 != null)
                    {
                        cashDrawerInstance2.Dispose();
                        cashDrawerInstance2 = null;
                    }

                    SetReleasedUI(CashDrawerInstance.Instance2);
                }
            });
        }

task< bool > CreateDefaultCashDrawerObject ( CashDrawerInstance instance ) [inline, private]

Creates the default cash drawer.

Parameters:
instance Specifies the cash drawer instance that should be used.
Returns:
True if the cash drawer was created, false otherwise.

Definition at line 78 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage);

            CashDrawer tempDrawer = null;
            tempDrawer = await DeviceHelpers.GetFirstCashDrawerAsync();

            if (tempDrawer == null)
            {
                rootPage.NotifyUser("Cash drawer not found. Please connect a cash drawer.", NotifyType.ErrorMessage);
                return false;
            }

            switch (instance)
            {
                case CashDrawerInstance.Instance1:
                    cashDrawerInstance1 = tempDrawer;
                    break;
                case CashDrawerInstance.Instance2:
                    cashDrawerInstance2 = tempDrawer;
                    break;
                default:
                    return false;
            }

            return true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked before the page is unloaded and is no longer the current source of a Frame.

Parameters:
e Event data describing the navigation that was requested.

Definition at line 67 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached.

Definition at line 57 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            ResetScenarioState();
            base.OnNavigatedTo(e);
        }

void ReleaseButton1_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event callback for release instance 1 button.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 199 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            if (claimedCashDrawerInstance1 != null)
            {
                claimedCashDrawerInstance1.Dispose();
                claimedCashDrawerInstance1 = null;

                SetReleasedUI(CashDrawerInstance.Instance1);

                rootPage.NotifyUser("Claimed instance 1 was released.", NotifyType.StatusMessage);
            }

            if (cashDrawerInstance1 != null)
            {
                cashDrawerInstance1.Dispose();
                cashDrawerInstance1 = null;
            }
        }

void ReleaseButton2_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event callback for release instance 2 button.

Parameters:
sender | Button that was clicked.
e | Event data associated with click event.

Definition at line 223 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            if (claimedCashDrawerInstance2 != null)
            {
                claimedCashDrawerInstance2.Dispose();
                claimedCashDrawerInstance2 = null;

                SetReleasedUI(CashDrawerInstance.Instance2);

                rootPage.NotifyUser("Claimed instance 2 was released.", NotifyType.StatusMessage);
            }

            if (cashDrawerInstance2 != null)
            {
                cashDrawerInstance2.Dispose();
                cashDrawerInstance2 = null;
            }
        }

void ResetScenarioState ( ) [inline, private]

Resets the display elements to original state.

Reset the scenario to its initial state.

Definition at line 309 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            if (claimedCashDrawerInstance1 != null)
            {
                claimedCashDrawerInstance1.Dispose();
                claimedCashDrawerInstance1 = null;
            }

            if (claimedCashDrawerInstance2 != null)
            {
                claimedCashDrawerInstance2.Dispose();
                claimedCashDrawerInstance2 = null;
            }

            if (cashDrawerInstance1 != null)
            {
                cashDrawerInstance1.Dispose();
                cashDrawerInstance1 = null;
            }

            if (cashDrawerInstance2 != null)
            {
                cashDrawerInstance2.Dispose();
                cashDrawerInstance2 = null;
            }

            ClaimButton1.IsEnabled = true;
            ClaimButton2.IsEnabled = true;
            ReleaseButton1.IsEnabled = false;
            ReleaseButton2.IsEnabled = false;
            RetainCheckBox1.IsChecked = true;
            RetainCheckBox2.IsChecked = true;

            rootPage.NotifyUser("Click a claim button to begin.", NotifyType.StatusMessage);
        }

void SetClaimedUI ( CashDrawerInstance instance ) [inline, private]

Sets the UI elements to a state corresponding to the specified instace being claimed.

Parameters:
instance Corresponds to instance that has been claimed.

Definition at line 349 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            switch (instance)
            {
                case CashDrawerInstance.Instance1:
                    ClaimButton1.IsEnabled = false;
                    ClaimButton2.IsEnabled = true;
                    ReleaseButton1.IsEnabled = true;
                    ReleaseButton2.IsEnabled = false;
                    break;

                case CashDrawerInstance.Instance2:
                    ClaimButton1.IsEnabled = true;
                    ClaimButton2.IsEnabled = false;
                    ReleaseButton1.IsEnabled = false;
                    ReleaseButton2.IsEnabled = true;
                    break;

                default:
                    break;
            }
        }

void SetReleasedUI ( CashDrawerInstance instance ) [inline, private]

Sets the UI elements to a state corresponding to the specified instace being released.

Parameters:
instance Corresponds to instance that has been released.

Definition at line 376 of file Scenario3_MultipleDrawers.xaml.cs.

        {
            switch (instance)
            {
                case CashDrawerInstance.Instance1:
                    ClaimButton1.IsEnabled = true;
                    ReleaseButton1.IsEnabled = false;
                    break;

                case CashDrawerInstance.Instance2:
                    ClaimButton2.IsEnabled = true;
                    ReleaseButton2.IsEnabled = false;
                    break;

                default:
                    break;
            }
        }

Member Data Documentation

CashDrawer cashDrawerInstance1 = null [private]

Definition at line 33 of file Scenario3_MultipleDrawers.xaml.cs.

CashDrawer cashDrawerInstance2 = null [private]

Definition at line 34 of file Scenario3_MultipleDrawers.xaml.cs.

ClaimedCashDrawer claimedCashDrawerInstance1 = null [private]

Definition at line 35 of file Scenario3_MultipleDrawers.xaml.cs.

ClaimedCashDrawer claimedCashDrawerInstance2 = null [private]

Definition at line 36 of file Scenario3_MultipleDrawers.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario3_MultipleDrawers.xaml.cs.

The documentation for this class was generated from the following files:
  • CashDrawer/cs/Scenario3_MultipleDrawers.xaml.cs
  • CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_NetworkConnectivityChanges Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_NetworkConnectivityChanges
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_NetworkConnectivityChanges Class Reference

List of all members.

Public Member Functions

Scenario3_NetworkConnectivityChanges ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnNetworkStatusChanged (object sender)
void | RegisterNetworkStatusChanged ()
void | RegisterUnregisterButton_Click (object sender, RoutedEventArgs e)
void | UnregisterNetworkStatusChanged ()
void | UpdateButtonStates ()
async void | UpdateNetworkStatus ()

Private Attributes

bool | m_isNetworkStatusChangeCallbackRegistered = false
bool | m_isNetworkStatusUpdatePending = false
bool | m_isUpdatingNetworkStatus = false

Detailed Description

Definition at line 21 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

Constructor & Destructor Documentation

Scenario3_NetworkConnectivityChanges ( ) [inline]

Definition at line 27 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            if (m_isNetworkStatusChangeCallbackRegistered)
            {
                UnregisterNetworkStatusChanged();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            UpdateButtonStates();
        }

async void OnNetworkStatusChanged ( object sender ) [inline, private]

Definition at line 84 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                UpdateNetworkStatus();
            });
        }

void RegisterNetworkStatusChanged ( ) [inline, private]

Definition at line 92 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            NetworkInformation.NetworkStatusChanged += OnNetworkStatusChanged;
            m_isNetworkStatusChangeCallbackRegistered = true;
            UpdateNetworkStatus();
        }

void RegisterUnregisterButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            if (m_isNetworkStatusChangeCallbackRegistered)
            {
                UnregisterNetworkStatusChanged();
            }
            else
            {
                RegisterNetworkStatusChanged();
            }
            UpdateButtonStates();
        }

void UnregisterNetworkStatusChanged ( ) [inline, private]

Definition at line 99 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            NetworkInformation.NetworkStatusChanged -= OnNetworkStatusChanged;
            m_isNetworkStatusChangeCallbackRegistered = false;
        }

void UpdateButtonStates ( ) [inline, private]

Update the UI based on whether we are registered for the event.

Definition at line 121 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            VisualStateManager.GoToState(this, m_isNetworkStatusChangeCallbackRegistered ? "Registered" : "Unregistered", false);
        }

async void UpdateNetworkStatus ( ) [inline, private]

Definition at line 45 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

        {
            // This code runs on the UI thread, so there are no race conditions on these
            // member variables.
            if (m_isUpdatingNetworkStatus)
            {
                // Update is already in progress. Let it finish before we re-evaluate.
                m_isNetworkStatusUpdatePending = true;
                return;
            }

            m_isUpdatingNetworkStatus = true;

            do
            {
                m_isNetworkStatusUpdatePending = false;
                ResultsText.Text = string.Empty;
                ConnectionProfile internetConnectionProfile = NetworkInformation.GetInternetConnectionProfile();
                NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel.None;
                if (internetConnectionProfile != null)
                {
                    connectivityLevel = internetConnectionProfile.GetNetworkConnectivityLevel();
                }

                Helpers.AppendLine(ResultsText, $"Current connectivity is {connectivityLevel}.");
                if (Helpers.ShouldAttemptToConnectToInternet(connectivityLevel))
                {
                    Helpers.AppendLine(ResultsText, "Checking network cost before connecting to the Internet.");
                    await Helpers.EvaluateCostAndConnectAsync(internetConnectionProfile.GetConnectionCost(), OptedInToNetworkUsageToggle.IsOn, ResultsText);
                }
                else
                {
                    Helpers.AppendLine(ResultsText, "Not attempting to connect to the Internet.");
                }
            }
            while (m_isNetworkStatusUpdatePending);
            m_isUpdatingNetworkStatus = false;
        }

Member Data Documentation

bool m_isNetworkStatusChangeCallbackRegistered = false [private]

Definition at line 23 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

bool m_isNetworkStatusUpdatePending = false [private]

Definition at line 25 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

bool m_isUpdatingNetworkStatus = false [private]

Definition at line 24 of file Scenario3_NetworkConnectivityChanges.xaml.cs.

The documentation for this class was generated from the following file:
  • NetworkConnectivity/cs/Scenario3_NetworkConnectivityChanges.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Notifications Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Notifications
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

Scenario3_Notifications Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario3_Notifications ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | ScenarioType { Toast, Tile }

Private Member Functions

async Task | CancelActiveDownloadsAsync ()
async Task< DownloadOperation > | CreateDownload (BackgroundDownloader downloader, int delaySeconds, string fileName)
async Task | DownloadAsync (DownloadOperation download)
bool | IsExceptionHandled (string title, Exception ex, DownloadOperation download=null)
void | Log (string message)
void | LogStatus (string message, NotifyType type)
async Task | RunDownloadsAsync (BackgroundDownloader downloader, ScenarioType type)
async void | TileNotificationButton_Click (object sender, RoutedEventArgs e)
async void | ToastNotificationButton_Click (object sender, RoutedEventArgs e)

Private Attributes

Uri | baseUri
BackgroundTransferGroup | notificationsGroup
MainPage rootPage = MainPage.Current

Static Private Attributes

static int | runId = 0

Detailed Description

Definition at line 31 of file Scenario3_Notifications.xaml.cs.

Member Enumeration Documentation

enum ScenarioType [private]
Enumerator:
Toast
Tile

Definition at line 43 of file Scenario3_Notifications.xaml.cs.

        {
            Toast,
            Tile
        }

Constructor & Destructor Documentation

Scenario3_Notifications ( ) [inline]

Definition at line 49 of file Scenario3_Notifications.xaml.cs.

        {
            // Use a unique group name so that no other component in the app uses the same group. The recommended way
            // is to generate a GUID and use it as group name as shown below.
            notificationsGroup = BackgroundTransferGroup.CreateGroup("{296628BF-5AE6-48CE-AA36-86A85A726B6A}");

            // When creating a group, we can optionally define the transfer behavior of transfers associated with the
            // group. A "parallel" transfer behavior allows multiple transfers in the same group to run concurrently
            // (default). A "serialized" transfer behavior allows at most one default priority transfer at a time for
            // the group.
            notificationsGroup.TransferBehavior = BackgroundTransferBehavior.Parallel;

            this.InitializeComponent();
        }

Member Function Documentation

async Task CancelActiveDownloadsAsync ( ) [inline, private]

Definition at line 80 of file Scenario3_Notifications.xaml.cs.

        {
            IReadOnlyList<DownloadOperation> downloads = null;
            try
            {
                // Note that we only enumerate transfers that belong to the transfer group used by this sample
                // scenario. We'll not enumerate transfers started by other sample scenarios in this app.
                downloads = await BackgroundDownloader.GetCurrentDownloadsForTransferGroupAsync(notificationsGroup);
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Discovery error", ex))
                {
                    throw;
                }
                return;
            }

            // If previous instances of this scenario started transfers that haven't completed yet, cancel them now
            // so that we can start this scenario cleanly.
            if (downloads.Count > 0)
            {
                CancellationTokenSource canceledToken = new CancellationTokenSource();
                canceledToken.Cancel();

                Task[] tasks = new Task[downloads.Count];
                for (int i = 0; i < downloads.Count; i++)
                {
                    tasks[i] = downloads[i].AttachAsync().AsTask(canceledToken.Token);
                }

                try
                {
                    await Task.WhenAll(tasks);
                }
                catch (TaskCanceledException)
                {
                }

                Log(String.Format(CultureInfo.CurrentCulture,
                    "Canceled {0} downloads from previous instances of this scenario.", downloads.Count));
            }

            // After cleaning up downloads from previous scenarios, enable buttons to allow the user to run the sample.
            ToastNotificationButton.IsEnabled = true;
            TileNotificationButton.IsEnabled = true;
        }

async Task<DownloadOperation> CreateDownload | ( | BackgroundDownloader | downloader,
 |  | int | delaySeconds,
 |  | string | fileName |
 | ) |  |  | [inline, private]

Definition at line 235 of file Scenario3_Notifications.xaml.cs.

        {
            Uri source = new Uri(baseUri, String.Format(CultureInfo.InvariantCulture, "?delay={0}", delaySeconds));

            StorageFile destinationFile;
            try
            {
                StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
                destinationFile = await picturesLibrary.CreateFileAsync(
                    fileName, CreationCollisionOption.GenerateUniqueName);
            }
            catch (FileNotFoundException ex)
            {
                rootPage.NotifyUser("Error while creating file: " + ex.Message, NotifyType.ErrorMessage);
                throw;
            }

            return downloader.CreateDownload(source, destinationFile);
        }

async Task DownloadAsync ( DownloadOperation download ) [inline, private]

Definition at line 256 of file Scenario3_Notifications.xaml.cs.

        {
            Log(String.Format(CultureInfo.CurrentCulture, "Downloading {0}", download.ResultFile.Name));

            try
            {
                await download.StartAsync();

                LogStatus(String.Format(CultureInfo.CurrentCulture, "Downloading {0} completed.", download.ResultFile.Name), NotifyType.StatusMessage);
            }
            catch (TaskCanceledException)
            {
            }
            catch (Exception ex)
            {
                if (!IsExceptionHandled("Execution error", ex, download))
                {
                    throw;
                }
            }
        }

bool IsExceptionHandled | ( | string | title,
 |  | Exception | ex,
 |  | DownloadOperation | download = null |
 | ) |  |  | [inline, private]

Definition at line 278 of file Scenario3_Notifications.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            if (error == WebErrorStatus.Unknown)
            {
                return false;
            }

            if (download == null)
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0}: {1}", title, error),
                    NotifyType.ErrorMessage);
            }
            else
            {
                LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0} - {1}: {2}", download.ResultFile.Name,
                    title, error), NotifyType.ErrorMessage);
            }

            return true;
        }

void Log ( string message ) [inline, private]

Definition at line 300 of file Scenario3_Notifications.xaml.cs.

        {
            outputField.Text += message + "\r\n";
        }

void LogStatus | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 305 of file Scenario3_Notifications.xaml.cs.

        {
            rootPage.NotifyUser(message, type);
            Log(message);
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 69 of file Scenario3_Notifications.xaml.cs.

        {
            // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
            // Typically this can be done in the App class by overriding OnLaunched() and checking for
            // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
            // We do it here in the sample to keep the sample code consolidated.
            // Note that for this specific scenario we're not interested in downloads from previous instances:
            // We'll just enumerate downloads from previous instances and cancel them immediately.
            await CancelActiveDownloadsAsync();
        }

async Task RunDownloadsAsync | ( | BackgroundDownloader | downloader,
 |  | ScenarioType | type |
 | ) |  |  | [inline, private]

Definition at line 186 of file Scenario3_Notifications.xaml.cs.

        {
            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Private Networks (Client and Server)" capability.
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out baseUri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            // Use a unique ID for every button click, to help the user associate downloads of the same run
            // in the logs.
            runId++;

            DownloadOperation[] downloads = new DownloadOperation[3];

            try
            {
                // First we create three download operations: Note that we don't start downloads immediately. It is
                // important to first create all operations that should participate in the toast/tile update. Once all
                // operations have been created, we can start them.
                // If we start a download and create a second one afterwards, there is a race where the first download
                // may complete before we were able to create the second one. This would result in the toast/tile being
                // shown before we even create the second download.
                downloads[0] = await CreateDownload(downloader, 1, String.Format(CultureInfo.InvariantCulture,
                    "{0}.{1}.FastDownload.txt", type, runId));
                downloads[1] = await CreateDownload(downloader, 5, String.Format(CultureInfo.InvariantCulture,
                    "{0}.{1}.MediumDownload.txt", type, runId));
                downloads[2] = await CreateDownload(downloader, 10, String.Format(CultureInfo.InvariantCulture,
                    "{0}.{1}.SlowDownload.txt", type, runId));
            }
            catch (FileNotFoundException)
            {
                // We were unable to create the destination file.
                return;
            }

            // Once all downloads participating in the toast/tile update have been created, start them.
            Task[] downloadTasks = new Task[downloads.Length];
            for (int i = 0; i < downloads.Length; i++)
            {
                downloadTasks[i] = DownloadAsync(downloads[i]);
            }

            await Task.WhenAll(downloadTasks);
        }

async void TileNotificationButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario3_Notifications.xaml.cs.

        {
            // Create a downloader and associate all its downloads with the transfer group used for this scenario.
            BackgroundDownloader downloader = new BackgroundDownloader();
            downloader.TransferGroup = notificationsGroup;

            // Create a TileNotification that should be shown when all transfers succeed.
            XmlDocument successTileXml = TileUpdateManager.GetTemplateContent(
                TileTemplateType.TileSquare150x150Text03);
            XmlNodeList successTextNodes = successTileXml.GetElementsByTagName("text");
            successTextNodes.Item(0).InnerText = "All three";
            successTextNodes.Item(1).InnerText = "downloads";
            successTextNodes.Item(2).InnerText = "completed";
            successTextNodes.Item(3).InnerText = "successfully.";
            TileNotification successTile = new TileNotification(successTileXml);
            successTile.ExpirationTime = DateTime.Now.AddMinutes(10);
            downloader.SuccessTileNotification = successTile;

            // Create a TileNotification that should be shown if at least one transfer fails.
            XmlDocument failureTileXml = TileUpdateManager.GetTemplateContent(
                TileTemplateType.TileSquare150x150Text03);
            XmlNodeList failureTextNodes = failureTileXml.GetElementsByTagName("text");
            failureTextNodes.Item(0).InnerText = "At least";
            failureTextNodes.Item(1).InnerText = "one download";
            failureTextNodes.Item(2).InnerText = "completed";
            failureTextNodes.Item(3).InnerText = "with failure.";
            TileNotification failureTile = new TileNotification(failureTileXml);
            failureTile.ExpirationTime = DateTime.Now.AddMinutes(10);
            downloader.FailureTileNotification = failureTile;

            // Now create and start downloads for the configured BackgroundDownloader object.
            await RunDownloadsAsync(downloader, ScenarioType.Tile);
        }

async void ToastNotificationButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 128 of file Scenario3_Notifications.xaml.cs.

        {
            // Create a downloader and associate all its downloads with the transfer group used for this scenario.
            BackgroundDownloader downloader = new BackgroundDownloader();
            downloader.TransferGroup = notificationsGroup;

            // Create a ToastNotification that should be shown when all transfers succeed.
            XmlDocument successToastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
            successToastXml.GetElementsByTagName("text").Item(0).InnerText =
                "All three downloads completed successfully.";
            ToastNotification successToast = new ToastNotification(successToastXml);
            downloader.SuccessToastNotification = successToast;

            // Create a ToastNotification that should be shown if at least one transfer fails.
            XmlDocument failureToastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
            failureToastXml.GetElementsByTagName("text").Item(0).InnerText =
                "At least one download completed with failure.";
            ToastNotification failureToast = new ToastNotification(failureToastXml);
            downloader.FailureToastNotification = failureToast;

            // Now create and start downloads for the configured BackgroundDownloader object.
            await RunDownloadsAsync(downloader, ScenarioType.Toast);
        }

Member Data Documentation

Uri baseUri [private]

Definition at line 39 of file Scenario3_Notifications.xaml.cs.

BackgroundTransferGroup notificationsGroup [private]

Definition at line 37 of file Scenario3_Notifications.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 35 of file Scenario3_Notifications.xaml.cs.

UINT32 runId = 0 [static, private]

Definition at line 41 of file Scenario3_Notifications.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario3_Notifications.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ParameterizedTemplate Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ParameterizedTemplate
Public Member Functions | Private Member Functions

Scenario3_ParameterizedTemplate Class Reference

List of all members.

Public Member Functions

Scenario3_ParameterizedTemplate ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 24 of file Scenario3_ParameterizedTemplate.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ParameterizedTemplate ( ) [inline]

Definition at line 26 of file Scenario3_ParameterizedTemplate.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 34 of file Scenario3_ParameterizedTemplate.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
            // to format a date/time by specifying a template via parameters.  Note that the user's language
            // and region preferences will determine the pattern of the date returned based on the
            // specified parts.

            // We keep results in this variable
            StringBuilder results = new StringBuilder();
            results.AppendLine("Current application context language: " + ApplicationLanguages.Languages[0]);
            results.AppendLine();

            // Create formatters with individual format specifiers for date/time elements.
            DateTimeFormatter[] dateFormatters = new[]
            {
                // Example formatters for dates.
                new DateTimeFormatter(
                    YearFormat.Full,
                    MonthFormat.Abbreviated,
                    DayFormat.Default,
                    DayOfWeekFormat.Abbreviated),
                new DateTimeFormatter(
                    YearFormat.Abbreviated,
                    MonthFormat.Abbreviated,
                    DayFormat.Default,
                    DayOfWeekFormat.None),
                new DateTimeFormatter(
                    YearFormat.Full,
                    MonthFormat.Full,
                    DayFormat.None,
                    DayOfWeekFormat.None),
                new DateTimeFormatter(
                    YearFormat.None,
                    MonthFormat.Full,
                    DayFormat.Default,
                    DayOfWeekFormat.None)
            };

            // Create formatters with individual format specifiers for time elements.
            DateTimeFormatter[] timeFormatters = new[]
            {
                // Example formatters for times.
                new DateTimeFormatter(
                    HourFormat.Default,
                    MinuteFormat.Default,
                    SecondFormat.Default),
                new DateTimeFormatter(
                    HourFormat.Default,
                    MinuteFormat.Default,
                    SecondFormat.None),
                new DateTimeFormatter(
                    HourFormat.Default,
                    MinuteFormat.None,
                    SecondFormat.None),
             };

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            results.AppendLine("Dates:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in dateFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            results.AppendLine();
            results.AppendLine("Times:");

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in timeFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            }

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario3_ParameterizedTemplate.xaml.cs
  • DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Polling
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Polling Class Reference

List of all members.

Public Member Functions

Scenario3_Polling ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayCurrentReading (object sender, object args)
void | ScenarioDisable ()
void | ScenarioEnable ()
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

Accelerometer | _accelerometer
uint _desiredReportInterval
DispatcherTimer | _dispatcherTimer
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario3_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Polling ( ) [inline]

Definition at line 31 of file Scenario3_Polling.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DisplayCurrentReading | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

This is the dispatcher callback.

Parameters:
sender
args

Definition at line 97 of file Scenario3_Polling.xaml.cs.

        {
            AccelerometerReading reading = _accelerometer.GetCurrentReading();
            if (reading != null)
            {
                MainPage.SetReadingText(ScenarioOutput, reading);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario3_Polling.xaml.cs.

        {
            _accelerometer = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
            if (_accelerometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                _desiredReportInterval = Math.Max(_accelerometer.MinimumReportInterval, 16);

                // Set up a DispatchTimer
                _dispatcherTimer = new DispatcherTimer();
                _dispatcherTimer.Tick += DisplayCurrentReading;
                _dispatcherTimer.Interval = TimeSpan.FromMilliseconds(_desiredReportInterval);

                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario3_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 124 of file Scenario3_Polling.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;

            // Stop the dispatcher
            _dispatcherTimer.Stop();

            // Restore the default report interval to release resources while the sensor is not in use
            _accelerometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 109 of file Scenario3_Polling.xaml.cs.

        {
            // Set the report interval to enable the sensor for polling
            _accelerometer.ReportInterval = _desiredReportInterval;

            Window.Current.VisibilityChanged += VisibilityChanged;
            _dispatcherTimer.Start();

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 75 of file Scenario3_Polling.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _dispatcherTimer.Start();
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _dispatcherTimer.Stop();
                }
            }
        }

Member Data Documentation

Accelerometer _accelerometer [private]

Definition at line 27 of file Scenario3_Polling.xaml.cs.

uint _desiredReportInterval [private]

Definition at line 28 of file Scenario3_Polling.xaml.cs.

DispatcherTimer _dispatcherTimer [private]

Definition at line 29 of file Scenario3_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario3_Polling.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario3_Polling.xaml.cs
  • Accelerometer/cpp/Scenario3_Polling.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ReceiveFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ReceiveFile
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ReceiveFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_ReceiveFile ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CreateTestFile ()
async void | CreateTestFileWithNoExtension ()
async void | RemoveTestFiles ()

Private Attributes

string | Extension = "alsdkcs"
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario3_ReceiveFile.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ReceiveFile ( ) [inline]

Definition at line 34 of file Scenario3_ReceiveFile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CreateTestFile ( ) [inline, private]

Definition at line 82 of file Scenario3_ReceiveFile.xaml.cs.

        {
            StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
            await folder.CreateFileAsync("Test " + Extension + " file." + Extension, CreationCollisionOption.ReplaceExisting);
            await Windows.System.Launcher.LaunchFolderAsync(folder);
        }

async void CreateTestFileWithNoExtension ( ) [inline, private]

Definition at line 89 of file Scenario3_ReceiveFile.xaml.cs.

        {
            StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
            await folder.CreateFileAsync("Test file with no extension", CreationCollisionOption.ReplaceExisting);
            await Windows.System.Launcher.LaunchFolderAsync(folder);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario3_ReceiveFile.xaml.cs.

        {
            // Display the result of the file activation if we got here as a result of being activated for a file.
            var args = e.Parameter as FileActivatedEventArgs;

            if (args != null)
            {
                string output = "Files received: " + args.Files.Count + "\n";
                foreach (StorageFile file in args.Files)
                {
                    output = output + file.Name + "\n";
                }

                if (args.NeighboringFilesQuery != null)
                {
                    // If supported, we receive the pictures from the same folder as the file that was launched
                    // because we declared the picturesLibrary capability. The order of the neighboring
                    // files matches the sort order of the folder from which the file was launched.
                    IReadOnlyList<StorageFile> neighboringFiles = await args.NeighboringFilesQuery.GetFilesAsync();
                    if (neighboringFiles.Count > 0)
                    {
                        output = output + "\nNeighboring files: " + neighboringFiles.Count + "\n";
                        int i;
                        for (i = 0; i < Math.Min(neighboringFiles.Count, 3); i++)
                        {
                            output = output + neighboringFiles[i].Name + "\n";
                        }
                        int remaining = neighboringFiles.Count - i;
                        if (remaining > 0)
                        {
                            output = output + "and " + remaining + " more.";
                        }
                    }
                }
                rootPage.NotifyUser(output, NotifyType.StatusMessage);
            }
        }

async void RemoveTestFiles ( ) [inline, private]

Definition at line 96 of file Scenario3_ReceiveFile.xaml.cs.

        {
            StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
            try
            {
                StorageFile file = await folder.GetFileAsync("Test " + Extension + " file." + Extension);
                await file.DeleteAsync();
            }
            catch (Exception)
            {
                // File I/O errors are reported as exceptions.
                // Ignore errors here.
            }

            try
            {
                StorageFile file = await folder.GetFileAsync("Test file with no extension");
                await file.DeleteAsync();
            }
            catch (Exception)
            {
                // File I/O errors are reported as exceptions.
                // Ignore errors here.
            }
        }

Member Data Documentation

string Extension = "alsdkcs" [private]

Definition at line 32 of file Scenario3_ReceiveFile.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario3_ReceiveFile.xaml.cs.

The documentation for this class was generated from the following file:
  • AssociationLaunching/cs/Scenario3_ReceiveFile.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Region Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Region
Public Member Functions | Private Member Functions

Scenario3_Region Class Reference

List of all members.

Public Member Functions

Scenario3_Region ()

Private Member Functions

string | ReportRegionData (GeographicRegion region)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario3_Region.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Region ( ) [inline]

Definition at line 21 of file Scenario3_Region.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportRegionData ( GeographicRegion region ) [inline, private]

Definition at line 26 of file Scenario3_Region.xaml.cs.

        {
            return "Display Name: " + region.DisplayName + "\n" +
                "Native Name: " + region.NativeName + "\n" +
                "Currencies in use: " + string.Join(", ", region.CurrenciesInUse) + "\n" +
                "Codes: " + region.CodeTwoLetter + ", " + region.CodeThreeLetter + ", " + region.CodeThreeDigit + "\n\n";
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario3_Region.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.GeographicRegion class to
            // obtain the geographic region characteristics.
            var userGeoRegion = new GeographicRegion();

            // This obtains the geographic region characteristics by providing a country or region code.
            var exampleGeoRegion = new GeographicRegion("JP");

            // Display the results
            OutputTextBlock.Text = "User's Preferred Geographic Region\n" + ReportRegionData(userGeoRegion) +
                "Example Geographic Region by region/country code (JP)\n" + ReportRegionData(exampleGeoRegion);
        }

The documentation for this class was generated from the following files:
  • GlobalizationPreferences/cs/Scenario3_Region.xaml.cs
  • GlobalizationPreferences/cpp/Scenario3_Region.xaml.cpp
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Replace Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Replace
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_Replace Class Reference

List of all members.

Public Member Functions

Scenario3_Replace ()

Private Member Functions

async void Replace_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario3_Replace.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Replace ( ) [inline]

Definition at line 23 of file Scenario3_Replace.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Replace_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Replace an appointment on the user's calendar using the default appointments provider app.

Parameters:
sender
e

Definition at line 33 of file Scenario3_Replace.xaml.cs.

        {
            // The appointment id argument for ReplaceAppointmentAsync is typically retrieved from AddAppointmentAsync and stored in app data.
            String appointmentIdOfAppointmentToReplace = AppointmentIdTextBox.Text;

            if (String.IsNullOrEmpty(appointmentIdOfAppointmentToReplace))
            {
                rootPage.NotifyUser("The appointment id cannot be empty", NotifyType.ErrorMessage);
            }
            else
            {
                // The Appointment argument for ReplaceAppointmentAsync should contain all of the Appointment's properties including those that may have changed.
                var appointment = new Windows.ApplicationModel.Appointments.Appointment();

                // Get the selection rect of the button pressed to replace this appointment
                var rect = MainPage.GetElementRect(sender as FrameworkElement);

                // ReplaceAppointmentAsync returns an updated appointment id when the appointment was successfully replaced.
                // The updated id may or may not be the same as the original one retrieved from AddAppointmentAsync.
                // An optional instance start time can be provided to indicate that a specific instance on that date should be replaced
                // in the case of a recurring appointment.
                // If the appointment id returned is an empty string, that indicates that the appointment was not replaced.
                String updatedAppointmentId;
                if (InstanceStartDateCheckBox.IsChecked.Value)
                {
                    // Replace a specific instance starting on the date provided.
                    var instanceStartDate = InstanceStartDateDatePicker.Date;
                    updatedAppointmentId = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowReplaceAppointmentAsync(appointmentIdOfAppointmentToReplace, appointment, rect, Windows.UI.Popups.Placement.Default, instanceStartDate);
                }
                else
                {
                    // Replace an appointment that occurs only once or in the case of a recurring appointment, replace the entire series.
                    updatedAppointmentId = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowReplaceAppointmentAsync(appointmentIdOfAppointmentToReplace, appointment, rect, Windows.UI.Popups.Placement.Default);
                }

                if (updatedAppointmentId != String.Empty)
                {
                    rootPage.NotifyUser("Updated Appointment Id: " + updatedAppointmentId, NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Appointment not replaced.", NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario3_Replace.xaml.cs.

The documentation for this class was generated from the following file:
  • Appointments/cs/Scenario3_Replace.xaml.cs
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_RequestModification Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_RequestModification
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario3_RequestModification Class Reference

See the README.md for discussion of this scenario. More...

List of all members.

Public Member Functions

Scenario3_RequestModification ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Types

enum | AzureKeyAcquisitionMethod { None, AuthorizationHeader, UrlQueryParameter, ApplicationDownloaded }

Private Member Functions

async Task | AppDownloadedKeyRequest (AdaptiveMediaSourceDownloadRequestedEventArgs args)
void | AzureMethodSelected_Click (object sender, RoutedEventArgs e)
void | DownloadFailed (AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadFailedEventArgs args)
async void | DownloadRequested (AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadRequestedEventArgs args)
async void | HdcpDesiredMinimumProtection_Click (object sender, RoutedEventArgs e)
async void | HideDescriptionOnSmallScreen ()
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | ModifyKeyRequestUri (AdaptiveMediaSourceDownloadRequestedEventArgs args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | RegisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
async void | SetMaxBitrateForProtectionLevel (HdcpProtection?protection, AdaptiveMediaSource ams)
void | UnregisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
void | UnregisterHandlers (MediaPlayer mediaPlayer)

Private Attributes

AdaptiveMediaSource | adaptiveMediaSource
AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
CancellationTokenSource | ctsForAppHttpClientForKeys = new CancellationTokenSource()
HdcpSession | hdcpSession
AddAuthorizationHeaderFilter httpClientFilter
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger
AzureKeyAcquisitionMethod tokenMethod

Detailed Description

Note: We register but do not unregister event handlers in this scenario, see the EventHandler scenario for patterns that can be used to clean up.

Definition at line 38 of file Scenario3_RequestModification.xaml.cs.

Member Enumeration Documentation

enum AzureKeyAcquisitionMethod [private]
Enumerator:
None
AuthorizationHeader
UrlQueryParameter
ApplicationDownloaded

Definition at line 380 of file Scenario3_RequestModification.xaml.cs.

        {
            None,
            AuthorizationHeader,
            UrlQueryParameter,
            ApplicationDownloaded,
        }

Constructor & Destructor Documentation

Scenario3_RequestModification ( ) [inline]

Definition at line 44 of file Scenario3_RequestModification.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task AppDownloadedKeyRequest ( AdaptiveMediaSourceDownloadRequestedEventArgs args ) [inline, private]

Definition at line 300 of file Scenario3_RequestModification.xaml.cs.

        {
            if (ContentSelectorControl.SelectedModel == null)
            {
                return;
            }

            // For AzureKeyAcquisitionMethod.ApplicationDownloaded we do the following:
            //   Call .GetDeferral() to allow asynchronous work to be performed
            //   Get the requested network resource using app code
            //   Set .Result.InputStream or .Result.Buffer with the response data
            //   Complete the deferral to indicate that we are done.
            // With this pattern, the app has complete control over any downloaded content.

            // Obtain a deferral so we can perform asynchronous operations.
            var deferral = args.GetDeferral();
            try
            {
                var appHttpClientForKeys = new HttpClient();
                appHttpClientForKeys.DefaultRequestHeaders.Authorization = new HttpCredentialsHeaderValue("Bearer", ContentSelectorControl.SelectedModel.AesToken);

                HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, args.ResourceUri);

                HttpResponseMessage response = await appHttpClientForKeys.SendRequestAsync(
                    request, HttpCompletionOption.ResponseHeadersRead).AsTask(ctsForAppHttpClientForKeys.Token);

                if (response.IsSuccessStatusCode)
                {
                    args.Result.InputStream = await response.Content.ReadAsInputStreamAsync();
                    // Alternatively, we could use:
                    // args.Result.Buffer = await response.Content.ReadAsBufferAsync();
                }
                else
                {
                    // The app code failed. Report this by setting the args.Result.ExtendedStatus.
                    // This will ensure that the AdaptiveMediaSource does not attempt to download the resource
                    // itself, and instead treats the download as having failed.
                    switch (response.StatusCode)
                    {
                        case HttpStatusCode.Unauthorized:
                            // HTTP_E_STATUS_DENIED
                            args.Result.ExtendedStatus = 0x80190191;
                            break;
                        case HttpStatusCode.NotFound:
                            // HTTP_E_STATUS_NOT_FOUND
                            args.Result.ExtendedStatus = 0x80190194;
                            break;
                        default:
                            // HTTP_E_STATUS_UNEXPECTED
                            args.Result.ExtendedStatus = 0x80190001;
                            break;
                    }
                    Log($"Key Download Failed: {response.StatusCode} {args.ResourceUri}");
                }
            }
            catch (TaskCanceledException)
            {
                Log($"Request canceled: {args.ResourceUri}");

            }
            catch (Exception e)
            {
                Log($"Key Download Failed: {e.Message} {args.ResourceUri}");
            }
            finally
            {
                // Complete the deferral when done.
                deferral.Complete();
            }
        }

void AzureMethodSelected_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 388 of file Scenario3_RequestModification.xaml.cs.

        {
            AzureKeyAcquisitionMethod selectedMethod;
            string selected = (sender as RadioButton).Tag.ToString();
            if (Enum.TryParse(selected, out selectedMethod))
            {
                tokenMethod = selectedMethod;
            }
        }

void DownloadFailed | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourceDownloadFailedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 371 of file Scenario3_RequestModification.xaml.cs.

        {
            Log($"DownloadFailed: {args.HttpResponseMessage}, {args.ResourceType}, {args.ResourceUri}");
        }

async void DownloadRequested | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourceDownloadRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 254 of file Scenario3_RequestModification.xaml.cs.

        {
            if (args.ResourceType == AdaptiveMediaSourceResourceType.Key)
            {
                switch (tokenMethod)
                {
                    case AzureKeyAcquisitionMethod.None:
                        break;
                    case AzureKeyAcquisitionMethod.AuthorizationHeader:
                        // By updating the IHttpFilter KeyHost property here, we ensure it's up to date
                        // before the network request is made.  It is the IHttpFilter that will insert
                        // the Authorization header.
                        if (httpClientFilter != null)
                        {
                            httpClientFilter.KeyHost = args.ResourceUri.Host;
                        }
                        break;
                    case AzureKeyAcquisitionMethod.UrlQueryParameter:
                        ModifyKeyRequestUri(args);
                        break;
                    case AzureKeyAcquisitionMethod.ApplicationDownloaded:
                        await AppDownloadedKeyRequest(args);
                        break;
                    default:
                        break;
                }
            }
        }

async void HdcpDesiredMinimumProtection_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles the radio button selections from the UI and imposes that minimum desired protection.

Definition at line 405 of file Scenario3_RequestModification.xaml.cs.

        {
            HdcpProtection desiredMinimumProtection = HdcpProtection.Off;
            string selected = (sender as RadioButton).Tag.ToString();
            if (Enum.TryParse(selected, out desiredMinimumProtection))
            {
                var result = await hdcpSession.SetDesiredMinProtectionAsync(desiredMinimumProtection);
                HdcpProtection? actualProtection = hdcpSession.GetEffectiveProtection();
                if (result != HdcpSetProtectionResult.Success)
                {
                    Log($"ERROR: Unable to set HdcpProtection.{desiredMinimumProtection}, Error: {result}, Actual HDCP: {actualProtection}");
                }
                else
                {
                    Log($"HDCP Requested Minimum: {desiredMinimumProtection}, Actual: {actualProtection}");
                }
            }
        }

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 226 of file Scenario3_RequestModification.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 148 of file Scenario3_RequestModification.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            if (tokenMethod == AzureKeyAcquisitionMethod.AuthorizationHeader)
            {
                if (ContentSelectorControl.SelectedModel == null)
                {
                    return null;
                }
                // Use an IHttpFilter to identify key request URIs and insert an Authorization header with the Bearer token.
                var baseProtocolFilter = new HttpBaseProtocolFilter();
                baseProtocolFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;  // Always set WriteBehavior = NoCache
                httpClientFilter = new AddAuthorizationHeaderFilter(baseProtocolFilter);
                httpClientFilter.AuthorizationHeader = new HttpCredentialsHeaderValue("Bearer", ContentSelectorControl.SelectedModel.AesToken);
                httpClient = new HttpClient(httpClientFilter);

                // Here is where you can add any required custom CDN headers.
                httpClient.DefaultRequestHeaders.Append("X-HeaderKey", "HeaderValue");
                // NOTE: It is not recommended to set Authorization headers needed for key request on the
                // default headers of the HttpClient, as these will also be used on non-HTTPS calls
                // for media segments and manifests -- and thus will be easily visible.
            }

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                // In addition to logging, we use the callbacks to update some UI elements in this scenario:
                RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);

                // At this point, we have read the manifest of the media source, and all bitrates are known.
                // Now that we have bitrates, attempt to cap them based on HdcpProtection.
                HdcpProtection? protection = hdcpSession.GetEffectiveProtection();
                SetMaxBitrateForProtectionLevel(protection, adaptiveMediaSource);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);

            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
                return null;
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = Guid.NewGuid().ToString();

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 471 of file Scenario3_RequestModification.xaml.cs.

        {
            LoggerControl.Log(message);
        }

void ModifyKeyRequestUri ( AdaptiveMediaSourceDownloadRequestedEventArgs args ) [inline, private]

Definition at line 283 of file Scenario3_RequestModification.xaml.cs.

        {
            if (ContentSelectorControl.SelectedModel == null)
            {
                return;
            }

            // This pattern can be used to modify Uris, for example:
            //   To a redirect traffic to a secondary endpoint
            //   To change an segment request into a byte-range Uri into another resource

            // Add the Bearer token to the Uri and modify the args.Result.ResourceUri
            string armoredAuthToken = System.Net.WebUtility.UrlEncode("Bearer=" + ContentSelectorControl.SelectedModel.AesToken);
            string uriWithTokenParameter = $"{args.ResourceUri.AbsoluteUri}&token={armoredAuthToken}";
            args.Result.ResourceUri = new Uri(uriWithTokenParameter);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario3_RequestModification.xaml.cs.

        {
            // Cancel any HTTP requests the app was making:
            ctsForAppHttpClientForKeys.Cancel();

            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }

            // We clean up HDCP explicitly. Otherwise, the OutputProtectionManager
            // will continue to impose our policy until it is finalized by the
            // garbage collector.
            hdcpSession?.Dispose();
            hdcpSession = null;
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file Scenario3_RequestModification.xaml.cs.

        {
            // We enforce HDCP in this scenario that uses encryption but not PlayReady.
            hdcpSession = new HdcpSession();

            // The protection level may change if screens are plugged or unplugged from the system or
            // if explicitly set in the radio buttons in the UI.
            hdcpSession.ProtectionChanged += (HdcpSession session, object args) =>
            {
                // After a change, impose a maximum bitrate based on the actual protection level.
                HdcpProtection? protection = session.GetEffectiveProtection();
                SetMaxBitrateForProtectionLevel(protection, adaptiveMediaSource);
            };

            // Explicitly create the instance of MediaPlayer if you need to register for its events
            // (like MediaOpened / MediaFailed) prior to setting an IMediaPlaybackSource.
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m =>!m.PlayReady),
                null,
                LoggerControl,
                LoadSourceFromUriAsync);

            ContentSelectorControl.HideLoadUri(); // Avoid free text URIs for this scenario.

            // Initialize tokenMethod based on the default selected radio button.
            var defaultRadioButton = AzureAuthorizationMethodPanel.Children.OfType<RadioButton>().First(button => button.IsChecked.Value);
            Enum.TryParse((string)defaultRadioButton.Tag, out tokenMethod);

            Log("Content Id 13 and 14 require that you choose an authorization method.");
            ContentSelectorControl.SetSelectedModel(MainPage.ContentManagementSystemStub.Where(m => m.Id == 13).FirstOrDefault());
        }

void RegisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 239 of file Scenario3_RequestModification.xaml.cs.

        {
            adaptiveMediaSource.DownloadRequested += DownloadRequested;
            adaptiveMediaSource.DownloadFailed += DownloadFailed;
        }

async void SetMaxBitrateForProtectionLevel | ( | HdcpProtection? | protection,
 |  | AdaptiveMediaSource | ams |
 | ) |  |  | [inline, private]

Enforces a fictitious content publisher's rules for bandwidth maximums based on HDCP protection levels.

Parameters:
protection | Protection level to use when imposing bandwidth restriction.
ams | AdaptiveMediaSource on which to impose restrictions

Definition at line 429 of file Scenario3_RequestModification.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                EffectiveHdcpProtectionText.Text = protection.ToString();

                if (ams != null && ams.AvailableBitrates.Count > 1)
                {
                    // Get a sorted list of available bitrates.
                    var bitrates = new List<uint>(ams.AvailableBitrates);
                    bitrates.Sort();

                    // Apply maximum bitrate policy based on a fictitious content publisher's rules.
                    switch (protection)
                    {
                        case HdcpProtection.OnWithTypeEnforcement:
                            // Allow full bitrate.
                            ams.DesiredMaxBitrate = bitrates[bitrates.Count - 1];
                            DesiredMaxBitrateText.Text = "full bitrate allowed";
                            break;
                        case HdcpProtection.On:
                            // When there is no HDCP Type 1, make the highest bitrate unavailable.
                            ams.DesiredMaxBitrate = bitrates[bitrates.Count - 2];
                            DesiredMaxBitrateText.Text = "highest bitrate is unavailable";
                            break;
                        case HdcpProtection.Off:
                        case null:
                        default:
                            // When there is no HDCP at all (Off), or the system is still trying to determine what
                            // HDCP protection level to apply (null), then make only the lowest bitrate available.
                            ams.DesiredMaxBitrate = bitrates[0];
                            DesiredMaxBitrateText.Text = "lowest bitrate only";
                            break;
                    }
                    Log($"Imposed DesiredMaxBitrate={ams.DesiredMaxBitrate} for HdcpProtection.{protection}");
                }
            });
        }

void UnregisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 245 of file Scenario3_RequestModification.xaml.cs.

        {
            if (adaptiveMediaSource != null)
            {
                adaptiveMediaSource.DownloadRequested -= DownloadRequested;
                adaptiveMediaSource.DownloadFailed -= DownloadFailed;
            }
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 75 of file Scenario3_RequestModification.xaml.cs.

        {
            AdaptiveMediaSource adaptiveMediaSource = null;
            MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
            if (mpItem != null)
            {
                adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
            }
            MediaSource source = mediaPlayer.Source as MediaSource;
            if (source != null)
            {
                adaptiveMediaSource = source.AdaptiveMediaSource;
            }

            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;

            UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
        }

Member Data Documentation

AdaptiveMediaSource adaptiveMediaSource [private]

Definition at line 103 of file Scenario3_RequestModification.xaml.cs.

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 478 of file Scenario3_RequestModification.xaml.cs.

CancellationTokenSource ctsForAppHttpClientForKeys = new CancellationTokenSource() [private]

Definition at line 42 of file Scenario3_RequestModification.xaml.cs.

HdcpSession hdcpSession [private]

Definition at line 102 of file Scenario3_RequestModification.xaml.cs.

AddAuthorizationHeaderFilter httpClientFilter [private]

Definition at line 101 of file Scenario3_RequestModification.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 477 of file Scenario3_RequestModification.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 475 of file Scenario3_RequestModification.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 476 of file Scenario3_RequestModification.xaml.cs.

AzureKeyAcquisitionMethod tokenMethod [private]

Definition at line 41 of file Scenario3_RequestModification.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario3_RequestModification.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ResetPIN Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ResetPIN
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_ResetPIN Class Reference

List of all members.

Public Member Functions

Scenario3_ResetPIN ()

Private Member Functions

async void ResetPin_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario3_ResetPIN.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ResetPIN ( ) [inline]

Definition at line 24 of file Scenario3_ResetPIN.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ResetPin_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'ResetPin' button.

Parameters:
sender
e

Definition at line 34 of file Scenario3_ResetPIN.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;

            try
            {
                SmartCard card = await rootPage.GetSmartCard();
                SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);

                rootPage.NotifyUser("Resetting smart card PIN...", NotifyType.StatusMessage);

                // When requesting a PIN reset, a SmartCardPinResetHandler must be
                // provided as an argument.  This handler must use the challenge
                // it receives and the card's admin key to calculate and set the
                // response.
                bool result = await provisioning.RequestPinResetAsync(
                    (pinResetSender, request) =>
                    {
                        SmartCardPinResetDeferral deferral = request.GetDeferral();

                        try
                        {
                            IBuffer response = ChallengeResponseAlgorithm.CalculateResponse(request.Challenge, rootPage.AdminKey);
                            request.SetResponse(response);
                        }
                        finally
                        {
                            deferral.Complete();
                        }
                    });

                if (result)
                {
                    rootPage.NotifyUser("Smart card PIN reset operation completed.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Smart card PIN reset operation was canceled by the user.", NotifyType.StatusMessage);
                }

            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Resetting smart card PIN failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario3_ResetPIN.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario3_ResetPIN.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SecondaryTiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_SecondaryTiles
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_SecondaryTiles Class Reference

List of all members.

Public Member Functions

Scenario3_SecondaryTiles ()

Private Member Functions

async void | CreateBadgeAndTextTile_Click (object sender, RoutedEventArgs e)
async void | CreateBadgeTile_Click (object sender, RoutedEventArgs e)
Rect | GetElementRect (FrameworkElement element)

Private Attributes

const String | BADGE_TILE_ID = "ST_BADGE"
MainPage rootPage = MainPage.Current
const String | TEXT_TILE_ID = "ST_BADGE_AND_TEXT"

Detailed Description

Definition at line 23 of file Scenario3_SecondaryTiles.xaml.cs.

Constructor & Destructor Documentation

Scenario3_SecondaryTiles ( ) [inline]

Definition at line 29 of file Scenario3_SecondaryTiles.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void CreateBadgeAndTextTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario3_SecondaryTiles.xaml.cs.

        {
            if (!SecondaryTile.Exists(TEXT_TILE_ID))
            {
                SecondaryTile secondTile = new SecondaryTile(
                    TEXT_TILE_ID,
                    "LockScreen CS - Badge and tile text",
                    "TEXT_ARGS",
                    new Uri("ms-appx:///Assets/squareTile-sdk.png"),
                    TileSize.Wide310x150
                );
                secondTile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/tile-sdk.png");
                secondTile.LockScreenBadgeLogo = new Uri("ms-appx:///Assets/badgelogo-sdk.png");
                secondTile.LockScreenDisplayBadgeAndTileText = true;

                bool isPinned = await secondTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement)sender), Placement.Above);
                if (isPinned)
                {
                    var tileDOM = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Text03);
                    tileDOM.SelectSingleNode("//text[@id=1]").InnerText = "Text for the lock screen";

                    TileUpdateManager.CreateTileUpdaterForSecondaryTile(TEXT_TILE_ID).Update(new TileNotification(tileDOM));
                    rootPage.NotifyUser("Secondary tile created and updated. Go to PC settings to add it to the lock screen.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Tile not created.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Badge and text secondary tile already exists.", NotifyType.ErrorMessage);
            }
        }

async void CreateBadgeTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario3_SecondaryTiles.xaml.cs.

        {
            if (!SecondaryTile.Exists(BADGE_TILE_ID)) {
                SecondaryTile secondTile = new SecondaryTile(
                    BADGE_TILE_ID,
                    "LockScreen CS - Badge only",
                    "BADGE_ARGS",
                    new Uri("ms-appx:///Assets/squareTile-sdk.png"),
                    TileSize.Square150x150
                );
                secondTile.LockScreenBadgeLogo = new Uri("ms-appx:///Assets/badgelogo-sdk.png");

                bool isPinned = await secondTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement)sender), Placement.Above);
                if (isPinned)
                {
                    BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(2);
                    BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(BADGE_TILE_ID).Update(new BadgeNotification(badgeContent.GetXml()));
                    rootPage.NotifyUser("Secondary tile created and badge updated. Go to PC settings to add it to the lock screen.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Tile not created.", NotifyType.ErrorMessage);
                }

            } else {
                rootPage.NotifyUser("Badge secondary tile already exists.", NotifyType.ErrorMessage);
            }
        }

Rect GetElementRect ( FrameworkElement element ) [inline, private]

Definition at line 98 of file Scenario3_SecondaryTiles.xaml.cs.

        {
            GeneralTransform buttonTransform = element.TransformToVisual(null);
            return buttonTransform.TransformBounds(new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }

Member Data Documentation

const String BADGE_TILE_ID = "ST_BADGE" [private]

Definition at line 26 of file Scenario3_SecondaryTiles.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario3_SecondaryTiles.xaml.cs.

const String TEXT_TILE_ID = "ST_BADGE_AND_TEXT" [private]

Definition at line 27 of file Scenario3_SecondaryTiles.xaml.cs.

The documentation for this class was generated from the following file:
  • LockScreenApps/cs/Scenario3_SecondaryTiles.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ServerForeground Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ServerForeground
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario3_ServerForeground Class Reference

List of all members.

Public Member Functions

Scenario3_ServerForeground ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Types

enum | CalculatorCharacteristics { Operand1 = 1, Operand2 = 2, Operator = 3 }
enum | CalculatorOperators { Add = 1, Subtract = 2, Multiply = 3, Divide = 4 }

Private Member Functions

async Task< bool > | CheckPeripheralRoleSupportAsync ()
int | ComputeResult ()
async void | NotifyClientDevices (int computedValue)
async void | Op1Characteristic_WriteRequestedAsync (GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
async void | Op2Characteristic_WriteRequestedAsync (GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
async void | OperatorCharacteristic_WriteRequestedAsync (GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
void | ProcessWriteCharacteristic (GattWriteRequest request, CalculatorCharacteristics opCode)
async void | PublishButton_ClickAsync ()
async void | ResultCharacteristic_ReadRequestedAsync (GattLocalCharacteristic sender, GattReadRequestedEventArgs args)
void | ResultCharacteristic_SubscribedClientsChanged (GattLocalCharacteristic sender, object args)
void | ServiceProvider_AdvertisementStatusChanged (GattServiceProvider sender, GattServiceProviderAdvertisementStatusChangedEventArgs args)
async Task< bool > | ServiceProviderInitAsync ()
async void | UpdateUX ()

Private Attributes

GattLocalCharacteristic | op1Characteristic
GattLocalCharacteristic | op2Characteristic
int | operand1Received = 0
int | operand2Received = 0
GattLocalCharacteristic | operatorCharacteristic
CalculatorOperators | operatorReceived = 0
bool | peripheralSupported
GattLocalCharacteristic | resultCharacteristic
int | resultVal = 0
MainPage rootPage = MainPage.Current
GattServiceProvider | serviceProvider

Detailed Description

Definition at line 31 of file Scenario3_ServerForeground.xaml.cs.

Member Enumeration Documentation

enum CalculatorCharacteristics [private]
Enumerator:
Operand1
Operand2
Operator

Definition at line 51 of file Scenario3_ServerForeground.xaml.cs.

        {
            Operand1 = 1,
            Operand2 = 2,
            Operator = 3
        }

enum CalculatorOperators [private]
Enumerator:
Add
Subtract
Multiply
Divide

Definition at line 58 of file Scenario3_ServerForeground.xaml.cs.

        {
            Add = 1,
            Subtract = 2,
            Multiply = 3,
            Divide = 4
        }

Constructor & Destructor Documentation

Scenario3_ServerForeground ( ) [inline]

Definition at line 67 of file Scenario3_ServerForeground.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async Task<bool> CheckPeripheralRoleSupportAsync ( ) [inline, private]

Definition at line 152 of file Scenario3_ServerForeground.xaml.cs.

        {
            // BT_Code: New for Creator's Update - Bluetooth adapter has properties of the local BT radio.
            var localAdapter = await BluetoothAdapter.GetDefaultAsync();

            if (localAdapter != null)
            {
                return localAdapter.IsPeripheralRoleSupported;
            }
            else
            {
                // Bluetooth is not turned on
                return false;
            }
        }

int ComputeResult ( ) [inline, private]

Definition at line 307 of file Scenario3_ServerForeground.xaml.cs.

        {
            Int32 computedValue = 0;
            switch (operatorReceived)
            {
                case CalculatorOperators.Add:
                    computedValue = operand1Received + operand2Received;
                    break;
                case CalculatorOperators.Subtract:
                    computedValue = operand1Received - operand2Received;
                    break;
                case CalculatorOperators.Multiply:
                    computedValue = operand1Received * operand2Received;
                    break;
                case CalculatorOperators.Divide:
                    if (operand2Received == 0 || (operand1Received == -0x80000000 && operand2Received == -1))
                    {
                        rootPage.NotifyUser("Division overflow", NotifyType.ErrorMessage);
                    }
                    else
                    {
                        computedValue = operand1Received / operand2Received;
                    }
                    break;
                default:
                    rootPage.NotifyUser("Invalid Operator", NotifyType.ErrorMessage);
                    break;
            }
            NotifyClientDevices(computedValue);
            return computedValue;
        }

async void NotifyClientDevices ( int computedValue ) [inline, private]

Definition at line 339 of file Scenario3_ServerForeground.xaml.cs.

        {
            var writer = new DataWriter();
            writer.ByteOrder = ByteOrder.LittleEndian;
            writer.WriteInt32(computedValue);

            // BT_Code: Returns a collection of all clients that the notification was attempted and the result.
            IReadOnlyList<GattClientNotificationResult> results = await resultCharacteristic.NotifyValueAsync(writer.DetachBuffer());

            rootPage.NotifyUser($"Sent value {computedValue} to clients.", NotifyType.StatusMessage);
            foreach (var result in results)
            {
                // An application can iterate through each registered client that was notified and retrieve the results:
                //
                // result.SubscribedClient: The details on the remote client.
                // result.Status: The GattCommunicationStatus
                // result.ProtocolError: iff Status == GattCommunicationStatus.ProtocolError
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 85 of file Scenario3_ServerForeground.xaml.cs.

        {
            if (serviceProvider != null)
            {
                if (serviceProvider.AdvertisementStatus != GattServiceProviderAdvertisementStatus.Stopped)
                {
                    serviceProvider.StopAdvertising();
                }
                serviceProvider = null;
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 72 of file Scenario3_ServerForeground.xaml.cs.

        {
            peripheralSupported = await CheckPeripheralRoleSupportAsync();
            if (peripheralSupported)
            {
                ServerPanel.Visibility = Visibility.Visible;
            }
            else
            {
                PeripheralWarning.Visibility = Visibility.Visible;
            }
        }

async void Op1Characteristic_WriteRequestedAsync | ( | GattLocalCharacteristic | sender,
 |  | GattWriteRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 359 of file Scenario3_ServerForeground.xaml.cs.

        {
            // BT_Code: Processing a write request.
            using (args.GetDeferral())
            {
                // Get the request information.  This requires device access before an app can access the device's request.
                GattWriteRequest request = await args.GetRequestAsync();
                if (request == null)
                {
                    // No access allowed to the device.  Application should indicate this to the user.
                    return;
                }
                ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operand1);
            }
        }

async void Op2Characteristic_WriteRequestedAsync | ( | GattLocalCharacteristic | sender,
 |  | GattWriteRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 375 of file Scenario3_ServerForeground.xaml.cs.

        {
            using (args.GetDeferral())
            {
                // Get the request information.  This requires device access before an app can access the device's request.
                GattWriteRequest request = await args.GetRequestAsync();
                if (request == null)
                {
                    // No access allowed to the device.  Application should indicate this to the user.
                    return;
                }
                ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operand2);
            }
        }

async void OperatorCharacteristic_WriteRequestedAsync | ( | GattLocalCharacteristic | sender,
 |  | GattWriteRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 390 of file Scenario3_ServerForeground.xaml.cs.

        {
            using (args.GetDeferral())
            {
                // Get the request information.  This requires device access before an app can access the device's request.
                GattWriteRequest request = await args.GetRequestAsync();
                if (request == null)
                {
                    // No access allowed to the device.  Application should indicate this to the user.
                    return;
                }
                ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operator);
            }
        }

void ProcessWriteCharacteristic | ( | GattWriteRequest | request,
 |  | CalculatorCharacteristics | opCode |
 | ) |  |  | [inline, private]

BT_Code: Processing a write request.Takes in a GATT Write request and updates UX based on opcode.

Parameters:
request
opCode Operand (1 or 2) and Operator (3)

Definition at line 410 of file Scenario3_ServerForeground.xaml.cs.

        {
            if (request.Value.Length != 4)
            {
                // Input is the wrong length. Respond with a protocol error if requested.
                if (request.Option == GattWriteOption.WriteWithResponse)
                {
                    request.RespondWithProtocolError(GattProtocolError.InvalidAttributeValueLength);
                }
                return;
            }

            var reader = DataReader.FromBuffer(request.Value);
            reader.ByteOrder = ByteOrder.LittleEndian;
            int val = reader.ReadInt32();

            switch (opCode)
            {
                case CalculatorCharacteristics.Operand1:
                    operand1Received = val;
                    break;
                case CalculatorCharacteristics.Operand2:
                    operand2Received = val;
                    break;
                case CalculatorCharacteristics.Operator:
                    if (!Enum.IsDefined(typeof(CalculatorOperators), val))
                    {
                        if (request.Option == GattWriteOption.WriteWithResponse)
                        {
                            request.RespondWithProtocolError(GattProtocolError.InvalidPdu);
                        }
                        return;
                    }
                    operatorReceived = (CalculatorOperators)val;
                    break;
            }
            // Complete the request if needed
            if (request.Option == GattWriteOption.WriteWithResponse)
            {
                request.Respond();
            }

            UpdateUX();
        }

async void PublishButton_ClickAsync ( ) [inline, private]

Definition at line 97 of file Scenario3_ServerForeground.xaml.cs.

        {
            // Server not initialized yet - initialize it and start publishing
            if (serviceProvider == null)
            {
                var serviceStarted = await ServiceProviderInitAsync();
                if (serviceStarted)
                {
                    rootPage.NotifyUser("Service successfully started", NotifyType.StatusMessage);
                    PublishButton.Content = "Stop Service";
                }
                else
                {
                    rootPage.NotifyUser("Service not started", NotifyType.ErrorMessage);
                }
            }
            else
            {
                // BT_Code: Stops advertising support for custom GATT Service
                serviceProvider.StopAdvertising();
                serviceProvider = null;
                PublishButton.Content = "Start Service";
            }
        }

async void ResultCharacteristic_ReadRequestedAsync | ( | GattLocalCharacteristic | sender,
 |  | GattReadRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 278 of file Scenario3_ServerForeground.xaml.cs.

        {
            // BT_Code: Process a read request.
            using (args.GetDeferral())
            {
                // Get the request information.  This requires device access before an app can access the device's request.
                GattReadRequest request = await args.GetRequestAsync();
                if (request == null)
                {
                    // No access allowed to the device.  Application should indicate this to the user.
                    rootPage.NotifyUser("Access to device not allowed", NotifyType.ErrorMessage);
                    return;
                }

                var writer = new DataWriter();
                writer.ByteOrder = ByteOrder.LittleEndian;
                writer.WriteInt32(resultVal);

                // Can get details about the request such as the size and offset, as well as monitor the state to see if it has been completed/cancelled externally.
                // request.Offset
                // request.Length
                // request.State
                // request.StateChanged += <Handler>

                // Gatt code to handle the response
                request.RespondWithValue(writer.DetachBuffer());
            }
        }

void ResultCharacteristic_SubscribedClientsChanged | ( | GattLocalCharacteristic | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 263 of file Scenario3_ServerForeground.xaml.cs.

        {
            rootPage.NotifyUser($"New device subscribed. New subscribed count: {sender.SubscribedClients.Count}", NotifyType.StatusMessage);
        }

void ServiceProvider_AdvertisementStatusChanged | ( | GattServiceProvider | sender,
 |  | GattServiceProviderAdvertisementStatusChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 268 of file Scenario3_ServerForeground.xaml.cs.

        {
            // Created - The default state of the advertisement, before the service is published for the first time.
            // Stopped - Indicates that the application has canceled the service publication and its advertisement.
            // Started - Indicates that the system was successfully able to issue the advertisement request.
            // Aborted - Indicates that the system was unable to submit the advertisement request, or it was canceled due to resource contention.

            rootPage.NotifyUser($"New Advertisement Status: {sender.AdvertisementStatus}", NotifyType.StatusMessage);
        }

async Task<bool> ServiceProviderInitAsync ( ) [inline, private]

Uses the relevant Service/Characteristic UUIDs to initialize, hook up event handlers and start a service on the local system.

Returns:

Definition at line 172 of file Scenario3_ServerForeground.xaml.cs.

        {
            // BT_Code: Initialize and starting a custom GATT Service using GattServiceProvider.
            GattServiceProviderResult serviceResult = await GattServiceProvider.CreateAsync(Constants.CalcServiceUuid);
            if (serviceResult.Error == BluetoothError.Success)
            {
                serviceProvider = serviceResult.ServiceProvider;
            }
            else
            {
                rootPage.NotifyUser($"Could not create service provider: {serviceResult.Error}", NotifyType.ErrorMessage);
                return false;
            }

            GattLocalCharacteristicResult result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.Op1CharacteristicUuid, Constants.gattOperandParameters);
            if (result.Error == BluetoothError.Success)
            {
                op1Characteristic = result.Characteristic;
            }
            else
            {
                rootPage.NotifyUser($"Could not create operand1 characteristic: {result.Error}", NotifyType.ErrorMessage);
                return false;
            }
            op1Characteristic.WriteRequested += Op1Characteristic_WriteRequestedAsync;

            result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.Op2CharacteristicUuid, Constants.gattOperandParameters);
            if (result.Error == BluetoothError.Success)
            {
                op2Characteristic = result.Characteristic;
            }
            else
            {
                rootPage.NotifyUser($"Could not create operand2 characteristic: {result.Error}", NotifyType.ErrorMessage);
                return false;
            }

            op2Characteristic.WriteRequested += Op2Characteristic_WriteRequestedAsync;

            result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.OperatorCharacteristicUuid, Constants.gattOperatorParameters);
            if (result.Error == BluetoothError.Success)
            {
                operatorCharacteristic = result.Characteristic;
            }
            else
            {
                rootPage.NotifyUser($"Could not create operator characteristic: {result.Error}", NotifyType.ErrorMessage);
                return false;
            }

            operatorCharacteristic.WriteRequested += OperatorCharacteristic_WriteRequestedAsync;

            // Add presentation format - 32-bit unsigned integer, with exponent 0, the unit is unitless, with no company description
            GattPresentationFormat intFormat = GattPresentationFormat.FromParts(
                GattPresentationFormatTypes.UInt32,
                PresentationFormats.Exponent,
                Convert.ToUInt16(PresentationFormats.Units.Unitless),
                Convert.ToByte(PresentationFormats.NamespaceId.BluetoothSigAssignedNumber),
                PresentationFormats.Description);

            Constants.gattResultParameters.PresentationFormats.Add(intFormat);

            result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.ResultCharacteristicUuid, Constants.gattResultParameters);
            if (result.Error == BluetoothError.Success)
            {
                resultCharacteristic = result.Characteristic;
            }
            else
            {
                rootPage.NotifyUser($"Could not create result characteristic: {result.Error}", NotifyType.ErrorMessage);
                return false;
            }
            resultCharacteristic.ReadRequested += ResultCharacteristic_ReadRequestedAsync;
            resultCharacteristic.SubscribedClientsChanged += ResultCharacteristic_SubscribedClientsChanged;

            // BT_Code: Indicate if your sever advertises as connectable and discoverable.
            GattServiceProviderAdvertisingParameters advParameters = new GattServiceProviderAdvertisingParameters
            {
                // IsConnectable determines whether a call to publish will attempt to start advertising and
                // put the service UUID in the ADV packet (best effort)
                IsConnectable = peripheralSupported,

                // IsDiscoverable determines whether a remote device can query the local device for support
                // of this service
                IsDiscoverable = true
            };
            serviceProvider.AdvertisementStatusChanged += ServiceProvider_AdvertisementStatusChanged;
            serviceProvider.StartAdvertising(advParameters);
            return true;
        }

async void UpdateUX ( ) [inline, private]

Definition at line 122 of file Scenario3_ServerForeground.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (operatorReceived)
                {
                    case CalculatorOperators.Add:
                        OperationText.Text = "+";
                        break;
                    case CalculatorOperators.Subtract:
                        OperationText.Text = "-";
                        break;
                    case CalculatorOperators.Multiply:
                        OperationText.Text = "*";
                        break;
                    case CalculatorOperators.Divide:
                        OperationText.Text = "/";
                        break;
                    default:
                        OperationText.Text = "INV";
                        break;
                }
                Operand1Text.Text = operand1Received.ToString();
                Operand2Text.Text = operand2Received.ToString();
                resultVal = ComputeResult();
                ResultText.Text = resultVal.ToString();
            });
        }

Member Data Documentation

GattLocalCharacteristic op1Characteristic [private]

Definition at line 37 of file Scenario3_ServerForeground.xaml.cs.

GattLocalCharacteristic op2Characteristic [private]

Definition at line 40 of file Scenario3_ServerForeground.xaml.cs.

int operand1Received = 0 [private]

Definition at line 38 of file Scenario3_ServerForeground.xaml.cs.

int operand2Received = 0 [private]

Definition at line 41 of file Scenario3_ServerForeground.xaml.cs.

GattLocalCharacteristic operatorCharacteristic [private]

Definition at line 43 of file Scenario3_ServerForeground.xaml.cs.

CalculatorOperators operatorReceived = 0 [private]

Definition at line 44 of file Scenario3_ServerForeground.xaml.cs.

bool peripheralSupported [private]

Definition at line 49 of file Scenario3_ServerForeground.xaml.cs.

GattLocalCharacteristic resultCharacteristic [private]

Definition at line 46 of file Scenario3_ServerForeground.xaml.cs.

int resultVal = 0 [private]

Definition at line 47 of file Scenario3_ServerForeground.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario3_ServerForeground.xaml.cs.

GattServiceProvider serviceProvider [private]

Definition at line 35 of file Scenario3_ServerForeground.xaml.cs.

The documentation for this class was generated from the following file:
  • BluetoothLE/cs/Scenario3_ServerForeground.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SettingContainer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_SettingContainer
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_SettingContainer Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_SettingContainer ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CreateContainer_Click (Object sender, RoutedEventArgs e)
void | DeleteContainer_Click (Object sender, RoutedEventArgs e)
void | DeleteSetting_Click (Object sender, RoutedEventArgs e)
void | DisplayOutput ()
void | WriteSetting_Click (Object sender, RoutedEventArgs e)

Private Attributes

const string | containerName = "exampleContainer"
ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings
MainPage rootPage = MainPage.Current
const string | settingName = "exampleSetting"

Detailed Description

Definition at line 22 of file Scenario3_SettingContainer.xaml.cs.

Constructor & Destructor Documentation

Scenario3_SettingContainer ( ) [inline]

Definition at line 30 of file Scenario3_SettingContainer.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void CreateContainer_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario3_SettingContainer.xaml.cs.

        {
            ApplicationDataContainer container = localSettings.CreateContainer(containerName, ApplicationDataCreateDisposition.Always);

            DisplayOutput();
        }

void DeleteContainer_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file Scenario3_SettingContainer.xaml.cs.

        {
            localSettings.DeleteContainer(containerName);

            DisplayOutput();
        }

void DeleteSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario3_SettingContainer.xaml.cs.

        {
            localSettings.Containers[containerName].Values.Remove(settingName);

            DisplayOutput();
        }

void DisplayOutput ( ) [inline, private]

Definition at line 63 of file Scenario3_SettingContainer.xaml.cs.

        {
            bool hasContainer = localSettings.Containers.TryGetValue(containerName, out ApplicationDataContainer container);
            bool hasSetting = hasContainer ? container.Values.ContainsKey(settingName) : false;

            OutputTextBlock.Text = $"Container Exists: {hasContainer}\nSetting Exists: {hasSetting}";

            WriteSetting.IsEnabled = hasContainer;
            DeleteSetting.IsEnabled = hasContainer;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 74 of file Scenario3_SettingContainer.xaml.cs.

        {
            DisplayOutput();
        }

void WriteSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario3_SettingContainer.xaml.cs.

        {
            localSettings.Containers[containerName].Values[settingName] = "Hello World"; // example value

            DisplayOutput();
        }

Member Data Documentation

const string containerName = "exampleContainer" [private]

Definition at line 27 of file Scenario3_SettingContainer.xaml.cs.

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [private]

Definition at line 25 of file Scenario3_SettingContainer.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario3_SettingContainer.xaml.cs.

const string settingName = "exampleSetting" [private]

Definition at line 28 of file Scenario3_SettingContainer.xaml.cs.

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario3_SettingContainer.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ShowHideMethods Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_ShowHideMethods
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario3_ShowHideMethods Class Reference

Sample page to call TryShow/TryHide methods.

List of all members.

Public Member Functions

Scenario3_ShowHideMethods ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | OnFadeOutCompleted (object sender, object e)
void | WordListBox_OnKeyUp (object sender, KeyRoutedEventArgs e)

Detailed Description

Definition at line 23 of file Scenario3_ShowHideMethods.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ShowHideMethods ( ) [inline]

Definition at line 25 of file Scenario3_ShowHideMethods.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnFadeOutCompleted | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario3_ShowHideMethods.xaml.cs.

        {
            ResultsTextBlock.Text = "";
            Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryShow();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario3_ShowHideMethods.xaml.cs.

        {
            FadeOutResults.Stop();
        }

void WordListBox_OnKeyUp | ( | object | sender,
 |  | KeyRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario3_ShowHideMethods.xaml.cs.

        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                string text = WordListBox.Text;
                if (text.Length > 0)
                {
                    Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryHide();
                    ResultsTextBlock.Text = text;
                    FadeOutResults.Begin();
                }
            }
        }

The documentation for this class was generated from the following file:
  • TouchKeyboard/cs/Scenario3_ShowHideMethods.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SingleFolder Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_SingleFolder
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_SingleFolder Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario3_SingleFolder ()

Private Member Functions

async void PickFolderButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario3_SingleFolder.xaml.cs.

Constructor & Destructor Documentation

Scenario3_SingleFolder ( ) [inline]

Definition at line 29 of file Scenario3_SingleFolder.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickFolderButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario3_SingleFolder.xaml.cs.

        {
            // Clear previous returned folder name, if it exists, between iterations of this scenario
            OutputTextBlock.Text = "";

            FolderPicker folderPicker = new FolderPicker();
            folderPicker.SuggestedStartLocation = PickerLocationId.Desktop;
            folderPicker.FileTypeFilter.Add(".docx");
            folderPicker.FileTypeFilter.Add(".xlsx");
            folderPicker.FileTypeFilter.Add(".pptx");
            StorageFolder folder = await folderPicker.PickSingleFolderAsync();
            if (folder != null)
            {
                // The StorageFolder has read/write access to all contents in the picked folder (including other sub-folder contents).
                // See the FileAccess sample for code that obtains a StorageFile from a StorageFolder to read and write.
                StorageApplicationPermissions.FutureAccessList.AddOrReplace("PickedFolderToken", folder);
                OutputTextBlock.Text = "Picked folder: " + folder.Name;
            }
            else
            {
                OutputTextBlock.Text = "Operation cancelled.";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_SingleFolder.xaml.cs.

The documentation for this class was generated from the following files:
  • FilePicker/cs/Scenario3_SingleFolder.xaml.cs
  • FilePicker/cpp/Scenario3_SingleFolder.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Size Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Size
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Size Class Reference

List of all members.

Public Member Functions

Scenario3_Size ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | ShowWindowBtn_Click (object sender, RoutedEventArgs e)

Private Attributes

AppWindow | appWindow
Frame | appWindowFrame = new Frame()
const double | MinWindowHeight = 48
const double | MinWindowWidth = 192

Detailed Description

Definition at line 23 of file Scenario3_Size.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Size ( ) [inline]

Definition at line 28 of file Scenario3_Size.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario3_Size.xaml.cs.

        {
            if (appWindow != null)
            {
                await appWindow.CloseAsync();
            }
        }

async void ShowWindowBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario3_Size.xaml.cs.

        {
            // Clear any previous message.
            MainPage.Current.NotifyUser(string.Empty, NotifyType.StatusMessage);

            Double.TryParse(windowWidthTxt.Text, out var windowWidth);
            Double.TryParse(windowHeightTxt.Text, out var windowHeight);
            if (windowWidth < MinWindowWidth || windowHeight < MinWindowHeight)
            {
                MainPage.Current.NotifyUser($"Please specify a width of at least {MinWindowWidth} and a height of at least {MinWindowHeight}.", NotifyType.ErrorMessage);
                return;
            }

            showWindowBtn.IsEnabled = false;

            // Only ever create and show one window. If the AppWindow exists use it
            if (appWindow == null)
            {
                // Create a new window
                appWindow = await AppWindow.TryCreateAsync();
                // Make sure we release the reference to this window, and release XAML resources, when it's closed
                appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
                // Navigate the frame to the page we want to show in the new window
                appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
            }

            // If specified size is smaller than the default min size for a window we need to set a new preferred min size first.
            // Let's set it to the smallest allowed and leave it at that.
            if (windowWidth < 500 || windowHeight < 320)
            {
                WindowManagementPreview.SetPreferredMinSize(appWindow, new Size(MinWindowWidth, MinWindowHeight));
            }
            // Request the size of our window
            appWindow.RequestSize(new Size(windowWidth, windowHeight));
            // Attach the XAML content to our window
            ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);

            // If the window is not visible, show it and/or bring it to foreground
            if (!appWindow.IsVisible)
            {
                await appWindow.TryShowAsync();
            }

            showWindowBtn.IsEnabled = true;
        }

Member Data Documentation

AppWindow appWindow [private]

Definition at line 25 of file Scenario3_Size.xaml.cs.

Frame appWindowFrame = new Frame() [private]

Definition at line 26 of file Scenario3_Size.xaml.cs.

const double MinWindowHeight = 48 [private]

Definition at line 43 of file Scenario3_Size.xaml.cs.

const double MinWindowWidth = 192 [private]

Definition at line 42 of file Scenario3_Size.xaml.cs.

The documentation for this class was generated from the following file:
  • AppWindow/cs/Scenario3_Size.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Transliteration Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Transliteration
Public Member Functions | Private Attributes

Scenario3_Transliteration Class Reference

List of all members.

Public Member Functions

Scenario3_Transliteration ()
void Go_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario3_Transliteration.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Transliteration ( ) [inline]

Definition at line 22 of file Scenario3_Transliteration.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void Go_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 27 of file Scenario3_Transliteration.xaml.cs.

        {
            TextOutput.Text = LinguisticServices.TransliterateFromCyrillicToLatin(TextInput.Text);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario3_Transliteration.xaml.cs.

The documentation for this class was generated from the following file:
  • LinguisticServices/cs/Scenario3_Transliteration.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Trim Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_Trim
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_Trim Class Reference

List of all members.

Public Member Functions

Scenario3_Trim ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisableButtons ()
void | DisableNonSquarePARProfiles ()
async void | EnableButtons ()
void | EnableNonSquarePARProfiles ()
void | GetPresetProfile (ComboBox combobox)
void | InputPauseButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | InputPlayButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | InputStopButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | MarkIn (Object sender, RoutedEventArgs e)
void | MarkOut (Object sender, RoutedEventArgs e)
void | OnTargetFormatChanged (object sender, SelectionChangedEventArgs e)
async void | OutputPathText (string text)
void | OutputPauseButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | OutputPlayButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | OutputStopButton_Click (Object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | OutputText (string text)
async void | PickFile (object sender, RoutedEventArgs e)
async void | PickOutput (object sender, RoutedEventArgs e)
async void | PlayFile (Windows.Storage.StorageFile MediaFile)
async void | SetCancelButton (bool isEnabled)
async void | SetOutputFileButton (bool isEnabled)
async void | SetPickFileButton (bool isEnabled)
async void | SetTranscodeButton (bool isEnabled)
async void | StopPlayers ()
async void | TranscodeCancel (object sender, RoutedEventArgs e)
async void | TranscodeComplete ()
async void | TranscodeError (string error)
async void | TranscodeFailure (TranscodeFailureReason reason)
void | TranscodeProgress (double percent)
async void | TranscodeTrim (Object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

TimeSpan | _c_sec0 = new TimeSpan(0, 0, 0)
TimeSpan | _c_sec1 = new TimeSpan(0, 0, 1)
CancellationTokenSource | _cts
Windows.UI.Core.CoreDispatcher | _dispatcher = Window.Current.Dispatcher
Windows.Storage.StorageFile | _InputFile = null
Windows.Storage.StorageFile | _OutputFile = null
string | _OutputFileExtension = ".mp4"
string | _OutputFileName = "TranscodeSampleOutput"
string | _OutputType = "MP4"
Windows.Media.MediaProperties.MediaEncodingProfile | _Profile
TimeSpan | _Start = new TimeSpan(0)
TimeSpan | _Stop = new TimeSpan(0)
Windows.Media.Transcoding.MediaTranscoder | _Transcoder = new Windows.Media.Transcoding.MediaTranscoder()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario3_Trim.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Trim ( ) [inline]

Definition at line 45 of file Scenario3_Trim.xaml.cs.

        {
            this.InitializeComponent();
            _cts = new CancellationTokenSource();

            // Hook up UI
            PickFileButton.Click += new RoutedEventHandler(PickFile);
            SetOutputButton.Click += new RoutedEventHandler(PickOutput);
            TargetFormat.SelectionChanged += new SelectionChangedEventHandler(OnTargetFormatChanged);
            Transcode.Click += new RoutedEventHandler(TranscodeTrim);
            Cancel.Click += new RoutedEventHandler(TranscodeCancel);
            MarkInButton.Click += new RoutedEventHandler(MarkIn);
            MarkOutButton.Click += new RoutedEventHandler(MarkOut);

            // Disable manual manipulation of trim points
            StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
            EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
            StartTimeText.IsEnabled = false;
            EndTimeText.IsEnabled = false;

            // Media Controls
            InputPlayButton.Click += new RoutedEventHandler(InputPlayButton_Click);
            InputPauseButton.Click += new RoutedEventHandler(InputPauseButton_Click);
            InputStopButton.Click += new RoutedEventHandler(InputStopButton_Click);
            OutputPlayButton.Click += new RoutedEventHandler(OutputPlayButton_Click);
            OutputPauseButton.Click += new RoutedEventHandler(OutputPauseButton_Click);
            OutputStopButton.Click += new RoutedEventHandler(OutputStopButton_Click);

            // File is not selected, disable all buttons but PickFileButton
            DisableButtons();
            SetPickFileButton(true);
            SetOutputFileButton(true);
            SetCancelButton(false);
        }

Member Function Documentation

void DisableButtons ( ) [inline, private]

Definition at line 451 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                ProfileSelect.IsEnabled = false;
                Transcode.IsEnabled = false;
                PickFileButton.IsEnabled = false;
                SetOutputButton.IsEnabled = false;
                TargetFormat.IsEnabled = false;
                MarkInButton.IsEnabled = false;
                MarkOutButton.IsEnabled = false;
                EnableMrfCrf444.IsEnabled = false;
            });
        }

void DisableNonSquarePARProfiles ( ) [inline, private]

Definition at line 472 of file Scenario3_Trim.xaml.cs.

        {
            ComboBoxItem_NTSC.IsEnabled = false;
            ComboBoxItem_PAL.IsEnabled = false;

            // Ensure a valid profile is set
            if ((ProfileSelect.SelectedIndex == 3) || (ProfileSelect.SelectedIndex == 4))
            {
                ProfileSelect.SelectedIndex = 2;
            }
        }

void Dispose ( ) [inline]

Definition at line 81 of file Scenario3_Trim.xaml.cs.

        {
            _cts.Dispose();
        }

void EnableButtons ( ) [inline, private]

Definition at line 433 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = true;
                SetOutputButton.IsEnabled = true;
                TargetFormat.IsEnabled = true;
                ProfileSelect.IsEnabled = true;
                MarkInButton.IsEnabled = true;
                MarkOutButton.IsEnabled = true;
                EnableMrfCrf444.IsEnabled = true;

                // The transcode button's initial state should be disabled until an output
                // file has been set.
                Transcode.IsEnabled = false;
            });
        }

void EnableNonSquarePARProfiles ( ) [inline, private]

Definition at line 466 of file Scenario3_Trim.xaml.cs.

        {
            ComboBoxItem_NTSC.IsEnabled = true;
            ComboBoxItem_PAL.IsEnabled = true;
        }

void GetPresetProfile ( ComboBox combobox ) [inline, private]

Definition at line 146 of file Scenario3_Trim.xaml.cs.

        {
            _Profile = null;
            VideoEncodingQuality videoEncodingProfile = VideoEncodingQuality.Wvga;
            switch (combobox.SelectedIndex)
            {
                case 0:
                    videoEncodingProfile = VideoEncodingQuality.HD1080p;
                    break;
                case 1:
                    videoEncodingProfile = VideoEncodingQuality.HD720p;
                    break;
                case 2:
                    videoEncodingProfile = VideoEncodingQuality.Wvga;
                    break;
                case 3:
                    videoEncodingProfile = VideoEncodingQuality.Ntsc;
                    break;
                case 4:
                    videoEncodingProfile = VideoEncodingQuality.Pal;
                    break;
                case 5:
                    videoEncodingProfile = VideoEncodingQuality.Vga;
                    break;
                case 6:
                    videoEncodingProfile = VideoEncodingQuality.Qvga;
                    break;
            }

            switch (_OutputType)
            {
                case "AVI":
                    _Profile = MediaEncodingProfile.CreateAvi(videoEncodingProfile);
                    break;
                case "WMV":
                    _Profile = MediaEncodingProfile.CreateWmv(videoEncodingProfile);
                    break;
                default:
                    _Profile = Windows.Media.MediaProperties.MediaEncodingProfile.CreateMp4(videoEncodingProfile);
                    break;
            }

            /*
            For transcoding to audio profiles, create the encoding profile using one of these APIs:
                MediaEncodingProfile.CreateMp3(audioEncodingProfile)
                MediaEncodingProfile.CreateM4a(audioEncodingProfile)
                MediaEncodingProfile.CreateWma(audioEncodingProfile)
                MediaEncodingProfile.CreateWav(audioEncodingProfile)

            where audioEncodingProfile is one of these presets:
                AudioEncodingQuality.High
                AudioEncodingQuality.Medium
                AudioEncodingQuality.Low
            */
        }

void InputPauseButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 375 of file Scenario3_Trim.xaml.cs.

        {
            InputVideo.Pause();
        }

void InputPlayButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 359 of file Scenario3_Trim.xaml.cs.

        {
            if (InputVideo.DefaultPlaybackRate == 0)
            {
                InputVideo.DefaultPlaybackRate = 1.0;
                InputVideo.PlaybackRate = 1.0;
            }

            InputVideo.Play();
        }

void InputStopButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 370 of file Scenario3_Trim.xaml.cs.

        {
            InputVideo.Stop();
        }

void MarkIn | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 202 of file Scenario3_Trim.xaml.cs.

        {
            _Start = InputVideo.Position;
            StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
            // Make sure end time is after start time.
            if ((_Start.CompareTo(_Stop) > 0) || (_Start.CompareTo(_Stop) == 0 && _Start != _c_sec0))
            {
                _Stop = _Start.Add(_c_sec1);
                EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
            }
        }

void MarkOut | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 214 of file Scenario3_Trim.xaml.cs.

        {
            _Stop = InputVideo.Position;
            EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
            // Make sure end time is after start time.
            if ((_Start.CompareTo(_Stop) > 0) || (_Start.CompareTo(_Stop) == 0 && _Start != _c_sec0))
            {
                if (_Stop.CompareTo(_c_sec1) > 0)
                {
                    _Start = _Stop.Subtract(_c_sec1);
                }
                else
                {
                    _Start = _c_sec0;
                }
                StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 91 of file Scenario3_Trim.xaml.cs.

        {
        }

void OnTargetFormatChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 335 of file Scenario3_Trim.xaml.cs.

        {
            switch (TargetFormat.SelectedIndex)
            {
                case 1:
                    _OutputFileExtension = ".wmv";
                    _OutputType = "WMV";
                    EnableNonSquarePARProfiles();
                    break;
                case 2:
                    _OutputFileExtension = ".avi";
                    _OutputType = "AVI";

                    // Disable NTSC and PAL profiles as non-square pixel aspect ratios are not supported by AVI
                    DisableNonSquarePARProfiles();
                    break;
                default:
                    _OutputFileExtension = ".mp4";
                    _OutputType = "MP4";
                    EnableNonSquarePARProfiles();
                    break;
            }
        }

async void OutputPathText ( string text ) [inline, private]

Definition at line 537 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputPath.Text = text;
            });
        }

void OutputPauseButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 396 of file Scenario3_Trim.xaml.cs.

        {
            OutputVideo.Pause();
        }

void OutputPlayButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 380 of file Scenario3_Trim.xaml.cs.

        {
            if (OutputVideo.DefaultPlaybackRate == 0)
            {
                OutputVideo.DefaultPlaybackRate = 1.0;
                OutputVideo.PlaybackRate = 1.0;
            }

            OutputVideo.Play();
        }

void OutputStopButton_Click | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 391 of file Scenario3_Trim.xaml.cs.

        {
            OutputVideo.Stop();
        }

async void OutputText ( string text ) [inline, private]

Definition at line 528 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputMsg.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green);
                OutputMsg.Text = text;
            });
        }

async void PickFile | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 299 of file Scenario3_Trim.xaml.cs.

        {
            Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".wmv");
            picker.FileTypeFilter.Add(".mp4");

            Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

                _InputFile = file;
                InputVideo.SetSource(stream, file.ContentType);
                InputVideo.Play();

                // Enable buttons
                EnableButtons();
            }
        }

async void PickOutput | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 320 of file Scenario3_Trim.xaml.cs.

        {
            FileSavePicker picker = new FileSavePicker();
            picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            picker.SuggestedFileName = _OutputFileName;
            picker.FileTypeChoices.Add(_OutputType, new System.Collections.Generic.List<string>() { _OutputFileExtension });

            _OutputFile = await picker.PickSaveFileAsync();

            if (_OutputFile != null)
            {
                SetTranscodeButton(true);
            }
        }

async void PlayFile ( Windows.Storage.StorageFile MediaFile ) [inline, private]

Definition at line 499 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                try
                {
                    Windows.Storage.Streams.IRandomAccessStream stream = await MediaFile.OpenAsync(FileAccessMode.Read);
                    OutputVideo.SetSource(stream, MediaFile.ContentType);
                    OutputVideo.Play();
                }
                catch (Exception exception)
                {
                    TranscodeError(exception.Message);
                }
            });
        }

void SetCancelButton ( bool isEnabled ) [inline, private]

Definition at line 425 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Cancel.IsEnabled = isEnabled;
            });
        }

void SetOutputFileButton ( bool isEnabled ) [inline, private]

Definition at line 409 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                SetOutputButton.IsEnabled = isEnabled;
            });
        }

void SetPickFileButton ( bool isEnabled ) [inline, private]

Definition at line 401 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PickFileButton.IsEnabled = isEnabled;
            });
        }

void SetTranscodeButton ( bool isEnabled ) [inline, private]

Definition at line 417 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Transcode.IsEnabled = isEnabled;
            });
        }

void StopPlayers ( ) [inline, private]

Definition at line 484 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (InputVideo.CurrentState != MediaElementState.Paused)
                {
                    InputVideo.Pause();
                }
                if (OutputVideo.CurrentState != MediaElementState.Paused)
                {
                    OutputVideo.Pause();
                }
            });
        }

async void TranscodeCancel | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 252 of file Scenario3_Trim.xaml.cs.

        {
            try
            {
                _cts.Cancel();
                _cts.Dispose();
                _cts = new CancellationTokenSource();

                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

async void TranscodeComplete ( ) [inline, private]

Definition at line 238 of file Scenario3_Trim.xaml.cs.

        {
            OutputText("Transcode completed.");
            OutputPathText("Output (" + _OutputFile.Path + ")");
            Windows.Storage.Streams.IRandomAccessStream stream = await _OutputFile.OpenAsync(Windows.Storage.FileAccessMode.Read);
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputVideo.SetSource(stream, _OutputFile.ContentType);
            });

            EnableButtons();
            SetCancelButton(false);
        }

async void TranscodeError ( string error ) [inline, private]

Definition at line 516 of file Scenario3_Trim.xaml.cs.

        {
            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                StatusMessage.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Red);
                StatusMessage.Text = error;
            });

            EnableButtons();
            SetCancelButton(false);
        }

void TranscodeFailure ( TranscodeFailureReason reason ) [inline, private]

Definition at line 271 of file Scenario3_Trim.xaml.cs.

        {
            try
            {
                if (_OutputFile != null)
                {
                    await _OutputFile.DeleteAsync();
                }
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }

            switch (reason)
            {
                case TranscodeFailureReason.CodecNotFound:
                    TranscodeError("Codec not found.");
                    break;
                case TranscodeFailureReason.InvalidProfile:
                    TranscodeError("Invalid profile.");
                    break;
                default:
                    TranscodeError("Unknown failure.");
                    break;
            }
        }

void TranscodeProgress ( double percent ) [inline, private]

Definition at line 233 of file Scenario3_Trim.xaml.cs.

        {
            OutputText("Progress:  " + percent.ToString().Split('.')[0] + "%");
        }

async void TranscodeTrim | ( | Object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 95 of file Scenario3_Trim.xaml.cs.

        {
            StopPlayers();
            DisableButtons();
            GetPresetProfile(ProfileSelect);

            // Clear messages
            StatusMessage.Text = "";

            _Transcoder.TrimStartTime = _Start;
            _Transcoder.TrimStopTime = _Stop;

            try
            {
                if (_InputFile != null && _OutputFile != null)
                {
                    var preparedTranscodeResult = await _Transcoder.PrepareFileTranscodeAsync(_InputFile, _OutputFile, _Profile);

                    if (EnableMrfCrf444.IsChecked.HasValue && (bool)EnableMrfCrf444.IsChecked)
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.MrfCrf444;
                    }
                    else
                    {
                        _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.Default;
                    }

                    if (preparedTranscodeResult.CanTranscode)
                    {
                        SetCancelButton(true);
                        var progress = new Progress<double>(TranscodeProgress);
                        await preparedTranscodeResult.TranscodeAsync().AsTask(_cts.Token, progress);
                        TranscodeComplete();
                    }
                    else
                    {
                        TranscodeFailure(preparedTranscodeResult.FailureReason);
                    }
                }
            }
            catch (TaskCanceledException)
            {
                OutputText("");
                TranscodeError("Transcode Canceled");
            }
            catch (Exception exception)
            {
                TranscodeError(exception.Message);
            }
        }

Member Data Documentation

TimeSpan _c_sec0 = new TimeSpan(0, 0, 0) [private]

Definition at line 42 of file Scenario3_Trim.xaml.cs.

TimeSpan _c_sec1 = new TimeSpan(0, 0, 1) [private]

Definition at line 43 of file Scenario3_Trim.xaml.cs.

CancellationTokenSource _cts [private]

Definition at line 31 of file Scenario3_Trim.xaml.cs.

Windows.UI.Core.CoreDispatcher _dispatcher = Window.Current.Dispatcher [private]

Definition at line 30 of file Scenario3_Trim.xaml.cs.

Windows.Storage.StorageFile _InputFile = null [private]

Definition at line 34 of file Scenario3_Trim.xaml.cs.

Windows.Storage.StorageFile _OutputFile = null [private]

Definition at line 35 of file Scenario3_Trim.xaml.cs.

string _OutputFileExtension = ".mp4" [private]

Definition at line 38 of file Scenario3_Trim.xaml.cs.

string _OutputFileName = "TranscodeSampleOutput" [private]

Definition at line 32 of file Scenario3_Trim.xaml.cs.

string _OutputType = "MP4" [private]

Definition at line 37 of file Scenario3_Trim.xaml.cs.

Windows.Media.MediaProperties.MediaEncodingProfile _Profile [private]

Definition at line 33 of file Scenario3_Trim.xaml.cs.

TimeSpan _Start = new TimeSpan(0) [private]

Definition at line 40 of file Scenario3_Trim.xaml.cs.

TimeSpan _Stop = new TimeSpan(0) [private]

Definition at line 41 of file Scenario3_Trim.xaml.cs.

Windows.Media.Transcoding.MediaTranscoder _Transcoder = new Windows.Media.Transcoding.MediaTranscoder() [private]

Definition at line 36 of file Scenario3_Trim.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario3_Trim.xaml.cs.

The documentation for this class was generated from the following files:
  • MediaTranscoding/cs/Scenario3_Trim.xaml.cs
  • MediaTranscoding/cpp/Scenario3_Trim.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_UnmanagedConsumable Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_UnmanagedConsumable
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_UnmanagedConsumable Class Reference

List of all members.

Public Member Functions

Scenario3_UnmanagedConsumable ()

Private Member Functions

async void | FulfillConsumableButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetConsumableBalanceButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetUnmanagedConsumablesButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | PurchaseAddOnButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()

Detailed Description

Definition at line 18 of file Scenario3_UnmanagedConsumable.xaml.cs.

Constructor & Destructor Documentation

Scenario3_UnmanagedConsumable ( ) [inline]

Definition at line 23 of file Scenario3_UnmanagedConsumable.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void FulfillConsumableButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 112 of file Scenario3_UnmanagedConsumable.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            // This can be used to ensure this request is never double fulfilled. The server will
            // accept only one report for this specific GUID.
            Guid trackingId = Guid.NewGuid();

            // Always use quantity of "1" to fulfill an Unmanaged consumable
            StoreConsumableResult result = await storeContext.ReportConsumableFulfillmentAsync(item.StoreId, 1, trackingId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StoreConsumableStatus.InsufficentQuantity:
                    rootPage.NotifyUser($"Insufficient Quantity! Balance Remaining: {result.BalanceRemaining}", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.Succeeded:
                    rootPage.NotifyUser($"Successful fulfillment! Balance Remaining: {result.BalanceRemaining}", NotifyType.StatusMessage);
                    break;

                case StoreConsumableStatus.NetworkError:
                    rootPage.NotifyUser("Network error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.ServerError:
                    rootPage.NotifyUser("Server error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Unknown error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;
            }
        }

async void GetConsumableBalanceButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 77 of file Scenario3_UnmanagedConsumable.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            StoreConsumableResult result = await storeContext.GetConsumableBalanceRemainingAsync(item.StoreId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StoreConsumableStatus.InsufficentQuantity: // should never get this...
                    rootPage.NotifyUser($"Insufficient Quantity! Balance Remaining: {result.BalanceRemaining}", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.Succeeded:
                    rootPage.NotifyUser($"Balance Remaining: {result.BalanceRemaining}", NotifyType.StatusMessage);
                    break;

                case StoreConsumableStatus.NetworkError:
                    rootPage.NotifyUser("Network error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.ServerError:
                    rootPage.NotifyUser("Server error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Unknown error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;
            }
        }

async void GetUnmanagedConsumablesButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario3_UnmanagedConsumable.xaml.cs.

        {
            string[] filterList = new string[] { "UnmanagedConsumable" };

            // Get list of Add Ons this app can sell, filtering for the types we know about.
            StoreProductQueryResult addOns = await storeContext.GetAssociatedStoreProductsAsync(filterList);

            ProductsListView.ItemsSource = Utils.CreateProductListFromQueryResult(addOns, "UnmanagedConsumable Add-Ons");
        }

async void PurchaseAddOnButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario3_UnmanagedConsumable.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            var result = await storeContext.RequestPurchaseAsync(item.StoreId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StorePurchaseStatus.AlreadyPurchased:
                    rootPage.NotifyUser($"You already bought this consumable and must fulfill it.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.Succeeded:
                    rootPage.NotifyUser($"You bought {item.Title}.", NotifyType.StatusMessage);
                    break;

                case StorePurchaseStatus.NotPurchased:
                    rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.NetworkError:
                    rootPage.NotifyUser("Product was not purchased due to a network error.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.ServerError:
                    rootPage.NotifyUser("Product was not purchased due to a server error.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Product was not purchased due to an unknown error.", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario3_UnmanagedConsumable.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 21 of file Scenario3_UnmanagedConsumable.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario3_UnmanagedConsumable.xaml.cs
  • Store/cpp/Scenario3_UnmanagedConsumable.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_UsingWindows Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario3_UsingWindows
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario3_UsingWindows Class Reference

List of all members.

Public Member Functions

Scenario3_UsingWindows ()
bool | CanCreateNewWindow (ObservableCollection< WindowInfo > windowsList)
bool | CanDestroyWindow (object item)
bool | IsNonNull (object item)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection< WindowInfo > | WindowList [get]

Private Member Functions

void | DestroyWindowButton_Click (object sender, RoutedEventArgs e)
async void | DisplayTextButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeAsync ()
async void | NewWindowButton_Click (object sender, RoutedEventArgs e)
async void | RefreshWindowButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedLineDisplay | lineDisplay
uint | maxWindows = 0
int | nextWindowId = new ObservableCollection<WindowInfo>() 0
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 36 of file Scenario3_UsingWindows.xaml.cs.

Constructor & Destructor Documentation

Scenario3_UsingWindows ( ) [inline]

Definition at line 46 of file Scenario3_UsingWindows.xaml.cs.

        {
            this.InitializeComponent();
            DataContext = this;
        }

Member Function Documentation

bool CanCreateNewWindow ( ObservableCollection< WindowInfo > windowsList )
bool CanDestroyWindow ( object item )
void DestroyWindowButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 176 of file Scenario3_UsingWindows.xaml.cs.

        {
            var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
            WindowList.RemoveAt(WindowsListBox.SelectedIndex);

            // The LineDisplayWindow class implements IDispose. Disposing of a LineDisplayWindow
            // results in its destruction on the line display device and invalidation of the object.
            targetWindow.Window.Dispose();

            rootPage.NotifyUser($"Destroyed window {targetWindow.Id}.", NotifyType.StatusMessage);
        }

async void DisplayTextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 188 of file Scenario3_UsingWindows.xaml.cs.

        {
            var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
            if (await targetWindow.Window.TryDisplayTextAsync(DisplayTextTextbox.Text))
            {
                rootPage.NotifyUser($"Displayed \"{DisplayTextTextbox.Text}\" to window {targetWindow.Id}.", NotifyType.StatusMessage);
            }
            else
            {
                // We probably lost our claim.
                rootPage.NotifyUser($"Failed to display to window {targetWindow.Id}.", NotifyType.ErrorMessage);
            }
        }

task< void > InitializeAsync ( ) [inline, private]

Definition at line 63 of file Scenario3_UsingWindows.xaml.cs.

        {
            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();

            maxWindows = (lineDisplay == null) ? 0 : lineDisplay.Capabilities.SupportedWindows;
            if (maxWindows >= 1)
            {
                // Create an entry to represent the default window.
                WindowList.Add(new WindowInfo(lineDisplay.DefaultWindow, nextWindowId));
                nextWindowId++;
            }
        }

bool IsNonNull ( object item )
async void NewWindowButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 76 of file Scenario3_UsingWindows.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            Rect viewportBounds = new Rect()
            {
                X = Helpers.ParseUIntWithFallback(NewViewportX, -1.0),
                Y = Helpers.ParseUIntWithFallback(NewViewportY, -1.0),
                Width = Helpers.ParseUIntWithFallback(NewViewportWidth, 0.0),
                Height = Helpers.ParseUIntWithFallback(NewViewportHeight, 0.0),
            };

            if ((viewportBounds.Width <= 0) || (viewportBounds.Height <= 0))
            {
                rootPage.NotifyUser("Viewport size must be be positive.", NotifyType.ErrorMessage);
                return;
            }

            // Viewport cannot extend beyond the screen.
            Size screenSizeInCharacters = lineDisplay.GetAttributes().ScreenSizeInCharacters;
            if ((viewportBounds.X < 0) || (viewportBounds.Y < 0) ||
                (viewportBounds.X + viewportBounds.Width > screenSizeInCharacters.Width) ||
                (viewportBounds.Y + viewportBounds.Height > screenSizeInCharacters.Height))
            {
                rootPage.NotifyUser("Viewport cannot extend beyond the screen.", NotifyType.ErrorMessage);
                return;
            }

            Size windowSize = new Size()
            {
                Width = Helpers.ParseUIntWithFallback(NewWindowWidth, 0.0),
                Height = Helpers.ParseUIntWithFallback(NewWindowHeight, 0.0),
            };

            if ((windowSize.Width <= 0) || (windowSize.Height <= 0))
            {
                rootPage.NotifyUser("Window size must be be positive.", NotifyType.ErrorMessage);
                return;
            }

            // Windows must be at least as large as their viewports.
            if ((viewportBounds.Width > windowSize.Width) || (viewportBounds.Height > windowSize.Height))
            {
                rootPage.NotifyUser("Window must be at least as large as viewport.", NotifyType.ErrorMessage);
                return;
            }

            // Window taller than viewport requires IsVerticalMarqueeSupported.
            if ((windowSize.Height > viewportBounds.Height) && !lineDisplay.Capabilities.IsVerticalMarqueeSupported)
            {
                rootPage.NotifyUser("Window cannot be taller than viewport on this line display.", NotifyType.ErrorMessage);
                return;
            }

            // Window wider than viewport requires IsHorizontalMarqueeSupported.
            if ((windowSize.Width > viewportBounds.Width) && !lineDisplay.Capabilities.IsHorizontalMarqueeSupported)
            {
                rootPage.NotifyUser("Window cannot be wider than viewport on this line display.", NotifyType.ErrorMessage);
                return;
            }

            // Window cannot be larger than viewport in both directions.
            // (Two-dimensional scrolling is not supported.)
            if ((windowSize.Width > viewportBounds.Width) && (windowSize.Height > viewportBounds.Height))
            {
                rootPage.NotifyUser("Window cannot be larger than viewport in both dimensions.", NotifyType.ErrorMessage);
                return;
            }

            LineDisplayWindow newWindow = await lineDisplay.TryCreateWindowAsync(viewportBounds, windowSize);

            if (newWindow != null)
            {
                var newWindowInfo = new WindowInfo(newWindow, nextWindowId);
                WindowList.Add(newWindowInfo);
                nextWindowId++;

                rootPage.NotifyUser($"Created window {newWindowInfo.Id}.", NotifyType.StatusMessage);
            }
            else
            {
                // We probably lost our claim.
                rootPage.NotifyUser("Failed to create a new window", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 57 of file Scenario3_UsingWindows.xaml.cs.

        {
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario3_UsingWindows.xaml.cs.

        {
            await InitializeAsync();
        }

async void RefreshWindowButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 162 of file Scenario3_UsingWindows.xaml.cs.

        {
            var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
            if (await targetWindow.Window.TryRefreshAsync())
            {
                rootPage.NotifyUser($"Refreshed window {targetWindow.Id}.", NotifyType.StatusMessage);
            }
            else
            {
                // We probably lost our claim.
                rootPage.NotifyUser($"Failed to refresh window {targetWindow.Id}.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ClaimedLineDisplay lineDisplay [private]

Definition at line 39 of file Scenario3_UsingWindows.xaml.cs.

uint maxWindows = 0 [private]

Definition at line 44 of file Scenario3_UsingWindows.xaml.cs.

int nextWindowId = new ObservableCollection<WindowInfo>() 0 [private]

Definition at line 43 of file Scenario3_UsingWindows.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 38 of file Scenario3_UsingWindows.xaml.cs.

Property Documentation

ObservableCollection<WindowInfo> WindowList [get]

Definition at line 41 of file Scenario3_UsingWindows.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario3_UsingWindows.xaml.cs
  • LineDisplay/cpp/Scenario3_UsingWindows.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

TextBlock | CreateLineItemTextBlock (string contents)
async void | GetFilesButton_Click (object sender, RoutedEventArgs e)
async void | GetThumbnailButton_Click (object sender, RoutedEventArgs e)
void | InertiaSwitch_Toggled (object sender, RoutedEventArgs e)
void | InitManipulationTransforms ()
void | InitOptions ()
void | ManipulateMe_ManipulationCompleted (object sender, ManipulationCompletedRoutedEventArgs e)
void | ManipulateMe_ManipulationDelta (object sender, ManipulationDeltaRoutedEventArgs e)
void | ManipulateMe_ManipulationInertiaStarting (object sender, ManipulationInertiaStartingRoutedEventArgs e)
void | ManipulateMe_ManipulationStarted (object sender, ManipulationStartedRoutedEventArgs e)
void | movementAxis_Changed (object sender, SelectionChangedEventArgs e)
void | myMap_Loaded (object sender, RoutedEventArgs e)
void | OnClear (object sender, RoutedEventArgs e)
async void | OnRecognizeAsync (object sender, RoutedEventArgs e)
void | OnRecognizerChanged (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
async void | ReadBytesButton_Click (object sender, RoutedEventArgs e)
void | RecoButton_Click (object sender, RoutedEventArgs e)
void | resetButton_Pressed (object sender, RoutedEventArgs e)
void | SetDefaultRecognizerByCurrentInputMethodLanguageTag ()
bool | SetRecognizerByName (string recognizerName)
async void | showSpaceNeedleButton_Click (object sender, RoutedEventArgs e)
void | TextServiceManager_InputLanguageChanged (CoreTextServicesManager sender, object args)
void | TrackButton_Click (object sender, RoutedEventArgs e)
async void | VideoTracks_SelectedIndexChanged (ISingleSelectMediaTrackList sender, object args)
async void | WriteBytesButton_Click (object sender, RoutedEventArgs e)

Private Attributes

CompositeTransform | deltaTransform
bool | forceManipulationsToEnd
InkRecognizerContainer | inkRecognizerContainer = null
MediaPlaybackItem | item
MediaPlaybackItemLogger | mpiLogger
Language | previousInputLanguage = null
MatrixTransform | previousTransform
IReadOnlyList< InkRecognizer > | recoView = null
MainPage rootPage = MainPage.Current
CoreTextServicesManager | textServiceManager = null
TransformGroup | transforms

Detailed Description

Demonstrates multi-track video playback and camera selection.

This page shows the code to do ink recognition.

Writing and reading bytes in a file.

Definition at line 22 of file scenario4.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 28 of file scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4 ( ) [inline]

Definition at line 27 of file 4-XAMLManipulations.xaml.cs.

        {
            this.InitializeComponent();
            forceManipulationsToEnd = false;

            InitOptions();

            // Initialize the transforms that will be used to manipulate the shape
            InitManipulationTransforms();

            // Register for the various manipulation events that will occur on the shape
            manipulateMe.ManipulationStarted += new ManipulationStartedEventHandler(ManipulateMe_ManipulationStarted);
            manipulateMe.ManipulationDelta += new ManipulationDeltaEventHandler(ManipulateMe_ManipulationDelta);
            manipulateMe.ManipulationCompleted += new ManipulationCompletedEventHandler(ManipulateMe_ManipulationCompleted);
            manipulateMe.ManipulationInertiaStarting += new ManipulationInertiaStartingEventHandler(ManipulateMe_ManipulationInertiaStarting);

            // The ManipulationMode property dictates what manipulation events the element
            // will listen to.  This will set it to a limited subset of these events.
            manipulateMe.ManipulationMode =
                ManipulationModes.TranslateX |
                ManipulationModes.TranslateY |
                ManipulationModes.Rotate |
                ManipulationModes.TranslateInertia |
                ManipulationModes.RotateInertia;
        }

Scenario4 ( ) [inline]

Definition at line 29 of file Scenario4_Bytes.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4 ( ) [inline]

Definition at line 26 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4 ( ) [inline]

Definition at line 26 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4 ( ) [inline]

Definition at line 34 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4 ( ) [inline]

Definition at line 34 of file Scenario4.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize drawing attributes. These are used in inking mode.
            InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
            drawingAttributes.Color = Windows.UI.Colors.Red;
            double penSize = 4;
            drawingAttributes.Size = new Windows.Foundation.Size(penSize, penSize);
            drawingAttributes.IgnorePressure = false;
            drawingAttributes.FitToCurve = true;

            // Show the available recognizers
            inkRecognizerContainer = new InkRecognizerContainer();
            recoView = inkRecognizerContainer.GetRecognizers();
            if (recoView.Count > 0)
            {
                foreach (InkRecognizer recognizer in recoView)
                {
                    RecoName.Items.Add(recognizer.Name);
                }
            }
            else
            {
                RecoName.IsEnabled = false;
                RecoName.Items.Add("No Recognizer Available");
            }
            RecoName.SelectedIndex = 0;
            // Set the text services so we can query when language changes
            textServiceManager = CoreTextServicesManager.GetForCurrentView();
            SetDefaultRecognizerByCurrentInputMethodLanguageTag();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
            inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch;
        }

Scenario4 ( ) [inline]

Definition at line 32 of file Scenario4_SelectingVideoTracks.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

TextBlock CreateLineItemTextBlock ( string contents ) [inline, private]

Definition at line 74 of file Scenario4.xaml.cs.

        {
            TextBlock textBlock = new TextBlock();
            textBlock.Text = contents;
            textBlock.Style = (Style)Application.Current.Resources["BasicTextStyle"];
            textBlock.TextWrapping = TextWrapping.Wrap;
            return textBlock;
        }

async void GetFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file Scenario4.xaml.cs.

        {
            // Reset output.
            OutputPanel.Children.Clear();

            // Ask the user to pick a folder.
            FolderPicker picker = new FolderPicker();
            picker.FileTypeFilter.Add("*");
            picker.ViewMode = PickerViewMode.List;
            picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            StorageFolder folder = await picker.PickSingleFolderAsync();
            if (folder != null)
            {
                // Query the folder.
                var query = folder.CreateFileQuery();
                var fileList = await query.GetFilesAsync();

                // Display file list with storage provider and availability.
                foreach (StorageFile file in fileList)
                {
                    // Create an entry in the list for the item.
                    var line = file.Name;

                    // Show the item's provider (This PC, OneDrive, Network, or Application Content).
                    line += ": On " + file.Provider.DisplayName;

                    // Show if the item is available (OneDrive items are usually available when
                    // online or when they are marked for "always available offline").
                    line += " (";
                    if (file.IsAvailable)
                    {
                        line += "available";
                    }
                    else
                    {
                        line += "not available";
                    }
                    line += ")";
                    OutputPanel.Children.Add(CreateLineItemTextBlock(line));
                }
            }
        }

async void GetThumbnailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario4.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);

            // Pick a folder
            FolderPicker folderPicker = new FolderPicker();
            foreach (string extension in FileExtensions.Image)
            {
                folderPicker.FileTypeFilter.Add(extension);
            }

            StorageFolder folder = await folderPicker.PickSingleFolderAsync();
            if (folder != null)
            {
                const ThumbnailMode thumbnailMode = ThumbnailMode.PicturesView;
                const uint size = 200;
                using (StorageItemThumbnail thumbnail = await folder.GetThumbnailAsync(thumbnailMode, size))
                {
                    if (thumbnail != null)
                    {
                        MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, folder, thumbnail, false);
                    }
                    else
                    {
                        rootPage.NotifyUser(Errors.NoImages, NotifyType.StatusMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
            }
        }

void InertiaSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 130 of file 4-XAMLManipulations.xaml.cs.

        {
            // Flip the current TranslateInertia and RotateInertia values in response to the
            // InertiaSwitch being toggled
            if (manipulateMe != null)
            {
                manipulateMe.ManipulationMode ^= ManipulationModes.TranslateInertia | ManipulationModes.RotateInertia;
            }
        }

void InitManipulationTransforms ( ) [inline, private]

Definition at line 53 of file 4-XAMLManipulations.xaml.cs.

        {
            transforms = new TransformGroup();
            previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
            deltaTransform = new CompositeTransform();

            transforms.Children.Add(previousTransform);
            transforms.Children.Add(deltaTransform);

            // Set the render transform on the rect
            manipulateMe.RenderTransform = transforms;
        }

void InitOptions ( ) [inline, private]

Definition at line 143 of file 4-XAMLManipulations.xaml.cs.

        {
            movementAxis.SelectedIndex = 0;
            inertiaSwitch.IsOn = true;
        }

void ManipulateMe_ManipulationCompleted | ( | object | sender,
 |  | ManipulationCompletedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file 4-XAMLManipulations.xaml.cs.

        {
            manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
        }

void ManipulateMe_ManipulationDelta | ( | object | sender,
 |  | ManipulationDeltaRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file 4-XAMLManipulations.xaml.cs.

        {
            // If the reset button has been pressed, mark the manipulation as completed
            if (forceManipulationsToEnd)
            {
                e.Complete();
                return;
            }

            previousTransform.Matrix = transforms.Value;

            // Get center point for rotation
            Point center = previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
            deltaTransform.CenterX = center.X;
            deltaTransform.CenterY = center.Y;

            // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
            // the rotation, scale, X, and Y changes
            deltaTransform.Rotation = e.Delta.Rotation;
            deltaTransform.TranslateX = e.Delta.Translation.X;
            deltaTransform.TranslateY = e.Delta.Translation.Y;
        }

void ManipulateMe_ManipulationInertiaStarting | ( | object | sender,
 |  | ManipulationInertiaStartingRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 100 of file 4-XAMLManipulations.xaml.cs.

        {
            manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
        }

void ManipulateMe_ManipulationStarted | ( | object | sender,
 |  | ManipulationStartedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file 4-XAMLManipulations.xaml.cs.

        {
            forceManipulationsToEnd = false;
            manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
        }

void movementAxis_Changed | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file 4-XAMLManipulations.xaml.cs.

        {
            // Set the object to listen to both X and Y translation events
            manipulateMe.ManipulationMode |= ManipulationModes.TranslateX | ManipulationModes.TranslateY;

            ComboBoxItem selectedItem = (ComboBoxItem)((ComboBox)sender).SelectedItem;
            switch (selectedItem.Content.ToString())
            {
                case "X only":
                    // Set the object to not listen for translations on the Y axis
                    manipulateMe.ManipulationMode ^= ManipulationModes.TranslateY;
                    break;
                case "Y only":
                    // Set the object to not listen for translations on the X axis
                    manipulateMe.ManipulationMode ^= ManipulationModes.TranslateX;
                    break;
            }
        }

void myMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario4.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 12;
        }

void OnClear | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 130 of file Scenario4.xaml.cs.

        {
            inkCanvas.InkPresenter.StrokeContainer.Clear();
            rootPage.NotifyUser("Cleared Canvas.", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario4_SelectingVideoTracks.xaml.cs.

        {
            mpiLogger?.Dispose();
            mpiLogger = null;
            MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 38 of file scenario4.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario4_SelectingVideoTracks.xaml.cs.

        {
            this.item = new MediaPlaybackItem(MediaSource.CreateFromUri(rootPage.MultiTrackVideoMediaUri));
            mpiLogger = new MediaPlaybackItemLogger(LoggerControl, item);

            item.VideoTracks.SelectedIndexChanged += VideoTracks_SelectedIndexChanged;

            this.mediaPlayerElement.Source = item;
            LoggerControl.Log($"Loaded: {rootPage.MultiTrackVideoMediaUri}");
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 71 of file Scenario4.xaml.cs.

        {
            // Registering handlers for InputLanguageChanged event
            textServiceManager.InputLanguageChanged += TextServiceManager_InputLanguageChanged;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario4_Bytes.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario4.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 77 of file Scenario4.xaml.cs.

        {
            InstallReco.IsOpen = false;
            textServiceManager.InputLanguageChanged -= TextServiceManager_InputLanguageChanged;
        }

async void OnRecognizeAsync | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 94 of file Scenario4.xaml.cs.

        {
            IReadOnlyList<InkStroke> currentStrokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
            if (currentStrokes.Count > 0)
            {
                RecognizeBtn.IsEnabled = false;
                ClearBtn.IsEnabled = false;
                RecoName.IsEnabled = false;

                var recognitionResults = await inkRecognizerContainer.RecognizeAsync(inkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All);

                if (recognitionResults.Count > 0)
                {
                    // Display recognition result
                    string str = "Recognition result:";
                    foreach (var r in recognitionResults)
                    {
                        str += " " + r.GetTextCandidates()[0];
                    }
                    rootPage.NotifyUser(str, NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("No text recognized.", NotifyType.StatusMessage);
                }

                RecognizeBtn.IsEnabled = true;
                ClearBtn.IsEnabled = true;
                RecoName.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser("Must first write something.", NotifyType.ErrorMessage);
            }
        }

void OnRecognizerChanged | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario4.xaml.cs.

        {
            string selectedValue = (string)RecoName.SelectedValue;
            SetRecognizerByName(selectedValue);
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 83 of file Scenario4.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, Output, inkCanvas);
        }

async void ReadBytesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario4_Bytes.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    IBuffer buffer = await FileIO.ReadBufferAsync(file);
                    string fileContent = MainPage.GetStringFromBuffer(buffer);
                    rootPage.NotifyUser($"The following {buffer.Length} bytes of text were read from '{file.Name}':\n{fileContent}", NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex) when (ex.HResult == MainPage.E_NO_UNICODE_TRANSLATION)
                {
                    rootPage.NotifyUser("File is not UTF-8 encoded.", NotifyType.ErrorMessage);
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error reading from '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

void RecoButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 189 of file Scenario4.xaml.cs.

        {
            InstallReco.IsOpen = !InstallReco.IsOpen;
        }

void resetButton_Pressed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 149 of file 4-XAMLManipulations.xaml.cs.

        {
            forceManipulationsToEnd = true;
            manipulateMe.RenderTransform = null;
            movementAxis.SelectedIndex = 0;
            InitOptions();
            InitManipulationTransforms();
        }

void SetDefaultRecognizerByCurrentInputMethodLanguageTag ( ) [inline, private]

Definition at line 163 of file Scenario4.xaml.cs.

        {
            // Query recognizer name based on current input method language tag (bcp47 tag)
            Language currentInputLanguage = textServiceManager.InputLanguage;

            if (currentInputLanguage != previousInputLanguage)
            {
                // try query with the full BCP47 name
                string recognizerName = RecognizerHelper.LanguageTagToRecognizerName(currentInputLanguage.LanguageTag);

                if (recognizerName != string.Empty)
                {
                    for (int index = 0; index < recoView.Count; index++)
                    {
                        if (recoView[index].Name == recognizerName)
                        {
                            inkRecognizerContainer.SetDefaultRecognizer(recoView[index]);
                            RecoName.SelectedIndex = index;
                            previousInputLanguage = currentInputLanguage;
                            break;
                        }
                    }
                }
            }
        }

bool SetRecognizerByName ( string recognizerName ) [inline, private]

Definition at line 136 of file Scenario4.xaml.cs.

        {
            bool recognizerFound = false;

            foreach (InkRecognizer reco in recoView)
            {
                if (recognizerName == reco.Name)
                {
                    inkRecognizerContainer.SetDefaultRecognizer(reco);
                    recognizerFound = true;
                    break;
                }
            }

            if (!recognizerFound && rootPage != null)
            {
                rootPage.NotifyUser("Could not find target recognizer.", NotifyType.ErrorMessage);
            }

            return recognizerFound;
        }

async void showSpaceNeedleButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario4.xaml.cs.

        {
            if (myMap.Is3DSupported)
            {
                myMap.Style = MapStyle.Aerial3DWithRoads;

                Geopoint spaceNeedlePoint = new Geopoint(new BasicGeoposition() { Latitude = 47.6204, Longitude = -122.3491 });

                MapScene spaceNeedleScene = MapScene.CreateFromLocationAndRadius(spaceNeedlePoint,
                                                                                400, /* show this many meters around */
                                                                                135, /* looking at it to the south east*/
                                                                                60 /* degrees pitch */);

                await myMap.TrySetSceneAsync(spaceNeedleScene);
            }
            else
            {
                string status = "3D views are not supported on this device.";
                rootPage.NotifyUser(status, NotifyType.ErrorMessage);
            }

        }

void TextServiceManager_InputLanguageChanged | ( | CoreTextServicesManager | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 158 of file Scenario4.xaml.cs.

        {
            SetDefaultRecognizerByCurrentInputMethodLanguageTag();
        }

void TrackButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario4_SelectingVideoTracks.xaml.cs.

        {
            // Get the video track index based on value of the 'tag' field
            var button = sender as Button;
            int videoTrackIndex = int.Parse(button.Tag as string);

            // Select the clicked camera track
            if (this.item != null && this.item.VideoTracks != null && this.item.VideoTracks.Count -1 >= videoTrackIndex)
            {
                this.item.VideoTracks.SelectedIndex = videoTrackIndex;
            }
        }

async void VideoTracks_SelectedIndexChanged | ( | ISingleSelectMediaTrackList | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario4_SelectingVideoTracks.xaml.cs.

        {
            var videoTrackIndex = sender.SelectedIndex;

            LoggerControl.Log("Switched to video track #" + (videoTrackIndex + 1)
                    + " | Id: " + this.item.VideoTracks[videoTrackIndex].Id
                    + " | Label: " + this.item.VideoTracks[videoTrackIndex].Label);

            // Forces a new frame to be rendered when we are paused.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                //Make sure to call the mediaPlayerElement on the UI thread:
                if (mediaPlayerElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
                    mediaPlayerElement.MediaPlayer.StepForwardOneFrame();
            });
        }

async void WriteBytesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario4_Bytes.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    string userContent = InputTextBox.Text;
                    IBuffer buffer = MainPage.GetBufferFromString(userContent);
                    await FileIO.WriteBufferAsync(file, buffer);
                    rootPage.NotifyUser(String.Format("The following {0} bytes of text were written to '{1}':{2}{3}", buffer.Length, file.Name, Environment.NewLine, userContent), NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser(String.Format("Error writing to '{0}': {1}", file.Name, ex.Message), NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

Member Data Documentation

CompositeTransform deltaTransform [private]

Definition at line 24 of file 4-XAMLManipulations.xaml.cs.

bool forceManipulationsToEnd [private]

Definition at line 25 of file 4-XAMLManipulations.xaml.cs.

InkRecognizerContainer inkRecognizerContainer = null [private]

Definition at line 29 of file Scenario4.xaml.cs.

MediaPlaybackItem item [private]

Definition at line 30 of file Scenario4_SelectingVideoTracks.xaml.cs.

MediaPlaybackItemLogger mpiLogger [private]

Definition at line 29 of file Scenario4_SelectingVideoTracks.xaml.cs.

Language previousInputLanguage = null [private]

Definition at line 31 of file Scenario4.xaml.cs.

MatrixTransform previousTransform [private]

Definition at line 23 of file 4-XAMLManipulations.xaml.cs.

IReadOnlyList<InkRecognizer> recoView = null [private]

Definition at line 30 of file Scenario4.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file scenario4.xaml.cs.

CoreTextServicesManager textServiceManager = null [private]

Definition at line 32 of file Scenario4.xaml.cs.

TransformGroup transforms [private]

Definition at line 22 of file 4-XAMLManipulations.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario4.xaml.cs
  • BasicInput/cs/4-XAMLManipulations.xaml.cs
  • FileAccess/cs/Scenario4_Bytes.xaml.cs
  • FileThumbnails/cs/Scenario4.xaml.cs
  • MapControl/cs/Scenario4.xaml.cs
  • SimpleInk/cs/Scenario4.xaml.cs
  • VideoPlayback/cs/Scenario4_SelectingVideoTracks.xaml.cs
  • FolderEnumeration/cs/Scenario4.xaml.cs
  • ApplicationResources/cpp/scenario4.xaml.cpp
  • BasicInput/cpp/4-XAMLManipulations.xaml.cpp
  • DatagramSocket/cpp/Scenario4.xaml.cpp
  • FileAccess/cpp/Scenario4_Bytes.xaml.cpp
  • FileThumbnails/cpp/Scenario4.xaml.cpp
  • FolderEnumeration/cpp/Scenario4.xaml.cpp
  • MapControl/cpp/Scenario4.xaml.cpp
  • SimpleInk/cpp/Scenario4.xaml.cpp
  • StreamSocket/cpp/Scenario4.xaml.cpp
  • WebSocket/cpp/Scenario4_PartialReadWrite.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_BackgroundActivity Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_BackgroundActivity
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_BackgroundActivity Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_BackgroundActivity ()

Public Attributes

const string | SampleBackgroundTaskEntryPoint = "Tasks.ActivitySensorBackgroundTask"
const string | SampleBackgroundTaskName = "ActivitySensorBackgroundTask"

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | RegisterBackgroundTask ()
async void | ScenarioRegisterTask (object sender, RoutedEventArgs e)
void | ScenarioUnregisterTask (object sender, RoutedEventArgs e)
async void | UpdateUIAsync (string status)

Private Attributes

Guid | ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196")
bool | registered = false
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario4_BackgroundActivity.xaml.cs.

Constructor & Destructor Documentation

Scenario4_BackgroundActivity ( ) [inline]

Definition at line 40 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for background task completion.

Parameters:
task | The task that is reporting completion.
args | The completion report arguments.

Definition at line 131 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            string status = "Completed";
            try
            {
                args.CheckResult();
            }
            catch (Exception e)
            {
                status = e.Message;
            }
            UpdateUIAsync(status);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 50 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == Scenario4_BackgroundActivity.SampleBackgroundTaskName)
                {
                    registered = true;
                    break;
                }
            }

            UpdateUIAsync(registered ? "Registered" : "Unregistered");
        }

void RegisterBackgroundTask ( ) [inline, private]

Registers the background task.

Definition at line 148 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            var builder = new BackgroundTaskBuilder()
            {
                Name = SampleBackgroundTaskName,
                TaskEntryPoint = SampleBackgroundTaskEntryPoint
            };

            const UInt32 reportIntervalMs = 3000; // 3 seconds
            var trigger = new ActivitySensorTrigger(reportIntervalMs);

            trigger.SubscribedActivities.Add(ActivityType.Walking);
            trigger.SubscribedActivities.Add(ActivityType.Running);
            trigger.SubscribedActivities.Add(ActivityType.Biking);

            builder.SetTrigger(trigger);

            BackgroundTaskRegistration task = builder.Register();
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);

            registered = true;
            UpdateUIAsync("Registered");
        }

async void ScenarioRegisterTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Register Task' button.

Parameters:
sender
e

Definition at line 69 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            // Determine if we can access activity sensors
            var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
            if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
            {
                // Determine if an activity sensor is present
                // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
                var activitySensor = await ActivitySensor.GetDefaultAsync();
                if (true||activitySensor != null)
                {
                    var status = await BackgroundExecutionManager.RequestAccessAsync();

                    if ((BackgroundAccessStatus.AlwaysAllowed == status) ||
                        (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == status))
                    {
                        RegisterBackgroundTask();
                    }
                    else
                    {
                        rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("No activity sensors found", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
            }
        }

void ScenarioUnregisterTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Unregister Task' button.

Parameters:
sender
e

Definition at line 108 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            // Loop through all background tasks and unregister any with SampleBackgroundTaskName
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (SampleBackgroundTaskName == cur.Value.Name)
                {
                    cur.Value.Unregister(true /*cancelTask*/);
                    registered = false;
                }
            }

            if (!registered)
            {
                UpdateUIAsync("Unregistered");
            }
        }

async void UpdateUIAsync ( string status ) [inline, private]

Updates the scenario UI.

Parameters:
status The status string to display.

Definition at line 176 of file Scenario4_BackgroundActivity.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ScenarioRegisterTaskButton.IsEnabled = !registered;
                ScenarioUnregisterTaskButton.IsEnabled = registered;
                ScenarioOutput_TaskRegistration.Text = status;

                var settings = ApplicationData.Current.LocalSettings;

                if (settings.Values.ContainsKey("ReportCount"))
                {
                    ScenarioOutput_ReportCount.Text = settings.Values["ReportCount"].ToString(); // stored as a string
                }
                if (settings.Values.ContainsKey("TaskStatus"))
                {
                    ScenarioOutput_TaskStatus.Text = settings.Values["TaskStatus"].ToString(); // stored as a string
                }
                if (settings.Values.ContainsKey("LastActivity"))
                {
                    ScenarioOutput_LastActivity.Text = (string)settings.Values["LastActivity"]; // stored as a string
                }
                if (settings.Values.ContainsKey("LastConfidence"))
                {
                    ScenarioOutput_LastConfidence.Text = (string)settings.Values["LastConfidence"]; // stored as a string
                }
                if (settings.Values.ContainsKey("LastTimestamp"))
                {
                    ScenarioOutput_LastTimestamp.Text = settings.Values["LastTimestamp"].ToString(); // stored as a string
                }
            });
        }

Member Data Documentation

Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196") [private]

Definition at line 33 of file Scenario4_BackgroundActivity.xaml.cs.

bool registered = false [private]

Definition at line 38 of file Scenario4_BackgroundActivity.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 37 of file Scenario4_BackgroundActivity.xaml.cs.

const string SampleBackgroundTaskEntryPoint = "Tasks.ActivitySensorBackgroundTask"

Definition at line 30 of file Scenario4_BackgroundActivity.xaml.cs.

const string SampleBackgroundTaskName = "ActivitySensorBackgroundTask"

Definition at line 29 of file Scenario4_BackgroundActivity.xaml.cs.

The documentation for this class was generated from the following files:
  • ActivitySensor/cs/Scenario4_BackgroundActivity.xaml.cs
  • ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeAdminKey Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ChangeAdminKey
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_ChangeAdminKey Class Reference

List of all members.

Public Member Functions

Scenario4_ChangeAdminKey ()

Private Member Functions

async void ChangeAdminKey_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 10 of file Scenario4_ChangeAdminKey.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ChangeAdminKey ( ) [inline]

Definition at line 14 of file Scenario4_ChangeAdminKey.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ChangeAdminKey_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'ChangeAdminKey' button.

Parameters:
sender
e

Definition at line 24 of file Scenario4_ChangeAdminKey.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;

            try
            {
                IBuffer newadminkey = CryptographicBuffer.GenerateRandom(MainPage.ADMIN_KEY_LENGTH_IN_BYTES);

                SmartCard card = await rootPage.GetSmartCard();
                SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);

                rootPage.NotifyUser("Changing smart card admin key...", NotifyType.StatusMessage);

                using (SmartCardChallengeContext context = await provisioning.GetChallengeContextAsync())
                {
                    IBuffer response = ChallengeResponseAlgorithm.CalculateResponse(context.Challenge, rootPage.AdminKey);

                    await context.ChangeAdministrativeKeyAsync(response, newadminkey);
                    rootPage.AdminKey = newadminkey;
                }

                rootPage.NotifyUser("Smart card change admin key operation completed.", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Changing smart card admin key operation failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 12 of file Scenario4_ChangeAdminKey.xaml.cs.

The documentation for this class was generated from the following files:
  • SmartCard/cs/Scenario4_ChangeAdminKey.xaml.cs
  • SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeSystemGroup Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ChangeSystemGroup
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario4_ChangeSystemGroup Class Reference

List of all members.

Public Member Functions

Scenario4_ChangeSystemGroup ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | PrepareSampleFiles_Click (object sender, RoutedEventArgs e)
async void | SystemGroup_Frequent_Click (object sender, RoutedEventArgs e)
async void | SystemGroup_None_Click (object sender, RoutedEventArgs e)
async void | SystemGroup_Recent_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 22 of file Scenario4_ChangeSystemGroup.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ChangeSystemGroup ( ) [inline]

Definition at line 24 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();
            switch(jumpList.SystemGroupKind)
            {
                case JumpListSystemGroupKind.Recent:
                    SystemGroup_Recent.IsChecked = true;
                    break;
                case JumpListSystemGroupKind.Frequent:
                    SystemGroup_Frequent.IsChecked = true;
                    break;
                case JumpListSystemGroupKind.None:
                    SystemGroup_None.IsChecked = true;
                    break;
            }
        }

async void PrepareSampleFiles_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            // NOTE: This is for the sake of the sample only. Real apps should allow
            // the system list to be populated by user activity.

            var localFolder = ApplicationData.Current.LocalFolder;
            for (int i = 0; i < 5; ++i)
            {
                string fileName = $"Temp{i}.ms-jumplist-sample";
                var file = await localFolder.CreateFileAsync(fileName, CreationCollisionOption.OpenIfExists);
                StorageApplicationPermissions.MostRecentlyUsedList.Add(file, "", RecentStorageItemVisibility.AppAndSystem);
            }
        }

async void SystemGroup_Frequent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();
            jumpList.SystemGroupKind = JumpListSystemGroupKind.Frequent;
            await jumpList.SaveAsync();
        }

async void SystemGroup_None_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();
            jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
            await jumpList.SaveAsync();
        }

async void SystemGroup_Recent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario4_ChangeSystemGroup.xaml.cs.

        {
            var jumpList = await JumpList.LoadCurrentAsync();
            jumpList.SystemGroupKind = JumpListSystemGroupKind.Recent;
            await jumpList.SaveAsync();
        }

The documentation for this class was generated from the following files:
  • JumpList/cs/Scenario4_ChangeSystemGroup.xaml.cs
  • JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CharacterGrouping Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_CharacterGrouping
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario4_CharacterGrouping Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_CharacterGrouping ()
void | AssignGroup_Click (object sender, RoutedEventArgs e)
void | GetGroups_Click (object sender, RoutedEventArgs e)

Private Member Functions

void | AddGroup (string label, UIElement element)

Private Attributes

CharacterGroupings | ActiveGroupings = null
Dictionary< string, UIElement > | groups = new Dictionary<string, UIElement>()
MainPage rootPage = MainPage.Current

Static Private Attributes

static readonly string | GlobeString = "\U0001F310"

Detailed Description

Definition at line 26 of file Scenario4_CharacterGrouping.xaml.cs.

Constructor & Destructor Documentation

Scenario4_CharacterGrouping ( ) [inline]

Definition at line 33 of file Scenario4_CharacterGrouping.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddGroup | ( | string | label,
 |  | UIElement | element |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario4_CharacterGrouping.xaml.cs.

        {
            groups.Add(label, element);
            GroupingsGrid.Items.Add(element);
        }

void AssignGroup_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 74 of file Scenario4_CharacterGrouping.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            if (ActiveGroupings == null)
            {
                rootPage.NotifyUser("Select a language first.", NotifyType.ErrorMessage);
                return;
            }
            if (String.IsNullOrEmpty(CandidateText.Text))
            {
                rootPage.NotifyUser("Enter text to assign to a group.", NotifyType.ErrorMessage);
                return;
            }
            string label = ActiveGroupings.Lookup(CandidateText.Text);
            if (!groups.TryGetValue(label, out UIElement element))
            {
                label = GlobeString;
                element = groups[GlobeString];
            }
            GroupingsGrid.SelectedItem = element;
            GroupingResult.Text = $"Group \"{label}\"";
            element.StartBringIntoView();
        }

void GetGroups_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Definition at line 44 of file Scenario4_CharacterGrouping.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            if (LanguageText.Text == "Default")
            {
                ActiveGroupings = new CharacterGroupings();
            }
            else if (Windows.Globalization.Language.IsWellFormed(LanguageText.Text))
            {
                ActiveGroupings = new CharacterGroupings(LanguageText.Text);
            }
            else
            {
                rootPage.NotifyUser("Invalid language tag.", NotifyType.ErrorMessage);
                return;
            }

            GroupingsGrid.Items.Clear();
            groups.Clear();
            foreach (CharacterGrouping grouping in ActiveGroupings)
            {
                // Save the "other" group for the end.
                if (!string.IsNullOrEmpty(grouping.Label))
                {
                    AddGroup(grouping.Label, new TextBlock { Text = grouping.Label });
                }
            }
            AddGroup(GlobeString, new SymbolIcon { Symbol = Symbol.Globe });
        }

Member Data Documentation

CharacterGroupings ActiveGroupings = null [private]

Definition at line 29 of file Scenario4_CharacterGrouping.xaml.cs.

readonly string GlobeString = "\U0001F310" [static, private]

Definition at line 31 of file Scenario4_CharacterGrouping.xaml.cs.

Dictionary<string, UIElement> groups = new Dictionary<string, UIElement>() [private]

Definition at line 30 of file Scenario4_CharacterGrouping.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario4_CharacterGrouping.xaml.cs.

The documentation for this class was generated from the following file:
  • LinguisticServices/cs/Scenario4_CharacterGrouping.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompactOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_CompactOverlay
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_CompactOverlay Class Reference

List of all members.

Public Member Functions

Scenario4_CompactOverlay ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | ShowWindowBtn_Click (object sender, RoutedEventArgs e)

Private Attributes

AppWindow | appWindow
Frame | appWindowFrame = new Frame()

Detailed Description

Definition at line 22 of file Scenario4_CompactOverlay.xaml.cs.

Constructor & Destructor Documentation

Scenario4_CompactOverlay ( ) [inline]

Definition at line 27 of file Scenario4_CompactOverlay.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario4_CompactOverlay.xaml.cs.

        {
            if (appWindow != null)
            {
                await appWindow.CloseAsync();
            }
        }

async void ShowWindowBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 40 of file Scenario4_CompactOverlay.xaml.cs.

        {
            // Is CompactOverlay supported for our main window?
            // If so, it will be supported for a new window as well.
            // If it isn't, it will not be supported for new windows either so we cannot proceed.
            if (!ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
            {
                return;
            }

            showWindowBtn.IsEnabled = false;

            if (appWindow == null)
            {

                // Create a new AppWindow
                appWindow = await AppWindow.TryCreateAsync();
                // Make sure we release the reference to this window, and release XAML resources, when it's closed
                appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
                // Is CompactOverlay supported for this AppWindow? If not, then stop.
                if (appWindow.Presenter.IsPresentationSupported(AppWindowPresentationKind.CompactOverlay))
                {
                    // Create a new frame for the window
                    // Navigate the frame to the CompactOverlay page inside it.
                    appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
                    // Attach the frame to the window
                    ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
                    // Let's set the title so that we can tell the windows apart
                    appWindow.Title = "CompactOverlay Window";
                    // Request the Presentation of the window to CompactOverlay
                    bool switched = appWindow.Presenter.RequestPresentation(AppWindowPresentationKind.CompactOverlay);
                    if (switched)
                    {
                        // If the request was satisfied, show the window
                        await appWindow.TryShowAsync();
                    }
                }
            }
            else
            {
                await appWindow.TryShowAsync();
            }

            showWindowBtn.IsEnabled = true;
        }

Member Data Documentation

AppWindow appWindow [private]

Definition at line 24 of file Scenario4_CompactOverlay.xaml.cs.

Frame appWindowFrame = new Frame() [private]

Definition at line 25 of file Scenario4_CompactOverlay.xaml.cs.

The documentation for this class was generated from the following file:
  • AppWindow/cs/Scenario4_CompactOverlay.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompletionGroups Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_CompletionGroups
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_CompletionGroups Class Reference

List of all members.

Public Member Functions

Scenario4_CompletionGroups ()

Private Member Functions

async Task< IStorageFile > | CreateResultFileAsync (int id)
void | OnDownloadCompleted (Task< DownloadOperation > task)
void | SetSubstatus (string text)
async void | StartDownloadsButton_Click (object sender, RoutedEventArgs e)

Private Attributes

int | downloadsCompleted
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario4_CompletionGroups.xaml.cs.

Constructor & Destructor Documentation

Scenario4_CompletionGroups ( ) [inline]

Definition at line 31 of file Scenario4_CompletionGroups.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<IStorageFile> CreateResultFileAsync ( int id ) [inline, private]

Definition at line 62 of file Scenario4_CompletionGroups.xaml.cs.

        {
            StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            IStorageFile resultFile = await picturesLibrary.CreateFileAsync(
                String.Format(CultureInfo.InvariantCulture, "picture{0}.png", id),
                CreationCollisionOption.GenerateUniqueName);
            return resultFile;
        }

void OnDownloadCompleted ( Task< DownloadOperation > task ) [inline, private]

Definition at line 79 of file Scenario4_CompletionGroups.xaml.cs.

        {
            var ignore = rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(
                    String.Format(CultureInfo.InvariantCulture, "{0} downloads completed.", ++downloadsCompleted),
                    NotifyType.StatusMessage);
            });
        }

void SetSubstatus ( string text ) [inline, private]

Definition at line 71 of file Scenario4_CompletionGroups.xaml.cs.

        {
            var ignore = SubstatusBlock.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                SubstatusBlock.Text = text;
            });
        }

async void StartDownloadsButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario4_CompletionGroups.xaml.cs.

        {
            Uri baseUri;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out baseUri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            BackgroundDownloader downloader = CompletionGroupTask.CreateBackgroundDownloader();

            downloadsCompleted = 0;

            for (int i = 0; i < 10;  i++)
            {
                Uri uri = new Uri(baseUri, String.Format(CultureInfo.InvariantCulture, "?id={0}", i));
                DownloadOperation download = downloader.CreateDownload(uri, await CreateResultFileAsync(i));
                Task<DownloadOperation> startTask = download.StartAsync().AsTask();
                Task continueTask = startTask.ContinueWith(OnDownloadCompleted);
            }

            downloader.CompletionGroup.Enable();

            SetSubstatus("Completion group enabled.");
        }

Member Data Documentation

int downloadsCompleted [private]

Definition at line 29 of file Scenario4_CompletionGroups.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario4_CompletionGroups.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompositeSettings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_CompositeSettings
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_CompositeSettings Class Reference

List of all members.

Public Member Functions

Scenario4_CompositeSettings ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | DeleteCompositeSetting_Click (Object sender, RoutedEventArgs e)
void | DisplayOutput ()
void | WriteCompositeSetting_Click (Object sender, RoutedEventArgs e)

Private Attributes

ApplicationDataContainer | localSettings = ApplicationData.Current.LocalSettings
const string | settingName = "exampleCompositeSetting"
const string | settingName1 = "one"
const string | settingName2 = "hello"

Detailed Description

Definition at line 19 of file Scenario4_CompositeSettings.xaml.cs.

Constructor & Destructor Documentation

Scenario4_CompositeSettings ( ) [inline]

Definition at line 27 of file Scenario4_CompositeSettings.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void DeleteCompositeSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario4_CompositeSettings.xaml.cs.

        {
            localSettings.Values.Remove(settingName);

            DisplayOutput();
        }

void DisplayOutput ( ) [inline, private]

Definition at line 52 of file Scenario4_CompositeSettings.xaml.cs.

        {
            ApplicationDataCompositeValue composite = (ApplicationDataCompositeValue)localSettings.Values[settingName];

            String output;
            if (composite == null)
            {
                output = "Composite Setting: <empty>";
            }
            else
            {
                output = String.Format("Composite Setting: {{{0} = {1}, {2} = \"{3}\"}}", settingName1, composite[settingName1], settingName2, composite[settingName2]);
            }

            OutputTextBlock.Text = output;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 69 of file Scenario4_CompositeSettings.xaml.cs.

        {
            DisplayOutput();
        }

void WriteCompositeSetting_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario4_CompositeSettings.xaml.cs.

        {
            // Composite settings are used to group multiple settings.
            // Note that Composite settings may not be nested.
            ApplicationDataCompositeValue composite = new ApplicationDataCompositeValue();
            composite[settingName1] = 1; // example value
            composite[settingName2] = "world"; // example value

            localSettings.Values[settingName] = composite;

            DisplayOutput();
        }

Member Data Documentation

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings [private]

Definition at line 21 of file Scenario4_CompositeSettings.xaml.cs.

const string settingName = "exampleCompositeSetting" [private]

Definition at line 23 of file Scenario4_CompositeSettings.xaml.cs.

const string settingName1 = "one" [private]

Definition at line 24 of file Scenario4_CompositeSettings.xaml.cs.

const string settingName2 = "hello" [private]

Definition at line 25 of file Scenario4_CompositeSettings.xaml.cs.

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario4_CompositeSettings.xaml.cs
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ConsumableProduct Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ConsumableProduct
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_ConsumableProduct Class Reference

A page for fourth scenario.

List of all members.

Public Member Functions

Scenario4_ConsumableProduct ()

Private Member Functions

async void | FulfillConsumableButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetConsumableBalanceButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetManagedConsumablesButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | PurchaseAddOnButton_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()

Detailed Description

Definition at line 22 of file Scenario4_ConsumableProduct.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ConsumableProduct ( ) [inline]

Definition at line 27 of file Scenario4_ConsumableProduct.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void FulfillConsumableButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file Scenario4_ConsumableProduct.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            UInt32 quantity = UInt32.Parse((string)QuantityComboBox.SelectedValue);

            // This can be used to ensure this request is never double fulfilled. The server will
            // only accept one report for this specific GUID.
            Guid trackingId = Guid.NewGuid();

            StoreConsumableResult result = await storeContext.ReportConsumableFulfillmentAsync(item.StoreId, quantity, trackingId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StoreConsumableStatus.InsufficentQuantity:
                    rootPage.NotifyUser($"Insufficient Quantity! Balance Remaining: {result.BalanceRemaining}", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.Succeeded:
                    rootPage.NotifyUser($"Successful fulfillment! Balance Remaining: {result.BalanceRemaining}", NotifyType.StatusMessage);
                    break;

                case StoreConsumableStatus.NetworkError:
                    rootPage.NotifyUser("Network error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.ServerError:
                    rootPage.NotifyUser("Server error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Unknown error fulfilling consumable.", NotifyType.ErrorMessage);
                    break;
            }
        }

async void GetConsumableBalanceButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario4_ConsumableProduct.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            StoreConsumableResult result = await storeContext.GetConsumableBalanceRemainingAsync(item.StoreId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StoreConsumableStatus.InsufficentQuantity: // should never get this...
                    rootPage.NotifyUser($"Insufficient Quantity! Balance Remaining: {result.BalanceRemaining}", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.Succeeded:
                    rootPage.NotifyUser($"Balance Remaining: {result.BalanceRemaining}", NotifyType.StatusMessage);
                    break;

                case StoreConsumableStatus.NetworkError:
                    rootPage.NotifyUser("Network error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;

                case StoreConsumableStatus.ServerError:
                    rootPage.NotifyUser("Server error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Unknown error retrieving consumable balance.", NotifyType.ErrorMessage);
                    break;
            }
        }

async void GetManagedConsumablesButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario4_ConsumableProduct.xaml.cs.

        {
            // Create a filtered list of the product AddOns I care about
            string[] filterList = new string[] { "Consumable" };

            // Get list of Add Ons this app can sell, filtering for the types we know about
            StoreProductQueryResult addOns = await storeContext.GetAssociatedStoreProductsAsync(filterList);

            ProductsListView.ItemsSource = Utils.CreateProductListFromQueryResult(addOns, "Consumable Add-Ons");
        }

async void PurchaseAddOnButton_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario4_ConsumableProduct.xaml.cs.

        {
            var item = (ItemDetails)ProductsListView.SelectedItem;

            StorePurchaseResult result = await storeContext.RequestPurchaseAsync(item.StoreId);
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            switch (result.Status)
            {
                case StorePurchaseStatus.AlreadyPurchased: // should never get this for a managed consumable since they are stackable
                    rootPage.NotifyUser($"You already bought this consumable.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.Succeeded:
                    rootPage.NotifyUser($"You bought {item.Title}.", NotifyType.StatusMessage);
                    break;

                case StorePurchaseStatus.NotPurchased:
                    rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.NetworkError:
                    rootPage.NotifyUser("Product was not purchased due to a network error.", NotifyType.ErrorMessage);
                    break;

                case StorePurchaseStatus.ServerError:
                    rootPage.NotifyUser("Product was not purchased due to a server error.", NotifyType.ErrorMessage);
                    break;

                default:
                    rootPage.NotifyUser("Product was not purchased due to an unknown error.", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario4_ConsumableProduct.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 25 of file Scenario4_ConsumableProduct.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario4_ConsumableProduct.xaml.cs
  • Store/cpp/Scenario4_ConsumableProduct.xaml.cpp
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_EdgeTappedListView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_EdgeTappedListView
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_EdgeTappedListView Class Reference

List of all members.

Public Member Functions

Scenario4_EdgeTappedListView ()

Protected Member Functions

override void | OnNavigatedFrom (Windows.UI.Xaml.Navigation.NavigationEventArgs e)
override void | OnNavigatedTo (Windows.UI.Xaml.Navigation.NavigationEventArgs e)

Private Member Functions

void | AddItem (object sender, RoutedEventArgs e)
void | CancelSelection (object sender, RoutedEventArgs e)
void | OnBackRequested (object sender, BackRequestedEventArgs e)
void | OnEdgeTapped (ListView sender, ListViewEdgeTappedEventArgs e)
void | OnSelectionChanged (object sender, SelectionChangedEventArgs e)
void | RemoveItem (object sender, RoutedEventArgs e)
void | SelectItems (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | SetCommandsVisibility (ListView listView)
void | UpdateSelectionUI ()

Private Attributes

ObservableCollection< Contact > | Contacts

Detailed Description

Definition at line 20 of file Scenario4_EdgeTappedListView.xaml.cs.

Constructor & Destructor Documentation

Scenario4_EdgeTappedListView ( ) [inline]

Definition at line 24 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            InitializeComponent();

            Contacts = Contact.GetContacts(50);
            MyListView.ItemsSource = Contacts;

            // We set the state of the commands on the appbar
            SetCommandsVisibility(MyListView);
        }

Member Function Documentation

void AddItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            Contacts.Add(Contact.GetNewContact());
        }

void CancelSelection | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            // If the list is multiple selection mode but there is no items selected,
            // then the list should return to the initial selection mode.
            if (MyListView.SelectedItems.Count == 0)
            {
                MyListView.SelectionMode = ListViewSelectionMode.None;
                MyListView.IsItemLeftEdgeTapEnabled = true;
                SetCommandsVisibility(MyListView);
            }
            else
            {
                MyListView.SelectedItems.Clear();
            }
        }

void OnBackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            // We want to exit from the multiselect mode when pressing back button
            if (!e.Handled && MyListView.SelectionMode == ListViewSelectionMode.Multiple)
            {
                MyListView.SelectedItems.Clear();
                UpdateSelectionUI();
                e.Handled = true;
            }
        }

void OnEdgeTapped | ( | ListView | sender,
 |  | ListViewEdgeTappedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            // When user releases the pointer after pressing on the left edge of the item,
            // the ListView will switch to Multiple Selection
            MyListView.SelectionMode = ListViewSelectionMode.Multiple;
            // Also, we want the Left Edge Tap funcionality will be no longer enable.
            MyListView.IsItemLeftEdgeTapEnabled = false;
            // It's desirable that the Appbar shows the actions available for multiselect
            SetCommandsVisibility(MyListView);
        }

override void OnNavigatedFrom ( Windows.UI.Xaml.Navigation.NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            SystemNavigationManager.GetForCurrentView().BackRequested -= OnBackRequested;
        }

override void OnNavigatedTo ( Windows.UI.Xaml.Navigation.NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            // This is how devs can handle the back button
            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
        }

void OnSelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 63 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            UpdateSelectionUI();
        }

void RemoveItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 106 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            if (MyListView.SelectedIndex != -1)
            {
                // When an item is removed from the underlying collection, the Listview is updated,
                // hence the this.SelectedItems is updated as well.
                // It's needed to copy the selected items collection to iterate over other collection that
                // is not updated.
                List<Contact> selectedItems = new List<Contact>();
                foreach (Contact item in MyListView.SelectedItems)
                {
                    selectedItems.Add(item);
                }
                foreach (Contact item in selectedItems)
                {
                    Contacts.Remove(item);
                }
            }
        }

void SelectItems | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            MyListView.SelectionMode = ListViewSelectionMode.Multiple;
            MyListView.IsItemLeftEdgeTapEnabled = false;
            SetCommandsVisibility(MyListView);
        }

void SetCommandsVisibility ( ListView listView ) [inline, private]

Definition at line 77 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            if (listView.SelectionMode == ListViewSelectionMode.Multiple || listView.SelectedItems.Count > 1)
            {
                SelectAppBarBtn.Visibility = Visibility.Collapsed;
                CancelSelectionAppBarBtn.Visibility = Visibility.Visible;
                AddItemAppBarBtn.Visibility = Visibility.Collapsed;
                RemoveItemAppBarBtn.Visibility = Visibility.Visible;
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            }
            else
            {
                SelectAppBarBtn.Visibility = Visibility.Visible;
                CancelSelectionAppBarBtn.Visibility = Visibility.Collapsed;
                AddItemAppBarBtn.Visibility = Visibility.Visible;
                RemoveItemAppBarBtn.Visibility = Visibility.Collapsed;
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            }
        }

void UpdateSelectionUI ( ) [inline, private]

Definition at line 53 of file Scenario4_EdgeTappedListView.xaml.cs.

        {
            // When there are no selected items, the list returns to None selection mode.
            if (MyListView.SelectedItems.Count == 0)
            {
                MyListView.SelectionMode = ListViewSelectionMode.None;
                MyListView.IsItemLeftEdgeTapEnabled = true;
                SetCommandsVisibility(MyListView);
            }
        }

Member Data Documentation

ObservableCollection<Contact> Contacts [private]

Definition at line 22 of file Scenario4_EdgeTappedListView.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario4_EdgeTappedListView.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ForegroundGeofence Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ForegroundGeofence
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario4_ForegroundGeofence Class Reference

List of all members.

Public Member Functions

Scenario4_ForegroundGeofence ()
async void | OnGeofenceStateChanged (GeofenceMonitor sender, object e)
async void | OnGeofenceStatusChanged (GeofenceMonitor sender, object e)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddEventDescription (string eventDescription)
void | AddGeofenceToRegisteredGeofenceListBox (Geofence geofence)
Geofence | GenerateGeofence ()
void | OnCreateGeofence (object sender, RoutedEventArgs e)
void | OnRegisteredGeofenceListBoxSelectionChanged (object sender, SelectionChangedEventArgs e)
void | OnRemoveGeofenceItem (object sender, RoutedEventArgs e)
async void | OnSetPositionToHere (object sender, RoutedEventArgs e)
void | OnVisibilityChanged (object sender, VisibilityChangedEventArgs args)
bool | ParseDoubleFromTextBox (TextBox e, string name, double minValue, double maxValue, out double value)
bool | ParseTimeSpan (string field, TimeSpan defaultValue, out TimeSpan value)
void | RefreshControlsFromGeofence (Geofence geofence)

Private Attributes

CancellationTokenSource | _cts = null
MainPage _rootPage = MainPage.Current
TimeSpan | defaultDwellTime = TimeSpan.FromSeconds(10)
GeofenceMonitor | geofenceMonitor = null
DateTimeOffset | startImmediately = DateTimeOffset.FromFileTime(0)

Static Private Attributes

static readonly string | timeSpanFormat = @"d\:h\:m\:s"

Detailed Description

Definition at line 27 of file Scenario4_ForegroundGeofence.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ForegroundGeofence ( ) [inline]

Definition at line 43 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddEventDescription ( string eventDescription ) [inline, private]

Definition at line 442 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            GeofenceEventsListBox.Items.Insert(0, new ListBoxItem { Content = eventDescription });
        }

void AddGeofenceToRegisteredGeofenceListBox ( Geofence geofence ) [inline, private]

Definition at line 350 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            Geocircle circle = (Geocircle)geofence.Geoshape;

            string text = $"{geofence.Id} ({circle.Center.Latitude:0.###}, {circle.Center.Longitude:0.###}, {circle.Radius:0.#})";
            RegisteredGeofenceListBox.Items.Insert(0, new ListBoxItem { Content = text, Tag = geofence });
        }

Geofence GenerateGeofence ( ) [inline, private]

Definition at line 207 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            _rootPage.NotifyUser("", NotifyType.StatusMessage);

            string fenceKey = Id.Text;
            if (fenceKey.Length == 0)
            {
                _rootPage.NotifyUser("Name must be between 1 and 64 characters.", NotifyType.ErrorMessage);
                return null;
            }

            BasicGeoposition position;
            double radius;
            if (!ParseDoubleFromTextBox(Longitude, "Longitude", -180, 180, out position.Longitude) ||
                !ParseDoubleFromTextBox(Latitude, "Latitude", -90, 90, out position.Latitude) ||
                !ParseDoubleFromTextBox(Radius, "Radius", .1, 10018754.3, out radius))
            {
                return null;
            }

            position.Altitude = 0.0;

            // the geofence is a circular region
            Geocircle geocircle = new Geocircle(position, radius);

            bool singleUse = SingleUse.IsChecked.Value;

            // want to listen for enter geofence, exit geofence and remove geofence events
            // you can select a subset of these event states
            MonitoredGeofenceStates mask = MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited | MonitoredGeofenceStates.Removed;

            // Dwell time is how long you need to be in geofence to have been considered to have Entered it.
            TimeSpan dwellTime;
            if (!ParseTimeSpan(DwellTime.Text, defaultDwellTime, out dwellTime))
            {
                _rootPage.NotifyUser("Invalid Dwell Time.", NotifyType.ErrorMessage);
                return null;
            }

            // The Duration is the length of time the geofence is active.
            // Zero means "infinite duration".
            TimeSpan duration;
            if (!ParseTimeSpan(Duration.Text, TimeSpan.Zero, out duration))
            {
                _rootPage.NotifyUser("Invalid Duration.", NotifyType.ErrorMessage);
                return null;
            }

            // setting up the start time of the geofence
            DateTimeOffset startTime;
            if (StartImmediately.IsChecked.Value)
            {
                // The special "start immediately" value can be used if the duration is zero.
                // Otherwise, we get the current time as the start time.
                startTime = (duration == TimeSpan.Zero) ? startImmediately : DateTimeOffset.Now;
            }
            else
            {
                startTime = StartDate.Date + StartTime.Time;
            }

            // Let the platform detect other invalid parameter combinations.
            try
            {
                return new Geofence(fenceKey, geocircle, mask, singleUse, dwellTime, startTime, duration);
            }
            catch (Exception ex)
            {
                _rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                return null;
            }
        }

void OnCreateGeofence | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Create Geofence' button.

Parameters:
sender
e

Definition at line 415 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            Geofence geofence = GenerateGeofence();
            if (geofence != null)
            {
                try
                {
                    // add geofence to GeofenceMonitor
                    geofenceMonitor.Geofences.Add(geofence);
                }
                catch (Exception ex)
                {
                    // GeofenceMonitor failed to add the geofence. Possible reasons include
                    // duplicate or invalid name, invalid position, having a limited-duration
                    // geofence that doesn't leave enough time for the DwellTime to trigger the geofence.
                    _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                    geofence = null;
                }
            }

            if (geofence != null)
            {
                // Update UI after geofence successfully added to GeofenceMonitor.
                AddGeofenceToRegisteredGeofenceListBox(geofence);
            }
        }

async void OnGeofenceStateChanged | ( | GeofenceMonitor | sender,
 |  | object | e |
 | ) |  |  | [inline]

Definition at line 145 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            var reports = sender.ReadReports();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                foreach (GeofenceStateChangeReport report in reports)
                {
                    GeofenceState state = report.NewState;
                    Geofence geofence = report.Geofence;
                    string eventDescription = geofence.Id + " " + DateTime.Now.ToString("T") + " (" + state.ToString();

                    if (state == GeofenceState.Removed)
                    {
                        eventDescription += "/" + report.RemovalReason.ToString() + ")";
                        AddEventDescription(eventDescription);

                        // remove the geofence from the monitor
                        geofenceMonitor.Geofences.Remove(geofence);

                        // Remove the geofence from the list box.
                        foreach (ListBoxItem item in RegisteredGeofenceListBox.Items)
                        {
                            if (item.Tag == geofence)
                            {
                                RegisteredGeofenceListBox.Items.Remove(item);
                                break;
                            }
                        }
                    }
                    else if (state == GeofenceState.Entered || state == GeofenceState.Exited)
                    {
                        // NOTE: You might want to write your app to take particular
                        // action based on whether the app has internet connectivity.

                        eventDescription += ")";
                        AddEventDescription(eventDescription);
                    }
                }
            });
        }

async void OnGeofenceStatusChanged | ( | GeofenceMonitor | sender,
 |  | object | e |
 | ) |  |  | [inline]

Definition at line 133 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            GeofenceMonitorStatus status = sender.Status;

            string eventDescription = "Geofence Status Changed " + DateTime.Now.ToString("T") + " (" + status.ToString() + ")";

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AddEventDescription(eventDescription);
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 94 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            Window.Current.VisibilityChanged -= OnVisibilityChanged;

            if (_cts != null)
            {
                _cts.Cancel();
                _cts = null;
            }
            if (geofenceMonitor != null)
            {
                geofenceMonitor.GeofenceStateChanged -= OnGeofenceStateChanged;
                geofenceMonitor.StatusChanged -= OnGeofenceStatusChanged;
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            Window.Current.VisibilityChanged += OnVisibilityChanged;

            DateTime oneHourLater = DateTime.Now.AddHours(1);
            //rjc/$$
            StartDate.Date = oneHourLater.Date;
            StartTime.Time = oneHourLater.TimeOfDay;

            // Get permission to use location
            GeolocationAccessStatus accessStatus = await Geolocator.RequestAccessAsync();
            switch (accessStatus)
            {
                case GeolocationAccessStatus.Allowed:
                    // Wrap in try/catch in case user revokes access suddenly.
                    try
                    {
                        geofenceMonitor = GeofenceMonitor.Current;
                    }
                    catch (UnauthorizedAccessException)
                    {
                        _rootPage.NotifyUser("Access denied.", NotifyType.ErrorMessage);
                    }
                    if (geofenceMonitor != null)
                    {
                        foreach (Geofence geofence in geofenceMonitor.Geofences)
                        {
                            AddGeofenceToRegisteredGeofenceListBox(geofence);
                        }

                        // register for state change events
                        geofenceMonitor.GeofenceStateChanged += OnGeofenceStateChanged;
                        geofenceMonitor.StatusChanged += OnGeofenceStatusChanged;
                    }
                    break;

                case GeolocationAccessStatus.Denied:
                    _rootPage.NotifyUser("Access denied.", NotifyType.ErrorMessage);
                    break;

                case GeolocationAccessStatus.Unspecified:
                    _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
                    break;
            }
        }

void OnRegisteredGeofenceListBoxSelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 280 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            if (0 == e.AddedItems.Count)
            {
                // disable the remove button
                RemoveGeofenceItem.IsEnabled = false;
            }
            else
            {
                // enable the remove button
                RemoveGeofenceItem.IsEnabled = true;

                // update controls with the values from the newly-selected geofence
                Geofence geofence = (Geofence)(RegisteredGeofenceListBox.SelectedItem as ListBoxItem).Tag;
                RefreshControlsFromGeofence(geofence);
            }
        }

void OnRemoveGeofenceItem | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Remove Geofence Item' button.

Parameters:
sender
e

Definition at line 192 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            var item = RegisteredGeofenceListBox.SelectedItem as ListBoxItem;
            if (item != null)
            {
                Geofence geofence = (Geofence)item.Tag;

                // remove the geofence from the monitor
                geofenceMonitor.Geofences.Remove(geofence);

                // and remove from the UI
                RegisteredGeofenceListBox.Items.Remove(item);
            }
        }

async void OnSetPositionToHere | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Set Lat/Long to current position' button.

Parameters:
sender
e

Definition at line 363 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            SetPositionProgressBar.Visibility = Visibility.Visible;
            SetPositionToHereButton.IsEnabled = false;
            Latitude.IsEnabled = false;
            Longitude.IsEnabled = false;

            try
            {
                // Get cancellation token
                _cts = new CancellationTokenSource();
                CancellationToken token = _cts.Token;

                // Carry out the operation
                // geolocator and location permissions are initialized and checked on page creation.
                var geolocator = new Geolocator();

                // Request a high accuracy position for better accuracy locating the geofence
                geolocator.DesiredAccuracy = PositionAccuracy.High;

                Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);

                Latitude.Text = pos.Coordinate.Point.Position.Latitude.ToString();
                Longitude.Text = pos.Coordinate.Point.Position.Longitude.ToString();

                // clear status
                _rootPage.NotifyUser("", NotifyType.StatusMessage);
            }
            catch (TaskCanceledException)
            {
                _rootPage.NotifyUser("Task canceled", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                _cts = null;
            }

            SetPositionProgressBar.Visibility = Visibility.Collapsed;
            SetPositionToHereButton.IsEnabled = true;
            Latitude.IsEnabled = true;
            Longitude.IsEnabled = true;
        }

void OnVisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            // NOTE: After the app is no longer visible on the screen and before the app is suspended
            // you might want your app to use toast notification for any geofence activity.
            // By registering for VisibiltyChanged the app is notified when the app is no longer visible in the foreground.

            if (geofenceMonitor != null)
            {
                if (args.Visible)
                {
                    // register for foreground events
                    geofenceMonitor.GeofenceStateChanged += OnGeofenceStateChanged;
                    geofenceMonitor.StatusChanged += OnGeofenceStatusChanged;
                }
                else
                {
                    // unregister foreground events (let background capture events)
                    geofenceMonitor.GeofenceStateChanged -= OnGeofenceStateChanged;
                    geofenceMonitor.StatusChanged -= OnGeofenceStatusChanged;
                }
            }
        }

bool ParseDoubleFromTextBox | ( | TextBox | e,
 |  | string | name,
 |  | double | minValue,
 |  | double | maxValue,
 |  | out double | value |
 | ) |  |  | [inline, private]

Definition at line 339 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            if (!Double.TryParse(e.Text, out value) || (value < minValue) || (value > maxValue))
            {
                _rootPage.NotifyUser($"{name} must be between {minValue} and {maxValue}", NotifyType.StatusMessage);
                return false;
            }
            return true;
        }

bool ParseTimeSpan | ( | string | field,
 |  | TimeSpan | defaultValue,
 |  | out TimeSpan | value |
 | ) |  |  | [inline, private]

Definition at line 447 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            value = TimeSpan.Zero;
            if (!string.IsNullOrEmpty(field))
            {
                uint[] fields = new uint[4];
                string[] rawFields = field.Split(new[] { ':' });
                int count;

                for (count = 0; count < rawFields.Length; count++)
                {
                    if (!uint.TryParse(rawFields[count], out fields[count]))
                    {
                        // Not parseable.
                        return false;
                    }
                }

                Array.Reverse(fields, 0, count);

                value = TimeSpan.FromDays(fields[3]) +
                    TimeSpan.FromHours(fields[2]) +
                    TimeSpan.FromMinutes(fields[1]) +
                    TimeSpan.FromSeconds(fields[0]);
            }

            if (value == TimeSpan.Zero)
            {
                value = defaultValue;
            }

            return true;
        }

void RefreshControlsFromGeofence ( Geofence geofence ) [inline, private]

Definition at line 298 of file Scenario4_ForegroundGeofence.xaml.cs.

        {
            Id.Text = geofence.Id;

            Geocircle circle = (Geocircle)geofence.Geoshape;

            Latitude.Text = circle.Center.Latitude.ToString();
            Longitude.Text = circle.Center.Longitude.ToString();
            Radius.Text = circle.Radius.ToString();
            SingleUse.IsChecked = geofence.SingleUse;

            if (geofence.DwellTime != TimeSpan.Zero)
            {
                DwellTime.Text = geofence.DwellTime.ToString(timeSpanFormat);
            }
            else
            {
                DwellTime.Text = "";
            }

            if (geofence.Duration != TimeSpan.Zero)
            {
                Duration.Text = geofence.Duration.ToString(timeSpanFormat);
            }
            else
            {
                Duration.Text = "";
            }

            if (geofence.StartTime == startImmediately)
            {
                StartImmediately.IsChecked = true;
            }
            else
            {
                StartAtSpecificTime.IsChecked = true;
                StartDate.Date = geofence.StartTime.Date;
                StartTime.Time = geofence.StartTime.TimeOfDay;
            }
        }

Member Data Documentation

CancellationTokenSource _cts = null [private]

Definition at line 34 of file Scenario4_ForegroundGeofence.xaml.cs.

MainPage _rootPage = MainPage.Current [private]

Definition at line 38 of file Scenario4_ForegroundGeofence.xaml.cs.

TimeSpan defaultDwellTime = TimeSpan.FromSeconds(10) [private]

Definition at line 29 of file Scenario4_ForegroundGeofence.xaml.cs.

GeofenceMonitor geofenceMonitor = null [private]

Definition at line 35 of file Scenario4_ForegroundGeofence.xaml.cs.

DateTimeOffset startImmediately = DateTimeOffset.FromFileTime(0) [private]

Definition at line 32 of file Scenario4_ForegroundGeofence.xaml.cs.

readonly string timeSpanFormat = @"d\:h\:m\:s" [static, private]

Definition at line 41 of file Scenario4_ForegroundGeofence.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario4_ForegroundGeofence.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Input Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Input
Public Member Functions | Private Member Functions

Scenario4_Input Class Reference

List of all members.

Public Member Functions

Scenario4_Input ()

Private Member Functions

void ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario4_Input.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Input ( ) [inline]

Definition at line 21 of file Scenario4_Input.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario4_Input.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.Language class to obtain the user's current
            // input language.  The language tag returned reflects the current input language specified
            // by the user.
            var userInputLanguage = Windows.Globalization.Language.CurrentInputMethodLanguageTag;

            // Display the results
            OutputTextBlock.Text = "User's current input language: " + userInputLanguage;
        }

The documentation for this class was generated from the following files:
  • GlobalizationPreferences/cs/Scenario4_Input.xaml.cs
  • GlobalizationPreferences/cpp/Scenario4_Input.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_InteractionFeedback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_InteractionFeedback
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_InteractionFeedback Class Reference

List of all members.

Public Member Functions

Scenario4_InteractionFeedback ()

Private Member Functions

SimpleHapticsControllerFeedback | GetSelectedFeedbackOrFallback (out string message)
void | MainGrid_Entered (object sender, PointerRoutedEventArgs e)
void | MainGrid_Exited (object sender, PointerRoutedEventArgs e)
void | SendFeedback_Clicked (object sender, RoutedEventArgs e)

Private Attributes

SimpleHapticsControllerFeedback | currentFeedback
SimpleHapticsController | hapticsController
PenDevice | penDevice

Detailed Description

Definition at line 23 of file Scenario4_InteractionFeedback.xaml.cs.

Constructor & Destructor Documentation

Scenario4_InteractionFeedback ( ) [inline]

Definition at line 29 of file Scenario4_InteractionFeedback.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback ( out string message ) [inline, private]

Definition at line 117 of file Scenario4_InteractionFeedback.xaml.cs.

        {
            // Look up the waveform the user selected.
            string name = (string)waveformComboBox.SelectionBoxItem;
            ushort waveform = MainPage.WaveformNamesMap[name];

            // See if the haptics controller supports the selected waveform.
            SimpleHapticsControllerFeedback feedback = MainPage.FindSupportedFeedback(hapticsController, waveform);
            if (feedback != null)
            {
                message = "Waveform set to " + name;
                return feedback;
            }

            // It does not. Use Click as a fallback.
            message = name + " is not supported by this pen, so falling back to Click";
            return MainPage.FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms.Click);
        }

void MainGrid_Entered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario4_InteractionFeedback.xaml.cs.

        {
            // If the current Pointer device is not a pen, exit
            if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
            {
                return;
            }

            // Attempt to retrieve the PenDevice from the current PointerId
            penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);

            // If a PenDevice cannot be retrieved based on the PointerId, it does not support
            // advanced pen features, such as tactile feedback
            if (penDevice == null)
            {
                statusText.Text = "Advanced pen features not supported";
                return;
            }

            // Check to see if the current PenDevice supports tactile feedback by seeing if it
            // has a SimpleHapticsController
            hapticsController = penDevice.SimpleHapticsController;
            if (hapticsController == null)
            {
                statusText.Text = "This pen does not provide tactile feedback";
                return;
            }
        }

void MainGrid_Exited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario4_InteractionFeedback.xaml.cs.

        {
            penDevice = null;
            statusText.Text = "";
            if (hapticsController != null)
            {
                hapticsController.StopFeedback();
                hapticsController = null;
                currentFeedback = null;
            }
        }

void SendFeedback_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario4_InteractionFeedback.xaml.cs.

        {
            if (hapticsController == null)
            {
                return;
            }

            // Get feedback based on the user's selected waveform
            currentFeedback = GetSelectedFeedbackOrFallback(out string message);

            // Send the current feedback to the PenDevice's SimpleHapticsController.
            // Once sent, unlike inking feedback, this feedback will be played immediately.
            // Also, check to see if the current PenDevice's SimpleHapticsController supports
            // setting the intensity value of the tactile feedback.  If so, set it based
            // on the slider.  If not, send the feedback without custom intensity.
            if (hapticsController.IsIntensitySupported)
            {
                hapticsController.SendHapticFeedback(currentFeedback, intensitySlider.Value / 100);
                message += "\nIntensity set to " + intensitySlider.Value + "%";
            }
            else
            {
                hapticsController.SendHapticFeedback(currentFeedback);
                message += "\nSetting intensity is not supported by this pen";
            }
            statusText.Text = message;
        }

Member Data Documentation

SimpleHapticsControllerFeedback currentFeedback [private]

Definition at line 27 of file Scenario4_InteractionFeedback.xaml.cs.

SimpleHapticsController hapticsController [private]

Definition at line 25 of file Scenario4_InteractionFeedback.xaml.cs.

PenDevice penDevice [private]

Definition at line 26 of file Scenario4_InteractionFeedback.xaml.cs.

The documentation for this class was generated from the following file:
  • PenHaptics/cs/Scenario4_InteractionFeedback.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_NumberParsing Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_NumberParsing
Public Member Functions | Private Member Functions

Scenario4_NumberParsing Class Reference

List of all members.

Public Member Functions

Scenario4_NumberParsing ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario4_NumberParsing.xaml.cs.

Constructor & Destructor Documentation

Scenario4_NumberParsing ( ) [inline]

Definition at line 22 of file Scenario4_NumberParsing.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 32 of file Scenario4_NumberParsing.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.NumberFormatting.DecimalFormatter,
            // Windows.Globalization.NumberFormatting.CurrencyFormatter and
            // Windows.Globalization.NumberFormatting.PercentFormatter classes to format and parse a number
            // percentage or currency.

            // Keep results of the scenario in a StringBuilder
            StringBuilder results = new StringBuilder();

            // Define percent formatters.
            PercentFormatter percentFormat = new PercentFormatter();
            PercentFormatter percentFormatJP = new PercentFormatter(new string[] { "ja" }, "ZZ");
            PercentFormatter percentFormatFR = new PercentFormatter(new string[] { "fr-FR" }, "ZZ");

            // Define decimal formatters.
            DecimalFormatter decimalFormat = new DecimalFormatter();
            decimalFormat.IsGrouped = true;
            DecimalFormatter decimalFormatJP = new DecimalFormatter(new string[] { "ja" }, "ZZ");
            decimalFormatJP.IsGrouped = true;
            DecimalFormatter decimalFormatFR = new DecimalFormatter(new string[] { "fr-FR" }, "ZZ");
            decimalFormatFR.IsGrouped = true;

            // Define currency formatters
            string userCurrency = GlobalizationPreferences.Currencies[0];
            CurrencyFormatter currencyFormat = new CurrencyFormatter(userCurrency);
            CurrencyFormatter currencyFormatJP = new CurrencyFormatter("JPY", new string[] { "ja" }, "ZZ");
            CurrencyFormatter currencyFormatFR = new CurrencyFormatter("EUR", new string[] { "fr-FR" }, "ZZ");

            // Generate numbers for parsing.
            double percentNumber = 0.523;
            double decimalNumber = 12345.67;
            double currencyNumber = 1234.56;

            // Roundtrip the percent numbers by formatting and parsing.
            String percent1 = percentFormat.Format(percentNumber);
            double percent1Parsed = percentFormat.ParseDouble(percent1).Value;

            String percent1JP = percentFormatJP.Format(percentNumber);
            double percent1JPParsed = percentFormatJP.ParseDouble(percent1JP).Value;

            String percent1FR = percentFormatFR.Format(percentNumber);
            double percent1FRParsed = percentFormatFR.ParseDouble(percent1FR).Value;

            // Generate the results for percent parsing.
            results.AppendLine("Percent parsing of " + percentNumber);
            results.AppendLine("Formatted for current user: " + percent1   + " Parsed as current user: " + percent1Parsed);
            results.AppendLine("Formatted for ja-JP: "        + percent1JP + " Parsed for ja-JP: "       + percent1JPParsed);
            results.AppendLine("Formatted for fr-FR: "        + percent1FR + " Parsed for fr-FR: "       + percent1FRParsed);
            results.AppendLine();

            // Roundtrip the decimal numbers for formatting and parsing.
            String decimal1 = decimalFormat.Format(decimalNumber);
            double decimal1Parsed = decimalFormat.ParseDouble(decimal1).Value;

            String decimal1JP = decimalFormatJP.Format(decimalNumber);
            double decimal1JPParsed = decimalFormatJP.ParseDouble(decimal1JP).Value;

            String decimal1FR = decimalFormatFR.Format(decimalNumber);
            double decimal1FRParsed = decimalFormatFR.ParseDouble(decimal1FR).Value;

            // Generate the results for decimal parsing.
            results.AppendLine("Decimal parsing of " + decimalNumber);
            results.AppendLine("Formatted for current user: " + decimal1   + " Parsed as current user: " + decimal1Parsed);
            results.AppendLine("Formatted for ja-JP: "        + decimal1JP + " Parsed for ja-JP: "       + decimal1JPParsed);
            results.AppendLine("Formatted for fr-FR: "        + decimal1FR + " Parsed for fr-FR: "       + decimal1FRParsed);
            results.AppendLine();

            // Roundtrip the currency numbers for formatting and parsing.
            String currency1 = currencyFormat.Format(currencyNumber);
            double currency1Parsed = currencyFormat.ParseDouble(currency1).Value;

            String currency1JP = currencyFormatJP.Format(currencyNumber);
            double currency1JPParsed = currencyFormatJP.ParseDouble(currency1JP).Value;

            String currency1FR = currencyFormatFR.Format(currencyNumber);
            double currency1FRParsed = currencyFormatFR.ParseDouble(currency1FR).Value;

            // Generate the results for decimal parsing.
            results.AppendLine("Currency parsing of " + currencyNumber);
            results.AppendLine("Formatted for current user: " + currency1   + " Parsed as current user: " + currency1Parsed);
            results.AppendLine("Formatted for ja-JP: "        + currency1JP + " Parsed for ja-JP: "       + currency1JPParsed);
            results.AppendLine("Formatted for fr-FR: "        + currency1FR + " Parsed for fr-FR: "       + currency1FRParsed);
            results.AppendLine();

            // Display the results.
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario4_NumberParsing.xaml.cs
  • NumberFormatting/cpp/Scenario4_NumberParsing.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_OrientationChanged Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_OrientationChanged
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_OrientationChanged Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_OrientationChanged ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | _accelerometerOriginal_ReadingChanged (Accelerometer sender, AccelerometerReadingChangedEventArgs args)
async void | _accelerometerReadingTransform_ReadingChanged (Accelerometer sender, AccelerometerReadingChangedEventArgs args)
void | Current_VisibilityChanged (object sender, VisibilityChangedEventArgs e)
void | displayInformation_OrientationChanged (DisplayInformation sender, object args)
void | ScenarioDisable ()
void | ScenarioEnable ()

Private Attributes

Accelerometer | accelerometerOriginal
Accelerometer | accelerometerReadingTransform
DisplayInformation | displayInformation
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario4_OrientationChanged.xaml.cs.

Constructor & Destructor Documentation

Scenario4_OrientationChanged ( ) [inline]

Definition at line 35 of file Scenario4_OrientationChanged.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void _accelerometerOriginal_ReadingChanged | ( | Accelerometer | sender,
 |  | AccelerometerReadingChangedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged event of the 'accelerometerOriginal' and should notify of the accelerometer reading changes.

Parameters:
sender
args Event data represents the accelerometer reading in its original reference frame.

Definition at line 119 of file Scenario4_OrientationChanged.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.SetReadingText(ScenarioOutputOriginal, args.Reading);
            });
        }

async void _accelerometerReadingTransform_ReadingChanged | ( | Accelerometer | sender,
 |  | AccelerometerReadingChangedEventArgs | args |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged event of the 'accelerometerReadingTransform' and should notify of the accelerometer reading changes.

Parameters:
sender
args Event data represents the accelerometer reading in its original reference frame.

Definition at line 136 of file Scenario4_OrientationChanged.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.SetReadingText(ScenarioOutputReadingTransform, args.Reading);
            });
        }

void Current_VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 152 of file Scenario4_OrientationChanged.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    accelerometerOriginal.ReadingChanged += _accelerometerOriginal_ReadingChanged;
                    accelerometerReadingTransform.ReadingChanged += _accelerometerReadingTransform_ReadingChanged;
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    accelerometerOriginal.ReadingChanged -= _accelerometerOriginal_ReadingChanged;
                    accelerometerReadingTransform.ReadingChanged -= _accelerometerReadingTransform_ReadingChanged;
                }
            }
        }

void displayInformation_OrientationChanged | ( | DisplayInformation | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Invoked when there is a change in the display orientation.

Parameters:
sender DisplayInformation object from which the new Orientation can be determined
e

Definition at line 81 of file Scenario4_OrientationChanged.xaml.cs.

        {
            if (null != accelerometerReadingTransform)
            {
                accelerometerReadingTransform.ReadingTransform = sender.CurrentOrientation;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario4_OrientationChanged.xaml.cs.

        {
            // Get two instances of the accelerometer:
            // One that returns the raw accelerometer data
            accelerometerOriginal = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
            // Other on which the 'ReadingTransform' is updated so that data returned aligns with the request transformation.
            accelerometerReadingTransform = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);

            if (accelerometerOriginal == null || accelerometerReadingTransform == null)
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }

            // Register for orientation change
            displayInformation = DisplayInformation.GetForCurrentView();
            displayInformation.OrientationChanged += displayInformation_OrientationChanged;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 63 of file Scenario4_OrientationChanged.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }

            displayInformation.OrientationChanged -= displayInformation_OrientationChanged;
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Invoked on pressing 'Disable' button'.

Definition at line 174 of file Scenario4_OrientationChanged.xaml.cs.

        {
            Window.Current.VisibilityChanged -= Current_VisibilityChanged;
            accelerometerOriginal.ReadingChanged -= _accelerometerOriginal_ReadingChanged;
            accelerometerReadingTransform.ReadingChanged -= _accelerometerReadingTransform_ReadingChanged;

            // Restore the default report interval to release resources while the sensor is not in use
            accelerometerOriginal.ReportInterval = 0;
            accelerometerReadingTransform.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Invoked on pressing 'Enable' button'.

Definition at line 92 of file Scenario4_OrientationChanged.xaml.cs.

        {
            // Establish the report interval
            accelerometerOriginal.ReportInterval = accelerometerOriginal.MinimumReportInterval;
            accelerometerReadingTransform.ReportInterval = accelerometerReadingTransform.MinimumReportInterval;

            // Establish the ReadingTransform to align with the current display orientation, so
            // that the accelerometer data from 'accelerometerReadingTransform' will align with the
            // current display orientation
            accelerometerReadingTransform.ReadingTransform = displayInformation.CurrentOrientation;

            Window.Current.VisibilityChanged += Current_VisibilityChanged;
            accelerometerOriginal.ReadingChanged += _accelerometerOriginal_ReadingChanged;
            accelerometerReadingTransform.ReadingChanged += _accelerometerReadingTransform_ReadingChanged;

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

Member Data Documentation

Accelerometer accelerometerOriginal [private]

Definition at line 31 of file Scenario4_OrientationChanged.xaml.cs.

Accelerometer accelerometerReadingTransform [private]

Definition at line 32 of file Scenario4_OrientationChanged.xaml.cs.

DisplayInformation displayInformation [private]

Definition at line 33 of file Scenario4_OrientationChanged.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario4_OrientationChanged.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario4_OrientationChanged.xaml.cs
  • Accelerometer/cpp/Scenario4_OrientationChanged.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Override Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Override
Public Member Functions | Private Member Functions

Scenario4_Override Class Reference

List of all members.

Public Member Functions

Scenario4_Override ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 24 of file Scenario4_Override.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Override ( ) [inline]

Definition at line 26 of file Scenario4_Override.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 34 of file Scenario4_Override.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
            // to format a date/time by using a formatter that provides specific languages,
            // geographic region, calendar and clock

            // We keep results in this variable
            StringBuilder results = new StringBuilder();
            results.AppendLine("Current default application context language: " + ApplicationLanguages.Languages[0]);
            results.AppendLine();

            // Create formatters with individual format specifiers for date/time elements.
            DateTimeFormatter[] templateFormatters = new[]
            {
                // Example formatters for dates using string templates.
                new DateTimeFormatter("longdate", new[] { "ja-JP", "en-US" }, "JP", CalendarIdentifiers.Japanese, ClockIdentifiers.TwelveHour),
                new DateTimeFormatter("month day", new[] { "fr-FR", "en-US" }, "FR", CalendarIdentifiers.Gregorian, ClockIdentifiers.TwentyFourHour),

                // Example formatters using paranetrized date templates.
                new DateTimeFormatter(YearFormat.Abbreviated,
                    MonthFormat.Abbreviated,
                    DayFormat.Default,
                    DayOfWeekFormat.None,
                    HourFormat.None,
                    MinuteFormat.None,
                    SecondFormat.None,
                    new[] { "de-DE", "en-US" },
                    "DE",
                    CalendarIdentifiers.Gregorian,
                    ClockIdentifiers.TwelveHour),

                // Example formatters for times.
                new DateTimeFormatter("longtime", new[] { "ja-JP", "en-US" }, "JP", CalendarIdentifiers.Japanese, ClockIdentifiers.TwelveHour),
                new DateTimeFormatter("hour minute", new[] { "fr-FR", "en-US" }, "FR", CalendarIdentifiers.Gregorian, ClockIdentifiers.TwentyFourHour),

                // Example formatters using paranetrized time templates.
                new DateTimeFormatter(YearFormat.None,
                    MonthFormat.None,
                    DayFormat.None,
                    DayOfWeekFormat.None,
                    HourFormat.Default,
                    MinuteFormat.Default,
                    SecondFormat.None,
                    new[] { "de-DE" },
                    "DE",
                    CalendarIdentifiers.Gregorian,
                    ClockIdentifiers.TwelveHour),
             };

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
            foreach (DateTimeFormatter formatter in templateFormatters)
            {
                // Format and display date/time.
                results.AppendLine(formatter.Template + ": (" + formatter.ResolvedLanguage + ") " + formatter.Format(dateTime));
            }

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario4_Override.xaml.cs
  • DateTimeFormatting/cpp/Scenario4_Override.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_PartialReadWrite Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_PartialReadWrite
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_PartialReadWrite Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_PartialReadWrite ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | AppendOutputLine (string value)
void | CloseSocket ()
async Task | ConnectAsync ()
void | MessageReceived (MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
async void | OnClosed (IWebSocket sender, WebSocketClosedEventArgs args)
async void | OnConnect (object sender, RoutedEventArgs e)
void | OnDisconnect (object sender, RoutedEventArgs e)
async void | OnSend (object sender, RoutedEventArgs e)
async Task | SendAsync ()
void | SetBusy (bool value)
void | UpdateVisualState ()

Private Attributes

bool | busy
MessageWebSocket | messageWebSocket
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 29 of file Scenario4_PartialReadWrite.xaml.cs.

Constructor & Destructor Documentation

Scenario4_PartialReadWrite ( ) [inline]

Definition at line 38 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            this.InitializeComponent();
            UpdateVisualState();
        }

Member Function Documentation

void AppendOutputLine ( string value ) [inline, private]

Definition at line 258 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            OutputField.Text += value + "\r\n";
        }

void CloseSocket ( ) [inline, private]

Definition at line 241 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            if (messageWebSocket != null)
            {
                try
                {
                    messageWebSocket.Close(1000, "Closed due to user request.");
                }
                catch (Exception ex)
                {
                    AppendOutputLine(MainPage.BuildWebSocketError(ex));
                    AppendOutputLine(ex.Message);
                }
                messageWebSocket = null;
            }
        }

async Task ConnectAsync ( ) [inline, private]

Definition at line 75 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            if (String.IsNullOrEmpty(ServerAddressField.Text))
            {
                rootPage.NotifyUser("Please specify a URI to connect to", NotifyType.ErrorMessage);
                return;
            }

            // Validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling TryGetUri() that will return null for strings that are not
            // valid WebSocket URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet
            // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
            // "Internet (Client)" capability respectively.
            Uri server = rootPage.TryGetUri(ServerAddressField.Text);
            if (server == null)
            {
                return;
            }

            messageWebSocket = new MessageWebSocket();
            messageWebSocket.Control.MessageType = SocketMessageType.Utf8;

            // To support receiving event notifications for partial messages, you must set this receive mode.
            // If you do not set this mode, you will only receive notifications for complete messages; which is
            // the default behavior. Setting to Partial allows us to process partial data as soon as it arrives,
            // as opposed to waiting until the EndOfMessage to process the entire data.
            messageWebSocket.Control.ReceiveMode = MessageWebSocketReceiveMode.PartialMessage;

            messageWebSocket.MessageReceived += MessageReceived;
            messageWebSocket.Closed += OnClosed;

            if (server.Scheme == "wss")
            {
                // WARNING: Only test applications should ignore SSL errors.
                // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
                // attacks. (Although the connection is secure, the server is not authenticated.)
                // Note that not all certificate validation errors can be ignored.
                // In this case, we are ignoring these errors since the certificate assigned to the localhost
                // URI is self-signed and has subject name = fabrikam.com
                messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
                messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);
            }

            AppendOutputLine($"Connecting to {server}...");
            try
            {
                await messageWebSocket.ConnectAsync(server);
            }
            catch (Exception ex) // For debugging
            {
                // Error happened during connect operation.
                messageWebSocket.Dispose();
                messageWebSocket = null;

                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }

            rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
        }

void MessageReceived | ( | MessageWebSocket | sender,
 |  | MessageWebSocketMessageReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 181 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            // Dispatch the event to the UI thread so we can update UI.
            var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                string partialOrCompleted = "Partial";

                if (args.IsMessageComplete)
                {
                    partialOrCompleted = "Complete";
                }

                AppendOutputLine(partialOrCompleted + " message received; Type: " + args.MessageType);

                using (DataReader reader = args.GetDataReader())
                {
                    reader.UnicodeEncoding = UnicodeEncoding.Utf8;

                    try
                    {
                        // Note that it may be possible for partial UTF8 messages to be split between a character if it
                        // extends multiple bytes. We avoid this by using only ASCII characters in this example.
                        // Should your application use multi-byte characters, you will need to do checks for broken characters.
                        string read = reader.ReadString(reader.UnconsumedBufferLength);
                        AppendOutputLine(read);
                    }
                    catch (Exception ex)
                    {
                        AppendOutputLine(MainPage.BuildWebSocketError(ex));
                        AppendOutputLine(ex.Message);
                    }
                }
            });
        }

async void OnClosed | ( | IWebSocket | sender,
 |  | WebSocketClosedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 226 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            // Dispatch the event to the UI thread so we do not need to synchronize access to messageWebSocket.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

                if (messageWebSocket == sender)
                {
                    CloseSocket();
                    UpdateVisualState();
                }
            });
        }

async void OnConnect | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            SetBusy(true);
            await ConnectAsync();
            SetBusy(false);
        }

void OnDisconnect | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 216 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            SetBusy(true);
            rootPage.NotifyUser("Closing", NotifyType.StatusMessage);
            CloseSocket();
            SetBusy(false);
            rootPage.NotifyUser("Closed", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            CloseSocket();
        }

async void OnSend | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 138 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            SetBusy(true);
            await SendAsync();
            SetBusy(false);
        }

async Task SendAsync ( ) [inline, private]

Definition at line 145 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            string message = InputField.Text;
            if (String.IsNullOrEmpty(message))
            {
                rootPage.NotifyUser("Please specify text to send", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                DataWriter messageWriter = new DataWriter();
                messageWriter.WriteString(message);
                IBuffer buffer = messageWriter.DetachBuffer();

                if (EndOfMessageCheckBox.IsChecked == true)
                {
                    AppendOutputLine("Sending end of message: " + message);
                    await messageWebSocket.SendFinalFrameAsync(buffer);
                }
                else
                {
                    AppendOutputLine("Sending partial message: " + message);
                    await messageWebSocket.SendNonfinalFrameAsync(buffer);
                }
            }
            catch (Exception ex)
            {
                AppendOutputLine(MainPage.BuildWebSocketError(ex));
                AppendOutputLine(ex.Message);
                return;
            }

            rootPage.NotifyUser("Send Complete", NotifyType.StatusMessage);
        }

void SetBusy ( bool value ) [inline, private]

Definition at line 62 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            busy = value;
            UpdateVisualState();
        }

void UpdateVisualState ( ) [inline, private]

Definition at line 49 of file Scenario4_PartialReadWrite.xaml.cs.

        {
            if (busy)
            {
                VisualStateManager.GoToState(this, "Busy", false);
            }
            else
            {
                bool connected = (messageWebSocket != null);
                VisualStateManager.GoToState(this, connected ? "Connected" : "Disconnected", false);
            }
        }

Member Data Documentation

bool busy [private]

Definition at line 36 of file Scenario4_PartialReadWrite.xaml.cs.

MessageWebSocket messageWebSocket [private]

Definition at line 35 of file Scenario4_PartialReadWrite.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 33 of file Scenario4_PartialReadWrite.xaml.cs.

The documentation for this class was generated from the following file:
  • WebSocket/cs/Scenario4_PartialReadWrite.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ReceiveUri Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ReceiveUri
Public Member Functions | Protected Member Functions | Private Attributes

Scenario4_ReceiveUri Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_ReceiveUri ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Attributes

string | Protocol = "alsdkcs"
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario4_ReceiveUri.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ReceiveUri ( ) [inline]

Definition at line 29 of file Scenario4_ReceiveUri.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file Scenario4_ReceiveUri.xaml.cs.

        {
            var args = e.Parameter as ProtocolActivatedEventArgs;

            // Display the result of the protocol activation if we got here as a result of being activated for a protocol.
            if (args != null)
            {
                rootPage.NotifyUser("Protocol activation received. The received URI is " + args.Uri.AbsoluteUri + ".", NotifyType.StatusMessage);
            }
        }

Member Data Documentation

string Protocol = "alsdkcs" [private]

Definition at line 27 of file Scenario4_ReceiveUri.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario4_ReceiveUri.xaml.cs.

The documentation for this class was generated from the following file:
  • AssociationLaunching/cs/Scenario4_ReceiveUri.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Remove Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Remove
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_Remove Class Reference

List of all members.

Public Member Functions

Scenario4_Remove ()
Scenario4_Remove ()

Private Member Functions

async void | PickPlaylistButton_Click (object sender, RoutedEventArgs e)
async void | Remove_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario4_Remove.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Remove ( ) [inline]

Definition at line 23 of file Scenario4_Remove.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario4_Remove ( ) [inline]

Definition at line 27 of file Scenario4_Remove.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickPlaylistButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Removes the last file in the playlist picked by the user in the FilePicker.

Parameters:
sender
e

Definition at line 37 of file Scenario4_Remove.xaml.cs.

        {
            Playlist playlist = await rootPage.PickPlaylistAsync();

            if (playlist != null)
            {
                if (playlist.Files.Count > 0)
                {
                    playlist.Files.RemoveAt(playlist.Files.Count - 1);

                    if (await rootPage.TrySavePlaylistAsync(playlist))
                    {
                        rootPage.NotifyUser("The last item in the playlist was removed.", NotifyType.StatusMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("No items in playlist.", NotifyType.ErrorMessage);
                }
            }
        }

async void Remove_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Removes the appointment associated with a particular appointment id string from the defaul appointment provider app.

Parameters:
sender
e

Definition at line 33 of file Scenario4_Remove.xaml.cs.

        {
            // The appointment id argument for ShowRemoveAppointmentAsync is typically retrieved from AddAppointmentAsync and stored in app data.
            String appointmentId = AppointmentIdTextBox.Text;

            // The appointment id cannot be null or empty.
            if (String.IsNullOrEmpty(appointmentId))
            {
                rootPage.NotifyUser("The appointment id cannot be empty", NotifyType.ErrorMessage);
            }
            else
            {
                // Get the selection rect of the button pressed to remove this appointment
                var rect = MainPage.GetElementRect(sender as FrameworkElement);

                // ShowRemoveAppointmentAsync returns a boolean indicating whether or not the appointment related to the appointment id given was removed.
                // An optional instance start time can be provided to indicate that a specific instance on that date should be removed
                // in the case of a recurring appointment.
                bool removed;
                if (InstanceStartDateCheckBox.IsChecked.Value)
                {
                    // Remove a specific instance starting on the date provided.
                    var instanceStartDate = InstanceStartDateDatePicker.Date;
                    removed = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowRemoveAppointmentAsync(appointmentId, rect, Windows.UI.Popups.Placement.Default, instanceStartDate);
                }
                else
                {
                    // Remove an appointment that occurs only once or in the case of a recurring appointment, replace the entire series.
                    removed = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowRemoveAppointmentAsync(appointmentId, rect, Windows.UI.Popups.Placement.Default);
                }

                if (removed)
                {
                    rootPage.NotifyUser("Appointment removed", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Appointment not removed", NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario4_Remove.xaml.cs.

The documentation for this class was generated from the following files:
  • Appointments/cs/Scenario4_Remove.xaml.cs
  • Playlists/cs/Scenario4_Remove.xaml.cs
  • Playlists/cpp/Scenario4_Remove.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SaveFile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_SaveFile
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_SaveFile Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_SaveFile ()

Private Member Functions

async void SaveFileButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario4_SaveFile.xaml.cs.

Constructor & Destructor Documentation

Scenario4_SaveFile ( ) [inline]

Definition at line 30 of file Scenario4_SaveFile.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void SaveFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario4_SaveFile.xaml.cs.

        {
            // Clear previous returned file name, if it exists, between iterations of this scenario
            OutputTextBlock.Text = "";

            FileSavePicker savePicker = new FileSavePicker();
            savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            // Dropdown of file types the user can save the file as
            savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" });
            // Default file name if the user does not type one in or select a file to replace
            savePicker.SuggestedFileName = "New Document";
            StorageFile file = await savePicker.PickSaveFileAsync();
            if (file != null)
            {
                // Prevent updates to the remote version of the file until we finish making changes and call CompleteUpdatesAsync.
                CachedFileManager.DeferUpdates(file);
                // write to file
                await FileIO.WriteTextAsync(file, "Example file contents.");
                // Let Windows know that we're finished changing the file so the other app can update the remote version of the file.
                // Completing updates may require Windows to ask for user input.
                FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file);
                if (status == FileUpdateStatus.Complete)
                {
                    OutputTextBlock.Text = "File " + file.Name + " was saved.";
                }
                else if (status == FileUpdateStatus.CompleteAndRenamed)
                {
                    OutputTextBlock.Text = "File " + file.Name + " was renamed and saved.";
                }
                else
                {
                    OutputTextBlock.Text = "File " + file.Name + " couldn't be saved.";
                }
            }
            else
            {
                OutputTextBlock.Text = "Operation cancelled.";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario4_SaveFile.xaml.cs.

The documentation for this class was generated from the following files:
  • FilePicker/cs/Scenario4_SaveFile.xaml.cs
  • FilePicker/cpp/Scenario4_SaveFile.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ScriptNotify Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ScriptNotify
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_ScriptNotify Class Reference

List of all members.

Public Member Functions

Scenario4_ScriptNotify ()

Private Member Functions

void | MoreLess_Click (Hyperlink sender, HyperlinkClickEventArgs args)
void | WebViewControl_ScriptNotify (object sender, NotifyEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario4_ScriptNotify.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ScriptNotify ( ) [inline]

Definition at line 23 of file Scenario4_ScriptNotify.xaml.cs.

        {
            this.InitializeComponent();
            WebViewControl.Navigate(new Uri("ms-appx-web:///html/scriptNotify_example.html"));
        }

Member Function Documentation

void MoreLess_Click | ( | Hyperlink | sender,
 |  | HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario4_ScriptNotify.xaml.cs.

        {
            var hyperlink = (Hyperlink)sender;
            if (MoreInformationText.Visibility == Visibility.Visible)
            {
                MoreInformationText.Visibility = Visibility.Collapsed;
                MoreLessText.Text = "Show more information";
            }
            else
            {
                MoreInformationText.Visibility = Visibility.Visible;
                MoreLessText.Text = "Show less information";
            }
            rootPage.NotifyUser("", NotifyType.StatusMessage);
        }

void WebViewControl_ScriptNotify | ( | object | sender,
 |  | NotifyEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario4_ScriptNotify.xaml.cs.

        {
            // Be sure to verify the source of the message when performing actions with the data.
            // As webview can be navigated, you need to check that the message is coming from a page/code
            // that you trust.
            rootPage.NotifyUser($"Event received from {e.CallingUri}: \"{e.Value}\"", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario4_ScriptNotify.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario4_ScriptNotify.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SecureStop Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_SecureStop
Public Member Functions

Scenario4_SecureStop Class Reference

List of all members.

Public Member Functions

Scenario4_SecureStop ()

Detailed Description

Definition at line 17 of file Scenario4_SecureStop.xaml.cs.

Constructor & Destructor Documentation

Scenario4_SecureStop ( ) [inline]

Definition at line 19 of file Scenario4_SecureStop.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = new SecureStopViewModel(mediaElement);
        }

The documentation for this class was generated from the following file:
  • PlayReady/cs/Scenario4_SecureStop.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Settings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Settings
Public Member Functions | Private Member Functions

Scenario4_Settings Class Reference

List of all members.

Public Member Functions

Scenario4_Settings ()

Private Member Functions

void CheckNow_Clicked (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 25 of file Scenario4_Settings.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Settings ( ) [inline]

Definition at line 27 of file Scenario4_Settings.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CheckNow_Clicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario4_Settings.xaml.cs.

        {
            AnoymousAuthorizationEnabled.Text = RemoteSystem.IsAuthorizationKindEnabled(RemoteSystemAuthorizationKind.Anonymous).ToString();
            SameUserAuthorizationEnabled.Text = RemoteSystem.IsAuthorizationKindEnabled(RemoteSystemAuthorizationKind.SameUser).ToString();
        }

The documentation for this class was generated from the following file:
  • RemoteSystems/cs/Scenario4_Settings.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ShowView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_ShowView
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_ShowView Class Reference

List of all members.

Public Member Functions

Scenario4_ShowView ()

Private Member Functions

void TextBox_GotFocus (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario4_ShowView.xaml.cs.

Constructor & Destructor Documentation

Scenario4_ShowView ( ) [inline]

Definition at line 22 of file Scenario4_ShowView.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void TextBox_GotFocus | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario4_ShowView.xaml.cs.

        {
            CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Emoji);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario4_ShowView.xaml.cs.

The documentation for this class was generated from the following file:
  • TouchKeyboard/cs/Scenario4_ShowView.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Snapshot Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Snapshot
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_Snapshot Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_Snapshot ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | FindButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 17 of file Scenario4_Snapshot.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Snapshot ( ) [inline]

Definition at line 23 of file Scenario4_Snapshot.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void FindButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario4_Snapshot.xaml.cs.

        {
            DeviceSelectorInfo deviceSelectorInfo;
            DeviceInformationCollection deviceInfoCollection;

            findButton.IsEnabled = false;
            resultCollection.Clear();

            // First get the device selector chosen by the UI.
            deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;

            rootPage.NotifyUser("FindAllAsync operation started...", NotifyType.StatusMessage);

            if (null == deviceSelectorInfo.Selector)
            {
                // If the a pre-canned device class selector was chosen, call the DeviceClass overload
                deviceInfoCollection = await DeviceInformation.FindAllAsync(deviceSelectorInfo.DeviceClassSelector);
            }
            else
            {
                // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
                deviceInfoCollection = await DeviceInformation.FindAllAsync(
                    deviceSelectorInfo.Selector,
                    null // don't request additional properties for this sample
                    );
            }

            rootPage.NotifyUser(
                String.Format("FindAllAsync operation completed. {0} devices found.", deviceInfoCollection.Count),
                NotifyType.StatusMessage);

            foreach (DeviceInformation deviceInfo in deviceInfoCollection)
            {
                resultCollection.Add(new DeviceInformationDisplay(deviceInfo));
            }

            findButton.IsEnabled = true;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 28 of file Scenario4_Snapshot.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;

            selectorComboBox.ItemsSource = DeviceSelectorChoices.FindAllAsyncSelectors;
            selectorComboBox.SelectedIndex = 0;
        }

Member Data Documentation

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 21 of file Scenario4_Snapshot.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 19 of file Scenario4_Snapshot.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario4_Snapshot.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_StateTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_StateTrigger
Public Member Functions

Scenario4_StateTrigger Class Reference

this page shows how to use a state trigger to manipulate setter properties if the property is available. More...

List of all members.

Public Member Functions

Scenario4_StateTrigger ()

Detailed Description

In this particular case, we conditionally set the AllowFocusOnInteraction property.

Definition at line 20 of file Scenario4_StateTrigger.xaml.cs.

Constructor & Destructor Documentation

Scenario4_StateTrigger ( ) [inline]

Definition at line 22 of file Scenario4_StateTrigger.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • VersionAdaptiveCode/cs/Scenario4_StateTrigger.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SymbologyAttributes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_SymbologyAttributes
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_SymbologyAttributes Class Reference

List of all members.

Public Member Functions

Scenario4_SymbologyAttributes ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | claimedScanner_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (object sender, ClaimedBarcodeScanner e)
void | ResetTheScenarioState ()
void | ScenarioEndScanButton_Click (object sender, RoutedEventArgs e)
async void | ScenarioStartScanButton_Click (object sender, RoutedEventArgs e)
async void | SetSymbologyAttributes_Click (object sender, RoutedEventArgs e)
async void | SymbologySelection_Changed (object sender, SelectionChangedEventArgs args)

Private Attributes

ClaimedBarcodeScanner | claimedScanner = null
ObservableCollection
< SymbologyListEntry > 		listOfSymbologies = null
MainPage rootPage = MainPage.Current
BarcodeScanner | scanner = null
BarcodeSymbologyAttributes | symbologyAttributes = null

Detailed Description

Definition at line 24 of file Scenario4_SymbologyAttributes.xaml.cs.

Constructor & Destructor Documentation

Scenario4_SymbologyAttributes ( ) [inline]

Definition at line 33 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            this.InitializeComponent();

            listOfSymbologies = new ObservableCollection<SymbologyListEntry>();
            SymbologyListSource.Source = listOfSymbologies;
        }

Member Function Documentation

async void claimedScanner_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for the DataReceived event fired when a barcode is scanned by the barcode scanner.

Parameters:
sender
args Contains the BarcodeScannerReport which contains the data obtained in the scan

Definition at line 132 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            // need to update the UI data on the dispatcher thread.
            // update the UI with the data received from the scan.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // read the data from the buffer and convert to string.
                ScenarioOutputScanDataLabel.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                ScenarioOutputScanData.Text = DataHelpers.GetDataString(args.Report.ScanData);
                ScenarioOutputScanDataType.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
            });
        }

void claimedScanner_ReleaseDeviceRequested | ( | object | sender,
 |  | ClaimedBarcodeScanner | e |
 | ) |  |  | [inline, private]

Event handler for the Release Device Requested event fired when barcode scanner receives Claim request from another application.

Parameters:
sender
args Contains the ClamiedBarcodeScanner that is sending this request

Definition at line 120 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            // always retain the device
            e.RetainDevice();
            rootPage.NotifyUser("Event ReleaseDeviceRequested received. Retaining the barcode scanner.", NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            ResetTheScenarioState();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            ResetTheScenarioState();
        }

void ResetTheScenarioState ( ) [inline, private]

Reset the Scenario state.

Definition at line 148 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            if (claimedScanner != null)
            {
                // Detach the event handlers
                claimedScanner.DataReceived -= claimedScanner_DataReceived;
                claimedScanner.ReleaseDeviceRequested -= claimedScanner_ReleaseDeviceRequested;
                // Release the Barcode Scanner and set to null
                claimedScanner.Dispose();
                claimedScanner = null;
            }

            if (scanner != null)
            {
                scanner.Dispose();
                scanner = null;
            }

            symbologyAttributes = null;

            // Reset the UI if we are still the current page.
            if (Frame.Content == this)
            {
                rootPage.NotifyUser("Click the start scanning button to begin.", NotifyType.StatusMessage);
                this.ScenarioOutputScanData.Text = "No data";
                this.ScenarioOutputScanDataLabel.Text = "No data";
                this.ScenarioOutputScanDataType.Text = "No data";

                // reset the button state
                ScenarioEndScanButton.IsEnabled = false;
                ScenarioStartScanButton.IsEnabled = true;
                SetSymbologyAttributesButton.IsEnabled = false;
                EnableCheckDigit.IsEnabled = false;
                TransmitCheckDigit.IsEnabled = false;
                SetDecodeRangeLimits.IsEnabled = false;

                // reset symbology list
                listOfSymbologies.Clear();
            }
        }

void ScenarioEndScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event handler for End Scan Button Click.

Releases the Barcode Scanner and resets the text in the UI

Parameters:
sender
e

Definition at line 195 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            // reset the scenario state
            this.ResetTheScenarioState();
        }

async void ScenarioStartScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Start Scan Button Click.

Sets up the barcode scanner to be ready to receive the data events from the scan.

Parameters:
sender
e

Definition at line 57 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            ScenarioStartScanButton.IsEnabled = false;

            rootPage.NotifyUser("Acquiring barcode scanner object.", NotifyType.StatusMessage);

            // create the barcode scanner.
            scanner = await DeviceHelpers.GetFirstBarcodeScannerAsync();

            if (scanner != null)
            {
                // claim the scanner for exclusive use and enable it so that data received events are received.
                claimedScanner = await scanner.ClaimScannerAsync();
                if (claimedScanner != null)
                {
                    // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
                    // claim ownership of the barcode scanner.
                    claimedScanner.ReleaseDeviceRequested += claimedScanner_ReleaseDeviceRequested;

                    // after successfully claiming, attach the datareceived event handler.
                    claimedScanner.DataReceived += claimedScanner_DataReceived;

                    // Ask the API to decode the data by default. By setting this, API will decode the raw data from the barcode scanner and
                    // send the ScanDataLabel and ScanDataType in the DataReceived event
                    claimedScanner.IsDecodeDataEnabled = true;

                    // enable the scanner.
                    // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be any useful because the API will not fire the event
                    // if the claimedScanner has not been Enabled
                    await claimedScanner.EnableAsync();

                    // after successful claim, list supported symbologies
                    IReadOnlyList<uint> supportedSymbologies = await scanner.GetSupportedSymbologiesAsync();
                    foreach (uint symbology in supportedSymbologies)
                    {
                        listOfSymbologies.Add(new SymbologyListEntry(symbology));
                    }

                    // reset the button state
                    ScenarioEndScanButton.IsEnabled = true;

                    rootPage.NotifyUser("Ready to scan. Device ID: " + claimedScanner.DeviceId, NotifyType.StatusMessage);
                }
                else
                {
                    scanner.Dispose();
                    scanner = null;
                    ScenarioStartScanButton.IsEnabled = true;
                    rootPage.NotifyUser("Claim barcode scanner failed.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                ScenarioStartScanButton.IsEnabled = true;
                rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage);
            }
        }

async void SetSymbologyAttributes_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 253 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            if ((claimedScanner != null) && (symbologyAttributes != null))
            {
                // populate attributes
                if (symbologyAttributes.IsCheckDigitValidationSupported)
                {
                    symbologyAttributes.IsCheckDigitValidationEnabled = EnableCheckDigit.IsChecked.Value;
                }
                if (symbologyAttributes.IsCheckDigitTransmissionSupported)
                {
                    symbologyAttributes.IsCheckDigitTransmissionEnabled = TransmitCheckDigit.IsChecked.Value;
                }
                if (symbologyAttributes.IsDecodeLengthSupported)
                {
                    if (SetDecodeRangeLimits.IsChecked.Value)
                    {
                        symbologyAttributes.DecodeLengthKind = BarcodeSymbologyDecodeLengthKind.Range;
                        symbologyAttributes.DecodeLength1 = (uint)MinimumDecodeLength.Value;
                        symbologyAttributes.DecodeLength2 = (uint)MaximumDecodeLength.Value;
                    }
                    else
                    {
                        symbologyAttributes.DecodeLengthKind = BarcodeSymbologyDecodeLengthKind.AnyLength;
                    }
                }

                SymbologyListEntry symbologyListEntry = (SymbologyListEntry)SymbologyListBox.SelectedItem;
                if (symbologyListEntry != null)
                {
                    bool attributesSet = false;

                    try
                    {
                        attributesSet = await claimedScanner.SetSymbologyAttributesAsync(symbologyListEntry.Id, symbologyAttributes);
                    }
                    catch (Exception)
                    {
                        // Scanner could not set the attributes.
                    }

                    if (attributesSet)
                    {
                        rootPage.NotifyUser("Attributes set for symbology '" + symbologyListEntry.Name + "'", NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("Attributes could not be set for symbology '" + symbologyListEntry.Name + "'.", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("Select a symbology from the list.", NotifyType.ErrorMessage);
                }
            }
        }

async void SymbologySelection_Changed | ( | object | sender,
 |  | SelectionChangedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for Symbology listbox selection changed.

Get symbology attributes and populate attribute UI components

Parameters:
sender
args

Definition at line 207 of file Scenario4_SymbologyAttributes.xaml.cs.

        {
            if (claimedScanner != null)
            {
                SymbologyListEntry symbologyListEntry = (SymbologyListEntry)SymbologyListBox.SelectedItem;
                if (symbologyListEntry != null)
                {
                    SetSymbologyAttributesButton.IsEnabled = false;
                    try
                    {
                        symbologyAttributes = await claimedScanner.GetSymbologyAttributesAsync(symbologyListEntry.Id);
                    }
                    catch (Exception)
                    {
                        symbologyAttributes = null;
                    }

                    if (symbologyAttributes != null)
                    {
                        SetSymbologyAttributesButton.IsEnabled = true;

                        // initialize attributes UIs
                        EnableCheckDigit.IsEnabled = symbologyAttributes.IsCheckDigitValidationSupported;
                        EnableCheckDigit.IsChecked = symbologyAttributes.IsCheckDigitValidationEnabled;
                        TransmitCheckDigit.IsEnabled = symbologyAttributes.IsCheckDigitTransmissionSupported;
                        TransmitCheckDigit.IsChecked = symbologyAttributes.IsCheckDigitTransmissionEnabled;
                        SetDecodeRangeLimits.IsEnabled = symbologyAttributes.IsDecodeLengthSupported;
                        bool decodeLengthEnabled = (symbologyAttributes.DecodeLengthKind == BarcodeSymbologyDecodeLengthKind.Range);
                        SetDecodeRangeLimits.IsChecked = decodeLengthEnabled;
                        if (decodeLengthEnabled)
                        {
                            MinimumDecodeLength.Value = Math.Min(symbologyAttributes.DecodeLength1, symbologyAttributes.DecodeLength2);
                            MaximumDecodeLength.Value = Math.Max(symbologyAttributes.DecodeLength1, symbologyAttributes.DecodeLength2);
                        }
                    }
                    else
                    {
                        rootPage.NotifyUser("Symbology attributes are not available.", NotifyType.ErrorMessage);
                        EnableCheckDigit.IsEnabled = false;
                        TransmitCheckDigit.IsEnabled = false;
                        SetDecodeRangeLimits.IsEnabled = false;
                    }
                }
            }
        }

Member Data Documentation

ClaimedBarcodeScanner claimedScanner = null [private]

Definition at line 28 of file Scenario4_SymbologyAttributes.xaml.cs.

ObservableCollection<SymbologyListEntry> listOfSymbologies = null [private]

Definition at line 30 of file Scenario4_SymbologyAttributes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario4_SymbologyAttributes.xaml.cs.

BarcodeScanner scanner = null [private]

Definition at line 27 of file Scenario4_SymbologyAttributes.xaml.cs.

BarcodeSymbologyAttributes symbologyAttributes = null [private]

Definition at line 31 of file Scenario4_SymbologyAttributes.xaml.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/Scenario4_SymbologyAttributes.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_TilePinned Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_TilePinned
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_TilePinned Class Reference

List of all members.

Public Member Functions

Scenario4_TilePinned ()

Private Member Functions

void TileExists_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 17 of file Scenario4_TilePinned.xaml.cs.

Constructor & Destructor Documentation

Scenario4_TilePinned ( ) [inline]

Definition at line 21 of file Scenario4_TilePinned.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void TileExists_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file Scenario4_TilePinned.xaml.cs.

        {
            if (SecondaryTile.Exists(MainPage.logoSecondaryTileId))
            {
                rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is pinned.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is not currently pinned.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 19 of file Scenario4_TilePinned.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario4_TilePinned.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Tuning Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_Tuning
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_Tuning Class Reference

See the README.md for discussion of this scenario.

List of all members.

Public Member Functions

Scenario4_Tuning ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | DesiredMaxBitrateList_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | DesiredMinBitrateList_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | DownloadBitrateChanged (AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadBitrateChangedEventArgs args)
async void | HideDescriptionOnSmallScreen ()
void | InitialBitrateList_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | InitializeBitrateLists (AdaptiveMediaSource aMS)
bool | IsValidBitrateCombination (uint?desiredMinBitrate, uint?desiredMaxBitrate, uint initialBitrate)
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
async void | PlaybackBitrateChanged (AdaptiveMediaSource sender, AdaptiveMediaSourcePlaybackBitrateChangedEventArgs args)
async void | PollForInboundBitsPerSecond (CancellationTokenSource cts)
void | RegisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
void | SetBitrateDowngradeTriggerRatio_Click ()
void | SetDesiredBitrateHeadroomRatio_Click ()
void | UnregisterForAdaptiveMediaSourceEvents (AdaptiveMediaSource adaptiveMediaSource)
void | UnregisterHandlers (MediaPlayer mediaPlayer)
async Task | UpdateDownloadBitrateAsync (uint downloadBitrate)
async Task | UpdatePlaybackBitrateAsync (uint playbackBitrate)

Private Attributes

AdaptiveMediaSource | adaptiveMediaSource
AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
BitrateHelper bitrateHelper
CancellationTokenSource | ctsForInboundBitsPerSecondUiRefresh = new CancellationTokenSource()
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger

Detailed Description

Definition at line 31 of file Scenario4_Tuning.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Tuning ( ) [inline]

Definition at line 37 of file Scenario4_Tuning.xaml.cs.

        {
            this.InitializeComponent();
            iconInboundBitsPerSecond.Symbol = (Symbol)0xE88A;
        }

Member Function Documentation

void DesiredMaxBitrateList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 264 of file Scenario4_Tuning.xaml.cs.

        {
            var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
            if (selection != null && adaptiveMediaSource.DesiredMaxBitrate != selection.Bitrate)
            {
                if (IsValidBitrateCombination(adaptiveMediaSource.DesiredMinBitrate, selection.Bitrate, adaptiveMediaSource.InitialBitrate))
                {
                    adaptiveMediaSource.DesiredMaxBitrate = selection.Bitrate;
                }
                else
                {
                    DesiredMaxBitrateList.SelectedItem = e.RemovedItems[0];
                }
            }
        }

void DesiredMinBitrateList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 248 of file Scenario4_Tuning.xaml.cs.

        {
            var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
            if (selection != null && adaptiveMediaSource.DesiredMinBitrate != selection.Bitrate)
            {
                if (IsValidBitrateCombination(selection.Bitrate, adaptiveMediaSource.DesiredMaxBitrate, adaptiveMediaSource.InitialBitrate))
                {
                    adaptiveMediaSource.DesiredMinBitrate = selection.Bitrate;
                }
                else
                {
                    DesiredMinBitrateList.SelectedItem = e.RemovedItems[0];
                }
            }
        }

async void DownloadBitrateChanged | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourceDownloadBitrateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 316 of file Scenario4_Tuning.xaml.cs.

        {
            uint downloadBitrate = args.NewValue;
            await UpdateDownloadBitrateAsync(downloadBitrate);
        }

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 191 of file Scenario4_Tuning.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

void InitialBitrateList_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 232 of file Scenario4_Tuning.xaml.cs.

        {
            var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
            if (selection != null && adaptiveMediaSource.InitialBitrate != selection.Bitrate)
            {
                if (IsValidBitrateCombination(adaptiveMediaSource.DesiredMinBitrate, adaptiveMediaSource.DesiredMaxBitrate, selection.Bitrate.Value))
                {
                    adaptiveMediaSource.InitialBitrate = selection.Bitrate.Value;
                }
                else
                {
                    InitialBitrateList.SelectedItem = e.RemovedItems[0];
                }
            }
        }

void InitializeBitrateLists ( AdaptiveMediaSource aMS ) [inline, private]

Definition at line 204 of file Scenario4_Tuning.xaml.cs.

        {
            var sortedBitrates = aMS.AvailableBitrates.OrderByDescending(br => br).Select(br => new BitrateItem(br)).ToArray();
            InitialBitrateList.ItemsSource = sortedBitrates;
            var selected = sortedBitrates.First(item => item.Bitrate == aMS.InitialBitrate);
            InitialBitrateList.SelectedItem = sortedBitrates.FirstOrDefault(item => item.Bitrate == aMS.InitialBitrate);

            var nullableSortedBitrates = (new BitrateItem[] { new BitrateItem(null) }).Concat(sortedBitrates).ToArray();
            DesiredMaxBitrateList.ItemsSource = DesiredMinBitrateList.ItemsSource = nullableSortedBitrates;

            DesiredMaxBitrateList.SelectedItem = nullableSortedBitrates.First(item => item.Bitrate == aMS.DesiredMaxBitrate);
            DesiredMinBitrateList.SelectedItem = nullableSortedBitrates.First(item => item.Bitrate == aMS.DesiredMinBitrate);
        }

bool IsValidBitrateCombination | ( | uint? | desiredMinBitrate,
 |  | uint? | desiredMaxBitrate,
 |  | uint | initialBitrate |
 | ) |  |  | [inline, private]

Definition at line 220 of file Scenario4_Tuning.xaml.cs.

        {
            // The ">" operator returns false if either operand is null. We take advantage of this
            // by testing in this manner. Do NOT "optimize" this by reversing the sense of the test
            // to "return desiredMinBitrate <= initialBitrate && initialBitrate <= desiredMaxBitrate;"
            if (desiredMinBitrate > initialBitrate || initialBitrate > desiredMaxBitrate)
            {
                return false;
            }
            return true;
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 133 of file Scenario4_Tuning.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                // In addition to logging, we use the callbacks to update some UI elements in this scenario:
                RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);

                // At this point, we have read the manifest of the media source, and all bitrates are known.
                bitrateHelper = new BitrateHelper(adaptiveMediaSource.AvailableBitrates);
                InitializeBitrateLists(adaptiveMediaSource);
                await UpdatePlaybackBitrateAsync(adaptiveMediaSource.CurrentPlaybackBitrate);
                await UpdateDownloadBitrateAsync(adaptiveMediaSource.CurrentDownloadBitrate);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);
            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
                return null;
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = Guid.NewGuid().ToString();

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 349 of file Scenario4_Tuning.xaml.cs.

        {
            LoggerControl.Log(message);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario4_Tuning.xaml.cs.

        {
            ctsForInboundBitsPerSecondUiRefresh.Cancel(); // Cancel timer
            adaptiveMediaSource = null; // release app instance of AdaptiveMediaSource

            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 89 of file Scenario4_Tuning.xaml.cs.

        {
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            // Ensure we have PlayReady support, if the user enters a DASH/PR Uri in the text box:
            var prHelper = new PlayReadyHelper(LoggerControl);
            prHelper.SetUpProtectionManager(mediaPlayer);
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
                null,
                LoggerControl,
                LoadSourceFromUriAsync);

            // There is no InboundBitsPerSecondChanged event, so we start a polling thread to update UI.
            PollForInboundBitsPerSecond(ctsForInboundBitsPerSecondUiRefresh);
        }

async void PlaybackBitrateChanged | ( | AdaptiveMediaSource | sender,
 |  | AdaptiveMediaSourcePlaybackBitrateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 331 of file Scenario4_Tuning.xaml.cs.

        {
            uint playbackBitrate = args.NewValue;
            await UpdatePlaybackBitrateAsync(playbackBitrate);
        }

async void PollForInboundBitsPerSecond ( CancellationTokenSource cts ) [inline, private]

Definition at line 112 of file Scenario4_Tuning.xaml.cs.

        {
            ulong InboundBitsPerSecondLast = 0;
            var refreshRate = TimeSpan.FromSeconds(2);
            while (!cts.IsCancellationRequested)
            {
                if (adaptiveMediaSource != null)
                {
                    if (InboundBitsPerSecondLast != adaptiveMediaSource.InboundBitsPerSecond)
                    {
                        InboundBitsPerSecondLast = adaptiveMediaSource.InboundBitsPerSecond;
                        InboundBitsPerSecondText.Text = InboundBitsPerSecondLast.ToString();
                    }
                }
                await Task.Delay(refreshRate);
            }
        }

void RegisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 302 of file Scenario4_Tuning.xaml.cs.

        {
            adaptiveMediaSource.DownloadBitrateChanged += DownloadBitrateChanged;
            adaptiveMediaSource.PlaybackBitrateChanged += PlaybackBitrateChanged;
        }

void SetBitrateDowngradeTriggerRatio_Click ( ) [inline, private]

Definition at line 280 of file Scenario4_Tuning.xaml.cs.

        {
            double ratio;
            if (double.TryParse(BitrateDowngradeTriggerRatioText.Text, out ratio))
            {
                adaptiveMediaSource.AdvancedSettings.BitrateDowngradeTriggerRatio = ratio;
            }
        }

void SetDesiredBitrateHeadroomRatio_Click ( ) [inline, private]

Definition at line 289 of file Scenario4_Tuning.xaml.cs.

        {
            double ratio;
            if (double.TryParse(BitrateDowngradeTriggerRatioText.Text, out ratio))
            {
                adaptiveMediaSource.AdvancedSettings.DesiredBitrateHeadroomRatio = ratio;
            }
        }

void UnregisterForAdaptiveMediaSourceEvents ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 308 of file Scenario4_Tuning.xaml.cs.

        {
            if (adaptiveMediaSource != null)
            {
                adaptiveMediaSource.DownloadBitrateChanged -= DownloadBitrateChanged;
                adaptiveMediaSource.PlaybackBitrateChanged -= PlaybackBitrateChanged;
            }
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 63 of file Scenario4_Tuning.xaml.cs.

        {
            AdaptiveMediaSource adaptiveMediaSource = null;
            MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
            if (mpItem != null)
            {
                adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
            }
            MediaSource source = mediaPlayer.Source as MediaSource;
            if (source != null)
            {
                adaptiveMediaSource = source.AdaptiveMediaSource;
            }

            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;

            UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
        }

async Task UpdateDownloadBitrateAsync ( uint downloadBitrate ) [inline, private]

Definition at line 322 of file Scenario4_Tuning.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                iconDownloadBitrate.Symbol = bitrateHelper.GetBitrateSymbol(downloadBitrate);
                txtDownloadBitrate.Text = downloadBitrate.ToString();
            }));
        }

async Task UpdatePlaybackBitrateAsync ( uint playbackBitrate ) [inline, private]

Definition at line 337 of file Scenario4_Tuning.xaml.cs.

        {
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                iconPlaybackBitrate.Symbol = bitrateHelper.GetBitrateSymbol(playbackBitrate);
                txtPlaybackBitrate.Text = playbackBitrate.ToString();
            }));
        }

Member Data Documentation

AdaptiveMediaSource adaptiveMediaSource [private]

Definition at line 34 of file Scenario4_Tuning.xaml.cs.

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 356 of file Scenario4_Tuning.xaml.cs.

BitrateHelper bitrateHelper [private]

Definition at line 35 of file Scenario4_Tuning.xaml.cs.

CancellationTokenSource ctsForInboundBitsPerSecondUiRefresh = new CancellationTokenSource() [private]

Definition at line 33 of file Scenario4_Tuning.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 355 of file Scenario4_Tuning.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 353 of file Scenario4_Tuning.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 354 of file Scenario4_Tuning.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario4_Tuning.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_UnicodeExtensions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_UnicodeExtensions
Public Member Functions | Private Member Functions

Scenario4_UnicodeExtensions Class Reference

List of all members.

Public Member Functions

Scenario4_UnicodeExtensions ()

Private Member Functions

string | ReportCalendarData (Calendar calendar, string calendarLabel)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario4_UnicodeExtensions.xaml.cs.

Constructor & Destructor Documentation

Scenario4_UnicodeExtensions ( ) [inline]

Definition at line 22 of file Scenario4_UnicodeExtensions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportCalendarData | ( | Calendar | calendar,
 |  | string | calendarLabel |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario4_UnicodeExtensions.xaml.cs.

        {
            string results = calendarLabel + ": " + calendar.GetCalendarSystem() + "\n";
            results += "Calendar system: " + calendar.GetCalendarSystem() + "\n";
            results += "Numeral System: " + calendar.NumeralSystem + "\n";
            results += "Resolved Language " + calendar.ResolvedLanguage + "\n";
            results += "Name of Month: " + calendar.MonthAsSoloString() + "\n";
            results += "Day of Month: " + calendar.DayAsPaddedString(2) + "\n";
            results += "Day of Week: " + calendar.DayOfWeekAsSoloString() + "\n";
            results += "Year: " + calendar.YearAsString() + "\n";
            results += "\n";
            return results;
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario4_UnicodeExtensions.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.Calendar class to display the parts of a date.

            // Create Calendar objects using different Unicode extensions for different languages.
            // NOTE: Calendar (ca) and numeral system (nu) are the only supported extensions with any others being ignored.
            // Note that collation (co) extension is ignored in the last example.
            Calendar cal1 = new Calendar();
            Calendar cal2 = new Calendar(new[] { "ar-SA-u-ca-gregory-nu-Latn" });
            Calendar cal3 = new Calendar(new[] { "he-IL-u-nu-arab" });
            Calendar cal4 = new Calendar(new[] { "he-IL-u-ca-hebrew-co-phonebk" });

            // Display individual date/time elements.
            OutputTextBlock.Text =
                ReportCalendarData(cal1, "User's default Calendar object") +
                ReportCalendarData(cal2, "Calendar object with Arabic language, Gregorian Calendar and Latin Numeral System (ar-SA-ca-gregory-nu-Latn)") +
                ReportCalendarData(cal3, "Calendar object with Hebrew language, Default Calendar for that language and Arab Numeral System (he-IL-u-nu-arab)") +
                ReportCalendarData(cal4, "Calendar object with Hebrew language, Hebrew Calendar, Default Numeral System for that language and Phonebook collation (he-IL-u-ca-hebrew-co-phonebk)");
        }

The documentation for this class was generated from the following files:
  • Calendar/cs/Scenario4_UnicodeExtensions.xaml.cs
  • Calendar/cpp/Scenario4_UnicodeExtensions.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_UpdatingLineDisplayAttributes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario4_UpdatingLineDisplayAttributes
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4_UpdatingLineDisplayAttributes Class Reference

List of all members.

Public Member Functions

Scenario4_UpdatingLineDisplayAttributes ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | InitializeAsync ()
void | SetValuesFromLineDisplay ()
async void | UpdateButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedLineDisplay | lineDisplay
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

Constructor & Destructor Documentation

Scenario4_UpdatingLineDisplayAttributes ( ) [inline]

Definition at line 27 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            this.InitializeComponent();
            DataContext = this;
        }

Member Function Documentation

task< void > InitializeAsync ( ) [inline, private]

Definition at line 44 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();

            BlinkRateSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeBlinkRate;
            BrightnessSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.IsBrightnessSupported;

            SupportedScreenSizesComboBox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeScreenSize;

            if (SupportedScreenSizesComboBox.IsEnabled)
            {
                foreach (Size screenSize in lineDisplay.SupportedScreenSizesInCharacters)
                {
                    SupportedScreenSizesComboBox.Items.Add(new ComboBoxItem { Content = $"{screenSize.Width} x {screenSize.Height}", Tag = screenSize });
                }

                if (SupportedScreenSizesComboBox.Items.Count > 0)
                {
                    SupportedScreenSizesComboBox.SelectedIndex = 0;
                }
            }

            CharacterSetMappingEnabledCheckbox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanMapCharacterSets;

            UpdateButton.IsEnabled = (lineDisplay != null);

            if (UpdateButton.IsEnabled)
            {
                SetValuesFromLineDisplay();

                if (lineDisplay.Capabilities.CanBlink == LineDisplayTextAttributeGranularity.NotSupported)
                {
                    await lineDisplay.DefaultWindow.TryDisplayTextAsync("Regular Text");
                }
                else
                {
                    await lineDisplay.DefaultWindow.TryDisplayTextAsync("Blinking Text", LineDisplayTextAttribute.Blink);
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            await InitializeAsync();
        }

void SetValuesFromLineDisplay ( ) [inline, private]

Definition at line 85 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            LineDisplayAttributes attributes = lineDisplay.GetAttributes();
            BlinkRateSlider.Value = attributes.BlinkRate.TotalMilliseconds;
            BrightnessSlider.Value = attributes.Brightness;
            CharacterSetMappingEnabledCheckbox.IsChecked = attributes.IsCharacterSetMappingEnabled;
        }

async void UpdateButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

        {
            LineDisplayAttributes attributes = lineDisplay.GetAttributes();

            if (lineDisplay.Capabilities.CanChangeBlinkRate)
            {
                attributes.BlinkRate = TimeSpan.FromMilliseconds(BlinkRateSlider.Value);
            }

            if (lineDisplay.Capabilities.IsBrightnessSupported)
            {
                attributes.Brightness = (int)BrightnessSlider.Value;
            }

            if (lineDisplay.Capabilities.CanChangeScreenSize)
            {
                attributes.ScreenSizeInCharacters = Helpers.GetSelectedItemTag<Size>(SupportedScreenSizesComboBox);
            }

            if (lineDisplay.Capabilities.CanMapCharacterSets)
            {
                attributes.IsCharacterSetMappingEnabled = CharacterSetMappingEnabledCheckbox.IsChecked.Value;
            }

            if (await lineDisplay.TryUpdateAttributesAsync(attributes))
            {
                rootPage.NotifyUser("Attributes updated successfully.", NotifyType.StatusMessage);

                // The resulting attributes may not match our request.
                // For example, the Line Display will choose the closest available blink rate.
                // Update the controls to show what the Line Display actually used.
                SetValuesFromLineDisplay();
            }
            else
            {
                // We probably lost our claim.
                rootPage.NotifyUser("Failed to update attributes.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ClaimedLineDisplay lineDisplay [private]

Definition at line 25 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario4_UpdatingLineDisplayAttributes.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario4_UpdatingLineDisplayAttributes.xaml.cs
  • LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario5 ()
Scenario5 ()
Scenario5 ()
Scenario5 ()
Scenario5 ()
Scenario5 ()
Scenario5 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AudioTracks_SelectedIndexChanged (ISingleSelectMediaTrackList sender, object args)
async void | GetThumbnailButton_Click (object sender, RoutedEventArgs e)
void | InertiaSwitch_Toggled (object sender, RoutedEventArgs e)
void | InitOptions ()
void | movementAxis_Changed (object sender, SelectionChangedEventArgs e)
void | myMap_Loaded (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
async void | ReadFromStreamButton_Click (object sender, RoutedEventArgs e)
void | resetButton_Pressed (object sender, RoutedEventArgs e)
void | Scenario5Button_Show_Click (object sender, RoutedEventArgs e)
async void | showStreetSideNearSpaceneedle_Click (object sender, RoutedEventArgs e)
void | TrackButton_Click (object sender, RoutedEventArgs e)
async void | WriteToStreamButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MediaPlaybackItem | item
ManipulationInputProcessor manipulationProcessor
MediaPlaybackItemLogger | mpiLogger
GestureRecognizer | recognizer
MainPage rootPage = MainPage.Current

Detailed Description

Demonstrates multi-track audio playback and language selection.

This page shows the code to configure the intial state of the InkToolbar.

Writing and reading using a stream.

Definition at line 23 of file scenario5.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 29 of file scenario5.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario5 ( ) [inline]

Definition at line 26 of file 5-GestureRecognizer.xaml.cs.

        {
            this.InitializeComponent();

            InitOptions();

            // Create a GestureRecognizer which will be used to process the manipulations
            // done on the rectangle
            recognizer = new GestureRecognizer();

            // Create a ManipulationInputProcessor which will listen for events on the
            // rectangle, process them, and update the rectangle's position, size, and rotation
            manipulationProcessor = new ManipulationInputProcessor(recognizer, manipulateMe, mainCanvas);
        }

Scenario5 ( ) [inline]

Definition at line 29 of file Scenario5_Stream.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario5 ( ) [inline]

Definition at line 29 of file Scenario5.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario5 ( ) [inline]

Definition at line 26 of file Scenario5.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario5 ( ) [inline]

Definition at line 24 of file Scenario5.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas
            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
        }

Scenario5 ( ) [inline]

Definition at line 31 of file Scenario5_SelectingAudioTracks.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AudioTracks_SelectedIndexChanged | ( | ISingleSelectMediaTrackList | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario5_SelectingAudioTracks.xaml.cs.

        {
            var audioTrackIndex = sender.SelectedIndex;

            LoggerControl.Log("Switched to audio track #" + (audioTrackIndex + 1)
                    + " | Id: " + this.item.AudioTracks[audioTrackIndex].Id
                    + " | Label: " + this.item.AudioTracks[audioTrackIndex].Label
                    + " | Language: " + this.item.AudioTracks[audioTrackIndex].Language);

        }

async void GetThumbnailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario5.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock, OutputDetails);

            // Pick a folder
            FolderPicker folderPicker = new FolderPicker();
            foreach (string extension in FileExtensions.Image)
            {
                folderPicker.FileTypeFilter.Add(extension);
            }

            StorageFolder folder = await folderPicker.PickSingleFolderAsync();
            if (folder != null)
            {
                const CommonFolderQuery monthShape = CommonFolderQuery.GroupByMonth;
                // Verify queries are supported because they are not supported in all picked locations.
                if (folder.IsCommonFolderQuerySupported(monthShape))
                {
                    // Convert folder to file group and query for items
                    IReadOnlyList<StorageFolder> months = await folder.CreateFolderQuery(monthShape).GetFoldersAsync();

                    if (months != null && months.Count > 0)
                    {
                        const ThumbnailMode thumbnailMode = ThumbnailMode.PicturesView;
                        const uint size = 200;
                        StorageFolder firstMonth = months[0];
                        using (StorageItemThumbnail thumbnail = await firstMonth.GetThumbnailAsync(thumbnailMode, size))
                        {
                            if (thumbnail != null)
                            {
                                MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, firstMonth, thumbnail, true);

                                // Also display the hierarchy of the file group to better visualize where the thumbnail comes from
                                IReadOnlyList<StorageFile> files = await firstMonth.GetFilesAsync();

                                if (files != null)
                                {
                                    StringBuilder output = new StringBuilder("\nList of files in this group:\n\n");
                                    foreach (StorageFile file in files)
                                    {
                                        output.AppendFormat("{0}\n", file.Name);
                                    }
                                    OutputDetails.Text = output.ToString();
                                }
                            }
                            else
                            {
                                rootPage.NotifyUser(Errors.NoImages, NotifyType.StatusMessage);
                            }
                        }
                    }
                    else
                    {
                        rootPage.NotifyUser(Errors.FileGroupEmpty, NotifyType.StatusMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser(Errors.FileGroupLocation, NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
            }
        }

void InertiaSwitch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file 5-GestureRecognizer.xaml.cs.

        {
            if (manipulationProcessor == null)
            {
                return;
            }

            manipulationProcessor.UseInertia(InertiaSwitch.IsOn);
        }

void InitOptions ( ) [inline, private]

Definition at line 41 of file 5-GestureRecognizer.xaml.cs.

        {
            movementAxis.SelectedIndex = 0;
            InertiaSwitch.IsOn = true;
        }

void movementAxis_Changed | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file 5-GestureRecognizer.xaml.cs.

        {
            if (manipulationProcessor == null)
            {
                return;
            }

            ComboBoxItem selectedItem = (ComboBoxItem)((ComboBox)sender).SelectedItem;
            switch (selectedItem.Content.ToString())
            {
                case "X only":
                    manipulationProcessor.LockToXAxis();
                    break;
                case "Y only":
                    manipulationProcessor.LockToYAxis();
                    break;
                default:
                    manipulationProcessor.MoveOnXAndYAxes();
                    break;
            }
        }

void myMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file Scenario5.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 12;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario5_SelectingAudioTracks.xaml.cs.

        {
            mpiLogger?.Dispose();
            mpiLogger = null;
            MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario5_SelectingAudioTracks.xaml.cs.

        {
            this.item = new MediaPlaybackItem(MediaSource.CreateFromUri(rootPage.CaptionedMediaUri));
            mpiLogger = new MediaPlaybackItemLogger(LoggerControl, item);

            item.AudioTracks.SelectedIndexChanged += AudioTracks_SelectedIndexChanged;

            this.mediaPlayerElement.Source = item;
            LoggerControl.Log($"Loaded: {rootPage.CaptionedMediaUri}");
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario5.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock, OutputDetails);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 39 of file scenario5.xaml.cs.

        {
            this.Scenario5TextBlock.Text = "";
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario5_Stream.xaml.cs.

        {
            rootPage.ValidateFile();
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 32 of file Scenario5.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

async void ReadFromStreamButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file Scenario5_Stream.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    using (IRandomAccessStream readStream = await file.OpenAsync(FileAccessMode.Read))
                    {
                        UInt64 size64 = readStream.Size;
                        if (size64 <= UInt32.MaxValue)
                        {
                            UInt32 size32 = (UInt32)size64;
                            IBuffer buffer = new Windows.Storage.Streams.Buffer(size32);
                            buffer = await readStream.ReadAsync(buffer, size32, InputStreamOptions.None);
                            string fileContent = MainPage.GetStringFromBuffer(buffer);
                            rootPage.NotifyUser($"The following text was read from '{file.Name}' using a stream:\n{fileContent}", NotifyType.StatusMessage);
                        }
                        else
                        {
                            rootPage.NotifyUser($"File {file.Name} is too big for ReadAsync to read in a single chunk. Files larger than 4GB need to be broken into multiple chunks to be read by ReadAsync.", NotifyType.ErrorMessage);
                        }
                    }
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex) when (ex.HResult == MainPage.E_NO_UNICODE_TRANSLATION)
                {
                    rootPage.NotifyUser("File is not UTF-8 encoded.", NotifyType.ErrorMessage);
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error reading from '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

void resetButton_Pressed | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file 5-GestureRecognizer.xaml.cs.

        {
            InitOptions();
            manipulationProcessor.Reset();
        }

void Scenario5Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario5Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 50 of file scenario5.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                var resourceLoader = ResourceLoader.GetForCurrentView("Errors");
                this.Scenario5TextBlock.Text = resourceLoader.GetString("InvalidOperation");
            }
        }

async void showStreetSideNearSpaceneedle_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file Scenario5.xaml.cs.

        {
            if (myMap.IsStreetsideSupported)
            {
                BasicGeoposition spaceNeedlePosition = new BasicGeoposition();
                spaceNeedlePosition.Latitude = 47.6204;
                spaceNeedlePosition.Longitude = -122.3491;

                Geopoint spaceNeedlePoint = new Geopoint(spaceNeedlePosition);

                StreetsidePanorama panoramaNearSpaceNeedle = await StreetsidePanorama.FindNearbyAsync(spaceNeedlePoint);

                if (panoramaNearSpaceNeedle != null)
                {
                    myMap.CustomExperience = new StreetsideExperience(panoramaNearSpaceNeedle);
                }
            }
            else
            {

                string status = "Streetside views are not supported on this device.";
                rootPage.NotifyUser(status, NotifyType.ErrorMessage);
            }
        }

void TrackButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario5_SelectingAudioTracks.xaml.cs.

        {
            // Get the audio track index based on value of the 'tag' field
            var button = sender as Button;
            var audioTrackIndex = int.Parse(button.Tag as string);

            // Select the clicked audio track
            if (this.item != null && this.item.AudioTracks != null && this.item.AudioTracks.Count - 1 >= audioTrackIndex)
            {
                this.item.AudioTracks.SelectedIndex = audioTrackIndex;
            }
        }

async void WriteToStreamButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario5_Stream.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    string userContent = InputTextBox.Text;
                    using (StorageStreamTransaction transaction = await file.OpenTransactedWriteAsync())
                    {
                        IBuffer buffer = MainPage.GetBufferFromString(userContent);
                        await transaction.Stream.WriteAsync(buffer);
                        transaction.Stream.Size = buffer.Length; // truncate file
                        await transaction.CommitAsync();
                        rootPage.NotifyUser($"The following text was written to '{file.Name}' using a stream:\n{userContent}", NotifyType.StatusMessage);
                    }
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser(String.Format("Error writing to '{0}': {1}", file.Name, ex.Message), NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

Member Data Documentation

MediaPlaybackItem item [private]

Definition at line 29 of file Scenario5_SelectingAudioTracks.xaml.cs.

ManipulationInputProcessor manipulationProcessor [private]

Definition at line 24 of file 5-GestureRecognizer.xaml.cs.

MediaPlaybackItemLogger mpiLogger [private]

Definition at line 28 of file Scenario5_SelectingAudioTracks.xaml.cs.

GestureRecognizer recognizer [private]

Definition at line 23 of file 5-GestureRecognizer.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file scenario5.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario5.xaml.cs
  • BasicInput/cs/5-GestureRecognizer.xaml.cs
  • FileAccess/cs/Scenario5_Stream.xaml.cs
  • FileThumbnails/cs/Scenario5.xaml.cs
  • MapControl/cs/Scenario5.xaml.cs
  • VideoPlayback/cs/Scenario5_SelectingAudioTracks.xaml.cs
  • SimpleInk/cs/Scenario5.xaml.cs
  • ApplicationResources/cpp/scenario5.xaml.cpp
  • BasicInput/cpp/5-GestureRecognizer.xaml.cpp
  • DatagramSocket/cpp/Scenario5.xaml.cpp
  • FileAccess/cpp/Scenario5_Stream.xaml.cpp
  • FileThumbnails/cpp/Scenario5.xaml.cpp
  • MapControl/cpp/Scenario5.xaml.cpp
  • SimpleInk/cpp/Scenario5.xaml.cpp
  • StreamSocket/cpp/Scenario5.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Capabilities Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_Capabilities
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_Capabilities Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario5_Capabilities ()

Public Attributes

ObservableCollection
< RemoteSystem > 		SystemList = > m_rootPage.systemList

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Capabilities_Click (object sender, RoutedEventArgs e)
async Task | ReportCapabilityAsync (RemoteSystem selectedSystem, string capability, TextBlock resultBlock)
void | UpdateStatus (string status, NotifyType statusType)

Private Attributes

MainPage m_rootPage

Detailed Description

Definition at line 30 of file Scenario5_Capabilities.xaml.cs.

Constructor & Destructor Documentation

Scenario5_Capabilities ( ) [inline]

Definition at line 33 of file Scenario5_Capabilities.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

async void Capabilities_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario5_Capabilities.xaml.cs.

        {
            UpdateStatus("Checking for capabilities...", NotifyType.StatusMessage);
            appServiceSupport.Text = "";
            launchUriSupport.Text = "";
            spatialEntitySupport.Text = "";

            RemoteSystem selectedSystem = SystemListComboBox.SelectedItem as RemoteSystem;
            if (selectedSystem != null && selectedSystem.Status == RemoteSystemStatus.Available)
            {
                // Check and report each capability.
                await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.AppService, appServiceSupport);
                await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.LaunchUri, launchUriSupport);
                await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.SpatialEntity, spatialEntitySupport);

                UpdateStatus("Successfully checked capabilities.", NotifyType.StatusMessage);
            }
            else if (selectedSystem != null && selectedSystem.Status != RemoteSystemStatus.Available)
            {
                UpdateStatus("The selected system is not available.", NotifyType.ErrorMessage);
            }
            else
            {
                UpdateStatus("Please select a system.", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario5_Capabilities.xaml.cs.

        {
            m_rootPage = MainPage.Current;
            m_rootPage.ValidateSystemDiscovery();
        }

async Task ReportCapabilityAsync | ( | RemoteSystem | selectedSystem,
 |  | string | capability,
 |  | TextBlock | resultBlock |
 | ) |  |  | [inline, private]

Definition at line 47 of file Scenario5_Capabilities.xaml.cs.

        {
            bool isSupported = await selectedSystem.GetCapabilitySupportedAsync(capability);
            resultBlock.Text = isSupported ? "Yes" : "No";
        }

void UpdateStatus | ( | string | status,
 |  | NotifyType | statusType |
 | ) |  |  | [inline, private]

Definition at line 80 of file Scenario5_Capabilities.xaml.cs.

        {
            m_rootPage.NotifyUser(status, statusType);
        }

Member Data Documentation

MainPage m_rootPage [private]

Definition at line 32 of file Scenario5_Capabilities.xaml.cs.

ObservableCollection<RemoteSystem> SystemList = > m_rootPage.systemList

Definition at line 45 of file Scenario5_Capabilities.xaml.cs.

The documentation for this class was generated from the following file:
  • RemoteSystems/cs/Scenario5_Capabilities.xaml.cs
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Clear Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_Clear
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_Clear Class Reference

List of all members.

Public Member Functions

Scenario5_Clear ()

Private Member Functions

async void PickPlaylistButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario5_Clear.xaml.cs.

Constructor & Destructor Documentation

Scenario5_Clear ( ) [inline]

Definition at line 27 of file Scenario5_Clear.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PickPlaylistButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Clears the playlist picked by the user in the FilePicker.

Parameters:
sender
e

Definition at line 37 of file Scenario5_Clear.xaml.cs.

        {
            Playlist playlist = await rootPage.PickPlaylistAsync();

            if (playlist != null)
            {
                playlist.Files.Clear();

                if (await rootPage.TrySavePlaylistAsync(playlist))
                {
                    this.rootPage.NotifyUser("Playlist cleared.", NotifyType.StatusMessage);
                }
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario5_Clear.xaml.cs.

The documentation for this class was generated from the following files:
  • Playlists/cs/Scenario5_Clear.xaml.cs
  • Playlists/cpp/Scenario5_Clear.xaml.cpp
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_DataEventsBatching Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_DataEventsBatching
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_DataEventsBatching Class Reference

List of all members.

Public Member Functions

Scenario5_DataEventsBatching ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | ReadingChanged (object sender, AccelerometerReadingChangedEventArgs e)
void | ScenarioDisable ()
void | ScenarioEnable ()
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

Accelerometer | accelerometer
uint desiredReportInterval
uint desiredReportLatency
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario5_DataEventsBatching.xaml.cs.

Constructor & Destructor Documentation

Scenario5_DataEventsBatching ( ) [inline]

Definition at line 32 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            accelerometer = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
            if (accelerometer != null)
            {
                // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
                // This value will be used later to activate the sensor.
                desiredReportInterval = Math.Max(accelerometer.MinimumReportInterval, 16);

                // MaxBatchSize will be 0 if the accelerometer does not support batching.
                uint maxLatency = accelerometer.MaxBatchSize * desiredReportInterval;
                desiredReportLatency = Math.Min(maxLatency, 10000);

                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
                ScenarioEnableButton.IsEnabled = true;
            }
            else
            {
                rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ScenarioDisable();
            }
        }

async void ReadingChanged | ( | object | sender,
 |  | AccelerometerReadingChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for ReadingChanged events.

Parameters:
sender
e

Definition at line 97 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.SetReadingText(ScenarioOutput, e.Reading);
            });
        }

void ScenarioDisable ( ) [inline, private]

This is the click handler for the 'Disable' button.

Definition at line 125 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            Window.Current.VisibilityChanged -= VisibilityChanged;
            accelerometer.ReadingChanged -= ReadingChanged;

            // Restore the default report interval to release resources while the sensor is not in use
            accelerometer.ReportInterval = 0;

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable ( ) [inline, private]

This is the click handler for the 'Enable' button.

Definition at line 108 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            // Establish the report interval
            accelerometer.ReportInterval = desiredReportInterval;

            // Establish the report latency. This is a no-op if the accelerometer does not support batching
            accelerometer.ReportLatency = desiredReportLatency;
            Window.Current.VisibilityChanged += VisibilityChanged;
            accelerometer.ReadingChanged += ReadingChanged;

            ScenarioEnableButton.IsEnabled = false;
            ScenarioDisableButton.IsEnabled = true;
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 75 of file Scenario5_DataEventsBatching.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    accelerometer.ReadingChanged += ReadingChanged;
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    accelerometer.ReadingChanged -= ReadingChanged;
                }
            }
        }

Member Data Documentation

Accelerometer accelerometer [private]

Definition at line 27 of file Scenario5_DataEventsBatching.xaml.cs.

uint desiredReportInterval [private]

Definition at line 28 of file Scenario5_DataEventsBatching.xaml.cs.

uint desiredReportLatency [private]

Definition at line 29 of file Scenario5_DataEventsBatching.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario5_DataEventsBatching.xaml.cs.

The documentation for this class was generated from the following files:
  • Accelerometer/cs/Scenario5_DataEventsBatching.xaml.cs
  • Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_DefiningCustomGlyphs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_DefiningCustomGlyphs
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_DefiningCustomGlyphs Class Reference

List of all members.

Public Member Functions

Scenario5_DefiningCustomGlyphs ()
bool | IsNonNull (object item)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

IBuffer | CreateSolidGlyphBuffer (int widthInPixels, int heightInPixels)
async void | DefineGlyphButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeAsync ()
async void | ResetButton_Click (object sender, RoutedEventArgs e)

Private Attributes

IBuffer | glyphBuffer
ClaimedLineDisplay | lineDisplay
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

Constructor & Destructor Documentation

Scenario5_DefiningCustomGlyphs ( ) [inline]

Definition at line 31 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            this.InitializeComponent();
            DataContext = this;
        }

Member Function Documentation

IBuffer CreateSolidGlyphBuffer | ( | int | widthInPixels,
 |  | int | heightInPixels |
 | ) |  |  | [inline, private]

Definition at line 104 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            // Data is sent in one byte chunks, so find the minimum number of whole bytes
            // needed to define each row of the glyph.
            int bytesPerRow = (widthInPixels + 7) / 8;

            byte[] newGlyphBuffer = new byte[bytesPerRow * heightInPixels];
            for (int i = 0; i < newGlyphBuffer.Length; i++)
            {
                // Set every bit so that we draw a solid rectangle.
                newGlyphBuffer[i] = 0xFF;
            }

            return CryptographicBuffer.CreateFromByteArray(newGlyphBuffer);
        }

async void DefineGlyphButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            var selectedGlyphCode = Helpers.GetSelectedItemTag<uint>(SupportedGlyphsComboBox);
            if (await lineDisplay.CustomGlyphs.TryRedefineAsync((uint)selectedGlyphCode, glyphBuffer) &&
                await lineDisplay.DefaultWindow.TryRefreshAsync())
            {
                // Success. See results on the line display.
                rootPage.NotifyUser($"Redefined glyph {selectedGlyphCode}.", NotifyType.ErrorMessage);

            }
            else
            {
                rootPage.NotifyUser("Unable to redefine glyph and refresh.", NotifyType.ErrorMessage);
            }
        }

task< void > InitializeAsync ( ) [inline, private]

Definition at line 48 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            ResetButton.IsEnabled = false;
            SupportedGlyphsComboBox.Items.Clear();

            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();

            if ((lineDisplay != null) && lineDisplay.Capabilities.CanDisplayCustomGlyphs)
            {
                string sampleText = "ABC";
                foreach (uint glyphCode in lineDisplay.CustomGlyphs.SupportedGlyphCodes)
                {
                    string glyphString = Char.ConvertFromUtf32((int)glyphCode);
                    SupportedGlyphsComboBox.Items.Add(new ComboBoxItem { Content = $"Code {glyphCode} (UTF-32 '{glyphString}')", Tag = glyphCode });
                    if (sampleText.Length < 10)
                    {
                        sampleText += glyphString;
                    }
                }

                if (SupportedGlyphsComboBox.Items.Count > 0)
                {
                    SupportedGlyphsComboBox.SelectedIndex = 0;
                }

                Size glyphSize = lineDisplay.CustomGlyphs.SizeInPixels;
                glyphBuffer = CreateSolidGlyphBuffer((int)glyphSize.Width, (int)glyphSize.Height);

                await lineDisplay.DefaultWindow.TryDisplayTextAsync(sampleText);
            }

            ResetButton.IsEnabled = true;
        }

bool IsNonNull ( object item )
override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            await InitializeAsync();
        }

async void ResetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 98 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

        {
            lineDisplay?.Dispose();
            await InitializeAsync();
        }

Member Data Documentation

IBuffer glyphBuffer [private]

Definition at line 29 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

ClaimedLineDisplay lineDisplay [private]

Definition at line 27 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario5_DefiningCustomGlyphs.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario5_DefiningCustomGlyphs.xaml.cs
  • LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_DisplayingBarcodePreview Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_DisplayingBarcodePreview
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes | Static Private Attributes

Scenario5_DisplayingBarcodePreview Class Reference

List of all members.

Public Member Functions

Scenario5_DisplayingBarcodePreview ()
void | RaisePropertyChanged (string propertyName=null)

Protected Member Functions

async override void | OnNavigatedFrom (NavigationEventArgs e)

Properties

bool | IsPreviewing = false [get, set]
bool | IsScannerClaimed [get, set]
bool | ScannerSupportsPreview = false [get, set]
bool | SoftwareTriggerStarted = false [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | ClaimedScanner_Closed (ClaimedBarcodeScanner sender, ClaimedBarcodeScannerClosedEventArgs args)
async void | ClaimedScanner_DataReceived (ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
async Task | CloseScannerResourcesAsync ()
void | FlipPreview_Click (object sender, RoutedEventArgs e)
void | HidePreviewButton_Click (object sender, RoutedEventArgs e)
void | MediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
async void | ScannerSelection_Changed (object sender, SelectionChangedEventArgs args)
async Task | SelectScannerAsync (string scannerDeviceId)
async Task | SetPreviewRotationAsync (DisplayOrientations displayOrientation)
async void | ShowPreviewButton_Click (object sender, RoutedEventArgs e)
async Task | StartMediaCaptureAsync (string videoDeviceId)
async void | StartSoftwareTriggerButton_Click (object sender, RoutedEventArgs e)
async void | StopSoftwareTriggerButton_Click (object sender, RoutedEventArgs e)
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)
void | Watcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)
void | Watcher_Updated (DeviceWatcher sender, DeviceInformationUpdate args)

Private Attributes

ObservableCollection
< BarcodeScannerInfo > 		barcodeScanners = new ObservableCollection<BarcodeScannerInfo>()
ClaimedBarcodeScanner | claimedScanner = null
DisplayRequest | displayRequest = new DisplayRequest()
bool | isSelectionChanging = false
bool | isStopPending = false
MediaCapture | mediaCapture
string | pendingSelectionDeviceId = null
MainPage | rootPage = false MainPage.Current
BarcodeScanner | selectedScanner = null
DeviceWatcher | watcher

Static Private Attributes

static readonly Guid | rotationGuid = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1")

Detailed Description

Definition at line 29 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

Constructor & Destructor Documentation

Scenario5_DisplayingBarcodePreview ( ) [inline]

Definition at line 53 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            this.InitializeComponent();

            ScannerListSource.Source = barcodeScanners;

            watcher = DeviceInformation.CreateWatcher(BarcodeScanner.GetDeviceSelector());
            watcher.Added += Watcher_Added;
            watcher.Removed += Watcher_Removed;
            watcher.Updated += Watcher_Updated;
            watcher.Start();

            DataContext = this;
        }

Member Function Documentation

void ClaimedScanner_Closed | ( | ClaimedBarcodeScanner | sender,
 |  | ClaimedBarcodeScannerClosedEventArgs | args |
 | ) |  |  | [inline, private]

Closed notification was received from the selected scanner.

Parameters:
sender
args

Definition at line 419 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            // Resources associated to the claimed barcode scanner can be cleaned up here
        }

async void ClaimedScanner_DataReceived | ( | ClaimedBarcodeScanner | sender,
 |  | BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Scan data was received from the selected scanner.

Parameters:
sender
args

Definition at line 429 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ScenarioOutputScanDataLabel.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
                ScenarioOutputScanData.Text = DataHelpers.GetDataString(args.Report.ScanData);
                ScenarioOutputScanDataType.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
            });
        }

async Task CloseScannerResourcesAsync ( ) [inline, private]

Close the scanners and stop the preview.

Definition at line 165 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            claimedScanner?.Dispose();
            claimedScanner = null;

            selectedScanner?.Dispose();
            selectedScanner = null;

            SoftwareTriggerStarted = false;
            RaisePropertyChanged(nameof(SoftwareTriggerStarted));

            if (IsPreviewing)
            {
                if (mediaCapture != null)
                {
                    await mediaCapture.StopPreviewAsync();
                    mediaCapture.Dispose();
                    mediaCapture = null;
                }

                // Allow the display to go to sleep.
                displayRequest.RequestRelease();

                IsPreviewing = false;
                RaisePropertyChanged(nameof(IsPreviewing));
            }
        }

void FlipPreview_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Flip Preview Button Click.

Stops scanning.

Parameters:
sender
e

Definition at line 324 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            if (PreviewControl.FlowDirection == FlowDirection.LeftToRight)
            {
                PreviewControl.FlowDirection = FlowDirection.RightToLeft;
            }
            else
            {
                PreviewControl.FlowDirection = FlowDirection.LeftToRight;
            }
        }

void HidePreviewButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Hide Preview Button Click.

Hides the preview window for the selected barcode scanner.

Parameters:
sender
e

Definition at line 280 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            claimedScanner?.HideVideoPreview();
        }

void MediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Media capture failed, potentially due to the camera being unplugged.

Parameters:
sender
errorEventArgs

Definition at line 258 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            rootPage.NotifyUser("Media capture failed. Make sure the camera is still connected.", NotifyType.ErrorMessage);
        }

async override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 94 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            watcher.Stop();

            if (isSelectionChanging)
            {
                // If selection is changing, then let it know to stop media capture
                // when it's done.
                isStopPending = true;
            }
            else
            {
                // If selection is not changing, then it's safe to stop immediately.
                await CloseScannerResourcesAsync();
            }
        }

void RaisePropertyChanged ( string propertyName = null ) [inline]

Update listeners that a property was changed so that data bindings can be updated.

Parameters:
propertyName

Definition at line 443 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

async void ScannerSelection_Changed | ( | object | sender,
 |  | SelectionChangedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for scanner listbox selection changed.

Parameters:
sender
args

Definition at line 341 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            var selectedScannerInfo = (BarcodeScannerInfo)args.AddedItems[0];
            var deviceId = selectedScannerInfo.DeviceId;

            if (isSelectionChanging)
            {
                pendingSelectionDeviceId = deviceId;
                return;
            }

            do
            {
                await SelectScannerAsync(deviceId);

                // Stop takes precedence over updating the selection.
                if (isStopPending)
                {
                    await CloseScannerResourcesAsync();
                    break;
                }

                deviceId = pendingSelectionDeviceId;
                pendingSelectionDeviceId = null;
            } while (!String.IsNullOrEmpty(deviceId));
        }

async Task SelectScannerAsync ( string scannerDeviceId ) [inline, private]

Select the scanner specified by its device ID.

Parameters:
scannerDeviceId

Definition at line 372 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            isSelectionChanging = true;

            await CloseScannerResourcesAsync();

            selectedScanner = await BarcodeScanner.FromIdAsync(scannerDeviceId);

            if (selectedScanner != null)
            {
                claimedScanner = await selectedScanner.ClaimScannerAsync();
                if (claimedScanner != null)
                {
                    await claimedScanner.EnableAsync();
                    claimedScanner.Closed += ClaimedScanner_Closed;
                    ScannerSupportsPreview = !String.IsNullOrEmpty(selectedScanner.VideoDeviceId);
                    RaisePropertyChanged(nameof(ScannerSupportsPreview));

                    claimedScanner.DataReceived += ClaimedScanner_DataReceived;

                    if (ScannerSupportsPreview)
                    {
                        await StartMediaCaptureAsync(selectedScanner.VideoDeviceId);
                    }
                }
                else
                {
                    rootPage.NotifyUser("Failed to claim the selected barcode scanner", NotifyType.ErrorMessage);
                }

            }
            else
            {
                rootPage.NotifyUser("Failed to create a barcode scanner object", NotifyType.ErrorMessage);
            }

            IsScannerClaimed = claimedScanner != null;
            RaisePropertyChanged(nameof(IsScannerClaimed));

            isSelectionChanging = false;
        }

async Task SetPreviewRotationAsync ( DisplayOrientations displayOrientation ) [inline, private]

Set preview rotation and mirroring state to adjust for the orientation of the camera, and for embedded cameras, the rotation of the device.

Parameters:
message
type

Definition at line 198 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            bool isExternalCamera;
            bool isPreviewMirrored;

            // Figure out where the camera is located to account for mirroring and later adjust rotation accordingly.
            DeviceInformation cameraInformation = await DeviceInformation.CreateFromIdAsync(selectedScanner.VideoDeviceId);

            if ((cameraInformation.EnclosureLocation == null) || (cameraInformation.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown))
            {
                isExternalCamera = true;
                isPreviewMirrored = false;
            }
            else
            {
                isExternalCamera = false;
                isPreviewMirrored = (cameraInformation.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
            }

            PreviewControl.FlowDirection = isPreviewMirrored ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

            if (!isExternalCamera)
            {
                // Calculate which way and how far to rotate the preview.
                int rotationDegrees = 0;
                switch (displayOrientation)
                {
                    case DisplayOrientations.Portrait:
                        rotationDegrees = 90;
                        break;
                    case DisplayOrientations.LandscapeFlipped:
                        rotationDegrees = 180;
                        break;
                    case DisplayOrientations.PortraitFlipped:
                        rotationDegrees = 270;
                        break;
                    case DisplayOrientations.Landscape:
                    default:
                        rotationDegrees = 0;
                        break;
                }

                // The rotation direction needs to be inverted if the preview is being mirrored.
                if (isPreviewMirrored)
                {
                    rotationDegrees = (360 - rotationDegrees) % 360;
                }

                // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames.
                var streamProperties = mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
                streamProperties.Properties[rotationGuid] = rotationDegrees;
                await mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, streamProperties, null);
            }
        }

async void ShowPreviewButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Show Preview Button Click.

Displays the preview window for the selected barcode scanner.

Parameters:
sender
e

Definition at line 269 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            await claimedScanner?.ShowVideoPreviewAsync();
        }

async Task StartMediaCaptureAsync ( string videoDeviceId ) [inline, private]

Starts previewing the selected scanner's video feed and prevents the display from going to sleep.

Definition at line 114 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            mediaCapture = new MediaCapture();

            // Register for a notification when something goes wrong
            mediaCapture.Failed += MediaCapture_Failed;

            var settings = new MediaCaptureInitializationSettings
            {
                VideoDeviceId = videoDeviceId,
                StreamingCaptureMode = StreamingCaptureMode.Video,
                SharingMode = MediaCaptureSharingMode.SharedReadOnly,
            };

            // Initialize MediaCapture
            bool captureInitialized = false;
            try
            {
                await mediaCapture.InitializeAsync(settings);
                captureInitialized = true;
            }
            catch (UnauthorizedAccessException)
            {
                rootPage.NotifyUser("The app was denied access to the camera", NotifyType.ErrorMessage);
            }
            catch (Exception e)
            {
                rootPage.NotifyUser("Failed to initialize the camera: " + e.Message, NotifyType.ErrorMessage);
            }

            if (captureInitialized)
            {
                // Prevent the device from sleeping while the preview is running.
                displayRequest.RequestActive();

                PreviewControl.Source = mediaCapture;
                await mediaCapture.StartPreviewAsync();
                await SetPreviewRotationAsync(DisplayInformation.GetForCurrentView().CurrentOrientation);
                IsPreviewing = true;
                RaisePropertyChanged(nameof(IsPreviewing));
            }
            else
            {
                mediaCapture.Dispose();
                mediaCapture = null;
            }
        }

async void StartSoftwareTriggerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Start Software Trigger Button Click.

Starts scanning.

Parameters:
sender
e

Definition at line 291 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            if (claimedScanner != null)
            {
                await claimedScanner.StartSoftwareTriggerAsync();

                SoftwareTriggerStarted = true;
                RaisePropertyChanged(nameof(SoftwareTriggerStarted));
            }
        }

async void StopSoftwareTriggerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Event Handler for Stop Software Trigger Button Click.

Stops scanning.

Parameters:
sender
e

Definition at line 308 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            if (claimedScanner != null)
            {
                await claimedScanner.StopSoftwareTriggerAsync();
                SoftwareTriggerStarted = false;
                RaisePropertyChanged(nameof(SoftwareTriggerStarted));
            }
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                barcodeScanners.Add(new BarcodeScannerInfo(args.Name, args.Id));

                // Select the first scanner by default.
                if (barcodeScanners.Count == 1)
                {
                    ScannerListBox.SelectedIndex = 0;
                }
            });
        }

void Watcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            // We don't do anything here, but this event needs to be handled to enable realtime updates.
            // See https://aka.ms/devicewatcher_added.
        }

void Watcher_Updated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

        {
            // We don't do anything here, but this event needs to be handled to enable realtime updates.
            //See https://aka.ms/devicewatcher_added.
        }

Member Data Documentation

ObservableCollection<BarcodeScannerInfo> barcodeScanners = new ObservableCollection<BarcodeScannerInfo>() [private]

Definition at line 37 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

ClaimedBarcodeScanner claimedScanner = null [private]

Definition at line 39 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

DisplayRequest displayRequest = new DisplayRequest() [private]

Definition at line 44 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

bool isSelectionChanging = false [private]

Definition at line 47 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

bool isStopPending = false [private]

Definition at line 49 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

MediaCapture mediaCapture [private]

Definition at line 45 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

string pendingSelectionDeviceId = null [private]

Definition at line 48 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

MainPage rootPage = false MainPage.Current [private]

Definition at line 36 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

readonly Guid rotationGuid = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1") [static, private]

Definition at line 42 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

BarcodeScanner selectedScanner = null [private]

Definition at line 38 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

DeviceWatcher watcher [private]

Definition at line 40 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

Property Documentation

bool IsPreviewing = false [get, set]

Definition at line 32 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

bool IsScannerClaimed [get, set]

Definition at line 31 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

bool ScannerSupportsPreview = false [get, set]

Definition at line 33 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

bool SoftwareTriggerStarted = false [get, set]

Definition at line 34 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 51 of file Scenario5_DisplayingBarcodePreview.xaml.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/Scenario5_DisplayingBarcodePreview.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GeofenceBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_GeofenceBackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_GeofenceBackgroundTask Class Reference

List of all members.

Public Member Functions

Scenario5_GeofenceBackgroundTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | FillEventListBoxWithExistingEvents ()
async void | OnCompleted (IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UpdateButtonStates ()

Private Attributes

IBackgroundTaskRegistration | _geofenceTask = null
MainPage _rootPage = MainPage.Current
const string | BackgroundTaskEntryPoint = "BackgroundTask.GeofenceBackgroundTask"
const string | BackgroundTaskName = "SampleGeofenceBackgroundTask"

Detailed Description

Definition at line 23 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

Constructor & Destructor Documentation

Scenario5_GeofenceBackgroundTask ( ) [inline]

Definition at line 33 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void FillEventListBoxWithExistingEvents ( ) [inline, private]

Populate events list box with entries from BackgroundGeofenceEventCollection.

Definition at line 151 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            MainPage.FillItemsFromSavedJson(GeofenceBackgroundEventsListBox, "BackgroundGeofenceEventCollection");
        }

async void OnCompleted | ( | IBackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline, private]

This is the callback when background event has been handled.

Parameters:
sender
e

Definition at line 114 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            // Update the UI with progress reported by the background task
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    // Rethrow any exception that occurred in the background task.
                    e.CheckResult();

                    // Update the UI with the completion status of the background task
                    // The Run method of the background task sets this status.
                    MainPage.ReportSavedStatus();

                    FillEventListBoxWithExistingEvents();
                }
                catch (Exception ex)
                {
                    // The background task had an error
                    _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                }
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            // See if our background task is already registered.
            _geofenceTask = MainPage.LookupBackgroundTask(BackgroundTaskName);

            if (_geofenceTask != null)
            {
                // Associate an event handler with the existing background task
                _geofenceTask.Completed += OnCompleted;

                FillEventListBoxWithExistingEvents();
            }
            UpdateButtonStates();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Register' button.

Parameters:
sender
e

Definition at line 58 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            // Register the background task without checking whether the user has enabled background execution.
            // If it's disabled, and then the user later enables background execution, the background task will be ready to run.
            // Create a new background task builder
            BackgroundTaskBuilder geofenceTaskBuilder = new BackgroundTaskBuilder();

            geofenceTaskBuilder.Name = BackgroundTaskName;
            geofenceTaskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;

            // Create a new location trigger
            var trigger = new LocationTrigger(LocationTriggerType.Geofence);

            // Associate the location trigger with the background task builder
            geofenceTaskBuilder.SetTrigger(trigger);

            // If it is important that there is user presence and/or
            // internet connection when OnCompleted is called
            // the following could be called before calling Register()
            // SystemCondition condition = new SystemCondition(SystemConditionType.UserPresent | SystemConditionType.InternetAvailable);
            // geofenceTaskBuilder.AddCondition(condition);

            // Register the background task
            _geofenceTask = geofenceTaskBuilder.Register();

            // Associate an event handler with the new background task
            _geofenceTask.Completed += OnCompleted;

            UpdateButtonStates();
            MainPage.CheckBackgroundAndRequestLocationAccess();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Unregister' button.

Parameters:
sender
e

Definition at line 95 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            // Unregister the background task
            if (null != _geofenceTask)
            {
                _geofenceTask.Unregister(true);
                _geofenceTask.Completed -= OnCompleted;
                _geofenceTask = null;
            }

            _rootPage.NotifyUser("Geofence background task unregistered", NotifyType.StatusMessage);
            UpdateButtonStates();
        }

void UpdateButtonStates ( ) [inline, private]

Update the enable state of the register/unregister buttons.

Definition at line 141 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

        {
            bool registered = (_geofenceTask != null);
            RegisterBackgroundTaskButton.IsEnabled = !registered;
            UnregisterBackgroundTaskButton.IsEnabled = registered;
        }

Member Data Documentation

IBackgroundTaskRegistration _geofenceTask = null [private]

Definition at line 28 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

MainPage _rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

const string BackgroundTaskEntryPoint = "BackgroundTask.GeofenceBackgroundTask" [private]

Definition at line 26 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

const string BackgroundTaskName = "SampleGeofenceBackgroundTask" [private]

Definition at line 25 of file Scenario5_GeofenceBackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario5_GeofenceBackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GetSingleDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_GetSingleDevice
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_GetSingleDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario5_GetSingleDevice ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | GetButton_Click (object sender, RoutedEventArgs e)
async void | Page_Loaded (object sender, RoutedEventArgs e)

Private Attributes

DeviceInformationKind | deviceInformationKind
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario5_GetSingleDevice.xaml.cs.

Constructor & Destructor Documentation

Scenario5_GetSingleDevice ( ) [inline]

Definition at line 25 of file Scenario5_GetSingleDevice.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file Scenario5_GetSingleDevice.xaml.cs.

        {
            resultCollection.Clear();

            string interfaceId = interfaceIdTextBox.Text;
            getButton.IsEnabled = false;

            rootPage.NotifyUser("CreateFromIdAsync operation started...", NotifyType.StatusMessage);

            try
            {
                // When you want to "save" a DeviceInformation to get it back again later,
                // use both the DeviceInformation.Kind and the DeviceInformation.Id.
                DeviceInformation deviceInfo = await DeviceInformation.CreateFromIdAsync(interfaceId, null, deviceInformationKind);

                rootPage.NotifyUser("CreateFromIdAsync operation completed.", NotifyType.StatusMessage);

                resultCollection.Add(new DeviceInformationDisplay(deviceInfo));
            }
            catch (FileNotFoundException)
            {
                rootPage.NotifyUser("Invalid Interface Id", NotifyType.ErrorMessage);
            }

            getButton.IsEnabled = true;
            getButton.Focus(FocusState.Keyboard);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 30 of file Scenario5_GetSingleDevice.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;
        }

async void Page_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario5_GetSingleDevice.xaml.cs.

        {
            DeviceInformationCollection deviceInfoCollection;

            // Pre-populate the text box with an interface id.
            deviceInfoCollection = await DeviceInformation.FindAllAsync(DeviceClass.AudioRender);
            if (deviceInfoCollection.Count > 0)
            {
                // When you want to "save" a DeviceInformation to get it back again later,
                // use both the DeviceInformation.Kind and the DeviceInformation.Id.
                interfaceIdTextBox.Text = deviceInfoCollection[0].Id;
                deviceInformationKind = deviceInfoCollection[0].Kind;
                InformationKindTextBox.Text = deviceInformationKind.ToString();
                getButton.IsEnabled = true;
            }
        }

Member Data Documentation

DeviceInformationKind deviceInformationKind [private]

Definition at line 21 of file Scenario5_GetSingleDevice.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 23 of file Scenario5_GetSingleDevice.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario5_GetSingleDevice.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario5_GetSingleDevice.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_InkingAndInteractionFeedback Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_InkingAndInteractionFeedback
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_InkingAndInteractionFeedback Class Reference

List of all members.

Public Member Functions

Scenario5_InkingAndInteractionFeedback ()

Private Member Functions

Point | GetSnappedPoint ()
void | InitializeGridLines ()
void | InitializeManipulationTransforms ()
bool | IsInSnapRange ()
void | MovableRect_Entered (object sender, PointerRoutedEventArgs e)
void | MovableRect_Exited (object sender, PointerRoutedEventArgs e)
void | MovableRect_ManipulationCompleted (object sender, ManipulationCompletedRoutedEventArgs e)
void | MovableRect_ManipulationDelta (object sender, ManipulationDeltaRoutedEventArgs e)
void | MovableRect_ManipulationStarted (object sender, ManipulationStartedRoutedEventArgs e)
void | SnapMovableRectToGridLines ()
void | UpdatePreviewRect ()

Private Attributes

CompositeTransform | deltaTransform
readonly int | gridSize = 100
SimpleHapticsController | hapticsController
PenDevice | penDevice
Point | previewTopLeft = new Point(-1, -1)
MatrixTransform | previousTransform
readonly double | snapDistance = 20
Point | topLeft
TransformGroup | transforms

Detailed Description

Definition at line 32 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

Constructor & Destructor Documentation

Scenario5_InkingAndInteractionFeedback ( ) [inline]

Definition at line 45 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            InitializeComponent();
            InitializeGridLines();
            InitializeManipulationTransforms();
        }

Member Function Documentation

Point GetSnappedPoint ( ) [inline, private]

Definition at line 266 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            Point snappedPoint;
            if (topLeft.X % gridSize <= snapDistance)
            {
                snappedPoint.X = topLeft.X + topLeft.X % gridSize * -1;
            }
            else if (topLeft.X % gridSize >= gridSize - snapDistance)
            {
                snappedPoint.X = topLeft.X + gridSize - (topLeft.X % gridSize);
            }
            else
            {
                snappedPoint.X = topLeft.X;
            }
            if (topLeft.Y % gridSize <= snapDistance)
            {
                snappedPoint.Y = topLeft.Y + topLeft.Y % gridSize * -1;
            }
            else if (topLeft.Y % gridSize >= gridSize - snapDistance)
            {
                snappedPoint.Y = topLeft.Y + gridSize - (topLeft.Y % gridSize);
            }
            else
            {
                snappedPoint.Y = topLeft.Y;
            }
            return snappedPoint;
        }

void InitializeGridLines ( ) [inline, private]

Definition at line 53 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            SolidColorBrush darkGray = new SolidColorBrush(Colors.DarkGray);
            double width = hapticCanvas.Width;
            double height = hapticCanvas.Height;
            for (int i = 0; i <= width; i += gridSize)
            {
                Line currLine = new Line() {
                    Stroke = darkGray,
                    X1 = i,
                    X2 = i,
                    Y1 = 0,
                    Y2 = height,
                };
                hapticCanvas.Children.Add(currLine);
            }
            for (int i = 0; i <= height; i += gridSize)
            {
                Line currLine = new Line() {
                    Stroke = darkGray,
                    X1 = 0,
                    X2 = width,
                    Y1 = i,
                    Y2 = i,
                };
                hapticCanvas.Children.Add(currLine);
            }
        }

void InitializeManipulationTransforms ( ) [inline, private]

Definition at line 83 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
            topLeft = new Point(75, 75);
            deltaTransform = new CompositeTransform() { TranslateX = topLeft.X, TranslateY = topLeft.Y };

            transforms = new TransformGroup() { Children = { previousTransform, deltaTransform } };

            // Set the render transform on the rect
            movableRect.RenderTransform = transforms;
        }

bool IsInSnapRange ( ) [inline, private]

Definition at line 297 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            return topLeft.X % gridSize <= snapDistance ||
                topLeft.X % gridSize >= gridSize - snapDistance ||
                topLeft.Y % gridSize <= snapDistance ||
                topLeft.Y % gridSize >= gridSize - snapDistance;
        }

void MovableRect_Entered | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            // If the current Pointer device is not a pen, exit
            if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
            {
                return;
            }

            // Attempt to retrieve the PenDevice from the current PointerId
            penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);

            // If a PenDevice cannot be retrieved based on the PointerId, it does not support
            // advanced pen features, such as tactile feedback
            if (penDevice == null)
            {
                statusText.Text = "Advanced pen features not supported";
                return;
            }

            // Check to see if the current PenDevice supports tactile feedback by seeing if it
            // has a SimpleHapticsController
            hapticsController = penDevice.SimpleHapticsController;
            if (hapticsController == null)
            {
                statusText.Text = "This pen does not provide tactile feedback";
                return;
            }

            // Send the InkContinuous waveform to the PenDevice's SimpleHapticsController.
            // Once sent, inking continuous tactile feedback will be triggered as soon as the pen tip touches
            // the screen and will be stopped once the pen tip is lifted from the screen.
            // Also, check to see if the current PenDevice's SimpleHapticsController supports
            // setting the intensity value of the tactile feedback.  If so, set it to 0.75.
            // If not, send the waveform with the default intensity.
            foreach (var waveform in hapticsController.SupportedFeedback)
            {
                if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.InkContinuous)
                {
                    if (hapticsController.IsIntensitySupported)
                    {
                        hapticsController.SendHapticFeedback(waveform, 0.75);
                     }
                    else
                    {
                        hapticsController.SendHapticFeedback(waveform);
                    }
                }
            }

        }

void MovableRect_Exited | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 153 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            penDevice = null;
            statusText.Text = "";
            if (hapticsController != null)
            {
                hapticsController.StopFeedback();
                hapticsController = null;
            }
        }

void MovableRect_ManipulationCompleted | ( | object | sender,
 |  | ManipulationCompletedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 230 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            movableRect.Style = MovableRectangle;
            if (IsInSnapRange())
            {
                SnapMovableRectToGridLines();
            }
        }

void MovableRect_ManipulationDelta | ( | object | sender,
 |  | ManipulationDeltaRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 173 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            previousTransform.Matrix = transforms.Value;

            // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve the X and Y changes
            deltaTransform.TranslateX = e.Delta.Translation.X;
            deltaTransform.TranslateY = e.Delta.Translation.Y;
            topLeft.X += e.Delta.Translation.X;
            topLeft.Y += e.Delta.Translation.Y;
            UpdatePreviewRect();
        }

void MovableRect_ManipulationStarted | ( | object | sender,
 |  | ManipulationStartedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 167 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            movableRect.Style = MovableRectangleDragged;
        }

void SnapMovableRectToGridLines ( ) [inline, private]

Definition at line 241 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            topLeft = GetSnappedPoint();
            previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
            deltaTransform.TranslateX = topLeft.X;
            deltaTransform.TranslateY = topLeft.Y;

            transforms = new TransformGroup() { Children = { previousTransform, deltaTransform } };

            movableRect.RenderTransform = transforms;

            if (hapticsController != null)
            {
                foreach (var waveform in hapticsController.SupportedFeedback)
                {
                    if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.Click)
                    {
                        hapticsController.SendHapticFeedback(waveform);
                    }
                }
            }
        }

void UpdatePreviewRect ( ) [inline, private]

Definition at line 189 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

        {
            if (IsInSnapRange())
            {
                previewRect.Visibility = Visibility.Visible;
                Point newPreviewTopLeft = GetSnappedPoint();

                // Check to see if this is the first time that the previewRect is in range of a given gridline
                // and send the Click tactile signal if so
                bool sendHaptics = true;
                if ((previewTopLeft.X == newPreviewTopLeft.X && previewTopLeft.Y == newPreviewTopLeft.Y) ||
                    (previewTopLeft.X == newPreviewTopLeft.X && newPreviewTopLeft.Y == topLeft.Y) ||
                    (previewTopLeft.Y == newPreviewTopLeft.Y && newPreviewTopLeft.X == topLeft.X))
                {
                    sendHaptics = false;
                }
                if (previewTopLeft.X != newPreviewTopLeft.X || previewTopLeft.Y != newPreviewTopLeft.Y)
                {
                    previewTopLeft = newPreviewTopLeft;
                    previewRect.Translation = new Vector3((float)previewTopLeft.X, (float)previewTopLeft.Y, 0);
                    if (hapticsController != null && sendHaptics)
                    {
                        foreach (var waveform in hapticsController.SupportedFeedback)
                        {
                            if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.Click)
                            {
                                hapticsController.SendHapticFeedback(waveform);
                            }
                        }
                    }
                }
            }
            else
            {
                previewRect.Visibility = Visibility.Collapsed;
                previewTopLeft = new Point(-1, -1);
            }
        }

Member Data Documentation

CompositeTransform deltaTransform [private]

Definition at line 40 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

readonly int gridSize = 100 [private]

Definition at line 34 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

SimpleHapticsController hapticsController [private]

Definition at line 42 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

PenDevice penDevice [private]

Definition at line 41 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

Point previewTopLeft = new Point(-1, -1) [private]

Definition at line 37 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

MatrixTransform previousTransform [private]

Definition at line 39 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

readonly double snapDistance = 20 [private]

Definition at line 35 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

Point topLeft [private]

Definition at line 36 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

TransformGroup transforms [private]

Definition at line 38 of file Scenario5_InkingAndInteractionFeedback.xaml.cs.

The documentation for this class was generated from the following file:
  • PenHaptics/cs/Scenario5_InkingAndInteractionFeedback.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_IsSupported Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_IsSupported
Public Member Functions | Protected Member Functions

Scenario5_IsSupported Class Reference

List of all members.

Public Member Functions

Scenario5_IsSupported ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 18 of file Scenario5_IsSupported.xaml.cs.

Constructor & Destructor Documentation

Scenario5_IsSupported ( ) [inline]

Definition at line 20 of file Scenario5_IsSupported.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 25 of file Scenario5_IsSupported.xaml.cs.

        {
            Supported.Text = JumpList.IsSupported() ? "supports" : "does not support";
        }

The documentation for this class was generated from the following files:
  • JumpList/cs/Scenario5_IsSupported.xaml.cs
  • JumpList/cpp/Scenario5_IsSupported.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_LaunchedFromSecondaryTile Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_LaunchedFromSecondaryTile
Public Member Functions | Private Attributes

Scenario5_LaunchedFromSecondaryTile Class Reference

List of all members.

Public Member Functions

Scenario5_LaunchedFromSecondaryTile ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 16 of file Scenario5_LaunchedFromSecondaryTile.xaml.cs.

Constructor & Destructor Documentation

Scenario5_LaunchedFromSecondaryTile ( ) [inline]

Definition at line 20 of file Scenario5_LaunchedFromSecondaryTile.xaml.cs.

        {
            this.InitializeComponent();

            if (!String.IsNullOrEmpty(rootPage.LaunchParam))
            {
                rootPage.NotifyUser("Application was activated from a Secondary Tile with the following Activation Arguments: " + MainPage.Current.LaunchParam, NotifyType.StatusMessage);
                rootPage.LaunchParam = null;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 18 of file Scenario5_LaunchedFromSecondaryTile.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario5_LaunchedFromSecondaryTile.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Metadata Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_Metadata
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_Metadata Class Reference

List of all members.

Public Member Functions

Scenario5_Metadata ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | HideDescriptionOnSmallScreen ()
void | Item_TimedMetadataTracksChanged (MediaPlaybackItem item, IVectorChangedEventArgs args)
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | metadata_emsg_mp4_CueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | metadata_extm3u_CueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | metadata_id3_CueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | metadata_TrackingEvents_CueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | metadata_TrackingEvents_CueExited (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | RegisterForMediaPlaybackItemEvents (MediaPlaybackItem item)
void | RegisterForMediaSourceEvents (MediaSource source)
void | RegisterMetadataHandlers (MediaPlaybackItem mediaPlaybackItem, int index)
async void | ScheduleAdFromScte35Payload (TimedMetadataTrack timedMetadataTrack, uint presentation_time_delta, uint timescale, uint event_duration, string scte35payload)
void | Source_OpenOperationCompleted (MediaSource source, MediaSourceOpenOperationCompletedEventArgs args)
void | UnregisterForMediaPlaybackItemEvents (MediaPlaybackItem item)
void | UnregisterForMediaSourceEvents (MediaSource source)
void | UnregisterHandlers (MediaPlayer mediaPlayer)
void | UnregisterMetadataHandlers (TimedMetadataTrack timedTrack)

Private Attributes

AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
UInt32 | lastProcessedAdId = 0
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger

Detailed Description

Definition at line 33 of file Scenario5_Metadata.xaml.cs.

Constructor & Destructor Documentation

Scenario5_Metadata ( ) [inline]

Definition at line 35 of file Scenario5_Metadata.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 167 of file Scenario5_Metadata.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

void Item_TimedMetadataTracksChanged | ( | MediaPlaybackItem | item,
 |  | IVectorChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 237 of file Scenario5_Metadata.xaml.cs.

        {
            Log($"item.TimedMetadataTracksChanged: CollectionChange:{args.CollectionChange} Index:{args.Index} Total:{item.TimedMetadataTracks.Count}");

            if (args.CollectionChange == CollectionChange.ItemInserted)
            {
                RegisterMetadataHandlers(item, (int)args.Index);
            }
            if (args.CollectionChange == CollectionChange.Reset)
            {
                for (int index = 0; index < item.TimedMetadataTracks.Count; index++)
                {
                    RegisterMetadataHandlers(item, index);
                }
            }
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 111 of file Scenario5_Metadata.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                var adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);

            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
                return null;
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = Guid.NewGuid().ToString();

            // In addition to logging, this scenario uses MediaSource events:
            RegisterForMediaSourceEvents(source);

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            // In addition to logging, this scenario uses MediaPlaybackItem events:
            RegisterForMediaPlaybackItemEvents(mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 625 of file Scenario5_Metadata.xaml.cs.

        {
            LoggerControl.Log(message);
        }

void metadata_emsg_mp4_CueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 382 of file Scenario5_Metadata.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();
            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} mp4 emsg DataCue CueEntered raised.");
            var dataCue = args.Cue as DataCue;
            if (dataCue != null)
            {
                // Ref: ISO/IEC 20009-1, Section 5.10.3.3.2 Definition of Box Type: 'emsg'
                string scheme_id_uri = string.Empty;
                string value = string.Empty;
                UInt32 timescale = (UInt32) TimeSpan.TicksPerSecond;
                UInt32 presentation_time_delta = (UInt32)dataCue.StartTime.Ticks;
                UInt32 event_duration = (UInt32)dataCue.Duration.Ticks;
                UInt32 id = 0;
                Byte[] message_data = null;

                const string scheme_id_uri_key = "emsg:scheme_id_uri";
                object propValue = null;
                dataCue.Properties.TryGetValue(scheme_id_uri_key, out propValue);
                scheme_id_uri = propValue!=null ? (string)propValue : "";

                const string value_key = "emsg:value";
                propValue = null;
                dataCue.Properties.TryGetValue(value_key, out propValue);
                value = propValue != null ? (string)propValue : "";

                const string timescale_key = "emsg:timescale";
                propValue = null;
                dataCue.Properties.TryGetValue(timescale_key, out propValue);
                timescale = propValue != null ? (UInt32)propValue : timescale;

                const string presentation_time_delta_key = "emsg:presentation_time_delta";
                propValue = null;
                dataCue.Properties.TryGetValue(presentation_time_delta_key, out propValue);
                presentation_time_delta = propValue != null ? (UInt32)propValue : presentation_time_delta;

                const string event_duration_key = "emsg:event_duration";
                propValue = null;
                dataCue.Properties.TryGetValue(event_duration_key, out propValue);
                event_duration = propValue != null ? (UInt32)propValue : event_duration;

                const string id_key = "emsg:id";
                propValue = null;
                dataCue.Properties.TryGetValue(id_key, out propValue);
                id = propValue != null ? (UInt32)propValue : 0;

                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {dataCue.Id}, StartTime: {dataCue.StartTime}, Duration: {dataCue.Duration}");
                logMsg.Append($"scheme_id_uri: {scheme_id_uri}, value: {value}, timescale: {timescale}, presentation_time_delta: {presentation_time_delta}, event_duration: {event_duration}, id: {id}");

                if (dataCue.Data != null)
                {
                    var dr = DataReader.FromBuffer(dataCue.Data);

                    // Check if this is a SCTE ad message:
                    // Ref:  http://dashif.org/identifiers/event-schemes/
                    if (scheme_id_uri.ToLower() == "urn:scte:scte35:2013:xml")
                    {
                        // SCTE recommends publishing emsg more than once, so we avoid reprocessing the same message id:
                        if (lastProcessedAdId != id)
                        {
                            lastProcessedAdId = id; // TODO: Requires robustness. Messages may be out of order, which would break this sample's logic.

                            dr.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
                            var scte35payload = dr.ReadString(dataCue.Data.Length);
                            logMsg.Append($", message_data: {scte35payload}");
                            ScheduleAdFromScte35Payload(timedMetadataTrack, presentation_time_delta, timescale, event_duration, scte35payload);
                        }
                        else
                        {
                            logMsg.AppendLine($"This emsg.Id, {id}, has already been processed.");
                        }
                    }
                    else
                    {
                        message_data = new byte[dataCue.Data.Length];
                        dr.ReadBytes(message_data);
                        // TODO: Use the 'emsg' bytes for something useful.
                        logMsg.Append($", message_data.Length: {message_data.Length}");
                    }
                }
            }
            Log(logMsg.ToString());
        }

void metadata_extm3u_CueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 332 of file Scenario5_Metadata.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();

            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} M3U8 DataCue CueEntered raised.");
            var dataCue = args.Cue as DataCue;
            if (dataCue != null && dataCue.Data != null)
            {
                // The payload is a UTF-16 Little Endian null-terminated string.
                // It is any comment line in a manifest that is not part of the HLS spec.
                var dr = DataReader.FromBuffer(dataCue.Data);
                dr.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf16LE;
                var m3u8Comment = dr.ReadString(dataCue.Data.Length / 2 - 1);
                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {dataCue.Id}, StartTime: {dataCue.StartTime}, Duration: {dataCue.Duration}");
                logMsg.Append(m3u8Comment);
                // TODO: Use the m3u8Comment string for something useful.
            }
            Log(logMsg.ToString());
        }

void metadata_id3_CueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 355 of file Scenario5_Metadata.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();
            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} ID3 DataCue CueEntered raised.");
            var dataCue = args.Cue as DataCue;
            if (dataCue != null && dataCue.Data != null && dataCue.Data.Length >= 10)
            {
                // The payload is the raw ID3 bytes found in a TS stream
                // Ref: http://id3.org/id3v2.4.0-structure
                var dr = DataReader.FromBuffer(dataCue.Data);
                var header_ID3 = dr.ReadString(3);
                var header_version_major = dr.ReadByte();
                var header_version_minor = dr.ReadByte();
                var header_flags = dr.ReadByte();
                var header_tagSize = dr.ReadUInt32();
                // TODO: Use the ID3 bytes for something useful.

                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {dataCue.Id}, StartTime: {dataCue.StartTime}, Duration: {dataCue.Duration}");
                logMsg.Append($"{header_ID3}, {header_version_major}.{header_version_minor}, {header_flags}, {header_tagSize}");
            }
            Log(logMsg.ToString());
        }

void metadata_TrackingEvents_CueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 589 of file Scenario5_Metadata.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();
            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} TrackingEventCue CueEntered raised.");
            var trackingEventCue = args.Cue as TrackingEventCue;
            if (trackingEventCue != null)
            {
                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {trackingEventCue.Id}, StartTime: {trackingEventCue.StartTime}, Duration: {trackingEventCue.Duration}");
                logMsg.Append($"{trackingEventCue.TrackingEventUri}");
                // TODO: Use the reporing Uri for something useful.
            }
            Log(logMsg.ToString());
        }

void metadata_TrackingEvents_CueExited | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 606 of file Scenario5_Metadata.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();
            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} TrackingEventCue CueExited raised.");
            var trackingEventCue = args.Cue as TrackingEventCue;
            if (trackingEventCue != null)
            {
                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {trackingEventCue.Id}, StartTime: {trackingEventCue.StartTime}, Duration: {trackingEventCue.Duration}");
                logMsg.Append($"{trackingEventCue.TrackingEventUri}");
            }
            Log(logMsg.ToString());
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario5_Metadata.xaml.cs.

        {

            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file Scenario5_Metadata.xaml.cs.

        {
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
            var prHelper = new PlayReadyHelper(LoggerControl);
            prHelper.SetUpProtectionManager(mediaPlayer);
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
                null,
                LoggerControl,
                LoadSourceFromUriAsync);

            ContentSelectorControl.SetAutoPlay(true);  // Force AutoPlay in this scenario.
        }

void RegisterForMediaPlaybackItemEvents ( MediaPlaybackItem item ) [inline, private]

Definition at line 206 of file Scenario5_Metadata.xaml.cs.

        {
            // If we encountered some unknown tags in an m3u8 manifest,
            // we might already have metadata tracks in the source,
            // which is used as the constructor for the MediaPlaybackItem.
            // Therefore, the MediaPlaybackItem may already have metadata tracks.
            // Since TracksChanged will not be raised for these it is best to check
            // if we have tracks, and set up the handlers:
            if (item.TimedMetadataTracks.Count > 0)
            {
                Log($"Registering existing TimedMetadataTracks, Count: {item.TimedMetadataTracks.Count}");

                for (int index = 0; index < item.TimedMetadataTracks.Count; index++)
                {
                    RegisterMetadataHandlers(item, index);
                }
            }

            // For any tracks found as the content is parsed, we register for the event handler:
            item.TimedMetadataTracksChanged += Item_TimedMetadataTracksChanged;
        }

void RegisterForMediaSourceEvents ( MediaSource source ) [inline, private]

Definition at line 180 of file Scenario5_Metadata.xaml.cs.

        {
            source.OpenOperationCompleted += Source_OpenOperationCompleted;
        }

void RegisterMetadataHandlers | ( | MediaPlaybackItem | mediaPlaybackItem,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 254 of file Scenario5_Metadata.xaml.cs.

        {
            var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
            object customValue = null;
            mediaPlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;

            StringBuilder logMsg = new StringBuilder($"{contentId} ");

            if (timedTrack.TrackKind == MediaTrackKind.TimedMetadata &&
                (timedTrack.TimedMetadataKind == TimedMetadataKind.Data ||
                timedTrack.TimedMetadataKind == TimedMetadataKind.Custom))
            {
                // Check for known dispatchTypes:
                var dispatchType = mediaPlaybackItem.TimedMetadataTracks[index].DispatchType;
                if (String.Equals(dispatchType, "EXTM3U", StringComparison.OrdinalIgnoreCase))
                {
                    timedTrack.CueEntered += metadata_extm3u_CueEntered;
                    timedTrack.Label = "HLS Manifest comments";
                    // Tell the platform that the app will render these.
                    // Without this, the CueEntered event will not be raised by the platform.
                    mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
                }
                else if (string.Equals(dispatchType, "15260DFFFF49443320FF49443320000F", StringComparison.OrdinalIgnoreCase)) // per Apple TS spec for ID3 meta
                {
                    timedTrack.CueEntered += metadata_id3_CueEntered;
                    timedTrack.Label = "ID3 Tags";
                    mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
                }
                else if (string.Equals(dispatchType, "emsg:mp4", StringComparison.OrdinalIgnoreCase)) // For 'emsg' box embedded in mp4 container
                {
                    timedTrack.CueEntered += metadata_emsg_mp4_CueEntered;
                    timedTrack.Label = "emsg payload";
                    mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
                }

                // Check for our Custom TimedMetadataTrack
                if (mediaPlaybackItem.TimedMetadataTracks[index].Id == "TrackingEvents")
                {
                    timedTrack.CueEntered += metadata_TrackingEvents_CueEntered;
                    timedTrack.CueExited += metadata_TrackingEvents_CueExited;
                    timedTrack.Label = "Tracking Events";
                    mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
                }

                logMsg.AppendLine($"Registered CueEntered for {timedTrack.Label}.");
            }
            else
            {
                logMsg.AppendLine("Did not register CueEntered for TimedMetadataTrack.");
            }
            logMsg.AppendLine($"TimedMetadataKind: {timedTrack.TimedMetadataKind}, Id: {timedTrack.Id}, Label: {timedTrack.Label}, DispatchType: {timedTrack.DispatchType}, Language: {timedTrack.Language}");

            Log(logMsg.ToString());
        }

async void ScheduleAdFromScte35Payload | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | uint | presentation_time_delta,
 |  | uint | timescale,
 |  | uint | event_duration,
 |  | string | scte35payload |
 | ) |  |  | [inline, private]

This function attempts to parse the SCTE-35 payload, then schedule an appropriately offset Ad using the MediaBreak APIs.

Parameters:
timedMetadataTrack Track which fired the cue
presentation_time_delta
timescale
event_duration
scte35payload

Definition at line 477 of file Scenario5_Metadata.xaml.cs.

        {
            // TODO: Parse SCTE-35
            //
            // Ref:
            // http://www.scte.org/SCTEDocs/Standards/ANSI_SCTE%20214-3%202015.pdf
            //
            // Eg:
            //
            // <SpliceInfoSection ptsAdjustment="0" scte35:tier="4095">
            //  <SpliceInsert spliceEventId="147467497"
            //                spliceEventCancelIndicator="false"
            //                outOfNetworkIndicator="false"
            //                uniqueProgramId="0"
            //                availNum="0"
            //                availsExpected="0"
            //                spliceImmediateFlag="false" >
            //    <Program>
            //      <SpliceTime ptsTime="6257853600"/>
            //    </Program>
            //    <BreakDuration autoReturn="true" duration="900000"/>
            //  </SpliceInsert>
            // </SpliceInfoSection>
            //
            //

            // We use the metadata track object which fired the Cue to walk our way back up the
            // media object stack to find our original AdaptiveMediaSource.
            //
            // The AdaptiveMediaSource is required because the SCTE-35 payload includes
            // timing offsets which are relative to the original content PTS -- see below.
            var ams = timedMetadataTrack.PlaybackItem.Source.AdaptiveMediaSource;

            if (ams != null && timescale != 0)
            {
                // ++++
                // NOTE: DO NOT PARSE SCTE35 LIKE THIS IN PRODUCTION CODE!
                //
                // Reminder:
                //
                // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
                // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
                // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
                // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
                //
                // We will not demonstrate proper SCTE35 parsing in this sample,
                // but instead we search through the xml find the ptsTime if present,
                // and use it to schedule an ad; keeping in place the various time offsets.
                //
                // e.g.: var sampleScte35Payload = "<SpliceInfoSection ptsAdjustment=\"0\" scte35:tier=\"4095\">< SpliceInsert spliceEventId = \"147467497\" spliceEventCancelIndicator = \"false\" outOfNetworkIndicator = \"false\" uniqueProgramId = \"0\" availNum = \"0\" availsExpected = \"0\" spliceImmediateFlag = \"false\" > < Program >< SpliceTime ptsTime = \"6257853600\" /></ Program >  < BreakDuration autoReturn = \"true\" duration = \"900000\" />  </ SpliceInsert > </ SpliceInfoSection > ";
                //
                var xmlStrings = scte35payload.Split(new string[] { "<", "/", ">", " ", "=", "\"" }, StringSplitOptions.RemoveEmptyEntries);
                string ptsTime = string.Empty;
                for (int i = 0; i < xmlStrings.Length; i++)
                {
                    if (xmlStrings[i] == "ptsTime")
                    {
                        if (i + 1 < xmlStrings.Length)
                        {
                            ptsTime = xmlStrings[i + 1];
                            break;
                        }
                    }
                }
                // ----

                // The AdaptiveMediaSource keeps track of the original PTS in an AdaptiveMediaSourceCorrelatedTimes
                // object that can be retrieved via ams.GetCorrelatedTimes().  All the while, it provids the
                // media pipeline with a consistent timeline that re-aligns zero at the begining  of the SeekableRange
                // when first joining a Live stream.
                long pts = 0;
                long.TryParse(ptsTime, out pts);
                var timeCorrelation = ams.GetCorrelatedTimes();
                if (timeCorrelation.Position.HasValue && timeCorrelation.PresentationTimeStamp.HasValue)
                {
                    TimeSpan currentPosition;
                    await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        currentPosition = mediaPlayerElement.MediaPlayer.PlaybackSession.Position;
                    });
                    TimeSpan emsgPresentationTimeDelta = TimeSpan.FromSeconds(presentation_time_delta/timescale);
                    long delayInTicks = timeCorrelation.PresentationTimeStamp.Value.Ticks - pts;
                    TimeSpan correctionForAsyncCalls = currentPosition - timeCorrelation.Position.Value;
                    TimeSpan targetAdPosition = emsgPresentationTimeDelta + TimeSpan.FromTicks(delayInTicks) + correctionForAsyncCalls;

                    Log($"Timing Info: PlaybackSession.Position:{currentPosition}  targetAdPosition:{targetAdPosition}  Delta:{targetAdPosition-currentPosition}  Ams.Position:{timeCorrelation.Position.GetValueOrDefault().Ticks}  SCTE ptsTime:{pts}  emsgPresentationTimeDelta:{emsgPresentationTimeDelta} Ams.PresentationTimeStamp:{timeCorrelation.PresentationTimeStamp.GetValueOrDefault().Ticks}  Ams.ProgramDateTime:{timeCorrelation.ProgramDateTime.GetValueOrDefault()}");

                    MediaBreakInsertionMethod insertionMethod = ams.IsLive ? MediaBreakInsertionMethod.Replace : MediaBreakInsertionMethod.Interrupt;
                    var redSkyUri = new Uri("http://az29176.vo.msecnd.net/videocontent/RedSky_FoxRiverWisc_GettyImagesRF-499617760_1080_HD_EN-US.mp4");
                    if (targetAdPosition != TimeSpan.Zero && targetAdPosition >= currentPosition)
                    {
                        // Schedule ad in the future:
                        Log($"Ad insertion triggerd by 'emsg'.  Scheduled: {targetAdPosition.ToString()} Current:{currentPosition.ToString()}");
                        var midRollBreak = new MediaBreak(insertionMethod, targetAdPosition);
                        midRollBreak.PlaybackList.Items.Add(new MediaPlaybackItem(MediaSource.CreateFromUri(redSkyUri)));
                        timedMetadataTrack.PlaybackItem.BreakSchedule.InsertMidrollBreak(midRollBreak);
                    }
                    else
                    {
                        // Play now!
                        Log($"Ad inserted immediately.  Scheduled: {targetAdPosition.ToString()} Current:{currentPosition.ToString()}");
                        var midRollBreak = new MediaBreak(insertionMethod);
                        midRollBreak.PlaybackList.Items.Add(new MediaPlaybackItem(MediaSource.CreateFromUri(redSkyUri)));
                        await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            mediaPlayerElement.MediaPlayer.BreakManager.PlayBreak(midRollBreak);
                        });
                    }
                }
            }
        }

void Source_OpenOperationCompleted | ( | MediaSource | source,
 |  | MediaSourceOpenOperationCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 189 of file Scenario5_Metadata.xaml.cs.

        {
            // Here we create our own metadata track.
            // Our goal is to track progress through the asset and report it back to a server.
            object customValue = null;
            source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            var reportingUriFormat = "http://myserver/reporting/{0}?id={1}";
            // From \Shared\TrackingEventCue.cs :
            TrackingEventCue.CreateTrackingEventsTrack(source, contentId, reportingUriFormat);
        }

void UnregisterForMediaPlaybackItemEvents ( MediaPlaybackItem item ) [inline, private]

Definition at line 228 of file Scenario5_Metadata.xaml.cs.

        {
            item.TimedMetadataTracksChanged -= Item_TimedMetadataTracksChanged;
            foreach (var track in item.TimedMetadataTracks)
            {
                UnregisterMetadataHandlers(track);
            }
        }

void UnregisterForMediaSourceEvents ( MediaSource source ) [inline, private]

Definition at line 184 of file Scenario5_Metadata.xaml.cs.

        {
            source.OpenOperationCompleted -= Source_OpenOperationCompleted;
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 58 of file Scenario5_Metadata.xaml.cs.

        {
            AdaptiveMediaSource adaptiveMediaSource = null;
            MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
            if (mpItem != null)
            {
                adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
                UnregisterForMediaSourceEvents(mpItem.Source);
                UnregisterForMediaPlaybackItemEvents(mpItem);
            }
            MediaSource source = mediaPlayer.Source as MediaSource;
            if (source != null)
            {
                adaptiveMediaSource = source.AdaptiveMediaSource;
                UnregisterForMediaSourceEvents(source);
            }

            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;

        }

void UnregisterMetadataHandlers ( TimedMetadataTrack timedTrack ) [inline, private]

Definition at line 310 of file Scenario5_Metadata.xaml.cs.

        {
            if (timedTrack.Label == "HLS Manifest comments")
            {
                timedTrack.CueEntered -= metadata_extm3u_CueEntered;
            }
            if(timedTrack.Label == "ID3 Tags")
            {
                timedTrack.CueEntered -= metadata_id3_CueEntered;
            }
            if(timedTrack.Label == "emsg payload")
            {
                timedTrack.CueEntered -= metadata_emsg_mp4_CueEntered;
            }
            if (timedTrack.Label == "Tracking Events")
            {
                timedTrack.CueEntered -= metadata_TrackingEvents_CueEntered;
                timedTrack.CueExited -= metadata_TrackingEvents_CueExited;
            }
        }

Member Data Documentation

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 632 of file Scenario5_Metadata.xaml.cs.

UInt32 lastProcessedAdId = 0 [private]

Definition at line 381 of file Scenario5_Metadata.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 631 of file Scenario5_Metadata.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 629 of file Scenario5_Metadata.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 630 of file Scenario5_Metadata.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario5_Metadata.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Msappdata Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_Msappdata
Public Member Functions | Protected Member Functions

Scenario5_Msappdata Class Reference

List of all members.

Public Member Functions

Scenario5_Msappdata ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Detailed Description

Definition at line 19 of file Scenario5_Msappdata.xaml.cs.

Constructor & Destructor Documentation

Scenario5_Msappdata ( ) [inline]

Definition at line 21 of file Scenario5_Msappdata.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 26 of file Scenario5_Msappdata.xaml.cs.

        {
            ApplicationData appData = ApplicationData.Current;

            StorageFile sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataLocal.png"));
            try
            {
                await sourceFile.CopyAsync(appData.LocalFolder);
            }
            catch (Exception)
            {
                // If the image has already been copied the CopyAsync() method above will fail.
                // Ignore this error.
            }

            sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataRoaming.png"));
            try
            {
                await sourceFile.CopyAsync(appData.RoamingFolder);
            }
            catch (Exception)
            {
                // If the image has already been copied the CopyAsync() method above will fail.
                // Ignore this error.
            }

            sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataTemp.png"));
            try
            {
                await sourceFile.CopyAsync(appData.TemporaryFolder);
            }
            catch (Exception)
            {
                // If the image has already been copied the CopyAsync() method above will fail.
                // Ignore this error.
            }

            LocalImage.Source = new BitmapImage(new Uri("ms-appdata:///local/appDataLocal.png"));
            RoamingImage.Source = new BitmapImage(new Uri("ms-appdata:///roaming/appDataRoaming.png"));
            TempImage.Source = new BitmapImage(new Uri("ms-appdata:///temp/appDataTemp.png"));
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 68 of file Scenario5_Msappdata.xaml.cs.

        {
            LocalImage.Source = null;
            RoamingImage.Source = null;
            TempImage.Source = null;
        }

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario5_Msappdata.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_NavToFiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_NavToFiles
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_NavToFiles Class Reference

List of all members.

Public Member Functions

Scenario5_NavToFiles ()

Private Member Functions

async void | LoadFromLocalState_Click ()
void | LoadFromPackage_Click ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario5_NavToFiles.xaml.cs.

Constructor & Destructor Documentation

Scenario5_NavToFiles ( ) [inline]

Definition at line 24 of file Scenario5_NavToFiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void LoadFromLocalState_Click ( ) [inline, private]

Navigates the webview to the local state directory.

Parameters:
sender
e

Definition at line 46 of file Scenario5_NavToFiles.xaml.cs.

        {
            // Create a file in a subdirectory.
            // The ms-appdata protocol isolates top-level subdirectories from each other.

            StorageFolder stateFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("NavigateToState", CreationCollisionOption.OpenIfExists);
            StorageFile htmlFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///html/html_example2.html"));

            await htmlFile.CopyAsync(stateFolder, "test.html", NameCollisionOption.ReplaceExisting);

            string url = "ms-appdata:///local/NavigateToState/test.html";
            WebViewControl.Navigate(new Uri(url));
            rootPage.NotifyUser($"Navigated to {url}", NotifyType.StatusMessage);
        }

void LoadFromPackage_Click ( ) [inline, private]

Navigates the webview to the application package.

Parameters:
sender
e

Definition at line 34 of file Scenario5_NavToFiles.xaml.cs.

        {
            string url = "ms-appx-web:///html/html_example2.html";
            WebViewControl.Navigate(new Uri(url));
            rootPage.NotifyUser($"Navigated to {url}", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario5_NavToFiles.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario5_NavToFiles.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RandomAccess Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_RandomAccess
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario5_RandomAccess Class Reference

List of all members.

Public Member Functions

Scenario5_RandomAccess ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CancelActiveDownloadsAsync ()
bool | IsWebException (string title, Exception ex)
async void | OnDownloadProgress (IAsyncOperationWithProgress< DownloadOperation, DownloadOperation > sender, DownloadOperation progress)
async void | OnRangesDownloaded (DownloadOperation sender, BackgroundTransferRangesDownloadedEventArgs args)
void | PauseDownload_Click (object sender, RoutedEventArgs e)
void | ResumeDownload_Click (object sender, RoutedEventArgs e)
void | SeekDownload_Click (object sender, RoutedEventArgs e)
async void | StartDownload_Click (object sender, RoutedEventArgs e)
async Task | StartDownloadAndReadContentsAsync ()

Static Private Member Functions

static string | FormatDownloadedRanges (IEnumerable< BackgroundTransferFileRange > ranges)

Private Attributes

const uint | BytesPerMegaByte = 1000000
DownloadOperation | download = null
IRandomAccessStreamWithContentType | randomAccessStream = null
CancellationTokenSource | readCancellationTokenSource = new CancellationTokenSource()
Task< IBuffer > | readOperation = null
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario5_RandomAccess.xaml.cs.

Constructor & Destructor Documentation

Scenario5_RandomAccess ( ) [inline]

Definition at line 41 of file Scenario5_RandomAccess.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

task< void > CancelActiveDownloadsAsync ( ) [inline, private]

Definition at line 63 of file Scenario5_RandomAccess.xaml.cs.

        {
            IReadOnlyList<DownloadOperation> downloads;
            try
            {
                downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
            }
            catch (Exception ex) when (IsWebException("Discovery error", ex))
            {
                // Don't worry if the old downloads encountered web exceptions.
                return;
            }

            // If previous sample instances/scenarios started transfers that haven't completed yet, cancel them now
            // so that we can start this scenario cleanly.
            if (downloads.Count > 0)
            {
                using (CancellationTokenSource canceledToken = new CancellationTokenSource())
                {
                    canceledToken.Cancel();

                    Task[] tasks = new Task[downloads.Count];
                    for (int i = 0; i < downloads.Count; i++)
                    {
                        tasks[i] = downloads[i].AttachAsync().AsTask(canceledToken.Token);
                    }

                    try
                    {
                        await Task.WhenAll(tasks);
                    }
                    catch (TaskCanceledException)
                    {
                    }
                }
                rootPage.NotifyUser($"Canceled {downloads.Count} downloads.", NotifyType.StatusMessage);
            }
        }

static string FormatDownloadedRanges ( IEnumerable< BackgroundTransferFileRange > ranges ) [inline, static, private]

Definition at line 143 of file Scenario5_RandomAccess.xaml.cs.

        {
            string result = "";
            foreach (BackgroundTransferFileRange range in ranges)
            {
                if (result != "")
                {
                    result += ", ";
                }

                result += $"{range.Offset}-{range.Offset + range.Length - 1}";
            }

            if (result == "")
            {
                result = "None";
            }
            return result;
        }

bool IsWebException | ( | string | title,
 |  | Exception | ex |
 | ) |  |  | [inline, private]

Definition at line 364 of file Scenario5_RandomAccess.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            bool result = (error != WebErrorStatus.Unknown);
            string message = result ? error.ToString() : ex.Message;
            if (download == null)
            {
                rootPage.NotifyUser($"{title}: {message}", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser($"{download.Guid} - {title}: {message}", NotifyType.ErrorMessage);
            }

            return result;
        }

async void OnDownloadProgress | ( | IAsyncOperationWithProgress< DownloadOperation, DownloadOperation > | sender,
 |  | DownloadOperation | progress |
 | ) |  |  | [inline, private]

Definition at line 163 of file Scenario5_RandomAccess.xaml.cs.

        {
            // We capture a snapshot of DownloadOperation.Progress because
            // it is is updated in real-time while the operation is ongoing.
            BackgroundDownloadProgress currentProgress = progress.Progress;

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Prepare the progress message to display in the UI.
                ulong percent = 100;
                if (currentProgress.TotalBytesToReceive > 0)
                {
                    percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
                }

                DownloadedStatusText.Text = $"{currentProgress.Status} - {percent}% downloaded.";
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 57 of file Scenario5_RandomAccess.xaml.cs.

        {
            // Cancel any outstanding reads.
            readCancellationTokenSource.Cancel();
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario5_RandomAccess.xaml.cs.

        {
            // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
            // Typically this can be done in the App class by overriding OnLaunched() and checking for
            // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
            // We do it here in the sample to keep the sample code consolidated.
            // Note that for this specific scenario we are not interested in downloads from previous instances, so
            // we just enumerate all downloads from previous instances and cancel them immediately.
            await CancelActiveDownloadsAsync();
        }

async void OnRangesDownloaded | ( | DownloadOperation | sender,
 |  | BackgroundTransferRangesDownloadedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 182 of file Scenario5_RandomAccess.xaml.cs.

        {
            // BackgroundTransfer will wait for the app's RangesDownloaded event handlers to finish executing before
            // triggering the next RangesDownloaded event. Any download progress made while the app's handlers are
            // executing get coalesced into a single RangesDownloaded event.
            //
            // When calling async APIs inside this handler, we must first take a deferral and then complete it once we
            // are done processing the event. Otherwise, BackgroundTransfer will assume that the handler is done executing
            // as soon as the synchronous portion of the handler returns, even if there are still tasks running.
            using (args.GetDeferral())
            {
                // AddedRanges tells you which ranges were downloaded since the last RangesDownloaded event.
                // To get the full list of downloaded ranges, use the GetDownloadedRanges method.
                string message = " Newly-downloaded ranges: " + FormatDownloadedRanges(args.AddedRanges);

                // A download may restart if the server contents changed while the download is in progress.
                if (args.WasDownloadRestarted)
                {
                    message += " (download was restarted)";
                }

                // Wait for the UI update to happen before completing the deferral. That way, we can be certain that
                // the next RangesDownloaded event will not get triggered midway through the UI update.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    DownloadedRangesText.Text = FormatDownloadedRanges(sender.GetDownloadedRanges());
                    rootPage.NotifyUser(message, NotifyType.StatusMessage);
                });
            }
        }

void PauseDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario5_RandomAccess.xaml.cs.

        {
            if (download != null)
            {
                download.Pause();
                pauseDownloadButton.IsEnabled = false;
                resumeDownloadButton.IsEnabled = true;
            }
        }

void ResumeDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 112 of file Scenario5_RandomAccess.xaml.cs.

        {
            if (download != null)
            {
                download.Resume();
                pauseDownloadButton.IsEnabled = true;
                resumeDownloadButton.IsEnabled = false;
            }
        }

void SeekDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 122 of file Scenario5_RandomAccess.xaml.cs.

        {
            // Cancel the ongoing read operation (if any).
            if (readOperation != null)
            {
                readCancellationTokenSource.Cancel();

                // Re-create the CancellationTokenSource for future reads.
                readCancellationTokenSource = new CancellationTokenSource();
            }

            if (randomAccessStream != null)
            {
                // Update the stream's seek position to the user-selected one.
                // The new seek position will take effect on the next ReadAsync operation.
                var seekPositionInMegaBytes = (ulong)seekSlider.Value;
                ulong seekPositionInBytes = seekPositionInMegaBytes * BytesPerMegaByte;
                randomAccessStream.Seek(seekPositionInBytes);
            }
        }

async void StartDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 213 of file Scenario5_RandomAccess.xaml.cs.

        {
            // Reset the output whenever a new download attempt begins.
            DownloadedInfoText.Text = "";
            DownloadedStatusText.Text = "";
            DownloadedRangesText.Text = "None";
            PreviousReadText.Text = "";
            CurrentReadText.Text = "";

            Uri source;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out source))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            string destination = fileNameField.Text.Trim();
            if (string.IsNullOrWhiteSpace(destination))
            {
                rootPage.NotifyUser("A local file name is required.", NotifyType.ErrorMessage);
                return;
            }

            StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            StorageFile destinationFile;
            try
            {
                destinationFile = await picturesLibrary.CreateFileAsync(destination, CreationCollisionOption.GenerateUniqueName);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Error while creating file: " + ex.Message, NotifyType.ErrorMessage);
                return;
            }

            BackgroundDownloader downloader = new BackgroundDownloader();
            download = downloader.CreateDownload(source, destinationFile);

            // Apps need to set the IsRandomAccessRequired boolean property to TRUE (default is FALSE) before they
            // call StartAsync() on a DownloadOperation object if they want to use the random access feature. After
            // opting into "random access" mode, GetResultRandomAccessStreamReference() can be called.
            //
            // Setting IsRandomAccessRequired to TRUE before starting the download is necessary because the
            // server-side requirements for Random Access functionality are stricter than for regular (sequential)
            // downloads, so BackgroundTransfer needs to know the app's intentions in advance. That way, it can fail
            // the transfer up front if the server does not satisfy those additional requirements (e.g., HTTP range
            // header support).
            download.IsRandomAccessRequired = true;

            // Subscribe to RangesDownloaded notifications.
            download.RangesDownloaded += OnRangesDownloaded;

            DownloadedInfoText.Text = $"Downloading to {destinationFile.Name}, {download.Guid}";

            // Start the download and read partially-downloaded content while the transfer is still ongoing.
            await StartDownloadAndReadContentsAsync();
        }

task< void > StartDownloadAndReadContentsAsync ( ) [inline, private]

Definition at line 271 of file Scenario5_RandomAccess.xaml.cs.

        {
            try
            {
                // Retrieve a random access stream from the download operation. Every OpenReadAsync() operation returns
                // a new stream instance that is independent of previous ones (i.e., the seek position of one stream
                // isn't affected by calls on another stream).
                //
                // This sample demonstrates the direct usage of a DownloadOperation's random access stream and its
                // effects on the ongoing transfer. However, bear in mind that there are a variety of operations
                // that can manage the stream on the app's behalf for specific scenarios. For instance, a
                // DownloadOperation pointing to a video URL can be consumed by the MediaPlayer class in four easy
                // steps:
                //
                // var randomAccessStreamReference = download.GetResultRandomAccessStreamReference();
                // stream = await randomAccessStreamReference.OpenReadAsync();
                // var mediaPlayer = new Windows.Media.Playback.MediaPlayer();
                // mediaPlayer.Source = Windows.Media.Core.MediaSource.CreateFromStream(stream, stream.ContentType);

                var randomAccessStreamReference = download.GetResultRandomAccessStreamReference();
                randomAccessStream = await randomAccessStreamReference.OpenReadAsync();

                // Start the download. If the server doesn't support random access, the download will fail
                // with WebErrorStatus.InsufficientRangeSupport or WebErrorStatus.MissingContentLengthSupport.
                IAsyncOperationWithProgress<DownloadOperation, DownloadOperation> downloadOperation = download.StartAsync();
                downloadOperation.Progress += OnDownloadProgress;
                Task downloadTask = downloadOperation.AsTask();

                startDownloadButton.IsEnabled = false;
                pauseDownloadButton.IsEnabled = true;

                // Read data while the download is still ongoing. Use a 1 MB read buffer for that purpose.
                var readBuffer = new Windows.Storage.Streams.Buffer(BytesPerMegaByte);
                while (!downloadTask.IsCompleted)
                {
                    ulong readOffsetInBytes = randomAccessStream.Position;

                    PreviousReadText.Text = CurrentReadText.Text;
                    CurrentReadText.Text = $"Reading from offset {readOffsetInBytes:n0}";

                    readOperation = randomAccessStream.ReadAsync(
                        readBuffer,
                        readBuffer.Capacity,
                        InputStreamOptions.None).
                        AsTask(readCancellationTokenSource.Token);

                    // Update the UI to show the current read's position.
                    currentPositionSlider.Value = readOffsetInBytes / BytesPerMegaByte;

                    try
                    {
                        // Wait for the read to complete.
                        IBuffer bytesRead = await readOperation;
                        CurrentReadText.Text += $", completed with {bytesRead.Length:n0} bytes";

                        // At this point, a real app would process the 'bytesRead' data to do something interesting
                        // with it (e.g., display video and/or play audio).

                        if (randomAccessStream.Position >= randomAccessStream.Size)
                        {
                            // We have reached EOF. Wrap around to the beginning while we wait for the download to complete.
                            randomAccessStream.Seek(0);
                        }
                    }
                    catch (OperationCanceledException)
                    {
                        // The ongoing read was canceled by SeekDownload_Click(...) in order for a new download
                        // position to take effect immediately.
                        CurrentReadText.Text += ", cancelled.";
                    }
                }

                // Wait for the download to complete.
                await downloadTask;

                rootPage.NotifyUser("Download completed successfully", NotifyType.StatusMessage);
            }
            catch (Exception ex) when (IsWebException("Execution error", ex))
            {
                // Abandon the operation if a web exception occurs.
            }
            finally
            {
                download = null;
                randomAccessStream = null;
                readOperation = null;

                startDownloadButton.IsEnabled = true;
                pauseDownloadButton.IsEnabled = false;
                resumeDownloadButton.IsEnabled = false;
            }
        }

Member Data Documentation

const uint BytesPerMegaByte = 1000000 [private]

Definition at line 33 of file Scenario5_RandomAccess.xaml.cs.

DownloadOperation download = null [private]

Definition at line 36 of file Scenario5_RandomAccess.xaml.cs.

IRandomAccessStreamWithContentType randomAccessStream = null [private]

Definition at line 37 of file Scenario5_RandomAccess.xaml.cs.

CancellationTokenSource readCancellationTokenSource = new CancellationTokenSource() [private]

Definition at line 39 of file Scenario5_RandomAccess.xaml.cs.

Task<IBuffer> readOperation = null [private]

Definition at line 38 of file Scenario5_RandomAccess.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario5_RandomAccess.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario5_RandomAccess.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RelativePositioning Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_RelativePositioning
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5_RelativePositioning Class Reference

List of all members.

Public Member Functions

Scenario5_RelativePositioning ()

Protected Member Functions

override async void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | ShowWindowBtn_Click (object sender, RoutedEventArgs e)

Private Attributes

AppWindow | appWindow
Frame | appWindowFrame = new Frame()

Detailed Description

Definition at line 23 of file Scenario5_RelativePositioning.xaml.cs.

Constructor & Destructor Documentation

Scenario5_RelativePositioning ( ) [inline]

Definition at line 28 of file Scenario5_RelativePositioning.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override async void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario5_RelativePositioning.xaml.cs.

        {
            if (appWindow != null)
            {
                await appWindow.CloseAsync();
            }
        }

async void ShowWindowBtn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario5_RelativePositioning.xaml.cs.

        {
            // Clear any previous message.
            MainPage.Current.NotifyUser(string.Empty, NotifyType.StatusMessage);

            if (!Double.TryParse(windowOffsetXTxt.Text, out var horizontalOffset) ||
                !Double.TryParse(windowOffsetYTxt.Text, out var verticalOffset))
            {
                MainPage.Current.NotifyUser($"Please specify valid numeric offsets.", NotifyType.ErrorMessage);
                return;
            }

            showWindowBtn.IsEnabled = false;

            // Only ever create and show one window.
            if (appWindow == null)
            {
                // Create a new window
                appWindow = await AppWindow.TryCreateAsync();
                // Make sure we release the reference to this window, and release XAML resources, when it's closed
                appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
                // Request the size of our window
                appWindow.RequestSize(new Size(500, 320));
                // Navigate the frame to the page we want to show in the new window
                appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
                // Attach the XAML content to our window
                ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
            }

            // Make a point for our offset.
            Point offset = new Point(horizontalOffset, verticalOffset);

            // Check if we should be setting our position relative to ApplicationView or DisplayRegion
            if (positionOffsetDisplayRegionRB.IsChecked.Value)
            {
                // Request an offset relative to the DisplayRegion we're on
                appWindow.RequestMoveRelativeToDisplayRegion(ApplicationView.GetForCurrentView().GetDisplayRegions()[0], offset);
            }
            else
            {
                // Relative to our ApplicationView
                appWindow.RequestMoveRelativeToCurrentViewContent(offset);
            }

            // If the window is not visible, show it and/or bring it to foreground
            if (!appWindow.IsVisible)
            {
                await appWindow.TryShowAsync();
            }

            showWindowBtn.IsEnabled = true;
        }

Member Data Documentation

AppWindow appWindow [private]

Definition at line 25 of file Scenario5_RelativePositioning.xaml.cs.

Frame appWindowFrame = new Frame() [private]

Definition at line 26 of file Scenario5_RelativePositioning.xaml.cs.

The documentation for this class was generated from the following file:
  • AppWindow/cs/Scenario5_RelativePositioning.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RestoreScrollPosition Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_RestoreScrollPosition
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario5_RestoreScrollPosition Class Reference

List of all members.

Public Member Functions

Scenario5_RestoreScrollPosition ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

IAsyncOperation< object > | GetItem (string key)
string | GetKey (object item)
void | ItemsListView_ContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
void | ItemsListView_ItemClick (object sender, RoutedEventArgs e)
async void | Page_Loaded (object sender, RoutedEventArgs e)

Private Attributes

ObservableCollection< Item > | _items = Item.GetItems(300)

Static Private Attributes

static double | _persistedItemContainerHeight = -1
static string | _persistedItemKey = ""
static string | _persistedPosition = ""

Detailed Description

Definition at line 23 of file Scenario5_RestoreScrollPosition.xaml.cs.

Constructor & Destructor Documentation

Scenario5_RestoreScrollPosition ( ) [inline]

Definition at line 33 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

IAsyncOperation<object> GetItem ( string key ) [inline, private]

Definition at line 54 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            // This function takes a key that ListViewPersistenceHelper parsed out of the _persistedPosition string
            // It returns an item that corresponds to the given key
            // The implementation of this function is dependent on the data model you are using. Every item in your list should have
            // a unique key this function returns
            return Task.Run(() =>
            {
                if (_items.Count <= 0)
                {
                    return null;
                }
                else
                {
                    return (object)_items.FirstOrDefault(i => i.Id == key);
                }
            }).AsAsyncOperation();
        }

string GetKey ( object item ) [inline, private]

Definition at line 73 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            // This function takes in the item at the top of the viewport at the moment of navigating away from the page, and returns
            // a key corresponding to that item. the implementation of this function is dependent on the data model you are using. In this
            // function we also save the fully rendered _persistedItemContainerHeight. You do not need to do this if all of your items have
            // the same fixed height. Finally, we save the key into a variable so it can be used outside of ListViewPersistenceHelper functions
            var singleItem = item as Item;
            if (singleItem != null)
            {
                _persistedItemContainerHeight = (ItemsListView.ContainerFromItem(item) as ListViewItem).ActualHeight;
                _persistedItemKey = singleItem.Id;
                return _persistedItemKey;
            }
            else
            {
                return string.Empty;
            }
        }

void ItemsListView_ContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 92 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            // This function manually sets the height of the item ListViewPersistenceHelper is attempting to scroll to. We need to set the height
            // because if the item is not fully rendered at the time of scrolling, it can return an incorrect height and cause ListViewPersistenceHelper
            // to overscroll.
            var singleItem = args.Item as Item;

            if (singleItem != null && singleItem.Id == _persistedItemKey)
            {
                if (!args.InRecycleQueue)
                {
                    // Here we set the container's height equal to the fully rendered container height we had saved before navigating away. If all the items in
                    // your list have the same fixed height, you can replace this variable with a hardcoded height value.
                    args.ItemContainer.Height = _persistedItemContainerHeight;
                }
                else
                {
                    // Containers in a list are recycled when they are scrolled out of view. However, if those containers have their Height property set and the content
                    // changes, that set Height is still applied. This creates an incorect UI if the items in your list are supposed to be of variable height.
                    // If all the items in your list have the same fixed height, you do not have to do this.
                    args.ItemContainer.ClearValue(HeightProperty);
                }
            }
        }

void ItemsListView_ItemClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            this.Frame.Navigate(typeof(ImagePage));
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 47 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            // Before we navigate away from the page, we want to generate a new _persistedPosition string. This string contains the key of the item at the top of the
            // viewing window (generated by the function GetKey) and the offset of that item.
            _persistedPosition = ListViewPersistenceHelper.GetRelativeScrollPosition(this.ItemsListView, this.GetKey);
        }

async void Page_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario5_RestoreScrollPosition.xaml.cs.

        {
            if (!string.IsNullOrEmpty(_persistedPosition))
            {
                // Here we kick off the async function to use the saved string _persistedPosition and the function GetItem to restore the scroll posistion
                await ListViewPersistenceHelper.SetRelativeScrollPositionAsync(this.ItemsListView, _persistedPosition, this.GetItem);
            }
        }

Member Data Documentation

ObservableCollection<Item> _items = Item.GetItems(300) [private]

Definition at line 28 of file Scenario5_RestoreScrollPosition.xaml.cs.

double _persistedItemContainerHeight = -1 [static, private]

Definition at line 29 of file Scenario5_RestoreScrollPosition.xaml.cs.

string _persistedItemKey = "" [static, private]

Definition at line 30 of file Scenario5_RestoreScrollPosition.xaml.cs.

string _persistedPosition = "" [static, private]

Definition at line 31 of file Scenario5_RestoreScrollPosition.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario5_RestoreScrollPosition.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RoundingAndPadding Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_RoundingAndPadding
Public Member Functions | Private Member Functions

Scenario5_RoundingAndPadding Class Reference

List of all members.

Public Member Functions

Scenario5_RoundingAndPadding ()

Private Member Functions

void | Display_Click (object sender, RoutedEventArgs e)
string | DisplayRoundingAlgorithmAsString (Windows.Globalization.NumberFormatting.RoundingAlgorithm roundingAlgorithm)
string | DoCurrencyRoundingScenarios (string currencyCode, RoundingAlgorithm roundingAlgorithm)
string | DoIncrementRoundingScenarios (RoundingAlgorithm roundingAlgorithm)
string | DoPaddingAndRoundingScenarios (RoundingAlgorithm roundingAlgorithm, int significantDigits, int integerDigits, int fractionalDigits)
string | DoPaddingScenarios (INumberFormatter formatter)
string | DoSignificantDigitRoundingScenarios (RoundingAlgorithm roundingAlgorithm)

Detailed Description

Definition at line 19 of file Scenario5_RoundingAndPadding.xaml.cs.

Constructor & Destructor Documentation

Scenario5_RoundingAndPadding ( ) [inline]

Definition at line 21 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 286 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Variable where we keep results to display
            StringBuilder results = new StringBuilder();

            // Create a decimal formatter used to do padding with only 4 significant digits.  We zero the
            // integerDigits and fractionDigits to only show the behavior of the significantDigits property
            // when formatting.
            DecimalFormatter decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            decimalFormatter.SignificantDigits = 4;
            decimalFormatter.IntegerDigits = 0;
            decimalFormatter.FractionDigits = 0;

            // Run through the scenarios with padding
            results.Append(DoPaddingScenarios(decimalFormatter));

            // Create a percent formatter used to do padding with 4 significant digits, 2 minimum integer
            // digits, 2 minimum factional digits.  This will show how the behavior of the significantDigits
            // property in conjunction with the integerDigits and fractionDigits properties.
            PercentFormatter percentFormatter = new Windows.Globalization.NumberFormatting.PercentFormatter();
            percentFormatter.SignificantDigits = 4;
            percentFormatter.IntegerDigits = 2;
            percentFormatter.FractionDigits = 2;

            // Run through the scenarios
            results.Append(DoPaddingScenarios(percentFormatter));

            // Do the significant rounding scenarios with round up algorithm
            results.Append(DoSignificantDigitRoundingScenarios(RoundingAlgorithm.RoundUp));

            // Do the significant rounding scenarios with round down algorithm
            results.Append(DoSignificantDigitRoundingScenarios(RoundingAlgorithm.RoundDown));

            // Do the increment rounding scenarios with round half up algorithm
            results.Append(DoIncrementRoundingScenarios(RoundingAlgorithm.RoundHalfUp));

            // Do the increment rounding scenarios with round half down algorithm
            results.Append(DoIncrementRoundingScenarios(RoundingAlgorithm.RoundHalfDown));

            // Do currency formatting with rounding for Japanese Yen with round half to odd algorithm
            results.Append(DoCurrencyRoundingScenarios("JPY", RoundingAlgorithm.RoundHalfToOdd));

            // Do currency formatting with rounding for Euro with round half to even algorithm
            results.Append(DoCurrencyRoundingScenarios("EUR", RoundingAlgorithm.RoundHalfToEven));

            // Do padding and rounding scenarios using round half up algorithm
            results.Append(DoPaddingAndRoundingScenarios(RoundingAlgorithm.RoundHalfUp, 4, 3, 2));

            // Do padding and rounding scenarios using round half down algorithm
            results.Append(DoPaddingAndRoundingScenarios(RoundingAlgorithm.RoundHalfDown, 4, 3, 2));

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

string DisplayRoundingAlgorithmAsString ( Windows.Globalization.NumberFormatting.RoundingAlgorithm roundingAlgorithm ) [inline, private]

Used to display the rounding algorithm in a string format.

Used by the different scenarios when displaying results for the scenario

Parameters:
roundingAlgorithm

Definition at line 31 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            String roundingAsString = "";

            // Convert the enumeration value into a string representation
            switch (roundingAlgorithm)
            {
                case RoundingAlgorithm.None:
                    roundingAsString = "no";
                    break;
                case RoundingAlgorithm.RoundAwayFromZero:
                    roundingAsString = "away from zero";
                    break;
                case RoundingAlgorithm.RoundDown:
                    roundingAsString = "down";
                    break;
                case RoundingAlgorithm.RoundHalfAwayFromZero:
                    roundingAsString = "half away from zero";
                    break;
                case RoundingAlgorithm.RoundHalfDown:
                    roundingAsString = "half down";
                    break;
                case RoundingAlgorithm.RoundHalfToEven:
                    roundingAsString = "half to even";
                    break;
                case RoundingAlgorithm.RoundHalfToOdd:
                    roundingAsString = "half to odd";
                    break;
                case RoundingAlgorithm.RoundHalfTowardsZero:
                    roundingAsString = "half towards zero";
                    break;
                case RoundingAlgorithm.RoundHalfUp:
                    roundingAsString = "half up";
                    break;
                case RoundingAlgorithm.RoundTowardsZero:
                    roundingAsString = "toward zero";
                    break;
                case RoundingAlgorithm.RoundUp:
                    roundingAsString = "up";
                    break;
                default:
                    roundingAsString = "unknown";
                    break;
            }
            return roundingAsString;
        }

string DoCurrencyRoundingScenarios | ( | string | currencyCode,
 |  | RoundingAlgorithm | roundingAlgorithm |
 | ) |  |  | [inline, private]

This scenario illustrates how to provide a rounding algorithm to a CurrencyFormatter class by means of the applyRoundingForCurrency method.

This will associate an IncrementNumberRounder using the same increment as the fractionDigits appropriate for the currency and language. You can always choose to provide a different rounding algorithm by setting the numberRounder property, as depicted in the doPaddingAndRoundingScenarios function. The mechanism provided here is better suited for currencies.

Parameters:
currencyCode
roundingAlgorithm

Definition at line 172 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Create the currency formatter and set the rounding algorithm provided as a parameter
            CurrencyFormatter currencyFormatter = new Windows.Globalization.NumberFormatting.CurrencyFormatter(currencyCode);
            currencyFormatter.ApplyRoundingForCurrency(roundingAlgorithm);

            // Display the properties of the scenario
            StringBuilder results = new StringBuilder();
            results.Append("Currency formatting for ");
            results.Append(currencyFormatter.Currency + " currency and using the ");
            results.Append(DisplayRoundingAlgorithmAsString(roundingAlgorithm) + " rounding algorithm\n\n");

            // Iterate through the numbers to round and add them to the results
            double[] numbersToFormat = new double[] { 14.55, 3.345, 16.2, 175.8 };
            foreach (double numberToFormat in numbersToFormat)
            {
                string formattedNumber = currencyFormatter.Format(numberToFormat);
                results.Append("Value: " + numberToFormat + " Formatted: " + formattedNumber + "\n");
            }

            // Add a carriage return at the end of the scenario for readability
            results.AppendLine();
            return results.ToString();
        }

String DoIncrementRoundingScenarios ( RoundingAlgorithm roundingAlgorithm ) [inline, private]

Shows how to do number rounding using the IncrementNumberRounding class.

/summary> param name="roundingAlgorithm">

Definition at line 201 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Create the rounder and set the rounding algorithm provided as a parameter
            IncrementNumberRounder rounder = new Windows.Globalization.NumberFormatting.IncrementNumberRounder();
            rounder.RoundingAlgorithm = roundingAlgorithm;

            // Formatter to display the rounded value.  It is recommended to use the increment number
            // rounder within a formatter object to avoid precision issues when displaying.
            DecimalFormatter formatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            formatter.NumberRounder = rounder;

            // Stores the results
            StringBuilder results = new StringBuilder();

            // Iterate through the increments we have defined in the scenario
            double[] incrementsToRound = new double[] { 0.001, 0.01, 0.1, 1.0 };
            foreach (double incrementToRound in incrementsToRound)
            {
                // Set the significant digits to round to
                rounder.Increment = incrementToRound;

                // Display the properties of the scenario
                results.Append("Rounding with ");
                results.Append(rounder.Increment + " increment and ");
                results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");

                // Iterate through the numbers to round and add them to the results
                double[] numbersToRound = new double[] { 0.1458, 1.458, 14.58, 145.8 };
                foreach (double numberToRound in numbersToRound)
                {
                    results.Append("Value: " + numberToRound + " Rounded: " + formatter.Format(numberToRound) + "\n");
                }

                // Add a carriage return at the end of the scenario for readability
                results.AppendLine();
            }

            return results.ToString();
        }

string DoPaddingAndRoundingScenarios | ( | RoundingAlgorithm | roundingAlgorithm,
 |  | int | significantDigits,
 |  | int | integerDigits,
 |  | int | fractionalDigits |
 | ) |  |  | [inline, private]

Demonstrates how to perform padding and rounding by using the DecimalFormatter class (can be any of the formatter classes in the Windows.Globalization.Numberformatting namespace) and the IncrementNumberRounder to do so.

The SignificantDigitsNumberRounder can also be used instead of the latter.

Parameters:
roundingAlgorithm
significantDigits
integerDigits
fractionalDigits

Definition at line 116 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Create the rounder and set the rounding algorithm provided as a parameter
            IncrementNumberRounder rounder = new Windows.Globalization.NumberFormatting.IncrementNumberRounder();
            rounder.RoundingAlgorithm = roundingAlgorithm;

            // Create the formatter, set the padding properties provided as parameters and associate the rounder
            // we have just created
            DecimalFormatter formatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
            formatter.SignificantDigits = significantDigits;
            formatter.IntegerDigits = integerDigits;
            formatter.FractionDigits = fractionalDigits;
            formatter.NumberRounder = rounder;

            // Stores the results
            StringBuilder results = new StringBuilder();

            // Iterate through the increments we have defined in the scenario
            double[] incrementsToRound = new double[] { 0.001, 0.01, 0.1, 1.0 };
            foreach (double incrementToRound in incrementsToRound)
            {
                // Set the increment to round to
                rounder.Increment = incrementToRound;

                // Display the properties of the scenario
                results.Append("Padding and rounding with ");
                results.Append(formatter.SignificantDigits + " significant digits, ");
                results.Append(formatter.IntegerDigits + " integer digits, ");
                results.Append(formatter.FractionDigits + " fractional digits, ");
                results.Append(rounder.Increment + " increment and ");
                results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");

                // Iterate through the numbers to round and pad, format them and add them to the results
                double[] numbersToFormat = new double[]  {0.1458, 1.458, 14.58, 145.8 };
                foreach (double numberToFormat in numbersToFormat)
                {
                    string formattedNumber = formatter.Format(numberToFormat);
                    results.Append("Value: " + numberToFormat + " Formatted: " + formattedNumber + "\n");
                }

                // Add a carriage return at the end of the scenario for readability
                results.AppendLine();
            }

            return results.ToString();
        }

string DoPaddingScenarios ( INumberFormatter formatter ) [inline, private]

Executes the padding scenarios.

Parameters:
formatter The formatter parameter can be either a DecimalFormatter, PercentFormatter PerMilleFormatter or CurrencyFormatter

Definition at line 85 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Display the properties of the scenario
            StringBuilder results = new StringBuilder();
            results.Append("Padding with ");
            results.Append(((ISignificantDigitsOption) formatter).SignificantDigits + " significant digits, ");
            results.Append(((INumberFormatterOptions) formatter).IntegerDigits + " integer digits, ");
            results.Append(((INumberFormatterOptions) formatter).FractionDigits + " fractional digits\n\n");

            // Iterate through the numbers to pad, format them and add them to the results
            double[] numbersToPad = new double[] { 0.12, 1.2, 10.2, 102 };
            foreach (double numberToPad in numbersToPad)
            {
                string paddedNumber = formatter.Format(numberToPad);
                results.Append("Value: " + numberToPad + " Padded: " + paddedNumber + "\n");
            }

            // Add a carriage return at the end of the scenario for readability
            results.AppendLine();
            return results.ToString();
        }

String DoSignificantDigitRoundingScenarios ( RoundingAlgorithm roundingAlgorithm ) [inline, private]

Shows how to do number rounding using the SignificantDigitsNumberRounder class.

Parameters:
roundingAlgorithm

Definition at line 245 of file Scenario5_RoundingAndPadding.xaml.cs.

        {
            // Create the rounder and set the rounding algorithm provided as a parameter.
            SignificantDigitsNumberRounder rounder = new Windows.Globalization.NumberFormatting.SignificantDigitsNumberRounder();
            rounder.RoundingAlgorithm = roundingAlgorithm;

            // Stores the results
            StringBuilder results = new StringBuilder();

            // Iterate through the significant digits we have defined in the scenario
            uint[] digitsToRound = new uint[] { 3, 2, 1 };
            foreach (uint digitToRound in digitsToRound)
            {
                // Set the significant digits to round to
                rounder.SignificantDigits = digitToRound;

                // Display the properties of the scenario
                results.Append("Rounding with ");
                results.Append(rounder.SignificantDigits + " significant digits and ");
                results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");

                // Iterate through the numbers to round and add them to the results
                double[] numbersToRound = new double[] { 0.1458, 1.458, 14.58, 145.8 };
                foreach (double numberToRound in numbersToRound)
                {
                    double roundedValue = rounder.RoundDouble(numberToRound);
                    results.Append("Value: " + numberToRound + " Rounded: " + roundedValue + "\n");
                }

                // Add a carriage return at the end of the scenario for readability
                results.AppendLine();
            }

            return results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario5_RoundingAndPadding.xaml.cs
  • NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Show Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_Show
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_Show Class Reference

List of all members.

Public Member Functions

Scenario5_Show ()

Private Member Functions

async void Show_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario5_Show.xaml.cs.

Constructor & Destructor Documentation

Scenario5_Show ( ) [inline]

Definition at line 23 of file Scenario5_Show.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Show the default appointment provider at a point in time 24 hours from now.

Parameters:
sender
e

Definition at line 33 of file Scenario5_Show.xaml.cs.

        {
            var dateToShow = DateTime.Now.AddDays(1);
            var duration = TimeSpan.FromHours(1);
            await Windows.ApplicationModel.Appointments.AppointmentManager.ShowTimeFrameAsync(dateToShow, duration);
            rootPage.NotifyUser("The default appointments provider should have appeared on screen.", NotifyType.StatusMessage);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario5_Show.xaml.cs.

The documentation for this class was generated from the following file:
  • Appointments/cs/Scenario5_Show.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TimeZone Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_TimeZone
Public Member Functions | Private Member Functions

Scenario5_TimeZone Class Reference

List of all members.

Public Member Functions

Scenario5_TimeZone ()

Private Member Functions

string | ReportCalendarData (Calendar calendar)
void | ShowResults_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario5_TimeZone.xaml.cs.

Constructor & Destructor Documentation

Scenario5_TimeZone ( ) [inline]

Definition at line 22 of file Scenario5_TimeZone.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string ReportCalendarData ( Calendar calendar ) [inline, private]

Definition at line 27 of file Scenario5_TimeZone.xaml.cs.

        {
            // Display individual date/time elements.
            return string.Format("In {0} time zone:   {1}   {2} {3}, {4}   {5}:{6}:{7} {8}  {9}",
                                 calendar.GetTimeZone(),
                                 calendar.DayOfWeekAsSoloString(),
                                 calendar.MonthAsSoloString(),
                                 calendar.DayAsPaddedString(2),
                                 calendar.YearAsString(),
                                 calendar.HourAsPaddedString(2),
                                 calendar.MinuteAsPaddedString(2),
                                 calendar.SecondAsPaddedString(2),
                                 calendar.PeriodAsString(),
                                 calendar.TimeZoneAsString(3));
        }

void ShowResults_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario5_TimeZone.xaml.cs.

        {
            // This scenario illustrates time zone support in Windows.Globalization.Calendar class

            // Displayed time zones in addition to the local time zone.
            string[] timeZones = new[] { "UTC", "America/New_York", "Asia/Kolkata" };

            // Store results here.
            StringBuilder results = new StringBuilder();

            // Create default Calendar object
            Calendar calendar = new Calendar();
            string localTimeZone = calendar.GetTimeZone();

            // Show current time in local time zone
            results.AppendLine("Current date and time:");
            results.AppendLine(ReportCalendarData(calendar));

            // Show current time in additional time zones
            foreach (string timeZone in timeZones)
            {
                calendar.ChangeTimeZone(timeZone);
                results.AppendLine(ReportCalendarData(calendar));
            }
            results.AppendLine();

            // Change back to local time zone
            calendar.ChangeTimeZone(localTimeZone);

            // Show a time on 14th day of second month of next year.
            // Note the effect of daylight saving time on the results.
            results.AppendLine("Same time on 14th day of second month of next year:");
            calendar.AddYears(1); calendar.Month = 2; calendar.Day = 14;
            results.AppendLine(ReportCalendarData(calendar));
            foreach (string timeZone in timeZones)
            {
                calendar.ChangeTimeZone(timeZone);
                results.AppendLine(ReportCalendarData(calendar));
            }
            results.AppendLine();

            // Change back to local time zone
            calendar.ChangeTimeZone(localTimeZone);

            // Show a time on 14th day of tenth month of next year.
            // Note the effect of daylight saving time on the results.
            results.AppendLine("Same time on 14th day of tenth month of next year:");
            calendar.AddMonths(8);
            results.AppendLine(ReportCalendarData(calendar));
            foreach (string timeZone in timeZones)
            {
                calendar.ChangeTimeZone(timeZone);
                results.AppendLine(ReportCalendarData(calendar));
            }
            results.AppendLine();

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • Calendar/cs/Scenario5_TimeZone.xaml.cs
  • Calendar/cpp/Scenario5_TimeZone.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TriggerCFU Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_TriggerCFU
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_TriggerCFU Class Reference

List of all members.

Public Member Functions

Scenario5_TriggerCFU ()

Private Member Functions

async void | CreateFileButton_Click (object sender, RoutedEventArgs e)
async void | GetFileFromFutureAccessListButton_Click (Object sender, RoutedEventArgs e)
async void | PickAFileButton_Click (Object sender, RoutedEventArgs e)
void | SaveToFutureAccessListButton_Click (Object sender, RoutedEventArgs e)
void | UpdateButtons ()
async void | WriteToFileButton_Click (Object sender, RoutedEventArgs e)
async void | WriteToFileWithExplicitCFUButton_Click (Object sender, RoutedEventArgs e)

Private Attributes

StorageFile | m_afterWriteFile = null
StorageFile | m_beforeReadFile = null
string | m_faToken
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario5_TriggerCFU.xaml.cs.

Constructor & Destructor Documentation

Scenario5_TriggerCFU ( ) [inline]

Definition at line 30 of file Scenario5_TriggerCFU.xaml.cs.

        {
            this.InitializeComponent();
            UpdateButtons();
        }

Member Function Documentation

async void CreateFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario5_TriggerCFU.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            FileSavePicker savePicker = new FileSavePicker();
            savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;

            savePicker.FileTypeChoices.Add("Plain Text", new string[] { ".txt" });
            savePicker.SuggestedFileName = "New Document";

            m_afterWriteFile = await savePicker.PickSaveFileAsync();
            if (m_afterWriteFile != null)
            {
                rootPage.NotifyUser("File created.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);
            }
            UpdateButtons();
        }

async void GetFileFromFutureAccessListButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 126 of file Scenario5_TriggerCFU.xaml.cs.

        {
            rootPage.NotifyUser("Getting the file from the Future Access List. If applicable, a ReadActivationMode.BeforeAccess activation will occur in approximately 60 seconds on desktop.", NotifyType.StatusMessage);
            StorageFile file = await StorageApplicationPermissions.FutureAccessList.GetFileAsync(m_faToken);
            if (file != null)
            {
                rootPage.NotifyUser($"Retrieved file from Future Access List: {file.Name}", NotifyType.StatusMessage);
                m_beforeReadFile = file;
            }
            else
            {
                rootPage.NotifyUser("Unable to retrieve file from Future Access List.", NotifyType.ErrorMessage);
            }
            UpdateButtons();
        }

async void PickAFileButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario5_TriggerCFU.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.FileTypeFilter.Add(".txt");

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                m_beforeReadFile = file;
                rootPage.NotifyUser($"Picked file: {file.Name}", NotifyType.StatusMessage);
            }
            else
            {
                m_beforeReadFile = null;
                rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);
            }
            UpdateButtons();
        }

void SaveToFutureAccessListButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 118 of file Scenario5_TriggerCFU.xaml.cs.

        {
            m_faToken = StorageApplicationPermissions.FutureAccessList.Add(m_beforeReadFile);
            rootPage.NotifyUser("Saved to Future Access List", NotifyType.StatusMessage);
            m_beforeReadFile = null;
            UpdateButtons();
        }

void UpdateButtons ( ) [inline, private]

Definition at line 36 of file Scenario5_TriggerCFU.xaml.cs.

        {
            WriteToFileButton.IsEnabled = (m_afterWriteFile != null);
            WriteToFileWithCFUButton.IsEnabled = (m_afterWriteFile != null);

            SaveToFutureAccessListButton.IsEnabled = (m_beforeReadFile != null);
            GetFileFromFutureAccessListButton.IsEnabled = !string.IsNullOrEmpty(m_faToken);
        }

async void WriteToFileButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario5_TriggerCFU.xaml.cs.

        {
            await FileIO.WriteTextAsync(m_afterWriteFile, "The File Picker App just wrote to the file!");
            rootPage.NotifyUser("File write complete. If applicable, a WriteActivationMode.AfterWrite activation will occur in approximately 60 seconds on desktop.", NotifyType.StatusMessage);
        }

async void WriteToFileWithExplicitCFUButton_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario5_TriggerCFU.xaml.cs.

        {
            StorageFile file = m_afterWriteFile;
            CachedFileManager.DeferUpdates(file);
            await FileIO.WriteTextAsync(file, "The File Picker App just wrote to the file!");
            rootPage.NotifyUser("File write complete. Explicitly completing updates.", NotifyType.StatusMessage);
            FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file);
            switch (status)
            {
                case FileUpdateStatus.Complete:
                    rootPage.NotifyUser($"File {file.Name} was saved.", NotifyType.StatusMessage);
                    break;

                case FileUpdateStatus.CompleteAndRenamed:
                    rootPage.NotifyUser($"File ${file.Name} was renamed and saved.", NotifyType.StatusMessage);
                    break;

                default:
                    rootPage.NotifyUser($"File ${file.Name} couldn't be saved.", NotifyType.ErrorMessage);
                    break;
            }
        }

Member Data Documentation

StorageFile m_afterWriteFile = null [private]

Definition at line 26 of file Scenario5_TriggerCFU.xaml.cs.

StorageFile m_beforeReadFile = null [private]

Definition at line 27 of file Scenario5_TriggerCFU.xaml.cs.

string m_faToken [private]

Definition at line 28 of file Scenario5_TriggerCFU.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario5_TriggerCFU.xaml.cs.

The documentation for this class was generated from the following files:
  • FilePicker/cs/Scenario5_TriggerCFU.xaml.cs
  • FilePicker/cpp/Scenario5_TriggerCFU.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_UnicodeExtensions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_UnicodeExtensions
Public Member Functions | Private Member Functions

Scenario5_UnicodeExtensions Class Reference

List of all members.

Public Member Functions

Scenario5_UnicodeExtensions ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 24 of file Scenario5_UnicodeExtensions.xaml.cs.

Constructor & Destructor Documentation

Scenario5_UnicodeExtensions ( ) [inline]

Definition at line 26 of file Scenario5_UnicodeExtensions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 34 of file Scenario5_UnicodeExtensions.xaml.cs.

        {
            // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
            // to format a date/time by using a formatter that uses Unicode extenstion in the specified
            // language name

            // We keep results in this variable
            StringBuilder results = new StringBuilder();
            results.AppendLine("Current default application context language: " + ApplicationLanguages.Languages[0]);
            results.AppendLine();

            // Create formatters using various types of constructors specifying Language list with unicode extension in language names
            DateTimeFormatter[] unicodeExtensionFormatters = new[]
            {
                // Default application context
                new DateTimeFormatter("longdate longtime"),
                // Telugu language, Gregorian Calendar and Latin Numeral System
                new DateTimeFormatter("longdate longtime", new[] { "te-in-u-ca-gregory-nu-latn", "en-US" }),
                // Hebrew language and Arabic Numeral System - calendar NOT specified in constructor
                new DateTimeFormatter(YearFormat.Default,
                    MonthFormat.Default,
                    DayFormat.Default,
                    DayOfWeekFormat.Default,
                    HourFormat.Default,
                    MinuteFormat.Default,
                    SecondFormat.Default,
                    new[] { "he-IL-u-nu-arab", "en-US" }),
                // Hebrew language and calendar - calendar specified in constructor
                // also, which overrides the one specified in Unicode extension
                new DateTimeFormatter(YearFormat.Default,
                    MonthFormat.Default,
                    DayFormat.Default,
                    DayOfWeekFormat.Default,
                    HourFormat.Default,
                    MinuteFormat.Default,
                    SecondFormat.Default,
                    new[] { "he-IL-u-ca-hebrew-co-phonebk", "en-US" },
                    "US",
                    CalendarIdentifiers.Gregorian,
                    ClockIdentifiers.TwentyFourHour),
             };

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // Format and display date/time along with other relevant properites
            foreach (DateTimeFormatter formatter in unicodeExtensionFormatters)
            {
                // Perform the actual formatting.
                results.AppendLine("Result: " + formatter.Format(dateTime));
                results.AppendLine("    Language List: " + string.Join(", ", formatter.Languages));
                results.AppendLine("    Template: " + formatter.Template);
                results.AppendLine("    Resolved Language: " + formatter.ResolvedLanguage);
                results.AppendLine("    Calendar System: " + formatter.Calendar);
                results.AppendLine("    Numeral System: " + formatter.NumeralSystem);
                results.AppendLine();
            }

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario5_UnicodeExtensions.xaml.cs
  • DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_UserCollection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_UserCollection
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_UserCollection Class Reference

List of all members.

Public Member Functions

Scenario5_UserCollection ()

Private Member Functions

async void | GetUserCollectionButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()

Detailed Description

Definition at line 19 of file Scenario5_UserCollection.xaml.cs.

Constructor & Destructor Documentation

Scenario5_UserCollection ( ) [inline]

Definition at line 24 of file Scenario5_UserCollection.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetUserCollectionButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file Scenario5_UserCollection.xaml.cs.

        {
            // Create a filtered list of the product AddOns I care about
            string[] filterList = new string[] { "Consumable", "Durable", "UnmanagedConsumable" };

            // Get user collection for this product, filtering for the types we know about
            StoreProductQueryResult collection = await storeContext.GetUserCollectionAsync(filterList);

            ProductsListView.ItemsSource = Utils.CreateProductListFromQueryResult(collection, "collection items");
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario5_UserCollection.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 22 of file Scenario5_UserCollection.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario5_UserCollection.xaml.cs
  • Store/cpp/Scenario5_UserCollection.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_VerifyResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario5_VerifyResponse
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_VerifyResponse Class Reference

List of all members.

Public Member Functions

Scenario5_VerifyResponse ()

Private Member Functions

async void VerifyResponse_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 9 of file Scenario5_VerifyResponse.xaml.cs.

Constructor & Destructor Documentation

Scenario5_VerifyResponse ( ) [inline]

Definition at line 13 of file Scenario5_VerifyResponse.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void VerifyResponse_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'VerifyResponse' button.

Parameters:
sender
e

Definition at line 23 of file Scenario5_VerifyResponse.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;

            try
            {
                bool verifyResult = false;
                SmartCard card = await rootPage.GetSmartCard();
                SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);

                rootPage.NotifyUser("Verifying smart card response...", NotifyType.StatusMessage);

                using (SmartCardChallengeContext context = await provisioning.GetChallengeContextAsync())
                {
                    IBuffer response = ChallengeResponseAlgorithm.CalculateResponse(context.Challenge, rootPage.AdminKey);
                    verifyResult = await context.VerifyResponseAsync(response);
                }

                rootPage.NotifyUser("Smart card response verification completed. Result: " + verifyResult.ToString(), NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser( "Verifying smart card response operation failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 11 of file Scenario5_VerifyResponse.xaml.cs.

The documentation for this class was generated from the following files:
  • SmartCard/cs/Scenario5_VerifyResponse.xaml.cs
  • SmartCard/cpp/Scenario5_VerifyResponse.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario6 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario6 ()
Scenario6 ()
Scenario6 ()
Scenario6 ()
Scenario6 ()
Scenario6 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | InitializePlaybackList ()
void | InkToolbar_ActiveToolChanged (InkToolbar sender, object args)
void | InkToolbar_EraseAllClicked (InkToolbar sender, object args)
void | InkToolbar_InkDrawingAttributesChanged (InkToolbar sender, object args)
void | InkToolbar_IsStencilButtonCheckedChanged (InkToolbar sender, InkToolbarIsStencilButtonCheckedChangedEventArgs args)
void | InkToolbar_SelectedStencilChanged (DependencyObject sender, DependencyProperty dp)
void | nextButton_Click (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
async void | pfnLink_Click (object sender, RoutedEventArgs e)
void | PlaybackList_CurrentItemChanged (MediaPlaybackList sender, CurrentMediaPlaybackItemChangedEventArgs args)
void | PlaybackSession_PlaybackRateChanged (MediaPlaybackSession sender, object args)
async void | PlaybackSession_PlaybackStateChanged (MediaPlaybackSession sender, object args)
void | playButton_Click (object sender, RoutedEventArgs e)
void | PlaylistView_ItemClick (object sender, ItemClickEventArgs e)
void | prevButton_Click (object sender, RoutedEventArgs e)
void | Scenario6Button_Show_Click (object sender, RoutedEventArgs e)
async void | SelectImageButton_Click (object sender, RoutedEventArgs e)
void | SetCanvasSize ()
async void | ShowPropertiesButton_Click (object sender, RoutedEventArgs e)
async void | speedButton_Click (object sender, RoutedEventArgs e)
void | ToggleLogs (object sender, RoutedEventArgs e)
void | UnprocessedInput_PointerEntered (InkUnprocessedInput sender, PointerEventArgs args)
void | UnprocessedInput_PointerEntered1 (InkUnprocessedInput sender, PointerEventArgs args)
void | UpdateTransportControls (MediaPlaybackState state)

Private Attributes

MediaPlayer | mp
List< MediaPlaybackItemLogger > | mpiLoggerList = new List<MediaPlaybackItemLogger>()
MediaPlaybackListLogger | mplLogger
MediaPlayerLogger | mpLogger
MediaPlaybackList | playbackList = new MediaPlaybackList()
MainPage rootPage = MainPage.Current
long | selectedStencilChangedToken

Static Private Attributes

static readonly string | dateAccessedProperty = "System.DateAccessed"
static readonly string | fileOwnerProperty = "System.FileOwner"

Detailed Description

Demonstrates playing video lists using MediaPlaybackList.

This page shows the code to control multiple InkCanvas controls with only one Inktoolbar.

Displaying file properties.

Definition at line 24 of file scenario6.xaml.cs.

Constructor & Destructor Documentation

Scenario6 ( ) [inline]

Definition at line 30 of file scenario6.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario6 ( ) [inline]

Definition at line 34 of file Scenario6_Properties.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario6 ( ) [inline]

Definition at line 26 of file Scenario6.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario6 ( ) [inline]

Definition at line 23 of file Scenario6.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario6 ( ) [inline]

Definition at line 30 of file Scenario6.xaml.cs.

        {
            this.InitializeComponent();

            // Initialize the InkCanvas controls
            inkCanvas.InkPresenter.InputDeviceTypes =
            inkCanvas2.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
        }

Scenario6 ( ) [inline]

Definition at line 39 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void InitializePlaybackList ( ) [inline, private]

Definition at line 71 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            // Initialize the playlist data/view model.
            // In a production app your data would be sourced from a data store or service.

            // Add content to the ListView and to the MediaPlaybackList.
            MediaModel media = new MediaModel(rootPage.MultiTrackVideoMediaUri)
            {
                Title = "Fitness",
                ArtUri = new Uri("ms-appx:///Assets/Media/multivideo.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            media = new MediaModel(rootPage.CaptionedMediaUri)
            {
                Title = "Elephant's Dream",
                ArtUri = new Uri("ms-appx:///Assets/Media/ElephantsDream.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            media = new MediaModel(rootPage.SintelMediaUri)
            {
                Title = "Sintel",
                ArtUri = new Uri("ms-appx:///Assets/Media/sintel.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            // Subscribe for changes
            playbackList.CurrentItemChanged += PlaybackList_CurrentItemChanged;

            // Loop
            playbackList.AutoRepeatEnabled = true;
        }

void InkToolbar_ActiveToolChanged | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 130 of file Scenario6.xaml.cs.

        {
            textLogs.Text = "ActiveToolChanged\n" + textLogs.Text;
        }

void InkToolbar_EraseAllClicked | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario6.xaml.cs.

        {
            textLogs.Text = "EraseAllClicked\n" + textLogs.Text;
        }

void InkToolbar_InkDrawingAttributesChanged | ( | InkToolbar | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario6.xaml.cs.

        {
            textLogs.Text = "InkDrawingAttributesChanged\n" + textLogs.Text;
        }

void InkToolbar_IsStencilButtonCheckedChanged | ( | InkToolbar | sender,
 |  | InkToolbarIsStencilButtonCheckedChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario6.xaml.cs.

        {
            textLogs.Text = $"IsStencilButtonCheckedChanged(Kind = {args.StencilKind}, IsChecked = {args.StencilButton.IsChecked.Value})\n" + textLogs.Text;
        }

void InkToolbar_SelectedStencilChanged | ( | DependencyObject | sender,
 |  | DependencyProperty | dp |
 | ) |  |  | [inline, private]

Definition at line 114 of file Scenario6.xaml.cs.

        {
            var stencilButton = (InkToolbarStencilButton)sender;
            textLogs.Text = $"SelectedStencil changed to {stencilButton.SelectedStencil}\n" + textLogs.Text;
        }

void nextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Tells the background audio agent to skip to the next track.

Parameters:
sender | The button
e | Click event args

Definition at line 203 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            playbackList.MoveNext();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 111 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            foreach (var mpiLogger in mpiLoggerList)
            {
                mpiLogger.Dispose();
            }
            mpiLoggerList.Clear();
            mpLogger?.Dispose();
            mpLogger = null;

            MediaPlayerHelper.CleanUpMediaPlayerSource(mp);
            playbackList.Items.Clear();
            playlistView.Items.Clear();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario6.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario6.xaml.cs.

        {
            // Registering handlers for PointerEntered event
            inkCanvas.InkPresenter.UnprocessedInput.PointerEntered += UnprocessedInput_PointerEntered;
            inkCanvas2.InkPresenter.UnprocessedInput.PointerEntered += UnprocessedInput_PointerEntered1;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            // Create a static playback list
            mplLogger = new MediaPlaybackListLogger(LoggerControl, playbackList);
            InitializePlaybackList();

            //Create the MediaPlayer:
            mp = new MediaPlayer();
            mpLogger = new MediaPlayerLogger(LoggerControl, mp);

            // Subscribe to MediaPlayer PlaybackState changed events
            mp.PlaybackSession.PlaybackStateChanged += PlaybackSession_PlaybackStateChanged;

            // Subscribe to MediaPlayer PlaybackRate changed events
            mp.PlaybackSession.PlaybackRateChanged += PlaybackSession_PlaybackRateChanged;

           // Subscribe to list UI changes
           playlistView.ItemClick += PlaylistView_ItemClick;

            //Attach the player to the MediaPlayerElement:
            mediaPlayerElement.SetMediaPlayer(mp);

            // Set list for playback
            mp.Source = playbackList;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file scenario6.xaml.cs.

        {
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario6_Properties.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario6.xaml.cs.

        {
            // Unregistering handlers for PointerEntered event
            inkCanvas.InkPresenter.UnprocessedInput.PointerEntered -= UnprocessedInput_PointerEntered;
            inkCanvas2.InkPresenter.UnprocessedInput.PointerEntered -= UnprocessedInput_PointerEntered1;
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario6.xaml.cs.

        {
            SetCanvasSize();
        }

async void pfnLink_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario6.xaml.cs.

        {
            Uri uri = new Uri("bingmaps:?rtp=adr.Mountain%20View,%20CA~adr.San%20Francisco,%20CA&amp;mode=d&amp;trfc=1");
            var launcherOptions = new LauncherOptions();
            launcherOptions.TargetApplicationPackageFamilyName = "Microsoft.WindowsMaps_8wekyb3d8bbwe";
            await Launcher.LaunchUriAsync(uri, launcherOptions);
        }

void PlaybackList_CurrentItemChanged | ( | MediaPlaybackList | sender,
 |  | CurrentMediaPlaybackItemChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 126 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            LoggerControl.Log($"Current item changed to index: {sender.CurrentItemIndex}");
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Synchronize our UI with the currently-playing item.
                playlistView.SelectedIndex = (int)sender.CurrentItemIndex;
            });
        }

void PlaybackSession_PlaybackRateChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 233 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            LoggerControl.Log($"Current playback rate changed to: {sender.PlaybackRate}");
        }

async void PlaybackSession_PlaybackStateChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

MediaPlayer state changed event handlers.

Note that we can subscribe to events even if Media Player is playing media in background

Parameters:
sender
args

Definition at line 143 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            LoggerControl.Log($"Current playback state changed to: {sender.PlaybackState}");

            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var currentState = sender.PlaybackState;

                // Update state label
                txtCurrentState.Text = currentState.ToString();

                // Update controls
                UpdateTransportControls(currentState);
            });
        }

void playButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

If the task is already running, it will just play/pause MediaPlayer Instance Otherwise, initializes MediaPlayer Handlers and starts playback track or to pause if we're already playing.

Definition at line 186 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            if (MediaPlaybackState.Playing == mp.PlaybackSession.PlaybackState)
            {
                mp.Pause();
            }
            else if (MediaPlaybackState.Paused == mp.PlaybackSession.PlaybackState)
            {
                mp.Play();
            }
        }

void PlaylistView_ItemClick | ( | object | sender,
 |  | ItemClickEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 159 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            var item = e.ClickedItem as MediaModel;
            LoggerControl.Log("Clicked item: " + item.Title);

            // Start the background task if it wasn't running
            playbackList.MoveTo((uint)playbackList.Items.IndexOf(item.MediaPlaybackItem));

            if (MediaPlaybackState.Paused == mp.PlaybackSession.PlaybackState)
            {
                mp.Play();
            }
        }

void prevButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Sends message to the background task to skip to the previous track.

Definition at line 176 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            playbackList.MovePrevious();
        }

void Scenario6Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario6Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 50 of file scenario6.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                var resourceLoader = ResourceLoader.GetForCurrentView("AppResourceClassLibrary/Resources");
                this.Scenario6TextBlock.Text = "Retrieved from app: " + resourceLoader.GetString("string1");
                this.Scenario6TextBlock2.Text = "Retrieved from class library: " + AppResourceClassLibrary.LocalizedNamesLibrary.LibraryName;
            }
        }

async void SelectImageButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 36 of file Scenario6.xaml.cs.

        {
            rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);

            uint size;
            if (uint.TryParse(RequestSize.Text, out size))
            {
                // Pick a photo
                FileOpenPicker openPicker = new FileOpenPicker();
                foreach (string extension in FileExtensions.Image)
                {
                    openPicker.FileTypeFilter.Add(extension);
                }

                StorageFile file = await openPicker.PickSingleFileAsync();
                if (file != null)
                {
                    const ThumbnailMode thumbnailMode = ThumbnailMode.SingleItem;

                    bool fastThumbnail = FastThumbnailCheckBox.IsChecked.Value;
                    ThumbnailOptions thumbnailOptions = ThumbnailOptions.UseCurrentScale;
                    if (fastThumbnail)
                    {
                        thumbnailOptions |= ThumbnailOptions.ReturnOnlyIfCached;
                    }

                    using (StorageItemThumbnail thumbnail = await file.GetScaledImageAsThumbnailAsync(thumbnailMode, size, thumbnailOptions))
                    {
                        if (thumbnail != null)
                        {
                            MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, file, thumbnail, false);
                        }
                        else if (fastThumbnail)
                        {
                            rootPage.NotifyUser(Errors.NoExifThumbnail, NotifyType.StatusMessage);
                        }
                        else
                        {
                            rootPage.NotifyUser(Errors.NoThumbnail, NotifyType.StatusMessage);
                        }
                    }
                }
                else
                {
                    rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser(Errors.InvalidSize, NotifyType.ErrorMessage);
            }
        }

void SetCanvasSize ( ) [inline, private]

Definition at line 72 of file Scenario6.xaml.cs.

        {
            outputGrid.Width = RootGrid.ActualWidth / 2;
            outputGrid.Height = RootGrid.ActualHeight / 2;
            inkCanvas.Width = RootGrid.ActualWidth / 2;
            inkCanvas.Height = RootGrid.ActualHeight / 2;
            outputGrid2.Width = RootGrid.ActualWidth / 2;
            outputGrid2.Height = RootGrid.ActualHeight / 2;
            inkCanvas2.Width = RootGrid.ActualWidth / 2;
            inkCanvas2.Height = RootGrid.ActualHeight / 2;
        }

async void ShowPropertiesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario6_Properties.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    // Get top level file properties
                    StringBuilder outputText = new StringBuilder();
                    outputText.AppendLine($"File name: {file.Name}");
                    outputText.AppendLine($"File type: {file.FileType}");

                    // Get basic properties
                    BasicProperties basicProperties = await file.GetBasicPropertiesAsync();
                    outputText.AppendLine($"File size: {basicProperties.Size} bytes");
                    outputText.AppendLine($"Date modified: {basicProperties.DateModified}");

                    // Get extra properties
                    IDictionary<string, object> extraProperties = await file.Properties.RetrievePropertiesAsync(new[] { dateAccessedProperty, fileOwnerProperty });
                    var propValue = extraProperties[dateAccessedProperty];
                    if (propValue != null)
                    {
                        outputText.AppendLine($"Date accessed: {propValue}");
                    }
                    propValue = extraProperties[fileOwnerProperty];
                    if (propValue != null)
                    {
                        outputText.Append($"File owner: {propValue}");
                    }

                    rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error retrieving properties for '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

async void speedButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 208 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            // Create menu and add commands
            var popupMenu = new PopupMenu();

            popupMenu.Commands.Add(new UICommand("4.0x", command => mp.PlaybackSession.PlaybackRate = 4.0));
            popupMenu.Commands.Add(new UICommand("2.0x", command => mp.PlaybackSession.PlaybackRate = 2.0));
            popupMenu.Commands.Add(new UICommand("1.5x", command => mp.PlaybackSession.PlaybackRate = 1.5));
            popupMenu.Commands.Add(new UICommand("1.0x", command => mp.PlaybackSession.PlaybackRate = 1.0));
            popupMenu.Commands.Add(new UICommand("0.5x", command => mp.PlaybackSession.PlaybackRate = 0.5));

            // Get button transform and then offset it by half the button
            // width to center. This will show the popup just above the button.
            var button = (Button)sender;
            var transform = button.TransformToVisual(null);
            var point = transform.TransformPoint(new Point(button.ActualWidth / 2, 0));

            // Show popup
            IUICommand result = await popupMenu.ShowAsync(point);
            if (result != null)
            {
                button.Content = result.Label;
            }
        }

void ToggleLogs | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario6.xaml.cs.

        {
            var stencilButton = (InkToolbarStencilButton)inkToolbar.GetMenuButton(InkToolbarMenuKind.Stencil);

            if (toggleLog.IsOn)
            {
                LogBorder.Visibility = Visibility.Visible;
                inkToolbar.ActiveToolChanged += InkToolbar_ActiveToolChanged;
                inkToolbar.InkDrawingAttributesChanged += InkToolbar_InkDrawingAttributesChanged;
                inkToolbar.EraseAllClicked += InkToolbar_EraseAllClicked;
                inkToolbar.IsStencilButtonCheckedChanged += InkToolbar_IsStencilButtonCheckedChanged;
                selectedStencilChangedToken = stencilButton.RegisterPropertyChangedCallback(InkToolbarStencilButton.SelectedStencilProperty, InkToolbar_SelectedStencilChanged);
            }
            else
            {
                LogBorder.Visibility = Visibility.Collapsed;
                textLogs.Text = string.Empty;
                inkToolbar.ActiveToolChanged -= InkToolbar_ActiveToolChanged;
                inkToolbar.InkDrawingAttributesChanged -= InkToolbar_InkDrawingAttributesChanged;
                inkToolbar.EraseAllClicked -= InkToolbar_EraseAllClicked;
                inkToolbar.IsStencilButtonCheckedChanged -= InkToolbar_IsStencilButtonCheckedChanged;
                stencilButton.UnregisterPropertyChangedCallback(InkToolbarStencilButton.SelectedStencilProperty, selectedStencilChangedToken);
            }
        }

void UnprocessedInput_PointerEntered | ( | InkUnprocessedInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario6.xaml.cs.

        {
            border1.BorderBrush = new SolidColorBrush(Colors.Blue);
            border2.BorderBrush = new SolidColorBrush(Colors.Gray);
            inkToolbar.TargetInkCanvas = inkCanvas;
        }

void UnprocessedInput_PointerEntered1 | ( | InkUnprocessedInput | sender,
 |  | PointerEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario6.xaml.cs.

        {
            border1.BorderBrush = new SolidColorBrush(Colors.Gray);
            border2.BorderBrush = new SolidColorBrush(Colors.Blue);
            inkToolbar.TargetInkCanvas = inkCanvas2;
        }

void UpdateTransportControls ( MediaPlaybackState state ) [inline, private]

Definition at line 238 of file Scenario6_PlayingVideoLists.xaml.cs.

        {
            nextButton.IsEnabled = true;
            prevButton.IsEnabled = true;
            if (state == MediaPlaybackState.Playing)
            {
                playButtonSymbol.Symbol = Symbol.Pause;
            }
            else
            {
                playButtonSymbol.Symbol = Symbol.Play;
            }
        }

Member Data Documentation

readonly string dateAccessedProperty = "System.DateAccessed" [static, private]

Definition at line 31 of file Scenario6_Properties.xaml.cs.

readonly string fileOwnerProperty = "System.FileOwner" [static, private]

Definition at line 32 of file Scenario6_Properties.xaml.cs.

MediaPlayer mp [private]

Definition at line 34 of file Scenario6_PlayingVideoLists.xaml.cs.

List<MediaPlaybackItemLogger> mpiLoggerList = new List<MediaPlaybackItemLogger>() [private]

Definition at line 37 of file Scenario6_PlayingVideoLists.xaml.cs.

MediaPlaybackListLogger mplLogger [private]

Definition at line 36 of file Scenario6_PlayingVideoLists.xaml.cs.

MediaPlayerLogger mpLogger [private]

Definition at line 35 of file Scenario6_PlayingVideoLists.xaml.cs.

MediaPlaybackList playbackList = new MediaPlaybackList() [private]

Definition at line 33 of file Scenario6_PlayingVideoLists.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file scenario6.xaml.cs.

long selectedStencilChangedToken [private]

Definition at line 28 of file Scenario6.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario6.xaml.cs
  • FileAccess/cs/Scenario6_Properties.xaml.cs
  • FileThumbnails/cs/Scenario6.xaml.cs
  • MapControl/cs/Scenario6.xaml.cs
  • SimpleInk/cs/Scenario6.xaml.cs
  • VideoPlayback/cs/Scenario6_PlayingVideoLists.xaml.cs
  • FileAccess/cpp/Scenario6_Properties.xaml.cpp
  • FileThumbnails/cpp/Scenario6.xaml.cpp
  • MapControl/cpp/Scenario6.xaml.cpp
  • SimpleInk/cpp/Scenario6.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_AdInsertion Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_AdInsertion
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_AdInsertion Class Reference

See the README.md for discussion of this scenario.

List of all members.

Public Member Functions

Scenario6_AdInsertion ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | CreateMediaBreaksForItem (MediaPlaybackItem item)
async void | HideDescriptionOnSmallScreen ()
void | Item_TimedMetadataTracksChanged (MediaPlaybackItem item, IVectorChangedEventArgs args)
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | metadata_TrackingEvents_CueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | RegisterForMediaPlaybackItemEvents (MediaPlaybackItem item)
void | RegisterForMediaSourceEvents (MediaSource source)
void | RegisterMetadataHandlers (MediaPlaybackItem mediaPlaybackItem, int index)
void | Source_OpenOperationCompleted (MediaSource source, MediaSourceOpenOperationCompletedEventArgs args)
void | UnregisterForMediaPlaybackItemEvents (MediaPlaybackItem item)
void | UnregisterForMediaSourceEvents (MediaSource source)
void | UnregisterHandlers (MediaPlayer mediaPlayer)
void | UnregisterMetadataHandlers (TimedMetadataTrack timedTrack)

Private Attributes

AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger

Detailed Description

Definition at line 32 of file Scenario6_AdInsertion.xaml.cs.

Constructor & Destructor Documentation

Scenario6_AdInsertion ( ) [inline]

Definition at line 34 of file Scenario6_AdInsertion.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CreateMediaBreaksForItem ( MediaPlaybackItem item ) [inline, private]

Definition at line 176 of file Scenario6_AdInsertion.xaml.cs.

        {
            if (item != null)
            {
                // We have two ads that will be repeated.
                var redSkyUri = new Uri("http://az29176.vo.msecnd.net/videocontent/RedSky_FoxRiverWisc_GettyImagesRF-499617760_1080_HD_EN-US.mp4");
                var flowersUri = new Uri("http://az29176.vo.msecnd.net/videocontent/CrocusTL_FramePoolRM_688-580-676_1080_HD_EN-US.mp4");

                // One option is to create a separate MediaPlaybackItem for each of your ads.
                // You might choose to do this if each ad needs different reporting information.
                // Another option is to re-use MediaPlaybackItems in different MediaBreaks.
                // This scenario demonstrates both patterns.
                var ad1 = new MediaPlaybackItem(MediaSource.CreateFromUri(redSkyUri));
                ad1.Source.CustomProperties["contentId"] = "Ad1_ID";
                ad1.Source.CustomProperties["description"] = "Red Sky";
                ad1.Source.CustomProperties["uri"] = redSkyUri.ToString();
                RegisterForMediaSourceEvents(ad1.Source);
                RegisterForMediaPlaybackItemEvents(ad1);

                var ad2 = new MediaPlaybackItem(MediaSource.CreateFromUri(flowersUri));
                ad2.Source.CustomProperties["contentId"] = "Ad2_ID";
                ad2.Source.CustomProperties["description"] = "Flowers";
                ad2.Source.CustomProperties["uri"] = flowersUri.ToString();
                RegisterForMediaSourceEvents(ad2.Source);
                RegisterForMediaPlaybackItemEvents(ad2);

                var ad3 = new MediaPlaybackItem(MediaSource.CreateFromUri(redSkyUri));
                ad3.Source.CustomProperties["contentId"] = "Ad3_ID";
                ad3.Source.CustomProperties["description"] = "Red Sky 2";
                ad3.Source.CustomProperties["uri"] = redSkyUri.ToString();
                RegisterForMediaSourceEvents(ad3.Source);
                RegisterForMediaPlaybackItemEvents(ad3);

                // Create a PrerollBreak on your main content.
                if (item.BreakSchedule.PrerollBreak == null)
                {
                    item.BreakSchedule.PrerollBreak = new MediaBreak(MediaBreakInsertionMethod.Interrupt);
                }

                // Add the ads to the PrerollBreak in the order you want them played
                item.BreakSchedule.PrerollBreak.PlaybackList.Items.Add(ad1);
                item.BreakSchedule.PrerollBreak.PlaybackList.Items.Add(ad2);

                // Add the ads to the MidRoll break at 10% into the main content.
                // To do this, we need to wait until the main MediaPlaybackItem is fully loaded by the player
                // so that we know its Duration. This will happen on MediaSource.OpenOperationCompleted.
                item.Source.OpenOperationCompleted += (sender, args) =>
                {
                    var attachedItem = MediaPlaybackItem.FindFromMediaSource(sender);
                    if (sender.Duration.HasValue)
                    {
                        // For live streaming, the duration will be TimeSpan.MaxValue, which won't work for this scenario,
                        // so we'll assume the total duration is 2 minutes for the purpose of ad insertion.
                        bool isLiveMediaSource = item.Source.AdaptiveMediaSource != null ? item.Source.AdaptiveMediaSource.IsLive : false;
                        long sourceDurationTicks = isLiveMediaSource ? TimeSpan.FromMinutes(2).Ticks : sender.Duration.Value.Ticks;
                        var positionAt10PercentOfMainContent = TimeSpan.FromTicks(sourceDurationTicks / 10);

                        // If the content is live, then the ad break replaces the streaming content.
                        // If the content is not live, then the content pauses for the ad, and then resumes
                        // after the ad is complete.
                        MediaBreakInsertionMethod insertionMethod = isLiveMediaSource ? MediaBreakInsertionMethod.Replace : MediaBreakInsertionMethod.Interrupt;
                        var midRollBreak = new MediaBreak(insertionMethod, positionAt10PercentOfMainContent);
                        midRollBreak.PlaybackList.Items.Add(ad2);
                        midRollBreak.PlaybackList.Items.Add(ad1);
                        attachedItem.BreakSchedule.InsertMidrollBreak(midRollBreak);
                        Log($"Added MidRoll at {positionAt10PercentOfMainContent}");
                    }
                };

                // Create a PostrollBreak:
                // Note: for Live content, it will only play once the presentation transitions to VOD.
                if (item.BreakSchedule.PostrollBreak == null)
                {
                    item.BreakSchedule.PostrollBreak = new MediaBreak(MediaBreakInsertionMethod.Interrupt);
                }
                // Add the ads to the PostrollBreak in the order you want them played
                item.BreakSchedule.PostrollBreak.PlaybackList.Items.Add(ad3);
            }
        }

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 167 of file Scenario6_AdInsertion.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

void Item_TimedMetadataTracksChanged | ( | MediaPlaybackItem | item,
 |  | IVectorChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 317 of file Scenario6_AdInsertion.xaml.cs.

        {
            Log($"item.TimedMetadataTracksChanged: CollectionChange:{args.CollectionChange} Index:{args.Index} Total:{item.TimedMetadataTracks.Count}");

            if (args.CollectionChange == CollectionChange.ItemInserted)
            {
                RegisterMetadataHandlers(item, (int)args.Index);
            }
            if (args.CollectionChange == CollectionChange.Reset)
            {
                for (int index = 0; index < item.TimedMetadataTracks.Count; index++)
                {
                    RegisterMetadataHandlers(item, index);
                }
            }
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 107 of file Scenario6_AdInsertion.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                var adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);

            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
                return null;
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = "MainContent_ID";

            // In addition to logging, this scenario uses MediaSource events:
            RegisterForMediaSourceEvents(source);

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            // In addition to logging, this scenario uses MediaPlaybackItem events:
            RegisterForMediaPlaybackItemEvents(mpItem);

            // Now that we should have a MediaPlaybackItem, we will insert pre- mid- and post-roll ads
            // with the MediaBreak API.
            CreateMediaBreaksForItem(mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 393 of file Scenario6_AdInsertion.xaml.cs.

        {
            LoggerControl.Log(message);
        }

void metadata_TrackingEvents_CueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 373 of file Scenario6_AdInsertion.xaml.cs.

        {
            StringBuilder logMsg = new StringBuilder();
            object customValue = null;
            timedMetadataTrack.PlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            logMsg.AppendLine($"{contentId} TrackingEventCue CueEntered raised.");
            var trackingEventCue = args.Cue as TrackingEventCue;
            if (trackingEventCue != null)
            {
                logMsg.AppendLine($"Label: {timedMetadataTrack.Label}, Id: {trackingEventCue.Id}, StartTime: {trackingEventCue.StartTime}, Duration: {trackingEventCue.Duration}");
                logMsg.Append($"{trackingEventCue.TrackingEventUri}");
                // TODO: Use the reporing Uri.
            }
            Log(logMsg.ToString());
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario6_AdInsertion.xaml.cs.

        {
            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario6_AdInsertion.xaml.cs.

        {
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
            var prHelper = new PlayReadyHelper(LoggerControl);
            prHelper.SetUpProtectionManager(mediaPlayer);
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
                null,
                LoggerControl,
                LoadSourceFromUriAsync);
        }

void RegisterForMediaPlaybackItemEvents ( MediaPlaybackItem item ) [inline, private]

Definition at line 286 of file Scenario6_AdInsertion.xaml.cs.

        {
            // If we encountered some unknown tags in an m3u8 manifest,
            // we might already have metadata tracks in the source,
            // which is used as the constructor for the MediaPlaybackItem.
            // Therefore, the MediaPlaybackItem may already have metadata tracks.
            // Since TracksChanged will not be raised for these it is best to check
            // if we have tracks, and set up the handlers:
            if (item.TimedMetadataTracks.Count > 0)
            {
                Log($"Registering existing TimedMetadataTracks, Count: {item.TimedMetadataTracks.Count}");

                for (int index = 0; index < item.TimedMetadataTracks.Count; index++)
                {
                    RegisterMetadataHandlers(item, index);
                }
            }

            // For any tracks found as the content is parsed, we register for the event handler:
            item.TimedMetadataTracksChanged += Item_TimedMetadataTracksChanged;
        }

void RegisterForMediaSourceEvents ( MediaSource source ) [inline, private]

Definition at line 260 of file Scenario6_AdInsertion.xaml.cs.

        {
            source.OpenOperationCompleted += Source_OpenOperationCompleted;
        }

void RegisterMetadataHandlers | ( | MediaPlaybackItem | mediaPlaybackItem,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 334 of file Scenario6_AdInsertion.xaml.cs.

        {
            var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
            object customValue = null;
            mediaPlaybackItem.Source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;

            StringBuilder logMsg = new StringBuilder($"{contentId} ");

            if (timedTrack.TrackKind == MediaTrackKind.TimedMetadata &&
                timedTrack.TimedMetadataKind == TimedMetadataKind.Custom)
            {
                // Check for our Custom TimedMetadataTrack
                if (mediaPlaybackItem.TimedMetadataTracks[index].Id == "TrackingEvents")
                {
                    timedTrack.CueEntered += metadata_TrackingEvents_CueEntered;
                    timedTrack.Label = "Tracking Events";
                    mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
                }

                logMsg.AppendLine($"Registered CueEntered for {timedTrack.Label}.");
            }
            else
            {
                logMsg.AppendLine("Did not register CueEntered for TimedMetadataTrack.");
            }
            logMsg.AppendLine($"TimedMetadataKind: {timedTrack.TimedMetadataKind}, Id: {timedTrack.Id}, Label: {timedTrack.Label}, DispatchType: {timedTrack.DispatchType}, Language: {timedTrack.Language}");

            Log(logMsg.ToString());
        }

void Source_OpenOperationCompleted | ( | MediaSource | source,
 |  | MediaSourceOpenOperationCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 269 of file Scenario6_AdInsertion.xaml.cs.

        {
            // Here we create our own metadata track.
            // Our goal is to track progress through the asset and report it back to a server.
            object customValue = null;
            source.CustomProperties.TryGetValue("contentId", out customValue);
            string contentId = (string)customValue;
            var reportingUriFormat = "http://myserver/reporting/{0}?id={1}";
            // From \Shared\TrackingEventCue.cs:
            TrackingEventCue.CreateTrackingEventsTrack(source, contentId, reportingUriFormat);
        }

void UnregisterForMediaPlaybackItemEvents ( MediaPlaybackItem item ) [inline, private]

Definition at line 308 of file Scenario6_AdInsertion.xaml.cs.

        {
            item.TimedMetadataTracksChanged -= Item_TimedMetadataTracksChanged;
            foreach (var track in item.TimedMetadataTracks)
            {
                UnregisterMetadataHandlers(track);
            }
        }

void UnregisterForMediaSourceEvents ( MediaSource source ) [inline, private]

Definition at line 264 of file Scenario6_AdInsertion.xaml.cs.

        {
            source.OpenOperationCompleted -= Source_OpenOperationCompleted;
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 56 of file Scenario6_AdInsertion.xaml.cs.

        {
            AdaptiveMediaSource adaptiveMediaSource = null;
            MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
            if (mpItem != null)
            {
                adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
                UnregisterForMediaSourceEvents(mpItem.Source);
                UnregisterForMediaPlaybackItemEvents(mpItem);
            }
            MediaSource source = mediaPlayer.Source as MediaSource;
            if (source != null)
            {
                adaptiveMediaSource = source.AdaptiveMediaSource;
                UnregisterForMediaSourceEvents(source);
            }

            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;

        }

void UnregisterMetadataHandlers ( TimedMetadataTrack timedTrack ) [inline, private]

Definition at line 365 of file Scenario6_AdInsertion.xaml.cs.

        {
            if (timedTrack.Label == "Tracking Events")
            {
                timedTrack.CueEntered -= metadata_TrackingEvents_CueEntered;
            }
        }

Member Data Documentation

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 400 of file Scenario6_AdInsertion.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 399 of file Scenario6_AdInsertion.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 397 of file Scenario6_AdInsertion.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 398 of file Scenario6_AdInsertion.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario6_AdInsertion.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_AppListingURI Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_AppListingURI
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_AppListingURI Class Reference

A page for sixth scenario.

List of all members.

Public Member Functions

Scenario6_AppListingURI ()

Private Member Functions

async void | DisplayLink ()

Private Attributes

MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()

Detailed Description

Definition at line 21 of file Scenario6_AppListingURI.xaml.cs.

Constructor & Destructor Documentation

Scenario6_AppListingURI ( ) [inline]

Definition at line 26 of file Scenario6_AppListingURI.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DisplayLink ( ) [inline, private]

Definition at line 31 of file Scenario6_AppListingURI.xaml.cs.

        {
            StoreProductResult result = await storeContext.GetStoreProductForCurrentAppAsync();
            if (result.ExtendedError != null)
            {
                Utils.ReportExtendedError(result.ExtendedError);
                return;
            }

            await Windows.System.Launcher.LaunchUriAsync(result.Product.LinkUri);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario6_AppListingURI.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 24 of file Scenario6_AppListingURI.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario6_AppListingURI.xaml.cs
  • Store/cpp/Scenario6_AppListingURI.xaml.cpp
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ClearScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_ClearScenario
Public Member Functions | Private Member Functions

Scenario6_ClearScenario Class Reference

List of all members.

Public Member Functions

Scenario6_ClearScenario ()

Private Member Functions

async void Clear_Click (Object sender, RoutedEventArgs e)

Detailed Description

Definition at line 17 of file Scenario6_ClearScenario.xaml.cs.

Constructor & Destructor Documentation

Scenario6_ClearScenario ( ) [inline]

Definition at line 19 of file Scenario6_ClearScenario.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void Clear_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file Scenario6_ClearScenario.xaml.cs.

        {
            try
            {
                await Windows.Storage.ApplicationData.Current.ClearAsync();
                OutputTextBlock.Text = "ApplicationData has been cleared.  Visit the other scenarios to see that their data has been cleared.";
            }
            catch (Exception)
            {
                OutputTextBlock.Text = "Unable to clear settings. This can happen when files are in use.";
            }
        }

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario6_ClearScenario.xaml.cs
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_CustomFilterAddedProps Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_CustomFilterAddedProps
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_CustomFilterAddedProps Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario6_CustomFilterAddedProps ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | StartWatcher ()
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)

Private Attributes

DeviceWatcherHelper deviceWatcherHelper
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario6_CustomFilterAddedProps.xaml.cs.

Constructor & Destructor Documentation

Scenario6_CustomFilterAddedProps ( ) [inline]

Definition at line 27 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            this.InitializeComponent();

            deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            deviceWatcherHelper.Reset();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;
        }

void StartWatcher ( ) [inline, private]

Definition at line 54 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            aqsFilterTextBox.IsEnabled = false;
            startWatcherButton.IsEnabled = false;
            resultCollection.Clear();

            // Request some additional properties.  In this saample, these extra properties are just used in the ResultsListViewTemplate.
            // Take a look there in the XAML. Also look at the converter used by the XAML GeneralPropertyValueConverter.  In general you just use
            // DeviceInformation.Properties["<property name>"] to get a property. e.g. DeviceInformation.Properties["System.Devices.InterfaceClassGuid"].
            string[] requestedProperties = new string[] {
                "System.Devices.InterfaceClassGuid",
                "System.ItemNameDisplay"
            };

            // Use AQS string filter from the text box
            DeviceWatcher deviceWatcher = DeviceInformation.CreateWatcher(
                aqsFilterTextBox.Text,
                requestedProperties);

            rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
            deviceWatcherHelper.StartWatcher(deviceWatcher);
            stopWatcherButton.IsEnabled = true;
            stopWatcherButton.Focus(FocusState.Keyboard);
            aqsFilterTextBox.IsEnabled = true;
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            StartWatcher();
        }

void StopWatcher ( ) [inline, private]

Definition at line 80 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            aqsFilterTextBox.IsEnabled = false;
            stopWatcherButton.IsEnabled = false;

            deviceWatcherHelper.StopWatcher();

            startWatcherButton.IsEnabled = true;
            startWatcherButton.Focus(FocusState.Keyboard);
            aqsFilterTextBox.IsEnabled = true;
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 49 of file Scenario6_CustomFilterAddedProps.xaml.cs.

        {
            StopWatcher();
        }

Member Data Documentation

DeviceWatcherHelper deviceWatcherHelper [private]

Definition at line 23 of file Scenario6_CustomFilterAddedProps.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 25 of file Scenario6_CustomFilterAddedProps.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario6_CustomFilterAddedProps.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario6_CustomFilterAddedProps.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_DeleteTPM Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_DeleteTPM
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_DeleteTPM Class Reference

List of all members.

Public Member Functions

Scenario6_DeleteTPM ()

Private Member Functions

async void | Delete_Click (object sender, RoutedEventArgs e)
void | HandleCardRemoved (SmartCardReader evtReader, CardRemovedEventArgs args)

Private Attributes

SmartCardReader | reader
MainPage rootPage = MainPage.Current
SynchronizationContext | uiContext = null

Detailed Description

Definition at line 9 of file Scenario6_DeleteTPM.xaml.cs.

Constructor & Destructor Documentation

Scenario6_DeleteTPM ( ) [inline]

Definition at line 16 of file Scenario6_DeleteTPM.xaml.cs.

        {
            this.InitializeComponent();

            // Since this class is a page, it will be instantiated on the UI
            // thread.  We need to keep a reference to the UI thread's
            // synchronization context as a member so that we can access it
            // from other threads for event handlers.  See the
            // HandleCardRemoved method for more information.
            uiContext = SynchronizationContext.Current;
        }

Member Function Documentation

async void Delete_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'Delete' button.

Parameters:
sender
e

Definition at line 33 of file Scenario6_DeleteTPM.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;
            rootPage.NotifyUser("Deleting the TPM virtual smart card...", NotifyType.ErrorMessage);

            try
            {
                SmartCard card = await rootPage.GetSmartCard();

                // The following two lines are not directly related to TPM virtual
                // smart card creation, but are used to demonstrate how to handle
                // CardRemoved events by registering an event handler with a
                // SmartCardReader object.  Since we are using a TPM virtual smart
                // card in this case, the card cannot actually be added to or
                // removed from the reader, but a CardRemoved event will fire
                // when the reader and card are deleted.
                //
                // We must retain a reference to the SmartCardReader object to
                // which we are adding the event handler.  We use += to add the
                // HandleCardRemoved method as an event handler.  The function
                // will be automatically boxed in a TypedEventHandler, but
                // the function signature match the template arguments for
                // the specific event - in this case,
                // <SmartCardReader, CardRemovedEventArgs>
                reader = card.Reader;
                reader.CardRemoved += HandleCardRemoved;

                bool result = await SmartCardProvisioning.RequestVirtualSmartCardDeletionAsync(card);

                if (result)
                {
                    rootPage.NotifyUser("TPM virtual smart card deletion completed.", NotifyType.StatusMessage);
                    rootPage.SmartCardReaderDeviceId = null;
                }
                else
                {
                    rootPage.NotifyUser("TPM virtual smart card deletion was canceled by the user.", NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("TPM virtual smartcard deletion failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

void HandleCardRemoved | ( | SmartCardReader | evtReader,
 |  | CardRemovedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 89 of file Scenario6_DeleteTPM.xaml.cs.

        {
            // This event handler will not be invoked on the UI thread.  Hence,
            // to perform UI operations we need to post a lambda to be executed
            // back on the UI thread; otherwise we may access objects which
            // are not marshalled for the current thread, which will result in an
            // exception due to RPC_E_WRONG_THREAD.
            uiContext.Post((object ignore) =>
            {
                rootPage.NotifyUser("Card removed from reader " + evtReader.Name + ".", NotifyType.StatusMessage);
            }, null);
        }

Member Data Documentation

SmartCardReader reader [private]

Definition at line 13 of file Scenario6_DeleteTPM.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 11 of file Scenario6_DeleteTPM.xaml.cs.

SynchronizationContext uiContext = null [private]

Definition at line 14 of file Scenario6_DeleteTPM.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario6_DeleteTPM.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_GetLastVisit Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_GetLastVisit
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_GetLastVisit Class Reference

List of all members.

Public Member Functions

Scenario6_GetLastVisit ()

Private Member Functions

async void | GetLastVisitButtonClicked (object sender, RoutedEventArgs e)
void | UpdateLastVisit (Geovisit visit)

Private Attributes

MainPage _rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario6_GetLastVisit.xaml.cs.

Constructor & Destructor Documentation

Scenario6_GetLastVisit ( ) [inline]

Definition at line 27 of file Scenario6_GetLastVisit.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetLastVisitButtonClicked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'getLastVisit' button.

Parameters:
sender
e

Definition at line 37 of file Scenario6_GetLastVisit.xaml.cs.

        {
            GetLastVisitButton.IsEnabled = false;
            LocationDisabledMessage.Visibility = Visibility.Collapsed;

            // Request permission to access location
            var accessStatus = await Geolocator.RequestAccessAsync();

            Geovisit visit = null;
            switch (accessStatus)
            {
                case GeolocationAccessStatus.Allowed:
                    _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);

                    // Get the last visit report, if any. This should be a quick operation.
                    visit = await GeovisitMonitor.GetLastReportAsync();
                    _rootPage.NotifyUser("Visit info updated.", NotifyType.StatusMessage);
                    break;

                case GeolocationAccessStatus.Denied:
                    _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                    LocationDisabledMessage.Visibility = Visibility.Visible;
                    break;

                default:
                case GeolocationAccessStatus.Unspecified:
                    _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
                    break;
            }

            UpdateLastVisit(visit);

            GetLastVisitButton.IsEnabled = true;
        }

void UpdateLastVisit ( Geovisit visit ) [inline, private]

Updates the user interface with the Geovisit data provided.

Parameters:
visit Geovisit to display its details

Definition at line 76 of file Scenario6_GetLastVisit.xaml.cs.

        {
            if (visit == null)
            {
                ScenarioOutput_Latitude.Text = "No data";
                ScenarioOutput_Longitude.Text = "No data";
                ScenarioOutput_Accuracy.Text = "No data";
                ScenarioOutput_Timestamp.Text = "No data";
                ScenarioOutput_VisitStateChange.Text = "No data";
            }
            else
            {
                // A valid visit is available, extract the state change and Timestamp.
                ScenarioOutput_VisitStateChange.Text = visit.StateChange.ToString();
                ScenarioOutput_Timestamp.Text = visit.Timestamp.ToString();

                // If a valid position is available, extract the position information that caused the state change to happen.
                if(visit.Position == null)
                {
                    ScenarioOutput_Latitude.Text = "No data";
                    ScenarioOutput_Longitude.Text = "No data";
                    ScenarioOutput_Accuracy.Text = "No data";
                    ScenarioOutput_IsRemoteSource.Text = "No data";
                }
                else
                {
                    ScenarioOutput_Latitude.Text = visit.Position.Coordinate.Point.Position.Latitude.ToString();
                    ScenarioOutput_Longitude.Text = visit.Position.Coordinate.Point.Position.Longitude.ToString();
                    ScenarioOutput_Accuracy.Text = visit.Position.Coordinate.Accuracy.ToString();
                    ScenarioOutput_IsRemoteSource.Text = visit.Position.Coordinate.IsRemoteSource.ToString();
                }
            }
        }

Member Data Documentation

MainPage _rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario6_GetLastVisit.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario6_GetLastVisit.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ManipulatingCursorAttributes Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_ManipulatingCursorAttributes
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_ManipulatingCursorAttributes Class Reference

List of all members.

Public Member Functions

Scenario6_ManipulatingCursorAttributes ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DisplayTextButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeAsync ()
async void | ResetButton_Click (object sender, RoutedEventArgs e)
async void | UpdateButton_Click (object sender, RoutedEventArgs e)

Private Attributes

ClaimedLineDisplay | lineDisplay
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 23 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

Constructor & Destructor Documentation

Scenario6_ManipulatingCursorAttributes ( ) [inline]

Definition at line 28 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

async void DisplayTextButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 142 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            if (await lineDisplay.DefaultWindow.TryDisplayTextAsync("Text"))
            {
                rootPage.NotifyUser("Text displayed.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Failed to display text.", NotifyType.ErrorMessage);
            }
        }

task< void > InitializeAsync ( ) [inline, private]

Definition at line 45 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            UpdateButton.IsEnabled = false;
            DisplayTextButton.IsEnabled = false;
            ResetButton.IsEnabled = false;
            CursorTypeComboBox.Items.Clear();

            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();

            CursorTypeComboBox.IsEnabled = (lineDisplay != null) && lineDisplay.DefaultWindow.Cursor.CanCustomize;
            if (CursorTypeComboBox.IsEnabled)
            {
                if (lineDisplay.DefaultWindow.Cursor.IsBlockSupported)
                {
                    CursorTypeComboBox.Items.Add(LineDisplayCursorType.Block);
                }

                if (lineDisplay.DefaultWindow.Cursor.IsHalfBlockSupported)
                {
                    CursorTypeComboBox.Items.Add(LineDisplayCursorType.HalfBlock);
                }

                if (lineDisplay.DefaultWindow.Cursor.IsOtherSupported)
                {
                    CursorTypeComboBox.Items.Add(LineDisplayCursorType.Other);
                }

                if (lineDisplay.DefaultWindow.Cursor.IsReverseSupported)
                {
                    CursorTypeComboBox.Items.Add(LineDisplayCursorType.Reverse);
                }

                if (lineDisplay.DefaultWindow.Cursor.IsUnderlineSupported)
                {
                    CursorTypeComboBox.Items.Add(LineDisplayCursorType.Underline);
                }

                if (CursorTypeComboBox.Items.Count > 0)
                {
                    CursorTypeComboBox.SelectedIndex = 0;
                }
            }

            IsAutoAdvanceEnabledCheckbox.IsEnabled = (lineDisplay != null);

            IsBlinkEnabledCheckbox.IsEnabled = (lineDisplay != null) && lineDisplay.DefaultWindow.Cursor.IsBlinkSupported;
            SetCursorPositionCheckbox.IsEnabled = (lineDisplay != null);
            UpdateButton.IsEnabled = (lineDisplay != null);
            DisplayTextButton.IsEnabled = (lineDisplay != null);

            ResetButton.IsEnabled = true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            await InitializeAsync();
        }

async void ResetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 154 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            lineDisplay?.Dispose();
            await InitializeAsync();
        }

async void UpdateButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 98 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

        {
            LineDisplayCursorAttributes cursorAttributes = lineDisplay.DefaultWindow.Cursor.GetAttributes();
            cursorAttributes.IsAutoAdvanceEnabled = IsAutoAdvanceEnabledCheckbox.IsChecked.Value;

            if (lineDisplay.DefaultWindow.Cursor.CanCustomize && (CursorTypeComboBox.SelectedItem != null))
            {
                cursorAttributes.CursorType = (LineDisplayCursorType)CursorTypeComboBox.SelectedItem;
            }

            if (lineDisplay.DefaultWindow.Cursor.IsBlinkSupported)
            {
                cursorAttributes.IsBlinkEnabled = IsBlinkEnabledCheckbox.IsChecked.Value;
            }

            if (SetCursorPositionCheckbox.IsChecked.Value)
            {
                Point position = new Point()
                {
                    X = Helpers.ParseUIntWithFallback(CursorPositionXTextBox, -1.0),
                    Y = Helpers.ParseUIntWithFallback(CursorPositionYTextBox, -1.0),
                };

                Size windowSizeInCharacters = lineDisplay.DefaultWindow.SizeInCharacters;
                if ((position.X < 0) || (position.X >= windowSizeInCharacters.Width) ||
                    (position.Y < 0) || (position.Y >= windowSizeInCharacters.Height))
                {
                    rootPage.NotifyUser("Cursor position must be within the window.", NotifyType.ErrorMessage);
                    return;
                }

                cursorAttributes.Position = position;
            }

            if (await lineDisplay.DefaultWindow.Cursor.TryUpdateAttributesAsync(cursorAttributes))
            {
                rootPage.NotifyUser("Cursor updated.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Failed to update the cursor.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

ClaimedLineDisplay lineDisplay [private]

Definition at line 26 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario6_ManipulatingCursorAttributes.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario6_ManipulatingCursorAttributes.xaml.cs
  • LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_NavToStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_NavToStream
Classes | Public Member Functions | Protected Member Functions | Private Attributes

Scenario6_NavToStream Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Classes

class | StreamUriWinRTResolver
Sample URI resolver object for use with NavigateToLocalStreamUri. More...

Public Member Functions

Scenario6_NavToStream ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Attributes

StreamUriWinRTResolver myResolver

Detailed Description

Definition at line 27 of file Scenario6_NavToStream.xaml.cs.

Constructor & Destructor Documentation

Scenario6_NavToStream ( ) [inline]

Definition at line 31 of file Scenario6_NavToStream.xaml.cs.

        {
            myResolver = new StreamUriWinRTResolver();
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario6_NavToStream.xaml.cs.

        {
            // The 'Host' part of the URI for the ms-local-stream protocol is a combination of the package name
            // and an application-defined key, which identifies the specfic resolver.
            // Here, we use 'MyTag'.

            Uri url = WebViewControl.BuildLocalStreamUri("MyTag", "/default.html");

            // The resolver object needs to be passed in to the navigate call.
            WebViewControl.NavigateToLocalStreamUri(url, myResolver);
        }

Member Data Documentation

StreamUriWinRTResolver myResolver [private]

Definition at line 29 of file Scenario6_NavToStream.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario6_NavToStream.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_NavToStream::StreamUriWinRTResolver Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_NavToStream
  • Scenario6_NavToStream::StreamUriWinRTResolver
Public Member Functions | Private Member Functions

Scenario6_NavToStream::StreamUriWinRTResolver Class Reference

Sample URI resolver object for use with NavigateToLocalStreamUri. More...

List of all members.

Public Member Functions

IAsyncOperation< IInputStream > | UriToStreamAsync (Uri uri)

Private Member Functions

async Task< IInputStream > | GetContentAsync (Uri uri)

Detailed Description

The object must implement the IUriToStreamResolver interface

Note: If your content is stored in the package or local state, then you can use the ms-appx-web: or ms-appdata: protocol demonstrated in the "Navigate to package and local state" scenario. Those protocols will will create a resolver for you.

Definition at line 58 of file Scenario6_NavToStream.xaml.cs.

Member Function Documentation

async Task<IInputStream> GetContentAsync ( Uri uri ) [inline, private]

Helper that produces the contents corresponding to a Uri.

Uses the C# await pattern to coordinate async operations.

Parameters:
uri
Returns:

Definition at line 79 of file Scenario6_NavToStream.xaml.cs.

            {
                string path = uri.AbsolutePath;
                string contents;

                switch (path)
                {
                    case "/default.html":
                        contents = await MainPage.LoadStringFromPackageFileAsync("stream_example.html");
                        contents = contents.Replace("%", Windows.ApplicationModel.Package.Current.Id.Name);
                        break;

                    case "/stream.css":
                        contents = "p { color: blue; }";
                        break;

                    default:
                        throw new Exception($"Could not resolve URI \"{uri}\"");
                }

                // Convert the string to a stream.
                IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(contents, BinaryStringEncoding.Utf8);
                var stream = new InMemoryRandomAccessStream();
                await stream.WriteAsync(buffer);
                return stream.GetInputStreamAt(0);
            }

IAsyncOperation<IInputStream> UriToStreamAsync ( Uri uri ) [inline]

The entry point for resolving a URI to a stream.

Parameters:
uri
Returns:

Definition at line 65 of file Scenario6_NavToStream.xaml.cs.

            {
                // Because of the signature of the this method, it can't use await, so we
                // call into a separate helper method that can use the C# await pattern.
                return GetContentAsync(uri).AsAsyncOperation();
            }

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario6_NavToStream.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_NumeralSystemTranslation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_NumeralSystemTranslation
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_NumeralSystemTranslation Class Reference

List of all members.

Public Member Functions

Scenario6_NumeralSystemTranslation ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario6_NumeralSystemTranslation.xaml.cs.

Constructor & Destructor Documentation

Scenario6_NumeralSystemTranslation ( ) [inline]

Definition at line 25 of file Scenario6_NumeralSystemTranslation.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 35 of file Scenario6_NumeralSystemTranslation.xaml.cs.

        {
            // Text for which translation of the numeral system will be performed.  Please note that translation only happens between
            // Latin and any other supported numeral system.  Translation between numeral systems is not a supported scenario.
            String stringToTranslate = "These are the 10 digits of a numeral system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";

            // Variable where we keep the results of the scenario
            StringBuilder results = new StringBuilder();
            results.Append("Original string: " + stringToTranslate + "\n\n");

            // The numeral system translator is initialized based on the current application language.
            NumeralSystemTranslator numeralTranslator = new Windows.Globalization.NumberFormatting.NumeralSystemTranslator();

            // Do translation
            results.Append("Using application settings (" + numeralTranslator.NumeralSystem + "): ");
            results.Append(numeralTranslator.TranslateNumerals(stringToTranslate) + "\n");

            // Switch to a different numeral system
            numeralTranslator.NumeralSystem = "hanidec";

            // Do translation
            results.Append("Using numeral system via property (" + numeralTranslator.NumeralSystem + " ): ");
            results.Append(numeralTranslator.TranslateNumerals(stringToTranslate) + "\n");

            // Create a converter using a language list to initialize the numeral system to an appropriate default
            numeralTranslator = new Windows.Globalization.NumberFormatting.NumeralSystemTranslator(new string[] {"ar-SA", "en-US"});

            // Do translation
            results.Append("Using numeral system via language list (" + numeralTranslator.NumeralSystem + "): ");
            results.Append(numeralTranslator.TranslateNumerals(stringToTranslate) + "\n");

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario6_NumeralSystemTranslation.xaml.cs.

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario6_NumeralSystemTranslation.xaml.cs
  • NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_RecoverableErrors Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_RecoverableErrors
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario6_RecoverableErrors Class Reference

List of all members.

Public Member Functions

Scenario6_RecoverableErrors ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | CancelActiveDownloadsAsync ()
async Task | HandleDownloadAsync ()
bool | IsWebException (string title, Exception ex)
async void | OnDownloadProgress (IAsyncOperationWithProgress< DownloadOperation, DownloadOperation > sender, DownloadOperation progress)
async void | StartDownload_Click (object sender, RoutedEventArgs e)

Private Attributes

DownloadOperation | download = null
CancellationTokenSource | downloadCancellationTokenSource = new CancellationTokenSource()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario6_RecoverableErrors.xaml.cs.

Constructor & Destructor Documentation

Scenario6_RecoverableErrors ( ) [inline]

Definition at line 35 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

task< void > CancelActiveDownloadsAsync ( ) [inline, private]

Definition at line 61 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            IReadOnlyList<DownloadOperation> downloads;
            try
            {
                downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
            }
            catch (Exception ex) when (IsWebException("Discovery error", ex))
            {
                // Don't worry if the old downloads encountered web exceptions.
                return;
            }

            // If previous sample instances/scenarios started transfers that haven't completed yet, cancel them now
            // so that we can start this scenario cleanly.
            if (downloads.Count > 0)
            {
                using (CancellationTokenSource canceledToken = new CancellationTokenSource())
                {
                    canceledToken.Cancel();

                    Task[] tasks = new Task[downloads.Count];
                    for (int i = 0; i < downloads.Count; i++)
                    {
                        tasks[i] = downloads[i].AttachAsync().AsTask(canceledToken.Token);
                    }

                    try
                    {
                        await Task.WhenAll(tasks);
                    }
                    catch (TaskCanceledException)
                    {
                    }
                }

                rootPage.NotifyUser($"Canceled {downloads.Count} downloads.", NotifyType.StatusMessage);
            }
        }

task< void > HandleDownloadAsync ( ) [inline, private]

Definition at line 214 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            try
            {
                startDownloadButton.IsEnabled = false;
                IAsyncOperationWithProgress<DownloadOperation, DownloadOperation> downloadOperation = download.StartAsync();
                downloadOperation.Progress += OnDownloadProgress;
                await downloadOperation.AsTask(downloadCancellationTokenSource.Token);

                rootPage.NotifyUser("Download completed successfully", NotifyType.StatusMessage);
            }
            catch (Exception ex) when (IsWebException("Execution error", ex))
            {
            }
            catch (TaskCanceledException)
            {
                // Download was canceled.
            }
            finally
            {
                download = null;
                startDownloadButton.IsEnabled = true;
            }
        }

bool IsWebException | ( | string | title,
 |  | Exception | ex |
 | ) |  |  | [inline, private]

Definition at line 239 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            bool result = (error != WebErrorStatus.Unknown);
            string message = result ? error.ToString() : ex.Message;
            if (download == null)
            {
                rootPage.NotifyUser($"{title}: {message}", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser($"{download.Guid} - {title}: {message}", NotifyType.ErrorMessage);
            }

            return result;
        }

async void OnDownloadProgress | ( | IAsyncOperationWithProgress< DownloadOperation, DownloadOperation > | sender,
 |  | DownloadOperation | progress |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            // We capture a snapshot of DownloadOperation.Progress because
            // it is is updated in real-time while the operation is ongoing.
            BackgroundDownloadProgress currentProgress = progress.Progress;

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Prepare the progress message to display in the UI.
                ulong percent = 100;
                if (currentProgress.TotalBytesToReceive > 0)
                {
                    percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
                }

                DownloadedStatusText.Text = $"{currentProgress.Status} - {percent}% downloaded.";

                if (currentProgress.HasRestarted)
                {
                    rootPage.NotifyUser("Download has restarted.", NotifyType.StatusMessage);
                }

                if (currentProgress.Status == BackgroundTransferStatus.PausedRecoverableWebErrorStatus)
                {
                    // The only value we put in RecoverableWebErrorStatuses is WebErrorStatus.Forbidden,
                    // so that will be the only value observed here.
                    System.Diagnostics.Debug.Assert(download.CurrentWebErrorStatus == WebErrorStatus.Forbidden);

                    rootPage.NotifyUser("URL has expired.", NotifyType.ErrorMessage);

                    // The URL expired. Ask the user for information so we can get a new URL.
                    ContentDialogResult result = await ReauthorizeDialog.ShowAsync();

                    if (result == ContentDialogResult.Primary)
                    {
                        // For the purpose of this sample, we simply remove "?shouldExpire=yes" from the URL
                        // to indicate that the sample server should treat it like a new, unexpired URL.
                        string originalUrlString = download.RequestedUri.OriginalString;
                        string newUrlString = originalUrlString.Replace("?shouldExpire=yes", "");

                        rootPage.NotifyUser("Updating URL and resuming the download.", NotifyType.StatusMessage);
                        download.RequestedUri = new Uri(newUrlString);
                        download.Resume();
                    }
                    else
                    {
                        // Cancel the download.
                        downloadCancellationTokenSource.Cancel();
                        downloadCancellationTokenSource.Dispose();

                        // Re-create the CancellationTokenSource for future downloads.
                        downloadCancellationTokenSource = new CancellationTokenSource();
                    }
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 56 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            downloadCancellationTokenSource.Cancel();
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 45 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
            // Typically this can be done in the App class by overriding OnLaunched() and checking for
            // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
            // We do it here in the sample to keep the sample code consolidated.
            // Note that for this specific scenario we are not interested in downloads from previous instances, so
            // we just enumerate all downloads from previous instances and cancel them immediately.
            await CancelActiveDownloadsAsync();
        }

async void StartDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 158 of file Scenario6_RecoverableErrors.xaml.cs.

        {
            // Reset the output whenever a new download attempt begins.
            DownloadedInfoText.Text = "";
            DownloadedStatusText.Text = "";
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            Uri source;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out source))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            string destination = fileNameField.Text.Trim();
            if (string.IsNullOrWhiteSpace(destination))
            {
                rootPage.NotifyUser("A local file name is required.", NotifyType.ErrorMessage);
                return;
            }

            StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
            StorageFile destinationFile;
            try
            {
                destinationFile = await picturesLibrary.CreateFileAsync(destination, CreationCollisionOption.GenerateUniqueName);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser($"Error while creating file: {ex.Message}", NotifyType.ErrorMessage);
                return;
            }

            BackgroundDownloader downloader = new BackgroundDownloader();
            download = downloader.CreateDownload(source, destinationFile);

            // Opt into "random access" mode. Transfers configured this way have full support for resumable URL updates.
            // If the timestamp or file size of the updated URL is different from that of the previous URL, the download
            // will restart from scratch. Otherwise, the transfer will resume from the same position using the new URL.
            //
            // Due to OS limitations, downloads that don't opt into "random access" mode will always restart from scratch
            // whenever their URL is updated.
            download.IsRandomAccessRequired = true;

            if (configureRecoverableErrorsCheckBox.IsChecked.Value)
            {
                // Declare HTTP 403 (WebErrorStatus.Forbidden) as a recoverable error.
                download.RecoverableWebErrorStatuses.Add(WebErrorStatus.Forbidden);
            }

            DownloadedInfoText.Text = $"Downloading to {destinationFile.Name}, {download.Guid}";

            // Start the download and wait for it to complete.
            await HandleDownloadAsync();
        }

Member Data Documentation

DownloadOperation download = null [private]

Definition at line 32 of file Scenario6_RecoverableErrors.xaml.cs.

CancellationTokenSource downloadCancellationTokenSource = new CancellationTokenSource() [private]

Definition at line 33 of file Scenario6_RecoverableErrors.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario6_RecoverableErrors.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_Recurrence Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_Recurrence
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_Recurrence Class Reference

List of all members.

Public Member Functions

Scenario6_Recurrence ()

Private Member Functions

void Create_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario6_Recurrence.xaml.cs.

Constructor & Destructor Documentation

Scenario6_Recurrence ( ) [inline]

Definition at line 23 of file Scenario6_Recurrence.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Create_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Creates a Recurrence object based on input fields and validates it.

Parameters:
sender
e

Definition at line 33 of file Scenario6_Recurrence.xaml.cs.

        {
            string errorMessage = null;
            var recurrence = new Windows.ApplicationModel.Appointments.AppointmentRecurrence();

            // Unit
            switch (UnitComboBox.SelectedIndex)
            {
                case 0:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Daily;
                    break;
                case 1:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Weekly;
                    break;
                case 2:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Monthly;
                    break;
                case 3:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.MonthlyOnDay;
                    break;
                case 4:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Yearly;
                    break;
                case 5:
                    recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.YearlyOnDay;
                    break;
            }

            // Occurrences
            // Note: Occurrences and Until properties are mutually exclusive.
            if (OccurrencesRadioButton.IsChecked.Value)
            {
                recurrence.Occurrences = (uint)OccurrencesSlider.Value;
            }

            // Until
            // Note: Until and Occurrences properties are mutually exclusive.
            if (UntilRadioButton.IsChecked.Value)
            {
                recurrence.Until = UntilDatePicker.Date;
            }

            // Interval
            recurrence.Interval = (uint)IntervalSlider.Value;

            // Week of the month
            switch (WeekOfMonthComboBox.SelectedIndex)
            {
                case 0:
                    recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.First;
                    break;
                case 1:
                    recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Second;
                    break;
                case 2:
                    recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Third;
                    break;
                case 3:
                    recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Fourth;
                    break;
                case 4:
                    recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Last;
                    break;
            }

            // Days of the Week
            // Note: For Weekly, MonthlyOnDay or YearlyOnDay recurrence unit values, at least one day must be specified.
            if (SundayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Sunday; }
            if (MondayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Monday; }
            if (TuesdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Tuesday; }
            if (WednesdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Wednesday; }
            if (ThursdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Thursday; }
            if (FridayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Friday; }
            if (SaturdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Saturday; }

            if (((recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Weekly) ||
                 (recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.MonthlyOnDay) ||
                 (recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.YearlyOnDay)) &&
                (recurrence.DaysOfWeek == Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.None))
            {
                errorMessage = "The recurrence specified is invalid. For Weekly, MonthlyOnDay or YearlyOnDay recurrence unit values, at least one day must be specified.";
            }

            // Month of the year
            recurrence.Month = (uint)MonthSlider.Value;

            // Day of the month
            recurrence.Day = (uint)DaySlider.Value;

            if (errorMessage == null)
            {
                rootPage.NotifyUser("The recurrence specified was created successfully and is valid.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario6_Recurrence.xaml.cs.

The documentation for this class was generated from the following file:
  • Appointments/cs/Scenario6_Recurrence.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ScrollIntoView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_ScrollIntoView
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_ScrollIntoView Class Reference

List of all members.

Public Member Functions

Scenario6_ScrollIntoView ()

Private Member Functions

void | Scroll_Click (object sender, RoutedEventArgs e)

Private Attributes

ObservableCollection< Item > | _items = Item.GetItems(1000)

Detailed Description

Definition at line 19 of file Scenario6_ScrollIntoView.xaml.cs.

Constructor & Destructor Documentation

Scenario6_ScrollIntoView ( ) [inline]

Definition at line 23 of file Scenario6_ScrollIntoView.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void Scroll_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario6_ScrollIntoView.xaml.cs.

        {
            int numVal;
            if (Int32.TryParse(scrollId.Text, out numVal) && numVal >= 0 && numVal < ItemsListView.Items.Count)
            {
                var item = (ComboBoxItem)ScrollAlignment.SelectedItem;
                var Alignment = (ScrollIntoViewAlignment)item.Tag;
                ItemsListView.ScrollIntoView(ItemsListView.Items[numVal], Alignment);
                scrollId.BorderBrush = ValidFormatBrush;
            }
            else
            {
                scrollId.BorderBrush = InvalidFormatBrush;
            }
        }

Member Data Documentation

ObservableCollection<Item> _items = Item.GetItems(1000) [private]

Definition at line 21 of file Scenario6_ScrollIntoView.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlListView/cs/Scenario6_ScrollIntoView.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_SecondaryTileNotification Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_SecondaryTileNotification
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_SecondaryTileNotification Class Reference

List of all members.

Public Member Functions

Scenario6_SecondaryTileNotification ()

Private Member Functions

async void | PinLiveTile_Click (object sender, RoutedEventArgs e)
void | SendBadgeNotification_Click (object sender, RoutedEventArgs e)
void | SendBadgeNotificationWithStringManipulation_Click (object sender, RoutedEventArgs e)
void | SendTileNotification_Click (object sender, RoutedEventArgs e)
void | SendTileNotificationWithStringManipulation_Click (object sender, RoutedEventArgs e)
bool | VerifyTileIsPinned ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 22 of file Scenario6_SecondaryTileNotification.xaml.cs.

Constructor & Destructor Documentation

Scenario6_SecondaryTileNotification ( ) [inline]

Definition at line 26 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void PinLiveTile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            // Prepare the images for our tile to be pinned.
            Uri square150x150Logo = new Uri("ms-appx:///Assets/square150x150Tile-sdk.png");
            Uri wide310x150Logo = new Uri("ms-appx:///Assets/wide310x150Tile-sdk.png");

            // During creation of the secondary tile, an application may set additional arguments on the tile that will be passed in during activation.
            // These arguments should be meaningful to the application. In this sample, we'll pass in the date and time the secondary tile was pinned.
            string tileActivationArguments = MainPage.dynamicTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();

            // Create a Secondary tile with all the required properties and sets perfered size to Wide310x150.
            SecondaryTile secondaryTile = new SecondaryTile(MainPage.dynamicTileId,
                                                            "A Live Secondary Tile",
                                                            tileActivationArguments,
                                                            square150x150Logo,
                                                            TileSize.Wide310x150);

            // Adding the wide tile logo.
            secondaryTile.VisualElements.Wide310x150Logo = wide310x150Logo;

            // The display of the app name can be controlled for each tile size.
            secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;
            secondaryTile.VisualElements.ShowNameOnWide310x150Logo = true;

            // Specify a foreground text value.
            // The tile background color is inherited from the parent unless a separate value is specified.
            secondaryTile.VisualElements.ForegroundText = ForegroundText.Dark;

            // OK, the tile is created and we can now attempt to pin the tile.
            // Note that the status message is updated when the async operation to pin the tile completes.
            bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Below);
            if (isPinned)
            {
                rootPage.NotifyUser("Secondary tile successfully pinned.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("Secondary tile not pinned.", NotifyType.ErrorMessage);
            }
        }

void SendBadgeNotification_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            if (VerifyTileIsPinned())
            {
                BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(6);

                // Send the notification to the secondary tile
                BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(new BadgeNotification(badgeContent.GetXml()));

                rootPage.NotifyUser("Badge notification sent to " + MainPage.dynamicTileId, NotifyType.StatusMessage);
            }
        }

void SendBadgeNotificationWithStringManipulation_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 148 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            if (VerifyTileIsPinned())
            {
                string badgeXmlString = "<badge value='9'/>";
                var badgeDOM = new Windows.Data.Xml.Dom.XmlDocument();
                badgeDOM.LoadXml(badgeXmlString);
                BadgeNotification badge = new BadgeNotification(badgeDOM);

                // Send the notification to the secondary tile
                BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(badge);

                rootPage.NotifyUser("Badge notification sent to " + MainPage.dynamicTileId, NotifyType.StatusMessage);
            }
        }

void SendTileNotification_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 82 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            if (VerifyTileIsPinned())
            {
                var tileContent = new TileContent
                {
                    Visual = new TileVisual
                    {
                        TileWide = new TileBinding
                        {
                            Content = new TileBindingContentAdaptive
                            {
                                Children =
                                    {
                                        new AdaptiveText{ Text = "Sent to a secondary tile from NotificationsExtensions!", HintWrap = true },
                                    }
                            }
                        }
                    }
                };
                // Send the notification to the secondary tile by creating a secondary tile updater
                TileUpdateManager.CreateTileUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(new TileNotification(tileContent.GetXml()));

                rootPage.NotifyUser("Tile notification sent to " + MainPage.dynamicTileId, NotifyType.StatusMessage);
            }
        }

void SendTileNotificationWithStringManipulation_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 122 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            if (VerifyTileIsPinned())
            {
                string tileXmlString = "<tile>"
                                 + "<visual version='2'>"
                                 + "<binding template='TileWide310x150Text04' fallback='TileWideText04'>"
                                 + "<text id='1'>Send to a secondary tile from strings</text>"
                                 + "</binding>"
                                 + "<binding template='TileSquare150x150Text04' fallback='TileSquareText04'>"
                                 + "<text id='1'>Send to a secondary tile from strings</text>"
                                 + "</binding>"
                                 + "</visual>"
                                 + "</tile>";

                var tileDOM = new Windows.Data.Xml.Dom.XmlDocument();
                tileDOM.LoadXml(tileXmlString);
                TileNotification tile = new TileNotification(tileDOM);

                // Send the notification to the secondary tile by creating a secondary tile updater
                TileUpdateManager.CreateTileUpdaterForSecondaryTile(MainPage.dynamicTileId).Update(tile);

                rootPage.NotifyUser("Tile notification sent to " + MainPage.dynamicTileId, NotifyType.StatusMessage);
            }
        }

bool VerifyTileIsPinned ( ) [inline, private]

Definition at line 31 of file Scenario6_SecondaryTileNotification.xaml.cs.

        {
            if (SecondaryTile.Exists(MainPage.dynamicTileId))
            {
                return true;
            }
            rootPage.NotifyUser(MainPage.dynamicTileId + " is not pinned.", NotifyType.ErrorMessage);
            return false;
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 24 of file Scenario6_SecondaryTileNotification.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario6_SecondaryTileNotification.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_TimeZone Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario6_TimeZone
Public Member Functions | Private Member Functions

Scenario6_TimeZone Class Reference

List of all members.

Public Member Functions

Scenario6_TimeZone ()

Private Member Functions

void Display ()

Detailed Description

Definition at line 24 of file Scenario6_TimeZone.xaml.cs.

Constructor & Destructor Documentation

Scenario6_TimeZone ( ) [inline]

Definition at line 26 of file Scenario6_TimeZone.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display ( ) [inline, private]

This is the click handler for the 'Display' button.

Definition at line 34 of file Scenario6_TimeZone.xaml.cs.

        {
            // This scenario illustrates time zone support in DateTimeFormatter class

            // Displayed time zones (other than local time zone)
            String[] timeZones = new String[] { "UTC", "America/New_York", "Asia/Kolkata" };

            // Store results here.
            StringBuilder results = new StringBuilder();

            // Create formatter object using longdate and longtime template
            DateTimeFormatter formatter = new DateTimeFormatter("longdate longtime");

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // Show current time.
            results.AppendLine("Current date and time");
            results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Show a time on 14th day of second month of next year.
            // Note the effect of daylight saving on the results.
            results.AppendLine("Same time on 14th day of second month of next year");
            dateTime = new DateTime(dateTime.Year + 1, 2, 14, dateTime.Hour, dateTime.Minute, dateTime.Second);
            results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Show a time on 14th day of tenth month of next year.
            // Note the effect of daylight saving on the results.
            results.AppendLine("Same time on 14th day of tenth month of next year");
            dateTime = dateTime.AddMonths(8);
            results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • DateTimeFormatting/cs/Scenario6_TimeZone.xaml.cs
  • DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario7 ()
Scenario7 ()
Scenario7 ()
Scenario7 ()
Scenario7 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddToListButton_Click (object sender, RoutedEventArgs e)
bool | ArePointsNear (Point point1, Point point2, double threshold)
void | BindMediaPlayerToUIElement (MediaPlayer mediaPlayer, UIElement uiElement)
List< Cluster > | BuildClustersForZoomLevel (int zoomLevel)
PlaceLocation | CalculateCenter (IList< PlaceInfo > places)
List< Cluster > | GetClustersForZoomLevel (int zoomLevel)
void | InkToolbar_IsStencilButtonCheckedChanged (InkToolbar sender, InkToolbarIsStencilButtonCheckedChangedEventArgs args)
async Task | LoadPlaceInfoAsync ()
void | mediaPlayerButton_Click (object sender, RoutedEventArgs e)
async void | myMap_Loaded (object sender, RoutedEventArgs e)
void | myMap_ZoomLevelChanged (MapControl sender, object args)
void | OnBringIntoView (object sender, RoutedEventArgs e)
async void | OpenFromListButton_Click (object sender, RoutedEventArgs e)
async void | pickFileButton_Click (object sender, RoutedEventArgs e)
void | refreshMapIcons ()
void | Scenario7Button_Show_Click (object sender, RoutedEventArgs e)
void | Scenario8_Loaded (object sender, RoutedEventArgs e)
void | ShowListButton_Click (object sender, RoutedEventArgs e)

Private Attributes

Dictionary< int, List< Cluster > > | clustersForZoomLevel = new Dictionary<int, List<Cluster>>()
ResourceContext | defaultContextForCurrentView
const int | FA_E_MAX_PERSISTED_ITEMS_REACHED = unchecked((int)0x80270220)
MediaPlayer | mediaPlayer
RandomAccessStreamReference[] | numberIconReferences = new RandomAccessStreamReference[8]
List< PlaceInfo > | places = new List<PlaceInfo>()
int | previousZoomLevel = 0
MainPage rootPage = MainPage.Current

Detailed Description

Demonstrates basic rendering of a MediaPlayer to a Composition surface.

This scenario demonstrates how to work with InkPresenterStencil objects in a ScrollViewer.

Persisting access to a storage item for future use.

-- Repositioning the InkPresenterStencil on demand -- Integrating a custom button with stencil functionality alongside the InkToolbar

This is a copy of scenario 1, but with UI Composition techniques.

Not shown in this sample are re-sizing a button to the video size, nor resizing video to button size, nor resizing operations as the UI changes.

Definition at line 23 of file scenario7.xaml.cs.

Constructor & Destructor Documentation

Scenario7 ( ) [inline]

Definition at line 33 of file scenario7.xaml.cs.

        {
            this.InitializeComponent();
            defaultContextForCurrentView = ResourceContext.GetForCurrentView();
        }

Scenario7 ( ) [inline]

Definition at line 33 of file Scenario7_FutureAccess.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario7 ( ) [inline]

Definition at line 77 of file Scenario7.xaml.cs.

        {
            InitializeComponent();

            // Prepare the custom icons we use to represent clusters of various sizes.
            for (int i = 2; i <= 9; i++)
            {
                numberIconReferences[i - 2] = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Numbers/" + i.ToString() + ".png"));
            }
        }

Scenario7 ( ) [inline]

Definition at line 28 of file Scenario7.xaml.cs.

        {
            this.InitializeComponent();

            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;

            // Customize the ruler
            var ruler = new InkPresenterRuler(inkCanvas.InkPresenter);
            ruler.BackgroundColor = Windows.UI.Colors.PaleTurquoise;
            ruler.ForegroundColor = Windows.UI.Colors.MidnightBlue;
            ruler.Length = 800;
            ruler.AreTickMarksVisible = false;
            ruler.IsCompassVisible = false;

            // Customize the protractor
            var protractor = new InkPresenterProtractor(inkCanvas.InkPresenter);
            protractor.BackgroundColor = Windows.UI.Colors.Bisque;
            protractor.ForegroundColor = Windows.UI.Colors.DarkGreen;
            protractor.AccentColor = Windows.UI.Colors.Firebrick;
            protractor.AreRaysVisible = false;
            protractor.AreTickMarksVisible = false;
            protractor.IsAngleReadoutVisible = false;
            protractor.IsCenterMarkerVisible = false;
        }

Scenario7 ( ) [inline]

Definition at line 39 of file Scenario7_VideoComposition.xaml.cs.

        {
            this.InitializeComponent();
            Loaded += Scenario8_Loaded;
        }

Member Function Documentation

void AddToListButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario7_FutureAccess.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                if (MRURadioButton.IsChecked.Value)
                {
                    // Add the file to app MRU and possibly system MRU
                    RecentStorageItemVisibility visibility = SystemMRUCheckBox.IsChecked.Value ? RecentStorageItemVisibility.AppAndSystem : RecentStorageItemVisibility.AppOnly;
                    rootPage.mruToken = StorageApplicationPermissions.MostRecentlyUsedList.Add(file, file.Name, visibility);
                    rootPage.NotifyUser($"The file '{file.Name}' was added to the MRU list and a token was stored.", NotifyType.StatusMessage);
                }
                else
                {
                    try
                    {
                        rootPage.falToken = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
                        rootPage.NotifyUser($"The file '{file.Name}' was added to the FAL list and a token was stored.", NotifyType.StatusMessage);
                    }
                    catch (Exception ex) when (ex.HResult == FA_E_MAX_PERSISTED_ITEMS_REACHED)
                    {
                        // A real program would call Remove() to create room in the FAL.
                        rootPage.NotifyUser($"The file '{file.Name}' was not added to the FAL list because the FAL list is full.", NotifyType.ErrorMessage);
                    }
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

bool ArePointsNear | ( | Point | point1,
 |  | Point | point2,
 |  | double | threshold |
 | ) |  |  | [inline, private]

Definition at line 214 of file Scenario7.xaml.cs.

        {
            double dx = point1.X - point2.X;
            double dy = point1.Y - point2.Y;
            double distanceSquared = dx * dx + dy * dy;
            return distanceSquared < threshold * threshold;
        }

void BindMediaPlayerToUIElement | ( | MediaPlayer | mediaPlayer,
 |  | UIElement | uiElement |
 | ) |  |  | [inline, private]

Definition at line 73 of file Scenario7_VideoComposition.xaml.cs.

        {
            // Get the backing composition visual for the passed in UIElement
            Visual hostVisual = ElementCompositionPreview.GetElementVisual(uiElement);

            // Get the compositor the visual belongs to
            Compositor compositor = hostVisual.Compositor;

            // Create a new container and make it a child of the element
            ContainerVisual container = compositor.CreateContainerVisual();
            ElementCompositionPreview.SetElementChildVisual(uiElement, container);

            // Add a new sprite visual to paint the player onto
            var playerVisual = compositor.CreateSpriteVisual();
            playerVisual.Size = uiElement.RenderSize.ToVector2();
            container.Children.InsertAtTop(playerVisual);

            // Get the player's surface
            var mediaSurface = mediaPlayer.GetSurface(compositor);
            var compositionSurface = mediaSurface.CompositionSurface;

            // Convert the surface to a brush used to paint the visual
            playerVisual.Brush = compositor.CreateSurfaceBrush(compositionSurface);
        }

std::vector< Cluster > BuildClustersForZoomLevel ( int zoomLevel ) [inline, private]

Definition at line 176 of file Scenario7.xaml.cs.

        {
            // For a particular zoom level, the map is 2^(zoomLevel + 8) pixels wide.
            // See https://msdn.microsoft.com/en-us/library/bb259689.aspx for more information.
            double scale = Math.Pow(2, zoomLevel + 8);

            // Say that each cluster covers a 100-pixel radius.
            const double clusterRadius = 100.0;

            double scaledclusterRadius = clusterRadius / scale;

            List<Cluster> clusters = new List<Cluster>();
            foreach (PlaceInfo place in places)
            {
                // Look for a cluster that is close to this place. If there is more than one,
                // we pick the first one arbitrarily.
                Cluster cluster = clusters.Where(c => ArePointsNear(place.Location.MapCoordinates, c.Location.MapCoordinates, scaledclusterRadius)).FirstOrDefault();

                if (cluster == null)
                {
                    // No such cluster exists yet. Make one.
                    cluster = new Cluster() { Location = place.Location };
                    clusters.Add(cluster);
                }
                // Add the place to that cluster.
                cluster.Places.Add(place);
            }

            // Update the Location of each cluster to the center of all the places within it.
            foreach (var cluster in clusters)
            {
                cluster.Location = CalculateCenter(cluster.Places);
            }

            return clusters;
        }

PlaceLocation CalculateCenter ( IList< PlaceInfo > places ) [inline, private]

Definition at line 224 of file Scenario7.xaml.cs.

        {
            double totalLatitude = 0.0;
            double totalLongitude = 0.0;

            foreach (PlaceInfo place in places)
            {
                totalLatitude += place.Location.Geoposition.Latitude;
                totalLongitude += place.Location.Geoposition.Longitude;
            }

            return new PlaceLocation(totalLatitude / places.Count, totalLongitude / places.Count);
        }

const std::vector< Cluster > & GetClustersForZoomLevel ( int zoomLevel ) [inline, private]

Definition at line 161 of file Scenario7.xaml.cs.

        {
            // See if we have built the clusters for this zoom level already.
            List<Cluster> clusters;
            if (!clustersForZoomLevel.TryGetValue(zoomLevel, out clusters))
            {
                // No. Go build them, and then cache it for next time.
                clusters = BuildClustersForZoomLevel(zoomLevel);
                clustersForZoomLevel[zoomLevel] = clusters;
            }
            return clusters;
        }

void InkToolbar_IsStencilButtonCheckedChanged | ( | InkToolbar | sender,
 |  | InkToolbarIsStencilButtonCheckedChangedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario7.xaml.cs.

        {
            var stencilButton = (InkToolbarStencilButton)inkToolbar.GetMenuButton(InkToolbarMenuKind.Stencil);
            BringIntoViewButton.IsEnabled = stencilButton.IsChecked.Value;
        }

task< void > LoadPlaceInfoAsync ( ) [inline, private]

Definition at line 88 of file Scenario7.xaml.cs.

        {
            Uri dataUri = new Uri("ms-appx:///places.txt");

            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
            IList<string> lines = await FileIO.ReadLinesAsync(file);

            // In the places.txt file, each place is represented by three lines:
            // Place name, latitude, and longitude.
            for (int i = 0; i < lines.Count; i += 3)
            {
                PlaceInfo place = new PlaceInfo
                {
                    Name = lines[i],
                    Location = new PlaceLocation(double.Parse(lines[i + 1]), double.Parse(lines[i + 2]))
                };

                places.Add(place);
            }
        }

void mediaPlayerButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario7_VideoComposition.xaml.cs.

        {
            if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
                mediaPlayer.Pause();
            else if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
                mediaPlayer.Play();
        }

async void myMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 109 of file Scenario7.xaml.cs.

        {
            await LoadPlaceInfoAsync();

            // Zoom in to the level that shows all our points of interest.
            GeoboundingBox boundingBox = GeoboundingBox.TryCompute(places.Select(place => place.Location.Geoposition));
            await myMap.TrySetViewBoundsAsync(boundingBox, null, MapAnimationKind.None);

            refreshMapIcons();
        }

void myMap_ZoomLevelChanged | ( | MapControl | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario7.xaml.cs.

        {
            int intZoomLevel = (int)myMap.ZoomLevel;
            if (previousZoomLevel != intZoomLevel)
            {
                previousZoomLevel = intZoomLevel;
                refreshMapIcons();
            }
        }

void OnBringIntoView | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario7.xaml.cs.

        {
            // Set stencil origin to Scrollviewer Viewport origin.
            // The purpose of this behavior is to allow the user to "grab" the
            // stencil and bring it into view no matter where the scrollviewer viewport
            // happens to be.  Note that this is accomplished by a simple translation
            // that adjusts to the zoom factor.  The additional ZoomFactor term is to
            // ensure the scale of the InkPresenterStencil is invariant to Zoom.
            Matrix3x2 viewportTransform =
                Matrix3x2.CreateScale(ScrollViewer.ZoomFactor) *
                Matrix3x2.CreateTranslation(
                   (float)ScrollViewer.HorizontalOffset,
                   (float)ScrollViewer.VerticalOffset) *
                Matrix3x2.CreateScale(1.0f / ScrollViewer.ZoomFactor);

            var stencilButton = (InkToolbarStencilButton)inkToolbar.GetMenuButton(InkToolbarMenuKind.Stencil);
            switch (stencilButton.SelectedStencil)
            {
                case InkToolbarStencilKind.Protractor:
                    stencilButton.Protractor.Transform = viewportTransform;
                    break;

                case InkToolbarStencilKind.Ruler:
                    stencilButton.Ruler.Transform = viewportTransform;
                    break;
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 56 of file Scenario7_VideoComposition.xaml.cs.

        {
            // Dispose the media player so it doesn't continue to play audio
            // after the page is unloaded
            mediaPlayer.Dispose();

            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario7_FutureAccess.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario7.xaml.cs.

        {
            // Make the ink canvas larger than the window, so that we can demonstrate
            // scrolling and zooming.
            inkCanvas.Width = Window.Current.Bounds.Width * 2;
            inkCanvas.Height = Window.Current.Bounds.Height * 2;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file scenario7.xaml.cs.

        {
            this.Scenario7TextBlock.Text = "";
        }

async void OpenFromListButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 107 of file Scenario7_FutureAccess.xaml.cs.

        {
            StorageFile file = null;

            if (MRURadioButton.IsChecked.Value)
            {
                if (rootPage.mruToken != null)
                {
                    // When the MRU becomes full, older entries are automatically deleted, so check if the
                    // token is still valid before using it.
                    if (StorageApplicationPermissions.MostRecentlyUsedList.ContainsItem(rootPage.mruToken))
                    {
                        // Open the file via the token that was stored when adding this file into the MRU list
                        file = await StorageApplicationPermissions.MostRecentlyUsedList.GetFileAsync(rootPage.mruToken);
                    }
                    else
                    {
                        rootPage.NotifyUser("The token is no longer valid.", NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("This operation requires a token. Add file to the MRU list first.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                if (rootPage.falToken != null)
                {
                    // Open the file via the token that was stored when adding this file into the FAL list.
                    // The token remains valid until we explicitly remove it.
                    file = await StorageApplicationPermissions.FutureAccessList.GetFileAsync(rootPage.falToken);
                }
                else
                {
                    rootPage.NotifyUser("This operation requires a token. Add file to the FAL list first.", NotifyType.ErrorMessage);
                }
            }

            if (file != null)
            {
                try
                {
                    // Read the file
                    string fileContent = await FileIO.ReadTextAsync(file);
                    rootPage.NotifyUser($"The file '{file.Name}' was opened by a stored token. It contains the following text:\b{fileContent}", NotifyType.StatusMessage);

                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error reading file opened from list: {ex.Message}", NotifyType.ErrorMessage);
                }
            }
        }

async void pickFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handles the pick file button click event to load a video.

Definition at line 101 of file Scenario7_VideoComposition.xaml.cs.

        {
            // Clear previous returned file name, if it exists, between iterations of this scenario
            rootPage.NotifyUser("", NotifyType.StatusMessage);

            // Create and open the file picker
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
            openPicker.FileTypeFilter.Add(".mp4");
            openPicker.FileTypeFilter.Add(".mkv");
            openPicker.FileTypeFilter.Add(".avi");

            StorageFile file = await openPicker.PickSingleFileAsync();
            if (file != null)
            {
                rootPage.NotifyUser("Picked video: " + file.Name, NotifyType.StatusMessage);
                mediaPlayer.Source = MediaSource.CreateFromStorageFile(file);
                mediaPlayer.Play();
            }
            else
            {
                rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);
            }
        }

void refreshMapIcons ( ) [inline, private]

Definition at line 130 of file Scenario7.xaml.cs.

        {
            // Erase the old map icons.
            myMap.MapElements.Clear();

            // Create an icon for each cluster.
            foreach (var cluster in GetClustersForZoomLevel(previousZoomLevel))
            {
                MapIcon mapIcon = new MapIcon
                {
                    Location = new Geopoint(cluster.Location.Geoposition),
                    CollisionBehaviorDesired = MapElementCollisionBehavior.RemainVisible,
                };

                if (cluster.Places.Count > 1)
                {
                    // The cluster represents more than one place. Use a custom marker that shows
                    // how many places are represented by this cluster, and place the marker
                    // centered at the cluster.
                    mapIcon.Image = numberIconReferences[Math.Min(cluster.Places.Count, 9) - 2];
                    mapIcon.NormalizedAnchorPoint = new Point(0.5, 0.5);
                }
                else
                {
                    // The cluster represents a single place. Label the cluster with the place name.
                    mapIcon.Title = cluster.Places[0].Name;
                }
                myMap.MapElements.Add(mapIcon);
            }
        }

void Scenario7Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario7Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 55 of file scenario7.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {

                this.Scenario7TextBlock.Text = ResourceManager.Current.MainResourceMap.GetValue("Resources/string1", defaultContextForCurrentView).ValueAsString;

                defaultContextForCurrentView.QualifierValues.MapChanged += async (s, m) =>
                {
                    await this.Scenario7TextBlock.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        this.Scenario7TextBlock.Text = ResourceManager.Current.MainResourceMap.GetValue("Resources/string1", defaultContextForCurrentView).ValueAsString;
                    });
                };
            }
        }

void Scenario8_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario7_VideoComposition.xaml.cs.

        {
            mediaPlayer = new MediaPlayer();
            mediaPlayer.Source = MediaSource.CreateFromUri(rootPage.CaptionedMediaUri);
            mediaPlayer.Play();

            // Bind to the element in the Loaded event after the layout
            // pass has run and sized elements
            BindMediaPlayerToUIElement(mediaPlayer, mediaPlayerButton);
        }

void ShowListButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario7_FutureAccess.xaml.cs.

        {
            AccessListEntryView entries;
            string listName;
            if (MRURadioButton.IsChecked.Value)
            {
                listName = "MRU";
                entries = StorageApplicationPermissions.MostRecentlyUsedList.Entries;
            }
            else
            {
                listName = "FAL";
                entries = StorageApplicationPermissions.FutureAccessList.Entries;
            }

            if (entries.Count > 0)
            {
                StringBuilder outputText = new StringBuilder($"The {listName} list contains the following item(s):");
                foreach (AccessListEntry entry in entries)
                {
                    outputText.AppendLine();
                    outputText.Append(entry.Metadata); // Application previously chose to store file.Name in this field
                }

                rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser($"The {listName} list is empty.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

Dictionary<int, List<Cluster> > clustersForZoomLevel = new Dictionary<int, List<Cluster>>() [private]

Definition at line 73 of file Scenario7.xaml.cs.

ResourceContext defaultContextForCurrentView [private]

Definition at line 30 of file scenario7.xaml.cs.

const int FA_E_MAX_PERSISTED_ITEMS_REACHED = unchecked((int)0x80270220) [private]

Definition at line 31 of file Scenario7_FutureAccess.xaml.cs.

MediaPlayer mediaPlayer [private]

Definition at line 37 of file Scenario7_VideoComposition.xaml.cs.

RandomAccessStreamReference [] numberIconReferences = new RandomAccessStreamReference[8] [private]

Definition at line 71 of file Scenario7.xaml.cs.

List<PlaceInfo> places = new List<PlaceInfo>() [private]

Definition at line 72 of file Scenario7.xaml.cs.

int previousZoomLevel = 0 [private]

Definition at line 75 of file Scenario7.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file scenario7.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario7.xaml.cs
  • FileAccess/cs/Scenario7_FutureAccess.xaml.cs
  • MapControl/cs/Scenario7.xaml.cs
  • VideoPlayback/cs/Scenario7_VideoComposition.xaml.cs
  • SimpleInk/cs/Scenario7.xaml.cs
  • ApplicationResources/cpp/scenario7.xaml.cpp
  • FileAccess/cpp/Scenario7_FutureAccess.xaml.cpp
  • MapControl/cpp/Scenario7.xaml.cpp
  • SimpleInk/cpp/Scenario7.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_B2B Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_B2B
Public Member Functions | Private Member Functions | Private Attributes

Scenario7_B2B Class Reference

For more details on the business to business APIs, see: https://msdn.microsoft.com/en-us/library/windows/apps/mt609002.aspx. More...

List of all members.

Public Member Functions

Scenario7_B2B ()

Private Member Functions

async void | GetCustomerCollectionsId ()
async void | GetCustomerPurchaseId ()
async Task< string > | GetTokenFromAzureOAuthAsync ()

Private Attributes

readonly string | appIdUri = "https://contoso.onmicrosoft.com"
readonly string | clientId = "00000000-0000-0000-0000-000000000000"
readonly string | clientSecret = "00000000000000000000000000000000000000000000"
MainPage rootPage = MainPage.Current
StoreContext | storeContext = StoreContext.GetDefault()
readonly string | tenantId = "00000000-0000-0000-0000-000000000000"

Detailed Description

Definition at line 27 of file Scenario7_B2B.xaml.cs.

Constructor & Destructor Documentation

Scenario7_B2B ( ) [inline]

Definition at line 40 of file Scenario7_B2B.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void GetCustomerCollectionsId ( ) [inline, private]

Definition at line 45 of file Scenario7_B2B.xaml.cs.

        {
            string aadToken = await GetTokenFromAzureOAuthAsync();
            if (!String.IsNullOrEmpty(aadToken))
            {
                string id = await storeContext.GetCustomerCollectionsIdAsync(aadToken, "kim@example.com");
                Output.Text = id;
                if (String.IsNullOrEmpty(id))
                {
                    rootPage.NotifyUser("GetCustomerCollectionsIdAsync failed.", NotifyType.ErrorMessage);
                }
            }
        }

async void GetCustomerPurchaseId ( ) [inline, private]

Definition at line 59 of file Scenario7_B2B.xaml.cs.

        {
            String aadToken = await GetTokenFromAzureOAuthAsync();
            if (!String.IsNullOrEmpty(aadToken))
            {
                string id = await storeContext.GetCustomerPurchaseIdAsync(aadToken, "kim@example.com");
                Output.Text = id;
                if (String.IsNullOrEmpty(id))
                {
                    rootPage.NotifyUser("GetCustomerPurchaseIdAsync failed.", NotifyType.ErrorMessage);
                }
            }
        }

task< String^> GetTokenFromAzureOAuthAsync ( ) [inline, private]

Definition at line 73 of file Scenario7_B2B.xaml.cs.

        {
            var content = new HttpFormUrlEncodedContent(new Dictionary<string, string>
            {
                { "grant_type", "client_credentials" },
                { "client_id", clientId },
                { "client_secret", clientSecret },
                { "resource", appIdUri },
            });
            content.Headers.ContentType = new HttpMediaTypeHeaderValue("application/x-www-form-urlencoded");
            try
            {
                HttpClient client = new HttpClient();
                HttpResponseMessage result = await client.PostAsync(
                    new Uri($"https://login.microsoftonline.com/{tenantId}/oauth2/token"), content);

                string responseString = await result.Content.ReadAsStringAsync();
                JsonValue response = JsonValue.Parse(responseString);

                return response.GetObject().GetNamedString("access_token");
            }
            catch (Exception ex)
            {
                // Networking errors in PostAsync are reported as exceptions.
                // JSON parsing errors are also reported as exceptions.
                Output.Text = $"Failed to load Azure OAuth Token: {ex}";
                return String.Empty;
            }
        }

Member Data Documentation

readonly string appIdUri = "https://contoso.onmicrosoft.com" [private]

Definition at line 38 of file Scenario7_B2B.xaml.cs.

readonly string clientId = "00000000-0000-0000-0000-000000000000" [private]

Definition at line 36 of file Scenario7_B2B.xaml.cs.

readonly string clientSecret = "00000000000000000000000000000000000000000000" [private]

Definition at line 37 of file Scenario7_B2B.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario7_B2B.xaml.cs.

StoreContext storeContext = StoreContext.GetDefault() [private]

Definition at line 30 of file Scenario7_B2B.xaml.cs.

readonly string tenantId = "00000000-0000-0000-0000-000000000000" [private]

Definition at line 35 of file Scenario7_B2B.xaml.cs.

The documentation for this class was generated from the following files:
  • Store/cs/Scenario7_B2B.xaml.cs
  • Store/cpp/Scenario7_B2B.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_DeviceInformationKind Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_DeviceInformationKind
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_DeviceInformationKind Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7_DeviceInformationKind ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnDeviceListChanged (DeviceWatcher sender, string id)
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StartWatchers ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatchers (bool reset=false)

Private Attributes

List< DeviceWatcherHelper > | deviceWatcherHelpers = new List<DeviceWatcherHelper>()
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 20 of file Scenario7_DeviceInformationKind.xaml.cs.

Constructor & Destructor Documentation

Scenario7_DeviceInformationKind ( ) [inline]

Definition at line 28 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnDeviceListChanged | ( | DeviceWatcher | sender,
 |  | string | id |
 | ) |  |  | [inline, private]

Definition at line 99 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            int watchersRunning = 0;

            // Count running watchers
            foreach (DeviceWatcherHelper deviceWatcherHelper in deviceWatcherHelpers)
            {
                if (deviceWatcherHelper.IsWatcherRunning())
                {
                    watchersRunning++;
                }
            }

            string message = $"{watchersRunning}/{deviceWatcherHelpers.Count} watchers running. {resultCollection.Count} devices found.";
            rootPage.NotifyUser(message, NotifyType.StatusMessage);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            StopWatchers(/* reset */ true);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;

            kindComboBox.ItemsSource = DeviceInformationKindChoices.Choices;
            kindComboBox.SelectedIndex = 0;
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 46 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            StartWatchers();
        }

void StartWatchers ( ) [inline, private]

Definition at line 56 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            startWatcherButton.IsEnabled = false;
            resultCollection.Clear();

            // Create a watcher for each DeviceInformationKind selected by the user
            foreach (DeviceInformationKind deviceInfoKind in ((DeviceInformationKindChoice)kindComboBox.SelectedItem).DeviceInformationKinds)
            {
                DeviceWatcher deviceWatcher = DeviceInformation.CreateWatcher(
                        "", // AQS Filter string
                        null, // requested properties
                        deviceInfoKind);

                DeviceWatcherHelper deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
                deviceWatcherHelper.UpdateStatus = false; // we will show our own status messages
                deviceWatcherHelper.DeviceChanged += OnDeviceListChanged;
                deviceWatcherHelpers.Add(deviceWatcherHelper);

                deviceWatcherHelper.StartWatcher(deviceWatcher);
            }

            stopWatcherButton.IsEnabled = true;
            stopWatcherButton.Focus(FocusState.Keyboard);
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 51 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            StopWatchers();
        }

void StopWatchers ( bool reset = false ) [inline, private]

Definition at line 81 of file Scenario7_DeviceInformationKind.xaml.cs.

        {
            stopWatcherButton.IsEnabled = false;

            foreach (DeviceWatcherHelper deviceWatcherHelper in deviceWatcherHelpers)
            {
                deviceWatcherHelper.StopWatcher();
                if (reset)
                {
                    deviceWatcherHelper.Reset();
                }
            }
            deviceWatcherHelpers.Clear();

            startWatcherButton.IsEnabled = true;
            startWatcherButton.Focus(FocusState.Keyboard);
        }

Member Data Documentation

List<DeviceWatcherHelper> deviceWatcherHelpers = new List<DeviceWatcherHelper>() [private]

Definition at line 24 of file Scenario7_DeviceInformationKind.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 26 of file Scenario7_DeviceInformationKind.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 22 of file Scenario7_DeviceInformationKind.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario7_DeviceInformationKind.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_DownloadReordering Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_DownloadReordering
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario7_DownloadReordering Class Reference

List of all members.

Public Member Functions

Scenario7_DownloadReordering ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< DownloadOperationItem > 		downloadCollection [get]

Private Member Functions

async Task | CancelActiveDownloadsAsync ()
async Task< DownloadOperation > | CreateDownload (BackgroundDownloader downloader, string remoteAddress, string fileName)
async Task | DownloadAsync (DownloadOperationItem item)
void | DownloadProgress (DownloadOperationItem item)
bool | IsWebException (string title, Exception ex, DownloadOperation download=null)
void | MakeCurrent_Click (object sender, RoutedEventArgs e)
async Task | RunDownloadsAsync ()
async void | StartDownload_Click (object sender, RoutedEventArgs e)

Private Attributes

const int | NumDownloads = 5
BackgroundTransferGroup | reorderGroup
MainPage rootPage

Detailed Description

Definition at line 89 of file Scenario7_DownloadReordering.xaml.cs.

Constructor & Destructor Documentation

Scenario7_DownloadReordering ( ) [inline]

Definition at line 98 of file Scenario7_DownloadReordering.xaml.cs.

        {
            reorderGroup = BackgroundTransferGroup.CreateGroup("{7421B969-18D4-4532-B6BD-22BDABF71C08}");
            reorderGroup.TransferBehavior = BackgroundTransferBehavior.Serialized;
            this.DataContext = this;
            this.InitializeComponent();
        }

Member Function Documentation

task< std::vector< DownloadOperation^> > CancelActiveDownloadsAsync ( ) [inline, private]

Definition at line 112 of file Scenario7_DownloadReordering.xaml.cs.

        {
            // Only the downloads that belong to the transfer group used by this sample scenario
            // will be canceled.
            IReadOnlyList<DownloadOperation> downloads = null;
            try
            {
                downloads = await BackgroundDownloader.GetCurrentDownloadsForTransferGroupAsync(reorderGroup);
            }
            catch (Exception ex)
            {
                if (!IsWebException("Discovery error", ex))
                {
                    throw;
                }
                return;
            }

            // If previous instances of this scenario started transfers that haven't completed yet,
            // cancel them now so that we can start this scenario cleanly.
            if (downloads.Count > 0)
            {
                CancellationTokenSource cancellationToken = new CancellationTokenSource();
                cancellationToken.Cancel();

                Task[] tasks = new Task[downloads.Count];
                for (int i = 0; i < downloads.Count; i++)
                {
                    tasks[i] = downloads[i].AttachAsync().AsTask(cancellationToken.Token);
                }

                // Cancel each download and ignore the cancellation exception.
                try
                {
                    await Task.WhenAll(tasks);
                }
                catch (TaskCanceledException)
                {
                }
            }
        }

async Task<DownloadOperation> CreateDownload | ( | BackgroundDownloader | downloader,
 |  | string | remoteAddress,
 |  | string | fileName |
 | ) |  |  | [inline, private]

Definition at line 232 of file Scenario7_DownloadReordering.xaml.cs.

        {
            Uri source = new Uri(remoteAddress);

            StorageFile destinationFile;
            try
            {
                destinationFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
                    fileName,
                    CreationCollisionOption.GenerateUniqueName);
            }
            catch (FileNotFoundException ex)
            {
                rootPage.NotifyUser($"Error while creating file: {ex.Message}", NotifyType.ErrorMessage);
                throw;
            }

            return downloader.CreateDownload(source, destinationFile);
        }

async Task DownloadAsync ( DownloadOperationItem item ) [inline, private]

Definition at line 255 of file Scenario7_DownloadReordering.xaml.cs.

        {
            Progress<DownloadOperation> progressCallback = new Progress<DownloadOperation>(
                (operation) => DownloadProgress(item));

            try
            {
                await item.download.StartAsync().AsTask(progressCallback);

                item.stateText = item.download.Progress.Status.ToString();
                rootPage.NotifyUser(
                    $"Downloading {item.download.ResultFile.Name} completed.",
                    NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                // Ignore canceled downloads since they are not displayed.
                if (item.download.Progress.Status != BackgroundTransferStatus.Canceled)
                {
                    // Ensure that we reach 100% even for errors.
                    item.percentComplete = 100;
                    item.stateText = item.download.Progress.Status.ToString();
                    if (!IsWebException("Execution error", ex, item.download))
                    {
                        throw;
                    }
                }
            }
        }

void DownloadProgress ( DownloadOperationItem item ) [inline, private]

Definition at line 285 of file Scenario7_DownloadReordering.xaml.cs.

        {
            BackgroundDownloadProgress currentProgress = item.download.Progress;
            BackgroundTransferStatus status = currentProgress.Status;
            int percentComplete = 0;

            if (currentProgress.TotalBytesToReceive > 0)
            {
                percentComplete = (int)((currentProgress.BytesReceived * 100) / currentProgress.TotalBytesToReceive);
            }

            var ignore = this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                item.stateText = status.ToString();
                item.percentComplete = percentComplete;
            });
        }

bool IsWebException | ( | string | title,
 |  | Exception | ex,
 |  | DownloadOperation | download = null |
 | ) |  |  | [inline, private]

Definition at line 303 of file Scenario7_DownloadReordering.xaml.cs.

        {
            WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
            bool result = (error != WebErrorStatus.Unknown);
            string message = result ? error.ToString() : ex.Message;

            if (download == null)
            {
                rootPage.NotifyUser($"{title}: {message}", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser($"{download.ResultFile.Name} - {title}: {message}", NotifyType.ErrorMessage);
            }

            return result;
        }

void MakeCurrent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 165 of file Scenario7_DownloadReordering.xaml.cs.

        {
            Button button = sender as Button;
            DownloadOperationItem item = button.DataContext as DownloadOperationItem;

            // Make the selected operation current.
            item.download.MakeCurrentInTransferGroup();
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 106 of file Scenario7_DownloadReordering.xaml.cs.

        {
            rootPage = MainPage.Current;
            await CancelActiveDownloadsAsync();
        }

task< void > RunDownloadsAsync ( ) [inline, private]

Definition at line 174 of file Scenario7_DownloadReordering.xaml.cs.

        {
            // Create a downloader and associate all its downloads with the transfer group used for
            // this scenario.
            BackgroundDownloader downloader = new BackgroundDownloader();
            downloader.TransferGroup = reorderGroup;

            // Validating the URI is required since it was received from an untrusted source (user
            // input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings
            // that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the
            // intranet that require the "Private Networks (Client and Server)" capability.
            string remoteAddress = remoteAddressField.Text.Trim();
            Uri tmpUri;
            if (!Uri.TryCreate(remoteAddress, UriKind.Absolute, out tmpUri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            string fileName = fileNameField.Text.Trim();
            if (string.IsNullOrWhiteSpace(fileName))
            {
                rootPage.NotifyUser("A local file name is required.", NotifyType.ErrorMessage);
                return;
            }

            // Try to create some downloads.
            DownloadOperation[] downloads = new DownloadOperation[NumDownloads];
            try
            {
                for (int i = 0; i < NumDownloads; i++)
                {
                    string currRemoteAddress = $"{remoteAddress}?id={i}";
                    string currFileName = $"{i}.{fileName}";
                    downloads[i] = await CreateDownload(downloader, currRemoteAddress, currFileName);
                }
            }
            catch (FileNotFoundException ex)
            {
                rootPage.NotifyUser($"Error while creating file: {ex.Message}", NotifyType.ErrorMessage);
                return;
            }

            // Once all downloads have been created, start them.
            Task[] downloadTasks = new Task[downloads.Length];
            downloadCollection.Clear();
            for (int i = 0; i < downloads.Length; i++)
            {
                DownloadOperationItem item = new DownloadOperationItem(downloads[i]);
                downloadTasks[i] = DownloadAsync(item);
                downloadCollection.Add(item);
            }

            await Task.WhenAll(downloadTasks);
        }

async void StartDownload_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 154 of file Scenario7_DownloadReordering.xaml.cs.

        {
            startDownloadButton.IsEnabled = false;

            // Create and start downloads.
            await RunDownloadsAsync();

            // After all downloads are complete, let the user start new ones again.
            startDownloadButton.IsEnabled = true;
        }

Member Data Documentation

const int NumDownloads = 5 [private]

Definition at line 91 of file Scenario7_DownloadReordering.xaml.cs.

BackgroundTransferGroup reorderGroup [private]

Definition at line 94 of file Scenario7_DownloadReordering.xaml.cs.

MainPage rootPage [private]

Definition at line 93 of file Scenario7_DownloadReordering.xaml.cs.

Property Documentation

ObservableCollection<DownloadOperationItem> downloadCollection [get]

Definition at line 95 of file Scenario7_DownloadReordering.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cs
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ForegroundVisits Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_ForegroundVisits
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_ForegroundVisits Class Reference

List of all members.

Public Member Functions

Scenario7_ForegroundVisits ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

async void | OnVisitStateChanged (GeovisitMonitor sender, GeovisitStateChangedEventArgs args)
async void | StartMonitoring (object sender, RoutedEventArgs e)
void | StopMonitoring (object sender, RoutedEventArgs e)
void | UpdateVisitData (Geovisit visit)

Private Attributes

MainPage _rootPage = MainPage.Current
GeovisitMonitor | _visitMonitor = null

Detailed Description

Definition at line 23 of file Scenario7_ForegroundVisits.xaml.cs.

Constructor & Destructor Documentation

Scenario7_ForegroundVisits ( ) [inline]

Definition at line 31 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            if (_visitMonitor != null)
            {
                _visitMonitor.Stop();
                _visitMonitor.VisitStateChanged -= OnVisitStateChanged;
            }
        }

async void OnVisitStateChanged | ( | GeovisitMonitor | sender,
 |  | GeovisitStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Event handler for VisitStateChanged events.

It is raised when a new visit state change is available based on the monitoring scope specified.

Parameters:
sender | Geovisitmonitor instance
args | VisitStateChanged args data

Definition at line 115 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _rootPage.NotifyUser("Visit state changed.", NotifyType.StatusMessage);
                UpdateVisitData(args.Visit);
            });
        }

async void StartMonitoring | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StartMonitoring' button.

Parameters:
sender
e

Definition at line 50 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            // Request permission to access location
            var accessStatus = await Geolocator.RequestAccessAsync();

            switch (accessStatus)
            {
                case GeolocationAccessStatus.Allowed:

                    _visitMonitor = new GeovisitMonitor();

                    // Add visit state changed event handler.
                    _visitMonitor.VisitStateChanged += OnVisitStateChanged;

                    // Start monitoring with the desired scope.
                    // For higher granularity such as building/venue level changes, choose venue.
                    // For lower granularity more or less in the range of zipcode level changes, choose city.
                    // Choosing Venue here as an example.
                    _visitMonitor.Start(VisitMonitoringScope.Venue);

                    LocationDisabledMessage.Visibility = Visibility.Collapsed;
                    _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);

                    StartMonitoringButton.IsEnabled = false;
                    StopMonitoringButton.IsEnabled = true;
                    break;

                case GeolocationAccessStatus.Denied:
                    _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
                    LocationDisabledMessage.Visibility = Visibility.Visible;
                    break;

                default:
                case GeolocationAccessStatus.Unspecified:
                    _rootPage.NotifyUser("Unspecificed error!", NotifyType.ErrorMessage);
                    LocationDisabledMessage.Visibility = Visibility.Collapsed;
                    break;
            }
        }

void StopMonitoring | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StopMonitoring' button.

Parameters:
sender
e

Definition at line 95 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            // Stop visit monitoring.
            _visitMonitor.Stop();
            _visitMonitor.VisitStateChanged -= OnVisitStateChanged;
            _visitMonitor = null;

            StartMonitoringButton.IsEnabled = true;
            StopMonitoringButton.IsEnabled = false;

            // Clear status
            _rootPage.NotifyUser("", NotifyType.StatusMessage);
        }

void UpdateVisitData ( Geovisit visit ) [inline, private]

Updates the user interface with the Geovisit data provided.

Parameters:
visit Geovisit to display its details

Definition at line 128 of file Scenario7_ForegroundVisits.xaml.cs.

        {
            // A valid visit is available, extract the state change and Timestamp.
            ScenarioOutput_VisitStateChange.Text = visit.StateChange.ToString();
            ScenarioOutput_Timestamp.Text = visit.Timestamp.ToString();

            // If a valid position is available, extract the position information that caused the state change to happen.
            if (visit.Position == null)
            {
                ScenarioOutput_Latitude.Text   = "No data";
                ScenarioOutput_Longitude.Text  = "No data";
                ScenarioOutput_Accuracy.Text   = "No data";
                ScenarioOutput_IsRemoteSource.Text = "No data";
            }
            else
            {
                ScenarioOutput_Latitude.Text    = visit.Position.Coordinate.Point.Position.Latitude.ToString();
                ScenarioOutput_Longitude.Text   = visit.Position.Coordinate.Point.Position.Longitude.ToString();
                ScenarioOutput_Accuracy.Text    = visit.Position.Coordinate.Accuracy.ToString();
                ScenarioOutput_IsRemoteSource.Text = visit.Position.Coordinate.IsRemoteSource.ToString();
            }
        }

Member Data Documentation

MainPage _rootPage = MainPage.Current [private]

Definition at line 29 of file Scenario7_ForegroundVisits.xaml.cs.

GeovisitMonitor _visitMonitor = null [private]

Definition at line 26 of file Scenario7_ForegroundVisits.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario7_ForegroundVisits.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ListAllCards Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_ListAllCards
Public Member Functions | Private Member Functions | Private Attributes

Scenario7_ListAllCards Class Reference

List of all members.

Public Member Functions

Scenario7_ListAllCards ()

Private Member Functions

async void ListSmartCard_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario7_ListAllCards.xaml.cs.

Constructor & Destructor Documentation

Scenario7_ListAllCards ( ) [inline]

Definition at line 29 of file Scenario7_ListAllCards.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ListSmartCard_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'ListSmartCard' button.

Parameters:
sender
e

Definition at line 39 of file Scenario7_ListAllCards.xaml.cs.

        {
            Button b = sender as Button;
            b.IsEnabled = false;
            try
            {
                rootPage.NotifyUser("Enumerating smart cards...", NotifyType.StatusMessage);

                // This list will be bound to our ItemListView once it has been
                // filled with SmartCardListItems.  The SmartCardListItem class
                // is defined above, and describes a reader/card pair with a
                // reader name and a card name.
                List<SmartCardListItem> cardItems = new List<SmartCardListItem>();

                // First we get the device selector for smart card readers using
                // the static GetDeviceSelector method of the SmartCardReader
                // class.  The selector is a string which describes a class of
                // devices to query for, and is used as the argument to
                // DeviceInformation.FindAllAsync.  GetDeviceSelector is
                // overloaded so that you can provide a SmartCardReaderKind
                // to specify if you are only interested in a particular type
                // of card/reader (e.g. TPM virtual smart card.)  In this case
                // we will list all cards and readers.
                string selector = SmartCardReader.GetDeviceSelector();
                DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector);

                // DeviceInformation.FindAllAsync gives us a
                // DeviceInformationCollection, which is essentially a list
                // of DeviceInformation objects.  We must iterate through that
                // list and instantiate SmartCardReader objects from the
                // DeviceInformation objects.
                foreach (DeviceInformation device in devices)
                {
                    SmartCardReader reader = await SmartCardReader.FromIdAsync(device.Id);

                    // For each reader, we want to find all the cards associated
                    // with it.  Then we will create a SmartCardListItem for
                    // each (reader, card) pair.
                    IReadOnlyList<SmartCard> cards = await reader.FindAllCardsAsync();

                    foreach (SmartCard card in cards)
                    {
                        SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);

                        SmartCardListItem item = new SmartCardListItem()
                        {
                            ReaderName = card.Reader.Name,
                            CardName = await provisioning.GetNameAsync()
                        };

                        cardItems.Add(item);
                    }
                }

                // Bind the source of ItemListView to our SmartCardListItem list.
                ItemListView.ItemsSource = cardItems;

                rootPage.NotifyUser("Enumerating smart cards completed.", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Enumerating smart cards failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario7_ListAllCards.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario7_ListAllCards.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_LiveSeekableRange Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_LiveSeekableRange
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_LiveSeekableRange Class Reference

See the README.md for discussion of this scenario.

List of all members.

Public Member Functions

Scenario7_LiveSeekableRange ()
TimeSpan | GetPlaybackPosition (double sliderPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition)
double | GetSliderPositionAtPlaybackPosition (TimeSpan playbackPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition)

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)

Private Member Functions

void | DesiredLiveOffsetButton_Click (object sender, RoutedEventArgs e)
void | DesiredSeekableWindowSizeButton_Click (object sender, RoutedEventArgs e)
void | GoToLive_Click (object sender, RoutedEventArgs e)
void | GoToStart_Click (object sender, RoutedEventArgs e)
async void | HideDescriptionOnSmallScreen ()
async Task< MediaPlaybackItem > | LoadSourceFromUriAsync (Uri uri, HttpClient httpClient=null)
void | Log (string message)
void | LogCurrentTimeCorrelation_Click (object sender, RoutedEventArgs e)
async void | MediaPlayer_PlaybackSession_PlaybackStateChanged (MediaPlaybackSession sender, object args)
void | Page_OnLoaded (object sender, RoutedEventArgs e)
void | Pause_Click (object sender, RoutedEventArgs e)
void | Play_Click (object sender, RoutedEventArgs e)
async void | PositionUpdateControl_PositionChanged (MediaPlaybackSession sender, object args)
void | PositionUpdateControl_SeekableRangesChanged (MediaPlaybackSession sender, object args)
void | PositionUpdateControl_SourceChanged (MediaPlayer sender, object args)
void | RegisterForDiscreteControls (MediaPlayer mediaPlayer)
void | RegisterForPositionUpdateControls (MediaPlayer mp)
void | SeekFixedAmount_Click (object sender, RoutedEventArgs e)
void | SeekToRequestedPosition (TimeSpan requestedPosition)
void | UnregisterForDiscreteControls (MediaPlayer mediaPlayer)
void | UnregisterForPositionUpdateControl (MediaPlayer mp)
void | UnregisterHandlers (MediaPlayer mediaPlayer)
void | UpdateSeekableRangesControl (IReadOnlyList< MediaTimeRange > SeekableRanges)
void | UpdateSeekableWindowControls ()
void | UpdateSeekableWindowControls (AdaptiveMediaSource adaptiveMediaSource)

Private Attributes

AdaptiveMediaSourceLogger | adaptiveMediaSourceLogger
TimeSpan | m_PlaybackPositionMaxTime = TimeSpan.FromHours(1)
TimeSpan | m_PlaybackPositionMinTime = TimeSpan.Zero
double | m_SliderFullScale = 100000.0
MediaPlaybackItemLogger | mediaPlaybackItemLogger
MediaPlayerLogger | mediaPlayerLogger
MediaSourceLogger | mediaSourceLogger

Detailed Description

Definition at line 33 of file Scenario7_LiveSeekableRange.xaml.cs.

Constructor & Destructor Documentation

Scenario7_LiveSeekableRange ( ) [inline]

Definition at line 35 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DesiredLiveOffsetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 184 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
            if (adaptiveMediaSource == null)
                return;
            TimeSpan result = adaptiveMediaSource.DesiredLiveOffset;
            if (TimeSpan.TryParse(DesiredLiveOffset.Text, out result))
            {
                adaptiveMediaSource.DesiredLiveOffset = result;
            }
            UpdateSeekableWindowControls();
        }

void DesiredSeekableWindowSizeButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 171 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
            if (adaptiveMediaSource == null)
                return;
            TimeSpan result = adaptiveMediaSource.DesiredSeekableWindowSize.GetValueOrDefault();
            if (TimeSpan.TryParse(DesiredSeekableWindowSize.Text, out result))
            {
                adaptiveMediaSource.DesiredSeekableWindowSize = result;
            }
            UpdateSeekableWindowControls();
        }

TimeSpan GetPlaybackPosition | ( | double | sliderPosition,
 |  | double | sliderFullScale,
 |  | TimeSpan | MinPosition,
 |  | TimeSpan | MaxPosition |
 | ) |  |  | [inline]

We will use slider ticks to drive a playback Position.

This is a linear interpolation, so: y = m*x + b Where: Position = m*sliderPosition + b

Where we have some data points:

At MinPosition, we are at slider position=0 MinPosition = m * 0 + b Thus: b = MinPosition

We choose a 100000 tick granularity for the slider, at which point it will be at MaxPosition: MaxPosition = m * 100000 + b MaxPosition = m * 100000 + MinPosition

Thus: m = (MaxPosition - MinPosition) / 100000 m = (MaxPosition - MinPosition) / sliderFullScale

And more generally, we have:

PlaybackPosition = [(MaxPosition - MinPosition) / sliderFullScale] * SliderPosition + MinPosition or: PlaybackPosition = ((MaxPosition - MinPosition) * SliderPosition / sliderFullScale) + MinPosition

Definition at line 341 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (sliderFullScale == 0)
                return TimeSpan.Zero;
            return TimeSpan.FromTicks((long)((MaxPosition - MinPosition).Ticks * sliderPosition / sliderFullScale) + MinPosition.Ticks);
        }

double GetSliderPositionAtPlaybackPosition | ( | TimeSpan | playbackPosition,
 |  | double | sliderFullScale,
 |  | TimeSpan | MinPosition,
 |  | TimeSpan | MaxPosition |
 | ) |  |  | [inline]

Given: y = m * x + b x = (y - b) /m.

Where from above: b = MinPosition m = (MaxPosition - MinPosition) / sliderFullScale

We have: Position = (PlaybackPosition - MinPosition) * sliderFullScale / (MaxPosition - MinPosition)

Definition at line 361 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if ((MaxPosition - MinPosition).Ticks == 0)
                return 0;

            if (playbackPosition == TimeSpan.Zero)
            {
                LoggerControl.Log("Transient playbackPosition == TimeSpan.Zero", LogViewLoggingLevel.Error);
            }

            var interpolatedPosition = (playbackPosition - MinPosition).Ticks * sliderFullScale / (MaxPosition - MinPosition).Ticks;

            if (interpolatedPosition < 0)
            {
                interpolatedPosition = 0;
                LoggerControl.Log("Transient calculatedPosition < 0", LogViewLoggingLevel.Error);
            }

            return interpolatedPosition;
        }

void GoToLive_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 429 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (mediaPlayerElement.MediaPlayer != null)
            {
                var seekableRanges = mediaPlayerElement.MediaPlayer.PlaybackSession.GetSeekableRanges();
                if (seekableRanges.Count > 0)
                {
                    UpdateSeekableRangesControl(seekableRanges);
                    var requestedPosition = seekableRanges[seekableRanges.Count-1].End;
                    SeekToRequestedPosition(requestedPosition);
                }
            }
        }

void GoToStart_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 415 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (mediaPlayerElement.MediaPlayer != null)
            {
                var seekableRanges = mediaPlayerElement.MediaPlayer.PlaybackSession.GetSeekableRanges();
                if (seekableRanges.Count > 0)
                {
                    UpdateSeekableRangesControl(seekableRanges);
                    var requestedPosition = seekableRanges[0].Start;
                    SeekToRequestedPosition(requestedPosition);
                }
            }
        }

async void HideDescriptionOnSmallScreen ( ) [inline, private]

Definition at line 157 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            // On small screens, hide the description text to make room for the video.
            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
            });
        }

async Task<MediaPlaybackItem> LoadSourceFromUriAsync | ( | Uri | uri,
 |  | HttpClient | httpClient = null |
 | ) |  |  | [inline, private]

Definition at line 103 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            UnregisterHandlers(mediaPlayerElement.MediaPlayer);

            AdaptiveMediaSourceCreationResult result = null;
            if (httpClient != null)
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
            }
            else
            {
                result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
            }

            MediaSource source;
            if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
            {
                var adaptiveMediaSource = result.MediaSource;

                // We use a helper class that logs all the events for the AdaptiveMediaSource:
                adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);

                source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);

                if (adaptiveMediaSource.MaxSeekableWindowSize.HasValue)
                {
                    UpdateSeekableWindowControls(adaptiveMediaSource);
                }
            }
            else
            {
                Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
                return null;
            }

            // We use a helper class that logs all the events for the MediaSource:
            mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);

            // Save the original Uri.
            source.CustomProperties["uri"] = uri.ToString();

            // You're likely to put a content tracking id into the CustomProperties.
            source.CustomProperties["contentId"] = Guid.NewGuid().ToString();

            var mpItem = new MediaPlaybackItem(source);

            // We use a helper class that logs all the events for the MediaPlaybackItem:
            mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);

            HideDescriptionOnSmallScreen();

            return mpItem;
        }

void Log ( string message ) [inline, private]

Definition at line 501 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            LoggerControl.Log(message);
        }

void LogCurrentTimeCorrelation_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 488 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
            if (adaptiveMediaSource == null)
                return;
            var times = adaptiveMediaSource.GetCorrelatedTimes();
            Log(times.ToJsonObject().ToString());
        }

async void MediaPlayer_PlaybackSession_PlaybackStateChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 460 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            Log($"PlaybackSession_PlaybackStateChanged, PlaybackState: {sender.PlaybackState}");

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (sender.PlaybackState)
                {
                    case MediaPlaybackState.None:
                    case MediaPlaybackState.Opening:
                    case MediaPlaybackState.Buffering:
                        PlayButton.IsEnabled = false;
                        PauseButton.IsEnabled = false;
                        break;
                    case MediaPlaybackState.Playing:
                        PlayButton.IsEnabled = false;
                        PauseButton.IsEnabled = true;
                        break;
                    case MediaPlaybackState.Paused:
                        PlayButton.IsEnabled = true;
                        PauseButton.IsEnabled = false;
                        break;
                    default:
                        break;
                }
            });
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 40 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            // Release handles on various media objects to ensure a quick clean-up
            ContentSelectorControl.MediaPlaybackItem = null;
            var mediaPlayer = mediaPlayerElement.MediaPlayer;
            if (mediaPlayer != null)
            {
                mediaPlayerLogger?.Dispose();
                mediaPlayerLogger = null;

                UnregisterForDiscreteControls(mediaPlayer);
                UnregisterForPositionUpdateControl(mediaPlayer);

                UnregisterHandlers(mediaPlayer);

                mediaPlayerElement.SetMediaPlayer(null);
                mediaPlayer.Dispose();
            }
        }

void Page_OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var mediaPlayer = new MediaPlayer();

            // We use a helper class that logs all the events for the MediaPlayer:
            mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);

            // In addition to logging, we use the callbacks to update some UI elements in this scenario:
            RegisterForDiscreteControls(mediaPlayer);
            RegisterForPositionUpdateControls(mediaPlayer);

            // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
            var prHelper = new PlayReadyHelper(LoggerControl);
            prHelper.SetUpProtectionManager(mediaPlayer);
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            ContentSelectorControl.Initialize(
                mediaPlayer,
                MainPage.ContentManagementSystemStub.Where(m => !m.Aes && m.Live),
                null,
                LoggerControl,
                LoadSourceFromUriAsync);

            // Initialize scenario specific layout:
            ContentSelectorControl.SetAutoPlay(true);
            mediaPlayerElement.AreTransportControlsEnabled = false;
            LoggerControl.Height = 200;
        }

void Pause_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 407 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (mediaPlayerElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
            {
                mediaPlayerElement.MediaPlayer.Pause();
            }
        }

void Play_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 399 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
          if(mediaPlayerElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
            {
                mediaPlayerElement.MediaPlayer.Play();
            }
        }

async void PositionUpdateControl_PositionChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 289 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var postion = sender.Position;
            var newSliderValue = GetSliderPositionAtPlaybackPosition(postion, m_SliderFullScale, m_PlaybackPositionMinTime, m_PlaybackPositionMaxTime);
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                CurrentPosition.Text = postion.ToString("c");
                PositionSlider.Value = newSliderValue;
            });
        }

void PositionUpdateControl_SeekableRangesChanged | ( | MediaPlaybackSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 252 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var seekableRanges = sender.GetSeekableRanges();
            UpdateSeekableRangesControl(seekableRanges);
        }

void PositionUpdateControl_SourceChanged | ( | MediaPlayer | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 239 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            m_PlaybackPositionMaxTime = TimeSpan.FromHours(1);
            m_PlaybackPositionMinTime = TimeSpan.Zero;
        }

void RegisterForDiscreteControls ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 443 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            // PlaybackSession Events
            mediaPlayer.PlaybackSession.PlaybackStateChanged += MediaPlayer_PlaybackSession_PlaybackStateChanged;
        }

void RegisterForPositionUpdateControls ( MediaPlayer mp ) [inline, private]

Definition at line 226 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            // Setup slider
            PositionSlider.Minimum = 0.0;
            PositionSlider.Maximum = m_SliderFullScale;
            PositionSlider.Value = 0.0;

            // Register for events
            mp.SourceChanged += PositionUpdateControl_SourceChanged;
            mp.PlaybackSession.PositionChanged += PositionUpdateControl_PositionChanged;
            mp.PlaybackSession.SeekableRangesChanged += PositionUpdateControl_SeekableRangesChanged;
        }

void SeekFixedAmount_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 387 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            TimeSpan amount = TimeSpan.Zero;
            string selected = (sender as Button).Tag.ToString();
            TimeSpan.TryParse(selected, out amount);
            if (amount != TimeSpan.Zero)
            {
                var requestedPosition = mediaPlayerElement.MediaPlayer.PlaybackSession.Position + amount;
                SeekToRequestedPosition(requestedPosition);
            }
        }

void SeekToRequestedPosition ( TimeSpan requestedPosition ) [inline, private]

Definition at line 302 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            Log($"Seeking to:{requestedPosition.ToString("c")}");
            mediaPlayerElement.MediaPlayer.PlaybackSession.Position = requestedPosition;
        }

void UnregisterForDiscreteControls ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 449 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (mediaPlayer == null)
            {
                return;
            }

            // PlaybackSession Events
            mediaPlayer.PlaybackSession.PlaybackStateChanged -= MediaPlayer_PlaybackSession_PlaybackStateChanged;
        }

void UnregisterForPositionUpdateControl ( MediaPlayer mp ) [inline, private]

Definition at line 245 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            mp.SourceChanged -= PositionUpdateControl_SourceChanged;
            mp.PlaybackSession.PositionChanged -= PositionUpdateControl_PositionChanged;
            mp.PlaybackSession.SeekableRangesChanged -= PositionUpdateControl_SeekableRangesChanged;
        }

void UnregisterHandlers ( MediaPlayer mediaPlayer ) [inline, private]

Definition at line 60 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            mediaPlaybackItemLogger?.Dispose();
            mediaPlaybackItemLogger = null;

            mediaSourceLogger?.Dispose();
            mediaSourceLogger = null;

            adaptiveMediaSourceLogger?.Dispose();
            adaptiveMediaSourceLogger = null;
        }

void UpdateSeekableRangesControl ( IReadOnlyList< MediaTimeRange > SeekableRanges ) [inline, private]

Definition at line 258 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (SeekableRanges.Count > 0)
            {
                var SeekableRangeMin = SeekableRanges.First();
                m_PlaybackPositionMinTime = SeekableRangeMin.Start;

                var SeekableRangeMax = SeekableRanges.Last();
                m_PlaybackPositionMaxTime = SeekableRangeMax.End;
            }
            else
            {
                m_PlaybackPositionMaxTime = TimeSpan.FromHours(1);
                m_PlaybackPositionMinTime = TimeSpan.Zero;
            }

            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                StartPosition.Text = m_PlaybackPositionMinTime.ToString("c");
                EndPosition.Text = m_PlaybackPositionMaxTime.ToString("c");
            });

            string ranges = "";
            foreach (var range in SeekableRanges)
            {
                ranges += $"[{range.Start},{range.End}],";
            }
            ranges = ranges.TrimEnd(',');
            Log($"MediaPlayer_PlaybackSession_SeekableRangesChanged: {ranges}");
        }

void UpdateSeekableWindowControls ( ) [inline, private]

Definition at line 197 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
            UpdateSeekableWindowControls(adaptiveMediaSource);
        }

void UpdateSeekableWindowControls ( AdaptiveMediaSource adaptiveMediaSource ) [inline, private]

Definition at line 203 of file Scenario7_LiveSeekableRange.xaml.cs.

        {
            if (adaptiveMediaSource == null)
                return;

            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MaxSeekableWindowSize.Text = adaptiveMediaSource.MaxSeekableWindowSize.HasValue ? $"{adaptiveMediaSource.MaxSeekableWindowSize.Value.ToString("c")}" : "";
                DesiredSeekableWindowSize.Text = adaptiveMediaSource.DesiredSeekableWindowSize.HasValue ? $"{adaptiveMediaSource.DesiredSeekableWindowSize.Value.ToString("c")}" : "";
                DesiredLiveOffset.Text = $"{adaptiveMediaSource.DesiredLiveOffset.ToString("c")}";
                MinLiveOffset.Text = adaptiveMediaSource.MinLiveOffset.HasValue ? $"{adaptiveMediaSource.MinLiveOffset.Value.ToString("c")}" : "";
            });
        }

Member Data Documentation

AdaptiveMediaSourceLogger adaptiveMediaSourceLogger [private]

Definition at line 508 of file Scenario7_LiveSeekableRange.xaml.cs.

TimeSpan m_PlaybackPositionMaxTime = TimeSpan.FromHours(1) [private]

Definition at line 223 of file Scenario7_LiveSeekableRange.xaml.cs.

TimeSpan m_PlaybackPositionMinTime = TimeSpan.Zero [private]

Definition at line 224 of file Scenario7_LiveSeekableRange.xaml.cs.

double m_SliderFullScale = 100000.0 [private]

Definition at line 221 of file Scenario7_LiveSeekableRange.xaml.cs.

MediaPlaybackItemLogger mediaPlaybackItemLogger [private]

Definition at line 507 of file Scenario7_LiveSeekableRange.xaml.cs.

MediaPlayerLogger mediaPlayerLogger [private]

Definition at line 505 of file Scenario7_LiveSeekableRange.xaml.cs.

MediaSourceLogger mediaSourceLogger [private]

Definition at line 506 of file Scenario7_LiveSeekableRange.xaml.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Scenario7_LiveSeekableRange.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_PinFromAppbar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_PinFromAppbar
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario7_PinFromAppbar Class Reference

List of all members.

Public Member Functions

Scenario7_PinFromAppbar ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | BottomAppBar_Opened (object sender, object e)
async void | PinToAppBar_Click (object sender, RoutedEventArgs e)
void | UpdateAppBarButton ()
void | Window_Activated (object sender, WindowActivatedEventArgs e)

Detailed Description

Definition at line 20 of file Scenario7_PinFromAppbar.xaml.cs.

Constructor & Destructor Documentation

Scenario7_PinFromAppbar ( ) [inline]

Definition at line 24 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BottomAppBar_Opened | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 135 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            UpdateAppBarButton();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            Window.Current.Activated -= Window_Activated;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            // The appbar is open by default.
            Message.Text = "Tap or click the Pin button to pin a tile.";
            UpdateAppBarButton();

            Window.Current.Activated += Window_Activated;
        }

async void PinToAppBar_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            this.SecondaryTileCommandBar.IsSticky = true;

            // Let us first verify if we need to pin or unpin
            if (SecondaryTile.Exists(MainPage.appbarTileId))
            {
                // First prepare the tile to be unpinned
                SecondaryTile secondaryTile = new SecondaryTile(MainPage.appbarTileId);

                // Now make the delete request.
                bool isUnpinned = await secondaryTile.RequestDeleteForSelectionAsync(MainPage.GetElementRect((FrameworkElement)sender), Windows.UI.Popups.Placement.Above);
                if (isUnpinned)
                {
                    Message.Text = MainPage.appbarTileId + " was unpinned.";
                }
                else
                {
                    Message.Text = MainPage.appbarTileId + " was not unpinned.";
                }

                UpdateAppBarButton();
            }
            else
            {
                // Prepare package images for the medium tile size in our tile to be pinned
                Uri square150x150Logo = new Uri("ms-appx:///Assets/square150x150Tile-sdk.png");

                // During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation,
                // so that the app knows which tile the user is launching. In this sample, we'll pass in the date and time the secondary tile was pinned.
                string tileActivationArguments = MainPage.appbarTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();

                // Create a Secondary tile with all the required arguments.
                // Note the last argument specifies what size the Secondary tile should show up as by default in the Pin to start fly out.
                // It can be set to TileSize.Square150x150, TileSize.Wide310x150, or TileSize.Default.
                // If set to TileSize.Wide310x150, then the asset for the wide size must be supplied as well.
                // TileSize.Default will default to the wide size if a wide size is provided, and to the medium size otherwise.
                SecondaryTile secondaryTile = new SecondaryTile(MainPage.appbarTileId,
                                                                "Secondary tile pinned via AppBar",
                                                                tileActivationArguments,
                                                                square150x150Logo,
                                                                TileSize.Square150x150);

                // Whether or not the app name should be displayed on the tile can be controlled for each tile size.  The default is false.
                secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;

                // Specify a foreground text value.
                // The tile background color is inherited from the parent unless a separate value is specified.
                secondaryTile.VisualElements.ForegroundText = ForegroundText.Dark;

                // OK, the tile is created and we can now attempt to pin the tile.
                // Note that the status message is updated when the async operation to pin the tile completes.
                bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Above);
                if (isPinned)
                {
                    Message.Text = MainPage.appbarTileId + " was successfully pinned.";
                }
                else
                {
                    Message.Text = MainPage.appbarTileId + " was not pinned.";
                }

                UpdateAppBarButton();
            }

            this.BottomAppBar.IsSticky = false;
        }

void UpdateAppBarButton ( ) [inline, private]

Definition at line 51 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            if (SecondaryTile.Exists(MainPage.appbarTileId))
            {
                this.PinUnPinCommandButton.Label = "Unpin";
                this.PinUnPinCommandButton.Icon = new SymbolIcon(Symbol.UnPin);
            }
            else
            {
                this.PinUnPinCommandButton.Label = "Pin";
                this.PinUnPinCommandButton.Icon = new SymbolIcon(Symbol.Pin);
            }

            this.PinUnPinCommandButton.UpdateLayout();
        }

void Window_Activated | ( | object | sender,
 |  | WindowActivatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file Scenario7_PinFromAppbar.xaml.cs.

        {
            // When the window regains activation, refresh the pin/unpin button.
            UpdateAppBarButton();
        }

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario7_PinFromAppbar.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ScrollingContentUsingMarquee Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_ScrollingContentUsingMarquee
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_ScrollingContentUsingMarquee Class Reference

List of all members.

Public Member Functions

Scenario7_ScrollingContentUsingMarquee ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task | InitializeAsync ()
async void | StartScrollingButton_Click (object sender, RoutedEventArgs e)
async Task | StopAllScrollingAsync ()
async void | StopScrollingButton_Click (object sender, RoutedEventArgs e)

Private Attributes

LineDisplayWindow | horizontalScrollableWindow
ClaimedLineDisplay | lineDisplay
MainPage rootPage = MainPage.Current
LineDisplayWindow | verticalScrollableWindow

Detailed Description

Definition at line 28 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

Constructor & Destructor Documentation

Scenario7_ScrollingContentUsingMarquee ( ) [inline]

Definition at line 35 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            this.InitializeComponent();
            this.DataContext = this;
        }

Member Function Documentation

Concurrency::task< void > InitializeAsync ( ) [inline, private]

Definition at line 56 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();

            if (lineDisplay != null)
            {
                Size screenSize = lineDisplay.GetAttributes().ScreenSizeInCharacters;
                int windowCount = 1;

                if (lineDisplay.Capabilities.IsHorizontalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows))
                {
                    // Create a horizontal scrollable window by creating a window
                    // whose width is wider than the viewport.
                    horizontalScrollableWindow = await lineDisplay.TryCreateWindowAsync(
                        new Rect()
                        {
                            X = 0,
                            Y = 0,
                            Width = screenSize.Width,
                            Height = screenSize.Height
                        },
                        new Size()
                        {
                            Width = screenSize.Width * 2,
                            Height = screenSize.Height
                        });

                    if (horizontalScrollableWindow != null)
                    {
                        windowCount++;
                        ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Left);
                        ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Right);
                    }
                }

                if (lineDisplay.Capabilities.IsVerticalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows))
                {
                    // Create a vertical scrollable window by creating a window
                    // whose height is taller than the viewport.
                    verticalScrollableWindow = await lineDisplay.TryCreateWindowAsync(
                        new Rect()
                        {
                            X = 0,
                            Y = 0,
                            Width = screenSize.Width,
                            Height = screenSize.Height
                        },
                        new Size()
                        {
                            Width = screenSize.Width,
                            Height = screenSize.Height * 2
                        });

                    if (verticalScrollableWindow != null)
                    {
                        windowCount++;
                        ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Up);
                        ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Down);
                    }
                }
            }

            if (ScrollDirectionComboBox.Items.Count > 0)
            {
                ScrollDirectionComboBox.SelectedIndex = 0;
                StartScrollingButton.IsEnabled = true;
                StopScrollingButton.IsEnabled = true;
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 46 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            horizontalScrollableWindow?.Dispose();
            horizontalScrollableWindow = null;
            verticalScrollableWindow?.Dispose();
            verticalScrollableWindow = null;
            lineDisplay?.Dispose();
            lineDisplay = null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            await InitializeAsync();
        }

async void StartScrollingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 126 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            LineDisplayScrollDirection scrollDirection = (LineDisplayScrollDirection)ScrollDirectionComboBox.SelectedItem;
            LineDisplayWindow selectedWindow = null;

            if (scrollDirection == LineDisplayScrollDirection.Left || scrollDirection == LineDisplayScrollDirection.Right)
            {
                selectedWindow = horizontalScrollableWindow;
            }
            else
            {
                selectedWindow = verticalScrollableWindow;
            }

            // Cannot make changes while scrolling is active.
            await StopAllScrollingAsync();

            // Bring the window to the front, clear its old contents,
            // and display some text that will require scrolling.
            await selectedWindow.TryRefreshAsync();
            await selectedWindow.TryClearTextAsync();
            await selectedWindow.TryDisplayTextAsync(
                "An incredibly lengthy string of arbitrary text that cannot be displayed on most line displays " +
                "without being scrolled into view. It will need to be scrolled into view left, right, up or down.");

            // Configure the scrolling behavior and start scrolling.
            selectedWindow.Marquee.Format = (LineDisplayMarqueeFormat)MarqueeFormatComboBox.SelectedItem;
            selectedWindow.Marquee.RepeatWaitInterval = TimeSpan.FromMilliseconds(RepeatWaitIntervalSlider.Value);
            selectedWindow.Marquee.ScrollWaitInterval = TimeSpan.FromMilliseconds(ScrollWaitIntervalSlider.Value);
            await selectedWindow.Marquee.TryStartScrollingAsync(scrollDirection);
        }

task< void > StopAllScrollingAsync ( ) [inline, private]

Definition at line 158 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            if (horizontalScrollableWindow != null)
            {
                await horizontalScrollableWindow.Marquee.TryStopScrollingAsync();
            }

            if (verticalScrollableWindow != null)
            {
                await verticalScrollableWindow.Marquee.TryStopScrollingAsync();
            }
        }

async void StopScrollingButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 170 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

        {
            await StopAllScrollingAsync();
        }

Member Data Documentation

LineDisplayWindow horizontalScrollableWindow [private]

Definition at line 32 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

ClaimedLineDisplay lineDisplay [private]

Definition at line 31 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

LineDisplayWindow verticalScrollableWindow [private]

Definition at line 33 of file Scenario7_ScrollingContentUsingMarquee.xaml.cs.

The documentation for this class was generated from the following files:
  • LineDisplay/cs/Scenario7_ScrollingContentUsingMarquee.xaml.cs
  • LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_SetVersion Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_SetVersion
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_SetVersion Class Reference

List of all members.

Public Member Functions

Scenario7_SetVersion ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | DisplayOutput ()
async void | SetVersion0_Click (Object sender, RoutedEventArgs e)
async void | SetVersion1_Click (Object sender, RoutedEventArgs e)
void | SetVersionHandler0 (SetVersionRequest request)
void | SetVersionHandler1 (SetVersionRequest request)

Private Attributes

ApplicationData | appData = ApplicationData.Current
const string | settingName = "SetVersionSetting"
const string | settingValue0 = "Data.v0"
const string | settingValue1 = "Data.v1"

Detailed Description

Definition at line 20 of file Scenario7_SetVersion.xaml.cs.

Constructor & Destructor Documentation

Scenario7_SetVersion ( ) [inline]

Definition at line 28 of file Scenario7_SetVersion.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

void DisplayOutput ( ) [inline, private]

Definition at line 99 of file Scenario7_SetVersion.xaml.cs.

        {
            OutputTextBlock.Text = "Version: " + appData.Version;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 104 of file Scenario7_SetVersion.xaml.cs.

        {
            DisplayOutput();
        }

async void SetVersion0_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 87 of file Scenario7_SetVersion.xaml.cs.

        {
            await appData.SetVersionAsync(0, SetVersionHandler0);
            DisplayOutput();
        }

async void SetVersion1_Click | ( | Object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario7_SetVersion.xaml.cs.

        {
            await appData.SetVersionAsync(1, SetVersionHandler1);
            DisplayOutput();
        }

void SetVersionHandler0 ( SetVersionRequest request ) [inline, private]

Definition at line 33 of file Scenario7_SetVersion.xaml.cs.

        {
            SetVersionDeferral deferral = request.GetDeferral();

            uint version = appData.Version;

            switch (version)
            {
                case 0:
                    // Version is already 0.  Nothing to do.
                    break;

                case 1:
                    // Need to convert data from v1 to v0.

                    // This sample simulates that conversion by writing a version-specific value.
                    appData.LocalSettings.Values[settingName] = settingValue0;

                    break;

                default:
                    throw new Exception("Unexpected ApplicationData Version: " + version);
            }

            deferral.Complete();
        }

void SetVersionHandler1 ( SetVersionRequest request ) [inline, private]

Definition at line 60 of file Scenario7_SetVersion.xaml.cs.

        {
            SetVersionDeferral deferral = request.GetDeferral();

            uint version = appData.Version;

            switch (version)
            {
                case 0:
                    // Need to convert data from v0 to v1.

                    // This sample simulates that conversion by writing a version-specific value.
                    appData.LocalSettings.Values[settingName] = settingValue1;

                    break;

                case 1:
                    // Version is already 1.  Nothing to do.
                    break;

                default:
                    throw new Exception("Unexpected ApplicationData Version: " + version);
            }

            deferral.Complete();
        }

Member Data Documentation

ApplicationData appData = ApplicationData.Current [private]

Definition at line 22 of file Scenario7_SetVersion.xaml.cs.

const string settingName = "SetVersionSetting" [private]

Definition at line 24 of file Scenario7_SetVersion.xaml.cs.

const string settingValue0 = "Data.v0" [private]

Definition at line 25 of file Scenario7_SetVersion.xaml.cs.

const string settingValue1 = "Data.v1" [private]

Definition at line 26 of file Scenario7_SetVersion.xaml.cs.

The documentation for this class was generated from the following file:
  • ApplicationData/cs/Scenario7_SetVersion.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_Share Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_Share
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario7_Share Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7_Share ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | DataTransferManager_DataRequested (DataTransferManager sender, DataRequestedEventArgs args)
void | ShareContent_Click (object sender, RoutedEventArgs e)
void | WebViewControl_NavigationCompleted (WebView sender, WebViewNavigationCompletedEventArgs args)
void | WebViewControl_NavigationStarting (WebView sender, WebViewNavigationStartingEventArgs args)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 24 of file Scenario7_Share.xaml.cs.

Constructor & Destructor Documentation

Scenario7_Share ( ) [inline]

Definition at line 28 of file Scenario7_Share.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void DataTransferManager_DataRequested | ( | DataTransferManager | sender,
 |  | DataRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Raised when the user initiates a Share operation.

Parameters:
sender
args

Definition at line 75 of file Scenario7_Share.xaml.cs.

        {
            DataRequest request = args.Request;
            // We are going to use an async API to talk to the webview, so get a deferral to give
            // us time to generate the results.
            DataRequestDeferral deferral = request.GetDeferral();
            DataPackage dp = await WebViewControl.CaptureSelectedContentToDataPackageAsync();

            // Determine whether there was any selected content.
            bool hasSelection = false;
            try
            {
                hasSelection = (dp != null) && (dp.GetView().AvailableFormats.Count > 0);
            }
            catch (Exception ex)
            {
                switch (ex.HResult)
                {
                    case unchecked((int)0x80070490):
                        // Mobile does not generate a data package with AvailableFormats
                        // and results in an exception. Sorry. Handle the case by acting as
                        // if we had no selected content.
                        hasSelection = false;
                        break;

                    default:
                        // All other exceptions are unexpected. Let them propagate.
                        throw;
                }
            }

            if (hasSelection)
            {
                // Webview has a selection, so we'll share its data package.
                dp.Properties.Title = "WebView sample selected content";
            }
            else
            {
                // No selection, so we'll share the url of the webview.
                dp = new DataPackage();
                dp.SetWebLink(WebViewControl.Source);
                dp.Properties.Title = "WebView sample page";
            }
            dp.Properties.Description = WebViewControl.Source.ToString();
            request.Data = dp;

            deferral.Complete();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario7_Share.xaml.cs.

        {
            // Unregister for the share event
            DataTransferManager.GetForCurrentView().DataRequested -= DataTransferManager_DataRequested;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 38 of file Scenario7_Share.xaml.cs.

        {
            rootPage = MainPage.Current;

            WebViewControl.Navigate(new Uri("http://www.microsoft.com"));

            // Register for the share event
            DataTransferManager.GetForCurrentView().DataRequested += DataTransferManager_DataRequested;
        }

void ShareContent_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario7_Share.xaml.cs.

        {
            // Show the share UI
            DataTransferManager.ShowShareUI();
        }

void WebViewControl_NavigationCompleted | ( | WebView | sender,
 |  | WebViewNavigationCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 59 of file Scenario7_Share.xaml.cs.

        {
            ProgressControl.IsActive = false;
        }

void WebViewControl_NavigationStarting | ( | WebView | sender,
 |  | WebViewNavigationStartingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario7_Share.xaml.cs.

        {
            ProgressControl.IsActive = true;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 26 of file Scenario7_Share.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario7_Share.xaml.cs
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_UsingUnicodeExtensions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario7_UsingUnicodeExtensions
Public Member Functions | Private Member Functions

Scenario7_UsingUnicodeExtensions Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario7_UsingUnicodeExtensions ()

Private Member Functions

void Display_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 23 of file Scenario7_UsingUnicodeExtensions.xaml.cs.

Constructor & Destructor Documentation

Scenario7_UsingUnicodeExtensions ( ) [inline]

Definition at line 25 of file Scenario7_UsingUnicodeExtensions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Display_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Display' button.

Parameters:
sender
e

Definition at line 35 of file Scenario7_UsingUnicodeExtensions.xaml.cs.

        {
            // This scenario uses language tags with unicode extensions to construct and use the various
            // formatters and NumeralSystemTranslator in Windows.Globalization.NumberFormatting to format numbers

            // Keep results of the scenario in a StringBuilder
            StringBuilder results = new StringBuilder();

            // Create number to format.
            double randomNumber = (new Random().NextDouble() * 100000);
            results.AppendLine("Random number used by formatters: " + randomNumber);
            // Create a string to translate
            String stringToTranslate = "These are the 10 digits of a numeral system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
            results.AppendLine("String used by NumeralSystemTranslater: " + stringToTranslate);
            // Create the rounder and set its increment to 0.01
            IncrementNumberRounder rounder = new Windows.Globalization.NumberFormatting.IncrementNumberRounder();
            rounder.Increment = 0.001;
            results.AppendLine("CurrencyFormatter will be using Euro symbol and all formatters rounding to 0.001 increments");
            results.AppendLine();

            // The list of language tags with unicode extensions we want to test
            String[] languages = new[] { "de-DE-u-nu-telu-ca-buddist-co-phonebk-cu-usd", "ja-jp-u-nu-arab"};

            // Create the various formatters, now using the language list with unicode extensions
            results.AppendLine("Creating formatters using following languages in the language list:");
            foreach(String language in languages)
            {
                results.AppendLine("\t" + language);
            }
            results.AppendLine();

            // Create the various formatters.
            DecimalFormatter decimalFormatter = new DecimalFormatter(languages, "ZZ");
            decimalFormatter.NumberRounder = rounder; decimalFormatter.FractionDigits = 2;
            CurrencyFormatter currencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.EUR, languages, "ZZ");
            currencyFormatter.NumberRounder = rounder; currencyFormatter.FractionDigits = 2;
            PercentFormatter percentFormatter = new PercentFormatter(languages, "ZZ");
            percentFormatter.NumberRounder = rounder; percentFormatter.FractionDigits = 2;
            PermilleFormatter permilleFormatter = new PermilleFormatter(languages, "ZZ");
            permilleFormatter.NumberRounder = rounder; permilleFormatter.FractionDigits = 2;
            NumeralSystemTranslator numeralTranslator = new NumeralSystemTranslator(languages);

            results.AppendLine("Using resolved language  " + decimalFormatter.ResolvedLanguage + "  : (note that all extension tags other than nu are ignored)");
            // Format using formatters and translate using NumeralSystemTranslator.
            results.AppendLine("Decimal Formatted:   " + decimalFormatter.Format(randomNumber));
            results.AppendLine("Currency formatted:   " + currencyFormatter.Format(randomNumber));
            results.AppendLine("Percent formatted:   " + percentFormatter.Format(randomNumber));
            results.AppendLine("Permille formatted:   " + permilleFormatter.Format(randomNumber));
            results.AppendLine("NumeralTranslator translated:   " + numeralTranslator.TranslateNumerals(stringToTranslate));
            results.AppendLine();

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

The documentation for this class was generated from the following files:
  • NumberFormatting/cs/Scenario7_UsingUnicodeExtensions.xaml.cs
  • NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.cpp
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario8 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario8 ()
Scenario8 ()
Scenario8 ()
Scenario8 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | AddItemForLanguageTag (string languageTag)
void | addToResultGrid (OfflineMapPackage package)
async void | CopyFileButton_Click (object sender, RoutedEventArgs e)
void | CoreWetStrokeUpdateSource_WetStrokeCanceled (CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args)
void | CoreWetStrokeUpdateSource_WetStrokeCompleted (CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args)
void | CoreWetStrokeUpdateSource_WetStrokeContinuing (CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args)
void | CoreWetStrokeUpdateSource_WetStrokeStarting (CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args)
void | CoreWetStrokeUpdateSource_WetStrokeStopping (CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args)
double | DistanceFromCenter (Point position)
async void | findAtCenterButton_Click (object sender, RoutedEventArgs e)
bool | FollowCircleTest (CoreWetStrokeUpdateEventArgs args)
string | GetAppLanguagesAsFormattedString ()
void | HandleFollowCircleInput (CoreWetStrokeUpdateEventArgs args)
void | HandleRegularInput (CoreWetStrokeUpdateEventArgs args)
bool | InCircleEdgeZone (double distanceFromCenter)
void | InkStackPanel_Loaded (object sender, RoutedEventArgs e)
void | LanguageOverrideCombo_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | myMap_Loaded (object sender, RoutedEventArgs e)
void | PopulateComboBox ()
void | ShowText ()
void | UpdateCurrentAppLanguageMessage ()

Static Private Member Functions

static bool | canDownload (OfflineMapPackage package)
static long | nearestMegabyte (ulong bytes)

Private Attributes

Point | circleCenter
const float | circleStrokeThickness = 2.0f
CoreWetStrokeUpdateSource | coreWetStrokeUpdateSource
bool | disableFollowCircle = false
bool | discontinueStroke = false
bool | followCircle = false
int | lastSelectedIndex
const float | penSize = 4.0f
const float | radius = 150.0f
MainPage rootPage = MainPage.Current

Detailed Description

This page shows the code to do ink recognition.

Copying a file.

Definition at line 25 of file scenario8.xaml.cs.

Constructor & Destructor Documentation

Scenario8 ( ) [inline]

Definition at line 29 of file scenario8.xaml.cs.

        {
            this.InitializeComponent();
            PopulateComboBox();
            UpdateCurrentAppLanguageMessage();
        }

Scenario8 ( ) [inline]

Definition at line 28 of file Scenario8_Copy.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario8 ( ) [inline]

Definition at line 23 of file Scenario8.xaml.cs.

        {
            InitializeComponent();
        }

Scenario8 ( ) [inline]

Definition at line 43 of file Scenario8.xaml.cs.

        {
            this.InitializeComponent();

            inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen;

            var drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
            drawingAttributes.Size = new Size(penSize, penSize);
            inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
        }

Member Function Documentation

void AddItemForLanguageTag ( string languageTag ) [inline, private]

Definition at line 66 of file scenario8.xaml.cs.

        {
            var language = new Language(languageTag);
            var item = new ComboBoxItem { Content = language.DisplayName, Tag = languageTag };
            LanguageOverrideCombo.Items.Add(item);

            // Select this item if it is the primary language override.
            if (languageTag == ApplicationLanguages.PrimaryLanguageOverride)
            {
                LanguageOverrideCombo.SelectedItem = item;
            }
        }

void addToResultGrid ( OfflineMapPackage package ) [inline, private]

Definition at line 62 of file Scenario8.xaml.cs.

        {
            // a descriptive name for the package
            // ex: "Washington, USA (160 MB)"
            string descriptiveName = package.DisplayName + ", " + package.EnclosingRegionName + " (" + nearestMegabyte(package.EstimatedSizeInBytes) + " MB)";

            // current download status (Downloaded, NotDownloaded, Downloading, etc)
            string downloadStatus = package.Status.ToString();

            TextBlock packageNameTextBlock = new TextBlock()
            {
                Text = descriptiveName,
                Margin = new Thickness(5),
                VerticalAlignment = VerticalAlignment.Center,
            };

            TextBlock packageStatusTextBlock = new TextBlock()
            {
                Text = downloadStatus,
                Margin = new Thickness(5),
                VerticalAlignment = VerticalAlignment.Center,
            };

            Button packageDownloadButton = new Button()
            {
                Content = "Download",
                IsEnabled = canDownload(package),
            };

            // event handler for Download button
            packageDownloadButton.Click += async (sender, e) =>
            {
                // queue up the package for download
                // requires offlineMapsManagement capability (see Package.appxmanifest)
                OfflineMapPackageStartDownloadResult result = await package.RequestStartDownloadAsync();

                // show any error
                if (result.Status != OfflineMapPackageStartDownloadStatus.Success)
                {
                    packageStatusTextBlock.Text = result.Status.ToString();
                }
            };

            // listen for package status changes and update the UI (download status, download button enable/disable)
            package.StatusChanged += async (sender, args) =>
            {
                // event might not be on the UI thread, so marshal if we need to update UI
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    packageStatusTextBlock.Text = package.Status.ToString();
                    packageDownloadButton.IsEnabled = canDownload(package);
                });
            };

            Grid.SetRow(packageNameTextBlock, resultsGrid.RowDefinitions.Count);
            Grid.SetColumn(packageNameTextBlock, 0);

            Grid.SetRow(packageStatusTextBlock, resultsGrid.RowDefinitions.Count);
            Grid.SetColumn(packageStatusTextBlock, 1);

            Grid.SetRow(packageDownloadButton, resultsGrid.RowDefinitions.Count);
            Grid.SetColumn(packageDownloadButton, 2);

            resultsGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            resultsGrid.Children.Add(packageNameTextBlock);
            resultsGrid.Children.Add(packageStatusTextBlock);
            resultsGrid.Children.Add(packageDownloadButton);
        }

static bool canDownload ( OfflineMapPackage package ) [inline, static, private]

Definition at line 137 of file Scenario8.xaml.cs.

        {
            // we can start a download if the package isn't downloaded or it's currently being deleted
            return package.Status == OfflineMapPackageStatus.NotDownloaded || package.Status == OfflineMapPackageStatus.Deleting;
        }

async void CopyFileButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario8_Copy.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                try
                {
                    StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
                    StorageFile fileCopy = await file.CopyAsync(picturesLibrary, "sample - Copy.dat", NameCollisionOption.ReplaceExisting);
                    rootPage.NotifyUser($"The file '{file.Name}' was copied and the new file was named '{fileCopy.Name}'.", NotifyType.StatusMessage);
                }
                catch (FileNotFoundException)
                {
                    rootPage.NotifyUserFileNotExist();
                }
                catch (Exception ex)
                {
                    // I/O errors are reported as exceptions.
                    rootPage.NotifyUser($"Error copying file '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

void CoreWetStrokeUpdateSource_WetStrokeCanceled | ( | CoreWetStrokeUpdateSource | sender,
 |  | CoreWetStrokeUpdateEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 133 of file Scenario8.xaml.cs.

        {
            followCircle = false;
            discontinueStroke = false;
            disableFollowCircle = false;
        }

void CoreWetStrokeUpdateSource_WetStrokeCompleted | ( | CoreWetStrokeUpdateSource | sender,
 |  | CoreWetStrokeUpdateEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 127 of file Scenario8.xaml.cs.

        {
            followCircle = false;
            discontinueStroke = false;
        }

void CoreWetStrokeUpdateSource_WetStrokeContinuing | ( | CoreWetStrokeUpdateSource | sender,
 |  | CoreWetStrokeUpdateEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 101 of file Scenario8.xaml.cs.

        {
            if (followCircle)
            {
                HandleFollowCircleInput(args);
            }
            else
            {
                HandleRegularInput(args);
            }
        }

void CoreWetStrokeUpdateSource_WetStrokeStarting | ( | CoreWetStrokeUpdateSource | sender,
 |  | CoreWetStrokeUpdateEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 87 of file Scenario8.xaml.cs.

        {
            followCircle = disableFollowCircle ? false : FollowCircleTest(args);
            if (followCircle)
            {
                HandleFollowCircleInput(args);
            }
            else
            {
                disableFollowCircle = true;
                HandleRegularInput(args);
            }
        }

void CoreWetStrokeUpdateSource_WetStrokeStopping | ( | CoreWetStrokeUpdateSource | sender,
 |  | CoreWetStrokeUpdateEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 113 of file Scenario8.xaml.cs.

        {
            if (followCircle)
            {
                HandleFollowCircleInput(args);
            }
            else
            {
                HandleRegularInput(args);
            }

            disableFollowCircle = false;
        }

double DistanceFromCenter ( Point position ) [inline, private]

Definition at line 212 of file Scenario8.xaml.cs.

        {
            return Math.Sqrt((position.X - circleCenter.X) * (position.X - circleCenter.X) +
                             (position.Y - circleCenter.Y) * (position.Y - circleCenter.Y));
        }

async void findAtCenterButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This method finds all available Offline Map packages at the map center geopoint.

Definition at line 37 of file Scenario8.xaml.cs.

        {
            resultsGrid.Children.Clear();
            resultsGrid.RowDefinitions.Clear();
            resultStatusTextBlock.Text = "";

            OfflineMapPackageQueryResult result = await OfflineMapPackage.FindPackagesAsync(myMap.Center);

            if (result.Status != OfflineMapPackageQueryStatus.Success)
            {
                resultStatusTextBlock.Text = "Error: " + result.Status;
            }
            else if (result.Packages.Count == 0)
            {
                resultStatusTextBlock.Text = "No maps found";
            }
            else
            {
                foreach (OfflineMapPackage package in result.Packages)
                {
                    addToResultGrid(package);
                }
            }
        }

bool FollowCircleTest ( CoreWetStrokeUpdateEventArgs args ) [inline, private]

Definition at line 140 of file Scenario8.xaml.cs.

        {
            var position = args.NewInkPoints[0].Position;
            var distanceFromCenter = DistanceFromCenter(position);

            return InCircleEdgeZone(distanceFromCenter);
        }

Platform::String GetAppLanguagesAsFormattedString ( ) [inline, private]

Definition at line 130 of file scenario8.xaml.cs.

        {
            return String.Join(", ", ApplicationLanguages.Languages);
        }

void HandleFollowCircleInput ( CoreWetStrokeUpdateEventArgs args ) [inline, private]

Definition at line 148 of file Scenario8.xaml.cs.

        {
            if (!discontinueStroke)
            {
                for (int i = 0; i < args.NewInkPoints.Count; i++)
                {
                    var position = args.NewInkPoints[i].Position;
                    var distanceFromCenter = DistanceFromCenter(position);

                    if (InCircleEdgeZone(distanceFromCenter))
                    {
                        // Calculate position of new InkPoint so that it lies on the edge of the circle
                        var radians = Math.Atan2(position.Y - circleCenter.Y, position.X - circleCenter.X);
                        var totalRadius = (radius + circleStrokeThickness / 2.0f + penSize / 2.0f);
                        Point newPoint = new Point((Math.Cos(radians) * totalRadius) + circleCenter.X, (Math.Sin(radians) * totalRadius) + circleCenter.Y);

                        args.NewInkPoints[i] = new InkPoint(newPoint, 0.5f);
                    }
                    else
                    {
                        // InkPoint is not in the follow circle zone, add no more InkPoints to Stroke
                        discontinueStroke = true;

                        for (int j = args.NewInkPoints.Count - 1; j >= i; j--)
                        {
                            args.NewInkPoints.RemoveAt(j);
                        }
                        break;
                    }
                }
            }
            else
            {
                // Stroke has been discontinued, remove all InkPoints
                for (int j = args.NewInkPoints.Count - 1; j >= 0; j--)
                {
                    args.NewInkPoints.RemoveAt(j);
                }
            }
        }

void HandleRegularInput ( CoreWetStrokeUpdateEventArgs args ) [inline, private]

Definition at line 189 of file Scenario8.xaml.cs.

        {
            for (int i = 0; i < args.NewInkPoints.Count; i++)
            {
                var position = args.NewInkPoints[i].Position;
                var distanceFromCenter = DistanceFromCenter(position);

                if (distanceFromCenter < radius + circleStrokeThickness / 2 + penSize / 2)
                {
                    // Ink input entered the circle. Handle this by removing remaining InkPoints
                    // and completing the stroke.

                    for (int j = args.NewInkPoints.Count - 1; j >= i; j--)
                    {
                        args.NewInkPoints.RemoveAt(j);
                    }

                    args.Disposition = CoreWetStrokeDisposition.Completed;
                    break;
                }
            }
        }

bool InCircleEdgeZone ( double distanceFromCenter ) [inline, private]

Definition at line 218 of file Scenario8.xaml.cs.

        {
            return (distanceFromCenter > radius * 0.8) && (distanceFromCenter < radius * 1.5);
        }

void InkStackPanel_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario8.xaml.cs.

        {
            inkCanvas.Width = InkStackPanel.ActualWidth;
            inkCanvas.Height = InkStackPanel.ActualHeight;

            circleCenter = new Point(inkCanvas.Width / 2.0f, inkCanvas.Height / 2.0f);
            InkCircle.Center = circleCenter;
            InkCircle.RadiusX = radius;
            InkCircle.RadiusY = radius;
            InkCirclePath.StrokeThickness = circleStrokeThickness;
        }

void LanguageOverrideCombo_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file scenario8.xaml.cs.

        {
            var combo = sender as ComboBox;
            var item = combo.SelectedValue as ComboBoxItem;
            var languageTag = item.Tag as string;

            // Ignore the divider (tag = "-")
            if (languageTag == "-")
            {
                combo.SelectedIndex = lastSelectedIndex;
            }
            else
            {
                lastSelectedIndex = combo.SelectedIndex;

                // Set the persistent language override
                ApplicationLanguages.PrimaryLanguageOverride = languageTag;

                // update current app languages message
                UpdateCurrentAppLanguageMessage();
            }
        }

void myMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 28 of file Scenario8.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 12;
        }

static long nearestMegabyte ( ulong bytes ) [inline, static, private]

Definition at line 132 of file Scenario8.xaml.cs.

        {
            return (long)Math.Round(bytes / (1024.0 * 1024.0));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 54 of file Scenario8.xaml.cs.

        {
            // Registering handlers for Wet Stroke events
            coreWetStrokeUpdateSource = CoreWetStrokeUpdateSource.Create(inkCanvas.InkPresenter);
            coreWetStrokeUpdateSource.WetStrokeStarting += CoreWetStrokeUpdateSource_WetStrokeStarting;
            coreWetStrokeUpdateSource.WetStrokeContinuing += CoreWetStrokeUpdateSource_WetStrokeContinuing;
            coreWetStrokeUpdateSource.WetStrokeStopping += CoreWetStrokeUpdateSource_WetStrokeStopping;
            coreWetStrokeUpdateSource.WetStrokeCompleted += CoreWetStrokeUpdateSource_WetStrokeCompleted;
            coreWetStrokeUpdateSource.WetStrokeCanceled += CoreWetStrokeUpdateSource_WetStrokeCanceled;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario8_Copy.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 65 of file Scenario8.xaml.cs.

        {
            // Unegistering handlers for Wet Stroke events
            coreWetStrokeUpdateSource.WetStrokeStarting -= CoreWetStrokeUpdateSource_WetStrokeStarting;
            coreWetStrokeUpdateSource.WetStrokeContinuing -= CoreWetStrokeUpdateSource_WetStrokeContinuing;
            coreWetStrokeUpdateSource.WetStrokeStopping -= CoreWetStrokeUpdateSource_WetStrokeStopping;
            coreWetStrokeUpdateSource.WetStrokeCompleted -= CoreWetStrokeUpdateSource_WetStrokeCompleted;
            coreWetStrokeUpdateSource.WetStrokeCanceled -= CoreWetStrokeUpdateSource_WetStrokeCanceled;
        }

void PopulateComboBox ( ) [inline, private]

Definition at line 79 of file scenario8.xaml.cs.

        {
            // First show the default setting
            LanguageOverrideCombo.Items.Add(new ComboBoxItem { Content = "Use language preferences (recommended)", Tag = "" });
            LanguageOverrideCombo.SelectedIndex = 0;

            // If there are app languages that the user speaks, show them next

            // Note: the first (non-override) language, if set as the primary language override
            // would give the same result as not having any primary language override. There's
            // still a difference, though: If the user changes their language preferences, the
            // default setting (no override) would mean that the actual primary app language
            // could change. But if it's set as an override, then it will remain the primary
            // app language after the user changes their language preferences.

            foreach (var languageTag in ApplicationLanguages.Languages)
            {
                AddItemForLanguageTag(languageTag);
            }

            // Now add a divider followed by all the app manifest languages (in case the user
            // wants to pick a language not currently in their profile)

            // NOTE: If an app is deployed using a bundle with resource packages, the following
            // addition to the list may not be useful: The set of languages returned by
            // ApplicationLanguages.ManifestLanguages will consist of only those manifest
            // languages in the main app package or in the resource packages that are installed
            // and registered for the current user. Language resource packages get deployed for
            // the user if the language is in the user's profile. Therefore, the only difference
            // from the set returned by ApplicationLanguages.Languages above would depend on
            // which languages are included in the main app package.

            LanguageOverrideCombo.Items.Add(new ComboBoxItem { Content = "——————", Tag = "-" });

            // In a production app, this list should be sorted, but that's beyond the
            // focus of this sample.
            foreach (var languageTag in ApplicationLanguages.ManifestLanguages)
            {
                AddItemForLanguageTag(languageTag);
            }

            LanguageOverrideCombo.SelectionChanged += LanguageOverrideCombo_SelectionChanged;

            lastSelectedIndex = LanguageOverrideCombo.SelectedIndex;
        }

void ShowText ( ) [inline, private]

Definition at line 36 of file scenario8.xaml.cs.

        {
            ResourceContext defaultContextForCurrentView = ResourceContext.GetForCurrentView();
            ResourceMap stringResourcesResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
            Scenario8MessageTextBlock.Text = stringResourcesResourceMap.GetValue("string1", defaultContextForCurrentView).ValueAsString;
        }

void UpdateCurrentAppLanguageMessage ( ) [inline, private]

Definition at line 125 of file scenario8.xaml.cs.

        {
            this.Scenario8AppLanguagesTextBlock.Text = "Current app language(s): " + GetAppLanguagesAsFormattedString();
        }

Member Data Documentation

Point circleCenter [private]

Definition at line 30 of file Scenario8.xaml.cs.

const float circleStrokeThickness = 2.0f [private]

Definition at line 28 of file Scenario8.xaml.cs.

CoreWetStrokeUpdateSource coreWetStrokeUpdateSource [private]

Definition at line 32 of file Scenario8.xaml.cs.

bool disableFollowCircle = false [private]

Definition at line 41 of file Scenario8.xaml.cs.

bool discontinueStroke = false [private]

Definition at line 38 of file Scenario8.xaml.cs.

bool followCircle = false [private]

Definition at line 35 of file Scenario8.xaml.cs.

int lastSelectedIndex [private]

Definition at line 27 of file scenario8.xaml.cs.

const float penSize = 4.0f [private]

Definition at line 29 of file Scenario8.xaml.cs.

const float radius = 150.0f [private]

Definition at line 27 of file Scenario8.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario8_Copy.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario8.xaml.cs
  • FileAccess/cs/Scenario8_Copy.xaml.cs
  • SimpleInk/cs/Scenario8.xaml.cs
  • MapControl/cs/Scenario8.xaml.cs
  • ApplicationResources/cpp/scenario8.xaml.cpp
  • FileAccess/cpp/Scenario8_Copy.xaml.cpp
  • MapControl/cpp/Scenario8.xaml.cpp
  • SimpleInk/cpp/Scenario8.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_CaptureBitmap Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_CaptureBitmap
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions

Scenario8_CaptureBitmap Class Reference

List of all members.

Public Member Functions

Scenario8_CaptureBitmap ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | CaptureButton_Click ()

Static Private Member Functions

static async Task< BitmapSource > | CreateScaledBitmapFromStreamAsync (int width, int height, IRandomAccessStream source)

Detailed Description

Definition at line 27 of file Scenario8_CaptureBitmap.xaml.cs.

Constructor & Destructor Documentation

Scenario8_CaptureBitmap ( ) [inline]

Definition at line 29 of file Scenario8_CaptureBitmap.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void CaptureButton_Click ( ) [inline, private]

Captures the WebView into a bitmap.

Parameters:
sender
e

Definition at line 44 of file Scenario8_CaptureBitmap.xaml.cs.

        {
            InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();
            await WebViewControl.CapturePreviewToStreamAsync(stream);

            // Scale the bitmap to the space available for the thumbnail image,
            // preserving aspect ratio.
            double thumbnailWidth = ThumbnailImage.Width;
            double thumbnailHeight = ThumbnailImage.Height;
            double webViewControlWidth = WebViewControl.ActualWidth;
            double webViewControlHeight = WebViewControl.ActualHeight;
            if (thumbnailWidth == 0 || thumbnailHeight == 0 ||
                webViewControlWidth == 0 || webViewControlHeight == 0)
            {
                // Avoid 0x0 bitmaps, which cause all sorts of problems.
                return;
            }

            double horizontalScale = thumbnailWidth / webViewControlWidth;
            double verticalScale = thumbnailHeight / webViewControlHeight;
            double scale = Math.Min(horizontalScale, verticalScale);
            int width = (int)(webViewControlWidth * scale);
            int height = (int)(webViewControlHeight * scale);
            BitmapSource thumbnailBitmap = await CreateScaledBitmapFromStreamAsync(width, height, stream);

            ThumbnailImage.Source = thumbnailBitmap;
        }

static async Task<BitmapSource> CreateScaledBitmapFromStreamAsync | ( | int | width,
 |  | int | height,
 |  | IRandomAccessStream | source |
 | ) |  |  | [inline, static, private]

Definition at line 72 of file Scenario8_CaptureBitmap.xaml.cs.

        {
            WriteableBitmap bitmap = new WriteableBitmap(width, height);
            BitmapDecoder decoder = await BitmapDecoder.CreateAsync(source);
            BitmapTransform transform = new BitmapTransform();
            transform.ScaledHeight = (uint)height;
            transform.ScaledWidth = (uint)width;
            PixelDataProvider pixelData = await decoder.GetPixelDataAsync(
                BitmapPixelFormat.Bgra8,
                BitmapAlphaMode.Straight,
                transform,
                ExifOrientationMode.RespectExifOrientation,
                ColorManagementMode.DoNotColorManage);
            pixelData.DetachPixelData().CopyTo(bitmap.PixelBuffer);
            return bitmap;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario8_CaptureBitmap.xaml.cs.

        {
            WebViewControl.Navigate(new Uri("http://www.bing.com"));
        }

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario8_CaptureBitmap.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_PairDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_PairDevice
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario8_PairDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario8_PairDevice ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnDeviceListChanged (DeviceWatcher sender, string id)
async void | PairButton_Click (object sender, RoutedEventArgs e)
void | ResultsListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | StartWatcher ()
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)
async void | UnpairButton_Click (object sender, RoutedEventArgs e)
void | UpdatePairingButtons ()

Private Attributes

DeviceWatcherHelper deviceWatcherHelper
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 19 of file Scenario8_PairDevice.xaml.cs.

Constructor & Destructor Documentation

Scenario8_PairDevice ( ) [inline]

Definition at line 27 of file Scenario8_PairDevice.xaml.cs.

        {
            this.InitializeComponent();

            deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
            deviceWatcherHelper.DeviceChanged += OnDeviceListChanged;
        }

Member Function Documentation

void OnDeviceListChanged | ( | DeviceWatcher | sender,
 |  | string | id |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario8_PairDevice.xaml.cs.

        {
            // If the item being updated is currently "selected", then update the pairing buttons
            DeviceInformationDisplay selectedDeviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
            if ((selectedDeviceInfoDisp != null) && (selectedDeviceInfoDisp.Id == id))
            {
                UpdatePairingButtons();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario8_PairDevice.xaml.cs.

        {
            deviceWatcherHelper.Reset();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 35 of file Scenario8_PairDevice.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;

            selectorComboBox.ItemsSource = DeviceSelectorChoices.PairingSelectors;
            selectorComboBox.SelectedIndex = 0;
        }

async void PairButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario8_PairDevice.xaml.cs.

        {
            // Gray out the pair button and results view while pairing is in progress.
            resultsListView.IsEnabled = false;
            pairButton.IsEnabled = false;
            rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);

            DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;

            DevicePairingResult dpr = await deviceInfoDisp.DeviceInformation.Pairing.PairAsync();

            rootPage.NotifyUser(
                "Pairing result = " + dpr.Status.ToString(),
                dpr.Status == DevicePairingResultStatus.Paired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);

            UpdatePairingButtons();
            resultsListView.IsEnabled = true;
        }

void ResultsListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 148 of file Scenario8_PairDevice.xaml.cs.

        {
            UpdatePairingButtons();
        }

void StartWatcher ( ) [inline, private]

Definition at line 58 of file Scenario8_PairDevice.xaml.cs.

        {
            startWatcherButton.IsEnabled = false;
            resultCollection.Clear();

            // Get the device selector chosen by the UI then add additional constraints for devices that
            // can be paired or are already paired.
            DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;
            string selector = "(" + deviceSelectorInfo.Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";

            DeviceWatcher deviceWatcher;
            if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
            {
                // Kind will be determined by the selector
                deviceWatcher = DeviceInformation.CreateWatcher(
                    selector,
                    null // don't request additional properties for this sample
                    );
            }
            else
            {
                // Kind is specified in the selector info
                deviceWatcher = DeviceInformation.CreateWatcher(
                    selector,
                    null, // don't request additional properties for this sample
                    deviceSelectorInfo.Kind);
            }

            rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
            deviceWatcherHelper.StartWatcher(deviceWatcher);
            stopWatcherButton.IsEnabled = true;
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario8_PairDevice.xaml.cs.

        {
            StartWatcher();
        }

void StopWatcher ( ) [inline, private]

Definition at line 91 of file Scenario8_PairDevice.xaml.cs.

        {
            stopWatcherButton.IsEnabled = false;

            deviceWatcherHelper.StopWatcher();

            startWatcherButton.IsEnabled = true;
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file Scenario8_PairDevice.xaml.cs.

        {
            StopWatcher();
        }

async void UnpairButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file Scenario8_PairDevice.xaml.cs.

        {
            // Gray out the unpair button and results view while unpairing is in progress.
            resultsListView.IsEnabled = false;
            unpairButton.IsEnabled = false;
            rootPage.NotifyUser("Unpairing started. Please wait...", NotifyType.StatusMessage);

            DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;

            DeviceUnpairingResult dupr = await deviceInfoDisp.DeviceInformation.Pairing.UnpairAsync();

            rootPage.NotifyUser(
                "Unpairing result = " + dupr.Status.ToString(),
                dupr.Status == DeviceUnpairingResultStatus.Unpaired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);

            UpdatePairingButtons();
            resultsListView.IsEnabled = true;
        }

void UpdatePairingButtons ( ) [inline, private]

Definition at line 153 of file Scenario8_PairDevice.xaml.cs.

        {
            DeviceInformationDisplay deviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;

            if (null != deviceInfoDisp &&
                deviceInfoDisp.DeviceInformation.Pairing.CanPair &&
                !deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
            {
                pairButton.IsEnabled = true;
            }
            else
            {
                pairButton.IsEnabled = false;
            }

            if (null != deviceInfoDisp &&
                deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
            {
                unpairButton.IsEnabled = true;
            }
            else
            {
                unpairButton.IsEnabled = false;
            }
        }

Member Data Documentation

DeviceWatcherHelper deviceWatcherHelper [private]

Definition at line 23 of file Scenario8_PairDevice.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 25 of file Scenario8_PairDevice.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario8_PairDevice.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario8_PairDevice.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_TransferMediaPlayer1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_TransferMediaPlayer1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario8_TransferMediaPlayer1 Class Reference

This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...

List of all members.

Public Member Functions

Scenario8_TransferMediaPlayer1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CreateMediaPlayer_Click (object sender, RoutedEventArgs e)
void | OnNavigatedFrom (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

The MediaPlayer created on this page can continue to play in the background, then be rebound to another scenario page.

Definition at line 24 of file Scenario8_TransferMediaPlayer1.xaml.cs.

Constructor & Destructor Documentation

Scenario8_TransferMediaPlayer1 ( ) [inline]

Definition at line 28 of file Scenario8_TransferMediaPlayer1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CreateMediaPlayer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file Scenario8_TransferMediaPlayer1.xaml.cs.

        {
            if (rootPage.commonMediaPlayer == null)
            {
                rootPage.commonMediaPlayer = new Windows.Media.Playback.MediaPlayer();
                rootPage.commonMediaPlayer.AutoPlay = true;
                rootPage.commonMediaPlayer.Source = Windows.Media.Core.MediaSource.CreateFromUri(rootPage.CaptionedMediaUri);

                mediaPlayerElement.SetMediaPlayer(rootPage.commonMediaPlayer);
                rootPage.NotifyUser("Created MediaPlayer.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("MediaPlayer already exists.", NotifyType.ErrorMessage);
            }
        }

void OnNavigatedFrom | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 37 of file Scenario8_TransferMediaPlayer1.xaml.cs.

        {
            // Detach the MediaPlayer from the MediaPlayerElement, but do not dispose it.
            // The MediaPlayer will continue to run, and it can be attached to another MediaPlayerElement.
            mediaPlayerElement.SetMediaPlayer(null);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 32 of file Scenario8_TransferMediaPlayer1.xaml.cs.

        {
            // Attach any existing MediaPlayer to the MediaPlayerElement on this page.
            mediaPlayerElement.SetMediaPlayer(rootPage.commonMediaPlayer);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario8_TransferMediaPlayer1.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlayback/cs/Scenario8_TransferMediaPlayer1.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_TransmitAPDU Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_TransmitAPDU
Public Member Functions | Private Member Functions | Private Attributes

Scenario8_TransmitAPDU Class Reference

List of all members.

Public Member Functions

Scenario8_TransmitAPDU ()

Private Member Functions

async void Transmit_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 10 of file Scenario8_TransmitAPDU.xaml.cs.

Constructor & Destructor Documentation

Scenario8_TransmitAPDU ( ) [inline]

Definition at line 14 of file Scenario8_TransmitAPDU.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Transmit_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Click handler for the 'TransmitAPDU' button.

Parameters:
sender
e

Definition at line 24 of file Scenario8_TransmitAPDU.xaml.cs.

        {
            if (!rootPage.ValidateTPMSmartCard())
            {
                rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
                return;
            }

            Button b = sender as Button;
            b.IsEnabled = false;

            try
            {
                SmartCard card = await rootPage.GetSmartCard();

                IBuffer result = null;

                using (SmartCardConnection connection = await card.ConnectAsync())
                {
                    // Read EF.ATR file
                    // The command is meant specifically for GIDS cards
                    // (such as TPM VSCs), and will fail on other types.
                    byte[] readEfAtrBytes = { 0x00, 0xCB, 0x2F, 0x01, 0x02, 0x5C, 0x00, 0xFF };

                    IBuffer readEfAtr = CryptographicBuffer.CreateFromByteArray(readEfAtrBytes);

                    result = await connection.TransmitAsync(readEfAtr);

                    rootPage.NotifyUser("Response: " + CryptographicBuffer.EncodeToHexString(result), NotifyType.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Transmitting APDU to card failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            finally
            {
                b.IsEnabled = true;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 12 of file Scenario8_TransmitAPDU.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario8_TransmitAPDU.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_UpdateAsync Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_UpdateAsync
Public Member Functions | Private Member Functions | Private Attributes

Scenario8_UpdateAsync Class Reference

List of all members.

Public Member Functions

Scenario8_UpdateAsync ()

Private Member Functions

async void UpdateDefaultLogo_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 18 of file Scenario8_UpdateAsync.xaml.cs.

Constructor & Destructor Documentation

Scenario8_UpdateAsync ( ) [inline]

Definition at line 22 of file Scenario8_UpdateAsync.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void UpdateDefaultLogo_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 27 of file Scenario8_UpdateAsync.xaml.cs.

        {
            if (SecondaryTile.Exists(MainPage.logoSecondaryTileId))
            {
                // Add the properties we want to update (logo in this example)
                SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId);
                secondaryTile.VisualElements.Square150x150Logo = new Uri("ms-appx:///Assets/squareTileLogoUpdate-sdk.png");
                bool isUpdated = await secondaryTile.UpdateAsync();

                if (isUpdated)
                {
                    rootPage.NotifyUser("Secondary tile logo updated.", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser("Secondary tile logo not updated.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Please pin a secondary tile using scenario 1 before updating the logo.", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 20 of file Scenario8_UpdateAsync.xaml.cs.

The documentation for this class was generated from the following file:
  • SecondaryTiles/cs/Scenario8_UpdateAsync.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_VisitsBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario8_VisitsBackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario8_VisitsBackgroundTask Class Reference

List of all members.

Public Member Functions

Scenario8_VisitsBackgroundTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | FillEventListBoxWithExistingEvents ()
async void | OnCompleted (IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
async void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UpdateButtonStates ()

Private Attributes

MainPage _rootPage = MainPage.Current
IBackgroundTaskRegistration | _visitTask = null
const string | BackgroundTaskEntryPoint = "BackgroundTask.VisitBackgroundTask"
const string | BackgroundTaskName = "SampleVisitBackgroundTask"

Detailed Description

Definition at line 24 of file Scenario8_VisitsBackgroundTask.xaml.cs.

Constructor & Destructor Documentation

Scenario8_VisitsBackgroundTask ( ) [inline]

Definition at line 34 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void FillEventListBoxWithExistingEvents ( ) [inline, private]

Populate events list box with entries from BackgroundVisitEventCollection.

Definition at line 160 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            MainPage.FillItemsFromSavedJson(VisitBackgroundEventsListBox, "BackgroundVisitEventCollection");
        }

async void OnCompleted | ( | IBackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline, private]

This is the callback when background event has been handled.

Parameters:
sender
e

Definition at line 125 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            // Update the UI with progress reported by the background task
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    // Rethrow any exception that occurred in the background task.
                    e.CheckResult();

                    // Update the UI with the completion status of the background task
                    MainPage.ReportSavedStatus();
                    FillEventListBoxWithExistingEvents();
                }
                catch (Exception ex)
                {
                    // The background task had an error
                    _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                }
            });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            // See if our background task is already registered.
            _visitTask = MainPage.LookupBackgroundTask(BackgroundTaskName);

            if (_visitTask != null)
            {
                // Associate an event handler with the existing background task
                _visitTask.Completed += OnCompleted;

                FillEventListBoxWithExistingEvents();
            }
            UpdateButtonStates();
        }

async void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Register' button.

Parameters:
sender
e

Definition at line 59 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            // Get permission for a background task from the user. If the user has already answered once,
            // this does nothing and the user must manually update their preference via Settings.
            BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();

            // Regardless of the answer, register the background task. If the user later enables background
            // execution, the background task will be ready to run.
            // Create a new background task builder
            BackgroundTaskBuilder visitTaskBuilder = new BackgroundTaskBuilder();

            visitTaskBuilder.Name = BackgroundTaskName;
            visitTaskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;

            // Create a new visit trigger
            var trigger = new GeovisitTrigger();

            // Set the desired monitoring scope.
            // For higher granularity such as venue/building level changes, choose venue.
            // For lower granularity more or less in the range of zipcode level changes, choose city.
            // Choosing Venue here as an example.
            trigger.MonitoringScope = VisitMonitoringScope.Venue;

            // Associate the trigger with the background task builder
            visitTaskBuilder.SetTrigger(trigger);

            // If it is important that there is user presence and/or
            // internet connection when OnCompleted is called
            // the following could be called before calling Register()
            // SystemCondition condition = new SystemCondition(SystemConditionType.UserPresent | SystemConditionType.InternetAvailable);
            // visitTaskBuilder.AddCondition(condition);

            // Register the background task
            _visitTask = visitTaskBuilder.Register();

            // Associate an event handler with the new background task
            _visitTask.Completed += OnCompleted;

            UpdateButtonStates();
            MainPage.CheckBackgroundAndRequestLocationAccess();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Unregister' button.

Parameters:
sender
e

Definition at line 106 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            // Unregister the background task
            if (null != _visitTask)
            {
                _visitTask.Unregister(true);
                _visitTask.Completed -= OnCompleted;
                _visitTask = null;
            }

            _rootPage.NotifyUser("Visit background task unregistered", NotifyType.StatusMessage);
            UpdateButtonStates();
        }

void UpdateButtonStates ( ) [inline, private]

Update the enable state of the register/unregister buttons.

Definition at line 150 of file Scenario8_VisitsBackgroundTask.xaml.cs.

        {
            bool registered = (_visitTask != null);
            RegisterBackgroundTaskButton.IsEnabled = !registered;
            UnregisterBackgroundTaskButton.IsEnabled = registered;
        }

Member Data Documentation

MainPage _rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario8_VisitsBackgroundTask.xaml.cs.

IBackgroundTaskRegistration _visitTask = null [private]

Definition at line 29 of file Scenario8_VisitsBackgroundTask.xaml.cs.

const string BackgroundTaskEntryPoint = "BackgroundTask.VisitBackgroundTask" [private]

Definition at line 27 of file Scenario8_VisitsBackgroundTask.xaml.cs.

const string BackgroundTaskName = "SampleVisitBackgroundTask" [private]

Definition at line 26 of file Scenario8_VisitsBackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • Geolocation/cs/Scenario8_VisitsBackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario9
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario9 Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

List of all members.

Public Member Functions

Scenario9 ()
Scenario9 ()
Scenario9 ()
Scenario9 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | ClearCanvasStrokeCache ()
async void | CompareFilesButton_Click (object sender, RoutedEventArgs e)
InkStrokeContainer | GetCurrentStrokesView (DateTimeOffset time)
InkStroke | GetPartialStroke (InkStroke stroke, DateTimeOffset time)
void | InkPresenter_StrokesCollected (InkPresenter sender, InkStrokesCollectedEventArgs e)
void | InkReplayTimer_Tick (object sender, object e)
void | MyMap_Loaded (object sender, RoutedEventArgs e)
void | OnReplay (object sender, RoutedEventArgs e)
void | OnReset (object sender, RoutedEventArgs e)
void | OnSizeChanged (object sender, SizeChangedEventArgs e)
void | Scenario9Button_Show_Click (object sender, RoutedEventArgs e)
void | SetDefaultStyleCombobox_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | SetMapStyleSheet ()
void | StopReplay ()

Private Attributes

DateTimeOffset | beginTimeOfRecordedSession
DateTime | beginTimeOfReplay
TimeSpan | durationOfRecordedSession
DateTimeOffset | endTimeOfRecordedSession
const int | FPS = 60
DispatcherTimer | inkReplayTimer
MainPage rootPage = MainPage.Current
InkStrokeBuilder | strokeBuilder
IReadOnlyList< InkStroke > | strokesToReplay

Detailed Description

This page demonstrates the usage of the InkPresenter APIs.

Shows how to customize the look and feel of the map.

Comparing two files to see if they are the same file.

It shows the following functionality:

  • Stroke Id and StrokeStartedTime/StrokeDuration properties for each stroke collected.
  • Loading and saving ink files with stroke timestamps.
  • Using stroke timestamps to replay ink.

Definition at line 24 of file scenario9.xaml.cs.

Constructor & Destructor Documentation

Scenario9 ( ) [inline]

Definition at line 30 of file scenario9.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario9 ( ) [inline]

Definition at line 29 of file Scenario9_Compare.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario9 ( ) [inline]

Definition at line 26 of file Scenario9.xaml.cs.

        {
            this.InitializeComponent();
        }

Scenario9 ( ) [inline]

Definition at line 45 of file Scenario9.xaml.cs.

        {
            this.InitializeComponent();

            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
        }

Member Function Documentation

void ClearCanvasStrokeCache ( ) [inline, private]

Definition at line 88 of file Scenario9.xaml.cs.

        {
            // Workaround for builds prior to 17650.
            // Throw away the old inkCanvas and create a new one to avoid accumulation of old strokes.
            outputGrid.Children.Remove(inkCanvas);
            inkCanvas = new InkCanvas();
            outputGrid.Children.Add(inkCanvas);
            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
            inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

async void CompareFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario9_Compare.xaml.cs.

        {
            StorageFile file = rootPage.sampleFile;
            if (file != null)
            {
                FileOpenPicker picker = new FileOpenPicker();
                picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
                picker.FileTypeFilter.Add("*");
                StorageFile comparand = await picker.PickSingleFileAsync();
                if (comparand != null)
                {
                    try
                    {
                        if (file.IsEqual(comparand))
                        {
                            rootPage.NotifyUser("Files are equal", NotifyType.StatusMessage);
                        }
                        else
                        {
                            rootPage.NotifyUser("Files are not equal", NotifyType.StatusMessage);
                        }
                    }
                    catch (FileNotFoundException)
                    {
                        rootPage.NotifyUserFileNotExist();
                    }
                }
                else
                {
                    rootPage.NotifyUser("Operation cancelled", NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUserFileNotExist();
            }
        }

InkStrokeContainer GetCurrentStrokesView ( DateTimeOffset time ) [inline, private]

Definition at line 187 of file Scenario9.xaml.cs.

        {
            var inkStrokeContainer = new InkStrokeContainer();

            // The purpose of this sample is to demonstrate the timestamp usage,
            // not the algorithm. (The time complexity of the code is O(N^2).)
            foreach (InkStroke stroke in strokesToReplay)
            {
                InkStroke s = GetPartialStroke(stroke, time);
                if (s != null)
                {
                    inkStrokeContainer.AddStroke(s);
                }
            }

            return inkStrokeContainer;
        }

InkStroke GetPartialStroke | ( | InkStroke | stroke,
 |  | DateTimeOffset | time |
 | ) |  |  | [inline, private]

Definition at line 205 of file Scenario9.xaml.cs.

        {
            DateTimeOffset? startTime = stroke.StrokeStartedTime;
            TimeSpan? duration = stroke.StrokeDuration;
            if (!startTime.HasValue || !duration.HasValue)
            {
                // If a stroke does not have valid timestamp, then treat it as
                // having been drawn before the playback started.
                // We must return a clone of the stroke, because a single stroke cannot
                // exist in more than one container.
                return stroke.Clone();
            }

            if (time < startTime.Value)
            {
                // Stroke has not started
                return null;
            }

            if (time >= startTime.Value + duration.Value)
            {
                // Stroke has already ended.
                // We must return a clone of the stroke, because a single stroke cannot exist in more than one container.
                return stroke.Clone();
            }

            // Stroke has started but not yet ended.
            // Create a partial stroke on the assumption that the ink points are evenly distributed in time.
            IReadOnlyList<InkPoint> points = stroke.GetInkPoints();
            var portion = (time - startTime.Value).TotalMilliseconds / duration.Value.TotalMilliseconds;
            var count = (int)((points.Count - 1) * portion) + 1;
            return strokeBuilder.CreateStrokeFromInkPoints(points.Take(count), System.Numerics.Matrix3x2.Identity, startTime, time - startTime);
        }

void InkPresenter_StrokesCollected | ( | InkPresenter | sender,
 |  | InkStrokesCollectedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 64 of file Scenario9.xaml.cs.

        {
            IReadOnlyList<InkStroke> strokes = e.Strokes;
            string log = $"Strokes collected: {strokes.Count}";
            foreach (InkStroke stroke in strokes)
            {
                log += $"\nId: {stroke.Id}, StartedTime: {stroke.StrokeStartedTime}, Duration: {stroke.StrokeDuration}";
            }
            rootPage.NotifyUser(log, NotifyType.StatusMessage);
        }

void InkReplayTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 170 of file Scenario9.xaml.cs.

        {
            var currentTimeOfReplay = DateTimeOffset.Now;
            TimeSpan timeElapsedInReplay = currentTimeOfReplay - beginTimeOfReplay;

            ReplayProgress.Value = timeElapsedInReplay.TotalMilliseconds;

            DateTimeOffset timeEquivalentInRecordedSession = beginTimeOfRecordedSession + timeElapsedInReplay;
            inkCanvas.InkPresenter.StrokeContainer = GetCurrentStrokesView(timeEquivalentInRecordedSession);

            if (timeElapsedInReplay > durationOfRecordedSession)
            {
                StopReplay();
                rootPage.NotifyUser("Replay finished.", NotifyType.StatusMessage);
            }
        }

void MyMap_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file Scenario9.xaml.cs.

        {
            myMap.Center = MainPage.SeattleGeopoint;
            myMap.ZoomLevel = 12;
            SetMapStyleSheet();
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Invoked when the user has selected a different scenario and navigation away from this page is about to occur.

Parameters:
e Event data that describes the navigation that has unloaded this page.

Definition at line 50 of file scenario9.xaml.cs.

        {
            // Clearing qualifier value overrides set on the default context for the current
            // view so that an override set here doesn't impact other scenarios. See comments
            // below for additional information.
            ResourceContext.GetForCurrentView().Reset();
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 34 of file Scenario9_Compare.xaml.cs.

        {
            rootPage.ValidateFile();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario9.xaml.cs.

        {
            // Registering handlers for StrokesCollected event
            inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file scenario9.xaml.cs.

        {
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 58 of file Scenario9.xaml.cs.

        {
            StopReplay();
            inkCanvas.InkPresenter.StrokesCollected -= InkPresenter_StrokesCollected;
        }

void OnReplay | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario9.xaml.cs.

        {
            if (strokeBuilder == null)
            {
                strokeBuilder = new InkStrokeBuilder();
                inkReplayTimer = new DispatcherTimer();
                inkReplayTimer.Interval = new TimeSpan(TimeSpan.TicksPerSecond / FPS);
                inkReplayTimer.Tick += InkReplayTimer_Tick;
            }

            strokesToReplay = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();

            ReplayButton.IsEnabled = false;
            inkCanvas.InkPresenter.IsInputEnabled = false;
            ClearCanvasStrokeCache();

            // Calculate the beginning of the earliest stroke and the end of the latest stroke.
            // This establishes the time period during which the strokes were collected.
            beginTimeOfRecordedSession = DateTimeOffset.MaxValue;
            endTimeOfRecordedSession = DateTimeOffset.MinValue;
            foreach (InkStroke stroke in strokesToReplay)
            {
                DateTimeOffset? startTime = stroke.StrokeStartedTime;
                TimeSpan? duration = stroke.StrokeDuration;
                if (startTime.HasValue && duration.HasValue)
                {
                    if (beginTimeOfRecordedSession > startTime.Value)
                    {
                        beginTimeOfRecordedSession = startTime.Value;
                    }
                    if (endTimeOfRecordedSession < startTime.Value + duration.Value)
                    {
                        endTimeOfRecordedSession = startTime.Value + duration.Value;
                    }
                }
            }

            // If we found at least one stroke with a timestamp, then we can replay.
            if (beginTimeOfRecordedSession != DateTimeOffset.MaxValue)
            {
                durationOfRecordedSession = endTimeOfRecordedSession - beginTimeOfRecordedSession;

                ReplayProgress.Maximum = durationOfRecordedSession.TotalMilliseconds;
                ReplayProgress.Value = 0.0;
                ReplayProgress.Visibility = Visibility.Visible;

                beginTimeOfReplay = DateTime.Now;
                inkReplayTimer.Start();

                rootPage.NotifyUser("Replay started.", NotifyType.StatusMessage);
            }
            else
            {
                // There was nothing to replay. Either there were no strokes at all,
                // or none of the strokes had timestamps.
                StopReplay();
            }
        }

void OnReset | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file Scenario9.xaml.cs.

        {
            StopReplay();
            inkCanvas.InkPresenter.StrokeContainer.Clear();
            ClearCanvasStrokeCache();
            rootPage.NotifyUser("Cleared Canvas", NotifyType.StatusMessage);
        }

void OnSizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 75 of file Scenario9.xaml.cs.

        {
            HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
        }

void Scenario9Button_Show_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario9Button_Show' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 65 of file scenario9.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                // A langauge override will be set on the default context for the current view.
                // When navigating between different scenarios in this sample, the content for each
                // scenario is loaded into a host page that remains constant. The view (meaning, the
                // CoreWindow) remains the same, and so it is the same default context that's in use.
                // Thus, an override set here can impact behavior in other scenarios.
                //
                // However, the description for the scenario may give the impression that a value
                // being set is local to this scenario. Also, when entering this scenario, the combo
                // box always gets set to the first item, which can add to the confusion. To avoid
                // confusion when using this sample, the override that gets set here will be cleared
                // when the user navigates away from this scenario (in the OnNavigatedFrom event
                // handler). In a real app, whether and when to clear an override will depend on
                // the desired behaviour and the design of the app.

                var context = ResourceContext.GetForCurrentView();

                var selectedLanguage = Scenario9ComboBox.SelectedValue;
                if (selectedLanguage != null)
                {
                    var lang = new List<string>();
                    lang.Add(selectedLanguage.ToString());
                    context.Languages = lang;
                    var resourceStringMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
                    this.Scenario9TextBlock.Text = resourceStringMap.GetValue("string1", context).ValueAsString;
                }
            }
        }

void SetDefaultStyleCombobox_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario9.xaml.cs.

        {
            // Protect against events that are raised before we are fully initialized.
            if (myMap != null)
            {
                SetMapStyleSheet();
            }
        }

void SetMapStyleSheet ( ) [inline, private]

Definition at line 47 of file Scenario9.xaml.cs.

        {
            switch (setDefaultStyleCombobox.SelectedIndex)
            {
                case 0:
                    myMap.StyleSheet = MapStyleSheet.Aerial();
                    break;
                case 1:
                    myMap.StyleSheet = MapStyleSheet.AerialWithOverlay();
                    break;
                case 2:
                    myMap.StyleSheet = MapStyleSheet.RoadDark();
                    break;
                case 3:
                    myMap.StyleSheet = MapStyleSheet.RoadLight();
                    break;
                case 4:
                    myMap.StyleSheet = MapStyleSheet.RoadHighContrastDark();
                    break;
                case 5:
                    myMap.StyleSheet = MapStyleSheet.RoadHighContrastLight();
                    break;
                case 6:
                    myMap.StyleSheet = MapStyleSheet.ParseFromJson(@"
                        {
                            ""version"": ""1.0"",
                            ""settings"": {
                                ""landColor"": ""#FFFFFF"",
                                ""spaceColor"": ""#000000""
                            },
                            ""elements"": {
                                ""mapElement"": {
                                    ""labelColor"": ""#000000"",
                                    ""labelOutlineColor"": ""#FFFFFF""
                                },
                                ""water"": {
                                    ""fillColor"": ""#DDDDDD""
                                },
                                ""area"": {
                                    ""fillColor"": ""#EEEEEE""
                                },
                                ""political"": {
                                    ""borderStrokeColor"": ""#CCCCCC"",
                                    ""borderOutlineColor"": ""#00000000""
                                }
                            }
                        }
                    ");
                    break;
            }
        }

void StopReplay ( ) [inline, private]

Definition at line 160 of file Scenario9.xaml.cs.

        {
            inkReplayTimer?.Stop();

            ReplayButton.IsEnabled = true;
            inkCanvas.InkPresenter.IsInputEnabled = true;
            ReplayProgress.Visibility = Visibility.Collapsed;

        }

Member Data Documentation

DateTimeOffset beginTimeOfRecordedSession [private]

Definition at line 35 of file Scenario9.xaml.cs.

DateTime beginTimeOfReplay [private]

Definition at line 38 of file Scenario9.xaml.cs.

TimeSpan durationOfRecordedSession [private]

Definition at line 37 of file Scenario9.xaml.cs.

DateTimeOffset endTimeOfRecordedSession [private]

Definition at line 36 of file Scenario9.xaml.cs.

const int FPS = 60 [private]

Definition at line 33 of file Scenario9.xaml.cs.

DispatcherTimer inkReplayTimer [private]

Definition at line 40 of file Scenario9.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file scenario9.xaml.cs.

InkStrokeBuilder strokeBuilder [private]

Definition at line 42 of file Scenario9.xaml.cs.

IReadOnlyList<InkStroke> strokesToReplay [private]

Definition at line 43 of file Scenario9.xaml.cs.

The documentation for this class was generated from the following files:
  • ApplicationResources/cs/scenario9.xaml.cs
  • FileAccess/cs/Scenario9_Compare.xaml.cs
  • SimpleInk/cs/Scenario9.xaml.cs
  • MapControl/cs/Scenario9.xaml.cs
  • FileAccess/cpp/Scenario9_Compare.xaml.cpp
  • MapControl/cpp/Scenario9.xaml.cpp
  • SimpleInk/cpp/Scenario9.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_ContainsFullScreenElement Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario9_ContainsFullScreenElement
Public Member Functions | Protected Member Functions | Private Member Functions

Scenario9_ContainsFullScreenElement Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario9_ContainsFullScreenElement ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | WebViewControl_ContainsFullScreenElementChanged (WebView sender, object args)

Detailed Description

Definition at line 22 of file Scenario9_ContainsFullScreenElement.xaml.cs.

Constructor & Destructor Documentation

Scenario9_ContainsFullScreenElement ( ) [inline]

Definition at line 24 of file Scenario9_ContainsFullScreenElement.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario9_ContainsFullScreenElement.xaml.cs.

        {
            WebViewControl.Navigate(new Uri("https://www.youtube.com/watch?v=XVfOe5mFbAE"));
        }

void WebViewControl_ContainsFullScreenElementChanged | ( | WebView | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 34 of file Scenario9_ContainsFullScreenElement.xaml.cs.

        {
            var applicationView = ApplicationView.GetForCurrentView();

            if (sender.ContainsFullScreenElement)
            {
                applicationView.TryEnterFullScreenMode();
            }
            else
            {
                // It is harmless to exit full screen mode when not full screen.
                applicationView.ExitFullScreenMode();
            }

        }

The documentation for this class was generated from the following file:
  • XamlWebView/cs/Scenario9_ContainsFullScreenElement.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_CustomPairDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario9_CustomPairDevice
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario9_CustomPairDevice Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario9_CustomPairDevice ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CompleteConfirmPinTask (bool accept)
void | CompletePasswordCredential (string username=null, string password=null)
void | CompleteProvidePinTask (string pin=null)
async Task< PasswordCredential > | GetPasswordCredentialFromUserAsync ()
async Task< string > | GetPinFromUserAsync ()
DevicePairingKinds | GetSelectedCeremonies ()
async Task< bool > | GetUserConfirmationAsync (string pin)
void | HidePairingPanel ()
void | noButton_Click (object sender, RoutedEventArgs e)
void | okButton_Click (object sender, RoutedEventArgs e)
void | OnDeviceListChanged (DeviceWatcher sender, string id)
async void | PairButton_Click (object sender, RoutedEventArgs e)
async void | PairingRequestedHandler (DeviceInformationCustomPairing sender, DevicePairingRequestedEventArgs args)
void | ResultsListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | ShowPairingPanel (string text, DevicePairingKinds pairingKind)
void | StartWatcher ()
void | StartWatcherButton_Click (object sender, RoutedEventArgs e)
void | StopWatcher ()
void | StopWatcherButton_Click (object sender, RoutedEventArgs e)
async void | UnpairButton_Click (object sender, RoutedEventArgs e)
void | UpdatePairingButtons ()
void | verifyButton_Click (object sender, RoutedEventArgs e)
void | yesButton_Click (object sender, RoutedEventArgs e)

Private Attributes

TaskCompletionSource< bool > | confirmPinTaskSrc
DeviceWatcherHelper deviceWatcherHelper
TaskCompletionSource
< PasswordCredential > 		providePasswordCredential
TaskCompletionSource< string > | providePinTaskSrc
ObservableCollection
< DeviceInformationDisplay > 		resultCollection = new ObservableCollection<DeviceInformationDisplay>()
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario9_CustomPairDevice.xaml.cs.

Constructor & Destructor Documentation

Scenario9_CustomPairDevice ( ) [inline]

Definition at line 33 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            this.InitializeComponent();

            deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
            deviceWatcherHelper.DeviceChanged += OnDeviceListChanged;
        }

Member Function Documentation

void CompleteConfirmPinTask ( bool accept ) [inline, private]

Definition at line 361 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            if (confirmPinTaskSrc != null)
            {
                confirmPinTaskSrc.SetResult(accept);
                confirmPinTaskSrc = null;
            }
        }

void CompletePasswordCredential | ( | string | username = null,
 |  | string | password = null |
 | ) |  |  | [inline, private]

Definition at line 330 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            if (providePasswordCredential != null)
            {
                if (String.IsNullOrEmpty(username))
                {
                    providePasswordCredential.SetResult(null);
                }
                else
                {
                    providePasswordCredential.SetResult(new PasswordCredential() { UserName = username, Password = password });
                }
                providePasswordCredential = null;
            }
        }

void CompleteProvidePinTask ( string pin = null ) [inline, private]

Definition at line 307 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            if (providePinTaskSrc != null)
            {
                providePinTaskSrc.SetResult(pin);
                providePinTaskSrc = null;
            }
        }

concurrency::task< PasswordCredential^> GetPasswordCredentialFromUserAsync ( ) [inline, private]

Definition at line 316 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            HidePairingPanel();
            CompletePasswordCredential(); // Abandon any previous pin request.

            ShowPairingPanel(
                "Please enter the username and password",
                DevicePairingKinds.ProvidePasswordCredential);

            providePasswordCredential = new TaskCompletionSource<PasswordCredential>();

            return await providePasswordCredential.Task;
        }

concurrency::task< Platform::String^> GetPinFromUserAsync ( ) [inline, private]

Definition at line 292 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            HidePairingPanel();
            CompleteProvidePinTask(); // Abandon any previous pin request.

            ShowPairingPanel(
                "Please enter the PIN shown on the device you're pairing with",
                DevicePairingKinds.ProvidePin);

            providePinTaskSrc = new TaskCompletionSource<string>();

            return await providePinTaskSrc.Task;
        }

DevicePairingKinds GetSelectedCeremonies ( ) [inline, private]

Definition at line 396 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            DevicePairingKinds ceremonySelection = DevicePairingKinds.None;
            if (confirmOnlyOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ConfirmOnly;
            if (displayPinOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.DisplayPin;
            if (providePinOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ProvidePin;
            if (confirmPinMatchOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ConfirmPinMatch;
            if (passwordCredentialOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ProvidePasswordCredential;
            return ceremonySelection;
        }

async Task<bool> GetUserConfirmationAsync ( string pin ) [inline, private]

Definition at line 346 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            HidePairingPanel();
            CompleteConfirmPinTask(false); // Abandon any previous request.

            ShowPairingPanel(
                "Does the following PIN match the one shown on the device you are pairing?: " + pin,
                DevicePairingKinds.ConfirmPinMatch);

            confirmPinTaskSrc = new TaskCompletionSource<bool>();

            return await confirmPinTaskSrc.Task;
        }

void HidePairingPanel ( ) [inline, private]

Definition at line 286 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            pairingPanel.Visibility = Visibility.Collapsed;
            pairingTextBlock.Text = "";
        }

void noButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 390 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            CompleteConfirmPinTask(false);
            HidePairingPanel();
        }

void okButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 370 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            // OK button is only used for the ProvidePin scenario
            CompleteProvidePinTask(pinEntryTextBox.Text);
            HidePairingPanel();
        }

void OnDeviceListChanged | ( | DeviceWatcher | sender,
 |  | string | id |
 | ) |  |  | [inline, private]

Definition at line 110 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            // If the item being updated is currently "selected", then update the pairing buttons
            DeviceInformationDisplay selectedDeviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
            if ((selectedDeviceInfoDisp != null) && (selectedDeviceInfoDisp.Id == id))
            {
                UpdatePairingButtons();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 52 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            deviceWatcherHelper.Reset();
            CompleteProvidePinTask(); // Abandon any previous pin request.
            CompletePasswordCredential(); // Abandon any previous pin request.
            CompleteConfirmPinTask(false); // Abandon any previous request.
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            resultsListView.ItemsSource = resultCollection;

            selectorComboBox.ItemsSource = DeviceSelectorChoices.PairingSelectors;
            selectorComboBox.SelectedIndex = 0;

            protectionLevelComboBox.ItemsSource = ProtectionSelectorChoices.Selectors;
            protectionLevelComboBox.SelectedIndex = 0;
        }

async void PairButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            // Gray out the pair button and results view while pairing is in progress.
            resultsListView.IsEnabled = false;
            pairButton.IsEnabled = false;
            rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);

            // Get the device selected for pairing
            DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;

            // Get ceremony type and protection level selections
            DevicePairingKinds ceremoniesSelected = GetSelectedCeremonies();
            ProtectionLevelSelectorInfo protectionLevelInfo = (ProtectionLevelSelectorInfo)protectionLevelComboBox.SelectedItem;
            DevicePairingProtectionLevel protectionLevel = protectionLevelInfo.ProtectionLevel;

            DeviceInformationCustomPairing customPairing = deviceInfoDisp.DeviceInformation.Pairing.Custom;

            customPairing.PairingRequested += PairingRequestedHandler;
            DevicePairingResult result = await customPairing.PairAsync(ceremoniesSelected, protectionLevel);
            customPairing.PairingRequested -= PairingRequestedHandler;

            rootPage.NotifyUser(
                "Pairing result = " + result.Status.ToString(),
                result.Status == DevicePairingResultStatus.Paired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);

            HidePairingPanel();
            UpdatePairingButtons();
            resultsListView.IsEnabled = true;
        }

async void PairingRequestedHandler | ( | DeviceInformationCustomPairing | sender,
 |  | DevicePairingRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 169 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            switch (args.PairingKind)
            {
                case DevicePairingKinds.ConfirmOnly:
                    // Windows itself will pop the confirmation dialog as part of "consent" if this is running on Desktop or Mobile
                    // If this is an App for 'Windows IoT Core' where there is no Windows Consent UX, you may want to provide your own confirmation.
                    args.Accept();
                    break;

                case DevicePairingKinds.DisplayPin:
                    // We just show the PIN on this side. The ceremony is actually completed when the user enters the PIN
                    // on the target device. We automatically accept here since we can't really "cancel" the operation
                    // from this side.
                    args.Accept();

                    // No need for a deferral since we don't need any decision from the user
                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        ShowPairingPanel(
                            "Please enter this PIN on the device you are pairing with: " + args.Pin,
                            args.PairingKind);

                    });
                    break;

                case DevicePairingKinds.ProvidePin:
                    // A PIN may be shown on the target device and the user needs to enter the matching PIN on
                    // this Windows device. Get a deferral so we can perform the async request to the user.
                    var collectPinDeferral = args.GetDeferral();

                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                    {
                        string pin = await GetPinFromUserAsync();
                        if (!string.IsNullOrEmpty(pin))
                        {
                            args.Accept(pin);
                        }

                        collectPinDeferral.Complete();
                    });
                    break;

                case DevicePairingKinds.ProvidePasswordCredential:
                    var collectCredentialDeferral = args.GetDeferral();
                    await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                    {
                        var credential = await GetPasswordCredentialFromUserAsync();
                        if (credential != null)
                        {
                            args.AcceptWithPasswordCredential(credential);
                        }
                        collectCredentialDeferral.Complete();
                    });
                    break;

                case DevicePairingKinds.ConfirmPinMatch:
                    // We show the PIN here and the user responds with whether the PIN matches what they see
                    // on the target device. Response comes back and we set it on the PinComparePairingRequestedData
                    // then complete the deferral.
                    var displayMessageDeferral = args.GetDeferral();

                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                    {
                        bool accept = await GetUserConfirmationAsync(args.Pin);
                        if (accept)
                        {
                            args.Accept();
                        }

                        displayMessageDeferral.Complete();
                    });
                    break;
            }
        }

void ResultsListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 407 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            UpdatePairingButtons();
        }

void ShowPairingPanel | ( | string | text,
 |  | DevicePairingKinds | pairingKind |
 | ) |  |  | [inline, private]

Definition at line 247 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            pairingPanel.Visibility = Visibility.Collapsed;
            pinEntryTextBox.Visibility = Visibility.Collapsed;
            okButton.Visibility = Visibility.Collapsed;
            usernameEntryTextBox.Visibility = Visibility.Collapsed;
            passwordEntryTextBox.Visibility = Visibility.Collapsed;
            verifyButton.Visibility = Visibility.Collapsed;
            yesButton.Visibility = Visibility.Collapsed;
            noButton.Visibility = Visibility.Collapsed;
            pairingTextBlock.Text = text;

            switch (pairingKind)
            {
                case DevicePairingKinds.ConfirmOnly:
                case DevicePairingKinds.DisplayPin:
                    // Don't need any buttons
                    break;
                case DevicePairingKinds.ProvidePin:
                    pinEntryTextBox.Text = "";
                    pinEntryTextBox.Visibility = Visibility.Visible;
                    okButton.Visibility = Visibility.Visible;
                    break;
                case DevicePairingKinds.ConfirmPinMatch:
                    yesButton.Visibility = Visibility.Visible;
                    noButton.Visibility = Visibility.Visible;
                    break;
                case DevicePairingKinds.ProvidePasswordCredential:
                    usernameEntryTextBox.Text = "";
                    passwordEntryTextBox.Text = "";
                    passwordEntryTextBox.Visibility = Visibility.Visible;
                    usernameEntryTextBox.Visibility = Visibility.Visible;
                    verifyButton.Visibility = Visibility.Visible;
                    break;
            }

            pairingPanel.Visibility = Visibility.Visible;
        }

void StartWatcher ( ) [inline, private]

Definition at line 70 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            startWatcherButton.IsEnabled = false;
            resultCollection.Clear();
            DeviceWatcher deviceWatcher;

            // Get the device selector chosen by the UI then add additional constraints for devices that
            // can be paired or are already paired.
            DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;
            string selector = "(" + deviceSelectorInfo.Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";

            if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
            {
                // Kind will be determined by the selector
                deviceWatcher = DeviceInformation.CreateWatcher(
                    selector,
                    null // don't request additional properties for this sample
                    );
            }
            else
            {
                // Kind is specified in the selector info
                deviceWatcher = DeviceInformation.CreateWatcher(
                    selector,
                    null, // don't request additional properties for this sample
                    deviceSelectorInfo.Kind);
            }

            rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
            deviceWatcherHelper.StartWatcher(deviceWatcher);
            stopWatcherButton.IsEnabled = true;
        }

void StartWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            StartWatcher();
        }

void StopWatcher ( ) [inline, private]

Definition at line 103 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            stopWatcherButton.IsEnabled = false;
            deviceWatcherHelper.StopWatcher();
            startWatcherButton.IsEnabled = true;
        }

void StopWatcherButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 65 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            StopWatcher();
        }

async void UnpairButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 150 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            // Gray out the unpair button and results view while unpairing is in progress.
            resultsListView.IsEnabled = false;
            unpairButton.IsEnabled = false;
            rootPage.NotifyUser("Unpairing started. Please wait...", NotifyType.StatusMessage);

            DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;

            DeviceUnpairingResult dupr = await deviceInfoDisp.DeviceInformation.Pairing.UnpairAsync();

            rootPage.NotifyUser(
                "Unpairing result = " + dupr.Status.ToString(),
                dupr.Status == DeviceUnpairingResultStatus.Unpaired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);

            UpdatePairingButtons();
            resultsListView.IsEnabled = true;
        }

void UpdatePairingButtons ( ) [inline, private]

Definition at line 412 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            DeviceInformationDisplay deviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;

            if (null != deviceInfoDisp &&
                deviceInfoDisp.DeviceInformation.Pairing.CanPair &&
                !deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
            {
                pairButton.IsEnabled = true;
            }
            else
            {
                pairButton.IsEnabled = false;
            }

            if (null != deviceInfoDisp &&
                deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
            {
                unpairButton.IsEnabled = true;
            }
            else
            {
                unpairButton.IsEnabled = false;
            }
        }

void verifyButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 377 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            // verify button is only used for the ProvidePin scenario
            CompletePasswordCredential(usernameEntryTextBox.Text, passwordEntryTextBox.Text);
            HidePairingPanel();
        }

void yesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 384 of file Scenario9_CustomPairDevice.xaml.cs.

        {
            CompleteConfirmPinTask(true);
            HidePairingPanel();
        }

Member Data Documentation

TaskCompletionSource<bool> confirmPinTaskSrc [private]

Definition at line 28 of file Scenario9_CustomPairDevice.xaml.cs.

DeviceWatcherHelper deviceWatcherHelper [private]

Definition at line 25 of file Scenario9_CustomPairDevice.xaml.cs.

TaskCompletionSource<PasswordCredential> providePasswordCredential [private]

Definition at line 29 of file Scenario9_CustomPairDevice.xaml.cs.

TaskCompletionSource<string> providePinTaskSrc [private]

Definition at line 27 of file Scenario9_CustomPairDevice.xaml.cs.

ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>() [private]

Definition at line 31 of file Scenario9_CustomPairDevice.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 23 of file Scenario9_CustomPairDevice.xaml.cs.

The documentation for this class was generated from the following files:
  • DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs
  • DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_TransferMediaPlayer2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario9_TransferMediaPlayer2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario9_TransferMediaPlayer2 Class Reference

This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...

List of all members.

Public Member Functions

Scenario9_TransferMediaPlayer2 ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | DisposeMediaPlayer_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

The MediaPlayerElement on this page is bound to a MediaPlayer created elsewhere.

Definition at line 24 of file Scenario9_TransferMediaPlayer2.xaml.cs.

Constructor & Destructor Documentation

Scenario9_TransferMediaPlayer2 ( ) [inline]

Definition at line 28 of file Scenario9_TransferMediaPlayer2.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DisposeMediaPlayer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file Scenario9_TransferMediaPlayer2.xaml.cs.

        {
            if(rootPage.commonMediaPlayer != null)
            {
                mediaPlayerElement.SetMediaPlayer(null);
                rootPage.commonMediaPlayer.Dispose();
                rootPage.commonMediaPlayer = null;
                rootPage.NotifyUser("Disposed of MediaPlayer.", NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser("MediaPlayer was already null.", NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario9_TransferMediaPlayer2.xaml.cs.

        {
            // Detach the MediaPlayer from the MediaPlayerElement, but do not dispose it.
            // The MediaPlayer will continue to run, and it can be attached to another MediaPlayerElement.
            mediaPlayerElement.SetMediaPlayer(null);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 33 of file Scenario9_TransferMediaPlayer2.xaml.cs.

        {
            // Attach any existing MediaPlayer to the MediaPlayerElement on this page.
            mediaPlayerElement.SetMediaPlayer(rootPage.commonMediaPlayer);
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario9_TransferMediaPlayer2.xaml.cs.

The documentation for this class was generated from the following file:
  • VideoPlayback/cs/Scenario9_TransferMediaPlayer2.xaml.cs
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_CloudFontOverview Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_CloudFontOverview
Public Member Functions

Scenario_CloudFontOverview Class Reference

List of all members.

Public Member Functions

Scenario_CloudFontOverview ()

Detailed Description

Definition at line 19 of file Scenario_CloudFontOverview.xaml.cs.

Constructor & Destructor Documentation

Scenario_CloudFontOverview ( ) [inline]

Definition at line 21 of file Scenario_CloudFontOverview.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following files:
  • XamlCloudFontIntegration/cs/Scenario_CloudFontOverview.xaml.cs
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.cpp
  • XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_ContinuousDictation Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_ContinuousDictation
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_ContinuousDictation Class Reference

List of all members.

Public Member Functions

Scenario_ContinuousDictation ()
async void | ContinuousRecognize_Click (object sender, RoutedEventArgs e)

Protected Member Functions

async override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | btnClearText_Click (object sender, RoutedEventArgs e)
async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | ContinuousRecognitionSession_Completed (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
async void | ContinuousRecognitionSession_ResultGenerated (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
void | dictationTextBox_TextChanged (object sender, TextChangedEventArgs e)
async Task | InitializeRecognizer (Language recognizerLanguage)
async void | openPrivacySettings_Click (Hyperlink sender, HyperlinkClickEventArgs args)
void | PopulateLanguageDropdown ()
async void | SpeechRecognizer_HypothesisGenerated (SpeechRecognizer sender, SpeechRecognitionHypothesisGeneratedEventArgs args)
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

StringBuilder | dictatedTextBuilder
bool | isListening
MainPage rootPage
SpeechRecognizer | speechRecognizer

Static Private Attributes

static uint | HResultPrivacyStatementDeclined = 0x80045509

Detailed Description

Definition at line 28 of file Scenario_ContinuousDictation.xaml.cs.

Constructor & Destructor Documentation

Scenario_ContinuousDictation ( ) [inline]

Definition at line 50 of file Scenario_ContinuousDictation.xaml.cs.

        {
            this.InitializeComponent();
            isListening = false;
            dictatedTextBuilder = new StringBuilder();
        }

Member Function Documentation

void btnClearText_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Clear the dictation textbox.

Parameters:
sender | Ignored
e | Ignored

Definition at line 400 of file Scenario_ContinuousDictation.xaml.cs.

        {
            btnClearText.IsEnabled = false;
            dictatedTextBuilder.Clear();
            dictationTextBox.Text = "";
            discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

            // Avoid setting focus on the text box, since it's a non-editable control.
            btnContinuousRecognize.Focus(FocusState.Programmatic);
        }

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 117 of file Scenario_ContinuousDictation.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
                Language newLanguage = (Language)item.Tag;
                if (speechRecognizer.CurrentLanguage != newLanguage)
                {
                    // trigger cleanup and re-initialization of speech.
                    try
                    {
                        await InitializeRecognizer(newLanguage);
                    }
                    catch (Exception exception)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

async void ContinuousRecognitionSession_Completed | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if some transient issues occur.

Parameters:
sender | The continuous recognition session
args | The state of the recognizer

Definition at line 217 of file Scenario_ContinuousDictation.xaml.cs.

        {
            if (args.Status != SpeechRecognitionResultStatus.Success)
            {
                // If TimeoutExceeded occurs, the user has been silent for too long. We can use this to
                // cancel recognition if the user in dictation mode and walks away from their device, etc.
                // In a global-command type scenario, this timeout won't apply automatically.
                // With dictation (no grammar in place) modes, the default timeout is 20 seconds.
                if (args.Status == SpeechRecognitionResultStatus.TimeoutExceeded)
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Automatic Time Out of Dictation", NotifyType.StatusMessage);
                        DictationButtonText.Text = " Dictate";
                        cbLanguageSelection.IsEnabled = true;
                        dictationTextBox.Text = dictatedTextBuilder.ToString();
                        isListening = false;
                    });
                }
                else
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
                        DictationButtonText.Text = " Dictate";
                        cbLanguageSelection.IsEnabled = true;
                        isListening = false;
                    });
                }
            }
        }

async void ContinuousRecognitionSession_ResultGenerated | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionResultGeneratedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when a result is generated.

Check for high to medium confidence, and then append the string to the end of the stringbuffer, and replace the content of the textbox with the string buffer, to remove any hypothesis text that may be present.

Parameters:
sender | The Recognition session that generated this result
args | Details about the recognized speech

Definition at line 274 of file Scenario_ContinuousDictation.xaml.cs.

        {
            // We may choose to discard content that has low confidence, as that could indicate that we're picking up
            // noise via the microphone, or someone could be talking out of earshot.
            if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
                args.Result.Confidence == SpeechRecognitionConfidence.High)
            {
                dictatedTextBuilder.Append(args.Result.Text + " ");

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

                    dictationTextBox.Text = dictatedTextBuilder.ToString();
                    btnClearText.IsEnabled = true;
                });
            }
            else
            {
                // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
                // is not the primary input mechanism for the application.
                // Here, just remove any hypothesis text by resetting it to the last known good.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    dictationTextBox.Text = dictatedTextBuilder.ToString();
                    string discardedText = args.Result.Text;
                    if (!string.IsNullOrEmpty(discardedText))
                    {
                        discardedText = discardedText.Length <= 25 ? discardedText : (discardedText.Substring(0, 25) + "...");

                        discardedTextBlock.Text = "Discarded due to low/rejected Confidence: " + discardedText;
                        discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                });
            }
        }

async void ContinuousRecognize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Begin recognition, or finish the recognition session.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 328 of file Scenario_ContinuousDictation.xaml.cs.

        {
            btnContinuousRecognize.IsEnabled = false;
            if (isListening == false)
            {
                // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
                // This prevents an exception from occurring.
                if (speechRecognizer.State == SpeechRecognizerState.Idle)
                {
                    DictationButtonText.Text = " Stop Dictation";
                    cbLanguageSelection.IsEnabled = false;
                    hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
                    discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

                    try
                    {
                        isListening = true;
                        await speechRecognizer.ContinuousRecognitionSession.StartAsync();
                    }
                    catch (Exception ex)
                    {
                        if ((uint)ex.HResult == HResultPrivacyStatementDeclined)
                        {
                            // Show a UI link to the privacy settings.
                            hlOpenPrivacySettings.Visibility = Visibility.Visible;
                        }
                        else
                        {
                            var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                            await messageDialog.ShowAsync();
                        }

                        isListening = false;
                        DictationButtonText.Text = " Dictate";
                        cbLanguageSelection.IsEnabled = true;

                    }
                }
            }
            else
            {
                isListening = false;
                DictationButtonText.Text = " Dictate";
                cbLanguageSelection.IsEnabled = true;

                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    // Cancelling recognition prevents any currently recognized speech from
                    // generating a ResultGenerated event. StopAsync() will allow the final session to
                    // complete.
                    try
                    {
                        await speechRecognizer.ContinuousRecognitionSession.StopAsync();

                        // Ensure we don't leave any hypothesis text behind
                        dictationTextBox.Text = dictatedTextBuilder.ToString();
                    }
                    catch (Exception exception)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
            btnContinuousRecognize.IsEnabled = true;
        }

void dictationTextBox_TextChanged | ( | object | sender,
 |  | TextChangedEventArgs | e |
 | ) |  |  | [inline, private]

Automatically scroll the textbox down to the bottom whenever new dictated text arrives.

Parameters:
sender | The dictation textbox
e | Unused text changed arguments

Definition at line 417 of file Scenario_ContinuousDictation.xaml.cs.

        {
            var grid = (Grid)VisualTreeHelper.GetChild(dictationTextBox, 0);
            for (var i = 0; i <= VisualTreeHelper.GetChildrenCount(grid) - 1; i++)
            {
                object obj = VisualTreeHelper.GetChild(grid, i);
                if (!(obj is ScrollViewer))
                {
                    continue;
                }

                ((ScrollViewer)obj).ChangeView(0.0f, ((ScrollViewer)obj).ExtentHeight, 1.0f);
                break;
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 144 of file Scenario_ContinuousDictation.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.HypothesisGenerated -= SpeechRecognizer_HypothesisGenerated;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            this.speechRecognizer = new SpeechRecognizer(recognizerLanguage);

            // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
            // of an audio indicator to help the user understand whether they're being heard.
            speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

            // Apply the dictation topic constraint to optimize for dictated freeform speech.
            var dictationConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "dictation");
            speechRecognizer.Constraints.Add(dictationConstraint);
            SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
            if (result.Status != SpeechRecognitionResultStatus.Success)
            {
                rootPage.NotifyUser("Grammar Compilation Failed: " + result.Status.ToString(), NotifyType.ErrorMessage);
                btnContinuousRecognize.IsEnabled = false;
            }

            // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
            // some recognized phrases occur, or the garbage rule is hit. HypothesisGenerated fires during recognition, and
            // allows us to provide incremental feedback based on what the user's currently saying.
            speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
            speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;
            speechRecognizer.HypothesisGenerated += SpeechRecognizer_HypothesisGenerated;
        }

async override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Upon leaving, clean up the speech recognizer.

Ensure we aren't still listening, and disable the event handlers to prevent leaks.

Parameters:
e Unused navigation parameters.

Definition at line 187 of file Scenario_ContinuousDictation.xaml.cs.

        {
            if (this.speechRecognizer != null)
            {
                if (isListening)
                {
                    await this.speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    isListening = false;
                    DictationButtonText.Text = " Dictate";
                    cbLanguageSelection.IsEnabled = true;
                }

                dictationTextBox.Text = "";

                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.HypothesisGenerated -= SpeechRecognizer_HypothesisGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Upon entering the scenario, ensure that we have permissions to use the Microphone.

This may entail popping up a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow audio input.

Parameters:
e Unused navigation parameters

Definition at line 65 of file Scenario_ContinuousDictation.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnContinuousRecognize.IsEnabled = true;

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                this.dictationTextBox.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
                btnContinuousRecognize.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }

        }

async void openPrivacySettings_Click | ( | Hyperlink | sender,
 |  | HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the Microsoft Privacy Policy, and enable personalization.

Parameters:
sender | Ignored
args | Ignored

Definition at line 439 of file Scenario_ContinuousDictation.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-speech"));
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 92 of file Scenario_ContinuousDictation.xaml.cs.

        {
            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedTopicLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }
        }

async void SpeechRecognizer_HypothesisGenerated | ( | SpeechRecognizer | sender,
 |  | SpeechRecognitionHypothesisGeneratedEventArgs | args |
 | ) |  |  | [inline, private]

While the user is speaking, update the textbox with the partial sentence of what's being said for user feedback.

Parameters:
sender | The recognizer that has generated the hypothesis
args | The hypothesis formed

Definition at line 254 of file Scenario_ContinuousDictation.xaml.cs.

        {
            string hypothesis = args.Hypothesis.Text;

            // Update the textbox with the currently confirmed text, and the hypothesis combined.
            string textboxContent = dictatedTextBuilder.ToString() + " " + hypothesis + " ...";
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                dictationTextBox.Text = textboxContent;
                btnClearText.IsEnabled = true;
            });
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Provide feedback to the user based on whether the recognizer is receiving their voice input.

Parameters:
sender | The recognizer that is currently running.
args | The current state of the recognizer.

Definition at line 316 of file Scenario_ContinuousDictation.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

StringBuilder dictatedTextBuilder [private]

Definition at line 41 of file Scenario_ContinuousDictation.xaml.cs.

uint HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 48 of file Scenario_ContinuousDictation.xaml.cs.

bool isListening [private]

Definition at line 37 of file Scenario_ContinuousDictation.xaml.cs.

MainPage rootPage [private]

Definition at line 31 of file Scenario_ContinuousDictation.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 34 of file Scenario_ContinuousDictation.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_ContinuousRecognitionListGrammar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_ContinuousRecognitionListGrammar
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_ContinuousRecognitionListGrammar Class Reference

List of all members.

Public Member Functions

Scenario_ContinuousRecognitionListGrammar ()
async void | ContinuousRecognize_Click (object sender, RoutedEventArgs e)

Protected Member Functions

async override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | ContinuousRecognitionSession_Completed (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
async void | ContinuousRecognitionSession_ResultGenerated (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
async Task | InitializeRecognizer (Language recognizerLanguage)
void | PopulateLanguageDropdown ()
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

bool | isListening
bool | isPopulatingLanguages = false
MainPage rootPage
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultRecognizerNotFound = 0x8004503a

Detailed Description

Definition at line 26 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

Constructor & Destructor Documentation

Scenario_ContinuousRecognitionListGrammar ( ) [inline]

Definition at line 49 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            this.InitializeComponent();
            isListening = false;
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 129 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            if (isPopulatingLanguages)
            {
                return;
            }

            ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
            Language newLanguage = (Language)item.Tag;
            if (speechRecognizer != null)
            {
                if (speechRecognizer.CurrentLanguage == newLanguage)
                {
                    return;
                }
            }

            // trigger cleanup and re-initialization of speech.
            try
            {
                // update the context for resource lookup
                speechContext.Languages = new string[] { newLanguage.LanguageTag };

                await InitializeRecognizer(newLanguage);
            }
            catch (Exception exception)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                await messageDialog.ShowAsync();
            }
        }

async void ContinuousRecognitionSession_Completed | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if some transient issues occur.

Parameters:
sender | The continuous recognition session
args | The state of the recognizer

Definition at line 310 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            if (args.Status != SpeechRecognitionResultStatus.Success)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
                    ContinuousRecoButtonText.Text = " Continuous Recognition";
                    cbLanguageSelection.IsEnabled = true;
                    isListening = false;
                });
            }
        }

async void ContinuousRecognitionSession_ResultGenerated | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionResultGeneratedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when a result is generated.

This may include a garbage rule that fires when general room noise or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with low confidence).

Parameters:
sender | The Recognition session that generated this result
args | Details about the recognized speech

Definition at line 331 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            // The garbage rule will not have a tag associated with it, the other rules will return a string matching the tag provided
            // when generating the grammar.
            string tag = "unknown";
            if (args.Result.Constraint != null)
            {
                tag = args.Result.Constraint.Tag;
            }

            // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their
            // grammar based on testing.
            if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
                args.Result.Confidence == SpeechRecognitionConfidence.High)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    heardYouSayTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
                });
            }
            else
            {
                // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
                // is not the primary input mechanism for the application.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    heardYouSayTextBlock.Visibility = Visibility.Collapsed;
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Sorry, I didn't catch that. (Heard: '{0}', Tag: {1}, Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
                });
            }
        }

async void ContinuousRecognize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Begin recognition, or finish the recognition session.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 383 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            btnContinuousRecognize.IsEnabled = false;
            if (isListening == false)
            {
                // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
                // This prevents an exception from occurring.
                if (speechRecognizer.State == SpeechRecognizerState.Idle)
                {
                    try
                    {
                        await speechRecognizer.ContinuousRecognitionSession.StartAsync();
                        ContinuousRecoButtonText.Text = " Stop Continuous Recognition";
                        cbLanguageSelection.IsEnabled = false;
                        isListening = true;
                    }
                    catch (Exception ex)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
            else
            {
                isListening = false;
                ContinuousRecoButtonText.Text = " Continuous Recognition";
                cbLanguageSelection.IsEnabled = true;

                heardYouSayTextBlock.Visibility = Visibility.Collapsed;
                resultTextBlock.Visibility = Visibility.Collapsed;
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    try
                    {
                        // Cancelling recognition prevents any currently recognized speech from
                        // generating a ResultGenerated event. StopAsync() will allow the final session to
                        // complete.
                        await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    }
                    catch (Exception ex)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }

            btnContinuousRecognize.IsEnabled = true;
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 166 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            try {
                this.speechRecognizer = new SpeechRecognizer(recognizerLanguage);

                // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
                // of an audio indicator to help the user understand whether they're being heard.
                speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

                // Build a command-list grammar. Commands should ideally be drawn from a resource file for localization, and
                // be grouped into tags for alternate forms of the same command.
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarGoHome", speechContext).ValueAsString
                        }, "Home"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarGoToContosoStudio", speechContext).ValueAsString
                        }, "GoToContosoStudio"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarShowMessage", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarOpenMessage", speechContext).ValueAsString
                        }, "Message"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarSendEmail", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCreateEmail", speechContext).ValueAsString
                        }, "Email"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarCallNitaFarley", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCallNita", speechContext).ValueAsString
                        }, "CallNita"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarCallWayneSigmon", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCallWayne", speechContext).ValueAsString
                        }, "CallWayne"));

                // Update the help text in the UI to show localized examples
                string uiOptionsText = string.Format("Try saying '{0}', '{1}' or '{2}'",
                    speechResourceMap.GetValue("ListGrammarGoHome", speechContext).ValueAsString,
                    speechResourceMap.GetValue("ListGrammarGoToContosoStudio", speechContext).ValueAsString,
                    speechResourceMap.GetValue("ListGrammarShowMessage", speechContext).ValueAsString);
                listGrammarHelpText.Text = string.Format("{0}\n{1}",
                    speechResourceMap.GetValue("ListGrammarHelpText", speechContext).ValueAsString,
                    uiOptionsText);

                SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
                if (result.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition buttons.
                    btnContinuousRecognize.IsEnabled = false;

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Unable to compile grammar.";
                }
                else
                {
                    btnContinuousRecognize.IsEnabled = true;

                    resultTextBlock.Visibility = Visibility.Collapsed;

                    // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
                    // some recognized phrases occur, or the garbage rule is hit.
                    speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
                    speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;
                }
            }
            catch (Exception ex)
            {
                if ((uint)ex.HResult == HResultRecognizerNotFound)
                {
                    btnContinuousRecognize.IsEnabled = false;

                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Speech Language pack for selected language not installed.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

        }

async override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Upon leaving, clean up the speech recognizer.

Ensure we aren't still listening, and disable the event handlers to prevent leaks.

Parameters:
e Unused navigation parameters.

Definition at line 284 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            if (this.speechRecognizer != null)
            {
                if (isListening)
                {
                    await this.speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    isListening = false;
                }
                heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;

                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Upon entering the scenario, ensure that we have permissions to use the Microphone.

This may entail popping up a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow audio input.

Parameters:
e Unused navigation parameters

Definition at line 63 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnContinuousRecognize.IsEnabled = true;

                // Initialize resource map to retrieve localized speech strings.
                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                string langTag = speechLanguage.LanguageTag;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { langTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                this.resultTextBlock.Visibility = Visibility.Visible;
                this.resultTextBlock.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
                btnContinuousRecognize.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 98 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            // disable the callback so we don't accidentally trigger initialization of the recognizer
            // while initialization is already in progress.
            isPopulatingLanguages = true;

            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }

            isPopulatingLanguages = false;
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Provide feedback to the user based on whether the recognizer is receiving their voice input.

Parameters:
sender | The recognizer that is currently running.
args | The current state of the recognizer.

Definition at line 371 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

uint HResultRecognizerNotFound = 0x8004503a [static, private]

the HResult 0x8004503a typically represents the case where a recognizer for a particular language cannot be found.

This may occur if the language is installed, but the speech pack for that language is not. See Settings -> Time & Language -> Region & Language -> *Language* -> Options -> Speech Language Options.

Definition at line 39 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

bool isListening [private]

Definition at line 47 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

bool isPopulatingLanguages = false [private]

Definition at line 44 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

MainPage rootPage [private]

Definition at line 29 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

ResourceContext speechContext [private]

Definition at line 41 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 32 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 42 of file Scenario_ContinuousRecognitionListGrammar.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_ContinuousRecognitionSRGSGrammar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_ContinuousRecognitionSRGSGrammar
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_ContinuousRecognitionSRGSGrammar Class Reference

List of all members.

Public Member Functions

Scenario_ContinuousRecognitionSRGSGrammar ()
async void | ContinuousRecognize_Click (object sender, RoutedEventArgs e)

Protected Member Functions

async override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | ContinuousRecognitionSession_Completed (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
async void | ContinuousRecognitionSession_ResultGenerated (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
Color | getColor (string colorString)
void | HandleRecognitionResult (SpeechRecognitionResult recoResult)
async Task | InitializeRecognizer (Language recognizerLanguage)
void | PopulateLanguageDropdown ()
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

Dictionary< string, Color > | colorLookup
bool | isPopulatingLanguages = false
MainPage rootPage
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultRecognizerNotFound = 0x8004503a

Detailed Description

Definition at line 30 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

Constructor & Destructor Documentation

Scenario_ContinuousRecognitionSRGSGrammar ( ) [inline]

Definition at line 58 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 137 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            if (isPopulatingLanguages)
            {
                return;
            }

            btnContinuousRecognize.IsEnabled = false;
            ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
            Language newLanguage = (Language)item.Tag;
            if (speechRecognizer != null)
            {
                if (speechRecognizer.CurrentLanguage == newLanguage)
                {
                    return;
                }
            }

            // trigger cleanup and re-initialization of speech.
            try
            {
                // update the context for resource lookup
                speechContext.Languages = new string[] { newLanguage.LanguageTag };

                await InitializeRecognizer(newLanguage);
            }
            catch (Exception exception)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                await messageDialog.ShowAsync();
            }
            btnContinuousRecognize.IsEnabled = true;
        }

async void ContinuousRecognitionSession_Completed | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when the session ends, either from a call to CancelAsync() or StopAsync(), or an error condition, such as the microphone becoming unavailable or some transient issues occuring.

Parameters:
sender | The continuous recognition session
args | The state of the recognizer

Definition at line 336 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
                ContinuousRecoButtonText.Text = " Continuous Recognition";
                cbLanguageSelection.IsEnabled = true;
            });
        }

async void ContinuousRecognitionSession_ResultGenerated | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionResultGeneratedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when a result is generated.

This may include a garbage rule that fires when general room noise or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with low confidence).

Parameters:
sender | The Recognition session that generated this result
args | Details about the recognized speech

Definition at line 353 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their
            // grammar based on testing.
            if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
                args.Result.Confidence == SpeechRecognitionConfidence.High)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    HandleRecognitionResult(args.Result);
                });
            }
            // Prompt the user if recognition failed or recognition confidence is low.
            else if (args.Result.Confidence == SpeechRecognitionConfidence.Rejected ||
            args.Result.Confidence == SpeechRecognitionConfidence.Low)
            {
                // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
                // is not the primary input mechanism for the application.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    resultTextBlock.Text = speechResourceMap.GetValue("SRGSGarbagePromptText", speechContext).ValueAsString;
                });
            }
        }

async void ContinuousRecognize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Begin recognition or finish the recognition session.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 286 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            btnContinuousRecognize.IsEnabled = false;
            // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
            // This prevents an exception from occurring.
            if (speechRecognizer.State == SpeechRecognizerState.Idle)
            {
                // Reset the text to prompt the user.
                try
                {
                    await speechRecognizer.ContinuousRecognitionSession.StartAsync();
                    resultTextBlock.Text = speechResourceMap.GetValue("SRGSHelpText", speechContext).ValueAsString;
                    ContinuousRecoButtonText.Text = " Stop Continuous Recognition";
                    cbLanguageSelection.IsEnabled = false;
                }
                catch (Exception ex)
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "StartAsync Exception");
                    await messageDialog.ShowAsync();
                }
            }
            else
            {
                try
                {
                    // Reset the text to prompt the user.
                    ContinuousRecoButtonText.Text = " Continuous Recognition";
                    cbLanguageSelection.IsEnabled = true;
                    resultTextBlock.Text = speechResourceMap.GetValue("SRGSHelpText", speechContext).ValueAsString;
                    // Cancelling recognition prevents any currently recognized speech from
                    // generating a ResultGenerated event. StopAsync() will allow the final session to
                    // complete.
                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                }
                catch (Exception ex)
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "CancelAsync Exception");
                    await messageDialog.ShowAsync();
                }
            }
            btnContinuousRecognize.IsEnabled = true;
        }

Color getColor ( string colorString ) [inline, private]

Creates a color object from the passed in string.

Parameters:
colorString The name of the color

Definition at line 488 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            Color newColor = Colors.Transparent;

            if (colorLookup.ContainsKey(colorString))
            {
                newColor = colorLookup[colorString];
            }

            return newColor;
        }

void HandleRecognitionResult ( SpeechRecognitionResult recoResult ) [inline, private]

Uses the result from the speech recognizer to change the colors of the shapes.

Parameters:
recoResult The result from the recognition event

Definition at line 395 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            // Check the confidence level of the recognition result.
            if (recoResult.Confidence == SpeechRecognitionConfidence.High ||
            recoResult.Confidence == SpeechRecognitionConfidence.Medium)
            {
                // Declare a string that will contain messages when the color rule matches GARBAGE.
                string garbagePrompt = "";

                // BACKGROUND: Check to see if the recognition result contains the semantic key for the background color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BACKGROUND") && recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString() != "...")
                {
                    string backgroundColor = recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString();
                    colorRectangle.Fill = new SolidColorBrush(getColor(backgroundColor));
                }

                // If "background" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BACKGROUND") && recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString() == "...")
                {

                    garbagePrompt += speechResourceMap.GetValue("SRGSBackgroundGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // BORDER: Check to see if the recognition result contains the semantic key for the border color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BORDER") && recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString() != "...")
                {
                    string borderColor = recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString();
                    colorRectangle.Stroke = new SolidColorBrush(getColor(borderColor));
                }

                // If "border" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BORDER") && recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString() == "...")
                {
                    garbagePrompt += speechResourceMap.GetValue("SRGSBorderGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // CIRCLE: Check to see if the recognition result contains the semantic key for the circle color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_CIRCLE") && recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString() != "...")
                {
                    string circleColor = recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString();
                    colorCircle.Fill = new SolidColorBrush(getColor(circleColor));
                }

                // If "circle" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_CIRCLE") && recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString() == "...")
                {
                    garbagePrompt += speechResourceMap.GetValue("SRGSCircleGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // Initialize a string that will describe the user's color choices.
                string textBoxColors = "You selected (Semantic Interpretation)-> \n";

                // Write the color choices contained in the semantics of the recognition result to the text box.
                foreach (KeyValuePair<String, IReadOnlyList<string>> child in recoResult.SemanticInterpretation.Properties)
                {

                    // Check to see if any of the semantic values in recognition result contains a match for the GARBAGE rule.
                    if (!child.Value.Equals("..."))
                    {

                        // Cycle through the semantic keys and values and write them to the text box.
                        textBoxColors += (string.Format(" {0} {1}\n",
                        child.Value[0], child.Key ?? "null"));

                        resultTextBlock.Text = textBoxColors;
                    }

                    // If there was no match to the colors rule or if it matched GARBAGE, prompt the user.
                    else
                    {
                        resultTextBlock.Text = garbagePrompt;
                    }
                }
            }

            // Prompt the user if recognition failed or recognition confidence is low.
            else if (recoResult.Confidence == SpeechRecognitionConfidence.Rejected ||
            recoResult.Confidence == SpeechRecognitionConfidence.Low)
            {
                resultTextBlock.Text = speechResourceMap.GetValue("SRGSGarbagePromptText", speechContext).ValueAsString;
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 199 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            try {
                // Initialize the SRGS-compliant XML file.
                // For more information about grammars for Windows apps and how to
                // define and use SRGS-compliant grammars in your app, see
                // https://msdn.microsoft.com/en-us/library/dn596121.aspx

                // determine the language code being used.
                string languageTag = recognizerLanguage.LanguageTag;
                string fileName = String.Format("SRGS\\{0}\\SRGSColors.xml", languageTag);
                StorageFile grammarContentFile = await Package.Current.InstalledLocation.GetFileAsync(fileName);

                resultTextBlock.Text = speechResourceMap.GetValue("SRGSHelpText", speechContext).ValueAsString;

                // Initialize the SpeechRecognizer and add the grammar.
                speechRecognizer = new SpeechRecognizer(recognizerLanguage);

                // Provide feedback to the user about the state of the recognizer. This can be used to provide
                // visual feedback to help the user understand whether they're being heard.
                speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

                SpeechRecognitionGrammarFileConstraint grammarConstraint = new SpeechRecognitionGrammarFileConstraint(grammarContentFile);
                speechRecognizer.Constraints.Add(grammarConstraint);
                SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();

                // Check to make sure that the constraints were in a proper format and the recognizer was able to compile them.
                if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition button.
                    btnContinuousRecognize.IsEnabled = false;

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Text = "Unable to compile grammar.";
                }
                else
                {

                    // Set EndSilenceTimeout to give users more time to complete speaking a phrase.
                    speechRecognizer.Timeouts.EndSilenceTimeout = TimeSpan.FromSeconds(1.2);

                    // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
                    // some recognized phrases occur, or the garbage rule is hit.
                    speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
                    speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;

                    btnContinuousRecognize.IsEnabled = true;

                    resultTextBlock.Text = speechResourceMap.GetValue("SRGSHelpText", speechContext).ValueAsString;
                    resultTextBlock.Visibility = Visibility.Visible;
                }
            }
            catch (Exception ex)
            {
                if ((uint)ex.HResult == HResultRecognizerNotFound)
                {
                    btnContinuousRecognize.IsEnabled = false;

                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Speech Language pack for selected language not installed.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

        }

async override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Upon leaving, clean up the speech recognizer.

Ensure we aren't still listening, and disable the event handlers to prevent leaks.

Parameters:
e Unused navigation parameters.

Definition at line 176 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                }

                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Upon entering the scenario, ensure that we have permissions to use the Microphone.

This may entail popping up a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow audio input.

Parameters:
e Unused navigation parameters

Definition at line 71 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnContinuousRecognize.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                string langTag = speechLanguage.LanguageTag;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { langTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();

                // Initialize the recognizer. Since the recognizer is disposed on scenario exit, we need to make sure we re-initialize it on scenario
                // entrance, as the xaml page may not get destroyed between openings of the scenario.
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
                btnContinuousRecognize.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 107 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            // disable the callback so we don't accidentally trigger initialization of the recognizer
            // while initialization is already in progress.
            isPopulatingLanguages = true;

            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }
            isPopulatingLanguages = false;
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Provide feedback to the user based on whether the recognizer is receiving their voice input.

Parameters:
sender | The recognizer that is currently running.
args | The current state of the recognizer.

Definition at line 383 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

Dictionary<string, Color> colorLookup [private]
Initial value:
 new Dictionary<string, Color>
        {
            { "COLOR_RED",   Colors.Red },   {"COLOR_BLUE",  Colors.Blue },  {"COLOR_BLACK",  Colors.Black},
            { "COLOR_BROWN", Colors.Brown},  {"COLOR_PURPLE",Colors.Purple}, {"COLOR_GREEN",  Colors.Green},
            { "COLOR_YELLOW",Colors.Yellow}, {"COLOR_CYAN",  Colors.Cyan},   {"COLOR_MAGENTA",Colors.Magenta},
            { "COLOR_ORANGE",Colors.Orange}, {"COLOR_GRAY",  Colors.Gray},   {"COLOR_WHITE",  Colors.White}
        }

Definition at line 50 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

uint HResultRecognizerNotFound = 0x8004503a [static, private]

the HResult 0x8004503a typically represents the case where a recognizer for a particular language cannot be found.

This may occur if the language is installed, but the speech pack for that language is not. See Settings -> Time & Language -> Region & Language -> *Language* -> Options -> Speech Language Options.

Definition at line 40 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

bool isPopulatingLanguages = false [private]

Definition at line 48 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

MainPage rootPage [private]

Definition at line 33 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

ResourceContext speechContext [private]

Definition at line 45 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 43 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 46 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_Document1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_Document1
Public Member Functions | Private Member Functions

Scenario_Document1 Class Reference

List of all members.

Public Member Functions

Scenario_Document1 ()

Private Member Functions

void Page_Loaded (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 17 of file Scenario_Document1.xaml.cs.

Constructor & Destructor Documentation

Scenario_Document1 ( ) [inline]

Definition at line 19 of file Scenario_Document1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Page_Loaded | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file Scenario_Document1.xaml.cs.

        {
            // Font formatting is being applied on page load rather than in XAML markup
            // so that the on-demand cloud font behavior can be experienced when the
            // app runs rather than when the XAML file is viewed in Visual Studio.

            // Formatting will be applied to all content elements in the page that don't
            // already have FontFamily set.
            this.FontFamily = new Windows.UI.Xaml.Media.FontFamily("Neue Haas Grotesk Text Pro");
        }

The documentation for this class was generated from the following files:
  • XamlCloudFontIntegration/cs/Scenario_Document1.xaml.cs
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.cpp
  • XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_Document2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_Document2
Public Member Functions | Private Member Functions

Scenario_Document2 Class Reference

List of all members.

Public Member Functions

Scenario_Document2 ()

Private Member Functions

void Page_Loaded (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 17 of file Scenario_Document2.xaml.cs.

Constructor & Destructor Documentation

Scenario_Document2 ( ) [inline]

Definition at line 19 of file Scenario_Document2.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Page_Loaded | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file Scenario_Document2.xaml.cs.

        {
            // Font formatting is being applied on page load rather than in XAML markup
            // so that the on-demand cloud font behavior can be experienced when the
            // app runs rather than when the XAML file is viewed in Visual Studio.

            // Formatting will be applied to all content elements in the page that don't
            // already have FontFamily set.
            this.FontFamily = new Windows.UI.Xaml.Media.FontFamily("FangSong");
        }

The documentation for this class was generated from the following files:
  • XamlCloudFontIntegration/cs/Scenario_Document2.xaml.cs
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.cpp
  • XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_Document3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_Document3
Public Member Functions | Private Member Functions

Scenario_Document3 Class Reference

List of all members.

Public Member Functions

Scenario_Document3 ()

Private Member Functions

void Page_Loaded (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Detailed Description

Definition at line 17 of file Scenario_Document3.xaml.cs.

Constructor & Destructor Documentation

Scenario_Document3 ( ) [inline]

Definition at line 19 of file Scenario_Document3.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Page_Loaded | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 24 of file Scenario_Document3.xaml.cs.

        {
            // Font formatting is being applied on page load rather than in XAML markup
            // so that the on-demand cloud font behavior can be experienced when the
            // app runs rather than when the XAML file is viewed in Visual Studio.

            // Formatting will be applied to all content elements in the page that don't
            // already have FontFamily set.
            this.FontFamily = new Windows.UI.Xaml.Media.FontFamily("Kokila");
        }

The documentation for this class was generated from the following files:
  • XamlCloudFontIntegration/cs/Scenario_Document3.xaml.cs
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.cpp
  • XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.cpp
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_ListConstraint Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_ListConstraint
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_ListConstraint Class Reference

List of all members.

Public Member Functions

Scenario_ListConstraint ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | InitializeRecognizer (Language recognizerLanguage)
void | PopulateLanguageDropdown ()
async void | RecognizeWithoutUIListConstraint_Click (object sender, RoutedEventArgs e)
async void | RecognizeWithUIListConstraint_Click (object sender, RoutedEventArgs e)
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

bool | isPopulatingLanguages = false
IAsyncOperation
< SpeechRecognitionResult > 		recognitionOperation
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultPrivacyStatementDeclined = 0x80045509
static uint | HResultRecognizerNotFound = 0x8004503a

Detailed Description

Definition at line 30 of file Scenario_ListConstraint.xaml.cs.

Constructor & Destructor Documentation

Scenario_ListConstraint ( ) [inline]

Definition at line 52 of file Scenario_ListConstraint.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 126 of file Scenario_ListConstraint.xaml.cs.

        {
            if (isPopulatingLanguages)
            {
                return;
            }

            ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
            Language newLanguage = (Language)item.Tag;
            if (speechRecognizer != null)
            {
                if (speechRecognizer.CurrentLanguage == newLanguage)
                {
                    return;
                }
            }

            // trigger cleanup and re-initialization of speech.
            try
            {
                // update the context for resource lookup
                speechContext.Languages = new string[] { newLanguage.LanguageTag };

                await InitializeRecognizer(newLanguage);
            }
            catch (Exception exception)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                await messageDialog.ShowAsync();
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 190 of file Scenario_ListConstraint.xaml.cs.

        {
            if(speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
            try
            {
                // Create an instance of SpeechRecognizer.
                speechRecognizer = new SpeechRecognizer(recognizerLanguage);

                // Provide feedback to the user about the state of the recognizer.
                speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

                // Add a list constraint to the recognizer.
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarGoHome", speechContext).ValueAsString
                        }, "Home"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarGoToContosoStudio", speechContext).ValueAsString
                        }, "GoToContosoStudio"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarShowMessage", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarOpenMessage", speechContext).ValueAsString
                        }, "Message"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarSendEmail", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCreateEmail", speechContext).ValueAsString
                        }, "Email"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarCallNitaFarley", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCallNita", speechContext).ValueAsString
                        }, "CallNita"));
                speechRecognizer.Constraints.Add(
                    new SpeechRecognitionListConstraint(
                        new List<string>()
                        {
                        speechResourceMap.GetValue("ListGrammarCallWayneSigmon", speechContext).ValueAsString,
                        speechResourceMap.GetValue("ListGrammarCallWayne", speechContext).ValueAsString
                        }, "CallWayne"));

                // RecognizeWithUIAsync allows developers to customize the prompts.
                string uiOptionsText = string.Format("Try saying '{0}', '{1}' or '{2}'",
                    speechResourceMap.GetValue("ListGrammarGoHome", speechContext).ValueAsString,
                    speechResourceMap.GetValue("ListGrammarGoToContosoStudio", speechContext).ValueAsString,
                    speechResourceMap.GetValue("ListGrammarShowMessage", speechContext).ValueAsString);
                speechRecognizer.UIOptions.ExampleText = uiOptionsText;
                helpTextBlock.Text = string.Format("{0}\n{1}",
                    speechResourceMap.GetValue("ListGrammarHelpText", speechContext).ValueAsString,
                    uiOptionsText);

                // Compile the constraint.
                SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();

                // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
                if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition buttons.
                    btnRecognizeWithUI.IsEnabled = false;
                    btnRecognizeWithoutUI.IsEnabled = false;

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Unable to compile grammar.";
                }
                else
                {
                    btnRecognizeWithUI.IsEnabled = true;
                    btnRecognizeWithoutUI.IsEnabled = true;

                    resultTextBlock.Visibility = Visibility.Collapsed;
                }
            }
            catch(Exception ex)
            {
                if((uint)ex.HResult == HResultRecognizerNotFound)
                {
                    btnRecognizeWithUI.IsEnabled = false;
                    btnRecognizeWithoutUI.IsEnabled = false;

                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Speech Language pack for selected language not installed.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks, dipose the speech recognizer, and clean up to ensure the scenario is not still attempting to recognize speech while not in view.

Parameters:
e Details about the navigation event

Definition at line 164 of file Scenario_ListConstraint.xaml.cs.

        {
            base.OnNavigatedFrom(e);
            if (speechRecognizer != null)
            {
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    if (recognitionOperation != null)
                    {
                        recognitionOperation.Cancel();
                        recognitionOperation = null;
                    }
                }

                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

When activating the scenario, ensure we have permission from the user to access their microphone, and provide an appropriate path for the user to enable access to the microphone if they haven't given explicit permission for it.

Parameters:
e The navigation event details

Definition at line 63 of file Scenario_ListConstraint.xaml.cs.

        {
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                // Enable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = true;
                btnRecognizeWithoutUI.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                string langTag = speechLanguage.LanguageTag;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { langTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 96 of file Scenario_ListConstraint.xaml.cs.

        {
            // disable the callback so we don't accidentally trigger initialization of the recognizer
            // while initialization is already in progress.
            isPopulatingLanguages = true;

            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
            foreach(Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if(lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }
            isPopulatingLanguages = false;
        }

async void RecognizeWithoutUIListConstraint_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses developer-provided UI for user feedback.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 378 of file Scenario_ListConstraint.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;

            // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
            btnRecognizeWithUI.IsEnabled = false;
            btnRecognizeWithoutUI.IsEnabled = false;
            cbLanguageSelection.IsEnabled = false;
            listenWithoutUIButtonText.Text = " listening for speech...";

            // Start recognition.
            try
            {
                // Save the recognition operation so we can cancel it (as it does not provide a blocking
                // UI, unlike RecognizeWithAsync()
                recognitionOperation = speechRecognizer.RecognizeAsync();

                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;

                // If successful, display the recognition result. A cancelled task should do nothing.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    string tag = "unknown";
                    if (speechRecognitionResult.Constraint != null)
                    {
                        // Only attempt to retreive the tag if we didn't hit the garbage rule.
                        tag = speechRecognitionResult.Constraint.Tag;
                    }

                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", speechRecognitionResult.Text, tag, speechRecognitionResult.Confidence.ToString());
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "The privacy statement was declined.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

            // Reset UI state.
            listenWithoutUIButtonText.Text = " without UI";
            cbLanguageSelection.IsEnabled = true;
            btnRecognizeWithUI.IsEnabled = true;
            btnRecognizeWithoutUI.IsEnabled = true;
        }

async void RecognizeWithUIListConstraint_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses the built-in speech recognition UI.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 319 of file Scenario_ListConstraint.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeWithUIAsync();

                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                // If successful, display the recognition result.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    string tag = "unknown";
                    if(speechRecognitionResult.Constraint != null)
                    {
                        // Only attempt to retreive the tag if we didn't hit the garbage rule.
                        tag = speechRecognitionResult.Constraint.Tag;
                    }

                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", speechRecognitionResult.Text, tag, speechRecognitionResult.Confidence.ToString());
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString() );
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "The privacy statement was declined.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Handle SpeechRecognizer state changed events by updating a UI component.

Parameters:
sender | Speech recognizer that generated this status event
args | The recognizer's status

Definition at line 305 of file Scenario_ListConstraint.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

uint HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 37 of file Scenario_ListConstraint.xaml.cs.

uint HResultRecognizerNotFound = 0x8004503a [static, private]

the HResult 0x8004503a typically represents the case where a recognizer for a particular language cannot be found.

This may occur if the language is installed, but the speech pack for that language is not. See Settings -> Time & Language -> Region & Language -> *Language* -> Options -> Speech Language Options.

Definition at line 44 of file Scenario_ListConstraint.xaml.cs.

bool isPopulatingLanguages = false [private]

Definition at line 49 of file Scenario_ListConstraint.xaml.cs.

IAsyncOperation<SpeechRecognitionResult> recognitionOperation [private]

Definition at line 50 of file Scenario_ListConstraint.xaml.cs.

ResourceContext speechContext [private]

Definition at line 47 of file Scenario_ListConstraint.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 46 of file Scenario_ListConstraint.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 48 of file Scenario_ListConstraint.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_PauseAsync Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_PauseAsync
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario_PauseAsync Class Reference

List of all members.

Public Member Functions

Scenario_PauseAsync ()
async void | EmailButton_Click (object sender, RoutedEventArgs e)
async void | PhoneButton_Click (object sender, RoutedEventArgs e)
async void | Recognize_Click (object sender, RoutedEventArgs e)

Protected Member Functions

async override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ContinuousRecognitionSession_Completed (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
async void | ContinuousRecognitionSession_ResultGenerated (SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
async Task | InitializeRecognizer ()
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
void | ToggleButtons (bool state)
void | UpdateUI (bool newState)

Private Attributes

SpeechRecognitionListConstraint | emailConstraint
bool | isListening
SpeechRecognitionListConstraint | phoneConstraint
MainPage rootPage
SpeechRecognizer | speechRecognizer

Detailed Description

Definition at line 24 of file Scenario_PauseAsync.xaml.cs.

Constructor & Destructor Documentation

Scenario_PauseAsync ( ) [inline]

Definition at line 39 of file Scenario_PauseAsync.xaml.cs.

        {
            InitializeComponent();
            isListening = false;
        }

Member Function Documentation

async void ContinuousRecognitionSession_Completed | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if some transient issues occur.

Parameters:
sender | The continuous recognition session
args | The state of the recognizer

Definition at line 155 of file Scenario_PauseAsync.xaml.cs.

        {
            if (args.Status != SpeechRecognitionResultStatus.Success)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
                    recognizeButtonText.Text = " Continuous Recognition";
                    btnEmailGrammar.IsEnabled = false;
                    btnPhoneGrammar.IsEnabled = false;
                    isListening = false;
                });
            }
        }

async void ContinuousRecognitionSession_ResultGenerated | ( | SpeechContinuousRecognitionSession | sender,
 |  | SpeechContinuousRecognitionResultGeneratedEventArgs | args |
 | ) |  |  | [inline, private]

Handle events fired when a result is generated.

This may include a garbage rule that fires when general room noise or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with low confidence).

Parameters:
sender | The Recognition session that generated this result
args | Details about the recognized speech

Definition at line 177 of file Scenario_PauseAsync.xaml.cs.

        {
            // The garbage rule will not have a tag associated with it, the other rules will return a string matching the tag provided
            // when generating the grammar.
            string tag = "unknown";
            if (args.Result.Constraint != null)
            {
                tag = args.Result.Constraint.Tag;
            }

            // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their
            // grammar based on testing.
            if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
                args.Result.Confidence == SpeechRecognitionConfidence.High)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
                });
            }
            else
            {
                // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
                // is not the primary input mechanism for the application.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    resultTextBlock.Text = string.Format("Sorry, I didn't catch that. (Heard: '{0}', Tag: {1}, Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
                });
            }
        }

async void EmailButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Adds or removes the 'email' constraint from the recognizer.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 289 of file Scenario_PauseAsync.xaml.cs.

        {
            // Update UI, disabling buttons so the user can't interrupt.
            UpdateUI(false);
            string newButtonText = "";

            long start = DateTime.Now.Ticks;

            try
            {
                // Pause the session. This allows you to update the grammars without stopping the
                // session and potentially losing audio and a recognition.
                await speechRecognizer.ContinuousRecognitionSession.PauseAsync();

                // Update the grammar appropriately.
                if (emailButtonText.Text.Equals("Remove 'email' grammar"))
                {
                    emailButtonText.Text = "Updating...";
                    speechRecognizer.Constraints.Remove(emailConstraint);
                    newButtonText = "Add 'email' grammar";
                    emailInfoTextBlock.Visibility = Visibility.Collapsed;
                }
                else
                {
                    emailButtonText.Text = "Updating...";
                    speechRecognizer.Constraints.Add(emailConstraint);
                    newButtonText = "Remove 'email' grammar";
                    emailInfoTextBlock.Visibility = Visibility.Visible;
                }

                // Recompile with the new constraints and resume the session again.
                SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
                if (result.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition buttons.
                    UpdateUI(false);

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Text = "Unable to compile grammar.";

                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    return;
                }

                speechRecognizer.ContinuousRecognitionSession.Resume();

                // For diagnostic purposes, display the amount of time it took to update the grammar.
                long elapsed = (DateTime.Now.Ticks - start) / TimeSpan.TicksPerMillisecond;
                msTextBlock.Text = "Grammar update took " + elapsed + " ms";
            }
            catch (Exception ex)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                await messageDialog.ShowAsync();
            }

            // Restore the original UI state.
            UpdateUI(true);
            emailButtonText.Text = newButtonText;
        }

void InitializeRecognizer ( ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Creates a SpeechRecognizer instance and initializes the grammar.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 78 of file Scenario_PauseAsync.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                speechRecognizer.Dispose();
                speechRecognizer = null;
            }

            speechRecognizer = new SpeechRecognizer();

            // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
            // of an audio indicator to help the user understand whether they're being heard.
            speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

            // It's not valid to pause a list grammar recognizer and recompile the constraints without at least one
            // constraint in place, so create a permanent constraint.
            var goHomeConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Go Home" }, "gohome");

            // These speech recognition constraints will be added and removed from the recognizer.
            emailConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Send email" }, "email");
            phoneConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Call phone" }, "phone");

            // Add some of the constraints initially, so we don't start with an empty list of constraints.
            speechRecognizer.Constraints.Add(goHomeConstraint);
            speechRecognizer.Constraints.Add(emailConstraint);

            SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
            if (result.Status != SpeechRecognitionResultStatus.Success)
            {
                // Disable the recognition buttons.
                btnRecognize.IsEnabled = false;

                // Let the user know that the grammar didn't compile properly.
                resultTextBlock.Text = "Unable to compile grammar.";
            }

            // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
            // some recognized phrases occur, or the garbage rule is hit.
            speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
            speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;
        }

async override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Upon leaving, clean up the speech recognizer.

Ensure we aren't still listening, and disable the event handlers to prevent leaks.

Parameters:
e Unused navigation parameters.

Definition at line 130 of file Scenario_PauseAsync.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                if (isListening)
                {
                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    isListening = false;
                }

                speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
                speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                speechRecognizer.Dispose();
                speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Upon entering the scenario, ensure that we have permissions to use the Microphone.

This may entail popping up a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow audio input.

Parameters:
e Unused navigation parameters

Definition at line 53 of file Scenario_PauseAsync.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnRecognize.IsEnabled = true;

                await InitializeRecognizer();
            }
            else
            {
                resultTextBlock.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
                btnRecognize.IsEnabled = false;
            }
        }

async void PhoneButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Adds or removes the 'phone' constraint from the recognizer.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 355 of file Scenario_PauseAsync.xaml.cs.

        {
            // Update UI, disabling buttons so the user can't interrupt.
            UpdateUI(false);
            string newButtonText = "";

            long start = DateTime.Now.Ticks;

            try
            {
                // Pause the session. This allows you to update the grammars without stopping the
                // session and potentially losing audio and a recognition.
                await speechRecognizer.ContinuousRecognitionSession.PauseAsync();

                // Update the grammar appropriately.
                if (phoneButtonText.Text.Equals("Remove 'phone' grammar"))
                {
                    phoneButtonText.Text = "Updating...";
                    speechRecognizer.Constraints.Remove(phoneConstraint);
                    newButtonText = "Add 'phone' grammar";
                    phoneInfoTextBlock.Visibility = Visibility.Collapsed;
                }
                else
                {
                    phoneButtonText.Text = "Updating...";
                    speechRecognizer.Constraints.Add(phoneConstraint);
                    newButtonText = "Remove 'phone' grammar";
                    phoneInfoTextBlock.Visibility = Visibility.Visible;
                }

                // Recompile with the new constraints and resume the session again.
                SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
                if (result.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition buttons.
                    UpdateUI(false);

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Text = "Unable to compile grammar.";

                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                    return;
                }

                speechRecognizer.ContinuousRecognitionSession.Resume();

                // For diagnostic purposes, display the amount of time it took to update the grammar.
                long elapsed = (DateTime.Now.Ticks - start) / TimeSpan.TicksPerMillisecond;
                msTextBlock.Text = "Grammar update took " + elapsed + " ms";
            }
            catch (Exception ex)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                await messageDialog.ShowAsync();
            }

            // Restore the original UI state.
            UpdateUI(true);
            phoneButtonText.Text = newButtonText;
        }

async void Recognize_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Begin recognition or finish the recognition session.

Parameters:
sender | The button that generated this event
e | Unused event details

Definition at line 226 of file Scenario_PauseAsync.xaml.cs.

        {
            UpdateUI(false);
            if (isListening == false)
            {
                // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
                // This prevents an exception from occurring.
                if (speechRecognizer.State == SpeechRecognizerState.Idle)
                {
                    // Reset the text to prompt the user.
                    try
                    {
                        await speechRecognizer.ContinuousRecognitionSession.StartAsync();

                        recognizeButtonText.Text = " Stop Continuous Recognition";
                        UpdateUI(true);
                        infoBoxes.Visibility = Visibility.Visible;
                        isListening = true;
                    }
                    catch (Exception ex)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
            else
            {
                recognizeButtonText.Text = " Continuous Recognition";
                infoBoxes.Visibility = Visibility.Collapsed;
                isListening = false;

                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    // Cancelling recognition prevents any currently recognized speech from
                    // generating a ResultGenerated event. StopAsync() will allow the final session to
                    // complete.
                    await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
                }

                btnEmailGrammar.IsEnabled = false;
                btnPhoneGrammar.IsEnabled = false;
                btnRecognize.IsEnabled = true;
            }

        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Provide feedback to the user based on whether the recognizer is receiving their voice input.

Parameters:
sender | The recognizer that is currently running.
args | The current state of the recognizer.

Definition at line 213 of file Scenario_PauseAsync.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
            });
        }

void ToggleButtons ( bool state ) [inline, private]

Toggle button state while operations are in progress.

Parameters:
state State to set the buttons to

Definition at line 277 of file Scenario_PauseAsync.xaml.cs.

        {
            btnRecognize.IsEnabled = state;
            btnEmailGrammar.IsEnabled = state;
            btnPhoneGrammar.IsEnabled = state;
        }

void UpdateUI ( bool newState ) [inline, private]

Definition at line 416 of file Scenario_PauseAsync.xaml.cs.

        {
            btnRecognize.IsEnabled = newState;
            btnEmailGrammar.IsEnabled = newState;
            btnPhoneGrammar.IsEnabled = newState;
        }

Member Data Documentation

SpeechRecognitionListConstraint emailConstraint [private]

Definition at line 36 of file Scenario_PauseAsync.xaml.cs.

bool isListening [private]

Definition at line 33 of file Scenario_PauseAsync.xaml.cs.

SpeechRecognitionListConstraint phoneConstraint [private]

Definition at line 37 of file Scenario_PauseAsync.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario_PauseAsync.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 30 of file Scenario_PauseAsync.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_PredefinedDictationGrammar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_PredefinedDictationGrammar
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_PredefinedDictationGrammar Class Reference

List of all members.

Public Member Functions

Scenario_PredefinedDictationGrammar ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | InitializeRecognizer (Language recognizerLanguage)
async void | openPrivacySettings_Click (Hyperlink sender, HyperlinkClickEventArgs args)
void | PopulateLanguageDropdown ()
async void | RecognizeWithoutUIDictationGrammar_Click (object sender, RoutedEventArgs e)
async void | RecognizeWithUIDictationGrammar_Click (object sender, RoutedEventArgs e)
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

IAsyncOperation
< SpeechRecognitionResult > 		recognitionOperation
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultPrivacyStatementDeclined = 0x80045509

Detailed Description

Definition at line 28 of file Scenario_PredefinedDictationGrammar.xaml.cs.

Constructor & Destructor Documentation

Scenario_PredefinedDictationGrammar ( ) [inline]

Definition at line 42 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 111 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
                Language newLanguage = (Language)item.Tag;
                if (speechRecognizer.CurrentLanguage != newLanguage)
                {
                    // trigger cleanup and re-initialization of speech.
                    try
                    {
                        speechContext.Languages = new string[] { newLanguage.LanguageTag };

                        await InitializeRecognizer(newLanguage);
                    }
                    catch (Exception exception)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 166 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            // Create an instance of SpeechRecognizer.
            speechRecognizer = new SpeechRecognizer(recognizerLanguage);

            // Provide feedback to the user about the state of the recognizer.
            speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

            // Compile the dictation topic constraint, which optimizes for dictated speech.
            var dictationConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "dictation");
            speechRecognizer.Constraints.Add(dictationConstraint);
            SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();

            // RecognizeWithUIAsync allows developers to customize the prompts.
            speechRecognizer.UIOptions.AudiblePrompt = "Dictate a phrase or sentence...";
            speechRecognizer.UIOptions.ExampleText = speechResourceMap.GetValue("DictationUIOptionsExampleText", speechContext).ValueAsString;

            // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
            if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
            {
                // Disable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;

                // Let the user know that the grammar didn't compile properly.
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Unable to compile grammar.";
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.

Parameters:
e Details about the navigation event

Definition at line 139 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            if (speechRecognizer != null)
            {
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    if (recognitionOperation != null)
                    {
                        recognitionOperation.Cancel();
                        recognitionOperation = null;
                    }
                }

                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

When activating the scenario, ensure we have permission from the user to access their microphone, and provide an appropriate path for the user to enable access to the microphone if they haven't given explicit permission for it.

Parameters:
e The navigation event details

Definition at line 53 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                // Enable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = true;
                btnRecognizeWithoutUI.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { speechLanguage.LanguageTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;

            }
        }

async void openPrivacySettings_Click | ( | Hyperlink | sender,
 |  | HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the Microsoft Privacy Policy, and enable personalization.

Parameters:
sender | Ignored
args | Ignored

Definition at line 338 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-speech"));
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 86 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedTopicLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }
        }

async void RecognizeWithoutUIDictationGrammar_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses developer-provided UI for user feedback.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 275 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;

            // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
            btnRecognizeWithUI.IsEnabled = false;
            btnRecognizeWithoutUI.IsEnabled = false;
            cbLanguageSelection.IsEnabled = false;
            hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
            listenWithoutUIButtonText.Text = " listening for speech...";

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                // If successful, display the recognition result.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = speechRecognitionResult.Text;
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    hlOpenPrivacySettings.Visibility = Visibility.Visible;
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

            // Reset UI state.
            listenWithoutUIButtonText.Text = " without UI";
            cbLanguageSelection.IsEnabled = true;
            btnRecognizeWithUI.IsEnabled = true;
            btnRecognizeWithoutUI.IsEnabled = true;
        }

async void RecognizeWithUIDictationGrammar_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses the built-in speech recognition UI.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 224 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;
            hlOpenPrivacySettings.Visibility = Visibility.Collapsed;

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeWithUIAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                // If successful, display the recognition result.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = speechRecognitionResult.Text;
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    hlOpenPrivacySettings.Visibility = Visibility.Visible;
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Handle SpeechRecognizer state changed events by updating a UI component.

Parameters:
sender | Speech recognizer that generated this status event
args | The recognizer's status

Definition at line 210 of file Scenario_PredefinedDictationGrammar.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

uint HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 35 of file Scenario_PredefinedDictationGrammar.xaml.cs.

IAsyncOperation<SpeechRecognitionResult> recognitionOperation [private]

Definition at line 38 of file Scenario_PredefinedDictationGrammar.xaml.cs.

ResourceContext speechContext [private]

Definition at line 39 of file Scenario_PredefinedDictationGrammar.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 37 of file Scenario_PredefinedDictationGrammar.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 40 of file Scenario_PredefinedDictationGrammar.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_PredefinedWebSearchGrammar Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_PredefinedWebSearchGrammar
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_PredefinedWebSearchGrammar Class Reference

List of all members.

Public Member Functions

Scenario_PredefinedWebSearchGrammar ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
async Task | InitializeRecognizer (Language recognizerLanguage)
async void | openPrivacySettings_Click (Hyperlink sender, HyperlinkClickEventArgs args)
void | PopulateLanguageDropDown ()
async void | RecognizeWithoutUIWebSearchGrammar_Click (object sender, RoutedEventArgs e)
async void | RecognizeWithUIWebSearchGrammar_Click (object sender, RoutedEventArgs e)
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

IAsyncOperation
< SpeechRecognitionResult > 		recognitionOperation
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultPrivacyStatementDeclined = 0x80045509

Detailed Description

Definition at line 28 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

Constructor & Destructor Documentation

Scenario_PredefinedWebSearchGrammar ( ) [inline]

Definition at line 42 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 308 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
                Language newLanguage = (Language)item.Tag;
                if (speechRecognizer.CurrentLanguage != newLanguage)
                {
                    // trigger cleanup and re-initialization of speech.
                    try
                    {
                        speechContext.Languages = new string[] { newLanguage.LanguageTag };

                        await InitializeRecognizer(newLanguage);
                    }
                    catch (Exception exception)
                    {
                        var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 134 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            // Create an instance of SpeechRecognizer.
            speechRecognizer = new SpeechRecognizer(recognizerLanguage);

            // Provide feedback to the user about the state of the recognizer.
            speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

            // Add a web search topic constraint to the recognizer.
            var webSearchGrammar = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "webSearch");
            speechRecognizer.Constraints.Add(webSearchGrammar);

            // RecognizeWithUIAsync allows developers to customize the prompts.
            speechRecognizer.UIOptions.AudiblePrompt = "Say what you want to search for...";
            speechRecognizer.UIOptions.ExampleText = speechResourceMap.GetValue("WebSearchUIOptionsExampleText", speechContext).ValueAsString;

            // Compile the constraint.
            SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();

            // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
            if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
            {
                // Disable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;

                // Let the user know that the grammar didn't compile properly.
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Unable to compile grammar.";
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.

Parameters:
e Details about the navigation event

Definition at line 108 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            base.OnNavigatedFrom(e);
            if (speechRecognizer != null)
            {
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    if (recognitionOperation != null)
                    {
                        recognitionOperation.Cancel();
                        recognitionOperation = null;
                    }
                }

                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

When activating the scenario, ensure we have permission from the user to access their microphone, and provide an appropriate path for the user to enable access to the microphone if they haven't given explicit permission for it.

Parameters:
e The navigation event details

Definition at line 53 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                // Enable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = true;
                btnRecognizeWithoutUI.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { speechLanguage.LanguageTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropDown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }

async void openPrivacySettings_Click | ( | Hyperlink | sender,
 |  | HyperlinkClickEventArgs | args |
 | ) |  |  | [inline, private]

Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the Microsoft Privacy Policy, and enable personalization.

Parameters:
sender | Ignored
args | Ignored

Definition at line 338 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-speech"));
        }

void PopulateLanguageDropDown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Definition at line 85 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedTopicLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }
        }

async void RecognizeWithoutUIWebSearchGrammar_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses developer-provided UI for user feedback.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 245 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;

            // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
            btnRecognizeWithUI.IsEnabled = false;
            btnRecognizeWithoutUI.IsEnabled = false;
            cbLanguageSelection.IsEnabled = false;
            hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
            listenWithoutUIButtonText.Text = " listening for speech...";

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                // If successful, display the recognition result.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = speechRecognitionResult.Text;
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    hlOpenPrivacySettings.Visibility = Visibility.Visible;
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

            // Reset UI state.
            listenWithoutUIButtonText.Text = " without UI";
            btnRecognizeWithUI.IsEnabled = true;
            cbLanguageSelection.IsEnabled = true;
            btnRecognizeWithoutUI.IsEnabled = true;
        }

async void RecognizeWithUIWebSearchGrammar_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses the built-in speech recognition UI.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 194 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;
            hlOpenPrivacySettings.Visibility = Visibility.Collapsed;

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeWithUIAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                // If successful, display the recognition result.
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = speechRecognitionResult.Text;
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    hlOpenPrivacySettings.Visibility = Visibility.Visible;
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Handle SpeechRecognizer state changed events by updating a UI component.

Parameters:
sender | Speech recognizer that generated this status event
args | The recognizer's status

Definition at line 180 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

uint HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 35 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

IAsyncOperation<SpeechRecognitionResult> recognitionOperation [private]

Definition at line 38 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

ResourceContext speechContext [private]

Definition at line 39 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 37 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 40 of file Scenario_PredefinedWebSearchGrammar.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_SampleOverview Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_SampleOverview
Public Member Functions

Scenario_SampleOverview Class Reference

List of all members.

Public Member Functions

Scenario_SampleOverview ()

Detailed Description

Definition at line 19 of file Scenario_SampleOverview.xaml.cs.

Constructor & Destructor Documentation

Scenario_SampleOverview ( ) [inline]

Definition at line 21 of file Scenario_SampleOverview.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following files:
  • XamlCloudFontIntegration/cs/Scenario_SampleOverview.xaml.cs
  • DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.cpp
  • XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_SRGSConstraint Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_SRGSConstraint
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario_SRGSConstraint Class Reference

List of all members.

Public Member Functions

Scenario_SRGSConstraint ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
async override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | cbLanguageSelection_SelectionChanged (object sender, SelectionChangedEventArgs e)
Color | getColor (string colorString)
void | HandleRecognitionResult (SpeechRecognitionResult recoResult)
async Task | InitializeRecognizer (Language recognizerLanguage)
void | PopulateLanguageDropdown ()
async void | RecognizeWithoutUI_Click (object sender, RoutedEventArgs e)
async void | RecognizeWithUI_Click (object sender, RoutedEventArgs e)
async void | SpeechRecognizer_StateChanged (SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)

Private Attributes

Dictionary< string, Color > | colorLookup
bool | isPopulatingLanguages = false
IAsyncOperation
< SpeechRecognitionResult > 		recognitionOperation
ResourceContext | speechContext
SpeechRecognizer | speechRecognizer
ResourceMap | speechResourceMap

Static Private Attributes

static uint | HResultPrivacyStatementDeclined = 0x80045509
static uint | HResultRecognizerNotFound = 0x8004503a

Detailed Description

Definition at line 31 of file Scenario_SRGSConstraint.xaml.cs.

Constructor & Destructor Documentation

Scenario_SRGSConstraint ( ) [inline]

Definition at line 62 of file Scenario_SRGSConstraint.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

async void cbLanguageSelection_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

When a user changes the speech recognition language, trigger re-initialization of the speech engine with that language, and change any speech-specific UI assets.

Parameters:
sender | Ignored
e | Ignored

Definition at line 139 of file Scenario_SRGSConstraint.xaml.cs.

        {
            if (isPopulatingLanguages)
            {
                return;
            }

            ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
            Language newLanguage = (Language)item.Tag;

            if (speechRecognizer != null)
            {
                if (speechRecognizer.CurrentLanguage == newLanguage)
                {
                    return;
                }
            }

            // trigger cleanup and re-initialization of speech.
            try
            {
                speechContext.Languages = new string[] { newLanguage.LanguageTag };

                await InitializeRecognizer(newLanguage);
            }
            catch (Exception exception)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                await messageDialog.ShowAsync();
            }
        }

Color getColor ( string colorString ) [inline, private]

Creates a color object from the passed in string.

Parameters:
colorString The name of the color

Definition at line 500 of file Scenario_SRGSConstraint.xaml.cs.

        {
            Color newColor = Colors.Transparent;

            if (colorLookup.ContainsKey(colorString))
            {
                newColor = colorLookup[colorString];
            }

            return newColor;
        }

void HandleRecognitionResult ( SpeechRecognitionResult recoResult ) [inline, private]

Uses the result from the speech recognizer to change the colors of the shapes.

Parameters:
recoResult The result from the recognition event

Definition at line 407 of file Scenario_SRGSConstraint.xaml.cs.

        {
            // Check the confidence level of the recognition result.
            if (recoResult.Confidence == SpeechRecognitionConfidence.High ||
            recoResult.Confidence == SpeechRecognitionConfidence.Medium)
            {
                // Declare a string that will contain messages when the color rule matches GARBAGE.
                string garbagePrompt = "";

                // BACKGROUND: Check to see if the recognition result contains the semantic key for the background color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BACKGROUND") && recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString() != "...")
                {
                    string backgroundColor = recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString();
                    colorRectangle.Fill = new SolidColorBrush(getColor(backgroundColor));
                }

                // If "background" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BACKGROUND") && recoResult.SemanticInterpretation.Properties["KEY_BACKGROUND"][0].ToString() == "...")
                {

                    garbagePrompt += speechResourceMap.GetValue("SRGSBackgroundGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // BORDER: Check to see if the recognition result contains the semantic key for the border color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BORDER") && recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString() != "...")
                {
                    string borderColor = recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString();
                    colorRectangle.Stroke = new SolidColorBrush(getColor(borderColor));
                }

                // If "border" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_BORDER") && recoResult.SemanticInterpretation.Properties["KEY_BORDER"][0].ToString() == "...")
                {
                    garbagePrompt += speechResourceMap.GetValue("SRGSBorderGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // CIRCLE: Check to see if the recognition result contains the semantic key for the circle color,
                // and not a match for the GARBAGE rule, and change the color.
                if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_CIRCLE") && recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString() != "...")
                {
                    string circleColor = recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString();
                    colorCircle.Fill = new SolidColorBrush(getColor(circleColor));
                }

                // If "circle" was matched, but the color rule matched GARBAGE, prompt the user.
                else if (recoResult.SemanticInterpretation.Properties.ContainsKey("KEY_CIRCLE") && recoResult.SemanticInterpretation.Properties["KEY_CIRCLE"][0].ToString() == "...")
                {
                    garbagePrompt += speechResourceMap.GetValue("SRGSCircleGarbagePromptText", speechContext).ValueAsString;
                    resultTextBlock.Text = garbagePrompt;
                }

                // Initialize a string that will describe the user's color choices.
                string textBoxColors = "You selected (Semantic Interpretation)-> \n";

                // Write the color choices contained in the semantics of the recognition result to the text box.
                foreach (KeyValuePair<String, IReadOnlyList<string>> child in recoResult.SemanticInterpretation.Properties)
                {

                    // Check to see if any of the semantic values in recognition result contains a match for the GARBAGE rule.
                    if (!child.Value.Equals("..."))
                    {

                        // Cycle through the semantic keys and values and write them to the text box.
                        textBoxColors += (string.Format(" {0} {1}\n",
                        child.Value[0], child.Key ?? "null"));

                        resultTextBlock.Text = textBoxColors;
                    }

                    // If there was no match to the colors rule or if it matched GARBAGE, prompt the user.
                    else
                    {
                        resultTextBlock.Text = garbagePrompt;
                    }
                }
            }

            // Prompt the user if recognition failed or recognition confidence is low.
            else if (recoResult.Confidence == SpeechRecognitionConfidence.Rejected ||
            recoResult.Confidence == SpeechRecognitionConfidence.Low)
            {
                resultTextBlock.Text = speechResourceMap.GetValue("SRGSGarbagePromptText", speechContext).ValueAsString;
            }
        }

async Task InitializeRecognizer ( Language recognizerLanguage ) [inline, private]

Initialize Speech Recognizer and compile constraints.

Parameters:
recognizerLanguage Language to use for the speech recognizer
Returns:
Awaitable task.

Definition at line 201 of file Scenario_SRGSConstraint.xaml.cs.

        {
            if (speechRecognizer != null)
            {
                // cleanup prior to re-initializing this scenario.
                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }

            try
            {
                // Initialize the SRGS-compliant XML file.
                // For more information about grammars for Windows apps and how to
                // define and use SRGS-compliant grammars in your app, see
                // https://msdn.microsoft.com/en-us/library/dn596121.aspx

                // determine the language code being used.
                string languageTag = recognizerLanguage.LanguageTag;
                string fileName = String.Format("SRGS\\{0}\\SRGSColors.xml", languageTag);
                StorageFile grammarContentFile = await Package.Current.InstalledLocation.GetFileAsync(fileName);

                // Initialize the SpeechRecognizer and add the grammar.
                speechRecognizer = new SpeechRecognizer(recognizerLanguage);

                // Provide feedback to the user about the state of the recognizer.
                speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;

                // RecognizeWithUIAsync allows developers to customize the prompts.
                speechRecognizer.UIOptions.ExampleText = speechResourceMap.GetValue("SRGSUIOptionsExampleText", speechContext).ValueAsString;

                SpeechRecognitionGrammarFileConstraint grammarConstraint = new SpeechRecognitionGrammarFileConstraint(grammarContentFile);
                speechRecognizer.Constraints.Add(grammarConstraint);
                SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();

                // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
                if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
                {
                    // Disable the recognition buttons.
                    btnRecognizeWithUI.IsEnabled = false;
                    btnRecognizeWithoutUI.IsEnabled = false;

                    // Let the user know that the grammar didn't compile properly.
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Unable to compile grammar.";
                }
                else
                {
                    btnRecognizeWithUI.IsEnabled = true;
                    btnRecognizeWithoutUI.IsEnabled = true;

                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = speechResourceMap.GetValue("SRGSListeningPromptText", speechContext).ValueAsString;

                    // Set EndSilenceTimeout to give users more time to complete speaking a phrase.
                    speechRecognizer.Timeouts.EndSilenceTimeout = TimeSpan.FromSeconds(1.2);
                }
            }
            catch (Exception ex)
            {
                if ((uint)ex.HResult == HResultRecognizerNotFound)
                {
                    btnRecognizeWithUI.IsEnabled = false;
                    btnRecognizeWithoutUI.IsEnabled = false;

                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "Speech Language pack for selected language not installed.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.

Parameters:
e Details about the navigation event

Definition at line 175 of file Scenario_SRGSConstraint.xaml.cs.

        {
            base.OnNavigatedFrom(e);
            if (speechRecognizer != null)
            {
                if (speechRecognizer.State != SpeechRecognizerState.Idle)
                {
                    if (recognitionOperation != null)
                    {
                        recognitionOperation.Cancel();
                        recognitionOperation = null;
                    }
                }

                speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;

                this.speechRecognizer.Dispose();
                this.speechRecognizer = null;
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

When activating the scenario, ensure we have permission from the user to access their microphone, and provide an appropriate path for the user to enable access to the microphone if they haven't given explicit permission for it.

Parameters:
e The navigation event details

Definition at line 73 of file Scenario_SRGSConstraint.xaml.cs.

        {
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                // Enable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = true;
                btnRecognizeWithoutUI.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                string langTag = speechLanguage.LanguageTag;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { langTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";

                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }

void PopulateLanguageDropdown ( ) [inline, private]

Look up the supported languages for this speech recognition scenario, that are installed on this machine, and populate a dropdown with a list.

Populate language dropdown with supported Dictation languages.

Definition at line 107 of file Scenario_SRGSConstraint.xaml.cs.

        {

            // disable the callback so we don't accidentally trigger initialization of the recognizer
            // while initialization is already in progress.
            isPopulatingLanguages = true;

            Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
            IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
            foreach (Language lang in supportedLanguages)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Tag = lang;
                item.Content = lang.DisplayName;

                cbLanguageSelection.Items.Add(item);
                if (lang.LanguageTag == defaultLanguage.LanguageTag)
                {
                    item.IsSelected = true;
                    cbLanguageSelection.SelectedItem = item;
                }
            }

            isPopulatingLanguages = false;
        }

async void RecognizeWithoutUI_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses developer-provided UI for user feedback.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 347 of file Scenario_SRGSConstraint.xaml.cs.

        {
            // Reset the text to prompt the user.
            resultTextBlock.Text = speechResourceMap.GetValue("SRGSListeningPromptText", speechContext).ValueAsString;

            // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
            btnRecognizeWithUI.IsEnabled = false;
            btnRecognizeWithoutUI.IsEnabled = false;
            cbLanguageSelection.IsEnabled = false;
            listenWithoutUIButtonText.Text = " listening for speech...";

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    HandleRecognitionResult(speechRecognitionResult);
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "The privacy statement was declined.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }

            // Reset UI state.
            listenWithoutUIButtonText.Text = " without UI";
            cbLanguageSelection.IsEnabled = true;
            btnRecognizeWithUI.IsEnabled = true;
            btnRecognizeWithoutUI.IsEnabled = true;
        }

async void RecognizeWithUI_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Uses the recognizer constructed earlier to listen for speech from the user before displaying it back on the screen.

Uses the built-in speech recognition UI.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 297 of file Scenario_SRGSConstraint.xaml.cs.

        {
            // Reset the text to prompt the user.
            resultTextBlock.Text = speechResourceMap.GetValue("SRGSListeningPromptText", speechContext).ValueAsString;

            // Start recognition.
            try
            {
                recognitionOperation = speechRecognizer.RecognizeWithUIAsync();
                SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
                if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
                {
                    HandleRecognitionResult(speechRecognitionResult);
                }
                else
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
                }
            }
            catch (TaskCanceledException exception)
            {
                // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
                // processing speech. Since this happens here when we navigate out of the scenario, don't try to
                // show a message dialog for this exception.
                System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
                System.Diagnostics.Debug.WriteLine(exception.ToString());
            }
            catch (Exception exception)
            {
                // Handle the speech privacy policy error.
                if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
                {
                    resultTextBlock.Visibility = Visibility.Visible;
                    resultTextBlock.Text = "The privacy statement was declined.";
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
                    await messageDialog.ShowAsync();
                }
            }
        }

async void SpeechRecognizer_StateChanged | ( | SpeechRecognizer | sender,
 |  | SpeechRecognizerStateChangedEventArgs | args |
 | ) |  |  | [inline, private]

Handle SpeechRecognizer state changed events by updating a UI component.

Parameters:
sender | Speech recognizer that generated this status event
args | The recognizer's status

Definition at line 283 of file Scenario_SRGSConstraint.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
            });
        }

Member Data Documentation

Dictionary<string, Color> colorLookup [private]
Initial value:
 new Dictionary<string, Color>
        {
            { "COLOR_RED",   Colors.Red },   {"COLOR_BLUE",  Colors.Blue },  {"COLOR_BLACK",  Colors.Black},
            { "COLOR_BROWN", Colors.Brown},  {"COLOR_PURPLE",Colors.Purple}, {"COLOR_GREEN",  Colors.Green},
            { "COLOR_YELLOW",Colors.Yellow}, {"COLOR_CYAN",  Colors.Cyan},   {"COLOR_MAGENTA",Colors.Magenta},
            { "COLOR_ORANGE",Colors.Orange}, {"COLOR_GRAY",  Colors.Gray},   {"COLOR_WHITE",  Colors.White}
        }

Definition at line 53 of file Scenario_SRGSConstraint.xaml.cs.

uint HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 38 of file Scenario_SRGSConstraint.xaml.cs.

uint HResultRecognizerNotFound = 0x8004503a [static, private]

the HResult 0x8004503a typically represents the case where a recognizer for a particular language cannot be found.

This may occur if the language is installed, but the speech pack for that language is not. See Settings -> Time & Language -> Region & Language -> *Language* -> Options -> Speech Language Options.

Definition at line 45 of file Scenario_SRGSConstraint.xaml.cs.

bool isPopulatingLanguages = false [private]

Definition at line 51 of file Scenario_SRGSConstraint.xaml.cs.

IAsyncOperation<SpeechRecognitionResult> recognitionOperation [private]

Definition at line 48 of file Scenario_SRGSConstraint.xaml.cs.

ResourceContext speechContext [private]

Definition at line 49 of file Scenario_SRGSConstraint.xaml.cs.

SpeechRecognizer speechRecognizer [private]

Definition at line 47 of file Scenario_SRGSConstraint.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 50 of file Scenario_SRGSConstraint.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_SynthesizeSSML Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_SynthesizeSSML
Public Member Functions | Private Member Functions | Private Attributes

Scenario_SynthesizeSSML Class Reference

List of all members.

Public Member Functions

Scenario_SynthesizeSSML ()

Private Member Functions

void | FillTextBox (SpeechCue cue)
void | InitializeListboxVoiceChooser ()
void | ListboxVoiceChooser_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | media_MediaEnded (MediaPlayer sender, object e)
async void | metadata_MarkCueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | RegisterForMarkEvents (MediaPlaybackItem mediaPlaybackItem)
void | RegisterMetadataHandlerForMarks (MediaPlaybackItem mediaPlaybackItem, int index)
async void | Speak_Click (object sender, RoutedEventArgs e)
void | UpdateSSMLText ()

Private Attributes

ResourceContext | speechContext
ResourceMap | speechResourceMap
SpeechSynthesizer | synthesizer

Detailed Description

Definition at line 26 of file Scenario_SynthesizeSSML.xaml.cs.

Constructor & Destructor Documentation

Scenario_SynthesizeSSML ( ) [inline]

Definition at line 32 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            InitializeComponent();
            synthesizer = new SpeechSynthesizer();

            speechContext = ResourceContext.GetForCurrentView();
            speechContext.Languages = new string[] { SpeechSynthesizer.DefaultVoice.Language };

            speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationTTSResources");

            MediaPlayer player = new MediaPlayer();
            player.AutoPlay = false;
            player.MediaEnded += media_MediaEnded;

            media.SetMediaPlayer(player);
            media.MediaPlayer.AutoPlay = false;

            InitializeListboxVoiceChooser();
            UpdateSSMLText();
        }

Member Function Documentation

void FillTextBox ( SpeechCue cue ) [inline, private]

Update the UI with text from the mark.

Parameters:
cue The cue containing the text

Definition at line 191 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            textBoxLastMarkTriggered.Text = cue.Text;
        }

void InitializeListboxVoiceChooser ( ) [inline, private]

This creates items out of the system installed voices.

The voices are then displayed in a listbox. This allows the user to change the voice of the synthesizer in your app based on their preference.

Definition at line 218 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            // Get all of the installed voices.
            var voices = SpeechSynthesizer.AllVoices;

            // Get the currently selected voice.
            VoiceInformation currentVoice = synthesizer.Voice;

            foreach (VoiceInformation voice in voices.OrderBy(p => p.Language))
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Name = voice.DisplayName;
                item.Tag = voice;
                item.Content = voice.DisplayName + " (Language: " + voice.Language + ")";
                listboxVoiceChooser.Items.Add(item);

                // Check to see if we're looking at the current voice and set it as selected in the listbox.
                if (currentVoice.Id == voice.Id)
                {
                    item.IsSelected = true;
                    listboxVoiceChooser.SelectedItem = item;
                }
            }
        }

void ListboxVoiceChooser_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is called when the user has selects a voice from the drop down.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 248 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            ComboBoxItem item = (ComboBoxItem)(listboxVoiceChooser.SelectedItem);
            VoiceInformation voice = (VoiceInformation)(item.Tag);
            synthesizer.Voice = voice;

            // update UI text to be an appropriate default translation.
            speechContext.Languages = new string[] { voice.Language };
            textToSynthesize.Text = speechResourceMap.GetValue("SynthesizeSSMLDefaultText", speechContext).ValueAsString;

            UpdateSSMLText();
        }

async void media_MediaEnded | ( | MediaPlayer | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is invoked when the stream is finished playing.

In this case, we're changing the button label based on the state.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 204 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
             () =>
             {
                 // Your UI update code goes here!
                 btnSpeak.Content = "Speak";
             });
        }

async void metadata_MarkCueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

This function executes when a SpeechCue is hit and calls the functions to update the UI.

Parameters:
timedMetadataTrack | The timedMetadataTrack associated with the event.
args | the arguments associated with the event.

Definition at line 167 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            // Check in case there are different tracks and the handler was used for more tracks
            if (timedMetadataTrack.TimedMetadataKind == TimedMetadataKind.Speech)
            {
                var cue = args.Cue as SpeechCue;
                if (cue != null)
                {
                    System.Diagnostics.Debug.WriteLine("Cue text:[" + cue.Text + "]");
                    // Do something with the cue
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                     () =>
                     {
                         // Your UI update code goes here!
                         FillTextBox(cue);
                     });
                }
            }
        }

void RegisterForMarkEvents ( MediaPlaybackItem mediaPlaybackItem ) [inline, private]

Register for all mark events.

Parameters:
mediaPlaybackItem The Media PLayback Item add handlers to.

Definition at line 119 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            //tracks could all be generated at creation
            for (int index =0; index < mediaPlaybackItem.TimedMetadataTracks.Count; index++)
            {
                RegisterMetadataHandlerForMarks(mediaPlaybackItem, index);
            }

            // if the tracks are added later we will
            // monitor the tracks being added and subscribe to the ones of interest
            mediaPlaybackItem.TimedMetadataTracksChanged += (MediaPlaybackItem sender, IVectorChangedEventArgs args) =>
            {
                if (args.CollectionChange == CollectionChange.ItemInserted)
                {
                    RegisterMetadataHandlerForMarks(sender, (int)args.Index);
                }
                else if (args.CollectionChange == CollectionChange.Reset)
                {
                    for (int index = 0; index < sender.TimedMetadataTracks.Count; index++)
                    {
                        RegisterMetadataHandlerForMarks(sender, index);
                    }
                }
            };
        }

void RegisterMetadataHandlerForMarks | ( | MediaPlaybackItem | mediaPlaybackItem,
 |  | int | index |
 | ) |  |  | [inline, private]

Register for just word bookmark events.

Parameters:
mediaPlaybackItem | The Media Playback Item to register handlers for.
index | Index of the timedMetadataTrack within the mediaPlaybackItem.

Definition at line 150 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            //make sure we only register for bookmarks
            var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
            if(timedTrack.Id == "SpeechBookmark")
            {
                timedTrack.CueEntered += metadata_MarkCueEntered;
                mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);

            }
        }

async void Speak_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is invoked when the user clicks on the speak/stop button.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 58 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            // If the media is playing, the user has pressed the button to stop the playback.
            if (media.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
            {
                media.MediaPlayer.Pause();
                btnSpeak.Content = "Speak";
            }
            else
            {
                string text = textToSynthesize.Text;
                if (!string.IsNullOrEmpty(text))
                {
                    // Change the button label. You could also just disable the button if you don't want any user control.
                    btnSpeak.Content = "Stop";

                    try
                    {
                        // Create a stream from the text. This will be played using a media element.
                        SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeSsmlToStreamAsync(text);

                        // Create a media source from the stream:
                        var mediaSource = MediaSource.CreateFromStream(synthesisStream, synthesisStream.ContentType);

                        //Create a Media Playback Item
                        var mediaPlaybackItem = new MediaPlaybackItem(mediaSource);

                        // Ensure that the app is notified for marks.
                        RegisterForMarkEvents(mediaPlaybackItem);

                        // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
                        // and start playing the synthesized audio stream.
                        media.Source = mediaPlaybackItem;
                        media.MediaPlayer.Play();
                    }
                    catch (System.IO.FileNotFoundException)
                    {
                        // If media player components are unavailable, (eg, using a N SKU of windows), we won't
                        // be able to start media playback. Handle this gracefully
                        btnSpeak.Content = "Speak";
                        btnSpeak.IsEnabled = false;
                        textToSynthesize.IsEnabled = false;
                        listboxVoiceChooser.IsEnabled = false;
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components unavailable");
                        await messageDialog.ShowAsync();
                    }
                    catch (Exception)
                    {
                        // If the SSML stream is not in the correct format, throw an error message to the user.
                        btnSpeak.Content = "Speak";
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Unable to synthesize text");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

void UpdateSSMLText ( ) [inline, private]

Update the text in the SSML field to match the language of the chosen synthesizer voice.

SSML language takes priority over the chosen synthesizer language. Thus, when changing voices, we need to update the SSML language to match.

Definition at line 268 of file Scenario_SynthesizeSSML.xaml.cs.

        {
            try
            {
                string text = textToSynthesize.Text;
                string language = synthesizer.Voice.Language;

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(text);

                var LangAttribute = doc.DocumentElement.GetAttributeNode("xml:lang");
                LangAttribute.InnerText = language;

                textToSynthesize.Text = doc.GetXml();
            }
            catch
            {
                // This can fail if the user is in the process of editing the XML.
                // In this case, we don't update the SSML language but also don't throw a failure.
            }
        }

Member Data Documentation

ResourceContext speechContext [private]

Definition at line 29 of file Scenario_SynthesizeSSML.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 30 of file Scenario_SynthesizeSSML.xaml.cs.

SpeechSynthesizer synthesizer [private]

Definition at line 28 of file Scenario_SynthesizeSSML.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_SynthesizeText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_SynthesizeText
Public Member Functions | Private Member Functions | Private Attributes

Scenario_SynthesizeText Class Reference

List of all members.

Public Member Functions

Scenario_SynthesizeText ()

Private Member Functions

void | InitializeListboxVoiceChooser ()
void | ListboxVoiceChooser_SelectionChanged (object sender, SelectionChangedEventArgs e)
void | media_MediaEnded (object sender, RoutedEventArgs e)
async void | Speak_Click (object sender, RoutedEventArgs e)

Private Attributes

ResourceContext | speechContext
ResourceMap | speechResourceMap
SpeechSynthesizer | synthesizer

Detailed Description

Definition at line 23 of file Scenario_SynthesizeText.xaml.cs.

Constructor & Destructor Documentation

Scenario_SynthesizeText ( ) [inline]

Definition at line 29 of file Scenario_SynthesizeText.xaml.cs.

        {
            InitializeComponent();
            synthesizer = new SpeechSynthesizer();

            speechContext = ResourceContext.GetForCurrentView();
            speechContext.Languages = new string[] { SpeechSynthesizer.DefaultVoice.Language };

            speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationTTSResources");

            InitializeListboxVoiceChooser();
        }

Member Function Documentation

void InitializeListboxVoiceChooser ( ) [inline, private]

This creates items out of the system installed voices.

The voices are then displayed in a listbox. This allows the user to change the voice of the synthesizer in your app based on their preference.

Definition at line 113 of file Scenario_SynthesizeText.xaml.cs.

        {
            // Get all of the installed voices.
            var voices = SpeechSynthesizer.AllVoices;

            // Get the currently selected voice.
            VoiceInformation currentVoice = synthesizer.Voice;

            foreach (VoiceInformation voice in voices.OrderBy(p=>p.Language))
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Name = voice.DisplayName;
                item.Tag = voice;
                item.Content = voice.DisplayName + " (Language: " + voice.Language + ")";
                listboxVoiceChooser.Items.Add(item);

                // Check to see if we're looking at the current voice and set it as selected in the listbox.
                if (currentVoice.Id == voice.Id)
                {
                    item.IsSelected = true;
                    listboxVoiceChooser.SelectedItem = item;
                }
            }
        }

void ListboxVoiceChooser_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is called when the user has selects a voice from the drop down.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 143 of file Scenario_SynthesizeText.xaml.cs.

        {
            ComboBoxItem item = (ComboBoxItem)(listboxVoiceChooser.SelectedItem);
            VoiceInformation voice = (VoiceInformation)(item.Tag);
            synthesizer.Voice = voice;

            // update UI text to be an appropriate default translation.
            speechContext.Languages = new string[] { voice.Language };
            textToSynthesize.Text = speechResourceMap.GetValue("SynthesizeTextDefaultText", speechContext).ValueAsString;
        }

void media_MediaEnded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is invoked when the stream is finished playing.

In this case, we're changing the button label based on the state.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 104 of file Scenario_SynthesizeText.xaml.cs.

        {
            btnSpeak.Content = "Speak";
        }

async void Speak_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is invoked when the user clicks on the speak/stop button.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 47 of file Scenario_SynthesizeText.xaml.cs.

        {
            // If the media is playing, the user has pressed the button to stop the playback.
            if (media.CurrentState == MediaElementState.Playing)
            {
                media.Stop();
                btnSpeak.Content = "Speak";
            }
            else
            {
                string text = textToSynthesize.Text;
                if (!String.IsNullOrEmpty(text))
                {
                    // Change the button label. You could also just disable the button if you don't want any user control.
                    btnSpeak.Content = "Stop";

                    try
                    {
                        // Create a stream from the text. This will be played using a media element.
                        SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeTextToStreamAsync(text);

                        // Set the source and start playing the synthesized audio stream.
                        media.AutoPlay = true;
                        media.SetSource(synthesisStream, synthesisStream.ContentType);
                        media.Play();
                    }
                    catch (System.IO.FileNotFoundException)
                    {
                        // If media player components are unavailable, (eg, using a N SKU of windows), we won't
                        // be able to start media playback. Handle this gracefully
                        btnSpeak.Content = "Speak";
                        btnSpeak.IsEnabled = false;
                        textToSynthesize.IsEnabled = false;
                        listboxVoiceChooser.IsEnabled = false;
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components unavailable");
                        await messageDialog.ShowAsync();
                    }
                    catch (Exception)
                    {
                        // If the text is unable to be synthesized, throw an error message to the user.
                        btnSpeak.Content = "Speak";
                        media.AutoPlay = false;
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Unable to synthesize text");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

Member Data Documentation

ResourceContext speechContext [private]

Definition at line 26 of file Scenario_SynthesizeText.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 27 of file Scenario_SynthesizeText.xaml.cs.

SpeechSynthesizer synthesizer [private]

Definition at line 25 of file Scenario_SynthesizeText.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario_SynthesizeTextBoundaries Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Scenario_SynthesizeTextBoundaries
Public Member Functions | Private Member Functions | Private Attributes

Scenario_SynthesizeTextBoundaries Class Reference

List of all members.

Public Member Functions

Scenario_SynthesizeTextBoundaries ()

Private Member Functions

void | FillTextBoxes (SpeechCue cue, TimedMetadataTrack timedMetadataTrack)
void | HighlightTextOnScreen (int?startPositionInInput, int?endPositionInInput)
void | InitializeListboxVoiceChooser ()
void | ListboxVoiceChooser_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | media_MediaEnded (MediaPlayer sender, object e)
async void | metadata_SpeechCueEntered (TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
void | RegisterForWordBoundaryEvents (MediaPlaybackItem mediaPlaybackItem)
void | RegisterMetadataHandlerForSentences (MediaPlaybackItem mediaPlaybackItem, int index)
void | RegisterMetadataHandlerForWords (MediaPlaybackItem mediaPlaybackItem, int index)
async void | Speak_Click (object sender, RoutedEventArgs e)

Private Attributes

ResourceContext | speechContext
ResourceMap | speechResourceMap
SpeechSynthesizer | synthesizer

Detailed Description

Definition at line 25 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

Constructor & Destructor Documentation

Scenario_SynthesizeTextBoundaries ( ) [inline]

Definition at line 31 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            InitializeComponent();
            synthesizer = new SpeechSynthesizer();

            speechContext = ResourceContext.GetForCurrentView();
            speechContext.Languages = new string[] { SpeechSynthesizer.DefaultVoice.Language };

            speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationTTSResources");

            MediaPlayer player = new MediaPlayer();
            player.AutoPlay = false;
            player.MediaEnded += media_MediaEnded;

            media.SetMediaPlayer(player);

            InitializeListboxVoiceChooser();
        }

Member Function Documentation

void FillTextBoxes | ( | SpeechCue | cue,
 |  | TimedMetadataTrack | timedMetadataTrack |
 | ) |  |  | [inline, private]

This function executes when a SpeechCue is hit and calls the functions to update the UI.

Parameters:
timedMetadataTrack | The timedMetadataTrack associated with the event.
cue | the SpeechCue object.

Definition at line 211 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            //if it is a sentence cue, populate the sentence text box.
            if(timedMetadataTrack.Id == "SpeechSentence")
            {
                textBoxLastSpeechSentence.Text = cue.Text;
            }
            //if it is a word cue, populate the word text box
            if(timedMetadataTrack.Id == "SpeechWord")
            {
                textBoxLastSpeechWord.Text = cue.Text;
            }
        }

void HighlightTextOnScreen | ( | int? | startPositionInInput,
 |  | int? | endPositionInInput |
 | ) |  |  | [inline, private]

This function selects the text associated with the start and end positions.

Parameters:
startPositionInput | the starting index of the word
endPositionInInput | the ending index of the word

Definition at line 230 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            if (startPositionInInput != null && endPositionInInput != null)
            {
                textToSynthesize.Select(startPositionInInput.Value, endPositionInInput.Value - startPositionInInput.Value + 1);
            }
        }

void InitializeListboxVoiceChooser ( ) [inline, private]

This creates items out of the system installed voices.

The voices are then displayed in a listbox. This allows the user to change the voice of the synthesizer in your app based on their preference.

Definition at line 138 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            // Get all of the installed voices.
            var voices = SpeechSynthesizer.AllVoices;

            // Get the currently selected voice.
            VoiceInformation currentVoice = synthesizer.Voice;

            foreach (VoiceInformation voice in voices.OrderBy(p => p.Language))
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Name = voice.DisplayName;
                item.Tag = voice;
                item.Content = voice.DisplayName + " (Language: " + voice.Language + ")";
                listboxVoiceChooser.Items.Add(item);

                // Check to see if we're looking at the current voice and set it as selected in the listbox.
                if (currentVoice.Id == voice.Id)
                {
                    item.IsSelected = true;
                    listboxVoiceChooser.SelectedItem = item;
                }
            }
        }

void ListboxVoiceChooser_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is called when the user has selects a voice from the drop down.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 168 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            ComboBoxItem item = (ComboBoxItem)(listboxVoiceChooser.SelectedItem);
            VoiceInformation voice = (VoiceInformation)(item.Tag);
            synthesizer.Voice = voice;

            // update UI text to be an appropriate default translation.
            speechContext.Languages = new string[] { voice.Language };
            textToSynthesize.Text = speechResourceMap.GetValue("SynthesizeTextBoundariesDefaultText", speechContext).ValueAsString;
        }

async void media_MediaEnded | ( | MediaPlayer | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

This is invoked when the stream is finished playing.

In this case, we're changing the button label based on the state.

Parameters:
sender | unused object parameter
e | unused event parameter

Definition at line 124 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
             () =>
             {
                 // Your UI update code goes here!
                 btnSpeak.Content = "Speak";
             });
        }

async void metadata_SpeechCueEntered | ( | TimedMetadataTrack | timedMetadataTrack,
 |  | MediaCueEventArgs | args |
 | ) |  |  | [inline, private]

This function executes when a SpeechCue is hit and calls the functions to update the UI.

Parameters:
timedMetadataTrack | The timedMetadataTrack associated with the event.
args | the arguments associated with the event.

Definition at line 184 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            // Check in case there are different tracks and the handler was used for more tracks
            if (timedMetadataTrack.TimedMetadataKind == TimedMetadataKind.Speech)
            {
                var cue = args.Cue as SpeechCue;
                if (cue != null)
                {
                    System.Diagnostics.Debug.WriteLine("Hit Cue with start:" + cue.StartPositionInInput + " and end:" + cue.EndPositionInInput);
                    System.Diagnostics.Debug.WriteLine("Cue text:[" + cue.Text + "]");
                    // Do something with the cue
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                     () =>
                     {
                         // Your UI update code goes here!
                         HighlightTextOnScreen(cue.StartPositionInInput, cue.EndPositionInInput);
                         FillTextBoxes(cue, timedMetadataTrack);
                     });
                }
            }
        }

void RegisterForWordBoundaryEvents ( MediaPlaybackItem mediaPlaybackItem ) [inline, private]

Register for all boundary events and register a function to add any new events if they arise.

Parameters:
mediaPlaybackItem The Media PLayback Item add handlers to.

Definition at line 242 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            // If tracks were available at source resolution time, itterate through and register:
            for (int index = 0; index < mediaPlaybackItem.TimedMetadataTracks.Count; index++)
            {
                RegisterMetadataHandlerForWords(mediaPlaybackItem, index);
                RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
            }

            // Since the tracks are added later we will
            // monitor the tracks being added and subscribe to the ones of interest
            mediaPlaybackItem.TimedMetadataTracksChanged += (MediaPlaybackItem sender, IVectorChangedEventArgs args) =>
            {
                if (args.CollectionChange == CollectionChange.ItemInserted)
                {
                    RegisterMetadataHandlerForWords(sender, (int)args.Index);
                    RegisterMetadataHandlerForSentences(mediaPlaybackItem, (int)args.Index);
                }
                else if (args.CollectionChange == CollectionChange.Reset)
                {
                    for (int index = 0; index < sender.TimedMetadataTracks.Count; index++)
                    {
                        RegisterMetadataHandlerForWords(sender, index);
                        RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
                    }
                }
            };
        }

void RegisterMetadataHandlerForSentences | ( | MediaPlaybackItem | mediaPlaybackItem,
 |  | int | index |
 | ) |  |  | [inline, private]

Register for just sentence boundary events.

Parameters:
mediaPlaybackItem | The Media Playback Item to register handlers for.
index | Index of the timedMetadataTrack within the mediaPlaybackItem.

Definition at line 292 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
            //register for only sentence cues
            if (timedTrack.Id == "SpeechSentence" && checkBoxSentenceBoundaries.IsChecked.Value)
            {
                timedTrack.CueEntered += metadata_SpeechCueEntered;
                mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
            }
        }

void RegisterMetadataHandlerForWords | ( | MediaPlaybackItem | mediaPlaybackItem,
 |  | int | index |
 | ) |  |  | [inline, private]

Register for just word boundary events.

Parameters:
mediaPlaybackItem | The Media Playback Item to register handlers for.
index | Index of the timedMetadataTrack within the mediaPlaybackItem.

Definition at line 276 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
            //register for only word cues
            if (timedTrack.Id == "SpeechWord" && checkBoxWordBoundaries.IsChecked.Value)
            {
                timedTrack.CueEntered += metadata_SpeechCueEntered;
                mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
            }
        }

async void Speak_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is invoked when the user clicks on the speak/stop button.

Parameters:
sender | Button that triggered this event
e | State information about the routed event

Definition at line 55 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

        {
            // If the media is playing, the user has pressed the button to stop the playback.
            if (media.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
            {
                media.MediaPlayer.Pause();
                btnSpeak.Content = "Speak";
            }
            else
            {
                string text = textToSynthesize.Text;
                if (!String.IsNullOrEmpty(text))
                {
                    // Change the button label. You could also just disable the button if you don't want any user control.
                    btnSpeak.Content = "Stop";

                    try
                    {
                        // Enable word marker generation (false by default).
                        synthesizer.Options.IncludeWordBoundaryMetadata = true;
                        synthesizer.Options.IncludeSentenceBoundaryMetadata = true;

                        SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeTextToStreamAsync(text);

                        // Create a media source from the stream:
                        var mediaSource = MediaSource.CreateFromStream(synthesisStream, synthesisStream.ContentType);

                        //Create a Media Playback Item
                        var mediaPlaybackItem = new MediaPlaybackItem(mediaSource);

                        // Ensure that the app is notified for cues.
                        RegisterForWordBoundaryEvents(mediaPlaybackItem);

                        // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
                        // and start playing the synthesized audio stream.
                        media.Source = mediaPlaybackItem;
                        media.MediaPlayer.Play();
                    }
                    catch (System.IO.FileNotFoundException)
                    {
                        // If media player components are unavailable, (eg, using a N SKU of windows), we won't
                        // be able to start media playback. Handle this gracefully
                        btnSpeak.Content = "Speak";
                        btnSpeak.IsEnabled = false;
                        textToSynthesize.IsEnabled = false;
                        listboxVoiceChooser.IsEnabled = false;
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components unavailable");
                        await messageDialog.ShowAsync();
                    }
                    catch (Exception)
                    {
                        // If the text is unable to be synthesized, throw an error message to the user.
                        btnSpeak.Content = "Speak";
                        media.AutoPlay = false;
                        var messageDialog = new Windows.UI.Popups.MessageDialog("Unable to synthesize text");
                        await messageDialog.ShowAsync();
                    }
                }
            }
        }

Member Data Documentation

ResourceContext speechContext [private]

Definition at line 28 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

ResourceMap speechResourceMap [private]

Definition at line 29 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

SpeechSynthesizer synthesizer [private]

Definition at line 27 of file Scenario_SynthesizeTextBoundaries.xaml.cs.

The documentation for this class was generated from the following files:
  • SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs
  • SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioBindingConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ScenarioBindingConverter
Public Member Functions

ScenarioBindingConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 140 of file MainPage.xaml.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 142 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 125 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 170 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 125 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 98 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 122 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 98 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 118 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 126 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 145 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 151 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 125 of file MainPage.xaml.cs.

        {
            Scenario s = value as Scenario;
            return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 131 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 128 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 104 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 176 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 148 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 124 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 131 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 157 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 132 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 104 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 151 of file MainPage.xaml.cs.

        {
            return true;
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 131 of file MainPage.xaml.cs.

        {
            return true;
        }

The documentation for this class was generated from the following files:
  • BackButton/cs/MainPage.xaml.cs
  • FilePickerContracts/cs/MainPage.xaml.cs
  • LiveDash/cs/LiveDashApp/MainPage.xaml.cs
  • MediaImport/cs/MainPage.xaml.cs
  • Nfc/Nfc/MainPage.xaml.cs
  • Projection/cs/MainPage.xaml.cs
  • SplashScreen/cs/MainPage.xaml.cs
  • XamlCommanding/cs/MainPage.xaml.cs
  • XamlDataVirtualization/cs/MainPage.xaml.cs
  • XamlDeferLoadStrategy/cs/MainPage.xaml.cs
  • XamlFocusVisuals/cs/MainPage.xaml.cs
  • XamlPivot/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScenarioCommon Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ScenarioCommon
Public Member Functions | Public Attributes | Properties | Private Attributes

ScenarioCommon Class Reference

List of all members.

Public Member Functions

void | OnBackgroundTaskCompleted (IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
bool | RegisteredCompletionHandlerForBackgroundTask ()

Public Attributes

BackgroundAuthenticationCompletedEventHandler | BackgroundAuthenticationCompleted
const string | BackgroundTaskEntryPoint = "HotspotAuthenticationTask.AuthenticationTask"
const string | BackgroundTaskName = "AuthenticationBackgroundTask"

Properties

static ScenarioCommon | Instance [get]

Private Attributes

bool | HasRegisteredBackgroundTaskHandler = false
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 33 of file ScenarioCommon.cs.

Member Function Documentation

void OnBackgroundTaskCompleted | ( | IBackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline]

Background task completion handler.

When authenticating through the foreground app, this triggers the authentication flow if the app is currently running.

Parameters:
sender
e

Definition at line 87 of file ScenarioCommon.cs.

        {
            if (sender.Name == BackgroundTaskName)
            {
                Exception exception = null;
                try
                {
                    // If the background task threw an exception, re-raise it here so we can pass it to the event handler.
                    e.CheckResult();
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                if (!ConfigStore.AuthenticateThroughBackgroundTask)
                {
                    BackgroundAuthenticationCompleted?.Invoke(this, new BackgroundAuthenticationCompletedEventArgs(null));
                }
            }
        }

bool RegisteredCompletionHandlerForBackgroundTask ( ) [inline]

Register completion handler for registered background task on application startup.

Returns:
True if a registerd task was found

Definition at line 57 of file ScenarioCommon.cs.

        {
            if (!HasRegisteredBackgroundTaskHandler)
            {
                try
                {
                    // Associate background task completed event handler with background task.
                    foreach (var cur in BackgroundTaskRegistration.AllTasks)
                    {
                        if (cur.Value.Name == BackgroundTaskName)
                        {
                            cur.Value.Completed += new BackgroundTaskCompletedEventHandler(OnBackgroundTaskCompleted);
                            HasRegisteredBackgroundTaskHandler = true;
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                }
            }
            return HasRegisteredBackgroundTaskHandler;
        }

Member Data Documentation

BackgroundAuthenticationCompletedEventHandler BackgroundAuthenticationCompleted

Definition at line 45 of file ScenarioCommon.cs.

const string BackgroundTaskEntryPoint = "HotspotAuthenticationTask.AuthenticationTask"

Definition at line 39 of file ScenarioCommon.cs.

const string BackgroundTaskName = "AuthenticationBackgroundTask"

Definition at line 42 of file ScenarioCommon.cs.

bool HasRegisteredBackgroundTaskHandler = false [private]

Definition at line 51 of file ScenarioCommon.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 48 of file ScenarioCommon.cs.

Property Documentation

ScenarioCommon Instance [static, get]

Definition at line 35 of file ScenarioCommon.cs.

The documentation for this class was generated from the following file:
  • HotspotAuthentication/cs/ScenarioCommon.cs
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneComposer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SceneComposer
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes

SceneComposer Class Reference

#include "SceneComposer.h"

List of all members.

Classes

class | InkObject
class | SceneObject
class | ShapeObject

Public Member Functions

SceneComposer ()
~SceneComposer ()
virtual ULONG STDMETHODCALLTYPE | AddRef () override
bool | CanPaste ()
void | ClearScene ()
void | CopySelected ()
void | CutSelected ()
void | DoCustomDry ()
void | DoErase (Windows::Foundation::Point prevPt, Windows::Foundation::Point currPt)
void | DrawLasso (Windows::Foundation::Point pt)
float | GetDPI ()
Windows::Foundation::Rect | GetSceneSelectionRect ()
Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource | Initialize (Windows::Foundation::Size sizeContent, Windows::Foundation::Size sizeViewPort)
void | Invalidate (_In_opt_ RECT *pInvalidateRect=nullptr)
void | OnViewSizeChanged (Windows::Foundation::Size newSize)
void | PasteSelected (Windows::Foundation::Point pastePosition)
virtual HRESULT STDMETHODCALLTYPE | QueryInterface (REFIID uuid, _Outptr_ void **object) override
virtual ULONG STDMETHODCALLTYPE | Release () override
void | SelectSceneObjects (Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^selectionPoints)
void | SetContentSize (Windows::Foundation::Size contentSize)
void | SetContentZoomFactor (float contentZoomFactor)
void | SetDPI (float dpi)
void | SetInkSynchronizer (Windows::UI::Input::Inking::InkSynchronizer^inkSynchronizer)
void | StartLassoSelection (Windows::Foundation::Point pt)
void | Trim ()
void | UnselectSceneObjects ()
void | UpdateInk (Windows::Foundation::Collections::IVectorView< Windows::UI::Input::Inking::InkStroke^>^strokes)
void | UpdateShape ()
virtual HRESULT STDMETHODCALLTYPE | UpdatesNeeded () override

Private Types

enum | SCENEOBJECT_TYPES { SOT_Ink = 0, SOT_Shape = 1, SOT_Generic = 2 }

Private Member Functions

RECT | ConvertUpdateRect (Windows::Foundation::Rect const &updateRect)
void | DeleteSceneObjects ()
void | DeleteSelectedAndUpdate ()
bool | Draw (_In_opt_ const RECT *pUpdateRect=nullptr)
void | RemoveSelectedStrokesFromSceneObjects ()
void | Render ()
void | RestoreDefaultStrokeSize ()
void | SelectInkSceneObject ()

Private Attributes

std::unique_ptr
< DX::DeviceResources > 		_deviceResources
bool | _EndDryPending
std::unique_ptr< InkRenderer > | _inkRenderer
Windows::UI::Input::Inking::InkSynchronizer | _inkSynchronizer
bool | _inLassoSelection
Windows::Foundation::Point | _ptCurrent
Windows::Foundation::Point | _ptInitial
ULONG | _refCount
std::vector< SceneObject * > | _sceneObjects
Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		_selectionBrush
std::unique_ptr< ShapeRenderer > | _shapeRenderer
Microsoft::WRL::ComPtr
< ID2D1StrokeStyle > 		_strokeStyle

Detailed Description

Definition at line 14 of file SceneComposer.h.

Member Enumeration Documentation

enum SCENEOBJECT_TYPES [private]
Enumerator:
SOT_Ink
SOT_Shape
SOT_Generic

Definition at line 99 of file SceneComposer.h.

                               {
            SOT_Ink = 0, SOT_Shape = 1, SOT_Generic = 2
        };

Constructor & Destructor Documentation

SceneComposer ( ) [inline]

Definition at line 17 of file SceneComposer.h.

{};

~SceneComposer ( )

Definition at line 33 of file SceneComposer.cpp.

{
    // Unregister image source's update callback
    ComPtr<IVirtualSurfaceImageSourceNative> imageSourceNative = _deviceResources->GetImageSourceNative();
    DX::ThrowIfFailed(imageSourceNative->RegisterForUpdatesNeeded(nullptr));

    DeleteSceneObjects();
}

Member Function Documentation

ULONG STDMETHODCALLTYPE AddRef ( ) [override, virtual]

Definition at line 528 of file SceneComposer.cpp.

{
    return static_cast<ULONG>(InterlockedIncrement(&_refCount));
}

bool CanPaste ( ) [inline]

Definition at line 74 of file SceneComposer.h.

{ return _inkRenderer->GetStrokeContainer()->CanPasteFromClipboard(); };

void ClearScene ( )

Definition at line 120 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    assert(_deviceResources != nullptr);

    DeleteSceneObjects();
    _sceneObjects.clear();
    _inkRenderer->Clear();
    _deviceResources->InvalidateContentRect();
}

RECT ConvertUpdateRect ( Windows::Foundation::Rect const & updateRect ) [private]

Definition at line 543 of file SceneComposer.cpp.

{
    // Enlarge the update rect to accommodate precision loss when covert float to long
    RECT updateRECT;
    updateRECT.left = static_cast<LONG>(updateRect.X) - RECT_DELTA;
    updateRECT.top = static_cast<LONG>(updateRect.Y) - RECT_DELTA;
    updateRECT.right = static_cast<LONG>(updateRect.X + updateRect.Width) + RECT_DELTA;
    updateRECT.bottom = static_cast<LONG>(updateRect.Y + updateRect.Height) + RECT_DELTA;

    return updateRECT;
}

void CopySelected ( )

Definition at line 325 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    RestoreDefaultStrokeSize();
    _inkRenderer->GetStrokeContainer()->CopySelectedToClipboard();
}

void CutSelected ( )

Definition at line 332 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    RestoreDefaultStrokeSize();
    _inkRenderer->GetStrokeContainer()->CopySelectedToClipboard();

    // Delete the scene objects in the cache and clear the selection rect
    _inkRenderer->UpdateSelectionRectangle(Windows::Foundation::Rect::Empty);
    DeleteSelectedAndUpdate();
}

void DeleteSceneObjects ( ) [private]

Definition at line 131 of file SceneComposer.cpp.

{
    for (unsigned int index = 0; index < _sceneObjects.size(); index++)
    {
        if (_sceneObjects[index] != nullptr)
        {
            delete _sceneObjects[index];
            _sceneObjects[index] = nullptr;
        }
    }
}

void DeleteSelectedAndUpdate ( ) [private]

Definition at line 205 of file SceneComposer.cpp.

{
    RemoveSelectedStrokesFromSceneObjects();
    Windows::Foundation::Rect updateRect = _inkRenderer->DeleteSelectedStrokes();

    if (!_inkRenderer->IsEmptyRect(updateRect))
    {
        assert(_deviceResources != nullptr);
        RECT vsisUpdateRect = _deviceResources->AdjustUpdateRect(ConvertUpdateRect(updateRect));
        _deviceResources->InvalidateRect(vsisUpdateRect);
    }
}

void DoCustomDry ( )

Definition at line 413 of file SceneComposer.cpp.

{
    assert(_inkSynchronizer != nullptr);
    Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ inkStrokes = _inkSynchronizer->BeginDry();
    assert(inkStrokes != nullptr);
    // Request VSIS update by invalidation and set the flag to call
    // InkSynchronizer's EndDry later. Note that before EndDry is
    // called, there will be no new StrokesCollected event fired
    // from InkPresenter, and we will not get any new stroke to dry.
    assert(!_EndDryPending);
    _EndDryPending = true;
    UpdateInk(inkStrokes);
}

void DoErase | ( | Windows::Foundation::Point | prevPt,
 |  | Windows::Foundation::Point | currPt
 | ) |  |

Definition at line 196 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    if (_inkRenderer->HasStrokesToErase(prevPt, currPt))
    {
        DeleteSelectedAndUpdate();
    }
}

bool Draw ( _In_opt_ const RECT * pUpdateRect = nullptr ) [private]

Definition at line 479 of file SceneComposer.cpp.

{
    assert(_deviceResources != nullptr);

    _deviceResources->BeginDraw(pUpdateRect);

    _deviceResources->ClearTarget();

    Render();

    if (_inLassoSelection)
    {
        // Draw lasso
        assert(_selectionBrush != nullptr && _strokeStyle != nullptr);
        D2D_RECT_F selectionRect = D2D1::RectF(_ptInitial.X, _ptInitial.Y, _ptCurrent.X, _ptCurrent.Y);
        _deviceResources->GetD2DDeviceContext()->DrawRectangle(selectionRect, _selectionBrush.Get(), 1.0f, _strokeStyle.Get());
    }
    else
    {
        // Draw selection rectangle
        _inkRenderer->DrawSelectionRect(_deviceResources->GetD2DDeviceContext(),
            _deviceResources->GetD2DFactory());
    }

    _deviceResources->EndDraw();

    return false;
}

void DrawLasso ( Windows::Foundation::Point pt )

Definition at line 259 of file SceneComposer.cpp.

{
    assert(_deviceResources != nullptr);

    // Lasso selection continues. Update the current end point of lasso rect
    _ptCurrent = pt;
    // Invalidate VSIS to trigger rendering update
    _deviceResources->InvalidateContentRect();
}

float GetDPI ( ) [inline]

Definition at line 55 of file SceneComposer.h.

{ return (_deviceResources != nullptr) ? _deviceResources->GetDPI() : 0; };

Windows::Foundation::Rect GetSceneSelectionRect ( )

Definition at line 189 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    Windows::Foundation::Rect rect = _inkRenderer->GetSelectionRectangle();
    return rect;
}

Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource Initialize | ( | Windows::Foundation::Size | sizeContent,
 |  | Windows::Foundation::Size | sizeViewPort
 | ) |  |

Definition at line 9 of file SceneComposer.cpp.

{
    _deviceResources = std::make_unique<DX::DeviceResources>(sizeContent, sizeViewPort);
    _shapeRenderer = std::make_unique<ShapeRenderer>();
    _inkRenderer = std::make_unique<InkRenderer>();

    assert(_deviceResources != nullptr);
    assert(_shapeRenderer != nullptr);
    assert(_inkRenderer != nullptr);

    _shapeRenderer->RefreshSize(sizeViewPort);

    // Register image source's update callback so update can be made to it.
    Microsoft::WRL::ComPtr<IVirtualSurfaceImageSourceNative> imageSourceNative = _deviceResources->GetImageSourceNative();
    DX::ThrowIfFailed(imageSourceNative->RegisterForUpdatesNeeded(this));

    _refCount = 0;
    _EndDryPending = false;
    _inLassoSelection = false;

    return _deviceResources->GetImageSource();
}

void Invalidate ( _In_opt_ RECT * pInvalidateRect = nullptr )

Definition at line 105 of file SceneComposer.cpp.

{
    assert(_deviceResources != nullptr);

    if (pInvalidateRect != nullptr)
    {
        // Invalidate VSIS to trigger rendering update
        _deviceResources->InvalidateRect(*pInvalidateRect);
    }
    else
    {
        _deviceResources->InvalidateContentRect();
    }
}

void OnViewSizeChanged ( Windows::Foundation::Size newSize )

Definition at line 154 of file SceneComposer.cpp.

{
    // This method can be called at program launch. By then device resources and
    // renderers are not initialized so we need to have null check.
    if (_shapeRenderer != nullptr)
    {
        // The size of shapes are proportional to the size of screen, so call
        // the shape renderer to recalculate max and min size for shapes.
        _shapeRenderer->RefreshSize(newSize);
    }
    if (_deviceResources != nullptr)
    {
        _deviceResources->SetViewSize(newSize);
        Invalidate();
    }
}

void PasteSelected ( Windows::Foundation::Point pastePosition )

Definition at line 343 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);

    if (_inkRenderer->GetStrokeContainer()->CanPasteFromClipboard())
    {
        Windows::Foundation::Rect pasteRect = _inkRenderer->GetStrokeContainer()->PasteFromClipboard(pastePosition);
        Windows::Foundation::Collections::IVector<Windows::Foundation::Point>^ pasteRectVector;

        // Create a selection rectangle that will be used to select strokes in the strokecontainer and then
        // we will add them to the scene object collection
        pasteRectVector = ref new Platform::Collections::Vector<Windows::Foundation::Point>();
        pasteRectVector->Append(Windows::Foundation::Point(pasteRect.Left, pasteRect.Top));
        pasteRectVector->Append(Windows::Foundation::Point(pasteRect.Left, pasteRect.Bottom));
        pasteRectVector->Append(Windows::Foundation::Point(pasteRect.Right, pasteRect.Bottom));
        pasteRectVector->Append(Windows::Foundation::Point(pasteRect.Right, pasteRect.Top));

        _inkRenderer->Select(pasteRectVector);
        Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ inkStrokes = _inkRenderer->GetStrokeContainer()->GetStrokes();
        for (unsigned int i = 0; i < inkStrokes->Size; i++)
        {
            if (inkStrokes->GetAt(i)->Selected)
            {
                InkObject* inkObject = new InkObject(inkStrokes->GetAt(i));
                _sceneObjects.push_back(inkObject);
            }
        }
        UnselectSceneObjects();
    }
}

HRESULT STDMETHODCALLTYPE QueryInterface | ( | REFIID | uuid,
 |  | _Outptr_ void ** | object |
 | ) |  |  | [override, virtual]

Definition at line 508 of file SceneComposer.cpp.

{
    if (uuid == IID_IUnknown
        || uuid == __uuidof(IVirtualSurfaceUpdatesCallbackNative)
        )
    {
        *object = this;
        AddRef();
        return S_OK;
    }
    else
    {
        *object = nullptr;
        return E_NOINTERFACE;
    }
}

ULONG STDMETHODCALLTYPE Release ( ) [override, virtual]

Definition at line 533 of file SceneComposer.cpp.

{
    ULONG newCount = static_cast<ULONG>(InterlockedDecrement(&_refCount));

    if (newCount == 0)
        delete this;

    return newCount;
}

void RemoveSelectedStrokesFromSceneObjects ( ) [private]

Definition at line 218 of file SceneComposer.cpp.

{
    for (std::vector<SceneObject*>::iterator pos = _sceneObjects.begin(); pos != _sceneObjects.end(); )
    {
        if ((*pos)->getType() == SOT_Ink)
        {
            InkObject* inkObject = dynamic_cast<InkObject*>(*pos);

            if(inkObject->IsStrokeSelected())
            {
                pos = _sceneObjects.erase(pos);
                delete inkObject;
                continue;
            }
        }
        pos++;
    }
}

void Render ( ) [private]

Definition at line 269 of file SceneComposer.cpp.

{
    auto strokes = ref new Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>;
    for (unsigned int index = 0; index < _sceneObjects.size(); index++)
    {
        if (_sceneObjects[index]->getType() == SOT_Ink)
        {
            InkObject* inkObject = dynamic_cast<InkObject*>(_sceneObjects[index]);
            if (inkObject != nullptr)
            {
                auto currentInkStroke = inkObject->getStrokes();
                // The max number of strokes in here is 2, one for the actual stroke and one for the highlighter
                for (unsigned int strokeIndex = 0; strokeIndex < currentInkStroke->Size; strokeIndex++)
                {
                    strokes->Append(currentInkStroke->GetAt(strokeIndex));
                }
                // Instead of passing one stroke at a time, we append all the strokes in the same z-order
                // to optimize the rendering of ink. Once we find that the next object in the scene is different
                // from ink or if we have reached the end of the vector, we pass the stroke collection to the
                // ink renderer.
                if ((index == (_sceneObjects.size() - 1)) ||
                    _sceneObjects[index + 1]->getType() == SOT_Shape)
                {
                    _inkRenderer->Render(strokes, _deviceResources->GetD2DDeviceContext());
                    strokes->Clear();
                }
            }
        }
        else if (_sceneObjects[index]->getType() == SOT_Shape)
        {
            ShapeObject* shape = dynamic_cast<ShapeObject*>(_sceneObjects[index]);
            if (shape != nullptr)
            {
                _shapeRenderer->Render(shape->getShape(), _deviceResources->GetD2DDeviceContext());
            }
        }
    }
}

void RestoreDefaultStrokeSize ( ) [private]

Definition at line 309 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ inkStrokes = _inkRenderer->GetStrokeContainer()->GetStrokes();
    for (unsigned int i = 0; i < inkStrokes->Size; i++)
    {
        Windows::UI::Input::Inking::InkStroke^ inkStroke = inkStrokes->GetAt(i);
        if (inkStroke->Selected)
        {
            auto strokeDrawingAttributes = inkStroke->DrawingAttributes;
            strokeDrawingAttributes->Size = InkObject::GetDefaultStrokeSize();
            inkStroke->DrawingAttributes = strokeDrawingAttributes;
        }
    }
}

void SelectInkSceneObject ( ) [private]

Definition at line 374 of file SceneComposer.cpp.

{
    Windows::Foundation::Rect selectionBoundingRect = Windows::Foundation::Rect::Empty;

    // Update the sceneInkObject to create or delete the highlighter stroke
    for (unsigned int index = 0; index < _sceneObjects.size(); index++)
    {
        if (_sceneObjects[index]->getType() == SOT_Ink)
        {
            InkObject* inkObject = dynamic_cast<InkObject*>(_sceneObjects[index]);
            if (inkObject != nullptr)
            {
                assert(_inkRenderer != nullptr);
                inkObject->SelectStroke(_inkRenderer->GetStrokeContainerForTemp());

                // Need to update selection bounding rect since we have changed the size
                // of selected strokes in the last step.
                if (inkObject->IsStrokeSelected())
                {
                    if (selectionBoundingRect.IsEmpty)
                    {
                        selectionBoundingRect = inkObject->GetInkStroke()->BoundingRect;
                    }
                    else
                    {
                        selectionBoundingRect.Union(inkObject->GetInkStroke()->BoundingRect);
                    }
                }
            }
        }
    }

    assert(_inkRenderer != nullptr);
    if (!_inkRenderer->IsEmptyRect(selectionBoundingRect))
    {
        _inkRenderer->UpdateSelectionRectangle(selectionBoundingRect);
    }
}

void SelectSceneObjects ( Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^ selectionPoints )

Definition at line 143 of file SceneComposer.cpp.

{
    _inLassoSelection = false;    // End of lasso selection

    assert(_inkRenderer != nullptr);
    // We call the inkRenderer to select the strokes in the strokecontainer. Then retrieve the stroke container
    // and update the vector of objects in the scene
    _inkRenderer->Select(selectionPoints);
    SelectInkSceneObject();
}

void SetContentSize ( Windows::Foundation::Size contentSize ) [inline]

Definition at line 43 of file SceneComposer.h.

                                                               {
            if (_deviceResources != nullptr) {
                _deviceResources->SetContentSize(contentSize);
            };
        };

void SetContentZoomFactor ( float contentZoomFactor ) [inline]

Definition at line 57 of file SceneComposer.h.

                                                           {
            if (_deviceResources != nullptr) {
                _deviceResources->SetContentZoomFactor(contentZoomFactor);
            }
        };

void SetDPI ( float dpi ) [inline]

Definition at line 49 of file SceneComposer.h.

                               {
            if (_deviceResources != nullptr) {
                _deviceResources->SetDPI(dpi);
            };
        };

void SetInkSynchronizer ( Windows::UI::Input::Inking::InkSynchronizer^ inkSynchronizer ) [inline]

Definition at line 77 of file SceneComposer.h.

                                                                                {
            _inkSynchronizer = inkSynchronizer;
        };

void StartLassoSelection ( Windows::Foundation::Point pt )

Definition at line 237 of file SceneComposer.cpp.

{
    _ptInitial = pt;
    _inLassoSelection = true;    // Start of lasso selection

    assert(_deviceResources != nullptr);
    DX::ThrowIfFailed(_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black), &_selectionBrush));

    DX::ThrowIfFailed(_deviceResources->GetD2DFactory()->CreateStrokeStyle(
        D2D1::StrokeStyleProperties(
        D2D1_CAP_STYLE_FLAT,
        D2D1_CAP_STYLE_FLAT,
        D2D1_CAP_STYLE_FLAT,
        D2D1_LINE_JOIN_ROUND,
        10.0F,
        D2D1_DASH_STYLE_DASH,
        0.0F),
        NULL,
        0,
        &_strokeStyle));
}

void Trim ( ) [inline]

Definition at line 62 of file SceneComposer.h.

                    {
            if (_deviceResources != nullptr) {
                _deviceResources->Trim();
            };
        };

void UnselectSceneObjects ( )

Definition at line 171 of file SceneComposer.cpp.

{
    assert(_inkRenderer != nullptr);
    assert(_deviceResources != nullptr);

    Windows::Foundation::Rect selectRect = _inkRenderer->GetSelectionRectangle();
    if (!selectRect.IsEmpty)
    {
        _inkRenderer->UnselectAll();
        SelectInkSceneObject();
        // Since we have undone the selection, it is safe to clear all the
        // temporarily created strokes for selection hollow effect
        _inkRenderer->ClearStrokeContainerForTemp();
        RECT updateRect = _deviceResources->AdjustUpdateRect(ConvertUpdateRect(selectRect));
        _deviceResources->InvalidateRect(updateRect);
    }
}

void UpdateInk ( Windows::Foundation::Collections::IVectorView< Windows::UI::Input::Inking::InkStroke^>^ strokes )

Definition at line 42 of file SceneComposer.cpp.

{
    Windows::Foundation::Rect strokesBoundingRect = Windows::Foundation::Rect::Empty;

    assert(strokes != nullptr);
    assert(_inkRenderer != nullptr);

    for (unsigned int i = 0; i < strokes->Size; i++)
    {
        Windows::UI::Input::Inking::InkStroke^ inkStroke = strokes->GetAt(i);
        if (strokesBoundingRect.IsEmpty)
        {
            strokesBoundingRect = inkStroke->BoundingRect;
        }
        else
        {
            strokesBoundingRect.Union(inkStroke->BoundingRect);
        }
        _inkRenderer->Update(inkStroke);
        InkObject* inkObject = new InkObject(inkStroke);
        _sceneObjects.push_back(inkObject);
    }

    if (strokes->Size > 0)
    {
        assert(!strokesBoundingRect.IsEmpty);
        assert(_deviceResources != nullptr);
        RECT updateRect = _deviceResources->AdjustUpdateRect(ConvertUpdateRect(strokesBoundingRect));
        Invalidate(&updateRect);
    }
    else
    {
        // Need to call EndDry to complete the drying process even if there is zero stroke returned
        if (_EndDryPending)
        {
            assert(_inkSynchronizer != nullptr);
            _inkSynchronizer->EndDry();
            _EndDryPending = false;
        }
    }
}

void UpdateShape ( )

Definition at line 84 of file SceneComposer.cpp.

{
    Windows::Foundation::Rect shapeRect = Windows::Foundation::Rect::Empty;

    assert(_shapeRenderer != nullptr);
    assert(_deviceResources != nullptr);
    Shape shape = _shapeRenderer->Update(_deviceResources->GetD2DDeviceContext());
    shapeRect.X = shape.shape.left;
    shapeRect.Y = shape.shape.top;
    shapeRect.Width = shape.shape.right - shape.shape.left;
    shapeRect.Height = shape.shape.bottom - shape.shape.top;

    SceneComposer::ShapeObject* shapeObject = new ShapeObject(shape);
    _sceneObjects.push_back(shapeObject);

    assert(shapeRect.Width > 0 && shapeRect.Height > 0);
    assert(_deviceResources != nullptr);
    RECT updateRect = _deviceResources->AdjustUpdateRect(ConvertUpdateRect(shapeRect));
    Invalidate(&updateRect);
}

HRESULT STDMETHODCALLTYPE UpdatesNeeded ( ) [override, virtual]

Definition at line 429 of file SceneComposer.cpp.

{
    HRESULT hr = S_OK;
    RECT* updateRects = nullptr;
    ULONG updateRectsCount = 0;

    assert(_deviceResources != nullptr);

    try
    {
        _deviceResources->GetUpdateRects(&updateRects, &updateRectsCount);

        for (ULONG i = 0; i < updateRectsCount; ++i)
        {
            Draw(&updateRects[i]);
        }

    }
    catch (Platform::Exception^ exception)
    {
        hr = exception->HResult;

        if (hr == D2DERR_RECREATE_TARGET ||
            hr == DXGI_ERROR_DEVICE_REMOVED)
        {
            // HandleDeviceLost
            _deviceResources->CreateDeviceResources();

            _deviceResources->InvalidateContentRect();
        }
    }

    // Clear up buffer for updateRects
    if (updateRects != nullptr)
    {
        delete updateRects;
    }

    // Complete any pending call for EndDry so we can continue to
    // receive new strokes to dry through StrokesCollected event.
    if (_EndDryPending)
    {
        assert(_inkSynchronizer != nullptr);
        _inkSynchronizer->EndDry();
        _EndDryPending = false;
    }

    return hr;
}

Member Data Documentation

std::unique_ptr<DX::DeviceResources> _deviceResources [private]

Definition at line 212 of file SceneComposer.h.

bool _EndDryPending [private]

Definition at line 227 of file SceneComposer.h.

std::unique_ptr<InkRenderer> _inkRenderer [private]

Definition at line 213 of file SceneComposer.h.

Windows::UI::Input::Inking::InkSynchronizer _inkSynchronizer [private]

Definition at line 226 of file SceneComposer.h.

bool _inLassoSelection [private]

Definition at line 221 of file SceneComposer.h.

Windows::Foundation::Point _ptCurrent [private]

Definition at line 219 of file SceneComposer.h.

Windows::Foundation::Point _ptInitial [private]

Definition at line 217 of file SceneComposer.h.

ULONG _refCount [private]

Definition at line 229 of file SceneComposer.h.

std::vector<SceneObject*> _sceneObjects [private]

Definition at line 211 of file SceneComposer.h.

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> _selectionBrush [private]

Definition at line 223 of file SceneComposer.h.

std::unique_ptr<ShapeRenderer> _shapeRenderer [private]

Definition at line 214 of file SceneComposer.h.

Microsoft::WRL::ComPtr<ID2D1StrokeStyle> _strokeStyle [private]

Definition at line 224 of file SceneComposer.h.

The documentation for this class was generated from the following files:
  • ComplexInk/cpp/Renderers/SceneComposer.h
  • ComplexInk/cpp/Renderers/SceneComposer.cpp
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneComposer::InkObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SceneComposer
  • SceneComposer::InkObject
Public Member Functions | Static Public Member Functions | Private Attributes

SceneComposer::InkObject Class Reference

Inherits SDKTemplate::SceneComposer::SceneObject.

List of all members.

Public Member Functions

InkObject (Windows::UI::Input::Inking::InkStroke^s)
Windows::UI::Input::Inking::InkStroke | GetInkStroke ()
Platform::Collections::Vector
< Windows::UI::Input::Inking::InkStroke^> 		getStrokes ()
virtual SCENEOBJECT_TYPES | getType ()
bool | IsStrokeSelected ()
void | SelectStroke (Windows::UI::Input::Inking::InkStrokeContainer^strokeContainerForTemp)

Static Public Member Functions

static Windows::Foundation::Size | GetDefaultStrokeSize ()
static float | GetSelectedStrokeSize ()

Private Attributes

Windows::UI::Input::Inking::InkStroke | _highlighterStroke
Windows::UI::Input::Inking::InkStroke | _stroke

Detailed Description

Definition at line 109 of file SceneComposer.h.

Constructor & Destructor Documentation

InkObject ( Windows::UI::Input::Inking::InkStroke^ s ) [inline]

Definition at line 125 of file SceneComposer.h.

                                                        :_stroke(s)
            {
                _highlighterStroke = nullptr;
            };

Member Function Documentation

static Windows::Foundation::Size GetDefaultStrokeSize ( ) [inline, static]

Definition at line 118 of file SceneComposer.h.

            {
                static const Windows::Foundation::Size defaultStrokeSize = Windows::Foundation::Size(2.0f, 2.0f);
                return defaultStrokeSize;
            }

Windows::UI::Input::Inking::InkStroke GetInkStroke ( ) [inline]

Definition at line 133 of file SceneComposer.h.

{ return _stroke; };

static float GetSelectedStrokeSize ( ) [inline, static]

Definition at line 112 of file SceneComposer.h.

            {
                static const float selectedStrokeSize = 5.0f;
                return selectedStrokeSize;
            }

Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^> getStrokes ( ) [inline]

Definition at line 136 of file SceneComposer.h.

            {
                Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>^ strokes = ref new Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>();
                strokes->Append(_stroke);
                if (_stroke->Selected)
                {
                    strokes->Append(_highlighterStroke);
                }
                return strokes;
            };

virtual SCENEOBJECT_TYPES getType ( ) [inline, virtual]

Reimplemented from SceneComposer::SceneObject.

Definition at line 130 of file SceneComposer.h.

{ return SCENEOBJECT_TYPES::SOT_Ink; };

bool IsStrokeSelected ( ) [inline]

Definition at line 132 of file SceneComposer.h.

{ return _stroke->Selected; };

void SelectStroke ( Windows::UI::Input::Inking::InkStrokeContainer^ strokeContainerForTemp ) [inline]

Definition at line 149 of file SceneComposer.h.

                                                                                {
                if (_stroke != nullptr)
                {
                    // Get the drawing attributes to modify them according to its state (inking or selection mode)
                    auto strokeDrawingAttributes = _stroke->DrawingAttributes;

                    if (_stroke->Selected)
                    {
                        // Create the highlighter stroke to give it a hollow effect
                        _highlighterStroke = _stroke->Clone();
                        _highlighterStroke->Selected = true;
                        auto highlighterAttributes = _highlighterStroke->DrawingAttributes;
                        highlighterAttributes->Color = CanvasBackgroundColor;
                        highlighterAttributes->Size = GetDefaultStrokeSize();
                        _highlighterStroke->DrawingAttributes = highlighterAttributes;

                        // Note that the Clone method must be used with AddStroke (InkManager) or AddStroke (InkStrokeContainer)
                        assert(strokeContainerForTemp != nullptr);
                        strokeContainerForTemp->AddStroke(_highlighterStroke);

                        strokeDrawingAttributes->Size = Windows::Foundation::Size(GetSelectedStrokeSize(), GetSelectedStrokeSize());
                        _stroke->DrawingAttributes = strokeDrawingAttributes;
                    }
                    else
                    {
                        // reset the pointer to highlighter stroke and set the corresponding inkstroke to the default drawing attributes
                        if (_highlighterStroke != nullptr)
                        {
                            _highlighterStroke = nullptr;
                        }
                        strokeDrawingAttributes->Size = GetDefaultStrokeSize();
                        _stroke->DrawingAttributes = strokeDrawingAttributes;
                    }
                }
            };

Member Data Documentation

Windows::UI::Input::Inking::InkStroke _highlighterStroke [private]

Definition at line 187 of file SceneComposer.h.

Windows::UI::Input::Inking::InkStroke _stroke [private]

Definition at line 183 of file SceneComposer.h.

The documentation for this class was generated from the following file:
  • ComplexInk/cpp/Renderers/SceneComposer.h
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneComposer::SceneObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SceneComposer
  • SceneComposer::SceneObject
Public Member Functions

SceneComposer::SceneObject Class Reference

Inherited by SceneComposer::InkObject, and SceneComposer::ShapeObject.

List of all members.

Public Member Functions

virtual SCENEOBJECT_TYPES getType ()

Detailed Description

Definition at line 103 of file SceneComposer.h.

Member Function Documentation

virtual SCENEOBJECT_TYPES getType ( ) [inline, virtual]

Reimplemented in SceneComposer::InkObject, and SceneComposer::ShapeObject.

Definition at line 106 of file SceneComposer.h.

{ return SCENEOBJECT_TYPES::SOT_Generic; };

The documentation for this class was generated from the following file:
  • ComplexInk/cpp/Renderers/SceneComposer.h
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SceneComposer::ShapeObject Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SceneComposer
  • SceneComposer::ShapeObject
Public Member Functions | Private Attributes

SceneComposer::ShapeObject Class Reference

Inherits SDKTemplate::SceneComposer::SceneObject.

List of all members.

Public Member Functions

ShapeObject (Shape s)
Shape getShape ()
virtual SCENEOBJECT_TYPES getType ()

Private Attributes

Shape _shape

Detailed Description

Definition at line 190 of file SceneComposer.h.

Constructor & Destructor Documentation

ShapeObject ( Shape s ) [inline]

Definition at line 193 of file SceneComposer.h.

: _shape(s) {};

Member Function Documentation

Shape getShape ( ) [inline]

Definition at line 195 of file SceneComposer.h.

{ return _shape; };

virtual SCENEOBJECT_TYPES getType ( ) [inline, virtual]

Reimplemented from SceneComposer::SceneObject.

Definition at line 194 of file SceneComposer.h.

{ return SCENEOBJECT_TYPES::SOT_Shape; };

Member Data Documentation

Shape _shape [private]

Definition at line 195 of file SceneComposer.h.

The documentation for this class was generated from the following file:
  • ComplexInk/cpp/Renderers/SceneComposer.h
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: School Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • School
Public Member Functions | Properties | Private Attributes

School Class Reference

List of all members.

Public Member Functions

School ()
School (JsonObject jsonObject)
JsonObject | ToJsonObject ()

Properties

string | Id [get, set]
string | Name = "" [get, set]
string | Type = "" [get, set]

Private Attributes

const string | idKey = "id"
const string | nameKey = "name"
const string | schoolKey = "school"
const string | typeKey = "type"

Detailed Description

Definition at line 16 of file School.cs.

Constructor & Destructor Documentation

School ( ) [inline]

Definition at line 23 of file School.cs.

        {
        }

School ( JsonObject jsonObject ) [inline]

Definition at line 27 of file School.cs.

        {
            JsonObject schoolObject = jsonObject.GetNamedObject(schoolKey, null);
            if (schoolObject != null)
            {
                Id = schoolObject.GetNamedString(idKey, "");
                Name = schoolObject.GetNamedString(nameKey, "");
            }
            Type = jsonObject.GetNamedString(typeKey);
        }

Member Function Documentation

JsonObject ToJsonObject ( ) [inline]

Definition at line 38 of file School.cs.

        {
            // C# provides multiple ways to initialize a JsonObject.
            // Here, we use indexed collection initializer syntax.
            JsonObject schoolObject = new JsonObject()
            {
                [idKey] = JsonValue.CreateStringValue(Id),
                [nameKey] = JsonValue.CreateStringValue(Name),
            };

            JsonObject jsonObject = new JsonObject();
            // Here we use indexer syntax.
            jsonObject[schoolKey] = schoolObject;

            // Here we use an explicit call to SetNamedValue.
            jsonObject.SetNamedValue(typeKey, JsonValue.CreateStringValue(Type));

            return jsonObject;
        }

Member Data Documentation

const string idKey = "id" [private]

Definition at line 18 of file School.cs.

const string nameKey = "name" [private]

Definition at line 20 of file School.cs.

const string schoolKey = "school" [private]

Definition at line 19 of file School.cs.

const string typeKey = "type" [private]

Definition at line 21 of file School.cs.

Property Documentation

string Id [get, set]

Definition at line 58 of file School.cs.

string Name = "" [get, set]

Definition at line 60 of file School.cs.

string Type = "" [get, set]

Definition at line 62 of file School.cs.

The documentation for this class was generated from the following file:
  • Json/cs/School.cs
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SdkSample Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SdkSample
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

SdkSample Class Reference

#include "Utils.h"

List of all members.

Public Member Functions

void | ClearLastStatus ()
void | Deinitialize ()
void | DisplayError (Platform::String^msg)
void | DisplayStatus (Platform::String^msg)
void | FormatError (CaptureFailedEventArgs^e, Platform::String^prefix)
void | FormatError (HResult err, Platform::String^msg, Platform::String^prefix)

Public Attributes

internal | __pad0__: void Initialize()

Private Member Functions

void | Log (Platform::String^message)
void | Log (Platform::String^message, Platform::String^tag, Platform::String^type)

Private Attributes

Windows::UI::Core::CoreDispatcher | _dispatcher
SDKTemplate::MainPage _rootPage

Detailed Description

Definition at line 46 of file Utils.h.

Member Function Documentation

void ClearLastStatus ( )

Definition at line 77 of file Utils.cpp.

{
    Log("");
}

void Deinitialize ( )

Definition at line 28 of file Utils.cpp.

{
    _rootPage = nullptr;
    _dispatcher = nullptr;
}

void DisplayError ( Platform::String^ msg )

Definition at line 39 of file Utils.cpp.

{
    Log(msg, nullptr, "error");
}

void DisplayStatus ( Platform::String^ msg )

Definition at line 34 of file Utils.cpp.

{
    Log(msg);
}

void FormatError | ( | CaptureFailedEventArgs^ | e,
 |  | Platform::String^ | prefix
 | ) |  |

Definition at line 70 of file Utils.cpp.

{
    HResult hr;
    hr.Value = e->Code;
    FormatError(hr, e->Message, prefix);
}

void FormatError | ( | HResult | err,
 |  | Platform::String^ | msg,
 |  | Platform::String^ | prefix
 | ) |  |

Definition at line 44 of file Utils.cpp.

{
    if (err.Value)
    {
        WCHAR dst[33];
        _ultow_s(err.Value, dst, ARRAYSIZE(dst), 16);
        Log(
            prefix +
            msg +
            ", Error code: " +
            ref new Platform::String(dst),
            nullptr,
            "error"
            );
    }
    else
    {
        Log(
            prefix +
            msg,
            nullptr,
            "error"
            );
    }
}

void Log ( Platform::String^ message ) [private]

Definition at line 82 of file Utils.cpp.

{
    Log(message, nullptr, "status");
}

void Log | ( | Platform::String^ | message,
 |  | Platform::String^ | tag,
 |  | Platform::String^ | type |
 | ) |  |  | [private]

Definition at line 87 of file Utils.cpp.

{
    auto isError = (type == "error");
    auto isStatus = (type == "status");

    if (isError || isStatus)
    {
        if (_rootPage != nullptr && _dispatcher != nullptr)
        {
            _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
                ref new Windows::UI::Core::DispatchedHandler([this, message, isError]()
            {
                _rootPage->NotifyUser(message, (isError) ? NotifyType::ErrorMessage : NotifyType::StatusMessage);
            }));
        }
    }
}

Member Data Documentation

internal __pad0__

Definition at line 49 of file Utils.h.

Windows::UI::Core::CoreDispatcher _dispatcher [private]

Definition at line 63 of file Utils.h.

SDKTemplate::MainPage _rootPage [private]

Definition at line 62 of file Utils.h.

The documentation for this class was generated from the following files:
  • SimpleCommunication/cpp/Utils.h
  • SimpleCommunication/cpp/Utils.cpp
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

Main Page

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

SDKTemplate

sealed

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame. More...

#include "Scenario0_Choose.xaml.h"

Inherits SDKTemplate::PrintHelper, SDKTemplate::PrintHelper, SDKTemplate::PrintHelper, SDKTemplate::PrintHelper, and SDKTemplate::PrintHelper.

List of all members.

Classes

class

sealed

struct

StreamFilteringCriteria

Public Member Functions

virtual

~Conversation ()

virtual

~DirectXPage ()

virtual

~DocumentPresenter ()

virtual

~Scenario1_DeviceUse ()

virtual

~Scenario1_LowLatencyInput ()

virtual

~Scenario1_OmnidirectionalSound ()

virtual

~Scenario1_PreviewSettings ()

virtual

~Scenario2_CardioidSound ()

virtual

~Scenario2_PhotoSettings ()

virtual

~Scenario3_AspectRatio ()

virtual

~Scenario3_CustomDecay ()

virtual

~SourceGroupCollection ()

AddImageFeedScenario ()

App ()

ApplicationTriggerTask ()

ApplicationTriggerTask ()

double

AspectRatio ()

BasicTests ()

BindableNode (Platform::String^nodeName, Platform::String^nodeNamespace, Platform::String^nodeValue)

Windows::UI::Xaml::Media::SolidColorBrush

Brushify (Windows::UI::Color c)

CalibrationBar ()

CalibrationBar ()

CalibrationBar ()

CancelCommand ()

ChatListView ()

void

CheckConcurrentProfileBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CheckHdrSupportBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Clear ()

void

ClearColorsClick (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Click_BaseArgs (Platform::Object^sender, Platform::Object^e)

void

Click_NoArgs ()

void

Click_RegularArgs (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Close ()

void

CloseDevice (void)

String

ColorValue (double red, double green, double blue)

CompletedCallback ()

ConnectedDevice (Platform::String^displayName, Windows::Devices::WiFiDirect::WiFiDirectDevice^wfdDevice, SocketReaderWriter^socketRW)

Content ()

ContinuationPage (Windows::UI::Xaml::Controls::RichTextBlockOverflow^textLinkContainer)

Conversation ()

virtual Platform::Object

Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)

virtual Platform::Object

Convert (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)

virtual Platform::Object

ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)

virtual Platform::Object

ConvertBack (Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language)

String

CountEmployees (xBindSampleModel::IEmployee^e)

String

countVowels (String^words)

Binding

CreateWordHeightBinding ()

Binding

CreateWordPositionBinding ()

Binding

CreateWordWidthBinding ()

CustomCommand ()

CustomOptionsPrintHelper (Page^scenarioPage)

CustomTitleBar ()

CustomTrigger ()

DefaultCloseCommand ()

DeviceConnect ()

DeviceConnect (void)

DeviceEvents ()

DeviceInformationDisplay (Windows::Devices::Enumeration::DeviceInformation^deviceInfoIn)

DeviceInformationKindChoice (Platform::String^displayName, Windows::Foundation::Collections::IVectorView< Windows::Devices::Enumeration::DeviceInformationKind >^deviceInformationKinds)

DeviceIO ()

DeviceListEntry (Windows::Devices::Enumeration::DeviceInformation^DeviceInterface)

DeviceReadWrite ()

DeviceSelectorInfo (Platform::String^displayName, Windows::Devices::Enumeration::DeviceClass deviceClassSelector, Platform::String^selector)

DeviceSelectorInfo (Platform::String^displayName, Windows::Devices::Enumeration::DeviceClass deviceClassSelector, Platform::String^selector, Windows::Devices::Enumeration::DeviceInformationKind kind)

DeviceWatcherHelper (Windows::Foundation::Collections::IObservableVector< DeviceInformationDisplay^>^resultCollection, Windows::UI::Core::CoreDispatcher^dispatcher)

DirectXPage ()

DiscoveredDevice (Windows::Devices::Enumeration::DeviceInformation^deviceInfoIn)

String

Display (String^stringArg, int intArg, double floatArg, bool boolArg)

void

Display ()

void

Display ()

void

Display ()

void

Display ()

void

Display ()

void

Display ()

DocumentPresenter (Platform::String^text, Platform::String^downloadableFontName, Platform::String^languageTag, Windows::UI::Color textColor, Windows::UI::Color textBackgroundColor, Windows::UI::Xaml::Controls::Image^imageTarget)

concurrency::task< void >

DoScenarioAsync ()

concurrency::task< void >

DoScenarioAsync ()

void

DoubleSpace_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DoubleSpaceHalfLeading_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

DownloadOperationItem (Windows::Networking::BackgroundTransfer::DownloadOperation^download)

void

EnableControlsInTitleBar (bool enable)

void

EnablePasteItemOnly (bool IsEnabled, Windows::Foundation::Point pos)

EventTests ()

FeatureReports ()

FirmwareAccess ()

FrameFormatModel (Windows::Media::Capture::Frames::MediaFrameFormat^format)

unsigned int

FrameRate ()

FrameRenderer (Windows::UI::Xaml::Controls::Image^image)

FrameSourceGroupModel (Windows::Media::Capture::Frames::MediaFrameSourceGroup^sourceGroup)

FrameSourceInfoModel (Windows::Media::Capture::Frames::MediaFrameSourceInfo^sourceInfo)

Functions ()

Platform::String

GetCurrentMessage ()

Platform::String

GetFriendlyName (bool showFrameRate=true)

void

GetPinValue_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

GetPropertyForDisplay (Platform::String^key)

String

GetTime ()

GroupedBackgroundTask ()

GroupedBackgroundTask ()

bool

HasSameFormat (Windows::Media::Capture::Frames::MediaFrameFormat^otherFormat)

unsigned int

Height ()

void

Hide ()

void

Hide ()

void

Hide ()

void

InitializeTransforms ()

InputOutputReports ()

InputReportEvents ()

bool

IsWatcherRunning ()

ItemDetails (Windows::Services::Store::StoreProduct^product)

ListsAndTemplates ()

void

LoadDocument ()

void

LoadInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)

LocationTrackingReason ()

void

LockToXAxis ()

void

LockToYAxis ()

void

Log (Platform::String^message)

void

Log (Platform::String^message)

void

LogWithWin10Constructor ()

void

LogWithWin81Constructor ()

m_imagePath (imagePath)

MainPage ()

MainPage ()

Windows::UI::Xaml::Media::SolidColorBrush

MakeColor (double red, double green, double blue)

ManipulationInputProcessor (Windows::UI::Input::GestureRecognizer^gestureRecognizer, Windows::UI::Xaml::UIElement^target, Windows::UI::Xaml::UIElement^referenceFrame)

ManipulationProcessor (Windows::UI::Input::GestureRecognizer^gestureRecognizer, Windows::UI::Xaml::Controls::Border^target, Windows::UI::Xaml::UIElement^referenceFrame)

MeteringData ()

void

MoveOnXAndYAxes ()

MultipleTasks ()

MyUserControl1 ()

OcrCapturedImage ()

OcrFileImage ()

void

OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)

OnDeviceConnectedEventArgs (bool isDeviceSuccessfullyConnected, Windows::Devices::Enumeration::DeviceInformation^deviceInformation)

void

OneAndHalfSpace_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnItemInvoked (unsigned int selectedItemIndex)

virtual void

OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

OtherBindings ()

PageRangePrintHelper (Page^scenarioPage)

PageToPrint ()

PhasingTests ()

PhotosPrintHelper (Page^scenarioPage)

void

PickContactEmail ()

void

PickContactPhone ()

void

PickContactsEmail ()

void

PickContactsPhone ()

void

PopulateColorsClick (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PrepareToSuspend ()

concurrency::task< void >

PrepareToSuspendAsync ()

PreviewOptionsPrintHelper (Page^scenarioPage)

PreviewUnavailable ()

PreviewUnavailable (Windows::Foundation::Size paperSize, Windows::Foundation::Size printableSize)

void

ProcessColor (String^value)

void

ProcessFrame (Windows::Media::Capture::Frames::MediaFrameReference^frame)

ProtectionLevelSelectorInfo (Platform::String^displayName, Windows::Devices::Enumeration::DevicePairingProtectionLevel protectionLevel)

void

PurchaseFullLicense ()

ReadBytes ()

void

ReadMessage ()

void

RemoveCredentials_Click (Platform::Object^, Platform::Object^)

void

Render (WindowsPreview::Media::Capture::Frames::PoseTrackingFrame^frame, CoordinateTransformationMethod^transformation)

void

RequestCalibration (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

void

RequestCalibration (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

void

RequestCalibration (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

void

Reset ()

void

Reset ()

void

ResetRect ()

void

ResumeLoggingIfApplicable ()

void

ResumeLoggingIfApplicable ()

void

RevealPasswords_Click (Platform::Object^, Platform::Object^)

void

Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)

S1_AddWithAPI ()

S2_UpdateAndDeleteWithAPI ()

S3_RetrieveWithAPI ()

S4_CheckIndexRevision ()

S5_AddWithAppContent ()

S6_DeleteWithAppContent ()

S7_RetrieveWithAppContent ()

SampleBackgroundTask ()

SampleBackgroundTask ()

SampleBackgroundTaskWithCondition ()

SampleBackgroundTaskWithCondition ()

void

SaveInternalState (_In_ Windows::Foundation::Collections::IPropertySet^state)

SavingDataReason ()

Scenario (Platform::String^title, Platform::String^description, Platform::String^className)

Scenario0_Choose ()

Scenario0_Choose ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario1 ()

Scenario10 ()

Scenario10 ()

Scenario10 ()

Scenario10 ()

Scenario11 ()

Scenario11 ()

Scenario11 ()

Scenario11 ()

Scenario12 ()

Scenario12 ()

Scenario12 ()

Scenario13 ()

Scenario1_AddAccount ()

Scenario1_Advertiser ()

Scenario1_Analyze ()

Scenario1_AppBarButtons ()

Scenario1_BankCards ()

Scenario1_Basic ()

Scenario1_Basic ()

Scenario1_Basic ()

Scenario1_Basic ()

Scenario1_Basic ()

Scenario1_CheckConsentAvailability ()

Scenario1_Colors ()

Scenario1_Configuration ()

Scenario1_Conversion ()

Scenario1_CorrelateStreams ()

Scenario1_Create ()

Scenario1_CreateTPMVSC ()

Scenario1_CurrentActivity ()

Scenario1_CustomDry ()

Scenario1_Data ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_DataEvents ()

Scenario1_Default ()

Scenario1_DefaultAccount ()

Scenario1_DefaultSpacing ()

Scenario1_DevicePicker ()

Scenario1_DeviceUse ()

Scenario1_DisplayDepthColorIR ()

Scenario1_Download ()

Scenario1_Enable ()

Scenario1_EventAndMenuHookup ()

Scenario1_Events ()

Scenario1_ExtractTextSegments ()

Scenario1_FindClaimEnable ()

Scenario1_Geotag ()

Scenario1_GetAndSetPin ()

Scenario1_GetDeviceInformation ()

Scenario1_GetLamp ()

Scenario1_Launched ()

Scenario1_ListView ()

Scenario1_LongAndShortFormats ()

Scenario1_LowLatency ()

Scenario1_LowLatencyInput ()

Scenario1_Message ()

Scenario1_Metrics ()

Scenario1_Mini ()

Scenario1_OmnidirectionalSound ()

Scenario1_OpenDrawer ()

Scenario1_Orientation ()

Scenario1_PercentPermilleFormatting ()

Scenario1_Prefs ()

Scenario1_PreviewSettings ()

Scenario1_ReadData ()

Scenario1_ReadData ()

Scenario1_ReceiptPrinter ()

Scenario1_Render ()

Scenario1_Save ()

Scenario1_SelectDisplay ()

Scenario1_SetRecordProfile ()

Scenario1_Single ()

Scenario1_SingleFile ()

Scenario1_SpellingTextSuggestions ()

Scenario1_TrialMode ()

Scenario1_TrimAndSaveClip ()

Scenario1Basic ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2 ()

Scenario2_AamvaCards ()

Scenario2_AppendClips ()

Scenario2_CardioidSound ()

Scenario2_ChangePin ()

Scenario2_CloseDrawer ()

Scenario2_ConcurrentProfile ()

Scenario2_Connector ()

Scenario2_Custom ()

Scenario2_DecimalFormatting ()

Scenario2_DelayMini ()

Scenario2_DeviceWatcher ()

Scenario2_Disable ()

Scenario2_Display ()

Scenario2_DisplayText ()

Scenario2_DragUICustomization ()

Scenario2_EnableSettings ()

Scenario2_Extend ()

Scenario2_FindAvailableSourceGroups ()

Scenario2_GetCurrentTextSegmentFromIndex ()

Scenario2_History ()

Scenario2_History ()

Scenario2_Icons ()

Scenario2_InAppPurchase ()

Scenario2_Lang ()

Scenario2_Launch ()

Scenario2_Launch ()

Scenario2_Listen ()

Scenario2_Load ()

Scenario2_Manage ()

Scenario2_ManageAccount ()

Scenario2_MessageCaption ()

Scenario2_Msa ()

Scenario2_MultiFile ()

Scenario2_Multiple ()

Scenario2_oAuthFacebook ()

Scenario2_PhotoSettings ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Polling ()

Scenario2_Prediction ()

Scenario2_PrintReceipt ()

Scenario2_Remove ()

Scenario2_RequestConsent ()

Scenario2_ScopedViews ()

Scenario2_ShakeEvents ()

Scenario2_Stats ()

Scenario2_StringTemplate ()

Scenario2_UniformSpacing ()

Scenario2_Upload ()

Scenario2_VideoChat ()

Scenario2StandardOptions ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3 ()

Scenario3_Aad ()

Scenario3_Add ()

Scenario3_AddAudioTracks ()

Scenario3_AspectRatio ()

Scenario3_AvailabilityChanged ()

Scenario3_BackgroundDeviceWatcher ()

Scenario3_Calibration ()

Scenario3_Calibration ()

Scenario3_Calibration ()

Scenario3_ChangeEvents ()

Scenario3_CredentialPickerOptions ()

Scenario3_CurrencyFormatting ()

Scenario3_CurrentStepCount ()

Scenario3_CustomDecay ()

Scenario3_CustomItems ()

Scenario3_DisplayOnOff ()

Scenario3_EnableHdrProfile ()

Scenario3_Enum ()

Scenario3_Events ()

Scenario3_FixAccount ()

Scenario3_Full ()

Scenario3_MultipleClaims ()

Scenario3_MultipleDrawers ()

Scenario3_Notifications ()

Scenario3_ParameterizedTemplate ()

Scenario3_Polling ()

Scenario3_Porting ()

Scenario3_ProportionalSpacing ()

Scenario3_Region ()

Scenario3_ResetPin ()

Scenario3_ReverseConversion ()

Scenario3_SingleFolder ()

Scenario3_StartDragAsync ()

Scenario3_Trim ()

Scenario3_UnmanagedConsumable ()

Scenario3_UsingWindows ()

Scenario3CustomOptions ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4 ()

Scenario4_AddOverlays ()

Scenario4_AddOverlays ()

Scenario4_BackgroundActivity ()

Scenario4_BackgroundProximitySensor ()

Scenario4_BackgroundTask ()

Scenario4_ChangeAdminKey ()

Scenario4_ChangeSystemGroup ()

Scenario4_CompletionGroups ()

Scenario4_ConsumableProduct ()

Scenario4_Control ()

Scenario4_Input ()

Scenario4_ManyProviders ()

Scenario4_NumberParsing ()

Scenario4_OrientationChanged ()

Scenario4_Override ()

Scenario4_Remove ()

Scenario4_SaveFile ()

Scenario4_Snapshot ()

Scenario4_UnicodeExtensions ()

Scenario4_UpdatingLineDisplayAttributes ()

Scenario4PageRange ()

Scenario5 ()

Scenario5 ()

Scenario5 ()

Scenario5 ()

Scenario5 ()

Scenario5 ()

Scenario5_Clear ()

Scenario5_DataEventsBatching ()

Scenario5_DefiningCustomGlyphs ()

Scenario5_GetSingleDevice ()

Scenario5_IsSupported ()

Scenario5_ManyProvidersManyAccounts ()

Scenario5_Multiple ()

Scenario5_RandomAccess ()

Scenario5_RoundingAndPadding ()

Scenario5_TimeZone ()

Scenario5_TriggerCFU ()

Scenario5_UnicodeExtensions ()

Scenario5_UserCollection ()

Scenario5_VerifyResponse ()

Scenario5Photos ()

Scenario6 ()

Scenario6 ()

Scenario6 ()

Scenario6 ()

Scenario6_AppListingURI ()

Scenario6_CustomFilterAddedProps ()

Scenario6_CustomProvider ()

Scenario6_DeleteTPMVSC ()

Scenario6_ManipulatingCursorAttributes ()

Scenario6_NumeralSystemTranslation ()

Scenario6_RecoverableErrors ()

Scenario6_Styling ()

Scenario6_TimeZone ()

Scenario6DisablePreview ()

Scenario7 ()

Scenario7 ()

Scenario7 ()

Scenario7 ()

Scenario7_B2B ()

Scenario7_CustomContent ()

Scenario7_DeviceInformationKind ()

Scenario7_DownloadReordering ()

Scenario7_ListSmartCards ()

Scenario7_ScrollingContentUsingMarquee ()

Scenario7_UsingUnicodeExtensions ()

Scenario8 ()

Scenario8 ()

Scenario8 ()

Scenario8 ()

Scenario8_PairDevice ()

Scenario8_Reflow ()

Scenario8_Transmit ()

Scenario9 ()

Scenario9 ()

Scenario9 ()

Scenario9_CustomPairDevice ()

Scenario_CloudFontOverview ()

Scenario_CloudFontOverview ()

Scenario_ContinuousDictation ()

Scenario_ContinuousRecognitionListGrammar ()

Scenario_ContinuousRecognitionSRGSGrammar ()

Scenario_Document1 ()

Scenario_Document1 ()

Scenario_Document2 ()

Scenario_Document2 ()

Scenario_Document3 ()

Scenario_Document3 ()

Scenario_ListConstraint ()

Scenario_PauseAsync ()

Scenario_PredefinedDictationGrammar ()

Scenario_PredefinedWebSearchGrammar ()

Scenario_SampleOverview ()

Scenario_SampleOverview ()

Scenario_SRGSConstraint ()

Scenario_SynthesizeSSML ()

Scenario_SynthesizeText ()

Scenario_SynthesizeTextBoundaries ()

SecondaryPage ()

ServicingCompleteTask ()

ServicingCompleteTask ()

SetErrorMessage ()

void

SetLayoutWidth (float width)

SetLockScreenImage ()

void

SetPinHigh_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SetPinLow_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SetSamplePeriod (int rate)

ShareApplicationLink ()

ShareCustomData ()

ShareCustomProvider ()

ShareDelayRenderedFiles ()

ShareFiles ()

ShareHtml ()

ShareImage ()

ShareText ()

ShareWebLink ()

Windows::UI::Xaml::Visibility

ShowPlaceholder (unsigned int count)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowResults_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowText ()

void

ShowTrialPeriodInformation ()

SignIn ()

SimpleLogger (Windows::UI::Xaml::Controls::TextBlock^textBlock)

SimpleLogger (Windows::UI::Xaml::Controls::TextBlock^textBlock)

void

SingleSpace_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

SkeletalFrameRenderer ()

SocketReaderWriter (Windows::Networking::Sockets::StreamSocket^socket, SDKTemplate::MainPage^mainPage)

SourceGroupCollection (Windows::UI::Core::CoreDispatcher^uiDispatcher)

StandardOptionsPrintHelper (Page^scenarioPage)

void

StartLogging ()

void

StartLogging ()

void

StartMetering (int sampleRate)

void

StartStopScenario_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartStopScenario_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartStopScenario_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartStopScenario_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcher (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher)

void

StopMetering ()

void

StopWatcher ()

StreamResolutionHelper (Windows::Media::MediaProperties::IMediaEncodingProperties^encodingProperties)

SymbologyListEntry (UINT symbologyId)

SymbologyListEntry (UINT symbologyId, bool symbologyEnabled)

Templates ()

TimeTriggeredTask ()

TimeTriggeredTask ()

UnspecifiedReason ()

void

UseInertia (bool inertia)

UserDataAccountViewModel (Windows::ApplicationModel::UserDataAccounts::UserDataAccount^account)

UserSelect ()

void

ViewPage ()

unsigned int

Width ()

WordOverlay (OcrWord^ocrWord)

void

WriteMessage (Platform::String^message)

WriteReadStream ()

Static Public Member Functions

static IBuffer

CalculateResponse (IBuffer^challenge, IBuffer^adminkey)

static
Windows::UI::Xaml::Visibility

CollapsedIf (bool value)

static
Windows::Foundation::Collections::IVector
< SampleDataModel^>

GetSampleData ()

static Platform::String

GetSubtypeForFrameReader (Windows::Media::Capture::Frames::MediaFrameSourceKind kind, Windows::Media::Capture::Frames::MediaFrameFormat^format)

static bool

IsNonNull (Platform::Object^o)

static bool

IsNonNull (Platform::Object^item)

static bool

IsNonNull (Platform::Object^item)

static Platform::String

LanguageTagToRecognizerName (Platform::String^bcp47tag)

static bool

Not (bool value)

static void

OnStart (Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup^sender, Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^args)

static
Windows::Foundation::IAsyncOperation
< bool >

RequestMicrophonePermissionAsync ()

static void

Start (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)

static
Windows::UI::Xaml::Media::SolidColorBrush

TextColor (Windows::UI::Color c)

Public Attributes

Button

_moreButton

event
Windows::Foundation::TypedEventHandler
< Windows::Devices::Enumeration::DeviceWatcher^,
Platform::String^>

DeviceChanged

Windows::Devices::Enumeration::DeviceInformation

m_Device

std::stack< std::tuple
< ICommandBarElement^, double > >

overflow = { }

virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler

PropertyChanged

std::queue< std::tuple
< ICommandBarElement^, double > >

separatorQueue = { }

double

separatorQueueWidth = 0.0

Protected Member Functions

void

AddItemToEnd ()

virtual
Windows::UI::Xaml::Controls::RichTextBlockOverflow

AddOnePrintPreviewPage (Windows::UI::Xaml::Controls::RichTextBlockOverflow^lastRTBOAdded, Windows::Graphics::Printing::PrintPageDescription printPageDescription) override

virtual void

AddPrintPages (Object^sender, AddPagesEventArgs^e) override

virtual void

AddPrintPages (Object^sender, AddPagesEventArgs^e) override

virtual void

AddPrintPages (Platform::Object^sender, Windows::UI::Xaml::Printing::AddPagesEventArgs^e) override

Windows::Foundation::Size

ArrangeOverride (Windows::Foundation::Size finalSize) override

void

BeginExtendedExecution ()

void

BeginExtendedExecution ()

void

BeginExtendedExecution ()

void

ChooseFileButton_Click ()

void

ClaimAndEnable_Click ()

void

ClaimSamePrinter_Click ()

void

ClearPageCollection ()

void

ClickToPlaySource_ImageOpened (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Xaml::Controls::TextBlock

CreateHeaderTextBlock (Platform::String^contents)

Windows::UI::Input::Inking::InkDrawingAttributes

CreateInkDrawingAttributesCore (Windows::UI::Xaml::Media::Brush^brush, double strokeWidth) override

Windows::UI::Xaml::Controls::TextBlock

CreateLineItemTextBlock ()

Windows::UI::Xaml::Controls::TextBlock

CreateLineItemTextBlock (Platform::String^contents)

virtual void

CreatePrintPreviewPages (Object^sender, Windows::UI::Xaml::Printing::PaginateEventArgs^e) override

virtual void

CreatePrintPreviewPages (Object^sender, PaginateEventArgs^e) override

void

DeleteSelectedItem ()

void

DisplayLink (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

EndExtendedExecution ()

void

EndExtendedExecution ()

void

EndExtendedExecution ()

void

FindPrinter_Click ()

void

GetCustomerCollectionsId (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetCustomerPurchaseId (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetFilesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetFilesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetGeotagButton_Click ()

virtual void

GetPrintPreviewPage (Object^sender, GetPreviewPageEventArgs^e) override

Platform::String

GetPropertyDisplayValue (Platform::Object^property)

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

virtual bool

GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request) override

void

IsImportantTransaction_Click ()

virtual Size

MeasureOverride (Size desiredSize) override

void

MessageTextBox_KeyUp (Platform::Object^sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^e)

void

OnApplyTemplate () override

virtual void

OnApplyTemplate () override

void

OnApproximateAccuracy ()

void

OnConnect ()

void

OnConnect ()

void

OnConnect ()

void

OnDisconnect ()

void

OnDisconnect ()

void

OnDisconnect ()

void

OnHighAccuracy ()

virtual void

OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override

virtual void

OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

virtual void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

virtual void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

virtual void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

virtual void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

void

OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

virtual void

OnPreviewPagesCreated (Windows::Graphics::Printing::PrintTaskOptions^printTaskOptions) override

void

OnPropertyChanged (Platform::String^propertyName)

void

OnPropertyChanged (Platform::String^name)

void

OnSend ()

void

OnSend ()

void

OnStart ()

void

OnStop ()

void

OnUnreliableAccuracy ()

void

PauseDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

RichTextBlockOverflow

PreviewOptionsPrintHelper::AddOnePrintPage (RichTextBlockOverflow^lastRTBOAdded, Windows::Graphics::Printing::PrintPageDescription printPageDescription)

void

PrintBarcode_Click ()

void

PrintBitmap_Click ()

void

PrintDetailedOptionsOptionChanged (Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails^sender, Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs^args)

void

PrintLine_Click ()

void

PrintReceipt_Click ()

virtual void

PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) override

virtual void

PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) override

virtual void

PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) override

virtual void

PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) override

virtual void

PrintTaskRequested (Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) override

void

RefreshPreview ()

void

ReleaseAll_Click ()

void

ReleaseClaim_Click ()

void

RestoreScrollPosition ()

void

ResumeDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SaveScrollPosition ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioDisable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

ScenarioEnable ()

void

SeekDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SendTextMessage ()

void

SetGeotagButton_Click ()

void

SetGeotagFromGeolocatorButton_Click ()

void

StartDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ValidatePageRangeOption (Windows::Graphics::Printing::OptionDetails::PrintPageRangeOptionDetails^pageRangeOption)

void

VisibilityChanged (Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

Protected Attributes

internal

__pad0__: App()

Properties

Windows::Foundation::Collections::IObservableVector
< ConnectedDevice^>

_connectedDevices

Windows::Foundation::Collections::IObservableVector
< DiscoveredDevice^>

_discoveredDevices

Platform::String

_displayTime

bool

_isSent

int

_percentComplete

Platform::String

_stateText

Vector< TextMessage^>

_storage = ref new Vector<TextMessage^>()

event
BindableVectorChangedEventHandler

_storageChanged

EventRegistrationToken

_token

Windows::Foundation::Collections::IVector
< SampleDataModel^>

AllItems

Platform::String

cardName

Platform::String

ClassName

Windows::UI::Color

Color

Windows::Foundation::Collections::IObservableVector
< ColorEntry^>

ColorEntries

Platform::String

ColorName

Platform::String

Description

Windows::Devices::Enumeration::DeviceClass

DeviceClassSelector

Platform::String

deviceId

Windows::Foundation::Collections::IVectorView
< Windows::Devices::Enumeration::DeviceInformationKind >

DeviceInformationKinds

Platform::String

DisplayName

Platform::String

Email

Windows::Foundation::Collections::IObservableVector
< xBindSampleModel::IEmployee^>

Employees

bool

enabled

Windows::Media::Capture::Frames::MediaFrameFormat

Format

Platform::String

Id

int

id

Windows::Foundation::Uri

ImageSourceUri

boolean

inCollection

bool

IsNew

Windows::Devices::Enumeration::DeviceInformationKind

Kind

Windows::UI::Xaml::Controls::Symbol

LassoSelect

Windows::Devices::Geolocation::Geopoint

Location

static
Windows::UI::Xaml::Controls::ListView

m_accountListView

Windows::Foundation::IAsyncOperation
< Windows::Storage::Streams::IRandomAccessStreamWithContentType^>

m_moderateMarginsIconAsyncOperation

Windows::Foundation::IAsyncOperation
< Windows::Storage::Streams::IRandomAccessStreamWithContentType^>

m_narrowMarginsIconAsyncOperation

bool

m_showHeader

TextLayoutImageSource

m_textLayoutImageSource

Platform::Array< LineMetrics^>

m_textLayoutLineMetrics

Windows::Foundation::IAsyncOperation
< Windows::Storage::Streams::IRandomAccessStreamWithContentType^>

m_wideMarginsIconAsyncOperation

xBindSampleModel::DataModel

Model

int

MyInt

Platform::String

nodeNamespace

Platform::String

nodeValue

Windows::Foundation::Point

NormalizedAnchorPoint

Platform::String

NullStringProperty

Platform::String

price

Windows::UI::Xaml::Controls::Frame

PrintFrame

Platform::String

productKind

Windows::Devices::Enumeration::DevicePairingProtectionLevel

ProtectionLevel

Platform::String

Selector

Windows::Media::Capture::Frames::MediaFrameSourceGroup

SourceGroup

Windows::Media::Capture::Frames::MediaFrameSourceInfo

SourceInfo

Windows::Foundation::Collections::IVectorView
< FrameSourceInfoModel^>

SourceInfos

Windows::Devices::Sensors::PedometerStepKind

stepKind

INT32

stepsCount

Windows::Foundation::TimeSpan

stepsDuration

Platform::String

storeId

Windows::UI::Xaml::Controls::RichTextBlock

TextContentBlock

Platform::String

Title

Windows::UI::Xaml::Controls::Symbol

TouchWriting

bool

UpdateStatus

bool

UsesPassport

ServiceViewModel

ViewModel

Private Types

enum

AccountAction { AddAccount, ManageAccount }

enum

CashDrawerInstance { Instance1, Instance2 }

typedef
Windows::Foundation::TypedEventHandler
< Windows::UI::Xaml::Controls::ListViewBase^,
Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^>

CCCEventHandler

enum

InkingAreaSubStates { AreaNone, Selecting, SelectingOrPasting, Erasing }

enum

InputModes { InkingMode, SelectingMode, ErasingMode, InkToolbarMode }

enum

LatencyModes { uninitialized, highLatency, lowLatency }

enum

MapIconState { None = 0, Disabled = 1, Hover = 2, Selected = 4 }

typedef Platform::String(*

MapIconStateToStyleEntryState )(MapIconState state)

enum

PointerHitTestStates { None = 0, InsideSelectionRect, InsideInkingArea }

enum

Role { uninitialized, active, passive }

enum

ScenarioOneStates {
uninitialized, initializing, waiting, previewing,
streaming, end
}

enum

ScenarioType { Toast, Tile }

Private Member Functions

~EventHandlerForDevice ()

~FileLoggingSessionScenario ()

~LoggingSessionScenario ()

~Scenario1_Download ()

~Scenario2_Upload ()

~Scenario3_Notifications ()

void

AccessChanged (Windows::Devices::Enumeration::DeviceAccessInformation^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^args)

void

Accessibility_HighContrastChanged (Windows::UI::ViewManagement::AccessibilitySettings^sender, Platform::Object^args)

delegate IAsyncAction

ActionTransition ()

void

AddAccount_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddAnimatedTilesClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddAudio_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddAudio_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddAudio_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddCustomIconItems ()

void

AddCustomProvider (Platform::String^providerId, Platform::String^authority)

concurrency::task< void >

AddDeviceAsync (Platform::String^id)

void

AddDeviceToList (Windows::Devices::Enumeration::DeviceInformation^deviceInformation, Platform::String^deviceSelector)

void

AddDeviceWatcher (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Platform::String^deviceSelector)

void

AddFolderButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddFontGlyphItems ()

void

AddItem (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

AddItemForLanguageTag (Platform::String^languageTag)

void

AddKnownIconItems ()

void

AddLayer1 ()

void

AddLayer1 ()

void

AddLayer2 ()

void

AddLayer2 ()

void

AddLinks (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddLinks (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddLinksAndDescription (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddLinksAndDescription (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddLinksAndDescription (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

concurrency::task< void >

AddLogFileMessageDispatch (Platform::String^message, const std::wstring &logFileFullPath)

concurrency::task< void >

AddLogFileMessageDispatch (Platform::String^message, const std::wstring &logFileFullPath)

void

AddMessage (Platform::String^message)

void

AddMessage (Platform::String^message)

concurrency::task< void >

AddMessageDispatch (Platform::String^message)

concurrency::task< void >

AddMessageDispatch (Platform::String^message)

void

AddOptimizationGoal (Windows::Devices::Sensors::SensorOptimizationGoal optimizationGoal)

concurrency::task< bool >

AddPassportToAccountOnServerAsync ()

void

AddReadingType (Windows::Devices::Sensors::SensorReadingType readingType)

void

AddReadingType (Windows::Devices::Sensors::AccelerometerReadingType readingType)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToIndex_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToJumpList_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AddToListButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

addToResultGrid (Windows::Services::Maps::OfflineMaps::OfflineMapPackage^package)

void

AddWebAccount (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccount (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccount (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccount (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccountProvider (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccountProvider (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccountProviders (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccountProviders (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccountProviders (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

AddWebAccounts (Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

addXamlChildrenButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AllHistory_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AnalyzeButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

AngularVelocitySlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

Animations_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

App_BackRequested (Platform::Object^sender, Windows::UI::Core::BackRequestedEventArgs^e)

void

AppendOutputLine (Platform::String^value)

void

AppendOutputLine (Platform::String^value)

void

AppendOutputLine (Platform::String^value)

void

AppendOutputLine (Platform::String^value)

void

AppendVideos_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Application_Resuming (Platform::Object^sender, Platform::Object^o)

void

Application_Suspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

ApplyRotationLock_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

ArchitectureString (Windows::System::ProcessorArchitecture architecture)

void

AttachDownloads ()

void

AttachmentImage_RightTapped (Platform::Object^sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^e)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

void

AttachProgressAndCompletedHandlers (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^task)

concurrency::task< bool >

AuthenticatePassportAsync ()

concurrency::task< bool >

AuthenticatePasswordCredentialsAsync ()

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^Provider, Platform::String^Scope, Platform::String^ClientID)

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID)

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID)

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID)

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID)

void

AuthenticateWithRequestToken (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID)

void

AuthenticateWithRequestTokenSilent (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID, Windows::Security::Credentials::WebAccount^account)

void

AuthenticateWithRequestTokenSilent (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID, Windows::Security::Credentials::WebAccount^account)

void

AuthenticateWithRequestTokenSilent (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID, Windows::Security::Credentials::WebAccount^account)

void

AuthenticateWithRequestTokenSilent (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID, Windows::Security::Credentials::WebAccount^account)

void

AuthenticateWithRequestTokenSilent (Windows::Security::Credentials::WebAccountProvider^provider, Platform::String^scope, Platform::String^clientID, Windows::Security::Credentials::WebAccount^account)

void

BlockUIThread_Toggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

BrightnessBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnAddIe_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnClearText_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnClose_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnClose_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnFromId_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnIe_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnSendMessage_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnSendMessage_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnStartAdvertisement_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnStopAdvertisement_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

btnWatcher_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

std::vector< Cluster >

BuildClustersForZoomLevel (int zoomLevel)

void

Button_AddNewAccount_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_AddProvider_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_AddUser_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click_1 (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click_2 (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Click_3 (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

button_Click_StartMetering (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

button_Click_StopMetering (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_DefaultSignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Forget_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_GetTokenSilently_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_GetTokenSilently_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_GetTokenSilently_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_GetTokenSilently_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_GetTokenSilently_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_ManageAccount_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_ManageAccounts_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_ManageAccounts_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_ManageAccounts_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_ManageSignedInAccounts_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Passport_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_Restart_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_SelectUser_Click (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

Button_SignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_SignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_SignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_SignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Button_SignIn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

PlaceLocation

CalculateCenter (const std::vector< PlaceInfo > &places)

task< void >

CalculatePreviewRotation ()

void

CallButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CameraButton_Tapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

void

CancelActiveDownloads ()

Concurrency::task< void >

CancelActiveDownloadsAsync ()

Concurrency::task< void >

CancelActiveDownloadsAsync ()

Concurrency::task< std::vector
< Windows::Networking::BackgroundTransfer::DownloadOperation^> >

CancelActiveDownloadsAsync ()

void

CancelAll_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CancelAll_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CancelCommandButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

CanShowCalibrationBar (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

bool

CanShowCalibrationBar (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

bool

CanShowCalibrationBar (Windows::Devices::Sensors::MagnetometerAccuracy accuracy)

CaptureDevice ()

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

cbLanguageSelection_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ChangeAdminKey_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChangeFolderClick (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< void >

ChangeMediaFormatAsync (FrameFormatModel^format)

void

ChangePin_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CheckAvailability_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CheckBox_Toggle (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs e)

void

CheckIfStreamsAreIdentical ()

void

CheckIfStreamsAreIdentical ()

void

CheckIndexRevision_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseBaseVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseBaseVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseFile_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseFirstVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseOverlayVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseOverlayVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseSecondVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ChooseVideo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ClaimButton1_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ClaimButton2_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< bool >

ClaimCashDrawer ()

concurrency::task< bool >

ClaimCashDrawer ()

concurrency::task< bool >

ClaimCashDrawer (CashDrawerInstance instance)

void

claimedCashDrawerInstance1_ReleaseDeviceRequested (Windows::Devices::PointOfService::ClaimedCashDrawer^sender, Platform::Object^e)

void

claimedCashDrawerInstance2_ReleaseDeviceRequested (Windows::Devices::PointOfService::ClaimedCashDrawer^sender, Platform::Object^e)

void

ClaimedPrinter_ReleaseDeviceRequested (ClaimedPosPrinter^claimedInstance, PosPrinterReleaseDeviceRequestedEventArgs^args)

task< void >

ClaimPrinter ()

Concurrency::task< void >

ClaimReader ()

Concurrency::task< void >

ClaimReader ()

task< void >

Cleanup ()

task< void >

CleanUp ()

void

CleanupAccountsControlDialog ()

void

CleanupAccountsControlDialog ()

void

CleanupAccountsControlDialog ()

void

CleanupAccountsControlDialog ()

void

CleanupAccountsControlDialog ()

task< void >

CleanupAsync ()

task< void >

CleanupCameraAsync ()

Concurrency::task< void >

CleanupCameraAsync ()

Concurrency::task< void >

CleanupCameraAsync ()

Concurrency::task< void >

CleanupCameraAsync ()

concurrency::task< void >

CleanupMediaCaptureAsync ()

concurrency::task< void >

CleanupMediaCaptureAsync ()

void

CleanupSink ()

void

ClearCanvasStrokeCache ()

void

ClearDeviceEntries (void)

void

ClearDrawnBoundingRect ()

void

ClearExtendedExecution ()

void

ClearExtendedExecution ()

void

ClearExtendedExecution ()

void

ClearMapClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ClearOutputs ()

void

ClearOutputs ()

void

ClearResults ()

void

ClearSelection ()

void

ClearSwitchStateTable ()

void

CloseCurrentlyConnectedDevice (void)

void

CloseFx2Device (void)

concurrency::task
< Windows::Storage::StorageFile^>

CloseSessionSaveFinalLogFile ()

void

CloseSocket ()

void

CloseSocket ()

void

CloseSocket ()

void

CloseSocket ()

Platform::String

CollectExpensiveData ()

Concurrency::task< void >

ColorizeCustomButtonAsync (Windows::UI::Color newColor)

void

ColorLampBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ComboBoxSettings_Changed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CommandBar_Closed (Platform::Object^sender, Platform::Object^e)

void

CommandBar_Closed (Platform::Object^sender, Platform::Object^e)

void

CommandBar_Closing (Platform::Object^sender, Platform::Object^e)

void

CommandBar_Opened (Platform::Object^sender, Platform::Object^e)

void

CommandBar_Opening (Platform::Object^sender, Platform::Object^e)

void

CommandBar_Opening (Platform::Object^sender, Platform::Object^e)

void

CommandInvokedHandler (Windows::UI::Popups::IUICommand^command)

void

CompareFilesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CompleteConfirmPinTask (bool accept)

void

CompletedCallbackButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CompletePasswordCredential (Platform::String^username=nullptr, Platform::String^password=nullptr)

void

CompleteProvidePinTask (Platform::String^pin=nullptr)

Concurrency::task< void >

ConnectAsync ()

Concurrency::task< void >

ConnectAsync ()

void

ConnectToDevice_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

Concurrency::task< void >

ConnectWebSocketAsync ()

void

ContextChanged (Windows::Foundation::Collections::IObservableMap< Platform::String^, Platform::String^>^sender, Windows::Foundation::Collections::IMapChangedEventArgs< Platform::String^>^eventArg)

void

ContinuousRecognitionSession_Completed (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^args)

void

ContinuousRecognitionSession_Completed (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^args)

void

ContinuousRecognitionSession_Completed (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^args)

void

ContinuousRecognitionSession_Completed (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^args)

void

ContinuousRecognitionSession_ResultGenerated (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^args)

void

ContinuousRecognitionSession_ResultGenerated (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^args)

void

ContinuousRecognitionSession_ResultGenerated (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^args)

void

ContinuousRecognitionSession_ResultGenerated (Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^args)

void

ContinuousRecognize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ContinuousRecognize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ContinuousRecognize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ContrastingColorButtonCheckedChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CopyFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CopyFlyoutItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CoreWetStrokeUpdateSource_WetStrokeCanceled (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

CoreWetStrokeUpdateSource_WetStrokeCompleted (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

CoreWetStrokeUpdateSource_WetStrokeContinuing (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

CoreWetStrokeUpdateSource_WetStrokeStarting (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

CoreWetStrokeUpdateSource_WetStrokeStopping (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

Create_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< bool >

CreateDefaultCashDrawerObject ()

concurrency::task< bool >

CreateDefaultCashDrawerObject ()

concurrency::task< bool >

CreateDefaultCashDrawerObject (CashDrawerInstance instance)

Concurrency::task< void >

CreateDefaultReaderObject ()

Concurrency::task< void >

CreateDefaultReaderObject ()

Concurrency::task
< Windows::Networking::BackgroundTransfer::DownloadOperation^>

CreateDownloadAsync (Windows::Networking::BackgroundTransfer::BackgroundDownloader^downloader, Platform::String^remoteAddress, Platform::String^fileName)

void

CreateFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CreateFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CreateGeneratorButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CreateGeneratorButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CreateGeneratorButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Xaml::Controls::TextBlock

CreateHeaderTextBlock (Platform::String^contents)

void

CreateLayers ()

Windows::UI::Xaml::Controls::TextBlock

CreateLineItemTextBlock (Platform::String^contents)

void

CreateLocalDataContainers ()

void

CreateMenuItems ()

void

CreateOrUpdatePropertyPopUp (Windows::UI::Input::PointerPoint^currentPoint)

void

CreateOverlays ()

void

CreateOverlays ()

Concurrency::task
< Platform::Collections::Vector
< Windows::Networking::BackgroundTransfer::BackgroundTransferContentPart^>^>

CreatePartsAsync (Windows::Foundation::Collections::IVectorView< Windows::Storage::StorageFile^>^files)

concurrency::task< bool >

CreatePassportKeyAsync (Platform::String^accountId)

concurrency::task< void >

CreateReaderAsync ()

concurrency::task< void >

CreateReaderAsync (Windows::Media::Capture::Frames::MediaFrameSourceInfo^sourceInfo)

Windows::Storage::Streams::IBuffer

CreateSolidGlyphBuffer (int widthInPixels, int heightInPixels)

Platform::Array< bool >

CreateSwitchStateArray (byte output[])

void

CurrentToolChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

CustomCommandButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

CustomTitleBar_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

CustomTitleBar_Unloaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

CutFlyoutItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DataSource_VectorChanged (Windows::Foundation::Collections::IObservableVector< xBindSampleModel::FileItem^>^sender, Windows::Foundation::Collections::IVectorChangedEventArgs^e)

task< void >

Deactivate ()

void

DefaultCloseCommandButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DefineGlyphButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Delete_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteAllItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteAllItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteItemsHelper (std::function< Windows::Foundation::IAsyncAction^(Windows::Storage::Search::ContentIndexer^)> deleteFunction)

void

DeleteKeywords_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteMultipleItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

DeletePassportServerSide ()

void

DeleteSingleItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeleteSingleItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DemonstrateLogging (Windows::Foundation::Diagnostics::LoggingChannel^channel)

void

DescriptionLocalizedResource_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DestroyWindowButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

deviceConnectDevices_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

deviceConnectStart_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

deviceConnectStop_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

deviceEventsBegin_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

deviceEventsCancel_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

deviceEventsGet_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeviceIOGet_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DeviceIOSet_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

dictationTextBox_TextChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::TextChangedEventArgs^e)

void

DisableButtons ()

void

DisableButtons ()

void

DisableButtons ()

void

DisableNonSquarePARProfiles ()

void

DisableNonSquarePARProfiles ()

void

DisconnectFromDevice_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

void

DiscoverActiveDownloads ()

void

DiscoverActiveUploads ()

void

DismissPopup_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DismissPopup_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DismissPopup_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DispatcherTimer_Tick (Platform::Object^sender, Platform::Object^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Display_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayCurrentReading (Platform::Object^sender, Platform::Object^e)

void

DisplayInformation_DpiChanged (Windows::Graphics::Display::DisplayInformation^displayInformation, Platform::Object^e)

void

DisplayInformation_OrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

DisplayMetrics (Windows::UI::Core::AnimationMetrics::AnimationEffect effect, Windows::UI::Core::AnimationMetrics::AnimationEffectTarget target)

void

DisplayMultipleCandidates (Windows::Foundation::Collections::IVectorView< Platform::String^>^candidates)

void

DisplayMultipleCandidates (Windows::Foundation::Collections::IVectorView< Platform::String^>^candidates)

void

DisplayNameLocalizedResource_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DisplayOrientation (Windows::Devices::Sensors::SimpleOrientation orientation)

void

DisplayOrientation (Windows::Devices::Sensors::SimpleOrientation orientation)

void

DisplayProperties_DpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

DisplayProperties_DpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

Platform::String

DisplayRoundingAlgorithmAsString (Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm)

void

DisplayTextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DisplayTextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DisplayTextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

DisplayUserInformationAsync (Platform::String^userID)

void

DisposeLamp ()

void

DisposeMediaCapture ()

double

DistanceFromCenter (Windows::Foundation::Point position)

void

DoCleanup ()

Platform::String

DoCurrencyRoundingScenarios (Platform::String^currencyCode, Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm)

Platform::String

DoIncrementRoundingScenarios (Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm)

Platform::String

DoPaddingAndRoundingScenarios (Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm, unsigned int significantDigits, int integerDigits, int fractionalDigits)

Platform::String

DoPaddingScenarios (Windows::Globalization::NumberFormatting::INumberFormatter^formatter)

void

DoScenario (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DoScenario (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

DoSignificantDigitRoundingScenarios (Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm)

void

DoSomething (Windows::Foundation::Diagnostics::ILoggingTarget^logger)

void

DoWin10Mode (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

DoWin81Mode (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

DownloadAsync (DownloadOperationItem^item)

Concurrency::task
< Windows::ApplicationModel::Contacts::Contact^>

DownloadContactDataAsync (Windows::ApplicationModel::Contacts::Contact^contact)

void

DownloadProgress (Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^operation, Windows::Networking::BackgroundTransfer::DownloadOperation^)

void

DownloadProgress (DownloadOperationItem^item)

void

DragCompleted (Windows::Foundation::IAsyncOperation< Windows::ApplicationModel::DataTransfer::DataPackageOperation >^asyncInfo, Windows::Foundation::AsyncStatus asyncStatus)

Concurrency::task< void >

DrainBackBufferAsync ()

void

DrawBoundingRect ()

void

drawer_AlarmExpired (Windows::Devices::PointOfService::CashDrawerCloseAlarm^alarm, Platform::Object^sender)

void

drawer_StatusUpdated (Windows::Devices::PointOfService::CashDrawer^sender, Windows::Devices::PointOfService::CashDrawerStatusUpdatedEventArgs^e)

void

DropBorder_DragEnter (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

DropBorder_Drop (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

DXFLOptionCombo_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

EmailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

task< void >

EnableAsync ()

void

EnableButtons ()

void

EnableButtons ()

void

EnableButtons ()

void

EnableButtons (bool isEnabled)

void

EnableControls_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

EnableDisableLogging (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

EnableDisableLogging (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

EnableIndependentInputEventHandlers ()

void

EnableInkingEventHandlers ()

void

EnableLoggingIndependentInputEventHandlers (bool enable)

void

EnableLoggingStrokeEventHandlers (bool enable)

void

EnableLoggingUnprocessedInputEventHandlers (bool enable)

void

EnableNonSquarePARProfiles ()

void

EnableNonSquarePARProfiles ()

void

EnableUI (bool newState)

void

EnableUnprocessedInputEventHandlers ()

task< void >

EndCall ()

void

EndCallButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

EndRound (bool hasWon)

void

EndScenario_Click (Platform::Object^sender, RoutedEventArgs e)

void

EnvironmentComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

EnvironmentComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

EnvironmentComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ErasingModeCheckBox_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ErasingModeCheckBox_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

EventHandlerForDevice (void)

void

Execute_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Execute_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Execute_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< bool >

ExecuteJobAndReportResultAsync (Windows::Devices::PointOfService::ReceiptPrintJob^job)

void

ExtendedExecutionSessionRevoked (Platform::Object^sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^args)

void

ExtendView_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ExtractButton_Tapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

void

ExtractButton_Tapped (Platform::Object^sender, TappedRoutedEventArgs^e)

FileLoggingSessionScenario ()

void

FillComboBox ()

void

FillTextBox (Windows::Media::Core::SpeechCue^cue)

void

FillTextBoxes (Windows::Media::Core::SpeechCue^cue, Windows::Media::Core::TimedMetadataTrack^timedMetadataTrack)

void

Find_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Find_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Find_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

FindAndCancelExistingBackgroundTask ()

void

findAtCenterButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

FindButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

task< DeviceInformation^>

FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel desiredPanel)

Concurrency::task
< Windows::Security::Cryptography::Certificates::Certificate^>

FindCertificateFromStoreAsync ()

void

FindClaimEnable_Click (Platform::Object^sender, RoutedEventArgs^e)

DeviceListEntry

FindDevice (Platform::String^deviceId)

task< void >

FindReceiptPrinter ()

Windows::UI::Xaml::Controls::ScrollViewer

FindScrollViewer (DependencyObject^depObject)

Windows::UI::Xaml::Controls::ScrollViewer

FindScrollViewer (DependencyObject^depObject)

void

Fix_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

FollowCircleTest (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

FontDownloadListener_DownloadCompleted ()

void

Footer_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Footer_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

FormatComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

FrameReader_FrameArrived (Windows::Media::Capture::Frames::MediaFrameReader^sender, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args)

void

FrameReader_FrameArrived (Windows::Media::Capture::Frames::MediaFrameReader^sender, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args)

void

FulfillConsumableButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

FulfillConsumableButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Input::GestureSettings

GenerateDefaultSettings ()

concurrency::task< UIElement^>

GeneratePageAsync (int photoNumber, PageDescription pageDescription)

void

GetAccounts ()

Concurrency::task
< Windows::Devices::Sensors::ActivitySensor^>

GetActivitySensorAsync ()

Platform::String

GetAddress (int i)

Platform::String

GetAppLanguagesAsFormattedString ()

void

GetAssociatedProductsButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetBooleanInputReport_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

Concurrency::task< void >

GetBooleanInputReportAsync (uint8 buttonNumber)

void

GetButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task
< Windows::Security::Cryptography::Certificates::Certificate^>

GetClientCertificateAsync ()

const std::vector< Cluster > &

GetClustersForZoomLevel (int zoomLevel)

void

GetCO2Level (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Color

getColor (Platform::String^colorString)

Windows::UI::Color

getColor (Platform::String^colorString)

void

GetConsumableBalanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetConsumableBalanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetCurrentButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Input::Inking::InkStrokeContainer

GetCurrentStrokesView (Windows::Foundation::DateTime time)

Platform::String

GetCustomerFooter ()

Platform::String

GetCustomerFooter ()

void

GetCustomProfile ()

void

GetData (Platform::Object^sender, Platform::Object^e)

SampleDataModel

GetDataModelForCurrentListViewFlyout ()

SampleDataModel

GetDataModelForCurrentListViewFlyout ()

void

GetDefaultAsyncBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetDefaultProvidersAndAccounts ()

void

GetDependencies_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

GetDeviceSpecificProperties (Windows::UI::Input::PointerPoint^currentPoint)

Windows::Foundation::Deferral

GetExecutionDeferral ()

void

GetFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetFileFromFutureAccessListButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetFilesAndFoldersButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetGyrometerSample (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetHistory_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

PointerHitTestStates

GetHitTestState (Windows::Foundation::Point position)

InkingAreaSubStates

GetInkingSubstate (Windows::UI::Core::PointerEventArgs^args)

void

GetInstalledLocation_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

unsigned int

GetItemIndex (Windows::UI::Input::RadialControllerMenuItem^item)

void

GetLedBlinkPattern_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

GetLedBlinkPatternAsync (void)

void

GetLicenseState ()

Windows::UI::Color

GetLogoBackgroundColor ()

void

GetManagedConsumablesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetManufacturerName_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

GetMerchantFooter ()

Platform::String

GetMerchantFooter ()

Platform::String

GetMouseProperties (Windows::UI::Input::PointerPoint^currentPoint)

void

GetNumericInputReport_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

Concurrency::task< void >

GetNumericInputReportAsync (void)

void

GetPackage_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetParent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::UI::Input::Inking::InkStroke

GetPartialStroke (Windows::UI::Input::Inking::InkStroke^stroke, Windows::Foundation::DateTime time)

concurrency::task
< Windows::Storage::Streams::IBuffer^>

GetPassportAuthenticationMessageAsync (Windows::Storage::Streams::IBuffer^message, Platform::String^accountId)

concurrency::task
< Windows::Security::Credentials::PasswordCredential^>

GetPasswordCredentialFromUserAsync ()

Platform::String

GetPenProperties (Windows::UI::Input::PointerPoint^currentPoint)

void

GetPicturesLibrary ()

concurrency::task
< Platform::String^>

GetPinFromUserAsync ()

Platform::String

GetPointerProperties (Windows::UI::Input::PointerPoint^currentPoint)

void

GetPresetProfile (Windows::UI::Xaml::Controls::ComboBox^comboBox)

void

GetPresetProfile (Windows::UI::Xaml::Controls::ComboBox^comboBox)

void

GetProviders ()

void

GetProvidersAndAccounts ()

void

GetProvidersAndAccounts ()

void

GetProvidersAndAccounts ()

void

GetProvidersAndAccounts ()

Windows::UI::Input::RadialControllerMenuItem

GetRadialControllerMenuItemFromSender (Platform::Object^sender)

Platform::Collections::Vector
< Platform::String^>

GetSampleData ()

Windows::Devices::Enumeration::DevicePairingKinds

GetSelectedCeremonies ()

void

GetThumbnailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetThumbnailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetThumbnailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetThumbnailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetThumbnailButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task
< Platform::String^>

GetTokenFromAzureOAuthAsync ()

Platform::String

GetTouchProperties (Windows::UI::Input::PointerPoint^currentPoint)

void

GetUnmanagedConsumablesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GetUserCollectionButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< bool >

GetUserConfirmationAsync (Platform::String^pin)

Concurrency::task
< Platform::String^>

GetVideoProfileSupportedDeviceIdAsync (Windows::Devices::Enumeration::Panel panel)

Concurrency::task
< Platform::String^>

GetVideoProfileSupportedDeviceIdAsync (Windows::Devices::Enumeration::Panel panel)

Concurrency::task
< Platform::String^>

GetVideoProfileSupportedDeviceIdAsync (Windows::Devices::Enumeration::Panel panel)

void

GreenButton_Click (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)

void

GroupByHelper (Windows::Storage::Search::QueryOptions^queryOptions)

void

GroupByMonthButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GroupByRatingButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GroupByTagButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

GroupComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

GroupNameLocalizedResource_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

HandleCardAdded (Windows::Devices::SmartCards::SmartCardReader^evtReader, Windows::Devices::SmartCards::CardAddedEventArgs^args)

void

HandleCardRemoved (Windows::Devices::SmartCards::SmartCardReader^evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs^args)

void

HandleDownloadAsync (Windows::Networking::BackgroundTransfer::DownloadOperation^download, boolean start)

Concurrency::task< void >

HandleDownloadAsync ()

void

HandleError (Platform::Exception^error, Platform::String^msg, Platform::String^prefix)

void

HandleFollowCircleInput (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

HandleRecognitionResult (Windows::Media::SpeechRecognition::SpeechRecognitionResult^recoResult)

void

HandleRecognitionResult (Windows::Media::SpeechRecognition::SpeechRecognitionResult^recoResult)

void

HandleRegularInput (Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^args)

void

HandleUploadAsync (Windows::Networking::BackgroundTransfer::UploadOperation^upload, bool start)

void

HeightSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

HexDump (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

HideGuidance ()

void

HideGuidance ()

void

HideGuidance ()

void

HideGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

HideGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

HideGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

HidePairingPanel ()

void

HidePropertyPopUp (Windows::UI::Input::PointerPoint^currentPoint)

void

HighlightWordOnScreen (int startPositionInInput, int endPositionInInput)

void

HttpMapTileDataSourceUriRequested (Windows::UI::Xaml::Controls::Maps::HttpMapTileDataSource^sender, Windows::UI::Xaml::Controls::Maps::MapTileUriRequestedEventArgs^e)

bool

InCircleEdgeZone (double distanceFromCenter)

void

IndependentEvent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

IndependentInputOnPointerEntering (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerExiting (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerHovering (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerLost (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerMoving (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerPressing (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

IndependentInputOnPointerReleasing (Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^sender, Windows::UI::Core::PointerEventArgs^args)

void

InertiaSwitch_Toggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InertiaSwitch_Toggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitalizeAccountsControlDialog ()

void

InitalizeAccountsControlDialog ()

void

InitalizeAccountsControlDialog ()

void

InitalizeAccountsControlDialog ()

void

InitalizeAccountsControlDialog ()

void

InitCustomProfileBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitDrawerButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitDrawerButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Initialize (Platform::String^displayName, Windows::Devices::Enumeration::DeviceClass deviceClassSelector, Platform::String^selector, Windows::Devices::Enumeration::DeviceInformationKind kind)

task< void >

Initialize ()

task< void >

Initialize ()

task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

Concurrency::task< void >

InitializeAsync ()

task< void >

InitializeCameraAsync ()

Concurrency::task< void >

InitializeCameraAsync ()

Concurrency::task< void >

InitializeCameraAsync ()

Concurrency::task< void >

InitializeCameraAsync ()

void

InitializeCameraButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitializeCameraButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitializeCameraButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitializeController ()

void

InitializeDeviceWatchers (void)

Concurrency::task< void >

InitializeLampAsync ()

void

InitializeListboxVoiceChooser ()

void

InitializeListboxVoiceChooser ()

void

InitializeListboxVoiceChooser ()

void

InitializeOsrFx2DeviceWatcher (void)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer ()

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeRecognizer (Windows::Globalization::Language^recognizerLanguage)

void

InitializeSuperMuttDeviceWatcher (void)

void

InitializeTransforms ()

void

InitializeUIControls ()

void

InitializeValues ()

void

InitializeValues ()

void

InitializeValues ()

void

InitializeValues ()

IAsyncAction

initializing_previewSetupCompleted ()

void

InitLampBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InitManipulationTransforms ()

void

InitOptions ()

void

InitOptions ()

void

InitRecordProfileBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InkingEvent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InkingModeSelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

InkPresenter_StrokesCollected (Windows::UI::Input::Inking::InkPresenter^sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^args)

void

InkPresenter_StrokesCollected (Windows::UI::Input::Inking::InkPresenter^sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^e)

void

InkPresenter_StrokesErased (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

InkPresenter_StrokesErased (Windows::UI::Input::Inking::InkPresenter^sender, Windows::UI::Input::Inking::InkStrokesErasedEventArgs^args)

void

InkReplayTimer_Tick (Platform::Object^sender, Platform::Object^e)

void

InkStackPanel_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs e)

void

InkToolbar_ActiveToolChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

InkToolbar_EraseAllClicked (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

inkToolbar_InkDrawingAttributesChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

InkToolbar_InkDrawingAttributesChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

InkToolbar_IsStencilButtonCheckedChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs^args)

void

InkToolbar_IsStencilButtonCheckedChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs^args)

void

inkToolbar_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InkToolbar_SelectedStencilChanged (Windows::UI::Xaml::DependencyObject^sender, Windows::UI::Xaml::DependencyProperty^dp)

void

InputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

InputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task
< Windows::Security::Cryptography::Certificates::Certificate^>

InstallClientCertificateAsync ()

void

InterruptMessageWorker (Windows::Devices::Custom::CustomDevice^fx2Device, Windows::Storage::Streams::IBuffer^switchMessageBuffer)

void

InvalidateLayout ()

void

InvalidateLayout ()

void

InvalidateLayout ()

bool

IsChecked (Windows::UI::Xaml::Controls::Primitives::ToggleButton^button)

Concurrency::task< bool >

IsFixNeededAsync (Windows::ApplicationModel::UserDataAccounts::UserDataAccount^account)

bool

IsFx2CustomTriggerTaskRegistered ()

bool

IsItemInMenu (Windows::UI::Input::RadialControllerMenuItem^item)

bool

IsPrinterClaimed ()

bool

IsTargetBorder (Platform::Object^sender)

bool

IsWebException (Platform::String^title, Platform::Exception^ex)

bool

IsWebException (Platform::String^title, Platform::Exception^ex)

void

Lamp_AvailabilityChanged (Windows::Devices::Lights::Lamp^sender, Windows::Devices::Lights::LampAvailabilityChangedEventArgs^args)

void

lampToggle_Toggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

LanguageList_SelectionChanged (Platform::Object^sender, SelectionChangedEventArgs^e)

void

LanguageList_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

LatencyModeToggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Launch_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Launch_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Launch_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Launch_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Launch_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

LaunchAtSize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

LaunchContextMenu (Windows::Foundation::Point contextMenuPosition)

void

LaunchInFullScreenModeCheckBox_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ListboxVoiceChooser_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ListboxVoiceChooser_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ListboxVoiceChooser_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ListFoldersButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ListSmartCards_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ListView_ContextCanceled (Windows::UI::Xaml::UIElement^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ListView_ContextRequested (Windows::UI::Xaml::UIElement^sender, Windows::UI::Xaml::Input::ContextRequestedEventArgs^e)

void

LoadAccount ()

void

LoadAccount ()

void

LoadAccounts ()

concurrency::task
< Windows::UI::Xaml::Media::Imaging::WriteableBitmap^>

LoadBitmapAsync (Windows::Foundation::Uri^source, bool landscape)

void

LoadButton_Tapped (Platform::Object^sender, TappedRoutedEventArgs^e)

task< void >

LoadImage (Windows::Storage::StorageFile^file)

Concurrency::task
< Windows::Graphics::Imaging::BitmapFrame^>

LoadLogoBitmapAsync ()

Concurrency::task< void >

LoadPlaceInfoAsync ()

void

LoadSampleImage ()

void

LocalClientButtonClicked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

LockScenarioChange ()

void

LockScenarioChange ()

void

Log (Platform::String^message)

void

Log (Platform::String^message)

void

Log (Platform::String^message)

void

Log (LogEventAction action)

void

LogContactInfo (Windows::UI::Input::RadialControllerScreenContact^contact)

void

LogException (Platform::String^title, Platform::Exception^ex)

void

LogException (Platform::String^title, Platform::Exception^ex)

void

LogException (Platform::String^title, Platform::Exception^ex, Windows::Networking::BackgroundTransfer::DownloadOperation^download=nullptr)

LoggingScenarioEventArgs (LoggingScenarioEventType type, const std::wstring &logFileFullPath)

LoggingScenarioEventArgs (bool enabled)

LoggingSessionScenario ()

void

LogMessage (Platform::String^message)

void

LogoffAndRemoveAccount ()

void

LogoffAndRemoveAccount ()

void

LogoffAndRemoveAccount ()

void

LogoffAndRemoveAccount ()

Windows::Foundation::IAsyncAction

LogoffAndRemoveAccount (Windows::Security::Credentials::WebAccount^account)

void

LogoffAndRemoveAccount ()

void

LogoffAndRemoveAllAccounts ()

void

LogStatus (Platform::String^message, SDKTemplate::NotifyType type)

void

LogStatus (Platform::String^message, SDKTemplate::NotifyType type)

void

LogStatus (Platform::String^message, SDKTemplate::NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusAsync (Platform::String^message, NotifyType type)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

Concurrency::task< void >

LogStatusToOutputBoxAsync (Platform::String^message)

void

LogToggleSwitch_Toggled (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MakeCurrent_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs e)

void

Manage_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ManipulateMe_ManipulationCompleted (Platform::Object^sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^e)

void

ManipulateMe_ManipulationDelta (Platform::Object^sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^e)

void

ManipulateMe_ManipulationInertiaStarting (Platform::Object^sender, Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^e)

void

ManipulateMe_ManipulationStarted (Platform::Object^sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^e)

void

mapBillboardAddButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapClearButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapElement3DAddButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapElementsLayer1Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapElementsLayer2Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapIconAddButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapItemButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapPolygonAddButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

mapPolylineAddButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MarkIn (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MarkOut (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MarshalLog (Platform::String^value)

void

MarshalLog (Platform::String^value)

void

MarshalNotifyUser (Platform::String^message, SDKTemplate::NotifyType type)

void

MatchPreviewAspectRatio ()

void

media_MediaEnded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

media_MediaEnded (Windows::Media::Playback::MediaPlayer^timedMetadataTrack, Platform::Object^e)

void

media_MediaEnded (Windows::Media::Playback::MediaPlayer^sender, Platform::Object^e)

void

MediaCapture_Failed (MediaCapture^sender, MediaCaptureFailedEventArgs^errorEventArgs)

void

MediaCapture_Failed (Windows::Media::Capture::MediaCapture^sender, Windows::Media::Capture::MediaCaptureFailedEventArgs^e)

void

MediaCapture_Failed (Windows::Media::Capture::MediaCapture^sender, Windows::Media::Capture::MediaCaptureFailedEventArgs^e)

void

MediaCapture_Failed (Windows::Media::Capture::MediaCapture^sender, Windows::Media::Capture::MediaCaptureFailedEventArgs^e)

void

MessageReceived (Windows::Networking::Sockets::MessageWebSocket^sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^args)

void

MessageReceived (Windows::Networking::Sockets::MessageWebSocket^sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^args)

void

metadata_MarkCueEntered (Windows::Media::Core::TimedMetadataTrack^timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^args)

void

metadata_SpeechCueEntered (Windows::Media::Core::TimedMetadataTrack^timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^args)

void

Methods_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

Methods_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

movementAxis_Changed (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

movementAxis_Changed (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

myGridView_ContainerContentChanging (Windows::UI::Xaml::Controls::ListViewBase^sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^args)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

myMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

myMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

myMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

myMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

MyMap_MapTapped (Windows::UI::Xaml::Controls::Maps::MapControl^sender, Windows::UI::Xaml::Controls::Maps::MapInputEventArgs^args)

void

myMap_ZoomLevelChanged (Windows::UI::Xaml::Controls::Maps::MapControl^sender, Platform::Object^args)

void

MyMapLoaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

NewWindowButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

NextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

NextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

noButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

NotifyIfAnyError (__int64 errCode)

void

NotifyPropertyChanged (Platform::String^prop)

void

NotifyUser (Platform::String^strMessage, NotifyType type)

void

NotifyUser (Platform::String^strMessage, NotifyType type)

void

OfflineLicensesChanged (Windows::Services::Store::StoreContext^sender, Platform::Object^args)

void

okButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnAamvaCardDataReceived (Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderAamvaCardDataReceivedEventArgs^args)

void

OnAccessChanged (Windows::Devices::Enumeration::DeviceAccessInformation^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^args)

void

OnAccessChanged (Windows::Devices::Enumeration::DeviceAccessInformation^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^args)

void

OnAccessChanged (Windows::Devices::Enumeration::DeviceAccessInformation^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^args)

void

OnAccountCommandsRequested (Windows::UI::ApplicationSettings::AccountsSettingsPane^sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

OnAccountCommandsRequested (Windows::UI::ApplicationSettings::AccountsSettingsPane^sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

OnAccountCommandsRequested (Windows::UI::ApplicationSettings::AccountsSettingsPane^sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

OnAccountCommandsRequested (Windows::UI::ApplicationSettings::AccountsSettingsPane^sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

OnAccountCommandsRequested (Windows::UI::ApplicationSettings::AccountsSettingsPane^sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^e)

void

OnAppResume (Platform::Object^sender, Platform::Object^args)

void

OnAppResume (Platform::Object^sender, Platform::Object^args)

void

OnAppResuming (Platform::Object^sender, Platform::Object^args)

void

OnAppResuming (Platform::Object^sender, Platform::Object^args)

void

OnApproximateAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnApproximateAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnAppSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnAppSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnAppSuspension (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)

void

OnAppSuspension (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)

void

OnAutoDismissTimerExpired (Platform::Object^sender, Platform::Object^e)

void

OnAutoDismissTimerExpired (Platform::Object^sender, Platform::Object^e)

void

OnAutoDismissTimerExpired (Platform::Object^sender, Platform::Object^e)

void

OnBackgroundTaskCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^e)

void

OnBankCardDataReceived (Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderBankCardDataReceivedEventArgs^args)

void

OnBringIntoView (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnButtonClicked (Windows::UI::Input::RadialController^sender, Windows::UI::Input::RadialControllerButtonClickedEventArgs^args)

void

OnCaptureFailed (Windows::Media::Capture::MediaCapture^sender, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs)

void

OnChannelLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel^sender, Platform::Object^args)

void

OnChannelLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel^sender, Platform::Object^args)

void

OnChatViewContainerContentChanging (Windows::UI::Xaml::Controls::ListViewBase^sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^args)

void

OnClear (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnClear (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnClear (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnClosed (Windows::Networking::Sockets::IWebSocket^sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^args)

void

OnClosed (Windows::Networking::Sockets::IWebSocket^sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^args)

void

OnClosed (Windows::Networking::Sockets::IWebSocket^sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^args)

void

OnClosed (Windows::Networking::Sockets::IWebSocket^sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^args)

void

OnCompositionScaleChanged (_In_ Windows::UI::Xaml::Controls::SwapChainPanel^sender, _In_ Object^args)

void

OnCompositionScaleChanged (Windows::UI::Xaml::Controls::SwapChainPanel^sender, Object^args)

void

OnConnectionRequested (Windows::Devices::WiFiDirect::WiFiDirectConnectionListener^sender, Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs^connectionEventArgs)

void

OnConnectionStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectDevice^sender, Object^arg)

void

OnControlAcquired (Windows::UI::Input::RadialController^sender, Windows::UI::Input::RadialControllerControlAcquiredEventArgs^args)

void

OnControlLost (Windows::UI::Input::RadialController^sender, Platform::Object^args)

void

OnCopy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnCustomSensorAdded (Windows::Devices::Enumeration::DeviceWatcher^watcher, Windows::Devices::Enumeration::DeviceInformation^firstDevice)

void

OnCustomSensorAdded (Windows::Devices::Enumeration::DeviceWatcher^watcher, Windows::Devices::Enumeration::DeviceInformation^firstDevice)

void

OnCut (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnDeferredImageRequestedHandler (Windows::ApplicationModel::DataTransfer::DataProviderRequest^request)

void

OnDeviceAccessChanged (Windows::Devices::Enumeration::DeviceAccessInformation^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^eventArgs)

void

OnDeviceAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^deviceInfo)

void

OnDeviceAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^deviceInformation, Platform::String^deviceSelector)

void

OnDeviceAdded (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformation^deviceInfo)

void

OnDeviceClosing (EventHandlerForDevice^sender, Windows::Devices::Enumeration::DeviceInformation^deviceInformation)

void

OnDeviceClosing (EventHandlerForDevice^sender, Windows::Devices::Enumeration::DeviceInformation^deviceInformation)

void

OnDeviceConnected (EventHandlerForDevice^sender, OnDeviceConnectedEventArgs^onDeviceConnectedEventArgs)

void

OnDeviceEnumerationComplete (Windows::Devices::Enumeration::DeviceWatcher^sender, Platform::Object^args)

void

OnDeviceListChanged (Windows::Devices::Enumeration::DeviceWatcher^sender, Platform::String^id)

void

OnDeviceListChanged (Windows::Devices::Enumeration::DeviceWatcher^sender, Platform::String^id)

void

OnDeviceListChanged (Windows::Devices::Enumeration::DeviceWatcher^sender, Platform::String^id)

void

OnDeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInformationUpdate)

void

OnDeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInformationUpdate)

void

OnDeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInfoUpdate)

void

OnDeviceUpdated (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInfoUpdate)

void

OnDisplayContentsInvalidated (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)

void

OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

OnDownloadProgress (Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^sender, Windows::Networking::BackgroundTransfer::DownloadOperation^progress)

void

OnDownloadProgress (Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^sender, Windows::Networking::BackgroundTransfer::DownloadOperation^progress)

void

OnDpiChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)

void

OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^)

void

OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

OnDrawingAttributesChanged (Windows::UI::Xaml::Controls::InkToolbar^sender, Platform::Object^args)

void

OnEnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Object^o)

void

OnHighAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnHighAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnHolding (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::HoldingEventArgs^args)

void

OnIncomingConnection (Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^args)

void

OnIncomingConnection (Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^args)

void

OnIncomingConnection (Object^sender, Object^args)

task< void >

OnInitializeCompleted (Windows::Foundation::HResult hr)

void

OnInitializeCompletedDispatchedHandler ()

void

OnInputReportEvent (Windows::Devices::HumanInterfaceDevice::HidDevice^sender, Windows::Devices::HumanInterfaceDevice::HidInputReportReceivedEventArgs^eventArgs)

void

OnInsertShape (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnIsVisibleChanged (Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^sender, Platform::Object^args)

void

OnKeyDown (Platform::Object^sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^e)

void

OnLayerMapElementClicked (Windows::UI::Xaml::Controls::Maps::MapElementsLayer^sender, Windows::UI::Xaml::Controls::Maps::MapElementsLayerClickEventArgs^args)

void

OnLayoutMetricsChanged (Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^sender, Platform::Object^args)

void

OnLoadAsync (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnLoaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnLoadedActions (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnLogFileGenerated (Windows::Foundation::Diagnostics::IFileLoggingSession^sender, Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs^args)

void

OnLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel^sender, Platform::Object^args)

void

OnLogSizeChanged (Platform::Object^sender, Platform::Object^args)

void

OnManipulationCompleted (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationCompletedEventArgs^args)

void

OnManipulationCompleted (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationCompletedEventArgs^args)

void

OnManipulationCompleted (Windows::UI::Input::GestureRecognizer^, Windows::UI::Input::ManipulationCompletedEventArgs^e)

void

OnManipulationInertiaStarting (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationInertiaStartingEventArgs^args)

void

OnManipulationInertiaStarting (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationInertiaStartingEventArgs^args)

void

OnManipulationInertiaStarting (Windows::UI::Input::GestureRecognizer^r, Windows::UI::Input::ManipulationInertiaStartingEventArgs^e)

void

OnManipulationStarted (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationStartedEventArgs^args)

void

OnManipulationStarted (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationStartedEventArgs^args)

void

OnManipulationStarted (Windows::UI::Input::GestureRecognizer^, Windows::UI::Input::ManipulationStartedEventArgs^e)

void

OnManipulationUpdated (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationUpdatedEventArgs^args)

void

OnManipulationUpdated (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::ManipulationUpdatedEventArgs^args)

void

OnManipulationUpdated (Windows::UI::Input::GestureRecognizer^, Windows::UI::Input::ManipulationUpdatedEventArgs^e)

void

OnMediaCaptureFailed (CaptureDevice^sender, CaptureFailedEventArgs^errorEventArgs)

void

OnMediaCaptureFailed (CaptureDevice^sender, CaptureFailedEventArgs^errorEventArgs)

void

OnMediaFailed (Platform::Object^sender, Windows::UI::Xaml::ExceptionRoutedEventArgs^e)

void

OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)

void

OnNavigationFailed (Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e)

void

OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

OnOrientationChanged (_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args)

void

OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^e)

void

OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)

void

OnPaste (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPenColorChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPenThicknessChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPenTypeChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPointerCanceled (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerCanceled (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerExited (Platform::Object^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnPointerMoved (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerMoved (Platform::Object^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnPointerMoved (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerPressed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerPressed (Platform::Object^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnPointerPressed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerReleased (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPointerReleased (Platform::Object^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnPointerReleased (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^args)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnPrintButtonClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnProgress (Windows::ApplicationModel::Background::BackgroundTaskRegistration^task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^args)

void

OnPropertyChanged (Platform::String^propertyName)

void

OnProximitySensorAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^device)

void

OnProximitySensorAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^device)

void

OnProximitySensorAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^device)

void

OnProximitySensorAdded (Windows::Devices::Enumeration::DeviceWatcher^sender, Windows::Devices::Enumeration::DeviceInformation^device)

void

OnRangesDownloaded (Windows::Networking::BackgroundTransfer::DownloadOperation^sender, Windows::Networking::BackgroundTransfer::BackgroundTransferRangesDownloadedEventArgs^args)

void

OnReadingChanged (Windows::Devices::Sensors::Custom::CustomSensor^sender, Windows::Devices::Sensors::Custom::CustomSensorReadingChangedEventArgs^e)

void

OnReadingChanged (Windows::Devices::Sensors::Pedometer^sender, Windows::Devices::Sensors::PedometerReadingChangedEventArgs^args)

void

OnRecognizeAsync (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnRecognizerChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnReleaseDeviceRequested (Platform::Object^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader^args)

void

OnReleaseDeviceRequested (Platform::Object^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader^args)

void

OnRendering (_In_ Platform::Object^sender, _In_ Platform::Object^args)

void

OnRendering (Platform::Object^sender, Platform::Object^args)

void

OnReplay (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnReset (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnResuming (Platform::Object^sender, Platform::Object^args)

void

OnRightTapped (Windows::UI::Input::GestureRecognizer^sender, Windows::UI::Input::RightTappedEventArgs^args)

void

OnRotationChanged (Windows::UI::Input::RadialController^sender, Windows::UI::Input::RadialControllerRotationChangedEventArgs^args)

void

OnSaveAsync (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnScreenContactContinued (Windows::UI::Input::RadialController^sender, Windows::UI::Input::RadialControllerScreenContactContinuedEventArgs^args)

void

OnScreenContactEnded (Windows::UI::Input::RadialController^sender, Platform::Object^args)

void

OnScreenContactStarted (Windows::UI::Input::RadialController^sender, Windows::UI::Input::RadialControllerScreenContactStartedEventArgs^args)

void

OnServerCustomValidationRequested (Windows::Networking::Sockets::MessageWebSocket^sender, Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^args)

void

OnServerCustomValidationRequested (Windows::Networking::Sockets::StreamWebSocket^sender, Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^args)

void

OnServerCustomValidationRequested (Windows::Networking::Sockets::MessageWebSocket^sender, Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^args)

void

OnShareProvidersRequested (Windows::ApplicationModel::DataTransfer::DataTransferManager^sender, Windows::ApplicationModel::DataTransfer::ShareProvidersRequestedEventArgs^e)

void

OnShareToContosoChat (Windows::ApplicationModel::DataTransfer::ShareProviderOperation^operation)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs e)

void

OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

void

OnSocketConnectionReceived (Windows::Networking::Sockets::StreamSocketListener^sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^connectionReceivedEventArgs)

void

OnStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher^sender, Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs^statusEventArgs)

void

OnStatusChanged (Platform::Object^sender, LoggingScenarioEventArgs^args)

void

OnStatusChanged (Platform::Object^sender, LoggingScenarioEventArgs^args)

void

OnStopped (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Object^o)

void

OnStrokeCanceled (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnStrokeContinued (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnStrokeEnded (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnStrokesCollected (Windows::UI::Input::Inking::InkPresenter^sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^args)

void

OnStrokeStarted (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e)

void

OnSwapChainPanelSizeChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^e)

void

OnSwapChainPanelSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^args)

void

OnTargetFormatChanged (Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

OnTargetFormatChanged (Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

OnTargetFormatChanged (Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

OnTaskCompleted ()

void

OnTick (Platform::Object^sender, Platform::Object^args)

void

OnTimer (Windows::System::Threading::ThreadPoolTimer^timer)

void

OnTimer (Windows::System::Threading::ThreadPoolTimer^timer)

void

OnTimerTick (Object^sender, Object^e)

void

OnTimerTick (Object^sender, Object^e)

void

OnTimerTick (Object^sender, Object^e)

void

OnUnreliableAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnUnreliableAccuracy (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OnViewChanged (Platform::Object^, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^e)

void

OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)

void

OnVisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

OnVisibilityChanged (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^args)

void

OnWindowResize (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OnWindowResize (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

void

OnWindowSizeChanged (Platform::Object^sender, Windows::UI::Core::WindowSizeChangedEventArgs^e)

void

OpenDrawerButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OpenFromListButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

OpenFx2DeviceAsync (Platform::String^Id)

void

OpenMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OpenMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OpenMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

openPrivacySettings_Click (Windows::UI::Xaml::Documents::Hyperlink^sender, Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^args)

void

openPrivacySettings_Click (Windows::UI::Xaml::Documents::Hyperlink^sender, Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^args)

void

openPrivacySettings_Click (Windows::UI::Xaml::Documents::Hyperlink^sender, Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^args)

void

OrderSlider_ValudChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

OrientationChanged (Windows::Devices::Sensors::SimpleOrientationSensor^sender, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^e)

void

OtherLinkInvoked (Windows::UI::Popups::IUICommand^command)

void

OtherLinkInvoked (Windows::UI::Popups::IUICommand^command)

void

OtherLinkInvoked (Windows::UI::Popups::IUICommand^command)

void

OtherLinkInvoked (Windows::UI::Popups::IUICommand^command)

void

OtherLinkInvoked (Windows::UI::Popups::IUICommand^command)

void

OutputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputPauseButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputPlayButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputSettings (double rawPixelsPerViewPixel, Windows::UI::Xaml::FrameworkElement^rectangle, Windows::UI::Xaml::Controls::TextBlock^relativePxText, Windows::UI::Xaml::Controls::TextBlock^physicalPxText, Windows::UI::Xaml::Controls::TextBlock^fontTextBlock)

void

OutputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputStopButton_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

OutputTokenResult (Windows::Security::Authentication::Web::Core::WebTokenRequestResult^result)

void

Page_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Page_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Page_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Page_Loaded (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PairButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PairButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PairingRequestedHandler (Windows::Devices::Enumeration::DeviceInformationCustomPairing^sender, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs^args)

Windows::Devices::SmartCards::SmartCardPinPolicy

ParsePinPolicy ()

concurrency::task< void >

PassportAvailableCheckAsync ()

void

PassportDelete ()

void

PasteFlyoutItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PauseAll_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PauseAnimationTapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

void

pfnLink_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PhasedTemplate_Checked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PhoneButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PhotoButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PhotoSettings_Changed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickAFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickAFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickAndSetButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickAudioButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickAudioButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickFile (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickFile (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickFile (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickFilesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickFolderButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< void >

PickNextMediaSourceAsync ()

concurrency::task< void >

PickNextMediaSourceAsync ()

concurrency::task< void >

PickNextMediaSourceWorkerAsync ()

concurrency::task< void >

PickNextMediaSourceWorkerAsync ()

void

PickOutput (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickOutput (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickOutput (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickPlaylistButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickPlaylistButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickPlaylistButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickPlaylistButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PickSingleDeviceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Pin_ValueChanged (Windows::Devices::Gpio::GpioPin^sender, Windows::Devices::Gpio::GpioPinValueChangedEventArgs^e)

void

PitchSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

PlayAnimationTapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

void

PlayButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PlayButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PlayButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PlayFile (Windows::Storage::StorageFile^MediaFile)

void

PlayFile (Windows::Storage::StorageFile^MediaFile)

void

PlayFile (Windows::Storage::StorageFile^MediaFile)

void

Pointer_Entered (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

Pointer_Moved (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

Pointer_Pressed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

Pointer_Released (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

Pointer_Wheel_Changed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

PopulateComboBox (Windows::Media::Capture::MediaStreamType streamType, Windows::UI::Xaml::Controls::ComboBox^comboBox, bool showFrameRate=true)

void

PopulateComboBox ()

void

PopulateComboBoxes ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateLanguageDropdown ()

void

PopulateSettingsComboBox ()

void

PrepareSampleFiles_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PresentTextLayout ()

void

PreviewButtonClicked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PreviewImage_SizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

PreviewImage_SizeChanged (Platform::Object^sender, SizeChangedEventArgs^e)

IAsyncAction

previewing_localClientButtonClicked ()

IAsyncAction

previewing_previewButtonClicked ()

IAsyncAction

previewing_recordingStarted ()

void

PreviewSettings_Changed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PreviewSettings_Changed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

printDetailedOptions_OptionChanged (Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails^sender, Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs^args)

void

PrintLine_Click (Platform::Object^sender, RoutedEventArgs e)

void

PrintLineFeedAndCutPaper (ReceiptPrintJob^job, Platform::String^receipt)

void

PrintLineFeedAndCutPaper (Windows::Devices::PointOfService::ReceiptPrintJob^job, Platform::String^receipt)

void

PrintMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PrintMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PrintMenuItem_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

PrintProfileInformation (Windows::Media::Capture::MediaCaptureVideoProfile^profile, Windows::Media::Capture::MediaCaptureVideoProfileMediaDescription^description)

void

PrintReceipt ()

void

PrintReceipt_Click (Platform::Object^sender, RoutedEventArgs e)

void

PrintRow (Platform::Array< byte >^bytes, int i)

void

PrintSelectedItem (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

PrintSelectedItem ()

void

PrivacyPolicyInvoked (Windows::UI::Popups::IUICommand^command)

void

PrivacyPolicyInvoked (Windows::UI::Popups::IUICommand^command)

void

PrivacyPolicyInvoked (Windows::UI::Popups::IUICommand^command)

void

PrivacyPolicyInvoked (Windows::UI::Popups::IUICommand^command)

void

PrivacyPolicyInvoked (Windows::UI::Popups::IUICommand^command)

Concurrency::task< void >

ProcessDataVirtualizationScrollOffsetsAsync (double actualHeight)

void

projectionCombobox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

Protocol_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

double

PtFromPx (double pixel)

void

PurchaseAddOnButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PurchaseAddOnButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PurchaseAddOnButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

PurpleButton_Click (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)

double

PxFromPt (double pt)

void

RadiusSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

RaiseDeviceChanged (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Platform::String^id)

void

RaiseToastAfterDelay (int id, int seconds)

void

ReadBlock_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ReadBytesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Reader_FrameArrived (Windows::Media::Capture::Frames::MediaFrameReader^reader, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args)

void

ReadFromStreamButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::LightSensor^sender, Windows::Devices::Sensors::LightSensorReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Inclinometer^sender, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Compass^sender, Windows::Devices::Sensors::CompassReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Gyrometer^sender, Windows::Devices::Sensors::GyrometerReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::ActivitySensor^sender, Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Inclinometer^sender, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::OrientationSensor^sender, Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Altimeter^sender, Windows::Devices::Sensors::AltimeterReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Barometer^sender, Windows::Devices::Sensors::BarometerReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::ProximitySensor^sender, Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs^e)

void

ReadingChanged (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^e)

void

ReadingChangedOriginal (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^e)

void

ReadingChangedReadingTransform (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^e)

void

ReadLoop (Windows::Storage::Streams::DataReader^dataReader)

void

ReadOnlyTextBox_ContextMenuOpening (Platform::Object^sender, Windows::UI::Xaml::Controls::ContextMenuEventArgs^e)

Concurrency::task< void >

ReadStreamAsync (Concurrency::task< Windows::Networking::BackgroundTransfer::DownloadOperation^> downloadTask, Windows::Storage::Streams::Buffer^readBuffer)

void

ReadTextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ReceiveDataLoop (Windows::Networking::Sockets::StreamWebSocket^activeSocket, Windows::Storage::Streams::IBuffer^readBuffer, UINT32 bytesReceivedSoFar)

void

Recognize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithoutUI_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithoutUIDictationGrammar_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithoutUIListConstraint_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithoutUIWebSearchGrammar_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithUI_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithUIDictationGrammar_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithUIListConstraint_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RecognizeWithUIWebSearchGrammar_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RefreshButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

refreshMapIcons ()

void

RefreshPreview ()

void

RefreshPreview ()

void

RefreshTimer_Tick (Platform::Object^sender, Platform::Object^e)

void

RefreshWindowButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask ()

void

RegisterBackgroundTask (Windows::ApplicationModel::Background::DeviceWatcherTrigger^deviceWatcherTrigger)

void

RegisterBackgroundTask ()

void

RegisterBackgroundTask ()

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterCustomTrigger_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterForAppEvents (void)

void

RegisterForBoundaryEvents (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem)

void

RegisterForDeviceAccessStatusChange ()

void

RegisterForDeviceWatcherEvents (void)

void

RegisterForInputReportEvents ()

void

RegisterForInputReportEvents_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

void

RegisterForMarkEvents (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem)

void

RegisterGroupedBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterGroupedBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RegisterMetadataHandlerForMarks (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem, int index)

void

RegisterMetadataHandlerForSentences (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem, int index)

void

RegisterMetadataHandlerForWords (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem, int index)

void

ReleaseButton1_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ReleaseButton2_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RemoveCustomProviders ()

concurrency::task< void >

RemoveDeviceAsync (Platform::String^id)

void

RemoveDeviceFromList (Platform::String^deviceId)

void

RemoveFeedButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RemoveFolderButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RemoveItem (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

RemoveJumpList_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RenderPropertyPopUp (Platform::String^pointerProperties, Platform::String^deviceSpecificProperties, Windows::UI::Input::PointerPoint^currentPoint)

Platform::String

ReportCalendarData (Windows::Globalization::Calendar^calendar, Platform::String^calendarLabel)

Platform::String

ReportCalendarData (Windows::Globalization::Calendar^calendar, Platform::String^calendarLabel)

Platform::String

ReportCalendarData (Windows::Globalization::Calendar^calendar, Platform::String^calendarLabel)

Platform::String

ReportCalendarData (Windows::Globalization::Calendar^calendar)

void

ReportColors ()

void

ReportContactResult (Windows::ApplicationModel::Contacts::Contact^contact)

void

ReportContactResults (Windows::Foundation::Collections::IVector< Windows::ApplicationModel::Contacts::Contact^>^contacts)

Platform::String

ReportLanguageData (Windows::Globalization::Language^lang)

Platform::String

ReportRegionData (Windows::Globalization::GeographicRegion^region)

void

RequestConsent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RequestTextLayoutUpdate ()

void

Reset ()

void

Reset_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Reset_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetButton_Pressed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

resetButton_Pressed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

resetButton_Pressed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetOutput ()

void

ResetOutput ()

void

ResetPin_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetScenarioState ()

void

ResetScenarioState ()

void

ResetScenarioState ()

void

ResetTheScenarioState ()

void

ResetTheScenarioState ()

void

ResetTheScenarioState ()

void

ResetValuesClick (Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetValuesClick (Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetValuesClick (Object^, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResetValuesClick (Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^e)

void

ResizeView_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RestartWatcher ()

void

ResultsListView_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ResultsListView_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ResumeAll_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RetrieveAllItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RetrieveAllItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RetrieveMatchedItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RetrieveMatchingItems_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

RollSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

RotationSpeedSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

RunDownload (Windows::Networking::BackgroundTransfer::DownloadOperation^download)

void

RunDownloads (Windows::Networking::BackgroundTransfer::BackgroundDownloader^downloader, ScenarioType type)

Concurrency::task< void >

RunDownloadsAsync ()

void

SampleButton_Tapped (Platform::Object^sender, TappedRoutedEventArgs^e)

void

Save_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SaveAccount (Windows::Security::Credentials::WebAccount^account)

void

SaveAccount (Windows::Security::Credentials::WebAccount^account)

void

SaveAccount (Windows::Security::Credentials::WebAccount^account)

void

SaveAccount (Windows::Security::Credentials::WebAccountProvider^provider, Windows::Security::Credentials::WebAccount^account)

void

SaveAccount (Windows::Security::Credentials::WebAccount^account)

void

SaveAccount (Windows::Security::Credentials::WebAccount^account)

void

SaveFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task
< Windows::Storage::StorageFile^>

SaveLogInMemoryToFileAsync ()

void

SaveToFutureAccessListButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScalingSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

Scenario10_SearchMultipleResourceIds (Windows::ApplicationModel::Resources::Core::ResourceContext^context, Platform::Collections::Vector< Platform::String^>^resourceIds)

void

Scenario10_ShowCandidates (Platform::String^resourceId, Windows::Foundation::Collections::IVectorView< Windows::ApplicationModel::Resources::Core::ResourceCandidate^>^resourceCandidates)

void

Scenario10Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Scenario11Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Scenario12Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Windows::Foundation::Rect

Scenario1::GetElementRect (Windows::UI::Xaml::FrameworkElement^element)

Windows::Foundation::Rect

Scenario2::GetTextboxSelectionRect (Windows::UI::Xaml::Controls::TextBox^textbox)

void

Scenario3Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Scenario4::RecoButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< void >

Scenario5::nearbyStreetside (Windows::Devices::Geolocation::Geopoint^spaceNeedlePoint)

void

Scenario5::OnSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

Scenario5Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

Scenario7_DownloadReordering::IsWebException (Platform::String^title, Platform::Exception^ex, Windows::Networking::BackgroundTransfer::DownloadOperation^download=nullptr)

void

Scenario7Button_Show_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Scenario8::LanguageOverrideCombo_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ScenarioControl_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ScenarioControl_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioDisableReadingChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnable (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEnableReadingChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEndReadButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioEndReadButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGet (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGetActivityHistory (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGetCurrentActivity (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGetData (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGetData (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioGetData (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioRegisterTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioRegisterTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioRegisterTask_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioStartReadButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioStartReadButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioUnregisterTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioUnregisterTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScenarioUnregisterTask_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ScrollViewer_ViewChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^args)

void

SDKTemplate::Scenario1_Advertiser::OnConnectionStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectDevice^sender, Platform::Object^arg)

void

SearchButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SecureBootState_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectDeviceInList (Platform::String^deviceIdToSelect)

void

SelectFilesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectImageButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectImageButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectImageButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectionSegmentButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectionSegmentsButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SelectItem (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

SelectLayer (Windows::UI::Xaml::Controls::Maps::MapElementsLayer^layer)

task< void >

SelectPreferredCameraStreamSettingAsync (Windows::Media::Capture::MediaStreamType mediaStreamType, VideoSettingsFilter^settingsFilterFunc)

void

SelectPreviouslySelectedItem (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

Concurrency::task< void >

SendAsync ()

Concurrency::task< void >

SendAsync ()

void

SendBooleanOutputReport_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

Concurrency::task< void >

SendBooleanOutputReportAsync (bool bitValue, uint8 buttonNumber)

void

SendDataLoop (Windows::Networking::Sockets::StreamWebSocket^activeSocket, Windows::Storage::Streams::IBuffer^sendBuffer, UINT32 bytesSentSoFar)

void

SendNumericOutputReport_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

Concurrency::task< void >

SendNumericOutputReportAsync (uint8 valueToWrite)

ServiceViewModel ()

void

ServiceViewModel::ResumeMeteringService (Object^, Object^)

void

ServiceViewModel::SuspendMeteringService (Object^, Windows::ApplicationModel::SuspendingEventArgs^)

void

SessionRevoked (Platform::Object^sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^args)

void

SessionRevoked (Platform::Object^sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^args)

void

SessionRevoked (Platform::Object^sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^args)

void

SetBusy (bool value)

void

SetBusy (bool value)

void

SetBusy (bool value)

void

SetBusy (bool value)

void

SetCancelButton (bool isEnabled)

void

SetCancelButton (bool isEnabled)

void

SetCancelButton (bool isEnabled)

void

SetCanvasSize ()

void

SetClaimedUI (CashDrawerInstance instance)

void

SetDefaultButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SetDefaultRecognizerByCurrentInputMethodLanguageTag ()

void

SetDefaultStyleCombobox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

SetError (Platform::String^errorText)

void

SetItemInvokedCallback (Windows::UI::Input::RadialControllerMenuItem^menuItem, unsigned int index)

void

SetLedBlinkPattern_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

SetLedBlinkPatternAsync (uint8 pattern)

void

SetMapProjection ()

void

SetMapStyle ()

void

SetMapStyleSheet ()

void

SetMargins (Platform::String^marginsValue)

void

SetMinimumSize_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SetOutputFileButton (bool isEnabled)

void

SetOutputFileButton (bool isEnabled)

void

SetPasswordExplainVisibility (bool isShown)

void

SetPickFileButton (bool isEnabled)

void

SetPickFileButton (bool isEnabled)

void

SetPickFileButton (bool isEnabled)

task< void >

SetPreviewRotationAsync ()

bool

SetRecognizerByName (Platform::String^recognizerName)

void

SetReleasedUI (CashDrawerInstance instance)

void

SetResult (Windows::Security::Credentials::UI::CredentialPickerResults^res)

void

SetResult (Windows::Security::Credentials::UI::CredentialPickerResults^res)

void

SetResult (Windows::Security::Credentials::UI::CredentialPickerResults^res)

void

SetStyleSheetStateCombobox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SetTranscodeButton (bool isEnabled)

void

SetTranscodeButton (bool isEnabled)

void

SetTranscodeButton (bool isEnabled)

void

SetUpAccounts ()

void

SetValuesFromLineDisplay ()

void

Shaken (Windows::Devices::Sensors::Accelerometer^sender, Windows::Devices::Sensors::AccelerometerShakenEventArgs^e)

void

ShareWebView_NavigationCompleted (Platform::Object^sender, Windows::UI::Xaml::Controls::WebViewNavigationCompletedEventArgs^e)

void

ShowContactCard_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowContactCard_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowContactCard_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowContactCardWithOptions_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowContactCardWithPlacement_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowDevicePicker (bool pickSingle)

void

ShowDevicePickerButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowGuidance ()

void

ShowGuidance ()

void

ShowGuidance ()

void

ShowGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowGuidanceButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowListButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowPairingPanel (Platform::String^text, Windows::Devices::Enumeration::DevicePairingKinds pairingKind)

void

ShowPropertiesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

showSpaceNeedleButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ShowStandardSystemOverlaysButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

showStreetSideNearSpaceneedle_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SignalBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SignalBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

concurrency::task< void >

SignInPassportAsync (bool passportIsPrimaryLogin)

concurrency::task< bool >

SignInPasswordAsync (bool calledFromPassport)

void

Sleep (int time)

void

Slider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

slider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SlowPhasing_Checked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SlowPhasing_UnChecked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SourceComboBox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

SourceGrid_DragStarting (Windows::UI::Xaml::UIElement^sender, Windows::UI::Xaml::DragStartingEventArgs^args)

void

SourceListView_DragItemsStarting (Platform::Object^sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^e)

void

SourcePositionX_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourcePositionX_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourcePositionY_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourcePositionY_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourcePositionZ_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourcePositionZ_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

SourceTextBlock_DragStarting (Windows::UI::Xaml::UIElement^sender, Windows::UI::Xaml::DragStartingEventArgs^args)

void

SourceTextBlock_PointerMoved (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

Speak_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Speak_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Speak_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SpecificHistory_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SpeechRecognizer_HypothesisGenerated (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognitionHypothesisGeneratedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

void

SpeechRecognizer_StateChanged (Windows::Media::SpeechRecognition::SpeechRecognizer^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^args)

Concurrency::task< void >

StartAsync ()

void

StartButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

task< void >

StartCameraAsync ()

void

StartDeviceWatcher (void)

void

StartDeviceWatchers (void)

void

StartDownload (Windows::Networking::BackgroundTransfer::BackgroundTransferPriority priority)

void

StartDownload (Windows::Storage::StorageFile^destinationFile, Windows::Networking::BackgroundTransfer::BackgroundDownloader^downloader, Windows::Foundation::Uri^source)

void

StartDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartDownload_Click (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Concurrency::task< void >

StartDownloadAndReadContentsAsync ()

void

StartDownloadsButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartHandlingAppEvents (void)

void

StartHighPriorityDownload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartInterruptMessageWorker (Windows::Devices::Custom::CustomDevice^fx2Device)

Concurrency::task< void >

StartLocationTrackingAsync ()

void

StartMultipartUpload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

task< void >

StartPreviewAsync ()

void

StartProcessingDataVirtualizationScrollOffsets (double actualHeight)

concurrency::task< void >

StartReaderAsync ()

void

StartReceiveData (Windows::Networking::Sockets::StreamWebSocket^activeSocket)

task< void >

StartRecordingAsync (Windows::Media::MediaProperties::MediaEncodingProfile^mediaEncodingProfile)

task< void >

StartRecordingToCustomSink ()

task< void >

StartRecordingToCustomSinkAsync ()

void

StartScenario ()

void

StartScenario ()

concurrency::task< void >

StartScenarioAsync ()

concurrency::task< void >

StartScenarioAsync ()

void

StartScrollingButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartSendData (Windows::Networking::Sockets::StreamWebSocket^activeSocket)

Concurrency::task< bool >

StartSensorBackgroundTaskAsync (Platform::String^deviceId)

void

StartStrokeSelection (Windows::Foundation::Point position)

void

StartSuperMuttInputReports (void)

void

StartUpload_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcher ()

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StartWatchers ()

Concurrency::task< void >

StopAllScrollingAsync ()

void

StopAnimationTapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

Concurrency::task< void >

StopAsync ()

void

StopButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopDeviceWatcher (void)

void

StopDeviceWatchers (void)

void

StopHandlingAppEvents (void)

void

StopPlayers ()

void

StopPlayers ()

void

StopPlayers ()

task< void >

StopPreviewAsync ()

concurrency::task< void >

StopReaderAsync ()

task< void >

StopRecordingAsync ()

void

StopReplay ()

void

StopScenario ()

void

StopScenario ()

void

StopScenario ()

void

StopScenario ()

void

StopScrollingButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopSuperMuttInputReports (void)

void

StopWatcher ()

void

StopWatcher ()

void

StopWatcher ()

void

StopWatcher ()

void

StopWatcher ()

void

StopWatcher ()

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatcherButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StopWatchers (bool reset=false)

IAsyncAction

streaming_latencyModeToggled ()

IAsyncAction

streaming_previewButtonClicked ()

IAsyncAction

streaming_recordingStarted ()

Platform::String

StringFromDouble (double)

void

StrokeEvent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

StrokeInput_StrokeStarted (Windows::UI::Input::Inking::InkStrokeInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

styleCombobox_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)

void

SuccessfulSignIn (Account^account)

Concurrency::task< void >

SynthesizeSSMLStream ()

Concurrency::task< void >

SynthesizeTextStream ()

void

SystemGroup_Frequent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SystemGroup_None_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

SystemGroup_Recent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

target_DoubleTapped (Platform::Object^sender, Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs^e)

void

target_Holding (Platform::Object^sender, Windows::UI::Xaml::Input::HoldingRoutedEventArgs^e)

void

target_PointerEntered (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

target_PointerExited (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

target_PointerPressed (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

target_PointerReleased (Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e)

void

target_RightTapped (Platform::Object^sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^e)

void

target_Tapped (Platform::Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^e)

void

TargetListView_DragItemsCompleted (Windows::UI::Xaml::Controls::ListViewBase^sender, Windows::UI::Xaml::Controls::DragItemsCompletedEventArgs^args)

void

TargetListView_DragItemsStarting (Platform::Object^sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^e)

void

TargetListView_DragOver (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetListView_Drop (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetTextBlock_DragEnter (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetTextBlock_Drop (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetTextBox_DragEnter (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetTextBox_DragLeave (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TargetTextBox_Drop (Platform::Object^sender, Windows::UI::Xaml::DragEventArgs^e)

void

TextLayoutFrame_SizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

TextLayoutFrame_SizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

TextLayoutFrame_SizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)

void

TextServiceManager_InputLanguageChanged (Windows::UI::Text::Core::CoreTextServicesManager^sender, Platform::Object^args)

void

TileNotificationButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

timedMetadataTrackChangedHandler (Windows::Media::Playback::MediaPlaybackItem^mediaPlaybackItem, Windows::Foundation::Collections::IVectorChangedEventArgs^args)

void

Timer_Tick (Platform::Object^sender, Platform::Object^e)

void

Timer_Tick (Platform::Object^sender, Platform::Object^e)

void

Timer_Tick (Platform::Object^sender, Platform::Object^e)

void

ToastNotificationButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Toggle_Custom (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ToggleDepth_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ToggleFullScreenModeButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ToggleFullScreenModeButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ToggleLogs (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

ToggleMenuSuppression (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)

void

ToggleSkeletons_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

ToHex (byte value)

void

TongueButton_Click (_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e)

void

ToolButton_Lasso (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TouchInking_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TouchInking_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TouchInkingCheckBox_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TouchInkingCheckBox_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TrafficFlowVisible_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

trafficFlowVisibleCheckBox_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeCancel (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeCancel (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeCancel (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeCustom (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeError (Platform::String^error)

void

TranscodeError (Platform::String^error)

void

TranscodeError (Platform::String^error)

void

TranscodeFailure (Windows::Media::Transcoding::TranscodeFailureReason reason)

void

TranscodeFailure (Windows::Media::Transcoding::TranscodeFailureReason reason)

void

TranscodeFailure (Windows::Media::Transcoding::TranscodeFailureReason reason)

void

TranscodePreset (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TranscodeProgress (Windows::Foundation::IAsyncActionWithProgress< double >^asyncInfo, double percent)

void

TranscodeProgress (Windows::Foundation::IAsyncActionWithProgress< double >^asyncInfo, double percent)

void

TranscodeProgress (Windows::Foundation::IAsyncActionWithProgress< double >^asyncInfo, double percent)

void

TranscodeTrim (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TransferData (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

Transmit_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

TrimClip_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

bool

TryCreateDownloadAsync (Windows::Networking::BackgroundTransfer::BackgroundDownloader^downloader, UINT8 delaySeconds, Platform::String^fileNameSuffix, ScenarioType type, Platform::Collections::Vector< Windows::Networking::BackgroundTransfer::DownloadOperation^>^downloadOperations, Concurrency::task< void > &resultTask)

concurrency::task< bool >

TryInitializeCaptureAsync ()

concurrency::task< bool >

TryInitializeMediaCaptureAsync (Windows::Media::Capture::Frames::MediaFrameSourceGroup^group)

concurrency::task< bool >

TryInitializeMediaCaptureAsync (Windows::Media::Capture::Frames::MediaFrameSourceGroup^group)

void

UndeferElementClick (Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnlockScenarioChange ()

void

UnlockScenarioChange ()

void

UnpairButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnpairButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnprocessedEvent_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnprocessedInput_PointerEntered (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInput_PointerEntered1 (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInput_PointerMoved (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInput_PointerPressed (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInput_PointerReleased (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerEntered (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerExited (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerHovered (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerLost (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerMoved (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerPressed (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnprocessedInputOnPointerReleased (Windows::UI::Input::Inking::InkUnprocessedInput^sender, Windows::UI::Core::PointerEventArgs^args)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Windows::ApplicationModel::Background::IBackgroundTaskRegistration^taskReg)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterBackgroundTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnRegisterBtn_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterCustomTrigger_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterFromAppEvents (void)

void

UnregisterFromDeviceAccessStatusChange ()

void

UnregisterFromDeviceWatcherEvents (void)

void

UnregisterFromInputReportEvent (void)

void

UnregisterFromInputReportEvents_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^eventArgs)

void

UnregisterGroupedTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterGroupedTask (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterTask ()

void

UnregisterUngroupedTasks (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UnregisterUngroupedTasks (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateAvailableLanguages ()

void

UpdateButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateButtons ()

void

UpdateButtons ()

concurrency::task< void >

UpdateButtonStateAsync ()

void

UpdateColors ()

void

UpdateConnectDisconnectButtonsAndList (bool enableConnectButton)

void

UpdateContent ()

void

UpdateContent ()

void

UpdateContent ()

void

UpdateContent ()

void

UpdateControls ()

void

UpdateControls ()

void

UpdateControls ()

void

UpdateCurrentAppLanguageMessage ()

void

UpdateEventRegistration (bool registerForEvents)

void

UpdateFrameSource ()

void

UpdateFullScreenModeStatus ()

void

UpdateGlyphBitmapImage ()

void

UpdateHeaderText ()

void

UpdateLayoutMetrics ()

void

UpdateLocalClientWindow ()

void

UpdateMessageLog (LogEventAction action)

void

UpdateName_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdatePairingButtons ()

void

UpdatePairingButtons ()

void

UpdatePositionAndVisibility ()

void

UpdatePropertyHelper (Platform::String^itemKey, Platform::String^propertyKey, Platform::String^propertyName, Platform::Object^newValue)

void

UpdateProps (Rect boundingBox)

void

UpdateRegisterButton ()

void

UpdateRegisterEventButtons (void)

void

UpdateRunningAverageContainerHeight (Windows::UI::Xaml::Controls::ListViewBase^sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^args)

void

UpdateScalingAndOrder ()

void

UpdateSSMLText ()

void

UpdateStartStopButtons (void)

void

UpdateStatus ()

void

UpdateStatusOutput (Windows::Devices::PointOfService::CashDrawerStatusKind status)

void

UpdateSwitchStateTable (Platform::Array< bool >^SwitchStateArray)

void

UpdateTextLayout ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUI ()

void

UpdateUIAsync (Platform::String^status)

void

UpdateUIAsync (Platform::String^status)

void

UpdateUIAsync (Platform::String^status)

void

UpdateValuesClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateValuesClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateValuesClick (Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateValuesClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UpdateVisualState ()

void

UpdateVisualState ()

void

UpdateVisualState ()

void

UpdateVisualState ()

void

UpdateWordBoxTransform ()

void

UpdateWordBoxTransform ()

Concurrency::task< void >

UploadMultipleFilesAsync (Windows::Foundation::Uri^uri, Windows::Foundation::Collections::IVectorView< Windows::Storage::StorageFile^>^files)

void

UploadProgress (Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::UploadOperation^, Windows::Networking::BackgroundTransfer::UploadOperation^>^operation, Windows::Networking::BackgroundTransfer::UploadOperation^)

Concurrency::task< void >

UploadSingleFileAsync (Windows::Foundation::Uri^uri, Windows::Storage::IStorageFile^file)

void

UseCustomColors_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs e)

void

UseMinimalOverlaysCheckBox_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

UserLanguageToggle_Toggled (Platform::Object^sender, RoutedEventArgs^e)

Windows::Foundation::Uri

ValidateAndGetUri (Platform::String^uriString)

void

verifyButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

VerifyResponse_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Platform::String

VersionString (Windows::ApplicationModel::PackageVersion version)

void

VideoButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

VideoPlaybackErrorHandler (Platform::Object^sender, Windows::UI::Xaml::ExceptionRoutedEventArgs^e)

void

VideoSettings_Changed (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

WaitForDrawerCloseButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

IAsyncAction

waiting_previewButtonClicked ()

void

Watcher_Added (Windows::Devices::Enumeration::DeviceWatcher^watcher, Windows::Devices::Enumeration::DeviceInformation^deviceInformation)

void

Watcher_DeviceAdded (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformation^deviceInfo)

void

Watcher_DeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInfoUpdate)

void

Watcher_DeviceUpdated (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^deviceInfoUpdate)

void

Watcher_EnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher^watcher, Platform::Object^e)

void

Watcher_EnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Platform::Object^e)

void

Watcher_Stopped (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher, Platform::Object^e)

void

WebAccountCommandInvoked (Windows::UI::ApplicationSettings::WebAccountCommand^command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^args)

void

WebAccountCommandInvoked (Windows::UI::ApplicationSettings::WebAccountCommand^command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^args)

void

WebAccountCommandInvoked (Windows::UI::ApplicationSettings::WebAccountCommand^command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^args)

void

WebAccountCommandInvoked (Windows::UI::ApplicationSettings::WebAccountCommand^command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^args)

void

WebAccountCommandInvoked (Windows::UI::ApplicationSettings::WebAccountCommand^command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^args)

void

WebAccountProviderCommandInvoked (Windows::UI::ApplicationSettings::WebAccountProviderCommand^command)

void

WebAccountProviderCommandInvoked (Windows::UI::ApplicationSettings::WebAccountProviderCommand^command)

void

WebAccountProviderCommandInvoked (Windows::UI::ApplicationSettings::WebAccountProviderCommand^command)

void

WebAccountProviderCommandInvoked (Windows::UI::ApplicationSettings::WebAccountProviderCommand^command)

void

WebAccountProviderCommandInvoked (Windows::UI::ApplicationSettings::WebAccountProviderCommand^command)

void

Window_VisibilityChanged (Platform::Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e)

void

WordSegmentButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WordSegmentsButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteBlock_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteBytesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteTextButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteToFileButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteToFileWithExplicitCFUButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

WriteToStreamButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

YawSlider_ValueChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e)

void

YellowButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

void

yesButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Static Private Member Functions

static bool

ArePointsNear (Windows::Foundation::Point point1, Windows::Foundation::Point point2, double threshold)

static bool

canDownload (Windows::Services::Maps::OfflineMaps::OfflineMapPackage^package)

static
Windows::Graphics::Imaging::SoftwareBitmap

ConvertToDisplayableImage (Windows::Media::Capture::Frames::VideoMediaFrame^inputFrame)

static
Windows::ApplicationModel::Contacts::Contact

CreatePlaceholderContact ()

static Platform::String

FormatDownloadedRanges (Windows::Foundation::Collections::IIterable< Windows::Networking::BackgroundTransfer::BackgroundTransferFileRange >^ranges)

static bool

GetAppLocalSettingsValueAsBool (Platform::String^key)

static bool

GetAppLocalSettingsValueAsBool (Platform::String^key)

static Platform::Object

GetAppLocalSettingsValueAsObject (Platform::String^key)

static Platform::Object

GetAppLocalSettingsValueAsObject (Platform::String^key)

static Platform::String

GetAppLocalSettingsValueAsString (Platform::String^key)

static Platform::String

GetAppLocalSettingsValueAsString (Platform::String^key)

static bool

IsAppLocalSettingsValue (Platform::String^key)

static bool

IsAppLocalSettingsValue (Platform::String^key)

static bool

IsWatcherStarted (Windows::Devices::Enumeration::DeviceWatcher^deviceWatcher)

static
Windows::UI::Xaml::Shapes::Line

LineTo (Platform::Array< WindowsPreview::Media::Capture::Frames::TrackedPose >^poses, WindowsPreview::Media::Capture::Frames::BodyPart fromBodyPart, WindowsPreview::Media::Capture::Frames::BodyPart toBodyPart, CoordinateTransformationMethod^positionTransformation)

static unsigned long long

nearestMegabyte (unsigned long long bytes)

static Platform::String

OrientationsToString (Windows::Graphics::Display::DisplayOrientations orientations)

static void

SetAppLocalSettingsValue (Platform::String^key, Platform::Object^value)

static void

SetAppLocalSettingsValue (Platform::String^key, Platform::Object^value)

template<class T >

static void

Swap (T &v1, T &v2)

static Platform::String

ToCustomStyleEntryState (MapIconState state)

static Platform::String

ToDefaultStyleEntryState (MapIconState state)

static
Windows::Graphics::Imaging::SoftwareBitmap

TransformBitmap (Windows::Graphics::Imaging::SoftwareBitmap^inputBitmap, TransformScanline pixelTransformation)

static void

UpdateMapElementOnClick (Windows::UI::Xaml::Controls::Maps::MapElement^mapElement, MapIconStateToStyleEntryState toStyleEntryState)

static void

UpdateMapElementOnPointerEntered (Windows::UI::Xaml::Controls::Maps::MapElement^mapElement, MapIconStateToStyleEntryState toStyleEntryState)

static void

UpdateMapElementOnPointerExited (Windows::UI::Xaml::Controls::Maps::MapElement^mapElement, MapIconStateToStyleEntryState toStyleEntryState)

Private Attributes

Windows::Foundation::EventRegistrationToken

_aamvaCardDataReceivedToken

Windows::Devices::Sensors::Accelerometer

_accelerometer

bool

_active

float

_angularVelocity = 0

Windows::Foundation::EventRegistrationToken

_bankCardDataReceivedToken

bool

_barDismissed

Windows::UI::Xaml::DispatcherTimer

_calibrationTimer

Windows::Storage::StorageFolder

_captureFolder

CardioidSound

_cardioidSound

Windows::Foundation::EventRegistrationToken

_CCCToken

Windows::Foundation::EventRegistrationToken

_CCToken

Windows::Foundation::Diagnostics::LoggingChannel

_channel

Windows::Foundation::Diagnostics::LoggingLevel

_channelLoggingLevel

Windows::Devices::PointOfService::ClaimedMagneticStripeReader

_claimedReader

Windows::UI::Input::Inking::InkInputProcessingConfiguration

_config

Windows::Foundation::EventRegistrationToken

_connectionRequestedToken

ContextMenuFlyout

_contextMenuFlyout

Concurrency::critical_section

_criticalSection

Concurrency::cancellation_token_source

_CTS

PointerHitTestStates

_currentHitTestState

InkingAreaSubStates

_currentHitTestSubState

Platform::String

_currentMessage

ScenarioOneStates

_currentState

CustomDecaySound

_customDecaySound

xBindSampleModel::FileDataSource

_dataSource

Platform::String

_deletedItem

CaptureDevice

_device

Windows::Foundation::EventRegistrationToken

_deviceAddedToken

Windows::Foundation::EventRegistrationToken

_deviceRemovedToken

Windows::Foundation::EventRegistrationToken

_deviceUpdatedToken

Windows::ApplicationModel::Background::BackgroundTaskRegistration

_deviceUseBackgroundTaskRegistration

Windows::ApplicationModel::Background::DeviceUseTrigger

_deviceUseTrigger

Windows::Devices::Enumeration::DeviceWatcher

_deviceWatcher

Windows::Foundation::EventRegistrationToken

_deviceWatcherEnumerationCompletedToken

Windows::Foundation::EventRegistrationToken

_deviceWatcherStoppedToken

std::mutex

_discoveryMutex

Windows::UI::Core::CoreDispatcher

_dispatcher

Windows::Foundation::Collections::IObservableVector
< DownloadOperationItem^>

_downloadCollection

Windows::Foundation::IAsyncOperation
< Windows::ApplicationModel::DataTransfer::DataPackageOperation >

_dragOperation

Platform::String

_dropHere

bool

_enabled

Windows::Media::MediaProperties::IMediaEncodingProperties

_encodingProperties

InkEventLogger *

_eventLogger

bool

_fWatcherStarted

Windows::UI::Input::GestureRecognizer

_gestureRecognizer

float

_height = 0

Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource

_imageSource

Windows::Foundation::EventRegistrationToken

_incomingConnectionEventRegistrationToken

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource

_independentInput

Windows::Foundation::EventRegistrationToken

_independentInputEnteringToken

Windows::Foundation::EventRegistrationToken

_independentInputExitingToken

Windows::Foundation::EventRegistrationToken

_independentInputHoveringToken

Windows::Foundation::EventRegistrationToken

_independentInputLostToken

Windows::Foundation::EventRegistrationToken

_independentInputMovingToken

Windows::Foundation::EventRegistrationToken

_independentInputPressingToken

Windows::Foundation::EventRegistrationToken

_independentInputReleasingToken

bool

_initialization

bool

_initialized = false

Windows::UI::Input::PointerPoint

_initialPointerPoint

Windows::Storage::StorageFile

_InputFile

InputModes

_inputMode

Platform::String

_insideName

bool

_isActive

bool

_isBusy

bool

_isChannelEnabled

bool

_isLoggingEnabled

bool

_isPreparingForSuspend

bool

_isPreviewing

bool

_isRecording

bool

_isTerminator

Windows::Devices::Lights::Lamp

_lamp

Windows::Foundation::EventRegistrationToken

_lampAvailabilutyChangedEventToken

ULARGE_INTEGER

_lastCalibrationTime

LatencyModes

_latencyMode

Windows::Devices::WiFiDirect::WiFiDirectConnectionListener

_listener

Windows::Networking::Sockets::StreamSocketListener

_listenerSocket

std::map< LatencyModes,
Windows::UI::Xaml::Controls::MediaElement^>

_localHostVideo

std::wstring

_logFileFullPath

long

_logFileGeneratedCount

DateTimeFormatter

_longTimeFormatter = ref new DateTimeFormatter("longtime")

Platform::Agile
< Windows::Media::Capture::MediaCapture^>

_mediaCapture

Platform::Agile
< Windows::Media::Capture::MediaCapture >

_mediaCapture

Windows::Foundation::EventRegistrationToken

_mediaCaptureFailedEventRegistrationToken

Windows::Foundation::EventRegistrationToken

_mediaCaptureFailedEventToken

Windows::Foundation::EventRegistrationToken

_mediaElementFailedEventRegistrationToken

Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy

_mediaSink

Windows::Foundation::EventRegistrationToken

_mediaSinkIncomingConnectionEventRegistrationToken

long volatile

_navigationDisabled

OmnidirectionalSound

_omnidirectionalSound

Windows::Foundation::EventRegistrationToken

_onChannelLoggingEnabledToken

Windows::Foundation::EventRegistrationToken

_onLogFileGeneratedToken

Windows::Storage::StorageFile

_OutputFile

Platform::String

_OutputFileExtension = ".mp4"

Platform::String

_OutputFileName

Platform::String

_OutputType = "MP4"

Platform::String

_outsideName

Windows::Foundation::Point

_pastePosition

float

_pitch = 0

int

_pointerId

Windows::Foundation::Point

_prevErasingPoint

ScenarioOneStates

_previousState

Windows::Media::MediaProperties::MediaEncodingProfile

_Profile

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher

_publisher

float

_radius = 2.0f

Windows::Devices::PointOfService::MagneticStripeReader

_reader

bool

_recordingStarted

Platform::Collections::Vector
< Platform::String^>

_reference

Windows::UI::Xaml::DispatcherTimer

_refreshTimer

Windows::Foundation::EventRegistrationToken

_releaseDeviceRequestedToken

std::mt19937

_rnd

Role

_role

float

_roll = 0

SDKTemplate::MainPage

_rootPage

MainPage

_rootPage

std::shared_ptr< SceneComposer >

_sceneComposer

SdkSample

_sdkSample

Platform::Collections::Vector
< Platform::String^>

_selection

Windows::Foundation::Collections::IVector
< Windows::Foundation::Point >

_selectionPoints

Windows::Foundation::Diagnostics::FileLoggingSession

_session

Windows::Foundation::Diagnostics::LoggingSession

_session

Windows::Storage::Streams::DataReader

_socketReader

Windows::Storage::Streams::DataWriter

_socketWriter

Windows::Foundation::TimeSpan

_start

PlayState

_state = PlayState::Stopped

Windows::Foundation::EventRegistrationToken

_statusChangedToken

Windows::Foundation::EventRegistrationToken

_stokeContinuedToken

Windows::Foundation::TimeSpan

_stop

StreamFilteringCriteria

_streamFilteringCriteria

Windows::Networking::Sockets::StreamSocket

_streamSocket

Windows::Foundation::EventRegistrationToken

_strokeCanceledToken

Windows::Foundation::EventRegistrationToken

_strokeEndedToken

Windows::Foundation::EventRegistrationToken

_strokesCollectedToken

Windows::Foundation::EventRegistrationToken

_strokeStartedToken

Platform::String

_symbol

Platform::Collections::Vector
< Platform::String^>

_symbols

Windows::Foundation::EventRegistrationToken

_taskCompletionToken

Windows::UI::Xaml::DispatcherTimer

_timer

DispatcherTimer

_timer

EventRegistrationToken

_timerEventToken

Windows::Media::Transcoding::MediaTranscoder

_Transcoder

LoggingScenarioEventType

_type

Platform::String

_type

Windows::Foundation::EventRegistrationToken

_unprocessedInputEnteredToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputExitedToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputHoveredToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputLostToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputMovedToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputPressedToken

Windows::Foundation::EventRegistrationToken

_unprocessedInputReleasedToken

boolean

_UseMp4

VideoSettingsFilter

_videoSettingsFilter

Windows::Foundation::EventRegistrationToken

_visibilityToken

Windows::Foundation::EventRegistrationToken

_windowSizeEventToken

float

_x = 0

float

_y = 0

float

_yaw = 0

float

_z = -2

Platform::String

AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb"

Platform::String

AAD_SCOPE_REQUESTED = ""

Windows::Devices::Sensors::Accelerometer

accelerometer

Windows::Devices::Sensors::Accelerometer

accelerometerOriginal

Windows::Devices::Sensors::Accelerometer

accelerometerReadingTransform

Windows::UI::ViewManagement::AccessibilitySettings

accessibility

Platform::String

ACCOUNTS_CONTAINER = "accountssettingscontainer"

std::map< ScenarioOneStates,
std::array< ActionTransition^, 5 > >

actionTransitionFunctions

std::map< int,
Windows::Networking::BackgroundTransfer::DownloadOperation^>

activeDownloads

int

activeItemIndex

Windows::Foundation::EventRegistrationToken

activeToolChangedToken

Platform::String

actualRpcCallbackRate

bool

addAccountLaunched

Windows::Devices::Spi::SpiDevice

adxl345Sensor

Platform::String

APP_SPECIFIC_PROVIDER_ID = "myproviderid"

Platform::String

APP_SPECIFIC_PROVIDER_NAME = "App specific provider"

Windows::Foundation::EventRegistrationToken

appResumeEventToken

Windows::Foundation::EventRegistrationToken

appSuspendEventToken

Platform::String

AUTHORITY_SUBCONTAINER = "authorities"

double

averageContainerHeight = 0.0

Platform::String

backgroundTaskName = "DeviceEnumerationCpp_BackgroundTaskName"

bool

backgroundTaskRegistered

Windows::ApplicationModel::Background::IBackgroundTaskRegistration

backgroundTaskRegistration

Windows::Storage::StorageFile

baseVideoFile

Windows::Foundation::DateTime

beginTimeOfRecordedSession

Windows::Foundation::DateTime

beginTimeOfReplay

Windows::Graphics::Imaging::SoftwareBitmap

bitmap

Windows::Foundation::Rect

boundingRect

bool

busy = false

SDKTemplate::CalibrationBar

calibrationBar

Concurrency::cancellation_token_source *

cancellationToken

Concurrency::cancellation_token_source

cancellationTokenSource

Windows::ApplicationModel::Background::BackgroundTaskCancellationReason

CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort

volatile bool

CancelRequested = false

Concurrency::cancellation_token_source

cancelSource

Windows::Devices::PointOfService::CashDrawer

cashDrawerInstance1 = nullptr

Windows::Devices::PointOfService::CashDrawer

cashDrawerInstance2 = nullptr

Windows::UI::Xaml::Style

checkBoxStyle

Windows::Foundation::Point

circleCenter

Windows::Devices::PointOfService::ClaimedCashDrawer

claimedCashDrawerInstance1 = nullptr

Windows::Devices::PointOfService::ClaimedCashDrawer

claimedCashDrawerInstance2 = nullptr

Windows::Devices::PointOfService::ClaimedCashDrawer

claimedDrawer = nullptr

ClaimedPosPrinter

claimedPrinter

std::map< int, std::vector
< Cluster > >

clustersForZoomLevel

Windows::Foundation::Collections::IMap
< Platform::String^,
Windows::UI::Color >

colorLookup

Windows::Devices::Sensors::Compass

compass

Windows::Media::Editing::MediaComposition

composition

concurrency::task_completion_event
< bool >

confirmPinTaskSrc

Platform::String

CONSUMER_AUTHORITY = "consumers"

Windows::Foundation::EventRegistrationToken

continuousRecognitionCompletedToken

Windows::Foundation::EventRegistrationToken

continuousRecognitionResultGeneratedToken

Windows::UI::Input::RadialController

controller

Windows::UI::Xaml::Interop::IBindableObservableVector

conversation

Windows::UI::Core::CoreIndependentInputSource

coreInput

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar

coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView()->TitleBar

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource

coreWetStrokeUpdateSource

Windows::UI::Xaml::Media::TransformGroup

cumulativeTransform

int

currChunk

Windows::Devices::Gpio::GpioPinValue

currentValue

Platform::String

DEFAULT_ACCOUNT_PROVIDER_ID = "https://login.windows.local"

Windows::ApplicationModel::Resources::Core::ResourceContext

defaultContextForCurrentView

Windows::UI::Xaml::Media::CompositeTransform

deltaTransform

uint32

desiredReportInterval = 0

uint32

desiredReportIntervalMs

uint32

desiredReportLatency = 0

Windows::Devices::Enumeration::DeviceInformation

device

Windows::Devices::HumanInterfaceDevice::HidDevice

device

Windows::Foundation::EventRegistrationToken

deviceAccessChangedEventToken

Windows::Devices::Enumeration::DeviceAccessInformation

deviceAccessInfo

Windows::Devices::Enumeration::DeviceAccessInformation

deviceAccessInformation

Windows::Foundation::EventRegistrationToken

deviceAddedEventToken

Windows::Foundation::TypedEventHandler
< EventHandlerForDevice^,
Windows::Devices::Enumeration::DeviceInformation^>

deviceCloseCallback

Windows::Foundation::TypedEventHandler
< EventHandlerForDevice^,
OnDeviceConnectedEventArgs^>

deviceConnectedCallback

Windows::Devices::Enumeration::DeviceInformation

deviceInfo

Windows::Devices::Enumeration::DeviceInformation

deviceInformation

Windows::Devices::Enumeration::DeviceInformationKind

deviceInformationKind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown

Windows::Foundation::EventRegistrationToken

deviceRemovedEventToken

std::shared_ptr
< DX::DeviceResources >

deviceResources

Platform::String

deviceSelector

Windows::Devices::Enumeration::DeviceWatcher

deviceWatcher

DeviceWatcherHelper

deviceWatcherHelper

Platform::Collections::Vector
< DeviceWatcherHelper^>

deviceWatcherHelpers = ref new Platform::Collections::Vector<DeviceWatcherHelper^>()

Platform::Collections::Vector
< Windows::Devices::Enumeration::DeviceWatcher^>

deviceWatchers

std::wstringstream

dictatedTextBuilder

Windows::UI::Input::GestureRecognizer

directXGestureRecognizer

bool

disableFollowCircle = false

bool

discontinueStroke = false

Windows::UI::Core::CoreDispatcher

dispatcher

Windows::UI::Core::ICoreDispatcher

dispatcher

Windows::UI::Xaml::DispatcherTimer

dispatcherTimer

Windows::Devices::Sensors::ProximitySensorDisplayOnOffController

displayController

Windows::Graphics::Display::DisplayInformation

displayInfo

DisplayInformation

displayInformation = DisplayInformation::GetForCurrentView()

Windows::Graphics::Display::DisplayInformation

displayInformation

Platform::String

displayName

DisplayRequest

displayRequest = ref new DisplayRequest()

Windows::Networking::BackgroundTransfer::DownloadOperation

download

const Platform::String

DPOnPageName = "DPOnPage"

Windows::Devices::PointOfService::CashDrawer

drawer = nullptr

Windows::Foundation::TimeSpan

durationOfRecordedSession

Windows::UI::Xaml::Controls::Border

element

Windows::UI::Xaml::UIElement

element

Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint

emailConstraint

Windows::Foundation::DateTime

endTimeOfRecordedSession

Windows::Foundation::EventRegistrationToken

eraseAllClickedToken

Windows::Foundation::EventRegistrationToken

eventRegistrationToken

Windows::Foundation::EventRegistrationToken

eventToken

Platform::String

expectedRpcCallbackRate

bool

externalCamera = false

Platform::String

falToken

Windows::Storage::StorageFile

file = nullptr

Windows::Storage::StorageFile

firstVideoFile

bool

followCircle = false

bool

forceManipulationsToEnd

Windows::Data::Text::TextPredictionGenerator

generator

Windows::Data::Text::TextConversionGenerator

generator

Windows::Data::Text::TextReverseConversionGenerator

generator

Windows::Devices::Geolocation::Geolocator

geolocator

bool

getAllHistory

Windows::Storage::Streams::IBuffer

glyphBuffer

BackgroundTaskRegistrationGroup

group = nullptr

Windows::Devices::Sensors::Gyrometer

gyrometer

Windows::Devices::Sensors::Gyrometer

gyrometerWindows

Windows::Devices::Sensors::Gyrometer

gyrometerWP

Platform::Collections::Vector
< HistoryRecord^>

historyRecords

Windows::Devices::PointOfService::LineDisplayWindow

horizontalScrollableWindow

Windows::UI::Xaml::Controls::Maps::MapTileSource

httpTileSource

Windows::Devices::I2c::I2cDevice

htu21dSensor

Windows::Foundation::EventRegistrationToken

hypothesisGeneratedToken

Platform::String

IMAGE_ENCODING_STRING

Windows::Storage::StorageFile

imageFile

Windows::Devices::Sensors::Inclinometer

inclinometer

event
IncomingConnectionEventHandler

IncomingConnectionEvent

bool

initialized

Windows::Foundation::EventRegistrationToken

inkDrawingAttributesChangedToken

Windows::UI::Input::Inking::InkRecognizerContainer

inkRecognizerContainer

Windows::UI::Xaml::DispatcherTimer

inkReplayTimer

Windows::Foundation::IAsyncAction

inputLoopWorker

Windows::Foundation::EventRegistrationToken

inputReportEventToken

Windows::UI::ViewManagement::UserInteractionMode

interactionMode

bool

isAllDevicesEnumerated

bool

isAngleDetected

bool

IsAnImportantTransaction = true

bool

isBoundRect

bool

isBusy = false

bool

isEnabledAutoReconnect

bool

isInitialized = false

bool

isLastKnownFullScreen = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->IsFullScreenMode

bool

isLaunched = false

bool

isPopulatingLanguages = false

bool

isPreviewing = false

bool

isPropertyChangedObserved

bool

isRegisteredForInputReportEvents

unsigned int

itemsSeen

Windows::Foundation::EventRegistrationToken

keyDownToken

std::map< String^,
Windows::Globalization::Language^>

languageMap

Windows::UI::Xaml::Shapes::Polyline

lasso

int

lastSelectedIndex

ULARGE_INTEGER

lastUpdateTime

const int

LED_PIN = 5

Windows::Devices::PointOfService::ClaimedLineDisplay

lineDisplay

const int

LISTEN_PIN = 6

Windows::Devices::Gpio::GpioPin

listenPin

Platform::Collections::Vector
< DeviceListEntry^>

listOfDevices

Windows::Security::Credentials::WebAccount

m_account

Account

m_account

Windows::Foundation::EventRegistrationToken

m_accountCommandsRequestedRegistrationToken

Platform::Collections::Map
< Platform::String^,
Windows::Security::Credentials::WebAccount^>

m_accounts

Account

m_activeAccount

Windows::Devices::Sensors::ActivitySensor

m_activitySensor

bool

m_addingAccount = true

Windows::Storage::StorageFile

m_afterWriteFile = nullptr

Windows::Graphics::Imaging::SoftwareBitmap

m_backBuffer

Windows::Storage::StorageFile

m_beforeReadFile = nullptr

std::vector
< Windows::UI::Xaml::Media::Brush^>

m_brushes

std::unique_ptr< FrameRenderer >

m_correlatedFrameRenderer

Microsoft::WRL::Wrappers::CriticalSection

m_CritsecCustomSensor

concurrency::critical_section

m_csPrintSync

PageDescription

m_currentPageDescription

concurrency::task< void >

m_currentTask = concurrency::task_from_result()

Windows::Devices::Sensors::Custom::CustomSensor

m_CustomSensor

uint32

m_DesiredReportInterval

Windows::Devices::Enumeration::DeviceAccessInformation

m_DeviceAccessInfo

Windows::Devices::Enumeration::DeviceAccessInformation

m_deviceAccessInfo

std::shared_ptr
< DX::DeviceResources >

m_deviceResources

DirectXPage

m_directXPage

Windows::UI::Core::CoreDispatcher

m_dispatcher

Windows::UI::Core::CoreDispatcher

m_Dispatcher

Windows::Graphics::Display::DisplayInformation

m_displayInformation

DocumentPresenter

m_documentPresenter

Platform::String

m_downloadableFontName

Windows::Foundation::EventRegistrationToken

m_downloadCompletedEventToken

float

m_dpi = 96.0f

Windows::Foundation::EventRegistrationToken

m_dpiChangedEventToken

Platform::String

m_faToken

DWriteTextLayoutCloudFontImplementation::FontDownloadListener

m_fontDownloadListener

Windows::Foundation::EventRegistrationToken

m_frameArrivedToken

Microsoft::WRL::Wrappers::SRWLock

m_frameLock

FrameRenderer

m_frameRenderer

std::map
< Windows::Media::Capture::Frames::MediaFrameSourceKind,
FrameRenderer^>

m_frameRenderers

std::map
< Windows::Media::Capture::Frames::MediaFrameSourceKind,
FrameSourceState >

m_frameSources

SourceGroupCollection

m_groupCollection

Windows::UI::Xaml::Controls::Image

m_imageElement

Platform::String

m_imagePath

Windows::UI::Xaml::Controls::Image

m_imageTarget

DisplayContent

m_imageText

bool

m_isWindowVisible

Platform::Collections::Vector
< Platform::String^>

m_languages = ref new Platform::Collections::Vector<Platform::String^>()

bool

m_layoutUpdateInProgress = false

SimpleLogger

m_logger

SDKTemplate::SimpleLogger

m_logger

Platform::Agile
< Windows::Media::Capture::MediaCapture >

m_mediaCapture

Platform::Agile
< Windows::Media::Capture::MediaCapture^>

m_mediaCapture

LONG

m_messageCount = 0

Platform::String

m_Name

std::map< int, UIElement^>

m_pageCollection

bool

m_passportAvailable = true

Scaling

m_photoScale

PhotoSize

m_photoSize

std::vector< UIElement^>

m_printPages

Windows::Security::Credentials::WebAccountProvider

m_provider

Platform::Collections::Map
< Platform::String^,
Windows::Security::Credentials::WebAccountProvider^>

m_providers

Windows::Media::Capture::Frames::MediaFrameReader

m_reader

std::vector< std::pair
< Windows::Media::Capture::Frames::MediaFrameReader^,
Windows::Foundation::EventRegistrationToken > >

m_readers

Windows::Foundation::EventRegistrationToken

m_readingToken

Windows::Foundation::EventRegistrationToken

m_ReadingToken

std::unique_ptr
< D2DSvgImageRenderer >

m_renderer

LONGLONG

m_requestCount

MainPage

m_rootPage = MainPage::Current

SDKTemplate::MainPage

m_RootPage

AccountAction

m_selectedAccountAction

int

m_selectedSourceGroupIndex = 0

UINT32

m_selectedSourceGroupIndex = 0

Windows::Media::Capture::Frames::MediaFrameSource

m_source

Windows::Foundation::Collections::IObservableVector
< FrameSourceGroupModel^>

m_sourceCollection

bool

m_streaming = false

bool

m_taskRunning = false

Windows::UI::Color

m_textBackgroundColor

Windows::UI::Xaml::Controls::TextBlock

m_textBlock

Windows::UI::Color

m_textColor

DWriteTextLayoutCloudFontImplementation::TextLayout

m_textLayout

DWriteTextLayoutCloudFontImplementation::TextLayoutImageSource

m_textLayoutImageSource

Platform::String

m_title

Windows::Foundation::EventRegistrationToken

m_visibilityChangedEventToken

Windows::Foundation::EventRegistrationToken

m_visibilityEventRegistrationToken

Windows::Foundation::EventRegistrationToken

m_VisibilityToken

Windows::Devices::Enumeration::DeviceWatcher

m_watcher

Windows::Devices::Enumeration::DeviceWatcher

m_Watcher

Windows::Foundation::EventRegistrationToken

m_watcherDeviceAddedToken

Windows::Foundation::EventRegistrationToken

m_watcherDeviceRemovedToken

Windows::Foundation::EventRegistrationToken

m_watcherDeviceUpdatedToken

std::unique_ptr
< SDKTemplate::LowLatencyInputMain >

main

SDKTemplate::ManipulationProcessor

manipulationProcessor

ManipulationInputProcessor

manipulationProcessor

Windows::Storage::Streams::RandomAccessStreamReference

mapBillboardStreamReference

Windows::Storage::Streams::RandomAccessStreamReference

mapIconStreamReference

Platform::Collections::Vector
< Windows::UI::Xaml::Controls::Maps::MapLayer^>

MapLayers

Windows::Storage::Streams::RandomAccessStreamReference

mapModelStreamReference

unsigned int

maxWindows = 0

Platform::Agile< MediaCapture >

mediaCapture

Windows::Foundation::EventRegistrationToken

mediaCaptureFailedEventToken

Windows::Media::Core::MediaStreamSource

mediaStreamSource

std::vector
< Windows::UI::Input::RadialControllerMenuItem^>

menuItems

int

messageNumber = 0

Windows::Networking::Sockets::MessageWebSocket

messageWebSocket

Windows::Storage::Streams::DataWriter

messageWriter

volatile bool

meteringOn

bool

meteringOnWhileSuspension

Platform::String

MICROSOFT_PROVIDER_ID = "https://login.microsoft.com"

bool

mirroringPreview = false

Platform::String

mruToken

Platform::String

MSA_CLIENT_ID = "none"

Platform::String

MSA_SCOPE_REQUESTED = "service::wl.basic::DELEGATION"

Windows::UI::Xaml::Controls::Maps::MapElementsLayer

myLayer1

Windows::UI::Xaml::Controls::Maps::MapElementsLayer

myLayer2

bool

navigatedAway

Platform::String

newButtonText

int

nextWindowId = 0

Windows::Networking::BackgroundTransfer::BackgroundTransferGroup

notificationsGroup

std::array
< Windows::Storage::Streams::RandomAccessStreamReference^, 8 >

numberIconReferences

const int

NumDownloads = 5

uint32

numInputReportEventsReceived

Windows::Globalization::Language

ocrLanguage

Platform::String

ORGANIZATION_AUTHORITY = "organizations"

Windows::Foundation::EventRegistrationToken

orientationChangedEventToken

Windows::Foundation::EventRegistrationToken

orientationChangedToken

Windows::Foundation::EventRegistrationToken

orientationToken

Windows::Storage::StorageFile

overlayVideoFile

Windows::UI::Xaml::UIElement

pageContent = nullptr

Windows::Data::Pdf::PdfDocument

pdfDocument

Windows::Devices::Sensors::Pedometer

pedometer

int

penSize

Windows::System::Threading::ThreadPoolTimer

periodicTimer

Windows::System::Threading::ThreadPoolTimer

PeriodicTimer = nullptr

Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint

phoneConstraint

Windows::Storage::StorageFile

pickedFile

Windows::Storage::StorageLibrary

picturesLibrary

Windows::Devices::Gpio::GpioPin

pin

std::vector< PlaceInfo >

places

Windows::Media::Playlists::Playlist

playlist

Windows::Foundation::EventRegistrationToken

pointerMovedToken

Windows::Foundation::EventRegistrationToken

pointerPressedToken

Windows::Foundation::EventRegistrationToken

pointerReleasedToken

std::map< unsigned int,
Windows::UI::Xaml::Controls::StackPanel^>

popups

Windows::Globalization::Language

previousInputLanguage

Platform::Array< bool >

previousSwitchValues

Windows::UI::Xaml::Media::MatrixTransform

previousTransform

int

previousZoomLevel = 0

PosPrinter

printer

PrintHelper

printHelper

event PropertyChangedEventHandler

privatePropertyChanged

bool

processingScrollOffsets = false

bool

processingScrollOffsetsDeferred = false

unsigned int

Progress = 0

concurrency::task_completion_event
< Windows::Security::Credentials::PasswordCredential^>

providePasswordCredentialSrc

concurrency::task_completion_event
< Platform::String^>

providePinTaskSrc

Platform::String

PROVIDER_ID_SUBCONTAINER = "providers"

Windows::Storage::Streams::IRandomAccessStreamWithContentType

randomAccessStream

Concurrency::cancellation_token_source

readCancellationTokenSource

unsigned int

readCounter = 0

Windows::Devices::SmartCards::SmartCardReader

reader

Windows::Foundation::EventRegistrationToken

readingToken

Windows::Foundation::EventRegistrationToken

readingTokenOriginal

Windows::Foundation::EventRegistrationToken

readingTokenReadingTransform

Concurrency::task
< Windows::Storage::Streams::IBuffer^>

readOperation

Windows::UI::Input::GestureRecognizer

recognizer

Platform::Collections::Vector
< HistoryRecord >

recordCollection

Windows::Foundation::Collections::IVectorView
< Windows::UI::Input::Inking::InkRecognizer^>

recoView

Windows::UI::Xaml::UIElement

reference

bool

registered

Windows::Devices::HumanInterfaceDevice::HidDevice

registeredDevice

bool

registeredForEvents

Windows::Foundation::EventRegistrationToken

releaseDeviceRequestedToken

Windows::Foundation::EventRegistrationToken

releaseRequestedToken1

Windows::Foundation::EventRegistrationToken

releaseRequestedToken2

Windows::Networking::BackgroundTransfer::BackgroundTransferGroup

reorderGroup

Windows::Foundation::Collections::IObservableVector
< DeviceInformationDisplay^>

resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>()

SDKTemplate::MainPage

rootPage = MainPage::Current

MainPage

rootPage = MainPage::Current

int

rotationDegrees

RPC_CLIENT_HANDLE

rpcclient

__int64

rpcDataCountOld = 0

bool

running = false

int32

runningStepCount

Platform::Array< __int64 >

sampleArray

Platform::String

sampleMessage

int

samplePeriod

unsigned int

sampleRefreshCount = 0

Platform::String

savedScrollPosition

Windows::Storage::StorageFile

secondVideoFile

Windows::UI::Xaml::Controls::Maps::MapElementsLayer

selectedLayer

int64_t

selectedStencilChangedToken

Windows::Devices::Sensors::SimpleOrientationSensor

sensor

Windows::Devices::Sensors::Altimeter

sensor

Windows::Devices::Sensors::Barometer

sensor

Windows::Devices::Sensors::LightSensor

sensor

Windows::Devices::Sensors::ProximitySensor

sensor

Windows::Devices::Sensors::OrientationSensor

sensor

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionSession

session

Windows::Foundation::EventRegistrationToken

sessionRevokedToken

const int

SET_PIN = 5

Windows::Devices::Gpio::GpioPin

setPin

uint16

shakeCounter = 0

Windows::Foundation::EventRegistrationToken

shakenToken

Windows::UI::Xaml::Controls::MenuFlyout

sharedFlyout

bool

sliderEnabled

std::vector
< Windows::UI::Xaml::Controls::Slider^>

sliders

double

sliderValue

Platform::Collections::Vector
< SmartCardItem^>

smartCardItems

SocketReaderWriter

socketRW

VideoRotation

sourceRotation

Windows::ApplicationModel::Resources::Core::ResourceContext

speechContext

Windows::Media::SpeechRecognition::SpeechRecognizer

speechRecognizer

Windows::ApplicationModel::Resources::Core::ResourceMap

speechResourceMap

bool

startButtonEnabled

time_t

startTime

Windows::Foundation::EventRegistrationToken

stateChangedToken

Windows::Foundation::EventRegistrationToken

statusUpdatedToken

Windows::Foundation::EventRegistrationToken

stencilButtonCheckedChangedToken

int

stepCount

int

stepGoal

bool

stopButtonEnabled

bool

stopMeteringRequested

Windows::Storage::AccessCache::StorageItemAccessList

storageItemAccessList

Windows::Foundation::Collections::IVectorView
< Windows::Storage::StorageFile^>

storageItems

Windows::Services::Store::StoreContext

storeContext

Platform::String

STORED_ACCOUNT_AUTHORITY = "accountauthority"

Platform::String

STORED_ACCOUNT_ID_KEY = "accountid"

Platform::String

STORED_AUTHORITY_ID_KEY = "authority"

Platform::String

STORED_PROVIDER_ID_KEY = "providerid"

Windows::Networking::Sockets::StreamWebSocket

streamWebSocket

Windows::UI::Input::Inking::InkStrokeBuilder

strokeBuilder

Windows::Foundation::Collections::IVectorView
< Windows::UI::Input::Inking::InkStroke^>

strokesToReplay

Windows::Foundation::Collections::IObservableVector
< Windows::Devices::PointOfService::LineDisplayCursorType >

supportedCursorTypes

Windows::ApplicationModel::SuspendingDeferral

suspendDeferral = nullptr

Windows::Foundation::EventRegistrationToken

suspendingToken

Windows::Foundation::EventRegistrationToken

switchChangedEventsHandler

Windows::Media::SpeechSynthesis::SpeechSynthesisStream

synthesisStream

Windows::Media::SpeechSynthesis::SpeechSynthesizer

synthesizer

int

taskCount = 0

Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral >

TaskDeferral = nullptr

Windows::ApplicationModel::Background::IBackgroundTaskInstance

TaskInstance = nullptr

Windows::ApplicationModel::Background::BackgroundTaskRegistration

taskRegistration

Windows::UI::Text::Core::CoreTextServicesManager

textServiceManager

Windows::UI::Xaml::DispatcherTimer

timer

Windows::Foundation::EventRegistrationToken

timerToken

Windows::UI::ViewManagement::ApplicationViewTitleBar

titleBar

std::vector
< Windows::UI::Xaml::Controls::ToggleSwitch^>

toggles

Windows::Foundation::EventRegistrationToken

token

int32

totalCumulativeSteps

uint32

totalNumberBytesReceived

Windows::UI::Xaml::Media::TransformGroup

transforms

ApplicationTrigger

trigger = nullptr

int32

unknownStepCount

CCCEventHandler

UpdateRunningAverageContainerHeightHandler = ref new CCCEventHandler(this, &ChatListView::UpdateRunningAverageContainerHeight)

std::vector< Platform::String^>

urls

Windows::Devices::PointOfService::LineDisplayWindow

verticalScrollableWindow

Platform::String

VIDEO_ENCODING_STRING

Windows::Foundation::EventRegistrationToken

visibilityToken

int32

walkingStepCount

Windows::Devices::Enumeration::DeviceWatcher

watcher

bool

watchersStarted

bool

watchersSuspended

bool

watcherStarted

bool

watcherSuspended

Windows::Devices::WiFiDirect::WiFiDirectDevice

wfdDevice

Windows::Foundation::Collections::IObservableVector
< WindowInfo^>

windowList = ref new Platform::Collections::Vector<WindowInfo^>()

Windows::Foundation::EventRegistrationToken

windowResizeToken

Windows::Foundation::EventRegistrationToken

windowSizeChangedToken

bool

windowVisible

OcrWord

word

std::vector< WordOverlay^>

wordBoxes

double

wordHeight

Thickness

wordPosition

double

wordWidth

unsigned int

writeCounter = 0

Windows::UI::Input::GestureRecognizer

xamlGestureRecognizer

Static Private Attributes

static ServiceViewModel

_Current

static
Windows::UI::Xaml::DependencyProperty

_DPOnPage

static FileLoggingSessionScenario

_instance

static LoggingSessionScenario

_instance

static std::map
< Platform::String^,
Platform::String^>

Bcp47ToRecognizerNameDictionary

static Platform::String

ButtonNameDisableReconnectToDevice

static Platform::String

ButtonNameDisconnectFromDevice

static constexpr unsigned

BytesPerMegaByte = 1000000

static int const

bytesPerRow = 16

static int const

bytesPerSegment = 2

static const LONGLONG

CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS = 300000000

static int const

chunkSize = 4096

static const float

circleStrokeThickness

static Platform::String

ColorSpaceProperty

static Platform::String

CopyrightProperty

static const int

DPI96 = 96

static const int

ElementNotFound = (int)0x80070490

static EventHandlerForDevice

eventHandlerForDevice

static const int

FPS = 60

static const unsigned int

HResultPrivacyStatementDeclined = 0x80045509

static const unsigned int

HResultRecognizerNotFound = 0x8004503a

static const UINT32

maxUploadFileSize = 100 * 1024 * 1024

static const int

minPenSize = 2

static const int

NoCaptureDevicesHResult = -1072845856

static const int

NumberOfPhotos = 6

static bool

optedIn

static const float

penSize

static const int

penSizeIncrement = 2

static const int

pinPolicyAllowedIndex = 1

static const int

pinPolicyDisallowedIndex = 0

static const int

pinPolicyRequireOneIndex = 2

static const float

radius

static UINT32

runId

static SRWLOCK

srwSingletonCreationLock

static int

stepCountGoalOffset

static const ULONGLONG

SUPPRESS_DURATION_APPROXIMATE_TICKS = 6000000000

static const ULONGLONG

SUPPRESS_DURATION_UNRELIABLE_TICKS = 3000000000

static const UINT64

tenMinutesIn100NanoSecondUnits = 6000000000

Detailed Description

This ListView is tailored to a Chat experience where the focus is on the last item in the list and as the user scrolls up the older messages are incrementally loaded.

The sixth scenario.

The fifth scenario.

The fourth scenario.

The third scenario.

The second scenario.

The first scenario.

Scenario that demos how to disable the print preview in the Modern Print Dialog window.

This class customizes the standard PrintHelper in order to disable print preview.

Photo printing scenario.

Scenario that demonstrates a page range implementation.

Scenario that demos how to add custom options (specific for the application).

Scenario that demos how to add customizations in the displayed options list.

Scenario that demonstrates how to invoke the Print UI.

Used in scenario 5 to display a custom print preview unavailable page.

Page content to send to the printer.

A paged used to flow text from a given text container Usage: Output scenarios 1-4 might not fit entirely on a given "printer page" In that case simply add new continuation pages of the given size until all the content can be displayed.

'Current step count' illustration page

History Page that gets loaded when 'History' scenario is selected.

Represents a history record object that gets binded to the ListView controller in the XAML.

'Events' scenario page that gets navigated to when the user selected the 'Events' scenario.

Wraps recognized word and provides word overlay position and size based on current scale.

Demonstrate how to use read AAMVA cards with MagneticStripeReader.

Demonstrate how to use read bank cards with MagneticStripeReader.

TODO.

The main content page for the App that is reached after successful logon.

Comparing two files to see if they are the same file.

Copying a file.

Persisting access to a storage item for future use.

Displaying file properties.

Writing and reading using a stream.

Writing and reading bytes in a file.

Writing and reading text in a file.

Getting a file's parent folder.

Creating a file.

Attempting to get a file with no error on failure.

Deleting a file.

Page containing the Extended Execution LocationTracking Reason scenario functions.

Page containing the Extended Execution SavingData Reason scenario functions.

Page containing the Extended Execution Unspecified Reason scenario functions.

Updates an IObservableVector based on events from a DeviceWatcher.

A page that hosts the Direct2D app in a SwapChainPanel, and app UI in XAML.

This scenario demonstrates how to get input reports and how to send output reports.

This page demonstrates how to use FeatureReports to communicate with the device.

Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events.

The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event is raised (app suspension and resume) or when the device is disconnected.

The class will only expose properties from DeviceInformation that are going to be used in this sample.

View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl.

View model for MediaFrameFormat used in XAML ContentControl.

View model for MediaFrameSourceInfo used in XAML ContentControl.

View model for MediaFrameSourceGroup used in XAML ContentControl.

The class is used for data-binding.

Provides application-specific behavior to supplement the default Application class.

Display animation metrics.

Each instance of this class provides information about a single device.

This class is used by the UI to display device specific information so that the user can identify which device to use.

In addition to handling the HidDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).

This class will also demonstrate how to handle device watcher events.

For simplicity, this class will only allow at most one device to be connected at any given time. In order to make this class support multiple devices, make this class a non-singleton and create multiple instances of this class; each instance should watch one connected device.

To use this sample with your device: 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation. 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.

Encapsulates the work necessary to register for watcher events, start and stop the watcher, handle race conditions, and break cycles.

Has the sign-out (Back to user list) and forget me (Remove Account) buttons.

Choosing the remove account option calls into the proper APIs to remove the Passport account key if that exists on the machine and unregister it with the server side.

The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order to disable print preview. Since print preview is disabled, the Paginate event will not be raised. Instead, the pages to be printed are generated in response to the AddPages event.

Covers getting the default sign in account.

Covers getting an MSA account and getting a token using that account.

Covers getting an AAD account and getting a token using that account.

Covers keeping and managing a single active account and having multiple account provider types.

Covers keeping and managing multiple active accounts and multiple account provider types.

This scenario illustrates adding a custom provider to use with Token Broker APIs.

We're performing our own logic to trigger loading more data.

Note: This is just delay loading the data, but isn't true data virtualization. A user that scrolls all the way to the beginning of the list will cause all the data to be loaded.

Definition at line 29 of file Scenario0_Choose.xaml.h.

Member Typedef Documentation

typedef Windows::Foundation::TypedEventHandler<Windows::UI::Xaml::Controls::ListViewBase^, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^> CCCEventHandler [private]

Definition at line 69 of file Scenario2_Load.xaml.h.

typedef Platform::String(* MapIconStateToStyleEntryState)(MapIconState state) [private]

Definition at line 40 of file Scenario11.xaml.h.

Member Enumeration Documentation

enum AccountAction [private]

Enumerator:

AddAccount

ManageAccount

Definition at line 60 of file Scenario5_ManyProvidersManyAccounts.xaml.h.
{ AddAccount, ManageAccount };
enum CashDrawerInstance [private]

Enumerator:

Instance1

Instance2

Definition at line 41 of file Scenario3_MultipleDrawers.xaml.h.
        {
            Instance1,
            Instance2
        };
enum InkingAreaSubStates [private]

Enumerator:

AreaNone

Selecting

SelectingOrPasting

Erasing

Definition at line 37 of file Scenario1_CustomDry.xaml.h.
        {
            AreaNone,
            Selecting,
            SelectingOrPasting,
            Erasing
        };
enum InputModes [private]

Enumerator:

InkingMode

SelectingMode

ErasingMode

InkToolbarMode

Definition at line 45 of file Scenario1_CustomDry.xaml.h.
        {
            InkingMode,
            SelectingMode,
            ErasingMode,
            InkToolbarMode
        };
enum LatencyModes [private]

Enumerator:

uninitialized

highLatency

lowLatency

Definition at line 75 of file Scenario1_LowLatency.xaml.h.
        {
            uninitialized,
            highLatency,
            lowLatency,
        };
enum MapIconState [private]

Enumerator:

None

Disabled

Hover

Selected

Definition at line 32 of file Scenario11.xaml.h.
                          : int
        {
            None = 0,
            Disabled = 1,
            Hover = 2,
            Selected = 4,
        };
enum PointerHitTestStates [private]

Enumerator:

None

InsideSelectionRect

InsideInkingArea

Definition at line 30 of file Scenario1_CustomDry.xaml.h.
        {
            None,
            InsideSelectionRect,
            InsideInkingArea,
        };
enum Role [private]

Enumerator:

uninitialized

active

passive

Definition at line 60 of file Scenario2_VideoChat.xaml.h.
        {
            uninitialized,
            active,
            passive,
        };
enum ScenarioOneStates [private]

Enumerator:

uninitialized

initializing

waiting

previewing

streaming

end

Definition at line 51 of file Scenario1_LowLatency.xaml.h.
        {
            uninitialized,
            initializing,
            waiting,
            previewing,
            streaming,
            end,
        };
enum ScenarioType [private]

Enumerator:

Toast

Tile

Definition at line 45 of file Scenario3_Notifications.xaml.h.
        {
            Toast,
            Tile
        };
Constructor & Destructor Documentation

virtual ~Scenario1_DeviceUse

(

)

[virtual]

~Scenario1_Download

(

)

[private]

~Scenario2_Upload

(

)

[private]

~Scenario3_Notifications

(

)

[private]

virtual ~SourceGroupCollection

(

)

[virtual]

virtual ~Scenario1_PreviewSettings

(

)

[virtual]

virtual ~Scenario2_PhotoSettings

(

)

[virtual]

virtual ~Scenario3_AspectRatio

(

)

[virtual]

~EventHandlerForDevice

(

)

[private]

virtual ~DirectXPage

(

)

[virtual]

virtual ~DocumentPresenter

(

)

[virtual]

~FileLoggingSessionScenario

(

)

[private]

~LoggingSessionScenario

(

)

[private]

virtual ~Scenario1_LowLatencyInput

(

)

[virtual]

virtual ~Scenario1_OmnidirectionalSound

(

)

[virtual]

virtual ~Scenario2_CardioidSound

(

)

[virtual]

virtual ~Scenario3_CustomDecay

(

)

[virtual]

virtual ~Conversation

(

)

[inline, virtual]

Definition at line 43 of file Scenario2_Load.xaml.cpp.
        {
            _storage->VectorChanged -= _token;
        }
Member Function Documentation

void AccessChanged

(

Windows::Devices::Enumeration::DeviceAccessInformation^

sender,

Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^

args

)

[private]

void Accessibility_HighContrastChanged

(

Windows::UI::ViewManagement::AccessibilitySettings^

sender,

Platform::Object^

args

)

[private]

delegate IAsyncAction ActionTransition

(

)

[private]

This is the FSM encapsulating the state table (states and actions) of the scenario.

void AddAccount_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddAnimatedTilesClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddAudio_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddAudio_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddAudio_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddCustomIconItems

(

)

[private]

void AddCustomProvider

(

Platform::String^

providerId,

Platform::String^

authority

)

[private]

concurrency::task<void> AddDeviceAsync

(

Platform::String^

id

)

[private]

Adds a SourceGroup with given Id to the collection.

void AddDeviceToList

(

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation,

Platform::String^

deviceSelector

)

[private]

void AddDeviceWatcher

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Platform::String^

deviceSelector

)

[private]

void AddFolderButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddFontGlyphItems

(

)

[private]

AddImageFeedScenario

(

)

void AddItem

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

void AddItemForLanguageTag

(

Platform::String^

languageTag

)

[private]

void AddItemToEnd

(

)

[protected]

void AddKnownIconItems

(

)

[private]

void AddLayer1

(

)

[private]

void AddLayer1

(

)

[private]

void AddLayer2

(

)

[private]

void AddLayer2

(

)

[private]

void AddLinks

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddLinks

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddLinksAndDescription

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddLinksAndDescription

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddLinksAndDescription

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

concurrency::task<void> AddLogFileMessageDispatch

(

Platform::String^

message,

const std::wstring &

logFileFullPath

)

[private]

concurrency::task<void> AddLogFileMessageDispatch

(

Platform::String^

message,

const std::wstring &

logFileFullPath

)

[private]

void AddMessage

(

Platform::String^

message

)

[private]

void AddMessage

(

Platform::String^

message

)

[private]

concurrency::task<void> AddMessageDispatch

(

Platform::String^

message

)

[private]

concurrency::task<void> AddMessageDispatch

(

Platform::String^

message

)

[private]

virtual Windows::UI::Xaml::Controls::RichTextBlockOverflow AddOnePrintPreviewPage

(

Windows::UI::Xaml::Controls::RichTextBlockOverflow^

lastRTBOAdded,

Windows::Graphics::Printing::PrintPageDescription

printPageDescription

)

[override, protected, virtual]

This function creates and adds one print preview page to the internal cache of print preview pages stored in m_printPreviewPages.

Parameters:

lastRTBOAdded

Last RichTextBlockOverflow element added in the current content

printPageDescription

Printer's page description

void AddOptimizationGoal

(

Windows::Devices::Sensors::SensorOptimizationGoal

optimizationGoal

)

[private]

concurrency::task<bool> AddPassportToAccountOnServerAsync

(

)

[private]

virtual void AddPrintPages

(

Platform::Object^

sender,

Windows::UI::Xaml::Printing::AddPagesEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:

sender

e

Add page event arguments containing a print task options reference

virtual void AddPrintPages

(

Object^

sender,

AddPagesEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:

sender

The print document.

e

Add page event arguments containing a print task options reference

Reimplemented from PrintHelper.

virtual void AddPrintPages

(

Object^

sender,

AddPagesEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintDocument.AddPages.

It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

Parameters:

sender

e

Add page event arguments containing a print task options reference

Reimplemented from PrintHelper.

void AddReadingType

(

Windows::Devices::Sensors::AccelerometerReadingType

readingType

)

[private]

void AddReadingType

(

Windows::Devices::Sensors::SensorReadingType

readingType

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToIndex_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToJumpList_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AddToListButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void addToResultGrid

(

Windows::Services::Maps::OfflineMaps::OfflineMapPackage^

package

)

[private]

void AddWebAccount

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccount

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccount

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccount

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccountProvider

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccountProvider

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccountProviders

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccountProviders

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccountProviders

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void AddWebAccounts

(

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void addXamlChildrenButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AllHistory_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AnalyzeButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void AngularVelocitySlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void Animations_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

App

(

)

void App_BackRequested

(

Platform::Object^

sender,

Windows::UI::Core::BackRequestedEventArgs^

e

)

[private]

void AppendOutputLine

(

Platform::String^

value

)

[private]

void AppendOutputLine

(

Platform::String^

value

)

[private]

void AppendOutputLine

(

Platform::String^

value

)

[private]

void AppendOutputLine

(

Platform::String^

value

)

[private]

void AppendVideos_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Application_Resuming

(

Platform::Object^

sender,

Platform::Object^

o

)

[private]

void Application_Suspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

ApplicationTriggerTask

(

)

ApplicationTriggerTask

(

)

void ApplyRotationLock_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String ArchitectureString

(

Windows::System::ProcessorArchitecture

architecture

)

[private]

static bool ArePointsNear

(

Windows::Foundation::Point

point1,

Windows::Foundation::Point

point2,

double

threshold

)

[static, private]

Windows::Foundation::Size ArrangeOverride

(

Windows::Foundation::Size

finalSize

)

[override, protected]

double AspectRatio

(

)

void AttachDownloads

(

)

[private]

void AttachmentImage_RightTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^

e

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

void AttachProgressAndCompletedHandlers

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

task

)

[private]

concurrency::task<bool> AuthenticatePassportAsync

(

)

[private]

concurrency::task<bool> AuthenticatePasswordCredentialsAsync

(

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

Provider,

Platform::String^

Scope,

Platform::String^

ClientID

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID

)

[private]

void AuthenticateWithRequestToken

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID

)

[private]

void AuthenticateWithRequestTokenSilent

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID,

Windows::Security::Credentials::WebAccount^

account

)

[private]

void AuthenticateWithRequestTokenSilent

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID,

Windows::Security::Credentials::WebAccount^

account

)

[private]

void AuthenticateWithRequestTokenSilent

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID,

Windows::Security::Credentials::WebAccount^

account

)

[private]

void AuthenticateWithRequestTokenSilent

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID,

Windows::Security::Credentials::WebAccount^

account

)

[private]

void AuthenticateWithRequestTokenSilent

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Platform::String^

scope,

Platform::String^

clientID,

Windows::Security::Credentials::WebAccount^

account

)

[private]

BasicTests

(

)

void BeginExtendedExecution

(

)

[protected]

void BeginExtendedExecution

(

)

[protected]

void BeginExtendedExecution

(

)

[protected]

BindableNode

(

Platform::String^

nodeName,

Platform::String^

nodeNamespace,

Platform::String^

nodeValue

)

[inline]

Definition at line 95 of file SampleConfiguration.h.
        {
            this->NodeName = nodeName;
            this->NodeNamespace = nodeNamespace;
            this->NodeValue = nodeValue;
        }
void BlockUIThread_Toggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void BrightnessBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Windows::UI::Xaml::Media::SolidColorBrush Brushify

(

Windows::UI::Color

c

)

[inline]

Definition at line 25 of file Functions.xaml.h.
        {
            return ref new SolidColorBrush(c);
        }
void btnAddIe_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnClearText_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnClose_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnClose_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnFromId_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnIe_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnSendMessage_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnSendMessage_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnStartAdvertisement_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnStopAdvertisement_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void btnWatcher_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

std::vector<Cluster> BuildClustersForZoomLevel

(

int

zoomLevel

)

[private]

void Button_AddNewAccount_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_AddProvider_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_AddUser_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click_1

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click_2

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Click_3

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void button_Click_StartMetering

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void button_Click_StopMetering

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_DefaultSignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Forget_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_GetTokenSilently_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_GetTokenSilently_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_GetTokenSilently_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_GetTokenSilently_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_GetTokenSilently_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_ManageAccount_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_ManageAccounts_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_ManageAccounts_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_ManageAccounts_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_ManageSignedInAccounts_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Passport_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_Restart_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_SelectUser_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void Button_SignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_SignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_SignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_SignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Button_SignIn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PlaceLocation CalculateCenter

(

const std::vector< PlaceInfo > &

places

)

[private]

task<void> CalculatePreviewRotation

(

)

[private]

static IBuffer CalculateResponse

(

IBuffer^

challenge,

IBuffer^

adminkey

)

[static]

CalibrationBar

(

)

CalibrationBar

(

)

CalibrationBar

(

)

void CallButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CameraButton_Tapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

void CancelActiveDownloads

(

)

[private]

Concurrency::task<void> CancelActiveDownloadsAsync

(

)

[private]

Concurrency::task<void> CancelActiveDownloadsAsync

(

)

[private]

Concurrency::task<std::vector<Windows::Networking::BackgroundTransfer::DownloadOperation^> > CancelActiveDownloadsAsync

(

)

[private]

void CancelAll_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CancelAll_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

CancelCommand

(

)

void CancelCommandButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static bool canDownload

(

Windows::Services::Maps::OfflineMaps::OfflineMapPackage^

package

)

[static, private]

bool CanShowCalibrationBar

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

[private]

bool CanShowCalibrationBar

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

[private]

bool CanShowCalibrationBar

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

[private]

CaptureDevice

(

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void cbLanguageSelection_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ChangeAdminKey_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChangeFolderClick

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<void> ChangeMediaFormatAsync

(

FrameFormatModel^

format

)

[private]

Changes the format of the currently selected source.

void ChangePin_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

ChatListView

(

)

void CheckAvailability_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CheckBox_Toggle

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs

e

)

[private]

void CheckConcurrentProfileBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void CheckHdrSupportBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void CheckIfStreamsAreIdentical

(

)

[private]

void CheckIfStreamsAreIdentical

(

)

[private]

void CheckIndexRevision_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseBaseVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseBaseVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseFile_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseFileButton_Click

(

)

[protected]

void ChooseFirstVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseOverlayVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseOverlayVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseSecondVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ChooseVideo_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ClaimAndEnable_Click

(

)

[protected]

void ClaimButton1_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ClaimButton2_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<bool> ClaimCashDrawer

(

)

[private]

concurrency::task<bool> ClaimCashDrawer

(

)

[private]

concurrency::task<bool> ClaimCashDrawer

(

CashDrawerInstance

instance

)

[private]

void claimedCashDrawerInstance1_ReleaseDeviceRequested

(

Windows::Devices::PointOfService::ClaimedCashDrawer^

sender,

Platform::Object^

e

)

[private]

void claimedCashDrawerInstance2_ReleaseDeviceRequested

(

Windows::Devices::PointOfService::ClaimedCashDrawer^

sender,

Platform::Object^

e

)

[private]

void ClaimedPrinter_ReleaseDeviceRequested

(

ClaimedPosPrinter^

claimedInstance,

PosPrinterReleaseDeviceRequestedEventArgs^

args

)

[private]

task<void> ClaimPrinter

(

)

[private]

Concurrency::task<void> ClaimReader

(

)

[private]

Concurrency::task<void> ClaimReader

(

)

[private]

void ClaimSamePrinter_Click

(

)

[protected]

task<void> Cleanup

(

)

[private]

task<void> CleanUp

(

)

[private]

void CleanupAccountsControlDialog

(

)

[private]

void CleanupAccountsControlDialog

(

)

[private]

void CleanupAccountsControlDialog

(

)

[private]

void CleanupAccountsControlDialog

(

)

[private]

void CleanupAccountsControlDialog

(

)

[private]

task<void> CleanupAsync

(

)

[private]

Asynchronous method cleaning up resources and stopping recording if necessary.

task<void> CleanupCameraAsync

(

)

[private]

Concurrency::task<void> CleanupCameraAsync

(

)

[private]

Concurrency::task<void> CleanupCameraAsync

(

)

[private]

Concurrency::task<void> CleanupCameraAsync

(

)

[private]

concurrency::task<void> CleanupMediaCaptureAsync

(

)

[private]

Stop streaming from all readers and dispose all readers and media capture object.

concurrency::task<void> CleanupMediaCaptureAsync

(

)

[private]

Unregisters FrameArrived event handlers, stops and disposes frame readers and disposes the MediaCapture object.

void CleanupSink

(

)

[private]

Cleaning up the sink.

void Clear

(

)

Clears all rendered shapes on this canvas.

void ClearCanvasStrokeCache

(

)

[private]

void ClearColorsClick

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ClearDeviceEntries

(

void

)

[private]

void ClearDrawnBoundingRect

(

)

[private]

void ClearExtendedExecution

(

)

[private]

void ClearExtendedExecution

(

)

[private]

void ClearExtendedExecution

(

)

[private]

void ClearMapClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ClearOutputs

(

)

[private]

void ClearOutputs

(

)

[private]

void ClearPageCollection

(

)

[protected]

Helper function that clears the page collection and also the pages attached to the "visual root".

void ClearResults

(

)

[private]

void ClearSelection

(

)

[private]

void ClearSwitchStateTable

(

)

[private]

void Click_BaseArgs

(

Platform::Object^

sender,

Platform::Object^

e

)

void Click_NoArgs

(

)

void Click_RegularArgs

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ClickToPlaySource_ImageOpened

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void Close

(

)

void CloseCurrentlyConnectedDevice

(

void

)

[private]

void CloseDevice

(

void

)

void CloseFx2Device

(

void

)

[private]

concurrency::task<Windows::Storage::StorageFile^> CloseSessionSaveFinalLogFile

(

)

[private]

void CloseSocket

(

)

[private]

void CloseSocket

(

)

[private]

void CloseSocket

(

)

[private]

void CloseSocket

(

)

[private]

static Windows::UI::Xaml::Visibility CollapsedIf

(

bool

value

)

[inline, static]

Definition at line 66 of file SampleConfiguration.h.
        {
            return value ? Windows::UI::Xaml::Visibility::Collapsed : Windows::UI::Xaml::Visibility::Visible;
        }
Platform::String CollectExpensiveData

(

)

[private]

Concurrency::task<void> ColorizeCustomButtonAsync

(

Windows::UI::Color

newColor

)

[private]

void ColorLampBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

String ColorValue

(

double

red,

double

green,

double

blue

)

void ComboBoxSettings_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CommandBar_Closed

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandBar_Closed

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandBar_Closing

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandBar_Opened

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandBar_Opening

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandBar_Opening

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void CommandInvokedHandler

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void CompareFilesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CompleteConfirmPinTask

(

bool

accept

)

[private]

CompletedCallback

(

)

void CompletedCallbackButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CompletePasswordCredential

(

Platform::String^

username = nullptr,

Platform::String^

password = nullptr

)

[private]

void CompleteProvidePinTask

(

Platform::String^

pin = nullptr

)

[private]

Concurrency::task<void> ConnectAsync

(

)

[private]

Concurrency::task<void> ConnectAsync

(

)

[private]

ConnectedDevice

(

Platform::String^

displayName,

Windows::Devices::WiFiDirect::WiFiDirectDevice^

wfdDevice,

SocketReaderWriter^

socketRW

)

void ConnectToDevice_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

Concurrency::task<void> ConnectWebSocketAsync

(

)

[private]

Content

(

)

void ContextChanged

(

Windows::Foundation::Collections::IObservableMap< Platform::String^, Platform::String^>^

sender,

Windows::Foundation::Collections::IMapChangedEventArgs< Platform::String^>^

eventArg

)

[private]

ContinuationPage

(

Windows::UI::Xaml::Controls::RichTextBlockOverflow^

textLinkContainer

)

Creates a continuation page and links text-flow to a text flow container.

Parameters:

textLinkContainer

Text link container which will flow text into this page

void ContinuousRecognitionSession_Completed

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_Completed

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_Completed

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_Completed

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_ResultGenerated

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_ResultGenerated

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_ResultGenerated

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^

args

)

[private]

void ContinuousRecognitionSession_ResultGenerated

(

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession^

sender,

Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs^

args

)

[private]

void ContinuousRecognize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ContinuousRecognize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ContinuousRecognize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ContrastingColorButtonCheckedChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Conversation

(

)

[inline]

Definition at line 38 of file Scenario2_Load.xaml.cpp.
        {
            _token = _storage->VectorChanged += ref new VectorChangedEventHandler<TextMessage^>(this, &Conversation::Storage_VectorChanged);
        }
virtual Platform::Object Convert

(

Platform::Object^

value,

Windows::UI::Xaml::Interop::TypeName

targetType,

Platform::Object^

parameter,

Platform::String^

language

)

[virtual]

virtual Platform::Object Convert

(

Platform::Object^

value,

Windows::UI::Xaml::Interop::TypeName

targetType,

Platform::Object^

parameter,

Platform::String^

language

)

[inline, virtual]

Definition at line 42 of file ShareApplicationLink.xaml.h.
        {
            bool v = safe_cast<bool>(value);
            return !v;
        }
virtual Platform::Object ConvertBack

(

Platform::Object^

value,

Windows::UI::Xaml::Interop::TypeName

targetType,

Platform::Object^

parameter,

Platform::String^

language

)

[inline, virtual]

Definition at line 305 of file DisplayHelpers.h.
        {
            throw ref new Platform::NotImplementedException();
        }
virtual Platform::Object ConvertBack

(

Platform::Object^

value,

Windows::UI::Xaml::Interop::TypeName

targetType,

Platform::Object^

parameter,

Platform::String^

language

)

[inline, virtual]

Definition at line 48 of file ShareApplicationLink.xaml.h.
        {
            bool v = safe_cast<bool>(value);
            return !v;
        }
static Windows::Graphics::Imaging::SoftwareBitmap ConvertToDisplayableImage

(

Windows::Media::Capture::Frames::VideoMediaFrame^

inputFrame

)

[static, private]

Converts the input frame to BGRA8 premultiplied alpha format and returns the result.

Returns nullptr if the input frame cannot be converted BGRA8 premultiplied alpha.

void CopyFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CopyFlyoutItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CoreWetStrokeUpdateSource_WetStrokeCanceled

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^

sender,

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void CoreWetStrokeUpdateSource_WetStrokeCompleted

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^

sender,

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void CoreWetStrokeUpdateSource_WetStrokeContinuing

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^

sender,

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void CoreWetStrokeUpdateSource_WetStrokeStarting

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^

sender,

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void CoreWetStrokeUpdateSource_WetStrokeStopping

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^

sender,

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

String CountEmployees

(

xBindSampleModel::IEmployee^

e

)

String countVowels

(

String^

words

)

void Create_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<bool> CreateDefaultCashDrawerObject

(

)

[private]

concurrency::task<bool> CreateDefaultCashDrawerObject

(

)

[private]

concurrency::task<bool> CreateDefaultCashDrawerObject

(

CashDrawerInstance

instance

)

[private]

Concurrency::task<void> CreateDefaultReaderObject

(

)

[private]

Concurrency::task<void> CreateDefaultReaderObject

(

)

[private]

Concurrency::task<Windows::Networking::BackgroundTransfer::DownloadOperation^> CreateDownloadAsync

(

Windows::Networking::BackgroundTransfer::BackgroundDownloader^

downloader,

Platform::String^

remoteAddress,

Platform::String^

fileName

)

[private]

void CreateFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CreateFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CreateGeneratorButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CreateGeneratorButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void CreateGeneratorButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Windows::UI::Xaml::Controls::TextBlock CreateHeaderTextBlock

(

Platform::String^

contents

)

[private]

Windows::UI::Xaml::Controls::TextBlock CreateHeaderTextBlock

(

Platform::String^

contents

)

[protected]

Windows::UI::Input::Inking::InkDrawingAttributes CreateInkDrawingAttributesCore

(

Windows::UI::Xaml::Media::Brush^

brush,

double

strokeWidth

)

[override, protected]

void CreateLayers

(

)

[private]

Windows::UI::Xaml::Controls::TextBlock CreateLineItemTextBlock

(

Platform::String^

contents

)

[private]

Windows::UI::Xaml::Controls::TextBlock CreateLineItemTextBlock

(

)

[protected]

Windows::UI::Xaml::Controls::TextBlock CreateLineItemTextBlock

(

Platform::String^

contents

)

[protected]

void CreateLocalDataContainers

(

)

[private]

void CreateMenuItems

(

)

[private]

void CreateOrUpdatePropertyPopUp

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void CreateOverlays

(

)

[private]

void CreateOverlays

(

)

[private]

Concurrency::task<Platform::Collections::Vector<Windows::Networking::BackgroundTransfer::BackgroundTransferContentPart^>^> CreatePartsAsync

(

Windows::Foundation::Collections::IVectorView< Windows::Storage::StorageFile^>^

files

)

[private]

concurrency::task<bool> CreatePassportKeyAsync

(

Platform::String^

accountId

)

[private]

static Windows::ApplicationModel::Contacts::Contact CreatePlaceholderContact

(

)

[static, private]

virtual void CreatePrintPreviewPages

(

Object^

sender,

Windows::UI::Xaml::Printing::PaginateEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintDocument.Paginate.

It creates print preview pages for the app.

Parameters:

sender

e

Paginate Event Arguments

virtual void CreatePrintPreviewPages

(

Object^

sender,

PaginateEventArgs^

e

)

[override, protected, virtual]

This is the event handler for Pagination.

Parameters:

sender

The document for which pagination occurs.

e

The pagination event arguments containing the print options.

Reimplemented from PrintHelper.

concurrency::task<void> CreateReaderAsync

(

)

[private]

Creates a reader from the current frame source and registers to handle its frame events.

Must be called from the UI thread.

concurrency::task<void> CreateReaderAsync

(

Windows::Media::Capture::Frames::MediaFrameSourceInfo^

sourceInfo

)

[private]

Creates a reader for the frame source described by the MediaFrameSourceInfo.

On frame arrived will render the output to the supplied software bitmap source.

Windows::Storage::Streams::IBuffer CreateSolidGlyphBuffer

(

int

widthInPixels,

int

heightInPixels

)

[private]

Platform::Array<bool> CreateSwitchStateArray

(

byte

output[]

)

[inline, private]

Definition at line 52 of file Scenario4_DeviceEvents.xaml.h.
        {
            auto switchStateArray = ref new Platform::Array<bool>(8);

            for (auto i = 0; i < 8; i += 1)
            {
                switchStateArray[i] = (output[0] & (1 << i)) != 0;
            }

            return switchStateArray;
        }
Binding CreateWordHeightBinding

(

)

Binding CreateWordPositionBinding

(

)

Left and Right properties of Thickess define word box position.

Binding CreateWordWidthBinding

(

)

void CurrentToolChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

CustomCommand

(

)

void CustomCommandButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

CustomOptionsPrintHelper

(

Page^

scenarioPage

)

CustomTitleBar

(

)

void CustomTitleBar_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

void CustomTitleBar_Unloaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

CustomTrigger

(

)

void CutFlyoutItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DataSource_VectorChanged

(

Windows::Foundation::Collections::IObservableVector< xBindSampleModel::FileItem^>^

sender,

Windows::Foundation::Collections::IVectorChangedEventArgs^

e

)

[private]

task<void> Deactivate

(

)

[private]

DefaultCloseCommand

(

)

void DefaultCloseCommandButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DefineGlyphButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Delete_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteAllItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteAllItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteItemsHelper

(

std::function< Windows::Foundation::IAsyncAction^(Windows::Storage::Search::ContentIndexer^)>

deleteFunction

)

[private]

void DeleteKeywords_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteMultipleItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

bool DeletePassportServerSide

(

)

[private]

void DeleteSelectedItem

(

)

[protected]

void DeleteSingleItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeleteSingleItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DemonstrateLogging

(

Windows::Foundation::Diagnostics::LoggingChannel^

channel

)

[private]

void DescriptionLocalizedResource_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DestroyWindowButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

DeviceConnect

(

)

DeviceConnect

(

void

)

void deviceConnectDevices_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void deviceConnectStart_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void deviceConnectStop_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

DeviceEvents

(

)

void deviceEventsBegin_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void deviceEventsCancel_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void deviceEventsGet_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

DeviceInformationDisplay

(

Windows::Devices::Enumeration::DeviceInformation^

deviceInfoIn

)

DeviceInformationKindChoice

(

Platform::String^

displayName,

Windows::Foundation::Collections::IVectorView< Windows::Devices::Enumeration::DeviceInformationKind >^

deviceInformationKinds

)

[inline]

Definition at line 168 of file DisplayHelpers.h.
        {
            DisplayName = displayName;
            DeviceInformationKinds = deviceInformationKinds;
        }
DeviceIO

(

)

void DeviceIOGet_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DeviceIOSet_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

DeviceListEntry

(

Windows::Devices::Enumeration::DeviceInformation^

DeviceInterface

)

[inline]

Definition at line 29 of file DeviceList.h.
        {
            m_Device = DeviceInterface;
            Matched = true;
        }
DeviceReadWrite

(

)

DeviceSelectorInfo

(

Platform::String^

displayName,

Windows::Devices::Enumeration::DeviceClass

deviceClassSelector,

Platform::String^

selector

)

[inline]

Definition at line 11 of file DisplayHelpers.h.
        {
            Initialize(
                displayName,
                deviceClassSelector,
                selector,
                Windows::Devices::Enumeration::DeviceInformationKind::Unknown);
        }
DeviceSelectorInfo

(

Platform::String^

displayName,

Windows::Devices::Enumeration::DeviceClass

deviceClassSelector,

Platform::String^

selector,

Windows::Devices::Enumeration::DeviceInformationKind

kind

)

[inline]

Definition at line 23 of file DisplayHelpers.h.
        {
            Initialize(
                displayName,
                deviceClassSelector,
                selector,
                kind);
        }
DeviceWatcherHelper

(

Windows::Foundation::Collections::IObservableVector< DeviceInformationDisplay^>^

resultCollection,

Windows::UI::Core::CoreDispatcher^

dispatcher

)

[inline]

Definition at line 18 of file DeviceWatcherHelper.h.
                                                     :
            resultCollection(resultCollection),
            dispatcher(dispatcher)
        {
            UpdateStatus = true;
        }
void dictationTextBox_TextChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::TextChangedEventArgs^

e

)

[private]

DirectXPage

(

)

void DisableButtons

(

)

[private]

void DisableButtons

(

)

[private]

void DisableButtons

(

)

[private]

void DisableNonSquarePARProfiles

(

)

[private]

void DisableNonSquarePARProfiles

(

)

[private]

void DisconnectFromDevice_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

void DiscoverActiveDownloads

(

)

[private]

void DiscoverActiveUploads

(

)

[private]

DiscoveredDevice

(

Windows::Devices::Enumeration::DeviceInformation^

deviceInfoIn

)

void DismissPopup_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DismissPopup_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DismissPopup_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DispatcherTimer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

String Display

(

String^

stringArg,

int

intArg,

double

floatArg,

bool

boolArg

)

void Display

(

)

void Display

(

)

void Display

(

)

void Display

(

)

void Display

(

)

void Display

(

)

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Display_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayCurrentReading

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void DisplayInformation_DpiChanged

(

Windows::Graphics::Display::DisplayInformation^

displayInformation,

Platform::Object^

e

)

[private]

void DisplayInformation_OrientationChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void DisplayLink

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void DisplayMetrics

(

Windows::UI::Core::AnimationMetrics::AnimationEffect

effect,

Windows::UI::Core::AnimationMetrics::AnimationEffectTarget

target

)

[private]

void DisplayMultipleCandidates

(

Windows::Foundation::Collections::IVectorView< Platform::String^>^

candidates

)

[private]

void DisplayMultipleCandidates

(

Windows::Foundation::Collections::IVectorView< Platform::String^>^

candidates

)

[private]

void DisplayNameLocalizedResource_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DisplayOrientation

(

Windows::Devices::Sensors::SimpleOrientation

orientation

)

[private]

void DisplayOrientation

(

Windows::Devices::Sensors::SimpleOrientation

orientation

)

[private]

void DisplayProperties_DpiChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void DisplayProperties_DpiChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

Platform::String DisplayRoundingAlgorithmAsString

(

Windows::Globalization::NumberFormatting::RoundingAlgorithm

roundingAlgorithm

)

[private]

void DisplayTextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DisplayTextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DisplayTextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> DisplayUserInformationAsync

(

Platform::String^

userID

)

[private]

void DisposeLamp

(

)

[private]

void DisposeMediaCapture

(

)

[private]

Closes the MediaCapture object and clears the items from the Format and Source ComboBoxes.

Must be called from the UI thread.

double DistanceFromCenter

(

Windows::Foundation::Point

position

)

[private]

void DoCleanup

(

)

[private]

Cleans up the resources.

DocumentPresenter

(

Platform::String^

text,

Platform::String^

downloadableFontName,

Platform::String^

languageTag,

Windows::UI::Color

textColor,

Windows::UI::Color

textBackgroundColor,

Windows::UI::Xaml::Controls::Image^

imageTarget

)

Platform::String DoCurrencyRoundingScenarios

(

Platform::String^

currencyCode,

Windows::Globalization::NumberFormatting::RoundingAlgorithm

roundingAlgorithm

)

[private]

Platform::String DoIncrementRoundingScenarios

(

Windows::Globalization::NumberFormatting::RoundingAlgorithm

roundingAlgorithm

)

[private]

Platform::String DoPaddingAndRoundingScenarios

(

Windows::Globalization::NumberFormatting::RoundingAlgorithm

roundingAlgorithm,

unsigned int

significantDigits,

int

integerDigits,

int

fractionalDigits

)

[private]

Platform::String DoPaddingScenarios

(

Windows::Globalization::NumberFormatting::INumberFormatter^

formatter

)

[private]

void DoScenario

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DoScenario

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<void> DoScenarioAsync

(

)

concurrency::task<void> DoScenarioAsync

(

)

Platform::String DoSignificantDigitRoundingScenarios

(

Windows::Globalization::NumberFormatting::RoundingAlgorithm

roundingAlgorithm

)

[private]

void DoSomething

(

Windows::Foundation::Diagnostics::ILoggingTarget^

logger

)

[private]

void DoubleSpace_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void DoubleSpaceHalfLeading_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void DoWin10Mode

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void DoWin81Mode

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> DownloadAsync

(

DownloadOperationItem^

item

)

[private]

Concurrency::task<Windows::ApplicationModel::Contacts::Contact^> DownloadContactDataAsync

(

Windows::ApplicationModel::Contacts::Contact^

contact

)

[private]

DownloadOperationItem

(

Windows::Networking::BackgroundTransfer::DownloadOperation^

download

)

void DownloadProgress

(

DownloadOperationItem^

item

)

[private]

void DownloadProgress

(

Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^

operation,

Windows::Networking::BackgroundTransfer::DownloadOperation^

)

[private]

void DragCompleted

(

Windows::Foundation::IAsyncOperation< Windows::ApplicationModel::DataTransfer::DataPackageOperation >^

asyncInfo,

Windows::Foundation::AsyncStatus

asyncStatus

)

[private]

Concurrency::task<void> DrainBackBufferAsync

(

)

[private]

Keep presenting the m_backBuffer until there are no more.

void DrawBoundingRect

(

)

[private]

void drawer_AlarmExpired

(

Windows::Devices::PointOfService::CashDrawerCloseAlarm^

alarm,

Platform::Object^

sender

)

[private]

void drawer_StatusUpdated

(

Windows::Devices::PointOfService::CashDrawer^

sender,

Windows::Devices::PointOfService::CashDrawerStatusUpdatedEventArgs^

e

)

[private]

void DropBorder_DragEnter

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void DropBorder_Drop

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void DXFLOptionCombo_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void EmailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

task<void> EnableAsync

(

)

[private]

void EnableButtons

(

bool

isEnabled

)

[private]

void EnableButtons

(

)

[private]

void EnableButtons

(

)

[private]

void EnableButtons

(

)

[private]

void EnableControls_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void EnableControlsInTitleBar

(

bool

enable

)

void EnableDisableLogging

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void EnableDisableLogging

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void EnableIndependentInputEventHandlers

(

)

[private]

void EnableInkingEventHandlers

(

)

[private]

void EnableLoggingIndependentInputEventHandlers

(

bool

enable

)

[private]

void EnableLoggingStrokeEventHandlers

(

bool

enable

)

[private]

void EnableLoggingUnprocessedInputEventHandlers

(

bool

enable

)

[private]

void EnableNonSquarePARProfiles

(

)

[private]

void EnableNonSquarePARProfiles

(

)

[private]

void EnablePasteItemOnly

(

bool

IsEnabled,

Windows::Foundation::Point

pos

)

void EnableUI

(

bool

newState

)

[private]

void EnableUnprocessedInputEventHandlers

(

)

[private]

task<void> EndCall

(

)

[private]

void EndCallButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void EndExtendedExecution

(

)

[protected]

void EndExtendedExecution

(

)

[protected]

void EndExtendedExecution

(

)

[protected]

void EndRound

(

bool

hasWon

)

[private]

void EndScenario_Click

(

Platform::Object^

sender,

RoutedEventArgs

e

)

[private]

void EnvironmentComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void EnvironmentComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void EnvironmentComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ErasingModeCheckBox_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ErasingModeCheckBox_Unchecked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

EventHandlerForDevice

(

void

)

[private]

EventTests

(

)

void Execute_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Execute_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Execute_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<bool> ExecuteJobAndReportResultAsync

(

Windows::Devices::PointOfService::ReceiptPrintJob^

job

)

[private]

void ExtendedExecutionSessionRevoked

(

Platform::Object^

sender,

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^

args

)

[private]

void ExtendView_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ExtractButton_Tapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

void ExtractButton_Tapped

(

Platform::Object^

sender,

TappedRoutedEventArgs^

e

)

[private]

FeatureReports

(

)

FileLoggingSessionScenario

(

)

[private]

void FillComboBox

(

)

[private]

void FillTextBox

(

Windows::Media::Core::SpeechCue^

cue

)

[private]

void FillTextBoxes

(

Windows::Media::Core::SpeechCue^

cue,

Windows::Media::Core::TimedMetadataTrack^

timedMetadataTrack

)

[private]

void Find_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Find_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Find_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void FindAndCancelExistingBackgroundTask

(

)

[private]

void findAtCenterButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void FindButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

task<DeviceInformation^> FindCameraDeviceByPanelAsync

(

Windows::Devices::Enumeration::Panel

desiredPanel

)

[private]

Concurrency::task<Windows::Security::Cryptography::Certificates::Certificate^> FindCertificateFromStoreAsync

(

)

[private]

void FindClaimEnable_Click

(

Platform::Object^

sender,

RoutedEventArgs^

e

)

[private]

DeviceListEntry FindDevice

(

Platform::String^

deviceId

)

[private]

void FindPrinter_Click

(

)

[protected]

task<void> FindReceiptPrinter

(

)

[private]

Windows::UI::Xaml::Controls::ScrollViewer FindScrollViewer

(

DependencyObject^

depObject

)

[private]

Windows::UI::Xaml::Controls::ScrollViewer FindScrollViewer

(

DependencyObject^

depObject

)

[private]

FirmwareAccess

(

)

void Fix_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

bool FollowCircleTest

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void FontDownloadListener_DownloadCompleted

(

)

[private]

void Footer_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Footer_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void FormatComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

Called when a format is selected.

Sets the format of the currently selected source.

static Platform::String FormatDownloadedRanges

(

Windows::Foundation::Collections::IIterable< Windows::Networking::BackgroundTransfer::BackgroundTransferFileRange >^

ranges

)

[static, private]

FrameFormatModel

(

Windows::Media::Capture::Frames::MediaFrameFormat^

format

)

unsigned int FrameRate

(

)

void FrameReader_FrameArrived

(

Windows::Media::Capture::Frames::MediaFrameReader^

sender,

Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^

args

)

[private]

Handler for frames which arrive from the MediaFrameReader.

void FrameReader_FrameArrived

(

Windows::Media::Capture::Frames::MediaFrameReader^

sender,

Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^

args

)

[private]

Handler for frames which arrive from the MediaFrameReader.

Buffers the required frames for rendering and renders based on which sources are enabled and available.

FrameRenderer

(

Windows::UI::Xaml::Controls::Image^

image

)

FrameSourceGroupModel

(

Windows::Media::Capture::Frames::MediaFrameSourceGroup^

sourceGroup

)

FrameSourceInfoModel

(

Windows::Media::Capture::Frames::MediaFrameSourceInfo^

sourceInfo

)

void FulfillConsumableButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void FulfillConsumableButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Functions

(

)

Windows::UI::Input::GestureSettings GenerateDefaultSettings

(

)

[private]

concurrency::task<UIElement^> GeneratePageAsync

(

int

photoNumber,

PageDescription

pageDescription

)

[private]

Generates a page containing a photo.

The image will be rotated if detected that there is a gain from that regarding size (try to maximize photo size).

Parameters:

photoNumber

The photo number.

pageDescription

The description of the printer page.

Returns:

A task that will produce the page.

void GetAccounts

(

)

[private]

Concurrency::task<Windows::Devices::Sensors::ActivitySensor^> GetActivitySensorAsync

(

)

[private]

Platform::String GetAddress

(

int

i

)

[private]

Platform::String GetAppLanguagesAsFormattedString

(

)

[private]

static bool GetAppLocalSettingsValueAsBool

(

Platform::String^

key

)

[inline, static, private]

Definition at line 85 of file FileLoggingSessionScenario.h.
        {
            Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
            return safe_cast<bool>(obj);
        }
static bool GetAppLocalSettingsValueAsBool

(

Platform::String^

key

)

[inline, static, private]

Definition at line 85 of file LoggingSessionScenario.h.
        {
            Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
            return safe_cast<bool>(obj);
        }
static Platform::Object GetAppLocalSettingsValueAsObject

(

Platform::String^

key

)

[inline, static, private]

Definition at line 80 of file FileLoggingSessionScenario.h.
        {
            return Windows::Storage::ApplicationData::Current->LocalSettings->Values->Lookup(key);
        }
static Platform::Object GetAppLocalSettingsValueAsObject

(

Platform::String^

key

)

[inline, static, private]

Definition at line 80 of file LoggingSessionScenario.h.
        {
            return Windows::Storage::ApplicationData::Current->LocalSettings->Values->Lookup(key);
        }
static Platform::String GetAppLocalSettingsValueAsString

(

Platform::String^

key

)

[inline, static, private]

Definition at line 91 of file FileLoggingSessionScenario.h.
        {
            Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
            return safe_cast<Platform::String^>(obj);
        }
static Platform::String GetAppLocalSettingsValueAsString

(

Platform::String^

key

)

[inline, static, private]

Definition at line 91 of file LoggingSessionScenario.h.
        {
            Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
            return safe_cast<Platform::String^>(obj);
        }
void GetAssociatedProductsButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetBooleanInputReport_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

Concurrency::task<void> GetBooleanInputReportAsync

(

uint8

buttonNumber

)

[private]

void GetButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<Windows::Security::Cryptography::Certificates::Certificate^> GetClientCertificateAsync

(

)

[private]

const std::vector<Cluster>& GetClustersForZoomLevel

(

int

zoomLevel

)

[private]

void GetCO2Level

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Windows::UI::Color getColor

(

Platform::String^

colorString

)

[private]

Windows::UI::Color getColor

(

Platform::String^

colorString

)

[private]

void GetConsumableBalanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetConsumableBalanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetCurrentButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String GetCurrentMessage

(

)

Windows::UI::Input::Inking::InkStrokeContainer GetCurrentStrokesView

(

Windows::Foundation::DateTime

time

)

[private]

void GetCustomerCollectionsId

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

Platform::String GetCustomerFooter

(

)

[private]

Platform::String GetCustomerFooter

(

)

[private]

void GetCustomerPurchaseId

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void GetCustomProfile

(

)

[private]

void GetData

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

SampleDataModel GetDataModelForCurrentListViewFlyout

(

)

[private]

SampleDataModel GetDataModelForCurrentListViewFlyout

(

)

[private]

void GetDefaultAsyncBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetDefaultProvidersAndAccounts

(

)

[private]

void GetDependencies_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String GetDeviceSpecificProperties

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

Windows::Foundation::Deferral GetExecutionDeferral

(

)

[private]

void GetFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetFileFromFutureAccessListButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetFilesAndFoldersButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetFilesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void GetFilesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

Platform::String GetFriendlyName

(

bool

showFrameRate = true

)

void GetGeotagButton_Click

(

)

[protected]

void GetGyrometerSample

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetHistory_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PointerHitTestStates GetHitTestState

(

Windows::Foundation::Point

position

)

[private]

InkingAreaSubStates GetInkingSubstate

(

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void GetInstalledLocation_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

unsigned int GetItemIndex

(

Windows::UI::Input::RadialControllerMenuItem^

item

)

[private]

void GetLedBlinkPattern_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> GetLedBlinkPatternAsync

(

void

)

[private]

void GetLicenseState

(

)

[private]

Windows::UI::Color GetLogoBackgroundColor

(

)

[private]

void GetManagedConsumablesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetManufacturerName_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String GetMerchantFooter

(

)

[private]

Platform::String GetMerchantFooter

(

)

[private]

Platform::String GetMouseProperties

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void GetNumericInputReport_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

Concurrency::task<void> GetNumericInputReportAsync

(

void

)

[private]

void GetPackage_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetParent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Windows::UI::Input::Inking::InkStroke GetPartialStroke

(

Windows::UI::Input::Inking::InkStroke^

stroke,

Windows::Foundation::DateTime

time

)

[private]

concurrency::task<Windows::Storage::Streams::IBuffer^> GetPassportAuthenticationMessageAsync

(

Windows::Storage::Streams::IBuffer^

message,

Platform::String^

accountId

)

[private]

concurrency::task<Windows::Security::Credentials::PasswordCredential^> GetPasswordCredentialFromUserAsync

(

)

[private]

Platform::String GetPenProperties

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void GetPicturesLibrary

(

)

[private]

concurrency::task<Platform::String^> GetPinFromUserAsync

(

)

[private]

void GetPinValue_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

Platform::String GetPointerProperties

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void GetPresetProfile

(

Windows::UI::Xaml::Controls::ComboBox^

comboBox

)

[private]

void GetPresetProfile

(

Windows::UI::Xaml::Controls::ComboBox^

comboBox

)

[private]

virtual void GetPrintPreviewPage

(

Object^

sender,

GetPreviewPageEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintDocument.GetPrintPreviewPage.

It provides a specific print preview page, in the form of an UIElement, to an instance of PrintDocument. PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.

Parameters:

sender

The print document.

e

Arguments containing the preview requested page.

Reimplemented from PrintHelper.

Platform::String GetPropertyDisplayValue

(

Platform::Object^

property

)

[protected]

Platform::String GetPropertyForDisplay

(

Platform::String^

key

)

[inline]

Definition at line 277 of file DisplayHelpers.h.
        {
            return Properties->HasKey(key) ? Properties->Lookup(key)->ToString() : nullptr;
        }
void GetProviders

(

)

[private]

void GetProvidersAndAccounts

(

)

[private]

void GetProvidersAndAccounts

(

)

[private]

void GetProvidersAndAccounts

(

)

[private]

void GetProvidersAndAccounts

(

)

[private]

Windows::UI::Input::RadialControllerMenuItem GetRadialControllerMenuItemFromSender

(

Platform::Object^

sender

)

[private]

static Windows::Foundation::Collections::IVector<SampleDataModel^> GetSampleData

(

)

[inline, static]

Definition at line 31 of file SampleDataModel.h.
        {
            return ref new Platform::Collections::Vector<SampleDataModel^>{
                ref new SampleDataModel("Cliff", "Assets/cliff.jpg"),
                ref new SampleDataModel("Grapes", "Assets/grapes.jpg"),
                ref new SampleDataModel("Rainier", "Assets/Rainier.jpg"),
                ref new SampleDataModel("Sunset", "Assets/Sunset.jpg"),
                ref new SampleDataModel("Treetops", "Assets/Treetops.jpg"),
                ref new SampleDataModel("Valley", "Assets/Valley.jpg"),
            };
        }
Platform::Collections::Vector<Platform::String^> GetSampleData

(

)

[private]

Windows::Devices::Enumeration::DevicePairingKinds GetSelectedCeremonies

(

)

[private]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

virtual bool GetShareContent

(

Windows::ApplicationModel::DataTransfer::DataRequest^

request

)

[override, protected, virtual]

static Platform::String GetSubtypeForFrameReader

(

Windows::Media::Capture::Frames::MediaFrameSourceKind

kind,

Windows::Media::Capture::Frames::MediaFrameFormat^

format

)

[static]

Determines the subtype to request from the MediaFrameReader that will result in a frame that can be rendered by ConvertToDisplayableImage.

Returns:

Subtype string to request, or null if subtype is not renderable.

void GetThumbnailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetThumbnailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetThumbnailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetThumbnailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetThumbnailButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

String GetTime

(

)

Concurrency::task<Platform::String^> GetTokenFromAzureOAuthAsync

(

)

[private]

Platform::String GetTouchProperties

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void GetUnmanagedConsumablesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GetUserCollectionButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<bool> GetUserConfirmationAsync

(

Platform::String^

pin

)

[private]

Concurrency::task<Platform::String^> GetVideoProfileSupportedDeviceIdAsync

(

Windows::Devices::Enumeration::Panel

panel

)

[private]

Concurrency::task<Platform::String^> GetVideoProfileSupportedDeviceIdAsync

(

Windows::Devices::Enumeration::Panel

panel

)

[private]

Concurrency::task<Platform::String^> GetVideoProfileSupportedDeviceIdAsync

(

Windows::Devices::Enumeration::Panel

panel

)

[private]

void GreenButton_Click

(

_In_ Platform::Object^

sender,

_In_ Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GroupByHelper

(

Windows::Storage::Search::QueryOptions^

queryOptions

)

[private]

void GroupByMonthButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GroupByRatingButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GroupByTagButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void GroupComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

Stops reading from the previous selection and starts reading frames from the newly selected source group.

GroupedBackgroundTask

(

)

GroupedBackgroundTask

(

)

void GroupNameLocalizedResource_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void HandleCardAdded

(

Windows::Devices::SmartCards::SmartCardReader^

evtReader,

Windows::Devices::SmartCards::CardAddedEventArgs^

args

)

[private]

void HandleCardRemoved

(

Windows::Devices::SmartCards::SmartCardReader^

evtReader,

Windows::Devices::SmartCards::CardRemovedEventArgs^

args

)

[private]

Concurrency::task<void> HandleDownloadAsync

(

)

[private]

void HandleDownloadAsync

(

Windows::Networking::BackgroundTransfer::DownloadOperation^

download,

boolean

start

)

[private]

void HandleError

(

Platform::Exception^

error,

Platform::String^

msg,

Platform::String^

prefix

)

[private]

void HandleFollowCircleInput

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void HandleRecognitionResult

(

Windows::Media::SpeechRecognition::SpeechRecognitionResult^

recoResult

)

[private]

void HandleRecognitionResult

(

Windows::Media::SpeechRecognition::SpeechRecognitionResult^

recoResult

)

[private]

void HandleRegularInput

(

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^

args

)

[private]

void HandleUploadAsync

(

Windows::Networking::BackgroundTransfer::UploadOperation^

upload,

bool

start

)

[private]

bool HasSameFormat

(

Windows::Media::Capture::Frames::MediaFrameFormat^

otherFormat

)

[inline]

Compares the Format contained by this view model to the given format for equivalency.

Parameters:

otherFormat

The MediaFrameFormat to compare to the MediaFrameFormat in this view model.

Returns:

Definition at line 65 of file FrameSourceViewModels.h.
        {
            if (otherFormat == nullptr)
            {
                return (Format == nullptr);
            }

            return Format->MajorType == otherFormat->MajorType &&
                Format->Subtype == otherFormat->Subtype &&
                Format->FrameRate->Numerator == otherFormat->FrameRate->Numerator &&
                Format->FrameRate->Denominator == otherFormat->FrameRate->Denominator &&
                ((Format->VideoFormat == nullptr && otherFormat->VideoFormat == nullptr) ||
                 (Format->VideoFormat != nullptr && otherFormat->VideoFormat != nullptr &&
                  Format->VideoFormat->Width == otherFormat->VideoFormat->Width &&
                  Format->VideoFormat->Height == otherFormat->VideoFormat->Height));
        }
unsigned int Height

(

)

void HeightSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void HexDump

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Hide

(

)

void Hide

(

)

void Hide

(

)

void HideGuidance

(

)

[private]

void HideGuidance

(

)

[private]

void HideGuidance

(

)

[private]

void HideGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void HideGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void HideGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void HidePairingPanel

(

)

[private]

void HidePropertyPopUp

(

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

void HighlightWordOnScreen

(

int

startPositionInInput,

int

endPositionInInput

)

[private]

void HttpMapTileDataSourceUriRequested

(

Windows::UI::Xaml::Controls::Maps::HttpMapTileDataSource^

sender,

Windows::UI::Xaml::Controls::Maps::MapTileUriRequestedEventArgs^

e

)

[private]

bool InCircleEdgeZone

(

double

distanceFromCenter

)

[private]

void IndependentEvent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void IndependentInputOnPointerEntering

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerExiting

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerHovering

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerLost

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerMoving

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerPressing

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void IndependentInputOnPointerReleasing

(

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void InertiaSwitch_Toggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InertiaSwitch_Toggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitalizeAccountsControlDialog

(

)

[private]

void InitalizeAccountsControlDialog

(

)

[private]

void InitalizeAccountsControlDialog

(

)

[private]

void InitalizeAccountsControlDialog

(

)

[private]

void InitalizeAccountsControlDialog

(

)

[private]

void InitCustomProfileBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitDrawerButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitDrawerButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

task<void> Initialize

(

)

[private]

task<void> Initialize

(

)

[private]

void Initialize

(

Platform::String^

displayName,

Windows::Devices::Enumeration::DeviceClass

deviceClassSelector,

Platform::String^

selector,

Windows::Devices::Enumeration::DeviceInformationKind

kind

)

[inline, private]

Definition at line 43 of file DisplayHelpers.h.
        {
            DisplayName = displayName;
            DeviceClassSelector = deviceClassSelector;
            Kind = kind;
            Selector = selector;
        }
task<void> InitializeAsync

(

)

[private]

Initialization of the device.

Concurrency::task<void> InitializeAsync

(

)

[private]

Concurrency::task<void> InitializeAsync

(

)

[private]

Concurrency::task<void> InitializeAsync

(

)

[private]

Concurrency::task<void> InitializeAsync

(

)

[private]

Concurrency::task<void> InitializeAsync

(

)

[private]

Concurrency::task<void> InitializeAsync

(

)

[private]

task<void> InitializeCameraAsync

(

)

[private]

Concurrency::task<void> InitializeCameraAsync

(

)

[private]

Concurrency::task<void> InitializeCameraAsync

(

)

[private]

Concurrency::task<void> InitializeCameraAsync

(

)

[private]

void InitializeCameraButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitializeCameraButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitializeCameraButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitializeController

(

)

[private]

void InitializeDeviceWatchers

(

void

)

[private]

Concurrency::task<void> InitializeLampAsync

(

)

[private]

void InitializeListboxVoiceChooser

(

)

[private]

void InitializeListboxVoiceChooser

(

)

[private]

void InitializeListboxVoiceChooser

(

)

[private]

void InitializeOsrFx2DeviceWatcher

(

void

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeRecognizer

(

Windows::Globalization::Language^

recognizerLanguage

)

[private]

void InitializeSuperMuttDeviceWatcher

(

void

)

[private]

void InitializeTransforms

(

)

void InitializeTransforms

(

)

[private]

void InitializeUIControls

(

)

[private]

void InitializeValues

(

)

[private]

void InitializeValues

(

)

[private]

void InitializeValues

(

)

[private]

void InitializeValues

(

)

[private]

IAsyncAction initializing_previewSetupCompleted

(

)

[private]

void InitLampBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InitManipulationTransforms

(

)

[private]

void InitOptions

(

)

[private]

void InitOptions

(

)

[private]

void InitRecordProfileBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InkingEvent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InkingModeSelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void InkPresenter_StrokesCollected

(

Windows::UI::Input::Inking::InkPresenter^

sender,

Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^

args

)

[private]

void InkPresenter_StrokesCollected

(

Windows::UI::Input::Inking::InkPresenter^

sender,

Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^

e

)

[private]

void InkPresenter_StrokesErased

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void InkPresenter_StrokesErased

(

Windows::UI::Input::Inking::InkPresenter^

sender,

Windows::UI::Input::Inking::InkStrokesErasedEventArgs^

args

)

[private]

void InkReplayTimer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void InkStackPanel_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs

e

)

[private]

void InkToolbar_ActiveToolChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

void InkToolbar_EraseAllClicked

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

void inkToolbar_InkDrawingAttributesChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

void InkToolbar_InkDrawingAttributesChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

void InkToolbar_IsStencilButtonCheckedChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs^

args

)

[private]

void InkToolbar_IsStencilButtonCheckedChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs^

args

)

[private]

void inkToolbar_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InkToolbar_SelectedStencilChanged

(

Windows::UI::Xaml::DependencyObject^

sender,

Windows::UI::Xaml::DependencyProperty^

dp

)

[private]

InputOutputReports

(

)

void InputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

InputReportEvents

(

)

void InputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void InputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<Windows::Security::Cryptography::Certificates::Certificate^> InstallClientCertificateAsync

(

)

[private]

void InterruptMessageWorker

(

Windows::Devices::Custom::CustomDevice^

fx2Device,

Windows::Storage::Streams::IBuffer^

switchMessageBuffer

)

[private]

void InvalidateLayout

(

)

[private]

void InvalidateLayout

(

)

[private]

void InvalidateLayout

(

)

[private]

static bool IsAppLocalSettingsValue

(

Platform::String^

key

)

[inline, static, private]

Definition at line 75 of file FileLoggingSessionScenario.h.
        {
            return Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key);
        }
static bool IsAppLocalSettingsValue

(

Platform::String^

key

)

[inline, static, private]

Definition at line 75 of file LoggingSessionScenario.h.
        {
            return Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key);
        }
bool IsChecked

(

Windows::UI::Xaml::Controls::Primitives::ToggleButton^

button

)

[private]

Concurrency::task<bool> IsFixNeededAsync

(

Windows::ApplicationModel::UserDataAccounts::UserDataAccount^

account

)

[private]

bool IsFx2CustomTriggerTaskRegistered

(

)

[private]

void IsImportantTransaction_Click

(

)

[protected]

bool IsItemInMenu

(

Windows::UI::Input::RadialControllerMenuItem^

item

)

[private]

static bool IsNonNull

(

Platform::Object^

o

)

[static]

static bool IsNonNull

(

Platform::Object^

item

)

[inline, static]

Definition at line 25 of file Scenario1_SelectDisplay.xaml.h.
        {
            return item != nullptr;
        }
static bool IsNonNull

(

Platform::Object^

item

)

[inline, static]

Definition at line 27 of file Scenario5_DefiningCustomGlyphs.xaml.h.
        {
            return item != nullptr;
        }
bool IsPrinterClaimed

(

)

[private]

bool IsTargetBorder

(

Platform::Object^

sender

)

[private]

bool IsWatcherRunning

(

)

static bool IsWatcherStarted

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher

)

[static, private]

bool IsWebException

(

Platform::String^

title,

Platform::Exception^

ex

)

[private]

bool IsWebException

(

Platform::String^

title,

Platform::Exception^

ex

)

[private]

ItemDetails

(

Windows::Services::Store::StoreProduct^

product

)

[inline]

Definition at line 8 of file ItemsListViewModel.h.
        {
            title = product->Title;
            price = product->Price->FormattedPrice;
            inCollection = product->IsInUserCollection;
            productKind = product->ProductKind;
            storeId = product->StoreId;
        }
void Lamp_AvailabilityChanged

(

Windows::Devices::Lights::Lamp^

sender,

Windows::Devices::Lights::LampAvailabilityChangedEventArgs^

args

)

[private]

void lampToggle_Toggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void LanguageList_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void LanguageList_SelectionChanged

(

Platform::Object^

sender,

SelectionChangedEventArgs^

e

)

[private]

static Platform::String LanguageTagToRecognizerName

(

Platform::String^

bcp47tag

)

[static]

void LatencyModeToggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Launch_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Launch_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Launch_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Launch_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Launch_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void LaunchAtSize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void LaunchContextMenu

(

Windows::Foundation::Point

contextMenuPosition

)

[private]

void LaunchInFullScreenModeCheckBox_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static Windows::UI::Xaml::Shapes::Line LineTo

(

Platform::Array< WindowsPreview::Media::Capture::Frames::TrackedPose >^

poses,

WindowsPreview::Media::Capture::Frames::BodyPart

fromBodyPart,

WindowsPreview::Media::Capture::Frames::BodyPart

toBodyPart,

CoordinateTransformationMethod^

positionTransformation

)

[static, private]

void ListboxVoiceChooser_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ListboxVoiceChooser_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ListboxVoiceChooser_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ListFoldersButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

ListsAndTemplates

(

)

void ListSmartCards_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ListView_ContextCanceled

(

Windows::UI::Xaml::UIElement^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ListView_ContextRequested

(

Windows::UI::Xaml::UIElement^

sender,

Windows::UI::Xaml::Input::ContextRequestedEventArgs^

e

)

[private]

void LoadAccount

(

)

[private]

void LoadAccount

(

)

[private]

void LoadAccounts

(

)

[private]

concurrency::task<Windows::UI::Xaml::Media::Imaging::WriteableBitmap^> LoadBitmapAsync

(

Windows::Foundation::Uri^

source,

bool

landscape

)

[private]

Loads an image from an uri source and performs a rotation based on the print target aspect.

Parameters:

source

The location of the image.

landscape

A flag that indicates if the target(printer page) is in landscape mode.

void LoadButton_Tapped

(

Platform::Object^

sender,

TappedRoutedEventArgs^

e

)

[private]

void LoadDocument

(

)

task<void> LoadImage

(

Windows::Storage::StorageFile^

file

)

[private]

void LoadInternalState

(

_In_ Windows::Foundation::Collections::IPropertySet^

state

)

Concurrency::task<Windows::Graphics::Imaging::BitmapFrame^> LoadLogoBitmapAsync

(

)

[private]

Concurrency::task<void> LoadPlaceInfoAsync

(

)

[private]

void LoadSampleImage

(

)

[private]

void LocalClientButtonClicked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

LocationTrackingReason

(

)

void LockScenarioChange

(

)

[private]

void LockScenarioChange

(

)

[private]

void LockToXAxis

(

)

void LockToYAxis

(

)

void Log

(

Platform::String^

message

)

[inline]

Definition at line 25 of file SimpleLogger.h.
        {
            auto calendar = ref new Windows::Globalization::Calendar();
            auto formatter = ref new Windows::Globalization::DateTimeFormatting::DateTimeFormatter("hour minute second");

            LONG messageNumber = InterlockedIncrement(&m_messageCount);
            Platform::String^ newMessage = "[" + messageNumber.ToString() + "] " +
                formatter->Format(calendar->GetDateTime()) + " : " + message;

            m_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Low,
                ref new Windows::UI::Core::DispatchedHandler(
                    [this, newMessage]()
            {
                m_textBlock->Text = newMessage + "\r\n" + m_textBlock->Text;
            }));
        }
void Log

(

Platform::String^

message

)

[private]

void Log

(

LogEventAction

action

)

[private]

void Log

(

Platform::String^

message

)

[private]

void Log

(

Platform::String^

message

)

[inline]

Definition at line 25 of file SimpleLogger.h.
        {
            auto calendar = ref new Windows::Globalization::Calendar();
            auto formatter = ref new Windows::Globalization::DateTimeFormatting::DateTimeFormatter("hour minute second");

            LONG messageNumber = InterlockedIncrement(&m_messageCount);
            Platform::String^ newMessage = "[" + messageNumber.ToString() + "] " +
                formatter->Format(calendar->GetDateTime()) + " : " + message;

            m_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Low,
                ref new Windows::UI::Core::DispatchedHandler(
                    [this, newMessage]()
            {
                m_textBlock->Text = newMessage + "\r\n" + m_textBlock->Text;
            }));
        }
void Log

(

Platform::String^

message

)

[private]

void LogContactInfo

(

Windows::UI::Input::RadialControllerScreenContact^

contact

)

[private]

void LogException

(

Platform::String^

title,

Platform::Exception^

ex

)

[private]

void LogException

(

Platform::String^

title,

Platform::Exception^

ex,

Windows::Networking::BackgroundTransfer::DownloadOperation^

download = nullptr

)

[private]

void LogException

(

Platform::String^

title,

Platform::Exception^

ex

)

[private]

LoggingScenarioEventArgs

(

LoggingScenarioEventType

type,

const std::wstring &

logFileFullPath

)

[inline, private]

Definition at line 39 of file LoggingScenarioEventArgs.h.
        {
            _type = type;
            _logFileFullPath = logFileFullPath;
        }
LoggingScenarioEventArgs

(

bool

enabled

)

[inline, private]

Definition at line 45 of file LoggingScenarioEventArgs.h.
        {
            _type = LoggingEnabledDisabled;
            _enabled = enabled;
        }
LoggingSessionScenario

(

)

[private]

void LogMessage

(

Platform::String^

message

)

[private]

void LogoffAndRemoveAccount

(

)

[private]

void LogoffAndRemoveAccount

(

)

[private]

void LogoffAndRemoveAccount

(

)

[private]

void LogoffAndRemoveAccount

(

)

[private]

Windows::Foundation::IAsyncAction LogoffAndRemoveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void LogoffAndRemoveAccount

(

)

[private]

void LogoffAndRemoveAllAccounts

(

)

[private]

void LogStatus

(

Platform::String^

message,

SDKTemplate::NotifyType

type

)

[private]

void LogStatus

(

Platform::String^

message,

SDKTemplate::NotifyType

type

)

[private]

void LogStatus

(

Platform::String^

message,

SDKTemplate::NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusAsync

(

Platform::String^

message,

NotifyType

type

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

Concurrency::task<void> LogStatusToOutputBoxAsync

(

Platform::String^

message

)

[private]

void LogToggleSwitch_Toggled

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void LogWithWin10Constructor

(

)

void LogWithWin81Constructor

(

)

m_imagePath

(

imagePath

)

[inline]

Definition at line 27 of file SampleDataModel.h.
            : m_title(title), m_imagePath(imagePath)
        {
        }
MainPage

(

)

MainPage

(

)

Windows::UI::Xaml::Media::SolidColorBrush MakeColor

(

double

red,

double

green,

double

blue

)

void MakeCurrent_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs

e

)

[private]

void Manage_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ManipulateMe_ManipulationCompleted

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^

e

)

[private]

void ManipulateMe_ManipulationDelta

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^

e

)

[private]

void ManipulateMe_ManipulationInertiaStarting

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^

e

)

[private]

void ManipulateMe_ManipulationStarted

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^

e

)

[private]

ManipulationInputProcessor

(

Windows::UI::Input::GestureRecognizer^

gestureRecognizer,

Windows::UI::Xaml::UIElement^

target,

Windows::UI::Xaml::UIElement^

referenceFrame

)

ManipulationProcessor

(

Windows::UI::Input::GestureRecognizer^

gestureRecognizer,

Windows::UI::Xaml::Controls::Border^

target,

Windows::UI::Xaml::UIElement^

referenceFrame

)

void mapBillboardAddButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapClearButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapElement3DAddButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapElementsLayer1Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapElementsLayer2Button_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapIconAddButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapItemButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapPolygonAddButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void mapPolylineAddButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MarkIn

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MarkOut

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MarshalLog

(

Platform::String^

value

)

[private]

void MarshalLog

(

Platform::String^

value

)

[private]

void MarshalNotifyUser

(

Platform::String^

message,

SDKTemplate::NotifyType

type

)

[private]

void MatchPreviewAspectRatio

(

)

[private]

virtual Size MeasureOverride

(

Size

desiredSize

)

[override, protected, virtual]

void media_MediaEnded

(

Windows::Media::Playback::MediaPlayer^

timedMetadataTrack,

Platform::Object^

e

)

[private]

void media_MediaEnded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void media_MediaEnded

(

Windows::Media::Playback::MediaPlayer^

sender,

Platform::Object^

e

)

[private]

void MediaCapture_Failed

(

MediaCapture^

sender,

MediaCaptureFailedEventArgs^

errorEventArgs

)

[private]

void MediaCapture_Failed

(

Windows::Media::Capture::MediaCapture^

sender,

Windows::Media::Capture::MediaCaptureFailedEventArgs^

e

)

[private]

void MediaCapture_Failed

(

Windows::Media::Capture::MediaCapture^

sender,

Windows::Media::Capture::MediaCaptureFailedEventArgs^

e

)

[private]

void MediaCapture_Failed

(

Windows::Media::Capture::MediaCapture^

sender,

Windows::Media::Capture::MediaCaptureFailedEventArgs^

e

)

[private]

void MessageReceived

(

Windows::Networking::Sockets::MessageWebSocket^

sender,

Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^

args

)

[private]

void MessageReceived

(

Windows::Networking::Sockets::MessageWebSocket^

sender,

Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^

args

)

[private]

void MessageTextBox_KeyUp

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::KeyRoutedEventArgs^

e

)

[protected]

void metadata_MarkCueEntered

(

Windows::Media::Core::TimedMetadataTrack^

timedMetadataTrack,

Windows::Media::Core::MediaCueEventArgs^

args

)

[private]

void metadata_SpeechCueEntered

(

Windows::Media::Core::TimedMetadataTrack^

timedMetadataTrack,

Windows::Media::Core::MediaCueEventArgs^

args

)

[private]

MeteringData

(

)

void Methods_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void Methods_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void movementAxis_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void movementAxis_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void MoveOnXAndYAxes

(

)

MultipleTasks

(

)

void myGridView_ContainerContentChanging

(

Windows::UI::Xaml::Controls::ListViewBase^

sender,

Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^

args

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void myMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void myMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void myMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void myMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void MyMap_MapTapped

(

Windows::UI::Xaml::Controls::Maps::MapControl^

sender,

Windows::UI::Xaml::Controls::Maps::MapInputEventArgs^

args

)

[private]

void myMap_ZoomLevelChanged

(

Windows::UI::Xaml::Controls::Maps::MapControl^

sender,

Platform::Object^

args

)

[private]

void MyMapLoaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

MyUserControl1

(

)

static unsigned long long nearestMegabyte

(

unsigned long long

bytes

)

[static, private]

void NewWindowButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void NextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Select next available source group and start streaming from it.

void NextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void noButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static bool Not

(

bool

value

)

[inline, static]

Definition at line 61 of file SampleConfiguration.h.
        {
            return !value;
        }
bool NotifyIfAnyError

(

__int64

errCode

)

[private]

void NotifyPropertyChanged

(

Platform::String^

prop

)

[private]

void NotifyUser

(

Platform::String^

strMessage,

NotifyType

type

)

[private]

void NotifyUser

(

Platform::String^

strMessage,

NotifyType

type

)

[private]

OcrCapturedImage

(

)

OcrFileImage

(

)

void OfflineLicensesChanged

(

Windows::Services::Store::StoreContext^

sender,

Platform::Object^

args

)

[private]

void okButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnAamvaCardDataReceived

(

Windows::Devices::PointOfService::ClaimedMagneticStripeReader^

sender,

Windows::Devices::PointOfService::MagneticStripeReaderAamvaCardDataReceivedEventArgs^

args

)

[private]

void OnAccessChanged

(

Windows::Devices::Enumeration::DeviceAccessInformation^

sender,

Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^

args

)

[private]

void OnAccessChanged

(

Windows::Devices::Enumeration::DeviceAccessInformation^

sender,

Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^

args

)

[private]

void OnAccessChanged

(

Windows::Devices::Enumeration::DeviceAccessInformation^

sender,

Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^

args

)

[private]

void OnAccountCommandsRequested

(

Windows::UI::ApplicationSettings::AccountsSettingsPane^

sender,

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void OnAccountCommandsRequested

(

Windows::UI::ApplicationSettings::AccountsSettingsPane^

sender,

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void OnAccountCommandsRequested

(

Windows::UI::ApplicationSettings::AccountsSettingsPane^

sender,

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void OnAccountCommandsRequested

(

Windows::UI::ApplicationSettings::AccountsSettingsPane^

sender,

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void OnAccountCommandsRequested

(

Windows::UI::ApplicationSettings::AccountsSettingsPane^

sender,

Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^

e

)

[private]

void OnApplyTemplate

(

)

[override, protected]

virtual void OnApplyTemplate

(

)

[override, protected, virtual]

void OnAppResume

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnAppResume

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnAppResuming

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnAppResuming

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnApproximateAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnApproximateAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnApproximateAccuracy

(

)

[protected]

void OnAppSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnAppSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnAppSuspension

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

args

)

[private]

void OnAppSuspension

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

args

)

[private]

void OnAutoDismissTimerExpired

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void OnAutoDismissTimerExpired

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void OnAutoDismissTimerExpired

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void OnBackgroundTaskCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

sender,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

e

)

[private]

void OnBankCardDataReceived

(

Windows::Devices::PointOfService::ClaimedMagneticStripeReader^

sender,

Windows::Devices::PointOfService::MagneticStripeReaderBankCardDataReceivedEventArgs^

args

)

[private]

void OnBringIntoView

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnButtonClicked

(

Windows::UI::Input::RadialController^

sender,

Windows::UI::Input::RadialControllerButtonClickedEventArgs^

args

)

[private]

void OnCanceled

(

Windows::ApplicationModel::Background::IBackgroundTaskInstance^

taskInstance,

Windows::ApplicationModel::Background::BackgroundTaskCancellationReason

reason

)

void OnCaptureFailed

(

Windows::Media::Capture::MediaCapture^

sender,

Windows::Media::Capture::MediaCaptureFailedEventArgs^

errorEventArgs

)

[inline, private]

Capture has failed.

Definition at line 142 of file Utils.h.
        {
            // Forward the error to listeners.
            Failed(this, ref new CaptureFailedEventArgs(errorEventArgs->Code, errorEventArgs->Message));
        }
void OnChannelLoggingEnabled

(

Windows::Foundation::Diagnostics::ILoggingChannel^

sender,

Platform::Object^

args

)

[private]

void OnChannelLoggingEnabled

(

Windows::Foundation::Diagnostics::ILoggingChannel^

sender,

Platform::Object^

args

)

[private]

void OnChatViewContainerContentChanging

(

Windows::UI::Xaml::Controls::ListViewBase^

sender,

Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^

args

)

[private]

void OnClear

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnClear

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnClear

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnClosed

(

Windows::Networking::Sockets::IWebSocket^

sender,

Windows::Networking::Sockets::WebSocketClosedEventArgs^

args

)

[private]

void OnClosed

(

Windows::Networking::Sockets::IWebSocket^

sender,

Windows::Networking::Sockets::WebSocketClosedEventArgs^

args

)

[private]

void OnClosed

(

Windows::Networking::Sockets::IWebSocket^

sender,

Windows::Networking::Sockets::WebSocketClosedEventArgs^

args

)

[private]

void OnClosed

(

Windows::Networking::Sockets::IWebSocket^

sender,

Windows::Networking::Sockets::WebSocketClosedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompleted

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^

args

)

[private]

void OnCompositionScaleChanged

(

Windows::UI::Xaml::Controls::SwapChainPanel^

sender,

Object^

args

)

[private]

void OnCompositionScaleChanged

(

_In_ Windows::UI::Xaml::Controls::SwapChainPanel^

sender,

_In_ Object^

args

)

[private]

void OnConnect

(

)

[protected]

void OnConnect

(

)

[protected]

void OnConnect

(

)

[protected]

void OnConnectionRequested

(

Windows::Devices::WiFiDirect::WiFiDirectConnectionListener^

sender,

Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs^

connectionEventArgs

)

[private]

void OnConnectionStatusChanged

(

Windows::Devices::WiFiDirect::WiFiDirectDevice^

sender,

Object^

arg

)

[private]

void OnControlAcquired

(

Windows::UI::Input::RadialController^

sender,

Windows::UI::Input::RadialControllerControlAcquiredEventArgs^

args

)

[private]

void OnControlLost

(

Windows::UI::Input::RadialController^

sender,

Platform::Object^

args

)

[private]

void OnCopy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnCustomSensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

watcher,

Windows::Devices::Enumeration::DeviceInformation^

firstDevice

)

[private]

void OnCustomSensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

watcher,

Windows::Devices::Enumeration::DeviceInformation^

firstDevice

)

[private]

void OnCut

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnDeferredImageRequestedHandler

(

Windows::ApplicationModel::DataTransfer::DataProviderRequest^

request

)

[private]

void OnDeviceAccessChanged

(

Windows::Devices::Enumeration::DeviceAccessInformation^

sender,

Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^

eventArgs

)

[private]

void OnDeviceAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformation^

deviceInfo

)

[private]

void OnDeviceAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

deviceInfo

)

[private]

void OnDeviceAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation,

Platform::String^

deviceSelector

)

[private]

void OnDeviceClosing

(

EventHandlerForDevice^

sender,

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation

)

[private]

void OnDeviceClosing

(

EventHandlerForDevice^

sender,

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation

)

[private]

void OnDeviceConnected

(

EventHandlerForDevice^

sender,

OnDeviceConnectedEventArgs^

onDeviceConnectedEventArgs

)

[private]

OnDeviceConnectedEventArgs

(

bool

isDeviceSuccessfullyConnected,

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation

)

[inline]

Definition at line 56 of file SampleConfiguration.h.
        {
            this->isDeviceSuccessfullyConnected = isDeviceSuccessfullyConnected;
            this->deviceInformation = deviceInformation;
        }
void OnDeviceEnumerationComplete

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Platform::Object^

args

)

[private]

void OnDeviceListChanged

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Platform::String^

id

)

[private]

void OnDeviceListChanged

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Platform::String^

id

)

[private]

void OnDeviceListChanged

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Platform::String^

id

)

[private]

void OnDeviceRemoved

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInfoUpdate

)

[private]

void OnDeviceRemoved

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInformationUpdate

)

[private]

void OnDeviceRemoved

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInformationUpdate

)

[private]

void OnDeviceUpdated

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInfoUpdate

)

[private]

void OnDisconnect

(

)

[protected]

void OnDisconnect

(

)

[protected]

void OnDisconnect

(

)

[protected]

void OnDisplayContentsInvalidated

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void OnDisplayContentsInvalidated

(

_In_ Windows::Graphics::Display::DisplayInformation^

sender,

_In_ Platform::Object^

args

)

[private]

void OnDownloadProgress

(

Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^

sender,

Windows::Networking::BackgroundTransfer::DownloadOperation^

progress

)

[private]

void OnDownloadProgress

(

Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^

sender,

Windows::Networking::BackgroundTransfer::DownloadOperation^

progress

)

[private]

void OnDpiChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

)

[private]

void OnDpiChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void OnDpiChanged

(

_In_ Windows::Graphics::Display::DisplayInformation^

sender,

_In_ Platform::Object^

args

)

[private]

void OnDrawingAttributesChanged

(

Windows::UI::Xaml::Controls::InkToolbar^

sender,

Platform::Object^

args

)

[private]

void OneAndHalfSpace_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void OnEnumerationCompleted

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Object^

o

)

[private]

void OnHighAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnHighAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnHighAccuracy

(

)

[protected]

void OnHolding

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::HoldingEventArgs^

args

)

[private]

void OnIncomingConnection

(

Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^

sender,

Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^

args

)

[private]

void OnIncomingConnection

(

Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^

sender,

Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^

args

)

[private]

void OnIncomingConnection

(

Object^

sender,

Object^

args

)

[inline, private]

There is an incoming connection.

Definition at line 151 of file Utils.h.
        {
            // Forward the event to listeners.
            IncomingConnectionEvent(safe_cast<Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^>(sender), safe_cast<Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^>(args));
        }
task<void> OnInitializeCompleted

(

Windows::Foundation::HResult

hr

)

[private]

void OnInitializeCompletedDispatchedHandler

(

)

[private]

void OnInputReportEvent

(

Windows::Devices::HumanInterfaceDevice::HidDevice^

sender,

Windows::Devices::HumanInterfaceDevice::HidInputReportReceivedEventArgs^

eventArgs

)

[private]

void OnInsertShape

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnIsVisibleChanged

(

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^

sender,

Platform::Object^

args

)

[private]

void OnItemInvoked

(

unsigned int

selectedItemIndex

)

void OnKeyDown

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::KeyRoutedEventArgs^

e

)

[private]

virtual void OnLaunched

(

Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^

e

)

[override, protected, virtual]

virtual void OnLaunched

(

Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^

e

)

[override, virtual]

virtual void OnLaunched

(

Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^

e

)

[override, protected, virtual]

void OnLayerMapElementClicked

(

Windows::UI::Xaml::Controls::Maps::MapElementsLayer^

sender,

Windows::UI::Xaml::Controls::Maps::MapElementsLayerClickEventArgs^

args

)

[private]

void OnLayoutMetricsChanged

(

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^

sender,

Platform::Object^

args

)

[private]

void OnLoadAsync

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnLoaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnLoadedActions

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnLogFileGenerated

(

Windows::Foundation::Diagnostics::IFileLoggingSession^

sender,

Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs^

args

)

[private]

void OnLoggingEnabled

(

Windows::Foundation::Diagnostics::ILoggingChannel^

sender,

Platform::Object^

args

)

[private]

void OnLogSizeChanged

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnManipulationCompleted

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationCompletedEventArgs^

args

)

[private]

void OnManipulationCompleted

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationCompletedEventArgs^

args

)

[private]

void OnManipulationCompleted

(

Windows::UI::Input::GestureRecognizer^

,

Windows::UI::Input::ManipulationCompletedEventArgs^

e

)

[private]

void OnManipulationInertiaStarting

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationInertiaStartingEventArgs^

args

)

[private]

void OnManipulationInertiaStarting

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationInertiaStartingEventArgs^

args

)

[private]

void OnManipulationInertiaStarting

(

Windows::UI::Input::GestureRecognizer^

r,

Windows::UI::Input::ManipulationInertiaStartingEventArgs^

e

)

[private]

void OnManipulationStarted

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationStartedEventArgs^

args

)

[private]

void OnManipulationStarted

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationStartedEventArgs^

args

)

[private]

void OnManipulationStarted

(

Windows::UI::Input::GestureRecognizer^

,

Windows::UI::Input::ManipulationStartedEventArgs^

e

)

[private]

void OnManipulationUpdated

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationUpdatedEventArgs^

args

)

[private]

void OnManipulationUpdated

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::ManipulationUpdatedEventArgs^

args

)

[private]

void OnManipulationUpdated

(

Windows::UI::Input::GestureRecognizer^

,

Windows::UI::Input::ManipulationUpdatedEventArgs^

e

)

[private]

void OnMediaCaptureFailed

(

CaptureDevice^

sender,

CaptureFailedEventArgs^

errorEventArgs

)

[private]

void OnMediaCaptureFailed

(

CaptureDevice^

sender,

CaptureFailedEventArgs^

errorEventArgs

)

[private]

void OnMediaFailed

(

Platform::Object^

sender,

Windows::UI::Xaml::ExceptionRoutedEventArgs^

e

)

[private]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates away from this Scenario.

Stops streaming and disposes of all objects.

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates away from this Scenario.

Stops streaming and disposes of all objects.

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates away from this Scenario.

Stops streaming and disposes of all objects.

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedFrom

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates to this Scenario.

Immediately start streaming from first available source group.

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates to this Scenario.

Sets the GroupCombobox item source.

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

Called when user navigates to this Scenario.

Immediately start streaming from first available source group.

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatedTo

(

Windows::UI::Xaml::Navigation::NavigationEventArgs^

e

)

[override, protected, virtual]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

virtual void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected, virtual]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected]

virtual void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected, virtual]

virtual void OnNavigatingFrom

(

Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^

e

)

[override, protected, virtual]

void OnNavigationFailed

(

Platform::Object^

sender,

Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^

e

)

[private]

void OnNavigationFailed

(

Platform::Object^

sender,

Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^

e

)

[private]

void OnOrientationChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void OnOrientationChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

args

)

[private]

void OnOrientationChanged

(

_In_ Windows::Graphics::Display::DisplayInformation^

sender,

_In_ Platform::Object^

args

)

[private]

void OnOrientationChanged

(

Windows::Graphics::Display::DisplayInformation^

sender,

Platform::Object^

e

)

[private]

void OnPaste

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPenColorChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPenThicknessChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPenTypeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPointerCanceled

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerCanceled

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerExited

(

Platform::Object^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnPointerMoved

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerMoved

(

Platform::Object^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnPointerMoved

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerPressed

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerPressed

(

Platform::Object^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnPointerPressed

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerReleased

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

void OnPointerReleased

(

Platform::Object^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnPointerReleased

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

args

)

[private]

virtual void OnPreviewPagesCreated

(

Windows::Graphics::Printing::PrintTaskOptions^

printTaskOptions

)

[override, protected, virtual]

This is called when the preview pages have been recreated.

We use it to call ValidatePageRangeOption to make sure that the Page Ranges are still valid

Parameters:

printTaskOptions

Reimplemented from PrintHelper.

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnPrintButtonClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnProgress

(

Windows::ApplicationModel::Background::BackgroundTaskRegistration^

task,

Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^

args

)

[private]

void OnPropertyChanged

(

Platform::String^

propertyName

)

[protected]

void OnPropertyChanged

(

Platform::String^

propertyName

)

[private]

void OnPropertyChanged

(

Platform::String^

name

)

[protected]

void OnProximitySensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

device

)

[private]

void OnProximitySensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

device

)

[private]

void OnProximitySensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

device

)

[private]

void OnProximitySensorAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

sender,

Windows::Devices::Enumeration::DeviceInformation^

device

)

[private]

void OnRangesDownloaded

(

Windows::Networking::BackgroundTransfer::DownloadOperation^

sender,

Windows::Networking::BackgroundTransfer::BackgroundTransferRangesDownloadedEventArgs^

args

)

[private]

void OnReadingChanged

(

Windows::Devices::Sensors::Custom::CustomSensor^

sender,

Windows::Devices::Sensors::Custom::CustomSensorReadingChangedEventArgs^

e

)

[private]

void OnReadingChanged

(

Windows::Devices::Sensors::Pedometer^

sender,

Windows::Devices::Sensors::PedometerReadingChangedEventArgs^

args

)

[private]

void OnRecognizeAsync

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnRecognizerChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnReleaseDeviceRequested

(

Platform::Object^

sender,

Windows::Devices::PointOfService::ClaimedMagneticStripeReader^

args

)

[private]

void OnReleaseDeviceRequested

(

Platform::Object^

sender,

Windows::Devices::PointOfService::ClaimedMagneticStripeReader^

args

)

[private]

void OnRendering

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnRendering

(

_In_ Platform::Object^

sender,

_In_ Platform::Object^

args

)

[private]

void OnReplay

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnReset

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnResuming

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnRightTapped

(

Windows::UI::Input::GestureRecognizer^

sender,

Windows::UI::Input::RightTappedEventArgs^

args

)

[private]

void OnRotationChanged

(

Windows::UI::Input::RadialController^

sender,

Windows::UI::Input::RadialControllerRotationChangedEventArgs^

args

)

[private]

void OnSaveAsync

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnScreenContactContinued

(

Windows::UI::Input::RadialController^

sender,

Windows::UI::Input::RadialControllerScreenContactContinuedEventArgs^

args

)

[private]

void OnScreenContactEnded

(

Windows::UI::Input::RadialController^

sender,

Platform::Object^

args

)

[private]

void OnScreenContactStarted

(

Windows::UI::Input::RadialController^

sender,

Windows::UI::Input::RadialControllerScreenContactStartedEventArgs^

args

)

[private]

void OnSend

(

)

[protected]

void OnSend

(

)

[protected]

void OnServerCustomValidationRequested

(

Windows::Networking::Sockets::MessageWebSocket^

sender,

Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^

args

)

[private]

void OnServerCustomValidationRequested

(

Windows::Networking::Sockets::MessageWebSocket^

sender,

Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^

args

)

[private]

void OnServerCustomValidationRequested

(

Windows::Networking::Sockets::StreamWebSocket^

sender,

Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^

args

)

[private]

void OnShareProvidersRequested

(

Windows::ApplicationModel::DataTransfer::DataTransferManager^

sender,

Windows::ApplicationModel::DataTransfer::ShareProvidersRequestedEventArgs^

e

)

[private]

void OnShareToContosoChat

(

Windows::ApplicationModel::DataTransfer::ShareProviderOperation^

operation

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSizeChanged

(

Windows::UI::Core::CoreWindow^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

args

)

[private]

void OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnSocketConnectionReceived

(

Windows::Networking::Sockets::StreamSocketListener^

sender,

Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^

connectionReceivedEventArgs

)

[private]

static void OnStart

(

Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup^

sender,

Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^

args

)

[static]

void OnStart

(

)

[protected]

void OnStatusChanged

(

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher^

sender,

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs^

statusEventArgs

)

[private]

void OnStatusChanged

(

Platform::Object^

sender,

LoggingScenarioEventArgs^

args

)

[private]

void OnStatusChanged

(

Platform::Object^

sender,

LoggingScenarioEventArgs^

args

)

[private]

void OnStop

(

)

[protected]

void OnStopped

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Object^

o

)

[private]

void OnStrokeCanceled

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnStrokeContinued

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnStrokeEnded

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnStrokesCollected

(

Windows::UI::Input::Inking::InkPresenter^

sender,

Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^

args

)

[private]

void OnStrokeStarted

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

args

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnSuspending

(

Platform::Object^

sender,

Windows::ApplicationModel::SuspendingEventArgs^

e

)

[private]

void OnSwapChainPanelSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

args

)

[private]

void OnSwapChainPanelSizeChanged

(

_In_ Platform::Object^

sender,

_In_ Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void OnTargetFormatChanged

(

Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void OnTargetFormatChanged

(

Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void OnTargetFormatChanged

(

Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void OnTaskCompleted

(

)

[private]

void OnTick

(

Platform::Object^

sender,

Platform::Object^

args

)

[private]

void OnTimer

(

Windows::System::Threading::ThreadPoolTimer^

timer

)

[private]

void OnTimer

(

Windows::System::Threading::ThreadPoolTimer^

timer

)

[private]

void OnTimerTick

(

Object^

sender,

Object^

e

)

[private]

void OnTimerTick

(

Object^

sender,

Object^

e

)

[private]

void OnTimerTick

(

Object^

sender,

Object^

e

)

[private]

void OnUnreliableAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnUnreliableAccuracy

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OnUnreliableAccuracy

(

)

[protected]

void OnViewChanged

(

Platform::Object^

,

Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^

e

)

[private]

void OnVisibilityChanged

(

Windows::UI::Core::CoreWindow^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

args

)

[private]

void OnVisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void OnVisibilityChanged

(

_In_ Windows::UI::Core::CoreWindow^

sender,

_In_ Windows::UI::Core::VisibilityChangedEventArgs^

args

)

[private]

void OnWindowResize

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OnWindowResize

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

args

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

args

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OnWindowSizeChanged

(

Platform::Object^

sender,

Windows::UI::Core::WindowSizeChangedEventArgs^

e

)

[private]

void OpenDrawerButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OpenFromListButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> OpenFx2DeviceAsync

(

Platform::String^

Id

)

[private]

void OpenMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OpenMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OpenMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void openPrivacySettings_Click

(

Windows::UI::Xaml::Documents::Hyperlink^

sender,

Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^

args

)

[private]

void openPrivacySettings_Click

(

Windows::UI::Xaml::Documents::Hyperlink^

sender,

Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^

args

)

[private]

void openPrivacySettings_Click

(

Windows::UI::Xaml::Documents::Hyperlink^

sender,

Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^

args

)

[private]

void OrderSlider_ValudChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void OrientationChanged

(

Windows::Devices::Sensors::SimpleOrientationSensor^

sender,

Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^

e

)

[private]

static Platform::String OrientationsToString

(

Windows::Graphics::Display::DisplayOrientations

orientations

)

[static, private]

OtherBindings

(

)

void OtherLinkInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void OtherLinkInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void OtherLinkInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void OtherLinkInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void OtherLinkInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void OutputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputPauseButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputPlayButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputSettings

(

double

rawPixelsPerViewPixel,

Windows::UI::Xaml::FrameworkElement^

rectangle,

Windows::UI::Xaml::Controls::TextBlock^

relativePxText,

Windows::UI::Xaml::Controls::TextBlock^

physicalPxText,

Windows::UI::Xaml::Controls::TextBlock^

fontTextBlock

)

[private]

void OutputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputStopButton_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void OutputTokenResult

(

Windows::Security::Authentication::Web::Core::WebTokenRequestResult^

result

)

[private]

void Page_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Page_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Page_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Page_Loaded

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PageRangePrintHelper

(

Page^

scenarioPage

)

PageToPrint

(

)

void PairButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PairButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PairingRequestedHandler

(

Windows::Devices::Enumeration::DeviceInformationCustomPairing^

sender,

Windows::Devices::Enumeration::DevicePairingRequestedEventArgs^

args

)

[private]

Windows::Devices::SmartCards::SmartCardPinPolicy ParsePinPolicy

(

)

[private]

concurrency::task<void> PassportAvailableCheckAsync

(

)

[private]

void PassportDelete

(

)

[private]

void PasteFlyoutItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PauseAll_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PauseAnimationTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

void PauseDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void pfnLink_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PhasedTemplate_Checked

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PhasingTests

(

)

void PhoneButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PhotoButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PhotoSettings_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PhotosPrintHelper

(

Page^

scenarioPage

)

[inline]

Definition at line 80 of file Scenario5Photos.xaml.h.
: PrintHelper(scenarioPage) { }
void PickAFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickAFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickAndSetButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickAudioButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickAudioButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickContactEmail

(

)

void PickContactPhone

(

)

void PickContactsEmail

(

)

void PickContactsPhone

(

)

void PickFile

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickFile

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickFile

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickFilesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickFolderButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

concurrency::task<void> PickNextMediaSourceAsync

(

)

[private]

Disable the Next button while we switch to the next eligible media source.

concurrency::task<void> PickNextMediaSourceAsync

(

)

[private]

Pick the next source group and start streaming from it.

concurrency::task<void> PickNextMediaSourceWorkerAsync

(

)

[private]

Switch to the next eligible media source.

concurrency::task<void> PickNextMediaSourceWorkerAsync

(

)

[private]

Switch to the next eligible media source.

void PickOutput

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickOutput

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickOutput

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickPlaylistButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickPlaylistButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickPlaylistButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickPlaylistButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PickSingleDeviceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Pin_ValueChanged

(

Windows::Devices::Gpio::GpioPin^

sender,

Windows::Devices::Gpio::GpioPinValueChangedEventArgs^

e

)

[private]

void PitchSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void PlayAnimationTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

void PlayButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PlayButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PlayButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PlayFile

(

Windows::Storage::StorageFile^

MediaFile

)

[private]

void PlayFile

(

Windows::Storage::StorageFile^

MediaFile

)

[private]

void PlayFile

(

Windows::Storage::StorageFile^

MediaFile

)

[private]

void Pointer_Entered

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void Pointer_Moved

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void Pointer_Pressed

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void Pointer_Released

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void Pointer_Wheel_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void PopulateColorsClick

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void PopulateComboBox

(

Windows::Media::Capture::MediaStreamType

streamType,

Windows::UI::Xaml::Controls::ComboBox^

comboBox,

bool

showFrameRate = true

)

[private]

void PopulateComboBox

(

)

[private]

void PopulateComboBoxes

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateLanguageDropdown

(

)

[private]

void PopulateSettingsComboBox

(

)

[private]

void PrepareSampleFiles_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PrepareToSuspend

(

)

concurrency::task<void> PrepareToSuspendAsync

(

)

void PresentTextLayout

(

)

[private]

void PreviewButtonClicked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PreviewImage_SizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void PreviewImage_SizeChanged

(

Platform::Object^

sender,

SizeChangedEventArgs^

e

)

[private]

IAsyncAction previewing_localClientButtonClicked

(

)

[private]

IAsyncAction previewing_previewButtonClicked

(

)

[private]

IAsyncAction previewing_recordingStarted

(

)

[private]

PreviewOptionsPrintHelper

(

Page^

scenarioPage

)

[inline]

Definition at line 22 of file Scenario6DisablePreview.xaml.h.
: PrintHelper(scenarioPage) { }
RichTextBlockOverflow PreviewOptionsPrintHelper::AddOnePrintPage

(

RichTextBlockOverflow^

lastRTBOAdded,

Windows::Graphics::Printing::PrintPageDescription

printPageDescription

)

[protected]

This function creates and adds one print page to the internal cache of print preview pages stored in m_printPages.

Parameters:

lastRTBOAdded

Last RichTextBlockOverflow element added in the current content

printPageDescription

Printer's page description

void PreviewSettings_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PreviewSettings_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

PreviewUnavailable

(

)

PreviewUnavailable

(

Windows::Foundation::Size

paperSize,

Windows::Foundation::Size

printableSize

)

Preview unavailable page constructor.

Parameters:

paperSize

The printing page paper size

printableSize

The usable/"printable" area on the page

void PrintBarcode_Click

(

)

[protected]

void PrintBitmap_Click

(

)

[protected]

void printDetailedOptions_OptionChanged

(

Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails^

sender,

Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs^

args

)

[private]

Option change event handler.

Parameters:

sender

PrintTaskOptionsDetails object

args

the event arguments containing the changed option id

void PrintDetailedOptionsOptionChanged

(

Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails^

sender,

Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs^

args

)

[protected]

Option change event handler.

Parameters:

sender

The print task option details for which an option changed.

args

The event arguments containing the id of the option changed.

void PrintLine_Click

(

Platform::Object^

sender,

RoutedEventArgs

e

)

[private]

void PrintLine_Click

(

)

[protected]

void PrintLineFeedAndCutPaper

(

ReceiptPrintJob^

job,

Platform::String^

receipt

)

[private]

void PrintLineFeedAndCutPaper

(

Windows::Devices::PointOfService::ReceiptPrintJob^

job,

Platform::String^

receipt

)

[private]

void PrintMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PrintMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PrintMenuItem_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> PrintProfileInformation

(

Windows::Media::Capture::MediaCaptureVideoProfile^

profile,

Windows::Media::Capture::MediaCaptureVideoProfileMediaDescription^

description

)

[private]

void PrintReceipt

(

)

[private]

void PrintReceipt_Click

(

Platform::Object^

sender,

RoutedEventArgs

e

)

[private]

void PrintReceipt_Click

(

)

[protected]

void PrintRow

(

Platform::Array< byte >^

bytes,

int

i

)

[private]

void PrintSelectedItem

(

)

[private]

void PrintSelectedItem

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

virtual void PrintTaskRequested

(

Windows::Graphics::Printing::PrintManager^

sender,

Windows::Graphics::Printing::PrintTaskRequestedEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:

sender

PrintManager

e

PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

virtual void PrintTaskRequested

(

Windows::Graphics::Printing::PrintManager^

sender,

Windows::Graphics::Printing::PrintTaskRequestedEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:

sender

PrintManager

e

PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

virtual void PrintTaskRequested

(

Windows::Graphics::Printing::PrintManager^

sender,

Windows::Graphics::Printing::PrintTaskRequestedEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:

sender

PrintManager

e

PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

virtual void PrintTaskRequested

(

Windows::Graphics::Printing::PrintManager^

sender,

Windows::Graphics::Printing::PrintTaskRequestedEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:

sender

The print manager for which a print task request was made.

e

The print taks request associated arguments.

Reimplemented from PrintHelper.

virtual void PrintTaskRequested

(

Windows::Graphics::Printing::PrintManager^

sender,

Windows::Graphics::Printing::PrintTaskRequestedEventArgs^

e

)

[override, protected, virtual]

This is the event handler for PrintManager.PrintTaskRequested.

In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Parameters:

sender

PrintManager

e

PrintTaskRequestedEventArgs

Reimplemented from PrintHelper.

void PrivacyPolicyInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void PrivacyPolicyInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void PrivacyPolicyInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void PrivacyPolicyInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void PrivacyPolicyInvoked

(

Windows::UI::Popups::IUICommand^

command

)

[private]

void ProcessColor

(

String^

value

)

Concurrency::task<void> ProcessDataVirtualizationScrollOffsetsAsync

(

double

actualHeight

)

[private]

void ProcessFrame

(

Windows::Media::Capture::Frames::MediaFrameReference^

frame

)

Buffer and render frames.

void projectionCombobox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

ProtectionLevelSelectorInfo

(

Platform::String^

displayName,

Windows::Devices::Enumeration::DevicePairingProtectionLevel

protectionLevel

)

[inline]

Definition at line 195 of file DisplayHelpers.h.
        {
            DisplayName = displayName;
            ProtectionLevel = protectionLevel;
        }
void Protocol_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

double PtFromPx

(

double

pixel

)

[private]

void PurchaseAddOnButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PurchaseAddOnButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PurchaseAddOnButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void PurchaseFullLicense

(

)

void PurpleButton_Click

(

_In_ Platform::Object^

sender,

_In_ Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

double PxFromPt

(

double

pt

)

[private]

void RadiusSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void RaiseDeviceChanged

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Platform::String^

id

)

[private]

void RaiseToastAfterDelay

(

int

id,

int

seconds

)

[private]

void ReadBlock_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

ReadBytes

(

)

void ReadBytesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Reader_FrameArrived

(

Windows::Media::Capture::Frames::MediaFrameReader^

reader,

Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^

args

)

[private]

Handles the frame arrived event by converting the frame to a dislayable format and rendering it to the screen.

void ReadFromStreamButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::OrientationSensor^

sender,

Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Compass^

sender,

Windows::Devices::Sensors::CompassReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Altimeter^

sender,

Windows::Devices::Sensors::AltimeterReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Gyrometer^

sender,

Windows::Devices::Sensors::GyrometerReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Inclinometer^

sender,

Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::ProximitySensor^

sender,

Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Accelerometer^

sender,

Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Barometer^

sender,

Windows::Devices::Sensors::BarometerReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Accelerometer^

sender,

Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::LightSensor^

sender,

Windows::Devices::Sensors::LightSensorReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::ActivitySensor^

sender,

Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs^

e

)

[private]

void ReadingChanged

(

Windows::Devices::Sensors::Inclinometer^

sender,

Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^

e

)

[private]

void ReadingChangedOriginal

(

Windows::Devices::Sensors::Accelerometer^

sender,

Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^

e

)

[private]

void ReadingChangedReadingTransform

(

Windows::Devices::Sensors::Accelerometer^

sender,

Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^

e

)

[private]

void ReadLoop

(

Windows::Storage::Streams::DataReader^

dataReader

)

[private]

void ReadMessage

(

)

void ReadOnlyTextBox_ContextMenuOpening

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::ContextMenuEventArgs^

e

)

[private]

Concurrency::task<void> ReadStreamAsync

(

Concurrency::task< Windows::Networking::BackgroundTransfer::DownloadOperation^>

downloadTask,

Windows::Storage::Streams::Buffer^

readBuffer

)

[private]

void ReadTextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ReceiveDataLoop

(

Windows::Networking::Sockets::StreamWebSocket^

activeSocket,

Windows::Storage::Streams::IBuffer^

readBuffer,

UINT32

bytesReceivedSoFar

)

[private]

void Recognize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithoutUI_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithoutUIDictationGrammar_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithoutUIListConstraint_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithoutUIWebSearchGrammar_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithUI_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithUIDictationGrammar_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithUIListConstraint_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RecognizeWithUIWebSearchGrammar_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RefreshButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void refreshMapIcons

(

)

[private]

void RefreshPreview

(

)

[protected]

Helper function used to triger a preview refresh.

void RefreshPreview

(

)

[private]

Helper function used to triger a preview refresh.

void RefreshPreview

(

)

[private]

Helper getter for image showing.

Helper function used to triger a preview refresh

void RefreshTimer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void RefreshWindowButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

)

[private]

void RegisterBackgroundTask

(

Windows::ApplicationModel::Background::DeviceWatcherTrigger^

deviceWatcherTrigger

)

[private]

void RegisterBackgroundTask

(

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterBackgroundTask

(

)

[private]

void RegisterBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterCustomTrigger_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterForAppEvents

(

void

)

[private]

void RegisterForBoundaryEvents

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem

)

[private]

void RegisterForDeviceAccessStatusChange

(

)

[private]

void RegisterForDeviceWatcherEvents

(

void

)

[private]

void RegisterForInputReportEvents

(

)

[private]

void RegisterForInputReportEvents_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

void RegisterForMarkEvents

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem

)

[private]

void RegisterGroupedBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterGroupedBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RegisterMetadataHandlerForMarks

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem,

int

index

)

[private]

void RegisterMetadataHandlerForSentences

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem,

int

index

)

[private]

void RegisterMetadataHandlerForWords

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem,

int

index

)

[private]

void ReleaseAll_Click

(

)

[protected]

void ReleaseButton1_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ReleaseButton2_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ReleaseClaim_Click

(

)

[protected]

void RemoveCredentials_Click

(

Platform::Object^

,

Platform::Object^

)

void RemoveCustomProviders

(

)

[private]

concurrency::task<void> RemoveDeviceAsync

(

Platform::String^

id

)

[private]

Removes a SourceGroup with given id from the collection if it exists.

void RemoveDeviceFromList

(

Platform::String^

deviceId

)

[private]

void RemoveFeedButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RemoveFolderButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RemoveItem

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

void RemoveJumpList_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Render

(

WindowsPreview::Media::Capture::Frames::PoseTrackingFrame^

frame,

CoordinateTransformationMethod^

transformation

)

Renders a pose tracking frame to this canvas.

void RenderPropertyPopUp

(

Platform::String^

pointerProperties,

Platform::String^

deviceSpecificProperties,

Windows::UI::Input::PointerPoint^

currentPoint

)

[private]

Platform::String ReportCalendarData

(

Windows::Globalization::Calendar^

calendar,

Platform::String^

calendarLabel

)

[private]

Platform::String ReportCalendarData

(

Windows::Globalization::Calendar^

calendar,

Platform::String^

calendarLabel

)

[private]

Platform::String ReportCalendarData

(

Windows::Globalization::Calendar^

calendar,

Platform::String^

calendarLabel

)

[private]

Platform::String ReportCalendarData

(

Windows::Globalization::Calendar^

calendar

)

[private]

void ReportColors

(

)

[private]

void ReportContactResult

(

Windows::ApplicationModel::Contacts::Contact^

contact

)

[private]

void ReportContactResults

(

Windows::Foundation::Collections::IVector< Windows::ApplicationModel::Contacts::Contact^>^

contacts

)

[private]

Platform::String ReportLanguageData

(

Windows::Globalization::Language^

lang

)

[private]

Platform::String ReportRegionData

(

Windows::Globalization::GeographicRegion^

region

)

[private]

void RequestCalibration

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

void RequestCalibration

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

void RequestCalibration

(

Windows::Devices::Sensors::MagnetometerAccuracy

accuracy

)

void RequestConsent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static Windows::Foundation::IAsyncOperation<bool> RequestMicrophonePermissionAsync

(

)

[static]

void RequestTextLayoutUpdate

(

)

[private]

void Reset

(

)

[private]

void Reset

(

)

void Reset

(

)

void Reset_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Reset_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void resetButton_Pressed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetButton_Pressed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void resetButton_Pressed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetOutput

(

)

[private]

void ResetOutput

(

)

[private]

void ResetPin_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetRect

(

)

void ResetScenarioState

(

)

[private]

void ResetScenarioState

(

)

[private]

void ResetScenarioState

(

)

[private]

void ResetTheScenarioState

(

)

[private]

void ResetTheScenarioState

(

)

[private]

void ResetTheScenarioState

(

)

[private]

void ResetValuesClick

(

Platform::Object^

,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetValuesClick

(

Platform::Object^

,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetValuesClick

(

Platform::Object^

,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResetValuesClick

(

Object^

,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResizeView_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RestartWatcher

(

)

[private]

void RestoreScrollPosition

(

)

[protected]

void ResultsListView_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ResultsListView_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ResumeAll_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ResumeDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void ResumeLoggingIfApplicable

(

)

void ResumeLoggingIfApplicable

(

)

void RetrieveAllItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RetrieveAllItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RetrieveMatchedItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RetrieveMatchingItems_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void RevealPasswords_Click

(

Platform::Object^

,

Platform::Object^

)

void RollSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void RotationSpeedSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void Run

(

Windows::ApplicationModel::Background::IBackgroundTaskInstance^

taskInstance

)

void RunDownload

(

Windows::Networking::BackgroundTransfer::DownloadOperation^

download

)

[private]

void RunDownloads

(

Windows::Networking::BackgroundTransfer::BackgroundDownloader^

downloader,

ScenarioType

type

)

[private]

Concurrency::task<void> RunDownloadsAsync

(

)

[private]

S1_AddWithAPI

(

)

S2_UpdateAndDeleteWithAPI

(

)

S3_RetrieveWithAPI

(

)

S4_CheckIndexRevision

(

)

S5_AddWithAppContent

(

)

S6_DeleteWithAppContent

(

)

S7_RetrieveWithAppContent

(

)

SampleBackgroundTask

(

)

SampleBackgroundTask

(

)

SampleBackgroundTaskWithCondition

(

)

SampleBackgroundTaskWithCondition

(

)

void SampleButton_Tapped

(

Platform::Object^

sender,

TappedRoutedEventArgs^

e

)

[private]

void Save_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccountProvider^

provider,

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveAccount

(

Windows::Security::Credentials::WebAccount^

account

)

[private]

void SaveFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SaveInternalState

(

_In_ Windows::Foundation::Collections::IPropertySet^

state

)

concurrency::task<Windows::Storage::StorageFile^> SaveLogInMemoryToFileAsync

(

)

[private]

void SaveScrollPosition

(

)

[protected]

void SaveToFutureAccessListButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

SavingDataReason

(

)

void ScalingSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

Scenario

(

Platform::String^

title,

Platform::String^

description,

Platform::String^

className

)

Scenario0_Choose

(

)

Scenario0_Choose

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario1

(

)

Scenario10

(

)

Scenario10

(

)

Scenario10

(

)

Scenario10

(

)

void Scenario10_SearchMultipleResourceIds

(

Windows::ApplicationModel::Resources::Core::ResourceContext^

context,

Platform::Collections::Vector< Platform::String^>^

resourceIds

)

[private]

void Scenario10_ShowCandidates

(

Platform::String^

resourceId,

Windows::Foundation::Collections::IVectorView< Windows::ApplicationModel::Resources::Core::ResourceCandidate^>^

resourceCandidates

)

[private]

void Scenario10Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario11

(

)

Scenario11

(

)

Scenario11

(

)

Scenario11

(

)

void Scenario11Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario12

(

)

Scenario12

(

)

Scenario12

(

)

void Scenario12Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario13

(

)

Windows::Foundation::Rect Scenario1::GetElementRect

(

Windows::UI::Xaml::FrameworkElement^

element

)

[private]

Scenario1_AddAccount

(

)

Scenario1_Advertiser

(

)

Scenario1_Analyze

(

)

Scenario1_AppBarButtons

(

)

Scenario1_BankCards

(

)

Scenario1_Basic

(

)

Scenario1_Basic

(

)

Scenario1_Basic

(

)

Scenario1_Basic

(

)

Scenario1_Basic

(

)

Scenario1_CheckConsentAvailability

(

)

Scenario1_Colors

(

)

Scenario1_Configuration

(

)

Scenario1_Conversion

(

)

Scenario1_CorrelateStreams

(

)

Scenario1_Create

(

)

Scenario1_CreateTPMVSC

(

)

Scenario1_CurrentActivity

(

)

Scenario1_CustomDry

(

)

Scenario1_Data

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_DataEvents

(

)

Scenario1_Default

(

)

Scenario1_DefaultAccount

(

)

Scenario1_DefaultSpacing

(

)

Scenario1_DevicePicker

(

)

Scenario1_DeviceUse

(

)

Scenario1_DisplayDepthColorIR

(

)

Scenario1_Download

(

)

Scenario1_Enable

(

)

Scenario1_EventAndMenuHookup

(

)

Scenario1_Events

(

)

Scenario1_ExtractTextSegments

(

)

Scenario1_FindClaimEnable

(

)

Scenario1_Geotag

(

)

Scenario1_GetAndSetPin

(

)

Scenario1_GetDeviceInformation

(

)

Scenario1_GetLamp

(

)

Scenario1_Launched

(

)

Scenario1_ListView

(

)

Scenario1_LongAndShortFormats

(

)

Scenario1_LowLatency

(

)

Scenario1_LowLatencyInput

(

)

Scenario1_Message

(

)

Scenario1_Metrics

(

)

Scenario1_Mini

(

)

Scenario1_OmnidirectionalSound

(

)

Scenario1_OpenDrawer

(

)

Scenario1_Orientation

(

)

Scenario1_PercentPermilleFormatting

(

)

Scenario1_Prefs

(

)

Scenario1_PreviewSettings

(

)

Scenario1_ReadData

(

)

Scenario1_ReadData

(

)

Scenario1_ReceiptPrinter

(

)

Scenario1_Render

(

)

Scenario1_Save

(

)

Scenario1_SelectDisplay

(

)

Scenario1_SetRecordProfile

(

)

Scenario1_Single

(

)

Scenario1_SingleFile

(

)

Scenario1_SpellingTextSuggestions

(

)

Scenario1_TrialMode

(

)

Scenario1_TrimAndSaveClip

(

)

Scenario1Basic

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Scenario2

(

)

Windows::Foundation::Rect Scenario2::GetTextboxSelectionRect

(

Windows::UI::Xaml::Controls::TextBox^

textbox

)

[private]

Scenario2_AamvaCards

(

)

Scenario2_AppendClips

(

)

Scenario2_CardioidSound

(

)

Scenario2_ChangePin

(

)

Scenario2_CloseDrawer

(

)

Scenario2_ConcurrentProfile

(

)

Scenario2_Connector

(

)

Scenario2_Custom

(

)

Scenario2_DecimalFormatting

(

)

Scenario2_DelayMini

(

)

Scenario2_DeviceWatcher

(

)

Scenario2_Disable

(

)

Scenario2_Display

(

)

Scenario2_DisplayText

(

)

Scenario2_DragUICustomization

(

)

Scenario2_EnableSettings

(

)

Scenario2_Extend

(

)

Scenario2_FindAvailableSourceGroups

(

)

Scenario2_GetCurrentTextSegmentFromIndex

(

)

Scenario2_History

(

)

Scenario2_History

(

)

Scenario2_Icons

(

)

Scenario2_InAppPurchase

(

)

Scenario2_Lang

(

)

Scenario2_Launch

(

)

Scenario2_Launch

(

)

Scenario2_Listen

(

)

Scenario2_Load

(

)

Scenario2_Manage

(

)

Scenario2_ManageAccount

(

)

Scenario2_MessageCaption

(

)

Scenario2_Msa

(

)

Scenario2_MultiFile

(

)

Scenario2_Multiple

(

)

Scenario2_oAuthFacebook

(

)

Scenario2_PhotoSettings

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Polling

(

)

Scenario2_Prediction

(

)

Scenario2_PrintReceipt

(

)

Scenario2_Remove

(

)

Scenario2_RequestConsent

(

)

Scenario2_ScopedViews

(

)

Scenario2_ShakeEvents

(

)

Scenario2_Stats

(

)

Scenario2_StringTemplate

(

)

Scenario2_UniformSpacing

(

)

Scenario2_Upload

(

)

Scenario2_VideoChat

(

)

Scenario2StandardOptions

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3

(

)

Scenario3_Aad

(

)

Scenario3_Add

(

)

Scenario3_AddAudioTracks

(

)

Scenario3_AspectRatio

(

)

Scenario3_AvailabilityChanged

(

)

Scenario3_BackgroundDeviceWatcher

(

)

Scenario3_Calibration

(

)

Scenario3_Calibration

(

)

Scenario3_Calibration

(

)

Scenario3_ChangeEvents

(

)

Scenario3_CredentialPickerOptions

(

)

Scenario3_CurrencyFormatting

(

)

Scenario3_CurrentStepCount

(

)

Scenario3_CustomDecay

(

)

Scenario3_CustomItems

(

)

Scenario3_DisplayOnOff

(

)

Scenario3_EnableHdrProfile

(

)

Scenario3_Enum

(

)

Scenario3_Events

(

)

Scenario3_FixAccount

(

)

Scenario3_Full

(

)

Scenario3_MultipleClaims

(

)

Scenario3_MultipleDrawers

(

)

Scenario3_Notifications

(

)

Scenario3_ParameterizedTemplate

(

)

Scenario3_Polling

(

)

Scenario3_Porting

(

)

Scenario3_ProportionalSpacing

(

)

Scenario3_Region

(

)

Scenario3_ResetPin

(

)

Scenario3_ReverseConversion

(

)

Scenario3_SingleFolder

(

)

Scenario3_StartDragAsync

(

)

Scenario3_Trim

(

)

Scenario3_UnmanagedConsumable

(

)

Scenario3_UsingWindows

(

)

void Scenario3Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario3CustomOptions

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

Scenario4

(

)

void Scenario4::RecoButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario4_AddOverlays

(

)

Scenario4_AddOverlays

(

)

Scenario4_BackgroundActivity

(

)

Scenario4_BackgroundProximitySensor

(

)

Scenario4_BackgroundTask

(

)

Scenario4_ChangeAdminKey

(

)

Scenario4_ChangeSystemGroup

(

)

Scenario4_CompletionGroups

(

)

Scenario4_ConsumableProduct

(

)

Scenario4_Control

(

)

Scenario4_Input

(

)

Scenario4_ManyProviders

(

)

Scenario4_NumberParsing

(

)

Scenario4_OrientationChanged

(

)

Scenario4_Override

(

)

Scenario4_Remove

(

)

Scenario4_SaveFile

(

)

Scenario4_Snapshot

(

)

Scenario4_UnicodeExtensions

(

)

Scenario4_UpdatingLineDisplayAttributes

(

)

Scenario4PageRange

(

)

Scenario5

(

)

Scenario5

(

)

Scenario5

(

)

Scenario5

(

)

Scenario5

(

)

Scenario5

(

)

concurrency::task<void> Scenario5::nearbyStreetside

(

Windows::Devices::Geolocation::Geopoint^

spaceNeedlePoint

)

[private]

void Scenario5::OnSizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

Scenario5_Clear

(

)

Scenario5_DataEventsBatching

(

)

Scenario5_DefiningCustomGlyphs

(

)

Scenario5_GetSingleDevice

(

)

Scenario5_IsSupported

(

)

Scenario5_ManyProvidersManyAccounts

(

)

Scenario5_Multiple

(

)

Scenario5_RandomAccess

(

)

Scenario5_RoundingAndPadding

(

)

Scenario5_TimeZone

(

)

Scenario5_TriggerCFU

(

)

Scenario5_UnicodeExtensions

(

)

Scenario5_UserCollection

(

)

Scenario5_VerifyResponse

(

)

void Scenario5Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario5Photos

(

)

Scenario6

(

)

Scenario6

(

)

Scenario6

(

)

Scenario6

(

)

Scenario6_AppListingURI

(

)

Scenario6_CustomFilterAddedProps

(

)

Scenario6_CustomProvider

(

)

Scenario6_DeleteTPMVSC

(

)

Scenario6_ManipulatingCursorAttributes

(

)

Scenario6_NumeralSystemTranslation

(

)

Scenario6_RecoverableErrors

(

)

Scenario6_Styling

(

)

Scenario6_TimeZone

(

)

Scenario6DisablePreview

(

)

Scenario7

(

)

Scenario7

(

)

Scenario7

(

)

Scenario7

(

)

Scenario7_B2B

(

)

Scenario7_CustomContent

(

)

Scenario7_DeviceInformationKind

(

)

Scenario7_DownloadReordering

(

)

bool Scenario7_DownloadReordering::IsWebException

(

Platform::String^

title,

Platform::Exception^

ex,

Windows::Networking::BackgroundTransfer::DownloadOperation^

download = nullptr

)

[private]

Scenario7_ListSmartCards

(

)

Scenario7_ScrollingContentUsingMarquee

(

)

Scenario7_UsingUnicodeExtensions

(

)

void Scenario7Button_Show_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Scenario8

(

)

Scenario8

(

)

Scenario8

(

)

Scenario8

(

)

void Scenario8::LanguageOverrideCombo_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

Scenario8_PairDevice

(

)

Scenario8_Reflow

(

)

Scenario8_Transmit

(

)

Scenario9

(

)

Scenario9

(

)

Scenario9

(

)

Scenario9_CustomPairDevice

(

)

Scenario_CloudFontOverview

(

)

Scenario_CloudFontOverview

(

)

Scenario_ContinuousDictation

(

)

Scenario_ContinuousRecognitionListGrammar

(

)

Scenario_ContinuousRecognitionSRGSGrammar

(

)

Scenario_Document1

(

)

Scenario_Document1

(

)

Scenario_Document2

(

)

Scenario_Document2

(

)

Scenario_Document3

(

)

Scenario_Document3

(

)

Scenario_ListConstraint

(

)

Scenario_PauseAsync

(

)

Scenario_PredefinedDictationGrammar

(

)

Scenario_PredefinedWebSearchGrammar

(

)

Scenario_SampleOverview

(

)

Scenario_SampleOverview

(

)

Scenario_SRGSConstraint

(

)

Scenario_SynthesizeSSML

(

)

Scenario_SynthesizeText

(

)

Scenario_SynthesizeTextBoundaries

(

)

void ScenarioControl_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ScenarioControl_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

)

[protected]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioDisable

(

)

[protected]

void ScenarioDisableReadingChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

)

[protected]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnable

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEnableReadingChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEndReadButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioEndReadButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGet

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGetActivityHistory

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGetCurrentActivity

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGetData

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGetData

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioGetData

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioRegisterTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioRegisterTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioRegisterTask_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioStartReadButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioStartReadButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioUnregisterTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioUnregisterTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScenarioUnregisterTask_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ScrollViewer_ViewChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^

args

)

[private]

void SDKTemplate::Scenario1_Advertiser::OnConnectionStatusChanged

(

Windows::Devices::WiFiDirect::WiFiDirectDevice^

sender,

Platform::Object^

arg

)

[private]

void SearchButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

SecondaryPage

(

)

void SecureBootState_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SeekDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void SelectButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectDeviceInList

(

Platform::String^

deviceIdToSelect

)

[private]

void SelectFilesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectImageButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectImageButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectImageButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectionSegmentButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectionSegmentsButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SelectItem

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

void SelectLayer

(

Windows::UI::Xaml::Controls::Maps::MapElementsLayer^

layer

)

[private]

task<void> SelectPreferredCameraStreamSettingAsync

(

Windows::Media::Capture::MediaStreamType

mediaStreamType,

VideoSettingsFilter^

settingsFilterFunc

)

[private]

Function allows to select camera settings.

Parameters:

mediaStreamType

Type of a the media stream.

mediaStreamType

Function which will be called to filter the correct settings.

void SelectPreviouslySelectedItem

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

Concurrency::task<void> SendAsync

(

)

[private]

Concurrency::task<void> SendAsync

(

)

[private]

void SendBooleanOutputReport_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

Concurrency::task<void> SendBooleanOutputReportAsync

(

bool

bitValue,

uint8

buttonNumber

)

[private]

void SendDataLoop

(

Windows::Networking::Sockets::StreamWebSocket^

activeSocket,

Windows::Storage::Streams::IBuffer^

sendBuffer,

UINT32

bytesSentSoFar

)

[private]

void SendNumericOutputReport_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

Concurrency::task<void> SendNumericOutputReportAsync

(

uint8

valueToWrite

)

[private]

void SendTextMessage

(

)

[protected]

ServiceViewModel

(

)

[private]

void ServiceViewModel::ResumeMeteringService

(

Object^

,

Object^

)

[private]

void ServiceViewModel::SuspendMeteringService

(

Object^

,

Windows::ApplicationModel::SuspendingEventArgs^

)

[private]

ServicingCompleteTask

(

)

ServicingCompleteTask

(

)

void SessionRevoked

(

Platform::Object^

sender,

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^

args

)

[private]

void SessionRevoked

(

Platform::Object^

sender,

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^

args

)

[private]

void SessionRevoked

(

Platform::Object^

sender,

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^

args

)

[private]

static void SetAppLocalSettingsValue

(

Platform::String^

key,

Platform::Object^

value

)

[inline, static, private]

Definition at line 66 of file FileLoggingSessionScenario.h.
        {
            if (Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key))
            {
                Windows::Storage::ApplicationData::Current->LocalSettings->Values->Remove(key);
            }
            Windows::Storage::ApplicationData::Current->LocalSettings->Values->Insert(key, value);
        }
static void SetAppLocalSettingsValue

(

Platform::String^

key,

Platform::Object^

value

)

[inline, static, private]

Definition at line 66 of file LoggingSessionScenario.h.
        {
            if (Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key))
            {
                Windows::Storage::ApplicationData::Current->LocalSettings->Values->Remove(key);
            }
            Windows::Storage::ApplicationData::Current->LocalSettings->Values->Insert(key, value);
        }
void SetBusy

(

bool

value

)

[private]

void SetBusy

(

bool

value

)

[private]

void SetBusy

(

bool

value

)

[private]

void SetBusy

(

bool

value

)

[private]

void SetCancelButton

(

bool

isEnabled

)

[private]

void SetCancelButton

(

bool

isEnabled

)

[private]

void SetCancelButton

(

bool

isEnabled

)

[private]

void SetCanvasSize

(

)

[private]

void SetClaimedUI

(

CashDrawerInstance

instance

)

[private]

void SetDefaultButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SetDefaultRecognizerByCurrentInputMethodLanguageTag

(

)

[private]

void SetDefaultStyleCombobox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void SetError

(

Platform::String^

errorText

)

[private]

SetErrorMessage

(

)

void SetGeotagButton_Click

(

)

[protected]

void SetGeotagFromGeolocatorButton_Click

(

)

[protected]

void SetItemInvokedCallback

(

Windows::UI::Input::RadialControllerMenuItem^

menuItem,

unsigned int

index

)

[private]

void SetLayoutWidth

(

float

width

)

void SetLedBlinkPattern_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> SetLedBlinkPatternAsync

(

uint8

pattern

)

[private]

SetLockScreenImage

(

)

void SetMapProjection

(

)

[private]

void SetMapStyle

(

)

[private]

void SetMapStyleSheet

(

)

[private]

void SetMargins

(

Platform::String^

marginsValue

)

[private]

Helper function used to set the top and left margins based on used selection.

Parameters:

marginsValue

The Id of the option selected by the user

void SetMinimumSize_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SetOutputFileButton

(

bool

isEnabled

)

[private]

void SetOutputFileButton

(

bool

isEnabled

)

[private]

void SetPasswordExplainVisibility

(

bool

isShown

)

[private]

void SetPickFileButton

(

bool

isEnabled

)

[private]

void SetPickFileButton

(

bool

isEnabled

)

[private]

void SetPickFileButton

(

bool

isEnabled

)

[private]

void SetPinHigh_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void SetPinLow_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

task<void> SetPreviewRotationAsync

(

)

[private]

bool SetRecognizerByName

(

Platform::String^

recognizerName

)

[private]

void SetReleasedUI

(

CashDrawerInstance

instance

)

[private]

void SetResult

(

Windows::Security::Credentials::UI::CredentialPickerResults^

res

)

[private]

void SetResult

(

Windows::Security::Credentials::UI::CredentialPickerResults^

res

)

[private]

void SetResult

(

Windows::Security::Credentials::UI::CredentialPickerResults^

res

)

[private]

void SetSamplePeriod

(

int

rate

)

void SetStyleSheetStateCombobox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SetTranscodeButton

(

bool

isEnabled

)

[private]

void SetTranscodeButton

(

bool

isEnabled

)

[private]

void SetTranscodeButton

(

bool

isEnabled

)

[private]

void SetUpAccounts

(

)

[private]

void SetValuesFromLineDisplay

(

)

[private]

void Shaken

(

Windows::Devices::Sensors::Accelerometer^

sender,

Windows::Devices::Sensors::AccelerometerShakenEventArgs^

e

)

[private]

ShareApplicationLink

(

)

ShareCustomData

(

)

ShareCustomProvider

(

)

ShareDelayRenderedFiles

(

)

ShareFiles

(

)

ShareHtml

(

)

ShareImage

(

)

ShareText

(

)

ShareWebLink

(

)

void ShareWebView_NavigationCompleted

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::WebViewNavigationCompletedEventArgs^

e

)

[private]

void ShowContactCard_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowContactCard_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowContactCard_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowContactCardWithOptions_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowContactCardWithPlacement_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowDevicePicker

(

bool

pickSingle

)

[private]

void ShowDevicePickerButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowGuidance

(

)

[private]

void ShowGuidance

(

)

[private]

void ShowGuidance

(

)

[private]

void ShowGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowGuidanceButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowListButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowPairingPanel

(

Platform::String^

text,

Windows::Devices::Enumeration::DevicePairingKinds

pairingKind

)

[private]

Windows::UI::Xaml::Visibility ShowPlaceholder

(

unsigned int

count

)

void ShowPropertiesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void ShowResults_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void showSpaceNeedleButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowStandardSystemOverlaysButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void showStreetSideNearSpaceneedle_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ShowText

(

)

void ShowTrialPeriodInformation

(

)

void SignalBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SignalBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

SignIn

(

)

concurrency::task<void> SignInPassportAsync

(

bool

passportIsPrimaryLogin

)

[private]

concurrency::task<bool> SignInPasswordAsync

(

bool

calledFromPassport

)

[private]

SimpleLogger

(

Windows::UI::Xaml::Controls::TextBlock^

textBlock

)

[inline]

Definition at line 19 of file SimpleLogger.h.
        {
            m_textBlock = textBlock;
            m_dispatcher = textBlock->Dispatcher;
        }
SimpleLogger

(

Windows::UI::Xaml::Controls::TextBlock^

textBlock

)

[inline]

Definition at line 19 of file SimpleLogger.h.
        {
            m_textBlock = textBlock;
            m_dispatcher = textBlock->Dispatcher;
        }
void SingleSpace_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

SkeletalFrameRenderer

(

)

void Sleep

(

int

time

)

[private]

void Slider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void slider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SlowPhasing_Checked

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SlowPhasing_UnChecked

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

SocketReaderWriter

(

Windows::Networking::Sockets::StreamSocket^

socket,

SDKTemplate::MainPage^

mainPage

)

[inline]

Definition at line 26 of file SocketReaderWriter.h.
                                                                                :
            _streamSocket(socket),
            _rootPage(mainPage)
        {
            _socketReader = ref new Windows::Storage::Streams::DataReader(socket->InputStream);
            _socketReader->UnicodeEncoding = Windows::Storage::Streams::UnicodeEncoding::Utf8;
            _socketReader->ByteOrder = Windows::Storage::Streams::ByteOrder::LittleEndian;

            _socketWriter = ref new Windows::Storage::Streams::DataWriter(socket->OutputStream);
            _socketWriter->UnicodeEncoding = Windows::Storage::Streams::UnicodeEncoding::Utf8;
            _socketWriter->ByteOrder = Windows::Storage::Streams::ByteOrder::LittleEndian;

            _currentMessage = nullptr;
        }
void SourceComboBox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

Called when a source is selected.

Sets the FormatCombobox item source based on the selected source.

void SourceGrid_DragStarting

(

Windows::UI::Xaml::UIElement^

sender,

Windows::UI::Xaml::DragStartingEventArgs^

args

)

[private]

SourceGroupCollection

(

Windows::UI::Core::CoreDispatcher^

uiDispatcher

)

void SourceListView_DragItemsStarting

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^

e

)

[private]

void SourcePositionX_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourcePositionX_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourcePositionY_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourcePositionY_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourcePositionZ_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourcePositionZ_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void SourceTextBlock_DragStarting

(

Windows::UI::Xaml::UIElement^

sender,

Windows::UI::Xaml::DragStartingEventArgs^

args

)

[private]

void SourceTextBlock_PointerMoved

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void Speak_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Speak_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void Speak_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SpecificHistory_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SpeechRecognizer_HypothesisGenerated

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognitionHypothesisGeneratedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

void SpeechRecognizer_StateChanged

(

Windows::Media::SpeechRecognition::SpeechRecognizer^

sender,

Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs^

args

)

[private]

StandardOptionsPrintHelper

(

Page^

scenarioPage

)

[inline]

Definition at line 13 of file Scenario2StandardOptions.xaml.h.
: PrintHelper(scenarioPage) { }
static void Start

(

Windows::ApplicationModel::Background::IBackgroundTaskInstance^

taskInstance

)

[static]

Concurrency::task<void> StartAsync

(

)

[private]

void StartButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Called when use clicks the Start button.

void StartButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

task<void> StartCameraAsync

(

)

[private]

void StartDeviceWatcher

(

void

)

[private]

void StartDeviceWatchers

(

void

)

[private]

void StartDownload

(

Windows::Storage::StorageFile^

destinationFile,

Windows::Networking::BackgroundTransfer::BackgroundDownloader^

downloader,

Windows::Foundation::Uri^

source

)

[private]

void StartDownload

(

Windows::Networking::BackgroundTransfer::BackgroundTransferPriority

priority

)

[private]

void StartDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void StartDownload_Click

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[protected]

void StartDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Concurrency::task<void> StartDownloadAndReadContentsAsync

(

)

[private]

void StartDownloadsButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartHandlingAppEvents

(

void

)

[private]

void StartHighPriorityDownload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartInterruptMessageWorker

(

Windows::Devices::Custom::CustomDevice^

fx2Device

)

[private]

Concurrency::task<void> StartLocationTrackingAsync

(

)

[private]

void StartLogging

(

)

void StartLogging

(

)

void StartMetering

(

int

sampleRate

)

void StartMultipartUpload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

task<void> StartPreviewAsync

(

)

[private]

void StartProcessingDataVirtualizationScrollOffsets

(

double

actualHeight

)

[private]

concurrency::task<void> StartReaderAsync

(

)

[private]

Starts reading frames from the current reader.

Must be called from the UI thread.

void StartReceiveData

(

Windows::Networking::Sockets::StreamWebSocket^

activeSocket

)

[private]

task<void> StartRecordingAsync

(

Windows::Media::MediaProperties::MediaEncodingProfile^

mediaEncodingProfile

)

[private]

Begins recording.

Parameters:

mediaEncodingProfile

Encoding profile which should be used for the recording session.

task<void> StartRecordingToCustomSink

(

)

[private]

task<void> StartRecordingToCustomSinkAsync

(

)

[private]

void StartScenario

(

)

[private]

void StartScenario

(

)

[private]

concurrency::task<void> StartScenarioAsync

(

)

[private]

concurrency::task<void> StartScenarioAsync

(

)

[private]

void StartScrollingButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartSendData

(

Windows::Networking::Sockets::StreamWebSocket^

activeSocket

)

[private]

Concurrency::task<bool> StartSensorBackgroundTaskAsync

(

Platform::String^

deviceId

)

[private]

void StartStopScenario_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void StartStopScenario_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void StartStopScenario_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void StartStopScenario_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

void StartStrokeSelection

(

Windows::Foundation::Point

position

)

[private]

void StartSuperMuttInputReports

(

void

)

[private]

void StartUpload_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

)

[private]

void StartWatcher

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher

)

void StartWatcher

(

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StartWatchers

(

)

[private]

Concurrency::task<void> StopAllScrollingAsync

(

)

[private]

void StopAnimationTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

Concurrency::task<void> StopAsync

(

)

[private]

void StopButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Called when use clicks the Stop button.

void StopButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopDeviceWatcher

(

void

)

[private]

void StopDeviceWatchers

(

void

)

[private]

void StopHandlingAppEvents

(

void

)

[private]

void StopMetering

(

)

void StopPlayers

(

)

[private]

void StopPlayers

(

)

[private]

void StopPlayers

(

)

[private]

task<void> StopPreviewAsync

(

)

[private]

concurrency::task<void> StopReaderAsync

(

)

[private]

Stops reading from the frame reader, disposes of the reader and updates the button state.

task<void> StopRecordingAsync

(

)

[private]

Stops recording.

void StopReplay

(

)

[private]

void StopScenario

(

)

[private]

void StopScenario

(

)

[private]

void StopScenario

(

)

[private]

void StopScenario

(

)

[private]

void StopScrollingButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopSuperMuttInputReports

(

void

)

[private]

void StopWatcher

(

)

[private]

void StopWatcher

(

)

[private]

void StopWatcher

(

)

[private]

void StopWatcher

(

)

[private]

void StopWatcher

(

)

[private]

void StopWatcher

(

)

void StopWatcher

(

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatcherButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StopWatchers

(

bool

reset = false

)

[private]

IAsyncAction streaming_latencyModeToggled

(

)

[private]

IAsyncAction streaming_previewButtonClicked

(

)

[private]

IAsyncAction streaming_recordingStarted

(

)

[private]

StreamResolutionHelper

(

Windows::Media::MediaProperties::IMediaEncodingProperties^

encodingProperties

)

Platform::String StringFromDouble

(

double

)

[private]

void StrokeEvent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void StrokeInput_StrokeStarted

(

Windows::UI::Input::Inking::InkStrokeInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void styleCombobox_SelectionChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::SelectionChangedEventArgs^

e

)

[private]

void SuccessfulSignIn

(

Account^

account

)

[private]

static void Swap

(

T &

v1,

T &

v2

)

[static, private]

Generic swap of 2 values.

Template Parameters:

T

typename

Parameters:

v1

Value 1

v2

Value 2

SymbologyListEntry

(

UINT

symbologyId,

bool

symbologyEnabled

)

[inline]

Definition at line 118 of file SampleConfiguration.h.
        {
            id = symbologyId;
            enabled = symbologyEnabled;
        }
SymbologyListEntry

(

UINT

symbologyId

)

[inline]

Definition at line 116 of file SampleConfiguration.h.
: SymbologyListEntry(symbologyId, true) { }
Concurrency::task<void> SynthesizeSSMLStream

(

)

[private]

Concurrency::task<void> SynthesizeTextStream

(

)

[private]

void SystemGroup_Frequent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SystemGroup_None_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void SystemGroup_Recent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void target_DoubleTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs^

e

)

[private]

void target_Holding

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::HoldingRoutedEventArgs^

e

)

[private]

void target_PointerEntered

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void target_PointerExited

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void target_PointerPressed

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void target_PointerReleased

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::PointerRoutedEventArgs^

e

)

[private]

void target_RightTapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^

e

)

[private]

void target_Tapped

(

Platform::Object^

sender,

Windows::UI::Xaml::Input::TappedRoutedEventArgs^

e

)

[private]

void TargetListView_DragItemsCompleted

(

Windows::UI::Xaml::Controls::ListViewBase^

sender,

Windows::UI::Xaml::Controls::DragItemsCompletedEventArgs^

args

)

[private]

void TargetListView_DragItemsStarting

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^

e

)

[private]

void TargetListView_DragOver

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetListView_Drop

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetTextBlock_DragEnter

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetTextBlock_Drop

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetTextBox_DragEnter

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetTextBox_DragLeave

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

void TargetTextBox_Drop

(

Platform::Object^

sender,

Windows::UI::Xaml::DragEventArgs^

e

)

[private]

Templates

(

)

static Windows::UI::Xaml::Media::SolidColorBrush TextColor

(

Windows::UI::Color

c

)

[static]

void TextLayoutFrame_SizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void TextLayoutFrame_SizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void TextLayoutFrame_SizeChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::SizeChangedEventArgs^

e

)

[private]

void TextServiceManager_InputLanguageChanged

(

Windows::UI::Text::Core::CoreTextServicesManager^

sender,

Platform::Object^

args

)

[private]

void TileNotificationButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void timedMetadataTrackChangedHandler

(

Windows::Media::Playback::MediaPlaybackItem^

mediaPlaybackItem,

Windows::Foundation::Collections::IVectorChangedEventArgs^

args

)

[private]

void Timer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void Timer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

void Timer_Tick

(

Platform::Object^

sender,

Platform::Object^

e

)

[private]

TimeTriggeredTask

(

)

TimeTriggeredTask

(

)

void ToastNotificationButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static Platform::String ToCustomStyleEntryState

(

MapIconState

state

)

[static, private]

static Platform::String ToDefaultStyleEntryState

(

MapIconState

state

)

[static, private]

void Toggle_Custom

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToggleDepth_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToggleFullScreenModeButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToggleFullScreenModeButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToggleLogs

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToggleMenuSuppression

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

args

)

[private]

void ToggleSkeletons_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String ToHex

(

byte

value

)

[private]

void TongueButton_Click

(

_In_ Platform::Object^

sender,

_In_ Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ToolButton_Lasso

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TouchInking_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TouchInking_Unchecked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TouchInkingCheckBox_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TouchInkingCheckBox_Unchecked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TrafficFlowVisible_Checked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void trafficFlowVisibleCheckBox_Unchecked

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeCancel

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeCancel

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeCancel

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeCustom

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeError

(

Platform::String^

error

)

[private]

void TranscodeError

(

Platform::String^

error

)

[private]

void TranscodeError

(

Platform::String^

error

)

[private]

void TranscodeFailure

(

Windows::Media::Transcoding::TranscodeFailureReason

reason

)

[private]

void TranscodeFailure

(

Windows::Media::Transcoding::TranscodeFailureReason

reason

)

[private]

void TranscodeFailure

(

Windows::Media::Transcoding::TranscodeFailureReason

reason

)

[private]

void TranscodePreset

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TranscodeProgress

(

Windows::Foundation::IAsyncActionWithProgress< double >^

asyncInfo,

double

percent

)

[private]

void TranscodeProgress

(

Windows::Foundation::IAsyncActionWithProgress< double >^

asyncInfo,

double

percent

)

[private]

void TranscodeProgress

(

Windows::Foundation::IAsyncActionWithProgress< double >^

asyncInfo,

double

percent

)

[private]

void TranscodeTrim

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TransferData

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

static Windows::Graphics::Imaging::SoftwareBitmap TransformBitmap

(

Windows::Graphics::Imaging::SoftwareBitmap^

inputBitmap,

TransformScanline

pixelTransformation

)

[static, private]

Transforms pixels of inputBitmap to an output bitmap using the supplied pixel transformation method.

Returns nullptr if translation fails.

void Transmit_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void TrimClip_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

bool TryCreateDownloadAsync

(

Windows::Networking::BackgroundTransfer::BackgroundDownloader^

downloader,

UINT8

delaySeconds,

Platform::String^

fileNameSuffix,

ScenarioType

type,

Platform::Collections::Vector< Windows::Networking::BackgroundTransfer::DownloadOperation^>^

downloadOperations,

Concurrency::task< void > &

resultTask

)

[private]

concurrency::task<bool> TryInitializeCaptureAsync

(

)

[private]

Initialize the media capture object.

Must be called from the UI thread.

concurrency::task<bool> TryInitializeMediaCaptureAsync

(

Windows::Media::Capture::Frames::MediaFrameSourceGroup^

group

)

[private]

Initialize the media capture object.

Must be called from the UI thread.

concurrency::task<bool> TryInitializeMediaCaptureAsync

(

Windows::Media::Capture::Frames::MediaFrameSourceGroup^

group

)

[private]

Initialize the media capture object.

Must be called from the UI thread.

void UndeferElementClick

(

Platform::Object^

,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnlockScenarioChange

(

)

[private]

void UnlockScenarioChange

(

)

[private]

void UnpairButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnpairButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnprocessedEvent_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnprocessedInput_PointerEntered

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInput_PointerEntered1

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInput_PointerMoved

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInput_PointerPressed

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInput_PointerReleased

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerEntered

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerExited

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerHovered

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerLost

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerMoved

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerPressed

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnprocessedInputOnPointerReleased

(

Windows::UI::Input::Inking::InkUnprocessedInput^

sender,

Windows::UI::Core::PointerEventArgs^

args

)

[private]

void UnregisterBackgroundTask

(

Windows::ApplicationModel::Background::IBackgroundTaskRegistration^

taskReg

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterBackgroundTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnRegisterBtn_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterCustomTrigger_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterFromAppEvents

(

void

)

[private]

void UnregisterFromDeviceAccessStatusChange

(

)

[private]

void UnregisterFromDeviceWatcherEvents

(

void

)

[private]

void UnregisterFromInputReportEvent

(

void

)

[private]

void UnregisterFromInputReportEvents_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

eventArgs

)

[private]

void UnregisterGroupedTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterGroupedTask

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterTask

(

)

[private]

void UnregisterUngroupedTasks

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UnregisterUngroupedTasks

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

UnspecifiedReason

(

)

void UpdateAvailableLanguages

(

)

[private]

void UpdateButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateButtons

(

)

[private]

void UpdateButtons

(

)

[private]

concurrency::task<void> UpdateButtonStateAsync

(

)

[private]

Updates the state of the start and stop buttons, based on the current App Model.

void UpdateColors

(

)

[private]

void UpdateConnectDisconnectButtonsAndList

(

bool

enableConnectButton

)

[private]

void UpdateContent

(

)

[private]

void UpdateContent

(

)

[private]

void UpdateContent

(

)

[private]

void UpdateContent

(

)

[private]

void UpdateControls

(

)

[private]

void UpdateControls

(

)

[private]

void UpdateControls

(

)

[private]

void UpdateCurrentAppLanguageMessage

(

)

[private]

void UpdateEventRegistration

(

bool

registerForEvents

)

[private]

void UpdateFrameSource

(

)

[private]

void UpdateFullScreenModeStatus

(

)

[private]

void UpdateGlyphBitmapImage

(

)

[private]

void UpdateHeaderText

(

)

[private]

void UpdateLayoutMetrics

(

)

[private]

void UpdateLocalClientWindow

(

)

[private]

static void UpdateMapElementOnClick

(

Windows::UI::Xaml::Controls::Maps::MapElement^

mapElement,

MapIconStateToStyleEntryState

toStyleEntryState

)

[static, private]

static void UpdateMapElementOnPointerEntered

(

Windows::UI::Xaml::Controls::Maps::MapElement^

mapElement,

MapIconStateToStyleEntryState

toStyleEntryState

)

[static, private]

static void UpdateMapElementOnPointerExited

(

Windows::UI::Xaml::Controls::Maps::MapElement^

mapElement,

MapIconStateToStyleEntryState

toStyleEntryState

)

[static, private]

void UpdateMessageLog

(

LogEventAction

action

)

[private]

void UpdateName_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdatePairingButtons

(

)

[private]

void UpdatePairingButtons

(

)

[private]

void UpdatePositionAndVisibility

(

)

[private]

void UpdatePropertyHelper

(

Platform::String^

itemKey,

Platform::String^

propertyKey,

Platform::String^

propertyName,

Platform::Object^

newValue

)

[private]

void UpdateProps

(

Rect

boundingBox

)

[private]

void UpdateRegisterButton

(

)

[private]

void UpdateRegisterEventButtons

(

void

)

[private]

void UpdateRunningAverageContainerHeight

(

Windows::UI::Xaml::Controls::ListViewBase^

sender,

Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^

args

)

[private]

void UpdateScalingAndOrder

(

)

[private]

void UpdateSSMLText

(

)

[private]

void UpdateStartStopButtons

(

void

)

[private]

void UpdateStatus

(

)

[private]

void UpdateStatusOutput

(

Windows::Devices::PointOfService::CashDrawerStatusKind

status

)

[private]

void UpdateSwitchStateTable

(

Platform::Array< bool >^

SwitchStateArray

)

[private]

void UpdateTextLayout

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

Enable and disable the stream toggle buttons and set their output message if they are disabled.

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUI

(

)

[private]

void UpdateUIAsync

(

Platform::String^

status

)

[private]

void UpdateUIAsync

(

Platform::String^

status

)

[private]

void UpdateUIAsync

(

Platform::String^

status

)

[private]

void UpdateValuesClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateValuesClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateValuesClick

(

Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateValuesClick

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void UpdateVisualState

(

)

[private]

void UpdateVisualState

(

)

[private]

void UpdateVisualState

(

)

[private]

void UpdateVisualState

(

)

[private]

void UpdateWordBoxTransform

(

)

[private]

void UpdateWordBoxTransform

(

)

[private]

Concurrency::task<void> UploadMultipleFilesAsync

(

Windows::Foundation::Uri^

uri,

Windows::Foundation::Collections::IVectorView< Windows::Storage::StorageFile^>^

files

)

[private]

void UploadProgress

(

Windows::Foundation::IAsyncOperationWithProgress< Windows::Networking::BackgroundTransfer::UploadOperation^, Windows::Networking::BackgroundTransfer::UploadOperation^>^

operation,

Windows::Networking::BackgroundTransfer::UploadOperation^

)

[private]

Concurrency::task<void> UploadSingleFileAsync

(

Windows::Foundation::Uri^

uri,

Windows::Storage::IStorageFile^

file

)

[private]

void UseCustomColors_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs

e

)

[inline, private]

Definition at line 29 of file Scenario1_Colors.xaml.h.
        {
            UpdateColors();
        }
void UseInertia

(

bool

inertia

)

void UseMinimalOverlaysCheckBox_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

UserDataAccountViewModel

(

Windows::ApplicationModel::UserDataAccounts::UserDataAccount^

account

)

[inline]

Definition at line 49 of file SampleConfiguration.h.
                                                                                :
            account(account)
        {
        }
void UserLanguageToggle_Toggled

(

Platform::Object^

sender,

RoutedEventArgs^

e

)

[private]

UserSelect

(

)

Windows::Foundation::Uri ValidateAndGetUri

(

Platform::String^

uriString

)

[private]

void ValidatePageRangeOption

(

Windows::Graphics::Printing::OptionDetails::PrintPageRangeOptionDetails^

pageRangeOption

)

[protected]

Deals with validating that the Page Ranges only contain pages that are present in the document.

This is not necessary and some apps don't do this validation. Instead, they just ignore the pages that are not present in the document and simply don't print them.

Parameters:

pageRangeOption

The PrintPageRangeOptionDetails option

void verifyButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void VerifyResponse_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Platform::String VersionString

(

Windows::ApplicationModel::PackageVersion

version

)

[private]

void VideoButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void VideoPlaybackErrorHandler

(

Platform::Object^

sender,

Windows::UI::Xaml::ExceptionRoutedEventArgs^

e

)

[private]

void VideoSettings_Changed

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void ViewPage

(

)

void VisibilityChanged

(

Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[protected]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

void WaitForDrawerCloseButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

IAsyncAction waiting_previewButtonClicked

(

)

[private]

void Watcher_Added

(

Windows::Devices::Enumeration::DeviceWatcher^

watcher,

Windows::Devices::Enumeration::DeviceInformation^

deviceInformation

)

[private]

void Watcher_DeviceAdded

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformation^

deviceInfo

)

[private]

void Watcher_DeviceRemoved

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInfoUpdate

)

[private]

void Watcher_DeviceUpdated

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Windows::Devices::Enumeration::DeviceInformationUpdate^

deviceInfoUpdate

)

[private]

void Watcher_EnumerationCompleted

(

Windows::Devices::Enumeration::DeviceWatcher^

watcher,

Platform::Object^

e

)

[private]

void Watcher_EnumerationCompleted

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Platform::Object^

e

)

[private]

void Watcher_Stopped

(

Windows::Devices::Enumeration::DeviceWatcher^

deviceWatcher,

Platform::Object^

e

)

[private]

void WebAccountCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountCommand^

command,

Windows::UI::ApplicationSettings::WebAccountInvokedArgs^

args

)

[private]

void WebAccountCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountCommand^

command,

Windows::UI::ApplicationSettings::WebAccountInvokedArgs^

args

)

[private]

void WebAccountCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountCommand^

command,

Windows::UI::ApplicationSettings::WebAccountInvokedArgs^

args

)

[private]

void WebAccountCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountCommand^

command,

Windows::UI::ApplicationSettings::WebAccountInvokedArgs^

args

)

[private]

void WebAccountCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountCommand^

command,

Windows::UI::ApplicationSettings::WebAccountInvokedArgs^

args

)

[private]

void WebAccountProviderCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountProviderCommand^

command

)

[private]

void WebAccountProviderCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountProviderCommand^

command

)

[private]

void WebAccountProviderCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountProviderCommand^

command

)

[private]

void WebAccountProviderCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountProviderCommand^

command

)

[private]

void WebAccountProviderCommandInvoked

(

Windows::UI::ApplicationSettings::WebAccountProviderCommand^

command

)

[private]

unsigned int Width

(

)

void Window_VisibilityChanged

(

Platform::Object^

sender,

Windows::UI::Core::VisibilityChangedEventArgs^

e

)

[private]

WordOverlay

(

OcrWord^

ocrWord

)

void WordSegmentButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WordSegmentsButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteBlock_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteBytesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteMessage

(

Platform::String^

message

)

WriteReadStream

(

)

void WriteTextButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteToFileButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteToFileWithExplicitCFUButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void WriteToStreamButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void YawSlider_ValueChanged

(

Platform::Object^

sender,

Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^

e

)

[private]

void YellowButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

void yesButton_Click

(

Platform::Object^

sender,

Windows::UI::Xaml::RoutedEventArgs^

e

)

[private]

Member Data Documentation

internal __pad0__ [protected]

Reimplemented from PrintHelper.

Definition at line 27 of file App.xaml.h.

Windows::Foundation::EventRegistrationToken _aamvaCardDataReceivedToken [private]

Definition at line 36 of file Scenario2_AamvaCards.xaml.h.

Windows::Devices::Sensors::Accelerometer _accelerometer [private]

Definition at line 38 of file Scenario1_DeviceUse.xaml.h.

bool _active [private]

Definition at line 58 of file Scenario2_VideoChat.xaml.h.

float _angularVelocity = 0 [private]

Definition at line 48 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::Foundation::EventRegistrationToken _bankCardDataReceivedToken [private]

Definition at line 36 of file Scenario1_BankCards.xaml.h.

bool _barDismissed [private]

Definition at line 47 of file CalibrationBar.xaml.h.

Windows::UI::Xaml::DispatcherTimer _calibrationTimer [private]

Definition at line 48 of file CalibrationBar.xaml.h.

Windows::Storage::StorageFolder _captureFolder [private]

Definition at line 37 of file Scenario2_PhotoSettings.xaml.h.

CardioidSound _cardioidSound [private]

Definition at line 54 of file Scenario2_CardioidSound.xaml.h.

Windows::Foundation::EventRegistrationToken _CCCToken [private]

Definition at line 24 of file PhasingTests.xaml.h.

Windows::Foundation::EventRegistrationToken _CCToken [private]

Definition at line 23 of file PhasingTests.xaml.h.

Windows::Foundation::Diagnostics::LoggingChannel _channel [private]

Definition at line 99 of file FileLoggingSessionScenario.h.

Windows::Foundation::Diagnostics::LoggingLevel _channelLoggingLevel [private]

Definition at line 108 of file FileLoggingSessionScenario.h.

Windows::Devices::PointOfService::ClaimedMagneticStripeReader _claimedReader [private]

Definition at line 35 of file Scenario1_BankCards.xaml.h.

Windows::UI::Input::Inking::InkInputProcessingConfiguration _config [private]

Definition at line 63 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _connectionRequestedToken [private]

Definition at line 53 of file Scenario1_Advertiser.xaml.h.

ContextMenuFlyout _contextMenuFlyout [private]

Definition at line 74 of file Scenario1_CustomDry.xaml.h.

Concurrency::critical_section _criticalSection [private]

Definition at line 92 of file Scenario1_CustomDry.xaml.h.

Concurrency::cancellation_token_source _CTS [private]

Definition at line 66 of file Scenario1_Default.xaml.h.

ServiceViewModel _Current [static, private]

Definition at line 55 of file ServiceViewModel.h.

PointerHitTestStates _currentHitTestState [private]

Definition at line 70 of file Scenario1_CustomDry.xaml.h.

InkingAreaSubStates _currentHitTestSubState [private]

Definition at line 69 of file Scenario1_CustomDry.xaml.h.

Platform::String _currentMessage [private]

Definition at line 51 of file SocketReaderWriter.h.

ScenarioOneStates _currentState [private]

Definition at line 60 of file Scenario1_LowLatency.xaml.h.

CustomDecaySound _customDecaySound [private]

Definition at line 41 of file Scenario3_CustomDecay.xaml.h.

xBindSampleModel::FileDataSource _dataSource [private]

Definition at line 25 of file PhasingTests.xaml.h.

Platform::String _deletedItem [private]

Definition at line 33 of file Scenario1_ListView.xaml.h.

CaptureDevice _device [private]

Definition at line 93 of file Scenario1_LowLatency.xaml.h.

Windows::Foundation::EventRegistrationToken _deviceAddedToken [private]

Definition at line 52 of file Scenario2_Connector.xaml.h.

Windows::Foundation::EventRegistrationToken _deviceRemovedToken [private]

Definition at line 53 of file Scenario2_Connector.xaml.h.

Windows::Foundation::EventRegistrationToken _deviceUpdatedToken [private]

Definition at line 54 of file Scenario2_Connector.xaml.h.

Windows::ApplicationModel::Background::BackgroundTaskRegistration _deviceUseBackgroundTaskRegistration [private]

Definition at line 44 of file Scenario1_DeviceUse.xaml.h.

Windows::ApplicationModel::Background::DeviceUseTrigger _deviceUseTrigger [private]

Definition at line 41 of file Scenario1_DeviceUse.xaml.h.

Windows::Devices::Enumeration::DeviceWatcher _deviceWatcher [private]

Definition at line 40 of file Scenario2_Connector.xaml.h.

Windows::Foundation::EventRegistrationToken _deviceWatcherEnumerationCompletedToken [private]

Definition at line 55 of file Scenario2_Connector.xaml.h.

Windows::Foundation::EventRegistrationToken _deviceWatcherStoppedToken [private]

Definition at line 56 of file Scenario2_Connector.xaml.h.

std::mutex _discoveryMutex [private]

Definition at line 41 of file Scenario2_Connector.xaml.h.

Windows::UI::Core::CoreDispatcher _dispatcher [private]

Definition at line 100 of file Scenario1_LowLatency.xaml.h.

Windows::Foundation::Collections::IObservableVector<DownloadOperationItem^> _downloadCollection [private]

Definition at line 85 of file Scenario7_DownloadReordering.xaml.h.

static Windows::UI::Xaml::DependencyProperty _DPOnPage [static, private]

Definition at line 21 of file BasicTests.xaml.h.

Windows::Foundation::IAsyncOperation<Windows::ApplicationModel::DataTransfer::DataPackageOperation> _dragOperation [private]

Definition at line 37 of file Scenario3_StartDragAsync.xaml.h.

Platform::String _dropHere [private]

Definition at line 31 of file Scenario2_DragUICustomization.xaml.h.

bool _enabled [private]

Definition at line 30 of file LoggingScenarioEventArgs.h.

Windows::Media::MediaProperties::IMediaEncodingProperties _encodingProperties [private]

Definition at line 29 of file StreamResolutionHelper.h.

InkEventLogger* _eventLogger [private]

Definition at line 88 of file Scenario1_CustomDry.xaml.h.

bool _fWatcherStarted [private]

Definition at line 42 of file Scenario2_Connector.xaml.h.

Windows::UI::Input::GestureRecognizer _gestureRecognizer [private]

Definition at line 85 of file Scenario1_CustomDry.xaml.h.

float _height = 0 [private]

Definition at line 47 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource _imageSource [private]

Definition at line 57 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _incomingConnectionEventRegistrationToken [private]

Definition at line 45 of file Scenario1_LowLatency.xaml.h.

Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource _independentInput [private]

Definition at line 60 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputEnteringToken [private]

Definition at line 101 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputExitingToken [private]

Definition at line 100 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputHoveringToken [private]

Definition at line 102 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputLostToken [private]

Definition at line 103 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputMovingToken [private]

Definition at line 97 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputPressingToken [private]

Definition at line 98 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _independentInputReleasingToken [private]

Definition at line 99 of file Scenario1_CustomDry.xaml.h.

bool _initialization [private]

Definition at line 56 of file Scenario2_VideoChat.xaml.h.

bool _initialized = false [private]

Definition at line 92 of file Scenario1_LowLatency.xaml.h.

Windows::UI::Input::PointerPoint _initialPointerPoint [private]

Definition at line 79 of file Scenario1_CustomDry.xaml.h.

Windows::Storage::StorageFile _InputFile [private]

Definition at line 63 of file Scenario1_Default.xaml.h.

InputModes _inputMode [private]

Definition at line 71 of file Scenario1_CustomDry.xaml.h.

Platform::String _insideName [private]

Definition at line 29 of file Scenario2_DragUICustomization.xaml.h.

FileLoggingSessionScenario _instance [static, private]

Definition at line 97 of file FileLoggingSessionScenario.h.

LoggingSessionScenario _instance [static, private]

Definition at line 97 of file LoggingSessionScenario.h.

bool _isActive [private]

Definition at line 35 of file Scenario3_StartDragAsync.xaml.h.

bool _isBusy [private]

Definition at line 103 of file FileLoggingSessionScenario.h.

bool _isChannelEnabled [private]

Definition at line 107 of file FileLoggingSessionScenario.h.

bool _isLoggingEnabled [private]

Definition at line 89 of file Scenario1_CustomDry.xaml.h.

bool _isPreparingForSuspend [private]

Definition at line 102 of file FileLoggingSessionScenario.h.

bool _isPreviewing [private]

Definition at line 34 of file Scenario1_PreviewSettings.xaml.h.

bool _isRecording [private]

Definition at line 35 of file Scenario3_AspectRatio.xaml.h.

bool _isTerminator [private]

Definition at line 55 of file Scenario2_VideoChat.xaml.h.

Windows::Devices::Lights::Lamp _lamp [private]

Definition at line 31 of file Scenario3_AvailabilityChanged.xaml.h.

Windows::Foundation::EventRegistrationToken _lampAvailabilutyChangedEventToken [private]

Definition at line 32 of file Scenario3_AvailabilityChanged.xaml.h.

ULARGE_INTEGER _lastCalibrationTime [private]

Definition at line 46 of file CalibrationBar.xaml.h.

LatencyModes _latencyMode [private]

Definition at line 81 of file Scenario1_LowLatency.xaml.h.

Windows::Devices::WiFiDirect::WiFiDirectConnectionListener _listener [private]

Definition at line 50 of file Scenario1_Advertiser.xaml.h.

Windows::Networking::Sockets::StreamSocketListener _listenerSocket [private]

Definition at line 51 of file Scenario1_Advertiser.xaml.h.

std::map<LatencyModes, Windows::UI::Xaml::Controls::MediaElement^> _localHostVideo [private]

Definition at line 82 of file Scenario1_LowLatency.xaml.h.

std::wstring _logFileFullPath [private]

Definition at line 29 of file LoggingScenarioEventArgs.h.

long _logFileGeneratedCount [private]

Definition at line 101 of file FileLoggingSessionScenario.h.

DateTimeFormatter _longTimeFormatter = ref new DateTimeFormatter("longtime") [private]

Definition at line 43 of file Functions.xaml.h.

Platform::Agile< Windows::Media::Capture::MediaCapture^> _mediaCapture [private]

Definition at line 31 of file Scenario1_PreviewSettings.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture> _mediaCapture [private]

Definition at line 78 of file Utils.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventRegistrationToken [private]

Definition at line 46 of file Scenario1_LowLatency.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken [private]

Definition at line 32 of file Scenario1_PreviewSettings.xaml.h.

Windows::Foundation::EventRegistrationToken _mediaElementFailedEventRegistrationToken [private]

Definition at line 47 of file Scenario2_VideoChat.xaml.h.

Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy _mediaSink [private]

Definition at line 80 of file Utils.h.

Windows::Foundation::EventRegistrationToken _mediaSinkIncomingConnectionEventRegistrationToken [private]

Definition at line 82 of file Utils.h.

Button _moreButton

Definition at line 48 of file DynamicCommandBar.h.

long volatile _navigationDisabled [private]

Definition at line 108 of file Scenario1_LowLatency.xaml.h.

OmnidirectionalSound _omnidirectionalSound [private]

Definition at line 43 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::Foundation::EventRegistrationToken _onChannelLoggingEnabledToken [private]

Definition at line 109 of file FileLoggingSessionScenario.h.

Windows::Foundation::EventRegistrationToken _onLogFileGeneratedToken [private]

Definition at line 112 of file FileLoggingSessionScenario.h.

Windows::Storage::StorageFile _OutputFile [private]

Definition at line 64 of file Scenario1_Default.xaml.h.

Platform::String _OutputFileExtension = ".mp4" [private]

Definition at line 61 of file Scenario1_Default.xaml.h.

Platform::String _OutputFileName [private]

Definition at line 60 of file Scenario1_Default.xaml.h.

Platform::String _OutputType = "MP4" [private]

Definition at line 68 of file Scenario1_Default.xaml.h.

Platform::String _outsideName [private]

Definition at line 30 of file Scenario2_DragUICustomization.xaml.h.

Windows::Foundation::Point _pastePosition [private]

Definition at line 25 of file ContextMenuFlyout.xaml.h.

float _pitch = 0 [private]

Definition at line 61 of file Scenario2_CardioidSound.xaml.h.

int _pointerId [private]

Definition at line 76 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::Point _prevErasingPoint [private]

Definition at line 82 of file Scenario1_CustomDry.xaml.h.

ScenarioOneStates _previousState [private]

Definition at line 61 of file Scenario1_LowLatency.xaml.h.

Windows::Media::MediaProperties::MediaEncodingProfile _Profile [private]

Definition at line 62 of file Scenario1_Default.xaml.h.

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher _publisher [private]

Definition at line 49 of file Scenario1_Advertiser.xaml.h.

float _radius = 2.0f [private]

Definition at line 46 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::Devices::PointOfService::MagneticStripeReader _reader [private]

Definition at line 34 of file Scenario1_BankCards.xaml.h.

bool _recordingStarted [private]

Definition at line 87 of file Utils.h.

Platform::Collections::Vector<Platform::String^> _reference [private]

Definition at line 31 of file Scenario1_ListView.xaml.h.

Windows::UI::Xaml::DispatcherTimer _refreshTimer [private]

Definition at line 47 of file Scenario1_DeviceUse.xaml.h.

Windows::Foundation::EventRegistrationToken _releaseDeviceRequestedToken [private]

Definition at line 37 of file Scenario1_BankCards.xaml.h.

std::mt19937 _rnd [private]

Definition at line 31 of file Scenario3_StartDragAsync.xaml.h.

Role _role [private]

Definition at line 66 of file Scenario2_VideoChat.xaml.h.

float _roll = 0 [private]

Definition at line 62 of file Scenario2_CardioidSound.xaml.h.

SDKTemplate::MainPage _rootPage [private]

Definition at line 50 of file SocketReaderWriter.h.

MainPage _rootPage [private]

Definition at line 29 of file Scenario1_SetRecordProfile.xaml.h.

std::shared_ptr< SceneComposer > _sceneComposer [private]

Definition at line 24 of file ContextMenuFlyout.xaml.h.

SdkSample _sdkSample [private]

Definition at line 99 of file Scenario1_LowLatency.xaml.h.

Platform::Collections::Vector<Platform::String^> _selection [private]

Definition at line 32 of file Scenario1_ListView.xaml.h.

Windows::Foundation::Collections::IVector<Windows::Foundation::Point> _selectionPoints [private]

Definition at line 66 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::Diagnostics::FileLoggingSession _session [private]

Definition at line 98 of file FileLoggingSessionScenario.h.

Windows::Foundation::Diagnostics::LoggingSession _session [private]

Definition at line 98 of file LoggingSessionScenario.h.

Windows::Storage::Streams::DataReader _socketReader [private]

Definition at line 47 of file SocketReaderWriter.h.

Windows::Storage::Streams::DataWriter _socketWriter [private]

Definition at line 48 of file SocketReaderWriter.h.

Windows::Foundation::TimeSpan _start [private]

Definition at line 72 of file Scenario3_Trim.xaml.h.

PlayState _state = PlayState::Stopped [private]

Definition at line 63 of file Scenario2_CardioidSound.xaml.h.

Windows::Foundation::EventRegistrationToken _statusChangedToken [private]

Definition at line 54 of file Scenario1_Advertiser.xaml.h.

Windows::Foundation::EventRegistrationToken _stokeContinuedToken [private]

Definition at line 114 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::TimeSpan _stop [private]

Definition at line 73 of file Scenario3_Trim.xaml.h.

StreamFilteringCriteria _streamFilteringCriteria [private]

Definition at line 90 of file Scenario1_LowLatency.xaml.h.

Windows::Networking::Sockets::StreamSocket _streamSocket [private]

Definition at line 49 of file SocketReaderWriter.h.

Windows::Foundation::EventRegistrationToken _strokeCanceledToken [private]

Definition at line 116 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _strokeEndedToken [private]

Definition at line 115 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _strokesCollectedToken [private]

Definition at line 95 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _strokeStartedToken [private]

Definition at line 113 of file Scenario1_CustomDry.xaml.h.

Platform::String _symbol [private]

Definition at line 39 of file Scenario3_StartDragAsync.xaml.h.

Platform::Collections::Vector<Platform::String^> _symbols [private]

Definition at line 33 of file Scenario3_StartDragAsync.xaml.h.

Windows::Foundation::EventRegistrationToken _taskCompletionToken [private]

Definition at line 53 of file Scenario1_DeviceUse.xaml.h.

DispatcherTimer _timer [private]

Definition at line 44 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::UI::Xaml::DispatcherTimer _timer [private]

Definition at line 41 of file Scenario3_StartDragAsync.xaml.h.

EventRegistrationToken _timerEventToken [private]

Definition at line 45 of file Scenario1_OmnidirectionalSound.xaml.h.

Windows::Media::Transcoding::MediaTranscoder _Transcoder [private]

Definition at line 65 of file Scenario1_Default.xaml.h.

LoggingScenarioEventType _type [private]

Definition at line 28 of file LoggingScenarioEventArgs.h.

Platform::String _type [private]

Definition at line 30 of file StreamResolutionHelper.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputEnteredToken [private]

Definition at line 109 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputExitedToken [private]

Definition at line 108 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputHoveredToken [private]

Definition at line 110 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputLostToken [private]

Definition at line 111 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputMovedToken [private]

Definition at line 105 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputPressedToken [private]

Definition at line 106 of file Scenario1_CustomDry.xaml.h.

Windows::Foundation::EventRegistrationToken _unprocessedInputReleasedToken [private]

Definition at line 107 of file Scenario1_CustomDry.xaml.h.

boolean _UseMp4 [private]

Definition at line 68 of file Scenario2_Custom.xaml.h.

VideoSettingsFilter _videoSettingsFilter [private]

Definition at line 43 of file Scenario1_LowLatency.xaml.h.

Windows::Foundation::EventRegistrationToken _visibilityToken [private]

Definition at line 50 of file Scenario1_DeviceUse.xaml.h.

Windows::Foundation::EventRegistrationToken _windowSizeEventToken [private]

Definition at line 49 of file CalibrationBar.xaml.h.

float _x = 0 [private]

Definition at line 57 of file Scenario2_CardioidSound.xaml.h.

float _y = 0 [private]

Definition at line 58 of file Scenario2_CardioidSound.xaml.h.

float _yaw = 0 [private]

Definition at line 60 of file Scenario2_CardioidSound.xaml.h.

float _z = -2 [private]

Definition at line 59 of file Scenario2_CardioidSound.xaml.h.

Platform::String AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb" [private]

Definition at line 44 of file Scenario1_DefaultAccount.xaml.h.

Platform::String AAD_SCOPE_REQUESTED = "" [private]

Definition at line 43 of file Scenario1_DefaultAccount.xaml.h.

Windows::Devices::Sensors::Accelerometer accelerometer [private]

Definition at line 43 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::Accelerometer accelerometerOriginal [private]

Definition at line 38 of file Scenario4_OrientationChanged.xaml.h.

Windows::Devices::Sensors::Accelerometer accelerometerReadingTransform [private]

Definition at line 39 of file Scenario4_OrientationChanged.xaml.h.

Windows::UI::ViewManagement::AccessibilitySettings accessibility [private]

Definition at line 29 of file Scenario11.xaml.h.

Platform::String ACCOUNTS_CONTAINER = "accountssettingscontainer" [private]

Definition at line 52 of file Scenario5_ManyProvidersManyAccounts.xaml.h.

std::map<ScenarioOneStates, std::array<ActionTransition^, 5> > actionTransitionFunctions [private]

Definition at line 65 of file Scenario1_LowLatency.xaml.h.

std::map<int , Windows::Networking::BackgroundTransfer::DownloadOperation^> activeDownloads [private]

Definition at line 48 of file Scenario1_Download.xaml.h.

int activeItemIndex [private]

Definition at line 43 of file Scenario1_EventAndMenuHookup.xaml.h.

Windows::Foundation::EventRegistrationToken activeToolChangedToken [private]

Definition at line 42 of file Scenario6.xaml.h.

Platform::String actualRpcCallbackRate [private]

Definition at line 70 of file ServiceViewModel.h.

bool addAccountLaunched [private]

Definition at line 29 of file Scenario1_AddAccount.xaml.h.

Windows::Devices::Spi::SpiDevice adxl345Sensor [private]

Definition at line 40 of file Scenario1_ReadData.xaml.h.

Platform::String APP_SPECIFIC_PROVIDER_ID = "myproviderid" [private]

Definition at line 54 of file Scenario4_ManyProviders.xaml.h.

Platform::String APP_SPECIFIC_PROVIDER_NAME = "App specific provider" [private]

Definition at line 55 of file Scenario4_ManyProviders.xaml.h.

Windows::Foundation::EventRegistrationToken appResumeEventToken [private]

Definition at line 150 of file EventHandlerForDevice.h.

Windows::Foundation::EventRegistrationToken appSuspendEventToken [private]

Definition at line 149 of file EventHandlerForDevice.h.

Platform::String AUTHORITY_SUBCONTAINER = "authorities" [private]

Definition at line 54 of file Scenario5_ManyProvidersManyAccounts.xaml.h.

double averageContainerHeight = 0.0 [private]

Definition at line 72 of file Scenario2_Load.xaml.h.

Platform::String backgroundTaskName = "DeviceEnumerationCpp_BackgroundTaskName" [private]

Definition at line 34 of file Scenario3_BackgroundDeviceWatcher.xaml.h.

bool backgroundTaskRegistered [private]

Definition at line 43 of file Scenario4_BackgroundTask.xaml.h.

Windows::ApplicationModel::Background::IBackgroundTaskRegistration backgroundTaskRegistration [private]

Definition at line 32 of file Scenario3_BackgroundDeviceWatcher.xaml.h.

Windows::Storage::StorageFile baseVideoFile [private]

Definition at line 31 of file Scenario4_AddOverlays.xaml.h.

std::map<Platform::String^, Platform::String^> Bcp47ToRecognizerNameDictionary [static, private]

Definition at line 13 of file RecognizerHelper.h.

Windows::Foundation::DateTime beginTimeOfRecordedSession [private]

Definition at line 45 of file Scenario9.xaml.h.

Windows::Foundation::DateTime beginTimeOfReplay [private]

Definition at line 48 of file Scenario9.xaml.h.

Windows::Graphics::Imaging::SoftwareBitmap bitmap [private]

Definition at line 57 of file OcrFileImage.xaml.h.

Windows::Foundation::Rect boundingRect [private]

Definition at line 53 of file Scenario2.xaml.h.

bool busy = false [private]

Definition at line 45 of file Scenario1_UTF8.xaml.h.

Platform::String ButtonNameDisableReconnectToDevice [static, private]

Definition at line 38 of file Scenario1_DeviceConnect.xaml.h.

Platform::String ButtonNameDisconnectFromDevice [static, private]

Definition at line 37 of file Scenario1_DeviceConnect.xaml.h.

constexpr unsigned BytesPerMegaByte = 1000000 [static, private]

Definition at line 38 of file Scenario5_RandomAccess.xaml.h.

int const bytesPerRow = 16 [static, private]

Definition at line 44 of file Scenario2_ReadBytes.xaml.h.

int const bytesPerSegment = 2 [static, private]

Definition at line 45 of file Scenario2_ReadBytes.xaml.h.

static const LONGLONG CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS = 300000000 [static, private]

Definition at line 44 of file CalibrationBar.xaml.h.

SDKTemplate::CalibrationBar calibrationBar [private]

Definition at line 41 of file Scenario3_Calibration.xaml.h.

Concurrency::cancellation_token_source * cancellationToken [private]

Definition at line 47 of file Scenario1_Download.xaml.h.

Concurrency::cancellation_token_source cancellationTokenSource [private]

Definition at line 37 of file Scenario6_RecoverableErrors.xaml.h.

Windows::ApplicationModel::Background::BackgroundTaskCancellationReason CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort [private]

Definition at line 25 of file BackgroundActivity.h.

volatile bool CancelRequested = false [private]

Definition at line 26 of file BackgroundActivity.h.

Concurrency::cancellation_token_source cancelSource [private]

Definition at line 33 of file Scenario4_DeviceEvents.xaml.h.

Windows::Devices::PointOfService::CashDrawer cashDrawerInstance1 = nullptr [private]

Definition at line 31 of file Scenario3_MultipleDrawers.xaml.h.

Windows::Devices::PointOfService::CashDrawer cashDrawerInstance2 = nullptr [private]

Definition at line 32 of file Scenario3_MultipleDrawers.xaml.h.

Windows::UI::Xaml::Style checkBoxStyle [private]

Definition at line 66 of file Scenario1_Basic.xaml.h.

int const chunkSize = 4096 [static, private]

Definition at line 46 of file Scenario2_ReadBytes.xaml.h.

Windows::Foundation::Point circleCenter [private]

Definition at line 49 of file Scenario8.xaml.h.

const float circleStrokeThickness [static, private]

Definition at line 44 of file Scenario8.xaml.h.

Windows::Devices::PointOfService::ClaimedCashDrawer claimedCashDrawerInstance1 = nullptr [private]

Definition at line 33 of file Scenario3_MultipleDrawers.xaml.h.

Windows::Devices::PointOfService::ClaimedCashDrawer claimedCashDrawerInstance2 = nullptr [private]

Definition at line 34 of file Scenario3_MultipleDrawers.xaml.h.

Windows::Devices::PointOfService::ClaimedCashDrawer claimedDrawer = nullptr [private]

Definition at line 32 of file Scenario1_OpenDrawer.xaml.h.

ClaimedPosPrinter claimedPrinter [private]

Definition at line 39 of file Scenario1_ReceiptPrinter.xaml.h.

std::map<int, std::vector<Cluster> > clustersForZoomLevel [private]

Definition at line 53 of file Scenario7.xaml.h.

Windows::Foundation::Collections::IMap< Platform::String^, Windows::UI::Color > colorLookup [private]

Definition at line 45 of file Scenario_ContinuousRecognitionSRGSGrammar.xaml.h.

Platform::String ColorSpaceProperty [static, private]

Definition at line 38 of file Scenario3.xaml.h.

Windows::Devices::Sensors::Compass compass [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Media::Editing::MediaComposition composition [private]

Definition at line 36 of file Scenario1_TrimAndSaveClip.xaml.h.

concurrency::task_completion_event<bool> confirmPinTaskSrc [private]

Definition at line 57 of file Scenario9_CustomPairDevice.xaml.h.

Platform::String CONSUMER_AUTHORITY = "consumers" [private]

Definition at line 39 of file Scenario1_DefaultAccount.xaml.h.

Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken [private]

Definition at line 48 of file Scenario_ContinuousDictation.xaml.h.

Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken [private]

Definition at line 49 of file Scenario_ContinuousDictation.xaml.h.

Windows::UI::Input::RadialController controller [private]

Definition at line 38 of file Scenario1_EventAndMenuHookup.xaml.h.

Windows::UI::Xaml::Interop::IBindableObservableVector conversation [private]

Definition at line 92 of file Scenario2_Load.xaml.h.

Platform::String CopyrightProperty [static, private]

Definition at line 37 of file Scenario3.xaml.h.

Windows::UI::Core::CoreIndependentInputSource coreInput [private]

Definition at line 81 of file Scenario1_LowLatencyInput.xaml.h.

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView()->TitleBar [private]

Definition at line 71 of file CustomTitleBar.xaml.h.

Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource coreWetStrokeUpdateSource [private]

Definition at line 47 of file Scenario8.xaml.h.

Windows::UI::Xaml::Media::TransformGroup cumulativeTransform [private]

Definition at line 44 of file 5-GestureRecognizer.xaml.h.

int currChunk [private]

Definition at line 47 of file Scenario2_ReadBytes.xaml.h.

Windows::Devices::Gpio::GpioPinValue currentValue [private]

Definition at line 43 of file Scenario2_Listen.xaml.h.

Platform::String DEFAULT_ACCOUNT_PROVIDER_ID = "https://login.windows.local" [private]

Definition at line 38 of file Scenario1_DefaultAccount.xaml.h.

Windows::ApplicationModel::Resources::Core::ResourceContext defaultContextForCurrentView [private]

Definition at line 40 of file scenario7.xaml.h.

Windows::UI::Xaml::Media::CompositeTransform deltaTransform [private]

Definition at line 43 of file 4-XAMLManipulations.xaml.h.

uint32 desiredReportInterval = 0 [private]

Definition at line 45 of file Scenario3_Polling.xaml.h.

uint32 desiredReportIntervalMs [private]

Definition at line 43 of file Scenario1_DataEvents.xaml.h.

uint32 desiredReportLatency = 0 [private]

Definition at line 47 of file Scenario5_DataEventsBatching.xaml.h.

Windows::Devices::Enumeration::DeviceInformation device [private]

Definition at line 45 of file DeviceListEntry.h.

Windows::Devices::HumanInterfaceDevice::HidDevice device [private]

Definition at line 147 of file EventHandlerForDevice.h.

Windows::Foundation::EventRegistrationToken deviceAccessChangedEventToken [private]

Definition at line 155 of file EventHandlerForDevice.h.

Windows::Devices::Enumeration::DeviceAccessInformation deviceAccessInfo [private]

Definition at line 36 of file Scenario1_Events.xaml.h.

Windows::Devices::Enumeration::DeviceAccessInformation deviceAccessInformation [private]

Definition at line 146 of file EventHandlerForDevice.h.

Windows::Foundation::EventRegistrationToken deviceAddedEventToken [private]

Definition at line 152 of file EventHandlerForDevice.h.

event Windows::Foundation::TypedEventHandler<Windows::Devices::Enumeration::DeviceWatcher^, Platform::String^> DeviceChanged

Definition at line 27 of file DeviceWatcherHelper.h.

Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, Windows::Devices::Enumeration::DeviceInformation^> deviceCloseCallback [private]

Definition at line 157 of file EventHandlerForDevice.h.

Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^> deviceConnectedCallback [private]

Definition at line 158 of file EventHandlerForDevice.h.

Windows::Devices::Enumeration::DeviceInformation deviceInfo [private]

Definition at line 292 of file DisplayHelpers.h.

Windows::Devices::Enumeration::DeviceInformation deviceInformation [private]

Definition at line 145 of file EventHandlerForDevice.h.

Windows::Devices::Enumeration::DeviceInformationKind deviceInformationKind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown [private]

Definition at line 30 of file Scenario5_GetSingleDevice.xaml.h.

Windows::Foundation::EventRegistrationToken deviceRemovedEventToken [private]

Definition at line 153 of file EventHandlerForDevice.h.

std::shared_ptr<DX::DeviceResources> deviceResources [private]

Definition at line 100 of file Scenario1_LowLatencyInput.xaml.h.

Platform::String deviceSelector [private]

Definition at line 49 of file DeviceListEntry.h.

Windows::Devices::Enumeration::DeviceWatcher deviceWatcher [private]

Definition at line 142 of file EventHandlerForDevice.h.

DeviceWatcherHelper deviceWatcherHelper [private]

Definition at line 31 of file Scenario2_DeviceWatcher.xaml.h.

Platform::Collections::Vector<DeviceWatcherHelper^> deviceWatcherHelpers = ref new Platform::Collections::Vector<DeviceWatcherHelper^>() [private]

Definition at line 33 of file Scenario7_DeviceInformationKind.xaml.h.

Platform::Collections::Vector<Windows::Devices::Enumeration::DeviceWatcher^> deviceWatchers [private]

Definition at line 45 of file Scenario1_DeviceConnect.xaml.h.

std::wstringstream dictatedTextBuilder [private]

Definition at line 38 of file Scenario_ContinuousDictation.xaml.h.

Windows::UI::Input::GestureRecognizer directXGestureRecognizer [private]

Definition at line 107 of file Scenario1_LowLatencyInput.xaml.h.

bool disableFollowCircle = false [private]

Definition at line 58 of file Scenario8.xaml.h.

bool discontinueStroke = false [private]

Definition at line 55 of file Scenario8.xaml.h.

Windows::UI::Core::CoreDispatcher dispatcher [private]

Definition at line 43 of file Scenario2_ShakeEvents.xaml.h.

Windows::UI::Core::ICoreDispatcher dispatcher [private]

Definition at line 58 of file ServiceViewModel.h.

Windows::UI::Xaml::DispatcherTimer dispatcherTimer [private]

Definition at line 46 of file Scenario3_Polling.xaml.h.

Windows::Devices::Sensors::ProximitySensorDisplayOnOffController displayController [private]

Definition at line 42 of file Scenario3_DisplayOnOff.xaml.h.

Windows::Graphics::Display::DisplayInformation displayInfo [private]

Definition at line 30 of file Scenario1_Orientation.xaml.h.

DisplayInformation displayInformation = DisplayInformation::GetForCurrentView() [private]

Definition at line 50 of file OcrCapturedImage.xaml.h.

Windows::Graphics::Display::DisplayInformation displayInformation [private]

Definition at line 44 of file Scenario4_OrientationChanged.xaml.h.

Platform::String displayName [private]

Definition at line 106 of file SocketReaderWriter.h.

DisplayRequest displayRequest = ref new DisplayRequest() [private]

Definition at line 53 of file OcrCapturedImage.xaml.h.

Windows::Networking::BackgroundTransfer::DownloadOperation download [private]

Definition at line 41 of file Scenario5_RandomAccess.xaml.h.

const int DPI96 = 96 [static, private]

Constant for 96 DPI.

Definition at line 146 of file Scenario5Photos.xaml.h.

const Platform::String DPOnPageName = "DPOnPage" [private]

Definition at line 20 of file BasicTests.xaml.h.

Windows::Devices::PointOfService::CashDrawer drawer = nullptr [private]

Definition at line 31 of file Scenario1_OpenDrawer.xaml.h.

Windows::Foundation::TimeSpan durationOfRecordedSession [private]

Definition at line 47 of file Scenario9.xaml.h.

Windows::UI::Xaml::UIElement element [private]

Definition at line 42 of file 5-GestureRecognizer.xaml.h.

Windows::UI::Xaml::Controls::Border element [private]

Definition at line 37 of file Scenario1_LowLatencyInput.xaml.h.

const int ElementNotFound = (int)0x80070490 [static, private]

Definition at line 33 of file Scenario2_Manage.xaml.h.

Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint emailConstraint [private]

Definition at line 37 of file Scenario_PauseAsync.xaml.h.

Windows::Foundation::DateTime endTimeOfRecordedSession [private]

Definition at line 46 of file Scenario9.xaml.h.

Windows::Foundation::EventRegistrationToken eraseAllClickedToken [private]

Definition at line 40 of file Scenario6.xaml.h.

EventHandlerForDevice eventHandlerForDevice [static, private]

Allows for singleton EventHandlerForDevice.

Definition at line 135 of file EventHandlerForDevice.h.

Windows::Foundation::EventRegistrationToken eventRegistrationToken [private]

Definition at line 34 of file Scenario1_TrialMode.xaml.h.

Windows::Foundation::EventRegistrationToken eventToken [private]

Definition at line 43 of file scenario7.xaml.h.

Platform::String expectedRpcCallbackRate [private]

Definition at line 69 of file ServiceViewModel.h.

bool externalCamera = false [private]

Definition at line 62 of file OcrCapturedImage.xaml.h.

Platform::String falToken [private]

Definition at line 33 of file Scenario7_FutureAccess.xaml.h.

Windows::Storage::StorageFile file = nullptr [private]

Definition at line 25 of file Scenario1_Geotag.xaml.h.

Windows::Storage::StorageFile firstVideoFile [private]

Definition at line 34 of file Scenario2_AppendClips.xaml.h.

bool followCircle = false [private]

Definition at line 52 of file Scenario8.xaml.h.

bool forceManipulationsToEnd [private]

Definition at line 44 of file 4-XAMLManipulations.xaml.h.

const int FPS = 60 [static, private]

Definition at line 43 of file Scenario9.xaml.h.

Windows::Data::Text::TextConversionGenerator generator [private]

Definition at line 27 of file Scenario1_Conversion.xaml.h.

Windows::Data::Text::TextPredictionGenerator generator [private]

Definition at line 27 of file Scenario2_Prediction.xaml.h.

Windows::Data::Text::TextReverseConversionGenerator generator [private]

Definition at line 22 of file Scenario3_ReverseConversion.xaml.h.

Windows::Devices::Geolocation::Geolocator geolocator [private]

Definition at line 38 of file Scenario3_LocationTrackingReason.xaml.h.

bool getAllHistory [private]

Definition at line 107 of file Scenario2_History.xaml.h.

Windows::Storage::Streams::IBuffer glyphBuffer [private]

Definition at line 39 of file Scenario5_DefiningCustomGlyphs.xaml.h.

BackgroundTaskRegistrationGroup group = nullptr [private]

Definition at line 38 of file Scenario6_GroupedTask.xaml.h.

Windows::Devices::Sensors::Gyrometer gyrometer [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::Gyrometer gyrometerWindows [private]

Definition at line 27 of file Scenario3_Porting.xaml.h.

Windows::Devices::Sensors::Gyrometer gyrometerWP [private]

Definition at line 26 of file Scenario3_Porting.xaml.h.

Platform::Collections::Vector<HistoryRecord^> historyRecords [private]

Definition at line 109 of file Scenario2_History.xaml.h.

Windows::Devices::PointOfService::LineDisplayWindow horizontalScrollableWindow [private]

Definition at line 34 of file Scenario7_ScrollingContentUsingMarquee.xaml.h.

static const unsigned int HResultPrivacyStatementDeclined = 0x80045509 [static, private]

This HResult represents the scenario where a user is prompted to allow in-app speech, but declines.

This should only happen on a Phone device, where speech is enabled for the entire device, not per-app.

Definition at line 34 of file Scenario_ContinuousDictation.xaml.h.

static const unsigned int HResultRecognizerNotFound = 0x8004503a [static, private]

Definition at line 35 of file Scenario_ContinuousRecognitionListGrammar.xaml.h.

Windows::UI::Xaml::Controls::Maps::MapTileSource httpTileSource [private]

Definition at line 28 of file Scenario12.xaml.h.

Windows::Devices::I2c::I2cDevice htu21dSensor [private]

Definition at line 40 of file Scenario1_ReadData.xaml.h.

Windows::Foundation::EventRegistrationToken hypothesisGeneratedToken [private]

Definition at line 50 of file Scenario_ContinuousDictation.xaml.h.

Platform::String IMAGE_ENCODING_STRING [private]

Definition at line 32 of file StreamResolutionHelper.h.

Windows::Storage::StorageFile imageFile [private]

Definition at line 36 of file ShareDelayRenderedFiles.xaml.h.

Windows::Devices::Sensors::Inclinometer inclinometer [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

event IncomingConnectionEventHandler IncomingConnectionEvent [private]

Definition at line 91 of file Utils.h.

bool initialized [private]

Definition at line 26 of file PhasingTests.xaml.h.

Windows::Foundation::EventRegistrationToken inkDrawingAttributesChangedToken [private]

Definition at line 41 of file Scenario6.xaml.h.

Windows::UI::Input::Inking::InkRecognizerContainer inkRecognizerContainer [private]

Definition at line 42 of file Scenario4.xaml.h.

Windows::UI::Xaml::DispatcherTimer inkReplayTimer [private]

Definition at line 50 of file Scenario9.xaml.h.

Windows::Foundation::IAsyncAction inputLoopWorker [private]

Definition at line 80 of file Scenario1_LowLatencyInput.xaml.h.

Windows::Foundation::EventRegistrationToken inputReportEventToken [private]

Definition at line 30 of file Scenario3_InputReportEvents.xaml.h.

Windows::UI::ViewManagement::UserInteractionMode interactionMode [private]

Definition at line 65 of file Scenario1_Basic.xaml.h.

bool isAllDevicesEnumerated [private]

Definition at line 50 of file Scenario1_DeviceConnect.xaml.h.

bool isAngleDetected [private]

Definition at line 41 of file OcrCapturedImage.xaml.h.

bool IsAnImportantTransaction = true [private]

Definition at line 40 of file Scenario1_ReceiptPrinter.xaml.h.

bool isBoundRect [private]

Definition at line 54 of file Scenario2.xaml.h.

bool isBusy = false [private]

Definition at line 36 of file Scenario1_FindClaimEnable.xaml.h.

bool isEnabledAutoReconnect [private]

Definition at line 162 of file EventHandlerForDevice.h.

bool isInitialized = false [private]

Definition at line 57 of file OcrCapturedImage.xaml.h.

bool isLastKnownFullScreen = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->IsFullScreenMode [private]

Definition at line 34 of file Scenario1_Basic.xaml.h.

bool isLaunched = false [private]

Definition at line 33 of file Scenario2_ManageAccount.xaml.h.

bool isPopulatingLanguages = false [private]

Definition at line 41 of file Scenario_ContinuousRecognitionListGrammar.xaml.h.

bool isPreviewing = false [private]

Definition at line 58 of file OcrCapturedImage.xaml.h.

bool isPropertyChangedObserved [private]

Definition at line 102 of file WordOverlay.h.

bool isRegisteredForInputReportEvents [private]

Definition at line 31 of file Scenario3_InputReportEvents.xaml.h.

unsigned int itemsSeen [private]

Definition at line 71 of file Scenario2_Load.xaml.h.

Windows::Foundation::EventRegistrationToken keyDownToken [private]

Definition at line 44 of file Scenario1_Basic.xaml.h.

std::map<String^, Windows::Globalization::Language^> languageMap [private]

Definition at line 54 of file OcrFileImage.xaml.h.

Windows::UI::Xaml::Shapes::Polyline lasso [private]

Definition at line 52 of file Scenario2.xaml.h.

int lastSelectedIndex [private]

Definition at line 33 of file scenario8.xaml.h.

ULARGE_INTEGER lastUpdateTime [private]

Definition at line 60 of file ServiceViewModel.h.

const int LED_PIN = 5 [private]

Definition at line 40 of file Scenario1_GetAndSetPin.xaml.h.

Windows::Devices::PointOfService::ClaimedLineDisplay lineDisplay [private]

Definition at line 34 of file Scenario2_DisplayText.xaml.h.

const int LISTEN_PIN = 6 [private]

Definition at line 40 of file Scenario2_Listen.xaml.h.

Windows::Devices::Gpio::GpioPin listenPin [private]

Definition at line 42 of file Scenario2_Listen.xaml.h.

Platform::Collections::Vector<DeviceListEntry^> listOfDevices [private]

Definition at line 43 of file Scenario1_DeviceConnect.xaml.h.

Windows::Security::Credentials::WebAccount m_account [private]

Definition at line 48 of file Scenario1_DefaultAccount.xaml.h.

Windows::Security::Credentials::WebAccount m_account [private]

Definition at line 39 of file SignIn.xaml.h.

Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken [private]

Definition at line 49 of file Scenario1_DefaultAccount.xaml.h.

Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccount^> m_accounts [private]

Definition at line 58 of file Scenario5_ManyProvidersManyAccounts.xaml.h.

Account m_activeAccount [private]

Definition at line 27 of file Content.xaml.h.

Windows::Devices::Sensors::ActivitySensor m_activitySensor [private]

Definition at line 41 of file Scenario3_ChangeEvents.xaml.h.

bool m_addingAccount = true [private]

Definition at line 38 of file SignIn.xaml.h.

Windows::Storage::StorageFile m_afterWriteFile = nullptr [private]

Definition at line 16 of file Scenario5_TriggerCFU.xaml.h.

Windows::Graphics::Imaging::SoftwareBitmap m_backBuffer [private]

Definition at line 65 of file FrameRenderer.h.

Windows::Storage::StorageFile m_beforeReadFile = nullptr [private]

Definition at line 17 of file Scenario5_TriggerCFU.xaml.h.

std::vector<Windows::UI::Xaml::Media::Brush^> m_brushes [private]

Definition at line 35 of file SkeletalFrameRenderer.h.

std::unique_ptr<FrameRenderer> m_correlatedFrameRenderer [private]

Definition at line 113 of file Scenario1_CorrelateStreams.xaml.h.

Microsoft::WRL::Wrappers::CriticalSection m_CritsecCustomSensor [private]

Definition at line 44 of file Scenario1_DataEvents.xaml.h.

concurrency::critical_section m_csPrintSync [private]

Synchronization object used to secure access to the page collection and the visual root(printingRoot).

Definition at line 156 of file Scenario5Photos.xaml.h.

PageDescription m_currentPageDescription [private]

The current printer's page description used to create the content (size, margins, printable area).

Definition at line 171 of file Scenario5Photos.xaml.h.

concurrency::task<void> m_currentTask = concurrency::task_from_result() [private]

Definition at line 125 of file Scenario2_FindAvailableSourceGroups.xaml.h.

Windows::Devices::Sensors::Custom::CustomSensor m_CustomSensor [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

uint32 m_DesiredReportInterval [private]

Definition at line 43 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Enumeration::DeviceInformation m_Device

Definition at line 7 of file DeviceList.h.

Windows::Devices::Enumeration::DeviceAccessInformation m_deviceAccessInfo [private]

Definition at line 40 of file Scenario3_ChangeEvents.xaml.h.

Windows::Devices::Enumeration::DeviceAccessInformation m_DeviceAccessInfo [private]

Definition at line 45 of file Scenario1_DataEvents.xaml.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 61 of file DirectXPage.xaml.h.

DirectXPage m_directXPage [private]

Definition at line 31 of file App.xaml.h.

Windows::UI::Core::CoreDispatcher m_dispatcher [private]

Definition at line 120 of file FrameSourceViewModels.h.

Windows::UI::Core::CoreDispatcher m_Dispatcher [private]

Definition at line 39 of file Scenario2_Polling.xaml.h.

Windows::Graphics::Display::DisplayInformation m_displayInformation [private]

Definition at line 42 of file DocumentPresenter.h.

DocumentPresenter m_documentPresenter [private]

Definition at line 31 of file Scenario_Document1.xaml.h.

Platform::String m_downloadableFontName [private]

Definition at line 34 of file DocumentPresenter.h.

Windows::Foundation::EventRegistrationToken m_downloadCompletedEventToken [private]

Definition at line 45 of file DocumentPresenter.h.

float m_dpi = 96.0f [private]

Definition at line 41 of file DocumentPresenter.h.

Windows::Foundation::EventRegistrationToken m_dpiChangedEventToken [private]

Definition at line 46 of file DocumentPresenter.h.

Platform::String m_faToken [private]

Definition at line 18 of file Scenario5_TriggerCFU.xaml.h.

DWriteTextLayoutCloudFontImplementation::FontDownloadListener m_fontDownloadListener [private]

Definition at line 40 of file DocumentPresenter.h.

Windows::Foundation::EventRegistrationToken m_frameArrivedToken [private]

Definition at line 139 of file Scenario2_FindAvailableSourceGroups.xaml.h.

Microsoft::WRL::Wrappers::SRWLock m_frameLock [private]

Definition at line 109 of file Scenario1_CorrelateStreams.xaml.h.

FrameRenderer m_frameRenderer [private]

Definition at line 134 of file Scenario2_FindAvailableSourceGroups.xaml.h.

std::map<Windows::Media::Capture::Frames::MediaFrameSourceKind, FrameRenderer^> m_frameRenderers [private]

Definition at line 89 of file Scenario1_DisplayDepthColorIR.xaml.h.

std::map<Windows::Media::Capture::Frames::MediaFrameSourceKind, FrameSourceState> m_frameSources [private]

Definition at line 111 of file Scenario1_CorrelateStreams.xaml.h.

SourceGroupCollection m_groupCollection [private]

Definition at line 136 of file Scenario2_FindAvailableSourceGroups.xaml.h.

Windows::UI::Xaml::Controls::Image m_imageElement [private]

Definition at line 64 of file FrameRenderer.h.

Platform::String m_imagePath [private]

Definition at line 45 of file SampleDataModel.h.

Windows::UI::Xaml::Controls::Image m_imageTarget [private]

Definition at line 39 of file DocumentPresenter.h.

DisplayContent m_imageText [private]

A flag that determines if text & images are to be shown.

Definition at line 65 of file Scenario3CustomOptions.xaml.h.

bool m_isWindowVisible [private]

Definition at line 63 of file DirectXPage.xaml.h.

Platform::Collections::Vector<Platform::String^> m_languages = ref new Platform::Collections::Vector<Platform::String^>() [private]

Definition at line 32 of file Scenario1_Configuration.xaml.h.

bool m_layoutUpdateInProgress = false [private]

Definition at line 43 of file DocumentPresenter.h.

SimpleLogger m_logger [private]

Definition at line 91 of file Scenario1_DisplayDepthColorIR.xaml.h.

SDKTemplate::SimpleLogger m_logger [private]

Definition at line 115 of file Scenario1_CorrelateStreams.xaml.h.

Platform::Agile< Windows::Media::Capture::MediaCapture^> m_mediaCapture [private]

Definition at line 85 of file Scenario1_DisplayDepthColorIR.xaml.h.

Platform::Agile<Windows::Media::Capture::MediaCapture^> m_mediaCapture [private]

Definition at line 130 of file Scenario2_FindAvailableSourceGroups.xaml.h.

LONG m_messageCount = 0 [private]

Definition at line 43 of file SimpleLogger.h.

Platform::String m_Name [private]

Definition at line 21 of file Account.h.

std::map<int, UIElement^> m_pageCollection [private]

A map of UIElements used to store the print preview pages.

Definition at line 151 of file Scenario5Photos.xaml.h.

bool m_passportAvailable = true [private]

Definition at line 40 of file SignIn.xaml.h.

Scaling m_photoScale [private]

Current scale settings for the image.

Definition at line 166 of file Scenario5Photos.xaml.h.

PhotoSize m_photoSize [private]

Current size settings for the image.

Definition at line 161 of file Scenario5Photos.xaml.h.

std::vector<UIElement^> m_printPages [private]

A list of UIElements used to store the print pages.

This gives easy access to any desired print page.

Definition at line 57 of file Scenario6DisablePreview.xaml.h.

Windows::Security::Credentials::WebAccountProvider m_provider [private]

Definition at line 47 of file Scenario1_DefaultAccount.xaml.h.

Platform::Collections::Map< Platform::String^, Windows::Security::Credentials::WebAccountProvider^> m_providers [private]

Definition at line 56 of file Scenario4_ManyProviders.xaml.h.

Windows::Media::Capture::Frames::MediaFrameReader m_reader [private]

Definition at line 133 of file Scenario2_FindAvailableSourceGroups.xaml.h.

std::vector<std::pair<Windows::Media::Capture::Frames::MediaFrameReader^, Windows::Foundation::EventRegistrationToken> > m_readers [private]

Definition at line 87 of file Scenario1_DisplayDepthColorIR.xaml.h.

Windows::Foundation::EventRegistrationToken m_readingToken [private]

Definition at line 42 of file Scenario3_ChangeEvents.xaml.h.

Windows::Foundation::EventRegistrationToken m_ReadingToken [private]

Definition at line 42 of file Scenario1_DataEvents.xaml.h.

std::unique_ptr<D2DSvgImageRenderer> m_renderer [private]

Definition at line 62 of file DirectXPage.xaml.h.

LONGLONG m_requestCount [private]

A request "number" used to describe a Paginate - GetPreviewPage session.

It is used by GetPreviewPage to determine, before calling SetPreviewPage, if the page content is out of date. Flow: Paginate will increment the request count and all subsequent GetPreviewPage calls will store a local copy and verify it before calling SetPreviewPage. If another Paginate event is triggered while some GetPreviewPage workers are still executing asynchronously their results will be discarded(ignored) because their request number is expired (the photo page description changed).

Definition at line 181 of file Scenario5Photos.xaml.h.

MainPage m_rootPage = MainPage::Current [private]

Definition at line 31 of file Scenario1_Configuration.xaml.h.

SDKTemplate::MainPage m_RootPage [private]

Definition at line 38 of file Scenario1_DataEvents.xaml.h.

AccountAction m_selectedAccountAction [private]

Definition at line 61 of file Scenario5_ManyProvidersManyAccounts.xaml.h.

int m_selectedSourceGroupIndex = 0 [private]

Definition at line 83 of file Scenario1_DisplayDepthColorIR.xaml.h.

UINT32 m_selectedSourceGroupIndex = 0 [private]

Definition at line 105 of file Scenario1_CorrelateStreams.xaml.h.

Windows::Media::Capture::Frames::MediaFrameSource m_source [private]

Definition at line 132 of file Scenario2_FindAvailableSourceGroups.xaml.h.

Windows::Foundation::Collections::IObservableVector<FrameSourceGroupModel^> m_sourceCollection [private]

Definition at line 118 of file FrameSourceViewModels.h.

bool m_streaming = false [private]

Definition at line 128 of file Scenario2_FindAvailableSourceGroups.xaml.h.

bool m_taskRunning = false [private]

Definition at line 66 of file FrameRenderer.h.

Windows::UI::Color m_textBackgroundColor [private]

Definition at line 36 of file DocumentPresenter.h.

Windows::UI::Xaml::Controls::TextBlock m_textBlock [private]

Definition at line 44 of file SimpleLogger.h.

Windows::UI::Color m_textColor [private]

Definition at line 35 of file DocumentPresenter.h.

DWriteTextLayoutCloudFontImplementation::TextLayout m_textLayout [private]

Definition at line 37 of file DocumentPresenter.h.

DWriteTextLayoutCloudFontImplementation::TextLayoutImageSource m_textLayoutImageSource [private]

Definition at line 38 of file DocumentPresenter.h.

Platform::String m_title [private]

Definition at line 44 of file SampleDataModel.h.

Windows::Foundation::EventRegistrationToken m_visibilityChangedEventToken [private]

Definition at line 47 of file DocumentPresenter.h.

Windows::Foundation::EventRegistrationToken m_visibilityEventRegistrationToken [private]

Definition at line 101 of file Scenario1_LowLatency.xaml.h.

Windows::Foundation::EventRegistrationToken m_VisibilityToken [private]

Definition at line 41 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Enumeration::DeviceWatcher m_watcher [private]

Definition at line 122 of file FrameSourceViewModels.h.

Windows::Devices::Enumeration::DeviceWatcher m_Watcher [private]

Definition at line 39 of file Scenario1_DataEvents.xaml.h.

Windows::Foundation::EventRegistrationToken m_watcherDeviceAddedToken [private]

Definition at line 123 of file FrameSourceViewModels.h.

Windows::Foundation::EventRegistrationToken m_watcherDeviceRemovedToken [private]

Definition at line 124 of file FrameSourceViewModels.h.

Windows::Foundation::EventRegistrationToken m_watcherDeviceUpdatedToken [private]

Definition at line 125 of file FrameSourceViewModels.h.

std::unique_ptr<SDKTemplate::LowLatencyInputMain> main [private]

Definition at line 101 of file Scenario1_LowLatencyInput.xaml.h.

SDKTemplate::ManipulationProcessor manipulationProcessor [private]

Definition at line 109 of file Scenario1_LowLatencyInput.xaml.h.

ManipulationInputProcessor manipulationProcessor [private]

Definition at line 66 of file 5-GestureRecognizer.xaml.h.

Windows::Storage::Streams::RandomAccessStreamReference mapBillboardStreamReference [private]

Definition at line 27 of file Scenario2.xaml.h.

Windows::Storage::Streams::RandomAccessStreamReference mapIconStreamReference [private]

Definition at line 26 of file Scenario2.xaml.h.

Platform::Collections::Vector< Windows::UI::Xaml::Controls::Maps::MapLayer^> MapLayers [private]

Initial value:
            ref new Platform::Collections::Vector<Windows::UI::Xaml::Controls::Maps::MapLayer^>()
Definition at line 30 of file Scenario10.xaml.h.

Windows::Storage::Streams::RandomAccessStreamReference mapModelStreamReference [private]

Definition at line 28 of file Scenario2.xaml.h.

const UINT32 maxUploadFileSize = 100 * 1024 * 1024 [static, private]

Definition at line 42 of file Scenario2_Upload.xaml.h.

unsigned int maxWindows = 0 [private]

Definition at line 111 of file Scenario3_UsingWindows.xaml.h.

Platform::Agile<MediaCapture> mediaCapture [private]

Definition at line 56 of file OcrCapturedImage.xaml.h.

Windows::Foundation::EventRegistrationToken mediaCaptureFailedEventToken [private]

Definition at line 69 of file OcrCapturedImage.xaml.h.

Windows::Media::Core::MediaStreamSource mediaStreamSource [private]

Definition at line 34 of file Scenario1_TrimAndSaveClip.xaml.h.

std::vector<Windows::UI::Input::RadialControllerMenuItem^> menuItems [private]

Definition at line 44 of file Scenario1_EventAndMenuHookup.xaml.h.

int messageNumber = 0 [private]

Definition at line 32 of file Scenario1_Basic.xaml.h.

Windows::Networking::Sockets::MessageWebSocket messageWebSocket [private]

Definition at line 43 of file Scenario1_UTF8.xaml.h.

Windows::Storage::Streams::DataWriter messageWriter [private]

Definition at line 44 of file Scenario1_UTF8.xaml.h.

volatile bool meteringOn [private]

Definition at line 56 of file ServiceViewModel.h.

bool meteringOnWhileSuspension [private]

Definition at line 57 of file ServiceViewModel.h.

Platform::String MICROSOFT_PROVIDER_ID = "https://login.microsoft.com" [private]

Definition at line 43 of file Scenario2_MSA.xaml.h.

const int minPenSize = 2 [static, private]

Definition at line 46 of file Scenario3.xaml.h.

bool mirroringPreview = false [private]

Definition at line 61 of file OcrCapturedImage.xaml.h.

Platform::String mruToken [private]

Definition at line 32 of file Scenario7_FutureAccess.xaml.h.

Platform::String MSA_CLIENT_ID = "none" [private]

Definition at line 42 of file Scenario1_DefaultAccount.xaml.h.

Platform::String MSA_SCOPE_REQUESTED = "service::wl.basic::DELEGATION" [private]

Definition at line 41 of file Scenario1_DefaultAccount.xaml.h.

Windows::UI::Xaml::Controls::Maps::MapElementsLayer myLayer1 [private]

Definition at line 27 of file Scenario10.xaml.h.

Windows::UI::Xaml::Controls::Maps::MapElementsLayer myLayer2 [private]

Definition at line 28 of file Scenario10.xaml.h.

bool navigatedAway [private]

Definition at line 40 of file Scenario3_InputReportEvents.xaml.h.

Platform::String newButtonText [private]

Definition at line 32 of file Scenario_PauseAsync.xaml.h.

int nextWindowId = 0 [private]

Definition at line 110 of file Scenario3_UsingWindows.xaml.h.

const int NoCaptureDevicesHResult = -1072845856 [static, private]

Definition at line 22 of file AudioCapturePermissions.h.

Windows::Networking::BackgroundTransfer::BackgroundTransferGroup notificationsGroup [private]

Definition at line 39 of file Scenario3_Notifications.xaml.h.

std::array<Windows::Storage::Streams::RandomAccessStreamReference^, 8> numberIconReferences [private]

Definition at line 51 of file Scenario7.xaml.h.

const int NumberOfPhotos = 6 [static, private]

The app's number of photos.

Definition at line 141 of file Scenario5Photos.xaml.h.

const int NumDownloads = 5 [private]

Definition at line 81 of file Scenario7_DownloadReordering.xaml.h.

uint32 numInputReportEventsReceived [private]

Definition at line 36 of file Scenario3_InputReportEvents.xaml.h.

Windows::Globalization::Language ocrLanguage [private]

Definition at line 44 of file OcrCapturedImage.xaml.h.

bool optedIn [static, private]

Definition at line 36 of file Scenario1.xaml.h.

Platform::String ORGANIZATION_AUTHORITY = "organizations" [private]

Definition at line 40 of file Scenario1_DefaultAccount.xaml.h.

Windows::Foundation::EventRegistrationToken orientationChangedEventToken [private]

Definition at line 68 of file OcrCapturedImage.xaml.h.

Windows::Foundation::EventRegistrationToken orientationChangedToken [private]

Definition at line 43 of file Scenario4_OrientationChanged.xaml.h.

Windows::Foundation::EventRegistrationToken orientationToken [private]

Definition at line 42 of file Scenario1_DataEvents.xaml.h.

std::stack<std::tuple<ICommandBarElement^, double> > overflow = { }

Definition at line 52 of file DynamicCommandBar.h.

Windows::Storage::StorageFile overlayVideoFile [private]

Definition at line 32 of file Scenario4_AddOverlays.xaml.h.

Windows::UI::Xaml::UIElement pageContent = nullptr [private]

Definition at line 72 of file CustomTitleBar.xaml.h.

Windows::Data::Pdf::PdfDocument pdfDocument [private]

Definition at line 30 of file Scenario1_Render.xaml.h.

Windows::Devices::Sensors::Pedometer pedometer [private]

Definition at line 37 of file Scenario1_Events.xaml.h.

const float penSize [static, private]

Definition at line 45 of file Scenario8.xaml.h.

int penSize [private]

Definition at line 49 of file Scenario3.xaml.h.

const int penSizeIncrement = 2 [static, private]

Definition at line 47 of file Scenario3.xaml.h.

Windows::System::Threading::ThreadPoolTimer PeriodicTimer = nullptr [private]

Definition at line 28 of file BackgroundActivity.h.

Windows::System::Threading::ThreadPoolTimer periodicTimer [private]

Definition at line 37 of file Scenario1_UnspecifiedReason.xaml.h.

Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint phoneConstraint [private]

Definition at line 38 of file Scenario_PauseAsync.xaml.h.

Windows::Storage::StorageFile pickedFile [private]

Definition at line 37 of file Scenario1_TrimAndSaveClip.xaml.h.

Windows::Storage::StorageLibrary picturesLibrary [private]

Definition at line 31 of file S2_ListFolders.xaml.h.

Windows::Devices::Gpio::GpioPin pin [private]

Definition at line 41 of file Scenario1_GetAndSetPin.xaml.h.

const int pinPolicyAllowedIndex = 1 [static, private]

Definition at line 17 of file Scenario1_CreateTPMVSC.xaml.h.

const int pinPolicyDisallowedIndex = 0 [static, private]

Definition at line 16 of file Scenario1_CreateTPMVSC.xaml.h.

const int pinPolicyRequireOneIndex = 2 [static, private]

Definition at line 18 of file Scenario1_CreateTPMVSC.xaml.h.

std::vector<PlaceInfo> places [private]

Definition at line 52 of file Scenario7.xaml.h.

Windows::Media::Playlists::Playlist playlist [private]

Definition at line 17 of file Scenario3_Add.xaml.h.

Windows::Foundation::EventRegistrationToken pointerMovedToken [private]

Definition at line 56 of file Scenario2.xaml.h.

Windows::Foundation::EventRegistrationToken pointerPressedToken [private]

Definition at line 55 of file Scenario2.xaml.h.

Windows::Foundation::EventRegistrationToken pointerReleasedToken [private]

Definition at line 57 of file Scenario2.xaml.h.

std::map<unsigned int, Windows::UI::Xaml::Controls::StackPanel^> popups [private]

Definition at line 46 of file 2-PointerPointProperties.xaml.h.

Windows::Globalization::Language previousInputLanguage [private]

Definition at line 44 of file Scenario4.xaml.h.

Platform::Array<bool> previousSwitchValues [private]

Definition at line 37 of file Scenario4_DeviceEvents.xaml.h.

Windows::UI::Xaml::Media::MatrixTransform previousTransform [private]

Definition at line 42 of file 4-XAMLManipulations.xaml.h.

int previousZoomLevel = 0 [private]

Definition at line 54 of file Scenario7.xaml.h.

PosPrinter printer [private]

Definition at line 38 of file Scenario1_ReceiptPrinter.xaml.h.

PrintHelper printHelper [private]

Definition at line 22 of file Scenario1Basic.xaml.h.

event PropertyChangedEventHandler privatePropertyChanged [private]

Definition at line 103 of file WordOverlay.h.

bool processingScrollOffsets = false [private]

Definition at line 73 of file Scenario2_Load.xaml.h.

bool processingScrollOffsetsDeferred = false [private]

Definition at line 74 of file Scenario2_Load.xaml.h.

unsigned int Progress = 0 [private]

Definition at line 29 of file BackgroundActivity.h.

event Windows::UI::Xaml::Data::PropertyChangedEventHandler PropertyChanged

Definition at line 26 of file Scenario7_DownloadReordering.xaml.h.

concurrency::task_completion_event<Windows::Security::Credentials::PasswordCredential^> providePasswordCredentialSrc [private]

Definition at line 58 of file Scenario9_CustomPairDevice.xaml.h.

concurrency::task_completion_event<Platform::String^> providePinTaskSrc [private]

Definition at line 56 of file Scenario9_CustomPairDevice.xaml.h.

Platform::String PROVIDER_ID_SUBCONTAINER = "providers" [private]

Definition at line 53 of file Scenario5_ManyProvidersManyAccounts.xaml.h.

const float radius [static, private]

Definition at line 43 of file Scenario8.xaml.h.

Windows::Storage::Streams::IRandomAccessStreamWithContentType randomAccessStream [private]

Definition at line 42 of file Scenario5_RandomAccess.xaml.h.

Concurrency::cancellation_token_source readCancellationTokenSource [private]

Definition at line 44 of file Scenario5_RandomAccess.xaml.h.

unsigned int readCounter = 0 [private]

Definition at line 30 of file Scenario5_DeviceReadWrite.xaml.h.

Windows::Devices::SmartCards::SmartCardReader reader [private]

Definition at line 23 of file Scenario1_CreateTPMVSC.xaml.h.

Windows::Foundation::EventRegistrationToken readingToken [private]

Definition at line 45 of file Scenario1_DataEvents.xaml.h.

Windows::Foundation::EventRegistrationToken readingTokenOriginal [private]

Definition at line 41 of file Scenario4_OrientationChanged.xaml.h.

Windows::Foundation::EventRegistrationToken readingTokenReadingTransform [private]

Definition at line 42 of file Scenario4_OrientationChanged.xaml.h.

Concurrency::task<Windows::Storage::Streams::IBuffer^> readOperation [private]

Definition at line 43 of file Scenario5_RandomAccess.xaml.h.

Windows::UI::Input::GestureRecognizer recognizer [private]

Definition at line 41 of file 5-GestureRecognizer.xaml.h.

Platform::Collections::Vector<HistoryRecord> recordCollection [private]

Definition at line 108 of file Scenario2_History.xaml.h.

Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkRecognizer^> recoView [private]

Definition at line 43 of file Scenario4.xaml.h.

Windows::UI::Xaml::UIElement reference [private]

Definition at line 43 of file 5-GestureRecognizer.xaml.h.

bool registered [private]

Definition at line 42 of file Scenario4_BackgroundActivity.xaml.h.

Windows::Devices::HumanInterfaceDevice::HidDevice registeredDevice [private]

Definition at line 34 of file Scenario3_InputReportEvents.xaml.h.

bool registeredForEvents [private]

Definition at line 39 of file Scenario1_Events.xaml.h.

Windows::Foundation::EventRegistrationToken releaseDeviceRequestedToken [private]

Definition at line 41 of file Scenario1_ReceiptPrinter.xaml.h.

Windows::Foundation::EventRegistrationToken releaseRequestedToken1 [private]

Definition at line 47 of file Scenario3_MultipleDrawers.xaml.h.

Windows::Foundation::EventRegistrationToken releaseRequestedToken2 [private]

Definition at line 48 of file Scenario3_MultipleDrawers.xaml.h.

Windows::Networking::BackgroundTransfer::BackgroundTransferGroup reorderGroup [private]

Definition at line 84 of file Scenario7_DownloadReordering.xaml.h.

Windows::Foundation::Collections::IObservableVector< DeviceInformationDisplay^> resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>() [private]

Definition at line 37 of file DeviceWatcherHelper.h.

MainPage rootPage = MainPage::Current [private]

Definition at line 38 of file Scenario0_Choose.xaml.h.

MainPage rootPage = MainPage::Current [private]

Definition at line 19 of file Scenario1_Metrics.xaml.h.

int rotationDegrees [private]

Definition at line 64 of file OcrCapturedImage.xaml.h.

RPC_CLIENT_HANDLE rpcclient [private]

Definition at line 63 of file ServiceViewModel.h.

__int64 rpcDataCountOld = 0 [private]

Definition at line 61 of file ServiceViewModel.h.

UINT32 runId [static, private]

Definition at line 41 of file Scenario3_Notifications.xaml.h.

bool running = false [private]

Definition at line 34 of file Scenario4_DeviceEvents.xaml.h.

int32 runningStepCount [private]

Definition at line 44 of file Scenario1_Events.xaml.h.

Platform::Array<__int64> sampleArray [private]

Definition at line 80 of file ServiceViewModel.h.

Platform::String sampleMessage [private]

Definition at line 68 of file ServiceViewModel.h.

int samplePeriod [private]

Definition at line 59 of file ServiceViewModel.h.

unsigned int sampleRefreshCount = 0 [private]

Definition at line 62 of file ServiceViewModel.h.

Platform::String savedScrollPosition [private]

Definition at line 33 of file Scenario1_Basic.xaml.h.

Windows::Storage::StorageFile secondVideoFile [private]

Definition at line 35 of file Scenario2_AppendClips.xaml.h.

Windows::UI::Xaml::Controls::Maps::MapElementsLayer selectedLayer [private]

Definition at line 29 of file Scenario10.xaml.h.

int64_t selectedStencilChangedToken [private]

Definition at line 43 of file Scenario6.xaml.h.

Windows::Devices::Sensors::LightSensor sensor [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::Barometer sensor [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::SimpleOrientationSensor sensor [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::OrientationSensor sensor [private]

Definition at line 43 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::SimpleOrientationSensor sensor [private]

Definition at line 40 of file Scenario1_DataEvents.xaml.h.

Windows::Devices::Sensors::ProximitySensor sensor [private]

Definition at line 41 of file Scenario1_DataEvents.xaml.h.

std::queue<std::tuple<ICommandBarElement^, double> > separatorQueue = { }

Definition at line 53 of file DynamicCommandBar.h.

double separatorQueueWidth = 0.0

Definition at line 54 of file DynamicCommandBar.h.

Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionSession session [private]

Definition at line 36 of file Scenario1_UnspecifiedReason.xaml.h.

Windows::Foundation::EventRegistrationToken sessionRevokedToken [private]

Definition at line 38 of file Scenario1_UnspecifiedReason.xaml.h.

const int SET_PIN = 5 [private]

Definition at line 39 of file Scenario2_Listen.xaml.h.

Windows::Devices::Gpio::GpioPin setPin [private]

Definition at line 41 of file Scenario2_Listen.xaml.h.

uint16 shakeCounter = 0 [private]

Definition at line 47 of file Scenario2_ShakeEvents.xaml.h.

Windows::Foundation::EventRegistrationToken shakenToken [private]

Definition at line 46 of file Scenario2_ShakeEvents.xaml.h.

Windows::UI::Xaml::Controls::MenuFlyout sharedFlyout [private]

Definition at line 30 of file Scenario3.xaml.h.

bool sliderEnabled [private]

Definition at line 73 of file ServiceViewModel.h.

std::vector<Windows::UI::Xaml::Controls::Slider^> sliders [private]

Definition at line 45 of file Scenario1_EventAndMenuHookup.xaml.h.

double sliderValue [private]

Definition at line 74 of file ServiceViewModel.h.

Platform::Collections::Vector<SmartCardItem^> smartCardItems [private]

Definition at line 52 of file Scenario7_ListSmartCards.xaml.h.

SocketReaderWriter socketRW [private]

Definition at line 101 of file SocketReaderWriter.h.

VideoRotation sourceRotation [private]

Definition at line 65 of file OcrCapturedImage.xaml.h.

Windows::ApplicationModel::Resources::Core::ResourceContext speechContext [private]

Definition at line 39 of file Scenario_ContinuousRecognitionListGrammar.xaml.h.

Windows::Media::SpeechRecognition::SpeechRecognizer speechRecognizer [private]

Definition at line 37 of file Scenario_ContinuousDictation.xaml.h.

Windows::ApplicationModel::Resources::Core::ResourceMap speechResourceMap [private]

Definition at line 40 of file Scenario_ContinuousRecognitionListGrammar.xaml.h.

SRWLOCK srwSingletonCreationLock [static, private]

Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.

Definition at line 140 of file EventHandlerForDevice.h.

bool startButtonEnabled [private]

Definition at line 71 of file ServiceViewModel.h.

time_t startTime [private]

Definition at line 39 of file Scenario1_UnspecifiedReason.xaml.h.

Windows::Foundation::EventRegistrationToken stateChangedToken [private]

Definition at line 47 of file Scenario_ContinuousDictation.xaml.h.

Windows::Foundation::EventRegistrationToken statusUpdatedToken [private]

Definition at line 40 of file Scenario2_CloseDrawer.xaml.h.

Windows::Foundation::EventRegistrationToken stencilButtonCheckedChangedToken [private]

Definition at line 39 of file Scenario6.xaml.h.

int stepCount [private]

Definition at line 45 of file Scenario4_BackgroundTask.xaml.h.

int stepCountGoalOffset [static, private]

Definition at line 44 of file Scenario4_BackgroundTask.xaml.h.

int stepGoal [private]

Definition at line 46 of file Scenario4_BackgroundTask.xaml.h.

bool stopButtonEnabled [private]

Definition at line 72 of file ServiceViewModel.h.

bool stopMeteringRequested [private]

Definition at line 64 of file ServiceViewModel.h.

Windows::Storage::AccessCache::StorageItemAccessList storageItemAccessList [private]

Definition at line 35 of file Scenario1_TrimAndSaveClip.xaml.h.

Windows::Foundation::Collections::IVectorView<Windows::Storage::StorageFile^> storageItems [private]

Definition at line 35 of file ShareFiles.xaml.h.

Windows::Services::Store::StoreContext storeContext [private]

Definition at line 33 of file Scenario1_TrialMode.xaml.h.

Platform::String STORED_ACCOUNT_AUTHORITY = "accountauthority" [private]

Definition at line 46 of file Scenario1_DefaultAccount.xaml.h.

Platform::String STORED_ACCOUNT_ID_KEY = "accountid" [private]

Definition at line 45 of file Scenario1_DefaultAccount.xaml.h.

Platform::String STORED_AUTHORITY_ID_KEY = "authority" [private]

Definition at line 53 of file Scenario4_ManyProviders.xaml.h.

Platform::String STORED_PROVIDER_ID_KEY = "providerid" [private]

Definition at line 52 of file Scenario4_ManyProviders.xaml.h.

Windows::Networking::Sockets::StreamWebSocket streamWebSocket [private]

Definition at line 42 of file Scenario2_Binary.xaml.h.

Windows::UI::Input::Inking::InkStrokeBuilder strokeBuilder [private]

Definition at line 52 of file Scenario9.xaml.h.

Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^> strokesToReplay [private]

Definition at line 53 of file Scenario9.xaml.h.

Windows::Foundation::Collections::IObservableVector<Windows::Devices::PointOfService::LineDisplayCursorType> supportedCursorTypes [private]

Initial value:
            ref new Platform::Collections::Vector<Windows::Devices::PointOfService::LineDisplayCursorType>
Definition at line 42 of file Scenario6_ManipulatingCursorAttributes.xaml.h.

static const ULONGLONG SUPPRESS_DURATION_APPROXIMATE_TICKS = 6000000000 [static, private]

Definition at line 42 of file CalibrationBar.xaml.h.

static const ULONGLONG SUPPRESS_DURATION_UNRELIABLE_TICKS = 3000000000 [static, private]

Definition at line 43 of file CalibrationBar.xaml.h.

Windows::ApplicationModel::SuspendingDeferral suspendDeferral = nullptr [private]

Definition at line 36 of file Scenario2_SavingDataReason.xaml.h.

Windows::Foundation::EventRegistrationToken suspendingToken [private]

Definition at line 35 of file Scenario2_SavingDataReason.xaml.h.

Windows::Foundation::EventRegistrationToken switchChangedEventsHandler [private]

Definition at line 36 of file Scenario4_DeviceEvents.xaml.h.

Windows::Media::SpeechSynthesis::SpeechSynthesisStream synthesisStream [private]

Definition at line 31 of file Scenario_SynthesizeSSML.xaml.h.

Windows::Media::SpeechSynthesis::SpeechSynthesizer synthesizer [private]

Definition at line 30 of file Scenario_SynthesizeSSML.xaml.h.

int taskCount = 0 [private]

Definition at line 38 of file Scenario4_MultipleTasks.xaml.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral> TaskDeferral = nullptr [private]

Definition at line 27 of file BackgroundActivity.h.

Windows::ApplicationModel::Background::IBackgroundTaskInstance TaskInstance = nullptr [private]

Definition at line 30 of file BackgroundActivity.h.

Windows::ApplicationModel::Background::BackgroundTaskRegistration taskRegistration [private]

Definition at line 26 of file Scenario6_CustomTrigger.xaml.h.

const UINT64 tenMinutesIn100NanoSecondUnits = 6000000000 [static, private]

Definition at line 43 of file Scenario3_Notifications.xaml.h.

Windows::UI::Text::Core::CoreTextServicesManager textServiceManager [private]

Definition at line 45 of file Scenario4.xaml.h.

Windows::UI::Xaml::DispatcherTimer timer [private]

Definition at line 44 of file Scenario2_Listen.xaml.h.

Windows::Foundation::EventRegistrationToken timerToken [private]

Definition at line 39 of file Scenario1_ReadData.xaml.h.

Windows::UI::ViewManagement::ApplicationViewTitleBar titleBar [private]

Definition at line 39 of file Scenario1_Colors.xaml.h.

std::vector<Windows::UI::Xaml::Controls::ToggleSwitch^> toggles [private]

Definition at line 46 of file Scenario1_EventAndMenuHookup.xaml.h.

Windows::Foundation::EventRegistrationToken token [private]

Definition at line 35 of file Scenario1.xaml.h.

int32 totalCumulativeSteps [private]

Definition at line 41 of file Scenario1_Events.xaml.h.

uint32 totalNumberBytesReceived [private]

Definition at line 37 of file Scenario3_InputReportEvents.xaml.h.

Windows::UI::Xaml::Media::TransformGroup transforms [private]

Definition at line 41 of file 4-XAMLManipulations.xaml.h.

ApplicationTrigger trigger = nullptr [private]

Definition at line 38 of file Scenario5_ApplicationTriggerTask.xaml.h.

int32 unknownStepCount [private]

Definition at line 42 of file Scenario1_Events.xaml.h.

CCCEventHandler UpdateRunningAverageContainerHeightHandler = ref new CCCEventHandler(this, &ChatListView::UpdateRunningAverageContainerHeight) [private]

Definition at line 75 of file Scenario2_Load.xaml.h.

std::vector<Platform::String^> urls [private]

Definition at line 27 of file Scenario12.xaml.h.

Windows::Devices::PointOfService::LineDisplayWindow verticalScrollableWindow [private]

Definition at line 35 of file Scenario7_ScrollingContentUsingMarquee.xaml.h.

Platform::String VIDEO_ENCODING_STRING [private]

Definition at line 33 of file StreamResolutionHelper.h.

Windows::Foundation::EventRegistrationToken visibilityToken [private]

Definition at line 44 of file Scenario1_DataEvents.xaml.h.

int32 walkingStepCount [private]

Definition at line 43 of file Scenario1_Events.xaml.h.

Windows::Devices::Enumeration::DeviceWatcher watcher [private]

Definition at line 36 of file Scenario1_SelectDisplay.xaml.h.

bool watchersStarted [private]

Definition at line 47 of file Scenario1_DeviceConnect.xaml.h.

bool watchersSuspended [private]

Definition at line 46 of file Scenario1_DeviceConnect.xaml.h.

bool watcherStarted [private]

Definition at line 161 of file EventHandlerForDevice.h.

bool watcherSuspended [private]

Definition at line 160 of file EventHandlerForDevice.h.

Windows::Devices::WiFiDirect::WiFiDirectDevice wfdDevice [private]

Definition at line 105 of file SocketReaderWriter.h.

Windows::Foundation::Collections::IObservableVector<WindowInfo^> windowList = ref new Platform::Collections::Vector<WindowInfo^>() [private]

Definition at line 108 of file Scenario3_UsingWindows.xaml.h.

Windows::Foundation::EventRegistrationToken windowResizeToken [private]

Definition at line 43 of file Scenario1_Basic.xaml.h.

Windows::Foundation::EventRegistrationToken windowSizeChangedToken [private]

Definition at line 37 of file Scenario1_Basic.xaml.h.

bool windowVisible [private]

Definition at line 102 of file Scenario1_LowLatencyInput.xaml.h.

OcrWord word [private]

Definition at line 96 of file WordOverlay.h.

std::vector< WordOverlay^> wordBoxes [private]

Definition at line 47 of file OcrCapturedImage.xaml.h.

double wordHeight [private]

Definition at line 100 of file WordOverlay.h.

Thickness wordPosition [private]

Definition at line 98 of file WordOverlay.h.

double wordWidth [private]

Definition at line 99 of file WordOverlay.h.

unsigned int writeCounter = 0 [private]

Definition at line 29 of file Scenario5_DeviceReadWrite.xaml.h.

Windows::UI::Input::GestureRecognizer xamlGestureRecognizer [private]

Definition at line 36 of file Scenario1_LowLatencyInput.xaml.h.

Property Documentation

Windows::Foundation::Collections::IObservableVector< ConnectedDevice^> _connectedDevices

Definition at line 29 of file Scenario1_Advertiser.xaml.h.

Windows::Foundation::Collections::IObservableVector<DiscoveredDevice^> _discoveredDevices

Definition at line 29 of file Scenario2_Connector.xaml.h.

Platform::String _displayTime

Definition at line 46 of file Scenario2_Load.xaml.h.

bool _isSent

Definition at line 48 of file Scenario2_Load.xaml.h.

int _percentComplete

Definition at line 46 of file Scenario7_DownloadReordering.xaml.h.

Platform::String _stateText

Definition at line 48 of file Scenario7_DownloadReordering.xaml.h.

Vector<TextMessage^> _storage = ref new Vector<TextMessage^>()

Definition at line 168 of file Scenario2_Load.xaml.cpp.

event BindableVectorChangedEventHandler _storageChanged

Definition at line 169 of file Scenario2_Load.xaml.cpp.

EventRegistrationToken _token

Definition at line 170 of file Scenario2_Load.xaml.cpp.

Windows::Foundation::Collections::IVector< SampleDataModel^> AllItems

Definition at line 26 of file Scenario2.xaml.h.

Platform::String cardName

Definition at line 41 of file Scenario7_ListSmartCards.xaml.h.

Platform::String ClassName

Definition at line 38 of file SampleConfiguration.h.

Windows::UI::Color Color

Definition at line 23 of file Functions.xaml.h.

Windows::Foundation::Collections::IObservableVector<ColorEntry^> ColorEntries

Definition at line 46 of file Functions.xaml.h.

Platform::String ColorName

Definition at line 22 of file Functions.xaml.h.

Platform::String Description

Definition at line 37 of file SampleConfiguration.h.

Windows::Devices::Enumeration::DeviceClass DeviceClassSelector

Definition at line 37 of file DisplayHelpers.h.

Platform::String deviceId

Definition at line 105 of file SampleConfiguration.h.

Windows::Foundation::Collections::IVectorView<Windows::Devices::Enumeration::DeviceInformationKind> DeviceInformationKinds

Definition at line 176 of file DisplayHelpers.h.

Platform::String DisplayName

Definition at line 31 of file FrameSourceViewModels.h.

Platform::String Email

Definition at line 15 of file Account.h.

Windows::Foundation::Collections::IObservableVector<xBindSampleModel::IEmployee^> Employees

Definition at line 21 of file ListsAndTemplates.xaml.h.

bool enabled

Definition at line 153 of file SampleConfiguration.h.

Windows::Media::Capture::Frames::MediaFrameFormat Format

Definition at line 84 of file FrameSourceViewModels.h.

Platform::String Id

Definition at line 30 of file FrameSourceViewModels.h.

int id

Definition at line 63 of file Scenario3_UsingWindows.xaml.h.

Windows::Foundation::Uri ImageSourceUri

Definition at line 25 of file Scenario3.xaml.h.

boolean inCollection

Definition at line 34 of file ItemsListViewModel.h.

bool IsNew

Definition at line 59 of file Functions.xaml.h.

Windows::Devices::Enumeration::DeviceInformationKind Kind

Definition at line 38 of file DisplayHelpers.h.

Windows::UI::Xaml::Controls::Symbol LassoSelect

Definition at line 28 of file Scenario2.xaml.h.

Windows::Devices::Geolocation::Geopoint Location

Definition at line 24 of file Scenario3.xaml.h.

Windows::UI::Xaml::Controls::ListView m_accountListView [static]

Definition at line 20 of file UserSelect.xaml.h.

Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IRandomAccessStreamWithContentType^> m_moderateMarginsIconAsyncOperation [private]

Definition at line 109 of file Scenario3CustomOptions.xaml.h.

Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IRandomAccessStreamWithContentType^> m_narrowMarginsIconAsyncOperation [private]

Definition at line 110 of file Scenario3CustomOptions.xaml.h.

bool m_showHeader [private]

Definition at line 112 of file Scenario3CustomOptions.xaml.h.

TextLayoutImageSource m_textLayoutImageSource

Definition at line 56 of file Scenario1_DefaultSpacing.xaml.h.

Platform::Array< LineMetrics^> m_textLayoutLineMetrics

Definition at line 58 of file Scenario1_DefaultSpacing.xaml.h.

Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IRandomAccessStreamWithContentType^> m_wideMarginsIconAsyncOperation [private]

Definition at line 108 of file Scenario3CustomOptions.xaml.h.

xBindSampleModel::DataModel Model

Definition at line 27 of file BasicTests.xaml.h.

int MyInt

Definition at line 26 of file BasicTests.xaml.h.

Platform::String nodeNamespace

Definition at line 139 of file SampleConfiguration.h.

Platform::String nodeValue

Definition at line 141 of file SampleConfiguration.h.

Windows::Foundation::Point NormalizedAnchorPoint

Definition at line 26 of file Scenario3.xaml.h.

Platform::String NullStringProperty

Definition at line 46 of file BasicTests.xaml.h.

Platform::String price

Definition at line 32 of file ItemsListViewModel.h.

Windows::UI::Xaml::Controls::Frame PrintFrame

Definition at line 92 of file Scenario4PageRange.xaml.h.

Platform::String productKind

Definition at line 35 of file ItemsListViewModel.h.

Windows::Devices::Enumeration::DevicePairingProtectionLevel ProtectionLevel

Definition at line 203 of file DisplayHelpers.h.

Platform::String Selector

Definition at line 39 of file DisplayHelpers.h.

Windows::Media::Capture::Frames::MediaFrameSourceGroup SourceGroup

Definition at line 32 of file FrameSourceViewModels.h.

Windows::Media::Capture::Frames::MediaFrameSourceInfo SourceInfo

Definition at line 48 of file FrameSourceViewModels.h.

Windows::Foundation::Collections::IVectorView<FrameSourceInfoModel^> SourceInfos

Definition at line 33 of file FrameSourceViewModels.h.

Windows::Devices::Sensors::PedometerStepKind stepKind

Definition at line 86 of file Scenario2_History.xaml.h.

INT32 stepsCount

Definition at line 88 of file Scenario2_History.xaml.h.

Windows::Foundation::TimeSpan stepsDuration

Definition at line 89 of file Scenario2_History.xaml.h.

Platform::String storeId

Definition at line 36 of file ItemsListViewModel.h.

Windows::UI::Xaml::Controls::RichTextBlock TextContentBlock

Definition at line 21 of file PageToPrint.xaml.h.

Platform::String Title

Definition at line 36 of file SampleConfiguration.h.

Windows::UI::Xaml::Controls::Symbol TouchWriting

Definition at line 29 of file Scenario2.xaml.h.

bool UpdateStatus

Definition at line 28 of file DeviceWatcherHelper.h.

bool UsesPassport

Definition at line 18 of file Account.h.

ServiceViewModel ViewModel

Definition at line 25 of file Scenario1_MeteringData.xaml.h.

The documentation for this class was generated from the following files:

Accelerometer/cpp/Scenario0_Choose.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.h

CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.h

ComplexInk/cpp/Scenario1_CustomDry.xaml.h

MapControl/cpp/Scenario11.xaml.h

SimpleCommunication/cpp/Scenario1_LowLatency.xaml.h

SimpleCommunication/cpp/Scenario2_VideoChat.xaml.h

WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.h

XamlBottomUpList/cpp/Scenario2_Load.xaml.h

Accelerometer/cpp/Scenario1_DataEvents.xaml.h

Accelerometer/cpp/Scenario2_ShakeEvents.xaml.h

Accelerometer/cpp/Scenario3_Polling.xaml.h

Accelerometer/cpp/Scenario4_OrientationChanged.xaml.h

Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.h

ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.h

ActivitySensor/cpp/Scenario2_History.xaml.h

ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.h

ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.h

Altimeter/cpp/Scenario1_DataEvents.xaml.h

Altimeter/cpp/Scenario2_Polling.xaml.h

AnimationMetrics/cpp/Scenario1_Metrics.xaml.h

ApplicationResources/cpp/scenario1.xaml.h

ApplicationResources/cpp/scenario10.xaml.h

ApplicationResources/cpp/scenario11.xaml.h

ApplicationResources/cpp/scenario12.xaml.h

ApplicationResources/cpp/scenario13.xaml.h

ApplicationResources/cpp/scenario2.xaml.h

ApplicationResources/cpp/scenario3.xaml.h

ApplicationResources/cpp/scenario4.xaml.h

ApplicationResources/cpp/scenario5.xaml.h

ApplicationResources/cpp/scenario7.xaml.h

ApplicationResources/cpp/scenario8.xaml.h

BackButton/cpp/App.xaml.h

BackButton/cpp/MainPage.xaml.h

BackButton/cpp/Scenario1.xaml.h

BackgroundActivation/cpp/BackgroundActivity.h

BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.h

BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.h

BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.h

BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.h

BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.h

BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h

BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.h

BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.h

BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.h

BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h

BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.h

Barometer/cpp/Scenario1_DataEvents.xaml.h

Barometer/cpp/Scenario2_Polling.xaml.h

BasicInput/cpp/1-InputEvents.xaml.h

BasicInput/cpp/2-PointerPointProperties.xaml.h

BasicInput/cpp/3-DeviceCapabilities.xaml.h

BasicInput/cpp/4-XAMLManipulations.xaml.h

BasicInput/cpp/5-GestureRecognizer.xaml.h

CameraFrames/cpp/FrameRenderer.h

CameraFrames/cpp/FrameSourceViewModels.h

CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.h

CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.h

CameraFrames/cpp/SimpleLogger.h

CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.h

CameraProfile/cpp/Scenario2_ConcurrentProfile.xaml.h

CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.h

CameraResolution/cpp/Scenario1_PreviewSettings.xaml.h

CameraResolution/cpp/Scenario2_PhotoSettings.xaml.h

CameraResolution/cpp/Scenario3_AspectRatio.xaml.h

CameraResolution/cpp/StreamResolutionHelper.h

CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.h

CameraStreamCorrelation/cpp/SimpleLogger.h

CameraStreamCorrelation/cpp/SkeletalFrameRenderer.h

CashDrawer/cpp/Scenario1_OpenDrawer.xaml.h

CashDrawer/cpp/Scenario2_CloseDrawer.xaml.h

ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.h

Compass/cpp/CalibrationBar.xaml.h

Compass/cpp/Scenario1_DataEvents.xaml.h

Compass/cpp/Scenario2_Polling.xaml.h

Compass/cpp/Scenario3_Calibration.xaml.h

ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.h

ContactCards/cpp/Scenario1_Mini.xaml.h

ContactCards/cpp/Scenario2_DelayMini.xaml.h

ContactCards/cpp/Scenario3_Full.xaml.h

ContactPicker/cpp/Scenario1_Single.xaml.h

ContactPicker/cpp/Scenario2_Multiple.xaml.h

ContextMenu/cpp/Scenario1.xaml.h

ContextMenu/cpp/Scenario2.xaml.h

CustomCapability/cpp/DeviceList.h

CustomCapability/cpp/Scenario1_MeteringData.xaml.h

CustomCapability/cpp/Scenario2_DeviceConnect.xaml.h

CustomCapability/cpp/Scenario3_DeviceIO.xaml.h

CustomCapability/cpp/Scenario4_DeviceEvents.xaml.h

CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.h

CustomCapability/cpp/Scenario6_CustomTrigger.xaml.h

CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.h

CustomCapability/cpp/ServiceViewModel.h

CustomHidDeviceAccess/cpp/DeviceListEntry.h

CustomHidDeviceAccess/cpp/EventHandlerForDevice.h

CustomHidDeviceAccess/cpp/SampleConfiguration.h

CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.h

CustomHidDeviceAccess/cpp/Scenario3_InputReportEvents.xaml.h

CustomSensors/cpp/Scenario1_DataEvents.xaml.h

CustomSensors/cpp/Scenario2_Polling.xaml.h

D2DSvgImage/cpp/App.xaml.h

D2DSvgImage/cpp/DirectXPage.xaml.h

DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.h

DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.h

DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.h

DeviceEnumerationAndPairing/cpp/DisplayHelpers.h

DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.h

DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.h

DisplayOrientation/cpp/Scenario1_Orientation.xaml.h

DpiScaling/cpp/Scenario1.xaml.h

DpiScaling/cpp/Scenario2.xaml.h

DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.h

DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario2_UniformSpacing.xaml.h

DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario3_ProportionalSpacing.xaml.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.h

ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.h

ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.h

ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.h

ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.h

FileAccess/cpp/Scenario10_Delete.xaml.h

FileAccess/cpp/Scenario11_TryGet.xaml.h

FileAccess/cpp/Scenario1_Create.xaml.h

FileAccess/cpp/Scenario2_GetParent.xaml.h

FileAccess/cpp/Scenario3_Text.xaml.h

FileAccess/cpp/Scenario4_Bytes.xaml.h

FileAccess/cpp/Scenario5_Stream.xaml.h

FileAccess/cpp/Scenario6_Properties.xaml.h

FileAccess/cpp/Scenario7_FutureAccess.xaml.h

FileAccess/cpp/Scenario8_Copy.xaml.h

FileAccess/cpp/Scenario9_Compare.xaml.h

FilePicker/cpp/Scenario1_SingleFile.xaml.h

FilePicker/cpp/Scenario2_MultiFile.xaml.h

FilePicker/cpp/Scenario3_SingleFolder.xaml.h

FilePicker/cpp/Scenario4_SaveFile.xaml.h

FilePicker/cpp/Scenario5_TriggerCFU.xaml.h

FileThumbnails/cpp/Scenario1.xaml.h

FileThumbnails/cpp/Scenario2.xaml.h

FileThumbnails/cpp/Scenario3.xaml.h

FileThumbnails/cpp/Scenario4.xaml.h

FileThumbnails/cpp/Scenario5.xaml.h

FileThumbnails/cpp/Scenario6.xaml.h

FolderEnumeration/cpp/Scenario3.xaml.h

FullScreenMode/cpp/Scenario1_Basic.xaml.h

Geotag/cpp/Scenario1_Geotag.xaml.h

Gyrometer/cpp/Scenario1_DataEvents.xaml.h

Gyrometer/cpp/Scenario2_Polling.xaml.h

Gyrometer/cpp/Scenario3_Porting.xaml.h

Inclinometer/cpp/CalibrationBar.xaml.h

Inclinometer/cpp/Scenario1_DataEvents.xaml.h

Inclinometer/cpp/Scenario2_Polling.xaml.h

Inclinometer/cpp/Scenario3_Calibration.xaml.h

IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.h

IoT-GPIO/cpp/Scenario2_Listen.xaml.h

IoT-I2C/cpp/Scenario1_ReadData.xaml.h

IoT-SPI/cpp/Scenario1_ReadData.xaml.h

KeyCredentialManager/cpp/Account.h

KeyCredentialManager/cpp/Content.xaml.h

KeyCredentialManager/cpp/SignIn.xaml.h

KeyCredentialManager/cpp/UserSelect.xaml.h

LampDevice/cpp/Scenario1_GetLamp.xaml.h

LampDevice/cpp/Scenario2_EnableSettings.xaml.h

LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.h

LibraryManagement/cpp/S2_ListFolders.xaml.h

LibraryManagement/cpp/S3_RemoveFolder.xaml.h

LightSensor/cpp/Scenario1_DataEvents.xaml.h

LightSensor/cpp/Scenario2_Polling.xaml.h

LineDisplay/cpp/Scenario1_SelectDisplay.xaml.h

LineDisplay/cpp/Scenario2_DisplayText.xaml.h

LineDisplay/cpp/Scenario3_UsingWindows.xaml.h

LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.h

LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.h

LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.h

LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.h

Logging/cpp/FileLoggingSessionScenario.h

Logging/cpp/LoggingScenarioEventArgs.h

Logging/cpp/LoggingSessionScenario.h

Logging/cpp/Scenario1.xaml.h

LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.h

MagneticStripeReader/cpp/Scenario1_BankCards.xaml.h

MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.h

MapControl/cpp/Scenario1.xaml.h

MapControl/cpp/Scenario10.xaml.h

MapControl/cpp/Scenario12.xaml.h

MapControl/cpp/Scenario2.xaml.h

MapControl/cpp/Scenario3.xaml.h

MapControl/cpp/Scenario4.xaml.h

MapControl/cpp/Scenario5.xaml.h

MapControl/cpp/Scenario6.xaml.h

MapControl/cpp/Scenario7.xaml.h

MapControl/cpp/Scenario8.xaml.h

MapControl/cpp/Scenario9.xaml.h

MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.h

MediaEditing/cpp/Scenario2_AppendClips.xaml.h

MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.h

MediaEditing/cpp/Scenario4_AddOverlays.xaml.h

MediaTranscoding/cpp/Scenario1_Default.xaml.h

MediaTranscoding/cpp/Scenario2_Custom.xaml.h

MediaTranscoding/cpp/Scenario3_Trim.xaml.h

MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.h

MessageDialog/cpp/CancelCommand.xaml.h

MessageDialog/cpp/CompletedCallback.xaml.h

MessageDialog/cpp/CustomCommand.xaml.h

MessageDialog/cpp/DefaultCloseCommand.xaml.h

OCR/cpp/OcrCapturedImage.xaml.h

OCR/cpp/OcrFileImage.xaml.h

OCR/cpp/WordOverlay.h

OrientationSensor/cpp/CalibrationBar.xaml.h

OrientationSensor/cpp/Scenario0_Choose.xaml.h

OrientationSensor/cpp/Scenario1_DataEvents.xaml.h

OrientationSensor/cpp/Scenario2_Polling.xaml.h

OrientationSensor/cpp/Scenario3_Calibration.xaml.h

Package/cpp/scenario1_identity.xaml.h

Package/cpp/scenario2_installedlocation.xaml.h

Package/cpp/scenario3_dependencies.xaml.h

PasswordVault/cpp/Scenario1_Save.xaml.h

PasswordVault/cpp/Scenario2_Manage.xaml.h

PdfDocument/cpp/Scenario1_Render.xaml.h

Pedometer/cpp/Scenario1_Events.xaml.h

Pedometer/cpp/Scenario2_History.xaml.h

Pedometer/cpp/Scenario3_CurrentStepCount.xaml.h

Pedometer/cpp/Scenario4_BackgroundTask.xaml.h

Personalization/cpp/SetLockScreenImage.xaml.h

Playlists/cpp/Scenario1_Create.xaml.h

Playlists/cpp/Scenario2_Display.xaml.h

Playlists/cpp/Scenario3_Add.xaml.h

Playlists/cpp/Scenario4_Remove.xaml.h

Playlists/cpp/Scenario5_Clear.xaml.h

PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.h

PosPrinter/cpp/Scenario1_ReceiptPrinter.xaml.h

PosPrinter/cpp/Scenario2_PrintReceipt.xaml.h

PosPrinter/cpp/Scenario3_MultipleClaims.xaml.h

Printing/cpp/PageToPrint.xaml.h

Printing/cpp/Scenario1Basic.xaml.h

Printing/cpp/Scenario2StandardOptions.xaml.h

Printing/cpp/Scenario3CustomOptions.xaml.h

Printing/cpp/Scenario4PageRange.xaml.h

Printing/cpp/Scenario5Photos.xaml.h

Printing/cpp/Scenario6DisablePreview.xaml.h

ProximitySensor/cpp/Scenario1_DataEvents.xaml.h

ProximitySensor/cpp/Scenario2_Polling.xaml.h

ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.h

ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.h

RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.h

RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.h

RelativeInclinometer/cpp/Scenario2_Polling.xaml.h

ResizeAppView/cpp/Scenario1_Basic.xaml.h

ShareSource/cpp/ShareDelayRenderedFiles.xaml.h

ShareSource/cpp/ShareFiles.xaml.h

ShareSource/cpp/ShareImage.xaml.h

SimpleCommunication/cpp/Utils.h

SimpleInk/cpp/RecognizerHelper.h

SimpleInk/cpp/Scenario11.xaml.h

SimpleInk/cpp/Scenario2.xaml.h

SimpleInk/cpp/Scenario3.xaml.h

SimpleInk/cpp/Scenario4.xaml.h

SimpleInk/cpp/Scenario5.xaml.h

SimpleInk/cpp/Scenario6.xaml.h

SimpleInk/cpp/Scenario7.xaml.h

SimpleInk/cpp/Scenario8.xaml.h

SimpleInk/cpp/Scenario9.xaml.h

SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.h

SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.h

SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.h

SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.h

SmartCard/cpp/Scenario7_ListSmartCards.xaml.h

SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.h

SpatialSound/cpp/Scenario2_CardioidSound.xaml.h

SpatialSound/cpp/Scenario3_CustomDecay.xaml.h

SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.h

SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.h

SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h

Store/cpp/ItemsListViewModel.h

Store/cpp/Scenario1_TrialMode.xaml.h

Store/cpp/Scenario2_InAppPurchase.xaml.h

Store/cpp/Scenario3_UnmanagedConsumable.xaml.h

Store/cpp/Scenario4_ConsumableProduct.xaml.h

Store/cpp/Scenario5_UserCollection.xaml.h

Store/cpp/Scenario6_AppListingURI.xaml.h

Store/cpp/Scenario7_B2B.xaml.h

Syndication/cpp/SampleConfiguration.h

TextSuggestion/cpp/Scenario1_Conversion.xaml.h

TextSuggestion/cpp/Scenario2_Prediction.xaml.h

TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.h

TitleBar/cpp/CustomTitleBar.xaml.h

TitleBar/cpp/Scenario1_Colors.xaml.h

TitleBar/cpp/Scenario2_Extend.xaml.h

UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.h

UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.h

UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.h

UserInteractionMode/cpp/Scenario1_Basic.xaml.h

WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.h

WebAccountManagement/cpp/Scenario2_MSA.xaml.h

WebAccountManagement/cpp/Scenario3_AAD.xaml.h

WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.h

WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.h

WebSocket/cpp/Scenario1_UTF8.xaml.h

WebSocket/cpp/Scenario2_Binary.xaml.h

WebSocket/cpp/Scenario3_ClientAuthentication.xaml.h

WebSocket/cpp/Scenario4_PartialReadWrite.xaml.h

WiFiDirect/cpp/Scenario1_Advertiser.xaml.h

WiFiDirect/cpp/Scenario2_Connector.xaml.h

WiFiDirect/cpp/SocketReaderWriter.h

XamlBind/cpp/App.xaml.h

XamlBind/cpp/BasicTests.xaml.h

XamlBind/cpp/EventTests.xaml.h

XamlBind/cpp/Functions.xaml.h

XamlBind/cpp/ListsAndTemplates.xaml.h

XamlBind/cpp/MainPage.xaml.h

XamlBind/cpp/MyUserControl1.xaml.h

XamlBind/cpp/OtherBindings.xaml.h

XamlBind/cpp/PhasingTests.xaml.h

XamlBind/cpp/SampleConfiguration.h

XamlBottomUpList/cpp/Scenario1_Basic.xaml.h

XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp

XamlCommanding/cpp/DynamicCommandBar.h

XamlContextMenu/cpp/SampleDataModel.h

XamlContextMenu/cpp/Scenario1.xaml.h

XamlContextMenu/cpp/Scenario2.xaml.h

XamlContextMenu/cpp/Scenario3.xaml.h

XamlDragAndDrop/cpp/Scenario1_ListView.xaml.h

XamlDragAndDrop/cpp/Scenario2_DragUICustomization.xaml.h

XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.h

BackButton/cpp/SecondaryPage.xaml.h

Calendar/cpp/Scenario1_Data.xaml.h

Calendar/cpp/Scenario2_Stats.xaml.h

Calendar/cpp/Scenario3_Enum.xaml.h

Calendar/cpp/Scenario4_UnicodeExtensions.xaml.h

Calendar/cpp/Scenario5_TimeZone.xaml.h

ContentIndexer/cpp/S1_AddWithAPI.xaml.h

ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.h

ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.h

ContentIndexer/cpp/S4_CheckIndexRevision.xaml.h

ContentIndexer/cpp/S5_AddWithAppContent.xaml.h

ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.h

ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.h

CredentialPicker/cpp/Scenario1_Message.xaml.h

CredentialPicker/cpp/Scenario2_MessageCaption.xaml.h

CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.h

CustomHidDeviceAccess/cpp/Scenario2_FeatureReports.xaml.h

CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.h

DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.h

DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.h

DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.h

DateTimeFormatting/cpp/Scenario4_Override.xaml.h

DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.h

DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.h

DisablingScreenCapture/cpp/Scenario1_Enable.xaml.h

DisablingScreenCapture/cpp/Scenario2_Disable.xaml.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.h

DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.h

FileSearch/cpp/Scenario1.xaml.h

FolderEnumeration/cpp/Scenario1.xaml.h

FolderEnumeration/cpp/Scenario2.xaml.h

FolderEnumeration/cpp/Scenario4.xaml.h

FullScreenMode/cpp/Scenario2_Launch.xaml.h

GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.h

GlobalizationPreferences/cpp/Scenario2_Lang.xaml.h

GlobalizationPreferences/cpp/Scenario3_Region.xaml.h

GlobalizationPreferences/cpp/Scenario4_Input.xaml.h

JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.h

JumpList/cpp/Scenario1_Launched.xaml.h

JumpList/cpp/Scenario2_Remove.xaml.h

JumpList/cpp/Scenario3_CustomItems.xaml.h

JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.h

JumpList/cpp/Scenario5_IsSupported.xaml.h

LibraryManagement/cpp/S1_AddFolder.xaml.h

Logging/cpp/LoggingChannelScenario.h

Logging/cpp/Scenario2.xaml.h

Logging/cpp/Scenario3.xaml.h

NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.h

NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.h

NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.h

NumberFormatting/cpp/Scenario4_NumberParsing.xaml.h

NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.h

NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.h

NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.h

Personalization/cpp/AddImageFeedScenario.xaml.h

Printing/cpp/ContinuationPage.xaml.h

Printing/cpp/PreviewUnavailable.xaml.h

ResizeAppView/cpp/Scenario2_Launch.xaml.h

SemanticTextQuery/cpp/Find.xaml.h

SemanticTextQuery/cpp/FindInProperty.xaml.h

SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.h

ShareSource/cpp/SetErrorMessage.xaml.h

ShareSource/cpp/ShareApplicationLink.xaml.h

ShareSource/cpp/ShareCustomData.xaml.h

ShareSource/cpp/ShareCustomProvider.xaml.h

ShareSource/cpp/ShareHtml.xaml.h

ShareSource/cpp/ShareText.xaml.h

ShareSource/cpp/ShareWebLink.xaml.h

SimpleInk/cpp/Scenario1.xaml.h

SimpleInk/cpp/Scenario10.xaml.h

SimpleInk/cpp/Scenario12.xaml.h

SmartCard/cpp/ChallengeResponseAlgorithm.h

SmartCard/cpp/Scenario2_ChangePin.xaml.h

SmartCard/cpp/Scenario3_ResetPin.xaml.h

SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.h

SmartCard/cpp/Scenario5_VerifyResponse.xaml.h

SmartCard/cpp/Scenario8_Transmit.xaml.h

Store/cpp/SampleConfiguration.h

TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.h

TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.h

TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.h

TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.h

UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.h

UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.h

UserDataAccountManager/cpp/SampleConfiguration.h

WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.h

XamlAnimatedGif/cpp/Scenario1_Basic.xaml.h

XamlBind/cpp/Templates.xaml.h

XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.h

XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.h

XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.h

XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.h

XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.h

XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.h

XamlCommanding/cpp/Scenario2_Icons.xaml.h

XamlCommanding/cpp/Scenario3_Events.xaml.h

XamlCommanding/cpp/Scenario4_Control.xaml.h

XamlCommanding/cpp/Scenario5_Multiple.xaml.h

XamlCommanding/cpp/Scenario6_Styling.xaml.h

XamlCommanding/cpp/Scenario7_CustomContent.xaml.h

XamlCommanding/cpp/Scenario8_Reflow.xaml.h

Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by 1.7.1


Windows-Universal-Examples: sealed::sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • sealed
  • sealed::sealed
Public Member Functions | Private Attributes

sealed::sealed Class Reference

List of all members.

Public Member Functions

void | Add (INT64 sizeValue)
INT64 | GetSize ()
SizeCounter ()

Private Attributes

INT64 | size

Detailed Description

Definition at line 44 of file Scenario2_Upload.xaml.h.

Member Function Documentation

void Add ( INT64 sizeValue )
INT64 GetSize ( )
SizeCounter ( )

Member Data Documentation

INT64 size [private]

Definition at line 54 of file Scenario2_Upload.xaml.h.

The documentation for this class was generated from the following file:
  • BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.h
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed::StreamFilteringCriteria Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • sealed
  • sealed::StreamFilteringCriteria
Public Attributes

sealed::StreamFilteringCriteria Struct Reference

List of all members.

Public Attributes

Platform::String | aspectRatio
int | horizontalResolution
Platform::String | subType

Detailed Description

Definition at line 84 of file Scenario1_LowLatency.xaml.h.

Member Data Documentation

Platform::String aspectRatio

Definition at line 86 of file Scenario1_LowLatency.xaml.h.

int horizontalResolution

Definition at line 87 of file Scenario1_LowLatency.xaml.h.

Platform::String subType

Definition at line 88 of file Scenario1_LowLatency.xaml.h.

The documentation for this struct was generated from the following file:
  • SimpleCommunication/cpp/Scenario1_LowLatency.xaml.h
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryAppWindowPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SecondaryAppWindowPage
Public Member Functions

SecondaryAppWindowPage Class Reference

List of all members.

Public Member Functions

SecondaryAppWindowPage ()

Detailed Description

Definition at line 16 of file SecondaryAppWindowPage.xaml.cs.

Constructor & Destructor Documentation

SecondaryAppWindowPage ( ) [inline]

Definition at line 18 of file SecondaryAppWindowPage.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • AppWindow/cs/SecondaryAppWindowPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SecondaryPage
Public Member Functions | Protected Member Functions

SecondaryPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

SecondaryPage ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 24 of file SecondaryPage.xaml.cs.

Constructor & Destructor Documentation

SecondaryPage ( ) [inline]

Definition at line 26 of file SecondaryPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file SecondaryPage.xaml.cs.

        {
            bool optedIn = false;

            if ((bool)e.Parameter)
            {
                optedIn = true;

            }

            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.CanGoBack && optedIn)
            {
                // If we have pages in our in-app backstack and have opted in to showing back, do so
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            }
            else
            {
                // Remove the UI from the title bar if there are no pages in our in-app back stack
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            }
        }

The documentation for this class was generated from the following files:
  • BackButton/cs/SecondaryPage.xaml.cs
  • BackButton/cpp/SecondaryPage.xaml.cpp
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryViewPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SecondaryViewPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SecondaryViewPage Class Reference

List of all members.

Public Member Functions

SecondaryViewPage ()
void | HandleProtocolLaunch (Uri uri)
async void | SwitchAndAnimate (int fromViewId)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | ClearTitle_Click (object sender, RoutedEventArgs e)
Storyboard | CreateEnterAnimation (Panel layoutRoot)
async void | GoToMain_Click (object sender, RoutedEventArgs e)
async void | HideView_Click (object sender, RoutedEventArgs e)
async void | ProtocolLaunch_Click (object sender, RoutedEventArgs e)
async void | SetTitle (string newTitle)
void | SetTitle_Click (object sender, RoutedEventArgs e)
async void | ViewLifetimeControl_Released (Object sender, EventArgs e)

Private Attributes

const int | ANIMATION_OPACITY_END = 1
const int | ANIMATION_OPACITY_START = 0
const int | ANIMATION_TRANSLATION_END = 0
const int | ANIMATION_TRANSLATION_START = 100
const string | EMPTY_TITLE = "<title cleared>"
CoreDispatcher | mainDispatcher
int | mainViewId
ViewLifetimeControl thisViewControl

Detailed Description

Definition at line 24 of file SecondaryViewPage.xaml.cs.

Constructor & Destructor Documentation

SecondaryViewPage ( ) [inline]

Definition at line 37 of file SecondaryViewPage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void ClearTitle_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file SecondaryViewPage.xaml.cs.

        {
            // Clear the title by setting it to blank
            SetTitle("");
            TitleBox.Text = "";
        }

Storyboard CreateEnterAnimation ( Panel layoutRoot ) [inline, private]

Definition at line 172 of file SecondaryViewPage.xaml.cs.

        {
            var enterAnimation = new Storyboard();

            // Use the AnimationDescription object if available. Otherwise, return an empty storyboard (no animation).
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Core.AnimationMetrics.AnimationDescription"))
            {
                Storyboard.SetTarget(enterAnimation, layoutRoot);

                var ad = new AnimationDescription(AnimationEffect.EnterPage, AnimationEffectTarget.Primary);
                for (int i = 0; i < layoutRoot.Children.Count; i++)
                {
                    // Add a render transform to the existing one just for animations
                    var element = layoutRoot.Children[i];
                    var tg = new TransformGroup();
                    tg.Children.Add(new TranslateTransform());
                    tg.Children.Add(element.RenderTransform);
                    element.RenderTransform = tg;

                    // Calculate the stagger for each animation. Note that this has a max
                    var delayMs = Math.Min(ad.StaggerDelay.TotalMilliseconds * i * ad.StaggerDelayFactor, ad.DelayLimit.Milliseconds);
                    var delay = TimeSpan.FromMilliseconds(delayMs);

                    foreach (var description in ad.Animations)
                    {
                        var animation = new DoubleAnimationUsingKeyFrames();

                        // Start the animation at the right offset
                        var startSpline = new SplineDoubleKeyFrame();
                        startSpline.KeyTime = TimeSpan.FromMilliseconds(0);
                        Storyboard.SetTarget(animation, element);

                        // Hold at that offset until the stagger delay is hit
                        var middleSpline = new SplineDoubleKeyFrame();
                        middleSpline.KeyTime = delay;

                        // Animation from delayed time to last time
                        var endSpline = new SplineDoubleKeyFrame();
                        endSpline.KeySpline = new KeySpline() { ControlPoint1 = description.Control1, ControlPoint2 = description.Control2 };
                        endSpline.KeyTime = description.Duration + delay;

                        // Do the translation
                        if (description.Type == PropertyAnimationType.Translation)
                        {
                            startSpline.Value = ANIMATION_TRANSLATION_START;
                            middleSpline.Value = ANIMATION_TRANSLATION_START;
                            endSpline.Value = ANIMATION_TRANSLATION_END;

                            Storyboard.SetTargetProperty(animation, "(UIElement.RenderTransform).(TransformGroup.Children)[0].X");
                        }
                        // Opacity
                        else if (description.Type == PropertyAnimationType.Opacity)
                        {
                            startSpline.Value = ANIMATION_OPACITY_START;
                            middleSpline.Value = ANIMATION_OPACITY_START;
                            endSpline.Value = ANIMATION_OPACITY_END;

                            Storyboard.SetTargetProperty(animation, "Opacity");
                        }
                        else
                        {
                            throw new Exception("Encountered an unexpected animation type.");
                        }

                        // Put the final animation together
                        animation.KeyFrames.Add(startSpline);
                        animation.KeyFrames.Add(middleSpline);
                        animation.KeyFrames.Add(endSpline);
                        enterAnimation.Children.Add(animation);
                    }
                }
            }
            return enterAnimation;
        }

async void GoToMain_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 52 of file SecondaryViewPage.xaml.cs.

        {
            // Switch to the main view without explicitly requesting
            // that this view be hidden
            thisViewControl.StartViewInUse();
            await ApplicationViewSwitcher.SwitchAsync(mainViewId);
            thisViewControl.StopViewInUse();
        }

void HandleProtocolLaunch ( Uri uri ) [inline]

Definition at line 128 of file SecondaryViewPage.xaml.cs.

        {
            // This code should only get executed if DisableSystemActivationPolicy
            // has not been called.
            ProtocolText.Visibility = Visibility.Visible;
            ProtocolText.Text = uri.AbsoluteUri;
        }

async void HideView_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 61 of file SecondaryViewPage.xaml.cs.

        {
            // Switch to main and hide this view entirely from the user
            thisViewControl.StartViewInUse();
            await ApplicationViewSwitcher.SwitchAsync(mainViewId,
                ApplicationView.GetForCurrentView().Id,
                ApplicationViewSwitchingOptions.ConsolidateViews);
            thisViewControl.StopViewInUse();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 42 of file SecondaryViewPage.xaml.cs.

        {
            thisViewControl = (ViewLifetimeControl) e.Parameter;
            mainViewId = ((App)App.Current).MainViewId;
            mainDispatcher = ((App)App.Current).MainDispatcher;

            // When this view is finally release, clean up state
            thisViewControl.Released += ViewLifetimeControl_Released;
        }

async void ProtocolLaunch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 136 of file SecondaryViewPage.xaml.cs.

        {
            // The activation will always end up on the same page unless you
            // create an external protocol activation.
            thisViewControl.StartViewInUse();
            await Launcher.LaunchUriAsync(new Uri("multiple-view-sample://basiclaunch/"));
            thisViewControl.StopViewInUse();
        }

async void SetTitle ( string newTitle ) [inline, private]

Definition at line 85 of file SecondaryViewPage.xaml.cs.

        {
            var thisViewId = ApplicationView.GetForCurrentView().Id;
            ApplicationView.GetForCurrentView().Title = newTitle;
            thisViewControl.StartViewInUse();

            // The title contained in the ViewLifetimeControl object is bound to
            // UI elements on the main thread. So, updating the title
            // in this object must be done on the main thread
            await mainDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // Setting the title on ApplicationView to blank will clear the title in
                // the system switcher. It would be good to still have a title in the app's UI.
                if (newTitle == "")
                {
                    newTitle = EMPTY_TITLE;
                }

                ((App)App.Current).UpdateTitle(newTitle, thisViewId);
            });
            thisViewControl.StopViewInUse();
        }

void SetTitle_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file SecondaryViewPage.xaml.cs.

        {
            // Set a title for the window. This title is visible
            // in system switchers
            SetTitle(TitleBox.Text);
        }

async void SwitchAndAnimate ( int fromViewId ) [inline]

Definition at line 145 of file SecondaryViewPage.xaml.cs.

        {
            // This continues the flow from Scenario 3
            thisViewControl.StartViewInUse();

            // Calculate the entrance animation. Recalculate this every time,
            // because the animation description can vary (for example,
            // if the user changes accessibility settings).
            Storyboard enterAnimation = CreateEnterAnimation(LayoutRoot);

            // Before switching, make this view match the outgoing window
            // (go to a blank background)
            enterAnimation.Begin();
            enterAnimation.Pause();
            enterAnimation.Seek(TimeSpan.FromMilliseconds(0));

            // Bring this view onto screen. Since the two view are drawing
            // the same visual, the user will not be able to perceive the switch
            await ApplicationViewSwitcher.SwitchAsync(ApplicationView.GetForCurrentView().Id,
                fromViewId,
                ApplicationViewSwitchingOptions.SkipAnimation);

            // Now that this window is on screen, animate in its contents
            enterAnimation.Begin();
            thisViewControl.StopViewInUse();
        }

async void ViewLifetimeControl_Released | ( | Object | sender,
 |  | EventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 108 of file SecondaryViewPage.xaml.cs.

        {
            ((ViewLifetimeControl)sender).Released -= ViewLifetimeControl_Released;
            // The ViewLifetimeControl object is bound to UI elements on the main thread
            // So, the object must be removed from that thread
            await mainDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ((App)App.Current).SecondaryViews.Remove(thisViewControl);
            });

            // The released event is fired on the thread of the window
            // it pertains to.
            //
            // It's important to make sure no work is scheduled on this thread
            // after it starts to close (no data binding changes, no changes to
            // XAML, creating new objects in destructors, etc.) since
            // that will throw exceptions
            Window.Current.Close();
        }

Member Data Documentation

const int ANIMATION_OPACITY_END = 1 [private]

Definition at line 29 of file SecondaryViewPage.xaml.cs.

const int ANIMATION_OPACITY_START = 0 [private]

Definition at line 28 of file SecondaryViewPage.xaml.cs.

const int ANIMATION_TRANSLATION_END = 0 [private]

Definition at line 27 of file SecondaryViewPage.xaml.cs.

const int ANIMATION_TRANSLATION_START = 100 [private]

Definition at line 26 of file SecondaryViewPage.xaml.cs.

const string EMPTY_TITLE = "<title cleared>" [private]

Definition at line 31 of file SecondaryViewPage.xaml.cs.

CoreDispatcher mainDispatcher [private]

Definition at line 35 of file SecondaryViewPage.xaml.cs.

int mainViewId [private]

Definition at line 34 of file SecondaryViewPage.xaml.cs.

ViewLifetimeControl thisViewControl [private]

Definition at line 33 of file SecondaryViewPage.xaml.cs.

The documentation for this class was generated from the following file:
  • MultipleViews/cs/SecondaryViewPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ServiceViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ServiceViewModel
Public Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes

ServiceViewModel Class Reference

List of all members.

Public Member Functions

bool | NotifyIfAnyError (long errCode)

Properties

internal string | ActualRpcCallbackRate [get, set]
static ServiceViewModel | Current [get, set]
internal string | ExpectedRpcCallbackRate [get, set]
internal string | SampleMessage [get, set]
internal bool | SliderEnabled [get, set]
internal double | SliderValue [get, set]
internal bool | StartButtonEnabled [get, set]
internal bool | StopButtonEnabled [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

ServiceViewModel ()
static long | GetCallbackCount (IntPtr RpcClientHandle, ref long MeteringData)
static long | GetMeteringData (IntPtr RpcClientHandle, ref long MeteringData)
static void | GetSystemTimeAsFileTime (ref FILETIME lpSystemTimeAsFileTime)
static IntPtr | LoadPackagedLibrary (string filename, uint reserved)
async void | NotifyPropertyChangedAsync (string prop)
void | NotifyStatusMessage (string message, NotifyType messageType)
async void | ResumeMeteringService (object sender, object e)
static long | RpcClientClose (IntPtr rpcClient)
static long | RpcClientInitialize (out IntPtr rpcClient)
internal void | SetSamplePeriod (int value)
static long | SetSampleRate (IntPtr rpcClient, int rate)
internal async Task | StartMetering (int sampleRate)
static long | StartMeteringAndWaitForStop (IntPtr RpcClientHandle, long samplePeriod)
internal async Task | StopMetering ()
static long | StopMeteringData (IntPtr RpcClientHandle)
async void | SuspendMeteringService (object sender, SuspendingEventArgs e)

Static Private Member Functions

static | ServiceViewModel ()

Private Attributes

string | actualRpcCallbackRate
Windows.UI.Core.CoreDispatcher | dispatcher
string | expectedRpcCallbackRate
Lazy< bool > | isSupported = new Lazy<bool>(() => LoadPackagedLibrary("RpcClient.dll", 0) != IntPtr.Zero)
LARGE_INTEGER lastUpdateTime
volatile bool | meteringOn
volatile bool | meteringOnWhileSuspension
IntPtr | rpcClient
long | rpcDataCountOld = 0
long[] | sampleArray
string | sampleMessage
int | samplePeriod
uint | sampleRefreshCount = 0
bool | sliderEnabled
double | sliderValue
bool | startButtonEnabled
bool | stopButtonEnabled
bool | stopMeteringRequested

Detailed Description

Definition at line 31 of file ServiceViewModel.cs.

Constructor & Destructor Documentation

ServiceViewModel ( ) [inline, static, private]

Definition at line 63 of file ServiceViewModel.cs.

        {
            Current = new ServiceViewModel();

            // Register for app suspend/resume handlers
            App.Current.Suspending += ServiceViewModel.Current.SuspendMeteringService;
            App.Current.Resuming += ServiceViewModel.Current.ResumeMeteringService;
        }

ServiceViewModel ( ) [inline, private]

Definition at line 176 of file ServiceViewModel.cs.

        {
            // Set default rate
            samplePeriod = 100;

            // Initialize UI state
            startButtonEnabled = true;
            stopButtonEnabled = false;
            sliderEnabled = true;
            sliderValue = samplePeriod;
            actualRpcCallbackRate = "0";
            expectedRpcCallbackRate = "0";

            meteringOn = false;
            meteringOnWhileSuspension = false;

            // Get the dispatcher for notifying property change
            dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;

            sampleArray = new long[1000];
        }

Member Function Documentation

static long GetCallbackCount | ( | IntPtr | RpcClientHandle,
 |  | ref long | MeteringData |
 | ) |  |  | [private]
static long GetMeteringData | ( | IntPtr | RpcClientHandle,
 |  | ref long | MeteringData |
 | ) |  |  | [private]
static void GetSystemTimeAsFileTime ( ref FILETIME lpSystemTimeAsFileTime ) [private]
static IntPtr LoadPackagedLibrary | ( | string | filename,
 |  | uint | reserved |
 | ) |  |  | [private]
bool NotifyIfAnyError ( long errCode ) [inline]

Definition at line 318 of file ServiceViewModel.cs.

        {
            if (errCode != 0)
            {
                meteringOn = false;
                NotifyStatusMessage("Error occured while communicating with RPC server: " + errCode.ToString(), NotifyType.ErrorMessage);

                // Reset button state
                StartButtonEnabled = true;
                StopButtonEnabled = false;
                return true;
            }
            return false;
        }

async void NotifyPropertyChangedAsync ( string prop ) [inline, private]

Definition at line 371 of file ServiceViewModel.cs.

        {
            if (dispatcher != null)
            {
                await dispatcher.RunAsync(
                    Windows.UI.Core.CoreDispatcherPriority.Normal,
                    () => PropertyChanged(this, new PropertyChangedEventArgs(prop)));
            }
        }

void NotifyStatusMessage | ( | string | message,
 |  | NotifyType | messageType |
 | ) |  |  | [inline, private]

Definition at line 310 of file ServiceViewModel.cs.

        {
            MainPage.Current.NotifyUser(message, messageType);
        }

async void ResumeMeteringService | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file ServiceViewModel.cs.

        {
            if (meteringOnWhileSuspension) {
                await StartMetering(samplePeriod);
                meteringOnWhileSuspension = false;
            }
        }

static long RpcClientClose ( IntPtr rpcClient ) [private]
static long RpcClientInitialize ( out IntPtr rpcClient ) [private]
void SetSamplePeriod ( int value ) [inline, private]

Definition at line 356 of file ServiceViewModel.cs.

        {
            samplePeriod = value;
            if (meteringOn)
            {
                long retCode = SetSampleRate(rpcClient, samplePeriod);
                if (!NotifyIfAnyError(retCode))
                {
                    NotifyStatusMessage(
                        "Sample period set to: " + samplePeriod,
                        NotifyType.StatusMessage);
                }
            }
        }

static long SetSampleRate | ( | IntPtr | rpcClient,
 |  | int | rate |
 | ) |  |  | [private]
void StartMetering ( int sampleRate ) [inline, private]

Definition at line 201 of file ServiceViewModel.cs.

        {
            await Task.Run(() =>
            {
                rpcClient = IntPtr.Zero;

                SampleMessage = "";
                StartButtonEnabled = false;
                StopButtonEnabled = true;
                stopMeteringRequested = false;

                if (!isSupported.Value)
                {
                    NotifyStatusMessage("NT service support has not been compiled for this architecture.", NotifyType.ErrorMessage);
                    return;
                }

                if (NotifyIfAnyError(RpcClientInitialize(out rpcClient))) return;

                meteringOn = true;
                sampleRefreshCount = 0;
                sampleArray[0] = 0;

                // Set the sample rate on server
                samplePeriod = sampleRate;
                long retCode = SetSampleRate(rpcClient, sampleRate);

                FILETIME initialSystemTime = new FILETIME();
                GetSystemTimeAsFileTime(ref initialSystemTime);
                lastUpdateTime = new LARGE_INTEGER();
                lastUpdateTime.LowPart = initialSystemTime.dwLowDateTime;
                lastUpdateTime.HighPart = initialSystemTime.dwHighDateTime;

                if (!NotifyIfAnyError(retCode))
                {
                    // Set up worker for UI update.
                    TimeSpan span = new TimeSpan(100 * 10000); // 100ms refresh rate

                    TimerElapsedHandler timerHandler = (ThreadPoolTimer) =>
                    {
                        long meteringData = 0;
                        GetMeteringData(rpcClient, ref meteringData);

                        // If there is no new data, return
                        if (sampleArray[0] == meteringData)
                        {
                            return;
                        }

                        // Arithmetic subtraction of time
                        // https://msdn.microsoft.com/en-us/library/ms724950%28VS.85%29.aspx
                        FILETIME currentSystemTime = new FILETIME();
                        LARGE_INTEGER currentTimeUi = new LARGE_INTEGER();
                        GetSystemTimeAsFileTime(ref currentSystemTime);
                        currentTimeUi.LowPart = currentSystemTime.dwLowDateTime;
                        currentTimeUi.HighPart = currentSystemTime.dwHighDateTime;

                        // Calculate number of samples received since last callback
                        long now = 0, diff = 0;
                        GetCallbackCount(rpcClient, ref now);

                        diff = now - rpcDataCountOld;
                        rpcDataCountOld = now;

                        // Calculate incoming sample rate
                        double rate = (double)diff * 1E7 / (currentTimeUi.QuadPart - lastUpdateTime.QuadPart);
                        ExpectedRpcCallbackRate = (1E3 / samplePeriod).ToString() + " /sec";
                        lastUpdateTime = currentTimeUi;

                        ActualRpcCallbackRate = rate.ToString() + " /sec";

                        // Construct the sample data string
                        string sampleMessage = meteringData + "\n";
                        uint length = (uint)sampleArray.Length;
                        if (sampleRefreshCount < length)
                        {
                            ++sampleRefreshCount;
                            length = sampleRefreshCount;
                        }

                        // Insert the new data point at the top of the array.
                        // Old data falls off the end of the array.
                        for (int i = 1; i < length; ++i)
                        {
                            sampleArray[i] = sampleArray[i - 1];
                            sampleMessage += sampleArray[i] + "\n";
                        }
                        sampleArray[0] = meteringData;

                        SampleMessage = sampleMessage;
                    };

                    ThreadPoolTimer periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(timerHandler, span);
                    NotifyStatusMessage("Metering start command sent successfully", NotifyType.StatusMessage);
                    retCode = StartMeteringAndWaitForStop(rpcClient, sampleRate);
                    meteringOn = false;
                    periodicTimer.Cancel();
                    if (!NotifyIfAnyError(retCode) && !stopMeteringRequested)
                    {
                        NotifyStatusMessage("Rpc server connection closed without stop metering being requested",
                                            NotifyType.ErrorMessage);
                        StartButtonEnabled = true;
                        StopButtonEnabled = false;
                    }
                    RpcClientClose(rpcClient);
                }
            });
        }

static long StartMeteringAndWaitForStop | ( | IntPtr | RpcClientHandle,
 |  | long | samplePeriod |
 | ) |  |  | [private]
void StopMetering ( ) [inline, private]

Definition at line 333 of file ServiceViewModel.cs.

        {
            await Task.Run(() =>
            {
                StopButtonEnabled = false;
                SliderEnabled = false;
                stopMeteringRequested = true;

                if (isSupported.Value)
                {
                    long retCode = StopMeteringData(rpcClient);
                    if (!NotifyIfAnyError(retCode))
                    {
                        NotifyStatusMessage("Metering stop command sent successfully",
                                            NotifyType.StatusMessage);
                    }
                }

                SliderEnabled = true;
                StartButtonEnabled = true;
            });
        }

static long StopMeteringData ( IntPtr RpcClientHandle ) [private]
async void SuspendMeteringService | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 80 of file ServiceViewModel.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            if (meteringOn) {
                await StopMetering();
                meteringOnWhileSuspension = true;
            }
            deferral.Complete();
        }

Member Data Documentation

string actualRpcCallbackRate [private]

Definition at line 105 of file ServiceViewModel.cs.

Windows.UI.Core.CoreDispatcher dispatcher [private]

Definition at line 93 of file ServiceViewModel.cs.

string expectedRpcCallbackRate [private]

Definition at line 104 of file ServiceViewModel.cs.

Lazy<bool> isSupported = new Lazy<bool>(() => LoadPackagedLibrary("RpcClient.dll", 0) != IntPtr.Zero) [private]

Definition at line 90 of file ServiceViewModel.cs.

LARGE_INTEGER lastUpdateTime [private]

Definition at line 95 of file ServiceViewModel.cs.

volatile bool meteringOn [private]

Definition at line 91 of file ServiceViewModel.cs.

volatile bool meteringOnWhileSuspension [private]

Definition at line 92 of file ServiceViewModel.cs.

IntPtr rpcClient [private]

Definition at line 98 of file ServiceViewModel.cs.

long rpcDataCountOld = 0 [private]

Definition at line 96 of file ServiceViewModel.cs.

long [] sampleArray [private]

Definition at line 100 of file ServiceViewModel.cs.

string sampleMessage [private]

Definition at line 103 of file ServiceViewModel.cs.

int samplePeriod [private]

Definition at line 94 of file ServiceViewModel.cs.

uint sampleRefreshCount = 0 [private]

Definition at line 97 of file ServiceViewModel.cs.

bool sliderEnabled [private]

Definition at line 108 of file ServiceViewModel.cs.

double sliderValue [private]

Definition at line 109 of file ServiceViewModel.cs.

bool startButtonEnabled [private]

Definition at line 106 of file ServiceViewModel.cs.

bool stopButtonEnabled [private]

Definition at line 107 of file ServiceViewModel.cs.

bool stopMeteringRequested [private]

Definition at line 99 of file ServiceViewModel.cs.

Property Documentation

internal string ActualRpcCallbackRate [get, set, private]

Definition at line 121 of file ServiceViewModel.cs.

ServiceViewModel Current [static, get, set]

Definition at line 61 of file ServiceViewModel.cs.

internal string ExpectedRpcCallbackRate [get, set, private]

Definition at line 112 of file ServiceViewModel.cs.

internal string SampleMessage [get, set, private]

Definition at line 130 of file ServiceViewModel.cs.

internal bool SliderEnabled [get, set, private]

Definition at line 156 of file ServiceViewModel.cs.

internal double SliderValue [get, set, private]

Definition at line 165 of file ServiceViewModel.cs.

internal bool StartButtonEnabled [get, set, private]

Definition at line 139 of file ServiceViewModel.cs.

internal bool StopButtonEnabled [get, set, private]

Definition at line 147 of file ServiceViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 174 of file ServiceViewModel.cs.

The documentation for this class was generated from the following files:
  • CustomCapability/cs/ServiceViewModel.cs
  • CustomCapability/cpp/ServiceViewModel.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ServicingCompleteTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ServicingCompleteTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ServicingCompleteTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ServicingCompleteTask ()
ServicingCompleteTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario3_ServicingCompleteTask.xaml.cs.

Constructor & Destructor Documentation

ServicingCompleteTask ( ) [inline]

Definition at line 34 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            this.InitializeComponent();
        }

ServicingCompleteTask ( ) [inline]

Definition at line 34 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.ServicingCompleteTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.ServicingCompleteTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.ServicingCompleteTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.ServicingCompleteTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.ServicingCompleteTaskProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.ServicingCompleteTaskProgress = progress;
                UpdateUI();
            });
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a ServicingCompleteTask.

Parameters:
sender
e

Definition at line 64 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.ServicingCompleteTaskEntryPoint,
                                                                   BackgroundTaskSample.ServicingCompleteTaskName,
                                                                   new SystemTrigger(SystemTriggerType.ServicingComplete, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a ServicingCompleteTask.

Parameters:
sender
e

Definition at line 64 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.ServicingCompleteTaskName,
                                                                   new SystemTrigger(SystemTriggerType.ServicingComplete, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a ServicingCompleteTask.

Parameters:
sender
e

Definition at line 79 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.ServicingCompleteTaskName);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a ServicingCompleteTask.

Parameters:
sender
e

Definition at line 79 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.ServicingCompleteTaskName);
            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.ServicingCompleteTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.ServicingCompleteTaskRegistered;
                Progress.Text = BackgroundTaskSample.ServicingCompleteTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.ServicingCompleteTaskName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario3_ServicingCompleteTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.ServicingCompleteTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.ServicingCompleteTaskRegistered;
                Progress.Text = BackgroundTaskSample.ServicingCompleteTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.ServicingCompleteTaskName);
            });
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario3_ServicingCompleteTask.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario3_ServicingCompleteTask.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cs
  • BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SetErrorMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SetErrorMessage
Public Member Functions | Protected Member Functions

SetErrorMessage Class Reference

List of all members.

Public Member Functions

SetErrorMessage ()

Protected Member Functions

override bool GetShareContent (DataRequest request)

Detailed Description

Definition at line 18 of file SetErrorMessage.xaml.cs.

Constructor & Destructor Documentation

SetErrorMessage ( ) [inline]

Definition at line 20 of file SetErrorMessage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 25 of file SetErrorMessage.xaml.cs.

        {
            string errorMessage = CustomErrorText.Text;
            if (String.IsNullOrEmpty(errorMessage))
            {
                errorMessage = "Enter a failure display text and try again.";
            }
            request.FailWithDisplayText(errorMessage);
            return false;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/SetErrorMessage.xaml.cs
  • ShareSource/cpp/SetErrorMessage.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SetLockScreenImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SetLockScreenImage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SetLockScreenImage Class Reference

List of all members.

Public Member Functions

SetLockScreenImage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | PickAndSetButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file SetLockScreenImage.xaml.cs.

Constructor & Destructor Documentation

SetLockScreenImage ( ) [inline]

Definition at line 30 of file SetLockScreenImage.xaml.cs.

        {
            InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file SetLockScreenImage.xaml.cs.

        {
        }

async void PickAndSetButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 44 of file SetLockScreenImage.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            FileOpenPicker imagePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                FileTypeFilter = { ".jpg", ".jpeg", ".png", ".bmp" }
            };

            StorageFile imageFile = await imagePicker.PickSingleFileAsync();
            if (imageFile != null)
            {
                try
                {
                    // Application now has access to the picked file, setting image to lockscreen.  This will fail if the file is an invalid format.
                    await LockScreen.SetImageFileAsync(imageFile);

                    // Retrieve the lock screen image that was set
                    IRandomAccessStream imageStream = LockScreen.GetImageStream();
                    if (imageStream != null)
                    {
                        BitmapImage lockScreen = new BitmapImage();
                        lockScreen.SetSource(imageStream);
                        LockScreenImage.Source = lockScreen;
                        LockScreenImage.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        LockScreenImage.Visibility = Visibility.Collapsed;
                        rootPage.NotifyUser("Setting the lock screen image failed.", NotifyType.StatusMessage);
                    }
                }
                catch (Exception)
                {
                    LockScreenImage.Visibility = Visibility.Collapsed;
                    rootPage.NotifyUser("Invalid image selected or error opening stream.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                LockScreenImage.Visibility = Visibility.Collapsed;
                rootPage.NotifyUser("No file was selected using the picker.", NotifyType.StatusMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file SetLockScreenImage.xaml.cs.

The documentation for this class was generated from the following files:
  • Personalization/cs/SetLockScreenImage.xaml.cs
  • Personalization/cpp/SetLockScreenImage.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Shape Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Shape
Public Attributes

Shape Struct Reference

#include "ShapeRenderer.h"

List of all members.

Public Attributes

Microsoft::WRL::ComPtr
< ID2D1SolidColorBrush > 		brush
D2D1_RECT_F shape

Detailed Description

Definition at line 16 of file ShapeRenderer.h.

Member Data Documentation

Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush

Definition at line 19 of file ShapeRenderer.h.

D2D1_RECT_F shape

Definition at line 18 of file ShapeRenderer.h.

The documentation for this struct was generated from the following file:
  • ComplexInk/cpp/Renderers/ShapeRenderer.h
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShapeRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShapeRenderer
Public Member Functions | Private Member Functions | Private Attributes

ShapeRenderer Class Reference

#include "ShapeRenderer.h"

List of all members.

Public Member Functions

ShapeRenderer ()
void | RefreshSize (Windows::Foundation::Size newSize)
void | Render (Shape shape, Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext)
Shape | Update (Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext)

Private Member Functions

void | CreateBrush (ID2D1SolidColorBrush **brush, Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext)

Private Attributes

std::default_random_engine | _generator
std::normal_distribution< float > | _shapeDistributionX
std::normal_distribution< float > | _shapeDistributionY

Detailed Description

Definition at line 22 of file ShapeRenderer.h.

Constructor & Destructor Documentation

ShapeRenderer ( )

Definition at line 9 of file ShapeRenderer.cpp.

{
    unsigned int seed = (unsigned int)time(0);
    srand(seed);

    _generator = std::default_random_engine(seed);
}

Member Function Documentation

void CreateBrush | ( | ID2D1SolidColorBrush ** | brush,
 |  | Microsoft::WRL::ComPtr< ID2D1DeviceContext > | d2dContext |
 | ) |  |  | [private]
void RefreshSize ( Windows::Foundation::Size newSize )

Definition at line 80 of file ShapeRenderer.cpp.

{
    int width = static_cast<int>(newSize.Width);
    int height = static_cast<int>(newSize.Height);

    if (width > 0 && height > 0)
    {
        // The mean will be the center of the viewport and the standard deviation a fourth of it
        _shapeDistributionX = std::normal_distribution<float>((float)width / 2, (float)width / 4);
        _shapeDistributionY = std::normal_distribution<float>((float)height / 2, (float)height / 4);
    }
}

void Render | ( | Shape | shape,
 |  | Microsoft::WRL::ComPtr< ID2D1DeviceContext > | d2dContext
 | ) |  |

Definition at line 17 of file ShapeRenderer.cpp.

{
    d2dContext->FillRectangle(&shape.shape, shape.brush.Get());
}

Shape Update ( Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext )

Definition at line 39 of file ShapeRenderer.cpp.

{
    Shape newShape;

    float centerX = _shapeDistributionX(_generator);
    float centerY = _shapeDistributionY(_generator);
    float width = _shapeDistributionX.mean() * 2;
    float height = _shapeDistributionY.mean() * 2;

    // The shape size is a percentage of the size of the canvas. This will create shapes that are proportional
    // to the canvas, regardless of the size of the screen.
    const float maxShapeSize = max(width, height) * MAX_SHAPE_SIZE_PERCENTAGE;
    const float minShapeSize = max(width, height) * MIN_SHAPE_SIZE_PERCENTAGE;

    float shapeWidth = 0, shapeHeight = 0;
    if (maxShapeSize > minShapeSize)
    {
        shapeWidth = (float)(rand() % ((int)(maxShapeSize - minShapeSize))) + minShapeSize;
        shapeHeight = (float)(rand() % ((int)(maxShapeSize - minShapeSize))) + minShapeSize;
    }

    float left = centerX - (shapeWidth / 2);
    float top = centerY - (shapeHeight / 2);

    // limit the shape position to the size of the canvas
    if (left <  0) left = maxShapeSize;
    if (top < 0) top = maxShapeSize;
    if (left > (width - maxShapeSize)) left = width - shapeWidth;
    if (top > (height - maxShapeSize))  top = height - shapeHeight;

    D2D1_RECT_F rectangle = D2D1::RectF(left, top, left + (shapeWidth / 2), top + (shapeHeight / 2));

    Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> shapeBrush;
    CreateBrush(&shapeBrush, d2dContext);

    newShape.shape = rectangle;
    newShape.brush = shapeBrush;

    return newShape;
}

Member Data Documentation

std::default_random_engine _generator [private]

Definition at line 34 of file ShapeRenderer.h.

std::normal_distribution<float> _shapeDistributionX [private]

Definition at line 38 of file ShapeRenderer.h.

std::normal_distribution<float> _shapeDistributionY [private]

Definition at line 39 of file ShapeRenderer.h.

The documentation for this class was generated from the following files:
  • ComplexInk/cpp/Renderers/ShapeRenderer.h
  • ComplexInk/cpp/Renderers/ShapeRenderer.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareApplicationLink Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareApplicationLink
Public Member Functions | Protected Member Functions | Private Member Functions

ShareApplicationLink Class Reference

List of all members.

Public Member Functions

ShareApplicationLink ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

Color | GetLogoBackgroundColor ()

Detailed Description

Definition at line 22 of file ShareApplicationLink.xaml.cs.

Constructor & Destructor Documentation

ShareApplicationLink ( ) [inline]

Definition at line 24 of file ShareApplicationLink.xaml.cs.

        {
            this.InitializeComponent();

            // Populate the ApplicationLinkComboBox with the deep links for all of the scenarios
            ObservableCollection<object> scenarioList = new ObservableCollection<object>();
            foreach (Scenario scenario in rootPage.scenarios)
            {
                scenarioList.Add(SharePage.GetApplicationLink(scenario.ClassType.Name));
            }
            ApplicationLinkComboBox.ItemsSource = scenarioList;
            ApplicationLinkComboBox.SelectedItem = ApplicationLink; // Default selection to the deep link for this scenario
        }

Member Function Documentation

Color GetLogoBackgroundColor ( ) [inline, private]

Reads out the values of the colors and constructs a color from their values.

Returns:

Definition at line 77 of file ShareApplicationLink.xaml.cs.

        {
            // The values are guaranteed to be within the appropriate byte range due to setting a minimum of 0
            // and a maximum of 255 on the sliders. However, it is necessary to convert them to bytes because
            // the slider exposes its value as a double.
            Color backgroundColor = new Color();
            backgroundColor.R = Convert.ToByte(RedSlider.Value);
            backgroundColor.G = Convert.ToByte(GreenSlider.Value);
            backgroundColor.B = Convert.ToByte(BlueSlider.Value);
            backgroundColor.A = Convert.ToByte(AlphaSlider.Value);

            return backgroundColor;
        }

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 38 of file ShareApplicationLink.xaml.cs.

        {
            bool succeeded = false;

            Uri selectedApplicationLink = ApplicationLinkComboBox.SelectedItem as Uri;
            if (selectedApplicationLink != null)
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = TitleInputBox.Text;
                requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                requestData.SetApplicationLink(selectedApplicationLink);

                // Place the selected logo and the background color in the data package properties
                if (MicrosoftLogo.IsChecked.Value)
                {
                    requestData.Properties.Square30x30Logo = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///assets/microsoftLogo.png"));
                    requestData.Properties.LogoBackgroundColor = GetLogoBackgroundColor();
                }
                else if (VisualStudioLogo.IsChecked.Value)
                {
                    requestData.Properties.Square30x30Logo = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///assets/visualStudioLogo.png"));
                    requestData.Properties.LogoBackgroundColor = GetLogoBackgroundColor();
                }

                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Select the application link you would like to share and try again.");
            }

            return succeeded;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareApplicationLink.xaml.cs
  • ShareSource/cpp/ShareApplicationLink.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareCustomData Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareCustomData
Public Member Functions | Protected Member Functions

ShareCustomData Class Reference

List of all members.

Public Member Functions

ShareCustomData ()

Protected Member Functions

override bool GetShareContent (DataRequest request)

Detailed Description

Definition at line 18 of file ShareCustomData.xaml.cs.

Constructor & Destructor Documentation

ShareCustomData ( ) [inline]

Definition at line 20 of file ShareCustomData.xaml.cs.

        {
            this.InitializeComponent();
            CustomDataTextBox.Text =
            @"{
               ""type"" : ""http://schema.org/Book"",
               ""properties"" :
               {
                ""image"" : ""http://sourceurl.com/catcher-in-the-rye-book-cover.jpg"",
                ""name"" : ""The Catcher in the Rye"",
                ""bookFormat"" : ""http://schema.org/Paperback"",
                ""author"" : ""http://sourceurl.com/author/jd_salinger.html"",
                ""numberOfPages"" : 224,
                ""publisher"" : ""Little, Brown, and Company"",
                ""datePublished"" : ""1991-05-01"",
                ""inLanguage"" : ""English"",
                ""isbn"" : ""0316769487""
                }
            }";
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 41 of file ShareCustomData.xaml.cs.

        {
            bool succeeded = false;

            string dataPackageFormat = DataFormatInputBox.Text;
            if (!String.IsNullOrEmpty(dataPackageFormat))
            {
                string dataPackageText = CustomDataTextBox.Text;
                if (!String.IsNullOrEmpty(dataPackageText))
                {
                    DataPackage requestData = request.Data;
                    requestData.Properties.Title = TitleInputBox.Text;
                    requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                    requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                    requestData.SetData(dataPackageFormat, dataPackageText);
                    succeeded = true;
                }
                else
                {
                    request.FailWithDisplayText("Enter the custom data you would like to share and try again.");
                }
            }
            else
            {
                request.FailWithDisplayText("Enter a custom data format and try again.");
            }
            return succeeded;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareCustomData.xaml.cs
  • ShareSource/cpp/ShareCustomData.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareCustomProvider Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareCustomProvider
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShareCustomProvider Class Reference

List of all members.

Public Member Functions

ShareCustomProvider ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | OnShareProvidersRequested (DataTransferManager s, ShareProvidersRequestedEventArgs e)
async void | OnShareToContosoChat (ShareProviderOperation operation)

Private Attributes

DataTransferManager | dataTransferManager = DataTransferManager.GetForCurrentView()

Detailed Description

Definition at line 22 of file ShareCustomProvider.xaml.cs.

Constructor & Destructor Documentation

ShareCustomProvider ( ) [inline]

Definition at line 26 of file ShareCustomProvider.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 45 of file ShareCustomProvider.xaml.cs.

        {
            DataPackage requestData = request.Data;
            requestData.Properties.Title = "I got a new high score!";
            requestData.SetText("I got a high score of 15063!");
            return true;
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file ShareCustomProvider.xaml.cs.

        {
            this.dataTransferManager.ShareProvidersRequested -= OnShareProvidersRequested;
            base.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file ShareCustomProvider.xaml.cs.

        {
            base.OnNavigatedTo(e);

            // Register the event to add a Share Provider
            dataTransferManager.ShareProvidersRequested += OnShareProvidersRequested;
        }

void OnShareProvidersRequested | ( | DataTransferManager | s,
 |  | ShareProvidersRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file ShareCustomProvider.xaml.cs.

        {
            // Take a deferral so that we can perform async operations. (This sample
            // doesn't perform any async operations in the ShareProvidersRequested
            // event handler, but we take the deferral anyway to demonstrate the pattern.)
            using (var deferral = e.GetDeferral())
            {
                // Create the custom share provider and add it.
                RandomAccessStreamReference icon = RandomAccessStreamReference.CreateFromUri(new Uri(@"ms-appx:///Assets/windows-sdk.png"));
                ShareProvider provider = new ShareProvider("Contoso Chat", icon, Windows.UI.Colors.LightGray, OnShareToContosoChat);
                e.Providers.Add(provider);
            }
        }

async void OnShareToContosoChat ( ShareProviderOperation operation ) [inline, private]

Definition at line 67 of file ShareCustomProvider.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                ShareCompletedText.Text = "";

                // Obtain the text from the data package. This should match
                // the information placed in it by the GetShareContent method.
                String text = await operation.Data.GetTextAsync();

                // The app can display custom UI to complete the Share operation.
                // Here, we simply display a progress control and delay for a while,
                // to simulate posting to the Contoso Chat service.
                ProgressControl.Visibility = Visibility.Visible;
                await Task.Delay(TimeSpan.FromSeconds(2));

                // All done. Show the success message.
                ProgressControl.Visibility = Visibility.Collapsed;
                ShareCompletedText.Text = $"Your message '{text}' has been shared with Contoso Chat.";

                // Completing the operation causes ShareCompleted to be raised.
                operation.ReportCompleted();
            });
        }

Member Data Documentation

DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView() [private]

Definition at line 24 of file ShareCustomProvider.xaml.cs.

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareCustomProvider.xaml.cs
  • ShareSource/cpp/ShareCustomProvider.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReadyHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Shared
  • PlayReadyHelpers
Static Public Member Functions | Properties | Static Private Member Functions

PlayReadyHelpers Class Reference

List of all members.

Static Public Member Functions

static PlayReadyLicenseSession | createLicenseSession ()
static MediaProtectionManager | InitializeProtectionManager (ServiceRequestedEventHandler serviceRequestHandler)
static void | ProactiveIndividualization (Action callback)
static void | ProactiveLicenseAcquisition (PlayReadyContentHeader contentHeader, Action callback=null)
static async void | ReactiveIndividualization (PlayReadyIndividualizationServiceRequest indivRequest, MediaProtectionServiceCompletion serviceCompletionNotifier, Action callback=null)
static async void | ReactiveLicenseAcquisition (IPlayReadyLicenseAcquisitionServiceRequest licenseRequest, MediaProtectionServiceCompletion serviceCompletionNotifier, Action callback=null)

Properties

static bool | IsIndividualized [get]

Static Private Member Functions

static void | ComponentLoadFailed (MediaProtectionManager sender, ComponentLoadFailedEventArgs e)

Detailed Description

Definition at line 24 of file PlayReadyHelpers.cs.

Member Function Documentation

static void ComponentLoadFailed | ( | MediaProtectionManager | sender,
 |  | ComponentLoadFailedEventArgs | e |
 | ) |  |  | [inline, static, private]

A ComponentLoadFailed event will occur when binary data fails to load.

This an infrequent event that may be triggered by a pending OS update in which DRM compoments are being renewed and may require a restart.

Definition at line 83 of file PlayReadyHelpers.cs.

        {

            for (int i = 0; i < e.Information.Items.Count; i++)
            {
                ViewModelBase.Log(e.Information.Items[i].Name + "\nReasons=0x" + e.Information.Items[i].Reasons + "\n"
                                                    + "Renewal Id=" + e.Information.Items[i].RenewalId);
            }
            e.Completion.Complete(false);
        }

static PlayReadyLicenseSession createLicenseSession ( ) [inline, static]

Definition at line 57 of file PlayReadyHelpers.cs.

        {
            //A setting to tell MF that we are using PlayReady.
            var propSetMF = new Windows.Foundation.Collections.PropertySet();
            propSetMF["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
            var cpsystems = new Windows.Foundation.Collections.PropertySet();
            cpsystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput"; //Playready TrustedInput Class Name
            propSetMF["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = cpsystems;

            //Create the MF media session that the license will be tied to
            var pmpServer = new Windows.Media.Protection.MediaProtectionPMPServer(propSetMF);

            var propSetPMPServer = new Windows.Foundation.Collections.PropertySet();
            //Set the property for the LicenseSession. This tells PlayReady to tie the license to that particular media session
            propSetPMPServer["Windows.Media.Protection.MediaProtectionPMPServer"] = pmpServer;

            var licenseSession = new Windows.Media.Protection.PlayReady.PlayReadyLicenseSession(propSetPMPServer);
            return licenseSession;
        }

static MediaProtectionManager InitializeProtectionManager ( ServiceRequestedEventHandler serviceRequestHandler ) [inline, static]

Definition at line 33 of file PlayReadyHelpers.cs.

        {

            var protectionManager = new MediaProtectionManager();

            //A setting to tell MF that we are using PlayReady.
            var props = new Windows.Foundation.Collections.PropertySet();
            props.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput");
            protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", props);
            protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
            //Maps the conatiner guid from the manifest or media segment
            protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");

            protectionManager.ServiceRequested += new ServiceRequestedEventHandler(serviceRequestHandler);
            protectionManager.ComponentLoadFailed += new ComponentLoadFailedEventHandler(ComponentLoadFailed);

            // Windows 10 provides built in support for Dash and does not require additional configuration.
            // This would be be good place to configure a MediaExtensionManager to support another stream source
            // such as the Smooth Streaming SDK

            return protectionManager;

        }

static void ProactiveIndividualization ( Action callback ) [inline, static]

The individual process can kick off proactively and not need to wait for a reactionary service request from PlayReady.

This enables the app to manage when activation occures.

Definition at line 189 of file PlayReadyHelpers.cs.

        {
            //Creating a new Indiv request and using the previous reactive method to complete the request
            var indivRequest = new PlayReadyIndividualizationServiceRequest();
            ReactiveIndividualization(indivRequest, null, callback);
        }

static void ProactiveLicenseAcquisition | ( | PlayReadyContentHeader | contentHeader,
 |  | Action | callback = null |
 | ) |  |  | [inline, static]

The application can proativly request a license by creating a license request and assigning a header which provides the specifics such as the KeyId of the license needed.

Definition at line 200 of file PlayReadyHelpers.cs.

        {
            var laRequest = new PlayReadyLicenseAcquisitionServiceRequest();
            laRequest.ContentHeader = contentHeader;
            ReactiveLicenseAcquisition(laRequest, null, callback);
        }

static async void ReactiveIndividualization | ( | PlayReadyIndividualizationServiceRequest | indivRequest,
 |  | MediaProtectionServiceCompletion | serviceCompletionNotifier,
 |  | Action | callback = null |
 | ) |  |  | [inline, static]

Reactive individualization is triggered by PlayReady when the DRM is first utilized in a new app.

If individualization was triggered as part a license request then that request will be queued until the indiv process completes. The serviceCompletionNotifier is utilized to notify the ProtectionManager that the next service request can begin.

Definition at line 100 of file PlayReadyHelpers.cs.

        {
            Exception exception = null;
            try
            {
                // The actual service call.
                // The Indiv ServiceRequest call cannot be customized like most other ServiceRequests.
                await indivRequest.BeginServiceRequest();
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            finally
            {
                if (serviceCompletionNotifier != null)
                {
                    // The Complete call will notify listeners that the service call is complete
                    // and queued service requests can begin.
                    serviceCompletionNotifier.Complete(exception == null);
                }
                ViewModelBase.Log("ReactiveIndividualization::Complete");
            }

            // The callback is only used in the sample to show PlayReadyStatics within the UI on the
            // completion of the ServiceRequest.
            if (callback != null)
            {
                var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
                await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    callback.Invoke();
                });
            }
        }

static async void ReactiveLicenseAcquisition | ( | IPlayReadyLicenseAcquisitionServiceRequest | licenseRequest,
 |  | MediaProtectionServiceCompletion | serviceCompletionNotifier,
 |  | Action | callback = null |
 | ) |  |  | [inline, static]

Reactive license acquisition is triggered by PlayReady when the DRM does not have a license for the content(KeyID) as part of an active playback attempt.

Service requests can be queued which is useful in scenarios such as root/leaf license and PlayReady Domains where one license depends on another. The serviceCompletionNotifier is utilized to notify the ProtectionManager that the next service request can begin.

Definition at line 145 of file PlayReadyHelpers.cs.

        {

            Exception exception = null;
            bool success = false;
            try
            {
                await licenseRequest.BeginServiceRequest();
                success = true;
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            finally
            {
                if (serviceCompletionNotifier != null)
                {
                    // The Complete call will notify listeners that the service call is complete
                    // and queued service requests can begin.
                    serviceCompletionNotifier.Complete(success);
                    serviceCompletionNotifier = null;
                }
                ViewModelBase.Log("ReactiveLicenseAcquisition::Complete");
            }

            // optional call back to update UI.
            if (callback != null)
            {
                var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
                await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    callback.Invoke();
                });

            }
        }

Property Documentation

bool IsIndividualized [static, get]

Definition at line 29 of file PlayReadyHelpers.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/Shared/PlayReadyHelpers.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelayCommand Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Shared
  • RelayCommand
Public Member Functions | Events | Private Attributes

RelayCommand Class Reference

A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...

List of all members.

Public Member Functions

RelayCommand (Action execute)
RelayCommand (Action execute, Func< bool > canExecute)
bool | CanExecute (object parameter)
void | Execute (object parameter)
void | RaiseCanExecuteChanged ()

Events

EventHandler | CanExecuteChanged

Private Attributes

readonly Func< bool > | _canExecute
readonly Action | _execute

Detailed Description

The default return value for the CanExecute method is 'true'. RaiseCanExecuteChanged needs to be called whenever CanExecute is expected to return a different value.

Definition at line 28 of file RelayCommand.cs.

Constructor & Destructor Documentation

RelayCommand ( Action execute ) [inline]

Creates a new command that can always execute.

Parameters:
execute The execution logic.

Definition at line 42 of file RelayCommand.cs.

            : this(execute, null)
        {
        }

RelayCommand | ( | Action | execute,
 |  | Func< bool > | canExecute |
 | ) |  |  | [inline]

Creates a new command.

Parameters:
execute | The execution logic.
canExecute | The execution status logic.

Definition at line 52 of file RelayCommand.cs.

        {
            if (execute == null)
                throw new ArgumentNullException("execute");
            _execute = execute;
            _canExecute = canExecute;
        }

Member Function Documentation

bool CanExecute ( object parameter ) [inline]

Determines whether this RelayCommand can execute in its current state.

Parameters:
parameter Data used by the command. If the command does not require data to be passed, this object can be set to null.
Returns:
true if this command can be executed; otherwise, false.

Definition at line 67 of file RelayCommand.cs.

        {
            return _canExecute == null ? true : _canExecute();
        }

void Execute ( object parameter ) [inline]

Executes the RelayCommand on the current command target.

Parameters:
parameter Data used by the command. If the command does not require data to be passed, this object can be set to null.

Definition at line 78 of file RelayCommand.cs.

        {
            _execute();
        }

void RaiseCanExecuteChanged ( ) [inline]

Method used to raise the CanExecuteChanged event to indicate that the return value of the CanExecute method has changed.

Definition at line 88 of file RelayCommand.cs.

        {
            var handler = CanExecuteChanged;
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }

Member Data Documentation

readonly Func<bool> _canExecute [private]

Definition at line 31 of file RelayCommand.cs.

readonly Action _execute [private]

Definition at line 30 of file RelayCommand.cs.

Event Documentation

EventHandler CanExecuteChanged

Raised when RaiseCanExecuteChanged is called.

Definition at line 36 of file RelayCommand.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/Shared/RelayCommand.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareDelayRenderedFiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareDelayRenderedFiles
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShareDelayRenderedFiles Class Reference

List of all members.

Public Member Functions

ShareDelayRenderedFiles ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

async void | OnDeferredImageRequestedHandler (DataProviderRequest providerRequest, StorageFile imageFile)
async void | SelectImageButton_Click (object sender, RoutedEventArgs e)

Private Attributes

StorageFile | selectedImage

Detailed Description

Definition at line 23 of file ShareDelayRenderedFiles.xaml.cs.

Constructor & Destructor Documentation

ShareDelayRenderedFiles ( ) [inline]

Definition at line 27 of file ShareDelayRenderedFiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 32 of file ShareDelayRenderedFiles.xaml.cs.

        {
            bool succeeded = false;

            if (this.selectedImage != null)
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = "Delay rendered image";
                requestData.Properties.Description = "Resized image from the Share Source sample";
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                requestData.Properties.Thumbnail = RandomAccessStreamReference.CreateFromFile(this.selectedImage);
                requestData.SetDataProvider(StandardDataFormats.Bitmap, providerRequest => this.OnDeferredImageRequestedHandler(providerRequest, this.selectedImage));
                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Select an image you would like to share and try again.");
            }
            return succeeded;
        }

async void OnDeferredImageRequestedHandler | ( | DataProviderRequest | providerRequest,
 |  | StorageFile | imageFile |
 | ) |  |  | [inline, private]

Definition at line 53 of file ShareDelayRenderedFiles.xaml.cs.

        {
            // In this delegate we provide updated Bitmap data using delayed rendering.

            if (imageFile != null)
            {
                // If the delegate is calling any asynchronous operations it needs to acquire the deferral first. This lets the
                // system know that you are performing some operations that might take a little longer and that the call to
                // SetData could happen after the delegate returns. Once you acquired the deferral object you must call Complete
                // on it after your final call to SetData.
                DataProviderDeferral deferral = providerRequest.GetDeferral();
                InMemoryRandomAccessStream inMemoryStream = new InMemoryRandomAccessStream();

                // Make sure to always call Complete when done with the deferral.
                try
                {
                    // Decode the image and re-encode it at 50% width and height.
                    IRandomAccessStream imageStream = await imageFile.OpenAsync(FileAccessMode.Read);
                    BitmapDecoder imageDecoder = await BitmapDecoder.CreateAsync(imageStream);
                    BitmapEncoder imageEncoder = await BitmapEncoder.CreateForTranscodingAsync(inMemoryStream, imageDecoder);
                    imageEncoder.BitmapTransform.ScaledWidth = (uint)(imageDecoder.OrientedPixelWidth * 0.5);
                    imageEncoder.BitmapTransform.ScaledHeight = (uint)(imageDecoder.OrientedPixelHeight * 0.5);
                    await imageEncoder.FlushAsync();

                    providerRequest.SetData(RandomAccessStreamReference.CreateFromStream(inMemoryStream));
                }
                finally
                {
                    deferral.Complete();
                }
            }
        }

async void SelectImageButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file ShareDelayRenderedFiles.xaml.cs.

        {
            FileOpenPicker imagePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                FileTypeFilter = { ".jpg", ".png", ".bmp", ".gif", ".tif" }
            };

            StorageFile pickedImage = await imagePicker.PickSingleFileAsync();

            if (pickedImage != null)
            {
                this.selectedImage = pickedImage;

                // Display the image in the UI.
                IRandomAccessStream displayStream = await pickedImage.OpenAsync(FileAccessMode.Read);
                BitmapImage bitmapImage = new BitmapImage();
                bitmapImage.SetSource(displayStream);
                ImageHolder.Source = bitmapImage;
                this.rootPage.NotifyUser("Selected " + pickedImage.Name + ".", NotifyType.StatusMessage);

                ShareStep.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

StorageFile selectedImage [private]

Definition at line 25 of file ShareDelayRenderedFiles.xaml.cs.

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareDelayRenderedFiles.xaml.cs
  • ShareSource/cpp/ShareDelayRenderedFiles.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareFiles Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareFiles
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShareFiles Class Reference

List of all members.

Public Member Functions

ShareFiles ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

async void | SelectFilesButton_Click (object sender, RoutedEventArgs e)

Private Attributes

IReadOnlyList< StorageFile > | storageItems

Detailed Description

Definition at line 21 of file ShareFiles.xaml.cs.

Constructor & Destructor Documentation

ShareFiles ( ) [inline]

Definition at line 25 of file ShareFiles.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 30 of file ShareFiles.xaml.cs.

        {
            bool succeeded = false;

            if (storageItems != null)
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = TitleInputBox.Text;
                requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                requestData.SetStorageItems(this.storageItems);
                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Select the files you would like to share and try again.");
            }
            return succeeded;
        }

async void SelectFilesButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file ShareFiles.xaml.cs.

        {
            FileOpenPicker filePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.List,
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
                FileTypeFilter = { "*" }
            };

            IReadOnlyList<StorageFile> pickedFiles = await filePicker.PickMultipleFilesAsync();

            if (pickedFiles.Count > 0)
            {
                this.storageItems = pickedFiles;

                // Display the file names in the UI.
                string selectedFiles = String.Empty;
                for (int index = 0; index < pickedFiles.Count; index++)
                {
                    selectedFiles += pickedFiles[index].Name;

                    if (index != (pickedFiles.Count - 1))
                    {
                        selectedFiles += ", ";
                    }
                }
                this.rootPage.NotifyUser("Picked files: " + selectedFiles + ".", NotifyType.StatusMessage);

                ShareStep.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

IReadOnlyList<StorageFile> storageItems [private]

Definition at line 23 of file ShareFiles.xaml.cs.

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareFiles.xaml.cs
  • ShareSource/cpp/ShareFiles.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareHtml Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareHtml
Public Member Functions | Protected Member Functions | Private Member Functions

ShareHtml Class Reference

List of all members.

Public Member Functions

ShareHtml ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

void | ShareWebView_NavigationCompleted (object sender, WebViewNavigationCompletedEventArgs e)

Detailed Description

Definition at line 18 of file ShareHtml.xaml.cs.

Constructor & Destructor Documentation

ShareHtml ( ) [inline]

Definition at line 20 of file ShareHtml.xaml.cs.

        {
            this.InitializeComponent();
            ShareWebView.Navigate(new Uri("http://msdn.microsoft.com"));
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 33 of file ShareHtml.xaml.cs.

        {
            // Get the user's selection from the WebView. Since this is an asynchronous operation we need to acquire the deferral first.
            DataRequestDeferral deferral = request.GetDeferral();

            // Make sure to always call Complete when done with the deferral.
            try
            {
                var requestDataOperation = ShareWebView.CaptureSelectedContentToDataPackageAsync();
                requestDataOperation.Completed += (asyncInfo, status) =>
                {
                    DataPackage requestData = asyncInfo.GetResults();
                    if ((requestData != null) && (requestData.GetView().AvailableFormats.Count > 0))
                    {
                        requestData.Properties.Title = "A web snippet for you";
                        requestData.Properties.Description = "HTML selection from a WebView control"; // The description is optional.
                        requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                        requestData.Properties.ContentSourceWebLink = new Uri("http://msdn.microsoft.com");
                        request.Data = requestData;
                        deferral.Complete();
                    }
                    else
                    {
                        // FailWithDisplayText calls Complete on the deferral.
                        request.FailWithDisplayText("Make a selection in the WebView control and try again.");
                    }
                };
            }
            catch (Exception)
            {
                deferral.Complete();
            }

            // At this point, we haven't populated the data package yet. It's done asynchronously above.
            return false;
        }

void ShareWebView_NavigationCompleted | ( | object | sender,
 |  | WebViewNavigationCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file ShareHtml.xaml.cs.

        {
            ShareWebView.Visibility = Windows.UI.Xaml.Visibility.Visible;
            BlockingRect.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            LoadingProgressRing.IsActive = false;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareHtml.xaml.cs
  • ShareSource/cpp/ShareHtml.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareImage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShareImage Class Reference

List of all members.

Public Member Functions

ShareImage ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

async void | SelectImageButton_Click (object sender, RoutedEventArgs e)

Private Attributes

StorageFile | imageFile

Detailed Description

Definition at line 23 of file ShareImage.xaml.cs.

Constructor & Destructor Documentation

ShareImage ( ) [inline]

Definition at line 27 of file ShareImage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 32 of file ShareImage.xaml.cs.

        {
            bool succeeded = false;

            if (this.imageFile != null)
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = TitleInputBox.Text;
                requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;

                // It's recommended to use both SetBitmap and SetStorageItems for sharing a single image
                // since the target app may only support one or the other.

                List<IStorageItem> imageItems = new List<IStorageItem>();
                imageItems.Add(this.imageFile);
                requestData.SetStorageItems(imageItems);

                RandomAccessStreamReference imageStreamRef = RandomAccessStreamReference.CreateFromFile(this.imageFile);
                requestData.Properties.Thumbnail = imageStreamRef;
                requestData.SetBitmap(imageStreamRef);
                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Select an image you would like to share and try again.");
            }
            return succeeded;
        }

async void SelectImageButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file ShareImage.xaml.cs.

        {
            FileOpenPicker imagePicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                FileTypeFilter = { ".jpg", ".png", ".bmp", ".gif", ".tif" }
            };

            StorageFile pickedImage = await imagePicker.PickSingleFileAsync();

            if (pickedImage != null)
            {
                this.imageFile = pickedImage;

                // Display the image in the UI.
                IRandomAccessStream displayStream = await pickedImage.OpenAsync(FileAccessMode.Read);
                BitmapImage bitmapImage = new BitmapImage();
                bitmapImage.SetSource(displayStream);
                ImageHolder.Source = bitmapImage;
                this.rootPage.NotifyUser("Selected " + pickedImage.Name + ".", NotifyType.StatusMessage);

                ShareStep.Visibility = Visibility.Visible;
            }
        }

Member Data Documentation

StorageFile imageFile [private]

Definition at line 25 of file ShareImage.xaml.cs.

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareImage.xaml.cs
  • ShareSource/cpp/ShareImage.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SharePage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SharePage
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

SharePage Class Reference

#include "SharePage.h"

List of all members.

Public Member Functions

virtual bool | GetShareContent (Windows::ApplicationModel::DataTransfer::DataRequest^request)
virtual void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | ShowUIButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Static Public Member Functions

static Windows::Foundation::Uri | GetApplicationLink (Platform::String^sharePageFullName)
static Uri | GetApplicationLink (string sharePageName)

Protected Member Functions

abstract bool | GetShareContent (DataRequest request)
override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)
void | ShowUIButton_Click (object sender, RoutedEventArgs e)

Properties

Uri | ApplicationLink [get]

Private Member Functions

void | OnDataRequested (Windows::ApplicationModel::DataTransfer::DataTransferManager^sender, Windows::ApplicationModel::DataTransfer::DataRequestedEventArgs^e)
void | OnDataRequested (DataTransferManager sender, DataRequestedEventArgs e)
void | OnShareCompleted (DataPackage sender, ShareCompletedEventArgs e)
void | OnShareCompleted (Windows::ApplicationModel::DataTransfer::DataPackage^sender, Windows::ApplicationModel::DataTransfer::ShareCompletedEventArgs^e)
void | OnTargetApplicationChosen (Windows::ApplicationModel::DataTransfer::DataTransferManager^sender, Windows::ApplicationModel::DataTransfer::TargetApplicationChosenEventArgs^e)
void | OnTargetApplicationChosen (DataTransferManager sender, TargetApplicationChosenEventArgs e)

Private Attributes

DataTransferManager | dataTransferManager
MainPage rootPage = MainPage::Current

Detailed Description

Definition at line 25 of file SharePage.h.

Member Function Documentation

static Windows::Foundation::Uri GetApplicationLink ( Platform::String^ sharePageFullName ) [static]
static Uri GetApplicationLink ( string sharePageName ) [inline, static]

Definition at line 104 of file SharePage.cs.

        {
            return new Uri("ms-sdk-sharesourcecs:navigate?page=" + sharePageName);
        }

virtual bool GetShareContent ( Windows::ApplicationModel::DataTransfer::DataRequest^ request ) [virtual]
abstract bool GetShareContent ( DataRequest request ) [protected, pure virtual]
void OnDataRequested | ( | Windows::ApplicationModel::DataTransfer::DataTransferManager^ | sender,
 |  | Windows::ApplicationModel::DataTransfer::DataRequestedEventArgs^ | e |
 | ) |  |  | [private]
void OnDataRequested | ( | DataTransferManager | sender,
 |  | DataRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file SharePage.cs.

        {
            // Register to be notified if the share operation completes.
            e.Request.Data.ShareCompleted += OnShareCompleted;

            // Call the scenario specific function to populate the datapackage with the data to be shared.
            if (GetShareContent(e.Request))
            {
                // Out of the datapackage properties, the title is required. If the scenario completed successfully, we need
                // to make sure the title is valid since the sample scenario gets the title from the user.
                if (String.IsNullOrEmpty(e.Request.Data.Properties.Title))
                {
                    e.Request.FailWithDisplayText(MainPage.MissingTitleError);
                }
            }
        }

virtual void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, virtual]
override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 36 of file SharePage.cs.

        {
            // Unregister our event handlers.
            this.dataTransferManager.DataRequested -= new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.OnDataRequested);
            this.dataTransferManager.TargetApplicationChosen -= OnTargetApplicationChosen;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 26 of file SharePage.cs.

        {
            // Register the current page as a share source.
            this.dataTransferManager = DataTransferManager.GetForCurrentView();
            this.dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.OnDataRequested);

            // Request to be notified when the user chooses a share target app.
            this.dataTransferManager.TargetApplicationChosen += OnTargetApplicationChosen;
        }

void OnShareCompleted | ( | Windows::ApplicationModel::DataTransfer::DataPackage^ | sender,
 |  | Windows::ApplicationModel::DataTransfer::ShareCompletedEventArgs^ | e |
 | ) |  |  | [private]
void OnShareCompleted | ( | DataPackage | sender,
 |  | ShareCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 67 of file SharePage.cs.

        {
            string shareCompletedStatus = "Shared successfully. ";

            // Typically, this information is not displayed to the user because the
            // user already knows which share target was selected.
            if (!String.IsNullOrEmpty(e.ShareTarget.AppUserModelId))
            {
                // The user picked an app.
                shareCompletedStatus += $"Target: App \"{e.ShareTarget.AppUserModelId}\"";
            }
            else if (e.ShareTarget.ShareProvider != null)
            {
                // The user picked a ShareProvider.
                shareCompletedStatus += $"Target: Share Provider \"{e.ShareTarget.ShareProvider.Title}\"";
            }

            this.rootPage.NotifyUser(shareCompletedStatus, NotifyType.StatusMessage);
        }

void OnTargetApplicationChosen | ( | Windows::ApplicationModel::DataTransfer::DataTransferManager^ | sender,
 |  | Windows::ApplicationModel::DataTransfer::TargetApplicationChosenEventArgs^ | e |
 | ) |  |  | [private]
void OnTargetApplicationChosen | ( | DataTransferManager | sender,
 |  | TargetApplicationChosenEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 62 of file SharePage.cs.

        {
            this.rootPage.NotifyUser($"User chose {e.ApplicationName}", NotifyType.StatusMessage);
        }

void ShowUIButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, protected]

Definition at line 87 of file SharePage.cs.

        {
            // If the user clicks the share button, invoke the share flow programatically.
            DataTransferManager.ShowShareUI();
        }

void ShowUIButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e
 | ) |  |

Definition at line 91 of file SharePage.cpp.

{
    // If the user clicks the share button, invoke the share flow programatically.
    Windows::ApplicationModel::DataTransfer::DataTransferManager::ShowShareUI();
}

Member Data Documentation

DataTransferManager dataTransferManager [private]

Definition at line 24 of file SharePage.cs.

MainPage rootPage = MainPage::Current [private]

Definition at line 45 of file SharePage.h.

Property Documentation

Uri ApplicationLink [get, protected]

Definition at line 97 of file SharePage.cs.

The documentation for this class was generated from the following files:
  • ShareSource/cpp/SharePage.h
  • ShareSource/cs/SharePage.cs
  • ShareSource/cpp/SharePage.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareTarget
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ShareTarget Class Reference

List of all members.

Public Member Functions

ShareTarget ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AddContentValue (string title, string description=null)
void | AddQuickLink_Checked (object sender, RoutedEventArgs e)
void | AddQuickLink_Unchecked (object sender, RoutedEventArgs e)
void | DismissUI_Click (object sender, RoutedEventArgs e)
async void | Footer_Click (object sender, RoutedEventArgs e)
void | NotifyUser (string strMessage, NotifyType type)
async void | NotifyUserBackgroundThread (string message, NotifyType type)
void | OtherShareOperationMethodsSection_Checked (object sender, RoutedEventArgs e)
void | OtherShareOperationMethodsSection_Unchecked (object sender, RoutedEventArgs e)
void | OtherShareOperations_Tapped (object sender, TappedRoutedEventArgs e)
void | QuickLinkSectionLabel_Tapped (object sender, TappedRoutedEventArgs e)
async void | ReportCompleted_Click (object sender, RoutedEventArgs e)
void | ReportDataRetrieved_Click (object sender, RoutedEventArgs e)
void | ReportErrorButton_Click (object sender, RoutedEventArgs e)

Private Attributes

const string | dataFormatName = "http://schema.org/Book"
Uri | sharedApplicationLink
IRandomAccessStreamReference | sharedBitmapStreamRef
string | sharedCustomData
Uri | sharedDataContentSourceApplicationLink
Uri | sharedDataContentSourceWebLink
string | sharedDataDescription
Color | sharedDataLogoBackgroundColor
string | sharedDataPackageFamilyName
IRandomAccessStreamReference | sharedDataSquare30x30Logo
string | sharedDataTitle
string | sharedHtmlFormat
IReadOnlyDictionary< string,
RandomAccessStreamReference > 		sharedResourceMap
IReadOnlyList< IStorageItem > | sharedStorageItems
string | sharedText
IRandomAccessStreamReference | sharedThumbnailStreamRef
Uri | sharedWebLink
ShareOperation | shareOperation
string | shareQuickLinkId

Detailed Description

Definition at line 34 of file ShareTarget.xaml.cs.

Constructor & Destructor Documentation

ShareTarget ( ) [inline]

Definition at line 56 of file ShareTarget.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AddContentValue | ( | string | title,
 |  | string | description = null |
 | ) |  |  | [inline, private]

Definition at line 439 of file ShareTarget.xaml.cs.

        {
            Run contentType = new Run();
            contentType.FontWeight = FontWeights.Bold;
            contentType.Text = title;
            ContentValue.Inlines.Add(contentType);

            if (description != null)
            {
                Run contentValue = new Run();
                contentValue.Text = description + Environment.NewLine;
                ContentValue.Inlines.Add(contentValue);
            }
        }

void AddQuickLink_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 325 of file ShareTarget.xaml.cs.

        {
            QuickLinkCustomization.Visibility = Visibility.Visible;
        }

void AddQuickLink_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 330 of file ShareTarget.xaml.cs.

        {
            QuickLinkCustomization.Visibility = Visibility.Collapsed;
        }

void DismissUI_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 378 of file ShareTarget.xaml.cs.

        {
            this.shareOperation.DismissUI();
        }

async void Footer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 410 of file ShareTarget.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

void NotifyUser | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 415 of file ShareTarget.xaml.cs.

        {
            switch (type)
            {
                // Use the status message style.
                case NotifyType.StatusMessage:
                    StatusBlock.Style = Resources["StatusStyle"] as Style;
                    break;
                // Use the error message style.
                case NotifyType.ErrorMessage:
                    StatusBlock.Style = Resources["ErrorStyle"] as Style;
                    break;
            }
            StatusBlock.Text = strMessage;
        }

async void NotifyUserBackgroundThread | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 431 of file ShareTarget.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                NotifyUser(message, type);
            });
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 61 of file ShareTarget.xaml.cs.

        {
            // It is recommended to only retrieve the ShareOperation object in the activation handler, return as
            // quickly as possible, and retrieve all data from the share target asynchronously.

            this.shareOperation = (ShareOperation)e.Parameter;

            await Task.Factory.StartNew(async () =>
            {
                // Retrieve the data package properties.
                this.sharedDataTitle = this.shareOperation.Data.Properties.Title;
                this.sharedDataDescription = this.shareOperation.Data.Properties.Description;
                this.sharedDataPackageFamilyName = this.shareOperation.Data.Properties.PackageFamilyName;
                this.sharedDataContentSourceWebLink = this.shareOperation.Data.Properties.ContentSourceWebLink;
                this.sharedDataContentSourceApplicationLink = this.shareOperation.Data.Properties.ContentSourceApplicationLink;
                this.sharedDataLogoBackgroundColor = this.shareOperation.Data.Properties.LogoBackgroundColor;
                this.sharedDataSquare30x30Logo = this.shareOperation.Data.Properties.Square30x30Logo;
                this.sharedThumbnailStreamRef = this.shareOperation.Data.Properties.Thumbnail;
                this.shareQuickLinkId = this.shareOperation.QuickLinkId;

                // Retrieve the data package content.
                // The GetWebLinkAsync(), GetTextAsync(), GetStorageItemsAsync(), etc. APIs will throw if there was an error retrieving the data from the source app.
                // In this sample, we just display the error. It is recommended that a share target app handles these in a way appropriate for that particular app.
                if (this.shareOperation.Data.Contains(StandardDataFormats.WebLink))
                {
                    try
                    {
                        this.sharedWebLink = await this.shareOperation.Data.GetWebLinkAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetWebLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(StandardDataFormats.ApplicationLink))
                {
                    try
                    {
                        this.sharedApplicationLink = await this.shareOperation.Data.GetApplicationLinkAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetApplicationLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(StandardDataFormats.Text))
                {
                    try
                    {
                        this.sharedText = await this.shareOperation.Data.GetTextAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetTextAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(StandardDataFormats.StorageItems))
                {
                    try
                    {
                        this.sharedStorageItems = await this.shareOperation.Data.GetStorageItemsAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetStorageItemsAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(dataFormatName))
                {
                    try
                    {
                        this.sharedCustomData = await this.shareOperation.Data.GetTextAsync(dataFormatName);
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetTextAsync(" + dataFormatName + ") - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(StandardDataFormats.Html))
                {
                    try
                    {
                        this.sharedHtmlFormat = await this.shareOperation.Data.GetHtmlFormatAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetHtmlFormatAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }

                    try
                    {
                        this.sharedResourceMap = await this.shareOperation.Data.GetResourceMapAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetResourceMapAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }
                if (this.shareOperation.Data.Contains(StandardDataFormats.Bitmap))
                {
                    try
                    {
                        this.sharedBitmapStreamRef = await this.shareOperation.Data.GetBitmapAsync();
                    }
                    catch (Exception ex)
                    {
                        NotifyUserBackgroundThread("Failed GetBitmapAsync - " + ex.Message, NotifyType.ErrorMessage);
                    }
                }

                // In this sample, we just display the shared data content.

                // Get back to the UI thread using the dispatcher.
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                {
                    DataPackageTitle.Text = this.sharedDataTitle;
                    DataPackageDescription.Text = this.sharedDataDescription;
                    DataPackagePackageFamilyName.Text = this.sharedDataPackageFamilyName;
                    if (this.sharedDataContentSourceWebLink != null)
                    {
                        DataPackageContentSourceWebLink.Text = this.sharedDataContentSourceWebLink.AbsoluteUri;
                    }
                    if (this.sharedDataContentSourceApplicationLink != null)
                    {
                        DataPackageContentSourceApplicationLink.Text = this.sharedDataContentSourceApplicationLink.AbsoluteUri;
                    }

                    if (this.sharedDataSquare30x30Logo != null)
                    {
                        IRandomAccessStreamWithContentType logoStream = await this.sharedDataSquare30x30Logo.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(logoStream);
                        LogoHolder.Source = bitmapImage;
                        LogoBackground.Background = new SolidColorBrush(this.sharedDataLogoBackgroundColor);
                        LogoArea.Visibility = Visibility.Visible;
                    }

                    if (!String.IsNullOrEmpty(this.shareOperation.QuickLinkId))
                    {
                        SelectedQuickLinkId.Text = this.shareQuickLinkId;
                    }

                    if (this.sharedThumbnailStreamRef != null)
                    {
                        IRandomAccessStreamWithContentType thumbnailStream = await this.sharedThumbnailStreamRef.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(thumbnailStream);
                        ThumbnailHolder.Source = bitmapImage;
                        ThumbnailArea.Visibility = Visibility.Visible;
                    }

                    if (this.sharedWebLink != null)
                    {
                        AddContentValue("WebLink: ", this.sharedWebLink.AbsoluteUri);
                    }
                    if (this.sharedApplicationLink != null)
                    {
                        AddContentValue("ApplicationLink: ", this.sharedApplicationLink.AbsoluteUri);
                    }
                    if (this.sharedText != null)
                    {
                        AddContentValue("Text: ", this.sharedText);
                    }
                    if (this.sharedStorageItems != null)
                    {
                        // Display the name of the files being shared.
                        StringBuilder fileNames = new StringBuilder();
                        for (int index = 0; index < this.sharedStorageItems.Count; index++)
                        {
                            fileNames.Append(this.sharedStorageItems[index].Name);
                            if (index < this.sharedStorageItems.Count - 1)
                            {
                                fileNames.Append(", ");
                            }
                        }
                        fileNames.Append(".");

                        AddContentValue("StorageItems: ", fileNames.ToString());
                    }
                    if (this.sharedCustomData != null)
                    {
                        // This is an area to be especially careful parsing data from the source app to avoid buffer overruns.
                        // This sample doesn't perform data validation but will catch any exceptions thrown.
                        try
                        {
                            StringBuilder receivedStrings = new StringBuilder();
                            JsonObject customObject = JsonObject.Parse(this.sharedCustomData);
                            if (customObject.ContainsKey("type"))
                            {
                                if (customObject["type"].GetString() == "http://schema.org/Book")
                                {
                                    // This sample expects the custom format to be of type http://schema.org/Book
                                    receivedStrings.AppendLine("Type: " + customObject["type"].Stringify());
                                    JsonObject properties = customObject["properties"].GetObject();
                                    receivedStrings.AppendLine("Image: " + properties["image"].Stringify());
                                    receivedStrings.AppendLine("Name: " + properties["name"].Stringify());
                                    receivedStrings.AppendLine("Book Format: " + properties["bookFormat"].Stringify());
                                    receivedStrings.AppendLine("Author: " + properties["author"].Stringify());
                                    receivedStrings.AppendLine("Number of Pages: " + properties["numberOfPages"].Stringify());
                                    receivedStrings.AppendLine("Publisher: " + properties["publisher"].Stringify());
                                    receivedStrings.AppendLine("Date Published: " + properties["datePublished"].Stringify());
                                    receivedStrings.AppendLine("In Language: " + properties["inLanguage"].Stringify());
                                    receivedStrings.Append("ISBN: " + properties["isbn"].Stringify());

                                    AddContentValue("Custom format data:" + Environment.NewLine, receivedStrings.ToString());
                                }
                                else
                                {
                                    NotifyUser("The custom format from the source app is not of type http://schema.org/Book", NotifyType.ErrorMessage);
                                }
                            }
                            else
                            {
                                NotifyUser("The custom format from the source app doesn't contain a type", NotifyType.ErrorMessage);
                            }
                        }
                        catch (Exception ex)
                        {
                            NotifyUser("Failed to parse the custom data - " + ex.Message, NotifyType.ErrorMessage);
                        }
                    }
                    if (this.sharedHtmlFormat != null)
                    {
                        string htmlFragment = HtmlFormatHelper.GetStaticFragment(this.sharedHtmlFormat);
                        if (!String.IsNullOrEmpty(htmlFragment))
                        {
                            AddContentValue("HTML: ");
                            ShareWebView.Visibility = Visibility.Visible;
                            ShareWebView.NavigateToString("<html><body>" + htmlFragment + "</body></html>");
                        }
                        else
                        {
                            NotifyUser("GetStaticFragment failed to parse the HTML from the source app", NotifyType.ErrorMessage);
                        }

                        // Check if there are any local images in the resource map.
                        if (this.sharedResourceMap.Count > 0)
                        {
                            ResourceMapValue.Text = "";
                            foreach (KeyValuePair<string, RandomAccessStreamReference> item in this.sharedResourceMap)
                            {
                                ResourceMapValue.Text += "\nKey: " + item.Key;
                            }
                            ResourceMapArea.Visibility = Visibility.Visible;
                        }
                    }
                    if (this.sharedBitmapStreamRef != null)
                    {
                        IRandomAccessStreamWithContentType bitmapStream = await this.sharedBitmapStreamRef.OpenReadAsync();
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.SetSource(bitmapStream);
                        ImageHolder.Source = bitmapImage;
                        ImageArea.Visibility = Visibility.Visible;
                    }
                });
            });
        }

void OtherShareOperationMethodsSection_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 394 of file ShareTarget.xaml.cs.

        {
            ExtendedSharingArea.Visibility = Visibility.Visible;
        }

void OtherShareOperationMethodsSection_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 389 of file ShareTarget.xaml.cs.

        {
            ExtendedSharingArea.Visibility = Visibility.Collapsed;
        }

void OtherShareOperations_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 383 of file ShareTarget.xaml.cs.

        {
            // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
            OtherShareOperationMethodsSection.IsChecked = !OtherShareOperationMethodsSection.IsChecked;
        }

void QuickLinkSectionLabel_Tapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 319 of file ShareTarget.xaml.cs.

        {
            // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
            AddQuickLink.IsChecked = !AddQuickLink.IsChecked;
        }

async void ReportCompleted_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 335 of file ShareTarget.xaml.cs.

        {
            if (AddQuickLink.IsChecked.Equals(true))
            {
                QuickLink quickLinkInfo = new QuickLink
                {
                    Id = QuickLinkId.Text,
                    Title = QuickLinkTitle.Text,

                    // For QuickLinks, the supported FileTypes and DataFormats are set independently from the manifest.
                    SupportedFileTypes = { "*" },
                    SupportedDataFormats =
                    {
                        StandardDataFormats.Text,
                        StandardDataFormats.WebLink,
                        StandardDataFormats.ApplicationLink,
                        StandardDataFormats.Bitmap,
                        StandardDataFormats.StorageItems,
                        StandardDataFormats.Html,
                        dataFormatName
                    }
                };

                try
                {
                    StorageFile iconFile = await Package.Current.InstalledLocation.CreateFileAsync("assets\\squareTile-sdk.png", CreationCollisionOption.OpenIfExists);
                    quickLinkInfo.Thumbnail = RandomAccessStreamReference.CreateFromFile(iconFile);
                    this.shareOperation.ReportCompleted(quickLinkInfo);
                }
                catch (Exception)
                {
                    // Even if the QuickLink cannot be created it is important to call ReportCompleted. Otherwise, if this is a long-running share,
                    // the app will stick around in the long-running share progress list.
                    this.shareOperation.ReportCompleted();
                    throw;
                }
            }
            else
            {
                this.shareOperation.ReportCompleted();
            }
        }

void ReportDataRetrieved_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 399 of file ShareTarget.xaml.cs.

        {
            this.shareOperation.ReportDataRetrieved();
            this.NotifyUser("Data retrieved...", NotifyType.StatusMessage);
        }

void ReportErrorButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 405 of file ShareTarget.xaml.cs.

        {
            this.shareOperation.ReportError(ReportError.Text);
        }

Member Data Documentation

const string dataFormatName = "http://schema.org/Book" [private]

Definition at line 54 of file ShareTarget.xaml.cs.

Uri sharedApplicationLink [private]

Definition at line 47 of file ShareTarget.xaml.cs.

IRandomAccessStreamReference sharedBitmapStreamRef [private]

Definition at line 52 of file ShareTarget.xaml.cs.

string sharedCustomData [private]

Definition at line 49 of file ShareTarget.xaml.cs.

Uri sharedDataContentSourceApplicationLink [private]

Definition at line 41 of file ShareTarget.xaml.cs.

Uri sharedDataContentSourceWebLink [private]

Definition at line 40 of file ShareTarget.xaml.cs.

string sharedDataDescription [private]

Definition at line 38 of file ShareTarget.xaml.cs.

Color sharedDataLogoBackgroundColor [private]

Definition at line 42 of file ShareTarget.xaml.cs.

string sharedDataPackageFamilyName [private]

Definition at line 39 of file ShareTarget.xaml.cs.

IRandomAccessStreamReference sharedDataSquare30x30Logo [private]

Definition at line 43 of file ShareTarget.xaml.cs.

string sharedDataTitle [private]

Definition at line 37 of file ShareTarget.xaml.cs.

string sharedHtmlFormat [private]

Definition at line 50 of file ShareTarget.xaml.cs.

IReadOnlyDictionary<string, RandomAccessStreamReference> sharedResourceMap [private]

Definition at line 51 of file ShareTarget.xaml.cs.

IReadOnlyList<IStorageItem> sharedStorageItems [private]

Definition at line 48 of file ShareTarget.xaml.cs.

string sharedText [private]

Definition at line 45 of file ShareTarget.xaml.cs.

IRandomAccessStreamReference sharedThumbnailStreamRef [private]

Definition at line 53 of file ShareTarget.xaml.cs.

Uri sharedWebLink [private]

Definition at line 46 of file ShareTarget.xaml.cs.

ShareOperation shareOperation [private]

Definition at line 36 of file ShareTarget.xaml.cs.

string shareQuickLinkId [private]

Definition at line 44 of file ShareTarget.xaml.cs.

The documentation for this class was generated from the following file:
  • ShareTarget/cs/ShareTarget.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareText Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareText
Public Member Functions | Protected Member Functions

ShareText Class Reference

List of all members.

Public Member Functions

ShareText ()

Protected Member Functions

override bool GetShareContent (DataRequest request)

Detailed Description

Definition at line 17 of file ShareText.xaml.cs.

Constructor & Destructor Documentation

ShareText ( ) [inline]

Definition at line 19 of file ShareText.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 24 of file ShareText.xaml.cs.

        {
            bool succeeded = false;

            string dataPackageText = TextToShare.Text;
            if (!String.IsNullOrEmpty(dataPackageText))
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = TitleInputBox.Text;
                requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                requestData.SetText(dataPackageText);
                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Enter the text you would like to share and try again.");
            }
            return succeeded;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareText.xaml.cs
  • ShareSource/cpp/ShareText.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareWebLink Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShareWebLink
Public Member Functions | Protected Member Functions | Private Member Functions

ShareWebLink Class Reference

List of all members.

Public Member Functions

ShareWebLink ()

Protected Member Functions

override bool | GetShareContent (DataRequest request)

Private Member Functions

Uri | ValidateAndGetUri (string uriString)

Detailed Description

Definition at line 17 of file ShareWebLink.xaml.cs.

Constructor & Destructor Documentation

ShareWebLink ( ) [inline]

Definition at line 19 of file ShareWebLink.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override bool GetShareContent ( DataRequest request ) [inline, protected]

Definition at line 24 of file ShareWebLink.xaml.cs.

        {
            bool succeeded = false;

            // The URI used in this sample is provided by the user so we need to ensure it's a well formatted absolute URI
            // before we try to share it.
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            Uri dataPackageUri = ValidateAndGetUri(UriToShare.Text);
            if (dataPackageUri != null)
            {
                DataPackage requestData = request.Data;
                requestData.Properties.Title = TitleInputBox.Text;
                requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
                requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
                requestData.SetWebLink(dataPackageUri);
                succeeded = true;
            }
            else
            {
                request.FailWithDisplayText("Enter the web link you would like to share and try again.");
            }
            return succeeded;
        }

Uri ValidateAndGetUri ( string uriString ) [inline, private]

Definition at line 48 of file ShareWebLink.xaml.cs.

        {
            Uri uri = null;
            try
            {
                uri = new Uri(uriString);
            }
            catch (FormatException)
            {
                this.rootPage.NotifyUser("The web link provided is not a valid absolute URI.", NotifyType.ErrorMessage);
            }
            return uri;
        }

The documentation for this class was generated from the following files:
  • ShareSource/cs/ShareWebLink.xaml.cs
  • ShareSource/cpp/ShareWebLink.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShowPackageFamilyName Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ShowPackageFamilyName
Public Member Functions

ShowPackageFamilyName Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ShowPackageFamilyName ()

Detailed Description

Definition at line 22 of file ShowPackageFamilyName.xaml.cs.

Constructor & Destructor Documentation

ShowPackageFamilyName ( ) [inline]

Definition at line 24 of file ShowPackageFamilyName.xaml.cs.

        {
            this.InitializeComponent();
            PackageFamilyName.Text = Package.Current.Id.FamilyName;
        }

The documentation for this class was generated from the following file:
  • AppServices/cs/AppServicesProvider/ShowPackageFamilyName.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SignIn Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SignIn
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SignIn Class Reference

The sign in form that contains username and password fields and the option to sign in with either Microsoft Passport or traditional username/password authentication. More...

List of all members.

Public Member Functions

SignIn ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async Task< bool > | AddPassportToAccountOnServer ()
async Task< bool > | AuthenticatePassportAsync ()
async Task< bool > | AuthenticatePasswordCredentialsAsync ()
async void | Button_Passport_Click (object sender, RoutedEventArgs e)
async void | Button_SignIn_Click (object sender, RoutedEventArgs e)
void | CleanUpUserList ()
async Task< bool > | CreatePassportKeyAsync (string accountId)
async Task< IBuffer > | GetPassportAuthenticationMessageAsync (IBuffer message, string accountId)
async Task | PassportAvailableCheckAsync ()
async Task | SignInPassportAsync (bool passportIsPrimaryLogin)
async Task< bool > | SignInPasswordAsync (bool calledFromPassport)
void | SuccessfulSignIn (Account account)

Private Attributes

Account m_account
bool | m_addingAccount = true
bool | m_passportAvailable = true
MainPage rootPage

Detailed Description

Right now there is no authentication of username/password except for that they are not empty - so any username/password combo will be accepted. However if Passport is used, it will use the actual Passport PIN that is set up on the machine running the sample.

If an account was passed from the user select we will do one of two things

1. If the selected account used Microsoft Passport as the last sign in method, it will attempt Microsoft Passport sign in first. If that is cancelled or fails, it will fall back on username/password form for sign in.

2. Else - show the username/password sign in form with username filled in based on chosen account.

Definition at line 40 of file SignIn.xaml.cs.

Constructor & Destructor Documentation

SignIn ( ) [inline]

Definition at line 47 of file SignIn.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async Task<bool> AddPassportToAccountOnServer ( ) [inline, private]

Function to be called when we need to register our public key with the server for Microsoft Passport.

Returns:
Boolean representing if adding the Passport login method to this account on the server succeeded

Definition at line 303 of file SignIn.xaml.cs.

        {
            // TODO: Add Passport signing info to server when that part is done for the sample
            await Task.Delay(100);

            return true;
        }

task< bool > AuthenticatePassportAsync ( ) [inline, private]

Attempts to get the authentication message from the Passport key for this account.

This will bring up the Passport PIN dialog and prompt the user for their PIN.

The authentication message will be null if signing fails.

Returns:
Boolean representing if authenticating Passport succeeded

Definition at line 258 of file SignIn.xaml.cs.

        {
            IBuffer message = CryptographicBuffer.ConvertStringToBinary("LoginAuth", BinaryStringEncoding.Utf8);
            IBuffer authMessage = await GetPassportAuthenticationMessageAsync(message, m_account.Email);

            if (authMessage != null)
            {
                return true;
            }

            return false;
        }

task< bool > AuthenticatePasswordCredentialsAsync ( ) [inline, private]

Authenticate user credentials with server and return result.

Returns:
Boolean representing if authenticating the user credentials with the server succeeded

Definition at line 242 of file SignIn.xaml.cs.

        {
            // TODO: Authenticate with server once that part is done for the sample.
            await Task.Delay(100);

            return true;
        }

async void Button_Passport_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Function called when the "Sign In with Microsoft Passport" button is clicked.

Checks if we are using an existing account and passes their preference for passport otherwise if this is a new account then they don't have a preference yet.

Parameters:
sender
e

Definition at line 100 of file SignIn.xaml.cs.

        {
            if (m_addingAccount == false)
            {
                await SignInPassportAsync(m_account.UsesPassport);
            }
            else
            {
                await SignInPassportAsync(false);
            }
        }

async void Button_SignIn_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Function called when regular username/password sign in button is clicked.

Parameters:
sender
e

Definition at line 87 of file SignIn.xaml.cs.

        {
            await SignInPasswordAsync(false);
        }

void CleanUpUserList ( ) [inline, private]

Uses the AccountsHelper class to save the account list before we move on from the sign in process.

Definition at line 315 of file SignIn.xaml.cs.

        {
            AccountsHelper.SaveAccountList(UserSelect.accountList);
        }

async Task<bool> CreatePassportKeyAsync ( string accountId ) [inline, private]

Creates a Passport key on the machine using the account id passed.

Then returns a boolean based on whether we were able to create a Passport key or not.

Will also attempt to create an attestation that this key is backed by hardware on the device, but is not a requirement for a working key in this scenario. It is possible to not accept a key that is software-based only.

Parameters:
accountId The account id associated with the account that we are enrolling into Passport
Returns:
Boolean representing if creating the Passport key succeeded

Definition at line 329 of file SignIn.xaml.cs.

        {
            KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync(accountId, KeyCredentialCreationOption.ReplaceExisting);

            if (keyCreationResult.Status == KeyCredentialStatus.Success)
            {
                rootPage.NotifyUser("Successfully made key", NotifyType.StatusMessage);

                KeyCredential userKey = keyCreationResult.Credential;
                IBuffer publicKey = userKey.RetrievePublicKey();
                KeyCredentialAttestationResult keyAttestationResult = await userKey.GetAttestationAsync();

                IBuffer keyAttestation = null;
                IBuffer certificateChain = null;
                bool keyAttestationIncluded = false;
                bool keyAttestationCanBeRetrievedLater = false;
                KeyCredentialAttestationStatus keyAttestationRetryType = 0;

                if (keyAttestationResult.Status == KeyCredentialAttestationStatus.Success)
                {
                    keyAttestationIncluded = true;
                    keyAttestation = keyAttestationResult.AttestationBuffer;
                    certificateChain = keyAttestationResult.CertificateChainBuffer;
                    rootPage.NotifyUser("Successfully made key and attestation", NotifyType.StatusMessage);
                }
                else if (keyAttestationResult.Status == KeyCredentialAttestationStatus.TemporaryFailure)
                {
                    keyAttestationRetryType = KeyCredentialAttestationStatus.TemporaryFailure;
                    keyAttestationCanBeRetrievedLater = true;
                    rootPage.NotifyUser("Successfully made key but not attestation", NotifyType.StatusMessage);
                }
                else if (keyAttestationResult.Status == KeyCredentialAttestationStatus.NotSupported)
                {
                    keyAttestationRetryType = KeyCredentialAttestationStatus.NotSupported;
                    keyAttestationCanBeRetrievedLater = false;
                    rootPage.NotifyUser("Key created, but key attestation not supported", NotifyType.StatusMessage);
                }

                // Package public key, keyAttesation if available,
                // certificate chain for attestation endorsement key if available,
                // status code of key attestation result: keyAttestationIncluded or
                // keyAttestationCanBeRetrievedLater and keyAttestationRetryType
                // and send it to application server to register the user.
                bool serverAddedPassportToAccount = await AddPassportToAccountOnServer();

                if (serverAddedPassportToAccount == true)
                {
                    return true;
                }
            }
            else if (keyCreationResult.Status == KeyCredentialStatus.UserCanceled)
            {
                // User cancelled the Passport enrollment process
            }
            else if (keyCreationResult.Status == KeyCredentialStatus.NotFound)
            {
                // User needs to create PIN
                textblock_PassportStatusText.Text = "Microsoft Passport is almost ready!\nPlease go to Windows Settings and set up a PIN to use it.";
                grid_PassportStatus.Background = new SolidColorBrush(Color.FromArgb(255, 50, 170, 207));
                button_PassportSignIn.IsEnabled = false;

                m_passportAvailable = false;
            }
            else
            {
                rootPage.NotifyUser(keyCreationResult.Status.ToString(), NotifyType.ErrorMessage);
            }

            return false;
        }

async Task<IBuffer> GetPassportAuthenticationMessageAsync | ( | IBuffer | message,
 |  | string | accountId |
 | ) |  |  | [inline, private]

Attempts to sign a message using the Passport key on the system for the accountId passed.

Parameters:
message | The message to be signed
accountId | The account id for the Passport key we are using to sign
Returns:
Boolean representing if creating the Passport authentication message succeeded

Definition at line 406 of file SignIn.xaml.cs.

        {
            KeyCredentialRetrievalResult openKeyResult = await KeyCredentialManager.OpenAsync(accountId);

            if (openKeyResult.Status == KeyCredentialStatus.Success)
            {
                KeyCredential userKey = openKeyResult.Credential;
                IBuffer publicKey = userKey.RetrievePublicKey();

                KeyCredentialOperationResult signResult = await userKey.RequestSignAsync(message);

                if (signResult.Status == KeyCredentialStatus.Success)
                {
                    return signResult.Result;
                }
                else if (signResult.Status == KeyCredentialStatus.UserCanceled)
                {
                    // User cancelled the Passport PIN entry.
                    //
                    // We will return null below this and the username/password
                    // sign in form will show.
                }
                else if (signResult.Status == KeyCredentialStatus.NotFound)
                {
                    // Must recreate Passport key
                }
                else if (signResult.Status == KeyCredentialStatus.SecurityDeviceLocked)
                {
                    // Can't use Passport right now, remember that hardware failed and suggest restart
                }
                else if (signResult.Status == KeyCredentialStatus.UnknownError)
                {
                    // Can't use Passport right now, try again later
                }

                return null;
            }
            else if (openKeyResult.Status == KeyCredentialStatus.NotFound)
            {
                // Passport key lost, need to recreate it
                textblock_PassportStatusText.Text = "Microsoft Passport is almost ready!\nPlease go to Windows Settings and set up a PIN to use it.";
                grid_PassportStatus.Background = new SolidColorBrush(Color.FromArgb(255, 50, 170, 207));
                button_PassportSignIn.IsEnabled = false;

                m_passportAvailable = false;
            }
            else
            {
                // Can't use Passport right now, try again later
            }
            return null;
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

The function that will be called when this frame is navigated to.

Checks to see if Microsoft Passport is available and checks to see if an account was passed in.

If an account was passed, check if it uses Microsoft Passport. and set the "adding user" flag so we don't add a new account to the list of users.

Parameters:
e

Definition at line 63 of file SignIn.xaml.cs.

        {
            rootPage = MainPage.Current;
            await PassportAvailableCheckAsync();

            if (e.Parameter != null)
            {
                m_account = (Account)e.Parameter;
                textbox_Username.Text = m_account.Email;
                textbox_Username.IsEnabled = false;
                m_addingAccount = false;

                if (m_account.UsesPassport)
                {
                    await SignInPassportAsync(true);
                }
            }
        }

task< void > PassportAvailableCheckAsync ( ) [inline, private]

Checks to see if Passport is ready to be used.

Passport has dependencies on: 1. Having a connected MSA Account 2. Having a Windows PIN set up for that account on the local machine

If Passport is not ready, then display how to set it up to the user and disable the "Sign In with Passport" button.

Definition at line 122 of file SignIn.xaml.cs.

        {
            if (await KeyCredentialManager.IsSupportedAsync())
            {
                button_PassportSignIn.IsEnabled = true;
            }
            else
            {
                //
                // Key credential is not enabled yet as user
                // needs to connect to a MSA account and select a pin in the connecting flow.
                //
                grid_PassportStatus.Background = new SolidColorBrush(Color.FromArgb(255, 50, 170, 207));
                textblock_PassportStatusText.Text = "Microsoft Passport is not set up.\nPlease go to Windows Settings and connect an MSA account!";
                m_passportAvailable = false;
            }
        }

task< void > SignInPassportAsync ( bool passportIsPrimaryLogin ) [inline, private]

The function called when the user wants to sign in with Passport but from the username/password dialog.

First we check if they already use Passport as their primary login method

Otherwise we authenticate their username/password and then begin the Passport enrollment process which consists of creating a Passport key and then sending that to the authentication server.

Parameters:
passportIsPrimaryLogin Boolean representing if primary login method is Passport

Definition at line 151 of file SignIn.xaml.cs.

        {
            if (passportIsPrimaryLogin == true)
            {
                if (await AuthenticatePassportAsync() == true)
                {
                    SuccessfulSignIn(m_account);
                    return;
                }
            }
            else if (await SignInPasswordAsync(true) == true)
            {
                if (await CreatePassportKeyAsync(textbox_Username.Text) == true)
                {
                    bool serverAddedPassportToAccount = await AddPassportToAccountOnServer();

                    if (serverAddedPassportToAccount == true)
                    {
                        rootPage.NotifyUser("Successfully signed in with Microsoft Passport!", NotifyType.StatusMessage);
                        if (m_addingAccount == true)
                        {
                            Account goodAccount = new Account() { Name = textbox_Username.Text, Email = textbox_Username.Text, UsesPassport = true };
                            SuccessfulSignIn(goodAccount);
                        }
                        else
                        {
                            m_account.UsesPassport = true;
                            SuccessfulSignIn(m_account);
                        }
                        return;
                    }
                }
                textblock_ErrorField.Text = "Sign In with Passport failed. Try later.";
                button_PassportSignIn.IsEnabled = false;
            }
            textblock_ErrorField.Text = "Invalid username or password.";
        }

task< bool > SignInPasswordAsync ( bool calledFromPassport ) [inline, private]

Method called when a user clicks on the username/password Sign In button.

Will attempt to authenticate the credentials with the server and then either sign in or display an error to the user if applicable.

Parameters:
calledFromPassport Boolean representing if this method was called from the user clicking "Sign In with Microsoft Passport"
Returns:
Boolean representing if signing in with password succeeded

Definition at line 197 of file SignIn.xaml.cs.

        {
            textblock_ErrorField.Text = "";

            if (textbox_Username.Text.Length == 0 || passwordbox_Password.Password.Length == 0)
            {
                textblock_ErrorField.Text = "Username/Password cannot be blank.";
                return false;
            }

            try
            {
                bool signedIn = await AuthenticatePasswordCredentialsAsync();

                if (!signedIn)
                {
                    textblock_ErrorField.Text = "Unable to sign you in with those credentials.";
                }
                else
                {
                    // TODO: Roaming Passport settings. Make it so the server can tell us if they prefer to use Passport and upsell immediately.

                    Account goodAccount = new Account() { Name = textbox_Username.Text, Email = textbox_Username.Text, UsesPassport = false };
                    if (!calledFromPassport)
                    {
                        rootPage.NotifyUser("Successfully signed in with traditional username/password!", NotifyType.StatusMessage);
                        SuccessfulSignIn(goodAccount);
                    }

                    return true;
                }

                return false;
            }
            catch (Exception e)
            {
                rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
                return false;
            }
        }

void SuccessfulSignIn ( Account account ) [inline, private]

Handles user saving for our list of users if this is a new user and navigates to the main content.

Parameters:
account The account used to sign in

Definition at line 276 of file SignIn.xaml.cs.

        {
            // If this is an already existing account, replace the old
            // version of this account in the account list.
            if (m_addingAccount == false)
            {
                foreach (Account a in UserSelect.accountList)
                {
                    if (a.Email == account.Email)
                    {
                        UserSelect.accountList.Remove(a);
                        break;
                    }
                }
            }

            UserSelect.accountList.Add(account);

            CleanUpUserList();
            this.Frame.Navigate(typeof(Content), account);
        }

Member Data Documentation

Account m_account [private]

Definition at line 44 of file SignIn.xaml.cs.

bool m_addingAccount = true [private]

Definition at line 43 of file SignIn.xaml.cs.

bool m_passportAvailable = true [private]

Definition at line 45 of file SignIn.xaml.cs.

MainPage rootPage [private]

Definition at line 42 of file SignIn.xaml.cs.

The documentation for this class was generated from the following files:
  • KeyCredentialManager/cs/SignIn.xaml.cs
  • KeyCredentialManager/cpp/SignIn.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleLogger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SimpleLogger
Public Member Functions | Private Member Functions | Private Attributes

SimpleLogger Class Reference

A simple logger to display text to TextBlock asynchronisely.

List of all members.

Public Member Functions

SimpleLogger (TextBlock textBlock)

Private Member Functions

internal async void | Log (string message)

Private Attributes

CoreDispatcher | _dispatcher
int | _messageCount
readonly object | _messageLock = new object()
string | _messageText = string.Empty
TextBlock | _textBlock

Detailed Description

Definition at line 21 of file SimpleLogger.cs.

Constructor & Destructor Documentation

SimpleLogger ( TextBlock textBlock ) [inline]

Definition at line 29 of file SimpleLogger.cs.

        {
            _textBlock = textBlock;
            _dispatcher = _textBlock.Dispatcher;
        }

Member Function Documentation

internal async void Log ( string message ) [inline, private]

Logs a message to be displayed.

Definition at line 38 of file SimpleLogger.cs.

        {
            var newMessage = $"[{_messageCount ++}] {DateTime.Now.ToString("hh:MM:ss")} : {message}\n{_messageText}";

            lock(_messageLock)
            {
                _messageText = newMessage;
            }

            await _dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                lock (_messageLock)
                {
                    _textBlock.Text = _messageText;
                }
            });
        }

Member Data Documentation

CoreDispatcher _dispatcher [private]

Definition at line 23 of file SimpleLogger.cs.

int _messageCount [private]

Definition at line 27 of file SimpleLogger.cs.

readonly object _messageLock = new object() [private]

Definition at line 26 of file SimpleLogger.cs.

string _messageText = string.Empty [private]

Definition at line 25 of file SimpleLogger.cs.

TextBlock _textBlock [private]

Definition at line 24 of file SimpleLogger.cs.

The documentation for this class was generated from the following file:
  • CameraFrames/cs/SimpleLogger.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SizePreferenceString Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SizePreferenceString
Properties

SizePreferenceString Class Reference

List of all members.

Properties

ViewSizePreference | Preference [get, set]
string | Title [get, set]

Detailed Description

Definition at line 23 of file Scenario1.xaml.cs.

Property Documentation

ViewSizePreference Preference [get, set]

Definition at line 26 of file Scenario1.xaml.cs.

string Title [get, set]

Definition at line 25 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • MultipleViews/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SlowInputStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SlowInputStream
Public Member Functions | Private Attributes

SlowInputStream Class Reference

List of all members.

Public Member Functions

SlowInputStream (uint length)
void Dispose ()
IAsyncOperationWithProgress
< IBuffer, uint > 		ReadAsync (IBuffer buffer, uint count, InputStreamOptions options)

Private Attributes

uint length
uint position

Detailed Description

Definition at line 24 of file SlowInputStream.cs.

Constructor & Destructor Documentation

SlowInputStream ( uint length ) [inline]

Definition at line 29 of file SlowInputStream.cs.

        {
            this.length = length;
            position = 0;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 60 of file SlowInputStream.cs.

        {
        }

IAsyncOperationWithProgress<IBuffer, uint> ReadAsync | ( | IBuffer | buffer,
 |  | uint | count,
 |  | InputStreamOptions | options |
 | ) |  |  | [inline]

Definition at line 35 of file SlowInputStream.cs.

        {
            return AsyncInfo.Run<IBuffer, uint>(async (cancellationToken, progress) =>
            {
                if (length - position < count)
                {
                    count = length - position;
                }

                byte[] data = new byte[count];
                for (uint i = 0; i < count; i++)
                {
                    data[i] = 64;
                }

                // Introduce a 1 second delay.
                await Task.Delay(1000);

                position += count;
                progress.Report(count);

                return data.AsBuffer();
            });
        }

Member Data Documentation

uint length [private]

Definition at line 26 of file SlowInputStream.cs.

uint position [private]

Definition at line 27 of file SlowInputStream.cs.

The documentation for this class was generated from the following file:
  • HttpClient/cs/SlowInputStream.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCardListItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SmartCardListItem
Properties

SmartCardListItem Class Reference

List of all members.

Properties

string | CardName [get, set]
string | ReaderName [get, set]

Detailed Description

Definition at line 10 of file Scenario7_ListAllCards.xaml.cs.

Property Documentation

string CardName [get, set]

Definition at line 19 of file Scenario7_ListAllCards.xaml.cs.

string ReaderName [get, set]

Definition at line 13 of file Scenario7_ListAllCards.xaml.cs.

The documentation for this class was generated from the following file:
  • SmartCard/cs/Scenario7_ListAllCards.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketReaderWriter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SocketReaderWriter
Public Member Functions | Private Attributes

SocketReaderWriter Class Reference

List of all members.

Public Member Functions

SocketReaderWriter (StreamSocket socket, MainPage mainPage)
void | Dispose ()
async Task< string > | ReadMessageAsync ()
async Task | WriteMessageAsync (string message)

Private Attributes

DataReader | _dataReader
DataWriter | _dataWriter
MainPage _rootPage
StreamSocket | _streamSocket

Detailed Description

Definition at line 25 of file SocketReaderWriter.cs.

Constructor & Destructor Documentation

SocketReaderWriter | ( | StreamSocket | socket,
 |  | MainPage | mainPage |
 | ) |  |  | [inline]

Definition at line 32 of file SocketReaderWriter.cs.

        {
            _dataReader = new DataReader(socket.InputStream);
            _dataReader.UnicodeEncoding = UnicodeEncoding.Utf8;
            _dataReader.ByteOrder = ByteOrder.LittleEndian;

            _dataWriter = new DataWriter(socket.OutputStream);
            _dataWriter.UnicodeEncoding = UnicodeEncoding.Utf8;
            _dataWriter.ByteOrder = ByteOrder.LittleEndian;

            _streamSocket = socket;
            _rootPage = mainPage;
        }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 46 of file SocketReaderWriter.cs.

        {
            _dataReader.Dispose();
            _dataWriter.Dispose();
            _streamSocket.Dispose();
        }

async Task<string> ReadMessageAsync ( ) [inline]

Definition at line 68 of file SocketReaderWriter.cs.

        {
            try
            {
                UInt32 bytesRead = await _dataReader.LoadAsync(sizeof(UInt32));
                if (bytesRead > 0)
                {
                    // Determine how long the string is.
                    UInt32 messageLength = _dataReader.ReadUInt32();
                    bytesRead = await _dataReader.LoadAsync(messageLength);
                    if (bytesRead > 0)
                    {
                        // Decode the string.
                        string message = _dataReader.ReadString(messageLength);
                        _rootPage.NotifyUserFromBackground("Got message: " + message, NotifyType.StatusMessage);
                        return message;
                    }
                }
            }
            catch (Exception)
            {
                _rootPage.NotifyUserFromBackground("Socket was closed!", NotifyType.StatusMessage);
            }
            return null;
        }

async Task WriteMessageAsync ( string message ) [inline]

Definition at line 53 of file SocketReaderWriter.cs.

        {
            try
            {
                _dataWriter.WriteUInt32(_dataWriter.MeasureString(message));
                _dataWriter.WriteString(message);
                await _dataWriter.StoreAsync();
                _rootPage.NotifyUserFromBackground("Sent message: " + message, NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                _rootPage.NotifyUserFromBackground("WriteMessage threw exception: " + ex.Message, NotifyType.StatusMessage);
            }
        }

Member Data Documentation

DataReader _dataReader [private]

Definition at line 27 of file SocketReaderWriter.cs.

DataWriter _dataWriter [private]

Definition at line 28 of file SocketReaderWriter.cs.

MainPage _rootPage [private]

Definition at line 30 of file SocketReaderWriter.cs.

StreamSocket _streamSocket [private]

Definition at line 29 of file SocketReaderWriter.cs.

The documentation for this class was generated from the following file:
  • WiFiDirect/cs/SocketReaderWriter.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SourceGroupCollection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SourceGroupCollection
Public Member Functions | Properties | Private Member Functions | Private Attributes

SourceGroupCollection Class Reference

View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl.

List of all members.

Public Member Functions

SourceGroupCollection (CoreDispatcher uiDispatcher)
void | Dispose ()

Properties

IReadOnlyList
< FrameSourceGroupModel > 		FrameSourceGroups [get]

Private Member Functions

async Task | AddDeviceAsync (string id)
async Task | RemoveDevice (string id)
async void | Watcher_Added (DeviceWatcher sender, DeviceInformation args)
async void | Watcher_Removed (DeviceWatcher sender, DeviceInformationUpdate args)
async void | Watcher_Updated (DeviceWatcher sender, DeviceInformationUpdate args)

Private Attributes

CoreDispatcher | _dispatcher
ObservableCollection
< FrameSourceGroupModel > 		_sourceCollection
DeviceWatcher | _watcher

Detailed Description

Definition at line 125 of file FrameSourceViewModels.cs.

Constructor & Destructor Documentation

SourceGroupCollection ( CoreDispatcher uiDispatcher ) [inline]

Definition at line 131 of file FrameSourceViewModels.cs.

        {
            _dispatcher = uiDispatcher;
            _sourceCollection = new ObservableCollection<FrameSourceGroupModel>();

            // Only listen to devices with type of MediaFrameSourceGroup
            var deviceSelector = MediaFrameSourceGroup.GetDeviceSelector();
            _watcher = DeviceInformation.CreateWatcher(deviceSelector);
            _watcher.Added += Watcher_Added;
            _watcher.Removed += Watcher_Removed;
            _watcher.Updated += Watcher_Updated;
            _watcher.Start();
        }

Member Function Documentation

async Task AddDeviceAsync ( string id ) [inline, private]

Adds a SourceGroup with given Id to the collection.

Definition at line 186 of file FrameSourceViewModels.cs.

        {
            var group = await MediaFrameSourceGroup.FromIdAsync(id);
            if (group != null)
            {
                await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        _sourceCollection.Add(new FrameSourceGroupModel(group));
                    });
            }
        }

void Dispose ( ) [inline]

Definition at line 145 of file FrameSourceViewModels.cs.

        {
            _watcher.Stop();
            _watcher.Updated -= Watcher_Updated;
            _watcher.Removed -= Watcher_Removed;
            _watcher.Added -= Watcher_Added;
        }

async Task RemoveDevice ( string id ) [inline, private]

Removes a SourceGroup with given id from the collection if it exists.

Definition at line 201 of file FrameSourceViewModels.cs.

        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    var existing = _sourceCollection.FirstOrDefault(item => item.Id == id);
                    if (existing != null)
                    {
                        _sourceCollection.Remove(existing);
                    }
                });
        }

async void Watcher_Added | ( | DeviceWatcher | sender,
 |  | DeviceInformation | args |
 | ) |  |  | [inline, private]

Adds a device to the collection when one connected.

Definition at line 178 of file FrameSourceViewModels.cs.

        {
            await AddDeviceAsync(args.Id);
        }

async void Watcher_Removed | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Removes a device from the collection when one disconnected.

Definition at line 170 of file FrameSourceViewModels.cs.

        {
            await RemoveDevice(args.Id);
        }

async void Watcher_Updated | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | args |
 | ) |  |  | [inline, private]

Updates a device when a change occurs.

Definition at line 161 of file FrameSourceViewModels.cs.

        {
            await RemoveDevice(args.Id);
            await AddDeviceAsync(args.Id);
        }

Member Data Documentation

CoreDispatcher _dispatcher [private]

Definition at line 127 of file FrameSourceViewModels.cs.

ObservableCollection<FrameSourceGroupModel> _sourceCollection [private]

Definition at line 129 of file FrameSourceViewModels.cs.

DeviceWatcher _watcher [private]

Definition at line 128 of file FrameSourceViewModels.cs.

Property Documentation

IReadOnlyList<FrameSourceGroupModel> FrameSourceGroups [get]

Definition at line 154 of file FrameSourceViewModels.cs.

The documentation for this class was generated from the following file:
  • CameraFrames/cs/FrameSourceViewModels.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Status Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Status
Static Private Attributes

Status Class Reference

List of all members.

Static Private Attributes

static internal readonly string | FileAdded = "File added to the basket."
static internal readonly string | FileAddFailed = "Couldn't add file to the basket."
static internal readonly string | FileRemoved = "File removed from the basket."

Detailed Description

Definition at line 38 of file SampleConfiguration.cs.

Member Data Documentation

internal readonly string FileAdded = "File added to the basket." [static, private]

Definition at line 40 of file SampleConfiguration.cs.

internal readonly string FileAddFailed = "Couldn't add file to the basket." [static, private]

Definition at line 42 of file SampleConfiguration.cs.

internal readonly string FileRemoved = "File removed from the basket." [static, private]

Definition at line 41 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • FilePickerContracts/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamResolution Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • StreamResolution
Public Member Functions | Properties | Private Attributes

StreamResolution Class Reference

Wrapper class around IMediaEncodingProperties to help how devices report supported resolutions. More...

List of all members.

Public Member Functions

StreamResolution (IMediaEncodingProperties properties)
string | GetFriendlyName (bool showFrameRate=true)

Properties

double | AspectRatio [get]
IMediaEncodingProperties | EncodingProperties [get]
uint | FrameRate [get]
uint | Height [get]
uint | Width [get]

Private Attributes

IMediaEncodingProperties | _properties

Detailed Description

Definition at line 21 of file StreamResolution.cs.

Constructor & Destructor Documentation

StreamResolution ( IMediaEncodingProperties properties ) [inline]

Definition at line 25 of file StreamResolution.cs.

        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            // Only handle ImageEncodingProperties and VideoEncodingProperties, which are the two types that GetAvailableMediaStreamProperties can return
            if (!(properties is ImageEncodingProperties) && !(properties is VideoEncodingProperties))
            {
                throw new ArgumentException("Argument is of the wrong type. Required: " + typeof(ImageEncodingProperties).Name
                    + " or " + typeof(VideoEncodingProperties).Name + ".", nameof(properties));
            }

            // Store the actual instance of the IMediaEncodingProperties for setting them later
            _properties = properties;
        }

Member Function Documentation

string GetFriendlyName ( bool showFrameRate = true ) [inline]

Output properties to a readable format for UI purposes eg.

1920x1080 [1.78] 30fps MPEG

Returns:
Readable string

Definition at line 108 of file StreamResolution.cs.

        {
            if (_properties is ImageEncodingProperties ||
                !showFrameRate)
            {
                return Width + "x" + Height + " [" + AspectRatio + "] " + _properties.Subtype;
            }
            else if (_properties is VideoEncodingProperties)
            {
                return Width + "x" + Height + " [" + AspectRatio + "] " + FrameRate + "FPS " + _properties.Subtype;
            }

            return String.Empty;
        }

Member Data Documentation

IMediaEncodingProperties _properties [private]

Definition at line 23 of file StreamResolution.cs.

Property Documentation

double AspectRatio [get]

Definition at line 94 of file StreamResolution.cs.

IMediaEncodingProperties EncodingProperties [get]

Definition at line 99 of file StreamResolution.cs.

uint FrameRate [get]

Definition at line 78 of file StreamResolution.cs.

uint Height [get]

Definition at line 61 of file StreamResolution.cs.

uint Width [get]

Definition at line 44 of file StreamResolution.cs.

The documentation for this class was generated from the following file:
  • CameraResolution/cs/StreamResolution.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • StreamSocketSample
  • sealed
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "Scenario1.xaml.h"

List of all members.

Public Member Functions

ListenerContext (MainPage^rootPage, Windows::Networking::Sockets::StreamSocketListener^listener)
LocalHostItem (Windows::Networking::HostName^localHostName)
void | OnConnection (Windows::Networking::Sockets::StreamSocketListener^listener, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^object)
Scenario1 ()
Scenario2 ()
Scenario3 ()
Scenario4 ()
Scenario5 ()

Protected Member Functions

virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override

Properties

Windows::Networking::HostName | localHost

Private Member Functions

~ListenerContext ()
void | BindToAny_Checked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | BindToAny_Unchecked (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CloseSockets_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ConnectSocket_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ConnectSocket_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ConnectSocketWithRetry (Windows::Networking::HostName^hostName, Platform::String^serviceName)
concurrency::task< void > | ConnectSocketWithRetryHandleSslErrorAsync (Windows::Networking::Sockets::StreamSocket^socket, Windows::Networking::HostName^hostName, Platform::String^serviceName)
Platform::String | GetCertificateInformation (Windows::Security::Cryptography::Certificates::Certificate^serverCert, Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate^>^intermediateCertificates)
void | NotifyUserFromAsyncThread (Platform::String^message, NotifyType type)
void | PopulateAdapterList ()
void | ReceiveStringLoop (Windows::Storage::Streams::DataReader^reader, Windows::Networking::Sockets::StreamSocket^socket)
void | SendHello_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
concurrency::task< bool > | ShouldIgnoreCertificateErrorsAsync (Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::ChainValidationResult >^serverCertificateErrors)
void | StartListener_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Private Attributes

Windows::Networking::Connectivity::NetworkAdapter | adapter
Windows::Networking::Sockets::StreamSocketListener | listener
Platform::Collections::Vector
< LocalHostItem^> 		localHostItems
MainPage rootPage

Static Private Attributes

static const int | abortButtonId = 0
static const int | continueButtonId = 1

Detailed Description

Definition at line 31 of file Scenario1.xaml.h.

Constructor & Destructor Documentation

~ListenerContext ( ) [private]

Member Function Documentation

void BindToAny_Checked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void BindToAny_Unchecked | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CloseSockets_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void ConnectSocket_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void ConnectSocket_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void ConnectSocketWithRetry | ( | Windows::Networking::HostName^ | hostName,
 |  | Platform::String^ | serviceName |
 | ) |  |  | [private]
concurrency::task<void> ConnectSocketWithRetryHandleSslErrorAsync | ( | Windows::Networking::Sockets::StreamSocket^ | socket,
 |  | Windows::Networking::HostName^ | hostName,
 |  | Platform::String^ | serviceName |
 | ) |  |  | [private]
Platform::String GetCertificateInformation | ( | Windows::Security::Cryptography::Certificates::Certificate^ | serverCert,
 |  | Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate^>^ | intermediateCertificates |
 | ) |  |  | [private]
ListenerContext | ( | MainPage^ | rootPage,
 |  | Windows::Networking::Sockets::StreamSocketListener^ | listener
 | ) |  |
LocalHostItem ( Windows::Networking::HostName^ localHostName )
void NotifyUserFromAsyncThread | ( | Platform::String^ | message,
 |  | NotifyType | type |
 | ) |  |  | [private]
void OnConnection | ( | Windows::Networking::Sockets::StreamSocketListener^ | listener,
 |  | Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^ | object
 | ) |  |
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
void PopulateAdapterList ( ) [private]
void ReceiveStringLoop | ( | Windows::Storage::Streams::DataReader^ | reader,
 |  | Windows::Networking::Sockets::StreamSocket^ | socket |
 | ) |  |  | [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
Scenario4 ( )
Scenario5 ( )
void SendHello_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
concurrency::task<bool> ShouldIgnoreCertificateErrorsAsync ( Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::ChainValidationResult >^ serverCertificateErrors ) [private]
void StartListener_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]

Member Data Documentation

const int abortButtonId = 0 [static, private]

Definition at line 40 of file Scenario5.xaml.h.

Windows::Networking::Connectivity::NetworkAdapter adapter [private]

Definition at line 40 of file Scenario2.xaml.h.

const int continueButtonId = 1 [static, private]

Definition at line 39 of file Scenario5.xaml.h.

Windows::Networking::Sockets::StreamSocketListener listener [private]

Definition at line 76 of file Scenario1.xaml.h.

Platform::Collections::Vector<LocalHostItem^> localHostItems [private]

Definition at line 58 of file Scenario1.xaml.h.

MainPage rootPage [private]

Definition at line 55 of file Scenario1.xaml.h.

Property Documentation

Windows::Networking::HostName localHost

Definition at line 39 of file Scenario1.xaml.h.

The documentation for this class was generated from the following files:
  • StreamSocket/cpp/Scenario1.xaml.h
  • StreamSocket/cpp/Scenario2.xaml.h
  • StreamSocket/cpp/Scenario3.xaml.h
  • StreamSocket/cpp/Scenario4.xaml.h
  • StreamSocket/cpp/Scenario5.xaml.h
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StringTrimmer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • StringTrimmer
Static Public Member Functions

StringTrimmer Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static Platform::String Trim (Platform::String^s)

Detailed Description

Definition at line 69 of file SampleConfiguration.h.

Member Function Documentation

static Platform::String Trim ( Platform::String^ s ) [inline, static]

Definition at line 72 of file SampleConfiguration.h.

        {
            const WCHAR* first = s->Begin();
            const WCHAR* last = s->End();

            while (first != last && iswspace(*first))
            {
                ++first;
            }

            while (first != last && iswspace(last[-1]))
            {
                --last;
            }

            return ref new Platform::String(first, static_cast<unsigned int>(last - first));
        }

The documentation for this class was generated from the following file:
  • Syndication/cpp/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SubPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SubPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SubPage Class Reference

List of all members.

Public Member Functions

SubPage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | LoadState (object sender, LoadStateEventArgs e)
void | Navigation_BackRequested (object sender, BackRequestedEventArgs e)
void | Page_Tapped (object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
void | SaveState (object sender, SaveStateEventArgs e)

Private Attributes

readonly NavigationHelper | navigationHelper
int | tapCount

Detailed Description

Definition at line 10 of file SubPage.xaml.cs.

Constructor & Destructor Documentation

SubPage ( ) [inline]

Definition at line 15 of file SubPage.xaml.cs.

        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += LoadState;
            this.navigationHelper.SaveState += SaveState;

            SystemNavigationManager.GetForCurrentView().BackRequested += Navigation_BackRequested;
        }

Member Function Documentation

void LoadState | ( | object | sender,
 |  | LoadStateEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file SubPage.xaml.cs.

        {
            tapCount = 0;
            if (e.PageState != null && e.PageState.ContainsKey("tapCount"))
            {
                tapCount = (int)e.PageState["tapCount"];
            }
            TapCountRun.Text = tapCount.ToString();
        }

void Navigation_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

This method facilitates navigation when the back button is pressed.

Parameters:
sender
e

Definition at line 77 of file SubPage.xaml.cs.

        {
            if (!e.Handled & this.Frame.CanGoBack)
            {
                e.Handled = true;
                this.Frame.GoBack();
            }
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 51 of file SubPage.xaml.cs.

        {
            this.navigationHelper.OnNavigatedFrom(e);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

The methods provided in this section are simply used to allow NavigationHelper to respond to the page's navigation methods.

Page specific logic should be placed in event handlers for the NavigationHelper.LoadState and NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session.

Parameters:
e Provides data for navigation methods and event handlers that cannot cancel the navigation request.

Definition at line 41 of file SubPage.xaml.cs.

        {
            this.TitleTextBlock.Text = e.Parameter.ToString();

            this.navigationHelper.OnNavigatedTo(e);

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }

void Page_Tapped | ( | object | sender,
 |  | Windows.UI.Xaml.Input.TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 86 of file SubPage.xaml.cs.

        {
            tapCount++;
            TapCountRun.Text = tapCount.ToString();
        }

void SaveState | ( | object | sender,
 |  | SaveStateEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file SubPage.xaml.cs.

        {
            e.PageState["tapCount"] = tapCount;
        }

Member Data Documentation

readonly NavigationHelper navigationHelper [private]

Definition at line 12 of file SubPage.xaml.cs.

int tapCount [private]

Definition at line 13 of file SubPage.xaml.cs.

The documentation for this class was generated from the following file:
  • BasicSuspension/cs/SubPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SymbologyListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • SymbologyListEntry
Public Member Functions | Public Attributes | Properties

SymbologyListEntry Class Reference

This class is used for data-binding.

List of all members.

Public Member Functions

SymbologyListEntry (uint symbologyId, bool symbologyEnabled=true)

Public Attributes

String | Name = > BarcodeSymbologies.GetName(Id)

Properties

uint | Id [get, set]
bool | IsEnabled [get, set]

Detailed Description

Definition at line 129 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

SymbologyListEntry | ( | uint | symbologyId,
 |  | bool | symbologyEnabled = true |
 | ) |  |  | [inline]

Definition at line 131 of file SampleConfiguration.cs.

        {
            Id = symbologyId;
            IsEnabled = symbologyEnabled;
        }

Member Data Documentation

String Name = > BarcodeSymbologies.GetName(Id)

Definition at line 139 of file SampleConfiguration.cs.

Property Documentation

uint Id [get, set]

Definition at line 137 of file SampleConfiguration.cs.

bool IsEnabled [get, set]

Definition at line 138 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • BarcodeScanner/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Syndication
  • sealed
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "Scenario1_GetFeed.xaml.h"

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

virtual void | OnNavigatedTo (NavigationEventArgs^e) override

Private Member Functions

void | DisplayCurrentItem ()
void | DisplayFeed ()
void | GetFeed_Click (Object^sender, RoutedEventArgs^e)
void | LinkField_Click (Object^sender, RoutedEventArgs^e)
void | NextItem_Click (Object^sender, RoutedEventArgs^e)
void | PreviousItem_Click (Object^sender, RoutedEventArgs^e)

Private Attributes

SyndicationFeed | currentFeed
unsigned int | currentItemIndex
MainPage rootPage

Detailed Description

Definition at line 36 of file Scenario1_GetFeed.xaml.h.

Member Function Documentation

void DisplayCurrentItem ( ) [private]
void DisplayFeed ( ) [private]
void GetFeed_Click | ( | Object^ | sender,
 |  | RoutedEventArgs^ | e |
 | ) |  |  | [private]
void LinkField_Click | ( | Object^ | sender,
 |  | RoutedEventArgs^ | e |
 | ) |  |  | [private]
void NextItem_Click | ( | Object^ | sender,
 |  | RoutedEventArgs^ | e |
 | ) |  |  | [private]
virtual void OnNavigatedTo ( NavigationEventArgs^ e ) [override, protected, virtual]
void PreviousItem_Click | ( | Object^ | sender,
 |  | RoutedEventArgs^ | e |
 | ) |  |  | [private]
Scenario1 ( )

Member Data Documentation

SyndicationFeed currentFeed [private]

Definition at line 45 of file Scenario1_GetFeed.xaml.h.

unsigned int currentItemIndex [private]

Definition at line 46 of file Scenario1_GetFeed.xaml.h.

MainPage rootPage [private]

Definition at line 44 of file Scenario1_GetFeed.xaml.h.

The documentation for this class was generated from the following file:
  • Syndication/cpp/Scenario1_GetFeed.xaml.h
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • TextMessage
Properties

TextMessage Class Reference

List of all members.

Properties

string | Body [get, set]
string | DisplayTime [get, set]
bool | IsReceived [get]
bool | IsSent [get, set]

Detailed Description

Definition at line 24 of file Scenario2_Load.xaml.cs.

Property Documentation

string Body [get, set]

Definition at line 26 of file Scenario2_Load.xaml.cs.

string DisplayTime [get, set]

Definition at line 27 of file Scenario2_Load.xaml.cs.

bool IsReceived [get]

Definition at line 29 of file Scenario2_Load.xaml.cs.

bool IsSent [get, set]

Definition at line 28 of file Scenario2_Load.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBottomUpList/cs/Scenario2_Load.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TimeTriggeredTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • TimeTriggeredTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

TimeTriggeredTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

TimeTriggeredTask ()
TimeTriggeredTask ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | AttachProgressAndCompletedHandlers (IBackgroundTaskRegistration task)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnCompleted (IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | OnProgress (IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | RegisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
void | UnregisterBackgroundTask (object sender, RoutedEventArgs e)
async void | UpdateUI ()
async void | UpdateUI ()

Private Attributes

MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario4_TimeTriggeredTask.xaml.cs.

Constructor & Destructor Documentation

TimeTriggeredTask ( ) [inline]

Definition at line 34 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            this.InitializeComponent();
        }

TimeTriggeredTask ( ) [inline]

Definition at line 34 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void AttachProgressAndCompletedHandlers ( IBackgroundTaskRegistration task ) [inline, private]

Attach progress and completed handers to a background task.

Parameters:
task The task to attach progress and completed handlers to.

Definition at line 89 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
            task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            UpdateUI();
        }

void OnCompleted | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskCompletedEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task completion.

Parameters:
task | The task that is reporting completion.
e | Arguments of the completion report.

Definition at line 115 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.TimeTriggeredTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.TimeTriggeredTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            foreach (var task in BackgroundTaskRegistration.AllTasks)
            {
                if (task.Value.Name == BackgroundTaskSample.TimeTriggeredTaskName)
                {
                    AttachProgressAndCompletedHandlers(task.Value);
                    BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.TimeTriggeredTaskName, true);
                    break;
                }
            }

            UpdateUI();
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.TimeTriggeredTaskProgress = progress;
                UpdateUI();
            });
        }

void OnProgress | ( | IBackgroundTaskRegistration | task,
 |  | BackgroundTaskProgressEventArgs | args |
 | ) |  |  | [inline, private]

Handle background task progress.

Parameters:
task | The task that is reporting progress.
e | Arguments of the progress report.

Definition at line 100 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                var progress = "Progress: " + args.Progress + "%";
                BackgroundTaskSample.TimeTriggeredTaskProgress = progress;
                UpdateUI();
            });
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a TimeTriggeredTask.

Parameters:
sender
e

Definition at line 64 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
                                                                   BackgroundTaskSample.TimeTriggeredTaskName,
                                                                   new TimeTrigger(15, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void RegisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Register a TimeTriggeredTask.

Parameters:
sender
e

Definition at line 64 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            var task = BackgroundTaskSample.RegisterBackgroundTask(null,
                                                                   BackgroundTaskSample.TimeTriggeredTaskName,
                                                                   new TimeTrigger(15, false),
                                                                   null);
            AttachProgressAndCompletedHandlers(task);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a TimeTriggeredTask.

Parameters:
sender
e

Definition at line 79 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.TimeTriggeredTaskName);
            UpdateUI();
        }

void UnregisterBackgroundTask | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Unregister a TimeTriggeredTask.

Parameters:
sender
e

Definition at line 79 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.TimeTriggeredTaskName);
            UpdateUI();
        }

void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.TimeTriggeredTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.TimeTriggeredTaskRegistered;
                Progress.Text = BackgroundTaskSample.TimeTriggeredTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.TimeTriggeredTaskName);
            });
        }

async void UpdateUI ( ) [inline, private]

Update the scenario UI.

Definition at line 123 of file Scenario4_TimeTriggeredTask.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
            () =>
            {
                RegisterButton.IsEnabled = !BackgroundTaskSample.TimeTriggeredTaskRegistered;
                UnregisterButton.IsEnabled = BackgroundTaskSample.TimeTriggeredTaskRegistered;
                Progress.Text = BackgroundTaskSample.TimeTriggeredTaskProgress;
                Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.TimeTriggeredTaskName);
            });
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario4_TimeTriggeredTask.xaml.cs.

The documentation for this class was generated from the following files:
  • BackgroundActivation/cs/Scenario4_TimeTriggeredTask.xaml.cs
  • BackgroundTask/cs/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cs
  • BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.cpp
  • BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TrackingEventCue Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • TrackingEventCue
Static Public Member Functions | Properties

TrackingEventCue Class Reference

The custom data that can be created, scheduled then consumed as part of a TimedMetadataTrack which has been added by the app. More...

List of all members.

Static Public Member Functions

static long | AdjustDurationIfLive (long sourceDurationTicks)
static void | CreateTrackingEventsTrack (MediaSource source, string contentId, string reportingUriFormat)

Properties

TimeSpan | Duration [get, set]
string | Id [get, set]
TimeSpan | StartTime [get, set]
Uri | TrackingEventUri [get, set]

Detailed Description

In these samples, it creates a set of cues at the start, 1/4, 1/2, 3/4 and upon completion of playback. For each of these points, it will fire an MediaCue with the custom TrackingEventUri property to be consumed by the app in the CueEntered event handler of the TimedMetadataTrack.

We also demonstrate the use of the .Duration IMediaCue property, which will fire CueExited for the midpoint Cue at the 55% mark.

Definition at line 19 of file TrackingEventCue.cs.

Member Function Documentation

static long AdjustDurationIfLive ( long sourceDurationTicks ) [inline, static]

Definition at line 78 of file TrackingEventCue.cs.

        {
            // Live sources will have an duration of TimeSpan.MaxValue,
            // so assume they are 2 minutes long for these scenarios.
            if (sourceDurationTicks == TimeSpan.MaxValue.Ticks)
            {
                sourceDurationTicks = TimeSpan.FromMinutes(2).Ticks;
            }
            return sourceDurationTicks;
        }

static void CreateTrackingEventsTrack | ( | MediaSource | source,
 |  | string | contentId,
 |  | string | reportingUriFormat |
 | ) |  |  | [inline, static]

Creates a TimedMetadataTrack on the source.

Parameters:
source | the source on which to create a TimedMetadataTrack
contentId | the content id for this source
reportingUriFormat | the format string used to create reporting Uri for each event

Definition at line 32 of file TrackingEventCue.cs.

        {
            if (source.Duration.HasValue && !string.IsNullOrEmpty(contentId))
            {
                long sourceDurationTicks = source.Duration.Value.Ticks;
                sourceDurationTicks = AdjustDurationIfLive(sourceDurationTicks);

                var trackingEvents = new TimedMetadataTrack("TrackingEvents", "", TimedMetadataKind.Custom);
                trackingEvents.AddCue(new TrackingEventCue()
                {
                    // This method is called once the media has loaded. If it is set to AutoPlay, then
                    // we may miss Position=0.0. Avoid the race by "starting" at the 2-second mark.
                    StartTime = TimeSpan.FromSeconds(2),
                    Id = "2s",
                    TrackingEventUri = new Uri(string.Format(reportingUriFormat, "started", contentId)),
                });
                trackingEvents.AddCue(new TrackingEventCue()
                {
                    StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.25)),
                    Id = "0.25",
                    TrackingEventUri = new Uri(string.Format(reportingUriFormat, "firstQuartile", contentId)),
                });
                trackingEvents.AddCue(new TrackingEventCue()
                {
                    StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.50)),
                    Id = "0.50",
                    TrackingEventUri = new Uri(string.Format(reportingUriFormat, "midpoint", contentId)),
                    // We can cause CueExited to fire at 55% by setting a Duration:
                    Duration = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.05)),
                });
                trackingEvents.AddCue(new TrackingEventCue()
                {
                    StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.75)),
                    Id = "0.75",
                    TrackingEventUri = new Uri(string.Format(reportingUriFormat, "thirdQuartile", contentId)),
                });
                trackingEvents.AddCue(new TrackingEventCue()
                {
                    StartTime = TimeSpan.FromTicks(sourceDurationTicks),
                    Id = "1.00",
                    TrackingEventUri = new Uri(string.Format(reportingUriFormat, "complete", contentId)),
                });
                source.ExternalTimedMetadataTracks.Add(trackingEvents);
            }
        }

Property Documentation

TimeSpan Duration [get, set]

Definition at line 21 of file TrackingEventCue.cs.

string Id [get, set]

Definition at line 22 of file TrackingEventCue.cs.

TimeSpan StartTime [get, set]

Definition at line 23 of file TrackingEventCue.cs.

Uri TrackingEventUri [get, set]

Definition at line 24 of file TrackingEventCue.cs.

The documentation for this class was generated from the following file:
  • AdaptiveStreaming/cs/Shared/TrackingEventCue.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TransportOptions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • TransportOptions
Public Member Functions | Private Member Functions | Private Attributes

TransportOptions Class Reference

List of all members.

Public Member Functions

TransportOptions ()

Private Member Functions

void | OnFocusEngaged (Control sender, FocusEngagedEventArgs e)
void | OnLoaded (object sender, RoutedEventArgs e)
void | RemoveTabStops (DependencyObject root)

Private Attributes

bool | IsGamepadSupported = true

Detailed Description

Definition at line 8 of file TransportOptions.xaml.cs.

Constructor & Destructor Documentation

TransportOptions ( ) [inline]

Definition at line 15 of file TransportOptions.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void OnFocusEngaged | ( | Control | sender,
 |  | FocusEngagedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 21 of file TransportOptions.xaml.cs.

        {
            if (IsGamepadSupported)
            {
                InitialButton.Focus(FocusState.Programmatic);
            }
        }

void OnLoaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 29 of file TransportOptions.xaml.cs.

        {
            IsGamepadSupported = (Tag as string) != "Legacy";

            // In "legacy mode", remove the tab stops from all child controls.
            if (!IsGamepadSupported)
            {
                RemoveTabStops(this);
            }
        }

void RemoveTabStops ( DependencyObject root ) [inline, private]

Definition at line 40 of file TransportOptions.xaml.cs.

        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
            {
                DependencyObject child = VisualTreeHelper.GetChild(root, i);
                Control control = child as Control;
                if (control != null)
                {
                    control.IsTabStop = false;
                }
                RemoveTabStops(child);
            }
        }

Member Data Documentation

bool IsGamepadSupported = true [private]

Definition at line 13 of file TransportOptions.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlGamepadNavigation/cs/TransportOptions.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UnspecifiedReason Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • UnspecifiedReason
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

UnspecifiedReason Class Reference

Page containing the Extended Execution Unspecified Reason scenario functions.

List of all members.

Public Member Functions

UnspecifiedReason ()

Protected Member Functions

override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

async void | BeginExtendedExecution ()
void | ClearExtendedExecution ()
void | EndExtendedExecution ()
void | OnTimer (object state)
async void | SessionRevoked (object sender, ExtendedExecutionRevokedEventArgs args)
void | UpdateUI ()

Private Attributes

Timer | periodicTimer = null
MainPage rootPage = MainPage.Current
ExtendedExecutionSession | session = null

Detailed Description

Definition at line 28 of file Scenario1_UnspecifiedReason.xaml.cs.

Constructor & Destructor Documentation

UnspecifiedReason ( ) [inline]

Definition at line 37 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void BeginExtendedExecution ( ) [inline, private]

Definition at line 81 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            // The previous Extended Execution must be closed before a new one can be requested.
            // This code is redundant here because the sample doesn't allow a new extended
            // execution to begin until the previous one ends, but we leave it here for illustration.
            ClearExtendedExecution();

            var newSession = new ExtendedExecutionSession();
            newSession.Reason = ExtendedExecutionReason.Unspecified;
            newSession.Description = "Raising periodic toasts";
            newSession.Revoked += SessionRevoked;
            ExtendedExecutionResult result = await newSession.RequestExtensionAsync();

            switch (result)
            {
                case ExtendedExecutionResult.Allowed:
                    rootPage.NotifyUser("Extended execution allowed.", NotifyType.StatusMessage);
                    session = newSession;
                    periodicTimer = new Timer(OnTimer, DateTime.Now, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10));
                    break;

                default:
                case ExtendedExecutionResult.Denied:
                    rootPage.NotifyUser("Extended execution denied.", NotifyType.ErrorMessage);
                    newSession.Dispose();
                    break;
            }
            UpdateUI();
        }

void ClearExtendedExecution ( ) [inline, private]

Definition at line 49 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            if (session != null)
            {
                session.Revoked -= SessionRevoked;
                session.Dispose();
                session = null;
            }

            if (periodicTimer != null)
            {
                periodicTimer.Dispose();
                periodicTimer = null;
            }
        }

void EndExtendedExecution ( ) [inline, private]

Definition at line 118 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            ClearExtendedExecution();
            UpdateUI();
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 42 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            // End the Extended Execution Session.
            // Only one extended execution session can be held by an application at one time.
            ClearExtendedExecution();
        }

void OnTimer ( object state ) [inline, private]

Definition at line 111 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            var startTime = (DateTime)state;
            var runningTime = Math.Round((DateTime.Now - startTime).TotalSeconds, 0);
            MainPage.DisplayToast($"Extended execution has been active for {runningTime} seconds");
        }

async void SessionRevoked | ( | object | sender,
 |  | ExtendedExecutionRevokedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 124 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                switch (args.Reason)
                {
                    case ExtendedExecutionRevokedReason.Resumed:
                        rootPage.NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType.StatusMessage);
                        break;

                    case ExtendedExecutionRevokedReason.SystemPolicy:
                        rootPage.NotifyUser("Extended execution revoked due to system policy.", NotifyType.StatusMessage);
                        break;
                }

                EndExtendedExecution();
            });
        }

void UpdateUI ( ) [inline, private]

Definition at line 65 of file Scenario1_UnspecifiedReason.xaml.cs.

        {
            if (session == null)
            {
                Status.Text = "Not requested";
                RequestButton.IsEnabled = true;
                CloseButton.IsEnabled = false;
            }
            else
            {
                Status.Text = "Requested";
                RequestButton.IsEnabled = false;
                CloseButton.IsEnabled = true;
            }
        }

Member Data Documentation

Timer periodicTimer = null [private]

Definition at line 35 of file Scenario1_UnspecifiedReason.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario1_UnspecifiedReason.xaml.cs.

ExtendedExecutionSession session = null [private]

Definition at line 34 of file Scenario1_UnspecifiedReason.xaml.cs.

The documentation for this class was generated from the following files:
  • ExtendedExecution/cs/Scenario1_UnspecifiedReason.xaml.cs
  • ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: User Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • User
Public Member Functions | Properties | Private Attributes

User Class Reference

List of all members.

Public Member Functions

User ()
User (string jsonString)
string | Stringify ()

Properties

ObservableCollection< School > | Education = "" [get]
string | Id [get, set]
string | Name = null [get, set]
string | Phone = "" [get, set]
double | Timezone = new ObservableCollection<School>() [get, set]
bool | Verified = 0.0 [get, set]

Private Attributes

const string | educationKey = "education"
const string | idKey = "id"
const string | nameKey = "name"
const string | phoneKey = "phone"
const string | timezoneKey = "timezone"
const string | verifiedKey = "verified"

Detailed Description

Definition at line 18 of file User.cs.

Constructor & Destructor Documentation

User ( ) [inline]

Definition at line 27 of file User.cs.

        {
        }

User ( string jsonString ) [inline]

Definition at line 31 of file User.cs.

                                       : this()
        {
            JsonObject jsonObject = JsonObject.Parse(jsonString);
            Id = jsonObject.GetNamedString(idKey, "");

            IJsonValue phoneJsonValue = jsonObject.GetNamedValue(phoneKey);
            if (phoneJsonValue.ValueType == JsonValueType.Null)
            {
                Phone = null;
            }
            else
            {
                Phone = phoneJsonValue.GetString();
            }

            Name = jsonObject.GetNamedString(nameKey, "");
            Timezone = jsonObject.GetNamedNumber(timezoneKey, 0);
            Verified = jsonObject.GetNamedBoolean(verifiedKey, false);

            foreach (IJsonValue jsonValue in jsonObject.GetNamedArray(educationKey, new JsonArray()))
            {
                Education.Add(new School(jsonValue.GetObject()));
            }
        }

Member Function Documentation

string Stringify ( ) [inline]

Definition at line 56 of file User.cs.

        {
            JsonObject jsonObject = new JsonObject();
            jsonObject[idKey] = JsonValue.CreateStringValue(Id);

            // Treating a blank string as null
            if (String.IsNullOrEmpty(Phone))
            {
                jsonObject[phoneKey] = JsonValue.CreateNullValue();
            }
            else
            {
                jsonObject[phoneKey] = JsonValue.CreateStringValue(Phone);
            }

            jsonObject[nameKey] = JsonValue.CreateStringValue(Name);

            jsonObject[timezoneKey] = JsonValue.CreateNumberValue(Timezone);
            jsonObject[verifiedKey] = JsonValue.CreateBooleanValue(Verified);

            JsonArray jsonArray = new JsonArray();
            foreach (School school in Education)
            {
                jsonArray.Add(school.ToJsonObject());
            }
            jsonObject[educationKey] = jsonArray;

            return jsonObject.Stringify();
        }

Member Data Documentation

const string educationKey = "education" [private]

Definition at line 23 of file User.cs.

const string idKey = "id" [private]

Definition at line 20 of file User.cs.

const string nameKey = "name" [private]

Definition at line 22 of file User.cs.

const string phoneKey = "phone" [private]

Definition at line 21 of file User.cs.

const string timezoneKey = "timezone" [private]

Definition at line 24 of file User.cs.

const string verifiedKey = "verified" [private]

Definition at line 25 of file User.cs.

Property Documentation

ObservableCollection<School> Education = "" [get]

Definition at line 92 of file User.cs.

string Id [get, set]

Definition at line 86 of file User.cs.

string Name = null [get, set]

Definition at line 90 of file User.cs.

string Phone = "" [get, set]

Definition at line 88 of file User.cs.

double Timezone = new ObservableCollection<School>() [get, set]

Definition at line 94 of file User.cs.

bool Verified = 0.0 [get, set]

Definition at line 95 of file User.cs.

The documentation for this class was generated from the following file:
  • Json/cs/User.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserSelect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • UserSelect
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

UserSelect Class Reference

The user select page, if users successfully log into the app they will be added to a saved set of users. More...

List of all members.

Public Member Functions

UserSelect ()

Static Public Attributes

static List< Account > | accountList

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Button_AddUser_Click (object sender, RoutedEventArgs e)
void | Button_SelectUser_Click (object sender, RoutedEventArgs e)
void | OnLoadedActions (object sender, RoutedEventArgs e)
async void | SetUpAccounts ()

Private Attributes

ListView | accountListView
MainPage rootPage

Detailed Description

That set of users will populate a list of account tiles that can be chosen from for signing in on this page.

If there are no accounts in the history, it will skip this and go directly to the traditional username/password sign in page.

If there exists 1 or more accounts, users can select an account tile which will pass the account object to the sign in form.

Definition at line 35 of file UserSelect.xaml.cs.

Constructor & Destructor Documentation

UserSelect ( ) [inline]

Definition at line 41 of file UserSelect.xaml.cs.

        {
            this.InitializeComponent();
            accountListView = listView_UserTileList;
            accountListView.SelectionChanged += Button_SelectUser_Click;
            this.Loaded += OnLoadedActions;
        }

Member Function Documentation

void Button_AddUser_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Function called when the "+" button is clicked for adding a new account.

Just navigates to the default sign in form with nothing filled out

Parameters:
sender
e

Definition at line 92 of file UserSelect.xaml.cs.

        {
            this.Frame.Navigate(typeof(SignIn));
        }

void Button_SelectUser_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Function called when an account is selected in the list of accounts.

Navigates to the sign in form and passes the chosen account The sign in form will check if Microsoft Passport should be used or not

Parameters:
sender
e

Definition at line 75 of file UserSelect.xaml.cs.

        {
            if (((ListView)sender).SelectedValue != null)
            {
                Account account = (Account)((ListView)sender).SelectedValue;
                rootPage.NotifyUser("Account " + account.Name + " selected!", NotifyType.StatusMessage);
                this.Frame.Navigate(typeof(SignIn), account);
            }
        }

void OnLoadedActions | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Function called when the current frame is loaded.

Calls SetUpAccounts

Parameters:
sender
e

Definition at line 61 of file UserSelect.xaml.cs.

        {
            SetUpAccounts();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 49 of file UserSelect.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void SetUpAccounts ( ) [inline, private]

Uses the AccountsHelper to load the list of accounts from a saved local app file, then checks to see if it was empty or not.

Checks to see if the user list has been created yet.

If it is empty then just go to the sign in form.

If it hasn't then create it and then just go to the sign in form. Otherwise, load the list of users into the ListView.

Definition at line 101 of file UserSelect.xaml.cs.

        {
            accountList = await AccountsHelper.LoadAccountList();
            accountListView.ItemsSource = accountList;

            if (accountList.Count == 0)
            {
                this.Frame.Navigate(typeof(SignIn));
            }
        }

Member Data Documentation

List<Account> accountList [static]

Definition at line 39 of file UserSelect.xaml.cs.

ListView accountListView [private]

Definition at line 38 of file UserSelect.xaml.cs.

MainPage rootPage [private]

Definition at line 37 of file UserSelect.xaml.cs.

The documentation for this class was generated from the following files:
  • KeyCredentialManager/cs/UserSelect.xaml.cs
  • KeyCredentialManager/cpp/UserSelect.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • UserViewModel
Public Member Functions | Properties | Events | Private Attributes

UserViewModel Class Reference

List of all members.

Public Member Functions

UserViewModel (String userId, String displayName)

Properties

String | DisplayName [get, set]
String | UserId [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Attributes

String | displayName

Detailed Description

Definition at line 62 of file SampleConfiguration.cs.

Constructor & Destructor Documentation

UserViewModel | ( | String | userId,
 |  | String | displayName |
 | ) |  |  | [inline]

Definition at line 64 of file SampleConfiguration.cs.

        {
            this.UserId = userId;
            this.displayName = displayName;
        }

Member Data Documentation

String displayName [private]

Definition at line 89 of file SampleConfiguration.cs.

Property Documentation

String DisplayName [get, set]

Definition at line 74 of file SampleConfiguration.cs.

String UserId [get, set]

Definition at line 72 of file SampleConfiguration.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 70 of file SampleConfiguration.cs.

The documentation for this class was generated from the following file:
  • UserInfo/cs/SampleConfiguration.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Util Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • Util
Static Public Member Functions | Private Attributes

Util Class Reference

List of all members.

Static Public Member Functions

static async Task< bool > | TryDeleteCredentialAccountAsync (string userId)

Private Attributes

const int | NTE_NO_KEY = unchecked((int)0x8009000D)
const int | NTE_PERM = unchecked((int)0x80090010)

Detailed Description

Definition at line 69 of file Util.cs.

Member Function Documentation

static async Task<bool> TryDeleteCredentialAccountAsync ( string userId ) [inline, static]

Definition at line 74 of file Util.cs.

        {
            bool deleted = false;

            try
            {
                await KeyCredentialManager.DeleteAsync(userId);
                deleted = true;
            }
            catch (Exception ex)
            {
                switch (ex.HResult)
                {
                    case NTE_NO_KEY:
                        // Key is already deleted. Ignore this error.
                        break;
                    case NTE_PERM:
                        // Access is denied. Ignore this error. We tried our best.
                        break;
                    default:
                        throw;
                }
            }
            return deleted;
        }

Member Data Documentation

const int NTE_NO_KEY = unchecked((int)0x8009000D) [private]

Definition at line 71 of file Util.cs.

const int NTE_PERM = unchecked((int)0x80090010) [private]

Definition at line 72 of file Util.cs.

The documentation for this class was generated from the following file:
  • MicrosoftPassport/cs/Util.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HardwareDRMViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • HardwareDRMViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

HardwareDRMViewModel Class Reference

Inherits SDKTemplate::ViewModels::ViewModelBase.

List of all members.

Public Member Functions

HardwareDRMViewModel (MediaElement mediaElement)

Properties

RelayCommand | CmdPlayMovie [get, set]
RelayCommand | CmdStopMovie [get, set]
RelayCommand | CmdUseHardware [get, set]
RelayCommand | CmdUseSoftware [get, set]
string | MoviePath [get, set]
PlayReadyInfoViewModel | PlayReadyInfo [get, set]

Private Member Functions

void | ConfigureHardwareDRM (MediaElement mediaElement)
void | ConfigureSoftwareDRM (MediaElement mediaElement)
void | Individualize ()
void | ProcessServiceRequest (IMediaProtectionServiceRequest serviceRequest)
void | ServiceRequested (MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)

Private Attributes

string | licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&SecurityLevel=2000"
bool | modeSelected = false
string | moviePath = MainPage.SampleMovieURL
MediaProtectionServiceCompletion | serviceCompletionNotifier = null

Detailed Description

Definition at line 21 of file HardwareDRMViewModel.cs.

Constructor & Destructor Documentation

HardwareDRMViewModel ( MediaElement mediaElement ) [inline]

A view model class for the IndivReactive Scenario.

Definition at line 41 of file HardwareDRMViewModel.cs.

        {
            this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
            mediaElement.ProtectionManager = this.ProtectionManager;
            PlayReadyInfo = new PlayReadyInfoViewModel();
            PlayReadyInfo.RefreshStatics();

            mediaElement.CurrentStateChanged += (s, a) => {
                ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
            };

            mediaElement.MediaFailed += (s, a) => {
                ViewModelBase.Log("Media Failed::" + a.ErrorMessage);
            };

            CmdPlayMovie    = new RelayCommand(() => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); },
                                               () => { return modeSelected && PlayReadyHelpers.IsIndividualized; });
            CmdStopMovie    = new RelayCommand(() => { mediaElement.Stop(); SetPlaybackEnabled(false); });
            CmdUseHardware  = new RelayCommand(() => { ConfigureHardwareDRM(mediaElement); },
                                               () => { return !modeSelected;  });
            CmdUseSoftware  = new RelayCommand(() => { ConfigureSoftwareDRM(mediaElement); },
                                               () => { return !modeSelected; });

        }

Member Function Documentation

void ConfigureHardwareDRM ( MediaElement mediaElement ) [inline, private]

This method will configure the properties used by Media Foundation and PlayReady to specify Hardware DRM.

The existing ProtectionManager assigned to the MediaElement is altered with updated/removed properties. Lastly, proactive individualiation is called.

Definition at line 71 of file HardwareDRMViewModel.cs.

        {
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            localSettings.CreateContainer("PlayReady", Windows.Storage.ApplicationDataCreateDisposition.Always);
            localSettings.Containers["PlayReady"].Values["SoftwareOverride"] = 0;
            localSettings.Containers["PlayReady"].Values["HardwareOverride"] = 1;
            mediaElement.ProtectionManager.Properties.Remove("Windows.Media.Protection.UseSoftwareProtectionLayer");
            mediaElement.ProtectionManager.Properties["Windows.Media.Protection.UseHardwareProtectionLayer"] = true;
            Individualize();
        }

void ConfigureSoftwareDRM ( MediaElement mediaElement ) [inline, private]

This method will configure the properties used by Media Foundation and PlayReady to specify Software DRM.

The existing ProtectionManager assigned to the MediaElement is altered with updated/removed properties. Lastly, proactive individualiation is called.

Definition at line 87 of file HardwareDRMViewModel.cs.

        {
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            localSettings.CreateContainer("PlayReady", Windows.Storage.ApplicationDataCreateDisposition.Always);
            localSettings.Containers["PlayReady"].Values["SoftwareOverride"] = 1;
            localSettings.Containers["PlayReady"].Values["HardwareOverride"] = 0;
            mediaElement.ProtectionManager.Properties.Remove("Windows.Media.Protection.UseHardwareProtectionLayer");
            mediaElement.ProtectionManager.Properties["Windows.Media.Protection.UseSoftwareProtectionLayer"] = true;
            Individualize();
        }

void Individualize ( ) [inline, private]

Definition at line 100 of file HardwareDRMViewModel.cs.

        {
            PlayReadyHelpers.ProactiveIndividualization(() => {
                modeSelected = true;
                CmdPlayMovie.RaiseCanExecuteChanged();
                CmdUseHardware.RaiseCanExecuteChanged();
                CmdUseSoftware.RaiseCanExecuteChanged();
            });
        }

void ProcessServiceRequest ( IMediaProtectionServiceRequest serviceRequest ) [inline, private]

The helper class will determine the exact type of ServiceRequest in order to customize and send the service request.

ServiceRequests (except for Individualization and Revocation) also support the GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge and manually send the challenge.

Definition at line 131 of file HardwareDRMViewModel.cs.

        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The initial service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...).
                licenseRequest.Uri = new Uri(licenseUrl);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest, serviceCompletionNotifier);
            }

        }

void ServiceRequested | ( | MediaProtectionManager | sender,
 |  | ServiceRequestedEventArgs | srEvent |
 | ) |  |  | [inline, private]

Definition at line 117 of file HardwareDRMViewModel.cs.

        {
            serviceCompletionNotifier = srEvent.Completion;
            IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
            ViewModelBase.Log(serviceRequest.GetType().Name);
            ProcessServiceRequest(serviceRequest);
        }

Member Data Documentation

string licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&SecurityLevel=2000" [private]

Definition at line 24 of file HardwareDRMViewModel.cs.

bool modeSelected = false [private]

Definition at line 37 of file HardwareDRMViewModel.cs.

string moviePath = MainPage.SampleMovieURL [private]

Definition at line 23 of file HardwareDRMViewModel.cs.

MediaProtectionServiceCompletion serviceCompletionNotifier = null [private]

The ProtectionManager defers the service call to the ServiceReqested handler.

This handler will enable the application to customize the communication (custom data, http headers, manual request) The ServiceCompletion instance will notify the ProtectionManager in the case of queued requests.

Definition at line 116 of file HardwareDRMViewModel.cs.

Property Documentation

RelayCommand CmdPlayMovie [get, set]

Definition at line 29 of file HardwareDRMViewModel.cs.

RelayCommand CmdStopMovie [get, set]

Definition at line 30 of file HardwareDRMViewModel.cs.

RelayCommand CmdUseHardware [get, set]

Definition at line 26 of file HardwareDRMViewModel.cs.

RelayCommand CmdUseSoftware [get, set]

Definition at line 27 of file HardwareDRMViewModel.cs.

string MoviePath [get, set]

Definition at line 152 of file HardwareDRMViewModel.cs.

PlayReadyInfoViewModel PlayReadyInfo [get, set]

Definition at line 32 of file HardwareDRMViewModel.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/HardwareDRMViewModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReadyInfoViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • PlayReadyInfoViewModel
Public Member Functions | Properties | Private Attributes

PlayReadyInfoViewModel Class Reference

Inherits SDKTemplate::ViewModels::ViewModelBase.

List of all members.

Public Member Functions

async void | RefreshStatics ()

Properties

bool | HasHardwareDRM [get, set]
bool | HasHEVCSupport [get, set]
uint | PlayReadySecurityVersion [get, set]
uint | SecurityLevel [get, set]

Private Attributes

bool | hasHardwareDRM
bool | hasHEVCSupport
uint playReadySecurityVersion
uint securityLevel

Detailed Description

Definition at line 19 of file PlayReadyInfoViewModel.cs.

Member Function Documentation

async void RefreshStatics ( ) [inline]

Definition at line 22 of file PlayReadyInfoViewModel.cs.

        {
            var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    SecurityLevel = PlayReadyStatics.PlayReadyCertificateSecurityLevel;
                    PlayReadySecurityVersion = PlayReadyStatics.PlayReadySecurityVersion;
                    HasHardwareDRM = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM);
                    HasHEVCSupport = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HEVC);
                }
                catch
                {
                    ViewModelBase.Log("PlayReadyStatics not yet available");
                }
            });

        }

Member Data Documentation

bool hasHardwareDRM [private]

Definition at line 93 of file PlayReadyInfoViewModel.cs.

bool hasHEVCSupport [private]

Definition at line 76 of file PlayReadyInfoViewModel.cs.

uint playReadySecurityVersion [private]

Definition at line 43 of file PlayReadyInfoViewModel.cs.

uint securityLevel [private]

Definition at line 59 of file PlayReadyInfoViewModel.cs.

Property Documentation

bool HasHardwareDRM [get, set]

Definition at line 95 of file PlayReadyInfoViewModel.cs.

bool HasHEVCSupport [get, set]

Definition at line 78 of file PlayReadyInfoViewModel.cs.

uint PlayReadySecurityVersion [get, set]

Definition at line 46 of file PlayReadyInfoViewModel.cs.

uint SecurityLevel [get, set]

Definition at line 61 of file PlayReadyInfoViewModel.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/PlayReadyInfoViewModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProactiveViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • ProactiveViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

ProactiveViewModel Class Reference

Inherits SDKTemplate::ViewModels::ViewModelBase.

List of all members.

Public Member Functions

ProactiveViewModel (MediaElement mediaElement)

Properties

RelayCommand | CmdGetLicense [get, set]
RelayCommand | CmdPlayMovie [get, set]
RelayCommand | CmdStopMovie [get, set]
string | KeyId [get, set]
string | MoviePath [get, set]
PlayReadyInfoViewModel | PlayReadyInfo [get, set]

Private Member Functions

void | GetLicense (Guid kid)
void | IndividualizeIfNeeded ()
bool | IsLicenseAvailable (Guid kid)
void | ProcessServiceRequest (IMediaProtectionServiceRequest serviceRequest)
void | ServiceRequested (MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)

Private Attributes

string | keyId = "{6F651AE1-DBE4-4434-BCB4-690D1564C41C}"
string | licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&SecurityLevel=2000&MaxResDecode=1920x1080"
string | moviePath = MainPage.SampleMovieURL
MediaProtectionServiceCompletion | serviceCompletionNotifier = null

Detailed Description

Definition at line 20 of file ProactiveViewModel.cs.

Constructor & Destructor Documentation

ProactiveViewModel ( MediaElement mediaElement ) [inline]

A view model class for the IndivReactive Scenario.

The ProtectionManager provides communication between the player and PlayReady DRM. The helper class will configure the protection manager for PlayReady and assign an event handler for Service requests.

The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as SecurityLevel and hardware support within the UI.

Proactive license acqusition will ensure a license is available prior to playback

Play is enabled once a license is available

Proactive individualization will ensure PlayReady have been configured to begin making license requests

Definition at line 38 of file ProactiveViewModel.cs.

        {
            /// The ProtectionManager provides communication between the player and PlayReady DRM.
            /// The helper class will configure the protection manager for PlayReady and assign an
            /// event handler for Service requests.
            this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
            mediaElement.ProtectionManager = this.ProtectionManager;
            /// The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as
            /// SecurityLevel and hardware support within the UI.
            PlayReadyInfo = new PlayReadyInfoViewModel();
            PlayReadyInfo.RefreshStatics();

            mediaElement.CurrentStateChanged += (s, a) => {
                ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
            };

            mediaElement.MediaFailed += (s, a) => {
                ViewModelBase.Log("Media Failed::" + a.ErrorMessage);
            };

            /// Proactive license acqusition will ensure a license is available
            /// prior to playback
            CmdGetLicense = new RelayCommand(() => { GetLicense(new Guid(this.KeyId)); }, () => { return PlayReadyHelpers.IsIndividualized; });

            /// Play is enabled once a license is available
            CmdPlayMovie = new RelayCommand(() => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); },
                                            () => IsLicenseAvailable(new Guid(KeyId)));
            CmdStopMovie = new RelayCommand(() => { mediaElement.Stop(); SetPlaybackEnabled(false); },
                                            () => IsLicenseAvailable(new Guid(KeyId)));

            /// Proactive individualization will ensure PlayReady have been configured
            /// to begin making license requests
            IndividualizeIfNeeded();
        }

Member Function Documentation

void GetLicense ( Guid kid ) [inline, private]

A content header is required to make a proactive license request.

The header needs at minimum a KeyId and a License URL. Additionally you set a custom data property which will be passed in the signed section of the license request for use by the service.

Definition at line 114 of file ProactiveViewModel.cs.

        {
            var laURL = new Uri(licenseUrl);
            var customData = "token:12345";
            var contentHeader =  new PlayReadyContentHeader(kid, "", PlayReadyEncryptionAlgorithm.Aes128Ctr, laURL, laURL, customData, Guid.Empty);
            PlayReadyHelpers.ProactiveLicenseAcquisition(contentHeader, () => {
                CmdPlayMovie.RaiseCanExecuteChanged();
                CmdStopMovie.RaiseCanExecuteChanged();
            });
        }

void IndividualizeIfNeeded ( ) [inline, private]

A check is made to see of the device has been initialize and a indiv service request is sent if not.

The callback will notify the app license calls can now be made.

Definition at line 76 of file ProactiveViewModel.cs.

        {
            if (!PlayReadyHelpers.IsIndividualized)
            {
                PlayReadyHelpers.ProactiveIndividualization(() => {
                    CmdGetLicense.RaiseCanExecuteChanged();
                    PlayReadyInfo.RefreshStatics();
                });
            }
        }

bool IsLicenseAvailable ( Guid kid ) [inline, private]

Tests to see if a license is available for playback.

Definition at line 88 of file ProactiveViewModel.cs.

        {
            // return false is app is not initialized
            // creating a PlayReadyContentHeader in an un-initialized app
            // will cause an exception
            if (!PlayReadyHelpers.IsIndividualized)
            {
                return false;
            }
            var contentHeader = new PlayReadyContentHeader(kid, "", PlayReadyEncryptionAlgorithm.Aes128Ctr, new Uri(licenseUrl), new Uri(licenseUrl), "", Guid.Empty);
            var licenses = new PlayReadyLicenseIterable(contentHeader, false);
            foreach (var license in licenses)
            {
                if (license.UsableForPlay)
                {
                    return true;
                }
            }

            return false;
        }

void ProcessServiceRequest ( IMediaProtectionServiceRequest serviceRequest ) [inline, private]

Definition at line 138 of file ProactiveViewModel.cs.

        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
               PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
               PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                PlayReadyHelpers.ReactiveLicenseAcquisition(serviceRequest as PlayReadyLicenseAcquisitionServiceRequest,  serviceCompletionNotifier);
            }
        }

void ServiceRequested | ( | MediaProtectionManager | sender,
 |  | ServiceRequestedEventArgs | srEvent |
 | ) |  |  | [inline, private]

Definition at line 130 of file ProactiveViewModel.cs.

        {
            serviceCompletionNotifier = srEvent.Completion;
            IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
            ViewModelBase.Log(serviceRequest.GetType().Name);
            ProcessServiceRequest(serviceRequest);
        }

Member Data Documentation

string keyId = "{6F651AE1-DBE4-4434-BCB4-690D1564C41C}" [private]

Definition at line 24 of file ProactiveViewModel.cs.

string licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&SecurityLevel=2000&MaxResDecode=1920x1080" [private]

Definition at line 28 of file ProactiveViewModel.cs.

string moviePath = MainPage.SampleMovieURL [private]

Definition at line 26 of file ProactiveViewModel.cs.

MediaProtectionServiceCompletion serviceCompletionNotifier = null [private]

Definition at line 129 of file ProactiveViewModel.cs.

Property Documentation

RelayCommand CmdGetLicense [get, set]

Definition at line 30 of file ProactiveViewModel.cs.

RelayCommand CmdPlayMovie [get, set]

Definition at line 31 of file ProactiveViewModel.cs.

RelayCommand CmdStopMovie [get, set]

Definition at line 32 of file ProactiveViewModel.cs.

string KeyId [get, set]

Definition at line 153 of file ProactiveViewModel.cs.

string MoviePath [get, set]

Definition at line 169 of file ProactiveViewModel.cs.

PlayReadyInfoViewModel PlayReadyInfo [get, set]

Definition at line 34 of file ProactiveViewModel.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/ProactiveViewModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ReactiveViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • ReactiveViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

ReactiveViewModel Class Reference

Inherits SDKTemplate::ViewModels::ViewModelBase.

List of all members.

Public Member Functions

ReactiveViewModel (MediaElement mediaElement)
void | MinConfig (MediaElement mediaElement)

Properties

RelayCommand | CmdPlayMovie [get, set]
RelayCommand | CmdStopMovie [get, set]
string | MoviePath [get, set]
PlayReadyInfoViewModel | PlayReadyInfo [get, set]

Private Member Functions

void | ProcessServiceRequest (IMediaProtectionServiceRequest serviceRequest)
void | ServiceRequested (MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)

Private Attributes

string | licenseURL = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?UseSimpleNonPersistentLicense=1"
string | moviePath = MainPage.SampleMovieURL
MediaProtectionServiceCompletion | serviceCompletionNotifier = null

Detailed Description

Definition at line 21 of file ReactiveViewModel.cs.

Constructor & Destructor Documentation

ReactiveViewModel ( MediaElement mediaElement ) [inline]

A view model class for the ReactiveRequest Scenario.

The ViewModel takes a UI MediaElement in the contructor to wire up commands and events to simplify the sample. Decoupling the MediaElement from the ViewModel would require addtional MVVM infrastucture.

The ProtectionManager provides communication between the player and PlayReady DRM. The helper class will configure the protection manager for PlayReady and assign an event handler for Service requests.

The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as SecurityLevel and hardware support in the UI.

Reactive license acqusition will happen automatically when setting the source of a MediaElement to protected content.

The licenseUrl in the sample is set to return a non-peristent license. When there is a hard Stop() on the playback, a new license will be requested on Play().

Definition at line 38 of file ReactiveViewModel.cs.

        {

            /// The ProtectionManager provides communication between the player and PlayReady DRM.
            /// The helper class will configure the protection manager for PlayReady and assign an
            /// event handler for Service requests.
            this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
            mediaElement.ProtectionManager = this.ProtectionManager;
            /// The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as
            /// SecurityLevel and hardware support in the UI.
            PlayReadyInfo = new PlayReadyInfoViewModel();
            PlayReadyInfo.RefreshStatics();

            /// Reactive license acqusition will happen automatically when setting the source of
            /// a MediaElement to protected content.
            CmdPlayMovie = new RelayCommand( () => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); });
            /// The licenseUrl in the sample is set to return a non-peristent license. When there is a
            /// hard Stop() on the playback, a new license will be requested on Play().
            CmdStopMovie = new RelayCommand(() => { mediaElement.Stop(); SetPlaybackEnabled(false); });

            mediaElement.CurrentStateChanged += (s, a) => {
                ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
            };

            mediaElement.MediaFailed += (s, a) => {
                ViewModelBase.Log("Err::" + a.ErrorMessage);
            };
        }

Member Function Documentation

void MinConfig ( MediaElement mediaElement ) [inline]

Definition at line 136 of file ReactiveViewModel.cs.

        {
            var manager = new MediaProtectionManager();
            var props = new Windows.Foundation.Collections.PropertySet();
            props.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput");
            manager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", props);
            manager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
            manager.Properties.Add("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");

            MediaProtectionServiceCompletion completionNotifer = null;
            manager.ServiceRequested += async (sender, srEvent) =>
            {
                completionNotifer = srEvent.Completion;
                var serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;

                ProcessServiceRequest(serviceRequest);
                if (serviceRequest is PlayReadyIndividualizationServiceRequest)
                {
                    var indivRequest = serviceRequest as PlayReadyIndividualizationServiceRequest;
                    await indivRequest.BeginServiceRequest();
                    serviceCompletionNotifier.Complete(true);
                }
                else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
                {
                    var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                    //licenseRequest.
                    await licenseRequest.BeginServiceRequest();
                    serviceCompletionNotifier.Complete(true);
                    serviceCompletionNotifier = null;
                }

            };
            mediaElement.ProtectionManager = manager;
        }

void ProcessServiceRequest ( IMediaProtectionServiceRequest serviceRequest ) [inline, private]

The helper class will determine the exact type of ServiceRequest in order to customize and send the service request.

ServiceRequests (except for Individualization and Revocation) also support the GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge and manually send the challenge.

Definition at line 88 of file ReactiveViewModel.cs.

        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
               PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
               PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The inital service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...).
                licenseRequest.Uri = new Uri(licenseURL);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest,  serviceCompletionNotifier);
                SetPlaybackEnabled(true);
            }

            // Here are the additional service calls available to support other scenarios
            //PlayReadySecureStopServiceRequest
            //PlayReadyDomainJoinServiceRequest
            //PlayReadyDomainLeaveServiceRequest
            //PlayReadyMeteringReportServiceRequest

            //PlayReadyRevocationServiceRequest

        }

void ServiceRequested | ( | MediaProtectionManager | sender,
 |  | ServiceRequestedEventArgs | srEvent |
 | ) |  |  | [inline, private]

Definition at line 74 of file ReactiveViewModel.cs.

        {
            serviceCompletionNotifier = srEvent.Completion;
            IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
            ViewModelBase.Log(serviceRequest.GetType().Name);
            ProcessServiceRequest(serviceRequest);
        }

Member Data Documentation

string licenseURL = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?UseSimpleNonPersistentLicense=1" [private]

Definition at line 25 of file ReactiveViewModel.cs.

string moviePath = MainPage.SampleMovieURL [private]

Definition at line 24 of file ReactiveViewModel.cs.

MediaProtectionServiceCompletion serviceCompletionNotifier = null [private]

The ProtectionManager defers the service call to the ServiceReqested handler.

This handler will enable the application to customize the communication (custom data, http headers, manual request) The ServiceCompletion instance will notify the ProtectionManager in the case of queued requests.

Definition at line 73 of file ReactiveViewModel.cs.

Property Documentation

RelayCommand CmdPlayMovie [get, set]

Definition at line 27 of file ReactiveViewModel.cs.

RelayCommand CmdStopMovie [get, set]

Definition at line 28 of file ReactiveViewModel.cs.

string MoviePath [get, set]

Definition at line 119 of file ReactiveViewModel.cs.

PlayReadyInfoViewModel PlayReadyInfo [get, set]

Definition at line 31 of file ReactiveViewModel.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/ReactiveViewModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecureStopViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • SecureStopViewModel
Public Member Functions | Properties | Private Member Functions | Private Attributes

SecureStopViewModel Class Reference

Inherits SDKTemplate::ViewModels::ViewModelBase.

List of all members.

Public Member Functions

SecureStopViewModel (MediaElement mediaElement)

Properties

PlayReadyContentHeader | activePlayReadyHeader [get, set]
RelayCommand | CmdGetPublisherCert [get, set]
RelayCommand | CmdPlayMovie [get, set]
RelayCommand | CmdRenewLicense [get, set]
RelayCommand | CmdStopMovie [get, set]
PlayReadyLicenseSession | licenseSession [get, set]
string | MoviePath [get, set]
PlayReadyInfoViewModel | PlayReadyInfo [get, set]

Private Member Functions

async void | GetPublisherCert (string publisherID, Action< byte[]> callback)
void | ProcessServiceRequest (IMediaProtectionServiceRequest serviceRequest)
void | RenewActiveLicense ()
async void | SendSecureStopRecords ()
void | ServiceRequested (MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)

Private Attributes

string | licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?SecureStop=1&UseSimpleNonPersistentLicense=1&RealTimeExpiration=1&FirstPlayExpiration=300"
string | moviePath = SDKTemplate.MainPage.SampleMovieURL
byte[] | publisherCert
string | publisherID = "xw6TjIuUUmvdCcl00t4RBA=="
string | secureStopServiceUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx"
MediaProtectionServiceCompletion | serviceCompletionNotifier = null

Detailed Description

Definition at line 25 of file SecureStopViewModel.cs.

Constructor & Destructor Documentation

SecureStopViewModel ( MediaElement mediaElement ) [inline]

A view model class for the IndivReactive Scenario.

Definition at line 52 of file SecureStopViewModel.cs.

        {
            this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
            mediaElement.ProtectionManager = this.ProtectionManager;

            licenseSession = PlayReadyHelpers.createLicenseSession();
            licenseSession.ConfigureMediaProtectionManager(mediaElement.ProtectionManager);

            PlayReadyInfo = new PlayReadyInfoViewModel();
            PlayReadyInfo.RefreshStatics();

            CmdPlayMovie = new RelayCommand(
                                    () => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); },
                                    () => publisherCert != null);

            CmdStopMovie = new RelayCommand(() => { mediaElement.Stop();},
                                            () => publisherCert != null);

            CmdGetPublisherCert = new RelayCommand(() =>
                                            {
                                                GetPublisherCert(publisherID, (cert) =>
                                                {
                                                    CmdPlayMovie.RaiseCanExecuteChanged();
                                                    CmdStopMovie.RaiseCanExecuteChanged();
                                                    CmdRenewLicense.RaiseCanExecuteChanged();
                                                });
                                            });

            CmdRenewLicense = new RelayCommand(() => RenewActiveLicense(),
                                               () => publisherCert != null);

            mediaElement.CurrentStateChanged += (s, a) =>
            {
                ViewModelBase.Log("Media State::" + mediaElement.CurrentState);

                switch (mediaElement.CurrentState)
                {
                    case MediaElementState.Closed:
                        SendSecureStopRecords();
                        activePlayReadyHeader = null;
                        SetPlaybackEnabled(false);
                        // renewing the licenseSession for subsequent Plays since the
                        // session is stopped
                        licenseSession = PlayReadyHelpers.createLicenseSession();
                        licenseSession.ConfigureMediaProtectionManager(mediaElement.ProtectionManager);
                        break;
                    default:
                        break;
                }

            };

            mediaElement.MediaFailed += (s, a) =>
            {
                ViewModelBase.Log("Err::" + a.ErrorMessage);
            };

            var localSettings = ApplicationData.Current.LocalSettings;
            ApplicationDataContainer container;
            localSettings.Containers.TryGetValue("PublisherCerts", out container);
            if (container != null && container.Values.ContainsKey(publisherID))
            {
                publisherCert = (byte[])container.Values[publisherID];
            }

            try
            {
                var securityVersion = PlayReadyStatics.PlayReadySecurityVersion;
                SendSecureStopRecords();
            }
            catch {
                PlayReadyHelpers.ProactiveIndividualization(() =>
                {
                    PlayReadyInfo.RefreshStatics();
                });
            }
        }

Member Function Documentation

async void GetPublisherCert | ( | string | publisherID,
 |  | Action< byte[]> | callback |
 | ) |  |  | [inline, private]

Definition at line 203 of file SecureStopViewModel.cs.

        {
            var localSettings = ApplicationData.Current.LocalSettings;
            if (!localSettings.Containers.ContainsKey("PublisherCerts"))
            {
                localSettings.CreateContainer("PublisherCerts", Windows.Storage.ApplicationDataCreateDisposition.Always);
            }

            if (!localSettings.Containers["PublisherCerts"].Values.ContainsKey(publisherID))
            {
                var xDoc = XDocument.Load("Data/MeteringChallenge.xml");
                XNamespace ns = "http://schemas.microsoft.com/DRM/2007/03/protocols";
                xDoc.Descendants(ns + "MID").FirstOrDefault().Value = publisherID;

                var content = new StringContent(xDoc.ToString(), System.Text.Encoding.UTF8, "text/xml");

                var client = new HttpClient();
                client.DefaultRequestHeaders.Add("SOAPAction", "http://schemas.microsoft.com/DRM/2007/03/protocols/GetMeteringCertificate");
                var response = await client.PostAsync(secureStopServiceUrl, content);

                string soapXml = await response.Content.ReadAsStringAsync();
                var xMeteringDoc = XDocument.Parse(soapXml);

                var base64Cert = xMeteringDoc.Descendants(ns + "MeterCert").FirstOrDefault().Value;
                var cert = Convert.FromBase64String(base64Cert);
                localSettings.Containers["PublisherCerts"].Values[publisherID] = cert;
            }

            this.publisherCert = (byte [])localSettings.Containers["PublisherCerts"].Values[publisherID];
            callback(this.publisherCert);
        }

void ProcessServiceRequest ( IMediaProtectionServiceRequest serviceRequest ) [inline, private]

...

Definition at line 172 of file SecureStopViewModel.cs.

        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseServiceRequestNotUsed = (serviceRequest as PlayReadyLicenseAcquisitionServiceRequest);
                activePlayReadyHeader = licenseServiceRequestNotUsed.ContentHeader;

                var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
                licenseServiceRequest.ContentHeader = activePlayReadyHeader;
                licenseServiceRequest.Uri = new Uri(licenseUrl);
                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, serviceCompletionNotifier);
            }
        }

void RenewActiveLicense ( ) [inline, private]

Definition at line 192 of file SecureStopViewModel.cs.

        {
            if (activePlayReadyHeader != null)
            {
                var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
                licenseServiceRequest.ContentHeader = activePlayReadyHeader;
                licenseServiceRequest.Uri = new Uri(licenseUrl);
                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, null);
            }
        }

async void SendSecureStopRecords ( ) [inline, private]

Definition at line 130 of file SecureStopViewModel.cs.

        {
            if (publisherCert == null) { return; }

            //// The following code will send all secure stop sessions at once
            var secureStopRequest = new PlayReadySecureStopServiceRequest(publisherCert);
            // setting the uri is optional. the uri defaults to whats in the cert
            try
            {
                secureStopRequest.Uri = new Uri(secureStopServiceUrl);
                await secureStopRequest.BeginServiceRequest();
            }
            catch (Exception e)
            {

                ViewModelBase.Log(e.Message);
            }

            // The following code can be used to iterate the secure stop sessions
            // which can be then be processed individually
            //PlayReadySecureStopIterable secureStopIterable = new PlayReadySecureStopIterable(publisherCert);
            //foreach (var secureStopReq in secureStopIterable)
            //{
            //    secureStopReq.Uri = new Uri(secureStopServiceUrl);
            //    await secureStopReq.BeginServiceRequest();
            //}
        }

void ServiceRequested | ( | MediaProtectionManager | sender,
 |  | ServiceRequestedEventArgs | srEvent |
 | ) |  |  | [inline, private]

Definition at line 161 of file SecureStopViewModel.cs.

        {
            serviceCompletionNotifier = srEvent.Completion;
            IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
            ViewModelBase.Log(serviceRequest.GetType().Name);
            ProcessServiceRequest(serviceRequest);
        }

Member Data Documentation

string licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?SecureStop=1&UseSimpleNonPersistentLicense=1&RealTimeExpiration=1&FirstPlayExpiration=300" [private]

Definition at line 28 of file SecureStopViewModel.cs.

string moviePath = SDKTemplate.MainPage.SampleMovieURL [private]

Definition at line 27 of file SecureStopViewModel.cs.

byte [] publisherCert [private]

Definition at line 34 of file SecureStopViewModel.cs.

string publisherID = "xw6TjIuUUmvdCcl00t4RBA==" [private]

Definition at line 33 of file SecureStopViewModel.cs.

string secureStopServiceUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx" [private]

Definition at line 30 of file SecureStopViewModel.cs.

MediaProtectionServiceCompletion serviceCompletionNotifier = null [private]

Definition at line 160 of file SecureStopViewModel.cs.

Property Documentation

PlayReadyContentHeader activePlayReadyHeader [get, set]

Definition at line 47 of file SecureStopViewModel.cs.

RelayCommand CmdGetPublisherCert [get, set]

Definition at line 38 of file SecureStopViewModel.cs.

RelayCommand CmdPlayMovie [get, set]

Definition at line 36 of file SecureStopViewModel.cs.

RelayCommand CmdRenewLicense [get, set]

Definition at line 39 of file SecureStopViewModel.cs.

RelayCommand CmdStopMovie [get, set]

Definition at line 37 of file SecureStopViewModel.cs.

PlayReadyLicenseSession licenseSession [get, set]

Definition at line 44 of file SecureStopViewModel.cs.

string MoviePath [get, set]

Definition at line 236 of file SecureStopViewModel.cs.

PlayReadyInfoViewModel PlayReadyInfo [get, set]

Definition at line 41 of file SecureStopViewModel.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/SecureStopViewModel.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewModelBase Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • ViewModels
  • ViewModelBase
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | Private Attributes | Static Private Attributes

ViewModelBase Class Reference

Inherited by HardwareDRMViewModel, PlayReadyInfoViewModel, ProactiveViewModel, ReactiveViewModel, and SecureStopViewModel.

List of all members.

Public Member Functions

async void | SetPlaybackEnabled (bool enabled)

Static Public Member Functions

static async void | Log (string message)

Protected Member Functions

void | RaisePropertyChanged ([CallerMemberName] string propertyName="")

Properties

ObservableCollection< string > | OutputLog [get, set]
bool | PlaybackEnabled [get, set]
MediaProtectionManager | ProtectionManager [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Attributes

bool | playbackEnabled = false
MediaProtectionManager | protectionManager

Static Private Attributes

static ObservableCollection
< string > 		outputLog = new ObservableCollection<string>()

Detailed Description

Definition at line 23 of file ViewModelBase.cs.

Member Function Documentation

static async void Log ( string message ) [inline, static]

Definition at line 40 of file ViewModelBase.cs.

        {
            var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                outputLog.Insert(0, message);
            });
        }

void RaisePropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, protected]

Fires an event when called.

Used to update the UI in the MVVM world. [CallerMemberName] Ensures only the peoperty that calls it gets the event and not every property

Definition at line 32 of file ViewModelBase.cs.

        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

async void SetPlaybackEnabled ( bool enabled ) [inline]

Definition at line 49 of file ViewModelBase.cs.

        {
            var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PlaybackEnabled = enabled;
            });
        }

Member Data Documentation

ObservableCollection<string> outputLog = new ObservableCollection<string>() [static, private]

Provides media and drm bindable logging for ViewModels.

Definition at line 61 of file ViewModelBase.cs.

bool playbackEnabled = false [private]

Definition at line 92 of file ViewModelBase.cs.

MediaProtectionManager protectionManager [private]

A ProtectionManager is assigned to a MediaElement(or MediaPlayer) instance to provide two way communication between the player and PlayReady DRM.

Definition at line 72 of file ViewModelBase.cs.

Property Documentation

ObservableCollection<string> OutputLog [get, set]

Definition at line 63 of file ViewModelBase.cs.

bool PlaybackEnabled [get, set]

Definition at line 94 of file ViewModelBase.cs.

MediaProtectionManager ProtectionManager [get, set]

Definition at line 74 of file ViewModelBase.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 26 of file ViewModelBase.cs.

The documentation for this class was generated from the following file:
  • PlayReady/cs/ViewModels/ViewModelBase.cs
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvertisementWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • AdvertisementWrapper
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

AdvertisementWrapper Class Reference

Wraps WiFiDirectServiceAdvertiser and handles callbacks and related state. More...

List of all members.

Public Member Functions

AdvertisementWrapper (WiFiDirectServiceAdvertiser advertiser, WiFiDirectServiceManager manager, string pin="")
async void | AcceptSessionRequest (string id, string pin="")
void | DeclineSessionRequest (string id)
void | Dispose ()

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

WiFiDirectServiceAdvertiser | Advertiser [get]
int | InternalId [get]
string | Name [get]
string | Pin [get]
IList
< WiFiDirectServiceSessionRequest > 		SessionRequestList [get]
string | Status [get]

Private Member Functions

~AdvertisementWrapper ()
void | OnAdvertisementStatusChanged (WiFiDirectServiceAdvertiser sender, object args)
void | OnAutoAcceptSessionConnected (WiFiDirectServiceAdvertiser sender, WiFiDirectServiceAutoAcceptSessionConnectedEventArgs args)
void | OnSessionRequested (WiFiDirectServiceAdvertiser sender, WiFiDirectServiceSessionRequestedEventArgs args)
void | ThrowIfDisposed ()

Private Attributes

WiFiDirectServiceAdvertiser | advertiser = null
bool | disposed = false
WiFiDirectServiceManager | manager = null
string | pin = ""
IList
< WiFiDirectServiceSessionRequest > 		requestList = new List<WiFiDirectServiceSessionRequest>()
Object | thisLock = new Object()
int | uniqueInternalId

Static Private Attributes

static int | nextId = 1

Detailed Description

Definition at line 29 of file WiFiDirectServiceWrappers.cs.

Constructor & Destructor Documentation

AdvertisementWrapper | ( | WiFiDirectServiceAdvertiser | advertiser,
 |  | WiFiDirectServiceManager | manager,
 |  | string | pin = "" |
 | ) |  |  | [inline]

Definition at line 48 of file WiFiDirectServiceWrappers.cs.

            {
                this.advertiser = advertiser;
                this.manager = manager;
                // Store PIN for "display" config method
                this.pin = pin;

                uniqueInternalId = nextId++;

                // This should fire when the service is created and advertisement has started
                // It will also fire when the advertisement has stopped for any reason
                this.advertiser.AdvertisementStatusChanged += OnAdvertisementStatusChanged;
                // This will fire when an auto-accept session is connected. Advertiser should keep track of the new service session
                this.advertiser.AutoAcceptSessionConnected += OnAutoAcceptSessionConnected;
                // This will fire when a session is requested and it must be explicitly accepted or rejected.
                // The advertiser may need to display a PIN or take user input for a PIN
                this.advertiser.SessionRequested += OnSessionRequested;
            }

~AdvertisementWrapper ( ) [inline, private]

Definition at line 299 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(false);
            }

Member Function Documentation

async void AcceptSessionRequest | ( | string | id,
 |  | string | pin = "" |
 | ) |  |  | [inline]

Definition at line 142 of file WiFiDirectServiceWrappers.cs.

            {
                WiFiDirectServiceSessionRequest request = null;
                bool found = false;

                lock (thisLock)
                {
                    foreach (var r in requestList)
                    {
                        if (r.DeviceInformation.Id == id)
                        {
                            found = true;
                            request = r;
                        }
                    }

                    if (!found)
                    {
                        throw new KeyNotFoundException("Attempted to accept session not found in list");
                    }

                    requestList.Remove(request);
                }
                manager.RemoveSessionRequest(request, this);

                try
                {
                    WiFiDirectServiceSession session = null;
                    string pinForConnect = pin;

                    // Determine if a PIN is needed
                    if (request.ProvisioningInfo.IsGroupFormationNeeded &&
                        request.ProvisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinDisplay)
                    {
                        // This means the advertiser should display a PIN and the seeker will look at the display and enter the same PIN
                        // The PIN may be randomly generated now, but for this sample, we configure a PIN when starting the advertiser
                        pinForConnect = this.pin;
                    }
                    else if (request.ProvisioningInfo.IsGroupFormationNeeded &&
                        request.ProvisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinEntry)
                    {
                        // This means that the seeker should display a PIN and the advertiser will need to look at that display and enter the same PIN
                        if (pin.Length == 0)
                        {
                            throw new ArgumentException("Expected PIN for connection, not provided");
                        }
                        pinForConnect = pin;
                    }
                    else
                    {
                        // PIN not needed, do not pass into connect
                        pinForConnect = "";
                    }

                    manager.NotifyUser("Accepting session request...", NotifyType.StatusMessage);

                    if (pinForConnect.Length > 0)
                    {
                        // NOTE: This MUST be called from the UI thread
                        session = await advertiser.ConnectAsync(request.DeviceInformation, pinForConnect);
                    }
                    else
                    {
                        // NOTE: This MUST be called from the UI thread
                        session = await advertiser.ConnectAsync(request.DeviceInformation);
                    }

                    manager.NotifyUser("Session request accepted", NotifyType.StatusMessage);

                    SessionWrapper sessionWrapper = new SessionWrapper(session, manager);
                    manager.AddSession(sessionWrapper);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("AcceptSessionRequest Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void DeclineSessionRequest ( string id ) [inline]

Definition at line 220 of file WiFiDirectServiceWrappers.cs.

            {
                WiFiDirectServiceSessionRequest request = null;

                bool found = false;

                lock (thisLock)
                {
                    foreach (var r in requestList)
                    {
                        if (r.DeviceInformation.Id == id)
                        {
                            found = true;
                            request = r;
                        }
                    }

                    if (!found)
                    {
                        throw new KeyNotFoundException("Attempted to accept session not found in list");
                    }

                    requestList.Remove(request);
                }
                manager.RemoveSessionRequest(request, this);

                // Decline incoming requests by disposing the request object
                request.Dispose();
                manager.NotifyUser("Declined Request", NotifyType.StatusMessage);
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 310 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    // Stop advertising
                    // If for some reason the advertiser is stopping between the time that we check
                    // the AdvertisementStatus and when we call Stop, this will throw
                    try
                    {
                        if (advertiser.AdvertisementStatus == WiFiDirectServiceAdvertisementStatus.Started)
                        {
                            advertiser.Stop();
                        }
                    }
                    catch (Exception)
                    {
                        // Stop can throw if it is already stopped or stopping, ignore
                    }

                    // Remove event handlers
                    advertiser.AdvertisementStatusChanged -= OnAdvertisementStatusChanged;
                    advertiser.AutoAcceptSessionConnected -= OnAutoAcceptSessionConnected;
                    advertiser.SessionRequested -= OnSessionRequested;

                    foreach (var request in requestList)
                    {
                        request.Dispose();
                    }
                    requestList.Clear();
                }

                disposed = true;
            }

void Dispose ( ) [inline]

Definition at line 304 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

void OnAdvertisementStatusChanged | ( | WiFiDirectServiceAdvertiser | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 278 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    WiFiDirectServiceAdvertisementStatus status = advertiser.AdvertisementStatus;

                    manager.NotifyUser("Advertisement Status Changed to " + status.ToString(), NotifyType.StatusMessage);

                    manager.AdvertiserStatusChanged(this);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnAdvertisementStatusChanged Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void OnAutoAcceptSessionConnected | ( | WiFiDirectServiceAdvertiser | sender,
 |  | WiFiDirectServiceAutoAcceptSessionConnectedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 252 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    string sessionInfo = "";
                    if (args.SessionInfo != null && args.SessionInfo.Length > 0)
                    {
                        using (DataReader sessionInfoDataReader = DataReader.FromBuffer(args.SessionInfo))
                        {
                            sessionInfo = sessionInfoDataReader.ReadString(args.SessionInfo.Length);
                        }
                    }

                    manager.NotifyUser("Auto-Accept Session Connected: sessionInfo=" + sessionInfo, NotifyType.StatusMessage);

                    SessionWrapper sessionWrapper = new SessionWrapper(args.Session, manager);
                    manager.AddSession(sessionWrapper);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnAutoAcceptSessionConnected Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void OnSessionRequested | ( | WiFiDirectServiceAdvertiser | sender,
 |  | WiFiDirectServiceSessionRequestedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 102 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    manager.NotifyUser("Received session request", NotifyType.StatusMessage);

                    string sessionInfo = "";
                    if (args.GetSessionRequest().SessionInfo != null && args.GetSessionRequest().SessionInfo.Length > 0)
                    {
                        using (DataReader sessionInfoDataReader = DataReader.FromBuffer(args.GetSessionRequest().SessionInfo))
                        {
                            sessionInfo = sessionInfoDataReader.ReadString(args.GetSessionRequest().SessionInfo.Length);
                            manager.NotifyUser("Received Session Info: " + sessionInfo, NotifyType.StatusMessage);
                        }
                    }

                    lock (thisLock)
                    {
                        requestList.Add(args.GetSessionRequest());
                    }

                    // Now we update the UI and wait for action to take (accept or decline)
                    manager.AddSessionRequest(args.GetSessionRequest(), this);

                    if (args.GetSessionRequest().ProvisioningInfo.IsGroupFormationNeeded &&
                        args.GetSessionRequest().ProvisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinDisplay)
                    {
                        // This means the advertiser should display a PIN and the seeker will look at the display and enter the same PIN
                        // The PIN may be randomly generated now, but for this sample, we configure a PIN when starting the advertiser
                        manager.NotifyUser("Remote side should enter PIN: " + pin, NotifyType.StatusMessage);
                    }
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnSessionRequest Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 349 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("AdvertisementWrapper");
                }
            }

Member Data Documentation

WiFiDirectServiceAdvertiser advertiser = null [private]

Definition at line 33 of file WiFiDirectServiceWrappers.cs.

bool disposed = false [private]

Definition at line 297 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceManager manager = null [private]

Definition at line 35 of file WiFiDirectServiceWrappers.cs.

int nextId = 1 [static, private]

Definition at line 46 of file WiFiDirectServiceWrappers.cs.

string pin = "" [private]

Definition at line 38 of file WiFiDirectServiceWrappers.cs.

IList<WiFiDirectServiceSessionRequest> requestList = new List<WiFiDirectServiceSessionRequest>() [private]

Definition at line 41 of file WiFiDirectServiceWrappers.cs.

Object thisLock = new Object() [private]

Definition at line 31 of file WiFiDirectServiceWrappers.cs.

int uniqueInternalId [private]

Definition at line 45 of file WiFiDirectServiceWrappers.cs.

Property Documentation

WiFiDirectServiceAdvertiser Advertiser [get]

Definition at line 72 of file WiFiDirectServiceWrappers.cs.

int InternalId [get]

Definition at line 77 of file WiFiDirectServiceWrappers.cs.

string Name [get]

Definition at line 87 of file WiFiDirectServiceWrappers.cs.

string Pin [get]

Definition at line 82 of file WiFiDirectServiceWrappers.cs.

IList<WiFiDirectServiceSessionRequest> SessionRequestList [get]

Definition at line 97 of file WiFiDirectServiceWrappers.cs.

string Status [get]

Definition at line 92 of file WiFiDirectServiceWrappers.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DiscoveredDeviceWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • DiscoveredDeviceWrapper
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

DiscoveredDeviceWrapper Class Reference

List of all members.

Public Member Functions

DiscoveredDeviceWrapper (DeviceInformation deviceInfo, WiFiDirectServiceManager manager)
async void | ConnectAsync (string pin="")
void | Dispose ()
async Task
< WiFiDirectServiceProvisioningInfo > 		GetProvisioningInfoAsync (WiFiDirectServiceConfigurationMethod configMethod)
async Task | OpenSessionAsync ()
async Task | SetServiceOptionsAsync (bool preferGO, string sessionInfo)

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

UInt32 | AdvertisementId [get, set]
UInt32 | ConfigMethods [get, set]
string | ServiceAddress [get, set]
string | ServiceInfo [get, set]
string | ServiceName [get, set]

Private Member Functions

~DiscoveredDeviceWrapper ()
void | OnSessionDeferred (WiFiDirectService sender, WiFiDirectServiceSessionDeferredEventArgs args)
void | ParseProperties ()
void | ThrowIfDisposed ()

Private Attributes

DeviceInformation | deviceInfo
bool | disposed = false
WiFiDirectServiceManager | manager = null
WiFiDirectService | service = null

Detailed Description

Definition at line 359 of file WiFiDirectServiceWrappers.cs.

Constructor & Destructor Documentation

DiscoveredDeviceWrapper | ( | DeviceInformation | deviceInfo,
 |  | WiFiDirectServiceManager | manager |
 | ) |  |  | [inline]

Definition at line 368 of file WiFiDirectServiceWrappers.cs.

            {
                this.deviceInfo = deviceInfo;
                this.manager = manager;

                ParseProperties();
            }

~DiscoveredDeviceWrapper ( ) [inline, private]

Definition at line 640 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(false);
            }

Member Function Documentation

async void ConnectAsync ( string pin = "" ) [inline]

Calls service.ConnectAsync() to connect the session If the session is not already opened, it calls OpenSessionAsync.

Parameters:
pin Optional PIN if needed

Definition at line 581 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                // Must call FromIdAsync first
                if (service == null)
                {
                    await OpenSessionAsync();
                }

                WiFiDirectServiceSession session = null;

                manager.NotifyUser("Connecting...", NotifyType.StatusMessage);

                try
                {
                    if (pin.Length > 0)
                    {
                        session = await service.ConnectAsync(pin);
                    }
                    else
                    {
                        session = await service.ConnectAsync();
                    }

                    manager.NotifyUser("Done Connecting", NotifyType.StatusMessage);

                    // Now we are done with this WiFiDirectService instance
                    // Clear state so a new connection can be started
                    service.SessionDeferred -= OnSessionDeferred;
                    service = null;

                    SessionWrapper sessionWrapper = new SessionWrapper(session, manager);
                    manager.AddSession(sessionWrapper);
                }
                catch (Exception ex)
                {
                    // This could fail due to driver or network issues
                    manager.NotifyUser("ConnectAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 651 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    if (service != null)
                    {
                        service.SessionDeferred -= OnSessionDeferred;
                    }
                }

                disposed = true;
            }

void Dispose ( ) [inline]

Definition at line 645 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

task< WiFiDirectServiceProvisioningInfo^> GetProvisioningInfoAsync ( WiFiDirectServiceConfigurationMethod configMethod ) [inline]

Calls service.GetProvisioningInfoAsync to begin provision discovery and determine if a PIN will be needed to connect.

Parameters:
configMethod Selected Config Method to use, based on supported config methods of discovered device

Definition at line 526 of file WiFiDirectServiceWrappers.cs.

            {
                WiFiDirectServiceProvisioningInfo provisioningInfo = null;
                ThrowIfDisposed();

                // Must call FromIdAsync first
                if (service == null)
                {
                    await OpenSessionAsync();
                }

                manager.NotifyUser("Get provisioning info...", NotifyType.StatusMessage);

                try
                {
                    provisioningInfo = await service.GetProvisioningInfoAsync(configMethod);

                    if (provisioningInfo.IsGroupFormationNeeded)
                    {
                        if (provisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinDisplay)
                        {
                            // UI should display the PIN and pass it into the call to Connect
                            manager.NotifyUser("Group Formation is needed, should DISPLAY PIN", NotifyType.StatusMessage);
                        }
                        else if (provisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinEntry)
                        {
                            // UI should take PIN as input and pass it into the call to Connect
                            manager.NotifyUser("Group Formation is needed, should ENTER PIN", NotifyType.StatusMessage);
                        }
                        else
                        {
                            manager.NotifyUser("Group Formation is needed, no PIN required", NotifyType.StatusMessage);
                        }
                    }
                    else
                    {
                        manager.NotifyUser("Group Formation is not needed", NotifyType.StatusMessage);
                    }
                }
                catch (Exception ex)
                {
                    // This could fail due to driver or network issues
                    manager.NotifyUser("GetProvisioningInfoAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }

                return provisioningInfo;
            }

void OnSessionDeferred | ( | WiFiDirectService | sender,
 |  | WiFiDirectServiceSessionDeferredEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 623 of file WiFiDirectServiceWrappers.cs.

            {
                string deferredSessionInfo = "";
                if (args.DeferredSessionInfo != null && args.DeferredSessionInfo.Length > 0)
                {
                    using (DataReader sessionInfoDataReader = DataReader.FromBuffer(args.DeferredSessionInfo))
                    {
                        deferredSessionInfo = sessionInfoDataReader.ReadString(args.DeferredSessionInfo.Length);
                    }
                }

                manager.NotifyUser("Session Connection was deferred... (" + deferredSessionInfo + ")", NotifyType.StatusMessage);
            }

task< void > OpenSessionAsync ( ) [inline]

Calls WiFiDirectService.FromId to open the seeker session Caller can then use this.Service to modify settings before connecting.

Definition at line 466 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                // This wrapper can only be used for FromIdAsync once
                if (service != null)
                {
                    throw new Exception("Attempted to connect to discovered service a second time!");
                }

                manager.NotifyUser("Open session...", NotifyType.StatusMessage);

                try
                {
                    // NOTE: This MUST be called from the UI thread
                    service = await WiFiDirectService.FromIdAsync(deviceInfo.Id);
                    service.SessionDeferred += OnSessionDeferred;
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("FromIdAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void ParseProperties ( ) [inline, private]

Definition at line 379 of file WiFiDirectServiceWrappers.cs.

            {
                object serviceName;
                if (deviceInfo.Properties.TryGetValue("System.Devices.WiFiDirectServices.ServiceName", out serviceName))
                {
                    ServiceName = serviceName.ToString();
                }
                else
                {
                    ServiceName = "";
                }

                object advertisementId;
                if (deviceInfo.Properties.TryGetValue("System.Devices.WiFiDirectServices.AdvertisementId", out advertisementId))
                {
                    AdvertisementId = Convert.ToUInt32(advertisementId, CultureInfo.InvariantCulture);
                }
                else
                {
                    AdvertisementId = 0;
                }

                object configMethods;
                if (deviceInfo.Properties.TryGetValue("System.Devices.WiFiDirectServices.ServiceConfigMethods", out configMethods))
                {
                    ConfigMethods = Convert.ToUInt32(configMethods, CultureInfo.InvariantCulture);
                }
                else
                {
                    ConfigMethods = 0;
                }

                object serviceAddress;
                if (deviceInfo.Properties.TryGetValue("System.Devices.WiFiDirectServices.ServiceAddress", out serviceAddress))
                {
                    byte[] macBuffer = (byte[])serviceAddress;

                    ServiceAddress = "";
                    foreach (byte octet in macBuffer)
                    {
                        ServiceAddress += octet.ToString("X2", CultureInfo.InvariantCulture) + ":";
                    }
                    if (ServiceAddress.Length > 0)
                    {
                        ServiceAddress = ServiceAddress.Substring(0, ServiceAddress.Length - 1);
                    }
                }
                else
                {
                    ServiceAddress = "XX:XX:XX:XX:XX:XX";
                }

                ServiceInfo = "";
                object serviceInfo;
                if (deviceInfo.Properties.TryGetValue("System.Devices.WiFiDirectServices.ServiceInformation", out serviceInfo))
                {
                    if (serviceInfo != null)
                    {
                        IBuffer serviceInfoBuffer;
                        using (var tempStream = new Windows.Storage.Streams.InMemoryRandomAccessStream())
                        {
                            using (var serviceInfoDataWriter = new DataWriter(tempStream))
                            {
                                serviceInfoDataWriter.WriteBytes((Byte[])serviceInfo);
                                serviceInfoBuffer = serviceInfoDataWriter.DetachBuffer();
                            }
                        }

                        using (DataReader serviceInfoDataReader = DataReader.FromBuffer(serviceInfoBuffer))
                        {
                            ServiceInfo = serviceInfoDataReader.ReadString(serviceInfoBuffer.Length);
                        }
                    }
                }
            }

async Task SetServiceOptionsAsync | ( | bool | preferGO,
 |  | string | sessionInfo |
 | ) |  |  | [inline]

Call this to set options before doing the actual connect.

Parameters:
preferGO | If true, this peer will prefer to be the group owner (GO) of the connection
sessionInfo | Optional 144 byte buffer to send with the request to the advertising peer

Definition at line 495 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                // Must call FromIdAsync first
                if (service == null)
                {
                    await OpenSessionAsync();
                }

                service.PreferGroupOwnerMode = preferGO;

                if (sessionInfo != "")
                {
                    using (var sessionInfoDataWriter = new DataWriter(new InMemoryRandomAccessStream()))
                    {
                        sessionInfoDataWriter.WriteString(sessionInfo);
                        service.SessionInfo = sessionInfoDataWriter.DetachBuffer();
                    }
                }
                else
                {
                    service.SessionInfo = null;
                }
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 669 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("DiscoveredDeviceWrapper");
                }
            }

Member Data Documentation

DeviceInformation deviceInfo [private]

Definition at line 361 of file WiFiDirectServiceWrappers.cs.

bool disposed = false [private]

Definition at line 638 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceManager manager = null [private]

Definition at line 363 of file WiFiDirectServiceWrappers.cs.

WiFiDirectService service = null [private]

Definition at line 366 of file WiFiDirectServiceWrappers.cs.

Property Documentation

UInt32 AdvertisementId [get, set]

Definition at line 458 of file WiFiDirectServiceWrappers.cs.

UInt32 ConfigMethods [get, set]

Definition at line 459 of file WiFiDirectServiceWrappers.cs.

string ServiceAddress [get, set]

Definition at line 457 of file WiFiDirectServiceWrappers.cs.

string ServiceInfo [get, set]

Definition at line 460 of file WiFiDirectServiceWrappers.cs.

string ServiceName [get, set]

Definition at line 456 of file WiFiDirectServiceWrappers.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | AddPrefix_Click (object sender, RoutedEventArgs e)
void | CreateAdvertiser_Click (object sender, RoutedEventArgs e)
void | RemovePrefix_Click (object sender, RoutedEventArgs e)
void | ResetFields ()

Private Attributes

MainPage rootPage

Detailed Description

A normal application would hide this implementation and just provide a way to begin advertising a service

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs

Definition at line 32 of file Scenario1_AdvertiserCreate.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 36 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                this.InitializeComponent();
            }

Member Function Documentation

void AddPrefix_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 155 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                if (NewPrefix.Text != "")
                {
                    ServicePrefixList.Items.Add(NewPrefix.Text);
                    NewPrefix.Text = "";
                }
            }

void CreateAdvertiser_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 70 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                rootPage.NotifyUser("Creating Advertisement", NotifyType.StatusMessage);

                try
                {
                    List<WiFiDirectServiceConfigurationMethod> configMethods = new List<WiFiDirectServiceConfigurationMethod>();

                    if (ConfigMethodDispaly.IsChecked ?? false)
                    {
                        configMethods.Add(WiFiDirectServiceConfigurationMethod.PinDisplay);
                    }
                    if (ConfigMethodKeypad.IsChecked ?? false)
                    {
                        configMethods.Add(WiFiDirectServiceConfigurationMethod.PinEntry);
                    }
                    if (ConfigMethodDefault.IsChecked ?? false)
                    {
                        configMethods.Add(WiFiDirectServiceConfigurationMethod.Default);
                    }

                    WiFiDirectServiceStatus status = WiFiDirectServiceStatus.Available;
                    if (Status.SelectedItem.ToString() == "Busy")
                    {
                        status = WiFiDirectServiceStatus.Busy;
                    }
                    else if (Status.SelectedItem.ToString() == "Custom")
                    {
                        status = WiFiDirectServiceStatus.Custom;
                    }

                    uint customStatus = 0;
                    if (CustomStatus.Text.Length > 0)
                    {
                        uint temp = 0;
                        if (uint.TryParse(CustomStatus.Text, out temp))
                        {
                            customStatus = temp;
                        }
                    }

                    // NOTE: Each prefix published will be handled by the driver so there are limitations
                    // to how many prefixes can be supported. In general, apps should only publish prefixes
                    // of the service name that are required for discovery
                    // Typically, this would be something like "com.example.games" for a service called "com.example.games.foobar"
                    IList<String> prefixList = new List<String>();
                    foreach (var prefix in ServicePrefixList.Items)
                    {
                        // NOTE: these must be actual prefixes of the service name
                        // Publication will fail if they are not
                        prefixList.Add((string)prefix);
                    }

                    WiFiDirectServiceManager.Instance.StartAdvertisement(
                        ServiceName.Text,
                        AutoAccept.IsChecked ?? false,
                        PreferGO.IsChecked ?? false,
                        ConfigMethodDisplayPin.Text,
                        configMethods,
                        status,
                        customStatus,
                        ServiceInformation.Text,
                        DeferredSessionInfo.Text,
                        prefixList
                        );

                    ResetFields();

                    // Force navigation to the next page for smoother experience
                    rootPage.GoToScenario(1);
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser(String.Format(CultureInfo.InvariantCulture, "Failed to start service: {0}", ex.Message), NotifyType.ErrorMessage);
                }
            }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 41 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                rootPage = MainPage.Current;

                ResetFields();
                WiFiDirectServiceManager.Instance.Scenario1 = this;
            }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 49 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.Scenario1 = null;
            }

void RemovePrefix_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                foreach (var prefix in ServicePrefixList.SelectedItems)
                {
                    ServicePrefixList.Items.Remove(prefix);
                }
            }

void ResetFields ( ) [inline, private]

Definition at line 54 of file Scenario1_AdvertiserCreate.xaml.cs.

            {
                ServiceName.Text = "";
                AutoAccept.IsChecked = true;
                PreferGO.IsChecked = true;
                Status.SelectedIndex = 0;
                CustomStatus.Text = "";
                ConfigMethodDefault.IsChecked = true;
                ConfigMethodDispaly.IsChecked = true;
                ConfigMethodDisplayPin.Text = "";
                ConfigMethodKeypad.IsChecked = false;
                DeferredSessionInfo.Text = "";
                ServiceInformation.Text = "";
                ServicePrefixList.Items.Clear();
            }

Member Data Documentation

MainPage rootPage [private]

Definition at line 34 of file Scenario1_AdvertiserCreate.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/Scenario1_AdvertiserCreate.xaml.cs
  • WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

UI exposing an interface to accept/decline incoming connection requests as an advertiser and to interact with connected sessions. More...

List of all members.

Public Member Functions

Scenario2 ()
async void | AddAdvertiser (AdvertisementWrapper advertiser)
async void | AddSession (SessionWrapper session)
async void | AddSessionRequest (WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser)
async void | RemoveAdvertiser (int index)
async void | RemoveSession (int index)
async void | RemoveSessionRequest (WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser)
void | UpdateAdvertiserStatus (AdvertisementWrapper advertiser)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | Accept_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | CloseSession_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | Decline_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | SelectSession_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | StopAdvertisement_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

MainPage rootPage
Object | thisLock = new Object()

Detailed Description

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs

Definition at line 60 of file Scenario2_AdvertiserAccept.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 66 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                this.InitializeComponent();
            }

Member Function Documentation

void Accept_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 215 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                if (SessionRequests.Items.Count > 0)
                {
                    int requestIndex = SessionRequests.SelectedIndex;
                    if (requestIndex >= 0)
                    {
                        SessionRequestWrapper request = SessionRequests.Items[requestIndex] as SessionRequestWrapper;
                        request.Advertisement.AcceptSessionRequest(request.Id, AcceptPin.Text);
                    }
                }
            }

async void AddAdvertiser ( AdvertisementWrapper advertiser ) [inline]

Definition at line 149 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        Advertisements.Items.Add(advertiser);
                    }
                });
            }

async void AddSession ( SessionWrapper session ) [inline]

Definition at line 183 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        ConnectedSessions.Items.Add(session);
                    }
                });
            }

async void AddSessionRequest | ( | WiFiDirectServiceSessionRequest | request,
 |  | AdvertisementWrapper | advertiser |
 | ) |  |  | [inline]

Definition at line 118 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        SessionRequestWrapper sessionRequest = new SessionRequestWrapper(request, advertiser);
                        SessionRequests.Items.Add(sessionRequest);
                    }
                });
            }

void CloseSession_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 241 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                if (ConnectedSessions.Items.Count > 0)
                {
                    int index = ConnectedSessions.SelectedIndex;
                    if (index >= 0)
                    {
                        WiFiDirectServiceManager.Instance.CloseSession(index);
                    }
                }
            }

void Decline_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 228 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                if (SessionRequests.Items.Count > 0)
                {
                    int requestIndex = SessionRequests.SelectedIndex;
                    if (requestIndex >= 0)
                    {
                        SessionRequestWrapper request = SessionRequests.Items[requestIndex] as SessionRequestWrapper;
                        request.Advertisement.DeclineSessionRequest(request.Id);
                    }
                }
            }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 71 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                lock (thisLock)
                {
                    rootPage = MainPage.Current;

                    MainUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Visible;

                    // Fill in all existing data
                    if (WiFiDirectServiceManager.Instance.Advertisers.Count > 0)
                    {
                        // Session Requests
                        SessionRequests.Items.Clear();

                        // Advertisers
                        Advertisements.Items.Clear();
                        foreach (var advertiser in WiFiDirectServiceManager.Instance.Advertisers)
                        {
                            Advertisements.Items.Add(advertiser);

                            foreach (var request in advertiser.SessionRequestList)
                            {
                                SessionRequestWrapper sessionRequest = new SessionRequestWrapper(request, advertiser);
                                SessionRequests.Items.Add(sessionRequest);
                            }
                        }

                        // Connected Sessions
                        ConnectedSessions.Items.Clear();
                        foreach (var session in WiFiDirectServiceManager.Instance.ConnectedSessionList)
                        {
                            ConnectedSessions.Items.Add(session);
                        }

                        MainUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
                        PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    }
                }
                WiFiDirectServiceManager.Instance.Scenario2 = this;
            }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 113 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.Scenario2 = null;
            }

async void RemoveAdvertiser ( int index ) [inline]

Definition at line 160 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        if (index > Advertisements.Items.Count - 1)
                        {
                            throw new IndexOutOfRangeException("Attempted to remove advertiser no longer in list");
                        }

                        Advertisements.Items.RemoveAt(index);

                        if (Advertisements.Items.Count == 0)
                        {
                            // Force navigation to the previous page for smoother experience
                            // This takes us to the scenario to create a new advertisement
                            rootPage.GoToScenario(0);
                        }
                    }
                });
            }

async void RemoveSession ( int index ) [inline]

Definition at line 194 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        if (index > ConnectedSessions.Items.Count - 1)
                        {
                            throw new IndexOutOfRangeException("Attempted to remove session no longer in list");
                        }

                        ConnectedSessions.Items.RemoveAt(index);
                    }
                });
            }

async void RemoveSessionRequest | ( | WiFiDirectServiceSessionRequest | request,
 |  | AdvertisementWrapper | advertiser |
 | ) |  |  | [inline]

Definition at line 130 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        foreach (SessionRequestWrapper r in SessionRequests.Items)
                        {
                            if (r.Advertisement.InternalId == advertiser.InternalId &&
                                r.Id == request.DeviceInformation.Id)
                            {
                                SessionRequests.Items.Remove(r);
                                break;
                            }
                        }
                    }
                });
            }

void SelectSession_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 253 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                if (ConnectedSessions.Items.Count > 0)
                {
                    int index = ConnectedSessions.SelectedIndex;
                    if (index >= 0)
                    {
                        WiFiDirectServiceManager.Instance.SelectSession(index);

                        // Force navigation to the next page for smoother experience
                        // This takes us to the scenario to send and receive data for a selected session
                        rootPage.GoToScenario(4);
                    }
                }
            }

void StopAdvertisement_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 269 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                if (Advertisements.Items.Count > 0)
                {
                    int index = Advertisements.SelectedIndex;
                    if (index >= 0)
                    {
                        WiFiDirectServiceManager.Instance.UnpublishService(index);
                    }
                }
            }

void UpdateAdvertiserStatus ( AdvertisementWrapper advertiser ) [inline]

Definition at line 210 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                // Update list
            }

Member Data Documentation

MainPage rootPage [private]

Definition at line 64 of file Scenario2_AdvertiserAccept.xaml.cs.

Object thisLock = new Object() [private]

Definition at line 62 of file Scenario2_AdvertiserAccept.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/Scenario2_AdvertiserAccept.xaml.cs
  • WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • Scenario3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

UI that provides a way to discover any Wi-Fi Direct service by name A real application would likely hard-code the service name to a well-known service rather than expose this in the UI. More...

List of all members.

Public Member Functions

Scenario3 ()
async void | SessionConnected ()
async void | UpdateDiscoveryList (IList< DiscoveredDeviceWrapper > devices)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | Discover_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | DoConnect_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | GetProvisioningInfo_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

WiFiDirectServiceProvisioningInfo | provisioningInfo
MainPage rootPage
Object | thisLock = new Object()

Detailed Description

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs

Definition at line 31 of file Scenario3_SeekerDiscover.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 39 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                this.InitializeComponent();
            }

Member Function Documentation

void Discover_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 88 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.DiscoverServicesAsync(
                    ServiceName.Text,
                    RequestedServiceInfo.Text
                    );
            }

async void DoConnect_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 132 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                if (DiscoveredServices.Items.Count > 0)
                {
                    int index = DiscoveredServices.SelectedIndex;
                    if (index >= 0)
                    {
                        DiscoveredDeviceWrapper service = (DiscoveredDeviceWrapper)DiscoveredServices.Items[index];

                        await service.SetServiceOptionsAsync(PreferGO.IsChecked ?? false, SessionInfo.Text);

                        if (provisioningInfo != null &&
                            provisioningInfo.IsGroupFormationNeeded &&
                            provisioningInfo.SelectedConfigurationMethod != WiFiDirectServiceConfigurationMethod.Default)
                        {
                            // These are the conditions under which a PIN is required
                            service.ConnectAsync(ConnectPin.Text);
                        }
                        else
                        {
                            // No PIN required
                            service.ConnectAsync();
                        }
                    }
                }
            }

async void GetProvisioningInfo_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                if (DiscoveredServices.Items.Count > 0)
                {
                    int index = DiscoveredServices.SelectedIndex;
                    if (index >= 0)
                    {
                        DiscoveredDeviceWrapper service = (DiscoveredDeviceWrapper)DiscoveredServices.Items[index];

                        WiFiDirectServiceConfigurationMethod configMethod = WiFiDirectServiceConfigurationMethod.Default;
                        if (((ComboBoxItem)SelectedConfigMethod.SelectedItem).Content.ToString() == "WFDS Default")
                        {
                            configMethod = WiFiDirectServiceConfigurationMethod.Default;
                        }
                        else if (((ComboBoxItem)SelectedConfigMethod.SelectedItem).Content.ToString() == "PIN Keypad")
                        {
                            configMethod = WiFiDirectServiceConfigurationMethod.PinEntry;
                        }
                        else if (((ComboBoxItem)SelectedConfigMethod.SelectedItem).Content.ToString() == "PIN Display")
                        {
                            configMethod = WiFiDirectServiceConfigurationMethod.PinDisplay;
                        }

                        await service.OpenSessionAsync();
                        await service.SetServiceOptionsAsync(PreferGO.IsChecked ?? false, SessionInfo.Text);
                        provisioningInfo = await service.GetProvisioningInfoAsync(configMethod);
                    }
                }
            }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 44 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                lock (thisLock)
                {
                    rootPage = MainPage.Current;

                    // Cleanup past discoveries
                    DiscoveredServices.Items.Clear();
                    provisioningInfo = null;

                    UpdateDiscoveryList(WiFiDirectServiceManager.Instance.DiscoveredDevices);
                }
                WiFiDirectServiceManager.Instance.Scenario3 = this;
            }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 59 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.Scenario3 = null;
            }

void SessionConnected ( ) [inline]

Definition at line 79 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // Force navigation to the next page for smoother experience
                    rootPage.GoToScenario(3);
                });
            }

async void UpdateDiscoveryList ( IList< DiscoveredDeviceWrapper > devices ) [inline]

Definition at line 64 of file Scenario3_SeekerDiscover.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        DiscoveredServices.Items.Clear();
                        foreach (var device in devices)
                        {
                            DiscoveredServices.Items.Add(device);
                        }
                    }
                });
            }

Member Data Documentation

WiFiDirectServiceProvisioningInfo provisioningInfo [private]

Definition at line 37 of file Scenario3_SeekerDiscover.xaml.cs.

MainPage rootPage [private]

Definition at line 35 of file Scenario3_SeekerDiscover.xaml.cs.

Object thisLock = new Object() [private]

Definition at line 33 of file Scenario3_SeekerDiscover.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/Scenario3_SeekerDiscover.xaml.cs
  • WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • Scenario4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4 Class Reference

UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with. More...

List of all members.

Public Member Functions

Scenario4 ()
async void | AddSession (SessionWrapper session)
async void | RemoveSession (int index)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | CloseSession_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
void | SelectSession_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

MainPage rootPage
Object | thisLock = new Object()

Detailed Description

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs

Definition at line 28 of file Scenario4_SeekerSession.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 34 of file Scenario4_SeekerSession.xaml.cs.

            {
                this.InitializeComponent();
            }

Member Function Documentation

async void AddSession ( SessionWrapper session ) [inline]

Definition at line 69 of file Scenario4_SeekerSession.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        ConnectedSessions.Items.Add(session);
                    }
                });
            }

void CloseSession_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 112 of file Scenario4_SeekerSession.xaml.cs.

            {
                if (ConnectedSessions.Items.Count > 0)
                {
                    int index = ConnectedSessions.SelectedIndex;
                    if (index >= 0)
                    {
                        WiFiDirectServiceManager.Instance.CloseSession(index);
                    }
                }
            }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario4_SeekerSession.xaml.cs.

            {
                lock (thisLock)
                {
                    rootPage = MainPage.Current;

                    MainUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Visible;

                    // Cleanup old entries
                    ConnectedSessions.Items.Clear();
                    foreach (var session in WiFiDirectServiceManager.Instance.ConnectedSessionList)
                    {
                        ConnectedSessions.Items.Add(session);
                    }

                    if (ConnectedSessions.Items.Count > 0)
                    {
                        MainUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
                        PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    }
                }
                WiFiDirectServiceManager.Instance.Scenario4 = this;
            }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 64 of file Scenario4_SeekerSession.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.Scenario4 = null;
            }

async void RemoveSession ( int index ) [inline]

Definition at line 80 of file Scenario4_SeekerSession.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        if (index > ConnectedSessions.Items.Count - 1)
                        {
                            throw new IndexOutOfRangeException("Attempted to remove session no longer in list");
                        }

                        ConnectedSessions.Items.RemoveAt(index);
                    }
                });
            }

void SelectSession_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file Scenario4_SeekerSession.xaml.cs.

            {
                if (ConnectedSessions.Items.Count > 0)
                {
                    int index = ConnectedSessions.SelectedIndex;
                    if (index >= 0)
                    {
                        WiFiDirectServiceManager.Instance.SelectSession(index);

                        // Force navigation to the next page for smoother experience
                        // This takes us to the scenario to send and receive data for a selected session
                        rootPage.GoToScenario(4);
                    }
                }
            }

Member Data Documentation

MainPage rootPage [private]

Definition at line 32 of file Scenario4_SeekerSession.xaml.cs.

Object thisLock = new Object() [private]

Definition at line 30 of file Scenario4_SeekerSession.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/Scenario4_SeekerSession.xaml.cs
  • WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • Scenario5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5 Class Reference

UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services This sample just demonstrates setting up the connection and sending strings A real application would likely open pre-determined ports for application communication. More...

List of all members.

Public Member Functions

Scenario5 ()
async void | AddSocket (SocketWrapper socket)
async void | RemoveSocket (int index)

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | AddPort_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
async void | DoSend_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)

Private Attributes

MainPage rootPage
SessionWrapper | session = null
Object | thisLock = new Object()

Detailed Description

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs

Definition at line 31 of file Scenario5_SendData.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 38 of file Scenario5_SendData.xaml.cs.

            {
                this.InitializeComponent();
            }

Member Function Documentation

void AddPort_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 117 of file Scenario5_SendData.xaml.cs.

            {
                if (session != null)
                {
                    ushort port = 0;
                    if (ushort.TryParse(Port.Text, out port))
                    {
                        // Create socket asynchronously, will get callback when it is complete to add the socket to the list
                        if (((ComboBoxItem)Protocol.SelectedItem).Content.ToString() == "TCP")
                        {
                            session.AddStreamSocketListenerAsync(port);
                        }
                        else
                        {
                            session.AddDatagramSocketAsync(port);
                        }
                    }
                }
            }

async void AddSocket ( SocketWrapper socket ) [inline]

Definition at line 90 of file Scenario5_SendData.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        ConnectedSockets.Items.Add(socket);
                    }
                });
            }

async void DoSend_Click | ( | object | sender,
 |  | Windows.UI.Xaml.RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 137 of file Scenario5_SendData.xaml.cs.

            {
                if (ConnectedSockets.Items.Count > 0 && session != null)
                {
                    int index = ConnectedSockets.SelectedIndex;
                    if (index >= 0)
                    {
                        string message = SendData.Text;
                        SendData.Text = "";

                        await session.SocketList[index].SendMessageAsync(message);
                    }
                }
            }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 43 of file Scenario5_SendData.xaml.cs.

            {
                lock (thisLock)
                {
                    rootPage = MainPage.Current;

                    MainUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Visible;

                    session = WiFiDirectServiceManager.Instance.CurrentSession;

                    if (session != null)
                    {
                        AdvertisementId.Text = session.AdvertisementId.ToString(CultureInfo.InvariantCulture);
                        ServiceAddress.Text = session.ServiceAddress;
                        SessionId.Text = session.SessionId.ToString(CultureInfo.InvariantCulture);
                        SessionAddress.Text = session.SessionAddress;
                        SessionStatus.Text = session.Session.Status.ToString();

                        ConnectedSockets.Items.Clear();
                        foreach (var socket in session.SocketList)
                        {
                            ConnectedSockets.Items.Add(socket);
                        }

                        MainUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
                        PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    }
                    else
                    {
                        AdvertisementId.Text = "##";
                        ServiceAddress.Text = "XX:XX:XX:XX:XX:XX";
                        SessionId.Text = "##";
                        SessionAddress.Text = "XX:XX:XX:XX:XX:XX";
                        SessionStatus.Text = "???";

                        ConnectedSockets.Items.Clear();
                    }
                }
                WiFiDirectServiceManager.Instance.Scenario5 = this;
            }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 85 of file Scenario5_SendData.xaml.cs.

            {
                WiFiDirectServiceManager.Instance.Scenario5 = null;
            }

async void RemoveSocket ( int index ) [inline]

Definition at line 101 of file Scenario5_SendData.xaml.cs.

            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (thisLock)
                    {
                        if (index > ConnectedSockets.Items.Count - 1)
                        {
                            throw new IndexOutOfRangeException("Attempted to remove socket no longer in list");
                        }

                        ConnectedSockets.Items.RemoveAt(index);
                    }
                });
            }

Member Data Documentation

MainPage rootPage [private]

Definition at line 35 of file Scenario5_SendData.xaml.cs.

SessionWrapper session = null [private]

Definition at line 36 of file Scenario5_SendData.xaml.cs.

Object thisLock = new Object() [private]

Definition at line 33 of file Scenario5_SendData.xaml.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/Scenario5_SendData.xaml.cs
  • WiFiDirectServices/cpp/Scenario5_SendData.xaml.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • sealed
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

#include "Scenario1_AdvertiserCreate.xaml.h"

List of all members.

Public Member Functions

virtual | ~AdvertisementWrapper ()
virtual | ~DiscoveredDeviceWrapper ()
virtual | ~SessionWrapper ()
virtual | ~SocketWrapper ()
virtual | ~StreamSocketListenerWrapper ()
void | AddAdvertiser (AdvertisementWrapper^advertiser)
Concurrency::task< void > | AddDatagramSocketAsync (uint16 port)
void | AddSession (SessionWrapper^session)
void | AddSession (SessionWrapper^session)
void | AddSessionRequest (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser)
void | AddSocket (SocketWrapper^socket)
void | AddStreamSocketInternal (Windows::Networking::Sockets::StreamSocket^socket)
Concurrency::task< void > | AddStreamSocketListenerAsync (uint16 port)
AdvertisementWrapper (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^advertiser, WiFiDirectServiceManager^manager, Platform::String^pin)
Concurrency::task< void > | ConnectAsync (Platform::String^pin="")
void | DeclineSessionRequest (Platform::String^id)
DiscoveredDeviceWrapper (Windows::Devices::Enumeration::DeviceInformation^deviceInfo, WiFiDirectServiceManager^manager)
Concurrency::task
< Windows::Devices::WiFiDirect::Services::WiFiDirectServiceProvisioningInfo^> 		GetProvisioningInfoAsync (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceConfigurationMethod configMethod)
Concurrency::task< void > | ReceiveMessageAsync ()
void | RemoveAdvertiser (unsigned int index)
void | RemoveSession (unsigned int index)
void | RemoveSession (unsigned int index)
void | RemoveSessionRequest (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser)
void | RemoveSocket (unsigned int index)
Scenario1 ()
Scenario2 ()
Scenario3 ()
Scenario4 ()
Scenario5 ()
void | SessionConnected ()
SessionRequestWrapper (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertisement)
SessionWrapper (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^session, WiFiDirectServiceManager^manager)
Concurrency::task< void > | SetServiceOptionsAsync (bool preferGO, Platform::String^sessionInfo)
SocketWrapper (WiFiDirectServiceManager^manager, Windows::Networking::Sockets::StreamSocket^streamSocket, Windows::Networking::Sockets::DatagramSocket^datagramSocket, bool canSend)
void | StartReceiveLoop ()
StreamSocketListenerWrapper (WiFiDirectServiceManager^manager, Windows::Networking::Sockets::StreamSocketListener^streamSocketListener, SessionWrapper^session)
void | UpdateAdvertiserStatus (AdvertisementWrapper^advertiser)
void | UpdateDiscoveryList (Windows::Foundation::Collections::IVector< DiscoveredDeviceWrapper^>^devices)

Protected Member Functions

virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override
virtual void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override

Properties

AdvertisementWrapper Advertisement
unsigned int | AdvertisementId
unsigned int | ConfigMethods
Platform::String | Id
Platform::String | Pin
Platform::String | ProvisioningInfo
Platform::String | ServiceAddress
Platform::String | ServiceInfo
Platform::String | ServiceName
Windows::Storage::Streams::IBuffer | SessionInfo

Private Member Functions

void | Accept_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | AddAdvertiser (AdvertisementWrapper^advertiser)
void | AddPort_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | AddPrefix_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | AddSession (SessionWrapper^session)
void | AddSessionRequest (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser)
void | AddSocket (SocketWrapper^socket)
void | AdvertiserStatusChanged (AdvertisementWrapper^advertiser)
void | CloseSession (unsigned int index)
void | CloseSession_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CloseSession_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | CreateAdvertiser_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Decline_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Discover_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DiscoverServicesAsync (Platform::String^serviceName, Platform::String^requestedServiceInfo="")
void | DoConnect_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DoSend_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | GetProvisioningInfo_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | NotifyUser (Platform::String^strMessage, NotifyType type)
void | OnAdvertisementStatusChanged (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Platform::Object^args)
void | OnAutoAcceptSessionConnected (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAutoAcceptSessionConnectedEventArgs^args)
void | OnConnectionReceived (Windows::Networking::Sockets::StreamSocketListener^sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^args)
void | OnRemotePortAdded (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceRemotePortAddedEventArgs^args)
void | OnSessionDeferred (Windows::Devices::WiFiDirect::Services::WiFiDirectService^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionDeferredEventArgs^args)
void | OnSessionRequested (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequestedEventArgs^args)
void | OnSessionStatusChanged (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^sender, Platform::Object^args)
void | OnUDPMessageReceived (Windows::Networking::Sockets::DatagramSocket^sender, Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^args)
void | ParseProperties ()
void | RemoveAdvertiser (AdvertisementWrapper^advertiser)
void | RemoveAdvertiser (unsigned int index)
void | RemovePrefix_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | RemoveSession (unsigned int index)
void | RemoveSession (SessionWrapper^session)
void | RemoveSessionRequest (Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser)
void | ResetFields ()
void | SelectSession (unsigned int index)
void | SelectSession_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | SelectSession_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | StopAdvertisement_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | UnpublishService (unsigned int index)
WiFiDirectServiceManager ()

Private Attributes

internal | __pad0__: static property WiFiDirectServiceManager^ Instance { WiFiDirectServiceManager^ get()
Windows::Foundation::EventRegistrationToken | _advertisementStatusChangedToken
Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser | _advertiser = nullptr
std::mutex | _advertiserMutex
Windows::Foundation::Collections::IVector
< AdvertisementWrapper^> 		_advertisers = ref new Platform::Collections::Vector<AdvertisementWrapper^>()
Windows::Foundation::EventRegistrationToken | _autoAcceptSessionConnectedToken
Windows::Foundation::Collections::IVector
< SessionWrapper^> 		_connectedSessions = ref new Platform::Collections::Vector<SessionWrapper^>()
Windows::Foundation::EventRegistrationToken | _connectionReceivedToken
Windows::Foundation::EventRegistrationToken | _datagramMessageReceivedToken
Windows::Networking::Sockets::DatagramSocket | _datagramSocket = nullptr
Windows::Devices::Enumeration::DeviceInformation | _deviceInfo
Windows::Foundation::Collections::IVector
< DiscoveredDeviceWrapper^> 		_discoveredDevices = ref new Platform::Collections::Vector<DiscoveredDeviceWrapper^>()
WiFiDirectServiceManager | _manager = nullptr
std::mutex | _managerMutex
std::mutex | _mutex
Platform::String | _pin = ""
Windows::Devices::WiFiDirect::Services::WiFiDirectServiceProvisioningInfo | _provisioningInfo
Windows::Storage::Streams::DataReader | _reader = nullptr
Windows::Foundation::EventRegistrationToken | _remotePortAddedToken
Windows::Foundation::Collections::IVector
< Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^> 		_requestList = ref new Platform::Collections::Vector<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^>()
SDKTemplate::MainPage _rootPage
MainPage _rootPage
Scenario1 | _scenario1 = nullptr
Scenario2 | _scenario2 = nullptr
Scenario3 | _scenario3 = nullptr
Scenario4 | _scenario4 = nullptr
Scenario5 | _scenario5 = nullptr
int | _selectedSession = -1
Windows::Devices::WiFiDirect::Services::WiFiDirectService | _service = nullptr
SessionWrapper | _session = nullptr
Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession | _session
Concurrency::event | _sessionClosedEvent
Windows::Foundation::EventRegistrationToken | _sessionDeferredToken
std::mutex | _sessionMutex
Windows::Foundation::EventRegistrationToken | _sessionRequestedToken
Windows::Foundation::EventRegistrationToken | _sessionStatusChangedToken
Windows::Foundation::Collections::IVector
< SocketWrapper^> 		_socketList = ref new Platform::Collections::Vector<SocketWrapper^>()
Windows::Networking::Sockets::StreamSocket | _streamSocket = nullptr
Windows::Networking::Sockets::StreamSocketListener | _streamSocketListener
Windows::Foundation::Collections::IVector
< StreamSocketListenerWrapper^> 		_streamSocketListeners = ref new Platform::Collections::Vector<StreamSocketListenerWrapper^>()
int | _uniqueInternalId
Windows::Storage::Streams::DataWriter | _writer = nullptr

Static Private Attributes

static WiFiDirectServiceManager | _instance
static int | _nextId

Detailed Description

Wraps WiFiDirectServiceAdvertiser and handles callbacks and related state.

Common class to wrap all of the services objects and state behind the UI.

UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services This sample just demonstrates setting up the connection and sending strings A real application would likely open pre-determined ports for application communication.

UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with.

UI that provides a way to discover any Wi-Fi Direct service by name A real application would likely hard-code the service name to a well-known service rather than expose this in the UI.

UI exposing an interface to accept/decline incoming connection requests as an advertiser and to interact with connected sessions.

Helper class to display session requests in list with extra data.

A normal application would hide this implementation and just provide a way to begin advertising a service

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.h/cpp and WiFiDirectServicesWrappers.h/cpp

Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.h/cpp and WiFiDirectServicesWrappers.h/cpp

Definition at line 29 of file Scenario1_AdvertiserCreate.xaml.h.

Constructor & Destructor Documentation

virtual ~AdvertisementWrapper ( ) [virtual]
virtual ~DiscoveredDeviceWrapper ( ) [virtual]
virtual ~StreamSocketListenerWrapper ( ) [virtual]
virtual ~SocketWrapper ( ) [virtual]
virtual ~SessionWrapper ( ) [virtual]

Member Function Documentation

void Accept_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void AddAdvertiser ( AdvertisementWrapper^ advertiser )
void AddAdvertiser ( AdvertisementWrapper^ advertiser ) [private]
Concurrency::task<void> AddDatagramSocketAsync ( uint16 port )
void AddPort_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void AddPrefix_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void AddSession ( SessionWrapper^ session )
void AddSession ( SessionWrapper^ session ) [private]
void AddSession ( SessionWrapper^ session )
void AddSessionRequest | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ | request,
 |  | AdvertisementWrapper^ | advertiser
 | ) |  |
void AddSessionRequest | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ | request,
 |  | AdvertisementWrapper^ | advertiser |
 | ) |  |  | [private]
void AddSocket ( SocketWrapper^ socket )
void AddSocket ( SocketWrapper^ socket ) [private]
void AddStreamSocketInternal ( Windows::Networking::Sockets::StreamSocket^ socket )
Concurrency::task<void> AddStreamSocketListenerAsync ( uint16 port )
AdvertisementWrapper | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^ | advertiser,
 |  | WiFiDirectServiceManager^ | manager,
 |  | Platform::String^ | pin
 | ) |  |
void AdvertiserStatusChanged ( AdvertisementWrapper^ advertiser ) [private]
void CloseSession ( unsigned int index ) [private]
void CloseSession_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void CloseSession_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<void> ConnectAsync ( Platform::String^ pin = "" )

Calls service.ConnectAsync() to connect the session If the session is not already opened, it calls OpenSession.

Parameters:
pin Optional PIN if needed
void CreateAdvertiser_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Decline_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DeclineSessionRequest ( Platform::String^ id )
void Discover_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
DiscoveredDeviceWrapper | ( | Windows::Devices::Enumeration::DeviceInformation^ | deviceInfo,
 |  | WiFiDirectServiceManager^ | manager
 | ) |  |
void DiscoverServicesAsync | ( | Platform::String^ | serviceName,
 |  | Platform::String^ | requestedServiceInfo = "" |
 | ) |  |  | [private]
void DoConnect_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DoSend_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void GetProvisioningInfo_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Concurrency::task<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceProvisioningInfo^> GetProvisioningInfoAsync ( Windows::Devices::WiFiDirect::Services::WiFiDirectServiceConfigurationMethod configMethod )

Calls service.GetProvisioningInfoAsync to begin provision discovery and determine if a PIN will be needed to connect.

Parameters:
configMethod Selected Config Method to use, based on supported config methods of discovered device
void NotifyUser | ( | Platform::String^ | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [private]
void OnAdvertisementStatusChanged | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnAutoAcceptSessionConnected | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^ | sender,
 |  | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAutoAcceptSessionConnectedEventArgs^ | args |
 | ) |  |  | [private]
void OnConnectionReceived | ( | Windows::Networking::Sockets::StreamSocketListener^ | sender,
 |  | Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^ | args |
 | ) |  |  | [private]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
virtual void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e ) [override, protected, virtual]
void OnRemotePortAdded | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^ | sender,
 |  | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceRemotePortAddedEventArgs^ | args |
 | ) |  |  | [private]
void OnSessionDeferred | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectService^ | sender,
 |  | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionDeferredEventArgs^ | args |
 | ) |  |  | [private]
void OnSessionRequested | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^ | sender,
 |  | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequestedEventArgs^ | args |
 | ) |  |  | [private]
void OnSessionStatusChanged | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnUDPMessageReceived | ( | Windows::Networking::Sockets::DatagramSocket^ | sender,
 |  | Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ | args |
 | ) |  |  | [private]
void ParseProperties ( ) [private]
Concurrency::task<void> ReceiveMessageAsync ( )

Read strings sent over the TCP socket Reads the uint32 size then the actual string.

void RemoveAdvertiser ( AdvertisementWrapper^ advertiser ) [private]
void RemoveAdvertiser ( unsigned int index )
void RemoveAdvertiser ( unsigned int index ) [private]
void RemovePrefix_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void RemoveSession ( unsigned int index )
void RemoveSession ( unsigned int index )
void RemoveSession ( unsigned int index ) [private]
void RemoveSession ( SessionWrapper^ session ) [private]
void RemoveSessionRequest | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ | request,
 |  | AdvertisementWrapper^ | advertiser
 | ) |  |
void RemoveSessionRequest | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ | request,
 |  | AdvertisementWrapper^ | advertiser |
 | ) |  |  | [private]
void RemoveSocket ( unsigned int index )
void ResetFields ( ) [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
Scenario4 ( )
Scenario5 ( )
void SelectSession ( unsigned int index ) [private]
void SelectSession_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void SelectSession_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void SessionConnected ( )
SessionRequestWrapper | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ | request,
 |  | AdvertisementWrapper^ | advertisement
 | ) |  |
SessionWrapper | ( | Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^ | session,
 |  | WiFiDirectServiceManager^ | manager
 | ) |  |
Concurrency::task<void> SetServiceOptionsAsync | ( | bool | preferGO,
 |  | Platform::String^ | sessionInfo
 | ) |  |

Call this to set options before doing the actual connect.

Parameters:
preferGO | If true, this peer will prefer to be the group owner (GO) of the connection
sessionInfo | Optional 144 byte buffer to send with the request to the advertising peer
SocketWrapper | ( | WiFiDirectServiceManager^ | manager,
 |  | Windows::Networking::Sockets::StreamSocket^ | streamSocket,
 |  | Windows::Networking::Sockets::DatagramSocket^ | datagramSocket,
 |  | bool | canSend
 | ) |  |
void StartReceiveLoop ( )
void StopAdvertisement_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
StreamSocketListenerWrapper | ( | WiFiDirectServiceManager^ | manager,
 |  | Windows::Networking::Sockets::StreamSocketListener^ | streamSocketListener,
 |  | SessionWrapper^ | session
 | ) |  |
void UnpublishService ( unsigned int index ) [private]
void UpdateAdvertiserStatus ( AdvertisementWrapper^ advertiser )
void UpdateDiscoveryList ( Windows::Foundation::Collections::IVector< DiscoveredDeviceWrapper^>^ devices )
WiFiDirectServiceManager ( ) [private]

Member Data Documentation

internal __pad0__ [private]

Definition at line 69 of file WiFiDirectServicesManager.h.

Windows::Foundation::EventRegistrationToken _advertisementStatusChangedToken [private]

Definition at line 47 of file WiFiDirectServicesWrappers.h.

Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser _advertiser = nullptr [private]

Definition at line 29 of file WiFiDirectServicesWrappers.h.

std::mutex _advertiserMutex [private]

Definition at line 33 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<AdvertisementWrapper^> _advertisers = ref new Platform::Collections::Vector<AdvertisementWrapper^>() [private]

Definition at line 46 of file WiFiDirectServicesManager.h.

Windows::Foundation::EventRegistrationToken _autoAcceptSessionConnectedToken [private]

Definition at line 48 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<SessionWrapper^> _connectedSessions = ref new Platform::Collections::Vector<SessionWrapper^>() [private]

Definition at line 53 of file WiFiDirectServicesManager.h.

Windows::Foundation::EventRegistrationToken _connectionReceivedToken [private]

Definition at line 194 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::EventRegistrationToken _datagramMessageReceivedToken [private]

Definition at line 227 of file WiFiDirectServicesWrappers.h.

Windows::Networking::Sockets::DatagramSocket _datagramSocket = nullptr [private]

Definition at line 219 of file WiFiDirectServicesWrappers.h.

Windows::Devices::Enumeration::DeviceInformation _deviceInfo [private]

Definition at line 120 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<DiscoveredDeviceWrapper^> _discoveredDevices = ref new Platform::Collections::Vector<DiscoveredDeviceWrapper^>() [private]

Definition at line 49 of file WiFiDirectServicesManager.h.

WiFiDirectServiceManager _instance [static, private]

Definition at line 60 of file WiFiDirectServicesManager.h.

WiFiDirectServiceManager _manager = nullptr [private]

Definition at line 31 of file WiFiDirectServicesWrappers.h.

std::mutex _managerMutex [private]

Definition at line 63 of file WiFiDirectServicesManager.h.

std::mutex _mutex [private]

Definition at line 79 of file Scenario2_AdvertiserAccept.xaml.h.

int _nextId [static, private]

Definition at line 44 of file WiFiDirectServicesWrappers.h.

Platform::String _pin = "" [private]

Definition at line 36 of file WiFiDirectServicesWrappers.h.

Windows::Devices::WiFiDirect::Services::WiFiDirectServiceProvisioningInfo _provisioningInfo [private]

Definition at line 45 of file Scenario3_SeekerDiscover.xaml.h.

Windows::Storage::Streams::DataReader _reader = nullptr [private]

Definition at line 223 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::EventRegistrationToken _remotePortAddedToken [private]

Definition at line 288 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^> _requestList = ref new Platform::Collections::Vector<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^>() [private]

Definition at line 40 of file WiFiDirectServicesWrappers.h.

SDKTemplate::MainPage _rootPage [private]

Definition at line 39 of file Scenario1_AdvertiserCreate.xaml.h.

MainPage _rootPage [private]

Definition at line 34 of file WiFiDirectServicesManager.h.

Scenario1 _scenario1 = nullptr [private]

Definition at line 39 of file WiFiDirectServicesManager.h.

Scenario2 _scenario2 = nullptr [private]

Definition at line 40 of file WiFiDirectServicesManager.h.

Scenario3 _scenario3 = nullptr [private]

Definition at line 41 of file WiFiDirectServicesManager.h.

Scenario4 _scenario4 = nullptr [private]

Definition at line 42 of file WiFiDirectServicesManager.h.

Scenario5 _scenario5 = nullptr [private]

Definition at line 43 of file WiFiDirectServicesManager.h.

int _selectedSession = -1 [private]

Definition at line 57 of file WiFiDirectServicesManager.h.

Windows::Devices::WiFiDirect::Services::WiFiDirectService _service = nullptr [private]

Definition at line 125 of file WiFiDirectServicesWrappers.h.

Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession _session [private]

Definition at line 275 of file WiFiDirectServicesWrappers.h.

SessionWrapper _session = nullptr [private]

Definition at line 45 of file Scenario5_SendData.xaml.h.

Concurrency::event _sessionClosedEvent [private]

Definition at line 292 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::EventRegistrationToken _sessionDeferredToken [private]

Definition at line 128 of file WiFiDirectServicesWrappers.h.

std::mutex _sessionMutex [private]

Definition at line 295 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::EventRegistrationToken _sessionRequestedToken [private]

Definition at line 49 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::EventRegistrationToken _sessionStatusChangedToken [private]

Definition at line 289 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<SocketWrapper^> _socketList = ref new Platform::Collections::Vector<SocketWrapper^>() [private]

Definition at line 285 of file WiFiDirectServicesWrappers.h.

Windows::Networking::Sockets::StreamSocket _streamSocket = nullptr [private]

Definition at line 218 of file WiFiDirectServicesWrappers.h.

Windows::Networking::Sockets::StreamSocketListener _streamSocketListener [private]

Definition at line 187 of file WiFiDirectServicesWrappers.h.

Windows::Foundation::Collections::IVector<StreamSocketListenerWrapper^> _streamSocketListeners = ref new Platform::Collections::Vector<StreamSocketListenerWrapper^>() [private]

Definition at line 281 of file WiFiDirectServicesWrappers.h.

int _uniqueInternalId [private]

Definition at line 43 of file WiFiDirectServicesWrappers.h.

Windows::Storage::Streams::DataWriter _writer = nullptr [private]

Definition at line 224 of file WiFiDirectServicesWrappers.h.

Property Documentation

AdvertisementWrapper Advertisement

Definition at line 37 of file Scenario2_AdvertiserAccept.xaml.h.

unsigned int AdvertisementId

Definition at line 139 of file WiFiDirectServicesWrappers.h.

unsigned int ConfigMethods

Definition at line 140 of file WiFiDirectServicesWrappers.h.

Platform::String Id

Definition at line 32 of file Scenario2_AdvertiserAccept.xaml.h.

Platform::String Pin

Definition at line 34 of file Scenario2_AdvertiserAccept.xaml.h.

Platform::String ProvisioningInfo

Definition at line 33 of file Scenario2_AdvertiserAccept.xaml.h.

Platform::String ServiceAddress

Definition at line 138 of file WiFiDirectServicesWrappers.h.

Platform::String ServiceInfo

Definition at line 141 of file WiFiDirectServicesWrappers.h.

Platform::String ServiceName

Definition at line 137 of file WiFiDirectServicesWrappers.h.

Windows::Storage::Streams::IBuffer SessionInfo

Definition at line 35 of file Scenario2_AdvertiserAccept.xaml.h.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.h
  • WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.h
  • WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.h
  • WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.h
  • WiFiDirectServices/cpp/Scenario5_SendData.xaml.h
  • WiFiDirectServices/cpp/WiFiDirectServicesManager.h
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.h
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SessionRequestWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • SessionRequestWrapper
Public Member Functions | Properties

SessionRequestWrapper Class Reference

Helper class to display session requests in list with extra data. More...

List of all members.

Public Member Functions

SessionRequestWrapper (WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertisement)

Properties

AdvertisementWrapper | Advertisement [get, set]
string | Id [get, set]
string | Pin [get, set]
string | ProvisioningInfo [get, set]
IBuffer | SessionInfo [get, set]

Detailed Description

Definition at line 28 of file Scenario2_AdvertiserAccept.xaml.cs.

Constructor & Destructor Documentation

SessionRequestWrapper | ( | WiFiDirectServiceSessionRequest | request,
 |  | AdvertisementWrapper | advertisement |
 | ) |  |  | [inline]

Definition at line 30 of file Scenario2_AdvertiserAccept.xaml.cs.

            {
                this.Id = request.DeviceInformation.Id;
                this.Advertisement = advertisement;
                this.Pin = "";
                this.ProvisioningInfo = "GroupFormation? " + (request.ProvisioningInfo.IsGroupFormationNeeded ? "Yes" : "No")
                    + ", ConfigMethod: " + request.ProvisioningInfo.SelectedConfigurationMethod.ToString();

                if (request.ProvisioningInfo.SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod.PinDisplay)
                {
                    this.Pin = advertisement.Pin;
                }

                this.SessionInfo = request.SessionInfo;
            }

Property Documentation

AdvertisementWrapper Advertisement [get, set]

Definition at line 51 of file Scenario2_AdvertiserAccept.xaml.cs.

string Id [get, set]

Definition at line 46 of file Scenario2_AdvertiserAccept.xaml.cs.

string Pin [get, set]

Definition at line 48 of file Scenario2_AdvertiserAccept.xaml.cs.

string ProvisioningInfo [get, set]

Definition at line 47 of file Scenario2_AdvertiserAccept.xaml.cs.

IBuffer SessionInfo [get, set]

Definition at line 49 of file Scenario2_AdvertiserAccept.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiDirectServices/cs/Scenario2_AdvertiserAccept.xaml.cs
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SessionWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • SessionWrapper
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

SessionWrapper Class Reference

List of all members.

Public Member Functions

SessionWrapper (WiFiDirectServiceSession session, WiFiDirectServiceManager manager)
async void | AddDatagramSocketAsync (UInt16 port)
void | AddStreamSocketInternal (StreamSocket socket)
async void | AddStreamSocketListenerAsync (UInt16 port)
void | Close ()
void | Dispose ()

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

uint | AdvertisementId [get]
string | ServiceAddress [get]
WiFiDirectServiceSession | Session [get]
string | SessionAddress [get]
uint | SessionId [get]
IList< SocketWrapper > | SocketList [get]

Private Member Functions

~SessionWrapper ()
async void | OnRemotePortAdded (WiFiDirectServiceSession sender, WiFiDirectServiceRemotePortAddedEventArgs args)
void | OnSessionStatusChanged (WiFiDirectServiceSession sender, object args)
void | ThrowIfDisposed ()

Private Attributes

bool | disposed = false
WiFiDirectServiceManager | manager = null
WiFiDirectServiceSession | session
AutoResetEvent | sessionClosedEvent = new AutoResetEvent(false)
IList< SocketWrapper > | socketList = new List<SocketWrapper>()
IList
< StreamSocketListenerWrapper > 		streamSocketListeners = new List<StreamSocketListenerWrapper>()

Detailed Description

Definition at line 679 of file WiFiDirectServiceWrappers.cs.

Constructor & Destructor Documentation

SessionWrapper | ( | WiFiDirectServiceSession | session,
 |  | WiFiDirectServiceManager | manager |
 | ) |  |  | [inline]

Definition at line 694 of file WiFiDirectServiceWrappers.cs.

            {
                this.session = session;
                this.manager = manager;

                this.session.SessionStatusChanged += OnSessionStatusChanged;
                this.session.RemotePortAdded += OnRemotePortAdded;
            }

~SessionWrapper ( ) [inline, private]

Definition at line 922 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(false);
            }

Member Function Documentation

async void AddDatagramSocketAsync ( UInt16 port ) [inline]

Definition at line 788 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                manager.NotifyUser("Adding stream socket listener for UDP port " + port, NotifyType.StatusMessage);

                var endpointPairCollection = session.GetConnectionEndpointPairs();

                DatagramSocket socket = new DatagramSocket();
                // Socket is "read-only", cannot send data but can receive data
                // Expectation is that application starts a listening socket, then remote device sends data
                SocketWrapper socketWrapper = new SocketWrapper(manager, null, socket, false);

                try
                {
                    // Bind UDP socket for receiving messages (peer should call connect and send messages to this socket)
                    manager.NotifyUser("BindEndpointAsync...", NotifyType.StatusMessage);
                    await socket.BindEndpointAsync(endpointPairCollection[0].LocalHostName, Convert.ToString(port, CultureInfo.InvariantCulture));
                    manager.NotifyUser("BindEndpointAsync Done", NotifyType.StatusMessage);

                    manager.NotifyUser("AddDatagramSocketAsync...", NotifyType.StatusMessage);
                    await session.AddDatagramSocketAsync(socket);
                    manager.NotifyUser("AddDatagramSocketAsync Done", NotifyType.StatusMessage);

                    // Update manager so UI can add to list
                    manager.AddSocket(socketWrapper);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("AddDatagramSocketAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }

                socketList.Add(socketWrapper);
            }

void AddStreamSocketInternal ( StreamSocket socket ) [inline]

Definition at line 886 of file WiFiDirectServiceWrappers.cs.

            {
                SocketWrapper socketWrapper = new SocketWrapper(manager, socket, null, true);

                // Start receiving messages recursively
                var rcv = socketWrapper.ReceiveMessageAsync();

                socketList.Add(socketWrapper);
                // Update manager so UI can add to list
                manager.AddSocket(socketWrapper);
            }

async void AddStreamSocketListenerAsync ( UInt16 port ) [inline]

Definition at line 754 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                manager.NotifyUser("Adding stream socket listener for TCP port " + port, NotifyType.StatusMessage);

                var endpointPairCollection = session.GetConnectionEndpointPairs();

                // Create listener for socket connection (and add to list to cleanup later)
                StreamSocketListener listenerSocket = new StreamSocketListener();
                StreamSocketListenerWrapper listenerWrapper = new StreamSocketListenerWrapper(
                    manager,
                    listenerSocket,
                    this
                    );

                try
                {
                    manager.NotifyUser("BindEndpointAsync...", NotifyType.StatusMessage);
                    await listenerSocket.BindEndpointAsync(endpointPairCollection[0].LocalHostName, Convert.ToString(port, CultureInfo.InvariantCulture));
                    manager.NotifyUser("BindEndpointAsync Done", NotifyType.StatusMessage);

                    manager.NotifyUser("AddStreamSocketListenerAsync...", NotifyType.StatusMessage);
                    await session.AddStreamSocketListenerAsync(listenerSocket);
                    manager.NotifyUser("AddStreamSocketListenerAsync Done", NotifyType.StatusMessage);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("AddStreamSocketListenerAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }

                streamSocketListeners.Add(listenerWrapper);
            }

void Close ( ) [inline]

Definition at line 734 of file WiFiDirectServiceWrappers.cs.

            {
                ThrowIfDisposed();

                foreach (var socket in socketList)
                {
                    socket.Dispose();
                }
                socketList.Clear();

                session.Dispose();

                // Wait for status change
                // NOTE: this should complete in 5 seconds under normal circumstances
                if (!sessionClosedEvent.WaitOne(60000))
                {
                    throw new Exception("Timed out waiting for session to close");
                }
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 933 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    // This will close the session
                    session.Dispose();

                    // Remove event handlers
                    session.SessionStatusChanged -= OnSessionStatusChanged;
                    session.RemotePortAdded -= OnRemotePortAdded;

                    foreach (var listener in streamSocketListeners)
                    {
                        listener.Dispose();
                    }
                    streamSocketListeners.Clear();

                    foreach (var socket in socketList)
                    {
                        socket.Dispose();
                    }
                    socketList.Clear();

                    sessionClosedEvent.Dispose();
                }

                disposed = true;
            }

void Dispose ( ) [inline]

Definition at line 927 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

async void OnRemotePortAdded | ( | WiFiDirectServiceSession | sender,
 |  | WiFiDirectServiceRemotePortAddedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 825 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    var endpointPairCollection = args.EndpointPairs;
                    var protocol = args.Protocol;
                    if (endpointPairCollection.Count == 0)
                    {
                        manager.NotifyUser("No endpoint pairs for remote port added event", NotifyType.ErrorMessage);
                        return;
                    }

                    manager.NotifyUser(String.Format("{0} Port {1} Added by remote peer",
                        (protocol == WiFiDirectServiceIPProtocol.Tcp) ? "TCP" : ((protocol == WiFiDirectServiceIPProtocol.Udp) ? "UDP" : "???"),
                        endpointPairCollection[0].RemoteServiceName
                        ),
                        NotifyType.StatusMessage
                        );

                    SocketWrapper socketWrapper = null;

                    if (args.Protocol == WiFiDirectServiceIPProtocol.Tcp)
                    {
                        // Connect to the stream socket listener
                        StreamSocket streamSocket = new StreamSocket();
                        socketWrapper = new SocketWrapper(manager, streamSocket, null, true);

                        manager.NotifyUser("Connecting to stream socket...", NotifyType.StatusMessage);
                        await streamSocket.ConnectAsync(endpointPairCollection[0]);
                        // Start receiving messages recursively
                        var rcv = socketWrapper.ReceiveMessageAsync();
                        manager.NotifyUser("Stream socket connected", NotifyType.StatusMessage);
                    }
                    else if (args.Protocol == WiFiDirectServiceIPProtocol.Udp)
                    {
                        // Connect a socket over UDP
                        DatagramSocket datagramSocket = new DatagramSocket();
                        socketWrapper = new SocketWrapper(manager, null, datagramSocket, true);

                        manager.NotifyUser("Connecting to datagram socket...", NotifyType.StatusMessage);
                        await datagramSocket.ConnectAsync(endpointPairCollection[0]);
                        manager.NotifyUser("Datagram socket connected", NotifyType.StatusMessage);
                    }
                    else
                    {
                        manager.NotifyUser("Bad protocol for remote port added event", NotifyType.ErrorMessage);
                        return;
                    }

                    socketList.Add(socketWrapper);
                    // Update manager so UI can add to list
                    manager.AddSocket(socketWrapper);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnRemotePortAdded Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void OnSessionStatusChanged | ( | WiFiDirectServiceSession | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 898 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    manager.NotifyUser("Session Status Changed to " + session.Status.ToString(), NotifyType.StatusMessage);

                    if (session.Status == WiFiDirectServiceSessionStatus.Closed)
                    {
                        sessionClosedEvent.Set();
                        // Cleanup
                        manager.RemoveSession(this);
                    }
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnSessionStatusChanged Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 967 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("SessionWrapper");
                }
            }

Member Data Documentation

bool disposed = false [private]

Definition at line 920 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceManager manager = null [private]

Definition at line 683 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceSession session [private]

Definition at line 681 of file WiFiDirectServiceWrappers.cs.

AutoResetEvent sessionClosedEvent = new AutoResetEvent(false) [private]

Definition at line 692 of file WiFiDirectServiceWrappers.cs.

IList<SocketWrapper> socketList = new List<SocketWrapper>() [private]

Definition at line 689 of file WiFiDirectServiceWrappers.cs.

IList<StreamSocketListenerWrapper> streamSocketListeners = new List<StreamSocketListenerWrapper>() [private]

Definition at line 686 of file WiFiDirectServiceWrappers.cs.

Property Documentation

uint AdvertisementId [get]

Definition at line 711 of file WiFiDirectServiceWrappers.cs.

string ServiceAddress [get]

Definition at line 720 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceSession Session [get]

Definition at line 706 of file WiFiDirectServiceWrappers.cs.

string SessionAddress [get]

Definition at line 725 of file WiFiDirectServiceWrappers.cs.

uint SessionId [get]

Definition at line 715 of file WiFiDirectServiceWrappers.cs.

IList<SocketWrapper> SocketList [get]

Definition at line 730 of file WiFiDirectServiceWrappers.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • SocketWrapper
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

SocketWrapper Class Reference

List of all members.

Public Member Functions

SocketWrapper (WiFiDirectServiceManager manager, StreamSocket streamSocket=null, DatagramSocket datagramSocket=null, bool canSend=true)
void | Dispose ()
async Task | ReceiveMessageAsync ()
async Task | SendMessageAsync (string message)

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

string | Port [get]
string | Protocol [get]

Private Member Functions

~SocketWrapper ()
async Task | HandleReceivedMessage (DataReader datareader, bool load=true)
async void | OnUDPMessageReceived (DatagramSocket sender, DatagramSocketMessageReceivedEventArgs args)
void | ThrowIfDisposed ()

Private Attributes

DatagramSocket | datagramSocket = null
bool | disposed = false
WiFiDirectServiceManager | manager = null
DataReader | reader = null
StreamSocket | streamSocket = null
DataWriter | writer

Detailed Description

Definition at line 1054 of file WiFiDirectServiceWrappers.cs.

Constructor & Destructor Documentation

SocketWrapper | ( | WiFiDirectServiceManager | manager,
 |  | StreamSocket | streamSocket = null,
 |  | DatagramSocket | datagramSocket = null,
 |  | bool | canSend = true |
 | ) |  |  | [inline]

Definition at line 1064 of file WiFiDirectServiceWrappers.cs.

            {
                this.streamSocket = streamSocket;
                this.datagramSocket = datagramSocket;
                this.manager = manager;

                if (streamSocket == null && datagramSocket == null)
                {
                    throw new Exception("Bad SocketWrapper parameters, must provide a TCP or UDP socket");
                }
                else if (streamSocket != null && datagramSocket != null)
                {
                    throw new Exception("Bad SocketWrapper parameters, got both TCP and UDP socket, expected only one");
                }
                else if (streamSocket != null)
                {
                    reader = new DataReader(streamSocket.InputStream);
                    if (canSend)
                    {
                        writer = new DataWriter(streamSocket.OutputStream);
                    }
                }
                else
                {
                    datagramSocket.MessageReceived += OnUDPMessageReceived;
                    if (canSend)
                    {
                        writer = new DataWriter(datagramSocket.OutputStream);
                    }
                }

                if (reader != null)
                {
                    reader.UnicodeEncoding = UnicodeEncoding.Utf8;
                    reader.ByteOrder = ByteOrder.LittleEndian;
                }

                if (writer != null)
                {
                    writer.UnicodeEncoding = UnicodeEncoding.Utf8;
                    writer.ByteOrder = ByteOrder.LittleEndian;
                }
            }

~SocketWrapper ( ) [inline, private]

Definition at line 1290 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(false);
            }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 1295 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 1301 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    if (streamSocket != null)
                    {
                        streamSocket.Dispose();
                    }

                    if (datagramSocket != null)
                    {
                        datagramSocket.Dispose();
                        datagramSocket.MessageReceived -= OnUDPMessageReceived;
                    }

                    if (writer != null)
                    {
                        writer.Dispose();
                    }

                    if (reader != null)
                    {
                        reader.Dispose();
                    }
                }

                disposed = true;
            }

async Task HandleReceivedMessage | ( | DataReader | datareader,
 |  | bool | load = true |
 | ) |  |  | [inline, private]

Handle both TCP receive call and UDP event handler.

Parameters:
datareader
load Set to true when the datareader.LoadAsync needs to be called for TCP
Returns:

Definition at line 1202 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();
                    uint bytesRead = 0;

                    if (load)
                    {
                        bytesRead = await datareader.LoadAsync(sizeof(uint));

                        if (bytesRead != sizeof(uint))
                        {
                            manager.NotifyUser("The underlying socket was closed before we were able to read the whole data.", NotifyType.ErrorMessage);
                            return;
                        }
                    }

                    if (!load || bytesRead > 0)
                    {
                        // Determine how long the string is.
                        uint messageLength = (uint)datareader.ReadUInt32();

                        if (load)
                        {
                            bytesRead = await datareader.LoadAsync(messageLength);
                            if (bytesRead != messageLength)
                            {
                                manager.NotifyUser("The underlying socket was closed before we were able to read the whole data.", NotifyType.ErrorMessage);
                                return;
                            }
                        }

                        if ((!load && messageLength > 0) || bytesRead > 0)
                        {
                            // Decode the string.
                            string currentMessage = datareader.ReadString(messageLength);
                            uint bytesReceived = messageLength;

                            // Just print a message for now
                            manager.NotifyUser(String.Format("Received Message: \"{0}\", {1} bytes",
                                    (currentMessage.Length > 32) ? currentMessage.Substring(0, 32) + "..." : currentMessage,
                                    bytesReceived
                                    ),
                                NotifyType.StatusMessage
                                );

                            // TCP will need to call this again, UDP will get callbacks
                            if (load)
                            {
                                await HandleReceivedMessage(datareader, load);
                            }
                        }
                        else
                        {
                            manager.NotifyUser("ReceiveMessage 0 bytes loaded for message content.", NotifyType.ErrorMessage);
                        }
                    }
                    else
                    {
                        manager.NotifyUser("ReceiveMessage 0 bytes loaded for message content.", NotifyType.ErrorMessage);
                    }
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("HandleReceivedMessage Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

async void OnUDPMessageReceived | ( | DatagramSocket | sender,
 |  | DatagramSocketMessageReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 1271 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    DataReader udpReader = args.GetDataReader();
                    udpReader.UnicodeEncoding = UnicodeEncoding.Utf8;
                    udpReader.ByteOrder = ByteOrder.LittleEndian;

                    await HandleReceivedMessage(udpReader, false);
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("OnUDPMessageReceived Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

async Task ReceiveMessageAsync ( ) [inline]

Read strings sent over the TCP socket Reads the uint32 size then the actual string.

Definition at line 1191 of file WiFiDirectServiceWrappers.cs.

            {
                await HandleReceivedMessage(this.reader);
            }

async Task SendMessageAsync ( string message ) [inline]

Send a string over the socket (TCP or UDP) Will send as a uint32 size followed by the message.

Parameters:
message Message to send

Definition at line 1155 of file WiFiDirectServiceWrappers.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    if (writer == null)
                    {
                        manager.NotifyUser("Socket is unable to send messages (receive only socket).", NotifyType.ErrorMessage);
                    }
                    else
                    {
                        writer.WriteUInt32(writer.MeasureString(message));
                        writer.WriteString(message);
                        await writer.StoreAsync();

                        uint bytesSent = writer.MeasureString(message);

                        manager.NotifyUser(String.Format("Sent Message: \"{0}\", {1} bytes",
                                (message.Length > 32) ? message.Substring(0, 32) + "..." : message,
                                bytesSent
                                ),
                            NotifyType.StatusMessage
                            );
                    }
                }
                catch (Exception ex)
                {
                    manager.NotifyUser("SendMessageAsync Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 1335 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("SocketWrapper");
                }
            }

Member Data Documentation

DatagramSocket datagramSocket = null [private]

Definition at line 1057 of file WiFiDirectServiceWrappers.cs.

bool disposed = false [private]

Definition at line 1288 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceManager manager = null [private]

Definition at line 1059 of file WiFiDirectServiceWrappers.cs.

DataReader reader = null [private]

Definition at line 1061 of file WiFiDirectServiceWrappers.cs.

StreamSocket streamSocket = null [private]

Definition at line 1056 of file WiFiDirectServiceWrappers.cs.

DataWriter writer [private]

Definition at line 1062 of file WiFiDirectServiceWrappers.cs.

Property Documentation

string Port [get]

Definition at line 1132 of file WiFiDirectServiceWrappers.cs.

string Protocol [get]

Definition at line 1113 of file WiFiDirectServiceWrappers.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocketListenerWrapper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • StreamSocketListenerWrapper
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

StreamSocketListenerWrapper Class Reference

List of all members.

Public Member Functions

StreamSocketListenerWrapper (WiFiDirectServiceManager manager, StreamSocketListener streamSocketListener, SessionWrapper session)
void | Dispose ()

Protected Member Functions

virtual void | Dispose (bool disposing)

Private Member Functions

~StreamSocketListenerWrapper ()
void | OnConnectionReceived (StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
void | ThrowIfDisposed ()

Private Attributes

bool | disposed = false
WiFiDirectServiceManager | manager = null
SessionWrapper | session = null
StreamSocketListener | streamSocketListener

Detailed Description

Definition at line 977 of file WiFiDirectServiceWrappers.cs.

Constructor & Destructor Documentation

StreamSocketListenerWrapper | ( | WiFiDirectServiceManager | manager,
 |  | StreamSocketListener | streamSocketListener,
 |  | SessionWrapper | session |
 | ) |  |  | [inline]

Definition at line 985 of file WiFiDirectServiceWrappers.cs.

            {
                this.streamSocketListener = streamSocketListener;
                this.session = session;
                this.manager = manager;

                this.streamSocketListener.ConnectionReceived += OnConnectionReceived;
            }

~StreamSocketListenerWrapper ( ) [inline, private]

Definition at line 1008 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(false);
            }

Member Function Documentation

void Dispose ( ) [inline]

Definition at line 1013 of file WiFiDirectServiceWrappers.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 1019 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    try
                    {
                        streamSocketListener.ConnectionReceived -= OnConnectionReceived;
                    }
                    catch (Exception)
                    { }

                    streamSocketListener.Dispose();
                }

                disposed = true;
            }

void OnConnectionReceived | ( | StreamSocketListener | sender,
 |  | StreamSocketListenerConnectionReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 998 of file WiFiDirectServiceWrappers.cs.

            {
                manager.NotifyUser("Connection received for TCP Port " + sender.Information.LocalPort, NotifyType.StatusMessage);

                session.AddStreamSocketInternal(args.Socket);
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 1041 of file WiFiDirectServiceWrappers.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("StreamSocketListenerWrapper");
                }
            }

Member Data Documentation

bool disposed = false [private]

Definition at line 1006 of file WiFiDirectServiceWrappers.cs.

WiFiDirectServiceManager manager = null [private]

Definition at line 981 of file WiFiDirectServiceWrappers.cs.

SessionWrapper session = null [private]

Definition at line 983 of file WiFiDirectServiceWrappers.cs.

StreamSocketListener streamSocketListener [private]

Definition at line 979 of file WiFiDirectServiceWrappers.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServiceManager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiDirectServices
  • WiFiDirectServiceManager
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

WiFiDirectServiceManager Class Reference

Common class to wrap all of the services objects and state behind the UI. More...

List of all members.

Public Member Functions

void | AddSession (SessionWrapper session)
void | AddSessionRequest (WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser)
void | AddSocket (SocketWrapper socket)
void | AdvertiserStatusChanged (AdvertisementWrapper advertiser)
void | CloseSession (int index)
async void | DiscoverServicesAsync (string serviceName, string requestedServiceInfo)
void | Dispose ()
async void | NotifyUser (string message, NotifyType type)
void | RemoveAdvertiser (AdvertisementWrapper advertiser)
void | RemoveSession (int index)
void | RemoveSession (SessionWrapper session)
void | RemoveSessionRequest (WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser)
void | SelectSession (int index)
void | StartAdvertisement (string serviceName, bool autoAccept, bool preferGO, string pin, IList< WiFiDirectServiceConfigurationMethod > configMethods, WiFiDirectServiceStatus status, uint customStatus, string serviceInfo, string deferredServiceInfo, IList< String > prefixList)
void | UnpublishService (int index)

Protected Member Functions

virtual void | Dispose (bool disposing)

Properties

IList< AdvertisementWrapper > | Advertisers [get]
IList< SessionWrapper > | ConnectedSessionList [get]
SessionWrapper | CurrentSession [get]
IList< DiscoveredDeviceWrapper > | DiscoveredDevices [get]
static WiFiDirectServiceManager | Instance [get]
MainPage | RootPage [get]
Scenario1 | Scenario1 [get, set]
Scenario2 | Scenario2 [get, set]
Scenario3 | Scenario3 [get, set]
Scenario4 | Scenario4 [get, set]
Scenario5 | Scenario5 [get, set]

Private Member Functions

WiFiDirectServiceManager ()
~WiFiDirectServiceManager ()
void | AddAdvertiser (AdvertisementWrapper advertiser)
void | RemoveAdvertiser (int index)
void | ThrowIfDisposed ()

Private Attributes

IList< AdvertisementWrapper > | advertisers = new List<AdvertisementWrapper>()
IList< SessionWrapper > | connectedSessions = new List<SessionWrapper>()
IList< DiscoveredDeviceWrapper > | discoveredDevices = new List<DiscoveredDeviceWrapper>()
bool | disposed = false
MainPage rootPage
Scenario1 | scenario1 = null
Scenario2 | scenario2 = null
Scenario3 | scenario3 = null
Scenario4 | scenario4 = null
Scenario5 | scenario5 = null
int | selectedSession = -1
Object | thisLock = new Object()

Static Private Attributes

static WiFiDirectServiceManager | instance

Detailed Description

Definition at line 28 of file WiFiDirectServiceManager.cs.

Constructor & Destructor Documentation

WiFiDirectServiceManager ( ) [inline, private]

Definition at line 59 of file WiFiDirectServiceManager.cs.

            {
                instance = this;
                this.rootPage = MainPage.Current;
            }

~WiFiDirectServiceManager ( ) [inline, private]

Definition at line 583 of file WiFiDirectServiceManager.cs.

            {
                Dispose(false);
            }

Member Function Documentation

void AddAdvertiser ( AdvertisementWrapper advertiser ) [inline, private]

Definition at line 371 of file WiFiDirectServiceManager.cs.

            {
                lock (thisLock)
                {
                    advertisers.Add(advertiser);
                }

                // Update UI to add this to list
                if (scenario2 != null)
                {
                    scenario2.AddAdvertiser(advertiser);
                }
            }

void AddSession ( SessionWrapper session ) [inline]

Definition at line 462 of file WiFiDirectServiceManager.cs.

            {
                lock (thisLock)
                {
                    connectedSessions.Add(session);
                }

                // Update UI to add this to list
                if (scenario2 != null)
                {
                    scenario2.AddSession(session);
                }
                if (scenario4 != null)
                {
                    scenario4.AddSession(session);
                }

                if (scenario3 != null)
                {
                    scenario3.SessionConnected();
                }
            }

void AddSessionRequest | ( | WiFiDirectServiceSessionRequest | request,
 |  | AdvertisementWrapper | advertiser |
 | ) |  |  | [inline]

Definition at line 428 of file WiFiDirectServiceManager.cs.

            {
                // Update UI to add this to list
                if (scenario2 != null)
                {
                    scenario2.AddSessionRequest(request, advertiser);
                }
            }

void AddSocket ( SocketWrapper socket ) [inline]

Definition at line 570 of file WiFiDirectServiceManager.cs.

            {
                // Update UI to add this to list
                if (scenario5 != null)
                {
                    scenario5.AddSocket(socket);
                }
            }

void AdvertiserStatusChanged ( AdvertisementWrapper advertiser ) [inline]

Definition at line 446 of file WiFiDirectServiceManager.cs.

            {
                if (advertiser.Advertiser.AdvertisementStatus == WiFiDirectServiceAdvertisementStatus.Aborted ||
                    advertiser.Advertiser.AdvertisementStatus == WiFiDirectServiceAdvertisementStatus.Stopped)
                {
                    RemoveAdvertiser(advertiser);
                }
                else
                {
                    if (scenario2 != null)
                    {
                        scenario2.UpdateAdvertiserStatus(advertiser);
                    }
                }
            }

void CloseSession ( int index ) [inline]

Definition at line 537 of file WiFiDirectServiceManager.cs.

            {
                SessionWrapper session = null;

                // First remove from list
                lock (thisLock)
                {
                    if (index > connectedSessions.Count - 1)
                    {
                        throw new IndexOutOfRangeException("Attempted to close session not found in list");
                    }

                    session = connectedSessions[index];
                    // Session will remove self from list when its status changes
                }

                // Close session by disposing underlying WiFiDirectServiceSession
                session.Close();
                RootPage.NotifyUser("Closed Session", NotifyType.StatusMessage);
            }

async void DiscoverServicesAsync | ( | string | serviceName,
 |  | string | requestedServiceInfo |
 | ) |  |  | [inline]

Definition at line 302 of file WiFiDirectServiceManager.cs.

            {
                try
                {
                    ThrowIfDisposed();

                    RootPage.NotifyUser("Discover services... (name='" + serviceName + "', requestedInfo='" + requestedServiceInfo + "')", NotifyType.StatusMessage);

                    // Clear old results
                    discoveredDevices.Clear();

                    // Discovery depends on whether service information is requested
                    string serviceSelector = "";
                    if (requestedServiceInfo == "")
                    {
                        // Just search by name
                        serviceSelector = WiFiDirectService.GetSelector(serviceName);
                    }
                    else
                    {
                        using (var serviceInfoDataWriter = new DataWriter(new InMemoryRandomAccessStream()))
                        {
                            serviceInfoDataWriter.WriteString(requestedServiceInfo);
                            // Discover by name and try to discover service information
                            serviceSelector = WiFiDirectService.GetSelector(serviceName, serviceInfoDataWriter.DetachBuffer());
                        }
                    }

                    List<string> additionalProperties = new List<string>();
                    additionalProperties.Add("System.Devices.WiFiDirectServices.ServiceAddress");
                    additionalProperties.Add("System.Devices.WiFiDirectServices.ServiceName");
                    additionalProperties.Add("System.Devices.WiFiDirectServices.ServiceInformation");
                    additionalProperties.Add("System.Devices.WiFiDirectServices.AdvertisementId");
                    additionalProperties.Add("System.Devices.WiFiDirectServices.ServiceConfigMethods");

                    // Note: This sample demonstrates finding services with FindAllAsync, which does a discovery and returns a list
                    // It is also possible to use DeviceWatcher to receive updates as soon as services are found and to continue the discovery until it is stopped
                    // See the DeviceWatcher sample for an example on how to use that class instead of DeviceInformation.FindAllAsync
                    DeviceInformationCollection deviceInfoCollection = await DeviceInformation.FindAllAsync(serviceSelector, additionalProperties);

                    if (deviceInfoCollection != null && deviceInfoCollection.Count > 0)
                    {
                        RootPage.NotifyUser("Done discovering services, found " + deviceInfoCollection.Count + " services", NotifyType.StatusMessage);

                        foreach (var device in deviceInfoCollection)
                        {
                            discoveredDevices.Add(new DiscoveredDeviceWrapper(device, this));
                        }
                    }
                    else
                    {
                        RootPage.NotifyUser("Done discovering services, No services found", NotifyType.StatusMessage);
                    }

                    // Update UI list
                    if (scenario3 != null)
                    {
                        scenario3.UpdateDiscoveryList(discoveredDevices);
                    }
                }
                catch (Exception ex)
                {
                    RootPage.NotifyUser(String.Format("Failed to discover services: {0}", ex.Message), NotifyType.ErrorMessage);
                    throw ex;
                }
            }

void Dispose ( ) [inline]

Definition at line 588 of file WiFiDirectServiceManager.cs.

            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }

virtual void Dispose ( bool disposing ) [inline, protected, virtual]

Definition at line 594 of file WiFiDirectServiceManager.cs.

            {
                if (disposed)
                {
                    return;
                }

                if (disposing)
                {
                    foreach (var advertiser in advertisers)
                    {
                        advertiser.Dispose();
                    }
                    advertisers.Clear();

                    foreach (var device in discoveredDevices)
                    {
                        device.Dispose();
                    }
                    discoveredDevices.Clear();

                    foreach (var session in connectedSessions)
                    {
                        session.Dispose();
                    }
                    connectedSessions.Clear();
                }

                disposed = true;
            }

async void NotifyUser | ( | string | message,
 |  | NotifyType | type |
 | ) |  |  | [inline]

Definition at line 78 of file WiFiDirectServiceManager.cs.

            {
                // Always dispatch to UI thread
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser(message, type);
                });
            }

void RemoveAdvertiser ( int index ) [inline, private]

Definition at line 385 of file WiFiDirectServiceManager.cs.

            {
                lock (thisLock)
                {
                    advertisers.RemoveAt(index);
                }

                // Update UI to remove from list
                if (scenario2 != null)
                {
                    scenario2.RemoveAdvertiser(index);
                }
            }

void RemoveAdvertiser ( AdvertisementWrapper advertiser ) [inline]

Definition at line 399 of file WiFiDirectServiceManager.cs.

            {
                int index = 0;
                bool fFound = false;

                lock (thisLock)
                {
                    // Lookup the index
                    foreach (var a in advertisers)
                    {
                        if (a.InternalId == advertiser.InternalId)
                        {
                            fFound = true;
                            break;
                        }
                        ++index;
                    }
                }

                if (fFound)
                {
                    RemoveAdvertiser(index);
                }
                else
                {
                    NotifyUser("Advertiser not found in list", NotifyType.ErrorMessage);
                }
            }

void RemoveSession ( SessionWrapper session ) [inline]

Definition at line 505 of file WiFiDirectServiceManager.cs.

            {
                int index = 0;
                bool fFound = false;

                lock (thisLock)
                {
                    // Lookup the index
                    foreach (var s in connectedSessions)
                    {
                        if (s.Session.SessionId == session.Session.SessionId &&
                            s.Session.SessionAddress == session.Session.SessionAddress &&
                            s.Session.AdvertisementId == session.Session.AdvertisementId &&
                            s.Session.ServiceAddress == session.Session.ServiceAddress)
                        {
                            fFound = true;
                            break;
                        }
                        ++index;
                    }
                }

                if (fFound)
                {
                    RemoveSession(index);
                }
                else
                {
                    NotifyUser("Session not found in list", NotifyType.ErrorMessage);
                }
            }

void RemoveSession ( int index ) [inline]

Definition at line 485 of file WiFiDirectServiceManager.cs.

            {
                lock (thisLock)
                {
                    // Invalidate selection
                    selectedSession = -1;
                    connectedSessions.RemoveAt(index);
                }

                // Update UI to remove from list
                if (scenario2 != null)
                {
                    scenario2.RemoveSession(index);
                }
                if (scenario4 != null)
                {
                    scenario4.RemoveSession(index);
                }
            }

void RemoveSessionRequest | ( | WiFiDirectServiceSessionRequest | request,
 |  | AdvertisementWrapper | advertiser |
 | ) |  |  | [inline]

Definition at line 437 of file WiFiDirectServiceManager.cs.

            {
                // Update UI to remove from list
                if (scenario2 != null)
                {
                    scenario2.RemoveSessionRequest(request, advertiser);
                }
            }

void SelectSession ( int index ) [inline]

Definition at line 558 of file WiFiDirectServiceManager.cs.

            {
                lock (thisLock)
                {
                    if (index > connectedSessions.Count - 1)
                    {
                        throw new IndexOutOfRangeException("Attempted to select session not found in list");
                    }
                    selectedSession = index;
                }
            }

void StartAdvertisement | ( | string | serviceName,
 |  | bool | autoAccept,
 |  | bool | preferGO,
 |  | string | pin,
 |  | IList< WiFiDirectServiceConfigurationMethod > | configMethods,
 |  | WiFiDirectServiceStatus | status,
 |  | uint | customStatus,
 |  | string | serviceInfo,
 |  | string | deferredServiceInfo,
 |  | IList< String > | prefixList |
 | ) |  |  | [inline]

Definition at line 159 of file WiFiDirectServiceManager.cs.

            {
                ThrowIfDisposed();

                // Create Advertiser object for the service
                // NOTE: service name is internally limited to up to 255 bytes in UTF-8 encoding
                // Valid characters include alpha-numeric, '.', '-', and any multi-byte character
                // characters a-z, A-Z are case-insensitive when discovering services
                WiFiDirectServiceAdvertiser advertiser = new WiFiDirectServiceAdvertiser(serviceName);

                // Auto-accept services will connect without interaction from advertiser
                // NOTE: if the config method used for a connection requires a PIN, then the advertiser will have to accept the connection
                advertiser.AutoAcceptSession = autoAccept;

                // Set the Group Owner intent to a large value so that the advertiser will try to become the group owner (GO)
                // NOTE: The GO of a P2P connection can connect to multiple clients while the client can connect to a single GO only
                advertiser.PreferGroupOwnerMode = preferGO;

                // Default status is "Available", but services may use a custom status code (value > 1) if applicable
                advertiser.ServiceStatus = status;
                advertiser.CustomServiceStatusCode = customStatus;

                // Service information can be up to 65000 bytes.
                // Service Seeker may explicitly discover this by specifying a short buffer that is a subset of this buffer.
                // If seeker portion matches, then entire buffer is returned, otherwise, the service information is not returned to the seeker
                // This sample uses a string for the buffer but it can be any data
                if (serviceInfo != null && serviceInfo.Length > 0)
                {
                    using (var tempStream = new Windows.Storage.Streams.InMemoryRandomAccessStream())
                    {
                        using (var serviceInfoDataWriter = new Windows.Storage.Streams.DataWriter(tempStream))
                        {
                            serviceInfoDataWriter.WriteString(serviceInfo);
                            advertiser.ServiceInfo = serviceInfoDataWriter.DetachBuffer();
                        }
                    }
                }
                else
                {
                    advertiser.ServiceInfo = null;
                }

                // This is a buffer of up to 144 bytes that is sent to the seeker in case the connection is "deferred" (i.e. not auto-accepted)
                // This buffer will be sent when auto-accept is false, or if a PIN is required to complete the connection
                // For the sample, we use a string, but it can contain any data
                if (deferredServiceInfo != null && deferredServiceInfo.Length > 0)
                {
                    using (var tempStream = new Windows.Storage.Streams.InMemoryRandomAccessStream())
                    {
                        using (var deferredSessionInfoDataWriter = new Windows.Storage.Streams.DataWriter(tempStream))
                        {
                            deferredSessionInfoDataWriter.WriteString(deferredServiceInfo);
                            advertiser.DeferredSessionInfo = deferredSessionInfoDataWriter.DetachBuffer();
                        }
                    }
                }
                else
                {
                    advertiser.DeferredSessionInfo = null;
                }

                // The advertiser supported configuration methods
                // Valid values are PIN-only (either keypad entry, display, or both), or PIN (keypad entry, display, or both) and WFD Services default
                // WFD Services Default config method does not require explicit PIN entry and offers a more seamless connection experience
                // Typically, an advertiser will support PIN display (and WFD Services Default), and a seeker will connect with either PIN entry or WFD Services Default
                if (configMethods != null)
                {
                    advertiser.PreferredConfigurationMethods.Clear();
                    foreach (var configMethod in configMethods)
                    {
                        advertiser.PreferredConfigurationMethods.Add(configMethod);
                    }
                }

                // Advertiser may also be discoverable by a prefix of the service name. Must explicitly specify prefixes allowed here.
                if (prefixList != null && prefixList.Count > 0)
                {
                    advertiser.ServiceNamePrefixes.Clear();
                    foreach (var prefix in prefixList)
                    {
                        advertiser.ServiceNamePrefixes.Add(prefix);
                    }
                }

                // For this sample, we wrap the advertiser in our own object which handles the advertiser events
                AdvertisementWrapper advertiserWrapper = new AdvertisementWrapper(advertiser, this, pin);

                AddAdvertiser(advertiserWrapper);

                RootPage.NotifyUser("Starting service...", NotifyType.StatusMessage);

                try
                {
                    // This may fail if the driver is unable to handle the request or if services is not supported
                    // NOTE: this must be called from the UI thread of the app
                    advertiser.Start();
                }
                catch (Exception ex)
                {
                    RootPage.NotifyUser(String.Format(CultureInfo.InvariantCulture, "Failed to start service: {0}", ex.Message), NotifyType.ErrorMessage);
                    throw;
                }
            }

void ThrowIfDisposed ( ) [inline, private]

Definition at line 625 of file WiFiDirectServiceManager.cs.

            {
                if (disposed)
                {
                    throw new ObjectDisposedException("WiFiDirectServiceManager");
                }
            }

void UnpublishService ( int index ) [inline]

Definition at line 274 of file WiFiDirectServiceManager.cs.

            {
                ThrowIfDisposed();

                AdvertisementWrapper advertiser = null;

                lock (thisLock)
                {
                    if (index > advertisers.Count - 1)
                    {
                        throw new IndexOutOfRangeException("Attempted to stop service not found in list");
                    }

                    advertiser = advertisers[index];
                }

                try
                {
                    advertiser.Advertiser.Stop();
                }
                catch (Exception ex)
                {
                    RootPage.NotifyUser("Stop Advertisement Failed: " + ex.Message, NotifyType.ErrorMessage);
                }
            }

Member Data Documentation

IList<AdvertisementWrapper> advertisers = new List<AdvertisementWrapper>() [private]

Definition at line 44 of file WiFiDirectServiceManager.cs.

IList<SessionWrapper> connectedSessions = new List<SessionWrapper>() [private]

Definition at line 51 of file WiFiDirectServiceManager.cs.

IList<DiscoveredDeviceWrapper> discoveredDevices = new List<DiscoveredDeviceWrapper>() [private]

Definition at line 47 of file WiFiDirectServiceManager.cs.

bool disposed = false [private]

Definition at line 581 of file WiFiDirectServiceManager.cs.

WiFiDirectServiceManager instance [static, private]

Definition at line 58 of file WiFiDirectServiceManager.cs.

MainPage rootPage [private]

Definition at line 32 of file WiFiDirectServiceManager.cs.

Scenario1 scenario1 = null [private]

Definition at line 37 of file WiFiDirectServiceManager.cs.

Scenario2 scenario2 = null [private]

Definition at line 38 of file WiFiDirectServiceManager.cs.

Scenario3 scenario3 = null [private]

Definition at line 39 of file WiFiDirectServiceManager.cs.

Scenario4 scenario4 = null [private]

Definition at line 40 of file WiFiDirectServiceManager.cs.

Scenario5 scenario5 = null [private]

Definition at line 41 of file WiFiDirectServiceManager.cs.

int selectedSession = -1 [private]

Definition at line 55 of file WiFiDirectServiceManager.cs.

Object thisLock = new Object() [private]

Definition at line 30 of file WiFiDirectServiceManager.cs.

Property Documentation

IList<AdvertisementWrapper> Advertisers [get]

Definition at line 132 of file WiFiDirectServiceManager.cs.

IList<SessionWrapper> ConnectedSessionList [get]

Definition at line 154 of file WiFiDirectServiceManager.cs.

SessionWrapper CurrentSession [get]

Definition at line 137 of file WiFiDirectServiceManager.cs.

IList<DiscoveredDeviceWrapper> DiscoveredDevices [get]

Definition at line 149 of file WiFiDirectServiceManager.cs.

WiFiDirectServiceManager Instance [static, get]

Definition at line 67 of file WiFiDirectServiceManager.cs.

MainPage RootPage [get]

Definition at line 89 of file WiFiDirectServiceManager.cs.

Scenario1 Scenario1 [get, set]

Definition at line 101 of file WiFiDirectServiceManager.cs.

Scenario2 Scenario2 [get, set]

Definition at line 107 of file WiFiDirectServiceManager.cs.

Scenario3 Scenario3 [get, set]

Definition at line 113 of file WiFiDirectServiceManager.cs.

Scenario4 Scenario4 [get, set]

Definition at line 119 of file WiFiDirectServiceManager.cs.

Scenario5 Scenario5 [get, set]

Definition at line 125 of file WiFiDirectServiceManager.cs.

The documentation for this class was generated from the following files:
  • WiFiDirectServices/cs/WiFiDirectServiceManager.cs
  • WiFiDirectServices/cpp/WiFiDirectServicesManager.cpp
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WiFiScan
  • sealed
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "DisplayHelpers.h"

List of all members.

Public Member Functions

Scenario1_CachedNetworks ()
Scenario2_Scan ()
Scenario3_RegisterForUpdates ()
Scenario4_Connect ()
WiFiNetworkDisplay (Windows::Devices::WiFi::WiFiAvailableNetwork^availableNetwork, Windows::Devices::WiFi::WiFiAdapter^adapter)

Protected Member Functions

void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override
void | OnPropertyChanged (Platform::String^name)

Static Protected Member Functions

static Platform::String | GetConnectivityLevelAsString (Windows::Networking::Connectivity::NetworkConnectivityLevel conectivityLevel)
static Concurrency::task< void > | UpdateConnectivityLevels (Windows::Foundation::Collections::IObservableVector< WiFiNetworkDisplay^>^networkCollection, UINT current)

Protected Attributes

internal | __pad0__: static Platform::String^ GetConnectionStatusAsString(Windows::Devices::WiFi::WiFiConnectionStatus connectionStatus)

Properties

Platform::String | ConnectivityLevel
virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler 		PropertyChanged
Windows::Foundation::Collections::IObservableVector
< WiFiNetworkDisplay^> 		ResultCollection
Windows::UI::Xaml::Media::Imaging::BitmapImage | WiFiImage

Private Member Functions

void | Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Button_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Button_Click_Register (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Button_Click_Unregister (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | ConnectButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DisconnectButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DisplayNetworkReport (Windows::Devices::WiFi::WiFiNetworkReport^report)
void | DisplayNetworkReport (Windows::Devices::WiFi::WiFiNetworkReport^report, Windows::Devices::WiFi::WiFiAdapter^adapter)
void | DisplayNetworkReport (Windows::Devices::WiFi::WiFiNetworkReport^report)
void | DisplayNetworkReport (Windows::Devices::WiFi::WiFiNetworkReport^report, Windows::Devices::WiFi::WiFiAdapter^adapter)
Platform::String | GetNetworkAuthenticationTypeAsString (Windows::Networking::Connectivity::NetworkAuthenticationType authenticationType)
Platform::String | GetNetworkEncryptionTypeAsString (Windows::Networking::Connectivity::NetworkEncryptionType encryptionType)
void | OnAvailableNetworksChanged (Windows::Devices::WiFi::WiFiAdapter^sender, Platform::Object^args)
void | OnNetworkStatusChanged (Platform::Object^sender)
void | ResultsListView_SelectionChanged (Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e)
void | ScanButton_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
Concurrency::task< void > | UpdateConnectivityLevel ()
void | UpdateConnectivityStatus ()
void | UpdateWiFiImage ()

Private Attributes

Windows::Devices::WiFi::WiFiAdapter | _firstAdapter
Windows::Foundation::EventRegistrationToken | _registrationToken
MainPage _rootPage
Platform::String | _savedProfileName
Windows::Foundation::Collections::IVectorView
< Windows::Devices::WiFi::WiFiAdapter^> 		_wiFiAdapters
Windows::Devices::WiFi::WiFiAdapter | adapter

Detailed Description

Definition at line 20 of file DisplayHelpers.h.

Member Function Documentation

void Button_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Button_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Button_Click_Register | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Button_Click_Unregister | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void ConnectButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DisconnectButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DisplayNetworkReport ( Windows::Devices::WiFi::WiFiNetworkReport^ report ) [private]
void DisplayNetworkReport | ( | Windows::Devices::WiFi::WiFiNetworkReport^ | report,
 |  | Windows::Devices::WiFi::WiFiAdapter^ | adapter |
 | ) |  |  | [private]
void DisplayNetworkReport ( Windows::Devices::WiFi::WiFiNetworkReport^ report ) [private]
void DisplayNetworkReport | ( | Windows::Devices::WiFi::WiFiNetworkReport^ | report,
 |  | Windows::Devices::WiFi::WiFiAdapter^ | adapter |
 | ) |  |  | [private]
static Platform::String GetConnectivityLevelAsString ( Windows::Networking::Connectivity::NetworkConnectivityLevel conectivityLevel ) [static, protected]
Platform::String GetNetworkAuthenticationTypeAsString ( Windows::Networking::Connectivity::NetworkAuthenticationType authenticationType ) [private]
Platform::String GetNetworkEncryptionTypeAsString ( Windows::Networking::Connectivity::NetworkEncryptionType encryptionType ) [private]
void OnAvailableNetworksChanged | ( | Windows::Devices::WiFi::WiFiAdapter^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs^ e ) [override, protected]
void OnNetworkStatusChanged ( Platform::Object^ sender ) [private]
void OnPropertyChanged ( Platform::String^ name ) [protected]
void ResultsListView_SelectionChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ | e |
 | ) |  |  | [private]
void ScanButton_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Scenario1_CachedNetworks ( )
Scenario2_Scan ( )
Scenario3_RegisterForUpdates ( )
Scenario4_Connect ( )
Concurrency::task<void> UpdateConnectivityLevel ( ) [private]
static Concurrency::task<void> UpdateConnectivityLevels | ( | Windows::Foundation::Collections::IObservableVector< WiFiNetworkDisplay^>^ | networkCollection,
 |  | UINT | current |
 | ) |  |  | [static, protected]
void UpdateConnectivityStatus ( ) [private]
void UpdateWiFiImage ( ) [private]
WiFiNetworkDisplay | ( | Windows::Devices::WiFi::WiFiAvailableNetwork^ | availableNetwork,
 |  | Windows::Devices::WiFi::WiFiAdapter^ | adapter
 | ) |  |

Member Data Documentation

internal __pad0__ [protected]

Definition at line 69 of file DisplayHelpers.h.

Windows::Devices::WiFi::WiFiAdapter _firstAdapter [private]

Definition at line 41 of file Scenario2_Scan.xaml.h.

Windows::Foundation::EventRegistrationToken _registrationToken [private]

Definition at line 45 of file Scenario3_RegisterForUpdates.xaml.h.

MainPage _rootPage [private]

Definition at line 41 of file Scenario1_CachedNetworks.xaml.h.

Platform::String _savedProfileName [private]

Definition at line 47 of file Scenario4_Connect.xaml.h.

Windows::Foundation::Collections::IVectorView<Windows::Devices::WiFi::WiFiAdapter^> _wiFiAdapters [private]

Definition at line 42 of file Scenario1_CachedNetworks.xaml.h.

Windows::Devices::WiFi::WiFiAdapter adapter [private]

Definition at line 76 of file DisplayHelpers.h.

Property Documentation

Platform::String ConnectivityLevel

Definition at line 60 of file DisplayHelpers.h.

virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler PropertyChanged

Definition at line 63 of file DisplayHelpers.h.

Windows::Foundation::Collections::IObservableVector< WiFiNetworkDisplay^> ResultCollection

Definition at line 32 of file Scenario1_CachedNetworks.xaml.h.

Windows::UI::Xaml::Media::Imaging::BitmapImage WiFiImage

Definition at line 62 of file DisplayHelpers.h.

The documentation for this class was generated from the following files:
  • WiFiScan/cpp/DisplayHelpers.h
  • WiFiScan/cpp/Scenario1_CachedNetworks.xaml.h
  • WiFiScan/cpp/Scenario2_Scan.xaml.h
  • WiFiScan/cpp/Scenario3_RegisterForUpdates.xaml.h
  • WiFiScan/cpp/Scenario4_Connect.xaml.h
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowInfo Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WindowInfo
Public Member Functions | Public Attributes | Properties

WindowInfo Class Reference

List of all members.

Public Member Functions

WindowInfo (LineDisplayWindow window, int id)

Public Attributes

string | Name = "(Default)" : String.Empty

Properties

int | Id [get, set]
LineDisplayWindow | Window [get, set]

Detailed Description

Definition at line 23 of file Scenario3_UsingWindows.xaml.cs.

Constructor & Destructor Documentation

WindowInfo | ( | LineDisplayWindow | window,
 |  | int | id |
 | ) |  |  | [inline]

Definition at line 29 of file Scenario3_UsingWindows.xaml.cs.

        {
            Window = window;
            Id = id;
        }

Member Data Documentation

string Name = "(Default)" : String.Empty

Definition at line 27 of file Scenario3_UsingWindows.xaml.cs.

Property Documentation

int Id [get, set]

Definition at line 26 of file Scenario3_UsingWindows.xaml.cs.

LineDisplayWindow Window [get, set]

Definition at line 25 of file Scenario3_UsingWindows.xaml.cs.

The documentation for this class was generated from the following file:
  • LineDisplay/cs/Scenario3_UsingWindows.xaml.cs
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WordOverlay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WordOverlay
Public Member Functions | Public Attributes | Protected Member Functions | Events | Private Member Functions | Private Attributes

WordOverlay Class Reference

Wraps recognized word and provides word overlay position and size based on current scale.

List of all members.

Public Member Functions

WordOverlay (OcrWord ocrWord)
Border | CreateBorder (Style style, UIElement child=null)
void | Transform (ScaleTransform scale)

Public Attributes

double | WordHeight = > wordBoundingRect.Height
Thickness | WordPosition = > new Thickness(wordBoundingRect.Left, wordBoundingRect.Top, 0, 0)
double | WordWidth = > wordBoundingRect.Width

Protected Member Functions

void | OnPropertyChanged (string PropertyName)

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

Binding | CreateBinding (string propertyName)
void | UpdateProps (Rect wordBoundingBox)

Private Attributes

OcrWord | word
Rect | wordBoundingRect

Detailed Description

Definition at line 25 of file WordOverlay.cs.

Constructor & Destructor Documentation

WordOverlay ( OcrWord ocrWord ) [inline]

Definition at line 47 of file WordOverlay.cs.

        {
            word = ocrWord;

            UpdateProps(word.BoundingRect);
        }

Member Function Documentation

Binding CreateBinding ( string propertyName ) [private]
Border CreateBorder | ( | Style | style,
 |  | UIElement | child = null |
 | ) |  |  | [inline]

Definition at line 60 of file WordOverlay.cs.

        {
            var overlay = new Border()
            {
                Child = child,
                Style = style
            };

            // Bind word boxes to UI.
            overlay.SetBinding(FrameworkElement.MarginProperty, CreateBinding("WordPosition"));
            overlay.SetBinding(FrameworkElement.WidthProperty, CreateBinding("WordWidth"));
            overlay.SetBinding(FrameworkElement.HeightProperty, CreateBinding("WordHeight"));

            return overlay;
        }

void OnPropertyChanged ( string PropertyName ) [inline, protected]

Definition at line 87 of file WordOverlay.cs.

        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName));
        }

void Transform ( ScaleTransform scale ) [inline]

Definition at line 54 of file WordOverlay.cs.

        {
            // Scale word box bounding rect and update properties.
            UpdateProps(scale.TransformBounds(word.BoundingRect));
        }

void UpdateProps ( Rect wordBoundingBox ) [inline, private]

Definition at line 78 of file WordOverlay.cs.

        {
            wordBoundingRect = wordBoundingBox;

            OnPropertyChanged("WordPosition");
            OnPropertyChanged("WordWidth");
            OnPropertyChanged("WordHeight");
        }

Member Data Documentation

OcrWord word [private]

Definition at line 27 of file WordOverlay.cs.

Rect wordBoundingRect [private]

Definition at line 28 of file WordOverlay.cs.

double WordHeight = > wordBoundingRect.Height

Scaled word box height.

Definition at line 43 of file WordOverlay.cs.

Thickness WordPosition = > new Thickness(wordBoundingRect.Left, wordBoundingRect.Top, 0, 0)

Left and Right properties of Thickess define word box position.

Definition at line 33 of file WordOverlay.cs.

double WordWidth = > wordBoundingRect.Width

Scaled word box width.

Definition at line 38 of file WordOverlay.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 45 of file WordOverlay.cs.

The documentation for this class was generated from the following files:
  • OCR/cs/WordOverlay.cs
  • OCR/cpp/WordOverlay.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WriteReadStream Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WriteReadStream
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

WriteReadStream Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

WriteReadStream ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | TransferData (object sender, RoutedEventArgs e)

Private Attributes

string[] | inputElements
MainPage rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_WriteReadStream.xaml.cs.

Constructor & Destructor Documentation

WriteReadStream ( ) [inline]

Definition at line 34 of file Scenario1_WriteReadStream.xaml.cs.

        {
            this.InitializeComponent();

            // Populate the text block with the input elements.
            ElementsToWrite.Text = String.Join(";", inputElements);
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file Scenario1_WriteReadStream.xaml.cs.

        {
        }

async void TransferData | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Copy Strings' button.

Here we will parse the strings contained in the ElementsToWrite text block, write them to a stream using DataWriter, retrieve them using DataReader, and output the results in the ElementsRead text block.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 59 of file Scenario1_WriteReadStream.xaml.cs.

        {
            // Initialize the in-memory stream where data will be stored.
            using (var stream = new Windows.Storage.Streams.InMemoryRandomAccessStream())
            {
                // Create the data writer object backed by the in-memory stream.
                using (var dataWriter = new Windows.Storage.Streams.DataWriter(stream))
                {
                    dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
                    dataWriter.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;

                    // Write each element separately.
                    foreach (string inputElement in inputElements)
                    {
                        uint inputElementSize = dataWriter.MeasureString(inputElement);
                        dataWriter.WriteUInt32(inputElementSize);
                        dataWriter.WriteString(inputElement);
                    }

                    // Send the contents of the writer to the backing stream.
                    await dataWriter.StoreAsync();

                    // For the in-memory stream implementation we are using, the flushAsync call is superfluous,
                    // but other types of streams may require it.
                    await dataWriter.FlushAsync();

                    // In order to prolong the lifetime of the stream, detach it from the DataWriter so that it
                    // will not be closed when Dispose() is called on dataWriter. Were we to fail to detach the
                    // stream, the call to dataWriter.Dispose() would close the underlying stream, preventing
                    // its subsequent use by the DataReader below.
                    dataWriter.DetachStream();
                }

                // Create the input stream at position 0 so that the stream can be read from the beginning.
                stream.Seek(0);
                using (var dataReader = new Windows.Storage.Streams.DataReader(stream))
                {
                    // The encoding and byte order need to match the settings of the writer we previously used.
                    dataReader.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
                    dataReader.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;

                    // Once we have written the contents successfully we load the stream.
                    await dataReader.LoadAsync((uint)stream.Size);

                    var receivedStrings = "";

                    // Keep reading until we consume the complete stream.
                    while (dataReader.UnconsumedBufferLength > 0)
                    {
                        // Note that the call to readString requires a length of "code units" to read. This
                        // is the reason each string is preceded by its length when "on the wire".
                        uint bytesToRead = dataReader.ReadUInt32();
                        receivedStrings += dataReader.ReadString(bytesToRead) + "\n";
                    }

                    // Populate the ElementsRead text block with the items we read from the stream.
                    ElementsRead.Text = receivedStrings;
                }
            }
        }

Member Data Documentation

string [] inputElements [private]
Initial value:
 new string[] {
            "Hello", "World", "1 2 3 4 5", "Très bien!", "Goodbye"
        }

Definition at line 30 of file Scenario1_WriteReadStream.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_WriteReadStream.xaml.cs.

The documentation for this class was generated from the following files:
  • DataReaderWriter/cs/Scenario1_WriteReadStream.xaml.cs
  • DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.cpp
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WRLInProcessWinRTComponent
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "Scenario1_OvenClient.xaml.h"

List of all members.

Public Member Functions

CustomException ()
CustomExceptionWRL ()
OvenClient ()
OvenClientWRL ()

Private Member Functions

void | BreadCompletedHandler1 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | BreadCompletedHandler2 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | BreadCompletedHandler3 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Private Attributes

Microsoft::SDKSamples::Kitchen::Oven _myOven
Microsoft::WRL::ComPtr
< ABI::Microsoft::SDKSamples::Kitchen::IOven > 		_myOven

Detailed Description

Definition at line 14 of file Scenario1_OvenClient.xaml.h.

Member Function Documentation

void BreadCompletedHandler1 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
void BreadCompletedHandler2 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
void BreadCompletedHandler3 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
CustomException ( )
CustomExceptionWRL ( )
OvenClient ( )
OvenClientWRL ( )
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]

Member Data Documentation

Microsoft::SDKSamples::Kitchen::Oven _myOven [private]

Definition at line 25 of file Scenario1_OvenClient.xaml.h.

Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> _myOven [private]

Definition at line 24 of file Scenario2_OvenClientWRL.xaml.h.

The documentation for this class was generated from the following files:
  • WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h
  • WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h
  • WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h
  • WRLInProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • WRLOutOfProcessWinRTComponent
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "Scenario1_OvenClient.xaml.h"

List of all members.

Public Member Functions

CustomException ()
CustomExceptionWRL ()
OvenClient ()
OvenClientWRL ()

Private Member Functions

void | BreadCompletedHandler1 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | BreadCompletedHandler2 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | BreadCompletedHandler3 (Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | Start_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)

Private Attributes

Microsoft::SDKSamples::Kitchen::Oven _myOven
Microsoft::WRL::ComPtr
< ABI::Microsoft::SDKSamples::Kitchen::IOven > 		_myOven

Detailed Description

Definition at line 14 of file Scenario1_OvenClient.xaml.h.

Member Function Documentation

void BreadCompletedHandler1 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
void BreadCompletedHandler2 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
void BreadCompletedHandler3 | ( | Microsoft::SDKSamples::Kitchen::Oven^ | oven,
 |  | Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ | args |
 | ) |  |  | [private]
CustomException ( )
CustomExceptionWRL ( )
OvenClient ( )
OvenClientWRL ( )
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void Start_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]

Member Data Documentation

Microsoft::SDKSamples::Kitchen::Oven _myOven [private]

Definition at line 25 of file Scenario1_OvenClient.xaml.h.

Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> _myOven [private]

Definition at line 24 of file Scenario2_OvenClientWRL.xaml.h.

The documentation for this class was generated from the following files:
  • WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h
  • WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h
  • WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h
  • WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SDKTemplate
  • XmlLite
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

#include "Scenario1_XmlReader.xaml.h"

List of all members.

Public Member Functions

Scenario1 ()
Scenario2 ()
Scenario3 ()

Private Member Functions

HRESULT | ConcatToOutput (PCWSTR str, UINT strLen)
void | DoSomething_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
void | DoSomething_Click (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
HRESULT | ReadAndWrite (IXmlReader *reader, IXmlWriterLite *writer)
HRESULT | ReadAttributes (IXmlReader *reader)
HRESULT | ReadXml (Windows::Storage::Streams::IRandomAccessStream^readStream)
void | ReadXmlClick (Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e)
HRESULT | WriteXml (Windows::Storage::Streams::IRandomAccessStream^writeStream)
HRESULT | WriteXml (Windows::Storage::Streams::IRandomAccessStream^pStream)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario1_XmlReader.xaml.h.

Member Function Documentation

HRESULT ConcatToOutput | ( | PCWSTR | str,
 |  | UINT | strLen |
 | ) |  |  | [private]
void DoSomething_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
void DoSomething_Click | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
HRESULT ReadAndWrite | ( | IXmlReader * | reader,
 |  | IXmlWriterLite * | writer |
 | ) |  |  | [private]
HRESULT ReadAttributes ( IXmlReader * reader ) [private]
HRESULT ReadXml ( Windows::Storage::Streams::IRandomAccessStream^ readStream ) [private]
void ReadXmlClick | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | e |
 | ) |  |  | [private]
Scenario1 ( )
Scenario2 ( )
Scenario3 ( )
HRESULT WriteXml ( Windows::Storage::Streams::IRandomAccessStream^ writeStream ) [private]
HRESULT WriteXml ( Windows::Storage::Streams::IRandomAccessStream^ pStream ) [private]

Member Data Documentation

MainPage rootPage [private]

Definition at line 31 of file Scenario1_XmlReader.xaml.h.

The documentation for this class was generated from the following files:
  • XmlLite/cpp/Scenario1_XmlReader.xaml.h
  • XmlLite/cpp/Scenario2_XmlWriter.xaml.h
  • XmlLite/cpp/Scenario3_XmlWriterLite.xaml.h
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SdrOverlayEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

SdrOverlayEffect Class Reference

#include "SdrOverlayEffect.h"

List of all members.

Public Member Functions

IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pRenderInfo)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pGraph)

Static Public Member Functions

static HRESULT __stdcall | CreateSdrOverlayImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

SdrOverlayEffect ()
HRESULT | UpdateConstants ()

Private Attributes

struct {
float dpi
} m_constants
float | m_dpi
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
Microsoft::WRL::ComPtr
< ID2D1EffectContext > 		m_effectContext
D2D1_RECT_L | m_inputRect
LONG | m_refCount

Detailed Description

Definition at line 21 of file SdrOverlayEffect.h.

Constructor & Destructor Documentation

SdrOverlayEffect ( ) [private]

Definition at line 19 of file SdrOverlayEffect.cpp.

                                   :
    m_refCount(1),
    m_constants{}

Member Function Documentation

static HRESULT __stdcall CreateSdrOverlayImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]
IFACEMETHODIMP_ ( UINT32 ) const
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP Initialize | ( | _In_ ID2D1EffectContext * | pContextInternal,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |
IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |
IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const
IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const
IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )
IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |
static HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]
IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pRenderInfo )
IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pGraph )
HRESULT UpdateConstants ( ) [private]

Member Data Documentation

float dpi

Definition at line 80 of file SdrOverlayEffect.h.

struct { ... } m_constants [private]
float m_dpi [private]

Definition at line 87 of file SdrOverlayEffect.h.

Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 83 of file SdrOverlayEffect.h.

Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext [private]

Definition at line 84 of file SdrOverlayEffect.h.

D2D1_RECT_L m_inputRect [private]

Definition at line 86 of file SdrOverlayEffect.h.

LONG m_refCount [private]

Definition at line 85 of file SdrOverlayEffect.h.

The documentation for this class was generated from the following files:
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.h
  • D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes

sealed Class Reference

Client side RPC implementation. More...

#include "App.h"

List of all members.

Public Member Functions

~RpcClient ()
Windows::UI::Composition::Visual | CreateChildElement ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()
FirstPersonCamera ()
Windows::Foundation::Numerics::float4x4 GetCameraToWorld ()
Windows::Foundation::Numerics::float4x4 GetWorldToCamera ()
__int64 | Initialize ()
void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^view) override
void | InitNewComposition ()
void | Load (Platform::String^unused) override
void | OnPointerMoved (Windows::UI::Core::CoreWindow^window, Windows::UI::Core::PointerEventArgs^args)
void | OnPointerPressed (Windows::UI::Core::CoreWindow^window, Windows::UI::Core::PointerEventArgs^args)
void | OnPointerReleased (Windows::UI::Core::CoreWindow^window, Windows::UI::Core::PointerEventArgs^args)
void | Reset ()
void | Run () override
__int64 | SetSampleRate (int rate)
void | SetWindow (Windows::UI::Core::CoreWindow^window) override
__int64 | StartMeteringAndWaitForStop (__int64 samplePeriod)
__int64 | StopMetering ()
void | Uninitialize () override
void | Update (float dt)
VisualProperties ()

Public Attributes

Windows::UI::Composition::CompositionTarget | _compositionTarget
Windows::UI::Composition::Compositor | _compositor
Windows::UI::Composition::ContainerVisual | _currentVisual
bool | _dragging
Windows::Foundation::Numerics::float2 * _offsetBias
Windows::UI::Composition::ContainerVisual | _root
Windows::ApplicationModel::Core::CoreApplicationView | _view
Windows::UI::Core::CoreWindow | _window
int | CallbackCount
__int64 | MeteringData

Private Member Functions

void | MoveAlongX (float distance)
void | MoveAlongY (float distance)
void | MoveAlongZ (float distance)
void | OnPointerMoved (Windows::UI::Core::CoreWindow^window, Windows::UI::Core::PointerEventArgs^args)
void | RotatePitch (float radians)
void | RotateYaw (float radians)

Private Attributes

handle_t | hRpcBinding
float | m_pitchAngle
Windows::Foundation::Numerics::float3 m_position
Windows::Foundation::Point | m_prevCursor
float | m_yawAngle
PCONTEXT_HANDLE_TYPE phContext

Static Private Attributes

static constexpr float | cMovementMetersPerSecond = 1.0f
static constexpr float | cPixelsToMeters = 0.005f
static constexpr float | cPixelsToMetersPerSecond = cPixelsToMeters * cMovementMetersPerSecond
static constexpr float | cPixelsToRadians = 0.00125f
static constexpr float | cPixelsToRadiansPerSecond = cPixelsToRadians * cRotationRadiansPerSecond
static constexpr float | cRotationRadiansPerSecond = 1.0f

Detailed Description

Definition at line 57 of file App.h.

Constructor & Destructor Documentation

~RpcClient ( )

Member Function Documentation

Windows::UI::Composition::Visual CreateChildElement ( )
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [virtual]
FirstPersonCamera ( )
Windows::Foundation::Numerics::float4x4 GetCameraToWorld ( )
Windows::Foundation::Numerics::float4x4 GetWorldToCamera ( )
void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ view ) [override]
__int64 Initialize ( )
void InitNewComposition ( )
void Load ( Platform::String^ unused ) [override]
void MoveAlongX ( float distance ) [private]
void MoveAlongY ( float distance ) [private]
void MoveAlongZ ( float distance ) [private]
void OnPointerMoved | ( | Windows::UI::Core::CoreWindow^ | window,
 |  | Windows::UI::Core::PointerEventArgs^ | args
 | ) |  |
void OnPointerMoved | ( | Windows::UI::Core::CoreWindow^ | window,
 |  | Windows::UI::Core::PointerEventArgs^ | args |
 | ) |  |  | [private]
void OnPointerPressed | ( | Windows::UI::Core::CoreWindow^ | window,
 |  | Windows::UI::Core::PointerEventArgs^ | args
 | ) |  |
void OnPointerReleased | ( | Windows::UI::Core::CoreWindow^ | window,
 |  | Windows::UI::Core::PointerEventArgs^ | args
 | ) |  |
void Reset ( )
void RotatePitch ( float radians ) [private]
void RotateYaw ( float radians ) [private]
void Run ( ) [override]
__int64 SetSampleRate ( int rate )
void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [override]
__int64 StartMeteringAndWaitForStop ( __int64 samplePeriod )
__int64 StopMetering ( )
void Uninitialize ( ) [override]
void Update ( float dt )
VisualProperties ( )

Member Data Documentation

Windows::UI::Composition::CompositionTarget _compositionTarget

Definition at line 10 of file VisualProperties.h.

Windows::UI::Composition::Compositor _compositor

Definition at line 8 of file VisualProperties.h.

Windows::UI::Composition::ContainerVisual _currentVisual

Definition at line 11 of file VisualProperties.h.

bool _dragging

Definition at line 13 of file VisualProperties.h.

Windows::Foundation::Numerics::float2* _offsetBias

Definition at line 12 of file VisualProperties.h.

Windows::UI::Composition::ContainerVisual _root

Definition at line 9 of file VisualProperties.h.

Windows::ApplicationModel::Core::CoreApplicationView _view

Definition at line 6 of file VisualProperties.h.

Windows::UI::Core::CoreWindow _window

Definition at line 7 of file VisualProperties.h.

int CallbackCount

Definition at line 29 of file RpcClient.h.

constexpr float cMovementMetersPerSecond = 1.0f [static, private]

Definition at line 40 of file GraphicsCamera.h.

constexpr float cPixelsToMeters = 0.005f [static, private]

Definition at line 39 of file GraphicsCamera.h.

constexpr float cPixelsToMetersPerSecond = cPixelsToMeters * cMovementMetersPerSecond [static, private]

Definition at line 43 of file GraphicsCamera.h.

constexpr float cPixelsToRadians = 0.00125f [static, private]

Definition at line 38 of file GraphicsCamera.h.

constexpr float cPixelsToRadiansPerSecond = cPixelsToRadians * cRotationRadiansPerSecond [static, private]

Definition at line 42 of file GraphicsCamera.h.

constexpr float cRotationRadiansPerSecond = 1.0f [static, private]

Definition at line 41 of file GraphicsCamera.h.

handle_t hRpcBinding [private]

Definition at line 32 of file RpcClient.h.

float m_pitchAngle [private]

Definition at line 49 of file GraphicsCamera.h.

Windows::Foundation::Numerics::float3 m_position [private]

Definition at line 45 of file GraphicsCamera.h.

Windows::Foundation::Point m_prevCursor [private]

Definition at line 46 of file GraphicsCamera.h.

float m_yawAngle [private]

Definition at line 48 of file GraphicsCamera.h.

__int64 MeteringData

Definition at line 30 of file RpcClient.h.

PCONTEXT_HANDLE_TYPE phContext [private]

Definition at line 33 of file RpcClient.h.

The documentation for this class was generated from the following files:
  • CameraStreamCoordinateMapper/cpp/App.h
  • CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.h
  • CompositionVisual/cpp/VisualProperties.h
  • CustomCapability/Service/Client/RpcClient.h
  • D2DCustomEffects/cpp/ComputeShader/App.h
  • D2DCustomEffects/cpp/PixelShader/App.h
  • D2DCustomEffects/cpp/VertexShader/App.h
  • D2DGradientMesh/cpp/App.h
  • DWriteColorGlyph/cpp/App.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewLifetimeControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SecondaryViewsHelpers
  • ViewLifetimeControl
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

ViewLifetimeControl Class Reference

List of all members.

Public Member Functions

int | StartViewInUse ()
int | StartViewInUse ()
int | StopViewInUse ()
int | StopViewInUse ()

Static Public Member Functions

static ViewLifetimeControl | CreateForCurrentView ()
static ViewLifetimeControl | CreateForCurrentView ()

Properties

bool | Consolidated [get, set]
CoreDispatcher | Dispatcher [get]
int | Id [get]
ViewReleasedHandler | Released
string | Title [get, set]

Events

ViewReleasedHandler | InternalReleased
PropertyChangedEventHandler | PropertyChanged

Private Member Functions

ViewLifetimeControl (CoreWindow newWindow)
ViewLifetimeControl (CoreWindow newWindow)
void | FinalizeRelease ()
void | FinalizeRelease ()
void | RegisterForEvents ()
void | RegisterForEvents ()
void | UnregisterForEvents ()
void | UnregisterForEvents ()
void | ViewConsolidated (ApplicationView sender, ApplicationViewConsolidatedEventArgs e)
void | ViewConsolidated (ApplicationView sender, ApplicationViewConsolidatedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

bool | consolidated = true
CoreDispatcher | dispatcher
bool | madeVisible = false
int | refCount = 0
bool | released = false
string | title
int | viewId
CoreWindow | window

Detailed Description

Definition at line 37 of file ViewLifetimeControl.cs.

Constructor & Destructor Documentation

ViewLifetimeControl ( CoreWindow newWindow ) [inline, private]

Definition at line 75 of file ViewLifetimeControl.cs.

        {
            dispatcher = newWindow.Dispatcher;
            window = newWindow;
            viewId = ApplicationView.GetApplicationViewIdForWindow(window);

            // This class will automatically tell the view when its time to close
            // or stay alive in a few cases
            RegisterForEvents();
        }

ViewLifetimeControl ( CoreWindow newWindow ) [inline, private]

Definition at line 81 of file ViewLifetimeControl.cs.

        {
            dispatcher = newWindow.Dispatcher;
            window = newWindow;
            viewId = ApplicationView.GetApplicationViewIdForWindow(window);

            // This class will automatically tell the view when its time to close
            // or stay alive in a few cases
            RegisterForEvents();
        }

Member Function Documentation

static ViewLifetimeControl CreateForCurrentView ( ) [inline, static]

Definition at line 135 of file ViewLifetimeControl.cs.

        {
            return new ViewLifetimeControl(CoreWindow.GetForCurrentThread());
        }

static ViewLifetimeControl CreateForCurrentView ( ) [inline, static]

Definition at line 155 of file ViewLifetimeControl.cs.

        {
            return new ViewLifetimeControl(CoreWindow.GetForCurrentThread());
        }

void FinalizeRelease ( ) [inline, private]

Definition at line 112 of file ViewLifetimeControl.cs.

        {
            bool justReleased = false;
            lock (this)
            {
                if (refCount == 0)
                {
                    justReleased = true;
                    released = true;
                }
            }

            // This assumes that released will never be made false after it
            // it has been set to true
            if (justReleased)
            {
                UnregisterForEvents();
                InternalReleased(this, null);
            }
        }

void FinalizeRelease ( ) [inline, private]

Definition at line 132 of file ViewLifetimeControl.cs.

        {
            bool justReleased = false;
            lock (this)
            {
                if (refCount == 0)
                {
                    justReleased = true;
                    released = true;
                }
            }

            // This assumes that released will never be made false after it
            // it has been set to true
            if (justReleased)
            {
                UnregisterForEvents();
                InternalReleased(this, null);
            }
        }

void RegisterForEvents ( ) [inline, private]

Definition at line 93 of file ViewLifetimeControl.cs.

        {
            // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
            // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
            // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
            ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
            window.VisibilityChanged += VisibilityChanged;
        }

void RegisterForEvents ( ) [inline, private]

Definition at line 87 of file ViewLifetimeControl.cs.

        {
            // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
            // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
            // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
            ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
        }

int StartViewInUse ( ) [inline]

Definition at line 185 of file ViewLifetimeControl.cs.

        {
            bool releasedCopy = false;
            int refCountCopy = 0;

            // This method is called from several different threads
            // (each view lives on its own thread)
            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = ++refCount;
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }

            return refCountCopy;
        }

int StartViewInUse ( ) [inline]

Definition at line 236 of file ViewLifetimeControl.cs.

        {
            bool releasedCopy = false;
            int refCountCopy = 0;

            // This method is called from several different threads
            // (each view lives on its own thread)
            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = ++refCount;
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }

            return refCountCopy;
        }

int StopViewInUse ( ) [inline]

Definition at line 212 of file ViewLifetimeControl.cs.

        {
            int refCountCopy = 0;
            bool releasedCopy = false;

            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = --refCount;
                    if (refCountCopy == 0)
                    {
                        // If no other view is interacting with this view, and
                        // the view isn't accessible to the user, it's appropriate
                        // to close it
                        //
                        // Before actually closing the view, make sure there are no
                        // other important events waiting in the queue (this low-priority item
                        // will run after other events)
                        var task = dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease);
                    }
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }
            return refCountCopy;
        }

int StopViewInUse ( ) [inline]

Definition at line 263 of file ViewLifetimeControl.cs.

        {
            int refCountCopy = 0;
            bool releasedCopy = false;

            lock (this)
            {
                releasedCopy = this.released;
                if (!released)
                {
                    refCountCopy = --refCount;
                    if ((refCountCopy == 0) && madeVisible)
                    {
                        dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease);
                    }
                }
            }

            if (releasedCopy)
            {
                throw new InvalidOperationException("This view is being disposed");
            }
            return refCountCopy;
        }

void UnregisterForEvents ( ) [inline, private]

Definition at line 96 of file ViewLifetimeControl.cs.

        {
            ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
        }

void UnregisterForEvents ( ) [inline, private]

Definition at line 103 of file ViewLifetimeControl.cs.

        {
            ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
            window.VisibilityChanged -= VisibilityChanged;
        }

void ViewConsolidated | ( | ApplicationView | sender,
 |  | ApplicationViewConsolidatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 124 of file ViewLifetimeControl.cs.

        {
            Consolidated = true;
        }

void ViewConsolidated | ( | ApplicationView | sender,
 |  | ApplicationViewConsolidatedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 104 of file ViewLifetimeControl.cs.

        {
            StopViewInUse();
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 109 of file ViewLifetimeControl.cs.

        {

            if (e.Visible)
            {
                // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
                // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
                // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
                Consolidated = false;
            }
        }

Member Data Documentation

bool consolidated = true [private]

Definition at line 69 of file ViewLifetimeControl.cs.

CoreDispatcher dispatcher [private]

Definition at line 40 of file ViewLifetimeControl.cs.

bool madeVisible = false [private]

Definition at line 75 of file ViewLifetimeControl.cs.

int refCount = 0 [private]

Definition at line 54 of file ViewLifetimeControl.cs.

bool released = false [private]

Definition at line 63 of file ViewLifetimeControl.cs.

string title [private]

Definition at line 47 of file ViewLifetimeControl.cs.

int viewId [private]

Definition at line 59 of file ViewLifetimeControl.cs.

CoreWindow window [private]

Definition at line 43 of file ViewLifetimeControl.cs.

Property Documentation

bool Consolidated [get, set]

Definition at line 208 of file ViewLifetimeControl.cs.

CoreDispatcher Dispatcher [get]

Definition at line 163 of file ViewLifetimeControl.cs.

int Id [get]

Definition at line 175 of file ViewLifetimeControl.cs.

ViewReleasedHandler Released [add, remove]

Definition at line 248 of file ViewLifetimeControl.cs.

string Title [get, set]

Definition at line 143 of file ViewLifetimeControl.cs.

Event Documentation

ViewReleasedHandler InternalReleased [private]

Definition at line 72 of file ViewLifetimeControl.cs.

PropertyChangedEventHandler PropertyChanged

Definition at line 246 of file ViewLifetimeControl.cs.

The documentation for this class was generated from the following files:
  • MultipleViews/cs/ViewLifetimeControl.cs
  • Projection/cs/ViewLifetimeControl.cs
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ArduinoDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • ArduinoDevice
Public Attributes

ArduinoDevice Class Reference

List of all members.

Public Attributes

const UInt16 | Pid = 0x0043
const UInt16 | Vid = 0x2341

Detailed Description

Definition at line 28 of file Constants.cs.

Member Data Documentation

const UInt16 Pid = 0x0043

Definition at line 31 of file Constants.cs.

const UInt16 Vid = 0x2341

Definition at line 30 of file Constants.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/Constants.cs
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceListEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • DeviceListEntry
Public Member Functions | Properties | Private Attributes

DeviceListEntry Class Reference

The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

List of all members.

Public Member Functions

DeviceListEntry (Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)

Properties

DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
String | InstanceId [get]

Private Attributes

DeviceInformation | device
String | deviceSelector

Detailed Description

Each instance of this class provides information about a single device.

This class is used by the UI to display device specific information so that the user can identify which device to use.

Definition at line 29 of file DeviceListEntry.cs.

Constructor & Destructor Documentation

DeviceListEntry | ( | Windows.Devices.Enumeration.DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.

Parameters:
deviceInformation
deviceSelector The AQS used to find this device

Definition at line 63 of file DeviceListEntry.cs.

        {
            device = deviceInformation;
            this.deviceSelector = deviceSelector;
        }

Member Data Documentation

DeviceInformation device [private]

Definition at line 31 of file DeviceListEntry.cs.

String deviceSelector [private]

Definition at line 32 of file DeviceListEntry.cs.

Property Documentation

DeviceInformation DeviceInformation [get]

Definition at line 43 of file DeviceListEntry.cs.

String DeviceSelector [get]

Definition at line 51 of file DeviceListEntry.cs.

String InstanceId [get]

Definition at line 35 of file DeviceListEntry.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/DeviceListEntry.cs
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceProperties Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • DeviceProperties
Public Attributes

DeviceProperties Class Reference

List of all members.

Public Attributes

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Detailed Description

Definition at line 23 of file Constants.cs.

Member Data Documentation

const String DeviceInstanceId = "System.Devices.DeviceInstanceId"

Definition at line 25 of file Constants.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/Constants.cs
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EventHandlerForDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • EventHandlerForDevice
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

EventHandlerForDevice Class Reference

The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

List of all members.

Public Member Functions

void | CloseDevice ()
void | ConfigureCurrentlyConnectedDevice ()
async Task< Boolean > | OpenDeviceAsync (DeviceInformation deviceInfo, String deviceSelector)

Static Public Member Functions

static void | CreateNewEventHandlerForDevice ()

Properties

static EventHandlerForDevice | Current [get]
SerialDevice | Device [get]
DeviceAccessInformation | DeviceAccessInformation [get]
DeviceInformation | DeviceInformation [get]
String | DeviceSelector [get]
Boolean | IsDeviceConnected [get]
Boolean | IsEnabledAutoReconnect [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceClose [get, set]
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		OnDeviceConnected [get, set]

Private Member Functions

EventHandlerForDevice ()
async void | CloseCurrentlyConnectedDevice ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAccessChanged (DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInfo)
void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RegisterForAppEvents ()
void | RegisterForDeviceAccessStatusChange ()
void | RegisterForDeviceWatcherEvents ()
void | StartDeviceWatcher ()
void | StopDeviceWatcher ()
void | UnregisterFromAppEvents ()
void | UnregisterFromDeviceAccessStatusChange ()
void | UnregisterFromDeviceWatcherEvents ()

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
SerialDevice | device
TypedEventHandler
< DeviceAccessInformation,
DeviceAccessChangedEventArgs > 		deviceAccessEventHandler
DeviceAccessInformation | deviceAccessInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformation > 		deviceAddedEventHandler
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceCloseCallback
TypedEventHandler
< EventHandlerForDevice,
DeviceInformation > 		deviceConnectedCallback
DeviceInformation | deviceInformation
TypedEventHandler
< DeviceWatcher,
DeviceInformationUpdate > 		deviceRemovedEventHandler
String | deviceSelector
DeviceWatcher | deviceWatcher
Boolean | isEnabledAutoReconnect
MainPage | rootPage = MainPage.Current
Boolean | watcherStarted
Boolean | watcherSuspended

Static Private Attributes

static EventHandlerForDevice | eventHandlerForDevice
static Object | singletonCreationLock = new Object()

Detailed Description

In addition to handling the SerialDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).

This class will also demonstrate how to handle device watcher events.

For simplicity, this class will only allow at most one device to be connected at any given time. In order to make this class support multiple devices, make this class a non-singleton and create multiple instances of this class; each instance should watch one connected device.

Definition at line 42 of file EventHandlerForDevice.cs.

Constructor & Destructor Documentation

EventHandlerForDevice ( void ) [inline, private]

Definition at line 365 of file EventHandlerForDevice.cs.

        {
            watcherStarted = false;
            watcherSuspended = false;
            isEnabledAutoReconnect = true;
        }

Member Function Documentation

async void CloseCurrentlyConnectedDevice ( void ) [inline, private]

This method demonstrates how to close the device properly using the WinRT Serial API.

When the SerialDevice is closing, it will cancel all IO operations that are still pending (not complete). The close will not wait for any IO completion callbacks to be called, so the close call may complete before any of the IO completion callbacks are called. The pending IO operations will still call their respective completion callbacks with either a task cancelled error or the operation completed.

Definition at line 381 of file EventHandlerForDevice.cs.

        {
            if (device != null)
            {
                // Notify callback that we're about to close the device
                if (deviceCloseCallback != null)
                {
                    deviceCloseCallback(this, deviceInformation);
                }

                // This closes the handle to the device
                device.Dispose();

                device = null;

                // Save the deviceInformation.Id in case deviceInformation is set to null when closing the
                // device
                String deviceId = deviceInformation.Id;

                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(() =>
                    {
                        MainPage.Current.NotifyUser(deviceId + " is closed", NotifyType.StatusMessage);
                    }));
            }
        }

void CloseDevice ( void ) [inline]

Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device was ever connected.

Definition at line 305 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected)
            {
                CloseCurrentlyConnectedDevice();
            }

            if (deviceWatcher != null)
            {
                if (watcherStarted)
                {
                    StopDeviceWatcher();

                    UnregisterFromDeviceWatcherEvents();
                }

                deviceWatcher = null;
            }

            if (deviceAccessInformation != null)
            {
                UnregisterFromDeviceAccessStatusChange();

                deviceAccessInformation = null;
            }

            if (appSuspendEventHandler != null || appResumeEventHandler != null)
            {
                UnregisterFromAppEvents();
            }

            deviceInformation = null;
            deviceSelector = null;

            deviceConnectedCallback = null;
            deviceCloseCallback = null;

            isEnabledAutoReconnect = true;
        }

void ConfigureCurrentlyConnectedDevice ( ) [inline]

Configures connection parameters for the device that is currently connected.

Definition at line 349 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected)
            {
                if (device != null)
                {
                    device.BaudRate = 9600;
                    device.Parity = SerialParity.None;
                    device.StopBits = SerialStopBitCount.One;
                    device.Handshake = SerialHandshake.None;
                    device.DataBits = 8;
                }
            }

        }

static void CreateNewEventHandlerForDevice ( ) [inline, static]

Creates a new instance of EventHandlerForDevice, enables auto reconnect, and uses it as the Current instance.

Definition at line 110 of file EventHandlerForDevice.cs.

        {
            eventHandlerForDevice = new EventHandlerForDevice();
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

When resume into the application, we should reopen a handle to the Serial device again.

This will automatically happen when we start the device watcher again; the device will be re-enumerated and we will attempt to reopen it if IsEnabledAutoReconnect property is enabled.

See OnAppSuspension for why we are starting the device watcher again

Parameters:
sender
arg

Definition at line 543 of file EventHandlerForDevice.cs.

        {
            if (watcherSuspended)
            {
                watcherSuspended = false;
                StartDeviceWatcher();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

If a Serial object has been instantiated (a handle to the device is opened), we must close it before the app goes into suspension because the API automatically closes it for us if we don't.

When resuming, the API will not reopen the device automatically, so we need to explicitly open the device in the app (Scenario1_ConnectDisconnect).

Since we have to reopen the device ourselves when the app resumes, it is good practice to explicitly call the close in the app as well (For every open there is a close).

We must stop the DeviceWatcher because it will continue to raise events even if the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 519 of file EventHandlerForDevice.cs.

        {
            if (watcherStarted)
            {
                watcherSuspended = true;
                StopDeviceWatcher();
            }
            else
            {
                watcherSuspended = false;
            }

            CloseCurrentlyConnectedDevice();
        }

async void OnDeviceAccessChanged | ( | DeviceAccessInformation | sender,
 |  | DeviceAccessChangedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Close the device if the device access was denied by anyone (system or the user) and reopen it if permissions are allowed again.

Parameters:
sender
eventArgs

Definition at line 592 of file EventHandlerForDevice.cs.

        {
            if ((eventArgs.Status == DeviceAccessStatus.DeniedBySystem)
                || (eventArgs.Status == DeviceAccessStatus.DeniedByUser))
            {
                CloseCurrentlyConnectedDevice();
            }
            else if ((eventArgs.Status == DeviceAccessStatus.Allowed) && (deviceInformation != null) && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInfo |
 | ) |  |  | [inline, private]

Open the device that the user wanted to open if it hasn't been opened yet and auto reconnect is enabled.

Parameters:
sender
deviceInfo

Definition at line 572 of file EventHandlerForDevice.cs.

        {
            if ((deviceInformation != null) && (deviceInfo.Id == deviceInformation.Id) && !IsDeviceConnected && isEnabledAutoReconnect)
            {
                await rootPage.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    new DispatchedHandler(async () =>
                    {
                        await OpenDeviceAsync(deviceInformation, deviceSelector);

                        // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
                    }));
            }
        }

void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

Close the device that is opened so that all pending operations are canceled properly.

Parameters:
sender
deviceInformationUpdate

Definition at line 557 of file EventHandlerForDevice.cs.

        {
            if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
            {
                // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
                // and stop talking to the disconnected device.
                CloseCurrentlyConnectedDevice();
            }
        }

async Task<Boolean> OpenDeviceAsync | ( | DeviceInformation | deviceInfo,
 |  | String | deviceSelector |
 | ) |  |  | [inline]

This method opens the device using the WinRT Serial API.

After the device is opened, save the device so that it can be used across scenarios.

It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed on the UI thread.

This method is used to reopen the device after the device reconnects to the computer and when the app resumes.

Parameters:
deviceInfo | Device information of the device to be opened
deviceSelector | The AQS used to find this device
Returns:
True if the device was successfully opened, false if the device could not be opened for well known reasons. An exception may be thrown if the device could not be opened for extraordinary reasons.

Definition at line 220 of file EventHandlerForDevice.cs.

        {
            device = await SerialDevice.FromIdAsync(deviceInfo.Id);

            Boolean successfullyOpenedDevice = false;
            NotifyType notificationStatus;
            String notificationMessage = null;

            // Device could have been blocked by user or the device has already been opened by another app.
            if (device != null)
            {
                successfullyOpenedDevice = true;

                deviceInformation = deviceInfo;
                this.deviceSelector = deviceSelector;

                notificationStatus = NotifyType.StatusMessage;
                notificationMessage = "Device " + deviceInformation.Id + " opened";

                // Notify registered callback handle that the device has been opened
                if (deviceConnectedCallback != null)
                {
                    deviceConnectedCallback(this, deviceInformation);
                }

                if (appSuspendEventHandler == null || appResumeEventHandler == null)
                {
                    RegisterForAppEvents();
                }

                // Register for DeviceAccessInformation.AccessChanged event and react to any changes to the
                // user access after the device handle was opened.
                if (deviceAccessEventHandler == null)
                {
                    RegisterForDeviceAccessStatusChange();
                }

                // Create and register device watcher events for the device to be opened unless we're reopening the device
                if (deviceWatcher == null)
                {
                    deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

                    RegisterForDeviceWatcherEvents();
                }

                if (!watcherStarted)
                {
                    // Start the device watcher after we made sure that the device is opened.
                    StartDeviceWatcher();
                }
            }
            else
            {
                successfullyOpenedDevice = false;

                notificationStatus = NotifyType.ErrorMessage;

                var deviceAccessStatus = DeviceAccessInformation.CreateFromId(deviceInfo.Id).CurrentStatus;

                if (deviceAccessStatus == DeviceAccessStatus.DeniedByUser)
                {
                    notificationMessage = "Access to the device was blocked by the user : " + deviceInfo.Id;
                }
                else if (deviceAccessStatus == DeviceAccessStatus.DeniedBySystem)
                {
                    // This status is most likely caused by app permissions (did not declare the device in the app's package.appxmanifest)
                    // This status does not cover the case where the device is already opened by another app.
                    notificationMessage = "Access to the device was blocked by the system : " + deviceInfo.Id;
                }
                else
                {
                    // Most likely the device is opened by another app, but cannot be sure
                    notificationMessage = "Unknown error, possibly opened by another app : " + deviceInfo.Id;
                }
            }

            MainPage.Current.NotifyUser(notificationMessage, notificationStatus);

            return successfullyOpenedDevice;
        }

void RegisterForAppEvents ( void ) [inline, private]

Register for app suspension/resume events.

See the comments for the event handlers for more information on the exact device operation performed.

We will also register for when the app exists so that we may close the device handle.

Definition at line 415 of file EventHandlerForDevice.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void RegisterForDeviceAccessStatusChange ( ) [inline, private]

Listen for any changed in device access permission.

The user can block access to the device while the device is in use. If the user blocks access to the device while the device is opened, the device's handle will be closed automatically by the system; it is still a good idea to close the device explicitly so that resources are cleaned up.

Note that by the time the AccessChanged event is raised, the device handle may already be closed by the system.

Definition at line 467 of file EventHandlerForDevice.cs.

        {
            // Enable the following registration ONLY if the Serial device under test is non-internal.
            //

            //deviceAccessInformation = DeviceAccessInformation.CreateFromId(deviceInformation.Id);
            //deviceAccessEventHandler = new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(this.OnDeviceAccessChanged);
            //deviceAccessInformation.AccessChanged += deviceAccessEventHandler;
        }

void RegisterForDeviceWatcherEvents ( void ) [inline, private]

Register for Added and Removed events.

Note that, when disconnecting the device, the device may be closed by the system before the OnDeviceRemoved callback is invoked.

Definition at line 440 of file EventHandlerForDevice.cs.

        {
            deviceAddedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);

            deviceRemovedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);

            deviceWatcher.Added += deviceAddedEventHandler;

            deviceWatcher.Removed += deviceRemovedEventHandler;
        }

void StartDeviceWatcher ( void ) [inline, private]

Definition at line 484 of file EventHandlerForDevice.cs.

        {
            watcherStarted = true;

            if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Start();
            }
        }

void StopDeviceWatcher ( void ) [inline, private]

Definition at line 495 of file EventHandlerForDevice.cs.

        {
            if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
            {
                deviceWatcher.Stop();
            }

            watcherStarted = false;
        }

void UnregisterFromAppEvents ( void ) [inline, private]

Definition at line 426 of file EventHandlerForDevice.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;
            appSuspendEventHandler = null;

            App.Current.Resuming -= appResumeEventHandler;
            appResumeEventHandler = null;
        }

void UnregisterFromDeviceAccessStatusChange ( ) [inline, private]

Definition at line 477 of file EventHandlerForDevice.cs.

        {
            deviceAccessInformation.AccessChanged -= deviceAccessEventHandler;

            deviceAccessEventHandler = null;
        }

void UnregisterFromDeviceWatcherEvents ( void ) [inline, private]

Definition at line 451 of file EventHandlerForDevice.cs.

        {
            deviceWatcher.Added -= deviceAddedEventHandler;
            deviceAddedEventHandler = null;

            deviceWatcher.Removed -= deviceRemovedEventHandler;
            deviceRemovedEventHandler = null;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 62 of file EventHandlerForDevice.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 61 of file EventHandlerForDevice.cs.

SerialDevice device [private]

Definition at line 59 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs> deviceAccessEventHandler [private]

Definition at line 69 of file EventHandlerForDevice.cs.

DeviceAccessInformation deviceAccessInformation [private]

Definition at line 58 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformation> deviceAddedEventHandler [private]

Definition at line 67 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceCloseCallback [private]

Definition at line 64 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceConnectedCallback [private]

Definition at line 65 of file EventHandlerForDevice.cs.

DeviceInformation deviceInformation [private]

Definition at line 57 of file EventHandlerForDevice.cs.

TypedEventHandler<DeviceWatcher, DeviceInformationUpdate> deviceRemovedEventHandler [private]

Definition at line 68 of file EventHandlerForDevice.cs.

String deviceSelector [private]

Definition at line 54 of file EventHandlerForDevice.cs.

DeviceWatcher deviceWatcher [private]

Definition at line 55 of file EventHandlerForDevice.cs.

EventHandlerForDevice eventHandlerForDevice [static, private]

Allows for singleton EventHandlerForDevice.

Definition at line 47 of file EventHandlerForDevice.cs.

Boolean isEnabledAutoReconnect [private]

Definition at line 73 of file EventHandlerForDevice.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 77 of file EventHandlerForDevice.cs.

Object singletonCreationLock = new Object() [static, private]

Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.

Definition at line 52 of file EventHandlerForDevice.cs.

Boolean watcherStarted [private]

Definition at line 72 of file EventHandlerForDevice.cs.

Boolean watcherSuspended [private]

Definition at line 71 of file EventHandlerForDevice.cs.

Property Documentation

EventHandlerForDevice Current [static, get]

Enforces the singleton pattern so that there is only one object handling app events as it relates to the SerialDevice because this sample app only supports communicating with one device at a time.

An instance of EventHandlerForDevice is globally available because the device needs to persist across scenario pages.

If there is no instance of EventHandlerForDevice created before this property is called, an EventHandlerForDevice will be created.

Definition at line 89 of file EventHandlerForDevice.cs.

SerialDevice Device [get]

Definition at line 150 of file EventHandlerForDevice.cs.

DeviceAccessInformation DeviceAccessInformation [get]

Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice object.

Definition at line 174 of file EventHandlerForDevice.cs.

DeviceInformation DeviceInformation [get]

This DeviceInformation represents which device is connected or which device will be reconnected when the device is plugged in again (if IsEnabledAutoReconnect is true);.

Definition at line 162 of file EventHandlerForDevice.cs.

String DeviceSelector [get]

DeviceSelector AQS used to find this device.

Definition at line 185 of file EventHandlerForDevice.cs.

Boolean IsDeviceConnected [get]

Definition at line 142 of file EventHandlerForDevice.cs.

Boolean IsEnabledAutoReconnect [get, set]

True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again.

Definition at line 196 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceClose [get, set]

Definition at line 116 of file EventHandlerForDevice.cs.

TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceConnected [get, set]

Definition at line 129 of file EventHandlerForDevice.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/EventHandlerForDevice.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConnectDisconnect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • Scenario1_ConnectDisconnect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_ConnectDisconnect Class Reference

Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...

List of all members.

Public Member Functions

Scenario1_ConnectDisconnect ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | AddDeviceToList (DeviceInformation deviceInformation, String deviceSelector)
void | AddDeviceWatcher (DeviceWatcher deviceWatcher, String deviceSelector)
void | ClearDeviceEntries ()
async void | ConnectToDevice_Click (Object sender, RoutedEventArgs eventArgs)
void | DisconnectFromDevice_Click (Object sender, RoutedEventArgs eventArgs)
DeviceListEntry | FindDevice (String deviceId)
void | InitializeDeviceWatchers ()
void | OnAppResume (Object sender, Object args)
void | OnAppSuspension (Object sender, SuspendingEventArgs args)
async void | OnDeviceAdded (DeviceWatcher sender, DeviceInformation deviceInformation)
async void | OnDeviceClosing (EventHandlerForDevice sender, DeviceInformation deviceInformation)
void | OnDeviceConnected (EventHandlerForDevice sender, DeviceInformation deviceInformation)
async void | OnDeviceEnumerationComplete (DeviceWatcher sender, Object args)
async void | OnDeviceRemoved (DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
void | RemoveDeviceFromList (String deviceId)
void | SelectDeviceInList (String deviceIdToSelect)
void | StartDeviceWatchers ()
void | StartHandlingAppEvents ()
void | StopDeviceWatchers ()
void | StopHandlingAppEvents ()
void | UpdateConnectDisconnectButtonsAndList (Boolean enableConnectButton)

Private Attributes

EventHandler< Object > | appResumeEventHandler
SuspendingEventHandler | appSuspendEventHandler
const String | ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed"
const String | ButtonNameDisconnectFromDevice = "Disconnect from device"
Boolean | isAllDevicesEnumerated
ObservableCollection
< DeviceListEntry > 		listOfDevices
Dictionary< DeviceWatcher, String > | mapDeviceWatchersToDeviceSelector
MainPage | rootPage = MainPage.Current
Boolean | watchersStarted
Boolean | watchersSuspended

Detailed Description

To use this sample with your device: 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation. 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.

Definition at line 42 of file Scenario1_ConnectDisconnect.xaml.cs.

Constructor & Destructor Documentation

Scenario1_ConnectDisconnect ( ) [inline]

Definition at line 62 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            this.InitializeComponent();

            listOfDevices = new ObservableCollection<DeviceListEntry>();

            mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
            watchersStarted = false;
            watchersSuspended = false;

            isAllDevicesEnumerated = false;
        }

Member Function Documentation

void AddDeviceToList | ( | DeviceInformation | deviceInformation,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Creates a DeviceListEntry for a device and adds it to the list of devices in the UI.

Parameters:
deviceInformation | DeviceInformation on the device to be added to the list
deviceSelector | The AQS used to find this device

Definition at line 276 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // search the device list for a device with a matching interface ID
            var match = FindDevice(deviceInformation.Id);

            // Add the device if it's new
            if (match == null)
            {
                // Create a new element for this device interface, and queue up the query of its
                // device information
                match = new DeviceListEntry(deviceInformation, deviceSelector);

                // Add the new element to the end of the list of devices
                listOfDevices.Add(match);
            }
        }

void AddDeviceWatcher | ( | DeviceWatcher | deviceWatcher,
 |  | String | deviceSelector |
 | ) |  |  | [inline, private]

Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.

Parameters:
deviceWatcher
deviceSelector The AQS used to create the device watcher

Definition at line 222 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
            deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
            deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);

            mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
        }

void ClearDeviceEntries ( void ) [inline, private]

Definition at line 301 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            listOfDevices.Clear();
        }

async void ConnectToDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 125 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    // Create an EventHandlerForDevice to watch for the device we are connecting to
                    EventHandlerForDevice.CreateNewEventHandlerForDevice();

                    // Get notified when the device was successfully connected to or about to be closed
                    EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                    EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;

                    // It is important that the FromIdAsync call is made on the UI thread because the consent prompt, when present,
                    // can only be displayed on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
                    Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);

                    // Disable connect button if we connected to the device
                    UpdateConnectDisconnectButtonsAndList(!openSuccess);
                }
            }
        }

void DisconnectFromDevice_Click | ( | Object | sender,
 |  | RoutedEventArgs | eventArgs |
 | ) |  |  | [inline, private]

Definition at line 154 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            var selection = ConnectDevices.SelectedItems;
            DeviceListEntry entry = null;

            // Prevent auto reconnect because we are voluntarily closing it
            // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
            EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;

            if (selection.Count > 0)
            {
                var obj = selection[0];
                entry = (DeviceListEntry)obj;

                if (entry != null)
                {
                    EventHandlerForDevice.Current.CloseDevice();
                }
            }

            UpdateConnectDisconnectButtonsAndList(true);
        }

DeviceListEntry FindDevice ( String deviceId ) [inline, private]

Searches through the existing list of devices for the first DeviceListEntry that has the specified device Id.

Parameters:
deviceId Id of the device that is being searched for
Returns:
DeviceListEntry that has the provided Id; else a nullptr

Definition at line 312 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (deviceId != null)
            {
                foreach (DeviceListEntry entry in listOfDevices)
                {
                    if (entry.DeviceInformation.Id == deviceId)
                    {
                        return entry;
                    }
                }
            }

            return null;
        }

void InitializeDeviceWatchers ( void ) [inline, private]

Initialize device watchers to look for the Serial Arduino device.

GetDeviceSelector return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or DeviceInformation.createFromIdAsync().

In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.

Definition at line 184 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            string deviceSelector = Windows.Devices.SerialCommunication.SerialDevice.GetDeviceSelectorFromUsbVidPid(
                                                                    ArduinoDevice.Vid, ArduinoDevice.Pid);

            // Create a device watcher to look for instances of the Serial Device that match the device selector
            // used earlier.

            var deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);

            // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
            AddDeviceWatcher(deviceWatcher, deviceSelector);
        }

void OnAppResume | ( | Object | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

See OnAppSuspension for why we are starting the device watchers again.

Parameters:
sender
args

Definition at line 352 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersSuspended)
            {
                watchersSuspended = false;
                StartDeviceWatchers();
            }
        }

void OnAppSuspension | ( | Object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

We must stop the DeviceWatchers because device watchers will continue to raise events even if the app is in suspension, which is not desired (drains battery).

We resume the device watcher once the app resumes again.

Parameters:
sender
eventArgs

Definition at line 334 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            if (watchersStarted)
            {
                watchersSuspended = true;
                StopDeviceWatchers();
            }
            else
            {
                watchersSuspended = false;
            }
        }

async void OnDeviceAdded | ( | DeviceWatcher | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

This function will add the device to the listOfDevices so that it shows up in the UI.

Parameters:
sender
deviceInformation

Definition at line 383 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device added - " + deviceInformation.Id, NotifyType.StatusMessage);

                    AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
                }));
        }

async void OnDeviceClosing | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

The device was closed.

If we will autoreconnect to the device, reflect that in the UI

Parameters:
sender
deviceInformation

Definition at line 460 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    // We were connected to the device that was unplugged, so change the "Disconnect from device" button
                    // to "Do not reconnect to device"
                    if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
                    {
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
                    }
                }));
        }

void OnDeviceConnected | ( | EventHandlerForDevice | sender,
 |  | DeviceInformation | deviceInformation |
 | ) |  |  | [inline, private]

If all the devices have been enumerated, select the device in the list we connected to.

Otherwise let the EnumerationComplete event from the device watcher handle the device selection

Parameters:
sender
deviceInformation

Definition at line 441 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Find and select our connected device
            if (isAllDevicesEnumerated)
            {
                SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
            }

            rootPage.NotifyUser("Connected to - " +
                                EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
        }

async void OnDeviceEnumerationComplete | ( | DeviceWatcher | sender,
 |  | Object | args |
 | ) |  |  | [inline, private]

Notify the UI whether or not we are connected to a device.

Parameters:
sender
args

Definition at line 400 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    isAllDevicesEnumerated = true;

                    // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
                    // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
                    if (EventHandlerForDevice.Current.IsDeviceConnected)
                    {
                        SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);

                        ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;

                        rootPage.NotifyUser("Connected to - " +
                                            EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);

                        EventHandlerForDevice.Current.ConfigureCurrentlyConnectedDevice();
                    }
                    else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
                    {
                        // We will be reconnecting to a device
                        ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;

                        rootPage.NotifyUser("Waiting to reconnect to device -  " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
                    }
                    else
                    {
                        rootPage.NotifyUser("No device is currently connected", NotifyType.StatusMessage);
                    }
                }));
        }

async void OnDeviceRemoved | ( | DeviceWatcher | sender,
 |  | DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [inline, private]

We will remove the device from the UI.

Parameters:
sender
deviceInformationUpdate

Definition at line 366 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device removed - " + deviceInformationUpdate.Id, NotifyType.StatusMessage);

                    RemoveDeviceFromList(deviceInformationUpdate.Id);
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Unregister from App events and DeviceWatcher events because this page will be unloaded.

Parameters:
eventArgs

Definition at line 115 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            StopDeviceWatchers();
            StopHandlingAppEvents();

            // We no longer care about the device being connected
            EventHandlerForDevice.Current.OnDeviceConnected = null;
            EventHandlerForDevice.Current.OnDeviceClose = null;
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 82 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // If we are connected to the device or planning to reconnect, we should disable the list of devices
            // to prevent the user from opening a device without explicitly closing or disabling the auto reconnect
            if (EventHandlerForDevice.Current.IsDeviceConnected
                || (EventHandlerForDevice.Current.IsEnabledAutoReconnect
                && EventHandlerForDevice.Current.DeviceInformation != null))
            {
                UpdateConnectDisconnectButtonsAndList(false);

                // These notifications will occur if we are waiting to reconnect to device when we start the page
                EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
            }
            else
            {
                UpdateConnectDisconnectButtonsAndList(true);
            }

            // Begin watching out for events
            StartHandlingAppEvents();

            // Initialize the desired device watchers so that we can watch for when devices are connected/removed
            InitializeDeviceWatchers();
            StartDeviceWatchers();

            DeviceListSource.Source = listOfDevices;
        }

void RemoveDeviceFromList ( String deviceId ) [inline, private]

Definition at line 293 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Removes the device entry from the interal list; therefore the UI
            var deviceEntry = FindDevice(deviceId);

            listOfDevices.Remove(deviceEntry);
        }

void SelectDeviceInList ( String deviceIdToSelect ) [inline, private]

Selects the item in the UI's listbox that corresponds to the provided device id.

If there are no matches, we will deselect anything that is selected.

Parameters:
deviceIdToSelect The device id of the device to select on the list box

Definition at line 480 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Don't select anything by default.
            ConnectDevices.SelectedIndex = -1;

            for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
            {
                if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
                {
                    ConnectDevices.SelectedIndex = deviceListIndex;

                    break;
                }
            }
        }

void StartDeviceWatchers ( void ) [inline, private]

Starts all device watchers including ones that have been individually stopped.

Definition at line 234 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Start all device watchers
            watchersStarted = true;
            isAllDevicesEnumerated = false;

            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
                    && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Start();
                }
            }
        }

void StartHandlingAppEvents ( void ) [inline, private]

Definition at line 198 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
            appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);

            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending += appSuspendEventHandler;

            App.Current.Resuming += appResumeEventHandler;
        }

void StopDeviceWatchers ( void ) [inline, private]

Stops all device watchers.

Definition at line 253 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // Stop all device watchers
            foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
            {
                if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
                    || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
                {
                    deviceWatcher.Stop();
                }
            }

            // Clear the list of devices so we don't have potentially disconnected devices around
            ClearDeviceEntries();

            watchersStarted = false;
        }

void StopHandlingAppEvents ( void ) [inline, private]

Definition at line 209 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            // This event is raised when the app is exited and when the app is suspended
            App.Current.Suspending -= appSuspendEventHandler;

            App.Current.Resuming -= appResumeEventHandler;
        }

void UpdateConnectDisconnectButtonsAndList ( Boolean enableConnectButton ) [inline, private]

When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.

Parameters:
enableConnectButton The state of ButtonConnectToDevice

Definition at line 500 of file Scenario1_ConnectDisconnect.xaml.cs.

        {
            ButtonConnectToDevice.IsEnabled = enableConnectButton;
            ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;

            ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
        }

Member Data Documentation

EventHandler<Object> appResumeEventHandler [private]

Definition at line 51 of file Scenario1_ConnectDisconnect.xaml.cs.

SuspendingEventHandler appSuspendEventHandler [private]

Definition at line 50 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed" [private]

Definition at line 45 of file Scenario1_ConnectDisconnect.xaml.cs.

const String ButtonNameDisconnectFromDevice = "Disconnect from device" [private]

Definition at line 44 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean isAllDevicesEnumerated [private]

Definition at line 60 of file Scenario1_ConnectDisconnect.xaml.cs.

ObservableCollection<DeviceListEntry> listOfDevices [private]

Definition at line 53 of file Scenario1_ConnectDisconnect.xaml.cs.

Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector [private]

Definition at line 55 of file Scenario1_ConnectDisconnect.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 48 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersStarted [private]

Definition at line 57 of file Scenario1_ConnectDisconnect.xaml.cs.

Boolean watchersSuspended [private]

Definition at line 56 of file Scenario1_ConnectDisconnect.xaml.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/Scenario1_ConnectDisconnect.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_LEDTemp Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • Scenario2_LEDTemp
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_LEDTemp Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Types

enum | LedState { LedStateOn, LedStateOff }

Public Member Functions

Scenario2_LEDTemp ()
void | Dispose ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs eventArgs)
override void | OnNavigatedTo (NavigationEventArgs eventArgs)

Private Member Functions

void | CancelAllIoTasks ()
void | CancelReadTask ()
void | CancelWriteTask ()
void | LED3Switch_Toggled (object sender, RoutedEventArgs e)
void | LED4Switch_Toggled (object sender, RoutedEventArgs e)
void | LED5Switch_Toggled (object sender, RoutedEventArgs e)
void | LED6Switch_Toggled (object sender, RoutedEventArgs e)
async void | NotifyReadCancelingTask ()
async void | NotifyReadTaskCanceled ()
async void | NotifyWriteCancelingTask ()
async void | NotifyWriteTaskCanceled ()
async Task | ReadAsync (CancellationToken cancellationToken)
void | ResetReadCancellationTokenSource ()
void | ResetWriteCancellationTokenSource ()
async void | TemperatureButton_Click (object sender, RoutedEventArgs e)
async Task | WriteAsync (CancellationToken cancellationToken)
async void | WriteLedCommand (String ledNumber, LedState ledState)

Private Attributes

DataReader | DataReaderObject = null
DataWriter | DataWriterObject = null
Boolean | IsNavigatedAway
CancellationTokenSource | ReadCancellationTokenSource
Object | ReadCancelLock = new Object()
MainPage | rootPage = MainPage.Current
CancellationTokenSource | WriteCancellationTokenSource
Object | WriteCancelLock = new Object()

Detailed Description

Definition at line 36 of file Scenario2_LEDTemp.xaml.cs.

Member Enumeration Documentation

enum LedState
Enumerator:
LedStateOn
LedStateOff

Definition at line 58 of file Scenario2_LEDTemp.xaml.cs.

        {
            LedStateOn,
            LedStateOff
        };

Constructor & Destructor Documentation

Scenario2_LEDTemp ( ) [inline]

Definition at line 64 of file Scenario2_LEDTemp.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CancelAllIoTasks ( ) [inline, private]

Definition at line 378 of file Scenario2_LEDTemp.xaml.cs.

        {
            CancelReadTask();
            CancelWriteTask();
        }

void CancelReadTask ( ) [inline, private]

It is important to be able to cancel tasks that may take a while to complete.

Cancelling tasks is the only way to stop any pending IO operations asynchronously. If the Serial Device is closed/deleted while there are pending IOs, the destructor will cancel all pending IO operations.

Definition at line 345 of file Scenario2_LEDTemp.xaml.cs.

        {
            lock (ReadCancelLock)
            {
                if (ReadCancellationTokenSource != null)
                {
                    if (!ReadCancellationTokenSource.IsCancellationRequested)
                    {
                        ReadCancellationTokenSource.Cancel();

                        // Existing IO already has a local copy of the old cancellation token so this reset won't affect it
                        ResetReadCancellationTokenSource();
                    }
                }
            }
        }

void CancelWriteTask ( ) [inline, private]

Definition at line 362 of file Scenario2_LEDTemp.xaml.cs.

        {
            lock (WriteCancelLock)
            {
                if (WriteCancellationTokenSource != null)
                {
                    if (!WriteCancellationTokenSource.IsCancellationRequested)
                    {
                        WriteCancellationTokenSource.Cancel();

                        // Existing IO already has a local copy of the old cancellation token so this reset won't affect it
                        ResetWriteCancellationTokenSource();
                    }
                }
            }
        }

void Dispose ( ) [inline]

Definition at line 69 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (ReadCancellationTokenSource != null)
            {
                ReadCancellationTokenSource.Dispose();
                ReadCancellationTokenSource = null;
            }

            if (WriteCancellationTokenSource != null)
            {
                WriteCancellationTokenSource.Dispose();
                WriteCancellationTokenSource = null;
            }
        }

void LED3Switch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the LED toggle switch is toggled.

Definition at line 123 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (LED3Switch.IsOn == true)
            {
                WriteLedCommand("3", LedState.LedStateOn);
            }
            else
            {
                WriteLedCommand("3", LedState.LedStateOff);
            }
        }

void LED4Switch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 135 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (LED4Switch.IsOn == true)
            {
                WriteLedCommand("4", LedState.LedStateOn);
            }
            else
            {
                WriteLedCommand("4", LedState.LedStateOff);
            }
        }

void LED5Switch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 147 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (LED5Switch.IsOn == true)
            {
                WriteLedCommand("5", LedState.LedStateOn);
            }
            else
            {
                WriteLedCommand("5", LedState.LedStateOff);
            }
        }

void LED6Switch_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 159 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (LED6Switch.IsOn == true)
            {
                WriteLedCommand("6", LedState.LedStateOn);
            }
            else
            {
                WriteLedCommand("6", LedState.LedStateOff);
            }
        }

async void NotifyReadCancelingTask ( ) [inline, private]

Print a status message saying we are canceling a task and disable all buttons to prevent multiple cancel requests.

Definition at line 405 of file Scenario2_LEDTemp.xaml.cs.

        {
            // Setting the dispatcher priority to high allows the UI to handle disabling of all the buttons
            // before any of the IO completion callbacks get a chance to modify the UI; that way this method
            // will never get the opportunity to overwrite UI changes made by IO callbacks
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Canceling Read... Please wait...", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyReadTaskCanceled ( ) [inline, private]

Notifies the UI that the operation has been cancelled.

Definition at line 439 of file Scenario2_LEDTemp.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Read request has been cancelled", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyWriteCancelingTask ( ) [inline, private]

Definition at line 420 of file Scenario2_LEDTemp.xaml.cs.

        {
            // Setting the dispatcher priority to high allows the UI to handle disabling of all the buttons
            // before any of the IO completion callbacks get a chance to modify the UI; that way this method
            // will never get the opportunity to overwrite UI changes made by IO callbacks
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Canceling Write... Please wait...", NotifyType.StatusMessage);
                    }
                }));
        }

async void NotifyWriteTaskCanceled ( ) [inline, private]

Definition at line 451 of file Scenario2_LEDTemp.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    if (!IsNavigatedAway)
                    {
                        rootPage.NotifyUser("Write request has been cancelled", NotifyType.StatusMessage);
                    }
                }));
        }

override void OnNavigatedFrom ( NavigationEventArgs eventArgs ) [inline, protected]

Cancel any on going tasks when navigating away from the page so the device is in a consistent state throughout all the scenarios.

Parameters:
eventArgs

Definition at line 114 of file Scenario2_LEDTemp.xaml.cs.

        {
            IsNavigatedAway = true;
            CancelAllIoTasks();
        }

override void OnNavigatedTo ( NavigationEventArgs eventArgs ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

We will enable/disable parts of the UI if the device doesn't support it.

Parameters:
eventArgs Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 91 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (EventHandlerForDevice.Current.Device == null)
            {
                LEDTempScrollViewer.Visibility = Visibility.Collapsed;
                MainPage.Current.NotifyUser("Device is not connected", NotifyType.ErrorMessage);
            }
            else
            {
                MainPage.Current.NotifyUser("Connected to " + EventHandlerForDevice.Current.DeviceInformation.Id,
                                            NotifyType.StatusMessage);

                // So we can reset future tasks
                ResetReadCancellationTokenSource();
                ResetWriteCancellationTokenSource();
            }
        }

async Task ReadAsync ( CancellationToken cancellationToken ) [inline, private]

Read from the input output stream using a task.

Parameters:
cancellationToken

Definition at line 309 of file Scenario2_LEDTemp.xaml.cs.

        {
            Task<UInt32> loadAsyncTask;

            uint ReadBufferLength = 7;

            // Don't start any IO if we canceled the task
            lock (ReadCancelLock)
            {
                cancellationToken.ThrowIfCancellationRequested();

                // Cancellation Token will be used so we can stop the task operation explicitly
                // The completion function should still be called so that we can properly handle a canceled task
                DataReaderObject.InputStreamOptions = InputStreamOptions.Partial;
                loadAsyncTask = DataReaderObject.LoadAsync(ReadBufferLength).AsTask(cancellationToken);
            }

            UInt32 bytesRead = await loadAsyncTask;

            if (bytesRead > 0)
            {
                String temp = DataReaderObject.ReadString(bytesRead);
                TemperatureValue.Text = temp.Trim() + "°C";
            }

            rootPage.NotifyUser("Read completed - " + bytesRead.ToString() + " bytes were read", NotifyType.StatusMessage);
        }

void ResetReadCancellationTokenSource ( ) [inline, private]

Definition at line 384 of file Scenario2_LEDTemp.xaml.cs.

        {
            // Create a new cancellation token source so that can cancel all the tokens again
            ReadCancellationTokenSource = new CancellationTokenSource();

            // Hook the cancellation callback (called whenever Task.cancel is called)
            ReadCancellationTokenSource.Token.Register(() => NotifyReadCancelingTask());
        }

void ResetWriteCancellationTokenSource ( ) [inline, private]

Definition at line 393 of file Scenario2_LEDTemp.xaml.cs.

        {
            // Create a new cancellation token source so that can cancel all the tokens again
            WriteCancellationTokenSource = new CancellationTokenSource();

            // Hook the cancellation callback (called whenever Task.cancel is called)
            WriteCancellationTokenSource.Token.Register(() => NotifyWriteCancelingTask());
        }

async void TemperatureButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the Temperature Button is clicked.

Definition at line 227 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Getting temperature...", NotifyType.StatusMessage);

                    DataWriterObject = new DataWriter(EventHandlerForDevice.Current.Device.OutputStream);
                    DataWriterObject.WriteString("temp\r");

                    await WriteAsync(WriteCancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*exception*/)
                {
                    NotifyWriteTaskCanceled();
                }
                catch (Exception exception)
                {
                    MainPage.Current.NotifyUser(exception.Message.ToString(), NotifyType.ErrorMessage);
                    Debug.WriteLine(exception.Message.ToString());
                }
                finally
                {
                    DataWriterObject.DetachStream();
                    DataWriterObject = null;
                }

                try
                {
                    TemperatureValue.Text = String.Empty;

                    DataReaderObject = new DataReader(EventHandlerForDevice.Current.Device.InputStream);
                    await ReadAsync(ReadCancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*exception*/)
                {
                    NotifyReadTaskCanceled();
                }
                catch (Exception exception)
                {
                    MainPage.Current.NotifyUser(exception.Message.ToString(), NotifyType.ErrorMessage);
                    Debug.WriteLine(exception.Message.ToString());
                }
                finally
                {
                    DataReaderObject.DetachStream();
                    DataReaderObject = null;
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

async Task WriteAsync ( CancellationToken cancellationToken ) [inline, private]

Write to the output stream using a task.

Parameters:
cancellationToken

Definition at line 287 of file Scenario2_LEDTemp.xaml.cs.

        {
            Task<UInt32> storeAsyncTask;

            // Don't start any IO if we canceled the task
            lock (WriteCancelLock)
            {
                cancellationToken.ThrowIfCancellationRequested();

                // Cancellation Token will be used so we can stop the task operation explicitly
                // The completion function should still be called so that we can properly handle a canceled task
                storeAsyncTask = DataWriterObject.StoreAsync().AsTask(cancellationToken);
            }

            UInt32 bytesWritten = await storeAsyncTask;
            rootPage.NotifyUser("Write completed - " + bytesWritten.ToString() + " bytes written", NotifyType.StatusMessage);
        }

async void WriteLedCommand | ( | String | ledNumber,
 |  | LedState | ledState |
 | ) |  |  | [inline, private]

Writes a custom command to the device to turn LEDs on/off using a DataWriter to the OutputStream.

Parameters:
ledNumber
ledState

Definition at line 177 of file Scenario2_LEDTemp.xaml.cs.

        {
            if (EventHandlerForDevice.Current.IsDeviceConnected)
            {
                try
                {
                    rootPage.NotifyUser("Writing...", NotifyType.StatusMessage);

                    DataWriterObject = new DataWriter(EventHandlerForDevice.Current.Device.OutputStream);

                    switch (ledState)
                    {
                        case LedState.LedStateOn:
                            DataWriterObject.WriteString("ledon " + ledNumber + "\r");
                            break;

                        case LedState.LedStateOff:
                            DataWriterObject.WriteString("ledoff " + ledNumber + "\r");
                            break;

                        default:
                            break;
                    }

                    await WriteAsync(WriteCancellationTokenSource.Token);
                }
                catch (OperationCanceledException /*exception*/)
                {
                    NotifyWriteTaskCanceled();
                }
                catch (Exception exception)
                {
                    MainPage.Current.NotifyUser(exception.Message.ToString(), NotifyType.ErrorMessage);
                    Debug.WriteLine(exception.Message.ToString());
                }
                finally
                {
                    DataWriterObject.DetachStream();
                    DataWriterObject = null;
                }
            }
            else
            {
                Utilities.NotifyDeviceNotConnected();
            }
        }

Member Data Documentation

DataReader DataReaderObject = null [private]

Definition at line 47 of file Scenario2_LEDTemp.xaml.cs.

DataWriter DataWriterObject = null [private]

Definition at line 53 of file Scenario2_LEDTemp.xaml.cs.

Boolean IsNavigatedAway [private]

Definition at line 56 of file Scenario2_LEDTemp.xaml.cs.

CancellationTokenSource ReadCancellationTokenSource [private]

Definition at line 44 of file Scenario2_LEDTemp.xaml.cs.

Object ReadCancelLock = new Object() [private]

Definition at line 45 of file Scenario2_LEDTemp.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 41 of file Scenario2_LEDTemp.xaml.cs.

CancellationTokenSource WriteCancellationTokenSource [private]

Definition at line 50 of file Scenario2_LEDTemp.xaml.cs.

Object WriteCancelLock = new Object() [private]

Definition at line 51 of file Scenario2_LEDTemp.xaml.cs.

The documentation for this class was generated from the following file:
  • SerialArduino/cs/Scenario2_LEDTemp.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utilities Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SerialArduino
  • Utilities
Static Public Member Functions

Utilities Class Reference

This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages.

List of all members.

Static Public Member Functions

static void NotifyDeviceNotConnected ()

Detailed Description

Definition at line 26 of file Utilities.cs.

Member Function Documentation

static void NotifyDeviceNotConnected ( void ) [inline, static]

Prints an error message stating that device is not connected.

Definition at line 31 of file Utilities.cs.

        {
            MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
        }

The documentation for this class was generated from the following file:
  • SerialArduino/cs/Utilities.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGame Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

Simple3DGame Class Reference

#include "Simple3DGame.h"

List of all members.

Public Member Functions

Simple3DGame ()
float | BonusTime ()
float | BonusTime ()
float | BonusTime ()
void | ContinueGame ()
void | ContinueGame ()
void | ContinueGame ()
Level CurrentLevel ()
Level CurrentLevel ()
std::shared_ptr< Level > const & | CurrentLevel ()
void | CycleBackground ()
void | FinalizeLoadLevel ()
void | FinalizeLoadLevel ()
void | FinalizeLoadLevel ()
bool | GameActive ()
bool | GameActive ()
bool | GameActive ()
Camera GameCamera ()
Camera GameCamera ()
Camera & GameCamera ()
HighScoreEntry HighScore ()
HighScoreEntry HighScore ()
HighScoreEntry HighScore ()
void | Initialize (_In_ MoveLookController^controller, _In_ GameRenderer^renderer)
void | Initialize (_In_ MoveLookController^controller, _In_ GameRenderer^renderer)
void | Initialize (_In_ std::shared_ptr< MoveLookController > const &controller, _In_ std::shared_ptr< GameRenderer > const &renderer)
bool | IsActivePlay ()
bool | IsActivePlay ()
bool | IsActivePlay ()
bool | IsTrial ()
bool | LevelActive ()
bool | LevelActive ()
bool | LevelActive ()
int | LevelCompleted ()
int | LevelCompleted ()
int | LevelCompleted ()
void | LoadGame ()
void | LoadGame ()
void | LoadGame ()
concurrency::task< void > | LoadLevelAsync ()
winrt::Windows::Foundation::IAsyncAction | LoadLevelAsync ()
concurrency::task< void > | LoadLevelAsync ()
void | OnResuming ()
void | OnResuming ()
void | OnResuming ()
void | OnSuspending ()
void | OnSuspending ()
void | OnSuspending ()
void | PauseGame ()
void | PauseGame ()
void | PauseGame ()
std::vector< GameObject^> | RenderObjects ()
std::vector< GameObject^> | RenderObjects ()
std::vector< std::shared_ptr
< GameObject > > const & 		RenderObjects ()
GameState RunGame ()
GameState RunGame ()
GameState RunGame ()
void | SetBackground (uint32 background)
void | SetCurrentLevelToSavedState ()
void | SetCurrentLevelToSavedState ()
void | SetCurrentLevelToSavedState ()
void | StartLevel ()
void | StartLevel ()
void | StartLevel ()
float | TimeRemaining ()
float | TimeRemaining ()
float | TimeRemaining ()
int | TotalHits ()
int | TotalHits ()
int | TotalHits ()
int | TotalShots ()
int | TotalShots ()
int | TotalShots ()
void | UpdateGameConfig (Windows::ApplicationModel::Store::LicenseInformation^licenseInformation)

Public Attributes

internal | __pad0__: Simple3DGame()

Private Member Functions

void | InitializeAmmo ()
void | InitializeAmmo ()
void | InitializeAmmo ()
void | InitializeGameConfig ()
void | LoadHighScore ()
void | LoadHighScore ()
void | LoadHighScore ()
void | LoadState ()
void | LoadState ()
void | LoadState ()
void | SaveHighScore ()
void | SaveHighScore ()
void | SaveHighScore ()
void | SaveState ()
void | SaveState ()
void | SaveState ()
void | UpdateDynamics ()
void | UpdateDynamics ()
void | UpdateDynamics ()

Private Attributes

uint32 | m_activeBackground
std::vector< Sphere^> | m_ammo
std::vector< std::shared_ptr
< Sphere > > 		m_ammo
uint32 | m_ammoCount
uint32_t | m_ammoCount
uint32 | m_ammoNext
uint32_t | m_ammoNext
Audio m_audioController
Camera m_camera
MoveLookController m_controller
std::shared_ptr
< MoveLookController > 		m_controller
uint32_t | m_currentLevel
uint32 | m_currentLevel
bool | m_gameActive
GameConfig m_gameConfig
std::vector< Level^> | m_level
std::vector< std::shared_ptr
< Level > > 		m_level
bool | m_levelActive
float | m_levelBonusTime
uint32_t | m_levelCount
uint32 | m_levelCount
float | m_levelDuration
float | m_levelTimeRemaining
DirectX::XMFLOAT3 | m_maxBound
DirectX::XMFLOAT3 | m_minBound
std::vector< std::shared_ptr
< GameObject > > 		m_objects
std::vector< GameObject^> | m_objects
std::shared_ptr< Sphere > | m_player
Sphere m_player
GameRenderer m_renderer
std::shared_ptr< GameRenderer > | m_renderer
std::vector< GameObject^> | m_renderObjects
std::vector< std::shared_ptr
< GameObject > > 		m_renderObjects
PersistentState m_savedState
GameTimer m_timer
HighScoreEntry m_topScore
int | m_totalHits
int | m_totalShots

Detailed Description

Definition at line 68 of file Simple3DGame.h.

Constructor & Destructor Documentation

Simple3DGame ( )

Definition at line 35 of file Simple3DGame.cpp.

                          :
    m_ammoCount(0),
    m_ammoNext(0),
    m_gameActive(false),
    m_levelActive(false),
    m_totalHits(0),
    m_totalShots(0),
    m_levelBonusTime(0.0),
    m_levelTimeRemaining(0.0),
    m_levelCount(0),
    m_currentLevel(0)
{
    m_topScore.totalHits = 0;
    m_topScore.totalShots = 0;
    m_topScore.levelCompleted = 0;
}

Member Function Documentation

float BonusTime ( ) [inline]

Definition at line 94 of file Simple3DGame.h.

{ return m_levelBonusTime; };

float BonusTime ( ) [inline]

Definition at line 85 of file Simple3DGame.h.

{ return m_levelBonusTime; };

float BonusTime ( ) [inline]

Definition at line 103 of file Simple3DGame.h.

{ return m_levelBonusTime; };

void ContinueGame ( )
void ContinueGame ( )
void ContinueGame ( )

Definition at line 329 of file Simple3DGame.cpp.

{
    m_timer->Start();
    m_controller->Active(true);
}

Level CurrentLevel ( ) [inline]

Definition at line 107 of file Simple3DGame.h.

{ return m_level[m_currentLevel]; };

Level CurrentLevel ( ) [inline]

Definition at line 98 of file Simple3DGame.h.

{ return m_level[m_currentLevel]; };

std::shared_ptr<Level> const& CurrentLevel ( ) [inline]

Definition at line 89 of file Simple3DGame.h.

{ return m_level[m_currentLevel]; };

void CycleBackground ( )

Definition at line 1177 of file Simple3DGame.cpp.

{
    // There may be gaps in the background textures list that are available for use because the
    // user has not purchased all them in order or at all.
    // Cycle through the list looking for the next one that is valid.  This may require wrapping
    // back to the beginning.

    unsigned int newBackground = m_activeBackground;

    while (newBackground < GameConstants::MaxBackgroundTextures)
    {
        newBackground++;
        if (newBackground >= GameConstants::MaxBackgroundTextures)
        {
            newBackground = 0;
            break;
        }
        else if (m_gameConfig.backgroundAvailable[newBackground])
        {
            break;
        }
    }

    if (newBackground != m_activeBackground)
    {
        m_activeBackground = newBackground;
        m_renderer->SetBackground(newBackground);
    }
}

void FinalizeLoadLevel ( )
void FinalizeLoadLevel ( )

Definition at line 296 of file Simple3DGame.cpp.

{
    // This method is called on the main thread, so Direct3D 11 DeviceContext
    // method calls are allowable here.

    // Finalize the Level loading.
    m_renderer->FinalizeLoadLevelResources();
}

void FinalizeLoadLevel ( )
bool GameActive ( ) [inline]

Definition at line 95 of file Simple3DGame.h.

{ return m_gameActive; };

bool GameActive ( ) [inline]

Definition at line 104 of file Simple3DGame.h.

{ return m_gameActive; };

bool GameActive ( ) [inline]

Definition at line 86 of file Simple3DGame.h.

{ return m_gameActive; };

Camera GameCamera ( ) [inline]

Definition at line 109 of file Simple3DGame.h.

{ return m_camera; };

Camera GameCamera ( ) [inline]

Definition at line 100 of file Simple3DGame.h.

{ return m_camera; };

Camera& GameCamera ( ) [inline]

Definition at line 91 of file Simple3DGame.h.

{ return m_camera; };

HighScoreEntry HighScore ( ) [inline]

Definition at line 97 of file Simple3DGame.h.

{ return m_topScore; };

HighScoreEntry HighScore ( ) [inline]

Definition at line 106 of file Simple3DGame.h.

{ return m_topScore; };

HighScoreEntry HighScore ( ) [inline]

Definition at line 88 of file Simple3DGame.h.

{ return m_topScore; };

void Initialize | ( | _In_ MoveLookController^ | controller,
 |  | _In_ GameRenderer^ | renderer
 | ) |  |

Definition at line 54 of file Simple3DGame.cpp.

{
    // This method is expected to be called as an asynchronous task.
    // Care should be taken to not call rendering methods on the
    // m_renderer as this would result in the D3D Context being
    // used in multiple threads, which is not allowed.

    m_controller = controller;
    m_renderer = renderer;

    m_audioController = ref new Audio;
    m_audioController->CreateDeviceIndependentResources();

    m_ammo = std::vector<Sphere^>(GameConstants::MaxAmmo);
    m_objects = std::vector<GameObject^>();
    m_renderObjects = std::vector<GameObject^>();
    m_level = std::vector<Level^>();

    m_savedState = ref new PersistentState();
    m_savedState->Initialize(ApplicationData::Current->LocalSettings->Values, "Game");

    m_timer = ref new GameTimer();

    // Create a sphere primitive to represent the player.
    // The sphere will be used to handle collisions and constrain the player in the world.
    // It is not rendered so it is not added to the list of render objects.
    // It is added to the object list so it will be included in intersection calculations.
    m_player = ref new Sphere(XMFLOAT3(0.0f, -1.3f, 4.0f), 0.2f);
    m_objects.push_back(m_player);
    m_player->Active(true);

    m_camera = ref new Camera;
    m_camera->SetProjParams(XM_PI / 2, 1.0f, 0.01f, 100.0f);
    m_camera->SetViewParams(
        m_player->Position(),            // Eye point in world coordinates.
        XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
        XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
        );

    m_controller->Pitch(m_camera->Pitch());
    m_controller->Yaw(m_camera->Yaw());

    // Instantiate a set of primitives to represent the containing world. These objects
    // maintain the geometry and material properties of the walls, floor and ceiling.
    // The TargetId is used to identify the world objects so that the right geometry
    // and textures can be associated with them later after those resources have
    // been created.
    GameObject^ world = ref new GameObject();
    world->TargetId(GameConstants::WorldFloorId);
    world->Active(true);
    m_renderObjects.push_back(world);

    world = ref new GameObject();
    world->TargetId(GameConstants::WorldCeilingId);
    world->Active(true);
    m_renderObjects.push_back(world);

    world = ref new GameObject();
    world->TargetId(GameConstants::WorldWallsId);
    world->Active(true);
    m_renderObjects.push_back(world);

    // Min and max Bound are defining the world space of the game.
    // All camera motion and dynamics are confined to this space.
    m_minBound = XMFLOAT3(-4.0f, -3.0f, -6.0f);
    m_maxBound = XMFLOAT3(4.0f, 3.0f, 6.0f);

    // Instantiate the Cylinders for use in the various game levels.
    // Each cylinder has a different initial position, radius and direction vector,
    // but share a common set of material properties.
    for (int a = 0; a < GameConstants::MaxCylinders; a++)
    {
        Cylinder^ cylinder;
        switch (a)
        {
        case 0:
            cylinder = ref new Cylinder(XMFLOAT3(-2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 1:
            cylinder = ref new Cylinder(XMFLOAT3(2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 2:
            cylinder = ref new Cylinder(XMFLOAT3(0.0f, -3.0f, -2.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 3:
            cylinder = ref new Cylinder(XMFLOAT3(-1.5f, -3.0f, -4.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 4:
            cylinder = ref new Cylinder(XMFLOAT3(1.5f, -3.0f, -4.0f), 0.50f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        }
        cylinder->Active(true);
        m_objects.push_back(cylinder);
        m_renderObjects.push_back(cylinder);
    }

    MediaReader^ mediaReader = ref new MediaReader;
    auto targetHitSound = mediaReader->LoadMedia("Assets\\hit.wav");

    // Instantiate the targets for use in the game.
    // Each target has a different initial position, size and orientation,
    // but share a common set of material properties.
    // The target is defined by a position and two vectors that define both
    // the plane of the target in world space and the size of the parallelogram
    // based on the lengths of the vectors.
    // Each target is assigned a number for identification purposes.
    // The Target ID number is 1 based.
    // All targets have the same material properties.
    for (int a = 1; a < GameConstants::MaxTargets; a++)
    {
        Face^ target;
        switch (a)
        {
        case 1:
            target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -1.5f), XMFLOAT3(-1.5f, -1.0f, -2.0f), XMFLOAT3(-2.5f, 1.0f, -1.5f));
            break;
        case 2:
            target = ref new Face(XMFLOAT3(-1.0f, 1.0f, -3.0f), XMFLOAT3(0.0f, 1.0f, -3.0f), XMFLOAT3(-1.0f, 2.0f, -3.0f));
            break;
        case 3:
            target = ref new Face(XMFLOAT3(1.5f, 0.0f, -3.0f), XMFLOAT3(2.5f, 0.0f, -2.0f), XMFLOAT3(1.5f, 2.0f, -3.0f));
            break;
        case 4:
            target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -5.5f), XMFLOAT3(-0.5f, -1.0f, -5.5f), XMFLOAT3(-2.5f, 1.0f, -5.5f));
            break;
        case 5:
            target = ref new Face(XMFLOAT3(0.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, -2.0f, -5.0f), XMFLOAT3(0.5f, 0.0f, -5.0f));
            break;
        case 6:
            target = ref new Face(XMFLOAT3(1.5f, -2.0f, -5.5f), XMFLOAT3(2.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, 0.0f, -5.5f));
            break;
        case 7:
            target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        case 8:
            target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        case 9:
            target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        }

        target->Target(true);
        target->TargetId(a);
        target->Active(true);
        target->HitSound(ref new SoundEffect());
        target->HitSound()->Initialize(
            m_audioController->SoundEffectEngine(),
            mediaReader->GetOutputWaveFormatEx(),
            targetHitSound
            );

        m_objects.push_back(target);
        m_renderObjects.push_back(target);
    }

    // Instantiate a set of spheres to be used as ammunition for the game
    // and set the material properties of the spheres.
    auto ammoHitSound = mediaReader->LoadMedia("Assets\\bounce.wav");

    for (int a = 0; a < GameConstants::MaxAmmo; a++)
    {
        m_ammo[a] = ref new Sphere;
        m_ammo[a]->Radius(GameConstants::AmmoRadius);
        m_ammo[a]->HitSound(ref new SoundEffect());
        m_ammo[a]->HitSound()->Initialize(
            m_audioController->SoundEffectEngine(),
            mediaReader->GetOutputWaveFormatEx(),
            ammoHitSound
            );
        m_ammo[a]->Active(false);
        m_renderObjects.push_back(m_ammo[a]);
    }

    // Instantiate each of the game levels. The Level class contains methods
    // that initialize the objects in the world for the given level and also
    // define any motion paths for the objects in that level.

    m_level.push_back(ref new Level1);
    m_level.push_back(ref new Level2);
    m_level.push_back(ref new Level3);
    m_level.push_back(ref new Level4);
    m_level.push_back(ref new Level5);
    m_level.push_back(ref new Level6);
    m_levelCount = static_cast<uint32>(m_level.size());

    // Load the top score from disk if it exists.
    LoadHighScore();

    // Load the currentScore for saved state if it exists.
    LoadState();

    m_controller->Active(false);
}

void Initialize | ( | _In_ MoveLookController^ | controller,
 |  | _In_ GameRenderer^ | renderer
 | ) |  |
void Initialize | ( | _In_ std::shared_ptr< MoveLookController > const & | controller,
 |  | _In_ std::shared_ptr< GameRenderer > const & | renderer
 | ) |  |

Definition at line 41 of file Simple3DGame.cpp.

{
    // This method is expected to be called as an asynchronous task.
    // Care should be taken to not call rendering methods on the
    // m_renderer as this would result in the D3D Context being
    // used in multiple threads, which is not allowed.

    m_controller = controller;
    m_renderer = renderer;

    m_audioController.CreateDeviceIndependentResources();

    m_ammo.resize(GameConstants::MaxAmmo);

    m_savedState.Initialize(ApplicationData::Current().LocalSettings().Values(), L"Game");

    // Create a sphere primitive to represent the player.
    // The sphere will be used to handle collisions and constrain the player in the world.
    // It is not rendered so it is not added to the list of render objects.
    // It is added to the object list so it will be included in intersection calculations.
    m_player = std::make_shared<Sphere>(XMFLOAT3(0.0f, -1.3f, 4.0f), 0.2f);
    m_objects.push_back(m_player);
    m_player->Active(true);

    m_camera.SetProjParams(XM_PI / 2, 1.0f, 0.01f, 100.0f);
    m_camera.SetViewParams(
        m_player->Position(),            // Eye point in world coordinates.
        XMFLOAT3(0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
        XMFLOAT3(0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
        );

    m_controller->Pitch(m_camera.Pitch());
    m_controller->Yaw(m_camera.Yaw());

    // Instantiate a set of primitives to represent the containing world. These objects
    // maintain the geometry and material properties of the walls, floor and ceiling.
    // The TargetId is used to identify the world objects so that the right geometry
    // and textures can be associated with them later after those resources have
    // been created.
    std::shared_ptr<GameObject> world = std::make_shared<GameObject>();
    world->TargetId(GameConstants::WorldFloorId);
    world->Active(true);
    m_renderObjects.push_back(world);

    world = std::make_shared<GameObject>();
    world->TargetId(GameConstants::WorldCeilingId);
    world->Active(true);
    m_renderObjects.push_back(world);

    world = std::make_shared<GameObject>();
    world->TargetId(GameConstants::WorldWallsId);
    world->Active(true);
    m_renderObjects.push_back(world);

    // Min and max Bound are defining the world space of the game.
    // All camera motion and dynamics are confined to this space.
    m_minBound = XMFLOAT3(-4.0f, -3.0f, -6.0f);
    m_maxBound = XMFLOAT3(4.0f, 3.0f, 6.0f);

    // Instantiate the Cylinders for use in the various game levels.
    // Each cylinder has a different initial position, radius and direction vector,
    // but share a common set of material properties.
    for (int a = 0; a < GameConstants::MaxCylinders; a++)
    {
        std::shared_ptr<Cylinder> cylinder;
        switch (a)
        {
        case 0:
            cylinder = std::make_shared<Cylinder>(XMFLOAT3(-2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 1:
            cylinder = std::make_shared<Cylinder>(XMFLOAT3(2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 2:
            cylinder = std::make_shared<Cylinder>(XMFLOAT3(0.0f, -3.0f, -2.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 3:
            cylinder = std::make_shared<Cylinder>(XMFLOAT3(-1.5f, -3.0f, -4.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        case 4:
            cylinder = std::make_shared<Cylinder>(XMFLOAT3(1.5f, -3.0f, -4.0f), 0.50f, XMFLOAT3(0.0f, 6.0f, 0.0f));
            break;
        }
        cylinder->Active(true);
        m_objects.push_back(cylinder);
        m_renderObjects.push_back(cylinder);
    }

    MediaReader mediaReader;
    auto targetHitSoundX = mediaReader.LoadMedia(L"Assets\\hit.wav");

    // Instantiate the targets for use in the game.
    // Each target has a different initial position, size and orientation,
    // but share a common set of material properties.
    // The target is defined by a position and two vectors that define both
    // the plane of the target in world space and the size of the parallelogram
    // based on the lengths of the vectors.
    // Each target is assigned a number for identification purposes.
    // The Target ID number is 1 based.
    // All targets have the same material properties.
    for (int a = 1; a < GameConstants::MaxTargets; a++)
    {
        std::shared_ptr<Face> target;
        switch (a)
        {
        case 1:
            target = std::make_shared<Face>(XMFLOAT3(-2.5f, -1.0f, -1.5f), XMFLOAT3(-1.5f, -1.0f, -2.0f), XMFLOAT3(-2.5f, 1.0f, -1.5f));
            break;
        case 2:
            target = std::make_shared<Face>(XMFLOAT3(-1.0f, 1.0f, -3.0f), XMFLOAT3(0.0f, 1.0f, -3.0f), XMFLOAT3(-1.0f, 2.0f, -3.0f));
            break;
        case 3:
            target = std::make_shared<Face>(XMFLOAT3(1.5f, 0.0f, -3.0f), XMFLOAT3(2.5f, 0.0f, -2.0f), XMFLOAT3(1.5f, 2.0f, -3.0f));
            break;
        case 4:
            target = std::make_shared<Face>(XMFLOAT3(-2.5f, -1.0f, -5.5f), XMFLOAT3(-0.5f, -1.0f, -5.5f), XMFLOAT3(-2.5f, 1.0f, -5.5f));
            break;
        case 5:
            target = std::make_shared<Face>(XMFLOAT3(0.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, -2.0f, -5.0f), XMFLOAT3(0.5f, 0.0f, -5.0f));
            break;
        case 6:
            target = std::make_shared<Face>(XMFLOAT3(1.5f, -2.0f, -5.5f), XMFLOAT3(2.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, 0.0f, -5.5f));
            break;
        case 7:
            target = std::make_shared<Face>(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        case 8:
            target = std::make_shared<Face>(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        case 9:
            target = std::make_shared<Face>(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
            break;
        }

        target->Target(true);
        target->TargetId(a);
        target->Active(true);
        target->HitSound(std::make_shared<SoundEffect>());
        target->HitSound()->Initialize(
            m_audioController.SoundEffectEngine(),
            mediaReader.GetOutputWaveFormatEx(),
            targetHitSoundX
            );

        m_objects.push_back(target);
        m_renderObjects.push_back(target);
    }

    // Instantiate a set of spheres to be used as ammunition for the game
    // and set the material properties of the spheres.
    auto ammoHitSound = mediaReader.LoadMedia(L"Assets\\bounce.wav");

    for (int a = 0; a < GameConstants::MaxAmmo; a++)
    {
        m_ammo[a] = std::make_shared<Sphere>();
        m_ammo[a]->Radius(GameConstants::AmmoRadius);
        m_ammo[a]->HitSound(std::make_shared<SoundEffect>());
        m_ammo[a]->HitSound()->Initialize(
            m_audioController.SoundEffectEngine(),
            mediaReader.GetOutputWaveFormatEx(),
            ammoHitSound
            );
        m_ammo[a]->Active(false);
        m_renderObjects.push_back(m_ammo[a]);
    }

    // Instantiate each of the game levels. The Level class contains methods
    // that initialize the objects in the world for the given level and also
    // define any motion paths for the objects in that level.

    m_level.push_back(std::make_shared<Level1>());
    m_level.push_back(std::make_shared<Level2>());
    m_level.push_back(std::make_shared<Level3>());
    m_level.push_back(std::make_shared<Level4>());
    m_level.push_back(std::make_shared<Level5>());
    m_level.push_back(std::make_shared<Level6>());
    m_levelCount = static_cast<uint32_t>(m_level.size());

    // Load the top score from disk if it exists.
    LoadHighScore();

    // Load the currentScore for saved state if it exists.
    LoadState();

    m_controller->Active(false);
}

void InitializeAmmo ( ) [private]
void InitializeAmmo ( ) [private]
void InitializeAmmo ( ) [private]

Definition at line 1060 of file Simple3DGame.cpp.

{
    m_ammoCount = 0;
    m_ammoNext = 0;
    for (uint32 i = 0; i < GameConstants::MaxAmmo; i++)
    {
        m_ammo[i]->Active(false);
    }
}

void InitializeGameConfig ( ) [private]

Definition at line 1088 of file Simple3DGame.cpp.

{
    m_gameConfig.isTrial = true;
    m_gameConfig.autoFire = false;
    m_controller->AutoFire(false);
    m_activeBackground = 0;
    m_gameConfig.backgroundAvailable[0] = true;
    for (int i = 1; i < GameConstants::MaxBackgroundTextures; i++)
    {
        m_gameConfig.backgroundAvailable[i] = false;
    }
}

bool IsActivePlay ( ) [inline]

Definition at line 98 of file Simple3DGame.h.

{ return m_timer->Active(); }

bool IsActivePlay ( ) [inline]

Definition at line 81 of file Simple3DGame.h.

{ return m_timer.Active(); }

bool IsActivePlay ( ) [inline]

Definition at line 90 of file Simple3DGame.h.

{ return m_timer->Active(); }

bool IsTrial ( ) [inline]

Definition at line 99 of file Simple3DGame.h.

{ return m_gameConfig.isTrial; }

bool LevelActive ( ) [inline]

Definition at line 96 of file Simple3DGame.h.

{ return m_levelActive; };

bool LevelActive ( ) [inline]

Definition at line 105 of file Simple3DGame.h.

{ return m_levelActive; };

bool LevelActive ( ) [inline]

Definition at line 87 of file Simple3DGame.h.

{ return m_levelActive; };

int LevelCompleted ( ) [inline]

Definition at line 100 of file Simple3DGame.h.

{ return m_currentLevel; };

int LevelCompleted ( ) [inline]

Definition at line 82 of file Simple3DGame.h.

{ return m_currentLevel; };

int LevelCompleted ( ) [inline]

Definition at line 91 of file Simple3DGame.h.

{ return m_currentLevel; };

void LoadGame ( )

Definition at line 254 of file Simple3DGame.cpp.

{
    m_player->Position(XMFLOAT3 (0.0f, -1.3f, 4.0f));

    m_camera->SetViewParams(
        m_player->Position(),            // Eye point in world coordinates.
        XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
        XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
        );

    m_controller->Pitch(m_camera->Pitch());
    m_controller->Yaw(m_camera->Yaw());
    m_currentLevel = 0;
    m_levelTimeRemaining = 0.0f;
    m_levelBonusTime = m_levelTimeRemaining;
    m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;
    InitializeAmmo();
    m_totalHits = 0;
    m_totalShots = 0;
    m_gameActive = false;
    m_levelActive = false;
    m_timer->Reset();
}

void LoadGame ( )
void LoadGame ( )
void LoadHighScore ( ) [private]
void LoadHighScore ( ) [private]

Definition at line 1051 of file Simple3DGame.cpp.

{
    m_topScore.levelCompleted = m_savedState->LoadInt32(":HighScore:LevelCompleted", 0);
    m_topScore.totalShots = m_savedState->LoadInt32(":HighScore:TotalShots", 0);
    m_topScore.totalHits = m_savedState->LoadInt32(":HighScore:TotalHits", 0);
}

void LoadHighScore ( ) [private]
winrt::Windows::Foundation::IAsyncAction LoadLevelAsync ( )
task< void > LoadLevelAsync ( )

Definition at line 280 of file Simple3DGame.cpp.

{
    // Initialize the level and spin up the async loading of the rendering
    // resources for the level.
    // This will run in a separate thread, so for Direct3D 11, only Device
    // methods are allowed.  Any DeviceContext method calls need to be
    // done in FinalizeLoadLevel.

    m_level[m_currentLevel]->Initialize(m_objects);
    m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;

    return m_renderer->LoadLevelResourcesAsync();
}

concurrency::task<void> LoadLevelAsync ( )
void LoadState ( ) [private]
void LoadState ( ) [private]

Definition at line 913 of file Simple3DGame.cpp.

{
    m_gameActive = m_savedState->LoadBool(":GameActive", m_gameActive);
    m_levelActive = m_savedState->LoadBool(":LevelActive", m_levelActive);

    if (m_gameActive)
    {
        // Loading from the last known state means the game wasn't finished when it was last played,
        // so set the current level.

        m_totalShots = m_savedState->LoadInt32(":TotalShots", 0);
        m_totalHits = m_savedState->LoadInt32(":TotalHits", 0);
        m_currentLevel = m_savedState->LoadInt32(":LevelCompleted", 0);
        m_levelBonusTime = m_savedState->LoadSingle(":BonusRoundTime", 0.0f);

        m_levelTimeRemaining = m_levelBonusTime;

        // Reload the current player position and set both the camera and the controller
        // with the current Look Direction.
        m_player->Position(
            m_savedState->LoadXMFLOAT3(":PlayerPosition", XMFLOAT3(0.0f, 0.0f, 0.0f))
            );
        m_camera->Eye(m_player->Position());
        m_camera->LookDirection(
            m_savedState->LoadXMFLOAT3(":PlayerLookDirection", XMFLOAT3(0.0f, 0.0f, 1.0f))
            );
        m_controller->Pitch(m_camera->Pitch());
        m_controller->Yaw(m_camera->Yaw());
    }
    else
    {
        // The game was not being played when it was last saved, so initialize to the beginning.
        m_currentLevel = 0;
        m_levelBonusTime = 0;
    }
}

void LoadState ( ) [private]
void OnResuming ( )
void OnResuming ( )

Definition at line 429 of file Simple3DGame.cpp.

{
    m_audioController->ResumeAudio();
}

void OnResuming ( )
void OnSuspending ( )
void OnSuspending ( )

Definition at line 422 of file Simple3DGame.cpp.

{
    m_audioController->SuspendAudio();
}

void OnSuspending ( )
void PauseGame ( )
void PauseGame ( )
void PauseGame ( )

Definition at line 321 of file Simple3DGame.cpp.

{
    m_timer->Stop();
    SaveState();
}

std::vector<GameObject^> RenderObjects ( ) [inline]

Definition at line 101 of file Simple3DGame.h.

{ return m_renderObjects; };

std::vector<std::shared_ptr<GameObject> > const& RenderObjects ( ) [inline]

Definition at line 92 of file Simple3DGame.h.

{ return m_renderObjects; };

std::vector<GameObject^> RenderObjects ( ) [inline]

Definition at line 110 of file Simple3DGame.h.

{ return m_renderObjects; };

GameState RunGame ( )
GameState RunGame ( )

Definition at line 337 of file Simple3DGame.cpp.

{
    // This method is called to execute a single time interval for active game play.
    // It returns the resulting state of game play after the interval has been executed.

    m_timer->Update();

    m_levelTimeRemaining = m_levelDuration - m_timer->PlayingTime();

    if (m_levelTimeRemaining <= 0.0f)
    {
        // Time expired, so the game is over.
        m_levelTimeRemaining = 0.0f;
        InitializeAmmo();
        m_timer->Reset();
        m_gameActive = false;
        m_levelActive = false;
        SaveState();

        if (m_totalHits > m_topScore.totalHits)
        {
            // There is a new high score so save it.
            m_topScore.totalHits = m_totalHits;
            m_topScore.totalShots = m_totalShots;
            m_topScore.levelCompleted = m_currentLevel;

            SaveHighScore();
        }
        return GameState::TimeExpired;
    }
    else
    {
        // Time has not expired, so run one frame of game play.
        m_player->Velocity(m_controller->Velocity());
        m_camera->LookDirection(m_controller->LookDirection());

        UpdateDynamics();

        // Update the Camera with the player position updates from the dynamics calculations.
        m_camera->Eye(m_player->Position());
        m_camera->LookDirection(m_controller->LookDirection());

        if (m_level[m_currentLevel]->Update(m_timer->PlayingTime(), m_timer->DeltaTime(), m_levelTimeRemaining, m_objects))
        {
            // The level has been completed.
            m_levelActive = false;
            InitializeAmmo();

            if (m_currentLevel < m_levelCount-1)
            {
                // More levels to go so increment the level number.
                // Actual level loading will occur in the LoadLevelAsync / FinalizeLoadLevel
                // methods.
                m_timer->Reset();
                m_currentLevel++;
                m_levelBonusTime = m_levelTimeRemaining;
                SaveState();
                return GameState::LevelComplete;
            }
            else
            {
                // All levels have been completed.
                m_timer->Reset();
                m_gameActive = false;
                m_levelActive = false;
                SaveState();

                if (m_totalHits > m_topScore.totalHits)
                {
                    // There is a new high score so save it.
                    m_topScore.totalHits = m_totalHits;
                    m_topScore.totalShots = m_totalShots;
                    m_topScore.levelCompleted = m_currentLevel;

                    SaveHighScore();
                }
                return GameState::GameComplete;
            }
        }
    }
    return GameState::Active;
}

GameState RunGame ( )
void SaveHighScore ( ) [private]

Definition at line 1042 of file Simple3DGame.cpp.

{
    m_savedState->SaveInt32(":HighScore:LevelCompleted", m_topScore.levelCompleted);
    m_savedState->SaveInt32(":HighScore:TotalShots", m_topScore.totalShots);
    m_savedState->SaveInt32(":HighScore:TotalHits", m_topScore.totalHits);
}

void SaveHighScore ( ) [private]
void SaveHighScore ( ) [private]
void SaveState ( ) [private]
void SaveState ( ) [private]
void SaveState ( ) [private]

Definition at line 860 of file Simple3DGame.cpp.

{
    // Save basic state of the game.
    m_savedState->SaveBool(":GameActive", m_gameActive);
    m_savedState->SaveBool(":LevelActive", m_levelActive);
    m_savedState->SaveInt32(":LevelCompleted", m_currentLevel);
    m_savedState->SaveInt32(":TotalShots", m_totalShots);
    m_savedState->SaveInt32(":TotalHits", m_totalHits);
    m_savedState->SaveSingle(":BonusRoundTime", m_levelBonusTime);
    m_savedState->SaveXMFLOAT3(":PlayerPosition", m_player->Position());
    m_savedState->SaveXMFLOAT3(":PlayerLookDirection", m_controller->LookDirection());

    if (m_levelActive)
    {
        // The game is currently in the middle of a level, so save the extended state of
        // the game.
        m_savedState->SaveSingle(":LevelDuration", m_levelDuration);
        m_savedState->SaveSingle(":LevelPlayingTime", m_timer->PlayingTime());

        m_savedState->SaveInt32(":AmmoCount", m_ammoCount);
        m_savedState->SaveInt32(":AmmoNext", m_ammoNext);

        const int bufferLength = 16;
        char16 str[bufferLength];

        for (uint32 i = 0; i < m_ammoCount; i++)
        {
            int len = swprintf_s(str, bufferLength, L"%d", i);
            Platform::String^ string = ref new Platform::String(str, len);

            m_savedState->SaveBool(Platform::String::Concat(":AmmoActive", string), m_ammo[i]->Active());
            m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoPosition", string), m_ammo[i]->Position());
            m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoVelocity", string), m_ammo[i]->Velocity());
        }

        m_savedState->SaveInt32(":ObjectCount", static_cast<int>(m_objects.size()));

        for (uint32 i = 0; i < m_objects.size(); i++)
        {
            int len = swprintf_s(str, bufferLength, L"%d", i);
            Platform::String^ string = ref new Platform::String(str, len);

            m_savedState->SaveBool(Platform::String::Concat(":ObjectActive", string), m_objects[i]->Active());
            m_savedState->SaveBool(Platform::String::Concat(":ObjectTarget", string), m_objects[i]->Target());
            m_savedState->SaveXMFLOAT3(Platform::String::Concat(":ObjectPosition", string), m_objects[i]->Position());
        }

        m_level[m_currentLevel]->SaveState(m_savedState);
    }
}

void SetBackground ( uint32 background )

Definition at line 1163 of file Simple3DGame.cpp.

{
    if (background < GameConstants::MaxBackgroundTextures)
    {
        if (m_gameConfig.backgroundAvailable[background])
        {
            m_activeBackground = background;
            m_renderer->SetBackground(background);
        }
    }
}

void SetCurrentLevelToSavedState ( )

Definition at line 952 of file Simple3DGame.cpp.

{
    if (m_gameActive)
    {
        if (m_levelActive)
        {
            // Middle of a level so restart where left off.
            m_levelDuration = m_savedState->LoadSingle(":LevelDuration", 0.0f);

            m_timer->Reset();
            m_timer->PlayingTime(m_savedState->LoadSingle(":LevelPlayingTime", 0.0f));

            m_ammoCount = m_savedState->LoadInt32(":AmmoCount", 0);

            m_ammoNext = m_savedState->LoadInt32(":AmmoNext", 0);

            const int bufferLength = 16;
            char16 str[bufferLength];

            for (uint32 i = 0; i < m_ammoCount; i++)
            {
                int len = swprintf_s(str, bufferLength, L"%d", i);
                Platform::String^ string = ref new Platform::String(str, len);

                m_ammo[i]->Active(
                    m_savedState->LoadBool(
                        Platform::String::Concat(":AmmoActive", string),
                        m_ammo[i]->Active()
                        )
                    );
                if (m_ammo[i]->Active())
                {
                    m_ammo[i]->OnGround(false);
                }

                m_ammo[i]->Position(
                    m_savedState->LoadXMFLOAT3(
                        Platform::String::Concat(":AmmoPosition", string),
                        m_ammo[i]->Position()
                        )
                    );

                m_ammo[i]->Velocity(
                    m_savedState->LoadXMFLOAT3(
                        Platform::String::Concat(":AmmoVelocity", string),
                        m_ammo[i]->Velocity()
                        )
                    );
            }

            int storedObjectCount = 0;
            storedObjectCount = m_savedState->LoadInt32(":ObjectCount", 0);

            storedObjectCount = min(storedObjectCount, static_cast<int>(m_objects.size()));

            for (int i = 0; i < storedObjectCount; i++)
            {
                int len = swprintf_s(str, bufferLength, L"%d", i);
                Platform::String^ string = ref new Platform::String(str, len);

                m_objects[i]->Active(
                    m_savedState->LoadBool(
                        Platform::String::Concat(":ObjectActive", string),
                        m_objects[i]->Active()
                        )
                    );

                m_objects[i]->Target(
                    m_savedState->LoadBool(
                        Platform::String::Concat(":ObjectTarget", string),
                        m_objects[i]->Target()
                        )
                    );

                m_objects[i]->Position(
                    m_savedState->LoadXMFLOAT3(
                        Platform::String::Concat(":ObjectPosition", string),
                        m_objects[i]->Position()
                        )
                    );
            }

            m_level[m_currentLevel]->LoadState(m_savedState);
            m_levelTimeRemaining = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime - m_timer->PlayingTime();
        }
    }
}

void SetCurrentLevelToSavedState ( )
void SetCurrentLevelToSavedState ( )
void StartLevel ( )
void StartLevel ( )
void StartLevel ( )

Definition at line 307 of file Simple3DGame.cpp.

{
    m_timer->Reset();
    m_timer->Start();
    if (m_currentLevel == 0)
    {
        m_gameActive = true;
    }
    m_levelActive = true;
    m_controller->Active(true);
}

float TimeRemaining ( ) [inline]

Definition at line 99 of file Simple3DGame.h.

{ return m_levelTimeRemaining; };

float TimeRemaining ( ) [inline]

Definition at line 90 of file Simple3DGame.h.

{ return m_levelTimeRemaining; };

float TimeRemaining ( ) [inline]

Definition at line 108 of file Simple3DGame.h.

{ return m_levelTimeRemaining; };

int TotalHits ( ) [inline]

Definition at line 93 of file Simple3DGame.h.

{ return m_totalHits; };

int TotalHits ( ) [inline]

Definition at line 102 of file Simple3DGame.h.

{ return m_totalHits; };

int TotalHits ( ) [inline]

Definition at line 84 of file Simple3DGame.h.

{ return m_totalHits; };

int TotalShots ( ) [inline]

Definition at line 92 of file Simple3DGame.h.

{ return m_totalShots; };

int TotalShots ( ) [inline]

Definition at line 83 of file Simple3DGame.h.

{ return m_totalShots; };

int TotalShots ( ) [inline]

Definition at line 101 of file Simple3DGame.h.

{ return m_totalShots; };

void UpdateDynamics ( ) [private]
void UpdateDynamics ( ) [private]

Definition at line 436 of file Simple3DGame.cpp.

{
    float timeTotal = m_timer->PlayingTime();
    float timeFrame = m_timer->DeltaTime();
    bool fire = m_controller->IsFiring();

#pragma region Shoot Ammo
    // Shoot ammo.
    if (fire)
    {
        static float lastFired;  // Timestamp of last ammo fired.

        if (timeTotal < lastFired)
        {
            // timeTotal is not guarenteed to be monotomically increasing because it is
            // reset at each level.
            lastFired = timeTotal - GameConstants::Physics::AutoFireDelay;
        }

        if (timeTotal - lastFired >= GameConstants::Physics::AutoFireDelay)
        {
            // Get inverse view matrix.
            XMMATRIX invView;
            XMVECTOR det;
            invView = XMMatrixInverse(&det, m_camera->View());

            // Compute initial velocity in world space from camera space.
            XMFLOAT4 initialVelocity(0.0f, 0.0f, 15.0f, 0.0f);
            m_ammo[m_ammoNext]->Velocity(XMVector4Transform(XMLoadFloat4(&initialVelocity), invView));

            // Set the initial position of the ammo to be fired. The position is offset from the player
            // to avoid an initial collision with the player object.
            XMFLOAT4 initialPosition(0.0f, -0.15f, m_player->Radius() + GameConstants::AmmoSize, 1.0f);
            m_ammo[m_ammoNext]->Position(XMVector4Transform(XMLoadFloat4(&initialPosition), invView));

            // Initially not laying on ground.
            m_ammo[m_ammoNext]->OnGround(false);
            m_ammo[m_ammoNext]->Active(true);

            // Set position in array of next Ammo to use.
            // We will re-use ammo taking the least recently used once we have hit the
            // MaxAmmo in use.
            m_ammoNext = (m_ammoNext + 1) % GameConstants::MaxAmmo;
            m_ammoCount = min(m_ammoCount + 1, GameConstants::MaxAmmo);

            lastFired = timeTotal;
            m_totalShots++;
        }
    }
#pragma endregion

#pragma region Animate Objects
    // Walk the list of objects looking for any objects that have an animation associated with it.
    // Update the position of the object based on evaluating the animation object with the current time.
    // Once the current time (timeTotal) is past the end of the animation time remove
    // the animation object since it is no longer needed.
    for (uint32 i = 0; i < m_objects.size(); i++)
    {
        if (m_objects[i]->AnimatePosition())
        {
            m_objects[i]->Position(m_objects[i]->AnimatePosition()->Evaluate(timeTotal));
            if (m_objects[i]->AnimatePosition()->IsFinished(timeTotal))
            {
                m_objects[i]->AnimatePosition(nullptr);
            }
        }
    }
#pragma endregion

    // If the elapsed time is too long, we slice up the time and handle physics over several
    // smaller time steps to avoid missing collisions.
    float timeLeft = timeFrame;
    float elapsedFrameTime;
    while (timeLeft > 0.0f)
    {
        elapsedFrameTime = min(timeLeft, GameConstants::Physics::FrameLength);
        timeLeft -= elapsedFrameTime;

        // Update the player position.
        m_player->Position(m_player->VectorPosition() + m_player->VectorVelocity() * elapsedFrameTime);

        // Do m_player / object intersections.
        for (uint32 a = 0; a < m_objects.size(); a++)
        {
            if (m_objects[a]->Active() && m_objects[a] != m_player)
            {
                XMFLOAT3 contact;
                XMFLOAT3 normal;

                if (m_objects[a]->IsTouching(m_player->Position(), m_player->Radius(), &contact, &normal))
                {
                    // Player is in contact with m_objects[a].
                    XMVECTOR oneToTwo;
                    oneToTwo = -XMLoadFloat3(&normal);

                    float impact = XMVectorGetX(
                        XMVector3Dot (oneToTwo, m_player->VectorVelocity())
                        );
                    // Make sure that the player is actually headed towards the object. At grazing angles there
                    // could appear to be an impact when the player is actually already hit and moving away.
                    if (impact > 0.0f)
                    {
                        // Compute the normal and tangential components of the player's velocity.
                        XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, m_player->VectorVelocity()) * oneToTwo;
                        XMVECTOR velocityOneTangent = m_player->VectorVelocity() - velocityOneNormal;

                        // Compute post-collision velocity.
                        m_player->Velocity(velocityOneTangent - velocityOneNormal);

                        // Fix the positions so that the player is just touching the object.
                        float distanceToMove = m_player->Radius();
                        m_player->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));
                    }
                }
            }
        }
        {
            // Do collision detection of the player with the bounding world.
            XMFLOAT3 position = m_player->Position();
            XMFLOAT3 velocity = m_player->Velocity();
            float radius = m_player->Radius();

            // Check for player collisions with the walls floor or ceiling and adjust the position.
            float limit = m_minBound.x + radius;
            if (position.x < limit)
            {
                position.x = limit;
                velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
            }
            limit = m_maxBound.x - radius;
            if (position.x > limit)
            {
                position.x = limit;
                velocity.x = -velocity.x + GameConstants::Physics::GroundRestitution;
            }
            limit = m_minBound.y + radius;
            if (position.y < limit)
            {
                position.y = limit;
                velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
            }
            limit = m_maxBound.y - radius;
            if (position.y > limit)
            {
                position.y = limit;
                velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
            }
            limit = m_minBound.z + radius;
            if (position.z < limit)
            {
                position.z = limit;
                velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
            }
            limit = m_maxBound.z - radius;
            if (position.z > limit)
            {
                position.z = limit;
                velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
            }
            m_player->Position(position);
            m_player->Velocity(velocity);
        }

        // Animate the ammo.
        if (m_ammoCount > 0)
        {
            // Check for collisions between ammo.
#pragma region inter-ammo collision detection
            if (m_ammoCount > 1)
            {
                for (uint32 one = 0; one < m_ammoCount; one++)
                {
                    for (uint32 two = (one + 1); two < m_ammoCount; two++)
                    {
                        // Check collision between instances One and Two.
                        // OneToTwo is the vector between the centers of the two ammo that are being checked.
                        XMVECTOR oneToTwo;
                        oneToTwo = m_ammo[two]->VectorPosition() - m_ammo[one]->VectorPosition();
                        float distanceSquared;
                        distanceSquared = XMVectorGetX(
                            XMVector3LengthSq(oneToTwo)
                            );
                        if (distanceSquared < (GameConstants::AmmoSize * GameConstants::AmmoSize))
                        {
                            // The two ammo are intersecting.
                            oneToTwo = XMVector3Normalize(oneToTwo);

                            // Check if the two instances are already moving away from each other.
                            // If so, skip collision.  This can happen when a lot of instances are
                            // bunched up next to each other.
                            float impact;
                            impact = XMVectorGetX(
                                XMVector3Dot(oneToTwo, m_ammo[one]->VectorVelocity()) -
                                XMVector3Dot(oneToTwo, m_ammo[two]->VectorVelocity())
                                );
                            if (impact > 0.0f)
                            {
                                // Compute the normal and tangential components of one's velocity.
                                XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
                                XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
                                XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;
                                // Compute the normal and tangential components of two's velocity.
                                XMVECTOR velocityTwo = (1 - GameConstants::Physics::BounceLost) * m_ammo[two]->VectorVelocity();
                                XMVECTOR velocityTwoNormal = XMVector3Dot(oneToTwo, velocityTwo) * oneToTwo;
                                XMVECTOR velocityTwoTangent = velocityTwo - velocityTwoNormal;

                                // Compute the post-collision velocities.
                                m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer) +
                                    velocityTwoNormal * GameConstants::Physics::BounceTransfer
                                    );
                                m_ammo[two]->Velocity(velocityTwoTangent - velocityTwoNormal * (1 - GameConstants::Physics::BounceTransfer) +
                                    velocityOneNormal * GameConstants::Physics::BounceTransfer
                                    );

                                // Fix the positions so that the two balls are exactly GameConstants::AmmoSize apart.
                                float distanceToMove = (GameConstants::AmmoSize - sqrtf(distanceSquared)) * 0.5f;
                                m_ammo[one]->Position(m_ammo[one]->VectorPosition() - (oneToTwo * distanceToMove));
                                m_ammo[two]->Position(m_ammo[two]->VectorPosition() + (oneToTwo * distanceToMove));

                                // Flag the two instances so that they are not laying on ground.
                                m_ammo[one]->OnGround(false);
                                m_ammo[two]->OnGround(false);

                                // Start playing the sounds for the impact between the two balls.
                                m_ammo[one]->PlaySound(impact, m_player->Position());
                                m_ammo[two]->PlaySound(impact, m_player->Position());
                            }
                        }
                    }
                }
            }
#pragma endregion

#pragma region Ammo-Object intersections
            // Check for intersections between the ammo and the other objects in the scene.
            for (uint32 one = 0; one < m_ammoCount; one++)
            {
                if (m_objects.size() > 0)
                {
                    if (!m_ammo[one]->OnGround())
                    {
                        for (uint32 i = 0; i < m_objects.size(); i++)
                        {
                            if (m_objects[i]->Active())
                            {
                                // The object is currently active in the scene. There may be objects in the list
                                // that are currently inactive, so those are skipped.
                                XMFLOAT3 contact;
                                XMFLOAT3 normal;

                                if (m_objects[i]->IsTouching(m_ammo[one]->Position(), GameConstants::AmmoRadius, &contact, &normal))
                                {
                                    // Ball is in contact with Object.
                                    XMVECTOR oneToTwo;
                                    oneToTwo = -XMLoadFloat3(&normal);

                                    float impact;
                                    impact = XMVectorGetX(
                                        XMVector3Dot (oneToTwo, m_ammo[one]->VectorVelocity())
                                        );
                                    // Make sure that the ball is actually headed towards the object. At grazing angles there
                                    // could appear to be an impact when the ball is actually already hit and moving away.
                                    if (impact > 0.0f)
                                    {
                                        // Compute the normal and tangential components of the ammo's velocity.
                                        XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
                                        XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
                                        XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;

                                        // Compute post-collision velocity of the ammo.
                                        m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer));

                                        // Fix the position so that the ball is exactly GameConstants::AmmoRadius from target.
                                        float distanceToMove = GameConstants::AmmoSize;
                                        m_ammo[one]->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));

                                        // Flag the Ammo as not laying on ground.
                                        m_ammo[one]->OnGround(false);

                                        // Play the sound associated with the Ammo hitting something.
                                        m_ammo[one]->PlaySound(impact, m_player->Position());

                                        if (m_objects[i]->Target() && !m_objects[i]->Hit())
                                        {
                                            // The object is a target and isn't currently hit, so mark it as hit and
                                            // play the sound associated with the impact.
                                            m_objects[i]->Hit(true);
                                            m_objects[i]->HitTime(timeTotal);
                                            m_totalHits++;

                                            m_objects[i]->PlaySound(impact, m_player->Position());
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
#pragma endregion

#pragma region Apply Gravity and world intersection
            // Apply gravity and check for collision against enclosing volume.
            for (uint32 i = 0; i < m_ammoCount; i++)
            {
                // Update the position and velocity of the ammo instance.
                m_ammo[i]->Position(m_ammo[i]->VectorPosition() + m_ammo[i]->VectorVelocity() * elapsedFrameTime);

                XMFLOAT3 velocity = m_ammo[i]->Velocity();
                XMFLOAT3 position = m_ammo[i]->Position();

                velocity.x -= velocity.x * 0.1f * elapsedFrameTime;
                velocity.z -= velocity.z * 0.1f * elapsedFrameTime;
                if (!m_ammo[i]->OnGround())
                {
                    // Apply gravity if the ammo instance is not already resting on the ground.
                    velocity.y -= GameConstants::Physics::Gravity * elapsedFrameTime;
                }

                if (!m_ammo[i]->OnGround())
                {
                    float limit = m_minBound.y + GameConstants::AmmoRadius;
                    if (position.y < limit)
                    {
                        // The ammo instance hit the ground.
                        // Align the ammo instance to the ground, invert the Y component of the velocity and
                        // play the impact sound. The X and Z velocity components will be reduced
                        // because of friction.
                        position.y = limit;
                        m_ammo[i]->PlaySound(-velocity.y, m_player->Position());

                        velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
                        velocity.x *= GameConstants::Physics::Friction;
                        velocity.z *= GameConstants::Physics::Friction;
                    }
                }
                else
                {
                    // The ammo instance is resting or rolling on ground.
                    // X and Z velocity components are reduced because of friction.
                    velocity.x *= GameConstants::Physics::Friction;
                    velocity.z *= GameConstants::Physics::Friction;
                }

                float limit = m_maxBound.y - GameConstants::AmmoRadius;
                if (position.y > limit)
                {
                    // The ammo instance hit the ceiling.
                    // Align the ammo instance to the ceiling, invert the Y component of the velocity and
                    // play the impact sound. The X and Z velocity components will be reduced
                    // because of friction.
                    position.y = limit;
                    m_ammo[i]->PlaySound(-velocity.y, m_player->Position());

                    velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
                    velocity.x *= GameConstants::Physics::Friction;
                    velocity.z *= GameConstants::Physics::Friction;
                }

                limit = m_minBound.y + GameConstants::AmmoRadius;
                if ((GameConstants::Physics::Gravity * (position.y - limit) + 0.5f * velocity.y * velocity.y) < GameConstants::Physics::RestThreshold)
                {
                    // The Y velocity component is below the resting threshold so flag the instance as
                    // laying on the ground and set the Y velocity component to zero.
                    position.y = limit;
                    velocity.y = 0.0f;
                    m_ammo[i]->OnGround(true);
                }

                limit = m_minBound.z + GameConstants::AmmoRadius;
                if (position.z < limit)
                {
                    // The ammo instance hit the a wall in the min Z direction.
                    // Align the ammo instance to the wall, invert the Z component of the velocity and
                    // play the impact sound.
                    position.z = limit;
                    m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
                    velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
                }

                limit = m_maxBound.z - GameConstants::AmmoRadius;
                if (position.z > limit)
                {
                    // The ammo instance hit the a wall in the max Z direction.
                    // Align the ammo instance to the wall, invert the Z component of the velocity and
                    // play the impact sound.
                    position.z = limit;
                    m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
                    velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
                }

                limit = m_minBound.x + GameConstants::AmmoRadius;
                if (position.x < limit)
                {
                    // The ammo instance hit the a wall in the min X direction.
                    // Align the ammo instance to the wall, invert the X component of the velocity and
                    // play the impact sound.
                    position.x = limit;
                    m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
                    velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
                }

                limit = m_maxBound.x - GameConstants::AmmoRadius;
                if (position.x > limit)
                {
                    // The ammo instance hit the a wall in the max X direction.
                    // Align the ammo instance to the wall, invert the X component of the velocity and
                    // play the impact sound.
                    position.x = limit;
                    m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
                    velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
                }

                // Save the updated velocity and position for the ammo instance.
                m_ammo[i]->Velocity(velocity);
                m_ammo[i]->Position(position);
            }
        }
    }
#pragma endregion
}

void UpdateDynamics ( ) [private]
void UpdateGameConfig ( Windows::ApplicationModel::Store::LicenseInformation^ licenseInformation )

Member Data Documentation

internal __pad0__

Definition at line 71 of file Simple3DGame.h.

uint32 m_activeBackground [private]

Definition at line 152 of file Simple3DGame.h.

std::vector< Sphere^> m_ammo [private]

Definition at line 117 of file Simple3DGame.h.

std::vector<std::shared_ptr<Sphere> > m_ammo [private]

Definition at line 108 of file Simple3DGame.h.

uint32 m_ammoCount [private]

Definition at line 118 of file Simple3DGame.h.

uint32_t m_ammoCount [private]

Definition at line 109 of file Simple3DGame.h.

uint32 m_ammoNext [private]

Definition at line 119 of file Simple3DGame.h.

uint32_t m_ammoNext [private]

Definition at line 110 of file Simple3DGame.h.

Audio m_audioController [private]

Definition at line 115 of file Simple3DGame.h.

Camera m_camera [private]

Definition at line 113 of file Simple3DGame.h.

MoveLookController m_controller [private]

Definition at line 111 of file Simple3DGame.h.

std::shared_ptr<MoveLookController> m_controller [private]

Definition at line 102 of file Simple3DGame.h.

uint32_t m_currentLevel [private]

Definition at line 125 of file Simple3DGame.h.

uint32 m_currentLevel [private]

Definition at line 134 of file Simple3DGame.h.

bool m_gameActive [private]

Definition at line 125 of file Simple3DGame.h.

GameConfig m_gameConfig [private]

Definition at line 151 of file Simple3DGame.h.

std::vector<std::shared_ptr<Level> > m_level [private]

Definition at line 123 of file Simple3DGame.h.

std::vector< Level^> m_level [private]

Definition at line 132 of file Simple3DGame.h.

bool m_levelActive [private]

Definition at line 126 of file Simple3DGame.h.

float m_levelBonusTime [private]

Definition at line 130 of file Simple3DGame.h.

uint32 m_levelCount [private]

Definition at line 133 of file Simple3DGame.h.

uint32_t m_levelCount [private]

Definition at line 124 of file Simple3DGame.h.

float m_levelDuration [private]

Definition at line 129 of file Simple3DGame.h.

float m_levelTimeRemaining [private]

Definition at line 131 of file Simple3DGame.h.

DirectX::XMFLOAT3 m_maxBound [private]

Definition at line 141 of file Simple3DGame.h.

DirectX::XMFLOAT3 m_minBound [private]

Definition at line 140 of file Simple3DGame.h.

std::vector<std::shared_ptr<GameObject> > m_objects [private]

Definition at line 128 of file Simple3DGame.h.

std::vector< GameObject^> m_objects [private]

Definition at line 137 of file Simple3DGame.h.

Sphere m_player [private]

Definition at line 136 of file Simple3DGame.h.

std::shared_ptr<Sphere> m_player [private]

Definition at line 127 of file Simple3DGame.h.

std::shared_ptr<GameRenderer> m_renderer [private]

Definition at line 103 of file Simple3DGame.h.

GameRenderer m_renderer [private]

Definition at line 112 of file Simple3DGame.h.

std::vector< GameObject^> m_renderObjects [private]

Definition at line 138 of file Simple3DGame.h.

std::vector<std::shared_ptr<GameObject> > m_renderObjects [private]

Definition at line 129 of file Simple3DGame.h.

PersistentState m_savedState [private]

Definition at line 122 of file Simple3DGame.h.

GameTimer m_timer [private]

Definition at line 124 of file Simple3DGame.h.

HighScoreEntry m_topScore [private]

Definition at line 121 of file Simple3DGame.h.

int m_totalHits [private]

Definition at line 127 of file Simple3DGame.h.

int m_totalShots [private]

Definition at line 128 of file Simple3DGame.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cpp/Simple3DGame.h
  • Simple3DGameDX/cppwinrt/Simple3DGame.h
  • Simple3DGameXaml/cpp/Simple3DGame.h
  • Simple3DGameDX/cpp/Simple3DGame.cpp
  • Simple3DGameDX/cppwinrt/Simple3DGame.cpp
  • Simple3DGameXaml/cpp/Simple3DGame.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IGameUIControl Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Simple3DGameDX
  • IGameUIControl
Public Member Functions

IGameUIControl Interface Reference

#include "GameUIControl.h"

Inherited by GameInfoOverlay, and GameInfoOverlay.

List of all members.

Public Member Functions

void | HideGameInfoOverlay ()
void | HideTooSmall ()
void | SetAction (GameInfoOverlayCommand action)
void | SetGameLoading (uint32 dots)
void | SetGameOver (bool win, int maxLevel, int hitCount, int shotCount, int highScore)
void | SetGameStats (int maxLevel, int hitCount, int shotCount)
void | SetLevelStart (int level, Platform::String^objective, float timeLimit, float bonusTime)
void | SetPause (int level, int hitCount, int shotCount, float timeRemaining)
void | ShowGameInfoOverlay ()
void | ShowTooSmall ()

Detailed Description

Definition at line 45 of file GameUIControl.h.

Member Function Documentation

void HideGameInfoOverlay ( )

Implemented in GameInfoOverlay, and GameInfoOverlay.

void HideTooSmall ( )

Implemented in GameInfoOverlay, and GameInfoOverlay.

void SetAction ( GameInfoOverlayCommand action )

Implemented in GameInfoOverlay, and GameInfoOverlay.

void SetGameLoading ( uint32 dots )

Implemented in GameInfoOverlay.

void SetGameOver | ( | bool | win,
 |  | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | int | highScore
 | ) |  |

Implemented in GameInfoOverlay, and GameInfoOverlay.

void SetGameStats | ( | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount
 | ) |  |

Implemented in GameInfoOverlay, and GameInfoOverlay.

void SetLevelStart | ( | int | level,
 |  | Platform::String^ | objective,
 |  | float | timeLimit,
 |  | float | bonusTime
 | ) |  |

Implemented in GameInfoOverlay.

void SetPause | ( | int | level,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | float | timeRemaining
 | ) |  |

Implemented in GameInfoOverlay, and GameInfoOverlay.

void ShowGameInfoOverlay ( )

Implemented in GameInfoOverlay, and GameInfoOverlay.

void ShowTooSmall ( )

Implemented in GameInfoOverlay, and GameInfoOverlay.

The documentation for this interface was generated from the following file:
  • Simple3DGameDX/cpp/GameUIControl.h
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Simple3DGameDX
  • sealed
Public Member Functions | Protected Member Functions | Private Attributes

sealed Class Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
virtual void | Initialize (Windows::ApplicationModel::Core::CoreApplicationView^applicationView)
virtual void | Load (Platform::String^entryPoint)
virtual void | Run ()
virtual void | SetWindow (Windows::UI::Core::CoreWindow^window)
virtual void | Uninitialize ()

Protected Member Functions

void | OnActivated (Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnResuming (Platform::Object^sender, Platform::Object^args)
void | OnStereoEnabledChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnSuspending (Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowActivationChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowActivatedEventArgs^args)
void | OnWindowClosed (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args)
void | OnWindowSizeChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args)

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
std::unique_ptr< GameMain > | m_main

Detailed Description

Definition at line 19 of file App.h.

Member Function Documentation

App ( )
virtual void Initialize ( Windows::ApplicationModel::Core::CoreApplicationView^ applicationView ) [virtual]
virtual void Load ( Platform::String^ entryPoint ) [virtual]
void OnActivated | ( | Windows::ApplicationModel::Core::CoreApplicationView^ | applicationView,
 |  | Windows::ApplicationModel::Activation::IActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnResuming | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnStereoEnabledChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [protected]
void OnSuspending | ( | Platform::Object^ | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [protected]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowActivationChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowActivatedEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowClosed | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::CoreWindowEventArgs^ | args |
 | ) |  |  | [protected]
void OnWindowSizeChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [protected]
virtual void Run ( ) [virtual]
virtual void SetWindow ( Windows::UI::Core::CoreWindow^ window ) [virtual]
virtual void Uninitialize ( ) [virtual]

Member Data Documentation

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 82 of file App.h.

std::unique_ptr<GameMain> m_main [private]

Definition at line 83 of file App.h.

The documentation for this class was generated from the following file:
  • Simple3DGameDX/cpp/App.h
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IGameUIControl Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Simple3DGameXaml
  • IGameUIControl
Public Member Functions

IGameUIControl Interface Reference

#include "GameUIControl.h"

Inherited by sealed.

List of all members.

Public Member Functions

void | HideGameInfoOverlay ()
void | HideTooSmall ()
void | SetAction (GameInfoOverlayCommand action)
void | SetGameLoading ()
void | SetGameOver (bool win, int maxLevel, int hitCount, int shotCount, int highScore)
void | SetGameStats (int maxLevel, int hitCount, int shotCount)
void | SetLevelStart (int level, Platform::String^objective, float timeLimit, float bonusTime)
void | SetPause (int level, int hitCount, int shotCount, float timeRemaining)
void | ShowGameInfoOverlay ()
void | ShowTooSmall ()

Detailed Description

Definition at line 43 of file GameUIControl.h.

Member Function Documentation

void HideGameInfoOverlay ( )

Implemented in sealed.

void HideTooSmall ( )

Implemented in sealed.

void SetAction ( GameInfoOverlayCommand action )

Implemented in sealed.

void SetGameLoading ( )

Implemented in sealed.

void SetGameOver | ( | bool | win,
 |  | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | int | highScore
 | ) |  |

Implemented in sealed.

void SetGameStats | ( | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount
 | ) |  |

Implemented in sealed.

void SetLevelStart | ( | int | level,
 |  | Platform::String^ | objective,
 |  | float | timeLimit,
 |  | float | bonusTime
 | ) |  |

Implemented in sealed.

void SetPause | ( | int | level,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | float | timeRemaining
 | ) |  |

Implemented in sealed.

void ShowGameInfoOverlay ( )

Implemented in sealed.

void ShowTooSmall ( )

Implemented in sealed.

The documentation for this interface was generated from the following file:
  • Simple3DGameXaml/cpp/GameUIControl.h
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Simple3DGameXaml
  • sealed
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

sealed Class Reference

A page that hosts a DirectX SwapChainPanel.

#include "App.xaml.h"

Inherits Simple3DGameXaml::IGameUIControl.

List of all members.

Public Member Functions

App ()
DirectXPage ()
virtual void | HideGameInfoOverlay ()
virtual void | HideTooSmall ()
virtual void | OnLaunched (_In_ Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args) override
void | OnResuming ()
void | OnSuspending ()
virtual void | SetAction (GameInfoOverlayCommand action)
virtual void | SetGameLoading ()
virtual void | SetGameOver (bool win, int maxLevel, int hitCount, int shotCount, int highScore)
virtual void | SetGameStats (int maxLevel, int hitCount, int shotCount)
virtual void | SetLevelStart (int level, Platform::String^objective, float timeLimit, float bonusTime)
virtual void | SetPause (int level, int hitCount, int shotCount, float timeRemaining)
virtual void | ShowGameInfoOverlay ()
virtual void | ShowTooSmall ()
void | UpdateContent (Windows::ApplicationModel::Store::ListingInformation^listing)

Public Attributes

internal | __pad0__: ProductItem( Windows::ApplicationModel::Store::ListingInformation^ listing
internal
Windows::ApplicationModel::Store::LicenseInformation
Platform::String bool 		isApp
internal
Windows::ApplicationModel::Store::LicenseInformation 		license
internal
Windows::ApplicationModel::Store::LicenseInformation
Platform::String 		productId
virtual event
Windows::UI::Xaml::Data::PropertyChangedEventHandler 		PropertyChanged

Private Member Functions

void | InitializeLicense ()
void | InitializeLicenseCore ()
void | OnAppBarOpened (Object^sender, Object^args)
void | OnBuyAppButtonTapped (Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^args)
void | OnBuySelectorClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnChangeBackgroundButtonClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnCompositionScaleChanged (Windows::UI::Xaml::Controls::SwapChainPanel^sender, Object^args)
void | OnDisplayContentsInvalidated (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnDpiChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnGameInfoOverlayTapped (Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^args)
void | OnLicenseChanged ()
void | OnLoadStoreClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnPlayButtonClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnResetButtonClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnResetLicenseButtonClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnResuming (_In_ Platform::Object^sender, _In_ Platform::Object^args)
void | OnStereoEnabledChanged (Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args)
void | OnStoreReturnClicked (Object^sender, Windows::UI::Xaml::RoutedEventArgs^args)
void | OnSuspending (_In_ Platform::Object^sender, _In_ Windows::ApplicationModel::SuspendingEventArgs^args)
void | OnSwapChainPanelSizeChanged (Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e)
void | OnVisibilityChanged (Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args)
void | OnWindowActivationChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Core::WindowActivatedEventArgs^args)
void | OnWindowActivationChanged (_In_ Platform::Object^sender, _In_ Windows::UI::Core::WindowActivatedEventArgs^args)
void | OnWindowSizeChanged (_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::WindowSizeChangedEventArgs^args)
void | OptionalTrialUpgrade ()
void | ResetLicenseFromFile ()
void | SetProductItems (Windows::ApplicationModel::Store::ListingInformation^listing, Windows::ApplicationModel::Store::LicenseInformation^license)
void | SetStatus (Windows::ApplicationModel::Store::LicenseInformation^license)
void | ShowStoreFlyout ()

Private Attributes

std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Platform::String | m_foreground
Platform::String | m_formattedPrice
bool | m_isApp
bool | m_isAppActive
bool | m_isAppTrial
bool | m_isAvailableForPurchase
bool | m_isProductActive
bool | m_isTrial
Windows::ApplicationModel::Store::LicenseInformation | m_licenseInformation
PersistentState m_licenseState
Windows::ApplicationModel::Store::ListingInformation | m_listingInformation
std::unique_ptr< GameMain > | m_main
DirectXPage | m_mainPage
bool | m_playActive
bool | m_possiblePurchaseUpgrade
Platform::String | m_productId
Platform::String | m_status
Platform::String | m_title
bool | m_windowVisible

Detailed Description

Definition at line 25 of file App.xaml.h.

Member Function Documentation

App ( )
DirectXPage ( )
virtual void HideGameInfoOverlay ( ) [virtual]

Implements IGameUIControl.

virtual void HideTooSmall ( ) [virtual]

Implements IGameUIControl.

void InitializeLicense ( ) [private]
void InitializeLicenseCore ( ) [private]
void OnAppBarOpened | ( | Object^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void OnBuyAppButtonTapped | ( | Object^ | sender,
 |  | Windows::UI::Xaml::Input::TappedRoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnBuySelectorClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnChangeBackgroundButtonClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnCompositionScaleChanged | ( | Windows::UI::Xaml::Controls::SwapChainPanel^ | sender,
 |  | Object^ | args |
 | ) |  |  | [private]
void OnDisplayContentsInvalidated | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnDpiChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnGameInfoOverlayTapped | ( | Object^ | sender,
 |  | Windows::UI::Xaml::Input::TappedRoutedEventArgs^ | args |
 | ) |  |  | [private]
virtual void OnLaunched ( _In_ Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args ) [override, virtual]
void OnLicenseChanged ( ) [private]
void OnLoadStoreClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnPlayButtonClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnResetButtonClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnResetLicenseButtonClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnResuming | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Platform::Object^ | args |
 | ) |  |  | [private]
void OnResuming ( )
void OnStereoEnabledChanged | ( | Windows::Graphics::Display::DisplayInformation^ | sender,
 |  | Platform::Object^ | args |
 | ) |  |  | [private]
void OnStoreReturnClicked | ( | Object^ | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs^ | args |
 | ) |  |  | [private]
void OnSuspending | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::ApplicationModel::SuspendingEventArgs^ | args |
 | ) |  |  | [private]
void OnSuspending ( )
void OnSwapChainPanelSizeChanged | ( | Platform::Object^ | sender,
 |  | Windows::UI::Xaml::SizeChangedEventArgs^ | e |
 | ) |  |  | [private]
void OnVisibilityChanged | ( | Windows::UI::Core::CoreWindow^ | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs^ | args |
 | ) |  |  | [private]
void OnWindowActivationChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Core::WindowActivatedEventArgs^ | args |
 | ) |  |  | [private]
void OnWindowActivationChanged | ( | _In_ Platform::Object^ | sender,
 |  | _In_ Windows::UI::Core::WindowActivatedEventArgs^ | args |
 | ) |  |  | [private]
void OnWindowSizeChanged | ( | _In_ Windows::UI::Core::CoreWindow^ | sender,
 |  | _In_ Windows::UI::Core::WindowSizeChangedEventArgs^ | args |
 | ) |  |  | [private]
void OptionalTrialUpgrade ( ) [private]
void ResetLicenseFromFile ( ) [private]
virtual void SetAction ( GameInfoOverlayCommand action ) [virtual]

Implements IGameUIControl.

virtual void SetGameLoading ( ) [virtual]

Implements IGameUIControl.

virtual void SetGameOver | ( | bool | win,
 |  | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | int | highScore |
 | ) |  |  | [virtual]

Implements IGameUIControl.

virtual void SetGameStats | ( | int | maxLevel,
 |  | int | hitCount,
 |  | int | shotCount |
 | ) |  |  | [virtual]

Implements IGameUIControl.

virtual void SetLevelStart | ( | int | level,
 |  | Platform::String^ | objective,
 |  | float | timeLimit,
 |  | float | bonusTime |
 | ) |  |  | [virtual]

Implements IGameUIControl.

virtual void SetPause | ( | int | level,
 |  | int | hitCount,
 |  | int | shotCount,
 |  | float | timeRemaining |
 | ) |  |  | [virtual]

Implements IGameUIControl.

void SetProductItems | ( | Windows::ApplicationModel::Store::ListingInformation^ | listing,
 |  | Windows::ApplicationModel::Store::LicenseInformation^ | license |
 | ) |  |  | [private]
void SetStatus ( Windows::ApplicationModel::Store::LicenseInformation^ license ) [private]
virtual void ShowGameInfoOverlay ( ) [virtual]

Implements IGameUIControl.

void ShowStoreFlyout ( ) [private]
virtual void ShowTooSmall ( ) [virtual]

Implements IGameUIControl.

void UpdateContent ( Windows::ApplicationModel::Store::ListingInformation^ listing )

Member Data Documentation

internal __pad0__

Definition at line 23 of file ProductItem.h.

internal Windows::ApplicationModel::Store::LicenseInformation Platform::String bool isApp

Definition at line 23 of file ProductItem.h.

internal Windows::ApplicationModel::Store::LicenseInformation license

Definition at line 23 of file ProductItem.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 98 of file DirectXPage.xaml.h.

Platform::String m_foreground [private]

Definition at line 91 of file ProductItem.h.

Platform::String m_formattedPrice [private]

Definition at line 88 of file ProductItem.h.

bool m_isApp [private]

Definition at line 92 of file ProductItem.h.

bool m_isAppActive [private]

Definition at line 93 of file ProductItem.h.

bool m_isAppTrial [private]

Definition at line 94 of file ProductItem.h.

bool m_isAvailableForPurchase [private]

Definition at line 96 of file ProductItem.h.

bool m_isProductActive [private]

Definition at line 95 of file ProductItem.h.

bool m_isTrial [private]

Definition at line 108 of file DirectXPage.xaml.h.

Windows::ApplicationModel::Store::LicenseInformation m_licenseInformation [private]

Definition at line 103 of file DirectXPage.xaml.h.

PersistentState m_licenseState [private]

Definition at line 107 of file DirectXPage.xaml.h.

Windows::ApplicationModel::Store::ListingInformation m_listingInformation [private]

Definition at line 104 of file DirectXPage.xaml.h.

std::unique_ptr<GameMain> m_main [private]

Definition at line 99 of file DirectXPage.xaml.h.

DirectXPage m_mainPage [private]

Definition at line 50 of file App.xaml.h.

bool m_playActive [private]

Definition at line 101 of file DirectXPage.xaml.h.

bool m_possiblePurchaseUpgrade [private]

Definition at line 105 of file DirectXPage.xaml.h.

Platform::String m_productId [private]

Definition at line 89 of file ProductItem.h.

Platform::String m_status [private]

Definition at line 90 of file ProductItem.h.

Platform::String m_title [private]

Definition at line 87 of file ProductItem.h.

bool m_windowVisible [private]

Definition at line 100 of file DirectXPage.xaml.h.

internal Windows::ApplicationModel::Store::LicenseInformation Platform::String productId

Definition at line 23 of file ProductItem.h.

virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler PropertyChanged

Definition at line 30 of file ProductItem.h.

The documentation for this class was generated from the following files:
  • Simple3DGameXaml/cpp/App.xaml.h
  • Simple3DGameXaml/cpp/DirectXPage.xaml.h
  • Simple3DGameXaml/cpp/ProductItem.h
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CaptureDevice Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleCommunication
  • CaptureDevice
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

CaptureDevice Class Reference

List of all members.

Public Member Functions

CaptureDevice ()
async Task | CleanUpAsync ()
async Task | InitializeAsync ()
async Task
< IMediaEncodingProperties > 		SelectPreferredCameraStreamSettingAsync (MediaStreamType mediaStreamType, Func< IMediaEncodingProperties, bool > filterSettings)
async Task | StartRecordingAsync (MediaEncodingProfile encodingProfile)
async Task | StopRecordingAsync ()

Static Public Member Functions

static async Task< bool > | CheckForRecordingDeviceAsync ()

Properties

MediaCapture | CaptureSource [get]

Events

EventHandler
< MediaCaptureFailedEventArgs > 		CaptureFailed
EventHandler
< IncomingConnectionEventArgs > 		IncomingConnectionArrived

Private Member Functions

void | CleanupSink ()
void | DoCleanup ()
void | mediaCapture_Failed (MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
void | mediaSink_IncomingConnectionEvent (object sender, object args)

Private Attributes

bool | forwardEvents = false
MediaCapture | mediaCapture
StspMediaSinkProxy | mediaSink
bool | recordingStarted = false

Detailed Description

Definition at line 21 of file CaptureDevice.cs.

Constructor & Destructor Documentation

CaptureDevice ( ) [inline]

Definition at line 35 of file CaptureDevice.cs.

{ }

Member Function Documentation

static async Task<bool> CheckForRecordingDeviceAsync ( ) [inline, static]

Definition at line 230 of file CaptureDevice.cs.

        {
            var cameraFound = false;

            var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            if (devices.Count > 0)
            {
                cameraFound = true;
            }

            return cameraFound;
        }

async Task CleanUpAsync ( ) [inline]

Asynchronous method cleaning up resources and stopping recording if necessary.

Definition at line 106 of file CaptureDevice.cs.

        {
            try
            {
                forwardEvents = true;

                if (mediaCapture == null && mediaSink == null) return;

                if (recordingStarted)
                {
                    await mediaCapture.StopRecordAsync();
                }

                DoCleanup();
            }
            catch (Exception)
            {
                DoCleanup();
            }
        }

void CleanupSink ( ) [inline, private]

Cleans up the resources.

Definition at line 58 of file CaptureDevice.cs.

        {
            if (mediaSink != null)
            {
                mediaSink.IncomingConnectionEvent -= mediaSink_IncomingConnectionEvent;
                mediaSink.Dispose();
                mediaSink = null;
                recordingStarted = false;
            }
        }

void DoCleanup ( ) [inline, private]

Definition at line 69 of file CaptureDevice.cs.

        {
            if (mediaCapture != null)
            {
                mediaCapture.Failed -= mediaCapture_Failed;
                mediaCapture = null;
            }

            CleanupSink();
        }

async Task InitializeAsync ( ) [inline]

Definition at line 80 of file CaptureDevice.cs.

        {
            try
            {
                forwardEvents = true;

                if (mediaCapture != null)
                {
                    throw new InvalidOperationException("Camera is already initialized");
                }

                mediaCapture = new MediaCapture();
                mediaCapture.Failed += mediaCapture_Failed;

                await mediaCapture.InitializeAsync();
            }
            catch (Exception e)
            {
                DoCleanup();
                throw e;
            }
        }

void mediaCapture_Failed | ( | MediaCapture | sender,
 |  | MediaCaptureFailedEventArgs | errorEventArgs |
 | ) |  |  | [inline, private]

Handler for the wrapped MediaCapture object's Failed event.

It just wraps and forward's MediaCapture's Failed event as own CaptureFailed event

Definition at line 41 of file CaptureDevice.cs.

        {
            if (CaptureFailed != null && forwardEvents) CaptureFailed(this, errorEventArgs);
        }

void mediaSink_IncomingConnectionEvent | ( | object | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Handler for the wrapped media sink object's IncomingConnectionEvent.

Expose the wrapped event to listeners as own IncomingConnectionArrived event.

Definition at line 50 of file CaptureDevice.cs.

        {
            if (IncomingConnectionArrived != null && forwardEvents) IncomingConnectionArrived((StspMediaSinkProxy)sender, (IncomingConnectionEventArgs)args);
        }

async Task<IMediaEncodingProperties> SelectPreferredCameraStreamSettingAsync | ( | MediaStreamType | mediaStreamType,
 |  | Func< IMediaEncodingProperties, bool > | filterSettings |
 | ) |  |  | [inline]

Allow selection of camera settings.

Parameters:
mediaStreamType | Type of a the media stream.
filterSettings | A predicate function, which will be called to filter the correct settings.

Definition at line 144 of file CaptureDevice.cs.

        {
            IMediaEncodingProperties previewEncodingProperties = null;

            if (mediaStreamType == MediaStreamType.Audio || mediaStreamType == MediaStreamType.Photo)
            {
                throw new ArgumentException("mediaStreamType value of MediaStreamType.Audio or MediaStreamType.Photo is not supported", "mediaStreamType");
            }
            if (filterSettings == null)
            {
                throw new ArgumentNullException("filterSettings");
            }

            var properties = mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(mediaStreamType);
            var filterredProperties = properties.Where(filterSettings);
            var preferredSettings = filterredProperties.ToArray();

            Array.Sort<IMediaEncodingProperties>(preferredSettings, (x, y) =>
            {
                return (int)(((x as VideoEncodingProperties).Width) -
                    (y as VideoEncodingProperties).Width);
            });

            if (preferredSettings.Length > 0)
            {
                previewEncodingProperties = preferredSettings[0];
                await mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(mediaStreamType, preferredSettings[0]);
            }

            return previewEncodingProperties;
        }

async Task StartRecordingAsync ( MediaEncodingProfile encodingProfile ) [inline]

Starts media recording asynchronously.

Parameters:
encodingProfile Encoding profile used for the recording session

Definition at line 182 of file CaptureDevice.cs.

        {
            try
            {
                // We cannot start recording twice.
                if (mediaSink != null && recordingStarted)
                {
                    throw new InvalidOperationException("Recording already started.");
                }

                // Release sink if there is one already.
                CleanupSink();

                // Create new sink
                mediaSink = new StspMediaSinkProxy();
                mediaSink.IncomingConnectionEvent += mediaSink_IncomingConnectionEvent;

                var mfExtension = await mediaSink.InitializeAsync(encodingProfile.Audio, encodingProfile.Video);
                await mediaCapture.StartRecordToCustomSinkAsync(encodingProfile, mfExtension);

                recordingStarted = true;
            }
            catch (Exception e)
            {
                CleanupSink();
                throw e;
            }
        }

async Task StopRecordingAsync ( ) [inline]

Stops recording asynchronously.

Definition at line 214 of file CaptureDevice.cs.

        {
            if (recordingStarted)
            {
                try
                {
                    await mediaCapture.StopRecordAsync();
                    CleanupSink();
                }
                catch (Exception)
                {
                    CleanupSink();
                }
            }
        }

Member Data Documentation

bool forwardEvents = false [private]

Definition at line 29 of file CaptureDevice.cs.

MediaCapture mediaCapture [private]

Definition at line 24 of file CaptureDevice.cs.

StspMediaSinkProxy mediaSink [private]

Definition at line 26 of file CaptureDevice.cs.

bool recordingStarted = false [private]

Definition at line 28 of file CaptureDevice.cs.

Property Documentation

MediaCapture CaptureSource [get]

Creates url object from MediaCapture.

Definition at line 131 of file CaptureDevice.cs.

Event Documentation

EventHandler<MediaCaptureFailedEventArgs> CaptureFailed

Definition at line 33 of file CaptureDevice.cs.

EventHandler<IncomingConnectionEventArgs> IncomingConnectionArrived

Definition at line 32 of file CaptureDevice.cs.

The documentation for this class was generated from the following file:
  • SimpleCommunication/cs/CaptureDevice.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatency Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleCommunication
  • LowLatency
Public Member Functions | Protected Member Functions | Properties | Private Types | Private Member Functions | Private Attributes

LowLatency Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

LowLatency ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)
async override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Properties

MediaElement | HiddenVideo [get]
MediaElement | LocalhostVideo [get]

Private Types

enum | LatencyMode { NormalLatency, LowLatency }
enum State {
Initializing, Waiting, Previewing, Streaming,
End
}

Private Member Functions

async Task | CleanupAsync ()
async void | Device_CaptureFailed (object sender, MediaCaptureFailedEventArgs e)
void | Device_IncomingConnectionArrived (object sender, IncomingConnectionEventArgs e)
async Task | InitializeAsync ()
async void | LatencyModeToggle_Toggled (object sender, RoutedEventArgs e)
async void | LoopbackClientButton_Click (object sender, RoutedEventArgs e)
async void | PreviewButton_Click (object sender, RoutedEventArgs e)
async Task | Previewing_PreviewButtonClicked ()
void | PreviewSetupCompleted ()
async Task | StartRecordingToCustomSink ()
async Task | Streaming_PreviewButtonClicked ()
async Task | Waiting_PreviewButtonClicked ()
async void | Window_VisibilityChanged (object sender, Windows.UI.Core.VisibilityChangedEventArgs e)

Private Attributes

State | currentState = null
const LatencyMode | defaultMode = LatencyMode.NormalLatency
CaptureDevice | device = null
LatencyMode | mode = null
VideoEncodingProperties | previewEncodingProperties = null
State | previousState = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 29 of file Scenario1_LowLatency.xaml.cs.

Member Enumeration Documentation

enum LatencyMode [private]
Enumerator:
NormalLatency
LowLatency

Definition at line 40 of file Scenario1_LowLatency.xaml.cs.

        {
            NormalLatency,
            LowLatency
        }

enum State [private]
Enumerator:
Initializing
Waiting
Previewing
Streaming
End

Definition at line 31 of file Scenario1_LowLatency.xaml.cs.

        {
            Initializing,
            Waiting,
            Previewing,
            Streaming,
            End
        }

Constructor & Destructor Documentation

LowLatency ( ) [inline]

Definition at line 57 of file Scenario1_LowLatency.xaml.cs.

        {
            this.InitializeComponent();

            rootPage.EnsureMediaExtensionManager();

            mode = LatencyMode.NormalLatency;
            LatencyModeToggle.IsOn = (mode == LatencyMode.LowLatency);
            rootPage.NotifyUser("Initializing...Please wait.", NotifyType.StatusMessage);
        }

Member Function Documentation

async Task CleanupAsync ( ) [inline, private]

Definition at line 353 of file Scenario1_LowLatency.xaml.cs.

        {
            try
            {
                if (currentState == State.Previewing || currentState == State.Streaming)
                {
                    await device.CaptureSource.StopPreviewAsync();

                    if (currentState == State.Streaming)
                    {
                        LocalhostVideo.Stop();
                    }
                }

                await device.CleanUpAsync();
            }
            catch (Exception)
            {
            }
            finally
            {
                LocalhostVideo.Source = null;
            }
        }

async void Device_CaptureFailed | ( | object | sender,
 |  | MediaCaptureFailedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 144 of file Scenario1_LowLatency.xaml.cs.

        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, (() =>
            {
                rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
            }));
        }

void Device_IncomingConnectionArrived | ( | object | sender,
 |  | IncomingConnectionEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 139 of file Scenario1_LowLatency.xaml.cs.

        {
            e.Accept();
        }

async Task InitializeAsync ( ) [inline, private]

<summarycancel Initializes the scenario

Returns:

Definition at line 94 of file Scenario1_LowLatency.xaml.cs.

        {
            var streamFilteringCriteria = new
            {
                HorizontalResolution = (uint)480,
                SubType = "YUY2"
            };
            currentState = State.Initializing;
            device = new CaptureDevice();

            PreviewVideo.Visibility = Visibility.Collapsed;
            WebcamPreviewPoster.Visibility = Visibility.Visible;
            PreviewButton.Content = "Start Preview";
            LoopbackClientButton.IsEnabled = false;

            mode = defaultMode;
            LatencyModeToggle.IsOn = (mode == LatencyMode.LowLatency);
            LatencyModeToggle.IsEnabled = false;

            await device.InitializeAsync();
            var setting = await device.SelectPreferredCameraStreamSettingAsync(MediaStreamType.VideoPreview, ((x) =>
            {
                var previewStreamEncodingProperty = x as Windows.Media.MediaProperties.VideoEncodingProperties;

                return (previewStreamEncodingProperty.Width >= streamFilteringCriteria.HorizontalResolution &&
                    previewStreamEncodingProperty.Subtype == streamFilteringCriteria.SubType);
            }));

            previewEncodingProperties = setting as VideoEncodingProperties;

            PreviewSetupCompleted();
        }

async void LatencyModeToggle_Toggled | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 328 of file Scenario1_LowLatency.xaml.cs.

        {
            if (currentState == State.Streaming)
            {
                try
                {
                    LocalhostVideo.Stop();

                    await device.StopRecordingAsync();
                    mode = (mode == LatencyMode.NormalLatency) ? LatencyMode.LowLatency : LatencyMode.NormalLatency;
                    await StartRecordingToCustomSink();

                    HiddenVideo.Source = null;
                    LocalhostVideo.Source = new Uri("stsp://localhost");

                    LocalhostVideo.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    HiddenVideo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
                catch (Exception exc)
                {
                    rootPage.NotifyUser(exc.Message, NotifyType.ErrorMessage);
                }
            }
        }

async void LoopbackClientButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'LoopbackClient' button.

It displays captured video recieved over the localhost network interface using a custom network media sink and media sources via a custom scheme

Parameters:
sender | The LoopbackClient button
e | The button click routed event arguments

Definition at line 294 of file Scenario1_LowLatency.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null)
            {
                previousState = currentState;
                await StartRecordingToCustomSink();

                if (currentState == State.Previewing)
                {
                    LocalhostVideo.Source = new Uri("stsp://localhost");
                    LatencyModeToggle.IsEnabled = true;
                    LoopbackClientButton.IsEnabled = false;

                    currentState = State.Streaming;
                }
            }
        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 176 of file Scenario1_LowLatency.xaml.cs.

        {
            var cameraEnumTask = CaptureDevice.CheckForRecordingDeviceAsync();

            var cameraFound = await cameraEnumTask;

            if (cameraFound)
            {
                try
                {
                    await InitializeAsync();

                    Window.Current.VisibilityChanged += Window_VisibilityChanged;
                }
                catch (Exception err)
                {
                    rootPage.NotifyUser("Camera initialization error: " + err.Message + "\n Try restarting the sample.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("A machine with a camera and a microphone is required to run this sample.", NotifyType.ErrorMessage);
            }
        }

async override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 201 of file Scenario1_LowLatency.xaml.cs.

        {
            Window.Current.VisibilityChanged -= Window_VisibilityChanged;
            await CleanupAsync();

            base.OnNavigatingFrom(e);
        }

async void PreviewButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Preview' button.

It starts or stops camera preview and streaming

Parameters:
sender
e

Definition at line 215 of file Scenario1_LowLatency.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null && device != null)
            {
                previousState = currentState;
                try
                {
                    switch (currentState)
                    {
                        case State.Waiting:
                            await Waiting_PreviewButtonClicked();
                            break;
                        case State.Previewing:
                            await Previewing_PreviewButtonClicked();
                            break;
                        case State.Streaming:
                            await Streaming_PreviewButtonClicked();
                            break;
                        default:
                            break;
                    }
                }
                catch (Exception exc)
                {
                    rootPage.NotifyUser(exc.Message, NotifyType.ErrorMessage);
                }
            }
        }

async Task Previewing_PreviewButtonClicked ( ) [inline, private]

Definition at line 245 of file Scenario1_LowLatency.xaml.cs.

        {
            Task stopPreviewTask = device.CaptureSource.StopPreviewAsync().AsTask();

            PreviewVideo.Visibility = Visibility.Collapsed;
            WebcamPreviewPoster.Visibility = Visibility.Visible;
            PreviewButton.Content = "Start Preview";
            LoopbackClientButton.IsEnabled = false;

            await stopPreviewTask;
            currentState = State.Waiting;
        }

void PreviewSetupCompleted ( ) [inline, private]

Definition at line 127 of file Scenario1_LowLatency.xaml.cs.

        {
            device.CaptureFailed += Device_CaptureFailed;
            device.IncomingConnectionArrived += Device_IncomingConnectionArrived;
            previousState = currentState;
            PreviewButton.IsEnabled = true;
            rootPage.NotifyUser("Done. Tap or click 'Start Preview' button to start webcam preview", NotifyType.StatusMessage);

            currentState = State.Waiting;
        }

async Task StartRecordingToCustomSink ( ) [inline, private]

Definition at line 313 of file Scenario1_LowLatency.xaml.cs.

        {
            // Use the MP4 preset to an obtain H.264 video encoding profile
            var mep = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga);
            mep.Audio = null;
            mep.Container = null;
            if (previewEncodingProperties != null)
            {
                mep.Video.Width = previewEncodingProperties.Width;
                mep.Video.Height = previewEncodingProperties.Height;
            }

            await device.StartRecordingAsync(mep);
        }

async Task Streaming_PreviewButtonClicked ( ) [inline, private]

Definition at line 272 of file Scenario1_LowLatency.xaml.cs.

        {
            LocalhostVideo.Stop();
            await device.StopRecordingAsync();
            LocalhostVideo.Source = null;
            await Previewing_PreviewButtonClicked();

            mode = defaultMode;
            LatencyModeToggle.IsOn = (mode == LatencyMode.LowLatency);
            LatencyModeToggle.IsEnabled = false;

            LocalhostVideo.Visibility = Windows.UI.Xaml.Visibility.Visible;
            HiddenVideo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

async Task Waiting_PreviewButtonClicked ( ) [inline, private]

Definition at line 258 of file Scenario1_LowLatency.xaml.cs.

        {
            rootPage.NotifyUser("", NotifyType.StatusMessage);
            PreviewVideo.Source = device.CaptureSource;
            await device.CaptureSource.StartPreviewAsync();

            WebcamPreviewPoster.Visibility = Visibility.Collapsed;
            PreviewVideo.Visibility = Visibility.Visible;
            PreviewButton.Content = "Stop Preview";
            LoopbackClientButton.IsEnabled = true;

            currentState = State.Previewing;
        }

async void Window_VisibilityChanged | ( | object | sender,
 |  | Windows.UI.Core.VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 152 of file Scenario1_LowLatency.xaml.cs.

        {
            if (!e.Visible)
            {
                await CleanupAsync();
            }
            else
            {
                try
                {
                    await InitializeAsync();
                }
                catch (Exception err)
                {
                    rootPage.NotifyUser("Camera initialization error: " + err.Message + "\n Try restarting the sample.", NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

State currentState = null [private]

Definition at line 51 of file Scenario1_LowLatency.xaml.cs.

const LatencyMode defaultMode = LatencyMode.NormalLatency [private]

Definition at line 55 of file Scenario1_LowLatency.xaml.cs.

CaptureDevice device = null [private]

Definition at line 50 of file Scenario1_LowLatency.xaml.cs.

LatencyMode mode = null [private]

Definition at line 54 of file Scenario1_LowLatency.xaml.cs.

VideoEncodingProperties previewEncodingProperties = null [private]

Definition at line 53 of file Scenario1_LowLatency.xaml.cs.

State previousState = null [private]

Definition at line 52 of file Scenario1_LowLatency.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 48 of file Scenario1_LowLatency.xaml.cs.

Property Documentation

MediaElement HiddenVideo [get, private]

The media element hidden in the local host client area.

Definition at line 83 of file Scenario1_LowLatency.xaml.cs.

MediaElement LocalhostVideo [get, private]

The media element visible in the local host client area.

Definition at line 72 of file Scenario1_LowLatency.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleCommunication/cs/Scenario1_LowLatency.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoChat Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleCommunication
  • VideoChat
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

VideoChat Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

VideoChat ()

Protected Member Functions

async override void | OnNavigatedTo (NavigationEventArgs e)
async override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | CallButton_Click (object sender, RoutedEventArgs e)
async void | Device_CaptureFailed (object sender, Windows.Media.Capture.MediaCaptureFailedEventArgs e)
async void | Device_IncomingConnectionArrived (object sender, IncomingConnectionEventArgs e)
async Task | EndCallAsync ()
async void | EndCallButton_Click (object sender, RoutedEventArgs e)
async Task | InitializeAsync (CancellationToken cancel=default(CancellationToken))
async void | RemoteVideo_MediaFailed (object sender, ExceptionRoutedEventArgs e)
async Task | StartRecordToCustomSink ()

Private Attributes

bool | activated = false
CaptureDevice | device = null
int | isTerminator = 0
bool | roleIsActive = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 27 of file Scenario2_VideoChat.xaml.cs.

Constructor & Destructor Documentation

VideoChat ( ) [inline]

Definition at line 38 of file Scenario2_VideoChat.xaml.cs.

        {
            this.InitializeComponent();

            rootPage.EnsureMediaExtensionManager();
        }

Member Function Documentation

void CallButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Default' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 167 of file Scenario2_VideoChat.xaml.cs.

        {
            Button b = sender as Button;
            var address = HostNameTextbox.Text;

            if (b != null && !String.IsNullOrEmpty(address))
            {
                roleIsActive = true;
                RemoteVideo.Source = new Uri("stsp://" + address);
                HostNameTextbox.IsEnabled = CallButton.IsEnabled = false;
                rootPage.NotifyUser("Initiating connection.. Please wait.", NotifyType.StatusMessage);
            }
        }

async void Device_CaptureFailed | ( | object | sender,
 |  | Windows.Media.Capture.MediaCaptureFailedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 142 of file Scenario2_VideoChat.xaml.cs.

        {
            if (Interlocked.CompareExchange(ref isTerminator, 1, 0) == 0)
            {
                await EndCallAsync();
            }
        }

async void Device_IncomingConnectionArrived | ( | object | sender,
 |  | IncomingConnectionEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 119 of file Scenario2_VideoChat.xaml.cs.

        {
            e.Accept();

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, (() =>
            {
                activated = true;
                var remoteAddress = e.RemoteUrl;
                EndCallButton.IsEnabled = true;
                Interlocked.Exchange(ref isTerminator, 0);

                if (!((bool)roleIsActive))
                {
                    // Passive client
                    RemoteVideo.Source = new Uri(remoteAddress);
                    HostNameTextbox.IsEnabled = CallButton.IsEnabled = false;
                }

                remoteAddress = remoteAddress.Replace("stsp://", "");
                rootPage.NotifyUser("Connected. Remote machine address: " + remoteAddress, NotifyType.StatusMessage);
            }));
        }

async Task EndCallAsync ( ) [inline, private]

Definition at line 196 of file Scenario2_VideoChat.xaml.cs.

        {
            await device.CleanUpAsync();

            // end the CallButton. session
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, (() =>
            {
                RemoteVideo.Stop();
                RemoteVideo.Source = null;
            }));

            // Start waiting for a new CallButton.
            await InitializeAsync();
        }

async void EndCallButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Other' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 187 of file Scenario2_VideoChat.xaml.cs.

        {
            Button b = sender as Button;
            if (b != null && Interlocked.CompareExchange(ref isTerminator, 1, 0) == 0)
            {
                await EndCallAsync();
            }
        }

async Task InitializeAsync ( CancellationToken cancel = default(CancellationToken) ) [inline, private]

Definition at line 85 of file Scenario2_VideoChat.xaml.cs.

        {
            rootPage.NotifyUser("Initializing..", NotifyType.StatusMessage);

            try
            {
                await device.InitializeAsync();
                await StartRecordToCustomSink();

                HostNameTextbox.IsEnabled = CallButton.IsEnabled = true;
                EndCallButton.IsEnabled = false;
                RemoteVideo.Source = null;

                // Each client starts out as passive
                roleIsActive = false;
                Interlocked.Exchange(ref isTerminator, 0);

                rootPage.NotifyUser("Tap 'CallButton.' button to start CallButton.", NotifyType.StatusMessage);
            }
            catch (Exception)
            {
                rootPage.NotifyUser("Initialization error. Restart the sample to try again.", NotifyType.ErrorMessage);
            }

        }

async override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 50 of file Scenario2_VideoChat.xaml.cs.

        {
            var cameraFound = await CaptureDevice.CheckForRecordingDeviceAsync();

            if (cameraFound)
            {
                device = new CaptureDevice();
                await InitializeAsync();
                device.IncomingConnectionArrived += Device_IncomingConnectionArrived;
                device.CaptureFailed += Device_CaptureFailed;
                RemoteVideo.MediaFailed += RemoteVideo_MediaFailed;
            }
            else
            {
                rootPage.NotifyUser("A machine with a camera and a microphone is required to run this sample.", NotifyType.ErrorMessage);
            }
        }

async override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Definition at line 68 of file Scenario2_VideoChat.xaml.cs.

        {
            base.OnNavigatingFrom(e);

            if (activated)
            {
                RemoteVideo.Stop();
                RemoteVideo.Source = null;
            }

            if (device != null)
            {
                await device.CleanUpAsync();
                device = null;
            }
        }

async void RemoteVideo_MediaFailed | ( | object | sender,
 |  | ExceptionRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 111 of file Scenario2_VideoChat.xaml.cs.

        {
            if (Interlocked.CompareExchange(ref isTerminator, 1, 0) == 0)
            {
                await EndCallAsync();
            }
        }

async Task StartRecordToCustomSink ( ) [inline, private]

Definition at line 150 of file Scenario2_VideoChat.xaml.cs.

        {
            MediaEncodingProfile mep = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Qvga);

            mep.Video.FrameRate.Numerator = 15;
            mep.Video.FrameRate.Denominator = 1;
            mep.Container = null;

            await device.StartRecordingAsync(mep);
        }

Member Data Documentation

bool activated = false [private]

Definition at line 36 of file Scenario2_VideoChat.xaml.cs.

CaptureDevice device = null [private]

Definition at line 33 of file Scenario2_VideoChat.xaml.cs.

int isTerminator = 0 [private]

Definition at line 35 of file Scenario2_VideoChat.xaml.cs.

bool roleIsActive = null [private]

Definition at line 34 of file Scenario2_VideoChat.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 31 of file Scenario2_VideoChat.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleCommunication/cs/Scenario2_VideoChat.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleImaging
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

Code-behind for Scenario 1, which demonstrates image properties with FileProperties.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Apply_Click (object sender, RoutedEventArgs e)
void | Close_Click (object sender, RoutedEventArgs e)
async Task | DisplayImageUIAsync (StorageFile file, IDictionary< string, string > propertyText)
IDictionary< string, string > | GetImagePropertiesForDisplay (IDictionary< string, object > retrievedProps)
async Task | LoadFileAsync (StorageFile file)
async void | Open_Click (object sender, RoutedEventArgs e)
void | ResetPersistedState ()
void | ResetSessionState ()
async void | RestoreDataFromPersistedState ()
void | SaveDataToPersistedState (object sender, SuspendingEventArgs args)

Private Attributes

const int | E_INVALIDARG = unchecked((int)0x80070057)
string | m_fileToken
StorageItemAccessList | m_futureAccess = StorageApplicationPermissions.FutureAccessList
ImageProperties | m_imageProperties
IPropertySet | m_localSettings = Windows.Storage.ApplicationData.Current.LocalSettings.Values
MainPage rootPage

Detailed Description

Definition at line 34 of file Scenario1.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 47 of file Scenario1.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Apply_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Updates the file with the user-edited properties.

The m_imageProperties object is still usable after the method completes.

Definition at line 358 of file Scenario1.xaml.cs.

        {
            rootPage.NotifyUser("Saving file...", NotifyType.StatusMessage);

            m_imageProperties.Title = TitleTextbox.Text;

            // Keywords are stored as an IList of strings.
            if (KeywordsTextbox.Text.Length > 0)
            {
                string[] keywordsArray = KeywordsTextbox.Text.Split('\n');
                m_imageProperties.Keywords.Clear();

                for (uint i = 0; i < keywordsArray.Length; i++)
                {
                    m_imageProperties.Keywords.Add(keywordsArray[i]);
                }
            }

            PropertySet propertiesToSave = new PropertySet();

            // Perform some simple validation of the GPS data and package it in a format
            // better suited for writing to the file.
            bool gpsWriteFailed = false;
            double[] latitude = new double[3];
            double[] longitude = new double[3];
            string latitudeRef = String.Empty;
            string longitudeRef = String.Empty;

            try
            {
                latitude[0] = Math.Floor(Double.Parse(LatDegTextbox.Text));
                latitude[1] = Math.Floor(Double.Parse(LatMinTextbox.Text));
                latitude[2] = Double.Parse(LatSecTextbox.Text);

                longitude[0] = Math.Floor(Double.Parse(LongDegTextbox.Text));
                longitude[1] = Math.Floor(Double.Parse(LongMinTextbox.Text));
                longitude[2] = Double.Parse(LongSecTextbox.Text);

                latitudeRef = LatRefTextbox.Text.ToUpper();
                longitudeRef = LongRefTextbox.Text.ToUpper();
            }
            catch (Exception) // Treat any exception as invalid GPS data.
            {
                gpsWriteFailed = true;
            }

            if ((latitude[0] >= 0 && latitude[0] <= 90) &&
                (latitude[1] >= 0 && latitude[1] <= 60) &&
                (latitude[2] >= 0 && latitude[2] <= 60) &&
                (latitudeRef == "N" || latitudeRef == "S") &&
                (longitude[0] >= 0 && longitude[0] <= 180) &&
                (latitude[1] >= 0 && longitude[1] <= 60) &&
                (longitude[2] >= 0 && longitude[2] <= 60) &&
                (longitudeRef == "E" || longitudeRef == "W"))
            {
                propertiesToSave.Add("System.GPS.LatitudeRef", latitudeRef);
                propertiesToSave.Add("System.GPS.LongitudeRef", longitudeRef);

                // The Latitude and Longitude properties are read-only. Instead,
                // write to System.GPS.LatitudeNumerator, LatitudeDenominator, etc.
                // These are length 3 arrays of integers. For simplicity, the
                // seconds data is rounded to the nearest 10000th.
                uint[] latitudeNumerator =
                {
                    (uint) latitude[0],
                    (uint) latitude[1],
                    (uint) (latitude[2] * 10000)
                };

                uint[] longitudeNumerator =
                {
                    (uint) longitude[0],
                    (uint) longitude[1],
                    (uint) (longitude[2] * 10000)
                };

                // LatitudeDenominator and LongitudeDenominator share the same values.
                uint[] denominator =
                {
                    1,
                    1,
                    10000
                };

                propertiesToSave.Add("System.GPS.LatitudeNumerator", latitudeNumerator);
                propertiesToSave.Add("System.GPS.LatitudeDenominator", denominator);
                propertiesToSave.Add("System.GPS.LongitudeNumerator", longitudeNumerator);
                propertiesToSave.Add("System.GPS.LongitudeDenominator", denominator);
            }
            else
            {
                gpsWriteFailed = true;
            }

            try
            {
                // SavePropertiesAsync commits edits to the top level properties (e.g. Title) as
                // well as any Windows properties contained within the propertiesToSave parameter.
                await m_imageProperties.SavePropertiesAsync(propertiesToSave);

                rootPage.NotifyUser(gpsWriteFailed ? "GPS data invalid; other properties successfully updated" :
                        "All properties successfully updated", NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                switch (err.HResult)
                {
                    case E_INVALIDARG:
                        // Some imaging formats, such as PNG and BMP, do not support Windows properties.
                        // Other formats do not support all Windows properties.
                        // For example, JPEG does not support System.FlagStatus.
                        rootPage.NotifyUser("Error: A property value is invalid, or the file format does " +
                            "not support one or more requested properties.", NotifyType.ErrorMessage);

                        break;

                    default:
                        rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                        break;
                }

                ResetSessionState();
                ResetPersistedState();
            }
        }

void Close_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Closing the file brings the scenario back to the default initialized state.

Definition at line 487 of file Scenario1.xaml.cs.

        {
            ResetSessionState();
            ResetPersistedState();
            rootPage.NotifyUser("Closed file", NotifyType.StatusMessage);
        }

async Task DisplayImageUIAsync | ( | StorageFile | file,
 |  | IDictionary< string, string > | propertyText |
 | ) |  |  | [inline, private]

Asynchronously displays the image file and properties text in the UI.

This method is called when the user loads a new file, or when the app resumes from a suspended state.

Parameters:
file | The image to be displayed.
propertyText | Collection of property text to be displayed. Must contain the following keys: Title, Keywords, DateTaken, Make, Model, LatRef, LongRef, LatDeg, LatMin, LatSec, LongDeg, LongMin, LongSec, Orientation, Exposure, FNumber.

Definition at line 308 of file Scenario1.xaml.cs.

        {
            BitmapImage src = new BitmapImage();
            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
            {
                await src.SetSourceAsync(stream);
            }

            PreviewImage.Source = src;
            AutomationProperties.SetName(PreviewImage, file.Name);

            TitleTextbox.Text = propertyText["Title"];
            KeywordsTextbox.Text = propertyText["Keywords"];
            DateTakenTextblock.Text = propertyText["DateTaken"];
            MakeTextblock.Text = propertyText["Make"];
            ModelTextblock.Text = propertyText["Model"];
            OrientationTextblock.Text = propertyText["Orientation"];
            LatDegTextbox.Text = propertyText["LatDeg"];
            LatMinTextbox.Text = propertyText["LatMin"];
            LatRefTextbox.Text = propertyText["LatRef"];
            LongDegTextbox.Text = propertyText["LongDeg"];
            LongMinTextbox.Text = propertyText["LongMin"];
            LongRefTextbox.Text = propertyText["LongRef"];
            ExposureTextblock.Text = propertyText["Exposure"];
            FNumberTextblock.Text = propertyText["FNumber"];

            // Truncate the latitude and longitude seconds data to 4 decimal places (precision of 1/10000th).
            if (propertyText["LatSec"].Length > 7)
            {
                LatSecTextbox.Text = propertyText["LatSec"].Substring(0, 7);
            }
            else
            {
                LatSecTextbox.Text = propertyText["LatSec"];
            }

            if (propertyText["LongSec"].Length > 7)
            {
                LongSecTextbox.Text = propertyText["LongSec"].Substring(0, 7);
            }
            else
            {
                LongSecTextbox.Text = propertyText["LongSec"];
            }
        }

IDictionary<string, string> GetImagePropertiesForDisplay ( IDictionary< string, object > retrievedProps ) [inline, private]

Gathers the imaging properties read from a file and formats them into a single object that can be consumed by DisplayImageUIAsync().

This method also reads from m_imageProperties.

Parameters:
retrievedProps Contains System.Photo.ExposureTime and System.Photo.FNumber
Returns:
Dictionary of strings to be used in DisplayImageUI().

Definition at line 223 of file Scenario1.xaml.cs.

        {
            var propertyText = new Dictionary<string, string>();

            // Some of the properties need to be converted/formatted.
            string keywordsText = String.Join(Environment.NewLine, m_imageProperties.Keywords);

            string exposureText;
            if (retrievedProps.ContainsKey("System.Photo.ExposureTime"))
            {
                exposureText = ((double)retrievedProps["System.Photo.ExposureTime"] * 1000).ToString() + " ms";
            }
            else
            {
                exposureText = "";
            }

            string fNumberText;
            if (retrievedProps.ContainsKey("System.Photo.FNumber"))
            {
                fNumberText = ((double)retrievedProps["System.Photo.FNumber"]).ToString("F1");
            }
            else
            {
                fNumberText = "";
            }

            string orientationText = Helpers.GetOrientationString(m_imageProperties.Orientation);

            string latRefText, longRefText, latDegText, latMinText, latSecText, longDegText, longMinText, longSecText;

            // Do a simple check if GPS data exists.
            if ((m_imageProperties.Latitude.HasValue) && (m_imageProperties.Longitude.HasValue))
            {
                double latitude = m_imageProperties.Latitude.Value;
                double longitude = m_imageProperties.Longitude.Value;

                // Latitude and longitude are returned as double precision numbers,
                // but we want to convert to degrees/minutes/seconds format.
                latRefText = (latitude >= 0) ? "N" : "S";
                longRefText = (longitude >= 0) ? "E" : "W";
                double latDeg = Math.Floor(Math.Abs(latitude));
                latDegText = latDeg.ToString();
                double latMin = Math.Floor((Math.Abs(latitude) - latDeg) * 60);
                latMinText = latMin.ToString();
                latSecText = ((Math.Abs(latitude) - latDeg - latMin / 60) * 3600).ToString();
                double longDeg = Math.Floor(Math.Abs(longitude));
                longDegText = longDeg.ToString();
                double longMin = Math.Floor((Math.Abs(longitude) - longDeg) * 60);
                longMinText = longMin.ToString();
                longSecText = ((Math.Abs(longitude) - longDeg - longMin / 60) * 3600).ToString();
            }
            else
            {
                latRefText = longRefText = latDegText = latMinText = latSecText = longDegText = longMinText = longSecText = "";
            }

            propertyText.Add("Title", m_imageProperties.Title);
            propertyText.Add("Keywords", keywordsText);
            propertyText.Add("DateTaken", m_imageProperties.DateTaken.ToString());
            propertyText.Add("Make", m_imageProperties.CameraManufacturer);
            propertyText.Add("Model", m_imageProperties.CameraModel);
            propertyText.Add("Orientation", orientationText);
            propertyText.Add("LatRef", latRefText);
            propertyText.Add("LongRef", longRefText);
            propertyText.Add("LatDeg", latDegText);
            propertyText.Add("LatMin", latMinText);
            propertyText.Add("LatSec", latSecText);
            propertyText.Add("LongDeg", longDegText);
            propertyText.Add("LongMin", longMinText);
            propertyText.Add("LongSec", longSecText);
            propertyText.Add("Exposure", exposureText);
            propertyText.Add("FNumber", fNumberText);

            return propertyText;
        }

async Task LoadFileAsync ( StorageFile file ) [inline, private]

Load an image from a file and display some basic imaging properties.

Parameters:
file The image to load.

Definition at line 177 of file Scenario1.xaml.cs.

        {
            try
            {
                // Request persisted access permissions to the file the user selected.
                // This allows the app to directly load the file in the future without relying on a
                // broker such as the file picker.
                m_fileToken = m_futureAccess.Add(file);

                // Windows.Storage.FileProperties.ImageProperties provides convenience access to
                // commonly-used properties such as geolocation and keywords. It also accepts
                // queries for Windows property system keys such as "System.Photo.Aperture".
                m_imageProperties = await file.Properties.GetImagePropertiesAsync();

                string[] requests =
                {
                    "System.Photo.ExposureTime",        // In seconds
                    "System.Photo.FNumber"              // F-stop values defined by EXIF spec
                };

                IDictionary<string, object> retrievedProps =
                    await m_imageProperties.RetrievePropertiesAsync(requests);
                await DisplayImageUIAsync(file, GetImagePropertiesForDisplay(retrievedProps));

                rootPage.NotifyUser(
                    "Loaded file from picker: " + file.Name,
                    NotifyType.StatusMessage
                    );

                CloseButton.IsEnabled = true;
                ApplyButton.IsEnabled = true;
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                ResetPersistedState();
                ResetSessionState();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Definition at line 55 of file Scenario1.xaml.cs.

        {
            rootPage = MainPage.Current;
            App.Current.Suspending += new SuspendingEventHandler(SaveDataToPersistedState);

            // Reset scenario state before starting.
            ResetSessionState();

            // Attempt to load the previously saved scenario state.
            if (m_localSettings.ContainsKey("scenario1FileToken"))
            {
                RestoreDataFromPersistedState();
            }
        }

async void Open_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when the user clicks on the Open button.

Definition at line 73 of file Scenario1.xaml.cs.

        {
            ResetSessionState();
            ResetPersistedState();

            FileOpenPicker picker = new FileOpenPicker();
            Helpers.FillDecoderExtensions(picker.FileTypeFilter);
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

            var file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                await LoadFileAsync(file);
            }
        }

void ResetPersistedState ( ) [inline, private]

Clears all of the state for this scenario that is stored in app data.

This method does not use the SuspensionManager helper class (defined in SuspensionManager.cs).

Definition at line 498 of file Scenario1.xaml.cs.

        {
            m_localSettings.Remove("scenario1FileToken");
            m_localSettings.Remove("scenario1Title");
            m_localSettings.Remove("scenario1Keywords");
            m_localSettings.Remove("scenario1DateTaken");
            m_localSettings.Remove("scenario1Make");
            m_localSettings.Remove("scenario1Model");
            m_localSettings.Remove("scenario1Orientation");
            m_localSettings.Remove("scenario1LatDeg");
            m_localSettings.Remove("scenario1LatMin");
            m_localSettings.Remove("scenario1LatSec");
            m_localSettings.Remove("scenario1LatRef");
            m_localSettings.Remove("scenario1LongDeg");
            m_localSettings.Remove("scenario1LongMin");
            m_localSettings.Remove("scenario1LongSec");
            m_localSettings.Remove("scenario1LongRef");
            m_localSettings.Remove("scenario1Exposure");
            m_localSettings.Remove("scenario1FNumber");
        }

void ResetSessionState ( ) [inline, private]

Clears all of the state that is stored in memory and in the UI.

Definition at line 522 of file Scenario1.xaml.cs.

        {
            m_imageProperties = null;
            m_fileToken = null;

            CloseButton.IsEnabled = false;
            ApplyButton.IsEnabled = false;
            PreviewImage.Source = null;

            TitleTextbox.Text = "";
            KeywordsTextbox.Text = "";
            DateTakenTextblock.Text = "";
            MakeTextblock.Text = "";
            ModelTextblock.Text = "";
            OrientationTextblock.Text = "";
            LatDegTextbox.Text = "";
            LatMinTextbox.Text = "";
            LatSecTextbox.Text = "";
            LatRefTextbox.Text = "";
            LongDegTextbox.Text = "";
            LongMinTextbox.Text = "";
            LongSecTextbox.Text = "";
            LongRefTextbox.Text = "";
            ExposureTextblock.Text = "";
            FNumberTextblock.Text = "";
        }

async void RestoreDataFromPersistedState ( ) [inline, private]

Reads the file token and property text from the persisted state, and calls DisplayImageUIAsync().

Definition at line 129 of file Scenario1.xaml.cs.

        {
            try
            {
                m_fileToken = m_localSettings["scenario1FileToken"].ToString();
                StorageFile file = await m_futureAccess.GetFileAsync(m_fileToken);
                m_imageProperties = await file.Properties.GetImagePropertiesAsync();

                Dictionary<string, string> propertyText = new Dictionary<string, string>();
                propertyText.Add("Title", m_localSettings["scenario1Title"].ToString());
                propertyText.Add("Keywords", m_localSettings["scenario1Keywords"].ToString());
                propertyText.Add("DateTaken", m_localSettings["scenario1DateTaken"].ToString());
                propertyText.Add("Make", m_localSettings["scenario1Make"].ToString());
                propertyText.Add("Model", m_localSettings["scenario1Model"].ToString());
                propertyText.Add("Orientation", m_localSettings["scenario1Orientation"].ToString());
                propertyText.Add("LatDeg", m_localSettings["scenario1LatDeg"].ToString());
                propertyText.Add("LatMin", m_localSettings["scenario1LatMin"].ToString());
                propertyText.Add("LatSec", m_localSettings["scenario1LatSec"].ToString());
                propertyText.Add("LatRef", m_localSettings["scenario1LatRef"].ToString());
                propertyText.Add("LongDeg", m_localSettings["scenario1LongDeg"].ToString());
                propertyText.Add("LongMin", m_localSettings["scenario1LongMin"].ToString());
                propertyText.Add("LongSec", m_localSettings["scenario1LongSec"].ToString());
                propertyText.Add("LongRef", m_localSettings["scenario1LongRef"].ToString());
                propertyText.Add("Exposure", m_localSettings["scenario1Exposure"].ToString());
                propertyText.Add("FNumber", m_localSettings["scenario1FNumber"].ToString());

                await DisplayImageUIAsync(file, propertyText);

                rootPage.NotifyUser(
                    "Loaded file from persisted state: " + file.Name,
                    NotifyType.StatusMessage
                    );

                CloseButton.IsEnabled = true;
                ApplyButton.IsEnabled = true;
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                ResetSessionState();
                ResetPersistedState();
            }
        }

void SaveDataToPersistedState | ( | object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

When the application is about to enter a suspended state, save the user edited properties text.

Definition at line 92 of file Scenario1.xaml.cs.

        {
            // Only save state if we have valid data.
            if (m_fileToken != null)
            {
                // Requesting a deferral prevents the application from being immediately suspended.
                SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral();

                // LocalSettings does not support overwriting existing items, so first clear the collection.
                ResetPersistedState();

                m_localSettings.Add("scenario1Title", TitleTextbox.Text);
                m_localSettings.Add("scenario1Keywords", KeywordsTextbox.Text);
                m_localSettings.Add("scenario1DateTaken", DateTakenTextblock.Text);
                m_localSettings.Add("scenario1Make", MakeTextblock.Text);
                m_localSettings.Add("scenario1Model", ModelTextblock.Text);
                m_localSettings.Add("scenario1Orientation", OrientationTextblock.Text);
                m_localSettings.Add("scenario1LatDeg", LatDegTextbox.Text);
                m_localSettings.Add("scenario1LatMin", LatMinTextbox.Text);
                m_localSettings.Add("scenario1LatSec", LatSecTextbox.Text);
                m_localSettings.Add("scenario1LatRef", LatRefTextbox.Text);
                m_localSettings.Add("scenario1LongDeg", LongDegTextbox.Text);
                m_localSettings.Add("scenario1LongMin", LongMinTextbox.Text);
                m_localSettings.Add("scenario1LongSec", LongSecTextbox.Text);
                m_localSettings.Add("scenario1LongRef", LongRefTextbox.Text);
                m_localSettings.Add("scenario1Exposure", ExposureTextblock.Text);
                m_localSettings.Add("scenario1FNumber", FNumberTextblock.Text);
                m_localSettings.Add("scenario1FileToken", m_fileToken);

                deferral.Complete();
            }
        }

Member Data Documentation

const int E_INVALIDARG = unchecked((int)0x80070057) [private]

Definition at line 39 of file Scenario1.xaml.cs.

string m_fileToken [private]

Definition at line 44 of file Scenario1.xaml.cs.

StorageItemAccessList m_futureAccess = StorageApplicationPermissions.FutureAccessList [private]

Definition at line 41 of file Scenario1.xaml.cs.

ImageProperties m_imageProperties [private]

Definition at line 43 of file Scenario1.xaml.cs.

IPropertySet m_localSettings = Windows.Storage.ApplicationData.Current.LocalSettings.Values [private]

Definition at line 42 of file Scenario1.xaml.cs.

MainPage rootPage [private]

Definition at line 45 of file Scenario1.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleImaging/cs/Scenario1.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleImaging
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

Code-behind for Scenario 2, which demonstrates image editing using BitmapDecoder and BitmapEncoder.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Close_Click (object sender, RoutedEventArgs e)
async Task | DisplayImageFileAsync (StorageFile file)
async Task | GetImageInformationAsync (StorageFile file)
async Task | LoadFileAsync (StorageFile file)
async Task | LoadSaveFileAsync (StorageFile outputFile)
async void | Open_Click (object sender, RoutedEventArgs e)
void | ResetPersistedState ()
void | ResetSessionState ()
async void | RestoreDataFromPersistedState ()
void | RotateLeft_Click (object sender, RoutedEventArgs e)
void | RotateRight_Click (object sender, RoutedEventArgs e)
async void | Save_Click (object sender, RoutedEventArgs e)
async void | SaveAs_Click (object sender, RoutedEventArgs e)
void | SaveDataToPersistedState (object sender, SuspendingEventArgs args)
void | ScaleSlider_ValueChanged (object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
void | UpdateImageDimensionsUI ()
void | UpdateImageRotation (PhotoOrientation rotation)

Private Attributes

bool | m_disableExifOrientation
uint m_displayHeightNonScaled
uint m_displayWidthNonScaled
PhotoOrientation | m_exifOrientation
string | m_fileToken
StorageItemAccessList | m_futureAccess = StorageApplicationPermissions.FutureAccessList
IPropertySet | m_localSettings = Windows.Storage.ApplicationData.Current.LocalSettings.Values
double | m_scaleFactor
RotateTransform | m_transform = new RotateTransform()
PhotoOrientation | m_userRotation
MainPage rootPage
const int | WINCODEC_ERR_COMPONENTNOTFOUND = unchecked((int)0x88982F50)
const int | WINCODEC_ERR_PROPERTYNOTSUPPORTED = unchecked((int)0x88982F41)
const int | WINCODEC_ERR_UNSUPPORTEDOPERATION = unchecked((int)0x88982F81)

Detailed Description

Definition at line 35 of file Scenario2.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 57 of file Scenario2.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Close_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Closing the file brings the scenario back to the default initialized state.

Definition at line 622 of file Scenario2.xaml.cs.

        {
            ResetSessionState();
            ResetPersistedState();
            rootPage.NotifyUser("Closed file", NotifyType.StatusMessage);
        }

async Task DisplayImageFileAsync ( StorageFile file ) [inline, private]

This function is called when the user clicks the Open button, and when they save (to refresh the image state).

Definition at line 217 of file Scenario2.xaml.cs.

        {
            // Request persisted access permissions to the file the user selected.
            // This allows the app to directly load the file in the future without relying on a
            // broker such as the file picker.
            m_fileToken = m_futureAccess.Add(file);

            // Display the image in the UI.
            BitmapImage src = new BitmapImage();
            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
            {
                await src.SetSourceAsync(stream);
            }

            PreviewImage.Source = src;
            AutomationProperties.SetName(PreviewImage, file.Name);

            // Use BitmapDecoder to attempt to read EXIF orientation and image dimensions.
            await GetImageInformationAsync(file);

            ExifOrientationTextblock.Text = Helpers.GetOrientationString(m_exifOrientation);
            UpdateImageDimensionsUI();

            ScaleSlider.IsEnabled = true;
            RotateLeftButton.IsEnabled = true;
            RotateRightButton.IsEnabled = true;
            SaveButton.IsEnabled = true;
            SaveAsButton.IsEnabled = true;
            CloseButton.IsEnabled = true;
        }

async Task GetImageInformationAsync ( StorageFile file ) [inline, private]

Asynchronously attempts to get the oriented dimensions and EXIF orientation from the image file.

Sets member variables instead of returning a value with the Task.

Parameters:
file
Returns:

Definition at line 254 of file Scenario2.xaml.cs.

        {
            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
            {
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);

                // The orientedPixelWidth and Height members provide the image dimensions
                // reflecting any EXIF orientation.
                m_displayHeightNonScaled = decoder.OrientedPixelHeight;
                m_displayWidthNonScaled = decoder.OrientedPixelWidth;

                try
                {
                    // Property access using BitmapProperties is similar to using
                    // Windows.Storage.FileProperties (see Scenario 1); BitmapProperties accepts
                    // property keys such as "System.Photo.Orientation".
                    // The EXIF orientation flag can be also be read using native metadata queries
                    // such as "/app1/ifd/{ushort=274}" (JPEG) or "/ifd/{ushort=274}" (TIFF).
                    string[] requestedProperties = { "System.Photo.Orientation" };
                    BitmapPropertySet retrievedProperties =
                        await decoder.BitmapProperties.GetPropertiesAsync(requestedProperties);

                    // Check to see if the property exists in the file.
                    if (retrievedProperties.ContainsKey("System.Photo.Orientation"))
                    {
                        // EXIF orientation ("System.Photo.Orientation") is stored as a 16-bit unsigned integer.
                        m_exifOrientation = Helpers.ConvertToPhotoOrientation(
                            (ushort)retrievedProperties["System.Photo.Orientation"].Value
                            );
                    }
                }
                catch (Exception err)
                {
                    switch (err.HResult)
                    {
                        // If the file format does not support properties continue without applying EXIF orientation.
                        case WINCODEC_ERR_UNSUPPORTEDOPERATION:
                        case WINCODEC_ERR_PROPERTYNOTSUPPORTED:
                            m_disableExifOrientation = true;
                            break;
                        default:
                            throw;
                    }
                }
            }
        }

async Task LoadFileAsync ( StorageFile file ) [inline, private]

Load an image from a file and display some basic imaging properties.

Parameters:
file The image to load.

Definition at line 198 of file Scenario2.xaml.cs.

        {
            try
            {
                await DisplayImageFileAsync(file);
                rootPage.NotifyUser("Loaded file from picker: " + file.Name, NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                ResetSessionState();
                ResetPersistedState();
            }
        }

async Task LoadSaveFileAsync ( StorageFile outputFile ) [inline, private]

Definition at line 485 of file Scenario2.xaml.cs.

        {
            try
            {
                StorageFile inputFile = await m_futureAccess.GetFileAsync(m_fileToken);
                Guid encoderId;

                switch (outputFile.FileType)
                {
                    case ".png":
                        encoderId = BitmapEncoder.PngEncoderId;
                        break;
                    case ".bmp":
                        encoderId = BitmapEncoder.BmpEncoderId;
                        break;
                    case ".jpg":
                    default:
                        encoderId = BitmapEncoder.JpegEncoderId;
                        break;
                }

                using (IRandomAccessStream inputStream = await inputFile.OpenAsync(FileAccessMode.Read),
                           outputStream = await outputFile.OpenAsync(FileAccessMode.ReadWrite))
                {
                    // BitmapEncoder expects an empty output stream; the user may have selected a
                    // pre-existing file.
                    outputStream.Size = 0;

                    // Get pixel data from the decoder. We apply the user-requested transforms on the
                    // decoded pixels to take advantage of potential optimizations in the decoder.
                    BitmapDecoder decoder = await BitmapDecoder.CreateAsync(inputStream);
                    BitmapTransform transform = new BitmapTransform();

                    // Scaling occurs before flip/rotation, therefore use the original dimensions
                    // (no orientation applied) as parameters for scaling.
                    transform.ScaledHeight = (uint)(decoder.PixelHeight * m_scaleFactor);
                    transform.ScaledWidth = (uint)(decoder.PixelWidth * m_scaleFactor);
                    transform.Rotation = Helpers.ConvertToBitmapRotation(m_userRotation);

                    // Fant is a relatively high quality interpolation mode.
                    transform.InterpolationMode = BitmapInterpolationMode.Fant;

                    // The BitmapDecoder indicates what pixel format and alpha mode best match the
                    // natively stored image data. This can provide a performance and/or quality gain.
                    BitmapPixelFormat format = decoder.BitmapPixelFormat;
                    BitmapAlphaMode alpha = decoder.BitmapAlphaMode;

                    PixelDataProvider pixelProvider = await decoder.GetPixelDataAsync(
                        format,
                        alpha,
                        transform,
                        ExifOrientationMode.RespectExifOrientation,
                        ColorManagementMode.ColorManageToSRgb
                        );

                    byte[] pixels = pixelProvider.DetachPixelData();

                    // Write the pixel data onto the encoder. Note that we can't simply use the
                    // BitmapTransform.ScaledWidth and ScaledHeight members as the user may have
                    // requested a rotation (which is applied after scaling).
                    BitmapEncoder encoder = await BitmapEncoder.CreateAsync(encoderId, outputStream);
                    encoder.SetPixelData(
                        format,
                        alpha,
                        (uint)((double)m_displayWidthNonScaled * m_scaleFactor),
                        (uint)((double)m_displayHeightNonScaled * m_scaleFactor),
                        decoder.DpiX,
                        decoder.DpiY,
                        pixels
                        );

                    await encoder.FlushAsync();

                    rootPage.NotifyUser("Successfully saved a copy: " + outputFile.Name, NotifyType.StatusMessage);
                }
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                ResetPersistedState();
                ResetSessionState();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Definition at line 65 of file Scenario2.xaml.cs.

        {
            rootPage = MainPage.Current;
            App.Current.Suspending += new SuspendingEventHandler(SaveDataToPersistedState);

            // Reset scenario state before starting.
            ResetSessionState();

            // Attempt to load the previously saved scenario state.
            if (m_localSettings.ContainsKey("scenario2FileToken"))
            {
                RestoreDataFromPersistedState();
            }
        }

async void Open_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Load an image from disk and display properties.

Invoked when the user clicks on the Open button.

Definition at line 178 of file Scenario2.xaml.cs.

        {
            ResetPersistedState();
            ResetSessionState();

            FileOpenPicker picker = new FileOpenPicker();
            Helpers.FillDecoderExtensions(picker.FileTypeFilter);
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

            var file = await picker.PickSingleFileAsync();
            if (file != null)
            {
                await LoadFileAsync(file);
            }
        }

void ResetPersistedState ( ) [inline, private]

Clears all of the state for this scenario that is stored in app data.

Definition at line 632 of file Scenario2.xaml.cs.

        {
            m_localSettings.Remove("scenario2FileToken");
            m_localSettings.Remove("scenario2Scale");
            m_localSettings.Remove("scenario2Rotation");
            m_localSettings.Remove("scenario2Width");
            m_localSettings.Remove("scenario2Height");
            m_localSettings.Remove("scenario2UserRotation");
            m_localSettings.Remove("scenario2ExifOrientation");
            m_localSettings.Remove("scenario2DisableExif");
        }

void ResetSessionState ( ) [inline, private]

Clears all of the state that is stored in memory and in the UI.

Definition at line 647 of file Scenario2.xaml.cs.

        {
            m_fileToken = null;
            m_displayHeightNonScaled = 0;
            m_displayWidthNonScaled = 0;
            m_scaleFactor = 1;
            m_userRotation = PhotoOrientation.Normal;
            m_exifOrientation = PhotoOrientation.Normal;
            m_disableExifOrientation = false;

            RotateLeftButton.IsEnabled = false;
            RotateRightButton.IsEnabled = false;
            SaveButton.IsEnabled = false;
            SaveAsButton.IsEnabled = false;
            CloseButton.IsEnabled = false;

            PreviewImage.Source = null;
            m_transform.CenterX = ImageViewbox.Width / 2;
            m_transform.CenterY = ImageViewbox.Height / 2;
            ImageViewbox.RenderTransform = m_transform;
            UpdateImageRotation(PhotoOrientation.Normal);

            ScaleTextblock.Text = "";
            ScaleSlider.Value = 100;
            ScaleSlider.IsEnabled = false;
            HeightTextblock.Text = "";
            WidthTextblock.Text = "";
            UserRotationTextblock.Text = "";
            ExifOrientationTextblock.Text = "";
        }

async void RestoreDataFromPersistedState ( ) [inline, private]

Reads the file token and image transform variables from the persisted state and restores the UI.

Definition at line 117 of file Scenario2.xaml.cs.

        {
            try
            {
                rootPage.NotifyUser("Loading image file from persisted state...", NotifyType.StatusMessage);

                m_fileToken = (string)m_localSettings["scenario2FileToken"];
                m_displayWidthNonScaled = (uint)m_localSettings["scenario2Width"];
                m_displayHeightNonScaled = (uint)m_localSettings["scenario2Height"];
                m_scaleFactor = (double)m_localSettings["scenario2Scale"];

                PhotoOrientation desiredOrientation =
                    Helpers.ConvertToPhotoOrientation((ushort)m_localSettings["scenario2UserRotation"]);

                m_exifOrientation =
                    Helpers.ConvertToPhotoOrientation((ushort)m_localSettings["scenario2ExifOrientation"]);

                m_disableExifOrientation = (bool)m_localSettings["scenario2DisableExif"];

                // Display the image in the UI.
                StorageFile file = await m_futureAccess.GetFileAsync(m_fileToken);
                BitmapImage src = new BitmapImage();

                using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
                {
                    await src.SetSourceAsync(stream);
                }
                PreviewImage.Source = src;
                AutomationProperties.SetName(PreviewImage, file.Name);

                // Display the image dimensions and transformation state in the UI.
                ExifOrientationTextblock.Text = Helpers.GetOrientationString(m_exifOrientation);
                ScaleSlider.Value = m_scaleFactor * 100;
                UpdateImageDimensionsUI();

                // Restore the image tag's rotation transform.
                while (desiredOrientation != m_userRotation)
                {
                    RotateRight_Click(null, null);
                }

                RotateRightButton.IsEnabled = true;
                RotateLeftButton.IsEnabled = true;
                SaveButton.IsEnabled = true;
                CloseButton.IsEnabled = true;
                SaveAsButton.IsEnabled = true;
                ScaleSlider.IsEnabled = true;
                rootPage.NotifyUser("Loaded image file from persisted state: " + file.Name, NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                ResetSessionState();
                ResetPersistedState();
            }
        }

void RotateLeft_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

When the user clicks Rotate Left, rotate the ImageViewbox by 90 degrees counterclockwise, and update the dimensions.

Definition at line 322 of file Scenario2.xaml.cs.

        {
            m_userRotation = Helpers.Add90DegreesCCW(m_userRotation);

            // Swap width and height.
            uint temp = m_displayHeightNonScaled;
            m_displayHeightNonScaled = m_displayWidthNonScaled;
            m_displayWidthNonScaled = temp;

            UpdateImageDimensionsUI();
            UpdateImageRotation(m_userRotation);
        }

void RotateRight_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

When the user clicks Rotate Right, rotate the ImageViewbox by 90 degrees clockwise, and update the dimensions.

Definition at line 305 of file Scenario2.xaml.cs.

        {
            m_userRotation = Helpers.Add90DegreesCW(m_userRotation);

            // Swap width and height.
            uint temp = m_displayHeightNonScaled;
            m_displayHeightNonScaled = m_displayWidthNonScaled;
            m_displayWidthNonScaled = temp;

            UpdateImageDimensionsUI();
            UpdateImageRotation(m_userRotation);
        }

async void Save_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Applies the user-provided scale and rotation operation to the original image file.

The "Transcoding" mode is used which preserves image metadata and performs other optimizations when possible.

This method attempts to perform "soft" rotation using the EXIF orientation flag when possible, but falls back to a hard rotation of the image pixels.

Definition at line 343 of file Scenario2.xaml.cs.

        {
            try
            {
                rootPage.NotifyUser("Saving file...", NotifyType.StatusMessage);

                // Create a new encoder and initialize it with data from the original file.
                // The encoder writes to an in-memory stream, we then copy the contents to the file.
                // This allows the application to perform in-place editing of the file: any unedited data
                // is copied to the destination, and the original file is overwritten
                // with updated data.
                StorageFile file = await m_futureAccess.GetFileAsync(m_fileToken);
                using (IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.ReadWrite),
                                           memStream = new InMemoryRandomAccessStream())
                {
                    BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);

                    // Use the native (no orientation applied) image dimensions because we want to handle
                    // orientation ourselves.
                    uint originalWidth = decoder.PixelWidth;
                    uint originalHeight = decoder.PixelHeight;

                    // Set the encoder's destination to the temporary, in-memory stream.
                    BitmapEncoder encoder = await BitmapEncoder.CreateForTranscodingAsync(memStream, decoder);

                    // Scaling occurs before flip/rotation, therefore use the original dimensions
                    // (no orientation applied) as parameters for scaling.
                    // Dimensions are rounded down by BitmapEncoder to the nearest integer.
                    if (m_scaleFactor != 1.0)
                    {
                        encoder.BitmapTransform.ScaledWidth = (uint)(originalWidth * m_scaleFactor);
                        encoder.BitmapTransform.ScaledHeight = (uint)(originalHeight * m_scaleFactor);

                        // Fant is a relatively high quality interpolation mode.
                        encoder.BitmapTransform.InterpolationMode = BitmapInterpolationMode.Fant;
                    }

                    // If the file format supports EXIF orientation ("System.Photo.Orientation") then
                    // update the orientation flag to reflect any user-specified rotation.
                    // Otherwise, perform a hard rotate using BitmapTransform.
                    if (m_disableExifOrientation == false)
                    {
                        BitmapPropertySet properties = new BitmapPropertySet();
                        ushort netExifOrientation = Helpers.ConvertToExifOrientationFlag(
                            Helpers.AddPhotoOrientation(m_userRotation, m_exifOrientation)
                            );

                        // BitmapProperties requires the application to explicitly declare the type
                        // of the property to be written - this is different from FileProperties which
                        // automatically coerces the value to the correct type. System.Photo.Orientation
                        // is defined as an unsigned 16 bit integer.
                        BitmapTypedValue orientationTypedValue = new BitmapTypedValue(
                            netExifOrientation,
                            Windows.Foundation.PropertyType.UInt16
                            );

                        properties.Add("System.Photo.Orientation", orientationTypedValue);
                        await encoder.BitmapProperties.SetPropertiesAsync(properties);
                    }
                    else
                    {
                        encoder.BitmapTransform.Rotation = Helpers.ConvertToBitmapRotation(m_userRotation);
                    }

                    // Attempt to generate a new thumbnail to reflect any rotation operation.
                    encoder.IsThumbnailGenerated = true;

                    try
                    {
                        await encoder.FlushAsync();
                    }
                    catch (Exception err)
                    {
                        switch (err.HResult)
                        {
                            case WINCODEC_ERR_UNSUPPORTEDOPERATION:
                                // If the encoder does not support writing a thumbnail, then try again
                                // but disable thumbnail generation.
                                encoder.IsThumbnailGenerated = false;
                                break;
                            default:
                                throw;
                        }
                    }

                    if (encoder.IsThumbnailGenerated == false)
                    {
                        await encoder.FlushAsync();
                    }

                    // Now that the file has been written to the temporary stream, copy the data to the file.
                    memStream.Seek(0);
                    fileStream.Seek(0);
                    fileStream.Size = 0;
                    await RandomAccessStream.CopyAsync(memStream, fileStream);
                }

                // Because the original file has been overwritten, reload it in the UI.
                ResetSessionState();
                await DisplayImageFileAsync(file);

                rootPage.NotifyUser("Successfully saved file: " + file.Name, NotifyType.StatusMessage);
            }
            catch (Exception err)
            {
                if (err.HResult == WINCODEC_ERR_COMPONENTNOTFOUND)
                {
                    // Some image formats (e.g. ICO) do not have encoders.
                    rootPage.NotifyUser("Error: this file format may not support editing.", NotifyType.ErrorMessage);
                }
                else
                {
                    rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
                }

                ResetPersistedState();
                ResetSessionState();
            }
        }

async void SaveAs_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Applies the user-provided scale and rotation operation to a new image file picked by the user.

This method writes the edited pixel data to the new file without any regard to existing metadata or other information in the original file.

Definition at line 468 of file Scenario2.xaml.cs.

        {
            FileSavePicker picker = new FileSavePicker();
            picker.FileTypeChoices.Add("JPEG image", new string[] { ".jpg" });
            picker.FileTypeChoices.Add("PNG image", new string[] { ".png" });
            picker.FileTypeChoices.Add("BMP image", new string[] { ".bmp" });
            picker.DefaultFileExtension = ".png";
            picker.SuggestedFileName = "Output file";
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

            var file = await picker.PickSaveFileAsync();
            if (file != null)
            {
                await LoadSaveFileAsync(file);
            }
        }

void SaveDataToPersistedState | ( | object | sender,
 |  | SuspendingEventArgs | args |
 | ) |  |  | [inline, private]

When the application is about to enter a suspended state, save the user edited properties text.

This method does not use the SuspensionManager helper class (defined in SuspensionManager.cs).

Definition at line 84 of file Scenario2.xaml.cs.

        {
            // Only save state if we have valid data.
            if (m_fileToken != null)
            {
                // Requesting a deferral prevents the application from being immediately suspended.
                SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral();

                // LocalSettings does not support overwriting existing items, so first clear the collection.
                ResetPersistedState();

                m_localSettings.Add("scenario2FileToken", m_fileToken);
                m_localSettings.Add("scenario2Width", m_displayWidthNonScaled);
                m_localSettings.Add("scenario2Height", m_displayHeightNonScaled);
                m_localSettings.Add("scenario2Scale", m_scaleFactor);
                m_localSettings.Add("scenario2UserRotation",
                    Helpers.ConvertToExifOrientationFlag(m_userRotation)
                    );

                m_localSettings.Add("scenario2ExifOrientation",
                    Helpers.ConvertToExifOrientationFlag(m_exifOrientation)
                    );

                m_localSettings.Add("scenario2DisableExif", m_disableExifOrientation);

                deferral.Complete();
            }
        }

void ScaleSlider_ValueChanged | ( | object | sender,
 |  | Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs | e |
 | ) |  |  | [inline, private]

Handles when the slider controlling image scale is changed.

Definition at line 572 of file Scenario2.xaml.cs.

        {
            // Ignore any value changed events the control is set up and we are accepting user input.
            if ((ScaleSlider != null) && (ScaleSlider.IsEnabled == true))
            {
                // The slider control uses percentages (0 to 100) while m_scaleFactor is a coefficient (0 to 1).
                m_scaleFactor = e.NewValue / 100;
                UpdateImageDimensionsUI();
            }
        }

void UpdateImageDimensionsUI ( ) [inline, private]

Display the image dimensions and transformation state in the UI.

Definition at line 586 of file Scenario2.xaml.cs.

        {
            ScaleTextblock.Text = (m_scaleFactor * 100).ToString() + "%";
            WidthTextblock.Text = Math.Floor(((double)m_displayWidthNonScaled * m_scaleFactor)).ToString() + " pixels";
            HeightTextblock.Text = Math.Floor(((double)m_displayHeightNonScaled * m_scaleFactor)).ToString() + " pixels";
            UserRotationTextblock.Text = Helpers.GetOrientationString(m_userRotation);
        }

void UpdateImageRotation ( PhotoOrientation rotation ) [inline, private]

Sets the RotationTransform angle of the Image (technically, its parent Viewbox).

Definition at line 597 of file Scenario2.xaml.cs.

        {
            switch (rotation)
            {
                case PhotoOrientation.Rotate270:
                    // Note that the PhotoOrientation enumeration uses a counterclockwise convention,
                    // while the RotationTransform uses a clockwise convention.
                    m_transform.Angle = 90;
                    break;
                case PhotoOrientation.Rotate180:
                    m_transform.Angle = 180;
                    break;
                case PhotoOrientation.Rotate90:
                    m_transform.Angle = 270;
                    break;
                case PhotoOrientation.Normal:
                default:
                    m_transform.Angle = 0;
                    break;
            }
        }

Member Data Documentation

bool m_disableExifOrientation [private]

Definition at line 54 of file Scenario2.xaml.cs.

uint m_displayHeightNonScaled [private]

Definition at line 50 of file Scenario2.xaml.cs.

uint m_displayWidthNonScaled [private]

Definition at line 49 of file Scenario2.xaml.cs.

PhotoOrientation m_exifOrientation [private]

Definition at line 53 of file Scenario2.xaml.cs.

string m_fileToken [private]

Definition at line 48 of file Scenario2.xaml.cs.

StorageItemAccessList m_futureAccess = StorageApplicationPermissions.FutureAccessList [private]

Definition at line 45 of file Scenario2.xaml.cs.

IPropertySet m_localSettings = Windows.Storage.ApplicationData.Current.LocalSettings.Values [private]

Definition at line 46 of file Scenario2.xaml.cs.

double m_scaleFactor [private]

Definition at line 51 of file Scenario2.xaml.cs.

RotateTransform m_transform = new RotateTransform() [private]

Definition at line 47 of file Scenario2.xaml.cs.

PhotoOrientation m_userRotation [private]

Definition at line 52 of file Scenario2.xaml.cs.

MainPage rootPage [private]

Definition at line 55 of file Scenario2.xaml.cs.

const int WINCODEC_ERR_COMPONENTNOTFOUND = unchecked((int)0x88982F50) [private]

Definition at line 43 of file Scenario2.xaml.cs.

const int WINCODEC_ERR_PROPERTYNOTSUPPORTED = unchecked((int)0x88982F41) [private]

Definition at line 41 of file Scenario2.xaml.cs.

const int WINCODEC_ERR_UNSUPPORTEDOPERATION = unchecked((int)0x88982F81) [private]

Definition at line 39 of file Scenario2.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleImaging/cs/Scenario2.xaml.cs
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleOrientationCS
  • Scenario1_DataEvents
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_DataEvents Class Reference

List of all members.

Public Member Functions

Scenario1_DataEvents ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)
override void | OnNavigatingFrom (NavigatingCancelEventArgs e)

Private Member Functions

void | DisplayOrientation (TextBlock tb, SimpleOrientation orientation)
async void | OrientationChanged (object sender, SimpleOrientationSensorOrientationChangedEventArgs e)
void | ScenarioDisable (object sender, RoutedEventArgs e)
void | ScenarioEnable (object sender, RoutedEventArgs e)
void | VisibilityChanged (object sender, VisibilityChangedEventArgs e)

Private Attributes

SimpleOrientationSensor | _sensor
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_DataEvents.xaml.cs.

Constructor & Destructor Documentation

Scenario1_DataEvents ( ) [inline]

Definition at line 32 of file Scenario1_DataEvents.xaml.cs.

        {
            this.InitializeComponent();

            _sensor = SimpleOrientationSensor.GetDefault();
            if (_sensor == null)
            {
                rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

void DisplayOrientation | ( | TextBlock | tb,
 |  | SimpleOrientation | orientation |
 | ) |  |  | [inline, private]

Helper method to display the device orientation in the specified text box.

Parameters:
tb | The text box receiving the orientation value.
orientation | The orientation value.

Definition at line 107 of file Scenario1_DataEvents.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.NotRotated:
                    tb.Text = "Not Rotated";
                    break;
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    tb.Text = "Rotated 90 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    tb.Text = "Rotated 180 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    tb.Text = "Rotated 270 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Faceup:
                    tb.Text = "Faceup";
                    break;
                case SimpleOrientation.Facedown:
                    tb.Text = "Facedown";
                    break;
                default:
                    tb.Text = "Unknown orientation";
                    break;
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 48 of file Scenario1_DataEvents.xaml.cs.

        {
            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

override void OnNavigatingFrom ( NavigatingCancelEventArgs e ) [inline, protected]

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

Parameters:
e Event data that can be examined by overriding code. The event data is representative of the navigation that will unload the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.

Definition at line 62 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _sensor.OrientationChanged -= new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);
            }

            base.OnNavigatingFrom(e);
        }

async void OrientationChanged | ( | object | sender,
 |  | SimpleOrientationSensorOrientationChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for OrientationChanged events.

Parameters:
sender
e

Definition at line 140 of file Scenario1_DataEvents.xaml.cs.

        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                DisplayOrientation(ScenarioOutput_Orientation, e.Orientation);
            });
        }

void ScenarioDisable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Disable' button.

Parameters:
sender
e

Definition at line 177 of file Scenario1_DataEvents.xaml.cs.

        {
            Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
            _sensor.OrientationChanged -= new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);

            ScenarioEnableButton.IsEnabled = true;
            ScenarioDisableButton.IsEnabled = false;
        }

void ScenarioEnable | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 153 of file Scenario1_DataEvents.xaml.cs.

        {
            if (_sensor != null)
            {
                Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
                _sensor.OrientationChanged += new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);

                ScenarioEnableButton.IsEnabled = false;
                ScenarioDisableButton.IsEnabled = true;

                // Display the current orientation once while waiting for the next orientation change
                DisplayOrientation(ScenarioOutput_Orientation, _sensor.GetCurrentOrientation());
            }
            else
            {
                rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
            }
        }

void VisibilityChanged | ( | object | sender,
 |  | VisibilityChangedEventArgs | e |
 | ) |  |  | [inline, private]

This is the event handler for VisibilityChanged events.

You would register for these notifications if handling sensor data when the app is not visible could cause unintended actions in the app.

Parameters:
sender
e Event data that can be examined for the current visibility state.

Definition at line 81 of file Scenario1_DataEvents.xaml.cs.

        {
            if (ScenarioDisableButton.IsEnabled)
            {
                if (e.Visible)
                {
                    // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                    _sensor.OrientationChanged += new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);
                }
                else
                {
                    // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                    _sensor.OrientationChanged -= new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);
                }
            }
        }

Member Data Documentation

SimpleOrientationSensor _sensor [private]

Definition at line 30 of file Scenario1_DataEvents.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario1_DataEvents.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleOrientationSensor/cs/Scenario1_DataEvents.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SimpleOrientationCS
  • Scenario2_Polling
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Polling Class Reference

List of all members.

Public Member Functions

Scenario2_Polling ()

Private Member Functions

void | DisplayOrientation (TextBlock tb, SimpleOrientation orientation)
void | ScenarioGet (object sender, RoutedEventArgs e)

Private Attributes

SimpleOrientationSensor | _sensor
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario2_Polling.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Polling ( ) [inline]

Definition at line 32 of file Scenario2_Polling.xaml.cs.

        {
            this.InitializeComponent();

            _sensor = SimpleOrientationSensor.GetDefault();
            if (_sensor == null)
            {
                rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
            }
        }

Member Function Documentation

void DisplayOrientation | ( | TextBlock | tb,
 |  | SimpleOrientation | orientation |
 | ) |  |  | [inline, private]

Helper method to display the device orientation in the specified text box.

Parameters:
tb | The text box receiving the orientation value.
orientation | The orientation value.

Definition at line 52 of file Scenario2_Polling.xaml.cs.

        {
            switch (orientation)
            {
                case SimpleOrientation.NotRotated:
                    tb.Text = "Not Rotated";
                    break;
                case SimpleOrientation.Rotated90DegreesCounterclockwise:
                    tb.Text = "Rotated 90 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Rotated180DegreesCounterclockwise:
                    tb.Text = "Rotated 180 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Rotated270DegreesCounterclockwise:
                    tb.Text = "Rotated 270 Degrees Counterclockwise";
                    break;
                case SimpleOrientation.Faceup:
                    tb.Text = "Faceup";
                    break;
                case SimpleOrientation.Facedown:
                    tb.Text = "Facedown";
                    break;
                default:
                    tb.Text = "Unknown orientation";
                    break;
            }
        }

void ScenarioGet | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Enable' button.

Parameters:
sender
e

Definition at line 85 of file Scenario2_Polling.xaml.cs.

        {
            if (_sensor != null)
            {
                DisplayOrientation(ScenarioOutput_Orientation, _sensor.GetCurrentOrientation());
            }
            else
            {
                rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

SimpleOrientationSensor _sensor [private]

Definition at line 30 of file Scenario2_Polling.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Polling.xaml.cs.

The documentation for this class was generated from the following file:
  • SimpleOrientationSensor/cs/Scenario2_Polling.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleSmsBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SmsBackgroundTask
  • SampleSmsBackgroundTask
Public Member Functions | Private Member Functions

SampleSmsBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | DisplayToast (IBackgroundTaskInstance taskInstance)
void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Detailed Description

Definition at line 27 of file SmsBackgroundTask.cs.

Member Function Documentation

void DisplayToast ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 54 of file SmsBackgroundTask.cs.

        {
            try
            {
                SmsMessageReceivedTriggerDetails smsDetails = taskInstance.TriggerDetails as SmsMessageReceivedTriggerDetails;

                // Just registered for text messages
                SmsTextMessage2 smsTextMessage;
                if (smsDetails.MessageType == SmsMessageType.Text)
                {
                    smsTextMessage = smsDetails.TextMessage;

                    XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

                    XmlNodeList stringElements = toastXml.GetElementsByTagName("text");

                    stringElements.Item(0).AppendChild(toastXml.CreateTextNode(smsTextMessage.From));

                    stringElements.Item(1).AppendChild(toastXml.CreateTextNode(smsTextMessage.Body));

                    ToastNotification notification = new ToastNotification(toastXml);
                    ToastNotificationManager.CreateToastNotifier().Show(notification);
                }
                else
                {
                    Debug.WriteLine("Invalid message type: " + smsDetails.MessageType);
                }

                // Ack the message
                smsDetails.Accept();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error displaying toast: " + ex.Message);
            }
        }

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 95 of file SmsBackgroundTask.cs.

        {
            //
            // Indicate that the background task is canceled.
            //
            var settings = Windows.Storage.ApplicationData.Current.LocalSettings;
            settings.Values[sender.Task.TaskId.ToString()] = "Canceled";

            Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 32 of file SmsBackgroundTask.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");
            //
            // Associate a cancellation handler with the background task.
            //
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            //
            // Do the background task activity.
            //
            DisplayToast(taskInstance);

            //
            // Provide status to application via local settings storage
            //
            var settings = Windows.Storage.ApplicationData.Current.LocalSettings;
            settings.Values[taskInstance.Task.TaskId.ToString()] = "Completed";

            Debug.WriteLine("Background " + taskInstance.Task.Name + ("process ran"));
        }

The documentation for this class was generated from the following file:
  • SmsSendAndReceive/cs/SmsBackgroundTask/SmsBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RegisterWithBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SmsSendAndReceive
  • RegisterWithBackgroundTask
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

RegisterWithBackgroundTask Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

RegisterWithBackgroundTask ()
void | InitializeRegisteredSmsBackgroundTasks ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnCompleted (IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
void | Register_Click (object sender, RoutedEventArgs e)
void | Unregister_Click (object sender, RoutedEventArgs e)
void | UpdateBackgroundTaskUIState (bool Registered)

Private Attributes

const string | BackgroundTaskEntryPoint = "SmsBackgroundTask.SampleSmsBackgroundTask"
const string | BackgroundTaskName = "SampleSmsBackgroundTask"
MainPage rootPage
CoreDispatcher | sampleDispatcher

Detailed Description

Definition at line 30 of file RegisterWithBackgroundTask.xaml.cs.

Constructor & Destructor Documentation

RegisterWithBackgroundTask ( ) [inline]

Definition at line 37 of file RegisterWithBackgroundTask.xaml.cs.

        {
            this.InitializeComponent();

            // Get dispatcher for dispatching updates to the UI thread.
            sampleDispatcher = Window.Current.CoreWindow.Dispatcher;

            RegisterButton.IsEnabled = true;
            UnregisterButton.IsEnabled = false;

            try
            {
                // Initialize state-based registration of currently registered background tasks.
                InitializeRegisteredSmsBackgroundTasks();
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }

        }

Member Function Documentation

void InitializeRegisteredSmsBackgroundTasks ( ) [inline]

Definition at line 83 of file RegisterWithBackgroundTask.xaml.cs.

        {
            try
            {
                //
                // Initialize UI elements based on currently registered background tasks
                // and associate background task completed event handler with each background task.
                //
                UpdateBackgroundTaskUIState(false);

                foreach (var item in BackgroundTaskRegistration.AllTasks)
                {
                    IBackgroundTaskRegistration task = item.Value;
                    if (task.Name == BackgroundTaskName)
                    {
                        UpdateBackgroundTaskUIState(true);
                        task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
                    }
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

async void OnCompleted | ( | IBackgroundTaskRegistration | sender,
 |  | BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 226 of file RegisterWithBackgroundTask.xaml.cs.

        {
            // Update the UI with the complrtion status reported by the background task.
            // Dispatch an anonymous task to the UI thread to do the update.
            await sampleDispatcher.RunAsync(CoreDispatcherPriority.Normal,
                () =>
                {
                    try
                    {
                        if ((sender != null) && (e != null))
                        {
                            // this method throws if the event is reporting an error
                            e.CheckResult();

                            // Update the UI with the background task's completion status.
                            // The task stores status in the application data settings indexed by the task ID.
                            var key = sender.TaskId.ToString();
                            var settings = ApplicationData.Current.LocalSettings;
                            BackgroundTaskStatus.Text = settings.Values[key].ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
                    }
                });
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 59 of file RegisterWithBackgroundTask.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Register_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file RegisterWithBackgroundTask.xaml.cs.

        {
            // Check to see that a filter action type is set
            if (AcceptImmediatelyButton.IsChecked == false && DropButton.IsChecked == false && PeekButton.IsChecked == false && AcceptButton.IsChecked == false)
            {
                rootPage.NotifyUser("Please set a filter action type", NotifyType.ErrorMessage);
                return;
            }

            // Check to see that a message type is set
            if (TextButton.IsChecked == false && AppButton.IsChecked == false && WapButton.IsChecked == false && BroadcastButton.IsChecked == false && VoicemailButton.IsChecked == false)
            {
                rootPage.NotifyUser("Please set a message type", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                // Set filter action type
                SmsMessageType messageType = SmsMessageType.Text; // set as Text as default
                if (TextButton.IsChecked == true)
                {
                    messageType = SmsMessageType.Text;
                }
                else if (AppButton.IsChecked == true)
                {
                    messageType = SmsMessageType.App;
                }
                else if (WapButton.IsChecked == true)
                {
                    messageType = SmsMessageType.Wap;
                }
                else if (BroadcastButton.IsChecked == true)
                {
                    messageType = SmsMessageType.Broadcast;
                }
                else if (VoicemailButton.IsChecked == true)
                {
                    messageType = SmsMessageType.Voicemail;
                }

                // Create new filter rule (individual)
                SmsFilterRule filter = new SmsFilterRule(messageType);

                // Set filter action type
                SmsFilterActionType actionType = SmsFilterActionType.Accept; // set as Accept as default
                if (AcceptImmediatelyButton.IsChecked == true)
                {
                    actionType = SmsFilterActionType.AcceptImmediately;
                }
                else if (DropButton.IsChecked == true)
                {
                    actionType = SmsFilterActionType.Drop;
                }
                else if (PeekButton.IsChecked == true)
                {
                    actionType = SmsFilterActionType.Peek;
                }
                else if (AcceptButton.IsChecked == true)
                {
                    actionType = SmsFilterActionType.Accept;
                }

                // Created set of filters for this application
                SmsFilterRules filterRules = new SmsFilterRules(actionType);
                IList<SmsFilterRule> rules = filterRules.Rules;
                rules.Add(filter);

                // Create a new background task builder.
                BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder();

                // Create a new SmsMessageReceivedTrigger.
                SmsMessageReceivedTrigger trigger = new SmsMessageReceivedTrigger(filterRules);

                // Associate the SmsReceived trigger with the background task builder.
                taskBuilder.SetTrigger(trigger);

                // Specify the background task to run when the trigger fires.
                taskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;

                // Name the background task.
                taskBuilder.Name = BackgroundTaskName;

                // Register the background task.
                BackgroundTaskRegistration taskRegistration = taskBuilder.Register();

                // Associate completed event handler with the new background task.
                taskRegistration.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);

                UpdateBackgroundTaskUIState(true);
                rootPage.NotifyUser("Registered SMS background task", NotifyType.StatusMessage);
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
            }
        }

void Unregister_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 209 of file RegisterWithBackgroundTask.xaml.cs.

        {
            // Loop through all background tasks and unregister our background task
            foreach (var cur in BackgroundTaskRegistration.AllTasks)
            {
                if (cur.Value.Name == BackgroundTaskName)
                {
                    cur.Value.Unregister(true);
                }
            }

            UpdateBackgroundTaskUIState(false);
            rootPage.NotifyUser("Unregistered SMS background task.", NotifyType.StatusMessage);

        }

void UpdateBackgroundTaskUIState ( bool Registered ) [inline, private]

Definition at line 66 of file RegisterWithBackgroundTask.xaml.cs.

        {
            if (Registered)
            {
                BackgroundTaskStatus.Text = "Registered";
                RegisterButton.IsEnabled = false;
                UnregisterButton.IsEnabled = true;
            }
            else
            {
                BackgroundTaskStatus.Text = "Unregistered";
                RegisterButton.IsEnabled = true;
                UnregisterButton.IsEnabled = false;
            }
        }

Member Data Documentation

const string BackgroundTaskEntryPoint = "SmsBackgroundTask.SampleSmsBackgroundTask" [private]

Definition at line 33 of file RegisterWithBackgroundTask.xaml.cs.

const string BackgroundTaskName = "SampleSmsBackgroundTask" [private]

Definition at line 34 of file RegisterWithBackgroundTask.xaml.cs.

MainPage rootPage [private]

Definition at line 32 of file RegisterWithBackgroundTask.xaml.cs.

CoreDispatcher sampleDispatcher [private]

Definition at line 35 of file RegisterWithBackgroundTask.xaml.cs.

The documentation for this class was generated from the following file:
  • SmsSendAndReceive/cs/SmsSendAndReceive/RegisterWithBackgroundTask.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SendTextMessage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SmsSendAndReceive
  • SendTextMessage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SendTextMessage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

SendTextMessage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Send_Click (object sender, RoutedEventArgs e)

Private Attributes

SmsDevice2 | device
MainPage rootPage

Detailed Description

Definition at line 27 of file SendTextMessage.xaml.cs.

Constructor & Destructor Documentation

SendTextMessage ( ) [inline]

Definition at line 32 of file SendTextMessage.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file SendTextMessage.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Send_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file SendTextMessage.xaml.cs.

        {
            if (SendToText.Text == "")
            {
                rootPage.NotifyUser("Please enter sender number", NotifyType.ErrorMessage);
                return;
            }

            if (SendMessageText.Text == "")
            {
                rootPage.NotifyUser("Please enter message", NotifyType.ErrorMessage);
                return;
            }

            // If this is the first request, get the default SMS device. If this
            // is the first SMS device access, the user will be prompted to grant
            // access permission for this application.
            if (device == null)
            {
                try
                {
                    rootPage.NotifyUser("Getting default SMS device ...", NotifyType.StatusMessage);
                    device = SmsDevice2.GetDefault();
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                    return;
                }

            }

            string msgStr = "";
            if (device != null)
            {
                try
                {
                    // Create a text message - set the entered destination number and message text.
                    SmsTextMessage2 msg = new SmsTextMessage2();
                    msg.To = SendToText.Text;
                    msg.Body = SendMessageText.Text;

                    // Send the message asynchronously
                    rootPage.NotifyUser("Sending message ...", NotifyType.StatusMessage);
                    SmsSendMessageResult result = await device.SendMessageAndGetResultAsync(msg);

                    if (result.IsSuccessful)
                    {
                        msgStr = "";
                        msgStr += "Text message sent, cellularClass: " + result.CellularClass.ToString();
                        IReadOnlyList<Int32> messageReferenceNumbers = result.MessageReferenceNumbers;

                        for (int i = 0; i < messageReferenceNumbers.Count; i++)
                        {
                            msgStr += "\n\t\tMessageReferenceNumber[" + i.ToString() + "]: " + messageReferenceNumbers[i].ToString();
                        }
                        rootPage.NotifyUser(msgStr, NotifyType.StatusMessage);
                    }
                    else
                    {
                        msgStr = "";
                        msgStr += "ModemErrorCode: " + result.ModemErrorCode.ToString();
                        msgStr += "\nIsErrorTransient: " + result.IsErrorTransient.ToString();
                        if (result.ModemErrorCode == SmsModemErrorCode.MessagingNetworkError)
                        {
                            msgStr += "\n\tNetworkCauseCode: " + result.NetworkCauseCode.ToString();

                            if (result.CellularClass == CellularClass.Cdma)
                            {
                                msgStr += "\n\tTransportFailureCause: " + result.TransportFailureCause.ToString();
                            }
                            rootPage.NotifyUser(msgStr, NotifyType.ErrorMessage);
                        }
                    }
                }
                catch (Exception ex)
                {
                    rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Failed to find SMS device", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

SmsDevice2 device [private]

Definition at line 30 of file SendTextMessage.xaml.cs.

MainPage rootPage [private]

Definition at line 29 of file SendTextMessage.xaml.cs.

The documentation for this class was generated from the following file:
  • SmsSendAndReceive/cs/SmsSendAndReceive/SendTextMessage.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SocketActivityBackgroundTask
  • SocketActivityTask
Public Member Functions | Private Attributes

SocketActivityTask Class Reference

List of all members.

Public Member Functions

async void | Run (IBackgroundTaskInstance taskInstance)
void | ShowToast (string text)

Private Attributes

const string | socketId = "SampleSocket"

Detailed Description

Definition at line 26 of file SocketActivityTask.cs.

Member Function Documentation

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 30 of file SocketActivityTask.cs.

        {
            var deferral = taskInstance.GetDeferral();
            try
            {
                var details = taskInstance.TriggerDetails as SocketActivityTriggerDetails;
                var socketInformation = details.SocketInformation;
                switch (details.Reason)
                {
                    case SocketActivityTriggerReason.SocketActivity:
                        var socket = socketInformation.StreamSocket;
                        DataReader reader = new DataReader(socket.InputStream);
                        reader.InputStreamOptions = InputStreamOptions.Partial;
                        await reader.LoadAsync(250);
                        var dataString = reader.ReadString(reader.UnconsumedBufferLength);
                        ShowToast(dataString);
                        socket.TransferOwnership(socketInformation.Id);
                        break;
                    case SocketActivityTriggerReason.KeepAliveTimerExpired:
                        socket = socketInformation.StreamSocket;
                        DataWriter writer = new DataWriter(socket.OutputStream);
                        writer.WriteBytes(Encoding.UTF8.GetBytes("Keep alive"));
                        await writer.StoreAsync();
                        writer.DetachStream();
                        writer.Dispose();
                        socket.TransferOwnership(socketInformation.Id);
                        break;
                    case SocketActivityTriggerReason.SocketClosed:
                        socket = new StreamSocket();
                        socket.EnableTransferOwnership(taskInstance.Task.TaskId, SocketActivityConnectedStandbyAction.Wake);
                        if (ApplicationData.Current.LocalSettings.Values["hostname"] == null)
                        {
                            break;
                        }
                        var hostname = (String)ApplicationData.Current.LocalSettings.Values["hostname"];
                        var port = (String)ApplicationData.Current.LocalSettings.Values["port"];
                        await socket.ConnectAsync(new HostName(hostname), port);
                        socket.TransferOwnership(socketId);
                        break;
                    default:
                        break;
                }
                deferral.Complete();
            }
            catch (Exception exception)
            {
                ShowToast(exception.Message);
                deferral.Complete();
            }
        }

void ShowToast ( string text ) [inline]

Definition at line 81 of file SocketActivityTask.cs.

        {
            var toastNotifier = ToastNotificationManager.CreateToastNotifier();
            var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
            var textNodes = toastXml.GetElementsByTagName("text");
            textNodes.First().AppendChild(toastXml.CreateTextNode(text));
            var toastNotification = new ToastNotification(toastXml);
            toastNotifier.Show(new ToastNotification(toastXml));
        }

Member Data Documentation

const string socketId = "SampleSocket" [private]

Definition at line 28 of file SocketActivityTask.cs.

The documentation for this class was generated from the following file:
  • SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/SocketActivityTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Connect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SocketActivityStreamSocket
  • Scenario1_Connect
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Connect Class Reference

List of all members.

Public Member Functions

Scenario1_Connect ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ConnectButton_Click (object sender, RoutedEventArgs e)

Private Attributes

const string | port = "40404"
MainPage rootPage
StreamSocket | socket = null
const string | socketId = "SampleSocket"
IBackgroundTaskRegistration | task = null

Detailed Description

Definition at line 26 of file Scenario1_Connect.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Connect ( ) [inline]

Definition at line 34 of file Scenario1_Connect.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ConnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 84 of file Scenario1_Connect.xaml.cs.

        {
            ApplicationData.Current.LocalSettings.Values["hostname"] = TargetServerTextBox.Text;
            ApplicationData.Current.LocalSettings.Values["port"] = port;

            try
            {
                SocketActivityInformation socketInformation;
                if (!SocketActivityInformation.AllSockets.TryGetValue(socketId, out socketInformation))
                {
                    socket = new StreamSocket();
                    socket.EnableTransferOwnership(task.TaskId, SocketActivityConnectedStandbyAction.Wake);
                    var targetServer = new HostName(TargetServerTextBox.Text);
                    await socket.ConnectAsync(targetServer, port);
                    // To demonstrate usage of CancelIOAsync async, have a pending read on the socket and call
                    // cancel before transfering the socket.
                    DataReader reader = new DataReader(socket.InputStream);
                    reader.InputStreamOptions = InputStreamOptions.Partial;
                    var read = reader.LoadAsync(250);
                    read.Completed += (info, status) =>
                    {

                    };
                    await socket.CancelIOAsync();
                    socket.TransferOwnership(socketId);
                    socket = null;
                }
                ConnectButton.IsEnabled = false;
                rootPage.NotifyUser("Connected. You may close the application", NotifyType.StatusMessage);
            }
            catch (Exception exception)
            {
                rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario1_Connect.xaml.cs.

        {
            rootPage = MainPage.Current;
            try
            {
                foreach (var current in BackgroundTaskRegistration.AllTasks)
                {
                    if (current.Value.Name == "SocketActivityBackgroundTask")
                    {
                        task = current.Value;
                        break;
                    }
                }

                // If there is no task allready created, create a new one
                if (task == null)
                {
                    var socketTaskBuilder = new BackgroundTaskBuilder();
                    socketTaskBuilder.Name = "SocketActivityBackgroundTask";
                    socketTaskBuilder.TaskEntryPoint = "SocketActivityBackgroundTask.SocketActivityTask";
                    var trigger = new SocketActivityTrigger();
                    socketTaskBuilder.SetTrigger(trigger);
                    task = socketTaskBuilder.Register();
                }

                SocketActivityInformation socketInformation;
                if (SocketActivityInformation.AllSockets.TryGetValue(socketId, out socketInformation))
                {
                    // Application can take ownership of the socket and make any socket operation
                    // For sample it is just transfering it back.
                    socket = socketInformation.StreamSocket;
                    socket.TransferOwnership(socketId);
                    socket = null;
                    rootPage.NotifyUser("Connected. You may close the application", NotifyType.StatusMessage);
                    TargetServerTextBox.IsEnabled = false;
                    ConnectButton.IsEnabled = false;
                }

            }
            catch (Exception exception)
            {
                rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

const string port = "40404" [private]

Definition at line 32 of file Scenario1_Connect.xaml.cs.

MainPage rootPage [private]

Definition at line 28 of file Scenario1_Connect.xaml.cs.

StreamSocket socket = null [private]

Definition at line 30 of file Scenario1_Connect.xaml.cs.

const string socketId = "SampleSocket" [private]

Definition at line 29 of file Scenario1_Connect.xaml.cs.

IBackgroundTaskRegistration task = null [private]

Definition at line 31 of file Scenario1_Connect.xaml.cs.

The documentation for this class was generated from the following file:
  • SocketActivityStreamSocket/cs/SocketActivityStreamSocket/Scenario1_Connect.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SoundEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

SoundEffect Class Reference

#include "SoundEffect.h"

List of all members.

Public Member Functions

SoundEffect ()
void | Initialize (_In_ IXAudio2 *masteringEngine, _In_ WAVEFORMATEX *sourceFormat, _In_ std::vector< byte > const &soundData)
void | PlaySound (_In_ float volume)

Private Attributes

bool | m_audioAvailable
std::vector< byte > | m_soundData
IXAudio2SourceVoice * | m_sourceVoice

Detailed Description

Definition at line 19 of file SoundEffect.h.

Constructor & Destructor Documentation

SoundEffect ( )

Definition at line 15 of file SoundEffect.cpp.

                         :
    m_audioAvailable(false)
{
}

Member Function Documentation

void Initialize | ( | _In_ IXAudio2 * | masteringEngine,
 |  | _In_ WAVEFORMATEX * | sourceFormat,
 |  | _In_ std::vector< byte > const & | soundData
 | ) |  |

Definition at line 20 of file SoundEffect.cpp.

{
    m_soundData = soundData;

    if (masteringEngine == nullptr)
    {
        // Audio is not available so just return.
        m_audioAvailable = false;
        return;
    }

    // Create a source voice for this sound effect.
    winrt::check_hresult(
        masteringEngine->CreateSourceVoice(
            &m_sourceVoice,
            sourceFormat
            )
        );
    m_audioAvailable = true;
}

void PlaySound ( _In_ float volume )

Definition at line 44 of file SoundEffect.cpp.

{
    XAUDIO2_BUFFER buffer = { 0 };

    if (!m_audioAvailable)
    {
        // Audio is not available so just return.
        return;
    }

    // Interrupt sound effect if it is currently playing.
    winrt::check_hresult(
        m_sourceVoice->Stop()
        );
    winrt::check_hresult(
        m_sourceVoice->FlushSourceBuffers()
        );

    // Queue the memory buffer for playback and start the voice.
    buffer.AudioBytes = (UINT32)m_soundData.size();
    buffer.pAudioData = m_soundData.data();
    buffer.Flags = XAUDIO2_END_OF_STREAM;

    winrt::check_hresult(
        m_sourceVoice->SetVolume(volume)
        );
    winrt::check_hresult(
        m_sourceVoice->SubmitSourceBuffer(&buffer)
        );
    winrt::check_hresult(
        m_sourceVoice->Start()
        );
}

Member Data Documentation

bool m_audioAvailable [private]

Definition at line 33 of file SoundEffect.h.

std::vector<byte> m_soundData [private]

Definition at line 35 of file SoundEffect.h.

IXAudio2SourceVoice* m_sourceVoice [private]

Definition at line 34 of file SoundEffect.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/SoundEffect.h
  • Simple3DGameDX/cppwinrt/GameContent/SoundEffect.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Sphere Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Member Functions | Private Attributes

Sphere Class Reference

#include "Sphere.h"

Inherits GameObject.

List of all members.

Public Member Functions

Sphere ()
Sphere (DirectX::XMFLOAT3 pos, float radius)
virtual bool | IsTouching (DirectX::XMFLOAT3 point, float radius, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) override
void | Position (DirectX::XMFLOAT3 position)
void | Position (DirectX::XMVECTOR position)
float | Radius ()
void | Radius (float radius)

Private Member Functions

void | Update ()

Private Attributes

float | m_radius

Detailed Description

Definition at line 20 of file Sphere.h.

Constructor & Destructor Documentation

Sphere ( )

Definition at line 17 of file Sphere.cpp.

{
    m_position = XMFLOAT3(0.0f, 0.0f, 0.0f);
    m_radius = 1.0f;
    Update();
}

Sphere | ( | DirectX::XMFLOAT3 | pos,
 |  | float | radius
 | ) |  |

Definition at line 24 of file Sphere.cpp.

{
    m_position = position;
    m_radius = radius;
    Update();
}

Member Function Documentation

virtual bool IsTouching | ( | DirectX::XMFLOAT3 | point,
 |  | float | radius,
 |  | _Out_ DirectX::XMFLOAT3 * | contact,
 |  | _Out_ DirectX::XMFLOAT3 * | normal |
 | ) |  |  | [override, virtual]

Reimplemented from GameObject.

__forceinline void Position ( DirectX::XMFLOAT3 position )

Reimplemented from GameObject.

Definition at line 44 of file Sphere.h.

{
    m_position = position;
    Update();
}

__forceinline void Position ( DirectX::XMVECTOR position )

Reimplemented from GameObject.

Definition at line 50 of file Sphere.h.

{
    DirectX::XMStoreFloat3(&m_position, position);
    Update();
}

__forceinline float Radius ( )

Definition at line 62 of file Sphere.h.

{
    return m_radius;
}

__forceinline void Radius ( float radius )

Definition at line 56 of file Sphere.h.

{
    m_radius = radius;
    Update();
}

void Update ( ) [private]

Definition at line 34 of file Sphere.cpp.

{
    XMStoreFloat4x4(
        &m_modelMatrix,
        XMMatrixScaling(m_radius, m_radius, m_radius) *
        XMMatrixTranslation(m_position.x, m_position.y, m_position.z)
        );
}

Member Data Documentation

float m_radius [private]

Definition at line 40 of file Sphere.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/Sphere.h
  • Simple3DGameDX/cppwinrt/GameContent/Sphere.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SphereMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

SphereMesh Class Reference

#include "SphereMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

SphereMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device, uint16_t segments)

Detailed Description

Definition at line 21 of file SphereMesh.h.

Constructor & Destructor Documentation

SphereMesh | ( | _In_ winrt::com_ptr< ID3D11Device3 > const & | device,
 |  | uint16_t | segments
 | ) |  |

Definition at line 18 of file SphereMesh.cpp.

{
    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    uint16_t slices = segments / 2;
    uint16_t numVertices = (slices + 1) * (segments + 1) + 1;
    uint16_t numIndices = slices * segments * 3 * 2;

    std::vector<PNTVertex> point(numVertices);
    std::vector<uint16_t> index(numIndices);

    // To make the texture look right on the top and bottom of the sphere
    // each slice will have 'segments + 1' vertices. The top and bottom
    // vertices will all be coincident, but have different U texture cooordinates.
    uint16_t p = 0;
    for (uint16_t a = 0; a <= slices; a++)
    {
        float angle1 = static_cast<float>(a) / static_cast<float>(slices) * XM_PI;
        float z = cos(angle1);
        float r = sin(angle1);
        for (uint16_t b = 0; b <= segments; b++)
        {
            float angle2 = static_cast<float>(b) / static_cast<float>(segments) * XM_2PI;
            point[p].position = XMFLOAT3(r * cos(angle2), r * sin(angle2), z);
            point[p].normal = point[p].position;
            point[p].textureCoordinate = XMFLOAT2((1.0f - z) / 2.0f, static_cast<float>(b) / static_cast<float>(segments));
            p++;
        }
    }
    m_vertexCount = p;

    p = 0;
    for (uint16_t a = 0; a < slices; a++)
    {
        uint16_t p1 = a * (segments + 1);
        uint16_t p2 = (a + 1) * (segments + 1);

        // Generate two triangles for each segment around the slice.
        for (uint16_t b = 0; b < segments; b++)
        {
            if (a < (slices - 1))
            {
                // For all but the bottom slice add the triangle with one
                // vertex in the a slice and two vertices in the a + 1 slice.
                // Skip it for the bottom slice since the triangle would be
                // degenerate as all the vertices in the bottom slice are coincident.
                index[p] = b + p1;
                index[p + 1] = b + p2;
                index[p + 2] = b + p2 + 1;
                p = p + 3;
            }
            if (a > 0)
            {
                // For all but the top slice add the triangle with two
                // vertices in the a slice and one vertex in the a + 1 slice.
                // Skip it for the top slice since the triangle would be
                // degenerate as all the vertices in the top slice are coincident.
                index[p] = b + p1;
                index[p + 1] = b + p2 + 1;
                index[p + 2] = b + p1 + 1;
                p = p + 3;
            }
        }
    }
    m_indexCount = p;

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = point.data();
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(uint16_t) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = index.data();
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/SphereMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/SphereMesh.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedSplash Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SplashScreenSample
  • ExtendedSplash
Public Member Functions | Private Member Functions | Private Attributes

ExtendedSplash Class Reference

List of all members.

Public Member Functions

ExtendedSplash (SplashScreen splashscreen, bool loadState)

Private Member Functions

void | DismissedEventHandler (SplashScreen sender, object e)
void | ExtendedSplash_OnResize (Object sender, WindowSizeChangedEventArgs e)
void | LearnMoreButton_Click (object sender, RoutedEventArgs e)
void | PositionImage ()
async void | RestoreStateAsync (bool loadState)

Private Attributes

internal bool | dismissed = false
internal Frame | rootFrame
double | ScaleFactor
SplashScreen | splash
internal Rect | splashImageRect

Detailed Description

Definition at line 25 of file ExtendedSplash.xaml.cs.

Constructor & Destructor Documentation

ExtendedSplash | ( | SplashScreen | splashscreen,
 |  | bool | loadState |
 | ) |  |  | [inline]

Definition at line 34 of file ExtendedSplash.xaml.cs.

        {
            InitializeComponent();

            LearnMoreButton.Click += new RoutedEventHandler(LearnMoreButton_Click);
            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            ScaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);
        }

Member Function Documentation

void DismissedEventHandler | ( | SplashScreen | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 115 of file ExtendedSplash.xaml.cs.

        {
            dismissed = true;

            // Navigate away from the app's extended splash screen after completing setup operations here...
            // This sample navigates away from the extended splash screen when the "Learn More" button is clicked.
        }

void ExtendedSplash_OnResize | ( | Object | sender,
 |  | WindowSizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file ExtendedSplash.xaml.cs.

        {
            // Safely update the extended splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
            if (splash != null)
            {
                // Update the coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }
        }

void LearnMoreButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 102 of file ExtendedSplash.xaml.cs.

        {
            // Navigate to mainpage
            rootFrame.Navigate(typeof(MainPage));

            // Set extended splash info on main page
            ((MainPage)rootFrame.Content).SetExtendedSplashInfo(splashImageRect, dismissed);

            // Place the frame in the current Window
            Window.Current.Content = rootFrame;
        }

void PositionImage ( ) [inline, private]

Definition at line 75 of file ExtendedSplash.xaml.cs.

        {
            extendedSplashImage.SetValue(Canvas.LeftProperty, splashImageRect.Left);
            extendedSplashImage.SetValue(Canvas.TopProperty, splashImageRect.Top);
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                extendedSplashImage.Height = splashImageRect.Height / ScaleFactor;
                extendedSplashImage.Width = splashImageRect.Width / ScaleFactor;
            }
            else
            {
                extendedSplashImage.Height = splashImageRect.Height;
                extendedSplashImage.Width = splashImageRect.Width;
            }
        }

async void RestoreStateAsync ( bool loadState ) [inline, private]

Definition at line 64 of file ExtendedSplash.xaml.cs.

        {
            if (loadState)
                await SuspensionManager.RestoreAsync();

            // Normally you should start the time consuming task asynchronously here and
            // dismiss the extended splash screen in the completed handler of that task
            // This sample dismisses extended splash screen  in the handler for "Learn More" button for demonstration
        }

Member Data Documentation

internal bool dismissed = false [private]

Definition at line 28 of file ExtendedSplash.xaml.cs.

internal Frame rootFrame [private]

Definition at line 29 of file ExtendedSplash.xaml.cs.

double ScaleFactor [private]

Definition at line 32 of file ExtendedSplash.xaml.cs.

SplashScreen splash [private]

Definition at line 31 of file ExtendedSplash.xaml.cs.

internal Rect splashImageRect [private]

Definition at line 27 of file ExtendedSplash.xaml.cs.

The documentation for this class was generated from the following file:
  • SplashScreen/cs/ExtendedSplash.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SplashScreenSample
  • Scenario1
Public Member Functions | Protected Member Functions

Scenario1 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 22 of file Scenario1_SplashScreenDismiss.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 24 of file Scenario1_SplashScreenDismiss.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 29 of file Scenario1_SplashScreenDismiss.xaml.cs.

        {
            if (MainPage.Current.Dismissed)
            {
                OutputTextBlock.Text = "Received the splash screen dismissal event.";
            }
            else
            {
                OutputTextBlock.Text = "The application didn't receive the splash screen dismissal event.";
            }
        }

The documentation for this class was generated from the following file:
  • SplashScreen/cs/Scenario1_SplashScreenDismiss.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • SplashScreenSample
  • Scenario2
Public Member Functions | Protected Member Functions

Scenario2 Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void OnNavigatedTo (NavigationEventArgs e)

Detailed Description

Definition at line 24 of file Scenario2_ExtendedSplash.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 26 of file Scenario2_ExtendedSplash.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 31 of file Scenario2_ExtendedSplash.xaml.cs.

        {
            Rect rect = MainPage.Current.SplashImageRect;
            XValue.Text = " " + rect.X.ToString() + ", ";
            YValue.Text = " " + rect.Y.ToString() + " with ";
            WidthValue.Text = " " + rect.Width.ToString() + ", ";
            HeightValue.Text = " " + rect.Height.ToString() + ".";
        }

The documentation for this class was generated from the following file:
  • SplashScreen/cs/Scenario2_ExtendedSplash.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 25 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Allows tracking page views, exceptions and other telemetry through the Microsoft Application Insights service.

Initializes the singleton application object. This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 35 of file App.xaml.cs.

        {

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 47 of file App.xaml.cs.

        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 93 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 105 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/App.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ControlSizeTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • CustomTriggers
  • ControlSizeTrigger
Properties | Private Member Functions | Private Attributes

ControlSizeTrigger Class Reference

List of all members.

Properties

double | MinHeight [get, set]
double | MinWidth [get, set]
FrameworkElement | TargetElement [get, set]

Private Member Functions

void | _targetElement_SizeChanged (object sender, SizeChangedEventArgs e)
void | UpdateTrigger ()

Private Attributes

double | _currentHeight
double | _currentWidth
double | _minHeight
double | _minWidth = -1
FrameworkElement | _targetElement

Detailed Description

Definition at line 10 of file ControlSizeTrigger.cs.

Member Function Documentation

void _targetElement_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file ControlSizeTrigger.cs.

        {
            _currentHeight = e.NewSize.Height;
            _currentWidth = e.NewSize.Width;
            UpdateTrigger();
        }

void UpdateTrigger ( ) [inline, private]

Definition at line 63 of file ControlSizeTrigger.cs.

        {
            //if target is set and either minHeight or minWidth is set, proceed
            if (_targetElement != null && (_minWidth > 0 || _minHeight > 0))
            {
                //if both minHeight and minWidth are set, then both conditions must be satisfied
                if (_minHeight > 0 && _minWidth > 0)
                {
                    SetActive((_currentHeight >= _minHeight) && (_currentWidth >= _minWidth));
                }
                //if only one of them is set, then only that condition needs to be satisfied
                else if (_minHeight > 0)
                {
                    SetActive(_currentHeight >= _minHeight);
                }
                else
                {
                    SetActive(_currentWidth >= _minWidth);
                }
            }
            else
            {
                SetActive(false);
            }
        }

Member Data Documentation

double _currentHeight [private]

Definition at line 15 of file ControlSizeTrigger.cs.

double _currentWidth [private]

Definition at line 15 of file ControlSizeTrigger.cs.

double _minHeight [private]

Definition at line 13 of file ControlSizeTrigger.cs.

double _minWidth = -1 [private]

Definition at line 13 of file ControlSizeTrigger.cs.

FrameworkElement _targetElement [private]

Definition at line 14 of file ControlSizeTrigger.cs.

Property Documentation

double MinHeight [get, set]

Definition at line 18 of file ControlSizeTrigger.cs.

double MinWidth [get, set]

Definition at line 29 of file ControlSizeTrigger.cs.

FrameworkElement TargetElement [get, set]

Definition at line 40 of file ControlSizeTrigger.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/CustomTriggers/ControlSizeTrigger.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceFamilyTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • CustomTriggers
  • DeviceFamilyTrigger
Properties | Private Attributes

DeviceFamilyTrigger Class Reference

List of all members.

Properties

string | DeviceFamily [get, set]

Private Attributes

string | _currentDeviceFamily
string | _queriedDeviceFamily

Detailed Description

Definition at line 10 of file DeviceFamilyTrigger.cs.

Member Data Documentation

string _currentDeviceFamily [private]

Definition at line 13 of file DeviceFamilyTrigger.cs.

string _queriedDeviceFamily [private]

Definition at line 13 of file DeviceFamilyTrigger.cs.

Property Documentation

string DeviceFamily [get, set]

Definition at line 16 of file DeviceFamilyTrigger.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/CustomTriggers/DeviceFamilyTrigger.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InputTypeTrigger Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • CustomTriggers
  • InputTypeTrigger
Public Member Functions | Properties | Private Member Functions | Private Attributes

InputTypeTrigger Class Reference

List of all members.

Public Member Functions

void | UpdateTrigger ()

Properties

PointerDeviceType | PointerType [get, set]
FrameworkElement | TargetElement [get, set]

Private Member Functions

void | _targetElement_PointerPressed (object sender, PointerRoutedEventArgs e)

Private Attributes

PointerDeviceType | _lastPointerType
FrameworkElement | _targetElement
PointerDeviceType | _triggerPointerType

Detailed Description

Definition at line 12 of file InputTypeTrigger.cs.

Member Function Documentation

void _targetElement_PointerPressed | ( | object | sender,
 |  | PointerRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file InputTypeTrigger.cs.

        {
            _lastPointerType = e.Pointer.PointerDeviceType;
            UpdateTrigger();
        }

void UpdateTrigger ( ) [inline]

Definition at line 48 of file InputTypeTrigger.cs.

        {
            SetActive(_triggerPointerType == _lastPointerType);
        }

Member Data Documentation

PointerDeviceType _lastPointerType [private]

Definition at line 16 of file InputTypeTrigger.cs.

FrameworkElement _targetElement [private]

Definition at line 15 of file InputTypeTrigger.cs.

PointerDeviceType _triggerPointerType [private]

Definition at line 16 of file InputTypeTrigger.cs.

Property Documentation

PointerDeviceType PointerType [get, set]

Definition at line 31 of file InputTypeTrigger.cs.

FrameworkElement TargetElement [get, set]

Definition at line 19 of file InputTypeTrigger.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/CustomTriggers/InputTypeTrigger.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemTemplateControl Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • ItemTemplateControl
Public Member Functions

ItemTemplateControl Class Reference

List of all members.

Public Member Functions

ItemTemplateControl ()

Detailed Description

Definition at line 20 of file ItemTemplateControl.xaml.cs.

Constructor & Destructor Documentation

ItemTemplateControl ( ) [inline]

Definition at line 22 of file ItemTemplateControl.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/ItemTemplateControl.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • MainPage
Public Member Functions | Private Member Functions | Private Attributes

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()

Private Member Functions

void MainPage_Loaded (object sender, RoutedEventArgs e)

Private Attributes

MainViewModel _viewModel

Detailed Description

Definition at line 24 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 27 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();
            this.Loaded += MainPage_Loaded;
        }

Member Function Documentation

void MainPage_Loaded | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 33 of file MainPage.xaml.cs.

        {
            _viewModel = new MainViewModel();
            list.ItemsSource = _viewModel.Items;
        }

Member Data Documentation

MainViewModel _viewModel [private]

Definition at line 26 of file MainPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • ViewModel
  • MainViewModel
Public Member Functions | Properties | Private Attributes

MainViewModel Class Reference

List of all members.

Public Member Functions

MainViewModel ()

Properties

ObservableCollection< Model > | Items [get, set]

Private Attributes

ObservableCollection< Model > | _items

Detailed Description

Definition at line 10 of file MainViewModel.cs.

Constructor & Destructor Documentation

MainViewModel ( ) [inline]

Definition at line 25 of file MainViewModel.cs.

        {
            Items = new ObservableCollection<Model>();
            Items.Clear();
            Items.Add(new Model { Name = "Item1", Description = "First item that is plain and simple", IsColorEnabled = false });
            Items.Add(new Model { Name = "Item2", Description = "Second item uses a ViewModel property in a custom trigger for color variation", IsColorEnabled = true });
            Items.Add(new Model { Name = "Item3", Description = "Third item without color in ViewModel property, but has a lot of text that increases its size. This larger size driven by the content drives changes to the colors in XAML using a custom ControlSizeTrigger", IsColorEnabled = false });
        }

Member Data Documentation

ObservableCollection<Model> _items [private]

Definition at line 12 of file MainViewModel.cs.

Property Documentation

ObservableCollection<Model> Items [get, set]

Definition at line 14 of file MainViewModel.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/ViewModel/MainViewModel.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Model Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StateTriggersSample
  • ViewModel
  • Model
Properties

Model Class Reference

List of all members.

Properties

string | Description [get, set]
Boolean | IsColorEnabled [get, set]
string | Name [get, set]

Detailed Description

Definition at line 9 of file Model.cs.

Property Documentation

string Description [get, set]

Definition at line 12 of file Model.cs.

Boolean IsColorEnabled [get, set]

Definition at line 13 of file Model.cs.

string Name [get, set]

Definition at line 11 of file Model.cs.

The documentation for this class was generated from the following file:
  • XamlStateTriggers/cs/ViewModel/Model.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: STEREO_PARAMETERS Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

STEREO_PARAMETERS Struct Reference

#include "StereoProjection.h"

List of all members.

Public Attributes

float | displaySizeInches
float | pixelResolutionHeight
float | pixelResolutionWidth
float | stereoExaggerationFactor
float | stereoSeparationFactor
float | viewerDistanceInches

Detailed Description

Definition at line 14 of file StereoProjection.h.

Member Data Documentation

float displaySizeInches

Definition at line 17 of file StereoProjection.h.

float pixelResolutionHeight

Definition at line 19 of file StereoProjection.h.

float pixelResolutionWidth

Definition at line 18 of file StereoProjection.h.

float stereoExaggerationFactor

Definition at line 21 of file StereoProjection.h.

float stereoSeparationFactor

Definition at line 20 of file StereoProjection.h.

float viewerDistanceInches

Definition at line 16 of file StereoProjection.h.

The documentation for this struct was generated from the following file:
  • Simple3DGameDX/cppwinrt/GameContent/StereoProjection.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Send Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketListenerServer
  • Scenario1_Send
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Send Class Reference

List of all members.

Public Member Functions

Scenario1_Send ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | OnConnected (StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
async void | SendButton_Click (object sender, RoutedEventArgs e)

Private Attributes

StreamSocket | connectedSocket = null
const string | port = "40404"
MainPage rootPage
StreamSocketListener | tcpListener

Detailed Description

Definition at line 25 of file Scenario1_Send.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Send ( ) [inline]

Definition at line 32 of file Scenario1_Send.xaml.cs.

        {
            this.InitializeComponent();
            SendMessageTextBox.IsEnabled = false;
            SendButton.IsEnabled = false;
        }

Member Function Documentation

async void OnConnected | ( | StreamSocketListener | sender,
 |  | StreamSocketListenerConnectionReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 39 of file Scenario1_Send.xaml.cs.

        {
            if (connectedSocket != null)
            {
                connectedSocket.Dispose();
                connectedSocket = null;
            }
            connectedSocket = args.Socket;
            await SendMessageTextBox.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                rootPage.NotifyUser("Client has connected, go ahead and send a message...", NotifyType.StatusMessage);
                SendMessageTextBox.IsEnabled = true;
                SendButton.IsEnabled = true;
            });
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 57 of file Scenario1_Send.xaml.cs.

        {
            rootPage = MainPage.Current;
            rootPage.NotifyUser("Waiting for client to connect...", NotifyType.StatusMessage);
            tcpListener = new StreamSocketListener();
            tcpListener.ConnectionReceived += OnConnected;
            await tcpListener.BindEndpointAsync(null, port);
        }

async void SendButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 66 of file Scenario1_Send.xaml.cs.

        {
            try
            {
                DataWriter writer = new DataWriter(connectedSocket.OutputStream);
                writer.WriteBytes(Encoding.UTF8.GetBytes(SendMessageTextBox.Text));
                SendMessageTextBox.Text = "";
                await writer.StoreAsync();
                writer.DetachStream();
                writer.Dispose();
            }
            catch(Exception exception)
            {
                rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

StreamSocket connectedSocket = null [private]

Definition at line 29 of file Scenario1_Send.xaml.cs.

const string port = "40404" [private]

Definition at line 30 of file Scenario1_Send.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario1_Send.xaml.cs.

StreamSocketListener tcpListener [private]

Definition at line 28 of file Scenario1_Send.xaml.cs.

The documentation for this class was generated from the following file:
  • SocketActivityStreamSocket/cs/Server/Scenario1_Send.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocalHostItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • LocalHostItem
Public Member Functions | Properties

LocalHostItem Class Reference

Helper class describing a NetworkAdapter and its associated IP address. More...

List of all members.

Public Member Functions

LocalHostItem (HostName localHostName)

Properties

string | DisplayString [get, set]
HostName | LocalHost [get, set]

Detailed Description

Definition at line 252 of file Scenario1_Start.xaml.cs.

Constructor & Destructor Documentation

LocalHostItem ( HostName localHostName ) [inline]

Definition at line 266 of file Scenario1_Start.xaml.cs.

        {
            if (localHostName == null)
            {
                throw new ArgumentNullException("localHostName");
            }

            if (localHostName.IPInformation == null)
            {
                throw new ArgumentException("Adapter information not found");
            }

            this.LocalHost = localHostName;
            this.DisplayString = "Address: " + localHostName.DisplayName +
                " Adapter: " + localHostName.IPInformation.NetworkAdapter.NetworkAdapterId;
        }

Property Documentation

string DisplayString [get, set]

Definition at line 255 of file Scenario1_Start.xaml.cs.

HostName LocalHost [get, set]

Definition at line 261 of file Scenario1_Start.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario1_Start.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • Scenario1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1 Class Reference

A page for first scenario.

List of all members.

Public Member Functions

Scenario1 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | BindToAny_Checked (object sender, RoutedEventArgs e)
void | BindToAny_Unchecked (object sender, RoutedEventArgs e)
void | NotifyUserFromAsyncThread (string strMessage, NotifyType type)
async void | OnConnection (StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
void | PopulateAdapterList ()
async void | StartListener_Click (object sender, RoutedEventArgs e)

Private Attributes

List< LocalHostItem > | localHostItems = new List<LocalHostItem>()
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 30 of file Scenario1_Start.xaml.cs.

Constructor & Destructor Documentation

Scenario1 ( ) [inline]

Definition at line 39 of file Scenario1_Start.xaml.cs.

        {
            this.InitializeComponent();
            PopulateAdapterList();
        }

Member Function Documentation

void BindToAny_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario1_Start.xaml.cs.

        {
            AdapterList.IsEnabled = false;
        }

void BindToAny_Unchecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file Scenario1_Start.xaml.cs.

        {
            AdapterList.IsEnabled = true;
        }

void NotifyUserFromAsyncThread | ( | string | strMessage,
 |  | NotifyType | type |
 | ) |  |  | [inline, private]

Definition at line 223 of file Scenario1_Start.xaml.cs.

        {
            var ignore = Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
        }

async void OnConnection | ( | StreamSocketListener | sender,
 |  | StreamSocketListenerConnectionReceivedEventArgs | args |
 | ) |  |  | [inline, private]

Invoked once a connection is accepted by StreamSocketListener.

Parameters:
sender | The listener that accepted the connection.
args | Parameters associated with the accepted connection.

Definition at line 176 of file Scenario1_Start.xaml.cs.

        {
            DataReader reader = new DataReader(args.Socket.InputStream);
            try
            {
                while (true)
                {
                    // Read first 4 bytes (length of the subsequent string).
                    uint sizeFieldCount = await reader.LoadAsync(sizeof(uint));
                    if (sizeFieldCount != sizeof(uint))
                    {
                        // The underlying socket was closed before we were able to read the whole data.
                        return;
                    }

                    // Read the string.
                    uint stringLength = reader.ReadUInt32();
                    uint actualStringLength = await reader.LoadAsync(stringLength);
                    if (stringLength != actualStringLength)
                    {
                        // The underlying socket was closed before we were able to read the whole data.
                        return;
                    }

                    // Display the string on the screen. The event is invoked on a non-UI thread, so we need to marshal
                    // the text back to the UI thread.
                    NotifyUserFromAsyncThread(
                        String.Format("Received data: \"{0}\"", reader.ReadString(actualStringLength)),
                        NotifyType.StatusMessage);
                }
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                NotifyUserFromAsyncThread(
                    "Read stream failed with error: " + exception.Message,
                    NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 50 of file Scenario1_Start.xaml.cs.

        {
            BindToAny.IsChecked = true;
        }

void PopulateAdapterList ( ) [inline, private]

Populates the NetworkAdapter list.

Definition at line 232 of file Scenario1_Start.xaml.cs.

        {
            localHostItems.Clear();
            AdapterList.ItemsSource = localHostItems;
            AdapterList.DisplayMemberPath = "DisplayString";

            foreach (HostName localHostInfo in NetworkInformation.GetHostNames())
            {
                if (localHostInfo.IPInformation != null)
                {
                    LocalHostItem adapterItem = new LocalHostItem(localHostInfo);
                    localHostItems.Add(adapterItem);
                }
            }
        }

async void StartListener_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'StartListener' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 70 of file Scenario1_Start.xaml.cs.

        {
            // Overriding the listener here is safe as it will be deleted once all references to it are gone.
            // However, in many cases this is a dangerous pattern to override data semi-randomly (each time user
            // clicked the button) so we block it here.
            if (CoreApplication.Properties.ContainsKey("listener"))
            {
                rootPage.NotifyUser(
                    "This step has already been executed. Please move to the next one.",
                    NotifyType.ErrorMessage);
                return;
            }

            if (String.IsNullOrEmpty(ServiceNameForListener.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            CoreApplication.Properties.Remove("serverAddress");
            CoreApplication.Properties.Remove("adapter");

            LocalHostItem selectedLocalHost = null;
            if ((BindToAddress.IsChecked == true) || (BindToAdapter.IsChecked == true))
            {
                selectedLocalHost = (LocalHostItem)AdapterList.SelectedItem;
                if (selectedLocalHost == null)
                {
                    rootPage.NotifyUser("Please select an address / adapter.", NotifyType.ErrorMessage);
                    return;
                }

                // The user selected an address. For demo purposes, we ensure that connect will be using the same
                // address.
                CoreApplication.Properties.Add("serverAddress", selectedLocalHost.LocalHost.CanonicalName);
            }

            StreamSocketListener listener = new StreamSocketListener();
            listener.ConnectionReceived += OnConnection;

            // If necessary, tweak the listener's control options before carrying out the bind operation.
            // These options will be automatically applied to the connected StreamSockets resulting from
            // incoming connections (i.e., those passed as arguments to the ConnectionReceived event handler).
            // Refer to the StreamSocketListenerControl class' MSDN documentation for the full list of control options.
            listener.Control.KeepAlive = false;

            // Save the socket, so subsequent steps can use it.
            CoreApplication.Properties.Add("listener", listener);

            // Start listen operation.
            try
            {
                if (BindToAny.IsChecked == true)
                {
                    // Don't limit traffic to an address or an adapter.
                    await listener.BindServiceNameAsync(ServiceNameForListener.Text);
                    rootPage.NotifyUser("Listening", NotifyType.StatusMessage);
                }
                else if (BindToAddress.IsChecked == true)
                {
                    // Try to bind to a specific address.
                    await listener.BindEndpointAsync(selectedLocalHost.LocalHost, ServiceNameForListener.Text);
                    rootPage.NotifyUser(
                        "Listening on address " + selectedLocalHost.LocalHost.CanonicalName,
                        NotifyType.StatusMessage);
                }
                else if (BindToAdapter.IsChecked == true)
                {
                    // Try to limit traffic to the selected adapter.
                    // This option will be overridden by interfaces with weak-host or forwarding modes enabled.
                    NetworkAdapter selectedAdapter = selectedLocalHost.LocalHost.IPInformation.NetworkAdapter;

                    // For demo purposes, ensure that we use the same adapter in the client connect scenario.
                    CoreApplication.Properties.Add("adapter", selectedAdapter);

                    await listener.BindServiceNameAsync(
                        ServiceNameForListener.Text,
                        SocketProtectionLevel.PlainSocket,
                        selectedAdapter);

                    rootPage.NotifyUser(
                        "Listening on adapter " + selectedAdapter.NetworkAdapterId,
                        NotifyType.StatusMessage);
                }
            }
            catch (Exception exception)
            {
                CoreApplication.Properties.Remove("listener");

                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser(
                    "Start listening failed with error: " + exception.Message,
                    NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

List<LocalHostItem> localHostItems = new List<LocalHostItem>() [private]

Definition at line 37 of file Scenario1_Start.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 34 of file Scenario1_Start.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario1_Start.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • Scenario2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2 Class Reference

A page for second scenario.

List of all members.

Public Member Functions

Scenario2 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ConnectSocket_Click (object sender, RoutedEventArgs e)

Private Attributes

NetworkAdapter | adapter = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario2_Connect.xaml.cs.

Constructor & Destructor Documentation

Scenario2 ( ) [inline]

Definition at line 37 of file Scenario2_Connect.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ConnectSocket_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ConnectSocket' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 72 of file Scenario2_Connect.xaml.cs.

        {
            if (CoreApplication.Properties.ContainsKey("clientSocket"))
            {
                rootPage.NotifyUser(
                    "This step has already been executed. Please move to the next one.",
                    NotifyType.ErrorMessage);
                return;
            }

            if (String.IsNullOrEmpty(ServiceNameForConnect.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            // By default 'HostNameForConnect' is disabled and host name validation is not required. When enabling the
            // text box validating the host name is required since it was received from an untrusted source
            // (user input). The host name is validated by catching ArgumentExceptions thrown by the HostName
            // constructor for invalid input.
            HostName hostName;
            try
            {
                hostName = new HostName(HostNameForConnect.Text);
            }
            catch (ArgumentException)
            {
                rootPage.NotifyUser("Error: Invalid host name.", NotifyType.ErrorMessage);
                return;
            }

            StreamSocket socket = new StreamSocket();

            // If necessary, tweak the socket's control options before carrying out the connect operation.
            // Refer to the StreamSocketControl class' MSDN documentation for the full list of control options.
            socket.Control.KeepAlive = false;

            // Save the socket, so subsequent steps can use it.
            CoreApplication.Properties.Add("clientSocket", socket);
            try
            {
                if (adapter == null)
                {
                    rootPage.NotifyUser("Connecting to: " + HostNameForConnect.Text, NotifyType.StatusMessage);

                    // Connect to the server (by default, the listener we created in the previous step).
                    await socket.ConnectAsync(hostName, ServiceNameForConnect.Text);

                    rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser(
                        "Connecting to: " + HostNameForConnect.Text +
                        " using network adapter " + adapter.NetworkAdapterId,
                        NotifyType.StatusMessage);

                    // Connect to the server (by default, the listener we created in the previous step)
                    // limiting traffic to the same adapter that the user specified in the previous step.
                    // This option will be overridden by interfaces with weak-host or forwarding modes enabled.
                    await socket.ConnectAsync(
                        hostName,
                        ServiceNameForConnect.Text,
                        SocketProtectionLevel.PlainSocket,
                        adapter);

                    rootPage.NotifyUser(
                        "Connected using network adapter " + adapter.NetworkAdapterId,
                        NotifyType.StatusMessage);
                }

                // Mark the socket as connected. Set the value to null, as we care only about the fact that the
                // property is set.
                CoreApplication.Properties.Add("connected", null);
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 47 of file Scenario2_Connect.xaml.cs.

        {
            // Make sure we're using the correct server address if an adapter was selected in scenario 1.
            object serverAddress;
            if (CoreApplication.Properties.TryGetValue("serverAddress", out serverAddress))
            {
                if (serverAddress is string)
                {
                    HostNameForConnect.Text = serverAddress as string;
                }
            }

            adapter = null;
            object networkAdapter;
            if (CoreApplication.Properties.TryGetValue("adapter", out networkAdapter))
            {
                adapter = (NetworkAdapter)networkAdapter;
            }
        }

Member Data Documentation

NetworkAdapter adapter = null [private]

Definition at line 35 of file Scenario2_Connect.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario2_Connect.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario2_Connect.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • Scenario3
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3 Class Reference

A page for third scenario.

List of all members.

Public Member Functions

Scenario3 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | SendHello_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario3_Send.xaml.cs.

Constructor & Destructor Documentation

Scenario3 ( ) [inline]

Definition at line 34 of file Scenario3_Send.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario3_Send.xaml.cs.

        {
        }

async void SendHello_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'SendHello' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 53 of file Scenario3_Send.xaml.cs.

        {
            if (!CoreApplication.Properties.ContainsKey("connected"))
            {
                rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
                return;
            }

            object outValue;
            StreamSocket socket;
            if (!CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
            {
                rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
                return;
            }

            socket = (StreamSocket)outValue;

            // Create a DataWriter if we did not create one yet. Otherwise use one that is already cached.
            DataWriter writer;
            if (!CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
            {
                writer = new DataWriter(socket.OutputStream);
                CoreApplication.Properties.Add("clientDataWriter", writer);
            }
            else
            {
                writer = (DataWriter)outValue;
            }

            // Write first the length of the string as UINT32 value followed up by the string.
            // Writing data to the writer will just store data in memory.
            string stringToSend = "Hello";
            writer.WriteUInt32(writer.MeasureString(stringToSend));
            writer.WriteString(stringToSend);

            // Write the locally buffered data to the network.
            try
            {
                await writer.StoreAsync();
                SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error if fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario3_Send.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario3_Send.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • Scenario4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario4 Class Reference

A page for fourth scenario.

List of all members.

Public Member Functions

Scenario4 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CloseSockets_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 28 of file Scenario4_Close.xaml.cs.

Constructor & Destructor Documentation

Scenario4 ( ) [inline]

Definition at line 34 of file Scenario4_Close.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CloseSockets_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'CloseSockets' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 53 of file Scenario4_Close.xaml.cs.

        {
            object outValue;
            if (CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
            {
                // Remove the data writer from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("clientDataWriter");
                DataWriter dataWriter = (DataWriter)outValue;

                // To reuse the socket with another data writer, the application must detach the stream from the
                // current writer before disposing it. This is added for completeness, as this sample closes the socket
                // in the very next block.
                dataWriter.DetachStream();
                dataWriter.Dispose();
            }

            if (CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
            {
                // Remove the socket from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("clientSocket");
                StreamSocket socket = (StreamSocket)outValue;

                // StreamSocket.Close() is exposed through the Dispose() method in C#.
                // The call below explicitly closes the socket.
                socket.Dispose();
            }

            if (CoreApplication.Properties.TryGetValue("listener", out outValue))
            {
                // Remove the listener from the list of application properties as we are about to close it.
                CoreApplication.Properties.Remove("listener");
                StreamSocketListener listener = (StreamSocketListener)outValue;

                // StreamSocketListener.Close() is exposed through the Dispose() method in C#.
                // The call below explicitly closes the socket.
                listener.Dispose();
            }

            CoreApplication.Properties.Remove("connected");
            CoreApplication.Properties.Remove("adapter");
            CoreApplication.Properties.Remove("serverAddress");

            rootPage.NotifyUser("Socket and listener closed", NotifyType.StatusMessage);
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario4_Close.xaml.cs.

        {
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 32 of file Scenario4_Close.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario4_Close.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • StreamSocketSample
  • Scenario5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario5 Class Reference

A page for fifth scenario.

List of all members.

Public Member Functions

Scenario5 ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | ConnectSocket_Click (object sender, RoutedEventArgs e)
string | GetCertificateInformation (Certificate serverCert, IReadOnlyList< Certificate > intermediateCertificates)
async Task< bool > | ShouldIgnoreCertificateErrorsAsync (IReadOnlyList< ChainValidationResult > serverCertificateErrors)
async Task< bool > | TryConnectSocketWithRetryAsync (StreamSocket socket, HostName hostName)

Private Attributes

const int | abortButtonId = 0
const int | continueButtonId = 1
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 33 of file Scenario5_Certificates.xaml.cs.

Constructor & Destructor Documentation

Scenario5 ( ) [inline]

Definition at line 42 of file Scenario5_Certificates.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ConnectSocket_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'ConnectSocket' button.

Parameters:
sender | Object for which the event was generated.
e | Event's parameters.

Definition at line 61 of file Scenario5_Certificates.xaml.cs.

        {
            // Validating the host name is required since it was received
            // from an untrusted source (user input). The host name is validated by catching ArgumentExceptions thrown
            // by the HostName constructor for invalid input.
            if (String.IsNullOrEmpty(ServiceNameForConnect.Text))
            {
                rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
                return;
            }

            HostName hostName;
            try
            {
                hostName = new HostName(HostNameForConnect.Text);
            }
            catch (ArgumentException)
            {
                rootPage.NotifyUser("Error: Invalid host name.", NotifyType.ErrorMessage);
                return;
            }

            rootPage.NotifyUser("Connecting to: " + HostNameForConnect.Text, NotifyType.StatusMessage);

            using (StreamSocket socket = new StreamSocket())
            {
                // If necessary, tweak the socket's control options before carrying out the connect operation.
                // Refer to the StreamSocketControl class' MSDN documentation for the full list of control options.
                socket.Control.ClientCertificate = null;

                bool shouldRetry = await TryConnectSocketWithRetryAsync(socket, hostName);
                if (shouldRetry)
                {
                    // Retry if the first attempt failed because of SSL errors.
                    await TryConnectSocketWithRetryAsync(socket, hostName);
                }
            }
        }

string GetCertificateInformation | ( | Certificate | serverCert,
 |  | IReadOnlyList< Certificate > | intermediateCertificates |
 | ) |  |  | [inline, private]

Gets detailed certificate information.

Parameters:
serverCert | The server certificate
intermediateCertificates | The server certificate chain
Returns:
A string containing certificate details

Definition at line 187 of file Scenario5_Certificates.xaml.cs.

        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("\tFriendly Name: " + serverCert.FriendlyName);
            stringBuilder.AppendLine("\tSubject: " + serverCert.Subject);
            stringBuilder.AppendLine("\tIssuer: " + serverCert.Issuer);
            stringBuilder.AppendLine("\tValidity: " + serverCert.ValidFrom + " - " + serverCert.ValidTo);

            // Enumerate the entire certificate chain.
            if (intermediateCertificates.Count > 0)
            {
                stringBuilder.AppendLine("\tCertificate chain: ");
                foreach (var cert in intermediateCertificates)
                {
                    stringBuilder.AppendLine("\t\tIntermediate Certificate Subject: " + cert.Subject);
                }
            }
            else
            {
                stringBuilder.AppendLine("\tNo certificates within the intermediate chain.");
            }

            return stringBuilder.ToString();
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 52 of file Scenario5_Certificates.xaml.cs.

        {
        }

async Task<bool> ShouldIgnoreCertificateErrorsAsync ( IReadOnlyList< ChainValidationResult > serverCertificateErrors ) [inline, private]

Allows the user to abort the connection in case of SSL/TLS errors.

Parameters:
serverCertificateErrors The server certificate errors
Returns:
False if the connection should be aborted

Definition at line 160 of file Scenario5_Certificates.xaml.cs.

        {
            string connectionErrors = String.Join(", ", serverCertificateErrors);

            string dialogMessage =
                "The remote server certificate validation failed with the following errors: " +
                connectionErrors + Environment.NewLine + "Security certificate problems may" +
                " indicate an attempt to fool you or intercept any data you send to the server.";

            MessageDialog dialog = new MessageDialog(dialogMessage, "Server Certificate Validation Errors");

            dialog.Commands.Add(new UICommand("Continue (not recommended)", null, continueButtonId));
            dialog.Commands.Add(new UICommand("Cancel", null, abortButtonId));
            dialog.DefaultCommandIndex = 1;
            dialog.CancelCommandIndex = 1;

            IUICommand selected = await dialog.ShowAsync();
            return (selected.Id is int) && ((int)selected.Id == continueButtonId);
        }

async Task<bool> TryConnectSocketWithRetryAsync | ( | StreamSocket | socket,
 |  | HostName | hostName |
 | ) |  |  | [inline, private]

Definition at line 100 of file Scenario5_Certificates.xaml.cs.

        {
            try
            {
                // Establish a secure connection to the server (by default, the local IIS server).
                await socket.ConnectAsync(hostName, ServiceNameForConnect.Text, SocketProtectionLevel.Tls12);

                string certInformation = GetCertificateInformation(
                    socket.Information.ServerCertificate,
                    socket.Information.ServerIntermediateCertificates);

                rootPage.NotifyUser(
                    "Connected to server. Certificate information: " + Environment.NewLine + certInformation,
                    NotifyType.StatusMessage);
                return false;
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                // If the exception was caused by an SSL error that is ignorable we are going to prompt the user
                // with an enumeration of the errors and ask for permission to ignore.
                if (socket.Information.ServerCertificateErrorSeverity != SocketSslErrorSeverity.Ignorable)
                {
                    rootPage.NotifyUser("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
                    return false;
                }
            }

            // Present the certificate issues and ask the user if we should continue.
            if (await ShouldIgnoreCertificateErrorsAsync(socket.Information.ServerCertificateErrors))
            {
                // -----------------------------------------------------------------------------------------------
                // WARNING: Only test applications should ignore SSL errors.
                // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle attacks.
                // -----------------------------------------------------------------------------------------------
                socket.Control.IgnorableServerCertificateErrors.Clear();
                foreach (var ignorableError in socket.Information.ServerCertificateErrors)
                {
                    socket.Control.IgnorableServerCertificateErrors.Add(ignorableError);
                }
                rootPage.NotifyUser("Retrying connection", NotifyType.StatusMessage);
                return true;
            }
            else
            {
                rootPage.NotifyUser("Connection aborted by user (certificate not trusted)", NotifyType.ErrorMessage);
                return false;
            }
        }

Member Data Documentation

const int abortButtonId = 0 [private]

Definition at line 36 of file Scenario5_Certificates.xaml.cs.

const int continueButtonId = 1 [private]

Definition at line 35 of file Scenario5_Certificates.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 40 of file Scenario5_Certificates.xaml.cs.

The documentation for this class was generated from the following file:
  • StreamSocket/cs/Scenario5_Certificates.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StringTrimmer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Static Public Member Functions

StringTrimmer Class Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static Platform::String Trim (Platform::String^s)

Detailed Description

Definition at line 70 of file SampleConfiguration.h.

Member Function Documentation

static Platform::String Trim ( Platform::String^ s ) [inline, static]

Definition at line 73 of file SampleConfiguration.h.

    {
        const WCHAR* first = s->Begin();
        const WCHAR* last = s->End();

        while (first != last && iswspace(*first))
        {
            ++first;
        }

        while (first != last && iswspace(last[-1]))
        {
            --last;
        }

        return ref new Platform::String(first, static_cast<unsigned int>(last - first));
    }

The documentation for this class was generated from the following file:
  • BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: S1_GetAFeed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Syndication
  • S1_GetAFeed
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

S1_GetAFeed Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

S1_GetAFeed ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | DisplayCurrentItem ()
void | DisplayFeed ()
async void | GetFeed_Click (object sender, RoutedEventArgs e)
async void | LinkField_Click (object sender, RoutedEventArgs e)
void | NextItem_Click (object sender, RoutedEventArgs e)
void | PreviousItem_Click (object sender, RoutedEventArgs e)

Private Attributes

SyndicationFeed | currentFeed = null
int | currentItemIndex
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario1_GetFeed.xaml.cs.

Constructor & Destructor Documentation

S1_GetAFeed ( ) [inline]

Definition at line 34 of file Scenario1_GetFeed.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void DisplayCurrentItem ( ) [inline, private]

Definition at line 138 of file Scenario1_GetFeed.xaml.cs.

        {
            SyndicationItem item = currentFeed.Items[currentItemIndex];

            // Display item number.
            IndexField.Text = String.Format(
                CultureInfo.InvariantCulture,
                "{0} of {1}",
                currentItemIndex + 1,
                currentFeed.Items.Count);

            // Display title.
            ItemTitleField.Text = item.Title != null ? item.Title.Text : "(no title)";

            // Display the main link.
            string link = string.Empty;
            if (item.Links.Count > 0)
            {
                link = item.Links[0].Uri.AbsoluteUri;
            }
            LinkField.Content = link;

            // Display item extensions.
            ExtensionsField.ItemsSource = item.ElementExtensions;

            // Display the body as HTML.
            string content = "(no content)";
            if (item.Content != null)
            {
                content = item.Content.Text;
            }
            else if (item.Summary != null)
            {
                content = item.Summary.Text;
            }
            ContentWebView.NavigateToString(content);
        }

void DisplayFeed ( ) [inline, private]

Definition at line 105 of file Scenario1_GetFeed.xaml.cs.

        {
            ISyndicationText title = currentFeed.Title;
            FeedTitleField.Text = title != null ? title.Text : "(no title)";

            currentItemIndex = 0;
            if (currentFeed.Items.Count > 0)
            {
                DisplayCurrentItem();
            }

            // List the items.
            OutputField.Text += "Items: " + currentFeed.Items.Count + "\r\n";
        }

async void GetFeed_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 48 of file Scenario1_GetFeed.xaml.cs.

        {
            OutputField.Text = "";

            // By default 'FeedUri' is disabled and URI validation is not required. When enabling the text box
            // validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Home or Work Networking" capability.
            Uri uri;
            if (!Uri.TryCreate(FeedUri.Text.Trim(), UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Error: Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            SyndicationClient client = new SyndicationClient();
            client.BypassCacheOnRetrieve = true;

            // Although most HTTP servers do not require User-Agent header, others will reject the request or return
            // a different response if this header is missing. Use SetRequestHeader() to add custom headers.
            client.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)");

            rootPage.NotifyUser("Downloading feed...", NotifyType.StatusMessage);
            OutputField.Text = "Downloading feed: " + uri.ToString() + "\r\n";

            try
            {
                currentFeed = await client.RetrieveFeedAsync(uri);
                rootPage.NotifyUser("Feed download complete.", NotifyType.StatusMessage);

                DisplayFeed();
            }
            catch (Exception ex)
            {
                SyndicationErrorStatus status = SyndicationError.GetStatus(ex.HResult);
                if (status == SyndicationErrorStatus.InvalidXml)
                {
                    OutputField.Text += "An invalid XML exception was thrown. " +
                        "Please make sure to use a URI that points to a RSS or Atom feed.";
                }

                if (status == SyndicationErrorStatus.Unknown)
                {
                    WebErrorStatus webError = WebError.GetStatus(ex.HResult);

                    if (webError == WebErrorStatus.Unknown)
                    {
                        // Neither a syndication nor a web error. Rethrow.
                        throw;
                    }
                }

                rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
            }
        }

async void LinkField_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 176 of file Scenario1_GetFeed.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri((sender as HyperlinkButton).Content.ToString()));
        }

void NextItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 129 of file Scenario1_GetFeed.xaml.cs.

        {
            if (currentFeed != null && currentItemIndex < (currentFeed.Items.Count - 1))
            {
                currentItemIndex++;
                DisplayCurrentItem();
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 44 of file Scenario1_GetFeed.xaml.cs.

        {
        }

void PreviousItem_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 120 of file Scenario1_GetFeed.xaml.cs.

        {
            if (currentFeed != null && currentItemIndex > 0)
            {
                currentItemIndex--;
                DisplayCurrentItem();
            }
        }

Member Data Documentation

SyndicationFeed currentFeed = null [private]

Definition at line 31 of file Scenario1_GetFeed.xaml.cs.

int currentItemIndex [private]

Definition at line 32 of file Scenario1_GetFeed.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 30 of file Scenario1_GetFeed.xaml.cs.

The documentation for this class was generated from the following file:
  • Syndication/cs/Scenario1_GetFeed.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TangentVertex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

TangentVertex Struct Reference

#include "BasicShapes.h"

List of all members.

Public Attributes

float3 pos
float2 tex
float3 uTan
float3 vTan

Detailed Description

Definition at line 21 of file BasicShapes.h.

Member Data Documentation

float3 pos

Definition at line 23 of file BasicShapes.h.

float2 tex

Definition at line 24 of file BasicShapes.h.

float3 uTan

Definition at line 25 of file BasicShapes.h.

float3 vTan

Definition at line 26 of file BasicShapes.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicShapes.h
  • Simple3DGameDX/cppwinrt/Common/BasicShapes.h
  • Simple3DGameXaml/cpp/Common/BasicShapes.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TargetTexture Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes

TargetTexture Class Reference

#include "TargetTexture.h"

List of all members.

Public Member Functions

TargetTexture (_In_ winrt::com_ptr< ID3D11Device3 > d3dDevice, _In_ ID2D1Factory1 *d2dFactory, _In_ IDWriteFactory1 *dwriteFactory, _In_ ID2D1DeviceContext *d2dContext)
void | CreateHitTextureResourceView (_In_ winrt::hstring const &name, _Out_ ID3D11ShaderResourceView **textureResourceView)
void | CreateTextureResourceView (_In_ winrt::hstring const &name, _Out_ ID3D11ShaderResourceView **textureResourceView)

Private Attributes

winrt::com_ptr
< ID2D1SolidColorBrush > 		m_blackBrush
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_blueBrush
winrt::com_ptr
< ID2D1EllipseGeometry > 		m_circleGeometry1
winrt::com_ptr
< ID2D1EllipseGeometry > 		m_circleGeometry2
winrt::com_ptr
< ID2D1EllipseGeometry > 		m_circleGeometry3
winrt::com_ptr
< ID2D1EllipseGeometry > 		m_circleGeometry4
winrt::com_ptr
< ID2D1EllipseGeometry > 		m_circleGeometry5
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_clearBrush
winrt::com_ptr
< ID2D1DeviceContext > 		m_d2dContext
winrt::com_ptr< ID2D1Factory1 > | m_d2dFactory
winrt::com_ptr< ID3D11Device1 > | m_d3dDevice
winrt::com_ptr< IDWriteFactory1 > | m_dwriteFactory
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_greenBrush
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_redBrush
winrt::com_ptr< IDWriteTextFormat > | m_textFormat
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_whiteBrush
winrt::com_ptr
< ID2D1SolidColorBrush > 		m_yellowBrush

Detailed Description

Definition at line 21 of file TargetTexture.h.

Constructor & Destructor Documentation

TargetTexture | ( | _In_ winrt::com_ptr< ID3D11Device3 > | d3dDevice,
 |  | _In_ ID2D1Factory1 * | d2dFactory,
 |  | _In_ IDWriteFactory1 * | dwriteFactory,
 |  | _In_ ID2D1DeviceContext * | d2dContext
 | ) |  |

Definition at line 15 of file TargetTexture.cpp.

      :
    m_d3dDevice(std::move(d3dDevice))
{
    m_d2dFactory.copy_from(d2dFactory);
    m_dwriteFactory.copy_from(dwriteFactory);
    m_d2dContext.copy_from(d2dContext);

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Red, 1.f),
            m_redBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::CornflowerBlue, 1.0f),
            m_blueBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Green, 1.f),
            m_greenBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White, 1.f),
            m_whiteBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Black, 1.f),
            m_blackBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::Yellow, 1.f),
            m_yellowBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dContext->CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::White, 0.0f),
            m_clearBrush.put()
            )
        );

    winrt::check_hresult(
        m_d2dFactory->CreateEllipseGeometry(
            D2D1::Ellipse(
                D2D1::Point2F(256.0f, 256.0f),
                50.0f,
                50.0f
                ),
            m_circleGeometry1.put()
            )
        );

    winrt::check_hresult(
        m_d2dFactory->CreateEllipseGeometry(
            D2D1::Ellipse(
                D2D1::Point2F(256.0f, 256.0f),
                100.0f,
                100.0f
                ),
            m_circleGeometry2.put()
            )
        );

    winrt::check_hresult(
        m_d2dFactory->CreateEllipseGeometry(
            D2D1::Ellipse(
                D2D1::Point2F(256.0f, 256.0f),
                150.0f,
                150.0f
                ),
            m_circleGeometry3.put()
            )
        );

    winrt::check_hresult(
        m_d2dFactory->CreateEllipseGeometry(
            D2D1::Ellipse(
                D2D1::Point2F(256.0f, 256.0f),
                200.0f,
                200.0f
                ),
            m_circleGeometry4.put()
            )
        );

    winrt::check_hresult(
        m_d2dFactory->CreateEllipseGeometry(
            D2D1::Ellipse(
                D2D1::Point2F(256.0f, 256.0f),
                250.0f,
                250.0f
                ),
            m_circleGeometry5.put()
            )
        );

    winrt::check_hresult(
        m_dwriteFactory->CreateTextFormat(
            L"Segoe UI",
            nullptr,
            DWRITE_FONT_WEIGHT_LIGHT,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            425,        // fontsize
            L"en-US",   // locale
            m_textFormat.put()
            )
        );

    // Center the text horizontally.
    winrt::check_hresult(
        m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER)
        );

    // Center the text vertically.
    winrt::check_hresult(
        m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER)
        );
}

Member Function Documentation

void CreateHitTextureResourceView | ( | _In_ winrt::hstring const & | name,
 |  | _Out_ ID3D11ShaderResourceView ** | textureResourceView
 | ) |  |

Definition at line 258 of file TargetTexture.cpp.

{
    // Allocate a offscreen D3D surface for D2D to render our 2D content into
    D3D11_TEXTURE2D_DESC texDesc;
    texDesc.ArraySize = 1;
    texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
    texDesc.CPUAccessFlags = 0;
    texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
    texDesc.Height = 512;
    texDesc.Width = 512;
    texDesc.MipLevels = 1;
    texDesc.MiscFlags = 0;
    texDesc.SampleDesc.Count = 1;
    texDesc.SampleDesc.Quality = 0;
    texDesc.Usage = D3D11_USAGE_DEFAULT;

    winrt::com_ptr<ID3D11Texture2D> offscreenTexture;
    winrt::check_hresult(
        m_d3dDevice->CreateTexture2D(&texDesc, nullptr, offscreenTexture.put())
        );

    // Convert the Direct2D texture into a Shader Resource View
    winrt::com_ptr<ID3D11ShaderResourceView> texture;
    winrt::check_hresult(
        m_d3dDevice->CreateShaderResourceView(offscreenTexture.get(), nullptr, texture.put())
        );
#if defined(_DEBUG)
    {
        char debugName[100];
        int l = sprintf_s(debugName, sizeof(debugName) / sizeof(debugName[0]), "Simple3DGame HitTarget %ls", name.c_str());
        winrt::check_hresult(
            texture->SetPrivateData(WKPDID_D3DDebugObjectName, l, debugName)
            );
    }
#endif

    winrt::com_ptr<IDXGISurface> dxgiSurface;
    dxgiSurface = offscreenTexture.as<IDXGISurface>();

    // Create a D2D render target which can draw into our offscreen D3D
    // surface. Given that we use a constant size for the texture, we
    // fix the DPI at 96.

    D2D1_BITMAP_PROPERTIES1 properties;
    properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
    properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
    properties.dpiX = 96;
    properties.dpiY = 96;
    properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
    properties.colorContext = nullptr;

    winrt::com_ptr<ID2D1Bitmap1> renderTarget;
    winrt::check_hresult(
        m_d2dContext->CreateBitmapFromDxgiSurface(
            dxgiSurface.get(),
            &properties,
            renderTarget.put()
            )
        );

    m_d2dContext->SetTarget(renderTarget.get());
    float saveDpiX;
    float saveDpiY;

    m_d2dContext->GetDpi(&saveDpiX, &saveDpiY);
    m_d2dContext->SetDpi(96.0f, 96.0f);

    m_d2dContext->BeginDraw();
    m_d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());

    D2D1_SIZE_F renderTargetSize = renderTarget->GetSize();

    m_d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
    m_d2dContext->FillGeometry(m_circleGeometry5.get(), m_yellowBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry4.get(), m_greenBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry3.get(), m_blueBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry2.get(), m_redBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry1.get(), m_whiteBrush.get());
    m_d2dContext->DrawText(
        name.c_str(),
        name.size(),
        m_textFormat.get(),
        D2D1::RectF(0, 0, renderTargetSize.width, renderTargetSize.height),
        m_blackBrush.get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = m_d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        winrt::check_hresult(hr);
    }

    m_d2dContext->SetTarget(nullptr);
    m_d2dContext->SetDpi(saveDpiX, saveDpiY);

    *textureResourceView = texture.detach();
}

void CreateTextureResourceView | ( | _In_ winrt::hstring const & | name,
 |  | _Out_ ID3D11ShaderResourceView ** | textureResourceView
 | ) |  |

Definition at line 155 of file TargetTexture.cpp.

{
    // Allocate a offscreen D3D surface for D2D to render our 2D content into
    D3D11_TEXTURE2D_DESC texDesc;
    texDesc.ArraySize = 1;
    texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
    texDesc.CPUAccessFlags = 0;
    texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
    texDesc.Height = 512;
    texDesc.Width = 512;
    texDesc.MipLevels = 1;
    texDesc.MiscFlags = 0;
    texDesc.SampleDesc.Count = 1;
    texDesc.SampleDesc.Quality = 0;
    texDesc.Usage = D3D11_USAGE_DEFAULT;

    winrt::com_ptr<ID3D11Texture2D> offscreenTexture;
    winrt::check_hresult(
        m_d3dDevice->CreateTexture2D(&texDesc, nullptr, offscreenTexture.put())
        );

    // Convert the Direct2D texture into a Shader Resource View
    winrt::com_ptr<ID3D11ShaderResourceView> texture;
    winrt::check_hresult(
        m_d3dDevice->CreateShaderResourceView(offscreenTexture.get(), nullptr, texture.put())
        );
#if defined(_DEBUG)
    {
        char debugName[100];
        int l = sprintf_s(debugName, sizeof(debugName) / sizeof(debugName[0]), "Simple3DGame Target %ls", name.c_str());
        winrt::check_hresult(
            texture->SetPrivateData(WKPDID_D3DDebugObjectName, l, debugName)
            );
    }
#endif

    winrt::com_ptr<IDXGISurface> dxgiSurface;
    dxgiSurface = offscreenTexture.as<IDXGISurface>();

    // Create a D2D render target which can draw into our offscreen D3D
    // surface. Given that we use a constant size for the texture, we
    // fix the DPI at 96.

    D2D1_BITMAP_PROPERTIES1 properties;
    properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
    properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
    properties.dpiX = 96;
    properties.dpiY = 96;
    properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
    properties.colorContext = nullptr;

    winrt::com_ptr<ID2D1Bitmap1> renderTarget;
    winrt::check_hresult(
        m_d2dContext->CreateBitmapFromDxgiSurface(
            dxgiSurface.get(),
            &properties,
            renderTarget.put()
            )
        );

    m_d2dContext->SetTarget(renderTarget.get());
    float saveDpiX;
    float saveDpiY;

    m_d2dContext->GetDpi(&saveDpiX, &saveDpiY);
    m_d2dContext->SetDpi(96.0f, 96.0f);

    m_d2dContext->BeginDraw();
    m_d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());

    D2D1_SIZE_F renderTargetSize = renderTarget->GetSize();

    m_d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::White));
    m_d2dContext->FillGeometry(m_circleGeometry5.get(), m_redBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry4.get(), m_blueBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry3.get(), m_greenBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry2.get(), m_yellowBrush.get());
    m_d2dContext->FillGeometry(m_circleGeometry1.get(), m_blackBrush.get());
    m_d2dContext->DrawText(
        name.c_str(),
        name.size(),
        m_textFormat.get(),
        D2D1::RectF(0, 0, renderTargetSize.width, renderTargetSize.height),
        m_whiteBrush.get()
        );

    // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
    // is lost. It will be handled during the next call to Present.
    HRESULT hr = m_d2dContext->EndDraw();
    if (hr != D2DERR_RECREATE_TARGET)
    {
        winrt::check_hresult(hr);
    }

    m_d2dContext->SetTarget(nullptr);
    m_d2dContext->SetDpi(saveDpiX, saveDpiY);

    *textureResourceView = texture.detach();
}

Member Data Documentation

winrt::com_ptr<ID2D1SolidColorBrush> m_blackBrush [private]

Definition at line 51 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_blueBrush [private]

Definition at line 48 of file TargetTexture.h.

winrt::com_ptr<ID2D1EllipseGeometry> m_circleGeometry1 [private]

Definition at line 55 of file TargetTexture.h.

winrt::com_ptr<ID2D1EllipseGeometry> m_circleGeometry2 [private]

Definition at line 56 of file TargetTexture.h.

winrt::com_ptr<ID2D1EllipseGeometry> m_circleGeometry3 [private]

Definition at line 57 of file TargetTexture.h.

winrt::com_ptr<ID2D1EllipseGeometry> m_circleGeometry4 [private]

Definition at line 58 of file TargetTexture.h.

winrt::com_ptr<ID2D1EllipseGeometry> m_circleGeometry5 [private]

Definition at line 59 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_clearBrush [private]

Definition at line 53 of file TargetTexture.h.

winrt::com_ptr<ID2D1DeviceContext> m_d2dContext [private]

Definition at line 44 of file TargetTexture.h.

winrt::com_ptr<ID2D1Factory1> m_d2dFactory [private]

Definition at line 43 of file TargetTexture.h.

winrt::com_ptr<ID3D11Device1> m_d3dDevice [private]

Definition at line 42 of file TargetTexture.h.

winrt::com_ptr<IDWriteFactory1> m_dwriteFactory [private]

Definition at line 45 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_greenBrush [private]

Definition at line 49 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_redBrush [private]

Definition at line 47 of file TargetTexture.h.

winrt::com_ptr<IDWriteTextFormat> m_textFormat [private]

Definition at line 61 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_whiteBrush [private]

Definition at line 50 of file TargetTexture.h.

winrt::com_ptr<ID2D1SolidColorBrush> m_yellowBrush [private]

Definition at line 52 of file TargetTexture.h.

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/TargetTexture.h
  • Simple3DGameDX/cppwinrt/GameContent/TargetTexture.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensorBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • ActivitySensorBackgroundTask
Public Member Functions | Private Member Functions

ActivitySensorBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Detailed Description

Definition at line 20 of file ActivitySensorBackgroundTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Handles background task cancellation.

Parameters:
sender | The background task instance being cancelled.
reason | The cancellation reason.

Definition at line 64 of file ActivitySensorBackgroundTask.cs.

        {
            var settings = ApplicationData.Current.LocalSettings;
            Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
            settings.Values["TaskStatus"] = reason.ToString() + " at " + DateTime.Now.ToString("u");
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 26 of file ActivitySensorBackgroundTask.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");

            // Associate a cancellation handler with the background task.
            // Even though this task isn't performing much work, it can still be cancelled.
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            // Read the activity reports
            ActivitySensorTriggerDetails triggerDetails = taskInstance.TriggerDetails as ActivitySensorTriggerDetails;
            var reports = triggerDetails.ReadReports();

            var settings = ApplicationData.Current.LocalSettings;
            settings.Values["ReportCount"] = reports.Count;
            if (reports.Count > 0)
            {
                var lastReading = reports[reports.Count - 1].Reading;
                settings.Values["LastActivity"] = lastReading.Activity.ToString();
                settings.Values["LastConfidence"] = lastReading.Confidence.ToString();
                settings.Values["LastTimestamp"] = lastReading.Timestamp.ToString("u");
            }
            else
            {
                settings.Values["LastActivity"] = "No data";
                settings.Values["LastConfidence"] = "No data";
                settings.Values["LastTimestamp"] = "No data";
            }

            settings.Values["TaskStatus"] = "Completed at " + DateTime.Now.ToString("u");

            // No deferral is held on taskInstance because we are returning immediately.
        }

The documentation for this class was generated from the following file:
  • ActivitySensor/cs/Tasks/ActivitySensorBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompletionGroupTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • CompletionGroupTask
Public Member Functions | Static Public Member Functions | Private Member Functions

CompletionGroupTask Class Reference

List of all members.

Public Member Functions

void | InvokeSimpleToast (int succeeded, int failed)
async void | Run (IBackgroundTaskInstance taskInstance)

Static Public Member Functions

static BackgroundDownloader | CreateBackgroundDownloader ()

Private Member Functions

bool | IsFailed (DownloadOperation download)
async Task | RetryDownloadsAsync (IEnumerable< DownloadOperation > downloadsToRetry)

Detailed Description

Definition at line 26 of file CompletionGroupTask.cs.

Member Function Documentation

BackgroundDownloader CreateBackgroundDownloader ( ) [inline, static]

Definition at line 128 of file CompletionGroupTask.cs.

        {
            BackgroundTransferCompletionGroup completionGroup = new BackgroundTransferCompletionGroup();

            BackgroundTaskBuilder builder = new BackgroundTaskBuilder();
            builder.TaskEntryPoint = "Tasks.CompletionGroupTask";
            builder.SetTrigger(completionGroup.Trigger);

            // The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
            // You do not need to unregister it explicitly.
            BackgroundTaskRegistration taskRegistration = builder.Register();

            BackgroundDownloader downloader = new BackgroundDownloader(completionGroup);

            return downloader;
        }

void InvokeSimpleToast | ( | int | succeeded,
 |  | int | failed |
 | ) |  |  | [inline]

Definition at line 110 of file CompletionGroupTask.cs.

        {
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText02);

            XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
            stringElements.Item(0).AppendChild(toastXml.CreateTextNode(String.Format(
                CultureInfo.InvariantCulture,
                "{0} downloads succeeded.",
                succeeded)));
            stringElements.Item(1).AppendChild(toastXml.CreateTextNode(String.Format(
                CultureInfo.InvariantCulture,
                "{0} downloads failed.",
                failed)));

            ToastNotification toast = new ToastNotification(toastXml);
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }

bool IsFailed ( DownloadOperation download ) [inline, private]

Definition at line 72 of file CompletionGroupTask.cs.

        {
            BackgroundTransferStatus status = download.Progress.Status;
            if (status == BackgroundTransferStatus.Error || status == BackgroundTransferStatus.Canceled)
            {
                return true;
            }

            ResponseInformation response = download.GetResponseInformation();
            if (response == null || response.StatusCode != 200)
            {
                return true;
            }

            return false;
        }

async Task RetryDownloadsAsync ( IEnumerable< DownloadOperation > downloadsToRetry ) [inline, private]

Definition at line 88 of file CompletionGroupTask.cs.

        {
            BackgroundDownloader downloader = CompletionGroupTask.CreateBackgroundDownloader();

            foreach (DownloadOperation downloadToRetry in downloadsToRetry)
            {
                // Retry with the same uri, but save to a different file name.
                string originalName = downloadToRetry.ResultFile.Name;
                string newName = originalName.Insert(originalName.LastIndexOf('.'), "_retried");
                await downloadToRetry.ResultFile.RenameAsync(newName, NameCollisionOption.ReplaceExisting);

                DownloadOperation download = downloader.CreateDownload(downloadToRetry.RequestedUri, downloadToRetry.ResultFile);

                // We do not await on background transfer asynchronous tasks, since await will only
                // finish after the entire transfer is complete, which may take a very long time.
                // The completion of these downloads will be handled by a future CompletionGroupTask instance.
                Task<DownloadOperation> startTask = download.StartAsync().AsTask();
            }

            downloader.CompletionGroup.Enable();
        }

async void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 32 of file CompletionGroupTask.cs.

        {
            // The background task awaits on an asynchronous task (RetryDownloadsAsync). Take a deferral
            // to delay the background task from closing prematurely while the asynchronous code is still running.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            BackgroundTransferCompletionGroupTriggerDetails details = taskInstance.TriggerDetails
                as BackgroundTransferCompletionGroupTriggerDetails;

            if (details == null)
            {
                // This task was not triggered by a completion group.
                deferral.Complete();
                return;
            }

            List<DownloadOperation> failedDownloads = new List<DownloadOperation>();
            int succeeded = 0;
            foreach (DownloadOperation download in details.Downloads)
            {
                if (IsFailed(download))
                {
                    failedDownloads.Add(download);
                }
                else
                {
                    succeeded++;
                }
            }

            InvokeSimpleToast(succeeded, failedDownloads.Count);

            if (failedDownloads.Count > 0)
            {
                await RetryDownloadsAsync(failedDownloads);
            }

            deferral.Complete();
        }

The documentation for this class was generated from the following files:
  • BackgroundTransfer/cs/Tasks/CompletionGroupTask.cs
  • BackgroundTransfer/cpp/Tasks/CompletionGroupTask.cpp
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdpBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • EdpBackgroundTask
Public Member Functions | Private Member Functions | Private Attributes

EdpBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

async void | DoBufferWork (IBackgroundTaskInstance taskInstance)
async void | DoFileWork (IBackgroundTaskInstance taskInstance)
void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
async void | ProtectedAccessResumed (object sender, ProtectedAccessResumedEventArgs args)
async void | ProtectedAccessSuspending (object sender, ProtectedAccessSuspendingEventArgs args)

Private Attributes

bool | m_areKeysDropped = true
volatile bool | m_cancelRequested = false
string | m_EnterpriseID = ""
string | m_fileProtStatus = ""
IBuffer | m_protectedBuffer = null
string | m_SecretMessage = "This is a secret message"
string | m_taskName = ""

Detailed Description

Definition at line 20 of file EdpBackgroundTask.cs.

Member Function Documentation

async void DoBufferWork ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 80 of file EdpBackgroundTask.cs.

        {
            string message = "Hello World!";
            string unprotectedMessage = "";
            string logFileName = "Bufferlog.txt";
            string logFileContent = "";

            StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            StorageFile logFile = await localFolder.CreateFileAsync(logFileName, CreationCollisionOption.OpenIfExists);

            IBuffer inputBuffer = CryptographicBuffer.ConvertStringToBinary(message, BinaryStringEncoding.Utf8);
            BufferProtectUnprotectResult procBuffer = await DataProtectionManager.ProtectAsync(inputBuffer, m_EnterpriseID);
            logFileContent += "\r\n" + DateTime.Now + ":" + "ProtStatus:" + procBuffer.ProtectionInfo.Status + "\n";
            logFileContent += "\r\n" + "Protected Buffer:" + CryptographicBuffer.EncodeToHexString(procBuffer.Buffer).Substring(0, 5);

            // If keys are dropped under lock, unprotectBuffer will fail so don't unprotectbuffer under lock
            if (!m_areKeysDropped)
            {
                BufferProtectUnprotectResult unBuffer = await DataProtectionManager.UnprotectAsync(procBuffer.Buffer);
                unprotectedMessage = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, procBuffer.Buffer);
                logFileContent += "\n Unprotected string:" + unprotectedMessage;
                if (message != unprotectedMessage)
                {
                    throw new Exception("Original string does not match with unprotectedMessage!");
                }
            }

            await FileIO.AppendTextAsync(logFile, logFileContent);

        }

async void DoFileWork ( IBackgroundTaskInstance taskInstance ) [inline, private]

Definition at line 112 of file EdpBackgroundTask.cs.

        {
            string textBody = "\nHello World";
            string fileName = "EdpSample.txt";
            string fileCopyName = "EdpSampleCopy.txt";
            string logFileName = "Filelog.txt";

            StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;

            StorageFile logFile = await localFolder.CreateFileAsync(logFileName, CreationCollisionOption.OpenIfExists);

            // Create a protected file allows the creation of new files even after keys are dropped so that application
            // can create and continue writing to files under lock

            var result = await FileProtectionManager.CreateProtectedAndOpenAsync(localFolder,
                                                                                fileName,
                                                                                m_EnterpriseID,
                                                                                CreationCollisionOption.ReplaceExisting
                                                                                );
            using (var stream = result.Stream)
            {
                m_fileProtStatus = result.ProtectionInfo.Status.ToString();

                // Write to File

                using (IOutputStream outputStream = result.Stream.GetOutputStreamAt(0))
                {
                    DataWriter writer = new DataWriter(outputStream);
                    for (int i = 0; i < 100; i++)
                    {
                        writer.WriteString(textBody);
                        await writer.StoreAsync();
                    }
                }
            }

            // Check and if Keys are not dropped, read and write to another file.
            // Read from a protected file and copy it to another one

            if (!m_areKeysDropped)
            {
                StorageFile edpFileSource = await localFolder.CreateFileAsync(fileName, CreationCollisionOption.OpenIfExists);
                StorageFile edpFileCopy = await localFolder.CreateFileAsync(fileCopyName, CreationCollisionOption.ReplaceExisting);
                string sourceContent = await FileIO.ReadTextAsync(edpFileSource);
                await FileIO.WriteTextAsync(edpFileCopy, sourceContent);
            }
            else
            {
                await FileIO.AppendTextAsync(logFile, "\r\n" + DateTime.Now + ":" + " keys are dropped. Skip reading");
            }
        }

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 216 of file EdpBackgroundTask.cs.

        {
            m_cancelRequested = true;
            Debug.WriteLine("EdpBackgroundTask " + sender.Task.Name + " Cancel Requested...");
        }

async void ProtectedAccessResumed | ( | object | sender,
 |  | ProtectedAccessResumedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 196 of file EdpBackgroundTask.cs.

        {
            // Keys are available so can read and write from a protected file

            m_areKeysDropped = false;

            BufferProtectUnprotectResult unBuffer = await DataProtectionManager.UnprotectAsync(m_protectedBuffer);
            m_SecretMessage = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8,
                                                                           m_protectedBuffer
                                                                           );
            string logFileContent = "\n Unprotected string:" + m_SecretMessage;

            var settings = ApplicationData.Current.LocalSettings;
            settings.Values[m_taskName] += "\nApp got DPL resumed event";
            StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            StorageFile logFile = await localFolder.CreateFileAsync("ResumeLog.txt",
                                                                       CreationCollisionOption.OpenIfExists);
            await FileIO.AppendTextAsync(logFile, "\r\n" + DateTime.Now + ":" + "Got DPL Protected resumed");
        }

async void ProtectedAccessSuspending | ( | object | sender,
 |  | ProtectedAccessSuspendingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 164 of file EdpBackgroundTask.cs.

        {
            string logFileContent = "";

            Windows.Foundation.Deferral deferal = args.GetDeferral();

            // Protect any sensitive data in Memory so that it cannot be accessed while the device is  locked
            // You should encrypt or destory any copies of sensitve data while device is going to a locked state.

            IBuffer inputBuffer = CryptographicBuffer.ConvertStringToBinary(m_SecretMessage,
                                                                            BinaryStringEncoding.Utf8);
            BufferProtectUnprotectResult procBuffer = await DataProtectionManager.ProtectAsync(inputBuffer, m_EnterpriseID);
            m_protectedBuffer = procBuffer.Buffer;

            deferal.Complete();

            m_areKeysDropped = true;

            var settings = ApplicationData.Current.LocalSettings;
            settings.Values[m_taskName] += "\nApp got DPL suspend event";

            StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;

            StorageFile logFile = await localFolder.CreateFileAsync("SuspendLog.txt",
                                           CreationCollisionOption.OpenIfExists);

            logFileContent += "\r\n" + DateTime.Now + ":" + "Got DPL Protected Suspended";
            logFileContent += "\r\n" + "Protection Status:" + procBuffer.ProtectionInfo.Status;

            await FileIO.AppendTextAsync(logFile, logFileContent);
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 30 of file EdpBackgroundTask.cs.

        {
            Debug.WriteLine("EdpBackgroundTask " + taskInstance.Task.Name + " starting...");

            m_taskName = taskInstance.Task.Name;

            var settings = ApplicationData.Current.LocalSettings;
            var key = taskInstance.Task.Name;

            // Get EnterpriseID

            m_EnterpriseID = settings.Values[key].ToString();
            settings.Values[key] = "";

            // Associate a cancellation handler with the background task.
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            ProtectionPolicyManager.ProtectedAccessSuspending += ProtectedAccessSuspending;
            ProtectionPolicyManager.ProtectedAccessResumed += ProtectedAccessResumed;

            // Do background task activity.
            uint Progress;
            for (Progress = 0; Progress <= 100; Progress += 10)
            {
                // If the cancellation handler indicated that the task was canceled, stop doing the task.
                if (m_cancelRequested)
                {
                    break;
                }

                DoBufferWork(taskInstance);
                DoFileWork(taskInstance);

                // Sleep for 10 seconds for testing purposes

                using (EventWaitHandle workEvent = new ManualResetEvent(false))
                {
                    workEvent.WaitOne(TimeSpan.FromSeconds(10));
                }
                // Indicate progress to foreground application.
                taskInstance.Progress = Progress;
            }

            settings.Values[key] += "\nWrote Protected File at: " +
                                       Windows.Storage.ApplicationData.Current.LocalFolder.Path;
            settings.Values[key] += "\nFile protection Status:" + m_fileProtStatus;

            Debug.WriteLine("EdpBackgroundTask " + taskInstance.Task.Name + ((Progress < 100) ? " Canceled" : " Completed"));
        }

Member Data Documentation

bool m_areKeysDropped = true [private]

Definition at line 24 of file EdpBackgroundTask.cs.

volatile bool m_cancelRequested = false [private]

Definition at line 22 of file EdpBackgroundTask.cs.

string m_EnterpriseID = "" [private]

Definition at line 26 of file EdpBackgroundTask.cs.

string m_fileProtStatus = "" [private]

Definition at line 25 of file EdpBackgroundTask.cs.

IBuffer m_protectedBuffer = null [private]

Definition at line 28 of file EdpBackgroundTask.cs.

string m_SecretMessage = "This is a secret message" [private]

Definition at line 27 of file EdpBackgroundTask.cs.

string m_taskName = "" [private]

Definition at line 23 of file EdpBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • EnterpriseDataProtection/cs/Tasks/EdpBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PedometerBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • PedometerBackgroundTask
Public Member Functions | Private Member Functions

PedometerBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Detailed Description

Definition at line 20 of file PedometerBackgroundTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Handles background task cancellation.

Parameters:
sender | The background task instance being cancelled.
reason | The cancellation reason.

Definition at line 80 of file PedometerBackgroundTask.cs.

        {
            var settings = ApplicationData.Current.LocalSettings;
            settings.Values["TaskStatus"] = reason.ToString() + " at " + DateTime.Now.ToString("u");
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 26 of file PedometerBackgroundTask.cs.

        {
            // Associate a cancellation handler with the background task.
            // Even though this task isn't performing much work, it can still be cancelled.
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            // Read the pedometer reports from the trigger
            SensorDataThresholdTriggerDetails triggerDetails = taskInstance.TriggerDetails as SensorDataThresholdTriggerDetails;
            // Ensure that this trigger is of Pedometer type
            if (SensorType.Pedometer == triggerDetails.SensorType)
            {
                var nThFromLast = 1;
                var reports = Pedometer.GetReadingsFromTriggerDetails(triggerDetails);
                var settings = ApplicationData.Current.LocalSettings;
                var lastReading = reports[reports.Count - nThFromLast];
                var knownTimestamp = lastReading.Timestamp;

                settings.Values["ReportCount"] = reports.Count.ToString();
                settings.Values["LastTimestamp"] = lastReading.Timestamp;

                // insert this step kind count
                settings.Values[lastReading.StepKind.ToString()] = lastReading.CumulativeSteps.ToString();

                // All reports that have the same timestamp correspond to step counts
                // of different step kinds supported by the sensor - Parse each one of
                // them and save in the application data
                while (nThFromLast < reports.Count)
                {
                    // get the next reading from the last
                    nThFromLast++;
                    lastReading = reports[reports.Count - nThFromLast];

                    if (knownTimestamp.UtcTicks == lastReading.Timestamp.UtcTicks)
                    {
                        // captured at the same time indicates that this step-kind data belongs to the same sample
                        // insert this step kind count
                        settings.Values[lastReading.StepKind.ToString()] = lastReading.CumulativeSteps.ToString();
                    }
                    else
                    {
                        break;
                    }
                }

                settings.Values["TaskStatus"] = "Completed at " + DateTime.Now.ToString("u");
            }
            // No deferral is held on taskInstance because we are returning immediately.
        }

The documentation for this class was generated from the following file:
  • Pedometer/cs/Tasks/PedometerBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensorBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • ProximitySensorBackgroundTask
Public Member Functions | Private Member Functions

ProximitySensorBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Detailed Description

Definition at line 20 of file ProximitySensorBackgroundTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Handles background task cancellation.

Parameters:
sender | The background task instance being cancelled.
reason | The cancellation reason.

Definition at line 58 of file ProximitySensorBackgroundTask.cs.

        {
            var settings = ApplicationData.Current.LocalSettings;
            Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
            settings.Values["TaskStatus"] = reason.ToString() + " at " + DateTime.Now.ToString("u");
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

The entry point of a background task.

Parameters:
taskInstance The current background task instance.

Definition at line 26 of file ProximitySensorBackgroundTask.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");

            // Associate a cancellation handler with the background task.
            // Even though this task isn't performing much work, it can still be canceled.
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            // Read the sensor readings from the trigger reports
            SensorDataThresholdTriggerDetails triggerDetails = taskInstance.TriggerDetails as SensorDataThresholdTriggerDetails;
            // Ensure the type of trigger we are dealing with is of type 'ProximitySensor'
            if (SensorType.ProximitySensor == triggerDetails.SensorType)
            {
                var reports = ProximitySensor.GetReadingsFromTriggerDetails(triggerDetails);
                var settings = ApplicationData.Current.LocalSettings;
                var lastReading = reports[reports.Count - 1];

                // cache appropriate details from this trigger in application data
                settings.Values["ReportCount"] = reports.Count.ToString();
                settings.Values["LastTimestamp"] = lastReading.Timestamp.ToString("u");
                settings.Values["Detected"] = lastReading.IsDetected.ToString();
                settings.Values["TaskStatus"] = "Completed at " + DateTime.Now.ToString("u");
            }

            // No deferral is held on taskInstance because we are returning immediately.
        }

The documentation for this class was generated from the following file:
  • ProximitySensor/cs/Tasks/ProximitySensorBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleBackgroundTask Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • SampleBackgroundTask
Public Member Functions | Private Member Functions | Private Attributes

SampleBackgroundTask Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
void | PeriodicTimerCallback (ThreadPoolTimer timer)

Private Attributes

BackgroundTaskCancellationReason | _cancelReason = BackgroundTaskCancellationReason.Abort
volatile bool | _cancelRequested = false
BackgroundTaskDeferral | _deferral = null
ThreadPoolTimer | _periodicTimer = null
uint | _progress = 0
IBackgroundTaskInstance | _taskInstance = null

Detailed Description

Definition at line 27 of file SampleBackgroundTask.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 69 of file SampleBackgroundTask.cs.

        {
            //
            // Indicate that the background task is canceled.
            //
            _cancelRequested = true;
            _cancelReason = reason;

            Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
        }

void PeriodicTimerCallback ( ThreadPoolTimer timer ) [inline, private]

Definition at line 83 of file SampleBackgroundTask.cs.

        {
            if ((_cancelRequested == false) && (_progress < 100))
            {
                _progress += 10;
                _taskInstance.Progress = _progress;
            }
            else
            {
                _periodicTimer.Cancel();

                var key = _taskInstance.Task.Name;

                //
                // Record that this background task ran.
                //
                String taskStatus = (_progress < 100) ? "Canceled with reason: " + _cancelReason.ToString() : "Completed";
                var settings = ApplicationData.Current.LocalSettings;
                settings.Values[key] = taskStatus;
                Debug.WriteLine("Background " + _taskInstance.Task.Name + settings.Values[key]);

                //
                // Indicate that the background task has completed.
                //
                _deferral.Complete();
            }
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 39 of file SampleBackgroundTask.cs.

        {
            Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");

            //
            // Query BackgroundWorkCost
            // Guidance: If BackgroundWorkCost is high, then perform only the minimum amount
            // of work in the background task and return immediately.
            //
            var cost = BackgroundWorkCost.CurrentBackgroundWorkCost;
            var settings = ApplicationData.Current.LocalSettings;
            settings.Values["BackgroundWorkCost"] = cost.ToString();

            //
            // Associate a cancellation handler with the background task.
            //
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            //
            // Get the deferral object from the task instance, and take a reference to the taskInstance;
            //
            _deferral = taskInstance.GetDeferral();
            _taskInstance = taskInstance;

            _periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(new TimerElapsedHandler(PeriodicTimerCallback), TimeSpan.FromSeconds(1));
        }

Member Data Documentation

BackgroundTaskCancellationReason _cancelReason = BackgroundTaskCancellationReason.Abort [private]

Definition at line 29 of file SampleBackgroundTask.cs.

volatile bool _cancelRequested = false [private]

Definition at line 30 of file SampleBackgroundTask.cs.

BackgroundTaskDeferral _deferral = null [private]

Definition at line 31 of file SampleBackgroundTask.cs.

ThreadPoolTimer _periodicTimer = null [private]

Definition at line 32 of file SampleBackgroundTask.cs.

uint _progress = 0 [private]

Definition at line 33 of file SampleBackgroundTask.cs.

IBackgroundTaskInstance _taskInstance = null [private]

Definition at line 34 of file SampleBackgroundTask.cs.

The documentation for this class was generated from the following file:
  • BackgroundTask/cs/Tasks/SampleBackgroundTask.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • sealed
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "ActivitySensorBackgroundTask.h"

List of all members.

Public Member Functions

ActivitySensorBackgroundTask ()
CompletionGroupTask ()
void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)
void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)
void | OnCanceled (IBackgroundTaskInstance^taskInstance, BackgroundTaskCancellationReason reason)
void | OnCanceled (IBackgroundTaskInstance^taskInstance, BackgroundTaskCancellationReason reason)
void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)
PedometerBackgroundTask ()
ProximitySensorBackgroundTask ()
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)
virtual void | Run (IBackgroundTaskInstance^taskInstance)
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)
virtual void | Run (IBackgroundTaskInstance^taskInstance)
virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)
ServicingComplete ()

Static Public Member Functions

static
Windows::Networking::BackgroundTransfer::BackgroundDownloader 		CreateBackgroundDownloader ()
static
Windows::Networking::BackgroundTransfer::BackgroundTransferGroup 		CreateTransferGroup ()

Private Member Functions

~ActivitySensorBackgroundTask ()
~PedometerBackgroundTask ()
~ProximitySensorBackgroundTask ()
~ServicingComplete ()
void | InvokeSimpleToast (int succeeded, int failed)
bool | IsFailed (Windows::Networking::BackgroundTransfer::DownloadOperation^download)
Concurrency::task< void > | RetryDownloadsAsync (Windows::Foundation::Collections::IVector< Windows::Networking::BackgroundTransfer::DownloadOperation^>^downloads)

Private Attributes

Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort
volatile bool | CancelRequested = false
Windows::System::Threading::ThreadPoolTimer | PeriodicTimer = nullptr
unsigned int | Progress = 0
Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral > 		TaskDeferral = nullptr
Windows::ApplicationModel::Background::IBackgroundTaskInstance | TaskInstance = nullptr
IBackgroundTaskInstance | TaskInstance

Detailed Description

Definition at line 26 of file ActivitySensorBackgroundTask.h.

Constructor & Destructor Documentation

~ActivitySensorBackgroundTask ( ) [inline, private]

Definition at line 36 of file ActivitySensorBackgroundTask.h.

{}

~ServicingComplete ( ) [private]
~PedometerBackgroundTask ( ) [inline, private]

Definition at line 32 of file PedometerBackgroundTask.h.

{}

~ProximitySensorBackgroundTask ( ) [inline, private]

Definition at line 30 of file ProximitySensorBackgroundTask.h.

{}

Member Function Documentation

ActivitySensorBackgroundTask ( ) [inline]

Definition at line 30 of file ActivitySensorBackgroundTask.h.

{}

CompletionGroupTask ( )
static Windows::Networking::BackgroundTransfer::BackgroundDownloader CreateBackgroundDownloader ( ) [static]
static Windows::Networking::BackgroundTransfer::BackgroundTransferGroup CreateTransferGroup ( ) [static]
void InvokeSimpleToast | ( | int | succeeded,
 |  | int | failed |
 | ) |  |  | [private]
bool IsFailed ( Windows::Networking::BackgroundTransfer::DownloadOperation^ download ) [private]
void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | taskInstance,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | reason
 | ) |  |
void OnCanceled | ( | IBackgroundTaskInstance^ | taskInstance,
 |  | BackgroundTaskCancellationReason | reason
 | ) |  |
void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | taskInstance,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | reason
 | ) |  |
void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | taskInstance,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | reason
 | ) |  |
void OnCanceled | ( | IBackgroundTaskInstance^ | taskInstance,
 |  | BackgroundTaskCancellationReason | reason
 | ) |  |
PedometerBackgroundTask ( ) [inline]

Definition at line 26 of file PedometerBackgroundTask.h.

{}

ProximitySensorBackgroundTask ( )
Concurrency::task<void> RetryDownloadsAsync ( Windows::Foundation::Collections::IVector< Windows::Networking::BackgroundTransfer::DownloadOperation^>^ downloads ) [private]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
virtual void Run ( IBackgroundTaskInstance^ taskInstance ) [virtual]
virtual void Run ( IBackgroundTaskInstance^ taskInstance ) [virtual]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
ServicingComplete ( )

Member Data Documentation

Windows::ApplicationModel::Background::BackgroundTaskCancellationReason CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort [private]

Definition at line 24 of file SampleBackgroundTask.h.

volatile bool CancelRequested = false [private]

Definition at line 25 of file SampleBackgroundTask.h.

Windows::System::Threading::ThreadPoolTimer PeriodicTimer = nullptr [private]

Definition at line 27 of file SampleBackgroundTask.h.

unsigned int Progress = 0 [private]

Definition at line 28 of file SampleBackgroundTask.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral> TaskDeferral = nullptr [private]

Definition at line 26 of file SampleBackgroundTask.h.

Windows::ApplicationModel::Background::IBackgroundTaskInstance TaskInstance = nullptr [private]

Definition at line 29 of file SampleBackgroundTask.h.

Windows::ApplicationModel::Background::IBackgroundTaskInstance TaskInstance [private]

Definition at line 38 of file ActivitySensorBackgroundTask.h.

The documentation for this class was generated from the following files:
  • ActivitySensor/cpp/Tasks/ActivitySensorBackgroundTask.h
  • BackgroundTask/cpp/Tasks/SampleBackgroundTask.h
  • BackgroundTask/cpp/Tasks/ServicingComplete.h
  • Pedometer/cpp/Tasks/PedometerBackgroundTask.h
  • ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.h
  • BackgroundTransfer/cpp/Tasks/CompletionGroupTask.h
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ServicingComplete Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Tasks
  • ServicingComplete
Public Member Functions | Private Member Functions | Private Attributes

ServicingComplete Class Reference

List of all members.

Public Member Functions

void | Run (IBackgroundTaskInstance taskInstance)

Private Member Functions

void | OnCanceled (IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

Private Attributes

volatile bool | _cancelRequested = false

Detailed Description

Definition at line 24 of file ServicingComplete.cs.

Member Function Documentation

void OnCanceled | ( | IBackgroundTaskInstance | sender,
 |  | BackgroundTaskCancellationReason | reason |
 | ) |  |  | [inline, private]

Definition at line 73 of file ServicingComplete.cs.

        {
            //
            // Indicate that the background task is canceled.
            //
            _cancelRequested = true;

            Debug.WriteLine("ServicingComplete " + sender.Task.Name + " Cancel Requested...");
        }

void Run ( IBackgroundTaskInstance taskInstance ) [inline]

Definition at line 31 of file ServicingComplete.cs.

        {
            Debug.WriteLine("ServicingComplete " + taskInstance.Task.Name + " starting...");

            //
            // Associate a cancellation handler with the background task.
            //
            taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);

            //
            // Do background task activity for servicing complete.
            //
            uint Progress;
            for (Progress = 0; Progress <= 100; Progress += 10)
            {
                //
                // If the cancellation handler indicated that the task was canceled, stop doing the task.
                //
                if (_cancelRequested)
                {
                    break;
                }

                //
                // Indicate progress to foreground application.
                //
                taskInstance.Progress = Progress;
            }

            var settings = ApplicationData.Current.LocalSettings;
            var key = taskInstance.Task.Name;

            //
            // Write to LocalSettings to indicate that this background task ran.
            //
            settings.Values[key] = (Progress < 100) ? "Canceled" : "Completed";
            Debug.WriteLine("ServicingComplete " + taskInstance.Task.Name + ((Progress < 100) ? " Canceled" : " Completed"));
        }

Member Data Documentation

volatile bool _cancelRequested = false [private]

Definition at line 26 of file ServicingComplete.cs.

The documentation for this class was generated from the following file:
  • BackgroundTask/cs/Tasks/ServicingComplete.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Conversion Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • TextSuggestion
  • Scenario1_Conversion
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario1_Conversion Class Reference

List of all members.

Public Member Functions

Scenario1_Conversion ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CreateGeneratorButton_Click (object sender, RoutedEventArgs e)
async void | Execute_Click (object sender, RoutedEventArgs e)
void | Methods_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

TextConversionGenerator | generator
MainPage rootPage

Detailed Description

Definition at line 12 of file Scenario1_Conversion.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Conversion ( ) [inline]

Page initializer.

Definition at line 20 of file Scenario1_Conversion.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CreateGeneratorButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Create Generator' button.

When this button is activated, the Text Suggestion API will try to resolve the language tag provided by the user, and create a Conversion Generator.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 128 of file Scenario1_Conversion.xaml.cs.

        {
            // Try to parse the language and create generator accordingly.
            generator = new TextConversionGenerator(langTag.Text);

            // Only allow generator operation when the language is available and installed.
            if (generator == null)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Failed to instantiate a generator."), NotifyType.ErrorMessage);
            }
            else if (generator.ResolvedLanguage == "und")
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Unsupported language."), NotifyType.ErrorMessage);
            }
            else if (generator.LanguageAvailableButNotInstalled)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Language available but not installed."), NotifyType.ErrorMessage);
            }
            else
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Visible;
                }

                rootPage.NotifyUser(string.Format("Successfully instantiated a generator."), NotifyType.StatusMessage);
            }
        }

async void Execute_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Execute' button.

When this button is activated, the text suggestion generator will get the conversion result for given input string and language tag, then print them in result column. Using 'async' keyword to indicate that this method runs asynchronously and contains one 'await' expression.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 47 of file Scenario1_Conversion.xaml.cs.

        {
            // Clean up result column.
            resultView.ItemsSource = null;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);

            var input = Input.Text;

            ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;

            if ((generator != null) && (selectedItem != null) && !String.IsNullOrEmpty(input))
            {
                // Specify the candidate number to get.
                if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("needMaxCount"))
                {
                    uint MaxCandidates = 0;
                    UInt32.TryParse(maxCandidates.Text, out MaxCandidates);

                    if (MaxCandidates != 0)
                    {
                        // Call the API with max candidate number we expect, and list the result when there are any candidates.
                        // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
                        resultView.ItemsSource = await generator.GetCandidatesAsync(input, MaxCandidates);

                        if (resultView.Items.Count == 0)
                        {
                            rootPage.NotifyUser(string.Format("No candidates."), NotifyType.StatusMessage);
                        }
                    }
                    else
                    {
                        rootPage.NotifyUser(string.Format("Not a valid candidate number. Expecting positive integer."), NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    // Call the API with default candidate number, and list the result when there are any candidates.
                    resultView.ItemsSource = await generator.GetCandidatesAsync(input);

                    if (resultView.Items.Count == 0)
                    {
                        rootPage.NotifyUser(string.Format("No candidates."), NotifyType.StatusMessage);
                    }
                }
            }
        }

void Methods_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Selecting the API interface to use.

User can either specify the max candidate number to get, or use the default value.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 102 of file Scenario1_Conversion.xaml.cs.

        {
            ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;

            if (maxCandidatesArea != null)
            {
                // Only show the candidate number input control when user chooses to specify the number.
                if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("needMaxCount"))
                {
                    maxCandidatesArea.Visibility = Visibility.Visible;
                }
                else
                {
                    maxCandidatesArea.Visibility = Visibility.Collapsed;
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Clean up the notification area when user navigate to prediction page.

Parameters:
e Event data that describes the click action on the button.

Definition at line 29 of file Scenario1_Conversion.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }

Member Data Documentation

TextConversionGenerator generator [private]

Definition at line 15 of file Scenario1_Conversion.xaml.cs.

MainPage rootPage [private]

Definition at line 14 of file Scenario1_Conversion.xaml.cs.

The documentation for this class was generated from the following file:
  • TextSuggestion/cs/Scenario1_Conversion.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Prediction Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • TextSuggestion
  • Scenario2_Prediction
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario2_Prediction Class Reference

List of all members.

Public Member Functions

Scenario2_Prediction ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CreateGeneratorButton_Click (object sender, RoutedEventArgs e)
async void | Execute_Click (object sender, RoutedEventArgs e)
void | Methods_SelectionChanged (object sender, SelectionChangedEventArgs e)

Private Attributes

TextPredictionGenerator | generator
MainPage rootPage

Detailed Description

Definition at line 12 of file Scenario2_Prediction.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Prediction ( ) [inline]

Page initializer.

Definition at line 20 of file Scenario2_Prediction.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CreateGeneratorButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Create Generator' button.

When this button is activated, the Text Suggestion API will try to resolve the language tag provided by the user, and create a Prediction Generator.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 128 of file Scenario2_Prediction.xaml.cs.

        {
            // Try to parse the language and create generator accordingly.
            generator = new TextPredictionGenerator(langTag.Text);

            // Only allow generator operation when the language is available and installed.
            if (generator == null)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Failed to instantiate a generator."), NotifyType.ErrorMessage);
            }
            else if (generator.ResolvedLanguage == "und")
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Unsupported language."), NotifyType.ErrorMessage);
            }
            else if (generator.LanguageAvailableButNotInstalled)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Language available but not installed."), NotifyType.ErrorMessage);
            }
            else
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Visible;
                }

                rootPage.NotifyUser(string.Format("Successfully instantiated a generator."), NotifyType.StatusMessage);
            }
        }

async void Execute_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Execute' button.

When this button is activated, the text suggestion generator will get the prediction result for given input string and language tag, then print them in result column. Using 'async' keyword to indicate that this method runs asynchronously and contains one 'await' expression.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 47 of file Scenario2_Prediction.xaml.cs.

        {
            // Clean up result column.
            resultView.ItemsSource = null;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);

            var input = Input.Text;

            ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;

            if ((generator != null) && (selectedItem != null) && !String.IsNullOrEmpty(input))
            {
                // Specifiy the candidate number to get.
                if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("needMaxCount"))
                {
                    uint MaxCandidates = 0;
                    UInt32.TryParse(maxCandidates.Text, out MaxCandidates);

                    if (MaxCandidates != 0)
                    {
                        // Call the API with max candidate number user expect, and list the result when there are any candidates.
                        // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
                        resultView.ItemsSource = await generator.GetCandidatesAsync(input, MaxCandidates);

                        if (resultView.Items.Count == 0)
                        {
                            rootPage.NotifyUser(string.Format("No candidates."), NotifyType.StatusMessage);
                        }
                    }
                    else
                    {
                        rootPage.NotifyUser(string.Format("Not a valid candidate number. Expecting positive integer."), NotifyType.ErrorMessage);
                    }
                }
                else
                {
                    // Call the API with default candidate number, and list the result when there are any candidates.
                    resultView.ItemsSource = await generator.GetCandidatesAsync(input);

                    if (resultView.Items.Count == 0)
                    {
                        rootPage.NotifyUser(string.Format("No candidates."), NotifyType.StatusMessage);
                    }
                }
            }
        }

void Methods_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Selecting the API interface to use.

User can either specify the max candidate number to get, or use the default value.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 102 of file Scenario2_Prediction.xaml.cs.

        {
            ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;

            if (maxCandidatesArea != null)
            {
                // Only show the candidate number input control when user chooses to specify the number.
                if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("needMaxCount"))
                {
                    maxCandidatesArea.Visibility = Visibility.Visible;
                }
                else
                {
                    maxCandidatesArea.Visibility = Visibility.Collapsed;
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Clean up the notification area when user navigate to prediction page.

Parameters:
e Event data that describes the click action on the button.

Definition at line 29 of file Scenario2_Prediction.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }

Member Data Documentation

TextPredictionGenerator generator [private]

Definition at line 15 of file Scenario2_Prediction.xaml.cs.

MainPage rootPage [private]

Definition at line 14 of file Scenario2_Prediction.xaml.cs.

The documentation for this class was generated from the following file:
  • TextSuggestion/cs/Scenario2_Prediction.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ReverseConversion Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • TextSuggestion
  • Scenario3_ReverseConversion
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

Scenario3_ReverseConversion Class Reference

List of all members.

Public Member Functions

Scenario3_ReverseConversion ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | CreateGeneratorButton_Click (object sender, RoutedEventArgs e)
async void | Execute_Click (object sender, RoutedEventArgs e)

Private Attributes

TextReverseConversionGenerator | generator
MainPage rootPage

Detailed Description

Definition at line 13 of file Scenario3_ReverseConversion.xaml.cs.

Constructor & Destructor Documentation

Scenario3_ReverseConversion ( ) [inline]

Page initializer.

Definition at line 21 of file Scenario3_ReverseConversion.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void CreateGeneratorButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Create Generator' button.

When this button is activated, the Text Suggestion API will try to resolve the language tag provided by the user, and create a Reverse Conversion Generator.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 102 of file Scenario3_ReverseConversion.xaml.cs.

        {
            // Try to parse the language and create generator accordingly.
            generator = new TextReverseConversionGenerator(langTag.Text);

            // Only allow generator operation when the language is available and installed.
            if (generator == null)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Failed to instantiate a generator."), NotifyType.ErrorMessage);
            }
            else if (generator.ResolvedLanguage == "und")
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Unsupported language."), NotifyType.ErrorMessage);
            }
            else if (generator.LanguageAvailableButNotInstalled)
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Collapsed;
                }

                rootPage.NotifyUser(string.Format("Language available but not installed."), NotifyType.ErrorMessage);
            }
            else
            {
                if (GeneratorOperationArea != null)
                {
                    GeneratorOperationArea.Visibility = Visibility.Visible;
                }

                rootPage.NotifyUser(string.Format("Successfully instantiated a generator."), NotifyType.StatusMessage);
            }
        }

async void Execute_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Execute' button.

When this button is activated, the text suggestion generator will get the reverse conversion result for given input string and language tag, then print them in result column. Using 'async' keyword to indicate that this method runs asynchronously and contains one 'await' expression.

Parameters:
sender | The object that raised the event.
e | Event data that describes the click action on the button.

Definition at line 48 of file Scenario3_ReverseConversion.xaml.cs.

        {
            // Clean up result column.
            resultView.ItemsSource = null;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);

            var input = Input.Text;

            ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;

            if ((generator != null) && (selectedItem != null) && (!String.IsNullOrEmpty(input)))
            {
                if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("segmented"))
                {
                    // Get the reverse conversion result per phoneme through calling the API and print it in result area.
                    // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
                    IReadOnlyList<TextPhoneme> phonemes = await generator.GetPhonemesAsync(input);
                    List<string> results = new List<string>();
                    foreach (TextPhoneme phoneme in phonemes)
                    {
                        results.Add(string.Format("{0} -> {1}", phoneme.DisplayText, phoneme.ReadingText));
                    }
                    resultView.ItemsSource = results;

                    if (phonemes.Count == 0)
                    {
                        rootPage.NotifyUser(string.Format("No results"), NotifyType.StatusMessage);
                    }
                }
                else
                {
                    // Get the reverse conversion result through calling the API and print it in result area.
                    // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
                    string result = await generator.ConvertBackAsync(input);
                    resultView.ItemsSource = new List<string> { result };

                    if (result.Length == 0)
                    {
                        rootPage.NotifyUser(string.Format("No results"), NotifyType.StatusMessage);
                    }
                }
            }
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Clean up the notification area when user navigate to prediction page.

Parameters:
e Event data that describes the click action on the button.

Definition at line 30 of file Scenario3_ReverseConversion.xaml.cs.

        {
            rootPage = MainPage.Current;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }

Member Data Documentation

TextReverseConversionGenerator generator [private]

Definition at line 16 of file Scenario3_ReverseConversion.xaml.cs.

MainPage rootPage [private]

Definition at line 15 of file Scenario3_ReverseConversion.xaml.cs.

The documentation for this class was generated from the following file:
  • TextSuggestion/cs/Scenario3_ReverseConversion.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TlvEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Properties

TlvEntry Class Reference

List of all members.

Public Member Functions

TlvEntry (ushort tag, object value)
byte[] | GetData (ushort?statusWord=null)

Properties

int | Length [get]
ushort | Tag [get, set]
byte | TagLength [get]
object | Value [get, set]
int | ValueLength [get]

Detailed Description

Definition at line 17 of file TlvEntry.cs.

Constructor & Destructor Documentation

TlvEntry | ( | ushort | tag,
 |  | object | value |
 | ) |  |  | [inline]

Definition at line 19 of file TlvEntry.cs.

    {
        Tag = tag;
        Value = value;
    }

Member Function Documentation

byte [] GetData ( ushort? statusWord = null ) [inline]

Definition at line 95 of file TlvEntry.cs.

    {
        int i = 0;
        var ret = new byte[this.Length + (statusWord == null ? 0 : 2)];

        if (TagLength == 2)
        {
            ret[i++] = (byte)((Tag & 0xFF00) >> 8);
            ret[i++] = (byte)(Tag & 0xFF);
        }
        else
        {
            ret[i++] = (byte)Tag;
        }

        if (ValueLength > 0x7F)
        {
            if (ValueLength > 0xFF)
            {
                throw new NotImplementedException();
            }
            ret[i++] = 0x81;
        }
        ret[i++] = (byte)ValueLength;

        if (Value is string)
        {
            Value = System.Text.UTF8Encoding.UTF8.GetBytes((string)Value);
        }
        else if (Value is IBuffer)
        {
            Value = ((IBuffer)Value).ToArray();
        }

        if (Value is byte[])
        {
            Array.Copy((byte[])Value, 0, ret, i, ((byte[])Value).Length);
            i += ((byte[])Value).Length;
        }
        else if (Value is TlvEntry)
        {
            Array.Copy(((TlvEntry)Value).GetData(), 0, ret, i, ((TlvEntry)Value).Length);
            i += ((TlvEntry)Value).Length;
        }
        else if (Value is TlvEntry[])
        {
            foreach (var entry in (TlvEntry[])Value)
            {
                Array.Copy(entry.GetData(), 0, ret, i, entry.Length);
                i += entry.Length;
            }
        }
        else
        {
            throw new InvalidOperationException();
        }

        if (statusWord != null)
        {
            ret[i++] = (byte)((statusWord & 0xFF00) >> 8);
            ret[i++] = (byte)(statusWord & 0xFF);
        }
        return ret;
    }

Property Documentation

int Length [get, private]

Definition at line 86 of file TlvEntry.cs.

ushort Tag [get, set, private]

Definition at line 26 of file TlvEntry.cs.

byte TagLength [get, private]

Definition at line 32 of file TlvEntry.cs.

object Value [get, set, private]

Definition at line 47 of file TlvEntry.cs.

int ValueLength [get, private]

Definition at line 53 of file TlvEntry.cs.

The documentation for this class was generated from the following file:
  • Nfc/Nfc/TlvEntry.cs
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • App
Public Member Functions | Protected Member Functions | Private Member Functions

App Class Reference

Provides application-specific behavior to supplement the default Application class.

List of all members.

Public Member Functions

App ()

Protected Member Functions

override void | OnLaunched (LaunchActivatedEventArgs e)

Private Member Functions

void | OnNavigationFailed (object sender, NavigationFailedEventArgs e)
void | OnSuspending (object sender, SuspendingEventArgs e)

Detailed Description

Definition at line 25 of file App.xaml.cs.

Constructor & Destructor Documentation

App ( ) [inline]

Initializes the singleton application object.

This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain().

Definition at line 31 of file App.xaml.cs.

        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

Member Function Documentation

override void OnLaunched ( LaunchActivatedEventArgs e ) [inline, protected]

Invoked when the application is launched normally by the end user.

Other entry points will be used such as when the application is launched to open a specific file.

Parameters:
e Details about the launch request and process.

Definition at line 42 of file App.xaml.cs.

        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Add background to our Frame for navigation transitions
                rootFrame.Background = (Brush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }

void OnNavigationFailed | ( | object | sender,
 |  | NavigationFailedEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when Navigation to a certain page fails.

Parameters:
sender | The Frame which failed navigation
e | Details about the navigation failure

Definition at line 83 of file App.xaml.cs.

        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

void OnSuspending | ( | object | sender,
 |  | SuspendingEventArgs | e |
 | ) |  |  | [inline, private]

Invoked when application execution is being suspended.

Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.

Parameters:
sender | The source of the suspend request.
e | Details about the suspend request.

Definition at line 95 of file App.xaml.cs.

        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/App.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ArticlePage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • ArticlePage
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes

ArticlePage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

ArticlePage ()

Protected Member Functions

override void | OnNavigatedFrom (NavigationEventArgs e)
override void | OnNavigatedTo (NavigationEventArgs e)

Properties

ArticleViewModel | Article [get, set]
static DependencyProperty | ArticleProperty [get]

Private Member Functions

void | ArticlePage_BackRequested (object sender, BackRequestedEventArgs e)
void | BackButton_Click (object sender, RoutedEventArgs e)
void | LoadTimer_Tick (object sender, object e)

Private Attributes

DispatcherTimer | _loadTimer
UISettings | _uiSettings

Static Private Attributes

static DependencyProperty | s_articleProperty

Detailed Description

Definition at line 26 of file ArticlePage.xaml.cs.

Constructor & Destructor Documentation

ArticlePage ( ) [inline]

Definition at line 45 of file ArticlePage.xaml.cs.

        {
            this.InitializeComponent();

            VisualStateManager.GoToState(this, "ContentNotLoadedState", false);

            // Simulate asynchronous loading of content
            _loadTimer = new DispatcherTimer();
            _loadTimer.Interval = TimeSpan.FromSeconds(0.55);
            _loadTimer.Tick += LoadTimer_Tick;

            _uiSettings = new UISettings();
        }

Member Function Documentation

void ArticlePage_BackRequested | ( | object | sender,
 |  | BackRequestedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 90 of file ArticlePage.xaml.cs.

        {
            e.Handled = true;
            Frame.GoBack();
        }

void BackButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 96 of file ArticlePage.xaml.cs.

        {
            Frame.GoBack();
        }

void LoadTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 59 of file ArticlePage.xaml.cs.

        {
            // Play content entrance animation
            VisualStateManager.GoToState(this, "ContentLoadedState", _uiSettings.AnimationsEnabled);
        }

override void OnNavigatedFrom ( NavigationEventArgs e ) [inline, protected]

Definition at line 81 of file ArticlePage.xaml.cs.

        {
            base.OnNavigatedFrom(e);

            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested -= ArticlePage_BackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 65 of file ArticlePage.xaml.cs.

        {
            base.OnNavigatedTo(e);

            var article = new ArticleViewModel();
            article.Headline = (string)e.Parameter;

            this.Article = article;

            _loadTimer.Start();

            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
            systemNavigationManager.BackRequested += ArticlePage_BackRequested;
            systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }

Member Data Documentation

DispatcherTimer _loadTimer [private]

Definition at line 28 of file ArticlePage.xaml.cs.

UISettings _uiSettings [private]

Definition at line 29 of file ArticlePage.xaml.cs.

DependencyProperty s_articleProperty [static, private]
Initial value:
            DependencyProperty.Register("Article", typeof(ArticleViewModel), typeof(ArticlePage), new PropertyMetadata(null))

Definition at line 31 of file ArticlePage.xaml.cs.

Property Documentation

ArticleViewModel Article [get, set]

Definition at line 40 of file ArticlePage.xaml.cs.

DependencyProperty ArticleProperty [static, get]

Definition at line 35 of file ArticlePage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/ArticlePage.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MainPage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • MainPage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

MainPage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MainPage ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | SectionView_ArticleSelected (object sender, ArticleViewModel e)
void | UpdateRandomSection ()
void | UpdateTimer_Tick (object sender, object e)

Private Attributes

Random | _random
DispatcherTimer | _updateTimer

Detailed Description

Definition at line 24 of file MainPage.xaml.cs.

Constructor & Destructor Documentation

MainPage ( ) [inline]

Definition at line 30 of file MainPage.xaml.cs.

        {
            this.InitializeComponent();

            _random = new Random();

            _updateTimer = new DispatcherTimer();
            _updateTimer.Interval = TimeSpan.FromSeconds(3.0);
            _updateTimer.Tick += UpdateTimer_Tick;
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 61 of file MainPage.xaml.cs.

        {
            base.OnNavigatedTo(e);

            _updateTimer.Start();
        }

void SectionView_ArticleSelected | ( | object | sender,
 |  | ArticleViewModel | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file MainPage.xaml.cs.

        {
            // In a real app, you might pass a unique ID for the article as a navigation parameter.
            // Here we pass the title.
            Frame.Navigate(typeof(ArticlePage), e.Headline);
        }

void UpdateRandomSection ( ) [inline, private]

Definition at line 41 of file MainPage.xaml.cs.

        {
            // Updating the section triggers a cool animation!
            // See SectionView.xaml and SectionView.xaml.cs

            var sectionsInView = HeadlinesHub.SectionsInView;
            var sectionsCount = sectionsInView.Count;

            if (sectionsCount > 0)
            {
                var sectionToUpdate = sectionsInView[_random.Next(sectionsCount)];
                sectionToUpdate.DataContext = new HeroArticlesViewModel();
            }
        }

void UpdateTimer_Tick | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 56 of file MainPage.xaml.cs.

        {
            UpdateRandomSection();
        }

Member Data Documentation

Random _random [private]

Definition at line 26 of file MainPage.xaml.cs.

DispatcherTimer _updateTimer [private]

Definition at line 27 of file MainPage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SectionView Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • SectionView
Public Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

SectionView Class Reference

List of all members.

Public Member Functions

SectionView ()

Properties

HeroArticlesViewModel | ViewModel [get, set]
static DependencyProperty | ViewModelProperty [get]

Events

TypedEventHandler< object,
ArticleViewModel > 		ArticleSelected

Private Member Functions

void | ArticleTapped (object sender, TappedRoutedEventArgs e)
void | ContentTransitionStoryboard_Completed (object sender, object e)
void | LayoutRoot_SizeChanged (object sender, SizeChangedEventArgs e)
void | OnViewModelChanged (HeroArticlesViewModel oldValue, HeroArticlesViewModel newValue)
void | UpdateForSizeChanged (double newWidth, double newHeight)

Static Private Member Functions

static void | OnViewModelPropertyChanged (DependencyObject o, DependencyPropertyChangedEventArgs e)

Private Attributes

UISettings | _uiSettings

Static Private Attributes

static DependencyProperty | s_viewModelProperty

Detailed Description

Definition at line 22 of file SectionView.xaml.cs.

Constructor & Destructor Documentation

SectionView ( ) [inline]

Definition at line 47 of file SectionView.xaml.cs.

        {
            this.InitializeComponent();

            VisualStateManager.GoToState(this, "ContentSteadyState", false);
            _uiSettings = new UISettings();
        }

Member Function Documentation

void ArticleTapped | ( | object | sender,
 |  | TappedRoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file SectionView.xaml.cs.

        {
            if (ArticleSelected != null)
            {
                ArticleSelected(this, (ArticleViewModel)((FrameworkElement)e.OriginalSource).DataContext);
            }
        }

void ContentTransitionStoryboard_Completed | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 78 of file SectionView.xaml.cs.

        {
            CurrentContentPresenter.Content = NextContentPresenter.Content;
            VisualStateManager.GoToState(this, "ContentSteadyState", false);
        }

void LayoutRoot_SizeChanged | ( | object | sender,
 |  | SizeChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 72 of file SectionView.xaml.cs.

        {
            var newSize = e.NewSize;
            UpdateForSizeChanged(newSize.Width, newSize.Height);
        }

void OnViewModelChanged | ( | HeroArticlesViewModel | oldValue,
 |  | HeroArticlesViewModel | newValue |
 | ) |  |  | [inline, private]

Definition at line 84 of file SectionView.xaml.cs.

        {
            if (oldValue != null && _uiSettings.AnimationsEnabled)
            {
                NextContentPresenter.Content = newValue;
                CurrentContentPresenter.Content = oldValue;

                // Play content transition
                VisualStateManager.GoToState(this, "ContentTransitionState", true);
            }
            else
            {
                CurrentContentPresenter.Content = newValue;
            }
        }

static void OnViewModelPropertyChanged | ( | DependencyObject | o,
 |  | DependencyPropertyChangedEventArgs | e |
 | ) |  |  | [inline, static, private]

Definition at line 100 of file SectionView.xaml.cs.

        {
            ((SectionView)o).OnViewModelChanged((HeroArticlesViewModel)e.OldValue, (HeroArticlesViewModel)e.NewValue);
        }

void UpdateForSizeChanged | ( | double | newWidth,
 |  | double | newHeight |
 | ) |  |  | [inline, private]

Definition at line 56 of file SectionView.xaml.cs.

        {
            // The rotation creates a rectangular prism effect.
            // The center of rotation should be at X = Width / 2 and Z = -Width / 2
            var centerX = newWidth / 2.0;
            RootTransform.CenterX = centerX;
            NextContentTransform.CenterX = centerX;

            var centerZ = -newWidth / 2.0;
            RootTransform.CenterZ = centerZ;
            NextContentTransform.CenterZ = centerZ;

            // Clip to our left and right bounds so the effect doesn't get too crazy.
            ClipGeometry.Rect = new Rect(0.0, -1024.0, newWidth, newHeight + 1024.0);
        }

Member Data Documentation

UISettings _uiSettings [private]

Definition at line 24 of file SectionView.xaml.cs.

DependencyProperty s_viewModelProperty [static, private]
Initial value:
 DependencyProperty.Register(
                "ViewModel",
                typeof(HeroArticlesViewModel),
                typeof(SectionView),
                new PropertyMetadata(null, new PropertyChangedCallback(OnViewModelPropertyChanged))
                )

Definition at line 29 of file SectionView.xaml.cs.

Property Documentation

HeroArticlesViewModel ViewModel [get, set]

Definition at line 42 of file SectionView.xaml.cs.

DependencyProperty ViewModelProperty [static, get]

Definition at line 37 of file SectionView.xaml.cs.

Event Documentation

TypedEventHandler<object, ArticleViewModel> ArticleSelected

Definition at line 113 of file SectionView.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/SectionView.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ArticleViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • ViewModels
  • ArticleViewModel
Public Member Functions | Properties | Private Attributes | Static Private Attributes

ArticleViewModel Class Reference

List of all members.

Public Member Functions

ArticleViewModel ()

Properties

string | FullText [get]
string | Headline [get, set]
ImageSource | ImageSource [get]

Private Attributes

string | _headline
Uri | _imageUri

Static Private Attributes

static Random | s_random = new Random()

Detailed Description

Definition at line 11 of file ArticleViewModel.cs.

Constructor & Destructor Documentation

ArticleViewModel ( ) [inline]

Definition at line 41 of file ArticleViewModel.cs.

        {
            _headline = new[]
                {
                    "Lorem Ipsum",
                    "Dolor Sit",
                    "Consectetus Adipiscing",
                    "Etiam Sed Nibh",
                    "Vivamus a Mollis Leo",
                    "Vestibulum Sollicitudin Arcu",
                    "Sed Suscipit Luctus",
                    "Arcu Malesuada Vitae",
                    "Sed Vulputate Aliquet",
                    "Donec Blandit Congue Dictum"
                }[s_random.Next(10)];

            var imagePath = "Images/circle_image" + (s_random.Next(3) + 1).ToString() + ".jpg";
            _imageUri = new Uri("ms-appx:///" + imagePath);
        }

Member Data Documentation

string _headline [private]

Definition at line 14 of file ArticleViewModel.cs.

Uri _imageUri [private]

Definition at line 15 of file ArticleViewModel.cs.

Random s_random = new Random() [static, private]

Definition at line 13 of file ArticleViewModel.cs.

Property Documentation

string FullText [get]

Definition at line 29 of file ArticleViewModel.cs.

string Headline [get, set]

Definition at line 18 of file ArticleViewModel.cs.

ImageSource ImageSource [get]

Definition at line 24 of file ArticleViewModel.cs.

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/ViewModels/ArticleViewModel.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HeroArticlesViewModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Transform3DAnimations
  • ViewModels
  • HeroArticlesViewModel
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

HeroArticlesViewModel Class Reference

List of all members.

Public Member Functions

HeroArticlesViewModel ()

Properties

ArticleViewModel | Article0 [get, set]
ArticleViewModel | Article1 [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged (string propertyName)

Private Attributes

ArticleViewModel _article0
ArticleViewModel _article1

Detailed Description

Definition at line 11 of file HeroArticlesViewModel.cs.

Constructor & Destructor Documentation

HeroArticlesViewModel ( ) [inline]

Definition at line 43 of file HeroArticlesViewModel.cs.

        {
            _article0 = new ArticleViewModel();
            _article1 = new ArticleViewModel();
        }

Member Function Documentation

void NotifyPropertyChanged ( string propertyName ) [inline, private]

Definition at line 49 of file HeroArticlesViewModel.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

Member Data Documentation

ArticleViewModel _article0 [private]

Definition at line 13 of file HeroArticlesViewModel.cs.

ArticleViewModel _article1 [private]

Definition at line 27 of file HeroArticlesViewModel.cs.

Property Documentation

ArticleViewModel Article0 [get, set]

Definition at line 15 of file HeroArticlesViewModel.cs.

ArticleViewModel Article1 [get, set]

Definition at line 30 of file HeroArticlesViewModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 57 of file HeroArticlesViewModel.cs.

The documentation for this class was generated from the following file:
  • XamlTransform3DAnimations/cs/ViewModels/HeroArticlesViewModel.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Turn Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes | Private Member Functions

Turn Class Reference

List of all members.

Public Attributes

float | turningSpeed = 60

Private Member Functions

void | Start ()
void | Update ()

Detailed Description

Definition at line 4 of file Turn.cs.

Member Function Documentation

void Start ( ) [inline, private]

Definition at line 8 of file Turn.cs.

                  {

  }

void Update ( ) [inline, private]

Definition at line 13 of file Turn.cs.

                 {
        float horizontal = Input.GetAxis("Horizontal") * turningSpeed * Time.deltaTime;
        transform.Rotate(0, horizontal, 0);
    }

Member Data Documentation

float turningSpeed = 60

Definition at line 5 of file Turn.cs.

The documentation for this class was generated from the following file:
  • 3DPrintingFromUnity/Assets/Script/Turn.cs
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TypeConversionHelpers Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Static Public Member Functions | Public Attributes

TypeConversionHelpers Class Reference

#include "SecureInterfaceStructures.h"

List of all members.

Static Public Member Functions

template<class T >
static _Check_return_ int32 | GetAllJoynMessageArg (alljoyn_msgarg argument, PCSTR signature, _Out_ T *value)
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Platform::String^*value)
template<class T >
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IVectorView< T >^*value)
template<class T , class U >
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IMapView< T, U >^*value)
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IVector< Platform::String^>^*value)
template<class T >
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IVector< T >^*value)
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IVectorView< Platform::String^>^*value)
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Platform::Object^*value)
template<class T , class U >
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IMap< T, U >^*value)
template<class T >
static _Check_return_ int32 | GetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Windows::Foundation::Collections::IMap< T, Platform::Object^>^*value)
static _Check_return_ int32 | GetDictionaryTypeSignatures (_In_ PCSTR signature, _Inout_ std::vector< char > *keySignature, _Inout_ std::vector< char > *valueSignature)
static _Check_return_ int32 | GetMapFromVariant (_In_ alljoyn_msgarg argument, _In_ char mapSignature, _Outptr_result_maybenull_ Platform::Object^*value)
static _Check_return_ int32 | GetValueFromVariant (_In_ alljoyn_msgarg argument, _Outptr_result_maybenull_ Platform::Object^*value)
template<class T >
static _Check_return_ int32 | GetVariantArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _Outptr_result_maybenull_ Platform::Object^*value)
static _Check_return_ int32 | GetVariantStructureArg (_In_ alljoyn_msgarg argument, _Outptr_result_maybenull_ Platform::Object^*value)
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Platform::String^value)
template<class T >
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ T value)
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Windows::Foundation::Collections::IVector< Platform::String^>^value)
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Platform::Object^value)
template<class T >
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Windows::Foundation::Collections::IVector< T >^value)
template<class T >
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Windows::Foundation::Collections::IVectorView< T >^value)
template<class T , class U >
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Windows::Foundation::Collections::IMap< T, U >^value)
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ Windows::Foundation::Collections::IVectorView< Platform::String^>^value)
template<class T , class U >
static _Check_return_ int32 | SetAllJoynMessageArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, Windows::Foundation::Collections::IMapView< T, U >^value)
template<class T >
static _Check_return_ int32 | SetVariantArg (_In_ alljoyn_msgarg argument, _In_ PCSTR signature, _In_ T value)
static _Check_return_ int32 | SetVariantStructureArg (_In_ alljoyn_msgarg argument, _In_ PROJECT_NAMESPACE::AllJoynMessageArgStructure^value)

Public Attributes

internal | __pad0__: static _Check_return_ int32 GetAllJoynMessageArg(_In_ alljoyn_msgarg argument
internal _In_ PCSTR | signature

Detailed Description

Definition at line 105 of file SecureInterfaceStructures.h.

Member Function Documentation

static _Check_return_ int32 GetAllJoynMessageArg | ( | alljoyn_msgarg | argument,
 |  | PCSTR | signature,
 |  | _Out_ T * | value |
 | ) |  |  | [inline, static]

Definition at line 83 of file TypeConversionHelpers.h.

    {
        return alljoyn_msgarg_get(argument, signature, value);
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Platform::String^* | value |
 | ) |  |  | [inline, static]

Definition at line 100 of file TypeConversionHelpers.h.

    {
        *value = nullptr;
        PSTR allJoynValue = nullptr;
        QStatus status = alljoyn_msgarg_get(argument, signature, &allJoynValue);
        if ((ER_OK == status) && (nullptr != allJoynValue))
        {
            *value = AllJoynHelpers::MultibyteToPlatformString(allJoynValue);
        }
        return static_cast<int32>(status);
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IVectorView< T >^* | value |
 | ) |  |  | [inline, static]

Definition at line 180 of file TypeConversionHelpers.h.

    {
        Windows::Foundation::Collections::IVector<T>^ result;
        int32 status = GetAllJoynMessageArg(argument, signature, &result);
        *value = result->GetView();
        return status;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IMapView< T, U >^* | value |
 | ) |  |  | [inline, static]

Definition at line 347 of file TypeConversionHelpers.h.

    {
        Windows::Foundation::Collections::IMap<T, U>^ result;
        int32 status = GetAllJoynMessageArg(argument, signature, &result);
        *value = result->GetView();
        return status;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IVector< Platform::String^>^* | value |
 | ) |  |  | [inline, static]

Definition at line 218 of file TypeConversionHelpers.h.

    {
        *value = ref new Platform::Collections::Vector<Platform::String^>();
        size_t elementCount = 0;
        alljoyn_msgarg arrayContents = nullptr;
        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(argument, signature, &elementCount, &arrayContents));

        if (arrayContents != nullptr)
        {
            for (size_t i = 0; i < elementCount; i++)
            {
                Platform::String^ elementValue;
                RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(alljoyn_msgarg_array_element(arrayContents, i), "s", &elementValue));
                (*value)->Append(elementValue);
            }
        }

        return S_OK;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IVector< T >^* | value |
 | ) |  |  | [inline, static]

Definition at line 119 of file TypeConversionHelpers.h.

    {
        *value = ref new Platform::Collections::Vector<T>();
        if (signature[0] != 'a')
        {
            return ER_BUS_SIGNATURE_MISMATCH;
        }

        if (IsArrayOfPrimitives(signature))
        {
            return GetPrimitiveArrayMessageArg(argument, signature, value);
        }

        // Remove the 'a' to get the signature of an array element.
        PCSTR elementSignature = signature + 1;
        size_t elementCount = 0;
        alljoyn_msgarg arrayContents = nullptr;
        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(argument, signature, &elementCount, &arrayContents));

        if (arrayContents != nullptr)
        {
            for (size_t i = 0; i < elementCount; i++)
            {
                T elementValue;
                RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(alljoyn_msgarg_array_element(arrayContents, i), elementSignature, &elementValue));
                (*value)->Append(elementValue);
            }
        }

        return ER_OK;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IVectorView< Platform::String^>^* | value |
 | ) |  |  | [inline, static]

Definition at line 238 of file TypeConversionHelpers.h.

    {
        Windows::Foundation::Collections::IVector<Platform::String^>^ result;
        int32 status = GetAllJoynMessageArg(argument, signature, &result);
        *value = result->GetView();
        return status;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Platform::Object^* | value |
 | ) |  |  | [inline, static]

Definition at line 639 of file TypeConversionHelpers.h.

    {
        UNREFERENCED_PARAMETER(signature);

        *value = nullptr;
        alljoyn_msgarg variantArg;
        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(argument, "v", &variantArg));
        return GetValueFromVariant(variantArg, value);
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IMap< T, U >^* | value |
 | ) |  |  | [inline, static]

Definition at line 252 of file TypeConversionHelpers.h.

    {
        *value = ref new Platform::Collections::Map<T, U>();

        std::vector<char> keyType;
        std::vector<char> valueType;
        RETURN_IF_QSTATUS_ERROR(GetDictionaryTypeSignatures(signature, &keyType, &valueType));

        size_t elementCount = 0;
        alljoyn_msgarg dictionaryContents = nullptr;
        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(argument, signature, &elementCount, &dictionaryContents));

        if (dictionaryContents != nullptr)
        {
            for (size_t i = 0; i < elementCount; i++)
            {
                alljoyn_msgarg keyArg, valueArg;
                RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(alljoyn_msgarg_array_element(dictionaryContents, i), "{**}", &keyArg, &valueArg));
                T dictionaryKey;
                RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(keyArg, keyType.data(), &dictionaryKey));
                U dictionaryValue;
                RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(valueArg, valueType.data(), &dictionaryValue));

                (*value)->Insert(dictionaryKey, dictionaryValue);
            }
        }

        return ER_OK;
    }

static _Check_return_ int32 GetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Windows::Foundation::Collections::IMap< T, Platform::Object^>^* | value |
 | ) |  |  | [inline, static]

Definition at line 283 of file TypeConversionHelpers.h.

    {
        *value = ref new Platform::Collections::Map<T, Platform::Object^>();

        std::vector<char> keyType;
        std::vector<char> valueType;
        RETURN_IF_QSTATUS_ERROR(GetDictionaryTypeSignatures(signature, &keyType, &valueType));

        size_t elementCount = 0;
        alljoyn_msgarg dictionaryContents = nullptr;
        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(argument, signature, &elementCount, &dictionaryContents));

        if (dictionaryContents != nullptr)
        {
            for (size_t i = 0; i < elementCount; i++)
            {
                alljoyn_msgarg keyArg, valueArg;
                RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_get(alljoyn_msgarg_array_element(dictionaryContents, i), "{*v}", &keyArg, &valueArg));
                T dictionaryKey;
                RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(keyArg, keyType.data(), &dictionaryKey));
                Platform::Object^ dictionaryValue;
                RETURN_IF_QSTATUS_ERROR(GetValueFromVariant(valueArg, &dictionaryValue));

                (*value)->Insert(dictionaryKey, dictionaryValue);
            }
        }

        return ER_OK;
    }

_Check_return_ int32 GetDictionaryTypeSignatures | ( | _In_ PCSTR | signature,
 |  | _Inout_ std::vector< char > * | keySignature,
 |  | _Inout_ std::vector< char > * | valueSignature |
 | ) |  |  | [static]

Definition at line 68 of file TypeConversionHelpers.cpp.

{
    if ((strlen(signature) < 3) || (signature[0] != 'a') || (signature[1] != '{'))
    {
        return ER_BUS_BAD_SIGNATURE;
    }

    // Skip past the opening "a{".
    signature += 2;
    RETURN_IF_QSTATUS_ERROR(AppendNextCompleteType(signature, keySignature));
    signature += keySignature->size();
    RETURN_IF_QSTATUS_ERROR(AppendNextCompleteType(signature, valueSignature));
    keySignature->push_back('\0');
    valueSignature->push_back('\0');
    return ER_OK;
}

static _Check_return_ int32 GetMapFromVariant | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ char | mapSignature,
 |  | _Outptr_result_maybenull_ Platform::Object^* | value |
 | ) |  |  | [inline, static]

Definition at line 535 of file TypeConversionHelpers.h.

    {
        *value = nullptr;

        switch (mapSignature)
        {
        case 'y':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<byte, Platform::Object^>^>(argument, "a{yv}", value);
        }
        case 'b':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<bool, Platform::Object^>^>(argument, "a{bv}", value);
        }
        case 'n':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<int16, Platform::Object^>^>(argument, "a{nv}", value);
        }
        case 'q':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<uint16, Platform::Object^>^>(argument, "a{qv}", value);
        }
        case 'i':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<int32, Platform::Object^>^>(argument, "a{iv}", value);
        }
        case 'u':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<uint32, Platform::Object^>^>(argument, "a{uv}", value);
        }
        case 'x':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<int64, Platform::Object^>^>(argument, "a{xv}", value);
        }
        case 't':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<uint64, Platform::Object^>^>(argument, "a{tv}", value);
        }
        case 'd':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<double, Platform::Object^>^>(argument, "a{dv}", value);
        }
        case 's':
        {
            return GetVariantArg<Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^>(argument, "a{sv}", value);
        }
        default:
            return ER_BUS_BAD_SIGNATURE;
        }
    }

static _Check_return_ int32 GetValueFromVariant | ( | _In_ alljoyn_msgarg | argument,
 |  | _Outptr_result_maybenull_ Platform::Object^* | value |
 | ) |  |  | [inline, static]

Definition at line 586 of file TypeConversionHelpers.h.

    {
        *value = nullptr;
        char variantSignature[c_MaximumSignatureLength];
        alljoyn_msgarg_signature(argument, variantSignature, c_MaximumSignatureLength);

        switch (variantSignature[0])
        {
        case 'y':
            return GetVariantArg<byte>(argument, "y", value);
        case 'b':
            return GetVariantArg<bool>(argument, "b", value);
        case 'n':
            return GetVariantArg<int16>(argument, "n", value);
        case 'q':
            return GetVariantArg<uint16>(argument, "q", value);
        case 'i':
            return GetVariantArg<int32>(argument, "i", value);
        case 'u':
            return GetVariantArg<uint32>(argument, "u", value);
        case 'x':
            return GetVariantArg<int64>(argument, "x", value);
        case 't':
            return GetVariantArg<uint64>(argument, "t", value);
        case 'd':
            return GetVariantArg<double>(argument, "d", value);
        case 's':
            return GetVariantArg<Platform::String^>(argument, "s", value);
        case '(':
            return GetVariantStructureArg(argument, value);
        case 'a':
            if (strlen(variantSignature) < 2)
            {
                return ER_BUS_BAD_SIGNATURE;
            }
            if (variantSignature[1] == '{')
            {
                if (strlen(variantSignature) < 3)
                {
                    return ER_BUS_BAD_SIGNATURE;
                }

                return GetMapFromVariant(argument, variantSignature[2], value);
            }
            else
            {
                return GetVariantArg<Windows::Foundation::Collections::IVector<Platform::Object^>^>(argument, "av", value);
            }
        }

        return ER_BUS_BAD_SIGNATURE;
    }

static _Check_return_ int32 GetVariantArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _Outptr_result_maybenull_ Platform::Object^* | value |
 | ) |  |  | [inline, static]

Definition at line 407 of file TypeConversionHelpers.h.

    {
        *value = nullptr;

        T innerValue;
        RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(argument, signature, &innerValue));
        *value = innerValue;
        return ER_OK;
    }

static _Check_return_ int32 GetVariantStructureArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _Outptr_result_maybenull_ Platform::Object^* | value |
 | ) |  |  | [inline, static]

Definition at line 379 of file TypeConversionHelpers.h.

    {
        *value = nullptr;
        size_t memberCount = alljoyn_msgarg_getnummembers(argument);
        auto result = ref new PROJECT_NAMESPACE::AllJoynMessageArgStructure();

        for (size_t i = 0; i < memberCount; i++)
        {
            Platform::Object^ variantValue;
            RETURN_IF_QSTATUS_ERROR(GetAllJoynMessageArg(alljoyn_msgarg_getmember(argument, i), "v", &variantValue));
            result->Append(variantValue);
        }

        *value = result;
        return ER_OK;
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Platform::String^ | value |
 | ) |  |  | [inline, static]

Definition at line 112 of file TypeConversionHelpers.h.

    {
        std::vector<char> inputArg = AllJoynHelpers::PlatformToMultibyteString(value);
        return alljoyn_msgarg_set_and_stabilize(argument, signature, inputArg.data());
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ T | value |
 | ) |  |  | [inline, static]

Definition at line 95 of file TypeConversionHelpers.h.

    {
        return alljoyn_msgarg_set(argument, signature, value);
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Windows::Foundation::Collections::IVector< Platform::String^>^ | value |
 | ) |  |  | [inline, static]

Definition at line 246 of file TypeConversionHelpers.h.

    {
        return SetAllJoynMessageArg(argument, signature, value->GetView());
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Platform::Object^ | value |
 | ) |  |  | [inline, static]

Definition at line 417 of file TypeConversionHelpers.h.

    {
        UNREFERENCED_PARAMETER(signature);

        auto byteValue = dynamic_cast<Platform::IBox<byte>^>(value);
        if (byteValue != nullptr)
        {
            return SetVariantArg(argument, "y", byteValue->Value);
        }
        auto boolValue = dynamic_cast<Platform::IBox<bool>^>(value);
        if (boolValue != nullptr)
        {
            return SetVariantArg(argument, "b", boolValue->Value);
        }
        auto int16Value = dynamic_cast<Platform::IBox<int16>^>(value);
        if (int16Value != nullptr)
        {
            return SetVariantArg(argument, "n", int16Value->Value);
        }
        auto uint16Value = dynamic_cast<Platform::IBox<uint16>^>(value);
        if (uint16Value != nullptr)
        {
            return SetVariantArg(argument, "q", uint16Value->Value);
        }
        auto int32Value = dynamic_cast<Platform::IBox<int32>^>(value);
        if (int32Value != nullptr)
        {
            return SetVariantArg(argument, "i", int32Value->Value);
        }
        auto uint32Value = dynamic_cast<Platform::IBox<uint32>^>(value);
        if (uint32Value != nullptr)
        {
            return SetVariantArg(argument, "u", uint32Value->Value);
        }
        auto int64Value = dynamic_cast<Platform::IBox<int64>^>(value);
        if (int64Value != nullptr)
        {
            return SetVariantArg(argument, "x", int64Value->Value);
        }
        auto uint64Value = dynamic_cast<Platform::IBox<uint64>^>(value);
        if (uint64Value != nullptr)
        {
            return SetVariantArg(argument, "t", uint64Value->Value);
        }
        auto doubleValue = dynamic_cast<Platform::IBox<double>^>(value);
        if (doubleValue != nullptr)
        {
            return SetVariantArg(argument, "d", doubleValue->Value);
        }
        auto stringValue = dynamic_cast<Platform::String^>(value);
        if (stringValue != nullptr)
        {
            return SetVariantArg(argument, "s", stringValue);
        }
        auto structValue = dynamic_cast<PROJECT_NAMESPACE::AllJoynMessageArgStructure^>(value);
        if (structValue != nullptr)
        {
            return SetVariantStructureArg(argument, structValue);
        }
        auto vectorValue = dynamic_cast<Windows::Foundation::Collections::IVector<Platform::Object^>^>(value);
        if (vectorValue != nullptr)
        {
            return SetVariantArg(argument, "av", vectorValue);
        }
        auto byteMapValue = dynamic_cast<Windows::Foundation::Collections::IMap<byte, Platform::Object^>^>(value);
        if (byteMapValue != nullptr)
        {
            return SetVariantArg(argument, "a{yv}", byteMapValue);
        }
        auto boolMapValue = dynamic_cast<Windows::Foundation::Collections::IMap<bool, Platform::Object^>^>(value);
        if (boolMapValue != nullptr)
        {
            return SetVariantArg(argument, "a{bv}", boolMapValue);
        }
        auto int16MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<int16, Platform::Object^>^>(value);
        if (int16MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{nv}", int16MapValue);
        }
        auto uint16MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<uint16, Platform::Object^>^>(value);
        if (uint16MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{qv}", int16MapValue);
        }
        auto int32MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<int32, Platform::Object^>^>(value);
        if (int32MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{iv}", int32MapValue);
        }
        auto uint32MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<uint32, Platform::Object^>^>(value);
        if (uint32MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{uv}", uint32MapValue);
        }
        auto int64MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<int64, Platform::Object^>^>(value);
        if (int64MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{xv}", int64MapValue);
        }
        auto uint64MapValue = dynamic_cast<Windows::Foundation::Collections::IMap<uint64, Platform::Object^>^>(value);
        if (uint64MapValue != nullptr)
        {
            return SetVariantArg(argument, "a{tv}", uint64MapValue);
        }
        auto doubleMapValue = dynamic_cast<Windows::Foundation::Collections::IMap<double, Platform::Object^>^>(value);
        if (doubleMapValue != nullptr)
        {
            return SetVariantArg(argument, "a{dv}", doubleMapValue);
        }
        auto stringMapValue = dynamic_cast<Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^>(value);
        if (stringMapValue != nullptr)
        {
            return SetVariantArg(argument, "a{sv}", stringMapValue);
        }

        return ER_BUS_BAD_VALUE_TYPE;
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Windows::Foundation::Collections::IVector< T >^ | value |
 | ) |  |  | [inline, static]

Definition at line 189 of file TypeConversionHelpers.h.

    {
        return SetAllJoynMessageArg(argument, signature, value->GetView());
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Windows::Foundation::Collections::IVectorView< T >^ | value |
 | ) |  |  | [inline, static]

Definition at line 152 of file TypeConversionHelpers.h.

    {
        if (signature[0] != 'a')
        {
            return ER_BUS_SIGNATURE_MISMATCH;
        }

        // An empty or null vector will cause errors in AllJoyn.
        if (value == nullptr || value->Size < 1)
        {
            return ER_INVALID_DATA;
        }

        // Remove the 'a' to get the signature of an array element.
        PCSTR elementSignature = signature + 1;
        alljoyn_msgarg arrayArgument = alljoyn_msgarg_array_create(value->Size);

        for (size_t i = 0; i < value->Size; i++)
        {
            RETURN_IF_QSTATUS_ERROR(SetAllJoynMessageArg(alljoyn_msgarg_array_element(arrayArgument, i), elementSignature, value->GetAt(static_cast<unsigned int>(i))));
        }

        QStatus status = alljoyn_msgarg_set_and_stabilize(argument, "a*", (size_t)value->Size, arrayArgument);
        alljoyn_msgarg_destroy(arrayArgument);
        return static_cast<int32>(status);
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Windows::Foundation::Collections::IMap< T, U >^ | value |
 | ) |  |  | [inline, static]

Definition at line 356 of file TypeConversionHelpers.h.

    {
        return SetAllJoynMessageArg(argument, signature, value->GetView());
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ Windows::Foundation::Collections::IVectorView< Platform::String^>^ | value |
 | ) |  |  | [inline, static]

Definition at line 194 of file TypeConversionHelpers.h.

    {
        // An empty or null vector will cause errors in AllJoyn.
        if (value == nullptr || value->Size < 1)
        {
            return ER_INVALID_DATA;
        }

        std::vector<std::vector<char>> strings;
        for (unsigned int i = 0; i < value->Size; i++)
        {
            strings.push_back(AllJoynHelpers::PlatformToMultibyteString(value->GetAt(i)));
        }

        // alljoyn_msgarg_set expects the strings to be in the form of an array of char*.
        std::vector<char*> allJoynArgument;
        for (unsigned int i = 0; i < value->Size; i++)
        {
            allJoynArgument.push_back(strings.at(i).data());
        }

        return alljoyn_msgarg_set_and_stabilize(argument, signature, value->Size, allJoynArgument.data());
    }

static _Check_return_ int32 SetAllJoynMessageArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | Windows::Foundation::Collections::IMapView< T, U >^ | value |
 | ) |  |  | [inline, static]

Definition at line 314 of file TypeConversionHelpers.h.

    {
        std::vector<char> keyType;
        std::vector<char> valueType;
        RETURN_IF_QSTATUS_ERROR(GetDictionaryTypeSignatures(signature, &keyType, &valueType));

        // An empty or null vector will cause errors in AllJoyn.
        if (value == nullptr || value->Size < 1)
        {
            return ER_INVALID_DATA;
        }

        alljoyn_msgarg dictionaryArg = alljoyn_msgarg_array_create(value->Size);

        int i = 0;
        for (auto dictionaryElement : value)
        {
            alljoyn_msgarg keyArg = alljoyn_msgarg_create();
            alljoyn_msgarg valueArg = alljoyn_msgarg_create();
            RETURN_IF_QSTATUS_ERROR(SetAllJoynMessageArg(keyArg, keyType.data(), dictionaryElement->Key));
            RETURN_IF_QSTATUS_ERROR(SetAllJoynMessageArg(valueArg, valueType.data(), dictionaryElement->Value));

            RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_set_and_stabilize(alljoyn_msgarg_array_element(dictionaryArg, i++), "{**}", keyArg, valueArg));
            alljoyn_msgarg_destroy(keyArg);
            alljoyn_msgarg_destroy(valueArg);
        }

        QStatus status = alljoyn_msgarg_set_and_stabilize(argument, signature, (size_t)value->Size, dictionaryArg);
        alljoyn_msgarg_destroy(dictionaryArg);
        return static_cast<int32>(status);
    }

static _Check_return_ int32 SetVariantArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PCSTR | signature,
 |  | _In_ T | value |
 | ) |  |  | [inline, static]

Definition at line 397 of file TypeConversionHelpers.h.

    {
        alljoyn_msgarg variantArg = alljoyn_msgarg_create();
        RETURN_IF_QSTATUS_ERROR(SetAllJoynMessageArg(variantArg, signature, value));
        QStatus status = alljoyn_msgarg_set_and_stabilize(argument, "v", variantArg);
        alljoyn_msgarg_destroy(variantArg);
        return status;
    }

static _Check_return_ int32 SetVariantStructureArg | ( | _In_ alljoyn_msgarg | argument,
 |  | _In_ PROJECT_NAMESPACE::AllJoynMessageArgStructure^ | value |
 | ) |  |  | [inline, static]

Definition at line 361 of file TypeConversionHelpers.h.

    {
        alljoyn_msgarg variantArg = alljoyn_msgarg_create();
        alljoyn_msgarg fields = alljoyn_msgarg_array_create(value->Size);
        for (unsigned int i = 0; i < value->Size; i++)
        {
            RETURN_IF_QSTATUS_ERROR(SetAllJoynMessageArg(alljoyn_msgarg_array_element(fields, i), "v", value->GetAt(i)));
        }

        RETURN_IF_QSTATUS_ERROR(alljoyn_msgarg_setstruct(variantArg, fields, value->Size));
        alljoyn_msgarg_destroy(fields);

        QStatus status = alljoyn_msgarg_set_and_stabilize(argument, "v", variantArg);
        alljoyn_msgarg_destroy(variantArg);

        return static_cast<int32>(status);
    }

Member Data Documentation

internal __pad0__

Definition at line 168 of file OnboardingStructures.h.

internal _In_ PCSTR signature

Definition at line 168 of file OnboardingStructures.h.

The documentation for this class was generated from the following files:
  • AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceStructures.h
  • AllJoyn/Common/Scenario2WinRTComponent/OnboardingStructures.h
  • AllJoyn/shared/TypeConversionHelpers.h
  • AllJoyn/shared/TypeConversionHelpers.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RequestResponse Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • UssdApi
  • RequestResponse
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

RequestResponse Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

RequestResponse ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | SendButton_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 28 of file RequestResponse.xaml.cs.

Constructor & Destructor Documentation

RequestResponse ( ) [inline]

Definition at line 32 of file RequestResponse.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file RequestResponse.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void SendButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 42 of file RequestResponse.xaml.cs.

        {
            // Get the USSD message text.
            if (MessageText.Text == "")
            {
                rootPage.NotifyUser("Message cannot be empty", NotifyType.ErrorMessage);
                return;
            }

            try
            {
                // Get the network account ID.
                IReadOnlyList<string> networkAccIds = Windows.Networking.NetworkOperators.MobileBroadbandAccount.AvailableNetworkAccountIds;

                if (networkAccIds.Count == 0)
                {
                    rootPage.NotifyUser("No network account ID found", NotifyType.ErrorMessage);
                    return;
                }
                // For the sake of simplicity, assume we want to use the first account.
                // Refer to the MobileBroadbandAccount API's for how to select a specific account ID.
                string networkAccountId = networkAccIds[0];

                SendButton.IsEnabled = false;
                rootPage.NotifyUser("Sending USSD request", NotifyType.StatusMessage);

                // Create a USSD session for the specified network acccount ID.
                UssdSession session = UssdSession.CreateFromNetworkAccountId(networkAccountId);

                // Send a message to the network and wait for the reply. This message is
                // specific to the network operator and must be selected accordingly.
                UssdReply reply = await session.SendMessageAndGetReplyAsync(new UssdMessage(MessageText.Text));

                // Display the network reply. The reply always contains a ResultCode.
                UssdResultCode code = reply.ResultCode;
                if (code == UssdResultCode.ActionRequired || code == UssdResultCode.NoActionRequired)
                {
                    // If the actionRequired or noActionRequired ResultCode is returned, the reply contains
                    // a message from the network.
                    UssdMessage replyMessage = reply.Message;
                    string payloadAsText = replyMessage.PayloadAsText;
                    if (payloadAsText != "")
                    {
                        // The message may be sent using various encodings. If Windows supports
                        // the encoding, the message can be accessed as text and will not be empty.
                        // Therefore, the test for an empty string is sufficient.
                        rootPage.NotifyUser("Response: " + payloadAsText, NotifyType.StatusMessage);
                    }
                    else
                    {
                        // If Windows does not support the encoding, the application may check
                        // the DataCodingScheme used for encoding and access the raw message
                        // through replyMessage.GetPayload
                        rootPage.NotifyUser("Unsupported data coding scheme 0x" + replyMessage.DataCodingScheme.ToString("X"),
                            NotifyType.StatusMessage);
                    }
                }
                else
                {
                    rootPage.NotifyUser("Request failed: " + code.ToString(), NotifyType.StatusMessage);
                }
                if (code == UssdResultCode.ActionRequired)
                {
                    session.Close(); // Close the session from our end
                }
            }
            catch (Exception ex)
            {
                rootPage.NotifyUser("Unexpected exception occured: " + ex.ToString(), NotifyType.ErrorMessage);
            }
            SendButton.IsEnabled = true;
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 30 of file RequestResponse.xaml.cs.

The documentation for this class was generated from the following file:
  • UssdProtcol/cs/RequestResponse.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Vector2< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

Vector2< T > Struct Template Reference

#include "BasicMath.h"

List of all members.

Public Member Functions

Vector2 (T _x=0, T _y=0)
Vector2 (T _x=0, T _y=0)
Vector2 (T _x=0, T _y=0)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)

Public Attributes

union {
struct {
T g
T r
} color
struct {
T x
T y
} coord
struct {
T u
T v
} textcoord
};
union {
struct {
T x
T y
}
struct {
T g
T r
}
struct {
T u
T v
}
};
union {
struct {
T x
T y
}
struct {
T g
T r
}
struct {
T u
T v
}
};

Detailed Description

template<class T>
struct Vector2< T >

Definition at line 22 of file BasicMath.h.

Constructor & Destructor Documentation

Vector2 | ( | T | _x = 0,
 |  | T | _y = 0 |
 | ) |  |  | [inline]

Definition at line 48 of file BasicMath.h.

: x(_x), y(_y) { }

Vector2 | ( | T | _x = 0,
 |  | T | _y = 0 |
 | ) |  |  | [inline]

Definition at line 48 of file BasicMath.h.

: x(_x), y(_y) { }

Vector2 | ( | T | _x = 0,
 |  | T | _y = 0 |
 | ) |  |  | [inline]

Definition at line 48 of file BasicMath.h.

: x(_x), y(_y) { }

Member Function Documentation

T& operator[] ( unsigned int index ) [inline]

Definition at line 43 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 43 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 43 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

Member Data Documentation

union { ... }
union { ... }
union { ... }
struct { ... } color
struct { ... } coord
T g

Definition at line 34 of file BasicMath.h.

T r

Definition at line 33 of file BasicMath.h.

struct { ... } textcoord
T u

Definition at line 38 of file BasicMath.h.

T v

Definition at line 39 of file BasicMath.h.

T x

Definition at line 28 of file BasicMath.h.

T y

Definition at line 29 of file BasicMath.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicMath.h
  • Simple3DGameDX/cppwinrt/Common/BasicMath.h
  • Simple3DGameXaml/cpp/Common/BasicMath.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Vector3< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

Vector3< T > Struct Template Reference

#include "BasicMath.h"

List of all members.

Public Member Functions

Vector3 (T _x=0, T _y=0, T _z=0)
Vector3 (T _x=0, T _y=0, T _z=0)
Vector3 (T _x=0, T _y=0, T _z=0)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)

Public Attributes

union {
struct {
T x
T y
T z
}
struct {
T b
T g
T r
}
struct {
T u
T v
T w
}
};
union {
struct {
T b
T g
T r
} color
struct {
T x
T y
T z
} coord
struct {
T u
T v
T w
} texcoord
};
union {
struct {
T x
T y
T z
}
struct {
T b
T g
T r
}
struct {
T u
T v
T w
}
};

Detailed Description

template<class T>
struct Vector3< T >

Definition at line 51 of file BasicMath.h.

Constructor & Destructor Documentation

Vector3 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0 |
 | ) |  |  | [inline]

Definition at line 80 of file BasicMath.h.

: x(_x), y(_y), z(_z) { }

Vector3 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0 |
 | ) |  |  | [inline]

Definition at line 80 of file BasicMath.h.

: coord{ _x, _y, _z } { }

Vector3 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0 |
 | ) |  |  | [inline]

Definition at line 80 of file BasicMath.h.

: x(_x), y(_y), z(_z) { }

Member Function Documentation

T& operator[] ( unsigned int index ) [inline]

Definition at line 75 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 75 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 75 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

Member Data Documentation

union { ... }
union { ... }
union { ... }
T b

Definition at line 65 of file BasicMath.h.

struct { ... } color
struct { ... } coord
T g

Definition at line 64 of file BasicMath.h.

T r

Definition at line 63 of file BasicMath.h.

struct { ... } texcoord
T u

Definition at line 69 of file BasicMath.h.

T v

Definition at line 70 of file BasicMath.h.

T w

Definition at line 71 of file BasicMath.h.

T x

Definition at line 57 of file BasicMath.h.

T y

Definition at line 58 of file BasicMath.h.

T z

Definition at line 59 of file BasicMath.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicMath.h
  • Simple3DGameDX/cppwinrt/Common/BasicMath.h
  • Simple3DGameXaml/cpp/Common/BasicMath.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Vector4< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Public Attributes

Vector4< T > Struct Template Reference

#include "BasicMath.h"

List of all members.

Public Member Functions

Vector4 (T _x=0, T _y=0, T _z=0, T _w=0)
Vector4 (T _x=0, T _y=0, T _z=0, T _w=0)
Vector4 (T _x=0, T _y=0, T _z=0, T _w=0)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)
T & | operator[] (unsigned int index)

Public Attributes

union {
struct {
T w
T x
T y
T z
}
struct {
T a
T b
T g
T r
}
};
union {
struct {
T a
T b
T g
T r
} color
struct {
T w
T x
T y
T z
} coord
};
union {
struct {
T w
T x
T y
T z
}
struct {
T a
T b
T g
T r
}
};

Detailed Description

template<class T>
struct Vector4< T >

Definition at line 83 of file BasicMath.h.

Constructor & Destructor Documentation

Vector4 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0,
 |  | T | _w = 0 |
 | ) |  |  | [inline]

Definition at line 108 of file BasicMath.h.

: x(_x), y(_y), z(_z), w(_w) { }

Vector4 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0,
 |  | T | _w = 0 |
 | ) |  |  | [inline]

Definition at line 108 of file BasicMath.h.

: x(_x), y(_y), z(_z), w(_w) { }

Vector4 | ( | T | _x = 0,
 |  | T | _y = 0,
 |  | T | _z = 0,
 |  | T | _w = 0 |
 | ) |  |  | [inline]

Definition at line 108 of file BasicMath.h.

: x(_x), y(_y), z(_z), w(_w) { }

Member Function Documentation

T& operator[] ( unsigned int index ) [inline]

Definition at line 103 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 103 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

T& operator[] ( unsigned int index ) [inline]

Definition at line 103 of file BasicMath.h.

    {
        return static_cast<T*>(this)[index];
    }

Member Data Documentation

union { ... }
union { ... }
union { ... }
T a

Definition at line 99 of file BasicMath.h.

T b

Definition at line 98 of file BasicMath.h.

struct { ... } color
struct { ... } coord
T g

Definition at line 97 of file BasicMath.h.

T r

Definition at line 96 of file BasicMath.h.

T w

Definition at line 92 of file BasicMath.h.

T x

Definition at line 89 of file BasicMath.h.

T y

Definition at line 90 of file BasicMath.h.

T z

Definition at line 91 of file BasicMath.h.

The documentation for this struct was generated from the following files:
  • Simple3DGameDX/cpp/Common/BasicMath.h
  • Simple3DGameDX/cppwinrt/Common/BasicMath.h
  • Simple3DGameXaml/cpp/Common/BasicMath.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoItemInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

VideoItemInfo Struct Reference

List of all members.

Public Attributes

const wchar_t * | source
const wchar_t * | title

Detailed Description

Definition at line 66 of file VideoGallery.xaml.cpp.

Member Data Documentation

const wchar_t* source

Definition at line 69 of file VideoGallery.xaml.cpp.

const wchar_t* title

Definition at line 68 of file VideoGallery.xaml.cpp.

The documentation for this struct was generated from the following file:
  • 360VideoPlayback/cpp/VideoGallery.xaml.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisualPropertiesFactory Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

VisualPropertiesFactory Class Reference

#include "VisualProperties.h"

List of all members.

Public Member Functions

virtual
Windows::ApplicationModel::Core::IFrameworkView 		CreateView ()

Detailed Description

Definition at line 34 of file VisualProperties.h.

Member Function Documentation

virtual Windows::ApplicationModel::Core::IFrameworkView CreateView ( ) [inline, virtual]

Definition at line 45 of file VisualProperties.h.

  {
    return ref new VisualProperties();
  }

The documentation for this class was generated from the following file:
  • CompositionVisual/cpp/VisualProperties.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • VoiceCommandService
  • sealed
Public Member Functions | Private Member Functions | Private Attributes

sealed Class Reference

#include "AdventureworksVoiceCommandService.h"

List of all members.

Public Member Functions

virtual void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance^taskInstance)

Private Member Functions

AdventureWorks_Shared::Trip | DisambiguateTrips (std::vector< AdventureWorks_Shared::Trip^> trips, Platform::String^disambiguationMessage, Platform::String^secondDisambiguationMessage)
Platform::String | GetResourceString (Platform::String^resourceName)
Platform::String | GetResourceStringAndFormat (Platform::String^resourceName, Platform::String^param)
void | LaunchAppInForeground ()
void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance^sender, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason)
void | OnVoiceCommandCompleted (Windows::ApplicationModel::VoiceCommands::VoiceCommandServiceConnection^sender, Windows::ApplicationModel::VoiceCommands::VoiceCommandCompletedEventArgs^args)
void | SendCompletionMessageForCancellation (Platform::String^destination)
void | SendCompletionMessageForDestination (Platform::String^destination)
void | ShowProgressScreen (Platform::String^progressMessage)

Private Attributes

Windows::ApplicationModel::Resources::Core::ResourceContext | context
Windows::ApplicationModel::Resources::Core::ResourceMap | resourceMap
Platform::Agile
< Windows::ApplicationModel::Background::BackgroundTaskDeferral^> 		serviceDeferral
Windows::Foundation::EventRegistrationToken | taskCancelledToken
Windows::ApplicationModel::VoiceCommands::VoiceCommandServiceConnection | voiceServiceConnection

Detailed Description

Definition at line 15 of file AdventureworksVoiceCommandService.h.

Member Function Documentation

AdventureWorks_Shared::Trip DisambiguateTrips | ( | std::vector< AdventureWorks_Shared::Trip^> | trips,
 |  | Platform::String^ | disambiguationMessage,
 |  | Platform::String^ | secondDisambiguationMessage |
 | ) |  |  | [private]
Platform::String GetResourceString ( Platform::String^ resourceName ) [private]
Platform::String GetResourceStringAndFormat | ( | Platform::String^ | resourceName,
 |  | Platform::String^ | param |
 | ) |  |  | [private]
void LaunchAppInForeground ( ) [private]
void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance^ | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason | reason |
 | ) |  |  | [private]
void OnVoiceCommandCompleted | ( | Windows::ApplicationModel::VoiceCommands::VoiceCommandServiceConnection^ | sender,
 |  | Windows::ApplicationModel::VoiceCommands::VoiceCommandCompletedEventArgs^ | args |
 | ) |  |  | [private]
virtual void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance ) [virtual]
void SendCompletionMessageForCancellation ( Platform::String^ destination ) [private]
void SendCompletionMessageForDestination ( Platform::String^ destination ) [private]
void ShowProgressScreen ( Platform::String^ progressMessage ) [private]

Member Data Documentation

Windows::ApplicationModel::Resources::Core::ResourceContext context [private]

Definition at line 22 of file AdventureworksVoiceCommandService.h.

Windows::ApplicationModel::Resources::Core::ResourceMap resourceMap [private]

Definition at line 23 of file AdventureworksVoiceCommandService.h.

Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral^> serviceDeferral [private]

Definition at line 27 of file AdventureworksVoiceCommandService.h.

Windows::Foundation::EventRegistrationToken taskCancelledToken [private]

Definition at line 25 of file AdventureworksVoiceCommandService.h.

Windows::ApplicationModel::VoiceCommands::VoiceCommandServiceConnection voiceServiceConnection [private]

Definition at line 26 of file AdventureworksVoiceCommandService.h.

The documentation for this class was generated from the following file:
  • CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.h
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WaveEffect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

WaveEffect Class Reference

#include "WaveEffect.h"

List of all members.

Classes

struct | Vertex

Public Member Functions

float | GetSkewX () const
float | GetSkewY () const
float | GetWaveOffset () const
IFACEMETHODIMP_ (ULONG) Release()
IFACEMETHODIMP_ (UINT32) GetInputCount() const
IFACEMETHODIMP_ (ULONG) AddRef()
IFACEMETHODIMP | Initialize (_In_ ID2D1EffectContext *pEffectContext, _In_ ID2D1TransformGraph *pTransformGraph)
IFACEMETHODIMP | MapInputRectsToOutputRect (_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect)
IFACEMETHODIMP | MapInvalidRect (UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const
IFACEMETHODIMP | MapOutputRectToInputRects (_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const
IFACEMETHODIMP | PrepareForRender (D2D1_CHANGE_TYPE changeType)
IFACEMETHODIMP | QueryInterface (_In_ REFIID riid, _Outptr_ void **ppOutput)
IFACEMETHODIMP | SetDrawInfo (_In_ ID2D1DrawInfo *pDrawInfo)
IFACEMETHODIMP | SetGraph (_In_ ID2D1TransformGraph *pTransformGraph)
HRESULT | SetSkewX (float skew)
HRESULT | SetSkewY (float skew)
HRESULT | SetWaveOffset (float waveOffset)

Static Public Member Functions

static HRESULT __stdcall | CreateWaveImpl (_Outptr_ IUnknown **ppEffectImpl)
static HRESULT | Register (_In_ ID2D1Factory1 *pFactory)

Private Member Functions

WaveEffect ()
HRESULT | GenerateMesh (_Outptr_ Vertex **ppMesh)
HRESULT | UpdateConstants ()

Static Private Member Functions

static float | Clamp (float v, float low, float high)

Private Attributes

struct {
D2D_MATRIX_4X4_F matrix
float sizeX
float sizeY
float skewX
float skewY
float waveOffset
} m_constants
Microsoft::WRL::ComPtr
< ID2D1DrawInfo > 		m_drawInfo
D2D_RECT_L | m_inputRect
UINT | m_numVertices
LONG | m_refCount
float | m_sizeX
float | m_sizeY
float | m_skewX
float | m_skewY
Microsoft::WRL::ComPtr
< ID2D1VertexBuffer > 		m_vertexBuffer
float | m_waveOffset

Detailed Description

Definition at line 33 of file WaveEffect.h.

Constructor & Destructor Documentation

WaveEffect ( ) [private]

Definition at line 98 of file WaveEffect.cpp.

                       :
    m_refCount(1),
    m_waveOffset(0),
    m_skewX(0),
    m_skewY(0),
    m_sizeX(0),
    m_sizeY(0)
{
}

Member Function Documentation

static float Clamp | ( | float | v,
 |  | float | low,
 |  | float | high |
 | ) |  |  | [inline, static, private]

Definition at line 99 of file WaveEffect.h.

    {
        return (v < low) ? low : (v > high) ? high : v;
    }

HRESULT __stdcall CreateWaveImpl ( _Outptr_ IUnknown ** ppEffectImpl ) [static]

Definition at line 27 of file WaveEffect.cpp.

{
    *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) WaveEffect());

    if (*ppEffectImpl == nullptr)
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return S_OK;
    }
}

HRESULT GenerateMesh ( _Outptr_ Vertex ** ppMesh ) [private]

Definition at line 190 of file WaveEffect.cpp.

{
    m_numVertices = 6 * TessellationAmount * TessellationAmount;

    Vertex *mesh = new (std::nothrow) Vertex[m_numVertices];

    if (mesh == nullptr)
    {
        return E_OUTOFMEMORY;
    }

    float offset = 1.0f / TessellationAmount;

    for (int i = 0; i < TessellationAmount; i++)
    {
        for (int j = TessellationAmount - 1; j >= 0; j--)
        {
            int index = (i * TessellationAmount + j) * 6;

            // This mesh consists of pairs of triangles forming squares. Each square contains
            // six vertices, three for each triangle. 'offset' represents the distance between each vertice
            // in the triangles. In this mesh, we only set the x and y coordinates of the vertices, since
            // they are the only variable part of the geometry. In the vertex shader, z is generated
            // based on x, and w is defined to be '1'. The actual coordinates here range from 0 to 1,
            // these values are scaled up based on the size of the image in the vertex shader.

            mesh[index].x     = i * offset;
            mesh[index].y     = j * offset;
            mesh[index + 1].x = i * offset;
            mesh[index + 1].y = j * offset + offset;
            mesh[index + 2].x = i * offset + offset;
            mesh[index + 2].y = j * offset;
            mesh[index + 3].x = i * offset + offset;
            mesh[index + 3].y = j * offset;
            mesh[index + 4].x = i * offset;
            mesh[index + 4].y = j * offset + offset;
            mesh[index + 5].x = i * offset + offset;
            mesh[index + 5].y = j * offset + offset;
        }
    }

    *ppMesh = mesh;

    return S_OK;
}

float GetSkewX ( ) const

Definition at line 265 of file WaveEffect.cpp.

{
    return m_skewX;
}

float GetSkewY ( ) const

Definition at line 270 of file WaveEffect.cpp.

{
    return m_skewY;
}

float GetWaveOffset ( ) const

Definition at line 275 of file WaveEffect.cpp.

{
    return m_waveOffset;
}

IFACEMETHODIMP_ ( UINT32 ) const [inline]

Definition at line 89 of file WaveEffect.h.

{ return 1; }

IFACEMETHODIMP_ ( ULONG )
IFACEMETHODIMP_ ( ULONG )
HRESULT Initialize | ( | _In_ ID2D1EffectContext * | pEffectContext,
 |  | _In_ ID2D1TransformGraph * | pTransformGraph
 | ) |  |

Definition at line 113 of file WaveEffect.cpp.

{
    BasicReaderWriter^ reader = ref new BasicReaderWriter();

    // Read compiled shader data instructions. Visual Studio automatically generates
    // the cso (Compiled Shader Object) file at compile time from the HLSL.

    Platform::Array<unsigned char, 1U>^ data;

    try
    {
        data = reader->ReadData("WaveEffect.cso");
    }
    catch (Platform::Exception^ e)
    {
        // Return error if file can not be read.
        return e->HResult;
    }

    HRESULT hr = pEffectContext->LoadVertexShader(GUID_WaveTransformVertexShader, data->Data, data->Length);

    if (SUCCEEDED(hr))
    {
        // Only generate the vertex buffer if it has not already been initialized.
        pEffectContext->FindVertexBuffer(&GUID_WaveTransformVertexBuffer, &m_vertexBuffer);
        if (m_vertexBuffer == nullptr)
        {
            Vertex* mesh = nullptr;
            hr = GenerateMesh(&mesh);

            if (SUCCEEDED(hr))
            {
                // Updating geometry every time the effect is rendered can be costly, so it is
                // recommended that vertex buffer remain static if possible (which it is in this
                // sample effect).
                D2D1_VERTEX_BUFFER_PROPERTIES vbProp = {0};
                vbProp.byteWidth = sizeof(Vertex) * m_numVertices;
                vbProp.data = reinterpret_cast<BYTE*>(mesh);
                vbProp.inputCount = 1;
                vbProp.usage =  D2D1_VERTEX_USAGE_STATIC;

                static const D2D1_INPUT_ELEMENT_DESC vertexLayout[] =
                {
                    {"MESH_POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0},
                };

                D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES cvbProp = {0};
                cvbProp.elementCount = ARRAYSIZE(vertexLayout);
                cvbProp.inputElements = vertexLayout;
                cvbProp.stride = sizeof(Vertex);
                cvbProp.shaderBufferWithInputSignature = data->Data;
                cvbProp.shaderBufferSize = data->Length;

                // The GUID is optional, and is provided here to register the geometry globally.
                // As mentioned above, this avoids duplication if multiple versions of the effect
                // are created.
                hr = pEffectContext->CreateVertexBuffer(
                    &vbProp,
                    &GUID_WaveTransformVertexBuffer,
                    &cvbProp,
                    &m_vertexBuffer
                    );
            }

            // Since mesh has already been transferred to GPU, it can be removed.
            delete[] mesh;
        }
    }

    hr = pTransformGraph->SetSingleTransformNode(this);

    return hr;
}

IFACEMETHODIMP MapInputRectsToOutputRect | ( | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputRects,
 |  | _In_reads_(inputRectCount) CONST D2D1_RECT_L * | pInputOpaqueSubRects,
 |  | UINT32 | inputRectCount,
 |  | _Out_ D2D1_RECT_L * | pOutputRect,
 |  | _Out_ D2D1_RECT_L * | pOutputOpaqueSubRect
 | ) |  |

Definition at line 312 of file WaveEffect.cpp.

{
    HRESULT hr = S_OK;

    if (inputRectCount != 1)
    {
        return E_FAIL;
    }

    m_inputRect = pInputRects[0];

    // Store the size of the rect so we can pass it into the vertex shader later.
    int newSizeX = pInputRects[0].right - pInputRects[0].left;
    int newSizeY = pInputRects[0].bottom - pInputRects[0].top;

    if (m_sizeX != newSizeX || m_sizeY != newSizeY)
    {
        m_sizeX = static_cast<float>(newSizeX);
        m_sizeY = static_cast<float>(newSizeY);
        hr = UpdateConstants();
    }

    if (SUCCEEDED(hr))
    {
        // Based on how the vertex shader is deforming the image, we can adjust the output rect to
        // avoid unnecessary rendering/blending. While simply setting the output rect to the input
        // rect is the simplest solution, there will be rendering errors if the custom effect is
        // subsequently transformed such that content that was previously outside screen bounds
        // should now be visible (i.e. a translation). If no geometric transformation is done to
        // an image, the outputRect can simply be assigned to the inputRect (*outputRect = m_inputRect)

        long inputRectHeight = m_inputRect.bottom - m_inputRect.top;
        long inputRectWidth = m_inputRect.right - m_inputRect.left;

        // These values are based on the transforms done in the vertex shader itself.

        // SkewOffset is the point where the wave is perpendicular to the screen.
        if (m_skewY > SkewOffset)
        {
            pOutputRect->top    = static_cast<long>(m_inputRect.top +    (inputRectHeight * WaveMarginTop) - WaveHeight);
            pOutputRect->bottom = static_cast<long>(m_inputRect.bottom - (inputRectHeight * WaveMarginBottom) + WaveHeight + (inputRectHeight * m_skewY));
        }
        else
        {
            pOutputRect->top    = static_cast<long>(m_inputRect.top + (inputRectHeight * WaveMarginTop) - WaveHeight + (inputRectHeight * (m_skewY - SkewOffset)));
            pOutputRect->bottom = static_cast<long>(m_inputRect.top + (inputRectHeight * WaveMarginTop) + WaveHeight);
        }

        if (m_skewX > 0)
        {
            pOutputRect->left  = static_cast<long>(m_inputRect.left   + (inputRectWidth * WaveMarginLeft));
            pOutputRect->right = static_cast<long>(m_inputRect.right  - (inputRectWidth * WaveMarginRight) + (inputRectWidth * m_skewX));
        }
        else
        {
            pOutputRect->left  = static_cast<long>(m_inputRect.left  + (inputRectWidth * WaveMarginLeft) + (inputRectWidth * m_skewX));
            pOutputRect->right = static_cast<long>(m_inputRect.right - (inputRectWidth * WaveMarginRight));
        }

        // Indicate that entire output might contain transparency
        ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));
    }

    return hr;
}

IFACEMETHODIMP MapInvalidRect | ( | UINT32 | inputIndex,
 |  | D2D1_RECT_L | invalidInputRect,
 |  | _Out_ D2D1_RECT_L * | pInvalidOutputRect |
 | ) |  |  | const

Definition at line 384 of file WaveEffect.cpp.

{
    // Indicate that the entire output may be invalid.
    *pInvalidOutputRect = m_inputRect;

    return S_OK;
}

IFACEMETHODIMP MapOutputRectToInputRects | ( | _In_ const D2D1_RECT_L * | pOutputRect,
 |  | _Out_writes_(inputRectCount) D2D1_RECT_L * | pInputRects,
 |  | UINT32 | inputRectCount |
 | ) |  |  | const

Definition at line 296 of file WaveEffect.cpp.

{
    if (inputRectCount != 1)
    {
        return E_FAIL;
    }

    pInputRects[0] = m_inputRect;

    return S_OK;
}

IFACEMETHODIMP PrepareForRender ( D2D1_CHANGE_TYPE changeType )

Definition at line 237 of file WaveEffect.cpp.

{
    return UpdateConstants();
}

IFACEMETHODIMP QueryInterface | ( | _In_ REFIID | riid,
 |  | _Outptr_ void ** | ppOutput
 | ) |  |

Definition at line 442 of file WaveEffect.cpp.

{
    *ppOutput = nullptr;
    HRESULT hr = S_OK;

    if (riid == __uuidof(ID2D1EffectImpl))
    {
        *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
    }
    else if (riid == __uuidof(ID2D1DrawTransform))
    {
        *ppOutput = static_cast<ID2D1DrawTransform*>(this);
    }
    else if (riid == __uuidof(ID2D1Transform))
    {
        *ppOutput = static_cast<ID2D1Transform*>(this);
    }
    else if (riid == __uuidof(ID2D1TransformNode))
    {
        *ppOutput = static_cast<ID2D1TransformNode*>(this);
    }
    else if (riid == __uuidof(IUnknown))
    {
        *ppOutput = this;
    }
    else
    {
        hr = E_NOINTERFACE;
    }

    if (*ppOutput != nullptr)
    {
        AddRef();
    }

    return hr;
}

HRESULT Register ( _In_ ID2D1Factory1 * pFactory ) [static]

Definition at line 41 of file WaveEffect.cpp.

{
    PCWSTR propertyXml =
        XML(
            <?xml version='1.0'?>
            <Effect>
                <!-- System Properties -->
                <Property name='DisplayName' type='string' value='Wave Effect'/>
                <Property name='Author' type='string' value='Microsoft Corporation'/>
                <Property name='Category' type='string' value='Sample'/>
                <Property name='Description' type='string' value='Animation of a wave.'/>
                <Inputs>
                    <Input name='Source'/>
                </Inputs>
                <!-- Effect-specific Properties -->
                <Property name='WaveOffset' type='float' value='0'>
                    <Property name='DisplayName' type='string' value='Wave Offset'/>
                    <Property name='Default' type='float' value='0.0'/>
                </Property>
                <Property name='SkewX' type='float' value='0'>
                    <Property name='DisplayName' type='string' value='Skew (X-Axis)'/>
                    <Property name='Min' type='float' value='-5.0'/>
                    <Property name='Max' type='float' value='5.0'/>
                    <Property name='Default' type='float' value='0.0'/>
                </Property>
                <Property name='SkewY' type='float' value='0'>
                    <Property name='DisplayName' type='string' value='Skew (Y-Axis)'/>
                    <Property name='Min' type='float' value='-5.0'/>
                    <Property name='Max' type='float' value='5.0'/>
                    <Property name='Default' type='float' value='0.0'/>
                </Property>
            </Effect>
            );

    // Property bindings are performed automatically for the system properties.
    // For effect-specific properties (i.e. WaveOffset), you must direct
    // Direct2D to the specific method in your implementation for manipulating
    // the property. This is done by assigning each property a 'setter' and 'getter'
    // in this table. Direct2D provides a set of helpers for doing this in
    // D2D1EffectHelpers.h, such as D2D1_VALUE_TYPE_BINDING used here.
    D2D1_PROPERTY_BINDING bindings[] =
    {
        D2D1_VALUE_TYPE_BINDING(L"WaveOffset",  &SetWaveOffset,  &GetWaveOffset),
        D2D1_VALUE_TYPE_BINDING(L"SkewX",  &SetSkewX,  &GetSkewX),
        D2D1_VALUE_TYPE_BINDING(L"SkewY",  &SetSkewY,  &GetSkewY)
    };

    // Register the effect using the data defined above.
    return pFactory->RegisterEffectFromString(
        CLSID_CustomWaveEffect,
        propertyXml,
        bindings,
        ARRAYSIZE(bindings),
        CreateWaveImpl
        );
}

IFACEMETHODIMP SetDrawInfo ( _In_ ID2D1DrawInfo * pDrawInfo )

Definition at line 396 of file WaveEffect.cpp.

{
    m_drawInfo = pDrawInfo;

    D2D1_VERTEX_RANGE range;
    range.startVertex = 0;
    range.vertexCount = m_numVertices;

    return m_drawInfo->SetVertexProcessing(
        m_vertexBuffer.Get(),
        D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER,
        nullptr, // Setting the blend description to nullptr draws the geometry using a simple source-over blend.
        &range,
        &GUID_WaveTransformVertexShader
        );
}

IFACEMETHODIMP SetGraph ( _In_ ID2D1TransformGraph * pTransformGraph ) [inline]

Definition at line 58 of file WaveEffect.h.

    {
        return E_NOTIMPL; // There's no need to implement this on effects with static input counts.
    }

HRESULT SetSkewX ( float skew )

Definition at line 246 of file WaveEffect.cpp.

{
    m_skewX = Clamp(skew, -5.0f, 5.0f);
    return S_OK;
}

HRESULT SetSkewY ( float skew )

Definition at line 252 of file WaveEffect.cpp.

{
    m_skewY = Clamp(skew, -5.0f, 5.0f);
    return S_OK;
}

HRESULT SetWaveOffset ( float waveOffset )

Definition at line 259 of file WaveEffect.cpp.

{
    m_waveOffset = waveOffset;
    return S_OK;
}

HRESULT UpdateConstants ( ) [private]

Definition at line 280 of file WaveEffect.cpp.

{
    // Update constant buffer 1 (the first constant buffer available to the effect)
    // with the progress, skew, and size values.

    m_constants.matrix = D2D1::Matrix4x4F::RotationX(3);
    m_constants.sizeX = m_sizeX;
    m_constants.sizeY = m_sizeY;
    m_constants.waveOffset = m_waveOffset;
    m_constants.skewX = m_skewX;
    m_constants.skewY = m_skewY;

    return m_drawInfo->SetVertexShaderConstantBuffer(reinterpret_cast<const BYTE*>(&m_constants), sizeof(m_constants));

}

Member Data Documentation

struct { ... } m_constants [private]
Microsoft::WRL::ComPtr<ID2D1DrawInfo> m_drawInfo [private]

Definition at line 124 of file WaveEffect.h.

D2D_RECT_L m_inputRect [private]

Definition at line 126 of file WaveEffect.h.

UINT m_numVertices [private]

Definition at line 125 of file WaveEffect.h.

LONG m_refCount [private]

Definition at line 128 of file WaveEffect.h.

float m_sizeX [private]

Definition at line 118 of file WaveEffect.h.

float m_sizeY [private]

Definition at line 119 of file WaveEffect.h.

float m_skewX [private]

Definition at line 120 of file WaveEffect.h.

float m_skewY [private]

Definition at line 121 of file WaveEffect.h.

Microsoft::WRL::ComPtr<ID2D1VertexBuffer> m_vertexBuffer [private]

Definition at line 123 of file WaveEffect.h.

float m_waveOffset [private]

Definition at line 117 of file WaveEffect.h.

D2D_MATRIX_4X4_F matrix

Definition at line 133 of file WaveEffect.h.

float sizeX

Definition at line 134 of file WaveEffect.h.

float sizeY

Definition at line 135 of file WaveEffect.h.

float skewX

Definition at line 137 of file WaveEffect.h.

float skewY

Definition at line 138 of file WaveEffect.h.

float waveOffset

Definition at line 136 of file WaveEffect.h.

The documentation for this class was generated from the following files:
  • D2DCustomEffects/cpp/VertexShader/WaveEffect.h
  • D2DCustomEffects/cpp/VertexShader/WaveEffect.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WaveEffect::Vertex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WaveEffect
  • WaveEffect::Vertex
Public Attributes

WaveEffect::Vertex Struct Reference

List of all members.

Public Attributes

float | x
float | y

Detailed Description

Definition at line 104 of file WaveEffect.h.

Member Data Documentation

float x

Definition at line 106 of file WaveEffect.h.

float y

Definition at line 107 of file WaveEffect.h.

The documentation for this struct was generated from the following file:
  • D2DCustomEffects/cpp/VertexShader/WaveEffect.h
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Facebook Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WebAuthentication
  • Scenario1_Facebook
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Facebook Class Reference

List of all members.

Public Member Functions

Scenario1_Facebook ()

Private Member Functions

async Task | GetFacebookUserNameAsync (string responseData)
async void | Launch_Click (object sender, RoutedEventArgs e)

Private Attributes

bool | authzInProgress = false
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 24 of file Scenario1_Facebook.xaml.cs.

Constructor & Destructor Documentation

Scenario1_Facebook ( ) [inline]

Definition at line 29 of file Scenario1_Facebook.xaml.cs.

        {
            this.InitializeComponent();

            // Use these SIDs to register the app with Facebook.
            WindowsStoreSidTextBlock.Text = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().Host;
            WindowsPhoneStoreSidTextBlock.Text = "feaebe20-b974-4857-a51c-3525e4dfe2a8"; // copied from Package.appxmanifest
        }

Member Function Documentation

async Task GetFacebookUserNameAsync ( string responseData ) [inline, private]

This function extracts access_token from the response returned from web authentication broker and uses that token to get user information using facebook graph api.

Parameters:
responseData responseData returned from AuthenticateAsync result.

Definition at line 97 of file Scenario1_Facebook.xaml.cs.

        {
            var decoder = new WwwFormUrlDecoder(responseData);
            var error = decoder.TryGetValue("error");
            if (error != null)
            {
                FacebookUserName.Text = $"Error: {error}";
                return;
            }

            // You can store access token locally for further use.
            string access_token = decoder.GetFirstValueByName("access_token");
            string expires_in = decoder.TryGetValue("expires_in"); // expires_in is optional

            HttpClient httpClient = new HttpClient();
            Uri uri = new Uri($"https://graph.facebook.com/me?access_token={Uri.EscapeDataString(access_token)}");

            HttpGetStringResult result = await httpClient.TryGetStringAsync(uri);
            if (result.Succeeded)
            {
                JsonObject userInfo = JsonObject.Parse(result.Value).GetObject();
                FacebookUserName.Text = userInfo.GetNamedString("name");
            }
            else
            {
                FacebookUserName.Text = "Error contacting Facebook";
            }
        }

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file Scenario1_Facebook.xaml.cs.

        {
            if (authzInProgress)
            {
                return;
            }

            FacebookReturnedToken.Text = "";
            FacebookUserName.Text = "";

            if (String.IsNullOrEmpty(FacebookClientID.Text))
            {
                rootPage.NotifyUser("Please enter a Client ID.", NotifyType.StatusMessage);
                return;
            }

            Uri callbackUri;
            if (!Uri.TryCreate(FacebookCallbackUrl.Text, UriKind.Absolute, out callbackUri))
            {
                rootPage.NotifyUser("Please enter a Callback URL.", NotifyType.StatusMessage);
                return;
            }

            Uri facebookStartUri = new Uri($"https://www.facebook.com/dialog/oauth?client_id={Uri.EscapeDataString(FacebookClientID.Text)}&redirect_uri={Uri.EscapeDataString(callbackUri.AbsoluteUri)}&scope=email&display=popup&response_type=token");

            rootPage.NotifyUser($"Navigating to {facebookStartUri}", NotifyType.StatusMessage);

            authzInProgress = true;
            try
            {
                WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, facebookStartUri, callbackUri);
                if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
                {
                    FacebookReturnedToken.Text = WebAuthenticationResult.ResponseData;
                    await GetFacebookUserNameAsync(WebAuthenticationResult.ResponseData);
                }
                else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
                {
                    FacebookReturnedToken.Text = $"HTTP error: {WebAuthenticationResult.ResponseErrorDetail}";
                }
                else
                {
                    FacebookReturnedToken.Text = $"Error: {WebAuthenticationResult.ResponseStatus}";
                }

            }
            catch (Exception Error)
            {
                rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
            }

            authzInProgress = false;
        }

Member Data Documentation

bool authzInProgress = false [private]

Definition at line 27 of file Scenario1_Facebook.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 26 of file Scenario1_Facebook.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAuthenticationBroker/cs/Scenario1_Facebook.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Twitter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WebAuthentication
  • Scenario2_Twitter
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Twitter Class Reference

List of all members.

Public Member Functions

Scenario2_Twitter ()

Private Member Functions

string | GetNonce ()
string | GetSignature (string sigBaseString, string consumerSecretKey)
string | GetTimeStamp ()
async Task< string > | GetTwitterRequestTokenAsync (string twitterCallbackUrl, string consumerKey)
async Task | GetTwitterUserNameAsync (string webAuthResultResponseData)
async void | Launch_Click (object sender, RoutedEventArgs e)
void | OutputToken (String TokenUri)
async Task< String > | SendDataAsync (String Url)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 26 of file Scenario2_Twitter.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Twitter ( ) [inline]

Definition at line 30 of file Scenario2_Twitter.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

string GetNonce ( ) [inline, private]

Definition at line 229 of file Scenario2_Twitter.xaml.cs.

        {
            Random rand = new Random();
            int nonce = rand.Next(1000000000);
            return nonce.ToString();
        }

string GetSignature | ( | string | sigBaseString,
 |  | string | consumerSecretKey |
 | ) |  |  | [inline, private]

Definition at line 242 of file Scenario2_Twitter.xaml.cs.

        {
            IBuffer KeyMaterial = CryptographicBuffer.ConvertStringToBinary(consumerSecretKey + "&", BinaryStringEncoding.Utf8);
            MacAlgorithmProvider HmacSha1Provider = MacAlgorithmProvider.OpenAlgorithm("HMAC_SHA1");
            CryptographicKey MacKey = HmacSha1Provider.CreateKey(KeyMaterial);
            IBuffer DataToBeSigned = CryptographicBuffer.ConvertStringToBinary(sigBaseString, BinaryStringEncoding.Utf8);
            IBuffer SignatureBuffer = CryptographicEngine.Sign(MacKey, DataToBeSigned);
            string Signature = CryptographicBuffer.EncodeToBase64String(SignatureBuffer);

            return Signature;
        }

string GetTimeStamp ( ) [inline, private]

Definition at line 236 of file Scenario2_Twitter.xaml.cs.

        {
            TimeSpan SinceEpoch = DateTime.UtcNow - new DateTime(1970, 1, 1);
            return Math.Round(SinceEpoch.TotalSeconds).ToString();
        }

async Task<string> GetTwitterRequestTokenAsync | ( | string | twitterCallbackUrl,
 |  | string | consumerKey |
 | ) |  |  | [inline, private]

Definition at line 185 of file Scenario2_Twitter.xaml.cs.

        {
            // Acquiring a request token
            string TwitterUrl = "https://api.twitter.com/oauth/request_token";

            string nonce = GetNonce();
            string timeStamp = GetTimeStamp();
            string SigBaseStringParams = "oauth_callback=" + Uri.EscapeDataString(twitterCallbackUrl);
            SigBaseStringParams += "&" + "oauth_consumer_key=" + consumerKey;
            SigBaseStringParams += "&" + "oauth_nonce=" + nonce;
            SigBaseStringParams += "&" + "oauth_signature_method=HMAC-SHA1";
            SigBaseStringParams += "&" + "oauth_timestamp=" + timeStamp;
            SigBaseStringParams += "&" + "oauth_version=1.0";
            string SigBaseString = "GET&";
            SigBaseString += Uri.EscapeDataString(TwitterUrl) + "&" + Uri.EscapeDataString(SigBaseStringParams);
            string Signature = GetSignature(SigBaseString, TwitterClientSecret.Text);

            TwitterUrl += "?" + SigBaseStringParams + "&oauth_signature=" + Uri.EscapeDataString(Signature);
            HttpClient httpClient = new HttpClient();
            string request_token = null;

            HttpGetStringResult result = await httpClient.TryGetStringAsync(new Uri(TwitterUrl));
            if (result.Succeeded)
            {
                string oauth_token_secret = null;
                string[] keyValPairs = result.Value.Split('&');

                for (int i = 0; i < keyValPairs.Length; i++)
                {
                    string[] splits = keyValPairs[i].Split('=');
                    switch (splits[0])
                    {
                        case "oauth_token":
                            request_token = splits[1];
                            break;
                        case "oauth_token_secret":
                            oauth_token_secret = splits[1];
                            break;
                    }
                }
            }
            return request_token;
        }

async Task GetTwitterUserNameAsync ( string webAuthResultResponseData ) [inline, private]

Definition at line 97 of file Scenario2_Twitter.xaml.cs.

        {
            // Acquiring a access_token first
            string responseData = webAuthResultResponseData.Substring(webAuthResultResponseData.IndexOf("oauth_token"));
            string request_token = null;
            string oauth_verifier = null;
            String[] keyValPairs = responseData.Split('&');

            for (int i = 0; i < keyValPairs.Length; i++)
            {
                String[] splits = keyValPairs[i].Split('=');
                switch (splits[0])
                {
                    case "oauth_token":
                        request_token = splits[1];
                        break;
                    case "oauth_verifier":
                        oauth_verifier = splits[1];
                        break;
                }
            }

            String TwitterUrl = "https://api.twitter.com/oauth/access_token";

            string timeStamp = GetTimeStamp();
            string nonce = GetNonce();

            String SigBaseStringParams = "oauth_consumer_key=" + TwitterClientID.Text;
            SigBaseStringParams += "&" + "oauth_nonce=" + nonce;
            SigBaseStringParams += "&" + "oauth_signature_method=HMAC-SHA1";
            SigBaseStringParams += "&" + "oauth_timestamp=" + timeStamp;
            SigBaseStringParams += "&" + "oauth_token=" + request_token;
            SigBaseStringParams += "&" + "oauth_version=1.0";
            String SigBaseString = "POST&";
            SigBaseString += Uri.EscapeDataString(TwitterUrl) + "&" + Uri.EscapeDataString(SigBaseStringParams);

            String Signature = GetSignature(SigBaseString, TwitterClientSecret.Text);

            HttpStringContent httpContent = new HttpStringContent("oauth_verifier=" + oauth_verifier, Windows.Storage.Streams.UnicodeEncoding.Utf8);
            httpContent.Headers.ContentType = HttpMediaTypeHeaderValue.Parse("application/x-www-form-urlencoded");
            string authorizationHeaderParams = "oauth_consumer_key=\"" + TwitterClientID.Text + "\", oauth_nonce=\"" + nonce + "\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"" + Uri.EscapeDataString(Signature) + "\", oauth_timestamp=\"" + timeStamp + "\", oauth_token=\"" + Uri.EscapeDataString(request_token) + "\", oauth_version=\"1.0\"";

            HttpClient httpClient = new HttpClient();

            httpClient.DefaultRequestHeaders.Authorization = new HttpCredentialsHeaderValue("OAuth", authorizationHeaderParams);
            HttpRequestResult result = await httpClient.TryPostAsync(new Uri(TwitterUrl), httpContent);
            if (result.Succeeded)
            {
                string response = await result.ResponseMessage.Content.ReadAsStringAsync();

                String[] Tokens = response.Split('&');
                string oauth_token_secret = null;
                string access_token = null;
                string screen_name = null;

                for (int i = 0; i < Tokens.Length; i++)
                {
                    String[] splits = Tokens[i].Split('=');
                    switch (splits[0])
                    {
                        case "screen_name":
                            screen_name = splits[1];
                            break;
                        case "oauth_token":
                            access_token = splits[1];
                            break;
                        case "oauth_token_secret":
                            oauth_token_secret = splits[1];
                            break;
                    }
                }

                if (access_token != null)
                {
                    // Store access_token for futher use (e.g., account management).
                }

                if (oauth_token_secret != null)
                {
                    // Store oauth_token_secret for further use (e.g., account management).
                }
                if (screen_name != null)
                {
                    rootPage.NotifyUser(screen_name + " is connected!", NotifyType.StatusMessage);
                }
            }
        }

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 55 of file Scenario2_Twitter.xaml.cs.

        {
            if (TwitterClientID.Text == "")
            {
                rootPage.NotifyUser("Please enter an Client ID.", NotifyType.StatusMessage);
            }
            else if (TwitterCallbackUrl.Text == "")
            {
                rootPage.NotifyUser("Please enter an Callback URL.", NotifyType.StatusMessage);
            }
            else if (TwitterClientSecret.Text == "")
            {
                rootPage.NotifyUser("Please enter an Client Secret.", NotifyType.StatusMessage);
            }

            string oauth_token = await GetTwitterRequestTokenAsync(TwitterCallbackUrl.Text, TwitterClientID.Text);
            if (String.IsNullOrEmpty(oauth_token))
            {
                rootPage.NotifyUser("Unable to obtain oauth token.", NotifyType.StatusMessage);
                return;
            }

            string TwitterUrl = "https://api.twitter.com/oauth/authorize?oauth_token=" + oauth_token;
            System.Uri StartUri = new Uri(TwitterUrl);
            System.Uri EndUri = new Uri(TwitterCallbackUrl.Text);

            WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, StartUri, EndUri);
            if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
            {
                OutputToken(WebAuthenticationResult.ResponseData.ToString());
                await GetTwitterUserNameAsync(WebAuthenticationResult.ResponseData.ToString());
            }
            else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
            {
                OutputToken("HTTP Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseErrorDetail.ToString());
            }
            else
            {
                OutputToken("Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseStatus.ToString());
            }
        }

void OutputToken ( String TokenUri ) [inline, private]

Definition at line 50 of file Scenario2_Twitter.xaml.cs.

        {
            TwitterReturnedToken.Text = TokenUri;
        }

async Task<String> SendDataAsync ( String Url ) [inline, private]

Definition at line 35 of file Scenario2_Twitter.xaml.cs.

        {
            HttpClient httpClient = new HttpClient();
            HttpGetStringResult result = await httpClient.TryGetStringAsync(new Uri(Url));
            if (result.Succeeded)
            {
                return result.Value;
            }
            else
            {
                rootPage.NotifyUser("Error getting data from server." + result.ExtendedError.Message, NotifyType.StatusMessage);
                return null;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 28 of file Scenario2_Twitter.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAuthenticationBroker/cs/Scenario2_Twitter.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Flickr Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WebAuthentication
  • Scenario3_Flickr
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_Flickr Class Reference

List of all members.

Public Member Functions

Scenario3_Flickr ()

Private Member Functions

async void | Launch_Click (object sender, RoutedEventArgs e)
void | OutputToken (String TokenUri)
async Task< string > | SendDataAsync (String Url)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 25 of file Scenario3_Flickr.xaml.cs.

Constructor & Destructor Documentation

Scenario3_Flickr ( ) [inline]

Definition at line 29 of file Scenario3_Flickr.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Launch_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 54 of file Scenario3_Flickr.xaml.cs.

        {
            if (FlickrClientID.Text == "")
            {
                rootPage.NotifyUser("Please enter an Client ID.", NotifyType.StatusMessage);
            }
            else if (FlickrCallbackUrl.Text == "")
            {
                rootPage.NotifyUser("Please enter an Callback URL.", NotifyType.StatusMessage);
            }
            else if (FlickrClientSecret.Text == "")
            {
                rootPage.NotifyUser("Please enter an Client Secret.", NotifyType.StatusMessage);
            }

            try
            {
                // Acquiring a request token
                TimeSpan SinceEpoch = DateTime.UtcNow - new DateTime(1970, 1, 1);
                Random Rand = new Random();
                String FlickrUrl = "https://secure.flickr.com/services/oauth/request_token";
                Int32 Nonce = Rand.Next(1000000000);

                // Compute base signature string and sign it.
                // This is a common operation that is required for all requests even after the token is obtained.
                // Parameters need to be sorted in alphabetical order
                // Keys and values should be URL Encoded.
                String SigBaseStringParams = "oauth_callback=" + Uri.EscapeDataString(FlickrCallbackUrl.Text);
                SigBaseStringParams += "&" + "oauth_consumer_key=" + FlickrClientID.Text;
                SigBaseStringParams += "&" + "oauth_nonce=" + Nonce.ToString();
                SigBaseStringParams += "&" + "oauth_signature_method=HMAC-SHA1";
                SigBaseStringParams += "&" + "oauth_timestamp=" + Math.Round(SinceEpoch.TotalSeconds);
                SigBaseStringParams += "&" + "oauth_version=1.0";
                String SigBaseString = "GET&";
                SigBaseString += Uri.EscapeDataString(FlickrUrl) + "&" + Uri.EscapeDataString(SigBaseStringParams);

                IBuffer KeyMaterial = CryptographicBuffer.ConvertStringToBinary(FlickrClientSecret.Text + "&", BinaryStringEncoding.Utf8);
                MacAlgorithmProvider HmacSha1Provider = MacAlgorithmProvider.OpenAlgorithm("HMAC_SHA1");
                CryptographicKey MacKey = HmacSha1Provider.CreateKey(KeyMaterial);
                IBuffer DataToBeSigned = CryptographicBuffer.ConvertStringToBinary(SigBaseString, BinaryStringEncoding.Utf8);
                IBuffer SignatureBuffer = CryptographicEngine.Sign(MacKey, DataToBeSigned);
                String Signature = CryptographicBuffer.EncodeToBase64String(SignatureBuffer);

                FlickrUrl += "?" + SigBaseStringParams + "&oauth_signature=" + Uri.EscapeDataString(Signature);
                string GetResponse = await SendDataAsync(FlickrUrl);
                rootPage.NotifyUser("Received Data: " + GetResponse, NotifyType.StatusMessage);

                if (GetResponse != null)
                {
                    String oauth_token = null;
                    String oauth_token_secret = null;
                    String[] keyValPairs = GetResponse.Split('&');

                    for (int i = 0; i < keyValPairs.Length; i++)
                    {
                        String[] splits = keyValPairs[i].Split('=');
                        switch (splits[0])
                        {
                            case "oauth_token":
                                oauth_token = splits[1];
                                break;
                            case "oauth_token_secret":
                                oauth_token_secret = splits[1];
                                break;
                        }
                    }

                    if (oauth_token != null)
                    {

                        FlickrUrl = "https://secure.flickr.com/services/oauth/authorize?oauth_token=" + oauth_token + "&perms=read";
                        System.Uri StartUri = new Uri(FlickrUrl);
                        System.Uri EndUri = new Uri(FlickrCallbackUrl.Text);

                        rootPage.NotifyUser("Navigating to: " + FlickrUrl, NotifyType.StatusMessage);
                        WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
                                                                WebAuthenticationOptions.None,
                                                                StartUri,
                                                                EndUri);
                        if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
                        {
                            OutputToken(WebAuthenticationResult.ResponseData.ToString());
                        }
                        else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
                        {
                            OutputToken("HTTP Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseErrorDetail.ToString());
                        }
                        else
                        {
                            OutputToken("Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseStatus.ToString());
                        }
                    }
                }
            }
            catch (Exception Error)
            {
                rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
            }
        }

void OutputToken ( String TokenUri ) [inline, private]

Definition at line 49 of file Scenario3_Flickr.xaml.cs.

        {
            FlickrReturnedToken.Text = TokenUri;
        }

async Task<string> SendDataAsync ( String Url ) [inline, private]

Definition at line 34 of file Scenario3_Flickr.xaml.cs.

        {
            HttpClient httpClient = new HttpClient();
            HttpGetStringResult result = await httpClient.TryGetStringAsync(new Uri(Url));
            if (result.Succeeded)
            {
                return result.Value;
            }
            else
            {
                rootPage.NotifyUser("Error getting data from server." + result.ExtendedError.Message, NotifyType.StatusMessage);
                return null;
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 27 of file Scenario3_Flickr.xaml.cs.

The documentation for this class was generated from the following file:
  • WebAuthenticationBroker/cs/Scenario3_Flickr.xaml.cs
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WICConvert Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

WICConvert Struct Reference

List of all members.

Public Attributes

GUID | source
GUID | target

Detailed Description

Definition at line 60 of file DirectXHelper.cpp.

Member Data Documentation

GUID source

Definition at line 62 of file DirectXHelper.cpp.

GUID target

Definition at line 63 of file DirectXHelper.cpp.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Common/DirectXHelper.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WICTranslate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Attributes

WICTranslate Struct Reference

List of all members.

Public Attributes

DXGI_FORMAT | format
GUID | wic

Detailed Description

Definition at line 23 of file DirectXHelper.cpp.

Member Data Documentation

DXGI_FORMAT format

Definition at line 26 of file DirectXHelper.cpp.

GUID wic

Definition at line 25 of file DirectXHelper.cpp.

The documentation for this struct was generated from the following file:
  • HolographicMixedRealityCapture/cpp/Common/DirectXHelper.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CachedNetworks Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WiFiScan
  • Scenario1_CachedNetworks
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario1_CachedNetworks Class Reference

List of all members.

Public Member Functions

Scenario1_CachedNetworks ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< WiFiNetworkDisplay > 		ResultCollection [get, set]

Private Member Functions

void | Button_Click (object sender, RoutedEventArgs e)
async void | DisplayNetworkReport (WiFiNetworkReport report, WiFiAdapter adapter)

Private Attributes

MainPage rootPage
IReadOnlyList< WiFiAdapter > | wiFiAdapters

Detailed Description

Definition at line 23 of file Scenario1_CachedNetworks.xaml.cs.

Constructor & Destructor Documentation

Scenario1_CachedNetworks ( ) [inline]

Definition at line 33 of file Scenario1_CachedNetworks.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 68 of file Scenario1_CachedNetworks.xaml.cs.

        {
            var button = (Button)sender;
            var index = (int)button.Tag;

            // Accessing the NetworkReport property from the WiFiAdapter does not trigger any scans.
            // The NetworkReport will have the report generated by the last scan on the system; the
            // scan need not be generated by the app.
            DisplayNetworkReport(wiFiAdapters[index].NetworkReport, wiFiAdapters[index]);
        }

async void DisplayNetworkReport | ( | WiFiNetworkReport | report,
 |  | WiFiAdapter | adapter |
 | ) |  |  | [inline, private]

Definition at line 79 of file Scenario1_CachedNetworks.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);

            ResultCollection.Clear();

            foreach (var network in report.AvailableNetworks)
            {
                var networkDisplay = new WiFiNetworkDisplay(network, adapter);
                await networkDisplay.UpdateConnectivityLevel();
                ResultCollection.Add(networkDisplay);
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 38 of file Scenario1_CachedNetworks.xaml.cs.

        {
            ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
            rootPage = MainPage.Current;

            // RequestAccessAsync must have been called at least once by the app before using the API
            // Calling it multiple times is fine but not necessary
            // RequestAccessAsync must be called from the UI thread
            var result = await WiFiAdapter.RequestAccessAsync();
            if (result != WiFiAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
            }
            else
            {
                DataContext = this;

                wiFiAdapters = await WiFiAdapter.FindAllAdaptersAsync();
                int index = 0;
                foreach (var adapter in wiFiAdapters)
                {
                    var button = new Button();
                    button.Tag = index;
                    button.Content = String.Format("WiFi Adapter {0}", ++index);
                    button.Click += Button_Click;
                    Buttons.Children.Add(button);
                }
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 26 of file Scenario1_CachedNetworks.xaml.cs.

IReadOnlyList<WiFiAdapter> wiFiAdapters [private]

Definition at line 25 of file Scenario1_CachedNetworks.xaml.cs.

Property Documentation

ObservableCollection<WiFiNetworkDisplay> ResultCollection [get, set]

Definition at line 28 of file Scenario1_CachedNetworks.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiScan/cs/Scenario1_CachedNetworks.xaml.cs
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Scan Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WiFiScan
  • Scenario2_Scan
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario2_Scan Class Reference

List of all members.

Public Member Functions

Scenario2_Scan ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< WiFiNetworkDisplay > 		ResultCollection [get, set]

Private Member Functions

async void | Button_Click (object sender, RoutedEventArgs e)
async void | DisplayNetworkReport (WiFiNetworkReport report)

Private Attributes

WiFiAdapter | firstAdapter
MainPage rootPage

Detailed Description

Definition at line 22 of file Scenario2_Scan.xaml.cs.

Constructor & Destructor Documentation

Scenario2_Scan ( ) [inline]

Definition at line 32 of file Scenario2_Scan.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void Button_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 71 of file Scenario2_Scan.xaml.cs.

        {
            await firstAdapter.ScanAsync();
            DisplayNetworkReport(firstAdapter.NetworkReport);
        }

async void DisplayNetworkReport ( WiFiNetworkReport report ) [inline, private]

Definition at line 77 of file Scenario2_Scan.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);

            ResultCollection.Clear();

            foreach (var network in report.AvailableNetworks)
            {
                var networkDisplay = new WiFiNetworkDisplay(network, firstAdapter);
                await networkDisplay.UpdateConnectivityLevel();
                ResultCollection.Add(networkDisplay);
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 37 of file Scenario2_Scan.xaml.cs.

        {
            ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
            rootPage = MainPage.Current;

            // RequestAccessAsync must have been called at least once by the app before using the API
            // Calling it multiple times is fine but not necessary
            // RequestAccessAsync must be called from the UI thread
            var access = await WiFiAdapter.RequestAccessAsync();
            if (access != WiFiAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
            }
            else
            {
                DataContext = this;

                var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
                if (result.Count >= 1)
                {
                    firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);

                    var button = new Button();
                    button.Content = string.Format("Scan");
                    button.Click += Button_Click;
                    Buttons.Children.Add(button);
                }
                else
                {
                    rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

WiFiAdapter firstAdapter [private]

Definition at line 24 of file Scenario2_Scan.xaml.cs.

MainPage rootPage [private]

Definition at line 25 of file Scenario2_Scan.xaml.cs.

Property Documentation

ObservableCollection<WiFiNetworkDisplay> ResultCollection [get, set]

Definition at line 27 of file Scenario2_Scan.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiScan/cs/Scenario2_Scan.xaml.cs
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_RegisterForUpdates Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WiFiScan
  • Scenario3_RegisterForUpdates
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario3_RegisterForUpdates Class Reference

List of all members.

Public Member Functions

Scenario3_RegisterForUpdates ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< WiFiNetworkDisplay > 		ResultCollection [get, set]

Private Member Functions

void | Button_Click_Register (object sender, RoutedEventArgs e)
void | Button_Click_Unregister (object sender, RoutedEventArgs e)
async void | DisplayNetworkReport (WiFiNetworkReport report, WiFiAdapter adapter)
void | FirstAdapter_AvailableNetworksChanged (WiFiAdapter sender, object args)

Private Attributes

WiFiAdapter | firstAdapter
MainPage rootPage

Detailed Description

Definition at line 23 of file Scenario3_RegisterForUpdates.xaml.cs.

Constructor & Destructor Documentation

Scenario3_RegisterForUpdates ( ) [inline]

Definition at line 34 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void Button_Click_Register | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            firstAdapter.AvailableNetworksChanged += FirstAdapter_AvailableNetworksChanged;
            RegisterButton.IsEnabled = false;
            UnregisterButton.IsEnabled = true;
        }

void Button_Click_Unregister | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 98 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            firstAdapter.AvailableNetworksChanged -= FirstAdapter_AvailableNetworksChanged;
            UnregisterButton.IsEnabled = false;
            RegisterButton.IsEnabled = true;
        }

async void DisplayNetworkReport | ( | WiFiNetworkReport | report,
 |  | WiFiAdapter | adapter |
 | ) |  |  | [inline, private]

Definition at line 74 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);

                ResultCollection.Clear();

                foreach (var network in report.AvailableNetworks)
                {
                    var networkDisplay = new WiFiNetworkDisplay(network, adapter);
                    await networkDisplay.UpdateConnectivityLevel();
                    ResultCollection.Add(networkDisplay);
                }
            });
        }

void FirstAdapter_AvailableNetworksChanged | ( | WiFiAdapter | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 69 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            DisplayNetworkReport(sender.NetworkReport, sender);
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 39 of file Scenario3_RegisterForUpdates.xaml.cs.

        {
            ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
            rootPage = MainPage.Current;

            // RequestAccessAsync must have been called at least once by the app before using the API
            // Calling it multiple times is fine but not necessary
            // RequestAccessAsync must be called from the UI thread
            var access = await WiFiAdapter.RequestAccessAsync();
            if (access != WiFiAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
            }
            else
            {
                DataContext = this;

                var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
                if (result.Count >= 1)
                {
                    firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
                    RegisterButton.IsEnabled = true;
                }
                else
                {
                    rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
                }
            }
        }

Member Data Documentation

WiFiAdapter firstAdapter [private]

Definition at line 25 of file Scenario3_RegisterForUpdates.xaml.cs.

MainPage rootPage [private]

Definition at line 27 of file Scenario3_RegisterForUpdates.xaml.cs.

Property Documentation

ObservableCollection<WiFiNetworkDisplay> ResultCollection [get, set]

Definition at line 29 of file Scenario3_RegisterForUpdates.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiScan/cs/Scenario3_RegisterForUpdates.xaml.cs
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Connect Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WiFiScan
  • Scenario4_Connect
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes

Scenario4_Connect Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

Scenario4_Connect ()

Protected Member Functions

override async void | OnNavigatedTo (NavigationEventArgs e)

Properties

ObservableCollection
< WiFiNetworkDisplay > 		ResultCollection [get, set]

Private Member Functions

async void | ConnectButton_Click (object sender, RoutedEventArgs e)
void | DisconnectButton_Click (object sender, RoutedEventArgs e)
async void | DisplayNetworkReport (WiFiNetworkReport report)
async void | NetworkInformation_NetworkStatusChanged (object sender)
void | ResultsListView_SelectionChanged (object sender, SelectionChangedEventArgs e)
async void | ScanButton_Click (object sender, RoutedEventArgs e)
async Task | UpdateConnectivityStatusAsync ()

Private Attributes

WiFiAdapter | firstAdapter
MainPage rootPage
string | savedProfileName = null

Detailed Description

Definition at line 31 of file Scenario4_Connect.xaml.cs.

Constructor & Destructor Documentation

Scenario4_Connect ( ) [inline]

Definition at line 43 of file Scenario4_Connect.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void ConnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 172 of file Scenario4_Connect.xaml.cs.

        {
            var selectedNetwork = ResultsListView.SelectedItem as WiFiNetworkDisplay;
            if (selectedNetwork == null || firstAdapter == null)
            {
                rootPage.NotifyUser("Network not selcted", NotifyType.ErrorMessage);
                return;
            }
            WiFiReconnectionKind reconnectionKind = WiFiReconnectionKind.Manual;
            if (IsAutomaticReconnection.IsChecked.HasValue && IsAutomaticReconnection.IsChecked == true)
            {
                reconnectionKind = WiFiReconnectionKind.Automatic;
            }

            WiFiConnectionResult result;
            if (selectedNetwork.AvailableNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211 &&
                selectedNetwork.AvailableNetwork.SecuritySettings.NetworkEncryptionType == NetworkEncryptionType.None)
            {
                result = await firstAdapter.ConnectAsync(selectedNetwork.AvailableNetwork, reconnectionKind);
            }
            else
            {
                // Only the password portion of the credential need to be supplied
                var credential = new PasswordCredential();

                // Make sure Credential.Password property is not set to an empty string.
                // Otherwise, a System.ArgumentException will be thrown.
                // The default empty password string will still be passed to the ConnectAsync method,
                // which should return an "InvalidCredential" error
                if (!string.IsNullOrEmpty(NetworkKey.Password))
                {
                    credential.Password = NetworkKey.Password;
                }

                result = await firstAdapter.ConnectAsync(selectedNetwork.AvailableNetwork, reconnectionKind, credential);
            }

            if (result.ConnectionStatus == WiFiConnectionStatus.Success)
            {
                rootPage.NotifyUser(string.Format("Successfully connected to {0}.", selectedNetwork.Ssid), NotifyType.StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(string.Format("Could not connect to {0}. Error: {1}", selectedNetwork.Ssid, result.ConnectionStatus), NotifyType.ErrorMessage);
            }
        }

void DisconnectButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 91 of file Scenario4_Connect.xaml.cs.

        {
            firstAdapter.Disconnect();
        }

async void DisplayNetworkReport ( WiFiNetworkReport report ) [inline, private]

Definition at line 135 of file Scenario4_Connect.xaml.cs.

        {
            rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);

            ResultCollection.Clear();

            foreach (var network in report.AvailableNetworks)
            {
                var networkDisplay = new WiFiNetworkDisplay(network, firstAdapter);
                await networkDisplay.UpdateConnectivityLevel();
                ResultCollection.Add(networkDisplay);
            }
        }

async void NetworkInformation_NetworkStatusChanged ( object sender ) [inline, private]

Definition at line 96 of file Scenario4_Connect.xaml.cs.

        {
            await UpdateConnectivityStatusAsync();

            // Update the connectivity level displayed for each
            foreach (var network in ResultCollection)
            {
                await network.UpdateConnectivityLevel();
            }
        }

override async void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Definition at line 48 of file Scenario4_Connect.xaml.cs.

        {
            ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
            rootPage = MainPage.Current;

            // RequestAccessAsync must have been called at least once by the app before using the API
            // Calling it multiple times is fine but not necessary
            // RequestAccessAsync must be called from the UI thread
            var access = await WiFiAdapter.RequestAccessAsync();
            if (access != WiFiAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
            }
            else
            {
                DataContext = this;

                var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
                if (result.Count >= 1)
                {
                    firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);

                    var scanButton = new Button();
                    scanButton.Content = string.Format("Scan");
                    scanButton.Click += ScanButton_Click;
                    Buttons.Children.Add(scanButton);

                    var disconnectButton = new Button();
                    disconnectButton.Content = string.Format("Disconnect");
                    disconnectButton.Click += DisconnectButton_Click; ;
                    Buttons.Children.Add(disconnectButton);

                    // Monitor network status changes
                    await UpdateConnectivityStatusAsync();
                    NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged;
                }
                else
                {
                    rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
                }
            }
        }

void ResultsListView_SelectionChanged | ( | object | sender,
 |  | SelectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 149 of file Scenario4_Connect.xaml.cs.

        {
            var selectedNetwork = ResultsListView.SelectedItem as WiFiNetworkDisplay;
            if (selectedNetwork == null)
            {
                return;
            }

            // Show the connection bar
            ConnectionBar.Visibility = Visibility.Visible;

            // Only show the password box if needed
            if (selectedNetwork.AvailableNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211 &&
                selectedNetwork.AvailableNetwork.SecuritySettings.NetworkEncryptionType == NetworkEncryptionType.None)
            {
                NetworkKeyInfo.Visibility = Visibility.Collapsed;
            }
            else
            {
                NetworkKeyInfo.Visibility = Visibility.Visible;
            }
        }

async void ScanButton_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 128 of file Scenario4_Connect.xaml.cs.

        {
            await firstAdapter.ScanAsync();
            ConnectionBar.Visibility = Visibility.Collapsed;
            DisplayNetworkReport(firstAdapter.NetworkReport);
        }

async Task UpdateConnectivityStatusAsync ( ) [inline, private]

Definition at line 107 of file Scenario4_Connect.xaml.cs.

        {
            var connectedProfile = await firstAdapter.NetworkAdapter.GetConnectedProfileAsync();
            if (connectedProfile != null && !connectedProfile.ProfileName.Equals(savedProfileName))
            {
                savedProfileName = connectedProfile.ProfileName;
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser(string.Format("WiFi adapter connected to: {0} ({1})", connectedProfile.ProfileName, connectedProfile.GetNetworkConnectivityLevel()), NotifyType.StatusMessage);
                });
            }
            else if (connectedProfile == null && savedProfileName != null)
            {
                savedProfileName = null;
                await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    rootPage.NotifyUser("WiFi adapter disconnected", NotifyType.StatusMessage);
                });
            }
        }

Member Data Documentation

WiFiAdapter firstAdapter [private]

Definition at line 34 of file Scenario4_Connect.xaml.cs.

MainPage rootPage [private]

Definition at line 33 of file Scenario4_Connect.xaml.cs.

string savedProfileName = null [private]

Definition at line 35 of file Scenario4_Connect.xaml.cs.

Property Documentation

ObservableCollection<WiFiNetworkDisplay> ResultCollection [get, set]

Definition at line 38 of file Scenario4_Connect.xaml.cs.

The documentation for this class was generated from the following file:
  • WiFiScan/cs/Scenario4_Connect.xaml.cs
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiNetworkDisplay Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WiFiScan
  • WiFiNetworkDisplay
Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes

WiFiNetworkDisplay Class Reference

List of all members.

Public Member Functions

WiFiNetworkDisplay (WiFiAvailableNetwork availableNetwork, WiFiAdapter adapter)
async Task | UpdateConnectivityLevel ()

Protected Member Functions

async void | OnPropertyChanged (string name)

Properties

WiFiAvailableNetwork | AvailableNetwork [get, set]
String | Bssid [get]
String | ChannelCenterFrequency [get]
String | ConnectivityLevel [get, set]
String | Rssi [get]
String | SecuritySettings [get]
String | Ssid [get]
BitmapImage | WiFiImage [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | UpdateWiFiImage ()

Private Attributes

WiFiAdapter | adapter
WiFiAvailableNetwork | availableNetwork

Detailed Description

Definition at line 23 of file DisplayHelpers.cs.

Constructor & Destructor Documentation

WiFiNetworkDisplay | ( | WiFiAvailableNetwork | availableNetwork,
 |  | WiFiAdapter | adapter |
 | ) |  |  | [inline]

Definition at line 26 of file DisplayHelpers.cs.

        {
            AvailableNetwork = availableNetwork;
            this.adapter = adapter;
            UpdateWiFiImage();
        }

Member Function Documentation

async void OnPropertyChanged ( string name ) [inline, protected]

Definition at line 143 of file DisplayHelpers.cs.

        {
            var rootPage = MainPage.Current;
            await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                PropertyChangedEventHandler handler = PropertyChanged;
                if (handler != null)
                {
                    handler(this, new PropertyChangedEventArgs(name));
                }
            });
        }

async Task UpdateConnectivityLevel ( ) [inline]

Definition at line 49 of file DisplayHelpers.cs.

        {
            string connectivityLevel = "Not Connected";
            string connectedSsid = null;

            var connectedProfile = await adapter.NetworkAdapter.GetConnectedProfileAsync();
            if (connectedProfile != null &&
                connectedProfile.IsWlanConnectionProfile &&
                connectedProfile.WlanConnectionProfileDetails != null)
            {
                connectedSsid = connectedProfile.WlanConnectionProfileDetails.GetConnectedSsid();
            }

            if (!string.IsNullOrEmpty(connectedSsid))
            {
                if (connectedSsid.Equals(AvailableNetwork.Ssid))
                {
                    connectivityLevel = connectedProfile.GetNetworkConnectivityLevel().ToString();
                }
            }

            ConnectivityLevel = connectivityLevel;

            OnPropertyChanged("ConnectivityLevel");
        }

void UpdateWiFiImage ( ) [inline, private]

Definition at line 33 of file DisplayHelpers.cs.

        {
            string imageFileNamePrefix = "secure";
            if (AvailableNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211)
            {
                imageFileNamePrefix = "open";
            }

            string imageFileName = string.Format("ms-appx:/Assets/{0}_{1}bar.png", imageFileNamePrefix, AvailableNetwork.SignalBars);

            WiFiImage = new BitmapImage(new Uri(imageFileName));

            OnPropertyChanged("WiFiImage");

        }

Member Data Documentation

WiFiAdapter adapter [private]

Definition at line 25 of file DisplayHelpers.cs.

WiFiAvailableNetwork availableNetwork [private]

Definition at line 128 of file DisplayHelpers.cs.

Property Documentation

WiFiAvailableNetwork AvailableNetwork [get, set]

Definition at line 130 of file DisplayHelpers.cs.

String Bssid [get]

Definition at line 84 of file DisplayHelpers.cs.

String ChannelCenterFrequency [get]

Definition at line 93 of file DisplayHelpers.cs.

String ConnectivityLevel [get, set]

Definition at line 116 of file DisplayHelpers.cs.

String Rssi [get]

Definition at line 101 of file DisplayHelpers.cs.

String SecuritySettings [get]

Definition at line 109 of file DisplayHelpers.cs.

String Ssid [get]

Definition at line 76 of file DisplayHelpers.cs.

BitmapImage WiFiImage [get, set]

Definition at line 122 of file DisplayHelpers.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 142 of file DisplayHelpers.cs.

The documentation for this class was generated from the following file:
  • WiFiScan/cs/DisplayHelpers.cs
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: final Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • final
Public Member Functions | Private Member Functions | Private Attributes

final Class Reference

#include "SurfaceMesh.h"

List of all members.

Public Member Functions

~SurfaceMesh ()
void | CreateDeviceDependentResources (ID3D11Device *device)
void | Draw (ID3D11Device *device, ID3D11DeviceContext *context, bool usingVprtShaders, bool isStereo)
const bool & | GetIsActive () const
const float & | GetLastActiveTime () const
const
Windows::Foundation::DateTime & 		GetLastUpdateTime () const
void | ReleaseDeviceDependentResources ()
void | ReleaseVertexResources ()
void | SetColorFadeTimer (const float &duration)
void | SetIsActive (const bool &isActive)
SurfaceMesh ()
void | UpdateSurface (Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh^surface)
void | UpdateTransform (ID3D11Device *device, ID3D11DeviceContext *context, DX::StepTimer const &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^baseCoordinateSystem)
void | UpdateVertexResources (ID3D11Device *device)

Private Member Functions

void | CreateDirectXBuffer (ID3D11Device *device, D3D11_BIND_FLAG binding, Windows::Storage::Streams::IBuffer^buffer, ID3D11Buffer **target)
void | SwapVertexBuffers ()

Private Attributes

float | m_colorFadeTimeout = -1.f
float | m_colorFadeTimer = -1.f
bool | m_constantBufferCreated = false
ModelNormalConstantBuffer m_constantBufferData
bool | m_isActive = false
float | m_lastActiveTime = -1.f
Windows::Foundation::DateTime | m_lastUpdateTime
bool | m_loadingComplete = false
SurfaceMeshProperties m_meshProperties
std::mutex | m_meshResourcesMutex
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_modelTransformBuffer
Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh | m_pendingSurfaceMesh = nullptr
Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh | m_surfaceMesh = nullptr
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_triangleIndices
SurfaceMeshProperties m_updatedMeshProperties
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_updatedTriangleIndices
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_updatedVertexNormals
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_updatedVertexPositions
bool | m_updateReady = false
concurrency::task< void > | m_updateVertexResourcesTask = concurrency::task_from_result()
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexNormals
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		m_vertexPositions

Detailed Description

Definition at line 30 of file SurfaceMesh.h.

Constructor & Destructor Documentation

~SurfaceMesh ( )

Member Function Documentation

void CreateDeviceDependentResources ( ID3D11Device * device )
void CreateDirectXBuffer | ( | ID3D11Device * | device,
 |  | D3D11_BIND_FLAG | binding,
 |  | Windows::Storage::Streams::IBuffer^ | buffer,
 |  | ID3D11Buffer ** | target |
 | ) |  |  | [private]
void Draw | ( | ID3D11Device * | device,
 |  | ID3D11DeviceContext * | context,
 |  | bool | usingVprtShaders,
 |  | bool | isStereo
 | ) |  |
const bool& GetIsActive ( ) const [inline]

Definition at line 51 of file SurfaceMesh.h.

{ return m_isActive;       }

const float& GetLastActiveTime ( ) const [inline]

Definition at line 52 of file SurfaceMesh.h.

{ return m_lastActiveTime; }

const Windows::Foundation::DateTime& GetLastUpdateTime ( ) const [inline]

Definition at line 53 of file SurfaceMesh.h.

{ return m_lastUpdateTime; }

void ReleaseDeviceDependentResources ( )
void ReleaseVertexResources ( )
void SetColorFadeTimer ( const float & duration ) [inline]

Definition at line 56 of file SurfaceMesh.h.

{ m_colorFadeTimeout = duration; m_colorFadeTimer = 0.f;    }

void SetIsActive ( const bool & isActive ) [inline]

Definition at line 55 of file SurfaceMesh.h.

{ m_isActive = isActive;                                    }

SurfaceMesh ( )
void SwapVertexBuffers ( ) [private]
void UpdateSurface ( Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh^ surface )
void UpdateTransform | ( | ID3D11Device * | device,
 |  | ID3D11DeviceContext * | context,
 |  | DX::StepTimer const & | timer,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | baseCoordinateSystem
 | ) |  |
void UpdateVertexResources ( ID3D11Device * device )

Member Data Documentation

float m_colorFadeTimeout = -1.f [private]

Definition at line 93 of file SurfaceMesh.h.

float m_colorFadeTimer = -1.f [private]

Definition at line 92 of file SurfaceMesh.h.

bool m_constantBufferCreated = false [private]

Definition at line 87 of file SurfaceMesh.h.

ModelNormalConstantBuffer m_constantBufferData [private]

Definition at line 85 of file SurfaceMesh.h.

bool m_isActive = false [private]

Definition at line 90 of file SurfaceMesh.h.

float m_lastActiveTime = -1.f [private]

Definition at line 91 of file SurfaceMesh.h.

Windows::Foundation::DateTime m_lastUpdateTime [private]

Definition at line 80 of file SurfaceMesh.h.

bool m_loadingComplete = false [private]

Definition at line 88 of file SurfaceMesh.h.

SurfaceMeshProperties m_meshProperties [private]

Definition at line 82 of file SurfaceMesh.h.

std::mutex m_meshResourcesMutex [private]

Definition at line 95 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelTransformBuffer [private]

Definition at line 78 of file SurfaceMesh.h.

Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh m_pendingSurfaceMesh = nullptr [private]

Definition at line 69 of file SurfaceMesh.h.

Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh m_surfaceMesh = nullptr [private]

Definition at line 70 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_triangleIndices [private]

Definition at line 74 of file SurfaceMesh.h.

SurfaceMeshProperties m_updatedMeshProperties [private]

Definition at line 83 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_updatedTriangleIndices [private]

Definition at line 77 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_updatedVertexNormals [private]

Definition at line 76 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_updatedVertexPositions [private]

Definition at line 75 of file SurfaceMesh.h.

bool m_updateReady = false [private]

Definition at line 89 of file SurfaceMesh.h.

concurrency::task<void> m_updateVertexResourcesTask = concurrency::task_from_result() [private]

Definition at line 67 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexNormals [private]

Definition at line 73 of file SurfaceMesh.h.

Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexPositions [private]

Definition at line 72 of file SurfaceMesh.h.

The documentation for this class was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/SurfaceMesh.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • ModelConstantBuffer
Public Attributes

ModelConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4X4 modelToWorld

Detailed Description

Definition at line 17 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4X4 modelToWorld

Definition at line 19 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ModelNormalConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • ModelNormalConstantBuffer
Public Attributes

ModelNormalConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | colorFadeFactor
DirectX::XMFLOAT4X4 | modelToWorld
DirectX::XMFLOAT4X4 | normalToWorld

Detailed Description

Definition at line 28 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 colorFadeFactor

Definition at line 32 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 modelToWorld

Definition at line 30 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 normalToWorld

Definition at line 31 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RealtimeSurfaceMeshRenderer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • RealtimeSurfaceMeshRenderer
Public Member Functions | Private Member Functions | Private Attributes

RealtimeSurfaceMeshRenderer Class Reference

#include "RealtimeSurfaceMeshRenderer.h"

List of all members.

Public Member Functions

RealtimeSurfaceMeshRenderer (const std::shared_ptr< DX::DeviceResources > &deviceResources)
void | AddSurface (Platform::Guid id, Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^newSurface)
void | ClearSurfaces ()
void | CreateDeviceDependentResources ()
Windows::Foundation::DateTime | GetLastUpdateTime (Platform::Guid id)
bool | HasSurface (Platform::Guid id)
void | HideInactiveMeshes (Windows::Foundation::Collections::IMapView< Platform::Guid, Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^>^const &surfaceCollection)
void | ReleaseDeviceDependentResources ()
void | RemoveSurface (Platform::Guid id)
void | Render (bool isStereo, bool useWireframe)
void | Update (DX::StepTimer const &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem)
void | UpdateSurface (Platform::Guid id, Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^newSurface)

Private Member Functions

Concurrency::task< void > | AddOrUpdateSurfaceAsync (Platform::Guid id, Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^newSurface)

Private Attributes

const float | c_maxInactiveMeshTime = 120.f
const float | c_surfaceMeshFadeInTime = 3.0f
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_colorPixelShader
Microsoft::WRL::ComPtr
< ID3D11RasterizerState > 		m_defaultRasterizerState
std::shared_ptr
< DX::DeviceResources > 		m_deviceResources
Microsoft::WRL::ComPtr
< ID3D11GeometryShader > 		m_geometryShader
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		m_inputLayout
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		m_lightingPixelShader
bool | m_loadingComplete
double | m_maxTrianglesPerCubicMeter = 1000.0
std::map< Platform::Guid,
SurfaceMesh > 		m_meshCollection
std::mutex | m_meshCollectionLock
unsigned int | m_surfaceMeshCount
bool | m_usingVprtShaders = false
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		m_vertexShader
Microsoft::WRL::ComPtr
< ID3D11RasterizerState > 		m_wireframeRasterizerState

Detailed Description

Definition at line 25 of file RealtimeSurfaceMeshRenderer.h.

Constructor & Destructor Documentation

RealtimeSurfaceMeshRenderer ( const std::shared_ptr< DX::DeviceResources > & deviceResources )

Member Function Documentation

Concurrency::task<void> AddOrUpdateSurfaceAsync | ( | Platform::Guid | id,
 |  | Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^ | newSurface |
 | ) |  |  | [private]
void AddSurface | ( | Platform::Guid | id,
 |  | Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^ | newSurface
 | ) |  |
void ClearSurfaces ( )

Definition at line 127 of file RealtimeSurfaceMeshRenderer.cpp.

{
    std::lock_guard<std::mutex> guard(m_meshCollectionLock);
    m_meshCollection.clear();
}

void CreateDeviceDependentResources ( )

Definition at line 219 of file RealtimeSurfaceMeshRenderer.cpp.

{
    m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();

    // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
    // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
    // we can avoid using a pass-through geometry shader to set the render
    // target array index, thus avoiding any overhead that would be
    // incurred by setting the geometry shader stage.
    std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///SurfaceVprtVertexShader.cso" : L"ms-appx:///SurfaceVertexShader.cso";

    // Load shaders asynchronously.
    task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
    task<std::vector<byte>> loadLightingPSTask = DX::ReadDataAsync(L"ms-appx:///SimpleLightingPixelShader.cso");
    task<std::vector<byte>> loadWireframePSTask = DX::ReadDataAsync(L"ms-appx:///SolidColorPixelShader.cso");

    task<std::vector<byte>> loadGSTask;
    if (!m_usingVprtShaders)
    {
        // Load the pass-through geometry shader.
        loadGSTask = DX::ReadDataAsync(L"ms-appx:///SurfaceGeometryShader.cso");
    }

    // After the vertex shader file is loaded, create the shader and input layout.
    auto createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData) {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateVertexShader(
                &fileData[0],
                fileData.size(),
                nullptr,
                &m_vertexShader
                )
            );

        static const D3D11_INPUT_ELEMENT_DESC vertexDesc [] =
        {
            { "POSITION", 0, DXGI_FORMAT_R16G16B16A16_SNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "NORMAL",   0, DXGI_FORMAT_R8G8B8A8_SNORM,     1, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        };

        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreateInputLayout(
                vertexDesc,
                ARRAYSIZE(vertexDesc),
                &fileData[0],
                fileData.size(),
                &m_inputLayout
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    auto createLightingPSTask = loadLightingPSTask.then([this](const std::vector<byte>& fileData) {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                &fileData[0],
                fileData.size(),
                nullptr,
                &m_lightingPixelShader
                )
            );
    });

    // After the pixel shader file is loaded, create the shader and constant buffer.
    auto createWireframePSTask = loadWireframePSTask.then([this](const std::vector<byte>& fileData) {
        DX::ThrowIfFailed(
            m_deviceResources->GetD3DDevice()->CreatePixelShader(
                &fileData[0],
                fileData.size(),
                nullptr,
                &m_colorPixelShader
            )
        );
    });

    task<void> createGSTask;
    if (!m_usingVprtShaders)
    {
        // After the pass-through geometry shader file is loaded, create the shader.
        createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
        {
            DX::ThrowIfFailed(
                m_deviceResources->GetD3DDevice()->CreateGeometryShader(
                    &fileData[0],
                    fileData.size(),
                    nullptr,
                    &m_geometryShader
                    )
                );
        });
    }

    // Once all shaders are loaded, create the mesh.
    task<void> shaderTaskGroup = m_usingVprtShaders ?
        (createLightingPSTask && createWireframePSTask && createVSTask) :
        (createLightingPSTask && createWireframePSTask && createVSTask && createGSTask);

    // Once the cube is loaded, the object is ready to be rendered.
    auto finishLoadingTask = shaderTaskGroup.then([this]() {

        // Recreate device-based surface mesh resources.
        std::lock_guard<std::mutex> guard(m_meshCollectionLock);
        for (auto& iter : m_meshCollection)
        {
            iter.second.ReleaseDeviceDependentResources();
            iter.second.CreateDeviceDependentResources(m_deviceResources->GetD3DDevice());
        }

        // Create a default rasterizer state descriptor.
        D3D11_RASTERIZER_DESC rasterizerDesc = CD3D11_RASTERIZER_DESC(D3D11_DEFAULT);

        // Create the default rasterizer state.
        m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_defaultRasterizerState.GetAddressOf());

        // Change settings for wireframe rasterization.
        rasterizerDesc.AntialiasedLineEnable = true;
        rasterizerDesc.CullMode = D3D11_CULL_NONE;
        rasterizerDesc.FillMode = D3D11_FILL_WIREFRAME;

        // Create a wireframe rasterizer state.
        m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_wireframeRasterizerState.GetAddressOf());

        m_loadingComplete = true;
    });
}

Windows::Foundation::DateTime GetLastUpdateTime ( Platform::Guid id )

Definition at line 371 of file RealtimeSurfaceMeshRenderer.cpp.

{
    std::lock_guard<std::mutex> guard(m_meshCollectionLock);
    auto& meshIter = m_meshCollection.find(id);
    if (meshIter != m_meshCollection.end())
    {
        auto const& mesh = meshIter->second;
        return mesh.GetLastUpdateTime();
    }
    else
    {
        static const Windows::Foundation::DateTime zero;
        return zero;
    }
}

bool HasSurface ( Platform::Guid id )

Definition at line 365 of file RealtimeSurfaceMeshRenderer.cpp.

{
    std::lock_guard<std::mutex> guard(m_meshCollectionLock);
    return m_meshCollection.find(id) != m_meshCollection.end();
}

void HideInactiveMeshes ( Windows::Foundation::Collections::IMapView< Platform::Guid, Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^>^const & surfaceCollection )
void ReleaseDeviceDependentResources ( )

Definition at line 345 of file RealtimeSurfaceMeshRenderer.cpp.

{
    m_loadingComplete = false;

    m_vertexShader.Reset();
    m_inputLayout.Reset();
    m_geometryShader.Reset();
    m_lightingPixelShader.Reset();
    m_colorPixelShader.Reset();

    m_defaultRasterizerState.Reset();
    m_wireframeRasterizerState.Reset();

    std::lock_guard<std::mutex> guard(m_meshCollectionLock);
    for (auto& iter : m_meshCollection)
    {
        iter.second.ReleaseDeviceDependentResources();
    }
}

void RemoveSurface ( Platform::Guid id )
void Render | ( | bool | isStereo,
 |  | bool | useWireframe
 | ) |  |

Definition at line 148 of file RealtimeSurfaceMeshRenderer.cpp.

{
    // Loading is asynchronous. Only draw geometry after it's loaded.
    if (!m_loadingComplete)
    {
        return;
    }

    auto context = m_deviceResources->GetD3DDeviceContext();

    context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    context->IASetInputLayout(m_inputLayout.Get());

    // Attach our vertex shader.
    context->VSSetShader(
        m_vertexShader.Get(),
        nullptr,
        0
        );

    // The constant buffer is per-mesh, and will be set for each one individually.
    if (!m_usingVprtShaders)
    {
        // Attach the passthrough geometry shader.
        context->GSSetShader(
            m_geometryShader.Get(),
            nullptr,
            0
            );
    }

    if (useWireframe)
    {
        // Use a wireframe rasterizer state.
        m_deviceResources->GetD3DDeviceContext()->RSSetState(m_wireframeRasterizerState.Get());

        // Attach a pixel shader to render a solid color wireframe.
        context->PSSetShader(
            m_colorPixelShader.Get(),
            nullptr,
            0
        );
    }
    else
    {
        // Use the default rasterizer state.
        m_deviceResources->GetD3DDeviceContext()->RSSetState(m_defaultRasterizerState.Get());

        // Attach a pixel shader that can do lighting.
        context->PSSetShader(
            m_lightingPixelShader.Get(),
            nullptr,
            0
        );
    }

    {
        std::lock_guard<std::mutex> guard(m_meshCollectionLock);

        // Draw the meshes.
        auto device = m_deviceResources->GetD3DDevice();
        for (auto& pair : m_meshCollection)
        {
            auto& id = pair.first;
            auto& surfaceMesh = pair.second;

            surfaceMesh.Draw(device, context, m_usingVprtShaders, isStereo);
        }
    }
}

void Update | ( | DX::StepTimer const & | timer,
 |  | Windows::Perception::Spatial::SpatialCoordinateSystem^ | coordinateSystem
 | ) |  |
void UpdateSurface | ( | Platform::Guid | id,
 |  | Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo^ | newSurface
 | ) |  |

Member Data Documentation

const float c_maxInactiveMeshTime = 120.f [private]

Definition at line 83 of file RealtimeSurfaceMeshRenderer.h.

const float c_surfaceMeshFadeInTime = 3.0f [private]

Definition at line 86 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_colorPixelShader [private]

Definition at line 60 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_defaultRasterizerState [private]

Definition at line 79 of file RealtimeSurfaceMeshRenderer.h.

std::shared_ptr<DX::DeviceResources> m_deviceResources [private]

Definition at line 53 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader [private]

Definition at line 58 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout [private]

Definition at line 56 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11PixelShader> m_lightingPixelShader [private]

Definition at line 59 of file RealtimeSurfaceMeshRenderer.h.

bool m_loadingComplete [private]

Definition at line 88 of file RealtimeSurfaceMeshRenderer.h.

double m_maxTrianglesPerCubicMeter = 1000.0 [private]

Definition at line 72 of file RealtimeSurfaceMeshRenderer.h.

std::map<Platform::Guid, SurfaceMesh> m_meshCollection [private]

Definition at line 63 of file RealtimeSurfaceMeshRenderer.h.

std::mutex m_meshCollectionLock [private]

Definition at line 66 of file RealtimeSurfaceMeshRenderer.h.

unsigned int m_surfaceMeshCount [private]

Definition at line 69 of file RealtimeSurfaceMeshRenderer.h.

bool m_usingVprtShaders = false [private]

Definition at line 76 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader [private]

Definition at line 57 of file RealtimeSurfaceMeshRenderer.h.

Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_wireframeRasterizerState [private]

Definition at line 80 of file RealtimeSurfaceMeshRenderer.h.

The documentation for this class was generated from the following files:
  • HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.h
  • HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SurfaceMeshProperties Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • SurfaceMeshProperties
Public Attributes

SurfaceMeshProperties Struct Reference

#include "SurfaceMesh.h"

List of all members.

Public Attributes

Windows::Perception::Spatial::SpatialCoordinateSystem | coordinateSystem = nullptr
unsigned int | indexCount = 0
DXGI_FORMAT | indexFormat = DXGI_FORMAT_UNKNOWN
unsigned int | normalStride = 0
Windows::Foundation::Numerics::float3 | vertexPositionScale = Windows::Foundation::Numerics::float3::one()
unsigned int | vertexStride = 0

Detailed Description

Definition at line 20 of file SurfaceMesh.h.

Member Data Documentation

Windows::Perception::Spatial::SpatialCoordinateSystem coordinateSystem = nullptr

Definition at line 22 of file SurfaceMesh.h.

unsigned int indexCount = 0

Definition at line 26 of file SurfaceMesh.h.

DXGI_FORMAT indexFormat = DXGI_FORMAT_UNKNOWN

Definition at line 27 of file SurfaceMesh.h.

unsigned int normalStride = 0

Definition at line 25 of file SurfaceMesh.h.

Windows::Foundation::Numerics::float3 vertexPositionScale = Windows::Foundation::Numerics::float3::one()

Definition at line 23 of file SurfaceMesh.h.

unsigned int vertexStride = 0

Definition at line 24 of file SurfaceMesh.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/SurfaceMesh.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • VertexPositionColor
Public Attributes

VertexPositionColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 52 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 55 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 54 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VertexPositionNormalColor Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • VertexPositionNormalColor
Public Attributes

VertexPositionNormalColor Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT3 | color
DirectX::XMFLOAT3 | normal
DirectX::XMFLOAT3 | pos

Detailed Description

Definition at line 59 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT3 color

Definition at line 63 of file ShaderStructures.h.

DirectX::XMFLOAT3 normal

Definition at line 62 of file ShaderStructures.h.

DirectX::XMFLOAT3 pos

Definition at line 61 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewProjectionConstantBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsHolographicCodeSamples
  • ViewProjectionConstantBuffer
Public Attributes

ViewProjectionConstantBuffer Struct Reference

#include "ShaderStructures.h"

List of all members.

Public Attributes

DirectX::XMFLOAT4 | cameraPosition
DirectX::XMFLOAT4 | lightPosition
DirectX::XMFLOAT4X4 | viewProjection [2]

Detailed Description

Definition at line 41 of file ShaderStructures.h.

Member Data Documentation

DirectX::XMFLOAT4 cameraPosition

Definition at line 43 of file ShaderStructures.h.

DirectX::XMFLOAT4 lightPosition

Definition at line 44 of file ShaderStructures.h.

DirectX::XMFLOAT4X4 viewProjection[2]

Definition at line 45 of file ShaderStructures.h.

The documentation for this struct was generated from the following file:
  • HolographicSpatialMapping/cpp/Content/ShaderStructures.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BufferHelper Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsPreview
  • Media
  • Capture
  • Frames
  • BufferHelper
Public Member Functions | Private Attributes

BufferHelper Class Reference

#include "BufferHelper.h"

List of all members.

Public Member Functions

BufferHelper (Windows::Storage::Streams::IBuffer^buffer)
BufferHelper (BufferView^bufferView)
template<typename parentType , typename repeatedType , uint32_t declaredCount = 1>
void | CheckBufferSize (const parentType *ptr, uint32_t effectiveCount)
template<typename T >
const T * | GetPtrAt (uint32_t byteOffset) const

Private Attributes

Windows::Storage::Streams::IBuffer | _buffer
Microsoft::WRL::ComPtr
< Windows::Storage::Streams::IBufferByteAccess > 		_bufferByteAccess
BYTE * | _bytes = nullptr
uint32_t | _offset = 0
uint32_t | _size = 0

Detailed Description

Definition at line 46 of file BufferHelper.h.

Constructor & Destructor Documentation

BufferHelper ( Windows::Storage::Streams::IBuffer^ buffer ) [inline]

Definition at line 49 of file BufferHelper.h.

                        : _buffer(buffer), _size(buffer->Capacity)
                    {
                        HRESULT hr = (reinterpret_cast<IInspectable*>(_buffer))->QueryInterface(_bufferByteAccess.ReleaseAndGetAddressOf());
                        if (FAILED(hr))
                        {
                            throw ref new Platform::Exception(hr);
                        }

                        hr = _bufferByteAccess->Buffer(&_bytes);
                        if (FAILED(hr))
                        {
                            throw ref new Platform::Exception(hr);
                        }
                    }

BufferHelper ( BufferView^ bufferView ) [inline]

Definition at line 64 of file BufferHelper.h.

                        : _buffer(bufferView->Buffer), _size(bufferView->Size)
                    {
                        HRESULT hr = (reinterpret_cast<IInspectable*>(_buffer))->QueryInterface(_bufferByteAccess.ReleaseAndGetAddressOf());
                        if (FAILED(hr))
                        {
                            throw ref new Platform::Exception(hr);
                        }

                        hr = _bufferByteAccess->Buffer(&_bytes);
                        if (FAILED(hr))
                        {
                            throw ref new Platform::Exception(hr);
                        }
                        _bytes += bufferView->Offset;
                    }

Member Function Documentation

void CheckBufferSize | ( | const parentType * | ptr,
 |  | uint32_t | effectiveCount |
 | ) |  |  | [inline]

Definition at line 92 of file BufferHelper.h.

                    {
                        auto offset = reinterpret_cast<const BYTE*>(ptr) - _bytes;
                        auto effectiveSize = sizeof_composedStructure<parentType, repeatedType, declaredCount>(effectiveCount);
                        if (offset + effectiveSize > _size)
                        {
                            throw ref new OutOfBoundsException();
                        }
                    }

const T* GetPtrAt ( uint32_t byteOffset ) const [inline]

Definition at line 82 of file BufferHelper.h.

                    {
                        if (byteOffset + sizeof(T) > _size)
                        {
                            throw ref new OutOfBoundsException();
                        }
                        return reinterpret_cast<const T*>(_bytes + byteOffset);
                    }

Member Data Documentation

Windows::Storage::Streams::IBuffer _buffer [private]

Definition at line 106 of file BufferHelper.h.

Microsoft::WRL::ComPtr<Windows::Storage::Streams::IBufferByteAccess> _bufferByteAccess [private]

Definition at line 105 of file BufferHelper.h.

BYTE* _bytes = nullptr [private]

Definition at line 102 of file BufferHelper.h.

uint32_t _offset = 0 [private]

Definition at line 103 of file BufferHelper.h.

uint32_t _size = 0 [private]

Definition at line 104 of file BufferHelper.h.

The documentation for this class was generated from the following file:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/BufferHelper.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: sealed Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsPreview
  • Media
  • Capture
  • Frames
  • sealed
Public Member Functions | Properties | Private Member Functions | Private Attributes

sealed Class Reference

#include "BufferHelper.h"

List of all members.

Public Member Functions

internal uint32_t uint32_t | _offset (offset)
internal uint32_t uint32_t | _size (size)
_status (status)
BufferView | GetCustomData ()
BufferView | GetCustomData ()
void | GetPoses (_In_ const Platform::Array< unsigned int >^indices, _Out_ Platform::WriteOnlyArray< TrackedPose >^poses)

Properties

internal | __pad0__: BufferView(Windows::Storage::Streams::IBuffer^ buffer
uint32_t | _offset
uint32_t | _size
internal _In_ unsigned int
_In_ const
MFPoseTrackingPreview::PoseTrackingEntityData * 		entityHeader
internal _In_ unsigned int | entityIndex
internal uint32_t | offset
internal uint32_t uint32_t | size: _buffer(buffer)

Private Member Functions

PoseTrackingFrame (Windows::Media::Capture::Frames::MediaFrameReference^mediaFrameReference, _In_ REFIID customDataType, _In_ Windows::Storage::Streams::IBuffer^frameBuffer, _In_ Windows::Foundation::Collections::IVectorView< PoseTrackingEntity^>^entities)

Private Attributes

Platform::Guid | _customDataType
size_t | _dataSize
Windows::Foundation::Collections::IVectorView
< PoseTrackingEntity^> 		_entities
Platform::Guid | _entityId
unsigned int | _entityIndex
PoseTrackingFrame | _frame
Windows::Storage::Streams::IBuffer | _frameBuffer
bool | _isTracked
Windows::Media::Capture::Frames::MediaFrameReference | _mediaFrameReference
unsigned int | _posesCount
Platform::Guid | _poseSetId
PoseTrackingFrameCreationStatus _status

Detailed Description

Definition at line 21 of file BufferHelper.h.

Member Function Documentation

internal uint32_t uint32_t _offset ( offset )
internal uint32_t uint32_t _size ( size ) [inline]

Definition at line 42 of file BufferHelper.h.

                        : _buffer(buffer), _offset(offset), _size(size)
                    {}

_status ( status ) [inline]

Definition at line 152 of file PoseTrackingFrame.h.

                        : _frame(frame), _status(status)
                    {
                    }

BufferView GetCustomData ( )
BufferView GetCustomData ( )
void GetPoses | ( | _In_ const Platform::Array< unsigned int >^ | indices,
 |  | _Out_ Platform::WriteOnlyArray< TrackedPose >^ | poses
 | ) |  |
PoseTrackingFrame | ( | Windows::Media::Capture::Frames::MediaFrameReference^ | mediaFrameReference,
 |  | _In_ REFIID | customDataType,
 |  | _In_ Windows::Storage::Streams::IBuffer^ | frameBuffer,
 |  | _In_ Windows::Foundation::Collections::IVectorView< PoseTrackingEntity^>^ | entities |
 | ) |  |  | [private]

Member Data Documentation

Platform::Guid _customDataType [private]

Definition at line 197 of file PoseTrackingFrame.h.

size_t _dataSize [private]

Definition at line 120 of file PoseTrackingFrame.h.

Windows::Foundation::Collections::IVectorView<PoseTrackingEntity^> _entities [private]

Definition at line 196 of file PoseTrackingFrame.h.

Platform::Guid _entityId [private]

Definition at line 117 of file PoseTrackingFrame.h.

unsigned int _entityIndex [private]

Definition at line 125 of file PoseTrackingFrame.h.

PoseTrackingFrame _frame [private]

Definition at line 156 of file PoseTrackingFrame.h.

Windows::Storage::Streams::IBuffer _frameBuffer [private]

Definition at line 124 of file PoseTrackingFrame.h.

bool _isTracked [private]

Definition at line 121 of file PoseTrackingFrame.h.

Windows::Media::Capture::Frames::MediaFrameReference _mediaFrameReference [private]

Definition at line 194 of file PoseTrackingFrame.h.

unsigned int _posesCount [private]

Definition at line 119 of file PoseTrackingFrame.h.

Platform::Guid _poseSetId [private]

Definition at line 118 of file PoseTrackingFrame.h.

PoseTrackingFrameCreationStatus _status [private]

Definition at line 157 of file PoseTrackingFrame.h.

Property Documentation

internal __pad0__

Definition at line 41 of file BufferHelper.h.

uint32_t _offset

Definition at line 37 of file BufferHelper.h.

uint32_t _size

Definition at line 39 of file BufferHelper.h.

internal _In_ unsigned int _In_ const MFPoseTrackingPreview::PoseTrackingEntityData* entityHeader

Definition at line 113 of file PoseTrackingFrame.h.

internal _In_ unsigned int entityIndex

Definition at line 113 of file PoseTrackingFrame.h.

internal uint32_t offset

Definition at line 41 of file BufferHelper.h.

internal uint32_t uint32_t size

Definition at line 41 of file BufferHelper.h.

The documentation for this class was generated from the following files:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/BufferHelper.h
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TrackedPose Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WindowsPreview
  • Media
  • Capture
  • Frames
  • TrackedPose
Public Attributes

TrackedPose Struct Reference

#include "PoseTrackingFrame.h"

List of all members.

Public Attributes

Windows::Foundation::Numerics::quaternion Orientation
TrackingStatus OrientationStatus
Windows::Foundation::Numerics::float3 Position
TrackingStatus PositionStatus

Detailed Description

Definition at line 26 of file PoseTrackingFrame.h.

Member Data Documentation

Windows::Foundation::Numerics::quaternion Orientation

Definition at line 30 of file PoseTrackingFrame.h.

TrackingStatus OrientationStatus

Definition at line 29 of file PoseTrackingFrame.h.

Windows::Foundation::Numerics::float3 Position

Definition at line 28 of file PoseTrackingFrame.h.

TrackingStatus PositionStatus

Definition at line 27 of file PoseTrackingFrame.h.

The documentation for this struct was generated from the following file:
  • CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundDeviceWatcherTask
  • factory_implementation
  • BackgroundDeviceWatcher

BackgroundDeviceWatcher Struct Reference

#include "BackgroundDeviceWatcher.h"

Detailed Description

Definition at line 17 of file BackgroundDeviceWatcher.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundDeviceWatcherTask
  • implementation
  • BackgroundDeviceWatcher
Public Member Functions

BackgroundDeviceWatcher Struct Reference

#include "BackgroundDeviceWatcher.h"

List of all members.

Public Member Functions

BackgroundDeviceWatcher ()
void Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Detailed Description

Definition at line 7 of file BackgroundDeviceWatcher.h.

Constructor & Destructor Documentation

BackgroundDeviceWatcher ( )

Member Function Documentation

void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )
The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • factory_implementation
  • ConnectTask

ConnectTask Struct Reference

#include "Tasks.h"

Detailed Description

Definition at line 37 of file Tasks.h.

The documentation for this struct was generated from the following file:
  • OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeofenceBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • factory_implementation
  • GeofenceBackgroundTask

GeofenceBackgroundTask Struct Reference

#include "GeofenceBackgroundTask.h"

Detailed Description

Definition at line 27 of file GeofenceBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocationBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • factory_implementation
  • LocationBackgroundTask

LocationBackgroundTask Struct Reference

#include "LocationBackgroundTask.h"

Detailed Description

Definition at line 27 of file LocationBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Tasks/LocationBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateMetadataTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • factory_implementation
  • UpdateMetadataTask

UpdateMetadataTask Struct Reference

#include "Tasks.h"

Detailed Description

Definition at line 33 of file Tasks.h.

The documentation for this struct was generated from the following file:
  • OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisitBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • factory_implementation
  • VisitBackgroundTask

VisitBackgroundTask Struct Reference

#include "VisitBackgroundTask.h"

Detailed Description

Definition at line 27 of file VisitBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Tasks/VisitBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • implementation
  • ConnectTask
Public Member Functions

ConnectTask Struct Reference

#include "Tasks.h"

List of all members.

Public Member Functions

void | DisplayToast (const winrt::hstring &ssid)
void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Detailed Description

Definition at line 24 of file Tasks.h.

Member Function Documentation

void DisplayToast ( const winrt::hstring & ssid )

Definition at line 105 of file Tasks.cpp.

    {
        ToastNotifier ToastNotifier = ToastNotificationManager::CreateToastNotifier();

        // Create a two line toast and add audio reminder

        // Here the xml that will be passed to the
        // ToastNotification for the toast is retrieved
        XmlDocument toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText02);

        winrt::hstring message(L"SSID: '" + ssid + L"'. Connecting in five seconds.");

        // Set both lines of text
        XmlNodeList toastNodeList = toastXml.GetElementsByTagName(L"text");
        toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode(L"Please turn on your hotspot now!"));
        toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));

        // now create a xml node for the audio source
        IXmlNode toastNode = toastXml.SelectSingleNode(L"/toast");
        XmlElement audio = toastXml.CreateElement(L"audio");
        audio.SetAttribute(L"src", L"ms-winsoundevent:Notification.SMS");

        ToastNotification toast(toastXml);
        ToastNotifier.Show(toast);
    }

void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )
The documentation for this struct was generated from the following files:
  • OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h
  • OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeofenceBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • implementation
  • GeofenceBackgroundTask
Public Member Functions | Private Member Functions | Static Private Attributes

GeofenceBackgroundTask Struct Reference

#include "GeofenceBackgroundTask.h"

List of all members.

Public Member Functions

GeofenceBackgroundTask ()
void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Private Member Functions

hstring | GenerateReportDescription (Windows::Devices::Geolocation::Geofencing::GeofenceStateChangeReport const &report)
void | ProcessGeofenceStateChangedReports ()

Static Private Attributes

static constexpr int | maxEventDescriptors = 42

Detailed Description

Definition at line 7 of file GeofenceBackgroundTask.h.

Constructor & Destructor Documentation

GeofenceBackgroundTask ( )

Member Function Documentation

hstring GenerateReportDescription ( Windows::Devices::Geolocation::Geofencing::GeofenceStateChangeReport const & report ) [private]
void ProcessGeofenceStateChangedReports ( ) [private]

Definition at line 35 of file GeofenceBackgroundTask.cpp.

    {
        // Load the values saved from last time.
        JsonArray geofenceBackgroundEvents = LoadSavedJson(L"BackgroundGeofenceEventCollection");

        // Process the state changes that have occurred since the last time we ran.
        hstring description;
        GeofenceMonitor monitor = GeofenceMonitor::Current();
        IVectorView<GeofenceStateChangeReport> reports = monitor.ReadReports();
        for (GeofenceStateChangeReport report : reports)
        {
            description = GenerateReportDescription(report);

            // Add to the collection, trimming old events if necessary.
            if (geofenceBackgroundEvents.Size() == maxEventDescriptors)
            {
                geofenceBackgroundEvents.RemoveAtEnd();
            }

            geofenceBackgroundEvents.InsertAt(0, JsonValue::CreateStringValue(description));
        }

        uint32_t numReports = reports.Size();
        if (numReports > 0)
        {
            // Save the modified results for next time.
            m_values.Insert(L"BackgroundGeofenceEventCollection", box_value(geofenceBackgroundEvents.Stringify()));

            if (numReports > 1)
            {
                description = L"There are " + to_hstring(numReports) + L" new geofence events";
            }
            DisplayToast(description);
        }
    }

void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )

Member Data Documentation

constexpr int maxEventDescriptors = 42 [static, private]

Definition at line 18 of file GeofenceBackgroundTask.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.h
  • Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LocationBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • implementation
  • LocationBackgroundTask
Public Member Functions | Private Member Functions | Private Attributes

LocationBackgroundTask Struct Reference

#include "LocationBackgroundTask.h"

List of all members.

Public Member Functions

LocationBackgroundTask ()
fire_and_forget | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Private Member Functions

void | OnCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason)
void | WipeGeolocDataFromAppData ()
void | WriteGeolocToAppData (Windows::Devices::Geolocation::Geoposition const &pos)
void | WriteStatusToAppData (hstring const &status)

Private Attributes

slim_mutex | m_mutex
Windows::Foundation::IAsyncOperation
< Windows::Devices::Geolocation::Geoposition > 		m_pendingOperation

Detailed Description

Definition at line 7 of file LocationBackgroundTask.h.

Constructor & Destructor Documentation

LocationBackgroundTask ( )

Member Function Documentation

void OnCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance const & | ,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason |  |
 | ) |  |  | [private]
fire_and_forget Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )
void WipeGeolocDataFromAppData ( ) [private]

Definition at line 68 of file LocationBackgroundTask.cpp.

    {
        m_values.TryRemove(L"Latitude");
        m_values.TryRemove(L"Longitude");
        m_values.TryRemove(L"Accuracy");
    }

void WriteGeolocToAppData ( Windows::Devices::Geolocation::Geoposition const & pos ) [private]
void WriteStatusToAppData ( hstring const & status ) [private]

Definition at line 75 of file LocationBackgroundTask.cpp.

    {
        m_values.Insert(L"Status", box_value(status));
    }

Member Data Documentation

slim_mutex m_mutex [private]

Definition at line 14 of file LocationBackgroundTask.h.

Windows::Foundation::IAsyncOperation<Windows::Devices::Geolocation::Geoposition> m_pendingOperation [private]

Definition at line 15 of file LocationBackgroundTask.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Tasks/LocationBackgroundTask.h
  • Geolocation/cppwinrt/Tasks/LocationBackgroundTask.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UpdateMetadataTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • implementation
  • UpdateMetadataTask
Public Member Functions

UpdateMetadataTask Struct Reference

#include "Tasks.h"

List of all members.

Public Member Functions

void Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Detailed Description

Definition at line 19 of file Tasks.h.

Member Function Documentation

void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )
The documentation for this struct was generated from the following file:
  • OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VisitBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • BackgroundTask
  • implementation
  • VisitBackgroundTask
Public Member Functions | Private Member Functions | Static Private Attributes

VisitBackgroundTask Struct Reference

#include "VisitBackgroundTask.h"

List of all members.

Public Member Functions

VisitBackgroundTask ()
void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Private Member Functions

hstring | GenerateVisitDescription (Windows::Devices::Geolocation::Geovisit const &visit)
void | ProcessVisitReports (Windows::Devices::Geolocation::GeovisitTriggerDetails const &triggerDetails)

Static Private Attributes

static constexpr int | maxEventDescriptors = 42

Detailed Description

Definition at line 7 of file VisitBackgroundTask.h.

Constructor & Destructor Documentation

VisitBackgroundTask ( )

Member Function Documentation

hstring GenerateVisitDescription ( Windows::Devices::Geolocation::Geovisit const & visit ) [private]
void ProcessVisitReports ( Windows::Devices::Geolocation::GeovisitTriggerDetails const & triggerDetails ) [private]
void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )

Member Data Documentation

constexpr int maxEventDescriptors = 42 [static, private]

Definition at line 18 of file VisitBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Tasks/VisitBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpMeteredConnectionFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • HttpFilters
  • factory_implementation
  • HttpMeteredConnectionFilter

HttpMeteredConnectionFilter Struct Reference

#include "HttpMeteredConnectionFilter.h"

Detailed Description

Definition at line 49 of file HttpMeteredConnectionFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/HttpFilters/HttpMeteredConnectionFilter.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpRetryFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • HttpFilters
  • factory_implementation
  • HttpRetryFilter

HttpRetryFilter Struct Reference

#include "HttpRetryFilter.h"

Detailed Description

Definition at line 33 of file HttpRetryFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/HttpFilters/HttpRetryFilter.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpMeteredConnectionFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • HttpFilters
  • implementation
  • HttpMeteredConnectionFilter
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

HttpMeteredConnectionFilter Struct Reference

#include "HttpMeteredConnectionFilter.h"

List of all members.

Public Member Functions

HttpMeteredConnectionFilter (Windows::Web::Http::Filters::IHttpFilter const &innerFilter)
void | Close ()
bool | OptIn ()
void | OptIn (bool value)
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Web::Http::HttpResponseMessage,
Windows::Web::Http::HttpProgress > 		SendRequestAsync (Windows::Web::Http::HttpRequestMessage request)

Static Public Member Functions

static hstring | MeteredConnectionPriorityPropertyName ()

Private Types

enum | MeteredConnectionBehavior { None = 0, Normal, Conservative, OptIn }

Private Member Functions

void | CheckPriority (MeteredConnectionPriority priority)

Static Private Member Functions

static MeteredConnectionBehavior | GetBehavior ()

Private Attributes

Windows::Web::Http::Filters::IHttpFilter | m_innerFilter
bool | m_optIn

Static Private Attributes

static constexpr wchar_t | MeteredConnectionPriorityPropertyNameLiteral [] = "HttpFilters.HttpMeteredConnectionFilter.MeteredConnectionPriority"

Detailed Description

Definition at line 19 of file HttpMeteredConnectionFilter.h.

Member Enumeration Documentation

enum MeteredConnectionBehavior [private]
Enumerator:
None
Normal
Conservative
OptIn

Definition at line 30 of file HttpMeteredConnectionFilter.h.

        {
            None = 0, // Used when there is no Internet profile available.
            Normal,
            Conservative,
            OptIn
        };

Constructor & Destructor Documentation

HttpMeteredConnectionFilter ( Windows::Web::Http::Filters::IHttpFilter const & innerFilter )

Member Function Documentation

void CheckPriority ( MeteredConnectionPriority priority ) [private]

Definition at line 57 of file HttpMeteredConnectionFilter.cpp.

    {
        MeteredConnectionBehavior behavior = GetBehavior();

        switch (behavior)
        {
        case MeteredConnectionBehavior::Normal:
            // Under normal behavior all requests are allowed.
            return;

        case MeteredConnectionBehavior::Conservative:
            // Under conservative behavior all requests except low priority requests are allowed.
            if (priority != MeteredConnectionPriority::Low)
            {
                return;
            }
            break;

        case MeteredConnectionBehavior::OptIn:
            // Under opt-in only high priority requests are allowed and only if user opted in.
            if (priority == MeteredConnectionPriority::High && OptIn())
            {
                return;
            }
            break;
        }

        // Everything else is not allowed.
        throw hresult_access_denied(L"The request priority is not allowed under the current connection behavior.");
    }

void Close ( ) [inline]

Definition at line 24 of file HttpMeteredConnectionFilter.h.

{ }

HttpMeteredConnectionFilter::MeteredConnectionBehavior GetBehavior ( ) [static, private]

Definition at line 88 of file HttpMeteredConnectionFilter.cpp.

    {
        ConnectionProfile connectionProfile = NetworkInformation::GetInternetConnectionProfile();

        if (connectionProfile == nullptr)
        {
            return MeteredConnectionBehavior::None;
        }

        ConnectionCost connectionCost = connectionProfile.GetConnectionCost();

        if (connectionCost.Roaming())
        {
            return MeteredConnectionBehavior::OptIn;
        }

        NetworkCostType type = connectionCost.NetworkCostType();
        if (type == NetworkCostType::Unrestricted || type == NetworkCostType::Unknown)
        {
            return MeteredConnectionBehavior::Normal;
        }

        else if (!connectionCost.OverDataLimit() && (type == NetworkCostType::Fixed || type == NetworkCostType::Variable))
        {
            return MeteredConnectionBehavior::Conservative;
        }

        return MeteredConnectionBehavior::OptIn;
    }

static hstring MeteredConnectionPriorityPropertyName ( ) [inline, static]

Definition at line 27 of file HttpMeteredConnectionFilter.h.

{ return MeteredConnectionPriorityPropertyNameLiteral; }

void OptIn ( bool value ) [inline]

Definition at line 23 of file HttpMeteredConnectionFilter.h.

{ m_optIn = value; }

bool OptIn ( ) [inline]

Definition at line 22 of file HttpMeteredConnectionFilter.h.

{ return m_optIn; }

Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpResponseMessage, Windows::Web::Http::HttpProgress> SendRequestAsync ( Windows::Web::Http::HttpRequestMessage request )

Member Data Documentation

Windows::Web::Http::Filters::IHttpFilter m_innerFilter [private]

Definition at line 40 of file HttpMeteredConnectionFilter.h.

bool m_optIn [private]

Definition at line 41 of file HttpMeteredConnectionFilter.h.

constexpr wchar_t MeteredConnectionPriorityPropertyNameLiteral[] = "HttpFilters.HttpMeteredConnectionFilter.MeteredConnectionPriority" [static, private]

Definition at line 38 of file HttpMeteredConnectionFilter.h.

The documentation for this struct was generated from the following files:
  • HttpClient/HttpFilters/HttpMeteredConnectionFilter.h
  • HttpClient/HttpFilters/HttpMeteredConnectionFilter.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpRetryFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • HttpFilters
  • implementation
  • HttpRetryFilter
Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

HttpRetryFilter Struct Reference

#include "HttpRetryFilter.h"

List of all members.

Public Member Functions

HttpRetryFilter (Windows::Web::Http::Filters::IHttpFilter const &innerFilter)
void | Close ()
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Web::Http::HttpResponseMessage,
Windows::Web::Http::HttpProgress > 		SendRequestAsync (Windows::Web::Http::HttpRequestMessage request)

Static Private Member Functions

static
Windows::Web::Http::HttpRequestMessage 		CopyRequestMessage (Windows::Web::Http::HttpRequestMessage const &message)
static uint32_t | GetRetriesValue (Windows::Web::Http::HttpRequestMessage const &request)

Private Attributes

Windows::Web::Http::Filters::IHttpFilter | m_innerFilter

Static Private Attributes

static constexpr wchar_t | RetriesPropertyName [] = "HttpFilters.HttpRetryFilter.Retries"

Detailed Description

Definition at line 17 of file HttpRetryFilter.h.

Constructor & Destructor Documentation

HttpRetryFilter ( Windows::Web::Http::Filters::IHttpFilter const & innerFilter )

Member Function Documentation

void Close ( ) [inline]

Definition at line 20 of file HttpRetryFilter.h.

{}

static Windows::Web::Http::HttpRequestMessage CopyRequestMessage ( Windows::Web::Http::HttpRequestMessage const & message ) [static, private]
static uint32_t GetRetriesValue ( Windows::Web::Http::HttpRequestMessage const & request ) [static, private]
Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpResponseMessage, Windows::Web::Http::HttpProgress> SendRequestAsync ( Windows::Web::Http::HttpRequestMessage request )

Member Data Documentation

Windows::Web::Http::Filters::IHttpFilter m_innerFilter [private]

Definition at line 24 of file HttpRetryFilter.h.

constexpr wchar_t RetriesPropertyName[] = "HttpFilters.HttpRetryFilter.Retries" [static, private]

Definition at line 26 of file HttpRetryFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/HttpFilters/HttpRetryFilter.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Item Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • Data
  • factory_implementation
  • Item

Item Struct Reference

Detailed Description

Definition at line 50 of file Item.cpp.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/Item.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Item Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • Data
  • implementation
  • Item
Public Member Functions | Public Attributes

Item Struct Reference

List of all members.

Public Member Functions

Item (int id, DateTime dateCreated, hstring title, hstring text)

Public Attributes

Windows::Foundation::DateTime | m_dateCreated
hstring | m_text
hstring | m_title

Detailed Description

Definition at line 20 of file Item.cpp.

Constructor & Destructor Documentation

Item | ( | int | id,
 |  | DateTime | dateCreated,
 |  | hstring | title,
 |  | hstring | text |
 | ) |  |  | [inline]

Definition at line 23 of file Item.cpp.

                                                                        :
            m_id{ id }, m_dateCreated{ dateCreated }, m_title{ std::move(title) }, m_text{ std::move(text) }

Member Data Documentation

Windows::Foundation::DateTime m_dateCreated

Definition at line 24 of file Item.cpp.

hstring m_text

Definition at line 44 of file Item.cpp.

hstring m_title

Definition at line 43 of file Item.cpp.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/Item.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • factory_implementation
  • DetailPage

DetailPage Struct Reference

#include "DetailPage.h"

Detailed Description

Definition at line 51 of file DetailPage.h.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/DetailPage.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • factory_implementation
  • MasterDetailPage

MasterDetailPage Struct Reference

#include "MasterDetailPage.h"

Detailed Description

Definition at line 40 of file MasterDetailPage.h.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/MasterDetailPage.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: App Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • implementation
  • App
Public Member Functions

App Struct Reference

#include "App.h"

List of all members.

Public Member Functions

App ()
Windows::UI::Xaml::Controls::Frame | CreateRootFrame ()
void | OnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &)
void | OnNavigationFailed (IInspectable const &, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const &)

Detailed Description

Definition at line 17 of file App.h.

Constructor & Destructor Documentation

App ( )

Member Function Documentation

Windows::UI::Xaml::Controls::Frame CreateRootFrame ( )
void OnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const & )
void OnNavigationFailed | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/App.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • implementation
  • DetailPage
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes

DetailPage Struct Reference

#include "DetailPage.h"

List of all members.

Public Member Functions

DetailPage ()
void | DetailPage_BackRequested (Windows::Foundation::IInspectable const &sender, Windows::UI::Core::BackRequestedEventArgs const &args)
ViewModels::ItemViewModel | Item ()
void | Item (ViewModels::ItemViewModel value)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | PageRoot_Loaded (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | PageRoot_Unloaded (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | Window_SizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Core::WindowSizeChangedEventArgs const &e)

Static Public Member Functions

static
Windows::UI::Xaml::DependencyProperty 		ItemProperty ()
static void | RegisterDependencyProperties ()

Private Member Functions

void | NavigateBackForWideState (bool useTransition)
void | OnBackRequested ()
void | ReplaceLastBackStackEntryParameter (Windows::Foundation::IInspectable const &parameter)
bool | ShouldGoToWideState ()

Static Private Attributes

static
Windows::UI::Xaml::DependencyProperty 		s_itemProperty

Detailed Description

Definition at line 17 of file DetailPage.h.

Constructor & Destructor Documentation

DetailPage ( )

Definition at line 37 of file DetailPage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void DetailPage_BackRequested | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Core::BackRequestedEventArgs const & | args
 | ) |  |
ViewModels::ItemViewModel Item ( ) [inline]

Definition at line 26 of file DetailPage.h.

{ return GetValue(s_itemProperty).as<ViewModels::ItemViewModel>(); }

void Item ( ViewModels::ItemViewModel value ) [inline]

Definition at line 27 of file DetailPage.h.

{ SetValue(s_itemProperty, value); }

static Windows::UI::Xaml::DependencyProperty ItemProperty ( ) [inline, static]

Definition at line 29 of file DetailPage.h.

{ return s_itemProperty; }

void NavigateBackForWideState ( bool useTransition ) [private]

Definition at line 89 of file DetailPage.cpp.

    {
        // Evict this page from the cache as we may not need it again.
        NavigationCacheMode(NavigationCacheMode::Disabled);

        if (useTransition)
        {
            Frame().GoBack(EntranceNavigationTransitionInfo());
        }
        else
        {
            Frame().GoBack(SuppressNavigationTransitionInfo());
        }
    }

void OnBackRequested ( ) [private]

Definition at line 64 of file DetailPage.cpp.

    {
        // Page above us will be our master view.
        // Make sure we are using the "drill out" animation in this transition.
        ReplaceLastBackStackEntryParameter(nullptr);
        Frame().GoBack(DrillInNavigationTransitionInfo());
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void PageRoot_Loaded | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void PageRoot_Unloaded | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void RegisterDependencyProperties ( ) [static]

Definition at line 31 of file DetailPage.cpp.

    {
        s_itemProperty = DependencyProperty::Register(L"Item", xaml_typename<ItemViewModel>(),
            xaml_typename<MasterDetailApp::DetailPage>(), nullptr);
    }

void ReplaceLastBackStackEntryParameter ( Windows::Foundation::IInspectable const & parameter ) [private]
bool ShouldGoToWideState ( ) [private]

Definition at line 104 of file DetailPage.cpp.

    {
        return Window::Current().Bounds().Width >= 720.0;
    }

void Window_SizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs const & | e
 | ) |  |

Member Data Documentation

Windows::UI::Xaml::DependencyProperty s_itemProperty [static, private]

Definition at line 37 of file DetailPage.h.

The documentation for this struct was generated from the following files:
  • XamlMasterDetail/cppwinrt/DetailPage.h
  • XamlMasterDetail/cppwinrt/DetailPage.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • implementation
  • MasterDetailPage
Public Member Functions | Private Member Functions | Private Attributes

MasterDetailPage Struct Reference

#include "MasterDetailPage.h"

List of all members.

Public Member Functions

MasterDetailPage ()
void | AdaptiveStates_CurrentStateChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::VisualStateChangedEventArgs const &e)
void | LayoutRoot_Loaded (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | MasterListView_ItemClick (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::ItemClickEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | DisableContentTransitions ()
void | EnableContentTransitions ()
void | UpdateForVisualState (Windows::UI::Xaml::VisualState const &newState, Windows::UI::Xaml::VisualState const &oldState=nullptr)

Private Attributes

Windows::Foundation::Collections::IVector
< MasterDetailApp::ViewModels::ItemViewModel > 		m_items

Detailed Description

Definition at line 17 of file MasterDetailPage.h.

Constructor & Destructor Documentation

MasterDetailPage ( )

Definition at line 30 of file MasterDetailPage.cpp.

    {
        InitializeComponent();
        m_items = single_threaded_observable_vector<ItemViewModel>();
        for (auto&& item : ItemsDataSource::GetAllItems())
        {
            m_items.Append(ItemViewModel::FromItem(item));
        }
        MasterListView().ItemsSource(m_items);
    }

Member Function Documentation

void AdaptiveStates_CurrentStateChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::VisualStateChangedEventArgs const & | e
 | ) |  |
void DisableContentTransitions ( ) [private]

Definition at line 93 of file MasterDetailPage.cpp.

    {
        if (DetailContentPresenter() != nullptr)
        {
            DetailContentPresenter().ContentTransitions().Clear();
        }
    }

void EnableContentTransitions ( ) [private]

Definition at line 88 of file MasterDetailPage.cpp.

    {
        DetailContentPresenter().ContentTransitions().ReplaceAll({ EntranceThemeTransition() });
    }

void LayoutRoot_Loaded | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void MasterListView_ItemClick | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::ItemClickEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void UpdateForVisualState | ( | Windows::UI::Xaml::VisualState const & | newState,
 |  | Windows::UI::Xaml::VisualState const & | oldState = nullptr |
 | ) |  |  | [private]

Member Data Documentation

Windows::Foundation::Collections::IVector<MasterDetailApp::ViewModels::ItemViewModel> m_items [private]

Definition at line 29 of file MasterDetailPage.h.

The documentation for this struct was generated from the following files:
  • XamlMasterDetail/cppwinrt/MasterDetailPage.h
  • XamlMasterDetail/cppwinrt/MasterDetailPage.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemsDataSource Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • ItemsDataSource
Static Public Member Functions | Static Private Member Functions

ItemsDataSource Struct Reference

#include "ItemsDataSource.h"

List of all members.

Static Public Member Functions

static
Windows::Foundation::Collections::IVector
< Data::Item > 		GetAllItems ()
static Data::Item GetItemById (int id)

Static Private Member Functions

static
Windows::Foundation::Collections::IVector
< Data::Item > 		CreateItems ()

Detailed Description

Definition at line 15 of file ItemsDataSource.h.

Member Function Documentation

static Windows::Foundation::Collections::IVector<Data::Item> CreateItems ( ) [inline, static, private]

Definition at line 29 of file ItemsDataSource.h.

        {
            auto now = winrt::clock::now();

            return winrt::single_threaded_vector<Data::Item>({
                Data::Item(0, now, L"Item 1",
                    LR"(Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer id facilisis lectus. Cras nec convallis ante, quis pulvinar tellus. Integer dictum accumsan pulvinar. Pellentesque eget enim sodales sapien vestibulum consequat.

Maecenas eu sapien ac urna aliquam dictum.

Nullam eget mattis metus.Donec pharetra, tellus in mattis tincidunt, magna ipsum gravida nibh, vitae lobortis ante odio vel quam.)"),
                Data::Item(1, now, L"Item 2",
                LR"(Quisque accumsan pretium ligula in faucibus. Mauris sollicitudin augue vitae lorem cursus condimentum quis ac mauris. Pellentesque quis turpis non nunc pretium sagittis. Nulla facilisi. Maecenas eu lectus ante. Proin eleifend vel lectus non tincidunt. Fusce condimentum luctus nisi, in elementum ante tincidunt nec.

Aenean in nisl at elit venenatis blandit ut vitae lectus.Praesent in sollicitudin nunc.Pellentesque justo augue, pretium at sem lacinia, scelerisque semper erat.Ut cursus tortor at metus lacinia dapibus.)"),
                Data::Item(2, now, L"Item 3",
                LR"(Ut consequat magna luctus justo egestas vehicula. Integer pharetra risus libero, et posuere justo mattis et.

Proin malesuada, libero vitae aliquam venenatis, diam est faucibus felis, vitae efficitur erat nunc non mauris.Suspendisse at sodales erat.
Aenean vulputate, turpis non tincidunt ornare, metus est sagittis erat, id lobortis orci odio eget quam.Suspendisse ex purus, lobortis quis suscipit a, volutpat vitae turpis.)"),
                Data::Item(3, now, L"Item 4",
                LR"(Duis facilisis, quam ut laoreet commodo, elit ex aliquet massa, non varius tellus lectus et nunc. Donec vitae risus ut ante pretium semper. Phasellus consectetur volutpat orci, eu dapibus turpis. Fusce varius sapien eu mattis pharetra.

Nam vulputate eu erat ornare blandit.Proin eget lacinia erat.Praesent nisl lectus, pretium eget leo et, dapibus dapibus velit.Integer at bibendum mi, et fringilla sem.)"),
                });
        }

static Windows::Foundation::Collections::IVector<Data::Item> GetAllItems ( ) [inline, static]

Definition at line 17 of file ItemsDataSource.h.

        {
            static auto items = CreateItems();
            return items;
        }

static Data::Item GetItemById ( int id ) [inline, static]

Definition at line 23 of file ItemsDataSource.h.

        {
            return GetAllItems().GetAt(id);
        }

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/ItemsDataSource.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemViewModel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • ViewModels
  • factory_implementation
  • ItemViewModel

ItemViewModel Struct Reference

Detailed Description

Definition at line 51 of file ItemViewModel.cpp.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/ItemViewModel.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ItemViewModel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • MasterDetailApp
  • ViewModels
  • implementation
  • ItemViewModel
Public Member Functions | Public Attributes

ItemViewModel Struct Reference

List of all members.

Public Member Functions

ItemViewModel (MasterDetailApp::Data::Item const &item)

Public Attributes

Windows::Foundation::DateTime const | m_dateCreated
hstring | m_text
hstring const | m_title

Detailed Description

Definition at line 17 of file ItemViewModel.cpp.

Constructor & Destructor Documentation

ItemViewModel ( MasterDetailApp::Data::Item const & item ) [inline]

Definition at line 19 of file ItemViewModel.cpp.

                                                           :
            m_id{ item.ItemId() }, m_title{ item.Title() },

Member Data Documentation

Windows::Foundation::DateTime const m_dateCreated

Definition at line 45 of file ItemViewModel.cpp.

hstring m_text

Definition at line 44 of file ItemViewModel.cpp.

hstring const m_title

Definition at line 20 of file ItemViewModel.cpp.

The documentation for this struct was generated from the following file:
  • XamlMasterDetail/cppwinrt/ItemViewModel.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RandomNumberGeneratorTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • RandomNumberService
  • factory_implementation
  • RandomNumberGeneratorTask

RandomNumberGeneratorTask Struct Reference

#include "RandomNumberGeneratorTask.h"

Detailed Description

Definition at line 26 of file RandomNumberGeneratorTask.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RandomNumberGeneratorTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • RandomNumberService
  • implementation
  • RandomNumberGeneratorTask
Public Member Functions | Private Member Functions | Private Attributes

RandomNumberGeneratorTask Struct Reference

#include "RandomNumberGeneratorTask.h"

List of all members.

Public Member Functions

RandomNumberGeneratorTask ()
void | Run (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance)

Private Member Functions

fire_and_forget | OnRequestReceived (Windows::ApplicationModel::AppService::AppServiceConnection const &, Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs const &args)
void | OnTaskCanceled (Windows::ApplicationModel::Background::IBackgroundTaskInstance const &, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason const &)

Private Attributes

std::mt19937 | randomNumberGenerator

Detailed Description

Definition at line 8 of file RandomNumberGeneratorTask.h.

Constructor & Destructor Documentation

RandomNumberGeneratorTask ( )

Member Function Documentation

fire_and_forget OnRequestReceived | ( | Windows::ApplicationModel::AppService::AppServiceConnection const & | ,
 |  | Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs const & | args |
 | ) |  |  | [private]
void OnTaskCanceled | ( | Windows::ApplicationModel::Background::IBackgroundTaskInstance const & | ,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCancellationReason const & |  |
 | ) |  |  | [private]
void Run ( Windows::ApplicationModel::Background::IBackgroundTaskInstance const & taskInstance )

Member Data Documentation

std::mt19937 randomNumberGenerator [private]

Definition at line 15 of file RandomNumberGeneratorTask.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • Sample
  • factory_implementation
  • LinguisticServices

LinguisticServices Struct Reference

#include "LinguisticServices.h"

Detailed Description

Definition at line 18 of file LinguisticServices.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/RuntimeComponent/LinguisticServices.h
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • Sample
  • implementation
  • LinguisticServices
Static Public Member Functions

LinguisticServices Struct Reference

#include "LinguisticServices.h"

List of all members.

Static Public Member Functions

static
Windows::Foundation::Collections::IVectorView
< hstring > 		RecognizeTextLanguages (hstring const &text)
static
Windows::Foundation::Collections::IVectorView
< RecognizedTextRun > 		RecognizeTextScripts (hstring const &text)
static hstring TransliterateFromCyrillicToLatin (hstring const &text)

Detailed Description

Definition at line 7 of file LinguisticServices.h.

Member Function Documentation

Windows::Foundation::Collections::IVectorView< hstring > RecognizeTextLanguages ( hstring const & text ) [static]

Definition at line 4 of file LinguisticServices.cpp.

{
    Windows::Foundation::Collections::IVectorView<hstring> LinguisticServices::RecognizeTextLanguages(hstring const& text)
    {
        std::vector<hstring> results;
        ELS::RecognizeTextLanguages(text.c_str(), text.size(), [&](auto lang)
            {
                results.emplace_back(lang);

Windows::Foundation::Collections::IVectorView< RecognizedTextRun > RecognizeTextScripts ( hstring const & text ) [static]

Definition at line 14 of file LinguisticServices.cpp.

    {
        std::vector<RecognizedTextRun> results;
        ELS::RecognizeTextScripts(text.c_str(), text.size(), [&](auto first, auto last, auto script)
            {
                results.emplace_back(RecognizedTextRun{ first, last, script });

hstring TransliterateFromCyrillicToLatin ( hstring const & text ) [static]

Definition at line 24 of file LinguisticServices.cpp.

    {
        hstring result;
        ELS::TransliterateFromCyrillicToLatin(text.c_str(), text.size(), [&](auto latin, auto length)
            {
                result = hstring(latin, length);

The documentation for this struct was generated from the following files:
  • LinguisticServices/RuntimeComponent/LinguisticServices.h
  • LinguisticServices/RuntimeComponent/LinguisticServices.cpp
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Constants Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • Constants
Public Attributes

Constants Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Attributes

constexpr wchar_t | ConnectEntryPoint [] = "BackgroundTask.ConnectTask"
constexpr wchar_t | ConnectTaskName [] = "ConnectTask"
constexpr wchar_t | DeviceWatcherTaskName [] = "DeviceWatcherTask"
constexpr wchar_t | MetadataUpdateEntryPoint [] = "BackgroundTask.UpdateMetadataTask"
constexpr wchar_t | MetadataUpdateTaskName [] = "UpdateMetadataTask"

Detailed Description

Definition at line 17 of file SampleConfiguration.h.

Member Data Documentation

constexpr wchar_t ConnectEntryPoint[] = "BackgroundTask.ConnectTask" [inline]

Definition at line 31 of file SampleConfiguration.h.

constexpr wchar_t ConnectTaskName[] = "ConnectTask" [inline]

Definition at line 30 of file SampleConfiguration.h.

constexpr wchar_t DeviceWatcherTaskName[] = "DeviceWatcherTask" [inline]

Definition at line 36 of file SampleConfiguration.h.

constexpr wchar_t MetadataUpdateEntryPoint[] = "BackgroundTask.UpdateMetadataTask" [inline]

Definition at line 26 of file SampleConfiguration.h.

constexpr wchar_t MetadataUpdateTaskName[] = "UpdateMetadataTask" [inline]

Definition at line 25 of file SampleConfiguration.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/SampleConfiguration.h
  • OnDemandHotspot/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceWatcherHelper Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • DeviceWatcherHelper
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

DeviceWatcherHelper Struct Reference

#include "DeviceWatcherHelper.h"

List of all members.

Public Member Functions

DeviceWatcherHelper (Windows::Foundation::Collections::IObservableVector< SDKTemplate::DeviceInformationDisplay > const &resultCollection, Windows::UI::Core::CoreDispatcher const &dispatcher)
event_token | DeviceChanged (Windows::Foundation::TypedEventHandler< Windows::Devices::Enumeration::DeviceWatcher, hstring > const &handler)
void | DeviceChanged (event_token const &token)
bool | IsWatcherRunning ()
void | Reset ()
void | StartWatcher (Windows::Devices::Enumeration::DeviceWatcher const &deviceWatcher)
void | StopWatcher ()
void | UpdateStatus (bool update)

Private Member Functions

void | RaiseDeviceChanged (Windows::Devices::Enumeration::DeviceWatcher const &sender, hstring const &id)
fire_and_forget | Watcher_DeviceAdded (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformation deviceInfo)
fire_and_forget | Watcher_DeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
fire_and_forget | Watcher_DeviceUpdated (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
fire_and_forget | Watcher_EnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher sender, IInspectable const &)
fire_and_forget | Watcher_Stopped (Windows::Devices::Enumeration::DeviceWatcher sender, IInspectable const &)

Static Private Member Functions

static bool | IsWatcherStarted (Windows::Devices::Enumeration::DeviceWatcher const &deviceWatcher)

Private Attributes

event
< Windows::Foundation::TypedEventHandler
< Windows::Devices::Enumeration::DeviceWatcher,
hstring > > 		deviceChanged
bool | updateStatus = true

Detailed Description

Definition at line 16 of file DeviceWatcherHelper.h.

Constructor & Destructor Documentation

DeviceWatcherHelper | ( | Windows::Foundation::Collections::IObservableVector< SDKTemplate::DeviceInformationDisplay > const & | resultCollection,
 |  | Windows::UI::Core::CoreDispatcher const & | dispatcher |
 | ) |  |  | [inline]

Definition at line 18 of file DeviceWatcherHelper.h.

                                                           :
            resultCollection(resultCollection), dispatcher(dispatcher) { }

Member Function Documentation

event_token DeviceChanged ( Windows::Foundation::TypedEventHandler< Windows::Devices::Enumeration::DeviceWatcher, hstring > const & handler ) [inline]

Definition at line 23 of file DeviceWatcherHelper.h.

        {
            return deviceChanged.add(handler);
        }

void DeviceChanged ( event_token const & token ) [inline]

Definition at line 28 of file DeviceWatcherHelper.h.

        {
            deviceChanged.remove(token);
        };

bool IsWatcherRunning ( )

Definition at line 70 of file DeviceWatcherHelper.cpp.

    {
        if (deviceWatcher == nullptr)
        {
            return false;
        }

        DeviceWatcherStatus status = deviceWatcher.Status();
        return (status == DeviceWatcherStatus::Started) ||
            (status == DeviceWatcherStatus::EnumerationCompleted) ||
            (status == DeviceWatcherStatus::Stopping);
    }

static bool IsWatcherStarted ( Windows::Devices::Enumeration::DeviceWatcher const & deviceWatcher ) [static, private]
void RaiseDeviceChanged | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | hstring const & | id |
 | ) |  |  | [private]
void Reset ( )

Definition at line 54 of file DeviceWatcherHelper.cpp.

    {
        if (deviceWatcher != nullptr)
        {
            StopWatcher();
            deviceWatcher = nullptr;
        }
    }

void StartWatcher ( Windows::Devices::Enumeration::DeviceWatcher const & deviceWatcher )
void StopWatcher ( )

Definition at line 39 of file DeviceWatcherHelper.cpp.

    {
        // Since the device watcher runs in the background, it is possible that
        // a notification is "in flight" at the time we stop the watcher.
        // In other words, it is possible for the watcher to become stopped while a
        // handler is running, or for a handler to run after the watcher has stopped.

        if (IsWatcherStarted(deviceWatcher))
        {
            // We do not null out the deviceWatcher yet because we want to receive
            // the Stopped event.
            deviceWatcher.Stop();
        }
    }

void UpdateStatus ( bool update ) [inline]

Definition at line 33 of file DeviceWatcherHelper.h.

        {
            updateStatus = update;
        }

fire_and_forget Watcher_DeviceAdded | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformation | deviceInfo |
 | ) |  |  | [private]
fire_and_forget Watcher_DeviceRemoved | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
fire_and_forget Watcher_DeviceUpdated | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
fire_and_forget Watcher_EnumerationCompleted | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget Watcher_Stopped | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]

Member Data Documentation

event<Windows::Foundation::TypedEventHandler<Windows::Devices::Enumeration::DeviceWatcher, hstring> > deviceChanged [private]

Definition at line 48 of file DeviceWatcherHelper.h.

bool updateStatus = true [private]

Definition at line 47 of file DeviceWatcherHelper.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.h
  • DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EmbeddedMFAsyncCallback< Callback > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • EmbeddedMFAsyncCallback< Callback >
Public Member Functions | Static Public Member Functions | Public Attributes

EmbeddedMFAsyncCallback< Callback > Struct Template Reference

#include "Common.h"

Inherits IMFAsyncCallback.

List of all members.

Public Member Functions

EmbeddedMFAsyncCallback (ParentPtr parent)
STDMETHOD() | GetParameters (DWORD *flags, DWORD *queueId) final
STDMETHOD() | Invoke (IMFAsyncResult *result) final
STDMETHOD() | QueryInterface (REFIID riid, void **ppvObject) final
void | SetQueueID (DWORD queueId)
STDMETHOD_ (ULONG, AddRef)() final
STDMETHOD_ (ULONG, Release)() final

Static Public Member Functions

template<typename Parent >
static Parent * | parent_finder (HRESULT(Parent::*)(IMFAsyncResult *))

Public Attributes

ParentPtr | m_parent
DWORD | m_queueId = 0

Detailed Description

template<auto Callback>
struct winrt::SDKTemplate::EmbeddedMFAsyncCallback< Callback >

Definition at line 89 of file Common.h.

Constructor & Destructor Documentation

EmbeddedMFAsyncCallback ( ParentPtr parent ) [inline]

Definition at line 97 of file Common.h.

: m_parent(parent) {}

Member Function Documentation

STDMETHOD() GetParameters | ( | DWORD * | flags,
 |  | DWORD * | queueId |
 | ) |  |  | [inline]

Definition at line 114 of file Common.h.

        {
            *flags = 0;
            *queueId = m_queueId;
            return S_OK;
        }

STDMETHOD() Invoke ( IMFAsyncResult * result ) [inline]

Definition at line 121 of file Common.h.

        {
            return (m_parent->*Callback)(result);
        }

static Parent* parent_finder ( HRESULT(Parent::*)(IMFAsyncResult *) ) [inline, static]

Definition at line 91 of file Common.h.

{ return nullptr; }

STDMETHOD() QueryInterface | ( | REFIID | riid,
 |  | void ** | ppvObject |
 | ) |  |  | [inline]

Definition at line 99 of file Common.h.

        {
            if (is_guid_of<::IMFAsyncCallback, ::IUnknown>(riid))
            {
                (*ppvObject) = this;
                AddRef();
                return S_OK;
            }
            *ppvObject = nullptr;
            return E_NOINTERFACE;
        }

void SetQueueID ( DWORD queueId ) [inline]

Definition at line 126 of file Common.h.

{ m_queueId = queueId; }

STDMETHOD_ | ( | ULONG | ,
 |  | Release |  |
 | ) |  |  | [inline]

Definition at line 112 of file Common.h.

{ return m_parent->Release(); }

STDMETHOD_ | ( | ULONG | ,
 |  | AddRef |  |
 | ) |  |  | [inline]

Definition at line 111 of file Common.h.

{ return m_parent->AddRef(); }

Member Data Documentation

ParentPtr m_parent

Definition at line 94 of file Common.h.

DWORD m_queueId = 0

Definition at line 95 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ensure_close Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • ensure_close
Public Member Functions | Public Attributes

ensure_close Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

ensure_close (Windows::Foundation::IClosable closable)
ensure_close (ensure_close &&other)
ensure_close (const ensure_close &)
~ensure_close ()
ensure_close & | operator= (ensure_close &&other)
ensure_close & | operator= (const ensure_close &)

Public Attributes

Windows::Foundation::IClosable | m_closable

Detailed Description

Definition at line 20 of file SampleConfiguration.h.

Constructor & Destructor Documentation

ensure_close ( Windows::Foundation::IClosable closable ) [inline]

Definition at line 24 of file SampleConfiguration.h.

: m_closable(std::move(closable)) { }

~ensure_close ( ) [inline]

Definition at line 25 of file SampleConfiguration.h.

{ if (m_closable) m_closable.Close(); }

ensure_close ( const ensure_close & )
ensure_close ( ensure_close && other )

Member Function Documentation

ensure_close& operator= ( const ensure_close & )
ensure_close& operator= ( ensure_close && other )

Member Data Documentation

Windows::Foundation::IClosable m_closable

Definition at line 22 of file SampleConfiguration.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/AppServicesClient/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Errors Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • Errors
Static Public Attributes

Errors Struct Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Attributes

static constexpr wchar_t | Cancel [] = "No result (operation cancelled, no item selected)"
static constexpr wchar_t | FileGroupEmpty [] = "No result (unexpected error: retrieved file group was null)"
static constexpr wchar_t | FileGroupLocation [] = "File groups are only available for library locations, please select a folder from one of your libraries"
static constexpr wchar_t | InvalidSize [] = "Invalid size (specified size must be numerical and greater than zero)"
static constexpr wchar_t | NoAlbumArt [] = "No result (no album art available for this song)"
static constexpr wchar_t | NoExifThumbnail [] = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)"
static constexpr wchar_t | NoIcon [] = "No result (no icon available for this document type)"
static constexpr wchar_t | NoImages [] = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)"
static constexpr wchar_t | NoThumbnail [] = "No result (no thumbnail could be obtained from the selected file)"

Detailed Description

Definition at line 30 of file SampleConfiguration.h.

Member Data Documentation

constexpr wchar_t Cancel[] = "No result (operation cancelled, no item selected)" [static]

Definition at line 39 of file SampleConfiguration.h.

constexpr wchar_t FileGroupEmpty[] = "No result (unexpected error: retrieved file group was null)" [static]

Definition at line 37 of file SampleConfiguration.h.

constexpr wchar_t FileGroupLocation[] = "File groups are only available for library locations, please select a folder from one of your libraries" [static]

Definition at line 38 of file SampleConfiguration.h.

constexpr wchar_t InvalidSize[] = "Invalid size (specified size must be numerical and greater than zero)" [static]

Definition at line 40 of file SampleConfiguration.h.

constexpr wchar_t NoAlbumArt[] = "No result (no album art available for this song)" [static]

Definition at line 34 of file SampleConfiguration.h.

constexpr wchar_t NoExifThumbnail[] = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)" [static]

Definition at line 32 of file SampleConfiguration.h.

constexpr wchar_t NoIcon[] = "No result (no icon available for this document type)" [static]

Definition at line 35 of file SampleConfiguration.h.

constexpr wchar_t NoImages[] = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)" [static]

Definition at line 36 of file SampleConfiguration.h.

constexpr wchar_t NoThumbnail[] = "No result (no thumbnail could be obtained from the selected file)" [static]

Definition at line 33 of file SampleConfiguration.h.

The documentation for this struct was generated from the following file:
  • FileThumbnails/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • BarcodeScannerInfo

BarcodeScannerInfo Struct Reference

#include "BarcodeScannerInfo.h"

Detailed Description

Definition at line 44 of file BarcodeScannerInfo.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/BarcodeScannerInfo.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BindingHelpers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • BindingHelpers

BindingHelpers Struct Reference

#include "BindingHelpers.h"

Detailed Description

Definition at line 34 of file BindingHelpers.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/BindingHelpers.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectionSettingsPanel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • ConnectionSettingsPanel

ConnectionSettingsPanel Struct Reference

#include "ConnectionSettingsPanel.h"

Detailed Description

Definition at line 35 of file ConnectionSettingsPanel.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/ConnectionSettingsPanel.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyFiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • CopyFiles

CopyFiles Struct Reference

#include "CopyFiles.h"

Detailed Description

Definition at line 33 of file CopyFiles.h.

The documentation for this struct was generated from the following file:
  • Clipboard/cppwinrt/CopyFiles.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • CopyImage

CopyImage Struct Reference

#include "CopyImage.h"

Detailed Description

Definition at line 37 of file CopyImage.h.

The documentation for this struct was generated from the following file:
  • Clipboard/cppwinrt/CopyImage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • CopyText

CopyText Struct Reference

#include "CopyText.h"

Detailed Description

Definition at line 45 of file CopyText.h.

The documentation for this struct was generated from the following file:
  • Clipboard/cppwinrt/CopyText.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTextBox Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • CustomTextBox

CustomTextBox Struct Reference

#include "Scenario1_Launch.h"

Detailed Description

Definition at line 49 of file Scenario1_Launch.h.

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario1_Launch.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTitleBar Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • CustomTitleBar

CustomTitleBar Struct Reference

#include "CustomTitleBar.h"

Detailed Description

Definition at line 44 of file CustomTitleBar.h.

The documentation for this struct was generated from the following file:
  • TitleBar/cppwinrt/CustomTitleBar.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailsPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • DetailsPage

DetailsPage Struct Reference

#include "DetailsPage.h"

Detailed Description

Definition at line 43 of file DetailsPage.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/DetailsPage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdgeTappedListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • EdgeTappedListView

EdgeTappedListView Struct Reference

#include "EdgeTappedListView.h"

Detailed Description

Definition at line 78 of file EdgeTappedListView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/EdgeTappedListView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GroupInfoList Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • GroupInfoList

GroupInfoList Struct Reference

#include "GroupInfoList.h"

Detailed Description

Definition at line 44 of file GroupInfoList.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/GroupInfoList.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HistoryAndRoaming Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • HistoryAndRoaming

HistoryAndRoaming Struct Reference

#include "HistoryAndRoaming.h"

Detailed Description

Definition at line 41 of file HistoryAndRoaming.h.

The documentation for this struct was generated from the following file:
  • Clipboard/cppwinrt/HistoryAndRoaming.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpJsonContent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • HttpJsonContent

HttpJsonContent Struct Reference

#include "HttpJsonContent.h"

Detailed Description

Definition at line 39 of file HttpJsonContent.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/HttpJsonContent.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImagePage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • ImagePage

ImagePage Struct Reference

#include "ImagePage.h"

Detailed Description

Definition at line 33 of file ImagePage.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/ImagePage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeepConnectionOpenScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • KeepConnectionOpenScenario

KeepConnectionOpenScenario Struct Reference

#include "KeepConnectionOpenScenario.h"

Detailed Description

Definition at line 38 of file KeepConnectionOpenScenario.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrCapturedImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • OcrCapturedImage

OcrCapturedImage Struct Reference

#include "OcrCapturedImage.h"

Detailed Description

Definition at line 81 of file OcrCapturedImage.h.

The documentation for this struct was generated from the following file:
  • OCR/cppwinrt/OcrCapturedImage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrFileImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • OcrFileImage

OcrFileImage Struct Reference

#include "OcrFileImage.h"

Detailed Description

Definition at line 42 of file OcrFileImage.h.

The documentation for this struct was generated from the following file:
  • OCR/cppwinrt/OcrFileImage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OpenCloseConnectionScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • OpenCloseConnectionScenario

OpenCloseConnectionScenario Struct Reference

#include "OpenCloseConnectionScenario.h"

Detailed Description

Definition at line 31 of file OpenCloseConnectionScenario.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OtherScenarios Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • OtherScenarios

OtherScenarios Struct Reference

#include "OtherScenarios.h"

Detailed Description

Definition at line 41 of file OtherScenarios.h.

The documentation for this struct was generated from the following file:
  • Clipboard/cppwinrt/OtherScenarios.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlugInFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • PlugInFilter

PlugInFilter Struct Reference

#include "PlugInFilter.h"

Detailed Description

Definition at line 31 of file PlugInFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/PlugInFilter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario01_GetText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario01_GetText

Scenario01_GetText Struct Reference

#include "Scenario01_GetText.h"

Detailed Description

Definition at line 44 of file Scenario01_GetText.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario01_GetText.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario02_GetStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario02_GetStream

Scenario02_GetStream Struct Reference

#include "Scenario02_GetStream.h"

Detailed Description

Definition at line 40 of file Scenario02_GetStream.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario02_GetStream.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario03_GetList Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario03_GetList

Scenario03_GetList Struct Reference

#include "Scenario03_GetList.h"

Detailed Description

Definition at line 40 of file Scenario03_GetList.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario03_GetList.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario04_PostText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario04_PostText

Scenario04_PostText Struct Reference

#include "Scenario04_PostText.h"

Detailed Description

Definition at line 40 of file Scenario04_PostText.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario04_PostText.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario05_PostStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario05_PostStream

Scenario05_PostStream Struct Reference

#include "Scenario05_PostStream.h"

Detailed Description

Definition at line 40 of file Scenario05_PostStream.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario05_PostStream.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario06_PostMultipart Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario06_PostMultipart

Scenario06_PostMultipart Struct Reference

#include "Scenario06_PostMultipart.h"

Detailed Description

Definition at line 42 of file Scenario06_PostMultipart.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario06_PostMultipart.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario07_PostStreamWithProgress Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario07_PostStreamWithProgress

Scenario07_PostStreamWithProgress Struct Reference

#include "Scenario07_PostStreamWithProgress.h"

Detailed Description

Definition at line 49 of file Scenario07_PostStreamWithProgress.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario08_PostCustomContent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario08_PostCustomContent

Scenario08_PostCustomContent Struct Reference

#include "Scenario08_PostCustomContent.h"

Detailed Description

Definition at line 42 of file Scenario08_PostCustomContent.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario08_PostCustomContent.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario09_GetCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario09_GetCookie

Scenario09_GetCookie Struct Reference

#include "Scenario09_GetCookie.h"

Detailed Description

Definition at line 41 of file Scenario09_GetCookie.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario09_GetCookie.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1

Scenario1 Struct Reference

#include "Scenario1.h"

Detailed Description

Definition at line 34 of file Scenario1.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario1.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario10

Scenario10 Struct Reference

#include "Scenario10.h"

Detailed Description

Definition at line 32 of file Scenario10.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario10.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10_SetCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario10_SetCookie

Scenario10_SetCookie Struct Reference

#include "Scenario10_SetCookie.h"

Detailed Description

Definition at line 32 of file Scenario10_SetCookie.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario10_SetCookie.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario11

Scenario11 Struct Reference

#include "Scenario11.h"

Detailed Description

Definition at line 31 of file Scenario11.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario11.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11_DeleteCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario11_DeleteCookie

Scenario11_DeleteCookie Struct Reference

#include "Scenario11_DeleteCookie.h"

Detailed Description

Definition at line 32 of file Scenario11_DeleteCookie.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario11_DeleteCookie.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario12_DisableCookies Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario12_DisableCookies

Scenario12_DisableCookies Struct Reference

#include "Scenario12_DisableCookies.h"

Detailed Description

Definition at line 43 of file Scenario12_DisableCookies.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario12_DisableCookies.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario13_RetryFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario13_RetryFilter

Scenario13_RetryFilter Struct Reference

#include "Scenario13_RetryFilter.h"

Detailed Description

Definition at line 42 of file Scenario13_RetryFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario13_RetryFilter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario14_MeteredConnectionFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario14_MeteredConnectionFilter

Scenario14_MeteredConnectionFilter Struct Reference

#include "Scenario14_MeteredConnectionFilter.h"

Detailed Description

Definition at line 42 of file Scenario14_MeteredConnectionFilter.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario15_ServerCertificateValidation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario15_ServerCertificateValidation

Scenario15_ServerCertificateValidation Struct Reference

#include "Scenario15_ServerCertificateValidation.h"

Detailed Description

Definition at line 48 of file Scenario15_ServerCertificateValidation.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Advertiser Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Advertiser

Scenario1_Advertiser Struct Reference

#include "Scenario1_Advertiser.h"

Detailed Description

Definition at line 60 of file Scenario1_Advertiser.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/Scenario1_Advertiser.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Analyze Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Analyze

Scenario1_Analyze Struct Reference

#include "Scenario1_Analyze.h"

Detailed Description

Definition at line 28 of file Scenario1_Analyze.h.

The documentation for this struct was generated from the following file:
  • JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basic Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Basic

Scenario1_Basic Struct Reference

#include "Scenario1_Basic.h"

Detailed Description

Definition at line 47 of file Scenario1_Basic.h.

The documentation for this struct was generated from the following file:
  • FullScreenMode/cppwinrt/Scenario1_Basic.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BasicFunctionality Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_BasicFunctionality

Scenario1_BasicFunctionality Struct Reference

#include "Scenario1_BasicFunctionality.h"

Detailed Description

Definition at line 46 of file Scenario1_BasicFunctionality.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basics Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Basics

Scenario1_Basics Struct Reference

#include "Scenario1_Basics.h"

Detailed Description

Definition at line 62 of file Scenario1_Basics.h.

The documentation for this struct was generated from the following file:
  • LampArray/cppwinrt/Scenario1_Basics.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Check Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Check

Scenario1_Check Struct Reference

#include "Scenario1_Check.h"

Detailed Description

Definition at line 40 of file Scenario1_Check.h.

The documentation for this struct was generated from the following file:
  • Capabilities/cppwinrt/Scenario1_Check.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CheckConsentAvailability Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_CheckConsentAvailability

Scenario1_CheckConsentAvailability Struct Reference

#include "Scenario1_CheckConsentAvailability.h"

Detailed Description

Definition at line 31 of file Scenario1_CheckConsentAvailability.h.

The documentation for this struct was generated from the following file:
  • UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Colors Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Colors

Scenario1_Colors Struct Reference

#include "Scenario1_Colors.h"

Detailed Description

Definition at line 49 of file Scenario1_Colors.h.

The documentation for this struct was generated from the following file:
  • TitleBar/cppwinrt/Scenario1_Colors.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Configure Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Configure

Scenario1_Configure Struct Reference

#include "Scenario1_Configure.h"

Detailed Description

Definition at line 29 of file Scenario1_Configure.h.

The documentation for this struct was generated from the following file:
  • LockScreenApps/cppwinrt/Scenario1_Configure.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConfigureMobileHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ConfigureMobileHotspot

Scenario1_ConfigureMobileHotspot Struct Reference

#include "Scenario1_ConfigureMobileHotspot.h"

Detailed Description

Definition at line 44 of file Scenario1_ConfigureMobileHotspot.h.

The documentation for this struct was generated from the following file:
  • MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Data Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Data

Scenario1_Data Struct Reference

#include "Scenario1_Data.h"

Detailed Description

Definition at line 28 of file Scenario1_Data.h.

The documentation for this struct was generated from the following file:
  • Calendar/cppwinrt/Scenario1_Data.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_DataEvents

Scenario1_DataEvents Struct Reference

#include "Scenario1_DataEvents.h"

Detailed Description

Definition at line 39 of file Scenario1_DataEvents.h.

The documentation for this struct was generated from the following file:
  • PresenceSensor/cppwinrt/Scenario1_DataEvents.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DetectInPhoto Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_DetectInPhoto

Scenario1_DetectInPhoto Struct Reference

#include "Scenario1_DetectInPhoto.h"

Detailed Description

Definition at line 45 of file Scenario1_DetectInPhoto.h.

The documentation for this struct was generated from the following file:
  • BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DevicePicker Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_DevicePicker

Scenario1_DevicePicker Struct Reference

#include "Scenario1_DevicePicker.h"

Detailed Description

Definition at line 43 of file Scenario1_DevicePicker.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Discovery Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Discovery

Scenario1_Discovery Struct Reference

#include "Scenario1_Discovery.h"

Detailed Description

Definition at line 60 of file Scenario1_Discovery.h.

The documentation for this struct was generated from the following file:
  • BluetoothLE/cppwinrt/Scenario1_Discovery.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Enable Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Enable

Scenario1_Enable Struct Reference

#include "Scenario1_Enable.h"

Detailed Description

Definition at line 26 of file Scenario1_Enable.h.

The documentation for this struct was generated from the following file:
  • DisablingScreenCapture/cppwinrt/Scenario1_Enable.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ExtractTextSegments Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ExtractTextSegments

Scenario1_ExtractTextSegments Struct Reference

#include "Scenario1_ExtractTextSegments.h"

Detailed Description

Definition at line 32 of file Scenario1_ExtractTextSegments.h.

The documentation for this struct was generated from the following file:
  • TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Files Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Files

Scenario1_Files Struct Reference

#include "Scenario1_Files.h"

Detailed Description

Definition at line 49 of file Scenario1_Files.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario1_Files.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindId Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_FindId

Scenario1_FindId Struct Reference

#include "Scenario1_FindId.h"

Detailed Description

Definition at line 29 of file Scenario1_FindId.h.

The documentation for this struct was generated from the following file:
  • Unicode/cppwinrt/Scenario1_FindId.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindUsers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_FindUsers

Scenario1_FindUsers Struct Reference

#include "Scenario1_FindUsers.h"

Detailed Description

Definition at line 32 of file Scenario1_FindUsers.h.

The documentation for this struct was generated from the following file:
  • UserInfo/cppwinrt/Scenario1_FindUsers.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_GetAndSetPin Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_GetAndSetPin

Scenario1_GetAndSetPin Struct Reference

#include "Scenario1_GetAndSetPin.h"

Detailed Description

Definition at line 41 of file Scenario1_GetAndSetPin.h.

The documentation for this struct was generated from the following file:
  • IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_InkCanvasTactileFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_InkCanvasTactileFeedback

Scenario1_InkCanvasTactileFeedback Struct Reference

#include "Scenario1_InkCanvasTactileFeedback.h"

Detailed Description

Definition at line 29 of file Scenario1_InkCanvasTactileFeedback.h.

The documentation for this struct was generated from the following file:
  • PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LanguageDetection Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_LanguageDetection

Scenario1_LanguageDetection Struct Reference

#include "Scenario1_LanguageDetection.h"

Detailed Description

Definition at line 29 of file Scenario1_LanguageDetection.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/cppwinrt/Scenario1_LanguageDetection.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launch Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Launch

Scenario1_Launch Struct Reference

#include "Scenario1_Launch.h"

Detailed Description

Definition at line 27 of file Scenario1_Launch.h.

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario1_Launch.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launched Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Launched

Scenario1_Launched Struct Reference

#include "Scenario1_Launched.h"

Detailed Description

Definition at line 28 of file Scenario1_Launched.h.

The documentation for this struct was generated from the following file:
  • JumpList/cppwinrt/Scenario1_Launched.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LongAndShortFormats Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_LongAndShortFormats

Scenario1_LongAndShortFormats Struct Reference

#include "Scenario1_LongAndShortFormats.h"

Detailed Description

Definition at line 28 of file Scenario1_LongAndShortFormats.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ManageHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ManageHotspot

Scenario1_ManageHotspot Struct Reference

#include "Scenario1_ManageHotspot.h"

Detailed Description

Definition at line 39 of file Scenario1_ManageHotspot.h.

The documentation for this struct was generated from the following file:
  • OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_MoveCertificate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_MoveCertificate

Scenario1_MoveCertificate Struct Reference

#include "Scenario1_MoveCertificate.h"

Detailed Description

Definition at line 36 of file Scenario1_MoveCertificate.h.

The documentation for this struct was generated from the following file:
  • UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_NetworkConnectivity Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_NetworkConnectivity

Scenario1_NetworkConnectivity Struct Reference

#include "Scenario1_NetworkConnectivity.h"

Detailed Description

Definition at line 25 of file Scenario1_NetworkConnectivity.h.

The documentation for this struct was generated from the following file:
  • NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Orientation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Orientation

Scenario1_Orientation Struct Reference

#include "Scenario1_Orientation.h"

Detailed Description

Definition at line 39 of file Scenario1_Orientation.h.

The documentation for this struct was generated from the following file:
  • DisplayOrientation/cppwinrt/Scenario1_Orientation.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ParseAndStringify Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ParseAndStringify

Scenario1_ParseAndStringify Struct Reference

#include "Scenario1_ParseAndStringify.h"

Detailed Description

Definition at line 41 of file Scenario1_ParseAndStringify.h.

The documentation for this struct was generated from the following file:
  • Json/cppwinrt/Scenario1_ParseAndStringify.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PercentPermilleFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_PercentPermilleFormatting

Scenario1_PercentPermilleFormatting Struct Reference

#include "Scenario1_PercentPermilleFormatting.h"

Detailed Description

Definition at line 28 of file Scenario1_PercentPermilleFormatting.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PinTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_PinTile

Scenario1_PinTile Struct Reference

#include "Scenario1_PinTile.h"

Detailed Description

Definition at line 32 of file Scenario1_PinTile.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario1_PinTile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Prefs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Prefs

Scenario1_Prefs Struct Reference

#include "Scenario1_Prefs.h"

Detailed Description

Definition at line 28 of file Scenario1_Prefs.h.

The documentation for this struct was generated from the following file:
  • GlobalizationPreferences/cppwinrt/Scenario1_Prefs.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Print Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Print

Scenario1_Print Struct Reference

#include "Scenario1_Print.h"

Detailed Description

Definition at line 40 of file Scenario1_Print.h.

The documentation for this struct was generated from the following file:
  • 3DPrinting/cppwinrt/Scenario1_Print.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ProvisionTPM Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ProvisionTPM

Scenario1_ProvisionTPM Struct Reference

#include "Scenario1_ProvisionTPM.h"

Detailed Description

Definition at line 39 of file Scenario1_ProvisionTPM.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario1_ProvisionTPM.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ReadData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_ReadData

Scenario1_ReadData Struct Reference

#include "Scenario1_ReadData.h"

Detailed Description

Definition at line 38 of file Scenario1_ReadData.h.

The documentation for this struct was generated from the following file:
  • IoT-I2C/cppwinrt/Scenario1_ReadData.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Render Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Render

Scenario1_Render Struct Reference

#include "Scenario1_Render.h"

Detailed Description

Definition at line 35 of file Scenario1_Render.h.

The documentation for this struct was generated from the following file:
  • PdfDocument/cppwinrt/Scenario1_Render.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Save Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Save

Scenario1_Save Struct Reference

#include "Scenario1_Save.h"

Detailed Description

Definition at line 32 of file Scenario1_Save.h.

The documentation for this struct was generated from the following file:
  • PasswordVault/cppwinrt/Scenario1_Save.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SecondaryWindow Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_SecondaryWindow

Scenario1_SecondaryWindow Struct Reference

#include "Scenario1_SecondaryWindow.h"

Detailed Description

Definition at line 36 of file Scenario1_SecondaryWindow.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/Scenario1_SecondaryWindow.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SimpleListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_SimpleListView

Scenario1_SimpleListView Struct Reference

#include "Scenario1_SimpleListView.h"

Detailed Description

Definition at line 25 of file Scenario1_SimpleListView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario1_SimpleListView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SingleFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_SingleFile

Scenario1_SingleFile Struct Reference

#include "Scenario1_SingleFile.h"

Detailed Description

Definition at line 31 of file Scenario1_SingleFile.h.

The documentation for this struct was generated from the following file:
  • FilePicker/cppwinrt/Scenario1_SingleFile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Toggle Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_Toggle

Scenario1_Toggle Struct Reference

#include "Scenario1_Toggle.h"

Detailed Description

Definition at line 32 of file Scenario1_Toggle.h.

The documentation for this struct was generated from the following file:
  • RadioManager/cppwinrt/Scenario1_Toggle.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackInWebcam Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_TrackInWebcam

Scenario1_TrackInWebcam Struct Reference

#include "Scenario1_TrackInWebcam.h"

Detailed Description

Definition at line 79 of file Scenario1_TrackInWebcam.h.

The documentation for this struct was generated from the following file:
  • BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_TrackPosition

Scenario1_TrackPosition Struct Reference

#include "Scenario1_TrackPosition.h"

Detailed Description

Definition at line 40 of file Scenario1_TrackPosition.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario1_TrackPosition.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UIFonts Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_UIFonts

Scenario1_UIFonts Struct Reference

#include "Scenario1_UIFonts.h"

Detailed Description

Definition at line 29 of file Scenario1_UIFonts.h.

The documentation for this struct was generated from the following file:
  • LanguageFont/cppwinrt/Scenario1_UIFonts.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UTF8 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_UTF8

Scenario1_UTF8 Struct Reference

#include "Scenario1_UTF8.h"

Detailed Description

Definition at line 47 of file Scenario1_UTF8.h.

The documentation for this struct was generated from the following file:
  • WebSocket/cppwinrt/Scenario1_UTF8.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_XmlReader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario1_XmlReader

Scenario1_XmlReader Struct Reference

#include "Scenario1_XmlReader.h"

Detailed Description

Definition at line 32 of file Scenario1_XmlReader.h.

The documentation for this struct was generated from the following file:
  • XmlLite/cppwinrt/Scenario1_XmlReader.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2

Scenario2 Struct Reference

#include "Scenario2.h"

Detailed Description

Definition at line 36 of file Scenario2.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario2.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Binary Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Binary

Scenario2_Binary Struct Reference

#include "Scenario2_Binary.h"

Detailed Description

Definition at line 45 of file Scenario2_Binary.h.

The documentation for this struct was generated from the following file:
  • WebSocket/cppwinrt/Scenario2_Binary.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ChangePIN Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_ChangePIN

Scenario2_ChangePIN Struct Reference

#include "Scenario2_ChangePIN.h"

Detailed Description

Definition at line 32 of file Scenario2_ChangePIN.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario2_ChangePIN.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Client Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Client

Scenario2_Client Struct Reference

#include "Scenario2_Client.h"

Detailed Description

Definition at line 57 of file Scenario2_Client.h.

The documentation for this struct was generated from the following file:
  • BluetoothLE/cppwinrt/Scenario2_Client.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Connector Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Connector

Scenario2_Connector Struct Reference

#include "Scenario2_Connector.h"

Detailed Description

Definition at line 61 of file Scenario2_Connector.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/Scenario2_Connector.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DecimalFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_DecimalFormatting

Scenario2_DecimalFormatting Struct Reference

#include "Scenario2_DecimalFormatting.h"

Detailed Description

Definition at line 28 of file Scenario2_DecimalFormatting.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DetectInWebcam Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_DetectInWebcam

Scenario2_DetectInWebcam Struct Reference

#include "Scenario2_DetectInWebcam.h"

Detailed Description

Definition at line 78 of file Scenario2_DetectInWebcam.h.

The documentation for this struct was generated from the following file:
  • BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_DeviceWatcher

Scenario2_DeviceWatcher Struct Reference

#include "Scenario2_DeviceWatcher.h"

Detailed Description

Definition at line 42 of file Scenario2_DeviceWatcher.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Disable Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Disable

Scenario2_Disable Struct Reference

#include "Scenario2_Disable.h"

Detailed Description

Definition at line 28 of file Scenario2_Disable.h.

The documentation for this struct was generated from the following file:
  • DisablingScreenCapture/cppwinrt/Scenario2_Disable.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DisplayRegion Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_DisplayRegion

Scenario2_DisplayRegion Struct Reference

#include "Scenario2_DisplayRegion.h"

Detailed Description

Definition at line 39 of file Scenario2_DisplayRegion.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/Scenario2_DisplayRegion.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DocumentFonts Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_DocumentFonts

Scenario2_DocumentFonts Struct Reference

#include "Scenario2_DocumentFonts.h"

Detailed Description

Definition at line 28 of file Scenario2_DocumentFonts.h.

The documentation for this struct was generated from the following file:
  • LanguageFont/cppwinrt/Scenario2_DocumentFonts.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Effects Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Effects

Scenario2_Effects Struct Reference

#include "Scenario2_Effects.h"

Detailed Description

Definition at line 155 of file Scenario2_Effects.h.

The documentation for this struct was generated from the following file:
  • LampArray/cppwinrt/Scenario2_Effects.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Extend Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Extend

Scenario2_Extend Struct Reference

#include "Scenario2_Extend.h"

Detailed Description

Definition at line 40 of file Scenario2_Extend.h.

The documentation for this struct was generated from the following file:
  • TitleBar/cppwinrt/Scenario2_Extend.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetCurrentTextSegmentFromIndex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_GetCurrentTextSegmentFromIndex

Scenario2_GetCurrentTextSegmentFromIndex Struct Reference

#include "Scenario2_GetCurrentTextSegmentFromIndex.h"

Detailed Description

Definition at line 32 of file Scenario2_GetCurrentTextSegmentFromIndex.h.

The documentation for this struct was generated from the following file:
  • TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_GetPosition

Scenario2_GetPosition Struct Reference

#include "Scenario2_GetPosition.h"

Detailed Description

Definition at line 38 of file Scenario2_GetPosition.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario2_GetPosition.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Lang Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Lang

Scenario2_Lang Struct Reference

#include "Scenario2_Lang.h"

Detailed Description

Definition at line 28 of file Scenario2_Lang.h.

The documentation for this struct was generated from the following file:
  • GlobalizationPreferences/cppwinrt/Scenario2_Lang.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Launch Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Launch

Scenario2_Launch Struct Reference

#include "Scenario2_Launch.h"

Detailed Description

Definition at line 34 of file Scenario2_Launch.h.

The documentation for this struct was generated from the following file:
  • 3DPrinting/cppwinrt/Scenario2_Launch.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Listen Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Listen

Scenario2_Listen Struct Reference

#include "Scenario2_Listen.h"

Detailed Description

Definition at line 50 of file Scenario2_Listen.h.

The documentation for this struct was generated from the following file:
  • IoT-GPIO/cppwinrt/Scenario2_Listen.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Manage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Manage

Scenario2_Manage Struct Reference

#include "Scenario2_Manage.h"

Detailed Description

Definition at line 34 of file Scenario2_Manage.h.

The documentation for this struct was generated from the following file:
  • PasswordVault/cppwinrt/Scenario2_Manage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Memory Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Memory

Scenario2_Memory Struct Reference

#include "Scenario2_Memory.h"

Detailed Description

Definition at line 40 of file Scenario2_Memory.h.

The documentation for this struct was generated from the following file:
  • PersonalDataEncryption/cppwinrt/Scenario2_Memory.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultiFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_MultiFile

Scenario2_MultiFile Struct Reference

#include "Scenario2_MultiFile.h"

Detailed Description

Definition at line 31 of file Scenario2_MultiFile.h.

The documentation for this struct was generated from the following file:
  • FilePicker/cppwinrt/Scenario2_MultiFile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultipleScanners Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_MultipleScanners

Scenario2_MultipleScanners Struct Reference

#include "Scenario2_MultipleScanners.h"

Detailed Description

Definition at line 71 of file Scenario2_MultipleScanners.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_NetworkCost Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_NetworkCost

Scenario2_NetworkCost Struct Reference

#include "Scenario2_NetworkCost.h"

Detailed Description

Definition at line 25 of file Scenario2_NetworkCost.h.

The documentation for this struct was generated from the following file:
  • NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Notifications Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Notifications

Scenario2_Notifications Struct Reference

#include "Scenario2_Notifications.h"

Detailed Description

Definition at line 36 of file Scenario2_Notifications.h.

The documentation for this struct was generated from the following file:
  • LockScreenApps/cppwinrt/Scenario2_Notifications.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Polling

Scenario2_Polling Struct Reference

#include "Scenario2_Polling.h"

Detailed Description

Definition at line 35 of file Scenario2_Polling.h.

The documentation for this struct was generated from the following file:
  • PresenceSensor/cppwinrt/Scenario2_Polling.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Remove Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Remove

Scenario2_Remove Struct Reference

#include "Scenario2_Remove.h"

Detailed Description

Definition at line 29 of file Scenario2_Remove.h.

The documentation for this struct was generated from the following file:
  • JumpList/cppwinrt/Scenario2_Remove.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestConsent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_RequestConsent

Scenario2_RequestConsent Struct Reference

#include "Scenario2_RequestConsent.h"

Detailed Description

Definition at line 31 of file Scenario2_RequestConsent.h.

The documentation for this struct was generated from the following file:
  • UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestMany Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_RequestMany

Scenario2_RequestMany Struct Reference

#include "Scenario2_RequestMany.h"

Detailed Description

Definition at line 31 of file Scenario2_RequestMany.h.

The documentation for this struct was generated from the following file:
  • Capabilities/cppwinrt/Scenario2_RequestMany.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ScriptDetection Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_ScriptDetection

Scenario2_ScriptDetection Struct Reference

#include "Scenario2_ScriptDetection.h"

Detailed Description

Definition at line 28 of file Scenario2_ScriptDetection.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/cppwinrt/Scenario2_ScriptDetection.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Settings Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Settings

Scenario2_Settings Struct Reference

#include "Scenario2_Settings.h"

Detailed Description

Definition at line 39 of file Scenario2_Settings.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario2_Settings.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ShowHideEvents Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_ShowHideEvents

Scenario2_ShowHideEvents Struct Reference

#include "Scenario2_ShowHideEvents.h"

Detailed Description

Definition at line 40 of file Scenario2_ShowHideEvents.h.

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SimpleGridView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_SimpleGridView

Scenario2_SimpleGridView Struct Reference

#include "Scenario2_SimpleGridView.h"

Detailed Description

Definition at line 25 of file Scenario2_SimpleGridView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario2_SimpleGridView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Stats Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_Stats

Scenario2_Stats Struct Reference

#include "Scenario2_Stats.h"

Detailed Description

Definition at line 28 of file Scenario2_Stats.h.

The documentation for this struct was generated from the following file:
  • Calendar/cppwinrt/Scenario2_Stats.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_StringTemplate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_StringTemplate

Scenario2_StringTemplate Struct Reference

#include "Scenario2_StringTemplate.h"

Detailed Description

Definition at line 28 of file Scenario2_StringTemplate.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SupportedTactileFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_SupportedTactileFeedback

Scenario2_SupportedTactileFeedback Struct Reference

#include "Scenario2_SupportedTactileFeedback.h"

Detailed Description

Definition at line 33 of file Scenario2_SupportedTactileFeedback.h.

The documentation for this struct was generated from the following file:
  • PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ToggleMobileHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_ToggleMobileHotspot

Scenario2_ToggleMobileHotspot Struct Reference

#include "Scenario2_ToggleMobileHotspot.h"

Detailed Description

Definition at line 33 of file Scenario2_ToggleMobileHotspot.h.

The documentation for this struct was generated from the following file:
  • MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_UnpinTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_UnpinTile

Scenario2_UnpinTile Struct Reference

#include "Scenario2_UnpinTile.h"

Detailed Description

Definition at line 32 of file Scenario2_UnpinTile.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario2_UnpinTile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_WatchUsers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_WatchUsers

Scenario2_WatchUsers Struct Reference

#include "Scenario2_WatchUsers.h"

Detailed Description

Definition at line 58 of file Scenario2_WatchUsers.h.

The documentation for this struct was generated from the following file:
  • UserInfo/cppwinrt/Scenario2_WatchUsers.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_XmlWriter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario2_XmlWriter

Scenario2_XmlWriter Struct Reference

#include "Scenario2_XmlWriter.h"

Detailed Description

Definition at line 32 of file Scenario2_XmlWriter.h.

The documentation for this struct was generated from the following file:
  • XmlLite/cppwinrt/Scenario2_XmlWriter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3

Scenario3 Struct Reference

#include "Scenario3.h"

Detailed Description

Definition at line 35 of file Scenario3.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario3.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ActiveSymbologies Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ActiveSymbologies

Scenario3_ActiveSymbologies Struct Reference

#include "Scenario3_ActiveSymbologies.h"

Detailed Description

Definition at line 48 of file Scenario3_ActiveSymbologies.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AppCapture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_AppCapture

Scenario3_AppCapture Struct Reference

#include "Scenario3_AppCapture.h"

Detailed Description

Definition at line 38 of file Scenario3_AppCapture.h.

The documentation for this struct was generated from the following file:
  • DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundDeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_BackgroundDeviceWatcher

Scenario3_BackgroundDeviceWatcher Struct Reference

#include "Scenario3_BackgroundDeviceWatcher.h"

Detailed Description

Definition at line 45 of file Scenario3_BackgroundDeviceWatcher.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_BackgroundTask

Scenario3_BackgroundTask Struct Reference

#include "Scenario3_BackgroundTask.h"

Detailed Description

Definition at line 42 of file Scenario3_BackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario3_BackgroundTask.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CheckUserConsentGroup Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_CheckUserConsentGroup

Scenario3_CheckUserConsentGroup Struct Reference

#include "Scenario3_CheckUserConsentGroup.h"

Detailed Description

Definition at line 34 of file Scenario3_CheckUserConsentGroup.h.

The documentation for this struct was generated from the following file:
  • UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Choosing Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_Choosing

Scenario3_Choosing Struct Reference

#include "Scenario3_Choosing.h"

Detailed Description

Definition at line 45 of file Scenario3_Choosing.h.

The documentation for this struct was generated from the following file:
  • PresenceSensor/cppwinrt/Scenario3_Choosing.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ClientAuthentication Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ClientAuthentication

Scenario3_ClientAuthentication Struct Reference

#include "Scenario3_ClientAuthentication.h"

Detailed Description

Definition at line 49 of file Scenario3_ClientAuthentication.h.

The documentation for this struct was generated from the following file:
  • WebSocket/cppwinrt/Scenario3_ClientAuthentication.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CurrencyFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_CurrencyFormatting

Scenario3_CurrencyFormatting Struct Reference

#include "Scenario3_CurrencyFormatting.h"

Detailed Description

Definition at line 28 of file Scenario3_CurrencyFormatting.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CustomItems Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_CustomItems

Scenario3_CustomItems Struct Reference

#include "Scenario3_CustomItems.h"

Detailed Description

Definition at line 32 of file Scenario3_CustomItems.h.

The documentation for this struct was generated from the following file:
  • JumpList/cppwinrt/Scenario3_CustomItems.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Enum Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_Enum

Scenario3_Enum Struct Reference

#include "Scenario3_Enum.h"

Detailed Description

Definition at line 28 of file Scenario3_Enum.h.

The documentation for this struct was generated from the following file:
  • Calendar/cppwinrt/Scenario3_Enum.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_EnumerateTiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_EnumerateTiles

Scenario3_EnumerateTiles Struct Reference

#include "Scenario3_EnumerateTiles.h"

Detailed Description

Definition at line 32 of file Scenario3_EnumerateTiles.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_InkingFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_InkingFeedback

Scenario3_InkingFeedback Struct Reference

#include "Scenario3_InkingFeedback.h"

Detailed Description

Definition at line 38 of file Scenario3_InkingFeedback.h.

The documentation for this struct was generated from the following file:
  • PenHaptics/cppwinrt/Scenario3_InkingFeedback.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_MasterDetail Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_MasterDetail

Scenario3_MasterDetail Struct Reference

#include "Scenario3_MasterDetail.h"

Detailed Description

Definition at line 42 of file Scenario3_MasterDetail.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario3_MasterDetail.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_NetworkConnectivityChanges Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_NetworkConnectivityChanges

Scenario3_NetworkConnectivityChanges Struct Reference

#include "Scenario3_NetworkConnectivityChanges.h"

Detailed Description

Definition at line 40 of file Scenario3_NetworkConnectivityChanges.h.

The documentation for this struct was generated from the following file:
  • NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ParameterizedTemplate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ParameterizedTemplate

Scenario3_ParameterizedTemplate Struct Reference

#include "Scenario3_ParameterizedTemplate.h"

Detailed Description

Definition at line 28 of file Scenario3_ParameterizedTemplate.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Region Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_Region

Scenario3_Region Struct Reference

#include "Scenario3_Region.h"

Detailed Description

Definition at line 28 of file Scenario3_Region.h.

The documentation for this struct was generated from the following file:
  • GlobalizationPreferences/cppwinrt/Scenario3_Region.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ResetPIN Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ResetPIN

Scenario3_ResetPIN Struct Reference

#include "Scenario3_ResetPIN.h"

Detailed Description

Definition at line 30 of file Scenario3_ResetPIN.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario3_ResetPIN.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SecondaryTiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_SecondaryTiles

Scenario3_SecondaryTiles Struct Reference

#include "Scenario3_SecondaryTiles.h"

Detailed Description

Definition at line 37 of file Scenario3_SecondaryTiles.h.

The documentation for this struct was generated from the following file:
  • LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ServerForeground Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ServerForeground

Scenario3_ServerForeground Struct Reference

#include "Scenario3_ServerForeground.h"

Detailed Description

Definition at line 84 of file Scenario3_ServerForeground.h.

The documentation for this struct was generated from the following file:
  • BluetoothLE/cppwinrt/Scenario3_ServerForeground.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SettingContainer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_SettingContainer

Scenario3_SettingContainer Struct Reference

#include "Scenario3_SettingContainer.h"

Detailed Description

Definition at line 42 of file Scenario3_SettingContainer.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario3_SettingContainer.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ShowHideMethods Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_ShowHideMethods

Scenario3_ShowHideMethods Struct Reference

#include "Scenario3_ShowHideMethods.h"

Detailed Description

Definition at line 35 of file Scenario3_ShowHideMethods.h.

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SingleFolder Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_SingleFolder

Scenario3_SingleFolder Struct Reference

#include "Scenario3_SingleFolder.h"

Detailed Description

Definition at line 31 of file Scenario3_SingleFolder.h.

The documentation for this struct was generated from the following file:
  • FilePicker/cppwinrt/Scenario3_SingleFolder.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Size Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_Size

Scenario3_Size Struct Reference

#include "Scenario3_Size.h"

Detailed Description

Definition at line 36 of file Scenario3_Size.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/Scenario3_Size.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Transliteration Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_Transliteration

Scenario3_Transliteration Struct Reference

#include "Scenario3_Transliteration.h"

Detailed Description

Definition at line 29 of file Scenario3_Transliteration.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/cppwinrt/Scenario3_Transliteration.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_XmlWriterLite Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario3_XmlWriterLite

Scenario3_XmlWriterLite Struct Reference

#include "Scenario3_XmlWriterLite.h"

Detailed Description

Definition at line 32 of file Scenario3_XmlWriterLite.h.

The documentation for this struct was generated from the following file:
  • XmlLite/cppwinrt/Scenario3_XmlWriterLite.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4

Scenario4 Struct Reference

#include "Scenario4.h"

Detailed Description

Definition at line 37 of file Scenario4.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario4.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeAdminKey Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_ChangeAdminKey

Scenario4_ChangeAdminKey Struct Reference

#include "Scenario4_ChangeAdminKey.h"

Detailed Description

Definition at line 30 of file Scenario4_ChangeAdminKey.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario4_ChangeAdminKey.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeSystemGroup Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_ChangeSystemGroup

Scenario4_ChangeSystemGroup Struct Reference

#include "Scenario4_ChangeSystemGroup.h"

Detailed Description

Definition at line 34 of file Scenario4_ChangeSystemGroup.h.

The documentation for this struct was generated from the following file:
  • JumpList/cppwinrt/Scenario4_ChangeSystemGroup.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CharacterGrouping Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_CharacterGrouping

Scenario4_CharacterGrouping Struct Reference

#include "Scenario4_CharacterGrouping.h"

Detailed Description

Definition at line 38 of file Scenario4_CharacterGrouping.h.

The documentation for this struct was generated from the following file:
  • LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompactOverlay Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_CompactOverlay

Scenario4_CompactOverlay Struct Reference

#include "Scenario4_CompactOverlay.h"

Detailed Description

Definition at line 36 of file Scenario4_CompactOverlay.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/Scenario4_CompactOverlay.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompositeSettings Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_CompositeSettings

Scenario4_CompositeSettings Struct Reference

#include "Scenario4_CompositeSettings.h"

Detailed Description

Definition at line 41 of file Scenario4_CompositeSettings.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario4_CompositeSettings.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_EdgeTappedListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_EdgeTappedListView

Scenario4_EdgeTappedListView Struct Reference

#include "Scenario4_EdgeTappedListView.h"

Detailed Description

Definition at line 44 of file Scenario4_EdgeTappedListView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario4_EdgeTappedListView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ForegroundGeofence Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_ForegroundGeofence

Scenario4_ForegroundGeofence Struct Reference

#include "Scenario4_ForegroundGeofence.h"

Detailed Description

Definition at line 61 of file Scenario4_ForegroundGeofence.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario4_ForegroundGeofence.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Input Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_Input

Scenario4_Input Struct Reference

#include "Scenario4_Input.h"

Detailed Description

Definition at line 28 of file Scenario4_Input.h.

The documentation for this struct was generated from the following file:
  • GlobalizationPreferences/cppwinrt/Scenario4_Input.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_InteractionFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_InteractionFeedback

Scenario4_InteractionFeedback Struct Reference

#include "Scenario4_InteractionFeedback.h"

Detailed Description

Definition at line 39 of file Scenario4_InteractionFeedback.h.

The documentation for this struct was generated from the following file:
  • PenHaptics/cppwinrt/Scenario4_InteractionFeedback.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_NumberParsing Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_NumberParsing

Scenario4_NumberParsing Struct Reference

#include "Scenario4_NumberParsing.h"

Detailed Description

Definition at line 28 of file Scenario4_NumberParsing.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario4_NumberParsing.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Override Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_Override

Scenario4_Override Struct Reference

#include "Scenario4_Override.h"

Detailed Description

Definition at line 28 of file Scenario4_Override.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario4_Override.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_PartialReadWrite Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_PartialReadWrite

Scenario4_PartialReadWrite Struct Reference

#include "Scenario4_PartialReadWrite.h"

Detailed Description

Definition at line 46 of file Scenario4_PartialReadWrite.h.

The documentation for this struct was generated from the following file:
  • WebSocket/cppwinrt/Scenario4_PartialReadWrite.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SaveFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_SaveFile

Scenario4_SaveFile Struct Reference

#include "Scenario4_SaveFile.h"

Detailed Description

Definition at line 31 of file Scenario4_SaveFile.h.

The documentation for this struct was generated from the following file:
  • FilePicker/cppwinrt/Scenario4_SaveFile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ShowView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_ShowView

Scenario4_ShowView Struct Reference

#include "Scenario4_ShowView.h"

Detailed Description

Definition at line 29 of file Scenario4_ShowView.h.

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario4_ShowView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Snapshot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_Snapshot

Scenario4_Snapshot Struct Reference

#include "Scenario4_Snapshot.h"

Detailed Description

Definition at line 36 of file Scenario4_Snapshot.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SymbologyAttributes Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_SymbologyAttributes

Scenario4_SymbologyAttributes Struct Reference

#include "Scenario4_SymbologyAttributes.h"

Detailed Description

Definition at line 50 of file Scenario4_SymbologyAttributes.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_TilePinned Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_TilePinned

Scenario4_TilePinned Struct Reference

#include "Scenario4_TilePinned.h"

Detailed Description

Definition at line 32 of file Scenario4_TilePinned.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario4_TilePinned.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_UnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario4_UnicodeExtensions

Scenario4_UnicodeExtensions Struct Reference

#include "Scenario4_UnicodeExtensions.h"

Detailed Description

Definition at line 28 of file Scenario4_UnicodeExtensions.h.

The documentation for this struct was generated from the following file:
  • Calendar/cppwinrt/Scenario4_UnicodeExtensions.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5

Scenario5 Struct Reference

#include "Scenario5.h"

Detailed Description

Definition at line 37 of file Scenario5.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario5.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_DisplayingBarcodePreview Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_DisplayingBarcodePreview

Scenario5_DisplayingBarcodePreview Struct Reference

#include "Scenario5_DisplayingBarcodePreview.h"

Detailed Description

Definition at line 116 of file Scenario5_DisplayingBarcodePreview.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GeofenceBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_GeofenceBackgroundTask

Scenario5_GeofenceBackgroundTask Struct Reference

#include "Scenario5_GeofenceBackgroundTask.h"

Detailed Description

Definition at line 46 of file Scenario5_GeofenceBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GetSingleDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_GetSingleDevice

Scenario5_GetSingleDevice Struct Reference

#include "Scenario5_GetSingleDevice.h"

Detailed Description

Definition at line 37 of file Scenario5_GetSingleDevice.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_InkingAndInteractionFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_InkingAndInteractionFeedback

Scenario5_InkingAndInteractionFeedback Struct Reference

#include "Scenario5_InkingAndInteractionFeedback.h"

Detailed Description

Definition at line 51 of file Scenario5_InkingAndInteractionFeedback.h.

The documentation for this struct was generated from the following file:
  • PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_IsSupported Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_IsSupported

Scenario5_IsSupported Struct Reference

#include "Scenario5_IsSupported.h"

Detailed Description

Definition at line 28 of file Scenario5_IsSupported.h.

The documentation for this struct was generated from the following file:
  • JumpList/cppwinrt/Scenario5_IsSupported.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_LaunchedFromSecondaryTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_LaunchedFromSecondaryTile

Scenario5_LaunchedFromSecondaryTile Struct Reference

#include "Scenario5_LaunchedFromSecondaryTile.h"

Detailed Description

Definition at line 32 of file Scenario5_LaunchedFromSecondaryTile.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Msappdata Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_Msappdata

Scenario5_Msappdata Struct Reference

#include "Scenario5_Msappdata.h"

Detailed Description

Definition at line 33 of file Scenario5_Msappdata.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario5_Msappdata.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RelativePositioning Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_RelativePositioning

Scenario5_RelativePositioning Struct Reference

#include "Scenario5_RelativePositioning.h"

Detailed Description

Definition at line 36 of file Scenario5_RelativePositioning.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/Scenario5_RelativePositioning.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RestoreScrollPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_RestoreScrollPosition

Scenario5_RestoreScrollPosition Struct Reference

#include "Scenario5_RestoreScrollPosition.h"

Detailed Description

Definition at line 45 of file Scenario5_RestoreScrollPosition.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RoundingAndPadding Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_RoundingAndPadding

Scenario5_RoundingAndPadding Struct Reference

#include "Scenario5_RoundingAndPadding.h"

Detailed Description

Definition at line 28 of file Scenario5_RoundingAndPadding.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TimeZone Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_TimeZone

Scenario5_TimeZone Struct Reference

#include "Scenario5_TimeZone.h"

Detailed Description

Definition at line 28 of file Scenario5_TimeZone.h.

The documentation for this struct was generated from the following file:
  • Calendar/cppwinrt/Scenario5_TimeZone.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TriggerCFU Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_TriggerCFU

Scenario5_TriggerCFU Struct Reference

#include "Scenario5_TriggerCFU.h"

Detailed Description

Definition at line 42 of file Scenario5_TriggerCFU.h.

The documentation for this struct was generated from the following file:
  • FilePicker/cppwinrt/Scenario5_TriggerCFU.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_UnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_UnicodeExtensions

Scenario5_UnicodeExtensions Struct Reference

#include "Scenario5_UnicodeExtensions.h"

Detailed Description

Definition at line 28 of file Scenario5_UnicodeExtensions.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_VerifyResponse Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario5_VerifyResponse

Scenario5_VerifyResponse Struct Reference

#include "Scenario5_VerifyResponse.h"

Detailed Description

Definition at line 30 of file Scenario5_VerifyResponse.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario5_VerifyResponse.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6

Scenario6 Struct Reference

#include "Scenario6.h"

Detailed Description

Definition at line 36 of file Scenario6.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario6.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ClearScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_ClearScenario

Scenario6_ClearScenario Struct Reference

#include "Scenario6_ClearScenario.h"

Detailed Description

Definition at line 29 of file Scenario6_ClearScenario.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario6_ClearScenario.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_CustomFilterAddedProps Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_CustomFilterAddedProps

Scenario6_CustomFilterAddedProps Struct Reference

#include "Scenario6_CustomFilterAddedProps.h"

Detailed Description

Definition at line 42 of file Scenario6_CustomFilterAddedProps.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_DeleteTPM Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_DeleteTPM

Scenario6_DeleteTPM Struct Reference

#include "Scenario6_DeleteTPM.h"

Detailed Description

Definition at line 36 of file Scenario6_DeleteTPM.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario6_DeleteTPM.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_GetLastVisit Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_GetLastVisit

Scenario6_GetLastVisit Struct Reference

#include "Scenario6_GetLastVisit.h"

Detailed Description

Definition at line 33 of file Scenario6_GetLastVisit.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario6_GetLastVisit.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_NumeralSystemTranslation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_NumeralSystemTranslation

Scenario6_NumeralSystemTranslation Struct Reference

#include "Scenario6_NumeralSystemTranslation.h"

Detailed Description

Definition at line 28 of file Scenario6_NumeralSystemTranslation.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ScrollIntoView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_ScrollIntoView

Scenario6_ScrollIntoView Struct Reference

#include "Scenario6_ScrollIntoView.h"

Detailed Description

Definition at line 32 of file Scenario6_ScrollIntoView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/Scenario6_ScrollIntoView.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_SecondaryTileNotification Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_SecondaryTileNotification

Scenario6_SecondaryTileNotification Struct Reference

#include "Scenario6_SecondaryTileNotification.h"

Detailed Description

Definition at line 38 of file Scenario6_SecondaryTileNotification.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_TimeZone Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario6_TimeZone

Scenario6_TimeZone Struct Reference

#include "Scenario6_TimeZone.h"

Detailed Description

Definition at line 28 of file Scenario6_TimeZone.h.

The documentation for this struct was generated from the following file:
  • DateTimeFormatting/cppwinrt/Scenario6_TimeZone.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7

Scenario7 Struct Reference

#include "Scenario7.h"

Detailed Description

Definition at line 38 of file Scenario7.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario7.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_DeviceInformationKind Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_DeviceInformationKind

Scenario7_DeviceInformationKind Struct Reference

#include "Scenario7_DeviceInformationKind.h"

Detailed Description

Definition at line 43 of file Scenario7_DeviceInformationKind.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ForegroundVisits Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_ForegroundVisits

Scenario7_ForegroundVisits Struct Reference

#include "Scenario7_ForegroundVisits.h"

Detailed Description

Definition at line 41 of file Scenario7_ForegroundVisits.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario7_ForegroundVisits.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ListAllCards Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_ListAllCards

Scenario7_ListAllCards Struct Reference

#include "Scenario7_ListAllCards.h"

Detailed Description

Definition at line 53 of file Scenario7_ListAllCards.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario7_ListAllCards.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_PinFromAppbar Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_PinFromAppbar

Scenario7_PinFromAppbar Struct Reference

#include "Scenario7_PinFromAppbar.h"

Detailed Description

Definition at line 41 of file Scenario7_PinFromAppbar.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_SetVersion Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_SetVersion

Scenario7_SetVersion Struct Reference

#include "Scenario7_SetVersion.h"

Detailed Description

Definition at line 44 of file Scenario7_SetVersion.h.

The documentation for this struct was generated from the following file:
  • ApplicationData/cppwinrt/Scenario7_SetVersion.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_UsingUnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario7_UsingUnicodeExtensions

Scenario7_UsingUnicodeExtensions Struct Reference

#include "Scenario7_UsingUnicodeExtensions.h"

Detailed Description

Definition at line 28 of file Scenario7_UsingUnicodeExtensions.h.

The documentation for this struct was generated from the following file:
  • NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario8

Scenario8 Struct Reference

#include "Scenario8.h"

Detailed Description

Definition at line 36 of file Scenario8.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario8.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_PairDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario8_PairDevice

Scenario8_PairDevice Struct Reference

#include "Scenario8_PairDevice.h"

Detailed Description

Definition at line 47 of file Scenario8_PairDevice.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_TransmitAPDU Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario8_TransmitAPDU

Scenario8_TransmitAPDU Struct Reference

#include "Scenario8_TransmitAPDU.h"

Detailed Description

Definition at line 30 of file Scenario8_TransmitAPDU.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario8_TransmitAPDU.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_UpdateAsync Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario8_UpdateAsync

Scenario8_UpdateAsync Struct Reference

#include "Scenario8_UpdateAsync.h"

Detailed Description

Definition at line 32 of file Scenario8_UpdateAsync.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_VisitsBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario8_VisitsBackgroundTask

Scenario8_VisitsBackgroundTask Struct Reference

#include "Scenario8_VisitsBackgroundTask.h"

Detailed Description

Definition at line 43 of file Scenario8_VisitsBackgroundTask.h.

The documentation for this struct was generated from the following file:
  • Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario9

Scenario9 Struct Reference

#include "Scenario9.h"

Detailed Description

Definition at line 32 of file Scenario9.h.

The documentation for this struct was generated from the following file:
  • FileAccess/cppwinrt/Scenario9.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_CustomPairDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Scenario9_CustomPairDevice

Scenario9_CustomPairDevice Struct Reference

#include "Scenario9_CustomPairDevice.h"

Detailed Description

Definition at line 65 of file Scenario9_CustomPairDevice.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: School Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • School

School Struct Reference

#include "School.h"

Detailed Description

Definition at line 44 of file School.h.

The documentation for this struct was generated from the following file:
  • Json/cppwinrt/School.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryAppWindowPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • SecondaryAppWindowPage

SecondaryAppWindowPage Struct Reference

#include "SecondaryAppWindowPage.h"

Detailed Description

Definition at line 26 of file SecondaryAppWindowPage.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/SecondaryAppWindowPage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryViewPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • SecondaryViewPage

SecondaryViewPage Struct Reference

#include "SecondaryViewPage.h"

Detailed Description

Definition at line 47 of file SecondaryViewPage.h.

The documentation for this struct was generated from the following file:
  • MultipleViews/cppwinrt/SecondaryViewPage.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShowPackageFamilyName Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • ShowPackageFamilyName

ShowPackageFamilyName Struct Reference

#include "ShowPackageFamilyName.h"

Detailed Description

Definition at line 26 of file ShowPackageFamilyName.h.

The documentation for this struct was generated from the following file:
  • AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SlowInputStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • SlowInputStream

SlowInputStream Struct Reference

#include "SlowInputStream.h"

Detailed Description

Definition at line 31 of file SlowInputStream.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/SlowInputStream.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCardListItem Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • SmartCardListItem

SmartCardListItem Struct Reference

#include "Scenario7_ListAllCards.h"

Detailed Description

Definition at line 57 of file Scenario7_ListAllCards.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario7_ListAllCards.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SymbologyListEntry Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • SymbologyListEntry

SymbologyListEntry Struct Reference

#include "SymbologyListEntry.h"

Detailed Description

Definition at line 54 of file SymbologyListEntry.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/SymbologyListEntry.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: User Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • User

User Struct Reference

#include "User.h"

Detailed Description

Definition at line 58 of file User.h.

The documentation for this struct was generated from the following file:
  • Json/cppwinrt/User.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utils Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • Utils

Utils Struct Reference

#include "SocketReaderWriter.h"

Detailed Description

Definition at line 121 of file SocketReaderWriter.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/SocketReaderWriter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewLifetimeControl Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • factory_implementation
  • ViewLifetimeControl

ViewLifetimeControl Struct Reference

#include "ViewLifetimeControl.h"

Detailed Description

Definition at line 94 of file ViewLifetimeControl.h.

The documentation for this struct was generated from the following file:
  • MultipleViews/cppwinrt/ViewLifetimeControl.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • FileExtensions
Static Public Member Functions

FileExtensions Struct Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static std::vector< hstring >
const & 		Document ()
static std::vector< hstring >
const & 		Image ()
static std::vector< hstring >
const & 		Music ()

Detailed Description

Definition at line 23 of file SampleConfiguration.h.

Member Function Documentation

static std::vector<hstring> const& Document ( ) [static]
static std::vector<hstring> const& Image ( ) [static]
static std::vector<hstring> const& Music ( ) [static]
The documentation for this struct was generated from the following file:
  • FileThumbnails/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileLoggingSessionScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • FileLoggingSessionScenario
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

FileLoggingSessionScenario Class Reference

#include "FileLoggingSessionScenario.h"

List of all members.

Classes

struct | BusySetter

Public Member Functions

Windows::Foundation::IAsyncAction | DoScenarioAsync ()
bool | IsBusy () const noexcept
int | LogFileGeneratedCount () const noexcept
bool | LoggingEnabled () const noexcept
void | StatusChanged (event_token const &token) noexcept
event_token | StatusChanged (StatusChangedHandler const &handler)
Windows::Foundation::IAsyncOperation
< bool > 		ToggleLoggingEnabledDisabledAsync ()

Static Public Member Functions

static FileLoggingSessionScenario & | Instance ()

Private Member Functions

FileLoggingSessionScenario ()
~FileLoggingSessionScenario ()
Windows::Foundation::IAsyncOperation
< Windows::Storage::StorageFile > 		CloseSessionSaveFinalLogFile ()
void | OnAppResuming (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &args)
fire_and_forget | OnAppSuspending (Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e)
void | OnChannelLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel const &sender, Windows::Foundation::IInspectable const &args)
fire_and_forget | OnLogFileGenerated (Windows::Foundation::Diagnostics::IFileLoggingSession const &sender, Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs const &args)
Windows::Foundation::IAsyncAction | PrepareToSuspendAsync ()
void | ResumeLoggingIfApplicable ()
void | StartLogging ()

Private Attributes

std::atomic< int > | _isBusy
bool | _isChannelEnabled = false
bool | _isPreparingForSuspend = false
std::atomic< int > | _logFileGeneratedCount
event< StatusChangedHandler > | _statusChanged

Detailed Description

Definition at line 17 of file FileLoggingSessionScenario.h.

Constructor & Destructor Documentation

~FileLoggingSessionScenario ( ) [private]

Definition at line 29 of file FileLoggingSessionScenario.cpp.

{
}

FileLoggingSessionScenario ( ) [private]

Definition at line 33 of file FileLoggingSessionScenario.cpp.

{
    // Create the logging channel.
    // When an app logs messages to a channel, the messges will go
    // to any sessions which are consuming messages from the channel.
    _channel = LoggingChannel(DEFAULT_CHANNEL_NAME);

    // This sample listens to the channel's events so it can track
    // information about the channel's enablement status.
    _channel.LoggingEnabled({ this, &FileLoggingSessionScenario::OnChannelLoggingEnabled });

    // Attach event handlers for Suspend/Resume.
    Windows::UI::Xaml::Application app = Windows::UI::Xaml::Application::Current();
    app.Suspending({ this, &FileLoggingSessionScenario::OnAppSuspending });
    app.Resuming({ this, &FileLoggingSessionScenario::OnAppResuming });

    // If the app is being launched (not resumed), the following call will
    // activate logging if it had been active at the time of the last suspend.
    ResumeLoggingIfApplicable();
}

Member Function Documentation

IAsyncOperation< StorageFile > CloseSessionSaveFinalLogFile ( ) [private]

Definition at line 276 of file FileLoggingSessionScenario.cpp.

{
    // Tell the session to save its final log file.
    StorageFile finalFileBeforeSuspend = co_await _session.CloseAndSaveToFileAsync();

    if (finalFileBeforeSuspend != nullptr)
    {
        // A final log file was created.
        // Move it to the sample-defined log folder.
        // First, get create/open our sample-defined log folder.
        StorageFolder ourSampleAppLogFolder =
            co_await ApplicationData::Current().LocalFolder().CreateFolderAsync(
                OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
                CreationCollisionOption::OpenIfExists);

        std::wstring logFileName;
        logFileName += L"Log-";
        logFileName += GetTimeStamp();
        logFileName += L".etl";
        co_await finalFileBeforeSuspend.MoveAsync(ourSampleAppLogFolder, logFileName, NameCollisionOption::FailIfExists);

        std::wstring fullPath;
        fullPath += ourSampleAppLogFolder.Path();
        fullPath += L'\\';
        fullPath += logFileName;

        StorageFile movedFile = co_await StorageFile::GetFileFromPathAsync(hstring(fullPath));
        return movedFile;
    }

    return nullptr;
}

IAsyncAction DoScenarioAsync ( )

Definition at line 130 of file FileLoggingSessionScenario.cpp.

{
    // Tell the UI the scenario is busy working.
    BusySetter busy(*this);

    std::wstring messageToLog;

    int messageIndex = 0; // Increments for each logging call.
    int startFileCount = LogFileGeneratedCount();

    const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;

    // To demo logging, loop and log messages until 3 log files have been produced.
    // Each time a new log is created, the FileLoggingSession will notify this sample
    // via the FileLoggingSession::LogFileGenerated event.
    // While not 3 files yet, execute the following code...
    while (LogFileGeneratedCount() - startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
    {
        // Since the channel is added to the session at level Warning, the following
        // message is logged because it is logged at level LoggingLevel.Critical.
        messageToLog = L"Message=";
        messageToLog += std::to_wstring(++messageIndex);
        messageToLog +=
            L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
            L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
        _channel.LogMessage(messageToLog, LoggingLevel::Critical);

        // Since the channel is added to the session at level Warning, the following
        // message is *not* logged because it is logged at LoggingLevel.Information.
        messageToLog = L"Message=";
        messageToLog += std::to_wstring(++messageIndex);
        messageToLog +=
            L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
            L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
        _channel.LogMessage(messageToLog, LoggingLevel::Information);

        int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
        messageToLog = L"Value #";
        messageToLog += std::to_wstring(++messageIndex);
        messageToLog += L':';
        messageToLog += std::to_wstring(value);
        _channel.LogMessage(messageToLog, LoggingLevel::Critical); // 'value' is logged as 14 byte wide character string.
        ++messageIndex;
        _channel.LogValuePair(L"Value", value, LoggingLevel::Critical); // 'value' is logged as a 4-byte integer.

        //
        // Pause every once in a while to simulate application activity outside of logging.
        //

        if (messageIndex % 50 == 0)
        {
            co_await resume_after(std::chrono::milliseconds(5));
        }
    }
}

FileLoggingSessionScenario & Instance ( ) [static]

Definition at line 56 of file FileLoggingSessionScenario.cpp.

{
    static FileLoggingSessionScenario instance;
    return instance;
}

bool IsBusy ( ) const

Definition at line 75 of file FileLoggingSessionScenario.cpp.

{
    return _isBusy != 0;
}

int LogFileGeneratedCount ( ) const

Definition at line 81 of file FileLoggingSessionScenario.cpp.

{
    return _logFileGeneratedCount;
}

bool LoggingEnabled ( ) const

Definition at line 87 of file FileLoggingSessionScenario.cpp.

{
    return _session != nullptr;
}

void OnAppResuming | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
fire_and_forget OnAppSuspending | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs const & | e |
 | ) |  |  | [private]
void OnChannelLoggingEnabled | ( | Windows::Foundation::Diagnostics::ILoggingChannel const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
fire_and_forget OnLogFileGenerated | ( | Windows::Foundation::Diagnostics::IFileLoggingSession const & | sender,
 |  | Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs const & | args |
 | ) |  |  | [private]
IAsyncAction PrepareToSuspendAsync ( ) [private]

Definition at line 212 of file FileLoggingSessionScenario.cpp.

{
    if (_session != nullptr)
    {
        _isPreparingForSuspend = true;

        // Before suspend, save any final log file.
        StorageFile finalLogFile = co_await CloseSessionSaveFinalLogFile();

        // Cleanup the session.
        _session.Close();
        _session = nullptr;

        // Save values used when the app is resumed or started later.
        // Logging is enabled.
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(true));

        // If there's a final log file...
        if (finalLogFile != nullptr)
        {
            // Save the log file name saved at suspend so the sample UI can be
            // updated on resume with that information.
            _settings.Insert(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME, box_value(finalLogFile.Path()));
        }
        else
        {
            _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
        }

        _isPreparingForSuspend = false;
    }
    else
    {
        // Save values used when the app is resumed or started later.
        // Logging is not enabled and no log file was saved.
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(false));
        _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
    }
}

void ResumeLoggingIfApplicable ( ) [private]

Definition at line 256 of file FileLoggingSessionScenario.cpp.

{
    bool loggingEnabled = unbox_value_or(_settings.TryLookup(LOGGING_ENABLED_SETTING_KEY_NAME), true);
    if (loggingEnabled)
    {
        StartLogging();
    }

    // When the sample suspends, it retains state as to whether or not it had
    // generated a new log file at the last suspension. This allows any
    // UI to be updated on resume to reflect that fact.
    hstring pathOfLogFileGeneratedBeforeSuspend = unbox_value_or(_settings.TryLookup(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME), L"");
    if (!pathOfLogFileGeneratedBeforeSuspend.empty())
    {
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGeneratedAtSuspend, pathOfLogFileGeneratedBeforeSuspend));
        _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
    }
}

void StartLogging ( ) [private]

Definition at line 187 of file FileLoggingSessionScenario.cpp.

{
    // If no session exists, create one.
    // NOTE: There are use cases where an application
    // may want to create only a channel for sessions outside
    // of the application itself. See MSDN for details. This
    // sample is the common scenario of an app logging events
    // which it wants to place in its own log file, so it creates
    // a session and channel as a pair. The channel is created
    // during construction of this LoggingScenario class so
    // it already exsits by the time this function is called.
    if (_session == nullptr)
    {
        _session = FileLoggingSession(DEFAULT_SESSION_NAME);
        _session.LogFileGenerated({ this, &FileLoggingSessionScenario::OnLogFileGenerated }); // event+=handler
    }

    // This sample adds the channel at level "warning" to
    // demonstrated how messages logged at more verbose levels
    // are ignored by the session.
    _session.AddLoggingChannel(_channel, LoggingLevel::Warning);
}

void StatusChanged ( event_token const & token )

Definition at line 69 of file FileLoggingSessionScenario.cpp.

{
    _statusChanged.remove(token);
}

event_token StatusChanged ( StatusChangedHandler const & handler )

Definition at line 63 of file FileLoggingSessionScenario.cpp.

{
    return _statusChanged.add(handler);
}

IAsyncOperation< bool > ToggleLoggingEnabledDisabledAsync ( )

Definition at line 94 of file FileLoggingSessionScenario.cpp.

{
    BusySetter busy(*this);

    if (_session != nullptr)
    {
        // Save any final log file.
        StorageFile finalLogFile = co_await CloseSessionSaveFinalLogFile();

        // Cleanup the session and let the sample UI know of the new status.
        _session.Close();
        _session = nullptr;
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGeneratedAtDisable, finalLogFile == nullptr ? L"" : finalLogFile.Path()));
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(false));
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, false));
        co_return false;
    }
    else
    {
        // Enable logging and let the UI know of the new status.
        StartLogging();
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(true));
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, true));
        co_return true;
    }
}

Member Data Documentation

std::atomic<int> _isBusy [private]

Definition at line 94 of file FileLoggingSessionScenario.h.

bool _isChannelEnabled = false [private]

Definition at line 97 of file FileLoggingSessionScenario.h.

bool _isPreparingForSuspend = false [private]

Definition at line 95 of file FileLoggingSessionScenario.h.

std::atomic<int> _logFileGeneratedCount [private]

Definition at line 90 of file FileLoggingSessionScenario.h.

event<StatusChangedHandler> _statusChanged [private]

Definition at line 98 of file FileLoggingSessionScenario.h.

The documentation for this class was generated from the following files:
  • Logging/cppwinrt/FileLoggingSessionScenario.h
  • Logging/cppwinrt/FileLoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileLoggingSessionScenario::BusySetter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • FileLoggingSessionScenario
  • FileLoggingSessionScenario::BusySetter
Public Member Functions | Public Attributes

FileLoggingSessionScenario::BusySetter Struct Reference

List of all members.

Public Member Functions

BusySetter (FileLoggingSessionScenario &scenario)
~BusySetter ()

Public Attributes

FileLoggingSessionScenario & _scenario

Detailed Description

Definition at line 83 of file FileLoggingSessionScenario.h.

Constructor & Destructor Documentation

~BusySetter ( )

Definition at line 384 of file FileLoggingSessionScenario.cpp.

{
    if (0 == --_scenario._isBusy)
    {
        _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
    }
}

BusySetter ( FileLoggingSessionScenario & scenario ) [explicit]

Definition at line 392 of file FileLoggingSessionScenario.cpp.

    : _scenario(scenario)
{
    if (1 == ++_scenario._isBusy)
    {
        _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
    }
}

Member Data Documentation

FileLoggingSessionScenario& _scenario

Definition at line 87 of file FileLoggingSessionScenario.h.

The documentation for this struct was generated from the following files:
  • Logging/cppwinrt/FileLoggingSessionScenario.h
  • Logging/cppwinrt/FileLoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Helpers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • Helpers
Static Public Member Functions

Helpers Struct Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static
Windows::UI::Xaml::Controls::TextBlock 		CreateHeaderTextBlock (param::hstring const &contents)
static
Windows::UI::Xaml::Controls::TextBlock 		CreateLineItemTextBlock (param::hstring const &contents)
static void | DisplayResult (Windows::UI::Xaml::Controls::Image const &image, Windows::UI::Xaml::Controls::TextBlock const &textBlock, Windows::Storage::FileProperties::ThumbnailMode thumbnailMode, uint32_t size, Windows::Storage::IStorageItem const &item, Windows::Storage::FileProperties::StorageItemThumbnail const &thumbnail, bool isGroup)
static
Windows::UI::Xaml::Media::Imaging::BitmapImage 		PlaceholderImage ()
static void | ResetOutput (MainPage const &rootPage, Windows::UI::Xaml::Controls::Image const &image, Windows::UI::Xaml::Controls::TextBlock const &output, Windows::UI::Xaml::Controls::TextBlock const &outputDetails=nullptr)

Detailed Description

Definition at line 43 of file SampleConfiguration.h.

Member Function Documentation

static Windows::UI::Xaml::Controls::TextBlock CreateHeaderTextBlock ( param::hstring const & contents ) [static]
static Windows::UI::Xaml::Controls::TextBlock CreateLineItemTextBlock ( param::hstring const & contents ) [static]
static void DisplayResult | ( | Windows::UI::Xaml::Controls::Image const & | image,
 |  | Windows::UI::Xaml::Controls::TextBlock const & | textBlock,
 |  | Windows::Storage::FileProperties::ThumbnailMode | thumbnailMode,
 |  | uint32_t | size,
 |  | Windows::Storage::IStorageItem const & | item,
 |  | Windows::Storage::FileProperties::StorageItemThumbnail const & | thumbnail,
 |  | bool | isGroup |
 | ) |  |  | [static]
static Windows::UI::Xaml::Media::Imaging::BitmapImage PlaceholderImage ( ) [static]
static void ResetOutput | ( | MainPage const & | rootPage,
 |  | Windows::UI::Xaml::Controls::Image const & | image,
 |  | Windows::UI::Xaml::Controls::TextBlock const & | output,
 |  | Windows::UI::Xaml::Controls::TextBlock const & | outputDetails = nullptr |
 | ) |  |  | [static]
The documentation for this struct was generated from the following files:
  • FileThumbnails/cppwinrt/SampleConfiguration.h
  • FolderEnumeration/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • BarcodeScannerInfo
Public Member Functions | Private Attributes

BarcodeScannerInfo Struct Reference

#include "BarcodeScannerInfo.h"

List of all members.

Public Member Functions

BarcodeScannerInfo (winrt::hstring const &deviceName, winrt::hstring const &deviceId)
winrt::hstring | DeviceId () const
winrt::hstring | Name () const

Private Attributes

winrt::hstring | m_deviceId
winrt::hstring | m_deviceName

Detailed Description

Definition at line 18 of file BarcodeScannerInfo.h.

Constructor & Destructor Documentation

BarcodeScannerInfo | ( | winrt::hstring const & | deviceName,
 |  | winrt::hstring const & | deviceId |
 | ) |  |  | [inline]

Definition at line 20 of file BarcodeScannerInfo.h.

                                                                                :
            m_deviceName(deviceName),
            m_deviceId(deviceId)
        {
        }

Member Function Documentation

winrt::hstring DeviceId ( ) const [inline]

Definition at line 31 of file BarcodeScannerInfo.h.

        {
            return m_deviceId;
        }

winrt::hstring Name ( ) const [inline]

Definition at line 26 of file BarcodeScannerInfo.h.

        {
            return m_deviceName;
        }

Member Data Documentation

winrt::hstring m_deviceId [private]

Definition at line 38 of file BarcodeScannerInfo.h.

winrt::hstring m_deviceName [private]

Definition at line 37 of file BarcodeScannerInfo.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/BarcodeScannerInfo.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BindingHelpers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • BindingHelpers
Static Public Member Functions

BindingHelpers Struct Reference

#include "BindingHelpers.h"

List of all members.

Static Public Member Functions

static
winrt::Windows::UI::Xaml::Visibility 		CollapsedIf (bool value)
static bool Not (bool value)

Detailed Description

Definition at line 18 of file BindingHelpers.h.

Member Function Documentation

static winrt::Windows::UI::Xaml::Visibility CollapsedIf ( bool value ) [inline, static]

Definition at line 25 of file BindingHelpers.h.

        {
            return value ? winrt::Windows::UI::Xaml::Visibility::Collapsed : winrt::Windows::UI::Xaml::Visibility::Visible;
        }

static bool Not ( bool value ) [inline, static]

Definition at line 20 of file BindingHelpers.h.

        {
            return !value;
        }

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/BindingHelpers.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLEDeviceDisplay Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • BluetoothLEDeviceDisplay
Public Member Functions | Private Member Functions | Private Attributes

BluetoothLEDeviceDisplay Struct Reference

#include "BluetoothLEDeviceDisplay.h"

List of all members.

Public Member Functions

BluetoothLEDeviceDisplay (Windows::Devices::Enumeration::DeviceInformation const &deviceInfoIn)
Windows::Devices::Enumeration::DeviceInformation | DeviceInformation ()
Windows::UI::Xaml::Media::Imaging::BitmapImage | GlyphBitmapImage ()
hstring | Id ()
bool | IsConnectable ()
bool | IsConnected ()
bool | IsPaired ()
hstring | Name ()
Windows::Foundation::Collections::IMapView
< hstring,
Windows::Foundation::IInspectable > 		Properties ()
void | PropertyChanged (event_token const &token) noexcept
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | Update (Windows::Devices::Enumeration::DeviceInformationUpdate const &deviceInfoUpdate)

Private Member Functions

bool | LookupBooleanProperty (param::hstring const &property)
void | OnPropertyChanged (param::hstring const &property)
fire_and_forget | UpdateGlyphBitmapImage ()

Private Attributes

event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged

Detailed Description

Definition at line 7 of file BluetoothLEDeviceDisplay.h.

Constructor & Destructor Documentation

BluetoothLEDeviceDisplay ( Windows::Devices::Enumeration::DeviceInformation const & deviceInfoIn )

Definition at line 13 of file BluetoothLEDeviceDisplay.cpp.

        : m_deviceInformation(deviceInfoIn)
    {
        UpdateGlyphBitmapImage();
    }

Member Function Documentation

Windows::Devices::Enumeration::DeviceInformation DeviceInformation ( ) [inline]

Definition at line 11 of file BluetoothLEDeviceDisplay.h.

        {
            return m_deviceInformation;
        }

Windows::UI::Xaml::Media::Imaging::BitmapImage GlyphBitmapImage ( ) [inline]

Definition at line 46 of file BluetoothLEDeviceDisplay.h.

        {
            return m_glyphBitmapImage;
        }

hstring Id ( ) [inline]

Definition at line 16 of file BluetoothLEDeviceDisplay.h.

        {
            return m_deviceInformation.Id();
        }

bool IsConnectable ( ) [inline]

Definition at line 36 of file BluetoothLEDeviceDisplay.h.

        {
            return LookupBooleanProperty(L"System.Devices.Aep.Bluetooth.Le.IsConnectable");
        }

bool IsConnected ( ) [inline]

Definition at line 31 of file BluetoothLEDeviceDisplay.h.

        {
            return LookupBooleanProperty(L"System.Devices.Aep.IsConnected");
        }

bool IsPaired ( ) [inline]

Definition at line 26 of file BluetoothLEDeviceDisplay.h.

        {
            return m_deviceInformation.Pairing().IsPaired();
        }

bool LookupBooleanProperty ( param::hstring const & property ) [private]

Definition at line 19 of file BluetoothLEDeviceDisplay.cpp.

    {
        auto value = m_deviceInformation.Properties().TryLookup(property);
        return value && unbox_value<bool>(value);
    }

hstring Name ( ) [inline]

Definition at line 21 of file BluetoothLEDeviceDisplay.h.

        {
            return m_deviceInformation.Name();
        }

void OnPropertyChanged ( param::hstring const & property ) [private]

Definition at line 50 of file BluetoothLEDeviceDisplay.cpp.

    {
        m_propertyChanged(*this, PropertyChangedEventArgs(property));
    }

Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable> Properties ( ) [inline]

Definition at line 41 of file BluetoothLEDeviceDisplay.h.

        {
            return m_deviceInformation.Properties();
        }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler )
void PropertyChanged ( event_token const & token )

Definition at line 45 of file BluetoothLEDeviceDisplay.cpp.

    {
        m_propertyChanged.remove(token);
    }

void Update ( Windows::Devices::Enumeration::DeviceInformationUpdate const & deviceInfoUpdate )
fire_and_forget UpdateGlyphBitmapImage ( ) [private]

Definition at line 55 of file BluetoothLEDeviceDisplay.cpp.

    {
        auto lifetime = get_strong();
        BitmapImage glyphBitmapImage;
        try
        {
            DeviceThumbnail deviceThumbnail = co_await m_deviceInformation.GetGlyphThumbnailAsync();
            co_await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
        }
        catch (...)
        {
            // Something went wrong getting or decoding the device glyph.
        }
        m_glyphBitmapImage = glyphBitmapImage;
        OnPropertyChanged(L"GlyphBitmapImage");
    }

Member Data Documentation

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 57 of file BluetoothLEDeviceDisplay.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.h
  • BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.cpp
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectedDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ConnectedDevice
Public Member Functions | Private Attributes

ConnectedDevice Struct Reference

#include "SocketReaderWriter.h"

List of all members.

Public Member Functions

ConnectedDevice (hstring displayNameIn, Windows::Devices::WiFiDirect::WiFiDirectDevice const &wfdDeviceIn, com_ptr< SocketReaderWriter > const &socketRWIn)
void | Close ()
auto | DisplayName ()
auto | SocketRW ()
auto | WfdDevice ()

Private Attributes

hstring | displayName
com_ptr< SocketReaderWriter > | socketRW
Windows::Devices::WiFiDirect::WiFiDirectDevice | wfdDevice

Detailed Description

Definition at line 74 of file SocketReaderWriter.h.

Constructor & Destructor Documentation

ConnectedDevice | ( | hstring | displayNameIn,
 |  | Windows::Devices::WiFiDirect::WiFiDirectDevice const & | wfdDeviceIn,
 |  | com_ptr< SocketReaderWriter > const & | socketRWIn |
 | ) |  |  | [inline]

Definition at line 76 of file SocketReaderWriter.h.

            : displayName(std::move(displayNameIn)), wfdDevice(wfdDeviceIn), socketRW(socketRWIn)
        {
        }

Member Function Documentation

void Close ( ) [inline]

Definition at line 84 of file SocketReaderWriter.h.

        {
            wfdDevice.Close();
            socketRW->Close();
        }

auto DisplayName ( ) [inline]

Definition at line 82 of file SocketReaderWriter.h.

{ return displayName; }

auto SocketRW ( ) [inline]

Definition at line 83 of file SocketReaderWriter.h.

{ return socketRW; }

auto WfdDevice ( ) [inline]

Definition at line 81 of file SocketReaderWriter.h.

{ return wfdDevice; }

Member Data Documentation

hstring displayName [private]

Definition at line 90 of file SocketReaderWriter.h.

com_ptr<SocketReaderWriter> socketRW [private]

Definition at line 92 of file SocketReaderWriter.h.

Windows::Devices::WiFiDirect::WiFiDirectDevice wfdDevice [private]

Definition at line 91 of file SocketReaderWriter.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/SocketReaderWriter.h
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ConnectionSettingsPanel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ConnectionSettingsPanel
Public Member Functions | Private Member Functions | Private Attributes

ConnectionSettingsPanel Struct Reference

#include "ConnectionSettingsPanel.h"

List of all members.

Public Member Functions

ConnectionSettingsPanel ()
void | btnAddConfigMethods_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
Windows::Foundation::IAsyncOperation
< bool > 		RequestPairDeviceAsync (Windows::Devices::Enumeration::DeviceInformationPairing pairing)
void | Reset ()

Private Member Functions

void | OnPairingRequested (Windows::Devices::Enumeration::DeviceInformationCustomPairing const &, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs const &e)

Private Attributes

std::vector
< Windows::Devices::WiFiDirect::WiFiDirectConfigurationMethod > 		supportedConfigMethods

Detailed Description

Definition at line 17 of file ConnectionSettingsPanel.h.

Constructor & Destructor Documentation

ConnectionSettingsPanel ( )

Definition at line 25 of file ConnectionSettingsPanel.cpp.

    {
        InitializeComponent();

        auto CreateComboBoxItem = [](hstring const& name, IInspectable const& tag = nullptr)
        {
            ComboBoxItem item;
            item.Content(box_value(name));
            item.Tag(tag);
            return item;
        };

        // Initialize the GroupOwnerIntent combo box.
        // The options are "Default", then values 0 through 15.
        cmbGOIntent().Items().Append(CreateComboBoxItem(L"Default"));
        for (int i = 0; i <= 15; i++)
        {
            cmbGOIntent().Items().Append(CreateComboBoxItem(to_hstring(i), box_value(static_cast<int16_t>(i))));
        }
        cmbGOIntent().SelectedIndex(0);

    }

Member Function Documentation

void btnAddConfigMethods_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnPairingRequested | ( | Windows::Devices::Enumeration::DeviceInformationCustomPairing const & | ,
 |  | Windows::Devices::Enumeration::DevicePairingRequestedEventArgs const & | e |
 | ) |  |  | [private]
Windows::Foundation::IAsyncOperation<bool> RequestPairDeviceAsync ( Windows::Devices::Enumeration::DeviceInformationPairing pairing )
void Reset ( )

Definition at line 48 of file ConnectionSettingsPanel.cpp.

    {
        supportedConfigMethods.clear();
    }

Member Data Documentation

std::vector<Windows::Devices::WiFiDirect::WiFiDirectConfigurationMethod> supportedConfigMethods [private]

Definition at line 27 of file ConnectionSettingsPanel.h.

The documentation for this struct was generated from the following files:
  • WiFiDirect/cppwinrt/ConnectionSettingsPanel.h
  • WiFiDirect/cppwinrt/ConnectionSettingsPanel.cpp
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Contact Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Contact
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes

Contact Struct Reference

#include "Contact.h"

List of all members.

Public Member Functions

hstring | Biography ()
hstring | FirstName ()
hstring | Id ()
hstring | Initials ()
hstring | LastName ()
hstring | Name ()
hstring | PhoneNumber ()
hstring | Position ()

Static Public Member Functions

static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Contact > 		GetContacts (int count)
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::GroupInfoList > 		GetContactsGrouped (int count)
static SDKTemplate::Contact | GetNewContact ()

Static Private Member Functions

static hstring | GenerateBiography ()
static hstring | GenerateFirstName ()
static hstring | GenerateLastName ()
static hstring | GeneratePhoneNumber ()
static hstring | GeneratePosition ()
static hstring | InitialOf (hstring const &word)

Private Attributes

hstring | biography = GenerateBiography()
hstring | firstName = GenerateFirstName()
hstring | id = to_hstring(Windows::Foundation::GuidHelper::CreateNewGuid())
hstring | lastName = GenerateLastName()
hstring | phoneNumber = GeneratePhoneNumber()
hstring | position = GeneratePosition()

Detailed Description

Definition at line 18 of file Contact.h.

Member Function Documentation

hstring Biography ( ) [inline]

Definition at line 27 of file Contact.h.

{ return biography; }

hstring FirstName ( ) [inline]

Definition at line 24 of file Contact.h.

{ return firstName; }

hstring GenerateBiography ( ) [static, private]

Definition at line 85 of file Contact.cpp.

  {
    static std::vector<hstring> const biographies({
      L"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer id facilisis lectus. Cras nec convallis ante, quis pulvinar tellus. Integer dictum accumsan pulvinar. Pellentesque eget enim sodales sapien vestibulum consequat.",
      L"Maecenas eu sapien ac urna aliquam dictum.",
      L"Nullam eget mattis metus. Donec pharetra, tellus in mattis tincidunt, magna ipsum gravida nibh, vitae lobortis ante odio vel quam.",
      L"Quisque accumsan pretium ligula in faucibus. Mauris sollicitudin augue vitae lorem cursus condimentum quis ac mauris. Pellentesque quis turpis non nunc pretium sagittis. Nulla facilisi. Maecenas eu lectus ante. Proin eleifend vel lectus non tincidunt. Fusce condimentum luctus nisi, in elementum ante tincidunt nec.",
      L"Aenean in nisl at elit venenatis blandit ut vitae lectus. Praesent in sollicitudin nunc. Pellentesque justo augue, pretium at sem lacinia, scelerisque semper erat. Ut cursus tortor at metus lacinia dapibus.",
      L"Ut consequat magna luctus justo egestas vehicula. Integer pharetra risus libero, et posuere justo mattis et.",
      L"Proin malesuada, libero vitae aliquam venenatis, diam est faucibus felis, vitae efficitur erat nunc non mauris. Suspendisse at sodales erat.",
      L"Aenean vulputate, turpis non tincidunt ornare, metus est sagittis erat, id lobortis orci odio eget quam. Suspendisse ex purus, lobortis quis suscipit a, volutpat vitae turpis.",
      L"Duis facilisis, quam ut laoreet commodo, elit ex aliquet massa, non varius tellus lectus et nunc. Donec vitae risus ut ante pretium semper. Phasellus consectetur volutpat orci, eu dapibus turpis. Fusce varius sapien eu mattis pharetra.",
      L"Nam vulputate eu erat ornare blandit. Proin eget lacinia erat. Praesent nisl lectus, pretium eget leo et, dapibus dapibus velit. Integer at bibendum mi, et fringilla sem."
      });
    return random_select(biographies);
  }

hstring GenerateFirstName ( ) [static, private]

Definition at line 107 of file Contact.cpp.

  {
    static std::vector<hstring> const names({
      L"Lilly", L"Mukhtar", L"Sophie", L"Femke", L"Abdul-Rafi'", L"Chirag-ud-D...", L"Mariana", L"Aarif", L"Sara",
      L"Ibadah", L"Fakhr", L"Ilene", L"Sardar", L"Hanna", L"Julie", L"Iain", L"Natalia", L"Henrik", L"Rasa", L"Quentin",
      L"Gadi", L"Pernille", L"Ishtar", L"Jimme", L"Justina", L"Lale", L"Elize", L"Rand", L"Roshanara", L"Rajab", L"Bijou",
      L"Marcus", L"Marcus", L"Alima", L"Francisco", L"Thaqib", L"Andreas", L"Mariana", L"Amalie", L"Rodney", L"Dena", L"Fadl",
      L"Ammar", L"Anna", L"Nasreen", L"Reem", L"Tomas", L"Filipa", L"Frank", L"Bari'ah", L"Parvaiz", L"Jibran", L"Tomas",
      L"Elli", L"Carlos", L"Diego", L"Henrik", L"Aruna", L"Vahid", L"Eliana", L"Roxane", L"Amanda", L"Ingrid", L"Wander",
      L"Malika", L"Basim", L"Eisa", L"Alina", L"Andreas", L"Deeba", L"Diya", L"Parveen", L"Bakr", L"Celine", L"Bakr",
      L"Marcus", L"Daniel", L"Mathea", L"Edmee", L"Hedda", L"Maria", L"Maja", L"Alhasan", L"Alina", L"Hedda", L"Victor",
      L"Aaftab", L"Guilherme", L"Maria", L"Kai", L"Sabien", L"Abdel", L"Fadl", L"Bahaar", L"Vasco", L"Jibran", L"Parsa",
      L"Catalina", L"Fouad", L"Colette"
      });
    return random_select(names);
  }

hstring GenerateLastName ( ) [static, private]

Definition at line 124 of file Contact.cpp.

  {
    static std::vector<hstring> const names({
      L"Carlson", L"Attia", L"Quint", L"Hollenberg", L"Khoury", L"Araujo", L"Hakimi", L"Seegers", L"Abadi", L"al",
      L"Krommenhoek", L"Siavashi", L"Kvistad", L"Sjo", L"Vanderslik", L"Fernandes", L"Dehli", L"Sheibani",
      L"Laamers", L"Batlouni", L"Lyngvær", L"Oveisi", L"Veenhuizen", L"Gardenier", L"Siavashi", L"Mutlu", L"Karzai",
      L"Mousavi", L"Natsheh", L"Seegers", L"Nevland", L"Lægreid", L"Bishara", L"Cunha", L"Hotaki", L"Kyvik",
      L"Cardoso", L"Pilskog", L"Pennekamp", L"Nuijten", L"Bettar", L"Borsboom", L"Skistad", L"Asef", L"Sayegh",
      L"Sousa", L"Medeiros", L"Kregel", L"Shamoun", L"Behzadi", L"Kuzbari", L"Ferreira", L"Van", L"Barros",
      L"Fernandes", L"Formo", L"Nolet", L"Shahrestaani", L"Correla", L"Amiri", L"Sousa", L"Fretheim", L"Van",
      L"Hamade", L"Baba", L"Mustafa", L"Bishara", L"Formo", L"Hemmati", L"Nader", L"Hatami", L"Natsheh", L"Langen",
      L"Maloof", L"Berger", L"Ostrem", L"Bardsen", L"Kramer", L"Bekken", L"Salcedo", L"Holter", L"Nader", L"Bettar",
      L"Georgsen", L"Cunha", L"Zardooz", L"Araujo", L"Batalha", L"Antunes", L"Vanderhoorn", L"Nader", L"Abadi",
      L"Siavashi", L"Montes", L"Sherzai", L"Vanderschans", L"Neves", L"Sarraf", L"Kuiters"
      });
    return random_select(names);
  }

hstring GeneratePhoneNumber ( ) [static, private]

Definition at line 102 of file Contact.cpp.

  {
    return L"(" + to_hstring(random_in_range(100, 999)) + L") " + to_hstring(random_in_range(100, 999)) + L"-" + to_hstring(random_in_range(100, 9999));
  }

hstring GeneratePosition ( ) [static, private]

Definition at line 79 of file Contact.cpp.

  {
    static std::vector<hstring> const positions({ L"Program Manager", L"Developer", L"Product Manager", L"Evangelist" });
    return random_select(positions);
  }

IObservableVector< SDKTemplate::Contact > GetContacts ( int count ) [static]

Definition at line 47 of file Contact.cpp.

  {
    std::vector<SDKTemplate::Contact> contacts;
    std::generate_n(std::back_inserter(contacts), count, &Contact::GetNewContact);
    return single_threaded_observable_vector(std::move(contacts));
  }

IObservableVector< SDKTemplate::GroupInfoList > GetContactsGrouped ( int count ) [static]

Definition at line 54 of file Contact.cpp.

  {
    std::map<int, std::vector<SDKTemplate::Contact>> groupMap;

    // Generate the contacts and put each one in a group
    // based on the first letter of the last name.
    for (int i = 0; i < count; i++)
    {
      SDKTemplate::Contact contact = GetNewContact();
      auto upper = toupper(contact.LastName()[0]);
      groupMap[upper].push_back(contact);
    }

    // Generate the list of GroupInfoList object, each representing one group.
    std::vector<SDKTemplate::GroupInfoList> groups;
    for (auto&& [upper, values] : groupMap)
    {
      SDKTemplate::GroupInfoList group;
      group.Key(to_hstring(static_cast<char16_t>(upper)));
      group.ReplaceAll(std::move(values));
      groups.push_back(group);
    }
    return single_threaded_observable_vector(std::move(groups));
  }

static SDKTemplate::Contact GetNewContact ( ) [inline, static]

Definition at line 29 of file Contact.h.

{ return make<Contact>(); }

hstring Id ( ) [inline]

Definition at line 20 of file Contact.h.

{ return id; }

static hstring InitialOf ( hstring const & word ) [inline, static, private]

Definition at line 41 of file Contact.h.

        {
            return hstring(static_cast<std::wstring_view>(word).substr(0, 1));
        }

hstring Initials ( ) [inline]

Definition at line 21 of file Contact.h.

{ return InitialOf(firstName) + InitialOf(lastName); }

hstring LastName ( ) [inline]

Definition at line 23 of file Contact.h.

{ return lastName; }

hstring Name ( ) [inline]

Definition at line 22 of file Contact.h.

{ return firstName + L" " + lastName; }

hstring PhoneNumber ( ) [inline]

Definition at line 26 of file Contact.h.

{ return phoneNumber; }

hstring Position ( ) [inline]

Definition at line 25 of file Contact.h.

{ return position; }

Member Data Documentation

hstring biography = GenerateBiography() [private]

Definition at line 39 of file Contact.h.

hstring firstName = GenerateFirstName() [private]

Definition at line 36 of file Contact.h.

hstring id = to_hstring(Windows::Foundation::GuidHelper::CreateNewGuid()) [private]

Definition at line 34 of file Contact.h.

hstring lastName = GenerateLastName() [private]

Definition at line 35 of file Contact.h.

hstring phoneNumber = GeneratePhoneNumber() [private]

Definition at line 38 of file Contact.h.

hstring position = GeneratePosition() [private]

Definition at line 37 of file Contact.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Contact.h
  • XamlListView/cppwinrt/Contact.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyFiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CopyFiles
Public Member Functions

CopyFiles Struct Reference

#include "CopyFiles.h"

List of all members.

Public Member Functions

CopyFiles ()
fire_and_forget | CopyButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | PasteButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file CopyFiles.h.

Constructor & Destructor Documentation

CopyFiles ( )

Definition at line 27 of file CopyFiles.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CopyButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget PasteButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • Clipboard/cppwinrt/CopyFiles.h
  • Clipboard/cppwinrt/CopyFiles.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CopyImage
Public Member Functions | Private Member Functions | Static Private Member Functions

CopyImage Struct Reference

#include "CopyImage.h"

List of all members.

Public Member Functions

CopyImage ()
void | CopyButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | CopyWithDelayedRenderingButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | PasteButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | CopyBitmap (bool isDelayRendered)

Static Private Member Functions

static fire_and_forget | OnDeferredImageRequestedHandler (Windows::ApplicationModel::DataTransfer::DataProviderRequest request, Windows::Storage::StorageFile imageFile)

Detailed Description

Definition at line 19 of file CopyImage.h.

Constructor & Destructor Documentation

CopyImage ( )

Definition at line 31 of file CopyImage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CopyBitmap ( bool isDelayRendered ) [private]

Definition at line 46 of file CopyImage.cpp.

    {
        auto lifetime = get_strong();

        auto imagePicker = FileOpenPicker();
        imagePicker.ViewMode(PickerViewMode::Thumbnail);
        imagePicker.SuggestedStartLocation(PickerLocationId::PicturesLibrary);
        imagePicker.FileTypeFilter().ReplaceAll({ L".jpg", L".png", L".bmp", L".gif", L".tif" });

        auto imageFile = co_await imagePicker.PickSingleFileAsync();
        if (imageFile)
        {
            auto dataPackage = DataPackage();
            hstring message;

            // Use one click handler for two operations: regular copy and copy using delayed rendering
            // Differentiate the case by the button name
            if (isDelayRendered)
            {
                dataPackage.SetDataProvider(StandardDataFormats::Bitmap(),
                    [imageFile](auto&& request)
                    {
                        OnDeferredImageRequestedHandler(request, imageFile);
                    });
                message = L"Image has been copied using delayed rendering";
            }
            else
            {
                dataPackage.SetBitmap(RandomAccessStreamReference::CreateFromFile(imageFile));
                message = L"Image has been copied";
            }

            if (Clipboard::SetContentWithOptions(dataPackage, nullptr))
            {
                rootPage.NotifyUser(message, NotifyType::StatusMessage);
            }
            else
            {
                // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
                rootPage.NotifyUser(L"Error copying content to clipboard.", NotifyType::ErrorMessage);
            }
        }
    }

void CopyButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void CopyWithDelayedRenderingButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
static fire_and_forget OnDeferredImageRequestedHandler | ( | Windows::ApplicationModel::DataTransfer::DataProviderRequest | request,
 |  | Windows::Storage::StorageFile | imageFile |
 | ) |  |  | [static, private]
fire_and_forget PasteButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • Clipboard/cppwinrt/CopyImage.h
  • Clipboard/cppwinrt/CopyImage.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CopyText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CopyText
Public Member Functions | Private Member Functions | Private Attributes

CopyText Struct Reference

#include "CopyText.h"

List of all members.

Public Member Functions

CopyText ()
void | CopyButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | PasteButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | DisplayResourceMapAsync (Windows::ApplicationModel::DataTransfer::DataPackageView dataPackageView)

Private Attributes

hstring | htmlFragment = "See the Share SDK sample for more information."
hstring | imgSrc = "ms-appx-web:///assets/windows-sdk.png"

Detailed Description

Definition at line 19 of file CopyText.h.

Constructor & Destructor Documentation

CopyText ( )

Definition at line 27 of file CopyText.cpp.

    {
        InitializeComponent();
        Description().NavigateToString(htmlFragment);
    }

Member Function Documentation

void CopyButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget DisplayResourceMapAsync ( Windows::ApplicationModel::DataTransfer::DataPackageView dataPackageView ) [private]
fire_and_forget PasteButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

hstring htmlFragment = "See the Share SDK sample for more information." [private]

Definition at line 29 of file CopyText.h.

hstring imgSrc = "ms-appx-web:///assets/windows-sdk.png" [private]

Definition at line 28 of file CopyText.h.

The documentation for this struct was generated from the following files:
  • Clipboard/cppwinrt/CopyText.h
  • Clipboard/cppwinrt/CopyText.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEffectState Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CustomEffectState
Public Member Functions | Public Attributes

CustomEffectState Struct Reference

#include "Scenario2_Effects.h"

List of all members.

Public Member Functions

CustomEffectState (winrt::Windows::Devices::Lights::LampArray const &lampArray)

Public Attributes

std::vector
< winrt::Windows::UI::Color > 		lampColors
std::vector< float > lampNormalizedX

Detailed Description

Definition at line 21 of file Scenario2_Effects.h.

Constructor & Destructor Documentation

CustomEffectState ( winrt::Windows::Devices::Lights::LampArray const & lampArray ) [inline]

Definition at line 23 of file Scenario2_Effects.h.

                                                                               :
            lampArray(lampArray),
            lampNormalizedX(lampArray.LampCount()),
            lampColors(lampNormalizedX.size(), winrt::Windows::UI::Colors::Black())
        { }

Member Data Documentation

std::vector<winrt::Windows::UI::Color> lampColors

Definition at line 38 of file Scenario2_Effects.h.

std::vector<float> lampNormalizedX

Definition at line 29 of file Scenario2_Effects.h.

The documentation for this struct was generated from the following file:
  • LampArray/cppwinrt/Scenario2_Effects.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTextBox Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CustomTextBox
Public Member Functions

CustomTextBox Struct Reference

#include "Scenario1_Launch.h"

List of all members.

Public Member Functions

CustomTextBox ()

Detailed Description

Definition at line 36 of file Scenario1_Launch.h.

Constructor & Destructor Documentation

CustomTextBox ( ) [inline]

Definition at line 38 of file Scenario1_Launch.h.

        {
            FontFamily(Windows::UI::Xaml::Media::FontFamily{ L"Times New Roman" });
            FontStyle(Windows::UI::Text::FontStyle::Italic);
            BorderThickness({ 1 });
        }

The documentation for this struct was generated from the following file:
  • TouchKeyboard/cppwinrt/Scenario1_Launch.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomTitleBar Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • CustomTitleBar
Public Member Functions | Private Member Functions | Private Attributes

CustomTitleBar Struct Reference

#include "CustomTitleBar.h"

List of all members.

Public Member Functions

CustomTitleBar ()
double | CoreTitleBarHeight ()
Windows::UI::Xaml::Thickness | CoreTitleBarPadding ()
void | CustomTitleBar_Loaded (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | CustomTitleBar_Unloaded (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | EnableControlsInTitleBar (bool enable)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | PropertyChanged (event_token const &token) noexcept
Windows::UI::Xaml::UIElement | SetPageContent (Windows::UI::Xaml::UIElement const &newContent)

Private Member Functions

void | UpdateLayoutMetrics ()
void | UpdatePositionAndVisibility ()

Private Attributes

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar | coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView().TitleBar()
event_token | isVisibleChangedToken
event_token | layoutMetricsChangedToken
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		propertyChanged
event_token | windowSizeChangedToken

Detailed Description

Definition at line 11 of file CustomTitleBar.h.

Constructor & Destructor Documentation

CustomTitleBar ( )

Definition at line 14 of file CustomTitleBar.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

double CoreTitleBarHeight ( ) [inline]

Definition at line 23 of file CustomTitleBar.h.

{ return coreTitleBar.Height(); }

Thickness CoreTitleBarPadding ( )

Definition at line 23 of file CustomTitleBar.cpp.

    {
        // The SystemOverlayLeftInset and SystemOverlayRightInset values are
        // in terms of physical left and right. Therefore, we need to flip
        // then when our flow direction is RTL.
        if (FlowDirection() == FlowDirection::LeftToRight)
        {
            return ThicknessHelper::FromLengths(coreTitleBar.SystemOverlayLeftInset(), 0, coreTitleBar.SystemOverlayRightInset(), 0);
        }
        else
        {
            return Windows::UI::Xaml::ThicknessHelper::FromLengths(coreTitleBar.SystemOverlayRightInset(), 0, coreTitleBar.SystemOverlayLeftInset(), 0);
        }
    }

void CustomTitleBar_Loaded | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void CustomTitleBar_Unloaded | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void EnableControlsInTitleBar ( bool enable )

Definition at line 114 of file CustomTitleBar.cpp.

    {
        if (enable)
        {
            TitleBarControl().Visibility(Visibility::Visible);
            // Any clicks on the BackgroundElement will be treated as clicks on the title bar.
            Window::Current().SetTitleBar(BackgroundElement());
        }
        else
        {
            TitleBarControl().Visibility(Visibility::Collapsed);
            Window::Current().SetTitleBar(nullptr);
        }
    }

void PropertyChanged ( event_token const & token ) [inline]

Definition at line 20 of file CustomTitleBar.h.

{ propertyChanged.remove(token); }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 18 of file CustomTitleBar.h.

{ return propertyChanged.add(handler); }

Windows::UI::Xaml::UIElement SetPageContent ( Windows::UI::Xaml::UIElement const & newContent )
void UpdateLayoutMetrics ( ) [private]

Definition at line 57 of file CustomTitleBar.cpp.

    {
        propertyChanged(*this, PropertyChangedEventArgs(L"CoreTitleBarHeight"));
        propertyChanged(*this, PropertyChangedEventArgs(L"CoreTitleBarPadding"));
    }

void UpdatePositionAndVisibility ( ) [private]

Definition at line 79 of file CustomTitleBar.cpp.

    {
        if (ApplicationView::GetForCurrentView().IsFullScreenMode())
        {
            // In full screen mode, the title bar overlays the content.
            // and might or might not be visible.
            TitleBar().Visibility(coreTitleBar.IsVisible() ? Visibility::Visible : Visibility::Collapsed);
            Grid::SetRow(TitleBar(), 1);
        }
        else
        {
            // When not in full screen mode, the title bar is visible and does not overlay content.
            TitleBar().Visibility(Visibility::Visible);
            Grid::SetRow(TitleBar(), 0);
        }
    }

Member Data Documentation

Windows::ApplicationModel::Core::CoreApplicationViewTitleBar coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView().TitleBar() [private]

Definition at line 28 of file CustomTitleBar.h.

event_token isVisibleChangedToken [private]

Definition at line 34 of file CustomTitleBar.h.

event_token layoutMetricsChangedToken [private]

Definition at line 33 of file CustomTitleBar.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged [private]

Definition at line 29 of file CustomTitleBar.h.

event_token windowSizeChangedToken [private]

Definition at line 35 of file CustomTitleBar.h.

The documentation for this struct was generated from the following files:
  • TitleBar/cppwinrt/CustomTitleBar.h
  • TitleBar/cppwinrt/CustomTitleBar.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DetailsPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DetailsPage
Public Member Functions | Private Member Functions

DetailsPage Struct Reference

#include "DetailsPage.h"

List of all members.

Public Member Functions

DetailsPage ()
void | DeleteItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnLoaded (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnUnloaded (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
auto | SelectedContact ()

Private Member Functions

void | NavigateBackForWideState (bool useTransition)
void | OnBackRequested (Windows::Foundation::IInspectable const &, Windows::UI::Core::BackRequestedEventArgs const &e)
void | OnWindowSizeChanged (Windows::Foundation::IInspectable const &, Windows::UI::Core::WindowSizeChangedEventArgs const &)
bool | ShouldGoToWideState ()

Detailed Description

Definition at line 17 of file DetailsPage.h.

Constructor & Destructor Documentation

DetailsPage ( )

Definition at line 24 of file DetailsPage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void DeleteItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void NavigateBackForWideState ( bool useTransition ) [private]

Definition at line 71 of file DetailsPage.cpp.

    {
        // Evict this page from the cache as we may not need it again.
        NavigationCacheMode(NavigationCacheMode::Disabled);

        if (useTransition)
        {
            Frame().GoBack(EntranceNavigationTransitionInfo());
        }
        else
        {
            Frame().GoBack(SuppressNavigationTransitionInfo());
        }
    }

void OnBackRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::BackRequestedEventArgs const & | e |
 | ) |  |  | [private]
void OnLoaded | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnUnloaded | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnWindowSizeChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs const & |  |
 | ) |  |  | [private]
auto SelectedContact ( ) [inline]

Definition at line 21 of file DetailsPage.h.

{ return selectedContact; }

bool ShouldGoToWideState ( ) [private]

Definition at line 86 of file DetailsPage.cpp.

    {
        return Window::Current().Bounds().Width >= 720;
    }

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/DetailsPage.h
  • XamlListView/cppwinrt/DetailsPage.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceInformationDisplay Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceInformationDisplay
Public Member Functions | Private Member Functions | Private Attributes

DeviceInformationDisplay Struct Reference

#include "DeviceHelpers.h"

List of all members.

Public Member Functions

DeviceInformationDisplay (Windows::Devices::Enumeration::DeviceInformation const &deviceInfoIn)
bool | CanPair () const
Windows::Devices::Enumeration::DeviceInformation | DeviceInformation () const
hstring | GetPropertyForDisplay (hstring const &key)
Windows::UI::Xaml::Media::Imaging::BitmapImage | GlyphBitmapImage () const
hstring | Id () const
bool | IsPaired () const
Windows::Devices::Enumeration::DeviceInformationKind | Kind () const
hstring | Name () const
Windows::Foundation::Collections::IMapView
< hstring, IInspectable > 		Properties ()
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | PropertyChanged (event_token const &token)
Windows::Foundation::Collections::IVectorView
< hstring > 		Stuff ()
void | Update (Windows::Devices::Enumeration::DeviceInformationUpdate const &deviceInfoUpdate)

Private Member Functions

void | OnPropertyChanged (hstring const &name)
fire_and_forget | UpdateGlyphBitmapImage ()

Private Attributes

event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged

Detailed Description

Definition at line 136 of file DeviceHelpers.h.

Constructor & Destructor Documentation

DeviceInformationDisplay ( Windows::Devices::Enumeration::DeviceInformation const & deviceInfoIn )

Member Function Documentation

bool CanPair ( ) const [inline]

Definition at line 161 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Pairing().CanPair();
        }

Windows::Devices::Enumeration::DeviceInformation DeviceInformation ( ) const [inline]

Definition at line 176 of file DeviceHelpers.h.

        {
            return m_deviceInfo;
        }

hstring GetPropertyForDisplay ( hstring const & key )

Definition at line 278 of file DeviceHelpers.cpp.

    {
        auto value = Properties().TryLookup(key);
        if (auto v = value.try_as<IReference<guid>>(); v)
        {
            return to_hstring(v.Value());
        }

        return unbox_value_or<hstring>(value, {});
    }

Windows::UI::Xaml::Media::Imaging::BitmapImage GlyphBitmapImage ( ) const [inline]

Definition at line 156 of file DeviceHelpers.h.

        {
            return m_glyphBitmapImage;
        }

hstring Id ( ) const [inline]

Definition at line 146 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Id();
        }

bool IsPaired ( ) const [inline]

Definition at line 166 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Pairing().IsPaired();
        }

Windows::Devices::Enumeration::DeviceInformationKind Kind ( ) const [inline]

Definition at line 141 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Kind();
        }

hstring Name ( ) const [inline]

Definition at line 151 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Name();
        }

void OnPropertyChanged ( hstring const & name ) [private]

Definition at line 300 of file DeviceHelpers.cpp.

    {
        m_propertyChanged(*this, PropertyChangedEventArgs(name));
    }

Windows::Foundation::Collections::IMapView<hstring, IInspectable> Properties ( ) [inline]

Definition at line 171 of file DeviceHelpers.h.

        {
            return m_deviceInfo.Properties();
        }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 185 of file DeviceHelpers.h.

        {
            return m_propertyChanged.add(handler);
        }

void PropertyChanged ( event_token const & token ) [inline]

Definition at line 190 of file DeviceHelpers.h.

        {
            m_propertyChanged.remove(token);
        }

Windows::Foundation::Collections::IVectorView<hstring> Stuff ( ) [inline]

Definition at line 183 of file DeviceHelpers.h.

{ return nullptr; }

void Update ( Windows::Devices::Enumeration::DeviceInformationUpdate const & deviceInfoUpdate )
fire_and_forget UpdateGlyphBitmapImage ( ) [private]

Definition at line 289 of file DeviceHelpers.cpp.

    {
        auto lifetime = get_strong();

        DeviceThumbnail deviceThumbnail = co_await m_deviceInfo.GetGlyphThumbnailAsync();
        BitmapImage glyphBitmapImage;
        co_await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
        m_glyphBitmapImage = glyphBitmapImage;
        OnPropertyChanged(L"GlyphBitmapImage");
    }

Member Data Documentation

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 196 of file DeviceHelpers.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceInformationKindChoice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceInformationKindChoice
Public Member Functions | Private Attributes

DeviceInformationKindChoice Struct Reference

#include "DeviceHelpers.h"

List of all members.

Public Member Functions

DeviceInformationKindChoice (hstring displayName, std::vector< Windows::Devices::Enumeration::DeviceInformationKind > kinds)
hstring | DisplayName () const
std::vector
< Windows::Devices::Enumeration::DeviceInformationKind >
const & 		Kinds () const

Private Attributes

hstring | displayName
std::vector
< Windows::Devices::Enumeration::DeviceInformationKind > 		kinds

Detailed Description

Definition at line 79 of file DeviceHelpers.h.

Constructor & Destructor Documentation

DeviceInformationKindChoice | ( | hstring | displayName,
 |  | std::vector< Windows::Devices::Enumeration::DeviceInformationKind > | kinds |
 | ) |  |  | [inline]

Definition at line 82 of file DeviceHelpers.h.

            : displayName(std::move(displayName)),
            kinds(std::move(kinds))
        {
        }

Member Function Documentation

hstring DisplayName ( ) const [inline]

Definition at line 88 of file DeviceHelpers.h.

        {
            return displayName;
        }

std::vector<Windows::Devices::Enumeration::DeviceInformationKind> const& Kinds ( ) const [inline]

Definition at line 93 of file DeviceHelpers.h.

        {
            return kinds;
        }

Member Data Documentation

hstring displayName [private]

Definition at line 99 of file DeviceHelpers.h.

std::vector<Windows::Devices::Enumeration::DeviceInformationKind> kinds [private]

Definition at line 100 of file DeviceHelpers.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceInformationKindChoices Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceInformationKindChoices
Static Public Member Functions

DeviceInformationKindChoices Struct Reference

#include "DeviceHelpers.h"

List of all members.

Static Public Member Functions

static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationKindChoice > 		Choices ()

Detailed Description

Definition at line 103 of file DeviceHelpers.h.

Member Function Documentation

IObservableVector< SDKTemplate::DeviceInformationKindChoice > Choices ( ) [static]

Definition at line 232 of file DeviceHelpers.cpp.

    {
        return single_threaded_observable_vector<SDKTemplate::DeviceInformationKindChoice>({
            make<DeviceInformationKindChoice>(L"DeviceContainer", std::vector{ DeviceInformationKind::DeviceContainer }),
            make<DeviceInformationKindChoice>(L"Device", std::vector{ DeviceInformationKind::Device }),
            make<DeviceInformationKindChoice>(L"DeviceInterface (Default)", std::vector{ DeviceInformationKind::DeviceInterface }),
            make<DeviceInformationKindChoice>(L"DeviceInterfaceClass", std::vector{ DeviceInformationKind::DeviceInterfaceClass }),
            make<DeviceInformationKindChoice>(L"AssociationEndpointContainer", std::vector{ DeviceInformationKind::AssociationEndpointContainer }),
            make<DeviceInformationKindChoice>(L"AssociationEndpoint", std::vector{ DeviceInformationKind::AssociationEndpoint }),
            make<DeviceInformationKindChoice>(L"AssociationEndpointService", std::vector{ DeviceInformationKind::AssociationEndpointService }),
            make<DeviceInformationKindChoice>(L"AssociationEndpointService and DeviceInterface", std::vector{ DeviceInformationKind::AssociationEndpointService, DeviceInformationKind::DeviceInterface }),
        });
    }

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceSelectorChoices Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceSelectorChoices
Static Public Member Functions

DeviceSelectorChoices Struct Reference

#include "DeviceHelpers.h"

List of all members.

Static Public Member Functions

static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		BackgroundDeviceWatcherSelectors ()
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		CommonDeviceSelectors ()
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		DevicePickerSelectors ()
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		DeviceWatcherSelectors ()
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		FindAllAsyncSelectors ()
static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceSelectorInfo > 		PairingSelectors ()

Detailed Description

Definition at line 69 of file DeviceHelpers.h.

Member Function Documentation

IObservableVector< SDKTemplate::DeviceSelectorInfo > BackgroundDeviceWatcherSelectors ( ) [static]

Definition at line 200 of file DeviceHelpers.cpp.

    {
        IObservableVector<SDKTemplate::DeviceSelectorInfo> selectors = CommonDeviceSelectors();

        selectors.Append(BluetoothPairedOnly());
        selectors.Append(BluetoothLEPairedOnly());
        selectors.Append(WiFiDirectPairedOnly());
        selectors.Append(PointOfServicePrinter());
        AddVideoCastingIfSupported(selectors);
        selectors.Append(DialAllApps());
        selectors.Append(Wsd());
        selectors.Append(Upnp());

        return selectors;
    }

IObservableVector< SDKTemplate::DeviceSelectorInfo > CommonDeviceSelectors ( ) [static]

Definition at line 36 of file DeviceHelpers.cpp.

    {
        return single_threaded_observable_vector<SDKTemplate::DeviceSelectorInfo>({
            // Pre-canned device class selectors
            make<DeviceSelectorInfo>(L"All Device Interfaces (default)", DeviceClass::All),
            make<DeviceSelectorInfo>(L"Audio Capture", DeviceClass::AudioCapture),
            make<DeviceSelectorInfo>(L"Audio Render", DeviceClass::AudioRender),
            make<DeviceSelectorInfo>(L"Image Scanner", DeviceClass::ImageScanner),
            make<DeviceSelectorInfo>(L"Location", DeviceClass::Location),
            make<DeviceSelectorInfo>(L"Portable Storage", DeviceClass::PortableStorageDevice),
            make<DeviceSelectorInfo>(L"Video Capture", DeviceClass::VideoCapture),

            // A few examples of selectors built dynamically by windows runtime apis.
            make<DeviceSelectorInfo>(L"Human Interface (HID)", Windows::Devices::HumanInterfaceDevice::HidDevice::GetDeviceSelector(0, 0)),
            make<DeviceSelectorInfo>(L"Activity Sensor", Windows::Devices::Sensors::ActivitySensor::GetDeviceSelector()),
            make<DeviceSelectorInfo>(L"Pedometer", Windows::Devices::Sensors::Pedometer::GetDeviceSelector()),
            make<DeviceSelectorInfo>(L"Proximity", Windows::Networking::Proximity::ProximityDevice::GetDeviceSelector()),
            make<DeviceSelectorInfo>(L"Proximity Sensor", Windows::Devices::Sensors::ProximitySensor::GetDeviceSelector()), });
    }

IObservableVector< SDKTemplate::DeviceSelectorInfo > DevicePickerSelectors ( ) [static]

Definition at line 157 of file DeviceHelpers.cpp.

    {
        // Add all selectors that can be used with the DevicePicker
        IObservableVector<SDKTemplate::DeviceSelectorInfo> selectors = CommonDeviceSelectors();
        selectors.Append(BluetoothPairedOnly());
        selectors.Append(BluetoothUnpairedOnly());
        selectors.Append(BluetoothLEPairedOnly());
        selectors.Append(BluetoothLEUnpairedOnly());
        selectors.Append(WiFiDirect());
        selectors.Append(PointOfServicePrinter());
        AddVideoCastingIfSupported(selectors);
        selectors.Append(DialAllApps());

        return selectors;
    }

IObservableVector< SDKTemplate::DeviceSelectorInfo > DeviceWatcherSelectors ( ) [static]

Definition at line 184 of file DeviceHelpers.cpp.

    {
        IObservableVector<SDKTemplate::DeviceSelectorInfo> selectors = CommonDeviceSelectors();

        selectors.Append(Bluetooth());
        selectors.Append(BluetoothLE());
        selectors.Append(WiFiDirect());
        selectors.Append(PointOfServicePrinter());
        AddVideoCastingIfSupported(selectors);
        selectors.Append(DialAllApps());
        selectors.Append(Wsd());
        selectors.Append(Upnp());

        return selectors;
    }

IObservableVector< SDKTemplate::DeviceSelectorInfo > FindAllAsyncSelectors ( ) [static]

Definition at line 173 of file DeviceHelpers.cpp.

    {
        IObservableVector<SDKTemplate::DeviceSelectorInfo> selectors = CommonDeviceSelectors();

        selectors.Append(BluetoothPairedOnly());
        selectors.Append(BluetoothLEPairedOnly());
        selectors.Append(WiFiDirectPairedOnly());

        return selectors;
    }

IObservableVector< SDKTemplate::DeviceSelectorInfo > PairingSelectors ( ) [static]

Definition at line 216 of file DeviceHelpers.cpp.

    {
        IObservableVector<SDKTemplate::DeviceSelectorInfo> selectors = single_threaded_observable_vector<SDKTemplate::DeviceSelectorInfo>();

        selectors.Append(Bluetooth());
        selectors.Append(BluetoothLE());
        selectors.Append(WiFiDirect());
        selectors.Append(PointOfServicePrinter());
        AddVideoCastingIfSupported(selectors);
        selectors.Append(Wsd());
        selectors.Append(Upnp());
        selectors.Append(NetworkCamera());

        return selectors;
    }

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceSelectorInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceSelectorInfo
Public Member Functions | Public Attributes

DeviceSelectorInfo Struct Reference

#include "DeviceHelpers.h"

List of all members.

Public Member Functions

DeviceSelectorInfo (hstring displayName, Windows::Devices::Enumeration::DeviceClass deviceClassSelector, Windows::Devices::Enumeration::DeviceInformationKind kind=Windows::Devices::Enumeration::DeviceInformationKind::Unknown, hstring selector={})
DeviceSelectorInfo (hstring const &displayName, hstring const &selector, Windows::Devices::Enumeration::DeviceInformationKind kind=Windows::Devices::Enumeration::DeviceInformationKind::Unknown)

Public Attributes

kind
Windows::Devices::Enumeration::DeviceClass | m_deviceClassSelector
Windows::Devices::Enumeration::DeviceInformationKind | m_kind
hstring | m_selector

Detailed Description

Definition at line 20 of file DeviceHelpers.h.

Constructor & Destructor Documentation

DeviceSelectorInfo | ( | hstring | displayName,
 |  | Windows::Devices::Enumeration::DeviceClass | deviceClassSelector,
 |  | Windows::Devices::Enumeration::DeviceInformationKind | kind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown |
 | ) |  |  | [inline]

Definition at line 22 of file DeviceHelpers.h.

                               {})
            : m_displayName(std::move(displayName)),
            m_deviceClassSelector(deviceClassSelector),
            m_kind(kind),
            m_selector(std::move(selector))
        {
        }

DeviceSelectorInfo | ( | hstring const & | displayName,
 |  | hstring const & | selector,
 |  | Windows::Devices::Enumeration::DeviceInformationKind | kind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown |
 | ) |  |  | [inline]

Definition at line 34 of file DeviceHelpers.h.

            : DeviceSelectorInfo(displayName, {}, kind, selector)

Member Data Documentation

kind

Definition at line 38 of file DeviceHelpers.h.

Windows::Devices::Enumeration::DeviceClass m_deviceClassSelector

Definition at line 38 of file DeviceHelpers.h.

Windows::Devices::Enumeration::DeviceInformationKind m_kind

Definition at line 65 of file DeviceHelpers.h.

hstring m_selector

Definition at line 66 of file DeviceHelpers.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceStateChangedEventArgs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceStateChangedEventArgs
Public Member Functions | Private Attributes

DeviceStateChangedEventArgs Struct Reference

#include "DeviceState.h"

List of all members.

Public Member Functions

DeviceStateChangedEventArgs (enum DeviceState deviceState, hresult error)
enum DeviceState | DeviceState ()
hresult | ExtendedError ()

Private Attributes

enum DeviceState const | m_deviceState
hresult const | m_error

Detailed Description

Definition at line 16 of file DeviceState.h.

Constructor & Destructor Documentation

DeviceStateChangedEventArgs | ( | enum DeviceState | deviceState,
 |  | hresult | error |
 | ) |  |  | [inline]

Definition at line 18 of file DeviceState.h.

: m_deviceState(deviceState), m_error(error) {}

Member Function Documentation

enum DeviceState DeviceState ( ) [inline]

Definition at line 20 of file DeviceState.h.

{ return m_deviceState; }

hresult ExtendedError ( ) [inline]

Definition at line 21 of file DeviceState.h.

{ return m_error; }

Member Data Documentation

enum DeviceState const m_deviceState [private]

Definition at line 24 of file DeviceState.h.

hresult const m_error [private]

Definition at line 25 of file DeviceState.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/DeviceState.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceStateSourceT< D > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DeviceStateSourceT< D >
Public Member Functions | Protected Member Functions | Protected Attributes

DeviceStateSourceT< D > Struct Template Reference

#include "DeviceState.h"

List of all members.

Public Member Functions

DeviceState | DeviceState ()
void | DeviceStateChanged (event_token token)
event_token | DeviceStateChanged (Windows::Foundation::TypedEventHandler< IDeviceStateSource, SDKTemplate::DeviceStateChangedEventArgs > const &handler)

Protected Member Functions

void | SetState (enum DeviceState state, HRESULT error=S_OK)
void | SetStateNoNotify (enum DeviceState state)

Protected Attributes

enum DeviceState | m_deviceState = DeviceState::Uninitialized
event
< Windows::Foundation::TypedEventHandler
< IDeviceStateSource,
SDKTemplate::DeviceStateChangedEventArgs > > 		m_deviceStateChanged

Detailed Description

template<typename D>
struct winrt::SDKTemplate::implementation::DeviceStateSourceT< D >

Definition at line 29 of file DeviceState.h.

Member Function Documentation

DeviceState DeviceState ( ) [inline]

Definition at line 31 of file DeviceState.h.

{ return m_deviceState; }

event_token DeviceStateChanged ( Windows::Foundation::TypedEventHandler< IDeviceStateSource, SDKTemplate::DeviceStateChangedEventArgs > const & handler ) [inline]

Definition at line 33 of file DeviceState.h.

        {
            return m_deviceStateChanged.add(handler);
        }

void DeviceStateChanged ( event_token token ) [inline]

Definition at line 37 of file DeviceState.h.

        {
            return m_deviceStateChanged.remove(token);
        }

void SetState | ( | enum DeviceState | state,
 |  | HRESULT | error = S_OK |
 | ) |  |  | [inline, protected]

Definition at line 46 of file DeviceState.h.

        {
            if (m_deviceState != state)
            {
                m_deviceState = state;
                m_deviceStateChanged(*static_cast<D*>(this), make<implementation::DeviceStateChangedEventArgs>(state, error));
            }
        }

void SetStateNoNotify ( enum DeviceState state ) [inline, protected]

Definition at line 55 of file DeviceState.h.

        {
            m_deviceState = state;
        }

Member Data Documentation

enum DeviceState m_deviceState = DeviceState::Uninitialized [protected]

Definition at line 43 of file DeviceState.h.

event<Windows::Foundation::TypedEventHandler<IDeviceStateSource, SDKTemplate::DeviceStateChangedEventArgs> > m_deviceStateChanged [protected]

Definition at line 44 of file DeviceState.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/DeviceState.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DiscoveredDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • DiscoveredDevice
Public Member Functions | Private Attributes

DiscoveredDevice Struct Reference

#include "SocketReaderWriter.h"

List of all members.

Public Member Functions

DiscoveredDevice (Windows::Devices::Enumeration::DeviceInformation const &deviceInfoIn)
auto | DeviceInfo ()
hstring | DisplayName ()
void | PropertyChanged (event_token token)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | UpdateDeviceInfo (Windows::Devices::Enumeration::DeviceInformationUpdate const &update)

Private Attributes

Windows::Devices::Enumeration::DeviceInformation | deviceInfo
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		propertyChanged

Detailed Description

Definition at line 36 of file SocketReaderWriter.h.

Constructor & Destructor Documentation

DiscoveredDevice ( Windows::Devices::Enumeration::DeviceInformation const & deviceInfoIn ) [inline]

Definition at line 39 of file SocketReaderWriter.h.

                                                                                : deviceInfo(deviceInfoIn)
        {
        }

Member Function Documentation

auto DeviceInfo ( ) [inline]

Definition at line 43 of file SocketReaderWriter.h.

{ return deviceInfo; }

hstring DisplayName ( ) [inline]

Definition at line 45 of file SocketReaderWriter.h.

        {
            return deviceInfo.Name() + L" - " + (deviceInfo.Pairing().IsPaired() ? L"Paired" : L"Unpaired");
        }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 56 of file SocketReaderWriter.h.

        {
            return propertyChanged.add(handler);
        }

void PropertyChanged ( event_token token ) [inline]

Definition at line 61 of file SocketReaderWriter.h.

        {
            propertyChanged.remove(token);
        }

void UpdateDeviceInfo ( Windows::Devices::Enumeration::DeviceInformationUpdate const & update ) [inline]

Definition at line 50 of file SocketReaderWriter.h.

        {
            deviceInfo.Update(update);
            propertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs(L"DisplayName"));
        }

Member Data Documentation

Windows::Devices::Enumeration::DeviceInformation deviceInfo [private]

Definition at line 67 of file SocketReaderWriter.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged [private]

Definition at line 68 of file SocketReaderWriter.h.

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/SocketReaderWriter.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdgeTappedListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • EdgeTappedListView
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

EdgeTappedListView Struct Reference

#include "EdgeTappedListView.h"

List of all members.

Classes

struct | ContainerEventTokens

Public Member Functions

EdgeTappedListView ()
auto | IsItemLeftEdgeTapEnabled ()
void | IsItemLeftEdgeTapEnabled (bool value)
void | ItemLeftEdgeTapped (event_token const &token) noexcept
auto | ItemLeftEdgeTapped (ListViewEdgeTappedEventHandler const &handler)
auto | LeftEdgeBrush ()
void | LeftEdgeBrush (Windows::UI::Xaml::Media::Brush const &value)

Private Member Functions

void | ClearVisual ()
void | Element_PointerCaptureLost (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &)
void | Element_PointerExited (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &)
void | Element_PointerPressed (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | Element_PointerReleased (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &)
void | OnContainerContentChanging (Windows::UI::Xaml::Controls::ListViewBase const &, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const &args)
void | ShowVisual ()

Static Private Member Functions

static void | RegisterDependencyPropertiesOnce ()

Private Attributes

bool | isItemLeftEdgeTapEnabled = false
event
< ListViewEdgeTappedEventHandler > 		itemLeftEdgeTappedEvent

Static Private Attributes

static constexpr double | HIT_TARGET = 32
static
Windows::UI::Xaml::DependencyProperty 		s_containerEventTokensProperty
static constexpr wchar_t | VISUAL_INDICATOR_NAME [] = "VisualIndicator"
static constexpr double | VISUAL_INDICATOR_WIDTH = 12

Detailed Description

Definition at line 28 of file EdgeTappedListView.h.

Constructor & Destructor Documentation

EdgeTappedListView ( )

Definition at line 39 of file EdgeTappedListView.cpp.

    {
        RegisterDependencyPropertiesOnce();
        ContainerContentChanging({ get_weak(), &EdgeTappedListView::OnContainerContentChanging });
        leftEdgeBrush = Application::Current().Resources().Lookup(box_value(L"SystemControlHighlightAltListAccentLowBrush")).as<Brush>();
    }

Member Function Documentation

void ClearVisual ( ) [private]

Definition at line 147 of file EdgeTappedListView.cpp.

    {
        if (listViewItemHighlighted != nullptr)
        {
            if (visualIndicator != nullptr)
            {
                visualIndicator.Opacity(0.0);
                if (itemLeftEdgeTappedEvent)
                {
                    itemLeftEdgeTappedEvent(*this, make<ListViewEdgeTappedEventArgs>(listViewItemHighlighted));
                }
            }
            listViewItemHighlighted = nullptr;
        }
    }

void Element_PointerCaptureLost | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & |  |
 | ) |  |  | [private]
void Element_PointerExited | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & |  |
 | ) |  |  | [private]
void Element_PointerPressed | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e |
 | ) |  |  | [private]
void Element_PointerReleased | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & |  |
 | ) |  |  | [private]
auto IsItemLeftEdgeTapEnabled ( ) [inline]

Definition at line 34 of file EdgeTappedListView.h.

{ return isItemLeftEdgeTapEnabled; }

void IsItemLeftEdgeTapEnabled ( bool value ) [inline]

Definition at line 35 of file EdgeTappedListView.h.

{ isItemLeftEdgeTapEnabled = value; }

auto ItemLeftEdgeTapped ( ListViewEdgeTappedEventHandler const & handler ) [inline]

Definition at line 38 of file EdgeTappedListView.h.

{ return itemLeftEdgeTappedEvent.add(handler); }

void ItemLeftEdgeTapped ( event_token const & token ) [inline]

Definition at line 39 of file EdgeTappedListView.h.

{ return itemLeftEdgeTappedEvent.remove(token); }

void LeftEdgeBrush ( Windows::UI::Xaml::Media::Brush const & value ) [inline]

Definition at line 37 of file EdgeTappedListView.h.

{ leftEdgeBrush = value; }

auto LeftEdgeBrush ( ) [inline]

Definition at line 36 of file EdgeTappedListView.h.

{ return leftEdgeBrush; }

void OnContainerContentChanging | ( | Windows::UI::Xaml::Controls::ListViewBase const & | ,
 |  | Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const & | args |
 | ) |  |  | [private]
void RegisterDependencyPropertiesOnce ( ) [static, private]

Definition at line 29 of file EdgeTappedListView.cpp.

    {
        static std::once_flag flag;
        std::call_once(flag, [] {
            s_containerEventTokensProperty = DependencyProperty::RegisterAttached(
                L"ContainerEventTokens", xaml_typename<IInspectable>(),
                xaml_typename<SDKTemplate::EdgeTappedListView>(), nullptr);
            });
    }

void ShowVisual ( ) [private]

Definition at line 115 of file EdgeTappedListView.cpp.

    {
        if (listViewItemHighlighted != nullptr)
        {
            visualIndicator = listViewItemHighlighted.FindName(VISUAL_INDICATOR_NAME).as<Rectangle>();
            if (visualIndicator == nullptr)
            {
                visualIndicator = Rectangle();
                visualIndicator.Name(VISUAL_INDICATOR_NAME);
                visualIndicator.Height(listViewItemHighlighted.ActualHeight());
                visualIndicator.HorizontalAlignment(HorizontalAlignment::Left);
                visualIndicator.Width(VISUAL_INDICATOR_WIDTH);
                visualIndicator.Fill(leftEdgeBrush);
                visualIndicator.Margin(Thickness{ -(listViewItemHighlighted.Padding().Left), 0, 0, 0 });
                Panel panel = listViewItemHighlighted.ContentTemplateRoot().try_as<Panel>();
                if (panel != nullptr)
                {
                    Grid grid = panel.try_as<Grid>();
                    if (grid != nullptr)
                    {
                        visualIndicator.SetValue(Grid::RowSpanProperty(), box_value(grid.RowDefinitions().Size()));
                    }
                    panel.Children().Append(visualIndicator);
                }
            }
            else
            {
                visualIndicator.Opacity(1.0);
            }
        }
    }

Member Data Documentation

constexpr double HIT_TARGET = 32 [static, private]

Definition at line 48 of file EdgeTappedListView.h.

bool isItemLeftEdgeTapEnabled = false [private]

Definition at line 42 of file EdgeTappedListView.h.

event<ListViewEdgeTappedEventHandler> itemLeftEdgeTappedEvent [private]

Definition at line 43 of file EdgeTappedListView.h.

Windows::UI::Xaml::DependencyProperty s_containerEventTokensProperty [static, private]

Definition at line 70 of file EdgeTappedListView.h.

constexpr wchar_t VISUAL_INDICATOR_NAME[] = "VisualIndicator" [static, private]

Definition at line 50 of file EdgeTappedListView.h.

constexpr double VISUAL_INDICATOR_WIDTH = 12 [static, private]

Definition at line 49 of file EdgeTappedListView.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/EdgeTappedListView.h
  • XamlListView/cppwinrt/EdgeTappedListView.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdgeTappedListView::ContainerEventTokens Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • EdgeTappedListView
  • EdgeTappedListView::ContainerEventTokens

EdgeTappedListView::ContainerEventTokens Struct Reference

Detailed Description

Definition at line 62 of file EdgeTappedListView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/EdgeTappedListView.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GeneratedBitmapState Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • GeneratedBitmapState
Public Attributes

GeneratedBitmapState Struct Reference

#include "Scenario2_Effects.h"

List of all members.

Public Attributes

uint32_t | bitmapHeight
uint32_t | bitmapWidth
float | squareLength
float | squareY

Detailed Description

Definition at line 45 of file Scenario2_Effects.h.

Member Data Documentation

uint32_t bitmapHeight

Definition at line 48 of file Scenario2_Effects.h.

uint32_t bitmapWidth

Definition at line 47 of file Scenario2_Effects.h.

float squareLength

Definition at line 49 of file Scenario2_Effects.h.

float squareY

Definition at line 50 of file Scenario2_Effects.h.

The documentation for this struct was generated from the following file:
  • LampArray/cppwinrt/Scenario2_Effects.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GroupInfoList Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • GroupInfoList
Public Member Functions | Private Attributes

GroupInfoList Struct Reference

#include "GroupInfoList.h"

List of all members.

Public Member Functions

GroupInfoList ()
auto | Append (Windows::Foundation::IInspectable const &value)
auto | Clear ()
auto | First ()
auto | GetAt (uint32_t index)
auto | GetMany (uint32_t startIndex, array_view< Windows::Foundation::IInspectable > items)
auto | GetView ()
auto | IndexOf (Windows::Foundation::IInspectable const &value, uint32_t &index)
auto | InsertAt (uint32_t index, Windows::Foundation::IInspectable const &value)
hstring | Key ()
void | Key (hstring const &value)
auto | RemoveAt (uint32_t index)
auto | RemoveAtEnd ()
auto | ReplaceAll (array_view< Windows::Foundation::IInspectable const > items)
auto | SetAt (uint32_t index, Windows::Foundation::IInspectable const &value)
auto | Size ()

Private Attributes

hstring | key
Windows::Foundation::Collections::IVector
< Windows::Foundation::IInspectable > 		vector = single_threaded_vector<Windows::Foundation::IInspectable>()

Detailed Description

Definition at line 17 of file GroupInfoList.h.

Constructor & Destructor Documentation

GroupInfoList ( )

Member Function Documentation

auto Append ( Windows::Foundation::IInspectable const & value ) [inline]

Definition at line 31 of file GroupInfoList.h.

{ return vector.Append(value); }

auto Clear ( ) [inline]

Definition at line 33 of file GroupInfoList.h.

{ return vector.Clear(); }

auto First ( ) [inline]

Definition at line 23 of file GroupInfoList.h.

{ return vector.First(); }

auto GetAt ( uint32_t index ) [inline]

Definition at line 24 of file GroupInfoList.h.

{ return vector.GetAt(index); }

auto GetMany | ( | uint32_t | startIndex,
 |  | array_view< Windows::Foundation::IInspectable > | items |
 | ) |  |  | [inline]

Definition at line 34 of file GroupInfoList.h.

{ return vector.GetMany(startIndex, items); }

auto GetView ( ) [inline]

Definition at line 26 of file GroupInfoList.h.

{ return vector.GetView(); }

auto IndexOf | ( | Windows::Foundation::IInspectable const & | value,
 |  | uint32_t & | index |
 | ) |  |  | [inline]

Definition at line 27 of file GroupInfoList.h.

{ return vector.IndexOf(value, index); }

auto InsertAt | ( | uint32_t | index,
 |  | Windows::Foundation::IInspectable const & | value |
 | ) |  |  | [inline]

Definition at line 29 of file GroupInfoList.h.

{ return vector.InsertAt(index, value); }

void Key ( hstring const & value ) [inline]

Definition at line 22 of file GroupInfoList.h.

{ key = value; }

hstring Key ( ) [inline]

Definition at line 21 of file GroupInfoList.h.

{ return key; }

auto RemoveAt ( uint32_t index ) [inline]

Definition at line 30 of file GroupInfoList.h.

{ return vector.RemoveAt(index); }

auto RemoveAtEnd ( ) [inline]

Definition at line 32 of file GroupInfoList.h.

{ return vector.RemoveAtEnd(); }

auto ReplaceAll ( array_view< Windows::Foundation::IInspectable const > items ) [inline]

Definition at line 35 of file GroupInfoList.h.

{ return vector.ReplaceAll(items); }

auto SetAt | ( | uint32_t | index,
 |  | Windows::Foundation::IInspectable const & | value |
 | ) |  |  | [inline]

Definition at line 28 of file GroupInfoList.h.

{ return vector.SetAt(index, value); }

auto Size ( ) [inline]

Definition at line 25 of file GroupInfoList.h.

{ return vector.Size(); }

Member Data Documentation

hstring key [private]

Definition at line 38 of file GroupInfoList.h.

Windows::Foundation::Collections::IVector<Windows::Foundation::IInspectable> vector = single_threaded_vector<Windows::Foundation::IInspectable>() [private]

Definition at line 39 of file GroupInfoList.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/GroupInfoList.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HistoryAndRoaming Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • HistoryAndRoaming
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

HistoryAndRoaming Struct Reference

#include "HistoryAndRoaming.h"

List of all members.

Public Member Functions

HistoryAndRoaming ()
fire_and_forget | CopyButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

fire_and_forget | CheckHistoryAndRoaming ()
void | OnHistoryEnabledChanged (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
void | OnRoamingEnabledChanged (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)

Static Private Member Functions

static void | SelectVisibleElement (Windows::UI::Xaml::UIElement const &ifTrue, Windows::UI::Xaml::UIElement const &ifFalse, bool value)

Private Attributes

event_token | historyEnabledToken
event_token | roamingEnabledToken

Detailed Description

Definition at line 19 of file HistoryAndRoaming.h.

Constructor & Destructor Documentation

HistoryAndRoaming ( )

Definition at line 29 of file HistoryAndRoaming.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CheckHistoryAndRoaming ( ) [private]

Definition at line 137 of file HistoryAndRoaming.cpp.

    {
        auto lifetime = get_strong();
        co_await Dispatcher();
        SelectVisibleElement(ClipboardHistoryBlock(), ClipboardHistoryUnavailableBlock(), Clipboard::IsHistoryEnabled());
        SelectVisibleElement(ClipboardRoamingBlock(), ClipboardRoamingUnavailableBlock(), Clipboard::IsRoamingEnabled());
    }

fire_and_forget CopyButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnHistoryEnabledChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnRoamingEnabledChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
static void SelectVisibleElement | ( | Windows::UI::Xaml::UIElement const & | ifTrue,
 |  | Windows::UI::Xaml::UIElement const & | ifFalse,
 |  | bool | value |
 | ) |  |  | [static, private]

Member Data Documentation

event_token historyEnabledToken [private]

Definition at line 28 of file HistoryAndRoaming.h.

event_token roamingEnabledToken [private]

Definition at line 30 of file HistoryAndRoaming.h.

The documentation for this struct was generated from the following files:
  • Clipboard/cppwinrt/HistoryAndRoaming.h
  • Clipboard/cppwinrt/HistoryAndRoaming.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpJsonContent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • HttpJsonContent
Public Member Functions | Private Member Functions | Private Attributes

HttpJsonContent Struct Reference

#include "HttpJsonContent.h"

List of all members.

Public Member Functions

HttpJsonContent (Windows::Data::Json::IJsonValue const &jsonValue)
Windows::Foundation::IAsyncOperationWithProgress
< uint64_t, uint64_t > 		BufferAllAsync ()
void | Close ()
Windows::Web::Http::Headers::HttpContentHeaderCollection | Headers ()
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Storage::Streams::IBuffer,
uint64_t > 		ReadAsBufferAsync ()
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Storage::Streams::IInputStream,
uint64_t > 		ReadAsInputStreamAsync ()
Windows::Foundation::IAsyncOperationWithProgress
< hstring, uint64_t > 		ReadAsStringAsync ()
bool | TryComputeLength (uint64_t &length)
Windows::Foundation::IAsyncOperationWithProgress
< uint64_t, uint64_t > 		WriteToStreamAsync (Windows::Storage::Streams::IOutputStream outputStream)

Private Member Functions

uint64_t | GetLength ()
Windows::Storage::Streams::IBuffer | ToBuffer ()

Private Attributes

Windows::Web::Http::Headers::HttpContentHeaderCollection
const 		m_headers
Windows::Data::Json::IJsonValue
const 		m_jsonValue

Detailed Description

Definition at line 17 of file HttpJsonContent.h.

Constructor & Destructor Documentation

HttpJsonContent ( Windows::Data::Json::IJsonValue const & jsonValue )

Member Function Documentation

IAsyncOperationWithProgress< uint64_t, uint64_t > BufferAllAsync ( )

Definition at line 38 of file HttpJsonContent.cpp.

    {
        auto progress = co_await get_progress_token();
        uint64_t length = GetLength();

        // Report progress.
        progress(length);

        // Just return the size in bytes.
        co_return length;
    }

void Close ( ) [inline]

Definition at line 27 of file HttpJsonContent.h.

{}

uint64_t GetLength ( ) [private]

Definition at line 101 of file HttpJsonContent.cpp.

    {
        return ToBuffer().Length();
    }

Windows::Web::Http::Headers::HttpContentHeaderCollection Headers ( ) [inline]

Definition at line 20 of file HttpJsonContent.h.

{ return m_headers; }

IAsyncOperationWithProgress< IBuffer, uint64_t > ReadAsBufferAsync ( )

Definition at line 50 of file HttpJsonContent.cpp.

    {
        co_return ToBuffer();
    }

IAsyncOperationWithProgress< IInputStream, uint64_t > ReadAsInputStreamAsync ( )

Definition at line 55 of file HttpJsonContent.cpp.

    {
        auto lifetime = get_strong();
        auto progress = co_await get_progress_token();

        InMemoryRandomAccessStream randomAccessStream;
        co_await randomAccessStream.WriteAsync(ToBuffer());

        // Report progress.
        progress(randomAccessStream.Size());

        co_return randomAccessStream.GetInputStreamAt(0);
    }

IAsyncOperationWithProgress< hstring, uint64_t > ReadAsStringAsync ( )

Definition at line 69 of file HttpJsonContent.cpp.

    {
        auto lifetime = get_strong();
        auto progress = co_await get_progress_token();

        hstring jsonString = m_jsonValue.Stringify();

        // Report progress (length of string)
        progress(jsonString.size());

        co_return jsonString;
    }

IBuffer ToBuffer ( ) [private]

Definition at line 106 of file HttpJsonContent.cpp.

    {
        return CryptographicBuffer::ConvertStringToBinary(m_jsonValue.Stringify(), BinaryStringEncoding::Utf8);
    }

bool TryComputeLength ( uint64_t & length )

Definition at line 82 of file HttpJsonContent.cpp.

    {
        length = GetLength();
        return true;
    }

Windows::Foundation::IAsyncOperationWithProgress<uint64_t, uint64_t> WriteToStreamAsync ( Windows::Storage::Streams::IOutputStream outputStream )

Member Data Documentation

Windows::Web::Http::Headers::HttpContentHeaderCollection const m_headers [private]

Definition at line 31 of file HttpJsonContent.h.

Windows::Data::Json::IJsonValue const m_jsonValue [private]

Definition at line 30 of file HttpJsonContent.h.

The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/HttpJsonContent.h
  • HttpClient/cppwinrt/HttpJsonContent.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImagePage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ImagePage
Public Member Functions | Private Member Functions

ImagePage Struct Reference

#include "ImagePage.h"

List of all members.

Public Member Functions

ImagePage ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | OnBackRequested (Windows::Foundation::IInspectable const &, Windows::UI::Core::BackRequestedEventArgs const &e)

Detailed Description

Definition at line 17 of file ImagePage.h.

Constructor & Destructor Documentation

ImagePage ( )

Definition at line 24 of file ImagePage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnBackRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::BackRequestedEventArgs const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/ImagePage.h
  • XamlListView/cppwinrt/ImagePage.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Item Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Item
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes

Item Struct Reference

#include "Item.h"

List of all members.

Public Member Functions

Item (int index)
auto | Id ()
auto | ImageSource ()

Static Public Member Functions

static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Item > 		GetItems (int count)

Static Private Member Functions

static
Windows::UI::Xaml::Media::ImageSource 		GenerateImageSource (int index)

Private Attributes

hstring | id

Detailed Description

Definition at line 17 of file Item.h.

Constructor & Destructor Documentation

Item ( int index ) [inline]

Definition at line 19 of file Item.h.

: id(to_hstring(index)), imageSource(GenerateImageSource(index)) {}

Member Function Documentation

ImageSource GenerateImageSource ( int index ) [static, private]

Definition at line 23 of file Item.cpp.

    {
        static std::vector<BitmapImage> sources({
            BitmapImage(Uri(L"ms-appx:///Assets/cliff.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/grapes_background.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage13.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage2.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage24.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage3.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage6.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage7.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/Ring01.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/Ring03Part1.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/Ring03Part3.jpg")),
            BitmapImage(Uri(L"ms-appx:///Assets/sunset.jpg")),
            });

        return sources[index % sources.size()];
    }

IObservableVector< SDKTemplate::Item > GetItems ( int count ) [static]

Definition at line 43 of file Item.cpp.

    {
        std::vector<SDKTemplate::Item> items;
        std::generate_n(std::back_inserter(items), count, [i = 0]() mutable { return make<Item>(i++); });
        return single_threaded_observable_vector(std::move(items));
    }

auto Id ( ) [inline]

Definition at line 21 of file Item.h.

{ return id; }

auto ImageSource ( ) [inline]

Definition at line 22 of file Item.h.

{ return imageSource; }

Member Data Documentation

hstring id [private]

Definition at line 27 of file Item.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Item.h
  • XamlListView/cppwinrt/Item.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeepConnectionOpenScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • KeepConnectionOpenScenario
Public Member Functions | Private Member Functions

KeepConnectionOpenScenario Struct Reference

#include "KeepConnectionOpenScenario.h"

List of all members.

Public Member Functions

KeepConnectionOpenScenario ()
void | CloseConnection_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | GenerateRandomNumber_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | OpenConnection_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | Connection_ServiceClosed (Windows::ApplicationModel::AppService::AppServiceConnection const &, Windows::ApplicationModel::AppService::AppServiceClosedEventArgs const &)

Detailed Description

Definition at line 18 of file KeepConnectionOpenScenario.h.

Constructor & Destructor Documentation

KeepConnectionOpenScenario ( )

Definition at line 26 of file KeepConnectionOpenScenario.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void CloseConnection_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget Connection_ServiceClosed | ( | Windows::ApplicationModel::AppService::AppServiceConnection const & | ,
 |  | Windows::ApplicationModel::AppService::AppServiceClosedEventArgs const & |  |
 | ) |  |  | [private]
fire_and_forget GenerateRandomNumber_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OpenConnection_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.h
  • AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ListViewEdgeTappedEventArgs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ListViewEdgeTappedEventArgs
Public Member Functions | Private Attributes

ListViewEdgeTappedEventArgs Struct Reference

#include "EdgeTappedListView.h"

List of all members.

Public Member Functions

ListViewEdgeTappedEventArgs (Windows::UI::Xaml::Controls::ListViewItem const &item)
auto | Item ()

Private Attributes

Windows::UI::Xaml::Controls::ListViewItem | item

Detailed Description

Definition at line 18 of file EdgeTappedListView.h.

Constructor & Destructor Documentation

ListViewEdgeTappedEventArgs ( Windows::UI::Xaml::Controls::ListViewItem const & item ) [inline]

Definition at line 20 of file EdgeTappedListView.h.

: item(item) {}

Member Function Documentation

auto Item ( ) [inline]

Definition at line 22 of file EdgeTappedListView.h.

{ return item; }

Member Data Documentation

Windows::UI::Xaml::Controls::ListViewItem item [private]

Definition at line 25 of file EdgeTappedListView.h.

The documentation for this struct was generated from the following file:
  • XamlListView/cppwinrt/EdgeTappedListView.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingScenarioEventArgs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • LoggingScenarioEventArgs
Public Member Functions | Private Attributes

LoggingScenarioEventArgs Struct Reference

#include "LoggingScenarioEventArgs.h"

List of all members.

Public Member Functions

LoggingScenarioEventArgs (LoggingScenarioEventType type)
LoggingScenarioEventArgs (LoggingScenarioEventType type, hstring const &logFileFullPath)
LoggingScenarioEventArgs (LoggingScenarioEventType type, bool enabled)
bool | Enabled () const noexcept
hstring | LogFileFullPath () const noexcept
LoggingScenarioEventType | Type () const noexcept

Private Attributes

bool | _enabled = false
hstring | _logFileFullPath
LoggingScenarioEventType | _type

Detailed Description

Definition at line 17 of file LoggingScenarioEventArgs.h.

Constructor & Destructor Documentation

LoggingScenarioEventArgs ( LoggingScenarioEventType type ) [inline]

Definition at line 20 of file LoggingScenarioEventArgs.h.

            : _type(type) {}

LoggingScenarioEventArgs | ( | LoggingScenarioEventType | type,
 |  | hstring const & | logFileFullPath |
 | ) |  |  | [inline]

Definition at line 24 of file LoggingScenarioEventArgs.h.

            : _type(type), _logFileFullPath(logFileFullPath) {}

LoggingScenarioEventArgs | ( | LoggingScenarioEventType | type,
 |  | bool | enabled |
 | ) |  |  | [inline]

Definition at line 28 of file LoggingScenarioEventArgs.h.

            : _type(type), _enabled(enabled) {}

Member Function Documentation

bool Enabled ( ) const [inline]

Definition at line 32 of file LoggingScenarioEventArgs.h.

{ return _enabled; }

hstring LogFileFullPath ( ) const [inline]

Definition at line 33 of file LoggingScenarioEventArgs.h.

{ return _logFileFullPath; }

LoggingScenarioEventType Type ( ) const [inline]

Definition at line 31 of file LoggingScenarioEventArgs.h.

{ return _type; }

Member Data Documentation

bool _enabled = false [private]

Definition at line 37 of file LoggingScenarioEventArgs.h.

hstring _logFileFullPath [private]

Definition at line 38 of file LoggingScenarioEventArgs.h.

LoggingScenarioEventType _type [private]

Definition at line 36 of file LoggingScenarioEventArgs.h.

The documentation for this struct was generated from the following file:
  • Logging/cppwinrt/LoggingScenarioEventArgs.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrCapturedImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • OcrCapturedImage
Public Member Functions | Private Member Functions | Private Attributes

OcrCapturedImage Struct Reference

#include "OcrCapturedImage.h"

List of all members.

Public Member Functions

OcrCapturedImage ()
fire_and_forget | Application_Resuming (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
fire_and_forget | Application_Suspending (Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e)
fire_and_forget | CameraButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DisplayInformation_OrientationChanged (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
fire_and_forget | ExtractButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &e)
void | PreviewImage_SizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e)

Private Member Functions

std::pair
< Windows::Media::Capture::VideoRotation,
int > 		CalculatePreviewRotation ()
Windows::Foundation::IAsyncAction | CleanupCameraAsync ()
Windows::Foundation::IAsyncOperation
< DeviceInformation > 		FindCameraDeviceByPanelAsync (Windows::Devices::Enumeration::Panel desiredPanel)
Windows::Foundation::IAsyncAction | InitializeCameraAsync ()
fire_and_forget | MediaCapture_Failed (Windows::Media::Capture::MediaCapture const &sender, Windows::Media::Capture::MediaCaptureFailedEventArgs const &errorEventArgs)
Windows::Foundation::IAsyncAction | SetPreviewRotationAsync ()
Windows::Foundation::IAsyncAction | StartCameraAsync ()
Windows::Foundation::IAsyncAction | StartPreviewAsync ()
Windows::Foundation::IAsyncAction | StopPreviewAsync ()
void | UpdateWordBoxTransform ()

Private Attributes

event_token | applicationResumingToken
event_token | applicationSuspendingToken
Windows::System::Display::DisplayRequest | displayRequest
bool | externalCamera = false
bool | isInitialized = false
bool | isPreviewing = false
event_token | mediaCaptureFailedToken
bool | mirroringPreview = false
event_token | orientationChangedEventToken
std::vector< com_ptr
< WordOverlay > > 		wordBoxes

Detailed Description

Definition at line 16 of file OcrCapturedImage.h.

Constructor & Destructor Documentation

OcrCapturedImage ( )

Definition at line 28 of file OcrCapturedImage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Application_Resuming | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e
 | ) |  |
fire_and_forget Application_Suspending | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs const & | e
 | ) |  |
std::pair< VideoRotation, int > CalculatePreviewRotation ( ) [private]

Reads the current orientation of the app and calculates the VideoRotation necessary to ensure the preview is rendered in the correct orientation.

Returns:
The rotation value to use in MediaCapture.SetPreviewRotation, and the accompanying rotation metadata with which to tag the preview stream.

Definition at line 517 of file OcrCapturedImage.cpp.

    {
        VideoRotation sourceRotation;
        int rotationDegrees;

        // Note that in some cases, the rotation direction needs to be inverted if the preview is being mirrored.
        switch (displayInformation.CurrentOrientation())
        {
        case DisplayOrientations::Portrait:
            if (mirroringPreview)
            {
                rotationDegrees = 270;
                sourceRotation = VideoRotation::Clockwise270Degrees;
            }
            else
            {
                rotationDegrees = 90;
                sourceRotation = VideoRotation::Clockwise90Degrees;
            }
            break;

        case DisplayOrientations::LandscapeFlipped:
            // No need to invert this rotation, as rotating 180 degrees is the same either way.
            rotationDegrees = 180;
            sourceRotation = VideoRotation::Clockwise180Degrees;
            break;

        case DisplayOrientations::PortraitFlipped:
            if (mirroringPreview)
            {
                rotationDegrees = 90;
                sourceRotation = VideoRotation::Clockwise90Degrees;
            }
            else
            {
                rotationDegrees = 270;
                sourceRotation = VideoRotation::Clockwise270Degrees;
            }
            break;

        case DisplayOrientations::Landscape:
        default:
            rotationDegrees = 0;
            sourceRotation = VideoRotation::None;
            break;
        }

        return { sourceRotation, rotationDegrees };
    }

fire_and_forget CameraButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
IAsyncAction CleanupCameraAsync ( ) [private]

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.

Definition at line 462 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        if (isInitialized)
        {
            if (isPreviewing)
            {
                // The call to stop the preview is included here for completeness, but can be
                // safely removed if a call to MediaCapture.Dispose() is being made later,
                // as the preview will be automatically stopped at that point
                co_await StopPreviewAsync();
            }

            isInitialized = false;
        }

        if (mediaCapture != nullptr)
        {
            mediaCapture.Failed(mediaCaptureFailedToken);
            mediaCapture.Close();
            mediaCapture = nullptr;
        }
    }

void DisplayInformation_OrientationChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e
 | ) |  |
fire_and_forget ExtractButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
IAsyncOperation< DeviceInformation > FindCameraDeviceByPanelAsync ( Windows::Devices::Enumeration::Panel desiredPanel ) [private]

Queries the available video capture devices to try and find one mounted on the desired panel.

Parameters:
desiredPanel The panel on the device that the desired camera is mounted on.
Returns:
A DeviceInformation instance with a reference to the camera mounted on the desired panel if available, any other camera if not, or null if no camera is available.

Definition at line 493 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        // Get available devices for capturing pictures.
        auto allVideoDevices = co_await DeviceInformation::FindAllAsync(DeviceClass::VideoCapture);

        // Get the desired camera by panel
        for (auto&& device : allVideoDevices)
        {
            if (device.EnclosureLocation() != nullptr && device.EnclosureLocation().Panel() == desiredPanel)
            {
                co_return device;
            }
        }

        // If there is no device mounted on the desired panel, return the first device found, if any.
        co_return allVideoDevices.Size() == 0 ? nullptr : allVideoDevices.GetAt(0);
    }

IAsyncAction InitializeCameraAsync ( ) [private]

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.

Definition at line 315 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        if (mediaCapture == nullptr)
        {
            // Attempt to get the back camera if one is available, but use any camera device if not.
            auto cameraDevice = co_await FindCameraDeviceByPanelAsync(winrt::Windows::Devices::Enumeration::Panel::Back);

            if (cameraDevice == nullptr)
            {
                rootPage.NotifyUser(L"No camera device!", NotifyType::ErrorMessage);

                co_return;
            }

            // Create MediaCapture and its settings.
            mediaCapture = MediaCapture();

            // Register for a notification when something goes wrong
            mediaCaptureFailedToken = mediaCapture.Failed({ get_weak(), &OcrCapturedImage::MediaCapture_Failed });

            MediaCaptureInitializationSettings settings;
            settings.VideoDeviceId(cameraDevice.Id());

            // Initialize MediaCapture
            try
            {
                co_await mediaCapture.InitializeAsync(settings);
                isInitialized = true;
            }
            catch (winrt::hresult_access_denied const&)
            {
                rootPage.NotifyUser(L"Denied access to the camera.", NotifyType::ErrorMessage);
            }
            catch (winrt::hresult_error const& e)
            {
                rootPage.NotifyUser(L"Exception when init MediaCapture. " + e.message(), NotifyType::ErrorMessage);
            }

            // If initialization succeeded, start the preview.
            if (isInitialized)
            {
                // Figure out where the camera is located
                if (cameraDevice.EnclosureLocation() == nullptr || cameraDevice.EnclosureLocation().Panel() == winrt::Windows::Devices::Enumeration::Panel::Unknown)
                {
                    // No information on the location of the camera, assume it's an external camera, not integrated on the device.
                    externalCamera = true;
                }
                else
                {
                    // Camera is fixed on the device.
                    externalCamera = false;

                    // Only mirror the preview if the camera is on the front panel.
                    mirroringPreview = (cameraDevice.EnclosureLocation().Panel() == winrt::Windows::Devices::Enumeration::Panel::Front);
                }

                co_await StartPreviewAsync();
            }
        }
    }

fire_and_forget MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture const & | sender,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs const & | errorEventArgs |
 | ) |  |  | [private]
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const & e )
void PreviewImage_SizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::SizeChangedEventArgs const & | e
 | ) |  |
IAsyncAction SetPreviewRotationAsync ( ) [private]

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.

Definition at line 413 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        // Only need to update the orientation if the camera is mounted on the device.
        if (externalCamera) co_return;

        // Calculate which way and how far to rotate the preview.
        auto [sourceRotation, rotationDegrees] = CalculatePreviewRotation();

        // Set preview rotation in the preview source.
        mediaCapture.SetPreviewRotation(sourceRotation);

        // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
        auto props = mediaCapture.VideoDeviceController().GetMediaStreamProperties(MediaStreamType::VideoPreview);
        props.Properties().Insert(RotationKey, box_value(rotationDegrees));
        co_await mediaCapture.SetEncodingPropertiesAsync(MediaStreamType::VideoPreview, props, nullptr);
    }

Windows::Foundation::IAsyncAction StartCameraAsync ( ) [private]

Starts the camera.

Initializes resources and starts preview.

Definition at line 286 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        if (!isInitialized)
        {
            co_await InitializeCameraAsync();
        }

        if (isInitialized)
        {
            TextOverlay().Children().Clear();
            wordBoxes.clear();

            PreviewImage().Source(nullptr);

            PreviewControl().Visibility(Visibility::Visible);
            Image().Visibility(Visibility::Collapsed);

            ExtractButton().Visibility(Visibility::Visible);
            CameraButton().Visibility(Visibility::Collapsed);

            rootPage.NotifyUser(L"Camera started.", NotifyType::StatusMessage);
        }
    }

IAsyncAction StartPreviewAsync ( ) [private]

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.

Definition at line 381 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        // Prevent the device from sleeping while the preview is running.
        displayRequest.RequestActive();

        // Set the preview source in the UI and mirror it if necessary.
        PreviewControl().Source(mediaCapture);
        PreviewControl().FlowDirection(mirroringPreview ? Windows::UI::Xaml::FlowDirection::RightToLeft : Windows::UI::Xaml::FlowDirection::LeftToRight);

        // Start the preview.
        try
        {
            co_await mediaCapture.StartPreviewAsync();
            isPreviewing = true;
        }
        catch (winrt::hresult_error const& ex)
        {
            rootPage.NotifyUser(L"Exception starting preview." + ex.message(), NotifyType::ErrorMessage);
        }

        // Initialize the preview to the current orientation.
        if (isPreviewing)
        {
            co_await SetPreviewRotationAsync();
        }
    }

IAsyncAction StopPreviewAsync ( ) [private]

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI.

Returns:

Definition at line 436 of file OcrCapturedImage.cpp.

    {
        auto lifetime = get_strong();

        try
        {
            isPreviewing = false;
            co_await mediaCapture.StopPreviewAsync();
        }
        catch (winrt::hresult_error const& ex)
        {
            rootPage.NotifyUser(L"Exception stopping preview. " + ex.message(), NotifyType::ErrorMessage);
        }

        // Use the dispatcher because this method is sometimes called from non-UI threads.
        co_await resume_foreground(Dispatcher());

        PreviewControl().Source(nullptr);

        // Allow the device to sleep now that the preview is stopped.
        displayRequest.RequestRelease();
    }

void UpdateWordBoxTransform ( ) [private]

Update word box transform to match current UI size.

Definition at line 240 of file OcrCapturedImage.cpp.

    {
        WriteableBitmap bitmap = PreviewImage().Source().as<WriteableBitmap>();

        if (bitmap != nullptr)
        {
            // Used for text overlay.
            // Prepare scale transform for words since image is not displayed in original size.
            ScaleTransform scaleTransform;
            scaleTransform.CenterX(0);
            scaleTransform.CenterY(0);
            scaleTransform.ScaleX(PreviewImage().ActualWidth() / bitmap.PixelWidth());
            scaleTransform.ScaleY(PreviewImage().ActualHeight() / bitmap.PixelHeight());

            for (auto&& item : wordBoxes)
            {
                item->Transform(scaleTransform);
            }
        }
    }

Member Data Documentation

event_token applicationResumingToken [private]

Definition at line 62 of file OcrCapturedImage.h.

event_token applicationSuspendingToken [private]

Definition at line 61 of file OcrCapturedImage.h.

Windows::System::Display::DisplayRequest displayRequest [private]

Definition at line 41 of file OcrCapturedImage.h.

bool externalCamera = false [private]

Definition at line 57 of file OcrCapturedImage.h.

bool isInitialized = false [private]

Definition at line 52 of file OcrCapturedImage.h.

bool isPreviewing = false [private]

Definition at line 53 of file OcrCapturedImage.h.

event_token mediaCaptureFailedToken [private]

Definition at line 60 of file OcrCapturedImage.h.

bool mirroringPreview = false [private]

Definition at line 56 of file OcrCapturedImage.h.

event_token orientationChangedEventToken [private]

Definition at line 59 of file OcrCapturedImage.h.

std::vector<com_ptr<WordOverlay> > wordBoxes [private]

Definition at line 32 of file OcrCapturedImage.h.

The documentation for this struct was generated from the following files:
  • OCR/cppwinrt/OcrCapturedImage.h
  • OCR/cppwinrt/OcrCapturedImage.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OcrFileImage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • OcrFileImage
Public Member Functions | Private Member Functions | Private Attributes

OcrFileImage Struct Reference

#include "OcrFileImage.h"

List of all members.

Public Member Functions

OcrFileImage ()
fire_and_forget | ExtractButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | LanguageList_SelectionChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
Windows::Foundation::IAsyncAction | LoadButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | PreviewImage_SizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SampleButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | UserLanguageToggle_Toggled (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | ClearResults ()
Windows::Foundation::IAsyncAction | LoadImageAsync (Windows::Storage::StorageFile const &file)
Windows::Foundation::IAsyncAction | LoadSampleImageAsync ()
void | UpdateAvailableLanguages ()
void | UpdateWordBoxTransform ()

Private Attributes

std::vector< com_ptr
< WordOverlay > > 		wordBoxes

Detailed Description

Definition at line 10 of file OcrFileImage.h.

Constructor & Destructor Documentation

OcrFileImage ( )

Definition at line 23 of file OcrFileImage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ClearResults ( ) [private]

Clears extracted text and text overlay from previous OCR.

Definition at line 116 of file OcrFileImage.cpp.

    {
        TextOverlay().RenderTransform(nullptr);
        ExtractedTextBox().Text({});
        TextOverlay().Children().Clear();
        wordBoxes.clear();
    }

fire_and_forget ExtractButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void LanguageList_SelectionChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction LoadButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction LoadImageAsync ( Windows::Storage::StorageFile const & file ) [private]
IAsyncAction LoadSampleImageAsync ( ) [private]

Definition at line 105 of file OcrFileImage.cpp.

    {
        auto lifetime = get_strong();

        StorageFile file = co_await Windows::ApplicationModel::Package::Current().InstalledLocation().GetFileAsync(L"Assets\\splash-sdk.png");
        co_await LoadImageAsync(file);
    }

fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void PreviewImage_SizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SampleButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateAvailableLanguages ( ) [private]

Updates list of ocr languages available on device.

Definition at line 46 of file OcrFileImage.cpp.

    {
        if (!UserLanguageToggle().IsOn())
        {
            std::vector<IInspectable> items;
            for (auto&& language : OcrEngine::AvailableRecognizerLanguages())
            {
                ComboBoxItem item;
                item.Content(box_value(language.DisplayName()));
                item.Tag(language);
                items.push_back(item);
            }
            // Check if any OCR language is available on device.
            if (items.size() > 0)
            {
                LanguageList().ItemsSource(winrt::single_threaded_vector<IInspectable>(std::move(items)));
                LanguageList().SelectedIndex(0);
                LanguageList().IsEnabled(true);
            }
            else
            {
                // Prevent OCR if no OCR languages are available on device.
                UserLanguageToggle().IsEnabled(false);
                LanguageList().IsEnabled(false);
                ExtractButton().IsEnabled(false);
                rootPage.NotifyUser(L"No available OCR languages.", NotifyType::ErrorMessage);
            }
        }
        else
        {
            LanguageList().ItemsSource(nullptr);
            LanguageList().IsEnabled(false);

            rootPage.NotifyUser(
                L"Run OCR in first OCR available language from UserProfile.GlobalizationPreferences.Languages list.",
                NotifyType::StatusMessage);
        }
    }

void UpdateWordBoxTransform ( ) [private]

Update word box transform to match current UI size.

Definition at line 127 of file OcrFileImage.cpp.

    {
        // Used for text overlay.
        // Prepare scale transform for words since image is not displayed in original size
        ScaleTransform scaleTransform;
        scaleTransform.CenterX(0);
        scaleTransform.CenterY(0);
        scaleTransform.ScaleX(PreviewImage().ActualWidth() / bitmap.PixelWidth());
        scaleTransform.ScaleY(PreviewImage().ActualHeight() / bitmap.PixelHeight());

        for (auto&& item : wordBoxes)
        {
            item->Transform(scaleTransform);
        }
    }

void UserLanguageToggle_Toggled | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

std::vector<com_ptr<WordOverlay> > wordBoxes [private]

Definition at line 33 of file OcrFileImage.h.

The documentation for this struct was generated from the following files:
  • OCR/cppwinrt/OcrFileImage.h
  • OCR/cppwinrt/OcrFileImage.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OpenCloseConnectionScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • OpenCloseConnectionScenario
Public Member Functions

OpenCloseConnectionScenario Struct Reference

#include "OpenCloseConnectionScenario.h"

List of all members.

Public Member Functions

OpenCloseConnectionScenario ()
fire_and_forget GenerateRandomNumber_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file OpenCloseConnectionScenario.h.

Constructor & Destructor Documentation

OpenCloseConnectionScenario ( )

Definition at line 25 of file OpenCloseConnectionScenario.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget GenerateRandomNumber_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.h
  • AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OtherScenarios Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • OtherScenarios
Public Member Functions | Private Member Functions | Static Private Attributes

OtherScenarios Struct Reference

#include "OtherScenarios.h"

List of all members.

Public Member Functions

OtherScenarios ()
void | ClearOutputButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | EmptyClipboardButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | RegisterClipboardContentChanged_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ShowFormatButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | ClearOutput ()
void | DisplayFormats ()

Static Private Attributes

static bool | registerContentChanged = false

Detailed Description

Definition at line 19 of file OtherScenarios.h.

Constructor & Destructor Documentation

OtherScenarios ( )

Definition at line 29 of file OtherScenarios.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ClearOutput ( ) [private]

Definition at line 86 of file OtherScenarios.cpp.

    {
        rootPage.NotifyUser(L"", NotifyType::StatusMessage);
        OutputText().Text(L"");
    }

void ClearOutputButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void DisplayFormats ( ) [private]

Definition at line 92 of file OtherScenarios.cpp.

    {
        rootPage.NotifyUser(L"", NotifyType::StatusMessage);
        OutputText().Text(SampleState::BuildClipboardFormatsOutputString());
    }

void EmptyClipboardButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void RegisterClipboardContentChanged_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ShowFormatButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

bool registerContentChanged = false [static, private]

Definition at line 31 of file OtherScenarios.h.

The documentation for this struct was generated from the following files:
  • Clipboard/cppwinrt/OtherScenarios.h
  • Clipboard/cppwinrt/OtherScenarios.cpp
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlotDataReadyEventArgs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • PlotDataReadyEventArgs
Public Member Functions | Private Attributes

PlotDataReadyEventArgs Struct Reference

#include "PlotData.h"

List of all members.

Public Member Functions

PlotDataReadyEventArgs (Windows::Storage::Streams::IBuffer const &buffer)
auto Points ()

Private Attributes

Windows::Storage::Streams::IBuffer
const 		m_buffer

Detailed Description

Definition at line 17 of file PlotData.h.

Constructor & Destructor Documentation

PlotDataReadyEventArgs ( Windows::Storage::Streams::IBuffer const & buffer ) [inline]

Definition at line 19 of file PlotData.h.

: m_buffer(buffer) {}

Member Function Documentation

auto Points ( ) [inline]

Definition at line 21 of file PlotData.h.

{ return m_buffer; }

Member Data Documentation

Windows::Storage::Streams::IBuffer const m_buffer [private]

Definition at line 24 of file PlotData.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/PlotData.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlotDataSourceT< D > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • PlotDataSourceT< D >
Public Member Functions | Protected Member Functions | Protected Attributes

PlotDataSourceT< D > Struct Template Reference

#include "PlotData.h"

List of all members.

Public Member Functions

event_token | PlotDataReady (Windows::Foundation::TypedEventHandler< IPlotDataSource, SDKTemplate::PlotDataReadyEventArgs > const &handler)
void | PlotDataReady (event_token token)

Protected Member Functions

void | ReportPlotDataReady (Windows::Storage::Streams::IBuffer const &buffer)

Protected Attributes

event
< Windows::Foundation::TypedEventHandler
< IPlotDataSource,
SDKTemplate::PlotDataReadyEventArgs > > 		m_plotDataReady

Detailed Description

template<typename D>
struct winrt::SDKTemplate::implementation::PlotDataSourceT< D >

Definition at line 28 of file PlotData.h.

Member Function Documentation

event_token PlotDataReady ( Windows::Foundation::TypedEventHandler< IPlotDataSource, SDKTemplate::PlotDataReadyEventArgs > const & handler ) [inline]

Definition at line 30 of file PlotData.h.

        {
            return m_plotDataReady.add(handler);
        }

void PlotDataReady ( event_token token ) [inline]

Definition at line 34 of file PlotData.h.

        {
            return m_plotDataReady.remove(token);
        }

void ReportPlotDataReady ( Windows::Storage::Streams::IBuffer const & buffer ) [inline, protected]

Definition at line 42 of file PlotData.h.

        {
            m_plotDataReady(*static_cast<D*>(this), make<implementation::PlotDataReadyEventArgs>(buffer));
        }

Member Data Documentation

event<Windows::Foundation::TypedEventHandler<IPlotDataSource, SDKTemplate::PlotDataReadyEventArgs> > m_plotDataReady [protected]

Definition at line 40 of file PlotData.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/PlotData.h
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlugInFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • PlugInFilter
Public Member Functions | Private Attributes

PlugInFilter Struct Reference

#include "PlugInFilter.h"

List of all members.

Public Member Functions

PlugInFilter (Windows::Web::Http::Filters::IHttpFilter const &innerFilter)
void | Close ()
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Web::Http::HttpResponseMessage,
Windows::Web::Http::HttpProgress > 		SendRequestAsync (Windows::Web::Http::HttpRequestMessage request)

Private Attributes

Windows::Web::Http::Filters::IHttpFilter | m_innerFilter

Detailed Description

Definition at line 17 of file PlugInFilter.h.

Constructor & Destructor Documentation

PlugInFilter ( Windows::Web::Http::Filters::IHttpFilter const & innerFilter )

Member Function Documentation

void Close ( )

Definition at line 52 of file PlugInFilter.cpp.

    {
        m_innerFilter.Close();
    }

Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpResponseMessage, Windows::Web::Http::HttpProgress> SendRequestAsync ( Windows::Web::Http::HttpRequestMessage request )

Member Data Documentation

Windows::Web::Http::Filters::IHttpFilter m_innerFilter [private]

Definition at line 25 of file PlugInFilter.h.

The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/PlugInFilter.h
  • HttpClient/cppwinrt/PlugInFilter.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProtectionLevelSelectorInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ProtectionLevelSelectorInfo
Public Member Functions | Private Attributes

ProtectionLevelSelectorInfo Struct Reference

#include "DeviceHelpers.h"

List of all members.

Public Member Functions

ProtectionLevelSelectorInfo (hstring displayName, Windows::Devices::Enumeration::DevicePairingProtectionLevel protectionLevel)
hstring | DisplayName ()
Windows::Devices::Enumeration::DevicePairingProtectionLevel | ProtectionLevel ()

Private Attributes

hstring | displayName
Windows::Devices::Enumeration::DevicePairingProtectionLevel | protectionLevel

Detailed Description

Definition at line 108 of file DeviceHelpers.h.

Constructor & Destructor Documentation

ProtectionLevelSelectorInfo | ( | hstring | displayName,
 |  | Windows::Devices::Enumeration::DevicePairingProtectionLevel | protectionLevel |
 | ) |  |  | [inline]

Definition at line 110 of file DeviceHelpers.h.

            : displayName(std::move(displayName)), protectionLevel(protectionLevel)
        {
        }

Member Function Documentation

hstring DisplayName ( ) [inline]

Definition at line 115 of file DeviceHelpers.h.

        {
            return displayName;
        }

Windows::Devices::Enumeration::DevicePairingProtectionLevel ProtectionLevel ( ) [inline]

Definition at line 120 of file DeviceHelpers.h.

        {
            return protectionLevel;
        }

Member Data Documentation

hstring displayName [private]

Definition at line 126 of file DeviceHelpers.h.

Windows::Devices::Enumeration::DevicePairingProtectionLevel protectionLevel [private]

Definition at line 127 of file DeviceHelpers.h.

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProtectionSelectorChoices Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ProtectionSelectorChoices
Static Public Member Functions

ProtectionSelectorChoices Struct Reference

#include "DeviceHelpers.h"

List of all members.

Static Public Member Functions

static
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::ProtectionLevelSelectorInfo > 		Selectors ()

Detailed Description

Definition at line 131 of file DeviceHelpers.h.

Member Function Documentation

IObservableVector< SDKTemplate::ProtectionLevelSelectorInfo > Selectors ( ) [static]

Definition at line 246 of file DeviceHelpers.cpp.

    {
        return single_threaded_observable_vector<SDKTemplate::ProtectionLevelSelectorInfo>({
            make<ProtectionLevelSelectorInfo>(L"Default", DevicePairingProtectionLevel::Default),
            make<ProtectionLevelSelectorInfo>(L"None", DevicePairingProtectionLevel::None),
            make<ProtectionLevelSelectorInfo>(L"Encryption", DevicePairingProtectionLevel::Encryption),
            make<ProtectionLevelSelectorInfo>(L"Encryption and authentication", DevicePairingProtectionLevel::EncryptionAndAuthentication),
            });
    }

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h
  • DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioModel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • RadioModel
Public Member Functions | Private Member Functions | Private Attributes

RadioModel Struct Reference

#include "RadioModel.h"

List of all members.

Public Member Functions

RadioModel (Windows::Devices::Radios::Radio const &radio, Windows::UI::Core::CoreDispatcher const &dispatcher)
bool | IsEnabled ()
bool | IsRadioOn ()
void | IsRadioOn (bool value)
hstring | Name ()
void | PropertyChanged (winrt::event_token const &token)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)

Private Member Functions

void | NotifyPropertyChanged (hstring const &propertyName)
fire_and_forget | Radio_StateChanged (Windows::Devices::Radios::Radio const &, Windows::Foundation::IInspectable const &)
void | SetEnabled (bool value)
fire_and_forget | SetRadioState (bool value)

Private Attributes

Windows::UI::Core::CoreDispatcher | dispatcher
bool | isEnabled
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		propertyChanged
Windows::Devices::Radios::Radio | radio

Detailed Description

Definition at line 18 of file RadioModel.h.

Constructor & Destructor Documentation

RadioModel | ( | Windows::Devices::Radios::Radio const & | radio,
 |  | Windows::UI::Core::CoreDispatcher const & | dispatcher
 | ) |  |

Member Function Documentation

bool IsEnabled ( ) [inline]

Definition at line 27 of file RadioModel.h.

        {
            return isEnabled;
        }

void IsRadioOn ( bool value ) [inline]

Definition at line 37 of file RadioModel.h.

        {
            SetRadioState(value);
        }

bool IsRadioOn ( ) [inline]

Definition at line 32 of file RadioModel.h.

        {
            return radio.State() == Windows::Devices::Radios::RadioState::On;
        }

hstring Name ( ) [inline]

Definition at line 22 of file RadioModel.h.

        {
            return radio.Name();
        }

void NotifyPropertyChanged ( hstring const & propertyName ) [private]

Definition at line 43 of file RadioModel.cpp.

    {
        propertyChanged(*this, PropertyChangedEventArgs(propertyName));
    }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 42 of file RadioModel.h.

        {
            return propertyChanged.add(handler);
        }

void PropertyChanged ( winrt::event_token const & token ) [inline]

Definition at line 47 of file RadioModel.h.

        {
            propertyChanged.remove(token);
        }

fire_and_forget Radio_StateChanged | ( | Windows::Devices::Radios::Radio const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void SetEnabled ( bool value ) [private]

Definition at line 48 of file RadioModel.cpp.

    {
        isEnabled = value;
        NotifyPropertyChanged(L"IsEnabled");
    }

fire_and_forget SetRadioState ( bool value ) [private]

Definition at line 54 of file RadioModel.cpp.

    {
        if (value != IsRadioOn())
        {
            auto lifetime = get_strong();
            RadioState newState = value ? RadioState::On : RadioState::Off;
            SetEnabled(false);
            co_await radio.SetStateAsync(newState);
            SetEnabled(true);
            NotifyPropertyChanged(L"IsRadioOn");
        }
    }

Member Data Documentation

Windows::UI::Core::CoreDispatcher dispatcher [private]

Definition at line 54 of file RadioModel.h.

bool isEnabled [private]

Definition at line 56 of file RadioModel.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged [private]

Definition at line 55 of file RadioModel.h.

Windows::Devices::Radios::Radio radio [private]

Definition at line 53 of file RadioModel.h.

The documentation for this struct was generated from the following files:
  • RadioManager/cppwinrt/RadioModel.h
  • RadioManager/cppwinrt/RadioModel.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario01_GetText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario01_GetText
Public Member Functions | Private Member Functions | Private Attributes

Scenario01_GetText Struct Reference

#include "Scenario01_GetText.h"

List of all members.

Public Member Functions

Scenario01_GetText ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | MaxHttpVersionToggle_Toggled (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)

Private Attributes

bool | isFilterUsed = false

Detailed Description

Definition at line 19 of file Scenario01_GetText.h.

Constructor & Destructor Documentation

Scenario01_GetText ( )

Definition at line 28 of file Scenario01_GetText.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void MaxHttpVersionToggle_Toggled | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

bool isFilterUsed = false [private]

Definition at line 35 of file Scenario01_GetText.h.

The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario01_GetText.h
  • HttpClient/cppwinrt/Scenario01_GetText.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario02_GetStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario02_GetStream
Public Member Functions | Private Member Functions

Scenario02_GetStream Struct Reference

#include "Scenario02_GetStream.h"

List of all members.

Public Member Functions

Scenario02_GetStream ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Web::Http::HttpRequestMessage request)

Detailed Description

Definition at line 19 of file Scenario02_GetStream.h.

Constructor & Destructor Documentation

Scenario02_GetStream ( )

Definition at line 27 of file Scenario02_GetStream.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Web::Http::HttpRequestMessage request ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario02_GetStream.h
  • HttpClient/cppwinrt/Scenario02_GetStream.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario03_GetList Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario03_GetList
Public Member Functions | Private Member Functions

Scenario03_GetList Struct Reference

#include "Scenario03_GetList.h"

List of all members.

Public Member Functions

Scenario03_GetList ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)

Detailed Description

Definition at line 19 of file Scenario03_GetList.h.

Constructor & Destructor Documentation

Scenario03_GetList ( )

Definition at line 26 of file Scenario03_GetList.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario03_GetList.h
  • HttpClient/cppwinrt/Scenario03_GetList.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario04_PostText Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario04_PostText
Public Member Functions | Private Member Functions

Scenario04_PostText Struct Reference

#include "Scenario04_PostText.h"

List of all members.

Public Member Functions

Scenario04_PostText ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)

Detailed Description

Definition at line 19 of file Scenario04_PostText.h.

Constructor & Destructor Documentation

Scenario04_PostText ( )

Definition at line 25 of file Scenario04_PostText.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario04_PostText.h
  • HttpClient/cppwinrt/Scenario04_PostText.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario05_PostStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario05_PostStream
Public Member Functions | Private Member Functions

Scenario05_PostStream Struct Reference

#include "Scenario05_PostStream.h"

List of all members.

Public Member Functions

Scenario05_PostStream ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Web::Http::HttpRequestMessage request)

Detailed Description

Definition at line 19 of file Scenario05_PostStream.h.

Constructor & Destructor Documentation

Scenario05_PostStream ( )

Definition at line 46 of file Scenario05_PostStream.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Web::Http::HttpRequestMessage request ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario05_PostStream.h
  • HttpClient/cppwinrt/Scenario05_PostStream.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario06_PostMultipart Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario06_PostMultipart
Public Member Functions | Private Member Functions

Scenario06_PostMultipart Struct Reference

#include "Scenario06_PostMultipart.h"

List of all members.

Public Member Functions

Scenario06_PostMultipart ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri, Windows::Web::Http::HttpMultipartFormDataContent form)

Detailed Description

Definition at line 19 of file Scenario06_PostMultipart.h.

Constructor & Destructor Documentation

Scenario06_PostMultipart ( )

Definition at line 25 of file Scenario06_PostMultipart.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync | ( | Windows::Foundation::Uri | resourceUri,
 |  | Windows::Web::Http::HttpMultipartFormDataContent | form |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario06_PostMultipart.h
  • HttpClient/cppwinrt/Scenario06_PostMultipart.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario07_PostStreamWithProgress Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario07_PostStreamWithProgress
Public Member Functions | Private Member Functions

Scenario07_PostStreamWithProgress Struct Reference

#include "Scenario07_PostStreamWithProgress.h"

List of all members.

Public Member Functions

Scenario07_PostStreamWithProgress ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ChunkedResponseToggle_Toggled (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri, Windows::Web::Http::IHttpContent content)
fire_and_forget | ProgressHandler (Windows::Foundation::IAsyncOperationWithProgress< Windows::Web::Http::HttpRequestResult, Windows::Web::Http::HttpProgress > const &sender, Windows::Web::Http::HttpProgress progress)
void | ResetFields ()
void | UpdateAddressField ()

Detailed Description

Definition at line 19 of file Scenario07_PostStreamWithProgress.h.

Constructor & Destructor Documentation

Scenario07_PostStreamWithProgress ( )

Definition at line 26 of file Scenario07_PostStreamWithProgress.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync | ( | Windows::Foundation::Uri | resourceUri,
 |  | Windows::Web::Http::IHttpContent | content |
 | ) |  |  | [private]
void ChunkedResponseToggle_Toggled | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget ProgressHandler | ( | Windows::Foundation::IAsyncOperationWithProgress< Windows::Web::Http::HttpRequestResult, Windows::Web::Http::HttpProgress > const & | sender,
 |  | Windows::Web::Http::HttpProgress | progress |
 | ) |  |  | [private]
void ResetFields ( ) [private]

Definition at line 120 of file Scenario07_PostStreamWithProgress.cpp.

    {
        StageField().Text(L"");
        RetriesField().Text(L"0");
        BytesSentField().Text(L"0");
        TotalBytesToSendField().Text(L"0");
        BytesReceivedField().Text(L"0");
        TotalBytesToReceiveField().Text(L"0");
        RequestProgressBar().Value(0);
    }

fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateAddressField ( ) [private]

Definition at line 41 of file Scenario07_PostStreamWithProgress.cpp.

    {
        // Tell the server we want a transfer-encoding chunked response.
        hstring queryString{};
        if (ChunkedResponseToggle().IsOn())
        {
            queryString = L"?chunkedResponse=1";
        }

        Helpers::ReplaceQueryString(AddressField(), queryString);
    }

The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.h
  • HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario08_PostCustomContent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario08_PostCustomContent
Public Member Functions | Private Member Functions

Scenario08_PostCustomContent Struct Reference

#include "Scenario08_PostCustomContent.h"

List of all members.

Public Member Functions

Scenario08_PostCustomContent ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri, Windows::Web::Http::IHttpContent content)

Detailed Description

Definition at line 19 of file Scenario08_PostCustomContent.h.

Constructor & Destructor Documentation

Scenario08_PostCustomContent ( )

Definition at line 26 of file Scenario08_PostCustomContent.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync | ( | Windows::Foundation::Uri | resourceUri,
 |  | Windows::Web::Http::IHttpContent | content |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario08_PostCustomContent.h
  • HttpClient/cppwinrt/Scenario08_PostCustomContent.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario09_GetCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario09_GetCookie
Public Member Functions | Private Member Functions

Scenario09_GetCookie Struct Reference

#include "Scenario09_GetCookie.h"

List of all members.

Public Member Functions

Scenario09_GetCookie ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | GetCookies_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | SendHttpGetButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)

Detailed Description

Definition at line 19 of file Scenario09_GetCookie.h.

Constructor & Destructor Documentation

Scenario09_GetCookie ( )

Definition at line 26 of file Scenario09_GetCookie.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void GetCookies_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget SendHttpGetButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario09_GetCookie.h
  • HttpClient/cppwinrt/Scenario09_GetCookie.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1
Public Member Functions | Static Private Member Functions

Scenario1 Struct Reference

Creating a file.

#include "Scenario1.h"

List of all members.

Public Member Functions

Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
Scenario1 ()
fire_and_forget | CreateFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | CreateView_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DoWin10Mode (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
void | DoWin81Mode (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
fire_and_forget | Enumerate_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | GetFilesAndFoldersButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetThumbnailButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | SearchButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | ShowAsStandalone_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Static Private Member Functions

static
Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > 		GenerateSizePreferenceBinding ()

Detailed Description

Definition at line 22 of file Scenario1.h.

Constructor & Destructor Documentation

Scenario1 ( )

Definition at line 24 of file Scenario1.cpp.

    {
        InitializeComponent();
    }

Scenario1 ( )
Scenario1 ( )
Scenario1 ( )
Scenario1 ( )
Scenario1 ( )
Scenario1 ( )

Member Function Documentation

fire_and_forget CreateFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget CreateView_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DoWin10Mode | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |
void DoWin81Mode | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |

Definition at line 25 of file Scenario1.cpp.

{
    LoggingChannelScenario().LogWithWin81Constructor();
    MainPage::Current().NotifyUser(L"Complete: Windows 8 mode", NotifyType::StatusMessage);
}

fire_and_forget Enumerate_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 30 of file Scenario1.cpp.

    {
        auto lifetime = get_strong();

        DevicesList().Items().Clear();

        // Get the string identifier of the audio renderer
        hstring AudioSelector = MediaDevice::GetAudioRenderSelector();

        // Custom properties defined in mmdeviceapi.h in the format "{GUID} PID"
        constexpr wchar_t PKEY_AudioEndpoint_Supports_EventDriven_Mode[] = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 7";

        // Add custom properties to the query
        DeviceInformationCollection deviceInfoCollection = co_await DeviceInformation::FindAllAsync(AudioSelector, { PKEY_AudioEndpoint_Supports_EventDriven_Mode });
        try
        {
            // Enumerate through the devices and the custom properties
            for (DeviceInformation&& deviceInfo : deviceInfoCollection)
            {
                hstring deviceInfoString = deviceInfo.Name();

                // Pull out the custom property
                std::optional<uint32_t> supportsEventDriven = deviceInfo.Properties().TryLookup(PKEY_AudioEndpoint_Supports_EventDriven_Mode).try_as<uint32_t>();
                if (supportsEventDriven)
                {
                    deviceInfoString = deviceInfoString + L" --> EventDriven(" + to_hstring(supportsEventDriven.value()) + L")";
                }

                DevicesList().Items().Append(box_value(deviceInfoString));
            }
            rootPage.NotifyUser(L"Enumerated " + to_hstring(deviceInfoCollection.Size()) + L" device(s).", NotifyType::StatusMessage);
        }
        catch (...)
        {
            rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
        }
    }

IObservableVector< IInspectable > GenerateSizePreferenceBinding ( ) [static, private]

Definition at line 55 of file Scenario1.cpp.

    {
        auto sizeChoices = single_threaded_observable_vector<IInspectable>();

        sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::Default, L"Default"));
        sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseHalf, L"UseHalf"));
        sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseLess, L"UseLess"));
        sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseMinimum, L"UseMinimum"));
        sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseMore, L"UseMore"));

        return sizeChoices;
    }

fire_and_forget GetFilesAndFoldersButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GetThumbnailButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget SearchButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget ShowAsStandalone_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario1.h
  • FileSearch/cppwinrt/Scenario1.h
  • FileThumbnails/cppwinrt/Scenario1.h
  • FolderEnumeration/cppwinrt/Scenario1.h
  • Logging/cppwinrt/Scenario1.h
  • MultipleViews/cppwinrt/Scenario1.h
  • WindowsAudioSession/cppwinrt/Scenario1.h
  • FileAccess/cppwinrt/Scenario1.cpp
  • FileSearch/cppwinrt/Scenario1.cpp
  • FileThumbnails/cppwinrt/Scenario1.cpp
  • FolderEnumeration/cppwinrt/Scenario1.cpp
  • Logging/cppwinrt/Scenario1.cpp
  • MultipleViews/cppwinrt/Scenario1.cpp
  • WindowsAudioSession/cppwinrt/Scenario1.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario10
Public Member Functions

Scenario10 Struct Reference

#include "Scenario10.h"

List of all members.

Public Member Functions

Scenario10 ()
fire_and_forget | DeleteFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario10.h.

Constructor & Destructor Documentation

Scenario10 ( )

Definition at line 25 of file Scenario10.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget DeleteFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario10.h
  • FileAccess/cppwinrt/Scenario10.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario10_SetCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario10_SetCookie
Public Member Functions

Scenario10_SetCookie Struct Reference

#include "Scenario10_SetCookie.h"

List of all members.

Public Member Functions

Scenario10_SetCookie ()
void SetCookie_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario10_SetCookie.h.

Constructor & Destructor Documentation

Scenario10_SetCookie ( )

Definition at line 24 of file Scenario10_SetCookie.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void SetCookie_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario10_SetCookie.h
  • HttpClient/cppwinrt/Scenario10_SetCookie.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario11
Public Member Functions

Scenario11 Struct Reference

#include "Scenario11.h"

List of all members.

Public Member Functions

Scenario11 ()
fire_and_forget GetFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario11.h.

Constructor & Destructor Documentation

Scenario11 ( )

Definition at line 25 of file Scenario11.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget GetFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario11.h
  • FileAccess/cppwinrt/Scenario11.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario11_DeleteCookie Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario11_DeleteCookie
Public Member Functions

Scenario11_DeleteCookie Struct Reference

#include "Scenario11_DeleteCookie.h"

List of all members.

Public Member Functions

Scenario11_DeleteCookie ()
void DeleteCookie_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario11_DeleteCookie.h.

Constructor & Destructor Documentation

Scenario11_DeleteCookie ( )

Definition at line 24 of file Scenario11_DeleteCookie.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void DeleteCookie_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario11_DeleteCookie.h
  • HttpClient/cppwinrt/Scenario11_DeleteCookie.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario12_DisableCookies Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario12_DisableCookies
Public Member Functions | Private Member Functions

Scenario12_DisableCookies Struct Reference

#include "Scenario12_DisableCookies.h"

List of all members.

Public Member Functions

Scenario12_DisableCookies ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | SendInitialGetButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SendNextRequestButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableInitialRequestAsync (Windows::Foundation::Uri resourceUri)
Windows::Foundation::IAsyncAction | CancelableNextRequestAsync (Windows::Foundation::Uri resourceUri)

Detailed Description

Definition at line 19 of file Scenario12_DisableCookies.h.

Constructor & Destructor Documentation

Scenario12_DisableCookies ( )

Definition at line 27 of file Scenario12_DisableCookies.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableInitialRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
Windows::Foundation::IAsyncAction CancelableNextRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget SendInitialGetButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SendNextRequestButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario12_DisableCookies.h
  • HttpClient/cppwinrt/Scenario12_DisableCookies.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario13_RetryFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario13_RetryFilter
Public Member Functions | Private Member Functions

Scenario13_RetryFilter Struct Reference

#include "Scenario13_RetryFilter.h"

List of all members.

Public Member Functions

Scenario13_RetryFilter ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | RetryAfterSwitch_Toggled (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)
void | UpdateAddressField ()

Detailed Description

Definition at line 19 of file Scenario13_RetryFilter.h.

Constructor & Destructor Documentation

Scenario13_RetryFilter ( )

Definition at line 27 of file Scenario13_RetryFilter.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void RetryAfterSwitch_Toggled | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateAddressField ( ) [private]

Definition at line 45 of file Scenario13_RetryFilter.cpp.

    {
        // Tell the server which type of Retry-After header we would like to receive.
        hstring queryString;
        if (RetryAfterSwitch().IsOn())
        {
            queryString = L"?retryAfter=deltaSeconds";
        }
        else
        {
            queryString = L"?retryAfter=httpDate";
        }

        Helpers::ReplaceQueryString(AddressField(), queryString);
    }

The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario13_RetryFilter.h
  • HttpClient/cppwinrt/Scenario13_RetryFilter.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario14_MeteredConnectionFilter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario14_MeteredConnectionFilter
Public Member Functions | Private Member Functions

Scenario14_MeteredConnectionFilter Struct Reference

#include "Scenario14_MeteredConnectionFilter.h"

List of all members.

Public Member Functions

Scenario14_MeteredConnectionFilter ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OptInSwitch_Toggled (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Foundation::Uri resourceUri)

Detailed Description

Definition at line 19 of file Scenario14_MeteredConnectionFilter.h.

Constructor & Destructor Documentation

Scenario14_MeteredConnectionFilter ( )

Definition at line 27 of file Scenario14_MeteredConnectionFilter.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Foundation::Uri resourceUri ) [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OptInSwitch_Toggled | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.h
  • HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario15_ServerCertificateValidation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario15_ServerCertificateValidation
Public Member Functions | Private Member Functions

Scenario15_ServerCertificateValidation Struct Reference

#include "Scenario15_ServerCertificateValidation.h"

List of all members.

Public Member Functions

Scenario15_ServerCertificateValidation ()
void | Cancel_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DefaultAndCustomValidation_Checked (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DefaultOSValidation_Checked (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | IgnoreErrorsAndCustomValidation_Checked (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Start_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | CancelableRequestAsync (Windows::Web::Http::HttpRequestMessage request)
Windows::Foundation::IAsyncOperation
< bool > 		IsCertificateValidAsync (Windows::Security::Cryptography::Certificates::Certificate serverCert)
fire_and_forget | MyCustomServerCertificateValidator (Windows::Web::Http::Filters::HttpBaseProtocolFilter const &sender, Windows::Web::Http::Filters::HttpServerCustomValidationRequestedEventArgs args)

Detailed Description

Definition at line 19 of file Scenario15_ServerCertificateValidation.h.

Constructor & Destructor Documentation

Scenario15_ServerCertificateValidation ( )

Definition at line 30 of file Scenario15_ServerCertificateValidation.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Cancel_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction CancelableRequestAsync ( Windows::Web::Http::HttpRequestMessage request ) [private]
void DefaultAndCustomValidation_Checked | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void DefaultOSValidation_Checked | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void IgnoreErrorsAndCustomValidation_Checked | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncOperation<bool> IsCertificateValidAsync ( Windows::Security::Cryptography::Certificates::Certificate serverCert ) [private]
fire_and_forget MyCustomServerCertificateValidator | ( | Windows::Web::Http::Filters::HttpBaseProtocolFilter const & | sender,
 |  | Windows::Web::Http::Filters::HttpServerCustomValidationRequestedEventArgs | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Start_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.h
  • HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Advertiser Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Advertiser
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Advertiser Struct Reference

#include "Scenario1_Advertiser.h"

List of all members.

Public Member Functions

Scenario1_Advertiser ()
void | btnAddIe_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnCloseDevice_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | btnSendMessage_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnStartAdvertisement_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnStopAdvertisement_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
auto | ConnectedDevices ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncOperation
< bool > 		HandleConnectionRequestAsync (Windows::Devices::WiFiDirect::WiFiDirectConnectionRequest connectionRequest)
Windows::Foundation::IAsyncOperation
< bool > 		IsAepPairedAsync (hstring deviceId)
fire_and_forget | OnConnectionRequested (Windows::Devices::WiFiDirect::WiFiDirectConnectionListener const &, Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs const &e)
void | OnConnectionStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectDevice const &sender, Windows::Foundation::IInspectable const &)
fire_and_forget | OnSocketConnectionReceived (Windows::Networking::Sockets::StreamSocketListener sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs e)
fire_and_forget | OnStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher sender, Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs e)
void | StopAdvertisement ()

Private Attributes

std::vector
< Windows::Devices::WiFiDirect::WiFiDirectInformationElement > 		informationElements
std::map
< Windows::Networking::Sockets::StreamSocketListener,
Windows::Devices::WiFiDirect::WiFiDirectDevice > 		pendingConnections
slim_mutex | pendingConnectionsMutex

Detailed Description

Definition at line 19 of file Scenario1_Advertiser.h.

Constructor & Destructor Documentation

Scenario1_Advertiser ( )

Definition at line 33 of file Scenario1_Advertiser.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void btnAddIe_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnCloseDevice_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget btnSendMessage_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnStartAdvertisement_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnStopAdvertisement_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
auto ConnectedDevices ( ) [inline]

Definition at line 25 of file Scenario1_Advertiser.h.

{ return connectedDevices; }

Windows::Foundation::IAsyncOperation<bool> HandleConnectionRequestAsync ( Windows::Devices::WiFiDirect::WiFiDirectConnectionRequest connectionRequest ) [private]
IAsyncOperation< bool > IsAepPairedAsync ( hstring deviceId ) [private]

Definition at line 252 of file Scenario1_Advertiser.cpp.

    {
        auto lifetime = get_strong();

        DeviceInformation devInfo = nullptr;
        try
        {
            devInfo = co_await DeviceInformation::CreateFromIdAsync(deviceId, { L"System.Devices.Aep.DeviceAddress" });
        }
        catch (hresult_error const& ex)
        {
            rootPage.NotifyUser(L"DeviceInformation.CreateFromIdAsync threw an exception: " + ex.message(), NotifyType::ErrorMessage);
        }

        if (devInfo == nullptr)
        {
            rootPage.NotifyUser(L"Device Information is null", NotifyType::ErrorMessage);
            co_return false;
        }

        hstring deviceAddress = unbox_value<hstring>(devInfo.Properties().Lookup(L"System.Devices.Aep.DeviceAddress"));
        hstring deviceSelector = L"System.Devices.Aep.DeviceAddress:=\"" + deviceAddress + L"\"";
        DeviceInformationCollection pairedDeviceCollection = co_await DeviceInformation::FindAllAsync(deviceSelector, nullptr, DeviceInformationKind::Device);
        co_return pairedDeviceCollection.Size() > 0;
    }

fire_and_forget OnConnectionRequested | ( | Windows::Devices::WiFiDirect::WiFiDirectConnectionListener const & | ,
 |  | Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs const & | e |
 | ) |  |  | [private]
void OnConnectionStatusChanged | ( | Windows::Devices::WiFiDirect::WiFiDirectDevice const & | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnSocketConnectionReceived | ( | Windows::Networking::Sockets::StreamSocketListener | sender,
 |  | Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs | e |
 | ) |  |  | [private]
fire_and_forget OnStatusChanged | ( | Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher | sender,
 |  | Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs | e |
 | ) |  |  | [private]
void StopAdvertisement ( ) [private]

Definition at line 137 of file Scenario1_Advertiser.cpp.

    {
        publisher.Stop();
        publisher.StatusChanged(statusChangedToken);

        listener.ConnectionRequested(connectionRequestedToken);

        connectionSettingsPanel().Reset();
        informationElements.clear();

        btnStartAdvertisement().IsEnabled(true);
        btnStopAdvertisement().IsEnabled(false);
    }

Member Data Documentation

std::vector<Windows::Devices::WiFiDirect::WiFiDirectInformationElement> informationElements [private]

Definition at line 34 of file Scenario1_Advertiser.h.

std::map<Windows::Networking::Sockets::StreamSocketListener, Windows::Devices::WiFiDirect::WiFiDirectDevice> pendingConnections [private]

Definition at line 45 of file Scenario1_Advertiser.h.

slim_mutex pendingConnectionsMutex [private]

Definition at line 44 of file Scenario1_Advertiser.h.

The documentation for this struct was generated from the following files:
  • WiFiDirect/cppwinrt/Scenario1_Advertiser.h
  • WiFiDirect/cppwinrt/Scenario1_Advertiser.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Analyze Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Analyze
Public Member Functions

Scenario1_Analyze Struct Reference

#include "Scenario1_Analyze.h"

List of all members.

Public Member Functions

Scenario1_Analyze ()
void AnalyzeButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_Analyze.h.

Constructor & Destructor Documentation

Scenario1_Analyze ( )

Definition at line 27 of file Scenario1_Analyze.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AnalyzeButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.h
  • JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basic Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Basic
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Basic Struct Reference

#include "Scenario1_Basic.h"

List of all members.

Public Member Functions

Scenario1_Basic ()
Scenario1_Basic ()
Scenario1_Basic ()
Windows::UI::Xaml::Style | CheckBoxStyle ()
Windows::UI::ViewManagement::UserInteractionMode | InteractionMode ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | PropertyChanged (event_token const &token) noexcept
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | ResizeView_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SetMinimumSize_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ShowStandardSystemOverlaysButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ToggleFullScreenModeButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | UseMinimalOverlaysCheckBox_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | OnWindowResize (Windows::Foundation::IInspectable const &, Windows::UI::Core::WindowSizeChangedEventArgs const &e)
void | RootPage_OnKeyDown (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const &e)
void | UpdateContent ()
void | UpdateContent ()
void | UpdateContent ()

Private Attributes

bool | isLastKnownFullScreen = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView().IsFullScreenMode()
event_token | keyDownToken
Windows::UI::ViewManagement::UserInteractionMode | m_interactionMode
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged
event_token | windowResizeToken
event_token | windowSizeChangedToken

Detailed Description

Definition at line 19 of file Scenario1_Basic.h.

Constructor & Destructor Documentation

Scenario1_Basic ( )

Definition at line 26 of file Scenario1_Basic.cpp.

    {
        InitializeComponent();
    }

Scenario1_Basic ( )
Scenario1_Basic ( )

Member Function Documentation

Windows::UI::Xaml::Style CheckBoxStyle ( ) [inline]

Definition at line 24 of file Scenario1_Basic.h.

        {
            return m_checkBoxStyle;
        }

Windows::UI::ViewManagement::UserInteractionMode InteractionMode ( ) [inline]

Definition at line 29 of file Scenario1_Basic.h.

        {
            return m_interactionMode;
        }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnWindowResize | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::WindowSizeChangedEventArgs const & | e |
 | ) |  |  | [private]
void PropertyChanged ( event_token const & token )

Definition at line 66 of file Scenario1_Basic.cpp.

    {
        m_propertyChanged.remove(token);
    }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler )
void ResizeView_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void RootPage_OnKeyDown | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Input::KeyRoutedEventArgs const & | e |
 | ) |  |  | [private]
void SetMinimumSize_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ShowStandardSystemOverlaysButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ToggleFullScreenModeButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateContent ( ) [private]
void UpdateContent ( ) [private]

Definition at line 85 of file Scenario1_Basic.cpp.

    {
        ApplicationView view = ApplicationView::GetForCurrentView();
        bool isFullScreenMode = view.IsFullScreenMode();
        ToggleFullScreenModeSymbol().Symbol(isFullScreenMode ? Symbol::BackToWindow : Symbol::FullScreen);
        ReportFullScreenMode().Text(isFullScreenMode ? L"is in" : L"is not in");
        FullScreenOptionsPanel().Visibility(isFullScreenMode ? Visibility::Visible : Visibility::Collapsed);

        // Did the system force a change in full screen mode?
        if (isLastKnownFullScreen != isFullScreenMode)
        {
            isLastKnownFullScreen = isFullScreenMode;
            // Clear any stray messages that talked about the mode we are no longer in.
            rootPage.NotifyUser(L"", NotifyType::StatusMessage);
        }
    }

void UpdateContent ( ) [private]
void UseMinimalOverlaysCheckBox_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

bool isLastKnownFullScreen = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView().IsFullScreenMode() [private]

Definition at line 35 of file Scenario1_Basic.h.

event_token keyDownToken [private]

Definition at line 38 of file Scenario1_Basic.h.

Windows::UI::ViewManagement::UserInteractionMode m_interactionMode [private]

Definition at line 43 of file Scenario1_Basic.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 41 of file Scenario1_Basic.h.

event_token windowResizeToken [private]

Definition at line 37 of file Scenario1_Basic.h.

event_token windowSizeChangedToken [private]

Definition at line 31 of file Scenario1_Basic.h.

The documentation for this struct was generated from the following files:
  • FullScreenMode/cppwinrt/Scenario1_Basic.h
  • ResizeAppView/cppwinrt/Scenario1_Basic.h
  • UserInteractionMode/cppwinrt/Scenario1_Basic.h
  • FullScreenMode/cppwinrt/Scenario1_Basic.cpp
  • ResizeAppView/cppwinrt/Scenario1_Basic.cpp
  • UserInteractionMode/cppwinrt/Scenario1_Basic.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_BasicFunctionality Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_BasicFunctionality
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_BasicFunctionality Struct Reference

#include "Scenario1_BasicFunctionality.h"

List of all members.

Public Member Functions

Scenario1_BasicFunctionality ()
fire_and_forget | claimedScanner_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &sender, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (Windows::Foundation::IInspectable const &, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | ScenarioEndScanButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ScenarioStartScanButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ScenarioStartTriggerButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ScenarioStopTriggerButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | ResetTheScenarioState ()

Private Attributes

event_token | m_claimedScannerDataReceivedToken
event_token | m_claimedScannerReleaseDeviceRequestedToken

Detailed Description

Definition at line 18 of file Scenario1_BasicFunctionality.h.

Constructor & Destructor Documentation

Scenario1_BasicFunctionality ( )

Definition at line 30 of file Scenario1_BasicFunctionality.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget claimedScanner_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | sender,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args
 | ) |  |
void claimedScanner_ReleaseDeviceRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void ResetTheScenarioState ( ) [private]

Definition at line 45 of file Scenario1_BasicFunctionality.cpp.

    {
        if (m_claimedScanner)
        {
            // Detach the event handlers
            m_claimedScanner.DataReceived(m_claimedScannerDataReceivedToken);
            m_claimedScanner.ReleaseDeviceRequested(m_claimedScannerReleaseDeviceRequestedToken);
            // Release the Barcode Scanner and set to null
            m_claimedScanner = nullptr;
        }

        m_scanner = nullptr;

        // Reset the UI if we are still the current page.
        if (Frame().Content() == *this)
        {
            m_rootPage.NotifyUser(L"Click the start scanning button to begin.", NotifyType::StatusMessage);
            ScenarioOutputScanData().Text(L"No data");
            ScenarioOutputScanDataLabel().Text(L"No data");
            ScenarioOutputScanDataType().Text(L"No data");

            // reset the button state
            ScenarioEndScanButton().IsEnabled(false);
            ScenarioStartScanButton().IsEnabled(true);
            ScenarioSoftwareTriggerPanel().Visibility(Visibility::Collapsed);
        }
    }

void ScenarioEndScanButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ScenarioStartScanButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ScenarioStartTriggerButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ScenarioStopTriggerButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

event_token m_claimedScannerDataReceivedToken [private]

Definition at line 36 of file Scenario1_BasicFunctionality.h.

event_token m_claimedScannerReleaseDeviceRequestedToken [private]

Definition at line 40 of file Scenario1_BasicFunctionality.h.

The documentation for this struct was generated from the following files:
  • BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.h
  • BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Basics Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Basics
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Basics Struct Reference

#include "Scenario1_Basics.h"

List of all members.

Public Member Functions

Scenario1_Basics ()
void | Apply_Clicked (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

void | ApplySettingsToLampArray (winrt::Windows::Devices::Lights::LampArray const &lampArray)
winrt::fire_and_forget | LampArray_AvailabilityChanged (winrt::Windows::Devices::Lights::LampArray const &sender, winrt::Windows::Foundation::IInspectable const &)
void | SetGradientPatternToLampArray (winrt::Windows::Devices::Lights::LampArray const &lampArray)
void | SetWasdPatternToLampArray (winrt::Windows::Devices::Lights::LampArray const &lampArray)
void | UpdateLampArrayList ()
winrt::fire_and_forget | Watcher_Added (winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformation const &deviceInformation)
winrt::fire_and_forget | Watcher_Removed (winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformationUpdate deviceInformationUpdate)

Private Attributes

std::vector< std::shared_ptr
< LampArrayInfo > > 		m_attachedLampArrays
winrt::Windows::Devices::Enumeration::DeviceWatcher::Added_revoker | m_deviceAddedRevoker
winrt::Windows::Devices::Enumeration::DeviceWatcher::Removed_revoker | m_deviceRemovedRevoker

Detailed Description

Definition at line 18 of file Scenario1_Basics.h.

Constructor & Destructor Documentation

Scenario1_Basics ( )

Definition at line 27 of file Scenario1_Basics.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Apply_Clicked | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ApplySettingsToLampArray ( winrt::Windows::Devices::Lights::LampArray const & lampArray ) [private]
winrt::fire_and_forget LampArray_AvailabilityChanged | ( | winrt::Windows::Devices::Lights::LampArray const & | sender,
 |  | winrt::Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void SetGradientPatternToLampArray ( winrt::Windows::Devices::Lights::LampArray const & lampArray ) [private]
void SetWasdPatternToLampArray ( winrt::Windows::Devices::Lights::LampArray const & lampArray ) [private]
void UpdateLampArrayList ( ) [private]

Definition at line 107 of file Scenario1_Basics.cpp.

    {
        std::wstring message = std::wstring(L"Attached LampArrays: ") + std::to_wstring(m_attachedLampArrays.size()) + L"\n";

        for (auto&& info : m_attachedLampArrays)
        {
            message += std::wstring(L"\t") + std::wstring(info->displayName) + L" ("
                + std::to_wstring(info->lampArray.LampArrayKind()) + L", " + std::to_wstring(info->lampArray.LampCount()) + L" lamps, "
                + std::wstring(info->lampArray.IsAvailable() ? L"Available" : L"Unavailable") + L")\n";
        }

        LampArraysSummary().Text(message);
    }

winrt::fire_and_forget Watcher_Added | ( | winrt::Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | winrt::Windows::Devices::Enumeration::DeviceInformation const & | deviceInformation |
 | ) |  |  | [private]
winrt::fire_and_forget Watcher_Removed | ( | winrt::Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | winrt::Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [private]

Member Data Documentation

std::vector<std::shared_ptr<LampArrayInfo> > m_attachedLampArrays [private]

Definition at line 31 of file Scenario1_Basics.h.

winrt::Windows::Devices::Enumeration::DeviceWatcher::Added_revoker m_deviceAddedRevoker [private]

Definition at line 37 of file Scenario1_Basics.h.

winrt::Windows::Devices::Enumeration::DeviceWatcher::Removed_revoker m_deviceRemovedRevoker [private]

Definition at line 38 of file Scenario1_Basics.h.

The documentation for this struct was generated from the following files:
  • LampArray/cppwinrt/Scenario1_Basics.h
  • LampArray/cppwinrt/Scenario1_Basics.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Check Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Check
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Check Struct Reference

#include "Scenario1_Check.h"

List of all members.

Public Member Functions

Scenario1_Check ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | StreamLocationButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | OnCapabilityAccessChanged (Windows::Security::Authorization::AppCapabilityAccess::AppCapability const &, Windows::Foundation::IInspectable const &)
Windows::Foundation::IAsyncAction | StreamLocationAsync ()
void | UpdateCapabilityStatus ()

Private Attributes

event_token | accessChangedToken

Detailed Description

Definition at line 18 of file Scenario1_Check.h.

Constructor & Destructor Documentation

Scenario1_Check ( )

Definition at line 28 of file Scenario1_Check.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnCapabilityAccessChanged | ( | Windows::Security::Authorization::AppCapabilityAccess::AppCapability const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
IAsyncAction StreamLocationAsync ( ) [private]

Definition at line 90 of file Scenario1_Check.cpp.

    {
        auto lifetime = get_strong();

        if (co_await Geolocator::RequestAccessAsync() == GeolocationAccessStatus::Allowed)
        {
            // Need try/catch because we can lose geolocator access at any time.
            try
            {
                // Specify a message to explain to the user why we are tracking their location.
                locationCapability.DisplayMessage(winrt::hstring(L"Streaming location"));

                LocationTextBlock().Text(L"Finding your current location...");
                Geolocator geolocator;

                for (int i = 0; i < 4; i++)
                {
                    Geoposition pos = co_await geolocator.GetGeopositionAsync();

                    if (pos == nullptr)
                    {
                        LocationTextBlock().Text(L"Current location unknown.");
                    }
                    else
                    {
                        std::wostringstream output;
                        output << L"Your location is: Latitude " << pos.Coordinate().Point().Position().Latitude <<
                            L", Longitude" << pos.Coordinate().Point().Position().Longitude;
                        LocationTextBlock().Text(output.str());
                    }

                    co_await winrt::resume_after(500ms);
                    co_await resume_foreground(Dispatcher());

                    // You can change the message as your app's usage changes.
                    locationCapability.DisplayMessage(L"Tracking your current location...");
                }
            }
            catch (hresult_access_denied const&)
            {
                // Lost access in the middle of the operation.
                // AccessChanged event will trigger a recalc.
            }

            LocationTextBlock().Text(L"");

            // Even though we clear the message immediately, it will take time before the message
            // disappear from the system. The system has a minimum display time for the message,
            // so that users can observe brief usage.
            locationCapability.DisplayMessage(L"");
        }
        else
        {
            // Lost access before operation started.
            // AccessChanged event will trigger a recalc.
        }
    }

fire_and_forget StreamLocationButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateCapabilityStatus ( ) [private]

Definition at line 148 of file Scenario1_Check.cpp.

    {
        auto lifetime = get_strong();

        AppCapabilityAccessStatus status = locationCapability.CheckAccess();
        if (status == AppCapabilityAccessStatus::Allowed)
        {
            LocationAccessBlock().Visibility(Visibility::Collapsed);
            LocationTextBlock().Visibility(Visibility::Visible);
        }
        else
        {
            LocationTextBlock().Visibility(Visibility::Collapsed);

            switch (status)
            {
            case AppCapabilityAccessStatus::NotDeclaredByApp:
                // The app neglected to declare the capability in its manifest.
                // This is a developer error.
                LocationAccessBlock().Text(L"App misconfiguration error. Contact vendor for support.");
                LocationAccessBlock().Visibility(Visibility::Visible);
                break;

            default:
            case AppCapabilityAccessStatus::DeniedBySystem:
                // We can send the user to the Settings page to obtain access
                // or at least explain why access is denied.
                LocationAccessBlock().Text(L"The system has blocked access to location.");
                LocationAccessBlock().Visibility(Visibility::Visible);
                break;

            case AppCapabilityAccessStatus::DeniedByUser:
                // We can send the user to the Settings page to obtain access.
                LocationAccessBlock().Text(L"You must enable location access in Settings.");
                LocationAccessBlock().Visibility(Visibility::Visible);
                break;

            case AppCapabilityAccessStatus::UserPromptRequired:
                // We can prompt the user to give us access.
                LocationAccessBlock().Visibility(Visibility::Collapsed);
                break;
            }
        }
    }

Member Data Documentation

event_token accessChangedToken [private]

Definition at line 28 of file Scenario1_Check.h.

The documentation for this struct was generated from the following files:
  • Capabilities/cppwinrt/Scenario1_Check.h
  • Capabilities/cppwinrt/Scenario1_Check.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_CheckConsentAvailability Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_CheckConsentAvailability
Public Member Functions

Scenario1_CheckConsentAvailability Struct Reference

#include "Scenario1_CheckConsentAvailability.h"

List of all members.

Public Member Functions

Scenario1_CheckConsentAvailability ()
fire_and_forget CheckAvailability_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_CheckConsentAvailability.h.

Constructor & Destructor Documentation

Scenario1_CheckConsentAvailability ( )

Definition at line 23 of file Scenario1_CheckConsentAvailability.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CheckAvailability_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.h
  • UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Colors Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Colors
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Colors Struct Reference

#include "Scenario1_Colors.h"

List of all members.

Public Member Functions

Scenario1_Colors ()
void | PropertyChanged (event_token const &token) noexcept
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
Windows::UI::ViewManagement::ApplicationViewTitleBar | TitleBar ()
void | UseCustomColors_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | UpdateColors ()

Private Attributes

event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged

Detailed Description

Definition at line 25 of file Scenario1_Colors.h.

Constructor & Destructor Documentation

Scenario1_Colors ( )

Definition at line 25 of file Scenario1_Colors.cpp.

    {
        InitializeComponent();

        titleBar = ApplicationView::GetForCurrentView().TitleBar();

        // Infer the radio button selection from the title bar colors.
        if (titleBar.ButtonBackgroundColor() == nullptr)
        {
            UseStandardColors().IsChecked(true);
        }
        else if (titleBar.ButtonBackgroundColor().Value().A > 0)
        {
            UseCustomColors().IsChecked(true);
        }
        else
        {
            TransparentWhenExtended().IsChecked(true);
        }

    }

Member Function Documentation

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler )
void PropertyChanged ( event_token const & token )

Definition at line 103 of file Scenario1_Colors.cpp.

    {
        m_propertyChanged.remove(token);
    }

Windows::UI::ViewManagement::ApplicationViewTitleBar TitleBar ( ) [inline]

Definition at line 29 of file Scenario1_Colors.h.

        {
            return titleBar;
        }

void UpdateColors ( ) [private]

Definition at line 52 of file Scenario1_Colors.cpp.

    {
        if (UseStandardColors().IsChecked().Value())
        {
            // Setting colors to null returns them to system defaults.
            titleBar.BackgroundColor(nullptr);
            titleBar.ForegroundColor(nullptr);
            titleBar.InactiveBackgroundColor(nullptr);
            titleBar.InactiveForegroundColor(nullptr);

            titleBar.ButtonBackgroundColor(nullptr);
            titleBar.ButtonHoverBackgroundColor(nullptr);
            titleBar.ButtonPressedBackgroundColor(nullptr);
            titleBar.ButtonInactiveBackgroundColor(nullptr);

            titleBar.ButtonForegroundColor(nullptr);
            titleBar.ButtonHoverForegroundColor(nullptr);
            titleBar.ButtonPressedForegroundColor(nullptr);
            titleBar.ButtonInactiveForegroundColor(nullptr);
        }
        else
        {
            // Title bar colors. Alpha must be 255.
            titleBar.BackgroundColor(ColorHelper::FromArgb(255, 54, 60, 116));
            titleBar.ForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
            titleBar.InactiveBackgroundColor(ColorHelper::FromArgb(255, 135, 141, 199));
            titleBar.InactiveForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));

            // Title bar button background colors. Alpha is respected when the view is extended
            // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
            uint8_t buttonAlpha = (uint8_t)(TransparentWhenExtended().IsChecked().Value() ? 0 : 255);
            titleBar.ButtonBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 54, 60, 116));
            titleBar.ButtonHoverBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 19, 21, 40));
            titleBar.ButtonPressedBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 232, 211, 162));
            titleBar.ButtonInactiveBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 135, 141, 199));

            // Title bar button foreground colors. Alpha must be 255.
            titleBar.ButtonForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
            titleBar.ButtonHoverForegroundColor(ColorHelper::FromArgb(255, 255, 255, 255));
            titleBar.ButtonPressedForegroundColor(ColorHelper::FromArgb(255, 54, 60, 116));
            titleBar.ButtonInactiveForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
        }

        m_propertyChanged(*this, PropertyChangedEventArgs(L"TitleBar"));
    }

void UseCustomColors_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 40 of file Scenario1_Colors.h.

The documentation for this struct was generated from the following files:
  • TitleBar/cppwinrt/Scenario1_Colors.h
  • TitleBar/cppwinrt/Scenario1_Colors.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Configure Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Configure
Public Member Functions

Scenario1_Configure Struct Reference

#include "Scenario1_Configure.h"

List of all members.

Public Member Functions

Scenario1_Configure ()
fire_and_forget | OpenAppSettings (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | OpenLockscreenSettings (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_Configure.h.

Constructor & Destructor Documentation

Scenario1_Configure ( )

Definition at line 23 of file Scenario1_Configure.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OpenAppSettings | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget OpenLockscreenSettings | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LockScreenApps/cppwinrt/Scenario1_Configure.h
  • LockScreenApps/cppwinrt/Scenario1_Configure.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ConfigureMobileHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ConfigureMobileHotspot
Public Member Functions | Private Member Functions

Scenario1_ConfigureMobileHotspot Struct Reference

#include "Scenario1_ConfigureMobileHotspot.h"

List of all members.

Public Member Functions

Scenario1_ConfigureMobileHotspot ()
fire_and_forget | ApplyChanges_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DiscardChanges_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

void | AddComboBoxItem (Windows::UI::Xaml::Controls::ComboBox const &comboBox, hstring name, Windows::Foundation::IInspectable const &tag, bool selected)
template<typename T >
void | AddComboBoxItem (Windows::UI::Xaml::Controls::ComboBox const &comboBox, T value, bool selected)
void | InitializeTetheringControls ()

Detailed Description

Definition at line 18 of file Scenario1_ConfigureMobileHotspot.h.

Constructor & Destructor Documentation

Scenario1_ConfigureMobileHotspot ( )

Definition at line 27 of file Scenario1_ConfigureMobileHotspot.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AddComboBoxItem | ( | Windows::UI::Xaml::Controls::ComboBox const & | comboBox,
 |  | hstring | name,
 |  | Windows::Foundation::IInspectable const & | tag,
 |  | bool | selected |
 | ) |  |  | [private]
void AddComboBoxItem | ( | Windows::UI::Xaml::Controls::ComboBox const & | comboBox,
 |  | T | value,
 |  | bool | selected |
 | ) |  |  | [inline, private]

Definition at line 35 of file Scenario1_ConfigureMobileHotspot.h.

        {
            AddComboBoxItem(comboBox, SDKTemplate::GetFriendlyName(value), box_value(value), selected);
        }

fire_and_forget ApplyChanges_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DiscardChanges_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void InitializeTetheringControls ( ) [private]

Definition at line 55 of file Scenario1_ConfigureMobileHotspot.cpp.

    {
        NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();

        SsidTextBox().Text(configuration.Ssid());
        PassphraseTextBox().Text(configuration.Passphrase());

        // Fill the Band combo box with supported bands, and select the current one.
        TetheringWiFiBand currentBand = configuration.Band();
        BandComboBox().Items().Clear();
        for (TetheringWiFiBand band = TetheringWiFiBand::Auto; band <= TetheringWiFiBand::FiveGigahertz; band = (TetheringWiFiBand)((int)band + 1))
        {
            if (SDKTemplate::IsBandSupported(configuration, band))
            {
                AddComboBoxItem(BandComboBox(), band, band == currentBand);
            }
        }
        if (BandComboBox().SelectedIndex() == -1)
        {
            AddComboBoxItem(BandComboBox(), currentBand, true);
        }
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.h
  • MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Data Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Data
Public Member Functions

Scenario1_Data Struct Reference

#include "Scenario1_Data.h"

List of all members.

Public Member Functions

Scenario1_Data ()
void ShowResults_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario1_Data.h.

Constructor & Destructor Documentation

Scenario1_Data ( )

Definition at line 35 of file Scenario1_Data.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Calendar/cppwinrt/Scenario1_Data.h
  • Calendar/cppwinrt/Scenario1_Data.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DataEvents Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_DataEvents
Public Member Functions | Private Member Functions

Scenario1_DataEvents Struct Reference

#include "Scenario1_DataEvents.h"

List of all members.

Public Member Functions

Scenario1_DataEvents ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ScenarioGetSensor_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | ReadingChanged (Windows::Devices::Sensors::HumanPresenceSensor const &, Windows::Devices::Sensors::HumanPresenceSensorReadingChangedEventArgs e)

Detailed Description

Definition at line 19 of file Scenario1_DataEvents.h.

Constructor & Destructor Documentation

Scenario1_DataEvents ( )

Definition at line 27 of file Scenario1_DataEvents.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget ReadingChanged | ( | Windows::Devices::Sensors::HumanPresenceSensor const & | ,
 |  | Windows::Devices::Sensors::HumanPresenceSensorReadingChangedEventArgs | e |
 | ) |  |  | [private]
fire_and_forget ScenarioGetSensor_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PresenceSensor/cppwinrt/Scenario1_DataEvents.h
  • PresenceSensor/cppwinrt/Scenario1_DataEvents.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DetectInPhoto Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_DetectInPhoto
Public Member Functions | Private Member Functions | Static Private Attributes

Scenario1_DetectInPhoto Struct Reference

#include "Scenario1_DetectInPhoto.h"

List of all members.

Public Member Functions

Scenario1_DetectInPhoto ()
fire_and_forget | OpenFile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | PhotoCanvas_SizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e)

Private Member Functions

void | ClearVisualization ()
Windows::Graphics::Imaging::BitmapTransform | ComputeScalingTransformForSourceImage (Windows::Graphics::Imaging::BitmapDecoder const &sourceDecoder)
void | SetupVisualization (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces)

Static Private Attributes

static constexpr uint32_t | sourceImageHeightLimit = 1280

Detailed Description

Definition at line 19 of file Scenario1_DetectInPhoto.h.

Constructor & Destructor Documentation

Scenario1_DetectInPhoto ( )

Definition at line 31 of file Scenario1_DetectInPhoto.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ClearVisualization ( ) [private]

Definition at line 51 of file Scenario1_DetectInPhoto.cpp.

    {
        PhotoCanvas().Background(nullptr);
        PhotoCanvas().Children().Clear();
        rootPage.NotifyUser(L"", NotifyType::StatusMessage);
    }

Windows::Graphics::Imaging::BitmapTransform ComputeScalingTransformForSourceImage ( Windows::Graphics::Imaging::BitmapDecoder const & sourceDecoder ) [private]
fire_and_forget OpenFile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void PhotoCanvas_SizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::SizeChangedEventArgs const & | e
 | ) |  |
void SetupVisualization | ( | Windows::UI::Xaml::Media::Imaging::WriteableBitmap const & | displaySource,
 |  | Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const & | foundFaces |
 | ) |  |  | [private]

Member Data Documentation

constexpr uint32_t sourceImageHeightLimit = 1280 [static, private]

Definition at line 35 of file Scenario1_DetectInPhoto.h.

The documentation for this struct was generated from the following files:
  • BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.h
  • BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_DevicePicker Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_DevicePicker
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_DevicePicker Struct Reference

#include "Scenario1_DevicePicker.h"

List of all members.

Public Member Functions

Scenario1_DevicePicker ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | PickSingleDeviceButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ShowDevicePickerButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | OnDevicePickerDismissed (Windows::Devices::Enumeration::DevicePicker const &, IInspectable const &)
fire_and_forget | OnDeviceSelected (Windows::Devices::Enumeration::DevicePicker const &, Windows::Devices::Enumeration::DeviceSelectedEventArgs args)
fire_and_forget | ShowDevicePicker (bool pickSingle)

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 19 of file Scenario1_DevicePicker.h.

Constructor & Destructor Documentation

Scenario1_DevicePicker ( )

Definition at line 27 of file Scenario1_DevicePicker.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnDevicePickerDismissed | ( | Windows::Devices::Enumeration::DevicePicker const & | ,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget OnDeviceSelected | ( | Windows::Devices::Enumeration::DevicePicker const & | ,
 |  | Windows::Devices::Enumeration::DeviceSelectedEventArgs | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void PickSingleDeviceButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ShowDevicePicker ( bool pickSingle ) [private]

Definition at line 59 of file Scenario1_DevicePicker.cpp.

    {
        auto lifetime = get_strong();

        showDevicePickerButton().IsEnabled(false);
        resultCollection.Clear();

        devicePicker = DevicePicker();

        // First get the device selector chosen by the UI.
        IInspectable item = selectorComboBox().SelectedItem();
        DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(item);

        if (deviceSelectorInfo->Selector().empty())
        {
            // If the a pre-canned device class selector was chosen, call the DeviceClass overload
            devicePicker.Filter().SupportedDeviceClasses().Append(deviceSelectorInfo->DeviceClassSelector());
        }
        else
        {
            // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
            devicePicker.Filter().SupportedDeviceSelectors().Append(deviceSelectorInfo->Selector());
        }

        rootPage.NotifyUser(L"Showing Device Picker", NotifyType::StatusMessage);

        // Calculate the position to show the picker (right below the buttons)
        GeneralTransform ge = pickSingleDeviceButton().TransformToVisual(nullptr);
        Point point = ge.TransformPoint({ 0, 0 });
        Rect rect{ point,
                        { static_cast<float>(pickSingleDeviceButton().ActualWidth()),
                          static_cast<float>(pickSingleDeviceButton().ActualHeight()) }
        };

        if (pickSingle)
        {
            DeviceInformation di = co_await devicePicker.PickSingleDeviceAsync(rect);
            if (nullptr != di)
            {
                resultCollection.Append(make<DeviceInformationDisplay>(di));
            }
            showDevicePickerButton().IsEnabled(true);
        }
        else
        {
            devicePicker.DevicePickerDismissed({ get_weak(), &Scenario1_DevicePicker::OnDevicePickerDismissed });
            devicePicker.DeviceSelected({ get_weak(), &Scenario1_DevicePicker::OnDeviceSelected });

            // Show the picker
            devicePicker.Show(rect);
        }
    }

void ShowDevicePickerButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 32 of file Scenario1_DevicePicker.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.cpp
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Discovery Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Discovery
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_Discovery Struct Reference

#include "Scenario1_Discovery.h"

List of all members.

Public Member Functions

Scenario1_Discovery ()
void | EnumerateButton_Click ()
Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > 		KnownDevices ()
bool | Not (bool value)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | PairButton_Click ()

Private Member Functions

fire_and_forget | DeviceWatcher_Added (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformation deviceInfo)
fire_and_forget | DeviceWatcher_EnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Foundation::IInspectable const &)
fire_and_forget | DeviceWatcher_Removed (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
fire_and_forget | DeviceWatcher_Stopped (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Foundation::IInspectable const &)
fire_and_forget | DeviceWatcher_Updated (Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
std::tuple
< SDKTemplate::BluetoothLEDeviceDisplay,
uint32_t > 		FindBluetoothLEDeviceDisplay (hstring const &id)
std::vector
< Windows::Devices::Enumeration::DeviceInformation >
::iterator 		FindUnknownDevices (hstring const &id)
void | StartBleDeviceWatcher ()
void | StopBleDeviceWatcher ()

Private Attributes

event_token | deviceWatcherAddedToken
event_token | deviceWatcherEnumerationCompletedToken
event_token | deviceWatcherRemovedToken
event_token | deviceWatcherStoppedToken
event_token | deviceWatcherUpdatedToken
Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > 		m_knownDevices = single_threaded_observable_vector<Windows::Foundation::IInspectable>()
std::vector
< Windows::Devices::Enumeration::DeviceInformation > 		UnknownDevices

Detailed Description

Definition at line 19 of file Scenario1_Discovery.h.

Constructor & Destructor Documentation

Scenario1_Discovery ( )

Definition at line 66 of file Scenario1_Discovery.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget DeviceWatcher_Added | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformation | deviceInfo |
 | ) |  |  | [private]
fire_and_forget DeviceWatcher_EnumerationCompleted | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget DeviceWatcher_Removed | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
fire_and_forget DeviceWatcher_Stopped | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget DeviceWatcher_Updated | ( | Windows::Devices::Enumeration::DeviceWatcher | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
void EnumerateButton_Click ( )

Definition at line 84 of file Scenario1_Discovery.cpp.

    {
        if (deviceWatcher == nullptr)
        {
            StartBleDeviceWatcher();
            EnumerateButton().Content(box_value(L"Stop enumerating"));
            rootPage.NotifyUser(L"Device watcher started.", NotifyType::StatusMessage);
        }
        else
        {
            StopBleDeviceWatcher();
            EnumerateButton().Content(box_value(L"Start enumerating"));
            rootPage.NotifyUser(L"Device watcher stopped.", NotifyType::StatusMessage);
        }
    }

std::tuple< SDKTemplate::BluetoothLEDeviceDisplay, uint32_t > FindBluetoothLEDeviceDisplay ( hstring const & id ) [private]

Definition at line 159 of file Scenario1_Discovery.cpp.

    {
        uint32_t size = m_knownDevices.Size();
        for (uint32_t index = 0; index < size; index++)
        {
            auto bleDeviceDisplay = m_knownDevices.GetAt(index).as<SDKTemplate::BluetoothLEDeviceDisplay>();
            if (bleDeviceDisplay.Id() == id)
            {
                return { bleDeviceDisplay, index };
            }
        }
        return { nullptr, 0-1U };
    }

std::vector< Windows::Devices::Enumeration::DeviceInformation >::iterator FindUnknownDevices ( hstring const & id ) [private]

Definition at line 173 of file Scenario1_Discovery.cpp.

    {
        return std::find_if(UnknownDevices.begin(), UnknownDevices.end(), [&](auto&& bleDeviceInfo)
        {
            return bleDeviceInfo.Id() == id;
        });
    }

Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> KnownDevices ( ) [inline]

Definition at line 25 of file Scenario1_Discovery.h.

        {
            return m_knownDevices;
        }

bool Not ( bool value ) [inline]

Definition at line 32 of file Scenario1_Discovery.h.

{ return !value; }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget PairButton_Click ( )

Definition at line 298 of file Scenario1_Discovery.cpp.

    {
        auto lifetime = get_strong();
        EnumerateButton().IsEnabled(false);

        rootPage.NotifyUser(L"Pairing started. Please wait...", NotifyType::StatusMessage);

        // For more information about device pairing, including examples of
        // customizing the pairing process, see the DeviceEnumerationAndPairing sample.

        // Capture the current selected item in case the user changes it while we are pairing.
        auto bleDeviceDisplay = ResultsListView().SelectedItem().as<SDKTemplate::BluetoothLEDeviceDisplay>();

        // BT_Code: Pair the currently selected device.
        DevicePairingResult result = co_await bleDeviceDisplay.DeviceInformation().Pairing().PairAsync();
        DevicePairingResultStatus status = result.Status();
        rootPage.NotifyUser(L"Pairing result = " + to_hstring(status),
            status == DevicePairingResultStatus::Paired || status == DevicePairingResultStatus::AlreadyPaired
            ? NotifyType::StatusMessage
            : NotifyType::ErrorMessage);

        EnumerateButton().IsEnabled(true);
    }

void StartBleDeviceWatcher ( ) [private]

Starts a device watcher that looks for all nearby Bluetooth devices (paired or unpaired).

Attaches event handlers to populate the device collection.

Definition at line 106 of file Scenario1_Discovery.cpp.

    {
        // Additional properties we would like about the device.
        // Property strings are documented here https://msdn.microsoft.com/en-us/library/windows/desktop/ff521659(v=vs.85).aspx
        auto requestedProperties = single_threaded_vector<hstring>({ L"System.Devices.Aep.DeviceAddress", L"System.Devices.Aep.IsConnected", L"System.Devices.Aep.Bluetooth.Le.IsConnectable" });

        // BT_Code: Example showing paired and non-paired in a single query.
        hstring aqsAllBluetoothLEDevices = L"(System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\")";

        deviceWatcher =
            Windows::Devices::Enumeration::DeviceInformation::CreateWatcher(
                aqsAllBluetoothLEDevices,
                requestedProperties,
                DeviceInformationKind::AssociationEndpoint);

        // Register event handlers before starting the watcher.
        deviceWatcherAddedToken = deviceWatcher.Added({ get_weak(), &Scenario1_Discovery::DeviceWatcher_Added });
        deviceWatcherUpdatedToken = deviceWatcher.Updated({ get_weak(), &Scenario1_Discovery::DeviceWatcher_Updated });
        deviceWatcherRemovedToken = deviceWatcher.Removed({ get_weak(), &Scenario1_Discovery::DeviceWatcher_Removed });
        deviceWatcherEnumerationCompletedToken = deviceWatcher.EnumerationCompleted({ get_weak(), &Scenario1_Discovery::DeviceWatcher_EnumerationCompleted });
        deviceWatcherStoppedToken = deviceWatcher.Stopped({ get_weak(), &Scenario1_Discovery::DeviceWatcher_Stopped });

        // Start over with an empty collection.
        m_knownDevices.Clear();

        // Start the watcher. Active enumeration is limited to approximately 30 seconds.
        // This limits power usage and reduces interference with other Bluetooth activities.
        // To monitor for the presence of Bluetooth LE devices for an extended period,
        // use the BluetoothLEAdvertisementWatcher runtime class. See the BluetoothAdvertisement
        // sample for an example.
        deviceWatcher.Start();
    }

void StopBleDeviceWatcher ( ) [private]

Stops watching for all nearby Bluetooth devices.

Definition at line 142 of file Scenario1_Discovery.cpp.

    {
        if (deviceWatcher != nullptr)
        {
            // Unregister the event handlers.
            deviceWatcher.Added(deviceWatcherAddedToken);
            deviceWatcher.Updated(deviceWatcherUpdatedToken);
            deviceWatcher.Removed(deviceWatcherRemovedToken);
            deviceWatcher.EnumerationCompleted(deviceWatcherEnumerationCompletedToken);
            deviceWatcher.Stopped(deviceWatcherStoppedToken);

            // Stop the watcher.
            deviceWatcher.Stop();
            deviceWatcher = nullptr;
        }
    }

Member Data Documentation

event_token deviceWatcherAddedToken [private]

Definition at line 38 of file Scenario1_Discovery.h.

event_token deviceWatcherEnumerationCompletedToken [private]

Definition at line 42 of file Scenario1_Discovery.h.

event_token deviceWatcherRemovedToken [private]

Definition at line 41 of file Scenario1_Discovery.h.

event_token deviceWatcherStoppedToken [private]

Definition at line 43 of file Scenario1_Discovery.h.

event_token deviceWatcherUpdatedToken [private]

Definition at line 40 of file Scenario1_Discovery.h.

Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> m_knownDevices = single_threaded_observable_vector<Windows::Foundation::IInspectable>() [private]

Definition at line 36 of file Scenario1_Discovery.h.

std::vector<Windows::Devices::Enumeration::DeviceInformation> UnknownDevices [private]

Definition at line 37 of file Scenario1_Discovery.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/Scenario1_Discovery.h
  • BluetoothLE/cppwinrt/Scenario1_Discovery.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Enable Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Enable
Public Member Functions

Scenario1_Enable Struct Reference

#include "Scenario1_Enable.h"

List of all members.

Public Member Functions

Scenario1_Enable ()

Detailed Description

Definition at line 18 of file Scenario1_Enable.h.

Constructor & Destructor Documentation

Scenario1_Enable ( )

Definition at line 15 of file Scenario1_Enable.cpp.

{
    Scenario1_Enable::Scenario1_Enable()

The documentation for this struct was generated from the following files:
  • DisablingScreenCapture/cppwinrt/Scenario1_Enable.h
  • DisablingScreenCapture/cppwinrt/Scenario1_Enable.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ExtractTextSegments Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ExtractTextSegments
Public Member Functions

Scenario1_ExtractTextSegments Struct Reference

#include "Scenario1_ExtractTextSegments.h"

List of all members.

Public Member Functions

Scenario1_ExtractTextSegments ()
void | SelectionSegmentsButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | WordSegmentsButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_ExtractTextSegments.h.

Constructor & Destructor Documentation

Scenario1_ExtractTextSegments ( )

Definition at line 22 of file Scenario1_ExtractTextSegments.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void SelectionSegmentsButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void WordSegmentsButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.h
  • TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Files Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Files
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario1_Files Struct Reference

#include "Scenario1_Files.h"

List of all members.

Public Member Functions

Scenario1_Files ()
Scenario1_Files ()
fire_and_forget | ChooseFile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ChooseFolder_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DisplayOutput ()
fire_and_forget | Increment_Local_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | Increment_LocalCache_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | Increment_Temporary_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ProtectL1_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ProtectL2_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | Unprotect_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | Read_Local_Counter ()
fire_and_forget | Read_LocalCache_Counter ()
fire_and_forget | Read_Temporary_Counter ()
void | ReportStatus (winrt::hstring const &operation, winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionStatus status)
void | UpdateItem (winrt::Windows::Storage::IStorageItem const &item)

Private Attributes

int | localCacheCounter = 0
Windows::Storage::StorageFolder | localCacheFolder = Windows::Storage::ApplicationData::Current().LocalCacheFolder()
int | localCounter = 0
Windows::Storage::StorageFolder | localFolder = Windows::Storage::ApplicationData::Current().LocalFolder()
int | temporaryCounter = 0
Windows::Storage::StorageFolder | temporaryFolder = Windows::Storage::ApplicationData::Current().TemporaryFolder()

Static Private Attributes

static const auto | filename = "sampleFile.txt"

Detailed Description

Definition at line 19 of file Scenario1_Files.h.

Constructor & Destructor Documentation

Scenario1_Files ( )

Definition at line 24 of file Scenario1_Files.cpp.

    {
        InitializeComponent();
    }

Scenario1_Files ( )

Member Function Documentation

fire_and_forget ChooseFile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ChooseFolder_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void DisplayOutput ( )

Definition at line 138 of file Scenario1_Files.cpp.

    {
        Read_Local_Counter();
        Read_LocalCache_Counter();
        Read_Temporary_Counter();
    }

fire_and_forget Increment_Local_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget Increment_LocalCache_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget Increment_Temporary_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget ProtectL1_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ProtectL2_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget Read_Local_Counter ( ) [private]

Definition at line 61 of file Scenario1_Files.cpp.

    {
        auto strong = get_strong();

        StorageFile file = (co_await localFolder.TryGetItemAsync(filename)).as<StorageFile>();
        if (file != nullptr)
        {
            hstring text = co_await FileIO::ReadTextAsync(file);

            LocalOutputTextBlock().Text(L"Local Counter: " + text);

            localCounter = wcstol(text.c_str(), nullptr, 10);
        }
        else
        {
            LocalOutputTextBlock().Text(L"Local Counter: <not found>");
        }
    }

fire_and_forget Read_LocalCache_Counter ( ) [private]

Definition at line 91 of file Scenario1_Files.cpp.

    {
        auto strong = get_strong();

        StorageFile file = (co_await localCacheFolder.TryGetItemAsync(filename)).as<StorageFile>();
        if (file != nullptr)
        {
            hstring text = co_await FileIO::ReadTextAsync(file);

            LocalCacheOutputTextBlock().Text(L"LocalCache Counter: " + text);

            localCacheCounter = wcstol(text.c_str(), nullptr, 10);
        }
        else
        {
            LocalCacheOutputTextBlock().Text(L"LocalCache Counter: <not found>");
        }
    }

fire_and_forget Read_Temporary_Counter ( ) [private]

Definition at line 121 of file Scenario1_Files.cpp.

    {
        StorageFile file = (co_await temporaryFolder.TryGetItemAsync(filename)).as<StorageFile>();
        if (file != nullptr)
        {
            hstring text = co_await FileIO::ReadTextAsync(file);

            TemporaryOutputTextBlock().Text(L"Temporary Counter: " + text);

            temporaryCounter = wcstol(text.c_str(), nullptr, 10);
        }
        else
        {
            TemporaryOutputTextBlock().Text(L"Temporary Counter: <not found>");
        }
    }

void ReportStatus | ( | winrt::hstring const & | operation,
 |  | winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionStatus | status |
 | ) |  |  | [private]
fire_and_forget Unprotect_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateItem ( winrt::Windows::Storage::IStorageItem const & item ) [private]

Member Data Documentation

const auto filename = "sampleFile.txt" [inline, static, private]

Definition at line 43 of file Scenario1_Files.h.

int localCacheCounter = 0 [private]

Definition at line 39 of file Scenario1_Files.h.

Windows::Storage::StorageFolder localCacheFolder = Windows::Storage::ApplicationData::Current().LocalCacheFolder() [private]

Definition at line 38 of file Scenario1_Files.h.

int localCounter = 0 [private]

Definition at line 37 of file Scenario1_Files.h.

Windows::Storage::StorageFolder localFolder = Windows::Storage::ApplicationData::Current().LocalFolder() [private]

Definition at line 36 of file Scenario1_Files.h.

int temporaryCounter = 0 [private]

Definition at line 41 of file Scenario1_Files.h.

Windows::Storage::StorageFolder temporaryFolder = Windows::Storage::ApplicationData::Current().TemporaryFolder() [private]

Definition at line 40 of file Scenario1_Files.h.

The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario1_Files.h
  • PersonalDataEncryption/cppwinrt/Scenario1_Files.h
  • ApplicationData/cppwinrt/Scenario1_Files.cpp
  • PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindId Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_FindId
Public Member Functions

Scenario1_FindId Struct Reference

#include "Scenario1_FindId.h"

List of all members.

Public Member Functions

Scenario1_FindId ()
void Default_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_FindId.h.

Constructor & Destructor Documentation

Scenario1_FindId ( )

Definition at line 100 of file Scenario1_FindId.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Default_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • Unicode/cppwinrt/Scenario1_FindId.h
  • Unicode/cppwinrt/Scenario1_FindId.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_FindUsers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_FindUsers
Public Member Functions

Scenario1_FindUsers Struct Reference

#include "Scenario1_FindUsers.h"

List of all members.

Public Member Functions

Scenario1_FindUsers ()
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ShowProperties ()

Detailed Description

Definition at line 18 of file Scenario1_FindUsers.h.

Constructor & Destructor Documentation

Scenario1_FindUsers ( )

Definition at line 27 of file Scenario1_FindUsers.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )

Definition at line 32 of file Scenario1_FindUsers.cpp.

    {
        auto lifetime = get_strong();

        auto users = co_await Helpers::GetUserViewModelsAsync();
        UserList().DataContext(users);
        if (users.Size() > 0)
        {
            UserList().SelectedIndex(0);
        }
    }

fire_and_forget ShowProperties ( )

Definition at line 44 of file Scenario1_FindUsers.cpp.

    {
        auto lifetime = get_strong();

        auto selectedUser = UserList().SelectedValue().as<SDKTemplate::UserViewModel>();
        if (selectedUser != nullptr)
        {
            ResultsText().Text(L"");
            ProfileImage().Source(nullptr);
            rootPage.NotifyUser(L"", NotifyType::StatusMessage);
            try
            {
                User user = User::GetFromId(selectedUser.UserId());

                // Start with some fixed properties.
                hstring result = L"NonRoamableId: " + user.NonRoamableId ()+ L"\n"
                + L"Type: " + to_hstring(user.Type()) + L"\n";
                + L"AuthenticationStatus: " + to_hstring(user.AuthenticationStatus()) + L"\n";

                // Build a list of all the properties we want.
                IVector<hstring> desiredProperties = single_threaded_vector<hstring>(
                {
                    KnownUserProperties::FirstName(),
                    KnownUserProperties::LastName(),
                    KnownUserProperties::ProviderName(),
                    KnownUserProperties::AccountName(),
                    KnownUserProperties::GuestHost(),
                    KnownUserProperties::PrincipalName(),
                    KnownUserProperties::DomainName(),
                    KnownUserProperties::SessionInitiationProtocolUri(),
                });
                // Issue a bulk query for all of the properties.
                IPropertySet values = co_await user.GetPropertiesAsync(desiredProperties.GetView());

                // Add those properties to our results.
                for (auto property : desiredProperties)
                {
                    result = result + property + L": " + values.Lookup(property).as<hstring>() + L"\n";
                }
                ResultsText().Text(result);

                // Get the user's picture.
                IRandomAccessStreamReference streamReference = co_await user.GetPictureAsync(UserPictureSize::Size64x64);
                if (streamReference != nullptr)
                {
                    IRandomAccessStream stream = co_await streamReference.OpenReadAsync();
                    BitmapImage bitmapImage;
                    bitmapImage.SetSource(stream);
                    ProfileImage().Source(bitmapImage);
                }
            }
            catch (hresult_error const& ex)
            {
                rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            }
        }
    }

The documentation for this struct was generated from the following files:
  • UserInfo/cppwinrt/Scenario1_FindUsers.h
  • UserInfo/cppwinrt/Scenario1_FindUsers.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_GetAndSetPin Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_GetAndSetPin
Public Member Functions | Private Member Functions | Static Private Attributes

Scenario1_GetAndSetPin Struct Reference

#include "Scenario1_GetAndSetPin.h"

List of all members.

Public Member Functions

Scenario1_GetAndSetPin ()
void | GetPinValue_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | SetPinHigh_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SetPinLow_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StartStopScenario_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | StartScenario ()
void | StopScenario ()

Static Private Attributes

static constexpr int | LED_PIN = 5

Detailed Description

Definition at line 18 of file Scenario1_GetAndSetPin.h.

Constructor & Destructor Documentation

Scenario1_GetAndSetPin ( )

Definition at line 24 of file Scenario1_GetAndSetPin.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void GetPinValue_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Definition at line 29 of file Scenario1_GetAndSetPin.cpp.

    {
        StopScenario();
    }

void SetPinHigh_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SetPinLow_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StartScenario ( ) [private]

Definition at line 34 of file Scenario1_GetAndSetPin.cpp.

    {
        GpioController gpio = GpioController::GetDefault();

        // Set up our GPIO pin for setting values.
        // If this next line crashes with a NullReferenceException,
        // then the problem is that there is no GPIO controller on the device.
        pin = gpio.OpenPin(LED_PIN);

        // Configure pin for output.
        pin.SetDriveMode(GpioPinDriveMode::Output);
    }

void StartStopScenario_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopScenario ( ) [private]

Definition at line 47 of file Scenario1_GetAndSetPin.cpp.

    {
        // Release the GPIO pin.
        if (pin != nullptr)
        {
            pin.Close();
            pin = nullptr;
        }
    }

Member Data Documentation

constexpr int LED_PIN = 5 [static, private]

Definition at line 30 of file Scenario1_GetAndSetPin.h.

The documentation for this struct was generated from the following files:
  • IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.h
  • IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_InkCanvasTactileFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_InkCanvasTactileFeedback
Public Member Functions

Scenario1_InkCanvasTactileFeedback Struct Reference

#include "Scenario1_InkCanvasTactileFeedback.h"

List of all members.

Public Member Functions

Scenario1_InkCanvasTactileFeedback ()
void OnSizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_InkCanvasTactileFeedback.h.

Constructor & Destructor Documentation

Scenario1_InkCanvasTactileFeedback ( )

Definition at line 22 of file Scenario1_InkCanvasTactileFeedback.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnSizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::SizeChangedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.h
  • PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LanguageDetection Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_LanguageDetection
Public Member Functions

Scenario1_LanguageDetection Struct Reference

#include "Scenario1_LanguageDetection.h"

List of all members.

Public Member Functions

Scenario1_LanguageDetection ()
void Go_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_LanguageDetection.h.

Constructor & Destructor Documentation

Scenario1_LanguageDetection ( )

Definition at line 24 of file Scenario1_LanguageDetection.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Go_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LinguisticServices/cppwinrt/Scenario1_LanguageDetection.h
  • LinguisticServices/cppwinrt/Scenario1_LanguageDetection.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launch Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Launch
Public Member Functions

Scenario1_Launch Struct Reference

#include "Scenario1_Launch.h"

List of all members.

Public Member Functions

Scenario1_Launch ()

Detailed Description

Definition at line 19 of file Scenario1_Launch.h.

Constructor & Destructor Documentation

Scenario1_Launch ( )

Definition at line 23 of file Scenario1_Launch.cpp.

    {
        InitializeComponent();
    }

The documentation for this struct was generated from the following files:
  • TouchKeyboard/cppwinrt/Scenario1_Launch.h
  • TouchKeyboard/cppwinrt/Scenario1_Launch.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Launched Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Launched
Public Member Functions

Scenario1_Launched Struct Reference

#include "Scenario1_Launched.h"

List of all members.

Public Member Functions

Scenario1_Launched ()
void OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_Launched.h.

Constructor & Destructor Documentation

Scenario1_Launched ( )

Definition at line 24 of file Scenario1_Launched.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
The documentation for this struct was generated from the following files:
  • JumpList/cppwinrt/Scenario1_Launched.h
  • JumpList/cppwinrt/Scenario1_Launched.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_LongAndShortFormats Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_LongAndShortFormats
Public Member Functions

Scenario1_LongAndShortFormats Struct Reference

#include "Scenario1_LongAndShortFormats.h"

List of all members.

Public Member Functions

Scenario1_LongAndShortFormats ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_LongAndShortFormats.h.

Constructor & Destructor Documentation

Scenario1_LongAndShortFormats ( )

Definition at line 24 of file Scenario1_LongAndShortFormats.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.h
  • DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ManageHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ManageHotspot
Public Member Functions | Private Member Functions

Scenario1_ManageHotspot Struct Reference

#include "Scenario1_ManageHotspot.h"

List of all members.

Public Member Functions

Scenario1_ManageHotspot ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | RegisterTasks_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | UnregisterTasks_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | UpdateNowButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | UpdateOnDemandButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

bool | SavePropertiesForBackgroundTask ()

Detailed Description

Definition at line 19 of file Scenario1_ManageHotspot.h.

Constructor & Destructor Documentation

Scenario1_ManageHotspot ( )

Definition at line 29 of file Scenario1_ManageHotspot.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void RegisterTasks_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
bool SavePropertiesForBackgroundTask ( ) [private]

Definition at line 126 of file Scenario1_ManageHotspot.cpp.

    {
        rootPage.NotifyUser(L"", NotifyType::StatusMessage);

        if (AvailableToggle().IsOn() && DisplayNameText().Text().empty())
        {
            rootPage.NotifyUser(L"An Available network must have a name.", NotifyType::ErrorMessage);
            return false;
        }

        if (SsidText().Text().empty())
        {
            rootPage.NotifyUser(L"You must provide an SSID for the Wi-Fi network.", NotifyType::ErrorMessage);
            return false;
        }

        if (PasswordText().Password().empty())
        {
            rootPage.NotifyUser(L"You must provide a password for the Wi-Fi network.", NotifyType::ErrorMessage);
            return false;
        }

        IPropertySet values = ApplicationData::Current().LocalSettings().Values();
        values.Insert(L"availability", box_value(AvailableToggle().IsOn()));
        values.Insert(L"displayName", box_value(DisplayNameText().Text()));
        values.Insert(L"bars", CellularBarsToggle().IsOn() ? box_value(static_cast<int>(CellularBarsSlider().Value())) : nullptr);
        values.Insert(L"battery", BatteryPercentageToggle().IsOn() ? box_value(static_cast<uint32_t>(BatteryPercentageSlider().Value())) : nullptr);
        values.Insert(L"ssid", box_value(SsidText().Text()));
        values.Insert(L"password", box_value(PasswordText().Password()));
        values.Insert(L"hotspotGuid", box_value(Constants::SampleHotspotGuid));

        return true;
    }

void UnregisterTasks_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateNowButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateOnDemandButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.h
  • OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_MoveCertificate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_MoveCertificate
Public Member Functions | Private Attributes

Scenario1_MoveCertificate Struct Reference

#include "Scenario1_MoveCertificate.h"

List of all members.

Public Member Functions

Scenario1_MoveCertificate ()
fire_and_forget | MoveAppCertificateToUserCertificateStore (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | MoveUserCertificateToAppCertificateStore (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Attributes

Windows::Security::Cryptography::Certificates::CertificateStore | appStore
Windows::Security::Cryptography::Certificates::UserCertificateStore | userStore

Detailed Description

Definition at line 18 of file Scenario1_MoveCertificate.h.

Constructor & Destructor Documentation

Scenario1_MoveCertificate ( )

Definition at line 27 of file Scenario1_MoveCertificate.cpp.

                                                         :
        appStore{ CertificateStores::GetStoreByName(StandardCertificateStoreNames::Personal()) },

Member Function Documentation

fire_and_forget MoveAppCertificateToUserCertificateStore | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget MoveUserCertificateToAppCertificateStore | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Member Data Documentation

Windows::Security::Cryptography::Certificates::CertificateStore appStore [private]

Definition at line 28 of file Scenario1_MoveCertificate.h.

Windows::Security::Cryptography::Certificates::UserCertificateStore userStore [private]

Definition at line 30 of file Scenario1_MoveCertificate.h.

The documentation for this struct was generated from the following files:
  • UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.h
  • UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_NetworkConnectivity Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_NetworkConnectivity
Public Member Functions

Scenario1_NetworkConnectivity Struct Reference

#include "Scenario1_NetworkConnectivity.h"

List of all members.

Public Member Functions

Scenario1_NetworkConnectivity ()
fire_and_forget QueryCurrentNetworkConnectivityButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 16 of file Scenario1_NetworkConnectivity.h.

Constructor & Destructor Documentation

Scenario1_NetworkConnectivity ( )

Definition at line 27 of file Scenario1_NetworkConnectivity.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget QueryCurrentNetworkConnectivityButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.h
  • NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Orientation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Orientation
Public Member Functions | Private Member Functions

Scenario1_Orientation Struct Reference

#include "Scenario1_Orientation.h"

List of all members.

Public Member Functions

Scenario1_Orientation ()
void | ApplyRotationLock_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | OnOrientationChanged (Windows::Graphics::Display::DisplayInformation const &, Windows::Foundation::IInspectable const &)
hstring | OrientationsToString (Windows::Graphics::Display::DisplayOrientations orientations)
void | UpdateContent ()

Detailed Description

Definition at line 18 of file Scenario1_Orientation.h.

Constructor & Destructor Documentation

Scenario1_Orientation ( )

Definition at line 23 of file Scenario1_Orientation.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ApplyRotationLock_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Definition at line 35 of file Scenario1_Orientation.cpp.

    {
        displayInfo.OrientationChanged(orientationChangedToken);
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Definition at line 28 of file Scenario1_Orientation.cpp.

    {
        displayInfo = DisplayInformation::GetForCurrentView();
        orientationChangedToken = displayInfo.OrientationChanged({ get_weak(), &Scenario1_Orientation::OnOrientationChanged });
        UpdateContent();
    }

void OnOrientationChanged | ( | Windows::Graphics::Display::DisplayInformation const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
hstring OrientationsToString ( Windows::Graphics::Display::DisplayOrientations orientations ) [private]
void UpdateContent ( ) [private]

Definition at line 72 of file Scenario1_Orientation.cpp.

    {
        NativeOrientationTextBlock().Text(OrientationsToString(displayInfo.NativeOrientation()));
        CurrentOrientationTextBlock().Text(OrientationsToString(displayInfo.CurrentOrientation()));
        AutoRotationPreferencesTextBlock().Text(OrientationsToString(DisplayInformation::AutoRotationPreferences()));
    }

The documentation for this struct was generated from the following files:
  • DisplayOrientation/cppwinrt/Scenario1_Orientation.h
  • DisplayOrientation/cppwinrt/Scenario1_Orientation.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ParseAndStringify Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ParseAndStringify
Public Member Functions | Private Member Functions

Scenario1_ParseAndStringify Struct Reference

#include "Scenario1_ParseAndStringify.h"

List of all members.

Public Member Functions

Scenario1_ParseAndStringify ()
void | Add_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DeleteSchool_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | Parse_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | Stringify_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

SDKTemplate::User CurrentUser ()
void | CurrentUser (SDKTemplate::User const &user)
bool | IsExceptionHandled (hresult_error const &ex)

Detailed Description

Definition at line 19 of file Scenario1_ParseAndStringify.h.

Constructor & Destructor Documentation

Scenario1_ParseAndStringify ( )

Definition at line 22 of file Scenario1_ParseAndStringify.cpp.

    {
        InitializeComponent();
        CurrentUser(SDKTemplate::User(JsonInput().Text()));
    }

Member Function Documentation

void Add_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
SDKTemplate::User CurrentUser ( ) [inline, private]

Definition at line 32 of file Scenario1_ParseAndStringify.h.

{ return DataContext().as<SDKTemplate::User>(); }

void CurrentUser ( SDKTemplate::User const & user ) [inline, private]

Definition at line 33 of file Scenario1_ParseAndStringify.h.

{ DataContext(user); }

void DeleteSchool_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
bool IsExceptionHandled ( hresult_error const & ex ) [private]

Definition at line 69 of file Scenario1_ParseAndStringify.cpp.

    {
        if (ex.code() == E_ILLEGAL_METHOD_CALL)
        {
            rootPage.NotifyUser(L"JSON did not match expected schema: " + ex.message(), NotifyType::ErrorMessage);
            return true;
        }

        hstring text;
        switch (JsonError::GetJsonStatus(ex.code()))
        {
        default:
        case JsonErrorStatus::Unknown: return false;
        case JsonErrorStatus::InvalidJsonString: text = L"Invalid JSON string"; break;
        case JsonErrorStatus::InvalidJsonNumber: text = L"Invalid JSON number"; break;
        case JsonErrorStatus::JsonValueNotFound: text = L"JSON value not found"; break;
        case JsonErrorStatus::ImplementationLimit: text = L"Implementation limit exceeded"; break;
        }

        rootPage.NotifyUser(text + L": " + ex.message(), NotifyType::ErrorMessage);
        return true;
    }

void Parse_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void Stringify_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • Json/cppwinrt/Scenario1_ParseAndStringify.h
  • Json/cppwinrt/Scenario1_ParseAndStringify.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PercentPermilleFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_PercentPermilleFormatting
Public Member Functions

Scenario1_PercentPermilleFormatting Struct Reference

#include "Scenario1_PercentPermilleFormatting.h"

List of all members.

Public Member Functions

Scenario1_PercentPermilleFormatting ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_PercentPermilleFormatting.h.

Constructor & Destructor Documentation

Scenario1_PercentPermilleFormatting ( )

Definition at line 23 of file Scenario1_PercentPermilleFormatting.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.h
  • NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_PinTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_PinTile
Public Member Functions

Scenario1_PinTile Struct Reference

#include "Scenario1_PinTile.h"

List of all members.

Public Member Functions

Scenario1_PinTile ()
fire_and_forget PinButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_PinTile.h.

Constructor & Destructor Documentation

Scenario1_PinTile ( )

Definition at line 24 of file Scenario1_PinTile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget PinButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario1_PinTile.h
  • SecondaryTiles/cppwinrt/Scenario1_PinTile.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Prefs Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Prefs
Public Member Functions

Scenario1_Prefs Struct Reference

#include "Scenario1_Prefs.h"

List of all members.

Public Member Functions

Scenario1_Prefs ()
void ShowResults_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario1_Prefs.h.

Constructor & Destructor Documentation

Scenario1_Prefs ( )

Definition at line 24 of file Scenario1_Prefs.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • GlobalizationPreferences/cppwinrt/Scenario1_Prefs.h
  • GlobalizationPreferences/cppwinrt/Scenario1_Prefs.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Print Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Print
Public Member Functions | Private Member Functions

Scenario1_Print Struct Reference

#include "Scenario1_Print.h"

List of all members.

Public Member Functions

Scenario1_Print ()
fire_and_forget | CreateFromXml_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | CreateProgrammatically_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | LoadPackageFromFile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | PrintPackage_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SavePackage_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | EnablePackageOperationButtons ()
void | OnTaskRequested (Windows::Graphics::Printing3D::Print3DManager const &sender, Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs const &args)

Detailed Description

Definition at line 19 of file Scenario1_Print.h.

Constructor & Destructor Documentation

Scenario1_Print ( )

Definition at line 366 of file Scenario1_Print.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CreateFromXml_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget CreateProgrammatically_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void EnablePackageOperationButtons ( ) [private]

Definition at line 371 of file Scenario1_Print.cpp.

    {
        SaveButton().IsEnabled(true);
        PrintButton().IsEnabled(true);
    }

fire_and_forget LoadPackageFromFile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnTaskRequested | ( | Windows::Graphics::Printing3D::Print3DManager const & | sender,
 |  | Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs const & | args |
 | ) |  |  | [private]
fire_and_forget PrintPackage_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SavePackage_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • 3DPrinting/cppwinrt/Scenario1_Print.h
  • 3DPrinting/cppwinrt/Scenario1_Print.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ProvisionTPM Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ProvisionTPM
Public Member Functions | Private Member Functions | Private Attributes

Scenario1_ProvisionTPM Struct Reference

#include "Scenario1_ProvisionTPM.h"

List of all members.

Public Member Functions

Scenario1_ProvisionTPM ()
fire_and_forget | Create_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | HandleCardAdded (Windows::Devices::SmartCards::SmartCardReader const &, Windows::Devices::SmartCards::CardAddedEventArgs const &)
Windows::Devices::SmartCards::SmartCardPinPolicy | ParsePinPolicy ()

Private Attributes

Windows::Devices::SmartCards::SmartCardReader::CardAdded_revoker | m_cardAddedToken

Detailed Description

Definition at line 19 of file Scenario1_ProvisionTPM.h.

Constructor & Destructor Documentation

Scenario1_ProvisionTPM ( )

Definition at line 30 of file Scenario1_ProvisionTPM.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Create_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void HandleCardAdded | ( | Windows::Devices::SmartCards::SmartCardReader const & | ,
 |  | Windows::Devices::SmartCards::CardAddedEventArgs const & |  |
 | ) |  |  | [private]
SmartCardPinPolicy ParsePinPolicy ( ) [private]

Definition at line 164 of file Scenario1_ProvisionTPM.cpp.

    {
        SmartCardPinPolicy pinPolicy;
        pinPolicy.MinLength(std::stoul(PinMinLength().Text().c_str()));
        pinPolicy.MaxLength(std::stoul(PinMaxLength().Text().c_str()));

        const auto upperCaseSelection = winrt::unbox_value<hstring>(PinUppercase().SelectedValue());
        pinPolicy.UppercaseLetters(ParsePinPolicyOption(upperCaseSelection));

        const auto lowerCaseSelection = winrt::unbox_value<hstring>(PinLowercase().SelectedValue());
        pinPolicy.LowercaseLetters(ParsePinPolicyOption(lowerCaseSelection));

        const auto digitsSelection = winrt::unbox_value<hstring>(PinDigits().SelectedValue());
        pinPolicy.Digits(ParsePinPolicyOption(digitsSelection));

        const auto specialSelection = winrt::unbox_value<hstring>(PinSpecial().SelectedValue());
        pinPolicy.SpecialCharacters(ParsePinPolicyOption(specialSelection));

        return pinPolicy;
    }

Member Data Documentation

Windows::Devices::SmartCards::SmartCardReader::CardAdded_revoker m_cardAddedToken [private]

Definition at line 26 of file Scenario1_ProvisionTPM.h.

The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario1_ProvisionTPM.h
  • SmartCard/cppwinrt/Scenario1_ProvisionTPM.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_ReadData Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_ReadData
Public Member Functions | Private Member Functions

Scenario1_ReadData Struct Reference

#include "Scenario1_ReadData.h"

List of all members.

Public Member Functions

Scenario1_ReadData ()
Scenario1_ReadData ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | StartStopScenario_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | StartStopScenario_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Foundation::IAsyncAction | StartScenarioAsync ()
Windows::Foundation::IAsyncAction | StartScenarioAsync ()
void | StopScenario ()
void | StopScenario ()
void | Timer_Tick (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
void | Timer_Tick (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)

Detailed Description

Definition at line 18 of file Scenario1_ReadData.h.

Constructor & Destructor Documentation

Scenario1_ReadData ( )

Definition at line 26 of file Scenario1_ReadData.cpp.

    {
        InitializeComponent();
    }

Scenario1_ReadData ( )

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Definition at line 31 of file Scenario1_ReadData.cpp.

    {
        StopScenario();
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
Windows::Foundation::IAsyncAction StartScenarioAsync ( ) [private]
IAsyncAction StartScenarioAsync ( ) [private]

Definition at line 36 of file Scenario1_ReadData.cpp.

    {
        auto lifetime = get_strong();

        hstring i2cDeviceSelector = I2cDevice::GetDeviceSelector();
        IVectorView<DeviceInformation> devices = co_await DeviceInformation::FindAllAsync(i2cDeviceSelector);

        // 0x40 was determined by looking at the datasheet for the HTU21D sensor
        I2cConnectionSettings HTU21D_settings(0x40);

        // If this next line crashes with an OutOfBoundsException,
        // then the problem is that no I2C devices were found.
        //
        // If the next line crashes with Access Denied, then the problem is
        // that access to the I2C device (HTU21D) is denied.
        //
        // The call to FromIdAsync will also crash if the settings are invalid.
        //
        // FromIdAsync produces null if there is a sharing violation on the device.
        // This will result in a NullReferenceException in Timer_Tick below.
        htu21dSensor = co_await I2cDevice::FromIdAsync(devices.GetAt(0).Id(), HTU21D_settings);

        // Start the polling timer.
        timer = DispatcherTimer();
        timer.Interval(500ms);
        timerEventToken = timer.Tick({ get_weak(), &Scenario1_ReadData::Timer_Tick });
        timer.Start();
    }

fire_and_forget StartStopScenario_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget StartStopScenario_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopScenario ( ) [private]

Definition at line 65 of file Scenario1_ReadData.cpp.

    {
        if (timer != nullptr)
        {
            timer.Tick(timerEventToken);
            timer.Stop();
            timer = nullptr;
        }

        // Release the I2C sensor.
        if (htu21dSensor != nullptr)
        {
            htu21dSensor.Close();
            htu21dSensor = nullptr;
        }
    }

void StopScenario ( ) [private]
void Timer_Tick | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
void Timer_Tick | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
The documentation for this struct was generated from the following files:
  • IoT-I2C/cppwinrt/Scenario1_ReadData.h
  • IoT-SPI/cppwinrt/Scenario1_ReadData.h
  • IoT-I2C/cppwinrt/Scenario1_ReadData.cpp
  • IoT-SPI/cppwinrt/Scenario1_ReadData.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Render Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Render
Public Member Functions

Scenario1_Render Struct Reference

#include "Scenario1_Render.h"

List of all members.

Public Member Functions

Scenario1_Render ()
fire_and_forget | LoadDocument (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ViewPage (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_Render.h.

Constructor & Destructor Documentation

Scenario1_Render ( )

Definition at line 29 of file Scenario1_Render.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget LoadDocument | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ViewPage | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PdfDocument/cppwinrt/Scenario1_Render.h
  • PdfDocument/cppwinrt/Scenario1_Render.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Save Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Save
Public Member Functions

Scenario1_Save Struct Reference

#include "Scenario1_Save.h"

List of all members.

Public Member Functions

Scenario1_Save ()
void SaveCredential_Click (Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &)

Detailed Description

Definition at line 19 of file Scenario1_Save.h.

Constructor & Destructor Documentation

Scenario1_Save ( )

Definition at line 23 of file Scenario1_Save.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void SaveCredential_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Foundation::IInspectable const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • PasswordVault/cppwinrt/Scenario1_Save.h
  • PasswordVault/cppwinrt/Scenario1_Save.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SecondaryWindow Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_SecondaryWindow
Public Member Functions | Private Member Functions

Scenario1_SecondaryWindow Struct Reference

#include "Scenario1_SecondaryWindow.h"

List of all members.

Public Member Functions

Scenario1_SecondaryWindow ()
fire_and_forget | Button_Click (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

void | OnWindowClosed (Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &)

Detailed Description

Definition at line 18 of file Scenario1_SecondaryWindow.h.

Constructor & Destructor Documentation

Scenario1_SecondaryWindow ( )

Definition at line 25 of file Scenario1_SecondaryWindow.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Button_Click | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnWindowClosed | ( | Windows::UI::WindowManagement::AppWindow const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/Scenario1_SecondaryWindow.h
  • AppWindow/cppwinrt/Scenario1_SecondaryWindow.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SimpleListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_SimpleListView
Public Member Functions

Scenario1_SimpleListView Struct Reference

#include "Scenario1_SimpleListView.h"

List of all members.

Public Member Functions

Scenario1_SimpleListView ()

Detailed Description

Definition at line 17 of file Scenario1_SimpleListView.h.

Constructor & Destructor Documentation

Scenario1_SimpleListView ( )

Definition at line 23 of file Scenario1_SimpleListView.cpp.

    {
        InitializeComponent();
        ContactsCVS().Source(Contact::GetContactsGrouped(250));
    }

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario1_SimpleListView.h
  • XamlListView/cppwinrt/Scenario1_SimpleListView.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_SingleFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_SingleFile
Public Member Functions

Scenario1_SingleFile Struct Reference

#include "Scenario1_SingleFile.h"

List of all members.

Public Member Functions

Scenario1_SingleFile ()
fire_and_forget PickAFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario1_SingleFile.h.

Constructor & Destructor Documentation

Scenario1_SingleFile ( )

Definition at line 24 of file Scenario1_SingleFile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget PickAFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FilePicker/cppwinrt/Scenario1_SingleFile.h
  • FilePicker/cppwinrt/Scenario1_SingleFile.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_Toggle Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_Toggle
Public Member Functions

Scenario1_Toggle Struct Reference

#include "Scenario1_Toggle.h"

List of all members.

Public Member Functions

Scenario1_Toggle ()
fire_and_forget OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario1_Toggle.h.

Constructor & Destructor Documentation

Scenario1_Toggle ( )

Definition at line 25 of file Scenario1_Toggle.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • RadioManager/cppwinrt/Scenario1_Toggle.h
  • RadioManager/cppwinrt/Scenario1_Toggle.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackInWebcam Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_TrackInWebcam
Public Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario1_TrackInWebcam Struct Reference

#include "Scenario1_TrackInWebcam.h"

List of all members.

Public Member Functions

Scenario1_TrackInWebcam ()
fire_and_forget | CameraStreamingButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Types

enum | ScenarioState { Idle, Streaming }

Private Member Functions

fire_and_forget | AbandonStreaming ()
Windows::Foundation::IAsyncAction | ChangeScenarioStateAsync (ScenarioState newState)
void | MediaCapture_CameraStreamFailed (Windows::Media::Capture::MediaCapture const &sender, Windows::Foundation::IInspectable const &args)
fire_and_forget | OnSuspending (Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e)
fire_and_forget | ProcessCurrentVideoFrame (Windows::System::Threading::ThreadPoolTimer const &timer)
Windows::Foundation::IAsyncAction | ProcessCurrentVideoFrameAsync ()
void | SetupVisualization (Windows::Foundation::Size framePixelSize, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces)
Windows::Foundation::IAsyncAction | ShutdownWebcamAsync ()
Windows::Foundation::IAsyncOperation
< bool > 		StartWebcamStreamingAsync ()

Private Attributes

ScenarioState | currentState = ScenarioState::Idle
event_token | suspendingEventToken

Detailed Description

Definition at line 19 of file Scenario1_TrackInWebcam.h.

Member Enumeration Documentation

enum ScenarioState [private]
Enumerator:
Idle

Display is blank - default state.

Streaming

Webcam is actively engaged and a live video stream is displayed.

Definition at line 30 of file Scenario1_TrackInWebcam.h.

        {
            /// Display is blank - default state.
            Idle,

            /// Webcam is actively engaged and a live video stream is displayed.
            Streaming,
        };

Constructor & Destructor Documentation

Scenario1_TrackInWebcam ( )

Definition at line 36 of file Scenario1_TrackInWebcam.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget AbandonStreaming ( ) [private]

Definition at line 286 of file Scenario1_TrackInWebcam.cpp.

    {
        auto lifetime = get_strong();

        // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
        // and instead need to schedule the state change on the UI thread.
        co_await resume_foreground(Dispatcher());
        co_await ChangeScenarioStateAsync(ScenarioState::Idle);
    }

fire_and_forget CameraStreamingButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
IAsyncAction ChangeScenarioStateAsync ( ScenarioState newState ) [private]

Definition at line 252 of file Scenario1_TrackInWebcam.cpp.

    {
        auto lifetime = get_strong();

        // Disable UI while state change is in progress
        CameraStreamingButton().IsEnabled(false);

        switch (newState)
        {
        case ScenarioState::Idle:

            currentState = newState;
            co_await ShutdownWebcamAsync();

            VisualizationCanvas().Children().Clear();
            CameraStreamingButton().Content(box_value(L"Start Streaming"));
            break;

        case ScenarioState::Streaming:

            if (!co_await StartWebcamStreamingAsync())
            {
                co_await ChangeScenarioStateAsync(ScenarioState::Idle);
                break;
            }

            VisualizationCanvas().Children().Clear();
            CameraStreamingButton().Content(box_value(L"Stop Streaming"));
            currentState = newState;
            CameraStreamingButton().IsEnabled(true);
            break;
        }
    }

void MediaCapture_CameraStreamFailed | ( | Windows::Media::Capture::MediaCapture const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnSuspending | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs const & | e |
 | ) |  |  | [private]
fire_and_forget ProcessCurrentVideoFrame ( Windows::System::Threading::ThreadPoolTimer const & timer ) [private]
IAsyncAction ProcessCurrentVideoFrameAsync ( ) [private]

Definition at line 176 of file Scenario1_TrackInWebcam.cpp.

    {
        auto lifetime = get_strong();

        // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
        // GetPreviewFrame will convert the native webcam frame into this format.
        static constexpr BitmapPixelFormat InputPixelFormat = BitmapPixelFormat::Nv12;
        VideoFrame previewFrame(InputPixelFormat, (int)videoProperties.Width(), (int)videoProperties.Height());

        try
        {
            co_await agileMediaCapture.get().GetPreviewFrameAsync(previewFrame);
        }
        catch (hresult_access_denied const&)
        {
            // Lost access to the camera.
            AbandonStreaming();
            co_return;
        }
        catch (hresult_error const&)
        {
            rootPage.NotifyUser(L"PreviewFrame with format '" + to_hstring(InputPixelFormat) + L"' is not supported by your Webcam", NotifyType::ErrorMessage);
            co_return;
        }

        // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
        if (!FaceDetector::IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap().BitmapPixelFormat()))
        {
            rootPage.NotifyUser(L"PixelFormat '" + to_hstring(previewFrame.SoftwareBitmap().BitmapPixelFormat()) + L"' is not supported by FaceDetector", NotifyType::ErrorMessage);
        }

        IVector<DetectedFace> faces;
        try
        {
            faces = co_await faceTracker.ProcessNextFrameAsync(previewFrame);
        }
        catch (hresult_error const& e)
        {
            rootPage.NotifyUser(e.message(), NotifyType::ErrorMessage);
            co_return;
        }

        // Create our visualization using the frame dimensions and face results but run it on the UI thread.
        Size previewFrameSize(
            static_cast<float>(previewFrame.SoftwareBitmap().PixelWidth()),
            static_cast<float>(previewFrame.SoftwareBitmap().PixelHeight()));
        co_await resume_foreground(Dispatcher());
        SetupVisualization(previewFrameSize, faces);
    }

void SetupVisualization | ( | Windows::Foundation::Size | framePixelSize,
 |  | Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const & | foundFaces |
 | ) |  |  | [private]
IAsyncAction ShutdownWebcamAsync ( ) [private]

Definition at line 119 of file Scenario1_TrackInWebcam.cpp.

    {
        auto lifetime = get_strong();

        if (frameProcessingTimer != nullptr)
        {
            frameProcessingTimer.Cancel();
        }

        if (agileMediaCapture)
        {
            auto mediaCapture = agileMediaCapture.get();
            if (mediaCapture.CameraStreamState() == Windows::Media::Devices::CameraStreamState::Streaming)
            {
                try
                {
                    co_await mediaCapture.StopPreviewAsync();
                }
                catch (hresult_error const&)
                {
                    // Since we're going to destroy the MediaCapture object there's nothing to do here
                }
            }
            mediaCapture.Close();
        }

        frameProcessingTimer = nullptr;
        CamPreview().Source(nullptr);
        agileMediaCapture = nullptr;
        CameraStreamingButton().IsEnabled(true);
    }

IAsyncOperation< bool > StartWebcamStreamingAsync ( ) [private]

Definition at line 67 of file Scenario1_TrackInWebcam.cpp.

    {
        auto lifetime = get_strong();

        bool successful;

        faceTracker = co_await FaceTracker::CreateAsync();
        try
        {
            MediaCapture mediaCapture;
            agileMediaCapture = mediaCapture;
            MediaCaptureInitializationSettings settings;

            // For this scenario, we only need Video (not microphone) so specify this in the initializer.
            // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
            // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
            settings.StreamingCaptureMode(StreamingCaptureMode::Video);

            co_await mediaCapture.InitializeAsync(settings);
            mediaCapture.Failed({ get_weak(), &Scenario1_TrackInWebcam::MediaCapture_CameraStreamFailed });

            // Cache the media properties as we'll need them later.
            auto deviceController = mediaCapture.VideoDeviceController();
            videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType::VideoPreview).as<VideoEncodingProperties>();

            // Immediately start streaming to our CaptureElement UI.
            // NOTE: CaptureElement's Source must be set before streaming is started.
            CamPreview().Source(mediaCapture);
            co_await mediaCapture.StartPreviewAsync();

            // Run the timer at 15 frames per second.
            TimeSpan timerInterval = TimeSpan{ 1s } / 15;
            frameProcessingTimer = ThreadPoolTimer::CreatePeriodicTimer({ get_weak(), &Scenario1_TrackInWebcam::ProcessCurrentVideoFrame }, timerInterval);

            successful = true;
        }
        catch (hresult_access_denied const&)
        {
            // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
            rootPage.NotifyUser(L"Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType::ErrorMessage);
            successful = false;
        }
        catch (hresult_error const& ex)
        {
            rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            successful = false;
        }

        co_return successful;
    }

Member Data Documentation

ScenarioState currentState = ScenarioState::Idle [private]

Reference back to the "root" page of the app.

Holds the current scenario state value.

Definition at line 44 of file Scenario1_TrackInWebcam.h.

event_token suspendingEventToken [private]

Definition at line 47 of file Scenario1_TrackInWebcam.h.

The documentation for this struct was generated from the following files:
  • BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.h
  • BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_TrackPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_TrackPosition
Public Member Functions | Private Member Functions

Scenario1_TrackPosition Struct Reference

#include "Scenario1_TrackPosition.h"

List of all members.

Public Member Functions

Scenario1_TrackPosition ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | StartTracking (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | StopTracking (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | OnPositionChanged (Windows::Devices::Geolocation::Geolocator const &, Windows::Devices::Geolocation::PositionChangedEventArgs e)
fire_and_forget | OnStatusChanged (Windows::Devices::Geolocation::Geolocator const &, Windows::Devices::Geolocation::StatusChangedEventArgs e)
void | UpdateLocationData (Windows::Devices::Geolocation::Geoposition const &position)

Detailed Description

Definition at line 18 of file Scenario1_TrackPosition.h.

Constructor & Destructor Documentation

Scenario1_TrackPosition ( )

Definition at line 25 of file Scenario1_TrackPosition.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OnPositionChanged | ( | Windows::Devices::Geolocation::Geolocator const & | ,
 |  | Windows::Devices::Geolocation::PositionChangedEventArgs | e |
 | ) |  |  | [private]
fire_and_forget OnStatusChanged | ( | Windows::Devices::Geolocation::Geolocator const & | ,
 |  | Windows::Devices::Geolocation::StatusChangedEventArgs | e |
 | ) |  |  | [private]
fire_and_forget StartTracking | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void StopTracking | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateLocationData ( Windows::Devices::Geolocation::Geoposition const & position ) [private]
The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario1_TrackPosition.h
  • Geolocation/cppwinrt/Scenario1_TrackPosition.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UIFonts Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_UIFonts
Public Member Functions

Scenario1_UIFonts Struct Reference

#include "Scenario1_UIFonts.h"

List of all members.

Public Member Functions

Scenario1_UIFonts ()
void ApplyFonts_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario1_UIFonts.h.

Constructor & Destructor Documentation

Scenario1_UIFonts ( )

Definition at line 24 of file Scenario1_UIFonts.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ApplyFonts_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LanguageFont/cppwinrt/Scenario1_UIFonts.h
  • LanguageFont/cppwinrt/Scenario1_UIFonts.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_UTF8 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_UTF8
Public Member Functions | Private Member Functions

Scenario1_UTF8 Struct Reference

#include "Scenario1_UTF8.h"

List of all members.

Public Member Functions

Scenario1_UTF8 ()
winrt::fire_and_forget | OnConnect (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnDisconnect (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
winrt::fire_and_forget | OnSend (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | AppendOutputLine (hstring const &value)
void | CloseSocket ()
Windows::Foundation::IAsyncAction | ConnectAsync ()
winrt::fire_and_forget | MessageReceived (Windows::Networking::Sockets::MessageWebSocket const &sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs e)
winrt::fire_and_forget | OnClosed (Windows::Networking::Sockets::IWebSocket sender, Windows::Networking::Sockets::WebSocketClosedEventArgs e)
winrt::fire_and_forget | OnServerCustomValidationRequested (Windows::Networking::Sockets::MessageWebSocket const &, Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs e)
Windows::Foundation::IAsyncAction | SendAsync ()
void | SetBusy (bool value)
void | UpdateVisualState ()

Detailed Description

Definition at line 18 of file Scenario1_UTF8.h.

Constructor & Destructor Documentation

Scenario1_UTF8 ( )

Definition at line 27 of file Scenario1_UTF8.cpp.

    {
        InitializeComponent();
        UpdateVisualState();
    }

Member Function Documentation

void AppendOutputLine ( hstring const & value ) [private]

Definition at line 293 of file Scenario1_UTF8.cpp.

    {
        OutputField().Text(OutputField().Text() + value + L"\r\n");
    }

void CloseSocket ( ) [private]

Definition at line 264 of file Scenario1_UTF8.cpp.

    {
        if (m_messageWriter)
        {
            // In order to reuse the socket with another DataWriter, the socket's output stream needs to be detached.
            // Otherwise, the DataWriter's destructor will automatically close the stream and all subsequent I/O operations
            // invoked on the socket's output stream will fail with ObjectDisposedException.
            //
            // This is only added for completeness, as this sample closes the socket in the very next code block.
            m_messageWriter.DetachStream();
            m_messageWriter.Close();
            m_messageWriter = nullptr;
        }

        if (m_messageWebSocket)
        {
            try
            {
                m_messageWebSocket.Close(1000, L"Closed due to user request.");
            }
            catch (winrt::hresult_error const& ex)
            {
                AppendOutputLine(BuildWebSocketError(ex));
                AppendOutputLine(ex.message());
            }
            m_messageWebSocket = nullptr;
        }
    }

IAsyncAction ConnectAsync ( ) [private]

Definition at line 69 of file Scenario1_UTF8.cpp.

    {
        auto lifetime = get_strong();

        if (InputField().Text().empty())
        {
            m_rootPage.NotifyUser(L"Please specify text to send", NotifyType::ErrorMessage);
            co_return;
        }

        // Validating the URI is required since it was received from an untrusted source (user input).
        // The URI is validated by calling TryGetUri() that will return null for strings that are not
        // valid WebSocket URIs.
        // Note that when enabling the text box users may provide URIs to machines on the intrAnet
        // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
        // "Internet (Client)" capability respectively.
        Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
        if (server == nullptr)
        {
            co_return;
        }

        m_messageWebSocket = MessageWebSocket();
        m_messageWebSocket.Control().MessageType(SocketMessageType::Utf8);
        m_messageWebSocket.MessageReceived({ get_weak(), &Scenario1_UTF8::MessageReceived });
        m_messageWebSocket.Closed({ get_weak(), &Scenario1_UTF8::OnClosed });

        // If we are connecting to wss:// endpoint, by default, the OS performs validation of
        // the server certificate based on well-known trusted CAs. We can perform additional custom
        // validation if needed.
        if (SecureWebSocketCheckBox().IsChecked().Value())
        {
            // WARNING: Only test applications should ignore SSL errors.
            // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
            // attacks. (Although the connection is secure, the server is not authenticated.)
            // Note that not all certificate validation errors can be ignored.
            // In this case, we are ignoring these errors since the certificate assigned to the localhost
            // URI is self-signed and has subject name = fabrikam.com
            m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
            m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);

            // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
            // custom validation of the server certificate. The event handler must implement the desired
            // custom certificate validation logic.
            m_messageWebSocket.ServerCustomValidationRequested({ get_weak(), &Scenario1_UTF8::OnServerCustomValidationRequested });

            // Certificate validation occurs only for secure connections.
            if (server.SchemeName() != L"wss")
            {
                AppendOutputLine(L"Note: Certificate validation is performed only for the wss: scheme.");
            }
        }

        AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");
        try
        {
            co_await m_messageWebSocket.ConnectAsync(server);
        }
        catch (winrt::hresult_error const& ex) // For debugging
        {
            // Error happened during connect operation.
            m_messageWebSocket.Close();
            m_messageWebSocket = nullptr;

            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }

        // The default DataWriter encoding is Utf8.
        m_messageWriter = DataWriter(m_messageWebSocket.OutputStream());
        m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);
    }

winrt::fire_and_forget MessageReceived | ( | Windows::Networking::Sockets::MessageWebSocket const & | sender,
 |  | Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs | e |
 | ) |  |  | [private]
winrt::fire_and_forget OnClosed | ( | Windows::Networking::Sockets::IWebSocket | sender,
 |  | Windows::Networking::Sockets::WebSocketClosedEventArgs | e |
 | ) |  |  | [private]
winrt::fire_and_forget OnConnect | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnDisconnect | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
winrt::fire_and_forget OnSend | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
winrt::fire_and_forget OnServerCustomValidationRequested | ( | Windows::Networking::Sockets::MessageWebSocket const & | ,
 |  | Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs | e |
 | ) |  |  | [private]
IAsyncAction SendAsync ( ) [private]

Definition at line 182 of file Scenario1_UTF8.cpp.

    {
        auto lifetime = get_strong();

        hstring message = InputField().Text();
        if (message.empty())
        {
            m_rootPage.NotifyUser(L"Please specify text to send", NotifyType::ErrorMessage);
            co_return;
        }

        AppendOutputLine(L"Sending Message: " + message);

        // Buffer any data we want to send.
        m_messageWriter.WriteString(message);

        try
        {
            // Send the data as one complete message.
            co_await m_messageWriter.StoreAsync();
        }
        catch (winrt::hresult_error const& ex)
        {
            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }

        m_rootPage.NotifyUser(L"Send Complete", NotifyType::StatusMessage);
    }

void SetBusy ( bool value ) [private]

Definition at line 54 of file Scenario1_UTF8.cpp.

    {
        m_busy = value;
        UpdateVisualState();
    }

void UpdateVisualState ( ) [private]

Definition at line 38 of file Scenario1_UTF8.cpp.

    {
        if (m_busy)
        {
            VisualStateManager::GoToState(*this, L"Busy", false);
        }
        else if (m_messageWebSocket != nullptr)
        {
            VisualStateManager::GoToState(*this, L"Connected", false);
        }
        else
        {
            VisualStateManager::GoToState(*this, L"Disconnected", false);
        }
    }

The documentation for this struct was generated from the following files:
  • WebSocket/cppwinrt/Scenario1_UTF8.h
  • WebSocket/cppwinrt/Scenario1_UTF8.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario1_XmlReader Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario1_XmlReader
Public Member Functions | Static Private Member Functions

Scenario1_XmlReader Struct Reference

#include "Scenario1_XmlReader.h"

List of all members.

Public Member Functions

Scenario1_XmlReader ()
fire_and_forget | ReadXmlClick (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Static Private Member Functions

static void | ReadAttributes (std::wostream &result, com_ptr< IXmlReader > const &reader)
static void | ReadXml (std::wostream &result, com_ptr< IStream > const &readStream)

Detailed Description

Definition at line 18 of file Scenario1_XmlReader.h.

Constructor & Destructor Documentation

Scenario1_XmlReader ( )

Definition at line 26 of file Scenario1_XmlReader.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ReadAttributes | ( | std::wostream & | result,
 |  | com_ptr< IXmlReader > const & | reader |
 | ) |  |  | [static, private]

Definition at line 144 of file Scenario1_XmlReader.cpp.

    {
        check_hresult(reader->MoveToFirstAttribute());

        do
        {
            if (!reader->IsDefault())
            {
                PCWSTR prefix = nullptr;
                PCWSTR localName = nullptr;
                PCWSTR value = nullptr;

                UINT prefixSize = 0;
                UINT localNameSize = 0;
                UINT valueSize = 0;

                check_hresult(reader->GetPrefix(&prefix, &prefixSize));
                check_hresult(reader->GetLocalName(&localName, &localNameSize));
                check_hresult(reader->GetValue(&value, &valueSize));

                result << L"Attr: ";
                if (prefixSize > 0)
                {
                    result << std::wstring_view(prefix, prefixSize) << L':';
                }
                result << std::wstring_view(localName, localNameSize) <<
                    L"=\"" << std::wstring_view(value, valueSize) << L"\"\n";
            }
        } while (check_enumerator(reader->MoveToNextAttribute()));
    }

void ReadXml | ( | std::wostream & | result,
 |  | com_ptr< IStream > const & | readStream |
 | ) |  |  | [static, private]

Definition at line 52 of file Scenario1_XmlReader.cpp.

    {
        XmlNodeType nodeType;

        com_ptr<IXmlReader> reader;
        check_hresult(::CreateXmlReader(IID_PPV_ARGS(&reader), nullptr));
        check_hresult(reader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit));
        check_hresult(reader->SetInput(readStream.get()));

        // Reads until there are no more nodes.
        while (check_enumerator(reader->Read(&nodeType)))
        {
            PCWSTR prefix = nullptr;
            PCWSTR localName = nullptr;
            PCWSTR value = nullptr;

            UINT prefixSize = 0;
            UINT localNameSize = 0;
            UINT valueSize = 0;

            switch (nodeType)
            {
            case XmlNodeType_XmlDeclaration:
                result << L"XmlDeclaration\n";
                ReadAttributes(result, reader);
                break;

            case XmlNodeType_Element:
                check_hresult(reader->GetPrefix(&prefix, &prefixSize));
                check_hresult(reader->GetLocalName(&localName, &localNameSize));
                result << L"Element: ";
                if (prefixSize > 0)
                {
                    result << std::wstring_view(prefix, prefixSize) << L':';
                }
                result << std::wstring_view(localName, localNameSize) << L"\n";

                ReadAttributes(result, reader);
                if (reader->IsEmptyElement())
                {
                    result << L" (empty)";
                }
                break;

            case XmlNodeType_EndElement:
                check_hresult(reader->GetPrefix(&prefix, &prefixSize));
                check_hresult(reader->GetLocalName(&localName, &localNameSize));
                result << L"End Element: ";
                if (prefixSize > 0)
                {
                    result << std::wstring_view(prefix, prefixSize) << L':';
                }
                result << std::wstring_view(localName, localNameSize) << L"\n";
                break;

            case XmlNodeType_Text:
                check_hresult(reader->GetValue(&value, &valueSize));
                result << L"Text: >" << std::wstring_view(value, valueSize) << L"<\n";
                break;

            case XmlNodeType_CDATA:
                check_hresult(reader->GetValue(&value, &valueSize));
                result << L"CDATA: " << std::wstring_view(value, valueSize) << L"\n";
                break;

            case XmlNodeType_ProcessingInstruction:
                check_hresult(reader->GetLocalName(&localName, &localNameSize));
                check_hresult(reader->GetValue(&value, &valueSize));
                result << L"Processing Instruction name:" << std::wstring_view(localName, localNameSize) << L", ";
                result << L"value:" << std::wstring_view(value, valueSize) << L"\n";
                break;

            case XmlNodeType_Comment:
                check_hresult(reader->GetValue(&value, &valueSize));
                result << L"Comment: " << std::wstring_view(value, valueSize) << L"\n";
                break;

            case XmlNodeType_DocumentType:
                result << L"DOCTYPE is not printed\n";
                break;

            case XmlNodeType_Whitespace:
                check_hresult(reader->GetValue(&value, &valueSize));
                result << L"WhiteSpace: " << std::wstring_view(value, valueSize) << L"\n";
                break;

            default:
                break;
            }
        }
    }

fire_and_forget ReadXmlClick | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • XmlLite/cppwinrt/Scenario1_XmlReader.h
  • XmlLite/cppwinrt/Scenario1_XmlReader.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2
Public Member Functions | Private Member Functions | Private Attributes

Scenario2 Struct Reference

Getting a file's parent folder.

#include "Scenario2.h"

Inherits winrt::SDKTemplate::MediaFoundationInitializer.

List of all members.

Public Member Functions

Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
Scenario2 ()
void | btnFilePicker_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPause_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPlay_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPlayPause_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnStop_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DisableContentUI ()
fire_and_forget | DoScenario (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
void | EnableDisableLogging (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
fire_and_forget | GetParent_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetThumbnailButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | GroupByMonthButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GroupByRatingButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GroupByTagButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | InitializeDevice ()
fire_and_forget | MediaButtonPressed (Windows::Media::SystemMediaTransportControls const &sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs e)
fire_and_forget | OnDeviceStateChange (IDeviceStateSource const &sender, SDKTemplate::DeviceStateChangedEventArgs e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &args)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &args)
fire_and_forget | OnPickFileAsync ()
void | OnSetVolume (double volume)
void | PauseDevice ()
void | PlayPauseToggleDevice ()
void | radioFile_Checked (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | radioTone_Checked (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | sliderFrequency_ValueChanged (IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e)
void | sliderVolume_ValueChanged (IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e)
void | StartDevice ()
void | StopDevice ()
void | UpdateContentProps (hstring const &text)
void | UpdateContentUI ()
void | UpdateMediaControlUI (DeviceState deviceState)

Private Member Functions

void | AddMessage (_In_ LPCWSTR message)
Windows::Foundation::IAsyncAction | GroupByHelperAsync (Windows::Storage::Search::QueryOptions queryOptions)
fire_and_forget | OnStatusChanged (SDKTemplate::LoggingScenarioEventArgs args)
void | UpdateControls ()

Private Attributes

LoggingSessionScenario & | _instance = LoggingSessionScenario::Instance()
event_token | _statusChangedToken
ContentType | m_contentType = ContentType::Tone
event_token | m_deviceStateChangeToken
bool | m_deviceSupportsRawMode = false
com_ptr< WASAPIRenderer > | m_renderer
event_token | m_systemMediaControlsButtonToken

Detailed Description

Definition at line 22 of file Scenario2.h.

Constructor & Destructor Documentation

Scenario2 ( )

Definition at line 25 of file Scenario2.cpp.

    {
        InitializeComponent();
    }

Scenario2 ( )
Scenario2 ( )
Scenario2 ( )
Scenario2 ( )

Member Function Documentation

void AddMessage ( _In_ LPCWSTR message ) [private]
void btnFilePicker_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 247 of file Scenario2.cpp.

    {
        OnPickFileAsync();
    }

void btnPause_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 232 of file Scenario2.cpp.

    {
        PauseDevice();
    }

void btnPlay_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 227 of file Scenario2.cpp.

    {
        StartDevice();
    }

void btnPlayPause_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 237 of file Scenario2.cpp.

    {
        PlayPauseToggleDevice();
    }

void btnStop_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 242 of file Scenario2.cpp.

    {
        StopDevice();
    }

void DisableContentUI ( )

Definition at line 97 of file Scenario2.cpp.

    {
        btnFilePicker().IsEnabled(false);
        sliderFrequency().IsEnabled(false);
        radioFile().IsEnabled(false);
        radioTone().IsEnabled(false);
    }

fire_and_forget DoScenario | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |
void EnableDisableLogging | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |
fire_and_forget GetParent_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GetThumbnailButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
Windows::Foundation::IAsyncAction GroupByHelperAsync ( Windows::Storage::Search::QueryOptions queryOptions ) [private]
fire_and_forget GroupByMonthButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GroupByRatingButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GroupByTagButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void InitializeDevice ( )

Definition at line 365 of file Scenario2.cpp.

    {
        if (m_renderer)
        {
            // Already initialized.
            return;
        }

        // Create a new WASAPI instance
        m_renderer = make_self<WASAPIRenderer>();

        // Register for events
        m_deviceStateChangeToken = m_renderer->DeviceStateChanged({ get_weak(), &Scenario2::OnDeviceStateChange });

        // Configure user based properties

        m_renderer->SetContentType(m_contentType);
        m_renderer->SetFrequency(sliderFrequency().Value());
        m_renderer->SetContentStream(m_contentStream);
        m_renderer->SetHWOffload(toggleHWOffload().IsOn());
        m_renderer->SetBackgroundAudio(toggleBackgroundAudio().IsOn());
        m_renderer->SetRawAudio(m_deviceSupportsRawMode && toggleRawAudio().IsOn());

        int BufferSize = 0;
        swscanf_s(txtHWBuffer().Text().c_str(), L"%d", &BufferSize);
        m_renderer->SetBufferDuration(static_cast<REFERENCE_TIME>(BufferSize));

        // Selects the Default Audio Device
        m_renderer->AsyncInitializeAudioDevice();

        // Set the initial volume.
        OnSetVolume(sliderVolume().Value());
    }

fire_and_forget MediaButtonPressed | ( | Windows::Media::SystemMediaTransportControls const & | sender,
 |  | Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs | e
 | ) |  |
fire_and_forget OnDeviceStateChange | ( | IDeviceStateSource const & | sender,
 |  | SDKTemplate::DeviceStateChangedEventArgs | e
 | ) |  |

Definition at line 255 of file Scenario2.cpp.

    {
        auto lifetime = get_strong();

        // Handle state specific messages
        switch (e.DeviceState())
        {
        case DeviceState::Initialized:
            StartDevice();
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Closed);
            break;

        case DeviceState::Playing:
            rootPage.NotifyUser(L"Playback Started", NotifyType::StatusMessage);
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Playing);
            break;

        case DeviceState::Paused:
            rootPage.NotifyUser(L"Playback Paused", NotifyType::StatusMessage);
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Paused);
            break;

        case DeviceState::Stopped:
            if (m_deviceStateChangeToken)
            {
                m_renderer->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
            }
            m_renderer = nullptr;

            rootPage.NotifyUser(L"Playback Stopped", NotifyType::StatusMessage);
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Stopped);
            break;

        case DeviceState::Error:
            if (m_deviceStateChangeToken)
            {
                m_renderer->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
            }
            m_renderer = nullptr;

            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Closed);

            // Specifically handle a couple of known errors
            auto error = e.ExtendedError();
            switch (error)
            {
            case AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE:
                rootPage.NotifyUser(L"ERROR: Endpoint Does Not Support HW Offload", NotifyType::ErrorMessage);
                break;

            case AUDCLNT_E_RESOURCES_INVALIDATED:
                rootPage.NotifyUser(L"ERROR: Endpoint Lost Access To Resources", NotifyType::ErrorMessage);
                break;

            default:
                rootPage.NotifyUser(L"ERROR: " + hresult_error(error).message(), NotifyType::ErrorMessage);
                break;
            }
        }

        // Update Control Buttons
        co_await resume_foreground(Dispatcher());
        UpdateMediaControlUI(e.DeviceState());
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & args )
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & args )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OnPickFileAsync ( )

Definition at line 325 of file Scenario2.cpp.

    {
        auto lifetime = get_strong();
        FileOpenPicker filePicker;
        filePicker.ViewMode(PickerViewMode::List);
        filePicker.SuggestedStartLocation(PickerLocationId::MusicLibrary);
        filePicker.FileTypeFilter().ReplaceAll({ L".wav", L".mp3", L".wma" });

        StorageFile file = co_await filePicker.PickSingleFileAsync();
        if (file != nullptr)
        {
            // Open the stream
            IRandomAccessStream stream = co_await file.OpenAsync(FileAccessMode::Read);
            if (stream != nullptr)
            {
                m_contentStream = stream;
                UpdateContentProps(file.Path());
            }
        }
    }

void OnSetVolume ( double volume )

Definition at line 351 of file Scenario2.cpp.

    {
        if (m_renderer)
        {
            // Updates the Session volume on the AudioClient
            m_renderer->SetVolumeOnSession(volume);
        }
    }

fire_and_forget OnStatusChanged ( SDKTemplate::LoggingScenarioEventArgs args ) [private]

Definition at line 131 of file Scenario2.cpp.

{
    // Switch to UI thread.
    co_await resume_foreground(Dispatcher());

    switch (args.Type())
    {
    case LoggingScenarioEventType::BusyStatusChanged:
        UpdateControls();
        break;

    case LoggingScenarioEventType::LogFileGenerated:
    {
        hstring logFileFullPath = args.LogFileFullPath();
        if (logFileFullPath.empty())
        {
            AddMessage(L"LogFileGenerated: none, nothing logged since saving the last file.");
        }
        else
        {
            // Add a message to the UI indicating a new log file was created.
            std::wstring fullPath(logFileFullPath);
            std::wstring directoryName;
            std::wstring fileName;
            std::size_t lastSlashPos = fullPath.find_last_of(L'\\');
            if (lastSlashPos > 0 && lastSlashPos < fullPath.size() - 1)
            {
                directoryName = fullPath.substr(0, lastSlashPos);
                fileName = fullPath.substr(lastSlashPos + 1, fullPath.size() - (lastSlashPos + 1));
            }

            ViewLogInfo().Text(
                L"Log folder: \"" + directoryName + L"\"\r\n"
                L"- To view with tracerpt: tracerpt.exe \"" + fullPath + L"\" -of XML -o LogFile.xml\r\n"
                L"- To view with Windows Performance Toolkit (WPT):\n"
                L"   xperf -merge \"" + fullPath + "\" merged.etl\n"
                L"   wpa.exe merged.etl");
            AddMessage((L"LogFileGenerated: " + fileName).c_str());
        }
    }
        break;

    case LoggingScenarioEventType::LoggingEnabledDisabled:
        AddMessage(args.Enabled()
            ? L"Logging has been enabled."
            : L"Logging has been disabled.");
        break;

    default:
        AddMessage(L"Unrecognized event.");
        break;
    }
}

void PauseDevice ( )

Definition at line 422 of file Scenario2.cpp.

    {
        if (m_renderer)
        {
            if (m_renderer->DeviceState() == DeviceState::Playing)
            {
                // Starts a work item to pause playback
                m_renderer->PausePlaybackAsync();
            }
        }
    }

void PlayPauseToggleDevice ( )

Definition at line 434 of file Scenario2.cpp.

    {
        if (m_renderer)
        {
            DeviceState deviceState = m_renderer->DeviceState();

            if (deviceState == DeviceState::Playing)
            {
                // Starts a work item to pause playback
                m_renderer->PausePlaybackAsync();
            }
            else if (deviceState == DeviceState::Paused)
            {
                // Starts a work item to pause playback
                m_renderer->StartPlayback();
            }
        }
        else
        {
            StartDevice();
        }
    }

void radioFile_Checked | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 219 of file Scenario2.cpp.

    {
        m_contentType = ContentType::File;
        UpdateContentProps(L"");
        m_contentStream = nullptr;
        UpdateContentUI();
    }

void radioTone_Checked | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 211 of file Scenario2.cpp.

    {
        m_contentType = ContentType::Tone;
        UpdateContentProps(L"");
        m_contentStream = nullptr;
        UpdateContentUI();
    }

void sliderFrequency_ValueChanged | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const & | e
 | ) |  |
void sliderVolume_ValueChanged | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const & | e
 | ) |  |
void StartDevice ( )

Definition at line 399 of file Scenario2.cpp.

    {
        if (m_renderer == nullptr)
        {
            // Call from main UI thread
            InitializeDevice();
        }
        else
        {
            // Starts a work item to begin playback, likely in the paused state
            m_renderer->StartPlayback();
        }
    }

void StopDevice ( )

Definition at line 413 of file Scenario2.cpp.

    {
        if (m_renderer)
        {
            // Set the event to stop playback
            m_renderer->StopPlaybackAsync();
        }
    }

void UpdateContentProps ( hstring const & text )

Definition at line 177 of file Scenario2.cpp.

    {
        // Ignore calls triggered by binding before construction is complete.
        if (txtContentProps() == nullptr)
        {
            return;
        }

        txtContentProps().Text(text);

        if (text.empty() && (m_contentType == ContentType::File))
        {
            txtContentProps().Background(SolidColorBrush({ 0xCC, 0xFF, 0x00, 0x00 }));
        }
        else
        {
            txtContentProps().Background(nullptr);
        }
    }

void UpdateContentUI ( )

Definition at line 106 of file Scenario2.cpp.

    {
        // Ignore calls triggered by binding before construction is complete.
        if (radioFile() == nullptr)
        {
            return;
        }

        radioFile().IsEnabled(true);
        radioTone().IsEnabled(true);

        switch (m_contentType)
        {
        case ContentType::Tone:
            btnFilePicker().IsEnabled(false);
            sliderFrequency().IsEnabled(true);
            UpdateContentProps(to_hstring(sliderFrequency().Value()) + L" Hz");
            break;

        case ContentType::File:
            btnFilePicker().IsEnabled(true);
            sliderFrequency().IsEnabled(false);
            break;

        default:
            break;
        }
    }

void UpdateControls ( ) [private]

Definition at line 84 of file Scenario2.cpp.

{
    if (_instance.LoggingEnabled())
    {
        InputTextBlock1().Text(
            L"Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.");
        EnableDisableLoggingButton().Content(box_value(L"Disable Logging"));

        if (_instance.IsBusy())
        {
            EnableDisableLoggingButton().IsEnabled(false);
            DoScenarioButton().IsEnabled(false);
        }
        else
        {
            EnableDisableLoggingButton().IsEnabled(true);
            DoScenarioButton().IsEnabled(true);
        }
    }
    else
    {
        InputTextBlock1().Text(
            L"Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.");
        EnableDisableLoggingButton().Content(box_value(L"Enable Logging"));
        DoScenarioButton().IsEnabled(false);
        EnableDisableLoggingButton().IsEnabled(!_instance.IsBusy());
    }
}

void UpdateMediaControlUI ( DeviceState deviceState )

Definition at line 136 of file Scenario2.cpp.

    {
        switch (deviceState)
        {
        case DeviceState::Playing:
            btnPlay().IsEnabled(false);
            btnStop().IsEnabled(true);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(true);
            break;

        case DeviceState::Stopped:
        case DeviceState::Error:
            btnPlay().IsEnabled(true);
            btnStop().IsEnabled(false);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(false);

            UpdateContentUI();
            break;

        case DeviceState::Paused:
            btnPlay().IsEnabled(true);
            btnStop().IsEnabled(true);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(false);
            break;

        case DeviceState::Starting:
        case DeviceState::Stopping:
            btnPlay().IsEnabled(false);
            btnStop().IsEnabled(false);
            btnPlayPause().IsEnabled(false);
            btnPause().IsEnabled(false);

            DisableContentUI();
            break;
        }
    }

Member Data Documentation

LoggingSessionScenario& _instance = LoggingSessionScenario::Instance() [private]

Definition at line 52 of file Scenario2.h.

event_token _statusChangedToken [private]

Definition at line 53 of file Scenario2.h.

ContentType m_contentType = ContentType::Tone [private]

Definition at line 64 of file Scenario2.h.

event_token m_deviceStateChangeToken [private]

Definition at line 56 of file Scenario2.h.

bool m_deviceSupportsRawMode = false [private]

Definition at line 61 of file Scenario2.h.

com_ptr<WASAPIRenderer> m_renderer [private]

Definition at line 65 of file Scenario2.h.

event_token m_systemMediaControlsButtonToken [private]

Definition at line 59 of file Scenario2.h.

The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario2.h
  • Logging/cppwinrt/Scenario2.h
  • WindowsAudioSession/cppwinrt/Scenario2.h
  • FileThumbnails/cppwinrt/Scenario2.h
  • FolderEnumeration/cppwinrt/Scenario2.h
  • FileAccess/cppwinrt/Scenario2.cpp
  • FileThumbnails/cppwinrt/Scenario2.cpp
  • FolderEnumeration/cppwinrt/Scenario2.cpp
  • Logging/cppwinrt/Scenario2.cpp
  • WindowsAudioSession/cppwinrt/Scenario2.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Binary Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Binary
Public Member Functions | Private Member Functions

Scenario2_Binary Struct Reference

#include "Scenario2_Binary.h"

List of all members.

Public Member Functions

Scenario2_Binary ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
winrt::fire_and_forget | OnStart (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnStop (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | AppendOutputLine (hstring const &value)
void | CloseSocket ()
winrt::fire_and_forget | OnClosed (Windows::Networking::Sockets::IWebSocket sender, Windows::Networking::Sockets::WebSocketClosedEventArgs e)
winrt::fire_and_forget | OnServerCustomValidationRequested (Windows::Networking::Sockets::StreamWebSocket const &, Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs e)
Windows::Foundation::IAsyncAction | ReceiveDataAsync (Windows::Networking::Sockets::StreamWebSocket activeSocket)
Windows::Foundation::IAsyncAction | SendDataAsync (Windows::Networking::Sockets::StreamWebSocket activeSocket)
void | SetBusy (bool value)
Windows::Foundation::IAsyncAction | StartAsync ()
void | UpdateVisualState ()

Detailed Description

Definition at line 18 of file Scenario2_Binary.h.

Constructor & Destructor Documentation

Scenario2_Binary ( )

Definition at line 30 of file Scenario2_Binary.cpp.

    {
        InitializeComponent();
        UpdateVisualState();
    }

Member Function Documentation

void AppendOutputLine ( hstring const & value ) [private]

Definition at line 313 of file Scenario2_Binary.cpp.

    {
        OutputField().Text(OutputField().Text() + value + L"\r\n");
    }

void CloseSocket ( ) [private]

Definition at line 296 of file Scenario2_Binary.cpp.

    {
        if (m_streamWebSocket)
        {
            try
            {
                m_streamWebSocket.Close(1000, L"Closed due to user request.");
            }
            catch (winrt::hresult_error const& ex)
            {
                AppendOutputLine(BuildWebSocketError(ex));
                AppendOutputLine(ex.message());
            }
            m_streamWebSocket = nullptr;
        }
    }

winrt::fire_and_forget OnClosed | ( | Windows::Networking::Sockets::IWebSocket | sender,
 |  | Windows::Networking::Sockets::WebSocketClosedEventArgs | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
winrt::fire_and_forget OnServerCustomValidationRequested | ( | Windows::Networking::Sockets::StreamWebSocket const & | ,
 |  | Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs | e |
 | ) |  |  | [private]
winrt::fire_and_forget OnStart | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnStop | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
Windows::Foundation::IAsyncAction ReceiveDataAsync ( Windows::Networking::Sockets::StreamWebSocket activeSocket ) [private]
Windows::Foundation::IAsyncAction SendDataAsync ( Windows::Networking::Sockets::StreamWebSocket activeSocket ) [private]
void SetBusy ( bool value ) [private]

Definition at line 57 of file Scenario2_Binary.cpp.

    {
        m_busy = value;
        UpdateVisualState();
    }

IAsyncAction StartAsync ( ) [private]

Definition at line 72 of file Scenario2_Binary.cpp.

    {
        auto lifetime = get_strong();

        // Validating the URI is required since it was received from an untrusted source (user input).
        // The URI is validated by calling TryGetUri() that will return null for strings that are not
        // valid WebSocket URIs.
        // Note that when enabling the text box users may provide URIs to machines on the intrAnet
        // or intErnet. In these cases the app requires the "Home or Work Networking" or
        // "Internet (Client)" capability respectively.
        Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
        if (server == nullptr)
        {
            co_return;
        }

        m_streamWebSocket = StreamWebSocket();
        m_streamWebSocket.Closed({ get_weak(), &Scenario2_Binary::OnClosed });

        // If we are connecting to wss:// endpoint, by default, the OS performs validation of
        // the server certificate based on well-known trusted CAs. We can perform additional custom
        // validation if needed.
        if (SecureWebSocketCheckBox().IsChecked().Value())
        {
            // WARNING: Only test applications should ignore SSL errors.
            // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
            // attacks. (Although the connection is secure, the server is not authenticated.)
            // Note that not all certificate validation errors can be ignored.
            // In this case, we are ignoring these errors since the certificate assigned to the localhost
            // URI is self-signed and has subject name = fabrikam.com
            m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
            m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);

            // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
            // custom validation of the server certificate. The event handler must implement the desired
            // custom certificate validation logic.
            m_streamWebSocket.ServerCustomValidationRequested({ get_weak(), &Scenario2_Binary::OnServerCustomValidationRequested });

            // Certificate validation is meaningful only for secure connections.
            if (server.SchemeName() != L"wss")
            {
                AppendOutputLine(L"Note: Certificate validation is performed only for the wss: scheme.");
            }
        }

        AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");
        try
        {
            co_await m_streamWebSocket.ConnectAsync(server);
        }
        catch (winrt::hresult_error const& ex) // For debugging
        {
            m_streamWebSocket.Close();
            m_streamWebSocket = nullptr;

            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }
        m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);

        // Start a task to continuously read for incoming data
        auto receiving = ReceiveDataAsync(m_streamWebSocket);

        // Start a task to continuously write outgoing data
        auto sending = SendDataAsync(m_streamWebSocket);
    }

void UpdateVisualState ( ) [private]

Definition at line 41 of file Scenario2_Binary.cpp.

    {
        if (m_busy)
        {
            VisualStateManager::GoToState(*this, L"Busy", false);
        }
        else if (m_streamWebSocket != nullptr)
        {
                VisualStateManager::GoToState(*this, L"Connected", false);
            }
        else
        {
            VisualStateManager::GoToState(*this, L"Disconnected", false);
        }
   }

The documentation for this struct was generated from the following files:
  • WebSocket/cppwinrt/Scenario2_Binary.h
  • WebSocket/cppwinrt/Scenario2_Binary.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ChangePIN Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_ChangePIN
Public Member Functions

Scenario2_ChangePIN Struct Reference

#include "Scenario2_ChangePIN.h"

List of all members.

Public Member Functions

Scenario2_ChangePIN ()
fire_and_forget ChangePin_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 20 of file Scenario2_ChangePIN.h.

Constructor & Destructor Documentation

Scenario2_ChangePIN ( )

Definition at line 26 of file Scenario2_ChangePIN.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget ChangePin_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario2_ChangePIN.h
  • SmartCard/cppwinrt/Scenario2_ChangePIN.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Client Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Client
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Client Struct Reference

#include "Scenario2_Client.h"

List of all members.

Public Member Functions

Scenario2_Client ()
fire_and_forget | CharacteristicList_SelectionChanged ()
fire_and_forget | CharacteristicReadButton_Click ()
fire_and_forget | CharacteristicWriteButton_Click ()
fire_and_forget | CharacteristicWriteButtonInt_Click ()
fire_and_forget | ConnectButton_Click ()
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ServiceList_SelectionChanged ()
fire_and_forget | ValueChangedSubscribeToggle_Click ()

Private Member Functions

void | AddValueChangedHandler ()
fire_and_forget | Characteristic_ValueChanged (Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const &, Windows::Devices::Bluetooth::GenericAttributeProfile::GattValueChangedEventArgs args)
Windows::Foundation::IAsyncOperation
< bool > 		ClearBluetoothLEDeviceAsync ()
void | EnableCharacteristicPanels (Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristicProperties properties)
hstring | FormatValueByPresentation (Windows::Storage::Streams::IBuffer const &buffer, Windows::Devices::Bluetooth::GenericAttributeProfile::GattPresentationFormat const &format)
void | RemoveValueChangedHandler ()
Windows::Foundation::IAsyncOperation
< bool > 		WriteBufferToSelectedCharacteristicAsync (Windows::Storage::Streams::IBuffer buffer)

Private Attributes

event_token | notificationsToken

Detailed Description

Definition at line 19 of file Scenario2_Client.h.

Constructor & Destructor Documentation

Scenario2_Client ( )

Definition at line 118 of file Scenario2_Client.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AddValueChangedHandler ( ) [private]

Definition at line 289 of file Scenario2_Client.cpp.

    {
        ValueChangedSubscribeToggle().Content(box_value(L"Unsubscribe from value changes"));
        if (!notificationsToken)
        {
            registeredCharacteristic = selectedCharacteristic;
            notificationsToken = registeredCharacteristic.ValueChanged({ get_weak(), &Scenario2_Client::Characteristic_ValueChanged });
        }
    }

fire_and_forget Characteristic_ValueChanged | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const & | ,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattValueChangedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget CharacteristicList_SelectionChanged ( )

Definition at line 308 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        auto selectedItem = CharacteristicList().SelectedItem().as<ComboBoxItem>();
        selectedCharacteristic = selectedItem ? selectedItem.Tag().as<GattCharacteristic>() : nullptr;

        if (selectedCharacteristic == nullptr)
        {
            EnableCharacteristicPanels(GattCharacteristicProperties::None);
            rootPage.NotifyUser(L"No characteristic selected", NotifyType::ErrorMessage);
            co_return;
        }

        // Get all the child descriptors of a characteristics. Use the cache mode to specify uncached descriptors only
        // and the new Async functions to get the descriptors of unpaired devices as well.
        GattDescriptorsResult result = co_await selectedCharacteristic.GetDescriptorsAsync(BluetoothCacheMode::Uncached);
        if (result.Status() != GattCommunicationStatus::Success)
        {
            rootPage.NotifyUser(L"Descriptor read failure: " + to_hstring(result.Status()), NotifyType::ErrorMessage);
        }

        // BT_Code: There's no need to access presentation format unless there's at least one.
        presentationFormat = nullptr;
        if (selectedCharacteristic.PresentationFormats().Size() > 0)
        {

            if (selectedCharacteristic.PresentationFormats().Size() == 1)
            {
                // Get the presentation format since there's only one way of presenting it
                presentationFormat = selectedCharacteristic.PresentationFormats().GetAt(0);
            }
            else
            {
                // It's difficult to figure out how to split up a characteristic and encode its different parts properly.
                // In this case, we'll just encode the whole thing to a string to make it easy to print out.
            }
        }

        // Enable/disable operations based on the GattCharacteristicProperties.
        EnableCharacteristicPanels(selectedCharacteristic.CharacteristicProperties());
    }

fire_and_forget CharacteristicReadButton_Click ( )

Definition at line 365 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        // BT_Code: Read the actual value from the device by using Uncached.
        GattReadResult result = co_await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode::Uncached);
        if (result.Status() == GattCommunicationStatus::Success)
        {
            rootPage.NotifyUser(L"Read result: " + FormatValueByPresentation(result.Value(), presentationFormat), NotifyType::StatusMessage);
        }
        else
        {
            rootPage.NotifyUser(L"Read failed: Status = " + to_hstring(result.Status()), NotifyType::ErrorMessage);
        }
    }

fire_and_forget CharacteristicWriteButton_Click ( )

Definition at line 381 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        hstring text = CharacteristicWriteValue().Text();
        if (!text.empty())
        {
            IBuffer writeBuffer = CryptographicBuffer::ConvertStringToBinary(CharacteristicWriteValue().Text(), BinaryStringEncoding::Utf8);

            co_await WriteBufferToSelectedCharacteristicAsync(writeBuffer);
        }
        else
        {
            rootPage.NotifyUser(L"No data to write to device", NotifyType::ErrorMessage);
        }
    }

fire_and_forget CharacteristicWriteButtonInt_Click ( )

Definition at line 398 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        int32_t readValue;
        if (TryParseInt(CharacteristicWriteValue().Text().begin(), readValue))
        {
            DataWriter writer;
            writer.ByteOrder(ByteOrder::LittleEndian);
            writer.WriteInt32(readValue);

            co_await WriteBufferToSelectedCharacteristicAsync(writer.DetachBuffer());
        }
        else
        {
            rootPage.NotifyUser(L"Data to write has to be an int32", NotifyType::ErrorMessage);
        }
    }

IAsyncOperation< bool > ClearBluetoothLEDeviceAsync ( ) [private]

Definition at line 143 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        if (notificationsToken)
        {
            // Need to clear the CCCD from the remote device so we stop receiving notifications
            GattCommunicationStatus result = co_await registeredCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue::None);
            if (result != GattCommunicationStatus::Success)
            {
                co_return false;
            }
            else
            {
                selectedCharacteristic.ValueChanged(std::exchange(notificationsToken, {}));
            }
        }

        if (bluetoothLeDevice != nullptr)
        {
            bluetoothLeDevice.Close();
            bluetoothLeDevice = nullptr;
        }
        co_return true;
    }

fire_and_forget ConnectButton_Click ( )

Definition at line 169 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        ConnectButton().IsEnabled(false);

        if (!co_await ClearBluetoothLEDeviceAsync())
        {
            rootPage.NotifyUser(L"Error: Unable to reset state, try again.", NotifyType::ErrorMessage);
            ConnectButton().IsEnabled(true);
            co_return;
        }

        try
        {
            // BT_Code: BluetoothLEDevice.FromIdAsync must be called from a UI thread because it may prompt for consent.
            bluetoothLeDevice = co_await BluetoothLEDevice::FromIdAsync(SampleState::SelectedBleDeviceId);

            if (bluetoothLeDevice == nullptr)
            {
                rootPage.NotifyUser(L"Failed to connect to device.", NotifyType::ErrorMessage);
            }
        }
        catch (hresult_error& ex)
        {
            if (ex.to_abi() == HRESULT_FROM_WIN32(ERROR_DEVICE_NOT_AVAILABLE))
            {
                rootPage.NotifyUser(L"Bluetooth radio is not on.", NotifyType::ErrorMessage);
            }
            else
            {
                throw;
            }
        }

        if (bluetoothLeDevice != nullptr)
        {
            // Note: BluetoothLEDevice.GattServices property will return an empty list for unpaired devices. For all uses we recommend using the GetGattServicesAsync method.
            // BT_Code: GetGattServicesAsync returns a list of all the supported services of the device (even if it's not paired to the system).
            // If the services supported by the device are expected to change during BT usage, subscribe to the GattServicesChanged event.
            GattDeviceServicesResult result = co_await bluetoothLeDevice.GetGattServicesAsync(BluetoothCacheMode::Uncached);

            if (result.Status() == GattCommunicationStatus::Success)
            {
                IVectorView<GattDeviceService> services = result.Services();
                rootPage.NotifyUser(L"Found " + to_hstring(services.Size()) + L" services", NotifyType::StatusMessage);
                for (auto&& service : services)
                {
                    ComboBoxItem item;
                    item.Content(box_value(DisplayHelpers::GetServiceName(service)));
                    item.Tag(service);
                    ServiceList().Items().Append(item);
                }
                ConnectButton().Visibility(Visibility::Collapsed);
                ServiceList().Visibility(Visibility::Visible);
            }
            else
            {
                rootPage.NotifyUser(L"Device unreachable", NotifyType::ErrorMessage);
            }
        }
        ConnectButton().IsEnabled(true);
    }

void EnableCharacteristicPanels ( Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristicProperties properties ) [private]
hstring FormatValueByPresentation | ( | Windows::Storage::Streams::IBuffer const & | buffer,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattPresentationFormat const & | format |
 | ) |  |  | [private]
fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void RemoveValueChangedHandler ( ) [private]

Definition at line 298 of file Scenario2_Client.cpp.

    {
        ValueChangedSubscribeToggle().Content(box_value(L"Subscribe to value changes"));
        if (notificationsToken)
        {
            registeredCharacteristic.ValueChanged(std::exchange(notificationsToken, {}));
            registeredCharacteristic = nullptr;
        }
    }

fire_and_forget ServiceList_SelectionChanged ( )

Definition at line 234 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        auto selectedItem = ServiceList().SelectedItem().as<ComboBoxItem>();
        GattDeviceService service = selectedItem ? selectedItem.Tag().as<GattDeviceService>() : nullptr;

        CharacteristicList().Items().Clear();
        RemoveValueChangedHandler();

        IVectorView<GattCharacteristic> characteristics{ nullptr };
        try
        {
            // Ensure we have access to the device.
            auto accessStatus = co_await service.RequestAccessAsync();
            if (accessStatus == DeviceAccessStatus::Allowed)
            {
                // BT_Code: Get all the child characteristics of a service. Use the cache mode to specify uncached characterstics only
                // and the new Async functions to get the characteristics of unpaired devices as well.
                GattCharacteristicsResult result = co_await service.GetCharacteristicsAsync(BluetoothCacheMode::Uncached);
                if (result.Status() == GattCommunicationStatus::Success)
                {
                    characteristics = result.Characteristics();
                }
                else
                {
                    rootPage.NotifyUser(L"Error accessing service.", NotifyType::ErrorMessage);
                }
            }
            else
            {
                // Not granted access
                rootPage.NotifyUser(L"Error accessing service.", NotifyType::ErrorMessage);

            }
        }
        catch (hresult_error& ex)
        {
            rootPage.NotifyUser(L"Restricted service. Can't read characteristics: " + ex.message(), NotifyType::ErrorMessage);
        }

        if (characteristics)
        {
            for (GattCharacteristic&& c : characteristics)
            {
                ComboBoxItem item;
                item.Content(box_value(DisplayHelpers::GetCharacteristicName(c)));
                item.Tag(c);
                CharacteristicList().Items().Append(item);
            }
        }
        CharacteristicList().Visibility(Visibility::Visible);
    }

fire_and_forget ValueChangedSubscribeToggle_Click ( )

Definition at line 454 of file Scenario2_Client.cpp.

    {
        auto lifetime = get_strong();

        if (!notificationsToken)
        {
            GattClientCharacteristicConfigurationDescriptorValue cccdValue = GattClientCharacteristicConfigurationDescriptorValue::None;
            if ((selectedCharacteristic.CharacteristicProperties() & GattCharacteristicProperties::Indicate) != GattCharacteristicProperties::None)
            {
                cccdValue = GattClientCharacteristicConfigurationDescriptorValue::Indicate;
            }

            else if ((selectedCharacteristic.CharacteristicProperties() & GattCharacteristicProperties::Notify) != GattCharacteristicProperties::None)
            {
                cccdValue = GattClientCharacteristicConfigurationDescriptorValue::Notify;
            }

            try
            {
                // BT_Code: Must write the CCCD in order for server to send indications.
                // We receive them in the ValueChanged event handler.
                GattCommunicationStatus status = co_await selectedCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(cccdValue);

                if (status == GattCommunicationStatus::Success)
                {
                    AddValueChangedHandler();
                    rootPage.NotifyUser(L"Successfully subscribed for value changes", NotifyType::StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser(L"Error registering for value changes: Status = " + to_hstring(status), NotifyType::ErrorMessage);
                }
            }
            catch (hresult_access_denied& ex)
            {
                // This usually happens when a device reports that it support indicate, but it actually doesn't.
                rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            }
        }
        else
        {
            try
            {
                // BT_Code: Must write the CCCD in order for server to send notifications.
                // We receive them in the ValueChanged event handler.
                // Note that this sample configures either Indicate or Notify, but not both.
                GattCommunicationStatus result = co_await
                    selectedCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
                        GattClientCharacteristicConfigurationDescriptorValue::None);
                if (result == GattCommunicationStatus::Success)
                {
                    RemoveValueChangedHandler();
                    rootPage.NotifyUser(L"Successfully un-registered for notifications", NotifyType::StatusMessage);
                }
                else
                {
                    rootPage.NotifyUser(L"Error un-registering for notifications: Status = " + to_hstring(result), NotifyType::ErrorMessage);
                }
            }
            catch (hresult_access_denied& ex)
            {
                // This usually happens when a device reports that it support notify, but it actually doesn't.
                rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            }
        }
    }

Windows::Foundation::IAsyncOperation<bool> WriteBufferToSelectedCharacteristicAsync ( Windows::Storage::Streams::IBuffer buffer ) [private]

Member Data Documentation

event_token notificationsToken [private]

Definition at line 35 of file Scenario2_Client.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/Scenario2_Client.h
  • BluetoothLE/cppwinrt/Scenario2_Client.cpp
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Connector Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Connector
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Connector Struct Reference

#include "Scenario2_Connector.h"

List of all members.

Public Member Functions

Scenario2_Connector ()
void | btnClose_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | btnFromId_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnIe_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | btnSendMessage_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | btnUnpair_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnWatcher_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
auto | ConnectedDevices ()
auto | DiscoveredDevices ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | OnConnectionStatusChanged (Windows::Devices::WiFiDirect::WiFiDirectDevice const &sender, Windows::Foundation::IInspectable const &)
fire_and_forget | OnDeviceAdded (Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformation deviceInfo)
fire_and_forget | OnDeviceRemoved (Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
fire_and_forget | OnDeviceUpdated (Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate)
void | OnEnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Foundation::IInspectable const &)
void | OnStopped (Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Foundation::IInspectable const &)
void | StopWatcher ()

Private Attributes

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher | publisher
event_token | watcherAddedToken
event_token | watcherEnumerationCompletedToken
event_token | watcherRemovedToken
event_token | watcherStoppedToken
event_token | watcherUpdatedToken

Detailed Description

Definition at line 18 of file Scenario2_Connector.h.

Constructor & Destructor Documentation

Scenario2_Connector ( )

Definition at line 35 of file Scenario2_Connector.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void btnClose_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget btnFromId_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnIe_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget btnSendMessage_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget btnUnpair_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnWatcher_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
auto ConnectedDevices ( ) [inline]

Definition at line 25 of file Scenario2_Connector.h.

{ return connectedDevices; }

auto DiscoveredDevices ( ) [inline]

Definition at line 24 of file Scenario2_Connector.h.

{ return discoveredDevices; }

void OnConnectionStatusChanged | ( | Windows::Devices::WiFiDirect::WiFiDirectDevice const & | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget OnDeviceAdded | ( | Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | Windows::Devices::Enumeration::DeviceInformation | deviceInfo |
 | ) |  |  | [private]
fire_and_forget OnDeviceRemoved | ( | Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
fire_and_forget OnDeviceUpdated | ( | Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInfoUpdate |
 | ) |  |  | [private]
void OnEnumerationCompleted | ( | Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnStopped | ( | Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void StopWatcher ( ) [private]

Definition at line 48 of file Scenario2_Connector.cpp.

    {
        deviceWatcher.Added(watcherAddedToken);
        deviceWatcher.Removed(watcherRemovedToken);
        deviceWatcher.Updated(watcherUpdatedToken);
        deviceWatcher.EnumerationCompleted(watcherEnumerationCompletedToken);
        deviceWatcher.Stopped(watcherStoppedToken);

        deviceWatcher.Stop();
        deviceWatcher = nullptr;
    }

Member Data Documentation

Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher publisher [private]

Definition at line 35 of file Scenario2_Connector.h.

event_token watcherAddedToken [private]

Definition at line 39 of file Scenario2_Connector.h.

event_token watcherEnumerationCompletedToken [private]

Definition at line 45 of file Scenario2_Connector.h.

event_token watcherRemovedToken [private]

Definition at line 43 of file Scenario2_Connector.h.

event_token watcherStoppedToken [private]

Definition at line 46 of file Scenario2_Connector.h.

event_token watcherUpdatedToken [private]

Definition at line 44 of file Scenario2_Connector.h.

The documentation for this struct was generated from the following files:
  • WiFiDirect/cppwinrt/Scenario2_Connector.h
  • WiFiDirect/cppwinrt/Scenario2_Connector.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DecimalFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_DecimalFormatting
Public Member Functions

Scenario2_DecimalFormatting Struct Reference

#include "Scenario2_DecimalFormatting.h"

List of all members.

Public Member Functions

Scenario2_DecimalFormatting ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_DecimalFormatting.h.

Constructor & Destructor Documentation

Scenario2_DecimalFormatting ( )

Definition at line 23 of file Scenario2_DecimalFormatting.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.h
  • NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DetectInWebcam Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_DetectInWebcam
Public Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario2_DetectInWebcam Struct Reference

#include "Scenario2_DetectInWebcam.h"

List of all members.

Public Member Functions

Scenario2_DetectInWebcam ()
fire_and_forget | CameraSnapshotButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | CameraStreamingButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | SnapshotCanvas_SizeChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e)

Private Types

enum | ScenarioState { Idle, Streaming, Snapshot }

Private Member Functions

fire_and_forget | AbandonStreaming ()
Windows::Foundation::IAsyncAction | ChangeScenarioStateAsync (ScenarioState newState)
fire_and_forget | MediaCapture_CameraStreamStateChanged (Windows::Media::Capture::MediaCapture const &sender, Windows::Foundation::IInspectable const &args)
fire_and_forget | OnSuspending (Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e)
void | SetupVisualization (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces)
Windows::Foundation::IAsyncAction | ShutdownWebcamAsync ()
Windows::Foundation::IAsyncOperation
< bool > 		StartWebcamStreamingAsync ()
Windows::Foundation::IAsyncOperation
< bool > 		TakeSnapshotAndFindFacesAsync ()

Private Attributes

ScenarioState | currentState = ScenarioState::Idle
event_token | suspendingEventToken

Detailed Description

Definition at line 19 of file Scenario2_DetectInWebcam.h.

Member Enumeration Documentation

enum ScenarioState [private]
Enumerator:
Idle
Streaming
Snapshot

Definition at line 32 of file Scenario2_DetectInWebcam.h.

        {
            // Display is blank - default state.
            Idle,

            // Webcam is actively engaged and a live video stream is displayed.
            Streaming,

            // Snapshot image has been captured and is being displayed along with detected faces; webcam is not active.
            Snapshot,
        };

Constructor & Destructor Documentation

Scenario2_DetectInWebcam ( )

Definition at line 33 of file Scenario2_DetectInWebcam.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget AbandonStreaming ( ) [private]
fire_and_forget CameraSnapshotButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget CameraStreamingButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
IAsyncAction ChangeScenarioStateAsync ( ScenarioState newState ) [private]

Definition at line 200 of file Scenario2_DetectInWebcam.cpp.

    {
        auto lifetime = get_strong();

        switch (newState)
        {
        case ScenarioState::Idle:

            CameraSnapshotButton().IsEnabled(false);
            currentState = newState;
            co_await ShutdownWebcamAsync();

            SnapshotCanvas().Background(nullptr);
            SnapshotCanvas().Children().Clear();
            CameraStreamingButton().Content(box_value(L"Start Streaming"));
            CameraSnapshotButton().Content(box_value(L"Take Snapshot"));
            break;

        case ScenarioState::Streaming:

            if (!co_await StartWebcamStreamingAsync())
            {
                co_await ChangeScenarioStateAsync(ScenarioState::Idle);
                break;
            }

            SnapshotCanvas().Background(nullptr);
            SnapshotCanvas().Children().Clear();
            CameraSnapshotButton().IsEnabled(true);
            CameraStreamingButton().Content(box_value(L"Stop Streaming"));
            CameraSnapshotButton().Content(box_value(L"Take Snapshot"));
            currentState = newState;
            break;

        case ScenarioState::Snapshot:

            if (!co_await TakeSnapshotAndFindFacesAsync())
            {
                co_await ChangeScenarioStateAsync(ScenarioState::Idle);
                break;
            }

            co_await ShutdownWebcamAsync();

            CameraSnapshotButton().IsEnabled(true);
            CameraStreamingButton().Content(box_value(L"Start Streaming"));
            CameraSnapshotButton().Content(box_value(L"Clear Display"));
            currentState = newState;
            break;
        }
    }

fire_and_forget MediaCapture_CameraStreamStateChanged | ( | Windows::Media::Capture::MediaCapture const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnSuspending | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs const & | e |
 | ) |  |  | [private]
void SetupVisualization | ( | Windows::UI::Xaml::Media::Imaging::WriteableBitmap const & | displaySource,
 |  | Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const & | foundFaces |
 | ) |  |  | [private]
IAsyncAction ShutdownWebcamAsync ( ) [private]

Definition at line 112 of file Scenario2_DetectInWebcam.cpp.

    {
        auto lifetime = get_strong();

        if (agileMediaCapture)
        {
            auto mediaCapture = agileMediaCapture.get();
            if (mediaCapture.CameraStreamState() == Windows::Media::Devices::CameraStreamState::Streaming)
            {
                try
                {
                    co_await mediaCapture.StopPreviewAsync();
                }
                catch (hresult_error const&)
                {
                    // Since we're going to destroy the MediaCapture object there's nothing to do here
                }
            }
            mediaCapture.Close();
        }

        CamPreview().Source(nullptr);
        agileMediaCapture = nullptr;
    }

void SnapshotCanvas_SizeChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::SizeChangedEventArgs const & | e
 | ) |  |
IAsyncOperation< bool > StartWebcamStreamingAsync ( ) [private]

Definition at line 64 of file Scenario2_DetectInWebcam.cpp.

    {
        auto lifetime = get_strong();

        bool successful;

        faceDetector = co_await FaceDetector::CreateAsync();
        try
        {
            MediaCapture mediaCapture;
            agileMediaCapture = mediaCapture;
            MediaCaptureInitializationSettings settings;

            // For this scenario, we only need Video (not microphone) so specify this in the initializer.
            // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
            // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
            settings.StreamingCaptureMode(StreamingCaptureMode::Video);

            co_await mediaCapture.InitializeAsync(settings);
            mediaCapture.CameraStreamStateChanged({ get_weak(), &Scenario2_DetectInWebcam::MediaCapture_CameraStreamStateChanged });

            // Cache the media properties as we'll need them later.
            auto deviceController = mediaCapture.VideoDeviceController();
            videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType::VideoPreview).as<VideoEncodingProperties>();

            // Immediately start streaming to our CaptureElement UI.
            // NOTE: CaptureElement's Source must be set before streaming is started.
            CamPreview().Source(mediaCapture);
            co_await mediaCapture.StartPreviewAsync();

            successful = true;
        }
        catch (hresult_access_denied const&)
        {
            // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
            rootPage.NotifyUser(L"Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType::ErrorMessage);
            successful = false;
        }
        catch (hresult_error const& ex)
        {
            rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            successful = false;
        }

        co_return successful;
    }

IAsyncOperation< bool > TakeSnapshotAndFindFacesAsync ( ) [private]

Definition at line 138 of file Scenario2_DetectInWebcam.cpp.

    {
        auto lifetime = get_strong();

        if (currentState != ScenarioState::Streaming)
        {
            co_return false;
        }

        bool successful = false;

        try
        {
            // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
            // GetPreviewFrame will convert the native webcam frame into this format.
            static constexpr BitmapPixelFormat InputPixelFormat = BitmapPixelFormat::Nv12;
            VideoFrame previewFrame(InputPixelFormat, (int)videoProperties.Width(), (int)videoProperties.Height());

            co_await agileMediaCapture.get().GetPreviewFrameAsync(previewFrame);

            // The returned VideoFrame should be in the supported NV12 format but we need to verify
            if (FaceDetector::IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap().BitmapPixelFormat()))
            {
                IVector<DetectedFace> faces = co_await faceDetector.DetectFacesAsync(previewFrame.SoftwareBitmap());

                // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to wb's buffer.
                // Note that WriteableBitmap doesn't support NV12 and we have to convert it to 32-bit BGRA.
                SoftwareBitmap convertedSource = SoftwareBitmap::Convert(previewFrame.SoftwareBitmap(), BitmapPixelFormat::Bgra8);
                WriteableBitmap displaySource(convertedSource.PixelWidth(), convertedSource.PixelHeight());
                convertedSource.CopyToBuffer(displaySource.PixelBuffer());

                // Create our display using the available image and face results.
                SetupVisualization(displaySource, faces);

                successful = true;
            }
            else
            {
                rootPage.NotifyUser(L"PixelFormat 'NV12' is not supported by FaceDetector", NotifyType::ErrorMessage);
            }
        }
        catch (hresult_error const& ex)
        {
            rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
        }

        co_return successful;
    }

Member Data Documentation

ScenarioState currentState = ScenarioState::Idle [private]

Definition at line 49 of file Scenario2_DetectInWebcam.h.

event_token suspendingEventToken [private]

Definition at line 52 of file Scenario2_DetectInWebcam.h.

The documentation for this struct was generated from the following files:
  • BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.h
  • BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_DeviceWatcher
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_DeviceWatcher Struct Reference

#include "Scenario2_DeviceWatcher.h"

List of all members.

Public Member Functions

Scenario2_DeviceWatcher ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | StartWatcher ()
void | StopWatcher ()

Private Attributes

com_ptr< DeviceWatcherHelper > | deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher())
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 20 of file Scenario2_DeviceWatcher.h.

Constructor & Destructor Documentation

Scenario2_DeviceWatcher ( )

Definition at line 27 of file Scenario2_DeviceWatcher.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void StartWatcher ( ) [private]

Definition at line 55 of file Scenario2_DeviceWatcher.cpp.

    {
        startWatcherButton().IsEnabled(false);
        resultCollection.Clear();

        // First get the device selector chosen by the UI.
        IInspectable item = selectorComboBox().SelectedItem();
        DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(item);

        DeviceWatcher deviceWatcher{ nullptr };
        if (deviceSelectorInfo->Selector().empty())
        {
            // If the a pre-canned device class selector was chosen, call the DeviceClass overload
            deviceWatcher = DeviceInformation::CreateWatcher(deviceSelectorInfo->DeviceClassSelector());
        }
        else if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
        {
            // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
            // Kind will be determined by the selector
            deviceWatcher = DeviceInformation::CreateWatcher(
                deviceSelectorInfo->Selector(),
                nullptr // don't request additional properties for this sample
            );
        }
        else
        {
            // Kind is specified in the selector info
            deviceWatcher = DeviceInformation::CreateWatcher(
                deviceSelectorInfo->Selector(),
                nullptr, // don't request additional properties for this sample
                deviceSelectorInfo->Kind());
        }

        rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
        deviceWatcherHelper->StartWatcher(deviceWatcher);
        stopWatcherButton().IsEnabled(true);
    }

void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcher ( ) [private]

Definition at line 93 of file Scenario2_DeviceWatcher.cpp.

    {
        stopWatcherButton().IsEnabled(false);
        deviceWatcherHelper->StopWatcher();
        startWatcherButton().IsEnabled(true);
    }

void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

com_ptr<DeviceWatcherHelper> deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher()) [private]

Definition at line 33 of file Scenario2_DeviceWatcher.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 32 of file Scenario2_DeviceWatcher.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Disable Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Disable
Public Member Functions

Scenario2_Disable Struct Reference

#include "Scenario2_Disable.h"

List of all members.

Public Member Functions

Scenario2_Disable ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_Disable.h.

Constructor & Destructor Documentation

Scenario2_Disable ( )

Definition at line 23 of file Scenario2_Disable.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
The documentation for this struct was generated from the following files:
  • DisablingScreenCapture/cppwinrt/Scenario2_Disable.h
  • DisablingScreenCapture/cppwinrt/Scenario2_Disable.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DisplayRegion Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_DisplayRegion
Public Member Functions | Private Member Functions

Scenario2_DisplayRegion Struct Reference

#include "Scenario2_DisplayRegion.h"

List of all members.

Public Member Functions

Scenario2_DisplayRegion ()
fire_and_forget | Button_Click (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

Windows::UI::WindowManagement::DisplayRegion | GetOtherDisplayRegion (Windows::UI::WindowManagement::DisplayRegion currentAppDisplayRegion)
int | NumberOfAvailableDisplayRegions ()
void | OnWindowClosed (Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &)

Detailed Description

Definition at line 18 of file Scenario2_DisplayRegion.h.

Constructor & Destructor Documentation

Scenario2_DisplayRegion ( )

Definition at line 28 of file Scenario2_DisplayRegion.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Button_Click | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
Windows::UI::WindowManagement::DisplayRegion GetOtherDisplayRegion ( Windows::UI::WindowManagement::DisplayRegion currentAppDisplayRegion ) [private]
int NumberOfAvailableDisplayRegions ( ) [private]

Definition at line 48 of file Scenario2_DisplayRegion.cpp.

    {
        // Get the list of all DisplayRegions defined for the WindowingEnvironment that our application is currently in
        IVectorView<DisplayRegion> displayRegions = ApplicationView::GetForCurrentView().WindowingEnvironment().GetDisplayRegions();

        int availableDisplayRegions = 0;
        // count all the DisplayRegions that are marked as available to the app for use.
        for (DisplayRegion const& displayregion : displayRegions)
        {
            if (displayregion.IsVisible())
            {
                availableDisplayRegions++;
            }
        }
        return availableDisplayRegions;
    }

fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnWindowClosed | ( | Windows::UI::WindowManagement::AppWindow const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/Scenario2_DisplayRegion.h
  • AppWindow/cppwinrt/Scenario2_DisplayRegion.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_DocumentFonts Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_DocumentFonts
Public Member Functions

Scenario2_DocumentFonts Struct Reference

#include "Scenario2_DocumentFonts.h"

List of all members.

Public Member Functions

Scenario2_DocumentFonts ()
void ApplyFonts_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_DocumentFonts.h.

Constructor & Destructor Documentation

Scenario2_DocumentFonts ( )

Definition at line 24 of file Scenario2_DocumentFonts.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ApplyFonts_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LanguageFont/cppwinrt/Scenario2_DocumentFonts.h
  • LanguageFont/cppwinrt/Scenario2_DocumentFonts.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Effects Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Effects
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario2_Effects Struct Reference

#include "Scenario2_Effects.h"

List of all members.

Public Member Functions

Scenario2_Effects ()
void | CustomEffectButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | CycleButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | FadeButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | GeneratedBitmapButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | PauseButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | PlayButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
winrt::fire_and_forget | StaticBitmapButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopButton_Click (winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | CleanupPreviousEffect ()
winrt::fire_and_forget | LampArray_AvailabilityChanged (winrt::Windows::Devices::Lights::LampArray const &sender, winrt::Windows::Foundation::IInspectable const &)
void | StartStopAllEffects (bool shouldStart)
void | UpdateLampArrayList ()
winrt::fire_and_forget | Watcher_Added (winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformation const &deviceInformation)
winrt::fire_and_forget | Watcher_Removed (winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformationUpdate deviceInformationUpdate)

Static Private Member Functions

static void | CustomEffect_UpdateRequested (CustomEffectState *state, winrt::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs const &args)
static void | GeneratedBitmapEffect_UpdateRequested (GeneratedBitmapState *state, winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const &args)
static std::vector< int > | GetLampArrayIndices (winrt::Windows::Devices::Lights::LampArray const &lampArray)
static void | StaticBitmapEffect_BitmapRequested (winrt::Windows::Graphics::Imaging::SoftwareBitmap const &bitmap, winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const &args)

Private Attributes

std::vector< std::unique_ptr
< LampArrayInfo > > 		m_attachedLampArrays
winrt::Windows::Foundation::Collections::IVectorView
< winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist > 		m_emptyList
winrt::Windows::Foundation::Collections::IVectorView
< winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist > 		m_readyPlaylists = m_emptyList

Detailed Description

Definition at line 61 of file Scenario2_Effects.h.

Constructor & Destructor Documentation

Scenario2_Effects ( )

Definition at line 42 of file Scenario2_Effects.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void CleanupPreviousEffect ( ) [private]

Definition at line 144 of file Scenario2_Effects.cpp.

    {
        // Clear the bitmap image in the app UI, as it is no longer current.
        ImageBitmap().Source(nullptr);

        // Passing all the playlists to a single call to StopAll will stop them
        // simultaneously across all attached LampArrays.
        LampArrayEffectPlaylist::StopAll(m_readyPlaylists);
        m_readyPlaylists = m_emptyList;
    }

void CustomEffect_UpdateRequested | ( | CustomEffectState * | state,
 |  | winrt::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs const & | args |
 | ) |  |  | [static, private]

Definition at line 378 of file Scenario2_Effects.cpp.

    {
        // Update the Lamp colors for the current frame. Start by calculating how far into the current iteration we are.
        // We will use this to mark how far across the LampArray bounding box the effect has reached.
        double effectProgress = ((state->frameNumber + 1) / static_cast<double>(CustomEffectFrameCount));

        // If Lamps were being turned off in the previous iteration, turn them on now, and vice versa.
        Color color = state->isColorOn ? state->color : Colors::Black();

        for (unsigned i = 0; i < state->lampNormalizedX.size(); i++)
        {
            // All Lamps that are to the left of our marker (normalized to the LampArray bounding box width)
            // should have their states updated.
            if (state->lampNormalizedX[i] <= effectProgress)
            {
                state->lampColors[i] = color;
            }
        }

        // Apply the Lamp states to the LampArray.
        args.SetColorsForIndices(state->lampColors, GetLampArrayIndices(state->lampArray));

        // Increment our frame counter, with wraparound if we've reached the frame limit.
        // Also update whether the lamps should be turned on or off for the next iteration.
        if (++state->frameNumber == CustomEffectFrameCount)
        {
            state->frameNumber = 0;
            state->isColorOn = !state->isColorOn;
        }
    }

void CustomEffectButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void CycleButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void FadeButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void GeneratedBitmapButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
static void GeneratedBitmapEffect_UpdateRequested | ( | GeneratedBitmapState * | state,
 |  | winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const & | args |
 | ) |  |  | [static, private]
std::vector< int > GetLampArrayIndices ( winrt::Windows::Devices::Lights::LampArray const & lampArray ) [static, private]

Definition at line 600 of file Scenario2_Effects.cpp.

    {
        std::vector<int> indices(lampArray.LampCount());
        std::iota(indices.begin(), indices.end(), 0);
        return indices;
    }

winrt::fire_and_forget LampArray_AvailabilityChanged | ( | winrt::Windows::Devices::Lights::LampArray const & | sender,
 |  | winrt::Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void PauseButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void PlayButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StartStopAllEffects ( bool shouldStart ) [private]
winrt::fire_and_forget StaticBitmapButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
static void StaticBitmapEffect_BitmapRequested | ( | winrt::Windows::Graphics::Imaging::SoftwareBitmap const & | bitmap,
 |  | winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const & | args |
 | ) |  |  | [static, private]
void StopButton_Click | ( | winrt::Windows::Foundation::IInspectable const & | sender,
 |  | winrt::Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateLampArrayList ( ) [private]

Definition at line 128 of file Scenario2_Effects.cpp.

    {
        std::wstring message = std::wstring(L"Attached LampArrays: ") + std::to_wstring(m_attachedLampArrays.size()) + L"\n";

        for (auto&& info : m_attachedLampArrays)
        {
            message += L"\t" + info->displayName + L" ("
                + std::to_wstring(info->lampArray.LampArrayKind()) + L", " + std::to_wstring(info->lampArray.LampCount()) + L" lamps, "
                + std::wstring(info->lampArray.IsAvailable() ? L"Available" : L"Unavailable") + L")\n";
        }

        LampArraysSummary().Text(message);
    }

winrt::fire_and_forget Watcher_Added | ( | winrt::Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | winrt::Windows::Devices::Enumeration::DeviceInformation const & | deviceInformation |
 | ) |  |  | [private]
winrt::fire_and_forget Watcher_Removed | ( | winrt::Windows::Devices::Enumeration::DeviceWatcher const & | ,
 |  | winrt::Windows::Devices::Enumeration::DeviceInformationUpdate | deviceInformationUpdate |
 | ) |  |  | [private]

Member Data Documentation

std::vector<std::unique_ptr<LampArrayInfo> > m_attachedLampArrays [private]

Definition at line 102 of file Scenario2_Effects.h.

winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist> m_emptyList [private]
Initial value:
            winrt::single_threaded_vector< winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist>().GetView()

Definition at line 109 of file Scenario2_Effects.h.

winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist> m_readyPlaylists = m_emptyList [private]

Definition at line 113 of file Scenario2_Effects.h.

The documentation for this struct was generated from the following files:
  • LampArray/cppwinrt/Scenario2_Effects.h
  • LampArray/cppwinrt/Scenario2_Effects.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Extend Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Extend
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_Extend Struct Reference

#include "Scenario2_Extend.h"

List of all members.

Public Member Functions

Scenario2_Extend ()
void | EnableControls_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ExtendView_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | ToggleFullScreenModeButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | UpdateFullScreenModeStatus ()

Private Attributes

event_token | windowSizeChangedToken

Detailed Description

Definition at line 19 of file Scenario2_Extend.h.

Constructor & Destructor Documentation

Scenario2_Extend ( )

Definition at line 27 of file Scenario2_Extend.cpp.

    {
        InitializeComponent();

        bool isExtendedIntoTitleBar = CoreApplication::GetCurrentView().TitleBar().ExtendViewIntoTitleBar();
        ExtendView().IsChecked(isExtendedIntoTitleBar);
        EnableControls().Visibility(isExtendedIntoTitleBar ? Visibility::Visible : Visibility::Collapsed);
        EnableControls().IsChecked(SampleState::AreControlsInTitleBar());
    }

Member Function Documentation

void EnableControls_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ExtendView_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void ToggleFullScreenModeButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateFullScreenModeStatus ( ) [private]

Definition at line 92 of file Scenario2_Extend.cpp.

    {
        bool isFullScreenMode = ApplicationView::GetForCurrentView().IsFullScreenMode();
        ToggleFullScreenModeSymbol().Symbol(isFullScreenMode ? Symbol::BackToWindow : Symbol::FullScreen);
        ReportFullScreenMode().Text(isFullScreenMode ? L"is in" : L"is not in");
    }

Member Data Documentation

event_token windowSizeChangedToken [private]

Definition at line 31 of file Scenario2_Extend.h.

The documentation for this struct was generated from the following files:
  • TitleBar/cppwinrt/Scenario2_Extend.h
  • TitleBar/cppwinrt/Scenario2_Extend.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetCurrentTextSegmentFromIndex Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_GetCurrentTextSegmentFromIndex
Public Member Functions

Scenario2_GetCurrentTextSegmentFromIndex Struct Reference

#include "Scenario2_GetCurrentTextSegmentFromIndex.h"

List of all members.

Public Member Functions

Scenario2_GetCurrentTextSegmentFromIndex ()
void | SelectionSegmentButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | WordSegmentButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_GetCurrentTextSegmentFromIndex.h.

Constructor & Destructor Documentation

Scenario2_GetCurrentTextSegmentFromIndex ( )

Definition at line 22 of file Scenario2_GetCurrentTextSegmentFromIndex.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void SelectionSegmentButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void WordSegmentButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.h
  • TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_GetPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_GetPosition
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_GetPosition Struct Reference

#include "Scenario2_GetPosition.h"

List of all members.

Public Member Functions

Scenario2_GetPosition ()
void | CancelGetGeolocationButtonClicked (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetGeolocationButtonClicked (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

void | ShowSatelliteData (bool isVisible)
void | UpdateLocationData (Windows::Devices::Geolocation::Geoposition const &position)

Private Attributes

Windows::Foundation::IAsyncOperation
< Windows::Devices::Geolocation::Geoposition > 		m_pendingOperation

Detailed Description

Definition at line 18 of file Scenario2_GetPosition.h.

Constructor & Destructor Documentation

Scenario2_GetPosition ( )

Definition at line 25 of file Scenario2_GetPosition.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void CancelGetGeolocationButtonClicked | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GetGeolocationButtonClicked | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void ShowSatelliteData ( bool isVisible ) [private]

Definition at line 151 of file Scenario2_GetPosition.cpp.

    {
        auto visibility = isVisible ? Visibility::Visible : Visibility::Collapsed;
        ScenarioOutput_PosPrecision().Visibility(visibility);
        ScenarioOutput_HorzPrecision().Visibility(visibility);
        ScenarioOutput_VertPrecision().Visibility(visibility);
        ScenarioOutput_GeomPrecision().Visibility(visibility);
        ScenarioOutput_TimePrecision().Visibility(visibility);
    }

void UpdateLocationData ( Windows::Devices::Geolocation::Geoposition const & position ) [private]

Member Data Documentation

Windows::Foundation::IAsyncOperation<Windows::Devices::Geolocation::Geoposition> m_pendingOperation [private]

Definition at line 28 of file Scenario2_GetPosition.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario2_GetPosition.h
  • Geolocation/cppwinrt/Scenario2_GetPosition.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Lang Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Lang
Public Member Functions

Scenario2_Lang Struct Reference

#include "Scenario2_Lang.h"

List of all members.

Public Member Functions

Scenario2_Lang ()
void ShowResults_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_Lang.h.

Constructor & Destructor Documentation

Scenario2_Lang ( )

Definition at line 36 of file Scenario2_Lang.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • GlobalizationPreferences/cppwinrt/Scenario2_Lang.h
  • GlobalizationPreferences/cppwinrt/Scenario2_Lang.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Launch Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Launch
Public Member Functions | Static Private Attributes

Scenario2_Launch Struct Reference

#include "Scenario2_Launch.h"

List of all members.

Public Member Functions

Scenario2_Launch ()
Scenario2_Launch ()
Scenario2_Launch ()
fire_and_forget | CheckIf3DBuilderIsInstalled_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | LaunchAtSize_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | LaunchFileIn3DBuilder_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | LaunchInFullScreenModeCheckBox_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Static Private Attributes

static constexpr wchar_t | PackageFamilyName3DBuilder [] = "Microsoft.3DBuilder_8wekyb3d8bbwe"

Detailed Description

Definition at line 19 of file Scenario2_Launch.h.

Constructor & Destructor Documentation

Scenario2_Launch ( )

Definition at line 27 of file Scenario2_Launch.cpp.

    {
        InitializeComponent();
    }

Scenario2_Launch ( )
Scenario2_Launch ( )

Member Function Documentation

fire_and_forget CheckIf3DBuilderIsInstalled_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void LaunchAtSize_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget LaunchFileIn3DBuilder_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void LaunchInFullScreenModeCheckBox_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

constexpr wchar_t PackageFamilyName3DBuilder[] = "Microsoft.3DBuilder_8wekyb3d8bbwe" [static, private]

Definition at line 28 of file Scenario2_Launch.h.

The documentation for this struct was generated from the following files:
  • 3DPrinting/cppwinrt/Scenario2_Launch.h
  • FullScreenMode/cppwinrt/Scenario2_Launch.h
  • ResizeAppView/cppwinrt/Scenario2_Launch.h
  • 3DPrinting/cppwinrt/Scenario2_Launch.cpp
  • FullScreenMode/cppwinrt/Scenario2_Launch.cpp
  • ResizeAppView/cppwinrt/Scenario2_Launch.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Listen Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Listen
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario2_Listen Struct Reference

#include "Scenario2_Listen.h"

List of all members.

Public Member Functions

Scenario2_Listen ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | StartStopScenario_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | Pin_ValueChanged (Windows::Devices::Gpio::GpioPin const &sender, Windows::Devices::Gpio::GpioPinValueChangedEventArgs const &e)
void | StartScenario ()
void | StopScenario ()
void | Timer_Tick (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)

Private Attributes

Windows::Devices::Gpio::GpioPinValue | currentValue = Windows::Devices::Gpio::GpioPinValue::High

Static Private Attributes

static constexpr int | LISTEN_PIN = 6
static constexpr int | SET_PIN = 5

Detailed Description

Definition at line 19 of file Scenario2_Listen.h.

Constructor & Destructor Documentation

Scenario2_Listen ( )

Definition at line 26 of file Scenario2_Listen.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Definition at line 31 of file Scenario2_Listen.cpp.

    {
        StopScenario();
    }

fire_and_forget Pin_ValueChanged | ( | Windows::Devices::Gpio::GpioPin const & | sender,
 |  | Windows::Devices::Gpio::GpioPinValueChangedEventArgs const & | e |
 | ) |  |  | [private]
void StartScenario ( ) [private]

Definition at line 36 of file Scenario2_Listen.cpp.

    {
        // Initialize the GPIO objects.
        GpioController gpio = GpioController::GetDefault();

        // Set up our GPIO pin for setting values.
        // If this next line crashes with a NullReferenceException,
        // then the problem is that there is no GPIO controller on the device.
        setPin = gpio.OpenPin(SET_PIN);

        // Establish initial value and configure pin for output.
        setPin.Write(currentValue);
        setPin.SetDriveMode(GpioPinDriveMode::Output);

        // Set up our GPIO pin for listening for value changes.
        listenPin = gpio.OpenPin(LISTEN_PIN);

        // Configure pin for input and add ValueChanged listener.
        listenPin.SetDriveMode(GpioPinDriveMode::Input);
        valueChangedEventToken = listenPin.ValueChanged({ get_weak(), &Scenario2_Listen::Pin_ValueChanged });

        // Start toggling the pin value every 500ms.
        timer = DispatcherTimer();
        timer.Interval(500ms);
        timerEventToken = timer.Tick({ get_weak(), &Scenario2_Listen::Timer_Tick });
        timer.Start();
    }

void StartStopScenario_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopScenario ( ) [private]

Definition at line 64 of file Scenario2_Listen.cpp.

    {
        // Stop the timer.
        if (timer != nullptr)
        {
            timer.Tick(timerEventToken);
            timer.Stop();
            timer = nullptr;
        }

        // Release the GPIO pins.
        if (setPin != nullptr)
        {
            setPin.Close();
            setPin = nullptr;
        }
        if (listenPin != nullptr)
        {
            listenPin.ValueChanged(valueChangedEventToken);
            listenPin.Close();
            listenPin = nullptr;
        }
    }

void Timer_Tick | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]

Member Data Documentation

Windows::Devices::Gpio::GpioPinValue currentValue = Windows::Devices::Gpio::GpioPinValue::High [private]

Definition at line 36 of file Scenario2_Listen.h.

constexpr int LISTEN_PIN = 6 [static, private]

Definition at line 32 of file Scenario2_Listen.h.

constexpr int SET_PIN = 5 [static, private]

Definition at line 28 of file Scenario2_Listen.h.

The documentation for this struct was generated from the following files:
  • IoT-GPIO/cppwinrt/Scenario2_Listen.h
  • IoT-GPIO/cppwinrt/Scenario2_Listen.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Manage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Manage
Public Member Functions

Scenario2_Manage Struct Reference

#include "Scenario2_Manage.h"

List of all members.

Public Member Functions

Scenario2_Manage ()
void | RemoveCredentials_Click (Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &)
void | RetrieveCredentials_Click (Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &)
void | RevealPasswords_Click (Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &)

Detailed Description

Definition at line 19 of file Scenario2_Manage.h.

Constructor & Destructor Documentation

Scenario2_Manage ( )

Definition at line 27 of file Scenario2_Manage.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void RemoveCredentials_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Foundation::IInspectable const & |
 | ) |  |
void RetrieveCredentials_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Foundation::IInspectable const & |
 | ) |  |
void RevealPasswords_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Foundation::IInspectable const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • PasswordVault/cppwinrt/Scenario2_Manage.h
  • PasswordVault/cppwinrt/Scenario2_Manage.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Memory Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Memory
Public Member Functions | Private Member Functions

Scenario2_Memory Struct Reference

#include "Scenario2_Memory.h"

List of all members.

Public Member Functions

Scenario2_Memory ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ProtectL1_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ProtectL2_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | Unprotect_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | ReportProtectedBuffer (Windows::Storage::Streams::IBuffer const &buffer)

Detailed Description

Definition at line 19 of file Scenario2_Memory.h.

Constructor & Destructor Documentation

Scenario2_Memory ( )

Definition at line 25 of file Scenario2_Memory.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget ProtectL1_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ProtectL2_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ReportProtectedBuffer ( Windows::Storage::Streams::IBuffer const & buffer ) [private]
fire_and_forget Unprotect_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PersonalDataEncryption/cppwinrt/Scenario2_Memory.h
  • PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultiFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_MultiFile
Public Member Functions

Scenario2_MultiFile Struct Reference

#include "Scenario2_MultiFile.h"

List of all members.

Public Member Functions

Scenario2_MultiFile ()
fire_and_forget PickFilesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario2_MultiFile.h.

Constructor & Destructor Documentation

Scenario2_MultiFile ( )

Definition at line 26 of file Scenario2_MultiFile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget PickFilesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FilePicker/cppwinrt/Scenario2_MultiFile.h
  • FilePicker/cppwinrt/Scenario2_MultiFile.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_MultipleScanners Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_MultipleScanners
Public Member Functions | Private Types | Private Member Functions | Private Attributes

Scenario2_MultipleScanners Struct Reference

#include "Scenario2_MultipleScanners.h"

List of all members.

Public Member Functions

Scenario2_MultipleScanners ()
void | ButtonEndScanningInstance1_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | ButtonEndScanningInstance2_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | ButtonStartScanningInstance1_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | ButtonStartScanningInstance2_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | claimedBarcodeScannerInstance1_ReleaseDeviceRequested (Windows::Foundation::IInspectable const &sender, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &)
fire_and_forget | claimedBarcodeScannerInstance2_ReleaseDeviceRequested (Windows::Foundation::IInspectable const &sender, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Types

enum | BarcodeScannerInstance { Instance1, Instance2 }

Private Member Functions

Windows::Foundation::IAsyncOperation
< bool > 		ClaimBarcodeScannerAsync (BarcodeScannerInstance instance)
fire_and_forget | claimedBarcodeScannerInstance1_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
fire_and_forget | claimedBarcodeScannerInstance2_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
Windows::Foundation::IAsyncOperation
< bool > 		CreateDefaultScannerObjectAsync (BarcodeScannerInstance instance)
Windows::Foundation::IAsyncOperation
< bool > 		EnableBarcodeScannerAsync (BarcodeScannerInstance instance)
void | ResetTheScenarioState ()
void | ResetUI ()
void | SetUI (BarcodeScannerInstance instance)

Private Attributes

event_token | m_dev1DataReceivedToken
event_token | m_dev1ReleaseRequestedToken
event_token | m_dev2DataReceivedToken
event_token | m_dev2ReleaseRequestedToken

Detailed Description

Definition at line 18 of file Scenario2_MultipleScanners.h.

Member Enumeration Documentation

enum BarcodeScannerInstance [private]

Enumerator for current active Instance.

Enumerator:
Instance1
Instance2

Definition at line 48 of file Scenario2_MultipleScanners.h.

        {
            Instance1,
            Instance2
        };

Constructor & Destructor Documentation

Scenario2_MultipleScanners ( )

Definition at line 33 of file Scenario2_MultipleScanners.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ButtonEndScanningInstance1_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void ButtonEndScanningInstance2_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget ButtonStartScanningInstance1_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget ButtonStartScanningInstance2_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
IAsyncOperation< bool > ClaimBarcodeScannerAsync ( BarcodeScannerInstance instance ) [private]

This method claims the connected scanner.

Returns:
a boolean based on whether it was able to claim the scanner.

Definition at line 302 of file Scenario2_MultipleScanners.cpp.

    {
        auto lifetime = get_strong();
        bool claimAsyncStatus = false;
        //select the instance to claim
        switch (instance)
        {
        case BarcodeScannerInstance::Instance1:

            m_claimedBarcodeScannerInstance1 = co_await m_barcodeScannerInstance1.ClaimScannerAsync();
            if (!m_claimedBarcodeScannerInstance1)
                m_rootPage.NotifyUser(L"Instance 1 claim barcode scanner failed.", NotifyType::ErrorMessage);
            else
                claimAsyncStatus = true;
            break;

        case BarcodeScannerInstance::Instance2:

            m_claimedBarcodeScannerInstance2 = co_await m_barcodeScannerInstance2.ClaimScannerAsync();
            if (!m_claimedBarcodeScannerInstance2)
                m_rootPage.NotifyUser(L"Instance 2 claim barcode scanner failed.", NotifyType::ErrorMessage);
            else
                claimAsyncStatus = true;
            break;

        default:
            co_return claimAsyncStatus;
        }
        co_return claimAsyncStatus;
    }

fire_and_forget claimedBarcodeScannerInstance1_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | ,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget claimedBarcodeScannerInstance1_ReleaseDeviceRequested | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & |
 | ) |  |
fire_and_forget claimedBarcodeScannerInstance2_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | ,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget claimedBarcodeScannerInstance2_ReleaseDeviceRequested | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & |
 | ) |  |
IAsyncOperation< bool > CreateDefaultScannerObjectAsync ( BarcodeScannerInstance instance ) [private]

This method returns the first available Barcode Scanner.

To enumerate and find a particular device use the device enumeration code.

Returns:
a boolean value based on whether it found a compatible scanner connected

Definition at line 270 of file Scenario2_MultipleScanners.cpp.

    {
        auto lifetime = get_strong();

        BarcodeScanner scanner = co_await BarcodeScanner::GetDefaultAsync();

        if (!scanner)
        {
            m_rootPage.NotifyUser(L"Barcode scanner not found. Please connect a barcode scanner.", NotifyType::ErrorMessage);
            co_return false;
        }

        switch (instance)
        {
        case BarcodeScannerInstance::Instance1:
            m_barcodeScannerInstance1 = scanner;
            break;
        case BarcodeScannerInstance::Instance2:
            m_barcodeScannerInstance2 = scanner;
            break;
        default:
            co_return false;
        }

        co_return true;
    }

IAsyncOperation< bool > EnableBarcodeScannerAsync ( BarcodeScannerInstance instance ) [private]

This method enables the connected scanner.

Returns:
a boolean based on whether it was able to enable the scanner.

Definition at line 338 of file Scenario2_MultipleScanners.cpp.

    {
        auto lifetime = get_strong();
        switch (instance)
        {
        case BarcodeScannerInstance::Instance1:
            co_await m_claimedBarcodeScannerInstance1.EnableAsync();
            m_rootPage.NotifyUser(L"Instance 1 ready to scan. Device ID: " + m_claimedBarcodeScannerInstance1.DeviceId(), NotifyType::StatusMessage);
            break;
        case BarcodeScannerInstance::Instance2:
            co_await m_claimedBarcodeScannerInstance2.EnableAsync();
            m_rootPage.NotifyUser(L"Instance 2 ready to scan. Device ID: " + m_claimedBarcodeScannerInstance2.DeviceId(), NotifyType::StatusMessage);
            break;
        default:
            co_return false;
        }
        co_return true;
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void ResetTheScenarioState ( ) [private]

Reset the Scenario state.

Definition at line 361 of file Scenario2_MultipleScanners.cpp.

    {
        if (m_claimedBarcodeScannerInstance1)
        {
            m_claimedBarcodeScannerInstance1.Close();
            m_claimedBarcodeScannerInstance1 = nullptr;
        }

        if (m_barcodeScannerInstance1)
        {
            m_barcodeScannerInstance1.Close();
            m_barcodeScannerInstance1 = nullptr;
        }

        if (m_claimedBarcodeScannerInstance2)
        {
            m_claimedBarcodeScannerInstance2.Close();
            m_claimedBarcodeScannerInstance2 = nullptr;
        }

        if (m_barcodeScannerInstance2)
        {
            m_barcodeScannerInstance2.Close();
            m_barcodeScannerInstance2 = nullptr;
        }

        ResetUI();
    }

void ResetUI ( ) [private]

Resets the display Elements to original state.

Definition at line 394 of file Scenario2_MultipleScanners.cpp.

    {
        Instance1Border().BorderBrush(SolidColorBrush{ Colors::Gray() });
        Instance2Border().BorderBrush(SolidColorBrush{ Colors::Gray() });

        ScanDataType1().Text(L"No data");
        ScanData1().Text(L"No data");
        DataLabel1().Text(L"No data");
        ScanDataType2().Text(L"No data");
        ScanData2().Text(L"No data");
        DataLabel2().Text(L"No data");

        ScenarioStartScanningInstance1().IsEnabled(true);
        ScenarioStartScanningInstance2().IsEnabled(true);
        ScenarioEndScanningInstance1().IsEnabled(false);
        ScenarioEndScanningInstance2().IsEnabled(false);
    }

void SetUI ( BarcodeScannerInstance instance ) [private]

Sets the UI elements to a state corresponding to the current active Instance.

Parameters:
instance Corresponds to the current active instance

Definition at line 417 of file Scenario2_MultipleScanners.cpp.

    {
        Instance1Border().BorderBrush(SolidColorBrush{ Colors::Gray() });
        Instance2Border().BorderBrush(SolidColorBrush{ Colors::Gray() });

        switch (instance)
        {
        case BarcodeScannerInstance::Instance1:
            ScenarioStartScanningInstance1().IsEnabled(false);
            ScenarioStartScanningInstance2().IsEnabled(true);
            ScenarioEndScanningInstance1().IsEnabled(true);
            ScenarioEndScanningInstance2().IsEnabled(false);
            Instance1Border().BorderBrush(SolidColorBrush{ Colors::DarkBlue() });
            break;

        case BarcodeScannerInstance::Instance2:
            ScenarioStartScanningInstance1().IsEnabled(true);
            ScenarioStartScanningInstance2().IsEnabled(false);
            ScenarioEndScanningInstance1().IsEnabled(false);
            ScenarioEndScanningInstance2().IsEnabled(true);
            Instance2Border().BorderBrush(SolidColorBrush{ Colors::DarkBlue() });
            break;
        }
    }

Member Data Documentation

event_token m_dev1DataReceivedToken [private]

Definition at line 41 of file Scenario2_MultipleScanners.h.

event_token m_dev1ReleaseRequestedToken [private]

Definition at line 34 of file Scenario2_MultipleScanners.h.

event_token m_dev2DataReceivedToken [private]

Definition at line 43 of file Scenario2_MultipleScanners.h.

event_token m_dev2ReleaseRequestedToken [private]

Definition at line 42 of file Scenario2_MultipleScanners.h.

The documentation for this struct was generated from the following files:
  • BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.h
  • BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_NetworkCost Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_NetworkCost
Public Member Functions

Scenario2_NetworkCost Struct Reference

#include "Scenario2_NetworkCost.h"

List of all members.

Public Member Functions

Scenario2_NetworkCost ()
void GetNetworkCost_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 16 of file Scenario2_NetworkCost.h.

Constructor & Destructor Documentation

Scenario2_NetworkCost ( )

Definition at line 25 of file Scenario2_NetworkCost.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void GetNetworkCost_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.h
  • NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Notifications Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Notifications
Public Member Functions

Scenario2_Notifications Struct Reference

#include "Scenario2_Notifications.h"

List of all members.

Public Member Functions

Scenario2_Notifications ()
void | ClearBadge_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ClearTile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendBadge_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendBadgeWithStringManipulation_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendTile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendTileWithStringManipulation_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_Notifications.h.

Constructor & Destructor Documentation

Scenario2_Notifications ( )

Definition at line 26 of file Scenario2_Notifications.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ClearBadge_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ClearTile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendBadge_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendBadgeWithStringManipulation_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendTile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendTileWithStringManipulation_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LockScreenApps/cppwinrt/Scenario2_Notifications.h
  • LockScreenApps/cppwinrt/Scenario2_Notifications.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Polling Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Polling
Public Member Functions

Scenario2_Polling Struct Reference

#include "Scenario2_Polling.h"

List of all members.

Public Member Functions

Scenario2_Polling ()
void | ScenarioGetData_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ScenarioGetSensor_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario2_Polling.h.

Constructor & Destructor Documentation

Scenario2_Polling ( )

Definition at line 28 of file Scenario2_Polling.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ScenarioGetData_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ScenarioGetSensor_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PresenceSensor/cppwinrt/Scenario2_Polling.h
  • PresenceSensor/cppwinrt/Scenario2_Polling.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Remove Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Remove
Public Member Functions

Scenario2_Remove Struct Reference

#include "Scenario2_Remove.h"

List of all members.

Public Member Functions

Scenario2_Remove ()
fire_and_forget RemoveJumpList_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_Remove.h.

Constructor & Destructor Documentation

Scenario2_Remove ( )

Definition at line 23 of file Scenario2_Remove.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget RemoveJumpList_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • JumpList/cppwinrt/Scenario2_Remove.h
  • JumpList/cppwinrt/Scenario2_Remove.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestConsent Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_RequestConsent
Public Member Functions

Scenario2_RequestConsent Struct Reference

#include "Scenario2_RequestConsent.h"

List of all members.

Public Member Functions

Scenario2_RequestConsent ()
fire_and_forget RequestConsent_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_RequestConsent.h.

Constructor & Destructor Documentation

Scenario2_RequestConsent ( )

Definition at line 23 of file Scenario2_RequestConsent.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget RequestConsent_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.h
  • UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_RequestMany Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_RequestMany
Public Member Functions

Scenario2_RequestMany Struct Reference

#include "Scenario2_RequestMany.h"

List of all members.

Public Member Functions

Scenario2_RequestMany ()
fire_and_forget RequestAccessButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario2_RequestMany.h.

Constructor & Destructor Documentation

Scenario2_RequestMany ( )

Definition at line 24 of file Scenario2_RequestMany.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget RequestAccessButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Capabilities/cppwinrt/Scenario2_RequestMany.h
  • Capabilities/cppwinrt/Scenario2_RequestMany.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ScriptDetection Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_ScriptDetection
Public Member Functions

Scenario2_ScriptDetection Struct Reference

#include "Scenario2_ScriptDetection.h"

List of all members.

Public Member Functions

Scenario2_ScriptDetection ()
void Go_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_ScriptDetection.h.

Constructor & Destructor Documentation

Scenario2_ScriptDetection ( )

Definition at line 24 of file Scenario2_ScriptDetection.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Go_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LinguisticServices/cppwinrt/Scenario2_ScriptDetection.h
  • LinguisticServices/cppwinrt/Scenario2_ScriptDetection.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Settings Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Settings
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario2_Settings Struct Reference

#include "Scenario2_Settings.h"

List of all members.

Public Member Functions

Scenario2_Settings ()
void | DeleteSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | WriteSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | DisplayOutput ()

Private Attributes

Windows::Storage::ApplicationDataContainer | localSettings = Windows::Storage::ApplicationData::Current().LocalSettings()

Static Private Attributes

static const auto | SettingName = "exampleSetting"

Detailed Description

Definition at line 19 of file Scenario2_Settings.h.

Constructor & Destructor Documentation

Scenario2_Settings ( )

Definition at line 24 of file Scenario2_Settings.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void DeleteSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DisplayOutput ( ) [private]

Definition at line 59 of file Scenario2_Settings.cpp.

    {
        auto stringValue = localSettings.Values().TryLookup(SettingName).try_as<hstring>();

        OutputTextBlock().Text(L"Setting: " + (stringValue.has_value() ? L"\"" + stringValue.value() + L"\"" : L"<empty>"));
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void WriteSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

Windows::Storage::ApplicationDataContainer localSettings = Windows::Storage::ApplicationData::Current().LocalSettings() [private]

Definition at line 31 of file Scenario2_Settings.h.

const auto SettingName = "exampleSetting" [inline, static, private]

Definition at line 33 of file Scenario2_Settings.h.

The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario2_Settings.h
  • ApplicationData/cppwinrt/Scenario2_Settings.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ShowHideEvents Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_ShowHideEvents
Public Member Functions | Private Member Functions

Scenario2_ShowHideEvents Struct Reference

Sample page to subscribe show/hide event of Touch Keyboard.

#include "Scenario2_ShowHideEvents.h"

List of all members.

Public Member Functions

Scenario2_ShowHideEvents ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | OnHiding (Windows::UI::ViewManagement::InputPane const &sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const &e)
void | OnShowing (Windows::UI::ViewManagement::InputPane const &sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const &e)

Detailed Description

Definition at line 22 of file Scenario2_ShowHideEvents.h.

Constructor & Destructor Documentation

Scenario2_ShowHideEvents ( )

Definition at line 24 of file Scenario2_ShowHideEvents.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnHiding | ( | Windows::UI::ViewManagement::InputPane const & | sender,
 |  | Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnShowing | ( | Windows::UI::ViewManagement::InputPane const & | sender,
 |  | Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const & | e |
 | ) |  |  | [private]
The documentation for this struct was generated from the following files:
  • TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.h
  • TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SimpleGridView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_SimpleGridView
Public Member Functions

Scenario2_SimpleGridView Struct Reference

#include "Scenario2_SimpleGridView.h"

List of all members.

Public Member Functions

Scenario2_SimpleGridView ()

Detailed Description

Definition at line 17 of file Scenario2_SimpleGridView.h.

Constructor & Destructor Documentation

Scenario2_SimpleGridView ( )

Definition at line 23 of file Scenario2_SimpleGridView.cpp.

    {
        InitializeComponent();
        ContactsCVS().Source(Contact::GetContactsGrouped(250));
    }

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario2_SimpleGridView.h
  • XamlListView/cppwinrt/Scenario2_SimpleGridView.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_Stats Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_Stats
Public Member Functions

Scenario2_Stats Struct Reference

#include "Scenario2_Stats.h"

List of all members.

Public Member Functions

Scenario2_Stats ()
void ShowResults_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario2_Stats.h.

Constructor & Destructor Documentation

Scenario2_Stats ( )

Definition at line 35 of file Scenario2_Stats.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Calendar/cppwinrt/Scenario2_Stats.h
  • Calendar/cppwinrt/Scenario2_Stats.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_StringTemplate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_StringTemplate
Public Member Functions

Scenario2_StringTemplate Struct Reference

#include "Scenario2_StringTemplate.h"

List of all members.

Public Member Functions

Scenario2_StringTemplate ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_StringTemplate.h.

Constructor & Destructor Documentation

Scenario2_StringTemplate ( )

Definition at line 33 of file Scenario2_StringTemplate.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.h
  • DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_SupportedTactileFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_SupportedTactileFeedback
Public Member Functions

Scenario2_SupportedTactileFeedback Struct Reference

#include "Scenario2_SupportedTactileFeedback.h"

List of all members.

Public Member Functions

Scenario2_SupportedTactileFeedback ()
void | Pointer_Entered (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | Pointer_Exited (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario2_SupportedTactileFeedback.h.

Constructor & Destructor Documentation

Scenario2_SupportedTactileFeedback ( )

Definition at line 28 of file Scenario2_SupportedTactileFeedback.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Pointer_Entered | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void Pointer_Exited | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.h
  • PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_ToggleMobileHotspot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_ToggleMobileHotspot
Public Member Functions

Scenario2_ToggleMobileHotspot Struct Reference

#include "Scenario2_ToggleMobileHotspot.h"

List of all members.

Public Member Functions

Scenario2_ToggleMobileHotspot ()
fire_and_forget | MobileHotspotToggle_Toggled (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario2_ToggleMobileHotspot.h.

Constructor & Destructor Documentation

Scenario2_ToggleMobileHotspot ( )

Definition at line 28 of file Scenario2_ToggleMobileHotspot.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget MobileHotspotToggle_Toggled | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Definition at line 55 of file Scenario2_ToggleMobileHotspot.cpp.

    {
        if (m_toggling)
        {
            co_return;
        }
        MainPage::Current().NotifyUser(L"", NotifyType::StatusMessage);

        bool isTethered = m_tetheringManager.TetheringOperationalState() == TetheringOperationalState::On;
        if (MobileHotspotToggle().IsOn() == isTethered)
        {
            // Already in desired state.
            co_return;
        }

        // Switch to opposite state.
        m_toggling = true;

        NetworkOperatorTetheringOperationResult result{ nullptr };
        if (isTethered)
        {
            result = co_await m_tetheringManager.StopTetheringAsync();
        }
        else
        {
            result = co_await m_tetheringManager.StartTetheringAsync();
        }

        if (result.Status() == TetheringOperationStatus::Success)
        {
            // Change to new state.
            MobileHotspotToggle().IsOn(!isTethered);
        }
        else
        {
            // Return to old state.
            MobileHotspotToggle().IsOn(isTethered);

            switch (result.Status())
            {
            case TetheringOperationStatus::WiFiDeviceOff:
                MainPage::Current().NotifyUser(
                    L"Wi-Fi adapter is either turned off or missing.",
                    NotifyType::ErrorMessage);
                break;

            default:
                MainPage::Current().NotifyUser(
                    L"Unhandled result while toggling Mobile Hotspot: " + to_hstring(static_cast<int>(result.Status())), // TODO: stringify
                    NotifyType::ErrorMessage);
                break;
            }
        }
        m_toggling = false;
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.h
  • MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_UnpinTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_UnpinTile
Public Member Functions

Scenario2_UnpinTile Struct Reference

#include "Scenario2_UnpinTile.h"

List of all members.

Public Member Functions

Scenario2_UnpinTile ()
fire_and_forget UnpinSecondaryTile_Click (Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario2_UnpinTile.h.

Constructor & Destructor Documentation

Scenario2_UnpinTile ( )

Definition at line 24 of file Scenario2_UnpinTile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget UnpinSecondaryTile_Click | ( | Windows::Foundation::IInspectable | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario2_UnpinTile.h
  • SecondaryTiles/cppwinrt/Scenario2_UnpinTile.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_WatchUsers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_WatchUsers
Public Member Functions | Private Member Functions | Private Attributes

Scenario2_WatchUsers Struct Reference

#include "Scenario2_WatchUsers.h"

List of all members.

Public Member Functions

Scenario2_WatchUsers ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | StartWatching ()
void | StopWatching ()
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::UserViewModel > 		Users ()

Private Member Functions

SDKTemplate::UserViewModel | FindModelByUserId (hstring const &userId)
Windows::Foundation::IAsyncOperation
< hstring > 		GetDisplayNameOrGenericNameAsync (Windows::System::User user)
fire_and_forget | OnEnumerationCompleted (Windows::System::UserWatcher const &, IInspectable const &e)
fire_and_forget | OnUserAdded (Windows::System::UserWatcher const &, Windows::System::UserChangedEventArgs const &e)
fire_and_forget | OnUserRemoved (Windows::System::UserWatcher const &, Windows::System::UserChangedEventArgs const &e)
fire_and_forget | OnUserUpdated (Windows::System::UserWatcher const &, Windows::System::UserChangedEventArgs const &e)
fire_and_forget | OnWatcherStopped (Windows::System::UserWatcher const &, IInspectable const &e)

Private Attributes

int | userNumber = 1
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::UserViewModel > 		users = single_threaded_observable_vector<SDKTemplate::UserViewModel>()

Detailed Description

Definition at line 17 of file Scenario2_WatchUsers.h.

Constructor & Destructor Documentation

Scenario2_WatchUsers ( )

Definition at line 25 of file Scenario2_WatchUsers.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

SDKTemplate::UserViewModel FindModelByUserId ( hstring const & userId ) [private]

Definition at line 71 of file Scenario2_WatchUsers.cpp.

    {
        for (SDKTemplate::UserViewModel&& model : users)
        {
            if (model.UserId() == userId)
            {
                return model;
            }
        }
        return nullptr;
    }

Windows::Foundation::IAsyncOperation<hstring> GetDisplayNameOrGenericNameAsync ( Windows::System::User user ) [private]
fire_and_forget OnEnumerationCompleted | ( | Windows::System::UserWatcher const & | ,
 |  | IInspectable const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OnUserAdded | ( | Windows::System::UserWatcher const & | ,
 |  | Windows::System::UserChangedEventArgs const & | e |
 | ) |  |  | [private]
fire_and_forget OnUserRemoved | ( | Windows::System::UserWatcher const & | ,
 |  | Windows::System::UserChangedEventArgs const & | e |
 | ) |  |  | [private]
fire_and_forget OnUserUpdated | ( | Windows::System::UserWatcher const & | ,
 |  | Windows::System::UserChangedEventArgs const & | e |
 | ) |  |  | [private]
fire_and_forget OnWatcherStopped | ( | Windows::System::UserWatcher const & | ,
 |  | IInspectable const & | e |
 | ) |  |  | [private]
void StartWatching ( )

Definition at line 35 of file Scenario2_WatchUsers.cpp.

    {
        rootPage.NotifyUser(L"", NotifyType::StatusMessage);

        userNumber = 1;
        users.Clear();
        userWatcher = User::CreateWatcher();

        userAddedToken = userWatcher.Added({ get_weak(), &Scenario2_WatchUsers::OnUserAdded });
        userUpdatedToken = userWatcher.Updated({ get_weak(), &Scenario2_WatchUsers::OnUserUpdated });
        userRemovedToken = userWatcher.Removed({ get_weak(), &Scenario2_WatchUsers::OnUserRemoved });
        enumerationCompletedToken = userWatcher.EnumerationCompleted({ get_weak(), &Scenario2_WatchUsers::OnEnumerationCompleted });
        watcherStoppedToken = userWatcher.Stopped({ get_weak(), &Scenario2_WatchUsers::OnWatcherStopped });
        userWatcher.Start();
        StartButton().IsEnabled(false);
        StopButton().IsEnabled(true);
    }

void StopWatching ( )

Definition at line 53 of file Scenario2_WatchUsers.cpp.

    {
        if (userWatcher != nullptr)
        {
            // Unregister all event handlers in case events are in flight.
            userWatcher.Added(userAddedToken);
            userWatcher.Updated(userUpdatedToken);
            userWatcher.Removed(userRemovedToken);
            userWatcher.EnumerationCompleted(enumerationCompletedToken);
            userWatcher.Stopped(watcherStoppedToken);
            userWatcher.Stop();
            userWatcher = nullptr;
            users.Clear();
            StartButton().IsEnabled(true);
            StopButton().IsEnabled(false);
        }
    }

Windows::Foundation::Collections::IObservableVector<SDKTemplate::UserViewModel> Users ( ) [inline]

Definition at line 23 of file Scenario2_WatchUsers.h.

        {
            return users;
        }

Member Data Documentation

int userNumber = 1 [private]

Definition at line 52 of file Scenario2_WatchUsers.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::UserViewModel> users = single_threaded_observable_vector<SDKTemplate::UserViewModel>() [private]

Definition at line 44 of file Scenario2_WatchUsers.h.

The documentation for this struct was generated from the following files:
  • UserInfo/cppwinrt/Scenario2_WatchUsers.h
  • UserInfo/cppwinrt/Scenario2_WatchUsers.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario2_XmlWriter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario2_XmlWriter
Public Member Functions | Private Member Functions

Scenario2_XmlWriter Struct Reference

#include "Scenario2_XmlWriter.h"

List of all members.

Public Member Functions

Scenario2_XmlWriter ()
fire_and_forget | DoSomething_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | WriteXml (com_ptr< IStream > const &writeStream)

Detailed Description

Definition at line 19 of file Scenario2_XmlWriter.h.

Constructor & Destructor Documentation

Scenario2_XmlWriter ( )

Definition at line 25 of file Scenario2_XmlWriter.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget DoSomething_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void WriteXml ( com_ptr< IStream > const & writeStream ) [private]

Definition at line 52 of file Scenario2_XmlWriter.cpp.

    {
        com_ptr<IXmlWriter> writer;
        check_hresult(::CreateXmlWriter(IID_PPV_ARGS(&writer), nullptr));
        check_hresult(writer->SetOutput(writeStream.get()));
        check_hresult(writer->SetProperty(XmlWriterProperty_Indent, TRUE));

        check_hresult(writer->WriteStartDocument(XmlStandalone_Omit));
        check_hresult(writer->WriteDocType(L"root", nullptr, nullptr, nullptr));
        check_hresult(writer->WriteProcessingInstruction(L"xml-stylesheet",
            L"href=\"mystyle.css\" title=\"Compact\" type=\"text/css\""));
        check_hresult(writer->WriteStartElement(nullptr, L"root", nullptr));
        check_hresult(writer->WriteStartElement(nullptr, L"sub", nullptr));
        check_hresult(writer->WriteAttributeString(nullptr, L"myAttr", nullptr, L"1234"));
        check_hresult(writer->WriteString(L"Markup is <escaped> for this string"));
        check_hresult(writer->WriteFullEndElement());
        check_hresult(writer->WriteStartElement(nullptr, L"anotherChild", nullptr));
        check_hresult(writer->WriteString(L"some text"));
        check_hresult(writer->WriteFullEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteCData(L"This is CDATA text."));
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteStartElement(nullptr, L"containsCharacterEntity", nullptr));
        check_hresult(writer->WriteCharEntity(L'a'));
        check_hresult(writer->WriteFullEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteStartElement(nullptr, L"containsChars", nullptr));
        check_hresult(writer->WriteChars(L"abcdefghijklm", 5));
        check_hresult(writer->WriteFullEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteStartElement(nullptr, L"containsName", nullptr));
        check_hresult(writer->WriteName(L"myName"));
        check_hresult(writer->WriteEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteStartElement(nullptr, L"containsNmToken", nullptr));
        check_hresult(writer->WriteNmToken(L"myNmToken"));
        check_hresult(writer->WriteEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteComment(L"This is a comment"));
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteRaw(L"<elementWrittenRaw/>"));
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteRawChars(L"<rawCharacters/>", 16));
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteElementString(nullptr, L"myElement", nullptr, L"myValue"));
        check_hresult(writer->WriteFullEndElement());
        check_hresult(writer->WriteWhitespace(L"\n"));
        check_hresult(writer->WriteEndDocument());
    }

The documentation for this struct was generated from the following files:
  • XmlLite/cppwinrt/Scenario2_XmlWriter.h
  • XmlLite/cppwinrt/Scenario2_XmlWriter.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario3 Struct Reference

#include "Scenario3.h"

Inherits winrt::SDKTemplate::MediaFoundationInitializer.

List of all members.

Public Member Functions

Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
Scenario3 ()
fire_and_forget | AnimatedSwitch_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | btnFilePicker_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPause_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPlay_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnPlayPause_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnStop_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DisableContentUI ()
fire_and_forget | DoScenario (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
fire_and_forget | EnableDisableLogging (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args)
fire_and_forget | GetFilesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetThumbnailButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | InitializeDevice ()
fire_and_forget | MediaButtonPressed (Windows::Media::SystemMediaTransportControls const &sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs e)
fire_and_forget | OnDeviceStateChange (IDeviceStateSource const &sender, SDKTemplate::DeviceStateChangedEventArgs e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &args)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &args)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | OnPickFileAsync ()
void | OnSetVolume (double volume)
void | PauseDevice ()
void | PlayPauseToggleDevice ()
void | radioFile_Checked (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | radioTone_Checked (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ReadTextButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | sliderFrequency_ValueChanged (IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e)
void | sliderVolume_ValueChanged (IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e)
void | StartDevice ()
void | StopDevice ()
void | UpdateContentProps (hstring const &text)
void | UpdateContentUI ()
void | UpdateMediaControlUI (DeviceState deviceState)
fire_and_forget | WriteTextButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | AddLogFileMessage (_In_ LPCWSTR message, _In_opt_ LPCWSTR logFileFullPath)
void | AddMessage (_In_ LPCWSTR message)
void | CompleteCurrentAnimation ()
void | Current_VisibilityChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Core::VisibilityChangedEventArgs const &e)
void | Fade_Completed (Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &)
fire_and_forget | OnStatusChanged (SDKTemplate::LoggingScenarioEventArgs args)
void | StartFadeOutContents ()
void | UpdateControls ()

Static Private Member Functions

static hstring | GetPropertyDisplayValue (Windows::Foundation::IInspectable const &rawValue)

Private Attributes

FileLoggingSessionScenario & | _instance = FileLoggingSessionScenario::Instance()
event_token | _statusChangedToken
handle | animationCompleteEvent
Windows::UI::Xaml::Media::Animation::Storyboard | fadeOutStoryboard
event_token | fadeOutToken
clock::time_point | lastFadeOutTime = clock::time_point::min()
ContentType | m_contentType = ContentType::Tone
event_token | m_deviceStateChangeToken
bool | m_deviceSupportsRawMode = false
bool | m_isMinimumLatency = false
com_ptr< WASAPIRenderer > | m_renderer
event_token | m_systemMediaControlsButtonToken
event_token | visibilityToken

Detailed Description

Definition at line 19 of file Scenario3.h.

Constructor & Destructor Documentation

Scenario3 ( )

Definition at line 25 of file Scenario3.cpp.

    {
        InitializeComponent();
    }

Scenario3 ( )
Scenario3 ( )
Scenario3 ( )
Scenario3 ( )
Scenario3 ( )

Member Function Documentation

void AddLogFileMessage | ( | _In_ LPCWSTR | message,
 |  | _In_opt_ LPCWSTR | logFileFullPath |
 | ) |  |  | [private]

Definition at line 135 of file Scenario3.cpp.

{
    std::wstring finalMessage = message;

    if (logFileFullPath == nullptr || logFileFullPath[0] == 0)
    {
        finalMessage += L": none, nothing logged since saving the last file.";
    }
    else
    {
        // Add a message to the UI indicating a new log file was created.
        std::wstring fullPath(logFileFullPath);
        std::wstring directoryName;
        std::wstring fileName;
        std::size_t lastSlashPos = fullPath.find_last_of(L'\\');
        if (lastSlashPos > 0 && lastSlashPos < fullPath.size() - 1)
        {
            directoryName = fullPath.substr(0, lastSlashPos);
            fileName = fullPath.substr(lastSlashPos + 1, fullPath.size() - (lastSlashPos + 1));
        }

        ViewLogInfo().Text(
            L"Log folder: \"" + directoryName + L"\"\r\n"
            L"- To view with tracerpt: tracerpt.exe \"" + fullPath + L"\" -of XML -o LogFile.xml\r\n"
            L"- To view with Windows Performance Toolkit (WPT):\n"
            L"   xperf -merge \"" + fullPath + "\" merged.etl\n"
            L"   wpa.exe merged.etl");

        finalMessage += L": ";
        finalMessage += fileName;
    }

    AddMessage(finalMessage.c_str());
}

void AddMessage ( _In_ LPCWSTR message ) [private]

Definition at line 118 of file Scenario3.cpp.

{
    TextBox statusMessageList = StatusMessageList();
    std::wstring statusText(statusMessageList.Text());
    statusText += message;
    statusText += L"\r\n";
    statusMessageList.Text(statusText);
    statusMessageList.Select(static_cast<int32_t>(statusText.size()), 0);

    ScrollViewer viewer = FindScrollViewer(statusMessageList);
    if (viewer != nullptr)
    {
        viewer.ChangeView(nullptr, statusMessageList.ActualHeight(), nullptr);
    }
}

fire_and_forget AnimatedSwitch_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void btnFilePicker_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 247 of file Scenario3.cpp.

    {
        OnPickFileAsync();
    }

void btnPause_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 232 of file Scenario3.cpp.

    {
        PauseDevice();
    }

void btnPlay_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 227 of file Scenario3.cpp.

    {
        StartDevice();
    }

void btnPlayPause_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 237 of file Scenario3.cpp.

    {
        PlayPauseToggleDevice();
    }

void btnStop_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 242 of file Scenario3.cpp.

    {
        StopDevice();
    }

void CompleteCurrentAnimation ( ) [private]

Definition at line 58 of file Scenario3.cpp.

    {
        // Must be called from the UI thread to avoid race conditions.
        if (animationCompleteEvent)
        {
            SetEvent(animationCompleteEvent.get());
            animationCompleteEvent.close();
        }
    }

void Current_VisibilityChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Core::VisibilityChangedEventArgs const & | e |
 | ) |  |  | [private]
void DisableContentUI ( )

Definition at line 96 of file Scenario3.cpp.

    {
        btnFilePicker().IsEnabled(false);
        sliderFrequency().IsEnabled(false);
        radioFile().IsEnabled(false);
        radioTone().IsEnabled(false);
    }

fire_and_forget DoScenario | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |
fire_and_forget EnableDisableLogging | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | args
 | ) |  |
void Fade_Completed | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget GetFilesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
static hstring GetPropertyDisplayValue ( Windows::Foundation::IInspectable const & rawValue ) [static, private]
fire_and_forget GetThumbnailButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void InitializeDevice ( )

Definition at line 372 of file Scenario3.cpp.

    {
        if (m_renderer)
        {
            // Already initialized.
            return;
        }

        // Create a new WASAPI instance
        m_renderer = make_self<WASAPIRenderer>();

        // Register for events
        m_deviceStateChangeToken = m_renderer->DeviceStateChanged({ get_weak(), &Scenario3::OnDeviceStateChange });

        // Configure user based properties
        m_renderer->SetContentType(m_contentType);
        m_renderer->SetFrequency(sliderFrequency().Value());
        m_renderer->SetContentStream(m_contentStream);

        m_isMinimumLatency = toggleMinimumLatency().IsOn();
        m_renderer->SetLowLatency(m_isMinimumLatency);
        m_renderer->SetHWOffload(false);
        m_renderer->SetBackgroundAudio(false);
        m_renderer->SetRawAudio(m_deviceSupportsRawMode && toggleRawAudio().IsOn());

        // Selects the Default Audio Device
        m_renderer->AsyncInitializeAudioDevice();

        // Set the initial volume.
        OnSetVolume(sliderVolume().Value());
    }

fire_and_forget MediaButtonPressed | ( | Windows::Media::SystemMediaTransportControls const & | sender,
 |  | Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs | e
 | ) |  |
fire_and_forget OnDeviceStateChange | ( | IDeviceStateSource const & | sender,
 |  | SDKTemplate::DeviceStateChangedEventArgs | e
 | ) |  |

Definition at line 255 of file Scenario3.cpp.

    {
        auto lifetime = get_strong();

        // Handle state specific messages
        switch (e.DeviceState())
        {
        case DeviceState::Initialized:
            StartDevice();
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Closed);
            break;

        case DeviceState::Playing:
            if (m_isMinimumLatency == true)
            {
                rootPage.NotifyUser(L"Playback Started (minimum latency)", NotifyType::StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(L"Playback Started (normal latency)", NotifyType::StatusMessage);
            }
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Playing);
            break;

        case DeviceState::Paused:
            rootPage.NotifyUser(L"Playback Paused", NotifyType::StatusMessage);
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Paused);
            break;

        case DeviceState::Stopped:
            if (m_deviceStateChangeToken)
            {
                m_renderer->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
            }
            m_renderer = nullptr;

            rootPage.NotifyUser(L"Playback Stopped", NotifyType::StatusMessage);
            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Stopped);
            break;

        case DeviceState::Error:
            if (m_deviceStateChangeToken)
            {
                m_renderer->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
            }
            m_renderer = nullptr;

            m_systemMediaControls.PlaybackStatus(MediaPlaybackStatus::Closed);

            // Specifically handle a couple of known errors
            auto error = e.ExtendedError();
            switch (error)
            {
            case AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE:
                rootPage.NotifyUser(L"ERROR: Endpoint Does Not Support HW Offload", NotifyType::ErrorMessage);
                break;

            case AUDCLNT_E_RESOURCES_INVALIDATED:
                rootPage.NotifyUser(L"ERROR: Endpoint Lost Access To Resources", NotifyType::ErrorMessage);
                break;

            default:
                rootPage.NotifyUser(L"ERROR: " + hresult_error(error).message(), NotifyType::ErrorMessage);
                break;
            }
        }

        // Update Control Buttons
        co_await resume_foreground(Dispatcher());
        UpdateMediaControlUI(e.DeviceState());
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & args )
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & args )
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnPickFileAsync ( )

Definition at line 332 of file Scenario3.cpp.

    {
        auto lifetime = get_strong();
        FileOpenPicker filePicker;
        filePicker.ViewMode(PickerViewMode::List);
        filePicker.SuggestedStartLocation(PickerLocationId::MusicLibrary);
        filePicker.FileTypeFilter().ReplaceAll({ L".wav", L".mp3", L".wma" });

        StorageFile file = co_await filePicker.PickSingleFileAsync();
        if (file != nullptr)
        {
            // Open the stream
            IRandomAccessStream stream = co_await file.OpenAsync(FileAccessMode::Read);
            if (stream != nullptr)
            {
                m_contentStream = stream;
                UpdateContentProps(file.Path());
            }
        }
    }

void OnSetVolume ( double volume )

Definition at line 358 of file Scenario3.cpp.

    {
        if (m_renderer)
        {
            // Updates the Session volume on the AudioClient
            m_renderer->SetVolumeOnSession(volume);
        }
    }

fire_and_forget OnStatusChanged ( SDKTemplate::LoggingScenarioEventArgs args ) [private]

Definition at line 171 of file Scenario3.cpp.

{
    // Switch to UI thread.
    co_await resume_foreground(Dispatcher());

    switch (args.Type())
    {
    case LoggingScenarioEventType::BusyStatusChanged:
        UpdateControls();
        break;

    case LoggingScenarioEventType::LogFileGenerated:
        AddLogFileMessage(L"LogFileGenerated", args.LogFileFullPath().c_str());
        break;

    case LoggingScenarioEventType::LogFileGeneratedAtSuspend:
        AddLogFileMessage(L"Log file at suspend", args.LogFileFullPath().c_str());
        break;

    case LoggingScenarioEventType::LogFileGeneratedAtDisable:
        AddLogFileMessage(L"Log file at disable", args.LogFileFullPath().c_str());
        break;

    case LoggingScenarioEventType::LoggingEnabledDisabled:
        AddMessage(args.Enabled()
            ? L"Logging has been enabled."
            : L"Logging has been disabled.");
        break;

    default:
        AddMessage(L"Unrecognized event.");
        break;
    }
}

void PauseDevice ( )

Definition at line 427 of file Scenario3.cpp.

    {
        if (m_renderer)
        {
            if (m_renderer->DeviceState() == DeviceState::Playing)
            {
                // Starts a work item to pause playback
                m_renderer->PausePlaybackAsync();
            }
        }
    }

void PlayPauseToggleDevice ( )

Definition at line 442 of file Scenario3.cpp.

    {
        if (m_renderer)
        {
            DeviceState deviceState = m_renderer->DeviceState();

            if (deviceState == DeviceState::Playing)
            {
                // Starts a work item to pause playback
                m_renderer->PausePlaybackAsync();
            }
            else if (deviceState == DeviceState::Paused)
            {
                // Starts a work item to pause playback
                m_renderer->StartPlayback();
            }
        }
        else
        {
            StartDevice();
        }
    }

void radioFile_Checked | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 219 of file Scenario3.cpp.

    {
        m_contentType = ContentType::File;
        UpdateContentProps(L"");
        m_contentStream = nullptr;
        UpdateContentUI();
    }

void radioTone_Checked | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Definition at line 211 of file Scenario3.cpp.

    {
        m_contentType = ContentType::Tone;
        UpdateContentProps(L"");
        m_contentStream = nullptr;
        UpdateContentUI();
    }

fire_and_forget ReadTextButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void sliderFrequency_ValueChanged | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const & | e
 | ) |  |
void sliderVolume_ValueChanged | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const & | e
 | ) |  |
void StartDevice ( )

Definition at line 404 of file Scenario3.cpp.

    {
        if (m_renderer == nullptr)
        {
            // Call from main UI thread
            InitializeDevice();
        }
        else
        {
            // Starts a work item to begin playback, likely in the paused state
            m_renderer->StartPlayback();
        }
    }

void StartFadeOutContents ( ) [private]

Definition at line 74 of file Scenario3.cpp.

    {
        CompleteCurrentAnimation();
        animationCompleteEvent.attach(CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_MODIFY_STATE | SYNCHRONIZE));
        check_bool(static_cast<bool>(animationCompleteEvent));

        fadeOutStoryboard.Begin();
    }

void StopDevice ( )

Definition at line 418 of file Scenario3.cpp.

    {
        if (m_renderer)
        {
            // Set the event to stop playback
            m_renderer->StopPlaybackAsync();
        }
    }

void UpdateContentProps ( hstring const & text )

Definition at line 178 of file Scenario3.cpp.

    {
        // Ignore calls triggered by binding before construction is complete.
        if (txtContentProps() == nullptr)
        {
            return;
        }

        txtContentProps().Text(text);

        if (text.empty() && (m_contentType == ContentType::File))
        {
            txtContentProps().Background(SolidColorBrush({ 0xCC, 0xFF, 0x00, 0x00 }));
        }
        else
        {
            txtContentProps().Background(nullptr);
        }
    }

void UpdateContentUI ( )

Definition at line 105 of file Scenario3.cpp.

    {
        // Ignore calls triggered by binding before construction is complete.
        if (radioFile() == nullptr)
        {
            return;
        }

        radioFile().IsEnabled(true);
        radioTone().IsEnabled(true);

        switch (m_contentType)
        {
        case ContentType::Tone:
            btnFilePicker().IsEnabled(false);
            sliderFrequency().IsEnabled(true);
            UpdateContentProps(to_hstring(sliderFrequency().Value()) + L" Hz");
            break;

        case ContentType::File:
            btnFilePicker().IsEnabled(true);
            sliderFrequency().IsEnabled(false);
            break;

        default:
            break;
        }
    }

void UpdateControls ( ) [private]

Definition at line 88 of file Scenario3.cpp.

{
    if (_instance.LoggingEnabled())
    {
        InputTextBlock1().Text(
            L"Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.");
        EnableDisableLoggingButton().Content(box_value(L"Disable Logging"));

        if (_instance.IsBusy())
        {
            EnableDisableLoggingButton().IsEnabled(false);
            DoScenarioButton().IsEnabled(false);
        }
        else
        {
            EnableDisableLoggingButton().IsEnabled(true);
            DoScenarioButton().IsEnabled(true);
        }
    }
    else
    {
        InputTextBlock1().Text(
            L"Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.");
        EnableDisableLoggingButton().Content(box_value(L"Enable Logging"));
        DoScenarioButton().IsEnabled(false);
        EnableDisableLoggingButton().IsEnabled(!_instance.IsBusy());
    }
}

void UpdateMediaControlUI ( DeviceState deviceState )

Definition at line 135 of file Scenario3.cpp.

    {
        switch (deviceState)
        {
        case DeviceState::Playing:
            btnPlay().IsEnabled(false);
            btnStop().IsEnabled(true);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(true);
            toggleMinimumLatency().IsEnabled(false);
            break;

        case DeviceState::Stopped:
        case DeviceState::Error:
            btnPlay().IsEnabled(true);
            btnStop().IsEnabled(false);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(false);
            toggleMinimumLatency().IsEnabled(true);

            UpdateContentUI();
            break;

        case DeviceState::Paused:
            btnPlay().IsEnabled(true);
            btnStop().IsEnabled(true);
            btnPlayPause().IsEnabled(true);
            btnPause().IsEnabled(false);
            break;

        case DeviceState::Starting:
        case DeviceState::Stopping:
            btnPlay().IsEnabled(false);
            btnStop().IsEnabled(false);
            btnPlayPause().IsEnabled(false);
            btnPause().IsEnabled(false);

            DisableContentUI();
            break;
        }
    }

fire_and_forget WriteTextButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

FileLoggingSessionScenario& _instance = FileLoggingSessionScenario::Instance() [private]

Definition at line 57 of file Scenario3.h.

event_token _statusChangedToken [private]

Definition at line 58 of file Scenario3.h.

handle animationCompleteEvent [private]

Definition at line 34 of file Scenario3.h.

Windows::UI::Xaml::Media::Animation::Storyboard fadeOutStoryboard [private]

Definition at line 32 of file Scenario3.h.

event_token fadeOutToken [private]

Definition at line 31 of file Scenario3.h.

clock::time_point lastFadeOutTime = clock::time_point::min() [private]

Definition at line 33 of file Scenario3.h.

ContentType m_contentType = ContentType::Tone [private]

Definition at line 65 of file Scenario3.h.

event_token m_deviceStateChangeToken [private]

Definition at line 56 of file Scenario3.h.

bool m_deviceSupportsRawMode = false [private]

Definition at line 61 of file Scenario3.h.

bool m_isMinimumLatency = false [private]

Definition at line 62 of file Scenario3.h.

com_ptr<WASAPIRenderer> m_renderer [private]

Definition at line 66 of file Scenario3.h.

event_token m_systemMediaControlsButtonToken [private]

Definition at line 59 of file Scenario3.h.

event_token visibilityToken [private]

Definition at line 29 of file Scenario3.h.

The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario3.h
  • Logging/cppwinrt/Scenario3.h
  • MultipleViews/cppwinrt/Scenario3.h
  • WindowsAudioSession/cppwinrt/Scenario3.h
  • FileThumbnails/cppwinrt/Scenario3.h
  • FolderEnumeration/cppwinrt/Scenario3.h
  • FileAccess/cppwinrt/Scenario3.cpp
  • FileThumbnails/cppwinrt/Scenario3.cpp
  • FolderEnumeration/cppwinrt/Scenario3.cpp
  • Logging/cppwinrt/Scenario3.cpp
  • MultipleViews/cppwinrt/Scenario3.cpp
  • WindowsAudioSession/cppwinrt/Scenario3.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ActiveSymbologies Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ActiveSymbologies
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_ActiveSymbologies Struct Reference

#include "Scenario3_ActiveSymbologies.h"

List of all members.

Public Member Functions

Scenario3_ActiveSymbologies ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | ScenarioEndScanButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | ScenarioStartScanButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | SetActiveSymbologies_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | claimedScanner_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (Windows::Foundation::IInspectable const &, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &e)
void | ResetTheScenarioState ()

Private Attributes

event_token | m_scannerDataReceivedToken
event_token | m_scannerReleaseRequestedToken

Detailed Description

Definition at line 18 of file Scenario3_ActiveSymbologies.h.

Constructor & Destructor Documentation

Scenario3_ActiveSymbologies ( )

Definition at line 19 of file Scenario3_ActiveSymbologies.cpp.

    {
        InitializeComponent();

        m_listOfSymbologies = single_threaded_observable_vector<SDKTemplate::SymbologyListEntry>();
        SymbologyListSource().Source(m_listOfSymbologies);
    }

Member Function Documentation

fire_and_forget claimedScanner_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | ,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [private]
void claimedScanner_ReleaseDeviceRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void ResetTheScenarioState ( ) [private]

Reset the Scenario state.

Definition at line 141 of file Scenario3_ActiveSymbologies.cpp.

    {
        if (m_claimedScanner)
        {
            // Detach the event handlers
            m_claimedScanner.DataReceived(m_scannerDataReceivedToken);
            m_claimedScanner.ReleaseDeviceRequested(m_scannerReleaseRequestedToken);

            // Release the Barcode Scanner and set to nullptr
            m_claimedScanner.Close();
            m_claimedScanner = nullptr;
        }

        if (m_scanner)
        {
            m_scanner.Close();
            m_scanner = nullptr;
        }

        // Reset the UI if we are still the current page.
        if (Frame().Content() == *this)
        {
            m_rootPage.NotifyUser(L"Click the start scanning button to begin.", NotifyType::StatusMessage);
            ScenarioOutputScanData().Text(L"No data");
            ScenarioOutputScanDataLabel().Text(L"No data");
            ScenarioOutputScanDataType().Text(L"No data");

            // reset the button state
            SetActiveSymbologiesButton().IsEnabled(false);
            ScenarioEndScanButton().IsEnabled(false);
            ScenarioStartScanButton().IsEnabled(true);

            // reset symbology list
            m_listOfSymbologies.Clear();
        }
    }

void ScenarioEndScanButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget ScenarioStartScanButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SetActiveSymbologies_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

event_token m_scannerDataReceivedToken [private]

Definition at line 37 of file Scenario3_ActiveSymbologies.h.

event_token m_scannerReleaseRequestedToken [private]

Definition at line 30 of file Scenario3_ActiveSymbologies.h.

The documentation for this struct was generated from the following files:
  • BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.h
  • BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_AppCapture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_AppCapture
Public Member Functions | Private Member Functions

Scenario3_AppCapture Struct Reference

#include "Scenario3_AppCapture.h"

List of all members.

Public Member Functions

Scenario3_AppCapture ()
fire_and_forget | AllowAppCaptureCheckBox_Toggled (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | AppCapture_CapturingChanged (Windows::Media::Capture::AppCapture const &, Windows::Foundation::IInspectable const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Member Functions

void | UpdateCaptureStatus ()

Detailed Description

Definition at line 18 of file Scenario3_AppCapture.h.

Constructor & Destructor Documentation

Scenario3_AppCapture ( )

Definition at line 25 of file Scenario3_AppCapture.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget AllowAppCaptureCheckBox_Toggled | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void AppCapture_CapturingChanged | ( | Windows::Media::Capture::AppCapture const & | ,
 |  | Windows::Foundation::IInspectable const & |
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void UpdateCaptureStatus ( ) [private]

Definition at line 57 of file Scenario3_AppCapture.cpp.

    {
        hstring audioStatus = appCapture.IsCapturingAudio() ? L"Audio is being captured." : L"Audio is not being captured.";
        hstring videoStatus = appCapture.IsCapturingVideo() ? L"Video is being captured." : L"Video is not being captured.";
        rootPage.NotifyUser(audioStatus + L"\n" + videoStatus, NotifyType::StatusMessage);
    }

The documentation for this struct was generated from the following files:
  • DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.h
  • DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.cpp
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundDeviceWatcher Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_BackgroundDeviceWatcher
Public Member Functions | Private Member Functions

Scenario3_BackgroundDeviceWatcher Struct Reference

#include "Scenario3_BackgroundDeviceWatcher.h"

List of all members.

Public Member Functions

Scenario3_BackgroundDeviceWatcher ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | OnTaskCompleted (Windows::ApplicationModel::Background::BackgroundTaskRegistration const &task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs const &args)
void | RegisterBackgroundTask (Windows::ApplicationModel::Background::DeviceWatcherTrigger const &deviceWatcherTrigger)
void | StartWatcher ()
void | StopWatcher ()
void | UnregisterBackgroundTask (Windows::ApplicationModel::Background::IBackgroundTaskRegistration const &taskReg)

Detailed Description

Definition at line 20 of file Scenario3_BackgroundDeviceWatcher.h.

Constructor & Destructor Documentation

Scenario3_BackgroundDeviceWatcher ( )

Definition at line 31 of file Scenario3_BackgroundDeviceWatcher.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnTaskCompleted | ( | Windows::ApplicationModel::Background::BackgroundTaskRegistration const & | task,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs const & | args |
 | ) |  |  | [private]
void RegisterBackgroundTask ( Windows::ApplicationModel::Background::DeviceWatcherTrigger const & deviceWatcherTrigger ) [private]
void StartWatcher ( ) [private]

Definition at line 73 of file Scenario3_BackgroundDeviceWatcher.cpp.

    {
        std::vector<DeviceWatcherEventKind> triggerEventKinds = { DeviceWatcherEventKind::Add, DeviceWatcherEventKind::Remove, DeviceWatcherEventKind::Update };

        startWatcherButton().IsEnabled(false);

        // First get the device selector chosen by the UI.
        IInspectable item = selectorComboBox().SelectedItem();
        DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(item);

        DeviceWatcher deviceWatcher{ nullptr };
        if (deviceSelectorInfo->Selector().empty())
        {
            // If a pre-canned device class selector was chosen, call the DeviceClass overload
            deviceWatcher = DeviceInformation::CreateWatcher(deviceSelectorInfo->DeviceClassSelector());
        }
        else if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
        {
            // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
            // Kind will be determined by the selector
            deviceWatcher = DeviceInformation::CreateWatcher(
                deviceSelectorInfo->Selector(),
                nullptr // don't request additional properties for this sample
            );
        }
        else
        {
            // Kind is specified in the selector info
            deviceWatcher = DeviceInformation::CreateWatcher(
                deviceSelectorInfo->Selector(),
                nullptr, // don't request additional properties for this sample
                deviceSelectorInfo->Kind());
        }

        //
        // Get the background trigger for this watcher
        DeviceWatcherTrigger deviceWatcherTrigger = deviceWatcher.GetBackgroundTrigger(triggerEventKinds);

        rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);

        // Register this trigger for our background task
        RegisterBackgroundTask(deviceWatcherTrigger);

        stopWatcherButton().IsEnabled(true);
    }

void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcher ( ) [private]

Definition at line 150 of file Scenario3_BackgroundDeviceWatcher.cpp.

    {
        stopWatcherButton().IsEnabled(false);
        if (backgroundTaskRegistration != nullptr)
        {
            UnregisterBackgroundTask(backgroundTaskRegistration);
        }
        startWatcherButton().IsEnabled(true);
    }

void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UnregisterBackgroundTask ( Windows::ApplicationModel::Background::IBackgroundTaskRegistration const & taskReg ) [private]
The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_BackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_BackgroundTask
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario3_BackgroundTask Struct Reference

#include "Scenario3_BackgroundTask.h"

List of all members.

Public Member Functions

Scenario3_BackgroundTask ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | RegisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | UnregisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | OnCompleted (Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e)
void | UpdateButtonStates ()

Private Attributes

Windows::ApplicationModel::Background::IBackgroundTaskRegistration | m_geolocTask

Static Private Attributes

static constexpr std::wstring_view | BackgroundTaskEntryPoint = name_of<BackgroundTask::LocationBackgroundTask>()
static constexpr wchar_t | BackgroundTaskName [] = "SampleLocationBackgroundTask"

Detailed Description

Definition at line 18 of file Scenario3_BackgroundTask.h.

Constructor & Destructor Documentation

Scenario3_BackgroundTask ( )

Definition at line 27 of file Scenario3_BackgroundTask.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnCompleted | ( | Windows::ApplicationModel::Background::IBackgroundTaskRegistration | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void RegisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UnregisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateButtonStates ( ) [private]

Definition at line 128 of file Scenario3_BackgroundTask.cpp.

    {
        bool registered = (m_geolocTask != nullptr);
        RegisterBackgroundTaskButton().IsEnabled(!registered);
        UnregisterBackgroundTaskButton().IsEnabled(registered);
    }

Member Data Documentation

constexpr std::wstring_view BackgroundTaskEntryPoint = name_of<BackgroundTask::LocationBackgroundTask>() [static, private]

Definition at line 33 of file Scenario3_BackgroundTask.h.

constexpr wchar_t BackgroundTaskName[] = "SampleLocationBackgroundTask" [static, private]

Definition at line 32 of file Scenario3_BackgroundTask.h.

Windows::ApplicationModel::Background::IBackgroundTaskRegistration m_geolocTask [private]

Definition at line 28 of file Scenario3_BackgroundTask.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario3_BackgroundTask.h
  • Geolocation/cppwinrt/Scenario3_BackgroundTask.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CheckUserConsentGroup Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_CheckUserConsentGroup
Public Member Functions | Static Private Member Functions

Scenario3_CheckUserConsentGroup Struct Reference

#include "Scenario3_CheckUserConsentGroup.h"

List of all members.

Public Member Functions

Scenario3_CheckUserConsentGroup ()
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ShowConsentGroups (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Static Private Member Functions

static hstring | EvaluateConsentResult (Windows::System::UserAgeConsentResult consentResult)

Detailed Description

Definition at line 18 of file Scenario3_CheckUserConsentGroup.h.

Constructor & Destructor Documentation

Scenario3_CheckUserConsentGroup ( )

Definition at line 27 of file Scenario3_CheckUserConsentGroup.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

static hstring EvaluateConsentResult ( Windows::System::UserAgeConsentResult consentResult ) [static, private]
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )

Definition at line 32 of file Scenario3_CheckUserConsentGroup.cpp.

    {
        auto lifetime = get_strong();

        auto users = co_await Helpers::GetUserViewModelsAsync();
        UserList().DataContext(users);
        if (users.Size() > 0)
        {
            UserList().SelectedIndex(0);
        }
    }

fire_and_forget ShowConsentGroups | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Definition at line 61 of file Scenario3_CheckUserConsentGroup.cpp.

    {
        auto lifetime = get_strong();

        auto selectedUser = UserList().SelectedValue().as<SDKTemplate::UserViewModel>();
        if (selectedUser != nullptr)
        {
            ResultsText().Text(L"");
            rootPage.NotifyUser(L"", NotifyType::StatusMessage);
            try
            {
                User user = User::GetFromId(selectedUser.UserId());

                UserAgeConsentResult canShowChildContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Child);
                hstring result = L"Child content: " + EvaluateConsentResult(canShowChildContent) + L"\n";

                UserAgeConsentResult canShowMinorContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Minor);
                result = result + L"Minor content: " + EvaluateConsentResult(canShowMinorContent) + L"\n";

                UserAgeConsentResult canShowAdultContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Adult);
                result = result + L"Adult content: " + EvaluateConsentResult(canShowAdultContent) + L"\n";

                ResultsText().Text(result);
            }
            catch (hresult_error const& ex)
            {
                // Operations on the "User" object fail if the user signs out.
                rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
            }
        }
    }

The documentation for this struct was generated from the following files:
  • UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.h
  • UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Choosing Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_Choosing
Public Member Functions | Private Member Functions

Scenario3_Choosing Struct Reference

#include "Scenario3_Choosing.h"

List of all members.

Public Member Functions

Scenario3_Choosing ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ScenarioPick_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ScenarioReadSelected_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ScenarioStart_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ScenarioStop_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

fire_and_forget | OnHumanPresenceSensorAdded (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformation deviceInfo)
fire_and_forget | OnHumanPresenceSensorEnumerationCompleted (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Foundation::IInspectable const &e)
fire_and_forget | OnHumanPresenceSensorRemoved (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate update)
fire_and_forget | OnHumanPresenceSensorUpdated (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate update)
Windows::Foundation::IAsyncAction | ReadOneReadingFromSensorAsync (Windows::Devices::Enumeration::DeviceInformation deviceInfo)

Detailed Description

Definition at line 18 of file Scenario3_Choosing.h.

Constructor & Destructor Documentation

Scenario3_Choosing ( )

Definition at line 30 of file Scenario3_Choosing.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnHumanPresenceSensorAdded | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformation | deviceInfo |
 | ) |  |  | [private]
fire_and_forget OnHumanPresenceSensorEnumerationCompleted | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
fire_and_forget OnHumanPresenceSensorRemoved | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | update |
 | ) |  |  | [private]
fire_and_forget OnHumanPresenceSensorUpdated | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate | update |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
Windows::Foundation::IAsyncAction ReadOneReadingFromSensorAsync ( Windows::Devices::Enumeration::DeviceInformation deviceInfo ) [private]
fire_and_forget ScenarioPick_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ScenarioReadSelected_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ScenarioStart_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ScenarioStop_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PresenceSensor/cppwinrt/Scenario3_Choosing.h
  • PresenceSensor/cppwinrt/Scenario3_Choosing.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ClientAuthentication Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ClientAuthentication
Public Member Functions | Private Member Functions

Scenario3_ClientAuthentication Struct Reference

#include "Scenario3_ClientAuthentication.h"

List of all members.

Public Member Functions

Scenario3_ClientAuthentication ()
Windows::Foundation::IAsyncAction | OnConnect (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnDisconnect (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Private Member Functions

void | AppendOutputLine (hstring const &value)
void | CloseSocket ()
Windows::Foundation::IAsyncAction | ConnectWebSocketAsync ()
Windows::Foundation::IAsyncOperation
< Windows::Security::Cryptography::Certificates::Certificate > 		FindCertificateFromStoreAsync ()
Windows::Foundation::IAsyncOperation
< Windows::Security::Cryptography::Certificates::Certificate > 		GetClientCertificateAsync ()
Windows::Foundation::IAsyncOperation
< Windows::Security::Cryptography::Certificates::Certificate > 		InstallClientCertificateAsync ()
Windows::Foundation::IAsyncAction | OnClosed (Windows::Networking::Sockets::IWebSocket sender, Windows::Networking::Sockets::WebSocketClosedEventArgs e)
void | SetBusy (bool value)
void | UpdateVisualState ()

Detailed Description

Definition at line 18 of file Scenario3_ClientAuthentication.h.

Constructor & Destructor Documentation

Scenario3_ClientAuthentication ( )

Definition at line 29 of file Scenario3_ClientAuthentication.cpp.

    {
        InitializeComponent();
        UpdateVisualState();
    }

Member Function Documentation

void AppendOutputLine ( hstring const & value ) [private]

Definition at line 270 of file Scenario3_ClientAuthentication.cpp.

    {
        OutputField().Text(OutputField().Text() + value + L"\r\n");
    }

void CloseSocket ( ) [private]

Definition at line 253 of file Scenario3_ClientAuthentication.cpp.

    {
        if (m_streamWebSocket)
        {
            try
            {
                m_streamWebSocket.Close(1000, L"Closed due to user request.");
            }
            catch (winrt::hresult_error const& ex)
            {
                AppendOutputLine(BuildWebSocketError(ex));
                AppendOutputLine(ex.message());
            }
            m_streamWebSocket = nullptr;
        }
    }

IAsyncAction ConnectWebSocketAsync ( ) [private]

Definition at line 166 of file Scenario3_ClientAuthentication.cpp.

    {
        auto lifetime = get_strong();

        // Validating the URI is required since it was received from an untrusted source (user input).
        // The URI is validated by calling TryGetUri() that will return null for strings that are not
        // valid WebSocket URIs.
        // Note that when enabling the text box users may provide URIs to machines on the intrAnet
        // or intErnet. In these cases the app requires the "Home or Work Networking" or
        // "Internet (Client)" capability respectively.
        Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
        if (server == nullptr)
        {
            return;
        }

        // Certificate validation is meaningful only for secure connections.
        if (server.SchemeName() != L"wss")
        {
            AppendOutputLine(L"Note: Certificate validation is performed only for the wss: scheme.");
        }

        m_streamWebSocket = StreamWebSocket();
        m_streamWebSocket.Closed({ get_weak(), &Scenario3_ClientAuthentication::OnClosed });

        // It is okay to set the ClientCertificate property even if GetClientCertificateAsync returns null.
        Certificate certificate = co_await GetClientCertificateAsync();
        m_streamWebSocket.Control().ClientCertificate(certificate);

        // When connecting to wss:// endpoint, the OS by default performs validation of
        // the server certificate based on well-known trusted CAs. For testing purposes, we are ignoring
        // SSL errors.
        // WARNING: Only test applications should ignore SSL errors.
        // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
        // attacks. (Although the connection is secure, the server is not authenticated.)
        // Note that not all certificate validation errors can be ignored.
        // In this case, we are ignoring these errors since the certificate assigned to the localhost
        // URI is self-signed and has subject name = fabrikam.com
        m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
        m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);

        AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");

        try
        {
            co_await m_streamWebSocket.ConnectAsync(server);
        }
        catch (winrt::hresult_error const& ex) // For debugging
        {
            m_streamWebSocket.Close();
            m_streamWebSocket = nullptr;

            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }

        m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);
        AppendOutputLine(L"Connected to WebSocket Server.");
    }

IAsyncOperation< Certificate > FindCertificateFromStoreAsync ( ) [private]

Definition at line 71 of file Scenario3_ClientAuthentication.cpp.

    {
        auto lifetime = get_strong();

        // Find the client certificate for authentication. If not found, it means it has not been installed.
        CertificateQuery query;
        query.IssuerName(m_ClientCertIssuerName);
        query.FriendlyName(m_ClientCertFriendlyName);

        IVectorView<Certificate> certs = co_await CertificateStores::FindAllAsync(query);
        if (certs.Size() == 0)
        {
            co_return nullptr;
        }

        // This sample installs only one certificate, so if we find one, it must be ours.
        co_return certs.GetAt(0);
    }

IAsyncOperation< Certificate > GetClientCertificateAsync ( ) [private]

Definition at line 150 of file Scenario3_ClientAuthentication.cpp.

    {
        auto lifetime = get_strong();

        // The client certificate could be installed already (if this scenario has been run before),
        // try finding it from the store.
        Certificate cert = co_await FindCertificateFromStoreAsync();
        if (cert != nullptr)
        {
            co_return cert;
        }

        // If the client certificate is not already installed, install it.
        co_return co_await InstallClientCertificateAsync();
    }

IAsyncOperation< Certificate > InstallClientCertificateAsync ( ) [private]

Definition at line 90 of file Scenario3_ClientAuthentication.cpp.

    {
        auto lifetime = get_strong();

        // Load the certificate from the clientCert.pfx file packaged with this sample.
        // This certificate has been signed with a trusted root certificate installed on the server.
        // The installation is done by running the setupServer.ps1 file, which should have been done
        // before running the app.
        // WARNING: Including a pfx file in the app package violates the Windows Store
        // certification requirements. We are shipping the pfx file with the package for demonstrating
        // the usage of client certificates. Apps that will be published through Windows Store
        // need to use other approaches to obtain a client certificate.
        Uri clientCertUri(m_ClientCertUriPath);
        StorageFile clientCertFile = co_await StorageFile::GetFileFromApplicationUriAsync(clientCertUri);

        IBuffer buffer = co_await FileIO::ReadBufferAsync(clientCertFile);
        AppendOutputLine(L"Reading certificate succeeded.");

        hstring clientCertData = Windows::Security::Cryptography::CryptographicBuffer::EncodeToBase64String(buffer);

        try
        {
            // Install the certificate to the app's certificate store.
            // The app certificate store is removed when the app is uninstalled.

            // To install a certificate to the CurrentUser\MY store, which is not app specific,
            // you need to use CertificateEnrollmentManager.UserCertificateEnrollmentManager.ImportPfxDataAsync().
            // In order to call that method, an app must have the "sharedUserCertificates" capability.
            // There are two ways to add this capability:
            //
            // 1. You can double click on the Package.appxmanifest file from the
            // solution explorer, select the "Capabilities" tab in the opened page, and then check the
            // "Shared User Certificates" box from the capabilities list.
            // 2. You can right click on the Package.appxmanifest file from the
            // solution explorer, select "View Code", and add "sharedUserCertificates" under the <Capabilities>
            // element directly.
            // Package.appxmanifest in this sample shows this capability commented out.
            //
            // The certificate will remain even when the app is uninstalled.
            co_await CertificateEnrollmentManager::ImportPfxDataAsync(
                clientCertData,
                m_ClientCertPassword,
                ExportOption::Exportable,
                KeyProtectionLevel::NoConsent,
                InstallOptions::DeleteExpired,
                m_ClientCertFriendlyName);

            AppendOutputLine(L"Installing certificate succeeded.");

            // Return the certificate we just installed.
            co_return co_await FindCertificateFromStoreAsync();
        }
        catch (winrt::hresult_error const& ex)
        {
            // This can happen if the certificate has already expired.
            AppendOutputLine(L"Installing certificate failed with " + ex.message());
            co_return nullptr;
        }
    }

Windows::Foundation::IAsyncAction OnClosed | ( | Windows::Networking::Sockets::IWebSocket | sender,
 |  | Windows::Networking::Sockets::WebSocketClosedEventArgs | e |
 | ) |  |  | [private]
Windows::Foundation::IAsyncAction OnConnect | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnDisconnect | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void SetBusy ( bool value ) [private]

Definition at line 56 of file Scenario3_ClientAuthentication.cpp.

    {
        m_busy = value;
        UpdateVisualState();
    }

void UpdateVisualState ( ) [private]

Definition at line 40 of file Scenario3_ClientAuthentication.cpp.

    {
        if (m_busy)
        {
            VisualStateManager::GoToState(*this, L"Busy", false);
        }
        else if (m_streamWebSocket != nullptr)
        {
            VisualStateManager::GoToState(*this, L"Connected", false);
        }
        else
        {
            VisualStateManager::GoToState(*this, L"Disconnected", false);
        }
    }

The documentation for this struct was generated from the following files:
  • WebSocket/cppwinrt/Scenario3_ClientAuthentication.h
  • WebSocket/cppwinrt/Scenario3_ClientAuthentication.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CurrencyFormatting Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_CurrencyFormatting
Public Member Functions

Scenario3_CurrencyFormatting Struct Reference

#include "Scenario3_CurrencyFormatting.h"

List of all members.

Public Member Functions

Scenario3_CurrencyFormatting ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario3_CurrencyFormatting.h.

Constructor & Destructor Documentation

Scenario3_CurrencyFormatting ( )

Definition at line 25 of file Scenario3_CurrencyFormatting.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.h
  • NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_CustomItems Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_CustomItems
Public Member Functions

Scenario3_CustomItems Struct Reference

#include "Scenario3_CustomItems.h"

List of all members.

Public Member Functions

Scenario3_CustomItems ()
fire_and_forget | AddToJumpList_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DescriptionLocalizedResource_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | DisplayNameLocalizedResource_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | GroupNameLocalizedResource_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario3_CustomItems.h.

Constructor & Destructor Documentation

Scenario3_CustomItems ( )

Definition at line 24 of file Scenario3_CustomItems.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget AddToJumpList_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DescriptionLocalizedResource_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void DisplayNameLocalizedResource_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void GroupNameLocalizedResource_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • JumpList/cppwinrt/Scenario3_CustomItems.h
  • JumpList/cppwinrt/Scenario3_CustomItems.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Enum Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_Enum
Public Member Functions

Scenario3_Enum Struct Reference

#include "Scenario3_Enum.h"

List of all members.

Public Member Functions

Scenario3_Enum ()
void ShowResults_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario3_Enum.h.

Constructor & Destructor Documentation

Scenario3_Enum ( )

Definition at line 24 of file Scenario3_Enum.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Calendar/cppwinrt/Scenario3_Enum.h
  • Calendar/cppwinrt/Scenario3_Enum.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_EnumerateTiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_EnumerateTiles
Public Member Functions

Scenario3_EnumerateTiles Struct Reference

#include "Scenario3_EnumerateTiles.h"

List of all members.

Public Member Functions

Scenario3_EnumerateTiles ()
fire_and_forget EnumerateSecondaryTiles_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario3_EnumerateTiles.h.

Constructor & Destructor Documentation

Scenario3_EnumerateTiles ( )

Definition at line 25 of file Scenario3_EnumerateTiles.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget EnumerateSecondaryTiles_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.h
  • SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_InkingFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_InkingFeedback
Public Member Functions | Private Member Functions

Scenario3_InkingFeedback Struct Reference

#include "Scenario3_InkingFeedback.h"

List of all members.

Public Member Functions

Scenario3_InkingFeedback ()
void | HapticCanvas_Entered (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | HapticCanvas_Exited (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)

Private Member Functions

Windows::Devices::Haptics::SimpleHapticsControllerFeedback | GetSelectedFeedbackOrFallback (std::wstring &message)

Detailed Description

Definition at line 19 of file Scenario3_InkingFeedback.h.

Constructor & Destructor Documentation

Scenario3_InkingFeedback ( )

Definition at line 31 of file Scenario3_InkingFeedback.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback ( std::wstring & message ) [private]

Definition at line 113 of file Scenario3_InkingFeedback.cpp.

    {
        // Look up the waveform the user selected.
        hstring name = waveformComboBox().SelectionBoxItem().as<hstring>();
        uint16_t waveform = WaveformNamesMap().at(name);

        // See if the haptics controller supports the selected waveform.
        SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, waveform);
        if (feedback != nullptr)
        {
            message = L"Waveform set to " + name;
            return feedback;
        }

        // It does not. Use InkContinuous as a fallback.
        message = name + L" is not supported by this pen, so falling back to InkContinuous";
        return FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::InkContinuous());
    }

void HapticCanvas_Entered | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void HapticCanvas_Exited | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PenHaptics/cppwinrt/Scenario3_InkingFeedback.h
  • PenHaptics/cppwinrt/Scenario3_InkingFeedback.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_MasterDetail Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_MasterDetail
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_MasterDetail Struct Reference

#include "Scenario3_MasterDetail.h"

List of all members.

Public Member Functions

Scenario3_MasterDetail ()
void | AddItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | CancelSelection (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DeleteItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DeleteItems (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnCurrentStateChanged (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::VisualStateChangedEventArgs const &)
void | OnItemClick (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::ItemClickEventArgs const &e)
void | OnLoaded (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnSelectionChanged (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &)
void | SelectItems (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | EnableContentTransitions ()
void | SelectSomethingIfPossible ()

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Contact > 		Contacts

Detailed Description

Definition at line 17 of file Scenario3_MasterDetail.h.

Constructor & Destructor Documentation

Scenario3_MasterDetail ( )

Definition at line 27 of file Scenario3_MasterDetail.cpp.

    {
        InitializeComponent();

        // Generate the list of contacts.
        // Remember to enable the NavigationCacheMode of this Page to avoid
        // loading the data every time user navigates back and forward.
        Contacts = Contact::GetContacts(140);
        if (Contacts.Size() > 0)
        {
            MasterListView().ItemsSource(Contacts);
        }
    }

Member Function Documentation

void AddItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void CancelSelection | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DeleteItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DeleteItems | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void EnableContentTransitions ( ) [private]

Definition at line 145 of file Scenario3_MasterDetail.cpp.

    {
        DetailContentPresenter().ContentTransitions().ReplaceAll({ EntranceThemeTransition() });
    }

void OnCurrentStateChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::VisualStateChangedEventArgs const & |
 | ) |  |
void OnItemClick | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::ItemClickEventArgs const & | e
 | ) |  |
void OnLoaded | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnSelectionChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & |
 | ) |  |
void SelectItems | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void SelectSomethingIfPossible ( ) [private]

Definition at line 166 of file Scenario3_MasterDetail.cpp.

    {
        if (Contacts.Size() > 0)
        {
            MasterListView().SelectedIndex(0);
        }
        else
        {
            // Collapse the Details view if there are no items.
            DetailContentPresenter().Visibility(Visibility::Collapsed);
        }
    }

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::Contact> Contacts [private]

Definition at line 33 of file Scenario3_MasterDetail.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario3_MasterDetail.h
  • XamlListView/cppwinrt/Scenario3_MasterDetail.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_NetworkConnectivityChanges Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_NetworkConnectivityChanges
Public Member Functions | Private Member Functions | Private Attributes

Scenario3_NetworkConnectivityChanges Struct Reference

#include "Scenario3_NetworkConnectivityChanges.h"

List of all members.

Public Member Functions

Scenario3_NetworkConnectivityChanges ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OptInOutComboBox_SelectionChanged (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &)
void | RegisterUnregisterButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | OnNetworkStatusChanged (Windows::Foundation::IInspectable const &)
void | RegisterNetworkStatusChanged ()
void | UnregisterNetworkStatusChanged ()
void | UpdateButtonStates ()
fire_and_forget | UpdateNetworkStatus ()

Private Attributes

bool | m_isNetworkStatusUpdatePending = false
bool | m_isUpdatingNetworkStatus = false

Detailed Description

Definition at line 16 of file Scenario3_NetworkConnectivityChanges.h.

Constructor & Destructor Documentation

Scenario3_NetworkConnectivityChanges ( )

Definition at line 28 of file Scenario3_NetworkConnectivityChanges.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnNetworkStatusChanged ( Windows::Foundation::IInspectable const & ) [private]
void OptInOutComboBox_SelectionChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & |
 | ) |  |
void RegisterNetworkStatusChanged ( ) [private]

Definition at line 97 of file Scenario3_NetworkConnectivityChanges.cpp.

    {
        m_networkStatusChangeEventToken = NetworkInformation::NetworkStatusChanged({ get_weak(), &Scenario3_NetworkConnectivityChanges::OnNetworkStatusChanged });
        UpdateNetworkStatus();
    }

void RegisterUnregisterButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UnregisterNetworkStatusChanged ( ) [private]

Definition at line 103 of file Scenario3_NetworkConnectivityChanges.cpp.

    {
        NetworkInformation::NetworkStatusChanged(std::exchange(m_networkStatusChangeEventToken, {}));
    }

void UpdateButtonStates ( ) [private]

Update the UI based on whether we are registered for the event.

Definition at line 124 of file Scenario3_NetworkConnectivityChanges.cpp.

    {
        VisualStateManager::GoToState(*this, m_networkStatusChangeEventToken ? L"Registered" : L"Unregistered", false);
    }

fire_and_forget UpdateNetworkStatus ( ) [private]

Definition at line 46 of file Scenario3_NetworkConnectivityChanges.cpp.

    {
        // This code runs on the UI thread, so there are no race conditions on these
        // member variables.
        if (m_isUpdatingNetworkStatus)
        {
            // Update is already in progress. Let it finish before we re-evaluate.
            m_isNetworkStatusUpdatePending = true;
            co_return;
        }

        auto lifetime = get_strong();

        m_isUpdatingNetworkStatus = true;

        do
        {
            m_isNetworkStatusUpdatePending = false;
            ResultsText().Text(L"");

            ConnectionProfile internetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();
            NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel::None;
            if (internetConnectionProfile != nullptr)
            {
                connectivityLevel = internetConnectionProfile.GetNetworkConnectivityLevel();
            }

            AppendLine(ResultsText(), L"Current connectivity is " + to_hstring(connectivityLevel) + L".");
            if (ShouldAttemptToConnectToInternet(connectivityLevel))
            {
                AppendLine(ResultsText(), L"Checking network cost before connecting to the Internet.");
                co_await EvaluateCostAndConnectAsync(internetConnectionProfile.GetConnectionCost(), OptedInToNetworkUsageToggle().IsOn(), ResultsText());
            }
            else
            {
                AppendLine(ResultsText(), L"Not attempting to connect to the Internet.");
            }
        }
        while (m_isNetworkStatusUpdatePending);
        m_isUpdatingNetworkStatus = false;
    }

Member Data Documentation

bool m_isNetworkStatusUpdatePending = false [private]

Definition at line 34 of file Scenario3_NetworkConnectivityChanges.h.

bool m_isUpdatingNetworkStatus = false [private]

Definition at line 33 of file Scenario3_NetworkConnectivityChanges.h.

The documentation for this struct was generated from the following files:
  • NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.h
  • NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ParameterizedTemplate Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ParameterizedTemplate
Public Member Functions

Scenario3_ParameterizedTemplate Struct Reference

#include "Scenario3_ParameterizedTemplate.h"

List of all members.

Public Member Functions

Scenario3_ParameterizedTemplate ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario3_ParameterizedTemplate.h.

Constructor & Destructor Documentation

Scenario3_ParameterizedTemplate ( )

Definition at line 33 of file Scenario3_ParameterizedTemplate.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.h
  • DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Region Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_Region
Public Member Functions

Scenario3_Region Struct Reference

#include "Scenario3_Region.h"

List of all members.

Public Member Functions

Scenario3_Region ()
void ShowResults_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario3_Region.h.

Constructor & Destructor Documentation

Scenario3_Region ( )

Definition at line 35 of file Scenario3_Region.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • GlobalizationPreferences/cppwinrt/Scenario3_Region.h
  • GlobalizationPreferences/cppwinrt/Scenario3_Region.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ResetPIN Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ResetPIN
Public Member Functions

Scenario3_ResetPIN Struct Reference

#include "Scenario3_ResetPIN.h"

List of all members.

Public Member Functions

Scenario3_ResetPIN ()
fire_and_forget ResetPin_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario3_ResetPIN.h.

Constructor & Destructor Documentation

Scenario3_ResetPIN ( )

Definition at line 27 of file Scenario3_ResetPIN.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget ResetPin_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario3_ResetPIN.h
  • SmartCard/cppwinrt/Scenario3_ResetPIN.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SecondaryTiles Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_SecondaryTiles
Public Member Functions | Static Private Member Functions | Static Private Attributes

Scenario3_SecondaryTiles Struct Reference

#include "Scenario3_SecondaryTiles.h"

List of all members.

Public Member Functions

Scenario3_SecondaryTiles ()
fire_and_forget | CreateBadgeAndTextTile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | CreateBadgeTile_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Static Private Member Functions

static Windows::Foundation::Rect | GetElementRect (Windows::UI::Xaml::FrameworkElement const &element)

Static Private Attributes

static constexpr wchar_t | BADGE_TILE_ID [] = "ST_BADGE"
static constexpr wchar_t | TEXT_TILE_ID [] = "ST_BADGE_AND_TEXT"

Detailed Description

Definition at line 18 of file Scenario3_SecondaryTiles.h.

Constructor & Destructor Documentation

Scenario3_SecondaryTiles ( )

Definition at line 28 of file Scenario3_SecondaryTiles.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CreateBadgeAndTextTile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget CreateBadgeTile_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
static Windows::Foundation::Rect GetElementRect ( Windows::UI::Xaml::FrameworkElement const & element ) [static, private]

Member Data Documentation

constexpr wchar_t BADGE_TILE_ID[] = "ST_BADGE" [static, private]

Definition at line 28 of file Scenario3_SecondaryTiles.h.

constexpr wchar_t TEXT_TILE_ID[] = "ST_BADGE_AND_TEXT" [static, private]

Definition at line 29 of file Scenario3_SecondaryTiles.h.

The documentation for this struct was generated from the following files:
  • LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.h
  • LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ServerForeground Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ServerForeground
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes

Scenario3_ServerForeground Struct Reference

#include "Scenario3_ServerForeground.h"

List of all members.

Public Member Functions

Scenario3_ServerForeground ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | PublishButton_ClickAsync ()

Private Types

enum | CalculatorCharacteristics { Operand1 = 1, Operand2 = 2, Operator = 3 }
enum | CalculatorOperators { Add = 1, Subtract = 2, Multiply = 3, Divide = 4 }

Private Member Functions

int | ComputeResult ()
bool | IsValidOperator (CalculatorOperators op)
fire_and_forget | NotifyClientDevices (int computedValue)
fire_and_forget | Op1Characteristic_WriteRequestedAsync (Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args)
fire_and_forget | Op2Characteristic_WriteRequestedAsync (Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args)
fire_and_forget | OperatorCharacteristic_WriteRequestedAsync (Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args)
void | ProcessWriteCharacteristic (Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequest const &request, CalculatorCharacteristics opCode)
fire_and_forget | ResultCharacteristic_ReadRequestedAsync (Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattReadRequestedEventArgs args)
void | ResultCharacteristic_SubscribedClientsChanged (Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, IInspectable const &args)
void | ServiceProvider_AdvertisementStatusChanged (Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProvider const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisementStatusChangedEventArgs const &args)
Windows::Foundation::IAsyncOperation
< bool > 		ServiceProviderInitAsync ()
fire_and_forget | UpdateUX ()

Static Private Member Functions

static
Windows::Foundation::IAsyncOperation
< bool > 		CheckPeripheralRoleSupportAsync ()

Private Attributes

event_token | op1CharacteristicWriteToken
event_token | op2CharacteristicWriteToken
int | operand1Received = 0
int | operand2Received = 0
event_token | operatorCharacteristicWriteToken
CalculatorOperators operatorReceived
bool | peripheralSupported = false
event_token | resultCharacteristicClientsChangedToken
event_token | resultCharacteristicReadToken
int | resultVal = 0
event_token | serviceProviderAdvertisementChangedToken

Detailed Description

Definition at line 19 of file Scenario3_ServerForeground.h.

Member Enumeration Documentation

enum CalculatorCharacteristics [private]
Enumerator:
Operand1
Operand2
Operator

Definition at line 28 of file Scenario3_ServerForeground.h.

        {
            Operand1 = 1,
            Operand2 = 2,
            Operator = 3,
        };

enum CalculatorOperators [private]
Enumerator:
Add
Subtract
Multiply
Divide

Definition at line 35 of file Scenario3_ServerForeground.h.

        {
            Add = 1,
            Subtract = 2,
            Multiply = 3,
            Divide = 4,
        };

Constructor & Destructor Documentation

Scenario3_ServerForeground ( )

Definition at line 69 of file Scenario3_ServerForeground.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

IAsyncOperation< bool > CheckPeripheralRoleSupportAsync ( ) [static, private]

Definition at line 182 of file Scenario3_ServerForeground.cpp.

    {
        // BT_Code: New for Creator's Update - Bluetooth adapter has properties of the local BT radio.
        auto localAdapter = co_await BluetoothAdapter::GetDefaultAsync();

        if (localAdapter != nullptr)
        {
            co_return localAdapter.IsPeripheralRoleSupported();
        }
        else
        {
            // Bluetooth is not turned on
            co_return false;
        }
    }

int ComputeResult ( ) [private]

Definition at line 361 of file Scenario3_ServerForeground.cpp.

    {
        int computedValue = 0;
        switch (operatorReceived)
        {
        case CalculatorOperators::Add:
            computedValue = operand1Received + operand2Received;
            break;
        case CalculatorOperators::Subtract:
            computedValue = operand1Received - operand2Received;
            break;
        case CalculatorOperators::Multiply:
            computedValue = operand1Received * operand2Received;
            break;
        case CalculatorOperators::Divide:
            if (operand2Received == 0 || (operand1Received == std::numeric_limits<int>::min() && operand2Received == -1))
            {
                rootPage.NotifyUser(L"Division overflow", NotifyType::ErrorMessage);
            }
            else
            {
                computedValue = operand1Received / operand2Received;
            }
            break;
        default:
            rootPage.NotifyUser(L"Invalid Operator", NotifyType::ErrorMessage);
            break;
        }
        NotifyClientDevices(computedValue);
        return computedValue;
    }

bool IsValidOperator ( CalculatorOperators op ) [inline, private]

Definition at line 43 of file Scenario3_ServerForeground.h.

        {
            return op >= CalculatorOperators::Add && op < CalculatorOperators::Divide;
        }

fire_and_forget NotifyClientDevices ( int computedValue ) [private]

Definition at line 393 of file Scenario3_ServerForeground.cpp.

    {
        auto lifetime = get_strong();
        DataWriter writer;
        writer.ByteOrder(ByteOrder::LittleEndian);
        writer.WriteInt32(computedValue);

        // BT_Code: Returns a collection of all clients that the notification was attempted and the result.
        IVectorView<GattClientNotificationResult> results = co_await resultCharacteristic.NotifyValueAsync(writer.DetachBuffer());

        rootPage.NotifyUser(L"Sent value " + to_hstring(computedValue) + L" to clients.", NotifyType::StatusMessage);
        for (GattClientNotificationResult&& result : results)
        {
            // An application can iterate through each registered client that was notified and retrieve the results:
            //
            // result.SubscribedClient(): The details on the remote client.
            // result.Status(): The GattCommunicationStatus
            // result.ProtocolError(): iff Status() == GattCommunicationStatus::ProtocolError
        }
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget Op1Characteristic_WriteRequestedAsync | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const & | sender,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget Op2Characteristic_WriteRequestedAsync | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const & | sender,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget OperatorCharacteristic_WriteRequestedAsync | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const & | sender,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs | args |
 | ) |  |  | [private]
void ProcessWriteCharacteristic | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequest const & | request,
 |  | CalculatorCharacteristics | opCode |
 | ) |  |  | [private]
fire_and_forget PublishButton_ClickAsync ( )

Definition at line 125 of file Scenario3_ServerForeground.cpp.

    {
        auto lifetime = get_strong();

        // Server not initialized yet - initialize it and start publishing
        if (serviceProvider == nullptr)
        {
            bool serviceStarted = co_await ServiceProviderInitAsync();
            if (serviceStarted)
            {
                rootPage.NotifyUser(L"Service successfully started", NotifyType::StatusMessage);
                PublishButton().Content(box_value(L"Stop Service"));
            }
            else
            {
                rootPage.NotifyUser(L"Service not started", NotifyType::ErrorMessage);
            }
        }
        else
        {
            // BT_Code: Stops advertising support for custom GATT Service
            serviceProvider.StopAdvertising();
            serviceProvider = nullptr;
            PublishButton().Content(box_value(L"Start Service"));
        }
    }

fire_and_forget ResultCharacteristic_ReadRequestedAsync | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const & | sender,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattReadRequestedEventArgs | args |
 | ) |  |  | [private]
void ResultCharacteristic_SubscribedClientsChanged | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const & | sender,
 |  | IInspectable const & | args |
 | ) |  |  | [private]
void ServiceProvider_AdvertisementStatusChanged | ( | Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProvider const & | sender,
 |  | Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisementStatusChangedEventArgs const & | args |
 | ) |  |  | [private]
IAsyncOperation< bool > ServiceProviderInitAsync ( ) [private]

Uses the relevant Service/Characteristic UUIDs to initialize, hook up event handlers and start a service on the local system.

Returns:

Definition at line 202 of file Scenario3_ServerForeground.cpp.

    {
        // BT_Code: Initialize and starting a custom GATT Service using GattServiceProvider.
        auto lifetime = get_strong();

        GattServiceProviderResult serviceResult = co_await GattServiceProvider::CreateAsync(Constants::CalcServiceUuid);
        if (serviceResult.Error() == BluetoothError::Success)
        {
            serviceProvider = serviceResult.ServiceProvider();
        }
        else
        {
            rootPage.NotifyUser(L"Could not create service provider: " + to_hstring(serviceResult.Error()), NotifyType::ErrorMessage);
            co_return false;
        }

        // BT_Code: Initializes custom local parameters w/ properties, protection levels as well as common descriptors like User Description.
        GattLocalCharacteristicParameters gattOperandParameters;
        gattOperandParameters.CharacteristicProperties(GattCharacteristicProperties::Write | GattCharacteristicProperties::WriteWithoutResponse);
        gattOperandParameters.WriteProtectionLevel(GattProtectionLevel::Plain);
        gattOperandParameters.UserDescription(L"Operand Characteristic");

        GattLocalCharacteristicResult result = co_await serviceProvider.Service().CreateCharacteristicAsync(Constants::Op1CharacteristicUuid, gattOperandParameters);
        if (result.Error() == BluetoothError::Success)
        {
            op1Characteristic = result.Characteristic();
        }
        else
        {
            rootPage.NotifyUser(L"Could not create operand1 characteristic: " + to_hstring(result.Error()), NotifyType::ErrorMessage);
            co_return false;
        }
        op1CharacteristicWriteToken = op1Characteristic.WriteRequested({ get_weak(), &Scenario3_ServerForeground::Op1Characteristic_WriteRequestedAsync });

        // Create the second operand characteristic.
        result = co_await serviceProvider.Service().CreateCharacteristicAsync(Constants::Op2CharacteristicUuid, gattOperandParameters);
        if (result.Error() == BluetoothError::Success)
        {
            op2Characteristic = result.Characteristic();
        }
        else
        {
            rootPage.NotifyUser(L"Could not create operand2 characteristic: " + to_hstring(result.Error()), NotifyType::ErrorMessage);
            co_return false;
        }

        op2CharacteristicWriteToken = op2Characteristic.WriteRequested({ get_weak(), &Scenario3_ServerForeground::Op2Characteristic_WriteRequestedAsync });

        // Create the operator characteristic.
        GattLocalCharacteristicParameters gattOperatorParameters;
        gattOperandParameters.CharacteristicProperties(GattCharacteristicProperties::Write | GattCharacteristicProperties::WriteWithoutResponse);
        gattOperandParameters.WriteProtectionLevel(GattProtectionLevel::Plain);
        gattOperandParameters.UserDescription(L"Operator Characteristic");

        result = co_await serviceProvider.Service().CreateCharacteristicAsync(Constants::OperatorCharacteristicUuid, gattOperatorParameters);
        if (result.Error() == BluetoothError::Success)
        {
            operatorCharacteristic = result.Characteristic();
        }
        else
        {
            rootPage.NotifyUser(L"Could not create operator characteristic: " + to_hstring(result.Error()), NotifyType::ErrorMessage);
            co_return false;
        }

        operatorCharacteristicWriteToken = operatorCharacteristic.WriteRequested({ get_weak(), &Scenario3_ServerForeground::OperatorCharacteristic_WriteRequestedAsync });

        // Create the result characteristic.
        GattLocalCharacteristicParameters gattResultParameters;
        gattResultParameters.CharacteristicProperties(GattCharacteristicProperties::Read | GattCharacteristicProperties::Notify);
        gattResultParameters.WriteProtectionLevel(GattProtectionLevel::Plain);
        gattResultParameters.UserDescription(L"Result  Characteristic");

        // Add presentation format - 32-bit unsigned integer, with exponent 0, the unit is unitless, with no company description
        GattPresentationFormat intFormat = GattPresentationFormat::FromParts(
            GattPresentationFormatTypes::UInt32(),
            PresentationFormats::Exponent,
            static_cast<uint16_t>(PresentationFormats::Units::Unitless),
            static_cast<uint8_t>(PresentationFormats::NamespaceId::BluetoothSigAssignedNumber),
            PresentationFormats::Description);

        gattResultParameters.PresentationFormats().Append(intFormat);

        result = co_await serviceProvider.Service().CreateCharacteristicAsync(Constants::ResultCharacteristicUuid, gattResultParameters);
        if (result.Error() == BluetoothError::Success)
        {
            resultCharacteristic = result.Characteristic();
        }
        else
        {
            rootPage.NotifyUser(L"Could not create result characteristic: " + to_hstring(result.Error()), NotifyType::ErrorMessage);
            co_return false;
        }
        resultCharacteristicReadToken = resultCharacteristic.ReadRequested({ get_weak(), &Scenario3_ServerForeground::ResultCharacteristic_ReadRequestedAsync });
        resultCharacteristicClientsChangedToken = resultCharacteristic.SubscribedClientsChanged({ get_weak(), &Scenario3_ServerForeground::ResultCharacteristic_SubscribedClientsChanged });

        // BT_Code: Indicate if your sever advertises as connectable and discoverable.
        GattServiceProviderAdvertisingParameters advParameters;

        // IsConnectable determines whether a call to publish will attempt to start advertising and
        // put the service UUID in the ADV packet (best effort)
        advParameters.IsConnectable(peripheralSupported);

        // IsDiscoverable determines whether a remote device can query the local device for support
        // of this service
        advParameters.IsDiscoverable(true);

        serviceProviderAdvertisementChangedToken = serviceProvider.AdvertisementStatusChanged({ get_weak(), &Scenario3_ServerForeground::ServiceProvider_AdvertisementStatusChanged });
        serviceProvider.StartAdvertising(advParameters);
        co_return true;
    }

fire_and_forget UpdateUX ( ) [private]

Definition at line 152 of file Scenario3_ServerForeground.cpp.

    {
        auto lifetime = get_strong();
        co_await resume_foreground(Dispatcher());

        switch (operatorReceived)
        {
        case CalculatorOperators::Add:
            OperationText().Text(L"+");
            break;
        case CalculatorOperators::Subtract:
            OperationText().Text(L"-");
            break;
        case CalculatorOperators::Multiply:
            OperationText().Text(L"*");
            break;
        case CalculatorOperators::Divide:
            OperationText().Text(L"/");
            break;
        default:
            OperationText().Text(L"INV");
            break;
        }
        Operand1Text().Text(to_hstring(operand1Received));
        Operand2Text().Text(to_hstring(operand2Received));
        resultVal = ComputeResult();
        ResultText().Text(to_hstring(resultVal));
    }

Member Data Documentation

event_token op1CharacteristicWriteToken [private]

Definition at line 60 of file Scenario3_ServerForeground.h.

event_token op2CharacteristicWriteToken [private]

Definition at line 61 of file Scenario3_ServerForeground.h.

int operand1Received = 0 [private]

Definition at line 54 of file Scenario3_ServerForeground.h.

int operand2Received = 0 [private]

Definition at line 55 of file Scenario3_ServerForeground.h.

event_token operatorCharacteristicWriteToken [private]

Definition at line 62 of file Scenario3_ServerForeground.h.

CalculatorOperators operatorReceived [private]

Definition at line 56 of file Scenario3_ServerForeground.h.

bool peripheralSupported = false [private]

Definition at line 58 of file Scenario3_ServerForeground.h.

event_token resultCharacteristicClientsChangedToken [private]

Definition at line 64 of file Scenario3_ServerForeground.h.

event_token resultCharacteristicReadToken [private]

Definition at line 63 of file Scenario3_ServerForeground.h.

int resultVal = 0 [private]

Definition at line 57 of file Scenario3_ServerForeground.h.

event_token serviceProviderAdvertisementChangedToken [private]

Definition at line 65 of file Scenario3_ServerForeground.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/Scenario3_ServerForeground.h
  • BluetoothLE/cppwinrt/Scenario3_ServerForeground.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SettingContainer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_SettingContainer
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario3_SettingContainer Struct Reference

#include "Scenario3_SettingContainer.h"

List of all members.

Public Member Functions

Scenario3_SettingContainer ()
void | CreateContainer_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DeleteContainer_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | DeleteSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | WriteSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | DisplayOutput ()

Private Attributes

Windows::Storage::ApplicationDataContainer | localSettings = Windows::Storage::ApplicationData::Current().LocalSettings()

Static Private Attributes

static const auto | containerName = "exampleContainer"
static const auto | settingName = "exampleSetting"

Detailed Description

Definition at line 19 of file Scenario3_SettingContainer.h.

Constructor & Destructor Documentation

Scenario3_SettingContainer ( )

Definition at line 25 of file Scenario3_SettingContainer.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void CreateContainer_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DeleteContainer_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DeleteSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DisplayOutput ( ) [private]

Definition at line 58 of file Scenario3_SettingContainer.cpp.

    {
        ApplicationDataContainer container = localSettings.Containers().TryLookup(containerName);
        bool hasSetting = container ? container.Values().HasKey(settingName) : false;

        std::wstringstream formatted;
        formatted << std::boolalpha << L"Container Exists: " << (container != nullptr) << std::endl;
        formatted << L"Setting Exists: " << hasSetting << std::endl;

        OutputTextBlock().Text(formatted.str());

        WriteSetting().IsEnabled(container != nullptr);
        DeleteSetting().IsEnabled(container != nullptr);
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void WriteSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

const auto containerName = "exampleContainer" [inline, static, private]

Definition at line 35 of file Scenario3_SettingContainer.h.

Windows::Storage::ApplicationDataContainer localSettings = Windows::Storage::ApplicationData::Current().LocalSettings() [private]

Definition at line 33 of file Scenario3_SettingContainer.h.

const auto settingName = "exampleSetting" [inline, static, private]

Definition at line 36 of file Scenario3_SettingContainer.h.

The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario3_SettingContainer.h
  • ApplicationData/cppwinrt/Scenario3_SettingContainer.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_ShowHideMethods Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_ShowHideMethods
Public Member Functions

Scenario3_ShowHideMethods Struct Reference

Sample page to call TryShow/TryHide methods.

#include "Scenario3_ShowHideMethods.h"

List of all members.

Public Member Functions

Scenario3_ShowHideMethods ()
void | OnFadeOutCompleted (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | WordListBox_OnKeyUp (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const &e)

Detailed Description

Definition at line 22 of file Scenario3_ShowHideMethods.h.

Constructor & Destructor Documentation

Scenario3_ShowHideMethods ( )

Definition at line 25 of file Scenario3_ShowHideMethods.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnFadeOutCompleted | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void WordListBox_OnKeyUp | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Input::KeyRoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.h
  • TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_SingleFolder Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_SingleFolder
Public Member Functions

Scenario3_SingleFolder Struct Reference

#include "Scenario3_SingleFolder.h"

List of all members.

Public Member Functions

Scenario3_SingleFolder ()
fire_and_forget PickFolderButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario3_SingleFolder.h.

Constructor & Destructor Documentation

Scenario3_SingleFolder ( )

Definition at line 25 of file Scenario3_SingleFolder.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget PickFolderButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FilePicker/cppwinrt/Scenario3_SingleFolder.h
  • FilePicker/cppwinrt/Scenario3_SingleFolder.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Size Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_Size
Public Member Functions | Private Member Functions

Scenario3_Size Struct Reference

#include "Scenario3_Size.h"

List of all members.

Public Member Functions

Scenario3_Size ()
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ShowWindowBtn_Click (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | OnWindowClosed (Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &)

Detailed Description

Definition at line 18 of file Scenario3_Size.h.

Constructor & Destructor Documentation

Scenario3_Size ( )

Definition at line 28 of file Scenario3_Size.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnWindowClosed | ( | Windows::UI::WindowManagement::AppWindow const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget ShowWindowBtn_Click | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/Scenario3_Size.h
  • AppWindow/cppwinrt/Scenario3_Size.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_Transliteration Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_Transliteration
Public Member Functions

Scenario3_Transliteration Struct Reference

#include "Scenario3_Transliteration.h"

List of all members.

Public Member Functions

Scenario3_Transliteration ()
void Go_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario3_Transliteration.h.

Constructor & Destructor Documentation

Scenario3_Transliteration ( )

Definition at line 24 of file Scenario3_Transliteration.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Go_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • LinguisticServices/cppwinrt/Scenario3_Transliteration.h
  • LinguisticServices/cppwinrt/Scenario3_Transliteration.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario3_XmlWriterLite Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario3_XmlWriterLite
Public Member Functions | Private Member Functions

Scenario3_XmlWriterLite Struct Reference

#include "Scenario3_XmlWriterLite.h"

List of all members.

Public Member Functions

Scenario3_XmlWriterLite ()
fire_and_forget | DoSomething_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | ReadAndWrite (com_ptr< IStream > const &readStream, com_ptr< IStream > const &writeStream)

Detailed Description

Definition at line 19 of file Scenario3_XmlWriterLite.h.

Constructor & Destructor Documentation

Scenario3_XmlWriterLite ( )

Definition at line 26 of file Scenario3_XmlWriterLite.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget DoSomething_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void ReadAndWrite | ( | com_ptr< IStream > const & | readStream,
 |  | com_ptr< IStream > const & | writeStream |
 | ) |  |  | [private]

Definition at line 60 of file Scenario3_XmlWriterLite.cpp.

    {
        com_ptr<IXmlReader> reader;
        check_hresult(::CreateXmlReader(IID_PPV_ARGS(&reader), nullptr));
        check_hresult(reader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit));
        check_hresult(reader->SetInput(readStream.get()));

        com_ptr<IXmlWriterLite> writer;
        check_hresult(::CreateXmlWriter(IID_PPV_ARGS(&writer), nullptr));
        check_hresult(writer->SetOutput(writeStream.get()));

        XmlNodeType nodeType;

        while (check_enumerator(reader->Read(&nodeType)))
        {
            PCWSTR     qualifiedName = nullptr;
            PCWSTR     value = nullptr;
            UINT       qualifiedNameSize = 0;
            UINT       valueSize = 0;

            switch (nodeType)
            {
            case XmlNodeType_Element:
            {
                check_hresult(reader->GetQualifiedName(&qualifiedName, &qualifiedNameSize));
                check_hresult(writer->WriteStartElement(qualifiedName, qualifiedNameSize));
                while (check_enumerator(reader->MoveToNextAttribute()))
                {
                    check_hresult(reader->GetQualifiedName(&qualifiedName, &qualifiedNameSize));
                    check_hresult(reader->GetValue(&value, &valueSize));
                    check_hresult(writer->WriteAttributeString(qualifiedName, qualifiedNameSize, value, valueSize));
                }
                check_hresult(reader->MoveToElement());
                if (reader->IsEmptyElement())
                {
                    check_hresult(reader->GetQualifiedName(&qualifiedName, &qualifiedNameSize));
                    check_hresult(writer->WriteEndElement(qualifiedName, qualifiedNameSize));
                }
                break;
            }
            case XmlNodeType_Text:
                check_hresult(reader->GetValue(&value, nullptr));
                check_hresult(writer->WriteString(value));
                break;

            case XmlNodeType_CDATA:
                check_hresult(reader->GetValue(&value, nullptr));
                check_hresult(writer->WriteCData(value));
                break;

            case XmlNodeType_ProcessingInstruction:
                check_hresult(reader->GetQualifiedName(&qualifiedName, nullptr));
                check_hresult(reader->GetValue(&value, nullptr));
                check_hresult(writer->WriteProcessingInstruction(qualifiedName, value));
                break;

            case XmlNodeType_Comment:
                check_hresult(reader->GetValue(&value, nullptr));
                check_hresult(writer->WriteComment(value));
                break;

            case XmlNodeType_DocumentType:
            {
                PCWSTR publicId = nullptr;
                PCWSTR systemId = nullptr;

                check_hresult(reader->GetQualifiedName(&qualifiedName, nullptr));
                check_hresult(reader->GetValue(&value, nullptr));
                if (check_enumerator(reader->MoveToAttributeByName(L"PUBLIC", nullptr)))
                {
                    reader->GetValue(&publicId, nullptr);
                }
                if (check_enumerator(reader->MoveToAttributeByName(L"SYSTEM", nullptr)))
                {
                    check_hresult(reader->GetValue(&systemId, nullptr));
                }
                check_hresult(writer->WriteDocType(
                    qualifiedName,
                    publicId,
                    systemId,
                    value));
                break;
            }
            case XmlNodeType_Whitespace:
                check_hresult(reader->GetValue(&value, nullptr));
                check_hresult(writer->WriteWhitespace(value));
                break;

            case XmlNodeType_EndElement:
                check_hresult(reader->GetQualifiedName(&qualifiedName, &qualifiedNameSize));
                check_hresult(writer->WriteFullEndElement(qualifiedName, qualifiedNameSize));
                break;

            default:
                break;
            }
        }
    }

The documentation for this struct was generated from the following files:
  • XmlLite/cppwinrt/Scenario3_XmlWriterLite.h
  • XmlLite/cppwinrt/Scenario3_XmlWriterLite.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4
Public Member Functions | Private Member Functions | Private Attributes

Scenario4 Struct Reference

Writing and reading bytes in a file.

#include "Scenario4.h"

Inherits winrt::SDKTemplate::MediaFoundationInitializer.

List of all members.

Public Member Functions

Scenario4 ()
Scenario4 ()
Scenario4 ()
Scenario4 ()
void | btnStartCapture_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | btnStopCapture_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | GetFilesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetThumbnailButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ReadBytesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | WriteBytesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | ClearCapture ()
void | InitializeCapture ()
fire_and_forget | OnDeviceStateChange (IDeviceStateSource const &sender, SDKTemplate::DeviceStateChangedEventArgs e)
fire_and_forget | OnPlotDataReady (IPlotDataSource const &sender, SDKTemplate::PlotDataReadyEventArgs e)
void | StopCapture ()
void | UpdateMediaControlUI (DeviceState deviceState)

Private Attributes

com_ptr< WASAPICapture > | m_capture
event_token | m_deviceStateChangeToken
int | m_discontinuityCount
bool | m_isLowLatency
event_token | m_plotDataReadyToken

Detailed Description

Definition at line 22 of file Scenario4.h.

Constructor & Destructor Documentation

Scenario4 ( )

Definition at line 26 of file Scenario4.cpp.

    {
        InitializeComponent();
    }

Scenario4 ( )
Scenario4 ( )
Scenario4 ( )

Member Function Documentation

void btnStartCapture_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void btnStopCapture_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ClearCapture ( ) [private]

Definition at line 37 of file Scenario4.cpp.

    {
        if (m_deviceStateChangeToken)
        {
            m_capture->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
        }

        if (m_plotDataReadyToken)
        {
            m_capture->PlotDataReady(std::exchange(m_plotDataReadyToken, {}));
        }

        StopCapture();
        m_capture = nullptr;
    }

fire_and_forget GetFilesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GetThumbnailButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void InitializeCapture ( ) [private]

Definition at line 224 of file Scenario4.cpp.

    {
        m_capture = nullptr;

        // Create a new WASAPI capture instance
        m_capture = make_self<WASAPICapture>();

        // Register for events
        m_deviceStateChangeToken = m_capture->DeviceStateChanged({ get_weak(), &Scenario4::OnDeviceStateChange });
        m_plotDataReadyToken = m_capture->PlotDataReady({ get_weak(), &Scenario4::OnPlotDataReady });

        // There is an initial discontinuity when we start, so reset discontinuity counter
        // to -1 so that we ignore that initial discontinuity.
        m_discontinuityCount = -1;

        // Configure whether we are using low-latency capture
        m_isLowLatency = toggleMinimumLatency().IsOn();
        m_capture->SetLowLatencyCapture(m_isLowLatency);

        // Perform the initialization
        m_capture->AsyncInitializeAudioDevice();
    }

fire_and_forget OnDeviceStateChange | ( | IDeviceStateSource const & | sender,
 |  | SDKTemplate::DeviceStateChangedEventArgs | e |
 | ) |  |  | [private]

Definition at line 97 of file Scenario4.cpp.

    {
        auto lifetime = get_strong();

        // Get the current time for messages
        std::time_t now = clock::to_time_t(clock::now());
        char buffer[26];
        ctime_s(buffer, ARRAYSIZE(buffer), &now);

        // Continue on UI thread.
        co_await resume_foreground(Dispatcher());

        // Update Control Buttons
        DeviceState state = e.DeviceState();
        UpdateMediaControlUI(state);

        // Handle state specific messages
        switch (state)
        {
        case DeviceState::Initialized:
            m_capture->AsyncStartCapture();
            break;

        case DeviceState::Capturing:
            if (m_isLowLatency)
            {
                rootPage.NotifyUser(L"Capture Started (minimum latency) at " + to_hstring(buffer), NotifyType::StatusMessage);
            }
            else
            {
                rootPage.NotifyUser(L"Capture Started (normal latency) at " + to_hstring(buffer), NotifyType::StatusMessage);
            }
            break;

        case DeviceState::Discontinuity:
        {
            m_discontinuityCount++;

            if (m_discontinuityCount > 0)
            {
                rootPage.NotifyUser(L"DISCONTINUITY DETECTED: " + to_hstring(buffer) + L" (Count = " + to_hstring(m_discontinuityCount) + L")", NotifyType::StatusMessage);
            }
        }
        break;

        case DeviceState::Flushing:
            if (m_plotDataReadyToken)
            {
                m_capture->PlotDataReady(std::exchange(m_plotDataReadyToken, {}));
            }

            rootPage.NotifyUser(L"Finalizing WAV Header.  This may take a few minutes...", NotifyType::StatusMessage);

            Oscilloscope().Points().ReplaceAll({ { OSC_START_X, OSC_START_Y }, { OSC_X_LENGTH, OSC_START_Y } });
            break;

        case DeviceState::Stopped:
            // For the stopped state, completely tear down the audio device
            ClearCapture();

            rootPage.NotifyUser(L"Capture Stopped", NotifyType::StatusMessage);
            break;

        case DeviceState::Error:
            ClearCapture();

            // Specifically handle a couple of known errors
            switch (hresult error = e.ExtendedError(); error)
            {
            case __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND):
                rootPage.NotifyUser(L"ERROR: Check the Sound control panel for an active recording device.", NotifyType::ErrorMessage);
                break;

            case AUDCLNT_E_RESOURCES_INVALIDATED:
                rootPage.NotifyUser(L"ERROR: Endpoint Lost Access To Resources", NotifyType::ErrorMessage);
                break;

            case E_ACCESSDENIED:
                rootPage.NotifyUser(L"ERROR: Access Denied.  Check 'Settings->Permissions' for access to Microphone.", NotifyType::ErrorMessage);
                break;

            default:
                rootPage.NotifyUser(L"ERROR: " + hresult_error(error).message(), NotifyType::ErrorMessage);
                break;
            }
        }
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget OnPlotDataReady | ( | IPlotDataSource const & | sender,
 |  | SDKTemplate::PlotDataReadyEventArgs | e |
 | ) |  |  | [private]

Definition at line 186 of file Scenario4.cpp.

    {
        auto lifetime = get_strong();

        co_await resume_foreground(Dispatcher());

        IBuffer buffer = e.Points();
        size_t pointCount = buffer.Length() / sizeof(int16_t);
        int16_t* points = reinterpret_cast<int16_t*>(buffer.data());

        // Scale the incoming point list so that it fills our scope.
        float y_range = static_cast<float>((std::numeric_limits<int16_t>::max)()) - std::numeric_limits<int16_t>::lowest();
        float x_inc = pointCount > 0 ? OSC_X_LENGTH / static_cast<float>(pointCount - 1) : 0.0f;

        UINT32 existingPoints = Oscilloscope().Points().Size();

        for (UINT32 i = 0; i < pointCount; i++)
        {
            Point p;

            // Fixup the x and y coordinates and set it back into the collection
            p.X = OSC_START_X + i * x_inc;
            p.Y = OSC_START_Y - (points[i] * OSC_TOTAL_HEIGHT) / y_range;

            if (i < existingPoints)
            {
                Oscilloscope().Points().SetAt(i, p);
            }
            else
            {
                Oscilloscope().Points().Append(p);
            }
        }
    }

fire_and_forget ReadBytesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void StopCapture ( ) [private]

Definition at line 250 of file Scenario4.cpp.

    {
        if (m_capture)
        {
            // Set the event to stop playback
            m_capture->AsyncStopCapture();
        }
    }

void UpdateMediaControlUI ( DeviceState deviceState ) [private]

Definition at line 55 of file Scenario4.cpp.

    {
        switch (deviceState)
        {
        case DeviceState::Capturing:
            btnStartCapture().IsEnabled(false);
            btnStopCapture().IsEnabled(true);
            toggleMinimumLatency().IsEnabled(false);
            break;

        case DeviceState::Stopped:
            btnStartCapture().IsEnabled(true);
            btnStopCapture().IsEnabled(false);
            toggleMinimumLatency().IsEnabled(true);
            break;

        case DeviceState::Initialized:
        case DeviceState::Starting:
        case DeviceState::Stopping:
        case DeviceState::Flushing:
        case DeviceState::Error:
            btnStartCapture().IsEnabled(false);
            btnStopCapture().IsEnabled(false);
            break;
        }
    }

fire_and_forget WriteBytesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

com_ptr<WASAPICapture> m_capture [private]

Definition at line 34 of file Scenario4.h.

event_token m_deviceStateChangeToken [private]

Definition at line 28 of file Scenario4.h.

int m_discontinuityCount [private]

Definition at line 32 of file Scenario4.h.

bool m_isLowLatency [private]

Definition at line 33 of file Scenario4.h.

event_token m_plotDataReadyToken [private]

Definition at line 30 of file Scenario4.h.

The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario4.h
  • WindowsAudioSession/cppwinrt/Scenario4.h
  • FileThumbnails/cppwinrt/Scenario4.h
  • FolderEnumeration/cppwinrt/Scenario4.h
  • FileAccess/cppwinrt/Scenario4.cpp
  • FileThumbnails/cppwinrt/Scenario4.cpp
  • FolderEnumeration/cppwinrt/Scenario4.cpp
  • WindowsAudioSession/cppwinrt/Scenario4.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeAdminKey Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_ChangeAdminKey
Public Member Functions

Scenario4_ChangeAdminKey Struct Reference

#include "Scenario4_ChangeAdminKey.h"

List of all members.

Public Member Functions

Scenario4_ChangeAdminKey ()
fire_and_forget ChangeAdminKey_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario4_ChangeAdminKey.h.

Constructor & Destructor Documentation

Scenario4_ChangeAdminKey ( )

Definition at line 28 of file Scenario4_ChangeAdminKey.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget ChangeAdminKey_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario4_ChangeAdminKey.h
  • SmartCard/cppwinrt/Scenario4_ChangeAdminKey.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ChangeSystemGroup Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_ChangeSystemGroup
Public Member Functions

Scenario4_ChangeSystemGroup Struct Reference

#include "Scenario4_ChangeSystemGroup.h"

List of all members.

Public Member Functions

Scenario4_ChangeSystemGroup ()
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | PrepareSampleFiles_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SystemGroup_Frequent_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SystemGroup_None_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | SystemGroup_Recent_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario4_ChangeSystemGroup.h.

Constructor & Destructor Documentation

Scenario4_ChangeSystemGroup ( )

Definition at line 26 of file Scenario4_ChangeSystemGroup.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget PrepareSampleFiles_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SystemGroup_Frequent_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SystemGroup_None_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget SystemGroup_Recent_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • JumpList/cppwinrt/Scenario4_ChangeSystemGroup.h
  • JumpList/cppwinrt/Scenario4_ChangeSystemGroup.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CharacterGrouping Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_CharacterGrouping
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario4_CharacterGrouping Struct Reference

#include "Scenario4_CharacterGrouping.h"

List of all members.

Public Member Functions

Scenario4_CharacterGrouping ()
void | AssignGroup_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | GetGroups_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | AddGroup (hstring const &label, Windows::UI::Xaml::UIElement const &element)

Private Attributes

std::map< hstring,
Windows::UI::Xaml::UIElement > 		Groups

Static Private Attributes

static constexpr wchar_t | GlobeString [] = "\U0001F310"

Detailed Description

Definition at line 19 of file Scenario4_CharacterGrouping.h.

Constructor & Destructor Documentation

Scenario4_CharacterGrouping ( )

Definition at line 25 of file Scenario4_CharacterGrouping.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AddGroup | ( | hstring const & | label,
 |  | Windows::UI::Xaml::UIElement const & | element |
 | ) |  |  | [private]
void AssignGroup_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void GetGroups_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

constexpr wchar_t GlobeString[] = "\U0001F310" [static, private]

Definition at line 30 of file Scenario4_CharacterGrouping.h.

std::map<hstring, Windows::UI::Xaml::UIElement> Groups [private]

Definition at line 27 of file Scenario4_CharacterGrouping.h.

The documentation for this struct was generated from the following files:
  • LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.h
  • LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompactOverlay Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_CompactOverlay
Public Member Functions | Private Member Functions

Scenario4_CompactOverlay Struct Reference

#include "Scenario4_CompactOverlay.h"

List of all members.

Public Member Functions

Scenario4_CompactOverlay ()
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ShowWindowBtn_Click (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | OnWindowClosed (Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &)

Detailed Description

Definition at line 18 of file Scenario4_CompactOverlay.h.

Constructor & Destructor Documentation

Scenario4_CompactOverlay ( )

Definition at line 28 of file Scenario4_CompactOverlay.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnWindowClosed | ( | Windows::UI::WindowManagement::AppWindow const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget ShowWindowBtn_Click | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/Scenario4_CompactOverlay.h
  • AppWindow/cppwinrt/Scenario4_CompactOverlay.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_CompositeSettings Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_CompositeSettings
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario4_CompositeSettings Struct Reference

#include "Scenario4_CompositeSettings.h"

List of all members.

Public Member Functions

Scenario4_CompositeSettings ()
void | DeleteCompositeSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | WriteCompositeSetting_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | DisplayOutput ()

Private Attributes

Windows::Storage::ApplicationDataContainer | localSettings = Windows::Storage::ApplicationData::Current().LocalSettings()

Static Private Attributes

static const auto | settingName = "exampleCompositeSetting"
static const auto | settingName1 = "one"
static const auto | settingName2 = "hello"

Detailed Description

Definition at line 19 of file Scenario4_CompositeSettings.h.

Constructor & Destructor Documentation

Scenario4_CompositeSettings ( )

Definition at line 25 of file Scenario4_CompositeSettings.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void DeleteCompositeSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void DisplayOutput ( ) [private]

Definition at line 50 of file Scenario4_CompositeSettings.cpp.

    {
        auto composite = localSettings.Values().Lookup(settingName).as<ApplicationDataCompositeValue>();

        std::wstringstream output;
        if (!composite)
        {
            output << L"Composite Setting: <empty>";
        }
        else
        {
            output << L"Composite setting: {" << settingName1 << L" = " << composite.Lookup(settingName1).as<int>() << L", ";
            output << settingName2 << L" = \"" << composite.Lookup(settingName2).as<hstring>().c_str() << "\"}";
        }

        OutputTextBlock().Text(output.str());
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void WriteCompositeSetting_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

Windows::Storage::ApplicationDataContainer localSettings = Windows::Storage::ApplicationData::Current().LocalSettings() [private]

Definition at line 31 of file Scenario4_CompositeSettings.h.

const auto settingName = "exampleCompositeSetting" [inline, static, private]

Definition at line 33 of file Scenario4_CompositeSettings.h.

const auto settingName1 = "one" [inline, static, private]

Definition at line 34 of file Scenario4_CompositeSettings.h.

const auto settingName2 = "hello" [inline, static, private]

Definition at line 35 of file Scenario4_CompositeSettings.h.

The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario4_CompositeSettings.h
  • ApplicationData/cppwinrt/Scenario4_CompositeSettings.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_EdgeTappedListView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_EdgeTappedListView
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_EdgeTappedListView Struct Reference

#include "Scenario4_EdgeTappedListView.h"

List of all members.

Public Member Functions

Scenario4_EdgeTappedListView ()
void | AddItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | CancelSelection (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnEdgeTapped (SDKTemplate::EdgeTappedListView const &, SDKTemplate::ListViewEdgeTappedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnSelectionChanged (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &)
void | RemoveItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | SelectItems (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | OnBackRequested (Windows::Foundation::IInspectable const &, Windows::UI::Core::BackRequestedEventArgs const &e)
void | SetCommandsVisibility (Windows::UI::Xaml::Controls::ListView const &listView)
void | UpdateSelectionUI ()

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Contact > 		Contacts

Detailed Description

Definition at line 18 of file Scenario4_EdgeTappedListView.h.

Constructor & Destructor Documentation

Scenario4_EdgeTappedListView ( )

Definition at line 26 of file Scenario4_EdgeTappedListView.cpp.

    {
        InitializeComponent();

        Contacts = Contact::GetContacts(50);
        MyListView().ItemsSource(Contacts);

        // We set the state of the commands on the appbar
        SetCommandsVisibility(MyListView());
    }

Member Function Documentation

void AddItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void CancelSelection | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnBackRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::BackRequestedEventArgs const & | e |
 | ) |  |  | [private]
void OnEdgeTapped | ( | SDKTemplate::EdgeTappedListView const & | ,
 |  | SDKTemplate::ListViewEdgeTappedEventArgs const & |
 | ) |  |

Definition at line 48 of file Scenario4_EdgeTappedListView.cpp.

    {
        // When user releases the pointer after pressing on the left edge of the item,
        // the ListView will switch to Multiple Selection
        MyListView().SelectionMode(ListViewSelectionMode::Multiple);
        // Also, we want the Left Edge Tap funcionality will be no longer enable.
        MyListView().IsItemLeftEdgeTapEnabled(false);
        // It's desirable that the Appbar shows the actions available for multiselect
        SetCommandsVisibility(MyListView());
    }

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnSelectionChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & |
 | ) |  |
void RemoveItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void SelectItems | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void SetCommandsVisibility ( Windows::UI::Xaml::Controls::ListView const & listView ) [private]
void UpdateSelectionUI ( ) [private]

Definition at line 59 of file Scenario4_EdgeTappedListView.cpp.

    {
        // When there are no selected items, the list returns to None selection mode.
        if (MyListView().SelectedItems().Size() == 0)
        {
            MyListView().SelectionMode(ListViewSelectionMode::None);
            MyListView().IsItemLeftEdgeTapEnabled(true);
            SetCommandsVisibility(MyListView());
        }
    }

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::Contact> Contacts [private]

Definition at line 33 of file Scenario4_EdgeTappedListView.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario4_EdgeTappedListView.h
  • XamlListView/cppwinrt/Scenario4_EdgeTappedListView.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ForegroundGeofence Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_ForegroundGeofence
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario4_ForegroundGeofence Struct Reference

#include "Scenario4_ForegroundGeofence.h"

List of all members.

Public Member Functions

Scenario4_ForegroundGeofence ()
void | OnCreateGeofence (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnRegisteredGeofenceListBoxSelectionChanged (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &e)
void | OnRemoveGeofenceItem (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | OnSetPositionToHere (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | AddEventDescription (hstring const &eventDescription)
void | AddGeofenceToRegisteredGeofenceListBox (Windows::Devices::Geolocation::Geofencing::Geofence const &geofence)
Windows::Devices::Geolocation::Geofencing::Geofence | GenerateGeofence ()
fire_and_forget | OnGeofenceStateChanged (Windows::Devices::Geolocation::Geofencing::GeofenceMonitor const &sender, Windows::Foundation::IInspectable const &)
fire_and_forget | OnGeofenceStatusChanged (Windows::Devices::Geolocation::Geofencing::GeofenceMonitor const &sender, Windows::Foundation::IInspectable const &)
void | OnVisibilityChanged (Windows::Foundation::IInspectable const &, Windows::UI::Core::VisibilityChangedEventArgs const &e)
bool | ParseDoubleFromTextBox (Windows::UI::Xaml::Controls::TextBox const &textBox, hstring const &name, double minValue, double maxValue, double &value)
bool | ParseTimeSpan (hstring const &field, Windows::Foundation::TimeSpan defaultValue, Windows::Foundation::TimeSpan &value)
void | RefreshControlsFromGeofence (Windows::Devices::Geolocation::Geofencing::Geofence const &geofence)
void | SetStartDateTimeToUI (Windows::Foundation::DateTime dateTime)

Private Attributes

Windows::Foundation::IAsyncOperation
< Windows::Devices::Geolocation::Geoposition > 		m_pendingOperation

Static Private Attributes

static constexpr
Windows::Foundation::TimeSpan 		defaultDwellTime = std::chrono::seconds(10)

Detailed Description

Definition at line 18 of file Scenario4_ForegroundGeofence.h.

Constructor & Destructor Documentation

Scenario4_ForegroundGeofence ( )

Definition at line 45 of file Scenario4_ForegroundGeofence.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AddEventDescription ( hstring const & eventDescription ) [private]

Definition at line 451 of file Scenario4_ForegroundGeofence.cpp.

    {
        ListBoxItem item;
        item.Content(box_value(eventDescription));
        GeofenceEventsListBox().Items().InsertAt(0, item);
    }

void AddGeofenceToRegisteredGeofenceListBox ( Windows::Devices::Geolocation::Geofencing::Geofence const & geofence ) [private]
Geofence GenerateGeofence ( ) [private]

Definition at line 223 of file Scenario4_ForegroundGeofence.cpp.

    {
        m_rootPage.NotifyUser(L"", NotifyType::StatusMessage);

        hstring fenceKey = Id().Text();
        if (fenceKey.empty())
        {
            m_rootPage.NotifyUser(L"Name must be between 1 and 64 characters.", NotifyType::ErrorMessage);
            return nullptr;
        }

        BasicGeoposition position{};
        double radius = 0.0;
        if (!ParseDoubleFromTextBox(Longitude(), L"Longitude", -180, 180, position.Longitude) ||
            !ParseDoubleFromTextBox(Latitude(), L"Latitude", -90, 90, position.Latitude) ||
            !ParseDoubleFromTextBox(Radius(), L"Radius", .1, 10018754.3, radius))
        {
            return nullptr;
        }

        position.Altitude = 0.0;

        // the geofence is a circular region
        Geocircle geocircle(position, radius);

        bool singleUse = SingleUse().IsChecked().Value();

        // want to listen for enter geofence, exit geofence and remove geofence events
        // you can select a subset of these event states
        MonitoredGeofenceStates mask = MonitoredGeofenceStates::Entered | MonitoredGeofenceStates::Exited | MonitoredGeofenceStates::Removed;

        // Dwell time is how long you need to be in geofence to have been considered to have Entered it.
        TimeSpan dwellTime;
        if (!ParseTimeSpan(DwellTime().Text(), defaultDwellTime, dwellTime))
        {
            m_rootPage.NotifyUser(L"Invalid Dwell Time.", NotifyType::ErrorMessage);
            return nullptr;
        }

        // The Duration is the length of time the geofence is active.
        // Zero means "infinite duration".
        TimeSpan duration;
        if (!ParseTimeSpan(Duration().Text(), TimeSpan::zero(), duration))
        {
            m_rootPage.NotifyUser(L"Invalid Duration.", NotifyType::ErrorMessage);
            return nullptr;
        }

        // setting up the start time of the geofence
        DateTime startTime;
        if (StartImmediately().IsChecked().Value())
        {
            // The special "start immediately" value can be used if the duration is zero.
            // Otherwise, we get the current time as the start time.
            startTime = (duration == TimeSpan::zero()) ? startImmediately : clock::now();
        }
        else
        {
            startTime = StartDate().Date() + StartTime().Time();
        }

        // Let the platform detect other invalid parameter combinations.
        try
        {
            return Geofence(fenceKey, geocircle, mask, singleUse, dwellTime, startTime, duration);
        }
        catch (...)
        {
            m_rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
            return nullptr;
        }
    }

void OnCreateGeofence | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget OnGeofenceStateChanged | ( | Windows::Devices::Geolocation::Geofencing::GeofenceMonitor const & | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget OnGeofenceStatusChanged | ( | Windows::Devices::Geolocation::Geofencing::GeofenceMonitor const & | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnRegisteredGeofenceListBoxSelectionChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & | e
 | ) |  |
void OnRemoveGeofenceItem | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget OnSetPositionToHere | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnVisibilityChanged | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Core::VisibilityChangedEventArgs const & | e |
 | ) |  |  | [private]
bool ParseDoubleFromTextBox | ( | Windows::UI::Xaml::Controls::TextBox const & | textBox,
 |  | hstring const & | name,
 |  | double | minValue,
 |  | double | maxValue,
 |  | double & | value |
 | ) |  |  | [private]
bool ParseTimeSpan | ( | hstring const & | field,
 |  | Windows::Foundation::TimeSpan | defaultValue,
 |  | Windows::Foundation::TimeSpan & | value |
 | ) |  |  | [private]
void RefreshControlsFromGeofence ( Windows::Devices::Geolocation::Geofencing::Geofence const & geofence ) [private]
void SetStartDateTimeToUI ( Windows::Foundation::DateTime dateTime ) [private]

Member Data Documentation

constexpr Windows::Foundation::TimeSpan defaultDwellTime = std::chrono::seconds(10) [static, private]

Definition at line 33 of file Scenario4_ForegroundGeofence.h.

Windows::Foundation::IAsyncOperation<Windows::Devices::Geolocation::Geoposition> m_pendingOperation [private]

Definition at line 36 of file Scenario4_ForegroundGeofence.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario4_ForegroundGeofence.h
  • Geolocation/cppwinrt/Scenario4_ForegroundGeofence.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Input Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_Input
Public Member Functions

Scenario4_Input Struct Reference

#include "Scenario4_Input.h"

List of all members.

Public Member Functions

Scenario4_Input ()
void ShowResults_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario4_Input.h.

Constructor & Destructor Documentation

Scenario4_Input ( )

Definition at line 23 of file Scenario4_Input.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • GlobalizationPreferences/cppwinrt/Scenario4_Input.h
  • GlobalizationPreferences/cppwinrt/Scenario4_Input.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_InteractionFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_InteractionFeedback
Public Member Functions | Private Member Functions

Scenario4_InteractionFeedback Struct Reference

#include "Scenario4_InteractionFeedback.h"

List of all members.

Public Member Functions

Scenario4_InteractionFeedback ()
void | MainGrid_Entered (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | MainGrid_Exited (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | SendFeedback_Clicked (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

Windows::Devices::Haptics::SimpleHapticsControllerFeedback | GetSelectedFeedbackOrFallback (std::wstring &message)

Detailed Description

Definition at line 19 of file Scenario4_InteractionFeedback.h.

Constructor & Destructor Documentation

Scenario4_InteractionFeedback ( )

Definition at line 31 of file Scenario4_InteractionFeedback.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback ( std::wstring & message ) [private]

Definition at line 120 of file Scenario4_InteractionFeedback.cpp.

    {
        // Look up the waveform the user selected.
        hstring name = waveformComboBox().SelectionBoxItem().as<hstring>();
        uint16_t waveform = WaveformNamesMap().at(name);

        // See if the haptics controller supports the selected waveform.
        SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, waveform);
        if (feedback != nullptr)
        {
            message = L"Waveform set to " + name;
            return feedback;
        }

        // It does not. Use Click as a fallback.
        message = name + L" is not supported by this pen, so falling back to Click";
        return FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::Click());
    }

void MainGrid_Entered | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void MainGrid_Exited | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void SendFeedback_Clicked | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • PenHaptics/cppwinrt/Scenario4_InteractionFeedback.h
  • PenHaptics/cppwinrt/Scenario4_InteractionFeedback.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_NumberParsing Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_NumberParsing
Public Member Functions

Scenario4_NumberParsing Struct Reference

#include "Scenario4_NumberParsing.h"

List of all members.

Public Member Functions

Scenario4_NumberParsing ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario4_NumberParsing.h.

Constructor & Destructor Documentation

Scenario4_NumberParsing ( )

Definition at line 24 of file Scenario4_NumberParsing.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario4_NumberParsing.h
  • NumberFormatting/cppwinrt/Scenario4_NumberParsing.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Override Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_Override
Public Member Functions

Scenario4_Override Struct Reference

#include "Scenario4_Override.h"

List of all members.

Public Member Functions

Scenario4_Override ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario4_Override.h.

Constructor & Destructor Documentation

Scenario4_Override ( )

Definition at line 24 of file Scenario4_Override.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario4_Override.h
  • DateTimeFormatting/cppwinrt/Scenario4_Override.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_PartialReadWrite Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_PartialReadWrite
Public Member Functions | Private Member Functions

Scenario4_PartialReadWrite Struct Reference

#include "Scenario4_PartialReadWrite.h"

List of all members.

Public Member Functions

Scenario4_PartialReadWrite ()
Windows::Foundation::IAsyncAction | OnConnect (Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs e)
void | OnDisconnect (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
Windows::Foundation::IAsyncAction | OnSend (Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs e)

Private Member Functions

void | AppendOutputLine (hstring const &value)
void | CloseSocket ()
Windows::Foundation::IAsyncAction | ConnectAsync ()
Windows::Foundation::IAsyncAction | MessageReceived (Windows::Networking::Sockets::MessageWebSocket sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs e)
Windows::Foundation::IAsyncAction | OnClosed (Windows::Networking::Sockets::IWebSocket sender, Windows::Networking::Sockets::WebSocketClosedEventArgs e)
Windows::Foundation::IAsyncAction | SendAsync ()
void | SetBusy (bool value)
void | UpdateVisualState ()

Detailed Description

Definition at line 18 of file Scenario4_PartialReadWrite.h.

Constructor & Destructor Documentation

Scenario4_PartialReadWrite ( )

Definition at line 27 of file Scenario4_PartialReadWrite.cpp.

    {
        InitializeComponent();
        UpdateVisualState();
    }

Member Function Documentation

void AppendOutputLine ( hstring const & value ) [private]

Definition at line 257 of file Scenario4_PartialReadWrite.cpp.

    {
        OutputField().Text(OutputField().Text() + value + L"\r\n");
    }

void CloseSocket ( ) [private]

Definition at line 240 of file Scenario4_PartialReadWrite.cpp.

    {
        if (m_messageWebSocket)
        {
            try
            {
                m_messageWebSocket.Close(1000, L"Closed due to user request.");
            }
            catch (winrt::hresult_error const& ex)
            {
                AppendOutputLine(BuildWebSocketError(ex));
                AppendOutputLine(ex.message());
            }
            m_messageWebSocket = nullptr;
        }
    }

IAsyncAction ConnectAsync ( ) [private]

Definition at line 69 of file Scenario4_PartialReadWrite.cpp.

    {
        auto lifetime = get_strong();

        if (ServerAddressField().Text().empty())
        {
            m_rootPage.NotifyUser(L"Please specify a URI to connect to", NotifyType::ErrorMessage);
            co_return;
        }

        // Validating the URI is required since it was received from an untrusted source (user input).
        // The URI is validated by calling TryGetUri() that will return null for strings that are not
        // valid WebSocket URIs.
        // Note that when enabling the text box users may provide URIs to machines on the intrAnet
        // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
        // "Internet (Client)" capability respectively.
        Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
        if (server == nullptr)
        {
            co_return;
        }

        m_messageWebSocket = MessageWebSocket();
        m_messageWebSocket.Control().MessageType(SocketMessageType::Utf8);

        // To support receiving event notifications for partial messages, you must set this receive mode.
        // If you do not set this mode, you will only receive notifications for complete messages; which is
        // the default behavior. Setting to Partial allows us to process partial data as soon as it arrives,
        // as opposed to waiting until the EndOfMessage to process the entire data.
        m_messageWebSocket.Control().ReceiveMode(MessageWebSocketReceiveMode::PartialMessage);

        m_messageWebSocket.MessageReceived({ get_weak(), &Scenario4_PartialReadWrite::MessageReceived });
        m_messageWebSocket.Closed({ get_weak(), &Scenario4_PartialReadWrite::OnClosed });

        if (server.SchemeName() == L"wss")
        {
            // WARNING: Only test applications should ignore SSL errors.
            // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
            // attacks. (Although the connection is secure, the server is not authenticated.)
            // Note that not all certificate validation errors can be ignored.
            // In this case, we are ignoring these errors since the certificate assigned to the localhost
            // URI is self-signed and has subject name = fabrikam.com
            m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
            m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);
        }

        AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");
        try
        {
            co_await m_messageWebSocket.ConnectAsync(server);
        }
        catch (winrt::hresult_error const& ex) // For debugging
        {
            // Error happened during connect operation.
            m_messageWebSocket.Close();
            m_messageWebSocket = nullptr;

            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }

        m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);
    }

Windows::Foundation::IAsyncAction MessageReceived | ( | Windows::Networking::Sockets::MessageWebSocket | sender,
 |  | Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs | e |
 | ) |  |  | [private]
Windows::Foundation::IAsyncAction OnClosed | ( | Windows::Networking::Sockets::IWebSocket | sender,
 |  | Windows::Networking::Sockets::WebSocketClosedEventArgs | e |
 | ) |  |  | [private]
Windows::Foundation::IAsyncAction OnConnect | ( | Windows::Foundation::IInspectable | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs | e
 | ) |  |
void OnDisconnect | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
Windows::Foundation::IAsyncAction OnSend | ( | Windows::Foundation::IInspectable | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs | e
 | ) |  |
IAsyncAction SendAsync ( ) [private]

Definition at line 143 of file Scenario4_PartialReadWrite.cpp.

    {
        auto lifetime = get_strong();

        hstring message = InputField().Text();
        if (message.empty())
        {
            m_rootPage.NotifyUser(L"Please specify text to send", NotifyType::ErrorMessage);
            co_return;
        }

        try
        {
            DataWriter messageWriter;
            messageWriter.WriteString(message);
            IBuffer buffer = messageWriter.DetachBuffer();

            if (EndOfMessageCheckBox().IsChecked().Value())
            {
                AppendOutputLine(L"Sending end of message: " + message);
                co_await m_messageWebSocket.SendFinalFrameAsync(buffer);
            }
            else
            {
                AppendOutputLine(L"Sending partial message: " + message);
                co_await m_messageWebSocket.SendNonfinalFrameAsync(buffer);
            }
        }
        catch (winrt::hresult_error const& ex)
        {
            AppendOutputLine(BuildWebSocketError(ex));
            AppendOutputLine(ex.message());
            co_return;
        }

        m_rootPage.NotifyUser(L"Send Complete", NotifyType::StatusMessage);
    }

void SetBusy ( bool value ) [private]

Definition at line 54 of file Scenario4_PartialReadWrite.cpp.

    {
        m_busy = value;
        UpdateVisualState();
    }

void UpdateVisualState ( ) [private]

Definition at line 38 of file Scenario4_PartialReadWrite.cpp.

    {
        if (m_busy)
        {
            VisualStateManager::GoToState(*this, L"Busy", false);
        }
        else if (m_messageWebSocket != nullptr)
        {
            VisualStateManager::GoToState(*this, L"Connected", false);
        }
        else
        {
            VisualStateManager::GoToState(*this, L"Disconnected", false);
        }
    }

The documentation for this struct was generated from the following files:
  • WebSocket/cppwinrt/Scenario4_PartialReadWrite.h
  • WebSocket/cppwinrt/Scenario4_PartialReadWrite.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SaveFile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_SaveFile
Public Member Functions

Scenario4_SaveFile Struct Reference

#include "Scenario4_SaveFile.h"

List of all members.

Public Member Functions

Scenario4_SaveFile ()
fire_and_forget SaveFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario4_SaveFile.h.

Constructor & Destructor Documentation

Scenario4_SaveFile ( )

Definition at line 25 of file Scenario4_SaveFile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget SaveFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FilePicker/cppwinrt/Scenario4_SaveFile.h
  • FilePicker/cppwinrt/Scenario4_SaveFile.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_ShowView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_ShowView
Public Member Functions

Scenario4_ShowView Struct Reference

#include "Scenario4_ShowView.h"

List of all members.

Public Member Functions

Scenario4_ShowView ()
void TextBox_GotFocus (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario4_ShowView.h.

Constructor & Destructor Documentation

Scenario4_ShowView ( )

Definition at line 23 of file Scenario4_ShowView.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void TextBox_GotFocus | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • TouchKeyboard/cppwinrt/Scenario4_ShowView.h
  • TouchKeyboard/cppwinrt/Scenario4_ShowView.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_Snapshot Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_Snapshot
Public Member Functions | Private Attributes

Scenario4_Snapshot Struct Reference

#include "Scenario4_Snapshot.h"

List of all members.

Public Member Functions

Scenario4_Snapshot ()
fire_and_forget | FindButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 20 of file Scenario4_Snapshot.h.

Constructor & Destructor Documentation

Scenario4_Snapshot ( )

Definition at line 26 of file Scenario4_Snapshot.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget FindButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 30 of file Scenario4_Snapshot.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_SymbologyAttributes Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_SymbologyAttributes
Public Member Functions | Private Member Functions | Private Attributes

Scenario4_SymbologyAttributes Struct Reference

#include "Scenario4_SymbologyAttributes.h"

List of all members.

Public Member Functions

Scenario4_SymbologyAttributes ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | ScenarioEndScanButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | ScenarioStartScanButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | SetSymbologyAttributes_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | SymbologySelection_Changed (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &)

Private Member Functions

fire_and_forget | claimedScanner_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
void | claimedScanner_ReleaseDeviceRequested (Windows::Foundation::IInspectable const &, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &args)
void | ResetTheScenarioState ()

Private Attributes

Windows::Devices::PointOfService::ClaimedBarcodeScanner::DataReceived_revoker | m_scannerDataReceivedToken
Windows::Devices::PointOfService::ClaimedBarcodeScanner::ReleaseDeviceRequested_revoker | m_scannerReleaseRequestedToken

Detailed Description

Definition at line 18 of file Scenario4_SymbologyAttributes.h.

Constructor & Destructor Documentation

Scenario4_SymbologyAttributes ( )

Definition at line 29 of file Scenario4_SymbologyAttributes.cpp.

    {
        InitializeComponent();

        m_listOfSymbologies = single_threaded_observable_vector<SymbologyListEntry>();
        SymbologyListSource().Source(m_listOfSymbologies);
    }

Member Function Documentation

fire_and_forget claimedScanner_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | ,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [private]
void claimedScanner_ReleaseDeviceRequested | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | args |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void ResetTheScenarioState ( ) [private]

Reset the Scenario state.

Definition at line 140 of file Scenario4_SymbologyAttributes.cpp.

    {
        if (m_claimedScanner)
        {
            // Detach the event handlers
            m_scannerDataReceivedToken.revoke();
            m_scannerReleaseRequestedToken.revoke();
            // Release the Barcode Scanner and set to nullptr
            m_claimedScanner.Close();
            m_claimedScanner = nullptr;
        }

        if (m_scanner)
        {
            m_scanner.Close();
            m_scanner = nullptr;
        }

        m_symbologyAttributes = nullptr;

        // Reset the UI if we are still the current page.
        if (Frame().Content() == *this)
        {
            m_rootPage.NotifyUser(L"Click the start scanning button to begin.", NotifyType::StatusMessage);
            ScenarioOutputScanData().Text(L"No data");
            ScenarioOutputScanDataLabel().Text(L"No data");
            ScenarioOutputScanDataType().Text(L"No data");

            // reset the button state
            ScenarioEndScanButton().IsEnabled(false);
            ScenarioStartScanButton().IsEnabled(true);
            SetSymbologyAttributesButton().IsEnabled(false);
            EnableCheckDigit().IsEnabled(false);
            TransmitCheckDigit().IsEnabled(false);
            SetDecodeRangeLimits().IsEnabled(false);

            // reset symbology list
            m_listOfSymbologies.Clear();
        }
    }

void ScenarioEndScanButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget ScenarioStartScanButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SetSymbologyAttributes_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SymbologySelection_Changed | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & |
 | ) |  |

Member Data Documentation

Windows::Devices::PointOfService::ClaimedBarcodeScanner::DataReceived_revoker m_scannerDataReceivedToken [private]

Definition at line 38 of file Scenario4_SymbologyAttributes.h.

Windows::Devices::PointOfService::ClaimedBarcodeScanner::ReleaseDeviceRequested_revoker m_scannerReleaseRequestedToken [private]

Definition at line 31 of file Scenario4_SymbologyAttributes.h.

The documentation for this struct was generated from the following files:
  • BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.h
  • BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_TilePinned Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_TilePinned
Public Member Functions

Scenario4_TilePinned Struct Reference

#include "Scenario4_TilePinned.h"

List of all members.

Public Member Functions

Scenario4_TilePinned ()
void TileExists_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario4_TilePinned.h.

Constructor & Destructor Documentation

Scenario4_TilePinned ( )

Definition at line 24 of file Scenario4_TilePinned.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void TileExists_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario4_TilePinned.h
  • SecondaryTiles/cppwinrt/Scenario4_TilePinned.cpp
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario4_UnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario4_UnicodeExtensions
Public Member Functions

Scenario4_UnicodeExtensions Struct Reference

#include "Scenario4_UnicodeExtensions.h"

List of all members.

Public Member Functions

Scenario4_UnicodeExtensions ()
void ShowResults_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario4_UnicodeExtensions.h.

Constructor & Destructor Documentation

Scenario4_UnicodeExtensions ( )

Definition at line 41 of file Scenario4_UnicodeExtensions.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Calendar/cppwinrt/Scenario4_UnicodeExtensions.h
  • Calendar/cppwinrt/Scenario4_UnicodeExtensions.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5
Public Member Functions

Scenario5 Struct Reference

Writing and reading using a stream.

#include "Scenario5.h"

List of all members.

Public Member Functions

Scenario5 ()
Scenario5 ()
fire_and_forget | GetThumbnailButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ReadFromStreamButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | WriteToStreamButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 22 of file Scenario5.h.

Constructor & Destructor Documentation

Scenario5 ( )

Definition at line 26 of file Scenario5.cpp.

    {
        InitializeComponent();
    }

Scenario5 ( )

Member Function Documentation

fire_and_forget GetThumbnailButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget ReadFromStreamButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget WriteToStreamButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario5.h
  • FileThumbnails/cppwinrt/Scenario5.h
  • FileAccess/cppwinrt/Scenario5.cpp
  • FileThumbnails/cppwinrt/Scenario5.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_DisplayingBarcodePreview Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_DisplayingBarcodePreview
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_DisplayingBarcodePreview Struct Reference

#include "Scenario5_DisplayingBarcodePreview.h"

List of all members.

Public Member Functions

Scenario5_DisplayingBarcodePreview ()
void | FlipPreview_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | HidePreviewButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
bool | IsPreviewing ()
void | IsPreviewing (bool isPreviewing)
bool | IsScannerClaimed ()
void | IsScannerClaimed (bool claimed)
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &args)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | PropertyChanged (event_token const &token) noexcept
fire_and_forget | ScannerSelection_Changed (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &args)
bool | ScannerSupportsPreview ()
void | ScannerSupportsPreview (bool supportsPreview)
fire_and_forget | ShowPreviewButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | SoftwareTriggerStarted (bool started)
bool | SoftwareTriggerStarted ()
fire_and_forget | StartSoftwareTriggerButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | StopSoftwareTriggerButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | Watcher_Added (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformation args)
fire_and_forget | Watcher_Removed (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate const &args)
fire_and_forget | Watcher_Updated (Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate const &args)

Private Member Functions

void | ClaimedScanner_Closed (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &sender, Windows::Devices::PointOfService::ClaimedBarcodeScannerClosedEventArgs const &args)
fire_and_forget | ClaimedScanner_DataReceived (Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args)
Windows::Foundation::IAsyncAction | CloseScannerResourcesAsync ()
void | MediaCapture_Failed (Windows::Media::Capture::MediaCapture const &sender, Windows::Media::Capture::MediaCaptureFailedEventArgs const &errorEventArgs)
void | RaisePropertyChanged (hstring propertyName)
Windows::Foundation::IAsyncAction | SelectScannerAsync (hstring scannerDeviceId)
Windows::Foundation::IAsyncAction | SetPreviewRotationAsync (Windows::Graphics::Display::DisplayOrientations displayOrientation)
Windows::Foundation::IAsyncAction | StartMediaCaptureAsync (hstring videoDeviceId)

Private Attributes

bool | isStopPending = false
Windows::System::Display::DisplayRequest | m_displayRequest
bool | m_isPreviewing = false
bool | m_isScannerClaimed = false
bool | m_isSelectionChanging = false
hstring | m_pendingSelectionDeviceId
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged
bool | m_scannerSupportsPreview = false
bool | m_softwareTriggerStarted = false

Detailed Description

Definition at line 18 of file Scenario5_DisplayingBarcodePreview.h.

Constructor & Destructor Documentation

Scenario5_DisplayingBarcodePreview ( )

Definition at line 34 of file Scenario5_DisplayingBarcodePreview.cpp.

    {
        InitializeComponent();

        ScannerListSource().Source(m_barcodeScanners);
        m_watcher = DeviceInformation::CreateWatcher(BarcodeScanner::GetDeviceSelector());
        m_watcher.Added({ get_weak(), &Scenario5_DisplayingBarcodePreview::Watcher_Added });
        m_watcher.Removed({ get_weak(), &Scenario5_DisplayingBarcodePreview::Watcher_Removed });
        m_watcher.Updated({ get_weak(), &Scenario5_DisplayingBarcodePreview::Watcher_Updated });
        m_watcher.Start();

        DataContext(*this);
    }

Member Function Documentation

void ClaimedScanner_Closed | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | sender,
 |  | Windows::Devices::PointOfService::ClaimedBarcodeScannerClosedEventArgs const & | args |
 | ) |  |  | [private]
fire_and_forget ClaimedScanner_DataReceived | ( | Windows::Devices::PointOfService::ClaimedBarcodeScanner const & | ,
 |  | Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs | args |
 | ) |  |  | [private]
IAsyncAction CloseScannerResourcesAsync ( ) [private]

Close the scanners and stop the preview.

Definition at line 144 of file Scenario5_DisplayingBarcodePreview.cpp.

    {
        auto lifetime = get_strong();
        if (m_claimedScanner)
        {
            m_claimedScanner.Close();
            m_claimedScanner = nullptr;
        }

        if (m_selectedScanner)
        {
            m_selectedScanner.Close();
            m_selectedScanner = nullptr;
        }

        SoftwareTriggerStarted(false);
        RaisePropertyChanged(L"SoftwareTriggerStarted");

        if (!IsPreviewing())
        {
            co_return;
        }

        if (m_mediaCapture)
        {
            co_await m_mediaCapture.StopPreviewAsync();
            m_mediaCapture.Close();
            m_mediaCapture = nullptr;
        }

        if (m_displayRequest)
        {
            m_displayRequest.RequestRelease();
            IsPreviewing(false);
            RaisePropertyChanged(L"IsPreviewing");
        }
    }

void FlipPreview_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void HidePreviewButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void IsPreviewing ( bool isPreviewing ) [inline]

Definition at line 35 of file Scenario5_DisplayingBarcodePreview.h.

        {
            m_isPreviewing = isPreviewing;
        }

bool IsPreviewing ( ) [inline]

Definition at line 31 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_isPreviewing;
        }

void IsScannerClaimed ( bool claimed ) [inline]

Definition at line 26 of file Scenario5_DisplayingBarcodePreview.h.

        {
            m_isScannerClaimed = claimed;
        }

bool IsScannerClaimed ( ) [inline]

Definition at line 22 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_isScannerClaimed;
        }

void MediaCapture_Failed | ( | Windows::Media::Capture::MediaCapture const & | sender,
 |  | Windows::Media::Capture::MediaCaptureFailedEventArgs const & | errorEventArgs |
 | ) |  |  | [private]
fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & args )
event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 58 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_propertyChanged.add(handler);
        }

void PropertyChanged ( event_token const & token ) [inline]

Definition at line 63 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_propertyChanged.remove(token);
        }

void RaisePropertyChanged ( hstring propertyName ) [private]

Update listeners that a property was changed so that data bindings can be updated.

Parameters:
propertyName

Definition at line 448 of file Scenario5_DisplayingBarcodePreview.cpp.

    {
        m_propertyChanged(*this, PropertyChangedEventArgs(propertyName));
    }

fire_and_forget ScannerSelection_Changed | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & | args
 | ) |  |
bool ScannerSupportsPreview ( ) [inline]

Definition at line 40 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_scannerSupportsPreview;
        }

void ScannerSupportsPreview ( bool supportsPreview ) [inline]

Definition at line 44 of file Scenario5_DisplayingBarcodePreview.h.

        {
            m_scannerSupportsPreview = supportsPreview;
        }

IAsyncAction SelectScannerAsync ( hstring scannerDeviceId ) [private]

Select the scanner specified by its device ID.

Parameters:
scannerDeviceId

Definition at line 377 of file Scenario5_DisplayingBarcodePreview.cpp.

    {
        auto lifetime = get_strong();
        m_isSelectionChanging = true;

        co_await CloseScannerResourcesAsync();

        m_selectedScanner = co_await BarcodeScanner::FromIdAsync(scannerDeviceId);

        if (m_selectedScanner)
        {
            m_claimedScanner = co_await m_selectedScanner.ClaimScannerAsync();
            if (m_claimedScanner)
            {
                co_await m_claimedScanner.EnableAsync();
                m_claimedScanner.Closed({ get_weak(), &Scenario5_DisplayingBarcodePreview::ClaimedScanner_Closed });
                ScannerSupportsPreview(!m_selectedScanner.VideoDeviceId().empty());
                RaisePropertyChanged(L"ScannerSupportsPreview");

                m_claimedScanner.DataReceived({ get_weak(), &Scenario5_DisplayingBarcodePreview::ClaimedScanner_DataReceived });

                if (ScannerSupportsPreview())
                {
                    co_await StartMediaCaptureAsync(m_selectedScanner.VideoDeviceId());
                }
            }
            else
            {
                m_rootPage.NotifyUser(L"Failed to claim the selected barcode scanner", NotifyType::ErrorMessage);
            }

        }
        else
        {
            m_rootPage.NotifyUser(L"Failed to create a barcode scanner object", NotifyType::ErrorMessage);
        }

        IsScannerClaimed(m_claimedScanner != nullptr);
        RaisePropertyChanged(L"IsScannerClaimed");

        m_isSelectionChanging = false;
    }

Windows::Foundation::IAsyncAction SetPreviewRotationAsync ( Windows::Graphics::Display::DisplayOrientations displayOrientation ) [private]
fire_and_forget ShowPreviewButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
bool SoftwareTriggerStarted ( ) [inline]

Definition at line 49 of file Scenario5_DisplayingBarcodePreview.h.

        {
            return m_softwareTriggerStarted;
        }

void SoftwareTriggerStarted ( bool started ) [inline]

Definition at line 53 of file Scenario5_DisplayingBarcodePreview.h.

        {
            m_softwareTriggerStarted = started;
        }

IAsyncAction StartMediaCaptureAsync ( hstring videoDeviceId ) [private]

Starts previewing the selected scanner's video feed and prevents the display from going to sleep.

Definition at line 94 of file Scenario5_DisplayingBarcodePreview.cpp.

    {
        auto lifetime = get_strong();
        m_mediaCapture = MediaCapture();

        // Register for a notification when something goes wrong
        m_mediaCapture.Failed({ get_weak(), &Scenario5_DisplayingBarcodePreview::MediaCapture_Failed });

        auto settings = MediaCaptureInitializationSettings();
        settings.VideoDeviceId(videoDeviceId);
        settings.StreamingCaptureMode(StreamingCaptureMode::Video);
        settings.SharingMode(MediaCaptureSharingMode::SharedReadOnly);

        // Initialize MediaCapture
        bool captureInitialized = false;
        try
        {
            co_await m_mediaCapture.InitializeAsync(settings);
            captureInitialized = true;
        }
        catch (hresult_access_denied const&)
        {
            m_rootPage.NotifyUser(L"The app was denied access to the camera", NotifyType::ErrorMessage);
        }
        catch (hresult_error const& e)
        {
            m_rootPage.NotifyUser(L"Failed to initialize the camera: " + e.message(), NotifyType::ErrorMessage);
        }

        if (captureInitialized)
        {
            // Prevent the device from sleeping while the preview is running.
            m_displayRequest.RequestActive();

            PreviewControl().Source(m_mediaCapture);
            co_await m_mediaCapture.StartPreviewAsync();
            co_await SetPreviewRotationAsync(DisplayInformation::GetForCurrentView().CurrentOrientation());
            IsPreviewing(true);
            RaisePropertyChanged(L"IsPreviewing");
        }
        else
        {
            m_mediaCapture.Close();
            m_mediaCapture = nullptr;
        }
    }

fire_and_forget StartSoftwareTriggerButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget StopSoftwareTriggerButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget Watcher_Added | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformation | args
 | ) |  |
fire_and_forget Watcher_Removed | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate const & | args
 | ) |  |
fire_and_forget Watcher_Updated | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | Windows::Devices::Enumeration::DeviceInformationUpdate const & | args
 | ) |  |

Member Data Documentation

bool isStopPending = false [private]

Definition at line 108 of file Scenario5_DisplayingBarcodePreview.h.

Windows::System::Display::DisplayRequest m_displayRequest [private]

Definition at line 97 of file Scenario5_DisplayingBarcodePreview.h.

bool m_isPreviewing = false [private]

Definition at line 93 of file Scenario5_DisplayingBarcodePreview.h.

bool m_isScannerClaimed = false [private]

Definition at line 92 of file Scenario5_DisplayingBarcodePreview.h.

bool m_isSelectionChanging = false [private]

Definition at line 106 of file Scenario5_DisplayingBarcodePreview.h.

hstring m_pendingSelectionDeviceId [private]

Definition at line 107 of file Scenario5_DisplayingBarcodePreview.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 110 of file Scenario5_DisplayingBarcodePreview.h.

bool m_scannerSupportsPreview = false [private]

Definition at line 94 of file Scenario5_DisplayingBarcodePreview.h.

bool m_softwareTriggerStarted = false [private]

Definition at line 95 of file Scenario5_DisplayingBarcodePreview.h.

The documentation for this struct was generated from the following files:
  • BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.h
  • BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GeofenceBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_GeofenceBackgroundTask
Public Member Functions | Private Member Functions | Static Private Attributes

Scenario5_GeofenceBackgroundTask Struct Reference

#include "Scenario5_GeofenceBackgroundTask.h"

List of all members.

Public Member Functions

Scenario5_GeofenceBackgroundTask ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | RegisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | UnregisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | FillEventListBoxWithExistingEvents ()
fire_and_forget | OnCompleted (Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e)
void | UpdateButtonStates ()

Static Private Attributes

static constexpr std::wstring_view | BackgroundTaskEntryPoint = name_of<BackgroundTask::GeofenceBackgroundTask>()
static constexpr wchar_t | BackgroundTaskName [] = "SampleGeofenceBackgroundTask"

Detailed Description

Definition at line 18 of file Scenario5_GeofenceBackgroundTask.h.

Constructor & Destructor Documentation

Scenario5_GeofenceBackgroundTask ( )

Definition at line 27 of file Scenario5_GeofenceBackgroundTask.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void FillEventListBoxWithExistingEvents ( ) [private]

Definition at line 119 of file Scenario5_GeofenceBackgroundTask.cpp.

    {
        FillItemsFromSavedJson(GeofenceBackgroundEventsListBox(), L"BackgroundGeofenceEventCollection");
    }

fire_and_forget OnCompleted | ( | Windows::ApplicationModel::Background::IBackgroundTaskRegistration | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [private]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void RegisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UnregisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateButtonStates ( ) [private]

Definition at line 112 of file Scenario5_GeofenceBackgroundTask.cpp.

    {
        bool registered = (m_geofenceTask != nullptr);
        RegisterBackgroundTaskButton().IsEnabled(!registered);
        UnregisterBackgroundTaskButton().IsEnabled(registered);
    }

Member Data Documentation

constexpr std::wstring_view BackgroundTaskEntryPoint = name_of<BackgroundTask::GeofenceBackgroundTask>() [static, private]

Definition at line 31 of file Scenario5_GeofenceBackgroundTask.h.

constexpr wchar_t BackgroundTaskName[] = "SampleGeofenceBackgroundTask" [static, private]

Definition at line 30 of file Scenario5_GeofenceBackgroundTask.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.h
  • Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_GetSingleDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_GetSingleDevice
Public Member Functions | Private Attributes

Scenario5_GetSingleDevice Struct Reference

#include "Scenario5_GetSingleDevice.h"

List of all members.

Public Member Functions

Scenario5_GetSingleDevice ()
fire_and_forget | GetButton_Click (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | Page_Loaded (IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Attributes

Windows::Devices::Enumeration::DeviceInformationKind | deviceInformationKind
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 19 of file Scenario5_GetSingleDevice.h.

Constructor & Destructor Documentation

Scenario5_GetSingleDevice ( )

Definition at line 26 of file Scenario5_GetSingleDevice.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget GetButton_Click | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget Page_Loaded | ( | IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

Windows::Devices::Enumeration::DeviceInformationKind deviceInformationKind [private]

Definition at line 29 of file Scenario5_GetSingleDevice.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 31 of file Scenario5_GetSingleDevice.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_InkingAndInteractionFeedback Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_InkingAndInteractionFeedback
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_InkingAndInteractionFeedback Struct Reference

#include "Scenario5_InkingAndInteractionFeedback.h"

List of all members.

Public Member Functions

Scenario5_InkingAndInteractionFeedback ()
void | MovableRect_Entered (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | MovableRect_Exited (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e)
void | MovableRect_ManipulationCompleted (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs const &)
void | MovableRect_ManipulationDelta (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs const &e)
void | MovableRect_ManipulationStarted (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs const &)

Private Member Functions

Windows::Foundation::Point | GetSnappedPoint ()
void | InitializeGridLines ()
void | InitializeManipulationTransforms ()
bool | IsInSnapRange ()
void | SnapMovableRectToGridLines ()
void | UpdatePreviewRect ()

Private Attributes

const int | gridSize = 100
const double | snapDistance = 20.0
Windows::Foundation::Point | topLeft

Detailed Description

Definition at line 19 of file Scenario5_InkingAndInteractionFeedback.h.

Constructor & Destructor Documentation

Scenario5_InkingAndInteractionFeedback ( )

Definition at line 38 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        InitializeComponent();
        InitializeGridLines();
        InitializeManipulationTransforms();
    }

Member Function Documentation

Point GetSnappedPoint ( ) [private]

Definition at line 258 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        Point snappedPoint;
        float remainderX = (float)fmod(topLeft.X, gridSize);
        if (remainderX <= snapDistance)
        {
            snappedPoint.X = topLeft.X - remainderX;
        }
        else if (remainderX >= gridSize - snapDistance)
        {
            snappedPoint.X = topLeft.X + gridSize - remainderX;
        }
        else
        {
            snappedPoint.X = topLeft.X;
        }
        float remainderY = (float)fmod(topLeft.Y, gridSize);
        if (remainderY <= snapDistance)
        {
            snappedPoint.Y = topLeft.Y - remainderY;
        }
        else if (remainderY >= gridSize - snapDistance)
        {
            snappedPoint.Y = topLeft.Y + gridSize - remainderY;
        }
        else
        {
            snappedPoint.Y = topLeft.Y;
        }
        return snappedPoint;
    }

void InitializeGridLines ( ) [private]

Definition at line 46 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        SolidColorBrush darkGray(Colors::DarkGray());
        double width = hapticCanvas().Width();
        double height = hapticCanvas().Height();
        for (int i = 0; i <= width; i += gridSize)
        {
            Line currLine;
            currLine.Stroke(darkGray);
            currLine.X1(i);
            currLine.X2(i);
            currLine.Y1(0);
            currLine.Y2(height);
            hapticCanvas().Children().Append(currLine);
        }
        for (int i = 0; i <= height; i += gridSize)
        {
            Line currLine;
            currLine.Stroke(darkGray);
            currLine.X1(0);
            currLine.X2(width);
            currLine.Y1(i);
            currLine.Y2(i);
            hapticCanvas().Children().Append(currLine);
        }
    }

void InitializeManipulationTransforms ( ) [private]

Definition at line 74 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        previousTransform = MatrixTransform();
        previousTransform.Matrix(MatrixHelper::Identity());
        deltaTransform = CompositeTransform();
        topLeft = Point(75, 75);
        deltaTransform.TranslateX(topLeft.X);
        deltaTransform.TranslateY(topLeft.Y);

        transforms = TransformGroup();
        transforms.Children().ReplaceAll({ previousTransform, deltaTransform });

        // Set the render transform on the rect
        movableRect().RenderTransform(transforms);
    }

bool IsInSnapRange ( ) [private]

Definition at line 291 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        float remainderX = (float)fmod(topLeft.X, gridSize);
        float remainderY = (float)fmod(topLeft.Y, gridSize);
        return remainderX <= snapDistance ||
            remainderX >= gridSize - snapDistance ||
            remainderY <= snapDistance ||
            remainderY >= gridSize - snapDistance;
    }

void MovableRect_Entered | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void MovableRect_Exited | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::PointerRoutedEventArgs const & | e
 | ) |  |
void MovableRect_ManipulationCompleted | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs const & |
 | ) |  |
void MovableRect_ManipulationDelta | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs const & | e
 | ) |  |
void MovableRect_ManipulationStarted | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs const & |
 | ) |  |
void SnapMovableRectToGridLines ( ) [private]

Definition at line 233 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        topLeft = GetSnappedPoint();
        previousTransform = MatrixTransform();
        previousTransform.Matrix(MatrixHelper::Identity());
        deltaTransform.TranslateX(topLeft.X);
        deltaTransform.TranslateY(topLeft.Y);

        transforms = TransformGroup();
        transforms.Children().ReplaceAll({ previousTransform, deltaTransform });

        movableRect().RenderTransform(transforms);

        if (hapticsController != nullptr)
        {
            SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::Click());
            if (feedback != nullptr)
            {
                hapticsController.SendHapticFeedback(feedback);
            }
        }
    }

void UpdatePreviewRect ( ) [private]

Definition at line 183 of file Scenario5_InkingAndInteractionFeedback.cpp.

    {
        if (IsInSnapRange())
        {
            previewRect().Visibility(Visibility::Visible);
            Point newPreviewTopLeft = GetSnappedPoint();

            // Check to see if this is the first time that the previewRect is in range of a given gridline
            // and send the Click tactile signal if so
            bool sendHaptics = true;
            if ((previewTopLeft.X == newPreviewTopLeft.X && previewTopLeft.Y == newPreviewTopLeft.Y) ||
                (previewTopLeft.X == newPreviewTopLeft.X && newPreviewTopLeft.Y == topLeft.Y) ||
                (previewTopLeft.Y == newPreviewTopLeft.Y && newPreviewTopLeft.X == topLeft.X))
            {
                sendHaptics = false;
            }
            if (previewTopLeft.X != newPreviewTopLeft.X || previewTopLeft.Y != newPreviewTopLeft.Y)
            {
                previewTopLeft = newPreviewTopLeft;
                previewRect().Translation({ previewTopLeft.X, previewTopLeft.Y, 0 });
                if (hapticsController != nullptr && sendHaptics)
                {
                    SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::Click());
                    if (feedback != nullptr)
                    {
                        hapticsController.SendHapticFeedback(feedback);
                    }
                }
            }
        }
        else
        {
            previewRect().Visibility(Visibility::Collapsed);
            previewTopLeft = Point(-1, -1);
        }
    }

Member Data Documentation

const int gridSize = 100 [private]

Definition at line 30 of file Scenario5_InkingAndInteractionFeedback.h.

const double snapDistance = 20.0 [private]

Definition at line 31 of file Scenario5_InkingAndInteractionFeedback.h.

Windows::Foundation::Point topLeft [private]

Definition at line 32 of file Scenario5_InkingAndInteractionFeedback.h.

The documentation for this struct was generated from the following files:
  • PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.h
  • PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_IsSupported Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_IsSupported
Public Member Functions

Scenario5_IsSupported Struct Reference

#include "Scenario5_IsSupported.h"

List of all members.

Public Member Functions

Scenario5_IsSupported ()
void OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario5_IsSupported.h.

Constructor & Destructor Documentation

Scenario5_IsSupported ( )

Definition at line 24 of file Scenario5_IsSupported.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
The documentation for this struct was generated from the following files:
  • JumpList/cppwinrt/Scenario5_IsSupported.h
  • JumpList/cppwinrt/Scenario5_IsSupported.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_LaunchedFromSecondaryTile Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_LaunchedFromSecondaryTile
Public Member Functions

Scenario5_LaunchedFromSecondaryTile Struct Reference

#include "Scenario5_LaunchedFromSecondaryTile.h"

List of all members.

Public Member Functions

Scenario5_LaunchedFromSecondaryTile ()
void OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario5_LaunchedFromSecondaryTile.h.

Constructor & Destructor Documentation

Scenario5_LaunchedFromSecondaryTile ( )

Definition at line 23 of file Scenario5_LaunchedFromSecondaryTile.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.h
  • SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_Msappdata Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_Msappdata
Public Member Functions | Private Member Functions

Scenario5_Msappdata Struct Reference

#include "Scenario5_Msappdata.h"

List of all members.

Public Member Functions

Scenario5_Msappdata ()
fire_and_forget | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &)

Private Member Functions

Windows::Foundation::IAsyncAction | CopyAssetToFolderIfNecessaryAsync (hstring name, Windows::Storage::StorageFolder const &folder)

Detailed Description

Definition at line 19 of file Scenario5_Msappdata.h.

Constructor & Destructor Documentation

Scenario5_Msappdata ( )

Definition at line 25 of file Scenario5_Msappdata.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

Windows::Foundation::IAsyncAction CopyAssetToFolderIfNecessaryAsync | ( | hstring | name,
 |  | Windows::Storage::StorageFolder const & | folder |
 | ) |  |  | [private]
fire_and_forget OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const & )
The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario5_Msappdata.h
  • ApplicationData/cppwinrt/Scenario5_Msappdata.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RelativePositioning Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_RelativePositioning
Public Member Functions | Private Member Functions

Scenario5_RelativePositioning Struct Reference

#include "Scenario5_RelativePositioning.h"

List of all members.

Public Member Functions

Scenario5_RelativePositioning ()
fire_and_forget | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | ShowWindowBtn_Click (IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | OnWindowClosed (Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &)

Detailed Description

Definition at line 18 of file Scenario5_RelativePositioning.h.

Constructor & Destructor Documentation

Scenario5_RelativePositioning ( )

Definition at line 28 of file Scenario5_RelativePositioning.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnWindowClosed | ( | Windows::UI::WindowManagement::AppWindow const & | sender,
 |  | IInspectable const & |  |
 | ) |  |  | [private]
fire_and_forget ShowWindowBtn_Click | ( | IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/Scenario5_RelativePositioning.h
  • AppWindow/cppwinrt/Scenario5_RelativePositioning.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RestoreScrollPosition Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_RestoreScrollPosition
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario5_RestoreScrollPosition Struct Reference

#include "Scenario5_RestoreScrollPosition.h"

List of all members.

Public Member Functions

Scenario5_RestoreScrollPosition ()
auto | _items ()
void | ItemsListView_ContainerContentChanging (Windows::UI::Xaml::Controls::ListViewBase const &, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const &args)
void | ItemsListView_ItemClick (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatingFrom (Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &)
fire_and_forget | Page_Loaded (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

Windows::Foundation::IAsyncOperation
< Windows::Foundation::IInspectable > 		GetItem (hstring const &key)
hstring | GetKey (IInspectable const &object)

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Item > 		items = Item::GetItems(300)

Static Private Attributes

static double | _persistedItemContainerHeight = -1.0
static hstring | _persistedItemKey
static hstring | _persistedPosition

Detailed Description

Definition at line 18 of file Scenario5_RestoreScrollPosition.h.

Constructor & Destructor Documentation

Scenario5_RestoreScrollPosition ( )

Definition at line 28 of file Scenario5_RestoreScrollPosition.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

auto _items ( ) [inline]

Definition at line 22 of file Scenario5_RestoreScrollPosition.h.

{ return items; }

IAsyncOperation< IInspectable > GetItem ( hstring const & key ) [private]

Definition at line 50 of file Scenario5_RestoreScrollPosition.cpp.

    {
        // This function takes a key that ListViewPersistenceHelper parsed out of the _persistedPosition string
        // It returns an item that corresponds to the given key
        // The implementation of this function is dependent on the data model you are using. Every item in your list should have
        // a unique key this function returns
        auto found = std::find_if(items.begin(), items.end(), [&](auto&& item) { return item.Id() == key; });
        co_return found == items.end() ? nullptr : *found;
    }

hstring GetKey ( IInspectable const & object ) [private]

Definition at line 60 of file Scenario5_RestoreScrollPosition.cpp.

    {
        // This function takes in the item at the top of the viewport at the moment of navigating away from the page, and returns
        // a key corresponding to that item. the implementation of this function is dependent on the data model you are using. In this
        // function we also save the fully rendered _persistedItemContainerHeight. You do not need to do this if all of your items have
        // the same fixed height. Finally, we save the key into a variable so it can be used outside of ListViewPersistenceHelper functions
        SDKTemplate::Item item = object.try_as<SDKTemplate::Item>();
        if (item != nullptr)
        {
            _persistedItemContainerHeight = ItemsListView().ContainerFromItem(item).as<ListViewItem>().ActualHeight();
            _persistedItemKey = item.Id();
            return _persistedItemKey;
        }
        else
        {
            return L"";
        }
    }

void ItemsListView_ContainerContentChanging | ( | Windows::UI::Xaml::Controls::ListViewBase const & | ,
 |  | Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const & | args
 | ) |  |
void ItemsListView_ItemClick | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatingFrom ( Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const & )
fire_and_forget Page_Loaded | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

double _persistedItemContainerHeight = -1.0 [static, private]

Definition at line 34 of file Scenario5_RestoreScrollPosition.h.

hstring _persistedItemKey [static, private]

Definition at line 35 of file Scenario5_RestoreScrollPosition.h.

hstring _persistedPosition [static, private]

Definition at line 36 of file Scenario5_RestoreScrollPosition.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::Item> items = Item::GetItems(300) [private]

Definition at line 29 of file Scenario5_RestoreScrollPosition.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.h
  • XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_RoundingAndPadding Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_RoundingAndPadding
Public Member Functions

Scenario5_RoundingAndPadding Struct Reference

#include "Scenario5_RoundingAndPadding.h"

List of all members.

Public Member Functions

Scenario5_RoundingAndPadding ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario5_RoundingAndPadding.h.

Constructor & Destructor Documentation

Scenario5_RoundingAndPadding ( )

Definition at line 240 of file Scenario5_RoundingAndPadding.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.h
  • NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TimeZone Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_TimeZone
Public Member Functions

Scenario5_TimeZone Struct Reference

#include "Scenario5_TimeZone.h"

List of all members.

Public Member Functions

Scenario5_TimeZone ()
void ShowResults_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario5_TimeZone.h.

Constructor & Destructor Documentation

Scenario5_TimeZone ( )

Definition at line 43 of file Scenario5_TimeZone.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void ShowResults_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • Calendar/cppwinrt/Scenario5_TimeZone.h
  • Calendar/cppwinrt/Scenario5_TimeZone.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_TriggerCFU Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_TriggerCFU
Public Member Functions | Private Member Functions | Private Attributes

Scenario5_TriggerCFU Struct Reference

#include "Scenario5_TriggerCFU.h"

List of all members.

Public Member Functions

Scenario5_TriggerCFU ()
fire_and_forget | CreateFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GetFileFromFutureAccessListButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | PickAFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | SaveToFutureAccessListButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | WriteToFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | WriteToFileWithExplicitCFUButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | UpdateButtons ()

Private Attributes

hstring | m_faToken

Detailed Description

Definition at line 19 of file Scenario5_TriggerCFU.h.

Constructor & Destructor Documentation

Scenario5_TriggerCFU ( )

Definition at line 26 of file Scenario5_TriggerCFU.cpp.

    {
        InitializeComponent();
        UpdateButtons();
    }

Member Function Documentation

fire_and_forget CreateFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget GetFileFromFutureAccessListButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget PickAFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void SaveToFutureAccessListButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateButtons ( ) [private]

Definition at line 32 of file Scenario5_TriggerCFU.cpp.

    {
        WriteToFileButton().IsEnabled(m_afterWriteFile != nullptr);
        WriteToFileWithCFUButton().IsEnabled(m_afterWriteFile != nullptr);

        SaveToFutureAccessListButton().IsEnabled(m_beforeReadFile != nullptr);
        GetFileFromFutureAccessListButton().IsEnabled(!m_faToken.empty());
    }

fire_and_forget WriteToFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget WriteToFileWithExplicitCFUButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Member Data Documentation

hstring m_faToken [private]

Definition at line 30 of file Scenario5_TriggerCFU.h.

The documentation for this struct was generated from the following files:
  • FilePicker/cppwinrt/Scenario5_TriggerCFU.h
  • FilePicker/cppwinrt/Scenario5_TriggerCFU.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_UnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_UnicodeExtensions
Public Member Functions

Scenario5_UnicodeExtensions Struct Reference

#include "Scenario5_UnicodeExtensions.h"

List of all members.

Public Member Functions

Scenario5_UnicodeExtensions ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario5_UnicodeExtensions.h.

Constructor & Destructor Documentation

Scenario5_UnicodeExtensions ( )

Definition at line 25 of file Scenario5_UnicodeExtensions.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.h
  • DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario5_VerifyResponse Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario5_VerifyResponse
Public Member Functions

Scenario5_VerifyResponse Struct Reference

#include "Scenario5_VerifyResponse.h"

List of all members.

Public Member Functions

Scenario5_VerifyResponse ()
fire_and_forget VerifyResponse_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario5_VerifyResponse.h.

Constructor & Destructor Documentation

Scenario5_VerifyResponse ( )

Definition at line 28 of file Scenario5_VerifyResponse.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget VerifyResponse_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario5_VerifyResponse.h
  • SmartCard/cppwinrt/Scenario5_VerifyResponse.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6
Public Member Functions

Scenario6 Struct Reference

Displaying file properties.

#include "Scenario6.h"

List of all members.

Public Member Functions

Scenario6 ()
Scenario6 ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | SelectImageButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | ShowPropertiesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 22 of file Scenario6.h.

Constructor & Destructor Documentation

Scenario6 ( )

Definition at line 29 of file Scenario6.cpp.

    {
        InitializeComponent();
    }

Scenario6 ( )

Member Function Documentation

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget SelectImageButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget ShowPropertiesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario6.h
  • FileThumbnails/cppwinrt/Scenario6.h
  • FileAccess/cppwinrt/Scenario6.cpp
  • FileThumbnails/cppwinrt/Scenario6.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ClearScenario Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_ClearScenario
Public Member Functions

Scenario6_ClearScenario Struct Reference

#include "Scenario6_ClearScenario.h"

List of all members.

Public Member Functions

Scenario6_ClearScenario ()
fire_and_forget Clear_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario6_ClearScenario.h.

Constructor & Destructor Documentation

Scenario6_ClearScenario ( )

Definition at line 23 of file Scenario6_ClearScenario.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Clear_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario6_ClearScenario.h
  • ApplicationData/cppwinrt/Scenario6_ClearScenario.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_CustomFilterAddedProps Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_CustomFilterAddedProps
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_CustomFilterAddedProps Struct Reference

#include "Scenario6_CustomFilterAddedProps.h"

List of all members.

Public Member Functions

Scenario6_CustomFilterAddedProps ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | StartWatcher ()
void | StopWatcher ()

Private Attributes

com_ptr< DeviceWatcherHelper > | deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher())
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 20 of file Scenario6_CustomFilterAddedProps.h.

Constructor & Destructor Documentation

Scenario6_CustomFilterAddedProps ( )

Definition at line 25 of file Scenario6_CustomFilterAddedProps.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void StartWatcher ( ) [private]

Definition at line 50 of file Scenario6_CustomFilterAddedProps.cpp.

    {
        aqsFilterTextBox().IsEnabled(false);
        startWatcherButton().IsEnabled(false);
        resultCollection.Clear();

        // Request some additional properties.  In this sample, these extra properties are just used in the ResultsListViewTemplate.
        // In general you just look up the property in the DeviceInformation.Properties.
        // e.g. DeviceInformation.Properties.TryLookup(L"System.Devices.InterfaceClassGuid").
        std::vector<hstring> requestedProperties = {
            L"System.Devices.InterfaceClassGuid",
            L"System.ItemNameDisplay"
        };

        // Use AQS string filter from the text box
        DeviceWatcher deviceWatcher = DeviceInformation::CreateWatcher(
            aqsFilterTextBox().Text(),
            requestedProperties);

        rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
        deviceWatcherHelper->StartWatcher(deviceWatcher);
        stopWatcherButton().IsEnabled(true);
        stopWatcherButton().Focus(FocusState::Keyboard);
        aqsFilterTextBox().IsEnabled(true);
    }

void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcher ( ) [private]

Definition at line 76 of file Scenario6_CustomFilterAddedProps.cpp.

    {
        aqsFilterTextBox().IsEnabled(false);
        stopWatcherButton().IsEnabled(false);

        deviceWatcherHelper->StopWatcher();

        startWatcherButton().IsEnabled(true);
        startWatcherButton().Focus(FocusState::Keyboard);
        aqsFilterTextBox().IsEnabled(true);
    }

void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

com_ptr<DeviceWatcherHelper> deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher()) [private]

Definition at line 33 of file Scenario6_CustomFilterAddedProps.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 32 of file Scenario6_CustomFilterAddedProps.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_DeleteTPM Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_DeleteTPM
Public Member Functions | Private Member Functions | Private Attributes

Scenario6_DeleteTPM Struct Reference

#include "Scenario6_DeleteTPM.h"

List of all members.

Public Member Functions

Scenario6_DeleteTPM ()
fire_and_forget | Delete_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | HandleCardRemoved (Windows::Devices::SmartCards::SmartCardReader const &evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs const &)

Private Attributes

Windows::Devices::SmartCards::SmartCardReader::CardRemoved_revoker | m_cardRemovedToken

Detailed Description

Definition at line 18 of file Scenario6_DeleteTPM.h.

Constructor & Destructor Documentation

Scenario6_DeleteTPM ( )

Definition at line 26 of file Scenario6_DeleteTPM.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Delete_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void HandleCardRemoved | ( | Windows::Devices::SmartCards::SmartCardReader const & | evtReader,
 |  | Windows::Devices::SmartCards::CardRemovedEventArgs const & |  |
 | ) |  |  | [private]

Definition at line 90 of file Scenario6_DeleteTPM.cpp.

    {
        // Note that this event is raised from a background thread.
        // However, the NotifyUser method is safe to call from background threads.
        m_rootPage.NotifyUser(L"Card removed from reader " + evtReader.Name() + L".", NotifyType::StatusMessage);
    }

Member Data Documentation

Windows::Devices::SmartCards::SmartCardReader::CardRemoved_revoker m_cardRemovedToken [private]

Definition at line 25 of file Scenario6_DeleteTPM.h.

The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario6_DeleteTPM.h
  • SmartCard/cppwinrt/Scenario6_DeleteTPM.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_GetLastVisit Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_GetLastVisit
Public Member Functions | Private Member Functions

Scenario6_GetLastVisit Struct Reference

#include "Scenario6_GetLastVisit.h"

List of all members.

Public Member Functions

Scenario6_GetLastVisit ()
fire_and_forget | GetLastVisitButtonClicked (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | UpdateLastVisit (Windows::Devices::Geolocation::Geovisit const &visit)

Detailed Description

Definition at line 18 of file Scenario6_GetLastVisit.h.

Constructor & Destructor Documentation

Scenario6_GetLastVisit ( )

Definition at line 24 of file Scenario6_GetLastVisit.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget GetLastVisitButtonClicked | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateLastVisit ( Windows::Devices::Geolocation::Geovisit const & visit ) [private]
The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario6_GetLastVisit.h
  • Geolocation/cppwinrt/Scenario6_GetLastVisit.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_NumeralSystemTranslation Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_NumeralSystemTranslation
Public Member Functions

Scenario6_NumeralSystemTranslation Struct Reference

#include "Scenario6_NumeralSystemTranslation.h"

List of all members.

Public Member Functions

Scenario6_NumeralSystemTranslation ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario6_NumeralSystemTranslation.h.

Constructor & Destructor Documentation

Scenario6_NumeralSystemTranslation ( )

Definition at line 23 of file Scenario6_NumeralSystemTranslation.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.h
  • NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_ScrollIntoView Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_ScrollIntoView
Public Member Functions | Private Attributes

Scenario6_ScrollIntoView Struct Reference

#include "Scenario6_ScrollIntoView.h"

List of all members.

Public Member Functions

Scenario6_ScrollIntoView ()
auto | _items ()
void | Scroll_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::Item > 		items = Item::GetItems(300)

Detailed Description

Definition at line 18 of file Scenario6_ScrollIntoView.h.

Constructor & Destructor Documentation

Scenario6_ScrollIntoView ( )

Definition at line 23 of file Scenario6_ScrollIntoView.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

auto _items ( ) [inline]

Definition at line 22 of file Scenario6_ScrollIntoView.h.

{ return items; }

void Scroll_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |

Definition at line 28 of file Scenario6_ScrollIntoView.cpp.

    {
        hstring text = scrollId().Text();
        wchar_t* end;
        unsigned long index = std::wcstoul(text.c_str(), &end, 10);
        if (text.c_str() == end)
        {
            index = ~0UL; // invalid
        }
        if (index < ItemsListView().Items().Size())
        {
            ScrollIntoViewAlignment alignment = ScrollAlignment().SelectedItem().as<FrameworkElement>().Tag().as<ScrollIntoViewAlignment>();
            ItemsListView().ScrollIntoView(ItemsListView().Items().GetAt(index), alignment);
            scrollId().BorderBrush(ValidFormatBrush());
        }
        else
        {
            scrollId().BorderBrush(InvalidFormatBrush());
        }
    }

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::Item> items = Item::GetItems(300) [private]

Definition at line 26 of file Scenario6_ScrollIntoView.h.

The documentation for this struct was generated from the following files:
  • XamlListView/cppwinrt/Scenario6_ScrollIntoView.h
  • XamlListView/cppwinrt/Scenario6_ScrollIntoView.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_SecondaryTileNotification Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_SecondaryTileNotification
Public Member Functions | Private Member Functions

Scenario6_SecondaryTileNotification Struct Reference

#include "Scenario6_SecondaryTileNotification.h"

List of all members.

Public Member Functions

Scenario6_SecondaryTileNotification ()
fire_and_forget | PinLiveTile_Click (Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendBadgeNotification_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendBadgeNotificationWithStringManipulation_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendTileNotification_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | SendTileNotificationWithStringManipulation_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

bool | VerifyTileIsPinned ()

Detailed Description

Definition at line 19 of file Scenario6_SecondaryTileNotification.h.

Constructor & Destructor Documentation

Scenario6_SecondaryTileNotification ( )

Definition at line 28 of file Scenario6_SecondaryTileNotification.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget PinLiveTile_Click | ( | Windows::Foundation::IInspectable | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendBadgeNotification_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendBadgeNotificationWithStringManipulation_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendTileNotification_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void SendTileNotificationWithStringManipulation_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
bool VerifyTileIsPinned ( ) [private]

Definition at line 33 of file Scenario6_SecondaryTileNotification.cpp.

    {
        if (SecondaryTile::Exists(SampleHelpers::DynamicTileId))
        {
            return true;
        }
        rootPage.NotifyUser(hstring(SampleHelpers::DynamicTileId) + L" is not pinned.", NotifyType::ErrorMessage);
        return false;
    }

The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.h
  • SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario6_TimeZone Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario6_TimeZone
Public Member Functions

Scenario6_TimeZone Struct Reference

#include "Scenario6_TimeZone.h"

List of all members.

Public Member Functions

Scenario6_TimeZone ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario6_TimeZone.h.

Constructor & Destructor Documentation

Scenario6_TimeZone ( )

Definition at line 34 of file Scenario6_TimeZone.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • DateTimeFormatting/cppwinrt/Scenario6_TimeZone.h
  • DateTimeFormatting/cppwinrt/Scenario6_TimeZone.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7
Public Member Functions

Scenario7 Struct Reference

Persisting access to a storage item for future use.

#include "Scenario7.h"

List of all members.

Public Member Functions

Scenario7 ()
void | AddToListButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | OpenFromListButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | ShowListButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 22 of file Scenario7.h.

Constructor & Destructor Documentation

Scenario7 ( )

Definition at line 27 of file Scenario7.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void AddToListButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OpenFromListButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void ShowListButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario7.h
  • FileAccess/cppwinrt/Scenario7.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_DeviceInformationKind Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_DeviceInformationKind
Public Member Functions | Private Attributes

Scenario7_DeviceInformationKind Struct Reference

#include "Scenario7_DeviceInformationKind.h"

List of all members.

Public Member Functions

Scenario7_DeviceInformationKind ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Attributes

Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 20 of file Scenario7_DeviceInformationKind.h.

Constructor & Destructor Documentation

Scenario7_DeviceInformationKind ( )

Definition at line 26 of file Scenario7_DeviceInformationKind.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 32 of file Scenario7_DeviceInformationKind.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ForegroundVisits Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_ForegroundVisits
Public Member Functions | Private Member Functions

Scenario7_ForegroundVisits Struct Reference

#include "Scenario7_ForegroundVisits.h"

List of all members.

Public Member Functions

Scenario7_ForegroundVisits ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
fire_and_forget | StartMonitoring (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | StopMonitoring (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

fire_and_forget | OnVisitStateChanged (Windows::Devices::Geolocation::GeovisitMonitor const &, Windows::Devices::Geolocation::GeovisitStateChangedEventArgs args)
void | UpdateVisitData (Windows::Devices::Geolocation::Geovisit const &visit)

Detailed Description

Definition at line 18 of file Scenario7_ForegroundVisits.h.

Constructor & Destructor Documentation

Scenario7_ForegroundVisits ( )

Definition at line 25 of file Scenario7_ForegroundVisits.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
fire_and_forget OnVisitStateChanged | ( | Windows::Devices::Geolocation::GeovisitMonitor const & | ,
 |  | Windows::Devices::Geolocation::GeovisitStateChangedEventArgs | args |
 | ) |  |  | [private]
fire_and_forget StartMonitoring | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void StopMonitoring | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateVisitData ( Windows::Devices::Geolocation::Geovisit const & visit ) [private]
The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario7_ForegroundVisits.h
  • Geolocation/cppwinrt/Scenario7_ForegroundVisits.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_ListAllCards Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_ListAllCards
Public Member Functions

Scenario7_ListAllCards Struct Reference

#include "Scenario7_ListAllCards.h"

List of all members.

Public Member Functions

Scenario7_ListAllCards ()
fire_and_forget ListSmartCard_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario7_ListAllCards.h.

Constructor & Destructor Documentation

Scenario7_ListAllCards ( )

Definition at line 28 of file Scenario7_ListAllCards.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget ListSmartCard_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario7_ListAllCards.h
  • SmartCard/cppwinrt/Scenario7_ListAllCards.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_PinFromAppbar Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_PinFromAppbar
Public Member Functions | Private Member Functions | Private Attributes

Scenario7_PinFromAppbar Struct Reference

#include "Scenario7_PinFromAppbar.h"

List of all members.

Public Member Functions

Scenario7_PinFromAppbar ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | PinToAppBar_Click (Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | BottomAppBar_Opened (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
void | UpdateAppBarButton ()
void | Window_Activated (Windows::Foundation::IInspectable const &sender, Windows::UI::Core::WindowActivatedEventArgs const &e)

Private Attributes

event_token | windowActivatedEventToken

Detailed Description

Definition at line 19 of file Scenario7_PinFromAppbar.h.

Constructor & Destructor Documentation

Scenario7_PinFromAppbar ( )

Definition at line 27 of file Scenario7_PinFromAppbar.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void BottomAppBar_Opened | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget PinToAppBar_Click | ( | Windows::Foundation::IInspectable | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdateAppBarButton ( ) [private]

Definition at line 54 of file Scenario7_PinFromAppbar.cpp.

    {
        if (SecondaryTile::Exists(SampleHelpers::AppBarTileId))
        {
            PinUnPinCommandButton().Label(L"Unpin");
            PinUnPinCommandButton().Icon(SymbolIcon(Symbol::UnPin));
        }
        else
        {
            PinUnPinCommandButton().Label(L"Pin");
            PinUnPinCommandButton().Icon(SymbolIcon(Symbol::Pin));
        }

        PinUnPinCommandButton().UpdateLayout();
    }

void Window_Activated | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Core::WindowActivatedEventArgs const & | e |
 | ) |  |  | [private]

Member Data Documentation

event_token windowActivatedEventToken [private]

Definition at line 30 of file Scenario7_PinFromAppbar.h.

The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.h
  • SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_SetVersion Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_SetVersion
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario7_SetVersion Struct Reference

#include "Scenario7_SetVersion.h"

List of all members.

Public Member Functions

Scenario7_SetVersion ()
void | DisplayOutput ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | SetVersion0_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | SetVersion1_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | SetVersionHandler0 (Windows::Storage::SetVersionRequest const &request)
void | SetVersionHandler1 (Windows::Storage::SetVersionRequest const &request)

Private Attributes

Windows::Storage::ApplicationData | appData = Windows::Storage::ApplicationData::Current()

Static Private Attributes

static const auto | settingName = "SetVersionSetting"
static const auto | settingValue0 = "Data.v0"
static const auto | settingValue1 = "Data.v1"

Detailed Description

Definition at line 19 of file Scenario7_SetVersion.h.

Constructor & Destructor Documentation

Scenario7_SetVersion ( )

Definition at line 24 of file Scenario7_SetVersion.cpp.

    {
        InitializeComponent();

        DisplayOutput();
    }

Member Function Documentation

void DisplayOutput ( )

Definition at line 99 of file Scenario7_SetVersion.cpp.

    {
        OutputTextBlock().Text(L"Version: " + to_hstring(appData.Version()));
    }

void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget SetVersion0_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SetVersion1_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void SetVersionHandler0 ( Windows::Storage::SetVersionRequest const & request ) [private]
void SetVersionHandler1 ( Windows::Storage::SetVersionRequest const & request ) [private]

Member Data Documentation

Windows::Storage::ApplicationData appData = Windows::Storage::ApplicationData::Current() [private]

Definition at line 34 of file Scenario7_SetVersion.h.

const auto settingName = "SetVersionSetting" [inline, static, private]

Definition at line 36 of file Scenario7_SetVersion.h.

const auto settingValue0 = "Data.v0" [inline, static, private]

Definition at line 37 of file Scenario7_SetVersion.h.

const auto settingValue1 = "Data.v1" [inline, static, private]

Definition at line 38 of file Scenario7_SetVersion.h.

The documentation for this struct was generated from the following files:
  • ApplicationData/cppwinrt/Scenario7_SetVersion.h
  • ApplicationData/cppwinrt/Scenario7_SetVersion.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario7_UsingUnicodeExtensions Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario7_UsingUnicodeExtensions
Public Member Functions

Scenario7_UsingUnicodeExtensions Struct Reference

#include "Scenario7_UsingUnicodeExtensions.h"

List of all members.

Public Member Functions

Scenario7_UsingUnicodeExtensions ()
void Display_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 18 of file Scenario7_UsingUnicodeExtensions.h.

Constructor & Destructor Documentation

Scenario7_UsingUnicodeExtensions ( )

Definition at line 24 of file Scenario7_UsingUnicodeExtensions.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void Display_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.h
  • NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario8
Public Member Functions

Scenario8 Struct Reference

Copying a file.

#include "Scenario8.h"

List of all members.

Public Member Functions

Scenario8 ()
fire_and_forget | CopyFileButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Detailed Description

Definition at line 22 of file Scenario8.h.

Constructor & Destructor Documentation

Scenario8 ( )

Definition at line 25 of file Scenario8.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CopyFileButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario8.h
  • FileAccess/cppwinrt/Scenario8.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_PairDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario8_PairDevice
Public Member Functions | Private Member Functions | Private Attributes

Scenario8_PairDevice Struct Reference

#include "Scenario8_PairDevice.h"

List of all members.

Public Member Functions

Scenario8_PairDevice ()
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | PairButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ResultsListView_SelectionChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | UnpairButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | OnDeviceListChanged (Windows::Devices::Enumeration::DeviceWatcher const &sender, hstring const &id)
void | StartWatcher ()
void | StopWatcher ()
void | UpdatePairingButtons ()

Private Attributes

com_ptr< DeviceWatcherHelper > | deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher())
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 20 of file Scenario8_PairDevice.h.

Constructor & Destructor Documentation

Scenario8_PairDevice ( )

Definition at line 27 of file Scenario8_PairDevice.cpp.

    {
        InitializeComponent();
        deviceWatcherHelper->DeviceChanged({ get_weak(), &Scenario8_PairDevice::OnDeviceListChanged });
    }

Member Function Documentation

void OnDeviceListChanged | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | hstring const & | id |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget PairButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void ResultsListView_SelectionChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & | e
 | ) |  |
void StartWatcher ( ) [private]

Definition at line 56 of file Scenario8_PairDevice.cpp.

    {
        startWatcherButton().IsEnabled(false);
        resultCollection.Clear();

        // Get the device selector chosen by the UI then add additional constraints for devices that
        // can be paired or are already paired.
        DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(selectorComboBox().SelectedItem());
        hstring selector = L"(" + deviceSelectorInfo->Selector() + L") AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";

        DeviceWatcher deviceWatcher{ nullptr };
        if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
        {
            // Kind will be determined by the selector
            deviceWatcher = DeviceInformation::CreateWatcher(
                selector,
                nullptr // don't request additional properties for this sample
            );
        }
        else
        {
            // Kind is specified in the selector info
            deviceWatcher = DeviceInformation::CreateWatcher(
                selector,
                nullptr, // don't request additional properties for this sample
                deviceSelectorInfo->Kind());
        }

        rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
        deviceWatcherHelper->StartWatcher(deviceWatcher);
        stopWatcherButton().IsEnabled(true);
    }

void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcher ( ) [private]

Definition at line 89 of file Scenario8_PairDevice.cpp.

    {
        stopWatcherButton().IsEnabled(false);

        deviceWatcherHelper->StopWatcher();

        startWatcherButton().IsEnabled(true);
    }

void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget UnpairButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdatePairingButtons ( ) [private]

Definition at line 158 of file Scenario8_PairDevice.cpp.

    {
        auto item = resultsListView().SelectedItem();
        DeviceInformationDisplay* deviceInfoDisp = FromInspectable<DeviceInformationDisplay>(item);
        if (deviceInfoDisp != nullptr &&
            deviceInfoDisp->DeviceInformation().Pairing().CanPair() &&
            !deviceInfoDisp->DeviceInformation().Pairing().IsPaired())
        {
            pairButton().IsEnabled(true);
        }
        else
        {
            pairButton().IsEnabled(false);
        }

        if (deviceInfoDisp != nullptr &&
            deviceInfoDisp->DeviceInformation().Pairing().IsPaired())
        {
            unpairButton().IsEnabled(true);
        }
        else
        {
            unpairButton().IsEnabled(false);
        }
    }

Member Data Documentation

com_ptr<DeviceWatcherHelper> deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher()) [private]

Definition at line 36 of file Scenario8_PairDevice.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 35 of file Scenario8_PairDevice.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_TransmitAPDU Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario8_TransmitAPDU
Public Member Functions

Scenario8_TransmitAPDU Struct Reference

#include "Scenario8_TransmitAPDU.h"

List of all members.

Public Member Functions

Scenario8_TransmitAPDU ()
fire_and_forget Transmit_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &)

Detailed Description

Definition at line 18 of file Scenario8_TransmitAPDU.h.

Constructor & Destructor Documentation

Scenario8_TransmitAPDU ( )

Definition at line 29 of file Scenario8_TransmitAPDU.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget Transmit_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
The documentation for this struct was generated from the following files:
  • SmartCard/cppwinrt/Scenario8_TransmitAPDU.h
  • SmartCard/cppwinrt/Scenario8_TransmitAPDU.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_UpdateAsync Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario8_UpdateAsync
Public Member Functions

Scenario8_UpdateAsync Struct Reference

#include "Scenario8_UpdateAsync.h"

List of all members.

Public Member Functions

Scenario8_UpdateAsync ()
fire_and_forget UpdateDefaultLogo_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Detailed Description

Definition at line 19 of file Scenario8_UpdateAsync.h.

Constructor & Destructor Documentation

Scenario8_UpdateAsync ( )

Definition at line 24 of file Scenario8_UpdateAsync.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget UpdateDefaultLogo_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
The documentation for this struct was generated from the following files:
  • SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.h
  • SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario8_VisitsBackgroundTask Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario8_VisitsBackgroundTask
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

Scenario8_VisitsBackgroundTask Struct Reference

#include "Scenario8_VisitsBackgroundTask.h"

List of all members.

Public Member Functions

Scenario8_VisitsBackgroundTask ()
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)
void | RegisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | UnregisterBackgroundTask (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)

Private Member Functions

void | FillEventListBoxWithExistingEvents ()
fire_and_forget | OnCompleted (Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e)
void | UpdateButtonStates ()

Private Attributes

Windows::ApplicationModel::Background::IBackgroundTaskRegistration | m_visitTask

Static Private Attributes

static constexpr std::wstring_view | BackgroundTaskEntryPoint = name_of<BackgroundTask::VisitBackgroundTask>()
static constexpr wchar_t | BackgroundTaskName [] = "SampleVisitBackgroundTask"

Detailed Description

Definition at line 18 of file Scenario8_VisitsBackgroundTask.h.

Constructor & Destructor Documentation

Scenario8_VisitsBackgroundTask ( )

Definition at line 26 of file Scenario8_VisitsBackgroundTask.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

void FillEventListBoxWithExistingEvents ( ) [private]

Definition at line 124 of file Scenario8_VisitsBackgroundTask.cpp.

    {
        FillItemsFromSavedJson(VisitBackgroundEventsListBox(), L"BackgroundVisitEventCollection");
    }

fire_and_forget OnCompleted | ( | Windows::ApplicationModel::Background::IBackgroundTaskRegistration | sender,
 |  | Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs | e |
 | ) |  |  | [private]
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
void RegisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UnregisterBackgroundTask | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void UpdateButtonStates ( ) [private]

Definition at line 117 of file Scenario8_VisitsBackgroundTask.cpp.

    {
        bool registered = (m_visitTask != nullptr);
        RegisterBackgroundTaskButton().IsEnabled(!registered);
        UnregisterBackgroundTaskButton().IsEnabled(registered);
    }

Member Data Documentation

constexpr std::wstring_view BackgroundTaskEntryPoint = name_of<BackgroundTask::VisitBackgroundTask>() [static, private]

Definition at line 33 of file Scenario8_VisitsBackgroundTask.h.

constexpr wchar_t BackgroundTaskName[] = "SampleVisitBackgroundTask" [static, private]

Definition at line 32 of file Scenario8_VisitsBackgroundTask.h.

Windows::ApplicationModel::Background::IBackgroundTaskRegistration m_visitTask [private]

Definition at line 28 of file Scenario8_VisitsBackgroundTask.h.

The documentation for this struct was generated from the following files:
  • Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.h
  • Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9 Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario9
Public Member Functions

Scenario9 Struct Reference

#include "Scenario9.h"

List of all members.

Public Member Functions

Scenario9 ()
fire_and_forget | CompareFilesButton_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &)

Detailed Description

Definition at line 19 of file Scenario9.h.

Constructor & Destructor Documentation

Scenario9 ( )

Definition at line 26 of file Scenario9.cpp.

    {
        InitializeComponent();
    }

Member Function Documentation

fire_and_forget CompareFilesButton_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & )
The documentation for this struct was generated from the following files:
  • FileAccess/cppwinrt/Scenario9.h
  • FileAccess/cppwinrt/Scenario9.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Scenario9_CustomPairDevice Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Scenario9_CustomPairDevice
Public Member Functions | Private Member Functions | Private Attributes

Scenario9_CustomPairDevice Struct Reference

#include "Scenario9_CustomPairDevice.h"

List of all members.

Public Member Functions

Scenario9_CustomPairDevice ()
void | noButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | okButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | OnNavigatedFrom (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | PairButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | ResultsListView_SelectionChanged (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &e)
void | StartWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | StopWatcherButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
fire_and_forget | UnpairButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | verifyButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)
void | yesButton_Click (Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e)

Private Member Functions

void | CompleteConfirmPinTask (bool accept)
void | CompletePasswordCredential (hstring username={}, hstring password={})
void | CompleteProvidePinTask (hstring pin={})
Windows::Foundation::IAsyncOperation
< Windows::Security::Credentials::PasswordCredential > 		GetPasswordCredentialFromUserAsync ()
Windows::Foundation::IAsyncOperation
< hstring > 		GetPinFromUserAsync ()
Windows::Devices::Enumeration::DevicePairingKinds | GetSelectedCeremonies ()
Windows::Foundation::IAsyncOperation
< bool > 		GetUserConfirmationAsync (hstring const &pin)
void | HidePairingPanel ()
void | OnDeviceListChanged (Windows::Devices::Enumeration::DeviceWatcher const &sender, hstring const &id)
fire_and_forget | PairingRequestedHandler (Windows::Devices::Enumeration::DeviceInformationCustomPairing const &sender, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs e)
void | ShowPairingPanel (hstring const &text, Windows::Devices::Enumeration::DevicePairingKinds pairingKind)
void | StartWatcher ()
void | StopWatcher ()
void | UpdatePairingButtons ()

Private Attributes

SimpleTaskCompletionSource< bool > | confirmPinTaskSrc
com_ptr< DeviceWatcherHelper > | deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher())
SimpleTaskCompletionSource
< Windows::Security::Credentials::PasswordCredential > 		providePasswordCredentialTaskSrc
SimpleTaskCompletionSource
< hstring > 		providePinTaskSrc
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::DeviceInformationDisplay > 		resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>()

Detailed Description

Definition at line 21 of file Scenario9_CustomPairDevice.h.

Constructor & Destructor Documentation

Scenario9_CustomPairDevice ( )

Definition at line 28 of file Scenario9_CustomPairDevice.cpp.

    {
        InitializeComponent();
        deviceWatcherHelper->DeviceChanged({ get_weak(), &Scenario9_CustomPairDevice::OnDeviceListChanged });
    }

Member Function Documentation

void CompleteConfirmPinTask ( bool accept ) [private]

Definition at line 371 of file Scenario9_CustomPairDevice.cpp.

    {
        confirmPinTaskSrc.SetResult(accept);
    }

void CompletePasswordCredential ( ) [private]
void CompleteProvidePinTask ( ) [private]
IAsyncOperation< PasswordCredential > GetPasswordCredentialFromUserAsync ( ) [private]

Definition at line 327 of file Scenario9_CustomPairDevice.cpp.

    {
        HidePairingPanel();
        CompletePasswordCredential(); // Abandon any previous pin request.

        ShowPairingPanel(
            L"Please enter the username and password",
            DevicePairingKinds::ProvidePasswordCredential);

        providePasswordCredentialTaskSrc = SimpleTaskCompletionSource<PasswordCredential>();

        return co_await providePasswordCredentialTaskSrc.Task();
    }

IAsyncOperation< hstring > GetPinFromUserAsync ( ) [private]

Definition at line 307 of file Scenario9_CustomPairDevice.cpp.

    {
        HidePairingPanel();
        CompleteProvidePinTask(); // Abandon any previous pin request.

        ShowPairingPanel(
            L"Please enter the PIN shown on the device you're pairing with",
            DevicePairingKinds::ProvidePin);

        providePinTaskSrc = SimpleTaskCompletionSource<hstring>();

        return co_await providePinTaskSrc.Task();
    }

DevicePairingKinds GetSelectedCeremonies ( ) [private]

Definition at line 403 of file Scenario9_CustomPairDevice.cpp.

    {
        DevicePairingKinds ceremonySelection = DevicePairingKinds::None;
        if (confirmOnlyOption().IsChecked().Value()) ceremonySelection |= DevicePairingKinds::ConfirmOnly;
        if (displayPinOption().IsChecked().Value()) ceremonySelection |= DevicePairingKinds::DisplayPin;
        if (providePinOption().IsChecked().Value()) ceremonySelection |= DevicePairingKinds::ProvidePin;
        if (confirmPinMatchOption().IsChecked().Value()) ceremonySelection |= DevicePairingKinds::ConfirmPinMatch;
        if (passwordCredentialOption().IsChecked().Value()) ceremonySelection |= DevicePairingKinds::ProvidePasswordCredential;
        return ceremonySelection;
    }

IAsyncOperation< bool > GetUserConfirmationAsync ( hstring const & pin ) [private]

Definition at line 356 of file Scenario9_CustomPairDevice.cpp.

    {
        HidePairingPanel();
        CompleteConfirmPinTask(false); // Abandon any previous request.

        ShowPairingPanel(
            L"Does the following PIN match the one shown on the device you are pairing?: " + pin,
            DevicePairingKinds::ConfirmPinMatch);

        confirmPinTaskSrc = SimpleTaskCompletionSource<bool>();

        return co_await confirmPinTaskSrc.Task();
    }

void HidePairingPanel ( ) [private]

Definition at line 301 of file Scenario9_CustomPairDevice.cpp.

    {
        pairingPanel().Visibility(Visibility::Collapsed);
        pairingTextBlock().Text({});
    }

void noButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void okButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void OnDeviceListChanged | ( | Windows::Devices::Enumeration::DeviceWatcher const & | sender,
 |  | hstring const & | id |
 | ) |  |  | [private]
void OnNavigatedFrom ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget PairButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget PairingRequestedHandler | ( | Windows::Devices::Enumeration::DeviceInformationCustomPairing const & | sender,
 |  | Windows::Devices::Enumeration::DevicePairingRequestedEventArgs | e |
 | ) |  |  | [private]
void ResultsListView_SelectionChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::Controls::SelectionChangedEventArgs const & | e
 | ) |  |
void ShowPairingPanel | ( | hstring const & | text,
 |  | Windows::Devices::Enumeration::DevicePairingKinds | pairingKind |
 | ) |  |  | [private]
void StartWatcher ( ) [private]

Definition at line 63 of file Scenario9_CustomPairDevice.cpp.

    {
        startWatcherButton().IsEnabled(false);
        resultCollection.Clear();

        // Get the device selector chosen by the UI then add additional constraints for devices that
        // can be paired or are already paired.
        DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(selectorComboBox().SelectedItem());
        hstring selector = L"(" + deviceSelectorInfo->Selector() + L") AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";

        DeviceWatcher deviceWatcher{ nullptr };
        if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
        {
            // Kind will be determined by the selector
            deviceWatcher = DeviceInformation::CreateWatcher(
                selector,
                nullptr // don't request additional properties for this sample
            );
        }
        else
        {
            // Kind is specified in the selector info
            deviceWatcher = DeviceInformation::CreateWatcher(
                selector,
                nullptr, // don't request additional properties for this sample
                deviceSelectorInfo->Kind());
        }

        rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
        deviceWatcherHelper->StartWatcher(deviceWatcher);
        stopWatcherButton().IsEnabled(true);
    }

void StartWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void StopWatcher ( ) [private]

Definition at line 96 of file Scenario9_CustomPairDevice.cpp.

    {
        stopWatcherButton().IsEnabled(false);

        deviceWatcherHelper->StopWatcher();

        startWatcherButton().IsEnabled(true);
    }

void StopWatcherButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
fire_and_forget UnpairButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void UpdatePairingButtons ( ) [private]

Definition at line 414 of file Scenario9_CustomPairDevice.cpp.

    {
        auto item = resultsListView().SelectedItem();
        DeviceInformationDisplay* deviceInfoDisp = FromInspectable<DeviceInformationDisplay>(item);
        if (deviceInfoDisp != nullptr &&
            deviceInfoDisp->DeviceInformation().Pairing().CanPair() &&
            !deviceInfoDisp->DeviceInformation().Pairing().IsPaired())
        {
            pairButton().IsEnabled(true);
        }
        else
        {
            pairButton().IsEnabled(false);
        }

        if (deviceInfoDisp != nullptr &&
            deviceInfoDisp->DeviceInformation().Pairing().IsPaired())
        {
            unpairButton().IsEnabled(true);
        }
        else
        {
            unpairButton().IsEnabled(false);
        }
    }

void verifyButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |
void yesButton_Click | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Xaml::RoutedEventArgs const & | e
 | ) |  |

Member Data Documentation

SimpleTaskCompletionSource<bool> confirmPinTaskSrc [private]

Definition at line 43 of file Scenario9_CustomPairDevice.h.

com_ptr<DeviceWatcherHelper> deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher()) [private]

Definition at line 41 of file Scenario9_CustomPairDevice.h.

SimpleTaskCompletionSource<Windows::Security::Credentials::PasswordCredential> providePasswordCredentialTaskSrc [private]

Definition at line 44 of file Scenario9_CustomPairDevice.h.

SimpleTaskCompletionSource<hstring> providePinTaskSrc [private]

Definition at line 42 of file Scenario9_CustomPairDevice.h.

Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>() [private]

Definition at line 40 of file Scenario9_CustomPairDevice.h.

The documentation for this struct was generated from the following files:
  • DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.h
  • DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: School Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • School
Public Member Functions | Private Attributes | Static Private Attributes

School Struct Reference

#include "School.h"

List of all members.

Public Member Functions

School ()
School (winrt::Windows::Data::Json::JsonObject const &jsonObject)
hstring | Id ()
void | Id (hstring const &value)
void | Name (hstring const &value)
hstring | Name ()
winrt::Windows::Data::Json::JsonObject | ToJsonObject ()
hstring | Type ()
void | Type (hstring const &value)

Private Attributes

hstring | m_id
hstring | m_name
hstring | m_type

Static Private Attributes

static constexpr wchar_t | idKey [] = "id"
static constexpr wchar_t | nameKey [] = "name"
static constexpr wchar_t | schoolKey [] = "school"
static constexpr wchar_t | typeKey [] = "type"

Detailed Description

Definition at line 17 of file School.h.

Constructor & Destructor Documentation

School ( )
School ( winrt::Windows::Data::Json::JsonObject const & jsonObject )

Definition at line 23 of file School.cpp.

    {
        JsonObject schoolObject = jsonObject.GetNamedObject(schoolKey, nullptr);
        if (schoolObject != nullptr)
        {
            m_id = schoolObject.GetNamedString(idKey, L"");
            m_name = schoolObject.GetNamedString(nameKey, L"");
        }
        m_type = jsonObject.GetNamedString(typeKey);
    }

Member Function Documentation

hstring Id ( ) [inline]

Definition at line 24 of file School.h.

{ return m_id; }

void Id ( hstring const & value ) [inline]

Definition at line 25 of file School.h.

{ m_id = value; }

hstring Name ( ) [inline]

Definition at line 26 of file School.h.

{ return m_name; }

void Name ( hstring const & value ) [inline]

Definition at line 27 of file School.h.

{ m_name = value; }

winrt::Windows::Data::Json::JsonObject ToJsonObject ( )

Definition at line 34 of file School.cpp.

    {
        JsonObject schoolObject;
        schoolObject.SetNamedValue(idKey, JsonValue::CreateStringValue(m_id));
        schoolObject.SetNamedValue(nameKey, JsonValue::CreateStringValue(m_name));

        JsonObject jsonObject;
        // JsonObject can also be treated as an IMap.
        jsonObject.Insert(schoolKey, schoolObject);
        jsonObject.Insert(typeKey, JsonValue::CreateStringValue(m_type));

        return jsonObject;
    }

void Type ( hstring const & value ) [inline]

Definition at line 29 of file School.h.

{ m_type = value; }

hstring Type ( ) [inline]

Definition at line 28 of file School.h.

{ return m_type; }

Member Data Documentation

constexpr wchar_t idKey[] = "id" [inline, static, private]

Definition at line 32 of file School.h.

hstring m_id [private]

Definition at line 37 of file School.h.

hstring m_name [private]

Definition at line 38 of file School.h.

hstring m_type [private]

Definition at line 39 of file School.h.

constexpr wchar_t nameKey[] = "name" [inline, static, private]

Definition at line 34 of file School.h.

constexpr wchar_t schoolKey[] = "school" [inline, static, private]

Definition at line 33 of file School.h.

constexpr wchar_t typeKey[] = "type" [inline, static, private]

Definition at line 35 of file School.h.

The documentation for this struct was generated from the following files:
  • Json/cppwinrt/School.h
  • Json/cppwinrt/School.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryAppWindowPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SecondaryAppWindowPage
Public Member Functions

SecondaryAppWindowPage Struct Reference

#include "SecondaryAppWindowPage.h"

List of all members.

Public Member Functions

SecondaryAppWindowPage ()

Detailed Description

Definition at line 18 of file SecondaryAppWindowPage.h.

Constructor & Destructor Documentation

SecondaryAppWindowPage ( )

Definition at line 22 of file SecondaryAppWindowPage.cpp.

    {
        InitializeComponent();
    }

The documentation for this struct was generated from the following files:
  • AppWindow/cppwinrt/SecondaryAppWindowPage.h
  • AppWindow/cppwinrt/SecondaryAppWindowPage.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryViewPage Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SecondaryViewPage
Public Member Functions | Private Member Functions | Private Attributes

SecondaryViewPage Struct Reference

#include "SecondaryViewPage.h"

List of all members.

Public Member Functions

SecondaryViewPage ()
void | ClearTitle_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | GoToMain_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | HandleProtocolLaunch (Windows::Foundation::Uri const &uri)
fire_and_forget | HideView_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | OnNavigatedTo (Windows::UI::Xaml::Navigation::NavigationEventArgs const &e)
fire_and_forget | ProtocolLaunch_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
void | SetTitle_Click (Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &)
fire_and_forget | SwitchAndAnimate (int32_t fromViewId)

Private Member Functions

Windows::UI::Xaml::Media::Animation::Storyboard | CreateEnterAnimation ()
fire_and_forget | SetTitle (hstring newTitle)
fire_and_forget | View_Released (SDKTemplate::ViewLifetimeControl const &sender, Windows::Foundation::IInspectable const &)

Private Attributes

event_token | m_releasedToken

Detailed Description

Definition at line 19 of file SecondaryViewPage.h.

Constructor & Destructor Documentation

SecondaryViewPage ( )

Definition at line 37 of file SecondaryViewPage.cpp.

    {
        InitializeComponent();
        m_enterAnimation = CreateEnterAnimation();
    }

Member Function Documentation

void ClearTitle_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
Storyboard CreateEnterAnimation ( ) [private]

Definition at line 196 of file SecondaryViewPage.cpp.

    {
        Storyboard enterAnimation;

        // Use the AnimationDescription object if available. Otherwise, return an empty storyboard (no animation).
        if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent(L"Windows.UI.Core.AnimationMetrics.AnimationDescription"))
        {
            Storyboard::SetTarget(enterAnimation, LayoutRoot());

            AnimationDescription ad(AnimationEffect::EnterPage, AnimationEffectTarget::Primary);
            for (unsigned int i = 0; i < LayoutRoot().Children().Size(); i++)
            {
                // Add a render transform to the existing one just for animations
                auto element = LayoutRoot().Children().GetAt(i);
                TransformGroup tg;
                tg.Children().Append(TranslateTransform());
                tg.Children().Append(element.RenderTransform());
                element.RenderTransform(tg);

                // Calculate the stagger for each animation. Note that this has a max
                TimeSpan delay = std::min(std::chrono::duration_cast<TimeSpan>(ad.StaggerDelay() * i * ad.StaggerDelayFactor()), ad.DelayLimit());

                for (auto description : ad.Animations())
                {
                    DoubleAnimationUsingKeyFrames animation;

                    // Start the animation at the right offset
                    SplineDoubleKeyFrame startSpline;
                    startSpline.KeyTime(KeyTimeHelper::FromTimeSpan(TimeSpan::zero()));
                    Storyboard::SetTarget(animation, element);

                    // Hold at that offset until the stagger delay is hit
                    SplineDoubleKeyFrame middleSpline;
                    middleSpline.KeyTime(KeyTimeHelper::FromTimeSpan(delay));

                    // Animation from delayed time to last time
                    SplineDoubleKeyFrame endSpline;
                    KeySpline endSplineKey;
                    endSplineKey.ControlPoint1(description.Control1());
                    endSplineKey.ControlPoint2(description.Control2());
                    endSpline.KeySpline(endSplineKey);
                    TimeSpan endKeyTime = description.Duration() + delay;
                    endSpline.KeyTime(KeyTimeHelper::FromTimeSpan(endKeyTime));

                    // Do the translation
                    if (description.Type() == PropertyAnimationType::Translation)
                    {
                        startSpline.Value(ANIMATION_TRANSLATION_START);
                        middleSpline.Value(ANIMATION_TRANSLATION_START);
                        endSpline.Value(ANIMATION_TRANSLATION_END);

                        Storyboard::SetTargetProperty(animation, L"(UIElement.RenderTransform).(TransformGroup.Children)[0].X");
                    }
                    // Opacity
                    else if (description.Type() == PropertyAnimationType::Opacity)
                    {
                        startSpline.Value(ANIMATION_OPACITY_START);
                        middleSpline.Value(ANIMATION_OPACITY_START);
                        endSpline.Value(ANIMATION_OPACITY_END);

                        Storyboard::SetTargetProperty(animation, L"Opacity");
                    }
                    else
                    {
                        throw hresult_invalid_argument(L"Encountered an unexpected animation type.");
                    }

                    // Put the final animation together
                    animation.KeyFrames().Append(startSpline);
                    animation.KeyFrames().Append(middleSpline);
                    animation.KeyFrames().Append(endSpline);
                    enterAnimation.Children().Append(animation);
                }
            }
        }

        return enterAnimation;
    }

fire_and_forget GoToMain_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void HandleProtocolLaunch ( Windows::Foundation::Uri const & uri )
fire_and_forget HideView_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
void OnNavigatedTo ( Windows::UI::Xaml::Navigation::NavigationEventArgs const & e )
fire_and_forget ProtocolLaunch_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SetTitle ( hstring newTitle ) [private]

Definition at line 90 of file SecondaryViewPage.cpp.

    {
        auto lifetime = get_strong();

        auto thisViewId = ApplicationView::GetForCurrentView().Id();
        ApplicationView::GetForCurrentView().Title(newTitle);
        m_thisViewControl.StartViewInUse();

        // The title contained in the ViewLifetimeControl object is bound to
        // UI elements on the main thread. So, updating the title
        // in this object must be done on the main thread
        co_await resume_foreground(SampleState::MainDispatcher);

        // We are now in the main window.

        // Setting the title on ApplicationView to blank will clear the title in
        // the system switcher. It would be good to still have a title in the app's UI.
        if (newTitle.empty())
        {
            newTitle = EMPTY_TITLE;
        }

        SampleState::UpdateTitle(newTitle, thisViewId);
        m_thisViewControl.StopViewInUse();
    }

void SetTitle_Click | ( | Windows::Foundation::IInspectable const & | ,
 |  | Windows::UI::Xaml::RoutedEventArgs const & |
 | ) |  |
fire_and_forget SwitchAndAnimate ( int32_t fromViewId )

Definition at line 51 of file SecondaryViewPage.cpp.

    {
        auto lifetime = get_strong();

        // This continues the flow from Scenario 3
        m_thisViewControl.StartViewInUse();

        // Before switching, make this view match the outgoing window
        // (go to a blank background)
        m_enterAnimation.Begin();
        m_enterAnimation.Pause();
        m_enterAnimation.Seek(TimeSpan::zero());

        // Bring this view onto screen. Since the two view are drawing
        // the same visual, the user will not be able to perceive the switch
        co_await ApplicationViewSwitcher::SwitchAsync(
            ApplicationView::GetForCurrentView().Id(),
            fromViewId,
            ApplicationViewSwitchingOptions::SkipAnimation);

        // Now that this window is on screen, animate in its contents
        m_enterAnimation.Begin();
        m_thisViewControl.StopViewInUse();
    }

fire_and_forget View_Released | ( | SDKTemplate::ViewLifetimeControl const & | sender,
 |  | Windows::Foundation::IInspectable const & |  |
 | ) |  |  | [private]

Member Data Documentation

event_token m_releasedToken [private]

Definition at line 34 of file SecondaryViewPage.h.

The documentation for this struct was generated from the following files:
  • MultipleViews/cppwinrt/SecondaryViewPage.h
  • MultipleViews/cppwinrt/SecondaryViewPage.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShowPackageFamilyName Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ShowPackageFamilyName
Public Member Functions

ShowPackageFamilyName Struct Reference

#include "ShowPackageFamilyName.h"

List of all members.

Public Member Functions

ShowPackageFamilyName ()

Detailed Description

Definition at line 18 of file ShowPackageFamilyName.h.

Constructor & Destructor Documentation

ShowPackageFamilyName ( )

Definition at line 21 of file ShowPackageFamilyName.cpp.

    {
        InitializeComponent();
        PackageFamilyName().Text(Package::Current().Id().FamilyName());
    }

The documentation for this struct was generated from the following files:
  • AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.h
  • AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.cpp
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SizePreferenceString Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SizePreferenceString
Public Member Functions | Private Attributes

SizePreferenceString Struct Reference

#include "SizePreferenceString.h"

List of all members.

Public Member Functions

SizePreferenceString (Windows::UI::ViewManagement::ViewSizePreference preference, hstring title)
Windows::UI::ViewManagement::ViewSizePreference | Preference ()
hstring | Title ()

Private Attributes

Windows::UI::ViewManagement::ViewSizePreference | m_preference
hstring | m_title

Detailed Description

Definition at line 7 of file SizePreferenceString.h.

Constructor & Destructor Documentation

SizePreferenceString | ( | Windows::UI::ViewManagement::ViewSizePreference | preference,
 |  | hstring | title |
 | ) |  |  | [inline]

Definition at line 9 of file SizePreferenceString.h.

            : m_preference(preference), m_title(title)
        {
        }

Member Function Documentation

Windows::UI::ViewManagement::ViewSizePreference Preference ( ) [inline]

Definition at line 19 of file SizePreferenceString.h.

        {
            return m_preference;
        }

hstring Title ( ) [inline]

Definition at line 14 of file SizePreferenceString.h.

        {
            return m_title;
        }

Member Data Documentation

Windows::UI::ViewManagement::ViewSizePreference m_preference [private]

Definition at line 26 of file SizePreferenceString.h.

hstring m_title [private]

Definition at line 25 of file SizePreferenceString.h.

The documentation for this struct was generated from the following file:
  • MultipleViews/cppwinrt/SizePreferenceString.h
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SlowInputStream Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SlowInputStream
Public Member Functions | Private Attributes

SlowInputStream Struct Reference

#include "SlowInputStream.h"

List of all members.

Public Member Functions

SlowInputStream (uint32_t length)
void | Close ()
Windows::Foundation::IAsyncOperationWithProgress
< Windows::Storage::Streams::IBuffer,
uint32_t > 		ReadAsync (Windows::Storage::Streams::IBuffer buffer, uint32_t count, Windows::Storage::Streams::InputStreamOptions options)

Private Attributes

uint32_t const | m_length
std::atomic< uint32_t > | m_position = 0

Detailed Description

Definition at line 16 of file SlowInputStream.h.

Constructor & Destructor Documentation

SlowInputStream ( uint32_t length ) [inline]

Definition at line 18 of file SlowInputStream.h.

: m_length(length) { }

Member Function Documentation

void Close ( ) [inline]

Definition at line 21 of file SlowInputStream.h.

{ }

Windows::Foundation::IAsyncOperationWithProgress<Windows::Storage::Streams::IBuffer, uint32_t> ReadAsync | ( | Windows::Storage::Streams::IBuffer | buffer,
 |  | uint32_t | count,
 |  | Windows::Storage::Streams::InputStreamOptions | options
 | ) |  |

Member Data Documentation

uint32_t const m_length [private]

Definition at line 24 of file SlowInputStream.h.

std::atomic<uint32_t> m_position = 0 [private]

Definition at line 25 of file SlowInputStream.h.

The documentation for this struct was generated from the following file:
  • HttpClient/cppwinrt/SlowInputStream.h
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCardListItem Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SmartCardListItem
Public Member Functions | Private Attributes

SmartCardListItem Struct Reference

#include "Scenario7_ListAllCards.h"

List of all members.

Public Member Functions

SmartCardListItem (hstring const &readerName, hstring const &cardName)
hstring | CardName ()
hstring | ReaderName ()

Private Attributes

hstring | m_cardName
hstring | m_readerName

Detailed Description

Definition at line 27 of file Scenario7_ListAllCards.h.

Constructor & Destructor Documentation

SmartCardListItem | ( | hstring const & | readerName,
 |  | hstring const & | cardName |
 | ) |  |  | [inline]

Definition at line 29 of file Scenario7_ListAllCards.h.

                                                                              :
            m_readerName(readerName),
            m_cardName(cardName)
        {
        }

Member Function Documentation

hstring CardName ( ) [inline]

Definition at line 40 of file Scenario7_ListAllCards.h.

        {
            return m_cardName;
        }

hstring ReaderName ( ) [inline]

Definition at line 35 of file Scenario7_ListAllCards.h.

        {
            return m_readerName;
        }

Member Data Documentation

hstring m_cardName [private]

Definition at line 47 of file Scenario7_ListAllCards.h.

hstring m_readerName [private]

Definition at line 46 of file Scenario7_ListAllCards.h.

The documentation for this struct was generated from the following file:
  • SmartCard/cppwinrt/Scenario7_ListAllCards.h
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SymbologyListEntry Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • SymbologyListEntry
Public Member Functions | Private Attributes

SymbologyListEntry Struct Reference

#include "SymbologyListEntry.h"

List of all members.

Public Member Functions

SymbologyListEntry (uint32_t symbologyId, bool symbologyEnabled=true)
uint32_t | Id ()
void | IsEnabled (bool enabled)
bool | IsEnabled ()
winrt::hstring | Name ()

Private Attributes

bool | m_enabled
uint32_t | m_id

Detailed Description

Definition at line 18 of file SymbologyListEntry.h.

Constructor & Destructor Documentation

SymbologyListEntry | ( | uint32_t | symbologyId,
 |  | bool | symbologyEnabled = true |
 | ) |  |  | [inline]

Definition at line 20 of file SymbologyListEntry.h.

                                                                               :
            m_id(symbologyId),
            m_enabled(symbologyEnabled)
        {
        }

Member Function Documentation

uint32_t Id ( ) [inline]

Definition at line 26 of file SymbologyListEntry.h.

        {
            return m_id;
        }

bool IsEnabled ( ) [inline]

Definition at line 31 of file SymbologyListEntry.h.

        {
            return m_enabled;
        }

void IsEnabled ( bool enabled ) [inline]

Definition at line 36 of file SymbologyListEntry.h.

        {
            m_enabled = enabled;
        }

winrt::hstring Name ( ) [inline]

Definition at line 41 of file SymbologyListEntry.h.

        {
            return winrt::Windows::Devices::PointOfService::BarcodeSymbologies::GetName(m_id);
        }

Member Data Documentation

bool m_enabled [private]

Definition at line 48 of file SymbologyListEntry.h.

uint32_t m_id [private]

Definition at line 47 of file SymbologyListEntry.h.

The documentation for this struct was generated from the following file:
  • BarcodeScanner/cppwinrt/SymbologyListEntry.h
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: User Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • User
Public Member Functions | Private Attributes | Static Private Attributes

User Struct Reference

#include "User.h"

List of all members.

Public Member Functions

User ()
User (hstring const &jsonString)
Windows::Foundation::Collections::IObservableVector
< SDKTemplate::School > 		Education ()
void | Id (hstring const &value)
hstring | Id ()
void | Name (hstring const &value)
hstring | Name ()
hstring | Phone ()
void | Phone (hstring const &value)
hstring | Stringify ()
double | Timezone ()
void | Timezone (double value)
void | Verified (bool value)
bool | Verified ()

Private Attributes

Windows::Foundation::Collections::IObservableVector
< winrt::SDKTemplate::School > 		m_education = single_threaded_observable_vector<SDKTemplate::School>()
hstring | m_id
hstring | m_name
hstring | m_phone
double | m_timezone = 0.0
bool | m_verified = false

Static Private Attributes

static constexpr wchar_t | educationKey [] = "education"
static constexpr wchar_t | idKey [] = "id"
static constexpr wchar_t | nameKey [] = "name"
static constexpr wchar_t | phoneKey [] = "phone"
static constexpr wchar_t | timezoneKey [] = "timezone"
static constexpr wchar_t | verifiedKey [] = "verified"

Detailed Description

Definition at line 22 of file User.h.

Constructor & Destructor Documentation

User ( )
User ( hstring const & jsonString )

Definition at line 21 of file User.cpp.

    {
        JsonObject jsonObject = JsonObject::Parse(jsonString);
        m_id = jsonObject.GetNamedString(idKey, L"");

        IJsonValue phoneJsonValue = jsonObject.GetNamedValue(phoneKey);
        if (phoneJsonValue.ValueType() == JsonValueType::Null)
        {
            m_phone = {};
        }
        else
        {
            m_phone = phoneJsonValue.GetString();
        }

        m_name = jsonObject.GetNamedString(nameKey, L"");
        m_timezone = jsonObject.GetNamedNumber(timezoneKey, 0.0);
        m_verified = jsonObject.GetNamedBoolean(verifiedKey, false);

        for (IJsonValue jsonValue : jsonObject.GetNamedArray(educationKey, {}))
        {
            m_education.Append(SDKTemplate::School(jsonValue.GetObject()));
        }
    }

Member Function Documentation

Windows::Foundation::Collections::IObservableVector<SDKTemplate::School> Education ( ) [inline]

Definition at line 33 of file User.h.

{ return m_education; }

void Id ( hstring const & value ) [inline]

Definition at line 28 of file User.h.

{ m_id = value; }

hstring Id ( ) [inline]

Definition at line 27 of file User.h.

{ return m_id; }

hstring Name ( ) [inline]

Definition at line 31 of file User.h.

{ return m_name; }

void Name ( hstring const & value ) [inline]

Definition at line 32 of file User.h.

{ m_name = value; }

void Phone ( hstring const & value ) [inline]

Definition at line 30 of file User.h.

{ m_phone = value; }

hstring Phone ( ) [inline]

Definition at line 29 of file User.h.

{ return m_phone; }

hstring Stringify ( )

Definition at line 46 of file User.cpp.

    {
        JsonObject jsonObject;

        jsonObject.SetNamedValue(idKey, JsonValue::CreateStringValue(m_id));

        // Treating a blank string as null
        if (m_phone.empty())
        {
            jsonObject.SetNamedValue(phoneKey, JsonValue::CreateNullValue());
        }
        else
        {
            jsonObject.SetNamedValue(phoneKey, JsonValue::CreateStringValue(m_phone));
        }

        jsonObject.SetNamedValue(nameKey, JsonValue::CreateStringValue(m_name));
        jsonObject.SetNamedValue(timezoneKey, JsonValue::CreateNumberValue(m_timezone));
        jsonObject.SetNamedValue(verifiedKey, JsonValue::CreateBooleanValue(m_verified));

        JsonArray jsonArray;
        for (SDKTemplate::School school : m_education)
        {
            jsonArray.Append(school.ToJsonObject());
        }

        // JsonObject can also be treated as an IMap.
        jsonObject.Insert(educationKey, jsonArray);

        return jsonObject.Stringify();
    }

double Timezone ( ) [inline]

Definition at line 34 of file User.h.

{ return m_timezone; }

void Timezone ( double value ) [inline]

Definition at line 35 of file User.h.

{ m_timezone = value; }

void Verified ( bool value ) [inline]

Definition at line 37 of file User.h.

{ m_verified = value; }

bool Verified ( ) [inline]

Definition at line 36 of file User.h.

{ return m_verified; }

Member Data Documentation

constexpr wchar_t educationKey[] = "education" [inline, static, private]

Definition at line 44 of file User.h.

constexpr wchar_t idKey[] = "id" [inline, static, private]

Definition at line 41 of file User.h.

Windows::Foundation::Collections::IObservableVector<winrt::SDKTemplate::School> m_education = single_threaded_observable_vector<SDKTemplate::School>() [private]

Definition at line 51 of file User.h.

hstring m_id [private]

Definition at line 48 of file User.h.

hstring m_name [private]

Definition at line 50 of file User.h.

hstring m_phone [private]

Definition at line 49 of file User.h.

double m_timezone = 0.0 [private]

Definition at line 52 of file User.h.

bool m_verified = false [private]

Definition at line 53 of file User.h.

constexpr wchar_t nameKey[] = "name" [inline, static, private]

Definition at line 43 of file User.h.

constexpr wchar_t phoneKey[] = "phone" [inline, static, private]

Definition at line 42 of file User.h.

constexpr wchar_t timezoneKey[] = "timezone" [inline, static, private]

Definition at line 45 of file User.h.

constexpr wchar_t verifiedKey[] = "verified" [inline, static, private]

Definition at line 46 of file User.h.

The documentation for this struct was generated from the following files:
  • Json/cppwinrt/User.h
  • Json/cppwinrt/User.cpp
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserViewModel Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • UserViewModel
Public Member Functions | Private Member Functions | Private Attributes

UserViewModel Struct Reference

#include "UserViewModel.h"

List of all members.

Public Member Functions

UserViewModel (hstring userId, hstring displayName)
hstring | DisplayName ()
void | DisplayName (hstring displayName)
void | PropertyChanged (event_token token)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
hstring | UserId ()
void | UserId (hstring userId)

Private Member Functions

void | RaisePropertyChanged (hstring propertyName)

Private Attributes

hstring | m_displayName
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged
hstring | m_userId

Detailed Description

Definition at line 18 of file UserViewModel.h.

Constructor & Destructor Documentation

UserViewModel | ( | hstring | userId,
 |  | hstring | displayName |
 | ) |  |  | [inline]

Definition at line 20 of file UserViewModel.h.

                                                           :
            m_userId(std::move(userId)),
            m_displayName(std::move(displayName))
        {
        }

Member Function Documentation

hstring DisplayName ( ) [inline]

Definition at line 37 of file UserViewModel.h.

        {
            return m_displayName;
        }

void DisplayName ( hstring displayName ) [inline]

Definition at line 42 of file UserViewModel.h.

        {
            m_displayName = std::move(displayName);
            RaisePropertyChanged(L"DisplayName");
        }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler ) [inline]

Definition at line 48 of file UserViewModel.h.

        {
            return m_propertyChanged.add(handler);
        }

void PropertyChanged ( event_token token ) [inline]

Definition at line 53 of file UserViewModel.h.

        {
            m_propertyChanged.remove(token);
        }

void RaisePropertyChanged ( hstring propertyName ) [inline, private]

Definition at line 59 of file UserViewModel.h.

        {
            m_propertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs(propertyName));
        }

hstring UserId ( ) [inline]

Definition at line 26 of file UserViewModel.h.

        {
            return m_userId;
        }

void UserId ( hstring userId ) [inline]

Definition at line 31 of file UserViewModel.h.

        {
            m_userId = std::move(userId);
            RaisePropertyChanged(L"UserId");
        }

Member Data Documentation

hstring m_displayName [private]

Definition at line 66 of file UserViewModel.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 67 of file UserViewModel.h.

hstring m_userId [private]

Definition at line 65 of file UserViewModel.h.

The documentation for this struct was generated from the following file:
  • UserInfo/cppwinrt/UserViewModel.h
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Utils Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • Utils
Public Member Functions | Static Public Member Functions

Utils Struct Reference

#include "SocketReaderWriter.h"

List of all members.

Public Member Functions

Utils ()

Static Public Member Functions

static bool | CanSendMessage (hstring const &message, Windows::Foundation::IInspectable const &connectedDevice)
static bool | IsNonEmptyString (hstring const &value)
static bool | IsNonNull (Windows::Foundation::IInspectable const &value)

Detailed Description

Definition at line 98 of file SocketReaderWriter.h.

Constructor & Destructor Documentation

Utils ( )

Member Function Documentation

static bool CanSendMessage | ( | hstring const & | message,
 |  | Windows::Foundation::IInspectable const & | connectedDevice |
 | ) |  |  | [inline, static]

Definition at line 102 of file SocketReaderWriter.h.

        {
            return !message.empty() && connectedDevice;
        }

static bool IsNonEmptyString ( hstring const & value ) [inline, static]

Definition at line 112 of file SocketReaderWriter.h.

        {
            return !value.empty();
        }

static bool IsNonNull ( Windows::Foundation::IInspectable const & value ) [inline, static]

Definition at line 107 of file SocketReaderWriter.h.

        {
            return value != nullptr;
        }

The documentation for this struct was generated from the following file:
  • WiFiDirect/cppwinrt/SocketReaderWriter.h
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ViewLifetimeControl Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • ViewLifetimeControl
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

ViewLifetimeControl Struct Reference

#include "ViewLifetimeControl.h"

List of all members.

Public Member Functions

ViewLifetimeControl (Windows::UI::Core::CoreWindow const &newWindow)
Windows::UI::Core::CoreDispatcher | Dispatcher ()
int32_t | Id ()
void | PropertyChanged (event_token const &token)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
event_token | Released (Windows::Foundation::TypedEventHandler< SDKTemplate::ViewLifetimeControl, Windows::Foundation::IInspectable > const &handler)
void | Released (event_token const &token)
int32_t | StartViewInUse ()
int32_t | StopViewInUse ()
void | Title (hstring const &value)
hstring | Title ()

Static Public Member Functions

static
SDKTemplate::ViewLifetimeControl 		CreateForCurrentView ()

Private Member Functions

void | FinalizeRelease ()
void | RegisterForEvents ()
void | UnregisterForEvents ()
void | ViewConsolidated (Windows::UI::ViewManagement::ApplicationView const &sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs const &e)

Private Attributes

event_token | m_consolidatedToken
event
< Windows::Foundation::TypedEventHandler
< SDKTemplate::ViewLifetimeControl,
Windows::Foundation::IInspectable > > 		m_internalReleased
std::mutex | m_mutex
event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged
int | m_refCount = 0
bool | m_released = false
hstring | m_title
int32_t | m_viewId
agile_ref
< Windows::UI::Core::CoreWindow > 		m_window

Detailed Description

Definition at line 18 of file ViewLifetimeControl.h.

Constructor & Destructor Documentation

ViewLifetimeControl ( Windows::UI::Core::CoreWindow const & newWindow )

Member Function Documentation

SDKTemplate::ViewLifetimeControl CreateForCurrentView ( ) [static]

Definition at line 106 of file ViewLifetimeControl.cpp.

    {
        return make<ViewLifetimeControl>(CoreWindow::GetForCurrentThread());
    }

Windows::UI::Core::CoreDispatcher Dispatcher ( ) [inline]

Definition at line 23 of file ViewLifetimeControl.h.

        {
            // This property never changes, so there's no need to lock
            return m_dispatcher;
        }

void FinalizeRelease ( ) [private]

Definition at line 83 of file ViewLifetimeControl.cpp.

    {
        bool justReleased = false;
        {
            auto lock = std::lock_guard(m_mutex);
            if (!m_released && m_refCount == 0)
            {
                m_released = true;
                justReleased = true;
            }
        } // lock

        // This assumes that released will never be made false after it
        // it has been set to true
        if (justReleased)
        {
            UnregisterForEvents();
            m_internalReleased(*this, nullptr);
        }
    }

int32_t Id ( ) [inline]

Definition at line 32 of file ViewLifetimeControl.h.

        {
            // This property never changes, so there's no need to lock
            return m_viewId;
        }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler )
void PropertyChanged ( event_token const & token )

Definition at line 198 of file ViewLifetimeControl.cpp.

    {
        return m_propertyChanged.remove(token);
    }

void RegisterForEvents ( ) [private]

Definition at line 58 of file ViewLifetimeControl.cpp.

    {
        // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
        // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
        // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
        m_consolidatedToken = ApplicationView::GetForCurrentView().Consolidated({ this, &ViewLifetimeControl::ViewConsolidated });
    }

void Released ( event_token const & token )

Definition at line 187 of file ViewLifetimeControl.cpp.

    {
        auto lock = std::lock_guard(m_mutex);
        return m_internalReleased.remove(token);
    }

event_token Released ( Windows::Foundation::TypedEventHandler< SDKTemplate::ViewLifetimeControl, Windows::Foundation::IInspectable > const & handler )
int32_t StartViewInUse ( )

Definition at line 133 of file ViewLifetimeControl.cpp.

    {
        auto lock = std::lock_guard(m_mutex);
        if (m_released)
        {
            throw hresult_error(RO_E_CLOSED, L"The view is being disposed");
        }
        return ++m_refCount;
    }

int32_t StopViewInUse ( )

Definition at line 146 of file ViewLifetimeControl.cpp.

    {
        auto lock = std::lock_guard(m_mutex);
        if (m_released)
        {
            throw hresult_error(RO_E_CLOSED, L"The view is being disposed");
        }
        if (m_refCount <= 0)
        {
            throw hresult_error(HRESULT_FROM_WIN32(ERROR_INVALID_STATE), L"Object was released too many times");
        }

        int refCountCopy = --m_refCount;
        if (refCountCopy == 0)
        {
            // If no other view is interacting with this view, and
            // the view isn't accessible to the user, it's appropriate
            // to close it
            //
            // Before actually closing the view, make sure there are no
            // other important events waiting in the queue (this low-priority item
            // will run after other events)
            m_dispatcher.RunAsync(CoreDispatcherPriority::Low, { this, &ViewLifetimeControl::FinalizeRelease });
        }

        return refCountCopy;
    }

void Title ( hstring const & value )

Definition at line 120 of file ViewLifetimeControl.cpp.

    {
        // This is expected to only be updated on the thread that this object is bound to
        // Hence, it's not necessary to lock
        if (m_title != value)
        {
            m_title = value;
            m_propertyChanged(*this, PropertyChangedEventArgs(L"Title"));
        }
    }

hstring Title ( )

Definition at line 113 of file ViewLifetimeControl.cpp.

    {
        // This is expected to only be updated on the thread that this object is bound to
        // Hence, it's not necessary to lock
        return m_title;
    }

void UnregisterForEvents ( ) [private]

Definition at line 67 of file ViewLifetimeControl.cpp.

    {
        ApplicationView::GetForCurrentView().Consolidated(m_consolidatedToken);
    }

void ViewConsolidated | ( | Windows::UI::ViewManagement::ApplicationView const & | sender,
 |  | Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs const & | e |
 | ) |  |  | [private]

Member Data Documentation

event_token m_consolidatedToken [private]

Definition at line 81 of file ViewLifetimeControl.h.

event<Windows::Foundation::TypedEventHandler<SDKTemplate::ViewLifetimeControl, Windows::Foundation::IInspectable> > m_internalReleased [private]

Definition at line 67 of file ViewLifetimeControl.h.

std::mutex m_mutex [private]

Definition at line 83 of file ViewLifetimeControl.h.

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 68 of file ViewLifetimeControl.h.

int m_refCount = 0 [private]

Definition at line 79 of file ViewLifetimeControl.h.

bool m_released = false [private]

Definition at line 72 of file ViewLifetimeControl.h.

hstring m_title [private]

Definition at line 65 of file ViewLifetimeControl.h.

int32_t m_viewId [private]

Definition at line 61 of file ViewLifetimeControl.h.

agile_ref<Windows::UI::Core::CoreWindow> m_window [private]

Definition at line 53 of file ViewLifetimeControl.h.

The documentation for this struct was generated from the following files:
  • MultipleViews/cppwinrt/ViewLifetimeControl.h
  • MultipleViews/cppwinrt/ViewLifetimeControl.cpp
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WordOverlay Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • implementation
  • WordOverlay
Public Member Functions | Private Member Functions | Private Attributes

WordOverlay Struct Reference

#include "WordOverlay.h"

List of all members.

Public Member Functions

WordOverlay (Windows::Media::Ocr::OcrWord const &ocrWord)
Windows::UI::Xaml::Controls::Border | CreateBorder (Windows::UI::Xaml::Style const &style, Windows::UI::Xaml::UIElement const &child=nullptr)
event_token | PropertyChanged (Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler)
void | PropertyChanged (event_token const &token) noexcept
void | Transform (Windows::UI::Xaml::Media::ScaleTransform const &scale)
double | WordHeight ()
Windows::UI::Xaml::Thickness | WordPosition ()
double | WordWidth ()

Private Member Functions

Windows::UI::Xaml::Data::Binding | CreateBinding (hstring const &propertyName)
void | OnPropertyChanged (hstring const &PropertyName)
void | UpdateProps (Windows::Foundation::Rect const &wordBoundingBox)

Private Attributes

event
< Windows::UI::Xaml::Data::PropertyChangedEventHandler > 		m_propertyChanged
Windows::Foundation::Rect | m_wordBoundingBox

Detailed Description

Definition at line 8 of file WordOverlay.h.

Constructor & Destructor Documentation

WordOverlay ( Windows::Media::Ocr::OcrWord const & ocrWord )

Member Function Documentation

Binding CreateBinding ( hstring const & propertyName ) [private]

Definition at line 52 of file WordOverlay.cpp.

    {
        Binding positionBinding;

        positionBinding.Path(PropertyPath{ propertyName });
        positionBinding.Source(*this);

        return positionBinding;
    }

Windows::UI::Xaml::Controls::Border CreateBorder | ( | Windows::UI::Xaml::Style const & | style,
 |  | Windows::UI::Xaml::UIElement const & | child = nullptr
 | ) |  |
void OnPropertyChanged ( hstring const & PropertyName ) [private]

Definition at line 71 of file WordOverlay.cpp.

    {
        m_propertyChanged(*this, PropertyChangedEventArgs(PropertyName));
    }

void PropertyChanged ( event_token const & token )

Definition at line 27 of file WordOverlay.cpp.

    {
        m_propertyChanged.remove(token);
    }

event_token PropertyChanged ( Windows::UI::Xaml::Data::PropertyChangedEventHandler const & handler )
void Transform ( Windows::UI::Xaml::Media::ScaleTransform const & scale )
void UpdateProps ( Windows::Foundation::Rect const & wordBoundingBox ) [private]
double WordHeight ( ) [inline]

Definition at line 13 of file WordOverlay.h.

{ return m_wordBoundingBox.Height; }

Windows::UI::Xaml::Thickness WordPosition ( ) [inline]

Definition at line 11 of file WordOverlay.h.

{ return { m_wordBoundingBox.X, m_wordBoundingBox.Y, 0, 0 };  }

double WordWidth ( ) [inline]

Definition at line 12 of file WordOverlay.h.

{ return m_wordBoundingBox.Width; }

Member Data Documentation

event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged [private]

Definition at line 28 of file WordOverlay.h.

Windows::Foundation::Rect m_wordBoundingBox [private]

Definition at line 26 of file WordOverlay.h.

The documentation for this struct was generated from the following files:
  • OCR/cppwinrt/WordOverlay.h
  • OCR/cppwinrt/WordOverlay.cpp
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArrayInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • LampArrayInfo
Public Member Functions | Public Attributes

LampArrayInfo Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

LampArrayInfo (winrt::hstring const &id, winrt::hstring const &displayName, winrt::Windows::Devices::Lights::LampArray const &lampArray)

Public Attributes

winrt::Windows::Devices::Lights::LampArray::AvailabilityChanged_revoker | availabilityChangedRevoker
winrt::hstring const | displayName
winrt::hstring const | id
winrt::Windows::Devices::Lights::LampArray
const 		lampArray

Detailed Description

Definition at line 22 of file SampleConfiguration.h.

Constructor & Destructor Documentation

LampArrayInfo | ( | winrt::hstring const & | id,
 |  | winrt::hstring const & | displayName,
 |  | winrt::Windows::Devices::Lights::LampArray const & | lampArray |
 | ) |  |  | [inline]

Definition at line 24 of file SampleConfiguration.h.

            : id(id), displayName(displayName), lampArray(lampArray)
        {
        }

Member Data Documentation

winrt::Windows::Devices::Lights::LampArray::AvailabilityChanged_revoker availabilityChangedRevoker

Definition at line 33 of file SampleConfiguration.h.

winrt::hstring const displayName

Definition at line 30 of file SampleConfiguration.h.

winrt::hstring const id

Definition at line 29 of file SampleConfiguration.h.

winrt::Windows::Devices::Lights::LampArray const lampArray

Definition at line 31 of file SampleConfiguration.h.

The documentation for this struct was generated from the following file:
  • LampArray/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingChannelScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • LoggingChannelScenario
Public Member Functions | Private Member Functions

LoggingChannelScenario Class Reference

#include "LoggingChannelScenario.h"

List of all members.

Public Member Functions

void | LogWithWin10Constructor ()
void | LogWithWin81Constructor ()

Private Member Functions

hstring | CollectExpensiveData ()
void | DemonstrateLogging (Windows::Foundation::Diagnostics::LoggingChannel const &channel)
void | DoSomething (Windows::Foundation::Diagnostics::ILoggingTarget const &logger)
void | OnLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel const &sender, Windows::Foundation::IInspectable const &e)

Detailed Description

Definition at line 16 of file LoggingChannelScenario.h.

Member Function Documentation

hstring CollectExpensiveData ( ) [private]

Definition at line 298 of file LoggingChannelScenario.cpp.

{
    return L"ExpensiveData";
}

void DemonstrateLogging ( Windows::Foundation::Diagnostics::LoggingChannel const & channel ) [private]
void DoSomething ( Windows::Foundation::Diagnostics::ILoggingTarget const & logger ) [private]
void LogWithWin10Constructor ( )

Construct a LoggingChannel with the Windows 10 constructor, then use the LoggingChannel for the scenario.

Also show the use cases for the two Windows 10 constructors.

Definition at line 40 of file LoggingChannelScenario.cpp.

{
    {
        // The 2-parameter constructor creates a channel with Windows 10 semantics.
        LoggingChannel channel(
            L"SampleProvider",
            nullptr); // null means use default options.

        // The Id is generated by hashing the string "SampleProvider".
        // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
        DemonstrateLogging(channel);
    }

    /*
    Demonstrate other (less-common) constructor scenarios:
    */

    {
        // This creates a channel with Windows 10 semantics and declared
        // membership in a provider group.
        GUID g = { 0x2e0582f3,0xd1b6,0x516a,0x9d,0xe3,0x9f,0xd7,0x9e,0xf9,0x52,0xf8 };
        LoggingChannel channel(
            L"SampleProvider",
            Windows::Foundation::Diagnostics::LoggingChannelOptions(g)); // Join a provider group
        // The Id is generated by hashing the string "SampleProvider".
        // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
    }

    {
        // This creates a channel with Windows 10 semantics and a specific
        // provider Id.
        GUID g = { 0x2e0582f3,0xd1b6,0x516a,0x9d,0xe3,0x9f,0xd7,0x9e,0xf9,0x52,0xf8 };
        LoggingChannel channel(
            L"SampleProvider",
            nullptr,
            g);
        // channel.Id == 2e0582f3-d1b6-516a-9de3-9fd79ef952f8
    }
}

void LogWithWin81Constructor ( )

Construct a LoggingChannel with the Windows 8.1 constructor, then use the LoggingChannel for the scenario.

See this sample's README for further discussion.

Definition at line 26 of file LoggingChannelScenario.cpp.

{
    // The 1-parameter constructor creates a channel with Windows 8.1 semantics.
    LoggingChannel channel(L"SampleProvider");
    DemonstrateLogging(channel);
}

void OnLoggingEnabled | ( | Windows::Foundation::Diagnostics::ILoggingChannel const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [private]
The documentation for this class was generated from the following files:
  • Logging/cppwinrt/LoggingChannelScenario.h
  • Logging/cppwinrt/LoggingChannelScenario.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingSessionScenario Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • LoggingSessionScenario
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

LoggingSessionScenario Class Reference

#include "LoggingSessionScenario.h"

List of all members.

Classes

struct | BusySetter

Public Member Functions

Windows::Foundation::IAsyncAction | DoScenarioAsync ()
bool | IsBusy () const noexcept
int | LogFileGeneratedCount () const noexcept
bool | LoggingEnabled () const noexcept
void | StatusChanged (winrt::event_token const &token) noexcept
winrt::event_token | StatusChanged (StatusChangedHandler const &handler)
bool | ToggleLoggingEnabledDisabled ()

Static Public Member Functions

static LoggingSessionScenario & | Instance ()

Private Member Functions

LoggingSessionScenario ()
~LoggingSessionScenario ()
void | OnAppResuming (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &args)
void | OnAppSuspending (Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e)
void | OnChannelLoggingEnabled (Windows::Foundation::Diagnostics::ILoggingChannel const &sender, Windows::Foundation::IInspectable const &args)
void | PrepareToSuspend ()
void | ResumeLoggingIfApplicable ()
void | StartLogging ()

Private Attributes

std::atomic< int > | _isBusy
bool | _isChannelEnabled = false
std::atomic< int > | _logFileGeneratedCount
event< StatusChangedHandler > | _statusChanged

Detailed Description

Definition at line 17 of file LoggingSessionScenario.h.

Constructor & Destructor Documentation

~LoggingSessionScenario ( ) [private]

Definition at line 29 of file LoggingSessionScenario.cpp.

{
}

LoggingSessionScenario ( ) [private]

Definition at line 33 of file LoggingSessionScenario.cpp.

{
    // Create the logging channel.
    // When an app logs messages to a channel, the messges will go
    // to any sessions which are consuming messages from the channel.
    _channel = LoggingChannel(DEFAULT_CHANNEL_NAME);

    // This sample listens to the channel's events so it can track
    // information about the channel's enablement status.
    _channel.LoggingEnabled({ this, &LoggingSessionScenario::OnChannelLoggingEnabled });

    // Attach event handlers for Suspend/Resume.
    Windows::UI::Xaml::Application app = Windows::UI::Xaml::Application::Current();
    app.Suspending({ this, &LoggingSessionScenario::OnAppSuspending });
    app.Resuming({ this, &LoggingSessionScenario::OnAppResuming });

    // If the app is being launched (not resumed), the following call will
    // activate logging if it had been active at the time of the last suspend.
    ResumeLoggingIfApplicable();
}

Member Function Documentation

IAsyncAction DoScenarioAsync ( )

Definition at line 115 of file LoggingSessionScenario.cpp.

{
    BusySetter busy(*this);

    std::wstring messageToLog;

    int messageIndex = 0; // Increments for each logging call.
    int lastDelayIndex = 0; // The messageIndex value at the last delay.
    int lastAppErrorIndex = 0; // The messageIndex value at the last simulated error.
    int startFileCount = LogFileGeneratedCount();

    const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;

    while (LogFileGeneratedCount() - startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
    {
        bool exceptionOccurred = false;
        try
        {
            // Since the channel is added to the session at level Warning,
            // the following is logged because it is logged at level LoggingLevel.Critical.
            messageToLog = L"Message=";
            messageToLog += std::to_wstring(++messageIndex);
            messageToLog +=
                L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
                L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
            _channel.LogMessage(messageToLog, LoggingLevel::Critical);

            // Since the channel is added to the session at level Warning,
            // the following is *not* logged because it is logged at LoggingLevel.Information.
            messageToLog = L"Message=";
            messageToLog += std::to_wstring(++messageIndex);
            messageToLog +=
                L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
                L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
            _channel.LogMessage(messageToLog, LoggingLevel::Information);

            int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
            messageToLog = L"Value #";
            messageToLog += std::to_wstring(++messageIndex);
            messageToLog += L':';
            messageToLog += std::to_wstring(value);
            _channel.LogMessage(messageToLog, LoggingLevel::Critical); // 'value' is logged as 14 byte wide character string.
            ++messageIndex;
            _channel.LogValuePair(L"Value", value, LoggingLevel::Critical); // 'value' is logged as a 4-byte integer.

            //
            // Every once in a while, simulate an application error
            // which causes the app to save the current snapshot
            // of logging events in memory to a disk ETL file.
            //

            if (messageIndex - lastAppErrorIndex >= 25000)
            {
                lastAppErrorIndex = messageIndex;

                // Before simulating an application error, demonstrate LoggingActivity.
                // A LoggingActivity outputs a pair of begin and end messages to the channel.
                // The first message is logged when the LoggingActivity is created. When
                // exiting the scope of the LoggingActivity, the second message will be logged.
                {
                    LoggingActivity activity(L"Add two numbers.", _channel,
                        LoggingLevel::Critical);
                    int oneNumber = 100;
                    int anotherNumber = 200;
                    int total = oneNumber + anotherNumber;
                    messageToLog = L"Message=";
                    messageToLog += std::to_wstring(++messageIndex);
                    messageToLog += L": The result of adding two numbers: ";
                    messageToLog += std::to_wstring(total);
                    _channel.LogMessage(messageToLog, LoggingLevel::Critical);
                } // The LoggingActivity instance will log the end message at this scope exit.

                // Simulate an application error.
                throw std::exception("Some bad app error occurred.");
            }

            //
            // Pause every once in a while to simulate application activity outside of logging.
            //

            if (messageIndex - lastDelayIndex >= 100)
            {
                lastDelayIndex = messageIndex;
                co_await resume_after(std::chrono::milliseconds(5));
            }
        }
        catch (std::exception const& e)
        {
            // Save in-memory logging buffer to a log file on error.

            hstring what;
            if (e.what() != nullptr)
            {
                what = to_hstring(e.what());
            }
            else
            {
                what = L"Unknown.";
            }

            // The session added the channel at level Warning. Log the message at
            // level Error which is above (more critical than) Warning, which
            // means it will actually get logged.
            _channel.LogMessage(L"Exception occurred: " + what, LoggingLevel::Error);

            // Since co_await is not supported within catch blocks, record the exception.
            // After the catch block, we'll notice that an exception occurred and save the log.
            exceptionOccurred = true;
        }

        if (exceptionOccurred)
        {
            // An exception occurred, so save the in-memory events to disk for analysis.

            // Create the app-defined folder under the app's local folder.
            // An app defines where/how it wants to store log files.
            // This sample uses OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME under
            // the app's local folder.
            StorageFolder ourSampleAppLogFolder =
                co_await ApplicationData::Current().LocalFolder().CreateFolderAsync(
                    OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
                    CreationCollisionOption::OpenIfExists);

            // Create a new log file name.
            std::wstring newLogFileName;
            newLogFileName += L"Log-";
            newLogFileName += GetTimeStamp();
            newLogFileName += L".etl";

            StorageFile logFile = co_await _session.SaveToFileAsync(ourSampleAppLogFolder, newLogFileName);
            ++_logFileGeneratedCount;
            _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGenerated, logFile.Path()));
        }
    }
}

LoggingSessionScenario & Instance ( ) [static]

Definition at line 56 of file LoggingSessionScenario.cpp.

{
    static LoggingSessionScenario instance;
    return instance;
}

bool IsBusy ( ) const

Definition at line 75 of file LoggingSessionScenario.cpp.

{
    return _isBusy != 0;
}

int LogFileGeneratedCount ( ) const

Definition at line 81 of file LoggingSessionScenario.cpp.

{
    return _logFileGeneratedCount;
}

bool LoggingEnabled ( ) const

Definition at line 87 of file LoggingSessionScenario.cpp.

{
    return _session != nullptr;
}

void OnAppResuming | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
void OnAppSuspending | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::ApplicationModel::SuspendingEventArgs const & | e |
 | ) |  |  | [private]
void OnChannelLoggingEnabled | ( | Windows::Foundation::Diagnostics::ILoggingChannel const & | sender,
 |  | Windows::Foundation::IInspectable const & | args |
 | ) |  |  | [private]
void PrepareToSuspend ( ) [private]

Definition at line 275 of file LoggingSessionScenario.cpp.

{
    _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(_session != nullptr));
}

void ResumeLoggingIfApplicable ( ) [private]

Definition at line 281 of file LoggingSessionScenario.cpp.

{
    bool loggingEnabled = unbox_value_or(_settings.TryLookup(LOGGING_ENABLED_SETTING_KEY_NAME), true);
    if (loggingEnabled)
    {
        StartLogging();
    }
}

void StartLogging ( ) [private]

Definition at line 252 of file LoggingSessionScenario.cpp.

{
    // If no session exists, create one.
    // NOTE: There are use cases where an application
    // may want to create only a channel for sessions outside
    // of the application itself. See MSDN for details. This
    // sample is the common scenario of an app logging events
    // which it wants to place in its own log file, so it creates
    // a session and channel as a pair. The channel is created
    // during construction of this LoggingSessionScenario class so
    // it already exists by the time this function is called.
    if (_session == nullptr)
    {
        _session = LoggingSession(DEFAULT_SESSION_NAME);
    }

    // This sample adds the channel at level "warning" to
    // demonstrate how messages logged at more verbose levels
    // are ignored by the session.
    _session.AddLoggingChannel(_channel, LoggingLevel::Warning);
}

event_token StatusChanged ( StatusChangedHandler const & handler )

Definition at line 63 of file LoggingSessionScenario.cpp.

{
    return _statusChanged.add(handler);
}

void StatusChanged ( winrt::event_token const & token )
bool ToggleLoggingEnabledDisabled ( )

Definition at line 93 of file LoggingSessionScenario.cpp.

{
    BusySetter busy(*this);

    if (_session != nullptr)
    {
        _session.Close();
        _session = nullptr;
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(false));
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, false));
        return false;
    }
    else
    {
        StartLogging();
        _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(true));
        _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, true));
        return true;
    }
}

Member Data Documentation

std::atomic<int> _isBusy [private]

Definition at line 88 of file LoggingSessionScenario.h.

bool _isChannelEnabled = false [private]

Definition at line 90 of file LoggingSessionScenario.h.

std::atomic<int> _logFileGeneratedCount [private]

Definition at line 84 of file LoggingSessionScenario.h.

event<StatusChangedHandler> _statusChanged [private]

Definition at line 91 of file LoggingSessionScenario.h.

The documentation for this class was generated from the following files:
  • Logging/cppwinrt/LoggingSessionScenario.h
  • Logging/cppwinrt/LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LoggingSessionScenario::BusySetter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • LoggingSessionScenario
  • LoggingSessionScenario::BusySetter
Public Member Functions | Public Attributes

LoggingSessionScenario::BusySetter Struct Reference

List of all members.

Public Member Functions

BusySetter (LoggingSessionScenario &scenario)
~BusySetter ()

Public Attributes

LoggingSessionScenario & _scenario

Detailed Description

Definition at line 77 of file LoggingSessionScenario.h.

Constructor & Destructor Documentation

~BusySetter ( )

Definition at line 323 of file LoggingSessionScenario.cpp.

{
    if (0 == --_scenario._isBusy)
    {
        _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
    }
}

BusySetter ( LoggingSessionScenario & scenario ) [explicit]

Definition at line 331 of file LoggingSessionScenario.cpp.

    : _scenario(scenario)
{
    if (1 == ++_scenario._isBusy)
    {
        _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
    }
}

Member Data Documentation

LoggingSessionScenario& _scenario

Definition at line 81 of file LoggingSessionScenario.h.

The documentation for this struct was generated from the following files:
  • Logging/cppwinrt/LoggingSessionScenario.h
  • Logging/cppwinrt/LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaFoundationInitializer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • MediaFoundationInitializer
Public Member Functions

MediaFoundationInitializer Struct Reference

#include "Common.h"

Inherited by Scenario2 [private], Scenario3 [private], and Scenario4 [private].

List of all members.

Public Member Functions

MediaFoundationInitializer ()
~MediaFoundationInitializer ()

Detailed Description

Definition at line 29 of file Common.h.

Constructor & Destructor Documentation

MediaFoundationInitializer ( ) [inline]

Definition at line 31 of file Common.h.

        {
            // Initialize MF
            check_hresult(MFStartup(MF_VERSION, MFSTARTUP_LITE));
        }

~MediaFoundationInitializer ( ) [inline]

Definition at line 37 of file Common.h.

        {
            MFShutdown();
        }

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MFSampleGenerator Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • MFSampleGenerator
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

MFSampleGenerator Struct Reference

#include "MFSampleGenerator.h"

List of all members.

Public Types

enum | ReaderState { Stopped, PreRoll, Playing, EndOfStream }

Public Member Functions

MFSampleGenerator ()
~MFSampleGenerator ()
bool | FillSampleBuffer (array_view< uint8_t > buffer, uint32_t *cbWritten)
void | Initialize (Windows::Storage::Streams::IRandomAccessStream const &stream, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx)
bool | IsEOF ()
void | Shutdown ()
void | StartSource ()
STDMETHODIMP_ (HRESULT) OnReadSample(HRESULT error
STDMETHODIMP_ (HRESULT) OnFlush(_In_ DWORD streamIndex)
STDMETHODIMP_ (HRESULT) OnEvent(_In_ DWORD streamIndex
void | StopSource ()

Public Attributes

_In_ IMFMediaEvent * | event
DWORD DWORD LONGLONG IMFSample * | sample
DWORD DWORD | streamFlags
DWORD | streamIndex
DWORD DWORD LONGLONG | timestamp

Private Member Functions

void | AddSamplesToQueue (IMFSample *MFSample)
bool | IsPreRollFilled ()

Static Private Member Functions

static com_ptr< IMFMediaType > | ConfigureStreams (com_ptr< IMFSourceReader > const &reader, WAVEFORMATEX *wfx)
static com_ptr< IMFMediaType > | CreateAudioType (WAVEFORMATEX *wfx)

Private Attributes

com_ptr< IMFMediaType > | m_audioMediaType
uint32_t | m_bytesPerPeriod
uint32_t | m_bytesPerSecond = 0
bool | m_isInitialized = false
ReaderState | m_readerState = ReaderState::Stopped
std::forward_list< RenderBuffer > | m_sampleQueue
std::forward_list
< RenderBuffer >::iterator 		m_sampleQueueTail = m_sampleQueue.before_begin()
com_ptr< IMFSourceReader > | m_sourceReader

Detailed Description

Definition at line 17 of file MFSampleGenerator.h.

Member Enumeration Documentation

enum ReaderState
Enumerator:
Stopped
PreRoll
Playing
EndOfStream

Definition at line 19 of file MFSampleGenerator.h.

        {
            Stopped,
            PreRoll,
            Playing,
            EndOfStream
        };

Constructor & Destructor Documentation

MFSampleGenerator ( )
~MFSampleGenerator ( )

Member Function Documentation

void AddSamplesToQueue ( IMFSample * MFSample ) [private]

Definition at line 308 of file MFSampleGenerator.cpp.

    {
        com_ptr<IMFMediaBuffer> mediaBuffer;

        // Since we are storing the raw byte data, convert this to a single buffer
        check_hresult(sample->ConvertToContiguousBuffer(mediaBuffer.put()));

        // Lock the sample
        BYTE* audioData = nullptr;
        DWORD cbAudioData = 0;
        check_hresult(mediaBuffer->Lock(&audioData, NULL, &cbAudioData));

        // Make sure we unlock the buffer.
        auto unlock = scope_exit([&] { mediaBuffer->Unlock(); });

        DWORD cbBytesCopied = 0;

        // First fill up any partial buffers from the previous sample
        if ((m_sampleQueueTail != m_sampleQueue.before_begin()) &&
            (m_sampleQueueTail->BytesFilled < m_sampleQueueTail->BufferSize))
        {
            RenderBuffer& PartialBuffer = *m_sampleQueueTail;

            DWORD cbBytesRemaining = PartialBuffer.BufferSize - PartialBuffer.BytesFilled;
            DWORD cbBytesToCopy = (std::min)(cbAudioData, cbBytesRemaining);

            CopyMemory(PartialBuffer.Buffer.get() + PartialBuffer.BytesFilled, audioData, cbBytesToCopy);

            PartialBuffer.BytesFilled += cbBytesToCopy;
            cbBytesCopied += cbBytesToCopy;
        }

        // Create buffers for the remainder of the samples
        while (cbBytesCopied < cbAudioData)
        {
            m_sampleQueueTail = m_sampleQueue.emplace_after(m_sampleQueueTail, m_bytesPerPeriod);
            RenderBuffer& SampleBuffer = *m_sampleQueueTail;

            DWORD cbBytesRemaining = cbAudioData - cbBytesCopied;
            DWORD cbBytesToCopy = (std::min)(static_cast<DWORD>(SampleBuffer.BufferSize), cbBytesRemaining);

            SampleBuffer.BytesFilled = 0;

            ZeroMemory(SampleBuffer.Buffer.get(), m_bytesPerPeriod);
            CopyMemory(SampleBuffer.Buffer.get(), audioData + cbBytesCopied, cbBytesToCopy);

            SampleBuffer.BytesFilled += cbBytesToCopy;
            cbBytesCopied += cbBytesToCopy;
        }
    }

com_ptr< IMFMediaType > ConfigureStreams | ( | com_ptr< IMFSourceReader > const & | reader,
 |  | WAVEFORMATEX * | wfx |
 | ) |  |  | [static, private]

Definition at line 115 of file MFSampleGenerator.cpp.

    {
        // Disable all streams
        check_hresult(reader->SetStreamSelection((DWORD)MF_SOURCE_READER_ALL_STREAMS, false));

        // Enable first audio stream
        check_hresult(reader->SetStreamSelection((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, true));

        com_ptr<IMFMediaType> partialMediaType = CreateAudioType(wfx);

        // Set type on source reader so necessary converters / decoders will be added
        check_hresult(reader->SetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, nullptr, partialMediaType.get()));

        // Verify the media type on stream
        com_ptr<IMFMediaType> uncompressedMediaType;
        check_hresult(reader->GetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, uncompressedMediaType.put()));

        unique_cotaskmem_ptr<WAVEFORMATEX> createdWfx;
        UINT32 cbFormat = 0;
        check_hresult(MFCreateWaveFormatExFromMFMediaType(uncompressedMediaType.get(), createdWfx.put(), &cbFormat));

        return uncompressedMediaType;
    }

com_ptr< IMFMediaType > CreateAudioType ( WAVEFORMATEX * wfx ) [static, private]

Definition at line 144 of file MFSampleGenerator.cpp.

    {
        com_ptr<IMFMediaType> mediaType;

        // Create a partial media type for our mix format (PCM or IEEE Float)
        check_hresult(MFCreateMediaType(mediaType.put()));

        // Set media type attributes
        check_hresult(mediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio));

        switch (GetRenderSampleType(wfx))
        {
        case RenderSampleType::Pcm16Bit:
        case RenderSampleType::Pcm24In32Bit:
            check_hresult(mediaType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
            break;
        case RenderSampleType::Float:
            check_hresult(mediaType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_Float));
            break;
        default:
            throw hresult_error(E_UNEXPECTED);
        }

        check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, wfx->nChannels));
        check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, wfx->nSamplesPerSec));
        check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, wfx->nBlockAlign));
        check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, wfx->nAvgBytesPerSec));
        check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, wfx->wBitsPerSample));
        check_hresult(mediaType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, true));

        return mediaType;
    }

bool FillSampleBuffer | ( | array_view< uint8_t > | buffer,
 |  | uint32_t * | cbWritten
 | ) |  |

Definition at line 253 of file MFSampleGenerator.cpp.

    {
        *cbWritten = 0;

        if (!m_isInitialized)
        {
            throw hresult_error(E_UNEXPECTED);
        }

        // Not going to return any data here while in a pre-roll state.
        if (m_readerState == ReaderState::PreRoll)
        {
            return true;
        }

        if (m_sampleQueue.empty())
        {
            if (m_readerState == ReaderState::EndOfStream)
            {
                // We are EOS, should be set from OnReadSample() and the client should check for EOS before
                // calling FillSampleBuffer()
                return false;
            }
            else
            {
                // There shouldn't be a situation where we get here unless the reader has
                // somehow gotten into the wrong state
                throw hresult_error(E_FAIL);
            }
        }
        else
        {
            RenderBuffer& sampleBuffer = m_sampleQueue.front();

            if (sampleBuffer.BufferSize > buffer.size())
            {
                // We don't have enough data in the client audio buffer this pass
                // Do nothing and wait for the next sample period
            }
            else
            {
                CopyMemory(buffer.data(), sampleBuffer.Buffer.get(), sampleBuffer.BufferSize);

                *cbWritten = sampleBuffer.BufferSize;
                m_sampleQueue.pop_front();
            }
        }
        return true;
    }

void Initialize | ( | Windows::Storage::Streams::IRandomAccessStream const & | stream,
 |  | UINT32 | FramesPerPeriod,
 |  | WAVEFORMATEX * | wfx
 | ) |  |
bool IsEOF ( ) [inline]

Definition at line 43 of file MFSampleGenerator.h.

        {
            return m_sampleQueue.empty() && m_readerState == ReaderState::EndOfStream;
        }

bool IsPreRollFilled ( ) [private]

Definition at line 364 of file MFSampleGenerator.cpp.

    {
        DWORD totalBytes = 0;

        for (RenderBuffer& sampleBuffer : m_sampleQueue)
        {
            totalBytes += sampleBuffer.BytesFilled;

            if (totalBytes >= m_bytesPerSecond * PREROLL_DURATION_SEC)
            {
                return true;
            }
        }

        return false;
    }

void Shutdown ( )

Definition at line 23 of file MFSampleGenerator.cpp.

    {
        if (m_isInitialized)
        {
            m_audioMediaType = nullptr;
            m_sourceReader = nullptr;

            m_sampleQueue.clear();

            m_isInitialized = false;
        }
    }

void StartSource ( )

Definition at line 41 of file MFSampleGenerator.cpp.

    {
        if (!m_isInitialized)
        {
            throw hresult_illegal_state_change();
        }

        // We can be in EOS if this is a resume from pause
        if ((m_readerState == ReaderState::PreRoll) ||
            (m_readerState == ReaderState::Playing) ||
            (m_readerState == ReaderState::EndOfStream))
            return;

        // This will start the source reader and asynchronously call OnReadSample
        check_hresult(m_sourceReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, nullptr, nullptr, nullptr, nullptr));
        m_readerState = ReaderState::PreRoll;
    }

STDMETHODIMP_ ( HRESULT )
STDMETHODIMP_ ( HRESULT )
STDMETHODIMP_ ( HRESULT )
void StopSource ( )

Definition at line 64 of file MFSampleGenerator.cpp.

    {
        // We only really need this if Source is still reading samples, otherwise
        // we should be in an EndOfStream state and parsing existing samples in the queue
        m_readerState = ReaderState::Stopped;
    }

Member Data Documentation

_In_ IMFMediaEvent* event

Definition at line 31 of file MFSampleGenerator.h.

com_ptr<IMFMediaType> m_audioMediaType [private]

Definition at line 60 of file MFSampleGenerator.h.

uint32_t m_bytesPerPeriod [private]

Definition at line 55 of file MFSampleGenerator.h.

uint32_t m_bytesPerSecond = 0 [private]

Definition at line 56 of file MFSampleGenerator.h.

bool m_isInitialized = false [private]

Definition at line 57 of file MFSampleGenerator.h.

ReaderState m_readerState = ReaderState::Stopped [private]

Definition at line 61 of file MFSampleGenerator.h.

std::forward_list<RenderBuffer> m_sampleQueue [private]

Definition at line 63 of file MFSampleGenerator.h.

std::forward_list<RenderBuffer>::iterator m_sampleQueueTail = m_sampleQueue.before_begin() [private]

Definition at line 64 of file MFSampleGenerator.h.

com_ptr<IMFSourceReader> m_sourceReader [private]

Definition at line 59 of file MFSampleGenerator.h.

DWORD DWORD LONGLONG IMFSample* sample

Definition at line 33 of file MFSampleGenerator.h.

DWORD DWORD streamFlags

Definition at line 33 of file MFSampleGenerator.h.

DWORD streamIndex

Definition at line 33 of file MFSampleGenerator.h.

DWORD DWORD LONGLONG timestamp

Definition at line 33 of file MFSampleGenerator.h.

The documentation for this struct was generated from the following files:
  • WindowsAudioSession/cppwinrt/MFSampleGenerator.h
  • WindowsAudioSession/cppwinrt/MFSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresentationFormats Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • PresentationFormats
Public Types | Static Public Attributes

PresentationFormats Struct Reference

#include "PresentationFormats.h"

List of all members.

Public Types

enum | NamespaceId { BluetoothSigAssignedNumber = 1, ReservedForFutureUse }
enum Units {
Unitless = 0x2700, LengthMetre = 0x2701, MassKilogram = 0x2702, TimeSecond = 0x2703,
ElectricCurrentAmpere = 0x2704, ThermodynamicTemperatureKelvin = 0x2705, AmountOfSubstanceMole = 0x2706, LuminousIntensityCandela = 0x2707,
AreaSquareMetres = 0x2710, VolumeCubicMetres = 0x2711, VelocityMetresPerSecond = 0x2712, AccelerationMetresPerSecondSquared = 0x2713,
WaveNumberReciprocalMetre = 0x2714, DensityKilogramperCubicMetre = 0x2715, SurfaceDensityKilogramPerSquareMetre = 0x2716, SpecificVolumeCubicMetrePerKilogram = 0x2717,
CurrentDensityAmperePerSquareMetre = 0x2718, MagneticFieldStrengthAmperePerMetre = 0x2719, AmountConcentrationMolePerCubicMetre = 0x271A, MassConcentrationKilogramPerCubicMetre = 0x271B,
LuminanceCandelaPerSquareMetre = 0x271C, RefractiveIndex = 0x271D, RelativePermeability = 0x271E, PlaneAngleRadian = 0x2720,
SolidAngleSteradian = 0x2721, FrequencyHertz = 0x2722, ForceNewton = 0x2723, PressurePascal = 0x2724,
EnergyJoule = 0x2725, PowerWatt = 0x2726, ElectricChargeCoulomb = 0x2727, ElectricPotentialDifferenceVolt = 0x2728,
CapacitanceFarad = 0x2729, ElectricResistanceOhm = 0x272A, ElectricConductanceSiemens = 0x272B, MagneticFluxWeber = 0x272C,
MagneticFluxDensityTesla = 0x272D, InductanceHenry = 0x272E, CelsiusTemperatureDegreeCelsius = 0x272F, LuminousFluxLumen = 0x2730,
IlluminanceLux = 0x2731, ActivityReferredToARadioNuclideBecquerel = 0x2732, AbsorbedDoseGray = 0x2733, DoseEquivalentSievert = 0x2734,
CatalyticActivityKatal = 0x2735, DynamicViscosityPascalSecond = 0x2740, MomentOfForceNewtonMetre = 0x2741, SurfaceTensionNewtonPerMetre = 0x2742,
AngularVelocityRadianPerSecond = 0x2743, AngularAccelerationRadianPerSecondSquared = 0x2744, HeatFluxDensityWattPerSquareMetre = 0x2745, HeatCapacityJoulePerKelvin = 0x2746,
SpecificHeatCapacityJoulePerKilogramKelvin = 0x2747, SpecificEnergyJoulePerKilogram = 0x2748, ThermalConductivityWattPerMetreKelvin = 0x2749, EnergyDensityJoulePerCubicMetre = 0x274A,
ElectricfieldstrengthVoltPerMetre = 0x274B, ElectricchargeDensityCoulombPerCubicMetre = 0x274C, SurfacechargeDensityCoulombPerSquareMetre = 0x274D, ElectricFluxDensityCoulombPerSquareMetre = 0x274E,
PermittivityFaradPerMetre = 0x274F, PermeabilityHenryPerMetre = 0x2750, MolarEnergyJoulePermole = 0x2751, MolarentropyJoulePermoleKelvin = 0x2752,
ExposureCoulombPerKilogram = 0x2753, AbsorbeddoserateGrayPerSecond = 0x2754, RadiantintensityWattPerSteradian = 0x2755, RadianceWattPerSquareMetreSteradian = 0x2756,
CatalyticActivityConcentrationKatalPerCubicMetre = 0x2757, TimeMinute = 0x2760, TimeHour = 0x2761, TimeDay = 0x2762,
PlaneAngleDegree = 0x2763, PlaneAngleMinute = 0x2764, PlaneAngleSecond = 0x2765, AreaHectare = 0x2766,
VolumeLitre = 0x2767, MassTonne = 0x2768, PressureBar = 0x2780, PressureMilliMetreofmercury = 0x2781,
LengthAngstrom = 0x2782, LengthNauticalMile = 0x2783, AreaBarn = 0x2784, VelocityKnot = 0x2785,
LogarithmicRadioQuantityNeper = 0x2786, LogarithmicRadioQuantityBel = 0x2787, LengthYard = 0x27A0, LengthParsec = 0x27A1,
LengthInch = 0x27A2, LengthFoot = 0x27A3, LengthMile = 0x27A4, PressurePoundForcePerSquareinch = 0x27A5,
VelocityKiloMetrePerHour = 0x27A6, VelocityMilePerHour = 0x27A7, AngularVelocityRevolutionPerminute = 0x27A8, EnergyGramcalorie = 0x27A9,
EnergyKilogramcalorie = 0x27AA, EnergyKiloWattHour = 0x27AB, ThermodynamicTemperatureDegreeFahrenheit = 0x27AC, Percentage = 0x27AD,
PerMille = 0x27AE, PeriodBeatsPerMinute = 0x27AF, ElectricchargeAmpereHours = 0x27B0, MassDensityMilligramPerdeciLitre = 0x27B1,
MassDensityMillimolePerLitre = 0x27B2, TimeYear = 0x27B3, TimeMonth = 0x27B4, ConcentrationCountPerCubicMetre = 0x27B5,
IrradianceWattPerSquareMetre = 0x27B6, MilliliterPerKilogramPerminute = 0x27B7, MassPound = 0x27B8
}

Static Public Attributes

static constexpr uint16_t | Description = 0x0000
static constexpr int | Exponent = 0

Detailed Description

Definition at line 17 of file PresentationFormats.h.

Member Enumeration Documentation

enum NamespaceId

The Name Space field is used to identify the organization that is responsible for defining the enumerations for the description field.

Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml

Enumerator:
BluetoothSigAssignedNumber
ReservedForFutureUse

Definition at line 144 of file PresentationFormats.h.

                               : uint8_t
        {
            BluetoothSigAssignedNumber = 1,
            ReservedForFutureUse,
        };

enum Units

Units are established international standards for the measurement of physical quantities.

Please refer https://www.bluetooth.com/specifications/assigned-numbers/units

Enumerator:
Unitless
LengthMetre
MassKilogram
TimeSecond
ElectricCurrentAmpere
ThermodynamicTemperatureKelvin
AmountOfSubstanceMole
LuminousIntensityCandela
AreaSquareMetres
VolumeCubicMetres
VelocityMetresPerSecond
AccelerationMetresPerSecondSquared
WaveNumberReciprocalMetre
DensityKilogramperCubicMetre
SurfaceDensityKilogramPerSquareMetre
SpecificVolumeCubicMetrePerKilogram
CurrentDensityAmperePerSquareMetre
MagneticFieldStrengthAmperePerMetre
AmountConcentrationMolePerCubicMetre
MassConcentrationKilogramPerCubicMetre
LuminanceCandelaPerSquareMetre
RefractiveIndex
RelativePermeability
PlaneAngleRadian
SolidAngleSteradian
FrequencyHertz
ForceNewton
PressurePascal
EnergyJoule
PowerWatt
ElectricChargeCoulomb
ElectricPotentialDifferenceVolt
CapacitanceFarad
ElectricResistanceOhm
ElectricConductanceSiemens
MagneticFluxWeber
MagneticFluxDensityTesla
InductanceHenry
CelsiusTemperatureDegreeCelsius
LuminousFluxLumen
IlluminanceLux
ActivityReferredToARadioNuclideBecquerel
AbsorbedDoseGray
DoseEquivalentSievert
CatalyticActivityKatal
DynamicViscosityPascalSecond
MomentOfForceNewtonMetre
SurfaceTensionNewtonPerMetre
AngularVelocityRadianPerSecond
AngularAccelerationRadianPerSecondSquared
HeatFluxDensityWattPerSquareMetre
HeatCapacityJoulePerKelvin
SpecificHeatCapacityJoulePerKilogramKelvin
SpecificEnergyJoulePerKilogram
ThermalConductivityWattPerMetreKelvin
EnergyDensityJoulePerCubicMetre
ElectricfieldstrengthVoltPerMetre
ElectricchargeDensityCoulombPerCubicMetre
SurfacechargeDensityCoulombPerSquareMetre
ElectricFluxDensityCoulombPerSquareMetre
PermittivityFaradPerMetre
PermeabilityHenryPerMetre
MolarEnergyJoulePermole
MolarentropyJoulePermoleKelvin
ExposureCoulombPerKilogram
AbsorbeddoserateGrayPerSecond
RadiantintensityWattPerSteradian
RadianceWattPerSquareMetreSteradian
CatalyticActivityConcentrationKatalPerCubicMetre
TimeMinute
TimeHour
TimeDay
PlaneAngleDegree
PlaneAngleMinute
PlaneAngleSecond
AreaHectare
VolumeLitre
MassTonne
PressureBar
PressureMilliMetreofmercury
LengthAngstrom
LengthNauticalMile
AreaBarn
VelocityKnot
LogarithmicRadioQuantityNeper
LogarithmicRadioQuantityBel
LengthYard
LengthParsec
LengthInch
LengthFoot
LengthMile
PressurePoundForcePerSquareinch
VelocityKiloMetrePerHour
VelocityMilePerHour
AngularVelocityRevolutionPerminute
EnergyGramcalorie
EnergyKilogramcalorie
EnergyKiloWattHour
ThermodynamicTemperatureDegreeFahrenheit
Percentage
PerMille
PeriodBeatsPerMinute
ElectricchargeAmpereHours
MassDensityMilligramPerdeciLitre
MassDensityMillimolePerLitre
TimeYear
TimeMonth
ConcentrationCountPerCubicMetre
IrradianceWattPerSquareMetre
MilliliterPerKilogramPerminute
MassPound

Definition at line 23 of file PresentationFormats.h.

                         : uint16_t
        {
            Unitless = 0x2700,
            LengthMetre = 0x2701,
            MassKilogram = 0x2702,
            TimeSecond = 0x2703,
            ElectricCurrentAmpere = 0x2704,
            ThermodynamicTemperatureKelvin = 0x2705,
            AmountOfSubstanceMole = 0x2706,
            LuminousIntensityCandela = 0x2707,
            AreaSquareMetres = 0x2710,
            VolumeCubicMetres = 0x2711,
            VelocityMetresPerSecond = 0x2712,
            AccelerationMetresPerSecondSquared = 0x2713,
            WaveNumberReciprocalMetre = 0x2714,
            DensityKilogramperCubicMetre = 0x2715,
            SurfaceDensityKilogramPerSquareMetre = 0x2716,
            SpecificVolumeCubicMetrePerKilogram = 0x2717,
            CurrentDensityAmperePerSquareMetre = 0x2718,
            MagneticFieldStrengthAmperePerMetre = 0x2719,
            AmountConcentrationMolePerCubicMetre = 0x271A,
            MassConcentrationKilogramPerCubicMetre = 0x271B,
            LuminanceCandelaPerSquareMetre = 0x271C,
            RefractiveIndex = 0x271D,
            RelativePermeability = 0x271E,
            PlaneAngleRadian = 0x2720,
            SolidAngleSteradian = 0x2721,
            FrequencyHertz = 0x2722,
            ForceNewton = 0x2723,
            PressurePascal = 0x2724,
            EnergyJoule = 0x2725,
            PowerWatt = 0x2726,
            ElectricChargeCoulomb = 0x2727,
            ElectricPotentialDifferenceVolt = 0x2728,
            CapacitanceFarad = 0x2729,
            ElectricResistanceOhm = 0x272A,
            ElectricConductanceSiemens = 0x272B,
            MagneticFluxWeber = 0x272C,
            MagneticFluxDensityTesla = 0x272D,
            InductanceHenry = 0x272E,
            CelsiusTemperatureDegreeCelsius = 0x272F,
            LuminousFluxLumen = 0x2730,
            IlluminanceLux = 0x2731,
            ActivityReferredToARadioNuclideBecquerel = 0x2732,
            AbsorbedDoseGray = 0x2733,
            DoseEquivalentSievert = 0x2734,
            CatalyticActivityKatal = 0x2735,
            DynamicViscosityPascalSecond = 0x2740,
            MomentOfForceNewtonMetre = 0x2741,
            SurfaceTensionNewtonPerMetre = 0x2742,
            AngularVelocityRadianPerSecond = 0x2743,
            AngularAccelerationRadianPerSecondSquared = 0x2744,
            HeatFluxDensityWattPerSquareMetre = 0x2745,
            HeatCapacityJoulePerKelvin = 0x2746,
            SpecificHeatCapacityJoulePerKilogramKelvin = 0x2747,
            SpecificEnergyJoulePerKilogram = 0x2748,
            ThermalConductivityWattPerMetreKelvin = 0x2749,
            EnergyDensityJoulePerCubicMetre = 0x274A,
            ElectricfieldstrengthVoltPerMetre = 0x274B,
            ElectricchargeDensityCoulombPerCubicMetre = 0x274C,
            SurfacechargeDensityCoulombPerSquareMetre = 0x274D,
            ElectricFluxDensityCoulombPerSquareMetre = 0x274E,
            PermittivityFaradPerMetre = 0x274F,
            PermeabilityHenryPerMetre = 0x2750,
            MolarEnergyJoulePermole = 0x2751,
            MolarentropyJoulePermoleKelvin = 0x2752,
            ExposureCoulombPerKilogram = 0x2753,
            AbsorbeddoserateGrayPerSecond = 0x2754,
            RadiantintensityWattPerSteradian = 0x2755,
            RadianceWattPerSquareMetreSteradian = 0x2756,
            CatalyticActivityConcentrationKatalPerCubicMetre = 0x2757,
            TimeMinute = 0x2760,
            TimeHour = 0x2761,
            TimeDay = 0x2762,
            PlaneAngleDegree = 0x2763,
            PlaneAngleMinute = 0x2764,
            PlaneAngleSecond = 0x2765,
            AreaHectare = 0x2766,
            VolumeLitre = 0x2767,
            MassTonne = 0x2768,
            PressureBar = 0x2780,
            PressureMilliMetreofmercury = 0x2781,
            LengthAngstrom = 0x2782,
            LengthNauticalMile = 0x2783,
            AreaBarn = 0x2784,
            VelocityKnot = 0x2785,
            LogarithmicRadioQuantityNeper = 0x2786,
            LogarithmicRadioQuantityBel = 0x2787,
            LengthYard = 0x27A0,
            LengthParsec = 0x27A1,
            LengthInch = 0x27A2,
            LengthFoot = 0x27A3,
            LengthMile = 0x27A4,
            PressurePoundForcePerSquareinch = 0x27A5,
            VelocityKiloMetrePerHour = 0x27A6,
            VelocityMilePerHour = 0x27A7,
            AngularVelocityRevolutionPerminute = 0x27A8,
            EnergyGramcalorie = 0x27A9,
            EnergyKilogramcalorie = 0x27AA,
            EnergyKiloWattHour = 0x27AB,
            ThermodynamicTemperatureDegreeFahrenheit = 0x27AC,
            Percentage = 0x27AD,
            PerMille = 0x27AE,
            PeriodBeatsPerMinute = 0x27AF,
            ElectricchargeAmpereHours = 0x27B0,
            MassDensityMilligramPerdeciLitre = 0x27B1,
            MassDensityMillimolePerLitre = 0x27B2,
            TimeYear = 0x27B3,
            TimeMonth = 0x27B4,
            ConcentrationCountPerCubicMetre = 0x27B5,
            IrradianceWattPerSquareMetre = 0x27B6,
            MilliliterPerKilogramPerminute = 0x27B7,
            MassPound = 0x27B8,
        };

Member Data Documentation

constexpr uint16_t Description = 0x0000 [static]

The Description is an enumerated value from the organization identified by the Name Space field.

Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml

Definition at line 156 of file PresentationFormats.h.

constexpr int Exponent = 0 [static]

Exponent value for the characteristics.

Definition at line 161 of file PresentationFormats.h.

The documentation for this struct was generated from the following file:
  • BluetoothLE/cppwinrt/PresentationFormats.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RenderBuffer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • RenderBuffer
Public Member Functions | Public Attributes

RenderBuffer Struct Reference

#include "Common.h"

List of all members.

Public Member Functions

RenderBuffer (uint32_t size)

Public Attributes

std::unique_ptr< BYTE[]> | Buffer
uint32_t | BufferSize
uint32_t | BytesFilled

Detailed Description

Definition at line 129 of file Common.h.

Constructor & Destructor Documentation

RenderBuffer ( uint32_t size ) [inline]

Definition at line 135 of file Common.h.

                                    :
            BufferSize(size),
            BytesFilled(size),
            Buffer(new BYTE[size])
        {
        }

Member Data Documentation

std::unique_ptr<BYTE[]> Buffer

Definition at line 133 of file Common.h.

uint32_t BufferSize

Definition at line 131 of file Common.h.

uint32_t BytesFilled

Definition at line 132 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleHelpers Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • SampleHelpers
Static Public Member Functions | Static Public Attributes

SampleHelpers Struct Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static hstring | CurrentTimeAsString ()
static Windows::Foundation::Rect | GetElementRect (Windows::Foundation::IInspectable const &e)

Static Public Attributes

static constexpr wchar_t | AppBarTileId [] = "SecondaryTile.AppBar"
static constexpr wchar_t | DynamicTileId [] = "SecondaryTile.LiveTile"
static constexpr wchar_t | LogoSecondaryTileId [] = "SecondaryTile.Logo"

Detailed Description

Definition at line 19 of file SampleConfiguration.h.

Member Function Documentation

static hstring CurrentTimeAsString ( ) [static]
static Windows::Foundation::Rect GetElementRect ( Windows::Foundation::IInspectable const & e ) [static]

Member Data Documentation

constexpr wchar_t AppBarTileId[] = "SecondaryTile.AppBar" [static]

Definition at line 23 of file SampleConfiguration.h.

constexpr wchar_t DynamicTileId[] = "SecondaryTile.LiveTile" [static]

Definition at line 22 of file SampleConfiguration.h.

constexpr wchar_t LogoSecondaryTileId[] = "SecondaryTile.Logo" [static]

Definition at line 21 of file SampleConfiguration.h.

The documentation for this struct was generated from the following file:
  • SecondaryTiles/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SampleState Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • SampleState
Static Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes

SampleState Struct Reference

#include "SampleConfiguration.h"

List of all members.

Static Public Member Functions

static void | AddCustomTitleBar ()
static void | AreControlsInTitleBar (bool value)
static bool | AreControlsInTitleBar ()
static hstring | BuildClipboardFormatsOutputString ()
static
Windows::UI::Notifications::ToastNotification 		DisplayToast (hstring const &message)
static bool | EnableClipboardContentChangedNotifications (bool enable)
static hstring const & | FalToken ()
static void | FalToken (hstring value)
static hstring const & | FileName ()
static
Windows::Storage::Streams::IBuffer 		GetBufferFromString (hstring const &string)
static hstring | GetStringFromBuffer (Windows::Storage::Streams::IBuffer const &buffer)
static bool | IsClipboardContentChangedEnabled ()
static hstring const & | MruToken ()
static void | MruToken (hstring value)
static void | NotifyUserFileNotExist ()
static void | RemoveCustomTitleBar ()
static
Windows::Storage::StorageFile
const & 		SampleFile ()
static void | SampleFile (Windows::Storage::StorageFile value)
static void | UpdateTitle (hstring newTitle, int32_t viewId)
static fire_and_forget | ValidateFile ()

Static Public Attributes

static implementation::App * | CurrentApp
static
Windows::UI::Core::CoreDispatcher 		MainDispatcher
static int32_t | MainViewId
static
Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > 		SecondaryViews
static hstring | SelectedBleDeviceId
static hstring | SelectedBleDeviceName

Static Private Member Functions

static void | AddClipboardFormatsOutputString (std::wostringstream &output)
static void | DisplayChangedFormats ()
static void | HandleClipboardChanged ()
static void | OnClipboardChanged (Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e)
static void | OnWindowActivated (Windows::Foundation::IInspectable const &sender, Windows::UI::Core::WindowActivatedEventArgs const &e)

Static Private Attributes

static event_token | activatedToken
static bool | areControlsInTitleBar
static event_token | clipboardContentChangedToken
static CustomTitleBar | customTitleBar
static hstring | falToken
static hstring | fileName
static bool | isApplicationWindowActive
static bool | isClipboardContentChangedEnabled
static hstring | mruToken
static bool | needToPrintClipboardFormat
static
Windows::Storage::StorageFile 		sampleFile

Detailed Description

Definition at line 26 of file SampleConfiguration.h.

Member Function Documentation

static void AddClipboardFormatsOutputString ( std::wostringstream & output ) [static, private]
static void AddCustomTitleBar ( ) [static]
static void AreControlsInTitleBar ( bool value ) [static]
static bool AreControlsInTitleBar ( ) [inline, static]

Definition at line 20 of file SampleConfiguration.h.

{ return areControlsInTitleBar; }

static hstring BuildClipboardFormatsOutputString ( ) [static]
static void DisplayChangedFormats ( ) [static, private]
static Windows::UI::Notifications::ToastNotification DisplayToast ( hstring const & message ) [static]
static bool EnableClipboardContentChangedNotifications ( bool enable ) [static]
static hstring const& FalToken ( ) [inline, static]

Definition at line 32 of file SampleConfiguration.h.

{ return falToken; }

static void FalToken ( hstring value ) [inline, static]

Definition at line 33 of file SampleConfiguration.h.

{ falToken = std::move(value); }

static hstring const& FileName ( ) [inline, static]

Definition at line 19 of file SampleConfiguration.h.

{ return fileName; }

static Windows::Storage::Streams::IBuffer GetBufferFromString ( hstring const & string ) [static]
static hstring GetStringFromBuffer ( Windows::Storage::Streams::IBuffer const & buffer ) [static]
static void HandleClipboardChanged ( ) [static, private]
static bool IsClipboardContentChangedEnabled ( ) [static]
static void MruToken ( hstring value ) [inline, static]

Definition at line 30 of file SampleConfiguration.h.

{ mruToken = std::move(value); }

static hstring const& MruToken ( ) [inline, static]

Definition at line 29 of file SampleConfiguration.h.

{ return mruToken; }

static void NotifyUserFileNotExist ( ) [static]
static void OnClipboardChanged | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::Foundation::IInspectable const & | e |
 | ) |  |  | [static, private]
static void OnWindowActivated | ( | Windows::Foundation::IInspectable const & | sender,
 |  | Windows::UI::Core::WindowActivatedEventArgs const & | e |
 | ) |  |  | [static, private]
static void RemoveCustomTitleBar ( ) [static]
static void SampleFile ( Windows::Storage::StorageFile value ) [inline, static]

Definition at line 22 of file SampleConfiguration.h.

{ sampleFile = std::move(value); }

static Windows::Storage::StorageFile const& SampleFile ( ) [inline, static]

Definition at line 21 of file SampleConfiguration.h.

{ return sampleFile; }

static void UpdateTitle | ( | hstring | newTitle,
 |  | int32_t | viewId |
 | ) |  |  | [static]
static fire_and_forget ValidateFile ( ) [static]

Member Data Documentation

event_token activatedToken [static, private]

Definition at line 25 of file SampleConfiguration.h.

bool areControlsInTitleBar [static, private]

Definition at line 25 of file SampleConfiguration.h.

event_token clipboardContentChangedToken [static, private]

Definition at line 24 of file SampleConfiguration.h.

implementation::App* CurrentApp [static]

Definition at line 20 of file SampleConfiguration.h.

CustomTitleBar customTitleBar [static, private]

Definition at line 26 of file SampleConfiguration.h.

hstring falToken [static, private]

Definition at line 39 of file SampleConfiguration.h.

hstring fileName [static, private]

Definition at line 36 of file SampleConfiguration.h.

bool isApplicationWindowActive [static, private]

Definition at line 28 of file SampleConfiguration.h.

bool isClipboardContentChangedEnabled [static, private]

Definition at line 26 of file SampleConfiguration.h.

Windows::UI::Core::CoreDispatcher MainDispatcher [static]

Definition at line 22 of file SampleConfiguration.h.

int32_t MainViewId [static]

Definition at line 23 of file SampleConfiguration.h.

hstring mruToken [static, private]

Definition at line 38 of file SampleConfiguration.h.

bool needToPrintClipboardFormat [static, private]

Definition at line 27 of file SampleConfiguration.h.

Windows::Storage::StorageFile sampleFile [static, private]

Definition at line 37 of file SampleConfiguration.h.

Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> SecondaryViews [static]

Definition at line 21 of file SampleConfiguration.h.

hstring SelectedBleDeviceId [static]

Definition at line 28 of file SampleConfiguration.h.

hstring SelectedBleDeviceName [static]

Definition at line 29 of file SampleConfiguration.h.

The documentation for this struct was generated from the following files:
  • BluetoothLE/cppwinrt/SampleConfiguration.h
  • Clipboard/cppwinrt/SampleConfiguration.h
  • FileAccess/cppwinrt/SampleConfiguration.h
  • MultipleViews/cppwinrt/SampleConfiguration.h
  • TitleBar/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: scope_exit< Lambda > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • scope_exit< Lambda >
Public Member Functions | Public Attributes

scope_exit< Lambda > Struct Template Reference

#include "Common.h"

List of all members.

Public Member Functions

scope_exit (Lambda &&lambda)
scope_exit (const scope_exit &)
~scope_exit ()
void | operator= (const scope_exit &)

Public Attributes

Lambda | m_lambda

Detailed Description

template<typename Lambda>
struct winrt::SDKTemplate::scope_exit< Lambda >

Definition at line 17 of file Common.h.

Constructor & Destructor Documentation

scope_exit ( Lambda && lambda ) [inline]

Definition at line 19 of file Common.h.

: m_lambda(std::move(lambda)) {}

~scope_exit ( ) [inline]

Definition at line 20 of file Common.h.

{ m_lambda(); }

scope_exit ( const scope_exit< Lambda > & )

Member Function Documentation

void operator= ( const scope_exit< Lambda > & )

Member Data Documentation

Lambda m_lambda

Definition at line 25 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleTaskCompletionSource< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • SimpleTaskCompletionSource< T >
Public Member Functions

SimpleTaskCompletionSource< T > Struct Template Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

void SetResult (T value)
Windows::Foundation::IAsyncOperation
< T > 		Task ()

Detailed Description

template<typename T>
struct winrt::SDKTemplate::SimpleTaskCompletionSource< T >

Definition at line 33 of file SampleConfiguration.h.

Member Function Documentation

void SetResult ( T value ) [inline]

Definition at line 35 of file SampleConfiguration.h.

        {
            if (!result)
            {
                result = std::move(value);
                SimpleTaskCompletionSource<void>::SetResult();
            }
        }

Windows::Foundation::IAsyncOperation<T> Task ( ) [inline]

Definition at line 44 of file SampleConfiguration.h.

        {
            co_await SimpleTaskCompletionSource<void>::Task();
            co_return result.value();
        }

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleTaskCompletionSource< void > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • SimpleTaskCompletionSource< void >
Public Member Functions

SimpleTaskCompletionSource< void > Struct Template Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

SimpleTaskCompletionSource ()
void | SetResult ()
Windows::Foundation::IAsyncAction | Task ()

Detailed Description

template<>
struct winrt::SDKTemplate::SimpleTaskCompletionSource< void >

Definition at line 54 of file SampleConfiguration.h.

Constructor & Destructor Documentation

SimpleTaskCompletionSource ( ) [inline]

Definition at line 56 of file SampleConfiguration.h.

        {
            check_bool(static_cast<bool>(completeEvent));
        }

Member Function Documentation

void SetResult ( ) [inline]

Definition at line 61 of file SampleConfiguration.h.

        {
            SetEvent(completeEvent.get());
        }

Windows::Foundation::IAsyncAction Task ( ) [inline]

Definition at line 66 of file SampleConfiguration.h.

        {
            handle localEvent;
            check_bool(DuplicateHandle(GetCurrentProcess(), completeEvent.get(), GetCurrentProcess(), localEvent.put(), 0, FALSE, DUPLICATE_SAME_ACCESS));
            co_await resume_on_signal(localEvent.get());
        }

The documentation for this struct was generated from the following file:
  • DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketReaderWriter Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • SocketReaderWriter
Public Member Functions | Private Attributes

SocketReaderWriter Struct Reference

#include "SocketReaderWriter.h"

List of all members.

Public Member Functions

SocketReaderWriter (Windows::Networking::Sockets::StreamSocket socket, MainPage mainPage)
void | Close ()
Windows::Foundation::IAsyncOperation
< Windows::Foundation::IReference
< hstring > > 		ReadMessageAsync ()
Windows::Foundation::IAsyncAction | WriteMessageAsync (hstring const &message)

Private Attributes

Windows::Storage::Streams::DataReader | dataReader
Windows::Storage::Streams::DataWriter | dataWriter
MainPage | rootPage
Windows::Networking::Sockets::StreamSocket | streamSocket

Detailed Description

Definition at line 20 of file SocketReaderWriter.h.

Constructor & Destructor Documentation

SocketReaderWriter | ( | Windows::Networking::Sockets::StreamSocket | socket,
 |  | MainPage | mainPage
 | ) |  |

Member Function Documentation

void Close ( )

Definition at line 37 of file SocketReaderWriter.cpp.

    {
        dataReader.Close();
        dataWriter.Close();
        streamSocket.Close();
    }

IAsyncOperation< IReference< hstring > > ReadMessageAsync ( )

Definition at line 61 of file SocketReaderWriter.cpp.

    {
        auto lifetime = get_strong();

        try
        {
            uint32_t bytesRead = co_await dataReader.LoadAsync(sizeof(uint32_t));
            if (bytesRead > 0)
            {
                // Determine how long the string is.
                uint32_t messageLength = dataReader.ReadUInt32();
                bytesRead = co_await dataReader.LoadAsync(messageLength);
                if (bytesRead > 0)
                {
                    // Decode the string.
                    hstring message = dataReader.ReadString(messageLength);
                    rootPage.NotifyUser(L"Got message: " + message, NotifyType::StatusMessage);
                    co_return message;
                }
            }
        }
        catch (hresult_error const&)
        {
            rootPage.NotifyUser(L"Socket was closed!", NotifyType::StatusMessage);
        }
        co_return nullptr;
    }

IAsyncAction WriteMessageAsync ( hstring const & message )

Definition at line 44 of file SocketReaderWriter.cpp.

    {
        auto lifetime = get_strong();

        try
        {
            dataWriter.WriteUInt32(dataWriter.MeasureString(message));
            dataWriter.WriteString(message);
            co_await dataWriter.StoreAsync();
            rootPage.NotifyUser(L"Sent message: " + message, NotifyType::StatusMessage);
        }
        catch (hresult_error const& ex)
        {
            rootPage.NotifyUser(L"WriteMessage raised exception: " + ex.message(), NotifyType::ErrorMessage);
        }
    }

Member Data Documentation

Windows::Storage::Streams::DataReader dataReader [private]

Definition at line 29 of file SocketReaderWriter.h.

Windows::Storage::Streams::DataWriter dataWriter [private]

Definition at line 30 of file SocketReaderWriter.h.

MainPage rootPage [private]

Definition at line 27 of file SocketReaderWriter.h.

Windows::Networking::Sockets::StreamSocket streamSocket [private]

Definition at line 28 of file SocketReaderWriter.h.

The documentation for this struct was generated from the following files:
  • WiFiDirect/cppwinrt/SocketReaderWriter.h
  • WiFiDirect/cppwinrt/SocketReaderWriter.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToneSampleGenerator Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • ToneSampleGenerator
Classes | Public Member Functions | Private Attributes

ToneSampleGenerator Class Reference

#include "ToneSampleGenerator.h"

List of all members.

Classes

struct | SineSampleInfo

Public Member Functions

void | FillSampleBuffer (array_view< uint8_t > buffer)
void | Flush ()
void | GenerateSampleBuffer (double Frequency, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx)
uint32_t | GetBufferLength () noexcept
bool | IsEOF () noexcept

Private Attributes

std::forward_list< RenderBuffer > | m_sampleQueue

Detailed Description

Definition at line 19 of file ToneSampleGenerator.h.

Member Function Documentation

void FillSampleBuffer ( array_view< uint8_t > buffer )

Definition at line 106 of file ToneSampleGenerator.cpp.

    {
        RenderBuffer& sampleBuffer = m_sampleQueue.front();

        if (buffer.size() > sampleBuffer.BufferSize)
        {
            throw hresult_invalid_argument();
        }

        CopyMemory(buffer.data(), sampleBuffer.Buffer.get(), buffer.size());

        m_sampleQueue.pop_front();
    }

void Flush ( ) [inline]

Definition at line 24 of file ToneSampleGenerator.h.

{ m_sampleQueue.clear(); }

void GenerateSampleBuffer | ( | double | Frequency,
 |  | UINT32 | FramesPerPeriod,
 |  | WAVEFORMATEX * | wfx
 | ) |  |

Definition at line 24 of file ToneSampleGenerator.cpp.

    {
        uint32_t renderBufferSizeInBytes = FramesPerPeriod * wfx->nBlockAlign;
        uint64_t renderDataLength = (wfx->nSamplesPerSec * TONE_DURATION_SEC * wfx->nBlockAlign) + (renderBufferSizeInBytes - 1);
        uint64_t renderBufferCount = renderDataLength / renderBufferSizeInBytes;

        SineSampleInfo info;
        info.Frequency = Frequency;
        info.ChannelCount = wfx->nChannels;
        info.SamplesPerSecond = wfx->nSamplesPerSec;
        info.Amplitude = TONE_AMPLITUDE;
        info.Theta = 0; // Updated by GenerateSamples to remember where to resume

        switch (GetRenderSampleType(wfx))
        {
        case RenderSampleType::Pcm16Bit:
            info.SampleSize = sizeof(int16_t);
            info.StoreSample = [](uint8_t* buffer, double value) { *reinterpret_cast<int16_t*>(buffer) = static_cast<int16_t>(value * (std::numeric_limits<int16_t>::max)()); };
            break;

        case RenderSampleType::Pcm24In32Bit:
            info.SampleSize = sizeof(int32_t);
            // Scale to a 24-bit integer, stored in the upper 24 bits of the 32-bit sample.
            info.StoreSample = [](uint8_t* buffer, double value) { *reinterpret_cast<int32_t*>(buffer) = static_cast<int32_t>(value * ((1 << 23) - 1)) << 8; };
            break;

        case RenderSampleType::Float:
            info.SampleSize = sizeof(float);
            info.StoreSample = [](uint8_t* buffer, double value) { *reinterpret_cast<float*>(buffer) = static_cast<float>(value); };
            break;

        default:
            throw hresult_error(E_UNEXPECTED);
        }

        std::forward_list<RenderBuffer>::iterator sampleQueueTail = m_sampleQueue.before_begin();
        for (uint64_t i = 0; i < renderBufferCount; i++)
        {
            sampleQueueTail = m_sampleQueue.emplace_after(sampleQueueTail, renderBufferSizeInBytes);
            RenderBuffer& sampleBuffer = *sampleQueueTail;
            info.GenerateSamples({ sampleBuffer.Buffer.get(), sampleBuffer.BufferSize });
        }
    }

uint32_t GetBufferLength ( ) [inline]

Definition at line 23 of file ToneSampleGenerator.h.

{ return m_sampleQueue.empty() ? 0 : m_sampleQueue.front().BufferSize; };

bool IsEOF ( ) [inline]

Definition at line 22 of file ToneSampleGenerator.h.

{ return m_sampleQueue.empty(); };

Member Data Documentation

std::forward_list<RenderBuffer> m_sampleQueue [private]

Definition at line 44 of file ToneSampleGenerator.h.

The documentation for this class was generated from the following files:
  • WindowsAudioSession/cppwinrt/ToneSampleGenerator.h
  • WindowsAudioSession/cppwinrt/ToneSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ToneSampleGenerator::SineSampleInfo Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • ToneSampleGenerator
  • ToneSampleGenerator::SineSampleInfo
Public Member Functions | Public Attributes

ToneSampleGenerator::SineSampleInfo Struct Reference

List of all members.

Public Member Functions

void | GenerateSamples (array_view< uint8_t > buffer) noexcept

Public Attributes

double | Amplitude
WORD | ChannelCount
double | Frequency
size_t | SampleSize
DWORD | SamplesPerSecond
void(* | StoreSample )(uint8_t *buffer, double value)
double | Theta = 0.0

Detailed Description

Definition at line 30 of file ToneSampleGenerator.h.

Member Function Documentation

void GenerateSamples ( array_view< uint8_t > buffer )

Definition at line 78 of file ToneSampleGenerator.cpp.

    {
        // Each sample represents (Frequency * 2 * M_PI / SamplesPerSecond) radians.
        // To avoid accumulated rounding errors, we track the cumulative Frequency.
        // To avoid loss of significance, we take the value mod SamplesPerSecond.
        size_t frames = buffer.size() / SampleSize / ChannelCount;
        uint8_t* next = buffer.data();
        for (size_t frame = 0; frame < frames; frame++)
        {
            double sinValue = Amplitude * sin(Theta * M_PI * 2 / SamplesPerSecond);
            for (size_t channel = 0; channel < ChannelCount; channel++)
            {
                StoreSample(next, sinValue);
                next += SampleSize;
            }
            Theta += Frequency;
            if (Theta > SamplesPerSecond)
            {
                Theta = Theta - SamplesPerSecond;
            }
        }
    }

Member Data Documentation

double Amplitude

Definition at line 35 of file ToneSampleGenerator.h.

WORD ChannelCount

Definition at line 33 of file ToneSampleGenerator.h.

double Frequency

Definition at line 32 of file ToneSampleGenerator.h.

size_t SampleSize

Definition at line 37 of file ToneSampleGenerator.h.

DWORD SamplesPerSecond

Definition at line 34 of file ToneSampleGenerator.h.

void(* StoreSample)(uint8_t *buffer, double value)

Definition at line 38 of file ToneSampleGenerator.h.

double Theta = 0.0

Definition at line 36 of file ToneSampleGenerator.h.

The documentation for this struct was generated from the following files:
  • WindowsAudioSession/cppwinrt/ToneSampleGenerator.h
  • WindowsAudioSession/cppwinrt/ToneSampleGenerator.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: unique_cotaskmem_ptr< T > Struct Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • unique_cotaskmem_ptr< T >
Public Member Functions | Public Attributes

unique_cotaskmem_ptr< T > Struct Template Reference

#include "Common.h"

List of all members.

Public Member Functions

unique_cotaskmem_ptr (T *p=nullptr)
unique_cotaskmem_ptr (unique_cotaskmem_ptr &&other)
unique_cotaskmem_ptr (unique_cotaskmem_ptr const &)
~unique_cotaskmem_ptr ()
T * | get ()
T * | operator-> ()
unique_cotaskmem_ptr & | operator= (unique_cotaskmem_ptr const &other)
T ** | put ()

Public Attributes

T * | m_p

Detailed Description

template<typename T>
struct winrt::SDKTemplate::unique_cotaskmem_ptr< T >

Definition at line 67 of file Common.h.

Constructor & Destructor Documentation

unique_cotaskmem_ptr ( T * p = nullptr ) [inline]

Definition at line 69 of file Common.h.

: m_p(p) {}

~unique_cotaskmem_ptr ( ) [inline]

Definition at line 70 of file Common.h.

{ CoTaskMemFree(m_p); }

unique_cotaskmem_ptr ( unique_cotaskmem_ptr< T > const & )
unique_cotaskmem_ptr ( unique_cotaskmem_ptr< T > && other ) [inline]

Definition at line 73 of file Common.h.

: m_p(std::exchange(other.m_p, nullptr)) {}

Member Function Documentation

T* get ( ) [inline]

Definition at line 81 of file Common.h.

{ return m_p; }

T* operator-> ( ) [inline]

Definition at line 80 of file Common.h.

{ return m_p; }

unique_cotaskmem_ptr& operator= ( unique_cotaskmem_ptr< T > const & other ) [inline]

Definition at line 74 of file Common.h.

        {
            CoTaskMemFree(std::exchange(m_p, std::exchange(other.m_p, nullptr)));
            return *this;
        }

T** put ( ) [inline]

Definition at line 82 of file Common.h.

{ return &m_p; }

Member Data Documentation

T* m_p

Definition at line 83 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: unique_disabled_control Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • unique_disabled_control
Public Member Functions | Public Attributes

unique_disabled_control Struct Reference

#include "SampleConfiguration.h"

List of all members.

Public Member Functions

unique_disabled_control (Windows::UI::Xaml::Controls::Control const &control)
~unique_disabled_control ()
void | operator= (unique_disabled_control const &)

Public Attributes

Windows::UI::Xaml::Controls::Control | c

Detailed Description

Definition at line 17 of file SampleConfiguration.h.

Constructor & Destructor Documentation

unique_disabled_control ( Windows::UI::Xaml::Controls::Control const & control ) [inline]

Definition at line 19 of file SampleConfiguration.h.

: c{ control }

~unique_disabled_control ( ) [inline]

Definition at line 27 of file SampleConfiguration.h.

        {
            c.IsEnabled(true);
        }

Member Function Documentation

void operator= ( unique_disabled_control const & )

Member Data Documentation

Windows::UI::Xaml::Controls::Control c

Definition at line 31 of file SampleConfiguration.h.

The documentation for this struct was generated from the following file:
  • AppWindow/cppwinrt/SampleConfiguration.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: unique_shared_work_queue Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • unique_shared_work_queue
Public Member Functions | Private Attributes

unique_shared_work_queue Struct Reference

#include "Common.h"

List of all members.

Public Member Functions

unique_shared_work_queue (PCWSTR className)
unique_shared_work_queue (unique_shared_work_queue const &)
~unique_shared_work_queue ()
DWORD | get ()
void | operator= (unique_shared_work_queue const &)

Private Attributes

DWORD | m_queueId = 0

Detailed Description

Definition at line 44 of file Common.h.

Constructor & Destructor Documentation

unique_shared_work_queue ( PCWSTR className ) [inline]

Definition at line 46 of file Common.h.

        {
            DWORD taskId = 0; // 0 means "create a new task group"
            check_hresult(MFLockSharedWorkQueue(className, 0, &taskId, &m_queueId));
        }

~unique_shared_work_queue ( ) [inline]

Definition at line 52 of file Common.h.

        {
            MFUnlockWorkQueue(m_queueId);
        }

unique_shared_work_queue ( unique_shared_work_queue const & )

Member Function Documentation

DWORD get ( ) [inline]

Definition at line 60 of file Common.h.

{ return m_queueId; }

void operator= ( unique_shared_work_queue const & )

Member Data Documentation

DWORD m_queueId = 0 [private]

Definition at line 62 of file Common.h.

The documentation for this struct was generated from the following file:
  • WindowsAudioSession/cppwinrt/Common.h
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WASAPICapture Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • WASAPICapture
Public Member Functions | Private Member Functions | Private Attributes

WASAPICapture Struct Reference

#include "WASAPICapture.h"

Inherits DeviceStateSourceT< WASAPICapture >, and PlotDataSourceT< WASAPICapture >.

List of all members.

Public Member Functions

WASAPICapture ()
STDMETHOD() | ActivateCompleted (IActivateAudioInterfaceAsyncOperation *operation)
void | AsyncInitializeAudioDevice () noexcept
void | AsyncStartCapture ()
void | AsyncStopCapture ()
void | SetLowLatencyCapture (bool value)

Private Member Functions

fire_and_forget | AsyncStoreData ()
fire_and_forget | CreateWAVFile ()
fire_and_forget | FixWAVHeader ()
void | InitializeScopeData ()
void | OnAudioSampleRequested ()
HRESULT | OnFinishCapture (IMFAsyncResult *pResult)
HRESULT | OnSampleReady (IMFAsyncResult *pResult)
HRESULT | OnSendScopeData (IMFAsyncResult *pResult)
HRESULT | OnStartCapture (IMFAsyncResult *pResult)
HRESULT | OnStopCapture (IMFAsyncResult *pResult)
void | ProcessScopeData (array_view< uint8_t > rawBytes)

Private Attributes

com_ptr< IAudioCaptureClient > | m_audioCaptureClient
com_ptr< IAudioClient3 > | m_audioClient
uint32_t | m_bufferFrames = 0
uint32_t | m_bytesSinceLastFlush = 0
Windows::Storage::Streams::IRandomAccessStream | m_contentStream
uint32_t | m_dataSize = 0
uint32_t | m_defaultPeriodInFrames
uint32_t | m_fundamentalPeriodInFrames
uint32_t | m_headerSize = 0
bool | m_isLowLatency = false
slim_mutex | m_lock
uint32_t | m_maxPeriodInFrames
uint32_t | m_minPeriodInFrames
unique_cotaskmem_ptr
< WAVEFORMATEX > 		m_mixFormat
Windows::Storage::Streams::IOutputStream | m_outputStream
Windows::Storage::Streams::IBuffer | m_plotDataBuffer
uint32_t | m_plotDataMaxPoints
uint32_t | m_plotDataPointsFilled
com_ptr< IMFAsyncResult > | m_sampleReadyAsyncResult
MFWORKITEM_KEY | m_sampleReadyKey = 0
bool | m_writing = false

Detailed Description

Definition at line 18 of file WASAPICapture.h.

Constructor & Destructor Documentation

WASAPICapture ( )

Definition at line 28 of file WASAPICapture.cpp.

    {
        // Set the capture event work queue to use the MMCSS queue
        m_SampleReadyCallback.SetQueueID(m_queueId.get());
    }

Member Function Documentation

HRESULT ActivateCompleted ( IActivateAudioInterfaceAsyncOperation * operation )

Definition at line 62 of file WASAPICapture.cpp.

    {
        HRESULT status = S_OK;
        com_ptr<::IUnknown> punkAudioInterface;

        // Check for a successful activation result
        check_hresult(operation->GetActivateResult(&status, punkAudioInterface.put()));
        check_hresult(status);

        // Get the pointer for the Audio Client
        m_audioClient = punkAudioInterface.as<IAudioClient3>();

        check_hresult(m_audioClient->GetMixFormat(m_mixFormat.put()));

        // convert from Float to 16-bit PCM
        switch (m_mixFormat->wFormatTag)
        {
        case WAVE_FORMAT_PCM:
            // nothing to do
            break;

        case WAVE_FORMAT_IEEE_FLOAT:
            m_mixFormat->wFormatTag = WAVE_FORMAT_PCM;
            m_mixFormat->wBitsPerSample = 16;
            m_mixFormat->nBlockAlign = m_mixFormat->nChannels * m_mixFormat->wBitsPerSample / BITS_PER_BYTE;
            m_mixFormat->nAvgBytesPerSec = m_mixFormat->nSamplesPerSec * m_mixFormat->nBlockAlign;
            break;

        case WAVE_FORMAT_EXTENSIBLE:
        {
            WAVEFORMATEXTENSIBLE* pWaveFormatExtensible = reinterpret_cast<WAVEFORMATEXTENSIBLE*>(m_mixFormat.get());
            if (pWaveFormatExtensible->SubFormat == KSDATAFORMAT_SUBTYPE_PCM)
            {
                // nothing to do
            }
            else if (pWaveFormatExtensible->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)
            {
                pWaveFormatExtensible->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
                pWaveFormatExtensible->Format.wBitsPerSample = 16;
                pWaveFormatExtensible->Format.nBlockAlign =
                    pWaveFormatExtensible->Format.nChannels *
                    pWaveFormatExtensible->Format.wBitsPerSample /
                    BITS_PER_BYTE;
                pWaveFormatExtensible->Format.nAvgBytesPerSec =
                    pWaveFormatExtensible->Format.nSamplesPerSec *
                    pWaveFormatExtensible->Format.nBlockAlign;
                pWaveFormatExtensible->Samples.wValidBitsPerSample =
                    pWaveFormatExtensible->Format.wBitsPerSample;

                // leave the channel mask as-is
            }
            else
            {
                // we can only handle float or PCM
                throw hresult_error(HRESULT_FROM_WIN32(ERROR_NOT_FOUND));
            }
            break;
        }

        default:
            // we can only handle float or PCM
            throw hresult_error(HRESULT_FROM_WIN32(ERROR_NOT_FOUND));
            break;
        }

        // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
        // to be the current engine format based on the processing mode for this stream
        check_hresult(m_audioClient->GetSharedModeEnginePeriod(m_mixFormat.get(), &m_defaultPeriodInFrames, &m_fundamentalPeriodInFrames, &m_minPeriodInFrames, &m_maxPeriodInFrames));

        // Initialize the AudioClient in Shared Mode with the user specified buffer
        if (!m_isLowLatency)
        {
            check_hresult(m_audioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                TimeSpan{ 20ms }.count(), // hnsBufferDuration
                0,
                m_mixFormat.get(),
                nullptr));
        }
        else
        {
            check_hresult(m_audioClient->InitializeSharedAudioStream(
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                m_minPeriodInFrames,
                m_mixFormat.get(),
                nullptr));
        }

        // Get the maximum size of the AudioClient Buffer
        check_hresult(m_audioClient->GetBufferSize(&m_bufferFrames));

        // Get the capture client
        m_audioCaptureClient.capture(m_audioClient, &IAudioClient::GetService);

        // Create Async callback for sample events
        check_hresult(MFCreateAsyncResult(nullptr, &m_SampleReadyCallback, nullptr, m_sampleReadyAsyncResult.put()));

        // Provides the event handle for the system to signal when an audio buffer is ready to be processed by the client
        check_hresult(m_audioClient->SetEventHandle(m_SampleReadyEvent.get()));

        // Create the visualization array
        InitializeScopeData();

        // Creates the WAV file asynchronously.  If successful, will transition to DeviceState::Initialized
        CreateWAVFile();

        // Need to return S_OK
        return S_OK;
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
        m_audioClient = nullptr;
        m_audioCaptureClient = nullptr;
        m_sampleReadyAsyncResult = nullptr;

        // Must return S_OK even on failure.
        return S_OK;
    }

void AsyncInitializeAudioDevice ( )

Definition at line 40 of file WASAPICapture.cpp.

    {
        com_ptr<IActivateAudioInterfaceAsyncOperation> asyncOp;

        // Get a string representing the Default Audio Capture Device
        hstring deviceIdString = MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default);

        // This call must be made on the main UI thread.  Async operation will call back to
        // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
        check_hresult(ActivateAudioInterfaceAsync(deviceIdString.c_str(), __uuidof(IAudioClient3), nullptr, this, asyncOp.put()));
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
    }

void AsyncStartCapture ( )

Definition at line 295 of file WASAPICapture.cpp.

    {
        // We should be in the initialzied state if this is the first time through getting ready to capture.
        if (m_deviceState == DeviceState::Initialized)
        {
            SetState(DeviceState::Starting);
            MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StartCaptureCallback, nullptr);
        }
    }

void AsyncStopCapture ( )

Definition at line 331 of file WASAPICapture.cpp.

    {
        if ((m_deviceState == DeviceState::Capturing) ||
            (m_deviceState == DeviceState::Error))
        {
            SetState(DeviceState::Stopping);

            MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StopCaptureCallback, nullptr);
        }
    }

fire_and_forget AsyncStoreData ( ) [private]

Definition at line 380 of file WASAPICapture.cpp.

    {
        auto lifetime = get_strong();

        co_await m_dataWriter.StoreAsync();
        m_writing = false;

        if (m_deviceState == DeviceState::Stopping)
        {
            // A Stop request is pending. Transition to Flushing to write out the WAV header.
            SetState(DeviceState::Flushing);
        }

        if (m_deviceState == DeviceState::Flushing)
        {
            check_hresult(MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_FinishCaptureCallback, nullptr));
        }
    }

fire_and_forget CreateWAVFile ( ) [private]

Definition at line 187 of file WASAPICapture.cpp.

    {
        auto lifetime = get_strong();

        // Create the WAV file, appending a number if file already exists
        StorageFile file = co_await KnownFolders::MusicLibrary().CreateFileAsync(AUDIO_FILE_NAME, CreationCollisionOption::GenerateUniqueName);

        // Then create a RandomAccessStream
        IRandomAccessStream stream = co_await file.OpenAsync(FileAccessMode::ReadWrite);

        // Get the OutputStream for the file
        m_contentStream = stream;
        m_outputStream = stream.GetOutputStreamAt(0);

        // Create the DataWriter
        m_dataWriter = DataWriter(m_outputStream);

        // Create the WAV header
        DWORD formatSize = sizeof(WAVEFORMATEX) + m_mixFormat->cbSize; // Size of fmt chunk
        DWORD header[] = {
            FCC('RIFF'),        // RIFF header
            0,                  // Total size of WAV (will be filled in later)
            FCC('WAVE'),        // WAVE FourCC
            FCC('fmt '),        // Start of 'fmt ' chunk
            formatSize          // Size of fmt chunk
        };

        DWORD data[] = { FCC('data'), 0 };  // Start of 'data' chunk (total size will be filled in later)

        // Write the header
        m_dataWriter.WriteBytes({ reinterpret_cast<uint8_t*>(header), sizeof(header) });
        m_dataWriter.WriteBytes({ reinterpret_cast<uint8_t*>(m_mixFormat.get()), formatSize });
        m_dataWriter.WriteBytes({ reinterpret_cast<uint8_t*>(data), sizeof(data) });

        m_headerSize = co_await m_dataWriter.StoreAsync();
        m_dataSize = 0;
        m_bytesSinceLastFlush = 0;

        // Wait for file data to be written to file
        co_await m_dataWriter.FlushAsync();

        SetState(DeviceState::Initialized);
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
    }

fire_and_forget FixWAVHeader ( ) [private]

Definition at line 240 of file WASAPICapture.cpp.

    {
        auto lifetime = get_strong();

        // Prepare a buffer to write DWORDs into the stream header.
        Buffer dwordBuffer(sizeof(DWORD));
        dwordBuffer.Length(sizeof(DWORD));
        auto dwordBufferPtr = reinterpret_cast<DWORD*>(dwordBuffer.data());

        IRandomAccessStream stream = m_contentStream.CloneStream();

        // Write the size of the 'data' chunk first
        stream.Seek(m_headerSize - sizeof(DWORD));
        *dwordBufferPtr = m_dataSize;
        co_await stream.WriteAsync(dwordBuffer);

        // Write the total file size, minus RIFF chunk and size
        stream.Seek(sizeof(DWORD)); // sizeof(DWORD) == sizeof(FOURCC)
        *dwordBufferPtr = m_dataSize + m_headerSize - 8; // 8 = RIFF chunk and size
        co_await stream.WriteAsync(dwordBuffer);

        co_await stream.FlushAsync();
        stream.Close();

        SetState(DeviceState::Stopped);
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
    }

void InitializeScopeData ( ) [private]

Definition at line 276 of file WASAPICapture.cpp.

    {
        // Only Support 16 bit Audio for now
        if (m_mixFormat->wBitsPerSample != 16)
        {
            m_plotDataBuffer = nullptr;
            return;
        }

        m_plotDataPointsFilled = 0;
        m_plotDataMaxPoints = static_cast<uint32_t>(DURATION_TO_VISUALIZE * m_mixFormat->nSamplesPerSec / 1s);
        m_plotDataBuffer = Buffer(m_plotDataMaxPoints * sizeof(int16_t));
    }

void OnAudioSampleRequested ( ) [private]

Definition at line 441 of file WASAPICapture.cpp.

    {
        auto guard = slim_lock_guard(m_lock);

        // If this flag is set, we have already queued up the async call to finialize the WAV header
        // So we don't want to grab or write any more data that would possibly give us an invalid size
        if ((m_deviceState == DeviceState::Stopping) ||
            (m_deviceState == DeviceState::Flushing))
        {
            return;
        }

        // A word on why we have a loop here:
        // Suppose it has been 10 milliseconds or so since the last time
        // this routine was invoked, and that we're capturing 48000 samples per second.
        //
        // The audio engine can be reasonably expected to have accumulated about that much
        // audio data - that is, about 480 samples.
        //
        // However, the audio engine is free to accumulate this in various ways:
        // a. as a single packet of 480 samples, OR
        // b. as a packet of 80 samples plus a packet of 400 samples, OR
        // c. as 48 packets of 10 samples each.
        //
        // In particular, there is no guarantee that this routine will be
        // run once for each packet.
        //
        // So every time this routine runs, we need to read ALL the packets
        // that are now available;
        //
        // We do this by calling IAudioCaptureClient::GetNextPacketSize
        // over and over again until it indicates there are no more packets remaining.
        uint32_t framesAvailable = 0;
        while (SUCCEEDED(m_audioCaptureClient->GetNextPacketSize(&framesAvailable)) && framesAvailable > 0)
        {
            DWORD bytesToCapture = framesAvailable * m_mixFormat->nBlockAlign;

            // WAV files have a 4GB (0xFFFFFFFF) size limit, so likely we have hit that limit when we
            // overflow here.  Time to stop the capture
            if ((m_dataSize + bytesToCapture) < m_dataSize)
            {
                AsyncStopCapture();
                return;
            }

            { // Scope for GetBuffer / ReleaseBuffer variables.
                uint8_t* data = nullptr;
                DWORD dwCaptureFlags;
                uint64_t devicePosition = 0;
                uint64_t qpcPosition = 0;

                // Get sample buffer
                check_hresult(m_audioCaptureClient->GetBuffer(&data, &framesAvailable, &dwCaptureFlags, &devicePosition, &qpcPosition));

                // Ensure that the buffer is released at scope exit, even if an exception occurs.
                auto release = scope_exit([&] { m_audioCaptureClient->ReleaseBuffer(framesAvailable); });

                if (dwCaptureFlags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY)
                {
                    // Pass down a discontinuity flag in case the app is interested and reset back to capturing
                    SetState(DeviceState::Discontinuity);
                    SetStateNoNotify(DeviceState::Capturing);
                }

                // Zero out sample if silence
                if (dwCaptureFlags & AUDCLNT_BUFFERFLAGS_SILENT)
                {
                    memset(data, 0, framesAvailable * m_mixFormat->nBlockAlign);
                }

                // Update plotter data
                array_view<uint8_t> dataBytes{ data, bytesToCapture };
                ProcessScopeData(dataBytes);

                // Write File and async store
                m_dataWriter.WriteBytes(dataBytes);

                // End of scope: Buffer is released back, and GetBuffer variables are no longer valid
            }

            // Increase the size of our 'data' chunk and bytes since last flush.  m_dataSize needs to be accurate but
            // m_bytesSinceLastFlush need only be an approximation.
            m_dataSize += bytesToCapture;
            m_bytesSinceLastFlush += bytesToCapture;

            if ((m_bytesSinceLastFlush > (m_mixFormat->nAvgBytesPerSec * FLUSH_INTERVAL / 1s)) && !m_writing)
            {
                // Set this flag when about to commit the async storage operation.  We don't want to
                // accidently call stop and finalize the WAV header or run into a scenario where the
                // store operation takes longer than FLUSH_INTERVAL as multiple concurrent calls
                // to StoreAsync() can cause an exception
                m_writing = true;

                // Reset the counter now since we can process more samples during the async callback
                m_bytesSinceLastFlush = 0;

                // Save the data we just wrote to the output file.
                AsyncStoreData();
            }
        }
    }

HRESULT OnFinishCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 405 of file WASAPICapture.cpp.

    {
        // FixWAVHeader will set the DeviceState::Stopped when all async tasks are complete
        FixWAVHeader();
        return S_OK;
    }

HRESULT OnSampleReady ( IMFAsyncResult * pResult ) [private]

Definition at line 417 of file WASAPICapture.cpp.

    {
        OnAudioSampleRequested();

        // Re-queue work item for next sample
        if (m_deviceState == DeviceState::Capturing)
        {
            check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_sampleReadyAsyncResult.get(), &m_sampleReadyKey));
        }

        return S_OK;
    }
    catch (...)
    {
        hresult error = to_hresult();
        SetState(DeviceState::Error, error);
        return error;
    }

HRESULT OnSendScopeData ( IMFAsyncResult * pResult ) [private]

Definition at line 591 of file WASAPICapture.cpp.

    {
        com_ptr<::IUnknown> points;
        check_hresult(pResult->GetState(points.put()));
        ReportPlotDataReady(points.as<IBuffer>());
        return S_OK;
    }
    catch (...)
    {
        return S_OK;
    }

HRESULT OnStartCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 310 of file WASAPICapture.cpp.

    {
        // Start the capture
        check_hresult(m_audioClient->Start());
        check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_sampleReadyAsyncResult.get(), &m_sampleReadyKey));
        SetState(DeviceState::Capturing);

        return S_OK;
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
        // Must return S_OK.
        return S_OK;
    }

HRESULT OnStopCapture ( IMFAsyncResult * pResult ) [private]

Definition at line 347 of file WASAPICapture.cpp.

    {
        // Stop capture by cancelling Work Item
        // Cancel the queued work item (if any)
        if (0 != m_sampleReadyKey)
        {
            MFCancelWorkItem(std::exchange(m_sampleReadyKey, 0));
        }

        m_sampleReadyAsyncResult = nullptr;
        if (m_audioClient)
        {
            m_audioClient->Stop();

            if (m_writing)
            {
                // A StoreAsync is already in progress. Let that one complete and finish the capture.
            }
            else
            {
                SetState(DeviceState::Flushing);
                AsyncStoreData();
            }
        }
        return S_OK;
    }
    catch (...) { return to_hresult(); }

void ProcessScopeData ( array_view< uint8_t > rawBytes ) [private]

Definition at line 548 of file WASAPICapture.cpp.

    {
        // There is no buffer if the data format is not one we support.
        // (For now, the only format we support is 16-bit audio.)
        if (m_plotDataBuffer == nullptr)
        {
            return;
        }

        uint32_t pointCount = rawBytes.size() / m_mixFormat->nChannels / (m_mixFormat->wBitsPerSample / BITS_PER_BYTE);

        auto plotData = reinterpret_cast<int16_t*>(m_plotDataBuffer.data());

        // Read the 16-bit samples from channel 0
        int16_t* pi16 = reinterpret_cast<int16_t*>(rawBytes.data());

        for (DWORD i = 0; m_plotDataPointsFilled < m_plotDataMaxPoints && i < pointCount; i++)
        {
            plotData[m_plotDataPointsFilled] = *pi16;
            pi16 += m_mixFormat->nChannels;

            m_plotDataPointsFilled++;
        }

        // Send off the event and get ready for the next set of samples
        if (m_plotDataPointsFilled == m_plotDataMaxPoints)
        {
            auto plotDataBuffer = std::exchange(m_plotDataBuffer, nullptr);
            m_plotDataPointsFilled = 0;

            plotDataBuffer.Length(m_plotDataMaxPoints * sizeof(int16_t));
            MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_SendScopeDataCallback, winrt::get_unknown(plotDataBuffer));

            // Create a new buffer to hold the next set of points.
            m_plotDataBuffer = Buffer(sizeof(int16_t) * m_plotDataMaxPoints);
        }
    }

void SetLowLatencyCapture ( bool value ) [inline]

Definition at line 25 of file WASAPICapture.h.

{ m_isLowLatency = value; }

Member Data Documentation

com_ptr<IAudioCaptureClient> m_audioCaptureClient [private]

Definition at line 78 of file WASAPICapture.h.

com_ptr<IAudioClient3> m_audioClient [private]

Definition at line 73 of file WASAPICapture.h.

uint32_t m_bufferFrames = 0 [private]

Definition at line 54 of file WASAPICapture.h.

uint32_t m_bytesSinceLastFlush = 0 [private]

Definition at line 65 of file WASAPICapture.h.

Windows::Storage::Streams::IRandomAccessStream m_contentStream [private]

Definition at line 69 of file WASAPICapture.h.

uint32_t m_dataSize = 0 [private]

Definition at line 64 of file WASAPICapture.h.

uint32_t m_defaultPeriodInFrames [private]

Definition at line 74 of file WASAPICapture.h.

uint32_t m_fundamentalPeriodInFrames [private]

Definition at line 75 of file WASAPICapture.h.

uint32_t m_headerSize = 0 [private]

Definition at line 63 of file WASAPICapture.h.

bool m_isLowLatency = false [private]

Definition at line 67 of file WASAPICapture.h.

slim_mutex m_lock [private]

Definition at line 60 of file WASAPICapture.h.

uint32_t m_maxPeriodInFrames [private]

Definition at line 76 of file WASAPICapture.h.

uint32_t m_minPeriodInFrames [private]

Definition at line 77 of file WASAPICapture.h.

unique_cotaskmem_ptr<WAVEFORMATEX> m_mixFormat [private]

Definition at line 71 of file WASAPICapture.h.

Windows::Storage::Streams::IOutputStream m_outputStream [private]

Definition at line 70 of file WASAPICapture.h.

Windows::Storage::Streams::IBuffer m_plotDataBuffer [private]

Definition at line 81 of file WASAPICapture.h.

uint32_t m_plotDataMaxPoints [private]

Definition at line 82 of file WASAPICapture.h.

uint32_t m_plotDataPointsFilled [private]

Definition at line 83 of file WASAPICapture.h.

com_ptr<IMFAsyncResult> m_sampleReadyAsyncResult [private]

Definition at line 79 of file WASAPICapture.h.

MFWORKITEM_KEY m_sampleReadyKey = 0 [private]

Definition at line 59 of file WASAPICapture.h.

bool m_writing = false [private]

Definition at line 66 of file WASAPICapture.h.

The documentation for this struct was generated from the following files:
  • WindowsAudioSession/cppwinrt/WASAPICapture.h
  • WindowsAudioSession/cppwinrt/WASAPICapture.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WASAPIRenderer Struct Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • winrt
  • SDKTemplate
  • WASAPIRenderer
Public Member Functions | Private Member Functions | Private Attributes

WASAPIRenderer Struct Reference

#include "WASAPIRenderer.h"

Inherits DeviceStateSourceT< WASAPIRenderer >.

List of all members.

Public Member Functions

STDMETHOD() | ActivateCompleted (IActivateAudioInterfaceAsyncOperation *operation) noexcept
void | AsyncInitializeAudioDevice () noexcept
HRESULT | PausePlaybackAsync ()
void | SetBackgroundAudio (bool value)
void | SetBufferDuration (REFERENCE_TIME value)
void | SetContentStream (Windows::Storage::Streams::IRandomAccessStream const &value)
void | SetContentType (ContentType value)
void | SetFrequency (double value)
void | SetHWOffload (bool value)
void | SetLowLatency (bool value)
void | SetRawAudio (bool value)
HRESULT | SetVolumeOnSession (double volume) noexcept
void | StartPlayback () noexcept
HRESULT | StopPlaybackAsync () noexcept

Private Member Functions

HRESULT | ConfigureDeviceInternal () noexcept
void | ConfigureSource ()
UINT32 | GetBufferFramesPerPeriod () noexcept
void | GetMFSample (uint32_t framesAvailable)
void | GetToneSample (uint32_t framesAvailable)
void | OnAudioSampleRequested (bool IsSilence=false)
HRESULT | OnPausePlayback (IMFAsyncResult *pResult)
HRESULT | OnSampleReady (IMFAsyncResult *pResult)
HRESULT | OnStartPlayback (IMFAsyncResult *pResult) noexcept
HRESULT | OnStopPlayback (IMFAsyncResult *pResult)
void | SetAudioClientChannelVolume ()
void | ValidateBufferValue ()

Private Attributes

com_ptr< IAudioClient3 > | m_AudioClient
com_ptr< IAudioRenderClient > | m_AudioRenderClient
uint32_t | m_BufferFrames = 0
float | m_channelVolume = 1.0f
winrt::Windows::Storage::Streams::IRandomAccessStream | m_ContentStream = nullptr
ContentType | m_contentType = ContentType::Tone
uint32_t | m_DefaultPeriodInFrames
hstring | m_DeviceIdString
double | m_Frequency = 0.0
uint32_t | m_FundamentalPeriodInFrames
REFERENCE_TIME | m_hnsBufferDuration = 0
bool | m_IsBackground = false
bool | m_IsHWOffload = false
bool | m_IsLowLatency = false
bool | m_IsRawAudio = false
slim_mutex | m_lock
uint32_t | m_MaxPeriodInFrames
com_ptr< MFSampleGenerator > | m_MFSource
uint32_t | m_MinPeriodInFrames
unique_cotaskmem_ptr
< WAVEFORMATEX > 		m_MixFormat
com_ptr< IMFAsyncResult > | m_SampleReadyAsyncResult
MFWORKITEM_KEY | m_SampleReadyKey
std::unique_ptr
< ToneSampleGenerator > 		m_ToneSource

Detailed Description

Definition at line 29 of file WASAPIRenderer.h.

Member Function Documentation

HRESULT ActivateCompleted ( IActivateAudioInterfaceAsyncOperation * operation )

Definition at line 45 of file WASAPIRenderer.cpp.

    {
        if (m_deviceState != DeviceState::Uninitialized)
        {
            throw hresult_error(E_NOT_VALID_STATE);
        }

        // Check for a successful activation result
        HRESULT hrActivateResult = S_OK;
        com_ptr<::IUnknown> punkAudioInterface;
        check_hresult(operation->GetActivateResult(&hrActivateResult, punkAudioInterface.put()));
        check_hresult(hrActivateResult);

        // Remember that we have been activated, but don't raise the event yet.
        SetStateNoNotify(DeviceState::Activated);

        // Get the pointer for the Audio Client
        m_AudioClient = punkAudioInterface.as<IAudioClient3>();

        // Configure user defined properties
        check_hresult(ConfigureDeviceInternal());

        // Initialize the AudioClient in Shared Mode with the user specified buffer
        if (!m_IsLowLatency || m_IsHWOffload)
        {
            check_hresult(m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                m_hnsBufferDuration,
                m_hnsBufferDuration,
                m_MixFormat.get(),
                nullptr));
        }
        else
        {
            check_hresult(m_AudioClient->InitializeSharedAudioStream(
                AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
                m_MinPeriodInFrames,
                m_MixFormat.get(),
                nullptr));
        }

        // Get the maximum size of the AudioClient Buffer
        check_hresult(m_AudioClient->GetBufferSize(&m_BufferFrames));

        // Get the render client
        m_AudioRenderClient.capture(m_AudioClient, &IAudioClient::GetService);

        // Create Async callback for sample events
        check_hresult(MFCreateAsyncResult(nullptr, &m_SampleReadyCallback, nullptr, m_SampleReadyAsyncResult.put()));

        // Sets the event handle that the system signals when an audio buffer is ready to be processed by the client
        check_hresult(m_AudioClient->SetEventHandle(m_SampleReadyEvent.get()));

        // Everything succeeded
        SetState(DeviceState::Initialized, S_OK);

        return S_OK;
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
        m_AudioClient = nullptr;
        m_AudioRenderClient = nullptr;
        m_SampleReadyAsyncResult = nullptr;

        // Must return S_OK even on failure.
        return S_OK;
    }

void AsyncInitializeAudioDevice ( )

Definition at line 23 of file WASAPIRenderer.cpp.

    {
        // Get a string representing the Default Audio Device Renderer
        m_DeviceIdString = MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default);

        // This call can be made safely from a background thread because we are asking for the IAudioClient3
        // interface of an audio device. Async operation will call back to
        // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
        com_ptr<IActivateAudioInterfaceAsyncOperation> asyncOp;
        check_hresult(ActivateAudioInterfaceAsync(m_DeviceIdString.c_str(), __uuidof(IAudioClient3), nullptr, this, asyncOp.put()));
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
    }

HRESULT ConfigureDeviceInternal ( ) [private]

Definition at line 150 of file WASAPIRenderer.cpp.

    {
        if (m_deviceState != DeviceState::Activated)
        {
            return E_NOT_VALID_STATE;
        }

        // Opt into HW Offloading.  If the endpoint does not support offload it will return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE
        AudioClientProperties audioProps = { 0 };
        audioProps.cbSize = sizeof(AudioClientProperties);
        audioProps.bIsOffload = m_IsHWOffload;
        audioProps.eCategory = AudioCategory_Media;

        if (m_IsRawAudio)
        {
            audioProps.Options = AUDCLNT_STREAMOPTIONS_RAW;
        }

        check_hresult(m_AudioClient->SetClientProperties(&audioProps));

        // If application already has a preferred source format available,
        // it can test whether the format is supported by the device:
        //
        // unique_cotaskmem_ptr<WAVEFORMATEX> applicationFormat = { ... };
        // if (S_OK == m_AudioClient->IsFormatSupported(applicationFormat.get()))
        // {
        //     m_MixFormat = std::move(applicationFormat);
        // }
        // else
        // {
        //     // device does not support the application format, so ask the device what format it prefers
        //     check_hresult(m_AudioClient->GetMixFormat(&m_MixFormat.put()));
        // }

        // This sample opens the device is shared mode so we need to find the supported WAVEFORMATEX mix format
        check_hresult(m_AudioClient->GetMixFormat(m_MixFormat.put()));

        if (!audioProps.bIsOffload)
        {
            // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
            // to be the current engine format based on the processing mode for this stream
            check_hresult(m_AudioClient->GetSharedModeEnginePeriod(m_MixFormat.get(), &m_DefaultPeriodInFrames, &m_FundamentalPeriodInFrames, &m_MinPeriodInFrames, &m_MaxPeriodInFrames));
        }

        // Verify the user defined value for hardware buffer
        ValidateBufferValue();

        return S_OK;
    }
    catch (...) { return to_hresult(); }

void ConfigureSource ( ) [private]

Definition at line 258 of file WASAPIRenderer.cpp.

    {
        UINT32 FramesPerPeriod = GetBufferFramesPerPeriod();

        switch (m_contentType)
        {
        case ContentType::Tone:
            // Generate the sine wave sample buffer
            m_ToneSource = std::make_unique<ToneSampleGenerator>();
            m_ToneSource->GenerateSampleBuffer(m_Frequency, FramesPerPeriod, m_MixFormat.get());
            break;

        case ContentType::File:
            m_MFSource = make_self<MFSampleGenerator>();
            // This will throw if the stream cannot be decoded.
            m_MFSource->Initialize(m_ContentStream, FramesPerPeriod, m_MixFormat.get());
            break;

        default:
            assert(false);
            std::terminate();
        }
    }

UINT32 GetBufferFramesPerPeriod ( ) [private]

Definition at line 119 of file WASAPIRenderer.cpp.

    {
        REFERENCE_TIME defaultDevicePeriod = 0;
        REFERENCE_TIME minimumDevicePeriod = 0;

        if (m_IsHWOffload)
        {
            return m_BufferFrames;
        }

        if (m_IsLowLatency)
        {
            return m_MinPeriodInFrames;
        }

        // Get the audio device period
        HRESULT hr = m_AudioClient->GetDevicePeriod(&defaultDevicePeriod, &minimumDevicePeriod);
        if (FAILED(hr))
        {
            return 0;
        }

        double devicePeriodInSeconds = defaultDevicePeriod / (10000.0 * 1000.0);
        return static_cast<UINT32>(m_MixFormat->nSamplesPerSec * devicePeriodInSeconds + 0.5);
    }

void GetMFSample ( uint32_t framesAvailable ) [private]

Definition at line 577 of file WASAPIRenderer.cpp.

    {
        BYTE* data = nullptr;

        // Post-Roll Silence
        if (m_MFSource->IsEOF())
        {
            check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
            // Ignore the return
            m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);

            StopPlaybackAsync();
        }
        else
        {
            uint32_t actualBytesRead = 0;
            uint32_t actualBytesToRead = framesAvailable * m_MixFormat->nBlockAlign;

            check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
            if (!m_MFSource->FillSampleBuffer({ data, actualBytesToRead }, &actualBytesRead))
            {
                // Hit EOS
                m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);
                StopPlaybackAsync();
            }
            else
            {
                // This can happen if we are pre-rolling so just insert silence
                if (0 == actualBytesRead)
                {
                    check_hresult(m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT));
                }
                else
                {
                    check_hresult(m_AudioRenderClient->ReleaseBuffer(actualBytesRead / m_MixFormat->nBlockAlign, 0));
                }
            }
        }
    }

void GetToneSample ( uint32_t framesAvailable ) [private]

Definition at line 545 of file WASAPIRenderer.cpp.

    {
        uint8_t* data;

        // Post-Roll Silence
        if (m_ToneSource->IsEOF())
        {
            check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
            // Ignore the return
            m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);

            StopPlaybackAsync();
        }
        else if (m_ToneSource->GetBufferLength() <= (framesAvailable * m_MixFormat->nBlockAlign))
        {
            uint32_t actualFramesToRead = m_ToneSource->GetBufferLength() / m_MixFormat->nBlockAlign;
            uint32_t actualBytesToRead = actualFramesToRead * m_MixFormat->nBlockAlign;

            check_hresult(m_AudioRenderClient->GetBuffer(actualFramesToRead, &data));
            if (actualBytesToRead > 0)
            {
                m_ToneSource->FillSampleBuffer({ data, actualBytesToRead });
            }
            check_hresult(m_AudioRenderClient->ReleaseBuffer(actualFramesToRead, 0));
        }
    }

void OnAudioSampleRequested ( bool IsSilence = false ) [private]

Definition at line 478 of file WASAPIRenderer.cpp.

    {

        auto guard = slim_lock_guard(m_lock);

        // Get padding in existing buffer
        UINT32 PaddingFrames = 0;
        check_hresult(m_AudioClient->GetCurrentPadding(&PaddingFrames));

        // GetCurrentPadding represents the number of queued frames
        // so we can subtract that from the overall number of frames we have
        uint32_t framesAvailable = m_BufferFrames - PaddingFrames;

        // Only continue if we have buffer to write data
        if (framesAvailable == 0)
        {
            return;
        }

        if (IsSilence)
        {
            // Fill the buffer with silence
            uint8_t* data;
            check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
            check_hresult(m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT));
            return;
        }

        // Even if we cancel a work item, this may still fire due to the async
        // nature of things.  There should be a queued work item already to handle
        // the process of stopping or stopped
        if (m_deviceState == DeviceState::Playing)
        {
            // Fill the buffer with a playback sample
            switch (m_contentType)
            {
            case ContentType::Tone:
                GetToneSample(framesAvailable);
                break;

            case ContentType::File:
                GetMFSample(framesAvailable);
                break;
            }
        }
    }
    catch (hresult_error const& error)
    {
        if (error.code() != AUDCLNT_E_RESOURCES_INVALIDATED)
        {
            throw;
        }

        // Attempt auto-recovery from loss of resources.
        SetStateNoNotify(DeviceState::Uninitialized);
        m_AudioClient = nullptr;
        m_AudioRenderClient = nullptr;
        m_SampleReadyAsyncResult = nullptr;

        AsyncInitializeAudioDevice();
    }

HRESULT OnPausePlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 441 of file WASAPIRenderer.cpp.

    {
        m_AudioClient->Stop();
        SetState(DeviceState::Paused, S_OK);

        return S_OK;
    }

HRESULT OnSampleReady ( IMFAsyncResult * pResult ) [private]

Definition at line 454 of file WASAPIRenderer.cpp.

    {
        OnAudioSampleRequested(false);

        // Re-queue work item for next sample
        if (m_deviceState == DeviceState::Playing)
        {
            check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_SampleReadyAsyncResult.get(), &m_SampleReadyKey));
        }

        return S_OK;
    }
    catch (...)
    {
        hresult error = to_hresult();
        SetState(DeviceState::Error, error);
        return error;
    }

HRESULT OnStartPlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 323 of file WASAPIRenderer.cpp.

    {
        // Pre-Roll the buffer with silence
        OnAudioSampleRequested(true);

        // For MF Source playback, need to start the source reader
        if (m_contentType == ContentType::File)
        {
            m_MFSource->StartSource();
        }

        // Set the initial volume.
        SetAudioClientChannelVolume();

        // Actually start the playback
        check_hresult(m_AudioClient->Start());

        SetState(DeviceState::Playing, S_OK);
        check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_SampleReadyAsyncResult.get(), &m_SampleReadyKey));

        return S_OK;
    }
    catch (...)
    {
        SetState(DeviceState::Error, to_hresult());
        // Must return S_OK.
        return S_OK;
    }

HRESULT OnStopPlayback ( IMFAsyncResult * pResult ) [private]

Definition at line 376 of file WASAPIRenderer.cpp.

    {
        // Stop playback by cancelling Work Item
        // Cancel the queued work item (if any)
        if (0 != m_SampleReadyKey)
        {
            MFCancelWorkItem(m_SampleReadyKey);
            m_SampleReadyKey = 0;
        }

        // Flush anything left in buffer with silence, best effort.
        try
        {
            OnAudioSampleRequested(true);
        }
        catch (...) { }

        m_AudioClient->Stop();
        m_SampleReadyAsyncResult = nullptr;

        switch (m_contentType)
        {
        case ContentType::Tone:
            // Flush remaining buffers
            m_ToneSource->Flush();
            break;

        case ContentType::File:
            // Stop Source and Flush remaining buffers
            m_MFSource->StopSource();
            m_MFSource->Shutdown();
            break;
        }

        SetState(DeviceState::Stopped);

        return S_OK;
    }

HRESULT PausePlaybackAsync ( )

Definition at line 420 of file WASAPIRenderer.cpp.

    {
        if ((m_deviceState != DeviceState::Playing) &&
            (m_deviceState != DeviceState::Error))
        {
            return E_NOT_VALID_STATE;
        }

        // Change state to stop automatic queueing of samples
        // Don't notify clients.
        SetStateNoNotify(DeviceState::Pausing);

        return MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_PausePlaybackCallback, nullptr);

    }

void SetAudioClientChannelVolume ( ) [private]

Definition at line 247 of file WASAPIRenderer.cpp.

    {
        check_hresult(capture<ISimpleAudioVolume>(m_AudioClient, &IAudioClient3::GetService)->SetMasterVolume(m_channelVolume, nullptr));
    }

void SetBackgroundAudio ( bool value ) [inline]

Definition at line 35 of file WASAPIRenderer.h.

{ m_IsBackground = value; }

void SetBufferDuration ( REFERENCE_TIME value ) [inline]

Definition at line 38 of file WASAPIRenderer.h.

{ m_hnsBufferDuration = value; }

void SetContentStream ( Windows::Storage::Streams::IRandomAccessStream const & value ) [inline]

Definition at line 33 of file WASAPIRenderer.h.

{ m_ContentStream = value; }

void SetContentType ( ContentType value ) [inline]

Definition at line 31 of file WASAPIRenderer.h.

{ m_contentType = value; }

void SetFrequency ( double value ) [inline]

Definition at line 32 of file WASAPIRenderer.h.

{ m_Frequency = value; }

void SetHWOffload ( bool value ) [inline]

Definition at line 34 of file WASAPIRenderer.h.

{ m_IsHWOffload = value; }

void SetLowLatency ( bool value ) [inline]

Definition at line 37 of file WASAPIRenderer.h.

{ m_IsLowLatency = value; }

void SetRawAudio ( bool value ) [inline]

Definition at line 36 of file WASAPIRenderer.h.

{ m_IsRawAudio = value; }

HRESULT SetVolumeOnSession ( double volume )

Definition at line 232 of file WASAPIRenderer.cpp.

    {
        // Convert [0.100] to [0..1] range and clamp
        m_channelVolume = (volumePercent < 0.0) ? 0.0f : (volumePercent > 100.0) ? 1.0f : (float)(volumePercent / 100.0);

        // Set the session volume on the endpoint if we have one.
        if (m_AudioClient)
        {
            SetAudioClientChannelVolume();
        }

        return S_OK;
    }
    catch (...) { return to_hresult(); }

void StartPlayback ( )

Definition at line 288 of file WASAPIRenderer.cpp.

    {
        switch (m_deviceState)
        {
        // We should be stopped if the user stopped playback, or we should be
        // initialized if this is the first time through getting ready to playback.
        case DeviceState::Stopped:
        case DeviceState::Initialized:
            // Setup either ToneGeneration or File Playback
            ConfigureSource();

            SetState(DeviceState::Starting, S_OK);
            check_hresult(MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StartPlaybackCallback, nullptr));
            break;

        case DeviceState::Paused:
            check_hresult(MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StartPlaybackCallback, nullptr));
            break;

        default:
            // Otherwise something else happened
            throw hresult_error(E_FAIL);
        }
    }
    catch (...)
    {
        hresult error = to_hresult();
        SetState(DeviceState::Error, error);
    }

HRESULT StopPlaybackAsync ( )

Definition at line 357 of file WASAPIRenderer.cpp.

    {
        if ((m_deviceState != DeviceState::Playing) &&
            (m_deviceState != DeviceState::Paused) &&
            (m_deviceState != DeviceState::Error))
        {
            return E_NOT_VALID_STATE;
        }

        SetState(DeviceState::Stopping, S_OK);

        return MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StopPlaybackCallback, nullptr);
    }

void ValidateBufferValue ( ) [private]

Definition at line 207 of file WASAPIRenderer.cpp.

    {
        if (!m_IsHWOffload)
        {
            // If we aren't using HW Offload, set this to 0 to use the default value
            m_hnsBufferDuration = 0;
            return;
        }

        REFERENCE_TIME hnsMinBufferDuration;
        REFERENCE_TIME hnsMaxBufferDuration;

        check_hresult(m_AudioClient->GetBufferSizeLimits(m_MixFormat.get(), true, &hnsMinBufferDuration, &hnsMaxBufferDuration));
        if (m_hnsBufferDuration < hnsMinBufferDuration)
        {
            // using MINIMUM size instead
            m_hnsBufferDuration = hnsMinBufferDuration;
        }
        else if (m_hnsBufferDuration > hnsMaxBufferDuration)
        {
            // using MAXIMUM size instead
            m_hnsBufferDuration = hnsMaxBufferDuration;
        }
    }

Member Data Documentation

com_ptr<IAudioClient3> m_AudioClient [private]

Definition at line 88 of file WASAPIRenderer.h.

com_ptr<IAudioRenderClient> m_AudioRenderClient [private]

Definition at line 89 of file WASAPIRenderer.h.

uint32_t m_BufferFrames = 0 [private]

Definition at line 73 of file WASAPIRenderer.h.

float m_channelVolume = 1.0f [private]

Definition at line 86 of file WASAPIRenderer.h.

winrt::Windows::Storage::Streams::IRandomAccessStream m_ContentStream = nullptr [private]

Definition at line 99 of file WASAPIRenderer.h.

ContentType m_contentType = ContentType::Tone [private]

Definition at line 92 of file WASAPIRenderer.h.

uint32_t m_DefaultPeriodInFrames [private]

Definition at line 82 of file WASAPIRenderer.h.

hstring m_DeviceIdString [private]

Definition at line 72 of file WASAPIRenderer.h.

double m_Frequency = 0.0 [private]

Definition at line 98 of file WASAPIRenderer.h.

uint32_t m_FundamentalPeriodInFrames [private]

Definition at line 83 of file WASAPIRenderer.h.

REFERENCE_TIME m_hnsBufferDuration = 0 [private]

Definition at line 97 of file WASAPIRenderer.h.

bool m_IsBackground = false [private]

Definition at line 94 of file WASAPIRenderer.h.

bool m_IsHWOffload = false [private]

Definition at line 93 of file WASAPIRenderer.h.

bool m_IsLowLatency = false [private]

Definition at line 96 of file WASAPIRenderer.h.

bool m_IsRawAudio = false [private]

Definition at line 95 of file WASAPIRenderer.h.

slim_mutex m_lock [private]

Definition at line 79 of file WASAPIRenderer.h.

uint32_t m_MaxPeriodInFrames [private]

Definition at line 84 of file WASAPIRenderer.h.

com_ptr<MFSampleGenerator> m_MFSource [private]

Definition at line 102 of file WASAPIRenderer.h.

uint32_t m_MinPeriodInFrames [private]

Definition at line 85 of file WASAPIRenderer.h.

unique_cotaskmem_ptr<WAVEFORMATEX> m_MixFormat [private]

Definition at line 81 of file WASAPIRenderer.h.

com_ptr<IMFAsyncResult> m_SampleReadyAsyncResult [private]

Definition at line 90 of file WASAPIRenderer.h.

MFWORKITEM_KEY m_SampleReadyKey [private]

Definition at line 76 of file WASAPIRenderer.h.

std::unique_ptr<ToneSampleGenerator> m_ToneSource [private]

Definition at line 101 of file WASAPIRenderer.h.

The documentation for this struct was generated from the following files:
  • WindowsAudioSession/cppwinrt/WASAPIRenderer.h
  • WindowsAudioSession/cppwinrt/WASAPIRenderer.cpp
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WorldCeilingMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

WorldCeilingMesh Class Reference

#include "WorldMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

WorldCeilingMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device)

Detailed Description

Definition at line 23 of file WorldMesh.h.

Constructor & Destructor Documentation

WorldCeilingMesh ( _In_ winrt::com_ptr< ID3D11Device3 > const & device )

Definition at line 18 of file WorldMesh.cpp.

{
    static constexpr PNTVertex cellVertices[] =
    {
        // CEILING
        {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(-0.15f, 0.0f)},
        {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(1.25f, 0.0f)},
        {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(-0.15f, 2.1f)},
        {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(1.25f, 2.1f)},
    };

    static constexpr WORD cellIndices[] = {
        0, 1, 2,
        1, 3, 2,
    };

    m_vertexCount = 4;
    m_indexCount = 6;

    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellVertices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(WORD) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellIndices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WorldFloorMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

WorldFloorMesh Class Reference

#include "WorldMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

WorldFloorMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device)

Detailed Description

Definition at line 34 of file WorldMesh.h.

Constructor & Destructor Documentation

WorldFloorMesh ( _In_ winrt::com_ptr< ID3D11Device3 > const & device )

Definition at line 59 of file WorldMesh.cpp.

{
    static constexpr PNTVertex cellVertices[] =
    {
        // FLOOR
        {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(1.0f, 0.0f)},
        {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
        {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(1.0f, 1.5f)},
    };

    static constexpr WORD cellIndices[] = {
        0, 1, 2,
        1, 3, 2,
    };

    m_vertexCount = 4;
    m_indexCount = 6;

    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellVertices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(WORD) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellIndices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WorldWallsMesh Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

WorldWallsMesh Class Reference

#include "WorldMesh.h"

Inherits MeshObject.

List of all members.

Public Member Functions

WorldWallsMesh (_In_ winrt::com_ptr< ID3D11Device3 > const &device)

Detailed Description

Definition at line 45 of file WorldMesh.h.

Constructor & Destructor Documentation

WorldWallsMesh ( _In_ winrt::com_ptr< ID3D11Device3 > const & device )

Definition at line 100 of file WorldMesh.cpp.

{
    static constexpr PNTVertex cellVertices[] =
    {
        // WALL
        {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(2.0f, 0.0f)},
        {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(0.0f, 1.5f)},
        {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(2.0f, 1.5f)},
        // WALL
        {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 0.0f)},
        {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
        {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 1.5f)},
        // WALL
        {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(2.0f, 0.0f)},
        {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 1.5f)},
        {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(2.0f, 1.5f)},
        // WALL
        {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
        {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 0.0f)},
        {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
        {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 1.5f)},
    };

    static constexpr WORD cellIndices[] = {
         0,  1,  2,
         1,  3,  2,
         4,  5,  6,
         5,  7,  6,
         8,  9, 10,
         9, 11, 10,
        12, 13, 14,
        13, 15, 14,
    };

    m_vertexCount = 16;
    m_indexCount = 24;

    D3D11_BUFFER_DESC bd = { 0 };
    D3D11_SUBRESOURCE_DATA initData = { 0 };

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
    bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellVertices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
        );

    bd.Usage = D3D11_USAGE_DEFAULT;
    bd.ByteWidth = sizeof(WORD) * m_indexCount;
    bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
    bd.CPUAccessFlags = 0;
    initData.pSysMem = cellIndices;
    winrt::check_hresult(
        device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
        );
}

The documentation for this class was generated from the following files:
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h
  • Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WrlFinal Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions

WrlFinal Class Reference

List of all members.

Public Member Functions

STDMETHODIMP GetActivationFactory (_In_ HSTRING activatableClassId, _COM_Outptr_ IInspectable **factory)

Detailed Description

Definition at line 14 of file module.cpp.

Member Function Documentation

STDMETHODIMP GetActivationFactory | ( | _In_ HSTRING | activatableClassId,
 |  | _COM_Outptr_ IInspectable ** | factory |
 | ) |  |  | [inline]

Definition at line 17 of file module.cpp.

    {
        *factory = nullptr;
        ComPtr<IActivationFactory> activationFactory;
        HRESULT hr = Module<InProc>::GetModule().GetActivationFactory(activatableClassId, &activationFactory);
        if (SUCCEEDED(hr))
        {
            *factory = activationFactory.Detach();
        }
        return hr;
    }

The documentation for this class was generated from the following file:
  • WRLOutOfProcessWinRTComponent/cpp/Server/module.cpp
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WRLInProcessWinRTComponent
  • CustomException
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CustomException Class Reference

List of all members.

Public Member Functions

CustomException ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 17 of file Scenario2_CustomException.xaml.cs.

Constructor & Destructor Documentation

CustomException ( ) [inline]

Definition at line 23 of file Scenario2_CustomException.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 33 of file Scenario2_CustomException.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle a Windows Runtime error originated by the Oven Windows Runtime component.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 42 of file Scenario2_CustomException.xaml.cs.

        {
            Oven myOven = new Oven();

            try
            {
                // Intentionally pass a bad parameter
                myOven.ConfigurePreheatTemperature((OvenTemperature)5);
            }
            catch (System.ArgumentException)
            {
                CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_CustomException.xaml.cs.

The documentation for this class was generated from the following file:
  • WRLInProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OvenClient Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WRLInProcessWinRTComponent
  • OvenClient
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OvenClient Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

OvenClient ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | BreadCompletedHandler1 (Oven oven, BreadBakedEventArgs args)
async void | BreadCompletedHandler2 (Oven oven, BreadBakedEventArgs bread)
async void | BreadCompletedHandler3 (Oven oven, BreadBakedEventArgs bread)
void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

Oven | _myOven = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario1_OvenClient.xaml.cs.

Constructor & Destructor Documentation

OvenClient ( ) [inline]

Definition at line 30 of file Scenario1_OvenClient.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void BreadCompletedHandler1 | ( | Oven | oven,
 |  | BreadBakedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 1: Invoked\n";
                    OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
                    OvenClientOutput.Text += "Event Handler 1: BreadBakedEventArgs flavor is: " + args.Bread.Flavor + "\n";
                };

            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

async void BreadCompletedHandler2 | ( | Oven | oven,
 |  | BreadBakedEventArgs | bread |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 2: Invoked\n";
                };
            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

async void BreadCompletedHandler3 | ( | Oven | oven,
 |  | BreadBakedEventArgs | bread |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario1_OvenClient.xaml.cs.

        {
            // Event handler 3 was removed and will not be invoked
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 3: Invoked\n";
                };

            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file Scenario1_OvenClient.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Use the custom Oven and BreadBakedEventArgs Windows Runtime components.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 49 of file Scenario1_OvenClient.xaml.cs.

        {
            // Component Creation
            if (_myOven == null)
            {
                Dimensions dimensions;
                dimensions.Width = 2;
                dimensions.Height = 2;
                dimensions.Depth = 2;

                _myOven = new Oven(dimensions);
            }

            // Getters and setters are accessed using property syntax
            OvenClientOutput.Text += "Oven volume is: " + _myOven.Volume.ToString() + "\n";

            // Register even listeners
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler1);
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler2);
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);

            // Unregister from an event using the -= syntax and a delegate instance
            _myOven.BreadBaked -= new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);

            // Bake a loaf of bread. This will trigger the BreadBaked event.
            _myOven.BakeBread("Sourdough");

            // Trigger the event again with a different preheat time
            _myOven.ConfigurePreheatTemperature(OvenTemperature.High);
            _myOven.BakeBread("Wheat");
        }

Member Data Documentation

Oven _myOven = null [private]

Definition at line 28 of file Scenario1_OvenClient.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_OvenClient.xaml.cs.

The documentation for this class was generated from the following file:
  • WRLInProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomException Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WRLOutOfProcessWinRTComponent
  • CustomException
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

CustomException Class Reference

List of all members.

Public Member Functions

CustomException ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 17 of file Scenario2_CustomException.xaml.cs.

Constructor & Destructor Documentation

CustomException ( ) [inline]

Definition at line 23 of file Scenario2_CustomException.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 33 of file Scenario2_CustomException.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Handle a Windows Runtime error originated by the Oven Windows Runtime component.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 42 of file Scenario2_CustomException.xaml.cs.

        {
            Oven myOven = new Oven();

            try
            {
                // Intentionally pass a bad parameter
                myOven.ConfigurePreheatTemperature((OvenTemperature)5);
            }
            catch (System.ArgumentException)
            {
                CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
            }
        }

Member Data Documentation

MainPage rootPage = MainPage.Current [private]

Definition at line 21 of file Scenario2_CustomException.xaml.cs.

The documentation for this class was generated from the following file:
  • WRLOutOfProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OvenClient Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • WRLOutOfProcessWinRTComponent
  • OvenClient
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

OvenClient Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

OvenClient ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | BreadCompletedHandler1 (Oven oven, BreadBakedEventArgs args)
async void | BreadCompletedHandler2 (Oven oven, BreadBakedEventArgs bread)
async void | BreadCompletedHandler3 (Oven oven, BreadBakedEventArgs bread)
void | Start_Click (object sender, RoutedEventArgs e)

Private Attributes

Oven | _myOven = null
MainPage | rootPage = MainPage.Current

Detailed Description

Definition at line 21 of file Scenario1_OvenClient.xaml.cs.

Constructor & Destructor Documentation

OvenClient ( ) [inline]

Definition at line 30 of file Scenario1_OvenClient.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

async void BreadCompletedHandler1 | ( | Oven | oven,
 |  | BreadBakedEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 81 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 1: Invoked\n";
                    OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
                    OvenClientOutput.Text += "Event Handler 1: Bread flavor is: " + args.Bread.Flavor + "\n";
                };

            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

async void BreadCompletedHandler2 | ( | Oven | oven,
 |  | BreadBakedEventArgs | bread |
 | ) |  |  | [inline, private]

Definition at line 93 of file Scenario1_OvenClient.xaml.cs.

        {
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 2: Invoked\n";
                };
            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

async void BreadCompletedHandler3 | ( | Oven | oven,
 |  | BreadBakedEventArgs | bread |
 | ) |  |  | [inline, private]

Definition at line 102 of file Scenario1_OvenClient.xaml.cs.

        {
            // Event handler 3 was removed and will not be invoked
            Action updateOutputText = () =>
                {
                    OvenClientOutput.Text += "Event Handler 3: Invoked\n";
                };

            await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 40 of file Scenario1_OvenClient.xaml.cs.

        {
        }

void Start_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Use the custom Oven and BreadBakedEventArgs Windows Runtime components.

Parameters:
sender | Contains information about the button that fired the event.
e | Contains state information and event data associated with a routed event.

Definition at line 49 of file Scenario1_OvenClient.xaml.cs.

        {
            // Component Creation
            if (_myOven == null)
            {
                Dimensions dimensions;
                dimensions.Width = 2;
                dimensions.Height = 2;
                dimensions.Depth = 2;

                _myOven = new Oven(dimensions);
            }

            // Getters and setters are accessed using property syntax
            OvenClientOutput.Text += "Oven volume is: " + _myOven.Volume.ToString() + "\n";

            // Register even listeners
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler1);
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler2);
            _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);

            // Unregister from an event using the -= syntax and a delegate instance
            _myOven.BreadBaked -= new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);

            // Bake a loaf of bread. This will trigger the BreadBaked event.
            _myOven.BakeBread("Sourdough");

            // Trigger the event again with a different preheat time
            _myOven.ConfigurePreheatTemperature(OvenTemperature.High);
            _myOven.BakeBread("Wheat");
        }

Member Data Documentation

Oven _myOven = null [private]

Definition at line 28 of file Scenario1_OvenClient.xaml.cs.

MainPage rootPage = MainPage.Current [private]

Definition at line 25 of file Scenario1_OvenClient.xaml.cs.

The documentation for this class was generated from the following file:
  • WRLOutOfProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicTests Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • BasicTests
Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes

BasicTests Class Reference

List of all members.

Public Member Functions

BasicTests ()

Public Attributes

xBindSampleModel.IEmployee NullEmployee
String | NullStringProperty

Properties

CSharpModel | CSharpModel [get, set]
String | DPOnPage [get, set]
static DependencyProperty | DPOnPageProperty [get]
DataModel | Model [get, set]
int | MyInt [get, set]

Private Member Functions

void | InitializeValues ()
void | ResetValuesClick (object sender, RoutedEventArgs e)
void | UpdateValuesClick (object sender, RoutedEventArgs e)

Private Attributes

const string | DPOnPageName = "DPOnPage"

Static Private Attributes

static readonly DependencyProperty | _DPOnPage

Detailed Description

Definition at line 10 of file BasicTests.xaml.cs.

Constructor & Destructor Documentation

BasicTests ( ) [inline]

Definition at line 30 of file BasicTests.xaml.cs.

        {
            this.Model = new DataModel();
            this.CSharpModel = new CSharpModel();
            this.InitializeComponent();
            InitializeValues();
        }

Member Function Documentation

void InitializeValues ( ) [inline, private]

Definition at line 38 of file BasicTests.xaml.cs.

        {
            this.DPOnPage = "DP on page";
        }

void ResetValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 50 of file BasicTests.xaml.cs.

        {
            this.Model.InitializeValues();
            this.CSharpModel.InitializeValues();
            this.InitializeValues();
        }

void UpdateValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 43 of file BasicTests.xaml.cs.

        {
            this.Model.UpdateValues();
            this.CSharpModel.UpdateValues();
            this.DPOnPage += "-";
        }

Member Data Documentation

readonly DependencyProperty _DPOnPage [static, private]
Initial value:
        DependencyProperty.Register(DPOnPageName, typeof(int), typeof(DataModel), new PropertyMetadata(0))

Definition at line 24 of file BasicTests.xaml.cs.

const string DPOnPageName = "DPOnPage" [private]

Definition at line 23 of file BasicTests.xaml.cs.

xBindSampleModel.IEmployee NullEmployee

Definition at line 27 of file BasicTests.xaml.cs.

String NullStringProperty

Definition at line 28 of file BasicTests.xaml.cs.

Property Documentation

CSharpModel CSharpModel [get, set]

Definition at line 15 of file BasicTests.xaml.cs.

String DPOnPage [get, set]

Definition at line 18 of file BasicTests.xaml.cs.

DependencyProperty DPOnPageProperty [static, get]

Definition at line 22 of file BasicTests.xaml.cs.

DataModel Model [get, set]

Definition at line 13 of file BasicTests.xaml.cs.

int MyInt [get, set]

Definition at line 12 of file BasicTests.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/BasicTests.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ColorEntry Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • ColorEntry
Public Member Functions | Properties

ColorEntry Class Reference

List of all members.

Public Member Functions

SolidColorBrush | Brushify (Color c)

Properties

Color | Color [get, set]
string | ColorName [get, set]

Detailed Description

Definition at line 156 of file Functions.xaml.cs.

Member Function Documentation

SolidColorBrush Brushify ( Color c ) [inline]

Definition at line 161 of file Functions.xaml.cs.

        {
            return new SolidColorBrush(c);
        }

Property Documentation

Color Color [get, set]

Definition at line 159 of file Functions.xaml.cs.

string ColorName [get, set]

Definition at line 158 of file Functions.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/Functions.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CSharpModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • CSharpModel
Public Member Functions | Public Attributes | Private Member Functions

CSharpModel Class Reference

List of all members.

Public Member Functions

CSharpModel ()

Public Attributes

int | IntField
string | StringField

Private Member Functions

internal void | InitializeValues ()
internal void | UpdateValues ()

Detailed Description

Definition at line 5 of file CSharpModel.cs.

Constructor & Destructor Documentation

CSharpModel ( ) [inline]

Definition at line 10 of file CSharpModel.cs.

        {
            InitializeValues();
        }

Member Function Documentation

internal void InitializeValues ( ) [inline, private]

Definition at line 15 of file CSharpModel.cs.

        {
            StringField = "Simple string field";
            IntField = 2;
        }

internal void UpdateValues ( ) [inline, private]

Definition at line 21 of file CSharpModel.cs.

        {
            this.IntField = IntField + 1 % 10;

            string ms = " " + DateTime.Now.Millisecond.ToString();
            this.StringField += ms;
        }

Member Data Documentation

int IntField

Definition at line 7 of file CSharpModel.cs.

string StringField

Definition at line 8 of file CSharpModel.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/CSharpModel.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EventTests Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • EventTests
Public Member Functions | Public Attributes | Properties | Private Member Functions

EventTests Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

EventTests ()

Public Attributes

RoutedEventHandler | clickDelegate

Properties

DataModel | Model [get, set]

Private Member Functions

void | Click_BaseArgs (object sender, object e)
void | Click_NoArgs ()
void | Click_RegularArgs (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 14 of file EventTests.xaml.cs.

Constructor & Destructor Documentation

EventTests ( ) [inline]

Definition at line 19 of file EventTests.xaml.cs.

        {
            this.InitializeComponent();
            this.Model = new DataModel();
            clickDelegate = this.Click_RegularArgs;
        }

Member Function Documentation

void Click_BaseArgs | ( | object | sender,
 |  | object | e |
 | ) |  |  | [inline, private]

Definition at line 38 of file EventTests.xaml.cs.

        {
            MessageDialog dlg = new MessageDialog("Clicked - Base args");
            var t = dlg.ShowAsync();
        }

void Click_NoArgs ( ) [inline, private]

Definition at line 32 of file EventTests.xaml.cs.

        {
            MessageDialog dlg = new MessageDialog("Clicked - No args");
            var t = dlg.ShowAsync();
        }

void Click_RegularArgs | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 26 of file EventTests.xaml.cs.

        {
            MessageDialog dlg = new MessageDialog("Clicked - Regular Args");
            var t = dlg.ShowAsync();
        }

Member Data Documentation

RoutedEventHandler clickDelegate

Definition at line 17 of file EventTests.xaml.cs.

Property Documentation

DataModel Model [get, set]

Definition at line 16 of file EventTests.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/EventTests.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Functions Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • Functions
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes

Functions Class Reference

List of all members.

Public Member Functions

Functions ()
string | ColorValue (double red, double green, double blue)
string | CountEmployees (IEmployee e)
int | CountEmployeesinternal (IEmployee e)
SolidColorBrush | MakeColor (double red, double green, double blue)
void | ProcessColor (string value)
Visibility | ShowPlaceholder (int count)

Static Public Member Functions

static SolidColorBrush | TextColor (Color c)

Public Attributes

xBindSampleModel.IEmployee NullEmployee
String | NullStringProperty

Properties

CSharpModel | CSharpModel [get, set]
DataModel | Model [get, set]

Private Member Functions

void | ClearColorsClick (object sender, RoutedEventArgs e)
string | countVowels (string words)
string | Display (string stringArg, int intArg, double floatArg, bool boolArg)
string | GetTime ()
void | InitializeValues ()
void | PopulateColorsClick (object sender, RoutedEventArgs e)
void | ResetValuesClick (object sender, RoutedEventArgs e)
void | UpdateValuesClick (object sender, RoutedEventArgs e)

Private Attributes

ObservableCollection< ColorEntry > | ColorEntries = new ObservableCollection<ColorEntry>()

Detailed Description

Definition at line 14 of file Functions.xaml.cs.

Constructor & Destructor Documentation

Functions ( ) [inline]

Definition at line 28 of file Functions.xaml.cs.

        {
            this.Model = new DataModel();
            this.CSharpModel = new CSharpModel();
            this.InitializeComponent();
            InitializeValues();
        }

Member Function Documentation

void ClearColorsClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 138 of file Functions.xaml.cs.

        {
            ColorEntries.Clear();
        }

string ColorValue | ( | double | red,
 |  | double | green,
 |  | double | blue |
 | ) |  |  | [inline]

Definition at line 99 of file Functions.xaml.cs.

        {
            return $"#{(int)red:X}{(int)green:X}{(int)blue:X}";
        }

string CountEmployees ( IEmployee e ) [inline]

Definition at line 78 of file Functions.xaml.cs.

        {
            return CountEmployeesinternal(e).ToString();
        }

int CountEmployeesinternal ( IEmployee e ) [inline]

Definition at line 83 of file Functions.xaml.cs.

        {
            int result = 1;
            if (e is Manager)
                foreach (IEmployee c in ((Manager)e).ReportsList)
                {
                    result += CountEmployeesinternal(c);
                }
            return result;
        }

string countVowels ( string words ) [inline, private]

Definition at line 65 of file Functions.xaml.cs.

        {
            int count = 0;
            foreach (char c in words.ToLower())
            {
                if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
                {
                    count++;
                }
            }
            return count.ToString();
        }

string Display | ( | string | stringArg,
 |  | int | intArg,
 |  | double | floatArg,
 |  | bool | boolArg |
 | ) |  |  | [inline, private]

Definition at line 60 of file Functions.xaml.cs.

        {
            return $"String is: {stringArg}, Integer is: {intArg}, Float is: {floatArg}, Boolean is {boolArg}";
        }

string GetTime ( ) [inline, private]

Definition at line 55 of file Functions.xaml.cs.

        {
            return DateTime.Now.ToString();
        }

void InitializeValues ( ) [inline, private]

Definition at line 37 of file Functions.xaml.cs.

        {
        }

SolidColorBrush MakeColor | ( | double | red,
 |  | double | green,
 |  | double | blue |
 | ) |  |  | [inline]

Definition at line 94 of file Functions.xaml.cs.

        {
            return new SolidColorBrush(Color.FromArgb(255, (byte)red, (byte)green, (byte)blue));
        }

void PopulateColorsClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 125 of file Functions.xaml.cs.

        {
            foreach (var p in typeof(Windows.UI.Colors).GetTypeInfo().DeclaredProperties)
            {
                if (p.PropertyType == typeof(Color))
                {
                    ColorEntry ce = new ColorEntry() { ColorName = p.Name };
                    ce.Color = (Color)p.GetMethod.Invoke(null, new object[0]);
                    ColorEntries.Add(ce);
                }
            }
        }

void ProcessColor ( string value ) [inline]

Definition at line 104 of file Functions.xaml.cs.

        {
            try
            {
                if (value.Length == 7 && value.StartsWith("#"))
                {
                    int red = int.Parse(value.Substring(1, 2), System.Globalization.NumberStyles.HexNumber);
                    int green = int.Parse(value.Substring(3, 2), System.Globalization.NumberStyles.HexNumber);
                    int blue = int.Parse(value.Substring(5, 2), System.Globalization.NumberStyles.HexNumber);

                    RedSlider.Value = red;
                    GreenSlider.Value = green;
                    BlueSlider.Value = blue;
                }
            }
            catch (Exception ex)
            {
                // raise error in the application
            }
        }

void ResetValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 47 of file Functions.xaml.cs.

        {
            this.Model.InitializeValues();
            this.CSharpModel.InitializeValues();
            this.InitializeValues();
        }

Visibility ShowPlaceholder ( int count ) [inline]

Definition at line 144 of file Functions.xaml.cs.

        {
            return (count > 0) ? Visibility.Collapsed : Visibility.Visible;
        }

static SolidColorBrush TextColor ( Color c ) [inline, static]

Definition at line 149 of file Functions.xaml.cs.

        {
            return new SolidColorBrush(((c.R * 0.299 + c.G * 0.587 + c.B * 0.114) > 150) ? Colors.Black : Colors.White);
        }

void UpdateValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 41 of file Functions.xaml.cs.

        {
            this.Model.UpdateValues();
            this.CSharpModel.UpdateValues();
        }

Member Data Documentation

ObservableCollection<ColorEntry> ColorEntries = new ObservableCollection<ColorEntry>() [private]

Definition at line 24 of file Functions.xaml.cs.

xBindSampleModel.IEmployee NullEmployee

Definition at line 21 of file Functions.xaml.cs.

String NullStringProperty

Definition at line 22 of file Functions.xaml.cs.

Property Documentation

CSharpModel CSharpModel [get, set]

Definition at line 19 of file Functions.xaml.cs.

DataModel Model [get, set]

Definition at line 17 of file Functions.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/Functions.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ListsAndTemplates Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • ListsAndTemplates
Public Member Functions | Public Attributes | Properties | Private Member Functions

ListsAndTemplates Class Reference

List of all members.

Public Member Functions

ListsAndTemplates ()

Public Attributes

List< IEmployee > | Employees = new List<IEmployee>()

Properties

DataModel | Model [get, set]

Private Member Functions

void | InitializeValues ()
void | ResetValuesClick (object sender, RoutedEventArgs e)
void | UpdateValuesClick (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 9 of file ListsAndTemplates.xaml.cs.

Constructor & Destructor Documentation

ListsAndTemplates ( ) [inline]

Definition at line 15 of file ListsAndTemplates.xaml.cs.

        {
            this.Model = new DataModel();
            this.InitializeComponent();
            InitializeValues();
        }

Member Function Documentation

void InitializeValues ( ) [inline, private]

Definition at line 22 of file ListsAndTemplates.xaml.cs.

        {
            this.Model.InitializeValues();
            foreach (IEmployee e in Model.ManagerProp.ReportsList)
            {
                if (this.Employees != null)
                {
                    this.Employees.Add(e);
                }
            }
        }

void ResetValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file ListsAndTemplates.xaml.cs.

        {
            this.InitializeValues();
        }

void UpdateValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 34 of file ListsAndTemplates.xaml.cs.

        {
            this.Model.UpdateValues();
            if (this.Employees != null)
            {
                IEmployee temp = Employees[0];
                Employees.RemoveAt(0);
                Employees.Add(temp);
            }
        }

Member Data Documentation

List<IEmployee> Employees = new List<IEmployee>()

Definition at line 13 of file ListsAndTemplates.xaml.cs.

Property Documentation

DataModel Model [get, set]

Definition at line 11 of file ListsAndTemplates.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/ListsAndTemplates.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MyUserControl1 Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • MyUserControl1
Public Member Functions | Properties | Events | Private Attributes

MyUserControl1 Class Reference

List of all members.

Public Member Functions

MyUserControl1 ()

Properties

string | NonDPProperty [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Attributes

string | _nonDPProperty

Detailed Description

Definition at line 21 of file MyUserControl1.xaml.cs.

Constructor & Destructor Documentation

MyUserControl1 ( ) [inline]

Definition at line 23 of file MyUserControl1.xaml.cs.

        {
            NonDPProperty = "Not Set";
            this.InitializeComponent();
        }

Member Data Documentation

string _nonDPProperty [private]

Definition at line 29 of file MyUserControl1.xaml.cs.

Property Documentation

string NonDPProperty [get, set]

Definition at line 30 of file MyUserControl1.xaml.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 42 of file MyUserControl1.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/MyUserControl1.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OtherBindings Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • OtherBindings
Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes

OtherBindings Class Reference

List of all members.

Public Member Functions

OtherBindings ()

Public Attributes

xBindSampleModel.IEmployee NullEmployee
String | NullStringProperty

Properties

CSharpModel | CSharpModel [get, set]
String | DPOnPage [get, set]
static DependencyProperty | DPOnPageProperty [get]
DataModel | Model [get, set]
int | MyInt [get, set]

Private Member Functions

void | InitializeValues ()
void | ResetValuesClick (object sender, RoutedEventArgs e)
void | UndeferElementClick (object sender, RoutedEventArgs e)
void | UpdateValuesClick (object sender, RoutedEventArgs e)

Private Attributes

const string | DPOnPageName = "DPOnPage"

Static Private Attributes

static readonly DependencyProperty | _DPOnPage

Detailed Description

Definition at line 12 of file OtherBindings.xaml.cs.

Constructor & Destructor Documentation

OtherBindings ( ) [inline]

Definition at line 31 of file OtherBindings.xaml.cs.

        {
            this.InitializeComponent();
            this.CSharpModel = new CSharpModel();
            this.Model = new DataModel();
            InitializeValues();
        }

Member Function Documentation

void InitializeValues ( ) [inline, private]

Definition at line 39 of file OtherBindings.xaml.cs.

        {
            this.DPOnPage = "DP on page";
            this.Background = new SolidColorBrush(Colors.Red);
        }

void ResetValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 53 of file OtherBindings.xaml.cs.

        {
            this.Model.InitializeValues();
            this.CSharpModel.InitializeValues();
            this.InitializeValues();
        }

void UndeferElementClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 60 of file OtherBindings.xaml.cs.

        {
            this.FindName("deferedTextBlock");
        }

void UpdateValuesClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 45 of file OtherBindings.xaml.cs.

        {
            this.Model.UpdateValues();
            this.CSharpModel.UpdateValues();
            this.DPOnPage += "-";
            this.Background = null;
        }

Member Data Documentation

readonly DependencyProperty _DPOnPage [static, private]
Initial value:
        DependencyProperty.Register(DPOnPageName, typeof(int), typeof(DataModel), new PropertyMetadata(0))

Definition at line 25 of file OtherBindings.xaml.cs.

const string DPOnPageName = "DPOnPage" [private]

Definition at line 24 of file OtherBindings.xaml.cs.

xBindSampleModel.IEmployee NullEmployee

Definition at line 28 of file OtherBindings.xaml.cs.

String NullStringProperty

Definition at line 29 of file OtherBindings.xaml.cs.

Property Documentation

CSharpModel CSharpModel [get, set]

Definition at line 16 of file OtherBindings.xaml.cs.

String DPOnPage [get, set]

Definition at line 19 of file OtherBindings.xaml.cs.

DependencyProperty DPOnPageProperty [static, get]

Definition at line 23 of file OtherBindings.xaml.cs.

DataModel Model [get, set]

Definition at line 15 of file OtherBindings.xaml.cs.

int MyInt [get, set]

Definition at line 14 of file OtherBindings.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/OtherBindings.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PhasingTests Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • PhasingTests
Public Member Functions | Properties | Private Member Functions | Private Attributes

PhasingTests Class Reference

List of all members.

Public Member Functions

PhasingTests ()

Properties

xBindSampleModel.FileDataSource | dataSource [get, set]

Private Member Functions

async void | ChangeFolderClick (object sender, RoutedEventArgs e)
async void | CreateTestData ()
void | DataSource_CollectionChanged (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
void | myGridView_ContainerContentChanging (ListViewBase sender, ContainerContentChangingEventArgs args)
void | PhasedTemplate_Checked (object sender, RoutedEventArgs e)
void | Reset_Click (object sender, RoutedEventArgs e)
void | Sleep (int msTime)
void | SlowPhasing_Checked (object sender, RoutedEventArgs e)
void | SlowPhasing_UnChecked (object sender, RoutedEventArgs e)

Private Attributes

xBindSampleModel.FileDataSource _dataSource
bool | Initialized = false

Detailed Description

Definition at line 26 of file PhasingTests.xaml.cs.

Constructor & Destructor Documentation

PhasingTests ( ) [inline]

Definition at line 55 of file PhasingTests.xaml.cs.

        {
            this.InitializeComponent();
            CreateTestData();
            Initialized = true;
        }

Member Function Documentation

async void ChangeFolderClick | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 79 of file PhasingTests.xaml.cs.

        {
            Windows.Storage.Pickers.FolderPicker picker = new Windows.Storage.Pickers.FolderPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".png");
            StorageFolder f = await picker.PickSingleFolderAsync();
            dataSource = new xBindSampleModel.FileDataSource();
            myGridView.ItemsSource = dataSource;
            LoadingPanel.Visibility = Visibility.Visible;
            await dataSource.SetupDataSource(f);
            LoadingPanel.Visibility = Visibility.Collapsed;
        }

async void CreateTestData ( ) [inline, private]

Definition at line 62 of file PhasingTests.xaml.cs.

        {
            await dataSource.SetupDataSourceUsingPicturesFolder();
            LoadingPanel.Visibility = Visibility.Collapsed;
            myGridView.ItemsSource = dataSource;
        }

void DataSource_CollectionChanged | ( | object | sender,
 |  | System.Collections.Specialized.NotifyCollectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 69 of file PhasingTests.xaml.cs.

        {
            NoItemsPanel.Visibility = (dataSource.Count == 0) ? Visibility.Visible : Visibility.Collapsed;
        }

void myGridView_ContainerContentChanging | ( | ListViewBase | sender,
 |  | ContainerContentChangingEventArgs | args |
 | ) |  |  | [inline, private]

Definition at line 93 of file PhasingTests.xaml.cs.

        {
            Sleep(1);
            if (args.Phase < 10) args.RegisterUpdateCallback(myGridView_ContainerContentChanging);
        }

void PhasedTemplate_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 126 of file PhasingTests.xaml.cs.

        {
            if (Initialized)
            {
                if (RadioPhasedTempl.IsChecked == true)
                {
                    myGridView.ItemTemplate = (DataTemplate)Resources["PhasedFileTemplate"];
                }
                else if (RadioxBindTempl.IsChecked.Value)
                {
                    myGridView.ItemTemplate = (DataTemplate)Resources["NonPhasedFileTemplate"];
                }
                else if (RadioClassicTempl.IsChecked.Value)
                {
                    myGridView.ItemTemplate = (DataTemplate)Resources["ClassicBindingFileTemplate"];
                }
            }
        }

void Reset_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 74 of file PhasingTests.xaml.cs.

        {
            dataSource.ResetCollection();
        }

void Sleep ( int msTime ) [inline, private]

Definition at line 99 of file PhasingTests.xaml.cs.

        {
            AutoResetEvent h = new AutoResetEvent(false);
            h.WaitOne(msTime);
        }

void SlowPhasing_Checked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 110 of file PhasingTests.xaml.cs.

        {
            if (Initialized)
            {
                if (SlowPhasing.IsChecked.Value)
                {
                    myGridView.ContainerContentChanging += myGridView_ContainerContentChanging;
                }
                else
                {
                    myGridView.ContainerContentChanging -= myGridView_ContainerContentChanging;
                }
            }
        }

void SlowPhasing_UnChecked | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 105 of file PhasingTests.xaml.cs.

        {
            SlowPhasing_Checked(sender, e);
        }

Member Data Documentation

xBindSampleModel.FileDataSource _dataSource [private]

Definition at line 29 of file PhasingTests.xaml.cs.

bool Initialized = false [private]

Definition at line 53 of file PhasingTests.xaml.cs.

Property Documentation

xBindSampleModel.FileDataSource dataSource [get, set, private]

Definition at line 31 of file PhasingTests.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlBind/cs/PhasingTests.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Templates Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleCS
  • Templates
Public Member Functions

Templates Class Reference

List of all members.

Public Member Functions

Templates ()

Detailed Description

Definition at line 10 of file Templates.xaml.cs.

Constructor & Destructor Documentation

Templates ( ) [inline]

Definition at line 12 of file Templates.xaml.cs.

        {
            InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlBind/cs/Templates.xaml.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BoolToVisibilityConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • BoolToVisibilityConverter
Private Member Functions

BoolToVisibilityConverter Class Reference

List of all members.

Private Member Functions

object IValueConverter. | Convert (object value, Type targetType, object parameter, string language)
object IValueConverter. | Convert (object value, Type targetType, object parameter, string language)
object IValueConverter. | ConvertBack (object value, Type targetType, object parameter, string language)
object IValueConverter. | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 10 of file BoolToVisibilityConverter.cs.

Member Function Documentation

object IValueConverter. Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 12 of file BoolToVisibilityConverter.cs.

        {
            if (!value.GetType().Equals(typeof(bool)))
            {
                throw new ArgumentException("Only Boolean is supported");
            }
            if (targetType.Equals(typeof(Windows.UI.Xaml.Visibility)))
            {
                return ((bool)value) ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                throw new ArgumentException("Unsuported type {0}", targetType.FullName);
            }
        }

object IValueConverter. Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 12 of file BoolToVisibilityConverter.cs.

        {
            if (!value.GetType().Equals(typeof(bool)))
            {
                throw new ArgumentException("Only Boolean is supported");
            }
            if (targetType.Equals(typeof(Windows.UI.Xaml.Visibility)))
            {
                return ((bool)value) ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                throw new ArgumentException("Unsuported type {0}", targetType.FullName);
            }
        }

object IValueConverter. ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 28 of file BoolToVisibilityConverter.cs.

        {
            throw new NotImplementedException();
        }

object IValueConverter. ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 28 of file BoolToVisibilityConverter.cs.

        {
            throw new NotImplementedException();
        }

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/BoolToVisibilityConverter.cs
  • XamlBind/cs/xBindSampleModel/BoolToVisibilityConverter.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ColorToStringConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • ColorToStringConverter
Public Member Functions | Static Private Attributes

ColorToStringConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Static Private Attributes

static string[] | colorNames = { "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen" }
static Color[] | colorValues = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen }

Detailed Description

Definition at line 9 of file ColorToStringConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 14 of file ColorToStringConverter.cs.

        {
            Color src = (Color)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorValues[i])
                {
                    return colorNames[i];
                }
            }
            return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", src.A, src.R, src.G, src.B);
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 14 of file ColorToStringConverter.cs.

        {
            Color src = (Color)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorValues[i])
                {
                    return colorNames[i];
                }
            }
            return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", src.A, src.R, src.G, src.B);
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 27 of file ColorToStringConverter.cs.

        {
            string src = (string)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorNames[i])
                {
                    return colorValues[i];
                }
            }
            if (src.StartsWith("#"))
            {
                return Color.FromArgb(Byte.Parse(src.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(5, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(7, 2), System.Globalization.NumberStyles.HexNumber));
            }
            throw new ArgumentException("Cannot parse the color");
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 27 of file ColorToStringConverter.cs.

        {
            string src = (string)value;
            for (int i = 0; i < colorValues.Length; i++)
            {
                if (src == colorNames[i])
                {
                    return colorValues[i];
                }
            }
            if (src.StartsWith("#"))
            {
                return Color.FromArgb(Byte.Parse(src.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(5, 2), System.Globalization.NumberStyles.HexNumber),
                    Byte.Parse(src.Substring(7, 2), System.Globalization.NumberStyles.HexNumber));
            }
            throw new ArgumentException("Cannot parse the color");
        }

Member Data Documentation

string [] colorNames = { "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen" } [static, private]

Definition at line 11 of file ColorToStringConverter.cs.

Color [] colorValues = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen } [static, private]

Definition at line 12 of file ColorToStringConverter.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/ColorToStringConverter.cs
  • XamlBind/cs/xBindSampleModel/ColorToStringConverter.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • DataModel
Public Member Functions | Static Public Member Functions | Properties | Events | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

DataModel Class Reference

List of all members.

Public Member Functions

DataModel ()
DataModel ()
void | InitializeValues ()
void | InitializeValues ()
string | SubString (string data, int startIndex)
void | UpdateValues ()
void | UpdateValues ()

Static Public Member Functions

static Manager | CreateManagerEmployeeTree ()
static Manager | CreateManagerEmployeeTree ()

Properties

bool | BoolPropWithINPC [get, set]
Color | ColorPropWithINPC [get, set]
IEmployee | EmployeePropertyDP [get, set]
static DependencyProperty | EmployeePropertyDPProperty [get]
IEmployee | EmployeePropNoINPC [get, set]
IEmployee | EmployeePropWithINPC [get, set]
EmployeeCollection | Employees [get, set]
int | IntPropertyDP [get, set]
static DependencyProperty | IntPropertyDPProperty [get]
int | IntPropNoINPC [get, set]
int | IntPropWithINPC [get, set]
Manager | ManagerProp [get, set]
string | StringPropAsInteger [get, set]
string | StringPropertyDP [get, set]
static DependencyProperty | StringPropertyDPProperty [get]
string | StringPropNoINPC [get, set]
string | StringPropWithINPC [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")
void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")

Static Private Member Functions

static void | CreateReports (int depth, Manager m, Random rnd)
static void | CreateReports (int depth, Manager m, Random rnd)

Private Attributes

bool | _BoolPropWithINPC
Color | _ColorPropWithINPC
IEmployee _EmployeePropWithINPC
EmployeeCollection _Employees
int | _IntPropWithINPC
Manager _ManagerProp
string | _StringPropWithINPC
const string | EmployeePropertyDPName = "EmployeePropertyDP"
const string | IntPropertyDPName = "IntPropertyDP"
const string | StringPropertyDPName = "StringPropertyDP"

Static Private Attributes

static readonly DependencyProperty | _EmployeePropertyDPProperty
static readonly DependencyProperty | _IntPropertyDPProperty
static readonly DependencyProperty | _StringPropertyDPProperty
static string[] | fnames = { "Alice", "Brian", "Chris", "David", "Emily", "Freda", "Garry", "Harriet", "Isobel", "John", "Keith", "Lisa", "Mark", "Nathan", "Olivia", "Penelope", "Quentin", "Robert", "Simon", "Tom", "Veronica", "Will", "Xavier", "Yvette", "Zach" }
static string[] | lnames = { "Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller", "Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White", "Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson", "Clark", "Rodriguez", "Lewis", "Lee", "Walker" }

Detailed Description

Definition at line 11 of file Model.cs.

Constructor & Destructor Documentation

DataModel ( ) [inline]

Definition at line 13 of file Model.cs.

        {
            InitializeValues();
        }

DataModel ( ) [inline]

Definition at line 13 of file Model.cs.

        {
            InitializeValues();
        }

Member Function Documentation

static Manager CreateManagerEmployeeTree ( ) [inline, static]

Definition at line 206 of file Model.cs.

        {
            Random rnd = new Random(4524); // Passing in a seed guarantees the same values each time
            Manager CEO = new Manager() { FirstName = fnames[rnd.Next(fnames.Length)], LastName = lnames[rnd.Next(lnames.Length)] };
            CreateReports(5, CEO, rnd);
            return CEO;
        }

static Manager CreateManagerEmployeeTree ( ) [inline, static]

Definition at line 201 of file Model.cs.

        {
            Random rnd = new Random(4524); // Passing in a seed guarantees the same values each time
            Manager CEO = new Manager() { FirstName = fnames[rnd.Next(fnames.Length)], LastName = lnames[rnd.Next(lnames.Length)] };
            CreateReports(5, CEO, rnd);
            return CEO;
        }

static void CreateReports | ( | int | depth,
 |  | Manager | m,
 |  | Random | rnd |
 | ) |  |  | [inline, static, private]

Definition at line 214 of file Model.cs.

        {
            int count = rnd.Next(10) + 3;
            for (int i = 0; i < count; i++)
            {
                int j = rnd.Next(10);
                IEmployee e = (j > 2 && depth > 1) ? (IEmployee)new Manager() : (IEmployee)new Employee();
                e.LastName = lnames[rnd.Next(lnames.Length)];
                e.FirstName = fnames[rnd.Next(fnames.Length)];
                e.DirectManager = m;
                m.ReportsList.Add(e);
                m.ReportsDict.Add(e.FirstName + i, e);
                if (e.IsManager) CreateReports(depth - 1, (Manager)e, rnd);
            }
        }

static void CreateReports | ( | int | depth,
 |  | Manager | m,
 |  | Random | rnd |
 | ) |  |  | [inline, static, private]

Definition at line 209 of file Model.cs.

        {
            int count = rnd.Next(10) + 3;
            for (int i = 0; i < count; i++)
            {
                int j = rnd.Next(10);
                IEmployee e = (j > 2 && depth > 1) ? (IEmployee)new Manager() : (IEmployee)new Employee();
                e.LastName = lnames[rnd.Next(lnames.Length)];
                e.FirstName = fnames[rnd.Next(fnames.Length)];
                e.DirectManager = m;
                m.ReportsList.Add(e);
                m.ReportsDict.Add(e.FirstName + i, e);
                if (e.IsManager) CreateReports(depth - 1, (Manager)e, rnd);
            }
        }

void InitializeValues ( ) [inline]

Definition at line 159 of file Model.cs.

        {
            ManagerProp = CreateManagerEmployeeTree();
            Employees = ManagerProp.ReportsOC;

            StringPropNoINPC = "String Property without INPC";
            StringPropWithINPC = "String Property with INPC";
            ColorPropWithINPC = Colors.Red;
            IntPropNoINPC = 42;
            IntPropWithINPC = 2;
            IntPropertyDP = 42;
            StringPropertyDP = "String Property as a DP";
            StringPropAsInteger = "65";
            EmployeePropNoINPC = Employees[0];
            EmployeePropWithINPC = Employees[1];

        }

void InitializeValues ( ) [inline]

Definition at line 159 of file Model.cs.

        {
            ManagerProp = CreateManagerEmployeeTree();
            Employees = ManagerProp.ReportsOC;

            StringPropNoINPC = "String Property without INPC";
            StringPropWithINPC = "String Property with INPC";
            ColorPropWithINPC = Colors.Red;
            IntPropNoINPC = 42;
            IntPropWithINPC = 2;
            IntPropertyDP = 42;
            StringPropertyDP = "String Property as a DP";
            StringPropAsInteger = "65";
            EmployeePropNoINPC = Employees[0];
            EmployeePropWithINPC = Employees[1];

        }

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 230 of file Model.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 235 of file Model.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

string SubString | ( | string | data,
 |  | int | startIndex |
 | ) |  |  | [inline]

Definition at line 196 of file Model.cs.

        {
            return data.Substring(startIndex);
        }

void UpdateValues ( ) [inline]

Definition at line 176 of file Model.cs.

        {
            this.BoolPropWithINPC = !this.BoolPropWithINPC;
            this.IntPropNoINPC = IntPropNoINPC + 10 % 100;
            this.IntPropWithINPC = IntPropWithINPC + 1 % 10;
            this.IntPropertyDP = IntPropertyDP + 10 % 100;

            string name = ", " + lnames[(new Random()).Next(lnames.Length)];
            this.StringPropNoINPC += name;
            this.StringPropWithINPC += name;
            this.StringPropertyDP += name;

            EmployeePropWithINPC = Employees[IntPropWithINPC % Employees.Count];
            EmployeePropertyDP = Employees[(IntPropWithINPC + 1) % Employees.Count];
            // Swap Manager Reports [0], [2]
            var temp = ManagerProp.ReportsOC[0];
            ManagerProp.ReportsOC[0] = ManagerProp.ReportsOC[2];
            ManagerProp.ReportsOC[2] = temp;
        }

void UpdateValues ( ) [inline]

Definition at line 176 of file Model.cs.

        {
            this.BoolPropWithINPC = !this.BoolPropWithINPC;
            this.IntPropNoINPC = IntPropNoINPC + 10 % 100;
            this.IntPropWithINPC = IntPropWithINPC + 1 % 10;
            this.IntPropertyDP = IntPropertyDP + 10 % 100;

            string name = ", " + lnames[(new Random()).Next(lnames.Length)];
            this.StringPropNoINPC += name;
            this.StringPropWithINPC += name;
            this.StringPropertyDP += name;

            EmployeePropWithINPC = Employees[IntPropWithINPC % Employees.Count];
            EmployeePropertyDP = Employees[(IntPropWithINPC + 1) % Employees.Count];
            // Swap Manager Reports [0], [2]
            var temp = ManagerProp.ReportsOC[0];
            ManagerProp.ReportsOC[0] = ManagerProp.ReportsOC[2];
            ManagerProp.ReportsOC[2] = temp;
        }

Member Data Documentation

bool _BoolPropWithINPC [private]

Definition at line 107 of file Model.cs.

Color _ColorPropWithINPC [private]

Definition at line 51 of file Model.cs.

static readonly DependencyProperty _EmployeePropertyDPProperty [static, private]
Initial value:
            DependencyProperty.Register(EmployeePropertyDPName, typeof(IEmployee), typeof(DataModel), new PropertyMetadata(0))

Definition at line 152 of file Model.cs.

IEmployee _EmployeePropWithINPC [private]

Definition at line 65 of file Model.cs.

EmployeeCollection _Employees [private]

Definition at line 79 of file Model.cs.

static readonly DependencyProperty _IntPropertyDPProperty [static, private]
Initial value:
            DependencyProperty.Register(IntPropertyDPName, typeof(int), typeof(DataModel), new PropertyMetadata(0))

Definition at line 128 of file Model.cs.

int _IntPropWithINPC [private]

Definition at line 37 of file Model.cs.

Manager _ManagerProp [private]

Definition at line 93 of file Model.cs.

static readonly DependencyProperty _StringPropertyDPProperty [static, private]
Initial value:
            DependencyProperty.Register(StringPropertyDPName, typeof(string), typeof(DataModel), new PropertyMetadata(""))

Definition at line 140 of file Model.cs.

string _StringPropWithINPC [private]

Definition at line 23 of file Model.cs.

const string EmployeePropertyDPName = "EmployeePropertyDP" [private]

Definition at line 151 of file Model.cs.

string [] fnames = { "Alice", "Brian", "Chris", "David", "Emily", "Freda", "Garry", "Harriet", "Isobel", "John", "Keith", "Lisa", "Mark", "Nathan", "Olivia", "Penelope", "Quentin", "Robert", "Simon", "Tom", "Veronica", "Will", "Xavier", "Yvette", "Zach" } [static, private]

Definition at line 203 of file Model.cs.

const string IntPropertyDPName = "IntPropertyDP" [private]

Definition at line 127 of file Model.cs.

string [] lnames = { "Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller", "Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White", "Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson", "Clark", "Rodriguez", "Lewis", "Lee", "Walker" } [static, private]

Definition at line 204 of file Model.cs.

const string StringPropertyDPName = "StringPropertyDP" [private]

Definition at line 139 of file Model.cs.

Property Documentation

bool BoolPropWithINPC [get, set]

Definition at line 109 of file Model.cs.

Color ColorPropWithINPC [get, set]

Definition at line 53 of file Model.cs.

IEmployee EmployeePropertyDP [get, set]

Definition at line 146 of file Model.cs.

static DependencyProperty EmployeePropertyDPProperty [static, get]

Definition at line 154 of file Model.cs.

IEmployee EmployeePropNoINPC [get, set]

Definition at line 21 of file Model.cs.

IEmployee EmployeePropWithINPC [get, set]

Definition at line 67 of file Model.cs.

EmployeeCollection Employees [get, set]

Definition at line 81 of file Model.cs.

int IntPropertyDP [get, set]

Definition at line 122 of file Model.cs.

static DependencyProperty IntPropertyDPProperty [static, get]

Definition at line 130 of file Model.cs.

int IntPropNoINPC [get, set]

Definition at line 20 of file Model.cs.

int IntPropWithINPC [get, set]

Definition at line 39 of file Model.cs.

Manager ManagerProp [get, set]

Definition at line 95 of file Model.cs.

string StringPropAsInteger [get, set]

Definition at line 19 of file Model.cs.

string StringPropertyDP [get, set]

Definition at line 134 of file Model.cs.

static DependencyProperty StringPropertyDPProperty [static, get]

Definition at line 142 of file Model.cs.

string StringPropNoINPC [get, set]

Definition at line 18 of file Model.cs.

string StringPropWithINPC [get, set]

Definition at line 25 of file Model.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 233 of file Model.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/Model.cs
  • XamlBind/cs/xBindSampleModel/Model.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DOModel Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • DOModel
Public Member Functions | Static Public Member Functions | Properties | Private Attributes | Static Private Attributes

DOModel Class Reference

List of all members.

Public Member Functions

DOModel ()
DOModel ()
void | UpdateValues ()
void | UpdateValues ()

Static Public Member Functions

static void | YinCallback (DependencyObject d, DependencyPropertyChangedEventArgs e)
static void | YinCallback (DependencyObject d, DependencyPropertyChangedEventArgs e)

Properties

int | IntPropertyDP [get, set]
static DependencyProperty | IntPropertyDPProperty [get]
YangContainer | YangObj [get, set]
double | YinPropertyDP [get, set]
static DependencyProperty | YinPropertyDPProperty [get]

Private Attributes

const string | IntPropertyDPName = "IntPropertyDP"
const string | YinPropertyDPName = "YinPropertyDP"

Static Private Attributes

static readonly DependencyProperty | _IntPropertyDPProperty
static readonly DependencyProperty | _YinPropertyDPProperty

Detailed Description

Definition at line 12 of file DOModel.cs.

Constructor & Destructor Documentation

DOModel ( ) [inline]

Definition at line 14 of file DOModel.cs.

        {
            YangObj = new YangContainer(this);
        }

DOModel ( ) [inline]

Definition at line 14 of file DOModel.cs.

        {
            YangObj = new YangContainer(this);
        }

Member Function Documentation

void UpdateValues ( ) [inline]

Definition at line 19 of file DOModel.cs.

        {
            this.IntPropertyDP++;
            YinPropertyDP = 65;
        }

void UpdateValues ( ) [inline]

Definition at line 19 of file DOModel.cs.

        {
            this.IntPropertyDP++;
            YinPropertyDP = 65;
        }

static void YinCallback | ( | DependencyObject | d,
 |  | DependencyPropertyChangedEventArgs | e |
 | ) |  |  | [inline, static]

Definition at line 56 of file DOModel.cs.

        {
            DOModel inst = d as DOModel;
            double value = (double)e.NewValue;
            if (inst.YangObj.Value != value)
            {
                inst.YangObj.Value = value;
            }
        }

static void YinCallback | ( | DependencyObject | d,
 |  | DependencyPropertyChangedEventArgs | e |
 | ) |  |  | [inline, static]

Definition at line 56 of file DOModel.cs.

        {
            DOModel inst = d as DOModel;
            double value = (double)e.NewValue;
            if (inst.YangObj.Value != value)
            {
                inst.YangObj.Value = value;
            }
        }

Member Data Documentation

static readonly DependencyProperty _IntPropertyDPProperty [static, private]
Initial value:
            DependencyProperty.Register(IntPropertyDPName, typeof(int), typeof(DataModel), new PropertyMetadata(0))

Definition at line 38 of file DOModel.cs.

static readonly DependencyProperty _YinPropertyDPProperty [static, private]
Initial value:
            DependencyProperty.Register(YinPropertyDPName, typeof(double), typeof(DataModel), new PropertyMetadata(0, YinCallback))

Definition at line 50 of file DOModel.cs.

const string IntPropertyDPName = "IntPropertyDP" [private]

Definition at line 37 of file DOModel.cs.

const string YinPropertyDPName = "YinPropertyDP" [private]

Definition at line 49 of file DOModel.cs.

Property Documentation

int IntPropertyDP [get, set]

Definition at line 32 of file DOModel.cs.

static DependencyProperty IntPropertyDPProperty [static, get]

Definition at line 40 of file DOModel.cs.

YangContainer YangObj [get, set]

Definition at line 26 of file DOModel.cs.

double YinPropertyDP [get, set]

Definition at line 44 of file DOModel.cs.

static DependencyProperty YinPropertyDPProperty [static, get]

Definition at line 52 of file DOModel.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/DOModel.cs
  • XamlBind/cs/xBindSampleModel/DOModel.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DoubleToIntConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • DoubleToIntConverter
Private Member Functions

DoubleToIntConverter Class Reference

List of all members.

Private Member Functions

object IValueConverter. | Convert (object value, Type targetType, object parameter, string language)
object IValueConverter. | Convert (object value, Type targetType, object parameter, string language)
object IValueConverter. | ConvertBack (object value, Type targetType, object parameter, string language)
object IValueConverter. | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 10 of file DoubleToIntConverter.cs.

Member Function Documentation

object IValueConverter. Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 12 of file DoubleToIntConverter.cs.

        {
            if (!value.GetType().Equals(typeof(double)))
            {
                throw new ArgumentException("Only Double is supported");
            }
            if (targetType.Equals(typeof(Int32)))
            {
                return (Int32)((double)value);
            }
            else if (targetType.Equals(typeof(UInt32)))
            {
                return (UInt32)((double)value);
            }
            else
            {
                throw new ArgumentException("Unsuported type {0}", targetType.FullName);
            }
        }

object IValueConverter. Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 12 of file DoubleToIntConverter.cs.

        {
            if (!value.GetType().Equals(typeof(double)))
            {
                throw new ArgumentException("Only Double is supported");
            }
            if (targetType.Equals(typeof(Int32)))
            {
                return (Int32)((double)value);
            }
            else if (targetType.Equals(typeof(UInt32)))
            {
                return (UInt32)((double)value);
            }
            else
            {
                throw new ArgumentException("Unsuported type {0}", targetType.FullName);
            }
        }

object IValueConverter. ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 32 of file DoubleToIntConverter.cs.

        {
            return (double)((Int32)value);
        }

object IValueConverter. ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline, private]

Definition at line 32 of file DoubleToIntConverter.cs.

        {
            return (double)((Int32)value);
        }

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/DoubleToIntConverter.cs
  • XamlBind/cs/xBindSampleModel/DoubleToIntConverter.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Employee Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • Employee
Public Member Functions | Properties | Private Member Functions | Private Attributes

Employee Class Reference

Inherits xBindSampleModel::IEmployee, and xBindSampleModel::IEmployee.

List of all members.

Public Member Functions

string | FullName ()
string | FullName ()
void | Poke (object sender, RoutedEventArgs e)
void | Poke (object sender, RoutedEventArgs e)

Properties

Manager | DirectManager [get, set]
string | FirstName [get, set]
bool | IsManager [get]
string | LastName [get, set]
string | Name [get]
Windows.UI.Xaml.Media.ImageSource | NullImageSource [get, set]
string | NullStringProperty [get, set]
String | Title [get]
bool | Visibility [get, set]

Private Member Functions

internal | Employee ()
internal | Employee ()

Private Attributes

string | _FirstName
string | _LastName
Manager _Manager

Detailed Description

Definition at line 7 of file Employee.cs.

Constructor & Destructor Documentation

internal Employee ( ) [inline, private]

Definition at line 13 of file Employee.cs.

        {
            Visibility = true;
        }

internal Employee ( ) [inline, private]

Definition at line 13 of file Employee.cs.

        {
            Visibility = true;
        }

Member Function Documentation

string FullName ( ) [inline]

Implements IEmployee.

Definition at line 79 of file Employee.cs.

{ return FirstName + " " + LastName; }

string FullName ( ) [inline]

Implements IEmployee.

Definition at line 79 of file Employee.cs.

{ return FirstName + " " + LastName; }

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Implements IEmployee.

Definition at line 18 of file Employee.cs.

        {
            MessageDialog dlg = new MessageDialog(Name + " has been poked.");
            var t = dlg.ShowAsync();
        }

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Implements IEmployee.

Definition at line 18 of file Employee.cs.

        {
            MessageDialog dlg = new MessageDialog(Name + " has been poked.");
            var t = dlg.ShowAsync();
        }

Member Data Documentation

string _FirstName [private]

Definition at line 9 of file Employee.cs.

string _LastName [private]

Definition at line 10 of file Employee.cs.

Manager _Manager [private]

Definition at line 11 of file Employee.cs.

Property Documentation

Manager DirectManager [get, set]

Implements IEmployee.

Definition at line 62 of file Employee.cs.

string FirstName [get, set]

Implements IEmployee.

Definition at line 38 of file Employee.cs.

bool IsManager [get]

Implements IEmployee.

Definition at line 73 of file Employee.cs.

string LastName [get, set]

Implements IEmployee.

Definition at line 50 of file Employee.cs.

string Name [get]

Implements IEmployee.

Definition at line 77 of file Employee.cs.

Windows UI Xaml Media ImageSource NullImageSource [get, set]

Implements IEmployee.

Definition at line 32 of file Employee.cs.

string NullStringProperty [get, set]

Implements IEmployee.

Definition at line 27 of file Employee.cs.

String Title [get]

Implements IEmployee.

Definition at line 75 of file Employee.cs.

bool Visibility [get, set]

Implements IEmployee.

Definition at line 24 of file Employee.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/Employee.cs
  • XamlBind/cs/xBindSampleModel/Employee.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EmployeeCollection Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • EmployeeCollection
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

EmployeeCollection Class Reference

List of all members.

Public Member Functions

EmployeeCollection ()
EmployeeCollection ()
void | Add (IEmployee item)
void | Add (IEmployee item)
void | Clear ()
void | Clear ()
bool | Contains (IEmployee item)
bool | Contains (IEmployee item)
void | CopyTo (IEmployee[] array, int arrayIndex)
void | CopyTo (IEmployee[] array, int arrayIndex)
IEnumerator< IEmployee > | GetEnumerator ()
IEnumerator< IEmployee > | GetEnumerator ()
int | IndexOf (IEmployee item)
int | IndexOf (IEmployee item)
void | Insert (int index, IEmployee item)
void | Insert (int index, IEmployee item)
bool | Remove (IEmployee item)
bool | Remove (IEmployee item)
void | RemoveAt (int index)
void | RemoveAt (int index)

Properties

int | Count [get]
int ICollection. | Count [get]
bool IList. | IsFixedSize [get]
bool IList. | IsReadOnly [get]
bool | IsReadOnly [get]
bool ICollection. | IsSynchronized [get]
object ICollection. | SyncRoot [get]
object IList. | this [int index] [get, set]
IEmployee | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged
VectorChangedEventHandler
< IEmployee > 		VectorChanged

Private Member Functions

int IList. | Add (object item)
int IList. | Add (object item)
void IList. | Clear ()
void IList. | Clear ()
bool IList. | Contains (object item)
bool IList. | Contains (object item)
void ICollection. | CopyTo (Array array, int index)
void ICollection. | CopyTo (Array array, int index)
void | Data_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
void | Data_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
IEnumerator IEnumerable. | GetEnumerator ()
IEnumerator IEnumerable. | GetEnumerator ()
int IList. | IndexOf (object item)
int IList. | IndexOf (object item)
void IList. | Insert (int index, object item)
void IList. | Insert (int index, object item)
void IList. | Remove (object item)
void IList. | Remove (object item)
void IList. | RemoveAt (int index)
void IList. | RemoveAt (int index)

Private Attributes

ObservableCollection< IEmployee > | data

Detailed Description

Definition at line 19 of file EmployeeCollection.cs.

Constructor & Destructor Documentation

EmployeeCollection ( ) [inline]

Definition at line 25 of file EmployeeCollection.cs.

        {
            data = new ObservableCollection<IEmployee>();
            data.CollectionChanged += Data_CollectionChanged;
        }

EmployeeCollection ( ) [inline]

Definition at line 25 of file EmployeeCollection.cs.

        {
            data = new ObservableCollection<IEmployee>();
            data.CollectionChanged += Data_CollectionChanged;
        }

Member Function Documentation

void Add ( IEmployee item ) [inline]

Definition at line 59 of file EmployeeCollection.cs.

        {
            data.Add(item);
        }

void Add ( IEmployee item ) [inline]

Definition at line 59 of file EmployeeCollection.cs.

        {
            data.Add(item);
        }

int IList. Add ( object item ) [inline, private]

Definition at line 116 of file EmployeeCollection.cs.

        {
            data.Add((IEmployee)item);
            return data.Count;
        }

int IList. Add ( object item ) [inline, private]

Definition at line 116 of file EmployeeCollection.cs.

        {
            data.Add((IEmployee)item);
            return data.Count;
        }

void IList. Clear ( ) [inline, private]

Definition at line 138 of file EmployeeCollection.cs.

        {
            data.Clear();
        }

void IList. Clear ( ) [inline, private]

Definition at line 138 of file EmployeeCollection.cs.

        {
            data.Clear();
        }

void Clear ( ) [inline]

Definition at line 64 of file EmployeeCollection.cs.

        {
            data.Clear();
        }

void Clear ( ) [inline]

Definition at line 64 of file EmployeeCollection.cs.

        {
            data.Clear();
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 124 of file EmployeeCollection.cs.

{ return data.Contains(item); }

bool Contains ( IEmployee item ) [inline]

Definition at line 68 of file EmployeeCollection.cs.

        {
            return data.Contains(item);
        }

bool Contains ( IEmployee item ) [inline]

Definition at line 68 of file EmployeeCollection.cs.

        {
            return data.Contains(item);
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 124 of file EmployeeCollection.cs.

{ return data.Contains(item); }

void ICollection. CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 148 of file EmployeeCollection.cs.

        {
            throw new NotImplementedException();
        }

void ICollection. CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 148 of file EmployeeCollection.cs.

        {
            throw new NotImplementedException();
        }

void CopyTo | ( | IEmployee[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 73 of file EmployeeCollection.cs.

        {
            data.CopyTo(array, arrayIndex);
        }

void CopyTo | ( | IEmployee[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 73 of file EmployeeCollection.cs.

        {
            data.CopyTo(array, arrayIndex);
        }

void Data_CollectionChanged | ( | object | sender,
 |  | NotifyCollectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file EmployeeCollection.cs.

        {
            if (VectorChanged != null)
            {
                VectorChangedEventArgs args = new VectorChangedEventArgs();
                args.CollectionChange = CollectionChange.Reset;
                VectorChanged(this, args);
            }

            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
                CollectionChanged(this, e);
            }
        }

void Data_CollectionChanged | ( | object | sender,
 |  | NotifyCollectionChangedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file EmployeeCollection.cs.

        {
            if (VectorChanged != null)
            {
                VectorChangedEventArgs args = new VectorChangedEventArgs();
                args.CollectionChange = CollectionChange.Reset;
                VectorChanged(this, args);
            }

            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
                CollectionChanged(this, e);
            }
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 96 of file EmployeeCollection.cs.

        {
            return data.GetEnumerator();
        }

IEnumerator<IEmployee> GetEnumerator ( ) [inline]

Definition at line 77 of file EmployeeCollection.cs.

{ return data.GetEnumerator(); }

IEnumerator<IEmployee> GetEnumerator ( ) [inline]

Definition at line 77 of file EmployeeCollection.cs.

{ return data.GetEnumerator(); }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 96 of file EmployeeCollection.cs.

        {
            return data.GetEnumerator();
        }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 126 of file EmployeeCollection.cs.

{ return data.IndexOf((IEmployee)item); }

int IndexOf ( IEmployee item ) [inline]

Definition at line 79 of file EmployeeCollection.cs.

{ return data.IndexOf(item); }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 126 of file EmployeeCollection.cs.

{ return data.IndexOf((IEmployee)item); }

int IndexOf ( IEmployee item ) [inline]

Definition at line 79 of file EmployeeCollection.cs.

{ return data.IndexOf(item); }

void Insert | ( | int | index,
 |  | IEmployee | item |
 | ) |  |  | [inline]

Definition at line 81 of file EmployeeCollection.cs.

        {
            data.Insert(index, item);
        }

void Insert | ( | int | index,
 |  | IEmployee | item |
 | ) |  |  | [inline]

Definition at line 81 of file EmployeeCollection.cs.

        {
            data.Insert(index, item);
        }

void IList. Insert | ( | int | index,
 |  | object | item |
 | ) |  |  | [inline, private]

Definition at line 128 of file EmployeeCollection.cs.

        {
            data.Insert(index, (IEmployee)item);
        }

void IList. Insert | ( | int | index,
 |  | object | item |
 | ) |  |  | [inline, private]

Definition at line 128 of file EmployeeCollection.cs.

        {
            data.Insert(index, (IEmployee)item);
        }

bool Remove ( IEmployee item ) [inline]

Definition at line 86 of file EmployeeCollection.cs.

        {
            return data.Remove(item);
        }

bool Remove ( IEmployee item ) [inline]

Definition at line 86 of file EmployeeCollection.cs.

        {
            return data.Remove(item);
        }

void IList. Remove ( object item ) [inline, private]

Definition at line 133 of file EmployeeCollection.cs.

        {
            data.Remove((IEmployee)item);
        }

void IList. Remove ( object item ) [inline, private]

Definition at line 133 of file EmployeeCollection.cs.

        {
            data.Remove((IEmployee)item);
        }

void RemoveAt ( int index ) [inline]

Definition at line 91 of file EmployeeCollection.cs.

        {
            data.RemoveAt(index);
        }

void RemoveAt ( int index ) [inline]

Definition at line 91 of file EmployeeCollection.cs.

        {
            data.RemoveAt(index);
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 143 of file EmployeeCollection.cs.

        {
            data.RemoveAt(index);
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 143 of file EmployeeCollection.cs.

        {
            data.RemoveAt(index);
        }

Member Data Documentation

ObservableCollection< IEmployee > data [private]

Definition at line 21 of file EmployeeCollection.cs.

Property Documentation

int ICollection Count [get]

Definition at line 56 of file EmployeeCollection.cs.

int ICollection. Count [get, private]

Definition at line 111 of file EmployeeCollection.cs.

bool IList IsFixedSize [get, private]

Definition at line 112 of file EmployeeCollection.cs.

bool IList. IsReadOnly [get, private]

Definition at line 122 of file EmployeeCollection.cs.

bool IList IsReadOnly [get]

Definition at line 57 of file EmployeeCollection.cs.

bool ICollection IsSynchronized [get, private]

Definition at line 113 of file EmployeeCollection.cs.

object ICollection SyncRoot [get, private]

Definition at line 114 of file EmployeeCollection.cs.

object IList. this[int index] [get, set, private]

Definition at line 106 of file EmployeeCollection.cs.

object IList this [get, set]

Definition at line 51 of file EmployeeCollection.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 23 of file EmployeeCollection.cs.

VectorChangedEventHandler< IEmployee > VectorChanged

Definition at line 22 of file EmployeeCollection.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs
  • XamlBind/cs/xBindSampleModel/EmployeeCollection.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EmployeeDictionary Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • EmployeeDictionary
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

EmployeeDictionary Class Reference

List of all members.

Public Member Functions

void | Add (KeyValuePair< string, IEmployee > item)
void | Add (string key, IEmployee value)
void | Add (KeyValuePair< string, IEmployee > item)
void | Add (string key, IEmployee value)
void | Clear ()
void | Clear ()
bool | Contains (KeyValuePair< string, IEmployee > item)
bool | Contains (KeyValuePair< string, IEmployee > item)
bool | ContainsKey (string key)
bool | ContainsKey (string key)
void | CopyTo (KeyValuePair< string, IEmployee >[] array, int arrayIndex)
void | CopyTo (KeyValuePair< string, IEmployee >[] array, int arrayIndex)
IEnumerator< KeyValuePair
< string, IEmployee > > 		GetEnumerator ()
IEnumerator< KeyValuePair
< string, IEmployee > > 		GetEnumerator ()
bool | Remove (string key)
bool | Remove (KeyValuePair< string, IEmployee > item)
bool | Remove (KeyValuePair< string, IEmployee > item)
bool | Remove (string key)
bool | TryGetValue (string key, out IEmployee value)
bool | TryGetValue (string key, out IEmployee value)

Properties

int | Count [get]
bool | IsReadOnly [get]
ICollection< string > | Keys [get]
IEmployee | this [string key] [get, set]
ICollection< IEmployee > | Values [get]

Events

MapChangedEventHandler< string,
IEmployee > 		MapChanged

Private Member Functions

void | FireMapChanged (CollectionChange change, string key)
void | FireMapChanged (CollectionChange change, string key)
IEnumerator IEnumerable. | GetEnumerator ()
IEnumerator IEnumerable. | GetEnumerator ()

Private Attributes

Dictionary< string, IEmployee > | data = new Dictionary<string, IEmployee>()

Detailed Description

Definition at line 161 of file EmployeeCollection.cs.

Member Function Documentation

void Add ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 199 of file EmployeeCollection.cs.

        {
            data.Add(item.Key, item.Value);
            FireMapChanged(CollectionChange.ItemInserted, item.Key);
        }

void Add | ( | string | key,
 |  | IEmployee | value |
 | ) |  |  | [inline]

Definition at line 205 of file EmployeeCollection.cs.

        {
            data.Add(key, value);
            FireMapChanged(CollectionChange.ItemInserted, key);
        }

void Add ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 199 of file EmployeeCollection.cs.

        {
            data.Add(item.Key, item.Value);
            FireMapChanged(CollectionChange.ItemInserted, item.Key);
        }

void Add | ( | string | key,
 |  | IEmployee | value |
 | ) |  |  | [inline]

Definition at line 205 of file EmployeeCollection.cs.

        {
            data.Add(key, value);
            FireMapChanged(CollectionChange.ItemInserted, key);
        }

void Clear ( ) [inline]

Definition at line 211 of file EmployeeCollection.cs.

        {
            data.Clear();
            FireMapChanged(CollectionChange.Reset, default(string));
        }

void Clear ( ) [inline]

Definition at line 211 of file EmployeeCollection.cs.

        {
            data.Clear();
            FireMapChanged(CollectionChange.Reset, default(string));
        }

bool Contains ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 217 of file EmployeeCollection.cs.

{ return data.Contains(item); }

bool Contains ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 217 of file EmployeeCollection.cs.

{ return data.Contains(item); }

bool ContainsKey ( string key ) [inline]

Definition at line 219 of file EmployeeCollection.cs.

{ return data.ContainsKey(key); }

bool ContainsKey ( string key ) [inline]

Definition at line 219 of file EmployeeCollection.cs.

{ return data.ContainsKey(key); }

void CopyTo | ( | KeyValuePair< string, IEmployee >[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 221 of file EmployeeCollection.cs.

        {
            var keys = data.Keys.GetEnumerator();
            var values = data.Values.GetEnumerator();
            for (int i = 0; i < data.Count; i++)
            {
                KeyValuePair<string, IEmployee> pair = new KeyValuePair<string, IEmployee>(keys.Current, values.Current);
                array[arrayIndex + i] = pair;
                keys.MoveNext();
                values.MoveNext();
            }
        }

void CopyTo | ( | KeyValuePair< string, IEmployee >[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline]

Definition at line 221 of file EmployeeCollection.cs.

        {
            var keys = data.Keys.GetEnumerator();
            var values = data.Values.GetEnumerator();
            for (int i = 0; i < data.Count; i++)
            {
                KeyValuePair<string, IEmployee> pair = new KeyValuePair<string, IEmployee>(keys.Current, values.Current);
                array[arrayIndex + i] = pair;
                keys.MoveNext();
                values.MoveNext();
            }
        }

void FireMapChanged | ( | CollectionChange | change,
 |  | string | key |
 | ) |  |  | [inline, private]

Definition at line 167 of file EmployeeCollection.cs.

        {
            if (MapChanged != null)
            {
                MapChanged(this, new MapChangedEventArgs<string>() { CollectionChange = change, Key = key });
            }
        }

void FireMapChanged | ( | CollectionChange | change,
 |  | string | key |
 | ) |  |  | [inline, private]

Definition at line 167 of file EmployeeCollection.cs.

        {
            if (MapChanged != null)
            {
                MapChanged(this, new MapChangedEventArgs<string>() { CollectionChange = change, Key = key });
            }
        }

IEnumerator<KeyValuePair<string, IEmployee> > GetEnumerator ( ) [inline]

Definition at line 234 of file EmployeeCollection.cs.

{ return data.GetEnumerator(); }

IEnumerator<KeyValuePair<string, IEmployee> > GetEnumerator ( ) [inline]

Definition at line 234 of file EmployeeCollection.cs.

{ return data.GetEnumerator(); }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 250 of file EmployeeCollection.cs.

{ return ((IEnumerable)data).GetEnumerator(); }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 250 of file EmployeeCollection.cs.

{ return ((IEnumerable)data).GetEnumerator(); }

bool Remove ( string key ) [inline]

Definition at line 238 of file EmployeeCollection.cs.

        {
            bool removed = data.Remove(key);
            if (removed) { FireMapChanged(CollectionChange.ItemRemoved, key); }
            return removed;
        }

bool Remove ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 236 of file EmployeeCollection.cs.

{ return Remove(item.Key); }

bool Remove ( string key ) [inline]

Definition at line 238 of file EmployeeCollection.cs.

        {
            bool removed = data.Remove(key);
            if (removed) { FireMapChanged(CollectionChange.ItemRemoved, key); }
            return removed;
        }

bool Remove ( KeyValuePair< string, IEmployee > item ) [inline]

Definition at line 236 of file EmployeeCollection.cs.

{ return Remove(item.Key); }

bool TryGetValue | ( | string | key,
 |  | out IEmployee | value |
 | ) |  |  | [inline]

Definition at line 245 of file EmployeeCollection.cs.

        {
            return data.TryGetValue(key, out value);
        }

bool TryGetValue | ( | string | key,
 |  | out IEmployee | value |
 | ) |  |  | [inline]

Definition at line 245 of file EmployeeCollection.cs.

        {
            return data.TryGetValue(key, out value);
        }

Member Data Documentation

Dictionary< string, IEmployee > data = new Dictionary<string, IEmployee>() [private]

Definition at line 163 of file EmployeeCollection.cs.

Property Documentation

int Count [get]

Definition at line 191 of file EmployeeCollection.cs.

bool IsReadOnly [get]

Definition at line 193 of file EmployeeCollection.cs.

ICollection< string > Keys [get]

Definition at line 195 of file EmployeeCollection.cs.

IEmployee this [get, set]

Definition at line 179 of file EmployeeCollection.cs.

ICollection< IEmployee > Values [get]

Definition at line 197 of file EmployeeCollection.cs.

Event Documentation

MapChangedEventHandler< string, IEmployee > MapChanged

Definition at line 165 of file EmployeeCollection.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs
  • XamlBind/cs/xBindSampleModel/EmployeeCollection.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileDataSource Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • FileDataSource
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

FileDataSource Class Reference

List of all members.

Public Member Functions

FileDataSource ()
FileDataSource ()
void | ResetCollection ()
void | ResetCollection ()
IAsyncAction | SetupDataSource (StorageFolder folder)
IAsyncAction | SetupDataSource (StorageFolder folder)
IAsyncAction | SetupDataSourceUsingPicturesFolder ()
IAsyncAction | SetupDataSourceUsingPicturesFolder ()

Properties

int | Count [get]
int ICollection< FileItem >. | Count [get]
int ICollection. | Count [get]
StorageFolder | Folder [get, set]
bool IList. | IsFixedSize [get]
bool ICollection< FileItem >. | IsReadOnly [get]
bool IList. | IsReadOnly [get]
bool ICollection. | IsSynchronized [get]
object ICollection. | SyncRoot [get]
object | this [int index] [get, set]
FileItem IList< FileItem >. | this [int index] [get, set]
object IList. | this [int index] [get, set]

Events

NotifyCollectionChangedEventHandler | CollectionChanged
VectorChangedEventHandler
< FileItem > 		VectorChanged

Private Member Functions

int IList. | Add (object item)
void ICollection< FileItem >. | Add (FileItem item)
void ICollection< FileItem >. | Add (FileItem item)
int IList. | Add (object item)
void IList. | Clear ()
void ICollection< FileItem >. | Clear ()
void ICollection< FileItem >. | Clear ()
void IList. | Clear ()
bool ICollection< FileItem >. | Contains (FileItem item)
bool ICollection< FileItem >. | Contains (FileItem item)
bool IList. | Contains (object item)
bool IList. | Contains (object item)
void ICollection. | CopyTo (Array array, int index)
void ICollection< FileItem >. | CopyTo (FileItem[] array, int arrayIndex)
void ICollection< FileItem >. | CopyTo (FileItem[] array, int arrayIndex)
void ICollection. | CopyTo (Array array, int index)
async Task | fetchBatch (int index)
async Task | fetchBatch (int index)
async Task | FetchData ()
async Task | FetchData ()
IEnumerator IEnumerable. | GetEnumerator ()
IEnumerator< FileItem >
IEnumerable< FileItem >. 		GetEnumerator ()
IEnumerator< FileItem >
IEnumerable< FileItem >. 		GetEnumerator ()
IEnumerator IEnumerable. | GetEnumerator ()
int IList. | IndexOf (object item)
int IList. | IndexOf (object item)
int IList< FileItem >. | IndexOf (FileItem item)
int IList< FileItem >. | IndexOf (FileItem item)
void IList. | Insert (int index, object value)
void IList< FileItem >. | Insert (int index, FileItem item)
void IList< FileItem >. | Insert (int index, FileItem item)
void IList. | Insert (int index, object value)
void | QueryResult_ContentsChanged (IStorageQueryResultBase sender, object args)
void | QueryResult_ContentsChanged (IStorageQueryResultBase sender, object args)
bool ICollection< FileItem >. | Remove (FileItem item)
void IList. | Remove (object value)
void IList. | Remove (object value)
bool ICollection< FileItem >. | Remove (FileItem item)
void IList. | RemoveAt (int index)
void IList< FileItem >. | RemoveAt (int index)
void IList< FileItem >. | RemoveAt (int index)
void IList. | RemoveAt (int index)
async Task | SetupDataSourceImpl (StorageFolder folder)
async Task | SetupDataSourceImpl (StorageFolder folder)
async Task | SetupDataSourceUsingPicturesFolderImpl ()
async Task | SetupDataSourceUsingPicturesFolderImpl ()

Private Attributes

List< FileItem > _cache
int | _count = 0
StorageFileQueryResult | _queryResult
const int | BATCHSIZE = 50
CoreDispatcher | dispatcher

Detailed Description

Definition at line 85 of file FileSystemDataSource.cs.

Constructor & Destructor Documentation

FileDataSource ( ) [inline]

Definition at line 95 of file FileSystemDataSource.cs.

        {
            dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;
            _cache = new List<FileItem>();
        }

FileDataSource ( ) [inline]

Definition at line 95 of file FileSystemDataSource.cs.

        {
            dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;
            _cache = new List<FileItem>();
        }

Member Function Documentation

int IList. Add ( object item ) [inline, private]

Definition at line 236 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. Add ( FileItem item ) [inline, private]

Definition at line 308 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

int IList. Add ( object item ) [inline, private]

Definition at line 236 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. Add ( FileItem item ) [inline, private]

Definition at line 308 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Clear ( ) [inline, private]

Definition at line 241 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. Clear ( ) [inline, private]

Definition at line 313 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Clear ( ) [inline, private]

Definition at line 241 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. Clear ( ) [inline, private]

Definition at line 313 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 186 of file FileSystemDataSource.cs.

        {
            return ((IList)this).IndexOf(item) != -1;
        }

bool ICollection<FileItem>. Contains ( FileItem item ) [inline, private]

Definition at line 318 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

bool IList. Contains ( object item ) [inline, private]

Definition at line 186 of file FileSystemDataSource.cs.

        {
            return ((IList)this).IndexOf(item) != -1;
        }

bool ICollection<FileItem>. Contains ( FileItem item ) [inline, private]

Definition at line 318 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection. CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 266 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. CopyTo | ( | FileItem[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline, private]

Definition at line 323 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection<FileItem>. CopyTo | ( | FileItem[] | array,
 |  | int | arrayIndex |
 | ) |  |  | [inline, private]

Definition at line 323 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ICollection. CopyTo | ( | Array | array,
 |  | int | index |
 | ) |  |  | [inline, private]

Definition at line 266 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

async Task fetchBatch ( int index ) [inline, private]

Definition at line 170 of file FileSystemDataSource.cs.

        {
            IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)index, (uint)BATCHSIZE);
            List<Task> tasks = new List<Task>(BATCHSIZE);
            for (int i = 0; i < results.Count; i++)
            {
                tasks.Add(
                    FileItem.fromStorageFile(results[i]).ContinueWith((f, j) =>
                    {
                        int cacheIndex = index + (int)j;
                        _cache[cacheIndex] = f.Result;
                    }, i));
            }
            await Task.WhenAll(tasks.ToArray());
        }

async Task fetchBatch ( int index ) [inline, private]

Definition at line 170 of file FileSystemDataSource.cs.

        {
            IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)index, (uint)BATCHSIZE);
            List<Task> tasks = new List<Task>(BATCHSIZE);
            for (int i = 0; i < results.Count; i++)
            {
                tasks.Add(
                    FileItem.fromStorageFile(results[i]).ContinueWith((f, j) =>
                    {
                        int cacheIndex = index + (int)j;
                        _cache[cacheIndex] = f.Result;
                    }, i));
            }
            await Task.WhenAll(tasks.ToArray());
        }

async Task FetchData ( ) [inline, private]

Definition at line 150 of file FileSystemDataSource.cs.

        {
            _count = (int)await _queryResult.GetItemCountAsync();
            this._cache.Clear();
            this._cache.AddRange(new FileItem[_count]);
            for (int i = 0; i < _count; i += BATCHSIZE)
            {
                await fetchBatch(i);
            }

            if (VectorChanged != null)
            {
                VectorChanged(this, new VectorChangedEventArgs() { CollectionChange = CollectionChange.Reset });
            }
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

async Task FetchData ( ) [inline, private]

Definition at line 150 of file FileSystemDataSource.cs.

        {
            _count = (int)await _queryResult.GetItemCountAsync();
            this._cache.Clear();
            this._cache.AddRange(new FileItem[_count]);
            for (int i = 0; i < _count; i += BATCHSIZE)
            {
                await fetchBatch(i);
            }

            if (VectorChanged != null)
            {
                VectorChanged(this, new VectorChangedEventArgs() { CollectionChange = CollectionChange.Reset });
            }
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 271 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

IEnumerator IEnumerable. GetEnumerator ( ) [inline, private]

Definition at line 271 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

IEnumerator<FileItem> IEnumerable<FileItem>. GetEnumerator ( ) [inline, private]

Definition at line 328 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

IEnumerator<FileItem> IEnumerable<FileItem>. GetEnumerator ( ) [inline, private]

Definition at line 328 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

int IList<FileItem>. IndexOf ( FileItem item ) [inline, private]

Definition at line 333 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 246 of file FileSystemDataSource.cs.

        {
            return _cache.IndexOf((FileItem)item);
        }

int IList. IndexOf ( object item ) [inline, private]

Definition at line 246 of file FileSystemDataSource.cs.

        {
            return _cache.IndexOf((FileItem)item);
        }

int IList<FileItem>. IndexOf ( FileItem item ) [inline, private]

Definition at line 333 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList<FileItem>. Insert | ( | int | index,
 |  | FileItem | item |
 | ) |  |  | [inline, private]

Definition at line 338 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Insert | ( | int | index,
 |  | object | value |
 | ) |  |  | [inline, private]

Definition at line 251 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Insert | ( | int | index,
 |  | object | value |
 | ) |  |  | [inline, private]

Definition at line 251 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList<FileItem>. Insert | ( | int | index,
 |  | FileItem | item |
 | ) |  |  | [inline, private]

Definition at line 338 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void QueryResult_ContentsChanged | ( | IStorageQueryResultBase | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 128 of file FileSystemDataSource.cs.

        {
            if (!dispatcher.HasThreadAccess)
            {
                var t = dispatcher.RunAsync(CoreDispatcherPriority.Normal, ResetCollection);
            }
        }

void QueryResult_ContentsChanged | ( | IStorageQueryResultBase | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 128 of file FileSystemDataSource.cs.

        {
            if (!dispatcher.HasThreadAccess)
            {
                var t = dispatcher.RunAsync(CoreDispatcherPriority.Normal, ResetCollection);
            }
        }

bool ICollection<FileItem>. Remove ( FileItem item ) [inline, private]

Definition at line 343 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Remove ( object value ) [inline, private]

Definition at line 256 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

bool ICollection<FileItem>. Remove ( FileItem item ) [inline, private]

Definition at line 343 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. Remove ( object value ) [inline, private]

Definition at line 256 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 261 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList. RemoveAt ( int index ) [inline, private]

Definition at line 261 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList<FileItem>. RemoveAt ( int index ) [inline, private]

Definition at line 348 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void IList<FileItem>. RemoveAt ( int index ) [inline, private]

Definition at line 348 of file FileSystemDataSource.cs.

        {
            throw new NotImplementedException();
        }

void ResetCollection ( ) [inline]

Definition at line 136 of file FileSystemDataSource.cs.

        {
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
            if (VectorChanged != null)
            {
                VectorChanged(this, new VectorChangedEventArgs() { CollectionChange = CollectionChange.Reset });
            }
        }

void ResetCollection ( ) [inline]

Definition at line 136 of file FileSystemDataSource.cs.

        {
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            }
            if (VectorChanged != null)
            {
                VectorChanged(this, new VectorChangedEventArgs() { CollectionChange = CollectionChange.Reset });
            }
        }

IAsyncAction SetupDataSource ( StorageFolder folder ) [inline]

Definition at line 102 of file FileSystemDataSource.cs.

        {
            return this.SetupDataSourceImpl(folder).AsAsyncAction();
        }

IAsyncAction SetupDataSource ( StorageFolder folder ) [inline]

Definition at line 102 of file FileSystemDataSource.cs.

        {
            return this.SetupDataSourceImpl(folder).AsAsyncAction();
        }

async Task SetupDataSourceImpl ( StorageFolder folder ) [inline, private]

Definition at line 107 of file FileSystemDataSource.cs.

        {
            this.Folder = folder;
            QueryOptions options = new QueryOptions();
            options.IndexerOption = IndexerOption.UseIndexerWhenAvailable;
            _queryResult = this.Folder.CreateFileQueryWithOptions(options);
            _queryResult.ContentsChanged += QueryResult_ContentsChanged;
            await FetchData();
        }

async Task SetupDataSourceImpl ( StorageFolder folder ) [inline, private]

Definition at line 107 of file FileSystemDataSource.cs.

        {
            this.Folder = folder;
            QueryOptions options = new QueryOptions();
            options.IndexerOption = IndexerOption.UseIndexerWhenAvailable;
            _queryResult = this.Folder.CreateFileQueryWithOptions(options);
            _queryResult.ContentsChanged += QueryResult_ContentsChanged;
            await FetchData();
        }

IAsyncAction SetupDataSourceUsingPicturesFolder ( ) [inline]

Definition at line 117 of file FileSystemDataSource.cs.

        {
            return SetupDataSourceUsingPicturesFolderImpl().AsAsyncAction();
        }

IAsyncAction SetupDataSourceUsingPicturesFolder ( ) [inline]

Definition at line 117 of file FileSystemDataSource.cs.

        {
            return SetupDataSourceUsingPicturesFolderImpl().AsAsyncAction();
        }

async Task SetupDataSourceUsingPicturesFolderImpl ( ) [inline, private]

Definition at line 121 of file FileSystemDataSource.cs.

        {
            StorageLibrary pictures = await Windows.Storage.StorageLibrary.GetLibraryAsync(Windows.Storage.KnownLibraryId.Pictures);
            await SetupDataSourceImpl(pictures.SaveFolder);
        }

async Task SetupDataSourceUsingPicturesFolderImpl ( ) [inline, private]

Definition at line 121 of file FileSystemDataSource.cs.

        {
            StorageLibrary pictures = await Windows.Storage.StorageLibrary.GetLibraryAsync(Windows.Storage.KnownLibraryId.Pictures);
            await SetupDataSourceImpl(pictures.SaveFolder);
        }

Member Data Documentation

List< FileItem > _cache [private]

Definition at line 90 of file FileSystemDataSource.cs.

int _count = 0 [private]

Definition at line 89 of file FileSystemDataSource.cs.

StorageFileQueryResult _queryResult [private]

Definition at line 87 of file FileSystemDataSource.cs.

const int BATCHSIZE = 50 [private]

Definition at line 148 of file FileSystemDataSource.cs.

CoreDispatcher dispatcher [private]

Definition at line 88 of file FileSystemDataSource.cs.

Property Documentation

int ICollection< FileItem > Count [get]

Definition at line 209 of file FileSystemDataSource.cs.

int ICollection<FileItem>. Count [get, private]

Definition at line 293 of file FileSystemDataSource.cs.

int ICollection. Count [get, private]

Definition at line 218 of file FileSystemDataSource.cs.

StorageFolder Folder [get, set]

Definition at line 126 of file FileSystemDataSource.cs.

bool IList IsFixedSize [get, private]

Definition at line 213 of file FileSystemDataSource.cs.

bool ICollection<FileItem>. IsReadOnly [get, private]

Definition at line 301 of file FileSystemDataSource.cs.

bool ICollection< FileItem > IsReadOnly [get, private]

Definition at line 215 of file FileSystemDataSource.cs.

bool ICollection IsSynchronized [get, private]

Definition at line 220 of file FileSystemDataSource.cs.

object ICollection SyncRoot [get, private]

Definition at line 222 of file FileSystemDataSource.cs.

FileItem IList< FileItem > this [get, set, private]

Definition at line 192 of file FileSystemDataSource.cs.

FileItem IList<FileItem>. this[int index] [get, set, private]

Definition at line 278 of file FileSystemDataSource.cs.

object IList. this[int index] [get, set, private]

Definition at line 225 of file FileSystemDataSource.cs.

Event Documentation

NotifyCollectionChangedEventHandler CollectionChanged

Definition at line 92 of file FileSystemDataSource.cs.

VectorChangedEventHandler< FileItem > VectorChanged

Definition at line 93 of file FileSystemDataSource.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/FileSystemDataSource.cs
  • XamlBind/cs/xBindSampleModel/FileSystemDataSource.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileItem Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • FileItem
Properties | Private Member Functions | Static Private Member Functions | Private Attributes

FileItem Class Reference

List of all members.

Properties

DateTimeOffset | Date [get, set]
string | DisplayName [get, set]
int | FileSize [get, set]
BitmapImage | ImageData [get]
int | ImageHeight [get, set]
int | ImageWidth [get, set]
string | Key [get, set]
string | Path [get, set]
string | prettyDate [get]
string | prettyFileSize [get]
string | prettyImageSize [get]

Private Member Functions

async Task | FetchImageAsync ()
async Task | FetchImageAsync ()

Static Private Member Functions

internal static async Task
< FileItem > 		fromStorageFile (StorageFile f)
internal static async Task
< FileItem > 		fromStorageFile (StorageFile f)

Private Attributes

BitmapImage | _imageData

Detailed Description

Definition at line 20 of file FileSystemDataSource.cs.

Member Function Documentation

async Task FetchImageAsync ( ) [inline, private]

Definition at line 32 of file FileSystemDataSource.cs.

        {
            _imageData = new BitmapImage();
            StorageFile f = await StorageFile.GetFileFromPathAsync(Path);
            await _imageData.SetSourceAsync(await f.GetThumbnailAsync(ThumbnailMode.SingleItem));
        }

async Task FetchImageAsync ( ) [inline, private]

Definition at line 32 of file FileSystemDataSource.cs.

        {
            _imageData = new BitmapImage();
            StorageFile f = await StorageFile.GetFileFromPathAsync(Path);
            await _imageData.SetSourceAsync(await f.GetThumbnailAsync(ThumbnailMode.SingleItem));
        }

internal static async Task<FileItem> fromStorageFile ( StorageFile f ) [inline, static, private]

Definition at line 40 of file FileSystemDataSource.cs.

        {
            FileItem item = new FileItem();
            item.Path = f.Path;
            item.DisplayName = f.DisplayName;
            BasicProperties bp = await f.GetBasicPropertiesAsync();
            item.FileSize = (int)bp.Size;
            item.Date = bp.DateModified;
            item.Key = f.FolderRelativeId;
            ImageProperties ip = await f.Properties.GetImagePropertiesAsync();
            item.ImageWidth = (int)ip.Width;
            item.ImageHeight = (int)ip.Height;
            var t = item.FetchImageAsync();
            return item;
        }

internal static async Task<FileItem> fromStorageFile ( StorageFile f ) [inline, static, private]

Definition at line 40 of file FileSystemDataSource.cs.

        {
            FileItem item = new FileItem();
            item.Path = f.Path;
            item.DisplayName = f.DisplayName;
            BasicProperties bp = await f.GetBasicPropertiesAsync();
            item.FileSize = (int)bp.Size;
            item.Date = bp.DateModified;
            item.Key = f.FolderRelativeId;
            ImageProperties ip = await f.Properties.GetImagePropertiesAsync();
            item.ImageWidth = (int)ip.Width;
            item.ImageHeight = (int)ip.Height;
            var t = item.FetchImageAsync();
            return item;
        }

Member Data Documentation

BitmapImage _imageData [private]

Definition at line 29 of file FileSystemDataSource.cs.

Property Documentation

DateTimeOffset Date [get, set]

Definition at line 25 of file FileSystemDataSource.cs.

string DisplayName [get, set]

Definition at line 22 of file FileSystemDataSource.cs.

int FileSize [get, set]

Definition at line 24 of file FileSystemDataSource.cs.

BitmapImage ImageData [get]

Definition at line 30 of file FileSystemDataSource.cs.

int ImageHeight [get, set]

Definition at line 27 of file FileSystemDataSource.cs.

int ImageWidth [get, set]

Definition at line 26 of file FileSystemDataSource.cs.

string Key [get, set]

Definition at line 38 of file FileSystemDataSource.cs.

string Path [get, set]

Definition at line 23 of file FileSystemDataSource.cs.

string prettyDate [get]

Definition at line 57 of file FileSystemDataSource.cs.

string prettyFileSize [get]

Definition at line 74 of file FileSystemDataSource.cs.

string prettyImageSize [get]

Definition at line 79 of file FileSystemDataSource.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/FileSystemDataSource.cs
  • XamlBind/cs/xBindSampleModel/FileSystemDataSource.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IEmployee Interface Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • IEmployee
Public Member Functions | Properties

IEmployee Interface Reference

Inherited by Employee, Employee, Manager, and Manager.

List of all members.

Public Member Functions

string | FullName ()
string | FullName ()
void | Poke (object sender, RoutedEventArgs e)
void | Poke (object sender, RoutedEventArgs e)

Properties

Manager | DirectManager [get, set]
string | FirstName [get, set]
bool | IsManager [get]
string | LastName [get, set]
string | Name [get]
Windows.UI.Xaml.Media.ImageSource | NullImageSource [get, set]
string | NullStringProperty [get, set]
string | Title [get]
bool | Visibility [get, set]

Detailed Description

Definition at line 17 of file IEmployee.cs.

Member Function Documentation

string FullName ( )

Implemented in Employee, Manager, Employee, and Manager.

string FullName ( )

Implemented in Employee, Manager, Employee, and Manager.

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e
 | ) |  |

Implemented in Employee, Manager, Employee, and Manager.

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e
 | ) |  |

Implemented in Employee, Manager, Employee, and Manager.

Property Documentation

Manager DirectManager [get, set]

Implemented in Employee, and Manager.

Definition at line 21 of file IEmployee.cs.

string FirstName [get, set]

Implemented in Employee, and Manager.

Definition at line 19 of file IEmployee.cs.

bool IsManager [get]

Implemented in Employee, and Manager.

Definition at line 22 of file IEmployee.cs.

string LastName [get, set]

Implemented in Employee, and Manager.

Definition at line 20 of file IEmployee.cs.

string Name [get]

Implemented in Employee, and Manager.

Definition at line 24 of file IEmployee.cs.

Windows UI Xaml Media ImageSource NullImageSource [get, set]

Implemented in Employee, and Manager.

Definition at line 27 of file IEmployee.cs.

string NullStringProperty [get, set]

Implemented in Employee, and Manager.

Definition at line 26 of file IEmployee.cs.

string Title [get]

Implemented in Employee, and Manager.

Definition at line 23 of file IEmployee.cs.

bool Visibility [get, set]

Implemented in Employee, and Manager.

Definition at line 25 of file IEmployee.cs.

The documentation for this interface was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/IEmployee.cs
  • XamlBind/cs/xBindSampleModel/IEmployee.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IntToDoubleConverter Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • IntToDoubleConverter
Public Member Functions

IntToDoubleConverter Class Reference

List of all members.

Public Member Functions

object | Convert (object value, Type targetType, object parameter, string language)
object | Convert (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)
object | ConvertBack (object value, Type targetType, object parameter, string language)

Detailed Description

Definition at line 38 of file DoubleToIntConverter.cs.

Member Function Documentation

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 40 of file DoubleToIntConverter.cs.

        {
            return (double)((Int32)value);
        }

object Convert | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 40 of file DoubleToIntConverter.cs.

        {
            return (double)((Int32)value);
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 45 of file DoubleToIntConverter.cs.

        {
            return (Int32)((double)value);
        }

object ConvertBack | ( | object | value,
 |  | Type | targetType,
 |  | object | parameter,
 |  | string | language |
 | ) |  |  | [inline]

Definition at line 45 of file DoubleToIntConverter.cs.

        {
            return (Int32)((double)value);
        }

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/DoubleToIntConverter.cs
  • XamlBind/cs/xBindSampleModel/DoubleToIntConverter.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Manager Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • Manager
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

Manager Class Reference

Inherits xBindSampleModel::IEmployee, and xBindSampleModel::IEmployee.

List of all members.

Public Member Functions

Manager ()
Manager ()
string | FullName ()
string | FullName ()
void | Poke (object sender, RoutedEventArgs e)
void | Poke (object sender, RoutedEventArgs e)

Properties

Manager | DirectManager [get, set]
string | FirstName [get, set]
bool | IsManager [get]
string | LastName [get, set]
string | Name [get]
Windows.UI.Xaml.Media.ImageSource | NullImageSource [get, set]
string | NullStringProperty [get, set]
EmployeeDictionary | ReportsDict [get]
IEnumerable< IEmployee > | ReportsEnum [get]
IList< IEmployee > | ReportsList [get]
EmployeeCollection | ReportsOC [get]
String | Title [get]
bool | Visibility [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")
void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")

Private Attributes

Employee _employee
EmployeeCollection _reports
EmployeeDictionary _reportsDictionary

Detailed Description

Definition at line 17 of file Manager.cs.

Constructor & Destructor Documentation

Manager ( ) [inline]

Definition at line 23 of file Manager.cs.

        {
            _employee = new Employee();
            _reports = new EmployeeCollection();
            _reportsDictionary = new EmployeeDictionary();
        }

Manager ( ) [inline]

Definition at line 23 of file Manager.cs.

        {
            _employee = new Employee();
            _reports = new EmployeeCollection();
            _reportsDictionary = new EmployeeDictionary();
        }

Member Function Documentation

string FullName ( ) [inline]

Implements IEmployee.

Definition at line 113 of file Manager.cs.

{  return FirstName + " " + LastName; }

string FullName ( ) [inline]

Implements IEmployee.

Definition at line 113 of file Manager.cs.

{  return FirstName + " " + LastName; }

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 119 of file Manager.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 119 of file Manager.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Implements IEmployee.

Definition at line 95 of file Manager.cs.

        {
            MessageDialog dlg = new MessageDialog("Employees of " + Name + " have been poked.");
            var t = dlg.ShowAsync();
        }

void Poke | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline]

Implements IEmployee.

Definition at line 95 of file Manager.cs.

        {
            MessageDialog dlg = new MessageDialog("Employees of " + Name + " have been poked.");
            var t = dlg.ShowAsync();
        }

Member Data Documentation

Employee _employee [private]

Definition at line 19 of file Manager.cs.

EmployeeCollection _reports [private]

Definition at line 20 of file Manager.cs.

EmployeeDictionary _reportsDictionary [private]

Definition at line 21 of file Manager.cs.

Property Documentation

Manager DirectManager [get, set]

Implements IEmployee.

Definition at line 83 of file Manager.cs.

string FirstName [get, set]

Implements IEmployee.

Definition at line 55 of file Manager.cs.

bool IsManager [get]

Implements IEmployee.

Definition at line 101 of file Manager.cs.

string LastName [get, set]

Implements IEmployee.

Definition at line 69 of file Manager.cs.

string Name [get]

Implements IEmployee.

Definition at line 111 of file Manager.cs.

Windows UI Xaml Media ImageSource NullImageSource [get, set]

Implements IEmployee.

Definition at line 37 of file Manager.cs.

string NullStringProperty [get, set]

Implements IEmployee.

Definition at line 35 of file Manager.cs.

EmployeeDictionary ReportsDict [get]

Definition at line 33 of file Manager.cs.

IEnumerable< IEmployee > ReportsEnum [get]

Definition at line 30 of file Manager.cs.

IList< IEmployee > ReportsList [get]

Definition at line 31 of file Manager.cs.

EmployeeCollection ReportsOC [get]

Definition at line 32 of file Manager.cs.

String Title [get]

Implements IEmployee.

Definition at line 104 of file Manager.cs.

bool Visibility [get, set]

Implements IEmployee.

Definition at line 43 of file Manager.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 117 of file Manager.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/Manager.cs
  • XamlBind/cs/xBindSampleModel/Manager.cs
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapChangedEventArgs< K > Class Template Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • MapChangedEventArgs< K >
Properties

MapChangedEventArgs< K > Class Template Reference

List of all members.

Properties

CollectionChange | CollectionChange [get, set]
K | Key [get, set]

Detailed Description

template<K>
class xBindSampleModel::MapChangedEventArgs-g< K >

Definition at line 155 of file EmployeeCollection.cs.

Property Documentation

CollectionChange CollectionChange [get, set]

Definition at line 157 of file EmployeeCollection.cs.

K Key [get, set]

Definition at line 158 of file EmployeeCollection.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs
  • XamlBind/cs/xBindSampleModel/EmployeeCollection.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VectorChangedEventArgs Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • VectorChangedEventArgs
Properties

VectorChangedEventArgs Class Reference

List of all members.

Properties

CollectionChange | CollectionChange [get, set]
uint | Index [get, set]

Detailed Description

Definition at line 11 of file EmployeeCollection.cs.

Property Documentation

CollectionChange CollectionChange [get, set]

Definition at line 13 of file EmployeeCollection.cs.

uint Index [get, set]

Definition at line 14 of file EmployeeCollection.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs
  • XamlBind/cs/xBindSampleModel/EmployeeCollection.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: YangContainer Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xBindSampleModel
  • YangContainer
Public Member Functions | Properties | Events | Private Member Functions | Private Attributes

YangContainer Class Reference

List of all members.

Public Member Functions

YangContainer (DOModel parent)
YangContainer (DOModel parent)

Properties

double | Value [get, set]

Events

PropertyChangedEventHandler | PropertyChanged

Private Member Functions

void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")
void | NotifyPropertyChanged ([CallerMemberName] string propertyName="")

Private Attributes

DOModel _parent
double | _value

Detailed Description

Definition at line 67 of file DOModel.cs.

Constructor & Destructor Documentation

YangContainer ( DOModel parent ) [inline]

Definition at line 71 of file DOModel.cs.

        {
            _parent = parent;
        }

YangContainer ( DOModel parent ) [inline]

Definition at line 71 of file DOModel.cs.

        {
            _parent = parent;
        }

Member Function Documentation

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 96 of file DOModel.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

void NotifyPropertyChanged ( [CallerMemberName] string propertyName = "" ) [inline, private]

Definition at line 96 of file DOModel.cs.

        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

Member Data Documentation

DOModel _parent [private]

Definition at line 69 of file DOModel.cs.

double _value [private]

Definition at line 76 of file DOModel.cs.

Property Documentation

double Value [get, set]

Definition at line 78 of file DOModel.cs.

Event Documentation

PropertyChangedEventHandler PropertyChanged

Definition at line 94 of file DOModel.cs.

The documentation for this class was generated from the following files:
  • XamlBind/cpp/xBindSampleModel/DOModel.cs
  • XamlBind/cs/xBindSampleModel/DOModel.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Account Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • Account
Properties

Account Class Reference

List of all members.

Properties

string | AccountName [get, set]
string | IconUri [get, set]

Detailed Description

Definition at line 59 of file AdaptivePage.xaml.cs.

Property Documentation

string AccountName [get, set]

Definition at line 61 of file AdaptivePage.xaml.cs.

string IconUri [get, set]

Definition at line 62 of file AdaptivePage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptivePage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • AdaptivePage
Public Member Functions | Properties | Private Member Functions

AdaptivePage Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

AdaptivePage ()

Properties

ObservableCollection< Account > | Accounts [get, set]
ObservableCollection< Email > | Emails [get, set]

Private Member Functions

void | AccountsList_Loading (FrameworkElement sender, object args)
void | AdaptivePage_VisibleBoundsChanged (ApplicationView sender, object args)

Detailed Description

Definition at line 12 of file AdaptivePage.xaml.cs.

Constructor & Destructor Documentation

AdaptivePage ( ) [inline]

Definition at line 17 of file AdaptivePage.xaml.cs.

        {
            this.InitializeComponent();

            Accounts = new ObservableCollection<Account>()
            {
                new Account() { AccountName = "test@outlook.com", IconUri = @"ms-appx:///Assets/Icons/outlook.png" },
                new Account() { AccountName = "test@gmail.com", IconUri = @"ms-appx:///Assets/Icons/gmail.png" },
                new Account() { AccountName = "test@yahoo.com", IconUri = @"ms-appx:///Assets/Icons/yahoo.png" },
                new Account() { AccountName = "test@mydomain.com", IconUri = @"ms-appx:///Assets/Icons/email.png" }
            };

            Emails = new ObservableCollection<Email>()
            {
                new Email() { From = "manager@company.com", Subject = "Weekend work", Body = "I'm going to need you to come in on Sunday too to cover for Bill.", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(1)).ToString("g")},
                new Email() { From = "employee@company.com", Subject = "Project link", Body = "Hey, can I get a link to the project you told me about?", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(2)).ToString("g")},
                new Email() { From = "spouse@home.com", Subject = "Groceries", Body = "Can you pick up some milk on your way home?", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(5)).ToString("g")},
                new Email() { From = "coworker@company.com", Subject = "PTO", Body = "I heard you're heading to the Bahamas soon?  So jealous!", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(15)).ToString("g")},
                new Email() { From = "hr@company.com", Subject = "PTO approved", Body = "Your PTO request has been approved.  Please remember to log your time.", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(30)).ToString("g")}
            };
            MailList.ItemsSource = Emails;

            ApplicationView.GetForCurrentView().VisibleBoundsChanged += AdaptivePage_VisibleBoundsChanged;
        }

Member Function Documentation

void AccountsList_Loading | ( | FrameworkElement | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 52 of file AdaptivePage.xaml.cs.

        {
            //We need to do this in Loading for AccountsList, since it's possible that it will be created later
            AccountsList.ItemsSource = Accounts;
        }

void AdaptivePage_VisibleBoundsChanged | ( | ApplicationView | sender,
 |  | object | args |
 | ) |  |  | [inline, private]

Definition at line 42 of file AdaptivePage.xaml.cs.

        {
            //Here we are hiding panes when we get to certain thresholds
            if (ApplicationView.GetForCurrentView().VisibleBounds.Width < 768 && ReadingPane != null)
                ReadingPane.Visibility = Visibility.Collapsed;

            if (ApplicationView.GetForCurrentView().VisibleBounds.Width < 1024 && AccountsList != null)
                AccountsList.Visibility = Visibility.Collapsed;
        }

Property Documentation

ObservableCollection<Account> Accounts [get, set]

Definition at line 14 of file AdaptivePage.xaml.cs.

ObservableCollection<Email> Emails [get, set]

Definition at line 15 of file AdaptivePage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicDeferral Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • BasicDeferral
Public Member Functions | Private Member Functions

BasicDeferral Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

BasicDeferral ()

Private Member Functions

void RealizeElements_Click (object sender, RoutedEventArgs e)

Detailed Description

Definition at line 24 of file BasicDeferral.xaml.cs.

Constructor & Destructor Documentation

BasicDeferral ( ) [inline]

Definition at line 26 of file BasicDeferral.xaml.cs.

        {
            this.InitializeComponent();
        }

Member Function Documentation

void RealizeElements_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 31 of file BasicDeferral.xaml.cs.

        {
            this.FindName("DeferredGrid"); //This will realize the deferred grid
        }

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/Scenarios/BasicDeferral.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeferredControlTemplatePart Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • DeferredControlTemplatePart
Public Member Functions

DeferredControlTemplatePart Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

DeferredControlTemplatePart ()

Detailed Description

Definition at line 21 of file DeferredControlTemplatePart.xaml.cs.

Constructor & Destructor Documentation

DeferredControlTemplatePart ( ) [inline]

Definition at line 23 of file DeferredControlTemplatePart.xaml.cs.

        {
            this.InitializeComponent();
        }

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/Scenarios/DeferredControlTemplatePart.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Email Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • Email
Properties

Email Class Reference

List of all members.

Properties

string | Body [get, set]
string | From [get, set]
string | ReceivedDate [get, set]
string | Subject [get, set]

Detailed Description

Definition at line 65 of file AdaptivePage.xaml.cs.

Property Documentation

string Body [get, set]

Definition at line 69 of file AdaptivePage.xaml.cs.

string From [get, set]

Definition at line 67 of file AdaptivePage.xaml.cs.

string ReceivedDate [get, set]

Definition at line 70 of file AdaptivePage.xaml.cs.

string Subject [get, set]

Definition at line 68 of file AdaptivePage.xaml.cs.

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitledImage Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • xDeferLoadStrategy
  • TitledImage
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes

TitledImage Class Reference

List of all members.

Public Member Functions

TitledImage ()

Static Public Attributes

static readonly DependencyProperty | HeaderProperty = DependencyProperty.Register("Header", typeof(string), typeof(TitledImage), new PropertyMetadata(null))
static readonly DependencyProperty | SourceProperty = DependencyProperty.Register("Source", typeof(ImageSource), typeof(TitledImage), new PropertyMetadata(null))

Protected Member Functions

override void | OnApplyTemplate ()

Properties

string | Header [get, set]
ImageSource | Source [get, set]

Private Member Functions

void | HeaderChanged (DependencyObject sender, DependencyProperty prop)

Private Attributes

ContentPresenter | _header

Detailed Description

Definition at line 8 of file TitledImage.cs.

Constructor & Destructor Documentation

TitledImage ( ) [inline]

Definition at line 36 of file TitledImage.cs.

        {
            this.DefaultStyleKey = typeof(TitledImage);

            //We need to register the callback in case they change the header at runtime
            this.RegisterPropertyChangedCallback(HeaderProperty, HeaderChanged);
        }

Member Function Documentation

void HeaderChanged | ( | DependencyObject | sender,
 |  | DependencyProperty | prop |
 | ) |  |  | [inline, private]

Definition at line 17 of file TitledImage.cs.

        {
            string header = (string)sender.GetValue(prop);
            //Double check to make sure that we don't needlessly realize the header presenter
            if (!string.IsNullOrEmpty(Header) && _header == null)
            {
                _header = (ContentPresenter)GetTemplateChild("HeaderPresenter"); //This will realize the element
            }
        }

override void OnApplyTemplate ( ) [inline, protected]

Definition at line 44 of file TitledImage.cs.

        {
            base.OnApplyTemplate();

            //Check to see if there's a header, and realize the element if there is one
            if(!string.IsNullOrEmpty(Header))
            {
                _header = (ContentPresenter)GetTemplateChild("HeaderPresenter"); //This will realize the element
            }
        }

Member Data Documentation

ContentPresenter _header [private]

Definition at line 34 of file TitledImage.cs.

readonly DependencyProperty HeaderProperty = DependencyProperty.Register("Header", typeof(string), typeof(TitledImage), new PropertyMetadata(null)) [static]

Definition at line 10 of file TitledImage.cs.

readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source", typeof(ImageSource), typeof(TitledImage), new PropertyMetadata(null)) [static]

Definition at line 27 of file TitledImage.cs.

Property Documentation

string Header [get, set]

Definition at line 12 of file TitledImage.cs.

ImageSource Source [get, set]

Definition at line 29 of file TitledImage.cs.

The documentation for this class was generated from the following file:
  • XamlDeferLoadStrategy/cs/TitledImage.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BuildNewRss Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Xml
  • BuildNewRss
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

BuildNewRss Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

BuildNewRss ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Scenario1BtnDefault_Click (object sender, RoutedEventArgs e)
async void | Scenario1Init ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario1_BuildNewRss.xaml.cs.

Constructor & Destructor Documentation

BuildNewRss ( ) [inline]

Definition at line 29 of file Scenario1_BuildNewRss.xaml.cs.

        {
            this.InitializeComponent();

            Scenario1Init();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 41 of file Scenario1_BuildNewRss.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Scenario1BtnDefault_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario1BtnDefault' button.

Parameters:
sender
e

Definition at line 51 of file Scenario1_BuildNewRss.xaml.cs.

        {
            String rss = scenario1RssInput.Text;
            if (null != rss && "" != rss)
            {
                String xml;
                var doc = new Windows.Data.Xml.Dom.XmlDocument();
                scenario1OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
                doc.LoadXml(xml);

                // create a rss CDataSection and insert into DOM tree
                var cdata = doc.CreateCDataSection(rss);
                var element = doc.GetElementsByTagName("content").Item(0);
                element.AppendChild(cdata);

                Scenario.RichEditBoxSetMsg(scenario1Result, doc.GetXml(), true);
            }
            else
            {
                Scenario.RichEditBoxSetError(scenario1Result, "Please type in RSS content in the [RSS Content] box firstly.");
            }
        }

async void Scenario1Init ( ) [inline, private]

Definition at line 74 of file Scenario1_BuildNewRss.xaml.cs.

        {
            try
            {
                Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("buildRss", "rssTemplate.xml");
                Scenario.RichEditBoxSetMsg(scenario1OriginalData, doc.GetXml(), true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario1Result, exp.Message);
                rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 27 of file Scenario1_BuildNewRss.xaml.cs.

The documentation for this class was generated from the following file:
  • XmlDocument/cs/Scenario1_BuildNewRss.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GiftDispatch Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Xml
  • GiftDispatch
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

GiftDispatch Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

GiftDispatch ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Scenario4BtnDefault_Click (object sender, RoutedEventArgs e)
async void | Scenario4Init ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario4_GiftDispatch.xaml.cs.

Constructor & Destructor Documentation

GiftDispatch ( ) [inline]

Definition at line 30 of file Scenario4_GiftDispatch.xaml.cs.

        {
            this.InitializeComponent();

            Scenario4Init();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 42 of file Scenario4_GiftDispatch.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Scenario4BtnDefault_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario4BtnDefault' button.

Parameters:
sender
e

Definition at line 66 of file Scenario4_GiftDispatch.xaml.cs.

        {
            String xml;
            scenario4OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

            var doc = new Windows.Data.Xml.Dom.XmlDocument();
            doc.LoadXml(xml);

            var thisYear = 2012;    // Here we don't use DateTime.Now.Year to get the current year so that all gifts can be delivered.
            var previousOneYear = thisYear - 1;
            var previousFiveYear = thisYear - 5;
            var previousTenYear = thisYear - 10;

            var xpathArray = new String[3];
            // select >= 1 year and < 5 years
            xpathArray[0] = "descendant::employee[startyear <= " + previousOneYear + " and startyear > " + previousFiveYear + "]";
            // select >= 5 years and < 10 years
            xpathArray[1] = "descendant::employee[startyear <= " + previousFiveYear + " and startyear > " + previousTenYear + "]";
            // select >= 10 years
            xpathArray[2] = "descendant::employee[startyear <= " + previousTenYear + "]";

            var Gifts = new String[3] { "Gift Card", "XBOX", "Windows Phone" };

            var output = new StringBuilder();
            uint i = 0;
            foreach (var xpath in xpathArray)
            {
                var employees = doc.SelectNodes(xpath);
                foreach (var emplopyee in employees)
                {
                    var employeeName = emplopyee.SelectSingleNode("descendant::name");
                    var department = emplopyee.SelectSingleNode("descendant::department");

                    output.AppendFormat("[{0}]/[{1}]/[{2}]\n", employeeName.FirstChild.NodeValue, department.FirstChild.NodeValue, Gifts[(i++) % 3]);
                }
            }

            Scenario.RichEditBoxSetMsg(scenario4Result, output.ToString(), true);
        }

async void Scenario4Init ( ) [inline, private]

Definition at line 47 of file Scenario4_GiftDispatch.xaml.cs.

        {
            try
            {
                Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("giftDispatch", "employees.xml");
                Scenario.RichEditBoxSetMsg(scenario4OriginalData, doc.GetXml(), true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario4Result, exp.Message);
                rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 28 of file Scenario4_GiftDispatch.xaml.cs.

The documentation for this class was generated from the following file:
  • XmlDocument/cs/Scenario4_GiftDispatch.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MarkHotProducts Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Xml
  • MarkHotProducts
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

MarkHotProducts Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

MarkHotProducts ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

void | Scenario2BtnDefault_Click (object sender, RoutedEventArgs e)
async void | Scenario2BtnSave_Click (object sender, RoutedEventArgs e)
async void | Scenario2Init ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario2_MarkHotProducts.xaml.cs.

Constructor & Destructor Documentation

MarkHotProducts ( ) [inline]

Definition at line 29 of file Scenario2_MarkHotProducts.xaml.cs.

        {
            this.InitializeComponent();

            Scenario2Init();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 41 of file Scenario2_MarkHotProducts.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

void Scenario2BtnDefault_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario2BtnDefault' button.

This function will look up products and mark hot products.

Parameters:
sender
e

Definition at line 52 of file Scenario2_MarkHotProducts.xaml.cs.

        {
            String xml;
            scenario2OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

            var doc = new Windows.Data.Xml.Dom.XmlDocument();
            doc.LoadXml(xml);

            // Mark 'hot' attribute to '1' if 'sell10days' is greater than 'InStore'
            var xpath = "/products/product[Sell10day>InStore]/@hot";
            var hotAttributes = doc.SelectNodes(xpath);
            for (uint index = 0; index < hotAttributes.Length; index++)
            {
                hotAttributes.Item(index).NodeValue = "1";
            }

            Scenario.RichEditBoxSetMsg(scenario2Result, doc.GetXml(), true);
            scenario2BtnSave.IsEnabled = true;  // enable Save button
        }

async void Scenario2BtnSave_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario2BtnSave' button.

This function is to save the new xml in which hot products are marked to a file.

Parameters:
sender
e

Definition at line 78 of file Scenario2_MarkHotProducts.xaml.cs.

        {
            String xml;
            scenario2Result.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

            var doc = new Windows.Data.Xml.Dom.XmlDocument();
            doc.LoadXml(xml);

            // save xml to a file
            var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("HotProducts.xml", Windows.Storage.CreationCollisionOption.GenerateUniqueName);
            await doc.SaveToFileAsync(file);

            Scenario.RichEditBoxSetMsg(scenario2Result, "Save to \"" + file.Path + "\" successfully.", true);

            scenario2BtnSave.IsEnabled = false;
        }

async void Scenario2Init ( ) [inline, private]

Definition at line 95 of file Scenario2_MarkHotProducts.xaml.cs.

        {
            try
            {
                Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("markHotProducts", "products.xml");
                Scenario.RichEditBoxSetMsg(scenario2OriginalData, doc.GetXml(), true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario2Result, exp.Message);
                rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 27 of file Scenario2_MarkHotProducts.xaml.cs.

The documentation for this class was generated from the following file:
  • XmlDocument/cs/Scenario2_MarkHotProducts.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLoading Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Xml
  • XmlLoading
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XmlLoading Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

XmlLoading ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | LaunchUri (object sender, RoutedEventArgs e)
async void | Scenario3BtnBuffer_Click (object sender, RoutedEventArgs e)
async void | Scenario3BtnFile_Click (object sender, RoutedEventArgs e)
async void | Scenario3Init ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 25 of file Scenario3_XmlLoading.xaml.cs.

Constructor & Destructor Documentation

XmlLoading ( ) [inline]

Definition at line 29 of file Scenario3_XmlLoading.xaml.cs.

        {
            this.InitializeComponent();

            Scenario3Init();
        }

Member Function Documentation

async void LaunchUri | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

Definition at line 160 of file Scenario3_XmlLoading.xaml.cs.

        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
        }

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 41 of file Scenario3_XmlLoading.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Scenario3BtnBuffer_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'scenario3BtnBuffer' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 66 of file Scenario3_XmlLoading.xaml.cs.

        {
            try
            {
                // Get load settings
                var loadSettings = new Windows.Data.Xml.Dom.XmlLoadSettings();
                if (true == scenario3RB1.IsChecked)
                {
                    loadSettings.ProhibitDtd = true;        // DTD is prohibited
                    loadSettings.ResolveExternals = false;  // Disable the resolve to external definitions such as external DTD
                }
                else if (true == scenario3RB2.IsChecked)
                {
                    loadSettings.ProhibitDtd = false;       // DTD is not prohibited
                    loadSettings.ResolveExternals = false;  // Disable the resolve to external definitions such as external DTD
                }
                else if (true == scenario3RB3.IsChecked)
                {
                    loadSettings.ProhibitDtd = false;       // DTD is not prohibited
                    loadSettings.ResolveExternals = true;   // Enable the resolve to external definitions such as external DTD
                }

                String xml;

                scenario3OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

                // Set external dtd file path
                if (loadSettings.ResolveExternals == true && loadSettings.ProhibitDtd == false)
                {
                    Windows.Storage.StorageFolder storageFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("loadExternaldtd");
                    String dtdPath = storageFolder.Path + "\\dtd.txt";
                    xml = xml.Replace("dtd.txt", dtdPath);
                }

                var dataWriter = new Windows.Storage.Streams.DataWriter();

                dataWriter.WriteString(xml);

                Windows.Storage.Streams.IBuffer ibuffer = dataWriter.DetachBuffer();

                var doc = new Windows.Data.Xml.Dom.XmlDocument();

                doc.LoadXmlFromBuffer(ibuffer, loadSettings);

                Scenario.RichEditBoxSetMsg(scenario3Result, doc.GetXml(), true);
            }
            catch (Exception)
            {
                // After loadSettings.ProhibitDtd is set to true, the exception is expected as the sample XML contains DTD
                Scenario.RichEditBoxSetError(scenario3Result, "Error: DTD is prohibited");
            }
        }

async void Scenario3BtnFile_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario3BtnFile' button.

You would replace this with your own handler if you have a button or buttons on this page.

Parameters:
sender
e

Definition at line 125 of file Scenario3_XmlLoading.xaml.cs.

        {
            try
            {
                // get load settings
                var loadSettings = new Windows.Data.Xml.Dom.XmlLoadSettings();
                if (true == scenario3RB1.IsChecked)
                {
                    loadSettings.ProhibitDtd = true;        // DTD is prohibited
                    loadSettings.ResolveExternals = false;  // Disable the resolve to external definitions such as external DTD
                }
                else if (true == scenario3RB2.IsChecked)
                {
                    loadSettings.ProhibitDtd = false;       // DTD is not prohibited
                    loadSettings.ResolveExternals = false;  // Disable the resolve to external definitions such as external DTD
                }
                else if (true == scenario3RB3.IsChecked)
                {
                    loadSettings.ProhibitDtd = false;       // DTD is not prohibited
                    loadSettings.ResolveExternals = true;   // Enable the resolve to external definitions such as external DTD
                }

                var folder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("loadExternaldtd");
                var file = await folder.GetFileAsync("xmlWithExternaldtd.xml");

                var doc = await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(file, loadSettings);

                Scenario.RichEditBoxSetMsg(scenario3Result, doc.GetXml(), true);
            }
            catch (Exception)
            {
                // After loadSettings.ProhibitDtd is set to true, the exception is expected as the sample XML contains DTD
                Scenario.RichEditBoxSetError(scenario3Result, "Error: DTD is prohibited");
            }
        }

async void Scenario3Init ( ) [inline, private]

Definition at line 46 of file Scenario3_XmlLoading.xaml.cs.

        {
            try
            {
                Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("loadExternaldtd", "xmlWithExternaldtd.xml");
                Scenario.RichEditBoxSetMsg(scenario3OriginalData, doc.GetXml(), true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario3Result, exp.Message);
                rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 27 of file Scenario3_XmlLoading.xaml.cs.

The documentation for this class was generated from the following file:
  • XmlDocument/cs/Scenario3_XmlLoading.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XSLTTransform Class Reference

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • Xml
  • XSLTTransform
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XSLTTransform Class Reference

An empty page that can be used on its own or navigated to within a Frame.

List of all members.

Public Member Functions

XSLTTransform ()

Protected Member Functions

override void | OnNavigatedTo (NavigationEventArgs e)

Private Member Functions

async void | Scenario5BtnTransformToDocument_Click (object sender, RoutedEventArgs e)
void | Scenario5BtnTransformToString_Click (object sender, RoutedEventArgs e)
void | Scenario5Init ()
async void | XsltInit ()

Private Attributes

MainPage rootPage

Detailed Description

Definition at line 26 of file Scenario5_XSLTTransform.xaml.cs.

Constructor & Destructor Documentation

XSLTTransform ( ) [inline]

Definition at line 30 of file Scenario5_XSLTTransform.xaml.cs.

        {
            this.InitializeComponent();

            Scenario5Init();
        }

Member Function Documentation

override void OnNavigatedTo ( NavigationEventArgs e ) [inline, protected]

Invoked when this page is about to be displayed in a Frame.

Parameters:
e Event data that describes how this page was reached. The Parameter property is typically used to configure the page.

Definition at line 42 of file Scenario5_XSLTTransform.xaml.cs.

        {
            rootPage = MainPage.Current;
        }

async void Scenario5BtnTransformToDocument_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario5BtnTransformToDocument' button.

Parameters:
sender
e

Definition at line 160 of file Scenario5_XSLTTransform.xaml.cs.

        {
            scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
            scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
            Scenario.RichEditBoxSetMsg(scenario5Result, "", true);

            Windows.Data.Xml.Dom.XmlDocument doc;
            Windows.Data.Xml.Dom.XmlDocument xsltDoc;
            String xml;
            String xslt;

            // Get xml content from xml input field
            scenario5Xml.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

            // Get xslt content from xslt input field
            scenario5Xslt.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xslt);

            if (null == xml || "" == xml.Trim())
            {
                Scenario.RichEditBoxSetError(scenario5Result, "Source XML can't be empty");
                return;
            }

            if (null == xslt || "" == xslt.Trim())
            {
                Scenario.RichEditBoxSetError(scenario5Result, "XSL content can't be empty");
                return;
            }

            try
            {
                // Load xml content
                doc = new Windows.Data.Xml.Dom.XmlDocument();
                doc.LoadXml(xml);
            }
            catch (Exception exp)
            {
                scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }

            try
            {
                // Load xslt content
                xsltDoc = new Windows.Data.Xml.Dom.XmlDocument();
                xsltDoc.LoadXml(xslt);
            }
            catch (Exception exp)
            {
                scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }

            try
            {
                // Transform xml according to the style sheet declaration specified in xslt file
                var xsltProcessor = new Windows.Data.Xml.Xsl.XsltProcessor(xsltDoc);
                Windows.Data.Xml.Dom.XmlDocument transformedDocument = xsltProcessor.TransformToDocument(doc);

                Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
                Windows.Storage.StorageFile xmlFile = await storageFolder.CreateFileAsync("transformed.xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);
                await transformedDocument.SaveToFileAsync(xmlFile);
                Scenario.RichEditBoxSetMsg(scenario5Result, string.Format("The result has been saved to: \n" + xmlFile.Path), true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }
        }

void Scenario5BtnTransformToString_Click | ( | object | sender,
 |  | RoutedEventArgs | e |
 | ) |  |  | [inline, private]

This is the click handler for the 'Scenario5BtnTransformToString' button.

Parameters:
sender
e

Definition at line 85 of file Scenario5_XSLTTransform.xaml.cs.

        {
            scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
            scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
            Scenario.RichEditBoxSetMsg(scenario5Result, "", true);

            Windows.Data.Xml.Dom.XmlDocument doc;
            Windows.Data.Xml.Dom.XmlDocument xsltDoc;
            String xml;
            String xslt;

            // Get xml content from xml input field
            scenario5Xml.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);

            // Get xslt content from xslt input field
            scenario5Xslt.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xslt);

            if (null == xml || "" == xml.Trim())
            {
                Scenario.RichEditBoxSetError(scenario5Result, "Source XML can't be empty");
                return;
            }

            if (null == xslt || "" == xslt.Trim())
            {
                Scenario.RichEditBoxSetError(scenario5Result, "XSL content can't be empty");
                return;
            }

            try
            {
                // Load xml content
                doc = new Windows.Data.Xml.Dom.XmlDocument();
                doc.LoadXml(xml);
            }
            catch (Exception exp)
            {
                scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }

            try
            {
                // Load xslt content
                xsltDoc = new Windows.Data.Xml.Dom.XmlDocument();
                xsltDoc.LoadXml(xslt);
            }
            catch (Exception exp)
            {
                scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }

            try
            {
                // Transform xml according to the style sheet declaration specified in xslt file
                var xsltProcessor = new Windows.Data.Xml.Xsl.XsltProcessor(xsltDoc);
                String transformedStr = xsltProcessor.TransformToString(doc);
                Scenario.RichEditBoxSetMsg(scenario5Result, transformedStr, true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                return;
            }
        }

void Scenario5Init ( ) [inline, private]

Definition at line 75 of file Scenario5_XSLTTransform.xaml.cs.

        {
            XsltInit();
        }

async void XsltInit ( ) [inline, private]

Definition at line 47 of file Scenario5_XSLTTransform.xaml.cs.

        {
            try
            {
                Windows.Storage.StorageFolder storageFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("xsltTransform");
                Windows.Storage.StorageFile xmlFile = await storageFolder.GetFileAsync("xmlContent.xml");
                Windows.Storage.StorageFile xsltFile = await storageFolder.GetFileAsync("xslContent.xml");

                // load xml file
                Windows.Data.Xml.Dom.XmlDocument doc = await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(xmlFile);
                Scenario.RichEditBoxSetMsg(scenario5Xml, doc.GetXml(), false);

                // load xslt file
                doc = await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(xsltFile);

                // Display xml and xslt file content in the input fields
                Scenario.RichEditBoxSetMsg(scenario5Xslt, doc.GetXml(), false);
                Scenario.RichEditBoxSetMsg(scenario5Result, "", true);
            }
            catch (Exception exp)
            {
                Scenario.RichEditBoxSetMsg(scenario5Xml, "", false);
                Scenario.RichEditBoxSetMsg(scenario5Xslt, "", false);
                Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
                rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
            }
        }

Member Data Documentation

MainPage rootPage [private]

Definition at line 28 of file Scenario5_XSLTTransform.xaml.cs.

The documentation for this class was generated from the following file:
  • XmlDocument/cs/Scenario5_XSLTTransform.xaml.cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Hierarchical Index

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • _360VideoPlaybackMain
  • App
  • AppView
  • AppViewSource
  • Disposer
    • CameraResources
    • DeviceResources
    • VideoRenderer
  • InteropStatics::IDirect3DDxgiInterfaceAccess
  • SpatialInputHandler
  • StepTimer
  • ViewProjectionConstantBuffer
  • ModelConstantBuffer
  • VertexPositionColor
  • VertexPositionTexture
  • FocusPointConstantBuffer
  • Helpers
  • MainPage
  • MediaTransportControls
  • ModelConstantBuffer
  • PlaybackPage
  • Program
  • sealed
  • SpatialInputHandler
  • VertexPositionTexture
  • VideoGallery
  • VideoGallery::VideoItemInfo
  • VideoItem
  • VideoRenderer
  • _RPC_CLIENT
  • WrlFinal
  • DefaultAccountScenario
  • IdentityChecker
  • MultipleAccountsScenario
  • SingleAccountScenario
  • SingleAzureADScenario
  • SingleMicrosoftAccountScenario
  • App
  • DateTimeOffsetConverter
  • INavigationService
    • NavigationService
  • LoadStateEventArgs
  • NavigationHelper
  • RelayCommand
  • RootFrameNavigationHelper
  • SaveStateEventArgs
  • SuspensionManager
  • SuspensionManagerException
  • VisibilityConverter
  • Trip
  • TripStore
  • TripDetails
  • TripListView
  • TripVoiceCommand
  • ViewModelBase
    • TripListViewModel
    • TripViewModel
  • ViewModelLocator
  • ViewModelBase
    • sealed
    • sealed
  • AdventureWorksVoiceCommandService
  • sealed
  • AllJoynBusObjectManager
  • AuthTypeToStringConverter
  • RelayCommand
  • Scenario1
  • Scenario1ViewModel
  • Scenario2
  • Scenario2ViewModel
  • AllJoynHelpers
  • AppData
  • RelayCommand
  • Scenario1
  • Scenario1ViewModel
  • Scenario2
  • Scenario2ViewModel
  • Animate
    • AnimateCirclePosition
    • AnimateLineListPosition
    • AnimateLinePosition
  • handle_closer
  • CSendOperationStatus
  • SetConnectedFunc
  • ShutdownFunc
  • StartFunc
  • StopFunc
  • AttributeValidationDescriptor
  • MediaTypeValidationDescriptor
  • App
  • Audio
  • IMemoryBufferByteAccess
  • Scenario1_FilePlayback
  • Scenario2_DeviceCapture
  • Scenario3_FrameInput
  • Scenario4_Submix
  • Scenario5_InboxEffects
  • Scenario6_CustomEffects
  • AudioFileReader
  • AudioStreamReader
  • AutoLock
  • sealed
  • BackgroundDeviceWatcher
  • MediaItem
    • MusicItem
    • VideoItem
  • PlaylistView
  • Scenario1
  • PlaybackService
  • SettingsService
  • Settings
  • MediaItemViewModel
  • MediaListViewModel
  • PlaybackSessionViewModel
  • PlaybackStateToButtonIconConverter
  • PlayerViewModel
  • SettingsViewModel
  • BackgroundTaskInformation
  • ConnectTask
  • GeofenceBackgroundTask
  • IoSyncBackgroundTask
  • LocalSettingKeys
  • LocationBackgroundTask
  • Scenario1_BackgroundTask
  • sealed
  • Sync
  • UpdateMetadataTask
  • VisitBackgroundTask
  • AdvertisementPublisherTask
  • AdvertisementWatcherTask
  • BadgeNotificationHistoryChangedTriggerTask
  • BadgeNumericNotificationContent
  • RfcommServerTask
  • ToastActivationTypeBackgroundClosedTask
  • ToastNotificationHistoryChangedTriggerTask
  • ToastNotificationQuickReplyTask
  • BarcodeDecodeTask
  • DecodeEngine
  • DecodeResult
  • Provider
  • sealed
  • AppView
  • AppViewSource
  • BasicHologramMain
  • BasicHologramMain::GamepadWithButtonState
  • Disposer
    • CameraResources
    • DeviceResources
    • SpinningCubeRenderer
  • InteropStatics::IDirect3DDxgiInterfaceAccess
  • SpatialInputHandler
  • StepTimer
  • ViewProjectionConstantBuffer
  • ModelConstantBuffer
  • VertexPositionColor
  • HolographicTemplateAppMain
  • HolographicTemplateAppMain::GamepadWithButtonState
  • ModelConstantBuffer
  • Program
  • sealed
  • SpatialInputHandler
  • SpinningCubeRenderer
  • VertexPositionColor
  • BasicLoader
  • Scenario1
  • Scenario2
  • Scenario3
  • BasicReaderWriter
  • BasicShapes
  • BasicTimer
  • BasicVertex
  • ColorToStringConverter
  • VeryObservableCollection-g< T >
  • Scenario1_Watcher
  • Scenario2_Publisher
  • Scenario3_BackgroundWatcher
  • Scenario4_BackgroundPublisher
  • Camera
  • AdvancedCaptureContext
  • App
  • MainPage
  • MainPage::AdvancedCaptureContext
  • sealed
  • App
  • IMemoryBufferByteAccess
  • MainPage
  • sealed
  • App
  • InvertBoolConverter
  • MainPage
  • RoundingConverter
  • Scenario1_SetRecordProfile
  • Scenario2_ConcurrentProfile
  • Scenario3_EnableHdrProfile
  • App
  • CameraRotationHelper
  • MainPage
  • sealed
  • CameraCoordinateMapper
  • CameraStreamCoordinateMapperMain
  • CameraStreamProcessor
  • CameraStreamProcessor::FrameData
  • GpuCoordinateMapper
  • GpuCoordinateMapper::CameraIntrinsics
  • GpuCoordinateMapper::RasterizedFrameBlob
  • GpuCoordinateMapper::VisualizeFrameBlob
  • QuadRenderer
  • sealed
  • TextRenderer
  • VertexPositionTex
  • App
  • MainPage
  • sealed
  • CardioidSound
  • CAsyncState
  • CMediaStream::CSourceLock
  • ColorBGRA
  • ISecureInterfaceConsumer
  • ISecureInterfaceLegacySignals
  • ISecureInterfaceProducer
  • ISecureInterfaceService
    • SecureInterfaceService
  • ISecureInterfaceSignals
  • ISignalEmitter
    • sealed
  • ComAutoRelease
  • DynamicCommandBar
  • Scenario1
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • Scenario6
  • Scenario7
  • Scenario8
  • VisualProperties
  • VisualPropertiesFactory
  • Scenario1
  • ConstantBufferChangeOnResize
  • ConstantBufferChangesEveryFrame
  • ConstantBufferChangesEveryPrim
  • ConstantBufferNeverChanges
  • Scenario1_Message
  • Scenario2_MessageCaption
  • Scenario3_CredentialPickerOptions
  • CritSec
  • CServiceBase
    • CSampleService
  • CustomComputeShaderMain
  • CustomComputeShaderRenderer
  • SampleOverlay
  • sealed
  • CustomDecaySound
  • AudioEchoEffect
  • IMemoryBufferByteAccess
  • DeviceConnect
  • DeviceListEntry
  • DeviceProperties
  • EventHandlerForDevice
  • FeatureReports
  • InputOutputReports
  • InputReportEvents
  • OnDeviceConnectedEventArgs
  • SuperMutt
  • SuperMutt::Device
  • SuperMutt::DeviceInputReportControlInformation
  • SuperMutt::LedPattern
  • SuperMutt::ReadWriteBufferControlInformation
  • Utilities
  • App
  • CustomMediaTransportControls
  • MainPage
  • CustomPixelShaderMain
  • CustomPixelShaderRenderer
  • SampleOverlay
  • sealed
  • Scenario1_DataEvents
  • Scenario2_Polling
  • DeviceConfiguration
  • DeviceListEntry
  • DeviceProperties
  • EventHandlerForDevice
  • Scenario1_ConnectDisconnect
  • Scenario2_ConfigureDevice
  • Scenario3_ReadWrite
  • Scenario4_Events
  • Utilities
  • DescriptorTypeEntry
  • DeviceListEntry
  • DeviceProperties
  • EventHandlerForDevice
  • LocalSettingKeys
  • OnDeviceConnectedEventArgs
  • OsrFx2
  • OsrFx2::Pipe
  • Scenario1_ConnectDisconnect
  • Scenario2_ControlTransfer
  • Scenario3_InterruptPipes
  • Scenario4_BulkPipes
  • Scenario5_UsbDescriptors
  • Scenario6_InterfaceSettings
  • Scenario7_SyncDevice
  • SuperMutt
  • SuperMutt::Pipe
  • SuperMutt::VendorCommand
  • SyncBackgroundTaskInformation
  • Utilities
  • CustomVertexShaderMain
  • CustomVertexShaderRenderer
  • SampleOverlay
  • sealed
  • D2DAdvancedColorImagesRenderer
  • ImageInfo
  • sealed
  • D2DGradientMeshMain
  • D2DGradientMeshRenderer
  • SampleOverlay
  • sealed
  • PhotoAdjustmentProperties
  • PhotoAdjustmentRenderer
  • sealed
  • IncrementalLoadingBase
    • GeneratorIncrementalLoadingClass-g< T >
  • LocalHostItem
  • RemotePeer
  • Scenario1
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • CacheChangedEventArgs-g< T >
  • FileDataSource
  • FileDataSource2
  • FileItem
  • ItemCacheManager< T >
  • ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • ItemIndexRangeList
  • Scenario1
  • Scenario2
  • DDS_HEADER
  • DDS_HEADER_DXT10
  • DDS_PIXELFORMAT
  • AccessHandler
  • CardDetails
  • DeviceStateSourceT< WASAPICapture >
    • WASAPICapture
  • DeviceStateSourceT< WASAPIRenderer >
    • WASAPIRenderer
  • DftEffect
  • DftTransform
  • DirectXApplicationSource
  • sealed
  • Scenario1_ListView
  • Scenario2_DragUICustomization
  • Scenario3_StartDragAsync
  • CustomTextRenderer
  • DWriteColorTextRendererMain
  • DWriteColorTextRendererRenderer
  • SampleOverlay
  • sealed
  • FontNameCollector
  • Listener
  • sealed
  • sealed
  • BaseControl
  • BaseElement
    • Ellipse
    • FilledEllipse
    • FilledRectangle
    • FocusableElement
      • Button
        • ExitButton
        • PlayPauseButton
      • SeekBarElement
    • Line
    • Rectangle
    • Text
  • CameraResources
  • DeviceResources
  • ElementMargin
  • GpuPerformanceTimer
  • MeshGeometry
  • Resource
    • NV12VideoTexture
    • QuadRenderer
    • SpinningCubeRenderer
    • TextRenderer
  • StepTimer
  • TextureData
  • ViewProjectionConstantBuffer
  • Scenario1
  • Scenario10_CpToClipboard
  • Scenario11_CPDNoUI
  • Scenario12_ShareData
  • Scenario13_ShareTarget
  • Scenario14_QueryCpPaste
  • Scenario15_DPLCreateFileEvents
  • Scenario16_NetworkResource
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • Scenario6
  • Scenario7
  • Scenario8_ClipboardSource
  • Scenario9_ClipboardTarget
  • unique_bag
  • unique_services
  • App
  • MainPage
  • sealed
  • AccessHandler
  • CachedFileUpdater_Local
  • CachedFileUpdater_Remote
  • FileOpenPicker_PickAppFile
  • FileOpenPicker_PickCachedFile
  • FileOpenPicker_PickURLFile
  • FileSavePicker_FailToSave
  • FileSavePicker_SaveToAppStorage
  • FileSavePicker_SaveToCachedFile
  • MainPage_CachedFile
  • MainPage_PickFile
  • MainPage_SaveFile
  • UpdateFileTask
  • FilmicEffect
  • CustomControlUsage
  • CustomFocusVisuals
  • SocialMediaCounter
  • GameConfig
  • GameHud
  • GameMain
  • GameObject
    • Cylinder
    • Face
    • Sphere
  • GameRenderer
  • GameTimer
  • Scenario1_DataEvents
  • Scenario2_Polling
  • Scenario3_Porting
  • HighScoreEntry
  • HolographicApp1Main
  • CubeModelConstantBuffer
  • FaceTrackerProcessor
  • HolographicFaceTrackerMain
  • QuadModelConstantBuffer
  • sealed
  • VertexPositionColor
  • VertexPositionTex
  • VideoFrameProcessor
  • Cursor
  • HolographicMRCSampleMain
  • IControl
    • ControlBase
      • Button
      • Panel
  • MediaCaptureManager
  • ModelColorConstantBuffer
  • ModelConstantBuffer
  • sealed
  • SpatialInputHandler
  • SpinningCubeRenderer
  • VertexPosition
  • VertexPositionColor
  • VertexPositionTexture
  • HolographicPaintMain
  • IDPadHelper
    • ThumbstickDPadHelper
    • TouchpadDPadHelper
  • ModelConstantBuffer
  • RenderingHelper
  • sealed
  • SourceHandler
    • HandHandler
    • SpatialControllerHandler
  • SourceHandler::PositionInformation
  • Stroke
  • Stroke::Square
  • Tool
    • ClearTool
  • ToolCarousel
  • VertexPosition
  • HolographicSpatialMappingMain
  • sealed
  • SpatialInputHandler
  • HolographicSpatialStageMain
  • ModelConstantBuffer
  • SceneController
  • SceneObject
  • sealed
  • SpatialStageManager
  • VertexPositionColor
  • DistanceFieldRenderer
  • HolographicTagAlongSampleMain
  • ModelConstantBuffer
  • QuadRenderer
  • sealed
  • SpatialInputHandler
  • TextRenderer
  • VertexPositionColorTex
  • HolographicVoiceInputMain
  • ModelColorConstantBuffer
  • sealed
  • SpatialInputHandler
  • SpinningCubeRenderer
  • VertexPositionColor
  • AuthenticationTask
  • ConfigStore
  • IMFAsyncCallback
    • AsyncCallback< T >
    • AsyncCallback< CMediaSource >
    • EmbeddedMFAsyncCallback< Callback >
  • IMFAttributes
    • CBaseAttributes<>
      • CMediaSink
      • CMediaSource
  • ImportableItemWrapper
  • Scenario1
  • Scenario1_DataEvents
  • Scenario2_Polling
  • Scenario3_Calibration
  • InkEventLogger
  • int24in32
  • AccessHandler
  • ApduCommand
    • DesfireCommand
    • SelectCommand
    • GeneralAuthenticate
      • GeneralAuthenticate
    • GetData
      • GetHistoricalBytes
        • GetHistoricalBytes
        • GetHistoricalBytes
        • GetHistoricalBytes
        • GetHistoricalBytes
      • GetUid
        • GetUid
        • GetUid
        • GetUid
        • GetUid
    • IncrementDecrement
    • LoadKeys
      • LoadKey
    • ManageSession
    • ReadBinary
      • Check
      • Read
      • Read
      • Read
    • TransparentExchange
    • UpdateBinary
      • Update
      • Write
      • Write
      • Write
  • ApduResponse
    • DesfireResponse
    • ApduResponse
      • ApduResponse
      • ApduResponse
      • ApduResponse
      • ApduResponse
    • ManageSessionResponse
    • TransparentExchangeResponse
  • IUIContentRootClone
    • MockUIContentRoot
  • Scenario1_GetLamp
  • Scenario2_EnableSettings
  • Scenario3_AvailabilityChanged
  • LARGE_INTEGER
  • Level
    • Level1
      • Level2
    • Level3
      • Level4
      • Level5
        • Level6
  • Scenario1_DataEvents
  • Scenario2_Polling
  • LineSegment
  • List< T >
  • List< T >::Node
  • List< T >::POSITION
  • List< CSourceOperation * >
    • ComPtrList< CSourceOperation >
  • List< MediaItem >
    • MediaList
  • List< object >
    • GroupInfoList
  • List< T * >
    • ComPtrList< T, NULLABLE >
  • ILivePlayer
    • LiveDashPlayer
  • Manifest
  • MediaSegment
  • MediaSegmentInformation
  • MediaStream
  • Period
  • Player
  • SourceBufferManager
    • LiveSourceBufferManager
  • DashManifestParser
  • Downloader
  • DASHEntry
  • LiveDashPlayer
  • LuminanceHeatmapEffect
  • Scenario1_BankCards
  • Scenario2_AamvaCards
  • App
  • Item
  • ItemsDataSource
  • DetailPage
  • MasterDetailPage
  • ItemViewModel
  • Material
  • Matrix4x4< T >
  • Scenario1_TrimAndSaveClip
  • Scenario2_AppendClips
  • Scenario3_AddAudioTracks
  • Scenario4_AddOverlays
  • MediaReader
  • MemDelete
  • MeshObject
    • CylinderMesh
    • FaceMesh
    • SphereMesh
    • WorldCeilingMesh
    • WorldFloorMesh
    • WorldWallsMesh
  • METERING_CONTEXT
  • PoseTrackingEntityData
  • PoseTrackingFrameHeader
  • TrackedPose
  • FxCompile
  • CBaseAttributes< TBase >
  • CalibrationBar
  • CMarker
  • CMediaStream
  • CSchemeHandler
  • CSourceOperation
    • CSetRateOperation
    • CStartOperation
  • CStreamSink
  • CStreamSink::CAsyncOperation
  • ISinkCallback
    • sealed::sealed
  • abstract
  • CBufferEnumerator
  • CBufferPacket
  • CMediaBufferWrapper
  • CNetworkChannel
    • sealed
    • sealed
  • INetworkClient
    • sealed
  • INetworkServer
    • sealed
  • sealed
  • StspDescription
  • StspOperationHeader
  • StspSampleHeader
  • StspStreamDescription
  • Dimensions
  • IAppliance
    • IOven
      • Oven
    • IOven
  • IBread
    • Bread
  • IBreadBakedEventArgs
  • IOvenFactory
  • sealed
  • RegisterMessage
  • SignatureMessage
  • SubjectPublicKeyInfo
  • SubjectPublicKeyInfo::SafeBCryptKeyHandle
  • SubjectPublicKeyInfo::SafeLocalAllocHandle
  • UserAndKeyHintMessage
  • AuthenticationController
  • HomeController
  • DAL
  • DAL::RegisteredUser
  • FilterConfig
  • RouteConfig
  • WebApiApplication
  • MidiDeviceWatcher
  • Scenario1_MIDIDeviceEnumeration
  • Scenario2_ReceiveMIDIMessages
  • Scenario3_SendMIDIMessages
  • AccessHandler
  • DefaultKeys
  • AccessHandler
  • AccountWatcher
  • BroadbandDevice
  • GetConnectionProfiles
  • ModemDeviceServices
  • ModemInformation
  • ShowConnection
  • SimCard
  • MoveLookController
  • sealed
  • sealed
  • NfcProvHeader
  • Scenario1
  • CardReader
  • ManageCardScenario
  • NfcUtils
  • ReceiptView
  • SetCardDataScenario
  • NoOp< T >
  • App
  • InstructionControl
  • InstructionsControl
  • PopToastControl
  • StepsControl
  • StepsHelperControl
  • UpdateFourTilesControl
  • TypeToUIElementConverter
  • XmlDocumentToStringConverter
  • BackButtonPage
    • MainPage
    • ScenarioPage
  • BindableBase
    • Scenario
    • ScenarioGroup
  • TilesHelper
  • IScenario
    • Scenario
    • ScenarioGroup
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • ScenarioElement
  • OmnidirectionalSound
  • App
  • MainPage
  • MainPage_OneHanded
  • Albums
  • Collections
  • Settings
  • MainViewModel
  • Model
  • ScenarioElement
  • sealed
  • OpQueue< T, TOperation >
  • OpQueue< CMediaSource, CSourceOperation >
    • CMediaSource
  • IOnboardingConsumer
  • IOnboardingLegacySignals
  • IOnboardingProducer
  • IOnboardingService
    • OnboardingService
  • IOnboardingSignals
  • ISignalEmitter
    • sealed
  • ConnectedTask
  • AtrInfo
  • AtrParser
  • IccDetection
  • SmartCardReaderUtils
  • HistoryRecord
  • Scenario1_Events
  • Scenario2_History
  • Scenario3_CurrentStepCount
  • Scenario4_BackgroundPedometer
  • PersistentState
  • PipeEvents
  • PipeIn
  • PipeOut
  • SampleDataModel
  • Scenario1
  • Scenario2
  • Scenario3
  • TabHeader
  • PlaybackControl
  • Scenario1
  • Scenario10
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • Scenario6
  • Scenario7
  • Scenario8
  • Scenario9
  • PlotDataSourceT< WASAPICapture >
    • WASAPICapture
  • PNTVertex
  • Print3D
  • ContinuationPage
  • InvalidPageException
  • PageDescription
  • PageToPrint
  • PreviewUnavailable
  • PrintHelper
    • CustomOptionsPrintHelper
    • DisablePreviewPrintHelper
    • PageRangePrintHelper
    • PhotosPrintHelper
    • StandardOptionsPrintHelper
  • Scenario1Basic
  • Scenario2StandardOptions
  • Scenario3CustomOptions
  • Scenario4PageRange
  • Scenario5Photos
  • Scenario6DisablePreview
  • PropertyGetContext< T >
  • PropertySetContext
  • Scenario1_DataEvents
  • Scenario2_Polling
  • Scenario3_DisplayOnOff
  • Scenario4_BackgroundProximitySensor
  • CustomException
  • OvenClient
  • RandomNumberGeneratorTask
  • RawSMBIOSData
  • RawSMBIOSTable
    • RawSMBIOSSystemInfo
  • ReadStreamTask
  • ReadStreamTask::ReadStreamTaskImpl
  • ReinhardEffect
  • Scenario1_DataEvents
  • Scenario2_Polling
  • RenderBuffer
  • RippleEffect
  • Metering
  • RecognizedTextRun
  • ScenarioContext
  • App
  • MediaTransportControlsWithCustomCastButton
  • ProjectedMediaTransportControls
  • ItemsDataProvider
    • AzureDataProvider
  • VideoMetaData
  • MainPage
  • ProjectionViewBroker
  • ProjectionViewPage
  • Scenario
  • Scenario01
  • Scenario02
  • Scenario03
  • Scenario04
  • Scenario05
  • Scenario06
  • UnhandledExceptionPage
  • ApiInformation
  • CustomDevicePickerFilter
  • DialLaunchArguments
  • RequiredDeviceProperties
  • ViewLifetimeControl
  • MainPage
  • ProjectionViewPage
  • ProjectionViewPageInitializationData
  • sealed
  • Scenario
  • Scenario1
  • Scenario2
  • Scenario3
  • sealed
  • sealed
  • CAPTUREDEVICEPROPS
  • DEVICEPROPS
  • MFSampleGenerator
  • sealed
  • ToneSampleGenerator
  • WASAPICapture
  • WASAPIRenderer
  • Account
  • AccountOverviewPage
  • AccountsHelper
  • AddAuthorizationHeaderFilter
  • App
  • AppContactPanel
  • AppException
  • ApplicationTriggerTask
  • AudioCapturePermissions
  • BackgroundActivity
  • BackgroundAuthenticationCompletedEventArgs
  • BackgroundTaskSample
  • BarcodeScannerInfo
  • BindingHelpers
  • BitrateHelper
  • BitrateItem
  • BluetoothLEDeviceDisplay
  • BooleanToVisibilityConverter
  • CachedFileUpdaterPage
  • CachedFileUpdaterPageSizeChangedEventArgs
  • CalibrationBar
  • CalligraphicPen
  • CancelCommand
  • CaptureFailedEventArgs
  • ChatListView
  • Cluster
  • LoadStateEventArgs
  • NavigationHelper
  • RootFrameNavigationHelper
  • SaveStateEventArgs
  • SuspensionManager
  • SuspensionManagerException
  • CompletedCallback
  • sealed
  • ConnectedDevice
  • ConnectionSettingsPanel
  • Constants
  • Contact
  • Content
  • ContentSelector
  • PlayReadyInfo
  • Conversation
  • CopyFiles
  • CopyImage
  • CopyText
  • CustomCommand
  • CustomEditControl
  • CustomEffectState
  • CustomTextBox
  • CustomTitleBar
  • CustomTrigger
  • D2DSvgImageRenderer
  • sealed
  • DataHelpers
  • DefaultCloseCommand
  • DetailsPage
  • DeviceConnect
  • DeviceEvents
  • DeviceHelpers
  • DeviceInformationDisplay
  • DeviceInformationKindChoice
  • DeviceIO
  • DeviceList
  • DeviceListEntry
  • DeviceReadWrite
  • DeviceSelectorInfo
  • DeviceWatcherHelper
  • DiscoveredDevice
  • DownloadOperationItem
  • EdgeTappedListView
  • EnableHelloPage
  • Errors
  • FileExtensions
  • FileLoggingSessionScenario
  • FileOpenPickerPage
  • FileSavePickerPage
  • FileSavePickerPageSizeChangedEventArgs
  • FirmwareAccess
  • FrameFormatModel
  • FrameRenderer
  • FrameSourceGroupModel
  • FrameSourceInfoModel
  • FrameSourceState
  • Fx2Driver
  • GeneratedBitmapState
  • GeoEquals
  • GroupedBackgroundTask
  • GuidComparer
  • HelperFunctions
  • Helpers
  • Helpers::BufferConverter
  • CommonLicenseRequest
  • PlayReadyHelper
  • Helpers::sealed
  • Helpers::ServiceStatusConverter
  • HistoryAndRoaming
  • HttpJsonContent
  • ImagePage
  • InkRenderer
  • InvalidPageException
  • IsApiPropertyPresentTrigger
  • Item
  • ItemDetails
  • ItemList
  • JsonRequest
  • KeepConnectionOpenScenario
  • LampArrayInfo
  • ListViewEdgeTappedEventArgs
  • LocationTrackingReason
  • LoggingChannelScenario
  • LoggingScenarioEventArgs
  • LoggingSessionScenario
  • LookupTable< T, LookupTableSize >
  • LowLatencyInputMain
  • MainPage
  • MainPageSizeChangedEventArgs
  • ManipulationInputProcessor
  • MediaCapturePreviewer
  • MediaFoundationConstants
  • MediaModel
  • MeteringData
  • MEUserControl
  • AdaptiveContentModel
  • MPEUserControl
  • MultipleTasks
  • NegatingBoolConverter
  • OcrCapturedImage
  • OcrFileImage
  • OpenCloseConnectionScenario
  • OtherScenarios
  • PageDescription
  • PlaceInfo
  • PlaceLocation
  • PlugInFilter
  • PointOfInterest
  • PresentationFormats
  • PrintHelper
    • sealed
    • sealed
    • sealed
    • sealed
    • sealed
  • ProtectionLevelSelectorInfo
  • RadioModel
  • ReadBytes
  • RectRenderer
  • RfcommChatDeviceDisplay
  • S1_AddWithAPI
  • S2_UpdateAndDeleteWithAPI
  • S3_RetrieveWithAPI
  • S4_CheckIndexRevision
  • S5_AddWithAppContent
  • S6_DeleteWithAppContent
  • S7_RetrieveWithAppContent
  • SampleBackgroundTask
  • SampleBackgroundTaskWithCondition
  • SampleConstants
  • SampleDataModel
  • SavingDataReason
  • Scenario
  • Scenario01_GetText
  • Scenario02_GetStream
  • Scenario03_GetList
  • Scenario04_PostText
  • Scenario05_PostStream
  • Scenario06_PostMultipart
  • Scenario07_PostStreamWithProgress
  • Scenario08_PostCustomContent
  • Scenario09_GetCookie
  • Scenario0_Choose
  • Scenario1
  • Scenario10
  • Scenario10_SetCookie
  • Scenario10_UnviewableContent
  • Scenario11
  • Scenario11_DeleteCookie
  • Scenario12
  • Scenario12_DisableCookies
  • Scenario13
  • Scenario13_RetryFilter
  • Scenario14_MeteredConnectionFilter
  • Scenario15_ServerCertificateValidation
  • Scenario1_AddAccount
  • Scenario1_Advertiser
  • Scenario1_Analyze
  • Scenario1_Basic
  • Scenario1_BasicFunctionality
  • Scenario1_Basics
  • Scenario1_BasicUserActivity
  • Scenario1_ChatClient
  • Scenario1_Check
  • Scenario1_CheckConsentAvailability
  • Scenario1_Colors
  • Scenario1_Configuration
  • Scenario1_Configure
  • Scenario1_ConfigureMobileHotspot
  • Scenario1_Create
  • Scenario1_CreateContact
  • Scenario1_CreateContacts
  • Scenario1_CreateTile
  • Scenario1_CurrentActivity
  • Scenario1_Data
  • Scenario1_DataEvents
  • Scenario1_Default
  • Scenario1_Define
  • Scenario1_DetectInPhoto
  • Scenario1_DevicePicker
  • Scenario1_DeviceUse
  • Scenario1_Directions
  • Scenario1_Discovery
  • Scenario1_DisplayDepthColorIR
  • Scenario1_Download
  • Scenario1_Enable
  • Scenario1_EventAndMenuHookup
  • Scenario1_ExampleOperations
  • Scenario1_ExtractTextSegments
  • Scenario1_Files
  • Scenario1_FindClaimEnable
  • Scenario1_FindId
  • Scenario1_FindUsers
  • Scenario1_Geotag
  • Scenario1_GetAndSetPin
  • Scenario1_GetDeviceInformation
  • Scenario1_Initialization
  • Scenario1_InkCanvasTactileFeedback
  • Scenario1_Input
  • Scenario1_LanguageDetection
  • Scenario1_Launch
  • Scenario1_Launched
  • Scenario1_LaunchFile
  • Scenario1_LongAndShortFormats
  • Scenario1_ManageHotspot
  • Scenario1_Metrics
  • Scenario1_Mini
  • Scenario1_MoveCertificate
  • Scenario1_MultiVideoPlayback
  • Scenario1_NavToUrl
  • Scenario1_NetworkConnectivity
  • Scenario1_OpenDrawer
  • Scenario1_Orientation
  • Scenario1_ParseAndStringify
  • Scenario1_PercentPermilleFormatting
  • Scenario1_PinTile
  • Scenario1_Prefs
  • Scenario1_PreviewSettings
  • Scenario1_Print
  • Scenario1_ProvisionTPM
  • Scenario1_ReactiveRequest
  • Scenario1_ReadData
  • Scenario1_Render
  • Scenario1_Save
  • Scenario1_SecondaryWindow
  • Scenario1_SelectDisplay
  • Scenario1_SimpleListView
  • Scenario1_SimplestAdaptiveStreaming
  • Scenario1_Single
  • Scenario1_SingleFile
  • Scenario1_SpellingTextSuggestions
  • Scenario1_Toggle
  • Scenario1_TrackInWebcam
  • Scenario1_TrackPosition
  • Scenario1_TrialMode
  • Scenario1_UIFonts
  • Scenario1_UTF8
  • Scenario1_Welcome
  • Scenario2
  • Scenario2_Add
  • Scenario2_AdvancedUserActivity
  • Scenario2_BackgroundTask
  • Scenario2_Binary
  • Scenario2_ChangePIN
  • Scenario2_ChatServer
  • Scenario2_Client
  • Scenario2_CloseDrawer
  • Scenario2_Conditional
  • Scenario2_Connector
  • Scenario2_Custom
  • Scenario2_DecimalFormatting
  • Scenario2_DelayMini
  • Scenario2_DetectInWebcam
  • Scenario2_DeviceWatcher
  • Scenario2_Disable
  • Scenario2_Display
  • Scenario2_DisplayRegion
  • Scenario2_DisplayText
  • Scenario2_DocumentFonts
  • Scenario2_Effects
  • Scenario2_Engage
  • Scenario2_EventHandlers
  • Scenario2_Extend
  • Scenario2_FindAvailableSourceGroups
  • Scenario2_GetCurrentTextSegmentFromIndex
  • Scenario2_GetPosition
  • Scenario2_History
  • Scenario2_InAppPurchase
  • Scenario2_Lang
  • Scenario2_Launch
  • Scenario2_LaunchUri
  • Scenario2_Listen
  • Scenario2_Load
  • Scenario2_Manage
  • Scenario2_ManageAccount
  • Scenario2_Memory
  • Scenario2_MultiFile
  • Scenario2_Multiple
  • Scenario2_MultipleScanners
  • Scenario2_NavToString
  • Scenario2_NetworkCost
  • Scenario2_Notifications
  • Scenario2_PhotoSettings
  • Scenario2_Polling
  • Scenario2_PrintReceipt
  • Scenario2_ProactiveRequest
  • Scenario2_ReceiveContact
  • Scenario2_Remove
  • Scenario2_RequestConsent
  • Scenario2_RequestMany
  • Scenario2_ScopedViews
  • Scenario2_ScriptDetection
  • Scenario2_Settings
  • Scenario2_ShakeEvents
  • Scenario2_ShowHideEvents
  • Scenario2_SimpleGridView
  • Scenario2_Stats
  • Scenario2_StringTemplate
  • Scenario2_SupportedTactileFeedback
  • Scenario2_SynchronizingPlayers
  • Scenario2_SystemDefaultMenu
  • Scenario2_ToggleMobileHotspot
  • Scenario2_UnpinTile
  • Scenario2_Upload
  • Scenario2_WatchUsers
  • Scenario3
  • Scenario3_ActiveSymbologies
  • Scenario3_AdaptiveCard
  • Scenario3_AdaptiveSync
  • Scenario3_Add
  • Scenario3_AppCapture
  • Scenario3_AspectRatio
  • Scenario3_BackgroundDeviceWatcher
  • Scenario3_BackgroundTask
  • Scenario3_BgChatServer
  • Scenario3_Calibration
  • Scenario3_ChangeEvents
  • Scenario3_CheckUserConsentGroup
  • Scenario3_ChooseControl
  • Scenario3_Choosing
  • Scenario3_ClientAuthentication
  • Scenario3_CurrencyFormatting
  • Scenario3_CustomItems
  • Scenario3_Enum
  • Scenario3_EnumerateTiles
  • Scenario3_FixAccount
  • Scenario3_ForegroundApp
  • Scenario3_Full
  • Scenario3_HardwareDRM
  • Scenario3_InkingFeedback
  • Scenario3_InvokeScript
  • Scenario3_LaunchAppServices
  • Scenario3_Legacy
  • Scenario3_MasterDetail
  • Scenario3_MultipleClaims
  • Scenario3_MultipleDrawers
  • Scenario3_NetworkConnectivityChanges
  • Scenario3_Notifications
  • Scenario3_ParameterizedTemplate
  • Scenario3_Polling
  • Scenario3_ReceiveFile
  • Scenario3_Region
  • Scenario3_Replace
  • Scenario3_RequestModification
  • Scenario3_ResetPIN
  • Scenario3_SecondaryTiles
  • Scenario3_ServerForeground
  • Scenario3_SettingContainer
  • Scenario3_ShowHideMethods
  • Scenario3_SingleFolder
  • Scenario3_Size
  • Scenario3_Transliteration
  • Scenario3_Trim
  • Scenario3_UnmanagedConsumable
  • Scenario3_UsingWindows
  • Scenario4
  • Scenario4_BackgroundActivity
  • Scenario4_ChangeAdminKey
  • Scenario4_ChangeSystemGroup
  • Scenario4_CharacterGrouping
  • Scenario4_CompactOverlay
  • Scenario4_CompletionGroups
  • Scenario4_CompositeSettings
  • Scenario4_ConsumableProduct
  • Scenario4_EdgeTappedListView
  • Scenario4_ForegroundGeofence
  • Scenario4_Input
  • Scenario4_InteractionFeedback
  • Scenario4_NumberParsing
  • Scenario4_OrientationChanged
  • Scenario4_Override
  • Scenario4_PartialReadWrite
  • Scenario4_ReceiveUri
  • Scenario4_Remove
  • Scenario4_SaveFile
  • Scenario4_ScriptNotify
  • Scenario4_SecureStop
  • Scenario4_Settings
  • Scenario4_ShowView
  • Scenario4_Snapshot
  • Scenario4_StateTrigger
  • Scenario4_SymbologyAttributes
  • Scenario4_TilePinned
  • Scenario4_Tuning
  • Scenario4_UnicodeExtensions
  • Scenario4_UpdatingLineDisplayAttributes
  • Scenario5
  • Scenario5_Capabilities
  • Scenario5_Clear
  • Scenario5_DataEventsBatching
  • Scenario5_DefiningCustomGlyphs
  • Scenario5_DisplayingBarcodePreview
  • Scenario5_GeofenceBackgroundTask
  • Scenario5_GetSingleDevice
  • Scenario5_InkingAndInteractionFeedback
  • Scenario5_IsSupported
  • Scenario5_LaunchedFromSecondaryTile
  • Scenario5_Metadata
  • Scenario5_Msappdata
  • Scenario5_NavToFiles
  • Scenario5_RandomAccess
  • Scenario5_RelativePositioning
  • Scenario5_RestoreScrollPosition
  • Scenario5_RoundingAndPadding
  • Scenario5_Show
  • Scenario5_TimeZone
  • Scenario5_TriggerCFU
  • Scenario5_UnicodeExtensions
  • Scenario5_UserCollection
  • Scenario5_VerifyResponse
  • Scenario6
  • Scenario6_AdInsertion
  • Scenario6_AppListingURI
  • Scenario6_ClearScenario
  • Scenario6_CustomFilterAddedProps
  • Scenario6_DeleteTPM
  • Scenario6_GetLastVisit
  • Scenario6_ManipulatingCursorAttributes
  • Scenario6_NavToStream
  • Scenario6_NavToStream::StreamUriWinRTResolver
  • Scenario6_NumeralSystemTranslation
  • Scenario6_RecoverableErrors
  • Scenario6_Recurrence
  • Scenario6_ScrollIntoView
  • Scenario6_SecondaryTileNotification
  • Scenario6_TimeZone
  • Scenario7
  • Scenario7_B2B
  • Scenario7_DeviceInformationKind
  • Scenario7_DownloadReordering
  • Scenario7_ForegroundVisits
  • Scenario7_ListAllCards
  • Scenario7_LiveSeekableRange
  • Scenario7_PinFromAppbar
  • Scenario7_ScrollingContentUsingMarquee
  • Scenario7_SetVersion
  • Scenario7_Share
  • Scenario7_UsingUnicodeExtensions
  • Scenario8
  • Scenario8_CaptureBitmap
  • Scenario8_PairDevice
  • Scenario8_TransferMediaPlayer1
  • Scenario8_TransmitAPDU
  • Scenario8_UpdateAsync
  • Scenario8_VisitsBackgroundTask
  • Scenario9
  • Scenario9_ContainsFullScreenElement
  • Scenario9_CustomPairDevice
  • Scenario9_TransferMediaPlayer2
  • Scenario_CloudFontOverview
  • Scenario_ContinuousDictation
  • Scenario_ContinuousRecognitionListGrammar
  • Scenario_ContinuousRecognitionSRGSGrammar
  • Scenario_Document1
  • Scenario_Document2
  • Scenario_Document3
  • Scenario_ListConstraint
  • Scenario_PauseAsync
  • Scenario_PredefinedDictationGrammar
  • Scenario_PredefinedWebSearchGrammar
  • Scenario_SampleOverview
  • Scenario_SRGSConstraint
  • Scenario_SynthesizeSSML
  • Scenario_SynthesizeText
  • Scenario_SynthesizeTextBoundaries
  • ScenarioBindingConverter
  • ScenarioCommon
  • SceneComposer
  • SceneComposer::SceneObject
    • SceneComposer::InkObject
    • SceneComposer::ShapeObject
  • School
  • SdkSample
  • sealed::sealed
  • sealed::StreamFilteringCriteria
  • SecondaryAppWindowPage
  • SecondaryPage
  • SecondaryViewPage
  • ServiceViewModel
  • ServicingCompleteTask
  • SetErrorMessage
  • SetLockScreenImage
  • Shape
  • ShapeRenderer
  • ShareApplicationLink
  • ShareCustomData
  • ShareCustomProvider
  • PlayReadyHelpers
  • RelayCommand
  • ShareDelayRenderedFiles
  • ShareFiles
  • ShareHtml
  • ShareImage
  • SharePage
  • ShareTarget
  • ShareText
  • ShareWebLink
  • ShowPackageFamilyName
  • SignIn
  • SimpleLogger
  • SizePreferenceString
  • SlowInputStream
  • SmartCardListItem
  • SocketReaderWriter
  • SourceGroupCollection
  • Status
  • StreamResolution
  • sealed
  • StringTrimmer
  • SubPage
  • SymbologyListEntry
  • sealed
  • TextMessage
  • TimeTriggeredTask
  • TrackingEventCue
  • TransportOptions
  • UnspecifiedReason
  • User
  • UserSelect
  • UserViewModel
  • Util
  • ViewModelBase
    • HardwareDRMViewModel
    • PlayReadyInfoViewModel
    • ProactiveViewModel
    • ReactiveViewModel
    • SecureStopViewModel
  • AdvertisementWrapper
  • DiscoveredDeviceWrapper
  • Scenario1
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • sealed
  • SessionRequestWrapper
  • SessionWrapper
  • SocketWrapper
  • StreamSocketListenerWrapper
  • WiFiDirectServiceManager
  • sealed
  • WindowInfo
  • WordOverlay
  • WriteReadStream
  • sealed
  • sealed
  • sealed
  • SdrOverlayEffect
  • sealed
  • ViewLifetimeControl
  • ArduinoDevice
  • DeviceListEntry
  • DeviceProperties
  • EventHandlerForDevice
  • Scenario1_ConnectDisconnect
  • Scenario2_LEDTemp
  • Utilities
  • Simple3DGame
  • IGameUIControl
    • GameInfoOverlay
    • GameInfoOverlay
  • sealed
  • IGameUIControl
    • sealed
  • CaptureDevice
  • LowLatency
  • VideoChat
  • Scenario1
  • Scenario2
  • Scenario1_DataEvents
  • Scenario2_Polling
  • SampleSmsBackgroundTask
  • RegisterWithBackgroundTask
  • SendTextMessage
  • SocketActivityTask
  • Scenario1_Connect
  • SoundEffect
  • ExtendedSplash
  • Scenario1
  • Scenario2
  • App
  • ControlSizeTrigger
  • DeviceFamilyTrigger
  • InputTypeTrigger
  • ItemTemplateControl
  • MainPage
  • MainViewModel
  • Model
  • STEREO_PARAMETERS
  • Scenario1_Send
  • LocalHostItem
  • Scenario1
  • Scenario2
  • Scenario3
  • Scenario4
  • Scenario5
  • StringTrimmer
  • S1_GetAFeed
  • TangentVertex
  • TargetTexture
  • ActivitySensorBackgroundTask
  • CompletionGroupTask
  • EdpBackgroundTask
  • PedometerBackgroundTask
  • ProximitySensorBackgroundTask
  • SampleBackgroundTask
  • sealed
  • ServicingComplete
  • Scenario1_Conversion
  • Scenario2_Prediction
  • Scenario3_ReverseConversion
  • TlvEntry
  • App
  • ArticlePage
  • MainPage
  • SectionView
  • ArticleViewModel
  • HeroArticlesViewModel
  • Turn
  • TypeConversionHelpers
  • RequestResponse
  • Vector2< T >
  • Vector3< T >
  • Vector4< T >
  • VideoItemInfo
  • VisualPropertiesFactory
  • sealed
  • WaveEffect
  • WaveEffect::Vertex
  • Scenario1_Facebook
  • Scenario2_Twitter
  • Scenario3_Flickr
  • WICConvert
  • WICTranslate
  • Scenario1_CachedNetworks
  • Scenario2_Scan
  • Scenario3_RegisterForUpdates
  • Scenario4_Connect
  • WiFiNetworkDisplay
  • final
  • ModelConstantBuffer
  • ModelNormalConstantBuffer
  • RealtimeSurfaceMeshRenderer
  • SurfaceMeshProperties
  • VertexPositionColor
  • VertexPositionNormalColor
  • ViewProjectionConstantBuffer
  • BufferHelper
  • sealed
  • TrackedPose
  • BackgroundDeviceWatcher
  • BackgroundDeviceWatcher
  • ConnectTask
  • GeofenceBackgroundTask
  • LocationBackgroundTask
  • UpdateMetadataTask
  • VisitBackgroundTask
  • ConnectTask
  • GeofenceBackgroundTask
  • LocationBackgroundTask
  • UpdateMetadataTask
  • VisitBackgroundTask
  • HttpMeteredConnectionFilter
  • HttpRetryFilter
  • HttpMeteredConnectionFilter
  • HttpRetryFilter
  • Item
  • Item
  • DetailPage
  • MasterDetailPage
  • App
  • DetailPage
  • MasterDetailPage
  • ItemsDataSource
  • ItemViewModel
  • ItemViewModel
  • RandomNumberGeneratorTask
  • RandomNumberGeneratorTask
  • LinguisticServices
  • LinguisticServices
  • Constants
  • DeviceWatcherHelper
  • ensure_close
  • Errors
  • BarcodeScannerInfo
  • BindingHelpers
  • ConnectionSettingsPanel
  • CopyFiles
  • CopyImage
  • CopyText
  • CustomTextBox
  • CustomTitleBar
  • DetailsPage
  • EdgeTappedListView
  • GroupInfoList
  • HistoryAndRoaming
  • HttpJsonContent
  • ImagePage
  • KeepConnectionOpenScenario
  • OcrCapturedImage
  • OcrFileImage
  • OpenCloseConnectionScenario
  • OtherScenarios
  • PlugInFilter
  • Scenario01_GetText
  • Scenario02_GetStream
  • Scenario03_GetList
  • Scenario04_PostText
  • Scenario05_PostStream
  • Scenario06_PostMultipart
  • Scenario07_PostStreamWithProgress
  • Scenario08_PostCustomContent
  • Scenario09_GetCookie
  • Scenario1
  • Scenario10
  • Scenario10_SetCookie
  • Scenario11
  • Scenario11_DeleteCookie
  • Scenario12_DisableCookies
  • Scenario13_RetryFilter
  • Scenario14_MeteredConnectionFilter
  • Scenario15_ServerCertificateValidation
  • Scenario1_Advertiser
  • Scenario1_Analyze
  • Scenario1_Basic
  • Scenario1_BasicFunctionality
  • Scenario1_Basics
  • Scenario1_Check
  • Scenario1_CheckConsentAvailability
  • Scenario1_Colors
  • Scenario1_Configure
  • Scenario1_ConfigureMobileHotspot
  • Scenario1_Data
  • Scenario1_DataEvents
  • Scenario1_DetectInPhoto
  • Scenario1_DevicePicker
  • Scenario1_Discovery
  • Scenario1_Enable
  • Scenario1_ExtractTextSegments
  • Scenario1_Files
  • Scenario1_FindId
  • Scenario1_FindUsers
  • Scenario1_GetAndSetPin
  • Scenario1_InkCanvasTactileFeedback
  • Scenario1_LanguageDetection
  • Scenario1_Launch
  • Scenario1_Launched
  • Scenario1_LongAndShortFormats
  • Scenario1_ManageHotspot
  • Scenario1_MoveCertificate
  • Scenario1_NetworkConnectivity
  • Scenario1_Orientation
  • Scenario1_ParseAndStringify
  • Scenario1_PercentPermilleFormatting
  • Scenario1_PinTile
  • Scenario1_Prefs
  • Scenario1_Print
  • Scenario1_ProvisionTPM
  • Scenario1_ReadData
  • Scenario1_Render
  • Scenario1_Save
  • Scenario1_SecondaryWindow
  • Scenario1_SimpleListView
  • Scenario1_SingleFile
  • Scenario1_Toggle
  • Scenario1_TrackInWebcam
  • Scenario1_TrackPosition
  • Scenario1_UIFonts
  • Scenario1_UTF8
  • Scenario1_XmlReader
  • Scenario2
  • Scenario2_Binary
  • Scenario2_ChangePIN
  • Scenario2_Client
  • Scenario2_Connector
  • Scenario2_DecimalFormatting
  • Scenario2_DetectInWebcam
  • Scenario2_DeviceWatcher
  • Scenario2_Disable
  • Scenario2_DisplayRegion
  • Scenario2_DocumentFonts
  • Scenario2_Effects
  • Scenario2_Extend
  • Scenario2_GetCurrentTextSegmentFromIndex
  • Scenario2_GetPosition
  • Scenario2_Lang
  • Scenario2_Launch
  • Scenario2_Listen
  • Scenario2_Manage
  • Scenario2_Memory
  • Scenario2_MultiFile
  • Scenario2_MultipleScanners
  • Scenario2_NetworkCost
  • Scenario2_Notifications
  • Scenario2_Polling
  • Scenario2_Remove
  • Scenario2_RequestConsent
  • Scenario2_RequestMany
  • Scenario2_ScriptDetection
  • Scenario2_Settings
  • Scenario2_ShowHideEvents
  • Scenario2_SimpleGridView
  • Scenario2_Stats
  • Scenario2_StringTemplate
  • Scenario2_SupportedTactileFeedback
  • Scenario2_ToggleMobileHotspot
  • Scenario2_UnpinTile
  • Scenario2_WatchUsers
  • Scenario2_XmlWriter
  • Scenario3
  • Scenario3_ActiveSymbologies
  • Scenario3_AppCapture
  • Scenario3_BackgroundDeviceWatcher
  • Scenario3_BackgroundTask
  • Scenario3_CheckUserConsentGroup
  • Scenario3_Choosing
  • Scenario3_ClientAuthentication
  • Scenario3_CurrencyFormatting
  • Scenario3_CustomItems
  • Scenario3_Enum
  • Scenario3_EnumerateTiles
  • Scenario3_InkingFeedback
  • Scenario3_MasterDetail
  • Scenario3_NetworkConnectivityChanges
  • Scenario3_ParameterizedTemplate
  • Scenario3_Region
  • Scenario3_ResetPIN
  • Scenario3_SecondaryTiles
  • Scenario3_ServerForeground
  • Scenario3_SettingContainer
  • Scenario3_ShowHideMethods
  • Scenario3_SingleFolder
  • Scenario3_Size
  • Scenario3_Transliteration
  • Scenario3_XmlWriterLite
  • Scenario4
  • Scenario4_ChangeAdminKey
  • Scenario4_ChangeSystemGroup
  • Scenario4_CharacterGrouping
  • Scenario4_CompactOverlay
  • Scenario4_CompositeSettings
  • Scenario4_EdgeTappedListView
  • Scenario4_ForegroundGeofence
  • Scenario4_Input
  • Scenario4_InteractionFeedback
  • Scenario4_NumberParsing
  • Scenario4_Override
  • Scenario4_PartialReadWrite
  • Scenario4_SaveFile
  • Scenario4_ShowView
  • Scenario4_Snapshot
  • Scenario4_SymbologyAttributes
  • Scenario4_TilePinned
  • Scenario4_UnicodeExtensions
  • Scenario5
  • Scenario5_DisplayingBarcodePreview
  • Scenario5_GeofenceBackgroundTask
  • Scenario5_GetSingleDevice
  • Scenario5_InkingAndInteractionFeedback
  • Scenario5_IsSupported
  • Scenario5_LaunchedFromSecondaryTile
  • Scenario5_Msappdata
  • Scenario5_RelativePositioning
  • Scenario5_RestoreScrollPosition
  • Scenario5_RoundingAndPadding
  • Scenario5_TimeZone
  • Scenario5_TriggerCFU
  • Scenario5_UnicodeExtensions
  • Scenario5_VerifyResponse
  • Scenario6
  • Scenario6_ClearScenario
  • Scenario6_CustomFilterAddedProps
  • Scenario6_DeleteTPM
  • Scenario6_GetLastVisit
  • Scenario6_NumeralSystemTranslation
  • Scenario6_ScrollIntoView
  • Scenario6_SecondaryTileNotification
  • Scenario6_TimeZone
  • Scenario7
  • Scenario7_DeviceInformationKind
  • Scenario7_ForegroundVisits
  • Scenario7_ListAllCards
  • Scenario7_PinFromAppbar
  • Scenario7_SetVersion
  • Scenario7_UsingUnicodeExtensions
  • Scenario8
  • Scenario8_PairDevice
  • Scenario8_TransmitAPDU
  • Scenario8_UpdateAsync
  • Scenario8_VisitsBackgroundTask
  • Scenario9
  • Scenario9_CustomPairDevice
  • School
  • SecondaryAppWindowPage
  • SecondaryViewPage
  • ShowPackageFamilyName
  • SlowInputStream
  • SmartCardListItem
  • SymbologyListEntry
  • User
  • Utils
  • ViewLifetimeControl
  • FileExtensions
  • FileLoggingSessionScenario
  • FileLoggingSessionScenario::BusySetter
  • Helpers
  • BarcodeScannerInfo
  • BindingHelpers
  • BluetoothLEDeviceDisplay
  • ConnectedDevice
  • ConnectionSettingsPanel
  • Contact
  • CopyFiles
  • CopyImage
  • CopyText
  • CustomEffectState
  • CustomTextBox
  • CustomTitleBar
  • DetailsPage
  • DeviceInformationDisplay
  • DeviceInformationKindChoice
  • DeviceInformationKindChoices
  • DeviceSelectorChoices
  • DeviceSelectorInfo
  • DeviceStateChangedEventArgs
  • DeviceStateSourceT< D >
  • DiscoveredDevice
  • EdgeTappedListView
  • EdgeTappedListView::ContainerEventTokens
  • GeneratedBitmapState
  • GroupInfoList
  • HistoryAndRoaming
  • HttpJsonContent
  • ImagePage
  • Item
  • KeepConnectionOpenScenario
  • ListViewEdgeTappedEventArgs
  • LoggingScenarioEventArgs
  • OcrCapturedImage
  • OcrFileImage
  • OpenCloseConnectionScenario
  • OtherScenarios
  • PlotDataReadyEventArgs
  • PlotDataSourceT< D >
  • PlugInFilter
  • ProtectionLevelSelectorInfo
  • ProtectionSelectorChoices
  • RadioModel
  • Scenario01_GetText
  • Scenario02_GetStream
  • Scenario03_GetList
  • Scenario04_PostText
  • Scenario05_PostStream
  • Scenario06_PostMultipart
  • Scenario07_PostStreamWithProgress
  • Scenario08_PostCustomContent
  • Scenario09_GetCookie
  • Scenario1
  • Scenario10
  • Scenario10_SetCookie
  • Scenario11
  • Scenario11_DeleteCookie
  • Scenario12_DisableCookies
  • Scenario13_RetryFilter
  • Scenario14_MeteredConnectionFilter
  • Scenario15_ServerCertificateValidation
  • Scenario1_Advertiser
  • Scenario1_Analyze
  • Scenario1_Basic
  • Scenario1_BasicFunctionality
  • Scenario1_Basics
  • Scenario1_Check
  • Scenario1_CheckConsentAvailability
  • Scenario1_Colors
  • Scenario1_Configure
  • Scenario1_ConfigureMobileHotspot
  • Scenario1_Data
  • Scenario1_DataEvents
  • Scenario1_DetectInPhoto
  • Scenario1_DevicePicker
  • Scenario1_Discovery
  • Scenario1_Enable
  • Scenario1_ExtractTextSegments
  • Scenario1_Files
  • Scenario1_FindId
  • Scenario1_FindUsers
  • Scenario1_GetAndSetPin
  • Scenario1_InkCanvasTactileFeedback
  • Scenario1_LanguageDetection
  • Scenario1_Launch
  • Scenario1_Launched
  • Scenario1_LongAndShortFormats
  • Scenario1_ManageHotspot
  • Scenario1_MoveCertificate
  • Scenario1_NetworkConnectivity
  • Scenario1_Orientation
  • Scenario1_ParseAndStringify
  • Scenario1_PercentPermilleFormatting
  • Scenario1_PinTile
  • Scenario1_Prefs
  • Scenario1_Print
  • Scenario1_ProvisionTPM
  • Scenario1_ReadData
  • Scenario1_Render
  • Scenario1_Save
  • Scenario1_SecondaryWindow
  • Scenario1_SimpleListView
  • Scenario1_SingleFile
  • Scenario1_Toggle
  • Scenario1_TrackInWebcam
  • Scenario1_TrackPosition
  • Scenario1_UIFonts
  • Scenario1_UTF8
  • Scenario1_XmlReader
  • Scenario2_Binary
  • Scenario2_ChangePIN
  • Scenario2_Client
  • Scenario2_Connector
  • Scenario2_DecimalFormatting
  • Scenario2_DetectInWebcam
  • Scenario2_DeviceWatcher
  • Scenario2_Disable
  • Scenario2_DisplayRegion
  • Scenario2_DocumentFonts
  • Scenario2_Effects
  • Scenario2_Extend
  • Scenario2_GetCurrentTextSegmentFromIndex
  • Scenario2_GetPosition
  • Scenario2_Lang
  • Scenario2_Launch
  • Scenario2_Listen
  • Scenario2_Manage
  • Scenario2_Memory
  • Scenario2_MultiFile
  • Scenario2_MultipleScanners
  • Scenario2_NetworkCost
  • Scenario2_Notifications
  • Scenario2_Polling
  • Scenario2_Remove
  • Scenario2_RequestConsent
  • Scenario2_RequestMany
  • Scenario2_ScriptDetection
  • Scenario2_Settings
  • Scenario2_ShowHideEvents
  • Scenario2_SimpleGridView
  • Scenario2_Stats
  • Scenario2_StringTemplate
  • Scenario2_SupportedTactileFeedback
  • Scenario2_ToggleMobileHotspot
  • Scenario2_UnpinTile
  • Scenario2_WatchUsers
  • Scenario2_XmlWriter
  • Scenario3_ActiveSymbologies
  • Scenario3_AppCapture
  • Scenario3_BackgroundDeviceWatcher
  • Scenario3_BackgroundTask
  • Scenario3_CheckUserConsentGroup
  • Scenario3_Choosing
  • Scenario3_ClientAuthentication
  • Scenario3_CurrencyFormatting
  • Scenario3_CustomItems
  • Scenario3_Enum
  • Scenario3_EnumerateTiles
  • Scenario3_InkingFeedback
  • Scenario3_MasterDetail
  • Scenario3_NetworkConnectivityChanges
  • Scenario3_ParameterizedTemplate
  • Scenario3_Region
  • Scenario3_ResetPIN
  • Scenario3_SecondaryTiles
  • Scenario3_ServerForeground
  • Scenario3_SettingContainer
  • Scenario3_ShowHideMethods
  • Scenario3_SingleFolder
  • Scenario3_Size
  • Scenario3_Transliteration
  • Scenario3_XmlWriterLite
  • Scenario4_ChangeAdminKey
  • Scenario4_ChangeSystemGroup
  • Scenario4_CharacterGrouping
  • Scenario4_CompactOverlay
  • Scenario4_CompositeSettings
  • Scenario4_EdgeTappedListView
  • Scenario4_ForegroundGeofence
  • Scenario4_Input
  • Scenario4_InteractionFeedback
  • Scenario4_NumberParsing
  • Scenario4_Override
  • Scenario4_PartialReadWrite
  • Scenario4_SaveFile
  • Scenario4_ShowView
  • Scenario4_Snapshot
  • Scenario4_SymbologyAttributes
  • Scenario4_TilePinned
  • Scenario4_UnicodeExtensions
  • Scenario5
  • Scenario5_DisplayingBarcodePreview
  • Scenario5_GeofenceBackgroundTask
  • Scenario5_GetSingleDevice
  • Scenario5_InkingAndInteractionFeedback
  • Scenario5_IsSupported
  • Scenario5_LaunchedFromSecondaryTile
  • Scenario5_Msappdata
  • Scenario5_RelativePositioning
  • Scenario5_RestoreScrollPosition
  • Scenario5_RoundingAndPadding
  • Scenario5_TimeZone
  • Scenario5_TriggerCFU
  • Scenario5_UnicodeExtensions
  • Scenario5_VerifyResponse
  • Scenario6
  • Scenario6_ClearScenario
  • Scenario6_CustomFilterAddedProps
  • Scenario6_DeleteTPM
  • Scenario6_GetLastVisit
  • Scenario6_NumeralSystemTranslation
  • Scenario6_ScrollIntoView
  • Scenario6_SecondaryTileNotification
  • Scenario6_TimeZone
  • Scenario7
  • Scenario7_DeviceInformationKind
  • Scenario7_ForegroundVisits
  • Scenario7_ListAllCards
  • Scenario7_PinFromAppbar
  • Scenario7_SetVersion
  • Scenario7_UsingUnicodeExtensions
  • Scenario8
  • Scenario8_PairDevice
  • Scenario8_TransmitAPDU
  • Scenario8_UpdateAsync
  • Scenario8_VisitsBackgroundTask
  • Scenario9
  • Scenario9_CustomPairDevice
  • School
  • SecondaryAppWindowPage
  • SecondaryViewPage
  • ShowPackageFamilyName
  • SizePreferenceString
  • SlowInputStream
  • SmartCardListItem
  • SymbologyListEntry
  • User
  • UserViewModel
  • Utils
  • ViewLifetimeControl
  • WordOverlay
  • LampArrayInfo
  • LoggingChannelScenario
  • LoggingSessionScenario
  • LoggingSessionScenario::BusySetter
  • MediaFoundationInitializer
    • Scenario2
    • Scenario3
    • Scenario4
  • MFSampleGenerator
  • PresentationFormats
  • RenderBuffer
  • SampleHelpers
  • SampleState
  • scope_exit< Lambda >
  • SimpleTaskCompletionSource< T >
  • SimpleTaskCompletionSource< void >
  • SocketReaderWriter
  • ToneSampleGenerator
  • ToneSampleGenerator::SineSampleInfo
  • unique_cotaskmem_ptr< T >
  • unique_disabled_control
  • unique_shared_work_queue
  • WrlFinal
  • CustomException
  • OvenClient
  • CustomException
  • OvenClient
  • BasicTests
  • ColorEntry
  • CSharpModel
  • EventTests
  • Functions
  • ListsAndTemplates
  • MyUserControl1
  • OtherBindings
  • PhasingTests
  • Templates
  • BoolToVisibilityConverter
  • ColorToStringConverter
  • DataModel
  • DOModel
  • DoubleToIntConverter
  • EmployeeCollection
  • EmployeeDictionary
  • FileDataSource
  • FileItem
  • IEmployee
    • Employee
    • Employee
    • Manager
    • Manager
  • IntToDoubleConverter
  • MapChangedEventArgs< K >
  • VectorChangedEventArgs
  • YangContainer
  • Account
  • AdaptivePage
  • BasicDeferral
  • DeferredControlTemplatePart
  • Email
  • TitledImage
  • BuildNewRss
  • GiftDispatch
  • MarkHotProducts
  • XmlLoading
  • XSLTTransform
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- _ -

  • _11 : Matrix4x4< T >
  • _12 : Matrix4x4< T >
  • _13 : Matrix4x4< T >
  • _14 : Matrix4x4< T >
  • _21 : Matrix4x4< T >
  • _22 : Matrix4x4< T >
  • _23 : Matrix4x4< T >
  • _24 : Matrix4x4< T >
  • _31 : Matrix4x4< T >
  • _32 : Matrix4x4< T >
  • _33 : Matrix4x4< T >
  • _34 : Matrix4x4< T >
  • _360VideoPlaybackMain() : _360VideoPlaybackMain
  • _41 : Matrix4x4< T >
  • _42 : Matrix4x4< T >
  • _43 : Matrix4x4< T >
  • _44 : Matrix4x4< T >
  • __pad0__ : sealed , PipeOut , PipeIn , sealed , ViewModelBase , sealed , Fx2Driver , BasicReaderWriter , MainPage , BasicTimer , sealed , PrintHelper , sealed , MainPage , sealed , TypeConversionHelpers , BasicLoader , BasicShapes , sealed , PersistentState , GameHud , DecodeResult , GameInfoOverlay , GameRenderer , DecodeEngine , Simple3DGame , sealed , CSendOperationStatus , CNetworkChannel , AdvancedCaptureContext , sealed , sealed::sealed , abstract , sealed , CaptureFailedEventArgs , SdkSample , sealed
  • __pad1__ : DecodeResult
  • _aamvaCardDataReceivedToken : sealed
  • _accelerometer : Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling , sealed
  • _accelerometerOriginal_ReadingChanged() : Scenario4_OrientationChanged
  • _accelerometerReadingTransform_ReadingChanged() : Scenario4_OrientationChanged
  • _acceptOperation : sealed
  • _Acquires_lock_() : CritSec , AutoLock , CMediaSource
  • _active : sealed
  • _activitySensor : Scenario3_ChangeEvents
  • _advancedCapture : sealed , MainPage
  • _advancedCaptureMode : sealed , MainPage
  • _advertisementStatusChangedToken : sealed
  • _advertiser : sealed
  • _advertiserMutex : sealed
  • _advertisers : sealed
  • _albumItems : MainViewModel
  • _allPhotosCapturedEventToken : sealed
  • _angle : OmnidirectionalSound
  • _angularVelocity : sealed
  • _appContactId : AppContactPanel
  • _applicationResumingEventToken : sealed
  • _applicationSuspendingEventToken : sealed
  • _article0 : HeroArticlesViewModel
  • _article1 : HeroArticlesViewModel
  • _audioData : AudioFileReader , AudioStreamReader
  • _audioFile : OmnidirectionalSound , CardioidSound , CustomDecaySound
  • _audioStream : OmnidirectionalSound
  • _autoAcceptSessionConnectedToken : sealed
  • _bankCardDataReceivedToken : sealed
  • _barDismissed : sealed , CalibrationBar
  • _beginDrawStarted : DeviceResources
  • _BoolPropWithINPC : DataModel
  • _breadBaked : WrlFinal
  • _buffer : BufferHelper
  • _bufferByteAccess : BufferHelper
  • _buffers : CBufferPacket , CBufferEnumerator
  • _busy : IncrementalLoadingBase
  • _bytes : BufferHelper
  • _c_sec0 : Scenario3_Trim
  • _c_sec1 : Scenario3_Trim
  • _cache : FileDataSource
  • _calibrationTimer : sealed , CalibrationBar
  • _callback : CMediaSink
  • _cameraEnclosureLocation : sealed , CameraRotationHelper
  • _cancelReason : BackgroundActivity , SampleBackgroundTask
  • _cancelRequested : BackgroundActivity , SampleBackgroundTask , ServicingComplete , AuthenticationTask
  • _canExecute : RelayCommand
  • _canExecuteCallback : sealed
  • _captureFolder : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , Scenario2_PhotoSettings , Scenario3_AspectRatio , sealed , MainPage , sealed , MainPage
  • _cardioidSound : sealed
  • _CCCToken : sealed
  • _CCToken : sealed
  • _changeEvents : ScenarioElement
  • _channel : sealed
  • _channelLoggingLevel : sealed
  • _claimedReader : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • _collectionItems : MainViewModel
  • _ColorPropWithINPC : DataModel
  • _compass : Scenario1_DataEvents , Scenario2_Polling
  • _CompletionEvent : ReadStreamTask::ReadStreamTaskImpl
  • _completionEvent : sealed
  • _compositionTarget : sealed , VisualProperties
  • _compositor : sealed , VisualProperties , Scenario2_Conditional
  • _ConcatenateCalled : sealed
  • _config : sealed
  • _ConfigureWiFiCalled : sealed
  • _ConnectCalled : sealed
  • _Connected : CStreamSink
  • _connectedDevices : sealed
  • _connectedSessions : sealed
  • _connectionId : sealed
  • _connectionReceivedToken : sealed
  • _connectionRequestedToken : sealed
  • _ConnectionResultReceived : sealed
  • _contentSize : DeviceResources
  • _contentZoomFactor : DeviceResources
  • _context : AuthenticationTask
  • _contextMenuFlyout : sealed
  • _coreWindow : CustomEditControl
  • _count : GeneratorIncrementalLoadingClass-g< T > , FileDataSource , FileDataSource2
  • _countOfCoalescedIndependentInput : InkEventLogger
  • _countOfCoalescedStrokeMessages : InkEventLogger
  • _countOfCoalescedUnprocessedInput : InkEventLogger
  • _cRef : CBufferPacket , CBufferEnumerator , CMarker , CMediaSink , CSourceOperation , CMediaSource , CMediaStream , CStreamSink::CAsyncOperation , CStreamSink
  • _criticalSection : sealed
  • _critSec : CNetworkChannel , sealed , CMediaSink , sealed , CMediaSource , CStreamSink
  • _cStreamsEnded : CMediaSink
  • _cts : Scenario2_GetPosition , Scenario4_ForegroundGeofence , LocationBackgroundTask , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • _CTS : sealed
  • _Current : DeviceList , sealed
  • _currentConfig : InkEventLogger
  • _currentDeviceFamily : DeviceFamilyTrigger
  • _currentHeight : ControlSizeTrigger
  • _currentHitTestState : sealed
  • _currentHitTestSubState : sealed
  • _currentIt : CBufferEnumerator
  • _currentMessage : sealed
  • _CurrentReceivedOperationHeader : CMediaSource
  • _currentSession : Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard
  • _currentState : sealed
  • _currentVisual : sealed , VisualProperties
  • _currentWidth : ControlSizeTrigger
  • _customDataType : sealed
  • _customDecaySound : sealed
  • _d2dContext : DeviceResources
  • _d2dDevice : DeviceResources
  • _d2dFactory : DeviceResources
  • _d3dContext : DeviceResources
  • _d3dDevice : DeviceResources
  • _data : Metering , CSourceOperation
  • _datagramMessageReceivedToken : sealed
  • _datagramSocket : sealed
  • _dataReader : SocketReaderWriter
  • _dataSize : sealed
  • _dataSource : PhasingTests , sealed
  • _dataWriter : SocketReaderWriter
  • _deferral : BackgroundActivity , sealed , SampleBackgroundTask
  • _deletedItem : sealed , Scenario1_ListView
  • _desiredReportInterval : Scenario3_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling
  • _Destination : ReadStreamTask::ReadStreamTaskImpl
  • _destinationEffectsPresent : Scenario2_Conditional
  • _destVisual : Scenario2_Conditional
  • _details : AuthenticationTask
  • _device : sealed
  • _deviceAccessInformation : Scenario3_ChangeEvents
  • _deviceAddedToken : sealed
  • _deviceEventArgs : MainPage
  • _deviceInfo : sealed
  • _deviceOrientation : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _deviceRemovedToken : sealed
  • _deviceResources : SceneComposer
  • _deviceUpdatedToken : sealed
  • _deviceUseBackgroundTaskRegistration : sealed , Scenario1_DeviceUse
  • _deviceUseTrigger : sealed , Scenario1_DeviceUse
  • _deviceWatcher : sealed , Scenario2_Connector
  • _deviceWatcherEnumerationCompletedToken : sealed
  • _deviceWatcherStoppedToken : sealed
  • _dimensions : Oven
  • _dims : sealed , WrlFinal
  • _discoveredDevices : sealed
  • _discoveryMutex : sealed
  • _dispatcher : SourceGroupCollection , SimpleLogger , MediaCapturePreviewer , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed , SdkSample , FileDataSource , FileDataSource2
  • _dispatcherTimer : Scenario3_Polling , Scenario2_Polling
  • _displayInformation : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , CameraRotationHelper , sealed , MainPage
  • _displayInformationEventToken : sealed
  • _displayOrientation : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _displayRequest : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _displayTime : sealed
  • _download : DownloadOperationItem
  • _downloadCollection : sealed
  • _dpiAdjustmentRatio : DeviceResources
  • _DPOnPage : sealed , BasicTests , OtherBindings
  • _dragging : sealed , VisualProperties
  • _dragOperation : sealed , Scenario3_StartDragAsync
  • _dropHere : sealed
  • _duration : OmnidirectionalSound
  • _dwId : CMediaStream
  • _dwIdentifier : CStreamSink
  • _editContext : CustomEditControl
  • _eDropMode : CMediaStream
  • _eMarkerType : CMarker
  • _employee : Manager
  • _EmployeePropertyDPProperty : DataModel
  • _EmployeePropWithINPC : DataModel
  • _Employees : DataModel
  • _enabled : sealed , LoggingScenarioEventArgs
  • _encodingProfile : sealed , MainPage
  • _encodingProperties : sealed
  • _EndDryPending : SceneComposer
  • _entities : sealed
  • _entityId : sealed
  • _entityIndex : sealed
  • _environment : OmnidirectionalSound , CardioidSound , CustomDecaySound
  • _error : CSendOperationStatus
  • _eSourceState : CMediaSource , CMediaStream
  • _eventLogger : sealed
  • _execute : RelayCommand
  • _executeCallback : sealed
  • _extendingLeft : CustomEditControl
  • _externalCamera : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _faceDetectedEventToken : sealed
  • _faceDetectionEffect : sealed , MainPage
  • _fActive : CMediaStream
  • _fAsyncOperationInProgress : sealed
  • _fConnected : SetConnectedFunc
  • _fDiscontinuity : CMediaStream
  • _fDropTime : CMediaStream
  • _fFirstSampleAfterConnect : CStreamSink
  • _fGetStartTimeFromSample : CStreamSink
  • _fInitDropTime : CMediaStream
  • _firstAdapter : sealed
  • _FirstName : Employee
  • _fIsVideo : CStreamSink
  • _flavor : Bread
  • _flRate : CSetRateOperation , CMediaSource , CMediaStream
  • _folder : FileDataSource , FileDataSource2
  • _foregroundAppId : AuthenticationTask
  • _format : AudioFileReader , AudioStreamReader
  • _FPSTimer : Scenario1_ExampleOperations
  • _frame : sealed
  • _frameBuffer : sealed
  • _frameCount : Scenario1_ExampleOperations
  • _frameRenderer : Scenario2_FindAvailableSourceGroups
  • _frameRenderers : Scenario1_DisplayDepthColorIR
  • _fShutdown : sealed
  • _fThin : CSetRateOperation
  • _fVideo : CMediaStream
  • _fWaitingForCleanPoint : CMediaStream
  • _fWaitingForFirstSample : CStreamSink
  • _fWatcherStarted : sealed , Scenario2_Connector
  • _generator : ShapeRenderer , GeneratorIncrementalLoadingClass-g< T >
  • _geofenceTask : Scenario5_GeofenceBackgroundTask
  • _geolocator : Scenario1_TrackPosition
  • _geolocTask : Scenario3_BackgroundTask
  • _gestureRecognizer : sealed
  • _GetContactAnnotationList() : Scenario1_CreateContacts
  • _GetContactList() : Scenario1_CreateContacts
  • _GetIsUpperCaseEnabledRequested : sealed
  • _GetLastErrorRequested : sealed
  • _GetScanInfoCalled : sealed
  • _GetStateRequested : sealed
  • _GetVersionRequested : sealed
  • _groupCollection : Scenario2_FindAvailableSourceGroups
  • _groupSelectionIndex : Scenario1_DisplayDepthColorIR
  • _guiCurrentSubtype : CStreamSink
  • _gyrometer : Scenario1_DataEvents , Scenario2_Polling
  • _hardwareCameraButtonEventToken : sealed
  • _header : TitledImage
  • _headline : ArticleViewModel
  • _height : sealed
  • _helper : Scenario1_ExampleOperations
  • _highlighterStroke : SceneComposer::InkObject
  • _hnsAmountToDrop : CMediaStream
  • _hnsStartDroppingAt : CMediaStream
  • _hrtfParams : OmnidirectionalSound , CardioidSound , CustomDecaySound , OmnidirectionalSound
  • _imageData : FileItem
  • _imagePath : ScenarioElement
  • _imageSource : sealed
  • _imageUri : ArticleViewModel
  • _Impl : ReadStreamTask
  • _importOperation : MainPage
  • _inclinometer : Scenario1_DataEvents , Scenario2_Polling
  • _incomingConnectionEventRegistrationToken : sealed
  • _independentInput : sealed
  • _independentInputEnteringToken : sealed
  • _independentInputExitingToken : sealed
  • _independentInputHoveringToken : sealed
  • _independentInputLostToken : sealed
  • _independentInputMovingToken : sealed
  • _independentInputPressingToken : sealed
  • _independentInputReleasingToken : sealed
  • _informationElements : Scenario1_Advertiser
  • _initialization : sealed
  • _initialized : sealed
  • _initialPointerPoint : sealed
  • _initStatus : OmnidirectionalSound
  • _inkRenderer : SceneComposer
  • _inkSynchronizer : SceneComposer
  • _inLassoSelection : SceneComposer
  • _InputFile : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • _inputMode : sealed
  • _inputPane : CustomEditControl
  • _inputPropertiesBackup : sealed , MainPage
  • _insideName : sealed
  • _instance : sealed , Scenario2 , Scenario3 , sealed
  • _internalFocus : CustomEditControl
  • _IntPropertyDPProperty : DOModel , DataModel
  • _IntPropWithINPC : DataModel
  • _isActive : sealed , Scenario3_StartDragAsync
  • _isActivePage : sealed , MainPage
  • _isBusy : sealed , FileLoggingSessionScenario , LoggingSessionScenario
  • _isChannelEnabled : sealed , FileLoggingSessionScenario , LoggingSessionScenario
  • _isClosed : CNetworkChannel
  • _IsConnected : CMediaSink
  • _isFocused : MainPage
  • _isInitialized : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _isLoggingEnabled : sealed
  • _isPreparingForSuspend : sealed , FileLoggingSessionScenario
  • _isPresent : IsApiPropertyPresentTrigger
  • _isPreviewing : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _isPropertyPresent : IsApiPropertyPresentTrigger
  • _isRecording : sealed , MainPage , sealed , MainPage
  • _isSent : sealed
  • _IsShutdown : CStreamSink , CMediaSink
  • _isSuspending : sealed , MainPage
  • _isTerminator : sealed
  • _isTracked : sealed
  • _isUIActive : sealed , MainPage
  • _IsUpperCaseEnabledChanged : sealed
  • _itemId : ItemViewModel
  • _items : MainViewModel , Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView , ItemsDataSource , Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView
  • _knownTypes : SuspensionManager
  • _lamp : sealed
  • _lampAvailabilutyChangedEventToken : sealed
  • _lastCalibrationTime : CalibrationBar , sealed , CalibrationBar
  • _LastName : Employee
  • _lastPointerType : InputTypeTrigger
  • _lastSelectedItem : MasterDetailPage
  • _lastTick : OmnidirectionalSound
  • _latencyMode : sealed
  • _LaunchType : sealed
  • _listener : sealed , Scenario1_Advertiser
  • _listenerSocket : sealed
  • _listeningPort : sealed
  • _llStartTime : SetConnectedFunc , StartFunc , CMediaSink
  • _loadTimer : ArticlePage
  • _localHostVideo : sealed
  • _log : InkEventLogger
  • _logFileFullPath : sealed , LoggingScenarioEventArgs
  • _logFileGeneratedCount : sealed , FileLoggingSessionScenario , LoggingSessionScenario
  • _logger : Scenario2_FindAvailableSourceGroups , Scenario1_DisplayDepthColorIR
  • _logicalDPI : DeviceResources
  • _longTimeFormatter : sealed
  • _m00 : Matrix4x4< T >
  • _m01 : Matrix4x4< T >
  • _m02 : Matrix4x4< T >
  • _m03 : Matrix4x4< T >
  • _m10 : Matrix4x4< T >
  • _m11 : Matrix4x4< T >
  • _m12 : Matrix4x4< T >
  • _m13 : Matrix4x4< T >
  • _m20 : Matrix4x4< T >
  • _m21 : Matrix4x4< T >
  • _m22 : Matrix4x4< T >
  • _m23 : Matrix4x4< T >
  • _m30 : Matrix4x4< T >
  • _m31 : Matrix4x4< T >
  • _m32 : Matrix4x4< T >
  • _m33 : Matrix4x4< T >
  • _magnetometer : Scenario2_Polling , Scenario1_DataEvents
  • _manager : sealed
  • _Manager : Employee
  • _managerMutex : sealed
  • _ManagerProp : DataModel
  • _maxCount : GeneratorIncrementalLoadingClass-g< T >
  • _mediaCapture : sealed , MainPage , sealed , MainPage , Scenario1_DisplayDepthColorIR , sealed , MainPage , sealed , MainPage , sealed , Scenario1_ExampleOperations , Scenario2_FindAvailableSourceGroups
  • _mediaCaptureFailedEventRegistrationToken : sealed
  • _mediaCaptureFailedEventToken : sealed
  • _mediaCaptureLifeLock : MainPage
  • _mediaControlPropChangedEventToken : sealed
  • _mediaElementFailedEventRegistrationToken : sealed
  • _mediaFrameReference : sealed
  • _mediaSink : sealed
  • _mediaSinkIncomingConnectionEventRegistrationToken : sealed
  • _message : CaptureFailedEventArgs
  • _messageCount : SimpleLogger
  • _messageLock : SimpleLogger
  • _messageText : SimpleLogger
  • _minHeight : ControlSizeTrigger
  • _minWidth : ControlSizeTrigger
  • _mirroringPreview : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _moreButton : sealed
  • _mutex : sealed
  • _myOven : sealed , OvenClient , sealed , OvenClient , sealed
  • _name : Scenario , ScenarioGroup
  • _navigationDisabled : sealed
  • _networkSender : CMediaSink , CMediaSource , CStreamSink
  • _nextId : sealed
  • _nOffset : CMediaBufferWrapper
  • _nonDPProperty : MyUserControl1
  • _OffboardCalled : sealed
  • _offset : BufferHelper , sealed
  • _offsetBias : sealed , VisualProperties
  • _omnidirectionalSound : sealed
  • _onChannelLoggingEnabledToken : sealed
  • _onLogFileGeneratedToken : sealed
  • _openedEvent : CMediaSource
  • _optionalRefPhotoCapturedEventToken : sealed
  • _opType : CSourceOperation
  • _orientationChangedEventToken : sealed
  • _orientationSensor : sealed , MainPage , CameraRotationHelper , sealed , MainPage , sealed , MainPage
  • _OutputFile : Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • _OutputFileExtension : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • _OutputFileName : Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • _outputPropertiesBackup : MainPage , sealed
  • _outputRenderer : Scenario1_ExampleOperations
  • _OutputType : Scenario1_Default , sealed , Scenario2_Custom , Scenario3_Trim
  • _outsideName : sealed
  • _pageIsLoading : Scenario1_NavToUrl
  • _pageKey : NavigationHelper
  • _parent : sealed , YangContainer
  • _pastePosition : sealed
  • _pBuffer : CMediaBufferWrapper
  • _pendingConnections : Scenario1_Advertiser
  • _percentComplete : DownloadOperationItem , sealed
  • _periodicTimer : BackgroundActivity , SampleBackgroundTask
  • _persistedItemContainerHeight : Scenario5_RestoreScrollPosition
  • _persistedItemKey : Scenario5_RestoreScrollPosition
  • _persistedPosition : Scenario5_RestoreScrollPosition
  • _pin : sealed
  • _pitch : sealed
  • _placeholder : MainPage
  • _pointerId : sealed
  • _posesCount : sealed
  • _poseSetId : sealed
  • _pParent : CStreamSink
  • _prevErasingPoint : sealed
  • _previewControl : MediaCapturePreviewer
  • _previewer : Scenario3_AspectRatio , Scenario2_PhotoSettings , Scenario1_PreviewSettings
  • _previewProperties : sealed , MainPage
  • _previewRenderer : Scenario1_ExampleOperations
  • _previousState : sealed
  • _Profile : sealed , Scenario2_Custom , Scenario1_Default , Scenario3_Trim
  • _progress : BackgroundActivity , SampleBackgroundTask
  • _properties : StreamResolution
  • _PropertyChanged : sealed
  • _propertyName : IsApiPropertyPresentTrigger
  • _provisioningInfo : sealed
  • _ptCurrent : SceneComposer
  • _ptInitial : SceneComposer
  • _publisher : Scenario1_Advertiser , sealed , Scenario2_Connector
  • _queriedDeviceFamily : DeviceFamilyTrigger
  • _queryResult : FileDataSource , FileDataSource2 , FileDataSource
  • _radius : sealed
  • _random : VisualProperties , MainPage
  • _ranges : ItemIndexRangeList
  • _rawCngPublicKeyBlob : SubjectPublicKeyInfo
  • _reader : Scenario2_FindAvailableSourceGroups , sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • _Reader : ReadStreamTask::ReadStreamTaskImpl
  • _reader : Scenario1_ExampleOperations , sealed
  • _readingToken : sealed
  • _recordingStarted : sealed
  • _recordLimitationExceededEventToken : sealed
  • _refCount : SceneComposer
  • _reference : sealed , Scenario1_ListView
  • _refreshTimer : sealed , Scenario1_DeviceUse
  • _registeredFrames : SuspensionManager
  • _registrationToken : sealed
  • _releaseDeviceRequestedToken : sealed
  • _Releases_lock_() : CritSec , CMediaSource , AutoLock
  • _remotePortAddedToken : sealed
  • _remoteUrl : CMediaSink , sealed
  • _reports : Manager
  • _reportsDictionary : Manager
  • _requestList : sealed
  • _rnd : Scenario3_StartDragAsync , sealed
  • _role : sealed
  • _roll : sealed
  • _root : sealed , VisualProperties
  • _rootPage : SocketReaderWriter , sealed , Scenario3_BackgroundTask , SdkSample , Scenario4_ForegroundGeofence , Scenario7_ForegroundVisits , Scenario5_GeofenceBackgroundTask , Scenario1_TrackPosition , sealed , Scenario2_GetPosition , Scenario6_GetLastVisit , Scenario8_VisitsBackgroundTask , sealed
  • _rootVisual : Scenario2_Conditional
  • _rotationHelper : sealed , MainPage
  • _sampleCount : sealed
  • _SampleQueue : CStreamSink
  • _samples : CMediaStream
  • _savedProfileName : sealed
  • _scenario : FileLoggingSessionScenario::BusySetter , LoggingSessionScenario::BusySetter
  • _scenario1 : sealed
  • _scenario2 : sealed
  • _scenario3 : sealed
  • _scenario4 : sealed
  • _scenario5 : sealed
  • _sceneAnalysisEffect : MainPage , sealed
  • _sceneAnalyzedEventToken : sealed
  • _sceneComposer : sealed
  • _sceneObjects : SceneComposer
  • _sdkSample : sealed
  • _selectedSession : sealed
  • _selection : Scenario1_ListView , CustomEditControl , sealed
  • _selectionBrush : SceneComposer
  • _selectionPoints : sealed
  • _selectionRect : InkRenderer
  • _sensor : Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents
  • _serverAddress : CMediaSource
  • _serverPort : CMediaSource
  • _service : sealed
  • _session : sealed
  • _sessionClosedEvent : sealed
  • _sessionDeferredToken : sealed
  • _SessionLost : sealed
  • _SessionMemberAdded : sealed
  • _SessionMemberRemoved : sealed
  • _sessionMutex : sealed
  • _sessionRequestedToken : sealed
  • _sessionState : SuspensionManager
  • _sessionStatusChangedToken : sealed
  • _SetIsUpperCaseEnabledRequested : sealed
  • _settingUpUi : MainPage
  • _setupTask : sealed , MainPage
  • _shakeCount : Scenario2_ShakeEvents
  • _shape : SceneComposer::ShapeObject
  • _shapeDistributionX : ShapeRenderer
  • _shapeDistributionY : ShapeRenderer
  • _shapeRenderer : SceneComposer
  • _singleControlMode : MainPage
  • _size : BufferHelper , sealed
  • _socket : CNetworkChannel
  • _socketList : sealed
  • _socketReader : sealed
  • _socketWriter : sealed
  • _source : Scenario2_FindAvailableSourceGroups
  • _sourceCollection : SourceGroupCollection
  • _sourceReaders : Scenario1_DisplayDepthColorIR
  • _sourceType : OmnidirectionalSound
  • _sourceVoice : CustomDecaySound , CardioidSound , OmnidirectionalSound
  • _sp2DBuffer : CMediaBufferWrapper
  • _spAttributes : CBaseAttributes< TBase >
  • _spBufferMarshal : CMediaBufferWrapper
  • _spByteStream : CStreamSink
  • _spClock : CMediaSink
  • _spCurrentReceiveBuffer : CMediaSource
  • _spCurrentReceivePacket : CMediaSource
  • _spCurrentType : CStreamSink
  • _spEventQueue : CStreamSink , CMediaSource , CMediaStream
  • _spFirstVideoSample : CStreamSink
  • _spFTM : CStreamSink
  • _spInkD2DRenderer : InkRenderer
  • _spMediaBuffer : CMediaBufferWrapper
  • _spMediaSink : sealed
  • _spParent : CBufferEnumerator
  • _spPD : CStartOperation
  • _spPresentationDescriptor : CMediaSource
  • _spReceiveBuffer : CMediaSink
  • _spSink : CStreamSink , sealed
  • _spSource : CMediaStream::CSourceLock , CMediaStream
  • _spStreamDescriptor : CMediaStream
  • _Start : Scenario3_Trim
  • _start : sealed
  • _StartTime : CStreamSink
  • _state : sealed , CStreamSink
  • _stateText : DownloadOperationItem , sealed
  • _status() : sealed
  • _statusChanged : LoggingSessionScenario , FileLoggingSessionScenario
  • _statusChangedToken : Scenario3 , Scenario2 , sealed
  • _step : ScenarioElement
  • _stokeContinuedToken : sealed
  • _stop : sealed
  • _Stop : Scenario3_Trim
  • _Stopped : sealed
  • _storage : sealed , IncrementalLoadingBase
  • _storageChanged : sealed
  • _StreamData : ReadStreamTask::ReadStreamTaskImpl
  • _streamFilteringCriteria : sealed
  • _streaming : Scenario2_FindAvailableSourceGroups
  • _streams : CMediaSource , CMediaSink
  • _streamSocket : sealed , SocketReaderWriter
  • _streamSocketListener : sealed
  • _streamSocketListeners : sealed
  • _StringPropertyDPProperty : DataModel
  • _StringPropWithINPC : DataModel
  • _stroke : SceneComposer::InkObject
  • _strokeCanceledToken : sealed
  • _strokeContainer : InkRenderer
  • _StrokeContainerForTemp : InkRenderer
  • _strokeEndedToken : sealed
  • _strokesCollectedToken : sealed
  • _strokeStartedToken : sealed
  • _strokeStyle : InkRenderer , SceneComposer
  • _supportedConfigMethods : ConnectionSettingsPanel
  • _symbol : Scenario3_StartDragAsync , sealed
  • _symbols : Scenario3_StartDragAsync , sealed
  • _systemMediaControls : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _systemNavigationManager : MainPage
  • _targetElement : ControlSizeTrigger , InputTypeTrigger
  • _targetElement_PointerPressed() : InputTypeTrigger
  • _targetElement_SizeChanged() : ControlSizeTrigger
  • _taskCompletionToken : sealed
  • _taskInstance : SampleBackgroundTask , BackgroundActivity
  • _temperature : sealed , WrlFinal , Oven
  • _text : CustomEditControl
  • _textBlock : SimpleLogger
  • _TextSentReceived : sealed
  • _tileId : ScenarioElement
  • _timer : sealed , Scenario3_StartDragAsync
  • _timerEventToken : sealed
  • _timerStep3 : ScenarioElement
  • _timerStep3_Tick() : ScenarioElement
  • _token : sealed
  • _tokens : CMediaStream
  • _Transcoder : Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • _triggerPointerType : InputTypeTrigger
  • _type : sealed , LoggingScenarioEventArgs
  • _typeName : IsApiPropertyPresentTrigger
  • _uiSettings : SectionView , ArticlePage
  • _uniqueInternalId : sealed
  • _unprocessedInputEnteredToken : sealed
  • _unprocessedInputExitedToken : sealed
  • _unprocessedInputHoveredToken : sealed
  • _unprocessedInputLostToken : sealed
  • _unprocessedInputMovedToken : sealed
  • _unprocessedInputPressedToken : sealed
  • _unprocessedInputReleasedToken : sealed
  • _updateTimer : MainPage
  • _UseMp4 : Scenario2_Custom , sealed
  • _value : YangContainer
  • _values : LocationBackgroundTask , GeofenceBackgroundTask , VisitBackgroundTask
  • _varContextValue : CMarker
  • _varMarkerValue : CMarker
  • _videoSettingsFilter : sealed
  • _videoStabilizationEffect : sealed , MainPage
  • _videoStabilizationEnabledToken : sealed
  • _view : sealed , VisualProperties
  • _viewModel : MainPage
  • _viewSize : DeviceResources
  • _visibilityToken : sealed
  • _visitMonitor : Scenario7_ForegroundVisits
  • _visitTask : Scenario8_VisitsBackgroundTask
  • _vsis : DeviceResources
  • _vsisNative : DeviceResources
  • _waitingConnectionId : CMediaSink
  • _watcher : SourceGroupCollection
  • _wiFiAdapters : sealed
  • _window : sealed , VisualProperties
  • _windowSizeEventToken : sealed
  • _windowVisibilityChangedEventToken : sealed
  • _WorkQueueCB : CStreamSink
  • _WorkQueueId : CStreamSink
  • _writer : sealed
  • _x : sealed
  • _xaudio2 : CardioidSound , OmnidirectionalSound , CustomDecaySound
  • _y : sealed
  • _yaw : sealed
  • _YinPropertyDPProperty : DOModel
  • _z : sealed
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Namespace Index

  • Namespace List
  • Namespace Members

Namespace List

Here is a list of all namespaces with brief descriptions:
_360VideoPlayback |
_360VideoPlayback::Common |
_360VideoPlayback::Content |
ABI |
ABI::Microsoft |
ABI::Microsoft::SDKSamples |
ABI::Microsoft::SDKSamples::Kitchen |
Accounts |
AdventureWorks |
AdventureWorks::Common |
AdventureWorks::Model |
AdventureWorks::View |
AdventureWorks::ViewModel |
AdventureWorks::VoiceCommands |
AdventureWorks_Shared |
AllJoynConsumerExperiences |
AllJoynProducerExperiences |
anonymous_namespace{BluetoothLEAttributeDisplay.cpp} |
anonymous_namespace{CameraCoordinateMapper.cpp} |
anonymous_namespace{Contact.cpp} |
anonymous_namespace{DDSTextureLoader.cpp} |
anonymous_namespace{GpuCoordinateMapper.cpp} |
anonymous_namespace{NetworkChannel.cpp} |
anonymous_namespace{SampleConfiguration.cpp} |
anonymous_namespace{Scenario05_PostStream.cpp} |
anonymous_namespace{Scenario1_Data.cpp} |
anonymous_namespace{Scenario1_FindId.cpp} |
anonymous_namespace{Scenario1_Print.cpp} |
anonymous_namespace{Scenario2_Client.cpp} |
anonymous_namespace{Scenario2_Effects.cpp} |
anonymous_namespace{Scenario2_Lang.cpp} |
anonymous_namespace{Scenario2_Stats.cpp} |
anonymous_namespace{Scenario2_StringTemplate.cpp} |
anonymous_namespace{Scenario3.cpp} |
anonymous_namespace{Scenario3_ParameterizedTemplate.cpp} |
anonymous_namespace{Scenario3_Region.cpp} |
anonymous_namespace{Scenario4_ForegroundGeofence.cpp} |
anonymous_namespace{Scenario4_UnicodeExtensions.cpp} |
anonymous_namespace{Scenario5_RoundingAndPadding.cpp} |
anonymous_namespace{Scenario5_TimeZone.cpp} |
anonymous_namespace{Scenario6.cpp} |
anonymous_namespace{Scenario6_TimeZone.cpp} |
anonymous_namespace{SecondaryViewPage.cpp} |
anonymous_namespace{StspMediaSink.cpp} |
anonymous_namespace{StspMediaSource.cpp} |
anonymous_namespace{Validation.cpp} |
AppResourceClassLibrary |
AudioCreation |
BackgroundDeviceWatcherTask |
BackgroundDeviceWatcherTaskCpp |
BackgroundDeviceWatcherTaskCs |
BackgroundMediaPlayback |
BackgroundMediaPlayback::DataModels |
BackgroundMediaPlayback::Services |
BackgroundMediaPlayback::ViewModels |
BackgroundTask |
BackgroundTasks |
BackgroundTasks::Helpers |
BarcodeDecoder |
BasicHologram |
BasicHologram::Common |
BasicHologram::Content |
BasicMediaCasting |
BindTestbedModel |
BluetoothAdvertisement |
CameraAdvancedCapture |
CameraGetPreviewFrame |
CameraManualControls |
CameraProfile |
CameraStarterKit |
CameraStreamCoordinateMapper |
CameraVideoStabilization |
com |
com::microsoft |
com::microsoft::Samples |
com::microsoft::Samples::SecureInterface |
Commanding |
CompositionVisual |
Compression |
CredentialPicker |
CustomComputeShader |
CustomEffect |
CustomHidDeviceAccess |
CustomMediaTransportControls |
CustomPixelShader |
CustomSensors |
CustomSerialDeviceAccess |
CustomUsbDeviceAccess |
CustomVertexShader |
D2DAdvancedColorImages |
D2DGradientMesh |
D2DPhotoAdjustment |
DataBinding |
DatagramSocketSample |
DataVirtualizationSample |
Desfire |
DirectX |
DisplayMetrics |
DisplaySizeHelper |
DragAndDropSampleManaged |
DWriteColorTextRenderer |
DWriteTextLayoutCloudFontImplementation |
DWriteTextLayoutImplementation |
DX |
EdpSample |
ELS |
ELS::Private |
FaceDetection |
Felica |
FilePickerContracts |
FilePickerContractsTasks |
FocusVisualsSample |
GameConstants |
GameConstants::Physics |
GameConstants::Sound |
GameControl |
GameInfoOverlayConstant |
GameUIConstants |
GyrometerCS |
HolographicApp2 |
HolographicFaceTracker |
HolographicMRCSample |
HolographicPaint |
HolographicSpatialMapping |
HolographicSpatialStage |
HolographicTagAlongSample |
HolographicVoiceInput |
HotspotAuthenticationTask |
HttpFilters |
ImportSample |
InclinometerCS |
Iso15693 |
Iso7816 |
Lamp |
LightSensorCS |
LiveDash |
LiveDash::Models |
LiveDash::Util |
LiveDashApp |
MagneticStripeReaderSample |
MasterDetailApp |
MasterDetailApp::Data |
MasterDetailApp::ViewModels |
MediaEditingSample |
MFPoseTrackingPreview |
Microsoft |
Microsoft::Build |
Microsoft::Build::Tasks |
Microsoft::Samples |
Microsoft::Samples::Common |
Microsoft::Samples::Devices |
Microsoft::Samples::Devices::Sensors |
Microsoft::Samples::Devices::Sensors::Calibration |
Microsoft::Samples::SimpleCommunication |
Microsoft::Samples::SimpleCommunication::Network |
Microsoft::SDKSamples |
Microsoft::SDKSamples::Kitchen |
MicrosoftPassport |
MicrosoftPassport::Models |
MicrosoftPassport::Server |
MicrosoftPassport::Server::Controllers |
MicrosoftPassport::Server::Data |
MIDI |
MifareStandard |
MifareUltralight |
MobileBroadband |
MoveLookConstants |
MrcEffectDefinitions |
NfcHceBackgroundTask |
NfcProvisioner |
NfcSample |
Notifications |
Notifications::Controls |
Notifications::Converters |
Notifications::Helpers |
Notifications::Model |
Notifications::ScenarioPages |
Notifications::ScenarioPages::Badges |
Notifications::ScenarioPages::Badges::Local |
Notifications::ScenarioPages::Badges::Local::PrimaryTile |
Notifications::ScenarioPages::Badges::Local::PrimaryTile::ClearBadge |
Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeGlyph |
Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeNumber |
Notifications::ScenarioPages::Badges::Local::SecondaryTileBadges |
Notifications::ScenarioPages::LiveTiles |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Default |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Logo |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Name |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::NameAndLogo |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::None |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Custom |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Contact |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::People |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Photos |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppData |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppPackage |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromInternet |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextStyles |
Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextWrap |
Notifications::ScenarioPages::LiveTiles::BasicState |
Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor |
Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Custom |
Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::InheritFromPrimary |
Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Transparent |
Notifications::ScenarioPages::LiveTiles::BasicState::Logos |
Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source |
Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppData |
Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppPackage |
Notifications::ScenarioPages::LiveTiles::FindAllAsync |
Notifications::ScenarioPages::LiveTiles::FindAllAsync::Visualizer |
Notifications::ScenarioPages::LiveTiles::Notifications |
Notifications::ScenarioPages::LiveTiles::Notifications::ExpiringNotification |
Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile |
Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Clearing |
Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Sending |
Notifications::ScenarioPages::LiveTiles::Notifications::SecondaryTiles |
Notifications::ScenarioPages::LiveTiles::Pinning |
Notifications::ScenarioPages::LiveTiles::UnpinEverything |
Notifications::ScenarioPages::LiveTiles::Updating |
Notifications::ScenarioPages::Toasts |
Notifications::ScenarioPages::Toasts::Actions |
Notifications::ScenarioPages::Toasts::Actions::Action |
Notifications::ScenarioPages::Toasts::Actions::Action::QuickReply |
Notifications::ScenarioPages::Toasts::Actions::Action::Text |
Notifications::ScenarioPages::Toasts::Actions::Action::TextAndImage |
Notifications::ScenarioPages::Toasts::Actions::InputText |
Notifications::ScenarioPages::Toasts::Actions::InputText::DefaultInput |
Notifications::ScenarioPages::Toasts::Actions::InputText::PlaceholderContent |
Notifications::ScenarioPages::Toasts::Actions::InputText::RetrievingArgs |
Notifications::ScenarioPages::Toasts::Actions::InputText::Title |
Notifications::ScenarioPages::Toasts::Actions::SystemCommands |
Notifications::ScenarioPages::Toasts::Actions::SystemCommands::SnoozeAndDismiss |
Notifications::ScenarioPages::Toasts::ActivationTypes |
Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppClosed |
Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppOpen |
Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppClosed |
Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppOpen |
Notifications::ScenarioPages::Toasts::ActivationTypes::Protocol |
Notifications::ScenarioPages::Toasts::ActivationTypes::System |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::AutoContent |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::CustomContent |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::Dismissing |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::AutoContent |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::CustomContent |
Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::Snoozing |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppData |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppPackage |
Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromInternet |
Notifications::ScenarioPages::Toasts::Audio |
Notifications::ScenarioPages::Toasts::Audio::Default |
Notifications::ScenarioPages::Toasts::Audio::EmailSound |
Notifications::ScenarioPages::Toasts::Audio::Looping |
Notifications::ScenarioPages::Toasts::Audio::Silent |
Notifications::ScenarioPages::Toasts::ExpiringToast |
Notifications::ScenarioPages::Toasts::GhostToast |
Notifications::ScenarioPages::Toasts::HistoryChangedTrigger |
Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::BadgeControl |
Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::RespondingToToasts |
Notifications::ScenarioPages::Toasts::Scenarios |
Notifications::ScenarioPages::Toasts::Scenarios::Alarm |
Notifications::ScenarioPages::Toasts::Scenarios::Default |
Notifications::ScenarioPages::Toasts::Scenarios::IncomingCall |
Notifications::ScenarioPages::Toasts::Scenarios::Reminder |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::ClearAll |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory::Visualizer |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTag |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTagAndGroup |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup |
Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup::ByGroup |
Notifications::ScenarioPages::Toasts::UpdateToast |
OneHandedUse_TailoredMultipleViews |
OneHandedUse_TailoredMultipleViews::UserControls |
OneHandedUse_TailoredMultipleViews::ViewModel |
OneNotifications_UWP |
OneNotifications_UWP::ScenarioPages |
OneNotifications_UWP::ScenarioPages::LiveTiles |
OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState |
OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState::CheckAllPropertiesCorrect |
OpenCVBridge |
org |
org::alljoyn |
org::alljoyn::Onboarding |
Osrusbfx2Task |
Pcsc |
Pcsc::Common |
PedometerCS |
PivotCS |
PlaybackManager |
PrintSample |
ProximityCS |
ProxyStubsForWinRTComponents |
RandomNumberService |
RelativeInclinometerCS |
RpcServer |
Sample |
ScreenCasting |
ScreenCasting::Controls |
ScreenCasting::Data |
ScreenCasting::Data::Azure |
ScreenCasting::Data::Common |
ScreenCasting::Util |
ScreenRotation |
SDKSample |
SDKSample::ProxyStubsForWinRTComponents |
SDKSample::SecondaryViewsHelpers |
SDKSample::WASAPIAudio |
SDKTemplate |
SDKTemplate::Common |
SDKTemplate::Compression |
SDKTemplate::Controls |
SDKTemplate::DatagramSocketSample |
SDKTemplate::DeviceHelpers |
SDKTemplate::DeviceProperties |
SDKTemplate::Helpers |
SDKTemplate::Models |
SDKTemplate::SampleConstants |
SDKTemplate::Shared |
SDKTemplate::SmartCardSample |
SDKTemplate::StreamSocketSample |
SDKTemplate::SuperMutt | This is the report descriptor for the support SuperMutt device
SDKTemplate::SuperMutt::Device |
SDKTemplate::SuperMutt::DeviceInputReportControlInformation | Only available for output reports
SDKTemplate::SuperMutt::LedPattern | Only available for Feature Reports
SDKTemplate::SuperMutt::ReadWriteBufferControlInformation | Only available for Input/Output Reports
SDKTemplate::Syndication |
SDKTemplate::Utils |
SDKTemplate::ViewModels |
SDKTemplate::WiFiDirectServices |
SDKTemplate::WiFiScan |
SDKTemplate::WRLInProcessWinRTComponent |
SDKTemplate::WRLOutOfProcessWinRTComponent |
SDKTemplate::XmlLite |
SecondaryViewsHelpers |
SerialArduino |
Simple3DGameDX |
Simple3DGameXaml |
SimpleCommunication |
SimpleImaging |
SimpleOrientationCS |
SmsBackgroundTask |
SmsSendAndReceive |
SocketActivityBackgroundTask |
SocketActivityStreamSocket |
SplashScreenSample |
StateTriggersSample |
StateTriggersSample::CustomTriggers |
StateTriggersSample::ViewModel |
std |
StreamSocketListenerServer |
StreamSocketSample |
Syndication |
Tasks |
TextSuggestion |
Transform3DAnimations |
Transform3DAnimations::ViewModels |
UssdApi |
VoiceCommandService |
WebAuthentication |
WiFiScan |
WindowsHolographicCodeSamples |
WindowsPreview |
WindowsPreview::Media |
WindowsPreview::Media::Capture |
WindowsPreview::Media::Capture::Frames |
winrt |
winrt::BackgroundDeviceWatcherTask |
winrt::BackgroundDeviceWatcherTask::factory_implementation |
winrt::BackgroundDeviceWatcherTask::implementation |
winrt::BackgroundTask |
winrt::BackgroundTask::factory_implementation |
winrt::BackgroundTask::implementation |
winrt::HttpFilters |
winrt::HttpFilters::factory_implementation |
winrt::HttpFilters::implementation |
winrt::MasterDetailApp |
winrt::MasterDetailApp::Data |
winrt::MasterDetailApp::Data::factory_implementation |
winrt::MasterDetailApp::Data::implementation |
winrt::MasterDetailApp::factory_implementation |
winrt::MasterDetailApp::implementation |
winrt::MasterDetailApp::ViewModels |
winrt::MasterDetailApp::ViewModels::factory_implementation |
winrt::MasterDetailApp::ViewModels::implementation |
winrt::RandomNumberService |
winrt::RandomNumberService::factory_implementation |
winrt::RandomNumberService::implementation |
winrt::Sample |
winrt::Sample::factory_implementation |
winrt::Sample::implementation |
winrt::SDKTemplate |
winrt::SDKTemplate::Constants |
winrt::SDKTemplate::DisplayHelpers |
winrt::SDKTemplate::factory_implementation |
winrt::SDKTemplate::Helpers |
winrt::SDKTemplate::implementation |
winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp} |
winrt::SDKTemplate::SampleHelpers |
WRLInProcessWinRTComponent |
WRLOutOfProcessWinRTComponent |
xBindSampleCS |
xBindSampleModel |
xDeferLoadStrategy |
Xml |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: _360VideoPlayback Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Functions

_360VideoPlayback Namespace Reference

Namespaces

namespace | Common
namespace | Content

Classes

class | _360VideoPlaybackMain
Updates, renders, and presents holographic content using Direct3D. More...
class | App
Provides application-specific behavior to supplement the default Application class. More...
class | AppView
The IFrameworkView connects the app with Windows and handles application lifecycle events. More...
class | AppViewSource
struct | FocusPointConstantBuffer
class | Helpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MediaTransportControls
struct | ModelConstantBuffer
class | PlaybackPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | Program
Windows Holographic application using SharpDX. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | SpatialInputHandler
struct | VertexPositionTexture
class | VideoGallery
An empty page that can be used on its own or navigated to within a Frame. More...
class | VideoItem
class | VideoRenderer

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(FocusPointConstantBuffer)%(sizeof(float)*4))==0,"FocusPointConstantBuffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

_360VideoPlayback::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
_360VideoPlayback::static_assert | ( | (sizeof(FocusPointConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "FocusPointConstantBuffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: _360VideoPlayback::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • _360VideoPlayback
  • Common
Classes

_360VideoPlayback::Common Namespace Reference

Classes

class | CameraResources
class | DeviceResources
Controls all the DirectX device resources. More...
class | DirectXHelper
class | Disposer
class | InteropStatics
class | SpatialInputHandler
class | StepTimer
Helper class for animation and simulation timing. More...
struct | ViewProjectionConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: _360VideoPlayback::Content Namespace Reference

  • Namespace List
  • Namespace Members
  • _360VideoPlayback
  • Content
Classes

_360VideoPlayback::Content Namespace Reference

Classes

struct | ModelConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
struct | VertexPositionColor
Used to send per-vertex data to the vertex shader. More...
struct | VertexPositionTexture
class | VideoRenderer
This sample renderer instantiates a basic rendering pipeline. More...
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ABI Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

ABI Namespace Reference

Namespaces

namespace Microsoft
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ABI::Microsoft Namespace Reference

  • Namespace List
  • Namespace Members
  • ABI
  • Microsoft
Namespaces

ABI::Microsoft Namespace Reference

Namespaces

namespace SDKSamples
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ABI::Microsoft::SDKSamples Namespace Reference

  • Namespace List
  • Namespace Members
  • ABI
  • Microsoft
  • SDKSamples
Namespaces

ABI::Microsoft::SDKSamples Namespace Reference

Namespaces

namespace Kitchen
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ABI::Microsoft::SDKSamples::Kitchen Namespace Reference

  • Namespace List
  • Namespace Members
  • ABI
  • Microsoft
  • SDKSamples
  • Kitchen
Classes

ABI::Microsoft::SDKSamples::Kitchen Namespace Reference

Classes

class WrlFinal
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accounts Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Accounts Namespace Reference

Classes

class | DefaultAccountScenario
This scenario covers getting the default account. More...
class | IdentityChecker
class | MultipleAccountsScenario
class | SingleAccountScenario
class | SingleAzureADScenario
class | SingleMicrosoftAccountScenario
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

AdventureWorks Namespace Reference

Namespaces

namespace | Common
namespace | Model
namespace | View
namespace | ViewModel
namespace | VoiceCommands

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | ViewModelBase
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • AdventureWorks
  • Common
Classes | Functions

AdventureWorks::Common Namespace Reference

Classes

class | DateTimeOffsetConverter
Convert a DateTime to a DateTimeOffset for use by a DatePicker, and back to allow for two-day data-binding. More...
interface | INavigationService
Navigation service interface, allows a test implementation to be substituted in its place. More...
class | LoadStateEventArgs
Class used to hold the event data required when a page attempts to load state. More...
class | NavigationHelper
NavigationHelper aids in navigation between pages. More...
class | NavigationService
Navigation system that decouples the View Model from knowledge of the View for navigation purposes. More...
class | RelayCommand
A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...
class | RootFrameNavigationHelper
RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...
class | SaveStateEventArgs
Class used to hold the event data required when a page attempts to save state. More...
class | SuspensionManager
SuspensionManager captures global session state to simplify process lifetime management for an application. More...
class | SuspensionManagerException
class | VisibilityConverter
Convert a Boolean status to Visibility.Visible (true) or Visibility.Collapsed (false). More...

Functions

delegate void | LoadStateEventHandler (object sender, LoadStateEventArgs e)
delegate void | SaveStateEventHandler (object sender, SaveStateEventArgs e)

Function Documentation

delegate void AdventureWorks::Common::LoadStateEventHandler | ( | object | sender,
 |  | LoadStateEventArgs | e
 | ) |  |

Represents the method that will handle the NavigationHelper.LoadStateevent.

delegate void AdventureWorks::Common::SaveStateEventHandler | ( | object | sender,
 |  | SaveStateEventArgs | e
 | ) |  |

Represents the method that will handle the NavigationHelper.SaveStateevent.

Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks::Model Namespace Reference

  • Namespace List
  • Namespace Members
  • AdventureWorks
  • Model
Classes

AdventureWorks::Model Namespace Reference

Classes

class | Trip
Trip model. More...
class | TripStore
Persistance layer for Trips created with Adventure Works. More...
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks::View Namespace Reference

  • Namespace List
  • Namespace Members
  • AdventureWorks
  • View
Classes

AdventureWorks::View Namespace Reference

Classes

class | TripDetails
Code Behind for a list of trips, including a Save and Delete button. More...
class | TripListView
Code Behind for a list of trips, including an Add button. More...
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks::ViewModel Namespace Reference

  • Namespace List
  • Namespace Members
  • AdventureWorks
  • ViewModel
Classes

AdventureWorks::ViewModel Namespace Reference

Classes

class | TripListViewModel
View Model controlling the behavior of a List view of trips. More...
class | TripViewModel
View Model associated with TripDetails.xaml. More...
struct | TripVoiceCommand
Simple struct to pass voice-command arguments to the appropriate view, in order to execute the action requested by the user. More...
class | ViewModelBase
Base class for all view models. More...
class | ViewModelLocator
ViewModelLocator ensures that viewmodels can be instantiated with a common reference to the TripStore. More...
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks::VoiceCommands Namespace Reference

  • Namespace List
  • Namespace Members
  • AdventureWorks
  • VoiceCommands
Classes

AdventureWorks::VoiceCommands Namespace Reference

Classes

class AdventureWorksVoiceCommandService
The VoiceCommandService implements the entrypoint for all headless voice commands invoked via Cortana. More...
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdventureWorks_Shared Namespace Reference

  • Namespace List
  • Namespace Members
Classes

AdventureWorks_Shared Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoynConsumerExperiences Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

AllJoynConsumerExperiences Namespace Reference

Classes

class | AuthTypeToStringConverter
class | RelayCommand
Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates. More...
class | Scenario1
class | Scenario1ViewModel
class | Scenario2
class | Scenario2ViewModel

Enumerations

enum | ConfigureWiFiResultStatus { NotConcurrent = 1, Concurrent = 2 }
enum ConnectionResultCode {
Validated = 0, Unreachable, UnsupportedProtocol, Unauthorized,
ErrorMessage
}
enum OnboardingAuthenticationType {
Wpa2Auto = -3, WpaAuto = -2, Any = -1, Open = 0,
Wep = 1, WpaTkip = 2, WpaCcmp = 3, Wpa2Tkip = 4,
Wpa2Ccmp = 5, Wps = 6
}

Enumeration Type Documentation

enum ConfigureWiFiResultStatus
Enumerator:
NotConcurrent
Concurrent

Definition at line 34 of file OnboardingEnumTypes.cs.

    {
        NotConcurrent = 1,
        Concurrent = 2,
    }

enum ConnectionResultCode
Enumerator:
Validated
Unreachable
UnsupportedProtocol
Unauthorized
ErrorMessage

Definition at line 40 of file OnboardingEnumTypes.cs.

    {
        Validated = 0,
        Unreachable,
        UnsupportedProtocol,
        Unauthorized,
        ErrorMessage,
    }

enum OnboardingAuthenticationType
Enumerator:
Wpa2Auto
WpaAuto
Any
Open
Wep
WpaTkip
WpaCcmp
Wpa2Tkip
Wpa2Ccmp
Wps

Definition at line 20 of file OnboardingEnumTypes.cs.

    {
        Wpa2Auto = -3,
        WpaAuto = -2,
        Any = -1,
        Open = 0,
        Wep = 1,
        WpaTkip = 2,
        WpaCcmp = 3,
        Wpa2Tkip = 4,
        Wpa2Ccmp = 5,
        Wps = 6,
    }

Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoynProducerExperiences Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

AllJoynProducerExperiences Namespace Reference

Classes

class | AppData
class | OnboardingService
class | RelayCommand
Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates. More...
class | Scenario1
class | Scenario1ViewModel
class | Scenario2
class | Scenario2ViewModel
class | SecureInterfaceService
The implementation of ISecureInterfaceService that will handle the concatenation method calls. More...

Enumerations

enum ConfigurationState {
NotConfigured = 0, NotValidated, Validating, Validated,
Error, Retry
}
enum | ConfigureWiFiResultStatus { NonConcurrent = 1, Concurrent = 2 }
enum ConnectionResultCode {
Validated = 0, Unreachable, UnsupportedProtocol, Unauthorized,
ErrorMessage
}
enum OnboardingAuthenticationType {
Wpa2Auto = -3, WpaAuto = -2, Any = -1, Open = 0,
Wep = 1, WpaTkip = 2, WpaCcmp = 3, Wpa2Tkip = 4,
Wpa2Ccmp = 5, Wps = 6
}

Enumeration Type Documentation

enum ConfigurationState
Enumerator:
NotConfigured
NotValidated
Validating
Validated
Error
Retry

Definition at line 46 of file OnboardingEnumTypes.cs.

    {
        NotConfigured = 0,
        NotValidated,
        Validating,
        Validated,
        Error,
        Retry,
    }

enum ConfigureWiFiResultStatus
Enumerator:
NonConcurrent
Concurrent

Definition at line 31 of file OnboardingEnumTypes.cs.

    {
        NonConcurrent = 1,
        Concurrent = 2,
    }

enum ConnectionResultCode
Enumerator:
Validated
Unreachable
UnsupportedProtocol
Unauthorized
ErrorMessage

Definition at line 37 of file OnboardingEnumTypes.cs.

    {
        Validated = 0,
        Unreachable,
        UnsupportedProtocol,
        Unauthorized,
        ErrorMessage,
    }

enum OnboardingAuthenticationType
Enumerator:
Wpa2Auto
WpaAuto
Any
Open
Wep
WpaTkip
WpaCcmp
Wpa2Tkip
Wpa2Ccmp
Wps

Definition at line 17 of file OnboardingEnumTypes.cs.

    {
        Wpa2Auto = -3,
        WpaAuto = -2,
        Any = -1,
        Open = 0,
        Wep = 1,
        WpaTkip = 2,
        WpaCcmp = 3,
        Wpa2Tkip = 4,
        Wpa2Ccmp = 5,
        Wps = 6,
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{BluetoothLEAttributeDisplay.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{BluetoothLEAttributeDisplay.cpp} Namespace Reference

Functions

bool TryParseSigDefinedUuid (guid const &uuid, uint16_t &shortId)

Function Documentation

bool anonymous_namespace{BluetoothLEAttributeDisplay.cpp}::TryParseSigDefinedUuid | ( | guid const & | uuid,
 |  | uint16_t & | shortId
 | ) |  |

Determines whether the UUID was assigned by the Bluetooth SIG.

If so, extracts the assigned number.

Definition at line 14 of file BluetoothLEAttributeDisplay.cpp.

    {
        // UUIDs defined by the Bluetooth SIG are of the form
        // 0000xxxx-0000-1000-8000-00805F9B34FB.
        constexpr guid BluetoothGuid = { 0x00000000, 0x0000, 0x1000, { 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB } };

        shortId = static_cast<uint16_t>(uuid.Data1);
        guid possibleBluetoothGuid = uuid;
        possibleBluetoothGuid.Data1 &= 0xFFFF0000;
        return possibleBluetoothGuid == BluetoothGuid;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{CameraCoordinateMapper.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{CameraCoordinateMapper.cpp} Namespace Reference

Functions

template<typename Func >
void | AccessSoftwareBitmap (SoftwareBitmap^bitmap, Func &&func)
void | CopySoftwareBitmapToDirect3DTexture (SoftwareBitmap^softwareBitmap, ID3D11DeviceContext *context, ID3D11Texture2D *texture)
template<typename Func >
ComPtr< ID3D11Texture2D > | GenerateIntrinsicsMapping (ID3D11Device *device, CameraIntrinsics^cameraIntrinsics, Func &&func)
bool | IsValidColorFrame (MediaFrameReference^frame)
bool | IsValidDepthFrame (MediaFrameReference^frame)

Function Documentation

void anonymous_namespace{CameraCoordinateMapper.cpp}::AccessSoftwareBitmap | ( | SoftwareBitmap^ | bitmap,
 |  | Func && | func
 | ) |  |

Definition at line 38 of file CameraCoordinateMapper.cpp.

    {
        if (BitmapBuffer^ bitmapBuffer = bitmap->LockBuffer(BitmapBufferAccessMode::Read))
        {
            if (IMemoryBufferReference^ bitmapRef = bitmapBuffer->CreateReference())
            {
                ComPtr<IMemoryBufferByteAccess> memoryBufferByteAccess;
                const HRESULT hr = reinterpret_cast<IInspectable*>(bitmapRef)->QueryInterface(IID_PPV_ARGS(&memoryBufferByteAccess));

                if (SUCCEEDED(hr) && memoryBufferByteAccess)
                {
                    byte* pSourceBuffer;
                    UINT32 capacity;
                    if (SUCCEEDED(memoryBufferByteAccess->GetBuffer(&pSourceBuffer, &capacity)) && pSourceBuffer)
                    {
                        func(pSourceBuffer, capacity);
                    }
                }
            }
        }
    }

void anonymous_namespace{CameraCoordinateMapper.cpp}::CopySoftwareBitmapToDirect3DTexture | ( | SoftwareBitmap^ | softwareBitmap,
 |  | ID3D11DeviceContext * | context,
 |  | ID3D11Texture2D * | texture
 | ) |  |

Definition at line 60 of file CameraCoordinateMapper.cpp.

    {
        AccessSoftwareBitmap(softwareBitmap, [&](byte* buffer, UINT32 capacity)
        {
            D3D11_MAPPED_SUBRESOURCE subresource;
            if (SUCCEEDED(context->Map(texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &subresource)))
            {
                std::memcpy(subresource.pData, buffer, capacity);
                context->Unmap(texture, 0);
            }
        });
    };

ComPtr<ID3D11Texture2D> anonymous_namespace{CameraCoordinateMapper.cpp}::GenerateIntrinsicsMapping | ( | ID3D11Device * | device,
 |  | CameraIntrinsics^ | cameraIntrinsics,
 |  | Func && | func
 | ) |  |

Definition at line 80 of file CameraCoordinateMapper.cpp.

    {
        using OutputType = decltype(func(cameraIntrinsics, Point{}));
        static_assert(sizeof(OutputType) == sizeof(float2), "Func should return the equivalent of 2 floats");

        const uint32_t imageWidth = cameraIntrinsics->ImageWidth;
        const uint32_t imageHeight = cameraIntrinsics->ImageHeight;

        const size_t numElements = imageWidth * imageHeight;

        auto spMap = std::make_unique<OutputType[]>(numElements);

        for (uint32_t y = 0; y < imageHeight; ++y)
        {
            for (uint32_t x = 0; x < imageWidth; ++x)
            {
                spMap[y * imageWidth + x] = func(cameraIntrinsics, Point(float(x), float(y)));
            }
        }

        DX::TextureData data{ spMap.get(), sizeof(OutputType) };
        return DX::CreateTexture(
            device,
            imageWidth,
            imageHeight,
            DXGI_FORMAT_R32G32_FLOAT,
            data,
            D3D11_BIND_SHADER_RESOURCE,
            D3D11_USAGE_IMMUTABLE);
    }

bool anonymous_namespace{CameraCoordinateMapper.cpp}::IsValidColorFrame ( MediaFrameReference^ frame )

Definition at line 111 of file CameraCoordinateMapper.cpp.

    {
        // These properties are required for our coordinate mapping algorithm
        return frame &&
               frame->CoordinateSystem &&
               frame->VideoMediaFrame &&
               frame->VideoMediaFrame->CameraIntrinsics &&
               frame->VideoMediaFrame->SoftwareBitmap;
    }

bool anonymous_namespace{CameraCoordinateMapper.cpp}::IsValidDepthFrame ( MediaFrameReference^ frame )

Definition at line 121 of file CameraCoordinateMapper.cpp.

    {
        // A valid depth frame has the same properties of a color frame, as well as a valid DepthMediaFrame property
        return IsValidColorFrame(frame) && frame->VideoMediaFrame->DepthMediaFrame;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Contact.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Contact.cpp} Namespace Reference

Functions

template<typename T >
T | random_below (T limit)
auto & | random_generator ()
template<typename T >
T | random_in_range (T minValue, T maxValue)
template<typename T >
T const & | random_select (std::vector< T > const &source)

Function Documentation

T anonymous_namespace{Contact.cpp}::random_below ( T limit )

Definition at line 33 of file Contact.cpp.

  {
    return random_in_range(T{}, limit - 1);
  }

auto& anonymous_namespace{Contact.cpp}::random_generator ( )

Definition at line 20 of file Contact.cpp.

  {
    static std::mt19937 generator{ std::random_device{}() };
    return generator;
  }

T anonymous_namespace{Contact.cpp}::random_in_range | ( | T | minValue,
 |  | T | maxValue
 | ) |  |

Definition at line 27 of file Contact.cpp.

  {
    return std::uniform_int_distribution<T>(minValue, maxValue)(random_generator());
  }

T const& anonymous_namespace{Contact.cpp}::random_select ( std::vector< T > const & source )

Definition at line 39 of file Contact.cpp.

  {
    return source[random_below(source.size())];
  }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{DDSTextureLoader.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Typedefs | Functions

anonymous_namespace{DDSTextureLoader.cpp} Namespace Reference

Classes

struct | handle_closer

Typedefs

typedef public std::unique_ptr
< void, handle_closer > 		ScopedHandle

Functions

HANDLE | safe_handle (HANDLE h)
template<UINT TNameLength>
void | SetDebugObjectName (_In_ ID3D11DeviceChild *resource, _In_ const char(&name)[TNameLength])

Typedef Documentation

typedef public std::unique_ptr<void, handle_closer> ScopedHandle

Definition at line 128 of file DDSTextureLoader.cpp.

Function Documentation

HANDLE anonymous_namespace{DDSTextureLoader.cpp}::safe_handle ( HANDLE h ) [inline]

Definition at line 130 of file DDSTextureLoader.cpp.

{ return (h == INVALID_HANDLE_VALUE) ? 0 : h; }

void anonymous_namespace{DDSTextureLoader.cpp}::SetDebugObjectName | ( | _In_ ID3D11DeviceChild * | resource,
 |  | _In_ const char(&) | name[TNameLength] |
 | ) |  |  | [inline]

Definition at line 133 of file DDSTextureLoader.cpp.

{
#if defined(_DEBUG) || defined(PROFILE)
    resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
#else
    UNREFERENCED_PARAMETER(resource);
    UNREFERENCED_PARAMETER(name);
#endif
}

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{GpuCoordinateMapper.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{GpuCoordinateMapper.cpp} Namespace Reference

Functions

CameraIntrinsics_Shader | GetCameraIntrinsicsConstantsForShader (const GpuCoordinateMapper::CameraIntrinsics &intrinsics)
RasterizeDepthMeshConstants_Shader | GetRasterizeDepthMeshConstantsForShader (const GpuCoordinateMapper::RasterizedFrameBlob &frameBlob)
VisualizeDepthMeshConstants_Shader | GetVisualizeDepthMeshConstantsForShader (const GpuCoordinateMapper::VisualizeFrameBlob &frameBlob)

Function Documentation

CameraIntrinsics_Shader anonymous_namespace{GpuCoordinateMapper.cpp}::GetCameraIntrinsicsConstantsForShader ( const GpuCoordinateMapper::CameraIntrinsics & intrinsics )

Definition at line 29 of file GpuCoordinateMapper.cpp.

    {
        CameraIntrinsics_Shader constants;

        constants.imageWidth = intrinsics.imageWidth;
        constants.imageHeight = intrinsics.imageHeight;

        return constants;
    }

RasterizeDepthMeshConstants_Shader anonymous_namespace{GpuCoordinateMapper.cpp}::GetRasterizeDepthMeshConstantsForShader ( const GpuCoordinateMapper::RasterizedFrameBlob & frameBlob )

Definition at line 39 of file GpuCoordinateMapper.cpp.

    {
        RasterizeDepthMeshConstants_Shader constants;

        constants.depthIntrinsics = GetCameraIntrinsicsConstantsForShader(frameBlob.depthIntrinsics);
        constants.targetIntrinsics = GetCameraIntrinsicsConstantsForShader(frameBlob.targetIntrinsics);
        constants.sourceIntrinsics = GetCameraIntrinsicsConstantsForShader(frameBlob.sourceIntrinsics);
        constants.depthToSource = frameBlob.depthToSource;
        constants.depthToTarget = frameBlob.depthToTarget;
        constants.sourceProjectionMatrix = frameBlob.sourceProjectionMatrix;
        constants.targetProjectionMatrix = frameBlob.targetProjectionMatrix;

        // DepthMaps are currently D16 format: [0,65535], depthScaleInMeters is how large each unit is in meters.
        constants.depthMapUnitsToMeters = frameBlob.depthScaleInMeters * std::numeric_limits<UINT16>::max();
        constants.depthRangeMinimumInMeters = frameBlob.depthRangeMinimumInMeters;
        constants.depthRangeMaximumInMeters = frameBlob.depthRangeMaximumInMeters;
        constants.depthMapImageWidthMinusOne = frameBlob.depthIntrinsics.imageWidth - 1u;

        return constants;
    }

VisualizeDepthMeshConstants_Shader anonymous_namespace{GpuCoordinateMapper.cpp}::GetVisualizeDepthMeshConstantsForShader ( const GpuCoordinateMapper::VisualizeFrameBlob & frameBlob )

Definition at line 60 of file GpuCoordinateMapper.cpp.

    {
        VisualizeDepthMeshConstants_Shader constants;

        constants.worldToProj = frameBlob.worldToView * frameBlob.viewToProj;

        return constants;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{NetworkChannel.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Classes

anonymous_namespace{NetworkChannel.cpp} Namespace Reference

Classes

class CSendOperationStatus
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{SampleConfiguration.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{SampleConfiguration.cpp} Namespace Reference

Functions

IAsyncOperation< hstring > | SendHttpGetRequestAsync ()
ViewLifetimeControl | TryFindViewLifetimeControlForViewId (int32_t viewId)

Function Documentation

IAsyncOperation<hstring> anonymous_namespace{SampleConfiguration.cpp}::SendHttpGetRequestAsync ( )

Definition at line 79 of file SampleConfiguration.cpp.

    {
        HttpClient httpClient;
        HttpGetStringResult result = co_await httpClient.TryGetStringAsync(Uri(L"http://www.msftconnecttest.com/connecttest.txt"));
        if (result.Succeeded())
        {
            co_return L"Success: \"" + result.Value() + L"\"";
        }
        else if (HttpResponseMessage responseMessage = result.ResponseMessage(); responseMessage != nullptr)
        {
            co_return L"HTTP error: " + to_hstring(static_cast<int32_t>(responseMessage.StatusCode()));
        }
        else
        {
            co_return L"Error: " + hresult_error(result.ExtendedError(), take_ownership_from_abi).message();
        }
    }

ViewLifetimeControl anonymous_namespace{SampleConfiguration.cpp}::TryFindViewLifetimeControlForViewId ( int32_t viewId )

Definition at line 46 of file SampleConfiguration.cpp.

    {
        for (IInspectable const& item : SampleState::SecondaryViews)
        {
            auto viewLifetimeControl = item.as<ViewLifetimeControl>();
            if (viewLifetimeControl.Id() == viewId)
            {
                return viewLifetimeControl;
            }
        }
        return nullptr;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario05_PostStream.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario05_PostStream.cpp} Namespace Reference

Functions

IAsyncOperation
< IRandomAccessStream > 		GenerateSampleStreamAsync (int contentLength)

Function Documentation

IAsyncOperation<IRandomAccessStream> anonymous_namespace{Scenario05_PostStream.cpp}::GenerateSampleStreamAsync ( int contentLength )

Definition at line 26 of file Scenario05_PostStream.cpp.

    {
        auto cancellation = co_await get_cancellation_token();
        cancellation.enable_propagation();

        Buffer buffer(contentLength);
        memset(buffer.data(), '@', contentLength);

        InMemoryRandomAccessStream stream;
        co_await stream.WriteAsync(buffer);

        // Rewind the stream.
        stream.Seek(0);

        co_return stream;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario1_Data.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario1_Data.cpp} Namespace Reference

Functions

void ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)

Function Documentation

void anonymous_namespace{Scenario1_Data.cpp}::ReportCalendarData | ( | std::wostream & | results,
 |  | Calendar const & | calendar,
 |  | PCWSTR | calendarLabel
 | ) |  |

Definition at line 23 of file Scenario1_Data.cpp.

    {
        results << calendarLabel << L": " << std::wstring_view(calendar.GetCalendarSystem()) << L"\n" <<
        L"Name of Month: " << std::wstring_view(calendar.MonthAsSoloString()) << L"\n" <<
        L"Day of Month: " << std::wstring_view(calendar.DayAsPaddedString(2)) << L"\n" <<
        L"Day of Week: " << std::wstring_view(calendar.DayOfWeekAsSoloString()) << L"\n" <<
        L"Year: " << std::wstring_view(calendar.YearAsString()) << L"\n\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario1_FindId.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario1_FindId.cpp} Namespace Reference

Functions

std::vector< std::wstring > FindIdsInString (std::wstring_view const &inputString)

Function Documentation

std::vector<std::wstring> anonymous_namespace{Scenario1_FindId.cpp}::FindIdsInString ( std::wstring_view const & inputString )

Definition at line 27 of file Scenario1_FindId.cpp.

    {
        // Vector where we maintain the ids found in the input string
        std::vector<std::wstring> idList;

        // Maintains the beginning index of the id found in the input string
        size_t indexIdStart = std::wstring_view::npos;

        // Iterate through each of the characters in the string
        size_t i = 0;
        while (i < inputString.size())
        {
            size_t nextIndex;
            uint32_t codepoint = inputString[i];

            if (UnicodeCharacters::IsHighSurrogate(codepoint))
            {
                // If the character is a high surrogate, then the next characters must be a low surrogate.
                if ((i < inputString.size()) && (UnicodeCharacters::IsLowSurrogate(inputString[i + 1])))
                {
                    // Update the code point with the surrogate pair.
                    codepoint = UnicodeCharacters::GetCodepointFromSurrogatePair(codepoint, inputString[i + 1]);
                    nextIndex = i + 2;
                }
                else
                {
                    // Warning: High surrogate not followed by low surrogate.
                    codepoint = 0;
                    nextIndex = i + 1;
                }
            }
            else
            {
                // Not a surrogate pair.
                nextIndex = i + 1;
            }

            if (indexIdStart == std::wstring_view::npos)
            {
                // Not in an id. Have we found an id start?
                if (UnicodeCharacters::IsIdStart(codepoint))
                {
                    indexIdStart = i;
                }
            }
            else if (!UnicodeCharacters::IsIdContinue(codepoint))
            {
                // We have not found an id continue, so the id is complete.  We need to
                // create the identifier string
                idList.emplace_back(inputString.substr(indexIdStart, i - indexIdStart));

                // Reset back the index start and re-examine the current code point
                // in next iteration
                indexIdStart = std::wstring::npos;
                nextIndex = i;
            }
            i = nextIndex;
        }

        // Do we have a pending id at the end of the string?
        if (indexIdStart != std::wstring_view::npos)
        {
            //  We need to create the identifier string
            idList.emplace_back(inputString.substr(indexIdStart, i - indexIdStart));
        }

        // Return the list of identifiers found in the string
        return idList;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario1_Print.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario1_Print.cpp} Namespace Reference

Functions

IAsyncOperation
< Printing3D3MFPackage > 		CreatePackageAsync ()
IAsyncOperation
< Printing3D3MFPackage > 		CreatePackageFromXmlAsync (hstring rawXml)
IAsyncAction | FixTextureContentTypeAsync (Printing3D3MFPackage package)
void | SetBufferBytes (IBuffer const &buffer, void const *data, uint32_t size)
void | SetMaterialIndices (Printing3DMesh const &mesh)
void | SetTriangleIndices (Printing3DMesh const &mesh)
void | SetVertices (Printing3DMesh const &mesh)
IAsyncOperation< hstring > | StreamToStringAsync (IRandomAccessStream stream)
IAsyncOperation
< IRandomAccessStream > 		StringToStreamAsync (hstring const &string)

Function Documentation

IAsyncOperation<Printing3D3MFPackage> anonymous_namespace{Scenario1_Print.cpp}::CreatePackageAsync ( )

Definition at line 186 of file Scenario1_Print.cpp.

    {
        Printing3D3MFPackage package;

        Printing3DModel model;
        model.Unit(Printing3DModelUnit::Millimeter);

        // Material indices start at 1. (0 is reserved.)

#pragma region Color materials
        // Create color materials.
        Printing3DColorMaterial colorMaterial1;
        colorMaterial1.Color({ 255, 20, 20, 90 });

        Printing3DColorMaterial colorMaterial2;
        colorMaterial2.Color({ 255, 250, 120, 45 });

        // Create a color group with id 1 and add the colors to it.
        Printing3DColorMaterialGroup colorGroup(1);
        colorGroup.Colors().ReplaceAll({ colorMaterial1, colorMaterial2 });

        // add the color group to the model.
        model.Material().ColorGroups().Append(colorGroup);
#pragma endregion

#pragma region Base materials
        // Create base materials.
        Printing3DBaseMaterial material1;
        material1.Name(Printing3DBaseMaterial::Pla());
        material1.Color(colorMaterial1);

        Printing3DBaseMaterial material2;
        material2.Name(Printing3DBaseMaterial::Abs());
        material2.Color(colorMaterial2);

        // Create a new base material group with id 2 and add the base materials to it.
        Printing3DBaseMaterialGroup materialGroup(2);
        materialGroup.Bases().ReplaceAll({ material1, material2 });

        // Add the material group to the base groups on the model.
        model.Material().BaseGroups().Append(materialGroup);

#pragma endregion

#pragma region Composite material groups
        // Create a composite material group with id 3.
        Printing3DCompositeMaterialGroup compositeMaterialGroup(3);

        // Add it to the metadata.
        // The key is the string "composite" followed by the composite material group id.
        // The value specifies that the default base material group to use is id 2.
        model.Metadata().Insert(L"composite3", L"2");

        // The indices are relative to the material indices that will be set by SetMaterialIndicesAsync.
        compositeMaterialGroup.MaterialIndices().ReplaceAll({ 0, 1 });

        // Create new composite materials.
        // The Values correspond to the materials added in the compositeMaterialGroup,
        // and they must sum to 1.0.

        // Composite material 1 consists of 20% material1 and 80% material2.
        Printing3DCompositeMaterial compositeMaterial1;
        compositeMaterial1.Values().ReplaceAll({ 0.2, 0.8 });

        // Composite material 2 consists of 50% material1 and 50% material2.
        Printing3DCompositeMaterial compositeMaterial2;
        compositeMaterial2.Values().ReplaceAll({ 0.5, 0.5 });

        // Composite material 3 consists of 80% material1 and 20% material2.
        Printing3DCompositeMaterial compositeMaterial3;
        compositeMaterial3.Values().ReplaceAll({ 0.8, 0.2 });

        // Composite material 4 consists of 40% material1 and 60% material2.
        Printing3DCompositeMaterial compositeMaterial4;
        compositeMaterial4.Values().ReplaceAll({ 0.4, 0.6 });

        // Add the composite materials to the compositeMaterialGroup.
        compositeMaterialGroup.Composites().ReplaceAll({ compositeMaterial1, compositeMaterial2, compositeMaterial3, compositeMaterial4 });

        // Add the composite material group to the model.
        model.Material().CompositeGroups().Append(compositeMaterialGroup);
#pragma endregion

#pragma region Texture resource
        Printing3DTextureResource textureResource;

        // Set the texture path in the 3MF file.
        textureResource.Name(L"/3D/Texture/msLogo.png");

        // Load the texture from our package.
        StorageFile file = co_await StorageFile::GetFileFromApplicationUriAsync(Uri(L"ms-appx:///Assets/msLogo.png"));
        textureResource.TextureData(co_await file.OpenReadAsync());

        package.Textures().Append(textureResource);
#pragma endregion

#pragma region 2D texture materials
        // Create a texture material group with id 4.
        Printing3DTexture2CoordMaterialGroup texture2CoordGroup(4);

        // Add it to the metadata.
        // The key is the string "tex" followed by the texture material group id.
        // The value is the name of the texture resource (see textureResource.Name above).
        model.Metadata().Insert(L"tex4", L"/3D/Texture/msLogo.png");

        // Create texture materials and add them to the group.
        Printing3DTexture2CoordMaterial coord1;
        coord1.U(0.0);
        coord1.V(1.0);

        Printing3DTexture2CoordMaterial coord2;
        coord2.U(1.0);
        coord2.V(1.0);

        Printing3DTexture2CoordMaterial coord3;
        coord3.U(0.0);
        coord3.V(0.0);

        Printing3DTexture2CoordMaterial coord4;
        coord4.U(1.0);
        coord4.V(0.0);

        texture2CoordGroup.Texture2Coords().ReplaceAll({ coord1, coord2, coord3, coord4 });

        // Add the texture material group to the model.
        model.Material().Texture2CoordGroups().Append(texture2CoordGroup);
#pragma endregion

#pragma region Mesh
        Printing3DMesh mesh;

        SetVertices(mesh);
        SetTriangleIndices(mesh);
        SetMaterialIndices(mesh);

        // add the mesh to the model
        model.Meshes().Append(mesh);
#pragma endregion

#pragma region Adding a component to the build
        // create a component.
        Printing3DComponent component;

        // assign the mesh to the component's mesh.
        component.Mesh(mesh);

        // Add the component to the model. A model can have multiple components.
        model.Components().Append(component);

        // The world matrix for the component is the identity matrix.
        Printing3DComponentWithMatrix componentWithMatrix;
        componentWithMatrix.Component(component);
        componentWithMatrix.Matrix(float4x4::identity());

        // add the componentWithMatrix to the build.
        // The build defines what is to be printed from within a Printing3DModel.
        // If you leave a mesh out of the build, it will not be printed.
        model.Build().Components().Append(componentWithMatrix);
#pragma endregion

        // Save the completed model into a package.
        co_await package.SaveModelToPackageAsync(model);

        // fix any textures in the model file.
        co_await FixTextureContentTypeAsync(package);

        co_return package;
    }

IAsyncOperation<Printing3D3MFPackage> anonymous_namespace{Scenario1_Print.cpp}::CreatePackageFromXmlAsync ( hstring rawXml )

Definition at line 355 of file Scenario1_Print.cpp.

    {
        Printing3D3MFPackage package;
        package.ModelPart(co_await StringToStreamAsync(rawXml));
        co_return package;
    }

IAsyncAction anonymous_namespace{Scenario1_Print.cpp}::FixTextureContentTypeAsync ( Printing3D3MFPackage package )

Definition at line 161 of file Scenario1_Print.cpp.

    {
        XmlDocument xmldoc;
        xmldoc.LoadXml(co_await StreamToStringAsync(package.ModelPart()));
        hstring ns3d = L"xmlns:m='http://schemas.microsoft.com/3dmanufacturing/material/2015/02'";

        for (IXmlNode node : xmldoc.SelectNodesNS(L"//m:texture2d[@contenttype='']", box_value(ns3d)))
        {
            IXmlNode contentType = node.Attributes().GetNamedItem(L"contenttype");
            auto path = unbox_value<hstring>(node.Attributes().GetNamedItem(L"path").NodeValue());
            std::wstring_view path_view = path;
            if (path_view.size() >= 4 && path_view.substr(path_view.size() - 4) == L".png")
            {
                contentType.NodeValue(box_value(L"image/png"));
            }
            else
            {
                contentType.NodeValue(box_value(L"image/jpg"));
            }
        }

        // Update the model with the repaired XML.
        package.ModelPart(co_await StringToStreamAsync(xmldoc.GetXml()));
    }

void anonymous_namespace{Scenario1_Print.cpp}::SetBufferBytes | ( | IBuffer const & | buffer,
 |  | void const * | data,
 |  | uint32_t | size
 | ) |  |

Definition at line 31 of file Scenario1_Print.cpp.

    {
        memcpy_s(buffer.data(), buffer.Length(), data, size);
    }

void anonymous_namespace{Scenario1_Print.cpp}::SetMaterialIndices ( Printing3DMesh const & mesh )

Definition at line 116 of file Scenario1_Print.cpp.

    {
        Printing3DBufferDescription description;
        description.Format = Printing3DBufferFormat::Printing3DUInt;
        description.Stride = 4; // 4 indices per material
        mesh.IndexCount(12); // 12 triangles with material
        mesh.TriangleMaterialIndicesDescription(description);

        // Create the buffer into which we will write the material indices.
        mesh.CreateTriangleMaterialIndices(sizeof(uint32_t) * description.Stride * mesh.IndexCount());

        // Fill the buffer with material indices.
        static constexpr uint32_t indices[] =
        {
            // base materials:
            // in  the BaseMaterialGroup, the BaseMaterial with id=0 will be applied to these triangle vertices
            2, 0, 0, 0,
            2, 0, 0, 0,
            // color materials:
            // in the ColorMaterialGroup, the ColorMaterials with these ids will be applied to these triangle vertices
            1, 1, 1, 1,
            1, 1, 1, 1,
            1, 0, 0, 0,
            1, 0, 0, 0,
            1, 0, 1, 0,
            1, 0, 1, 1,
            // composite materials:
            // in the CompositeMaterialGroup, the CompositeMaterial with id=0 will be applied to these triangles
            3,0,0,0,
            3,0,0,0,
            // texture materials:
            // in the Texture2CoordMaterialGroup, each texture coordinate is mapped to the appropriate vertex on these
            // two adjacent triangle faces, so that the square face they create displays the original rectangular image
            4, 0, 3, 1,
            4, 2, 3, 0,
        };

        SetBufferBytes(mesh.GetTriangleMaterialIndices(), indices, sizeof(indices));
    }

void anonymous_namespace{Scenario1_Print.cpp}::SetTriangleIndices ( Printing3DMesh const & mesh )

Definition at line 83 of file Scenario1_Print.cpp.

    {
        Printing3DBufferDescription description;
        description.Format = Printing3DBufferFormat::Printing3DUInt;
        description.Stride = 3; // 3 vertex position indices per triangle
        mesh.IndexCount(12); // 12 triangles in the cube
        mesh.TriangleIndicesDescription(description);

        // Create the buffer into which we will write the triangle vertex indices.
        mesh.CreateTriangleIndices(sizeof(uint32_t) * description.Stride * mesh.IndexCount());

        // Fill the buffer with triangle vertex indices.
        static constexpr uint32_t indices[] =
        {
            1, 0, 2,
            1, 2, 3,
            0, 1, 5,
            0, 5, 4,
            1, 3, 7,
            1, 7, 5,
            2, 7, 3,
            2, 6, 7,
            0, 6, 2,
            0, 4, 6,
            6, 5, 7,
            4, 5, 6,
        };

        SetBufferBytes(mesh.GetTriangleIndices(), indices, sizeof(indices));
    }

void anonymous_namespace{Scenario1_Print.cpp}::SetVertices ( Printing3DMesh const & mesh )

Definition at line 55 of file Scenario1_Print.cpp.

    {
        Printing3DBufferDescription description;
        description.Format = Printing3DBufferFormat::Printing3DDouble;
        description.Stride = 3; // Three values per vertex (x, y, z).
        mesh.VertexPositionsDescription(description);
        mesh.VertexCount(8); // 8 total vertices in the cube

        // Create the buffer into which we will write the vertex positions.
        mesh.CreateVertexPositions(sizeof(double) * description.Stride * mesh.VertexCount());

        // Fill the buffer with vertex coordinates.
        static constexpr double vertices[] =
        {
            0, 0, 0,
            10, 0, 0,
            0, 10, 0,
            10, 10, 0,
            0, 0, 10,
            10, 0, 10,
            0, 10, 10,
            10, 10, 10,
        };

        SetBufferBytes(mesh.GetVertexPositions(), vertices, sizeof(vertices));
    }

IAsyncOperation<hstring> anonymous_namespace{Scenario1_Print.cpp}::StreamToStringAsync ( IRandomAccessStream stream )

Definition at line 36 of file Scenario1_Print.cpp.

    {
        uint32_t size = static_cast<uint32_t>(stream.Size());
        Buffer buffer(size);
        IBuffer readBuffer = co_await stream.ReadAsync(buffer, size, InputStreamOptions::None);
        co_return CryptographicBuffer::ConvertBinaryToString(BinaryStringEncoding::Utf8, readBuffer);
    }

IAsyncOperation<IRandomAccessStream> anonymous_namespace{Scenario1_Print.cpp}::StringToStreamAsync ( hstring const & string )

Definition at line 44 of file Scenario1_Print.cpp.

    {
        IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(string, BinaryStringEncoding::Utf8);
        InMemoryRandomAccessStream outputStream;
        co_await outputStream.WriteAsync(buffer);
        co_return outputStream;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario2_Client.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario2_Client.cpp} Namespace Reference

Functions

template<typename T >
T | Read (DataReader const &reader)
template<>
int32_t | Read< int32_t > (DataReader const &reader)
template<>
uint32_t | Read< uint32_t > (DataReader const &reader)
template<>
uint8_t | Read< uint8_t > (DataReader const &reader)
void | SetVisibility (UIElement const &element, bool visible)
template<typename T >
bool | TryExtract (IBuffer const &buffer, T &result)
bool | TryParseInt (const wchar_t *str, int32_t &result)

Function Documentation

T anonymous_namespace{Scenario2_Client.cpp}::Read ( DataReader const & reader )
int32_t anonymous_namespace{Scenario2_Client.cpp}::Read< int32_t > ( DataReader const & reader )
uint32_t anonymous_namespace{Scenario2_Client.cpp}::Read< uint32_t > ( DataReader const & reader )
uint8_t anonymous_namespace{Scenario2_Client.cpp}::Read< uint8_t > ( DataReader const & reader )
void anonymous_namespace{Scenario2_Client.cpp}::SetVisibility | ( | UIElement const & | element,
 |  | bool | visible
 | ) |  |

Definition at line 33 of file Scenario2_Client.cpp.

    {
        element.Visibility(visible ? Visibility::Visible : Visibility::Collapsed);
    }

bool anonymous_namespace{Scenario2_Client.cpp}::TryExtract | ( | IBuffer const & | buffer,
 |  | T & | result
 | ) |  |

Definition at line 88 of file Scenario2_Client.cpp.

    {
        if (buffer.Length() >= sizeof(T))
        {
            DataReader reader = DataReader::FromBuffer(buffer);
            result = Read<T>(reader);
            return true;
        }
        return false;
    }

bool anonymous_namespace{Scenario2_Client.cpp}::TryParseInt | ( | const wchar_t * | str,
 |  | int32_t & | result
 | ) |  |

Definition at line 39 of file Scenario2_Client.cpp.

    {
        wchar_t* end;
        errno = 0;
        result = std::wcstol(str, &end, 0);

        if (str == end)
        {
            // Not parseable.
            return false;
        }

        if (errno == ERANGE || result < INT_MIN || INT_MAX < result)
        {
            // Out of range.
            return false;
        }

        if (*end != L'\0')
        {
            // Extra unparseable characters at the end.
            return false;
        }

        return true;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario2_Effects.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Variables

anonymous_namespace{Scenario2_Effects.cpp} Namespace Reference

Variables

constexpr TimeSpan | ColorRampDuration = std::chrono::milliseconds(500)
constexpr int | CustomEffectFrameCount = 30
constexpr TimeSpan | EffectUpdateInterval = std::chrono::milliseconds(33)
constexpr int | GeneratedBitmapEffectFrameCount = 60

Variable Documentation

constexpr TimeSpan ColorRampDuration = std::chrono::milliseconds(500)

Definition at line 35 of file Scenario2_Effects.cpp.

constexpr int CustomEffectFrameCount = 30

Definition at line 36 of file Scenario2_Effects.cpp.

constexpr TimeSpan EffectUpdateInterval = std::chrono::milliseconds(33)

Definition at line 34 of file Scenario2_Effects.cpp.

constexpr int GeneratedBitmapEffectFrameCount = 60

Definition at line 37 of file Scenario2_Effects.cpp.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario2_Lang.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario2_Lang.cpp} Namespace Reference

Functions

hstring ReportLanguageData (Language const &lang)

Function Documentation

hstring anonymous_namespace{Scenario2_Lang.cpp}::ReportLanguageData ( Language const & lang )

Definition at line 25 of file Scenario2_Lang.cpp.

    {
        return L"Display Name: " + lang.DisplayName() + L"\n" +
            L"Language Tag: " + lang.LanguageTag() + L"\n" +
            L"Native Name: " + lang.NativeName() + L"\n" +
            L"Script Code: " + lang.Script() + L"\n\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario2_Stats.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario2_Stats.cpp} Namespace Reference

Functions

void ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)

Function Documentation

void anonymous_namespace{Scenario2_Stats.cpp}::ReportCalendarData | ( | std::wostream & | results,
 |  | Calendar const & | calendar,
 |  | PCWSTR | calendarLabel
 | ) |  |

Definition at line 23 of file Scenario2_Stats.cpp.

    {
        results << calendarLabel << L": " << std::wstring_view(calendar.GetCalendarSystem()) << L"\n" <<
            L"Months in this Year: " << calendar.NumberOfMonthsInThisYear() << L"\n" <<
            L"Days in this Month: " << calendar.NumberOfDaysInThisMonth() << L"\n" <<
            L"Hours in this Period: " << calendar.NumberOfHoursInThisPeriod() << L"\n" <<
            L"Era: " << std::wstring_view(calendar.EraAsString()) << L"\n\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario2_StringTemplate.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario2_StringTemplate.cpp} Namespace Reference

Functions

void GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, DateTime dateToFormat)

Function Documentation

void anonymous_namespace{Scenario2_StringTemplate.cpp}::GenerateResult | ( | std::wostream & | results,
 |  | DateTimeFormatter const & | formatter,
 |  | DateTime | dateToFormat
 | ) |  |

Definition at line 24 of file Scenario2_StringTemplate.cpp.

    {
        // Perform the actual formatting.
        results << std::wstring_view(formatter.Template()) << L": " << std::wstring_view(formatter.Format(dateToFormat)) << std::endl;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario3.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario3.cpp} Namespace Reference

Functions

handle duplicate (handle const &other)

Function Documentation

handle anonymous_namespace{Scenario3.cpp}::duplicate ( handle const & other )

Definition at line 30 of file Scenario3.cpp.

    {
        handle result;
        if (other)
        {
            check_bool(DuplicateHandle(GetCurrentProcess(), other.get(), GetCurrentProcess(), result.put(), 0, FALSE, DUPLICATE_SAME_ACCESS));
        }
        return result;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario3_ParameterizedTemplate.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario3_ParameterizedTemplate.cpp} Namespace Reference

Functions

void GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, DateTime dateToFormat)

Function Documentation

void anonymous_namespace{Scenario3_ParameterizedTemplate.cpp}::GenerateResult | ( | std::wostream & | results,
 |  | DateTimeFormatter const & | formatter,
 |  | DateTime | dateToFormat
 | ) |  |

Definition at line 24 of file Scenario3_ParameterizedTemplate.cpp.

    {
        // Perform the actual formatting.
        results << std::wstring_view(formatter.Template()) << L": " << std::wstring_view(formatter.Format(dateToFormat)) << std::endl;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario3_Region.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario3_Region.cpp} Namespace Reference

Functions

hstring ReportRegionData (GeographicRegion const &region)

Function Documentation

hstring anonymous_namespace{Scenario3_Region.cpp}::ReportRegionData ( GeographicRegion const & region )

Definition at line 24 of file Scenario3_Region.cpp.

    {
        return L"Display Name: " + region.DisplayName() + L"\n" +
            L"Native Name: " + region.NativeName() + L"\n" +
            L"Currencies in use: " + SDKTemplate::StringJoin(L", ", region.CurrenciesInUse()) + L"\n" +
            L"Codes: " + region.CodeTwoLetter() + L", " + region.CodeThreeLetter() + L", " + region.CodeThreeDigit() + L"\n\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario4_ForegroundGeofence.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario4_ForegroundGeofence.cpp} Namespace Reference

Functions

template<typename T , typename U >
void RemoveByValue (T &&collection, U &&value)

Function Documentation

void anonymous_namespace{Scenario4_ForegroundGeofence.cpp}::RemoveByValue | ( | T && | collection,
 |  | U && | value
 | ) |  |

Definition at line 33 of file Scenario4_ForegroundGeofence.cpp.

    {
        uint32_t index = 0;
        if (collection.IndexOf(value, index))
        {
            collection.RemoveAt(index);
        }
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario4_UnicodeExtensions.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario4_UnicodeExtensions.cpp} Namespace Reference

Functions

void ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)

Function Documentation

void anonymous_namespace{Scenario4_UnicodeExtensions.cpp}::ReportCalendarData | ( | std::wostream & | results,
 |  | Calendar const & | calendar,
 |  | PCWSTR | calendarLabel
 | ) |  |

Definition at line 23 of file Scenario4_UnicodeExtensions.cpp.

    {
        results <<
            calendarLabel << L": " << std::wstring_view(calendar.GetCalendarSystem()) << "\n" <<
            L"Calendar system: " << std::wstring_view(calendar.GetCalendarSystem()) << L"\n" <<
            L"Numeral System: " << std::wstring_view(calendar.NumeralSystem()) << L"\n" <<
            L"Resolved Language " << std::wstring_view(calendar.ResolvedLanguage()) << L"\n" <<
            L"Name of Month: " << std::wstring_view(calendar.MonthAsSoloString()) << L"\n" <<
            L"Day of Month: " << std::wstring_view(calendar.DayAsPaddedString(2)) << L"\n" <<
            L"Day of Week: " << std::wstring_view(calendar.DayOfWeekAsSoloString()) << L"\n" <<
            L"Year: " << std::wstring_view(calendar.YearAsString()) << L"\n" <<
            L"\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario5_RoundingAndPadding.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario5_RoundingAndPadding.cpp} Namespace Reference

Functions

std::wstring | DisplayRoundingAlgorithmAsString (RoundingAlgorithm roundingAlgorithm)
void | DoCurrencyRoundingScenarios (std::wostream &results, hstring const &currencyCode, RoundingAlgorithm roundingAlgorithm)
void | DoIncrementRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm)
void | DoPaddingAndRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm, unsigned int significantDigits, int integerDigits, int fractionalDigits)
void | DoPaddingScenarios (std::wostream &results, INumberFormatter const &formatter)
void | DoSignificantDigitRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm)

Function Documentation

std::wstring anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DisplayRoundingAlgorithmAsString ( RoundingAlgorithm roundingAlgorithm )

Definition at line 25 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Convert the enumeration value into a string representation
        switch (roundingAlgorithm) {
        case RoundingAlgorithm::None:
            return L"no";
            break;
        case RoundingAlgorithm::RoundAwayFromZero:
            return L"away from zero";
            break;
        case RoundingAlgorithm::RoundDown:
            return L"down";
            break;
        case RoundingAlgorithm::RoundHalfAwayFromZero:
            return L"half away from zero";
            break;
        case RoundingAlgorithm::RoundHalfDown:
            return L"half down";
            break;
        case RoundingAlgorithm::RoundHalfToEven:
            return L"half to even";
            break;
        case RoundingAlgorithm::RoundHalfToOdd:
            return L"half to odd";
            break;
        case RoundingAlgorithm::RoundHalfTowardsZero:
            return L"half towards zero";
            break;
        case RoundingAlgorithm::RoundHalfUp:
            return L"half up";
            break;
        case RoundingAlgorithm::RoundTowardsZero:
            return L"toward zero";
            break;
        case RoundingAlgorithm::RoundUp:
            return L"up";
            break;
        default:
            return L"unknown";
            break;
        }
    }

void anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DoCurrencyRoundingScenarios | ( | std::wostream & | results,
 |  | hstring const & | currencyCode,
 |  | RoundingAlgorithm | roundingAlgorithm
 | ) |  |

This scenario illustrates how to provide a rounding algorithm to a CurrencyFormatter class by means of the applyRoundingForCurrency method.

This will associate an IncrementNumberRounder using the same increment as the fractionDigits appropriate for the currency and language. You can always choose to provide a different rounding algorithm by setting the numberRounder property, as depicted in the doPaddingAndRoundingScenarios function. The mechanism provided here is better suited for currencies.

Definition at line 143 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Create the currency formatter and set the rounding algorithm provided as a parameter
        CurrencyFormatter currencyFormatter(currencyCode);
        currencyFormatter.ApplyRoundingForCurrency(roundingAlgorithm);

        // Display the properties of the scenario
        results << L"Currency formatting for ";
        results << std::wstring_view(currencyFormatter.Currency()) << L" currency and using the ";
        results << DisplayRoundingAlgorithmAsString(roundingAlgorithm) << L" rounding algorithm";
        results << std::endl << std::endl;

        // Iterate through the numbers to round and add them to the results
        static constexpr double numbersToFormat[] = { 14.55, 3.345, 16.2, 175.8 };
        for (double numberToFormat : numbersToFormat)
        {
            hstring formattedNumber = currencyFormatter.Format(numberToFormat);
            results << L"Value: " << numberToFormat << L" Formatted: " << std::wstring_view(formattedNumber) << std::endl;
        }

        // Add a carriage return at the end of the scenario for readability
        results << std::endl;
    }

void anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DoIncrementRoundingScenarios | ( | std::wostream & | results,
 |  | RoundingAlgorithm | roundingAlgorithm
 | ) |  |

Shows how to do number rounding using the IncrementNumberRounding class.

Definition at line 168 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Create the rounder and set the rounding algorithm provided as a parameter
        IncrementNumberRounder rounder;
        rounder.RoundingAlgorithm(roundingAlgorithm);

        // Formatter to display the rounded value.  It is recommended to use the increment number
        // rounder within a formatter object to avoid precision issues when displaying.
        DecimalFormatter formatter;
        formatter.NumberRounder(rounder);

        // Iterate through the increments we have defined in the scenario
        static constexpr double incrementsToRound[] = { 0.001, 0.01, 0.1, 1.0 };
        for (double incrementToRound : incrementsToRound)
        {
            // Set the significant digits to round to
            rounder.Increment(incrementToRound);

            // Display the properties of the scenario
            results << L"Rounding with ";
            results << rounder.Increment() << L" increment and ";
            results << DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm()) << L" rounding algorithm";
            results << std::endl << std::endl;

            // Iterate through the numbers to round and add them to the results
            static constexpr double numbersToRound[] = { 0.1458, 1.458, 14.58, 145.8 };
            for (double numberToRound : numbersToRound)
            {
                results << L"Value: " << numberToRound << L" Rounded: " << std::wstring_view(formatter.Format(numberToRound)) << std::endl;
            }

            // Add a carriage return at the end of the scenario for readability
            results << std::endl;
        }
    }

void anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DoPaddingAndRoundingScenarios | ( | std::wostream & | results,
 |  | RoundingAlgorithm | roundingAlgorithm,
 |  | unsigned int | significantDigits,
 |  | int | integerDigits,
 |  | int | fractionalDigits
 | ) |  |

Demonstrates how to perform padding and rounding by using the DecimalFormatter class (can be any of the formatter classes in the Windows.Globalization.Numberformatting namespace) and the IncrementNumberRounder to do so.

The SignificantDigitsNumberRounder can also be used instead of the latter.

Definition at line 95 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Create the rounder and set the rounding algorithm provided as a parameter
        IncrementNumberRounder rounder;
        rounder.RoundingAlgorithm(roundingAlgorithm);

        // Create the formatter, set the padding properties provided as parameters and associate the rounder
        // we have just created
        DecimalFormatter formatter;
        formatter.SignificantDigits(significantDigits);
        formatter.IntegerDigits(integerDigits);
        formatter.FractionDigits(fractionalDigits);
        formatter.NumberRounder(rounder);

        // Iterate through the increments we have defined in the scenario
        static constexpr double incrementsToRound[] = { 0.001, 0.01, 0.1, 1.0 };
        for (double incrementToRound : incrementsToRound)
        {
            // Set the increment to round to
            rounder.Increment(incrementToRound);

            // Display the properties of the scenario
            results << L"Padding and rounding with ";
            results << formatter.SignificantDigits() << L" significant digits, ";
            results << formatter.IntegerDigits() << L" integer digits, ";
            results << formatter.FractionDigits() << L" fractional digits, ";
            results << rounder.Increment() << L" increment and ";
            results << DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm()) << L" rounding algorithm";
            results << std::endl << std::endl;

            // Iterate through the numbers to round and pad, format them and add them to the results
            static constexpr double numbersToFormat[] = { 0.1458, 1.458, 14.58, 145.8 };
            for (double numberToFormat : numbersToFormat)
            {
                hstring formattedNumber = formatter.Format(numberToFormat);
                results << L"Value: " << numberToFormat << L" Formatted: " << std::wstring_view(formattedNumber) << std::endl;
            }

            // Add a carriage return at the end of the scenario for readability
            results << std::endl;
        }
    }

void anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DoPaddingScenarios | ( | std::wostream & | results,
 |  | INumberFormatter const & | formatter
 | ) |  |

The formatter parameter can be either a DecimalFormatter, PercentFormatter PerMilleFormatter or CurrencyFormatter.

Definition at line 71 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Display the properties of the scenario
        results << L"Padding with ";
        results << formatter.as<ISignificantDigitsOption>().SignificantDigits() << L" significant digits, ";
        results << formatter.as<INumberFormatterOptions>().IntegerDigits() << L" integer digits, ";
        results << formatter.as<INumberFormatterOptions>().FractionDigits() << L" fractional digits";
        results << std::endl << std::endl;

        // Iterate through the numbers to pad, format them and add them to the results
        static constexpr double numbersToPad[] = { 0.12, 1.2, 10.2, 102 };
        for (double numberToPad : numbersToPad)
        {
            hstring paddedNumber = formatter.Format(numberToPad);
            results << L"Value: " << numberToPad << L" Padded: " << std::wstring_view(paddedNumber) << std::endl;
        }

        // Add a carriage return at the end of the scenario for readability
        results << std::endl;
    }

void anonymous_namespace{Scenario5_RoundingAndPadding.cpp}::DoSignificantDigitRoundingScenarios | ( | std::wostream & | results,
 |  | RoundingAlgorithm | roundingAlgorithm
 | ) |  |

Shows how to do number rounding using the SignificantDigitsNumberRounder class.

Definition at line 205 of file Scenario5_RoundingAndPadding.cpp.

    {
        // Create the rounder and set the rounding algorithm provided as a parameter.
        SignificantDigitsNumberRounder rounder;
        rounder.RoundingAlgorithm(roundingAlgorithm);

        // Iterate through the significant digits we have defined in the scenario
        static constexpr unsigned int digitsToRound[] = { 3, 2, 1 };
        for (unsigned int digitToRound : digitsToRound)
        {
            // Set the significant digits to round to
            rounder.SignificantDigits(digitToRound);

            // Display the properties of the scenario
            results << L"Rounding with ";
            results << rounder.SignificantDigits() << L" significant digits and ";
            results << DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm()) << L" rounding algorithm";
            results << std::endl << std::endl;

            // Iterate through the numbers to round and add them to the results
            static constexpr double numbersToRound[] = { 0.1458, 1.458, 14.58, 145.8 };
            for (double numberToRound : numbersToRound)
            {
                double roundedValue = rounder.RoundDouble(numberToRound);
                results << L"Value: " << numberToRound << L" Rounded: " << roundedValue << std::endl;
            }

            // Add a carriage return at the end of the scenario for readability
            results << std::endl;
        }
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario5_TimeZone.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario5_TimeZone.cpp} Namespace Reference

Functions

void ReportCalendarData (std::wostream &results, Calendar const &calendar)

Function Documentation

void anonymous_namespace{Scenario5_TimeZone.cpp}::ReportCalendarData | ( | std::wostream & | results,
 |  | Calendar const & | calendar
 | ) |  |

Definition at line 23 of file Scenario5_TimeZone.cpp.

    {
        // Display individual date/time elements.
        results <<
            L"In " << std::wstring_view(calendar.GetTimeZone()) <<
            L" time zone:   " << std::wstring_view(calendar.DayOfWeekAsSoloString()) <<
            L"   " << std::wstring_view(calendar.MonthAsSoloString()) <<
            L" " << std::wstring_view(calendar.DayAsPaddedString(2)) <<
            L", " << std::wstring_view(calendar.YearAsString()) <<
            L"   " << std::wstring_view(calendar.HourAsPaddedString(2)) <<
            L":" << std::wstring_view(calendar.MinuteAsPaddedString(2)) <<
            L":" << std::wstring_view(calendar.SecondAsPaddedString(2)) <<
            L" " << std::wstring_view(calendar.PeriodAsString()) <<
            L"  " << std::wstring_view(calendar.TimeZoneAsString(3)) <<
            L"\n";
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario6.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario6.cpp} Namespace Reference

Functions

bool TryParseUInt (const wchar_t *str, uint32_t &result)

Function Documentation

bool anonymous_namespace{Scenario6.cpp}::TryParseUInt | ( | const wchar_t * | str,
 |  | uint32_t & | result
 | ) |  |

Definition at line 28 of file Scenario6.cpp.

    {
        wchar_t* end;
        errno = 0;
        result = std::wcstoul(str, &end, 0);

        if (str == end)
        {
            // Not parseable.
            return false;
        }

        if (errno == ERANGE)
        {
            // Out of range.
            return false;
        }

        if (*end != L'\0')
        {
            // Extra unparseable characters at the end.
            return false;
        }

        return true;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Scenario6_TimeZone.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Functions

anonymous_namespace{Scenario6_TimeZone.cpp} Namespace Reference

Functions

void GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, PCWSTR timeZone, DateTime dateToFormat)

Function Documentation

void anonymous_namespace{Scenario6_TimeZone.cpp}::GenerateResult | ( | std::wostream & | results,
 |  | DateTimeFormatter const & | formatter,
 |  | PCWSTR | timeZone,
 |  | DateTime | dateToFormat
 | ) |  |

Definition at line 24 of file Scenario6_TimeZone.cpp.

    {
        // Perform the actual formatting.
        results << L"In " << timeZone << L" time zone: " <<
            std::wstring_view(formatter.Format(dateToFormat, timeZone)) << std::endl;
    }

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{SecondaryViewPage.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Variables

anonymous_namespace{SecondaryViewPage.cpp} Namespace Reference

Variables

const int | ANIMATION_OPACITY_END = 1
const int | ANIMATION_OPACITY_START = 0
const int | ANIMATION_TRANSLATION_END = 0
const int | ANIMATION_TRANSLATION_START = 100
hstring | EMPTY_TITLE = "<title cleared>"

Variable Documentation

const int ANIMATION_OPACITY_END = 1

Definition at line 31 of file SecondaryViewPage.cpp.

const int ANIMATION_OPACITY_START = 0

Definition at line 30 of file SecondaryViewPage.cpp.

const int ANIMATION_TRANSLATION_END = 0

Definition at line 29 of file SecondaryViewPage.cpp.

const int ANIMATION_TRANSLATION_START = 100

Definition at line 28 of file SecondaryViewPage.cpp.

hstring EMPTY_TITLE = "<title cleared>"

Definition at line 32 of file SecondaryViewPage.cpp.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{StspMediaSink.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions | Variables

anonymous_namespace{StspMediaSink.cpp} Namespace Reference

Classes

class | SetConnectedFunc
class | ShutdownFunc
class | StartFunc
class | StopFunc

Functions

void | ConvertPropertiesToMediaType (_In_ IMediaEncodingProperties^mep, _Outptr_ IMFMediaType **ppMT)
template<class T , class TFunc >
HRESULT | ForEach (ComPtrList< T > &col, TFunc fn)
DWORD | GetStreamId (Windows::Media::Capture::MediaStreamType mediaStreamType)

Variables

const DWORD | c_cbReceiveBuffer = 8 * 1024

Function Documentation

void anonymous_namespace{StspMediaSink.cpp}::ConvertPropertiesToMediaType | ( | _In_ IMediaEncodingProperties^ | mep,
 |  | _Outptr_ IMFMediaType ** | ppMT
 | ) |  |

Definition at line 145 of file StspMediaSink.cpp.

    {
        if (mep == nullptr || ppMT == nullptr)
        {
            throw ref new InvalidArgumentException();
        }
        ComPtr<IMFMediaType> spMT;
        *ppMT = nullptr;
        ThrowIfError(MFCreateMediaType(&spMT));

        auto it = mep->Properties->First();

        while (it->HasCurrent)
        {
            auto currentValue = it->Current;
            AddAttribute(currentValue->Key, safe_cast<IPropertyValue^>(currentValue->Value), spMT.Get());
            it->MoveNext();
        }

        GUID guiMajorType = safe_cast<IPropertyValue^>(mep->Properties->Lookup(MF_MT_MAJOR_TYPE))->GetGuid();

        if (guiMajorType != MFMediaType_Video && guiMajorType != MFMediaType_Audio)
        {
            Throw(E_UNEXPECTED);
        }

        *ppMT = spMT.Detach();
    }

HRESULT anonymous_namespace{StspMediaSink.cpp}::ForEach | ( | ComPtrList< T > & | col,
 |  | TFunc | fn
 | ) |  |

Definition at line 75 of file StspMediaSink.cpp.

    {
        ComPtrList<T>::POSITION pos = col.FrontPosition();
        ComPtrList<T>::POSITION endPos = col.EndPosition();
        HRESULT hr = S_OK;

        for (;pos != endPos; pos = col.Next(pos))
        {
            ComPtr<T> spStream;

            hr = col.GetItemPos(pos, &spStream);
            if (FAILED(hr))
            {
                break;
            }

            hr = fn(spStream.Get());
        }

        return hr;
    }

DWORD anonymous_namespace{StspMediaSink.cpp}::GetStreamId ( Windows::Media::Capture::MediaStreamType mediaStreamType )

Definition at line 174 of file StspMediaSink.cpp.

    {
        switch(mediaStreamType)
        {
        case Windows::Media::Capture::MediaStreamType::VideoRecord:
            return 0;
        case Windows::Media::Capture::MediaStreamType::Audio:
            return 1;
        }

        throw ref new InvalidArgumentException();
    }

Variable Documentation

const DWORD c_cbReceiveBuffer = 8 * 1024

Definition at line 19 of file StspMediaSink.cpp.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{StspMediaSource.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Variables

anonymous_namespace{StspMediaSource.cpp} Namespace Reference

Variables

const DWORD | c_cbMaxPacketSize = 1024 * 1024
const DWORD | c_cbReceiveBufferSize = 2 * 1024

Variable Documentation

const DWORD c_cbMaxPacketSize = 1024 * 1024

Definition at line 19 of file StspMediaSource.cpp.

const DWORD c_cbReceiveBufferSize = 2 * 1024

Definition at line 18 of file StspMediaSource.cpp.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: anonymous_namespace{Validation.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions | Variables

anonymous_namespace{Validation.cpp} Namespace Reference

Classes

struct | AttributeValidationDescriptor
struct | MediaTypeValidationDescriptor

Functions

const
MediaTypeValidationDescriptor * 		FindMediaTypeDescriptor (REFGUID guidMajorType, REFGUID guidSubtype)
bool | IsAttributeValid (const MediaTypeValidationDescriptor *validationDescriptor, REFGUID guidKey, PROPVARIANT *pValue)
bool | ValidateBlob (PROPVARIANT *pValue)
template<VARTYPE vt>
bool | ValidateDataType (PROPVARIANT *pValue)

Variables

const AttributeValidationDescriptor | AACValidAttributes []
const AttributeValidationDescriptor | H264ValidAttributes []
const MediaTypeValidationDescriptor | ValidMediaTypes []

Function Documentation

const MediaTypeValidationDescriptor* anonymous_namespace{Validation.cpp}::FindMediaTypeDescriptor | ( | REFGUID | guidMajorType,
 |  | REFGUID | guidSubtype
 | ) |  |

Definition at line 76 of file Validation.cpp.

    {
        for (UINT32 nIndex = 0; nIndex < _countof(ValidMediaTypes); ++nIndex)
        {
            if (ValidMediaTypes[nIndex].guidSubtype == guidSubtype &&
                ((guidMajorType == MFMediaType_Video && ValidMediaTypes[nIndex].fVideo) ||
                (guidMajorType == MFMediaType_Audio && !ValidMediaTypes[nIndex].fVideo)))
            {
                return &ValidMediaTypes[nIndex];
            }
        }

        return nullptr;
    }

bool anonymous_namespace{Validation.cpp}::IsAttributeValid | ( | const MediaTypeValidationDescriptor * | validationDescriptor,
 |  | REFGUID | guidKey,
 |  | PROPVARIANT * | pValue
 | ) |  |

Definition at line 93 of file Validation.cpp.

    {
        bool isValid = false;

        for (UINT32 nIndex = 0; nIndex < validationDescriptor->cAttributes; ++nIndex)
        {
            if (validationDescriptor->attributes[nIndex].guidKey == guidKey)
            {
                if (validationDescriptor->attributes[nIndex].IsValid(pValue))
                {
                    isValid = true;
                }
                else
                {
                   ThrowIfError(MF_E_INVALIDMEDIATYPE);
                }
                break;
            }
        }

        return isValid;
    }

bool anonymous_namespace{Validation.cpp}::ValidateBlob ( PROPVARIANT * pValue )

Definition at line 21 of file Validation.cpp.

    {
        return ValidateDataType<MF_ATTRIBUTE_BLOB>(pValue) && pValue->caub.cElems < 128;
    }

bool anonymous_namespace{Validation.cpp}::ValidateDataType ( PROPVARIANT * pValue )

Definition at line 15 of file Validation.cpp.

    {
        return (pValue->vt == vt);
    }

Variable Documentation

const AttributeValidationDescriptor AACValidAttributes[]
Initial value:
 {
        {MF_MT_AUDIO_AVG_BYTES_PER_SECOND, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AVG_BITRATE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AUDIO_BLOCK_ALIGNMENT, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AUDIO_NUM_CHANNELS, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_COMPRESSED, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AUDIO_SAMPLES_PER_SECOND, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AUDIO_PREFER_WAVEFORMATEX, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_USER_DATA, ValidateDataType<MF_ATTRIBUTE_BLOB>},
        {MF_MT_FIXED_SIZE_SAMPLES, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AAC_PAYLOAD_TYPE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_AUDIO_BITS_PER_SAMPLE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
    }

Definition at line 54 of file Validation.cpp.

const AttributeValidationDescriptor H264ValidAttributes[]
Initial value:
 {
        {MF_MT_FRAME_SIZE, ValidateDataType<MF_ATTRIBUTE_UINT64>},
        {MF_MT_AVG_BITRATE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_MPEG_SEQUENCE_HEADER, ValidateBlob},
        {MF_MT_MPEG2_PROFILE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
        {MF_MT_FRAME_RATE, ValidateDataType<MF_ATTRIBUTE_UINT64>},
        {MF_MT_PIXEL_ASPECT_RATIO, ValidateDataType<MF_ATTRIBUTE_UINT64>},
        {MF_MT_INTERLACE_MODE, ValidateDataType<MF_ATTRIBUTE_UINT32>},
    }

Definition at line 43 of file Validation.cpp.

const MediaTypeValidationDescriptor ValidMediaTypes[]
Initial value:
 {
        {MFVideoFormat_H264, true, _countof(H264ValidAttributes), H264ValidAttributes},
        {MFAudioFormat_AAC, false, _countof(AACValidAttributes), AACValidAttributes}
    }

Definition at line 70 of file Validation.cpp.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppResourceClassLibrary Namespace Reference

  • Namespace List
  • Namespace Members
Classes

AppResourceClassLibrary Namespace Reference

Classes

class LocalizedNamesLibrary
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation Namespace Reference

  • Namespace List
  • Namespace Members
Classes

AudioCreation Namespace Reference

Classes

interface | IMemoryBufferByteAccess
class | Scenario1_FilePlayback
Using the AudioGraph API to playback from a file input. More...
class | Scenario2_DeviceCapture
This scenario shows using AudioGraph for audio capture from a microphone with low latency. More...
class | Scenario3_FrameInput
Scenario 3: Using a frame input node to play audio. More...
class | Scenario4_Submix
Shows use of a SubMix node with an effect applied to it. More...
class | Scenario5_InboxEffects
This scenario is to demonstrate the use of Built-In Effects. More...
class | Scenario6_CustomEffects
Using custom effects with the AudioGraph API. More...
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcherTask Namespace Reference

  • Namespace List
  • Namespace Members
Variables

BackgroundDeviceWatcherTask Namespace Reference

Variables

runtimeclass BackgroundDeviceWatcher

Variable Documentation

runtimeclass BackgroundDeviceWatcher

Definition at line 6 of file BackgroundDeviceWatcher.idl.

Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcherTaskCpp Namespace Reference

  • Namespace List
  • Namespace Members
Classes

BackgroundDeviceWatcherTaskCpp Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundDeviceWatcherTaskCs Namespace Reference

  • Namespace List
  • Namespace Members
Classes

BackgroundDeviceWatcherTaskCs Namespace Reference

Classes

class BackgroundDeviceWatcher
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

BackgroundMediaPlayback Namespace Reference

Namespaces

namespace | DataModels
namespace | Services
namespace | ViewModels

Classes

class | PlaylistView
A custom control for playlists that wraps a ListView. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Settings
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback::DataModels Namespace Reference

  • Namespace List
  • Namespace Members
  • BackgroundMediaPlayback
  • DataModels
Classes

BackgroundMediaPlayback::DataModels Namespace Reference

Classes

class | MediaItem
class | MediaList
class | MusicItem
class | VideoItem
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback::Services Namespace Reference

  • Namespace List
  • Namespace Members
  • BackgroundMediaPlayback
  • Services
Classes

BackgroundMediaPlayback::Services Namespace Reference

Classes

class | PlaybackService
The central authority on playback in the application providing access to the player and active playlist. More...
class | SettingsService
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback::ViewModels Namespace Reference

  • Namespace List
  • Namespace Members
  • BackgroundMediaPlayback
  • ViewModels
Classes

BackgroundMediaPlayback::ViewModels Namespace Reference

Classes

class | MediaItemViewModel
View model for media items. More...
class | MediaListViewModel
View model for a list of media items. More...
class | PlaybackSessionViewModel
class | PlaybackStateToButtonIconConverter
class | PlayerViewModel
The view model for the player. More...
class | SettingsViewModel
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Variables

BackgroundTask Namespace Reference

Classes

class | BackgroundTaskInformation
class | ConnectTask
class | GeofenceBackgroundTask
class | Helpers
class | IoSyncBackgroundTask
class | LocalSettingKeys
class | LocationBackgroundTask
class | Scenario1_BackgroundTask
class | sealed
class | Sync
class | UpdateMetadataTask
class | VisitBackgroundTask

Variables

runtimeclass | ConnectTask
runtimeclass | GeofenceBackgroundTask
runtimeclass | LocationBackgroundTask
runtimeclass | UpdateMetadataTask
runtimeclass | VisitBackgroundTask

Variable Documentation

runtimeclass ConnectTask

Definition at line 12 of file Tasks.idl.

runtimeclass GeofenceBackgroundTask

Definition at line 6 of file Tasks.idl.

runtimeclass LocationBackgroundTask

Definition at line 12 of file Tasks.idl.

runtimeclass UpdateMetadataTask

Definition at line 6 of file Tasks.idl.

runtimeclass VisitBackgroundTask

Definition at line 18 of file Tasks.idl.

Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTasks Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

BackgroundTasks Namespace Reference

Namespaces

namespace | Helpers

Classes

class | AdvertisementPublisherTask
class | AdvertisementWatcherTask
class | BadgeNotificationHistoryChangedTriggerTask
class | BadgeNumericNotificationContent
Notification content object to display a number on a tile's badge. More...
class | RfcommServerTask
class | ToastActivationTypeBackgroundClosedTask
class | ToastNotificationHistoryChangedTriggerTask
class | ToastNotificationQuickReplyTask
class | Util
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTasks::Helpers Namespace Reference

  • Namespace List
  • Namespace Members
  • BackgroundTasks
  • Helpers
Classes | Enumerations

BackgroundTasks::Helpers Namespace Reference

Classes

class | BackgroundTaskStorage
class | BadgeHelper
class | Settings
class | StringHelper
class | ToastHelper

Enumerations

enum | BackgroundTaskStatus { Error, Success }

Enumeration Type Documentation

enum BackgroundTaskStatus
Enumerator:
Error
Success

Definition at line 3 of file BackgroundTaskStatus.cs.

    {
        Error,
        Success
    }

Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeDecoder Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Variables

BarcodeDecoder Namespace Reference

Classes

class | BarcodeDecodeTask
class | DecodeEngine
class | DecodeResult
class | Provider
class | sealed

Variables

Provider | provider = nullptr

Variable Documentation

Provider provider = nullptr

Definition at line 21 of file BarcodeDecoder.cpp.

Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Functions

BasicHologram Namespace Reference

Namespaces

namespace | Common
namespace | Content

Classes

class | AppView
The IFrameworkView connects the app with Windows and handles application lifecycle events. More...
class | AppViewSource
class | BasicHologramMain
class | HolographicTemplateAppMain
Updates, renders, and presents holographic content using Direct3D. More...
struct | ModelConstantBuffer
class | Program
Windows Holographic application using SharpDX. More...
class | sealed
class | SpatialInputHandler
class | SpinningCubeRenderer
struct | VertexPositionColor

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • BasicHologram
  • Common
Classes

BasicHologram::Common Namespace Reference

Classes

class | CameraResources
class | DeviceResources
Controls all the DirectX device resources. More...
class | DirectXHelper
class | Disposer
class | InteropStatics
class | SpatialInputHandler
class | StepTimer
Helper class for animation and simulation timing. More...
struct | ViewProjectionConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram::Content Namespace Reference

  • Namespace List
  • Namespace Members
  • BasicHologram
  • Content
Classes

BasicHologram::Content Namespace Reference

Classes

struct | ModelConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
class | SpinningCubeRenderer
This sample renderer instantiates a basic rendering pipeline. More...
struct | VertexPositionColor
Used to send per-vertex data to the vertex shader. More...
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting Namespace Reference

  • Namespace List
  • Namespace Members
Classes

BasicMediaCasting Namespace Reference

Classes

class | Scenario1
class | Scenario2
class | Scenario3
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BindTestbedModel Namespace Reference

  • Namespace List
  • Namespace Members
Classes

BindTestbedModel Namespace Reference

Classes

class | ColorToStringConverter
class | VeryObservableCollection-g
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement Namespace Reference

  • Namespace List
  • Namespace Members
Classes

BluetoothAdvertisement Namespace Reference

Classes

class | Scenario1_Watcher
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Publisher
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_BackgroundWatcher
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_BackgroundPublisher
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraAdvancedCapture Namespace Reference

Classes

class | AdvancedCaptureContext
Helper class to contain the information that describes an advanced capture. More...
class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraGetPreviewFrame Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
interface | IMemoryBufferByteAccess
class | MainPage
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraManualControls Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | InvertBoolConverter
class | MainPage
class | RoundingConverter
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraProfile Namespace Reference

Classes

class | Scenario1_SetRecordProfile
SetRecordProfile page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_ConcurrentProfile
ConcurrenProfile page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_EnableHdrProfile
EnableHDRProfile page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraStarterKit Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | CameraRotationHelper
class | MainPage
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

CameraStreamCoordinateMapper Namespace Reference

Classes

class | CameraCoordinateMapper
class | CameraStreamCoordinateMapperMain
class | CameraStreamProcessor
class | GpuCoordinateMapper
class | QuadRenderer
class | sealed
class | TextRenderer
struct | VertexPositionTex

Functions

struct | alignas (16) ModelViewProjectionConstantBuffer

Function Documentation

struct alignas ( 16 ) [read]

Definition at line 51 of file ShaderStructures.h.

    {
        Windows::Foundation::Numerics::float4x4 worldToProj;
    };

Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CameraVideoStabilization Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: com Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

com Namespace Reference

Namespaces

namespace microsoft
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: com::microsoft Namespace Reference

  • Namespace List
  • Namespace Members
  • com
  • microsoft
Namespaces

com::microsoft Namespace Reference

Namespaces

namespace Samples
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: com::microsoft::Samples Namespace Reference

  • Namespace List
  • Namespace Members
  • com
  • microsoft
  • Samples
Namespaces

com::microsoft::Samples Namespace Reference

Namespaces

namespace SecureInterface
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: com::microsoft::Samples::SecureInterface Namespace Reference

  • Namespace List
  • Namespace Members
  • com
  • microsoft
  • Samples
  • SecureInterface
Classes | Variables

com::microsoft::Samples::SecureInterface Namespace Reference

Classes

interface | ISecureInterfaceConsumer
interface | ISecureInterfaceLegacySignals
interface | ISecureInterfaceProducer
interface | ISecureInterfaceService
interface | ISecureInterfaceSignals
interface | ISignalEmitter
class | sealed

Variables

PCSTR | c_SecureInterfaceIntrospectionXml = "</interface>"

Variable Documentation

PCSTR c_SecureInterfaceIntrospectionXml = "</interface>"

Definition at line 429 of file SecureInterfaceProducer.cpp.

Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Commanding Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Commanding Namespace Reference

Classes

class | DynamicCommandBar
We extend the CommandBar by adding logic to reflow commands as space is reduced. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CompositionVisual Namespace Reference

Classes

class | VisualProperties
class | VisualPropertiesFactory
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Compression Namespace Reference

Classes

class Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CredentialPicker Namespace Reference

Classes

class | Scenario1_Message
class | Scenario2_MessageCaption
class | Scenario3_CredentialPickerOptions
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomComputeShader Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomComputeShader Namespace Reference

Classes

class | CustomComputeShaderMain
class | CustomComputeShaderRenderer
class | SampleOverlay
class | sealed
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEffect Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomEffect Namespace Reference

Classes

class | AudioEchoEffect
interface | IMemoryBufferByteAccess
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

CustomHidDeviceAccess Namespace Reference

Classes

class | DeviceConnect
Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events. More...
class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...
class | DeviceProperties
class | EventHandlerForDevice
The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event is raised (app suspension and resume) or when the device is disconnected. More...
class | FeatureReports
This page demonstrates how to use FeatureReports to communicate with the device. More...
class | InputOutputReports
This scenario demonstrates how to get input reports and how to send output reports. More...
class | InputReportEvents
This scenario demonstrates to how register and utilize input reports. More...
class | OnDeviceConnectedEventArgs
class | SuperMutt
This is the report descriptor for the support SuperMutt device. More...
class | Utilities

Enumerations

enum | DeviceType { SuperMutt, Any, None }

Enumeration Type Documentation

enum DeviceType
Enumerator:
SuperMutt
Any
None

Definition at line 41 of file SampleConfiguration.cs.

    {
        SuperMutt,
        Any,    // Can be any device
        None
    }

Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomMediaTransportControls Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomMediaTransportControls Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | CustomMediaTransportControls
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomPixelShader Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomPixelShader Namespace Reference

Classes

class | CustomPixelShaderMain
class | CustomPixelShaderRenderer
class | SampleOverlay
class | sealed
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomSensors Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomSerialDeviceAccess Namespace Reference

Classes

class | DeviceConfiguration
class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...
class | DeviceProperties
class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...
class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...
class | Scenario2_ConfigureDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_ReadWrite
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_Events
An empty page that can be used on its own or navigated to within a Frame. More...
class | Utilities
This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages. More...
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

CustomUsbDeviceAccess Namespace Reference

Classes

class | DescriptorTypeEntry
DescriptorTypeEntry is used so that the UI can bind to the list of these entries and display them. More...
class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...
class | DeviceProperties
class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...
class | LocalSettingKeys
class | OnDeviceConnectedEventArgs
class | OsrFx2
class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a USB Device and respond to device disconnects, app suspending and resuming events. More...
class | Scenario2_ControlTransfer
This page demonstrates how to use control transfers to communicate with the device. More...
class | Scenario3_InterruptPipes
This page demonstrates how to use interrupts pipes on a UsbDevice. More...
class | Scenario4_BulkPipes
This page demonstrates how to propertly use bulk pipes to read and write to the device. More...
class | Scenario5_UsbDescriptors
This scenario demonstrates how get various descriptors from UsbDevice. More...
class | Scenario6_InterfaceSettings
Scenario will demonstrate how to change interface settings (also known as alternate interface setting). More...
class | Scenario7_SyncDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | SuperMutt
class | SyncBackgroundTaskInformation
class | Utilities

Enumerations

enum Descriptor {
Device, Configuration, Interface, Endpoint,
String, Custom
}
enum | DeviceType { OsrFx2, SuperMutt, All, None }

Enumeration Type Documentation

enum Descriptor
Enumerator:
Device
Configuration
Interface
Endpoint
String
Custom

Definition at line 65 of file SampleConfiguration.cs.

    {
        Device,
        Configuration,
        Interface,
        Endpoint,
        String,
        Custom
    };

enum DeviceType
Enumerator:
OsrFx2
SuperMutt
All
None

Definition at line 57 of file SampleConfiguration.cs.

    {
        OsrFx2,
        SuperMutt,
        All,    // Can be any device
        None
    };

Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomVertexShader Namespace Reference

  • Namespace List
  • Namespace Members
Classes

CustomVertexShader Namespace Reference

Classes

class | CustomVertexShaderMain
class | CustomVertexShaderRenderer
class | SampleOverlay
class | sealed
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

D2DAdvancedColorImages Namespace Reference

Classes

class | D2DAdvancedColorImagesRenderer
struct | ImageInfo
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Enumerations

enum RenderEffectKind {
ReinhardTonemap, FilmicTonemap, None, SdrOverlay,
LuminanceHeatmap
}

Enumeration Type Documentation

enum RenderEffectKind

Supported render effects which are inserted into the render pipeline.

Includes HDR tonemappers and useful visual tools. Each render effect is implemented as a custom Direct2D effect.

Enumerator:
ReinhardTonemap
FilmicTonemap
None
SdrOverlay
LuminanceHeatmap

Definition at line 23 of file RenderOptions.h.

    {
        ReinhardTonemap,
        FilmicTonemap,
        None,
        SdrOverlay,
        LuminanceHeatmap
    };

Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh Namespace Reference

  • Namespace List
  • Namespace Members
Classes

D2DGradientMesh Namespace Reference

Classes

class | D2DGradientMeshMain
class | D2DGradientMeshRenderer
class | SampleOverlay
class | sealed
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment Namespace Reference

  • Namespace List
  • Namespace Members
Classes

D2DPhotoAdjustment Namespace Reference

Classes

struct | PhotoAdjustmentProperties
class | PhotoAdjustmentRenderer
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataBinding Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DataBinding Namespace Reference

Classes

class | GeneratorIncrementalLoadingClass-g
class | IncrementalLoadingBase
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocketSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DatagramSocketSample Namespace Reference

Classes

class | LocalHostItem
Helper class describing a NetworkAdapter and its associated IP address. More...
class | RemotePeer
Helper class used to identify and respond to a remote peer. More...
class | Scenario1
A page for first scenario. More...
class | Scenario2
A page for second scenario. More...
class | Scenario3
A page for third scenario. More...
class | Scenario4
A page for fourth scenario. More...
class | Scenario5
A page for fifth scenario. More...
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataVirtualizationSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DataVirtualizationSample Namespace Reference

Classes

class | CacheChangedEventArgs-g
class | FileDataSource
A custom datasource over the file system that supports data virtualization. More...
class | FileDataSource2
A custom datasource over the file system that supports data virtualization. More...
class | FileItem
Represents a file and its properties. More...
class | ItemCacheManager-g
class | ItemIndexRangeExtensions
class | ItemIndexRangeList
Represents a sorted collection of discontiguous ItemIndexRanges. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Desfire Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Desfire Namespace Reference

Classes

class | AccessHandler
Access handler class for Desfire based ICC. More...
class | CardDetails
Class hodls Desfire card details information. More...
class | DesfireCommand
Class DesfireCommand extends the Iso7816.ApduCommand and provides mappings to Iso7816 command fields. More...
class | DesfireResponse
Class DesfireResponse extends the Iso7816.ApduResponse. More...
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DirectX Namespace Reference

  • Namespace List
  • Namespace Members
Enumerations | Functions

DirectX Namespace Reference

Enumerations

enum DDS_ALPHA_MODE {
DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4
}

Functions

HRESULT | CreateDDSTextureFromFile (_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFile (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_z_ const wchar_t *szFileName, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFileEx (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_z_ const wchar_t *szFileName, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFileEx (_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)

Enumeration Type Documentation

enum DDS_ALPHA_MODE
Enumerator:
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM

Definition at line 52 of file DDSTextureLoader.h.

    {
        DDS_ALPHA_MODE_UNKNOWN       = 0,
        DDS_ALPHA_MODE_STRAIGHT      = 1,
        DDS_ALPHA_MODE_PREMULTIPLIED = 2,
        DDS_ALPHA_MODE_OPAQUE        = 3,
        DDS_ALPHA_MODE_CUSTOM        = 4,
    };

Function Documentation

HRESULT DirectX::CreateDDSTextureFromFile | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_z_ const wchar_t * | szFileName,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromFile | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_opt_ ID3D11DeviceContext * | d3dContext,
 |  | _In_z_ const wchar_t * | szFileName,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromFileEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_opt_ ID3D11DeviceContext * | d3dContext,
 |  | _In_z_ const wchar_t * | szFileName,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromFileEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_z_ const wchar_t * | szFileName,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromMemory | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromMemory | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_opt_ ID3D11DeviceContext * | d3dContext,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromMemoryEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_opt_ ID3D11DeviceContext * | d3dContext,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
HRESULT DirectX::CreateDDSTextureFromMemoryEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ DDS_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayMetrics Namespace Reference

  • Namespace List
  • Namespace Members

DisplayMetrics Namespace Reference

Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplaySizeHelper Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DisplaySizeHelper Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DragAndDropSampleManaged Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DragAndDropSampleManaged Namespace Reference

Classes

class | Scenario1_ListView
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_DragUICustomization
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_StartDragAsync
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorTextRenderer Namespace Reference

  • Namespace List
  • Namespace Members
Classes

DWriteColorTextRenderer Namespace Reference

Classes

class | CustomTextRenderer
class | DWriteColorTextRendererMain
class | DWriteColorTextRendererRenderer
class | SampleOverlay
class | sealed
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFontImplementation Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

DWriteTextLayoutCloudFontImplementation Namespace Reference

Classes

class | FontNameCollector
class | Listener
class | sealed

Functions

public delegate void | FontDownloadCompletedHandler ()

Function Documentation

public delegate void DWriteTextLayoutCloudFontImplementation::FontDownloadCompletedHandler ( )
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutImplementation Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

DWriteTextLayoutImplementation Namespace Reference

Classes

class | sealed

Enumerations

enum | FontLineGapUsage { Default = DWRITE_LINE_SPACING_METHOD_DEFAULT, Disabled = DWRITE_FONT_LINE_GAP_USAGE_DISABLED, Enabled = DWRITE_FONT_LINE_GAP_USAGE_ENABLED }
enum | LineSpacingMethod { Default = DWRITE_LINE_SPACING_METHOD_DEFAULT, Uniform = DWRITE_LINE_SPACING_METHOD_UNIFORM, Proportional = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL }

Enumeration Type Documentation

enum FontLineGapUsage
Enumerator:
Default
Disabled
Enabled

Definition at line 39 of file TextLayout.h.

    {
        // Use default behavior for line gap usage. (This is different
        // for GDI-compatible text layout than for normal text layout.)
        Default = DWRITE_FONT_LINE_GAP_USAGE_DEFAULT,

        // The font line gap is excluded from line spacing.
        Disabled = DWRITE_FONT_LINE_GAP_USAGE_DISABLED,

        // The font line gap is included in line spacing.
        Enabled = DWRITE_FONT_LINE_GAP_USAGE_ENABLED
    };

enum LineSpacingMethod
Enumerator:
Default
Uniform
Proportional

Definition at line 18 of file TextLayout.h.

    {
        // Default line spacing depends solely on the content, growing
        // to accommodate the size of fonts and inline objects.
        Default = DWRITE_LINE_SPACING_METHOD_DEFAULT,

        // Uniform line spacing: the spacing of all lines is determined by
        // values provided by the app in a DWRITE_LINE_SPACING structure.
        // One use of uniform spacing is to avoid the uneven appearance
        // that can occur from font fallback.
        Uniform = DWRITE_LINE_SPACING_METHOD_UNIFORM,

        // Proportional line spacing: the spacing and baseline distances
        // are based on the computed values based on the content, as with
        // default spacing, but adjusted proportionally by scaling factors
        // you provide in a DWRITE_LINE_SPACING structure.
        Proportional = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL
    };

Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DX Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations | Functions

DX Namespace Reference

Classes

class | BaseControl
class | BaseElement
class | Button
class | CameraResources
class | DeviceResources
struct | ElementMargin
class | Ellipse
class | ExitButton
class | FilledEllipse
class | FilledRectangle
class | FocusableElement
class | GpuPerformanceTimer
class | Line
struct | MeshGeometry
class | PlayPauseButton
class | Rectangle
class | Resource
class | SeekBarElement
class | StepTimer
class | Text
struct | TextureData
struct | ViewProjectionConstantBuffer

Enumerations

enum | ButtonShape { Rectangle, Circle }
enum | ButtonState { None, Pressing, Pressed }
enum | GeometryShaderIndex { GeometryShader_Simple = 0, GeometryShader_Texture, GeometryShader_Max }
enum | PixelShaderIndex { PixelShader_Simple = 0, PixelShader_Cursor, PixelShader_Texture, PixelShader_Max }
enum TextureIndex {
Texture_Cursor = 0, Texture_Init, Texture_Hologram, Texture_SysAudio,
Texture_Photo, Texture_Video, Texture_Max
}
enum | VertexShaderIndex { VertexShader_Simple = 0, VertexShader_Texture, VertexShader_Max }

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels)
float | ConvertPixelsToDips (float pixels, float dpi)
D2D1_COLOR_F | ConvertToColorF (Windows::UI::Color color)
template<typename ObjectType , typename... Args>
concurrency::task< void > | CreateAndInitializeAsync (std::shared_ptr< ObjectType > &target, Args &&...args)
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		CreateBuffer (ID3D11Device *device, const size_t size, const void *buffer=nullptr, std::optional< UINT > bindFlags=std::nullopt, std::optional< D3D11_USAGE > usage=std::nullopt, std::optional< UINT > cpuFlags=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		CreateDepthStencilView (ID3D11Texture2D *texture, std::optional< DXGI_FORMAT > format=std::nullopt)
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface | CreateDepthTextureInteropObject (const Microsoft::WRL::ComPtr< ID3D11Texture2D > spTexture2D)
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		CreateInputLayout (ID3D11Device *device, const D3D11_INPUT_ELEMENT_DESC *vertexDesc, size_t vertexDescCount, const void *vertexShaderData, size_t vertexShaderDataSize)
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		CreatePixelShader (ID3D11Device *device, const void *data, size_t dataSize)
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		CreateRenderTargetView (ID3D11Texture2D *texture)
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		CreateSamplerState (ID3D11Device *device, const D3D11_SAMPLER_DESC &samplerDesc=CD3D11_SAMPLER_DESC{CD3D11_DEFAULT{}})
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		CreateShaderResourceView (ID3D11Texture2D *texture, std::optional< DXGI_FORMAT > format=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		CreateTexture (ID3D11Device *device, UINT width, UINT height, DXGI_FORMAT format, std::optional< TextureData > textureData=std::nullopt, std::optional< UINT > bindFlags=std::nullopt, std::optional< D3D11_USAGE > usage=std::nullopt, std::optional< UINT > cpuFlags=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		CreateVertexShader (ID3D11Device *device, const void *data, size_t dataSize)
HRESULT | CreateWICTextureFromMemory (ID3D11Device *d3dDevice, const uint8_t *wicData, size_t wicDataSize, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, size_t maxsize=0)
HRESULT | CreateWICTextureFromMemoryEx (ID3D11Device *d3dDevice, const uint8_t *wicData, size_t wicDataSize, size_t maxsize, D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView)
int | DipsToPixels (float size, float dpi)
int | DipsToPixelsCeil (float size, float dpi)
int | DipsToPixelsFloor (float size, float dpi)
DirectX::XMFLOAT4 | GetDXColor (Windows::UI::Color color)
DXGI_FORMAT | GetDxgiFormat ()
DirectX::XMVECTOR | GetQuaternionVectorFromRay (Windows::Foundation::Numerics::float3 forward, Windows::Foundation::Numerics::float3 up)
float | PixelsToDips (int size, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
std::future< std::vector< byte > > | ReadDataAsync (const std::wstring_view &filename)
static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
void | ThrowIfFailed (HRESULT hr)

Enumeration Type Documentation

enum ButtonShape
Enumerator:
Rectangle
Circle

Definition at line 6 of file Controls.h.

    {
        Rectangle,
        Circle,
    };

enum ButtonState
Enumerator:
None
Pressing
Pressed

Definition at line 12 of file Controls.h.

    {
        None,
        Pressing,
        Pressed
    };

enum GeometryShaderIndex
Enumerator:
GeometryShader_Simple
GeometryShader_Texture
GeometryShader_Max

Definition at line 24 of file DeviceResources.h.

    {
        GeometryShader_Simple = 0,
        GeometryShader_Texture,
        GeometryShader_Max
    } GeometryShaderIndex;

enum PixelShaderIndex
Enumerator:
PixelShader_Simple
PixelShader_Cursor
PixelShader_Texture
PixelShader_Max

Definition at line 16 of file DeviceResources.h.

    {
        PixelShader_Simple = 0,
        PixelShader_Cursor,
        PixelShader_Texture,
        PixelShader_Max
    } PixelShaderIndex;

enum TextureIndex
Enumerator:
Texture_Cursor
Texture_Init
Texture_Hologram
Texture_SysAudio
Texture_Photo
Texture_Video
Texture_Max

Definition at line 31 of file DeviceResources.h.

    {
        Texture_Cursor = 0,
        Texture_Init,
        Texture_Hologram,
        Texture_SysAudio,
        Texture_Photo,
        Texture_Video,
        Texture_Max
    } TextureIndex;

enum VertexShaderIndex
Enumerator:
VertexShader_Simple
VertexShader_Texture
VertexShader_Max

Definition at line 9 of file DeviceResources.h.

    {
        VertexShader_Simple = 0,
        VertexShader_Texture,
        VertexShader_Max
    } VertexShaderIndex;

Function Documentation

float ConvertDipsToPixels | ( | float | dips,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 33 of file DirectXHelper.h.

    {
        constexpr float dipsPerInch = 96.0f;
        return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
    }

float ConvertPixelsToDips ( float pixels ) [inline]

Definition at line 31 of file DirectXSample.h.

    {
        static const float dipsPerInch = 96.0f;
        return pixels * dipsPerInch / Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi; // Do not round.
    }

float ConvertPixelsToDips | ( | float | pixels,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 39 of file DirectXSample.h.

    {
        static const float dipsPerInch = 96.0f;
        return pixels * dipsPerInch / dpi; // Do not round.
    }

D2D1_COLOR_F ConvertToColorF ( Windows::UI::Color color ) [inline]

Definition at line 26 of file DirectXHelper.h.

    {

concurrency::task<void> DX::CreateAndInitializeAsync | ( | std::shared_ptr< ObjectType > & | target,
 |  | Args &&... | args
 | ) |  |

Definition at line 122 of file DeviceResources.h.

    {
        // Forward the arguments to std::make_shared, which will call the ObjectType's matching constructor
        target = std::make_shared<ObjectType>(std::forward<Args>(args)...);

        // Then we initialize the resources asynchronously
        return target->CreateDeviceDependentResourcesAsync();
    }

ComPtr< ID3D11Buffer > CreateBuffer | ( | ID3D11Device * | device,
 |  | const size_t | size,
 |  | const void * | buffer = nullptr,
 |  | std::optional< UINT > | bindFlags = std::nullopt,
 |  | std::optional< D3D11_USAGE > | usage = std::nullopt,
 |  | std::optional< UINT > | cpuFlags = std::nullopt
 | ) |  |

Definition at line 120 of file DirectXHelper.cpp.

{
    if (size > std::numeric_limits<UINT>::max())
    {
        throw std::invalid_argument("size is larger than UINT");
    }

    const CD3D11_BUFFER_DESC desc{
        static_cast<UINT>(size),
        bindFlags.value_or(D3D11_BIND_CONSTANT_BUFFER),
        usage.value_or(D3D11_USAGE_DEFAULT),
        cpuFlags.value_or(0x0),
    };

    const D3D11_SUBRESOURCE_DATA data{
        buffer,
        0u,
        0u
    };

    const D3D11_SUBRESOURCE_DATA* pData = (buffer) ? &data : nullptr;

    ComPtr<ID3D11Buffer> result;
    DX::ThrowIfFailed(device->CreateBuffer(&desc, pData, &result));
    return result;
}

ComPtr< ID3D11DepthStencilView > CreateDepthStencilView | ( | ID3D11Texture2D * | texture,
 |  | std::optional< DXGI_FORMAT > | format = std::nullopt
 | ) |  |

Definition at line 187 of file DirectXHelper.cpp.

{
    ComPtr<ID3D11Device> device;
    texture->GetDevice(&device);

    const CD3D11_DEPTH_STENCIL_VIEW_DESC desc{
        texture,
        D3D11_DSV_DIMENSION_TEXTURE2D,
        format.value_or(DXGI_FORMAT_UNKNOWN)
    };

    ComPtr<ID3D11DepthStencilView> result;
    DX::ThrowIfFailed(device->CreateDepthStencilView(texture, &desc, &result));
    return result;
}

winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface DX::CreateDepthTextureInteropObject ( const Microsoft::WRL::ComPtr< ID3D11Texture2D > spTexture2D ) [inline]

Definition at line 26 of file DirectXHelper.h.

    {
        // Direct3D interop APIs are used to provide the buffer to the WinRT API.
        Microsoft::WRL::ComPtr<IDXGIResource1> depthStencilResource;
        winrt::check_hresult(spTexture2D.As(&depthStencilResource));
        Microsoft::WRL::ComPtr<IDXGISurface2> depthDxgiSurface;
        winrt::check_hresult(depthStencilResource->CreateSubresourceSurface(0, &depthDxgiSurface));
        winrt::com_ptr<::IInspectable> inspectableSurface;
        winrt::check_hresult(
            CreateDirect3D11SurfaceFromDXGISurface(
                depthDxgiSurface.Get(),
                inspectableSurface.put()
            ));

        return inspectableSurface.as<winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface>();
    }

ComPtr< ID3D11InputLayout > CreateInputLayout | ( | ID3D11Device * | device,
 |  | const D3D11_INPUT_ELEMENT_DESC * | vertexDesc,
 |  | size_t | vertexDescCount,
 |  | const void * | vertexShaderData,
 |  | size_t | vertexShaderDataSize
 | ) |  |

Definition at line 47 of file DirectXHelper.cpp.

{
    if (vertexShaderDataSize > std::numeric_limits<UINT>::max() ||
        vertexDescCount > std::numeric_limits<UINT>::max())
    {
        throw std::invalid_argument("size is larger than UINT");
    }

    ComPtr<ID3D11InputLayout> result;
    DX::ThrowIfFailed(device->CreateInputLayout(
        vertexDesc,
        static_cast<UINT>(vertexDescCount),
        vertexShaderData,
        static_cast<UINT>(vertexShaderDataSize),
        &result));

    return result;
}

ComPtr< ID3D11PixelShader > CreatePixelShader | ( | ID3D11Device * | device,
 |  | const void * | data,
 |  | size_t | dataSize
 | ) |  |

Definition at line 27 of file DirectXHelper.cpp.

{
    if (dataSize > std::numeric_limits<UINT>::max())
    {
        throw std::invalid_argument("size is larger than UINT");
    }

    ComPtr<ID3D11PixelShader> result;
    DX::ThrowIfFailed(device->CreatePixelShader(
        data,
        static_cast<UINT>(dataSize),
        nullptr,
        &result));

    return result;
}

ComPtr< ID3D11RenderTargetView > CreateRenderTargetView ( ID3D11Texture2D * texture )

Definition at line 171 of file DirectXHelper.cpp.

{
    ComPtr<ID3D11Device> device;
    texture->GetDevice(&device);

    const CD3D11_RENDER_TARGET_VIEW_DESC desc{
        texture,
        D3D11_RTV_DIMENSION_TEXTURE2D
    };

    ComPtr<ID3D11RenderTargetView> result;
    DX::ThrowIfFailed(device->CreateRenderTargetView(texture, &desc, &result));
    return result;
}

Microsoft::WRL::ComPtr<ID3D11SamplerState> DX::CreateSamplerState ( ID3D11Device * device )
ComPtr< ID3D11ShaderResourceView > CreateShaderResourceView | ( | ID3D11Texture2D * | texture,
 |  | std::optional< DXGI_FORMAT > | format = std::nullopt
 | ) |  |

Definition at line 153 of file DirectXHelper.cpp.

{
    ComPtr<ID3D11Device> device;
    texture->GetDevice(&device);

    const CD3D11_SHADER_RESOURCE_VIEW_DESC desc{
        texture,
        D3D11_SRV_DIMENSION_TEXTURE2D,
        format.value_or(DXGI_FORMAT_UNKNOWN)
    };

    ComPtr<ID3D11ShaderResourceView> result;
    DX::ThrowIfFailed(device->CreateShaderResourceView(texture, &desc, &result));
    return result;
}

Microsoft::WRL::ComPtr<ID3D11Texture2D> DX::CreateTexture | ( | ID3D11Device * | device,
 |  | UINT | width,
 |  | UINT | height,
 |  | DXGI_FORMAT | format,
 |  | std::optional< TextureData > | textureData = std::nullopt,
 |  | std::optional< UINT > | bindFlags = std::nullopt,
 |  | std::optional< D3D11_USAGE > | usage = std::nullopt,
 |  | std::optional< UINT > | cpuFlags = std::nullopt
 | ) |  |
ComPtr< ID3D11VertexShader > CreateVertexShader | ( | ID3D11Device * | device,
 |  | const void * | data,
 |  | size_t | dataSize
 | ) |  |

Definition at line 7 of file DirectXHelper.cpp.

{
    if (dataSize > std::numeric_limits<UINT>::max())
    {
        throw std::invalid_argument("size is larger than UINT");
    }

    ComPtr<ID3D11VertexShader> result;
    DX::ThrowIfFailed(device->CreateVertexShader(
        data,
        static_cast<UINT>(dataSize),
        nullptr,
        &result));

    return result;
}

HRESULT CreateWICTextureFromMemory | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | wicData,
 |  | size_t | wicDataSize,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | size_t | maxsize = 0
 | ) |  |

Definition at line 641 of file DirectXHelper.cpp.

{
    return CreateWICTextureFromMemoryEx(d3dDevice, wicData, wicDataSize, maxsize,
                                        D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
                                        texture, textureView);
}

HRESULT CreateWICTextureFromMemoryEx | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | wicData,
 |  | size_t | wicDataSize,
 |  | size_t | maxsize,
 |  | D3D11_USAGE | usage,
 |  | unsigned int | bindFlags,
 |  | unsigned int | cpuAccessFlags,
 |  | unsigned int | miscFlags,
 |  | bool | forceSRGB,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView
 | ) |  |

Definition at line 575 of file DirectXHelper.cpp.

{
    if (texture)
    {
        *texture = nullptr;
    }
    if (textureView)
    {
        *textureView = nullptr;
    }

    if (!d3dDevice || !wicData || (!texture && !textureView))
        return E_INVALIDARG;

    if (!wicDataSize)
        return E_FAIL;

#ifdef _WIN64
    if (wicDataSize > 0xFFFFFFFF)
        return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
#endif

    IWICImagingFactory* pWIC = _GetWIC();
    if (!pWIC)
        return E_NOINTERFACE;

    // Create input stream for memory
    ComPtr<IWICStream> stream;
    HRESULT hr = pWIC->CreateStream(stream.GetAddressOf());
    if (FAILED(hr))
        return hr;

    hr = stream->InitializeFromMemory(const_cast<uint8_t*>(wicData), static_cast<DWORD>(wicDataSize));
    if (FAILED(hr))
        return hr;

    // Initialize WIC
    ComPtr<IWICBitmapDecoder> decoder;
    hr = pWIC->CreateDecoderFromStream(stream.Get(), 0, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf());
    if (FAILED(hr))
        return hr;

    ComPtr<IWICBitmapFrameDecode> frame;
    hr = decoder->GetFrame(0, frame.GetAddressOf());
    if (FAILED(hr))
        return hr;

    hr = CreateTextureFromWIC(d3dDevice, nullptr,
                              frame.Get(), maxsize,
                              usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
                              texture, textureView);

    return hr;
}

int DX::DipsToPixels | ( | float | size,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 32 of file DirectXHelper.h.

    {

int DX::DipsToPixelsCeil | ( | float | size,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 37 of file DirectXHelper.h.

    {

int DX::DipsToPixelsFloor | ( | float | size,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 42 of file DirectXHelper.h.

    {

DirectX::XMFLOAT4 DX::GetDXColor ( Windows::UI::Color color ) [inline]

Definition at line 61 of file DirectXHelper.h.

    {
        return DirectX::XMFLOAT4(
            static_cast<float>(color.R) / 255.0f,
            static_cast<float>(color.G) / 255.0f,
            static_cast<float>(color.B) / 255.0f,
            static_cast<float>(color.A) / 255.0f);
    }

DXGI_FORMAT DX::GetDxgiFormat ( ) [inline]

Definition at line 70 of file DirectXHelper.h.

    {
        return sizeof(VertexIndex_t) == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT;
    }

DirectX::XMVECTOR DX::GetQuaternionVectorFromRay | ( | Windows::Foundation::Numerics::float3 | forward,
 |  | Windows::Foundation::Numerics::float3 | up |
 | ) |  |  | [inline]

Definition at line 75 of file DirectXHelper.h.

    {
        Windows::Foundation::Numerics::float3 right;
        DirectX::XMStoreFloat3(&right, DirectX::XMVector3Cross(DirectX::XMLoadFloat3(&forward), DirectX::XMLoadFloat3(&up)));
        // Create the matrix switching from current coordinatesystem to right, up, backwards
        const DirectX::XMMATRIX orientationMatrix = DirectX::XMMatrixSet(
            right.x, right.y, right.z, 0.0f,
            up.x, up.y, up.z, 0.0f,
            -forward.x, -forward.y, -forward.z, 0.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        );
        // And return the associated quaternion
        return DirectX::XMQuaternionRotationMatrix(orientationMatrix);
    }

float DX::PixelsToDips | ( | int | size,
 |  | float | dpi |
 | ) |  |  | [inline]

Definition at line 47 of file DirectXHelper.h.

    {

Concurrency::task< std::vector< byte > > ReadDataAsync ( const std::wstring & filename ) [inline]

Definition at line 17 of file DirectXHelper.h.

    {
        using namespace Windows::Storage;
        using namespace Concurrency;

        return create_task(PathIO::ReadBufferAsync(Platform::StringReference(filename.c_str()))).then(
            [] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
            {
                std::vector<byte> returnBuffer;
                returnBuffer.resize(fileBuffer->Length);
                Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), static_cast<unsigned int>(returnBuffer.size())));
                return returnBuffer;
            });
    }

std::future<std::vector<byte> > DX::ReadDataAsync ( const std::wstring_view & filename ) [inline]

Definition at line 6 of file DirectXHelper.h.

    {
        using namespace winrt::Windows::Storage;
        using namespace winrt::Windows::Storage::Streams;

        IBuffer fileBuffer = co_await PathIO::ReadBufferAsync(filename);

        std::vector<byte> returnBuffer;
        returnBuffer.resize(fileBuffer.Length());
        DataReader::FromBuffer(fileBuffer).ReadBytes(winrt::array_view<uint8_t>(returnBuffer));
        return returnBuffer;
    }

static_assert | ( | (sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
void ThrowIfFailed ( HRESULT hr ) [inline]

Definition at line 7 of file DirectXHelper.h.

    {
        if (FAILED(hr))
        {
            // Set a breakpoint on this line to catch Win32 API errors.
            throw Platform::Exception::CreateException(hr);
        }
    }

Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EdpSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

EdpSample Namespace Reference

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario10_CpToClipboard
class | Scenario11_CPDNoUI
class | Scenario12_ShareData
class | Scenario13_ShareTarget
class | Scenario14_QueryCpPaste
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario15_DPLCreateFileEvents
Registering a background task and notification channel for raw notifications. More...
class | Scenario16_NetworkResource
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5
class | Scenario6
class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8_ClipboardSource
class | Scenario9_ClipboardTarget
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ELS Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Functions

ELS Namespace Reference

Namespaces

namespace | Private

Functions

template<typename Lambda >
void | RecognizeTextLanguages (wchar_t const *text, DWORD length, Lambda &&callback)
template<typename Lambda >
void | RecognizeTextScripts (wchar_t const *text, DWORD length, Lambda &&callback)
template<typename Lambda >
void | TransliterateFromCyrillicToLatin (wchar_t const *text, DWORD length, Lambda &&callback)

Function Documentation

void ELS::RecognizeTextLanguages | ( | wchar_t const * | text,
 |  | DWORD | length,
 |  | Lambda && | callback
 | ) |  |

Definition at line 43 of file elsutil.h.

    {
        if (length == 0) return;

        Private::unique_bag bag;
        Private::MappingRecognizeTextFromService(ELS_GUID_LANGUAGE_DETECTION, text, length, bag);

        for (auto pos = reinterpret_cast<wchar_t const*>(bag.prgResultRanges[0].pData); *pos; pos += (wcslen(pos) + 1))
        {
            callback(pos);
        }
    }

void ELS::RecognizeTextScripts | ( | wchar_t const * | text,
 |  | DWORD | length,
 |  | Lambda && | callback
 | ) |  |

Definition at line 57 of file elsutil.h.

    {
        if (length == 0) return;

        Private::unique_bag bag;
        Private::MappingRecognizeTextFromService(ELS_GUID_SCRIPT_DETECTION, text, length, bag);

        for (DWORD rangeIndex = 0; rangeIndex < bag.dwRangesCount; ++rangeIndex)
        {
            callback(bag.prgResultRanges[rangeIndex].dwStartIndex, bag.prgResultRanges[rangeIndex].dwEndIndex,
                reinterpret_cast<wchar_t const*>(bag.prgResultRanges[rangeIndex].pData));
        }
    }

void ELS::TransliterateFromCyrillicToLatin | ( | wchar_t const * | text,
 |  | DWORD | length,
 |  | Lambda && | callback
 | ) |  |

Definition at line 72 of file elsutil.h.

    {
        Private::unique_bag bag;
        Private::MappingRecognizeTextFromService(ELS_GUID_TRANSLITERATION_CYRILLIC_TO_LATIN, text, length, bag);
        callback(reinterpret_cast<wchar_t const*>(bag.prgResultRanges[0].pData), bag.prgResultRanges[0].dwDataSize / sizeof(wchar_t));
    }

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ELS::Private Namespace Reference

  • Namespace List
  • Namespace Members
  • ELS
  • Private
Classes | Functions

ELS::Private Namespace Reference

Classes

struct | unique_bag
struct | unique_services

Functions

void | MappingRecognizeTextFromService (REFGUID service, wchar_t const *text, DWORD length, unique_bag &bag)

Function Documentation

void ELS::Private::MappingRecognizeTextFromService | ( | REFGUID | service,
 |  | wchar_t const * | text,
 |  | DWORD | length,
 |  | unique_bag & | bag |
 | ) |  |  | [inline]

Definition at line 25 of file elsutil.h.

    {
        MAPPING_ENUM_OPTIONS EnumOptions = {};
        EnumOptions.Size = sizeof(EnumOptions);
        EnumOptions.pGuid = const_cast<GUID*>(&service);

        DWORD dwServicesCount = 0;
        unique_services services;
        winrt::check_hresult(MappingGetServices(&EnumOptions, &services, &dwServicesCount));

        bag.Size = sizeof(bag);
        winrt::check_hresult(MappingRecognizeText(services, text, length, 0, nullptr, &bag));
    }

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FaceDetection Namespace Reference

  • Namespace List
  • Namespace Members
Classes

FaceDetection Namespace Reference

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Felica Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Felica Namespace Reference

Classes

class | AccessHandler
Access handler class for Felica based ICC. More...
class | ApduResponse
Felica response APDU. More...
class | Check
Felica Check command when sent to the card the card is expected to read the byte of blocks specified in the block list. More...
class | GetHistoricalBytes
Felica GetHistoricalBytes command. More...
class | GetUid
Felica GetUid command. More...
class | Update
Felica Update command when sent to the card the card is expected to write the byte of blocks specified in the block list. More...
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts Namespace Reference

  • Namespace List
  • Namespace Members
Classes

FilePickerContracts Namespace Reference

Classes

class | CachedFileUpdater_Local
An empty page that can be used on its own or navigated to within a Frame. More...
class | CachedFileUpdater_Remote
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileOpenPicker_PickAppFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileOpenPicker_PickCachedFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileOpenPicker_PickURLFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePicker_FailToSave
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePicker_SaveToAppStorage
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePicker_SaveToCachedFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPage_CachedFile
class | MainPage_PickFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPage_SaveFile
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContractsTasks Namespace Reference

  • Namespace List
  • Namespace Members
Classes

FilePickerContractsTasks Namespace Reference

Classes

class UpdateFileTask
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FocusVisualsSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

FocusVisualsSample Namespace Reference

Classes

class | CustomControlUsage
An empty page that can be used on its own or navigated to within a Frame. More...
class | CustomFocusVisuals
An empty page that can be used on its own or navigated to within a Frame. More...
class | SocialMediaCounter
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameConstants Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

GameConstants Namespace Reference

Namespaces

namespace | Physics
namespace | Sound
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameConstants::Physics Namespace Reference

  • Namespace List
  • Namespace Members
  • GameConstants
  • Physics

GameConstants::Physics Namespace Reference

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameConstants::Sound Namespace Reference

  • Namespace List
  • Namespace Members
  • GameConstants
  • Sound

GameConstants::Sound Namespace Reference

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameControl Namespace Reference

  • Namespace List
  • Namespace Members
Enumerations

GameControl Namespace Reference

Enumerations

enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}

Enumeration Type Documentation

enum GameInfoOverlayState
Enumerator:
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause

Definition at line 72 of file GameMain.h.

    {
        Loading,
        GameStats,
        GameOverExpired,
        GameOverCompleted,
        LevelStart,
        Pause,
    };

enum GameInfoOverlayState
Enumerator:
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause

Definition at line 72 of file GameMain.h.

    {
        Loading,
        GameStats,
        GameOverExpired,
        GameOverCompleted,
        LevelStart,
        Pause,
    };

enum GameInfoOverlayState
Enumerator:
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause
Loading
GameStats
GameOverExpired
GameOverCompleted
LevelStart
Pause

Definition at line 67 of file GameMain.h.

    {
        Loading,
        GameStats,
        GameOverExpired,
        GameOverCompleted,
        LevelStart,
        Pause,
    };

enum PressResultState
Enumerator:
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel

Definition at line 65 of file GameMain.h.

    {
        LoadGame,
        PlayLevel,
        ContinueLevel,
    };

enum PressResultState
Enumerator:
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel

Definition at line 60 of file GameMain.h.

    {
        LoadGame,
        PlayLevel,
        ContinueLevel,
    };

enum PressResultState
Enumerator:
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel
LoadGame
PlayLevel
ContinueLevel

Definition at line 65 of file GameMain.h.

    {
        LoadGame,
        PlayLevel,
        ContinueLevel,
    };

enum UpdateEngineState
Enumerator:
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated

Definition at line 54 of file GameMain.h.

    {
        WaitingForResources,
        ResourcesLoaded,
        WaitingForPress,
        Dynamics,
        TooSmall,
        Suspended,
        Deactivated,
    };

enum UpdateEngineState
Enumerator:
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated

Definition at line 54 of file GameMain.h.

    {
        WaitingForResources,
        ResourcesLoaded,
        WaitingForPress,
        Dynamics,
        TooSmall,
        Suspended,
        Deactivated,
    };

enum UpdateEngineState
Enumerator:
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated
WaitingForResources
ResourcesLoaded
WaitingForPress
Dynamics
TooSmall
Suspended
Deactivated

Definition at line 49 of file GameMain.h.

    {
        WaitingForResources,
        ResourcesLoaded,
        WaitingForPress,
        Dynamics,
        TooSmall,
        Suspended,
        Deactivated,
    };

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameInfoOverlayConstant Namespace Reference

  • Namespace List
  • Namespace Members

GameInfoOverlayConstant Namespace Reference

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GameUIConstants Namespace Reference

  • Namespace List
  • Namespace Members

GameUIConstants Namespace Reference

Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GyrometerCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

GyrometerCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
class | Scenario3_Porting
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicApp2 Namespace Reference

  • Namespace List
  • Namespace Members
Classes

HolographicApp2 Namespace Reference

Classes

class HolographicApp1Main
Updates, renders, and presents holographic content using Direct3D. More...
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracker Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

HolographicFaceTracker Namespace Reference

Classes

struct | CubeModelConstantBuffer
class | FaceTrackerProcessor
class | HolographicFaceTrackerMain
class | NV12VideoTexture
struct | QuadModelConstantBuffer
class | QuadRenderer
class | sealed
class | SpinningCubeRenderer
class | TextRenderer
struct | VertexPositionColor
struct | VertexPositionTex
class | VideoFrameProcessor

Functions

static_assert ((sizeof(CubeModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(QuadModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

HolographicFaceTracker::static_assert | ( | (sizeof(CubeModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
HolographicFaceTracker::static_assert | ( | (sizeof(QuadModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMRCSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations | Functions

HolographicMRCSample Namespace Reference

Classes

class | Button
class | ControlBase
class | Cursor
class | HolographicMRCSampleMain
class | IControl
class | MediaCaptureManager
struct | ModelColorConstantBuffer
struct | ModelConstantBuffer
class | Panel
class | sealed
class | SpatialInputHandler
class | SpinningCubeRenderer
struct | VertexPosition
struct | VertexPositionColor
struct | VertexPositionTexture

Enumerations

enum | ControlType { Control_Unknown = 0, Control_Panel, Control_Button, Control_CameraPreview }

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ModelColorConstantBuffer)%(sizeof(float)*4))==0,"Model color constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Enumeration Type Documentation

enum ControlType
Enumerator:
Control_Unknown
Control_Panel
Control_Button
Control_CameraPreview

Definition at line 10 of file IControl.h.

    {
        Control_Unknown = 0,
        Control_Panel,
        Control_Button,
        Control_CameraPreview
    } ControlType;

Function Documentation

HolographicMRCSample::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
HolographicMRCSample::static_assert | ( | (sizeof(ModelColorConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model color constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicPaint Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations | Functions | Variables

HolographicPaint Namespace Reference

Classes

class | ClearTool
class | HandHandler
class | HolographicPaintMain
class | IDPadHelper
struct | ModelConstantBuffer
class | RenderingHelper
class | sealed
class | SourceHandler
class | SpatialControllerHandler
class | Stroke
class | ThumbstickDPadHelper
class | Tool
class | ToolCarousel
class | TouchpadDPadHelper
struct | VertexPosition

Enumerations

enum | ApplicationMode { Drawing, ChooseTool }
enum DPadAction {
None, Left, Right, Top,
Bottom
}
enum | HandAssignment { Unknown, LeftHand, RightHand }
enum | RotationDirection { RotateLeft = -1, RotateRight = 1 }

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Variables

constexpr unsigned int | AnyHandSourceId = static_cast<unsigned int>(-2)
constexpr float | DefaultControllerScale = .05f
constexpr unsigned int | NoSourceId = static_cast<unsigned int>(-1)

Enumeration Type Documentation

enum ApplicationMode
Enumerator:
Drawing
ChooseTool

Definition at line 15 of file SourceHandler.h.

{ Drawing, ChooseTool };

enum DPadAction
Enumerator:
None
Left
Right
Top
Bottom

Definition at line 6 of file DPadHelper.h.

{ None, Left, Right, Top, Bottom };

enum HandAssignment
Enumerator:
Unknown
LeftHand
RightHand

Definition at line 17 of file SourceHandler.h.

{ Unknown, LeftHand, RightHand };

enum RotationDirection
Enumerator:
RotateLeft
RotateRight

Definition at line 8 of file ToolCarousel.h.

: int { RotateLeft = -1, RotateRight = 1 };

Function Documentation

HolographicPaint::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |

Variable Documentation

constexpr unsigned int AnyHandSourceId = static_cast<unsigned int>(-2)

Definition at line 11 of file SourceHandler.h.

constexpr float DefaultControllerScale = .05f

Definition at line 13 of file SourceHandler.h.

constexpr unsigned int NoSourceId = static_cast<unsigned int>(-1)

Definition at line 10 of file SourceHandler.h.

Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping Namespace Reference

  • Namespace List
  • Namespace Members
Classes

HolographicSpatialMapping Namespace Reference

Classes

class | HolographicSpatialMappingMain
class | sealed
class | SpatialInputHandler
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

HolographicSpatialStage Namespace Reference

Classes

class | HolographicSpatialStageMain
struct | ModelConstantBuffer
class | SceneController
class | SceneObject
class | sealed
class | SpatialStageManager
struct | VertexPositionColor

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

HolographicSpatialStage::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlongSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

HolographicTagAlongSample Namespace Reference

Classes

class | DistanceFieldRenderer
class | HolographicTagAlongSampleMain
struct | ModelConstantBuffer
class | QuadRenderer
class | sealed
class | SpatialInputHandler
class | TextRenderer
struct | VertexPositionColorTex

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

HolographicTagAlongSample::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

HolographicVoiceInput Namespace Reference

Classes

class | HolographicVoiceInputMain
struct | ModelColorConstantBuffer
class | sealed
class | SpatialInputHandler
class | SpinningCubeRenderer
struct | VertexPositionColor

Functions

static_assert ((sizeof(ModelColorConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

HolographicVoiceInput::static_assert | ( | (sizeof(ModelColorConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthenticationTask Namespace Reference

  • Namespace List
  • Namespace Members
Classes

HotspotAuthenticationTask Namespace Reference

Classes

class | AuthenticationTask
class | ConfigStore
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpFilters Namespace Reference

  • Namespace List
  • Namespace Members
Enumerations | Variables

HttpFilters Namespace Reference

Enumerations

enum | MeteredConnectionPriority { Low = 0, Medium, High }

Variables

runtimeclass | HttpMeteredConnectionFilter
runtimeclass | HttpRetryFilter
Boolean | OptIn

Enumeration Type Documentation

enum MeteredConnectionPriority
Enumerator:
Low
Medium
High

Definition at line 3 of file Project.idl.

    {
        Low = 0,
        Medium,
        High
    };

Variable Documentation

runtimeclass HttpMeteredConnectionFilter

Definition at line 17 of file Project.idl.

runtimeclass HttpRetryFilter

Definition at line 12 of file Project.idl.

Boolean OptIn

Definition at line 18 of file Project.idl.

Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ImportSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

ImportSample Namespace Reference

Classes

class | ImportableItemWrapper
Wrapper for the thumbnail and the ImportableItem. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InclinometerCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

InclinometerCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
class | Scenario3_Calibration
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Iso15693 Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Iso15693 Namespace Reference

Classes

class | AccessHandler
Access handler class for Iso15693 based ICC. More...
class | ApduResponse
Iso15693 response APDU. More...
class | GetHistoricalBytes
Iso15693 GetHistoricalBytes command. More...
class | GetUid
Iso15693 GetUid command. More...
class | Read
Iso15693 read command. More...
class | Write
Iso15693 write command. More...
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Iso7816 Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

Iso7816 Namespace Reference

Classes

class | ApduCommand
Class ApduCommand implments the ISO 7816 apdu commands. More...
class | ApduResponse
Class ApduResponse implments handler for the ISO 7816 apdu response. More...
class | SelectCommand
Class that implements select command. More...

Enumerations

enum Cla {
CompliantCmd0x = 0x00, AppCompliantCmdAx = 0xA0, ProprietaryCla8x = 0x80, ProprietaryCla9x = 0x90,
ReservedForPts = 0xFF
}
enum | ClaXx { NoSmOrNoSmIndication = 0x00, ProprietarySmFormat = 0x01, SecureMessageNoHeaderSM = 0x10, SecureMessage1p6 = 0x11 }
enum Ins {
EraseBinary = 0x0E, Verify = 0x20, ManageChannel = 0x70, ExternalAuthenticate = 0x82,
GetChallenge = 0x84, InternalAuthenticate = 0x88, SelectFile = 0xA4, ReadBinary = 0xB0,
ReadRecords = 0xB2, GetResponse = 0xC0, Envelope = 0xC2, GetData = 0xCA,
WriteBinary = 0xD0, WriteRecord = 0xD2, UpdateBinary = 0xD6, PutData = 0xDA,
UpdateData = 0xDC, AppendRecord = 0xE2
}

Enumeration Type Documentation

enum Cla

Enumeration of possible ISO 7816 Command.

Enumerator:
CompliantCmd0x
AppCompliantCmdAx
ProprietaryCla8x
ProprietaryCla9x
ReservedForPts

Definition at line 17 of file Iso7816Defs.cs.

                    : byte
    {
        CompliantCmd0x          = 0x00,
        AppCompliantCmdAx       = 0xA0,
        ProprietaryCla8x        = 0x80,
        ProprietaryCla9x        = 0x90,
        ReservedForPts          = 0xFF,           // Protocol Type Selelction
    }

enum ClaXx

Enumeration of lower nibbile of CLA.

Enumerator:
NoSmOrNoSmIndication
ProprietarySmFormat
SecureMessageNoHeaderSM
SecureMessage1p6

Definition at line 28 of file Iso7816Defs.cs.

                      : byte
    {
        NoSmOrNoSmIndication    = 0x00,
        ProprietarySmFormat     = 0x01,
        SecureMessageNoHeaderSM = 0x10,
        SecureMessage1p6        = 0x11,
    }

enum Ins

Enumeration of possible instructions.

Enumerator:
EraseBinary
Verify
ManageChannel
ExternalAuthenticate
GetChallenge
InternalAuthenticate
SelectFile
ReadBinary
ReadRecords
GetResponse
Envelope
GetData
WriteBinary
WriteRecord
UpdateBinary
PutData
UpdateData
AppendRecord

Definition at line 38 of file Iso7816Defs.cs.

                    : byte
    {
        EraseBinary             = 0x0E,
        Verify                  = 0x20,
        ManageChannel           = 0x70,
        ExternalAuthenticate    = 0x82,
        GetChallenge            = 0x84,
        InternalAuthenticate    = 0x88,
        SelectFile              = 0xA4,
        ReadBinary              = 0xB0,
        ReadRecords             = 0xB2,
        GetResponse             = 0xC0,
        Envelope                = 0xC2,
        GetData                 = 0xCA,
        WriteBinary             = 0xD0,
        WriteRecord             = 0xD2,
        UpdateBinary            = 0xD6,
        PutData                 = 0xDA,
        UpdateData              = 0xDC,
        AppendRecord            = 0xE2,
    }

Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Lamp Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Lamp Namespace Reference

Classes

class | Scenario1_GetLamp
Scenario 1 Get Lamp Page. More...
class | Scenario2_EnableSettings
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_AvailabilityChanged
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensorCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

LightSensorCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

LiveDash Namespace Reference

Namespaces

namespace | Models
namespace | Util

Classes

interface | ILivePlayer
class | LiveDashPlayer
class | LiveSourceBufferManager
This class extends a source buffer manager but handles cases for live playback such as setting a live offset and the logic to pick the next segment to play. More...
class | Player
This class manages the source buffers (audio and video) and takes care of setting the mse stream source on the media element. More...
class | SourceBufferManager
Handles the source buffer for each stream of data. More...
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash::Models Namespace Reference

  • Namespace List
  • Namespace Members
  • LiveDash
  • Models
Classes

LiveDash::Models Namespace Reference

Classes

class | Manifest
Represents a DASH manifest of type .mpd. More...
class | MediaSegment
Represents a media segment withing a media stream. More...
class | MediaSegmentInformation
class | MediaStream
Represents a stream of data, such as audio or video. More...
class | Period
Represents a period within a media presentation description. More...
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash::Util Namespace Reference

  • Namespace List
  • Namespace Members
  • LiveDash
  • Util
Classes

LiveDash::Util Namespace Reference

Classes

class | DashManifestParser
class | Downloader
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDashApp Namespace Reference

  • Namespace List
  • Namespace Members
Classes

LiveDashApp Namespace Reference

Classes

class | DASHEntry
class | LiveDashPlayer
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReaderSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MagneticStripeReaderSample Namespace Reference

Classes

class | Scenario1_BankCards
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_AamvaCards
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailApp Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Variables

MasterDetailApp Namespace Reference

Namespaces

namespace | Data
namespace | ViewModels

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | DetailPage
class | MasterDetailPage

Variables

runtimeclass | DetailPage
runtimeclass | MasterDetailPage

Variable Documentation

runtimeclass DetailPage

Definition at line 19 of file Project.idl.

runtimeclass MasterDetailPage

Definition at line 17 of file Project.idl.

Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailApp::Data Namespace Reference

  • Namespace List
  • Namespace Members
  • MasterDetailApp
  • Data
Classes

MasterDetailApp::Data Namespace Reference

Classes

class | Item
class | ItemsDataSource
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MasterDetailApp::ViewModels Namespace Reference

  • Namespace List
  • Namespace Members
  • MasterDetailApp
  • ViewModels
Classes

MasterDetailApp::ViewModels Namespace Reference

Classes

class ItemViewModel
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditingSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MediaEditingSample Namespace Reference

Classes

class | Scenario1_TrimAndSaveClip
class | Scenario2_AppendClips
class | Scenario3_AddAudioTracks
class | Scenario4_AddOverlays
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MFPoseTrackingPreview Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations | Functions

MFPoseTrackingPreview Namespace Reference

Classes

struct | PoseTrackingEntityData
struct | PoseTrackingFrameHeader
struct | TrackedPose

Enumerations

enum BodyPart {
SpineBase = 0, SpineMid = 1, Neck = 2, Head = 3,
ShoulderLeft = 4, ElbowLeft = 5, WristLeft = 6, HandLeft = 7,
ShoulderRight = 8, ElbowRight = 9, WristRight = 10, HandRight = 11,
HipLeft = 12, KneeLeft = 13, AnkleLeft = 14, FootLeft = 15,
HipRight = 16, KneeRight = 17, AnkleRight = 18, FootRight = 19,
SpineShoulder = 20, HandTipLeft = 21, ThumbLeft = 22, HandTipRight = 23,
ThumbRight = 24
}
enum | TrackingStatus { NotTracked = 0, Inferred = 1, Tracked = 2 }

Functions

DEFINE_GUID (MFPerceptionFormat_PoseTracking, 0x69232056, 0x2ed9, 0x4d0e, 0x89, 0xcc, 0x5d, 0x27, 0x34, 0xa5, 0x68, 0x8)
DEFINE_GUID (PoseSet_HandTracking, 0xf142c82c, 0x3a57, 0x4e7d, 0x81, 0x59, 0x98, 0xbd, 0xbd, 0x6c, 0xcf, 0xe2)
DEFINE_GUID (PoseSet_BodyTracking, 0x84520b1f, 0xab61, 0x46da, 0xab, 0x1d, 0xe0, 0x13, 0x40, 0xef, 0x88, 0x4e)

Enumeration Type Documentation

enum BodyPart
Enumerator:
SpineBase
SpineMid
Neck
Head
ShoulderLeft
ElbowLeft
WristLeft
HandLeft
ShoulderRight
ElbowRight
WristRight
HandRight
HipLeft
KneeLeft
AnkleLeft
FootLeft
HipRight
KneeRight
AnkleRight
FootRight
SpineShoulder
HandTipLeft
ThumbLeft
HandTipRight
ThumbRight

Definition at line 26 of file MFPoseTrackingFrame.h.

                        : int32_t {
        SpineBase = 0,
        SpineMid = 1,
        Neck = 2,
        Head = 3,
        ShoulderLeft = 4,
        ElbowLeft = 5,
        WristLeft = 6,
        HandLeft = 7,
        ShoulderRight = 8,
        ElbowRight = 9,
        WristRight = 10,
        HandRight = 11,
        HipLeft = 12,
        KneeLeft = 13,
        AnkleLeft = 14,
        FootLeft = 15,
        HipRight = 16,
        KneeRight = 17,
        AnkleRight = 18,
        FootRight = 19,
        SpineShoulder = 20,
        HandTipLeft = 21,
        ThumbLeft = 22,
        HandTipRight = 23,
        ThumbRight = 24,
    };

enum TrackingStatus
Enumerator:
NotTracked
Inferred
Tracked

Definition at line 18 of file MFPoseTrackingFrame.h.

                              : int32_t {
        NotTracked = 0,
        Inferred = 1,
        Tracked = 2,
    };

Function Documentation

MFPoseTrackingPreview::DEFINE_GUID | ( | MFPerceptionFormat_PoseTracking | ,
 |  | 0x69232056 | ,
 |  | 0x2ed9 | ,
 |  | 0x4d0e | ,
 |  | 0x89 | ,
 |  | 0xcc | ,
 |  | 0x5d | ,
 |  | 0x27 | ,
 |  | 0x34 | ,
 |  | 0xa5 | ,
 |  | 0x68 | ,
 |  | 0x8 |
 | ) |  |
MFPoseTrackingPreview::DEFINE_GUID | ( | PoseSet_HandTracking | ,
 |  | 0xf142c82c | ,
 |  | 0x3a57 | ,
 |  | 0x4e7d | ,
 |  | 0x81 | ,
 |  | 0x59 | ,
 |  | 0x98 | ,
 |  | 0xbd | ,
 |  | 0xbd | ,
 |  | 0x6c | ,
 |  | 0xcf | ,
 |  | 0xe2 |
 | ) |  |
MFPoseTrackingPreview::DEFINE_GUID | ( | PoseSet_BodyTracking | ,
 |  | 0x84520b1f | ,
 |  | 0xab61 | ,
 |  | 0x46da | ,
 |  | 0xab | ,
 |  | 0x1d | ,
 |  | 0xe0 | ,
 |  | 0x13 | ,
 |  | 0x40 | ,
 |  | 0xef | ,
 |  | 0x88 | ,
 |  | 0x4e |
 | ) |  |
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

Microsoft Namespace Reference

Namespaces

namespace | Build
namespace | Samples
namespace | SDKSamples
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Build Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Build
Namespaces

Microsoft::Build Namespace Reference

Namespaces

namespace Tasks
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Build::Tasks Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Build
  • Tasks
Classes

Microsoft::Build::Tasks Namespace Reference

Classes

class FxCompile
Task to support Fxc.exe. More...
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
Namespaces

Microsoft::Samples Namespace Reference

Namespaces

namespace | Common
namespace | Devices
namespace | SimpleCommunication
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • Common
Classes

Microsoft::Samples::Common Namespace Reference

Classes

class CBaseAttributes
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::Devices Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • Devices
Namespaces

Microsoft::Samples::Devices Namespace Reference

Namespaces

namespace Sensors
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::Devices::Sensors Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • Devices
  • Sensors
Namespaces

Microsoft::Samples::Devices::Sensors Namespace Reference

Namespaces

namespace Calibration
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::Devices::Sensors::Calibration Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • Devices
  • Sensors
  • Calibration
Classes

Microsoft::Samples::Devices::Sensors::Calibration Namespace Reference

Classes

class CalibrationBar
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::SimpleCommunication Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • SimpleCommunication
Namespaces | Classes | Enumerations | Functions | Variables

Microsoft::Samples::SimpleCommunication Namespace Reference

Namespaces

namespace | Network

Classes

class | CMarker
class | CMediaSink
class | CMediaSource
class | CMediaStream
class | CSchemeHandler
class | CSetRateOperation
class | CSourceOperation
class | CStartOperation
class | CStreamSink
interface | ISinkCallback
class | sealed
struct | StspDescription
struct | StspOperationHeader
struct | StspSampleHeader
struct | StspStreamDescription

Enumerations

enum SourceState {
SourceState_Invalid, SourceState_Opening, SourceState_Starting, SourceState_Started,
SourceState_Stopped, SourceState_Shutdown
}
enum | StspNetworkType { StspNetworkType_IPv4, StspNetworkType_IPv6 }
enum StspOperation {
StspOperation_Unknown, StspOperation_ClientRequestDescription, StspOperation_ClientRequestStart, StspOperation_ClientRequestStop,
StspOperation_ServerDescription, StspOperation_ServerSample, StspOperation_ServerFormatChange, StspOperation_Last
}
enum StspSampleFlags {
StspSampleFlag_BottomFieldFirst = 1, StspSampleFlag_CleanPoint = 2, StspSampleFlag_DerivedFromTopField = 4, StspSampleFlag_Discontinuity = 8,
StspSampleFlag_Interlaced = 16, StspSampleFlag_RepeatFirstField = 32, StspSampleFlag_SingleField = 64
}

Functions

wchar_t const | __declspec (selectany) c_szStspScheme[] = "stsp:"
HRESULT | CreateMarker (MFSTREAMSINK_MARKER_TYPE eMarkerType, const PROPVARIANT *pvarMarkerValue, const PROPVARIANT *pvarContextValue, IMarker **ppMarker)
interface | DECLSPEC_UUID ("3AC82233-933C-43a9-AF3D-ADC94EABF406") DECLSPEC_NOVTABLE IMarker
interface | DECLSPEC_UUID ("09CFFBBF-67AC-4AD6-8463-9CF82CA3E52F") DECLSPEC_NOVTABLE IStspSinkInternal
void | FilterOutputMediaType (IMFMediaType *pSourceMediaType, IMFMediaType *pDestinationMediaType)
void | ValidateInputMediaType (REFGUID guidMajorType, REFGUID guidSubtype, IMFMediaType *pMediaType)

Variables

unsigned short const | c_wStspDefaultPort = 10010

Enumeration Type Documentation

enum SourceState
Enumerator:
SourceState_Invalid
SourceState_Opening
SourceState_Starting
SourceState_Started
SourceState_Stopped
SourceState_Shutdown

Definition at line 91 of file StspDefs.h.

{
    // Invalid state, source cannot be used
    SourceState_Invalid,
    // Opening the connection
    SourceState_Opening,
    // Streaming started
    SourceState_Starting,
    // Streaming started
    SourceState_Started,
    // Streanung stopped
    SourceState_Stopped,
    // Source is shut down
    SourceState_Shutdown,
};

enum StspNetworkType
Enumerator:
StspNetworkType_IPv4
StspNetworkType_IPv6

Definition at line 84 of file StspDefs.h.

{
    StspNetworkType_IPv4,
    StspNetworkType_IPv6,
};

enum StspOperation
Enumerator:
StspOperation_Unknown
StspOperation_ClientRequestDescription
StspOperation_ClientRequestStart
StspOperation_ClientRequestStop
StspOperation_ServerDescription
StspOperation_ServerSample
StspOperation_ServerFormatChange
StspOperation_Last

Definition at line 32 of file StspDefs.h.

{
    StspOperation_Unknown,
    StspOperation_ClientRequestDescription,
    StspOperation_ClientRequestStart,
    StspOperation_ClientRequestStop,
    StspOperation_ServerDescription,
    StspOperation_ServerSample,
    StspOperation_ServerFormatChange,
    StspOperation_Last,
};

enum StspSampleFlags
Enumerator:
StspSampleFlag_BottomFieldFirst
StspSampleFlag_CleanPoint
StspSampleFlag_DerivedFromTopField
StspSampleFlag_Discontinuity
StspSampleFlag_Interlaced
StspSampleFlag_RepeatFirstField
StspSampleFlag_SingleField

Definition at line 64 of file StspDefs.h.

{
    StspSampleFlag_BottomFieldFirst = 1,
    StspSampleFlag_CleanPoint = 2,
    StspSampleFlag_DerivedFromTopField = 4,
    StspSampleFlag_Discontinuity = 8,
    StspSampleFlag_Interlaced = 16,
    StspSampleFlag_RepeatFirstField = 32,
    StspSampleFlag_SingleField = 64,
};

Function Documentation

wchar_t const __declspec ( selectany ) = "stsp:"
HRESULT CreateMarker | ( | MFSTREAMSINK_MARKER_TYPE | eMarkerType,
 |  | const PROPVARIANT * | pvarMarkerValue,
 |  | const PROPVARIANT * | pvarContextValue,
 |  | IMarker ** | ppMarker
 | ) |  |

Definition at line 13 of file Marker.cpp.

{
    return CMarker::Create(eMarkerType, pvarMarkerValue, pvarContextValue, ppMarker);
}

interface Microsoft::Samples::SimpleCommunication::DECLSPEC_UUID ( "3AC82233-933C-43a9-AF3D-ADC94EABF406" )

Definition at line 25 of file StspDefs.h.

                                                                                : public IUnknown
{
    IFACEMETHOD (GetMarkerType) (MFSTREAMSINK_MARKER_TYPE *pType) = 0;
    IFACEMETHOD (GetMarkerValue) (PROPVARIANT *pvar) = 0;
    IFACEMETHOD (GetContext) (PROPVARIANT *pvar) = 0;
};

interface Microsoft::Samples::SimpleCommunication::DECLSPEC_UUID ( "09CFFBBF-67AC-4AD6-8463-9CF82CA3E52F" )

Definition at line 19 of file StspDefs.h.

                                                                                : public IUnknown
{
    virtual void TriggerAcceptConnection(DWORD connectionId) = 0;
    virtual void TriggerRefuseConnection(DWORD connectionId) = 0;
};

void FilterOutputMediaType | ( | IMFMediaType * | pSourceMediaType,
 |  | IMFMediaType * | pDestinationMediaType
 | ) |  |

Definition at line 118 of file Validation.cpp.

{
    HRESULT hr = S_OK;
    GUID guidMajorType;
    GUID guidSubtype;
    const MediaTypeValidationDescriptor *typeDescriptor = nullptr;

    ThrowIfError(pSourceMediaType->GetMajorType(&guidMajorType));

    ThrowIfError(pSourceMediaType->GetGUID(MF_MT_SUBTYPE, &guidSubtype));

    typeDescriptor = FindMediaTypeDescriptor(guidMajorType, guidSubtype);

    // Not a valid media type
    if (typeDescriptor == nullptr)
    {
        Throw(MF_E_INVALIDMEDIATYPE);
    }

    UINT32 cAttributes = 0;
    pSourceMediaType->GetCount(&cAttributes);

    // Remove optional and not necessary attributes.
    for (UINT32 nIndex = 0; nIndex < cAttributes; ++nIndex)
    {
        GUID guidKey;
        PROPVARIANT val;
        Exception ^error = nullptr;
        PropVariantInit(&val);
        ThrowIfError(pSourceMediaType->GetItemByIndex(nIndex, &guidKey, &val));
        try
        {
            if (IsAttributeValid(typeDescriptor, guidKey, &val))
            {
                // Copy only attributes that can be sent otherwise skip it.
                ThrowIfError(pDestinationMediaType->SetItem(guidKey, val));
            }
        }
        catch(Exception ^exc)
        {
            error = exc;
        }

        PropVariantClear(&val);
        if (error != nullptr)
        {
            throw error;
        }
    }
}

void ValidateInputMediaType | ( | REFGUID | guidMajorType,
 |  | REFGUID | guidSubtype,
 |  | IMFMediaType * | pMediaType
 | ) |  |

Definition at line 170 of file Validation.cpp.

{
    const MediaTypeValidationDescriptor *typeDescriptor = FindMediaTypeDescriptor(guidMajorType, guidSubtype);

    if (typeDescriptor == nullptr)
    {
        Throw(MF_E_INVALIDMEDIATYPE);
    }

    UINT32 cAttributes = 0;
    pMediaType->GetCount(&cAttributes);

    for (UINT32 nIndex = 0; nIndex < cAttributes; ++nIndex)
    {
        Exception ^error = nullptr;
        GUID guidKey;
        PROPVARIANT val;
        PropVariantInit(&val);

        ThrowIfError(pMediaType->GetItemByIndex(nIndex, &guidKey, &val));
        try
        {
            if (!IsAttributeValid(typeDescriptor, guidKey, &val))
            {
                ThrowIfError(MF_E_INVALIDMEDIATYPE);
            }
        }
        catch(Exception ^exc)
        {
            error = exc;
        }

        PropVariantClear(&val);
        if (error != nullptr)
        {
            throw error;
        }
    }
}

Variable Documentation

unsigned short const c_wStspDefaultPort = 10010

Definition at line 109 of file StspDefs.h.

Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::Samples::SimpleCommunication::Network Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • Samples
  • SimpleCommunication
  • Network
Classes | Functions

Microsoft::Samples::SimpleCommunication::Network Namespace Reference

Classes

class | abstract
class | CBufferEnumerator
class | CBufferPacket
class | CMediaBufferWrapper
class | CNetworkChannel
interface | INetworkClient
interface | INetworkServer
class | sealed

Functions

HRESULT | CreateBufferPacket (_Outptr_ IBufferPacket **ppBufferPacket)
HRESULT | CreateBufferPacketFromMFSample (_In_ IMFSample *pSample, _Outptr_ IBufferPacket **ppBufferPacket)
HRESULT | CreateMediaBufferWrapper (_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)
HRESULT | CreateMediaBufferWrapper (DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)
INetworkClient CreateNetworkClient ()
INetworkServer | CreateNetworkServer (unsigned short listeningPort)
interface | DECLSPEC_UUID ("3FEBFE65-E515-4448-8DB4-10D7DBC030A8") DECLSPEC_NOVTABLE IBufferEnumerator
interface | DECLSPEC_UUID ("D30E9A4E-31BD-484C-940D-0E5FF536036D") DECLSPEC_NOVTABLE IMediaBufferWrapper
interface | DECLSPEC_UUID ("E6D1193E-8B68-4526-885A-9C858613807D") DECLSPEC_NOVTABLE IBufferPacket

Function Documentation

HRESULT CreateBufferPacket ( _Outptr_ IBufferPacket ** ppBufferPacket )

Definition at line 18 of file BufferPacket.cpp.

{
    return CBufferPacket::CreateInstance(ppBufferPacket);
}

HRESULT CreateBufferPacketFromMFSample | ( | _In_ IMFSample * | pSample,
 |  | _Outptr_ IBufferPacket ** | ppBufferPacket
 | ) |  |

Definition at line 13 of file BufferPacket.cpp.

{
    return CBufferPacket::FromMFSample(pSample, ppBufferPacket);
}

HRESULT CreateMediaBufferWrapper | ( | _In_ IMFMediaBuffer * | pMediaBuffer,
 |  | _Outptr_ IMediaBufferWrapper ** | ppMediaBufferWrapper
 | ) |  |

Definition at line 18 of file MediaBufferWrapper.cpp.

{
    return CMediaBufferWrapper::CreateInstance(pMediaBuffer, ppMediaBufferWrapper);
}

HRESULT CreateMediaBufferWrapper | ( | DWORD | dwMaxLength,
 |  | _Outptr_ IMediaBufferWrapper ** | ppMediaBufferWrapper
 | ) |  |

Definition at line 13 of file MediaBufferWrapper.cpp.

{
    return CMediaBufferWrapper::CreateInstance(dwMaxLength, ppMediaBufferWrapper);
}

INetworkClient CreateNetworkClient ( )

Definition at line 14 of file NetworkClient.cpp.

{
    return ref new CNetworkClient();
}

INetworkServer CreateNetworkServer ( unsigned short listeningPort )

Definition at line 14 of file NetworkServer.cpp.

{
    return ref new CNetworkServer(listeningPort);
}

interface Microsoft::Samples::SimpleCommunication::Network::DECLSPEC_UUID ( "3FEBFE65-E515-4448-8DB4-10D7DBC030A8" )

Definition at line 27 of file StspNetwork.h.

                                                                                : public IUnknown
    {
        IFACEMETHOD_(bool, IsValid) ();
        IFACEMETHOD(GetCurrent) (_Out_ IMediaBufferWrapper **ppBuffer);
        IFACEMETHOD(MoveNext) ();
        IFACEMETHOD(Reset) ();
    };

interface Microsoft::Samples::SimpleCommunication::Network::DECLSPEC_UUID ( "D30E9A4E-31BD-484C-940D-0E5FF536036D" )

Definition at line 10 of file StspNetwork.h.

                                                                                : public IUnknown
    {
        IFACEMETHOD_(IMFMediaBuffer *, GetMediaBuffer) () const = 0;
        IFACEMETHOD_(BYTE *, GetBuffer) () const = 0;

        IFACEMETHOD(SetOffset) (DWORD nOffset) = 0;
        IFACEMETHOD_(DWORD, GetOffset) () const = 0;

        IFACEMETHOD(GetCurrentLength) (DWORD *pcbCurrentLength) = 0;
        IFACEMETHOD(SetCurrentLength) (DWORD cbCurrentLength) = 0;

        IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0;
        IFACEMETHOD(TrimRight) (DWORD cbSize, _Out_ IMediaBufferWrapper **pWrapper) = 0;

        IFACEMETHOD(Reset) () = 0;
    };

interface Microsoft::Samples::SimpleCommunication::Network::DECLSPEC_UUID ( "E6D1193E-8B68-4526-885A-9C858613807D" )

Definition at line 35 of file StspNetwork.h.

                                                                                : public IUnknown
    {
        IFACEMETHOD(AddBuffer) (IMediaBufferWrapper *pBuffer) = 0;
        IFACEMETHOD(InsertBuffer) (unsigned int nIndex, _In_ IMediaBufferWrapper *pBuffer) = 0;
        IFACEMETHOD(RemoveBuffer) (unsigned int nIndex, _Outptr_ IMediaBufferWrapper **ppBuffer) = 0;
        IFACEMETHOD(Clear) () = 0;
        IFACEMETHOD_(size_t, GetBufferCount) () const = 0;

        IFACEMETHOD(GetTotalLength) (_Out_ DWORD *pcbTotalLength) = 0;
        IFACEMETHOD(CopyTo) (DWORD nOffset, DWORD cbSize, _In_reads_bytes_(cbSize) void *pDest, _Out_ DWORD *pcbCopied) = 0;
        IFACEMETHOD(MoveLeft) (DWORD cbSize, _Out_writes_bytes_(cbSize) void *pDest) = 0;
        IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0;
        IFACEMETHOD(ToMFSample) (IMFSample **ppSample) = 0;

        IFACEMETHOD(GetEnumerator) (_Out_ IBufferEnumerator **pEnumerator) = 0;
    };

Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::SDKSamples Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • SDKSamples
Namespaces

Microsoft::SDKSamples Namespace Reference

Namespaces

namespace Kitchen
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Microsoft::SDKSamples::Kitchen Namespace Reference

  • Namespace List
  • Namespace Members
  • Microsoft
  • SDKSamples
  • Kitchen
Classes | Typedefs | Enumerations | Functions | Variables

Microsoft::SDKSamples::Kitchen Namespace Reference

Classes

class | Bread
struct | Dimensions
interface | IAppliance
interface | IBread
interface | IBreadBakedEventArgs
interface | IOven
interface | IOvenFactory
class | Oven
class | sealed

Typedefs

typedef struct
Microsoft::SDKSamples::Kitchen::Dimensions 		Dimensions
typedef enum
Microsoft::SDKSamples::Kitchen::OvenTemperature 		OvenTemperature

Enumerations

enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}
enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}
enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}
enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}

Functions

activatable (1.0)
activatable (IOvenFactory, 1.0)] runtimeclass Oven

Variables

runtimeclass | Bread
runtimeclass | BreadBakedEventArgs
runtimeclass | Oven

Typedef Documentation

typedef struct Microsoft::SDKSamples::Kitchen::Dimensions Dimensions
typedef enum Microsoft::SDKSamples::Kitchen::OvenTemperature OvenTemperature

Enumeration Type Documentation

enum typedef enum Microsoft::SDKSamples::Kitchen::OvenTemperature OvenTemperature
Enumerator:
Low
Medium
High
Low
Medium
High
Low
Medium
High
Low
Medium
High

Definition at line 10 of file BreadTypes.h.

    {
        Low,
        Medium,
        High
    };

enum OvenTemperature
Enumerator:
Low
Medium
High
Low
Medium
High
Low
Medium
High
Low
Medium
High

Definition at line 21 of file Microsoft.SDKSamples.Kitchen.idl.

    {
        Low,
        Medium,
        High
    } OvenTemperature;

enum OvenTemperature
Enumerator:
Low
Medium
High
Low
Medium
High
Low
Medium
High
Low
Medium
High

Definition at line 21 of file Microsoft.SDKSamples.Kitchen.idl.

    {
        Low,
        Medium,
        High
    } OvenTemperature;

enum OvenTemperature
Enumerator:
Low
Medium
High
Low
Medium
High
Low
Medium
High
Low
Medium
High

Definition at line 24 of file OvenServer.cs.

    {
        Low,
        Medium,
        High
    }

Function Documentation

activatable ( 1. 0 )
activatable | ( | IOvenFactory | ,
 |  | 1. | 0
 | ) |  |

Definition at line 78 of file Microsoft.SDKSamples.Kitchen.idl.

    {
        [default] interface IOven;
    }

Variable Documentation

runtimeclass Bread

Definition at line 28 of file Microsoft.SDKSamples.Kitchen.idl.

runtimeclass BreadBakedEventArgs

Definition at line 29 of file Microsoft.SDKSamples.Kitchen.idl.

runtimeclass Oven

Definition at line 30 of file Microsoft.SDKSamples.Kitchen.idl.

Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

MicrosoftPassport Namespace Reference

Namespaces

namespace | Models
namespace | Server
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport::Models Namespace Reference

  • Namespace List
  • Namespace Members
  • MicrosoftPassport
  • Models
Classes

MicrosoftPassport::Models Namespace Reference

Classes

class | RegisterMessage
class | SignatureMessage
class | SubjectPublicKeyInfo
class | UserAndKeyHintMessage
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport::Server Namespace Reference

  • Namespace List
  • Namespace Members
  • MicrosoftPassport
  • Server
Namespaces | Classes

MicrosoftPassport::Server Namespace Reference

Namespaces

namespace | Controllers
namespace | Data

Classes

class | FilterConfig
class | RouteConfig
class | WebApiApplication
class | WebApiConfig
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport::Server::Controllers Namespace Reference

  • Namespace List
  • Namespace Members
  • MicrosoftPassport
  • Server
  • Controllers
Classes

MicrosoftPassport::Server::Controllers Namespace Reference

Classes

class | AuthenticationController
class | HomeController
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport::Server::Data Namespace Reference

  • Namespace List
  • Namespace Members
  • MicrosoftPassport
  • Server
  • Data
Classes

MicrosoftPassport::Server::Data Namespace Reference

Classes

class DAL
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MIDI Namespace Reference

Classes

class | MidiDeviceWatcher
DeviceWatcher class to monitor adding/removing MIDI devices on the fly. More...
class | Scenario1_MIDIDeviceEnumeration
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_ReceiveMIDIMessages
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_SendMIDIMessages
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MifareStandard Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MifareStandard Namespace Reference

Classes

class | AccessHandler
Access handler class for Mifare Standard/Classic based ICC commands. More...
class | ApduResponse
Mifare response APDU. More...
class | DefaultKeys
class | GeneralAuthenticate
Mifare Standard GetHistoricalBytes command. More...
class | GetHistoricalBytes
Mifare Standard GetHistoricalBytes command. More...
class | GetUid
Mifare Standard GetUid command. More...
class | LoadKey
Mifare Standard Load Keys commad which stores the supplied key into the specified numbered key slot for subsequent use by the General Authenticate command. More...
class | Read
Mifare Standard Read commad when sent to the card the card is expected to return 16 bytes. More...
class | Write
Mifare Standard Write commad when sent to the card, writes 16 bytes at a time. More...
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MifareUltralight Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MifareUltralight Namespace Reference

Classes

class | AccessHandler
Access handler class for MifareUL based ICC. More...
class | ApduResponse
Mifare response APDU. More...
class | GetHistoricalBytes
Mifare UL GetHistoricalBytes command. More...
class | GetUid
Mifare UL GetUid command. More...
class | Read
Mifare UL Read commad when sent to the card the card is expected to return 16 byte of 4 Mifare pages starting at address addr. More...
class | Write
Mifare UL Write commad when sent to the card, writes 4 bytes (1 Mifare block) at given block address addr. More...
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband Namespace Reference

  • Namespace List
  • Namespace Members
Classes

MobileBroadband Namespace Reference

Classes

class | AccountWatcher
An empty page that can be used on its own or navigated to within a Frame. More...
class | BroadbandDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | GetConnectionProfiles
An empty page that can be used on its own or navigated to within a Frame. More...
class | ModemDeviceServices
An empty page that can be used on its own or navigated to within a Frame. More...
class | ModemInformation
An empty page that can be used on its own or navigated to within a Frame. More...
class | ShowConnection
An empty page that can be used on its own or navigated to within a Frame. More...
class | SimCard
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MoveLookConstants Namespace Reference

  • Namespace List
  • Namespace Members

MoveLookConstants Namespace Reference

Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MrcEffectDefinitions Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

MrcEffectDefinitions Namespace Reference

Classes

class | sealed

Enumerations

enum | AudioMixerMode { Mic = 0, Loopback = 1, MicAndLoopback = 2 }
enum | MixedRealityCapturePerspective { Display = 0, PhotoVideoCamera = 1 }

Enumeration Type Documentation

enum AudioMixerMode
Enumerator:
Mic
Loopback
MicAndLoopback

Definition at line 34 of file MrcAudioEffectDefinition.h.

    {
        Mic = 0,
        Loopback = 1,
        MicAndLoopback = 2
    };

enum MixedRealityCapturePerspective
Enumerator:
Display
PhotoVideoCamera

Definition at line 92 of file MrcVideoEffectDefinition.h.

    {
        Display = 0,
        PhotoVideoCamera = 1,
    };

Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcHceBackgroundTask Namespace Reference

  • Namespace List
  • Namespace Members
Classes

NfcHceBackgroundTask Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner Namespace Reference

  • Namespace List
  • Namespace Members
Classes

NfcProvisioner Namespace Reference

Classes

struct | NfcProvHeader
The NfcProvHeader is a prefix to each NFC provisioning message which contains information about the protocol version, message index, total message count, and etc. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

NfcSample Namespace Reference

Classes

class | CardReader
An empty page that can be used on its own or navigated to within a Frame. More...
class | ManageCardScenario
An empty page that can be used on its own or navigated to within a Frame. More...
class | NfcUtils
class | ReceiptView
An empty page that can be used on its own or navigated to within a Frame. More...
class | SetCardDataScenario

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage }

Enumeration Type Documentation

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage

Definition at line 26 of file NfcUtils.cs.

    {
        StatusMessage,
        ErrorMessage
    };

Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

Notifications Namespace Reference

Namespaces

namespace | Controls
namespace | Converters
namespace | Helpers
namespace | Model
namespace | ScenarioPages

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioPage
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::Controls Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • Controls
Classes

Notifications::Controls Namespace Reference

Classes

class | InstructionControl
class | InstructionsControl
class | PopToastControl
class | StepsControl
class | StepsHelperControl
class | UpdateFourTilesControl
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::Converters Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • Converters
Classes

Notifications::Converters Namespace Reference

Classes

class | TypeToUIElementConverter
class | XmlDocumentToStringConverter
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::Helpers Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • Helpers
Classes

Notifications::Helpers Namespace Reference

Classes

class | BackButtonPage
class | BindableBase
From http://danrigby.com/2012/04/01/inotifypropertychanged-the-net-4-5-way-revisited/. More...
class | TilesHelper
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::Model Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • Model
Classes

Notifications::Model Namespace Reference

Classes

interface | IScenario
class | Scenario
class | ScenarioGroup
class | Scenarios
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
Namespaces

Notifications::ScenarioPages Namespace Reference

Namespaces

namespace | Badges
namespace | LiveTiles
namespace | Toasts
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
Namespaces

Notifications::ScenarioPages::Badges Namespace Reference

Namespaces

namespace Local
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
Namespaces

Notifications::ScenarioPages::Badges::Local Namespace Reference

Namespaces

namespace | PrimaryTile
namespace | SecondaryTileBadges
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local::PrimaryTile Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
Namespaces

Notifications::ScenarioPages::Badges::Local::PrimaryTile Namespace Reference

Namespaces

namespace | ClearBadge
namespace | SetBadgeGlyph
namespace | SetBadgeNumber
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local::PrimaryTile::ClearBadge Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • ClearBadge
Classes

Notifications::ScenarioPages::Badges::Local::PrimaryTile::ClearBadge Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeGlyph Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeGlyph
Classes

Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeGlyph Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeNumber Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeNumber
Classes

Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeNumber Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Badges::Local::SecondaryTileBadges Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • SecondaryTileBadges
Classes

Notifications::ScenarioPages::Badges::Local::SecondaryTileBadges Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
Namespaces

Notifications::ScenarioPages::LiveTiles Namespace Reference

Namespaces

namespace | AdaptiveTemplates
namespace | BasicState
namespace | FindAllAsync
namespace | Notifications
namespace | Pinning
namespace | UnpinEverything
namespace | Updating
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
Namespaces

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates Namespace Reference

Namespaces

namespace | Branding
namespace | Custom
namespace | HintPresentation
namespace | Images
namespace | TextStyles
namespace | TextWrap
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
Namespaces

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding Namespace Reference

Namespaces

namespace | Default
namespace | Logo
namespace | Name
namespace | NameAndLogo
namespace | None
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Default Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Default
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Default Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Logo Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Logo
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Logo Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Name Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Name
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Name Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::NameAndLogo Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • NameAndLogo
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::NameAndLogo Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::None Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • None
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::None Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Custom Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Custom
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Custom Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
Namespaces

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation Namespace Reference

Namespaces

namespace | Contact
namespace | People
namespace | Photos
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Contact Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Contact
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Contact Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::People Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • People
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::People Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Photos Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Photos
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Photos Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
Namespaces

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images Namespace Reference

Namespaces

namespace Source
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
Namespaces

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source Namespace Reference

Namespaces

namespace | FromAppData
namespace | FromAppPackage
namespace | FromInternet
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppData Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppData
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppData Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppPackage Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppPackage
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppPackage Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromInternet Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromInternet
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromInternet Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextStyles Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextStyles
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextStyles Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextWrap Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextWrap
Classes

Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextWrap Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
Namespaces

Notifications::ScenarioPages::LiveTiles::BasicState Namespace Reference

Namespaces

namespace | BackgroundColor
namespace | Logos
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
Namespaces

Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor Namespace Reference

Namespaces

namespace | Custom
namespace | InheritFromPrimary
namespace | Transparent
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Custom Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Custom
Classes

Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Custom Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::InheritFromPrimary Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • InheritFromPrimary
Classes

Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::InheritFromPrimary Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Transparent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Transparent
Classes

Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Transparent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::Logos Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
Namespaces

Notifications::ScenarioPages::LiveTiles::BasicState::Logos Namespace Reference

Namespaces

namespace Source
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
Namespaces

Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source Namespace Reference

Namespaces

namespace | AppData
namespace | AppPackage
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppData Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppData
Classes

Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppData Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppPackage Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppPackage
Classes

Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppPackage Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::FindAllAsync Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync
Namespaces

Notifications::ScenarioPages::LiveTiles::FindAllAsync Namespace Reference

Namespaces

namespace Visualizer
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::FindAllAsync::Visualizer Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync
  • Visualizer
Classes

Notifications::ScenarioPages::LiveTiles::FindAllAsync::Visualizer Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
Namespaces

Notifications::ScenarioPages::LiveTiles::Notifications Namespace Reference

Namespaces

namespace | ExpiringNotification
namespace | PrimaryTile
namespace | SecondaryTiles
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications::ExpiringNotification Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • ExpiringNotification
Classes

Notifications::ScenarioPages::LiveTiles::Notifications::ExpiringNotification Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
Namespaces

Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile Namespace Reference

Namespaces

namespace | Clearing
namespace | Sending
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Clearing Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Clearing
Classes

Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Clearing Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Sending Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Sending
Classes

Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Sending Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Notifications::SecondaryTiles Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • SecondaryTiles
Classes

Notifications::ScenarioPages::LiveTiles::Notifications::SecondaryTiles Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Pinning Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Pinning
Classes

Notifications::ScenarioPages::LiveTiles::Pinning Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::UnpinEverything Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • UnpinEverything
Classes

Notifications::ScenarioPages::LiveTiles::UnpinEverything Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::LiveTiles::Updating Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Updating
Classes

Notifications::ScenarioPages::LiveTiles::Updating Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
Namespaces

Notifications::ScenarioPages::Toasts Namespace Reference

Namespaces

namespace | Actions
namespace | ActivationTypes
namespace | AdaptiveTemplates
namespace | Audio
namespace | ExpiringToast
namespace | GhostToast
namespace | HistoryChangedTrigger
namespace | Scenarios
namespace | ToastNotificationManagerHistory
namespace | UpdateToast
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
Namespaces

Notifications::ScenarioPages::Toasts::Actions Namespace Reference

Namespaces

namespace | Action
namespace | InputText
namespace | SystemCommands
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::Action Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
Namespaces

Notifications::ScenarioPages::Toasts::Actions::Action Namespace Reference

Namespaces

namespace | QuickReply
namespace | Text
namespace | TextAndImage
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::Action::QuickReply Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • QuickReply
Classes

Notifications::ScenarioPages::Toasts::Actions::Action::QuickReply Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::Action::Text Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • Text
Classes

Notifications::ScenarioPages::Toasts::Actions::Action::Text Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::Action::TextAndImage Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • TextAndImage
Classes

Notifications::ScenarioPages::Toasts::Actions::Action::TextAndImage Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::InputText Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
Namespaces

Notifications::ScenarioPages::Toasts::Actions::InputText Namespace Reference

Namespaces

namespace | DefaultInput
namespace | PlaceholderContent
namespace | RetrievingArgs
namespace | Title
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::InputText::DefaultInput Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • DefaultInput
Classes

Notifications::ScenarioPages::Toasts::Actions::InputText::DefaultInput Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::InputText::PlaceholderContent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • PlaceholderContent
Classes

Notifications::ScenarioPages::Toasts::Actions::InputText::PlaceholderContent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::InputText::RetrievingArgs Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • RetrievingArgs
Classes

Notifications::ScenarioPages::Toasts::Actions::InputText::RetrievingArgs Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::InputText::Title Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • Title
Classes

Notifications::ScenarioPages::Toasts::Actions::InputText::Title Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::SystemCommands Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands
Namespaces

Notifications::ScenarioPages::Toasts::Actions::SystemCommands Namespace Reference

Namespaces

namespace SnoozeAndDismiss
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Actions::SystemCommands::SnoozeAndDismiss Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands
  • SnoozeAndDismiss
Classes

Notifications::ScenarioPages::Toasts::Actions::SystemCommands::SnoozeAndDismiss Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
Namespaces

Notifications::ScenarioPages::Toasts::ActivationTypes Namespace Reference

Namespaces

namespace | BackgroundWithAppClosed
namespace | BackgroundWithAppOpen
namespace | ForegroundWithAppClosed
namespace | ForegroundWithAppOpen
namespace | Protocol
namespace | System
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppClosed Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppClosed
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppClosed Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppOpen Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppOpen
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppOpen Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppClosed Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppClosed
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppClosed Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppOpen Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppOpen
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppOpen Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::Protocol Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • Protocol
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::Protocol Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
Namespaces

Notifications::ScenarioPages::Toasts::ActivationTypes::System Namespace Reference

Namespaces

namespace | Dismiss
namespace | Snooze
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
Namespaces

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss Namespace Reference

Namespaces

namespace | AutoContent
namespace | CustomContent
namespace | Dismissing
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::AutoContent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • AutoContent
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::AutoContent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::CustomContent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • CustomContent
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::CustomContent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::Dismissing Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • Dismissing
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::Dismissing Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
Namespaces

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze Namespace Reference

Namespaces

namespace | AutoContent
namespace | CustomContent
namespace | Snoozing
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::AutoContent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • AutoContent
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::AutoContent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::CustomContent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • CustomContent
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::CustomContent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::Snoozing Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • Snoozing
Classes

Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::Snoozing Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
Namespaces

Notifications::ScenarioPages::Toasts::AdaptiveTemplates Namespace Reference

Namespaces

namespace Image
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
Namespaces

Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image Namespace Reference

Namespaces

namespace Src
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
Namespaces

Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src Namespace Reference

Namespaces

namespace | FromAppData
namespace | FromAppPackage
namespace | FromInternet
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppData Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppData
Classes

Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppData Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppPackage Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppPackage
Classes

Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppPackage Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromInternet Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromInternet
Classes

Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromInternet Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Audio Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
Namespaces

Notifications::ScenarioPages::Toasts::Audio Namespace Reference

Namespaces

namespace | Default
namespace | EmailSound
namespace | Looping
namespace | Silent
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Audio::Default Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Default
Classes

Notifications::ScenarioPages::Toasts::Audio::Default Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Audio::EmailSound Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • EmailSound
Classes

Notifications::ScenarioPages::Toasts::Audio::EmailSound Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Audio::Looping Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Looping
Classes

Notifications::ScenarioPages::Toasts::Audio::Looping Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Audio::Silent Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Silent
Classes

Notifications::ScenarioPages::Toasts::Audio::Silent Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ExpiringToast Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ExpiringToast
Classes

Notifications::ScenarioPages::Toasts::ExpiringToast Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::GhostToast Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • GhostToast
Classes

Notifications::ScenarioPages::Toasts::GhostToast Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::HistoryChangedTrigger Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
Namespaces

Notifications::ScenarioPages::Toasts::HistoryChangedTrigger Namespace Reference

Namespaces

namespace | BadgeControl
namespace | RespondingToToasts
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::BadgeControl Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • BadgeControl
Classes

Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::BadgeControl Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::RespondingToToasts Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • RespondingToToasts
Classes

Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::RespondingToToasts Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Scenarios Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
Namespaces

Notifications::ScenarioPages::Toasts::Scenarios Namespace Reference

Namespaces

namespace | Alarm
namespace | Default
namespace | IncomingCall
namespace | Reminder
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Scenarios::Alarm Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Alarm
Classes

Notifications::ScenarioPages::Toasts::Scenarios::Alarm Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Scenarios::Default Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Default
Classes

Notifications::ScenarioPages::Toasts::Scenarios::Default Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Scenarios::IncomingCall Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • IncomingCall
Classes

Notifications::ScenarioPages::Toasts::Scenarios::IncomingCall Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::Scenarios::Reminder Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Reminder
Classes

Notifications::ScenarioPages::Toasts::Scenarios::Reminder Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
Namespaces

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory Namespace Reference

Namespaces

namespace | ClearAll
namespace | GetHistory
namespace | Remove
namespace | RemoveGroup
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::ClearAll Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • ClearAll
Classes

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::ClearAll Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory
Namespaces

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory Namespace Reference

Namespaces

namespace Visualizer
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory::Visualizer Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory
  • Visualizer
Classes

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory::Visualizer Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
Namespaces

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove Namespace Reference

Namespaces

namespace | ByTag
namespace | ByTagAndGroup
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTag Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTag
Classes

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTag Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTagAndGroup Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTagAndGroup
Classes

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTagAndGroup Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
Namespaces

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup Namespace Reference

Namespaces

namespace ByGroup
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup::ByGroup Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
  • ByGroup
Classes

Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup::ByGroup Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications::ScenarioPages::Toasts::UpdateToast Namespace Reference

  • Namespace List
  • Namespace Members
  • Notifications
  • ScenarioPages
  • Toasts
  • UpdateToast
Classes

Notifications::ScenarioPages::Toasts::UpdateToast Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneHandedUse_TailoredMultipleViews Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

OneHandedUse_TailoredMultipleViews Namespace Reference

Namespaces

namespace | UserControls
namespace | ViewModel

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPage_OneHanded
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneHandedUse_TailoredMultipleViews::UserControls Namespace Reference

  • Namespace List
  • Namespace Members
  • OneHandedUse_TailoredMultipleViews
  • UserControls
Classes

OneHandedUse_TailoredMultipleViews::UserControls Namespace Reference

Classes

class | Albums
class | Collections
class | Settings
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneHandedUse_TailoredMultipleViews::ViewModel Namespace Reference

  • Namespace List
  • Namespace Members
  • OneHandedUse_TailoredMultipleViews
  • ViewModel
Classes

OneHandedUse_TailoredMultipleViews::ViewModel Namespace Reference

Classes

class | MainViewModel
class | Model
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneNotifications_UWP Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

OneNotifications_UWP Namespace Reference

Namespaces

namespace ScenarioPages
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneNotifications_UWP::ScenarioPages Namespace Reference

  • Namespace List
  • Namespace Members
  • OneNotifications_UWP
  • ScenarioPages
Namespaces

OneNotifications_UWP::ScenarioPages Namespace Reference

Namespaces

namespace LiveTiles
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneNotifications_UWP::ScenarioPages::LiveTiles Namespace Reference

  • Namespace List
  • Namespace Members
  • OneNotifications_UWP
  • ScenarioPages
  • LiveTiles
Namespaces

OneNotifications_UWP::ScenarioPages::LiveTiles Namespace Reference

Namespaces

namespace BasicState
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState Namespace Reference

  • Namespace List
  • Namespace Members
  • OneNotifications_UWP
  • ScenarioPages
  • LiveTiles
  • BasicState
Namespaces

OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState Namespace Reference

Namespaces

namespace CheckAllPropertiesCorrect
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState::CheckAllPropertiesCorrect Namespace Reference

  • Namespace List
  • Namespace Members
  • OneNotifications_UWP
  • ScenarioPages
  • LiveTiles
  • BasicState
  • CheckAllPropertiesCorrect
Classes

OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState::CheckAllPropertiesCorrect Namespace Reference

Classes

class ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OpenCVBridge Namespace Reference

  • Namespace List
  • Namespace Members
Classes

OpenCVBridge Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: org Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

org Namespace Reference

Namespaces

namespace alljoyn
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: org::alljoyn Namespace Reference

  • Namespace List
  • Namespace Members
  • org
  • alljoyn
Namespaces

org::alljoyn Namespace Reference

Namespaces

namespace Onboarding
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: org::alljoyn::Onboarding Namespace Reference

  • Namespace List
  • Namespace Members
  • org
  • alljoyn
  • Onboarding
Classes | Variables

org::alljoyn::Onboarding Namespace Reference

Classes

interface | IOnboardingConsumer
interface | IOnboardingLegacySignals
interface | IOnboardingProducer
interface | IOnboardingService
interface | IOnboardingSignals
interface | ISignalEmitter
class | sealed

Variables

PCSTR | c_OnboardingIntrospectionXml = "</interface>"

Variable Documentation

PCSTR c_OnboardingIntrospectionXml = "</interface>"

Definition at line 598 of file OnboardingProducer.cpp.

Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Osrusbfx2Task Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Osrusbfx2Task Namespace Reference

Classes

class ConnectedTask
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pcsc Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Enumerations

Pcsc Namespace Reference

Namespaces

namespace | Common

Classes

class | ApduResponse
PCSC Apdu response. More...
class | GeneralAuthenticate
PCSC GeneralAuthenticate command. More...
class | GetData
PCSC GetData command. More...
class | GetHistoricalBytes
PCSC GetHistoricalBytes command. More...
class | GetUid
PCSC GetUid command. More...
class | IncrementDecrement
PCSC IncrementDecrement command. More...
class | LoadKeys
PCSC LoadKeys command. More...
class | ManageSession
PCSC ManageSession command. More...
class | ManageSessionResponse
PCSC ManageSession response. More...
class | ReadBinary
PCSC ReadBinary command. More...
class | SmartCardConnectionExtension
class | SmartCardReaderUtils
class | TransparentExchange
PCSC TransparentExchange command. More...
class | TransparentExchangeResponse
PCSC TransparentExchange response. More...
class | UpdateBinary
PCSC Updatebinary Command. More...

Enumerations

enum CardName {
Unknown = 0x0000, MifareStandard1K = 0x0001, MifareStandard4K = 0x0002, MifareUltralight = 0x0003,
SLE55R = 0x0004, SR176 = 0x0006, SRIX4K = 0x0007, AT88RF020 = 0x0008,
AT88SC0204CRF = 0x0009, AT88SC0808CRF = 0x000A, AT88SC1616CRF = 0x000B, AT88SC3216CRF = 0x000C,
AT88SC6416CRF = 0x000D, SRF55V10P = 0x000E, SRF55V02P = 0x000F, SRF55V10S = 0x0010,
SRF55V02S = 0x0011, TAG_IT = 0x0012, LRI512 = 0x0013, ICODESLI = 0x0014,
TEMPSENS = 0x0015, ICODE1 = 0x0016, PicoPass2K = 0x0017, PicoPass2KS = 0x0018,
PicoPass16K = 0x0019, PicoPass16Ks = 0x001A, PicoPass16K8x2 = 0x001B, PicoPass16KS8x2 = 0x001C,
PicoPass32KS16p16 = 0x001D, PicoPass32KS16p8x2 = 0x001E, PicoPass32KS8x2p16 = 0x001F, PicoPass32KS8x2p8x2 = 0x0020,
LRI64 = 0x0021, ICODEUID = 0x0022, ICODEEPC = 0x0023, LRI12 = 0x0024,
LRI128 = 0x0025, MifareMini = 0x0026, SLE66R01P = 0x0027, SLE66RxxP = 0x0028,
SLE66RxxS = 0x0029, SLE55RxxE = 0x002A, SRF55V01P = 0x002B, SRF66V10ST = 0x002C,
SRF66V10IT = 0x002D, SRF66V01ST = 0x002E, JewelTag = 0x002F, TopazTag = 0x0030,
AT88SC0104CRF = 0x0031, AT88SC0404CRF = 0x0032, AT88RF01C = 0x0033, AT88RF04C = 0x0034,
iCodeSL2 = 0x0035, MifarePlusSL1_2K = 0x0036, MifarePlusSL1_4K = 0x0037, MifarePlusSL2_2K = 0x0038,
MifarePlusSL2_4K = 0x0039, MifareUltralightC = 0x003A, FeliCa = 0x003B, MelexisSensorTagMLX90129 = 0x003C,
MifareUltralightEV1 = 0x003D, CardNameMaxValue = MifareUltralightEV1
}
enum Ins {
GetData = 0xCA, LoadKeys = 0x82, GeneralAuthenticate = 0x86, Verify = 0x20,
ReadBinary = 0xB0, UpdateBinary = 0xD6
}
enum StorageStandard {
Unknown = 0x00, Iso14443AP1 = 0x01, Iso14443AP2 = 0x02, Iso14443AP3 = 0x03,
Iso14443ARfu = 0x04, Iso14443BP1 = 0x05, Iso14443BP2 = 0x06, Iso14443BP3 = 0x07,
Iso14443BRfu = 0x08, Iso15693P1 = 0x09, Iso15693P2 = 0x0A, Iso15693P3 = 0x0B,
Iso15693P4 = 0x0C, Iso7816CI2C = 0x0D, Iso7816CEI2C = 0x0E, Iso7816C2WBP = 0x0F,
Iso7816C3WBP = 0x10, FeliCa = 0x11, LowFreqCContactless = 0x40
}

Enumeration Type Documentation

enum CardName

PCSC card name enum (nn short).

Enumerator:
Unknown
MifareStandard1K
MifareStandard4K
MifareUltralight
SLE55R
SR176
SRIX4K
AT88RF020
AT88SC0204CRF
AT88SC0808CRF
AT88SC1616CRF
AT88SC3216CRF
AT88SC6416CRF
SRF55V10P
SRF55V02P
SRF55V10S
SRF55V02S
TAG_IT
LRI512
ICODESLI
TEMPSENS
ICODE1
PicoPass2K
PicoPass2KS
PicoPass16K
PicoPass16Ks
PicoPass16K8x2
PicoPass16KS8x2
PicoPass32KS16p16
PicoPass32KS16p8x2
PicoPass32KS8x2p16
PicoPass32KS8x2p8x2
LRI64
ICODEUID
ICODEEPC
LRI12
LRI128
MifareMini
SLE66R01P
SLE66RxxP
SLE66RxxS
SLE55RxxE
SRF55V01P
SRF66V10ST
SRF66V10IT
SRF66V01ST
JewelTag
TopazTag
AT88SC0104CRF
AT88SC0404CRF
AT88RF01C
AT88RF04C
iCodeSL2
MifarePlusSL1_2K
MifarePlusSL1_4K
MifarePlusSL2_2K
MifarePlusSL2_4K
MifareUltralightC
FeliCa
MelexisSensorTagMLX90129
MifareUltralightEV1
CardNameMaxValue

Definition at line 48 of file PcscDefs.cs.

                         : ushort
    {
        Unknown                         = 0x0000,

        MifareStandard1K                = 0x0001,
        MifareStandard4K                = 0x0002,
        MifareUltralight                = 0x0003,
        SLE55R                          = 0x0004,
        SR176                           = 0x0006,
        SRIX4K                          = 0x0007,
        AT88RF020                       = 0x0008,
        AT88SC0204CRF                   = 0x0009,
        AT88SC0808CRF                   = 0x000A,
        AT88SC1616CRF                   = 0x000B,
        AT88SC3216CRF                   = 0x000C,
        AT88SC6416CRF                   = 0x000D,
        SRF55V10P                       = 0x000E,
        SRF55V02P                       = 0x000F,
        SRF55V10S                       = 0x0010,
        SRF55V02S                       = 0x0011,
        TAG_IT                          = 0x0012,
        LRI512                          = 0x0013,
        ICODESLI                        = 0x0014,
        TEMPSENS                        = 0x0015,
        ICODE1                          = 0x0016,
        PicoPass2K                      = 0x0017,
        PicoPass2KS                     = 0x0018,
        PicoPass16K                     = 0x0019,
        PicoPass16Ks                    = 0x001A,
        PicoPass16K8x2                  = 0x001B,
        PicoPass16KS8x2                 = 0x001C,
        PicoPass32KS16p16               = 0x001D,
        PicoPass32KS16p8x2              = 0x001E,
        PicoPass32KS8x2p16              = 0x001F,
        PicoPass32KS8x2p8x2             = 0x0020,
        LRI64                           = 0x0021,
        ICODEUID                        = 0x0022,
        ICODEEPC                        = 0x0023,
        LRI12                           = 0x0024,
        LRI128                          = 0x0025,
        MifareMini                      = 0x0026,
        SLE66R01P                       = 0x0027,
        SLE66RxxP                       = 0x0028,
        SLE66RxxS                       = 0x0029,
        SLE55RxxE                       = 0x002A,
        SRF55V01P                       = 0x002B,
        SRF66V10ST                      = 0x002C,
        SRF66V10IT                      = 0x002D,
        SRF66V01ST                      = 0x002E,
        JewelTag                        = 0x002F,
        TopazTag                        = 0x0030,
        AT88SC0104CRF                   = 0x0031,
        AT88SC0404CRF                   = 0x0032,
        AT88RF01C                       = 0x0033,
        AT88RF04C                       = 0x0034,
        iCodeSL2                        = 0x0035,
        MifarePlusSL1_2K                = 0x0036,
        MifarePlusSL1_4K                = 0x0037,
        MifarePlusSL2_2K                = 0x0038,
        MifarePlusSL2_4K                = 0x0039,
        MifareUltralightC               = 0x003A,
        FeliCa                          = 0x003B,
        MelexisSensorTagMLX90129        = 0x003C,
        MifareUltralightEV1             = 0x003D,

        CardNameMaxValue                = MifareUltralightEV1,
    }

enum Ins

Enumeration of possible instructions.

Enumerator:
GetData
LoadKeys
GeneralAuthenticate
Verify
ReadBinary
UpdateBinary

Definition at line 119 of file PcscDefs.cs.

                    : byte
    {
        GetData = 0xCA,
        LoadKeys = 0x82,
        GeneralAuthenticate = 0x86,
        Verify = 0x20,
        ReadBinary = 0xB0,
        UpdateBinary = 0xD6,
    }

enum StorageStandard

PCSC storage standard enum (ss byte).

Enumerator:
Unknown
Iso14443AP1
Iso14443AP2
Iso14443AP3
Iso14443ARfu
Iso14443BP1
Iso14443BP2
Iso14443BP3
Iso14443BRfu
Iso15693P1
Iso15693P2
Iso15693P3
Iso15693P4
Iso7816CI2C
Iso7816CEI2C
Iso7816C2WBP
Iso7816C3WBP
FeliCa
LowFreqCContactless

Definition at line 17 of file PcscDefs.cs.

                                : byte
    {
        Unknown                         = 0x00,
        Iso14443AP1                     = 0x01,
        Iso14443AP2                     = 0x02,
        Iso14443AP3                     = 0x03,
        Iso14443ARfu                    = 0x04,

        Iso14443BP1                     = 0x05,
        Iso14443BP2                     = 0x06,
        Iso14443BP3                     = 0x07,
        Iso14443BRfu                    = 0x08,

        Iso15693P1                      = 0x09,
        Iso15693P2                      = 0x0A,
        Iso15693P3                      = 0x0B,
        Iso15693P4                      = 0x0C,

        Iso7816CI2C                     = 0x0D,
        Iso7816CEI2C                    = 0x0E,
        Iso7816C2WBP                    = 0x0F,
        Iso7816C3WBP                    = 0x10,

        FeliCa                          = 0x11,

        LowFreqCContactless             = 0x40,
    }

Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pcsc::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • Pcsc
  • Common
Classes | Enumerations

Pcsc::Common Namespace Reference

Classes

class | AtrInfo
class | AtrParser
Helper class that parses the ATR and populate the AtrInfo class. More...
class | ByteExtension
Extensions to the Byte primitive data type.
class | IccDetection
Class used to detect the type of the ICC card detected. More...

Enumerations

enum | DeviceClass { Unknown = 0x00, StorageClass = 0x01, Iso14443P4 = 0x02, MifareDesfire = 0x03 }

Enumeration Type Documentation

enum DeviceClass

ICC Device class.

Enumerator:
Unknown
StorageClass
Iso14443P4
MifareDesfire

Definition at line 17 of file CommonDefs.cs.

                            : byte
    {
        Unknown             = 0x00,
        StorageClass        = 0x01,  // for PCSC class, there will be subcategory to identify the physical icc
        Iso14443P4          = 0x02,
        MifareDesfire       = 0x03,
    }

Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PedometerCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

PedometerCS Namespace Reference

Classes

class | HistoryRecord
Represents a history record object that gets binded to the ListView controller in the XAML. More...
class | Scenario1_Events
'Events' scenario page that gets navigated to when the user selected the 'Events' scenario. More...
class | Scenario2_History
History Page that gets loaded when 'History' scenario is selected. More...
class | Scenario3_CurrentStepCount
'Current step count' illustration page More...
class | Scenario4_BackgroundPedometer
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PivotCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

PivotCS Namespace Reference

Classes

class | SampleDataModel
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3
class | TabHeader
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlaybackManager Namespace Reference

  • Namespace List
  • Namespace Members
Classes

PlaybackManager Namespace Reference

Classes

class | PlaybackControl
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PrintSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

PrintSample Namespace Reference

Classes

class | ContinuationPage
A paged used to flow text from a given text container Usage: Output scenarios 1-4 might not fit entirely on a given "printer page" In that case simply add new continuation pages of the given size until all the content can be displayed. More...
class | CustomOptionsPrintHelper
class | DisablePreviewPrintHelper
This class customizes the standard PrintHelper in order to disable print preview. More...
class | InvalidPageException
class | PageDescription
Printable page description. More...
class | PageRangePrintHelper
class | PageToPrint
Page content to send to the printer. More...
class | PhotosPrintHelper
class | PreviewUnavailable
Used in scenario 5 to display a custom print preview unavailable page. More...
class | PrintHelper
class | Scenario1Basic
Scenario that demonstrates how to invoke the Print UI. More...
class | Scenario2StandardOptions
Scenario that demos how to add customizations in the displayed options list. More...
class | Scenario3CustomOptions
Scenario that demos how to add custom options (specific for the application). More...
class | Scenario4PageRange
Scenario that demonstrates a page range implementation. More...
class | Scenario5Photos
Photo printing scenario. More...
class | Scenario6DisablePreview
Scenario that demos how to disable the print preview in the Modern Print Dialog window. More...
class | StandardOptionsPrintHelper

Enumerations

enum | DisplayContent { Text = 1, Images = 2, TextAndImages = 3 }
enum | PhotoSize { SizeFullPage, Size4x6, Size5x7, Size8x10 }
enum | Scaling { ShrinkToFit, Crop }

Enumeration Type Documentation

enum DisplayContent
Enumerator:
Text

Show only text.

Images

Show only images.

TextAndImages

Show a combination of images and text.

Definition at line 27 of file Scenario3CustomOptions.xaml.cs.

                                 : int
    {
        /// <summary>
        /// Show only text
        /// </summary>
        Text = 1,

        /// <summary>
        /// Show only images
        /// </summary>
        Images = 2,

        /// <summary>
        /// Show a combination of images and text
        /// </summary>
        TextAndImages = 3
    }

enum PhotoSize

Photo size options.

Enumerator:
SizeFullPage
Size4x6
Size5x7
Size8x10

Definition at line 35 of file Scenario5Photos.xaml.cs.

                          : byte
    {
        SizeFullPage,
        Size4x6,
        Size5x7,
        Size8x10
    }

enum Scaling

Photo scaling options.

Enumerator:
ShrinkToFit
Crop

Definition at line 46 of file Scenario5Photos.xaml.cs.

                        : byte
    {
        ShrinkToFit,
        Crop
    }

Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximityCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

ProximityCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
class | Scenario3_DisplayOnOff
class | Scenario4_BackgroundProximitySensor
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents Namespace Reference

  • Namespace List
  • Namespace Members
Classes

ProxyStubsForWinRTComponents Namespace Reference

Classes

class | CustomException
class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RandomNumberService Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Variables

RandomNumberService Namespace Reference

Classes

class | RandomNumberGeneratorTask

Variables

runtimeclass | RandomNumberGeneratorTask

Variable Documentation

runtimeclass RandomNumberGeneratorTask

Definition at line 6 of file RandomNumberGeneratorTask.idl.

Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometerCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

RelativeInclinometerCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RpcServer Namespace Reference

  • Namespace List
  • Namespace Members
Classes

RpcServer Namespace Reference

Classes

class Metering
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Sample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Sample Namespace Reference

Classes

struct RecognizedTextRun
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Enumerations

ScreenCasting Namespace Reference

Namespaces

namespace | Controls
namespace | Data
namespace | Util

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ProjectionViewBroker
class | ProjectionViewPage
class | Scenario
class | Scenario01
class | Scenario02
class | Scenario03
class | Scenario04
class | Scenario05
class | Scenario06
class | UnhandledExceptionPage
An empty page that can be used on its own or navigated to within a Frame. More...

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage }

Enumeration Type Documentation

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage

Definition at line 199 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting::Controls Namespace Reference

  • Namespace List
  • Namespace Members
  • ScreenCasting
  • Controls
Classes

ScreenCasting::Controls Namespace Reference

Classes

class | MediaTransportControlsWithCustomCastButton
class | ProjectedMediaTransportControls
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting::Data Namespace Reference

  • Namespace List
  • Namespace Members
  • ScreenCasting
  • Data
Namespaces

ScreenCasting::Data Namespace Reference

Namespaces

namespace | Azure
namespace | Common
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting::Data::Azure Namespace Reference

  • Namespace List
  • Namespace Members
  • ScreenCasting
  • Data
  • Azure
Classes

ScreenCasting::Data::Azure Namespace Reference

Classes

class AzureDataProvider
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting::Data::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • ScreenCasting
  • Data
  • Common
Classes

ScreenCasting::Data::Common Namespace Reference

Classes

class | ItemsDataProvider
class | VideoMetaData
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenCasting::Util Namespace Reference

  • Namespace List
  • Namespace Members
  • ScreenCasting
  • Util
Classes | Functions

ScreenCasting::Util Namespace Reference

Classes

class | ApiInformation
class | CustomDevicePickerFilter
class | DialLaunchArguments
class | RequiredDeviceProperties
class | ViewLifetimeControl

Functions

delegate void | ViewReleasedHandler (Object sender, EventArgs e)

Function Documentation

delegate void ScreenCasting::Util::ViewReleasedHandler | ( | Object | sender,
 |  | EventArgs | e
 | ) |  |
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ScreenRotation Namespace Reference

  • Namespace List
  • Namespace Members

ScreenRotation Namespace Reference

Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKSample Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Enumerations

SDKSample Namespace Reference

Namespaces

namespace | ProxyStubsForWinRTComponents
namespace | SecondaryViewsHelpers
namespace | WASAPIAudio

Classes

class | MainPage
class | ProjectionViewPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ProjectionViewPageInitializationData
struct | Scenario
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage, StatusMessage, ErrorMessage }
enum | NotifyType { StatusMessage, ErrorMessage, StatusMessage, ErrorMessage }

Enumeration Type Documentation

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 20 of file MainPage.xaml.h.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 19 of file MainPage.xaml.h.

    {
        StatusMessage,
        ErrorMessage
    };

Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKSample::ProxyStubsForWinRTComponents Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKSample
  • ProxyStubsForWinRTComponents
Classes

SDKSample::ProxyStubsForWinRTComponents Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKSample::SecondaryViewsHelpers Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKSample
  • SecondaryViewsHelpers
Classes | Functions

SDKSample::SecondaryViewsHelpers Namespace Reference

Classes

class | sealed

Functions

public delegate void | ViewReleasedHandler (Platform::Object^sender, Platform::Object^e)

Function Documentation

public delegate void SDKSample::SecondaryViewsHelpers::ViewReleasedHandler | ( | Platform::Object^ | sender,
 |  | Platform::Object^ | e
 | ) |  |
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKSample::WASAPIAudio Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKSample
  • WASAPIAudio
Classes | Enumerations | Functions

SDKSample::WASAPIAudio Namespace Reference

Classes

struct | CAPTUREDEVICEPROPS
struct | DEVICEPROPS
class | MFSampleGenerator
class | sealed
class | ToneSampleGenerator
class | WASAPICapture
class | WASAPIRenderer

Enumerations

enum | ContentType { ContentTypeTone, ContentTypeFile }
enum DeviceState {
DeviceStateUnInitialized, DeviceStateInError, DeviceStateDiscontinuity, DeviceStateFlushing,
DeviceStateActivated, DeviceStateInitialized, DeviceStateStarting, DeviceStatePlaying,
DeviceStateCapturing, DeviceStatePausing, DeviceStatePaused, DeviceStateStopping,
DeviceStateStopped
}

Functions

public delegate void | DeviceStateChangedHandler (Platform::Object^sender, DeviceStateChangedEventArgs^e)
public delegate void | PlotDataReadyHandler (Platform::Object^sender, PlotDataReadyEventArgs^e)

Enumeration Type Documentation

enum ContentType
Enumerator:
ContentTypeTone
ContentTypeFile

Definition at line 36 of file WASAPIRenderer.h.

      {
         ContentTypeTone,
         ContentTypeFile
      };

enum DeviceState
Enumerator:
DeviceStateUnInitialized
DeviceStateInError
DeviceStateDiscontinuity
DeviceStateFlushing
DeviceStateActivated
DeviceStateInitialized
DeviceStateStarting
DeviceStatePlaying
DeviceStateCapturing
DeviceStatePausing
DeviceStatePaused
DeviceStateStopping
DeviceStateStopped

Definition at line 27 of file DeviceState.h.

        {
            DeviceStateUnInitialized,
            DeviceStateInError,
            DeviceStateDiscontinuity,
            DeviceStateFlushing,
            DeviceStateActivated,
            DeviceStateInitialized,
            DeviceStateStarting,
            DeviceStatePlaying,
            DeviceStateCapturing,
            DeviceStatePausing,
            DeviceStatePaused,
            DeviceStateStopping,
            DeviceStateStopped
        };

Function Documentation

public delegate void SDKSample::WASAPIAudio::DeviceStateChangedHandler | ( | Platform::Object^ | sender,
 |  | DeviceStateChangedEventArgs^ | e
 | ) |  |
public delegate void SDKSample::WASAPIAudio::PlotDataReadyHandler | ( | Platform::Object^ | sender,
 |  | PlotDataReadyEventArgs^ | e
 | ) |  |
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables

SDKTemplate Namespace Reference

Namespaces

namespace | Common
namespace | Compression
namespace | Controls
namespace | DatagramSocketSample
namespace | DeviceHelpers
namespace | DeviceProperties
namespace | Helpers
namespace | Models
namespace | SampleConstants
namespace | Shared
namespace | SmartCardSample
namespace | StreamSocketSample
namespace | SuperMutt
namespace | Syndication
namespace | Utils
namespace | ViewModels
namespace | WiFiDirectServices
namespace | WiFiScan
namespace | WRLInProcessWinRTComponent
namespace | WRLOutOfProcessWinRTComponent
namespace | XmlLite

Classes

class | Account
class | AccountOverviewPage
class | AccountsHelper
class | AddAuthorizationHeaderFilter
class | App
Provides application-specific behavior to supplement the default Application class. More...
class | AppContactPanel
A page that is hosted within the MyPeople flyout on the taskbar. More...
class | AppException
class | ApplicationTriggerTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | AudioCapturePermissions
class | BackgroundActivity
class | BackgroundAuthenticationCompletedEventArgs
class | BackgroundTaskSample
class | BarcodeScannerInfo
This class is used for data-binding. More...
class | BindingHelpers
class | BindingUtils
class | BitrateHelper
class | BitrateItem
Item which provides a nicer display name for "null" bitrate. More...
class | BluetoothLEDeviceDisplay
Display class used to represent a BluetoothLEDevice in the Device list. More...
class | BooleanToVisibilityConverter
class | CachedFileUpdaterPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | CachedFileUpdaterPageSizeChangedEventArgs
class | CalibrationBar
class | CalligraphicPen
class | CancelCommand
class | CaptureFailedEventArgs
class | ChallengeResponseAlgorithm
class | ChatListView
This ListView is tailored to a Chat experience where the focus is on the last item in the list and as the user scrolls up the older messages are incrementally loaded. More...
class | Cluster
class | CompletedCallback
class | ConnectedDevice
class | ConnectionSettingsPanel
class | Constants
Class containing Attributes and UUIDs that will populate the SDP record. More...
class | Contact
class | Content
class | Conversation
class | CopyFiles
class | CopyImage
class | CopyText
class | CustomCommand
class | CustomEditControl
class | CustomEffectState
class | CustomTextBox
Custom Text box control derived from Textbox class. More...
class | CustomTitleBar
class | CustomTrigger
class | D2DSvgImageRenderer
class | DataHelpers
class | DefaultCloseCommand
class | DetailsPage
class | DeviceConnect
An empty page that can be used on its own or navigated to within a Frame. More...
class | DeviceEvents
class | DeviceHelpers
class | DeviceInformationDisplay
struct | DeviceInformationKindChoice
class | DeviceInformationKindChoices
class | DeviceIO
class | DeviceList
class | DeviceListEntry
class | DeviceReadWrite
class | DeviceSelectorChoices
class | DeviceSelectorInfo
class | DeviceWatcherHelper
Updates an ObservableCollection based on events from a DeviceWatcher. More...
class | DiscoveredDevice
class | DispatcherService
Helper class used to run functions on the UI thread.
class | DisplayHelpers
Helpers for formatting information for display.
class | DownloadOperationItem
class | EdgeTappedListView
class | EnableHelloPage
class | Errors
class | FileExtensions
class | FileLoggingSessionScenario
FileLoggingSessionScenario is a central singleton class which contains the logging-specific sample code. More...
class | FileOpenPickerPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePickerPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePickerPageSizeChangedEventArgs
class | FirmwareAccess
class | FormDecoderExtensions
class | FrameFormatModel
View model for MediaFrameFormat used in XAML ContentControl. More...
class | FrameRenderer
class | FrameSourceGroupModel
View model for MediaFrameSourceGroup used in XAML ContentControl. More...
class | FrameSourceInfoModel
View model for MediaFrameSourceInfo used in XAML ContentControl. More...
struct | FrameSourceState
class | Fx2Driver
class | GeneratedBitmapState
struct | GeoEquals
class | Globals
class | GroupedBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | GroupInfoList
struct | GuidComparer
class | HelperFunctions
class | Helpers
class | HistoryAndRoaming
class | HttpJsonContent
class | ImagePage
Page2 is simply a blank page with a button to navigate back to the MainPage. More...
class | InkRenderer
class | InvalidPageException
class | IsApiPropertyPresentTrigger
class | Item
items that are in the observable collection (ItemList) More...
class | ItemDetails
class | ItemList
observable collection that will contain the list of items. More...
class | JsonRequest
class | KeepConnectionOpenScenario
An empty page that can be used on its own or navigated to within a Frame. More...
class | LampArrayInfo
class | ListViewEdgeTappedEventArgs
class | LocationTrackingReason
Page containing the Extended Execution LocationTracking Reason scenario functions. More...
class | LoggingChannelScenario
Demonstrate usage of LoggingChannel and LoggingActivity. More...
class | LoggingScenarioEventArgs
class | LoggingSessionScenario
LoggingSessionScenario is a central singleton class which contains the logging-specific sample code. More...
class | LookupTable
class | LowLatencyInputMain
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPageSizeChangedEventArgs
class | ManipulationInputProcessor
class | MediaCapturePreviewer
class | MediaFoundationConstants
Assorted Media Foundation constants from the Windows SDK C headers. More...
class | MediaModel
class | MediaPlayerHelper
Allows for disposal of the underlying MediaSources attached to a MediaPlayer, regardless of if a MediaSource or MediaPlaybackItem was passed to the MediaPlayer.
class | MeteringData
An empty page that can be used on its own or navigated to within a Frame. More...
class | MEUserControl
class | MoreSymbols
class | MPEUserControl
class | MultipleTasks
class | NegatingBoolConverter
A value converter which negates a bool. More...
class | OcrCapturedImage
class | OcrFileImage
class | OpenCloseConnectionScenario
An empty page that can be used on its own or navigated to within a Frame. More...
class | OtherScenarios
class | PageDescription
Printable page description. More...
class | PlaceInfo
struct | PlaceLocation
class | PlugInFilter
class | PointOfInterest
class | PresentationFormats
Class containing the details of Gatt characteristics presentation formats. More...
class | PrintHelper
struct | ProtectionLevelSelectorInfo
class | ProtectionSelectorChoices
class | RadioModel
class | ReadBytes
An empty page that can be used on its own or navigated to within a Frame. More...
class | RecognizerHelper
class | RectRenderer
class | RfcommChatDeviceDisplay
class | S1_AddWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...
class | S2_UpdateAndDeleteWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...
class | S3_RetrieveWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...
class | S4_CheckIndexRevision
An empty page that can be used on its own or navigated to within a Frame. More...
class | S5_AddWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...
class | S6_DeleteWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...
class | S7_RetrieveWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...
class | SampleBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | SampleBackgroundTaskWithCondition
An empty page that can be used on its own or navigated to within a Frame. More...
struct | SampleConstants
class | SampleDataModel
class | SavingDataReason
Page containing the Extended Execution SavingData Reason scenario functions. More...
struct | Scenario
Scenario Class Object. More...
class | Scenario01_GetText
class | Scenario02_GetStream
class | Scenario03_GetList
class | Scenario04_PostText
class | Scenario05_PostStream
class | Scenario06_PostMultipart
class | Scenario07_PostStreamWithProgress
class | Scenario08_PostCustomContent
class | Scenario09_GetCookie
class | Scenario0_Choose
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario10_SetCookie
class | Scenario10_UnviewableContent
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario11
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario11_DeleteCookie
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario12
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario12_DisableCookies
class | Scenario13
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario13_RetryFilter
class | Scenario14_MeteredConnectionFilter
class | Scenario15_ServerCertificateValidation
class | Scenario1_AddAccount
class | Scenario1_Advertiser
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Analyze
class | Scenario1_Basic
class | Scenario1_BasicFunctionality
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Basics
This page uses methods of the ApiInformation class to detect the presence of types, methods, events, and enumerated values. More...
class | Scenario1_BasicUserActivity
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_ChatClient
class | Scenario1_Check
class | Scenario1_CheckConsentAvailability
class | Scenario1_Colors
class | Scenario1_Configuration
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Configure
class | Scenario1_ConfigureMobileHotspot
class | Scenario1_Create
class | Scenario1_CreateContact
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_CreateContacts
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_CreateTile
class | Scenario1_CurrentActivity
class | Scenario1_Data
class | Scenario1_DataEvents
class | Scenario1_Default
class | Scenario1_Define
class | Scenario1_DetectInPhoto
Page for demonstrating FaceDetection on an image file. More...
class | Scenario1_DevicePicker
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_DeviceUse
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Directions
class | Scenario1_Discovery
class | Scenario1_DisplayDepthColorIR
class | Scenario1_Download
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Enable
class | Scenario1_EventAndMenuHookup
class | Scenario1_ExampleOperations
Scenario that illustrates using OpenCV along with camera frames. More...
class | Scenario1_ExtractTextSegments
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Files
class | Scenario1_FindClaimEnable
class | Scenario1_FindId
class | Scenario1_FindUsers
class | Scenario1_Geotag
class | Scenario1_GetAndSetPin
class | Scenario1_GetDeviceInformation
class | Scenario1_Initialization
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_InkCanvasTactileFeedback
class | Scenario1_Input
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_LanguageDetection
class | Scenario1_Launch
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Launched
class | Scenario1_LaunchFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_LongAndShortFormats
class | Scenario1_ManageHotspot
class | Scenario1_Metrics
class | Scenario1_Mini
class | Scenario1_MoveCertificate
class | Scenario1_MultiVideoPlayback
Multi-video playback control. More...
class | Scenario1_NavToUrl
class | Scenario1_NetworkConnectivity
class | Scenario1_OpenDrawer
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Orientation
class | Scenario1_ParseAndStringify
class | Scenario1_PercentPermilleFormatting
class | Scenario1_PinTile
class | Scenario1_Prefs
class | Scenario1_PreviewSettings
Scenario 1 Change camera preview settings. More...
class | Scenario1_Print
class | Scenario1_ProvisionTPM
class | Scenario1_ReactiveRequest
This Scenario demonstrates simple Reactive license Acquisition. More...
class | Scenario1_ReadData
class | Scenario1_Render
class | Scenario1_Save
class | Scenario1_SecondaryWindow
class | Scenario1_SelectDisplay
class | Scenario1_SimpleListView
class | Scenario1_SimplestAdaptiveStreaming
See the README.md for discussion of this scenario. More...
class | Scenario1_Single
class | Scenario1_SingleFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_SpellingTextSuggestions
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Toggle
class | Scenario1_TrackInWebcam
Page for demonstrating FaceTracking. More...
class | Scenario1_TrackPosition
class | Scenario1_TrialMode
class | Scenario1_UIFonts
class | Scenario1_UTF8
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario1_Welcome
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Add
class | Scenario2_AdvancedUserActivity
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_BackgroundTask
This page is used to handle authentication by background task scenario. More...
class | Scenario2_Binary
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_ChangePIN
class | Scenario2_ChatServer
class | Scenario2_Client
class | Scenario2_CloseDrawer
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Conditional
This page shows how to use the ApiInformation class in app code to. More...
class | Scenario2_Connector
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Custom
class | Scenario2_DecimalFormatting
class | Scenario2_DelayMini
class | Scenario2_DetectInWebcam
Page for demonstrating FaceDetection on a webcam snapshot. More...
class | Scenario2_DeviceWatcher
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Disable
class | Scenario2_Display
class | Scenario2_DisplayRegion
class | Scenario2_DisplayText
class | Scenario2_DocumentFonts
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Effects
class | Scenario2_Engage
class | Scenario2_EventHandlers
See the README.md for discussion of this scenario. More...
class | Scenario2_Extend
class | Scenario2_FindAvailableSourceGroups
class | Scenario2_GetCurrentTextSegmentFromIndex
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_GetPosition
class | Scenario2_History
class | Scenario2_InAppPurchase
class | Scenario2_Lang
class | Scenario2_Launch
class | Scenario2_LaunchUri
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Listen
Scenario describing how to listen for changes to a GPIO pin value. More...
class | Scenario2_Load
class | Scenario2_Manage
class | Scenario2_ManageAccount
class | Scenario2_Memory
class | Scenario2_MultiFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_Multiple
class | Scenario2_MultipleScanners
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_NavToString
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_NetworkCost
class | Scenario2_Notifications
class | Scenario2_PhotoSettings
Scenario 2 Change camera preview and photo settings. More...
class | Scenario2_Polling
class | Scenario2_PrintReceipt
class | Scenario2_ProactiveRequest
class | Scenario2_ReceiveContact
Page to handle the protocol activation. More...
class | Scenario2_Remove
class | Scenario2_RequestConsent
class | Scenario2_RequestMany
class | Scenario2_ScopedViews
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_ScriptDetection
class | Scenario2_Settings
class | Scenario2_ShakeEvents
class | Scenario2_ShowHideEvents
Sample page to subscribe show/hide event of Touch Keyboard. More...
class | Scenario2_SimpleGridView
class | Scenario2_Stats
class | Scenario2_StringTemplate
class | Scenario2_SupportedTactileFeedback
class | Scenario2_SynchronizingPlayers
Multi-video playback syncronization using TimelineControllerPositionOffset. More...
class | Scenario2_SystemDefaultMenu
class | Scenario2_ToggleMobileHotspot
class | Scenario2_UnpinTile
class | Scenario2_Upload
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2_WatchUsers
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_ActiveSymbologies
class | Scenario3_AdaptiveCard
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_AdaptiveSync
Multi-video live playback synchronization using an AdaptiveMediaSource. More...
class | Scenario3_Add
class | Scenario3_AppCapture
class | Scenario3_AspectRatio
Scenario 3 keep aspect ratios the same. More...
class | Scenario3_BackgroundDeviceWatcher
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_BackgroundTask
class | Scenario3_BgChatServer
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_Calibration
class | Scenario3_ChangeEvents
class | Scenario3_CheckUserConsentGroup
class | Scenario3_ChooseControl
This scenario shows how to choose a user control based on whether a class is present. More...
class | Scenario3_Choosing
class | Scenario3_ClientAuthentication
class | Scenario3_CurrencyFormatting
class | Scenario3_CustomItems
class | Scenario3_Enum
class | Scenario3_EnumerateTiles
class | Scenario3_FixAccount
class | Scenario3_ForegroundApp
The page is used to handle authenticate by foreground app scenario. More...
class | Scenario3_Full
class | Scenario3_HardwareDRM
class | Scenario3_InkingFeedback
class | Scenario3_InvokeScript
class | Scenario3_LaunchAppServices
class | Scenario3_Legacy
class | Scenario3_MasterDetail
class | Scenario3_MultipleClaims
class | Scenario3_MultipleDrawers
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_NetworkConnectivityChanges
class | Scenario3_Notifications
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_ParameterizedTemplate
class | Scenario3_Polling
class | Scenario3_ReceiveFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_Region
class | Scenario3_Replace
class | Scenario3_RequestModification
See the README.md for discussion of this scenario. More...
class | Scenario3_ResetPIN
class | Scenario3_SecondaryTiles
class | Scenario3_ServerForeground
class | Scenario3_SettingContainer
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_ShowHideMethods
Sample page to call TryShow/TryHide methods. More...
class | Scenario3_SingleFolder
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario3_Size
class | Scenario3_Transliteration
class | Scenario3_Trim
class | Scenario3_UnmanagedConsumable
class | Scenario3_UsingWindows
class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_BackgroundActivity
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_ChangeAdminKey
class | Scenario4_ChangeSystemGroup
class | Scenario4_CharacterGrouping
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_CompactOverlay
class | Scenario4_CompletionGroups
class | Scenario4_CompositeSettings
class | Scenario4_ConsumableProduct
A page for fourth scenario. More...
class | Scenario4_EdgeTappedListView
class | Scenario4_ForegroundGeofence
class | Scenario4_Input
class | Scenario4_InteractionFeedback
class | Scenario4_NumberParsing
class | Scenario4_OrientationChanged
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_Override
class | Scenario4_PartialReadWrite
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_ReceiveUri
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_Remove
class | Scenario4_SaveFile
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_ScriptNotify
class | Scenario4_SecureStop
class | Scenario4_Settings
class | Scenario4_ShowView
class | Scenario4_Snapshot
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario4_StateTrigger
this page shows how to use a state trigger to manipulate setter properties if the property is available. More...
class | Scenario4_SymbologyAttributes
class | Scenario4_TilePinned
class | Scenario4_Tuning
See the README.md for discussion of this scenario. More...
class | Scenario4_UnicodeExtensions
class | Scenario4_UpdatingLineDisplayAttributes
class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5_Capabilities
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5_Clear
class | Scenario5_DataEventsBatching
class | Scenario5_DefiningCustomGlyphs
class | Scenario5_DisplayingBarcodePreview
class | Scenario5_GeofenceBackgroundTask
class | Scenario5_GetSingleDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario5_InkingAndInteractionFeedback
class | Scenario5_IsSupported
class | Scenario5_LaunchedFromSecondaryTile
class | Scenario5_Metadata
class | Scenario5_Msappdata
class | Scenario5_NavToFiles
class | Scenario5_RandomAccess
class | Scenario5_RelativePositioning
class | Scenario5_RestoreScrollPosition
class | Scenario5_RoundingAndPadding
class | Scenario5_Show
class | Scenario5_TimeZone
class | Scenario5_TriggerCFU
class | Scenario5_UnicodeExtensions
class | Scenario5_UserCollection
class | Scenario5_VerifyResponse
class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6_AdInsertion
See the README.md for discussion of this scenario. More...
class | Scenario6_AppListingURI
A page for sixth scenario. More...
class | Scenario6_ClearScenario
class | Scenario6_CustomFilterAddedProps
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6_DeleteTPM
class | Scenario6_GetLastVisit
class | Scenario6_ManipulatingCursorAttributes
class | Scenario6_NavToStream
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6_NumeralSystemTranslation
class | Scenario6_RecoverableErrors
class | Scenario6_Recurrence
class | Scenario6_ScrollIntoView
class | Scenario6_SecondaryTileNotification
class | Scenario6_TimeZone
class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario7_B2B
For more details on the business to business APIs, see: https://msdn.microsoft.com/en-us/library/windows/apps/mt609002.aspx. More...
class | Scenario7_DeviceInformationKind
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario7_DownloadReordering
class | Scenario7_ForegroundVisits
class | Scenario7_ListAllCards
class | Scenario7_LiveSeekableRange
See the README.md for discussion of this scenario. More...
class | Scenario7_PinFromAppbar
class | Scenario7_ScrollingContentUsingMarquee
class | Scenario7_SetVersion
class | Scenario7_Share
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario7_UsingUnicodeExtensions
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8_CaptureBitmap
class | Scenario8_PairDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario8_TransferMediaPlayer1
This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...
class | Scenario8_TransmitAPDU
class | Scenario8_UpdateAsync
class | Scenario8_VisitsBackgroundTask
class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario9_ContainsFullScreenElement
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario9_CustomPairDevice
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario9_TransferMediaPlayer2
This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...
class | Scenario_CloudFontOverview
class | Scenario_ContinuousDictation
class | Scenario_ContinuousRecognitionListGrammar
class | Scenario_ContinuousRecognitionSRGSGrammar
class | Scenario_Document1
class | Scenario_Document2
class | Scenario_Document3
class | Scenario_ListConstraint
class | Scenario_PauseAsync
class | Scenario_PredefinedDictationGrammar
class | Scenario_PredefinedWebSearchGrammar
class | Scenario_SampleOverview
class | Scenario_SRGSConstraint
class | Scenario_SynthesizeSSML
class | Scenario_SynthesizeText
class | Scenario_SynthesizeTextBoundaries
class | ScenarioBindingConverter
class | ScenarioCommon
class | SceneComposer
class | School
class | SdkSample
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | SecondaryAppWindowPage
class | SecondaryPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | SecondaryViewPage
class | ServiceViewModel
class | ServicingCompleteTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | SetErrorMessage
class | SetLockScreenImage
struct | Shape
class | ShapeRenderer
class | ShareApplicationLink
class | ShareCustomData
class | ShareCustomProvider
class | ShareDelayRenderedFiles
class | ShareFiles
class | ShareHtml
class | ShareImage
class | SharePage
class | ShareTarget
class | ShareText
class | ShareWebLink
class | ShowPackageFamilyName
An empty page that can be used on its own or navigated to within a Frame. More...
class | SignIn
The sign in form that contains username and password fields and the option to sign in with either Microsoft Passport or traditional username/password authentication. More...
class | SimpleLogger
A simple logger to display text to TextBlock asynchronisely. More...
class | SizePreferenceString
class | SlowInputStream
class | SmartCardListItem
class | SocketReaderWriter
class | SourceGroupCollection
View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl. More...
class | Status
class | StreamResolution
Wrapper class around IMediaEncodingProperties to help how devices report supported resolutions. More...
class | StringTrimmer
class | SubPage
class | SymbologyListEntry
This class is used for data-binding. More...
class | TextMessage
class | TimeTriggeredTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | TrackingEventCue
The custom data that can be created, scheduled then consumed as part of a TimedMetadataTrack which has been added by the app. More...
class | TransportOptions
class | UnspecifiedReason
Page containing the Extended Execution Unspecified Reason scenario functions. More...
class | User
class | UserSelect
The user select page, if users successfully log into the app they will be added to a saved set of users. More...
class | UserViewModel
class | Util
class | Utilities
class | Utils
class | WindowInfo
class | WordOverlay
Wraps recognized word and provides word overlay position and size based on current scale. More...
class | WriteReadStream
An empty page that can be used on its own or navigated to within a Frame. More...

Typedefs

typedef
Windows::Foundation::EventHandler
< Windows::Devices::Custom::CustomDevice^> 		DeviceClosingHandler
typedef std::function< void(int,
byte *, byte *) 		TransformScanline )

Enumerations

enum DeviceState {
Uninitialized, Error, Discontinuity, Flushing,
Activated, Initialized, Starting, Playing,
Capturing, Pausing, Paused, Stopping,
Stopped
}
enum | DeviceType { SuperMutt, All, None }
enum | DisplayContent { Text = 1, Images = 2, TextAndImages = 3 }
enum GattNativeCharacteristicUuid {
None = 0, AlertCategoryID = 0x2A43, AlertCategoryIDBitMask = 0x2A42, AlertLevel = 0x2A06,
AlertNotificationControlPoint = 0x2A44, AlertStatus = 0x2A3F, Appearance = 0x2A01, BatteryLevel = 0x2A19,
BloodPressureFeature = 0x2A49, BloodPressureMeasurement = 0x2A35, BodySensorLocation = 0x2A38, BootKeyboardInputReport = 0x2A22,
BootKeyboardOutputReport = 0x2A32, BootMouseInputReport = 0x2A33, CSCFeature = 0x2A5C, CSCMeasurement = 0x2A5B,
CurrentTime = 0x2A2B, DateTime = 0x2A08, DayDateTime = 0x2A0A, DayofWeek = 0x2A09,
DeviceName = 0x2A00, DSTOffset = 0x2A0D, ExactTime256 = 0x2A0C, FirmwareRevisionString = 0x2A26,
GlucoseFeature = 0x2A51, GlucoseMeasurement = 0x2A18, GlucoseMeasurementContext = 0x2A34, HardwareRevisionString = 0x2A27,
HeartRateControlPoint = 0x2A39, HeartRateMeasurement = 0x2A37, HIDControlPoint = 0x2A4C, HIDInformation = 0x2A4A,
IEEE11073_20601RegulatoryCertificationDataList = 0x2A2A, IntermediateCuffPressure = 0x2A36, IntermediateTemperature = 0x2A1E, LocalTimeInformation = 0x2A0F,
ManufacturerNameString = 0x2A29, MeasurementInterval = 0x2A21, ModelNumberString = 0x2A24, NewAlert = 0x2A46,
PeripheralPreferredConnectionParameters = 0x2A04, PeripheralPrivacyFlag = 0x2A02, PnPID = 0x2A50, ProtocolMode = 0x2A4E,
ReconnectionAddress = 0x2A03, RecordAccessControlPoint = 0x2A52, ReferenceTimeInformation = 0x2A14, Report = 0x2A4D,
ReportMap = 0x2A4B, RingerControlPoint = 0x2A40, RingerSetting = 0x2A41, RSCFeature = 0x2A54,
RSCMeasurement = 0x2A53, SCControlPoint = 0x2A55, ScanIntervalWindow = 0x2A4F, ScanRefresh = 0x2A31,
SensorLocation = 0x2A5D, SerialNumberString = 0x2A25, ServiceChanged = 0x2A05, SoftwareRevisionString = 0x2A28,
SupportedNewAlertCategory = 0x2A47, SupportedUnreadAlertCategory = 0x2A48, SystemID = 0x2A23, TemperatureMeasurement = 0x2A1C,
TemperatureType = 0x2A1D, TimeAccuracy = 0x2A12, TimeSource = 0x2A13, TimeUpdateControlPoint = 0x2A16,
TimeUpdateState = 0x2A17, TimewithDST = 0x2A11, TimeZone = 0x2A0E, TxPowerLevel = 0x2A07,
UnreadAlertStatus = 0x2A45, AggregateInput = 0x2A5A, AnalogInput = 0x2A58, AnalogOutput = 0x2A59,
CyclingPowerControlPoint = 0x2A66, CyclingPowerFeature = 0x2A65, CyclingPowerMeasurement = 0x2A63, CyclingPowerVector = 0x2A64,
DigitalInput = 0x2A56, DigitalOutput = 0x2A57, ExactTime100 = 0x2A0B, LNControlPoint = 0x2A6B,
LNFeature = 0x2A6A, LocationandSpeed = 0x2A67, Navigation = 0x2A68, NetworkAvailability = 0x2A3E,
PositionQuality = 0x2A69, ScientificTemperatureinCelsius = 0x2A3C, SecondaryTimeZone = 0x2A10, String = 0x2A3D,
TemperatureinCelsius = 0x2A1F, TemperatureinFahrenheit = 0x2A20, TimeBroadcast = 0x2A15, BatteryLevelState = 0x2A1B,
BatteryPowerState = 0x2A1A, PulseOximetryContinuousMeasurement = 0x2A5F, PulseOximetryControlPoint = 0x2A62, PulseOximetryFeatures = 0x2A61,
PulseOximetryPulsatileEvent = 0x2A60, SimpleKeyState = 0xFFE1
}
enum GattNativeDescriptorUuid {
CharacteristicExtendedProperties = 0x2900, CharacteristicUserDescription = 0x2901, ClientCharacteristicConfiguration = 0x2902, ServerCharacteristicConfiguration = 0x2903,
CharacteristicPresentationFormat = 0x2904, CharacteristicAggregateFormat = 0x2905, ValidRange = 0x2906, ExternalReportReference = 0x2907,
ReportReference = 0x2908
}
enum GattNativeServiceUuid {
None = 0, AlertNotification = 0x1811, Battery = 0x180F, BloodPressure = 0x1810,
CurrentTimeService = 0x1805, CyclingSpeedandCadence = 0x1816, DeviceInformation = 0x180A, GenericAccess = 0x1800,
GenericAttribute = 0x1801, Glucose = 0x1808, HealthThermometer = 0x1809, HeartRate = 0x180D,
HumanInterfaceDevice = 0x1812, ImmediateAlert = 0x1802, LinkLoss = 0x1803, NextDSTChange = 0x1807,
PhoneAlertStatus = 0x180E, ReferenceTimeUpdateService = 0x1806, RunningSpeedandCadence = 0x1814, ScanParameters = 0x1813,
TxPower = 0x1804, SimpleKeyService = 0xFFE0
}
enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}
enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}
enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
enum | PhotoSize { SizeFullPage, Size4x6, Size5x7, Size8x10 }
enum | Scaling { ShrinkToFit, Crop }

Functions

void | AddAppContentFilesToIndexedFolder ()
void | AddItemsToIndex (Windows::Storage::Search::ContentIndexer^indexer)
void | AddVideoCastingIfSupported (Vector< DeviceSelectorInfo^>^selectors)
delegate void | BackgroundAuthenticationCompletedEventHandler (ScenarioCommon sender, BackgroundAuthenticationCompletedEventArgs e)
void | Button_Click_ApplyNow ()
void | Button_Click_Save ()
delegate void | CaptureFailedHandler (CaptureDevice^sender, CaptureFailedEventArgs^errorEventArgs)
void | CharacteristicList_SelectionChanged ()
void | CharacteristicReadButton_Click ()
void | CharacteristicWriteButton_Click ()
void | CharacteristicWriteButtonInt_Click ()
Concurrency::task< void > | completed_ui_task ()
void | ConnectButton_Click ()
public delegate
Windows::Foundation::Point 		CoordinateTransformationMethod (Windows::Foundation::Numerics::float3)
template<typename Func >
auto | create_delayed_task (std::chrono::milliseconds delay, Func func, concurrency::cancellation_token token=concurrency::cancellation_token::none())-> decltype(create_task(func))
Platform::String | CreateItemString (Platform::String^itemKey, Platform::Collections::Vector< Platform::String^>^propertyKeys, Windows::Foundation::Collections::IMapView< Platform::String^, Platform::Object^>^properties)
void | EnumerateButton_Click ()
String | GetPropertyForDisplay (String key)
std::wstring | GetTimeStamp ()
void | HighlightRanges (Windows::UI::Xaml::Controls::TextBlock^tb, Platform::String^strText, Windows::Foundation::Collections::IVectorView< Windows::Data::Text::TextSegment >^ranges)
Platform::String | HResultToString (int hr)
delegate void | IncomingConnectionEventHandler (Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^args)
void | InitializeRevisionNumber ()
template<typename TLambda >
Concurrency::task< void > | invoke_async_lambda (TLambda lambda)
Boolean | Not (Boolean value)
void | OnIndexerOperationBegin ()
void | OnIndexerOperationComplete (Windows::Storage::Search::ContentIndexer^indexer)
void | PairButton_Click ()
void | PublishButton_ClickAsync ()
Windows Foundation
IAsyncOperation< Boolean > 		RequestPairDeviceAsync (Windows.Devices.Enumeration.DeviceInformationPairing pairing)
void | Reset ()
void | ServiceList_SelectionChanged ()
void | ShowProperties ()
void | StartWatching ()
delegate void | StatusChangedHandler (Platform::Object^sender, LoggingScenarioEventArgs^args)
void | StopWatching ()
Platform::String | StringifyProperty (Platform::Object^property)
Platform::String | StringJoin (Platform::String^delimeter, Windows::Foundation::Collections::IVectorView< Platform::String^>^vector)
void | Update (Windows.Devices.Enumeration.DeviceInformationUpdate deviceInfoUpdate)
void | ValueChangedSubscribeToggle_Click ()
delegate bool | VideoSettingsFilter (Windows::Media::MediaProperties::IMediaEncodingProperties^, unsigned int)

Variables

Int32 | Bars
Boolean | BarsVisible
Int32 | BatteryPercent
Boolean | BatteryVisible
const float | bigRectSize = 200
runtimeclass | BluetoothLEDeviceDisplay
runtimeclass | ConnectedDevice
runtimeclass | ConnectionSettingsPanel
runtimeclass | CopyFiles
runtimeclass | CopyImage
runtimeclass | CopyText
Platform::Array< byte > | CustomOui = ref new Platform::Array<byte>{ 0xAA, 0xBB, 0xCC }
byte | CustomOuiType = 0xDD
runtimeclass | CustomTextBox
runtimeclass | DeviceInformationDisplay
runtimeclass | DiscoveredDevice
String | DisplayName
runtimeclass | HistoryAndRoaming
runtimeclass | HttpJsonContent
Boolean | IsAvailable
Boolean | IsRadioOn
runtimeclass | KeepConnectionOpenScenario
const float | minScreenWidth = 720
Platform::Array< byte > | MsftOui = ref new Platform::Array<byte>{ 0x00, 0x50, 0xF2 }
runtimeclass | OcrCapturedImage
runtimeclass | OcrFileImage
runtimeclass | ODHModel
runtimeclass | OpenCloseConnectionScenario
runtimeclass | OtherScenarios
String | Password
runtimeclass | PlugInFilter
runtimeclass | RadioModel
runtimeclass | Scenario01_GetText
runtimeclass | Scenario02_GetStream
runtimeclass | Scenario03_GetList
runtimeclass | Scenario04_PostText
runtimeclass | Scenario05_PostStream
runtimeclass | Scenario06_PostMultipart
runtimeclass | Scenario07_PostStreamWithProgress
runtimeclass | Scenario08_PostCustomContent
runtimeclass | Scenario09_GetCookie
runtimeclass | Scenario1
runtimeclass | Scenario10
runtimeclass | Scenario10_SetCookie
runtimeclass | Scenario11
runtimeclass | Scenario11_DeleteCookie
runtimeclass | Scenario12_DisableCookies
runtimeclass | Scenario13_RetryFilter
runtimeclass | Scenario14_MeteredConnectionFilter
runtimeclass | Scenario15_ServerCertificateValidation
runtimeclass | Scenario1_Advertiser
runtimeclass | Scenario1_Analyze
runtimeclass | Scenario1_Basic
runtimeclass | Scenario1_BasicFunctionality
runtimeclass | Scenario1_Basics
runtimeclass | Scenario1_Check
runtimeclass | Scenario1_CheckConsentAvailability
runtimeclass | Scenario1_Colors
runtimeclass | Scenario1_Configure
runtimeclass | Scenario1_ConfigureMobileHotspot
runtimeclass | Scenario1_Data
runtimeclass | Scenario1_DataEvents
runtimeclass | Scenario1_DetectInPhoto
runtimeclass | Scenario1_DevicePicker
runtimeclass | Scenario1_Discovery
runtimeclass | Scenario1_Enable
runtimeclass | Scenario1_ExtractTextSegments
runtimeclass | Scenario1_Files
runtimeclass | Scenario1_FindId
runtimeclass | Scenario1_FindUsers
runtimeclass | Scenario1_GetAndSetPin
runtimeclass | Scenario1_InkCanvasTactileFeedback
runtimeclass | Scenario1_LanguageDetection
runtimeclass | Scenario1_Launch
runtimeclass | Scenario1_Launched
runtimeclass | Scenario1_LongAndShortFormats
runtimeclass | Scenario1_ManageHotspot
runtimeclass | Scenario1_MoveCertificate
runtimeclass | Scenario1_NetworkConnectivity
runtimeclass | Scenario1_Orientation
runtimeclass | Scenario1_ParseAndStringify
runtimeclass | Scenario1_PercentPermilleFormatting
runtimeclass | Scenario1_PinTile
runtimeclass | Scenario1_Prefs
runtimeclass | Scenario1_Print
runtimeclass | Scenario1_ProvisionTPM
runtimeclass | Scenario1_ReadData
runtimeclass | Scenario1_Render
runtimeclass | Scenario1_Save
runtimeclass | Scenario1_SecondaryWindow
runtimeclass | Scenario1_SimpleListView
runtimeclass | Scenario1_SingleFile
runtimeclass | Scenario1_Toggle
runtimeclass | Scenario1_TrackInWebcam
runtimeclass | Scenario1_TrackPosition
runtimeclass | Scenario1_UIFonts
runtimeclass | Scenario1_UTF8
runtimeclass | Scenario1_XmlReader
runtimeclass | Scenario2
runtimeclass | Scenario2_Binary
runtimeclass | Scenario2_ChangePIN
runtimeclass | Scenario2_Client
runtimeclass | Scenario2_Connector
runtimeclass | Scenario2_DecimalFormatting
runtimeclass | Scenario2_DetectInWebcam
runtimeclass | Scenario2_DeviceWatcher
runtimeclass | Scenario2_Disable
runtimeclass | Scenario2_DisplayRegion
runtimeclass | Scenario2_DocumentFonts
runtimeclass | Scenario2_Effects
runtimeclass | Scenario2_GetCurrentTextSegmentFromIndex
runtimeclass | Scenario2_GetPosition
runtimeclass | Scenario2_Lang
runtimeclass | Scenario2_Launch
runtimeclass | Scenario2_Listen
runtimeclass | Scenario2_Manage
runtimeclass | Scenario2_Memory
runtimeclass | Scenario2_MultiFile
runtimeclass | Scenario2_MultipleScanners
runtimeclass | Scenario2_NetworkCost
runtimeclass | Scenario2_Notifications
runtimeclass | Scenario2_Polling
runtimeclass | Scenario2_Remove
runtimeclass | Scenario2_RequestConsent
runtimeclass | Scenario2_RequestMany
runtimeclass | Scenario2_ScriptDetection
runtimeclass | Scenario2_Settings
runtimeclass | Scenario2_ShowHideEvents
runtimeclass | Scenario2_SimpleGridView
runtimeclass | Scenario2_Stats
runtimeclass | Scenario2_StringTemplate
runtimeclass | Scenario2_SupportedTactileFeedback
runtimeclass | Scenario2_ToggleMobileHotspot
runtimeclass | Scenario2_UnpinTile
runtimeclass | Scenario2_WatchUsers
runtimeclass | Scenario2_XmlWriter
runtimeclass | Scenario3
runtimeclass | Scenario3_ActiveSymbologies
runtimeclass | Scenario3_AppCapture
runtimeclass | Scenario3_BackgroundDeviceWatcher
runtimeclass | Scenario3_BackgroundTask
runtimeclass | Scenario3_CheckUserConsentGroup
runtimeclass | Scenario3_Choosing
runtimeclass | Scenario3_ClientAuthentication
runtimeclass | Scenario3_CurrencyFormatting
runtimeclass | Scenario3_CustomItems
runtimeclass | Scenario3_Enum
runtimeclass | Scenario3_EnumerateTiles
runtimeclass | Scenario3_InkingFeedback
runtimeclass | Scenario3_MasterDetail
runtimeclass | Scenario3_NetworkConnectivityChanges
runtimeclass | Scenario3_ParameterizedTemplate
runtimeclass | Scenario3_Region
runtimeclass | Scenario3_ResetPIN
runtimeclass | Scenario3_SecondaryTiles
runtimeclass | Scenario3_ServerForeground
runtimeclass | Scenario3_SettingContainer
runtimeclass | Scenario3_ShowHideMethods
runtimeclass | Scenario3_SingleFolder
runtimeclass | Scenario3_Size
runtimeclass | Scenario3_Transliteration
runtimeclass | Scenario3_XmlWriterLite
runtimeclass | Scenario4
runtimeclass | Scenario4_ChangeAdminKey
runtimeclass | Scenario4_ChangeSystemGroup
runtimeclass | Scenario4_CharacterGrouping
runtimeclass | Scenario4_CompactOverlay
runtimeclass | Scenario4_CompositeSettings
runtimeclass | Scenario4_EdgeTappedListView
runtimeclass | Scenario4_ForegroundGeofence
runtimeclass | Scenario4_Input
runtimeclass | Scenario4_InteractionFeedback
runtimeclass | Scenario4_NumberParsing
runtimeclass | Scenario4_Override
runtimeclass | Scenario4_PartialReadWrite
runtimeclass | Scenario4_SaveFile
runtimeclass | Scenario4_ShowView
runtimeclass | Scenario4_Snapshot
runtimeclass | Scenario4_TilePinned
runtimeclass | Scenario4_UnicodeExtensions
runtimeclass | Scenario5
runtimeclass | Scenario5_GeofenceBackgroundTask
runtimeclass | Scenario5_GetSingleDevice
runtimeclass | Scenario5_InkingAndInteractionFeedback
runtimeclass | Scenario5_IsSupported
runtimeclass | Scenario5_LaunchedFromSecondaryTile
runtimeclass | Scenario5_Msappdata
runtimeclass | Scenario5_RelativePositioning
runtimeclass | Scenario5_RestoreScrollPosition
runtimeclass | Scenario5_RoundingAndPadding
runtimeclass | Scenario5_TimeZone
runtimeclass | Scenario5_TriggerCFU
runtimeclass | Scenario5_UnicodeExtensions
runtimeclass | Scenario5_VerifyResponse
runtimeclass | Scenario6
runtimeclass | Scenario6_ClearScenario
runtimeclass | Scenario6_CustomFilterAddedProps
runtimeclass | Scenario6_DeleteTPM
runtimeclass | Scenario6_GetLastVisit
runtimeclass | Scenario6_NumeralSystemTranslation
runtimeclass | Scenario6_ScrollIntoView
runtimeclass | Scenario6_SecondaryTileNotification
runtimeclass | Scenario6_TimeZone
runtimeclass | Scenario7
runtimeclass | Scenario7_DeviceInformationKind
runtimeclass | Scenario7_ForegroundVisits
runtimeclass | Scenario7_ListAllCards
runtimeclass | Scenario7_PinFromAppbar
runtimeclass | Scenario7_SetVersion
runtimeclass | Scenario7_UsingUnicodeExtensions
runtimeclass | Scenario8
runtimeclass | Scenario8_PairDevice
runtimeclass | Scenario8_UpdateAsync
runtimeclass | Scenario8_VisitsBackgroundTask
runtimeclass | Scenario9
runtimeclass | Scenario9_CustomPairDevice
runtimeclass | SecondaryAppWindowPage
runtimeclass | ShowPackageFamilyName
runtimeclass | SlowInputStream
const float | smallRectSize = 125
String | Ssid
Platform::String | strServerPort = "50001"
runtimeclass | UserViewModel
Platform::Array< byte > | WfaOui = ref new Platform::Array<byte>{ 0x50, 0x6F, 0x9A }
runtimeclass | WordOverlay

Typedef Documentation

typedef Windows::Foundation::EventHandler<Windows::Devices::Custom::CustomDevice^> DeviceClosingHandler

Definition at line 36 of file DeviceList.h.

typedef std::function<void(int, byte*, byte*) TransformScanline)

Definition at line 19 of file FrameRenderer.h.

Enumeration Type Documentation

enum DeviceState
Enumerator:
Uninitialized
Error
Discontinuity
Flushing
Activated
Initialized
Starting
Playing
Capturing
Pausing
Paused
Stopping
Stopped

Definition at line 40 of file Project.idl.

    {
        Uninitialized,
        Error,
        Discontinuity,
        Flushing,
        Activated,

        Initialized,
        Starting,
        Playing,
        Capturing,
        Pausing,
        Paused,
        Stopping,
        Stopped,
    };

enum DeviceType
Enumerator:
SuperMutt
All
None

Definition at line 46 of file SampleConfiguration.h.

    {
        SuperMutt,
        All,    // Can be any device
        None
    };

enum DisplayContent
Enumerator:
Text

Show only text.

Images

Show only images.

TextAndImages

Show a combination of images and text.

Definition at line 10 of file Scenario3CustomOptions.xaml.h.

    {
        /// <summary>
        /// Show only text
        /// </summary>
        Text = 1,

        /// <summary>
        /// Show only images
        /// </summary>
        Images = 2,

        /// <summary>
        /// Show a combination of images and text
        /// </summary>
        TextAndImages = 3
    };

enum GattNativeCharacteristicUuid

This enum is nice for finding a string representation of a BT SIG assigned value for Characteristic UUIDs Reference: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx.

Enumerator:
None
AlertCategoryID
AlertCategoryIDBitMask
AlertLevel
AlertNotificationControlPoint
AlertStatus
Appearance
BatteryLevel
BloodPressureFeature
BloodPressureMeasurement
BodySensorLocation
BootKeyboardInputReport
BootKeyboardOutputReport
BootMouseInputReport
CSCFeature
CSCMeasurement
CurrentTime
DateTime
DayDateTime
DayofWeek
DeviceName
DSTOffset
ExactTime256
FirmwareRevisionString
GlucoseFeature
GlucoseMeasurement
GlucoseMeasurementContext
HardwareRevisionString
HeartRateControlPoint
HeartRateMeasurement
HIDControlPoint
HIDInformation
IEEE11073_20601RegulatoryCertificationDataList
IntermediateCuffPressure
IntermediateTemperature
LocalTimeInformation
ManufacturerNameString
MeasurementInterval
ModelNumberString
NewAlert
PeripheralPreferredConnectionParameters
PeripheralPrivacyFlag
PnPID
ProtocolMode
ReconnectionAddress
RecordAccessControlPoint
ReferenceTimeInformation
Report
ReportMap
RingerControlPoint
RingerSetting
RSCFeature
RSCMeasurement
SCControlPoint
ScanIntervalWindow
ScanRefresh
SensorLocation
SerialNumberString
ServiceChanged
SoftwareRevisionString
SupportedNewAlertCategory
SupportedUnreadAlertCategory
SystemID
TemperatureMeasurement
TemperatureType
TimeAccuracy
TimeSource
TimeUpdateControlPoint
TimeUpdateState
TimewithDST
TimeZone
TxPowerLevel
UnreadAlertStatus
AggregateInput
AnalogInput
AnalogOutput
CyclingPowerControlPoint
CyclingPowerFeature
CyclingPowerMeasurement
CyclingPowerVector
DigitalInput
DigitalOutput
ExactTime100
LNControlPoint
LNFeature
LocationandSpeed
Navigation
NetworkAvailability
PositionQuality
ScientificTemperatureinCelsius
SecondaryTimeZone
String
TemperatureinCelsius
TemperatureinFahrenheit
TimeBroadcast
BatteryLevelState
BatteryPowerState
PulseOximetryContinuousMeasurement
PulseOximetryControlPoint
PulseOximetryFeatures
PulseOximetryPulsatileEvent
SimpleKeyState

Definition at line 172 of file DisplayHelpers.cs.

                                             : ushort
    {
        None = 0,
        AlertCategoryID = 0x2A43,
        AlertCategoryIDBitMask = 0x2A42,
        AlertLevel = 0x2A06,
        AlertNotificationControlPoint = 0x2A44,
        AlertStatus = 0x2A3F,
        Appearance = 0x2A01,
        BatteryLevel = 0x2A19,
        BloodPressureFeature = 0x2A49,
        BloodPressureMeasurement = 0x2A35,
        BodySensorLocation = 0x2A38,
        BootKeyboardInputReport = 0x2A22,
        BootKeyboardOutputReport = 0x2A32,
        BootMouseInputReport = 0x2A33,
        CSCFeature = 0x2A5C,
        CSCMeasurement = 0x2A5B,
        CurrentTime = 0x2A2B,
        DateTime = 0x2A08,
        DayDateTime = 0x2A0A,
        DayofWeek = 0x2A09,
        DeviceName = 0x2A00,
        DSTOffset = 0x2A0D,
        ExactTime256 = 0x2A0C,
        FirmwareRevisionString = 0x2A26,
        GlucoseFeature = 0x2A51,
        GlucoseMeasurement = 0x2A18,
        GlucoseMeasurementContext = 0x2A34,
        HardwareRevisionString = 0x2A27,
        HeartRateControlPoint = 0x2A39,
        HeartRateMeasurement = 0x2A37,
        HIDControlPoint = 0x2A4C,
        HIDInformation = 0x2A4A,
        IEEE11073_20601RegulatoryCertificationDataList = 0x2A2A,
        IntermediateCuffPressure = 0x2A36,
        IntermediateTemperature = 0x2A1E,
        LocalTimeInformation = 0x2A0F,
        ManufacturerNameString = 0x2A29,
        MeasurementInterval = 0x2A21,
        ModelNumberString = 0x2A24,
        NewAlert = 0x2A46,
        PeripheralPreferredConnectionParameters = 0x2A04,
        PeripheralPrivacyFlag = 0x2A02,
        PnPID = 0x2A50,
        ProtocolMode = 0x2A4E,
        ReconnectionAddress = 0x2A03,
        RecordAccessControlPoint = 0x2A52,
        ReferenceTimeInformation = 0x2A14,
        Report = 0x2A4D,
        ReportMap = 0x2A4B,
        RingerControlPoint = 0x2A40,
        RingerSetting = 0x2A41,
        RSCFeature = 0x2A54,
        RSCMeasurement = 0x2A53,
        SCControlPoint = 0x2A55,
        ScanIntervalWindow = 0x2A4F,
        ScanRefresh = 0x2A31,
        SensorLocation = 0x2A5D,
        SerialNumberString = 0x2A25,
        ServiceChanged = 0x2A05,
        SoftwareRevisionString = 0x2A28,
        SupportedNewAlertCategory = 0x2A47,
        SupportedUnreadAlertCategory = 0x2A48,
        SystemID = 0x2A23,
        TemperatureMeasurement = 0x2A1C,
        TemperatureType = 0x2A1D,
        TimeAccuracy = 0x2A12,
        TimeSource = 0x2A13,
        TimeUpdateControlPoint = 0x2A16,
        TimeUpdateState = 0x2A17,
        TimewithDST = 0x2A11,
        TimeZone = 0x2A0E,
        TxPowerLevel = 0x2A07,
        UnreadAlertStatus = 0x2A45,
        AggregateInput = 0x2A5A,
        AnalogInput = 0x2A58,
        AnalogOutput = 0x2A59,
        CyclingPowerControlPoint = 0x2A66,
        CyclingPowerFeature = 0x2A65,
        CyclingPowerMeasurement = 0x2A63,
        CyclingPowerVector = 0x2A64,
        DigitalInput = 0x2A56,
        DigitalOutput = 0x2A57,
        ExactTime100 = 0x2A0B,
        LNControlPoint = 0x2A6B,
        LNFeature = 0x2A6A,
        LocationandSpeed = 0x2A67,
        Navigation = 0x2A68,
        NetworkAvailability = 0x2A3E,
        PositionQuality = 0x2A69,
        ScientificTemperatureinCelsius = 0x2A3C,
        SecondaryTimeZone = 0x2A10,
        String = 0x2A3D,
        TemperatureinCelsius = 0x2A1F,
        TemperatureinFahrenheit = 0x2A20,
        TimeBroadcast = 0x2A15,
        BatteryLevelState = 0x2A1B,
        BatteryPowerState = 0x2A1A,
        PulseOximetryContinuousMeasurement = 0x2A5F,
        PulseOximetryControlPoint = 0x2A62,
        PulseOximetryFeatures = 0x2A61,
        PulseOximetryPulsatileEvent = 0x2A60,
        SimpleKeyState = 0xFFE1
    }

enum GattNativeDescriptorUuid

This enum assists in finding a string representation of a BT SIG assigned value for Descriptor UUIDs Reference: https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx.

Enumerator:
CharacteristicExtendedProperties
CharacteristicUserDescription
ClientCharacteristicConfiguration
ServerCharacteristicConfiguration
CharacteristicPresentationFormat
CharacteristicAggregateFormat
ValidRange
ExternalReportReference
ReportReference

Definition at line 282 of file DisplayHelpers.cs.

                                         : ushort
    {
        CharacteristicExtendedProperties = 0x2900,
        CharacteristicUserDescription = 0x2901,
        ClientCharacteristicConfiguration = 0x2902,
        ServerCharacteristicConfiguration = 0x2903,
        CharacteristicPresentationFormat = 0x2904,
        CharacteristicAggregateFormat = 0x2905,
        ValidRange = 0x2906,
        ExternalReportReference = 0x2907,
        ReportReference = 0x2908
    }

enum GattNativeServiceUuid

This enum assists in finding a string representation of a BT SIG assigned value for Service UUIDS Reference: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx.

Enumerator:
None
AlertNotification
Battery
BloodPressure
CurrentTimeService
CyclingSpeedandCadence
DeviceInformation
GenericAccess
GenericAttribute
Glucose
HealthThermometer
HeartRate
HumanInterfaceDevice
ImmediateAlert
LinkLoss
NextDSTChange
PhoneAlertStatus
ReferenceTimeUpdateService
RunningSpeedandCadence
ScanParameters
TxPower
SimpleKeyService

Definition at line 142 of file DisplayHelpers.cs.

                                      : ushort
    {
        None = 0,
        AlertNotification = 0x1811,
        Battery = 0x180F,
        BloodPressure = 0x1810,
        CurrentTimeService = 0x1805,
        CyclingSpeedandCadence = 0x1816,
        DeviceInformation = 0x180A,
        GenericAccess = 0x1800,
        GenericAttribute = 0x1801,
        Glucose = 0x1808,
        HealthThermometer = 0x1809,
        HeartRate = 0x180D,
        HumanInterfaceDevice = 0x1812,
        ImmediateAlert = 0x1802,
        LinkLoss = 0x1803,
        NextDSTChange = 0x1807,
        PhoneAlertStatus = 0x180E,
        ReferenceTimeUpdateService = 0x1806,
        RunningSpeedandCadence = 0x1814,
        ScanParameters = 0x1813,
        TxPower = 0x1804,
        SimpleKeyService = 0xFFE0
    }

enum LoggingScenarioEventType
Enumerator:
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled

Definition at line 15 of file LoggingScenarioEventArgs.h.

    {
        BusyStatusChanged,
        LogFileGenerated,
        LogFileGeneratedAtDisable,
        LogFileGeneratedAtSuspend,
        LoggingEnabledDisabled
    };

enum LoggingScenarioEventType
Enumerator:
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled

Definition at line 34 of file Project.idl.

    {
        BusyStatusChanged,
        LogFileGenerated,
        LogFileGeneratedAtDisable,
        LogFileGeneratedAtSuspend,
        LoggingEnabledDisabled,
    };

enum LoggingScenarioEventType

LoggingScenario tells the UI what's happening by using the following enums.

Enumerator:
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled
BusyStatusChanged
LogFileGenerated
LogFileGeneratedAtDisable
LogFileGeneratedAtSuspend
LoggingEnabledDisabled

Definition at line 15 of file LoggingScenarioEventArgs.cs.

    {
        BusyStatusChanged,
        LogFileGenerated,
        LogFileGeneratedAtDisable,
        LogFileGeneratedAtSuspend,
        LoggingEnabledDisabled
    }

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 61 of file SampleConfiguration.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 114 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 134 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 117 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 19 of file MainPage.xaml.h.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 143 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 121 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 117 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 117 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 110 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 118 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 90 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 19 of file MainPage.xaml.h.

    {
        StatusMessage,
        ErrorMessage
    };

enum NotifyType
Enumerator:
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage
StatusMessage
ErrorMessage

Definition at line 90 of file MainPage.xaml.cs.

    {
        StatusMessage,
        ErrorMessage
    };

enum PhotoSize

Photo size options.

Enumerator:
SizeFullPage
Size4x6
Size5x7
Size8x10

Definition at line 13 of file Scenario5Photos.xaml.h.

                   : byte
    {
        SizeFullPage,
        Size4x6,
        Size5x7,
        Size8x10
    };

enum Scaling

Photo scaling options.

Enumerator:
ShrinkToFit
Crop

Definition at line 24 of file Scenario5Photos.xaml.h.

                 : byte
    {
        ShrinkToFit,
        Crop
    };

Function Documentation

void SDKTemplate::AddAppContentFilesToIndexedFolder ( ) [inline]

Definition at line 106 of file Helpers.h.

    {
        auto localFolder = Windows::Storage::ApplicationData::Current->LocalFolder;
        auto installDirectory = Windows::ApplicationModel::Package::Current->InstalledLocation;
        auto outputStrings = ref new Platform::Collections::Vector<Platform::String^>();
        outputStrings->Append(L"Items added to the \"Indexed\" folder:");
        Concurrency::create_task(installDirectory->GetFolderAsync(L"appcontent-ms")).then(
        [outputStrings, localFolder](Windows::Storage::StorageFolder^ appContentFolder)
        {
            return Concurrency::create_task(appContentFolder->GetFilesAsync()).then(
            [outputStrings, localFolder] (Windows::Foundation::Collections::IVectorView<Windows::Storage::StorageFile^>^ files)
            {
                return Concurrency::create_task(localFolder->CreateFolderAsync(L"Indexed", Windows::Storage::CreationCollisionOption::OpenIfExists)).then(
                [outputStrings, files](Windows::Storage::StorageFolder^ indexedFolder)
                {
                    std::vector<Concurrency::task<Windows::Storage::StorageFile^>> copyTasks;
                    for (const auto& file : files)
                    {
                        copyTasks.push_back(Concurrency::create_task(file->CopyAsync(indexedFolder, file->Name, Windows::Storage::NameCollisionOption::ReplaceExisting)));
                        outputStrings->Append(L"\n" + file->DisplayName + file->FileType);
                    }
                    return Concurrency::when_all(copyTasks.begin(), copyTasks.end());
                });
            });
        }).then([outputStrings](std::vector<Windows::Storage::StorageFile^> files)
        {
            auto outputString = ref new Platform::String(L"");
            for (const auto& str : outputStrings)
            {
                outputString += str;
            }

void SDKTemplate::AddItemsToIndex ( Windows::Storage::Search::ContentIndexer^ indexer ) [inline]

Definition at line 55 of file Helpers.h.

    {
        const int numberOfItemsToIndex = 3;
        Concurrency::task<void> addItemTasks;
        for (int i = 0; i < numberOfItemsToIndex; i++)
        {
            auto content = ref new Windows::Storage::Search::IndexableContent();
            content->Id = L"SampleKey" + i;
            content->Properties->Insert(Windows::Storage::SystemProperties::ItemNameDisplay, L"Sample Item Name " + i);
            content->Properties->Insert(Windows::Storage::SystemProperties::Keywords, L"Sample keyword " + i);
            content->Properties->Insert(Windows::Storage::SystemProperties::Comment, L"Sample comment " + i);
            OnIndexerOperationBegin();
            auto nextTask = Concurrency::create_task(indexer->AddAsync(content));
            addItemTasks = (i == 0) ? nextTask : (addItemTasks && nextTask);
        }

        addItemTasks.then([indexer]()
        {
            OnIndexerOperationComplete(indexer);
            auto propertyKeys = ref new Platform::Collections::Vector<Platform::String^>();
            propertyKeys->Append(Windows::Storage::SystemProperties::ItemNameDisplay);
            auto query = indexer->CreateQuery(L"*", propertyKeys);
            return query->GetCountAsync();
        }).then([](unsigned int count)
        {

void SDKTemplate::AddVideoCastingIfSupported ( Vector< DeviceSelectorInfo^>^ selectors )

Definition at line 136 of file DisplayHelpers.cpp.

    {
        try
        {
            selectors->Append(DeviceSelectorChoices::VideoCasting);
        }
        catch (Exception^ ex)
        {
            if (ex->HResult == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED))
            {
                // Video casting not supported by the system.
            }
            else
            {
                throw;
            }
        }
    }

delegate void SDKTemplate::BackgroundAuthenticationCompletedEventHandler | ( | ScenarioCommon | sender,
 |  | BackgroundAuthenticationCompletedEventArgs | e
 | ) |  |
void SDKTemplate::Button_Click_ApplyNow ( )
void SDKTemplate::Button_Click_Save ( )
delegate void SDKTemplate::CaptureFailedHandler | ( | CaptureDevice^ | sender,
 |  | CaptureFailedEventArgs^ | errorEventArgs
 | ) |  |
void SDKTemplate::CharacteristicList_SelectionChanged ( )
void SDKTemplate::CharacteristicReadButton_Click ( )
void SDKTemplate::CharacteristicWriteButton_Click ( )
void SDKTemplate::CharacteristicWriteButtonInt_Click ( )
Concurrency::task<void> SDKTemplate::completed_ui_task ( ) [inline]

Definition at line 74 of file SampleConfiguration.h.

    {
        return Concurrency::create_task(concurrency::create_async([] {}));
    }

void SDKTemplate::ConnectButton_Click ( )
public delegate Windows::Foundation::Point SDKTemplate::CoordinateTransformationMethod ( Windows::Foundation::Numerics::float3 )
auto SDKTemplate::create_delayed_task | ( | std::chrono::milliseconds | delay,
 |  | Func | func,
 |  | concurrency::cancellation_token | token = concurrency::cancellation_token::none()
 | ) |  |

Definition at line 47 of file LoggingScenarioHelpers.h.

    {
        concurrency::task_completion_event<void> tce;

        auto pTimer = new concurrency::timer<int>(static_cast<int>(delay.count()), 0, NULL, false);
        auto pCallback = new concurrency::call<int>([tce](int)
        {
            tce.set();
        });

        pTimer->link_target(pCallback);
        pTimer->start();

        return create_task(tce).then([pCallback, pTimer]()
        {
            delete pCallback;
            delete pTimer;
        }).then(func, token);
    }

Platform::String SDKTemplate::CreateItemString | ( | Platform::String^ | itemKey,
 |  | Platform::Collections::Vector< Platform::String^>^ | propertyKeys,
 |  | Windows::Foundation::Collections::IMapView< Platform::String^, Platform::Object^>^ | properties |
 | ) |  |  | [inline]

Definition at line 84 of file Helpers.h.

    {
        Platform::String^ itemString = L"Key: " + itemKey + L"\n";
        for (const auto& propkey : propertyKeys)
        {
            itemString += propkey + L": " + StringifyProperty(properties->Lookup(propkey)) + L"\n";

void SDKTemplate::EnumerateButton_Click ( )
String SDKTemplate::GetPropertyForDisplay ( String key )
std::wstring SDKTemplate::GetTimeStamp ( ) [inline]

Definition at line 25 of file LoggingScenarioHelpers.h.

    {
        std::wstring result;
        SYSTEMTIME timeNow;
        GetLocalTime(&timeNow);
        result.resize(16);
        swprintf_s(
            &result[0],
            result.size() + 1,
            L"%02u%02u%02u-%02u%02u%02u%03u",
            timeNow.wYear - 2000,
            timeNow.wMonth,
            timeNow.wDay,
            timeNow.wHour,
            timeNow.wMinute,
            timeNow.wSecond,
            timeNow.wMilliseconds);
        return result;
    }

void SDKTemplate::HighlightRanges | ( | Windows::UI::Xaml::Controls::TextBlock^ | tb,
 |  | Platform::String^ | strText,
 |  | Windows::Foundation::Collections::IVectorView< Windows::Data::Text::TextSegment >^ | ranges
 | ) |  |
Platform::String SDKTemplate::HResultToString ( int hr ) [inline]

Definition at line 96 of file Helpers.h.

    {
        wchar_t hresultBuffer[11];

delegate void SDKTemplate::IncomingConnectionEventHandler | ( | Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^ | sender,
 |  | Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^ | args
 | ) |  |
void SDKTemplate::InitializeRevisionNumber ( ) [inline]

Definition at line 5 of file Helpers.h.

{
    inline void InitializeRevisionNumber()
    {
        // This initializes the value used throughout the sample which tracks the expected index revision number. This
        // value is used to check if the app's expected revision number matches the actual index revision number and is
        // stored in the app's local settings to allow it to persist across termination.
        auto localSettings = Windows::Storage::ApplicationData::Current->LocalSettings;
        if (!localSettings->Values->HasKey(L"expectedIndexRevision"))
        {

Concurrency::task<void> SDKTemplate::invoke_async_lambda ( TLambda lambda )

Definition at line 94 of file SampleConfiguration.h.

    {
        co_await lambda();
    }

Boolean SDKTemplate::Not ( Boolean value )
void SDKTemplate::OnIndexerOperationBegin ( ) [inline]

Definition at line 17 of file Helpers.h.

    {
        // Update the expected index revision number in expectation of the call that's about to be made
        auto localSettings = Windows::Storage::ApplicationData::Current->LocalSettings;

void SDKTemplate::OnIndexerOperationComplete ( Windows::Storage::Search::ContentIndexer^ indexer ) [inline]

Definition at line 25 of file Helpers.h.

    {
        // Set the expectedIndexRevision to be the reported index revision number because the operation
        // has succeeded

void SDKTemplate::PairButton_Click ( )
void SDKTemplate::PublishButton_ClickAsync ( )
Windows Foundation IAsyncOperation<Boolean> SDKTemplate::RequestPairDeviceAsync ( Windows.Devices.Enumeration.DeviceInformationPairing pairing )
void SDKTemplate::Reset ( )
void SDKTemplate::ServiceList_SelectionChanged ( )
void SDKTemplate::ShowProperties ( )
void SDKTemplate::StartWatching ( )
delegate void SDKTemplate::StatusChangedHandler | ( | Platform::Object^ | sender,
 |  | LoggingScenarioEventArgs^ | args
 | ) |  |
void SDKTemplate::StopWatching ( )
Platform::String SDKTemplate::StringifyProperty ( Platform::Object^ property ) [inline]

Definition at line 34 of file Helpers.h.

    {
        Platform::String^ propertyString;
        // We need special handling to stringify vector properties such as the Keywords property.
        auto vectorProperty = dynamic_cast<Platform::IBoxArray<Platform::String^>^>(property);
        if (vectorProperty != nullptr)
        {
            for (const auto& str : vectorProperty->Value)
            {
                propertyString += str + L"; ";
            }
        }
        else
        {
            propertyString = property->ToString();

Platform::String SDKTemplate::StringJoin | ( | Platform::String^ | delimeter,
 |  | Windows::Foundation::Collections::IVectorView< Platform::String^>^ | vector
 | ) |  |
void SDKTemplate::Update ( Windows.Devices.Enumeration.DeviceInformationUpdate deviceInfoUpdate )
void SDKTemplate::ValueChangedSubscribeToggle_Click ( )
delegate bool SDKTemplate::VideoSettingsFilter | ( | Windows::Media::MediaProperties::IMediaEncodingProperties^ | ,
 |  | unsigned | int
 | ) |  |

Variable Documentation

Int32 Bars

Definition at line 30 of file Project.idl.

Boolean BarsVisible

Definition at line 29 of file Project.idl.

Int32 BatteryPercent

Definition at line 32 of file Project.idl.

Boolean BatteryVisible

Definition at line 31 of file Project.idl.

const float bigRectSize = 200

Definition at line 17 of file Constants.h.

runtimeclass BluetoothLEDeviceDisplay

Display class used to represent a BluetoothLEDevice in the Device list.

Definition at line 54 of file Project.idl.

runtimeclass ConnectedDevice

Definition at line 47 of file Project.idl.

runtimeclass ConnectionSettingsPanel

Definition at line 29 of file Project.idl.

runtimeclass CopyFiles

Definition at line 29 of file Project.idl.

runtimeclass CopyImage

Definition at line 23 of file Project.idl.

runtimeclass CopyText

Definition at line 17 of file Project.idl.

Platform::Array< byte > CustomOui = ref new Platform::Array<byte>{ 0xAA, 0xBB, 0xCC }

Definition at line 22 of file SocketReaderWriter.cpp.

byte CustomOuiType = 0xDD

Definition at line 23 of file SocketReaderWriter.cpp.

runtimeclass CustomTextBox

Definition at line 41 of file Project.idl.

runtimeclass DeviceInformationDisplay

Definition at line 18 of file Project.idl.

runtimeclass DiscoveredDevice

Definition at line 47 of file Project.idl.

String DisplayName

Definition at line 26 of file Project.idl.

runtimeclass HistoryAndRoaming

Definition at line 35 of file Project.idl.

runtimeclass HttpJsonContent

Definition at line 116 of file Project.idl.

Boolean IsAvailable

Definition at line 28 of file Project.idl.

Boolean IsRadioOn

Definition at line 23 of file Project.idl.

runtimeclass KeepConnectionOpenScenario

Definition at line 23 of file Project.idl.

const float minScreenWidth = 720

Definition at line 19 of file Constants.h.

Platform::Array< byte > MsftOui = ref new Platform::Array<byte>{ 0x00, 0x50, 0xF2 }

Definition at line 25 of file SocketReaderWriter.cpp.

runtimeclass OcrCapturedImage

Definition at line 23 of file Project.idl.

runtimeclass OcrFileImage

Definition at line 17 of file Project.idl.

runtimeclass ODHModel

Definition at line 19 of file Project.idl.

runtimeclass OpenCloseConnectionScenario

Definition at line 17 of file Project.idl.

runtimeclass OtherScenarios

Definition at line 41 of file Project.idl.

String Password

Definition at line 34 of file Project.idl.

runtimeclass PlugInFilter

Definition at line 106 of file Project.idl.

runtimeclass RadioModel

Definition at line 23 of file Project.idl.

runtimeclass Scenario01_GetText

Definition at line 17 of file Project.idl.

runtimeclass Scenario02_GetStream

Definition at line 23 of file Project.idl.

runtimeclass Scenario03_GetList

Definition at line 29 of file Project.idl.

runtimeclass Scenario04_PostText

Definition at line 35 of file Project.idl.

runtimeclass Scenario05_PostStream

Definition at line 41 of file Project.idl.

runtimeclass Scenario06_PostMultipart

Definition at line 47 of file Project.idl.

runtimeclass Scenario07_PostStreamWithProgress

Definition at line 53 of file Project.idl.

runtimeclass Scenario08_PostCustomContent

Definition at line 59 of file Project.idl.

runtimeclass Scenario09_GetCookie

Definition at line 65 of file Project.idl.

runtimeclass Scenario1

Definition at line 17 of file Project.idl.

runtimeclass Scenario10

Definition at line 71 of file Project.idl.

runtimeclass Scenario10_SetCookie

Definition at line 71 of file Project.idl.

runtimeclass Scenario11

Definition at line 77 of file Project.idl.

runtimeclass Scenario11_DeleteCookie

Definition at line 77 of file Project.idl.

runtimeclass Scenario12_DisableCookies

Definition at line 83 of file Project.idl.

runtimeclass Scenario13_RetryFilter

Definition at line 89 of file Project.idl.

runtimeclass Scenario14_MeteredConnectionFilter

Definition at line 95 of file Project.idl.

runtimeclass Scenario15_ServerCertificateValidation

Definition at line 101 of file Project.idl.

runtimeclass Scenario1_Advertiser

Definition at line 16 of file Project.idl.

runtimeclass Scenario1_Analyze

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Basic

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_BasicFunctionality

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Basics

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Check

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_CheckConsentAvailability

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Colors

Definition at line 15 of file Project.idl.

runtimeclass Scenario1_Configure

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ConfigureMobileHotspot

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Data

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_DataEvents

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_DetectInPhoto

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_DevicePicker

Definition at line 43 of file Project.idl.

runtimeclass Scenario1_Discovery

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Enable

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ExtractTextSegments

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Files

Definition at line 7 of file Project.idl.

runtimeclass Scenario1_FindId

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_FindUsers

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_GetAndSetPin

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_InkCanvasTactileFeedback

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_LanguageDetection

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Launch

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Launched

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_LongAndShortFormats

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ManageHotspot

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_MoveCertificate

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_NetworkConnectivity

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Orientation

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ParseAndStringify

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_PercentPermilleFormatting

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_PinTile

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Prefs

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Print

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ProvisionTPM

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_ReadData

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Render

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Save

Definition at line 6 of file Project.idl.

runtimeclass Scenario1_SecondaryWindow

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_SimpleListView

Definition at line 16 of file Project.idl.

runtimeclass Scenario1_SingleFile

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_Toggle

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_TrackInWebcam

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_TrackPosition

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_UIFonts

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_UTF8

Definition at line 17 of file Project.idl.

runtimeclass Scenario1_XmlReader

Definition at line 17 of file Project.idl.

runtimeclass Scenario2

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Binary

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_ChangePIN

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Client

Definition at line 30 of file Project.idl.

runtimeclass Scenario2_Connector

Definition at line 17 of file Project.idl.

runtimeclass Scenario2_DecimalFormatting

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_DetectInWebcam

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_DeviceWatcher

Definition at line 54 of file Project.idl.

runtimeclass Scenario2_Disable

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_DisplayRegion

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_DocumentFonts

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Effects

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_GetCurrentTextSegmentFromIndex

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_GetPosition

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Lang

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Launch

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Listen

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Manage

Definition at line 12 of file Project.idl.

runtimeclass Scenario2_Memory

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_MultiFile

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_MultipleScanners

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_NetworkCost

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Notifications

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Polling

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Remove

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_RequestConsent

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_RequestMany

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_ScriptDetection

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_Settings

Definition at line 13 of file Project.idl.

runtimeclass Scenario2_ShowHideEvents

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_SimpleGridView

Definition at line 17 of file Project.idl.

runtimeclass Scenario2_Stats

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_StringTemplate

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_SupportedTactileFeedback

Definition at line 19 of file Project.idl.

runtimeclass Scenario2_ToggleMobileHotspot

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_UnpinTile

Definition at line 23 of file Project.idl.

runtimeclass Scenario2_WatchUsers

Definition at line 25 of file Project.idl.

runtimeclass Scenario2_XmlWriter

Definition at line 23 of file Project.idl.

runtimeclass Scenario3

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_ActiveSymbologies

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_AppCapture

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_BackgroundDeviceWatcher

Definition at line 60 of file Project.idl.

runtimeclass Scenario3_BackgroundTask

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_CheckUserConsentGroup

Definition at line 35 of file Project.idl.

runtimeclass Scenario3_Choosing

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_ClientAuthentication

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_CurrencyFormatting

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_CustomItems

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_Enum

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_EnumerateTiles

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_InkingFeedback

Definition at line 31 of file Project.idl.

runtimeclass Scenario3_MasterDetail

Definition at line 23 of file Project.idl.

runtimeclass Scenario3_NetworkConnectivityChanges

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_ParameterizedTemplate

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_Region

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_ResetPIN

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_SecondaryTiles

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_ServerForeground

Definition at line 44 of file Project.idl.

runtimeclass Scenario3_SettingContainer

Definition at line 19 of file Project.idl.

runtimeclass Scenario3_ShowHideMethods

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_SingleFolder

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_Size

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_Transliteration

Definition at line 29 of file Project.idl.

runtimeclass Scenario3_XmlWriterLite

Definition at line 29 of file Project.idl.

runtimeclass Scenario4

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_ChangeAdminKey

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_ChangeSystemGroup

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_CharacterGrouping

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_CompactOverlay

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_CompositeSettings

Definition at line 25 of file Project.idl.

runtimeclass Scenario4_EdgeTappedListView

Definition at line 29 of file Project.idl.

runtimeclass Scenario4_ForegroundGeofence

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_Input

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_InteractionFeedback

Definition at line 37 of file Project.idl.

runtimeclass Scenario4_NumberParsing

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_Override

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_PartialReadWrite

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_SaveFile

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_ShowView

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_Snapshot

Definition at line 66 of file Project.idl.

runtimeclass Scenario4_TilePinned

Definition at line 35 of file Project.idl.

runtimeclass Scenario4_UnicodeExtensions

Definition at line 35 of file Project.idl.

runtimeclass Scenario5

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_GeofenceBackgroundTask

Definition at line 36 of file Project.idl.

runtimeclass Scenario5_GetSingleDevice

Definition at line 72 of file Project.idl.

runtimeclass Scenario5_InkingAndInteractionFeedback

Definition at line 43 of file Project.idl.

runtimeclass Scenario5_IsSupported

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_LaunchedFromSecondaryTile

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_Msappdata

Definition at line 31 of file Project.idl.

runtimeclass Scenario5_RelativePositioning

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_RestoreScrollPosition

Definition at line 47 of file Project.idl.

runtimeclass Scenario5_RoundingAndPadding

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_TimeZone

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_TriggerCFU

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_UnicodeExtensions

Definition at line 41 of file Project.idl.

runtimeclass Scenario5_VerifyResponse

Definition at line 41 of file Project.idl.

runtimeclass Scenario6

Definition at line 47 of file Project.idl.

runtimeclass Scenario6_ClearScenario

Definition at line 37 of file Project.idl.

runtimeclass Scenario6_CustomFilterAddedProps

Definition at line 78 of file Project.idl.

runtimeclass Scenario6_DeleteTPM

Definition at line 47 of file Project.idl.

runtimeclass Scenario6_GetLastVisit

Definition at line 48 of file Project.idl.

runtimeclass Scenario6_NumeralSystemTranslation

Definition at line 47 of file Project.idl.

runtimeclass Scenario6_ScrollIntoView

Definition at line 48 of file Project.idl.

runtimeclass Scenario6_SecondaryTileNotification

Definition at line 47 of file Project.idl.

runtimeclass Scenario6_TimeZone

Definition at line 47 of file Project.idl.

runtimeclass Scenario7

Definition at line 53 of file Project.idl.

runtimeclass Scenario7_DeviceInformationKind

Definition at line 84 of file Project.idl.

runtimeclass Scenario7_ForegroundVisits

Definition at line 54 of file Project.idl.

runtimeclass Scenario7_ListAllCards

Definition at line 53 of file Project.idl.

runtimeclass Scenario7_PinFromAppbar

Definition at line 53 of file Project.idl.

runtimeclass Scenario7_SetVersion

Definition at line 43 of file Project.idl.

runtimeclass Scenario7_UsingUnicodeExtensions

Definition at line 53 of file Project.idl.

runtimeclass Scenario8

Definition at line 59 of file Project.idl.

runtimeclass Scenario8_PairDevice

Definition at line 90 of file Project.idl.

runtimeclass Scenario8_UpdateAsync

Definition at line 59 of file Project.idl.

runtimeclass Scenario8_VisitsBackgroundTask

Definition at line 60 of file Project.idl.

runtimeclass Scenario9

Definition at line 65 of file Project.idl.

runtimeclass Scenario9_CustomPairDevice

Definition at line 96 of file Project.idl.

runtimeclass SecondaryAppWindowPage

Definition at line 47 of file Project.idl.

runtimeclass ShowPackageFamilyName

Definition at line 17 of file Project.idl.

runtimeclass SlowInputStream

Definition at line 111 of file Project.idl.

const float smallRectSize = 125

Definition at line 18 of file Constants.h.

String Ssid

Definition at line 33 of file Project.idl.

Platform::String strServerPort = "50001"

Definition at line 26 of file SocketReaderWriter.cpp.

runtimeclass UserViewModel

Definition at line 41 of file Project.idl.

Platform::Array< byte > WfaOui = ref new Platform::Array<byte>{ 0x50, 0x6F, 0x9A }

Definition at line 24 of file SocketReaderWriter.cpp.

runtimeclass WordOverlay

Definition at line 29 of file Project.idl.

Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Common Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Common
Classes | Functions

SDKTemplate::Common Namespace Reference

Classes

class | LoadStateEventArgs
Class used to hold the event data required when a page attempts to load state. More...
class | NavigationHelper
NavigationHelper aids in navigation between pages. More...
class | RootFrameNavigationHelper
RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...
class | SaveStateEventArgs
Class used to hold the event data required when a page attempts to save state. More...
class | SuspensionManager
SuspensionManager captures global session state to simplify process lifetime management for an application. More...
class | SuspensionManagerException

Functions

delegate void | LoadStateEventHandler (object sender, LoadStateEventArgs e)
delegate void | SaveStateEventHandler (object sender, SaveStateEventArgs e)

Function Documentation

delegate void SDKTemplate::Common::LoadStateEventHandler | ( | object | sender,
 |  | LoadStateEventArgs | e
 | ) |  |

Represents the method that will handle the NavigationHelper.LoadStateevent.

delegate void SDKTemplate::Common::SaveStateEventHandler | ( | object | sender,
 |  | SaveStateEventArgs | e
 | ) |  |

Represents the method that will handle the NavigationHelper.SaveStateevent.

Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Compression Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Compression
Classes

SDKTemplate::Compression Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Controls Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Controls
Classes

SDKTemplate::Controls Namespace Reference

Classes

class | ContentSelector
class | PlayReadyInfo
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::DatagramSocketSample Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • DatagramSocketSample
Classes

SDKTemplate::DatagramSocketSample Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::DeviceHelpers Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • DeviceHelpers
Functions

SDKTemplate::DeviceHelpers Namespace Reference

Functions

Concurrency::task
< Windows::Devices::PointOfService::BarcodeScanner^> 		GetFirstBarcodeScannerAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)
Concurrency::task
< Windows::Devices::PointOfService::CashDrawer^> 		GetFirstCashDrawerAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)
Concurrency::task
< Windows::Devices::PointOfService::MagneticStripeReader^> 		GetFirstMagneticStripeReaderAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)

Function Documentation

Concurrency::task<Windows::Devices::PointOfService::BarcodeScanner^> SDKTemplate::DeviceHelpers::GetFirstBarcodeScannerAsync ( Windows::Devices::PointOfService::PosConnectionTypes connectionTypes = Windows::Devices::PointOfService::PosConnectionTypes::All )
Concurrency::task<Windows::Devices::PointOfService::CashDrawer^> SDKTemplate::DeviceHelpers::GetFirstCashDrawerAsync ( Windows::Devices::PointOfService::PosConnectionTypes connectionTypes = Windows::Devices::PointOfService::PosConnectionTypes::All )
Concurrency::task<Windows::Devices::PointOfService::MagneticStripeReader^> SDKTemplate::DeviceHelpers::GetFirstMagneticStripeReaderAsync ( Windows::Devices::PointOfService::PosConnectionTypes connectionTypes = Windows::Devices::PointOfService::PosConnectionTypes::All )
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::DeviceProperties Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • DeviceProperties

SDKTemplate::DeviceProperties Namespace Reference

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Helpers Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Helpers
Classes | Functions

SDKTemplate::Helpers Namespace Reference

Classes

class | CommonLicenseRequest
class | PlayReadyHelper
Encapsulates all the required calls to setup a MediaProtectionManger within a MediaPlayer for typical PlayReady scenarios. More...

Functions

void | AddItem (Windows::UI::Xaml::Controls::ComboBox^comboBox, Platform::Object^value, Platform::String^name)
template<typename T >
void | AddItem (Windows::UI::Xaml::Controls::ComboBox^comboBox, T value)
Concurrency::task< void > | DelayAsync (Windows::Foundation::TimeSpan duration, Concurrency::cancellation_token cancel=Concurrency::cancellation_token::none())
Platform::String | GetCurrentDateTimeAsString ()
template<typename T >
T | GetSelectedItemTag (Windows::UI::Xaml::Controls::Primitives::Selector^selector)
double | MillisecondsFromTimeSpan (Windows::Foundation::TimeSpan value)
template<typename T >
T | ParseUIntWithFallback (Windows::UI::Xaml::Controls::TextBox^textBox, T fallback)
Windows::Foundation::TimeSpan | TimeSpanFromMilliseconds (double value)
Windows::Foundation::TimeSpan | TimeSpanFromSeconds (int seconds)

Function Documentation

void SDKTemplate::Helpers::AddItem | ( | Windows::UI::Xaml::Controls::ComboBox^ | comboBox,
 |  | Platform::Object^ | value,
 |  | Platform::String^ | name
 | ) |  |
void SDKTemplate::Helpers::AddItem | ( | Windows::UI::Xaml::Controls::ComboBox^ | comboBox,
 |  | T | value
 | ) |  |

Definition at line 71 of file SampleConfiguration.h.

        {
            AddItem(comboBox, value, value.ToString());
        }

Concurrency::task<void> SDKTemplate::Helpers::DelayAsync | ( | Windows::Foundation::TimeSpan | duration,
 |  | Concurrency::cancellation_token | cancel = Concurrency::cancellation_token::none()
 | ) |  |
Platform::String SDKTemplate::Helpers::GetCurrentDateTimeAsString ( )
T SDKTemplate::Helpers::GetSelectedItemTag ( Windows::UI::Xaml::Controls::Primitives::Selector^ selector )

Definition at line 77 of file SampleConfiguration.h.

        {
            return safe_cast<T>(safe_cast<Windows::UI::Xaml::FrameworkElement^>(selector->SelectedItem)->Tag);
        }

double SDKTemplate::Helpers::MillisecondsFromTimeSpan ( Windows::Foundation::TimeSpan value ) [inline]

Definition at line 87 of file SampleConfiguration.h.

        {
            return static_cast<double>(value.Duration) / 10000;
        }

T SDKTemplate::Helpers::ParseUIntWithFallback | ( | Windows::UI::Xaml::Controls::TextBox^ | textBox,
 |  | T | fallback
 | ) |  |

Definition at line 55 of file SampleConfiguration.h.

        {
            wchar_t* end;
            errno = 0;
            unsigned long value = wcstoul(textBox->Text->Data(), &end, 10);
            if (errno == ERANGE || *end != L'\0')
            {
                return fallback;
            }

            return static_cast<T>(value);
        }

Windows::Foundation::TimeSpan SDKTemplate::Helpers::TimeSpanFromMilliseconds ( double value ) [inline]

Definition at line 82 of file SampleConfiguration.h.

        {
            return Windows::Foundation::TimeSpan{ static_cast<long long>(value * 10000) };
        }

Windows::Foundation::TimeSpan SDKTemplate::Helpers::TimeSpanFromSeconds ( int seconds )
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Models Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Models
Classes

SDKTemplate::Models Namespace Reference

Classes

class AdaptiveContentModel
A list of manifest URLs, both HLS and DASH; clear, encrypted and PlayReady; VOD and Live. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SampleConstants Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SampleConstants

SDKTemplate::SampleConstants Namespace Reference

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Shared Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Shared
Classes

SDKTemplate::Shared Namespace Reference

Classes

class | PlayReadyHelpers
class | RelayCommand
A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SmartCardSample Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SmartCardSample

SDKTemplate::SmartCardSample Namespace Reference

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::StreamSocketSample Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • StreamSocketSample
Classes

SDKTemplate::StreamSocketSample Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SuperMutt Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SuperMutt
Namespaces

SDKTemplate::SuperMutt Namespace Reference

This is the report descriptor for the support SuperMutt device. More...

Namespaces

namespace | Device
namespace | DeviceInputReportControlInformation
namespace | LedPattern
namespace | ReadWriteBufferControlInformation

Detailed Description

0x06, 0xAA, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x01, // COLLECTION (Application) 0x85, 0x01, // REPORT_ID (1) 0xa1, 0x00, // COLLECTION (Physical) 0x05, 0x09, // USAGE_PAGE (Button) 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x29, 0x04, // USAGE_MAXIMUM (Button 4) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x04, // REPORT_COUNT (4) 0x81, 0x02, // INPUT (Data,Var,Abs) 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) 0x09, 0xe0, // USAGE (Volume) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x0a, // LOGICAL_MAXIMUM (10) 0x35, 0x00, // PHYSICAL_MINIMUM (0) 0x45, 0x64, // PHYSICAL_MAXIMUM (100) 0x75, 0x04, // REPORT_SIZE (4) 0x95, 0x01, // REPORT_COUNT (1) 0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xa1, 0x00, // COLLECTION (Physical) 0x05, 0x09, // USAGE_PAGE (Button) 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x29, 0x04, // USAGE_MAXIMUM (Button 4) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x04, // REPORT_COUNT (4) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) 0x09, 0xe0, // USAGE (Volume) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x0a, // LOGICAL_MAXIMUM (10) 0x35, 0x00, // PHYSICAL_MINIMUM (0) 0x45, 0x64, // PHYSICAL_MAXIMUM (100) 0x75, 0x04, // REPORT_SIZE (4) 0x95, 0x01, // REPORT_COUNT (1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0x03, // REPORT_ID (3) 0x06, 0xAA, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x01, // REPORT_COUNT (1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x95, 0x07, // REPORT_COUNT (7) 0x91, 0x07, // OUTPUT (Cnst,Var,Rel) 0xc0, // END_COLLECTION 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0x04, // REPORT_ID (4) 0x06, 0xAA, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0xc0, // END_COLLECTION 0x06, 0xDD, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x02, // COLLECTION (Logical) 0x85, 0xff, // REPORT_ID (255) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 // END_COLLECTION

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SuperMutt::Device Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SuperMutt
  • Device

SDKTemplate::SuperMutt::Device Namespace Reference

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SuperMutt::DeviceInputReportControlInformation Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SuperMutt
  • DeviceInputReportControlInformation

SDKTemplate::SuperMutt::DeviceInputReportControlInformation Namespace Reference

Only available for output reports. More...

Detailed Description

The report Id is used to start and stop device input reports. Data: 0x01 will enable input reports

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SuperMutt::LedPattern Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SuperMutt
  • LedPattern

SDKTemplate::SuperMutt::LedPattern Namespace Reference

Only available for Feature Reports. More...

Detailed Description

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::SuperMutt::ReadWriteBufferControlInformation Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • SuperMutt
  • ReadWriteBufferControlInformation

SDKTemplate::SuperMutt::ReadWriteBufferControlInformation Namespace Reference

Only available for Input/Output Reports. More...

Detailed Description

Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Syndication Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Syndication
Classes

SDKTemplate::Syndication Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::Utils Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • Utils
Functions

SDKTemplate::Utils Namespace Reference

Functions

Platform::Collections::Vector
< ItemDetails^> 		CreateProductListFromQueryResult (Windows::Services::Store::StoreProductQueryResult^addOns, Platform::String^description)
int64_t | DaysUntil (Windows::Foundation::DateTime endDate)
void | ReportExtendedError (Windows::Foundation::HResult extendedError)

Function Documentation

Platform::Collections::Vector<ItemDetails^> SDKTemplate::Utils::CreateProductListFromQueryResult | ( | Windows::Services::Store::StoreProductQueryResult^ | addOns,
 |  | Platform::String^ | description
 | ) |  |
int64_t SDKTemplate::Utils::DaysUntil ( Windows::Foundation::DateTime endDate )
void SDKTemplate::Utils::ReportExtendedError ( Windows::Foundation::HResult extendedError )
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::ViewModels Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • ViewModels
Classes

SDKTemplate::ViewModels Namespace Reference

Classes

class | HardwareDRMViewModel
class | PlayReadyInfoViewModel
class | ProactiveViewModel
class | ReactiveViewModel
class | SecureStopViewModel
class | ViewModelBase
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::WiFiDirectServices Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • WiFiDirectServices
Classes

SDKTemplate::WiFiDirectServices Namespace Reference

Classes

class | AdvertisementWrapper
Wraps WiFiDirectServiceAdvertiser and handles callbacks and related state. More...
class | DiscoveredDeviceWrapper
class | Scenario1
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | Scenario2
UI exposing an interface to accept/decline incoming connection requests as an advertiser and to interact with connected sessions. More...
class | Scenario3
UI that provides a way to discover any Wi-Fi Direct service by name A real application would likely hard-code the service name to a well-known service rather than expose this in the UI. More...
class | Scenario4
UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with. More...
class | Scenario5
UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services This sample just demonstrates setting up the connection and sending strings A real application would likely open pre-determined ports for application communication. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | SessionRequestWrapper
Helper class to display session requests in list with extra data. More...
class | SessionWrapper
class | SocketWrapper
class | StreamSocketListenerWrapper
class | WiFiDirectServiceManager
Common class to wrap all of the services objects and state behind the UI. More...
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::WiFiScan Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • WiFiScan
Classes

SDKTemplate::WiFiScan Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::WRLInProcessWinRTComponent Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • WRLInProcessWinRTComponent
Classes

SDKTemplate::WRLInProcessWinRTComponent Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::WRLOutOfProcessWinRTComponent Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • WRLOutOfProcessWinRTComponent
Classes

SDKTemplate::WRLOutOfProcessWinRTComponent Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SDKTemplate::XmlLite Namespace Reference

  • Namespace List
  • Namespace Members
  • SDKTemplate
  • XmlLite
Classes

SDKTemplate::XmlLite Namespace Reference

Classes

class sealed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryViewsHelpers Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

SecondaryViewsHelpers Namespace Reference

Classes

class | ViewLifetimeControl

Functions

delegate void | ViewReleasedHandler (Object sender, EventArgs e)

Function Documentation

delegate void ViewReleasedHandler | ( | Object | sender,
 |  | EventArgs | e
 | ) |  |
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SerialArduino Namespace Reference

Classes

class | ArduinoDevice
class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...
class | DeviceProperties
class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...
class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...
class | Scenario2_LEDTemp
An empty page that can be used on its own or navigated to within a Frame. More...
class | Utilities
This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages. More...
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

Simple3DGameDX Namespace Reference

Classes

interface | IGameUIControl
class | sealed

Enumerations

enum GameInfoOverlayCommand {
None, TapToContinue, PleaseWait, PlayAgain,
None, TapToContinue, PleaseWait, PlayAgain
}
enum GameInfoOverlayCommand {
None, TapToContinue, PleaseWait, PlayAgain,
None, TapToContinue, PleaseWait, PlayAgain
}

Enumeration Type Documentation

enum GameInfoOverlayCommand
Enumerator:
None
TapToContinue
PleaseWait
PlayAgain
None
TapToContinue
PleaseWait
PlayAgain

Definition at line 37 of file GameUIControl.h.

    {
        None,
        TapToContinue,
        PleaseWait,
        PlayAgain,
    };

enum GameInfoOverlayCommand
Enumerator:
None
TapToContinue
PleaseWait
PlayAgain
None
TapToContinue
PleaseWait
PlayAgain

Definition at line 37 of file GameUIControl.h.

    {
        None,
        TapToContinue,
        PleaseWait,
        PlayAgain,
    };

Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Enumerations

Simple3DGameXaml Namespace Reference

Classes

interface | IGameUIControl
class | sealed
A page that hosts a DirectX SwapChainPanel. More...

Enumerations

enum | GameInfoOverlayCommand { None, TapToContinue, PleaseWait, PlayAgain }

Enumeration Type Documentation

enum GameInfoOverlayCommand
Enumerator:
None
TapToContinue
PleaseWait
PlayAgain

Definition at line 35 of file GameUIControl.h.

    {
        None,
        TapToContinue,
        PleaseWait,
        PlayAgain,
    };

Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SimpleCommunication Namespace Reference

Classes

class | CaptureDevice
class | LowLatency
An empty page that can be used on its own or navigated to within a Frame. More...
class | VideoChat
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SimpleImaging Namespace Reference

Classes

class | Helpers
Contains helper functionality, including handling/converting EXIF orientation values.
class | Scenario1
Code-behind for Scenario 1, which demonstrates image properties with FileProperties. More...
class | Scenario2
Code-behind for Scenario 2, which demonstrates image editing using BitmapDecoder and BitmapEncoder. More...
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SimpleOrientationCS Namespace Reference

Classes

class | Scenario1_DataEvents
class | Scenario2_Polling
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsBackgroundTask Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SmsBackgroundTask Namespace Reference

Classes

class SampleSmsBackgroundTask
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SmsSendAndReceive Namespace Reference

Classes

class | RegisterWithBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...
class | SendTextMessage
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityBackgroundTask Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SocketActivityBackgroundTask Namespace Reference

Classes

class SocketActivityTask
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SocketActivityStreamSocket Namespace Reference

Classes

class Scenario1_Connect
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreenSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

SplashScreenSample Namespace Reference

Classes

class | ExtendedSplash
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StateTriggersSample Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

StateTriggersSample Namespace Reference

Namespaces

namespace | CustomTriggers
namespace | ViewModel

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | ItemTemplateControl
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StateTriggersSample::CustomTriggers Namespace Reference

  • Namespace List
  • Namespace Members
  • StateTriggersSample
  • CustomTriggers
Classes

StateTriggersSample::CustomTriggers Namespace Reference

Classes

class | ControlSizeTrigger
class | DeviceFamilyTrigger
class | InputTypeTrigger
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StateTriggersSample::ViewModel Namespace Reference

  • Namespace List
  • Namespace Members
  • StateTriggersSample
  • ViewModel
Classes

StateTriggersSample::ViewModel Namespace Reference

Classes

class | MainViewModel
class | Model
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: std Namespace Reference

  • Namespace List
  • Namespace Members
Functions

std Namespace Reference

Functions

std::wstring to_wstring (winrt::Windows::Devices::Lights::LampArrayKind lampArrayKind)

Function Documentation

std::wstring std::to_wstring ( winrt::Windows::Devices::Lights::LampArrayKind lampArrayKind )
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocketListenerServer Namespace Reference

  • Namespace List
  • Namespace Members
Classes

StreamSocketListenerServer Namespace Reference

Classes

class Scenario1_Send
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocketSample Namespace Reference

  • Namespace List
  • Namespace Members
Classes

StreamSocketSample Namespace Reference

Classes

class | LocalHostItem
Helper class describing a NetworkAdapter and its associated IP address. More...
class | Scenario1
A page for first scenario. More...
class | Scenario2
A page for second scenario. More...
class | Scenario3
A page for third scenario. More...
class | Scenario4
A page for fourth scenario. More...
class | Scenario5
A page for fifth scenario. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Syndication Namespace Reference

Classes

class S1_GetAFeed
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Tasks Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Tasks Namespace Reference

Classes

class | ActivitySensorBackgroundTask
class | CompletionGroupTask
class | EdpBackgroundTask
class | PedometerBackgroundTask
class | ProximitySensorBackgroundTask
class | SampleBackgroundTask
class | sealed
class | ServicingComplete
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion Namespace Reference

  • Namespace List
  • Namespace Members
Classes

TextSuggestion Namespace Reference

Classes

class | Scenario1_Conversion
class | Scenario2_Prediction
class | Scenario3_ReverseConversion
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Transform3DAnimations Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Classes

Transform3DAnimations Namespace Reference

Namespaces

namespace | ViewModels

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | ArticlePage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | SectionView
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Transform3DAnimations::ViewModels Namespace Reference

  • Namespace List
  • Namespace Members
  • Transform3DAnimations
  • ViewModels
Classes

Transform3DAnimations::ViewModels Namespace Reference

Classes

class | ArticleViewModel
class | HeroArticlesViewModel
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdApi Namespace Reference

  • Namespace List
  • Namespace Members
Classes

UssdApi Namespace Reference

Classes

class RequestResponse
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VoiceCommandService Namespace Reference

  • Namespace List
  • Namespace Members
Classes

VoiceCommandService Namespace Reference

Classes

class sealed
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthentication Namespace Reference

  • Namespace List
  • Namespace Members
Classes

WebAuthentication Namespace Reference

Classes

class | Scenario1_Facebook
class | Scenario2_Twitter
class | Scenario3_Flickr
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan Namespace Reference

  • Namespace List
  • Namespace Members
Classes

WiFiScan Namespace Reference

Classes

class | Scenario1_CachedNetworks
class | Scenario2_Scan
class | Scenario3_RegisterForUpdates
class | Scenario4_Connect
An empty page that can be used on its own or navigated to within a Frame. More...
class | WiFiNetworkDisplay
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsHolographicCodeSamples Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Functions

WindowsHolographicCodeSamples Namespace Reference

Classes

class | final
struct | ModelConstantBuffer
struct | ModelNormalConstantBuffer
class | RealtimeSurfaceMeshRenderer
struct | SurfaceMeshProperties
struct | VertexPositionColor
struct | VertexPositionNormalColor
struct | ViewProjectionConstantBuffer

Functions

template<typename t = byte>
t * | GetDataFromIBuffer (Windows::Storage::Streams::IBuffer^container)
static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"View/projection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ModelNormalConstantBuffer)%(sizeof(float)*4))==0,"Model/normal constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")

Function Documentation

t* WindowsHolographicCodeSamples::GetDataFromIBuffer ( Windows::Storage::Streams::IBuffer^ container )

Definition at line 24 of file GetDataFromIBuffer.h.

    {
        if (container == nullptr)
        {
            return nullptr;
        }

        unsigned int bufferLength = container->Length;

        if (!(bufferLength > 0))
        {
            return nullptr;
        }

        HRESULT hr = S_OK;

        ComPtr<IUnknown> pUnknown = reinterpret_cast<IUnknown*>(container);
        ComPtr<IBufferByteAccess> spByteAccess;
        hr = pUnknown.As(&spByteAccess);
        if (FAILED(hr))
        {
            return nullptr;
        }

        byte* pRawData = nullptr;
        hr = spByteAccess->Buffer(&pRawData);
        if (FAILED(hr))
        {
            return nullptr;
        }

        return reinterpret_cast<t*>(pRawData);
    }

WindowsHolographicCodeSamples::static_assert | ( | (sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "View/projection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
WindowsHolographicCodeSamples::static_assert | ( | (sizeof(ModelNormalConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model/normal constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
WindowsHolographicCodeSamples::static_assert | ( | (sizeof(ModelConstantBuffer)%(sizeof(float)*4)) | = =0,
 |  | "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats)." |
 | ) |  |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsPreview Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces

WindowsPreview Namespace Reference

Namespaces

namespace Media
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsPreview::Media Namespace Reference

  • Namespace List
  • Namespace Members
  • WindowsPreview
  • Media
Namespaces

WindowsPreview::Media Namespace Reference

Namespaces

namespace Capture
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsPreview::Media::Capture Namespace Reference

  • Namespace List
  • Namespace Members
  • WindowsPreview
  • Media
  • Capture
Namespaces

WindowsPreview::Media::Capture Namespace Reference

Namespaces

namespace Frames
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsPreview::Media::Capture::Frames Namespace Reference

  • Namespace List
  • Namespace Members
  • WindowsPreview
  • Media
  • Capture
  • Frames
Classes | Enumerations

WindowsPreview::Media::Capture::Frames Namespace Reference

Classes

class | BufferHelper
class | sealed
struct | TrackedPose

Enumerations

enum BodyPart {
SpineBase = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineBase), SpineMid = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineMid), Neck = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Neck), Head = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Head),
ShoulderLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderLeft), ElbowLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowLeft), WristLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristLeft), HandLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandLeft),
ShoulderRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderRight), ElbowRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowRight), WristRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristRight), HandRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandRight),
HipLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipLeft), KneeLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeLeft), AnkleLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleLeft), FootLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootLeft),
HipRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipRight), KneeRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeRight), AnkleRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleRight), FootRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootRight),
SpineShoulder = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineShoulder), HandTipLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipLeft), ThumbLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbLeft), HandTipRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipRight),
ThumbRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbRight)
}
enum PoseTrackingFrameCreationStatus {
Success, NotAPerceptionMediaType, NotAPoseTrackingFrame, FrameBufferReleased,
InvalidFormat
}
enum | TrackingStatus { NotTracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::NotTracked), Inferred = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Inferred), Tracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Tracked) }

Enumeration Type Documentation

enum BodyPart
Enumerator:
SpineBase
SpineMid
Neck
Head
ShoulderLeft
ElbowLeft
WristLeft
HandLeft
ShoulderRight
ElbowRight
WristRight
HandRight
HipLeft
KneeLeft
AnkleLeft
FootLeft
HipRight
KneeRight
AnkleRight
FootRight
SpineShoulder
HandTipLeft
ThumbLeft
HandTipRight
ThumbRight

Definition at line 35 of file PoseTrackingFrame.h.

                                           : int32_t {
                    SpineBase     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineBase),
                    SpineMid      = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineMid),
                    Neck          = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Neck),
                    Head          = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Head),
                    ShoulderLeft  = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderLeft),
                    ElbowLeft     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowLeft),
                    WristLeft     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristLeft),
                    HandLeft      = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandLeft),
                    ShoulderRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderRight),
                    ElbowRight    = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowRight),
                    WristRight    = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristRight),
                    HandRight     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandRight),
                    HipLeft       = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipLeft),
                    KneeLeft      = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeLeft),
                    AnkleLeft     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleLeft),
                    FootLeft      = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootLeft),
                    HipRight      = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipRight),
                    KneeRight     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeRight),
                    AnkleRight    = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleRight),
                    FootRight     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootRight),
                    SpineShoulder = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineShoulder),
                    HandTipLeft   = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipLeft),
                    ThumbLeft     = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbLeft),
                    HandTipRight  = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipRight),
                    ThumbRight    = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbRight)
                };

enum PoseTrackingFrameCreationStatus
Enumerator:
Success
NotAPerceptionMediaType
NotAPoseTrackingFrame
FrameBufferReleased
InvalidFormat

Definition at line 130 of file PoseTrackingFrame.h.

                {
                    Success, // The buffer could be correctly accessed and interpreted as a Pose Tracking Frame
                    NotAPerceptionMediaType, // The Media Type associated to the MediaFrameReference was not Perception
                    NotAPoseTrackingFrame,  // The Media Subtype associated to the MediaFrameReference was not Pose Tracking
                    FrameBufferReleased, // The Buffer associated to the MediaFrameReference has already been already released
                    InvalidFormat // There was a mistmatch between expected and real value of some internal fields of the buffer
                };

enum TrackingStatus
Enumerator:
NotTracked
Inferred
Tracked

Definition at line 20 of file PoseTrackingFrame.h.

                                                 : int32_t {
                    NotTracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::NotTracked),
                    Inferred = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Inferred),
                    Tracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Tracked)
                };

Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt Namespace Reference

  • Namespace List
  • Namespace Members
Namespaces | Functions

winrt Namespace Reference

Namespaces

namespace | BackgroundDeviceWatcherTask
namespace | BackgroundTask
namespace | HttpFilters
namespace | MasterDetailApp
namespace | RandomNumberService
namespace | Sample
namespace | SDKTemplate

Functions

hstring | to_hstring (Windows::Graphics::Imaging::BitmapPixelFormat format)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectError)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectConnectionStatus)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectConfigurationMethod)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatus)
hstring | to_hstring (Windows::Networking::Sockets::SocketMessageType value)
hstring | to_hstring (Windows::UI::ViewManagement::UserInteractionMode value)
hstring | to_hstring (Windows::System::UserAuthenticationStatus value)
hstring | to_hstring (Windows::System::UserType value)
hstring | to_hstring (Windows::Foundation::IReference< Windows::UI::Color > const &value)
hstring | to_hstring (Windows::Devices::Sensors::HumanEngagement value)
hstring | to_hstring (Windows::Devices::Sensors::HumanPresence value)
hstring | to_hstring (Windows::Networking::Connectivity::NetworkCostType type)
hstring | to_hstring (Windows::Networking::Connectivity::NetworkConnectivityLevel value)
hstring | to_hstring (Windows::Web::Http::HttpProgressStage value)
hstring | to_hstring (Windows::Web::Http::HttpVersion value)
hstring | to_hstring (Windows::Web::Http::HttpResponseMessageSource value)
hstring | to_hstring (Windows::Web::WebErrorStatus value)
hstring | to_hstring (Windows::Globalization::DayOfWeek value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceRemovalReason value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceMonitorStatus value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceState value)
hstring | to_hstring (Windows::Devices::Geolocation::VisitStateChange value)
hstring | to_hstring (Windows::Devices::Geolocation::PositionSource value)
hstring | to_hstring (Windows::Foundation::TimeSpan value)
hstring | to_hstring (Windows::Foundation::IReference< double > const &value)
hstring | to_hstring (Windows::Storage::FileProperties::ThumbnailMode thumbnailMode)
hstring | to_hstring (Windows::Devices::Enumeration::DeviceInformationKind kind)
hstring | to_hstring (Windows::Devices::Enumeration::DeviceUnpairingResultStatus status)
hstring | to_hstring (Windows::Devices::Enumeration::DevicePairingResultStatus status)
hstring | to_hstring (GattServiceProviderAdvertisementStatus status)
hstring | to_hstring (BluetoothError error)
hstring | to_hstring (GattCommunicationStatus status)
hstring | to_hstring (DevicePairingResultStatus status)

Function Documentation

hstring winrt::to_hstring ( Windows::Graphics::Imaging::BitmapPixelFormat format )
hstring winrt::to_hstring ( Windows::Devices::WiFiDirect::WiFiDirectError )
hstring winrt::to_hstring ( Windows::Devices::WiFiDirect::WiFiDirectConnectionStatus )
hstring winrt::to_hstring ( Windows::Devices::WiFiDirect::WiFiDirectConfigurationMethod )
hstring winrt::to_hstring ( Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatus )
hstring winrt::to_hstring ( Windows::Networking::Sockets::SocketMessageType value )
hstring winrt::to_hstring ( Windows::UI::ViewManagement::UserInteractionMode value )
hstring winrt::to_hstring ( Windows::System::UserAuthenticationStatus value )
hstring winrt::to_hstring ( Windows::System::UserType value )
hstring to_hstring ( Windows::Foundation::IReference< Windows::UI::Color > const & value )

Definition at line 109 of file Scenario1_Colors.cpp.

{
    if (value == nullptr)
    {
        return L"null";
    }

    Color color = value.Value();

    return L"A: " + to_hstring(color.A) + L",  R: " + to_hstring(color.R) + L", G: " + to_hstring(color.G) + L", B: " + to_hstring(color.B);
}

hstring winrt::to_hstring ( Windows::Devices::Sensors::HumanEngagement value )
hstring winrt::to_hstring ( Windows::Devices::Sensors::HumanPresence value )
hstring winrt::to_hstring ( Windows::Networking::Connectivity::NetworkCostType type )
hstring winrt::to_hstring ( Windows::Networking::Connectivity::NetworkConnectivityLevel value )
hstring winrt::to_hstring ( Windows::Web::Http::HttpProgressStage value )
hstring winrt::to_hstring ( Windows::Web::Http::HttpVersion value )
hstring winrt::to_hstring ( Windows::Web::Http::HttpResponseMessageSource value )
hstring to_hstring ( Windows::Web::WebErrorStatus value )
hstring winrt::to_hstring ( Windows::Globalization::DayOfWeek value )
hstring winrt::to_hstring ( Windows::Devices::Geolocation::Geofencing::GeofenceRemovalReason value )
hstring winrt::to_hstring ( Windows::Devices::Geolocation::Geofencing::GeofenceMonitorStatus value )
hstring winrt::to_hstring ( Windows::Devices::Geolocation::Geofencing::GeofenceState value )
hstring to_hstring ( Windows::Devices::Geolocation::VisitStateChange value )

Definition at line 68 of file Helpers.cpp.

{
    switch (value)
    {
    case VisitStateChange::TrackingLost:
        return L"TrackingLost";
    case VisitStateChange::Arrived:
        return L"Arrived";
    case VisitStateChange::Departed:
        return L"Departed";
    case VisitStateChange::OtherMovement:
        return L"OtherMovement";
    }
    return to_hstring(static_cast<uint32_t>(value));
}

hstring winrt::to_hstring ( Windows::Devices::Geolocation::PositionSource value )
hstring winrt::to_hstring ( Windows::Foundation::TimeSpan value )
hstring winrt::to_hstring ( Windows::Foundation::IReference< double > const & value )
hstring winrt::to_hstring ( Windows::Storage::FileProperties::ThumbnailMode thumbnailMode )
hstring winrt::to_hstring ( Windows::Devices::Enumeration::DeviceInformationKind kind )
hstring to_hstring ( Windows::Devices::Enumeration::DeviceUnpairingResultStatus status )
hstring to_hstring ( Windows::Devices::Enumeration::DevicePairingResultStatus status )
hstring winrt::to_hstring ( GattServiceProviderAdvertisementStatus status )

Definition at line 47 of file Scenario3_ServerForeground.cpp.

    {
        switch (status)
        {
        case GattServiceProviderAdvertisementStatus::Created: return L"Created";
        case GattServiceProviderAdvertisementStatus::Stopped: return L"Stopped";
        case GattServiceProviderAdvertisementStatus::Started: return L"Started";
        case GattServiceProviderAdvertisementStatus::Aborted: return L"Aborted";
        }
        return L"Code " + to_hstring(static_cast<int>(status));
    }

hstring winrt::to_hstring ( BluetoothError error )

Definition at line 29 of file Scenario3_ServerForeground.cpp.

    {
        switch (error)
        {
        case BluetoothError::Success: return L"Success";
        case BluetoothError::RadioNotAvailable: return L"RadioNotAvailable";
        case BluetoothError::ResourceInUse: return L"ResourceInUse";
        case BluetoothError::DeviceNotConnected: return L"DeviceNotConnected";
        case BluetoothError::OtherError: return L"OtherError";
        case BluetoothError::DisabledByPolicy: return L"DisabledByPolicy";
        case BluetoothError::NotSupported: return L"NotSupported";
        case BluetoothError::DisabledByUser: return L"DisabledByUser";
        case BluetoothError::ConsentRequired: return L"ConsentRequired";
        case BluetoothError::TransportNotSupported: return L"TransportNotSupported";
        }
        return L"Code " + to_hstring(static_cast<int>(error));
    }

hstring winrt::to_hstring ( GattCommunicationStatus status )

Definition at line 102 of file Scenario2_Client.cpp.

    {
        switch (status)
        {
        case GattCommunicationStatus::Success: return L"Success";
        case GattCommunicationStatus::Unreachable: return L"Unreachable";
        case GattCommunicationStatus::ProtocolError: return L"ProtocolError";
        case GattCommunicationStatus::AccessDenied: return L"AccessDenied";
        }
        return to_hstring(static_cast<int>(status));
    }

hstring to_hstring ( DevicePairingResultStatus status )

Definition at line 27 of file Scenario1_Discovery.cpp.

    {
        switch (status)
        {
        case DevicePairingResultStatus::Paired: return L"Paired";
        case DevicePairingResultStatus::NotReadyToPair: return L"NotReadyToPair";
        case DevicePairingResultStatus::NotPaired: return L"NotPaired";
        case DevicePairingResultStatus::AlreadyPaired: return L"AlreadyPaired";
        case DevicePairingResultStatus::ConnectionRejected: return L"ConnectionRejected";
        case DevicePairingResultStatus::TooManyConnections: return L"TooManyConnections";
        case DevicePairingResultStatus::HardwareFailure: return L"HardwareFailure";
        case DevicePairingResultStatus::AuthenticationTimeout: return L"AuthenticationTimeout";
        case DevicePairingResultStatus::AuthenticationNotAllowed: return L"AuthenticationNotAllowed";
        case DevicePairingResultStatus::AuthenticationFailure: return L"AuthenticationFailure";
        case DevicePairingResultStatus::NoSupportedProfiles: return L"NoSupportedProfiles";
        case DevicePairingResultStatus::ProtectionLevelCouldNotBeMet: return L"ProtectionLevelCouldNotBeMet";
        case DevicePairingResultStatus::AccessDenied: return L"AccessDenied";
        case DevicePairingResultStatus::InvalidCeremonyData: return L"InvalidCeremonyData";
        case DevicePairingResultStatus::PairingCanceled: return L"PairingCanceled";
        case DevicePairingResultStatus::OperationAlreadyInProgress: return L"OperationAlreadyInProgress";
        case DevicePairingResultStatus::RequiredHandlerNotRegistered: return L"RequiredHandlerNotRegistered";
        case DevicePairingResultStatus::RejectedByHandler: return L"RejectedByHandler";
        case DevicePairingResultStatus::RemoteDeviceHasAssociation: return L"RemoteDeviceHasAssociation";
        case DevicePairingResultStatus::Failed: return L"Failed";
        }
        return L"Code " + to_hstring(static_cast<int>(status));
    }

Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundDeviceWatcherTask Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundDeviceWatcherTask
Namespaces

winrt::BackgroundDeviceWatcherTask Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundDeviceWatcherTask::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundDeviceWatcherTask
  • factory_implementation
Classes

winrt::BackgroundDeviceWatcherTask::factory_implementation Namespace Reference

Classes

struct BackgroundDeviceWatcher
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundDeviceWatcherTask::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundDeviceWatcherTask
  • implementation
Classes | Functions

winrt::BackgroundDeviceWatcherTask::implementation Namespace Reference

Classes

struct | BackgroundDeviceWatcher

Functions

void | DebugWriteLine (const hstring &message)

Function Documentation

void winrt::BackgroundDeviceWatcherTask::implementation::DebugWriteLine ( const hstring & message )

Definition at line 12 of file BackgroundDeviceWatcher.cpp.

    {
        OutputDebugStringW(message.c_str());
        OutputDebugStringW(L"\r\n");
    }

Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundTask Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundTask
Namespaces | Functions

winrt::BackgroundTask Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation

Functions

void | DisplayToast (hstring const &message)
hstring | FormatDateTime (Windows::Foundation::DateTime value, hstring const &format)
Windows::Data::Json::JsonArray | LoadSavedJson (hstring const &key)
hstring | to_brief_hstring (double value)

Function Documentation

void DisplayToast ( hstring const & message )

Definition at line 43 of file Helpers.cpp.

{
    // Display a toast for each geofence event.
    ToastNotifier ToastNotifier = ToastNotificationManager::CreateToastNotifier();

    // Create a two line toast and add audio reminder

    // Here the xml that will be passed to the
    // ToastNotification for the toast is retrieved
    XmlDocument toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText02);

    // Set both lines of text
    XmlNodeList toastNodeList = toastXml.GetElementsByTagName(L"text");
    toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode(L"Geolocation Sample"));
    toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));

    // now create a xml node for the audio source
    IXmlNode toastNode = toastXml.SelectSingleNode(L"/toast");
    XmlElement audio = toastXml.CreateElement(L"audio");
    audio.SetAttribute(L"src", L"ms-winsoundevent:Notification.SMS");

    ToastNotification toast(toastXml);
    ToastNotifier.Show(toast);
}

hstring FormatDateTime | ( | Windows::Foundation::DateTime | value,
 |  | hstring const & | format
 | ) |  |

Definition at line 12 of file Helpers.cpp.

{
    return DateTimeFormatter(format).Format(value);
}

JsonArray LoadSavedJson ( hstring const & key )

Definition at line 27 of file Helpers.cpp.

{
    auto values = Windows::Storage::ApplicationData::Current().LocalSettings().Values();
    hstring json = values.TryLookup(key).try_as<hstring>().value_or(L"");

    if (json.empty())
    {
        // Not present. Return an empty array.
        return JsonArray();
    }
    else
    {
        return JsonValue::Parse(json).GetArray();
    }
}

hstring to_brief_hstring ( double value )

Definition at line 18 of file Helpers.cpp.

{
    char temp[32];
    std::to_chars_result result = std::to_chars(std::begin(temp), std::end(temp), value, std::chars_format::general, 6);
    WINRT_ASSERT(result.ec == std::errc{});
    return to_hstring(std::string_view(temp, result.ptr - temp));
}

Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundTask::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundTask
  • factory_implementation
Classes

winrt::BackgroundTask::factory_implementation Namespace Reference

Classes

struct | ConnectTask
struct | GeofenceBackgroundTask
struct | LocationBackgroundTask
struct | UpdateMetadataTask
struct | VisitBackgroundTask
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::BackgroundTask::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • BackgroundTask
  • implementation
Classes

winrt::BackgroundTask::implementation Namespace Reference

Classes

struct | ConnectTask
struct | GeofenceBackgroundTask
struct | LocationBackgroundTask
struct | UpdateMetadataTask
struct | VisitBackgroundTask
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::HttpFilters Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • HttpFilters
Namespaces

winrt::HttpFilters Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::HttpFilters::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • HttpFilters
  • factory_implementation
Classes

winrt::HttpFilters::factory_implementation Namespace Reference

Classes

struct | HttpMeteredConnectionFilter
struct | HttpRetryFilter
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::HttpFilters::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • HttpFilters
  • implementation
Classes

winrt::HttpFilters::implementation Namespace Reference

Classes

struct | HttpMeteredConnectionFilter
struct | HttpRetryFilter
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
Namespaces | Classes

winrt::MasterDetailApp Namespace Reference

Namespaces

namespace | Data
namespace | factory_implementation
namespace | implementation
namespace | ViewModels

Classes

struct | ItemsDataSource
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::Data Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • Data
Namespaces

winrt::MasterDetailApp::Data Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::Data::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • Data
  • factory_implementation
Classes

winrt::MasterDetailApp::Data::factory_implementation Namespace Reference

Classes

struct Item
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::Data::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • Data
  • implementation
Classes

winrt::MasterDetailApp::Data::implementation Namespace Reference

Classes

struct Item
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • factory_implementation
Classes

winrt::MasterDetailApp::factory_implementation Namespace Reference

Classes

struct | DetailPage
struct | MasterDetailPage
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • implementation
Classes

winrt::MasterDetailApp::implementation Namespace Reference

Classes

struct | App
struct | DetailPage
struct | MasterDetailPage
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::ViewModels Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • ViewModels
Namespaces

winrt::MasterDetailApp::ViewModels Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::ViewModels::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • ViewModels
  • factory_implementation
Classes

winrt::MasterDetailApp::ViewModels::factory_implementation Namespace Reference

Classes

struct ItemViewModel
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::MasterDetailApp::ViewModels::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • MasterDetailApp
  • ViewModels
  • implementation
Classes

winrt::MasterDetailApp::ViewModels::implementation Namespace Reference

Classes

struct ItemViewModel
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::RandomNumberService Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • RandomNumberService
Namespaces

winrt::RandomNumberService Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::RandomNumberService::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • RandomNumberService
  • factory_implementation
Classes

winrt::RandomNumberService::factory_implementation Namespace Reference

Classes

struct RandomNumberGeneratorTask
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::RandomNumberService::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • RandomNumberService
  • implementation
Classes

winrt::RandomNumberService::implementation Namespace Reference

Classes

struct RandomNumberGeneratorTask
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::Sample Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • Sample
Namespaces

winrt::Sample Namespace Reference

Namespaces

namespace | factory_implementation
namespace | implementation
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::Sample::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • Sample
  • factory_implementation
Classes

winrt::Sample::factory_implementation Namespace Reference

Classes

struct LinguisticServices
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::Sample::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • Sample
  • implementation
Classes

winrt::Sample::implementation Namespace Reference

Classes

struct LinguisticServices
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
Namespaces | Classes | Enumerations | Functions | Variables

winrt::SDKTemplate Namespace Reference

Namespaces

namespace | Constants
namespace | DisplayHelpers
namespace | factory_implementation
namespace | Helpers
namespace | implementation
namespace | SampleHelpers

Classes

struct | Constants
struct | DeviceWatcherHelper
struct | EmbeddedMFAsyncCallback
struct | ensure_close
struct | Errors
struct | FileExtensions
class | FileLoggingSessionScenario
struct | Helpers
struct | LampArrayInfo
class | LoggingChannelScenario
class | LoggingSessionScenario
struct | MediaFoundationInitializer
struct | MFSampleGenerator
struct | PresentationFormats
struct | RenderBuffer
struct | SampleHelpers
struct | SampleState
struct | scope_exit
struct | SimpleTaskCompletionSource
struct | SimpleTaskCompletionSource< void >
struct | SocketReaderWriter
class | ToneSampleGenerator
struct | unique_cotaskmem_ptr
struct | unique_disabled_control
struct | unique_shared_work_queue
struct | WASAPICapture
struct | WASAPIRenderer

Enumerations

enum | ContentType { Tone, File }
enum | CostGuidance { Normal, OptIn, Conservative }
enum | RenderSampleType { Unknown, Float, Pcm16Bit, Pcm24In32Bit }

Functions

void | App_Construct (implementation::App *app)
void | App_LaunchCompleted (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e)
fire_and_forget | App_OnActivated (Windows::ApplicationModel::Activation::IActivatedEventArgs const &)
void | App_OnFileActivated (Windows::ApplicationModel::Activation::FileActivatedEventArgs const &e)
bool | App_OverrideOnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e)
void | AppendLine (Windows::UI::Xaml::Controls::TextBlock const &textBlock, hstring const &message)
template<typename T >
void | ApplyLanguageFont (T const &element, Windows::Globalization::Fonts::LanguageFont const &languageFont)
Windows::Foundation::IAsyncOperation
< bool > 		AreCertificateAndCertChainValidAsync (Windows::Security::Cryptography::Certificates::Certificate serverCert, Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate > certChain)
hstring | BuildWebSocketError (hresult_error const &ex)
IBuffer | CalculateChallengeResponse (IBuffer const &challenge, IBuffer const &adminKey)
Windows::Storage::Streams::IBuffer | CalculateChallengeResponse (Windows::Storage::Streams::IBuffer const &challenge, Windows::Storage::Streams::IBuffer const &adminKey)
bool | check_enumerator (hresult hr)
fire_and_forget | CheckBackgroundAndRequestLocationAccess ()
void | EvaluateAndReportConnectionCost (Windows::Networking::Connectivity::ConnectionCost cost, Windows::UI::Xaml::Controls::TextBlock const &textBlock)
winrt::Windows::Foundation::IAsyncAction | EvaluateCostAndConnectAsync (Windows::Networking::Connectivity::ConnectionCost cost, bool optedInToCharges, Windows::UI::Xaml::Controls::TextBlock textBlock)
void | FillItemsFromSavedJson (Windows::UI::Xaml::Controls::ItemsControl const &itemsControl, hstring const &key)
Windows::UI::Xaml::Controls::ScrollViewer | FindScrollViewer (Windows::UI::Xaml::DependencyObject const &control)
Windows::Devices::Haptics::SimpleHapticsControllerFeedback | FindSupportedFeedback (Windows::Devices::Haptics::SimpleHapticsController const &hapticsController, uint16_t waveform)
hstring | FormatDateTime (Windows::Foundation::DateTime value, hstring const &format)
template<typename T >
T * | FromInspectable (Windows::Foundation::IInspectable const &insp)
IBuffer | GetAdminKey ()
Windows::Foundation::Rect | GetElementRect (Windows::UI::Xaml::FrameworkElement const &element)
hstring | GetFriendlyName (TetheringWiFiBand value)
hstring | GetFriendlyName (Windows::Networking::NetworkOperators::TetheringWiFiBand value)
CostGuidance | GetNetworkCostGuidance (Windows::Networking::Connectivity::ConnectionCost cost)
RenderSampleType | GetRenderSampleType (WAVEFORMATEX const *wfx)
template<typename T , typename Control >
T | GetSelectedItemTag (Control &&control)
IAsyncOperation< SmartCard > | GetSmartCardAsync ()
hstring | GetSmartCardReaderDeviceId ()
std::wstring | GetTimeStamp ()
fire_and_forget | HandlePairing (Windows::UI::Core::CoreDispatcher dispatcher, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs e)
bool | IsBandSupported (NetworkOperatorTetheringAccessPointConfiguration const &configuration, TetheringWiFiBand band)
bool | IsBandSupported (Windows::Networking::NetworkOperators::NetworkOperatorTetheringAccessPointConfiguration const &configuration, Windows::Networking::NetworkOperators::TetheringWiFiBand band)
Windows::ApplicationModel::Background::IBackgroundTaskRegistration | LookupBackgroundTask (hstring const &name)
hstring | PinValueToString (Windows::Devices::Gpio::GpioPinValue value)
template<typename T , typename V >
bool | RemoveByValue (T &&collection, V &&value)
void | ReportSavedStatus ()
void | SetAdminKey (IBuffer const &buffer)
void | SetAdminKey (winrt::Windows::Storage::Streams::IBuffer const &buffer)
void | SetSmartCardReaderDeviceId (winrt::hstring const &id)
void | SetSmartCardReaderDeviceId (hstring const &id)
bool | ShouldAttemptToConnectToInternet (Windows::Networking::Connectivity::NetworkConnectivityLevel level)
hstring | StringJoin (std::wstring const &delimiter, Windows::Foundation::Collections::IVectorView< hstring > const &vector)
hstring | StringJoin (hstring const &delimiter, Windows::Foundation::Collections::IVectorView< hstring > const &vector)
hstring | to_message ()
NetworkOperatorTetheringManager | TryGetCurrentNetworkOperatorTetheringManager ()
Windows::Foundation::Uri | TryGetUri (MainPage const &rootPage, hstring const &uriString)
bool | TryParseDouble (const wchar_t *str, double &result)
bool | TryParseFloat (hstring const &str, float &result)
bool | TryParseInt32 (wchar_t const *text, int32_t &value)
bool | TryParseUInt (const wchar_t *str, uint32_t &result)
wchar_t * | TryParseUIntPrefix (const wchar_t *str, uint32_t &result)
bool | ValidateTPMSmartCard ()
std::map< hstring, uint16_t >
const & 		WaveformNamesMap ()

Variables

const uint32_t | ADMIN_KEY_LENGTH_IN_BYTES = 24
IBuffer | g_adminKey
hstring | g_smartCardReaderDeviceId

Enumeration Type Documentation

enum ContentType
Enumerator:
Tone
File

Definition at line 18 of file WASAPIRenderer.h.

    {
        Tone,
        File
    };

enum CostGuidance
Enumerator:
Normal
OptIn
Conservative

Definition at line 25 of file SampleConfiguration.h.

    {
        Normal,
        OptIn,
        Conservative
    };

enum RenderSampleType
Enumerator:
Unknown
Float
Pcm16Bit
Pcm24In32Bit

Definition at line 143 of file Common.h.

    {
        Unknown,
        Float,
        Pcm16Bit,
        Pcm24In32Bit,
    };

Function Documentation

void winrt::SDKTemplate::App_Construct ( implementation::App * app ) [inline]

Definition at line 27 of file SampleConfiguration.h.

{ SampleState::CurrentApp = app; }

void App_LaunchCompleted ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const & e )
fire_and_forget winrt::SDKTemplate::App_OnActivated ( Windows::ApplicationModel::Activation::IActivatedEventArgs const & )
void winrt::SDKTemplate::App_OnFileActivated ( Windows::ApplicationModel::Activation::FileActivatedEventArgs const & e )
bool winrt::SDKTemplate::App_OverrideOnLaunched ( Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const & e )
void winrt::SDKTemplate::AppendLine | ( | Windows::UI::Xaml::Controls::TextBlock const & | textBlock,
 |  | hstring const & | message
 | ) |  |
void winrt::SDKTemplate::ApplyLanguageFont | ( | T const & | element,
 |  | Windows::Globalization::Fonts::LanguageFont const & | languageFont
 | ) |  |

Definition at line 18 of file SampleConfiguration.h.

    {
        element.FontFamily({ languageFont.FontFamily() });
        element.FontWeight(languageFont.FontWeight());
        element.FontStyle(languageFont.FontStyle());
        element.FontStretch(languageFont.FontStretch());
    }

Windows::Foundation::IAsyncOperation<bool> winrt::SDKTemplate::AreCertificateAndCertChainValidAsync | ( | Windows::Security::Cryptography::Certificates::Certificate | serverCert,
 |  | Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate > | certChain
 | ) |  |
hstring BuildWebSocketError ( hresult_error const & ex )

Definition at line 113 of file SampleConfiguration.cpp.

{
    if (ex.code() == INET_E_SECURITY_PROBLEM) // 0x800C000EU
    {
        // INET_E_SECURITY_PROBLEM - our custom certificate validator rejected the request.
        return L"Error: Rejected by custom certificate validation.";
    }

    WebErrorStatus status = WebSocketError::GetStatus(ex.code());

    // Normally we'd use the HResult and status to test for specific conditions we want to handle.
    // In this sample, we'll just output them for demonstration purposes.
    switch (status)
    {
    case WebErrorStatus::CannotConnect:
    case WebErrorStatus::NotFound:
    case WebErrorStatus::RequestTimeout:
        return L"Cannot connect to the server. Please make sure to run the server setup script before running the sample.";

    case WebErrorStatus::Unknown:
        return L"COM error: " + to_hstring(ex.code());

    default:
        return L"Error: " + to_hstring(status);
    }
}

IBuffer winrt::SDKTemplate::CalculateChallengeResponse | ( | IBuffer const & | challenge,
 |  | IBuffer const & | adminKey
 | ) |  |

Definition at line 54 of file SmartCardHelpers.cpp.

    {
        SymmetricKeyAlgorithmProvider provider = SymmetricKeyAlgorithmProvider::OpenAlgorithm(SymmetricAlgorithmNames::TripleDesCbc());
        CryptographicKey key = provider.CreateSymmetricKey(adminKey);
        return CryptographicEngine::Encrypt(key, challenge, nullptr);
    }

Windows::Storage::Streams::IBuffer winrt::SDKTemplate::CalculateChallengeResponse | ( | Windows::Storage::Streams::IBuffer const & | challenge,
 |  | Windows::Storage::Streams::IBuffer const & | adminKey
 | ) |  |
bool winrt::SDKTemplate::check_enumerator ( hresult hr ) [inline]

Definition at line 17 of file SampleConfiguration.h.

    {
        check_hresult(hr);
        return hr == S_OK;
    }

fire_and_forget CheckBackgroundAndRequestLocationAccess ( )

Definition at line 155 of file SampleConfiguration.cpp.

{
    // Get permission for a background task from the user. If the user has already answered once,
    // this does nothing and the user must manually update their preference via Settings.
    BackgroundAccessStatus backgroundAccessStatus = co_await BackgroundExecutionManager::RequestAccessAsync();

    SDKTemplate::MainPage rootPage = SDKTemplate::MainPage::Current();

    switch (backgroundAccessStatus)
    {
    case BackgroundAccessStatus::AlwaysAllowed:
    case BackgroundAccessStatus::AllowedSubjectToSystemPolicy:
        // BackgroundTask is allowed
        rootPage.NotifyUser(L"Background task registered.", NotifyType::StatusMessage);

        // Need to request access to location.
        // This must be done when we create the background task registration
        // because the background task cannot display UI.
        // If the user has already answered once,
        // this does nothing and the user must manually update their preference via Settings.
        switch (co_await Geolocator::RequestAccessAsync())
        {
        case GeolocationAccessStatus::Allowed:
            break;

        case GeolocationAccessStatus::Denied:
            rootPage.NotifyUser(L"Access to location is denied.", NotifyType::ErrorMessage);
            break;

        case GeolocationAccessStatus::Unspecified:
            rootPage.NotifyUser(L"Unspecified error!", NotifyType::ErrorMessage);
            break;
        }
        break;

    default:
        rootPage.NotifyUser(L"Background tasks may be disabled for this app", NotifyType::ErrorMessage);
        break;
    }
}

void winrt::SDKTemplate::EvaluateAndReportConnectionCost | ( | Windows::Networking::Connectivity::ConnectionCost | cost,
 |  | Windows::UI::Xaml::Controls::TextBlock const & | textBlock
 | ) |  |
winrt::Windows::Foundation::IAsyncAction winrt::SDKTemplate::EvaluateCostAndConnectAsync | ( | Windows::Networking::Connectivity::ConnectionCost | cost,
 |  | bool | optedInToCharges,
 |  | Windows::UI::Xaml::Controls::TextBlock | textBlock
 | ) |  |
void winrt::SDKTemplate::FillItemsFromSavedJson | ( | Windows::UI::Xaml::Controls::ItemsControl const & | itemsControl,
 |  | hstring const & | key
 | ) |  |
Windows::UI::Xaml::Controls::ScrollViewer winrt::SDKTemplate::FindScrollViewer ( Windows::UI::Xaml::DependencyObject const & control ) [inline]

Definition at line 49 of file LoggingScenarioHelpers.h.

    {
        if (control == nullptr)
        {
            return nullptr;
        }

        int childCount = Windows::UI::Xaml::Media::VisualTreeHelper::GetChildrenCount(control);
        if (childCount <= 0)
        {
            return nullptr;
        }

        for (int childIndex = 0; childIndex < childCount; childIndex++)
        {
            Windows::UI::Xaml::DependencyObject childControl =
                Windows::UI::Xaml::Media::VisualTreeHelper::GetChild(control, childIndex);
            Windows::UI::Xaml::Controls::ScrollViewer viewer =
                childControl.try_as<Windows::UI::Xaml::Controls::ScrollViewer>();
            if (viewer != nullptr)
            {
                return viewer;
            }

            viewer = FindScrollViewer(childControl);
            if (viewer != nullptr)
            {
                return viewer;
            }
        }

        return nullptr;
    }

Windows::Devices::Haptics::SimpleHapticsControllerFeedback winrt::SDKTemplate::FindSupportedFeedback | ( | Windows::Devices::Haptics::SimpleHapticsController const & | hapticsController,
 |  | uint16_t | waveform
 | ) |  |
hstring winrt::SDKTemplate::FormatDateTime | ( | Windows::Foundation::DateTime | value,
 |  | hstring const & | format
 | ) |  |
T* winrt::SDKTemplate::FromInspectable ( Windows::Foundation::IInspectable const & insp )

Definition at line 25 of file SampleConfiguration.h.

    {
        // Note that this a reference to the T inside the IInspectable,
        // so the caller is responsible for keeping the IInspectable alive.
        return insp ? get_self<T>(insp.as<typename T::class_type>()) : nullptr;
    }

winrt::Windows::Storage::Streams::IBuffer GetAdminKey ( )
Windows::Foundation::Rect winrt::SDKTemplate::GetElementRect ( Windows::UI::Xaml::FrameworkElement const & element )
hstring winrt::SDKTemplate::GetFriendlyName ( TetheringWiFiBand value )

Definition at line 97 of file SampleConfiguration.cpp.

    {
        switch (value)
        {
        case TetheringWiFiBand::Auto: return L"Any available";
        case TetheringWiFiBand::TwoPointFourGigahertz: return L"2.4 GHz";
        case TetheringWiFiBand::FiveGigahertz: return L"5 Ghz";
        default: return L"Unknown (" + to_hstring(static_cast<uint32_t>(value)) + L")";
        }
    }

hstring winrt::SDKTemplate::GetFriendlyName ( Windows::Networking::NetworkOperators::TetheringWiFiBand value )
CostGuidance winrt::SDKTemplate::GetNetworkCostGuidance ( Windows::Networking::Connectivity::ConnectionCost cost )
RenderSampleType winrt::SDKTemplate::GetRenderSampleType ( WAVEFORMATEX const * wfx ) [inline]

Definition at line 156 of file Common.h.

    {
        WAVEFORMATEXTENSIBLE const* wfext = reinterpret_cast<WAVEFORMATEXTENSIBLE const*>(wfx);

        if ((wfx->wFormatTag == WAVE_FORMAT_PCM) ||
            ((wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
                (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_PCM)))
        {
            if (wfx->wBitsPerSample == 16)
            {
                return RenderSampleType::Pcm16Bit;
            }
            else if (wfx->wBitsPerSample == 32)
            {
                if ((wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
                    (wfext->Samples.wValidBitsPerSample == 24))
                {
                    return RenderSampleType::Pcm24In32Bit;
                }
            }
        }
        else if ((wfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) ||
            ((wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
                (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)))
        {
            return RenderSampleType::Float;
        }

        return RenderSampleType::Unknown;
    }

T winrt::SDKTemplate::GetSelectedItemTag ( Control && control )

Definition at line 20 of file SampleConfiguration.h.

    {
        return unbox_value<T>(control.SelectedItem().as<Windows::UI::Xaml::FrameworkElement>().Tag());
    }

Windows::Foundation::IAsyncOperation< Windows::Devices::SmartCards::SmartCard > GetSmartCardAsync ( )
winrt::hstring GetSmartCardReaderDeviceId ( )
std::wstring winrt::SDKTemplate::GetTimeStamp ( ) [inline]

Definition at line 28 of file LoggingScenarioHelpers.h.

    {
        std::wstring result;
        SYSTEMTIME timeNow;
        GetLocalTime(&timeNow);
        result.resize(16);
        swprintf_s(
            &result[0],
            result.size() + 1,
            L"%02u%02u%02u-%02u%02u%02u%03u",
            timeNow.wYear - 2000,
            timeNow.wMonth,
            timeNow.wDay,
            timeNow.wHour,
            timeNow.wMinute,
            timeNow.wSecond,
            timeNow.wMilliseconds);
        return result;
    }

fire_and_forget winrt::SDKTemplate::HandlePairing | ( | Windows::UI::Core::CoreDispatcher | dispatcher,
 |  | Windows::Devices::Enumeration::DevicePairingRequestedEventArgs | e
 | ) |  |
bool winrt::SDKTemplate::IsBandSupported | ( | NetworkOperatorTetheringAccessPointConfiguration const & | configuration,
 |  | TetheringWiFiBand | band
 | ) |  |

Definition at line 111 of file SampleConfiguration.cpp.

    {
        // "Auto" mode is always supported even though it is technically not a frequency band.
        if (band == TetheringWiFiBand::Auto)
        {
            return true;
        }

        try
        {
            return configuration.IsBandSupported(band);
        }
        catch (hresult_error const& ex)
        {
            if (ex.code() == HRESULT_FROM_WIN32(ERROR_INVALID_STATE))
            {
                // The WiFi device has been disconnected. Report that we support nothing.
                return false;
            }
            throw;
        }
    }

bool winrt::SDKTemplate::IsBandSupported | ( | Windows::Networking::NetworkOperators::NetworkOperatorTetheringAccessPointConfiguration const & | configuration,
 |  | Windows::Networking::NetworkOperators::TetheringWiFiBand | band
 | ) |  |
IBackgroundTaskRegistration LookupBackgroundTask ( hstring const & name )

Definition at line 117 of file SampleConfiguration.cpp.

{
    IBackgroundTaskRegistration found;
    // Loop through all background tasks to find one with the matching name
    for (auto [taskGuid, task] : BackgroundTaskRegistration::AllTasks())
    {
        if (task.Name() == name)
        {
            found = task;
            break;
        }
    }

    if (found != nullptr)
    {
        // Check whether the user has already granted background execution access.
        BackgroundAccessStatus backgroundAccessStatus = BackgroundExecutionManager::GetAccessStatus();

        SDKTemplate::MainPage rootPage = SDKTemplate::MainPage::Current();

        switch (backgroundAccessStatus)
        {
        case BackgroundAccessStatus::AlwaysAllowed:
        case BackgroundAccessStatus::AllowedSubjectToSystemPolicy:
            rootPage.NotifyUser(L"Background task is already registered. Waiting for next update...", NotifyType::StatusMessage);
            break;

        default:
            rootPage.NotifyUser(L"Background tasks may be disabled for this app", NotifyType::ErrorMessage);
            break;
        }
    }

    return found;
}

hstring winrt::SDKTemplate::PinValueToString ( Windows::Devices::Gpio::GpioPinValue value ) [inline]

Definition at line 17 of file SampleConfiguration.h.

    {
        switch (value)
        {
        case Windows::Devices::Gpio::GpioPinValue::Low: return L"Low";
        case Windows::Devices::Gpio::GpioPinValue::High: return L"High";
        default: return to_hstring(static_cast<int32_t>(value));
        }
    }

bool winrt::SDKTemplate::RemoveByValue | ( | T && | collection,
 |  | V && | value
 | ) |  |

Definition at line 28 of file SampleConfiguration.h.

    {
        uint32_t index;
        bool found = collection.IndexOf(std::forward<V>(value), index);
        if (found)
        {
            collection.RemoveAt(index);
        }
        return found;
    }

void ReportSavedStatus ( )

Definition at line 213 of file SampleConfiguration.cpp.

{
    auto values = Windows::Storage::ApplicationData::Current().LocalSettings().Values();
    hstring status = values.TryLookup(L"Status").try_as<hstring>().value_or(L"");
    if (!status.empty())
    {
        SDKTemplate::MainPage::Current().NotifyUser(status, NotifyType::StatusMessage);
    }
}

void winrt::SDKTemplate::SetAdminKey ( IBuffer const & buffer )

Definition at line 34 of file SmartCardHelpers.cpp.

    {
        g_adminKey = buffer;
    }

void winrt::SDKTemplate::SetAdminKey ( winrt::Windows::Storage::Streams::IBuffer const & buffer )
void winrt::SDKTemplate::SetSmartCardReaderDeviceId ( winrt::hstring const & id )
void winrt::SDKTemplate::SetSmartCardReaderDeviceId ( hstring const & id )

Definition at line 24 of file SmartCardHelpers.cpp.

    {
        g_smartCardReaderDeviceId = id;
    }

bool winrt::SDKTemplate::ShouldAttemptToConnectToInternet ( Windows::Networking::Connectivity::NetworkConnectivityLevel level )
hstring winrt::SDKTemplate::StringJoin | ( | std::wstring const & | delimiter,
 |  | Windows::Foundation::Collections::IVectorView< hstring > const & | vector
 | ) |  |
hstring winrt::SDKTemplate::StringJoin | ( | hstring const & | delimiter,
 |  | Windows::Foundation::Collections::IVectorView< hstring > const & | vector
 | ) |  |
hstring to_message ( )

Definition at line 224 of file SampleConfiguration.cpp.

{
    try
    {
        throw;
    }
    catch (hresult_error const& e)
    {
        return e.message();
    }
    catch (std::exception const& ex)
    {
        return winrt::to_hstring(ex.what());
    }
    catch (...)
    {
        std::terminate();
    }
}

Windows::Networking::NetworkOperators::NetworkOperatorTetheringManager TryGetCurrentNetworkOperatorTetheringManager ( )
Uri TryGetUri | ( | MainPage const & | rootPage,
 |  | hstring const & | uriString
 | ) |  |

Definition at line 81 of file SampleConfiguration.cpp.

{
    Uri webSocketUri{ nullptr };

    try
    {
        webSocketUri = Uri(uriString);
    }
    catch (hresult_error const&)
    {
        rootPage.NotifyUser(L"Error: Invalid URI", NotifyType::ErrorMessage);
        return nullptr;
    }

    // Fragments are not allowed in WebSocket URIs.
    if (!webSocketUri.Fragment().empty())
    {
        rootPage.NotifyUser(L"Error: URI fragments not supported in WebSocket URIs.", NotifyType::ErrorMessage);
        return nullptr;
    }

    // Uri.SchemeName returns the canonicalized scheme name so we can use case-sensitive, ordinal string
    // comparison.
    if ((webSocketUri.SchemeName() != L"ws") && (webSocketUri.SchemeName() != L"wss"))
    {
        rootPage.NotifyUser(L"Error: WebSockets only support ws:// and wss:// schemes.", NotifyType::ErrorMessage);
        return nullptr;
    }

    return webSocketUri;
}

bool TryParseDouble | ( | const wchar_t * | str,
 |  | double & | result
 | ) |  |

Definition at line 80 of file SampleConfiguration.cpp.

{
    wchar_t* end;
    errno = 0;
    result = std::wcstod(str, &end);

    if (str == end)
    {
        // Not parseable.
        return false;
    }

    if (errno == ERANGE)
    {
        // Out of range.
        result = 0;
        return false;
    }

    if (*end != L'\0')
    {
        // Extra unparseable characters at the end.
        result = 0;
        return false;
    }

    // Disallow infinity and NaN.
    if (!std::isfinite(result))
    {
        return false;
    }

    return true;
}

bool TryParseFloat | ( | hstring const & | str,
 |  | float & | result
 | ) |  |

Definition at line 35 of file SampleConfiguration.cpp.

{
    errno = 0;
    wchar_t* endptr;
    result = wcstof(str.c_str(), &endptr);
    return errno == 0 && std::isfinite(result);
}

bool TryParseInt32 | ( | wchar_t const * | text,
 |  | int32_t & | value
 | ) |  |

Definition at line 32 of file SampleConfiguration.cpp.

{
    wchar_t* end;
    errno = 0;
    value = std::wcstol(text, &end, 10);

    if (text == end || *end != L'\0')
    {
        // Not parseable.
        return false;
    }

    if (errno == ERANGE)
    {
        // Out of range.
        return false;
    }

    return true;
}

bool TryParseUInt | ( | const wchar_t * | str,
 |  | uint32_t & | result
 | ) |  |

Definition at line 68 of file SampleConfiguration.cpp.

{
    wchar_t* end = TryParseUIntPrefix(str, result);
    if (!end || *end != L'\0')
    {
        result = 0;
        return false;
    }

    return true;
}

wchar_t * TryParseUIntPrefix | ( | const wchar_t * | str,
 |  | uint32_t & | result
 | ) |  |

Definition at line 46 of file SampleConfiguration.cpp.

{
    wchar_t* end;
    errno = 0;
    result = std::wcstoul(str, &end, 0);

    if (str == end)
    {
        // Not parseable.
        return nullptr;
    }

    if (errno == ERANGE)
    {
        // Out of range.
        return nullptr;
    }

    return end;
}

bool ValidateTPMSmartCard ( )
std::map< hstring, uint16_t > const & WaveformNamesMap ( )

Definition at line 36 of file SampleConfiguration.cpp.

{
    static const std::map<winrt::hstring, uint16_t> map
    {
        { L"BrushContinuous", KnownSimpleHapticsControllerWaveforms::BrushContinuous() },
        { L"BuzzContinuous", KnownSimpleHapticsControllerWaveforms::BuzzContinuous() },
        { L"ChiselMarkerContinuous", KnownSimpleHapticsControllerWaveforms::ChiselMarkerContinuous() },
        { L"Click", KnownSimpleHapticsControllerWaveforms::Click() },
        { L"EraserContinuous", KnownSimpleHapticsControllerWaveforms::EraserContinuous() },
        { L"Error", KnownSimpleHapticsControllerWaveforms::Error() },
        { L"GalaxyPenContinuous", KnownSimpleHapticsControllerWaveforms::GalaxyPenContinuous() },
        { L"Hover", KnownSimpleHapticsControllerWaveforms::Hover() },
        { L"InkContinuous", KnownSimpleHapticsControllerWaveforms::InkContinuous() },
        { L"MarkerContinuous", KnownSimpleHapticsControllerWaveforms::MarkerContinuous() },
        { L"PencilContinuous", KnownSimpleHapticsControllerWaveforms::PencilContinuous() },
        { L"Press", KnownSimpleHapticsControllerWaveforms::Press() },
        { L"Release", KnownSimpleHapticsControllerWaveforms::Release() },
        { L"RumbleContinuous", KnownSimpleHapticsControllerWaveforms::RumbleContinuous() },
        { L"Success", KnownSimpleHapticsControllerWaveforms::Success() },
    };
    return map;
}

Variable Documentation

const uint32_t ADMIN_KEY_LENGTH_IN_BYTES = 24

Definition at line 5 of file SmartCardHelpers.h.

IBuffer g_adminKey

Definition at line 12 of file SmartCardHelpers.cpp.

hstring g_smartCardReaderDeviceId

Definition at line 11 of file SmartCardHelpers.cpp.

Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::Constants Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • Constants

winrt::SDKTemplate::Constants Namespace Reference

Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::DisplayHelpers Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • DisplayHelpers
Functions

winrt::SDKTemplate::DisplayHelpers Namespace Reference

Functions

hstring | GetCharacteristicName (GattCharacteristic const &characteristic)
hstring | GetCharacteristicName (Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const &characteristic)
hstring | GetServiceName (Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceService const &service)
hstring | GetServiceName (GattDeviceService const &service)

Function Documentation

hstring winrt::SDKTemplate::DisplayHelpers::GetCharacteristicName ( GattCharacteristic const & characteristic )

Definition at line 71 of file BluetoothLEAttributeDisplay.cpp.

    {
        uint16_t shortId;

        guid uuid = characteristic.Uuid();
        if (TryParseSigDefinedUuid(uuid, shortId))
        {
            // Reference: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx
            const static std::map<uint32_t, const wchar_t*> knownCharacteristicIds =
            {
                { 0x0000, L"None" },
                { 0x2A43, L"AlertCategoryID" },
                { 0x2A42, L"AlertCategoryIDBitMask" },
                { 0x2A06, L"AlertLevel" },
                { 0x2A44, L"AlertNotificationControlPoint" },
                { 0x2A3F, L"AlertStatus" },
                { 0x2A01, L"Appearance" },
                { 0x2A19, L"BatteryLevel" },
                { 0x2A49, L"BloodPressureFeature" },
                { 0x2A35, L"BloodPressureMeasurement" },
                { 0x2A38, L"BodySensorLocation" },
                { 0x2A22, L"BootKeyboardInputReport" },
                { 0x2A32, L"BootKeyboardOutputReport" },
                { 0x2A33, L"BootMouseInputReport" },
                { 0x2A5C, L"CSCFeature" },
                { 0x2A5B, L"CSCMeasurement" },
                { 0x2A2B, L"CurrentTime" },
                { 0x2A08, L"DateTime" },
                { 0x2A0A, L"DayDateTime" },
                { 0x2A09, L"DayofWeek" },
                { 0x2A00, L"DeviceName" },
                { 0x2A0D, L"DSTOffset" },
                { 0x2A0C, L"ExactTime256" },
                { 0x2A26, L"FirmwareRevisionString" },
                { 0x2A51, L"GlucoseFeature" },
                { 0x2A18, L"GlucoseMeasurement" },
                { 0x2A34, L"GlucoseMeasurementContext" },
                { 0x2A27, L"HardwareRevisionString" },
                { 0x2A39, L"HeartRateControlPoint" },
                { 0x2A37, L"HeartRateMeasurement" },
                { 0x2A4C, L"HIDControlPoint" },
                { 0x2A4A, L"HIDInformation" },
                { 0x2A2A, L"IEEE11073_20601RegulatoryCertificationDataList" },
                { 0x2A36, L"IntermediateCuffPressure" },
                { 0x2A1E, L"IntermediateTemperature" },
                { 0x2A0F, L"LocalTimeInformation" },
                { 0x2A29, L"ManufacturerNameString" },
                { 0x2A21, L"MeasurementInterval" },
                { 0x2A24, L"ModelNumberString" },
                { 0x2A46, L"NewAlert" },
                { 0x2A04, L"PeripheralPreferredConnectionParameters" },
                { 0x2A02, L"PeripheralPrivacyFlag" },
                { 0x2A50, L"PnPID" },
                { 0x2A4E, L"ProtocolMode" },
                { 0x2A03, L"ReconnectionAddress" },
                { 0x2A52, L"RecordAccessControlPoint" },
                { 0x2A14, L"ReferenceTimeInformation" },
                { 0x2A4D, L"Report" },
                { 0x2A4B, L"ReportMap" },
                { 0x2A40, L"RingerControlPoint" },
                { 0x2A41, L"RingerSetting" },
                { 0x2A54, L"RSCFeature" },
                { 0x2A53, L"RSCMeasurement" },
                { 0x2A55, L"SCControlPoint" },
                { 0x2A4F, L"ScanIntervalWindow" },
                { 0x2A31, L"ScanRefresh" },
                { 0x2A5D, L"SensorLocation" },
                { 0x2A25, L"SerialNumberString" },
                { 0x2A05, L"ServiceChanged" },
                { 0x2A28, L"SoftwareRevisionString" },
                { 0x2A47, L"SupportedNewAlertCategory" },
                { 0x2A48, L"SupportedUnreadAlertCategory" },
                { 0x2A23, L"SystemID" },
                { 0x2A1C, L"TemperatureMeasurement" },
                { 0x2A1D, L"TemperatureType" },
                { 0x2A12, L"TimeAccuracy" },
                { 0x2A13, L"TimeSource" },
                { 0x2A16, L"TimeUpdateControlPoint" },
                { 0x2A17, L"TimeUpdateState" },
                { 0x2A11, L"TimewithDST" },
                { 0x2A0E, L"TimeZone" },
                { 0x2A07, L"TxPowerLevel" },
                { 0x2A45, L"UnreadAlertStatus" },
                { 0x2A5A, L"AggregateInput" },
                { 0x2A58, L"AnalogInput" },
                { 0x2A59, L"AnalogOutput" },
                { 0x2A66, L"CyclingPowerControlPoint" },
                { 0x2A65, L"CyclingPowerFeature" },
                { 0x2A63, L"CyclingPowerMeasurement" },
                { 0x2A64, L"CyclingPowerVector" },
                { 0x2A56, L"DigitalInput" },
                { 0x2A57, L"DigitalOutput" },
                { 0x2A0B, L"ExactTime100" },
                { 0x2A6B, L"LNControlPoint" },
                { 0x2A6A, L"LNFeature" },
                { 0x2A67, L"LocationandSpeed" },
                { 0x2A68, L"Navigation" },
                { 0x2A3E, L"NetworkAvailability" },
                { 0x2A69, L"PositionQuality" },
                { 0x2A3C, L"ScientificTemperatureinCelsius" },
                { 0x2A10, L"SecondaryTimeZone" },
                { 0x2A3D, L"String" },
                { 0x2A1F, L"TemperatureinCelsius" },
                { 0x2A20, L"TemperatureinFahrenheit" },
                { 0x2A15, L"TimeBroadcast" },
                { 0x2A1B, L"BatteryLevelState" },
                { 0x2A1A, L"BatteryPowerState" },
                { 0x2A5F, L"PulseOximetryContinuousMeasurement" },
                { 0x2A62, L"PulseOximetryControlPoint" },
                { 0x2A61, L"PulseOximetryFeatures" },
                { 0x2A60, L"PulseOximetryPulsatileEvent" },
                { 0xFFE1, L"SimpleKeyState" },
            };

            auto it = knownCharacteristicIds.find(shortId);
            if (it != knownCharacteristicIds.end())
            {
                return it->second;
            }
        }

        hstring userDescription = characteristic.UserDescription();
        if (!userDescription.empty())
        {
            return userDescription;
        }

        return L"Custom Characteristic: " + to_hstring(uuid);
    }

hstring winrt::SDKTemplate::DisplayHelpers::GetCharacteristicName ( Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const & characteristic )
hstring winrt::SDKTemplate::DisplayHelpers::GetServiceName ( Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceService const & service )
hstring winrt::SDKTemplate::DisplayHelpers::GetServiceName ( GattDeviceService const & service )

Definition at line 29 of file BluetoothLEAttributeDisplay.cpp.

    {
        uint16_t shortId;

        guid uuid = service.Uuid();
        if (TryParseSigDefinedUuid(uuid, shortId))
        {
            // Reference: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
            const static std::map<uint32_t, const wchar_t*> knownServiceIds =
            {
                { 0x0000, L"None" },
                { 0x1811, L"AlertNotification" },
                { 0x180F, L"Battery" },
                { 0x1810, L"BloodPressure" },
                { 0x1805, L"CurrentTimeService" },
                { 0x1816, L"CyclingSpeedandCadence" },
                { 0x180A, L"DeviceInformation" },
                { 0x1800, L"GenericAccess" },
                { 0x1801, L"GenericAttribute" },
                { 0x1808, L"Glucose" },
                { 0x1809, L"HealthThermometer" },
                { 0x180D, L"HeartRate" },
                { 0x1812, L"HumanInterfaceDevice" },
                { 0x1802, L"ImmediateAlert" },
                { 0x1803, L"LinkLoss" },
                { 0x1807, L"NextDSTChange" },
                { 0x180E, L"PhoneAlertStatus" },
                { 0x1806, L"ReferenceTimeUpdateService" },
                { 0x1814, L"RunningSpeedandCadence" },
                { 0x1813, L"ScanParameters" },
                { 0x1804, L"TxPower" },
                { 0xFFE0, L"SimpleKeyService" },
            };
            auto it = knownServiceIds.find(shortId);
            if (it != knownServiceIds.end())
            {
                return it->second;
            }
        }
        return L"Custom service: " + to_hstring(uuid);
    }

Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::factory_implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • factory_implementation
Classes

winrt::SDKTemplate::factory_implementation Namespace Reference

Classes

struct | BarcodeScannerInfo
struct | BindingHelpers
struct | ConnectionSettingsPanel
struct | CopyFiles
struct | CopyImage
struct | CopyText
struct | CustomTextBox
struct | CustomTitleBar
struct | DetailsPage
struct | EdgeTappedListView
struct | GroupInfoList
struct | HistoryAndRoaming
struct | HttpJsonContent
struct | ImagePage
struct | KeepConnectionOpenScenario
struct | OcrCapturedImage
struct | OcrFileImage
struct | OpenCloseConnectionScenario
struct | OtherScenarios
struct | PlugInFilter
struct | Scenario01_GetText
struct | Scenario02_GetStream
struct | Scenario03_GetList
struct | Scenario04_PostText
struct | Scenario05_PostStream
struct | Scenario06_PostMultipart
struct | Scenario07_PostStreamWithProgress
struct | Scenario08_PostCustomContent
struct | Scenario09_GetCookie
struct | Scenario1
struct | Scenario10
struct | Scenario10_SetCookie
struct | Scenario11
struct | Scenario11_DeleteCookie
struct | Scenario12_DisableCookies
struct | Scenario13_RetryFilter
struct | Scenario14_MeteredConnectionFilter
struct | Scenario15_ServerCertificateValidation
struct | Scenario1_Advertiser
struct | Scenario1_Analyze
struct | Scenario1_Basic
struct | Scenario1_BasicFunctionality
struct | Scenario1_Basics
struct | Scenario1_Check
struct | Scenario1_CheckConsentAvailability
struct | Scenario1_Colors
struct | Scenario1_Configure
struct | Scenario1_ConfigureMobileHotspot
struct | Scenario1_Data
struct | Scenario1_DataEvents
struct | Scenario1_DetectInPhoto
struct | Scenario1_DevicePicker
struct | Scenario1_Discovery
struct | Scenario1_Enable
struct | Scenario1_ExtractTextSegments
struct | Scenario1_Files
struct | Scenario1_FindId
struct | Scenario1_FindUsers
struct | Scenario1_GetAndSetPin
struct | Scenario1_InkCanvasTactileFeedback
struct | Scenario1_LanguageDetection
struct | Scenario1_Launch
struct | Scenario1_Launched
struct | Scenario1_LongAndShortFormats
struct | Scenario1_ManageHotspot
struct | Scenario1_MoveCertificate
struct | Scenario1_NetworkConnectivity
struct | Scenario1_Orientation
struct | Scenario1_ParseAndStringify
struct | Scenario1_PercentPermilleFormatting
struct | Scenario1_PinTile
struct | Scenario1_Prefs
struct | Scenario1_Print
struct | Scenario1_ProvisionTPM
struct | Scenario1_ReadData
struct | Scenario1_Render
struct | Scenario1_Save
struct | Scenario1_SecondaryWindow
struct | Scenario1_SimpleListView
struct | Scenario1_SingleFile
struct | Scenario1_Toggle
struct | Scenario1_TrackInWebcam
struct | Scenario1_TrackPosition
struct | Scenario1_UIFonts
struct | Scenario1_UTF8
struct | Scenario1_XmlReader
struct | Scenario2
struct | Scenario2_Binary
struct | Scenario2_ChangePIN
struct | Scenario2_Client
struct | Scenario2_Connector
struct | Scenario2_DecimalFormatting
struct | Scenario2_DetectInWebcam
struct | Scenario2_DeviceWatcher
struct | Scenario2_Disable
struct | Scenario2_DisplayRegion
struct | Scenario2_DocumentFonts
struct | Scenario2_Effects
struct | Scenario2_Extend
struct | Scenario2_GetCurrentTextSegmentFromIndex
struct | Scenario2_GetPosition
struct | Scenario2_Lang
struct | Scenario2_Launch
struct | Scenario2_Listen
struct | Scenario2_Manage
struct | Scenario2_Memory
struct | Scenario2_MultiFile
struct | Scenario2_MultipleScanners
struct | Scenario2_NetworkCost
struct | Scenario2_Notifications
struct | Scenario2_Polling
struct | Scenario2_Remove
struct | Scenario2_RequestConsent
struct | Scenario2_RequestMany
struct | Scenario2_ScriptDetection
struct | Scenario2_Settings
struct | Scenario2_ShowHideEvents
struct | Scenario2_SimpleGridView
struct | Scenario2_Stats
struct | Scenario2_StringTemplate
struct | Scenario2_SupportedTactileFeedback
struct | Scenario2_ToggleMobileHotspot
struct | Scenario2_UnpinTile
struct | Scenario2_WatchUsers
struct | Scenario2_XmlWriter
struct | Scenario3
struct | Scenario3_ActiveSymbologies
struct | Scenario3_AppCapture
struct | Scenario3_BackgroundDeviceWatcher
struct | Scenario3_BackgroundTask
struct | Scenario3_CheckUserConsentGroup
struct | Scenario3_Choosing
struct | Scenario3_ClientAuthentication
struct | Scenario3_CurrencyFormatting
struct | Scenario3_CustomItems
struct | Scenario3_Enum
struct | Scenario3_EnumerateTiles
struct | Scenario3_InkingFeedback
struct | Scenario3_MasterDetail
struct | Scenario3_NetworkConnectivityChanges
struct | Scenario3_ParameterizedTemplate
struct | Scenario3_Region
struct | Scenario3_ResetPIN
struct | Scenario3_SecondaryTiles
struct | Scenario3_ServerForeground
struct | Scenario3_SettingContainer
struct | Scenario3_ShowHideMethods
struct | Scenario3_SingleFolder
struct | Scenario3_Size
struct | Scenario3_Transliteration
struct | Scenario3_XmlWriterLite
struct | Scenario4
struct | Scenario4_ChangeAdminKey
struct | Scenario4_ChangeSystemGroup
struct | Scenario4_CharacterGrouping
struct | Scenario4_CompactOverlay
struct | Scenario4_CompositeSettings
struct | Scenario4_EdgeTappedListView
struct | Scenario4_ForegroundGeofence
struct | Scenario4_Input
struct | Scenario4_InteractionFeedback
struct | Scenario4_NumberParsing
struct | Scenario4_Override
struct | Scenario4_PartialReadWrite
struct | Scenario4_SaveFile
struct | Scenario4_ShowView
struct | Scenario4_Snapshot
struct | Scenario4_SymbologyAttributes
struct | Scenario4_TilePinned
struct | Scenario4_UnicodeExtensions
struct | Scenario5
struct | Scenario5_DisplayingBarcodePreview
struct | Scenario5_GeofenceBackgroundTask
struct | Scenario5_GetSingleDevice
struct | Scenario5_InkingAndInteractionFeedback
struct | Scenario5_IsSupported
struct | Scenario5_LaunchedFromSecondaryTile
struct | Scenario5_Msappdata
struct | Scenario5_RelativePositioning
struct | Scenario5_RestoreScrollPosition
struct | Scenario5_RoundingAndPadding
struct | Scenario5_TimeZone
struct | Scenario5_TriggerCFU
struct | Scenario5_UnicodeExtensions
struct | Scenario5_VerifyResponse
struct | Scenario6
struct | Scenario6_ClearScenario
struct | Scenario6_CustomFilterAddedProps
struct | Scenario6_DeleteTPM
struct | Scenario6_GetLastVisit
struct | Scenario6_NumeralSystemTranslation
struct | Scenario6_ScrollIntoView
struct | Scenario6_SecondaryTileNotification
struct | Scenario6_TimeZone
struct | Scenario7
struct | Scenario7_DeviceInformationKind
struct | Scenario7_ForegroundVisits
struct | Scenario7_ListAllCards
struct | Scenario7_PinFromAppbar
struct | Scenario7_SetVersion
struct | Scenario7_UsingUnicodeExtensions
struct | Scenario8
struct | Scenario8_PairDevice
struct | Scenario8_TransmitAPDU
struct | Scenario8_UpdateAsync
struct | Scenario8_VisitsBackgroundTask
struct | Scenario9
struct | Scenario9_CustomPairDevice
struct | School
struct | SecondaryAppWindowPage
struct | SecondaryViewPage
struct | ShowPackageFamilyName
struct | SlowInputStream
struct | SmartCardListItem
struct | SymbologyListEntry
struct | User
struct | Utils
struct | ViewLifetimeControl
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::Helpers Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • Helpers
Functions

winrt::SDKTemplate::Helpers Namespace Reference

Functions

HttpClient | CreateHttpClientWithCustomHeaders ()
IAsyncAction | DisplayTextResultAsync (HttpResponseMessage response, TextBox output)
Windows::Foundation::IAsyncAction | DisplayTextResultAsync (Windows::Web::Http::HttpResponseMessage response, Windows::UI::Xaml::Controls::TextBox output)
void | DisplayWebError (MainPage const &rootPage, hresult const &error)
Windows::Foundation::IAsyncOperation
< Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > > 		GetUserViewModelsAsync ()
void | ReplaceQueryString (TextBox const &addressField, hstring const &newQueryString)
void | ReplaceQueryString (Windows::UI::Xaml::Controls::TextBox const &addressField, hstring const &newQueryString)
void | ScenarioCompleted (Button const &startButton, Button const &cancelButton)
void | ScenarioCompleted (Windows::UI::Xaml::Controls::Button const &startButton, Windows::UI::Xaml::Controls::Button const &cancelButton)
void | ScenarioStarted (Windows::UI::Xaml::Controls::Button const &startButton, Windows::UI::Xaml::Controls::Button const &cancelButton, Windows::UI::Xaml::Controls::TextBox const &outputField)
void | ScenarioStarted (Button const &startButton, Button const &cancelButton, TextBox const &outputField)
hstring | SerializeHeaders (HttpResponseMessage const &response)
hstring | SerializeHeaders (Windows::Web::Http::HttpResponseMessage const &response)
hstring | ToSimpleString (Windows::Foundation::DateTime dateTime)
Uri | TryParseHttpUri (hstring const &uriString)

Function Documentation

HttpClient winrt::SDKTemplate::Helpers::CreateHttpClientWithCustomHeaders ( )
IAsyncAction winrt::SDKTemplate::Helpers::DisplayTextResultAsync | ( | HttpResponseMessage | response,
 |  | TextBox | output
 | ) |  |

Definition at line 38 of file Helpers.cpp.

    {
        output.Text(output.Text() + SerializeHeaders(response));

        auto cancellation = co_await get_cancellation_token();
        cancellation.enable_propagation();

        std::wstring text{ co_await response.Content().ReadAsStringAsync() };

        // Change <BR> to newlines.
        for (auto pos = text.find(L"<br>"); pos != std::wstring::npos; pos = text.find(L"<br>", pos + 1))
        {
            text.replace(pos, 4, L"\n");
        }

        output.Text(output.Text() + hstring(text));
    }

Windows::Foundation::IAsyncAction winrt::SDKTemplate::Helpers::DisplayTextResultAsync | ( | Windows::Web::Http::HttpResponseMessage | response,
 |  | Windows::UI::Xaml::Controls::TextBox | output
 | ) |  |
void winrt::SDKTemplate::Helpers::DisplayWebError | ( | MainPage const & | rootPage,
 |  | hresult const & | error
 | ) |  |
Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> > winrt::SDKTemplate::Helpers::GetUserViewModelsAsync ( )
void winrt::SDKTemplate::Helpers::ReplaceQueryString | ( | TextBox const & | addressField,
 |  | hstring const & | newQueryString
 | ) |  |

Definition at line 124 of file Helpers.cpp.

    {
        hstring resourceAddress = addressField.Text();
        std::wstring_view view(resourceAddress);

        // Remove previous query string.
        auto questionMarkPos = view.find(L'?');
        if (questionMarkPos != std::wstring_view::npos)
        {
            view = view.substr(0, questionMarkPos);
        }

        addressField.Text(view + newQueryString);
    }

void winrt::SDKTemplate::Helpers::ReplaceQueryString | ( | Windows::UI::Xaml::Controls::TextBox const & | addressField,
 |  | hstring const & | newQueryString
 | ) |  |
void winrt::SDKTemplate::Helpers::ScenarioCompleted | ( | Button const & | startButton,
 |  | Button const & | cancelButton
 | ) |  |

Definition at line 118 of file Helpers.cpp.

    {
        startButton.IsEnabled(true);
        cancelButton.IsEnabled(false);
    }

void winrt::SDKTemplate::Helpers::ScenarioCompleted | ( | Windows::UI::Xaml::Controls::Button const & | startButton,
 |  | Windows::UI::Xaml::Controls::Button const & | cancelButton
 | ) |  |
void winrt::SDKTemplate::Helpers::ScenarioStarted | ( | Windows::UI::Xaml::Controls::Button const & | startButton,
 |  | Windows::UI::Xaml::Controls::Button const & | cancelButton,
 |  | Windows::UI::Xaml::Controls::TextBox const & | outputField
 | ) |  |
void winrt::SDKTemplate::Helpers::ScenarioStarted | ( | Button const & | startButton,
 |  | Button const & | cancelButton,
 |  | TextBox const & | outputField
 | ) |  |

Definition at line 108 of file Helpers.cpp.

    {
        startButton.IsEnabled(false);
        cancelButton.IsEnabled(true);
        if (outputField != nullptr)
        {
            outputField.Text(L"");
        }
    }

hstring winrt::SDKTemplate::Helpers::SerializeHeaders ( HttpResponseMessage const & response )

Definition at line 56 of file Helpers.cpp.

    {
        std::wostringstream output;

        auto SerializeHeaderCollection = [&](IIterable<IKeyValuePair<hstring, hstring>> const& headers)
        {
            for (auto [key, value] : headers)
            {
                output << std::wstring_view(key) << L": " << std::wstring_view(value) << L"\n";
            }
        };

        // We cast the StatusCode to an int so we display the numeric value (e.g., "200") rather than the
        // name of the enum (e.g., "OK") which would often be redundant with the ReasonPhrase.

        output << static_cast<int32_t>(response.StatusCode()) << L" " << std::wstring_view(response.ReasonPhrase()) << L"\n";

        SerializeHeaderCollection(response.Headers());
        SerializeHeaderCollection(response.Content().Headers());
        output << L"\n";
        return hstring(output.str());
    }

hstring winrt::SDKTemplate::Helpers::SerializeHeaders ( Windows::Web::Http::HttpResponseMessage const & response )
hstring winrt::SDKTemplate::Helpers::ToSimpleString ( Windows::Foundation::DateTime dateTime )
Uri winrt::SDKTemplate::Helpers::TryParseHttpUri ( hstring const & uriString )
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::implementation Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • implementation
Namespaces | Classes | Functions | Variables

winrt::SDKTemplate::implementation Namespace Reference

Namespaces

namespace | anonymous_namespace{DeviceHelpers.cpp}

Classes

struct | BarcodeScannerInfo
struct | BindingHelpers
struct | BluetoothLEDeviceDisplay
struct | ConnectedDevice
struct | ConnectionSettingsPanel
struct | Contact
struct | CopyFiles
struct | CopyImage
struct | CopyText
struct | CustomEffectState
struct | CustomTextBox
struct | CustomTitleBar
struct | DetailsPage
struct | DeviceInformationDisplay
struct | DeviceInformationKindChoice
struct | DeviceInformationKindChoices
struct | DeviceSelectorChoices
struct | DeviceSelectorInfo
struct | DeviceStateChangedEventArgs
struct | DeviceStateSourceT
struct | DiscoveredDevice
struct | EdgeTappedListView
struct | GeneratedBitmapState
struct | GroupInfoList
struct | HistoryAndRoaming
struct | HttpJsonContent
struct | ImagePage
struct | Item
struct | KeepConnectionOpenScenario
struct | ListViewEdgeTappedEventArgs
struct | LoggingScenarioEventArgs
struct | OcrCapturedImage
struct | OcrFileImage
struct | OpenCloseConnectionScenario
struct | OtherScenarios
struct | PlotDataReadyEventArgs
struct | PlotDataSourceT
struct | PlugInFilter
struct | ProtectionLevelSelectorInfo
struct | ProtectionSelectorChoices
struct | RadioModel
struct | Scenario01_GetText
struct | Scenario02_GetStream
struct | Scenario03_GetList
struct | Scenario04_PostText
struct | Scenario05_PostStream
struct | Scenario06_PostMultipart
struct | Scenario07_PostStreamWithProgress
struct | Scenario08_PostCustomContent
struct | Scenario09_GetCookie
struct | Scenario1
Creating a file. More...
struct | Scenario10
struct | Scenario10_SetCookie
struct | Scenario11
struct | Scenario11_DeleteCookie
struct | Scenario12_DisableCookies
struct | Scenario13_RetryFilter
struct | Scenario14_MeteredConnectionFilter
struct | Scenario15_ServerCertificateValidation
struct | Scenario1_Advertiser
struct | Scenario1_Analyze
struct | Scenario1_Basic
struct | Scenario1_BasicFunctionality
struct | Scenario1_Basics
struct | Scenario1_Check
struct | Scenario1_CheckConsentAvailability
struct | Scenario1_Colors
struct | Scenario1_Configure
struct | Scenario1_ConfigureMobileHotspot
struct | Scenario1_Data
struct | Scenario1_DataEvents
struct | Scenario1_DetectInPhoto
struct | Scenario1_DevicePicker
struct | Scenario1_Discovery
struct | Scenario1_Enable
struct | Scenario1_ExtractTextSegments
struct | Scenario1_Files
struct | Scenario1_FindId
struct | Scenario1_FindUsers
struct | Scenario1_GetAndSetPin
struct | Scenario1_InkCanvasTactileFeedback
struct | Scenario1_LanguageDetection
struct | Scenario1_Launch
struct | Scenario1_Launched
struct | Scenario1_LongAndShortFormats
struct | Scenario1_ManageHotspot
struct | Scenario1_MoveCertificate
struct | Scenario1_NetworkConnectivity
struct | Scenario1_Orientation
struct | Scenario1_ParseAndStringify
struct | Scenario1_PercentPermilleFormatting
struct | Scenario1_PinTile
struct | Scenario1_Prefs
struct | Scenario1_Print
struct | Scenario1_ProvisionTPM
struct | Scenario1_ReadData
struct | Scenario1_Render
struct | Scenario1_Save
struct | Scenario1_SecondaryWindow
struct | Scenario1_SimpleListView
struct | Scenario1_SingleFile
struct | Scenario1_Toggle
struct | Scenario1_TrackInWebcam
struct | Scenario1_TrackPosition
struct | Scenario1_UIFonts
struct | Scenario1_UTF8
struct | Scenario1_XmlReader
struct | Scenario2
Getting a file's parent folder. More...
struct | Scenario2_Binary
struct | Scenario2_ChangePIN
struct | Scenario2_Client
struct | Scenario2_Connector
struct | Scenario2_DecimalFormatting
struct | Scenario2_DetectInWebcam
struct | Scenario2_DeviceWatcher
struct | Scenario2_Disable
struct | Scenario2_DisplayRegion
struct | Scenario2_DocumentFonts
struct | Scenario2_Effects
struct | Scenario2_Extend
struct | Scenario2_GetCurrentTextSegmentFromIndex
struct | Scenario2_GetPosition
struct | Scenario2_Lang
struct | Scenario2_Launch
struct | Scenario2_Listen
struct | Scenario2_Manage
struct | Scenario2_Memory
struct | Scenario2_MultiFile
struct | Scenario2_MultipleScanners
struct | Scenario2_NetworkCost
struct | Scenario2_Notifications
struct | Scenario2_Polling
struct | Scenario2_Remove
struct | Scenario2_RequestConsent
struct | Scenario2_RequestMany
struct | Scenario2_ScriptDetection
struct | Scenario2_Settings
struct | Scenario2_ShowHideEvents
Sample page to subscribe show/hide event of Touch Keyboard. More...
struct | Scenario2_SimpleGridView
struct | Scenario2_Stats
struct | Scenario2_StringTemplate
struct | Scenario2_SupportedTactileFeedback
struct | Scenario2_ToggleMobileHotspot
struct | Scenario2_UnpinTile
struct | Scenario2_WatchUsers
struct | Scenario2_XmlWriter
struct | Scenario3
struct | Scenario3_ActiveSymbologies
struct | Scenario3_AppCapture
struct | Scenario3_BackgroundDeviceWatcher
struct | Scenario3_BackgroundTask
struct | Scenario3_CheckUserConsentGroup
struct | Scenario3_Choosing
struct | Scenario3_ClientAuthentication
struct | Scenario3_CurrencyFormatting
struct | Scenario3_CustomItems
struct | Scenario3_Enum
struct | Scenario3_EnumerateTiles
struct | Scenario3_InkingFeedback
struct | Scenario3_MasterDetail
struct | Scenario3_NetworkConnectivityChanges
struct | Scenario3_ParameterizedTemplate
struct | Scenario3_Region
struct | Scenario3_ResetPIN
struct | Scenario3_SecondaryTiles
struct | Scenario3_ServerForeground
struct | Scenario3_SettingContainer
struct | Scenario3_ShowHideMethods
Sample page to call TryShow/TryHide methods. More...
struct | Scenario3_SingleFolder
struct | Scenario3_Size
struct | Scenario3_Transliteration
struct | Scenario3_XmlWriterLite
struct | Scenario4
Writing and reading bytes in a file. More...
struct | Scenario4_ChangeAdminKey
struct | Scenario4_ChangeSystemGroup
struct | Scenario4_CharacterGrouping
struct | Scenario4_CompactOverlay
struct | Scenario4_CompositeSettings
struct | Scenario4_EdgeTappedListView
struct | Scenario4_ForegroundGeofence
struct | Scenario4_Input
struct | Scenario4_InteractionFeedback
struct | Scenario4_NumberParsing
struct | Scenario4_Override
struct | Scenario4_PartialReadWrite
struct | Scenario4_SaveFile
struct | Scenario4_ShowView
struct | Scenario4_Snapshot
struct | Scenario4_SymbologyAttributes
struct | Scenario4_TilePinned
struct | Scenario4_UnicodeExtensions
struct | Scenario5
Writing and reading using a stream. More...
struct | Scenario5_DisplayingBarcodePreview
struct | Scenario5_GeofenceBackgroundTask
struct | Scenario5_GetSingleDevice
struct | Scenario5_InkingAndInteractionFeedback
struct | Scenario5_IsSupported
struct | Scenario5_LaunchedFromSecondaryTile
struct | Scenario5_Msappdata
struct | Scenario5_RelativePositioning
struct | Scenario5_RestoreScrollPosition
struct | Scenario5_RoundingAndPadding
struct | Scenario5_TimeZone
struct | Scenario5_TriggerCFU
struct | Scenario5_UnicodeExtensions
struct | Scenario5_VerifyResponse
struct | Scenario6
Displaying file properties. More...
struct | Scenario6_ClearScenario
struct | Scenario6_CustomFilterAddedProps
struct | Scenario6_DeleteTPM
struct | Scenario6_GetLastVisit
struct | Scenario6_NumeralSystemTranslation
struct | Scenario6_ScrollIntoView
struct | Scenario6_SecondaryTileNotification
struct | Scenario6_TimeZone
struct | Scenario7
Persisting access to a storage item for future use. More...
struct | Scenario7_DeviceInformationKind
struct | Scenario7_ForegroundVisits
struct | Scenario7_ListAllCards
struct | Scenario7_PinFromAppbar
struct | Scenario7_SetVersion
struct | Scenario7_UsingUnicodeExtensions
struct | Scenario8
Copying a file. More...
struct | Scenario8_PairDevice
struct | Scenario8_TransmitAPDU
struct | Scenario8_UpdateAsync
struct | Scenario8_VisitsBackgroundTask
struct | Scenario9
struct | Scenario9_CustomPairDevice
struct | School
struct | SecondaryAppWindowPage
struct | SecondaryViewPage
struct | ShowPackageFamilyName
struct | SizePreferenceString
struct | SlowInputStream
struct | SmartCardListItem
struct | SymbologyListEntry
struct | User
struct | UserViewModel
struct | Utils
struct | ViewLifetimeControl
struct | WordOverlay

Functions

TimeSpan | LocalTimeOfDay (DateTime dateTime)
int32_t | ParseHeartRateValue (IBuffer const &buffer)
SmartCardPinCharacterPolicyOption | ParsePinPolicyOption (hstring const &value)

Variables

constexpr float | MinWindowHeight = 48
constexpr float | MinWindowWidth = 192

Function Documentation

TimeSpan winrt::SDKTemplate::implementation::LocalTimeOfDay ( DateTime dateTime )

Definition at line 111 of file Scenario4_ForegroundGeofence.cpp.

    {
        // Convert from UTC to local, then calculate remainder.
        // This takes advantage of the fact that FILETIME begins at midnight.
        FILETIME utc = clock::to_FILETIME(dateTime);
        FILETIME local;
        FileTimeToLocalFileTime(&utc, &local);
        return TimeSpan(file_time(local).value % TimeSpan(std::chrono::hours(24)).count());
    }

int32_t winrt::SDKTemplate::implementation::ParseHeartRateValue ( IBuffer const & buffer )

Process the raw data received from the device into application usable data, according the the Bluetooth Heart Rate Profile.

https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml&u=org.bluetooth.characteristic.heart_rate_measurement.xml This function throws an std::out_of_range if the data cannot be parsed.

Parameters:
data Raw data received from the heart rate monitor.
Returns:
The heart rate measurement value.

Definition at line 544 of file Scenario2_Client.cpp.

    {
        // Heart Rate profile defined flag values
        const uint8_t heartRateValueFormat = 0x1;

        com_array<uint8_t> bytes;
        CryptographicBuffer::CopyToByteArray(buffer, bytes);

        if (bytes.at(0) & heartRateValueFormat)
        {
            return bytes.at(1) | (bytes.at(2) << 8);
        }
        return bytes.at(1);
    }

SmartCardPinCharacterPolicyOption winrt::SDKTemplate::implementation::ParsePinPolicyOption ( hstring const & value )

Definition at line 140 of file Scenario1_ProvisionTPM.cpp.

    {
        static constexpr wchar_t pinPolicyDisallowed[] = L"Disallowed";
        static constexpr wchar_t pinPolicyAllowed[] = L"Allowed";
        static constexpr wchar_t pinPolicyRequireOne[] = L"Require At Least One";

        if (value == pinPolicyDisallowed)
        {
            return SmartCardPinCharacterPolicyOption::Disallow;
        }
        else if (value == pinPolicyAllowed)
        {
            return SmartCardPinCharacterPolicyOption::Allow;
        }
        else if (value == pinPolicyRequireOne)
        {
            return SmartCardPinCharacterPolicyOption::RequireAtLeastOne;
        }
        else
        {
            throw hresult_invalid_argument();
        }
    }

Variable Documentation

constexpr float MinWindowHeight = 48

Definition at line 43 of file Scenario3_Size.cpp.

constexpr float MinWindowWidth = 192

Definition at line 42 of file Scenario3_Size.cpp.

Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp} Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • implementation
  • anonymous_namespace{DeviceHelpers.cpp}
Functions

winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp} Namespace Reference

Functions

void AddVideoCastingIfSupported (IObservableVector< SDKTemplate::DeviceSelectorInfo > &selectors)
SDKTemplate::DeviceSelectorInfo Bluetooth ()
SDKTemplate::DeviceSelectorInfo BluetoothLE ()
SDKTemplate::DeviceSelectorInfo BluetoothLEPairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothLEUnpairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothPairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothUnpairedOnly ()
SDKTemplate::DeviceSelectorInfo DialAllApps ()
SDKTemplate::DeviceSelectorInfo NetworkCamera ()
SDKTemplate::DeviceSelectorInfo PointOfServicePrinter ()
SDKTemplate::DeviceSelectorInfo Upnp ()
SDKTemplate::DeviceSelectorInfo VideoCasting ()
SDKTemplate::DeviceSelectorInfo WiFiDirect ()
SDKTemplate::DeviceSelectorInfo WiFiDirectPairedOnly ()
SDKTemplate::DeviceSelectorInfo Wsd ()

Function Documentation

void winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::AddVideoCastingIfSupported ( IObservableVector< SDKTemplate::DeviceSelectorInfo > & selectors )

Definition at line 136 of file DeviceHelpers.cpp.

        {
            try
            {
                selectors.Append(VideoCasting());
            }
            catch (hresult_error const& ex)
            {

                if (ex.code() == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED))
                {
                    // Video casting is not supported by the system.
                }
                else
                {
                    throw;
                }
            }
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::Bluetooth ( )

Definition at line 58 of file DeviceHelpers.cpp.

        {
            // Currently Bluetooth APIs don't provide a selector to get ALL devices that are both paired and non-paired.  Typically you wouldn't need this for common scenarios, but it's convenient to demonstrate the
            // various sample scenarios.
            return make<DeviceSelectorInfo>(L"Bluetooth", L"System.Devices.Aep.ProtocolId:=\"{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\"", DeviceInformationKind::AssociationEndpoint);
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::BluetoothLE ( )

Definition at line 75 of file DeviceHelpers.cpp.

        {
            // Currently Bluetooth APIs don't provide a selector to get ALL devices that are both paired and non-paired.  Typically you wouldn't need this for common scenarios, but it's convenient to demonstrate the
            // various sample scenarios.
            return make<DeviceSelectorInfo>(L"Bluetooth LE", L"System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\"", DeviceInformationKind::AssociationEndpoint);
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::BluetoothLEPairedOnly ( )

Definition at line 87 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Bluetooth LE (paired)", Windows::Devices::Bluetooth::BluetoothLEDevice::GetDeviceSelectorFromPairingState(true));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::BluetoothLEUnpairedOnly ( )

Definition at line 82 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Bluetooth LE (unpaired)", Windows::Devices::Bluetooth::BluetoothLEDevice::GetDeviceSelectorFromPairingState(false));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::BluetoothPairedOnly ( )

Definition at line 70 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Bluetooth (paired)", Windows::Devices::Bluetooth::BluetoothDevice::GetDeviceSelectorFromPairingState(true));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::BluetoothUnpairedOnly ( )

Definition at line 65 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Bluetooth (unpaired)", Windows::Devices::Bluetooth::BluetoothDevice::GetDeviceSelectorFromPairingState(false));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::DialAllApps ( )

Definition at line 112 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"DIAL (All apps)", Windows::Media::DialProtocol::DialDevice::GetDeviceSelector(L""));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::NetworkCamera ( )

Definition at line 131 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Web Services on Devices (NetworkCamera)", L"System.Devices.Aep.ProtocolId:=\"{43cc0de4-8ca8-4a56-805a-86fc63f21602}\"", DeviceInformationKind::AssociationEndpoint);
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::PointOfServicePrinter ( )

Definition at line 102 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Point of Service Printer", Windows::Devices::PointOfService::PosPrinter::GetDeviceSelector());
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::Upnp ( )

Definition at line 126 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"UPnP", L"System.Devices.Aep.ProtocolId:=\"{0e261de4-12f0-46e6-91ba-428607ccef64}\"", DeviceInformationKind::AssociationEndpoint);
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::VideoCasting ( )

Definition at line 107 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Video Casting", Windows::Media::Casting::CastingDevice::GetDeviceSelector(Windows::Media::Casting::CastingPlaybackTypes::Video));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::WiFiDirect ( )

Definition at line 92 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Wi-Fi Direct", Windows::Devices::WiFiDirect::WiFiDirectDevice::GetDeviceSelector(Windows::Devices::WiFiDirect::WiFiDirectDeviceSelectorType::AssociationEndpoint));
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::WiFiDirectPairedOnly ( )

Definition at line 97 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Wi-Fi Direct (paired)", Windows::Devices::WiFiDirect::WiFiDirectDevice::GetDeviceSelector());
        }

SDKTemplate::DeviceSelectorInfo winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}::Wsd ( )

Definition at line 121 of file DeviceHelpers.cpp.

        {
            return make<DeviceSelectorInfo>(L"Web Services on Devices (WSD)", L"System.Devices.Aep.ProtocolId:=\"{782232aa-a2f9-4993-971b-aedc551346b0}\"", DeviceInformationKind::AssociationEndpoint);
        }

Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: winrt::SDKTemplate::SampleHelpers Namespace Reference

  • Namespace List
  • Namespace Members
  • winrt
  • SDKTemplate
  • SampleHelpers
Functions

winrt::SDKTemplate::SampleHelpers Namespace Reference

Functions

void | HighlightFaces (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces, Windows::UI::Xaml::Controls::Canvas const &canvas, Windows::UI::Xaml::DataTemplate const &dataTemplate)
void | RepositionFaces (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::UI::Xaml::Controls::Canvas const &canvas)

Function Documentation

void winrt::SDKTemplate::SampleHelpers::HighlightFaces | ( | Windows::UI::Xaml::Media::Imaging::WriteableBitmap const & | displaySource,
 |  | Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const & | foundFaces,
 |  | Windows::UI::Xaml::Controls::Canvas const & | canvas,
 |  | Windows::UI::Xaml::DataTemplate const & | dataTemplate
 | ) |  |
void winrt::SDKTemplate::SampleHelpers::RepositionFaces | ( | Windows::UI::Xaml::Media::Imaging::WriteableBitmap const & | displaySource,
 |  | Windows::UI::Xaml::Controls::Canvas const & | canvas
 | ) |  |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent Namespace Reference

  • Namespace List
  • Namespace Members
Classes

WRLInProcessWinRTComponent Namespace Reference

Classes

class | CustomException
class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent Namespace Reference

  • Namespace List
  • Namespace Members
Classes

WRLOutOfProcessWinRTComponent Namespace Reference

Classes

class | CustomException
class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: xBindSampleCS Namespace Reference

  • Namespace List
  • Namespace Members
Classes

xBindSampleCS Namespace Reference

Classes

class | BasicTests
class | ColorEntry
class | CSharpModel
class | EventTests
An empty page that can be used on its own or navigated to within a Frame. More...
class | Functions
class | ListsAndTemplates
class | MyUserControl1
class | OtherBindings
class | PhasingTests
class | Templates
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: xBindSampleModel Namespace Reference

  • Namespace List
  • Namespace Members
Classes

xBindSampleModel Namespace Reference

Classes

class | BoolToVisibilityConverter
class | ColorToStringConverter
class | DataModel
class | DOModel
class | DoubleToIntConverter
class | Employee
class | EmployeeCollection
class | EmployeeDictionary
class | FileDataSource
class | FileItem
interface | IEmployee
class | IntToDoubleConverter
class | Manager
class | MapChangedEventArgs-g
class | VectorChangedEventArgs
class | YangContainer
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: xDeferLoadStrategy Namespace Reference

  • Namespace List
  • Namespace Members
Classes

xDeferLoadStrategy Namespace Reference

Classes

class | Account
class | AdaptivePage
An empty page that can be used on its own or navigated to within a Frame. More...
class | BasicDeferral
An empty page that can be used on its own or navigated to within a Frame. More...
class | DeferredControlTemplatePart
An empty page that can be used on its own or navigated to within a Frame. More...
class | Email
class | TitledImage
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Xml Namespace Reference

  • Namespace List
  • Namespace Members
Classes

Xml Namespace Reference

Classes

class | BuildNewRss
An empty page that can be used on its own or navigated to within a Frame. More...
class | GiftDispatch
An empty page that can be used on its own or navigated to within a Frame. More...
class | MarkHotProducts
An empty page that can be used on its own or navigated to within a Frame. More...
class | XmlLoading
An empty page that can be used on its own or navigated to within a Frame. More...
class | XSLTTransform
An empty page that can be used on its own or navigated to within a Frame. More...
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- _ -

  • __declspec() : Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: File Index

  • File List
  • File Members

File List

Here is a list of all files with brief descriptions:
360VideoPlayback/cpp/360VideoPlaybackMain.cpp [code]
360VideoPlayback/cpp/360VideoPlaybackMain.h [code]
360VideoPlayback/cpp/App.xaml.cpp [code]
360VideoPlayback/cpp/App.xaml.h [code]
360VideoPlayback/cpp/AppView.cpp [code]
360VideoPlayback/cpp/AppView.h [code]
360VideoPlayback/cpp/MainPage.xaml.cpp [code]
360VideoPlayback/cpp/MainPage.xaml.h [code]
360VideoPlayback/cpp/pch.cpp [code]
360VideoPlayback/cpp/pch.h [code]
360VideoPlayback/cpp/PlaybackPage.xaml.cpp [code]
360VideoPlayback/cpp/PlaybackPage.xaml.h [code]
360VideoPlayback/cpp/VideoGallery.xaml.cpp [code]
360VideoPlayback/cpp/VideoGallery.xaml.h [code]
360VideoPlayback/cpp/VideoItem.h [code]
360VideoPlayback/cpp/Common/BaseControl.cpp [code]
360VideoPlayback/cpp/Common/BaseControl.h [code]
360VideoPlayback/cpp/Common/BaseElement.cpp [code]
360VideoPlayback/cpp/Common/BaseElement.h [code]
360VideoPlayback/cpp/Common/CameraResources.cpp [code]
360VideoPlayback/cpp/Common/CameraResources.h [code]
360VideoPlayback/cpp/Common/Controls.cpp [code]
360VideoPlayback/cpp/Common/Controls.h [code]
360VideoPlayback/cpp/Common/DeviceResources.cpp [code]
360VideoPlayback/cpp/Common/DeviceResources.h [code]
360VideoPlayback/cpp/Common/DirectXHelper.h [code]
360VideoPlayback/cpp/Common/MeshGeometry.cpp [code]
360VideoPlayback/cpp/Common/MeshGeometry.h [code]
360VideoPlayback/cpp/Common/SeekBarElement.cpp [code]
360VideoPlayback/cpp/Common/SeekBarElement.h [code]
360VideoPlayback/cpp/Common/StepTimer.h [code]
360VideoPlayback/cpp/Content/MediaTransportControls.cpp [code]
360VideoPlayback/cpp/Content/MediaTransportControls.h [code]
360VideoPlayback/cpp/Content/ShaderStructures.h [code]
360VideoPlayback/cpp/Content/SpatialInputHandler.cpp [code]
360VideoPlayback/cpp/Content/SpatialInputHandler.h [code]
360VideoPlayback/cpp/Content/VideoRenderer.cpp [code]
360VideoPlayback/cpp/Content/VideoRenderer.h [code]
360VideoPlayback/cs/_360VideoPlaybackMain.cs [code]
360VideoPlayback/cs/App.xaml.cs [code]
360VideoPlayback/cs/AppView.cs [code]
360VideoPlayback/cs/AppViewSource.cs [code]
360VideoPlayback/cs/FxCompile.cs [code]
360VideoPlayback/cs/Helpers.cs [code]
360VideoPlayback/cs/HolographicApp1Main.cs [code]
360VideoPlayback/cs/MainPage.xaml.cs [code]
360VideoPlayback/cs/PlaybackPage.xaml.cs [code]
360VideoPlayback/cs/Program.cs [code]
360VideoPlayback/cs/VideoGallery.xaml.cs [code]
360VideoPlayback/cs/VideoItem.cs [code]
360VideoPlayback/cs/Common/CameraResources.cs [code]
360VideoPlayback/cs/Common/DeviceResources.cs [code]
360VideoPlayback/cs/Common/DirectXHelper.cs [code]
360VideoPlayback/cs/Common/Disposer.cs [code]
360VideoPlayback/cs/Common/InteropStatics.cs [code]
360VideoPlayback/cs/Common/StepTimer.cs [code]
360VideoPlayback/cs/Content/ShaderStructures.cs [code]
360VideoPlayback/cs/Content/SpatialInputHandler.cs [code]
360VideoPlayback/cs/Content/VideoRenderer.cs [code]
3DPrinting/cppwinrt/pch.cpp [code]
3DPrinting/cppwinrt/pch.h [code]
3DPrinting/cppwinrt/Project.idl [code]
3DPrinting/cppwinrt/SampleConfiguration.cpp [code]
3DPrinting/cppwinrt/SampleConfiguration.h [code]
3DPrinting/cppwinrt/Scenario1_Print.cpp [code]
3DPrinting/cppwinrt/Scenario1_Print.h [code]
3DPrinting/cppwinrt/Scenario2_Launch.cpp [code]
3DPrinting/cppwinrt/Scenario2_Launch.h [code]
3DPrinting/cs/SampleConfiguration.cs [code]
3DPrinting/cs/Scenario1_Print.xaml.cs [code]
3DPrinting/cs/Scenario2_Launch.xaml.cs [code]
3DPrintingFromUnity/Assets/Script/Print3D.cs [code]
3DPrintingFromUnity/Assets/Script/Turn.cs [code]
Accelerometer/cpp/pch.cpp [code]
Accelerometer/cpp/pch.h [code]
Accelerometer/cpp/SampleConfiguration.cpp [code]
Accelerometer/cpp/SampleConfiguration.h [code]
Accelerometer/cpp/Scenario0_Choose.xaml.cpp [code]
Accelerometer/cpp/Scenario0_Choose.xaml.h [code]
Accelerometer/cpp/Scenario1_DataEvents.xaml.cpp [code]
Accelerometer/cpp/Scenario1_DataEvents.xaml.h [code]
Accelerometer/cpp/Scenario2_ShakeEvents.xaml.cpp [code]
Accelerometer/cpp/Scenario2_ShakeEvents.xaml.h [code]
Accelerometer/cpp/Scenario3_Polling.xaml.cpp [code]
Accelerometer/cpp/Scenario3_Polling.xaml.h [code]
Accelerometer/cpp/Scenario4_OrientationChanged.xaml.cpp [code]
Accelerometer/cpp/Scenario4_OrientationChanged.xaml.h [code]
Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.cpp [code]
Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.h [code]
Accelerometer/cs/SampleConfiguration.cs [code]
Accelerometer/cs/Scenario0_Choose.xaml.cs [code]
Accelerometer/cs/Scenario1_DataEvents.xaml.cs [code]
Accelerometer/cs/Scenario2_ShakeEvents.xaml.cs [code]
Accelerometer/cs/Scenario3_Polling.xaml.cs [code]
Accelerometer/cs/Scenario4_OrientationChanged.xaml.cs [code]
Accelerometer/cs/Scenario5_DataEventsBatching.xaml.cs [code]
ActivitySensor/cpp/pch.cpp [code]
ActivitySensor/cpp/pch.h [code]
ActivitySensor/cpp/SampleConfiguration.cpp [code]
ActivitySensor/cpp/SampleConfiguration.h [code]
ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.cpp [code]
ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.h [code]
ActivitySensor/cpp/Scenario2_History.xaml.cpp [code]
ActivitySensor/cpp/Scenario2_History.xaml.h [code]
ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.cpp [code]
ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.h [code]
ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.cpp [code]
ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.h [code]
ActivitySensor/cpp/Tasks/ActivitySensorBackgroundTask.cpp [code]
ActivitySensor/cpp/Tasks/ActivitySensorBackgroundTask.h [code]
ActivitySensor/cpp/Tasks/pch.cpp [code]
ActivitySensor/cpp/Tasks/pch.h [code]
ActivitySensor/cs/SampleConfiguration.cs [code]
ActivitySensor/cs/Scenario1_CurrentActivity.xaml.cs [code]
ActivitySensor/cs/Scenario2_History.xaml.cs [code]
ActivitySensor/cs/Scenario3_ChangeEvents.xaml.cs [code]
ActivitySensor/cs/Scenario4_BackgroundActivity.xaml.cs [code]
ActivitySensor/cs/Tasks/ActivitySensorBackgroundTask.cs [code]
ActivitySensor/cs/Tasks/Properties/AssemblyInfo.cs [code]
AdaptiveStreaming/cs/SampleConfiguration.cs [code]
AdaptiveStreaming/cs/Scenario1_SimplestAdaptiveStreaming.xaml.cs [code]
AdaptiveStreaming/cs/Scenario2_EventHandlers.xaml.cs [code]
AdaptiveStreaming/cs/Scenario3_RequestModification.xaml.cs [code]
AdaptiveStreaming/cs/Scenario4_Tuning.xaml.cs [code]
AdaptiveStreaming/cs/Scenario5_Metadata.xaml.cs [code]
AdaptiveStreaming/cs/Scenario6_AdInsertion.xaml.cs [code]
AdaptiveStreaming/cs/Scenario7_LiveSeekableRange.xaml.cs [code]
AdaptiveStreaming/cs/Controls/ContentSelector.xaml.cs [code]
AdaptiveStreaming/cs/Helpers/CommonLicenseRequest.cs [code]
AdaptiveStreaming/cs/Helpers/PlayReadyHelper.cs [code]
AdaptiveStreaming/cs/Models/AdaptiveContentModel.cs [code]
AdaptiveStreaming/cs/Shared/TrackingEventCue.cs [code]
AdvancedCasting/cs/01_MediaElement.xaml.cs [code]
AdvancedCasting/cs/02_Casting_API_CastButton.xaml.cs [code]
AdvancedCasting/cs/03_DIAL_Sender_API.xaml.cs [code]
AdvancedCasting/cs/04_DIAL_Receiver_App.xaml.cs [code]
AdvancedCasting/cs/05_Multi_View_Media_Application.xaml.cs [code]
AdvancedCasting/cs/06_Combine_Casting_Tech.xaml.cs [code]
AdvancedCasting/cs/App.xaml.cs [code]
AdvancedCasting/cs/MainPage.xaml.cs [code]
AdvancedCasting/cs/ProjectionViewPage.xaml.cs [code]
AdvancedCasting/cs/SampleConfiguration.cs [code]
AdvancedCasting/cs/UnhandledExceptionPage.xaml.cs [code]
AdvancedCasting/cs/Controls/MediaTransportControlsWithCustomCastButton.cs [code]
AdvancedCasting/cs/Controls/ProjectedMediaTransportControls.cs [code]
AdvancedCasting/cs/Controls/ProjectionViewBroker.cs [code]
AdvancedCasting/cs/Data/Azure/AzureDataProvider.cs [code]
AdvancedCasting/cs/Data/Common/ItemsDataProvider.cs [code]
AdvancedCasting/cs/Data/Common/VideoMetaData.cs [code]
AdvancedCasting/cs/Util/ApiInformation.cs [code]
AdvancedCasting/cs/Util/CustomDevicePickerFilter.cs [code]
AdvancedCasting/cs/Util/DialLaunchArguments.cs [code]
AdvancedCasting/cs/Util/RequiredDeviceProperties.cs [code]
AdvancedCasting/cs/Util/ViewLifetimeControl.cs [code]
AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h [code]
AllJoyn/Common/Scenario1WinRTComponent/ISecureInterfaceService.h [code]
AllJoyn/Common/Scenario1WinRTComponent/pch.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/pch.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceEventArgs.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceMethodResults.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.cpp [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.h [code]
AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceStructures.h [code]
AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h [code]
AllJoyn/Common/Scenario2WinRTComponent/IOnboardingService.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingEventArgs.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingMethodResults.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.h [code]
AllJoyn/Common/Scenario2WinRTComponent/OnboardingStructures.h [code]
AllJoyn/Common/Scenario2WinRTComponent/pch.cpp [code]
AllJoyn/Common/Scenario2WinRTComponent/pch.h [code]
AllJoyn/ConsumerExperiences/cs/OnboardingEnumTypes.cs [code]
AllJoyn/ConsumerExperiences/cs/RelayCommand.cs [code]
AllJoyn/ConsumerExperiences/cs/SampleConfiguration.cs [code]
AllJoyn/ConsumerExperiences/cs/Scenario1.xaml.cs [code]
AllJoyn/ConsumerExperiences/cs/Scenario1ViewModel.cs [code]
AllJoyn/ConsumerExperiences/cs/Scenario2.xaml.cs [code]
AllJoyn/ConsumerExperiences/cs/Scenario2ViewModel.cs [code]
AllJoyn/ProducerExperiences/cs/AppData.cs [code]
AllJoyn/ProducerExperiences/cs/OnboardingEnumTypes.cs [code]
AllJoyn/ProducerExperiences/cs/OnboardingService.cs [code]
AllJoyn/ProducerExperiences/cs/RelayCommand.cs [code]
AllJoyn/ProducerExperiences/cs/SampleConfiguration.cs [code]
AllJoyn/ProducerExperiences/cs/Scenario1.xaml.cs [code]
AllJoyn/ProducerExperiences/cs/Scenario1ViewModel.cs [code]
AllJoyn/ProducerExperiences/cs/Scenario2.xaml.cs [code]
AllJoyn/ProducerExperiences/cs/Scenario2ViewModel.cs [code]
AllJoyn/ProducerExperiences/cs/SecureInterfaceService.cs [code]
AllJoyn/shared/AllJoynBusObjectManager.cpp [code]
AllJoyn/shared/AllJoynBusObjectManager.h [code]
AllJoyn/shared/AllJoynHelpers.cpp [code]
AllJoyn/shared/TypeConversionHelpers.cpp [code]
AllJoyn/shared/TypeConversionHelpers.h [code]
Altimeter/cpp/pch.cpp [code]
Altimeter/cpp/pch.h [code]
Altimeter/cpp/SampleConfiguration.cpp [code]
Altimeter/cpp/SampleConfiguration.h [code]
Altimeter/cpp/Scenario1_DataEvents.xaml.cpp [code]
Altimeter/cpp/Scenario1_DataEvents.xaml.h [code]
Altimeter/cpp/Scenario2_Polling.xaml.cpp [code]
Altimeter/cpp/Scenario2_Polling.xaml.h [code]
Altimeter/cs/SampleConfiguration.cs [code]
Altimeter/cs/Scenario1_DataEvents.xaml.cs [code]
Altimeter/cs/Scenario2_Polling.xaml.cs [code]
AnimationMetrics/cpp/pch.cpp [code]
AnimationMetrics/cpp/pch.h [code]
AnimationMetrics/cpp/SampleConfiguration.cpp [code]
AnimationMetrics/cpp/SampleConfiguration.h [code]
AnimationMetrics/cpp/Scenario1_Metrics.xaml.cpp [code]
AnimationMetrics/cpp/Scenario1_Metrics.xaml.h [code]
AnimationMetrics/cs/SampleConfiguration.cs [code]
AnimationMetrics/cs/Scenario1_Metrics.xaml.cs [code]
ApplicationData/cppwinrt/pch.cpp [code]
ApplicationData/cppwinrt/pch.h [code]
ApplicationData/cppwinrt/Project.idl [code]
ApplicationData/cppwinrt/SampleConfiguration.cpp [code]
ApplicationData/cppwinrt/SampleConfiguration.h [code]
ApplicationData/cppwinrt/Scenario1_Files.cpp [code]
ApplicationData/cppwinrt/Scenario1_Files.h [code]
ApplicationData/cppwinrt/Scenario2_Settings.cpp [code]
ApplicationData/cppwinrt/Scenario2_Settings.h [code]
ApplicationData/cppwinrt/Scenario3_SettingContainer.cpp [code]
ApplicationData/cppwinrt/Scenario3_SettingContainer.h [code]
ApplicationData/cppwinrt/Scenario4_CompositeSettings.cpp [code]
ApplicationData/cppwinrt/Scenario4_CompositeSettings.h [code]
ApplicationData/cppwinrt/Scenario5_Msappdata.cpp [code]
ApplicationData/cppwinrt/Scenario5_Msappdata.h [code]
ApplicationData/cppwinrt/Scenario6_ClearScenario.cpp [code]
ApplicationData/cppwinrt/Scenario6_ClearScenario.h [code]
ApplicationData/cppwinrt/Scenario7_SetVersion.cpp [code]
ApplicationData/cppwinrt/Scenario7_SetVersion.h [code]
ApplicationData/cs/SampleConfiguration.cs [code]
ApplicationData/cs/Scenario1_Files.xaml.cs [code]
ApplicationData/cs/Scenario2_Settings.xaml.cs [code]
ApplicationData/cs/Scenario3_SettingContainer.xaml.cs [code]
ApplicationData/cs/Scenario4_CompositeSettings.xaml.cs [code]
ApplicationData/cs/Scenario5_Msappdata.xaml.cs [code]
ApplicationData/cs/Scenario6_ClearScenario.xaml.cs [code]
ApplicationData/cs/Scenario7_SetVersion.xaml.cs [code]
ApplicationResources/cpp/pch.cpp [code]
ApplicationResources/cpp/pch.h [code]
ApplicationResources/cpp/SampleConfiguration.cpp [code]
ApplicationResources/cpp/SampleConfiguration.h [code]
ApplicationResources/cpp/scenario1.xaml.cpp [code]
ApplicationResources/cpp/scenario1.xaml.h [code]
ApplicationResources/cpp/scenario10.xaml.cpp [code]
ApplicationResources/cpp/scenario10.xaml.h [code]
ApplicationResources/cpp/scenario11.xaml.cpp [code]
ApplicationResources/cpp/scenario11.xaml.h [code]
ApplicationResources/cpp/scenario12.xaml.cpp [code]
ApplicationResources/cpp/scenario12.xaml.h [code]
ApplicationResources/cpp/scenario13.xaml.cpp [code]
ApplicationResources/cpp/scenario13.xaml.h [code]
ApplicationResources/cpp/scenario2.xaml.cpp [code]
ApplicationResources/cpp/scenario2.xaml.h [code]
ApplicationResources/cpp/scenario3.xaml.cpp [code]
ApplicationResources/cpp/scenario3.xaml.h [code]
ApplicationResources/cpp/scenario4.xaml.cpp [code]
ApplicationResources/cpp/scenario4.xaml.h [code]
ApplicationResources/cpp/scenario5.xaml.cpp [code]
ApplicationResources/cpp/scenario5.xaml.h [code]
ApplicationResources/cpp/scenario7.xaml.cpp [code]
ApplicationResources/cpp/scenario7.xaml.h [code]
ApplicationResources/cpp/scenario8.xaml.cpp [code]
ApplicationResources/cpp/scenario8.xaml.h [code]
ApplicationResources/cs/constants.cs [code]
ApplicationResources/cs/scenario1.xaml.cs [code]
ApplicationResources/cs/scenario10.xaml.cs [code]
ApplicationResources/cs/scenario11.xaml.cs [code]
ApplicationResources/cs/scenario12.xaml.cs [code]
ApplicationResources/cs/scenario13.xaml.cs [code]
ApplicationResources/cs/scenario2.xaml.cs [code]
ApplicationResources/cs/scenario3.xaml.cs [code]
ApplicationResources/cs/scenario4.xaml.cs [code]
ApplicationResources/cs/scenario5.xaml.cs [code]
ApplicationResources/cs/scenario6.xaml.cs [code]
ApplicationResources/cs/scenario7.xaml.cs [code]
ApplicationResources/cs/scenario8.xaml.cs [code]
ApplicationResources/cs/scenario9.xaml.cs [code]
ApplicationResources/cs/AppResourceClassLibrary/class1.cs [code]
ApplicationResources/cs/AppResourceClassLibrary/Properties/AssemblyInfo.cs [code]
Appointments/cs/SampleConfiguration.cs [code]
Appointments/cs/Scenario1_Define.xaml.cs [code]
Appointments/cs/Scenario2_Add.xaml.cs [code]
Appointments/cs/Scenario3_Replace.xaml.cs [code]
Appointments/cs/Scenario4_Remove.xaml.cs [code]
Appointments/cs/Scenario5_Show.xaml.cs [code]
Appointments/cs/Scenario6_Recurrence.xaml.cs [code]
AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.cpp [code]
AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.h [code]
AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.cpp [code]
AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.h [code]
AppServices/cppwinrt/AppServicesClient/pch.cpp [code]
AppServices/cppwinrt/AppServicesClient/pch.h [code]
AppServices/cppwinrt/AppServicesClient/Project.idl [code]
AppServices/cppwinrt/AppServicesClient/SampleConfiguration.cpp [code]
AppServices/cppwinrt/AppServicesClient/SampleConfiguration.h [code]
AppServices/cppwinrt/AppServicesProvider/pch.cpp [code]
AppServices/cppwinrt/AppServicesProvider/pch.h [code]
AppServices/cppwinrt/AppServicesProvider/Project.idl [code]
AppServices/cppwinrt/AppServicesProvider/SampleConfiguration.cpp [code]
AppServices/cppwinrt/AppServicesProvider/SampleConfiguration.h [code]
AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.cpp [code]
AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.h [code]
AppServices/cppwinrt/RandomNumberService/pch.cpp [code]
AppServices/cppwinrt/RandomNumberService/pch.h [code]
AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.cpp [code]
AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.h [code]
AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.idl [code]
AppServices/cs/AppServicesClient/KeepConnectionOpenScenario.xaml.cs [code]
AppServices/cs/AppServicesClient/OpenCloseConnectionScenario.xaml.cs [code]
AppServices/cs/AppServicesClient/SampleConfiguration.cs [code]
AppServices/cs/AppServicesProvider/SampleConfiguration.cs [code]
AppServices/cs/AppServicesProvider/ShowPackageFamilyName.xaml.cs [code]
AppServices/cs/RandomNumberService/RandomNumberGeneratorTask.cs [code]
AppServices/cs/RandomNumberService/Properties/AssemblyInfo.cs [code]
AppWindow/cppwinrt/pch.cpp [code]
AppWindow/cppwinrt/pch.h [code]
AppWindow/cppwinrt/Project.idl [code]
AppWindow/cppwinrt/SampleConfiguration.cpp [code]
AppWindow/cppwinrt/SampleConfiguration.h [code]
AppWindow/cppwinrt/Scenario1_SecondaryWindow.cpp [code]
AppWindow/cppwinrt/Scenario1_SecondaryWindow.h [code]
AppWindow/cppwinrt/Scenario2_DisplayRegion.cpp [code]
AppWindow/cppwinrt/Scenario2_DisplayRegion.h [code]
AppWindow/cppwinrt/Scenario3_Size.cpp [code]
AppWindow/cppwinrt/Scenario3_Size.h [code]
AppWindow/cppwinrt/Scenario4_CompactOverlay.cpp [code]
AppWindow/cppwinrt/Scenario4_CompactOverlay.h [code]
AppWindow/cppwinrt/Scenario5_RelativePositioning.cpp [code]
AppWindow/cppwinrt/Scenario5_RelativePositioning.h [code]
AppWindow/cppwinrt/SecondaryAppWindowPage.cpp [code]
AppWindow/cppwinrt/SecondaryAppWindowPage.h [code]
AppWindow/cs/SampleConfiguration.cs [code]
AppWindow/cs/Scenario1_SecondaryWindow.xaml.cs [code]
AppWindow/cs/Scenario2_DisplayRegion.xaml.cs [code]
AppWindow/cs/Scenario3_Size.xaml.cs [code]
AppWindow/cs/Scenario4_CompactOverlay.xaml.cs [code]
AppWindow/cs/Scenario5_RelativePositioning.xaml.cs [code]
AppWindow/cs/SecondaryAppWindowPage.xaml.cs [code]
AssociationLaunching/cs/SampleConfiguration.cs [code]
AssociationLaunching/cs/Scenario1_LaunchFile.xaml.cs [code]
AssociationLaunching/cs/Scenario2_LaunchUri.xaml.cs [code]
AssociationLaunching/cs/Scenario3_ReceiveFile.xaml.cs [code]
AssociationLaunching/cs/Scenario4_ReceiveUri.xaml.cs [code]
AudioCategory/cs/AudioCategory/PlaybackControl.xaml.cs [code]
AudioCategory/cs/AudioCategory/SampleConfiguration.cs [code]
AudioCategory/cs/AudioCategory/Scenario1.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario10.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario2.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario3.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario4.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario5.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario6.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario7.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario8.xaml.cs [code]
AudioCategory/cs/AudioCategory/Scenario9.xaml.cs [code]
AudioCreation/cs/AudioCreation/SampleConfiguration.cs [code]
AudioCreation/cs/AudioCreation/Scenario1_FilePlayback.xaml.cs [code]
AudioCreation/cs/AudioCreation/Scenario2_DeviceCapture.xaml.cs [code]
AudioCreation/cs/AudioCreation/Scenario3_FrameInputNode.xaml.cs [code]
AudioCreation/cs/AudioCreation/Scenario4_Submix.xaml.cs [code]
AudioCreation/cs/AudioCreation/Scenario5_InboxEffects.xaml.cs [code]
AudioCreation/cs/AudioCreation/Scenario6_CustomEffects.xaml.cs [code]
AudioCreation/cs/CustomEffect/CustomEffect.cs [code]
AudioCreation/cs/CustomEffect/Properties/AssemblyInfo.cs [code]
BackButton/cpp/App.xaml.cpp [code]
BackButton/cpp/App.xaml.h [code]
BackButton/cpp/MainPage.xaml.cpp [code]
BackButton/cpp/MainPage.xaml.h [code]
BackButton/cpp/pch.cpp [code]
BackButton/cpp/pch.h [code]
BackButton/cpp/SampleConfiguration.cpp [code]
BackButton/cpp/SampleConfiguration.h [code]
BackButton/cpp/Scenario1.xaml.cpp [code]
BackButton/cpp/Scenario1.xaml.h [code]
BackButton/cpp/SecondaryPage.xaml.cpp [code]
BackButton/cpp/SecondaryPage.xaml.h [code]
BackButton/cs/App.xaml.cs [code]
BackButton/cs/MainPage.xaml.cs [code]
BackButton/cs/SampleConfiguration.cs [code]
BackButton/cs/Scenario1.xaml.cs [code]
BackButton/cs/SecondaryPage.xaml.cs [code]
BackgroundActivation/cpp/BackgroundActivity.cpp [code]
BackgroundActivation/cpp/BackgroundActivity.h [code]
BackgroundActivation/cpp/pch.cpp [code]
BackgroundActivation/cpp/pch.h [code]
BackgroundActivation/cpp/SampleConfiguration.cpp [code]
BackgroundActivation/cpp/SampleConfiguration.h [code]
BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.cpp [code]
BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.h [code]
BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp [code]
BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.h [code]
BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.cpp [code]
BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.h [code]
BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.cpp [code]
BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.h [code]
BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.cpp [code]
BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.h [code]
BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp [code]
BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h [code]
BackgroundActivation/cs/BackgroundActivity.cs [code]
BackgroundActivation/cs/SampleConfiguration.cs [code]
BackgroundActivation/cs/Scenario1_SampleBackgroundTask.xaml.cs [code]
BackgroundActivation/cs/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs [code]
BackgroundActivation/cs/Scenario3_ServicingCompleteTask.xaml.cs [code]
BackgroundActivation/cs/Scenario4_TimeTriggeredTask.xaml.cs [code]
BackgroundActivation/cs/Scenario5_ApplicationTriggerTask.xaml.cs [code]
BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs [code]
BackgroundMediaPlayback/cs/App.xaml.cs [code]
BackgroundMediaPlayback/cs/BackgroundApp.cs [code]
BackgroundMediaPlayback/cs/SampleConfiguration.cs [code]
BackgroundMediaPlayback/cs/Scenario1.xaml.cs [code]
BackgroundMediaPlayback/cs/Settings.xaml.cs [code]
BackgroundMediaPlayback/cs/DataModels/MediaItem.cs [code]
BackgroundMediaPlayback/cs/DataModels/MediaList.cs [code]
BackgroundMediaPlayback/cs/DataModels/MusicItem.cs [code]
BackgroundMediaPlayback/cs/DataModels/VideoItem.cs [code]
BackgroundMediaPlayback/cs/Services/PlaybackService.cs [code]
BackgroundMediaPlayback/cs/Services/SettingsService.cs [code]
BackgroundMediaPlayback/cs/ViewModels/MediaItemViewModel.cs [code]
BackgroundMediaPlayback/cs/ViewModels/MediaListViewModel.cs [code]
BackgroundMediaPlayback/cs/ViewModels/PlaybackSessionViewModel.cs [code]
BackgroundMediaPlayback/cs/ViewModels/PlaybackStateToButtonIconConverter.cs [code]
BackgroundMediaPlayback/cs/ViewModels/PlayerViewModel.cs [code]
BackgroundMediaPlayback/cs/ViewModels/SettingsViewModel.cs [code]
BackgroundMediaPlayback/cs/Views/PlaylistView.xaml.cs [code]
BackgroundSensors/cpp/pch.cpp [code]
BackgroundSensors/cpp/pch.h [code]
BackgroundSensors/cpp/SampleConfiguration.cpp [code]
BackgroundSensors/cpp/SampleConfiguration.h [code]
BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.cpp [code]
BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.h [code]
BackgroundSensors/cpp/BackgroundTask/pch.cpp [code]
BackgroundSensors/cpp/BackgroundTask/pch.h [code]
BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.cpp [code]
BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.h [code]
BackgroundSensors/cs/SampleConfiguration.cs [code]
BackgroundSensors/cs/Scenario1_DeviceUse.xaml.cs [code]
BackgroundSensors/cs/BackgroundTask/Scenario1_BackgroundTask.cs [code]
BackgroundSensors/cs/BackgroundTask/Properties/AssemblyInfo.cs [code]
BackgroundTask/cpp/BackgroundTask/pch.cpp [code]
BackgroundTask/cpp/BackgroundTask/pch.h [code]
BackgroundTask/cpp/BackgroundTask/SampleConfiguration.cpp [code]
BackgroundTask/cpp/BackgroundTask/SampleConfiguration.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.h [code]
BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.cpp [code]
BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.h [code]
BackgroundTask/cpp/Tasks/pch.cpp [code]
BackgroundTask/cpp/Tasks/pch.h [code]
BackgroundTask/cpp/Tasks/SampleBackgroundTask.cpp [code]
BackgroundTask/cpp/Tasks/SampleBackgroundTask.h [code]
BackgroundTask/cpp/Tasks/ServicingComplete.cpp [code]
BackgroundTask/cpp/Tasks/ServicingComplete.h [code]
BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cs [code]
BackgroundTask/cs/BackgroundTask/Scenario6_GroupedTask.xaml.cs [code]
BackgroundTask/cs/Tasks/SampleBackgroundTask.cs [code]
BackgroundTask/cs/Tasks/ServicingComplete.cs [code]
BackgroundTask/cs/Tasks/Properties/AssemblyInfo.cs [code]
BackgroundTransfer/cpp/BackgroundTransfer/pch.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/pch.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.h [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cpp [code]
BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.h [code]
BackgroundTransfer/cpp/Tasks/CompletionGroupTask.cpp [code]
BackgroundTransfer/cpp/Tasks/CompletionGroupTask.h [code]
BackgroundTransfer/cpp/Tasks/pch.cpp [code]
BackgroundTransfer/cpp/Tasks/pch.h [code]
BackgroundTransfer/cs/BackgroundTransfer/SampleConfiguration.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario1_Download.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario2_Upload.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario3_Notifications.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario5_RandomAccess.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cs [code]
BackgroundTransfer/cs/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cs [code]
BackgroundTransfer/cs/Tasks/CompletionGroupTask.cs [code]
BackgroundTransfer/cs/Tasks/Properties/AssemblyInfo.cs [code]
BarcodeScanner/cppwinrt/BarcodeScannerInfo.cpp [code]
BarcodeScanner/cppwinrt/BarcodeScannerInfo.h [code]
BarcodeScanner/cppwinrt/BindingHelpers.cpp [code]
BarcodeScanner/cppwinrt/BindingHelpers.h [code]
BarcodeScanner/cppwinrt/DataHelpers.cpp [code]
BarcodeScanner/cppwinrt/DataHelpers.h [code]
BarcodeScanner/cppwinrt/pch.cpp [code]
BarcodeScanner/cppwinrt/pch.h [code]
BarcodeScanner/cppwinrt/Project.idl [code]
BarcodeScanner/cppwinrt/SampleConfiguration.cpp [code]
BarcodeScanner/cppwinrt/SampleConfiguration.h [code]
BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.cpp [code]
BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.h [code]
BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.cpp [code]
BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.h [code]
BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.cpp [code]
BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.h [code]
BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.cpp [code]
BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.h [code]
BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.cpp [code]
BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.h [code]
BarcodeScanner/cppwinrt/SymbologyListEntry.cpp [code]
BarcodeScanner/cppwinrt/SymbologyListEntry.h [code]
BarcodeScanner/cs/SampleConfiguration.cs [code]
BarcodeScanner/cs/Scenario1_BasicFunctionality.xaml.cs [code]
BarcodeScanner/cs/Scenario2_MultipleScanners.xaml.cs [code]
BarcodeScanner/cs/Scenario3_ActiveSymbologies.xaml.cs [code]
BarcodeScanner/cs/Scenario4_SymbologyAttributes.xaml.cs [code]
BarcodeScanner/cs/Scenario5_DisplayingBarcodePreview.xaml.cs [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.cpp [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.h [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.cpp [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.h [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/pch.cpp [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/pch.h [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.cpp [code]
BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.h [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/pch.cpp [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/pch.h [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.cpp [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.cpp [code]
BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.h [code]
BarcodeScannerProvider/cs/BarcodeDecoder/BarcodeDecoder.cs [code]
BarcodeScannerProvider/cs/BarcodeDecoder/DecodeEngine.cs [code]
BarcodeScannerProvider/cs/BarcodeDecoder/Provider.cs [code]
BarcodeScannerProvider/cs/BarcodeDecoder/Properties/AssemblyInfo.cs [code]
BarcodeScannerProvider/cs/BarcodeScannerProvider/SampleConfiguration.cs [code]
BarcodeScannerProvider/cs/BarcodeScannerProvider/Scenario1_Configuration.xaml.cs [code]
Barometer/cpp/pch.cpp [code]
Barometer/cpp/pch.h [code]
Barometer/cpp/SampleConfiguration.cpp [code]
Barometer/cpp/SampleConfiguration.h [code]
Barometer/cpp/Scenario1_DataEvents.xaml.cpp [code]
Barometer/cpp/Scenario1_DataEvents.xaml.h [code]
Barometer/cpp/Scenario2_Polling.xaml.cpp [code]
Barometer/cpp/Scenario2_Polling.xaml.h [code]
Barometer/cs/SampleConfiguration.cs [code]
Barometer/cs/Scenario1_DataEvents.xaml.cs [code]
Barometer/cs/Scenario2_Polling.xaml.cs [code]
BasicFaceDetection/cppwinrt/pch.cpp [code]
BasicFaceDetection/cppwinrt/pch.h [code]
BasicFaceDetection/cppwinrt/Project.idl [code]
BasicFaceDetection/cppwinrt/SampleConfiguration.cpp [code]
BasicFaceDetection/cppwinrt/SampleConfiguration.h [code]
BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.cpp [code]
BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.h [code]
BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.cpp [code]
BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.h [code]
BasicFaceDetection/cs/SampleConfiguration.cs [code]
BasicFaceDetection/cs/Scenario1_DetectInPhoto.xaml.cs [code]
BasicFaceDetection/cs/Scenario2_DetectInWebcam.xaml.cs [code]
BasicFaceTracking/cppwinrt/pch.cpp [code]
BasicFaceTracking/cppwinrt/pch.h [code]
BasicFaceTracking/cppwinrt/Project.idl [code]
BasicFaceTracking/cppwinrt/SampleConfiguration.cpp [code]
BasicFaceTracking/cppwinrt/SampleConfiguration.h [code]
BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.cpp [code]
BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.h [code]
BasicFaceTracking/cs/SampleConfiguration.cs [code]
BasicFaceTracking/cs/Scenario1_TrackInWebcam.xaml.cs [code]
BasicHologram/cpp/AppView.cpp [code]
BasicHologram/cpp/AppView.h [code]
BasicHologram/cpp/BasicHologramMain.cpp [code]
BasicHologram/cpp/BasicHologramMain.h [code]
BasicHologram/cpp/pch.cpp [code]
BasicHologram/cpp/pch.h [code]
BasicHologram/cpp/Common/CameraResources.cpp [code]
BasicHologram/cpp/Common/CameraResources.h [code]
BasicHologram/cpp/Common/DeviceResources.cpp [code]
BasicHologram/cpp/Common/DeviceResources.h [code]
BasicHologram/cpp/Common/DirectXHelper.h [code]
BasicHologram/cpp/Common/StepTimer.h [code]
BasicHologram/cpp/Content/ShaderStructures.h [code]
BasicHologram/cpp/Content/SpatialInputHandler.cpp [code]
BasicHologram/cpp/Content/SpatialInputHandler.h [code]
BasicHologram/cpp/Content/SpinningCubeRenderer.cpp [code]
BasicHologram/cpp/Content/SpinningCubeRenderer.h [code]
BasicHologram/cppwinrt/AppView.cpp [code]
BasicHologram/cppwinrt/AppView.h [code]
BasicHologram/cppwinrt/BasicHologramMain.cpp [code]
BasicHologram/cppwinrt/BasicHologramMain.h [code]
BasicHologram/cppwinrt/pch.cpp [code]
BasicHologram/cppwinrt/pch.h [code]
BasicHologram/cppwinrt/Common/CameraResources.cpp [code]
BasicHologram/cppwinrt/Common/CameraResources.h [code]
BasicHologram/cppwinrt/Common/DeviceResources.cpp [code]
BasicHologram/cppwinrt/Common/DeviceResources.h [code]
BasicHologram/cppwinrt/Common/DirectXHelper.h [code]
BasicHologram/cppwinrt/Common/StepTimer.h [code]
BasicHologram/cppwinrt/Content/ShaderStructures.h [code]
BasicHologram/cppwinrt/Content/SpatialInputHandler.cpp [code]
BasicHologram/cppwinrt/Content/SpatialInputHandler.h [code]
BasicHologram/cppwinrt/Content/SpinningCubeRenderer.cpp [code]
BasicHologram/cppwinrt/Content/SpinningCubeRenderer.h [code]
BasicHologram/cs/AppView.cs [code]
BasicHologram/cs/AppViewSource.cs [code]
BasicHologram/cs/BasicHologramMain.cs [code]
BasicHologram/cs/FxCompile.cs [code]
BasicHologram/cs/Program.cs [code]
BasicHologram/cs/Common/CameraResources.cs [code]
BasicHologram/cs/Common/DeviceResources.cs [code]
BasicHologram/cs/Common/DirectXHelper.cs [code]
BasicHologram/cs/Common/Disposer.cs [code]
BasicHologram/cs/Common/InteropStatics.cs [code]
BasicHologram/cs/Common/StepTimer.cs [code]
BasicHologram/cs/Content/ShaderStructures.cs [code]
BasicHologram/cs/Content/SpatialInputHandler.cs [code]
BasicHologram/cs/Content/SpinningCubeRenderer.cs [code]
BasicInput/cpp/1-InputEvents.xaml.cpp [code]
BasicInput/cpp/1-InputEvents.xaml.h [code]
BasicInput/cpp/2-PointerPointProperties.xaml.cpp [code]
BasicInput/cpp/2-PointerPointProperties.xaml.h [code]
BasicInput/cpp/3-DeviceCapabilities.xaml.cpp [code]
BasicInput/cpp/3-DeviceCapabilities.xaml.h [code]
BasicInput/cpp/4-XAMLManipulations.xaml.cpp [code]
BasicInput/cpp/4-XAMLManipulations.xaml.h [code]
BasicInput/cpp/5-GestureRecognizer.xaml.cpp [code]
BasicInput/cpp/5-GestureRecognizer.xaml.h [code]
BasicInput/cpp/pch.cpp [code]
BasicInput/cpp/pch.h [code]
BasicInput/cpp/SampleConfiguration.cpp [code]
BasicInput/cpp/SampleConfiguration.h [code]
BasicInput/cs/1-InputEvents.xaml.cs [code]
BasicInput/cs/2-PointerPointProperties.xaml.cs [code]
BasicInput/cs/3-DeviceCapabilities.xaml.cs [code]
BasicInput/cs/4-XAMLManipulations.xaml.cs [code]
BasicInput/cs/5-GestureRecognizer.xaml.cs [code]
BasicInput/cs/SampleConfiguration.cs [code]
BasicMediaCasting/cs/SampleConfiguration.cs [code]
BasicMediaCasting/cs/Scenario1_BuiltInCasting.xaml.cs [code]
BasicMediaCasting/cs/Scenario2_CastingDevicePicker.xaml.cs [code]
BasicMediaCasting/cs/Scenario3_CustomPicker.xaml.cs [code]
BasicSuspension/cs/App.xaml.cs [code]
BasicSuspension/cs/MainPage.xaml.cs [code]
BasicSuspension/cs/SubPage.xaml.cs [code]
BasicSuspension/cs/Common/NavigationHelper.cs [code]
BasicSuspension/cs/Common/SuspensionManager.cs [code]
BluetoothAdvertisement/cs/SampleConfiguration.cs [code]
BluetoothAdvertisement/cs/Scenario1_Watcher.xaml.cs [code]
BluetoothAdvertisement/cs/Scenario2_Publisher.xaml.cs [code]
BluetoothAdvertisement/cs/Scenario3_BackgroundWatcher.xaml.cs [code]
BluetoothAdvertisement/cs/Scenario4_BackgroundPublisher.xaml.cs [code]
BluetoothAdvertisement/cs/Tasks/AdvertisementBackgroundTasks.cs [code]
BluetoothAdvertisement/cs/Tasks/Properties/AssemblyInfo.cs [code]
BluetoothLE/cppwinrt/BluetoothLEAttributeDisplay.cpp [code]
BluetoothLE/cppwinrt/BluetoothLEAttributeDisplay.h [code]
BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.cpp [code]
BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.h [code]
BluetoothLE/cppwinrt/pch.cpp [code]
BluetoothLE/cppwinrt/pch.h [code]
BluetoothLE/cppwinrt/PresentationFormats.h [code]
BluetoothLE/cppwinrt/Project.idl [code]
BluetoothLE/cppwinrt/SampleConfiguration.cpp [code]
BluetoothLE/cppwinrt/SampleConfiguration.h [code]
BluetoothLE/cppwinrt/Scenario1_Discovery.cpp [code]
BluetoothLE/cppwinrt/Scenario1_Discovery.h [code]
BluetoothLE/cppwinrt/Scenario2_Client.cpp [code]
BluetoothLE/cppwinrt/Scenario2_Client.h [code]
BluetoothLE/cppwinrt/Scenario3_ServerForeground.cpp [code]
BluetoothLE/cppwinrt/Scenario3_ServerForeground.h [code]
BluetoothLE/cs/Constants.cs [code]
BluetoothLE/cs/DispatcherTaskExtensions.cs [code]
BluetoothLE/cs/DisplayHelpers.cs [code]
BluetoothLE/cs/PresentationFormats.cs [code]
BluetoothLE/cs/SampleConfiguration.cs [code]
BluetoothLE/cs/Scenario1_Discovery.xaml.cs [code]
BluetoothLE/cs/Scenario2_Client.xaml.cs [code]
BluetoothLE/cs/Scenario3_ServerForeground.xaml.cs [code]
BluetoothRfcommChat/cs/SampleConfiguration.cs [code]
BluetoothRfcommChat/cs/Scenario1_ChatClient.xaml.cs [code]
BluetoothRfcommChat/cs/Scenario2_ChatServer.xaml.cs [code]
BluetoothRfcommChat/cs/Scenario3_BgChatServer.xaml.cs [code]
BluetoothRfcommChat/cs/Tasks/RfcommServerTask.cs [code]
BluetoothRfcommChat/cs/Tasks/Properties/AssemblyInfo.cs [code]
Calendar/cpp/pch.cpp [code]
Calendar/cpp/pch.h [code]
Calendar/cpp/SampleConfiguration.cpp [code]
Calendar/cpp/SampleConfiguration.h [code]
Calendar/cpp/Scenario1_Data.xaml.cpp [code]
Calendar/cpp/Scenario1_Data.xaml.h [code]
Calendar/cpp/Scenario2_Stats.xaml.cpp [code]
Calendar/cpp/Scenario2_Stats.xaml.h [code]
Calendar/cpp/Scenario3_Enum.xaml.cpp [code]
Calendar/cpp/Scenario3_Enum.xaml.h [code]
Calendar/cpp/Scenario4_UnicodeExtensions.xaml.cpp [code]
Calendar/cpp/Scenario4_UnicodeExtensions.xaml.h [code]
Calendar/cpp/Scenario5_TimeZone.xaml.cpp [code]
Calendar/cpp/Scenario5_TimeZone.xaml.h [code]
Calendar/cppwinrt/pch.cpp [code]
Calendar/cppwinrt/pch.h [code]
Calendar/cppwinrt/Project.idl [code]
Calendar/cppwinrt/SampleConfiguration.cpp [code]
Calendar/cppwinrt/SampleConfiguration.h [code]
Calendar/cppwinrt/Scenario1_Data.cpp [code]
Calendar/cppwinrt/Scenario1_Data.h [code]
Calendar/cppwinrt/Scenario2_Stats.cpp [code]
Calendar/cppwinrt/Scenario2_Stats.h [code]
Calendar/cppwinrt/Scenario3_Enum.cpp [code]
Calendar/cppwinrt/Scenario3_Enum.h [code]
Calendar/cppwinrt/Scenario4_UnicodeExtensions.cpp [code]
Calendar/cppwinrt/Scenario4_UnicodeExtensions.h [code]
Calendar/cppwinrt/Scenario5_TimeZone.cpp [code]
Calendar/cppwinrt/Scenario5_TimeZone.h [code]
Calendar/cs/SampleConfiguration.cs [code]
Calendar/cs/Scenario1_Data.xaml.cs [code]
Calendar/cs/Scenario2_Stats.xaml.cs [code]
Calendar/cs/Scenario3_Enum.xaml.cs [code]
Calendar/cs/Scenario4_UnicodeExtensions.xaml.cs [code]
Calendar/cs/Scenario5_TimeZone.xaml.cs [code]
CameraAdvancedCapture/cpp/App.xaml.cpp [code]
CameraAdvancedCapture/cpp/App.xaml.h [code]
CameraAdvancedCapture/cpp/MainPage.xaml.cpp [code]
CameraAdvancedCapture/cpp/MainPage.xaml.h [code]
CameraAdvancedCapture/cpp/pch.cpp [code]
CameraAdvancedCapture/cpp/pch.h [code]
CameraAdvancedCapture/cs/App.xaml.cs [code]
CameraAdvancedCapture/cs/MainPage.xaml.cs [code]
CameraFaceDetection/cpp/App.xaml.cpp [code]
CameraFaceDetection/cpp/App.xaml.h [code]
CameraFaceDetection/cpp/MainPage.xaml.cpp [code]
CameraFaceDetection/cpp/MainPage.xaml.h [code]
CameraFaceDetection/cpp/pch.cpp [code]
CameraFaceDetection/cpp/pch.h [code]
CameraFaceDetection/cs/App.xaml.cs [code]
CameraFaceDetection/cs/MainPage.xaml.cs [code]
CameraFrames/cpp/FrameRenderer.cpp [code]
CameraFrames/cpp/FrameRenderer.h [code]
CameraFrames/cpp/FrameSourceViewModels.cpp [code]
CameraFrames/cpp/FrameSourceViewModels.h [code]
CameraFrames/cpp/LookupTable.h [code]
CameraFrames/cpp/pch.cpp [code]
CameraFrames/cpp/pch.h [code]
CameraFrames/cpp/SampleConfiguration.cpp [code]
CameraFrames/cpp/SampleConfiguration.h [code]
CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.cpp [code]
CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.h [code]
CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.cpp [code]
CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.h [code]
CameraFrames/cpp/SimpleLogger.h [code]
CameraFrames/cs/FrameSourceViewModels.cs [code]
CameraFrames/cs/SampleConfiguration.cs [code]
CameraFrames/cs/Scenario1_DisplayDepthColorIR.xaml.cs [code]
CameraFrames/cs/Scenario2_FindAvailableSourceGroups.xaml.cs [code]
CameraFrames/cs/SimpleLogger.cs [code]
CameraGetPreviewFrame/cpp/App.xaml.cpp [code]
CameraGetPreviewFrame/cpp/App.xaml.h [code]
CameraGetPreviewFrame/cpp/MainPage.xaml.cpp [code]
CameraGetPreviewFrame/cpp/MainPage.xaml.h [code]
CameraGetPreviewFrame/cpp/pch.cpp [code]
CameraGetPreviewFrame/cpp/pch.h [code]
CameraGetPreviewFrame/cs/App.xaml.cs [code]
CameraGetPreviewFrame/cs/MainPage.xaml.cs [code]
CameraManualControls/cs/App.xaml.cs [code]
CameraManualControls/cs/MainPage.ExposureValue.xaml.cs [code]
CameraManualControls/cs/MainPage.Flash.xaml.cs [code]
CameraManualControls/cs/MainPage.Focus.xaml.cs [code]
CameraManualControls/cs/MainPage.IsoSpeed.xaml.cs [code]
CameraManualControls/cs/MainPage.Shutter.xaml.cs [code]
CameraManualControls/cs/MainPage.WhiteBalance.xaml.cs [code]
CameraManualControls/cs/MainPage.xaml.cs [code]
CameraManualControls/cs/MainPage.Zoom.xaml.cs [code]
CameraOpenCV/cs/SampleConfiguration.cs [code]
CameraOpenCV/cs/Scenario1_ExampleOperations.xaml.cs [code]
CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.cpp [code]
CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.h [code]
CameraOpenCV/shared/OpenCVBridge/pch.cpp [code]
CameraOpenCV/shared/OpenCVBridge/pch.h [code]
CameraProfile/cpp/pch.cpp [code]
CameraProfile/cpp/pch.h [code]
CameraProfile/cpp/SampleConfiguration.cpp [code]
CameraProfile/cpp/SampleConfiguration.h [code]
CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.cpp [code]
CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.h [code]
CameraProfile/cpp/Scenario2_ConcurrentProfile.xaml.cpp [code]
CameraProfile/cpp/Scenario2_ConcurrentProfile.xaml.h [code]
CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.cpp [code]
CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.h [code]
CameraProfile/cs/SampleConfiguration.cs [code]
CameraProfile/cs/Scenario1_SetRecordProfile.xaml.cs [code]
CameraProfile/cs/Scenario2_ConcurrentProfile.xaml.cs [code]
CameraProfile/cs/Scenario3_EnableHdrProfile.xaml.cs [code]
CameraResolution/cpp/pch.cpp [code]
CameraResolution/cpp/pch.h [code]
CameraResolution/cpp/SampleConfiguration.cpp [code]
CameraResolution/cpp/SampleConfiguration.h [code]
CameraResolution/cpp/Scenario1_PreviewSettings.xaml.cpp [code]
CameraResolution/cpp/Scenario1_PreviewSettings.xaml.h [code]
CameraResolution/cpp/Scenario2_PhotoSettings.xaml.cpp [code]
CameraResolution/cpp/Scenario2_PhotoSettings.xaml.h [code]
CameraResolution/cpp/Scenario3_AspectRatio.xaml.cpp [code]
CameraResolution/cpp/Scenario3_AspectRatio.xaml.h [code]
CameraResolution/cpp/StreamResolutionHelper.cpp [code]
CameraResolution/cpp/StreamResolutionHelper.h [code]
CameraResolution/cs/SampleConfiguration.cs [code]
CameraResolution/cs/Scenario1_PreviewSettings.xaml.cs [code]
CameraResolution/cs/Scenario2_PhotoSettings.xaml.cs [code]
CameraResolution/cs/Scenario3_AspectRatio.xaml.cs [code]
CameraResolution/cs/StreamResolution.cs [code]
CameraStarterKit/cpp/App.xaml.cpp [code]
CameraStarterKit/cpp/App.xaml.h [code]
CameraStarterKit/cpp/CameraRotationHelper.cpp [code]
CameraStarterKit/cpp/CameraRotationHelper.h [code]
CameraStarterKit/cpp/MainPage.xaml.cpp [code]
CameraStarterKit/cpp/MainPage.xaml.h [code]
CameraStarterKit/cpp/pch.cpp [code]
CameraStarterKit/cpp/pch.h [code]
CameraStarterKit/cs/App.xaml.cs [code]
CameraStarterKit/cs/CameraRotationHelper.cs [code]
CameraStarterKit/cs/MainPage.xaml.cs [code]
CameraStreamCoordinateMapper/cpp/App.cpp [code]
CameraStreamCoordinateMapper/cpp/App.h [code]
CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.cpp [code]
CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.h [code]
CameraStreamCoordinateMapper/cpp/pch.cpp [code]
CameraStreamCoordinateMapper/cpp/pch.h [code]
CameraStreamCoordinateMapper/cpp/Common/DeviceResources.cpp [code]
CameraStreamCoordinateMapper/cpp/Common/DeviceResources.h [code]
CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.cpp [code]
CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.h [code]
CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.cpp [code]
CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.h [code]
CameraStreamCoordinateMapper/cpp/Common/StepTimer.h [code]
CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.cpp [code]
CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.h [code]
CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.cpp [code]
CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.h [code]
CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.cpp [code]
CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h [code]
CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.cpp [code]
CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.h [code]
CameraStreamCoordinateMapper/cpp/Content/ShaderStructures.h [code]
CameraStreamCoordinateMapper/cpp/Content/TextRenderer.cpp [code]
CameraStreamCoordinateMapper/cpp/Content/TextRenderer.h [code]
CameraStreamCorrelation/cpp/FrameRenderer.cpp [code]
CameraStreamCorrelation/cpp/FrameRenderer.h [code]
CameraStreamCorrelation/cpp/pch.cpp [code]
CameraStreamCorrelation/cpp/pch.h [code]
CameraStreamCorrelation/cpp/SampleConfiguration.cpp [code]
CameraStreamCorrelation/cpp/SampleConfiguration.h [code]
CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.cpp [code]
CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.h [code]
CameraStreamCorrelation/cpp/SimpleLogger.h [code]
CameraStreamCorrelation/cpp/SkeletalFrameRenderer.cpp [code]
CameraStreamCorrelation/cpp/SkeletalFrameRenderer.h [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/BufferHelper.h [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/MFPoseTrackingFrame.h [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.cpp [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.h [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.cpp [code]
CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.h [code]
CameraVideoStabilization/cpp/App.xaml.cpp [code]
CameraVideoStabilization/cpp/App.xaml.h [code]
CameraVideoStabilization/cpp/MainPage.xaml.cpp [code]
CameraVideoStabilization/cpp/MainPage.xaml.h [code]
CameraVideoStabilization/cpp/pch.cpp [code]
CameraVideoStabilization/cpp/pch.h [code]
CameraVideoStabilization/cs/App.xaml.cs [code]
CameraVideoStabilization/cs/MainPage.xaml.cs [code]
Capabilities/cppwinrt/pch.cpp [code]
Capabilities/cppwinrt/pch.h [code]
Capabilities/cppwinrt/Project.idl [code]
Capabilities/cppwinrt/SampleConfiguration.cpp [code]
Capabilities/cppwinrt/SampleConfiguration.h [code]
Capabilities/cppwinrt/Scenario1_Check.cpp [code]
Capabilities/cppwinrt/Scenario1_Check.h [code]
Capabilities/cppwinrt/Scenario2_RequestMany.cpp [code]
Capabilities/cppwinrt/Scenario2_RequestMany.h [code]
Capabilities/cs/SampleConfiguration.cs [code]
Capabilities/cs/Scenario1_Check.xaml.cs [code]
Capabilities/cs/Scenario2_RequestMany.xaml.cs [code]
CashDrawer/cpp/pch.cpp [code]
CashDrawer/cpp/pch.h [code]
CashDrawer/cpp/SampleConfiguration.cpp [code]
CashDrawer/cpp/SampleConfiguration.h [code]
CashDrawer/cpp/Scenario1_OpenDrawer.xaml.cpp [code]
CashDrawer/cpp/Scenario1_OpenDrawer.xaml.h [code]
CashDrawer/cpp/Scenario2_CloseDrawer.xaml.cpp [code]
CashDrawer/cpp/Scenario2_CloseDrawer.xaml.h [code]
CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.cpp [code]
CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.h [code]
CashDrawer/cs/SampleConfiguration.cs [code]
CashDrawer/cs/Scenario1_OpenDrawer.xaml.cs [code]
CashDrawer/cs/Scenario2_CloseDrawer.xaml.cs [code]
CashDrawer/cs/Scenario3_MultipleDrawers.xaml.cs [code]
ClientDeviceInformation/cpp/pch.cpp [code]
ClientDeviceInformation/cpp/pch.h [code]
ClientDeviceInformation/cpp/SampleConfiguration.cpp [code]
ClientDeviceInformation/cpp/SampleConfiguration.h [code]
ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.cpp [code]
ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.h [code]
ClientDeviceInformation/cs/SampleConfiguration.cs [code]
ClientDeviceInformation/cs/Scenario1_GetDeviceInformation.xaml.cs [code]
Clipboard/cppwinrt/CopyFiles.cpp [code]
Clipboard/cppwinrt/CopyFiles.h [code]
Clipboard/cppwinrt/CopyImage.cpp [code]
Clipboard/cppwinrt/CopyImage.h [code]
Clipboard/cppwinrt/CopyText.cpp [code]
Clipboard/cppwinrt/CopyText.h [code]
Clipboard/cppwinrt/HistoryAndRoaming.cpp [code]
Clipboard/cppwinrt/HistoryAndRoaming.h [code]
Clipboard/cppwinrt/OtherScenarios.cpp [code]
Clipboard/cppwinrt/OtherScenarios.h [code]
Clipboard/cppwinrt/pch.cpp [code]
Clipboard/cppwinrt/pch.h [code]
Clipboard/cppwinrt/Project.idl [code]
Clipboard/cppwinrt/SampleConfiguration.cpp [code]
Clipboard/cppwinrt/SampleConfiguration.h [code]
Clipboard/cs/CopyFiles.xaml.cs [code]
Clipboard/cs/CopyImage.xaml.cs [code]
Clipboard/cs/CopyText.xaml.cs [code]
Clipboard/cs/HistoryAndRoaming.xaml.cs [code]
Clipboard/cs/OtherScenarios.xaml.cs [code]
Clipboard/cs/SampleConfiguration.cs [code]
Compass/cpp/CalibrationBar.xaml.cpp [code]
Compass/cpp/CalibrationBar.xaml.h [code]
Compass/cpp/pch.cpp [code]
Compass/cpp/pch.h [code]
Compass/cpp/SampleConfiguration.cpp [code]
Compass/cpp/SampleConfiguration.h [code]
Compass/cpp/Scenario1_DataEvents.xaml.cpp [code]
Compass/cpp/Scenario1_DataEvents.xaml.h [code]
Compass/cpp/Scenario2_Polling.xaml.cpp [code]
Compass/cpp/Scenario2_Polling.xaml.h [code]
Compass/cpp/Scenario3_Calibration.xaml.cpp [code]
Compass/cpp/Scenario3_Calibration.xaml.h [code]
Compass/cs/CalibrationBar.xaml.cs [code]
Compass/cs/SampleConfiguration.cs [code]
Compass/cs/Scenario1_DataEvents.xaml.cs [code]
Compass/cs/Scenario2_Polling.xaml.cs [code]
Compass/cs/Scenario3_Calibration.xaml.cs [code]
ComplexInk/cpp/pch.cpp [code]
ComplexInk/cpp/pch.h [code]
ComplexInk/cpp/SampleConfiguration.cpp [code]
ComplexInk/cpp/SampleConfiguration.h [code]
ComplexInk/cpp/Scenario1_CustomDry.xaml.cpp [code]
ComplexInk/cpp/Scenario1_CustomDry.xaml.h [code]
ComplexInk/cpp/Common/DeviceResources.cpp [code]
ComplexInk/cpp/Common/DeviceResources.h [code]
ComplexInk/cpp/Common/DirectXHelper.h [code]
ComplexInk/cpp/Common/InkEventLogger.cpp [code]
ComplexInk/cpp/Common/InkEventLogger.h [code]
ComplexInk/cpp/Common/Resources.h [code]
ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.cpp [code]
ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.h [code]
ComplexInk/cpp/Renderers/InkRenderer.cpp [code]
ComplexInk/cpp/Renderers/InkRenderer.h [code]
ComplexInk/cpp/Renderers/SceneComposer.cpp [code]
ComplexInk/cpp/Renderers/SceneComposer.h [code]
ComplexInk/cpp/Renderers/ShapeRenderer.cpp [code]
ComplexInk/cpp/Renderers/ShapeRenderer.h [code]
CompositionVisual/cpp/pch.cpp [code]
CompositionVisual/cpp/pch.h [code]
CompositionVisual/cpp/VisualProperties.cpp [code]
CompositionVisual/cpp/VisualProperties.h [code]
CompositionVisual/cs/VisualProperties.cs [code]
Compression/cpp/CompressionUtils.cpp [code]
Compression/cpp/CompressionUtils.h [code]
Compression/cpp/pch.cpp [code]
Compression/cpp/pch.h [code]
Compression/cpp/SampleConfiguration.cpp [code]
Compression/cpp/SampleConfiguration.h [code]
Compression/cpp/Scenario1.xaml.cpp [code]
Compression/cpp/Scenario1.xaml.h [code]
Compression/cpp/Scenario2.xaml.cpp [code]
Compression/cpp/Scenario2.xaml.h [code]
Compression/cpp/Scenario3.xaml.cpp [code]
Compression/cpp/Scenario3.xaml.h [code]
Compression/cs/SampleConfiguration.cs [code]
Compression/cs/Scenario1.xaml.cs [code]
ContactCardIntegration/cs/SampleConfiguration.cs [code]
ContactCardIntegration/cs/Scenario1_CreateContacts.xaml.cs [code]
ContactCardIntegration/cs/Scenario2_ReceiveContact.xaml.cs [code]
ContactCards/cpp/pch.cpp [code]
ContactCards/cpp/pch.h [code]
ContactCards/cpp/SampleConfiguration.cpp [code]
ContactCards/cpp/SampleConfiguration.h [code]
ContactCards/cpp/Scenario1_Mini.xaml.cpp [code]
ContactCards/cpp/Scenario1_Mini.xaml.h [code]
ContactCards/cpp/Scenario2_DelayMini.xaml.cpp [code]
ContactCards/cpp/Scenario2_DelayMini.xaml.h [code]
ContactCards/cpp/Scenario3_Full.xaml.cpp [code]
ContactCards/cpp/Scenario3_Full.xaml.h [code]
ContactCards/cs/SampleConfiguration.cs [code]
ContactCards/cs/Scenario1_Mini.xaml.cs [code]
ContactCards/cs/Scenario2_DelayMini.xaml.cs [code]
ContactCards/cs/Scenario3_Full.xaml.cs [code]
ContactPanel/cs/AppContactPanel.xaml.cs [code]
ContactPanel/cs/SampleConfiguration.cs [code]
ContactPanel/cs/Scenario1_CreateContact.xaml.cs [code]
ContactPicker/cpp/pch.cpp [code]
ContactPicker/cpp/pch.h [code]
ContactPicker/cpp/SampleConfiguration.cpp [code]
ContactPicker/cpp/SampleConfiguration.h [code]
ContactPicker/cpp/Scenario1_Single.xaml.cpp [code]
ContactPicker/cpp/Scenario1_Single.xaml.h [code]
ContactPicker/cpp/Scenario2_Multiple.xaml.cpp [code]
ContactPicker/cpp/Scenario2_Multiple.xaml.h [code]
ContactPicker/cs/SampleConfiguration.cs [code]
ContactPicker/cs/Scenario1_Single.xaml.cs [code]
ContactPicker/cs/Scenario2_Multiple.xaml.cs [code]
ContentIndexer/cpp/Helpers.h [code]
ContentIndexer/cpp/pch.cpp [code]
ContentIndexer/cpp/pch.h [code]
ContentIndexer/cpp/S1_AddWithAPI.xaml.cpp [code]
ContentIndexer/cpp/S1_AddWithAPI.xaml.h [code]
ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.cpp [code]
ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.h [code]
ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.cpp [code]
ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.h [code]
ContentIndexer/cpp/S4_CheckIndexRevision.xaml.cpp [code]
ContentIndexer/cpp/S4_CheckIndexRevision.xaml.h [code]
ContentIndexer/cpp/S5_AddWithAppContent.xaml.cpp [code]
ContentIndexer/cpp/S5_AddWithAppContent.xaml.h [code]
ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.cpp [code]
ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.h [code]
ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.cpp [code]
ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.h [code]
ContentIndexer/cpp/SampleConfiguration.cpp [code]
ContentIndexer/cpp/SampleConfiguration.h [code]
ContentIndexer/cs/Helpers.cs [code]
ContentIndexer/cs/S1_AddWithAPI.xaml.cs [code]
ContentIndexer/cs/S2_UpdateAndDeleteWithAPI.xaml.cs [code]
ContentIndexer/cs/S3_RetrieveWithAPI.xaml.cs [code]
ContentIndexer/cs/S4_CheckIndexRevision.xaml.cs [code]
ContentIndexer/cs/S5_AddWithAppContent.xaml.cs [code]
ContentIndexer/cs/S6_DeleteWithAppContent.xaml.cs [code]
ContentIndexer/cs/S7_RetrieveWithAppContent.xaml.cs [code]
ContentIndexer/cs/SampleConfiguration.cs [code]
ContextMenu/cpp/pch.cpp [code]
ContextMenu/cpp/pch.h [code]
ContextMenu/cpp/SampleConfiguration.cpp [code]
ContextMenu/cpp/SampleConfiguration.h [code]
ContextMenu/cpp/Scenario1.xaml.cpp [code]
ContextMenu/cpp/Scenario1.xaml.h [code]
ContextMenu/cpp/Scenario2.xaml.cpp [code]
ContextMenu/cpp/Scenario2.xaml.h [code]
ContextMenu/cs/SampleConfiguration.cs [code]
ContextMenu/cs/Scenario1.xaml.cs [code]
ContextMenu/cs/Scenario2.xaml.cs [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.h [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/Trip.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/Trip.h [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/pch.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/pch.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/BoolToVisibilityConverter.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/BoolToVisibilityConverter.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/RelayCommand.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/Common/RelayCommand.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripListViewModel.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripListViewModel.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.h [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelLocator.cpp [code]
CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelLocator.h [code]
CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.cpp [code]
CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.h [code]
CortanaVoiceCommand/cpp/VoiceCommandService/pch.cpp [code]
CortanaVoiceCommand/cpp/VoiceCommandService/pch.h [code]
CortanaVoiceCommand/cs/AdventureWorks.shared/Model/Trip.cs [code]
CortanaVoiceCommand/cs/AdventureWorks.shared/Model/TripStore.cs [code]
CortanaVoiceCommand/cs/AdventureWorks.shared/Properties/AssemblyInfo.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/App.xaml.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/DateTimeOffsetConverter.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/INavigationService.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationService.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/RelayCommand.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/SuspensionManager.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/Common/VisibilityConverter.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/View/TripDetails.xaml.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/View/TripListView.xaml.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripListViewModel.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripViewModel.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripVoiceCommand.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelBase.cs [code]
CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelLocator.cs [code]
CortanaVoiceCommand/cs/VoiceCommandService/AdventureWorksVoiceCommandService.cs [code]
CortanaVoiceCommand/cs/VoiceCommandService/Properties/AssemblyInfo.cs [code]
CredentialPicker/cpp/pch.cpp [code]
CredentialPicker/cpp/pch.h [code]
CredentialPicker/cpp/SampleConfiguration.cpp [code]
CredentialPicker/cpp/SampleConfiguration.h [code]
CredentialPicker/cpp/Scenario1_Message.xaml.cpp [code]
CredentialPicker/cpp/Scenario1_Message.xaml.h [code]
CredentialPicker/cpp/Scenario2_MessageCaption.xaml.cpp [code]
CredentialPicker/cpp/Scenario2_MessageCaption.xaml.h [code]
CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.cpp [code]
CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.h [code]
CredentialPicker/cs/SampleConfiguration.cs [code]
CredentialPicker/cs/Scenario1_Message.xaml.cs [code]
CredentialPicker/cs/Scenario2_MessageCaption.xaml.cs [code]
CredentialPicker/cs/Scenario3_CredentialPickerOptions.xaml.cs [code]
CustomCapability/cpp/DeviceList.cpp [code]
CustomCapability/cpp/DeviceList.h [code]
CustomCapability/cpp/Fx2Driver.cpp [code]
CustomCapability/cpp/Fx2Driver.h [code]
CustomCapability/cpp/pch.cpp [code]
CustomCapability/cpp/pch.h [code]
CustomCapability/cpp/SampleConfiguration.cpp [code]
CustomCapability/cpp/SampleConfiguration.h [code]
CustomCapability/cpp/Scenario1_MeteringData.xaml.cpp [code]
CustomCapability/cpp/Scenario1_MeteringData.xaml.h [code]
CustomCapability/cpp/Scenario2_DeviceConnect.xaml.cpp [code]
CustomCapability/cpp/Scenario2_DeviceConnect.xaml.h [code]
CustomCapability/cpp/Scenario3_DeviceIO.xaml.cpp [code]
CustomCapability/cpp/Scenario3_DeviceIO.xaml.h [code]
CustomCapability/cpp/Scenario4_DeviceEvents.xaml.cpp [code]
CustomCapability/cpp/Scenario4_DeviceEvents.xaml.h [code]
CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.cpp [code]
CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.h [code]
CustomCapability/cpp/Scenario6_CustomTrigger.xaml.cpp [code]
CustomCapability/cpp/Scenario6_CustomTrigger.xaml.h [code]
CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.cpp [code]
CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.h [code]
CustomCapability/cpp/ServiceViewModel.cpp [code]
CustomCapability/cpp/ServiceViewModel.h [code]
CustomCapability/cs/DeviceList.cs [code]
CustomCapability/cs/Fx2Driver.cs [code]
CustomCapability/cs/SampleConfiguration.cs [code]
CustomCapability/cs/Scenario1_MeteringData.xaml.cs [code]
CustomCapability/cs/Scenario2_DeviceConnect.xaml.cs [code]
CustomCapability/cs/Scenario3_DeviceIO.xaml.cs [code]
CustomCapability/cs/Scenario4_DeviceEvents.xaml.cs [code]
CustomCapability/cs/Scenario5_DeviceReadWrite.xaml.cs [code]
CustomCapability/cs/Scenario6_CustomTrigger.xaml.cs [code]
CustomCapability/cs/Scenario7_FirmwareAccess.xaml.cs [code]
CustomCapability/cs/ServiceViewModel.cs [code]
CustomCapability/Service/Client/FirmwareAccess.h [code]
CustomCapability/Service/Client/pch.cpp [code]
CustomCapability/Service/Client/pch.h [code]
CustomCapability/Service/Client/RpcClient.cpp [code]
CustomCapability/Service/Client/RpcClient.h [code]
CustomCapability/Service/Client/RpcClientApi.cpp [code]
CustomCapability/Service/Client/RpcClientApi.h [code]
CustomCapability/Service/Client/smbios.cpp [code]
CustomCapability/Service/Client/targetver.h [code]
CustomCapability/Service/Client/uefi.cpp [code]
CustomCapability/Service/Interface/RpcInterface.Idl [code]
CustomCapability/Service/Osrusbfx2Task/ConnectedTask.cs [code]
CustomCapability/Service/Server/HsaService.cpp [code]
CustomCapability/Service/Server/Metering.cpp [code]
CustomCapability/Service/Server/Metering.h [code]
CustomCapability/Service/Server/RpcServer.cpp [code]
CustomCapability/Service/Server/RpcServer.h [code]
CustomCapability/Service/Server/SampleService.cpp [code]
CustomCapability/Service/Server/SampleService.h [code]
CustomCapability/Service/Server/ServiceBase.cpp [code]
CustomCapability/Service/Server/ServiceBase.h [code]
CustomCapability/Service/Server/ServiceInstaller.cpp [code]
CustomCapability/Service/Server/ServiceInstaller.h [code]
CustomCapability/Service/Server/stdafx.cpp [code]
CustomCapability/Service/Server/stdafx.h [code]
CustomCapability/Service/Server/targetver.h [code]
CustomEditControl/cs/CustomEditControl.xaml.cs [code]
CustomEditControl/cs/SampleConfiguration.cs [code]
CustomEditControl/cs/Scenario1_Input.xaml.cs [code]
CustomHidDeviceAccess/cpp/DeviceListEntry.cpp [code]
CustomHidDeviceAccess/cpp/DeviceListEntry.h [code]
CustomHidDeviceAccess/cpp/EventHandlerForDevice.cpp [code]
CustomHidDeviceAccess/cpp/EventHandlerForDevice.h [code]
CustomHidDeviceAccess/cpp/pch.cpp [code]
CustomHidDeviceAccess/cpp/pch.h [code]
CustomHidDeviceAccess/cpp/SampleConfiguration.cpp [code]
CustomHidDeviceAccess/cpp/SampleConfiguration.h [code]
CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.cpp [code]
CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.h [code]
CustomHidDeviceAccess/cpp/Scenario2_FeatureReports.xaml.cpp [code]
CustomHidDeviceAccess/cpp/Scenario2_FeatureReports.xaml.h [code]
CustomHidDeviceAccess/cpp/Scenario3_InputReportEvents.xaml.cpp [code]
CustomHidDeviceAccess/cpp/Scenario3_InputReportEvents.xaml.h [code]
CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.cpp [code]
CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.h [code]
CustomHidDeviceAccess/cpp/Utilities.cpp [code]
CustomHidDeviceAccess/cpp/Utilities.h [code]
CustomHidDeviceAccess/cs/DeviceListEntry.cs [code]
CustomHidDeviceAccess/cs/EventHandlerForDevice.cs [code]
CustomHidDeviceAccess/cs/SampleConfiguration.cs [code]
CustomHidDeviceAccess/cs/Scenario1_DeviceConnect.xaml.cs [code]
CustomHidDeviceAccess/cs/Scenario2_FeatureReports.xaml.cs [code]
CustomHidDeviceAccess/cs/Scenario3_InputReportEvents.xaml.cs [code]
CustomHidDeviceAccess/cs/Scenario4_InputOutputReports.xaml.cs [code]
CustomHidDeviceAccess/cs/Utilities.cs [code]
CustomSensors/cpp/pch.cpp [code]
CustomSensors/cpp/pch.h [code]
CustomSensors/cpp/SampleConfiguration.cpp [code]
CustomSensors/cpp/SampleConfiguration.h [code]
CustomSensors/cpp/Scenario1_DataEvents.xaml.cpp [code]
CustomSensors/cpp/Scenario1_DataEvents.xaml.h [code]
CustomSensors/cpp/Scenario2_Polling.xaml.cpp [code]
CustomSensors/cpp/Scenario2_Polling.xaml.h [code]
CustomSensors/cs/SampleConfiguration.cs [code]
CustomSensors/cs/Scenario1_DataEvents.xaml.cs [code]
CustomSensors/cs/Scenario2_Polling.xaml.cs [code]
CustomSerialDeviceAccess/cs/Constants.cs [code]
CustomSerialDeviceAccess/cs/DeviceListEntry.cs [code]
CustomSerialDeviceAccess/cs/EventHandlerForDevice.cs [code]
CustomSerialDeviceAccess/cs/SampleConfiguration.cs [code]
CustomSerialDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs [code]
CustomSerialDeviceAccess/cs/Scenario2_ConfigureDevice.xaml.cs [code]
CustomSerialDeviceAccess/cs/Scenario3_ReadWrite.xaml.cs [code]
CustomSerialDeviceAccess/cs/Scenario4_Events.xaml.cs [code]
CustomSerialDeviceAccess/cs/Utilities.cs [code]
CustomUsbDeviceAccess/cs/DeviceListEntry.cs [code]
CustomUsbDeviceAccess/cs/EventHandlerForDevice.cs [code]
CustomUsbDeviceAccess/cs/SampleConfiguration.cs [code]
CustomUsbDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario2_ControlTransfer.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario3_InterruptPipes.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario4_BulkPipes.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario5_UsbDescriptors.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario6_InterfaceSettings.xaml.cs [code]
CustomUsbDeviceAccess/cs/Scenario7_SyncDevice.xaml.cs [code]
CustomUsbDeviceAccess/cs/Utilities.cs [code]
CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs [code]
CustomUsbDeviceAccess/cs/BackgroundTask/IoSyncBackgroundTask.cs [code]
CustomUsbDeviceAccess/cs/BackgroundTask/Properties/AssemblyInfo.cs [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/App.xaml.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/App.xaml.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXHelper.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/RenderOptions.h [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.cpp [code]
D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.h [code]
D2DCustomEffects/cpp/ComputeShader/App.cpp [code]
D2DCustomEffects/cpp/ComputeShader/App.h [code]
D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.cpp [code]
D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.h [code]
D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.cpp [code]
D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.h [code]
D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.cpp [code]
D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.h [code]
D2DCustomEffects/cpp/ComputeShader/DeviceResources.cpp [code]
D2DCustomEffects/cpp/ComputeShader/DeviceResources.h [code]
D2DCustomEffects/cpp/ComputeShader/DftEffect.cpp [code]
D2DCustomEffects/cpp/ComputeShader/DftEffect.h [code]
D2DCustomEffects/cpp/ComputeShader/DftTransform.cpp [code]
D2DCustomEffects/cpp/ComputeShader/DftTransform.h [code]
D2DCustomEffects/cpp/ComputeShader/DirectXHelper.h [code]
D2DCustomEffects/cpp/ComputeShader/pch.cpp [code]
D2DCustomEffects/cpp/ComputeShader/pch.h [code]
D2DCustomEffects/cpp/ComputeShader/SampleOverlay.cpp [code]
D2DCustomEffects/cpp/ComputeShader/SampleOverlay.h [code]
D2DCustomEffects/cpp/PixelShader/App.cpp [code]
D2DCustomEffects/cpp/PixelShader/App.h [code]
D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.cpp [code]
D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.h [code]
D2DCustomEffects/cpp/PixelShader/BasicTimer.cpp [code]
D2DCustomEffects/cpp/PixelShader/BasicTimer.h [code]
D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.cpp [code]
D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.h [code]
D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.cpp [code]
D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.h [code]
D2DCustomEffects/cpp/PixelShader/DeviceResources.cpp [code]
D2DCustomEffects/cpp/PixelShader/DeviceResources.h [code]
D2DCustomEffects/cpp/PixelShader/DirectXHelper.h [code]
D2DCustomEffects/cpp/PixelShader/pch.cpp [code]
D2DCustomEffects/cpp/PixelShader/pch.h [code]
D2DCustomEffects/cpp/PixelShader/RippleEffect.cpp [code]
D2DCustomEffects/cpp/PixelShader/RippleEffect.h [code]
D2DCustomEffects/cpp/PixelShader/SampleOverlay.cpp [code]
D2DCustomEffects/cpp/PixelShader/SampleOverlay.h [code]
D2DCustomEffects/cpp/VertexShader/App.cpp [code]
D2DCustomEffects/cpp/VertexShader/App.h [code]
D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.cpp [code]
D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.h [code]
D2DCustomEffects/cpp/VertexShader/BasicTimer.cpp [code]
D2DCustomEffects/cpp/VertexShader/BasicTimer.h [code]
D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.cpp [code]
D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.h [code]
D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.cpp [code]
D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.h [code]
D2DCustomEffects/cpp/VertexShader/DeviceResources.cpp [code]
D2DCustomEffects/cpp/VertexShader/DeviceResources.h [code]
D2DCustomEffects/cpp/VertexShader/DirectXHelper.h [code]
D2DCustomEffects/cpp/VertexShader/pch.cpp [code]
D2DCustomEffects/cpp/VertexShader/pch.h [code]
D2DCustomEffects/cpp/VertexShader/SampleOverlay.cpp [code]
D2DCustomEffects/cpp/VertexShader/SampleOverlay.h [code]
D2DCustomEffects/cpp/VertexShader/WaveEffect.cpp [code]
D2DCustomEffects/cpp/VertexShader/WaveEffect.h [code]
D2DGradientMesh/cpp/App.cpp [code]
D2DGradientMesh/cpp/App.h [code]
D2DGradientMesh/cpp/D2DGradientMeshMain.cpp [code]
D2DGradientMesh/cpp/D2DGradientMeshMain.h [code]
D2DGradientMesh/cpp/D2DGradientMeshRenderer.cpp [code]
D2DGradientMesh/cpp/D2DGradientMeshRenderer.h [code]
D2DGradientMesh/cpp/DeviceResources.cpp [code]
D2DGradientMesh/cpp/DeviceResources.h [code]
D2DGradientMesh/cpp/DirectXHelper.h [code]
D2DGradientMesh/cpp/pch.cpp [code]
D2DGradientMesh/cpp/pch.h [code]
D2DGradientMesh/cpp/SampleOverlay.cpp [code]
D2DGradientMesh/cpp/SampleOverlay.h [code]
D2DPhotoAdjustment/cpp/App.xaml.cpp [code]
D2DPhotoAdjustment/cpp/App.xaml.h [code]
D2DPhotoAdjustment/cpp/DirectXPage.xaml.cpp [code]
D2DPhotoAdjustment/cpp/DirectXPage.xaml.h [code]
D2DPhotoAdjustment/cpp/pch.cpp [code]
D2DPhotoAdjustment/cpp/pch.h [code]
D2DPhotoAdjustment/cpp/PhotoAdjustmentProperties.h [code]
D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.cpp [code]
D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.h [code]
D2DPhotoAdjustment/cpp/Common/DeviceResources.cpp [code]
D2DPhotoAdjustment/cpp/Common/DeviceResources.h [code]
D2DPhotoAdjustment/cpp/Common/DirectXHelper.h [code]
D2DSvgImage/cpp/App.xaml.cpp [code]
D2DSvgImage/cpp/App.xaml.h [code]
D2DSvgImage/cpp/D2DSvgImageRenderer.cpp [code]
D2DSvgImage/cpp/D2DSvgImageRenderer.h [code]
D2DSvgImage/cpp/DirectXPage.xaml.cpp [code]
D2DSvgImage/cpp/DirectXPage.xaml.h [code]
D2DSvgImage/cpp/pch.cpp [code]
D2DSvgImage/cpp/pch.h [code]
D2DSvgImage/cpp/Common/DeviceResources.cpp [code]
D2DSvgImage/cpp/Common/DeviceResources.h [code]
D2DSvgImage/cpp/Common/DirectXHelper.h [code]
DatagramSocket/cpp/pch.cpp [code]
DatagramSocket/cpp/pch.h [code]
DatagramSocket/cpp/SampleConfiguration.cpp [code]
DatagramSocket/cpp/SampleConfiguration.h [code]
DatagramSocket/cpp/Scenario1.xaml.cpp [code]
DatagramSocket/cpp/Scenario1.xaml.h [code]
DatagramSocket/cpp/Scenario2.xaml.cpp [code]
DatagramSocket/cpp/Scenario2.xaml.h [code]
DatagramSocket/cpp/Scenario3.xaml.cpp [code]
DatagramSocket/cpp/Scenario3.xaml.h [code]
DatagramSocket/cpp/Scenario4.xaml.cpp [code]
DatagramSocket/cpp/Scenario4.xaml.h [code]
DatagramSocket/cpp/Scenario5.xaml.cpp [code]
DatagramSocket/cpp/Scenario5.xaml.h [code]
DatagramSocket/cs/SampleConfiguration.cs [code]
DatagramSocket/cs/Scenario1_Start.xaml.cs [code]
DatagramSocket/cs/Scenario2_Connect.xaml.cs [code]
DatagramSocket/cs/Scenario3_Send.xaml.cs [code]
DatagramSocket/cs/Scenario4_Close.xaml.cs [code]
DatagramSocket/cs/Scenario5_MulticastAndBroadcast.xaml.cs [code]
DataReaderWriter/cpp/pch.cpp [code]
DataReaderWriter/cpp/pch.h [code]
DataReaderWriter/cpp/SampleConfiguration.cpp [code]
DataReaderWriter/cpp/SampleConfiguration.h [code]
DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.cpp [code]
DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.h [code]
DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.cpp [code]
DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.h [code]
DataReaderWriter/cs/SampleConfiguration.cs [code]
DataReaderWriter/cs/Scenario1_WriteReadStream.xaml.cs [code]
DataReaderWriter/cs/Scenario2_ReadBytes.xaml.cs [code]
DateTimeFormatting/cpp/pch.cpp [code]
DateTimeFormatting/cpp/pch.h [code]
DateTimeFormatting/cpp/SampleConfiguration.cpp [code]
DateTimeFormatting/cpp/SampleConfiguration.h [code]
DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.h [code]
DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.h [code]
DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.h [code]
DateTimeFormatting/cpp/Scenario4_Override.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario4_Override.xaml.h [code]
DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.h [code]
DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.cpp [code]
DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.h [code]
DateTimeFormatting/cppwinrt/pch.cpp [code]
DateTimeFormatting/cppwinrt/pch.h [code]
DateTimeFormatting/cppwinrt/Project.idl [code]
DateTimeFormatting/cppwinrt/SampleConfiguration.cpp [code]
DateTimeFormatting/cppwinrt/SampleConfiguration.h [code]
DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.cpp [code]
DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.h [code]
DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.cpp [code]
DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.h [code]
DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.cpp [code]
DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.h [code]
DateTimeFormatting/cppwinrt/Scenario4_Override.cpp [code]
DateTimeFormatting/cppwinrt/Scenario4_Override.h [code]
DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.cpp [code]
DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.h [code]
DateTimeFormatting/cppwinrt/Scenario6_TimeZone.cpp [code]
DateTimeFormatting/cppwinrt/Scenario6_TimeZone.h [code]
DateTimeFormatting/cs/SampleConfiguration.cs [code]
DateTimeFormatting/cs/Scenario1_LongAndShortFormats.xaml.cs [code]
DateTimeFormatting/cs/Scenario2_StringTemplate.xaml.cs [code]
DateTimeFormatting/cs/Scenario3_ParameterizedTemplate.xaml.cs [code]
DateTimeFormatting/cs/Scenario4_Override.xaml.cs [code]
DateTimeFormatting/cs/Scenario5_UnicodeExtensions.xaml.cs [code]
DateTimeFormatting/cs/Scenario6_TimeZone.xaml.cs [code]
DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.cpp [code]
DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.h [code]
DeviceEnumerationAndPairing/cpp/DisplayHelpers.cpp [code]
DeviceEnumerationAndPairing/cpp/DisplayHelpers.h [code]
DeviceEnumerationAndPairing/cpp/pch.cpp [code]
DeviceEnumerationAndPairing/cpp/pch.h [code]
DeviceEnumerationAndPairing/cpp/SampleConfiguration.cpp [code]
DeviceEnumerationAndPairing/cpp/SampleConfiguration.h [code]
DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.cpp [code]
DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.h [code]
DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.cpp [code]
DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.h [code]
DeviceEnumerationAndPairing/cpp/Tasks/pch.cpp [code]
DeviceEnumerationAndPairing/cpp/Tasks/pch.h [code]
DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h [code]
DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.h [code]
DeviceEnumerationAndPairing/cppwinrt/pch.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/pch.h [code]
DeviceEnumerationAndPairing/cppwinrt/Project.idl [code]
DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.h [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.h [code]
DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.h [code]
DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.idl [code]
DeviceEnumerationAndPairing/cppwinrt/Tasks/pch.cpp [code]
DeviceEnumerationAndPairing/cppwinrt/Tasks/pch.h [code]
DeviceEnumerationAndPairing/cs/DeviceWatcherHelper.cs [code]
DeviceEnumerationAndPairing/cs/DisplayHelpers.cs [code]
DeviceEnumerationAndPairing/cs/SampleConfiguration.cs [code]
DeviceEnumerationAndPairing/cs/Scenario1_DevicePicker.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario2_DeviceWatcher.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario3_BackgroundDeviceWatcher.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario4_Snapshot.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario5_GetSingleDevice.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario6_CustomFilterAddedProps.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario7_DeviceInformationKind.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario8_PairDevice.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs [code]
DeviceEnumerationAndPairing/cs/Tasks/BackgroundDeviceWatcher.cs [code]
DeviceEnumerationAndPairing/cs/Tasks/Properties/AssemblyInfo.cs [code]
DisablingScreenCapture/cpp/pch.cpp [code]
DisablingScreenCapture/cpp/pch.h [code]
DisablingScreenCapture/cpp/SampleConfiguration.cpp [code]
DisablingScreenCapture/cpp/SampleConfiguration.h [code]
DisablingScreenCapture/cpp/Scenario1_Enable.xaml.cpp [code]
DisablingScreenCapture/cpp/Scenario1_Enable.xaml.h [code]
DisablingScreenCapture/cpp/Scenario2_Disable.xaml.cpp [code]
DisablingScreenCapture/cpp/Scenario2_Disable.xaml.h [code]
DisablingScreenCapture/cppwinrt/pch.cpp [code]
DisablingScreenCapture/cppwinrt/pch.h [code]
DisablingScreenCapture/cppwinrt/Project.idl [code]
DisablingScreenCapture/cppwinrt/SampleConfiguration.cpp [code]
DisablingScreenCapture/cppwinrt/SampleConfiguration.h [code]
DisablingScreenCapture/cppwinrt/Scenario1_Enable.cpp [code]
DisablingScreenCapture/cppwinrt/Scenario1_Enable.h [code]
DisablingScreenCapture/cppwinrt/Scenario2_Disable.cpp [code]
DisablingScreenCapture/cppwinrt/Scenario2_Disable.h [code]
DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.cpp [code]
DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.h [code]
DisablingScreenCapture/cs/SampleConfiguration.cs [code]
DisablingScreenCapture/cs/Scenario1_Enable.xaml.cs [code]
DisablingScreenCapture/cs/Scenario2_Disable.xaml.cs [code]
DisablingScreenCapture/cs/Scenario3_AppCapture.xaml.cs [code]
DisplayOrientation/cpp/pch.cpp [code]
DisplayOrientation/cpp/pch.h [code]
DisplayOrientation/cpp/SampleConfiguration.cpp [code]
DisplayOrientation/cpp/SampleConfiguration.h [code]
DisplayOrientation/cpp/Scenario1_Orientation.xaml.cpp [code]
DisplayOrientation/cpp/Scenario1_Orientation.xaml.h [code]
DisplayOrientation/cppwinrt/pch.cpp [code]
DisplayOrientation/cppwinrt/pch.h [code]
DisplayOrientation/cppwinrt/Project.idl [code]
DisplayOrientation/cppwinrt/SampleConfiguration.cpp [code]
DisplayOrientation/cppwinrt/SampleConfiguration.h [code]
DisplayOrientation/cppwinrt/Scenario1_Orientation.cpp [code]
DisplayOrientation/cppwinrt/Scenario1_Orientation.h [code]
DisplayOrientation/cs/SampleConfiguration.cs [code]
DisplayOrientation/cs/Scenario1_Orientation.xaml.cs [code]
DpiScaling/cpp/pch.cpp [code]
DpiScaling/cpp/pch.h [code]
DpiScaling/cpp/SampleConfiguration.cpp [code]
DpiScaling/cpp/SampleConfiguration.h [code]
DpiScaling/cpp/Scenario1.xaml.cpp [code]
DpiScaling/cpp/Scenario1.xaml.h [code]
DpiScaling/cpp/Scenario2.xaml.cpp [code]
DpiScaling/cpp/Scenario2.xaml.h [code]
DpiScaling/cs/SampleConfiguration.cs [code]
DpiScaling/cs/Scenario1.xaml.cs [code]
DpiScaling/cs/Scenario2.xaml.cs [code]
DWriteColorGlyph/cpp/App.cpp [code]
DWriteColorGlyph/cpp/App.h [code]
DWriteColorGlyph/cpp/CustomTextRenderer.cpp [code]
DWriteColorGlyph/cpp/CustomTextRenderer.h [code]
DWriteColorGlyph/cpp/DeviceResources.cpp [code]
DWriteColorGlyph/cpp/DeviceResources.h [code]
DWriteColorGlyph/cpp/DirectXHelper.h [code]
DWriteColorGlyph/cpp/DWriteColorTextRendererMain.cpp [code]
DWriteColorGlyph/cpp/DWriteColorTextRendererMain.h [code]
DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.cpp [code]
DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.h [code]
DWriteColorGlyph/cpp/pch.cpp [code]
DWriteColorGlyph/cpp/pch.h [code]
DWriteColorGlyph/cpp/SampleOverlay.cpp [code]
DWriteColorGlyph/cpp/SampleOverlay.h [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/pch.cpp [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/pch.h [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.cpp [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.h [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.cpp [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.h [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario2_UniformSpacing.xaml.cpp [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario2_UniformSpacing.xaml.h [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario3_ProportionalSpacing.xaml.cpp [code]
DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario3_ProportionalSpacing.xaml.h [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/DirectXHelper.h [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/pch.cpp [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/pch.h [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayout.cpp [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayout.h [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.cpp [code]
DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/pch.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/pch.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/DirectXHelper.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/pch.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/pch.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.h [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.cpp [code]
DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.h [code]
EnterpriseDataProtection/cs/SampleConfiguration.cs [code]
EnterpriseDataProtection/cs/Scenario10_CpToClipboard.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario11_CPDNoUI.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario12_ShareData.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario13_ShareTarget.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario14_QueryCpPaste.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario15_DPLFileCreateEvents.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario16_NetworkResource.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario1_Setup.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario2_IdManaged.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario3_UIPolicy.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario4_FilePMgr.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario5_Revoke.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario6_ProtectBuffer.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario7_ProtectStream.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario8_ClipboardSource.xaml.cs [code]
EnterpriseDataProtection/cs/Scenario9_ClipboardTarget.xaml.cs [code]
EnterpriseDataProtection/cs/Tasks/EdpBackgroundTask.cs [code]
EnterpriseDataProtection/cs/Tasks/Properties/AssemblyInfo.cs [code]
ExtendedExecution/cpp/pch.cpp [code]
ExtendedExecution/cpp/pch.h [code]
ExtendedExecution/cpp/SampleConfiguration.cpp [code]
ExtendedExecution/cpp/SampleConfiguration.h [code]
ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.cpp [code]
ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.h [code]
ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.cpp [code]
ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.h [code]
ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.cpp [code]
ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.h [code]
ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.cpp [code]
ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.h [code]
ExtendedExecution/cs/SampleConfiguration.cs [code]
ExtendedExecution/cs/Scenario1_UnspecifiedReason.xaml.cs [code]
ExtendedExecution/cs/Scenario2_SavingDataReason.xaml.cs [code]
ExtendedExecution/cs/Scenario3_LocationTrackingReason.xaml.cs [code]
ExtendedExecution/cs/Scenario4_MultipleTasks.xaml.cs [code]
FileAccess/cpp/pch.cpp [code]
FileAccess/cpp/pch.h [code]
FileAccess/cpp/SampleConfiguration.cpp [code]
FileAccess/cpp/SampleConfiguration.h [code]
FileAccess/cpp/Scenario10_Delete.xaml.cpp [code]
FileAccess/cpp/Scenario10_Delete.xaml.h [code]
FileAccess/cpp/Scenario11_TryGet.xaml.cpp [code]
FileAccess/cpp/Scenario11_TryGet.xaml.h [code]
FileAccess/cpp/Scenario1_Create.xaml.cpp [code]
FileAccess/cpp/Scenario1_Create.xaml.h [code]
FileAccess/cpp/Scenario2_GetParent.xaml.cpp [code]
FileAccess/cpp/Scenario2_GetParent.xaml.h [code]
FileAccess/cpp/Scenario3_Text.xaml.cpp [code]
FileAccess/cpp/Scenario3_Text.xaml.h [code]
FileAccess/cpp/Scenario4_Bytes.xaml.cpp [code]
FileAccess/cpp/Scenario4_Bytes.xaml.h [code]
FileAccess/cpp/Scenario5_Stream.xaml.cpp [code]
FileAccess/cpp/Scenario5_Stream.xaml.h [code]
FileAccess/cpp/Scenario6_Properties.xaml.cpp [code]
FileAccess/cpp/Scenario6_Properties.xaml.h [code]
FileAccess/cpp/Scenario7_FutureAccess.xaml.cpp [code]
FileAccess/cpp/Scenario7_FutureAccess.xaml.h [code]
FileAccess/cpp/Scenario8_Copy.xaml.cpp [code]
FileAccess/cpp/Scenario8_Copy.xaml.h [code]
FileAccess/cpp/Scenario9_Compare.xaml.cpp [code]
FileAccess/cpp/Scenario9_Compare.xaml.h [code]
FileAccess/cppwinrt/pch.cpp [code]
FileAccess/cppwinrt/pch.h [code]
FileAccess/cppwinrt/Project.idl [code]
FileAccess/cppwinrt/SampleConfiguration.cpp [code]
FileAccess/cppwinrt/SampleConfiguration.h [code]
FileAccess/cppwinrt/Scenario1.cpp [code]
FileAccess/cppwinrt/Scenario1.h [code]
FileAccess/cppwinrt/Scenario10.cpp [code]
FileAccess/cppwinrt/Scenario10.h [code]
FileAccess/cppwinrt/Scenario11.cpp [code]
FileAccess/cppwinrt/Scenario11.h [code]
FileAccess/cppwinrt/Scenario2.cpp [code]
FileAccess/cppwinrt/Scenario2.h [code]
FileAccess/cppwinrt/Scenario3.cpp [code]
FileAccess/cppwinrt/Scenario3.h [code]
FileAccess/cppwinrt/Scenario4.cpp [code]
FileAccess/cppwinrt/Scenario4.h [code]
FileAccess/cppwinrt/Scenario5.cpp [code]
FileAccess/cppwinrt/Scenario5.h [code]
FileAccess/cppwinrt/Scenario6.cpp [code]
FileAccess/cppwinrt/Scenario6.h [code]
FileAccess/cppwinrt/Scenario7.cpp [code]
FileAccess/cppwinrt/Scenario7.h [code]
FileAccess/cppwinrt/Scenario8.cpp [code]
FileAccess/cppwinrt/Scenario8.h [code]
FileAccess/cppwinrt/Scenario9.cpp [code]
FileAccess/cppwinrt/Scenario9.h [code]
FileAccess/cs/SampleConfiguration.cs [code]
FileAccess/cs/Scenario10_Delete.xaml.cs [code]
FileAccess/cs/Scenario11_TryGet.xaml.cs [code]
FileAccess/cs/Scenario1_Create.xaml.cs [code]
FileAccess/cs/Scenario2_GetParent.xaml.cs [code]
FileAccess/cs/Scenario3_Text.xaml.cs [code]
FileAccess/cs/Scenario4_Bytes.xaml.cs [code]
FileAccess/cs/Scenario5_Stream.xaml.cs [code]
FileAccess/cs/Scenario6_Properties.xaml.cs [code]
FileAccess/cs/Scenario7_FutureAccess.xaml.cs [code]
FileAccess/cs/Scenario8_Copy.xaml.cs [code]
FileAccess/cs/Scenario9_Compare.xaml.cs [code]
FilePicker/cpp/pch.cpp [code]
FilePicker/cpp/pch.h [code]
FilePicker/cpp/SampleConfiguration.cpp [code]
FilePicker/cpp/SampleConfiguration.h [code]
FilePicker/cpp/Scenario1_SingleFile.xaml.cpp [code]
FilePicker/cpp/Scenario1_SingleFile.xaml.h [code]
FilePicker/cpp/Scenario2_MultiFile.xaml.cpp [code]
FilePicker/cpp/Scenario2_MultiFile.xaml.h [code]
FilePicker/cpp/Scenario3_SingleFolder.xaml.cpp [code]
FilePicker/cpp/Scenario3_SingleFolder.xaml.h [code]
FilePicker/cpp/Scenario4_SaveFile.xaml.cpp [code]
FilePicker/cpp/Scenario4_SaveFile.xaml.h [code]
FilePicker/cpp/Scenario5_TriggerCFU.xaml.cpp [code]
FilePicker/cpp/Scenario5_TriggerCFU.xaml.h [code]
FilePicker/cppwinrt/pch.cpp [code]
FilePicker/cppwinrt/pch.h [code]
FilePicker/cppwinrt/Project.idl [code]
FilePicker/cppwinrt/SampleConfiguration.cpp [code]
FilePicker/cppwinrt/SampleConfiguration.h [code]
FilePicker/cppwinrt/Scenario1_SingleFile.cpp [code]
FilePicker/cppwinrt/Scenario1_SingleFile.h [code]
FilePicker/cppwinrt/Scenario2_MultiFile.cpp [code]
FilePicker/cppwinrt/Scenario2_MultiFile.h [code]
FilePicker/cppwinrt/Scenario3_SingleFolder.cpp [code]
FilePicker/cppwinrt/Scenario3_SingleFolder.h [code]
FilePicker/cppwinrt/Scenario4_SaveFile.cpp [code]
FilePicker/cppwinrt/Scenario4_SaveFile.h [code]
FilePicker/cppwinrt/Scenario5_TriggerCFU.cpp [code]
FilePicker/cppwinrt/Scenario5_TriggerCFU.h [code]
FilePicker/cs/SampleConfiguration.cs [code]
FilePicker/cs/Scenario1_SingleFile.xaml.cs [code]
FilePicker/cs/Scenario2_MultiFile.xaml.cs [code]
FilePicker/cs/Scenario3_SingleFolder.xaml.cs [code]
FilePicker/cs/Scenario4_SaveFile.xaml.cs [code]
FilePicker/cs/Scenario5_TriggerCFU.xaml.cs [code]
FilePickerContracts/cs/App.xaml.cs [code]
FilePickerContracts/cs/App.xaml.custom.cs [code]
FilePickerContracts/cs/CachedFileUpdater_Local.xaml.cs [code]
FilePickerContracts/cs/CachedFileUpdater_Remote.xaml.cs [code]
FilePickerContracts/cs/CachedFileUpdaterPage.xaml.cs [code]
FilePickerContracts/cs/FileOpenPicker_PickAppFile.xaml.cs [code]
FilePickerContracts/cs/FileOpenPicker_PickCachedFile.xaml.cs [code]
FilePickerContracts/cs/FileOpenPicker_PickURLFile.xaml.cs [code]
FilePickerContracts/cs/FileOpenPickerPage.xaml.cs [code]
FilePickerContracts/cs/FileSavePicker_FailToSave.xaml.cs [code]
FilePickerContracts/cs/FileSavePicker_SaveToAppStorage.xaml.cs [code]
FilePickerContracts/cs/FileSavePicker_SaveToCachedFile.xaml.cs [code]
FilePickerContracts/cs/FileSavePickerPage.xaml.cs [code]
FilePickerContracts/cs/MainPage.xaml.cs [code]
FilePickerContracts/cs/MainPage_CachedFile.xaml.cs [code]
FilePickerContracts/cs/MainPage_PickFile.xaml.cs [code]
FilePickerContracts/cs/MainPage_SaveFile.xaml.cs [code]
FilePickerContracts/cs/SampleConfiguration.cs [code]
FilePickerContracts/cs/Tasks/UpdateFileTask.cs [code]
FileSearch/cpp/pch.cpp [code]
FileSearch/cpp/pch.h [code]
FileSearch/cpp/SampleConfiguration.cpp [code]
FileSearch/cpp/SampleConfiguration.h [code]
FileSearch/cpp/Scenario1.xaml.cpp [code]
FileSearch/cpp/Scenario1.xaml.h [code]
FileSearch/cppwinrt/pch.cpp [code]
FileSearch/cppwinrt/pch.h [code]
FileSearch/cppwinrt/Project.idl [code]
FileSearch/cppwinrt/SampleConfiguration.cpp [code]
FileSearch/cppwinrt/SampleConfiguration.h [code]
FileSearch/cppwinrt/Scenario1.cpp [code]
FileSearch/cppwinrt/Scenario1.h [code]
FileSearch/cs/SampleConfiguration.cs [code]
FileSearch/cs/Scenario1.xaml.cs [code]
FileThumbnails/cpp/pch.cpp [code]
FileThumbnails/cpp/pch.h [code]
FileThumbnails/cpp/SampleConfiguration.cpp [code]
FileThumbnails/cpp/SampleConfiguration.h [code]
FileThumbnails/cpp/Scenario1.xaml.cpp [code]
FileThumbnails/cpp/Scenario1.xaml.h [code]
FileThumbnails/cpp/Scenario2.xaml.cpp [code]
FileThumbnails/cpp/Scenario2.xaml.h [code]
FileThumbnails/cpp/Scenario3.xaml.cpp [code]
FileThumbnails/cpp/Scenario3.xaml.h [code]
FileThumbnails/cpp/Scenario4.xaml.cpp [code]
FileThumbnails/cpp/Scenario4.xaml.h [code]
FileThumbnails/cpp/Scenario5.xaml.cpp [code]
FileThumbnails/cpp/Scenario5.xaml.h [code]
FileThumbnails/cpp/Scenario6.xaml.cpp [code]
FileThumbnails/cpp/Scenario6.xaml.h [code]
FileThumbnails/cppwinrt/pch.cpp [code]
FileThumbnails/cppwinrt/pch.h [code]
FileThumbnails/cppwinrt/Project.idl [code]
FileThumbnails/cppwinrt/SampleConfiguration.cpp [code]
FileThumbnails/cppwinrt/SampleConfiguration.h [code]
FileThumbnails/cppwinrt/Scenario1.cpp [code]
FileThumbnails/cppwinrt/Scenario1.h [code]
FileThumbnails/cppwinrt/Scenario2.cpp [code]
FileThumbnails/cppwinrt/Scenario2.h [code]
FileThumbnails/cppwinrt/Scenario3.cpp [code]
FileThumbnails/cppwinrt/Scenario3.h [code]
FileThumbnails/cppwinrt/Scenario4.cpp [code]
FileThumbnails/cppwinrt/Scenario4.h [code]
FileThumbnails/cppwinrt/Scenario5.cpp [code]
FileThumbnails/cppwinrt/Scenario5.h [code]
FileThumbnails/cppwinrt/Scenario6.cpp [code]
FileThumbnails/cppwinrt/Scenario6.h [code]
FileThumbnails/cs/SampleConfiguration.cs [code]
FileThumbnails/cs/Scenario1.xaml.cs [code]
FileThumbnails/cs/Scenario2.xaml.cs [code]
FileThumbnails/cs/Scenario3.xaml.cs [code]
FileThumbnails/cs/Scenario4.xaml.cs [code]
FileThumbnails/cs/Scenario5.xaml.cs [code]
FileThumbnails/cs/Scenario6.xaml.cs [code]
FolderEnumeration/cpp/pch.cpp [code]
FolderEnumeration/cpp/pch.h [code]
FolderEnumeration/cpp/SampleConfiguration.cpp [code]
FolderEnumeration/cpp/SampleConfiguration.h [code]
FolderEnumeration/cpp/Scenario1.xaml.cpp [code]
FolderEnumeration/cpp/Scenario1.xaml.h [code]
FolderEnumeration/cpp/Scenario2.xaml.cpp [code]
FolderEnumeration/cpp/Scenario2.xaml.h [code]
FolderEnumeration/cpp/Scenario3.xaml.cpp [code]
FolderEnumeration/cpp/Scenario3.xaml.h [code]
FolderEnumeration/cpp/Scenario4.xaml.cpp [code]
FolderEnumeration/cpp/Scenario4.xaml.h [code]
FolderEnumeration/cppwinrt/pch.cpp [code]
FolderEnumeration/cppwinrt/pch.h [code]
FolderEnumeration/cppwinrt/Project.idl [code]
FolderEnumeration/cppwinrt/SampleConfiguration.cpp [code]
FolderEnumeration/cppwinrt/SampleConfiguration.h [code]
FolderEnumeration/cppwinrt/Scenario1.cpp [code]
FolderEnumeration/cppwinrt/Scenario1.h [code]
FolderEnumeration/cppwinrt/Scenario2.cpp [code]
FolderEnumeration/cppwinrt/Scenario2.h [code]
FolderEnumeration/cppwinrt/Scenario3.cpp [code]
FolderEnumeration/cppwinrt/Scenario3.h [code]
FolderEnumeration/cppwinrt/Scenario4.cpp [code]
FolderEnumeration/cppwinrt/Scenario4.h [code]
FolderEnumeration/cs/SampleConfiguration.cs [code]
FolderEnumeration/cs/Scenario1.xaml.cs [code]
FolderEnumeration/cs/Scenario2.xaml.cs [code]
FolderEnumeration/cs/Scenario3.xaml.cs [code]
FolderEnumeration/cs/Scenario4.xaml.cs [code]
FullScreenMode/cpp/pch.cpp [code]
FullScreenMode/cpp/pch.h [code]
FullScreenMode/cpp/SampleConfiguration.cpp [code]
FullScreenMode/cpp/SampleConfiguration.h [code]
FullScreenMode/cpp/Scenario1_Basic.xaml.cpp [code]
FullScreenMode/cpp/Scenario1_Basic.xaml.h [code]
FullScreenMode/cpp/Scenario2_Launch.xaml.cpp [code]
FullScreenMode/cpp/Scenario2_Launch.xaml.h [code]
FullScreenMode/cppwinrt/pch.cpp [code]
FullScreenMode/cppwinrt/pch.h [code]
FullScreenMode/cppwinrt/Project.idl [code]
FullScreenMode/cppwinrt/SampleConfiguration.cpp [code]
FullScreenMode/cppwinrt/SampleConfiguration.h [code]
FullScreenMode/cppwinrt/Scenario1_Basic.cpp [code]
FullScreenMode/cppwinrt/Scenario1_Basic.h [code]
FullScreenMode/cppwinrt/Scenario2_Launch.cpp [code]
FullScreenMode/cppwinrt/Scenario2_Launch.h [code]
FullScreenMode/cs/SampleConfiguration.cs [code]
FullScreenMode/cs/Scenario1_Basic.xaml.cs [code]
FullScreenMode/cs/Scenario2_Launch.xaml.cs [code]
Geolocation/cppwinrt/pch.cpp [code]
Geolocation/cppwinrt/pch.h [code]
Geolocation/cppwinrt/Project.idl [code]
Geolocation/cppwinrt/SampleConfiguration.cpp [code]
Geolocation/cppwinrt/SampleConfiguration.h [code]
Geolocation/cppwinrt/Scenario1_TrackPosition.cpp [code]
Geolocation/cppwinrt/Scenario1_TrackPosition.h [code]
Geolocation/cppwinrt/Scenario2_GetPosition.cpp [code]
Geolocation/cppwinrt/Scenario2_GetPosition.h [code]
Geolocation/cppwinrt/Scenario3_BackgroundTask.cpp [code]
Geolocation/cppwinrt/Scenario3_BackgroundTask.h [code]
Geolocation/cppwinrt/Scenario4_ForegroundGeofence.cpp [code]
Geolocation/cppwinrt/Scenario4_ForegroundGeofence.h [code]
Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.cpp [code]
Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.h [code]
Geolocation/cppwinrt/Scenario6_GetLastVisit.cpp [code]
Geolocation/cppwinrt/Scenario6_GetLastVisit.h [code]
Geolocation/cppwinrt/Scenario7_ForegroundVisits.cpp [code]
Geolocation/cppwinrt/Scenario7_ForegroundVisits.h [code]
Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.cpp [code]
Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.h [code]
Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.cpp [code]
Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.h [code]
Geolocation/cppwinrt/Tasks/Helpers.cpp [code]
Geolocation/cppwinrt/Tasks/Helpers.h [code]
Geolocation/cppwinrt/Tasks/LocationBackgroundTask.cpp [code]
Geolocation/cppwinrt/Tasks/LocationBackgroundTask.h [code]
Geolocation/cppwinrt/Tasks/pch.cpp [code]
Geolocation/cppwinrt/Tasks/pch.h [code]
Geolocation/cppwinrt/Tasks/Tasks.idl [code]
Geolocation/cppwinrt/Tasks/VisitBackgroundTask.cpp [code]
Geolocation/cppwinrt/Tasks/VisitBackgroundTask.h [code]
Geolocation/cs/SampleConfiguration.cs [code]
Geolocation/cs/Scenario1_TrackPosition.xaml.cs [code]
Geolocation/cs/Scenario2_GetPosition.xaml.cs [code]
Geolocation/cs/Scenario3_BackgroundTask.xaml.cs [code]
Geolocation/cs/Scenario4_ForegroundGeofence.xaml.cs [code]
Geolocation/cs/Scenario5_GeofenceBackgroundTask.xaml.cs [code]
Geolocation/cs/Scenario6_GetLastVisit.xaml.cs [code]
Geolocation/cs/Scenario7_ForegroundVisits.xaml.cs [code]
Geolocation/cs/Scenario8_VisitsBackgroundTask.xaml.cs [code]
Geolocation/cs/Tasks/GeofenceBackgroundTask.cs [code]
Geolocation/cs/Tasks/Helpers.cs [code]
Geolocation/cs/Tasks/LocationBackgroundTask.cs [code]
Geolocation/cs/Tasks/VisitBackgroundTask.cs [code]
Geolocation/cs/Tasks/Properties/AssemblyInfo.cs [code]
Geotag/cpp/pch.cpp [code]
Geotag/cpp/pch.h [code]
Geotag/cpp/SampleConfiguration.cpp [code]
Geotag/cpp/SampleConfiguration.h [code]
Geotag/cpp/Scenario1_Geotag.xaml.cpp [code]
Geotag/cpp/Scenario1_Geotag.xaml.h [code]
Geotag/cs/SampleConfiguration.cs [code]
Geotag/cs/Scenario1_Geotag.xaml.cs [code]
GlobalizationPreferences/cpp/pch.cpp [code]
GlobalizationPreferences/cpp/pch.h [code]
GlobalizationPreferences/cpp/SampleConfiguration.cpp [code]
GlobalizationPreferences/cpp/SampleConfiguration.h [code]
GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.cpp [code]
GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.h [code]
GlobalizationPreferences/cpp/Scenario2_Lang.xaml.cpp [code]
GlobalizationPreferences/cpp/Scenario2_Lang.xaml.h [code]
GlobalizationPreferences/cpp/Scenario3_Region.xaml.cpp [code]
GlobalizationPreferences/cpp/Scenario3_Region.xaml.h [code]
GlobalizationPreferences/cpp/Scenario4_Input.xaml.cpp [code]
GlobalizationPreferences/cpp/Scenario4_Input.xaml.h [code]
GlobalizationPreferences/cppwinrt/pch.cpp [code]
GlobalizationPreferences/cppwinrt/pch.h [code]
GlobalizationPreferences/cppwinrt/Project.idl [code]
GlobalizationPreferences/cppwinrt/SampleConfiguration.cpp [code]
GlobalizationPreferences/cppwinrt/SampleConfiguration.h [code]
GlobalizationPreferences/cppwinrt/Scenario1_Prefs.cpp [code]
GlobalizationPreferences/cppwinrt/Scenario1_Prefs.h [code]
GlobalizationPreferences/cppwinrt/Scenario2_Lang.cpp [code]
GlobalizationPreferences/cppwinrt/Scenario2_Lang.h [code]
GlobalizationPreferences/cppwinrt/Scenario3_Region.cpp [code]
GlobalizationPreferences/cppwinrt/Scenario3_Region.h [code]
GlobalizationPreferences/cppwinrt/Scenario4_Input.cpp [code]
GlobalizationPreferences/cppwinrt/Scenario4_Input.h [code]
GlobalizationPreferences/cs/SampleConfiguration.cs [code]
GlobalizationPreferences/cs/Scenario1_Prefs.xaml.cs [code]
GlobalizationPreferences/cs/Scenario2_Lang.xaml.cs [code]
GlobalizationPreferences/cs/Scenario3_Region.xaml.cs [code]
GlobalizationPreferences/cs/Scenario4_Input.xaml.cs [code]
Gyrometer/cpp/pch.cpp [code]
Gyrometer/cpp/pch.h [code]
Gyrometer/cpp/SampleConfiguration.cpp [code]
Gyrometer/cpp/SampleConfiguration.h [code]
Gyrometer/cpp/Scenario1_DataEvents.xaml.cpp [code]
Gyrometer/cpp/Scenario1_DataEvents.xaml.h [code]
Gyrometer/cpp/Scenario2_Polling.xaml.cpp [code]
Gyrometer/cpp/Scenario2_Polling.xaml.h [code]
Gyrometer/cpp/Scenario3_Porting.xaml.cpp [code]
Gyrometer/cpp/Scenario3_Porting.xaml.h [code]
Gyrometer/cs/SampleConfiguration.cs [code]
Gyrometer/cs/Scenario1_DataEvents.xaml.cs [code]
Gyrometer/cs/Scenario2_Polling.xaml.cs [code]
Gyrometer/cs/Scenario3_Porting.xaml.cs [code]
HolographicFaceTracking/cpp/AppView.cpp [code]
HolographicFaceTracking/cpp/AppView.h [code]
HolographicFaceTracking/cpp/HolographicFaceTrackerMain.cpp [code]
HolographicFaceTracking/cpp/HolographicFaceTrackerMain.h [code]
HolographicFaceTracking/cpp/pch.cpp [code]
HolographicFaceTracking/cpp/pch.h [code]
HolographicFaceTracking/cpp/Common/CameraResources.cpp [code]
HolographicFaceTracking/cpp/Common/CameraResources.h [code]
HolographicFaceTracking/cpp/Common/DeviceResources.cpp [code]
HolographicFaceTracking/cpp/Common/DeviceResources.h [code]
HolographicFaceTracking/cpp/Common/DirectXHelper.h [code]
HolographicFaceTracking/cpp/Common/StepTimer.h [code]
HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.cpp [code]
HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.h [code]
HolographicFaceTracking/cpp/Content/NV12VideoTexture.cpp [code]
HolographicFaceTracking/cpp/Content/NV12VideoTexture.h [code]
HolographicFaceTracking/cpp/Content/QuadRenderer.cpp [code]
HolographicFaceTracking/cpp/Content/QuadRenderer.h [code]
HolographicFaceTracking/cpp/Content/ShaderStructures.h [code]
HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.cpp [code]
HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.h [code]
HolographicFaceTracking/cpp/Content/TextRenderer.cpp [code]
HolographicFaceTracking/cpp/Content/TextRenderer.h [code]
HolographicFaceTracking/cpp/Content/VideoFrameProcessor.cpp [code]
HolographicFaceTracking/cpp/Content/VideoFrameProcessor.h [code]
HolographicMixedRealityCapture/cpp/AppView.cpp [code]
HolographicMixedRealityCapture/cpp/AppView.h [code]
HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.cpp [code]
HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.h [code]
HolographicMixedRealityCapture/cpp/MediaCaptureManager.cpp [code]
HolographicMixedRealityCapture/cpp/MediaCaptureManager.h [code]
HolographicMixedRealityCapture/cpp/pch.cpp [code]
HolographicMixedRealityCapture/cpp/pch.h [code]
HolographicMixedRealityCapture/cpp/Common/CameraResources.cpp [code]
HolographicMixedRealityCapture/cpp/Common/CameraResources.h [code]
HolographicMixedRealityCapture/cpp/Common/DeviceResources.cpp [code]
HolographicMixedRealityCapture/cpp/Common/DeviceResources.h [code]
HolographicMixedRealityCapture/cpp/Common/DirectXHelper.cpp [code]
HolographicMixedRealityCapture/cpp/Common/DirectXHelper.h [code]
HolographicMixedRealityCapture/cpp/Common/StepTimer.h [code]
HolographicMixedRealityCapture/cpp/Content/Button.cpp [code]
HolographicMixedRealityCapture/cpp/Content/Button.h [code]
HolographicMixedRealityCapture/cpp/Content/ControlBase.cpp [code]
HolographicMixedRealityCapture/cpp/Content/ControlBase.h [code]
HolographicMixedRealityCapture/cpp/Content/Cursor.cpp [code]
HolographicMixedRealityCapture/cpp/Content/Cursor.h [code]
HolographicMixedRealityCapture/cpp/Content/IControl.h [code]
HolographicMixedRealityCapture/cpp/Content/Panel.cpp [code]
HolographicMixedRealityCapture/cpp/Content/Panel.h [code]
HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h [code]
HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.cpp [code]
HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.h [code]
HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.cpp [code]
HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.h [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcAudioEffectDefinition.cpp [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcAudioEffectDefinition.h [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcVideoEffectDefinition.cpp [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcVideoEffectDefinition.h [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.cpp [code]
HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.h [code]
HolographicSpatialMapping/cpp/AppView.cpp [code]
HolographicSpatialMapping/cpp/AppView.h [code]
HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.cpp [code]
HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.h [code]
HolographicSpatialMapping/cpp/pch.cpp [code]
HolographicSpatialMapping/cpp/pch.h [code]
HolographicSpatialMapping/cpp/Common/CameraResources.cpp [code]
HolographicSpatialMapping/cpp/Common/CameraResources.h [code]
HolographicSpatialMapping/cpp/Common/DeviceResources.cpp [code]
HolographicSpatialMapping/cpp/Common/DeviceResources.h [code]
HolographicSpatialMapping/cpp/Common/DirectXHelper.h [code]
HolographicSpatialMapping/cpp/Common/StepTimer.h [code]
HolographicSpatialMapping/cpp/Content/GetDataFromIBuffer.h [code]
HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.cpp [code]
HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.h [code]
HolographicSpatialMapping/cpp/Content/ShaderStructures.h [code]
HolographicSpatialMapping/cpp/Content/SpatialInputHandler.cpp [code]
HolographicSpatialMapping/cpp/Content/SpatialInputHandler.h [code]
HolographicSpatialMapping/cpp/Content/SurfaceMesh.cpp [code]
HolographicSpatialMapping/cpp/Content/SurfaceMesh.h [code]
HolographicSpatialStage/cpp/AppView.cpp [code]
HolographicSpatialStage/cpp/AppView.h [code]
HolographicSpatialStage/cpp/HolographicSpatialStageMain.cpp [code]
HolographicSpatialStage/cpp/HolographicSpatialStageMain.h [code]
HolographicSpatialStage/cpp/pch.cpp [code]
HolographicSpatialStage/cpp/pch.h [code]
HolographicSpatialStage/cpp/SpatialStageManager.cpp [code]
HolographicSpatialStage/cpp/SpatialStageManager.h [code]
HolographicSpatialStage/cpp/Common/CameraResources.cpp [code]
HolographicSpatialStage/cpp/Common/CameraResources.h [code]
HolographicSpatialStage/cpp/Common/DeviceResources.cpp [code]
HolographicSpatialStage/cpp/Common/DeviceResources.h [code]
HolographicSpatialStage/cpp/Common/DirectXHelper.h [code]
HolographicSpatialStage/cpp/Common/StepTimer.h [code]
HolographicSpatialStage/cpp/Content/SceneController.cpp [code]
HolographicSpatialStage/cpp/Content/SceneController.h [code]
HolographicSpatialStage/cpp/Content/SceneObject.cpp [code]
HolographicSpatialStage/cpp/Content/SceneObject.h [code]
HolographicSpatialStage/cpp/Content/ShaderStructures.h [code]
HolographicTagAlong/cpp/AppView.cpp [code]
HolographicTagAlong/cpp/AppView.h [code]
HolographicTagAlong/cpp/HolographicTagAlongSampleMain.cpp [code]
HolographicTagAlong/cpp/HolographicTagAlongSampleMain.h [code]
HolographicTagAlong/cpp/pch.cpp [code]
HolographicTagAlong/cpp/pch.h [code]
HolographicTagAlong/cpp/Common/CameraResources.cpp [code]
HolographicTagAlong/cpp/Common/CameraResources.h [code]
HolographicTagAlong/cpp/Common/DeviceResources.cpp [code]
HolographicTagAlong/cpp/Common/DeviceResources.h [code]
HolographicTagAlong/cpp/Common/DirectXHelper.h [code]
HolographicTagAlong/cpp/Common/StepTimer.h [code]
HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp [code]
HolographicTagAlong/cpp/Content/DDSTextureLoader.h [code]
HolographicTagAlong/cpp/Content/DistanceFieldRenderer.cpp [code]
HolographicTagAlong/cpp/Content/DistanceFieldRenderer.h [code]
HolographicTagAlong/cpp/Content/QuadRenderer.cpp [code]
HolographicTagAlong/cpp/Content/QuadRenderer.h [code]
HolographicTagAlong/cpp/Content/ShaderStructures.h [code]
HolographicTagAlong/cpp/Content/SpatialInputHandler.cpp [code]
HolographicTagAlong/cpp/Content/SpatialInputHandler.h [code]
HolographicTagAlong/cpp/Content/TextRenderer.cpp [code]
HolographicTagAlong/cpp/Content/TextRenderer.h [code]
HolographicVoiceInput/cpp/AppView.cpp [code]
HolographicVoiceInput/cpp/AppView.h [code]
HolographicVoiceInput/cpp/HolographicVoiceInputMain.cpp [code]
HolographicVoiceInput/cpp/HolographicVoiceInputMain.h [code]
HolographicVoiceInput/cpp/pch.cpp [code]
HolographicVoiceInput/cpp/pch.h [code]
HolographicVoiceInput/cpp/Audio/AudioFileReader.cpp [code]
HolographicVoiceInput/cpp/Audio/AudioFileReader.h [code]
HolographicVoiceInput/cpp/Audio/AudioStreamReader.cpp [code]
HolographicVoiceInput/cpp/Audio/AudioStreamReader.h [code]
HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.cpp [code]
HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.h [code]
HolographicVoiceInput/cpp/Audio/XAudio2Helpers.h [code]
HolographicVoiceInput/cpp/Common/CameraResources.cpp [code]
HolographicVoiceInput/cpp/Common/CameraResources.h [code]
HolographicVoiceInput/cpp/Common/DeviceResources.cpp [code]
HolographicVoiceInput/cpp/Common/DeviceResources.h [code]
HolographicVoiceInput/cpp/Common/DirectXHelper.h [code]
HolographicVoiceInput/cpp/Common/PrintWstringToDebugConsole.h [code]
HolographicVoiceInput/cpp/Common/StepTimer.h [code]
HolographicVoiceInput/cpp/Content/ShaderStructures.h [code]
HolographicVoiceInput/cpp/Content/SpatialInputHandler.cpp [code]
HolographicVoiceInput/cpp/Content/SpatialInputHandler.h [code]
HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.cpp [code]
HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.h [code]
HotspotAuthentication/cs/SampleConfiguration.cs [code]
HotspotAuthentication/cs/Scenario1_Initialization.xaml.cs [code]
HotspotAuthentication/cs/Scenario2_BackgroundTask.xaml.cs [code]
HotspotAuthentication/cs/Scenario3_ForegroundApp.xaml.cs [code]
HotspotAuthentication/cs/ScenarioCommon.cs [code]
HotspotAuthentication/cs/HotspotAuthenticationTask/BackgroundTask.cs [code]
HotspotAuthentication/cs/HotspotAuthenticationTask/ConfigStore.cs [code]
HotspotAuthentication/cs/HotspotAuthenticationTask/Properties/AssemblyInfo.cs [code]
HttpClient/cppwinrt/Helpers.cpp [code]
HttpClient/cppwinrt/Helpers.h [code]
HttpClient/cppwinrt/HttpJsonContent.cpp [code]
HttpClient/cppwinrt/HttpJsonContent.h [code]
HttpClient/cppwinrt/pch.cpp [code]
HttpClient/cppwinrt/pch.h [code]
HttpClient/cppwinrt/PlugInFilter.cpp [code]
HttpClient/cppwinrt/PlugInFilter.h [code]
HttpClient/cppwinrt/Project.idl [code]
HttpClient/cppwinrt/SampleConfiguration.cpp [code]
HttpClient/cppwinrt/SampleConfiguration.h [code]
HttpClient/cppwinrt/Scenario01_GetText.cpp [code]
HttpClient/cppwinrt/Scenario01_GetText.h [code]
HttpClient/cppwinrt/Scenario02_GetStream.cpp [code]
HttpClient/cppwinrt/Scenario02_GetStream.h [code]
HttpClient/cppwinrt/Scenario03_GetList.cpp [code]
HttpClient/cppwinrt/Scenario03_GetList.h [code]
HttpClient/cppwinrt/Scenario04_PostText.cpp [code]
HttpClient/cppwinrt/Scenario04_PostText.h [code]
HttpClient/cppwinrt/Scenario05_PostStream.cpp [code]
HttpClient/cppwinrt/Scenario05_PostStream.h [code]
HttpClient/cppwinrt/Scenario06_PostMultipart.cpp [code]
HttpClient/cppwinrt/Scenario06_PostMultipart.h [code]
HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.cpp [code]
HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.h [code]
HttpClient/cppwinrt/Scenario08_PostCustomContent.cpp [code]
HttpClient/cppwinrt/Scenario08_PostCustomContent.h [code]
HttpClient/cppwinrt/Scenario09_GetCookie.cpp [code]
HttpClient/cppwinrt/Scenario09_GetCookie.h [code]
HttpClient/cppwinrt/Scenario10_SetCookie.cpp [code]
HttpClient/cppwinrt/Scenario10_SetCookie.h [code]
HttpClient/cppwinrt/Scenario11_DeleteCookie.cpp [code]
HttpClient/cppwinrt/Scenario11_DeleteCookie.h [code]
HttpClient/cppwinrt/Scenario12_DisableCookies.cpp [code]
HttpClient/cppwinrt/Scenario12_DisableCookies.h [code]
HttpClient/cppwinrt/Scenario13_RetryFilter.cpp [code]
HttpClient/cppwinrt/Scenario13_RetryFilter.h [code]
HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.cpp [code]
HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.h [code]
HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.cpp [code]
HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.h [code]
HttpClient/cppwinrt/SlowInputStream.cpp [code]
HttpClient/cppwinrt/SlowInputStream.h [code]
HttpClient/cs/Helpers.cs [code]
HttpClient/cs/HttpJsonContent.cs [code]
HttpClient/cs/PlugInFilter.cs [code]
HttpClient/cs/SampleConfiguration.cs [code]
HttpClient/cs/Scenario01_GetText.xaml.cs [code]
HttpClient/cs/Scenario02_GetStream.xaml.cs [code]
HttpClient/cs/Scenario03_GetList.xaml.cs [code]
HttpClient/cs/Scenario04_PostText.xaml.cs [code]
HttpClient/cs/Scenario05_PostStream.xaml.cs [code]
HttpClient/cs/Scenario06_PostMultipart.xaml.cs [code]
HttpClient/cs/Scenario07_PostStreamWithProgress.xaml.cs [code]
HttpClient/cs/Scenario08_PostCustomContent.xaml.cs [code]
HttpClient/cs/Scenario09_GetCookie.xaml.cs [code]
HttpClient/cs/Scenario10_SetCookie.xaml.cs [code]
HttpClient/cs/Scenario11_DeleteCookie.xaml.cs [code]
HttpClient/cs/Scenario12_DisableCookies.xaml.cs [code]
HttpClient/cs/Scenario13_RetryFilter.xaml.cs [code]
HttpClient/cs/Scenario14_MeteredConnectionFilter.xaml.cs [code]
HttpClient/cs/Scenario15_ServerCertificateValidation.xaml.cs [code]
HttpClient/cs/SlowInputStream.cs [code]
HttpClient/HttpFilters/HttpMeteredConnectionFilter.cpp [code]
HttpClient/HttpFilters/HttpMeteredConnectionFilter.h [code]
HttpClient/HttpFilters/HttpRetryFilter.cpp [code]
HttpClient/HttpFilters/HttpRetryFilter.h [code]
HttpClient/HttpFilters/pch.cpp [code]
HttpClient/HttpFilters/pch.h [code]
HttpClient/HttpFilters/Project.idl [code]
Inclinometer/cpp/CalibrationBar.xaml.cpp [code]
Inclinometer/cpp/CalibrationBar.xaml.h [code]
Inclinometer/cpp/pch.cpp [code]
Inclinometer/cpp/pch.h [code]
Inclinometer/cpp/SampleConfiguration.cpp [code]
Inclinometer/cpp/SampleConfiguration.h [code]
Inclinometer/cpp/Scenario1_DataEvents.xaml.cpp [code]
Inclinometer/cpp/Scenario1_DataEvents.xaml.h [code]
Inclinometer/cpp/Scenario2_Polling.xaml.cpp [code]
Inclinometer/cpp/Scenario2_Polling.xaml.h [code]
Inclinometer/cpp/Scenario3_Calibration.xaml.cpp [code]
Inclinometer/cpp/Scenario3_Calibration.xaml.h [code]
Inclinometer/cs/CalibrationBar.xaml.cs [code]
Inclinometer/cs/SampleConfiguration.cs [code]
Inclinometer/cs/Scenario1_DataEvents.xaml.cs [code]
Inclinometer/cs/Scenario2_Polling.xaml.cs [code]
Inclinometer/cs/Scenario3_Calibration.xaml.cs [code]
InkAnalysis/cs/SampleConfiguration.cs [code]
InkAnalysis/cs/Scenario1.xaml.cs [code]
InkAnalysis/cs/Scenario2.xaml.cs [code]
IoT-GPIO/cpp/pch.cpp [code]
IoT-GPIO/cpp/pch.h [code]
IoT-GPIO/cpp/SampleConfiguration.cpp [code]
IoT-GPIO/cpp/SampleConfiguration.h [code]
IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.cpp [code]
IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.h [code]
IoT-GPIO/cpp/Scenario2_Listen.xaml.cpp [code]
IoT-GPIO/cpp/Scenario2_Listen.xaml.h [code]
IoT-GPIO/cppwinrt/pch.cpp [code]
IoT-GPIO/cppwinrt/pch.h [code]
IoT-GPIO/cppwinrt/Project.idl [code]
IoT-GPIO/cppwinrt/SampleConfiguration.cpp [code]
IoT-GPIO/cppwinrt/SampleConfiguration.h [code]
IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.cpp [code]
IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.h [code]
IoT-GPIO/cppwinrt/Scenario2_Listen.cpp [code]
IoT-GPIO/cppwinrt/Scenario2_Listen.h [code]
IoT-GPIO/cs/SampleConfiguration.cs [code]
IoT-GPIO/cs/Scenario1_GetAndSetPin.xaml.cs [code]
IoT-GPIO/cs/Scenario2_Listen.xaml.cs [code]
IoT-I2C/cpp/pch.cpp [code]
IoT-I2C/cpp/pch.h [code]
IoT-I2C/cpp/SampleConfiguration.cpp [code]
IoT-I2C/cpp/SampleConfiguration.h [code]
IoT-I2C/cpp/Scenario1_ReadData.xaml.cpp [code]
IoT-I2C/cpp/Scenario1_ReadData.xaml.h [code]
IoT-I2C/cppwinrt/pch.cpp [code]
IoT-I2C/cppwinrt/pch.h [code]
IoT-I2C/cppwinrt/Project.idl [code]
IoT-I2C/cppwinrt/SampleConfiguration.cpp [code]
IoT-I2C/cppwinrt/SampleConfiguration.h [code]
IoT-I2C/cppwinrt/Scenario1_ReadData.cpp [code]
IoT-I2C/cppwinrt/Scenario1_ReadData.h [code]
IoT-I2C/cs/SampleConfiguration.cs [code]
IoT-I2C/cs/Scenario1_ReadData.xaml.cs [code]
IoT-SPI/cpp/pch.cpp [code]
IoT-SPI/cpp/pch.h [code]
IoT-SPI/cpp/SampleConfiguration.cpp [code]
IoT-SPI/cpp/SampleConfiguration.h [code]
IoT-SPI/cpp/Scenario1_ReadData.xaml.cpp [code]
IoT-SPI/cpp/Scenario1_ReadData.xaml.h [code]
IoT-SPI/cppwinrt/pch.cpp [code]
IoT-SPI/cppwinrt/pch.h [code]
IoT-SPI/cppwinrt/Project.idl [code]
IoT-SPI/cppwinrt/SampleConfiguration.cpp [code]
IoT-SPI/cppwinrt/SampleConfiguration.h [code]
IoT-SPI/cppwinrt/Scenario1_ReadData.cpp [code]
IoT-SPI/cppwinrt/Scenario1_ReadData.h [code]
IoT-SPI/cs/SampleConfiguration.cs [code]
IoT-SPI/cs/Scenario1_ReadData.xaml.cs [code]
JapanesePhoneticAnalysis/cpp/pch.cpp [code]
JapanesePhoneticAnalysis/cpp/pch.h [code]
JapanesePhoneticAnalysis/cpp/SampleConfiguration.cpp [code]
JapanesePhoneticAnalysis/cpp/SampleConfiguration.h [code]
JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.cpp [code]
JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.h [code]
JapanesePhoneticAnalysis/cppwinrt/pch.cpp [code]
JapanesePhoneticAnalysis/cppwinrt/pch.h [code]
JapanesePhoneticAnalysis/cppwinrt/Project.idl [code]
JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.cpp [code]
JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.h [code]
JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.cpp [code]
JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.h [code]
JapanesePhoneticAnalysis/cs/SampleConfiguration.cs [code]
JapanesePhoneticAnalysis/cs/Scenario1_Analyze.xaml.cs [code]
Json/cppwinrt/pch.cpp [code]
Json/cppwinrt/pch.h [code]
Json/cppwinrt/Project.idl [code]
Json/cppwinrt/SampleConfiguration.cpp [code]
Json/cppwinrt/SampleConfiguration.h [code]
Json/cppwinrt/Scenario1_ParseAndStringify.cpp [code]
Json/cppwinrt/Scenario1_ParseAndStringify.h [code]
Json/cppwinrt/School.cpp [code]
Json/cppwinrt/School.h [code]
Json/cppwinrt/User.cpp [code]
Json/cppwinrt/User.h [code]
Json/cs/SampleConfiguration.cs [code]
Json/cs/Scenario1_ParseAndStringify.xaml.cs [code]
Json/cs/School.cs [code]
Json/cs/User.cs [code]
JumpList/cpp/pch.cpp [code]
JumpList/cpp/pch.h [code]
JumpList/cpp/SampleConfiguration.cpp [code]
JumpList/cpp/SampleConfiguration.h [code]
JumpList/cpp/Scenario1_Launched.xaml.cpp [code]
JumpList/cpp/Scenario1_Launched.xaml.h [code]
JumpList/cpp/Scenario2_Remove.xaml.cpp [code]
JumpList/cpp/Scenario2_Remove.xaml.h [code]
JumpList/cpp/Scenario3_CustomItems.xaml.cpp [code]
JumpList/cpp/Scenario3_CustomItems.xaml.h [code]
JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.cpp [code]
JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.h [code]
JumpList/cpp/Scenario5_IsSupported.xaml.cpp [code]
JumpList/cpp/Scenario5_IsSupported.xaml.h [code]
JumpList/cppwinrt/pch.cpp [code]
JumpList/cppwinrt/pch.h [code]
JumpList/cppwinrt/Project.idl [code]
JumpList/cppwinrt/SampleConfiguration.cpp [code]
JumpList/cppwinrt/SampleConfiguration.h [code]
JumpList/cppwinrt/Scenario1_Launched.cpp [code]
JumpList/cppwinrt/Scenario1_Launched.h [code]
JumpList/cppwinrt/Scenario2_Remove.cpp [code]
JumpList/cppwinrt/Scenario2_Remove.h [code]
JumpList/cppwinrt/Scenario3_CustomItems.cpp [code]
JumpList/cppwinrt/Scenario3_CustomItems.h [code]
JumpList/cppwinrt/Scenario4_ChangeSystemGroup.cpp [code]
JumpList/cppwinrt/Scenario4_ChangeSystemGroup.h [code]
JumpList/cppwinrt/Scenario5_IsSupported.cpp [code]
JumpList/cppwinrt/Scenario5_IsSupported.h [code]
JumpList/cs/SampleConfiguration.cs [code]
JumpList/cs/Scenario1_Launched.xaml.cs [code]
JumpList/cs/Scenario2_Remove.xaml.cs [code]
JumpList/cs/Scenario3_CustomItems.xaml.cs [code]
JumpList/cs/Scenario4_ChangeSystemGroup.xaml.cs [code]
JumpList/cs/Scenario5_IsSupported.xaml.cs [code]
KeyCredentialManager/cpp/Account.cpp [code]
KeyCredentialManager/cpp/Account.h [code]
KeyCredentialManager/cpp/App.xaml.cpp [code]
KeyCredentialManager/cpp/Content.xaml.cpp [code]
KeyCredentialManager/cpp/Content.xaml.h [code]
KeyCredentialManager/cpp/pch.cpp [code]
KeyCredentialManager/cpp/pch.h [code]
KeyCredentialManager/cpp/SampleConfiguration.cpp [code]
KeyCredentialManager/cpp/SampleConfiguration.h [code]
KeyCredentialManager/cpp/SignIn.xaml.cpp [code]
KeyCredentialManager/cpp/SignIn.xaml.h [code]
KeyCredentialManager/cpp/UserSelect.xaml.cpp [code]
KeyCredentialManager/cpp/UserSelect.xaml.h [code]
KeyCredentialManager/cs/Account.cs [code]
KeyCredentialManager/cs/AccountsHelper.cs [code]
KeyCredentialManager/cs/Content.xaml.cs [code]
KeyCredentialManager/cs/SampleConfiguration.cs [code]
KeyCredentialManager/cs/SignIn.xaml.cs [code]
KeyCredentialManager/cs/UserSelect.xaml.cs [code]
LampArray/cppwinrt/pch.cpp [code]
LampArray/cppwinrt/pch.h [code]
LampArray/cppwinrt/Project.idl [code]
LampArray/cppwinrt/SampleConfiguration.cpp [code]
LampArray/cppwinrt/SampleConfiguration.h [code]
LampArray/cppwinrt/Scenario1_Basics.cpp [code]
LampArray/cppwinrt/Scenario1_Basics.h [code]
LampArray/cppwinrt/Scenario2_Effects.cpp [code]
LampArray/cppwinrt/Scenario2_Effects.h [code]
LampArray/cs/SampleConfiguration.cs [code]
LampArray/cs/Scenario1_Basics.xaml.cs [code]
LampArray/cs/Scenario2_Effects.xaml.cs [code]
LampDevice/cpp/pch.cpp [code]
LampDevice/cpp/pch.h [code]
LampDevice/cpp/SampleConfiguration.cpp [code]
LampDevice/cpp/SampleConfiguration.h [code]
LampDevice/cpp/Scenario1_GetLamp.xaml.cpp [code]
LampDevice/cpp/Scenario1_GetLamp.xaml.h [code]
LampDevice/cpp/Scenario2_EnableSettings.xaml.cpp [code]
LampDevice/cpp/Scenario2_EnableSettings.xaml.h [code]
LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.cpp [code]
LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.h [code]
LampDevice/cs/SampleConfiguration.cs [code]
LampDevice/cs/Scenario1_GetLamp.xaml.cs [code]
LampDevice/cs/Scenario2_EnableSettings.xaml.cs [code]
LampDevice/cs/Scenario3_AvailabilityChanged.xaml.cs [code]
LanguageFont/cppwinrt/pch.cpp [code]
LanguageFont/cppwinrt/pch.h [code]
LanguageFont/cppwinrt/Project.idl [code]
LanguageFont/cppwinrt/SampleConfiguration.cpp [code]
LanguageFont/cppwinrt/SampleConfiguration.h [code]
LanguageFont/cppwinrt/Scenario1_UIFonts.cpp [code]
LanguageFont/cppwinrt/Scenario1_UIFonts.h [code]
LanguageFont/cppwinrt/Scenario2_DocumentFonts.cpp [code]
LanguageFont/cppwinrt/Scenario2_DocumentFonts.h [code]
LanguageFont/cs/SampleConfiguration.cs [code]
LanguageFont/cs/Scenario1_UIFonts.xaml.cs [code]
LanguageFont/cs/Scenario2_DocumentFonts.xaml.cs [code]
LibraryManagement/cpp/pch.cpp [code]
LibraryManagement/cpp/pch.h [code]
LibraryManagement/cpp/S1_AddFolder.xaml.cpp [code]
LibraryManagement/cpp/S1_AddFolder.xaml.h [code]
LibraryManagement/cpp/S2_ListFolders.xaml.cpp [code]
LibraryManagement/cpp/S2_ListFolders.xaml.h [code]
LibraryManagement/cpp/S3_RemoveFolder.xaml.cpp [code]
LibraryManagement/cpp/S3_RemoveFolder.xaml.h [code]
LibraryManagement/cpp/SampleConfiguration.cpp [code]
LibraryManagement/cpp/SampleConfiguration.h [code]
LibraryManagement/cs/S1_AddFolder.xaml.cs [code]
LibraryManagement/cs/S2_ListFolders.xaml.cs [code]
LibraryManagement/cs/S3_RemoveFolder.xaml.cs [code]
LibraryManagement/cs/SampleConfiguration.cs [code]
LightSensor/cpp/pch.cpp [code]
LightSensor/cpp/pch.h [code]
LightSensor/cpp/SampleConfiguration.cpp [code]
LightSensor/cpp/SampleConfiguration.h [code]
LightSensor/cpp/Scenario1_DataEvents.xaml.cpp [code]
LightSensor/cpp/Scenario1_DataEvents.xaml.h [code]
LightSensor/cpp/Scenario2_Polling.xaml.cpp [code]
LightSensor/cpp/Scenario2_Polling.xaml.h [code]
LightSensor/cs/SampleConfiguration.cs [code]
LightSensor/cs/Scenario1_DataEvents.xaml.cs [code]
LightSensor/cs/Scenario2_Polling.xaml.cs [code]
LineDisplay/cpp/pch.cpp [code]
LineDisplay/cpp/pch.h [code]
LineDisplay/cpp/SampleConfiguration.cpp [code]
LineDisplay/cpp/SampleConfiguration.h [code]
LineDisplay/cpp/Scenario1_SelectDisplay.xaml.cpp [code]
LineDisplay/cpp/Scenario1_SelectDisplay.xaml.h [code]
LineDisplay/cpp/Scenario2_DisplayText.xaml.cpp [code]
LineDisplay/cpp/Scenario2_DisplayText.xaml.h [code]
LineDisplay/cpp/Scenario3_UsingWindows.xaml.cpp [code]
LineDisplay/cpp/Scenario3_UsingWindows.xaml.h [code]
LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.cpp [code]
LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.h [code]
LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.cpp [code]
LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.h [code]
LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.cpp [code]
LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.h [code]
LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.cpp [code]
LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.h [code]
LineDisplay/cs/SampleConfiguration.cs [code]
LineDisplay/cs/Scenario1_SelectDisplay.xaml.cs [code]
LineDisplay/cs/Scenario2_DisplayText.xaml.cs [code]
LineDisplay/cs/Scenario3_UsingWindows.xaml.cs [code]
LineDisplay/cs/Scenario4_UpdatingLineDisplayAttributes.xaml.cs [code]
LineDisplay/cs/Scenario5_DefiningCustomGlyphs.xaml.cs [code]
LineDisplay/cs/Scenario6_ManipulatingCursorAttributes.xaml.cs [code]
LineDisplay/cs/Scenario7_ScrollingContentUsingMarquee.xaml.cs [code]
LinguisticServices/cppwinrt/pch.cpp [code]
LinguisticServices/cppwinrt/pch.h [code]
LinguisticServices/cppwinrt/Project.idl [code]
LinguisticServices/cppwinrt/SampleConfiguration.cpp [code]
LinguisticServices/cppwinrt/SampleConfiguration.h [code]
LinguisticServices/cppwinrt/Scenario1_LanguageDetection.cpp [code]
LinguisticServices/cppwinrt/Scenario1_LanguageDetection.h [code]
LinguisticServices/cppwinrt/Scenario2_ScriptDetection.cpp [code]
LinguisticServices/cppwinrt/Scenario2_ScriptDetection.h [code]
LinguisticServices/cppwinrt/Scenario3_Transliteration.cpp [code]
LinguisticServices/cppwinrt/Scenario3_Transliteration.h [code]
LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.cpp [code]
LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.h [code]
LinguisticServices/cs/SampleConfiguration.cs [code]
LinguisticServices/cs/Scenario1_LanguageDetection.xaml.cs [code]
LinguisticServices/cs/Scenario2_ScriptDetection.xaml.cs [code]
LinguisticServices/cs/Scenario3_Transliteration.xaml.cs [code]
LinguisticServices/cs/Scenario4_CharacterGrouping.xaml.cs [code]
LinguisticServices/RuntimeComponent/LinguisticServices.cpp [code]
LinguisticServices/RuntimeComponent/LinguisticServices.h [code]
LinguisticServices/RuntimeComponent/LinguisticServices.idl [code]
LinguisticServices/RuntimeComponent/pch.cpp [code]
LinguisticServices/RuntimeComponent/pch.h [code]
LinguisticServices/shared/elsutil.h [code]
LiveDash/cs/LiveDash/ILivePlayer.cs [code]
LiveDash/cs/LiveDash/LiveDashPlayer.cs [code]
LiveDash/cs/LiveDash/LiveSourceBufferManager.cs [code]
LiveDash/cs/LiveDash/Player.cs [code]
LiveDash/cs/LiveDash/SourceBufferManager.cs [code]
LiveDash/cs/LiveDash/Models/Manifest.cs [code]
LiveDash/cs/LiveDash/Models/MediaSegment.cs [code]
LiveDash/cs/LiveDash/Models/MediaSegmentInformation.cs [code]
LiveDash/cs/LiveDash/Models/MediaStream.cs [code]
LiveDash/cs/LiveDash/Models/Period.cs [code]
LiveDash/cs/LiveDash/Util/DashManifestParser.cs [code]
LiveDash/cs/LiveDash/Util/Utils.cs [code]
LiveDash/cs/LiveDashApp/MainPage.xaml.cs [code]
LiveDash/cs/LiveDashApp/SampleConfiguration.cs [code]
LiveDash/cs/LiveDashApp/Views/LiveDashPlayer.xaml.cs [code]
LiveDash/cs/LiveDashApp/Views/Log.xaml.cs [code]
LockScreenApps/cppwinrt/pch.cpp [code]
LockScreenApps/cppwinrt/pch.h [code]
LockScreenApps/cppwinrt/Project.idl [code]
LockScreenApps/cppwinrt/SampleConfiguration.cpp [code]
LockScreenApps/cppwinrt/SampleConfiguration.h [code]
LockScreenApps/cppwinrt/Scenario1_Configure.cpp [code]
LockScreenApps/cppwinrt/Scenario1_Configure.h [code]
LockScreenApps/cppwinrt/Scenario2_Notifications.cpp [code]
LockScreenApps/cppwinrt/Scenario2_Notifications.h [code]
LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.cpp [code]
LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.h [code]
LockScreenApps/cs/SampleConfiguration.cs [code]
LockScreenApps/cs/Scenario1_Configure.xaml.cs [code]
LockScreenApps/cs/Scenario2_Notifications.xaml.cs [code]
LockScreenApps/cs/Scenario3_SecondaryTiles.xaml.cs [code]
Logging/cpp/FileLoggingSessionScenario.cpp [code]
Logging/cpp/FileLoggingSessionScenario.h [code]
Logging/cpp/LoggingChannelScenario.cpp [code]
Logging/cpp/LoggingChannelScenario.h [code]
Logging/cpp/LoggingScenarioEventArgs.h [code]
Logging/cpp/LoggingScenarioHelpers.h [code]
Logging/cpp/LoggingSessionScenario.cpp [code]
Logging/cpp/LoggingSessionScenario.h [code]
Logging/cpp/pch.cpp [code]
Logging/cpp/pch.h [code]
Logging/cpp/SampleConfiguration.cpp [code]
Logging/cpp/SampleConfiguration.h [code]
Logging/cpp/Scenario1.xaml.cpp [code]
Logging/cpp/Scenario1.xaml.h [code]
Logging/cpp/Scenario2.xaml.cpp [code]
Logging/cpp/Scenario2.xaml.h [code]
Logging/cpp/Scenario3.xaml.cpp [code]
Logging/cpp/Scenario3.xaml.h [code]
Logging/cppwinrt/FileLoggingSessionScenario.cpp [code]
Logging/cppwinrt/FileLoggingSessionScenario.h [code]
Logging/cppwinrt/LoggingChannelScenario.cpp [code]
Logging/cppwinrt/LoggingChannelScenario.h [code]
Logging/cppwinrt/LoggingScenarioEventArgs.h [code]
Logging/cppwinrt/LoggingScenarioHelpers.h [code]
Logging/cppwinrt/LoggingSessionScenario.cpp [code]
Logging/cppwinrt/LoggingSessionScenario.h [code]
Logging/cppwinrt/pch.cpp [code]
Logging/cppwinrt/pch.h [code]
Logging/cppwinrt/Project.idl [code]
Logging/cppwinrt/SampleConfiguration.cpp [code]
Logging/cppwinrt/SampleConfiguration.h [code]
Logging/cppwinrt/Scenario1.cpp [code]
Logging/cppwinrt/Scenario1.h [code]
Logging/cppwinrt/Scenario2.cpp [code]
Logging/cppwinrt/Scenario2.h [code]
Logging/cppwinrt/Scenario3.cpp [code]
Logging/cppwinrt/Scenario3.h [code]
Logging/cs/FileLoggingSessionScenario.cs [code]
Logging/cs/LoggingChannelScenario.cs [code]
Logging/cs/LoggingScenarioEventArgs.cs [code]
Logging/cs/LoggingSessionScenario.cs [code]
Logging/cs/SampleConfiguration.cs [code]
Logging/cs/Scenario1.xaml.cs [code]
Logging/cs/Scenario2.xaml.cs [code]
Logging/cs/Scenario3.xaml.cs [code]
LowLatencyInput/cpp/App.xaml.cpp [code]
LowLatencyInput/cpp/LowLatencyInputMain.cpp [code]
LowLatencyInput/cpp/LowLatencyInputMain.h [code]
LowLatencyInput/cpp/pch.cpp [code]
LowLatencyInput/cpp/pch.h [code]
LowLatencyInput/cpp/SampleConfiguration.cpp [code]
LowLatencyInput/cpp/SampleConfiguration.h [code]
LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.cpp [code]
LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.h [code]
LowLatencyInput/cpp/Common/Constants.h [code]
LowLatencyInput/cpp/Common/DeviceResources.cpp [code]
LowLatencyInput/cpp/Common/DeviceResources.h [code]
LowLatencyInput/cpp/Common/DirectXHelper.h [code]
LowLatencyInput/cpp/Content/RectRenderer.cpp [code]
LowLatencyInput/cpp/Content/RectRenderer.h [code]
MagneticStripeReader/cpp/pch.cpp [code]
MagneticStripeReader/cpp/pch.h [code]
MagneticStripeReader/cpp/SampleConfiguration.cpp [code]
MagneticStripeReader/cpp/SampleConfiguration.h [code]
MagneticStripeReader/cpp/Scenario1_BankCards.xaml.cpp [code]
MagneticStripeReader/cpp/Scenario1_BankCards.xaml.h [code]
MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.cpp [code]
MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.h [code]
MagneticStripeReader/cs/SampleConfiguration.cs [code]
MagneticStripeReader/cs/Scenario1_BankCards.xaml.cs [code]
MagneticStripeReader/cs/Scenario2_AamvaCards.xaml.cs [code]
Magnetometer/cs/SampleConfiguration.cs [code]
Magnetometer/cs/Scenario1_DataEvents.xaml.cs [code]
Magnetometer/cs/Scenario2_Polling.xaml.cs [code]
MapControl/cpp/pch.cpp [code]
MapControl/cpp/pch.h [code]
MapControl/cpp/SampleConfiguration.cpp [code]
MapControl/cpp/SampleConfiguration.h [code]
MapControl/cpp/Scenario1.xaml.cpp [code]
MapControl/cpp/Scenario1.xaml.h [code]
MapControl/cpp/Scenario10.xaml.cpp [code]
MapControl/cpp/Scenario10.xaml.h [code]
MapControl/cpp/Scenario11.xaml.cpp [code]
MapControl/cpp/Scenario11.xaml.h [code]
MapControl/cpp/Scenario12.xaml.cpp [code]
MapControl/cpp/Scenario12.xaml.h [code]
MapControl/cpp/Scenario2.xaml.cpp [code]
MapControl/cpp/Scenario2.xaml.h [code]
MapControl/cpp/Scenario3.xaml.cpp [code]
MapControl/cpp/Scenario3.xaml.h [code]
MapControl/cpp/Scenario4.xaml.cpp [code]
MapControl/cpp/Scenario4.xaml.h [code]
MapControl/cpp/Scenario5.xaml.cpp [code]
MapControl/cpp/Scenario5.xaml.h [code]
MapControl/cpp/Scenario6.xaml.cpp [code]
MapControl/cpp/Scenario6.xaml.h [code]
MapControl/cpp/Scenario7.xaml.cpp [code]
MapControl/cpp/Scenario7.xaml.h [code]
MapControl/cpp/Scenario8.xaml.cpp [code]
MapControl/cpp/Scenario8.xaml.h [code]
MapControl/cpp/Scenario9.xaml.cpp [code]
MapControl/cpp/Scenario9.xaml.h [code]
MapControl/cs/SampleConfiguration.cs [code]
MapControl/cs/Scenario1.xaml.cs [code]
MapControl/cs/Scenario10.xaml.cs [code]
MapControl/cs/Scenario11.xaml.cs [code]
MapControl/cs/Scenario12.xaml.cs [code]
MapControl/cs/Scenario2.xaml.cs [code]
MapControl/cs/Scenario3.xaml.cs [code]
MapControl/cs/Scenario4.xaml.cs [code]
MapControl/cs/Scenario5.xaml.cs [code]
MapControl/cs/Scenario6.xaml.cs [code]
MapControl/cs/Scenario7.xaml.cs [code]
MapControl/cs/Scenario8.xaml.cs [code]
MapControl/cs/Scenario9.xaml.cs [code]
MediaEditing/cpp/pch.cpp [code]
MediaEditing/cpp/pch.h [code]
MediaEditing/cpp/SampleConfiguration.cpp [code]
MediaEditing/cpp/SampleConfiguration.h [code]
MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.cpp [code]
MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.h [code]
MediaEditing/cpp/Scenario2_AppendClips.xaml.cpp [code]
MediaEditing/cpp/Scenario2_AppendClips.xaml.h [code]
MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.cpp [code]
MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.h [code]
MediaEditing/cpp/Scenario4_AddOverlays.xaml.cpp [code]
MediaEditing/cpp/Scenario4_AddOverlays.xaml.h [code]
MediaEditing/cs/SampleConfiguration.cs [code]
MediaEditing/cs/Scenario1_TrimAndSaveClip.xaml.cs [code]
MediaEditing/cs/Scenario2_AppendClips.xaml.cs [code]
MediaEditing/cs/Scenario3_AddAudioTracks.xaml.cs [code]
MediaEditing/cs/Scenario4_AddOverlays.xaml.cs [code]
MediaImport/cs/App.xaml.cs [code]
MediaImport/cs/ImportableItemWrapper.cs [code]
MediaImport/cs/MainPage.xaml.cs [code]
MediaImport/cs/SampleConfiguration.cs [code]
MediaImport/cs/Scenario1.xaml.cs [code]
MediaImport/cs/DataBinding/GeneratorIncrementalLoadingClass.cs [code]
MediaImport/cs/DataBinding/IncrementalLoadingBase.cs [code]
MediaTranscoding/cpp/pch.cpp [code]
MediaTranscoding/cpp/pch.h [code]
MediaTranscoding/cpp/SampleConfiguration.cpp [code]
MediaTranscoding/cpp/SampleConfiguration.h [code]
MediaTranscoding/cpp/Scenario1_Default.xaml.cpp [code]
MediaTranscoding/cpp/Scenario1_Default.xaml.h [code]
MediaTranscoding/cpp/Scenario2_Custom.xaml.cpp [code]
MediaTranscoding/cpp/Scenario2_Custom.xaml.h [code]
MediaTranscoding/cpp/Scenario3_Trim.xaml.cpp [code]
MediaTranscoding/cpp/Scenario3_Trim.xaml.h [code]
MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.cpp [code]
MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.h [code]
MediaTranscoding/cs/MediaFoundationConstants.cs [code]
MediaTranscoding/cs/SampleConfiguration.cs [code]
MediaTranscoding/cs/Scenario1_Default.xaml.cs [code]
MediaTranscoding/cs/Scenario2_Custom.xaml.cs [code]
MediaTranscoding/cs/Scenario3_Trim.xaml.cs [code]
MessageDialog/cpp/CancelCommand.xaml.cpp [code]
MessageDialog/cpp/CancelCommand.xaml.h [code]
MessageDialog/cpp/CompletedCallback.xaml.cpp [code]
MessageDialog/cpp/CompletedCallback.xaml.h [code]
MessageDialog/cpp/CustomCommand.xaml.cpp [code]
MessageDialog/cpp/CustomCommand.xaml.h [code]
MessageDialog/cpp/DefaultCloseCommand.xaml.cpp [code]
MessageDialog/cpp/DefaultCloseCommand.xaml.h [code]
MessageDialog/cpp/pch.cpp [code]
MessageDialog/cpp/pch.h [code]
MessageDialog/cpp/SampleConfiguration.cpp [code]
MessageDialog/cpp/SampleConfiguration.h [code]
MessageDialog/cs/CancelCommand.xaml.cs [code]
MessageDialog/cs/CompletedCallback.xaml.cs [code]
MessageDialog/cs/CustomCommand.xaml.cs [code]
MessageDialog/cs/DefaultCloseCommand.xaml.cs [code]
MessageDialog/cs/SampleConfiguration.cs [code]
MicrosoftPassport/cs/AccountOverviewPage.xaml.cs [code]
MicrosoftPassport/cs/EnableHelloPage.xaml.cs [code]
MicrosoftPassport/cs/MainPage.xaml.cs [code]
MicrosoftPassport/cs/Util.cs [code]
MicrosoftPassport/Server/Global.asax.cs [code]
MicrosoftPassport/Server/App_Start/FilterConfig.cs [code]
MicrosoftPassport/Server/App_Start/RouteConfig.cs [code]
MicrosoftPassport/Server/App_Start/WebApiConfig.cs [code]
MicrosoftPassport/Server/Controllers/AuthenticationController.cs [code]
MicrosoftPassport/Server/Controllers/HomeController.cs [code]
MicrosoftPassport/Server/Data/DAL.cs [code]
MicrosoftPassport/Server/Models/Messages.cs [code]
MicrosoftPassport/Server/Models/SubjectPublicKeyInfo.cs [code]
MicrosoftPassport/Server/Properties/AssemblyInfo.cs [code]
MIDI/cs/MidiDeviceWatcher.cs [code]
MIDI/cs/SampleConfiguration.cs [code]
MIDI/cs/Scenario1_MIDIDeviceEnumeration.xaml.cs [code]
MIDI/cs/Scenario2_ReceiveMIDIMessages.xaml.cs [code]
MIDI/cs/Scenario3_SendMIDIMessages.xaml.cs [code]
MixedRealityModel/cs/SampleConfiguration.cs [code]
MixedRealityModel/cs/Scenario1_CreateTile.xaml.cs [code]
MobileBroadband/cs/AccountWatcher.xaml.cs [code]
MobileBroadband/cs/BroadbandDevice.xaml.cs [code]
MobileBroadband/cs/GetConnectionProfiles.xaml.cs [code]
MobileBroadband/cs/ModemDeviceServices.xaml.cs [code]
MobileBroadband/cs/ModemInformation.xaml.cs [code]
MobileBroadband/cs/SampleConfiguration.cs [code]
MobileBroadband/cs/ShowConnection.xaml.cs [code]
MobileBroadband/cs/SimCard.xaml.cs [code]
MobileHotspot/cppwinrt/pch.cpp [code]
MobileHotspot/cppwinrt/pch.h [code]
MobileHotspot/cppwinrt/Project.idl [code]
MobileHotspot/cppwinrt/SampleConfiguration.cpp [code]
MobileHotspot/cppwinrt/SampleConfiguration.h [code]
MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.cpp [code]
MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.h [code]
MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.cpp [code]
MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.h [code]
MobileHotspot/cs/SampleConfiguration.cs [code]
MobileHotspot/cs/Scenario1_ConfigureMobileHotspot.xaml.cs [code]
MobileHotspot/cs/Scenario2_ToggleMobileHotspot.xaml.cs [code]
MultipleViews/cppwinrt/pch.cpp [code]
MultipleViews/cppwinrt/pch.h [code]
MultipleViews/cppwinrt/Project.idl [code]
MultipleViews/cppwinrt/SampleConfiguration.cpp [code]
MultipleViews/cppwinrt/SampleConfiguration.h [code]
MultipleViews/cppwinrt/Scenario1.cpp [code]
MultipleViews/cppwinrt/Scenario1.h [code]
MultipleViews/cppwinrt/Scenario3.cpp [code]
MultipleViews/cppwinrt/Scenario3.h [code]
MultipleViews/cppwinrt/SecondaryViewPage.cpp [code]
MultipleViews/cppwinrt/SecondaryViewPage.h [code]
MultipleViews/cppwinrt/SizePreferenceString.h [code]
MultipleViews/cppwinrt/ViewLifetimeControl.cpp [code]
MultipleViews/cppwinrt/ViewLifetimeControl.h [code]
MultipleViews/cs/App.xaml.cs [code]
MultipleViews/cs/SampleConfiguration.cs [code]
MultipleViews/cs/Scenario1.xaml.cs [code]
MultipleViews/cs/Scenario3.xaml.cs [code]
MultipleViews/cs/SecondaryViewPage.xaml.cs [code]
MultipleViews/cs/ViewLifetimeControl.cs [code]
NetworkConnectivity/cppwinrt/pch.cpp [code]
NetworkConnectivity/cppwinrt/pch.h [code]
NetworkConnectivity/cppwinrt/Project.idl [code]
NetworkConnectivity/cppwinrt/SampleConfiguration.cpp [code]
NetworkConnectivity/cppwinrt/SampleConfiguration.h [code]
NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.cpp [code]
NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.h [code]
NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.cpp [code]
NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.h [code]
NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.cpp [code]
NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.h [code]
NetworkConnectivity/cs/Helpers.cs [code]
NetworkConnectivity/cs/SampleConfiguration.cs [code]
NetworkConnectivity/cs/Scenario1_NetworkConnectivity.xaml.cs [code]
NetworkConnectivity/cs/Scenario2_NetworkCost.xaml.cs [code]
NetworkConnectivity/cs/Scenario3_NetworkConnectivityChanges.xaml.cs [code]
Nfc/Nfc/App.xaml.cs [code]
Nfc/Nfc/CardReader.xaml.cs [code]
Nfc/Nfc/MainPage.xaml.cs [code]
Nfc/Nfc/ManageCard.xaml.cs [code]
Nfc/Nfc/NfcUtils.cs [code]
Nfc/Nfc/ReceiptView.xaml.cs [code]
Nfc/Nfc/SampleConfiguration.cs [code]
Nfc/Nfc/SetCardData.xaml.cs [code]
Nfc/Nfc/TlvEntry.cs [code]
Nfc/NfcHceBackgroundTask/BgTask.cpp [code]
Nfc/NfcHceBackgroundTask/BgTask.h [code]
Nfc/NfcHceBackgroundTask/pch.cpp [code]
Nfc/NfcHceBackgroundTask/pch.h [code]
Nfc/NfcHceBackgroundTask/Utilities.cpp [code]
Nfc/NfcHceBackgroundTask/Utilities.h [code]
Nfc/PcscSdk/AtrParser.cs [code]
Nfc/PcscSdk/CommonDefs.cs [code]
Nfc/PcscSdk/DesfireAccessHandler.cs [code]
Nfc/PcscSdk/DesfireCommand.cs [code]
Nfc/PcscSdk/FelicaAccessHandler.cs [code]
Nfc/PcscSdk/FelicaCommands.cs [code]
Nfc/PcscSdk/IccDetection.cs [code]
Nfc/PcscSdk/Iso15693AccessHandler.cs [code]
Nfc/PcscSdk/Iso15693Commands.cs [code]
Nfc/PcscSdk/Iso7816.cs [code]
Nfc/PcscSdk/Iso7816Defs.cs [code]
Nfc/PcscSdk/MifareStandardAccessHandler.cs [code]
Nfc/PcscSdk/MifareStandardCommands.cs [code]
Nfc/PcscSdk/MifareUltralightAccessHandler.cs [code]
Nfc/PcscSdk/MifareUltralightCommands.cs [code]
Nfc/PcscSdk/Pcsc.cs [code]
Nfc/PcscSdk/PcscDefs.cs [code]
Nfc/PcscSdk/PcscUtils.cs [code]
NfcProvisioner/cs/SampleConfiguration.cs [code]
NfcProvisioner/cs/Scenario1.xaml.cs [code]
Notifications/cs/BackgroundTasks/BadgeNotificationHistoryChangedTriggerTask.cs [code]
Notifications/cs/BackgroundTasks/ToastActivationTypeBackgroundClosedTask.cs [code]
Notifications/cs/BackgroundTasks/ToastNotificationHistoryChangedTriggerTask.cs [code]
Notifications/cs/BackgroundTasks/ToastNotificationQuickReplyTask.cs [code]
Notifications/cs/BackgroundTasks/Helpers/BackgroundTaskStatus.cs [code]
Notifications/cs/BackgroundTasks/Helpers/BackgroundTaskStorage.cs [code]
Notifications/cs/BackgroundTasks/Helpers/BadgeHelper.cs [code]
Notifications/cs/BackgroundTasks/Helpers/Settings.cs [code]
Notifications/cs/BackgroundTasks/Helpers/ToastHelper.cs [code]
Notifications/cs/BackgroundTasks/Properties/AssemblyInfo.cs [code]
Notifications/cs/Notifications/App.xaml.cs [code]
Notifications/cs/Notifications/MainPage.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPage.xaml.cs [code]
Notifications/cs/Notifications/Controls/InstructionControl.cs [code]
Notifications/cs/Notifications/Controls/InstructionsControl.cs [code]
Notifications/cs/Notifications/Controls/PopToastControl.xaml.cs [code]
Notifications/cs/Notifications/Controls/StepsControl.cs [code]
Notifications/cs/Notifications/Controls/StepsHelperControl.cs [code]
Notifications/cs/Notifications/Controls/UpdateFourTilesControl.xaml.cs [code]
Notifications/cs/Notifications/Converters/TypeToUIElementConverter.cs [code]
Notifications/cs/Notifications/Converters/XmlDocumentToStringConverter.cs [code]
Notifications/cs/Notifications/Helpers/BackButtonPage.cs [code]
Notifications/cs/Notifications/Helpers/BindableBase.cs [code]
Notifications/cs/Notifications/Helpers/StringHelper.cs [code]
Notifications/cs/Notifications/Helpers/TilesHelper.cs [code]
Notifications/cs/Notifications/Model/IScenario.cs [code]
Notifications/cs/Notifications/Model/Scenario.cs [code]
Notifications/cs/Notifications/Model/ScenarioGroup.cs [code]
Notifications/cs/Notifications/Model/Scenarios.cs [code]
Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ClearBadge/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeGlyph/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeNumber/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Badges/Local/SecondaryTileBadges/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Default/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Logo/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Name/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/NameAndLogo/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/None/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Custom/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Contact/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/People/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Photos/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppData/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppPackage/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromInternet/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextStyles/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextWrap/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Custom/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/InheritFromPrimary/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Transparent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/CheckAllPropertiesCorrect/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppData/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppPackage/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/FindAllAsync/Visualizer/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ExpiringNotification/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Clearing/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Sending/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/SecondaryTiles/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Pinning/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/UnpinEverything/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/LiveTiles/Updating/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/QuickReply/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/Text/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/TextAndImage/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/DefaultInput/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/PlaceholderContent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/RetrievingArgs/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/Title/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/SystemCommands/SnoozeAndDismiss/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppClosed/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppOpen/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppClosed/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppOpen/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/Protocol/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/AutoContent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/CustomContent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/Dismissing/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/AutoContent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/CustomContent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/Snoozing/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppPackage/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromInternet/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Default/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/EmailSound/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Looping/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Silent/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ExpiringToast/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/GhostToast/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/BadgeControl/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/RespondingToToasts/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Alarm/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Default/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/IncomingCall/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Reminder/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ClearAll/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/GetHistory/Visualizer/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTag/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTagAndGroup/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ByGroup/ScenarioElement.xaml.cs [code]
Notifications/cs/Notifications/ScenarioPages/Toasts/UpdateToast/ScenarioElement.xaml.cs [code]
NumberFormatting/cpp/pch.cpp [code]
NumberFormatting/cpp/pch.h [code]
NumberFormatting/cpp/SampleConfiguration.cpp [code]
NumberFormatting/cpp/SampleConfiguration.h [code]
NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.cpp [code]
NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.h [code]
NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.cpp [code]
NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.h [code]
NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.cpp [code]
NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.h [code]
NumberFormatting/cpp/Scenario4_NumberParsing.xaml.cpp [code]
NumberFormatting/cpp/Scenario4_NumberParsing.xaml.h [code]
NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.cpp [code]
NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.h [code]
NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.cpp [code]
NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.h [code]
NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.cpp [code]
NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.h [code]
NumberFormatting/cppwinrt/pch.cpp [code]
NumberFormatting/cppwinrt/pch.h [code]
NumberFormatting/cppwinrt/Project.idl [code]
NumberFormatting/cppwinrt/SampleConfiguration.cpp [code]
NumberFormatting/cppwinrt/SampleConfiguration.h [code]
NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.cpp [code]
NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.h [code]
NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.cpp [code]
NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.h [code]
NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.cpp [code]
NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.h [code]
NumberFormatting/cppwinrt/Scenario4_NumberParsing.cpp [code]
NumberFormatting/cppwinrt/Scenario4_NumberParsing.h [code]
NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.cpp [code]
NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.h [code]
NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.cpp [code]
NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.h [code]
NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.cpp [code]
NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.h [code]
NumberFormatting/cs/SampleConfiguration.cs [code]
NumberFormatting/cs/Scenario1_PercentPermilleFormatting.xaml.cs [code]
NumberFormatting/cs/Scenario2_DecimalFormatting.xaml.cs [code]
NumberFormatting/cs/Scenario3_CurrencyFormatting.xaml.cs [code]
NumberFormatting/cs/Scenario4_NumberParsing.xaml.cs [code]
NumberFormatting/cs/Scenario5_RoundingAndPadding.xaml.cs [code]
NumberFormatting/cs/Scenario6_NumeralSystemTranslation.xaml.cs [code]
NumberFormatting/cs/Scenario7_UsingUnicodeExtensions.xaml.cs [code]
OCR/cpp/OcrCapturedImage.xaml.cpp [code]
OCR/cpp/OcrCapturedImage.xaml.h [code]
OCR/cpp/OcrFileImage.xaml.cpp [code]
OCR/cpp/OcrFileImage.xaml.h [code]
OCR/cpp/pch.cpp [code]
OCR/cpp/pch.h [code]
OCR/cpp/SampleConfiguration.cpp [code]
OCR/cpp/SampleConfiguration.h [code]
OCR/cpp/WordOverlay.cpp [code]
OCR/cpp/WordOverlay.h [code]
OCR/cppwinrt/OcrCapturedImage.cpp [code]
OCR/cppwinrt/OcrCapturedImage.h [code]
OCR/cppwinrt/OcrFileImage.cpp [code]
OCR/cppwinrt/OcrFileImage.h [code]
OCR/cppwinrt/pch.cpp [code]
OCR/cppwinrt/pch.h [code]
OCR/cppwinrt/Project.idl [code]
OCR/cppwinrt/SampleConfiguration.cpp [code]
OCR/cppwinrt/SampleConfiguration.h [code]
OCR/cppwinrt/WordOverlay.cpp [code]
OCR/cppwinrt/WordOverlay.h [code]
OCR/cs/OcrCapturedImage.xaml.cs [code]
OCR/cs/OcrFileImage.xaml.cs [code]
OCR/cs/SampleConfiguration.cs [code]
OCR/cs/WordOverlay.cs [code]
OnDemandHotspot/cppwinrt/pch.cpp [code]
OnDemandHotspot/cppwinrt/pch.h [code]
OnDemandHotspot/cppwinrt/Project.idl [code]
OnDemandHotspot/cppwinrt/SampleConfiguration.cpp [code]
OnDemandHotspot/cppwinrt/SampleConfiguration.h [code]
OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.cpp [code]
OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.h [code]
OnDemandHotspot/cppwinrt/BackgroundTask/pch.cpp [code]
OnDemandHotspot/cppwinrt/BackgroundTask/pch.h [code]
OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.cpp [code]
OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h [code]
OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.idl [code]
OnDemandHotspot/cs/SampleConfiguration.cs [code]
OnDemandHotspot/cs/Scenario1_ManageHotspot.xaml.cs [code]
OnDemandHotspot/cs/BackgroundTask/Tasks.cs [code]
OnDemandHotspot/cs/BackgroundTask/Properties/AssemblyInfo.cs [code]
OrientationSensor/cpp/CalibrationBar.xaml.cpp [code]
OrientationSensor/cpp/CalibrationBar.xaml.h [code]
OrientationSensor/cpp/pch.cpp [code]
OrientationSensor/cpp/pch.h [code]
OrientationSensor/cpp/SampleConfiguration.cpp [code]
OrientationSensor/cpp/SampleConfiguration.h [code]
OrientationSensor/cpp/Scenario0_Choose.xaml.cpp [code]
OrientationSensor/cpp/Scenario0_Choose.xaml.h [code]
OrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp [code]
OrientationSensor/cpp/Scenario1_DataEvents.xaml.h [code]
OrientationSensor/cpp/Scenario2_Polling.xaml.cpp [code]
OrientationSensor/cpp/Scenario2_Polling.xaml.h [code]
OrientationSensor/cpp/Scenario3_Calibration.xaml.cpp [code]
OrientationSensor/cpp/Scenario3_Calibration.xaml.h [code]
OrientationSensor/cs/CalibrationBar.xaml.cs [code]
OrientationSensor/cs/SampleConfiguration.cs [code]
OrientationSensor/cs/Scenario0_Choose.xaml.cs [code]
OrientationSensor/cs/Scenario1_DataEvents.xaml.cs [code]
OrientationSensor/cs/Scenario2_Polling.xaml.cs [code]
OrientationSensor/cs/Scenario3_Calibration.xaml.cs [code]
Package/cpp/pch.cpp [code]
Package/cpp/pch.h [code]
Package/cpp/SampleConfiguration.cpp [code]
Package/cpp/SampleConfiguration.h [code]
Package/cpp/scenario1_identity.xaml.cpp [code]
Package/cpp/scenario1_identity.xaml.h [code]
Package/cpp/scenario2_installedlocation.xaml.cpp [code]
Package/cpp/scenario2_installedlocation.xaml.h [code]
Package/cpp/scenario3_dependencies.xaml.cpp [code]
Package/cpp/scenario3_dependencies.xaml.h [code]
Package/cs/SampleConfiguration.cs [code]
Package/cs/scenario1_identity.xaml.cs [code]
Package/cs/scenario2_installedlocation.xaml.cs [code]
Package/cs/scenario3_dependencies.xaml.cs [code]
PasswordVault/cpp/pch.cpp [code]
PasswordVault/cpp/pch.h [code]
PasswordVault/cpp/SampleConfiguration.cpp [code]
PasswordVault/cpp/SampleConfiguration.h [code]
PasswordVault/cpp/Scenario1_Save.xaml.cpp [code]
PasswordVault/cpp/Scenario1_Save.xaml.h [code]
PasswordVault/cpp/Scenario2_Manage.xaml.cpp [code]
PasswordVault/cpp/Scenario2_Manage.xaml.h [code]
PasswordVault/cppwinrt/pch.cpp [code]
PasswordVault/cppwinrt/pch.h [code]
PasswordVault/cppwinrt/Project.idl [code]
PasswordVault/cppwinrt/SampleConfiguration.cpp [code]
PasswordVault/cppwinrt/SampleConfiguration.h [code]
PasswordVault/cppwinrt/Scenario1_Save.cpp [code]
PasswordVault/cppwinrt/Scenario1_Save.h [code]
PasswordVault/cppwinrt/Scenario2_Manage.cpp [code]
PasswordVault/cppwinrt/Scenario2_Manage.h [code]
PasswordVault/cs/SampleConfiguration.cs [code]
PasswordVault/cs/Scenario1_Save.xaml.cs [code]
PasswordVault/cs/Scenario2_Manage.xaml.cs [code]
PdfDocument/cpp/pch.cpp [code]
PdfDocument/cpp/pch.h [code]
PdfDocument/cpp/SampleConfiguration.cpp [code]
PdfDocument/cpp/SampleConfiguration.h [code]
PdfDocument/cpp/Scenario1_Render.xaml.cpp [code]
PdfDocument/cpp/Scenario1_Render.xaml.h [code]
PdfDocument/cppwinrt/pch.cpp [code]
PdfDocument/cppwinrt/pch.h [code]
PdfDocument/cppwinrt/Project.idl [code]
PdfDocument/cppwinrt/SampleConfiguration.cpp [code]
PdfDocument/cppwinrt/SampleConfiguration.h [code]
PdfDocument/cppwinrt/Scenario1_Render.cpp [code]
PdfDocument/cppwinrt/Scenario1_Render.h [code]
PdfDocument/cs/SampleConfiguration.cs [code]
PdfDocument/cs/Scenario1_Render.xaml.cs [code]
Pedometer/cpp/pch.cpp [code]
Pedometer/cpp/pch.h [code]
Pedometer/cpp/SampleConfiguration.cpp [code]
Pedometer/cpp/SampleConfiguration.h [code]
Pedometer/cpp/Scenario1_Events.xaml.cpp [code]
Pedometer/cpp/Scenario1_Events.xaml.h [code]
Pedometer/cpp/Scenario2_History.xaml.cpp [code]
Pedometer/cpp/Scenario2_History.xaml.h [code]
Pedometer/cpp/Scenario3_CurrentStepCount.xaml.cpp [code]
Pedometer/cpp/Scenario3_CurrentStepCount.xaml.h [code]
Pedometer/cpp/Scenario4_BackgroundTask.xaml.cpp [code]
Pedometer/cpp/Scenario4_BackgroundTask.xaml.h [code]
Pedometer/cpp/Tasks/pch.cpp [code]
Pedometer/cpp/Tasks/pch.h [code]
Pedometer/cpp/Tasks/PedometerBackgroundTask.cpp [code]
Pedometer/cpp/Tasks/PedometerBackgroundTask.h [code]
Pedometer/cs/SampleConfiguration.cs [code]
Pedometer/cs/Scenario1_Events.xaml.cs [code]
Pedometer/cs/Scenario2_History.xaml.cs [code]
Pedometer/cs/Scenario3_CurrentStepCount.xaml.cs [code]
Pedometer/cs/Scenario4_BackgroundTask.xaml.cs [code]
Pedometer/cs/Tasks/PedometerBackgroundTask.cs [code]
Pedometer/cs/Tasks/Properties/AssemblyInfo.cs [code]
PenHaptics/cppwinrt/pch.cpp [code]
PenHaptics/cppwinrt/pch.h [code]
PenHaptics/cppwinrt/Project.idl [code]
PenHaptics/cppwinrt/SampleConfiguration.cpp [code]
PenHaptics/cppwinrt/SampleConfiguration.h [code]
PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.cpp [code]
PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.h [code]
PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.cpp [code]
PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.h [code]
PenHaptics/cppwinrt/Scenario3_InkingFeedback.cpp [code]
PenHaptics/cppwinrt/Scenario3_InkingFeedback.h [code]
PenHaptics/cppwinrt/Scenario4_InteractionFeedback.cpp [code]
PenHaptics/cppwinrt/Scenario4_InteractionFeedback.h [code]
PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.cpp [code]
PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.h [code]
PenHaptics/cs/SampleConfiguration.cs [code]
PenHaptics/cs/Scenario1_InkCanvasTactileFeedback.xaml.cs [code]
PenHaptics/cs/Scenario2_SupportedTactileFeedback.xaml.cs [code]
PenHaptics/cs/Scenario3_InkingFeedback.xaml.cs [code]
PenHaptics/cs/Scenario4_InteractionFeedback.xaml.cs [code]
PenHaptics/cs/Scenario5_InkingAndInteractionFeedback.xaml.cs [code]
PersonalDataEncryption/cppwinrt/pch.cpp [code]
PersonalDataEncryption/cppwinrt/pch.h [code]
PersonalDataEncryption/cppwinrt/Project.idl [code]
PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp [code]
PersonalDataEncryption/cppwinrt/SampleConfiguration.h [code]
PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp [code]
PersonalDataEncryption/cppwinrt/Scenario1_Files.h [code]
PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp [code]
PersonalDataEncryption/cppwinrt/Scenario2_Memory.h [code]
PersonalDataEncryption/cs/SampleConfiguration.cs [code]
PersonalDataEncryption/cs/Scenario1_Files.xaml.cs [code]
PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs [code]
Personalization/cpp/AddImageFeedScenario.xaml.cpp [code]
Personalization/cpp/AddImageFeedScenario.xaml.h [code]
Personalization/cpp/pch.cpp [code]
Personalization/cpp/pch.h [code]
Personalization/cpp/SampleConfiguration.cpp [code]
Personalization/cpp/SampleConfiguration.h [code]
Personalization/cpp/SetLockScreenImage.xaml.cpp [code]
Personalization/cpp/SetLockScreenImage.xaml.h [code]
Personalization/cs/SampleConfiguration.cs [code]
Personalization/cs/SetLockScreenImage.xaml.cs [code]
Playlists/cpp/pch.cpp [code]
Playlists/cpp/pch.h [code]
Playlists/cpp/SampleConfiguration.cpp [code]
Playlists/cpp/SampleConfiguration.h [code]
Playlists/cpp/Scenario1_Create.xaml.cpp [code]
Playlists/cpp/Scenario1_Create.xaml.h [code]
Playlists/cpp/Scenario2_Display.xaml.cpp [code]
Playlists/cpp/Scenario2_Display.xaml.h [code]
Playlists/cpp/Scenario3_Add.xaml.cpp [code]
Playlists/cpp/Scenario3_Add.xaml.h [code]
Playlists/cpp/Scenario4_Remove.xaml.cpp [code]
Playlists/cpp/Scenario4_Remove.xaml.h [code]
Playlists/cpp/Scenario5_Clear.xaml.cpp [code]
Playlists/cpp/Scenario5_Clear.xaml.h [code]
Playlists/cs/SampleConfiguration.cs [code]
Playlists/cs/Scenario1_Create.xaml.cs [code]
Playlists/cs/Scenario2_Display.xaml.cs [code]
Playlists/cs/Scenario3_Add.xaml.cs [code]
Playlists/cs/Scenario4_Remove.xaml.cs [code]
Playlists/cs/Scenario5_Clear.xaml.cs [code]
PlayReady/cs/SampleConfiguration.cs [code]
PlayReady/cs/Scenario1_ReactiveRequest.xaml.cs [code]
PlayReady/cs/Scenario2_ProactiveRequest.xaml.cs [code]
PlayReady/cs/Scenario3_HardwareDRM.xaml.cs [code]
PlayReady/cs/Scenario4_SecureStop.xaml.cs [code]
PlayReady/cs/Controls/PlayReadyInfo.xaml.cs [code]
PlayReady/cs/Shared/PlayReadyHelpers.cs [code]
PlayReady/cs/Shared/RelayCommand.cs [code]
PlayReady/cs/ViewModels/HardwareDRMViewModel.cs [code]
PlayReady/cs/ViewModels/PlayReadyInfoViewModel.cs [code]
PlayReady/cs/ViewModels/ProactiveViewModel.cs [code]
PlayReady/cs/ViewModels/ReactiveViewModel.cs [code]
PlayReady/cs/ViewModels/SecureStopViewModel.cs [code]
PlayReady/cs/ViewModels/ViewModelBase.cs [code]
PosPrinter/cpp/pch.cpp [code]
PosPrinter/cpp/pch.h [code]
PosPrinter/cpp/SampleConfiguration.cpp [code]
PosPrinter/cpp/SampleConfiguration.h [code]
PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.cpp [code]
PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.h [code]
PosPrinter/cpp/Scenario1_ReceiptPrinter.xaml.cpp [code]
PosPrinter/cpp/Scenario1_ReceiptPrinter.xaml.h [code]
PosPrinter/cpp/Scenario2_PrintReceipt.xaml.cpp [code]
PosPrinter/cpp/Scenario2_PrintReceipt.xaml.h [code]
PosPrinter/cpp/Scenario3_MultipleClaims.xaml.cpp [code]
PosPrinter/cpp/Scenario3_MultipleClaims.xaml.h [code]
PosPrinter/cs/SampleConfiguration.cs [code]
PosPrinter/cs/Scenario1_FindClaimEnable.xaml.cs [code]
PosPrinter/cs/Scenario2_PrintReceipt.xaml.cs [code]
PosPrinter/cs/Scenario3_MultipleClaims.xaml.cs [code]
PresenceSensor/cppwinrt/pch.cpp [code]
PresenceSensor/cppwinrt/pch.h [code]
PresenceSensor/cppwinrt/Project.idl [code]
PresenceSensor/cppwinrt/SampleConfiguration.cpp [code]
PresenceSensor/cppwinrt/SampleConfiguration.h [code]
PresenceSensor/cppwinrt/Scenario1_DataEvents.cpp [code]
PresenceSensor/cppwinrt/Scenario1_DataEvents.h [code]
PresenceSensor/cppwinrt/Scenario2_Polling.cpp [code]
PresenceSensor/cppwinrt/Scenario2_Polling.h [code]
PresenceSensor/cppwinrt/Scenario3_Choosing.cpp [code]
PresenceSensor/cppwinrt/Scenario3_Choosing.h [code]
PresenceSensor/cs/SampleConfiguration.cs [code]
PresenceSensor/cs/Scenario1_DataEvents.xaml.cs [code]
PresenceSensor/cs/Scenario2_Polling.xaml.cs [code]
PresenceSensor/cs/Scenario3_Choosing.xaml.cs [code]
Printing/cpp/ContinuationPage.xaml.cpp [code]
Printing/cpp/ContinuationPage.xaml.h [code]
Printing/cpp/PageToPrint.xaml.cpp [code]
Printing/cpp/PageToPrint.xaml.h [code]
Printing/cpp/pch.cpp [code]
Printing/cpp/pch.h [code]
Printing/cpp/PreviewUnavailable.xaml.cpp [code]
Printing/cpp/PreviewUnavailable.xaml.h [code]
Printing/cpp/PrintHelper.cpp [code]
Printing/cpp/PrintHelper.h [code]
Printing/cpp/SampleConfiguration.cpp [code]
Printing/cpp/SampleConfiguration.h [code]
Printing/cpp/Scenario1Basic.xaml.cpp [code]
Printing/cpp/Scenario1Basic.xaml.h [code]
Printing/cpp/Scenario2StandardOptions.xaml.cpp [code]
Printing/cpp/Scenario2StandardOptions.xaml.h [code]
Printing/cpp/Scenario3CustomOptions.xaml.cpp [code]
Printing/cpp/Scenario3CustomOptions.xaml.h [code]
Printing/cpp/Scenario4PageRange.xaml.cpp [code]
Printing/cpp/Scenario4PageRange.xaml.h [code]
Printing/cpp/Scenario5Photos.xaml.cpp [code]
Printing/cpp/Scenario5Photos.xaml.h [code]
Printing/cpp/Scenario6DisablePreview.xaml.cpp [code]
Printing/cpp/Scenario6DisablePreview.xaml.h [code]
Printing/cs/ContinuationPage.xaml.cs [code]
Printing/cs/PageToPrint.xaml.cs [code]
Printing/cs/PreviewUnavailable.xaml.cs [code]
Printing/cs/PrintHelper.cs [code]
Printing/cs/SampleConfiguration.cs [code]
Printing/cs/Scenario1Basic.xaml.cs [code]
Printing/cs/Scenario2StandardOptons.xaml.cs [code]
Printing/cs/Scenario3CustomOptions.xaml.cs [code]
Printing/cs/Scenario4PageRange.xaml.cs [code]
Printing/cs/Scenario5Photos.xaml.cs [code]
Printing/cs/Scenario6DisablePreview.xaml.cs [code]
Projection/cpp/App.xaml.cpp [code]
Projection/cpp/App.xaml.h [code]
Projection/cpp/MainPage.xaml.cpp [code]
Projection/cpp/MainPage.xaml.h [code]
Projection/cpp/pch.cpp [code]
Projection/cpp/pch.h [code]
Projection/cpp/ProjectionViewPage.xaml.cpp [code]
Projection/cpp/ProjectionViewPage.xaml.h [code]
Projection/cpp/SampleConfiguration.cpp [code]
Projection/cpp/SampleConfiguration.h [code]
Projection/cpp/Scenario1.xaml.cpp [code]
Projection/cpp/Scenario1.xaml.h [code]
Projection/cpp/Scenario2.xaml.cpp [code]
Projection/cpp/Scenario2.xaml.h [code]
Projection/cpp/Scenario3.xaml.cpp [code]
Projection/cpp/Scenario3.xaml.h [code]
Projection/cpp/ViewLifetimeControl.cpp [code]
Projection/cpp/ViewLifetimeControl.h [code]
Projection/cs/App.xaml.cs [code]
Projection/cs/MainPage.xaml.cs [code]
Projection/cs/ProjectionViewPage.xaml.cs [code]
Projection/cs/SampleConfiguration.cs [code]
Projection/cs/Scenario1.xaml.cs [code]
Projection/cs/Scenario2.xaml.cs [code]
Projection/cs/Scenario3.xaml.cs [code]
Projection/cs/ViewLifetimeControl.cs [code]
ProximitySensor/cpp/pch.cpp [code]
ProximitySensor/cpp/pch.h [code]
ProximitySensor/cpp/SampleConfiguration.cpp [code]
ProximitySensor/cpp/SampleConfiguration.h [code]
ProximitySensor/cpp/Scenario1_DataEvents.xaml.cpp [code]
ProximitySensor/cpp/Scenario1_DataEvents.xaml.h [code]
ProximitySensor/cpp/Scenario2_Polling.xaml.cpp [code]
ProximitySensor/cpp/Scenario2_Polling.xaml.h [code]
ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.cpp [code]
ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.h [code]
ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.cpp [code]
ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.h [code]
ProximitySensor/cpp/Tasks/pch.cpp [code]
ProximitySensor/cpp/Tasks/pch.h [code]
ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.cpp [code]
ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.h [code]
ProximitySensor/cs/SampleConfiguration.cs [code]
ProximitySensor/cs/Scenario1_DataEvents.xaml.cs [code]
ProximitySensor/cs/Scenario2_Polling.xaml.cs [code]
ProximitySensor/cs/Scenario3_DisplayOnOff.xaml.cs [code]
ProximitySensor/cs/Scenario4_BackgroundProximitySensor.xaml.cs [code]
ProximitySensor/cs/Tasks/ProximitySensorBackgroundTask.cs [code]
ProximitySensor/cs/Tasks/Properties/AssemblyInfo.cs [code]
ProxyStubsForWinRTComponents/cpp/cpp/pch.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/pch.h [code]
ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.h [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.h [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.h [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.h [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp [code]
ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h [code]
ProxyStubsForWinRTComponents/cpp/cs/SampleConfiguration.cs [code]
ProxyStubsForWinRTComponents/cpp/cs/Scenario1_OvenClient.xaml.cs [code]
ProxyStubsForWinRTComponents/cpp/cs/Scenario2_CustomException.xaml.cs [code]
ProxyStubsForWinRTComponents/cpp/Server/BreadServer.cpp [code]
ProxyStubsForWinRTComponents/cpp/Server/BreadServer.h [code]
ProxyStubsForWinRTComponents/cpp/Server/BreadTypes.h [code]
ProxyStubsForWinRTComponents/cpp/Server/OvenServer.cpp [code]
ProxyStubsForWinRTComponents/cpp/Server/OvenServer.h [code]
ProxyStubsForWinRTComponents/cpp/Server/pch.cpp [code]
ProxyStubsForWinRTComponents/cpp/Server/pch.h [code]
ProxyStubsForWinRTComponents/cs/cpp/pch.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/pch.h [code]
ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.h [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario1_OvenClient.xaml.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario1_OvenClient.xaml.h [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario2_OvenClientWRL.xaml.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario2_OvenClientWRL.xaml.h [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.h [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.cpp [code]
ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.h [code]
ProxyStubsForWinRTComponents/cs/cs/SampleConfiguration.cs [code]
ProxyStubsForWinRTComponents/cs/cs/Scenario1_OvenClient.xaml.cs [code]
ProxyStubsForWinRTComponents/cs/cs/Scenario2_CustomException.xaml.cs [code]
ProxyStubsForWinRTComponents/cs/Server/BreadServer.cs [code]
ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs [code]
ProxyStubsForWinRTComponents/cs/Server/Properties/AssemblyInfo.cs [code]
RadialController/cpp/pch.cpp [code]
RadialController/cpp/pch.h [code]
RadialController/cpp/SampleConfiguration.cpp [code]
RadialController/cpp/SampleConfiguration.h [code]
RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.cpp [code]
RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.h [code]
RadialController/cs/SampleConfiguration.cs [code]
RadialController/cs/Scenario1_EventAndMenuHookup.xaml.cs [code]
RadialController/cs/Scenario2_SystemDefaultMenu.xaml.cs [code]
RadioManager/cppwinrt/pch.cpp [code]
RadioManager/cppwinrt/pch.h [code]
RadioManager/cppwinrt/Project.idl [code]
RadioManager/cppwinrt/RadioModel.cpp [code]
RadioManager/cppwinrt/RadioModel.h [code]
RadioManager/cppwinrt/SampleConfiguration.cpp [code]
RadioManager/cppwinrt/SampleConfiguration.h [code]
RadioManager/cppwinrt/Scenario1_Toggle.cpp [code]
RadioManager/cppwinrt/Scenario1_Toggle.h [code]
RadioManager/cs/RadioModel.cs [code]
RadioManager/cs/SampleConfiguration.cs [code]
RadioManager/cs/Scenario1_Toggle.xaml.cs [code]
RelativeInclinometer/cpp/pch.cpp [code]
RelativeInclinometer/cpp/pch.h [code]
RelativeInclinometer/cpp/SampleConfiguration.cpp [code]
RelativeInclinometer/cpp/SampleConfiguration.h [code]
RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.cpp [code]
RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.h [code]
RelativeInclinometer/cpp/Scenario2_Polling.xaml.cpp [code]
RelativeInclinometer/cpp/Scenario2_Polling.xaml.h [code]
RelativeInclinometer/cs/SampleConfiguration.cs [code]
RelativeInclinometer/cs/Scenario1_DataEvents.xaml.cs [code]
RelativeInclinometer/cs/Scenario2_Polling.xaml.cs [code]
RemoteSystems/cs/BooleanToVisibilityConverter.cs [code]
RemoteSystems/cs/SampleConfiguration.cs [code]
RemoteSystems/cs/Scenario1_Discovery.xaml.cs [code]
RemoteSystems/cs/Scenario2_LaunchUri.xaml.cs [code]
RemoteSystems/cs/Scenario3_LaunchAppServices.xaml.cs [code]
RemoteSystems/cs/Scenario4_Settings.xaml.cs [code]
RemoteSystems/cs/Scenario5_Capabilities.xaml.cs [code]
ResizeAppView/cpp/pch.cpp [code]
ResizeAppView/cpp/pch.h [code]
ResizeAppView/cpp/SampleConfiguration.cpp [code]
ResizeAppView/cpp/SampleConfiguration.h [code]
ResizeAppView/cpp/Scenario1_Basic.xaml.cpp [code]
ResizeAppView/cpp/Scenario1_Basic.xaml.h [code]
ResizeAppView/cpp/Scenario2_Launch.xaml.cpp [code]
ResizeAppView/cpp/Scenario2_Launch.xaml.h [code]
ResizeAppView/cppwinrt/pch.cpp [code]
ResizeAppView/cppwinrt/pch.h [code]
ResizeAppView/cppwinrt/Project.idl [code]
ResizeAppView/cppwinrt/SampleConfiguration.cpp [code]
ResizeAppView/cppwinrt/SampleConfiguration.h [code]
ResizeAppView/cppwinrt/Scenario1_Basic.cpp [code]
ResizeAppView/cppwinrt/Scenario1_Basic.h [code]
ResizeAppView/cppwinrt/Scenario2_Launch.cpp [code]
ResizeAppView/cppwinrt/Scenario2_Launch.h [code]
ResizeAppView/cs/SampleConfiguration.cs [code]
ResizeAppView/cs/Scenario1_Basic.xaml.cs [code]
ResizeAppView/cs/Scenario2_Launch.xaml.cs [code]
SecondaryTiles/cppwinrt/pch.cpp [code]
SecondaryTiles/cppwinrt/pch.h [code]
SecondaryTiles/cppwinrt/Project.idl [code]
SecondaryTiles/cppwinrt/SampleConfiguration.cpp [code]
SecondaryTiles/cppwinrt/SampleConfiguration.h [code]
SecondaryTiles/cppwinrt/Scenario1_PinTile.cpp [code]
SecondaryTiles/cppwinrt/Scenario1_PinTile.h [code]
SecondaryTiles/cppwinrt/Scenario2_UnpinTile.cpp [code]
SecondaryTiles/cppwinrt/Scenario2_UnpinTile.h [code]
SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.cpp [code]
SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.h [code]
SecondaryTiles/cppwinrt/Scenario4_TilePinned.cpp [code]
SecondaryTiles/cppwinrt/Scenario4_TilePinned.h [code]
SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.cpp [code]
SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.h [code]
SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.cpp [code]
SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.h [code]
SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.cpp [code]
SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.h [code]
SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.cpp [code]
SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.h [code]
SecondaryTiles/cs/SampleConfiguration.cs [code]
SecondaryTiles/cs/Scenario1_PinTile.xaml.cs [code]
SecondaryTiles/cs/Scenario2_UnpinTile.xaml.cs [code]
SecondaryTiles/cs/Scenario3_EnumerateTiles.xaml.cs [code]
SecondaryTiles/cs/Scenario4_TilePinned.xaml.cs [code]
SecondaryTiles/cs/Scenario5_LaunchedFromSecondaryTile.xaml.cs [code]
SecondaryTiles/cs/Scenario6_SecondaryTileNotification.xaml.cs [code]
SecondaryTiles/cs/Scenario7_PinFromAppbar.xaml.cs [code]
SecondaryTiles/cs/Scenario8_UpdateAsync.xaml.cs [code]
SemanticTextQuery/cpp/Find.xaml.cpp [code]
SemanticTextQuery/cpp/Find.xaml.h [code]
SemanticTextQuery/cpp/FindInProperty.xaml.cpp [code]
SemanticTextQuery/cpp/FindInProperty.xaml.h [code]
SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.cpp [code]
SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.h [code]
SemanticTextQuery/cpp/pch.cpp [code]
SemanticTextQuery/cpp/pch.h [code]
SemanticTextQuery/cpp/SampleConfiguration.cpp [code]
SemanticTextQuery/cpp/SampleConfiguration.h [code]
SemanticTextQuery/cs/Find.xaml.cs [code]
SemanticTextQuery/cs/FindInProperty.xaml.cs [code]
SemanticTextQuery/cs/GetMatchingPropertiesWithRanges.xaml.cs [code]
SemanticTextQuery/cs/SampleConfiguration.cs [code]
SerialArduino/cs/Constants.cs [code]
SerialArduino/cs/DeviceListEntry.cs [code]
SerialArduino/cs/EventHandlerForDevice.cs [code]
SerialArduino/cs/SampleConfiguration.cs [code]
SerialArduino/cs/Scenario1_ConnectDisconnect.xaml.cs [code]
SerialArduino/cs/Scenario2_LEDTemp.xaml.cs [code]
SerialArduino/cs/Utilities.cs [code]
ShareSource/cpp/pch.cpp [code]
ShareSource/cpp/pch.h [code]
ShareSource/cpp/SampleConfiguration.cpp [code]
ShareSource/cpp/SampleConfiguration.h [code]
ShareSource/cpp/SetErrorMessage.xaml.cpp [code]
ShareSource/cpp/SetErrorMessage.xaml.h [code]
ShareSource/cpp/ShareApplicationLink.xaml.cpp [code]
ShareSource/cpp/ShareApplicationLink.xaml.h [code]
ShareSource/cpp/ShareCustomData.xaml.cpp [code]
ShareSource/cpp/ShareCustomData.xaml.h [code]
ShareSource/cpp/ShareCustomProvider.xaml.cpp [code]
ShareSource/cpp/ShareCustomProvider.xaml.h [code]
ShareSource/cpp/ShareDelayRenderedFiles.xaml.cpp [code]
ShareSource/cpp/ShareDelayRenderedFiles.xaml.h [code]
ShareSource/cpp/ShareFiles.xaml.cpp [code]
ShareSource/cpp/ShareFiles.xaml.h [code]
ShareSource/cpp/ShareHtml.xaml.cpp [code]
ShareSource/cpp/ShareHtml.xaml.h [code]
ShareSource/cpp/ShareImage.xaml.cpp [code]
ShareSource/cpp/ShareImage.xaml.h [code]
ShareSource/cpp/SharePage.cpp [code]
ShareSource/cpp/SharePage.h [code]
ShareSource/cpp/ShareText.xaml.cpp [code]
ShareSource/cpp/ShareText.xaml.h [code]
ShareSource/cpp/ShareWebLink.xaml.cpp [code]
ShareSource/cpp/ShareWebLink.xaml.h [code]
ShareSource/cs/SampleConfiguration.cs [code]
ShareSource/cs/SetErrorMessage.xaml.cs [code]
ShareSource/cs/ShareApplicationLink.xaml.cs [code]
ShareSource/cs/ShareCustomData.xaml.cs [code]
ShareSource/cs/ShareCustomProvider.xaml.cs [code]
ShareSource/cs/ShareDelayRenderedFiles.xaml.cs [code]
ShareSource/cs/ShareFiles.xaml.cs [code]
ShareSource/cs/ShareHtml.xaml.cs [code]
ShareSource/cs/ShareImage.xaml.cs [code]
ShareSource/cs/SharePage.cs [code]
ShareSource/cs/ShareText.xaml.cs [code]
ShareSource/cs/ShareWebLink.xaml.cs [code]
ShareTarget/cs/SampleConfiguration.cs [code]
ShareTarget/cs/Scenario1_Welcome.xaml.cs [code]
ShareTarget/cs/ShareTarget.xaml.cs [code]
Simple3DGameDX/cpp/App.cpp [code]
Simple3DGameDX/cpp/App.h [code]
Simple3DGameDX/cpp/GameHud.cpp [code]
Simple3DGameDX/cpp/GameHud.h [code]
Simple3DGameDX/cpp/GameInfoOverlay.cpp [code]
Simple3DGameDX/cpp/GameInfoOverlay.h [code]
Simple3DGameDX/cpp/GameMain.cpp [code]
Simple3DGameDX/cpp/GameMain.h [code]
Simple3DGameDX/cpp/GameRenderer.cpp [code]
Simple3DGameDX/cpp/GameRenderer.h [code]
Simple3DGameDX/cpp/GameUIConstants.h [code]
Simple3DGameDX/cpp/GameUIControl.h [code]
Simple3DGameDX/cpp/Simple3DGame.cpp [code]
Simple3DGameDX/cpp/Simple3DGame.h [code]
Simple3DGameDX/cpp/Common/BasicLoader.cpp [code]
Simple3DGameDX/cpp/Common/BasicLoader.h [code]
Simple3DGameDX/cpp/Common/BasicMath.h [code]
Simple3DGameDX/cpp/Common/BasicReaderWriter.cpp [code]
Simple3DGameDX/cpp/Common/BasicReaderWriter.h [code]
Simple3DGameDX/cpp/Common/BasicShapes.h [code]
Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp [code]
Simple3DGameDX/cpp/Common/DDSTextureLoader.h [code]
Simple3DGameDX/cpp/Common/DeviceResources.cpp [code]
Simple3DGameDX/cpp/Common/DeviceResources.h [code]
Simple3DGameDX/cpp/Common/DirectXSample.h [code]
Simple3DGameDX/cpp/Common/PersistentState.cpp [code]
Simple3DGameDX/cpp/Common/PersistentState.h [code]
Simple3DGameDX/cppwinrt/App.cpp [code]
Simple3DGameDX/cppwinrt/GameHud.cpp [code]
Simple3DGameDX/cppwinrt/GameHud.h [code]
Simple3DGameDX/cppwinrt/GameInfoOverlay.cpp [code]
Simple3DGameDX/cppwinrt/GameInfoOverlay.h [code]
Simple3DGameDX/cppwinrt/GameMain.cpp [code]
Simple3DGameDX/cppwinrt/GameMain.h [code]
Simple3DGameDX/cppwinrt/GameRenderer.cpp [code]
Simple3DGameDX/cppwinrt/GameRenderer.h [code]
Simple3DGameDX/cppwinrt/GameUIConstants.h [code]
Simple3DGameDX/cppwinrt/GameUIControl.h [code]
Simple3DGameDX/cppwinrt/pch.cpp [code]
Simple3DGameDX/cppwinrt/pch.h [code]
Simple3DGameDX/cppwinrt/Simple3DGame.cpp [code]
Simple3DGameDX/cppwinrt/Simple3DGame.h [code]
Simple3DGameDX/cppwinrt/Common/BasicLoader.cpp [code]
Simple3DGameDX/cppwinrt/Common/BasicLoader.h [code]
Simple3DGameDX/cppwinrt/Common/BasicMath.h [code]
Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.cpp [code]
Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.h [code]
Simple3DGameDX/cppwinrt/Common/BasicShapes.h [code]
Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.cpp [code]
Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.h [code]
Simple3DGameDX/cppwinrt/Common/DeviceResources.cpp [code]
Simple3DGameDX/cppwinrt/Common/DeviceResources.h [code]
Simple3DGameDX/cppwinrt/Common/DirectXSample.h [code]
Simple3DGameDX/cppwinrt/Common/PersistentState.cpp [code]
Simple3DGameDX/cppwinrt/Common/PersistentState.h [code]
Simple3DGameDX/cppwinrt/GameContent/Animate.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Animate.h [code]
Simple3DGameDX/cppwinrt/GameContent/Audio.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Audio.h [code]
Simple3DGameDX/cppwinrt/GameContent/Camera.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Camera.h [code]
Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h [code]
Simple3DGameDX/cppwinrt/GameContent/Cylinder.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Cylinder.h [code]
Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.h [code]
Simple3DGameDX/cppwinrt/GameContent/Face.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Face.h [code]
Simple3DGameDX/cppwinrt/GameContent/FaceMesh.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/FaceMesh.h [code]
Simple3DGameDX/cppwinrt/GameContent/GameConstants.h [code]
Simple3DGameDX/cppwinrt/GameContent/GameObject.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/GameObject.h [code]
Simple3DGameDX/cppwinrt/GameContent/GameTimer.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/GameTimer.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level1.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level1.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level2.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level2.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level3.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level3.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level4.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level4.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level5.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level5.h [code]
Simple3DGameDX/cppwinrt/GameContent/Level6.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Level6.h [code]
Simple3DGameDX/cppwinrt/GameContent/Material.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Material.h [code]
Simple3DGameDX/cppwinrt/GameContent/MediaReader.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/MediaReader.h [code]
Simple3DGameDX/cppwinrt/GameContent/MeshObject.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/MeshObject.h [code]
Simple3DGameDX/cppwinrt/GameContent/MoveLookController.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/MoveLookController.h [code]
Simple3DGameDX/cppwinrt/GameContent/SoundEffect.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/SoundEffect.h [code]
Simple3DGameDX/cppwinrt/GameContent/Sphere.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/Sphere.h [code]
Simple3DGameDX/cppwinrt/GameContent/SphereMesh.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/SphereMesh.h [code]
Simple3DGameDX/cppwinrt/GameContent/StereoProjection.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/StereoProjection.h [code]
Simple3DGameDX/cppwinrt/GameContent/TargetTexture.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/TargetTexture.h [code]
Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp [code]
Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h [code]
Simple3DGameXaml/cpp/App.xaml.cpp [code]
Simple3DGameXaml/cpp/App.xaml.h [code]
Simple3DGameXaml/cpp/DirectXPage.xaml.cpp [code]
Simple3DGameXaml/cpp/DirectXPage.xaml.h [code]
Simple3DGameXaml/cpp/GameHud.cpp [code]
Simple3DGameXaml/cpp/GameHud.h [code]
Simple3DGameXaml/cpp/GameMain.cpp [code]
Simple3DGameXaml/cpp/GameMain.h [code]
Simple3DGameXaml/cpp/GameRenderer.cpp [code]
Simple3DGameXaml/cpp/GameRenderer.h [code]
Simple3DGameXaml/cpp/GameUIConstants.h [code]
Simple3DGameXaml/cpp/GameUIControl.h [code]
Simple3DGameXaml/cpp/ProductItem.cpp [code]
Simple3DGameXaml/cpp/ProductItem.h [code]
Simple3DGameXaml/cpp/Simple3DGame.cpp [code]
Simple3DGameXaml/cpp/Simple3DGame.h [code]
Simple3DGameXaml/cpp/Common/BasicLoader.cpp [code]
Simple3DGameXaml/cpp/Common/BasicLoader.h [code]
Simple3DGameXaml/cpp/Common/BasicMath.h [code]
Simple3DGameXaml/cpp/Common/BasicReaderWriter.cpp [code]
Simple3DGameXaml/cpp/Common/BasicReaderWriter.h [code]
Simple3DGameXaml/cpp/Common/BasicShapes.h [code]
Simple3DGameXaml/cpp/Common/DDSTextureLoader.cpp [code]
Simple3DGameXaml/cpp/Common/DDSTextureLoader.h [code]
Simple3DGameXaml/cpp/Common/DeviceResources.cpp [code]
Simple3DGameXaml/cpp/Common/DeviceResources.h [code]
Simple3DGameXaml/cpp/Common/DirectXSample.h [code]
Simple3DGameXaml/cpp/Common/PersistentState.cpp [code]
Simple3DGameXaml/cpp/Common/PersistentState.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/AsyncCB.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BaseAttributes.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/CritSec.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkServer.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkServer.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/OpQueue.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/pch.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/pch.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Trace.cpp [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Trace.h [code]
SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Validation.cpp [code]
SimpleCommunication/cpp/pch.cpp [code]
SimpleCommunication/cpp/pch.h [code]
SimpleCommunication/cpp/SampleConfiguration.cpp [code]
SimpleCommunication/cpp/SampleConfiguration.h [code]
SimpleCommunication/cpp/Scenario1_LowLatency.xaml.cpp [code]
SimpleCommunication/cpp/Scenario1_LowLatency.xaml.h [code]
SimpleCommunication/cpp/Scenario2_VideoChat.xaml.cpp [code]
SimpleCommunication/cpp/Scenario2_VideoChat.xaml.h [code]
SimpleCommunication/cpp/Utils.cpp [code]
SimpleCommunication/cpp/Utils.h [code]
SimpleCommunication/cs/CaptureDevice.cs [code]
SimpleCommunication/cs/SampleConfiguration.cs [code]
SimpleCommunication/cs/Scenario1_LowLatency.xaml.cs [code]
SimpleCommunication/cs/Scenario2_VideoChat.xaml.cs [code]
SimpleImaging/cs/Helpers.cs [code]
SimpleImaging/cs/SampleConfiguration.cs [code]
SimpleImaging/cs/Scenario1.xaml.cs [code]
SimpleImaging/cs/Scenario2.xaml.cs [code]
SimpleInk/cpp/pch.cpp [code]
SimpleInk/cpp/pch.h [code]
SimpleInk/cpp/RecognizerHelper.cpp [code]
SimpleInk/cpp/RecognizerHelper.h [code]
SimpleInk/cpp/SampleConfiguration.cpp [code]
SimpleInk/cpp/SampleConfiguration.h [code]
SimpleInk/cpp/Scenario1.xaml.cpp [code]
SimpleInk/cpp/Scenario1.xaml.h [code]
SimpleInk/cpp/Scenario10.xaml.cpp [code]
SimpleInk/cpp/Scenario10.xaml.h [code]
SimpleInk/cpp/Scenario11.xaml.cpp [code]
SimpleInk/cpp/Scenario11.xaml.h [code]
SimpleInk/cpp/Scenario12.xaml.cpp [code]
SimpleInk/cpp/Scenario12.xaml.h [code]
SimpleInk/cpp/Scenario2.xaml.cpp [code]
SimpleInk/cpp/Scenario2.xaml.h [code]
SimpleInk/cpp/Scenario3.xaml.cpp [code]
SimpleInk/cpp/Scenario3.xaml.h [code]
SimpleInk/cpp/Scenario4.xaml.cpp [code]
SimpleInk/cpp/Scenario4.xaml.h [code]
SimpleInk/cpp/Scenario5.xaml.cpp [code]
SimpleInk/cpp/Scenario5.xaml.h [code]
SimpleInk/cpp/Scenario6.xaml.cpp [code]
SimpleInk/cpp/Scenario6.xaml.h [code]
SimpleInk/cpp/Scenario7.xaml.cpp [code]
SimpleInk/cpp/Scenario7.xaml.h [code]
SimpleInk/cpp/Scenario8.xaml.cpp [code]
SimpleInk/cpp/Scenario8.xaml.h [code]
SimpleInk/cpp/Scenario9.xaml.cpp [code]
SimpleInk/cpp/Scenario9.xaml.h [code]
SimpleInk/cs/RecognizerHelper.cs [code]
SimpleInk/cs/SampleConfiguration.cs [code]
SimpleInk/cs/Scenario1.xaml.cs [code]
SimpleInk/cs/Scenario10.xaml.cs [code]
SimpleInk/cs/Scenario11.xaml.cs [code]
SimpleInk/cs/Scenario12.xaml.cs [code]
SimpleInk/cs/Scenario2.xaml.cs [code]
SimpleInk/cs/Scenario3.xaml.cs [code]
SimpleInk/cs/Scenario4.xaml.cs [code]
SimpleInk/cs/Scenario5.xaml.cs [code]
SimpleInk/cs/Scenario6.xaml.cs [code]
SimpleInk/cs/Scenario7.xaml.cs [code]
SimpleInk/cs/Scenario8.xaml.cs [code]
SimpleInk/cs/Scenario9.xaml.cs [code]
SimpleOrientationSensor/cpp/pch.cpp [code]
SimpleOrientationSensor/cpp/pch.h [code]
SimpleOrientationSensor/cpp/SampleConfiguration.cpp [code]
SimpleOrientationSensor/cpp/SampleConfiguration.h [code]
SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp [code]
SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.h [code]
SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.cpp [code]
SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.h [code]
SimpleOrientationSensor/cs/SampleConfiguration.cs [code]
SimpleOrientationSensor/cs/Scenario1_DataEvents.xaml.cs [code]
SimpleOrientationSensor/cs/Scenario2_Polling.xaml.cs [code]
SmartCard/cpp/ChallengeResponseAlgorithm.cpp [code]
SmartCard/cpp/ChallengeResponseAlgorithm.h [code]
SmartCard/cpp/pch.cpp [code]
SmartCard/cpp/pch.h [code]
SmartCard/cpp/SampleConfiguration.cpp [code]
SmartCard/cpp/SampleConfiguration.h [code]
SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.cpp [code]
SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.h [code]
SmartCard/cpp/Scenario2_ChangePin.xaml.cpp [code]
SmartCard/cpp/Scenario2_ChangePin.xaml.h [code]
SmartCard/cpp/Scenario3_ResetPin.xaml.cpp [code]
SmartCard/cpp/Scenario3_ResetPin.xaml.h [code]
SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.cpp [code]
SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.h [code]
SmartCard/cpp/Scenario5_VerifyResponse.xaml.cpp [code]
SmartCard/cpp/Scenario5_VerifyResponse.xaml.h [code]
SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.cpp [code]
SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.h [code]
SmartCard/cpp/Scenario7_ListSmartCards.xaml.cpp [code]
SmartCard/cpp/Scenario7_ListSmartCards.xaml.h [code]
SmartCard/cpp/Scenario8_Transmit.xaml.cpp [code]
SmartCard/cpp/Scenario8_Transmit.xaml.h [code]
SmartCard/cppwinrt/pch.cpp [code]
SmartCard/cppwinrt/pch.h [code]
SmartCard/cppwinrt/Project.idl [code]
SmartCard/cppwinrt/SampleConfiguration.cpp [code]
SmartCard/cppwinrt/SampleConfiguration.h [code]
SmartCard/cppwinrt/Scenario1_ProvisionTPM.cpp [code]
SmartCard/cppwinrt/Scenario1_ProvisionTPM.h [code]
SmartCard/cppwinrt/Scenario2_ChangePIN.cpp [code]
SmartCard/cppwinrt/Scenario2_ChangePIN.h [code]
SmartCard/cppwinrt/Scenario3_ResetPIN.cpp [code]
SmartCard/cppwinrt/Scenario3_ResetPIN.h [code]
SmartCard/cppwinrt/Scenario4_ChangeAdminKey.cpp [code]
SmartCard/cppwinrt/Scenario4_ChangeAdminKey.h [code]
SmartCard/cppwinrt/Scenario5_VerifyResponse.cpp [code]
SmartCard/cppwinrt/Scenario5_VerifyResponse.h [code]
SmartCard/cppwinrt/Scenario6_DeleteTPM.cpp [code]
SmartCard/cppwinrt/Scenario6_DeleteTPM.h [code]
SmartCard/cppwinrt/Scenario7_ListAllCards.cpp [code]
SmartCard/cppwinrt/Scenario7_ListAllCards.h [code]
SmartCard/cppwinrt/Scenario8_TransmitAPDU.cpp [code]
SmartCard/cppwinrt/Scenario8_TransmitAPDU.h [code]
SmartCard/cppwinrt/SmartCardHelpers.cpp [code]
SmartCard/cppwinrt/SmartCardHelpers.h [code]
SmartCard/cs/ChallengeResponseAlgorithm.cs [code]
SmartCard/cs/SampleConfiguration.cs [code]
SmartCard/cs/Scenario1_ProvisionTPM.xaml.cs [code]
SmartCard/cs/Scenario2_ChangePIN.xaml.cs [code]
SmartCard/cs/Scenario3_ResetPIN.xaml.cs [code]
SmartCard/cs/Scenario4_ChangeAdminKey.xaml.cs [code]
SmartCard/cs/Scenario5_VerifyResponse.xaml.cs [code]
SmartCard/cs/Scenario6_DeleteTPM.xaml.cs [code]
SmartCard/cs/Scenario7_ListAllCards.xaml.cs [code]
SmartCard/cs/Scenario8_TransmitAPDU.xaml.cs [code]
SmsSendAndReceive/cs/SmsBackgroundTask/SmsBackgroundTask.cs [code]
SmsSendAndReceive/cs/SmsBackgroundTask/Properties/AssemblyInfo.cs [code]
SmsSendAndReceive/cs/SmsSendAndReceive/RegisterWithBackgroundTask.xaml.cs [code]
SmsSendAndReceive/cs/SmsSendAndReceive/SampleConfiguration.cs [code]
SmsSendAndReceive/cs/SmsSendAndReceive/SendTextMessage.xaml.cs [code]
SocketActivityStreamSocket/cs/Server/SampleConfiguration.cs [code]
SocketActivityStreamSocket/cs/Server/Scenario1_Send.xaml.cs [code]
SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/SocketActivityTask.cs [code]
SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/Properties/AssemblyInfo.cs [code]
SocketActivityStreamSocket/cs/SocketActivityStreamSocket/SampleConfiguration.cs [code]
SocketActivityStreamSocket/cs/SocketActivityStreamSocket/Scenario1_Connect.xaml.cs [code]
SpatialInteractionSource/cpp/AppView.cpp [code]
SpatialInteractionSource/cpp/AppView.h [code]
SpatialInteractionSource/cpp/DPadHelper.cpp [code]
SpatialInteractionSource/cpp/DPadHelper.h [code]
SpatialInteractionSource/cpp/HandHandler.cpp [code]
SpatialInteractionSource/cpp/HandHandler.h [code]
SpatialInteractionSource/cpp/HolographicPaintMain.cpp [code]
SpatialInteractionSource/cpp/HolographicPaintMain.h [code]
SpatialInteractionSource/cpp/pch.cpp [code]
SpatialInteractionSource/cpp/pch.h [code]
SpatialInteractionSource/cpp/SourceHandler.cpp [code]
SpatialInteractionSource/cpp/SourceHandler.h [code]
SpatialInteractionSource/cpp/SpatialControllerHandler.cpp [code]
SpatialInteractionSource/cpp/SpatialControllerHandler.h [code]
SpatialInteractionSource/cpp/Common/CameraResources.cpp [code]
SpatialInteractionSource/cpp/Common/CameraResources.h [code]
SpatialInteractionSource/cpp/Common/DeviceResources.cpp [code]
SpatialInteractionSource/cpp/Common/DeviceResources.h [code]
SpatialInteractionSource/cpp/Common/DirectXHelper.h [code]
SpatialInteractionSource/cpp/Common/StepTimer.h [code]
SpatialInteractionSource/cpp/Content/RenderingHelper.cpp [code]
SpatialInteractionSource/cpp/Content/RenderingHelper.h [code]
SpatialInteractionSource/cpp/Content/RenderingInterfaces.h [code]
SpatialInteractionSource/cpp/Content/ShaderStructures.h [code]
SpatialInteractionSource/cpp/Content/Stroke.cpp [code]
SpatialInteractionSource/cpp/Content/Stroke.h [code]
SpatialInteractionSource/cpp/Content/Tool.cpp [code]
SpatialInteractionSource/cpp/Content/Tool.h [code]
SpatialInteractionSource/cpp/Content/ToolCarousel.cpp [code]
SpatialInteractionSource/cpp/Content/ToolCarousel.h [code]
SpatialInteractionSource/cpp/Content/Whiteboard.cpp [code]
SpatialInteractionSource/cpp/Content/Whiteboard.h [code]
SpatialSound/cpp/AudioFileReader.cpp [code]
SpatialSound/cpp/AudioFileReader.h [code]
SpatialSound/cpp/CardioidSound.cpp [code]
SpatialSound/cpp/CardioidSound.h [code]
SpatialSound/cpp/CustomDecay.cpp [code]
SpatialSound/cpp/CustomDecay.h [code]
SpatialSound/cpp/OmnidirectionalSound.cpp [code]
SpatialSound/cpp/OmnidirectionalSound.h [code]
SpatialSound/cpp/pch.cpp [code]
SpatialSound/cpp/pch.h [code]
SpatialSound/cpp/Resource.h [code]
SpatialSound/cpp/SampleConfiguration.cpp [code]
SpatialSound/cpp/SampleConfiguration.h [code]
SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.cpp [code]
SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.h [code]
SpatialSound/cpp/Scenario2_CardioidSound.xaml.cpp [code]
SpatialSound/cpp/Scenario2_CardioidSound.xaml.h [code]
SpatialSound/cpp/Scenario3_CustomDecay.xaml.cpp [code]
SpatialSound/cpp/Scenario3_CustomDecay.xaml.h [code]
SpatialSound/cpp/XAudio2Helpers.h [code]
SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.cpp [code]
SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.h [code]
SpeechRecognitionAndSynthesis/cpp/pch.cpp [code]
SpeechRecognitionAndSynthesis/cpp/pch.h [code]
SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp [code]
SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.h [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp [code]
SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h [code]
SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs [code]
SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs [code]
SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs [code]
SplashScreen/cs/App.xaml.cs [code]
SplashScreen/cs/ExtendedSplash.xaml.cs [code]
SplashScreen/cs/MainPage.xaml.cs [code]
SplashScreen/cs/SampleConfiguration.cs [code]
SplashScreen/cs/Scenario1_SplashScreenDismiss.xaml.cs [code]
SplashScreen/cs/Scenario2_ExtendedSplash.xaml.cs [code]
SplashScreen/cs/common/SuspensionManager.cs [code]
Store/cpp/ItemsListViewModel.h [code]
Store/cpp/pch.cpp [code]
Store/cpp/pch.h [code]
Store/cpp/SampleConfiguration.cpp [code]
Store/cpp/SampleConfiguration.h [code]
Store/cpp/Scenario1_TrialMode.xaml.cpp [code]
Store/cpp/Scenario1_TrialMode.xaml.h [code]
Store/cpp/Scenario2_InAppPurchase.xaml.cpp [code]
Store/cpp/Scenario2_InAppPurchase.xaml.h [code]
Store/cpp/Scenario3_UnmanagedConsumable.xaml.cpp [code]
Store/cpp/Scenario3_UnmanagedConsumable.xaml.h [code]
Store/cpp/Scenario4_ConsumableProduct.xaml.cpp [code]
Store/cpp/Scenario4_ConsumableProduct.xaml.h [code]
Store/cpp/Scenario5_UserCollection.xaml.cpp [code]
Store/cpp/Scenario5_UserCollection.xaml.h [code]
Store/cpp/Scenario6_AppListingURI.xaml.cpp [code]
Store/cpp/Scenario6_AppListingURI.xaml.h [code]
Store/cpp/Scenario7_B2B.xaml.cpp [code]
Store/cpp/Scenario7_B2B.xaml.h [code]
Store/cs/ItemsListViewModel.cs [code]
Store/cs/SampleConfiguration.cs [code]
Store/cs/Scenario1_TrialMode.xaml.cs [code]
Store/cs/Scenario2_InAppPurchase.xaml.cs [code]
Store/cs/Scenario3_UnmanagedConsumable.xaml.cs [code]
Store/cs/Scenario4_ConsumableProduct.xaml.cs [code]
Store/cs/Scenario5_UserCollection.xaml.cs [code]
Store/cs/Scenario6_AppListingURI.xaml.cs [code]
Store/cs/Scenario7_B2B.xaml.cs [code]
StreamSocket/cpp/pch.cpp [code]
StreamSocket/cpp/pch.h [code]
StreamSocket/cpp/SampleConfiguration.cpp [code]
StreamSocket/cpp/SampleConfiguration.h [code]
StreamSocket/cpp/Scenario1.xaml.cpp [code]
StreamSocket/cpp/Scenario1.xaml.h [code]
StreamSocket/cpp/Scenario2.xaml.cpp [code]
StreamSocket/cpp/Scenario2.xaml.h [code]
StreamSocket/cpp/Scenario3.xaml.cpp [code]
StreamSocket/cpp/Scenario3.xaml.h [code]
StreamSocket/cpp/Scenario4.xaml.cpp [code]
StreamSocket/cpp/Scenario4.xaml.h [code]
StreamSocket/cpp/Scenario5.xaml.cpp [code]
StreamSocket/cpp/Scenario5.xaml.h [code]
StreamSocket/cs/SampleConfiguration.cs [code]
StreamSocket/cs/Scenario1_Start.xaml.cs [code]
StreamSocket/cs/Scenario2_Connect.xaml.cs [code]
StreamSocket/cs/Scenario3_Send.xaml.cs [code]
StreamSocket/cs/Scenario4_Close.xaml.cs [code]
StreamSocket/cs/Scenario5_Certificates.xaml.cs [code]
Syndication/cpp/pch.cpp [code]
Syndication/cpp/pch.h [code]
Syndication/cpp/SampleConfiguration.cpp [code]
Syndication/cpp/SampleConfiguration.h [code]
Syndication/cpp/Scenario1_GetFeed.xaml.cpp [code]
Syndication/cpp/Scenario1_GetFeed.xaml.h [code]
Syndication/cs/SampleConfiguration.cs [code]
Syndication/cs/Scenario1_GetFeed.xaml.cs [code]
SystemMediaTransportControls/cs/SampleConfiguration.cs [code]
SystemMediaTransportControls/cs/Scenario1.xaml.cs [code]
TextSegmentation/cpp/pch.cpp [code]
TextSegmentation/cpp/pch.h [code]
TextSegmentation/cpp/SampleConfiguration.cpp [code]
TextSegmentation/cpp/SampleConfiguration.h [code]
TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.cpp [code]
TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.h [code]
TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cpp [code]
TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.h [code]
TextSegmentation/cppwinrt/pch.cpp [code]
TextSegmentation/cppwinrt/pch.h [code]
TextSegmentation/cppwinrt/Project.idl [code]
TextSegmentation/cppwinrt/SampleConfiguration.cpp [code]
TextSegmentation/cppwinrt/SampleConfiguration.h [code]
TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.cpp [code]
TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.h [code]
TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.cpp [code]
TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.h [code]
TextSegmentation/cs/SampleConfiguration.cs [code]
TextSegmentation/cs/Scenario1_ExtractTextSegments.xaml.cs [code]
TextSegmentation/cs/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs [code]
TextSuggestion/cpp/pch.cpp [code]
TextSuggestion/cpp/pch.h [code]
TextSuggestion/cpp/SampleConfiguration.cpp [code]
TextSuggestion/cpp/SampleConfiguration.h [code]
TextSuggestion/cpp/Scenario1_Conversion.xaml.cpp [code]
TextSuggestion/cpp/Scenario1_Conversion.xaml.h [code]
TextSuggestion/cpp/Scenario2_Prediction.xaml.cpp [code]
TextSuggestion/cpp/Scenario2_Prediction.xaml.h [code]
TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.cpp [code]
TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.h [code]
TextSuggestion/cs/SampleConfiguration.cs [code]
TextSuggestion/cs/Scenario1_Conversion.xaml.cs [code]
TextSuggestion/cs/Scenario2_Prediction.xaml.cs [code]
TextSuggestion/cs/Scenario3_ReverseConversion.xaml.cs [code]
TitleBar/cpp/CustomTitleBar.xaml.cpp [code]
TitleBar/cpp/CustomTitleBar.xaml.h [code]
TitleBar/cpp/pch.cpp [code]
TitleBar/cpp/pch.h [code]
TitleBar/cpp/SampleConfiguration.cpp [code]
TitleBar/cpp/SampleConfiguration.h [code]
TitleBar/cpp/Scenario1_Colors.xaml.cpp [code]
TitleBar/cpp/Scenario1_Colors.xaml.h [code]
TitleBar/cpp/Scenario2_Extend.xaml.cpp [code]
TitleBar/cpp/Scenario2_Extend.xaml.h [code]
TitleBar/cppwinrt/CustomTitleBar.cpp [code]
TitleBar/cppwinrt/CustomTitleBar.h [code]
TitleBar/cppwinrt/pch.cpp [code]
TitleBar/cppwinrt/pch.h [code]
TitleBar/cppwinrt/Project.idl [code]
TitleBar/cppwinrt/SampleConfiguration.cpp [code]
TitleBar/cppwinrt/SampleConfiguration.h [code]
TitleBar/cppwinrt/Scenario1_Colors.cpp [code]
TitleBar/cppwinrt/Scenario1_Colors.h [code]
TitleBar/cppwinrt/Scenario2_Extend.cpp [code]
TitleBar/cppwinrt/Scenario2_Extend.h [code]
TitleBar/cs/CustomTitleBar.xaml.cs [code]
TitleBar/cs/SampleConfiguration.cs [code]
TitleBar/cs/Scenario1_Colors.xaml.cs [code]
TitleBar/cs/Scenario2_Extend.xaml.cs [code]
TouchKeyboard/cppwinrt/pch.cpp [code]
TouchKeyboard/cppwinrt/pch.h [code]
TouchKeyboard/cppwinrt/Project.idl [code]
TouchKeyboard/cppwinrt/SampleConfiguration.cpp [code]
TouchKeyboard/cppwinrt/SampleConfiguration.h [code]
TouchKeyboard/cppwinrt/Scenario1_Launch.cpp [code]
TouchKeyboard/cppwinrt/Scenario1_Launch.h [code]
TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.cpp [code]
TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.h [code]
TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.cpp [code]
TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.h [code]
TouchKeyboard/cppwinrt/Scenario4_ShowView.cpp [code]
TouchKeyboard/cppwinrt/Scenario4_ShowView.h [code]
TouchKeyboard/cs/CustomTextBox.cs [code]
TouchKeyboard/cs/SampleConfiguration.cs [code]
TouchKeyboard/cs/Scenario1_Launch.xaml.cs [code]
TouchKeyboard/cs/Scenario2_ShowHideEvents.xaml.cs [code]
TouchKeyboard/cs/Scenario3_ShowHideMethods.xaml.cs [code]
TouchKeyboard/cs/Scenario4_ShowView.xaml.cs [code]
TouchKeyboardTextInput/cpp/pch.cpp [code]
TouchKeyboardTextInput/cpp/pch.h [code]
TouchKeyboardTextInput/cpp/SampleConfiguration.cpp [code]
TouchKeyboardTextInput/cpp/SampleConfiguration.h [code]
TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.cpp [code]
TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.h [code]
TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.cpp [code]
TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.h [code]
TouchKeyboardTextInput/cs/SampleConfiguration.cs [code]
TouchKeyboardTextInput/cs/Scenario1_SpellingTextSuggestions.xaml.cs [code]
TouchKeyboardTextInput/cs/Scenario2_ScopedViews.xaml.cs [code]
Unicode/cppwinrt/pch.cpp [code]
Unicode/cppwinrt/pch.h [code]
Unicode/cppwinrt/Project.idl [code]
Unicode/cppwinrt/SampleConfiguration.cpp [code]
Unicode/cppwinrt/SampleConfiguration.h [code]
Unicode/cppwinrt/Scenario1_FindId.cpp [code]
Unicode/cppwinrt/Scenario1_FindId.h [code]
Unicode/cs/SampleConfiguration.cs [code]
Unicode/cs/Scenario1_FindId.xaml.cs [code]
UserActivity/cs/SampleConfiguration.cs [code]
UserActivity/cs/Scenario1_BasicUserActivity.xaml.cs [code]
UserActivity/cs/Scenario2_AdvancedUserActivity.xaml.cs [code]
UserActivity/cs/Scenario3_AdaptiveCard.xaml.cs [code]
UserCertificateStore/cppwinrt/pch.cpp [code]
UserCertificateStore/cppwinrt/pch.h [code]
UserCertificateStore/cppwinrt/Project.idl [code]
UserCertificateStore/cppwinrt/SampleConfiguration.cpp [code]
UserCertificateStore/cppwinrt/SampleConfiguration.h [code]
UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.cpp [code]
UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.h [code]
UserCertificateStore/cs/SampleConfiguration.cs [code]
UserCertificateStore/cs/Scenario1_MoveCertificate.xaml.cs [code]
UserConsentVerifier/cpp/pch.cpp [code]
UserConsentVerifier/cpp/pch.h [code]
UserConsentVerifier/cpp/SampleConfiguration.cpp [code]
UserConsentVerifier/cpp/SampleConfiguration.h [code]
UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.cpp [code]
UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.h [code]
UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.cpp [code]
UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.h [code]
UserConsentVerifier/cppwinrt/pch.cpp [code]
UserConsentVerifier/cppwinrt/pch.h [code]
UserConsentVerifier/cppwinrt/Project.idl [code]
UserConsentVerifier/cppwinrt/SampleConfiguration.cpp [code]
UserConsentVerifier/cppwinrt/SampleConfiguration.h [code]
UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.cpp [code]
UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.h [code]
UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.cpp [code]
UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.h [code]
UserConsentVerifier/cs/SampleConfiguration.cs [code]
UserConsentVerifier/cs/Scenario1_CheckConsentAvailability.xaml.cs [code]
UserConsentVerifier/cs/Scenario2_RequestConsent.xaml.cs [code]
UserDataAccountManager/cpp/pch.cpp [code]
UserDataAccountManager/cpp/pch.h [code]
UserDataAccountManager/cpp/SampleConfiguration.cpp [code]
UserDataAccountManager/cpp/SampleConfiguration.h [code]
UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.cpp [code]
UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.h [code]
UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.cpp [code]
UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.h [code]
UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.cpp [code]
UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.h [code]
UserDataAccountManager/cs/SampleConfiguration.cs [code]
UserDataAccountManager/cs/Scenario1_AddAccount.xaml.cs [code]
UserDataAccountManager/cs/Scenario2_ManageAccount.xaml.cs [code]
UserDataAccountManager/cs/Scenario3_FixAccount.xaml.cs [code]
UserInfo/cppwinrt/pch.cpp [code]
UserInfo/cppwinrt/pch.h [code]
UserInfo/cppwinrt/Project.idl [code]
UserInfo/cppwinrt/SampleConfiguration.cpp [code]
UserInfo/cppwinrt/SampleConfiguration.h [code]
UserInfo/cppwinrt/Scenario1_FindUsers.cpp [code]
UserInfo/cppwinrt/Scenario1_FindUsers.h [code]
UserInfo/cppwinrt/Scenario2_WatchUsers.cpp [code]
UserInfo/cppwinrt/Scenario2_WatchUsers.h [code]
UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.cpp [code]
UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.h [code]
UserInfo/cppwinrt/UserViewModel.cpp [code]
UserInfo/cppwinrt/UserViewModel.h [code]
UserInfo/cs/SampleConfiguration.cs [code]
UserInfo/cs/Scenario1_FindUsers.xaml.cs [code]
UserInfo/cs/Scenario2_WatchUsers.xaml.cs [code]
UserInfo/cs/Scenario3_CheckUserConsentGroup.xaml.cs [code]
UserInteractionMode/cpp/pch.cpp [code]
UserInteractionMode/cpp/pch.h [code]
UserInteractionMode/cpp/SampleConfiguration.cpp [code]
UserInteractionMode/cpp/SampleConfiguration.h [code]
UserInteractionMode/cpp/Scenario1_Basic.xaml.cpp [code]
UserInteractionMode/cpp/Scenario1_Basic.xaml.h [code]
UserInteractionMode/cppwinrt/pch.cpp [code]
UserInteractionMode/cppwinrt/pch.h [code]
UserInteractionMode/cppwinrt/Project.idl [code]
UserInteractionMode/cppwinrt/SampleConfiguration.cpp [code]
UserInteractionMode/cppwinrt/SampleConfiguration.h [code]
UserInteractionMode/cppwinrt/Scenario1_Basic.cpp [code]
UserInteractionMode/cppwinrt/Scenario1_Basic.h [code]
UserInteractionMode/cs/SampleConfiguration.cs [code]
UserInteractionMode/cs/Scenario1_Basic.xaml.cs [code]
UssdProtcol/cs/RequestResponse.xaml.cs [code]
UssdProtcol/cs/SampleConfiguration.cs [code]
VersionAdaptiveCode/cs/IsApiPropertyPresentTrigger.cs [code]
VersionAdaptiveCode/cs/MEUserControl.xaml.cs [code]
VersionAdaptiveCode/cs/MPEUserControl.xaml.cs [code]
VersionAdaptiveCode/cs/SampleConfiguration.cs [code]
VersionAdaptiveCode/cs/Scenario1_Basics.xaml.cs [code]
VersionAdaptiveCode/cs/Scenario2_Conditional.xaml.cs [code]
VersionAdaptiveCode/cs/Scenario3_ChooseControl.xaml.cs [code]
VersionAdaptiveCode/cs/Scenario4_StateTrigger.xaml.cs [code]
VideoPlayback/cs/SampleConfiguration.cs [code]
VideoPlayback/cs/Scenario1_PlayingVideos.xaml.cs [code]
VideoPlayback/cs/Scenario2_DisplayingInBandClosedCaptions.xaml.cs [code]
VideoPlayback/cs/Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs [code]
VideoPlayback/cs/Scenario4_SelectingVideoTracks.xaml.cs [code]
VideoPlayback/cs/Scenario5_SelectingAudioTracks.xaml.cs [code]
VideoPlayback/cs/Scenario6_PlayingVideoLists.xaml.cs [code]
VideoPlayback/cs/Scenario7_VideoComposition.xaml.cs [code]
VideoPlayback/cs/Scenario8_TransferMediaPlayer1.xaml.cs [code]
VideoPlayback/cs/Scenario9_TransferMediaPlayer2.xaml.cs [code]
VideoPlaybackSynchronization/cs/SampleConfiguration.cs [code]
VideoPlaybackSynchronization/cs/Scenario1_MultiVideoPlayback.xaml.cs [code]
VideoPlaybackSynchronization/cs/Scenario2_SynchronizingPlayers.xaml.cs [code]
VideoPlaybackSynchronization/cs/Scenario3_AdaptiveSync.xaml.cs [code]
WebAccountManagement/cpp/pch.cpp [code]
WebAccountManagement/cpp/pch.h [code]
WebAccountManagement/cpp/SampleConfiguration.cpp [code]
WebAccountManagement/cpp/SampleConfiguration.h [code]
WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.cpp [code]
WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.h [code]
WebAccountManagement/cpp/Scenario2_MSA.xaml.cpp [code]
WebAccountManagement/cpp/Scenario2_MSA.xaml.h [code]
WebAccountManagement/cpp/Scenario3_AAD.xaml.cpp [code]
WebAccountManagement/cpp/Scenario3_AAD.xaml.h [code]
WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.cpp [code]
WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.h [code]
WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.cpp [code]
WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.h [code]
WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.cpp [code]
WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.h [code]
WebAccountManagement/cs/DefaultAccountScenario.xaml.cs [code]
WebAccountManagement/cs/IdentityChecker.cs [code]
WebAccountManagement/cs/MultipleAccountsScenario.xaml.cs [code]
WebAccountManagement/cs/SampleConfiguration.cs [code]
WebAccountManagement/cs/SingleAccountScenario.xaml.cs [code]
WebAccountManagement/cs/SingleAzureADScenario.xaml.cs [code]
WebAccountManagement/cs/SingleMicrosoftAccountScenario.xaml.cs [code]
WebAuthenticationBroker/cpp/pch.cpp [code]
WebAuthenticationBroker/cpp/pch.h [code]
WebAuthenticationBroker/cpp/SampleConfiguration.cpp [code]
WebAuthenticationBroker/cpp/SampleConfiguration.h [code]
WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.cpp [code]
WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.h [code]
WebAuthenticationBroker/cs/SampleConfiguration.cs [code]
WebAuthenticationBroker/cs/Scenario1_Facebook.xaml.cs [code]
WebAuthenticationBroker/cs/Scenario2_Twitter.xaml.cs [code]
WebAuthenticationBroker/cs/Scenario3_Flickr.xaml.cs [code]
WebSocket/cpp/pch.cpp [code]
WebSocket/cpp/pch.h [code]
WebSocket/cpp/SampleConfiguration.cpp [code]
WebSocket/cpp/SampleConfiguration.h [code]
WebSocket/cpp/Scenario1_UTF8.xaml.cpp [code]
WebSocket/cpp/Scenario1_UTF8.xaml.h [code]
WebSocket/cpp/Scenario2_Binary.xaml.cpp [code]
WebSocket/cpp/Scenario2_Binary.xaml.h [code]
WebSocket/cpp/Scenario3_ClientAuthentication.xaml.cpp [code]
WebSocket/cpp/Scenario3_ClientAuthentication.xaml.h [code]
WebSocket/cpp/Scenario4_PartialReadWrite.xaml.cpp [code]
WebSocket/cpp/Scenario4_PartialReadWrite.xaml.h [code]
WebSocket/cppwinrt/pch.cpp [code]
WebSocket/cppwinrt/pch.h [code]
WebSocket/cppwinrt/Project.idl [code]
WebSocket/cppwinrt/SampleConfiguration.cpp [code]
WebSocket/cppwinrt/SampleConfiguration.h [code]
WebSocket/cppwinrt/Scenario1_UTF8.cpp [code]
WebSocket/cppwinrt/Scenario1_UTF8.h [code]
WebSocket/cppwinrt/Scenario2_Binary.cpp [code]
WebSocket/cppwinrt/Scenario2_Binary.h [code]
WebSocket/cppwinrt/Scenario3_ClientAuthentication.cpp [code]
WebSocket/cppwinrt/Scenario3_ClientAuthentication.h [code]
WebSocket/cppwinrt/Scenario4_PartialReadWrite.cpp [code]
WebSocket/cppwinrt/Scenario4_PartialReadWrite.h [code]
WebSocket/cs/SampleConfiguration.cs [code]
WebSocket/cs/Scenario1_UTF8.xaml.cs [code]
WebSocket/cs/Scenario2_Binary.xaml.cs [code]
WebSocket/cs/Scenario3_ClientAuthentication.xaml.cs [code]
WebSocket/cs/Scenario4_PartialReadWrite.xaml.cs [code]
WiFiDirect/cpp/pch.cpp [code]
WiFiDirect/cpp/pch.h [code]
WiFiDirect/cpp/SampleConfiguration.cpp [code]
WiFiDirect/cpp/SampleConfiguration.h [code]
WiFiDirect/cpp/Scenario1_Advertiser.xaml.cpp [code]
WiFiDirect/cpp/Scenario1_Advertiser.xaml.h [code]
WiFiDirect/cpp/Scenario2_Connector.xaml.cpp [code]
WiFiDirect/cpp/Scenario2_Connector.xaml.h [code]
WiFiDirect/cpp/SocketReaderWriter.cpp [code]
WiFiDirect/cpp/SocketReaderWriter.h [code]
WiFiDirect/cppwinrt/ConnectionSettingsPanel.cpp [code]
WiFiDirect/cppwinrt/ConnectionSettingsPanel.h [code]
WiFiDirect/cppwinrt/pch.cpp [code]
WiFiDirect/cppwinrt/pch.h [code]
WiFiDirect/cppwinrt/Project.idl [code]
WiFiDirect/cppwinrt/SampleConfiguration.cpp [code]
WiFiDirect/cppwinrt/SampleConfiguration.h [code]
WiFiDirect/cppwinrt/Scenario1_Advertiser.cpp [code]
WiFiDirect/cppwinrt/Scenario1_Advertiser.h [code]
WiFiDirect/cppwinrt/Scenario2_Connector.cpp [code]
WiFiDirect/cppwinrt/Scenario2_Connector.h [code]
WiFiDirect/cppwinrt/SocketReaderWriter.cpp [code]
WiFiDirect/cppwinrt/SocketReaderWriter.h [code]
WiFiDirect/cs/ConnectionSettingsPanel.xaml.cs [code]
WiFiDirect/cs/SampleConfiguration.cs [code]
WiFiDirect/cs/Scenario1_Advertiser.xaml.cs [code]
WiFiDirect/cs/Scenario2_Connector.xaml.cs [code]
WiFiDirect/cs/SocketReaderWriter.cs [code]
WiFiDirect/cs/Utils.cs [code]
WiFiDirectServices/cpp/pch.cpp [code]
WiFiDirectServices/cpp/pch.h [code]
WiFiDirectServices/cpp/SampleConfiguration.cpp [code]
WiFiDirectServices/cpp/SampleConfiguration.h [code]
WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.cpp [code]
WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.h [code]
WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.cpp [code]
WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.h [code]
WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.cpp [code]
WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.h [code]
WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.cpp [code]
WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.h [code]
WiFiDirectServices/cpp/Scenario5_SendData.xaml.cpp [code]
WiFiDirectServices/cpp/Scenario5_SendData.xaml.h [code]
WiFiDirectServices/cpp/WiFiDirectServicesManager.cpp [code]
WiFiDirectServices/cpp/WiFiDirectServicesManager.h [code]
WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp [code]
WiFiDirectServices/cpp/WiFiDirectServicesWrappers.h [code]
WiFiDirectServices/cpp/Helpers/BufferConverter.h [code]
WiFiDirectServices/cpp/Helpers/ServiceStatusConverter.h [code]
WiFiDirectServices/cs/SampleConfiguration.cs [code]
WiFiDirectServices/cs/Scenario1_AdvertiserCreate.xaml.cs [code]
WiFiDirectServices/cs/Scenario2_AdvertiserAccept.xaml.cs [code]
WiFiDirectServices/cs/Scenario3_SeekerDiscover.xaml.cs [code]
WiFiDirectServices/cs/Scenario4_SeekerSession.xaml.cs [code]
WiFiDirectServices/cs/Scenario5_SendData.xaml.cs [code]
WiFiDirectServices/cs/WiFiDirectServiceManager.cs [code]
WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs [code]
WiFiDirectServices/cs/Helpers/BufferConverter.cs [code]
WiFiDirectServices/cs/Helpers/ServiceStatusConverter.cs [code]
WiFiScan/cpp/DisplayHelpers.cpp [code]
WiFiScan/cpp/DisplayHelpers.h [code]
WiFiScan/cpp/pch.cpp [code]
WiFiScan/cpp/pch.h [code]
WiFiScan/cpp/SampleConfiguration.cpp [code]
WiFiScan/cpp/SampleConfiguration.h [code]
WiFiScan/cpp/Scenario1_CachedNetworks.xaml.cpp [code]
WiFiScan/cpp/Scenario1_CachedNetworks.xaml.h [code]
WiFiScan/cpp/Scenario2_Scan.xaml.cpp [code]
WiFiScan/cpp/Scenario2_Scan.xaml.h [code]
WiFiScan/cpp/Scenario3_RegisterForUpdates.xaml.cpp [code]
WiFiScan/cpp/Scenario3_RegisterForUpdates.xaml.h [code]
WiFiScan/cpp/Scenario4_Connect.xaml.cpp [code]
WiFiScan/cpp/Scenario4_Connect.xaml.h [code]
WiFiScan/cs/DisplayHelpers.cs [code]
WiFiScan/cs/SampleConfiguration.cs [code]
WiFiScan/cs/Scenario1_CachedNetworks.xaml.cs [code]
WiFiScan/cs/Scenario2_Scan.xaml.cs [code]
WiFiScan/cs/Scenario3_RegisterForUpdates.xaml.cs [code]
WiFiScan/cs/Scenario4_Connect.xaml.cs [code]
WindowsAudioSession/cpp/App.xaml.cpp [code]
WindowsAudioSession/cpp/App.xaml.h [code]
WindowsAudioSession/cpp/Common.h [code]
WindowsAudioSession/cpp/DeviceState.h [code]
WindowsAudioSession/cpp/MainPage.xaml.cpp [code]
WindowsAudioSession/cpp/MainPage.xaml.h [code]
WindowsAudioSession/cpp/MFSampleGenerator.cpp [code]
WindowsAudioSession/cpp/MFSampleGenerator.h [code]
WindowsAudioSession/cpp/pch.cpp [code]
WindowsAudioSession/cpp/pch.h [code]
WindowsAudioSession/cpp/PlotData.h [code]
WindowsAudioSession/cpp/SampleConfiguration.cpp [code]
WindowsAudioSession/cpp/SampleConfiguration.h [code]
WindowsAudioSession/cpp/Scenario1.xaml.cpp [code]
WindowsAudioSession/cpp/Scenario1.xaml.h [code]
WindowsAudioSession/cpp/Scenario2.xaml.cpp [code]
WindowsAudioSession/cpp/Scenario2.xaml.h [code]
WindowsAudioSession/cpp/Scenario3.xaml.cpp [code]
WindowsAudioSession/cpp/Scenario3.xaml.h [code]
WindowsAudioSession/cpp/Scenario4.xaml.cpp [code]
WindowsAudioSession/cpp/Scenario4.xaml.h [code]
WindowsAudioSession/cpp/ToneSampleGenerator.cpp [code]
WindowsAudioSession/cpp/ToneSampleGenerator.h [code]
WindowsAudioSession/cpp/WASAPICapture.cpp [code]
WindowsAudioSession/cpp/WASAPICapture.h [code]
WindowsAudioSession/cpp/WASAPIRenderer.cpp [code]
WindowsAudioSession/cpp/WASAPIRenderer.h [code]
WindowsAudioSession/cppwinrt/Common.h [code]
WindowsAudioSession/cppwinrt/DeviceState.h [code]
WindowsAudioSession/cppwinrt/MFSampleGenerator.cpp [code]
WindowsAudioSession/cppwinrt/MFSampleGenerator.h [code]
WindowsAudioSession/cppwinrt/pch.cpp [code]
WindowsAudioSession/cppwinrt/pch.h [code]
WindowsAudioSession/cppwinrt/PlotData.h [code]
WindowsAudioSession/cppwinrt/Project.idl [code]
WindowsAudioSession/cppwinrt/SampleConfiguration.cpp [code]
WindowsAudioSession/cppwinrt/SampleConfiguration.h [code]
WindowsAudioSession/cppwinrt/Scenario1.cpp [code]
WindowsAudioSession/cppwinrt/Scenario1.h [code]
WindowsAudioSession/cppwinrt/Scenario2.cpp [code]
WindowsAudioSession/cppwinrt/Scenario2.h [code]
WindowsAudioSession/cppwinrt/Scenario3.cpp [code]
WindowsAudioSession/cppwinrt/Scenario3.h [code]
WindowsAudioSession/cppwinrt/Scenario4.cpp [code]
WindowsAudioSession/cppwinrt/Scenario4.h [code]
WindowsAudioSession/cppwinrt/ToneSampleGenerator.cpp [code]
WindowsAudioSession/cppwinrt/ToneSampleGenerator.h [code]
WindowsAudioSession/cppwinrt/WASAPICapture.cpp [code]
WindowsAudioSession/cppwinrt/WASAPICapture.h [code]
WindowsAudioSession/cppwinrt/WASAPIRenderer.cpp [code]
WindowsAudioSession/cppwinrt/WASAPIRenderer.h [code]
WRLInProcessWinRTComponent/cpp/cpp/pch.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/pch.h [code]
WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.h [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp [code]
WRLInProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h [code]
WRLInProcessWinRTComponent/cpp/cs/SampleConfiguration.cs [code]
WRLInProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs [code]
WRLInProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs [code]
WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl [code]
WRLInProcessWinRTComponent/cpp/Server/module.cpp [code]
WRLInProcessWinRTComponent/cpp/Server/OvenServer.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/pch.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/pch.h [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.h [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h [code]
WRLOutOfProcessWinRTComponent/cpp/cs/SampleConfiguration.cs [code]
WRLOutOfProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs [code]
WRLOutOfProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs [code]
WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl [code]
WRLOutOfProcessWinRTComponent/cpp/Server/module.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/Server/OvenServer.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/Server/pch.cpp [code]
WRLOutOfProcessWinRTComponent/cpp/Server/pch.h [code]
XamlAnimatedGif/cpp/pch.cpp [code]
XamlAnimatedGif/cpp/pch.h [code]
XamlAnimatedGif/cpp/SampleConfiguration.cpp [code]
XamlAnimatedGif/cpp/SampleConfiguration.h [code]
XamlAnimatedGif/cpp/Scenario1_Basic.xaml.cpp [code]
XamlAnimatedGif/cpp/Scenario1_Basic.xaml.h [code]
XamlAnimatedGif/cs/SampleConfiguration.cs [code]
XamlAnimatedGif/cs/Scenario1_Basic.xaml.cs [code]
XamlBind/cpp/App.xaml.cpp [code]
XamlBind/cpp/App.xaml.h [code]
XamlBind/cpp/BasicTests.xaml.cpp [code]
XamlBind/cpp/BasicTests.xaml.h [code]
XamlBind/cpp/EventTests.xaml.cpp [code]
XamlBind/cpp/EventTests.xaml.h [code]
XamlBind/cpp/Functions.xaml.cpp [code]
XamlBind/cpp/Functions.xaml.h [code]
XamlBind/cpp/ListsAndTemplates.xaml.cpp [code]
XamlBind/cpp/ListsAndTemplates.xaml.h [code]
XamlBind/cpp/MainPage.xaml.cpp [code]
XamlBind/cpp/MainPage.xaml.h [code]
XamlBind/cpp/MyUserControl1.xaml.cpp [code]
XamlBind/cpp/MyUserControl1.xaml.h [code]
XamlBind/cpp/OtherBindings.xaml.cpp [code]
XamlBind/cpp/OtherBindings.xaml.h [code]
XamlBind/cpp/pch.cpp [code]
XamlBind/cpp/pch.h [code]
XamlBind/cpp/PhasingTests.xaml.cpp [code]
XamlBind/cpp/PhasingTests.xaml.h [code]
XamlBind/cpp/SampleConfiguration.cpp [code]
XamlBind/cpp/SampleConfiguration.h [code]
XamlBind/cpp/Templates.xaml.cpp [code]
XamlBind/cpp/Templates.xaml.h [code]
XamlBind/cpp/xBindSampleModel/BoolToVisibilityConverter.cs [code]
XamlBind/cpp/xBindSampleModel/ColorToStringConverter.cs [code]
XamlBind/cpp/xBindSampleModel/Converters.cs [code]
XamlBind/cpp/xBindSampleModel/DOModel.cs [code]
XamlBind/cpp/xBindSampleModel/DoubleToIntConverter.cs [code]
XamlBind/cpp/xBindSampleModel/Employee.cs [code]
XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs [code]
XamlBind/cpp/xBindSampleModel/FileSystemDataSource.cs [code]
XamlBind/cpp/xBindSampleModel/IEmployee.cs [code]
XamlBind/cpp/xBindSampleModel/Manager.cs [code]
XamlBind/cpp/xBindSampleModel/Model.cs [code]
XamlBind/cpp/xBindSampleModel/VeryObservableCollection.cs [code]
XamlBind/cpp/xBindSampleModel/Properties/AssemblyInfo.cs [code]
XamlBind/cs/BasicTests.xaml.cs [code]
XamlBind/cs/CSharpModel.cs [code]
XamlBind/cs/EventTests.xaml.cs [code]
XamlBind/cs/Functions.xaml.cs [code]
XamlBind/cs/ListsAndTemplates.xaml.cs [code]
XamlBind/cs/MainPage.xaml.cs [code]
XamlBind/cs/MyUserControl1.xaml.cs [code]
XamlBind/cs/OtherBindings.xaml.cs [code]
XamlBind/cs/PhasingTests.xaml.cs [code]
XamlBind/cs/SampleConfiguration.cs [code]
XamlBind/cs/Templates.xaml.cs [code]
XamlBind/cs/xBindSampleModel/BoolToVisibilityConverter.cs [code]
XamlBind/cs/xBindSampleModel/ColorToStringConverter.cs [code]
XamlBind/cs/xBindSampleModel/Converters.cs [code]
XamlBind/cs/xBindSampleModel/DOModel.cs [code]
XamlBind/cs/xBindSampleModel/DoubleToIntConverter.cs [code]
XamlBind/cs/xBindSampleModel/Employee.cs [code]
XamlBind/cs/xBindSampleModel/EmployeeCollection.cs [code]
XamlBind/cs/xBindSampleModel/FileSystemDataSource.cs [code]
XamlBind/cs/xBindSampleModel/IEmployee.cs [code]
XamlBind/cs/xBindSampleModel/Manager.cs [code]
XamlBind/cs/xBindSampleModel/Model.cs [code]
XamlBind/cs/xBindSampleModel/VeryObservableCollection.cs [code]
XamlBind/cs/xBindSampleModel/Properties/AssemblyInfo.cs [code]
XamlBottomUpList/cpp/pch.cpp [code]
XamlBottomUpList/cpp/pch.h [code]
XamlBottomUpList/cpp/SampleConfiguration.cpp [code]
XamlBottomUpList/cpp/SampleConfiguration.h [code]
XamlBottomUpList/cpp/Scenario1_Basic.xaml.cpp [code]
XamlBottomUpList/cpp/Scenario1_Basic.xaml.h [code]
XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp [code]
XamlBottomUpList/cpp/Scenario2_Load.xaml.h [code]
XamlBottomUpList/cs/SampleConfiguration.cs [code]
XamlBottomUpList/cs/Scenario1_Basic.xaml.cs [code]
XamlBottomUpList/cs/Scenario2_Load.xaml.cs [code]
XamlCloudFontIntegration/cpp/pch.cpp [code]
XamlCloudFontIntegration/cpp/pch.h [code]
XamlCloudFontIntegration/cpp/SampleConfiguration.cpp [code]
XamlCloudFontIntegration/cpp/SampleConfiguration.h [code]
XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.cpp [code]
XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.h [code]
XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.cpp [code]
XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.h [code]
XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.cpp [code]
XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.h [code]
XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.cpp [code]
XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.h [code]
XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.cpp [code]
XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.h [code]
XamlCloudFontIntegration/cs/SampleConfiguration.cs [code]
XamlCloudFontIntegration/cs/Scenario_CloudFontOverview.xaml.cs [code]
XamlCloudFontIntegration/cs/Scenario_Document1.xaml.cs [code]
XamlCloudFontIntegration/cs/Scenario_Document2.xaml.cs [code]
XamlCloudFontIntegration/cs/Scenario_Document3.xaml.cs [code]
XamlCloudFontIntegration/cs/Scenario_SampleOverview.xaml.cs [code]
XamlCommanding/cpp/App.xaml.cpp [code]
XamlCommanding/cpp/DynamicCommandBar.cpp [code]
XamlCommanding/cpp/DynamicCommandBar.h [code]
XamlCommanding/cpp/pch.cpp [code]
XamlCommanding/cpp/pch.h [code]
XamlCommanding/cpp/SampleConfiguration.cpp [code]
XamlCommanding/cpp/SampleConfiguration.h [code]
XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.cpp [code]
XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.h [code]
XamlCommanding/cpp/Scenario2_Icons.xaml.cpp [code]
XamlCommanding/cpp/Scenario2_Icons.xaml.h [code]
XamlCommanding/cpp/Scenario3_Events.xaml.cpp [code]
XamlCommanding/cpp/Scenario3_Events.xaml.h [code]
XamlCommanding/cpp/Scenario4_Control.xaml.cpp [code]
XamlCommanding/cpp/Scenario4_Control.xaml.h [code]
XamlCommanding/cpp/Scenario5_Multiple.xaml.cpp [code]
XamlCommanding/cpp/Scenario5_Multiple.xaml.h [code]
XamlCommanding/cpp/Scenario6_Styling.xaml.cpp [code]
XamlCommanding/cpp/Scenario6_Styling.xaml.h [code]
XamlCommanding/cpp/Scenario7_CustomContent.xaml.cpp [code]
XamlCommanding/cpp/Scenario7_CustomContent.xaml.h [code]
XamlCommanding/cpp/Scenario8_Reflow.xaml.cpp [code]
XamlCommanding/cpp/Scenario8_Reflow.xaml.h [code]
XamlCommanding/cs/DynamicCommandBar.cs [code]
XamlCommanding/cs/MainPage.xaml.cs [code]
XamlCommanding/cs/SampleConfiguration.cs [code]
XamlCommanding/cs/Scenario1.xaml.cs [code]
XamlCommanding/cs/Scenario2.xaml.cs [code]
XamlCommanding/cs/Scenario3.xaml.cs [code]
XamlCommanding/cs/Scenario4.xaml.cs [code]
XamlCommanding/cs/Scenario5.xaml.cs [code]
XamlCommanding/cs/Scenario6.xaml.cs [code]
XamlCommanding/cs/Scenario7.xaml.cs [code]
XamlCommanding/cs/Scenario8.xaml.cs [code]
XamlContextMenu/cpp/pch.cpp [code]
XamlContextMenu/cpp/pch.h [code]
XamlContextMenu/cpp/SampleConfiguration.cpp [code]
XamlContextMenu/cpp/SampleConfiguration.h [code]
XamlContextMenu/cpp/SampleDataModel.h [code]
XamlContextMenu/cpp/Scenario1.xaml.cpp [code]
XamlContextMenu/cpp/Scenario1.xaml.h [code]
XamlContextMenu/cpp/Scenario2.xaml.cpp [code]
XamlContextMenu/cpp/Scenario2.xaml.h [code]
XamlContextMenu/cpp/Scenario3.xaml.cpp [code]
XamlContextMenu/cpp/Scenario3.xaml.h [code]
XamlContextMenu/cs/SampleConfiguration.cs [code]
XamlContextMenu/cs/SampleData.cs [code]
XamlContextMenu/cs/Scenario1.xaml.cs [code]
XamlContextMenu/cs/Scenario2.xaml.cs [code]
XamlContextMenu/cs/Scenario3.xaml.cs [code]
XamlCustomMediaTransportControls/cs/App.xaml.cs [code]
XamlCustomMediaTransportControls/cs/CustomMediaTransportControls.cs [code]
XamlCustomMediaTransportControls/cs/MainPage.xaml.cs [code]
XamlCustomMediaTransportControls/cs/Properties/AssemblyInfo.cs [code]
XamlDataVirtualization/cs/MainPage.xaml.cs [code]
XamlDataVirtualization/cs/SampleConfiguration.cs [code]
XamlDataVirtualization/cs/Scenario1/FileDataSource.cs [code]
XamlDataVirtualization/cs/Scenario1/FileItem.cs [code]
XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs [code]
XamlDataVirtualization/cs/Scenario1/ItemIndexRangeExtensions.cs [code]
XamlDataVirtualization/cs/Scenario1/ItemIndexRangeList.cs [code]
XamlDataVirtualization/cs/Scenario1/Scenario1.xaml.cs [code]
XamlDataVirtualization/cs/Scenario2/FileDataSource2.cs [code]
XamlDataVirtualization/cs/Scenario2/Scenario2.xaml.cs [code]
XamlDeferLoadStrategy/cs/MainPage.xaml.cs [code]
XamlDeferLoadStrategy/cs/SampleConfiguration.cs [code]
XamlDeferLoadStrategy/cs/TitledImage.cs [code]
XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs [code]
XamlDeferLoadStrategy/cs/Scenarios/BasicDeferral.xaml.cs [code]
XamlDeferLoadStrategy/cs/Scenarios/DeferredControlTemplatePart.xaml.cs [code]
XamlDragAndDrop/cpp/pch.cpp [code]
XamlDragAndDrop/cpp/pch.h [code]
XamlDragAndDrop/cpp/SampleConfiguration.cpp [code]
XamlDragAndDrop/cpp/SampleConfiguration.h [code]
XamlDragAndDrop/cpp/Scenario1_ListView.xaml.cpp [code]
XamlDragAndDrop/cpp/Scenario1_ListView.xaml.h [code]
XamlDragAndDrop/cpp/Scenario2_DragUICustomization.xaml.cpp [code]
XamlDragAndDrop/cpp/Scenario2_DragUICustomization.xaml.h [code]
XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.cpp [code]
XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.h [code]
XamlDragAndDrop/cs/SampleConfiguration.cs [code]
XamlDragAndDrop/cs/Scenario1_ListView.xaml.cs [code]
XamlDragAndDrop/cs/Scenario2_DragUICustomization.xaml.cs [code]
XamlDragAndDrop/cs/Scenario3_StartDragAsync.xaml.cs [code]
XamlFocusVisuals/cs/MainPage.xaml.cs [code]
XamlFocusVisuals/cs/SampleConfiguration.cs [code]
XamlFocusVisuals/cs/SocialMediaCounter.cs [code]
XamlFocusVisuals/cs/Scenarios/CustomControlUsage.xaml.cs [code]
XamlFocusVisuals/cs/Scenarios/CustomFocusVisuals.xaml.cs [code]
XamlGamepadNavigation/cs/SampleConfiguration.cs [code]
XamlGamepadNavigation/cs/Scenario1_Directions.xaml.cs [code]
XamlGamepadNavigation/cs/Scenario2_Engage.xaml.cs [code]
XamlGamepadNavigation/cs/Scenario3_Legacy.xaml.cs [code]
XamlGamepadNavigation/cs/TransportOptions.xaml.cs [code]
XamlListView/cppwinrt/Contact.cpp [code]
XamlListView/cppwinrt/Contact.h [code]
XamlListView/cppwinrt/DetailsPage.cpp [code]
XamlListView/cppwinrt/DetailsPage.h [code]
XamlListView/cppwinrt/EdgeTappedListView.cpp [code]
XamlListView/cppwinrt/EdgeTappedListView.h [code]
XamlListView/cppwinrt/GroupInfoList.cpp [code]
XamlListView/cppwinrt/GroupInfoList.h [code]
XamlListView/cppwinrt/ImagePage.cpp [code]
XamlListView/cppwinrt/ImagePage.h [code]
XamlListView/cppwinrt/Item.cpp [code]
XamlListView/cppwinrt/Item.h [code]
XamlListView/cppwinrt/pch.cpp [code]
XamlListView/cppwinrt/pch.h [code]
XamlListView/cppwinrt/Project.idl [code]
XamlListView/cppwinrt/SampleConfiguration.cpp [code]
XamlListView/cppwinrt/SampleConfiguration.h [code]
XamlListView/cppwinrt/Scenario1_SimpleListView.cpp [code]
XamlListView/cppwinrt/Scenario1_SimpleListView.h [code]
XamlListView/cppwinrt/Scenario2_SimpleGridView.cpp [code]
XamlListView/cppwinrt/Scenario2_SimpleGridView.h [code]
XamlListView/cppwinrt/Scenario3_MasterDetail.cpp [code]
XamlListView/cppwinrt/Scenario3_MasterDetail.h [code]
XamlListView/cppwinrt/Scenario4_EdgeTappedListView.cpp [code]
XamlListView/cppwinrt/Scenario4_EdgeTappedListView.h [code]
XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.cpp [code]
XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.h [code]
XamlListView/cppwinrt/Scenario6_ScrollIntoView.cpp [code]
XamlListView/cppwinrt/Scenario6_ScrollIntoView.h [code]
XamlListView/cs/Contact.cs [code]
XamlListView/cs/DetailsPage.xaml.cs [code]
XamlListView/cs/EdgeTappedListView.cs [code]
XamlListView/cs/GroupInfoList.cs [code]
XamlListView/cs/ImagePage.xaml.cs [code]
XamlListView/cs/Item.cs [code]
XamlListView/cs/SampleConfiguration.cs [code]
XamlListView/cs/Scenario1_SimpleListView.xaml.cs [code]
XamlListView/cs/Scenario2_SimpleGridView.xaml.cs [code]
XamlListView/cs/Scenario3_MasterDetail.xaml.cs [code]
XamlListView/cs/Scenario4_EdgeTappedListView.xaml.cs [code]
XamlListView/cs/Scenario5_RestoreScrollPosition.xaml.cs [code]
XamlListView/cs/Scenario6_ScrollIntoView.xaml.cs [code]
XamlMasterDetail/cppwinrt/App.cpp [code]
XamlMasterDetail/cppwinrt/App.h [code]
XamlMasterDetail/cppwinrt/DetailPage.cpp [code]
XamlMasterDetail/cppwinrt/DetailPage.h [code]
XamlMasterDetail/cppwinrt/Item.cpp [code]
XamlMasterDetail/cppwinrt/ItemsDataSource.h [code]
XamlMasterDetail/cppwinrt/ItemViewModel.cpp [code]
XamlMasterDetail/cppwinrt/MasterDetailPage.cpp [code]
XamlMasterDetail/cppwinrt/MasterDetailPage.h [code]
XamlMasterDetail/cppwinrt/pch.cpp [code]
XamlMasterDetail/cppwinrt/pch.h [code]
XamlMasterDetail/cppwinrt/Project.idl [code]
XamlMasterDetail/cppwinrt/SampleConfiguration.cpp [code]
XamlMasterDetail/cppwinrt/SampleConfiguration.h [code]
XamlMasterDetail/cs/App.xaml.cs [code]
XamlMasterDetail/cs/DetailPage.xaml.cs [code]
XamlMasterDetail/cs/MasterDetailPage.xaml.cs [code]
XamlMasterDetail/cs/Data/Item.cs [code]
XamlMasterDetail/cs/Data/ItemsDataSource.cs [code]
XamlMasterDetail/cs/Properties/AssemblyInfo.cs [code]
XamlMasterDetail/cs/ViewModels/ItemViewModel.cs [code]
XamlPivot/cs/MainPage.xaml.cs [code]
XamlPivot/cs/SampleConfiguration.cs [code]
XamlPivot/cs/SampleData.cs [code]
XamlPivot/cs/Scenario1.xaml.cs [code]
XamlPivot/cs/Scenario2.xaml.cs [code]
XamlPivot/cs/Scenario3.xaml.cs [code]
XamlPivot/cs/TabHeader.xaml.cs [code]
XamlStateTriggers/cs/App.xaml.cs [code]
XamlStateTriggers/cs/ItemTemplateControl.xaml.cs [code]
XamlStateTriggers/cs/MainPage.xaml.cs [code]
XamlStateTriggers/cs/CustomTriggers/ControlSizeTrigger.cs [code]
XamlStateTriggers/cs/CustomTriggers/DeviceFamilyTrigger.cs [code]
XamlStateTriggers/cs/CustomTriggers/InputTypeTrigger.cs [code]
XamlStateTriggers/cs/Properties/AssemblyInfo.cs [code]
XamlStateTriggers/cs/ViewModel/MainViewModel.cs [code]
XamlStateTriggers/cs/ViewModel/Model.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/App.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage_OneHanded.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.cpp [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.h [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/pch.cpp [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/pch.h [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/Properties/AssemblyInfo.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Albums.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Collections.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Settings.xaml.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/MainViewModel.cs [code]
XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/Model.cs [code]
XamlTransform3DAnimations/cs/App.xaml.cs [code]
XamlTransform3DAnimations/cs/ArticlePage.xaml.cs [code]
XamlTransform3DAnimations/cs/MainPage.xaml.cs [code]
XamlTransform3DAnimations/cs/SectionView.xaml.cs [code]
XamlTransform3DAnimations/cs/Properties/AssemblyInfo.cs [code]
XamlTransform3DAnimations/cs/ViewModels/ArticleViewModel.cs [code]
XamlTransform3DAnimations/cs/ViewModels/HeroArticlesViewModel.cs [code]
XamlWebView/cs/SampleConfiguration.cs [code]
XamlWebView/cs/Scenario10_UnviewableContent.xaml.cs [code]
XamlWebView/cs/Scenario1_NavToUrl.xaml.cs [code]
XamlWebView/cs/Scenario2_NavToString.xaml.cs [code]
XamlWebView/cs/Scenario3_InvokeScript.xaml.cs [code]
XamlWebView/cs/Scenario4_ScriptNotify.xaml.cs [code]
XamlWebView/cs/Scenario5_NavToFiles.xaml.cs [code]
XamlWebView/cs/Scenario6_NavToStream.xaml.cs [code]
XamlWebView/cs/Scenario7_Share.xaml.cs [code]
XamlWebView/cs/Scenario8_CaptureBitmap.xaml.cs [code]
XamlWebView/cs/Scenario9_ContainsFullScreenElement.xaml.cs [code]
XmlDocument/cs/SampleConfiguration.cs [code]
XmlDocument/cs/Scenario1_BuildNewRss.xaml.cs [code]
XmlDocument/cs/Scenario2_MarkHotProducts.xaml.cs [code]
XmlDocument/cs/Scenario3_XmlLoading.xaml.cs [code]
XmlDocument/cs/Scenario4_GiftDispatch.xaml.cs [code]
XmlDocument/cs/Scenario5_XSLTTransform.xaml.cs [code]
XmlLite/cpp/pch.cpp [code]
XmlLite/cpp/pch.h [code]
XmlLite/cpp/SampleConfiguration.cpp [code]
XmlLite/cpp/SampleConfiguration.h [code]
XmlLite/cpp/Scenario1_XmlReader.xaml.cpp [code]
XmlLite/cpp/Scenario1_XmlReader.xaml.h [code]
XmlLite/cpp/Scenario2_XmlWriter.xaml.cpp [code]
XmlLite/cpp/Scenario2_XmlWriter.xaml.h [code]
XmlLite/cpp/Scenario3_XmlWriterLite.xaml.cpp [code]
XmlLite/cpp/Scenario3_XmlWriterLite.xaml.h [code]
XmlLite/cppwinrt/pch.cpp [code]
XmlLite/cppwinrt/pch.h [code]
XmlLite/cppwinrt/Project.idl [code]
XmlLite/cppwinrt/SampleConfiguration.cpp [code]
XmlLite/cppwinrt/SampleConfiguration.h [code]
XmlLite/cppwinrt/Scenario1_XmlReader.cpp [code]
XmlLite/cppwinrt/Scenario1_XmlReader.h [code]
XmlLite/cppwinrt/Scenario2_XmlWriter.cpp [code]
XmlLite/cppwinrt/Scenario2_XmlWriter.h [code]
XmlLite/cppwinrt/Scenario3_XmlWriterLite.cpp [code]
XmlLite/cppwinrt/Scenario3_XmlWriterLite.h [code]
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/360VideoPlaybackMain.cpp File Reference

  • File Members
  • 360VideoPlayback
  • cpp
Variables

360VideoPlaybackMain.cpp File Reference

#include "pch.h"
#include "360VideoPlaybackMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Variables

const float MTC_SPAWN_DISTANCE = 1.35f

Variable Documentation

const float MTC_SPAWN_DISTANCE = 1.35f

Definition at line 21 of file 360VideoPlaybackMain.cpp.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/360VideoPlaybackMain.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces | Defines

360VideoPlaybackMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\VideoRenderer.h"
#include "Content\SpatialInputHandler.h"
#include "Content\MediaTransportControls.h"
#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\SpatialInputHandler.h"

Go to the source code of this file.

Classes

class | _360VideoPlaybackMain
Updates, renders, and presents holographic content using Direct3D. More...

Namespaces

namespace | _360VideoPlayback

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 11 of file 360VideoPlaybackMain.h.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/App.xaml.cpp File Reference

  • 360VideoPlayback
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/App.xaml.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/AppView.cpp File Reference

  • 360VideoPlayback
  • cpp

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include "VideoGallery.xaml.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/AppView.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "360VideoPlaybackMain.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/MainPage.xaml.cpp File Reference

  • 360VideoPlayback
  • cpp

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "VideoGallery.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/MainPage.xaml.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"
#include "VideoGallery.xaml.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/pch.cpp File Reference

  • 360VideoPlayback
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/pch.h File Reference

  • 360VideoPlayback
  • cpp

pch.h File Reference

#include <agile.h>
#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include <list>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/PlaybackPage.xaml.cpp File Reference

  • 360VideoPlayback
  • cpp
Functions | Variables

PlaybackPage.xaml.cpp File Reference

#include "pch.h"
#include "PlaybackPage.xaml.h"
#include "VideoGallery.xaml.h"

Go to the source code of this file.

Functions

quaternion | CreateFromHeadingPitchRoll (double flHeading, double flPitch, double flRoll)

Variables

const int | mouseWheelData = 120
const int | scrollStep = 2
const double | THUMBSTICK_DEADZONE = 0.25f

Function Documentation

quaternion CreateFromHeadingPitchRoll | ( | double | flHeading,
 |  | double | flPitch,
 |  | double | flRoll
 | ) |  |

Definition at line 34 of file PlaybackPage.xaml.cpp.

{
    // Here we are creating the quaternion assuming Tait–Bryan angles and applying the
    // angles in order of yaw, pitch, roll.
    // https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
    quaternion result;

    const float headingPart = (XMConvertToRadians((float)flHeading) * 0.5f);    // clockwise
    const float sin1 = sin(headingPart);
    const float cos1 = cos(headingPart);

    const float pitchPart = (XMConvertToRadians(-(float)flPitch) * 0.5f);       // counterclockwise
    const float sin2 = sin(pitchPart);
    const float cos2 = cos(pitchPart);

    const float rollPart = (XMConvertToRadians((float)flRoll) * 0.5f);          // clockwise
    const float sin3 = sin(rollPart);
    const float cos3 = cos(rollPart);

    result.w = cos1 * cos2 * cos3 - sin1 * sin2 * sin3;
    result.x = cos1 * cos2 * sin3 + sin1 * sin2 * cos3;
    result.y = sin1 * cos2 * cos3 + cos1 * sin2 * sin3;
    result.z = cos1 * sin2 * cos3 - sin1 * cos2 * sin3;

    return result;
}

Variable Documentation

const int mouseWheelData = 120

Definition at line 30 of file PlaybackPage.xaml.cpp.

const int scrollStep = 2

Definition at line 29 of file PlaybackPage.xaml.cpp.

const double THUMBSTICK_DEADZONE = 0.25f

Definition at line 28 of file PlaybackPage.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/PlaybackPage.xaml.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

PlaybackPage.xaml.h File Reference

#include "PlaybackPage.g.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoGallery.xaml.cpp File Reference

  • 360VideoPlayback
  • cpp
Classes | Variables

VideoGallery.xaml.cpp File Reference

#include "pch.h"
#include "VideoGallery.xaml.h"
#include "PlaybackPage.xaml.h"
#include "AppView.h"

Go to the source code of this file.

Classes

struct | VideoItemInfo

Variables

const VideoItemInfo | sampleVideos []

Variable Documentation

const VideoItemInfo sampleVideos[]
Initial value:
 {

    {
        L"Sample Video",
        L"https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/SampleVideo.mp4",
    }
}

Definition at line 72 of file VideoGallery.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoGallery.xaml.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

VideoGallery.xaml.h File Reference

#include "VideoGallery.g.h"
#include "VideoItem.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoItem.h File Reference

  • 360VideoPlayback
  • cpp
Classes | Namespaces

VideoItem.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseControl.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common
Variables

BaseControl.cpp File Reference

#include "pch.h"
#include "BaseControl.h"
#include "DirectXHelper.h"
#include "DirectXCollision.h"
#include "..\360VideoPlaybackMain.h"

Go to the source code of this file.

Variables

const float4 | constantFocusPointColor = { 1.0f, 1.0f, 1.0f, 1.0f }
const float | constantFocusPointIntensity = 1.0f
const float | constantFocusPointRadius = 0.1f
const float4 | defaultGlassColor = { 0.0f, 0.0f, 0.0f, 0.5f }

Variable Documentation

const float4 constantFocusPointColor = { 1.0f, 1.0f, 1.0f, 1.0f }

Definition at line 18 of file BaseControl.cpp.

const float constantFocusPointIntensity = 1.0f

Definition at line 20 of file BaseControl.cpp.

const float constantFocusPointRadius = 0.1f

Definition at line 19 of file BaseControl.cpp.

const float4 defaultGlassColor = { 0.0f, 0.0f, 0.0f, 0.5f }

Definition at line 17 of file BaseControl.cpp.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseControl.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces | Defines

BaseControl.h File Reference

#include "CameraResources.h"
#include "DeviceResources.h"
#include "BaseElement.h"
#include "MeshGeometry.h"
#include "StepTimer.h"

Go to the source code of this file.

Classes

class | BaseControl

Namespaces

namespace | DX

Defines

#define | DEFAULT_TEXTURE_SIZE 128

Define Documentation

#define DEFAULT_TEXTURE_SIZE 128

Definition at line 9 of file BaseControl.h.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseElement.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common
Functions | Variables

BaseElement.cpp File Reference

#include "pch.h"
#include "BaseElement.h"
#include "DirectXHelper.h"
#include "..\360VideoPlaybackMain.h"

Go to the source code of this file.

Functions

m_parentFocusedPosition (float2(0.0f))
m_parentTextureHeight (0)
m_parentTextureWidth (0)

Variables

const float MAX_TEXT_LAYOUT_SIZE = 500

Function Documentation

m_parentFocusedPosition ( float2(0.0f) )

Definition at line 213 of file BaseElement.cpp.

{
}

m_parentTextureHeight ( 0 )
m_parentTextureWidth ( 0 )

Variable Documentation

const float MAX_TEXT_LAYOUT_SIZE = 500

Definition at line 15 of file BaseElement.cpp.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseElement.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces | Defines

BaseElement.h File Reference

#include "StepTimer.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | BaseElement
struct | ElementMargin
class | Ellipse
class | FilledEllipse
class | FilledRectangle
class | FocusableElement
class | Line
class | Rectangle
class | Text

Namespaces

namespace | DX

Defines

#define | BUTTON_SIZE 64
#define | FONT_SIZE 10.667f

Define Documentation

#define BUTTON_SIZE 64

Definition at line 6 of file BaseElement.h.

#define FONT_SIZE 10.667f

Definition at line 5 of file BaseElement.h.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/CameraResources.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/CameraResources.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/Controls.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common
Functions | Variables

Controls.cpp File Reference

#include "pch.h"
#include "Controls.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include "..\AppView.h"
#include "..\VideoGallery.xaml.h"

Go to the source code of this file.

Functions

const ColorF | enabledForegroundColor (0xFFFFFF)
const ColorF | focusOutlineColor (0xFFFFFF)
const ColorF | pressedBackgroundFillColor (0x00AFFF)

Variables

const float | c_maxSecondsInPerformPressedFeedbackState = 0.25f
UINT | DEFAULT_SIZE = 18

Function Documentation

const ColorF enabledForegroundColor ( 0xFFFFFF )
const ColorF focusOutlineColor ( 0xFFFFFF )
const ColorF pressedBackgroundFillColor ( 0x00AFFF )

Variable Documentation

const float c_maxSecondsInPerformPressedFeedbackState = 0.25f

Definition at line 24 of file Controls.cpp.

UINT DEFAULT_SIZE = 18

Definition at line 25 of file Controls.cpp.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/Controls.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces | Enumerations

Controls.h File Reference

#include "BaseElement.h"

Go to the source code of this file.

Classes

class | Button
class | ExitButton
class | PlayPauseButton

Namespaces

namespace | DX

Enumerations

enum | ButtonShape { Rectangle, Circle }
enum | ButtonState { None, Pressing, Pressed }
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/DeviceResources.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common
Variables

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Variables

const FLOAT dxgiDefaultDPI = 96

Variable Documentation

const FLOAT dxgiDefaultDPI = 96

Definition at line 14 of file DeviceResources.cpp.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/DeviceResources.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/DirectXHelper.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/MeshGeometry.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common

MeshGeometry.cpp File Reference

#include "pch.h"
#include "MeshGeometry.h"
#include "..\360VideoPlaybackMain.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include "..\Content\ShaderStructures.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/MeshGeometry.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces

MeshGeometry.h File Reference

#include "..\Content\ShaderStructures.h"

Go to the source code of this file.

Classes

struct | MeshGeometry

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/SeekBarElement.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Common
Variables

SeekBarElement.cpp File Reference

#include "pch.h"
#include "SeekBarElement.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include "..\360VideoPlaybackMain.h"
#include "..\AppView.h"

Go to the source code of this file.

Variables

const unsigned int | END_OF_PLAYBACK_BUFFER_MS = 200
const UINT | millisecondsPerSecond = 1000
const long long | s_hnsPerMillisecond = 10000
const int64 | ticksPerSecond = 10000000LL

Variable Documentation

const unsigned int END_OF_PLAYBACK_BUFFER_MS = 200

Definition at line 23 of file SeekBarElement.cpp.

const UINT millisecondsPerSecond = 1000

Definition at line 22 of file SeekBarElement.cpp.

const long long s_hnsPerMillisecond = 10000

Definition at line 20 of file SeekBarElement.cpp.

const int64 ticksPerSecond = 10000000LL

Definition at line 21 of file SeekBarElement.cpp.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/SeekBarElement.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces

SeekBarElement.h File Reference

#include "BaseElement.h"

Go to the source code of this file.

Classes

class | SeekBarElement

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/StepTimer.h File Reference

  • 360VideoPlayback
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/MediaTransportControls.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Content
Variables

MediaTransportControls.cpp File Reference

#include "pch.h"
#include "MediaTransportControls.h"
#include "..\Common\DirectXHelper.h"
#include "..\Common\Controls.h"
#include "VideoRenderer.h"
#include "..\Common\SeekbarElement.h"
#include "..\Common\MeshGeometry.h"

Go to the source code of this file.

Variables

const float | MAX_INACTIVE_TIME_TO_HIDE = 5.0f
const UINT | PLAYPAUSE_CONTAINER_SIZE = BUTTON_SIZE * 2
const unsigned short | PLAYPAUSE_TESSELATION = 24
const UINT | PLAYPAUSE_TEXT_SIZE = PLAYPAUSE_CONTAINER_SIZE / 2

Variable Documentation

const float MAX_INACTIVE_TIME_TO_HIDE = 5.0f

Definition at line 17 of file MediaTransportControls.cpp.

const UINT PLAYPAUSE_CONTAINER_SIZE = BUTTON_SIZE * 2

Definition at line 24 of file MediaTransportControls.cpp.

const unsigned short PLAYPAUSE_TESSELATION = 24

Definition at line 23 of file MediaTransportControls.cpp.

const UINT PLAYPAUSE_TEXT_SIZE = PLAYPAUSE_CONTAINER_SIZE / 2

Definition at line 25 of file MediaTransportControls.cpp.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/MediaTransportControls.h File Reference

  • 360VideoPlayback
  • cpp
  • Content
Classes | Namespaces

MediaTransportControls.h File Reference

#include "..\Common\CameraResources.h"
#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "..\Common\BaseControl.h"
#include "..\Common\BaseControl.h"

Go to the source code of this file.

Classes

class | MediaTransportControls

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/ShaderStructures.h File Reference

  • 360VideoPlayback
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | FocusPointConstantBuffer
struct | ModelConstantBuffer
struct | VertexPositionTexture

Namespaces

namespace | _360VideoPlayback

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(FocusPointConstantBuffer)%(sizeof(float)*4))==0,"FocusPointConstantBuffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/SpatialInputHandler.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/SpatialInputHandler.h File Reference

  • 360VideoPlayback
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/VideoRenderer.cpp File Reference

  • 360VideoPlayback
  • cpp
  • Content

VideoRenderer.cpp File Reference

#include "pch.h"
#include "VideoRenderer.h"
#include "Common\DirectXHelper.h"
#include "Windows.Graphics.DirectX.Direct3D11.interop.h"
#include "AppView.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/VideoRenderer.h File Reference

  • 360VideoPlayback
  • cpp
  • Content
Classes | Namespaces

VideoRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include <concrt.h>
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | VideoRenderer

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/_360VideoPlaybackMain.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces | Defines

_360VideoPlaybackMain.cs File Reference

Go to the source code of this file.

Classes

class | _360VideoPlaybackMain
Updates, renders, and presents holographic content using Direct3D. More...

Namespaces

namespace | _360VideoPlayback

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 9 of file _360VideoPlaybackMain.cs.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/App.xaml.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/AppView.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

AppView.cs File Reference

Go to the source code of this file.

Classes

class | AppView
The IFrameworkView connects the app with Windows and handles application lifecycle events. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/AppViewSource.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

AppViewSource.cs File Reference

Go to the source code of this file.

Classes

class | AppViewSource

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/FxCompile.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

FxCompile.cs File Reference

Go to the source code of this file.

Classes

class | FxCompile
Task to support Fxc.exe. More...

Namespaces

namespace | Microsoft::Build::Tasks
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Helpers.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/HolographicApp1Main.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces | Defines

HolographicApp1Main.cs File Reference

Go to the source code of this file.

Classes

class | HolographicApp1Main
Updates, renders, and presents holographic content using Direct3D. More...

Namespaces

namespace | HolographicApp2

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 9 of file HolographicApp1Main.cs.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/MainPage.xaml.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/PlaybackPage.xaml.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

PlaybackPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PlaybackPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Program.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

Program.cs File Reference

Go to the source code of this file.

Classes

class | Program
Windows Holographic application using SharpDX. More...

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/VideoGallery.xaml.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

VideoGallery.xaml.cs File Reference

Go to the source code of this file.

Classes

class | VideoGallery
An empty page that can be used on its own or navigated to within a Frame. More...
class | VideoGallery::VideoItemInfo

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/VideoItem.cs File Reference

  • 360VideoPlayback
  • cs
Classes | Namespaces

VideoItem.cs File Reference

Go to the source code of this file.

Classes

class | VideoItem

Namespaces

namespace | _360VideoPlayback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/CameraResources.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

CameraResources.cs File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/DeviceResources.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

DeviceResources.cs File Reference

Go to the source code of this file.

Classes

class | DeviceResources
Controls all the DirectX device resources. More...

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/DirectXHelper.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

DirectXHelper.cs File Reference

Go to the source code of this file.

Classes

class | DirectXHelper

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/Disposer.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

Disposer.cs File Reference

Go to the source code of this file.

Classes

class | Disposer

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/InteropStatics.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

InteropStatics.cs File Reference

Go to the source code of this file.

Classes

class | InteropStatics
interface | InteropStatics::IDirect3DDxgiInterfaceAccess

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/StepTimer.cs File Reference

  • 360VideoPlayback
  • cs
  • Common
Classes | Namespaces

StepTimer.cs File Reference

Go to the source code of this file.

Classes

class | StepTimer
Helper class for animation and simulation timing. More...

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/ShaderStructures.cs File Reference

  • 360VideoPlayback
  • cs
  • Content
Classes | Namespaces

ShaderStructures.cs File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
struct | VertexPositionColor
Used to send per-vertex data to the vertex shader. More...
struct | VertexPositionTexture

Namespaces

namespace | _360VideoPlayback::Content
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/SpatialInputHandler.cs File Reference

  • 360VideoPlayback
  • cs
  • Content
Classes | Namespaces

SpatialInputHandler.cs File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | _360VideoPlayback::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/VideoRenderer.cs File Reference

  • 360VideoPlayback
  • cs
  • Content
Classes | Namespaces

VideoRenderer.cs File Reference

Go to the source code of this file.

Classes

class | VideoRenderer
This sample renderer instantiates a basic rendering pipeline. More...

Namespaces

namespace | _360VideoPlayback::Content
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/pch.cpp File Reference

  • 3DPrinting
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/pch.h File Reference

  • 3DPrinting
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Foundation.Numerics.h"
#include "winrt/Windows.ApplicationModel.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.Graphics.Printing3D.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Project.idl File Reference

  • 3DPrinting
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Print
runtimeclass | Scenario2_Launch
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/SampleConfiguration.cpp File Reference

  • 3DPrinting
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/SampleConfiguration.h File Reference

  • 3DPrinting
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario1_Print.cpp File Reference

  • 3DPrinting
  • cppwinrt
Namespaces | Functions

Scenario1_Print.cpp File Reference

#include "pch.h"
#include "Scenario1_Print.h"
#include "Scenario1_Print.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario1_Print.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

IAsyncOperation
< Printing3D3MFPackage > 		CreatePackageAsync ()
IAsyncOperation
< Printing3D3MFPackage > 		CreatePackageFromXmlAsync (hstring rawXml)
IAsyncAction | FixTextureContentTypeAsync (Printing3D3MFPackage package)
void | SetBufferBytes (IBuffer const &buffer, void const *data, uint32_t size)
void | SetMaterialIndices (Printing3DMesh const &mesh)
void | SetTriangleIndices (Printing3DMesh const &mesh)
void | SetVertices (Printing3DMesh const &mesh)
IAsyncOperation< hstring > | StreamToStringAsync (IRandomAccessStream stream)
IAsyncOperation
< IRandomAccessStream > 		StringToStreamAsync (hstring const &string)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario1_Print.h File Reference

  • 3DPrinting
  • cppwinrt
Classes | Namespaces

Scenario1_Print.h File Reference

#include "Scenario1_Print.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Print
struct | Scenario1_Print

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario2_Launch.cpp File Reference

  • 3DPrinting
  • cppwinrt
Namespaces

Scenario2_Launch.cpp File Reference

#include "pch.h"
#include "Scenario2_Launch.h"
#include "Scenario2_Launch.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario2_Launch.h File Reference

  • 3DPrinting
  • cppwinrt
Classes | Namespaces

Scenario2_Launch.h File Reference

#include "Scenario2_Launch.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Launch
struct | Scenario2_Launch

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cs/SampleConfiguration.cs File Reference

  • 3DPrinting
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cs/Scenario1_Print.xaml.cs File Reference

  • 3DPrinting
  • cs
Classes | Namespaces

Scenario1_Print.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Print

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cs/Scenario2_Launch.xaml.cs File Reference

  • 3DPrinting
  • cs
Classes | Namespaces

Scenario2_Launch.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Launch

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrintingFromUnity/Assets/Script/Print3D.cs File Reference

  • 3DPrintingFromUnity
  • Assets
  • Script
Classes

Print3D.cs File Reference

Go to the source code of this file.

Classes

class Print3D
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrintingFromUnity/Assets/Script/Turn.cs File Reference

  • 3DPrintingFromUnity
  • Assets
  • Script
Classes

Turn.cs File Reference

Go to the source code of this file.

Classes

class Turn
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/pch.cpp File Reference

  • Accelerometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/pch.h File Reference

  • Accelerometer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/SampleConfiguration.cpp File Reference

  • Accelerometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/SampleConfiguration.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario0_Choose.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario0_Choose.xaml.cpp File Reference

#include "pch.h"
#include "Scenario0_Choose.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario0_Choose.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario0_Choose.xaml.h File Reference

#include "pch.h"
#include "Scenario0_Choose.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario2_ShakeEvents.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario2_ShakeEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ShakeEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario2_ShakeEvents.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario2_ShakeEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario2_ShakeEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario3_Polling.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario3_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario3_Polling.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario3_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario4_OrientationChanged.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario4_OrientationChanged.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_OrientationChanged.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario4_OrientationChanged.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario4_OrientationChanged.xaml.h File Reference

#include "pch.h"
#include "Scenario4_OrientationChanged.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.cpp File Reference

  • Accelerometer
  • cpp

Scenario5_DataEventsBatching.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_DataEventsBatching.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario5_DataEventsBatching.xaml.h File Reference

  • Accelerometer
  • cpp
Classes | Namespaces

Scenario5_DataEventsBatching.xaml.h File Reference

#include "pch.h"
#include "Scenario5_DataEventsBatching.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/SampleConfiguration.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario0_Choose.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario0_Choose.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario0_Choose

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario2_ShakeEvents.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario2_ShakeEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ShakeEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario3_Polling.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario3_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario4_OrientationChanged.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario4_OrientationChanged.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_OrientationChanged
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario5_DataEventsBatching.xaml.cs File Reference

  • Accelerometer
  • cs
Classes | Namespaces

Scenario5_DataEventsBatching.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_DataEventsBatching

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/pch.cpp File Reference

  • ActivitySensor
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/pch.h File Reference

  • ActivitySensor
  • cpp
Variables

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Variables

const GUID GUID_ActivitySensor_ClassId = { 0X9D9E0118, 0X1807, 0X4F2E, 0X96, 0XE4, 0X2C, 0XE5, 0X71, 0X42, 0XE1, 0X96 }

Variable Documentation

const GUID GUID_ActivitySensor_ClassId = { 0X9D9E0118, 0X1807, 0X4F2E, 0X96, 0XE4, 0X2C, 0XE5, 0X71, 0X42, 0XE1, 0X96 }

Definition at line 13 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/SampleConfiguration.cpp File Reference

  • ActivitySensor
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/SampleConfiguration.h File Reference

  • ActivitySensor
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.cpp File Reference

  • ActivitySensor
  • cpp

Scenario1_CurrentActivity.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_CurrentActivity.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.h File Reference

  • ActivitySensor
  • cpp
Classes | Namespaces

Scenario1_CurrentActivity.xaml.h File Reference

#include "pch.h"
#include "Scenario1_CurrentActivity.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario2_History.xaml.cpp File Reference

  • ActivitySensor
  • cpp

Scenario2_History.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_History.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario2_History.xaml.h File Reference

  • ActivitySensor
  • cpp
Classes | Namespaces

Scenario2_History.xaml.h File Reference

#include "pch.h"
#include "Scenario2_History.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.cpp File Reference

  • ActivitySensor
  • cpp

Scenario3_ChangeEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ChangeEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.h File Reference

  • ActivitySensor
  • cpp
Classes | Namespaces

Scenario3_ChangeEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario3_ChangeEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.cpp File Reference

  • ActivitySensor
  • cpp

Scenario4_BackgroundActivity.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_BackgroundActivity.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario4_BackgroundActivity.xaml.h File Reference

  • ActivitySensor
  • cpp
Classes | Namespaces

Scenario4_BackgroundActivity.xaml.h File Reference

#include "pch.h"
#include "Scenario4_BackgroundActivity.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/ActivitySensorBackgroundTask.cpp File Reference

  • ActivitySensor
  • cpp
  • Tasks

ActivitySensorBackgroundTask.cpp File Reference

#include "pch.h"
#include "ActivitySensorBackgroundTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/ActivitySensorBackgroundTask.h File Reference

  • ActivitySensor
  • cpp
  • Tasks
Classes | Namespaces

ActivitySensorBackgroundTask.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/pch.cpp File Reference

  • ActivitySensor
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/pch.h File Reference

  • ActivitySensor
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/SampleConfiguration.cs File Reference

  • ActivitySensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario1_CurrentActivity.xaml.cs File Reference

  • ActivitySensor
  • cs
Classes | Namespaces

Scenario1_CurrentActivity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CurrentActivity

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario2_History.xaml.cs File Reference

  • ActivitySensor
  • cs
Classes | Namespaces

Scenario2_History.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_History

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario3_ChangeEvents.xaml.cs File Reference

  • ActivitySensor
  • cs
Classes | Namespaces

Scenario3_ChangeEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ChangeEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario4_BackgroundActivity.xaml.cs File Reference

  • ActivitySensor
  • cs
Classes | Namespaces

Scenario4_BackgroundActivity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_BackgroundActivity
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/ActivitySensorBackgroundTask.cs File Reference

  • ActivitySensor
  • cs
  • Tasks
Classes | Namespaces

ActivitySensorBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | ActivitySensorBackgroundTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • ActivitySensor
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/SampleConfiguration.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | BitrateHelper
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario1_SimplestAdaptiveStreaming.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario1_SimplestAdaptiveStreaming.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SimplestAdaptiveStreaming
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario2_EventHandlers.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario2_EventHandlers.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_EventHandlers
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario3_RequestModification.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario3_RequestModification.xaml.cs File Reference

Go to the source code of this file.

Classes

class | AddAuthorizationHeaderFilter
class | Scenario3_RequestModification
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario4_Tuning.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario4_Tuning.xaml.cs File Reference

Go to the source code of this file.

Classes

class | BitrateItem
Item which provides a nicer display name for "null" bitrate. More...
class | Scenario4_Tuning
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario5_Metadata.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario5_Metadata.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_Metadata

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario6_AdInsertion.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario6_AdInsertion.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_AdInsertion
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario7_LiveSeekableRange.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
Classes | Namespaces

Scenario7_LiveSeekableRange.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_LiveSeekableRange
See the README.md for discussion of this scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Controls/ContentSelector.xaml.cs File Reference

  • AdaptiveStreaming
  • cs
  • Controls
Classes | Namespaces

ContentSelector.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ContentSelector

Namespaces

namespace | SDKTemplate::Controls
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Helpers/CommonLicenseRequest.cs File Reference

  • AdaptiveStreaming
  • cs
  • Helpers
Classes | Namespaces

CommonLicenseRequest.cs File Reference

Go to the source code of this file.

Classes

class | CommonLicenseRequest

Namespaces

namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Helpers/PlayReadyHelper.cs File Reference

  • AdaptiveStreaming
  • cs
  • Helpers
Classes | Namespaces

PlayReadyHelper.cs File Reference

Go to the source code of this file.

Classes

class | PlayReadyHelper
Encapsulates all the required calls to setup a MediaProtectionManger within a MediaPlayer for typical PlayReady scenarios. More...

Namespaces

namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Models/AdaptiveContentModel.cs File Reference

  • AdaptiveStreaming
  • cs
  • Models
Classes | Namespaces

AdaptiveContentModel.cs File Reference

Go to the source code of this file.

Classes

class | AdaptiveContentModel
A list of manifest URLs, both HLS and DASH; clear, encrypted and PlayReady; VOD and Live. More...

Namespaces

namespace | SDKTemplate::Models
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Shared/TrackingEventCue.cs File Reference

  • AdaptiveStreaming
  • cs
  • Shared
Classes | Namespaces

TrackingEventCue.cs File Reference

Go to the source code of this file.

Classes

class | TrackingEventCue
The custom data that can be created, scheduled then consumed as part of a TimedMetadataTrack which has been added by the app. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/01_MediaElement.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

01_MediaElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario01

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/02_Casting_API_CastButton.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

02_Casting_API_CastButton.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario02

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/03_DIAL_Sender_API.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

03_DIAL_Sender_API.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario03

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/04_DIAL_Receiver_App.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

04_DIAL_Receiver_App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario04

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/05_Multi_View_Media_Application.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

05_Multi_View_Media_Application.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario05

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/06_Combine_Casting_Tech.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

06_Combine_Casting_Tech.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario06

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/App.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/MainPage.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | ScreenCasting

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage }
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/ProjectionViewPage.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

ProjectionViewPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ProjectionViewPage

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/SampleConfiguration.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/UnhandledExceptionPage.xaml.cs File Reference

  • AdvancedCasting
  • cs
Classes | Namespaces

UnhandledExceptionPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | UnhandledExceptionPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Controls/MediaTransportControlsWithCustomCastButton.cs File Reference

  • AdvancedCasting
  • cs
  • Controls
Classes | Namespaces

MediaTransportControlsWithCustomCastButton.cs File Reference

Go to the source code of this file.

Classes

class | MediaTransportControlsWithCustomCastButton

Namespaces

namespace | ScreenCasting::Controls
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Controls/ProjectedMediaTransportControls.cs File Reference

  • AdvancedCasting
  • cs
  • Controls
Classes | Namespaces

ProjectedMediaTransportControls.cs File Reference

Go to the source code of this file.

Classes

class | ProjectedMediaTransportControls

Namespaces

namespace | ScreenCasting::Controls
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Controls/ProjectionViewBroker.cs File Reference

  • AdvancedCasting
  • cs
  • Controls
Classes | Namespaces

ProjectionViewBroker.cs File Reference

Go to the source code of this file.

Classes

class | ProjectionViewBroker

Namespaces

namespace | ScreenCasting
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Azure/AzureDataProvider.cs File Reference

  • AdvancedCasting
  • cs
  • Data
  • Azure
Classes | Namespaces

AzureDataProvider.cs File Reference

Go to the source code of this file.

Classes

class | AzureDataProvider

Namespaces

namespace | ScreenCasting::Data::Azure
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Common/ItemsDataProvider.cs File Reference

  • AdvancedCasting
  • cs
  • Data
  • Common
Classes | Namespaces

ItemsDataProvider.cs File Reference

Go to the source code of this file.

Classes

class | ItemsDataProvider

Namespaces

namespace | ScreenCasting::Data::Common
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Common/VideoMetaData.cs File Reference

  • AdvancedCasting
  • cs
  • Data
  • Common
Classes | Namespaces

VideoMetaData.cs File Reference

Go to the source code of this file.

Classes

class | VideoMetaData

Namespaces

namespace | ScreenCasting::Data::Common
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/ApiInformation.cs File Reference

  • AdvancedCasting
  • cs
  • Util
Classes | Namespaces

ApiInformation.cs File Reference

Go to the source code of this file.

Classes

class | ApiInformation

Namespaces

namespace | ScreenCasting::Util
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/CustomDevicePickerFilter.cs File Reference

  • AdvancedCasting
  • cs
  • Util
Classes | Namespaces

CustomDevicePickerFilter.cs File Reference

Go to the source code of this file.

Classes

class | CustomDevicePickerFilter

Namespaces

namespace | ScreenCasting::Util
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/DialLaunchArguments.cs File Reference

  • AdvancedCasting
  • cs
  • Util
Classes | Namespaces

DialLaunchArguments.cs File Reference

Go to the source code of this file.

Classes

class | DialLaunchArguments

Namespaces

namespace | ScreenCasting::Util
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/RequiredDeviceProperties.cs File Reference

  • AdvancedCasting
  • cs
  • Util
Classes | Namespaces

RequiredDeviceProperties.cs File Reference

Go to the source code of this file.

Classes

class | RequiredDeviceProperties

Namespaces

namespace | ScreenCasting::Util
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/ViewLifetimeControl.cs File Reference

  • AdvancedCasting
  • cs
  • Util
Classes | Namespaces | Functions

ViewLifetimeControl.cs File Reference

Go to the source code of this file.

Classes

class | ViewLifetimeControl

Namespaces

namespace | ScreenCasting::Util

Functions

delegate void | ViewReleasedHandler (Object sender, EventArgs e)
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces | Defines | Variables

AllJoynHelpers.h File Reference

Go to the source code of this file.

Classes

class | AllJoynHelpers
interface | ISignalEmitter
class | PropertyGetContext< T >
class | PropertySetContext

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface

Defines

#define | RETURN_IF_QSTATUS_ERROR(status)

Variables

const int | c_MaximumSignatureLength = 255
const int | c_MessageTimeoutInMilliseconds = 10000

Define Documentation

#define RETURN_IF_QSTATUS_ERROR ( status )
Value:
{   \
int32 alljoynStatus = static_cast<int32>(status);    \
if (Windows::Devices::AllJoyn::AllJoynStatus::Ok != alljoynStatus)  \
{   \
    return status;   \
}   \
}

Definition at line 29 of file AllJoynHelpers.h.

Variable Documentation

const int c_MaximumSignatureLength = 255

Definition at line 27 of file AllJoynHelpers.h.

const int c_MessageTimeoutInMilliseconds = 10000

Definition at line 24 of file AllJoynHelpers.h.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/ISecureInterfaceService.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

ISecureInterfaceService.h File Reference

Go to the source code of this file.

Classes

interface | ISecureInterfaceService

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/pch.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/pch.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Defines

pch.h File Reference

#include <windows.h>
#include <ppltasks.h>
#include <concrt.h>
#include <collection.h>
#include <windows.devices.alljoyn.interop.h>
#include <map>
#include <alljoyn_c/busattachment.h>
#include <alljoyn_c/dbusstddefines.h>
#include <alljoyn_c/AboutData.h>
#include <alljoyn_c/AboutObj.h>
#include <alljoyn_c/AboutObjectDescription.h>
#include "AllJoynHelpers.h"
#include "AllJoynBusObjectManager.h"
#include "SecureInterfaceStructures.h"
#include "TypeConversionHelpers.h"
#include "SecureInterfaceMethodResults.h"
#include "SecureInterfaceEventArgs.h"
#include "ISecureInterfaceService.h"
#include "SecureInterfaceSignals.h"
#include "SecureInterfaceLegacySignals.h"
#include "SecureInterfaceProducer.h"
#include "SecureInterfaceConsumer.h"
#include "SecureInterfaceServiceEventArgs.h"
#include "SecureInterfaceServiceEventAdapter.h"
#include "AllJoynHelpers.h"

Go to the source code of this file.

Defines

#define PROJECT_NAMESPACE com::microsoft::Samples::SecureInterface

Define Documentation

#define PROJECT_NAMESPACE com::microsoft::Samples::SecureInterface

Definition at line 40 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceConsumer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceConsumer.h File Reference

Go to the source code of this file.

Classes

interface | ISecureInterfaceConsumer
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceEventArgs.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceEventArgs.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceLegacySignals.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceLegacySignals.h File Reference

Go to the source code of this file.

Classes

interface | ISecureInterfaceLegacySignals
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceMethodResults.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceMethodResults.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceProducer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces | Variables

SecureInterfaceProducer.h File Reference

Go to the source code of this file.

Classes

interface | ISecureInterfaceProducer
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface

Variables

PCSTR | c_SecureInterfaceIntrospectionXml = "</interface>"
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceServiceEventAdapter.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceServiceEventAdapter.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Namespaces

SecureInterfaceServiceEventArgs.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceServiceEventArgs.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.cpp File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceSignals.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceSignals.h File Reference

Go to the source code of this file.

Classes

interface | ISecureInterfaceSignals
class | sealed

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceStructures.h File Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent
Classes | Namespaces

SecureInterfaceStructures.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | TypeConversionHelpers

Namespaces

namespace | com
namespace | com::microsoft
namespace | com::microsoft::Samples
namespace | com::microsoft::Samples::SecureInterface
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/AllJoynHelpers.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces | Defines | Variables

AllJoynHelpers.h File Reference

Go to the source code of this file.

Classes

class | AllJoynHelpers
interface | ISignalEmitter
class | PropertyGetContext< T >
class | PropertySetContext

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding

Defines

#define | RETURN_IF_QSTATUS_ERROR(status)

Variables

const int | c_MaximumSignatureLength = 255
const int | c_MessageTimeoutInMilliseconds = 10000

Define Documentation

#define RETURN_IF_QSTATUS_ERROR ( status )
Value:
{   \
int32 alljoynStatus = static_cast<int32>(status);    \
if (Windows::Devices::AllJoyn::AllJoynStatus::Ok != alljoynStatus)  \
{   \
    return status;   \
}   \
}

Definition at line 29 of file AllJoynHelpers.h.

Variable Documentation

const int c_MaximumSignatureLength = 255

Definition at line 27 of file AllJoynHelpers.h.

const int c_MessageTimeoutInMilliseconds = 10000

Definition at line 24 of file AllJoynHelpers.h.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/IOnboardingService.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

IOnboardingService.h File Reference

Go to the source code of this file.

Classes

interface | IOnboardingService

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingConsumer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingConsumer.h File Reference

Go to the source code of this file.

Classes

interface | IOnboardingConsumer
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingEventArgs.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingEventArgs.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingLegacySignals.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingLegacySignals.h File Reference

Go to the source code of this file.

Classes

interface | IOnboardingLegacySignals
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingMethodResults.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingMethodResults.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed
class | sealed
class | sealed
class | sealed
class | sealed
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingProducer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingProducer.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces | Variables

OnboardingProducer.h File Reference

Go to the source code of this file.

Classes

interface | IOnboardingProducer
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding

Variables

PCSTR | c_OnboardingIntrospectionXml = "</interface>"
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingServiceEventAdapter.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingServiceEventAdapter.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Namespaces

OnboardingServiceEventArgs.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingServiceEventArgs.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed
class | sealed
class | sealed
class | sealed
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingSignals.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingSignals.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingSignals.h File Reference

Go to the source code of this file.

Classes

interface | IOnboardingSignals
class | sealed

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingStructures.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Classes | Namespaces

OnboardingStructures.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed
class | sealed
class | TypeConversionHelpers

Namespaces

namespace | org
namespace | org::alljoyn
namespace | org::alljoyn::Onboarding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/pch.cpp File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/pch.h File Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent
Defines

pch.h File Reference

#include <windows.h>
#include <ppltasks.h>
#include <concrt.h>
#include <collection.h>
#include <windows.devices.alljoyn.interop.h>
#include <map>
#include <alljoyn_c/busattachment.h>
#include <alljoyn_c/dbusstddefines.h>
#include <alljoyn_c/AboutData.h>
#include <alljoyn_c/AboutObj.h>
#include <alljoyn_c/AboutObjectDescription.h>
#include "AllJoynHelpers.h"
#include "AllJoynBusObjectManager.h"
#include "OnboardingStructures.h"
#include "TypeConversionHelpers.h"
#include "OnboardingMethodResults.h"
#include "OnboardingEventArgs.h"
#include "IOnboardingService.h"
#include "OnboardingSignals.h"
#include "OnboardingLegacySignals.h"
#include "OnboardingProducer.h"
#include "OnboardingConsumer.h"
#include "OnboardingServiceEventArgs.h"
#include "OnboardingServiceEventAdapter.h"

Go to the source code of this file.

Defines

#define PROJECT_NAMESPACE org::alljoyn::Onboarding

Define Documentation

#define PROJECT_NAMESPACE org::alljoyn::Onboarding

Definition at line 40 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/OnboardingEnumTypes.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces | Enumerations

OnboardingEnumTypes.cs File Reference

Go to the source code of this file.

Classes

class | AuthTypeToStringConverter

Namespaces

namespace | AllJoynConsumerExperiences

Enumerations

enum | ConfigureWiFiResultStatus { NotConcurrent = 1, Concurrent = 2 }
enum ConnectionResultCode {
Validated = 0, Unreachable, UnsupportedProtocol, Unauthorized,
ErrorMessage
}
enum OnboardingAuthenticationType {
Wpa2Auto = -3, WpaAuto = -2, Any = -1, Open = 0,
Wep = 1, WpaTkip = 2, WpaCcmp = 3, Wpa2Tkip = 4,
Wpa2Ccmp = 5, Wps = 6
}
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/RelayCommand.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

RelayCommand.cs File Reference

Go to the source code of this file.

Classes

class | RelayCommand
Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates. More...

Namespaces

namespace | AllJoynConsumerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/SampleConfiguration.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario1.xaml.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1

Namespaces

namespace | AllJoynConsumerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario1ViewModel.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

Scenario1ViewModel.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1ViewModel

Namespaces

namespace | AllJoynConsumerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario2.xaml.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2

Namespaces

namespace | AllJoynConsumerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario2ViewModel.cs File Reference

  • AllJoyn
  • ConsumerExperiences
  • cs
Classes | Namespaces

Scenario2ViewModel.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2ViewModel

Namespaces

namespace | AllJoynConsumerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/AppData.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

AppData.cs File Reference

Go to the source code of this file.

Classes

class | AppData

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/OnboardingEnumTypes.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Namespaces | Enumerations

OnboardingEnumTypes.cs File Reference

Go to the source code of this file.

Namespaces

namespace | AllJoynProducerExperiences

Enumerations

enum ConfigurationState {
NotConfigured = 0, NotValidated, Validating, Validated,
Error, Retry
}
enum | ConfigureWiFiResultStatus { NonConcurrent = 1, Concurrent = 2 }
enum ConnectionResultCode {
Validated = 0, Unreachable, UnsupportedProtocol, Unauthorized,
ErrorMessage
}
enum OnboardingAuthenticationType {
Wpa2Auto = -3, WpaAuto = -2, Any = -1, Open = 0,
Wep = 1, WpaTkip = 2, WpaCcmp = 3, Wpa2Tkip = 4,
Wpa2Ccmp = 5, Wps = 6
}
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/OnboardingService.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

OnboardingService.cs File Reference

Go to the source code of this file.

Classes

class | OnboardingService

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/RelayCommand.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

RelayCommand.cs File Reference

Go to the source code of this file.

Classes

class | RelayCommand
Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates. More...

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/SampleConfiguration.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario1.xaml.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario1ViewModel.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

Scenario1ViewModel.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1ViewModel

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario2.xaml.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario2ViewModel.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

Scenario2ViewModel.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2ViewModel

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/SecureInterfaceService.cs File Reference

  • AllJoyn
  • ProducerExperiences
  • cs
Classes | Namespaces

SecureInterfaceService.cs File Reference

Go to the source code of this file.

Classes

class | SecureInterfaceService
The implementation of ISecureInterfaceService that will handle the concatenation method calls. More...

Namespaces

namespace | AllJoynProducerExperiences
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/AllJoynBusObjectManager.cpp File Reference

  • AllJoyn
  • shared

AllJoynBusObjectManager.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/AllJoynBusObjectManager.h File Reference

  • AllJoyn
  • shared
Classes

AllJoynBusObjectManager.h File Reference

Go to the source code of this file.

Classes

class AllJoynBusObjectManager
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/AllJoynHelpers.cpp File Reference

  • AllJoyn
  • shared

AllJoynHelpers.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/TypeConversionHelpers.cpp File Reference

  • AllJoyn
  • shared

TypeConversionHelpers.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/TypeConversionHelpers.h File Reference

  • AllJoyn
  • shared
Classes

TypeConversionHelpers.h File Reference

Go to the source code of this file.

Classes

class TypeConversionHelpers
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/pch.cpp File Reference

  • Altimeter
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/pch.h File Reference

  • Altimeter
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/SampleConfiguration.cpp File Reference

  • Altimeter
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/SampleConfiguration.h File Reference

  • Altimeter
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Altimeter
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Altimeter
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/Scenario2_Polling.xaml.cpp File Reference

  • Altimeter
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/Scenario2_Polling.xaml.h File Reference

  • Altimeter
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/SampleConfiguration.cs File Reference

  • Altimeter
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Altimeter
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/Scenario2_Polling.xaml.cs File Reference

  • Altimeter
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/pch.cpp File Reference

  • AnimationMetrics
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/pch.h File Reference

  • AnimationMetrics
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/SampleConfiguration.cpp File Reference

  • AnimationMetrics
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/SampleConfiguration.h File Reference

  • AnimationMetrics
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/Scenario1_Metrics.xaml.cpp File Reference

  • AnimationMetrics
  • cpp
Functions

Scenario1_Metrics.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Metrics.xaml.h"
#include <sstream>

Go to the source code of this file.

Functions

double TimeSpanToMilliseconds (Windows::Foundation::TimeSpan timeSpan)

Function Documentation

double TimeSpanToMilliseconds ( Windows::Foundation::TimeSpan timeSpan )

Definition at line 26 of file Scenario1_Metrics.xaml.cpp.

{
    return timeSpan.Duration / 10000.0f;
}

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/Scenario1_Metrics.xaml.h File Reference

  • AnimationMetrics
  • cpp
Classes | Namespaces

Scenario1_Metrics.xaml.h File Reference

#include "Scenario1_Metrics.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cs/SampleConfiguration.cs File Reference

  • AnimationMetrics
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cs/Scenario1_Metrics.xaml.cs File Reference

  • AnimationMetrics
  • cs
Classes | Namespaces

Scenario1_Metrics.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Metrics

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/pch.cpp File Reference

  • ApplicationData
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/pch.h File Reference

  • ApplicationData
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Storage.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Project.idl File Reference

  • ApplicationData
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Files
runtimeclass | Scenario2_Settings
runtimeclass | Scenario3_SettingContainer
runtimeclass | Scenario4_CompositeSettings
runtimeclass | Scenario5_Msappdata
runtimeclass | Scenario6_ClearScenario
runtimeclass | Scenario7_SetVersion
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/SampleConfiguration.cpp File Reference

  • ApplicationData
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/SampleConfiguration.h File Reference

  • ApplicationData
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario1_Files.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario1_Files.cpp File Reference

#include "pch.h"
#include "Scenario1_Files.h"
#include "Scenario1_Files.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario1_Files.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario1_Files.h File Reference

#include "Scenario1_Files.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Files
struct | Scenario1_Files

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario2_Settings.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario2_Settings.cpp File Reference

#include "pch.h"
#include "Scenario2_Settings.h"
#include "Scenario2_Settings.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario2_Settings.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario2_Settings.h File Reference

#include "Scenario2_Settings.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Settings
struct | Scenario2_Settings

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario3_SettingContainer.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario3_SettingContainer.cpp File Reference

#include "pch.h"
#include <sstream>
#include "Scenario3_SettingContainer.h"
#include "Scenario3_SettingContainer.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario3_SettingContainer.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario3_SettingContainer.h File Reference

#include "Scenario3_SettingContainer.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_SettingContainer
struct | Scenario3_SettingContainer

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario4_CompositeSettings.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario4_CompositeSettings.cpp File Reference

#include "pch.h"
#include <sstream>
#include "Scenario4_CompositeSettings.h"
#include "Scenario4_CompositeSettings.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario4_CompositeSettings.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario4_CompositeSettings.h File Reference

#include "Scenario4_CompositeSettings.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_CompositeSettings
struct | Scenario4_CompositeSettings

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario5_Msappdata.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario5_Msappdata.cpp File Reference

#include "pch.h"
#include "Scenario5_Msappdata.h"
#include "Scenario5_Msappdata.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario5_Msappdata.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario5_Msappdata.h File Reference

#include "Scenario5_Msappdata.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5_Msappdata
struct | Scenario5_Msappdata

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario6_ClearScenario.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario6_ClearScenario.cpp File Reference

#include "pch.h"
#include "Scenario6_ClearScenario.h"
#include "Scenario6_ClearScenario.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario6_ClearScenario.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario6_ClearScenario.h File Reference

#include "Scenario6_ClearScenario.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario6_ClearScenario
struct | Scenario6_ClearScenario

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario7_SetVersion.cpp File Reference

  • ApplicationData
  • cppwinrt
Namespaces

Scenario7_SetVersion.cpp File Reference

#include "pch.h"
#include "Scenario7_SetVersion.h"
#include "Scenario7_SetVersion.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario7_SetVersion.h File Reference

  • ApplicationData
  • cppwinrt
Classes | Namespaces

Scenario7_SetVersion.h File Reference

#include "Scenario7_SetVersion.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario7_SetVersion
struct | Scenario7_SetVersion

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/SampleConfiguration.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario1_Files.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario1_Files.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Files

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario2_Settings.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario2_Settings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Settings

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario3_SettingContainer.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario3_SettingContainer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_SettingContainer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario4_CompositeSettings.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario4_CompositeSettings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_CompositeSettings

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario5_Msappdata.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario5_Msappdata.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_Msappdata

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario6_ClearScenario.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario6_ClearScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_ClearScenario

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario7_SetVersion.xaml.cs File Reference

  • ApplicationData
  • cs
Classes | Namespaces

Scenario7_SetVersion.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_SetVersion

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/pch.cpp File Reference

  • ApplicationResources
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/pch.h File Reference

  • ApplicationResources
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/SampleConfiguration.cpp File Reference

  • ApplicationResources
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/SampleConfiguration.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario1.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario1.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario10.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario10.xaml.cpp File Reference

#include "pch.h"
#include "Scenario10.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario10.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario10.xaml.h File Reference

#include "pch.h"
#include "Scenario10.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario11.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario11.xaml.cpp File Reference

#include "pch.h"
#include "Scenario11.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario11.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario11.xaml.h File Reference

#include "pch.h"
#include "Scenario11.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario12.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario12.xaml.cpp File Reference

#include <ppltasks.h>
#include "pch.h"
#include "Scenario12.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario12.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario12.xaml.h File Reference

#include "pch.h"
#include "Scenario12.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario13.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario13.xaml.cpp File Reference

#include "pch.h"
#include "Scenario13.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario13.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario13.xaml.h File Reference

#include "pch.h"
#include "Scenario13.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario2.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario2.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario3.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario3.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario4.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario4.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario5.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario5.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario5.xaml.h File Reference

#include "pch.h"
#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario7.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario7.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario7.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario7.xaml.h File Reference

#include "pch.h"
#include "Scenario7.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario8.xaml.cpp File Reference

  • ApplicationResources
  • cpp

scenario8.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario8.xaml.h File Reference

  • ApplicationResources
  • cpp
Classes | Namespaces

scenario8.xaml.h File Reference

#include "pch.h"
#include "Scenario8.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/constants.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

constants.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario1.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario10.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario10.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario11.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario11.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario12.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario12.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario12
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario13.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario13.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario13
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario2.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario3.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario4.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario5.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario6.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario7.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario7.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario8.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario9.xaml.cs File Reference

  • ApplicationResources
  • cs
Classes | Namespaces

scenario9.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/AppResourceClassLibrary/class1.cs File Reference

  • ApplicationResources
  • cs
  • AppResourceClassLibrary
Classes | Namespaces

class1.cs File Reference

Go to the source code of this file.

Classes

class | LocalizedNamesLibrary

Namespaces

namespace | AppResourceClassLibrary
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/AppResourceClassLibrary/Properties/AssemblyInfo.cs File Reference

  • ApplicationResources
  • cs
  • AppResourceClassLibrary
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/SampleConfiguration.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario1_Define.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario1_Define.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Define

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario2_Add.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario2_Add.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Add

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario3_Replace.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario3_Replace.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Replace

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario4_Remove.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario4_Remove.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Remove

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario5_Show.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario5_Show.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_Show

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario6_Recurrence.xaml.cs File Reference

  • Appointments
  • cs
Classes | Namespaces

Scenario6_Recurrence.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_Recurrence

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Namespaces

KeepConnectionOpenScenario.cpp File Reference

#include "pch.h"
#include "KeepConnectionOpenScenario.h"
#include "KeepConnectionOpenScenario.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Classes | Namespaces

KeepConnectionOpenScenario.h File Reference

#include "KeepConnectionOpenScenario.g.h"

Go to the source code of this file.

Classes

struct | KeepConnectionOpenScenario
struct | KeepConnectionOpenScenario

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Namespaces

OpenCloseConnectionScenario.cpp File Reference

#include "pch.h"
#include "OpenCloseConnectionScenario.h"
#include "OpenCloseConnectionScenario.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Classes | Namespaces

OpenCloseConnectionScenario.h File Reference

#include "OpenCloseConnectionScenario.g.h"

Go to the source code of this file.

Classes

struct | OpenCloseConnectionScenario
struct | OpenCloseConnectionScenario

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/pch.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/pch.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.AppService.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/Project.idl File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | KeepConnectionOpenScenario
runtimeclass | OpenCloseConnectionScenario
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/SampleConfiguration.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/SampleConfiguration.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesClient
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | ensure_close

Namespaces

namespace | winrt::SDKTemplate

Functions

bool | TryParseInt32 (wchar_t const *text, int32_t &value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/pch.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/pch.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/Project.idl File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | ShowPackageFamilyName
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/SampleConfiguration.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/SampleConfiguration.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.cpp File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider
Namespaces

ShowPackageFamilyName.cpp File Reference

#include "pch.h"
#include "ShowPackageFamilyName.h"
#include "ShowPackageFamilyName.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.h File Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider
Classes | Namespaces

ShowPackageFamilyName.h File Reference

#include "ShowPackageFamilyName.g.h"

Go to the source code of this file.

Classes

struct | ShowPackageFamilyName
struct | ShowPackageFamilyName

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/pch.cpp File Reference

  • AppServices
  • cppwinrt
  • RandomNumberService

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/pch.h File Reference

  • AppServices
  • cppwinrt
  • RandomNumberService

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.ApplicationModel.AppService.h>
#include <winrt/Windows.ApplicationModel.Background.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.cpp File Reference

  • AppServices
  • cppwinrt
  • RandomNumberService
Namespaces

RandomNumberGeneratorTask.cpp File Reference

#include "pch.h"
#include "RandomNumberGeneratorTask.h"
#include "RandomNumberGeneratorTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::RandomNumberService::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.h File Reference

  • AppServices
  • cppwinrt
  • RandomNumberService
Classes | Namespaces

RandomNumberGeneratorTask.h File Reference

#include "RandomNumberGeneratorTask.g.h"
#include <random>

Go to the source code of this file.

Classes

struct | RandomNumberGeneratorTask
struct | RandomNumberGeneratorTask

Namespaces

namespace | winrt::RandomNumberService::factory_implementation
namespace | winrt::RandomNumberService::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.idl File Reference

  • AppServices
  • cppwinrt
  • RandomNumberService
Namespaces | Variables

RandomNumberGeneratorTask.idl File Reference

Go to the source code of this file.

Namespaces

namespace | RandomNumberService

Variables

runtimeclass | RandomNumberGeneratorTask
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/KeepConnectionOpenScenario.xaml.cs File Reference

  • AppServices
  • cs
  • AppServicesClient
Classes | Namespaces

KeepConnectionOpenScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | KeepConnectionOpenScenario
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/OpenCloseConnectionScenario.xaml.cs File Reference

  • AppServices
  • cs
  • AppServicesClient
Classes | Namespaces

OpenCloseConnectionScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OpenCloseConnectionScenario
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/SampleConfiguration.cs File Reference

  • AppServices
  • cs
  • AppServicesClient
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesProvider/SampleConfiguration.cs File Reference

  • AppServices
  • cs
  • AppServicesProvider
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesProvider/ShowPackageFamilyName.xaml.cs File Reference

  • AppServices
  • cs
  • AppServicesProvider
Classes | Namespaces

ShowPackageFamilyName.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShowPackageFamilyName
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/RandomNumberGeneratorTask.cs File Reference

  • AppServices
  • cs
  • RandomNumberService
Classes | Namespaces

RandomNumberGeneratorTask.cs File Reference

Go to the source code of this file.

Classes

class | RandomNumberGeneratorTask

Namespaces

namespace | RandomNumberService
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/Properties/AssemblyInfo.cs File Reference

  • AppServices
  • cs
  • RandomNumberService
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/pch.cpp File Reference

  • AppWindow
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/pch.h File Reference

  • AppWindow
  • cppwinrt

pch.h File Reference

#include <unknwn.h>
#include "winrt/coroutine.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.WindowManagement.h"
#include "winrt/Windows.UI.WindowManagement.Preview.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Hosting.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Project.idl File Reference

  • AppWindow
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_SecondaryWindow
runtimeclass | Scenario2_DisplayRegion
runtimeclass | Scenario3_Size
runtimeclass | Scenario4_CompactOverlay
runtimeclass | Scenario5_RelativePositioning
runtimeclass | SecondaryAppWindowPage
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SampleConfiguration.cpp File Reference

  • AppWindow
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SampleConfiguration.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | unique_disabled_control

Namespaces

namespace | winrt::SDKTemplate

Functions

bool | TryParseFloat (hstring const &str, float &result)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario1_SecondaryWindow.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces

Scenario1_SecondaryWindow.cpp File Reference

#include "pch.h"
#include "Scenario1_SecondaryWindow.h"
#include "Scenario1_SecondaryWindow.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario1_SecondaryWindow.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

Scenario1_SecondaryWindow.h File Reference

#include "Scenario1_SecondaryWindow.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_SecondaryWindow
struct | Scenario1_SecondaryWindow

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario2_DisplayRegion.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces

Scenario2_DisplayRegion.cpp File Reference

#include "pch.h"
#include "Scenario2_DisplayRegion.h"
#include "Scenario2_DisplayRegion.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario2_DisplayRegion.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

Scenario2_DisplayRegion.h File Reference

#include "Scenario2_DisplayRegion.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_DisplayRegion
struct | Scenario2_DisplayRegion

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario3_Size.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces | Variables

Scenario3_Size.cpp File Reference

#include "pch.h"
#include "Scenario3_Size.h"
#include "Scenario3_Size.g.cpp"
#include "SampleConfiguration.h"
#include "MainPage.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::implementation

Variables

constexpr float | MinWindowHeight = 48
constexpr float | MinWindowWidth = 192
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario3_Size.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

Scenario3_Size.h File Reference

#include "Scenario3_Size.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_Size
struct | Scenario3_Size

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario4_CompactOverlay.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces

Scenario4_CompactOverlay.cpp File Reference

#include "pch.h"
#include "Scenario4_CompactOverlay.h"
#include "Scenario4_CompactOverlay.g.cpp"
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario4_CompactOverlay.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

Scenario4_CompactOverlay.h File Reference

#include "Scenario4_CompactOverlay.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_CompactOverlay
struct | Scenario4_CompactOverlay

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario5_RelativePositioning.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces

Scenario5_RelativePositioning.cpp File Reference

#include "pch.h"
#include "Scenario5_RelativePositioning.h"
#include "Scenario5_RelativePositioning.g.cpp"
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario5_RelativePositioning.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

Scenario5_RelativePositioning.h File Reference

#include "Scenario5_RelativePositioning.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_RelativePositioning
struct | Scenario5_RelativePositioning

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SecondaryAppWindowPage.cpp File Reference

  • AppWindow
  • cppwinrt
Namespaces

SecondaryAppWindowPage.cpp File Reference

#include "pch.h"
#include "SecondaryAppWindowPage.h"
#include "SecondaryAppWindowPage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SecondaryAppWindowPage.h File Reference

  • AppWindow
  • cppwinrt
Classes | Namespaces

SecondaryAppWindowPage.h File Reference

#include "SecondaryAppWindowPage.g.h"

Go to the source code of this file.

Classes

struct | SecondaryAppWindowPage
struct | SecondaryAppWindowPage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/SampleConfiguration.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario1_SecondaryWindow.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

Scenario1_SecondaryWindow.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SecondaryWindow

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario2_DisplayRegion.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

Scenario2_DisplayRegion.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DisplayRegion

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario3_Size.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

Scenario3_Size.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Size

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario4_CompactOverlay.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

Scenario4_CompactOverlay.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_CompactOverlay

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario5_RelativePositioning.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

Scenario5_RelativePositioning.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_RelativePositioning

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/SecondaryAppWindowPage.xaml.cs File Reference

  • AppWindow
  • cs
Classes | Namespaces

SecondaryAppWindowPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SecondaryAppWindowPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/SampleConfiguration.cs File Reference

  • AssociationLaunching
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/Scenario1_LaunchFile.xaml.cs File Reference

  • AssociationLaunching
  • cs
Classes | Namespaces

Scenario1_LaunchFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_LaunchFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/Scenario2_LaunchUri.xaml.cs File Reference

  • AssociationLaunching
  • cs
Classes | Namespaces

Scenario2_LaunchUri.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_LaunchUri
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/Scenario3_ReceiveFile.xaml.cs File Reference

  • AssociationLaunching
  • cs
Classes | Namespaces

Scenario3_ReceiveFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ReceiveFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/Scenario4_ReceiveUri.xaml.cs File Reference

  • AssociationLaunching
  • cs
Classes | Namespaces

Scenario4_ReceiveUri.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ReceiveUri
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/PlaybackControl.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

PlaybackControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PlaybackControl
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/SampleConfiguration.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario1.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario10.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario10.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario2.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario3.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario4.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario5.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario6.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario7.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario7.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario8.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario9.xaml.cs File Reference

  • AudioCategory
  • cs
  • AudioCategory
Classes | Namespaces

Scenario9.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PlaybackManager
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/SampleConfiguration.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario1_FilePlayback.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario1_FilePlayback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_FilePlayback
Using the AudioGraph API to playback from a file input. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario2_DeviceCapture.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario2_DeviceCapture.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DeviceCapture
This scenario shows using AudioGraph for audio capture from a microphone with low latency. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario3_FrameInputNode.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario3_FrameInputNode.xaml.cs File Reference

Go to the source code of this file.

Classes

interface | IMemoryBufferByteAccess
class | Scenario3_FrameInput
Scenario 3: Using a frame input node to play audio. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario4_Submix.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario4_Submix.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Submix
Shows use of a SubMix node with an effect applied to it. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario5_InboxEffects.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario5_InboxEffects.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_InboxEffects
This scenario is to demonstrate the use of Built-In Effects. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario6_CustomEffects.xaml.cs File Reference

  • AudioCreation
  • cs
  • AudioCreation
Classes | Namespaces

Scenario6_CustomEffects.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_CustomEffects
Using custom effects with the AudioGraph API. More...

Namespaces

namespace | AudioCreation
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/CustomEffect/CustomEffect.cs File Reference

  • AudioCreation
  • cs
  • CustomEffect
Classes | Namespaces

CustomEffect.cs File Reference

Go to the source code of this file.

Classes

class | AudioEchoEffect
interface | IMemoryBufferByteAccess

Namespaces

namespace | CustomEffect
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/CustomEffect/Properties/AssemblyInfo.cs File Reference

  • AudioCreation
  • cs
  • CustomEffect
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/App.xaml.cpp File Reference

  • BackButton
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/App.xaml.h File Reference

  • BackButton
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/MainPage.xaml.cpp File Reference

  • BackButton
  • cpp

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/MainPage.xaml.h File Reference

  • BackButton
  • cpp
Classes | Namespaces | Enumerations

MainPage.xaml.h File Reference

#include "MainPage.g.h"
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/pch.cpp File Reference

  • BackButton
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/pch.h File Reference

  • BackButton
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SampleConfiguration.cpp File Reference

  • BackButton
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SampleConfiguration.h File Reference

  • BackButton
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/Scenario1.xaml.cpp File Reference

  • BackButton
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"
#include "SecondaryPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/Scenario1.xaml.h File Reference

  • BackButton
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SecondaryPage.xaml.cpp File Reference

  • BackButton
  • cpp

SecondaryPage.xaml.cpp File Reference

#include "pch.h"
#include "SecondaryPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SecondaryPage.xaml.h File Reference

  • BackButton
  • cpp
Classes | Namespaces

SecondaryPage.xaml.h File Reference

#include "SecondaryPage.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/App.xaml.cs File Reference

  • BackButton
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/MainPage.xaml.cs File Reference

  • BackButton
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/SampleConfiguration.cs File Reference

  • BackButton
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/Scenario1.xaml.cs File Reference

  • BackButton
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/SecondaryPage.xaml.cs File Reference

  • BackButton
  • cs
Classes | Namespaces

SecondaryPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SecondaryPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/BackgroundActivity.cpp File Reference

  • BackgroundActivation
  • cpp

BackgroundActivity.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "BackgroundActivity.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/BackgroundActivity.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

BackgroundActivity.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/pch.cpp File Reference

  • BackgroundActivation
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/pch.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

pch.h File Reference

#include <vccorlib.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.g.h"
#include "App.xaml.h"

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/SampleConfiguration.cpp File Reference

  • BackgroundActivation
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "BackgroundActivity.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/SampleConfiguration.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces | Defines

SampleConfiguration.h File Reference

#include <collection.h>
#include "App.g.h"
#include "BackgroundActivity.h"

Go to the source code of this file.

Classes

class | BackgroundTaskSample
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate

Defines

#define | ApplicationTriggerTaskName "ApplicationTriggerTask"
#define | BackgroundTaskGroupFriendlyName "Background Task Group"
#define | BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
#define | GroupedBackgroundTaskName "GroupedBackgroundTask"
#define | SampleBackgroundTaskName "SampleBackgroundTask"
#define | SampleBackgroundTaskWithConditionName "SampleBackgroundTaskWithCondition"
#define | ServicingCompleteTaskName "ServicingCompleteTask"
#define | TimeTriggeredTaskName "TimeTriggeredTask"

Define Documentation

#define ApplicationTriggerTaskName "ApplicationTriggerTask"

Definition at line 26 of file SampleConfiguration.h.

#define BackgroundTaskGroupFriendlyName "Background Task Group"

Definition at line 29 of file SampleConfiguration.h.

#define BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"

Definition at line 28 of file SampleConfiguration.h.

#define GroupedBackgroundTaskName "GroupedBackgroundTask"

Definition at line 27 of file SampleConfiguration.h.

#define SampleBackgroundTaskName "SampleBackgroundTask"

Definition at line 22 of file SampleConfiguration.h.

#define SampleBackgroundTaskWithConditionName "SampleBackgroundTaskWithCondition"

Definition at line 23 of file SampleConfiguration.h.

#define ServicingCompleteTaskName "ServicingCompleteTask"

Definition at line 24 of file SampleConfiguration.h.

#define TimeTriggeredTaskName "TimeTriggeredTask"

Definition at line 25 of file SampleConfiguration.h.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario1_SampleBackgroundTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SampleBackgroundTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario1_SampleBackgroundTask.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario1_SampleBackgroundTask.xaml.h File Reference

#include "pch.h"
#include "Scenario1_SampleBackgroundTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_SampleBackgroundTaskWithCondition.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario2_SampleBackgroundTaskWithCondition.xaml.h File Reference

#include "pch.h"
#include "Scenario2_SampleBackgroundTaskWithCondition.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario3_ServicingCompleteTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ServicingCompleteTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario3_ServicingCompleteTask.xaml.h File Reference

#include "pch.h"
#include "Scenario3_ServicingCompleteTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario4_TimeTriggeredTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_TimeTriggeredTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario4_TimeTriggeredTask.xaml.h File Reference

#include "pch.h"
#include "Scenario4_TimeTriggeredTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario5_ApplicationTriggerTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_ApplicationTriggerTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario5_ApplicationTriggerTask.xaml.h File Reference

#include <ppltasks.h>
#include "pch.h"
#include "Scenario5_ApplicationTriggerTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp File Reference

  • BackgroundActivation
  • cpp

Scenario6_GroupedTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_GroupedTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h File Reference

  • BackgroundActivation
  • cpp
Classes | Namespaces

Scenario6_GroupedTask.xaml.h File Reference

#include <ppltasks.h>
#include "pch.h"
#include "Scenario6_GroupedTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/BackgroundActivity.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

BackgroundActivity.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundActivity

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/SampleConfiguration.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | BackgroundTaskSample
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario1_SampleBackgroundTask.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario1_SampleBackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SampleBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario2_SampleBackgroundTaskWithCondition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SampleBackgroundTaskWithCondition
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario3_ServicingCompleteTask.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario3_ServicingCompleteTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ServicingCompleteTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario4_TimeTriggeredTask.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario4_TimeTriggeredTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TimeTriggeredTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario5_ApplicationTriggerTask.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario5_ApplicationTriggerTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ApplicationTriggerTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs File Reference

  • BackgroundActivation
  • cs
Classes | Namespaces

Scenario6_GroupedTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | GroupedBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/App.xaml.cs File Reference

  • BackgroundMediaPlayback
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/BackgroundApp.cs File Reference

  • BackgroundMediaPlayback
  • cs
Classes | Namespaces

BackgroundApp.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/SampleConfiguration.cs File Reference

  • BackgroundMediaPlayback
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Scenario1.xaml.cs File Reference

  • BackgroundMediaPlayback
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BackgroundMediaPlayback
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Settings.xaml.cs File Reference

  • BackgroundMediaPlayback
  • cs
Classes | Namespaces

Settings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Settings
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BackgroundMediaPlayback
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/MediaItem.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • DataModels
Classes | Namespaces

MediaItem.cs File Reference

Go to the source code of this file.

Classes

class | MediaItem

Namespaces

namespace | BackgroundMediaPlayback::DataModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/MediaList.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • DataModels
Classes | Namespaces

MediaList.cs File Reference

Go to the source code of this file.

Classes

class | MediaList

Namespaces

namespace | BackgroundMediaPlayback::DataModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/MusicItem.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • DataModels
Classes | Namespaces

MusicItem.cs File Reference

Go to the source code of this file.

Classes

class | MusicItem

Namespaces

namespace | BackgroundMediaPlayback::DataModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/VideoItem.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • DataModels
Classes | Namespaces

VideoItem.cs File Reference

Go to the source code of this file.

Classes

class | VideoItem

Namespaces

namespace | BackgroundMediaPlayback::DataModels
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Services/PlaybackService.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • Services
Classes | Namespaces

PlaybackService.cs File Reference

Go to the source code of this file.

Classes

class | PlaybackService
The central authority on playback in the application providing access to the player and active playlist. More...

Namespaces

namespace | BackgroundMediaPlayback::Services
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Services/SettingsService.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • Services
Classes | Namespaces

SettingsService.cs File Reference

Go to the source code of this file.

Classes

class | SettingsService

Namespaces

namespace | BackgroundMediaPlayback::Services
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/MediaItemViewModel.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

MediaItemViewModel.cs File Reference

Go to the source code of this file.

Classes

class | MediaItemViewModel
View model for media items. More...

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/MediaListViewModel.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

MediaListViewModel.cs File Reference

Go to the source code of this file.

Classes

class | MediaListViewModel
View model for a list of media items. More...

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/PlaybackSessionViewModel.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

PlaybackSessionViewModel.cs File Reference

Go to the source code of this file.

Classes

class | PlaybackSessionViewModel

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/PlaybackStateToButtonIconConverter.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

PlaybackStateToButtonIconConverter.cs File Reference

Go to the source code of this file.

Classes

class | PlaybackStateToButtonIconConverter

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/PlayerViewModel.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

PlayerViewModel.cs File Reference

Go to the source code of this file.

Classes

class | PlayerViewModel
The view model for the player. More...

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/SettingsViewModel.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels
Classes | Namespaces

SettingsViewModel.cs File Reference

Go to the source code of this file.

Classes

class | SettingsViewModel

Namespaces

namespace | BackgroundMediaPlayback::ViewModels
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Views/PlaylistView.xaml.cs File Reference

  • BackgroundMediaPlayback
  • cs
  • Views
Classes | Namespaces

PlaylistView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PlaylistView
A custom control for playlists that wraps a ListView. More...

Namespaces

namespace | BackgroundMediaPlayback
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/pch.cpp File Reference

  • BackgroundSensors
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/pch.h File Reference

  • BackgroundSensors
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/SampleConfiguration.cpp File Reference

  • BackgroundSensors
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/SampleConfiguration.h File Reference

  • BackgroundSensors
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::SampleConstants
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.cpp File Reference

  • BackgroundSensors
  • cpp

Scenario1_DeviceUse.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DeviceUse.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.h File Reference

  • BackgroundSensors
  • cpp
Classes | Namespaces

Scenario1_DeviceUse.xaml.h File Reference

#include "Scenario1_DeviceUse.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/pch.cpp File Reference

  • BackgroundSensors
  • cpp
  • BackgroundTask

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/pch.h File Reference

  • BackgroundSensors
  • cpp
  • BackgroundTask

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.cpp File Reference

  • BackgroundSensors
  • cpp
  • BackgroundTask

Scenario1_BackgroundTask.cpp File Reference

#include "pch.h"
#include "Scenario1_BackgroundTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.h File Reference

  • BackgroundSensors
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario1_BackgroundTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/SampleConfiguration.cs File Reference

  • BackgroundSensors
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | SampleConstants
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/Scenario1_DeviceUse.xaml.cs File Reference

  • BackgroundSensors
  • cs
Classes | Namespaces

Scenario1_DeviceUse.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DeviceUse
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/BackgroundTask/Scenario1_BackgroundTask.cs File Reference

  • BackgroundSensors
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario1_BackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_BackgroundTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/BackgroundTask/Properties/AssemblyInfo.cs File Reference

  • BackgroundSensors
  • cs
  • BackgroundTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/pch.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/pch.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

pch.h File Reference

#include <vccorlib.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/SampleConfiguration.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/SampleConfiguration.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces | Defines

SampleConfiguration.h File Reference

#include <collection.h>

Go to the source code of this file.

Classes

class | BackgroundTaskSample
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate

Defines

#define | ApplicationTriggerTaskName "ApplicationTriggerTask"
#define | BackgroundTaskGroupFriendlyName "Background Task Group"
#define | BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
#define | GroupedBackgroundTaskName "GroupedBackgroundTask"
#define | SampleBackgroundTaskEntryPoint "Tasks.SampleBackgroundTask"
#define | SampleBackgroundTaskName "SampleBackgroundTask"
#define | SampleBackgroundTaskWithConditionName "SampleBackgroundTaskWithCondition"
#define | ServicingCompleteTaskEntryPoint "Tasks.ServicingComplete"
#define | ServicingCompleteTaskName "ServicingCompleteTask"
#define | TimeTriggeredTaskName "TimeTriggeredTask"

Define Documentation

#define ApplicationTriggerTaskName "ApplicationTriggerTask"

Definition at line 25 of file SampleConfiguration.h.

#define BackgroundTaskGroupFriendlyName "Background Task Group"

Definition at line 28 of file SampleConfiguration.h.

#define BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"

Definition at line 27 of file SampleConfiguration.h.

#define GroupedBackgroundTaskName "GroupedBackgroundTask"

Definition at line 26 of file SampleConfiguration.h.

#define SampleBackgroundTaskEntryPoint "Tasks.SampleBackgroundTask"

Definition at line 19 of file SampleConfiguration.h.

#define SampleBackgroundTaskName "SampleBackgroundTask"

Definition at line 20 of file SampleConfiguration.h.

#define SampleBackgroundTaskWithConditionName "SampleBackgroundTaskWithCondition"

Definition at line 21 of file SampleConfiguration.h.

#define ServicingCompleteTaskEntryPoint "Tasks.ServicingComplete"

Definition at line 22 of file SampleConfiguration.h.

#define ServicingCompleteTaskName "ServicingCompleteTask"

Definition at line 23 of file SampleConfiguration.h.

#define TimeTriggeredTaskName "TimeTriggeredTask"

Definition at line 24 of file SampleConfiguration.h.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario1_SampleBackgroundTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SampleBackgroundTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario1_SampleBackgroundTask.xaml.h File Reference

#include "pch.h"
#include "Scenario1_SampleBackgroundTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_SampleBackgroundTaskWithCondition.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario2_SampleBackgroundTaskWithCondition.xaml.h File Reference

#include "pch.h"
#include "Scenario2_SampleBackgroundTaskWithCondition.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario3_ServicingCompleteTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ServicingCompleteTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario3_ServicingCompleteTask.xaml.h File Reference

#include "pch.h"
#include "Scenario3_ServicingCompleteTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario4_TimeTriggeredTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_TimeTriggeredTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario4_TimeTriggeredTask.xaml.h File Reference

#include "pch.h"
#include "Scenario4_TimeTriggeredTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario5_ApplicationTriggerTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_ApplicationTriggerTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario5_ApplicationTriggerTask.xaml.h File Reference

#include <ppltasks.h>
#include "pch.h"
#include "Scenario5_ApplicationTriggerTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.cpp File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario6_GroupedTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_GroupedTask.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario6_GroupedTask.xaml.h File Reference

  • BackgroundTask
  • cpp
  • BackgroundTask
Classes | Namespaces

Scenario6_GroupedTask.xaml.h File Reference

#include <ppltasks.h>
#include "pch.h"
#include "Scenario6_GroupedTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/pch.cpp File Reference

  • BackgroundTask
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/pch.h File Reference

  • BackgroundTask
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/SampleBackgroundTask.cpp File Reference

  • BackgroundTask
  • cpp
  • Tasks

SampleBackgroundTask.cpp File Reference

#include "pch.h"
#include "SampleBackgroundTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/SampleBackgroundTask.h File Reference

  • BackgroundTask
  • cpp
  • Tasks
Classes | Namespaces

SampleBackgroundTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/ServicingComplete.cpp File Reference

  • BackgroundTask
  • cpp
  • Tasks

ServicingComplete.cpp File Reference

#include "pch.h"
#include "ServicingComplete.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/ServicingComplete.h File Reference

  • BackgroundTask
  • cpp
  • Tasks
Classes | Namespaces

ServicingComplete.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundTaskSample
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario1_SampleBackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SampleBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario2_SampleBackgroundTaskWithCondition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SampleBackgroundTaskWithCondition
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario3_ServicingCompleteTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ServicingCompleteTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario4_TimeTriggeredTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TimeTriggeredTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario5_ApplicationTriggerTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ApplicationTriggerTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario6_GroupedTask.xaml.cs File Reference

  • BackgroundTask
  • cs
  • BackgroundTask
Classes | Namespaces

Scenario6_GroupedTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | GroupedBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/SampleBackgroundTask.cs File Reference

  • BackgroundTask
  • cs
  • Tasks
Classes | Namespaces

SampleBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | SampleBackgroundTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/ServicingComplete.cs File Reference

  • BackgroundTask
  • cs
  • Tasks
Classes | Namespaces

ServicingComplete.cs File Reference

Go to the source code of this file.

Classes

class | ServicingComplete

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • BackgroundTask
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/pch.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/pch.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | StringTrimmer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario1_Download.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Download.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario1_Download.xaml.h File Reference

#include "pch.h"
#include "Scenario1_Download.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

struct | GuidComparer
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario2_Upload.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Upload.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario2_Upload.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Upload.g.h"
#include "MainPage.xaml.h"
#include "Collection.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed::sealed

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario3_Notifications.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Notifications.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario3_Notifications.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Notifications.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario4_CompletionGroups.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_CompletionGroups.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario4_CompletionGroups.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario4_CompletionGroups.xaml.h File Reference

#include "pch.h"
#include "Scenario4_CompletionGroups.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario5_RandomAccess.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_RandomAccess.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario5_RandomAccess.xaml.h File Reference

#include "pch.h"
#include "Scenario5_RandomAccess.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario6_RecoverableErrors.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_RecoverableErrors.xaml.h"
#include <assert.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario6_RecoverableErrors.xaml.h File Reference

#include "pch.h"
#include "Scenario6_RecoverableErrors.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cpp File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario7_DownloadReordering.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_DownloadReordering.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.h File Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer
Classes | Namespaces

Scenario7_DownloadReordering.xaml.h File Reference

#include "pch.h"
#include "Scenario7_DownloadReordering.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/CompletionGroupTask.cpp File Reference

  • BackgroundTransfer
  • cpp
  • Tasks

CompletionGroupTask.cpp File Reference

#include "pch.h"
#include "CompletionGroupTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/CompletionGroupTask.h File Reference

  • BackgroundTransfer
  • cpp
  • Tasks
Classes | Namespaces

CompletionGroupTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/pch.cpp File Reference

  • BackgroundTransfer
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/pch.h File Reference

  • BackgroundTransfer
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/SampleConfiguration.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario1_Download.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario1_Download.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Download
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario2_Upload.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario2_Upload.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Upload
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario3_Notifications.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario3_Notifications.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Notifications
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario4_CompletionGroups.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_CompletionGroups

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario5_RandomAccess.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario5_RandomAccess.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_RandomAccess

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario6_RecoverableErrors.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_RecoverableErrors

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cs File Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer
Classes | Namespaces

Scenario7_DownloadReordering.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DownloadOperationItem
class | Scenario7_DownloadReordering

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/Tasks/CompletionGroupTask.cs File Reference

  • BackgroundTransfer
  • cs
  • Tasks
Classes | Namespaces

CompletionGroupTask.cs File Reference

Go to the source code of this file.

Classes

class | CompletionGroupTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • BackgroundTransfer
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BarcodeScannerInfo.cpp File Reference

  • BarcodeScanner
  • cppwinrt

BarcodeScannerInfo.cpp File Reference

#include "pch.h"
#include "BarcodeScannerInfo.h"
#include "BarcodeScannerInfo.g.cpp"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BarcodeScannerInfo.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

BarcodeScannerInfo.h File Reference

#include "BarcodeScannerInfo.g.h"

Go to the source code of this file.

Classes

struct | BarcodeScannerInfo
struct | BarcodeScannerInfo

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BindingHelpers.cpp File Reference

  • BarcodeScanner
  • cppwinrt

BindingHelpers.cpp File Reference

#include "pch.h"
#include "BindingHelpers.h"
#include "BindingHelpers.g.cpp"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BindingHelpers.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

BindingHelpers.h File Reference

#include "BindingHelpers.g.h"

Go to the source code of this file.

Classes

struct | BindingHelpers
struct | BindingHelpers

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/DataHelpers.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces | Functions

DataHelpers.cpp File Reference

#include "pch.h"
#include <sstream>
#include <iomanip>
#include "DataHelpers.h"

Go to the source code of this file.

Namespaces

namespace | winrt

Functions

winrt::hstring | GetDataLabelString (winrt::IBuffer const &data, uint32_t scanDataType)
std::wstring | GetDataString (winrt::IBuffer const &data)

Function Documentation

winrt::hstring GetDataLabelString | ( | winrt::IBuffer const & | data,
 |  | uint32_t | scanDataType
 | ) |  |

Definition at line 50 of file DataHelpers.cpp.

{
    // Only certain data types contain encoded text.
    //   To keep this simple, we'll just decode a few of them.
    if (!data)
    {
        return L"No data";
    }

    if (scanDataType == winrt::BarcodeSymbologies::Upca() ||
        scanDataType == winrt::BarcodeSymbologies::UpcaAdd2() ||
        scanDataType == winrt::BarcodeSymbologies::UpcaAdd5() ||
        scanDataType == winrt::BarcodeSymbologies::Upce() ||
        scanDataType == winrt::BarcodeSymbologies::UpceAdd2() ||
        scanDataType == winrt::BarcodeSymbologies::UpceAdd5() ||
        scanDataType == winrt::BarcodeSymbologies::Ean8() ||
        scanDataType == winrt::BarcodeSymbologies::TfStd() ||
        scanDataType == winrt::BarcodeSymbologies::OcrA() ||
        scanDataType == winrt::BarcodeSymbologies::OcrB())
    {
        // The UPC, EAN8, and 2 of 5 families encode the digits 0..9
        // which are then sent to the app in a UTF8 string (like "01234")

        // This is not an exhaustive list of symbologies that can be converted to a string

        winrt::DataReader reader = winrt::DataReader::FromBuffer(data);
        return reader.ReadString(data.Length());
    }
    else
    {
        // Some other symbologies (typically 2-D symbologies) contain binary data that
        //  should not be converted to text.
        return winrt::hstring{ L"Decoded data unavailable. Raw label data: " + GetDataString(data) };
    }
}

std::wstring GetDataString ( winrt::IBuffer const & data )

Definition at line 23 of file DataHelpers.cpp.

{
    if (!data)
    {
        return L"No data";
    }

    // Just to show that we have the raw data, we'll print the value of the bytes.
    // Arbitrarily limit the number of bytes printed so the UI isn't overloaded.
    const unsigned int MAX_BYTES_TO_PRINT = 20;
    unsigned int byteCount = (std::min)(data.Length(), MAX_BYTES_TO_PRINT);

    std::wstringstream buffer;
    buffer << std::setfill(L'0') << std::hex;
    for (uint32_t value : winrt::array_view(data.data(), byteCount))
    {
        buffer << std::setw(2) << value  << L" ";
    }

    if (byteCount < data.Length())
    {
        buffer << L"...";
    }

    return buffer.str();
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/DataHelpers.h File Reference

  • BarcodeScanner
  • cppwinrt
Functions

DataHelpers.h File Reference

Go to the source code of this file.

Functions

winrt::hstring | GetDataLabelString (winrt::Windows::Storage::Streams::IBuffer const &data, uint32_t scanDataType)
std::wstring | GetDataString (winrt::Windows::Storage::Streams::IBuffer const &data)

Function Documentation

winrt::hstring GetDataLabelString | ( | winrt::Windows::Storage::Streams::IBuffer const & | data,
 |  | uint32_t | scanDataType
 | ) |  |
std::wstring GetDataString ( winrt::Windows::Storage::Streams::IBuffer const & data )
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/pch.cpp File Reference

  • BarcodeScanner
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/pch.h File Reference

  • BarcodeScanner
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.System.Display.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Data.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Devices.PointOfService.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.h"
#include "winrt/Windows.Graphics.Display.h"
#include "winrt/Windows.Media.h"
#include "winrt/Windows.Media.Capture.h"
#include "winrt/Windows.Media.Devices.h"
#include "winrt/Windows.Media.MediaProperties.h"
#include "DataHelpers.h"
#include "BarcodeScannerInfo.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Project.idl File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_BasicFunctionality
runtimeclass | Scenario2_MultipleScanners
runtimeclass | Scenario3_ActiveSymbologies
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SampleConfiguration.cpp File Reference

  • BarcodeScanner
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SampleConfiguration.h File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

Scenario1_BasicFunctionality.cpp File Reference

#include "pch.h"
#include <thread>
#include <mutex>
#include "Scenario1_BasicFunctionality.h"
#include "Scenario1_BasicFunctionality.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

Scenario1_BasicFunctionality.h File Reference

#include "Scenario1_BasicFunctionality.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_BasicFunctionality
struct | Scenario1_BasicFunctionality

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

Scenario2_MultipleScanners.cpp File Reference

#include "pch.h"
#include "Scenario2_MultipleScanners.h"
#include "Scenario2_MultipleScanners.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

Scenario2_MultipleScanners.h File Reference

#include "Scenario2_MultipleScanners.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_MultipleScanners
struct | Scenario2_MultipleScanners

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

Scenario3_ActiveSymbologies.cpp File Reference

#include "pch.h"
#include "Scenario3_ActiveSymbologies.h"
#include "Scenario3_ActiveSymbologies.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

Scenario3_ActiveSymbologies.h File Reference

#include "Scenario3_ActiveSymbologies.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_ActiveSymbologies
struct | Scenario3_ActiveSymbologies

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

Scenario4_SymbologyAttributes.cpp File Reference

#include "pch.h"
#include "Scenario4_SymbologyAttributes.h"
#include "Scenario4_SymbologyAttributes.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

Scenario4_SymbologyAttributes.h File Reference

#include "Scenario4_SymbologyAttributes.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_SymbologyAttributes
struct | Scenario4_SymbologyAttributes

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.cpp File Reference

  • BarcodeScanner
  • cppwinrt
Namespaces

Scenario5_DisplayingBarcodePreview.cpp File Reference

#include "pch.h"
#include "Scenario5_DisplayingBarcodePreview.h"
#include "Scenario5_DisplayingBarcodePreview.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario5_DisplayingBarcodePreview.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

Scenario5_DisplayingBarcodePreview.h File Reference

#include "Scenario5_DisplayingBarcodePreview.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_DisplayingBarcodePreview
struct | Scenario5_DisplayingBarcodePreview

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SymbologyListEntry.cpp File Reference

  • BarcodeScanner
  • cppwinrt

SymbologyListEntry.cpp File Reference

#include "pch.h"
#include "SymbologyListEntry.h"
#include "SymbologyListEntry.g.cpp"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SymbologyListEntry.h File Reference

  • BarcodeScanner
  • cppwinrt
Classes | Namespaces

SymbologyListEntry.h File Reference

#include "SymbologyListEntry.g.h"

Go to the source code of this file.

Classes

struct | SymbologyListEntry
struct | SymbologyListEntry

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/SampleConfiguration.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | BarcodeScannerInfo
This class is used for data-binding. More...
class | BindingHelpers
class | DataHelpers
class | DeviceHelpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | SymbologyListEntry
This class is used for data-binding. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario1_BasicFunctionality.xaml.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

Scenario1_BasicFunctionality.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_BasicFunctionality
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario2_MultipleScanners.xaml.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

Scenario2_MultipleScanners.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_MultipleScanners
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario3_ActiveSymbologies.xaml.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

Scenario3_ActiveSymbologies.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ActiveSymbologies

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario4_SymbologyAttributes.xaml.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

Scenario4_SymbologyAttributes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_SymbologyAttributes

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario5_DisplayingBarcodePreview.xaml.cs File Reference

  • BarcodeScanner
  • cs
Classes | Namespaces

Scenario5_DisplayingBarcodePreview.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_DisplayingBarcodePreview

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Namespaces | Variables

BarcodeDecoder.cpp File Reference

#include "pch.h"
#include "BarcodeDecoder.h"
#include "Provider.h"

Go to the source code of this file.

Namespaces

namespace | BarcodeDecoder

Variables

Provider | provider = nullptr
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Classes | Namespaces

BarcodeDecoder.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Namespaces

DecodeEngine.cpp File Reference

#include "pch.h"
#include "DecodeEngine.h"

Go to the source code of this file.

Namespaces

namespace BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Classes | Namespaces

DecodeEngine.h File Reference

Go to the source code of this file.

Classes

class | DecodeEngine
class | DecodeResult

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/pch.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/pch.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Namespaces

Provider.cpp File Reference

#include "pch.h"
#include "Provider.h"

Go to the source code of this file.

Namespaces

namespace BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/Provider.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder
Classes | Namespaces

Provider.h File Reference

#include "pch.h"
#include "DecodeEngine.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/pch.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/pch.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "Scenario1_Configuration.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DeviceHelpers

Functions

Concurrency::task< void > | completed_ui_task ()
Concurrency::task
< Windows::Devices::PointOfService::BarcodeScanner^> 		GetFirstBarcodeScannerAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.cpp File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

Scenario1_Configuration.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Configuration.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.h File Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider
Classes | Namespaces

Scenario1_Configuration.xaml.h File Reference

#include "Scenario1_Configuration.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/BarcodeDecoder.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
Classes | Namespaces

BarcodeDecoder.cs File Reference

Go to the source code of this file.

Classes

class | BarcodeDecodeTask

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/DecodeEngine.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
Classes | Namespaces

DecodeEngine.cs File Reference

Go to the source code of this file.

Classes

class | DecodeEngine
class | DecodeResult

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/Provider.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
Classes | Namespaces

Provider.cs File Reference

Go to the source code of this file.

Classes

class | Provider

Namespaces

namespace | BarcodeDecoder
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/Properties/AssemblyInfo.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeScannerProvider/SampleConfiguration.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeScannerProvider
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeScannerProvider/Scenario1_Configuration.xaml.cs File Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeScannerProvider
Classes | Namespaces

Scenario1_Configuration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Configuration
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/pch.cpp File Reference

  • Barometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/pch.h File Reference

  • Barometer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/SampleConfiguration.cpp File Reference

  • Barometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/SampleConfiguration.h File Reference

  • Barometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Barometer
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Barometer
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/Scenario2_Polling.xaml.cpp File Reference

  • Barometer
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/Scenario2_Polling.xaml.h File Reference

  • Barometer
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cs/SampleConfiguration.cs File Reference

  • Barometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Barometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cs/Scenario2_Polling.xaml.cs File Reference

  • Barometer
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/pch.cpp File Reference

  • BasicFaceDetection
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/pch.h File Reference

  • BasicFaceDetection
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Graphics.Imaging.h"
#include "winrt/Windows.Media.h"
#include "winrt/Windows.Media.Capture.h"
#include "winrt/Windows.Media.Devices.h"
#include "winrt/Windows.Media.FaceAnalysis.h"
#include "winrt/Windows.Media.MediaProperties.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Project.idl File Reference

  • BasicFaceDetection
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_DetectInPhoto
runtimeclass | Scenario2_DetectInWebcam
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/SampleConfiguration.cpp File Reference

  • BasicFaceDetection
  • cppwinrt
Functions

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Functions

void ApplyScale (FrameworkElement const &box, double widthScale, double heightScale)

Function Documentation

void ApplyScale | ( | FrameworkElement const & | box,
 |  | double | widthScale,
 |  | double | heightScale
 | ) |  |

Definition at line 40 of file SampleConfiguration.cpp.

{
    // We saved the original size of the face box in the element's Tag field.
    BitmapBounds faceBox = unbox_value<BitmapBounds>(box.Tag());
    box.Width(faceBox.Width * widthScale);
    box.Height(faceBox.Height * heightScale);
    box.Margin({ faceBox.X * widthScale, faceBox.Y * heightScale, 0, 0 });
}

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/SampleConfiguration.h File Reference

  • BasicFaceDetection
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::SampleHelpers

Functions

void | HighlightFaces (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces, Windows::UI::Xaml::Controls::Canvas const &canvas, Windows::UI::Xaml::DataTemplate const &dataTemplate)
void | RepositionFaces (Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::UI::Xaml::Controls::Canvas const &canvas)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.cpp File Reference

  • BasicFaceDetection
  • cppwinrt
Namespaces

Scenario1_DetectInPhoto.cpp File Reference

#include "pch.h"
#include "Scenario1_DetectInPhoto.h"
#include "Scenario1_DetectInPhoto.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.h File Reference

  • BasicFaceDetection
  • cppwinrt
Classes | Namespaces

Scenario1_DetectInPhoto.h File Reference

#include "Scenario1_DetectInPhoto.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_DetectInPhoto
struct | Scenario1_DetectInPhoto

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.cpp File Reference

  • BasicFaceDetection
  • cppwinrt
Namespaces

Scenario2_DetectInWebcam.cpp File Reference

#include "pch.h"
#include "Scenario2_DetectInWebcam.h"
#include "Scenario2_DetectInWebcam.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario2_DetectInWebcam.h File Reference

  • BasicFaceDetection
  • cppwinrt
Classes | Namespaces

Scenario2_DetectInWebcam.h File Reference

#include "Scenario2_DetectInWebcam.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_DetectInWebcam
struct | Scenario2_DetectInWebcam

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/SampleConfiguration.cs File Reference

  • BasicFaceDetection
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/Scenario1_DetectInPhoto.xaml.cs File Reference

  • BasicFaceDetection
  • cs
Classes | Namespaces

Scenario1_DetectInPhoto.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DetectInPhoto
Page for demonstrating FaceDetection on an image file. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/Scenario2_DetectInWebcam.xaml.cs File Reference

  • BasicFaceDetection
  • cs
Classes | Namespaces

Scenario2_DetectInWebcam.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DetectInWebcam
Page for demonstrating FaceDetection on a webcam snapshot. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/pch.cpp File Reference

  • BasicFaceTracking
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/pch.h File Reference

  • BasicFaceTracking
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Graphics.Imaging.h"
#include "winrt/Windows.Media.h"
#include "winrt/Windows.Media.Capture.h"
#include "winrt/Windows.Media.Devices.h"
#include "winrt/Windows.Media.FaceAnalysis.h"
#include "winrt/Windows.Media.MediaProperties.h"
#include "winrt/Windows.System.Threading.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.UI.Xaml.Shapes.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/Project.idl File Reference

  • BasicFaceTracking
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_TrackInWebcam
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/SampleConfiguration.cpp File Reference

  • BasicFaceTracking
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/SampleConfiguration.h File Reference

  • BasicFaceTracking
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

hstring | to_hstring (Windows::Graphics::Imaging::BitmapPixelFormat format)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.cpp File Reference

  • BasicFaceTracking
  • cppwinrt
Namespaces

Scenario1_TrackInWebcam.cpp File Reference

#include "pch.h"
#include "Scenario1_TrackInWebcam.h"
#include "Scenario1_TrackInWebcam.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.h File Reference

  • BasicFaceTracking
  • cppwinrt
Classes | Namespaces

Scenario1_TrackInWebcam.h File Reference

#include "Scenario1_TrackInWebcam.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_TrackInWebcam
struct | Scenario1_TrackInWebcam

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cs/SampleConfiguration.cs File Reference

  • BasicFaceTracking
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cs/Scenario1_TrackInWebcam.xaml.cs File Reference

  • BasicFaceTracking
  • cs
Classes | Namespaces

Scenario1_TrackInWebcam.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_TrackInWebcam
Page for demonstrating FaceTracking. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/AppView.cpp File Reference

  • BasicHologram
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 18 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/AppView.h File Reference

  • BasicHologram
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "BasicHologramMain.h"
#include "Common\DeviceResources.h"
#include "BasicHologramMain.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/BasicHologramMain.cpp File Reference

  • BasicHologram
  • cpp

BasicHologramMain.cpp File Reference

#include "pch.h"
#include "BasicHologramMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/BasicHologramMain.h File Reference

  • BasicHologram
  • cpp
Classes | Namespaces | Defines

BasicHologramMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | BasicHologramMain
struct | BasicHologramMain::GamepadWithButtonState

Namespaces

namespace | BasicHologram

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 11 of file BasicHologramMain.h.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/pch.cpp File Reference

  • BasicHologram
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/pch.h File Reference

  • BasicHologram
  • cpp

pch.h File Reference

#include <agile.h>
#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <vector>
#include <wincodec.h>
#include <WindowsNumerics.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/CameraResources.cpp File Reference

  • BasicHologram
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/CameraResources.h File Reference

  • BasicHologram
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/DeviceResources.cpp File Reference

  • BasicHologram
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/DeviceResources.h File Reference

  • BasicHologram
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/DirectXHelper.h File Reference

  • BasicHologram
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/StepTimer.h File Reference

  • BasicHologram
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/ShaderStructures.h File Reference

  • BasicHologram
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | VertexPositionColor

Namespaces

namespace | BasicHologram

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/SpatialInputHandler.cpp File Reference

  • BasicHologram
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/SpatialInputHandler.h File Reference

  • BasicHologram
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/SpinningCubeRenderer.cpp File Reference

  • BasicHologram
  • cpp
  • Content

SpinningCubeRenderer.cpp File Reference

#include "pch.h"
#include "SpinningCubeRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/SpinningCubeRenderer.h File Reference

  • BasicHologram
  • cpp
  • Content
Classes | Namespaces

SpinningCubeRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SpinningCubeRenderer

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/AppView.cpp File Reference

  • BasicHologram
  • cppwinrt
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"

Go to the source code of this file.

Functions

int __stdcall wWinMain (HINSTANCE, HINSTANCE, PWSTR, int)

Function Documentation

int __stdcall wWinMain | ( | HINSTANCE | ,
 |  | HINSTANCE | ,
 |  | PWSTR | ,
 |  | int |
 | ) |  |

Definition at line 16 of file AppView.cpp.

{
    winrt::init_apartment();
    CoreApplication::Run(AppViewSource());
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/AppView.h File Reference

  • BasicHologram
  • cppwinrt
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "BasicHologramMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/BasicHologramMain.cpp File Reference

  • BasicHologram
  • cppwinrt

BasicHologramMain.cpp File Reference

#include "pch.h"
#include "BasicHologramMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/BasicHologramMain.h File Reference

  • BasicHologram
  • cppwinrt
Classes | Namespaces | Defines

BasicHologramMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | BasicHologramMain
struct | BasicHologramMain::GamepadWithButtonState

Namespaces

namespace | BasicHologram

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 11 of file BasicHologramMain.h.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/pch.cpp File Reference

  • BasicHologram
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/pch.h File Reference

  • BasicHologram
  • cppwinrt

pch.h File Reference

#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <future>
#include <map>
#include <mutex>
#include <vector>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <Windows.Graphics.Directx.Direct3D11.Interop.h>
#include <wrl\client.h>
#include <winrt\base.h>
#include <winrt\Windows.ApplicationModel.Activation.h>
#include <winrt\Windows.ApplicationModel.Core.h>
#include <winrt\Windows.Foundation.h>
#include <winrt\Windows.Foundation.Collections.h>
#include <winrt\Windows.Foundation.Metadata.h>
#include <winrt\Windows.Gaming.Input.h>
#include <winrt\Windows.Graphics.Display.h>
#include <winrt\Windows.Graphics.Holographic.h>
#include <winrt\Windows.Perception.People.h>
#include <winrt\Windows.Perception.Spatial.h>
#include <winrt\Windows.Storage.h>
#include <winrt\Windows.Storage.Streams.h>
#include <winrt\Windows.UI.Core.h>
#include <winrt\Windows.UI.Input.Spatial.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/CameraResources.cpp File Reference

  • BasicHologram
  • cppwinrt
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/CameraResources.h File Reference

  • BasicHologram
  • cppwinrt
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/DeviceResources.cpp File Reference

  • BasicHologram
  • cppwinrt
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/DeviceResources.h File Reference

  • BasicHologram
  • cppwinrt
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/DirectXHelper.h File Reference

  • BasicHologram
  • cppwinrt
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface | CreateDepthTextureInteropObject (const Microsoft::WRL::ComPtr< ID3D11Texture2D > spTexture2D)
std::future< std::vector< byte > > | ReadDataAsync (const std::wstring_view &filename)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/StepTimer.h File Reference

  • BasicHologram
  • cppwinrt
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/ShaderStructures.h File Reference

  • BasicHologram
  • cppwinrt
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | VertexPositionColor

Namespaces

namespace | BasicHologram

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpatialInputHandler.cpp File Reference

  • BasicHologram
  • cppwinrt
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpatialInputHandler.h File Reference

  • BasicHologram
  • cppwinrt
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpinningCubeRenderer.cpp File Reference

  • BasicHologram
  • cppwinrt
  • Content

SpinningCubeRenderer.cpp File Reference

#include "pch.h"
#include "SpinningCubeRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpinningCubeRenderer.h File Reference

  • BasicHologram
  • cppwinrt
  • Content
Classes | Namespaces

SpinningCubeRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SpinningCubeRenderer

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/AppView.cs File Reference

  • BasicHologram
  • cs
Classes | Namespaces

AppView.cs File Reference

Go to the source code of this file.

Classes

class | AppView
The IFrameworkView connects the app with Windows and handles application lifecycle events. More...

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/AppViewSource.cs File Reference

  • BasicHologram
  • cs
Classes | Namespaces

AppViewSource.cs File Reference

Go to the source code of this file.

Classes

class | AppViewSource

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/BasicHologramMain.cs File Reference

  • BasicHologram
  • cs
Classes | Namespaces | Defines

BasicHologramMain.cs File Reference

Go to the source code of this file.

Classes

class | HolographicTemplateAppMain
Updates, renders, and presents holographic content using Direct3D. More...
class | HolographicTemplateAppMain::GamepadWithButtonState

Namespaces

namespace | BasicHologram

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 9 of file BasicHologramMain.cs.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/FxCompile.cs File Reference

  • BasicHologram
  • cs
Classes | Namespaces

FxCompile.cs File Reference

Go to the source code of this file.

Classes

class | FxCompile
Task to support Fxc.exe. More...

Namespaces

namespace | Microsoft::Build::Tasks
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Program.cs File Reference

  • BasicHologram
  • cs
Classes | Namespaces

Program.cs File Reference

Go to the source code of this file.

Classes

class | Program
Windows Holographic application using SharpDX. More...

Namespaces

namespace | BasicHologram
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/CameraResources.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

CameraResources.cs File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/DeviceResources.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

DeviceResources.cs File Reference

Go to the source code of this file.

Classes

class | DeviceResources
Controls all the DirectX device resources. More...

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/DirectXHelper.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

DirectXHelper.cs File Reference

Go to the source code of this file.

Classes

class | DirectXHelper

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/Disposer.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

Disposer.cs File Reference

Go to the source code of this file.

Classes

class | Disposer

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/InteropStatics.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

InteropStatics.cs File Reference

Go to the source code of this file.

Classes

class | InteropStatics
interface | InteropStatics::IDirect3DDxgiInterfaceAccess

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/StepTimer.cs File Reference

  • BasicHologram
  • cs
  • Common
Classes | Namespaces

StepTimer.cs File Reference

Go to the source code of this file.

Classes

class | StepTimer
Helper class for animation and simulation timing. More...

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Content/ShaderStructures.cs File Reference

  • BasicHologram
  • cs
  • Content
Classes | Namespaces

ShaderStructures.cs File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
Constant buffer used to send hologram position transform to the shader pipeline. More...
struct | VertexPositionColor
Used to send per-vertex data to the vertex shader. More...

Namespaces

namespace | BasicHologram::Content
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Content/SpatialInputHandler.cs File Reference

  • BasicHologram
  • cs
  • Content
Classes | Namespaces

SpatialInputHandler.cs File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | BasicHologram::Common
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Content/SpinningCubeRenderer.cs File Reference

  • BasicHologram
  • cs
  • Content
Classes | Namespaces

SpinningCubeRenderer.cs File Reference

Go to the source code of this file.

Classes

class | SpinningCubeRenderer
This sample renderer instantiates a basic rendering pipeline. More...

Namespaces

namespace | BasicHologram::Content
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/1-InputEvents.xaml.cpp File Reference

  • BasicInput
  • cpp

1-InputEvents.xaml.cpp File Reference

#include "pch.h"
#include "1-InputEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/1-InputEvents.xaml.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

1-InputEvents.xaml.h File Reference

#include "1-InputEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/2-PointerPointProperties.xaml.cpp File Reference

  • BasicInput
  • cpp

2-PointerPointProperties.xaml.cpp File Reference

#include "pch.h"
#include "2-PointerPointProperties.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/2-PointerPointProperties.xaml.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

2-PointerPointProperties.xaml.h File Reference

#include "2-PointerPointProperties.g.h"
#include "MainPage.xaml.h"
#include <map>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/3-DeviceCapabilities.xaml.cpp File Reference

  • BasicInput
  • cpp

3-DeviceCapabilities.xaml.cpp File Reference

#include "pch.h"
#include "3-DeviceCapabilities.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/3-DeviceCapabilities.xaml.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

3-DeviceCapabilities.xaml.h File Reference

#include "3-DeviceCapabilities.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/4-XAMLManipulations.xaml.cpp File Reference

  • BasicInput
  • cpp

4-XAMLManipulations.xaml.cpp File Reference

#include "pch.h"
#include "4-XAMLManipulations.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/4-XAMLManipulations.xaml.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

4-XAMLManipulations.xaml.h File Reference

#include "4-XAMLManipulations.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/5-GestureRecognizer.xaml.cpp File Reference

  • BasicInput
  • cpp

5-GestureRecognizer.xaml.cpp File Reference

#include "pch.h"
#include "5-GestureRecognizer.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/5-GestureRecognizer.xaml.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

5-GestureRecognizer.xaml.h File Reference

#include "5-GestureRecognizer.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/pch.cpp File Reference

  • BasicInput
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/pch.h File Reference

  • BasicInput
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/SampleConfiguration.cpp File Reference

  • BasicInput
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/SampleConfiguration.h File Reference

  • BasicInput
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/1-InputEvents.xaml.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

1-InputEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/2-PointerPointProperties.xaml.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

2-PointerPointProperties.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/3-DeviceCapabilities.xaml.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

3-DeviceCapabilities.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/4-XAMLManipulations.xaml.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

4-XAMLManipulations.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/5-GestureRecognizer.xaml.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

5-GestureRecognizer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ManipulationInputProcessor
class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/SampleConfiguration.cs File Reference

  • BasicInput
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/SampleConfiguration.cs File Reference

  • BasicMediaCasting
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/Scenario1_BuiltInCasting.xaml.cs File Reference

  • BasicMediaCasting
  • cs
Classes | Namespaces

Scenario1_BuiltInCasting.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1

Namespaces

namespace | BasicMediaCasting
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/Scenario2_CastingDevicePicker.xaml.cs File Reference

  • BasicMediaCasting
  • cs
Classes | Namespaces

Scenario2_CastingDevicePicker.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2

Namespaces

namespace | BasicMediaCasting
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/Scenario3_CustomPicker.xaml.cs File Reference

  • BasicMediaCasting
  • cs
Classes | Namespaces

Scenario3_CustomPicker.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3

Namespaces

namespace | BasicMediaCasting
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/App.xaml.cs File Reference

  • BasicSuspension
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/MainPage.xaml.cs File Reference

  • BasicSuspension
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Item
items that are in the observable collection (ItemList) More...
class | ItemList
observable collection that will contain the list of items. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/SubPage.xaml.cs File Reference

  • BasicSuspension
  • cs
Classes | Namespaces

SubPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SubPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/Common/NavigationHelper.cs File Reference

  • BasicSuspension
  • cs
  • Common
Classes | Namespaces | Functions

NavigationHelper.cs File Reference

Go to the source code of this file.

Classes

class | LoadStateEventArgs
Class used to hold the event data required when a page attempts to load state. More...
class | NavigationHelper
NavigationHelper aids in navigation between pages. More...
class | RootFrameNavigationHelper
RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...
class | SaveStateEventArgs
Class used to hold the event data required when a page attempts to save state. More...

Namespaces

namespace | SDKTemplate::Common

Functions

delegate void | LoadStateEventHandler (object sender, LoadStateEventArgs e)
delegate void | SaveStateEventHandler (object sender, SaveStateEventArgs e)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/Common/SuspensionManager.cs File Reference

  • BasicSuspension
  • cs
  • Common
Classes | Namespaces

SuspensionManager.cs File Reference

Go to the source code of this file.

Classes

class | SuspensionManager
SuspensionManager captures global session state to simplify process lifetime management for an application. More...
class | SuspensionManagerException

Namespaces

namespace | SDKTemplate::Common
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/SampleConfiguration.cs File Reference

  • BluetoothAdvertisement
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario1_Watcher.xaml.cs File Reference

  • BluetoothAdvertisement
  • cs
Classes | Namespaces

Scenario1_Watcher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Watcher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BluetoothAdvertisement
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario2_Publisher.xaml.cs File Reference

  • BluetoothAdvertisement
  • cs
Classes | Namespaces

Scenario2_Publisher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Publisher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BluetoothAdvertisement
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario3_BackgroundWatcher.xaml.cs File Reference

  • BluetoothAdvertisement
  • cs
Classes | Namespaces

Scenario3_BackgroundWatcher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_BackgroundWatcher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BluetoothAdvertisement
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario4_BackgroundPublisher.xaml.cs File Reference

  • BluetoothAdvertisement
  • cs
Classes | Namespaces

Scenario4_BackgroundPublisher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_BackgroundPublisher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | BluetoothAdvertisement
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Tasks/AdvertisementBackgroundTasks.cs File Reference

  • BluetoothAdvertisement
  • cs
  • Tasks
Classes | Namespaces

AdvertisementBackgroundTasks.cs File Reference

Go to the source code of this file.

Classes

class | AdvertisementPublisherTask
class | AdvertisementWatcherTask

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • BluetoothAdvertisement
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEAttributeDisplay.cpp File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions

BluetoothLEAttributeDisplay.cpp File Reference

#include "pch.h"
#include "BluetoothLEAttributeDisplay.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{BluetoothLEAttributeDisplay.cpp}
namespace | winrt::SDKTemplate::DisplayHelpers

Functions

hstring | GetCharacteristicName (GattCharacteristic const &characteristic)
hstring | GetServiceName (GattDeviceService const &service)
bool | TryParseSigDefinedUuid (guid const &uuid, uint16_t &shortId)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEAttributeDisplay.h File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions

BluetoothLEAttributeDisplay.h File Reference

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::DisplayHelpers

Functions

hstring | GetCharacteristicName (Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const &characteristic)
hstring | GetServiceName (Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceService const &service)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.cpp File Reference

  • BluetoothLE
  • cppwinrt
Namespaces

BluetoothLEDeviceDisplay.cpp File Reference

#include "pch.h"
#include "BluetoothLEDeviceDisplay.h"
#include "BluetoothLEDeviceDisplay.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces

BluetoothLEDeviceDisplay.h File Reference

#include "BluetoothLEDeviceDisplay.g.h"

Go to the source code of this file.

Classes

struct | BluetoothLEDeviceDisplay

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/pch.cpp File Reference

  • BluetoothLE
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/pch.h File Reference

  • BluetoothLE
  • cppwinrt
Defines

pch.h File Reference

#include <unknwn.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Bluetooth.h"
#include "winrt/Windows.Devices.Bluetooth.GenericAttributeProfile.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/SDKTemplate.h"
#include <ctime>

Go to the source code of this file.

Defines

#define | __STDC_WANT_SECURE_LIB__ 1
#define | NOMINMAX

Define Documentation

#define __STDC_WANT_SECURE_LIB__ 1

Definition at line 4 of file pch.h.

#define NOMINMAX

Definition at line 3 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/PresentationFormats.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces

PresentationFormats.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | PresentationFormats

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Project.idl File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

void | CharacteristicList_SelectionChanged ()
void | CharacteristicReadButton_Click ()
void | CharacteristicWriteButton_Click ()
void | CharacteristicWriteButtonInt_Click ()
void | ConnectButton_Click ()
void | EnumerateButton_Click ()
Boolean | Not (Boolean value)
void | PairButton_Click ()
void | PublishButton_ClickAsync ()
void | ServiceList_SelectionChanged ()
void | Update (Windows.Devices.Enumeration.DeviceInformationUpdate deviceInfoUpdate)
void | ValueChangedSubscribeToggle_Click ()

Variables

runtimeclass | BluetoothLEDeviceDisplay
runtimeclass | Scenario1_Discovery
runtimeclass | Scenario2_Client
runtimeclass | Scenario3_ServerForeground
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/SampleConfiguration.cpp File Reference

  • BluetoothLE
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/SampleConfiguration.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | Constants
struct | SampleState

Namespaces

namespace | winrt::SDKTemplate

Functions

Windows::Foundation::Rect | GetElementRect (Windows::UI::Xaml::FrameworkElement const &element)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario1_Discovery.cpp File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions

Scenario1_Discovery.cpp File Reference

#include "pch.h"
#include "Scenario1_Discovery.h"
#include "Scenario1_Discovery.g.cpp"
#include "SampleConfiguration.h"
#include "BluetoothLEDeviceDisplay.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation

Functions

hstring | to_hstring (DevicePairingResultStatus status)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario1_Discovery.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces

Scenario1_Discovery.h File Reference

#include "Scenario1_Discovery.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Discovery
struct | Scenario1_Discovery

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario2_Client.cpp File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions

Scenario2_Client.cpp File Reference

#include "pch.h"
#include "Scenario2_Client.h"
#include "Scenario2_Client.g.cpp"
#include "SampleConfiguration.h"
#include "BluetoothLEAttributeDisplay.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario2_Client.cpp}
namespace | winrt
namespace | winrt::SDKTemplate::implementation

Functions

int32_t | ParseHeartRateValue (IBuffer const &buffer)
template<typename T >
T | Read (DataReader const &reader)
template<>
int32_t | Read< int32_t > (DataReader const &reader)
template<>
uint32_t | Read< uint32_t > (DataReader const &reader)
template<>
uint8_t | Read< uint8_t > (DataReader const &reader)
void | SetVisibility (UIElement const &element, bool visible)
hstring | to_hstring (GattCommunicationStatus status)
template<typename T >
bool | TryExtract (IBuffer const &buffer, T &result)
bool | TryParseInt (const wchar_t *str, int32_t &result)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario2_Client.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces

Scenario2_Client.h File Reference

#include "Scenario2_Client.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Client
struct | Scenario2_Client

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario3_ServerForeground.cpp File Reference

  • BluetoothLE
  • cppwinrt
Namespaces | Functions

Scenario3_ServerForeground.cpp File Reference

#include "pch.h"
#include "Scenario3_ServerForeground.h"
#include "Scenario3_ServerForeground.g.cpp"
#include "SampleConfiguration.h"
#include "PresentationFormats.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation

Functions

hstring | to_hstring (BluetoothError error)
hstring | to_hstring (GattServiceProviderAdvertisementStatus status)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario3_ServerForeground.h File Reference

  • BluetoothLE
  • cppwinrt
Classes | Namespaces

Scenario3_ServerForeground.h File Reference

#include "Scenario3_ServerForeground.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_ServerForeground
struct | Scenario3_ServerForeground

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Constants.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

Constants.cs File Reference

Go to the source code of this file.

Classes

class | Constants
Class containing Attributes and UUIDs that will populate the SDP record. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/DispatcherTaskExtensions.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

DispatcherTaskExtensions.cs File Reference

Go to the source code of this file.

Classes

class | DispatcherService
Helper class used to run functions on the UI thread.

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/DisplayHelpers.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces | Enumerations

DisplayHelpers.cs File Reference

Go to the source code of this file.

Classes

class | BluetoothLEDeviceDisplay
Display class used to represent a BluetoothLEDevice in the Device list. More...
class | DisplayHelpers
Helpers for formatting information for display.
class | Utilities

Namespaces

namespace | SDKTemplate

Enumerations

enum GattNativeCharacteristicUuid {
None = 0, AlertCategoryID = 0x2A43, AlertCategoryIDBitMask = 0x2A42, AlertLevel = 0x2A06,
AlertNotificationControlPoint = 0x2A44, AlertStatus = 0x2A3F, Appearance = 0x2A01, BatteryLevel = 0x2A19,
BloodPressureFeature = 0x2A49, BloodPressureMeasurement = 0x2A35, BodySensorLocation = 0x2A38, BootKeyboardInputReport = 0x2A22,
BootKeyboardOutputReport = 0x2A32, BootMouseInputReport = 0x2A33, CSCFeature = 0x2A5C, CSCMeasurement = 0x2A5B,
CurrentTime = 0x2A2B, DateTime = 0x2A08, DayDateTime = 0x2A0A, DayofWeek = 0x2A09,
DeviceName = 0x2A00, DSTOffset = 0x2A0D, ExactTime256 = 0x2A0C, FirmwareRevisionString = 0x2A26,
GlucoseFeature = 0x2A51, GlucoseMeasurement = 0x2A18, GlucoseMeasurementContext = 0x2A34, HardwareRevisionString = 0x2A27,
HeartRateControlPoint = 0x2A39, HeartRateMeasurement = 0x2A37, HIDControlPoint = 0x2A4C, HIDInformation = 0x2A4A,
IEEE11073_20601RegulatoryCertificationDataList = 0x2A2A, IntermediateCuffPressure = 0x2A36, IntermediateTemperature = 0x2A1E, LocalTimeInformation = 0x2A0F,
ManufacturerNameString = 0x2A29, MeasurementInterval = 0x2A21, ModelNumberString = 0x2A24, NewAlert = 0x2A46,
PeripheralPreferredConnectionParameters = 0x2A04, PeripheralPrivacyFlag = 0x2A02, PnPID = 0x2A50, ProtocolMode = 0x2A4E,
ReconnectionAddress = 0x2A03, RecordAccessControlPoint = 0x2A52, ReferenceTimeInformation = 0x2A14, Report = 0x2A4D,
ReportMap = 0x2A4B, RingerControlPoint = 0x2A40, RingerSetting = 0x2A41, RSCFeature = 0x2A54,
RSCMeasurement = 0x2A53, SCControlPoint = 0x2A55, ScanIntervalWindow = 0x2A4F, ScanRefresh = 0x2A31,
SensorLocation = 0x2A5D, SerialNumberString = 0x2A25, ServiceChanged = 0x2A05, SoftwareRevisionString = 0x2A28,
SupportedNewAlertCategory = 0x2A47, SupportedUnreadAlertCategory = 0x2A48, SystemID = 0x2A23, TemperatureMeasurement = 0x2A1C,
TemperatureType = 0x2A1D, TimeAccuracy = 0x2A12, TimeSource = 0x2A13, TimeUpdateControlPoint = 0x2A16,
TimeUpdateState = 0x2A17, TimewithDST = 0x2A11, TimeZone = 0x2A0E, TxPowerLevel = 0x2A07,
UnreadAlertStatus = 0x2A45, AggregateInput = 0x2A5A, AnalogInput = 0x2A58, AnalogOutput = 0x2A59,
CyclingPowerControlPoint = 0x2A66, CyclingPowerFeature = 0x2A65, CyclingPowerMeasurement = 0x2A63, CyclingPowerVector = 0x2A64,
DigitalInput = 0x2A56, DigitalOutput = 0x2A57, ExactTime100 = 0x2A0B, LNControlPoint = 0x2A6B,
LNFeature = 0x2A6A, LocationandSpeed = 0x2A67, Navigation = 0x2A68, NetworkAvailability = 0x2A3E,
PositionQuality = 0x2A69, ScientificTemperatureinCelsius = 0x2A3C, SecondaryTimeZone = 0x2A10, String = 0x2A3D,
TemperatureinCelsius = 0x2A1F, TemperatureinFahrenheit = 0x2A20, TimeBroadcast = 0x2A15, BatteryLevelState = 0x2A1B,
BatteryPowerState = 0x2A1A, PulseOximetryContinuousMeasurement = 0x2A5F, PulseOximetryControlPoint = 0x2A62, PulseOximetryFeatures = 0x2A61,
PulseOximetryPulsatileEvent = 0x2A60, SimpleKeyState = 0xFFE1
}
enum GattNativeDescriptorUuid {
CharacteristicExtendedProperties = 0x2900, CharacteristicUserDescription = 0x2901, ClientCharacteristicConfiguration = 0x2902, ServerCharacteristicConfiguration = 0x2903,
CharacteristicPresentationFormat = 0x2904, CharacteristicAggregateFormat = 0x2905, ValidRange = 0x2906, ExternalReportReference = 0x2907,
ReportReference = 0x2908
}
enum GattNativeServiceUuid {
None = 0, AlertNotification = 0x1811, Battery = 0x180F, BloodPressure = 0x1810,
CurrentTimeService = 0x1805, CyclingSpeedandCadence = 0x1816, DeviceInformation = 0x180A, GenericAccess = 0x1800,
GenericAttribute = 0x1801, Glucose = 0x1808, HealthThermometer = 0x1809, HeartRate = 0x180D,
HumanInterfaceDevice = 0x1812, ImmediateAlert = 0x1802, LinkLoss = 0x1803, NextDSTChange = 0x1807,
PhoneAlertStatus = 0x180E, ReferenceTimeUpdateService = 0x1806, RunningSpeedandCadence = 0x1814, ScanParameters = 0x1813,
TxPower = 0x1804, SimpleKeyService = 0xFFE0
}
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/PresentationFormats.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

PresentationFormats.cs File Reference

Go to the source code of this file.

Classes

class | PresentationFormats
Class containing the details of Gatt characteristics presentation formats. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/SampleConfiguration.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Scenario1_Discovery.xaml.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

Scenario1_Discovery.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Discovery

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Scenario2_Client.xaml.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

Scenario2_Client.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Client

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Scenario3_ServerForeground.xaml.cs File Reference

  • BluetoothLE
  • cs
Classes | Namespaces

Scenario3_ServerForeground.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ServerForeground

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/SampleConfiguration.cs File Reference

  • BluetoothRfcommChat
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | Constants
Class containing Attributes and UUIDs that will populate the SDP record. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario1_ChatClient.xaml.cs File Reference

  • BluetoothRfcommChat
  • cs
Classes | Namespaces

Scenario1_ChatClient.xaml.cs File Reference

Go to the source code of this file.

Classes

class | RfcommChatDeviceDisplay
class | Scenario1_ChatClient

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario2_ChatServer.xaml.cs File Reference

  • BluetoothRfcommChat
  • cs
Classes | Namespaces

Scenario2_ChatServer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ChatServer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario3_BgChatServer.xaml.cs File Reference

  • BluetoothRfcommChat
  • cs
Classes | Namespaces

Scenario3_BgChatServer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_BgChatServer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Tasks/RfcommServerTask.cs File Reference

  • BluetoothRfcommChat
  • cs
  • Tasks
Classes | Namespaces

RfcommServerTask.cs File Reference

Go to the source code of this file.

Classes

class | RfcommServerTask

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • BluetoothRfcommChat
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/pch.cpp File Reference

  • Calendar
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/pch.h File Reference

  • Calendar
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/SampleConfiguration.cpp File Reference

  • Calendar
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/SampleConfiguration.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario1_Data.xaml.cpp File Reference

  • Calendar
  • cpp

Scenario1_Data.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Data.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario1_Data.xaml.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

Scenario1_Data.xaml.h File Reference

#include "Scenario1_Data.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario2_Stats.xaml.cpp File Reference

  • Calendar
  • cpp

Scenario2_Stats.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Stats.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario2_Stats.xaml.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

Scenario2_Stats.xaml.h File Reference

#include "Scenario2_Stats.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario3_Enum.xaml.cpp File Reference

  • Calendar
  • cpp

Scenario3_Enum.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Enum.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario3_Enum.xaml.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

Scenario3_Enum.xaml.h File Reference

#include "Scenario3_Enum.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario4_UnicodeExtensions.xaml.cpp File Reference

  • Calendar
  • cpp

Scenario4_UnicodeExtensions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_UnicodeExtensions.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario4_UnicodeExtensions.xaml.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

Scenario4_UnicodeExtensions.xaml.h File Reference

#include "Scenario4_UnicodeExtensions.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario5_TimeZone.xaml.cpp File Reference

  • Calendar
  • cpp

Scenario5_TimeZone.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_TimeZone.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario5_TimeZone.xaml.h File Reference

  • Calendar
  • cpp
Classes | Namespaces

Scenario5_TimeZone.xaml.h File Reference

#include "Scenario5_TimeZone.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/pch.cpp File Reference

  • Calendar
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/pch.h File Reference

  • Calendar
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.Globalization.DateTimeFormatting.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Project.idl File Reference

  • Calendar
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Data
runtimeclass | Scenario2_Stats
runtimeclass | Scenario3_Enum
runtimeclass | Scenario4_UnicodeExtensions
runtimeclass | Scenario5_TimeZone
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/SampleConfiguration.cpp File Reference

  • Calendar
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/SampleConfiguration.h File Reference

  • Calendar
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario1_Data.cpp File Reference

  • Calendar
  • cppwinrt
Namespaces | Functions

Scenario1_Data.cpp File Reference

#include "pch.h"
#include "Scenario1_Data.h"
#include "Scenario1_Data.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario1_Data.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario1_Data.h File Reference

  • Calendar
  • cppwinrt
Classes | Namespaces

Scenario1_Data.h File Reference

#include "Scenario1_Data.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Data
struct | Scenario1_Data

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario2_Stats.cpp File Reference

  • Calendar
  • cppwinrt
Namespaces | Functions

Scenario2_Stats.cpp File Reference

#include "pch.h"
#include "Scenario2_Stats.h"
#include "Scenario2_Stats.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario2_Stats.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario2_Stats.h File Reference

  • Calendar
  • cppwinrt
Classes | Namespaces

Scenario2_Stats.h File Reference

#include "Scenario2_Stats.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Stats
struct | Scenario2_Stats

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario3_Enum.cpp File Reference

  • Calendar
  • cppwinrt
Namespaces

Scenario3_Enum.cpp File Reference

#include "pch.h"
#include "Scenario3_Enum.h"
#include "Scenario3_Enum.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario3_Enum.h File Reference

  • Calendar
  • cppwinrt
Classes | Namespaces

Scenario3_Enum.h File Reference

#include "Scenario3_Enum.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_Enum
struct | Scenario3_Enum

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario4_UnicodeExtensions.cpp File Reference

  • Calendar
  • cppwinrt
Namespaces | Functions

Scenario4_UnicodeExtensions.cpp File Reference

#include "pch.h"
#include "Scenario4_UnicodeExtensions.h"
#include "Scenario4_UnicodeExtensions.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario4_UnicodeExtensions.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | ReportCalendarData (std::wostream &results, Calendar const &calendar, PCWSTR calendarLabel)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario4_UnicodeExtensions.h File Reference

  • Calendar
  • cppwinrt
Classes | Namespaces

Scenario4_UnicodeExtensions.h File Reference

#include "Scenario4_UnicodeExtensions.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_UnicodeExtensions
struct | Scenario4_UnicodeExtensions

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario5_TimeZone.cpp File Reference

  • Calendar
  • cppwinrt
Namespaces | Functions

Scenario5_TimeZone.cpp File Reference

#include "pch.h"
#include "Scenario5_TimeZone.h"
#include "Scenario5_TimeZone.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario5_TimeZone.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | ReportCalendarData (std::wostream &results, Calendar const &calendar)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario5_TimeZone.h File Reference

  • Calendar
  • cppwinrt
Classes | Namespaces

Scenario5_TimeZone.h File Reference

#include "Scenario5_TimeZone.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_TimeZone
struct | Scenario5_TimeZone

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/SampleConfiguration.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/Scenario1_Data.xaml.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

Scenario1_Data.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Data

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/Scenario2_Stats.xaml.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

Scenario2_Stats.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Stats

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/Scenario3_Enum.xaml.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

Scenario3_Enum.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Enum

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/Scenario4_UnicodeExtensions.xaml.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

Scenario4_UnicodeExtensions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_UnicodeExtensions

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/Scenario5_TimeZone.xaml.cs File Reference

  • Calendar
  • cs
Classes | Namespaces

Scenario5_TimeZone.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_TimeZone

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/App.xaml.cpp File Reference

  • CameraAdvancedCapture
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/App.xaml.h File Reference

  • CameraAdvancedCapture
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraAdvancedCapture
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/MainPage.xaml.cpp File Reference

  • CameraAdvancedCapture
  • cpp
Functions

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <sstream>
#include <math.h>
#include <ctime>

Go to the source code of this file.

Functions

_captureFolder (nullptr)

Function Documentation

_captureFolder ( nullptr )

Definition at line 52 of file MainPage.xaml.cpp.

{
    this->InitializeComponent();

    _orientationSensor = SimpleOrientationSensor::GetDefault();
    _displayInformation = DisplayInformation::GetForCurrentView();
    _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();

    // Do not cache the state of the UI when suspending/navigating
    Page::NavigationCacheMode = Navigation::NavigationCacheMode::Disabled;

    // Useful to know when to initialize/clean up the camera
    _applicationSuspendingEventToken =
        Application::Current->Suspending += ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
    _applicationResumingEventToken =
        Application::Current->Resuming += ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);

    // Set the maximum on the progress bar
    HdrImpactBar->Maximum = CERTAINTY_CAP;
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/MainPage.xaml.h File Reference

  • CameraAdvancedCapture
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"

Go to the source code of this file.

Classes

class | AdvancedCaptureContext
Helper class to contain the information that describes an advanced capture. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraAdvancedCapture
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/pch.cpp File Reference

  • CameraAdvancedCapture
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/pch.h File Reference

  • CameraAdvancedCapture
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cs/App.xaml.cs File Reference

  • CameraAdvancedCapture
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraAdvancedCapture
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cs/MainPage.xaml.cs File Reference

  • CameraAdvancedCapture
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
class | MainPage::AdvancedCaptureContext
Helper class to contain the information that describes an Advanced Capture. More...

Namespaces

namespace | CameraAdvancedCapture
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/App.xaml.cpp File Reference

  • CameraFaceDetection
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/App.xaml.h File Reference

  • CameraFaceDetection
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | FaceDetection
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/MainPage.xaml.cpp File Reference

  • CameraFaceDetection
  • cpp
Functions

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Functions

_captureFolder (nullptr)

Function Documentation

_captureFolder ( nullptr )

Definition at line 50 of file MainPage.xaml.cpp.

{
    InitializeComponent();

    _orientationSensor = SimpleOrientationSensor::GetDefault();
    _displayInformation = DisplayInformation::GetForCurrentView();
    _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();

    // Do not cache the state of the UI when suspending/navigating
    Page::NavigationCacheMode = Navigation::NavigationCacheMode::Disabled;

    // Useful to know when to initialize/clean up the camera
    _applicationSuspendingEventToken =
        Application::Current->Suspending += ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
    _applicationResumingEventToken =
        Application::Current->Resuming += ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/MainPage.xaml.h File Reference

  • CameraFaceDetection
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | FaceDetection
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/pch.cpp File Reference

  • CameraFaceDetection
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/pch.h File Reference

  • CameraFaceDetection
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cs/App.xaml.cs File Reference

  • CameraFaceDetection
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | FaceDetection
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cs/MainPage.xaml.cs File Reference

  • CameraFaceDetection
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | FaceDetection
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameRenderer.cpp File Reference

  • CameraFrames
  • cpp
Classes | Functions

FrameRenderer.cpp File Reference

#include "pch.h"
#include <cmath>
#include <MemoryBuffer.h>
#include "FrameRenderer.h"

Go to the source code of this file.

Classes

struct | ColorBGRA

Functions

template<typename T >
Microsoft::WRL::ComPtr< T > | AsComPtr (Platform::Object^object)
template<typename T , typename U >
T | InterlockedExchangeRefPointer (T^*target, U value)

Function Documentation

Microsoft::WRL::ComPtr<T> AsComPtr ( Platform::Object^ object )

Definition at line 45 of file FrameRenderer.cpp.

{
    Microsoft::WRL::ComPtr<T> p;
    reinterpret_cast<IUnknown*>(object)->QueryInterface(IID_PPV_ARGS(&p));
    return p;
}

T InterlockedExchangeRefPointer | ( | T^* | target,
 |  | U | value
 | ) |  |

Definition at line 33 of file FrameRenderer.cpp.

{
    static_assert(sizeof(T^) == sizeof(void*), "InterlockedExchangePointer is the wrong size");
    T^ exchange = value;
    void** rawExchange = reinterpret_cast<void**>(&exchange);
    void** rawTarget = reinterpret_cast<void**>(target);
    *rawExchange = static_cast<IInspectable*>(InterlockedExchangePointer(rawTarget, *rawExchange));
    return exchange;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameRenderer.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces | Typedefs

FrameRenderer.h File Reference

#include "LookupTable.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Typedefs

typedef std::function< void(int,
byte *, byte *) 		TransformScanline )
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameSourceViewModels.cpp File Reference

  • CameraFrames
  • cpp

FrameSourceViewModels.cpp File Reference

#include "pch.h"
#include "FrameSourceViewModels.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameSourceViewModels.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

FrameSourceViewModels.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/LookupTable.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

LookupTable.h File Reference

Go to the source code of this file.

Classes

class | LookupTable< T, LookupTableSize >

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/pch.cpp File Reference

  • CameraFrames
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/pch.h File Reference

  • CameraFrames
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <shared_mutex>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/SampleConfiguration.cpp File Reference

  • CameraFrames
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/SampleConfiguration.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.cpp File Reference

  • CameraFrames
  • cpp

Scenario1_DisplayDepthColorIR.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DisplayDepthColorIR.xaml.h"
#include "FrameRenderer.h"
#include <unordered_set>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

Scenario1_DisplayDepthColorIR.xaml.h File Reference

#include "Scenario1_DisplayDepthColorIR.g.h"
#include "MainPage.xaml.h"
#include "SimpleLogger.h"
#include "FrameRenderer.h"
#include "SimpleLogger.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.cpp File Reference

  • CameraFrames
  • cpp

Scenario2_FindAvailableSourceGroups.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_FindAvailableSourceGroups.xaml.h"
#include "FrameRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

Scenario2_FindAvailableSourceGroups.xaml.h File Reference

#include "Scenario2_FindAvailableSourceGroups.g.h"
#include "MainPage.xaml.h"
#include "SimpleLogger.h"
#include "FrameRenderer.h"
#include "FrameSourceViewModels.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/SimpleLogger.h File Reference

  • CameraFrames
  • cpp
Classes | Namespaces

SimpleLogger.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/FrameSourceViewModels.cs File Reference

  • CameraFrames
  • cs
Classes | Namespaces

FrameSourceViewModels.cs File Reference

Go to the source code of this file.

Classes

class | FrameFormatModel
View model for MediaFrameFormat used in XAML ContentControl. More...
class | FrameSourceGroupModel
View model for MediaFrameSourceGroup used in XAML ContentControl. More...
class | FrameSourceInfoModel
View model for MediaFrameSourceInfo used in XAML ContentControl. More...
class | SourceGroupCollection
View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/SampleConfiguration.cs File Reference

  • CameraFrames
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/Scenario1_DisplayDepthColorIR.xaml.cs File Reference

  • CameraFrames
  • cs
Classes | Namespaces

Scenario1_DisplayDepthColorIR.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DisplayDepthColorIR

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/Scenario2_FindAvailableSourceGroups.xaml.cs File Reference

  • CameraFrames
  • cs
Classes | Namespaces

Scenario2_FindAvailableSourceGroups.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_FindAvailableSourceGroups

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/SimpleLogger.cs File Reference

  • CameraFrames
  • cs
Classes | Namespaces

SimpleLogger.cs File Reference

Go to the source code of this file.

Classes

class | SimpleLogger
A simple logger to display text to TextBlock asynchronisely. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/App.xaml.cpp File Reference

  • CameraGetPreviewFrame
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/App.xaml.h File Reference

  • CameraGetPreviewFrame
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraGetPreviewFrame
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/MainPage.xaml.cpp File Reference

  • CameraGetPreviewFrame
  • cpp
Functions

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <MemoryBuffer.h>
#include <sstream>

Go to the source code of this file.

Functions

_captureFolder (nullptr)

Function Documentation

_captureFolder ( nullptr )

Definition at line 45 of file MainPage.xaml.cpp.

{
    InitializeComponent();

    _displayInformation = DisplayInformation::GetForCurrentView();
    _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();

    // Cache the UI to have the checkboxes retain their state, as the enabled/disabled state of the
    // GetPreviewFrameButton is reset in code when suspending/navigating (see Start/StopPreviewAsync)
    Page::NavigationCacheMode = Navigation::NavigationCacheMode::Required;

    // Useful to know when to initialize/clean up the camera
    _applicationSuspendingEventToken =
        Application::Current->Suspending += ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
    _applicationResumingEventToken =
        Application::Current->Resuming += ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/MainPage.xaml.h File Reference

  • CameraGetPreviewFrame
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraGetPreviewFrame
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/pch.cpp File Reference

  • CameraGetPreviewFrame
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/pch.h File Reference

  • CameraGetPreviewFrame
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cs/App.xaml.cs File Reference

  • CameraGetPreviewFrame
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraGetPreviewFrame
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cs/MainPage.xaml.cs File Reference

  • CameraGetPreviewFrame
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

interface | IMemoryBufferByteAccess
class | MainPage

Namespaces

namespace | CameraGetPreviewFrame
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/App.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.ExposureValue.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.ExposureValue.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.Flash.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.Flash.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.Focus.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.Focus.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.IsoSpeed.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.IsoSpeed.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.Shutter.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.Shutter.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.WhiteBalance.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.WhiteBalance.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | InvertBoolConverter
class | MainPage
class | RoundingConverter

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.Zoom.xaml.cs File Reference

  • CameraManualControls
  • cs
Classes | Namespaces

MainPage.Zoom.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraManualControls
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/cs/SampleConfiguration.cs File Reference

  • CameraOpenCV
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/cs/Scenario1_ExampleOperations.xaml.cs File Reference

  • CameraOpenCV
  • cs
Classes | Namespaces

Scenario1_ExampleOperations.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ExampleOperations
Scenario that illustrates using OpenCV along with camera frames. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.cpp File Reference

  • CameraOpenCV
  • shared
  • OpenCVBridge

OpenCVHelper.cpp File Reference

#include "pch.h"
#include "OpenCVHelper.h"
#include "MemoryBuffer.h"
#include <iostream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.h File Reference

  • CameraOpenCV
  • shared
  • OpenCVBridge
Classes | Namespaces

OpenCVHelper.h File Reference

#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\video.hpp>

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | OpenCVBridge
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/pch.cpp File Reference

  • CameraOpenCV
  • shared
  • OpenCVBridge

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/pch.h File Reference

  • CameraOpenCV
  • shared
  • OpenCVBridge

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/pch.cpp File Reference

  • CameraProfile
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/pch.h File Reference

  • CameraProfile
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/SampleConfiguration.cpp File Reference

  • CameraProfile
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/SampleConfiguration.h File Reference

  • CameraProfile
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.cpp File Reference

  • CameraProfile
  • cpp

Scenario1_SetRecordProfile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SetRecordProfile.xaml.h"
#include <math.h>
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.h File Reference

  • CameraProfile
  • cpp
Classes | Namespaces

Scenario1_SetRecordProfile.xaml.h File Reference

#include "Scenario1_SetRecordProfile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario2_ConcurrentProfile.xaml.cpp File Reference

  • CameraProfile
  • cpp

Scenario2_ConcurrentProfile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ConcurrentProfile.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario2_ConcurrentProfile.xaml.h File Reference

  • CameraProfile
  • cpp
Classes | Namespaces

Scenario2_ConcurrentProfile.xaml.h File Reference

#include "Scenario2_ConcurrentProfile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.cpp File Reference

  • CameraProfile
  • cpp

Scenario3_EnableHdrProfile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_EnableHdrProfile.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.h File Reference

  • CameraProfile
  • cpp
Classes | Namespaces

Scenario3_EnableHdrProfile.xaml.h File Reference

#include "Scenario3_EnableHdrProfile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/SampleConfiguration.cs File Reference

  • CameraProfile
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/Scenario1_SetRecordProfile.xaml.cs File Reference

  • CameraProfile
  • cs
Classes | Namespaces

Scenario1_SetRecordProfile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SetRecordProfile
SetRecordProfile page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CameraProfile
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/Scenario2_ConcurrentProfile.xaml.cs File Reference

  • CameraProfile
  • cs
Classes | Namespaces

Scenario2_ConcurrentProfile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ConcurrentProfile
ConcurrenProfile page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CameraProfile
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/Scenario3_EnableHdrProfile.xaml.cs File Reference

  • CameraProfile
  • cs
Classes | Namespaces

Scenario3_EnableHdrProfile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_EnableHdrProfile
EnableHDRProfile page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CameraProfile
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/pch.cpp File Reference

  • CameraResolution
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/pch.h File Reference

  • CameraResolution
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/SampleConfiguration.cpp File Reference

  • CameraResolution
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/SampleConfiguration.h File Reference

  • CameraResolution
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario1_PreviewSettings.xaml.cpp File Reference

  • CameraResolution
  • cpp

Scenario1_PreviewSettings.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_PreviewSettings.xaml.h"
#include "StreamResolutionHelper.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario1_PreviewSettings.xaml.h File Reference

  • CameraResolution
  • cpp
Classes | Namespaces

Scenario1_PreviewSettings.xaml.h File Reference

#include "Scenario1_PreviewSettings.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario2_PhotoSettings.xaml.cpp File Reference

  • CameraResolution
  • cpp

Scenario2_PhotoSettings.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_PhotoSettings.xaml.h"
#include "StreamResolutionHelper.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario2_PhotoSettings.xaml.h File Reference

  • CameraResolution
  • cpp
Classes | Namespaces

Scenario2_PhotoSettings.xaml.h File Reference

#include "Scenario2_PhotoSettings.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario3_AspectRatio.xaml.cpp File Reference

  • CameraResolution
  • cpp

Scenario3_AspectRatio.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_AspectRatio.xaml.h"
#include "StreamResolutionHelper.h"
#include <sstream>
#include <math.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario3_AspectRatio.xaml.h File Reference

  • CameraResolution
  • cpp
Classes | Namespaces

Scenario3_AspectRatio.xaml.h File Reference

#include "Scenario3_AspectRatio.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/StreamResolutionHelper.cpp File Reference

  • CameraResolution
  • cpp

StreamResolutionHelper.cpp File Reference

#include "pch.h"
#include "StreamResolutionHelper.h"
#include <sstream>
#include <math.h>
#include <iomanip>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/StreamResolutionHelper.h File Reference

  • CameraResolution
  • cpp
Classes | Namespaces

StreamResolutionHelper.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/SampleConfiguration.cs File Reference

  • CameraResolution
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MediaCapturePreviewer
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/Scenario1_PreviewSettings.xaml.cs File Reference

  • CameraResolution
  • cs
Classes | Namespaces

Scenario1_PreviewSettings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_PreviewSettings
Scenario 1 Change camera preview settings. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/Scenario2_PhotoSettings.xaml.cs File Reference

  • CameraResolution
  • cs
Classes | Namespaces

Scenario2_PhotoSettings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_PhotoSettings
Scenario 2 Change camera preview and photo settings. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/Scenario3_AspectRatio.xaml.cs File Reference

  • CameraResolution
  • cs
Classes | Namespaces

Scenario3_AspectRatio.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AspectRatio
Scenario 3 keep aspect ratios the same. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/StreamResolution.cs File Reference

  • CameraResolution
  • cs
Classes | Namespaces

StreamResolution.cs File Reference

Go to the source code of this file.

Classes

class | StreamResolution
Wrapper class around IMediaEncodingProperties to help how devices report supported resolutions. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/App.xaml.cpp File Reference

  • CameraStarterKit
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/App.xaml.h File Reference

  • CameraStarterKit
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/CameraRotationHelper.cpp File Reference

  • CameraStarterKit
  • cpp

CameraRotationHelper.cpp File Reference

#include "pch.h"
#include "CameraRotationHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/CameraRotationHelper.h File Reference

  • CameraStarterKit
  • cpp
Classes | Namespaces

CameraRotationHelper.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/MainPage.xaml.cpp File Reference

  • CameraStarterKit
  • cpp
Functions

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Functions

_captureFolder (nullptr)
_rotationHelper (nullptr)

Function Documentation

_captureFolder ( nullptr )
_rotationHelper ( nullptr )

Definition at line 46 of file MainPage.xaml.cpp.

{
    InitializeComponent();

    _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();

    // Do not cache the state of the UI when suspending/navigating
    Page::NavigationCacheMode = Navigation::NavigationCacheMode::Disabled;
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/MainPage.xaml.h File Reference

  • CameraStarterKit
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"
#include "CameraRotationHelper.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/pch.cpp File Reference

  • CameraStarterKit
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/pch.h File Reference

  • CameraStarterKit
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/App.xaml.cs File Reference

  • CameraStarterKit
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/CameraRotationHelper.cs File Reference

  • CameraStarterKit
  • cs
Classes | Namespaces

CameraRotationHelper.cs File Reference

Go to the source code of this file.

Classes

class | CameraRotationHelper

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/MainPage.xaml.cs File Reference

  • CameraStarterKit
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraStarterKit
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/App.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"
#include "CameraStreamCoordinateMapperMain.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 31 of file App.cpp.

{
    auto direct3DApplicationSource = ref new Direct3DApplicationSource();
    CoreApplication::Run(direct3DApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/App.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
Classes | Namespaces

App.h File Reference

#include "Common\DeviceResources.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp

CameraStreamCoordinateMapperMain.cpp File Reference

#include "pch.h"
#include "CameraStreamCoordinateMapperMain.h"
#include "Common\DirectXHelper.h"
#include "Common\GraphicsCamera.h"
#include "Content\QuadRenderer.h"
#include "Content\TextRenderer.h"
#include "Content\CameraCoordinateMapper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
Classes | Namespaces

CameraStreamCoordinateMapperMain.h File Reference

#include "Common\StepTimer.h"
#include "Common\DeviceResources.h"
#include "Content\GpuCoordinateMapper.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | CameraStreamCoordinateMapperMain

Namespaces

namespace | CameraStreamCoordinateMapper
namespace | DX
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/pch.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/pch.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
Defines

pch.h File Reference

#include <wrl.h>
#include <wrl\client.h>
#include <dxgi1_4.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effects_2.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <WindowsNumerics.h>
#include <collection.h>
#include <agile.h>
#include <concrt.h>
#include <memory>
#include <shared_mutex>
#include <future>
#include <algorithm>
#include <numeric>
#include <optional>
#include <string>
#include <cmath>
#include <experimental\resumable>
#include <ppltasks.h>
#include <pplawait.h>

Go to the source code of this file.

Defines

#define NOMINMAX

Define Documentation

#define NOMINMAX

Definition at line 14 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DeviceResources.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <DXGI.h>

Go to the source code of this file.

Namespaces

namespace | DisplayMetrics
namespace | ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DeviceResources.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common

DirectXHelper.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common
Classes | Namespaces | Functions

DirectXHelper.h File Reference

Go to the source code of this file.

Classes

class | GpuPerformanceTimer
struct | TextureData

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Microsoft::WRL::ComPtr
< ID3D11Buffer > 		CreateBuffer (ID3D11Device *device, const size_t size, const void *buffer=nullptr, std::optional< UINT > bindFlags=std::nullopt, std::optional< D3D11_USAGE > usage=std::nullopt, std::optional< UINT > cpuFlags=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11DepthStencilView > 		CreateDepthStencilView (ID3D11Texture2D *texture, std::optional< DXGI_FORMAT > format=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11InputLayout > 		CreateInputLayout (ID3D11Device *device, const D3D11_INPUT_ELEMENT_DESC *vertexDesc, size_t vertexDescCount, const void *vertexShaderData, size_t vertexShaderDataSize)
Microsoft::WRL::ComPtr
< ID3D11PixelShader > 		CreatePixelShader (ID3D11Device *device, const void *data, size_t dataSize)
Microsoft::WRL::ComPtr
< ID3D11RenderTargetView > 		CreateRenderTargetView (ID3D11Texture2D *texture)
Microsoft::WRL::ComPtr
< ID3D11SamplerState > 		CreateSamplerState (ID3D11Device *device, const D3D11_SAMPLER_DESC &samplerDesc=CD3D11_SAMPLER_DESC{CD3D11_DEFAULT{}})
Microsoft::WRL::ComPtr
< ID3D11ShaderResourceView > 		CreateShaderResourceView (ID3D11Texture2D *texture, std::optional< DXGI_FORMAT > format=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11Texture2D > 		CreateTexture (ID3D11Device *device, UINT width, UINT height, DXGI_FORMAT format, std::optional< TextureData > textureData=std::nullopt, std::optional< UINT > bindFlags=std::nullopt, std::optional< D3D11_USAGE > usage=std::nullopt, std::optional< UINT > cpuFlags=std::nullopt)
Microsoft::WRL::ComPtr
< ID3D11VertexShader > 		CreateVertexShader (ID3D11Device *device, const void *data, size_t dataSize)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common

GraphicsCamera.cpp File Reference

#include "pch.h"
#include "Common\GraphicsCamera.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common
Classes

GraphicsCamera.h File Reference

Go to the source code of this file.

Classes

class sealed
Client side RPC implementation. More...
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/StepTimer.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Namespaces | Functions

CameraCoordinateMapper.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "CameraCoordinateMapper.h"
#include "CameraStreamProcessor.h"
#include "GpuCoordinateMapper.h"
#include <MemoryBuffer.h>

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{CameraCoordinateMapper.cpp}

Functions

template<typename Func >
void | AccessSoftwareBitmap (SoftwareBitmap^bitmap, Func &&func)
void | CopySoftwareBitmapToDirect3DTexture (SoftwareBitmap^softwareBitmap, ID3D11DeviceContext *context, ID3D11Texture2D *texture)
template<typename Func >
ComPtr< ID3D11Texture2D > | GenerateIntrinsicsMapping (ID3D11Device *device, CameraIntrinsics^cameraIntrinsics, Func &&func)
bool | IsValidColorFrame (MediaFrameReference^frame)
bool | IsValidDepthFrame (MediaFrameReference^frame)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraCoordinateMapper.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces

CameraCoordinateMapper.h File Reference

#include "Common\DeviceResources.h"
#include "GpuCoordinateMapper.h"

Go to the source code of this file.

Classes

class | CameraCoordinateMapper

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content

CameraStreamProcessor.cpp File Reference

#include "pch.h"
#include "CameraStreamProcessor.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces

CameraStreamProcessor.h File Reference

Go to the source code of this file.

Classes

class | CameraStreamProcessor
struct | CameraStreamProcessor::FrameData

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Namespaces | Functions

GpuCoordinateMapper.cpp File Reference

#include "pch.h"
#include "GpuCoordinateMapper.h"
#include "Common\DirectXHelper.h"
#include "Shaders\RasterizeDepthMeshVS.h"
#include "Shaders\RasterizeDepthMeshPS.h"
#include "Shaders\VisualizeDepthMeshVS.h"
#include "Shaders\VisualizeDepthMeshPS.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{GpuCoordinateMapper.cpp}

Functions

CameraIntrinsics_Shader | GetCameraIntrinsicsConstantsForShader (const GpuCoordinateMapper::CameraIntrinsics &intrinsics)
RasterizeDepthMeshConstants_Shader | GetRasterizeDepthMeshConstantsForShader (const GpuCoordinateMapper::RasterizedFrameBlob &frameBlob)
VisualizeDepthMeshConstants_Shader | GetVisualizeDepthMeshConstantsForShader (const GpuCoordinateMapper::VisualizeFrameBlob &frameBlob)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/GpuCoordinateMapper.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces

GpuCoordinateMapper.h File Reference

#include "Common\DeviceResources.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | GpuCoordinateMapper
struct | GpuCoordinateMapper::CameraIntrinsics
struct | GpuCoordinateMapper::RasterizedFrameBlob
struct | GpuCoordinateMapper::VisualizeFrameBlob

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content

QuadRenderer.cpp File Reference

#include "pch.h"
#include "QuadRenderer.h"
#include "Common\DirectXHelper.h"
#include "Shaders\QuadVertexShader.h"
#include "Shaders\QuadPixelShader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces

QuadRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | QuadRenderer

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/ShaderStructures.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | VertexPositionTex

Namespaces

namespace | CameraStreamCoordinateMapper

Functions

struct | alignas (16) ModelViewProjectionConstantBuffer
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/TextRenderer.cpp File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Functions

TextRenderer.cpp File Reference

#include "pch.h"
#include "TextRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Functions

DWRITE_TEXT_ALIGNMENT | GetDwriteTextAlignment (TextRenderer::TextAlignment alignment)
D2D1::Matrix3x2F | GetScreenTranslation (const Windows::Foundation::Size &screenSize, const DWRITE_TEXT_METRICS &textMetrics, TextRenderer::TextAlignment alignment)

Function Documentation

DWRITE_TEXT_ALIGNMENT GetDwriteTextAlignment ( TextRenderer::TextAlignment alignment )

Definition at line 78 of file TextRenderer.cpp.

{
    if (alignment == TextRenderer::TextAlignment::TopLeft || alignment == TextRenderer::TextAlignment::BottomLeft)
    {
        return DWRITE_TEXT_ALIGNMENT_LEADING;
    }
    else
    {
        return DWRITE_TEXT_ALIGNMENT_TRAILING;
    }
}

D2D1::Matrix3x2F GetScreenTranslation | ( | const Windows::Foundation::Size & | screenSize,
 |  | const DWRITE_TEXT_METRICS & | textMetrics,
 |  | TextRenderer::TextAlignment | alignment
 | ) |  |

Definition at line 55 of file TextRenderer.cpp.

{
    const float layoutOffsetX = screenSize.Width - textMetrics.layoutWidth;
    const float layoutOffsetY = screenSize.Height - textMetrics.height;

    if (alignment == TextRenderer::TextAlignment::BottomRight)
    {
        return D2D1::Matrix3x2F::Translation(layoutOffsetX, layoutOffsetY);
    }

    if (alignment == TextRenderer::TextAlignment::TopRight)
    {
        return D2D1::Matrix3x2F::Translation(layoutOffsetX, 0.0f);
    }

    if (alignment == TextRenderer::TextAlignment::BottomLeft)
    {
        return D2D1::Matrix3x2F::Translation(0.0f, layoutOffsetY);
    }

    return D2D1::Matrix3x2F::Translation(0.0f, 0.0f);
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/TextRenderer.h File Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content
Classes | Namespaces

TextRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | TextRenderer

Namespaces

namespace | CameraStreamCoordinateMapper
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/FrameRenderer.cpp File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Functions

FrameRenderer.cpp File Reference

#include "pch.h"
#include <MemoryBuffer.h>
#include "FrameRenderer.h"

Go to the source code of this file.

Classes

struct | ColorBGRA

Functions

template<typename T >
Microsoft::WRL::ComPtr< T > | AsComPtr (Platform::Object^object)
template<typename T , typename U >
T | InterlockedExchangeRefPointer (T^*target, U value)

Function Documentation

Microsoft::WRL::ComPtr<T> AsComPtr ( Platform::Object^ object )

Definition at line 46 of file FrameRenderer.cpp.

{
    Microsoft::WRL::ComPtr<T> p;
    reinterpret_cast<IUnknown*>(object)->QueryInterface(IID_PPV_ARGS(&p));
    return p;
}

T InterlockedExchangeRefPointer | ( | T^* | target,
 |  | U | value
 | ) |  |

Definition at line 34 of file FrameRenderer.cpp.

{
    static_assert(sizeof(T^) == sizeof(void*), "InterlockedExchangePointer is the wrong size");
    T^ exchange = value;
    void** rawExchange = reinterpret_cast<void**>(&exchange);
    void** rawTarget = reinterpret_cast<void**>(target);
    *rawExchange = static_cast<IInspectable*>(InterlockedExchangePointer(rawTarget, *rawExchange));
    return exchange;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/FrameRenderer.h File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Namespaces

FrameRenderer.h File Reference

Go to the source code of this file.

Classes

class | FrameRenderer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/pch.cpp File Reference

  • CameraStreamCorrelation
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/pch.h File Reference

  • CameraStreamCorrelation
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <shared_mutex>
#include <initguid.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SampleConfiguration.cpp File Reference

  • CameraStreamCorrelation
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SampleConfiguration.h File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.cpp File Reference

  • CameraStreamCorrelation
  • cpp

Scenario1_CorrelateStreams.xaml.cpp File Reference

#include "pch.h"
#include <windowsnumerics.h>
#include "Scenario1_CorrelateStreams.xaml.h"
#include "FrameRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.h File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Namespaces

Scenario1_CorrelateStreams.xaml.h File Reference

#include "Scenario1_CorrelateStreams.g.h"
#include "MainPage.xaml.h"
#include "SkeletalFrameRenderer.h"
#include "SimpleLogger.h"
#include "FrameRenderer.h"
#include <wrl.h>
#include <wrl/client.h>

Go to the source code of this file.

Classes

struct | FrameSourceState
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SimpleLogger.h File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Namespaces

SimpleLogger.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SkeletalFrameRenderer.cpp File Reference

  • CameraStreamCorrelation
  • cpp

SkeletalFrameRenderer.cpp File Reference

#include "pch.h"
#include "SkeletalFrameRenderer.h"
#include <initguid.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SkeletalFrameRenderer.h File Reference

  • CameraStreamCorrelation
  • cpp
Classes | Namespaces | Functions

SkeletalFrameRenderer.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Functions

public delegate
Windows::Foundation::Point 		CoordinateTransformationMethod (Windows::Foundation::Numerics::float3)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/BufferHelper.h File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview
Classes | Namespaces

BufferHelper.h File Reference

Go to the source code of this file.

Classes

class | BufferHelper
class | sealed

Namespaces

namespace | WindowsPreview
namespace | WindowsPreview::Media
namespace | WindowsPreview::Media::Capture
namespace | WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/MFPoseTrackingFrame.h File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview
Classes | Namespaces | Enumerations | Functions

MFPoseTrackingFrame.h File Reference

Go to the source code of this file.

Classes

struct | PoseTrackingEntityData
struct | PoseTrackingFrameHeader
struct | TrackedPose

Namespaces

namespace | MFPoseTrackingPreview

Enumerations

enum BodyPart {
SpineBase = 0, SpineMid = 1, Neck = 2, Head = 3,
ShoulderLeft = 4, ElbowLeft = 5, WristLeft = 6, HandLeft = 7,
ShoulderRight = 8, ElbowRight = 9, WristRight = 10, HandRight = 11,
HipLeft = 12, KneeLeft = 13, AnkleLeft = 14, FootLeft = 15,
HipRight = 16, KneeRight = 17, AnkleRight = 18, FootRight = 19,
SpineShoulder = 20, HandTipLeft = 21, ThumbLeft = 22, HandTipRight = 23,
ThumbRight = 24
}
enum | TrackingStatus { NotTracked = 0, Inferred = 1, Tracked = 2 }

Functions

DEFINE_GUID (MFPerceptionFormat_PoseTracking, 0x69232056, 0x2ed9, 0x4d0e, 0x89, 0xcc, 0x5d, 0x27, 0x34, 0xa5, 0x68, 0x8)
DEFINE_GUID (PoseSet_HandTracking, 0xf142c82c, 0x3a57, 0x4e7d, 0x81, 0x59, 0x98, 0xbd, 0xbd, 0x6c, 0xcf, 0xe2)
DEFINE_GUID (PoseSet_BodyTracking, 0x84520b1f, 0xab61, 0x46da, 0xab, 0x1d, 0xe0, 0x13, 0x40, 0xef, 0x88, 0x4e)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.cpp File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.h File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview
Functions

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <Windows.Foundation.Numerics.h>
#include <robuffer.h>
#include <wrl.h>
#include <Mfobjects.h>
#include <Mfapi.h>
#include <string>
#include "BufferHelper.h"

Go to the source code of this file.

Functions

template<typename parentType , typename repeatedType , uint32_t declaredCount = 1>
uint32_t sizeof_composedStructure (uint32_t effectiveCount)

Function Documentation

uint32_t sizeof_composedStructure ( uint32_t effectiveCount )

Definition at line 29 of file pch.h.

{
    return static_cast<uint32_t>(sizeof(parentType) + (static_cast<int32_t>(effectiveCount) - static_cast<int32_t>(declaredCount)) * sizeof(repeatedType));
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.cpp File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview
Functions | Variables

PoseTrackingFrame.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "PoseTrackingFrame.h"

Go to the source code of this file.

Functions

static_assert (sizeof(MFPoseTrackingPreview::TrackedPose)==sizeof(WindowsPreview::Media::Capture::Frames::TrackedPose),"Error: Mismatched size of TrackedPose")
static_assert (offsetof(MFPoseTrackingPreview::TrackedPose, Orientation)==offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Orientation),"Error: Mismatched offset of v in TrackedPose")
static_assert (offsetof(MFPoseTrackingPreview::TrackedPose, OrientationStatus)==offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, OrientationStatus),"Error: Mismatched offset of OrientationStatus in TrackedPose")
static_assert (offsetof(MFPoseTrackingPreview::TrackedPose, Position)==offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Position),"Error: Mismatched offset of Position in TrackedPose")
static_assert (offsetof(MFPoseTrackingPreview::TrackedPose, PositionStatus)==offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, PositionStatus),"Error: Mismatched offset of PositionStatus in TrackedPose")

Variables

const unsigned int GuidBufferLength = 40

Function Documentation

static_assert | ( | sizeof(MFPoseTrackingPreview::TrackedPose) | = =sizeof(WindowsPreview::Media::Capture::Frames::TrackedPose),
 |  | "Error: Mismatched size of TrackedPose" |
 | ) |  |
static_assert | ( | offsetof(MFPoseTrackingPreview::TrackedPose, Orientation) | = =offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Orientation),
 |  | "Error: Mismatched offset of v in TrackedPose" |
 | ) |  |
static_assert | ( | offsetof(MFPoseTrackingPreview::TrackedPose, OrientationStatus) | = =offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, OrientationStatus),
 |  | "Error: Mismatched offset of OrientationStatus in TrackedPose" |
 | ) |  |
static_assert | ( | offsetof(MFPoseTrackingPreview::TrackedPose, Position) | = =offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Position),
 |  | "Error: Mismatched offset of Position in TrackedPose" |
 | ) |  |
static_assert | ( | offsetof(MFPoseTrackingPreview::TrackedPose, PositionStatus) | = =offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, PositionStatus),
 |  | "Error: Mismatched offset of PositionStatus in TrackedPose" |
 | ) |  |

Variable Documentation

const unsigned int GuidBufferLength = 40

Definition at line 29 of file PoseTrackingFrame.cpp.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.h File Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview
Classes | Namespaces | Enumerations

PoseTrackingFrame.h File Reference

#include "MFPoseTrackingFrame.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
class | sealed
class | sealed
struct | TrackedPose

Namespaces

namespace | WindowsPreview
namespace | WindowsPreview::Media
namespace | WindowsPreview::Media::Capture
namespace | WindowsPreview::Media::Capture::Frames

Enumerations

enum BodyPart {
SpineBase = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineBase), SpineMid = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineMid), Neck = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Neck), Head = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::Head),
ShoulderLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderLeft), ElbowLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowLeft), WristLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristLeft), HandLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandLeft),
ShoulderRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ShoulderRight), ElbowRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ElbowRight), WristRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::WristRight), HandRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandRight),
HipLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipLeft), KneeLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeLeft), AnkleLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleLeft), FootLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootLeft),
HipRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HipRight), KneeRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::KneeRight), AnkleRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::AnkleRight), FootRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::FootRight),
SpineShoulder = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::SpineShoulder), HandTipLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipLeft), ThumbLeft = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbLeft), HandTipRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::HandTipRight),
ThumbRight = static_cast<int32_t>(MFPoseTrackingPreview::BodyPart::ThumbRight)
}
enum PoseTrackingFrameCreationStatus {
Success, NotAPerceptionMediaType, NotAPoseTrackingFrame, FrameBufferReleased,
InvalidFormat
}
enum | TrackingStatus { NotTracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::NotTracked), Inferred = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Inferred), Tracked = static_cast<int32_t>(MFPoseTrackingPreview::TrackingStatus::Tracked) }
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/App.xaml.cpp File Reference

  • CameraVideoStabilization
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/App.xaml.h File Reference

  • CameraVideoStabilization
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraVideoStabilization
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/MainPage.xaml.cpp File Reference

  • CameraVideoStabilization
  • cpp
Functions

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Functions

_captureFolder (nullptr)
_inputPropertiesBackup (nullptr)
_outputPropertiesBackup (nullptr)
_videoStabilizationEffect (nullptr)

Function Documentation

_captureFolder ( nullptr )

Definition at line 52 of file MainPage.xaml.cpp.

{
    InitializeComponent();

    _orientationSensor = SimpleOrientationSensor::GetDefault();
    _displayInformation = DisplayInformation::GetForCurrentView();
    _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();

    // Do not cache the state of the UI when suspending/navigating
    Page::NavigationCacheMode = Navigation::NavigationCacheMode::Disabled;

    // Useful to know when to initialize/clean up the camera
    _applicationSuspendingEventToken =
        Application::Current->Suspending += ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
    _applicationResumingEventToken =
        Application::Current->Resuming += ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);
}

_inputPropertiesBackup ( nullptr )
_outputPropertiesBackup ( nullptr )
_videoStabilizationEffect ( nullptr )
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/MainPage.xaml.h File Reference

  • CameraVideoStabilization
  • cpp
Classes | Namespaces

MainPage.xaml.h File Reference

#include "MainPage.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraVideoStabilization
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/pch.cpp File Reference

  • CameraVideoStabilization
  • cpp
Defines

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Defines

#define USE_VS_RECOMMENDATION

Define Documentation

#define USE_VS_RECOMMENDATION

Definition at line 14 of file pch.cpp.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/pch.h File Reference

  • CameraVideoStabilization
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cs/App.xaml.cs File Reference

  • CameraVideoStabilization
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CameraVideoStabilization
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cs/MainPage.xaml.cs File Reference

  • CameraVideoStabilization
  • cs
Classes | Namespaces | Defines

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage

Namespaces

namespace | CameraVideoStabilization

Defines

#define | USE_VS_RECOMMENDATION

Define Documentation

#define USE_VS_RECOMMENDATION

Definition at line 12 of file MainPage.xaml.cs.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/pch.cpp File Reference

  • Capabilities
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/pch.h File Reference

  • Capabilities
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Geolocation.h"
#include "winrt/Windows.Security.Authorization.AppCapabilityAccess.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Project.idl File Reference

  • Capabilities
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Check
runtimeclass | Scenario2_RequestMany
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/SampleConfiguration.cpp File Reference

  • Capabilities
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/SampleConfiguration.h File Reference

  • Capabilities
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario1_Check.cpp File Reference

  • Capabilities
  • cppwinrt
Namespaces

Scenario1_Check.cpp File Reference

#include "pch.h"
#include "Scenario1_Check.h"
#include "Scenario1_Check.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario1_Check.h File Reference

  • Capabilities
  • cppwinrt
Classes | Namespaces

Scenario1_Check.h File Reference

#include "Scenario1_Check.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Check
struct | Scenario1_Check

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario2_RequestMany.cpp File Reference

  • Capabilities
  • cppwinrt
Namespaces

Scenario2_RequestMany.cpp File Reference

#include "pch.h"
#include "Scenario2_RequestMany.h"
#include "Scenario2_RequestMany.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario2_RequestMany.h File Reference

  • Capabilities
  • cppwinrt
Classes | Namespaces

Scenario2_RequestMany.h File Reference

#include "Scenario2_RequestMany.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_RequestMany
struct | Scenario2_RequestMany

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cs/SampleConfiguration.cs File Reference

  • Capabilities
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cs/Scenario1_Check.xaml.cs File Reference

  • Capabilities
  • cs
Classes | Namespaces

Scenario1_Check.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Check

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cs/Scenario2_RequestMany.xaml.cs File Reference

  • Capabilities
  • cs
Classes | Namespaces

Scenario2_RequestMany.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_RequestMany

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/pch.cpp File Reference

  • CashDrawer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/pch.h File Reference

  • CashDrawer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/SampleConfiguration.cpp File Reference

  • CashDrawer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/SampleConfiguration.h File Reference

  • CashDrawer
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DeviceHelpers

Functions

Concurrency::task
< Windows::Devices::PointOfService::CashDrawer^> 		GetFirstCashDrawerAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario1_OpenDrawer.xaml.cpp File Reference

  • CashDrawer
  • cpp

Scenario1_OpenDrawer.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OpenDrawer.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario1_OpenDrawer.xaml.h File Reference

  • CashDrawer
  • cpp
Classes | Namespaces

Scenario1_OpenDrawer.xaml.h File Reference

#include "Scenario1_OpenDrawer.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario2_CloseDrawer.xaml.cpp File Reference

  • CashDrawer
  • cpp

Scenario2_CloseDrawer.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_CloseDrawer.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario2_CloseDrawer.xaml.h File Reference

  • CashDrawer
  • cpp
Classes | Namespaces

Scenario2_CloseDrawer.xaml.h File Reference

#include "Scenario2_CloseDrawer.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.cpp File Reference

  • CashDrawer
  • cpp

Scenario3_MultipleDrawers.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_MultipleDrawers.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario3_MultipleDrawers.xaml.h File Reference

  • CashDrawer
  • cpp
Classes | Namespaces

Scenario3_MultipleDrawers.xaml.h File Reference

#include "Scenario3_MultipleDrawers.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/SampleConfiguration.cs File Reference

  • CashDrawer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | DeviceHelpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/Scenario1_OpenDrawer.xaml.cs File Reference

  • CashDrawer
  • cs
Classes | Namespaces

Scenario1_OpenDrawer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_OpenDrawer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/Scenario2_CloseDrawer.xaml.cs File Reference

  • CashDrawer
  • cs
Classes | Namespaces

Scenario2_CloseDrawer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_CloseDrawer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/Scenario3_MultipleDrawers.xaml.cs File Reference

  • CashDrawer
  • cs
Classes | Namespaces

Scenario3_MultipleDrawers.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_MultipleDrawers
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/pch.cpp File Reference

  • ClientDeviceInformation
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/pch.h File Reference

  • ClientDeviceInformation
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/SampleConfiguration.cpp File Reference

  • ClientDeviceInformation
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/SampleConfiguration.h File Reference

  • ClientDeviceInformation
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.cpp File Reference

  • ClientDeviceInformation
  • cpp

Scenario1_GetDeviceInformation.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_GetDeviceInformation.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.h File Reference

  • ClientDeviceInformation
  • cpp
Classes | Namespaces

Scenario1_GetDeviceInformation.xaml.h File Reference

#include "Scenario1_GetDeviceInformation.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cs/SampleConfiguration.cs File Reference

  • ClientDeviceInformation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cs/Scenario1_GetDeviceInformation.xaml.cs File Reference

  • ClientDeviceInformation
  • cs
Classes | Namespaces

Scenario1_GetDeviceInformation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_GetDeviceInformation

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyFiles.cpp File Reference

  • Clipboard
  • cppwinrt
Namespaces

CopyFiles.cpp File Reference

#include "pch.h"
#include "CopyFiles.h"
#include "CopyFiles.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyFiles.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

CopyFiles.h File Reference

#include "CopyFiles.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | CopyFiles
struct | CopyFiles

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyImage.cpp File Reference

  • Clipboard
  • cppwinrt
Namespaces

CopyImage.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "CopyImage.h"
#include "CopyImage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyImage.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

CopyImage.h File Reference

#include "CopyImage.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | CopyImage
struct | CopyImage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyText.cpp File Reference

  • Clipboard
  • cppwinrt
Namespaces

CopyText.cpp File Reference

#include "pch.h"
#include "CopyText.h"
#include "CopyText.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyText.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

CopyText.h File Reference

#include "CopyText.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | CopyText
struct | CopyText

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/HistoryAndRoaming.cpp File Reference

  • Clipboard
  • cppwinrt
Namespaces

HistoryAndRoaming.cpp File Reference

#include "pch.h"
#include "HistoryAndRoaming.h"
#include "HistoryAndRoaming.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/HistoryAndRoaming.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

HistoryAndRoaming.h File Reference

#include "HistoryAndRoaming.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | HistoryAndRoaming
struct | HistoryAndRoaming

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/OtherScenarios.cpp File Reference

  • Clipboard
  • cppwinrt
Namespaces

OtherScenarios.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "OtherScenarios.h"
#include "OtherScenarios.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/OtherScenarios.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

OtherScenarios.h File Reference

#include "OtherScenarios.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | OtherScenarios
struct | OtherScenarios

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/pch.cpp File Reference

  • Clipboard
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/pch.h File Reference

  • Clipboard
  • cppwinrt

pch.h File Reference

#include <sstream>
#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.DataTransfer.h"
#include "winrt/Windows.Data.Html.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.Graphics.Imaging.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Notifications.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/Project.idl File Reference

  • Clipboard
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | CopyFiles
runtimeclass | CopyImage
runtimeclass | CopyText
runtimeclass | HistoryAndRoaming
runtimeclass | OtherScenarios
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/SampleConfiguration.cpp File Reference

  • Clipboard
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/SampleConfiguration.h File Reference

  • Clipboard
  • cppwinrt
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | SampleState

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/CopyFiles.xaml.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

CopyFiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CopyFiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/CopyImage.xaml.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

CopyImage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CopyImage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/CopyText.xaml.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

CopyText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CopyText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/HistoryAndRoaming.xaml.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

HistoryAndRoaming.xaml.cs File Reference

Go to the source code of this file.

Classes

class | HistoryAndRoaming

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/OtherScenarios.xaml.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

OtherScenarios.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OtherScenarios

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/SampleConfiguration.cs File Reference

  • Clipboard
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/CalibrationBar.xaml.cpp File Reference

  • Compass
  • cpp

CalibrationBar.xaml.cpp File Reference

#include "pch.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/CalibrationBar.xaml.h File Reference

  • Compass
  • cpp
Classes | Namespaces

CalibrationBar.xaml.h File Reference

#include "pch.h"
#include "CalibrationBar.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/pch.cpp File Reference

  • Compass
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/pch.h File Reference

  • Compass
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/SampleConfiguration.cpp File Reference

  • Compass
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/SampleConfiguration.h File Reference

  • Compass
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Compass
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Compass
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario2_Polling.xaml.cpp File Reference

  • Compass
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario2_Polling.xaml.h File Reference

  • Compass
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario3_Calibration.xaml.cpp File Reference

  • Compass
  • cpp

Scenario3_Calibration.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Calibration.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario3_Calibration.xaml.h File Reference

  • Compass
  • cpp
Classes | Namespaces

Scenario3_Calibration.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Calibration.g.h"
#include "MainPage.xaml.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/CalibrationBar.xaml.cs File Reference

  • Compass
  • cs
Classes | Namespaces

CalibrationBar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CalibrationBar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/SampleConfiguration.cs File Reference

  • Compass
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Compass
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/Scenario2_Polling.xaml.cs File Reference

  • Compass
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/Scenario3_Calibration.xaml.cs File Reference

  • Compass
  • cs
Classes | Namespaces

Scenario3_Calibration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Calibration

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/pch.cpp File Reference

  • ComplexInk
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/pch.h File Reference

  • ComplexInk
  • cpp
Variables

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <wrl.h>
#include <wrl/client.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1effects_1.h>
#include <dwrite_2.h>
#include <wincodec.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <memory>
#include <agile.h>
#include <concrt.h>
#include "App.xaml.h"
#include <dxgi.h>
#include <dxgi1_2.h>
#include <d2d1_1.h>
#include <d3d11.h>
#include <d2d1.h>
#include <vector>
#include <debugapi.h>
#include <d3d11_1.h>
#include <dwrite.h>
#include "windows.ui.xaml.media.dxinterop.h"

Go to the source code of this file.

Variables

const Windows::UI::Color CanvasBackgroundColor = Windows::UI::Colors::CornflowerBlue

Variable Documentation

const Windows::UI::Color CanvasBackgroundColor = Windows::UI::Colors::CornflowerBlue

Definition at line 35 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/SampleConfiguration.cpp File Reference

  • ComplexInk
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/SampleConfiguration.h File Reference

  • ComplexInk
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Scenario1_CustomDry.xaml.cpp File Reference

  • ComplexInk
  • cpp
Variables

Scenario1_CustomDry.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_CustomDry.xaml.h"

Go to the source code of this file.

Variables

const float | LARGE_CANVAS_HEIGHT = 1 << 21
const float | LARGE_CANVAS_WIDTH = 1 << 21

Variable Documentation

const float LARGE_CANVAS_HEIGHT = 1 << 21

Definition at line 33 of file Scenario1_CustomDry.xaml.cpp.

const float LARGE_CANVAS_WIDTH = 1 << 21

Definition at line 32 of file Scenario1_CustomDry.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Scenario1_CustomDry.xaml.h File Reference

  • ComplexInk
  • cpp
Classes | Namespaces

Scenario1_CustomDry.xaml.h File Reference

#include "Scenario1_CustomDry.g.h"
#include "MainPage.xaml.h"
#include "Renderers\SceneComposer.h"
#include "Controls\ContextMenuFlyout.xaml.h"
#include "Common\InkEventLogger.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/DeviceResources.cpp File Reference

  • ComplexInk
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/DeviceResources.h File Reference

  • ComplexInk
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "pch.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>
#include <math.h>
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/DirectXHelper.h File Reference

  • ComplexInk
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/InkEventLogger.cpp File Reference

  • ComplexInk
  • cpp
  • Common

InkEventLogger.cpp File Reference

#include "pch.h"
#include "InkEventLogger.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/InkEventLogger.h File Reference

  • ComplexInk
  • cpp
  • Common
Classes

InkEventLogger.h File Reference

#include "Resources.h"

Go to the source code of this file.

Classes

class InkEventLogger
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/Resources.h File Reference

  • ComplexInk
  • cpp
  • Common
Enumerations

Resources.h File Reference

Go to the source code of this file.

Enumerations

enum LogEventAction {
StrokeCollected, StrokeErased, IndependentInputEntered, IndependentInputHover,
IndependentInputPressed, IndependentInputMoved, IndependentInputReleased, IndependentInputLost,
IndependentInputExited, UnprocessedInputEntered, UnprocessedInputHover, UnprocessedInputPressed,
UnprocessedInputMoved, UnprocessedInputReleased, UnprocessedInputLost, UnprocessedInputExited,
StrokeStarted, StrokeContinued, StrokeEnded, StrokeCanceled
}
enum LogEventTypes {
EventNone = 0x0, InkingEventType = 0x1, IndependentInputEventType = 0x2, UnprocessedInputEventType = 0x4,
StrokeEventType = 0x8
}

Enumeration Type Documentation

enum LogEventAction
Enumerator:
StrokeCollected
StrokeErased
IndependentInputEntered
IndependentInputHover
IndependentInputPressed
IndependentInputMoved
IndependentInputReleased
IndependentInputLost
IndependentInputExited
UnprocessedInputEntered
UnprocessedInputHover
UnprocessedInputPressed
UnprocessedInputMoved
UnprocessedInputReleased
UnprocessedInputLost
UnprocessedInputExited
StrokeStarted
StrokeContinued
StrokeEnded
StrokeCanceled

Definition at line 12 of file Resources.h.

{
    StrokeCollected,
    StrokeErased,
    IndependentInputEntered,
    IndependentInputHover,
    IndependentInputPressed,
    IndependentInputMoved,
    IndependentInputReleased,
    IndependentInputLost,
    IndependentInputExited,
    UnprocessedInputEntered,
    UnprocessedInputHover,
    UnprocessedInputPressed,
    UnprocessedInputMoved,
    UnprocessedInputReleased,
    UnprocessedInputLost,
    UnprocessedInputExited,
    StrokeStarted,
    StrokeContinued,
    StrokeEnded,
    StrokeCanceled
};

enum LogEventTypes
Enumerator:
EventNone
InkingEventType
IndependentInputEventType
UnprocessedInputEventType
StrokeEventType

Definition at line 3 of file Resources.h.

{
    EventNone                   = 0x0,
    InkingEventType             = 0x1,
    IndependentInputEventType   = 0x2,
    UnprocessedInputEventType   = 0x4,
    StrokeEventType             = 0x8
};

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.cpp File Reference

  • ComplexInk
  • cpp
  • Controls

ContextMenuFlyout.xaml.cpp File Reference

#include "pch.h"
#include "ContextMenuFlyout.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.h File Reference

  • ComplexInk
  • cpp
  • Controls
Classes | Namespaces | Defines

ContextMenuFlyout.xaml.h File Reference

#include "Controls\ContextMenuFlyout.g.h"
#include "..\Renderers\SceneComposer.h"
#include "..\Renderers\SceneComposer.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Defines

#define | PASTE_ITEM_INDEX 4

Define Documentation

#define PASTE_ITEM_INDEX 4

Definition at line 8 of file ContextMenuFlyout.xaml.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/InkRenderer.cpp File Reference

  • ComplexInk
  • cpp
  • Renderers

InkRenderer.cpp File Reference

#include "pch.h"
#include "InkRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/InkRenderer.h File Reference

  • ComplexInk
  • cpp
  • Renderers
Classes | Namespaces

InkRenderer.h File Reference

#include <inkrenderer.h>
#include "Common/DirectXHelper.h"
#include "WindowsNumerics.h"

Go to the source code of this file.

Classes

class | InkRenderer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/SceneComposer.cpp File Reference

  • ComplexInk
  • cpp
  • Renderers

SceneComposer.cpp File Reference

#include "pch.h"
#include "SceneComposer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/SceneComposer.h File Reference

  • ComplexInk
  • cpp
  • Renderers
Classes | Namespaces | Defines

SceneComposer.h File Reference

#include "..\Common\DeviceResources.h"
#include "InkRenderer.h"
#include "ShapeRenderer.h"
#include "WindowsNumerics.h"

Go to the source code of this file.

Classes

class | SceneComposer
class | SceneComposer::InkObject
class | SceneComposer::SceneObject
class | SceneComposer::ShapeObject

Namespaces

namespace | SDKTemplate

Defines

#define | RECT_DELTA 3

Define Documentation

#define RECT_DELTA 3

Definition at line 10 of file SceneComposer.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/ShapeRenderer.cpp File Reference

  • ComplexInk
  • cpp
  • Renderers

ShapeRenderer.cpp File Reference

#include "pch.h"
#include "ShapeRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/ShapeRenderer.h File Reference

  • ComplexInk
  • cpp
  • Renderers
Classes | Namespaces | Defines

ShapeRenderer.h File Reference

#include "Common/DirectXHelper.h"
#include <random>
#include <stdlib.h>
#include <time.h>

Go to the source code of this file.

Classes

struct | Shape
class | ShapeRenderer

Namespaces

namespace | SDKTemplate

Defines

#define | MAX_SHAPE_SIZE_PERCENTAGE 0.20f
#define | MIN_SHAPE_SIZE_PERCENTAGE 0.08f

Define Documentation

#define MAX_SHAPE_SIZE_PERCENTAGE 0.20f

Definition at line 10 of file ShapeRenderer.h.

#define MIN_SHAPE_SIZE_PERCENTAGE 0.08f

Definition at line 11 of file ShapeRenderer.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/pch.cpp File Reference

  • CompositionVisual
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/pch.h File Reference

  • CompositionVisual
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/VisualProperties.cpp File Reference

  • CompositionVisual
  • cpp
Functions

VisualProperties.cpp File Reference

#include "pch.h"
#include "VisualProperties.h"
#include "windowsnumerics.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 22 of file VisualProperties.cpp.

{
  auto visualPropertiesFactory = ref new VisualPropertiesFactory();
  CoreApplication::Run(visualPropertiesFactory);
  return 0;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/VisualProperties.h File Reference

  • CompositionVisual
  • cpp
Classes

VisualProperties.h File Reference

Go to the source code of this file.

Classes

class | sealed
Client side RPC implementation. More...
class | VisualPropertiesFactory
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cs/VisualProperties.cs File Reference

  • CompositionVisual
  • cs
Classes | Namespaces

VisualProperties.cs File Reference

Go to the source code of this file.

Classes

class | VisualProperties
class | VisualPropertiesFactory

Namespaces

namespace | CompositionVisual
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/CompressionUtils.cpp File Reference

  • Compression
  • cpp
Classes

CompressionUtils.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "CompressionUtils.h"

Go to the source code of this file.

Classes

struct ReadStreamTask::ReadStreamTaskImpl
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/CompressionUtils.h File Reference

  • Compression
  • cpp
Classes

CompressionUtils.h File Reference

Go to the source code of this file.

Classes

class | ReadStreamTask
struct | ScenarioContext
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/pch.cpp File Reference

  • Compression
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/pch.h File Reference

  • Compression
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <compressapi.h>
#include <sstream>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/SampleConfiguration.cpp File Reference

  • Compression
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/SampleConfiguration.h File Reference

  • Compression
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario1.xaml.cpp File Reference

  • Compression
  • cpp
Classes | Functions

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"
#include "CompressionUtils.h"
#include <robuffer.h>

Go to the source code of this file.

Classes

struct | PipeEvents
class | PipeIn
class | PipeOut

Functions

byte * | GetUnderlyingBuffer (IBuffer^buf)

Function Documentation

byte* GetUnderlyingBuffer ( IBuffer^ buf )

Definition at line 54 of file Scenario1.xaml.cpp.

{
    Microsoft::WRL::ComPtr<IBufferByteAccess> bufferByteAccess;
    HRESULT hr = reinterpret_cast<IUnknown*>(buf)->QueryInterface(IID_PPV_ARGS(&bufferByteAccess));
    byte* raw_buffer;
    hr = bufferByteAccess->Buffer(&raw_buffer);
    return raw_buffer;
}

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario1.xaml.h File Reference

  • Compression
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Compression
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario2.xaml.cpp File Reference

  • Compression
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include "CompressionUtils.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario2.xaml.h File Reference

  • Compression
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Compression
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario3.xaml.cpp File Reference

  • Compression
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"
#include "CompressionUtils.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario3.xaml.h File Reference

  • Compression
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Compression
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cs/SampleConfiguration.cs File Reference

  • Compression
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cs/Scenario1.xaml.cs File Reference

  • Compression
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Compression
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/SampleConfiguration.cs File Reference

  • ContactCardIntegration
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/Scenario1_CreateContacts.xaml.cs File Reference

  • ContactCardIntegration
  • cs
Classes | Namespaces

Scenario1_CreateContacts.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CreateContacts
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/Scenario2_ReceiveContact.xaml.cs File Reference

  • ContactCardIntegration
  • cs
Classes | Namespaces

Scenario2_ReceiveContact.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ReceiveContact
Page to handle the protocol activation. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/pch.cpp File Reference

  • ContactCards
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/pch.h File Reference

  • ContactCards
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/SampleConfiguration.cpp File Reference

  • ContactCards
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/SampleConfiguration.h File Reference

  • ContactCards
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario1_Mini.xaml.cpp File Reference

  • ContactCards
  • cpp

Scenario1_Mini.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Mini.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario1_Mini.xaml.h File Reference

  • ContactCards
  • cpp
Classes | Namespaces

Scenario1_Mini.xaml.h File Reference

#include "Scenario1_Mini.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario2_DelayMini.xaml.cpp File Reference

  • ContactCards
  • cpp

Scenario2_DelayMini.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_DelayMini.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario2_DelayMini.xaml.h File Reference

  • ContactCards
  • cpp
Classes | Namespaces

Scenario2_DelayMini.xaml.h File Reference

#include "Scenario2_DelayMini.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario3_Full.xaml.cpp File Reference

  • ContactCards
  • cpp

Scenario3_Full.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Full.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario3_Full.xaml.h File Reference

  • ContactCards
  • cpp
Classes | Namespaces

Scenario3_Full.xaml.h File Reference

#include "Scenario3_Full.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/SampleConfiguration.cs File Reference

  • ContactCards
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/Scenario1_Mini.xaml.cs File Reference

  • ContactCards
  • cs
Classes | Namespaces

Scenario1_Mini.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Mini

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/Scenario2_DelayMini.xaml.cs File Reference

  • ContactCards
  • cs
Classes | Namespaces

Scenario2_DelayMini.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DelayMini

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/Scenario3_Full.xaml.cs File Reference

  • ContactCards
  • cs
Classes | Namespaces

Scenario3_Full.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Full

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/AppContactPanel.xaml.cs File Reference

  • ContactPanel
  • cs
Classes | Namespaces

AppContactPanel.xaml.cs File Reference

Go to the source code of this file.

Classes

class | AppContactPanel
A page that is hosted within the MyPeople flyout on the taskbar. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/SampleConfiguration.cs File Reference

  • ContactPanel
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | Constants
Class containing Attributes and UUIDs that will populate the SDP record. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/Scenario1_CreateContact.xaml.cs File Reference

  • ContactPanel
  • cs
Classes | Namespaces

Scenario1_CreateContact.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CreateContact
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/pch.cpp File Reference

  • ContactPicker
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/pch.h File Reference

  • ContactPicker
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/SampleConfiguration.cpp File Reference

  • ContactPicker
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/SampleConfiguration.h File Reference

  • ContactPicker
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/Scenario1_Single.xaml.cpp File Reference

  • ContactPicker
  • cpp

Scenario1_Single.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Single.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/Scenario1_Single.xaml.h File Reference

  • ContactPicker
  • cpp
Classes | Namespaces

Scenario1_Single.xaml.h File Reference

#include "Scenario1_Single.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/Scenario2_Multiple.xaml.cpp File Reference

  • ContactPicker
  • cpp

Scenario2_Multiple.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Multiple.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/Scenario2_Multiple.xaml.h File Reference

  • ContactPicker
  • cpp
Classes | Namespaces

Scenario2_Multiple.xaml.h File Reference

#include "Scenario2_Multiple.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cs/SampleConfiguration.cs File Reference

  • ContactPicker
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cs/Scenario1_Single.xaml.cs File Reference

  • ContactPicker
  • cs
Classes | Namespaces

Scenario1_Single.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Single

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cs/Scenario2_Multiple.xaml.cs File Reference

  • ContactPicker
  • cs
Classes | Namespaces

Scenario2_Multiple.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Multiple

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/Helpers.h File Reference

  • ContentIndexer
  • cpp
Namespaces | Functions

Helpers.h File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

void | AddAppContentFilesToIndexedFolder ()
void | AddItemsToIndex (Windows::Storage::Search::ContentIndexer^indexer)
Platform::String | CreateItemString (Platform::String^itemKey, Platform::Collections::Vector< Platform::String^>^propertyKeys, Windows::Foundation::Collections::IMapView< Platform::String^, Platform::Object^>^properties)
Platform::String | HResultToString (int hr)
void | InitializeRevisionNumber ()
void | OnIndexerOperationBegin ()
void | OnIndexerOperationComplete (Windows::Storage::Search::ContentIndexer^indexer)
Platform::String | StringifyProperty (Platform::Object^property)
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/pch.cpp File Reference

  • ContentIndexer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/pch.h File Reference

  • ContentIndexer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S1_AddWithAPI.xaml.cpp File Reference

  • ContentIndexer
  • cpp

S1_AddWithAPI.xaml.cpp File Reference

#include "pch.h"
#include "S1_AddWithAPI.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S1_AddWithAPI.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S1_AddWithAPI.xaml.h File Reference

#include "S1_AddWithAPI.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.cpp File Reference

  • ContentIndexer
  • cpp

S2_UpdateAndDeleteWithAPI.xaml.cpp File Reference

#include "pch.h"
#include "S2_UpdateAndDeleteWithAPI.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S2_UpdateAndDeleteWithAPI.xaml.h File Reference

#include "S2_UpdateAndDeleteWithAPI.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.cpp File Reference

  • ContentIndexer
  • cpp
Functions

S3_RetrieveWithAPI.xaml.cpp File Reference

#include "pch.h"
#include "S3_RetrieveWithAPI.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Functions

void ExecuteQueryHelper (String^queryString)

Function Documentation

void ExecuteQueryHelper ( String^ queryString )

Definition at line 44 of file S3_RetrieveWithAPI.xaml.cpp.

{
    auto indexer = Windows::Storage::Search::ContentIndexer::GetIndexer();
    auto propertyKeys = ref new Vector<String^>();
    propertyKeys->Append(Windows::Storage::SystemProperties::ItemNameDisplay);
    propertyKeys->Append(Windows::Storage::SystemProperties::Keywords);
    propertyKeys->Append(Windows::Storage::SystemProperties::Comment);
    auto query = indexer->CreateQuery(queryString, propertyKeys);
    create_task(query->GetAsync()).then([propertyKeys](IVectorView<Windows::Storage::Search::IIndexableContent^>^ documents)
    {
        String^ itemsString;
        for (const auto& document : documents)
        {
            itemsString += CreateItemString(document->Id, propertyKeys, document->Properties->GetView()) + L"\n";
        }
        MainPage::Current->NotifyUser(itemsString, NotifyType::StatusMessage);
    });
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S3_RetrieveWithAPI.xaml.h File Reference

#include "S3_RetrieveWithAPI.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S4_CheckIndexRevision.xaml.cpp File Reference

  • ContentIndexer
  • cpp

S4_CheckIndexRevision.xaml.cpp File Reference

#include "pch.h"
#include "S4_CheckIndexRevision.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S4_CheckIndexRevision.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S4_CheckIndexRevision.xaml.h File Reference

#include "S4_CheckIndexRevision.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S5_AddWithAppContent.xaml.cpp File Reference

  • ContentIndexer
  • cpp

S5_AddWithAppContent.xaml.cpp File Reference

#include "pch.h"
#include "S5_AddWithAppContent.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S5_AddWithAppContent.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S5_AddWithAppContent.xaml.h File Reference

#include "S5_AddWithAppContent.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.cpp File Reference

  • ContentIndexer
  • cpp

S6_DeleteWithAppContent.xaml.cpp File Reference

#include "pch.h"
#include "S6_DeleteWithAppContent.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S6_DeleteWithAppContent.xaml.h File Reference

#include "S6_DeleteWithAppContent.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.cpp File Reference

  • ContentIndexer
  • cpp
Functions

S7_RetrieveWithAppContent.xaml.cpp File Reference

#include "pch.h"
#include "S7_RetrieveWithAppContent.xaml.h"
#include "MainPage.xaml.h"
#include "Helpers.h"

Go to the source code of this file.

Functions

void RetrieveAppContentHelper (std::function< Windows::Storage::Search::StorageFileQueryResult^(Windows::Storage::StorageFolder^)> getQueryFunction)

Function Documentation

void RetrieveAppContentHelper ( std::function< Windows::Storage::Search::StorageFileQueryResult^(Windows::Storage::StorageFolder^)> getQueryFunction )

Definition at line 43 of file S7_RetrieveWithAppContent.xaml.cpp.

{
    create_task(Windows::Storage::ApplicationData::Current->LocalFolder->CreateFolderAsync(L"Indexed", Windows::Storage::CreationCollisionOption::OpenIfExists)).then(
    [getQueryFunction](Windows::Storage::StorageFolder^ indexedFolder)
    {
        auto query = getQueryFunction(indexedFolder);
        return query->GetFilesAsync();
    }).then([](IVectorView<Windows::Storage::StorageFile^>^ files)
    {
        auto propertyKeys = ref new Vector<String^>();
        propertyKeys->Append(Windows::Storage::SystemProperties::ItemNameDisplay);
        propertyKeys->Append(Windows::Storage::SystemProperties::Keywords);
        propertyKeys->Append(Windows::Storage::SystemProperties::Comment);
        propertyKeys->Append(Windows::Storage::SystemProperties::Title);
        std::vector<task<IMap<String^, Object^>^>> retrieveTasks;
        for (const auto& file : files)
        {
            retrieveTasks.push_back(create_task(file->Properties->RetrievePropertiesAsync(propertyKeys)));
        }
        return when_all(retrieveTasks.begin(), retrieveTasks.end());
    }).then([](std::vector<IMap<String^, Object^>^> retrievedItems)
    {
        String^ outputString;
        for (const auto& item : retrievedItems)
        {
            outputString += L"Name: " + StringifyProperty(item->Lookup(Windows::Storage::SystemProperties::ItemNameDisplay)) + L"\n";
            outputString += L"Keywords: " + StringifyProperty(item->Lookup(Windows::Storage::SystemProperties::Keywords)) + L"\n";
            outputString += L"Comment: " + StringifyProperty(item->Lookup(Windows::Storage::SystemProperties::Comment)) + L"\n";
            outputString += L"Title: " + StringifyProperty(item->Lookup(Windows::Storage::SystemProperties::Title)) + L"\n\n";
        }
        MainPage::Current->NotifyUser(outputString, NotifyType::StatusMessage);
    });
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

S7_RetrieveWithAppContent.xaml.h File Reference

#include "S7_RetrieveWithAppContent.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/SampleConfiguration.cpp File Reference

  • ContentIndexer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/SampleConfiguration.h File Reference

  • ContentIndexer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/Helpers.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S1_AddWithAPI.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S1_AddWithAPI.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S1_AddWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S2_UpdateAndDeleteWithAPI.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S2_UpdateAndDeleteWithAPI.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S2_UpdateAndDeleteWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S3_RetrieveWithAPI.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S3_RetrieveWithAPI.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S3_RetrieveWithAPI
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S4_CheckIndexRevision.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S4_CheckIndexRevision.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S4_CheckIndexRevision
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S5_AddWithAppContent.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S5_AddWithAppContent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S5_AddWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S6_DeleteWithAppContent.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S6_DeleteWithAppContent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S6_DeleteWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S7_RetrieveWithAppContent.xaml.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

S7_RetrieveWithAppContent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S7_RetrieveWithAppContent
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/SampleConfiguration.cs File Reference

  • ContentIndexer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/pch.cpp File Reference

  • ContextMenu
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/pch.h File Reference

  • ContextMenu
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/SampleConfiguration.cpp File Reference

  • ContextMenu
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/SampleConfiguration.h File Reference

  • ContextMenu
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario1.xaml.cpp File Reference

  • ContextMenu
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario1.xaml.h File Reference

  • ContextMenu
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario2.xaml.cpp File Reference

  • ContextMenu
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario2.xaml.h File Reference

  • ContextMenu
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cs/SampleConfiguration.cs File Reference

  • ContextMenu
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cs/Scenario1.xaml.cs File Reference

  • ContextMenu
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cs/Scenario2.xaml.cs File Reference

  • ContextMenu
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared
Defines

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <xmllite.h>
#include <shcore.h>
#include <wrl.h>
#include <iostream>
#include <sstream>
#include <locale>
#include <iomanip>

Go to the source code of this file.

Defines

#define ChkHr(stmt) do { hr = stmt; if (FAILED(hr)) return hr; } while(0)

Define Documentation

#define ChkHr ( stmt ) do { hr = stmt; if (FAILED(hr)) return hr; } while(0)

Definition at line 27 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/Trip.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

Trip.cpp File Reference

#include "pch.h"
#include "Trip.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/Trip.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared
Classes | Namespaces

Trip.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | AdventureWorks_Shared
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

TripStore.cpp File Reference

#include "pch.h"
#include "TripStore.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared
Classes | Namespaces

TripStore.h File Reference

#include "Trip.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | AdventureWorks_Shared
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

App.xaml.cpp File Reference

#include "pch.h"
#include "View\TripListView.xaml.h"
#include "View\TripDetails.xaml.h"
#include "ViewModel\TripVoiceCommand.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"
#include "ViewModel\ViewModelLocator.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/pch.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/pch.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <iostream>
#include <sstream>
#include <locale>
#include <iomanip>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/BoolToVisibilityConverter.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

BoolToVisibilityConverter.cpp File Reference

#include "pch.h"
#include "BoolToVisibilityConverter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/BoolToVisibilityConverter.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common
Classes | Namespaces

BoolToVisibilityConverter.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

CalendarConverter.cpp File Reference

#include "pch.h"
#include "CalendarConverter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common
Classes | Namespaces

CalendarConverter.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/RelayCommand.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

RelayCommand.cpp File Reference

#include "pch.h"
#include "RelayCommand.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/RelayCommand.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common
Classes | Namespaces

RelayCommand.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripDetails.xaml.cpp File Reference

#include "pch.h"
#include "TripDetails.xaml.h"
#include "View\TripListView.xaml.h"
#include "ViewModel\TripVoiceCommand.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View
Classes | Namespaces

TripDetails.xaml.h File Reference

#include "View\TripDetails.g.h"
#include "ViewModel\TripViewModel.h"
#include "Common\CalendarConverter.h"
#include "Common\BoolToVisibilityConverter.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripListView.xaml.cpp File Reference

#include "pch.h"
#include "TripListView.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View
Classes | Namespaces

TripListView.xaml.h File Reference

#include "View\TripListview.g.h"
#include "ViewModel\TripListViewModel.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripListViewModel.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

TripListViewModel.cpp File Reference

#include "pch.h"
#include "ViewModel\TripListViewModel.h"
#include "Common\RelayCommand.h"
#include "View\TripDetails.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripListViewModel.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripListViewModel.h File Reference

#include "ViewModel\ViewModelBase.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

TripViewModel.cpp File Reference

#include "pch.h"
#include "TripViewModel.h"
#include "Common\RelayCommand.h"
#include "View\TripListView.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripViewModel.h File Reference

#include "ViewModel\ViewModelBase.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

TripVoiceCommand.cpp File Reference

#include "pch.h"
#include "TripVoiceCommand.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripVoiceCommand.h File Reference

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

ViewModelBase.cpp File Reference

#include "pch.h"
#include "ViewModelBase.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel
Classes | Namespaces

ViewModelBase.h File Reference

Go to the source code of this file.

Classes

class | ViewModelBase

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelLocator.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

ViewModelLocator.cpp File Reference

#include "pch.h"
#include "ViewModelLocator.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelLocator.h File Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel
Classes | Namespaces

ViewModelLocator.h File Reference

#include "App.g.h"
#include "ViewModel\ViewModelBase.h"
#include "ViewModel\TripListViewModel.h"
#include "ViewModel\TripViewModel.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

AdventureworksVoiceCommandService.cpp File Reference

#include "pch.h"
#include "AdventureWorksVoiceCommandService.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.h File Reference

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService
Classes | Namespaces

AdventureworksVoiceCommandService.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | VoiceCommandService
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/pch.cpp File Reference

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/pch.h File Reference

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Model/Trip.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Model
Classes | Namespaces

Trip.cs File Reference

Go to the source code of this file.

Classes

class | Trip
Trip model. More...

Namespaces

namespace | AdventureWorks::Model
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Model/TripStore.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Model
Classes | Namespaces

TripStore.cs File Reference

Go to the source code of this file.

Classes

class | TripStore
Persistance layer for Trips created with Adventure Works. More...

Namespaces

namespace | AdventureWorks::Model
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Properties/AssemblyInfo.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/App.xaml.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | AdventureWorks
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/DateTimeOffsetConverter.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

DateTimeOffsetConverter.cs File Reference

Go to the source code of this file.

Classes

class | DateTimeOffsetConverter
Convert a DateTime to a DateTimeOffset for use by a DatePicker, and back to allow for two-day data-binding. More...

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/INavigationService.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

INavigationService.cs File Reference

Go to the source code of this file.

Classes

interface | INavigationService
Navigation service interface, allows a test implementation to be substituted in its place. More...

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationHelper.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces | Functions

NavigationHelper.cs File Reference

Go to the source code of this file.

Classes

class | LoadStateEventArgs
Class used to hold the event data required when a page attempts to load state. More...
class | NavigationHelper
NavigationHelper aids in navigation between pages. More...
class | RootFrameNavigationHelper
RootFrameNavigationHelper registers for standard mouse and keyboard shortcuts used to go back and forward. More...
class | SaveStateEventArgs
Class used to hold the event data required when a page attempts to save state. More...

Namespaces

namespace | AdventureWorks::Common

Functions

delegate void | LoadStateEventHandler (object sender, LoadStateEventArgs e)
delegate void | SaveStateEventHandler (object sender, SaveStateEventArgs e)
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationService.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

NavigationService.cs File Reference

Go to the source code of this file.

Classes

class | NavigationService
Navigation system that decouples the View Model from knowledge of the View for navigation purposes. More...

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/RelayCommand.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

RelayCommand.cs File Reference

Go to the source code of this file.

Classes

class | RelayCommand
A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/SuspensionManager.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

SuspensionManager.cs File Reference

Go to the source code of this file.

Classes

class | SuspensionManager
SuspensionManager captures global session state to simplify process lifetime management for an application. More...
class | SuspensionManagerException

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/VisibilityConverter.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common
Classes | Namespaces

VisibilityConverter.cs File Reference

Go to the source code of this file.

Classes

class | VisibilityConverter
Convert a Boolean status to Visibility.Visible (true) or Visibility.Collapsed (false). More...

Namespaces

namespace | AdventureWorks::Common
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/View/TripDetails.xaml.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • View
Classes | Namespaces

TripDetails.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TripDetails
Code Behind for a list of trips, including a Save and Delete button. More...

Namespaces

namespace | AdventureWorks::View
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/View/TripListView.xaml.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • View
Classes | Namespaces

TripListView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TripListView
Code Behind for a list of trips, including an Add button. More...

Namespaces

namespace | AdventureWorks::View
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripListViewModel.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripListViewModel.cs File Reference

Go to the source code of this file.

Classes

class | TripListViewModel
View Model controlling the behavior of a List view of trips. More...

Namespaces

namespace | AdventureWorks::ViewModel
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripViewModel.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripViewModel.cs File Reference

Go to the source code of this file.

Classes

class | TripViewModel
View Model associated with TripDetails.xaml. More...

Namespaces

namespace | AdventureWorks::ViewModel
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripVoiceCommand.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel
Classes | Namespaces

TripVoiceCommand.cs File Reference

Go to the source code of this file.

Classes

struct | TripVoiceCommand
Simple struct to pass voice-command arguments to the appropriate view, in order to execute the action requested by the user. More...

Namespaces

namespace | AdventureWorks::ViewModel
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelBase.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel
Classes | Namespaces

ViewModelBase.cs File Reference

Go to the source code of this file.

Classes

class | ViewModelBase
Base class for all view models. More...

Namespaces

namespace | AdventureWorks::ViewModel
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ViewModelLocator.cs File Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel
Classes | Namespaces

ViewModelLocator.cs File Reference

Go to the source code of this file.

Classes

class | ViewModelLocator
ViewModelLocator ensures that viewmodels can be instantiated with a common reference to the TripStore. More...

Namespaces

namespace | AdventureWorks::ViewModel
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/VoiceCommandService/AdventureWorksVoiceCommandService.cs File Reference

  • CortanaVoiceCommand
  • cs
  • VoiceCommandService
Classes | Namespaces

AdventureWorksVoiceCommandService.cs File Reference

Go to the source code of this file.

Classes

class | AdventureWorksVoiceCommandService
The VoiceCommandService implements the entrypoint for all headless voice commands invoked via Cortana. More...

Namespaces

namespace | AdventureWorks::VoiceCommands
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/VoiceCommandService/Properties/AssemblyInfo.cs File Reference

  • CortanaVoiceCommand
  • cs
  • VoiceCommandService
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/pch.cpp File Reference

  • CredentialPicker
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/pch.h File Reference

  • CredentialPicker
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/SampleConfiguration.cpp File Reference

  • CredentialPicker
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/SampleConfiguration.h File Reference

  • CredentialPicker
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario1_Message.xaml.cpp File Reference

  • CredentialPicker
  • cpp

Scenario1_Message.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Message.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario1_Message.xaml.h File Reference

  • CredentialPicker
  • cpp
Classes | Namespaces

Scenario1_Message.xaml.h File Reference

#include "Scenario1_Message.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario2_MessageCaption.xaml.cpp File Reference

  • CredentialPicker
  • cpp

Scenario2_MessageCaption.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_MessageCaption.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario2_MessageCaption.xaml.h File Reference

  • CredentialPicker
  • cpp
Classes | Namespaces

Scenario2_MessageCaption.xaml.h File Reference

#include "Scenario2_MessageCaption.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.cpp File Reference

  • CredentialPicker
  • cpp

Scenario3_CredentialPickerOptions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CredentialPickerOptions.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.h File Reference

  • CredentialPicker
  • cpp
Classes | Namespaces

Scenario3_CredentialPickerOptions.xaml.h File Reference

#include "Scenario3_CredentialPickerOptions.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/SampleConfiguration.cs File Reference

  • CredentialPicker
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario1_Message.xaml.cs File Reference

  • CredentialPicker
  • cs
Classes | Namespaces

Scenario1_Message.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Message

Namespaces

namespace | CredentialPicker
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario2_MessageCaption.xaml.cs File Reference

  • CredentialPicker
  • cs
Classes | Namespaces

Scenario2_MessageCaption.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_MessageCaption

Namespaces

namespace | CredentialPicker
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario3_CredentialPickerOptions.xaml.cs File Reference

  • CredentialPicker
  • cs
Classes | Namespaces

Scenario3_CredentialPickerOptions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_CredentialPickerOptions

Namespaces

namespace | CredentialPicker
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/DeviceList.cpp File Reference

  • CustomCapability
  • cpp

DeviceList.cpp File Reference

#include "pch.h"
#include "DeviceList.h"
#include "Fx2Driver.h"
#include "MainPage.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/DeviceList.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces | Typedefs

DeviceList.h File Reference

Go to the source code of this file.

Classes

class | DeviceList
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Typedefs

typedef
Windows::Foundation::EventHandler
< Windows::Devices::Custom::CustomDevice^> 		DeviceClosingHandler
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Fx2Driver.cpp File Reference

  • CustomCapability
  • cpp
Functions

Fx2Driver.cpp File Reference

#include "pch.h"
#include "Fx2Driver.h"
#include <initguid.h>

Go to the source code of this file.

Functions

DEFINE_GUID (GUID_DEVINTERFACE_OSRUSBFX2, 0x573e8c73, 0xcb4, 0x4471, 0xa1, 0xbf, 0xfa, 0xb2, 0x6c, 0x31, 0xd3, 0x84)

Function Documentation

DEFINE_GUID | ( | GUID_DEVINTERFACE_OSRUSBFX2 | ,
 |  | 0x573e8c73 | ,
 |  | 0xcb4 | ,
 |  | 0x4471 | ,
 |  | 0xa1 | ,
 |  | 0xbf | ,
 |  | 0xfa | ,
 |  | 0xb2 | ,
 |  | 0x6c | ,
 |  | 0x31 | ,
 |  | 0xd3 | ,
 |  | 0x84 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Fx2Driver.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Fx2Driver.h File Reference

Go to the source code of this file.

Classes

class | Fx2Driver

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/pch.cpp File Reference

  • CustomCapability
  • cpp
Functions

pch.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <robuffer.h>
#include <wrl\client.h>

Go to the source code of this file.

Functions

byte * | GetArrayFromBuffer (Windows::Storage::Streams::IBuffer^buffer)
void | NotifyStatusMessage (Platform::String^message, SDKTemplate::NotifyType messageType)

Function Documentation

byte* GetArrayFromBuffer ( Windows::Storage::Streams::IBuffer^ buffer )

Definition at line 26 of file pch.cpp.

{
    ComPtr<IInspectable> base = reinterpret_cast<IInspectable*>(buffer);
    ComPtr<IBufferByteAccess> access;

    auto hr = base.As(&access);

    if (FAILED(hr))
    {
        throw Platform::Exception::CreateException(hr);
    }

    byte* data;

    hr = access->Buffer(&data);

    if (FAILED(hr))
    {
        throw Platform::Exception::CreateException(hr);
    }

    // The returned buffer is valid as long as the IBuffer passed in
    // remains valid.
    return data;
}

void NotifyStatusMessage | ( | Platform::String^ | message,
 |  | SDKTemplate::NotifyType | messageType
 | ) |  |

Definition at line 52 of file pch.cpp.

{
    SDKTemplate::MainPage::Current->NotifyUser(message, messageType);
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/pch.h File Reference

  • CustomCapability
  • cpp
Functions

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Functions

byte * | GetArrayFromBuffer (Windows::Storage::Streams::IBuffer^buffer)
void | NotifyStatusMessage (Platform::String^message, SDKTemplate::NotifyType messageType)

Function Documentation

byte* GetArrayFromBuffer ( Windows::Storage::Streams::IBuffer^ buffer )

Definition at line 26 of file pch.cpp.

{
    ComPtr<IInspectable> base = reinterpret_cast<IInspectable*>(buffer);
    ComPtr<IBufferByteAccess> access;

    auto hr = base.As(&access);

    if (FAILED(hr))
    {
        throw Platform::Exception::CreateException(hr);
    }

    byte* data;

    hr = access->Buffer(&data);

    if (FAILED(hr))
    {
        throw Platform::Exception::CreateException(hr);
    }

    // The returned buffer is valid as long as the IBuffer passed in
    // remains valid.
    return data;
}

void NotifyStatusMessage | ( | Platform::String^ | message,
 |  | SDKTemplate::NotifyType | messageType
 | ) |  |

Definition at line 52 of file pch.cpp.

{
    SDKTemplate::MainPage::Current->NotifyUser(message, messageType);
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/SampleConfiguration.cpp File Reference

  • CustomCapability
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/SampleConfiguration.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario1_MeteringData.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario1_MeteringData.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_MeteringData.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario1_MeteringData.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario1_MeteringData.xaml.h File Reference

#include "Scenario1_MeteringData.g.h"
#include "ServiceViewModel.h"
#include "DeviceList.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario2_DeviceConnect.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario2_DeviceConnect.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "Scenario2_DeviceConnect.xaml.h"
#include "DeviceList.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario2_DeviceConnect.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario2_DeviceConnect.xaml.h File Reference

#include "Scenario2_DeviceConnect.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario3_DeviceIO.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario3_DeviceIO.xaml.cpp File Reference

#include "pch.h"
#include <robuffer.h>
#include "MainPage.xaml.h"
#include "Scenario3_DeviceIO.xaml.h"
#include "DeviceList.h"
#include "Fx2Driver.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario3_DeviceIO.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario3_DeviceIO.xaml.h File Reference

#include "Scenario3_DeviceIO.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario4_DeviceEvents.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario4_DeviceEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_DeviceEvents.xaml.h"
#include "MainPage.xaml.h"
#include "DeviceList.h"
#include "Fx2Driver.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario4_DeviceEvents.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario4_DeviceEvents.xaml.h File Reference

#include "Scenario4_DeviceEvents.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario5_DeviceReadWrite.xaml.cpp File Reference

#include "pch.h"
#include <sstream>
#include "MainPage.xaml.h"
#include "Scenario5_DeviceReadWrite.xaml.h"
#include "DeviceList.h"
#include "Fx2Driver.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario5_DeviceReadWrite.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario5_DeviceReadWrite.xaml.h File Reference

#include "Scenario5_DeviceReadWrite.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario6_CustomTrigger.xaml.cpp File Reference

  • CustomCapability
  • cpp
Defines

Scenario6_CustomTrigger.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_CustomTrigger.xaml.h"

Go to the source code of this file.

Defines

#define GUID_CUSTOMSYSTEMEVENTTRIGGERID_OSRUSBFX2 L"{C7BDD245-5CDA-4BBD-B68D-B5E36F7911A3}"

Define Documentation

#define GUID_CUSTOMSYSTEMEVENTTRIGGERID_OSRUSBFX2 L"{C7BDD245-5CDA-4BBD-B68D-B5E36F7911A3}"

Definition at line 25 of file Scenario6_CustomTrigger.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario6_CustomTrigger.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario6_CustomTrigger.xaml.h File Reference

#include "Scenario6_CustomTrigger.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.cpp File Reference

  • CustomCapability
  • cpp

Scenario7_FirmwareAccess.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_FirmwareAccess.xaml.h"
#include <string>
#include "firmwareaccess.h"
#include <intsafe.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

Scenario7_FirmwareAccess.xaml.h File Reference

#include "Scenario7_FirmwareAccess.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/ServiceViewModel.cpp File Reference

  • CustomCapability
  • cpp

ServiceViewModel.cpp File Reference

#include "pch.h"
#include "ServiceViewModel.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/ServiceViewModel.h File Reference

  • CustomCapability
  • cpp
Classes | Namespaces

ServiceViewModel.h File Reference

#include "RpcClientApi.h"
#include <memory>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/DeviceList.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

DeviceList.cs File Reference

Go to the source code of this file.

Classes

class | DeviceList
class | DeviceListEntry

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Fx2Driver.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Fx2Driver.cs File Reference

Go to the source code of this file.

Classes

class | Fx2Driver

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/SampleConfiguration.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario1_MeteringData.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario1_MeteringData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MeteringData
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario2_DeviceConnect.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario2_DeviceConnect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeviceConnect
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario3_DeviceIO.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario3_DeviceIO.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeviceIO

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario4_DeviceEvents.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario4_DeviceEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeviceEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario5_DeviceReadWrite.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario5_DeviceReadWrite.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeviceReadWrite

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario6_CustomTrigger.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario6_CustomTrigger.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomTrigger

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario7_FirmwareAccess.xaml.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

Scenario7_FirmwareAccess.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FirmwareAccess

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/ServiceViewModel.cs File Reference

  • CustomCapability
  • cs
Classes | Namespaces

ServiceViewModel.cs File Reference

Go to the source code of this file.

Classes

struct | LARGE_INTEGER
class | ServiceViewModel

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/FirmwareAccess.h File Reference

  • CustomCapability
  • Service
  • Client
Defines | Functions | Variables

FirmwareAccess.h File Reference

Go to the source code of this file.

Defines

#define | MANUFACTURER_NAME_LENGTH_MAX 1024

Functions

__declspec (dllexport) DWORD GetManufacturerNameFromSmbios(_Out_ wchar_t *ManufacturerName

Variables

_In_ DWORD | Size

Define Documentation

#define MANUFACTURER_NAME_LENGTH_MAX 1024

Definition at line 5 of file FirmwareAccess.h.

Function Documentation

__declspec ( dllexport )

Variable Documentation

_In_ DWORD Size

Definition at line 12 of file FirmwareAccess.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/pch.cpp File Reference

  • CustomCapability
  • Service
  • Client

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/pch.h File Reference

  • CustomCapability
  • Service
  • Client

pch.h File Reference

#include "targetver.h"
#include <windows.h>
#include "targetver.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/RpcClient.cpp File Reference

  • CustomCapability
  • Service
  • Client
Defines | Functions

RpcClient.cpp File Reference

#include "pch.h"
#include "RpcClient.h"

Go to the source code of this file.

Defines

#define | WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

Functions

void | MeteringDataEvent (__int64 data, __int64 context)
*MIDL allocate and free
********************************************************void
__RPC_FAR *__RPC_USER 		midl_user_allocate (size_t len)
void __RPC_USER | midl_user_free (void __RPC_FAR *ptr)

Define Documentation

#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

Definition at line 15 of file RpcClient.cpp.

Function Documentation

void MeteringDataEvent | ( | __int64 | data,
 |  | __int64 | context
 | ) |  |

Definition at line 161 of file RpcClient.cpp.

{
    RpcClient* client = static_cast<RpcClient*>((PVOID)context);
    client->MeteringData = data;
    ++client->CallbackCount;
}

* MIDL allocate and free* ****************************************************** * void __RPC_FAR* __RPC_USER midl_user_allocate ( size_t len )

Definition at line 172 of file RpcClient.cpp.

{
    return(malloc(len));
}

void __RPC_USER midl_user_free ( void __RPC_FAR * ptr )

Definition at line 177 of file RpcClient.cpp.

{
    free(ptr);
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/RpcClient.h File Reference

  • CustomCapability
  • Service
  • Client
Classes | Defines

RpcClient.h File Reference

#include "RpcInterface_h.h"

Go to the source code of this file.

Classes

class | sealed
Client side RPC implementation. More...

Defines

#define | RPC_STATIC_ENDPOINT L"HsaSampleRpcEndpoint"

Define Documentation

#define RPC_STATIC_ENDPOINT L"HsaSampleRpcEndpoint"

Definition at line 13 of file RpcClient.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/RpcClientApi.cpp File Reference

  • CustomCapability
  • Service
  • Client
Classes | Defines | Typedefs | Functions

RpcClientApi.cpp File Reference

#include "pch.h"
#include "RpcClient.h"
#include "RpcClientApi.h"

Go to the source code of this file.

Classes

struct | _RPC_CLIENT

Defines

#define | WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

Typedefs

typedef struct _RPC_CLIENT * | PRPC_CLIENT
typedef struct _RPC_CLIENT | RPC_CLIENT

Functions

__int64 | GetCallbackCount (RPC_CLIENT_HANDLE RpcClientHandle, __int64 *MeteringData)
__int64 | GetMeteringData (RPC_CLIENT_HANDLE RpcClientHandle, __int64 *MeteringData)
RpcClient * | RetriveRpcClientFromHandle (RPC_CLIENT_HANDLE RpcClientHandle)
__int64 | RpcClientClose (RPC_CLIENT_HANDLE RpcClientHandle)
__int64 | RpcClientInitialize (RPC_CLIENT_HANDLE *RpcClientHandle)
__int64 | SetSampleRate (RPC_CLIENT_HANDLE RpcClientHandle, int rate)
__int64 | StartMeteringAndWaitForStop (RPC_CLIENT_HANDLE RpcClientHandle, __int64 samplePeriod)
__int64 | StopMeteringData (RPC_CLIENT_HANDLE RpcClientHandle)

Define Documentation

#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

Definition at line 15 of file RpcClientApi.cpp.

Typedef Documentation

typedef struct _RPC_CLIENT * PRPC_CLIENT
typedef struct _RPC_CLIENT RPC_CLIENT

Function Documentation

__int64 GetCallbackCount | ( | RPC_CLIENT_HANDLE | RpcClientHandle,
 |  | __int64 * | MeteringData
 | ) |  |

Definition at line 145 of file RpcClientApi.cpp.

{
    RpcClient* client;
    if (RpcClientHandle == NULL || MeteringData == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }

    *MeteringData = client->CallbackCount;
    return ERROR_SUCCESS;
}

__int64 GetMeteringData | ( | RPC_CLIENT_HANDLE | RpcClientHandle,
 |  | __int64 * | MeteringData
 | ) |  |

Definition at line 113 of file RpcClientApi.cpp.

                                                                                {
    RpcClient* client;
    if (RpcClientHandle == NULL || MeteringData == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }
    *MeteringData = client->MeteringData;
    return ERROR_SUCCESS;
}

RpcClient * RetriveRpcClientFromHandle ( RPC_CLIENT_HANDLE RpcClientHandle )

Definition at line 161 of file RpcClientApi.cpp.

                                                                         {
    return ((PRPC_CLIENT)RpcClientHandle)->RpcClient;
}

__int64 RpcClientClose ( RPC_CLIENT_HANDLE RpcClientHandle )

Definition at line 128 of file RpcClientApi.cpp.

                                                          {
    RpcClient* client;
    if (RpcClientHandle == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }
    delete client;
    delete RpcClientHandle;

    return ERROR_SUCCESS;
}

__int64 RpcClientInitialize ( RPC_CLIENT_HANDLE * RpcClientHandle )

Definition at line 30 of file RpcClientApi.cpp.

                                                                {
    __int64 ret;
    PRPC_CLIENT rpcClientStruct = NULL;
    if (RpcClientHandle == NULL) {
        ret = ERROR_INVALID_PARAMETER;
        goto error;
    }

    rpcClientStruct = new RPC_CLIENT();
    if (rpcClientStruct == NULL) {
        ret = ERROR_NOT_ENOUGH_MEMORY;
        goto error;
    }
    rpcClientStruct->RpcClient = new RpcClient();
    if (rpcClientStruct->RpcClient == NULL) {
        ret = ERROR_NOT_ENOUGH_MEMORY;
        goto error;
    }

    ret = rpcClientStruct->RpcClient->Initialize();

error:
    if (ret != 0) {
        if (rpcClientStruct != NULL) {
            if (rpcClientStruct->RpcClient != NULL) {
                delete rpcClientStruct->RpcClient;
            }
            delete rpcClientStruct;
        }
    }
    else {
        *RpcClientHandle = rpcClientStruct;
    }

    return ret;
}

__int64 SetSampleRate | ( | RPC_CLIENT_HANDLE | RpcClientHandle,
 |  | int | rate
 | ) |  |

Definition at line 98 of file RpcClientApi.cpp.

                                                                   {
    RpcClient* client;
    if (RpcClientHandle == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }

    return client->SetSampleRate(rate);
}

__int64 StartMeteringAndWaitForStop | ( | RPC_CLIENT_HANDLE | RpcClientHandle,
 |  | __int64 | samplePeriod
 | ) |  |

Definition at line 68 of file RpcClientApi.cpp.

                                                                                {
    RpcClient* client;
    if (RpcClientHandle == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }

    return client->StartMeteringAndWaitForStop(samplePeriod);
}

__int64 StopMeteringData ( RPC_CLIENT_HANDLE RpcClientHandle )

Definition at line 83 of file RpcClientApi.cpp.

                                                            {
    RpcClient* client;
    if (RpcClientHandle == NULL) {
        return ERROR_INVALID_PARAMETER;
    }

    client = RetriveRpcClientFromHandle(RpcClientHandle);
    if (client == NULL) {
        return ERROR_INVALID_HANDLE;
    }

    return client->StopMetering();
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/RpcClientApi.h File Reference

  • CustomCapability
  • Service
  • Client
Typedefs | Functions | Variables

RpcClientApi.h File Reference

Go to the source code of this file.

Typedefs

typedef void * | RPC_CLIENT_HANDLE

Functions

__declspec (dllexport) __int64 RpcClientInitialize(RPC_CLIENT_HANDLE *RpcClientHandle)

Variables

__int64 * | MeteringData
int | rate
__int64 | samplePeriod

Typedef Documentation

typedef void* RPC_CLIENT_HANDLE

Definition at line 19 of file RpcClientApi.h.

Function Documentation

__declspec ( dllexport )

Variable Documentation

__int64 * MeteringData

Definition at line 39 of file RpcClientApi.h.

int rate

Definition at line 35 of file RpcClientApi.h.

__int64 samplePeriod

Definition at line 27 of file RpcClientApi.h.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/smbios.cpp File Reference

  • CustomCapability
  • Service
  • Client
Classes | Functions

smbios.cpp File Reference

#include "pch.h"
#include <intsafe.h>
#include <string>
#include "FirmwareAccess.h"

Go to the source code of this file.

Classes

struct | RawSMBIOSData
struct | RawSMBIOSSystemInfo
struct | RawSMBIOSTable

Functions

DWORD | FindSmBiosTable (_In_ const RawSMBIOSData *SMBIOSData, _In_ BYTE Type, _Out_ RawSMBIOSTable **SMBIOSTable)
DWORD | GetManufacturerNameFromSmbios (_Out_ wchar_t *ManufacturerName, _In_ DWORD Size)
DWORD | GetSmBiosString (_In_ const RawSMBIOSTable *SmBiosTable, _In_ BYTE StringIndex, _Out_ PWSTR *ResultString)

Function Documentation

DWORD FindSmBiosTable | ( | _In_ const RawSMBIOSData * | SMBIOSData,
 |  | _In_ BYTE | Type,
 |  | _Out_ RawSMBIOSTable ** | SMBIOSTable
 | ) |  |

Definition at line 49 of file smbios.cpp.

{
    DWORD error = S_OK;
    ULONG i = 0;
    RawSMBIOSTable* smbiosTable = NULL;
    bool properTermination = false;

    *SMBIOSTable = NULL;

    // Find SMBIOS Table
    do
    {
        properTermination = false;

        // Check that the table header fits in the buffer.
        if (i + sizeof(RawSMBIOSTable) < SMBIOSData->Length)
        {

            if (SMBIOSData->SMBIOSTableData[i] == Type)
            {
                // Found table
                smbiosTable = (RawSMBIOSTable*)&SMBIOSData->SMBIOSTableData[i];
            }

            // Set i to the end of the formated section.
            i += SMBIOSData->SMBIOSTableData[i + 1];

            // Look for the end of the struct that must be terminated by \0\0
            while (i + 1 < SMBIOSData->Length)
            {
                if (0 == SMBIOSData->SMBIOSTableData[i] &&
                    0 == SMBIOSData->SMBIOSTableData[i + 1])
                {
                    properTermination = true;
                    i += 2;
                    break;
                }

                ++i;
            }
        }
    }
    while (properTermination && !smbiosTable);

    if (properTermination) {
        if (!smbiosTable) {
            // The table was not found.
            error = ERROR_FILE_NOT_FOUND;
        }
    }
    else
    {
        // A table was not double null terminated within the buffer.
        error = ERROR_INVALID_DATA;
    }

    if (ERROR_SUCCESS == error) {
        *SMBIOSTable = smbiosTable;
    }

    return error;
}

DWORD GetManufacturerNameFromSmbios | ( | _Out_ wchar_t * | ManufacturerName,
 |  | _In_ DWORD | Size
 | ) |  |

Definition at line 224 of file smbios.cpp.

{
    DWORD error = ERROR_SUCCESS;
    DWORD smBiosDataSize = 0;
    RawSMBIOSData* smBiosData = NULL;
    DWORD bytesWritten = 0;
    RawSMBIOSSystemInfo* systemInfo = NULL;
    PWSTR manufacturerName = NULL;

    if (ManufacturerName == NULL)
    {
        return E_INVALIDARG;
    }

    //
    // Query size of SMBIOS data.
    //
    smBiosDataSize = GetSystemFirmwareTable('RSMB', 0, NULL, 0);
    if (smBiosDataSize <= 0)
    {
        error = GetLastError();
        goto exit;
    }

    //
    // Allocate memory for the smbios table
    //
    smBiosData = (RawSMBIOSData*) HeapAlloc(GetProcessHeap(), 0, smBiosDataSize);
    if (smBiosData == NULL)
    {
        error = ERROR_OUTOFMEMORY;
        goto exit;
    }

    bytesWritten = GetSystemFirmwareTable('RSMB', 0, smBiosData, smBiosDataSize);
    if (bytesWritten != smBiosDataSize)
    {
        error = ERROR_INVALID_DATA;
        goto exit;
    }

    error = FindSmBiosTable(smBiosData, 1, (RawSMBIOSTable**)&systemInfo);
    if (error != ERROR_SUCCESS)
    {
        goto exit;
    }

    error = GetSmBiosString(systemInfo, systemInfo->Manufacturer, &manufacturerName);
    if (error != ERROR_SUCCESS)
    {
        goto exit;
    }

    if (manufacturerName != NULL)
    {
        if (Size <  (DWORD) wcslen(manufacturerName))
        {
            error = ERROR_BUFFER_OVERFLOW;
            goto exit;
        }

        wcscpy_s(ManufacturerName, Size, manufacturerName);
        HeapFree(GetProcessHeap(), 0, manufacturerName);
    }
    else
    {
        error = E_UNEXPECTED;
    }

exit:
    if (smBiosData)
    {
        HeapFree(GetProcessHeap(), 0, smBiosData);
    }

    return error;
}

DWORD GetSmBiosString | ( | _In_ const RawSMBIOSTable * | SmBiosTable,
 |  | _In_ BYTE | StringIndex,
 |  | _Out_ PWSTR * | ResultString
 | ) |  |

Definition at line 117 of file smbios.cpp.

{
    DWORD error = ERROR_SUCCESS;
    PSTR currentString = NULL;
    BYTE CurrentStringIndex = 1;
    ULONG stringLen = 0;
    ULONG bufferLen = 0;
    HRESULT hr = S_OK;

    *ResultString = NULL;

    // 0 index implies the empty string
    if (StringIndex <= 0)
    {
        goto exit;
    }

    currentString = (PSTR)(((BYTE*)SmBiosTable) + SmBiosTable->Length);

    // find the string in the multisz string
    while (*currentString)
    {
        if (CurrentStringIndex == StringIndex)
        {
            break;
        }

        ++currentString;

        if (!*currentString)
        {
            ++currentString;
            ++CurrentStringIndex;
        }
    }

    if (!*currentString)
    {
        // String was not found in the string table.
        error = ERROR_INVALID_DATA;
        goto exit;
    }

    // Convert the string to UNICODE
    stringLen = MultiByteToWideChar(
                    CP_ACP,
                    MB_PRECOMPOSED | MB_ERR_INVALID_CHARS,
                    currentString,
                    -1,
                    NULL,
                    0);

    if (0 == stringLen)
    {
        error = GetLastError();
        goto exit;
    }

    // SMBIOS strings are limited to 64 characters
    if (stringLen > 65)
    {
        error = ERROR_INVALID_DATA;
        goto exit;
    }

    hr = ULongMult(stringLen, sizeof(WCHAR), &bufferLen);
    if (hr != S_OK)
    {
        error = ERROR_INVALID_DATA;
        goto exit;
    }

    *ResultString = (PWSTR) HeapAlloc(GetProcessHeap(), 0, bufferLen);
    if (!*ResultString)
    {
        error = ERROR_OUTOFMEMORY;
        goto exit;
    }

    stringLen = MultiByteToWideChar(
                   CP_ACP,
                   MB_PRECOMPOSED | MB_ERR_INVALID_CHARS,
                   currentString,
                   -1,
                   *ResultString,
                   stringLen);

    if (0 == stringLen)
    {
        error = GetLastError();
    }

exit:
    if (error != ERROR_SUCCESS)
    {
        HeapFree(GetProcessHeap(),  0, *ResultString);
        *ResultString = NULL;
    }

    return error;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/targetver.h File Reference

  • CustomCapability
  • Service
  • Client

targetver.h File Reference

#include <SDKDDKVer.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/uefi.cpp File Reference

  • CustomCapability
  • Service
  • Client
Defines | Functions

uefi.cpp File Reference

#include "pch.h"
#include "firmwareaccess.h"

Go to the source code of this file.

Defines

#define | EFI_GLOBAL_VAR_GUID L"{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}"

Functions

DWORD | GetSecureBootEnabledFromUefi (_Out_ bool *SecureBootEnabled)

Define Documentation

#define EFI_GLOBAL_VAR_GUID L"{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}"

Definition at line 15 of file uefi.cpp.

Function Documentation

DWORD GetSecureBootEnabledFromUefi ( _Out_ bool * SecureBootEnabled )

Definition at line 18 of file uefi.cpp.

{
    BYTE secureBootStatus;
    DWORD bytesReturned;
    DWORD error = ERROR_SUCCESS;
    bytesReturned = GetFirmwareEnvironmentVariable(L"SecureBoot",
                                                   EFI_GLOBAL_VAR_GUID,
                                                   &secureBootStatus,
                                                   sizeof(BYTE));
    if (bytesReturned <= 0)
    {
        error = GetLastError();
        goto exit;
    }

    if (bytesReturned != sizeof(BYTE))
    {
        error = ERROR_INVALID_DATA;
        goto exit;
    }

    *SecureBootEnabled = (secureBootStatus != 0);

exit:
    return error;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Interface/RpcInterface.Idl File Reference

  • CustomCapability
  • Service
  • Interface
Typedefs | Functions | Variables

RpcInterface.Idl File Reference

Go to the source code of this file.

Typedefs

typedef PCONTEXT_HANDLE_TYPE * | PPCONTEXT_HANDLE_TYPE

Functions

void | MeteringDataEvent ([in] __int64 data,[in, optional] __int64 context)
void | RemoteClose ([in, out] PPCONTEXT_HANDLE_TYPE pphContext)
void | RemoteOpen ([in] handle_t hBinding,[out] PPCONTEXT_HANDLE_TYPE pphContext)
void | SetSamplePeriod ([in] PCONTEXT_HANDLE_TYPE phContext,[in] __int64 samplePeriod)
void | StartMetering ([in] PCONTEXT_HANDLE_TYPE phContext,[in] __int64 samplePeriod,[in, optional] __int64 context)
void | StopMetering ([in] PCONTEXT_HANDLE_TYPE phContext)

Variables

import oaidl | idl
interface RpcInterface typedef
void * 		PCONTEXT_HANDLE_TYPE

Typedef Documentation

typedef PCONTEXT_HANDLE_TYPE* PPCONTEXT_HANDLE_TYPE

Definition at line 24 of file RpcInterface.Idl.

Function Documentation

void MeteringDataEvent | ( | [in] __int64 | data,
 |  | [in, optional] __int64 | context
 | ) |  |

Definition at line 161 of file RpcClient.cpp.

{
    RpcClient* client = static_cast<RpcClient*>((PVOID)context);
    client->MeteringData = data;
    ++client->CallbackCount;
}

void RemoteClose ( [in, out] PPCONTEXT_HANDLE_TYPE pphContext )
void RemoteOpen | ( | [in] handle_t | hBinding,
 |  | [out] PPCONTEXT_HANDLE_TYPE | pphContext
 | ) |  |
void SetSamplePeriod | ( | [in] PCONTEXT_HANDLE_TYPE | phContext,
 |  | [in] __int64 | samplePeriod
 | ) |  |
void StartMetering | ( | [in] PCONTEXT_HANDLE_TYPE | phContext,
 |  | [in] __int64 | samplePeriod,
 |  | [in, optional] __int64 | context
 | ) |  |
void StopMetering ( [in] PCONTEXT_HANDLE_TYPE phContext )

Variable Documentation

import unknwn idl

Definition at line 12 of file RpcInterface.Idl.

interface RpcInterface typedef void* PCONTEXT_HANDLE_TYPE

Definition at line 23 of file RpcInterface.Idl.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Osrusbfx2Task/ConnectedTask.cs File Reference

  • CustomCapability
  • Service
  • Osrusbfx2Task
Classes | Namespaces

ConnectedTask.cs File Reference

Go to the source code of this file.

Classes

class | ConnectedTask

Namespaces

namespace | Osrusbfx2Task
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/HsaService.cpp File Reference

  • CustomCapability
  • Service
  • Server
Defines | Functions

HsaService.cpp File Reference

#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include "ServiceInstaller.h"
#include "ServiceBase.h"
#include "SampleService.h"

Go to the source code of this file.

Defines

#define | SERVICE_ACCOUNT NULL
#define | SERVICE_DEPENDENCIES L""
#define | SERVICE_DISPLAY_NAME L"Hsa Sample Service"
#define | SERVICE_NAME L"HsaService"
#define | SERVICE_PASSWORD NULL
#define | SERVICE_START_TYPE SERVICE_DEMAND_START

Functions

int | wmain (_In_ int argc, _In_ wchar_t *argv[])

Define Documentation

#define SERVICE_ACCOUNT NULL

Definition at line 39 of file HsaService.cpp.

#define SERVICE_DEPENDENCIES L""

Definition at line 36 of file HsaService.cpp.

#define SERVICE_DISPLAY_NAME L"Hsa Sample Service"

Definition at line 30 of file HsaService.cpp.

#define SERVICE_NAME L"HsaService"

Definition at line 27 of file HsaService.cpp.

#define SERVICE_PASSWORD NULL

Definition at line 42 of file HsaService.cpp.

#define SERVICE_START_TYPE SERVICE_DEMAND_START

Definition at line 33 of file HsaService.cpp.

Function Documentation

int wmain | ( | _In_ int | argc,
 |  | _In_ wchar_t * | argv[]
 | ) |  |

Definition at line 60 of file HsaService.cpp.

{
    bool invalidArgs = false;

    if ((argc > 1) && ((*argv[1] == L'-' || (*argv[1] == L'/'))))
    {
        if (_wcsicmp(L"install", argv[1] + 1) == 0)
        {
            // Install the service when the command is
            // "-install" or "/install".
            InstallService(
                SERVICE_NAME,               // Name of service
                SERVICE_DISPLAY_NAME,       // Name to display
                SERVICE_START_TYPE,         // Service start type
                SERVICE_DEPENDENCIES,       // Dependencies
                SERVICE_ACCOUNT,            // Service running account
                SERVICE_PASSWORD            // Password of the account
            );
        }
        else if (_wcsicmp(L"remove", argv[1] + 1) == 0)
        {
            // Uninstall the service when the command is
            // "-remove" or "/remove".
            UninstallService(SERVICE_NAME);
        }
        else if (_wcsicmp(L"console", argv[1] + 1) == 0)
        {
            // Uninstall the service when the command is
            // "-remove" or "/remove".
            CSampleService service(SERVICE_NAME);
            service.ConsoleRun();
        }
        else
        {
            invalidArgs = true;
        }
    }
    else
    {
        invalidArgs = true;
        CSampleService service(SERVICE_NAME);
        if (!CServiceBase::Run(service))
        {
            wprintf(L"Service failed to run w/err 0x%08lx\n", GetLastError());
        }
    }

    if (invalidArgs)
    {
        wprintf(L"Parameters:\n");
        wprintf(L" -install  to install the service.\n");
        wprintf(L" -remove   to remove the service.\n");
        wprintf(L" -console  to run in console mode.\n");
    }

    return 0;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/Metering.cpp File Reference

  • CustomCapability
  • Service
  • Server
Functions

Metering.cpp File Reference

#include "stdafx.h"
#include "Metering.h"
#include <assert.h>
#include "RpcInterface_h.h"

Go to the source code of this file.

Functions

void CALLBACK MeteringWorkerTpCallback (_In_ PTP_CALLBACK_INSTANCE, _In_ PVOID pContext, _In_ PTP_TIMER)

Function Documentation

void CALLBACK MeteringWorkerTpCallback | ( | _In_ | PTP_CALLBACK_INSTANCE,
 |  | _In_ PVOID | pContext,
 |  | _In_ | PTP_TIMER
 | ) |  |

Definition at line 22 of file Metering.cpp.

{
    Metering *metering = static_cast<Metering *>(pContext);

    if (metering != nullptr)
    {
        // Run the metering worker for this instance of metering
        metering->MeteringWorker();
    }
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/Metering.h File Reference

  • CustomCapability
  • Service
  • Server
Classes | Namespaces

Metering.h File Reference

#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <thread>
#include <mutex>

Go to the source code of this file.

Classes

class | Metering

Namespaces

namespace | RpcServer
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/RpcServer.cpp File Reference

  • CustomCapability
  • Service
  • Server
Defines | Functions | Variables

RpcServer.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "RpcInterface_h.h"
#include <windows.h>
#include <sddl.h>
#include <securitybaseapi.h>
#include <AclAPI.h>
#include "RpcServer.h"

Go to the source code of this file.

Defines

#define | DEFAULT_METERING_PERIOD 100

Functions

void | FreeSidArray (__inout_ecount(cSIDs) PSID *pSIDs, ULONG cSIDs)
void __RPC_FAR *__RPC_USER | midl_user_allocate (_In_ size_t len)
void __RPC_USER | midl_user_free (_In_ void __RPC_FAR *ptr)
void __RPC_USER | PCONTEXT_HANDLE_TYPE_rundown (_In_ PCONTEXT_HANDLE_TYPE phContext)
void | RemoteClose (_Inout_ PPCONTEXT_HANDLE_TYPE pphContext)
void | RemoteOpen (_In_ handle_t hBinding, _Out_ PPCONTEXT_HANDLE_TYPE pphContext)
void | RpcServerDisconnect ()
DWORD | RpcServerStart ()
void | SetSamplePeriod (_In_ PCONTEXT_HANDLE_TYPE phContext, _In_ __int64 period)
void | StartMetering (_In_ PCONTEXT_HANDLE_TYPE phContext, _In_ __int64 period, _In_ __int64 context)
void | StopMetering (_In_ PCONTEXT_HANDLE_TYPE phContext)

Variables

const WCHAR * | CustomCapabilityName = "microsoft.hsaTestCustomCapability_q536wpkpf5cy2"
bool | ShutdownRequested

Define Documentation

#define DEFAULT_METERING_PERIOD 100

Definition at line 26 of file RpcServer.cpp.

Function Documentation

void FreeSidArray | ( | __inout_ecount(cSIDs) PSID * | pSIDs,
 |  | ULONG | cSIDs
 | ) |  |

Definition at line 33 of file RpcServer.cpp.

{
    if (pSIDs != nullptr)
    {
        for (ULONG i = 0; i < cSIDs; i++)
        {
            LocalFree(pSIDs[i]);

            pSIDs[i] = nullptr;
        }

        LocalFree(pSIDs);

        pSIDs = nullptr;
        cSIDs = 0;
    }
}

void __RPC_FAR* __RPC_USER midl_user_allocate ( _In_ size_t len )

Definition at line 334 of file RpcServer.cpp.

{
    return(malloc(len));
}

void __RPC_USER midl_user_free ( _In_ void __RPC_FAR * ptr )

Definition at line 339 of file RpcServer.cpp.

{
    free(ptr);
}

void __RPC_USER PCONTEXT_HANDLE_TYPE_rundown ( _In_ PCONTEXT_HANDLE_TYPE phContext )

Definition at line 291 of file RpcServer.cpp.

{
    std::cout << "client died" << std::endl;
    StopMetering(phContext);
    RemoteClose(&phContext);
}

void RemoteClose ( _Inout_ PPCONTEXT_HANDLE_TYPE pphContext )

Definition at line 269 of file RpcServer.cpp.

{
    std::cout << "closing rpc endpoint" << std::endl;
    if (*pphContext == nullptr)
    {
        //Log error, client tried to close a NULL handle.
        return;
    }

    METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(*pphContext);
    delete meteringContext->metering;
    MIDL_user_free(meteringContext);

    // This tells the run-time, when it is marshalling the out
    // parameters, that the context handle has been closed normally.
    *pphContext = nullptr;
}

void RemoteOpen | ( | _In_ handle_t | hBinding,
 |  | _Out_ PPCONTEXT_HANDLE_TYPE | pphContext
 | ) |  |

Definition at line 256 of file RpcServer.cpp.

{
    std::cout << "opening rpc endpoint" << std::endl;
    *pphContext = static_cast<PCONTEXT_HANDLE_TYPE *>(midl_user_allocate(sizeof(METERING_CONTEXT)));
    METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(*pphContext);
    meteringContext->metering = new Metering(DEFAULT_METERING_PERIOD);
}

void RpcServerDisconnect ( )

Definition at line 238 of file RpcServer.cpp.

{
    DWORD hResult = S_OK;
    ShutdownRequested = true;
    hResult = RpcServerUnregisterIf(RpcInterface_v1_0_s_ifspec, nullptr, 0);

    RpcEpUnregister(RpcInterface_v1_0_s_ifspec, BindingVector, nullptr);

    if (BindingVector != nullptr)
    {
        RpcBindingVectorFree(&BindingVector);
        BindingVector = nullptr;
    }
}

DWORD RpcServerStart ( )

Definition at line 54 of file RpcServer.cpp.

{
    DWORD hResult = S_OK;
    WCHAR* protocolSequence = L"ncalrpc";
    unsigned int minCalls = 1;
    unsigned int dontWait = false;
    ShutdownRequested = false;

    SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
    PSID everyoneSid = nullptr;
    PSID* capabilitySids = nullptr;
    DWORD capabilitySidCount = 0;
    PSID* capabilityGroupSids = nullptr;
    DWORD capabilityGroupSidCount = 0;
    EXPLICIT_ACCESS ea[2] = {};
    PACL acl = nullptr;
    SECURITY_DESCRIPTOR rpcSecurityDescriptor = {};

    // When creating the RPC endpoint we want it to allow connections from any UWA that contains
    // the custom capability SID in its process token.  When a UWA declares the custom capability
    // in its app manifest, it will later contain the SID form of that custom capability in its
    // process token at runtime.  By default, RPC endpoints don't allow UWAs (AppContainer processes)
    // to connect to them, so we need to set the security on the endpoint to allow access to UWAs with the
    // custom capability.
    //
    // To do this we'll perform the following steps:
    // 1) Convert the custom capability name to a SID
    // 2) Create a security descriptor using that SID, as well as other needed SIDs.  This sample shows how to allow
    //    all 'non UWAs' access as well as UWAs containing the custom capability SID.
    // 3) Create the RPC endpoint using that security descriptor
    //
    // To create the security descriptor we're roughly following this MSDN sample:
    // https://msdn.microsoft.com/en-us/library/windows/desktop/aa446595(v=vs.85).aspx

    // Get the SID form of the custom capability.  In this case we only expect one SID and
    // we don't care about the capability group.
    if (!DeriveCapabilitySidsFromName(
        CustomCapabilityName,
        &capabilityGroupSids,
        &capabilityGroupSidCount,
        &capabilitySids,
        &capabilitySidCount))
    {
        hResult = GetLastError();
        goto end;
    }

    if (capabilitySidCount != 1)
    {
        // Unexpected sid count
        hResult = ERROR_INVALID_PARAMETER;
        goto end;
    }

    // Get the SID that represents 'everyone' (this doesn't include AppContainers)
    if (!AllocateAndInitializeSid(
        &SIDAuthWorld, 1,
        SECURITY_WORLD_RID,
        0, 0, 0, 0, 0, 0, 0,
        &everyoneSid))
    {
        hResult = GetLastError();
        goto end;
    }

    // Now create the Access Control List (ACL) for the Security descriptor

    // Everyone GENERIC_ALL access
    ea[0].grfAccessMode = SET_ACCESS;
    ea[0].grfAccessPermissions = GENERIC_ALL;
    ea[0].grfInheritance = NO_INHERITANCE;
    ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
    ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
    ea[0].Trustee.ptstrName = static_cast<LPWSTR>(everyoneSid);

    // Custom capability GENERIC_ALL access
    ea[1].grfAccessMode = SET_ACCESS;
    ea[1].grfAccessPermissions = GENERIC_ALL;
    ea[1].grfInheritance = NO_INHERITANCE;
    ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
    ea[1].Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
    ea[1].Trustee.ptstrName = static_cast<LPWSTR>(capabilitySids[0]); // Earlier we ensured there was exactly 1

    hResult = SetEntriesInAcl(ARRAYSIZE(ea), ea, nullptr, &acl);

    if (hResult != ERROR_SUCCESS)
    {
        goto end;
    }

    // Initialize an empty security descriptor
    if (!InitializeSecurityDescriptor(&rpcSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION))
    {
        hResult = GetLastError();
        goto end;
    }

    // Assign the ACL to the security descriptor
    if (!SetSecurityDescriptorDacl(&rpcSecurityDescriptor, TRUE, acl, FALSE))
    {
        hResult = GetLastError();
        goto end;
    }

    //
    // Bind to LRPC using dynamic endpoints
    //
    hResult = RpcServerUseProtseqEp(
        reinterpret_cast<RPC_WSTR>(protocolSequence),
        RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
        reinterpret_cast<RPC_WSTR>(RPC_STATIC_ENDPOINT),
        &rpcSecurityDescriptor);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerRegisterIf3(
        RpcInterface_v1_0_s_ifspec,
        nullptr,
        nullptr,
        RPC_IF_AUTOLISTEN | RPC_IF_ALLOW_LOCAL_ONLY,
        RPC_C_LISTEN_MAX_CALLS_DEFAULT,
        0,
        nullptr,
        &rpcSecurityDescriptor);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerInqBindings(&BindingVector);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcEpRegister(
        RpcInterface_v1_0_s_ifspec,
        BindingVector,
        nullptr,
        nullptr);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerListen(
        minCalls,
        RPC_C_LISTEN_MAX_CALLS_DEFAULT,
        dontWait);

    if (hResult == RPC_S_ALREADY_LISTENING)
    {
        hResult = RPC_S_OK;
    }

end:

    // Cleanup sids
    FreeSidArray(capabilityGroupSids, capabilityGroupSidCount);
    FreeSidArray(capabilitySids, capabilitySidCount);

    if (everyoneSid != nullptr)
    {
        FreeSid(everyoneSid);
    }

    // cleanup acl
    if (acl != nullptr)
    {
        LocalFree(acl);
    }

    return hResult;
}

void SetSamplePeriod | ( | _In_ PCONTEXT_HANDLE_TYPE | phContext,
 |  | _In_ __int64 | period
 | ) |  |

Definition at line 312 of file RpcServer.cpp.

{
    METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
    meteringContext->metering->SetSamplePeriod(period);
}

void StartMetering | ( | _In_ PCONTEXT_HANDLE_TYPE | phContext,
 |  | _In_ __int64 | period,
 |  | _In_ __int64 | context
 | ) |  |

Definition at line 301 of file RpcServer.cpp.

{
    std::cout << "start metering" << std::endl;
    METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
    meteringContext->metering->StartMetering(period, context);
    std::cout << "done metering" << std::endl;
}

void StopMetering ( _In_ PCONTEXT_HANDLE_TYPE phContext )

Definition at line 321 of file RpcServer.cpp.

{
    std::cout << "stop metering" << std::endl;
    METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
    meteringContext->metering->StopMetering();
}

Variable Documentation

const WCHAR* CustomCapabilityName = "microsoft.hsaTestCustomCapability_q536wpkpf5cy2"

Definition at line 28 of file RpcServer.cpp.

bool ShutdownRequested

Definition at line 30 of file RpcServer.cpp.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/RpcServer.h File Reference

  • CustomCapability
  • Service
  • Server
Classes | Defines | Functions

RpcServer.h File Reference

#include "metering.h"

Go to the source code of this file.

Classes

struct | METERING_CONTEXT

Defines

#define | RPC_STATIC_ENDPOINT L"HsaSampleRpcEndpoint"

Functions

void | RpcServerDisconnect ()
DWORD | RpcServerStart ()

Define Documentation

#define RPC_STATIC_ENDPOINT L"HsaSampleRpcEndpoint"

Definition at line 3 of file RpcServer.h.

Function Documentation

void RpcServerDisconnect ( )

Definition at line 238 of file RpcServer.cpp.

{
    DWORD hResult = S_OK;
    ShutdownRequested = true;
    hResult = RpcServerUnregisterIf(RpcInterface_v1_0_s_ifspec, nullptr, 0);

    RpcEpUnregister(RpcInterface_v1_0_s_ifspec, BindingVector, nullptr);

    if (BindingVector != nullptr)
    {
        RpcBindingVectorFree(&BindingVector);
        BindingVector = nullptr;
    }
}

DWORD RpcServerStart ( )

Definition at line 54 of file RpcServer.cpp.

{
    DWORD hResult = S_OK;
    WCHAR* protocolSequence = L"ncalrpc";
    unsigned int minCalls = 1;
    unsigned int dontWait = false;
    ShutdownRequested = false;

    SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
    PSID everyoneSid = nullptr;
    PSID* capabilitySids = nullptr;
    DWORD capabilitySidCount = 0;
    PSID* capabilityGroupSids = nullptr;
    DWORD capabilityGroupSidCount = 0;
    EXPLICIT_ACCESS ea[2] = {};
    PACL acl = nullptr;
    SECURITY_DESCRIPTOR rpcSecurityDescriptor = {};

    // When creating the RPC endpoint we want it to allow connections from any UWA that contains
    // the custom capability SID in its process token.  When a UWA declares the custom capability
    // in its app manifest, it will later contain the SID form of that custom capability in its
    // process token at runtime.  By default, RPC endpoints don't allow UWAs (AppContainer processes)
    // to connect to them, so we need to set the security on the endpoint to allow access to UWAs with the
    // custom capability.
    //
    // To do this we'll perform the following steps:
    // 1) Convert the custom capability name to a SID
    // 2) Create a security descriptor using that SID, as well as other needed SIDs.  This sample shows how to allow
    //    all 'non UWAs' access as well as UWAs containing the custom capability SID.
    // 3) Create the RPC endpoint using that security descriptor
    //
    // To create the security descriptor we're roughly following this MSDN sample:
    // https://msdn.microsoft.com/en-us/library/windows/desktop/aa446595(v=vs.85).aspx

    // Get the SID form of the custom capability.  In this case we only expect one SID and
    // we don't care about the capability group.
    if (!DeriveCapabilitySidsFromName(
        CustomCapabilityName,
        &capabilityGroupSids,
        &capabilityGroupSidCount,
        &capabilitySids,
        &capabilitySidCount))
    {
        hResult = GetLastError();
        goto end;
    }

    if (capabilitySidCount != 1)
    {
        // Unexpected sid count
        hResult = ERROR_INVALID_PARAMETER;
        goto end;
    }

    // Get the SID that represents 'everyone' (this doesn't include AppContainers)
    if (!AllocateAndInitializeSid(
        &SIDAuthWorld, 1,
        SECURITY_WORLD_RID,
        0, 0, 0, 0, 0, 0, 0,
        &everyoneSid))
    {
        hResult = GetLastError();
        goto end;
    }

    // Now create the Access Control List (ACL) for the Security descriptor

    // Everyone GENERIC_ALL access
    ea[0].grfAccessMode = SET_ACCESS;
    ea[0].grfAccessPermissions = GENERIC_ALL;
    ea[0].grfInheritance = NO_INHERITANCE;
    ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
    ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
    ea[0].Trustee.ptstrName = static_cast<LPWSTR>(everyoneSid);

    // Custom capability GENERIC_ALL access
    ea[1].grfAccessMode = SET_ACCESS;
    ea[1].grfAccessPermissions = GENERIC_ALL;
    ea[1].grfInheritance = NO_INHERITANCE;
    ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
    ea[1].Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
    ea[1].Trustee.ptstrName = static_cast<LPWSTR>(capabilitySids[0]); // Earlier we ensured there was exactly 1

    hResult = SetEntriesInAcl(ARRAYSIZE(ea), ea, nullptr, &acl);

    if (hResult != ERROR_SUCCESS)
    {
        goto end;
    }

    // Initialize an empty security descriptor
    if (!InitializeSecurityDescriptor(&rpcSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION))
    {
        hResult = GetLastError();
        goto end;
    }

    // Assign the ACL to the security descriptor
    if (!SetSecurityDescriptorDacl(&rpcSecurityDescriptor, TRUE, acl, FALSE))
    {
        hResult = GetLastError();
        goto end;
    }

    //
    // Bind to LRPC using dynamic endpoints
    //
    hResult = RpcServerUseProtseqEp(
        reinterpret_cast<RPC_WSTR>(protocolSequence),
        RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
        reinterpret_cast<RPC_WSTR>(RPC_STATIC_ENDPOINT),
        &rpcSecurityDescriptor);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerRegisterIf3(
        RpcInterface_v1_0_s_ifspec,
        nullptr,
        nullptr,
        RPC_IF_AUTOLISTEN | RPC_IF_ALLOW_LOCAL_ONLY,
        RPC_C_LISTEN_MAX_CALLS_DEFAULT,
        0,
        nullptr,
        &rpcSecurityDescriptor);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerInqBindings(&BindingVector);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcEpRegister(
        RpcInterface_v1_0_s_ifspec,
        BindingVector,
        nullptr,
        nullptr);

    if (hResult != S_OK)
    {
        goto end;
    }

    hResult = RpcServerListen(
        minCalls,
        RPC_C_LISTEN_MAX_CALLS_DEFAULT,
        dontWait);

    if (hResult == RPC_S_ALREADY_LISTENING)
    {
        hResult = RPC_S_OK;
    }

end:

    // Cleanup sids
    FreeSidArray(capabilityGroupSids, capabilityGroupSidCount);
    FreeSidArray(capabilitySids, capabilitySidCount);

    if (everyoneSid != nullptr)
    {
        FreeSid(everyoneSid);
    }

    // cleanup acl
    if (acl != nullptr)
    {
        LocalFree(acl);
    }

    return hResult;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/SampleService.cpp File Reference

  • CustomCapability
  • Service
  • Server
Functions

SampleService.cpp File Reference

#include "stdafx.h"
#include "SampleService.h"
#include "RpcServer.h"
#include <Evntrace.h>

Go to the source code of this file.

Functions

VOID CALLBACK ServiceWorkerThread (_In_ PTP_CALLBACK_INSTANCE, _In_ PVOID Parameter, _In_ PTP_WORK)

Function Documentation

VOID CALLBACK ServiceWorkerThread | ( | _In_ | PTP_CALLBACK_INSTANCE,
 |  | _In_ PVOID | Parameter,
 |  | _In_ | PTP_WORK
 | ) |  |

Definition at line 45 of file SampleService.cpp.

{
    //
    // Do something when the work callback is invoked.
    //
    {
        _int64 status = RpcServerStart();
        if (status)
        {
            CSampleService* sampleService = static_cast<CSampleService *>(Parameter);
            sampleService->Stop();
        }
    }

    return;
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/SampleService.h File Reference

  • CustomCapability
  • Service
  • Server
Classes

SampleService.h File Reference

#include "ServiceBase.h"

Go to the source code of this file.

Classes

class CSampleService
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceBase.cpp File Reference

  • CustomCapability
  • Service
  • Server
Functions

ServiceBase.cpp File Reference

#include "stdafx.h"
#include "ServiceBase.h"
#include <assert.h>
#include <strsafe.h>
#include <evntprov.h>
#include <Evntrace.h>

Go to the source code of this file.

Functions

EXTERN_C __declspec (selectany) const GUID HSA_SERVICE_PROVIDER_GUID

Function Documentation

EXTERN_C __declspec ( selectany ) const
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceBase.h File Reference

  • CustomCapability
  • Service
  • Server
Classes

ServiceBase.h File Reference

#include <windows.h>
#include <evntprov.h>

Go to the source code of this file.

Classes

class CServiceBase
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceInstaller.cpp File Reference

  • CustomCapability
  • Service
  • Server
Functions

ServiceInstaller.cpp File Reference

#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include "ServiceInstaller.h"

Go to the source code of this file.

Functions

void | InstallService (_In_ PWSTR pszServiceName, _In_ PWSTR pszDisplayName, _In_ DWORD dwStartType, _In_ PWSTR pszDependencies, _In_ PWSTR pszAccount, _In_ PWSTR pszPassword)
void | UninstallService (_In_ PWSTR pszServiceName)

Function Documentation

void InstallService | ( | _In_ PWSTR | pszServiceName,
 |  | _In_ PWSTR | pszDisplayName,
 |  | _In_ DWORD | dwStartType,
 |  | _In_ PWSTR | pszDependencies,
 |  | _In_ PWSTR | pszAccount,
 |  | _In_ PWSTR | pszPassword
 | ) |  |

Definition at line 42 of file ServiceInstaller.cpp.

{
    wchar_t szPath[MAX_PATH];
    SC_HANDLE schSCManager = nullptr;
    SC_HANDLE schService = nullptr;

    if (GetModuleFileName(nullptr, szPath, ARRAYSIZE(szPath)) == 0)
    {
        wprintf(L"GetModuleFileName failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Open the local default service control manager database
    schSCManager = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT |
                                 SC_MANAGER_CREATE_SERVICE);
    if (schSCManager == nullptr)
    {
        wprintf(L"OpenSCManager failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Install the service into SCM by calling CreateService
    schService = CreateService(
        schSCManager,                   // SCManager database
        pszServiceName,                 // Name of service
        pszDisplayName,                 // Name to display
        SERVICE_QUERY_STATUS | SERVICE_START,  // Desired access
        SERVICE_WIN32_OWN_PROCESS,      // Service type
        dwStartType,                    // Service start type
        SERVICE_ERROR_NORMAL,           // Error control type
        szPath,                         // Service's binary
        nullptr,                           // No load ordering group
        nullptr,                           // No tag identifier
        pszDependencies,                // Dependencies
        pszAccount,                     // Service running account
        pszPassword                     // Password of the account
    );

    if (schService == nullptr)
    {
        wprintf(L"CreateService failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    wprintf(L"%s is installed.\n", pszServiceName);

    if (StartService(schService, 0, nullptr) == 0)
    {
        wprintf(L"StartService failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    wprintf(L"%s is started.\n", pszServiceName);

Cleanup:
    // Centralized cleanup for all allocated resources.
    if (schSCManager)
    {
        CloseServiceHandle(schSCManager);
        schSCManager = nullptr;
    }
    if (schService)
    {
        CloseServiceHandle(schService);
        schService = nullptr;
    }
}

void UninstallService ( _In_ PWSTR pszServiceName )

Definition at line 128 of file ServiceInstaller.cpp.

{
    SC_HANDLE schSCManager = nullptr;
    SC_HANDLE schService = nullptr;
    SERVICE_STATUS ssSvcStatus = {};

    // Open the local default service control manager database
    schSCManager = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT);
    if (schSCManager == nullptr)
    {
        wprintf(L"OpenSCManager failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Open the service with delete, stop, and query status permissions
    schService = OpenService(schSCManager, pszServiceName, SERVICE_STOP |
                             SERVICE_QUERY_STATUS | DELETE);
    if (schService == nullptr)
    {
        wprintf(L"OpenService failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Try to stop the service
    if (ControlService(schService, SERVICE_CONTROL_STOP, &ssSvcStatus))
    {
        wprintf(L"Stopping %s.", pszServiceName);
        Sleep(1000);

        while (QueryServiceStatus(schService, &ssSvcStatus))
        {
            if (ssSvcStatus.dwCurrentState == SERVICE_STOP_PENDING)
            {
                wprintf(L".");
                Sleep(1000);
            }
            else break;
        }

        if (ssSvcStatus.dwCurrentState == SERVICE_STOPPED)
        {
            wprintf(L"\n%s is stopped.\n", pszServiceName);
        }
        else
        {
            wprintf(L"\n%s failed to stop.\n", pszServiceName);
        }
    }

    // Now remove the service by calling DeleteService.
    if (!DeleteService(schService))
    {
        wprintf(L"DeleteService failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    wprintf(L"%s is removed.\n", pszServiceName);

Cleanup:
    // Centralized cleanup for all allocated resources.
    if (schSCManager)
    {
        CloseServiceHandle(schSCManager);
        schSCManager = nullptr;
    }
    if (schService)
    {
        CloseServiceHandle(schService);
        schService = nullptr;
    }
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceInstaller.h File Reference

  • CustomCapability
  • Service
  • Server
Functions

ServiceInstaller.h File Reference

Go to the source code of this file.

Functions

void | InstallService (PWSTR pszServiceName, PWSTR pszDisplayName, DWORD dwStartType, PWSTR pszDependencies, PWSTR pszAccount, PWSTR pszPassword)
void | UninstallService (PWSTR pszServiceName)

Function Documentation

void InstallService | ( | PWSTR | pszServiceName,
 |  | PWSTR | pszDisplayName,
 |  | DWORD | dwStartType,
 |  | PWSTR | pszDependencies,
 |  | PWSTR | pszAccount,
 |  | PWSTR | pszPassword
 | ) |  |
void UninstallService ( PWSTR pszServiceName )
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/stdafx.cpp File Reference

  • CustomCapability
  • Service
  • Server

stdafx.cpp File Reference

#include "stdafx.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/stdafx.h File Reference

  • CustomCapability
  • Service
  • Server
Defines | Variables

stdafx.h File Reference

#include "targetver.h"
#include <stdio.h>
#include <tchar.h>

Go to the source code of this file.

Defines

#define | NOMINMAX

Variables

bool | ShutdownRequested

Define Documentation

#define NOMINMAX

Definition at line 13 of file stdafx.h.

Variable Documentation

bool ShutdownRequested

Definition at line 30 of file RpcServer.cpp.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/targetver.h File Reference

  • CustomCapability
  • Service
  • Server

targetver.h File Reference

#include <SDKDDKVer.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/cs/CustomEditControl.xaml.cs File Reference

  • CustomEditControl
  • cs
Classes | Namespaces

CustomEditControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomEditControl

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/cs/SampleConfiguration.cs File Reference

  • CustomEditControl
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/cs/Scenario1_Input.xaml.cs File Reference

  • CustomEditControl
  • cs
Classes | Namespaces

Scenario1_Input.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Input
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/DeviceListEntry.cpp File Reference

  • CustomHidDeviceAccess
  • cpp
Namespaces

DeviceListEntry.cpp File Reference

#include "pch.h"
#include "DeviceListEntry.h"

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/DeviceListEntry.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

DeviceListEntry.h File Reference

#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/EventHandlerForDevice.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

EventHandlerForDevice.cpp File Reference

#include "pch.h"
#include "EventHandlerForDevice.h"
#include "MainPage.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/EventHandlerForDevice.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

EventHandlerForDevice.h File Reference

#include "pch.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/pch.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/pch.h File Reference

  • CustomHidDeviceAccess
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/SampleConfiguration.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/SampleConfiguration.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces | Enumerations

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DeviceProperties
namespace | SDKTemplate::SuperMutt
namespace | SDKTemplate::SuperMutt::Device
namespace | SDKTemplate::SuperMutt::DeviceInputReportControlInformation
namespace | SDKTemplate::SuperMutt::LedPattern
namespace | SDKTemplate::SuperMutt::ReadWriteBufferControlInformation

Enumerations

enum | DeviceType { SuperMutt, All, None }
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

Scenario1_DeviceConnect.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DeviceConnect.xaml.h"
#include "EventHandlerForDevice.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

Scenario1_DeviceConnect.xaml.h File Reference

#include "DeviceListEntry.h"
#include "EventHandlerForDevice.h"
#include "Scenario1_DeviceConnect.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario2_FeatureReports.xaml.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

Scenario2_FeatureReports.xaml.cpp File Reference

#include "pch.h"
#include "Utilities.h"
#include "EventHandlerForDevice.h"
#include "Scenario2_FeatureReports.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario2_FeatureReports.xaml.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

Scenario2_FeatureReports.xaml.h File Reference

#include "Scenario2_FeatureReports.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario3_InputReportEvents.xaml.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

Scenario3_InputReportEvents.xaml.cpp File Reference

#include "pch.h"
#include "Utilities.h"
#include "Scenario3_InputReportEvents.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario3_InputReportEvents.xaml.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

Scenario3_InputReportEvents.xaml.h File Reference

#include "EventHandlerForDevice.h"
#include "Scenario3_InputReportEvents.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

Scenario4_InputOutputReports.xaml.cpp File Reference

#include "pch.h"
#include "Utilities.h"
#include "EventHandlerForDevice.h"
#include "Scenario4_InputOutputReports.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

Scenario4_InputOutputReports.xaml.h File Reference

#include "Scenario4_InputOutputReports.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Utilities.cpp File Reference

  • CustomHidDeviceAccess
  • cpp

Utilities.cpp File Reference

#include "pch.h"
#include "Utilities.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Utilities.h File Reference

  • CustomHidDeviceAccess
  • cpp
Classes | Namespaces

Utilities.h File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "EventHandlerForDevice.h"

Go to the source code of this file.

Classes

class | Utilities

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/DeviceListEntry.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

DeviceListEntry.cs File Reference

Go to the source code of this file.

Classes

class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/EventHandlerForDevice.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

EventHandlerForDevice.cs File Reference

Go to the source code of this file.

Classes

class | EventHandlerForDevice
The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event is raised (app suspension and resume) or when the device is disconnected. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/SampleConfiguration.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces | Enumerations

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | DeviceProperties
class | OnDeviceConnectedEventArgs
class | SuperMutt
This is the report descriptor for the support SuperMutt device. More...
class | SuperMutt::Device
class | SuperMutt::DeviceInputReportControlInformation
Only available for output reports. More...
class | SuperMutt::LedPattern
Only available for Feature Reports. More...
class | SuperMutt::ReadWriteBufferControlInformation
Only available for Input/Output Reports. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | CustomHidDeviceAccess
namespace | SDKTemplate

Enumerations

enum | DeviceType { SuperMutt, Any, None }
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario1_DeviceConnect.xaml.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

Scenario1_DeviceConnect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeviceConnect
Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario2_FeatureReports.xaml.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

Scenario2_FeatureReports.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FeatureReports
This page demonstrates how to use FeatureReports to communicate with the device. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario3_InputReportEvents.xaml.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

Scenario3_InputReportEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | InputReportEvents
This scenario demonstrates to how register and utilize input reports. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario4_InputOutputReports.xaml.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

Scenario4_InputOutputReports.xaml.cs File Reference

Go to the source code of this file.

Classes

class | InputOutputReports
This scenario demonstrates how to get input reports and how to send output reports. More...

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Utilities.cs File Reference

  • CustomHidDeviceAccess
  • cs
Classes | Namespaces

Utilities.cs File Reference

Go to the source code of this file.

Classes

class | Utilities

Namespaces

namespace | CustomHidDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/pch.cpp File Reference

  • CustomSensors
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/pch.h File Reference

  • CustomSensors
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <wrl\wrappers\corewrappers.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/SampleConfiguration.cpp File Reference

  • CustomSensors
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/SampleConfiguration.h File Reference

  • CustomSensors
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • CustomSensors
  • cpp
Defines | Variables

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Defines

#define | CO2_LEVEL_KEY "{74879888-a3cc-45c6-9ea9-058838256433} 1"

Variables

const GUID | GUID_CustomSensorDevice_VendorDefinedSubTypeID = { 0x4025a865, 0x638c, 0x43aa, 0xa6, 0x88, 0x98, 0x58, 0x9, 0x61, 0xee, 0xae }

Define Documentation

#define CO2_LEVEL_KEY "{74879888-a3cc-45c6-9ea9-058838256433} 1"

Definition at line 42 of file Scenario1_DataEvents.xaml.cpp.

Variable Documentation

const GUID GUID_CustomSensorDevice_VendorDefinedSubTypeID = { 0x4025a865, 0x638c, 0x43aa, 0xa6, 0x88, 0x98, 0x58, 0x9, 0x61, 0xee, 0xae }

Definition at line 35 of file Scenario1_DataEvents.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/Scenario1_DataEvents.xaml.h File Reference

  • CustomSensors
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/Scenario2_Polling.xaml.cpp File Reference

  • CustomSensors
  • cpp
Defines | Variables

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Defines

#define | CO2_LEVEL_KEY "{74879888-a3cc-45c6-9ea9-058838256433} 1"

Variables

const GUID | GUID_CustomSensorDevice_VendorDefinedTypeID = { 0x4025a865, 0x638c, 0x43aa, 0xa6, 0x88, 0x98, 0x58, 0x9, 0x61, 0xee, 0xae }

Define Documentation

#define CO2_LEVEL_KEY "{74879888-a3cc-45c6-9ea9-058838256433} 1"

Definition at line 43 of file Scenario2_Polling.xaml.cpp.

Variable Documentation

const GUID GUID_CustomSensorDevice_VendorDefinedTypeID = { 0x4025a865, 0x638c, 0x43aa, 0xa6, 0x88, 0x98, 0x58, 0x9, 0x61, 0xee, 0xae }

Definition at line 36 of file Scenario2_Polling.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/Scenario2_Polling.xaml.h File Reference

  • CustomSensors
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cs/SampleConfiguration.cs File Reference

  • CustomSensors
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cs/Scenario1_DataEvents.xaml.cs File Reference

  • CustomSensors
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | CustomSensors
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cs/Scenario2_Polling.xaml.cs File Reference

  • CustomSensors
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | CustomSensors
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Constants.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Constants.cs File Reference

Go to the source code of this file.

Classes

class | DeviceConfiguration
class | DeviceProperties

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/DeviceListEntry.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

DeviceListEntry.cs File Reference

Go to the source code of this file.

Classes

class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/EventHandlerForDevice.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

EventHandlerForDevice.cs File Reference

Go to the source code of this file.

Classes

class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/SampleConfiguration.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Scenario1_ConnectDisconnect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Scenario2_ConfigureDevice.xaml.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Scenario2_ConfigureDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ConfigureDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Scenario3_ReadWrite.xaml.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Scenario3_ReadWrite.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ReadWrite
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Scenario4_Events.xaml.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Scenario4_Events.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Events
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Utilities.cs File Reference

  • CustomSerialDeviceAccess
  • cs
Classes | Namespaces

Utilities.cs File Reference

Go to the source code of this file.

Classes

class | Utilities
This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages. More...

Namespaces

namespace | CustomSerialDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/DeviceListEntry.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

DeviceListEntry.cs File Reference

Go to the source code of this file.

Classes

class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/EventHandlerForDevice.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

EventHandlerForDevice.cs File Reference

Go to the source code of this file.

Classes

class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/SampleConfiguration.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces | Enumerations

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | DeviceProperties
class | LocalSettingKeys
class | OnDeviceConnectedEventArgs
class | OsrFx2
class | OsrFx2::Pipe
class | OsrFx2::VendorCommand
class | SuperMutt
class | SuperMutt::Pipe
class | SuperMutt::VendorCommand
class | SyncBackgroundTaskInformation
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | CustomUsbDeviceAccess
namespace | SDKTemplate

Enumerations

enum Descriptor {
Device, Configuration, Interface, Endpoint,
String, Custom
}
enum | DeviceType { OsrFx2, SuperMutt, All, None }
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario1_ConnectDisconnect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a USB Device and respond to device disconnects, app suspending and resuming events. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario2_ControlTransfer.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario2_ControlTransfer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ControlTransfer
This page demonstrates how to use control transfers to communicate with the device. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario3_InterruptPipes.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario3_InterruptPipes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_InterruptPipes
This page demonstrates how to use interrupts pipes on a UsbDevice. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario4_BulkPipes.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario4_BulkPipes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_BulkPipes
This page demonstrates how to propertly use bulk pipes to read and write to the device. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario5_UsbDescriptors.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario5_UsbDescriptors.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DescriptorTypeEntry
DescriptorTypeEntry is used so that the UI can bind to the list of these entries and display them. More...
class | Scenario5_UsbDescriptors
This scenario demonstrates how get various descriptors from UsbDevice. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario6_InterfaceSettings.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario6_InterfaceSettings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_InterfaceSettings
Scenario will demonstrate how to change interface settings (also known as alternate interface setting). More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario7_SyncDevice.xaml.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Scenario7_SyncDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_SyncDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Utilities.cs File Reference

  • CustomUsbDeviceAccess
  • cs
Classes | Namespaces

Utilities.cs File Reference

Go to the source code of this file.

Classes

class | Utilities

Namespaces

namespace | CustomUsbDeviceAccess
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs File Reference

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask
Classes | Namespaces

Constants.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundTaskInformation
class | LocalSettingKeys
class | Sync

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/IoSyncBackgroundTask.cs File Reference

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask
Classes | Namespaces

IoSyncBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | IoSyncBackgroundTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/Properties/AssemblyInfo.cs File Reference

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/App.xaml.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

App.xaml.cpp File Reference

#include "pch.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/App.xaml.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"
#include "DirectXPage.xaml.h"
#include "DirectXPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Functions

D2DAdvancedColorImagesRenderer.cpp File Reference

#include "pch.h"
#include "D2DAdvancedColorImagesRenderer.h"
#include "DirectXPage.xaml.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Functions

m_isComputeSupported (false)

Function Documentation

m_isComputeSupported ( false )

Definition at line 54 of file D2DAdvancedColorImagesRenderer.cpp.

{
    // Register to be notified if the GPU device is lost or recreated.
    m_deviceResources->RegisterDeviceNotify(this);

    CreateDeviceIndependentResources();
    CreateDeviceDependentResources();
    CreateWindowSizeDependentResources();
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Namespaces

D2DAdvancedColorImagesRenderer.h File Reference

#include "DeviceResources.h"
#include "ReinhardEffect.h"
#include "FilmicEffect.h"
#include "SdrOverlayEffect.h"
#include "LuminanceHeatmapEffect.h"
#include "RenderOptions.h"

Go to the source code of this file.

Classes

class | D2DAdvancedColorImagesRenderer
struct | ImageInfo

Namespaces

namespace | D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXHelper.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Functions

DirectXPage.xaml.cpp File Reference

#include "pch.h"
#include "DirectXPage.xaml.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Functions

m_imageMaxCLL (-1.0f)
m_isImageValid (false)

Function Documentation

m_imageMaxCLL ( -1. 0f )

Definition at line 44 of file DirectXPage.xaml.cpp.

{
    InitializeComponent();

    // Register event handlers for page lifecycle.
    CoreWindow^ window = Window::Current->CoreWindow;

    window->KeyUp += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &DirectXPage::OnKeyUp);

    window->VisibilityChanged +=
        ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &DirectXPage::OnVisibilityChanged);

    window->ResizeCompleted +=
        ref new TypedEventHandler<CoreWindow ^, Object ^>(this, &DirectXPage::OnResizeCompleted);

    DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();

    currentDisplayInformation->DpiChanged +=
        ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDpiChanged);

    currentDisplayInformation->OrientationChanged +=
        ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnOrientationChanged);

    DisplayInformation::DisplayContentsInvalidated +=
        ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDisplayContentsInvalidated);

    currentDisplayInformation->AdvancedColorInfoChanged +=
        ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnAdvancedColorInfoChanged);

    swapChainPanel->CompositionScaleChanged +=
        ref new TypedEventHandler<SwapChainPanel^, Object^>(this, &DirectXPage::OnCompositionScaleChanged);

    swapChainPanel->SizeChanged +=
        ref new SizeChangedEventHandler(this, &DirectXPage::OnSwapChainPanelSizeChanged);

    // Pointer and manipulation events handle image pan and zoom.
    swapChainPanel->PointerPressed += ref new PointerEventHandler(this, &DirectXPage::OnPointerPressed);
    swapChainPanel->PointerMoved += ref new PointerEventHandler(this, &DirectXPage::OnPointerMoved);
    swapChainPanel->PointerReleased += ref new PointerEventHandler(this, &DirectXPage::OnPointerReleased);
    swapChainPanel->PointerCanceled += ref new PointerEventHandler(this, &DirectXPage::OnPointerCanceled);
    swapChainPanel->PointerWheelChanged += ref new PointerEventHandler(this, &DirectXPage::OnPointerWheelChanged);

    m_gestureRecognizer = ref new GestureRecognizer();
    m_gestureRecognizer->GestureSettings =
        GestureSettings::ManipulationTranslateX |
        GestureSettings::ManipulationTranslateY |
        GestureSettings::ManipulationScale;

    m_gestureRecognizer->ManipulationStarted +=
        ref new TypedEventHandler<GestureRecognizer^, ManipulationStartedEventArgs^>(this, &DirectXPage::OnManipulationStarted);

    m_gestureRecognizer->ManipulationUpdated +=
        ref new TypedEventHandler<GestureRecognizer^, ManipulationUpdatedEventArgs^>(this, &DirectXPage::OnManipulationUpdated);

    m_gestureRecognizer->ManipulationCompleted +=
        ref new TypedEventHandler<GestureRecognizer^, ManipulationCompletedEventArgs^>(this, &DirectXPage::OnManipulationCompleted);

    m_renderOptionsViewModel = ref new RenderOptionsViewModel();

    // At this point we have access to the device and
    // can create the device-dependent resources.
    m_deviceResources = std::make_shared<DX::DeviceResources>();
    m_deviceResources->SetSwapChainPanel(swapChainPanel);

    m_renderer = std::unique_ptr<D2DAdvancedColorImagesRenderer>(new D2DAdvancedColorImagesRenderer(m_deviceResources));

    UpdateDisplayACState(currentDisplayInformation->GetAdvancedColorInfo());
}

m_isImageValid ( false )
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Namespaces

DirectXPage.xaml.h File Reference

#include "DirectXPage.g.h"
#include "DeviceResources.h"
#include "D2DAdvancedColorImagesRenderer.h"
#include "RenderOptions.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Defines | Functions

FilmicEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "FilmicEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Functions

IFACEMETHODIMP_ (UINT32) FilmicEffect
IFACEMETHODIMP_ (ULONG) FilmicEffect

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file FilmicEffect.cpp.

Function Documentation

IFACEMETHODIMP_ ( UINT32 )

Definition at line 199 of file FilmicEffect.cpp.

{
    return 1;
}

IFACEMETHODIMP_ ( ULONG )

Definition at line 213 of file FilmicEffect.cpp.

{
    m_refCount--;

    if (m_refCount == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_refCount;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/FilmicEffect.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Functions

FilmicEffect.h File Reference

Go to the source code of this file.

Classes

class FilmicEffect

Functions

DEFINE_GUID (GUID_FilmicEffectPixelShader, 0x4214db42, 0x3bc5, 0x4f17, 0xb8, 0x59, 0x9d, 0x29, 0x15, 0x27, 0x4a, 0x6c)
DEFINE_GUID (CLSID_CustomFilmicEffect, 0x40e0e874, 0x562c, 0x480f, 0x9b, 0x3e, 0x69, 0xf8, 0x42, 0x25, 0x59, 0xc9)

Function Documentation

DEFINE_GUID | ( | GUID_FilmicEffectPixelShader | ,
 |  | 0x4214db42 | ,
 |  | 0x3bc5 | ,
 |  | 0x4f17 | ,
 |  | 0xb8 | ,
 |  | 0x59 | ,
 |  | 0x9d | ,
 |  | 0x29 | ,
 |  | 0x15 | ,
 |  | 0x27 | ,
 |  | 0x4a | ,
 |  | 0x6c |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomFilmicEffect | ,
 |  | 0x40e0e874 | ,
 |  | 0x562c | ,
 |  | 0x480f | ,
 |  | 0x9b | ,
 |  | 0x3e | ,
 |  | 0x69 | ,
 |  | 0xf8 | ,
 |  | 0x42 | ,
 |  | 0x25 | ,
 |  | 0x59 | ,
 |  | 0xc9 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Defines

LuminanceHeatmapEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "LuminanceHeatmapEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file LuminanceHeatmapEffect.cpp.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Functions

LuminanceHeatmapEffect.h File Reference

Go to the source code of this file.

Classes

class LuminanceHeatmapEffect

Functions

DEFINE_GUID (GUID_LuminanceHeatmapPixelShader, 0xced40834, 0x5bc7, 0x4cc6, 0xbe, 0xe9, 0x4f, 0x94, 0xf, 0xab, 0x7b, 0xc1)
DEFINE_GUID (CLSID_CustomLuminanceHeatmapEffect, 0x52bfa892, 0x4616, 0x4b9f, 0xb6, 0x69, 0x1f, 0x4e, 0xdb, 0xfe, 0x10, 0x72)

Function Documentation

DEFINE_GUID | ( | GUID_LuminanceHeatmapPixelShader | ,
 |  | 0xced40834 | ,
 |  | 0x5bc7 | ,
 |  | 0x4cc6 | ,
 |  | 0xbe | ,
 |  | 0xe9 | ,
 |  | 0x4f | ,
 |  | 0x94 | ,
 |  | 0xf | ,
 |  | 0xab | ,
 |  | 0x7b | ,
 |  | 0xc1 |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomLuminanceHeatmapEffect | ,
 |  | 0x52bfa892 | ,
 |  | 0x4616 | ,
 |  | 0x4b9f | ,
 |  | 0xb6 | ,
 |  | 0x69 | ,
 |  | 0x1f | ,
 |  | 0x4e | ,
 |  | 0xdb | ,
 |  | 0xfe | ,
 |  | 0x10 | ,
 |  | 0x72 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

pch.h File Reference

#include <agile.h>
#include <algorithm>
#include <collection.h>
#include <concrt.h>
#include <memory>
#include <ppltasks.h>
#include <shcore.h>
#include <string>
#include <sstream>
#include <wrl.h>
#include <wrl/client.h>
#include <dxgi1_6.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effectauthor_1.h>
#include <d2d1effecthelpers.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Defines | Functions

ReinhardEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "ReinhardEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Functions

IFACEMETHODIMP_ (UINT32) ReinhardEffect
IFACEMETHODIMP_ (ULONG) ReinhardEffect

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file ReinhardEffect.cpp.

Function Documentation

IFACEMETHODIMP_ ( UINT32 )

Definition at line 198 of file ReinhardEffect.cpp.

{
    return 1;
}

IFACEMETHODIMP_ ( ULONG )

Definition at line 212 of file ReinhardEffect.cpp.

{
    m_refCount--;

    if (m_refCount == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_refCount;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Functions

ReinhardEffect.h File Reference

Go to the source code of this file.

Classes

class ReinhardEffect

Functions

DEFINE_GUID (GUID_ReinhardEffectPixelShader, 0x6716FB29, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6)
DEFINE_GUID (CLSID_CustomReinhardEffect, 0xB7B36C92, 0x3498, 0x4A94, 0x9E, 0x95, 0x9F, 0x24, 0x6F, 0x92, 0x45, 0xBF)

Function Documentation

DEFINE_GUID | ( | GUID_ReinhardEffectPixelShader | ,
 |  | 0x6716FB29 | ,
 |  | 0x06A0 | ,
 |  | 0x460F | ,
 |  | 0xAA | ,
 |  | 0x9C | ,
 |  | 0x8B | ,
 |  | 0x8F | ,
 |  | 0xF0 | ,
 |  | 0x33 | ,
 |  | 0x5E | ,
 |  | 0xA6 |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomReinhardEffect | ,
 |  | 0xB7B36C92 | ,
 |  | 0x3498 | ,
 |  | 0x4A94 | ,
 |  | 0x9E | ,
 |  | 0x95 | ,
 |  | 0x9F | ,
 |  | 0x24 | ,
 |  | 0x6F | ,
 |  | 0x92 | ,
 |  | 0x45 | ,
 |  | 0xBF |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/RenderOptions.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Namespaces | Enumerations

RenderOptions.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | D2DAdvancedColorImages

Enumerations

enum RenderEffectKind {
ReinhardTonemap, FilmicTonemap, None, SdrOverlay,
LuminanceHeatmap
}
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.cpp File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Defines

SdrOverlayEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "SdrOverlayEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file SdrOverlayEffect.cpp.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.h File Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages
Classes | Functions

SdrOverlayEffect.h File Reference

Go to the source code of this file.

Classes

class SdrOverlayEffect

Functions

DEFINE_GUID (GUID_SdrOverlayPixelShader, 0xfddf597e, 0x98d4, 0x4aac, 0x83, 0x49, 0x6f, 0xb8, 0x76, 0x67, 0xdc, 0xb5)
DEFINE_GUID (CLSID_CustomSdrOverlayEffect, 0x376c22b8, 0xe6c3, 0x41e7, 0xb1, 0xc1, 0xfb, 0x5f, 0x7e, 0xc9, 0xee, 0x49)

Function Documentation

DEFINE_GUID | ( | GUID_SdrOverlayPixelShader | ,
 |  | 0xfddf597e | ,
 |  | 0x98d4 | ,
 |  | 0x4aac | ,
 |  | 0x83 | ,
 |  | 0x49 | ,
 |  | 0x6f | ,
 |  | 0xb8 | ,
 |  | 0x76 | ,
 |  | 0x67 | ,
 |  | 0xdc | ,
 |  | 0xb5 |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomSdrOverlayEffect | ,
 |  | 0x376c22b8 | ,
 |  | 0xe6c3 | ,
 |  | 0x41e7 | ,
 |  | 0xb1 | ,
 |  | 0xc1 | ,
 |  | 0xfb | ,
 |  | 0x5f | ,
 |  | 0x7e | ,
 |  | 0xc9 | ,
 |  | 0xee | ,
 |  | 0x49 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/App.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 33 of file App.cpp.

{
    auto direct3DApplicationSource = ref new Direct3DApplicationSource();
    CoreApplication::Run(direct3DApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/App.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Namespaces

App.h File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "CustomComputeShaderMain.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | CustomComputeShader
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

CustomComputeShaderMain.cpp File Reference

#include "pch.h"
#include "CustomComputeShaderMain.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Namespaces

CustomComputeShaderMain.h File Reference

#include "DeviceResources.h"
#include "CustomComputeShaderRenderer.h"
#include "SampleOverlay.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Classes

class | CustomComputeShaderMain

Namespaces

namespace | CustomComputeShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

CustomComputeShaderRenderer.cpp File Reference

#include "pch.h"
#include "CustomComputeShaderRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Namespaces

CustomComputeShaderRenderer.h File Reference

#include "DeviceResources.h"
#include "DftEffect.h"

Go to the source code of this file.

Classes

class | CustomComputeShaderRenderer

Namespaces

namespace | CustomComputeShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DeviceResources.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DeviceResources.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DftEffect.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Defines | Functions

DftEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "DftEffect.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Functions

IFACEMETHODIMP_ (ULONG) DftEffect

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file DftEffect.cpp.

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 187 of file DftEffect.cpp.

{
    m_cRef--;

    if (m_cRef == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_cRef;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DftEffect.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Functions

DftEffect.h File Reference

#include "DftTransform.h"

Go to the source code of this file.

Classes

class DftEffect

Functions

DEFINE_GUID (CLSID_CustomDftEffect, 0x88F0F871, 0x18A3, 0x4C55, 0xB5, 0x28, 0xE7, 0x38, 0xA7, 0x81, 0x35, 0x1F)

Function Documentation

DEFINE_GUID | ( | CLSID_CustomDftEffect | ,
 |  | 0x88F0F871 | ,
 |  | 0x18A3 | ,
 |  | 0x4C55 | ,
 |  | 0xB5 | ,
 |  | 0x28 | ,
 |  | 0xE7 | ,
 |  | 0x38 | ,
 |  | 0xA7 | ,
 |  | 0x81 | ,
 |  | 0x35 | ,
 |  | 0x1F |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DftTransform.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Functions

DftTransform.cpp File Reference

#include "pch.h"
#include "DftTransform.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Functions

IFACEMETHODIMP_ (ULONG) DftTransform

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 240 of file DftTransform.cpp.

{
    m_cRef--;

    if (m_cRef == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_cRef;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DftTransform.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Enumerations | Functions

DftTransform.h File Reference

Go to the source code of this file.

Classes

class | DftTransform

Enumerations

enum | TransformType { Horizontal, Vertical }

Functions

DEFINE_GUID (GUID_DFT_H_CS4, 0x6716AAA9, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6)
DEFINE_GUID (GUID_DFT_V_CS5, 0x895136D1, 0x1511, 0x3850, 0xAF, 0x3B, 0x7A, 0xA3, 0xB0, 0x6C, 0x5D, 0xE1)
DEFINE_GUID (GUID_DFT_V_CS4, 0x6716BCD1, 0x04D0, 0x3750, 0xAF, 0x9C, 0x7B, 0x23, 0xC0, 0x63, 0x5C, 0x61)
DEFINE_GUID (GUID_DFT_H_CS5, 0x652562A9, 0x0523, 0x460F, 0xDE, 0x1C, 0x8B, 0x8F, 0xA0, 0x43, 0x1E, 0x86)

Enumeration Type Documentation

enum TransformType
Enumerator:
Horizontal
Vertical

Definition at line 20 of file DftTransform.h.

{
    Horizontal,
    Vertical
};

Function Documentation

DEFINE_GUID | ( | GUID_DFT_H_CS4 | ,
 |  | 0x6716AAA9 | ,
 |  | 0x06A0 | ,
 |  | 0x460F | ,
 |  | 0xAA | ,
 |  | 0x9C | ,
 |  | 0x8B | ,
 |  | 0x8F | ,
 |  | 0xF0 | ,
 |  | 0x33 | ,
 |  | 0x5E | ,
 |  | 0xA6 |
 | ) |  |
DEFINE_GUID | ( | GUID_DFT_V_CS5 | ,
 |  | 0x895136D1 | ,
 |  | 0x1511 | ,
 |  | 0x3850 | ,
 |  | 0xAF | ,
 |  | 0x3B | ,
 |  | 0x7A | ,
 |  | 0xA3 | ,
 |  | 0xB0 | ,
 |  | 0x6C | ,
 |  | 0x5D | ,
 |  | 0xE1 |
 | ) |  |
DEFINE_GUID | ( | GUID_DFT_V_CS4 | ,
 |  | 0x6716BCD1 | ,
 |  | 0x04D0 | ,
 |  | 0x3750 | ,
 |  | 0xAF | ,
 |  | 0x9C | ,
 |  | 0x7B | ,
 |  | 0x23 | ,
 |  | 0xC0 | ,
 |  | 0x63 | ,
 |  | 0x5C | ,
 |  | 0x61 |
 | ) |  |
DEFINE_GUID | ( | GUID_DFT_H_CS5 | ,
 |  | 0x652562A9 | ,
 |  | 0x0523 | ,
 |  | 0x460F | ,
 |  | 0xDE | ,
 |  | 0x1C | ,
 |  | 0x8B | ,
 |  | 0x8F | ,
 |  | 0xA0 | ,
 |  | 0x43 | ,
 |  | 0x1E | ,
 |  | 0x86 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DirectXHelper.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/pch.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/pch.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

pch.h File Reference

#include <wrl.h>
#include <wrl/client.h>
#include <memory>
#include <agile.h>
#include <concrt.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effects_2.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <d2d1effectauthor_1.h>
#include <d2d1effecthelpers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/SampleOverlay.cpp File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

SampleOverlay.cpp File Reference

#include "pch.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/SampleOverlay.h File Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader
Classes | Namespaces

SampleOverlay.h File Reference

#include "DirectXHelper.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | SampleOverlay

Namespaces

namespace | CustomComputeShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/App.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 33 of file App.cpp.

{
    auto direct3DApplicationSource = ref new Direct3DApplicationSource();
    CoreApplication::Run(direct3DApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/App.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Namespaces

App.h File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "CustomPixelShaderMain.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | CustomPixelShader
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/BasicTimer.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

BasicTimer.cpp File Reference

#include "pch.h"
#include "BasicTimer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/BasicTimer.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes

BasicTimer.h File Reference

Go to the source code of this file.

Classes

class BasicTimer
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

CustomPixelShaderMain.cpp File Reference

#include "pch.h"
#include "CustomPixelShaderMain.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/CustomPixelShaderMain.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Namespaces

CustomPixelShaderMain.h File Reference

#include "BasicTimer.h"
#include "DeviceResources.h"
#include "CustomPixelShaderRenderer.h"
#include "SampleOverlay.h"
#include "BasicTimer.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Classes

class | CustomPixelShaderMain

Namespaces

namespace | CustomPixelShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

CustomPixelShaderRenderer.cpp File Reference

#include "pch.h"
#include "CustomPixelShaderRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Namespaces

CustomPixelShaderRenderer.h File Reference

#include "DeviceResources.h"
#include "BasicTimer.h"
#include "RippleEffect.h"

Go to the source code of this file.

Classes

class | CustomPixelShaderRenderer

Namespaces

namespace | CustomPixelShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/DeviceResources.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/DeviceResources.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/DirectXHelper.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/pch.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/pch.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

pch.h File Reference

#include <wrl.h>
#include <wrl/client.h>
#include <memory>
#include <agile.h>
#include <concrt.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effects_2.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <d2d1effectauthor_1.h>
#include <d2d1effecthelpers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/RippleEffect.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Defines | Functions

RippleEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "RippleEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Functions

IFACEMETHODIMP_ (UINT32) RippleEffect
IFACEMETHODIMP_ (ULONG) RippleEffect

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file RippleEffect.cpp.

Function Documentation

IFACEMETHODIMP_ ( UINT32 )

Definition at line 309 of file RippleEffect.cpp.

{
    return 1;
}

IFACEMETHODIMP_ ( ULONG )

Definition at line 323 of file RippleEffect.cpp.

{
    m_refCount--;

    if (m_refCount == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_refCount;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/RippleEffect.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Enumerations | Functions

RippleEffect.h File Reference

Go to the source code of this file.

Classes

class RippleEffect

Enumerations

enum RIPPLE_PROP {
RIPPLE_PROP_FREQUENCY = 0, RIPPLE_PROP_PHASE = 1, RIPPLE_PROP_AMPLITUDE = 2, RIPPLE_PROP_SPREAD = 3,
RIPPLE_PROP_CENTER = 4
}

Functions

DEFINE_GUID (GUID_RipplePixelShader, 0x6716FB29, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6)
DEFINE_GUID (CLSID_CustomRippleEffect, 0xB7B36C92, 0x3498, 0x4A94, 0x9E, 0x95, 0x9F, 0x24, 0x6F, 0x92, 0x45, 0xBF)

Enumeration Type Documentation

enum RIPPLE_PROP
Enumerator:
RIPPLE_PROP_FREQUENCY
RIPPLE_PROP_PHASE
RIPPLE_PROP_AMPLITUDE
RIPPLE_PROP_SPREAD
RIPPLE_PROP_CENTER

Definition at line 15 of file RippleEffect.h.

{
    RIPPLE_PROP_FREQUENCY = 0,
    RIPPLE_PROP_PHASE     = 1,
    RIPPLE_PROP_AMPLITUDE = 2,
    RIPPLE_PROP_SPREAD    = 3,
    RIPPLE_PROP_CENTER    = 4
};

Function Documentation

DEFINE_GUID | ( | GUID_RipplePixelShader | ,
 |  | 0x6716FB29 | ,
 |  | 0x06A0 | ,
 |  | 0x460F | ,
 |  | 0xAA | ,
 |  | 0x9C | ,
 |  | 0x8B | ,
 |  | 0x8F | ,
 |  | 0xF0 | ,
 |  | 0x33 | ,
 |  | 0x5E | ,
 |  | 0xA6 |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomRippleEffect | ,
 |  | 0xB7B36C92 | ,
 |  | 0x3498 | ,
 |  | 0x4A94 | ,
 |  | 0x9E | ,
 |  | 0x95 | ,
 |  | 0x9F | ,
 |  | 0x24 | ,
 |  | 0x6F | ,
 |  | 0x92 | ,
 |  | 0x45 | ,
 |  | 0xBF |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/SampleOverlay.cpp File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

SampleOverlay.cpp File Reference

#include "pch.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/SampleOverlay.h File Reference

  • D2DCustomEffects
  • cpp
  • PixelShader
Classes | Namespaces

SampleOverlay.h File Reference

#include "DirectXHelper.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | SampleOverlay

Namespaces

namespace | CustomPixelShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/App.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 32 of file App.cpp.

{
    auto direct3DApplicationSource = ref new Direct3DApplicationSource();
    CoreApplication::Run(direct3DApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/App.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Namespaces

App.h File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "CustomVertexShaderMain.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | CustomVertexShader
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/BasicReaderWriter.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/BasicTimer.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

BasicTimer.cpp File Reference

#include "pch.h"
#include "BasicTimer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/BasicTimer.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes

BasicTimer.h File Reference

Go to the source code of this file.

Classes

class BasicTimer
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

CustomVertexShaderMain.cpp File Reference

#include "pch.h"
#include "CustomVertexShaderMain.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Namespaces

CustomVertexShaderMain.h File Reference

#include "BasicTimer.h"
#include "DeviceResources.h"
#include "CustomVertexShaderRenderer.h"
#include "SampleOverlay.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Classes

class | CustomVertexShaderMain

Namespaces

namespace | CustomVertexShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

CustomVertexShaderRenderer.cpp File Reference

#include "pch.h"
#include "CustomVertexShaderRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/CustomVertexShaderRenderer.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Namespaces

CustomVertexShaderRenderer.h File Reference

#include "DeviceResources.h"
#include "BasicTimer.h"
#include "WaveEffect.h"

Go to the source code of this file.

Classes

class | CustomVertexShaderRenderer

Namespaces

namespace | CustomVertexShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/DeviceResources.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/DeviceResources.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/DirectXHelper.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/pch.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/pch.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

pch.h File Reference

#include <wrl.h>
#include <wrl/client.h>
#include <memory>
#include <agile.h>
#include <concrt.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effects_2.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <d2d1effectauthor_1.h>
#include <d2d1effecthelpers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/SampleOverlay.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

SampleOverlay.cpp File Reference

#include "pch.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/SampleOverlay.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Namespaces

SampleOverlay.h File Reference

#include "DirectXHelper.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | SampleOverlay

Namespaces

namespace | CustomVertexShader
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/WaveEffect.cpp File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Defines | Functions

WaveEffect.cpp File Reference

#include "pch.h"
#include <initguid.h>
#include "WaveEffect.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Defines

#define XML(X) TEXT(#X)

Functions

IFACEMETHODIMP_ (ULONG) WaveEffect

Define Documentation

#define XML ( X ) TEXT(#X)

Definition at line 17 of file WaveEffect.cpp.

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 424 of file WaveEffect.cpp.

{
    m_refCount--;

    if (m_refCount == 0)
    {
        delete this;
        return 0;
    }
    else
    {
        return m_refCount;
    }
}

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/WaveEffect.h File Reference

  • D2DCustomEffects
  • cpp
  • VertexShader
Classes | Enumerations | Functions

WaveEffect.h File Reference

Go to the source code of this file.

Classes

class | WaveEffect
struct | WaveEffect::Vertex

Enumerations

enum | WAVE_PROP { WAVE_PROP_OFFSET = 0, WAVE_PROP_SKEW_X = 1, WAVE_PROP_SKEW_Y = 2, WAVE_PROP_FORCE_DWORD = 0xFFFFFFFF }

Functions

DEFINE_GUID (GUID_WaveTransformVertexShader, 0x65fa2492, 0x9478, 0x4c4d, 0x95, 0x67, 0xf6, 0x96, 0x72, 0x6a, 0x83, 0xa4)
DEFINE_GUID (CLSID_CustomWaveEffect, 0x7b4c948b, 0xfcf2, 0x4c6b, 0xa0, 0x93, 0xdb, 0x4e, 0x59, 0x99, 0x42, 0x43)
DEFINE_GUID (GUID_WaveTransformVertexBuffer, 0xa9149e76, 0xc708, 0x4b3a, 0xad, 0x59, 0x56, 0x72, 0x3b, 0x65, 0x33, 0x44)

Enumeration Type Documentation

enum WAVE_PROP
Enumerator:
WAVE_PROP_OFFSET
WAVE_PROP_SKEW_X
WAVE_PROP_SKEW_Y
WAVE_PROP_FORCE_DWORD

Definition at line 23 of file WaveEffect.h.

{
    WAVE_PROP_OFFSET      = 0,
    WAVE_PROP_SKEW_X      = 1,
    WAVE_PROP_SKEW_Y      = 2,
    WAVE_PROP_FORCE_DWORD = 0xFFFFFFFF
};

Function Documentation

DEFINE_GUID | ( | GUID_WaveTransformVertexShader | ,
 |  | 0x65fa2492 | ,
 |  | 0x9478 | ,
 |  | 0x4c4d | ,
 |  | 0x95 | ,
 |  | 0x67 | ,
 |  | 0xf6 | ,
 |  | 0x96 | ,
 |  | 0x72 | ,
 |  | 0x6a | ,
 |  | 0x83 | ,
 |  | 0xa4 |
 | ) |  |
DEFINE_GUID | ( | CLSID_CustomWaveEffect | ,
 |  | 0x7b4c948b | ,
 |  | 0xfcf2 | ,
 |  | 0x4c6b | ,
 |  | 0xa0 | ,
 |  | 0x93 | ,
 |  | 0xdb | ,
 |  | 0x4e | ,
 |  | 0x59 | ,
 |  | 0x99 | ,
 |  | 0x42 | ,
 |  | 0x43 |
 | ) |  |
DEFINE_GUID | ( | GUID_WaveTransformVertexBuffer | ,
 |  | 0xa9149e76 | ,
 |  | 0xc708 | ,
 |  | 0x4b3a | ,
 |  | 0xad | ,
 |  | 0x59 | ,
 |  | 0x56 | ,
 |  | 0x72 | ,
 |  | 0x3b | ,
 |  | 0x65 | ,
 |  | 0x33 | ,
 |  | 0x44 |
 | ) |  |
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/App.cpp File Reference

  • D2DGradientMesh
  • cpp
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 25 of file App.cpp.

{
    auto directXApplicationSource = ref new DirectXApplicationSource();
    CoreApplication::Run(directXApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/App.h File Reference

  • D2DGradientMesh
  • cpp
Classes | Namespaces

App.h File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "D2DGradientMeshMain.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | D2DGradientMesh
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshMain.cpp File Reference

  • D2DGradientMesh
  • cpp

D2DGradientMeshMain.cpp File Reference

#include "pch.h"
#include "D2DGradientMeshMain.h"
#include <DirectXColors.h>
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshMain.h File Reference

  • D2DGradientMesh
  • cpp
Classes | Namespaces

D2DGradientMeshMain.h File Reference

#include "DeviceResources.h"
#include "D2DGradientMeshRenderer.h"
#include "SampleOverlay.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Classes

class | D2DGradientMeshMain

Namespaces

namespace | D2DGradientMesh
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshRenderer.cpp File Reference

  • D2DGradientMesh
  • cpp

D2DGradientMeshRenderer.cpp File Reference

#include "pch.h"
#include "D2DGradientMeshRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshRenderer.h File Reference

  • D2DGradientMesh
  • cpp
Classes | Namespaces

D2DGradientMeshRenderer.h File Reference

#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | D2DGradientMeshRenderer

Namespaces

namespace | D2DGradientMesh
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/DeviceResources.cpp File Reference

  • D2DGradientMesh
  • cpp
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/DeviceResources.h File Reference

  • D2DGradientMesh
  • cpp
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/DirectXHelper.h File Reference

  • D2DGradientMesh
  • cpp
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/pch.cpp File Reference

  • D2DGradientMesh
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/pch.h File Reference

  • D2DGradientMesh
  • cpp

pch.h File Reference

#include <wrl.h>
#include <wrl/client.h>
#include <d3d11_2.h>
#include <d2d1_3.h>
#include <dwrite_2.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <memory>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/SampleOverlay.cpp File Reference

  • D2DGradientMesh
  • cpp

SampleOverlay.cpp File Reference

#include "pch.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/SampleOverlay.h File Reference

  • D2DGradientMesh
  • cpp
Classes | Namespaces

SampleOverlay.h File Reference

#include "DirectXHelper.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | SampleOverlay

Namespaces

namespace | D2DGradientMesh
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/App.xaml.cpp File Reference

  • D2DPhotoAdjustment
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/App.xaml.h File Reference

  • D2DPhotoAdjustment
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"
#include "DirectXPage.xaml.h"
#include "DirectXPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | D2DPhotoAdjustment
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/DirectXPage.xaml.cpp File Reference

  • D2DPhotoAdjustment
  • cpp

DirectXPage.xaml.cpp File Reference

#include "pch.h"
#include "DirectXPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/DirectXPage.xaml.h File Reference

  • D2DPhotoAdjustment
  • cpp
Classes | Namespaces

DirectXPage.xaml.h File Reference

#include "DirectXPage.g.h"
#include "Common\DeviceResources.h"
#include "PhotoAdjustmentRenderer.h"
#include "PhotoAdjustmentProperties.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | D2DPhotoAdjustment
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/pch.cpp File Reference

  • D2DPhotoAdjustment
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/pch.h File Reference

  • D2DPhotoAdjustment
  • cpp

pch.h File Reference

#include <agile.h>
#include <concrt.h>
#include <memory>
#include <ppltasks.h>
#include <wrl.h>
#include <wrl/client.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <d2d1effects_2.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <d2d1effectauthor_1.h>
#include <d2d1effecthelpers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/PhotoAdjustmentProperties.h File Reference

  • D2DPhotoAdjustment
  • cpp
Classes | Namespaces

PhotoAdjustmentProperties.h File Reference

Go to the source code of this file.

Classes

struct | PhotoAdjustmentProperties

Namespaces

namespace | D2DPhotoAdjustment
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.cpp File Reference

  • D2DPhotoAdjustment
  • cpp

PhotoAdjustmentRenderer.cpp File Reference

#include "pch.h"
#include "PhotoAdjustmentRenderer.h"
#include "DirectXPage.xaml.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/PhotoAdjustmentRenderer.h File Reference

  • D2DPhotoAdjustment
  • cpp
Classes | Namespaces

PhotoAdjustmentRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "PhotoAdjustmentProperties.h"

Go to the source code of this file.

Classes

class | PhotoAdjustmentRenderer

Namespaces

namespace | D2DPhotoAdjustment
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/DeviceResources.cpp File Reference

  • D2DPhotoAdjustment
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/DeviceResources.h File Reference

  • D2DPhotoAdjustment
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/DirectXHelper.h File Reference

  • D2DPhotoAdjustment
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/App.xaml.cpp File Reference

  • D2DSvgImage
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/App.xaml.h File Reference

  • D2DSvgImage
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"
#include "DirectXPage.xaml.h"
#include "DirectXPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/D2DSvgImageRenderer.cpp File Reference

  • D2DSvgImage
  • cpp

D2DSvgImageRenderer.cpp File Reference

#include "pch.h"
#include "D2DSvgImageRenderer.h"
#include "DirectXPage.xaml.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/D2DSvgImageRenderer.h File Reference

  • D2DSvgImage
  • cpp
Classes | Namespaces

D2DSvgImageRenderer.h File Reference

#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | D2DSvgImageRenderer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/DirectXPage.xaml.cpp File Reference

  • D2DSvgImage
  • cpp

DirectXPage.xaml.cpp File Reference

#include "pch.h"
#include "DirectXPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/DirectXPage.xaml.h File Reference

  • D2DSvgImage
  • cpp
Classes | Namespaces

DirectXPage.xaml.h File Reference

#include "DirectXPage.g.h"
#include "Common\DeviceResources.h"
#include "D2DSvgImageRenderer.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/pch.cpp File Reference

  • D2DSvgImage
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/pch.h File Reference

  • D2DSvgImage
  • cpp

pch.h File Reference

#include <agile.h>
#include <concrt.h>
#include <memory>
#include <ppltasks.h>
#include <wrl.h>
#include <wrl/client.h>
#include <shcore.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/Common/DeviceResources.cpp File Reference

  • D2DSvgImage
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/Common/DeviceResources.h File Reference

  • D2DSvgImage
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/Common/DirectXHelper.h File Reference

  • D2DSvgImage
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/pch.cpp File Reference

  • DatagramSocket
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/pch.h File Reference

  • DatagramSocket
  • cpp

pch.h File Reference

#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/SampleConfiguration.cpp File Reference

  • DatagramSocket
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/SampleConfiguration.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include <collection.h>

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario1.xaml.cpp File Reference

  • DatagramSocket
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario1.xaml.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario2.xaml.cpp File Reference

  • DatagramSocket
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario2.xaml.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario3.xaml.cpp File Reference

  • DatagramSocket
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario3.xaml.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario4.xaml.cpp File Reference

  • DatagramSocket
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario4.xaml.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario5.xaml.cpp File Reference

  • DatagramSocket
  • cpp

Scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario5.xaml.h File Reference

  • DatagramSocket
  • cpp
Classes | Namespaces

Scenario5.xaml.h File Reference

#include "pch.h"
#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/SampleConfiguration.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario1_Start.xaml.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

Scenario1_Start.xaml.cs File Reference

Go to the source code of this file.

Classes

class | LocalHostItem
Helper class describing a NetworkAdapter and its associated IP address. More...
class | RemotePeer
Helper class used to identify and respond to a remote peer. More...
class | Scenario1
A page for first scenario. More...

Namespaces

namespace | DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario2_Connect.xaml.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

Scenario2_Connect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
A page for second scenario. More...

Namespaces

namespace | DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario3_Send.xaml.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

Scenario3_Send.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
A page for third scenario. More...

Namespaces

namespace | DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario4_Close.xaml.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

Scenario4_Close.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
A page for fourth scenario. More...

Namespaces

namespace | DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario5_MulticastAndBroadcast.xaml.cs File Reference

  • DatagramSocket
  • cs
Classes | Namespaces

Scenario5_MulticastAndBroadcast.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
A page for fifth scenario. More...

Namespaces

namespace | DatagramSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/pch.cpp File Reference

  • DataReaderWriter
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/pch.h File Reference

  • DataReaderWriter
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/SampleConfiguration.cpp File Reference

  • DataReaderWriter
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/SampleConfiguration.h File Reference

  • DataReaderWriter
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.cpp File Reference

  • DataReaderWriter
  • cpp
Variables

Scenario1_WriteReadStream.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_WriteReadStream.xaml.h"

Go to the source code of this file.

Variables

Array< String^> _inputElements

Variable Documentation

Array<String^> _inputElements
Initial value:
 ref new Array<String^>
{
    "Hello", "World", "1 2 3 4 5", "Très bien!", "Goodbye"
}

Definition at line 29 of file Scenario1_WriteReadStream.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.h File Reference

  • DataReaderWriter
  • cpp
Classes | Namespaces

Scenario1_WriteReadStream.xaml.h File Reference

#include "pch.h"
#include "Scenario1_WriteReadStream.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.cpp File Reference

  • DataReaderWriter
  • cpp

Scenario2_ReadBytes.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ReadBytes.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.h File Reference

  • DataReaderWriter
  • cpp
Classes | Namespaces

Scenario2_ReadBytes.xaml.h File Reference

#include <cstring>
#include "pch.h"
#include "Scenario2_ReadBytes.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cs/SampleConfiguration.cs File Reference

  • DataReaderWriter
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cs/Scenario1_WriteReadStream.xaml.cs File Reference

  • DataReaderWriter
  • cs
Classes | Namespaces

Scenario1_WriteReadStream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | WriteReadStream
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cs/Scenario2_ReadBytes.xaml.cs File Reference

  • DataReaderWriter
  • cs
Classes | Namespaces

Scenario2_ReadBytes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ReadBytes
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/pch.cpp File Reference

  • DateTimeFormatting
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/pch.h File Reference

  • DateTimeFormatting
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/SampleConfiguration.cpp File Reference

  • DateTimeFormatting
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/SampleConfiguration.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario1_LongAndShortFormats.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_LongAndShortFormats.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario1_LongAndShortFormats.xaml.h File Reference

#include "pch.h"
#include "Scenario1_LongAndShortFormats.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario2_StringTemplate.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_StringTemplate.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario2_StringTemplate.xaml.h File Reference

#include "pch.h"
#include "Scenario2_StringTemplate.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario3_ParameterizedTemplate.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ParameterizedTemplate.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario3_ParameterizedTemplate.xaml.h File Reference

#include "pch.h"
#include "Scenario3_ParameterizedTemplate.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario4_Override.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario4_Override.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Override.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario4_Override.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario4_Override.xaml.h File Reference

#include "pch.h"
#include "Scenario4_Override.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario5_UnicodeExtensions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_UnicodeExtensions.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario5_UnicodeExtensions.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario5_UnicodeExtensions.xaml.h File Reference

#include "pch.h"
#include "Scenario5_UnicodeExtensions.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.cpp File Reference

  • DateTimeFormatting
  • cpp

Scenario6_TimeZone.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_TimeZone.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.h File Reference

  • DateTimeFormatting
  • cpp
Classes | Namespaces

Scenario6_TimeZone.xaml.h File Reference

#include "pch.h"
#include "Scenario6_TimeZone.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/pch.cpp File Reference

  • DateTimeFormatting
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/pch.h File Reference

  • DateTimeFormatting
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.Globalization.DateTimeFormatting.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Project.idl File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_LongAndShortFormats
runtimeclass | Scenario2_StringTemplate
runtimeclass | Scenario3_ParameterizedTemplate
runtimeclass | Scenario4_Override
runtimeclass | Scenario5_UnicodeExtensions
runtimeclass | Scenario6_TimeZone
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/SampleConfiguration.cpp File Reference

  • DateTimeFormatting
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/SampleConfiguration.h File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

hstring | StringJoin (std::wstring const &delimiter, Windows::Foundation::Collections::IVectorView< hstring > const &vector)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces

Scenario1_LongAndShortFormats.cpp File Reference

#include "pch.h"
#include "Scenario1_LongAndShortFormats.h"
#include "Scenario1_LongAndShortFormats.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario1_LongAndShortFormats.h File Reference

#include "Scenario1_LongAndShortFormats.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_LongAndShortFormats
struct | Scenario1_LongAndShortFormats

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces | Functions

Scenario2_StringTemplate.cpp File Reference

#include "pch.h"
#include "Scenario2_StringTemplate.h"
#include "Scenario2_StringTemplate.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario2_StringTemplate.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, DateTime dateToFormat)
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario2_StringTemplate.h File Reference

#include "Scenario2_StringTemplate.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_StringTemplate
struct | Scenario2_StringTemplate

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces | Functions

Scenario3_ParameterizedTemplate.cpp File Reference

#include "pch.h"
#include "Scenario3_ParameterizedTemplate.h"
#include "Scenario3_ParameterizedTemplate.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario3_ParameterizedTemplate.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, DateTime dateToFormat)
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario3_ParameterizedTemplate.h File Reference

#include "Scenario3_ParameterizedTemplate.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_ParameterizedTemplate
struct | Scenario3_ParameterizedTemplate

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario4_Override.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces

Scenario4_Override.cpp File Reference

#include "pch.h"
#include "Scenario4_Override.h"
#include "Scenario4_Override.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario4_Override.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario4_Override.h File Reference

#include "Scenario4_Override.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_Override
struct | Scenario4_Override

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces

Scenario5_UnicodeExtensions.cpp File Reference

#include "pch.h"
#include "Scenario5_UnicodeExtensions.h"
#include "Scenario5_UnicodeExtensions.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario5_UnicodeExtensions.h File Reference

#include "Scenario5_UnicodeExtensions.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_UnicodeExtensions
struct | Scenario5_UnicodeExtensions

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario6_TimeZone.cpp File Reference

  • DateTimeFormatting
  • cppwinrt
Namespaces | Functions

Scenario6_TimeZone.cpp File Reference

#include "pch.h"
#include "Scenario6_TimeZone.h"
#include "Scenario6_TimeZone.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario6_TimeZone.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

void | GenerateResult (std::wostream &results, DateTimeFormatter const &formatter, PCWSTR timeZone, DateTime dateToFormat)
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario6_TimeZone.h File Reference

  • DateTimeFormatting
  • cppwinrt
Classes | Namespaces

Scenario6_TimeZone.h File Reference

#include "Scenario6_TimeZone.g.h"

Go to the source code of this file.

Classes

struct | Scenario6_TimeZone
struct | Scenario6_TimeZone

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/SampleConfiguration.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario1_LongAndShortFormats.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario1_LongAndShortFormats.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_LongAndShortFormats

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario2_StringTemplate.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario2_StringTemplate.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_StringTemplate

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario3_ParameterizedTemplate.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario3_ParameterizedTemplate.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ParameterizedTemplate

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario4_Override.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario4_Override.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Override

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario5_UnicodeExtensions.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario5_UnicodeExtensions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_UnicodeExtensions

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario6_TimeZone.xaml.cs File Reference

  • DateTimeFormatting
  • cs
Classes | Namespaces

Scenario6_TimeZone.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_TimeZone

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

DeviceWatcherHelper.cpp File Reference

#include "pch.h"
#include "DeviceWatcherHelper.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

DeviceWatcherHelper.h File Reference

#include "DisplayHelpers.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/DisplayHelpers.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp
Namespaces | Functions

DisplayHelpers.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include <ppltasks.h>
#include <DisplayHelpers.h>

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

void | AddVideoCastingIfSupported (Vector< DeviceSelectorInfo^>^selectors)
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/DisplayHelpers.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

DisplayHelpers.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/pch.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/pch.h File Reference

  • DeviceEnumerationAndPairing
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/SampleConfiguration.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/SampleConfiguration.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario1_DevicePicker.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DevicePicker.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario1_DevicePicker.xaml.h File Reference

#include "Scenario1_DevicePicker.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario2_DeviceWatcher.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_DeviceWatcher.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario2_DeviceWatcher.xaml.h File Reference

#include "Scenario2_DeviceWatcher.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario3_BackgroundDeviceWatcher.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_BackgroundDeviceWatcher.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario3_BackgroundDeviceWatcher.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario3_BackgroundDeviceWatcher.xaml.h File Reference

#include "Scenario3_BackgroundDeviceWatcher.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario4_Snapshot.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Snapshot.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario4_Snapshot.xaml.h File Reference

#include "Scenario4_Snapshot.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario5_GetSingleDevice.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_GetSingleDevice.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario5_GetSingleDevice.xaml.h File Reference

#include "Scenario5_GetSingleDevice.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario6_CustomFilterAddedProps.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_CustomFilterAddedProps.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario6_CustomFilterAddedProps.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario6_CustomFilterAddedProps.xaml.h File Reference

#include "Scenario6_CustomFilterAddedProps.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario7_DeviceInformationKind.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_DeviceInformationKind.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario7_DeviceInformationKind.xaml.h File Reference

#include "Scenario7_DeviceInformationKind.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario8_PairDevice.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8_PairDevice.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario8_PairDevice.xaml.h File Reference

#include "Scenario8_PairDevice.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp

Scenario9_CustomPairDevice.xaml.cpp File Reference

#include "pch.h"
#include "Scenario9_CustomPairDevice.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
Classes | Namespaces

Scenario9_CustomPairDevice.xaml.h File Reference

#include "Scenario9_CustomPairDevice.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

BackgroundDeviceWatcherTask.cpp File Reference

#include "pch.h"
#include "BackgroundDeviceWatcherTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks
Classes | Namespaces

BackgroundDeviceWatcherTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | BackgroundDeviceWatcherTaskCpp
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/pch.cpp File Reference

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/pch.h File Reference

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces | Functions

DeviceHelpers.cpp File Reference

#include "pch.h"
#include "DeviceHelpers.h"
#include "winrt/Windows.Devices.HumanInterfaceDevice.h"
#include "winrt/Windows.Networking.Proximity.h"
#include "winrt/Windows.Devices.Bluetooth.h"
#include "winrt/Windows.Devices.WiFiDirect.h"
#include "winrt/Windows.Media.Casting.h"
#include "winrt/Windows.Media.DialProtocol.h"
#include "winrt/Windows.Devices.Sensors.h"
#include "winrt/Windows.Devices.PointOfService.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::implementation
namespace | winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}

Functions

void | AddVideoCastingIfSupported (IObservableVector< SDKTemplate::DeviceSelectorInfo > &selectors)
SDKTemplate::DeviceSelectorInfo Bluetooth ()
SDKTemplate::DeviceSelectorInfo BluetoothLE ()
SDKTemplate::DeviceSelectorInfo BluetoothLEPairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothLEUnpairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothPairedOnly ()
SDKTemplate::DeviceSelectorInfo BluetoothUnpairedOnly ()
SDKTemplate::DeviceSelectorInfo DialAllApps ()
SDKTemplate::DeviceSelectorInfo NetworkCamera ()
SDKTemplate::DeviceSelectorInfo PointOfServicePrinter ()
SDKTemplate::DeviceSelectorInfo Upnp ()
SDKTemplate::DeviceSelectorInfo VideoCasting ()
SDKTemplate::DeviceSelectorInfo WiFiDirect ()
SDKTemplate::DeviceSelectorInfo WiFiDirectPairedOnly ()
SDKTemplate::DeviceSelectorInfo Wsd ()
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

DeviceHelpers.h File Reference

#include "DeviceSelectorInfo.g.h"
#include "DeviceInformationKindChoice.g.h"
#include "ProtectionLevelSelectorInfo.g.h"
#include "DeviceInformationDisplay.g.h"

Go to the source code of this file.

Classes

struct | DeviceInformationDisplay
struct | DeviceInformationKindChoice
struct | DeviceInformationKindChoices
struct | DeviceSelectorChoices
struct | DeviceSelectorInfo
struct | ProtectionLevelSelectorInfo
struct | ProtectionSelectorChoices

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

DeviceWatcherHelper.cpp File Reference

#include "pch.h"
#include "MainPage.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

DeviceWatcherHelper.h File Reference

Go to the source code of this file.

Classes

struct | DeviceWatcherHelper

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/pch.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/pch.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.Background.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Security.Credentials.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Project.idl File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces | Functions | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

String | GetPropertyForDisplay (String key)

Variables

runtimeclass | DeviceInformationDisplay
runtimeclass | Scenario1_DevicePicker
runtimeclass | Scenario2_DeviceWatcher
runtimeclass | Scenario3_BackgroundDeviceWatcher
runtimeclass | Scenario4_Snapshot
runtimeclass | Scenario5_GetSingleDevice
runtimeclass | Scenario6_CustomFilterAddedProps
runtimeclass | Scenario7_DeviceInformationKind
runtimeclass | Scenario8_PairDevice
runtimeclass | Scenario9_CustomPairDevice
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/SampleConfiguration.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | SimpleTaskCompletionSource< T >
struct | SimpleTaskCompletionSource< void >

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

template<typename T >
T * | FromInspectable (Windows::Foundation::IInspectable const &insp)
hstring | to_hstring (Windows::Devices::Enumeration::DeviceUnpairingResultStatus status)
hstring | to_hstring (Windows::Devices::Enumeration::DeviceInformationKind kind)
hstring | to_hstring (Windows::Devices::Enumeration::DevicePairingResultStatus status)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario1_DevicePicker.cpp File Reference

#include "pch.h"
#include "Scenario1_DevicePicker.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "Scenario1_DevicePicker.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario1_DevicePicker.h File Reference

#include "Scenario1_DevicePicker.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_DevicePicker
struct | Scenario1_DevicePicker

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario2_DeviceWatcher.cpp File Reference

#include "pch.h"
#include "Scenario2_DeviceWatcher.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "DeviceWatcherHelper.h"
#include "Scenario2_DeviceWatcher.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario2_DeviceWatcher.h File Reference

#include "Scenario2_DeviceWatcher.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario2_DeviceWatcher
struct | Scenario2_DeviceWatcher

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces | Variables

Scenario3_BackgroundDeviceWatcher.cpp File Reference

#include "pch.h"
#include "Scenario3_BackgroundDeviceWatcher.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "DeviceWatcherHelper.h"
#include "Scenario3_BackgroundDeviceWatcher.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::implementation

Variables

winrt::hstring | backgroundTaskName = "DeviceEnumeration_BackgroundTaskName"

Variable Documentation

winrt::hstring backgroundTaskName = "DeviceEnumeration_BackgroundTaskName"

Definition at line 27 of file Scenario3_BackgroundDeviceWatcher.cpp.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario3_BackgroundDeviceWatcher.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario3_BackgroundDeviceWatcher.h File Reference

#include "Scenario3_BackgroundDeviceWatcher.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario3_BackgroundDeviceWatcher
struct | Scenario3_BackgroundDeviceWatcher

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario4_Snapshot.cpp File Reference

#include "pch.h"
#include "Scenario4_Snapshot.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "Scenario4_Snapshot.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario4_Snapshot.h File Reference

#include "Scenario4_Snapshot.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario4_Snapshot
struct | Scenario4_Snapshot

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario5_GetSingleDevice.cpp File Reference

#include "pch.h"
#include "Scenario5_GetSingleDevice.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"
#include "Scenario5_GetSingleDevice.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario5_GetSingleDevice.h File Reference

#include "Scenario5_GetSingleDevice.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5_GetSingleDevice
struct | Scenario5_GetSingleDevice

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario6_CustomFilterAddedProps.cpp File Reference

#include "pch.h"
#include "Scenario6_CustomFilterAddedProps.h"
#include "DeviceHelpers.h"
#include "Scenario6_CustomFilterAddedProps.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario6_CustomFilterAddedProps.h File Reference

#include "Scenario6_CustomFilterAddedProps.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario6_CustomFilterAddedProps
struct | Scenario6_CustomFilterAddedProps

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario7_DeviceInformationKind.cpp File Reference

#include "pch.h"
#include "Scenario7_DeviceInformationKind.h"
#include "DeviceHelpers.h"
#include "SampleConfiguration.h"
#include "Scenario7_DeviceInformationKind.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario7_DeviceInformationKind.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario7_DeviceInformationKind.h File Reference

#include "Scenario7_DeviceInformationKind.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario7_DeviceInformationKind
struct | Scenario7_DeviceInformationKind

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario8_PairDevice.cpp File Reference

#include "pch.h"
#include "Scenario8_PairDevice.h"
#include "DeviceHelpers.h"
#include "SampleConfiguration.h"
#include "Scenario8_PairDevice.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario8_PairDevice.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario8_PairDevice.h File Reference

#include "Scenario8_PairDevice.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"

Go to the source code of this file.

Classes

struct | Scenario8_PairDevice
struct | Scenario8_PairDevice

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Namespaces

Scenario9_CustomPairDevice.cpp File Reference

#include "pch.h"
#include "Scenario9_CustomPairDevice.h"
#include "DeviceHelpers.h"
#include "SampleConfiguration.h"
#include "Scenario9_CustomPairDevice.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
Classes | Namespaces

Scenario9_CustomPairDevice.h File Reference

#include "Scenario9_CustomPairDevice.g.h"
#include "MainPage.h"
#include "DeviceWatcherHelper.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

struct | Scenario9_CustomPairDevice
struct | Scenario9_CustomPairDevice

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks
Namespaces | Functions

BackgroundDeviceWatcher.cpp File Reference

#include "pch.h"
#include "BackgroundDeviceWatcher.h"
#include "BackgroundDeviceWatcher.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt::BackgroundDeviceWatcherTask::implementation

Functions

void | DebugWriteLine (const hstring &message)
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks
Classes | Namespaces

BackgroundDeviceWatcher.h File Reference

#include "BackgroundDeviceWatcher.g.h"

Go to the source code of this file.

Classes

struct | BackgroundDeviceWatcher
struct | BackgroundDeviceWatcher

Namespaces

namespace | winrt::BackgroundDeviceWatcherTask::factory_implementation
namespace | winrt::BackgroundDeviceWatcherTask::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.idl File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks
Namespaces | Variables

BackgroundDeviceWatcher.idl File Reference

Go to the source code of this file.

Namespaces

namespace | BackgroundDeviceWatcherTask

Variables

runtimeclass | BackgroundDeviceWatcher
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/pch.cpp File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/pch.h File Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.ApplicationModel.Background.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Storage.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/DeviceWatcherHelper.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

DeviceWatcherHelper.cs File Reference

Go to the source code of this file.

Classes

class | DeviceWatcherHelper
Updates an ObservableCollection based on events from a DeviceWatcher. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/DisplayHelpers.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

DisplayHelpers.cs File Reference

Go to the source code of this file.

Classes

class | DeviceInformationDisplay
struct | DeviceInformationKindChoice
class | DeviceInformationKindChoices
class | DeviceSelectorChoices
class | DeviceSelectorInfo
struct | ProtectionLevelSelectorInfo
class | ProtectionSelectorChoices

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/SampleConfiguration.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario1_DevicePicker.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario1_DevicePicker.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DevicePicker
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario2_DeviceWatcher.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario2_DeviceWatcher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DeviceWatcher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario3_BackgroundDeviceWatcher.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario3_BackgroundDeviceWatcher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_BackgroundDeviceWatcher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario4_Snapshot.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario4_Snapshot.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Snapshot
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario5_GetSingleDevice.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario5_GetSingleDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_GetSingleDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario6_CustomFilterAddedProps.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario6_CustomFilterAddedProps.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_CustomFilterAddedProps
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario7_DeviceInformationKind.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario7_DeviceInformationKind.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_DeviceInformationKind
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario8_PairDevice.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario8_PairDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_PairDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
Classes | Namespaces

Scenario9_CustomPairDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9_CustomPairDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Tasks/BackgroundDeviceWatcher.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
  • Tasks
Classes | Namespaces

BackgroundDeviceWatcher.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundDeviceWatcher

Namespaces

namespace | BackgroundDeviceWatcherTaskCs
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • DeviceEnumerationAndPairing
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/pch.cpp File Reference

  • DisablingScreenCapture
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/pch.h File Reference

  • DisablingScreenCapture
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/SampleConfiguration.cpp File Reference

  • DisablingScreenCapture
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/SampleConfiguration.h File Reference

  • DisablingScreenCapture
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario1_Enable.xaml.cpp File Reference

  • DisablingScreenCapture
  • cpp

Scenario1_Enable.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Enable.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario1_Enable.xaml.h File Reference

  • DisablingScreenCapture
  • cpp
Classes | Namespaces

Scenario1_Enable.xaml.h File Reference

#include "Scenario1_Enable.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario2_Disable.xaml.cpp File Reference

  • DisablingScreenCapture
  • cpp

Scenario2_Disable.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Disable.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario2_Disable.xaml.h File Reference

  • DisablingScreenCapture
  • cpp
Classes | Namespaces

Scenario2_Disable.xaml.h File Reference

#include "Scenario2_Disable.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/pch.cpp File Reference

  • DisablingScreenCapture
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/pch.h File Reference

  • DisablingScreenCapture
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Media.Capture.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Project.idl File Reference

  • DisablingScreenCapture
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Enable
runtimeclass | Scenario2_Disable
runtimeclass | Scenario3_AppCapture
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/SampleConfiguration.cpp File Reference

  • DisablingScreenCapture
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/SampleConfiguration.h File Reference

  • DisablingScreenCapture
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario1_Enable.cpp File Reference

  • DisablingScreenCapture
  • cppwinrt
Namespaces

Scenario1_Enable.cpp File Reference

#include "pch.h"
#include "Scenario1_Enable.h"
#include "Scenario1_Enable.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario1_Enable.h File Reference

  • DisablingScreenCapture
  • cppwinrt
Classes | Namespaces

Scenario1_Enable.h File Reference

#include "Scenario1_Enable.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Enable
struct | Scenario1_Enable

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario2_Disable.cpp File Reference

  • DisablingScreenCapture
  • cppwinrt
Namespaces

Scenario2_Disable.cpp File Reference

#include "pch.h"
#include "Scenario2_Disable.h"
#include "Scenario2_Disable.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario2_Disable.h File Reference

  • DisablingScreenCapture
  • cppwinrt
Classes | Namespaces

Scenario2_Disable.h File Reference

#include "Scenario2_Disable.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Disable
struct | Scenario2_Disable

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.cpp File Reference

  • DisablingScreenCapture
  • cppwinrt
Namespaces

Scenario3_AppCapture.cpp File Reference

#include "pch.h"
#include "Scenario3_AppCapture.h"
#include "Scenario3_AppCapture.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario3_AppCapture.h File Reference

  • DisablingScreenCapture
  • cppwinrt
Classes | Namespaces

Scenario3_AppCapture.h File Reference

#include "Scenario3_AppCapture.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_AppCapture
struct | Scenario3_AppCapture

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/SampleConfiguration.cs File Reference

  • DisablingScreenCapture
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/Scenario1_Enable.xaml.cs File Reference

  • DisablingScreenCapture
  • cs
Classes | Namespaces

Scenario1_Enable.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Enable

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/Scenario2_Disable.xaml.cs File Reference

  • DisablingScreenCapture
  • cs
Classes | Namespaces

Scenario2_Disable.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Disable

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/Scenario3_AppCapture.xaml.cs File Reference

  • DisablingScreenCapture
  • cs
Classes | Namespaces

Scenario3_AppCapture.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AppCapture

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/pch.cpp File Reference

  • DisplayOrientation
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/pch.h File Reference

  • DisplayOrientation
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/SampleConfiguration.cpp File Reference

  • DisplayOrientation
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/SampleConfiguration.h File Reference

  • DisplayOrientation
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/Scenario1_Orientation.xaml.cpp File Reference

  • DisplayOrientation
  • cpp

Scenario1_Orientation.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Orientation.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/Scenario1_Orientation.xaml.h File Reference

  • DisplayOrientation
  • cpp
Classes | Namespaces

Scenario1_Orientation.xaml.h File Reference

#include "Scenario1_Orientation.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/pch.cpp File Reference

  • DisplayOrientation
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/pch.h File Reference

  • DisplayOrientation
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Graphics.Display.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/Project.idl File Reference

  • DisplayOrientation
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Orientation
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/SampleConfiguration.cpp File Reference

  • DisplayOrientation
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/SampleConfiguration.h File Reference

  • DisplayOrientation
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/Scenario1_Orientation.cpp File Reference

  • DisplayOrientation
  • cppwinrt
Namespaces

Scenario1_Orientation.cpp File Reference

#include "pch.h"
#include "Scenario1_Orientation.h"
#include "Scenario1_Orientation.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/Scenario1_Orientation.h File Reference

  • DisplayOrientation
  • cppwinrt
Classes | Namespaces

Scenario1_Orientation.h File Reference

#include "Scenario1_Orientation.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Orientation
struct | Scenario1_Orientation

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cs/SampleConfiguration.cs File Reference

  • DisplayOrientation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cs/Scenario1_Orientation.xaml.cs File Reference

  • DisplayOrientation
  • cs
Classes | Namespaces

Scenario1_Orientation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Orientation

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/pch.cpp File Reference

  • DpiScaling
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/pch.h File Reference

  • DpiScaling
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/SampleConfiguration.cpp File Reference

  • DpiScaling
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/SampleConfiguration.h File Reference

  • DpiScaling
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario1.xaml.cpp File Reference

  • DpiScaling
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario1.xaml.h File Reference

  • DpiScaling
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario2.xaml.cpp File Reference

  • DpiScaling
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario2.xaml.h File Reference

  • DpiScaling
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/SampleConfiguration.cs File Reference

  • DpiScaling
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/Scenario1.xaml.cs File Reference

  • DpiScaling
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/Scenario2.xaml.cs File Reference

  • DpiScaling
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/App.cpp File Reference

  • DWriteColorGlyph
  • cpp
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 25 of file App.cpp.

{
    auto directXApplicationSource = ref new DirectXApplicationSource();
    CoreApplication::Run(directXApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/App.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

App.h File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DWriteColorTextRendererMain.h"
#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed
Client side RPC implementation. More...

Namespaces

namespace | DWriteColorTextRenderer
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/CustomTextRenderer.cpp File Reference

  • DWriteColorGlyph
  • cpp
Functions

CustomTextRenderer.cpp File Reference

#include "pch.h"
#include "CustomTextRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Functions

IFACEMETHODIMP_ (unsigned long) CustomTextRenderer

Function Documentation

IFACEMETHODIMP_ ( unsigned long )

Definition at line 237 of file CustomTextRenderer.cpp.

{
    unsigned long newCount = InterlockedDecrement(&m_refCount);
    if (newCount == 0)
    {
        delete this;
        return 0;
    }

    return newCount;
}

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/CustomTextRenderer.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

CustomTextRenderer.h File Reference

#include "DeviceResources.h"

Go to the source code of this file.

Classes

class | CustomTextRenderer

Namespaces

namespace | DWriteColorTextRenderer
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DeviceResources.cpp File Reference

  • DWriteColorGlyph
  • cpp
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DeviceResources.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DirectXHelper.h File Reference

  • DWriteColorGlyph
  • cpp
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererMain.cpp File Reference

  • DWriteColorGlyph
  • cpp

DWriteColorTextRendererMain.cpp File Reference

#include "pch.h"
#include "DWriteColorTextRendererMain.h"
#include <DirectXColors.h>
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererMain.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

DWriteColorTextRendererMain.h File Reference

#include "DeviceResources.h"
#include "DWriteColorTextRendererRenderer.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Classes

class | DWriteColorTextRendererMain

Namespaces

namespace | DWriteColorTextRenderer
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.cpp File Reference

  • DWriteColorGlyph
  • cpp

DWriteColorTextRendererRenderer.cpp File Reference

#include "pch.h"
#include "DWriteColorTextRendererRenderer.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

DWriteColorTextRendererRenderer.h File Reference

#include "DeviceResources.h"
#include "CustomTextRenderer.h"

Go to the source code of this file.

Classes

class | DWriteColorTextRendererRenderer

Namespaces

namespace | DWriteColorTextRenderer
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/pch.cpp File Reference

  • DWriteColorGlyph
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/pch.h File Reference

  • DWriteColorGlyph
  • cpp
Defines

pch.h File Reference

#include <wrl.h>
#include <wrl/client.h>
#include <d3d11_2.h>
#include <d2d1_3.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <DirectXMath.h>
#include <memory>
#include <ppltasks.h>

Go to the source code of this file.

Defines

#define NTDDI_VERSION NTDDI_WIN10_RS1

Define Documentation

#define NTDDI_VERSION NTDDI_WIN10_RS1

Definition at line 11 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/SampleOverlay.cpp File Reference

  • DWriteColorGlyph
  • cpp

SampleOverlay.cpp File Reference

#include "pch.h"
#include "SampleOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/SampleOverlay.h File Reference

  • DWriteColorGlyph
  • cpp
Classes | Namespaces

SampleOverlay.h File Reference

#include "DirectXHelper.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Classes

class | SampleOverlay

Namespaces

namespace | DWriteColorTextRenderer
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/pch.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/pch.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

Scenario1_DefaultSpacing.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DefaultSpacing.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes
Classes | Namespaces

Scenario1_DefaultSpacing.xaml.h File Reference

#include "Scenario1_DefaultSpacing.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario2_UniformSpacing.xaml.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

Scenario2_UniformSpacing.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_UniformSpacing.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario2_UniformSpacing.xaml.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes
Classes | Namespaces

Scenario2_UniformSpacing.xaml.h File Reference

#include "Scenario2_UniformSpacing.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario3_ProportionalSpacing.xaml.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

Scenario3_ProportionalSpacing.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ProportionalSpacing.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario3_ProportionalSpacing.xaml.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes
Classes | Namespaces

Scenario3_ProportionalSpacing.xaml.h File Reference

#include "Scenario3_ProportionalSpacing.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/DirectXHelper.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation
Namespaces | Functions

DirectXHelper.h File Reference

#include "pch.h"
#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | DX

Functions

D2D1_COLOR_F | ConvertToColorF (Windows::UI::Color color)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/pch.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/pch.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <dwrite_3.h>
#include <math.h>
#include <windows.ui.xaml.media.dxinterop.h>
#include <string>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayout.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

TextLayout.cpp File Reference

#include "pch.h"
#include "TextLayout.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayout.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation
Classes | Namespaces | Enumerations

TextLayout.h File Reference

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | DWriteTextLayoutImplementation

Enumerations

enum | FontLineGapUsage { Default = DWRITE_LINE_SPACING_METHOD_DEFAULT, Disabled = DWRITE_FONT_LINE_GAP_USAGE_DISABLED, Enabled = DWRITE_FONT_LINE_GAP_USAGE_ENABLED }
enum | LineSpacingMethod { Default = DWRITE_LINE_SPACING_METHOD_DEFAULT, Uniform = DWRITE_LINE_SPACING_METHOD_UNIFORM, Proportional = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL }
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.cpp File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

TextLayoutImageSource.cpp File Reference

#include "pch.h"
#include "TextLayoutImageSource.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.h File Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation
Classes | Namespaces

TextLayoutImageSource.h File Reference

#include "TextLayout.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | DWriteTextLayoutImplementation
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

DocumentPresenter.cpp File Reference

#include "pch.h"
#include "DocumentPresenter.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

DocumentPresenter.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/pch.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/pch.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_CloudFontOverview.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_CloudFontOverview.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

Scenario_CloudFontOverview.xaml.h File Reference

#include "Scenario_CloudFontOverview.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_Document1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document1.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

Scenario_Document1.xaml.h File Reference

#include "Scenario_Document1.g.h"
#include "MainPage.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_Document2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document2.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

Scenario_Document2.xaml.h File Reference

#include "Scenario_Document2.g.h"
#include "MainPage.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_Document3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document3.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document3.xaml.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

Scenario_Document3.xaml.h File Reference

#include "Scenario_Document3.g.h"
#include "MainPage.xaml.h"
#include "DocumentPresenter.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_SampleOverview.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SampleOverview.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont
Classes | Namespaces

Scenario_SampleOverview.xaml.h File Reference

#include "Scenario_SampleOverview.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/DirectXHelper.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Namespaces | Functions

DirectXHelper.h File Reference

#include "pch.h"
#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | DX

Functions

D2D1_COLOR_F | ConvertToColorF (Windows::UI::Color color)
int | DipsToPixels (float size, float dpi)
int | DipsToPixelsCeil (float size, float dpi)
int | DipsToPixelsFloor (float size, float dpi)
float | PixelsToDips (int size, float dpi)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Variables

FontDownloadListener.cpp File Reference

#include "pch.h"
#include "FontDownloadListener.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Variables

FontDownloadListener g_listener

Variable Documentation

FontDownloadListener g_listener

Definition at line 21 of file FontDownloadListener.cpp.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontDownloadListener.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Classes | Namespaces | Functions

FontDownloadListener.h File Reference

#include "TextLayout.h"

Go to the source code of this file.

Classes

class | Listener
class | sealed

Namespaces

namespace | DWriteTextLayoutCloudFontImplementation

Functions

public delegate void | FontDownloadCompletedHandler ()
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

FontNameCollector.cpp File Reference

#include "pch.h"
#include "FontNameCollector.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/FontNameCollector.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Classes | Namespaces

FontNameCollector.h File Reference

Go to the source code of this file.

Classes

class | FontNameCollector

Namespaces

namespace | DWriteTextLayoutCloudFontImplementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/pch.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/pch.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <dwrite_3.h>
#include <math.h>
#include <windows.ui.xaml.media.dxinterop.h>
#include <string>
#include <set>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

TextLayout.cpp File Reference

#include "pch.h"
#include "TextLayout.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Classes | Namespaces

TextLayout.h File Reference

#include "FontNameCollector.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | DWriteTextLayoutCloudFontImplementation
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.cpp File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

TextLayoutImageSource.cpp File Reference

#include "pch.h"
#include "TextLayoutImageSource.h"
#include "DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.h File Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation
Classes | Namespaces

TextLayoutImageSource.h File Reference

#include "TextLayout.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | DWriteTextLayoutCloudFontImplementation
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/SampleConfiguration.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario10_CpToClipboard.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario10_CpToClipboard.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10_CpToClipboard

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario11_CPDNoUI.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario11_CPDNoUI.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11_CPDNoUI

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario12_ShareData.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario12_ShareData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario12_ShareData

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario13_ShareTarget.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario13_ShareTarget.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario13_ShareTarget

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario14_QueryCpPaste.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario14_QueryCpPaste.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario14_QueryCpPaste
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario15_DPLFileCreateEvents.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario15_DPLFileCreateEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario15_DPLCreateFileEvents
Registering a background task and notification channel for raw notifications. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario16_NetworkResource.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario16_NetworkResource.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario16_NetworkResource
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario1_Setup.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario1_Setup.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario2_IdManaged.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario2_IdManaged.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario3_UIPolicy.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario3_UIPolicy.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario4_FilePMgr.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario4_FilePMgr.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario5_Revoke.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario5_Revoke.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario6_ProtectBuffer.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario6_ProtectBuffer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario7_ProtectStream.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario7_ProtectStream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario8_ClipboardSource.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario8_ClipboardSource.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_ClipboardSource

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario9_ClipboardTarget.xaml.cs File Reference

  • EnterpriseDataProtection
  • cs
Classes | Namespaces

Scenario9_ClipboardTarget.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9_ClipboardTarget

Namespaces

namespace | EdpSample
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/EdpBackgroundTask.cs File Reference

  • EnterpriseDataProtection
  • cs
  • Tasks
Classes | Namespaces

EdpBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | EdpBackgroundTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • EnterpriseDataProtection
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/pch.cpp File Reference

  • ExtendedExecution
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/pch.h File Reference

  • ExtendedExecution
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/SampleConfiguration.cpp File Reference

  • ExtendedExecution
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/SampleConfiguration.h File Reference

  • ExtendedExecution
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Helpers

Functions

Concurrency::task< void > | DelayAsync (Windows::Foundation::TimeSpan duration, Concurrency::cancellation_token cancel=Concurrency::cancellation_token::none())
Windows::Foundation::TimeSpan | TimeSpanFromSeconds (int seconds)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.cpp File Reference

  • ExtendedExecution
  • cpp

Scenario1_UnspecifiedReason.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_UnspecifiedReason.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.h File Reference

  • ExtendedExecution
  • cpp
Classes | Namespaces

Scenario1_UnspecifiedReason.xaml.h File Reference

#include "Scenario1_UnspecifiedReason.g.h"
#include "MainPage.xaml.h"
#include <time.h>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.cpp File Reference

  • ExtendedExecution
  • cpp

Scenario2_SavingDataReason.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_SavingDataReason.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.h File Reference

  • ExtendedExecution
  • cpp
Classes | Namespaces

Scenario2_SavingDataReason.xaml.h File Reference

#include "Scenario2_SavingDataReason.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.cpp File Reference

  • ExtendedExecution
  • cpp

Scenario3_LocationTrackingReason.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_LocationTrackingReason.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.h File Reference

  • ExtendedExecution
  • cpp
Classes | Namespaces

Scenario3_LocationTrackingReason.xaml.h File Reference

#include "Scenario3_LocationTrackingReason.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.cpp File Reference

  • ExtendedExecution
  • cpp

Scenario4_MultipleTasks.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_MultipleTasks.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.h File Reference

  • ExtendedExecution
  • cpp
Classes | Namespaces

Scenario4_MultipleTasks.xaml.h File Reference

#include "Scenario4_MultipleTasks.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/SampleConfiguration.cs File Reference

  • ExtendedExecution
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/Scenario1_UnspecifiedReason.xaml.cs File Reference

  • ExtendedExecution
  • cs
Classes | Namespaces

Scenario1_UnspecifiedReason.xaml.cs File Reference

Go to the source code of this file.

Classes

class | UnspecifiedReason
Page containing the Extended Execution Unspecified Reason scenario functions. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/Scenario2_SavingDataReason.xaml.cs File Reference

  • ExtendedExecution
  • cs
Classes | Namespaces

Scenario2_SavingDataReason.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SavingDataReason
Page containing the Extended Execution SavingData Reason scenario functions. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/Scenario3_LocationTrackingReason.xaml.cs File Reference

  • ExtendedExecution
  • cs
Classes | Namespaces

Scenario3_LocationTrackingReason.xaml.cs File Reference

Go to the source code of this file.

Classes

class | LocationTrackingReason
Page containing the Extended Execution LocationTracking Reason scenario functions. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/Scenario4_MultipleTasks.xaml.cs File Reference

  • ExtendedExecution
  • cs
Classes | Namespaces

Scenario4_MultipleTasks.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MultipleTasks

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/pch.cpp File Reference

  • FileAccess
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/pch.h File Reference

  • FileAccess
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/SampleConfiguration.cpp File Reference

  • FileAccess
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/SampleConfiguration.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario10_Delete.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario10_Delete.xaml.cpp File Reference

#include "pch.h"
#include "Scenario10_Delete.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario10_Delete.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario10_Delete.xaml.h File Reference

#include "pch.h"
#include "Scenario10_Delete.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario11_TryGet.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario11_TryGet.xaml.cpp File Reference

#include "pch.h"
#include "Scenario11_TryGet.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario11_TryGet.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario11_TryGet.xaml.h File Reference

#include "pch.h"
#include "Scenario11_TryGet.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario1_Create.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario1_Create.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Create.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario1_Create.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario1_Create.xaml.h File Reference

#include "pch.h"
#include "Scenario1_Create.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario2_GetParent.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario2_GetParent.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_GetParent.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario2_GetParent.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario2_GetParent.xaml.h File Reference

#include "pch.h"
#include "Scenario2_GetParent.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario3_Text.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario3_Text.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Text.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario3_Text.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario3_Text.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Text.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario4_Bytes.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario4_Bytes.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Bytes.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario4_Bytes.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario4_Bytes.xaml.h File Reference

#include "pch.h"
#include "Scenario4_Bytes.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario5_Stream.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario5_Stream.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_Stream.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario5_Stream.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario5_Stream.xaml.h File Reference

#include "pch.h"
#include "Scenario5_Stream.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario6_Properties.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario6_Properties.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_Properties.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario6_Properties.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario6_Properties.xaml.h File Reference

#include "pch.h"
#include "Scenario6_Properties.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario7_FutureAccess.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario7_FutureAccess.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_FutureAccess.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario7_FutureAccess.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario7_FutureAccess.xaml.h File Reference

#include "pch.h"
#include "Scenario7_FutureAccess.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario8_Copy.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario8_Copy.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8_Copy.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario8_Copy.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario8_Copy.xaml.h File Reference

#include "pch.h"
#include "Scenario8_Copy.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario9_Compare.xaml.cpp File Reference

  • FileAccess
  • cpp

Scenario9_Compare.xaml.cpp File Reference

#include "pch.h"
#include "Scenario9_Compare.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario9_Compare.xaml.h File Reference

  • FileAccess
  • cpp
Classes | Namespaces

Scenario9_Compare.xaml.h File Reference

#include "pch.h"
#include "Scenario9_Compare.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/pch.cpp File Reference

  • FileAccess
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/pch.h File Reference

  • FileAccess
  • cppwinrt
Defines

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.DateTimeFormatting.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.AccessCache.h"
#include "winrt/Windows.Storage.FileProperties.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Defines

#define NOMINMAX

Define Documentation

#define NOMINMAX

Definition at line 3 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Project.idl File Reference

  • FileAccess
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1
runtimeclass | Scenario10
runtimeclass | Scenario11
runtimeclass | Scenario2
runtimeclass | Scenario3
runtimeclass | Scenario4
runtimeclass | Scenario5
runtimeclass | Scenario6
runtimeclass | Scenario7
runtimeclass | Scenario8
runtimeclass | Scenario9
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/SampleConfiguration.cpp File Reference

  • FileAccess
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/SampleConfiguration.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | SampleState

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario1.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario1.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario10.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario10.cpp File Reference

#include "pch.h"
#include "Scenario10.h"
#include "Scenario10.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario10.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario10.h File Reference

#include "Scenario10.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario10
struct | Scenario10

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario11.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario11.cpp File Reference

#include "pch.h"
#include "Scenario11.h"
#include "Scenario11.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario11.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario11.h File Reference

#include "Scenario11.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario11
struct | Scenario11

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario2.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario2.cpp File Reference

#include "pch.h"
#include "Scenario2.h"
#include "Scenario2.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario2.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario2.h File Reference

#include "Scenario2.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2
struct | Scenario2
Getting a file's parent folder. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario3.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario3.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "Scenario3.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario4.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario4.cpp File Reference

#include "pch.h"
#include "Scenario4.h"
#include "Scenario4.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario4.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario4.h File Reference

#include "Scenario4.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4
struct | Scenario4
Writing and reading bytes in a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario5.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario5.cpp File Reference

#include "pch.h"
#include "Scenario5.h"
#include "Scenario5.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario5.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario5.h File Reference

#include "Scenario5.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5
struct | Scenario5
Writing and reading using a stream. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario6.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario6.cpp File Reference

#include "pch.h"
#include "Scenario6.h"
#include "Scenario6.g.cpp"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario6.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario6.h File Reference

#include "Scenario6.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario6
struct | Scenario6
Displaying file properties. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario7.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario7.cpp File Reference

#include "pch.h"
#include "Scenario7.h"
#include "Scenario7.g.cpp"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario7.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario7.h File Reference

#include "Scenario7.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario7
struct | Scenario7
Persisting access to a storage item for future use. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario8.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario8.cpp File Reference

#include "pch.h"
#include "Scenario8.h"
#include "Scenario8.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario8.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario8.h File Reference

#include "Scenario8.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario8
struct | Scenario8
Copying a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario9.cpp File Reference

  • FileAccess
  • cppwinrt
Namespaces

Scenario9.cpp File Reference

#include "pch.h"
#include "Scenario9.h"
#include "Scenario9.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario9.h File Reference

  • FileAccess
  • cppwinrt
Classes | Namespaces

Scenario9.h File Reference

#include "Scenario9.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario9
struct | Scenario9

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/SampleConfiguration.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario10_Delete.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario10_Delete.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario11_TryGet.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario11_TryGet.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario1_Create.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario1_Create.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario2_GetParent.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario2_GetParent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario3_Text.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario3_Text.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario4_Bytes.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario4_Bytes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario5_Stream.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario5_Stream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario6_Properties.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario6_Properties.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario7_FutureAccess.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario7_FutureAccess.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario8_Copy.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario8_Copy.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario9_Compare.xaml.cs File Reference

  • FileAccess
  • cs
Classes | Namespaces

Scenario9_Compare.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/pch.cpp File Reference

  • FilePicker
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/pch.h File Reference

  • FilePicker
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/SampleConfiguration.cpp File Reference

  • FilePicker
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/SampleConfiguration.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario1_SingleFile.xaml.cpp File Reference

  • FilePicker
  • cpp

Scenario1_SingleFile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SingleFile.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario1_SingleFile.xaml.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

Scenario1_SingleFile.xaml.h File Reference

#include "pch.h"
#include "Scenario1_SingleFile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario2_MultiFile.xaml.cpp File Reference

  • FilePicker
  • cpp

Scenario2_MultiFile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_MultiFile.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario2_MultiFile.xaml.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

Scenario2_MultiFile.xaml.h File Reference

#include "pch.h"
#include "Scenario2_MultiFile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario3_SingleFolder.xaml.cpp File Reference

  • FilePicker
  • cpp

Scenario3_SingleFolder.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_SingleFolder.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario3_SingleFolder.xaml.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

Scenario3_SingleFolder.xaml.h File Reference

#include "pch.h"
#include "Scenario3_SingleFolder.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario4_SaveFile.xaml.cpp File Reference

  • FilePicker
  • cpp

Scenario4_SaveFile.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_SaveFile.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario4_SaveFile.xaml.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

Scenario4_SaveFile.xaml.h File Reference

#include "pch.h"
#include "Scenario4_SaveFile.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario5_TriggerCFU.xaml.cpp File Reference

  • FilePicker
  • cpp

Scenario5_TriggerCFU.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_TriggerCFU.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario5_TriggerCFU.xaml.h File Reference

  • FilePicker
  • cpp
Classes | Namespaces

Scenario5_TriggerCFU.xaml.h File Reference

#include "pch.h"
#include "Scenario5_TriggerCFU.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/pch.cpp File Reference

  • FilePicker
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/pch.h File Reference

  • FilePicker
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.AccessCache.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Pickers.Provider.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Project.idl File Reference

  • FilePicker
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_SingleFile
runtimeclass | Scenario2_MultiFile
runtimeclass | Scenario3_SingleFolder
runtimeclass | Scenario4_SaveFile
runtimeclass | Scenario5_TriggerCFU
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/SampleConfiguration.cpp File Reference

  • FilePicker
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/SampleConfiguration.h File Reference

  • FilePicker
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario1_SingleFile.cpp File Reference

  • FilePicker
  • cppwinrt
Namespaces

Scenario1_SingleFile.cpp File Reference

#include "pch.h"
#include "Scenario1_SingleFile.h"
#include "Scenario1_SingleFile.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario1_SingleFile.h File Reference

  • FilePicker
  • cppwinrt
Classes | Namespaces

Scenario1_SingleFile.h File Reference

#include "Scenario1_SingleFile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_SingleFile
struct | Scenario1_SingleFile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario2_MultiFile.cpp File Reference

  • FilePicker
  • cppwinrt
Namespaces

Scenario2_MultiFile.cpp File Reference

#include "pch.h"
#include "Scenario2_MultiFile.h"
#include <sstream>
#include "Scenario2_MultiFile.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario2_MultiFile.h File Reference

  • FilePicker
  • cppwinrt
Classes | Namespaces

Scenario2_MultiFile.h File Reference

#include "Scenario2_MultiFile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_MultiFile
struct | Scenario2_MultiFile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario3_SingleFolder.cpp File Reference

  • FilePicker
  • cppwinrt
Namespaces

Scenario3_SingleFolder.cpp File Reference

#include "pch.h"
#include "Scenario3_SingleFolder.h"
#include "Scenario3_SingleFolder.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario3_SingleFolder.h File Reference

  • FilePicker
  • cppwinrt
Classes | Namespaces

Scenario3_SingleFolder.h File Reference

#include "Scenario3_SingleFolder.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_SingleFolder
struct | Scenario3_SingleFolder

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario4_SaveFile.cpp File Reference

  • FilePicker
  • cppwinrt
Namespaces

Scenario4_SaveFile.cpp File Reference

#include "pch.h"
#include "Scenario4_SaveFile.h"
#include "Scenario4_SaveFile.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario4_SaveFile.h File Reference

  • FilePicker
  • cppwinrt
Classes | Namespaces

Scenario4_SaveFile.h File Reference

#include "Scenario4_SaveFile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_SaveFile
struct | Scenario4_SaveFile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario5_TriggerCFU.cpp File Reference

  • FilePicker
  • cppwinrt
Namespaces

Scenario5_TriggerCFU.cpp File Reference

#include "pch.h"
#include "Scenario5_TriggerCFU.h"
#include "Scenario5_TriggerCFU.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario5_TriggerCFU.h File Reference

  • FilePicker
  • cppwinrt
Classes | Namespaces

Scenario5_TriggerCFU.h File Reference

#include "Scenario5_TriggerCFU.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5_TriggerCFU
struct | Scenario5_TriggerCFU

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/SampleConfiguration.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario1_SingleFile.xaml.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

Scenario1_SingleFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SingleFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario2_MultiFile.xaml.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

Scenario2_MultiFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_MultiFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario3_SingleFolder.xaml.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

Scenario3_SingleFolder.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_SingleFolder
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario4_SaveFile.xaml.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

Scenario4_SaveFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_SaveFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario5_TriggerCFU.xaml.cs File Reference

  • FilePicker
  • cs
Classes | Namespaces

Scenario5_TriggerCFU.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_TriggerCFU

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/App.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/App.xaml.custom.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

App.xaml.custom.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/CachedFileUpdater_Local.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

CachedFileUpdater_Local.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CachedFileUpdater_Local
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/CachedFileUpdater_Remote.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

CachedFileUpdater_Remote.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CachedFileUpdater_Remote
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/CachedFileUpdaterPage.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

CachedFileUpdaterPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CachedFileUpdaterPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | CachedFileUpdaterPageSizeChangedEventArgs

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileOpenPicker_PickAppFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileOpenPicker_PickAppFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileOpenPicker_PickAppFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileOpenPicker_PickCachedFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileOpenPicker_PickCachedFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileOpenPicker_PickCachedFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileOpenPicker_PickURLFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileOpenPicker_PickURLFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileOpenPicker_PickURLFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileOpenPickerPage.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileOpenPickerPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileOpenPickerPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_FailToSave.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileSavePicker_FailToSave.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileSavePicker_FailToSave
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_SaveToAppStorage.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileSavePicker_SaveToAppStorage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileSavePicker_SaveToAppStorage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_SaveToCachedFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileSavePicker_SaveToCachedFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileSavePicker_SaveToCachedFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePickerPage.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

FileSavePickerPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | FileSavePickerPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | FileSavePickerPageSizeChangedEventArgs

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/MainPage.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/MainPage_CachedFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

MainPage_CachedFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage_CachedFile

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/MainPage_PickFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

MainPage_PickFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage_PickFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/MainPage_SaveFile.xaml.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

MainPage_SaveFile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage_SaveFile
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FilePickerContracts
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/SampleConfiguration.cs File Reference

  • FilePickerContracts
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | Status

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/Tasks/UpdateFileTask.cs File Reference

  • FilePickerContracts
  • cs
  • Tasks
Classes | Namespaces

UpdateFileTask.cs File Reference

Go to the source code of this file.

Classes

class | UpdateFileTask

Namespaces

namespace | FilePickerContractsTasks
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/pch.cpp File Reference

  • FileSearch
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/pch.h File Reference

  • FileSearch
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/SampleConfiguration.cpp File Reference

  • FileSearch
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/SampleConfiguration.h File Reference

  • FileSearch
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/Scenario1.xaml.cpp File Reference

  • FileSearch
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/Scenario1.xaml.h File Reference

  • FileSearch
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/pch.cpp File Reference

  • FileSearch
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/pch.h File Reference

  • FileSearch
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Search.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/Project.idl File Reference

  • FileSearch
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/SampleConfiguration.cpp File Reference

  • FileSearch
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/SampleConfiguration.h File Reference

  • FileSearch
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/Scenario1.cpp File Reference

  • FileSearch
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/Scenario1.h File Reference

  • FileSearch
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cs/SampleConfiguration.cs File Reference

  • FileSearch
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cs/Scenario1.xaml.cs File Reference

  • FileSearch
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/pch.cpp File Reference

  • FileThumbnails
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/pch.h File Reference

  • FileThumbnails
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/SampleConfiguration.cpp File Reference

  • FileThumbnails
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/SampleConfiguration.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"
#include <collection.h>

Go to the source code of this file.

Classes

class | Errors
class | FileExtensions
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario1.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario1.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario2.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario2.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario3.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario3.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario4.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario4.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario5.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario5.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario5.xaml.h File Reference

#include "pch.h"
#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario6.xaml.cpp File Reference

  • FileThumbnails
  • cpp

Scenario6.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario6.xaml.h File Reference

  • FileThumbnails
  • cpp
Classes | Namespaces

Scenario6.xaml.h File Reference

#include "pch.h"
#include "Scenario6.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/pch.cpp File Reference

  • FileThumbnails
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/pch.h File Reference

  • FileThumbnails
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.FileProperties.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Search.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Project.idl File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/SampleConfiguration.cpp File Reference

  • FileThumbnails
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/SampleConfiguration.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Errors
struct | FileExtensions
struct | Helpers

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

hstring | to_hstring (Windows::Storage::FileProperties::ThumbnailMode thumbnailMode)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario1.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario1.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario2.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Scenario2.cpp File Reference

#include "pch.h"
#include "Scenario2.h"
#include "Scenario2.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario2.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario2.h File Reference

#include "Scenario2.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2
struct | Scenario2
Getting a file's parent folder. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario3.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario3.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "Scenario3.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario4.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Scenario4.cpp File Reference

#include "pch.h"
#include "Scenario4.h"
#include "Scenario4.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario4.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario4.h File Reference

#include "Scenario4.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4
struct | Scenario4
Writing and reading bytes in a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario5.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces

Scenario5.cpp File Reference

#include "pch.h"
#include "Scenario5.h"
#include "Scenario5.g.cpp"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario5.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario5.h File Reference

#include "Scenario5.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5
struct | Scenario5
Writing and reading using a stream. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario6.cpp File Reference

  • FileThumbnails
  • cppwinrt
Namespaces | Functions

Scenario6.cpp File Reference

#include "pch.h"
#include "Scenario6.h"
#include "Scenario6.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario6.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

bool | TryParseUInt (const wchar_t *str, uint32_t &result)
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario6.h File Reference

  • FileThumbnails
  • cppwinrt
Classes | Namespaces

Scenario6.h File Reference

#include "Scenario6.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario6
struct | Scenario6
Displaying file properties. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/SampleConfiguration.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | Errors
class | FileExtensions
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario1.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario2.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario3.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario4.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario5.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario6.xaml.cs File Reference

  • FileThumbnails
  • cs
Classes | Namespaces

Scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/pch.cpp File Reference

  • FolderEnumeration
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/pch.h File Reference

  • FolderEnumeration
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/SampleConfiguration.cpp File Reference

  • FolderEnumeration
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/SampleConfiguration.h File Reference

  • FolderEnumeration
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario1.xaml.cpp File Reference

  • FolderEnumeration
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario1.xaml.h File Reference

  • FolderEnumeration
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario2.xaml.cpp File Reference

  • FolderEnumeration
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario2.xaml.h File Reference

  • FolderEnumeration
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario3.xaml.cpp File Reference

  • FolderEnumeration
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario3.xaml.h File Reference

  • FolderEnumeration
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario4.xaml.cpp File Reference

  • FolderEnumeration
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario4.xaml.h File Reference

  • FolderEnumeration
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/pch.cpp File Reference

  • FolderEnumeration
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/pch.h File Reference

  • FolderEnumeration
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.FileProperties.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Search.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Project.idl File Reference

  • FolderEnumeration
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/SampleConfiguration.cpp File Reference

  • FolderEnumeration
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/SampleConfiguration.h File Reference

  • FolderEnumeration
  • cppwinrt
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | Helpers

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario1.cpp File Reference

  • FolderEnumeration
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario1.h File Reference

  • FolderEnumeration
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario2.cpp File Reference

  • FolderEnumeration
  • cppwinrt
Namespaces

Scenario2.cpp File Reference

#include "pch.h"
#include "Scenario2.h"
#include "Scenario2.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario2.h File Reference

  • FolderEnumeration
  • cppwinrt
Classes | Namespaces

Scenario2.h File Reference

#include "Scenario2.g.h"

Go to the source code of this file.

Classes

struct | Scenario2
struct | Scenario2
Getting a file's parent folder. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario3.cpp File Reference

  • FolderEnumeration
  • cppwinrt
Namespaces

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario3.h File Reference

  • FolderEnumeration
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "Scenario3.g.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario4.cpp File Reference

  • FolderEnumeration
  • cppwinrt
Namespaces

Scenario4.cpp File Reference

#include "pch.h"
#include "Scenario4.h"
#include "Scenario4.g.cpp"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario4.h File Reference

  • FolderEnumeration
  • cppwinrt
Classes | Namespaces

Scenario4.h File Reference

#include "Scenario4.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4
struct | Scenario4
Writing and reading bytes in a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/SampleConfiguration.cs File Reference

  • FolderEnumeration
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/Scenario1.xaml.cs File Reference

  • FolderEnumeration
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/Scenario2.xaml.cs File Reference

  • FolderEnumeration
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/Scenario3.xaml.cs File Reference

  • FolderEnumeration
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/Scenario4.xaml.cs File Reference

  • FolderEnumeration
  • cs
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/pch.cpp File Reference

  • FullScreenMode
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/pch.h File Reference

  • FullScreenMode
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/SampleConfiguration.cpp File Reference

  • FullScreenMode
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/SampleConfiguration.h File Reference

  • FullScreenMode
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario1_Basic.xaml.cpp File Reference

  • FullScreenMode
  • cpp

Scenario1_Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario1_Basic.xaml.h File Reference

  • FullScreenMode
  • cpp
Classes | Namespaces

Scenario1_Basic.xaml.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario2_Launch.xaml.cpp File Reference

  • FullScreenMode
  • cpp

Scenario2_Launch.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Launch.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario2_Launch.xaml.h File Reference

  • FullScreenMode
  • cpp
Classes | Namespaces

Scenario2_Launch.xaml.h File Reference

#include "Scenario2_Launch.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/pch.cpp File Reference

  • FullScreenMode
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/pch.h File Reference

  • FullScreenMode
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Input.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Project.idl File Reference

  • FullScreenMode
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Basic
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/SampleConfiguration.cpp File Reference

  • FullScreenMode
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/SampleConfiguration.h File Reference

  • FullScreenMode
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario1_Basic.cpp File Reference

  • FullScreenMode
  • cppwinrt
Namespaces

Scenario1_Basic.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.h"
#include "Scenario1_Basic.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario1_Basic.h File Reference

  • FullScreenMode
  • cppwinrt
Classes | Namespaces

Scenario1_Basic.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Basic
struct | Scenario1_Basic

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario2_Launch.cpp File Reference

  • FullScreenMode
  • cppwinrt
Namespaces

Scenario2_Launch.cpp File Reference

#include "pch.h"
#include "Scenario2_Launch.h"
#include "Scenario2_Launch.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario2_Launch.h File Reference

  • FullScreenMode
  • cppwinrt
Classes | Namespaces

Scenario2_Launch.h File Reference

#include "Scenario2_Launch.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Launch
struct | Scenario2_Launch

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/SampleConfiguration.cs File Reference

  • FullScreenMode
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/Scenario1_Basic.xaml.cs File Reference

  • FullScreenMode
  • cs
Classes | Namespaces

Scenario1_Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basic

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/Scenario2_Launch.xaml.cs File Reference

  • FullScreenMode
  • cs
Classes | Namespaces

Scenario2_Launch.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Launch

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/pch.cpp File Reference

  • Geolocation
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/pch.h File Reference

  • Geolocation
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include <winrt/BackgroundTask.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.ApplicationModel.Background.h>
#include <winrt/Windows.Data.Json.h>
#include <winrt/Windows.Devices.Geolocation.h>
#include <winrt/Windows.Devices.Geolocation.Geofencing.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Globalization.DateTimeFormatting.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Project.idl File Reference

  • Geolocation
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_TrackPosition
runtimeclass | Scenario2_GetPosition
runtimeclass | Scenario3_BackgroundTask
runtimeclass | Scenario4_ForegroundGeofence
runtimeclass | Scenario5_GeofenceBackgroundTask
runtimeclass | Scenario6_GetLastVisit
runtimeclass | Scenario7_ForegroundVisits
runtimeclass | Scenario8_VisitsBackgroundTask
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/SampleConfiguration.cpp File Reference

  • Geolocation
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/SampleConfiguration.h File Reference

  • Geolocation
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

fire_and_forget | CheckBackgroundAndRequestLocationAccess ()
void | FillItemsFromSavedJson (Windows::UI::Xaml::Controls::ItemsControl const &itemsControl, hstring const &key)
hstring | FormatDateTime (Windows::Foundation::DateTime value, hstring const &format)
Windows::ApplicationModel::Background::IBackgroundTaskRegistration | LookupBackgroundTask (hstring const &name)
void | ReportSavedStatus ()
hstring | to_hstring (Windows::Devices::Geolocation::VisitStateChange value)
hstring | to_hstring (Windows::Foundation::TimeSpan value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceRemovalReason value)
hstring | to_hstring (Windows::Foundation::IReference< double > const &value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceMonitorStatus value)
hstring | to_hstring (Windows::Devices::Geolocation::Geofencing::GeofenceState value)
hstring | to_hstring (Windows::Devices::Geolocation::PositionSource value)
hstring | to_message ()
bool | TryParseDouble (const wchar_t *str, double &result)
bool | TryParseUInt (const wchar_t *str, uint32_t &result)
wchar_t * | TryParseUIntPrefix (const wchar_t *str, uint32_t &result)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario1_TrackPosition.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario1_TrackPosition.cpp File Reference

#include "pch.h"
#include "Scenario1_TrackPosition.h"
#include "Scenario1_TrackPosition.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario1_TrackPosition.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario1_TrackPosition.h File Reference

#include "Scenario1_TrackPosition.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_TrackPosition
struct | Scenario1_TrackPosition

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario2_GetPosition.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario2_GetPosition.cpp File Reference

#include "pch.h"
#include "Scenario2_GetPosition.h"
#include "Scenario2_GetPosition.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario2_GetPosition.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario2_GetPosition.h File Reference

#include "Scenario2_GetPosition.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_GetPosition
struct | Scenario2_GetPosition

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario3_BackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario3_BackgroundTask.cpp File Reference

#include "pch.h"
#include "Scenario3_BackgroundTask.h"
#include "Scenario3_BackgroundTask.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario3_BackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario3_BackgroundTask.h File Reference

#include "Scenario3_BackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_BackgroundTask
struct | Scenario3_BackgroundTask

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario4_ForegroundGeofence.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces | Functions

Scenario4_ForegroundGeofence.cpp File Reference

#include "pch.h"
#include "Scenario4_ForegroundGeofence.h"
#include "Scenario4_ForegroundGeofence.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario4_ForegroundGeofence.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

TimeSpan | LocalTimeOfDay (DateTime dateTime)
template<typename T , typename U >
void | RemoveByValue (T &&collection, U &&value)
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario4_ForegroundGeofence.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario4_ForegroundGeofence.h File Reference

#include "Scenario4_ForegroundGeofence.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_ForegroundGeofence
struct | Scenario4_ForegroundGeofence

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario5_GeofenceBackgroundTask.cpp File Reference

#include "pch.h"
#include "Scenario5_GeofenceBackgroundTask.h"
#include "Scenario5_GeofenceBackgroundTask.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario5_GeofenceBackgroundTask.h File Reference

#include "Scenario5_GeofenceBackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_GeofenceBackgroundTask
struct | Scenario5_GeofenceBackgroundTask

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario6_GetLastVisit.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario6_GetLastVisit.cpp File Reference

#include "pch.h"
#include "Scenario6_GetLastVisit.h"
#include "Scenario6_GetLastVisit.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario6_GetLastVisit.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario6_GetLastVisit.h File Reference

#include "Scenario6_GetLastVisit.g.h"

Go to the source code of this file.

Classes

struct | Scenario6_GetLastVisit
struct | Scenario6_GetLastVisit

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario7_ForegroundVisits.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario7_ForegroundVisits.cpp File Reference

#include "pch.h"
#include "Scenario7_ForegroundVisits.h"
#include "Scenario7_ForegroundVisits.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario7_ForegroundVisits.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario7_ForegroundVisits.h File Reference

#include "Scenario7_ForegroundVisits.g.h"

Go to the source code of this file.

Classes

struct | Scenario7_ForegroundVisits
struct | Scenario7_ForegroundVisits

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
Namespaces

Scenario8_VisitsBackgroundTask.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario8_VisitsBackgroundTask.h"
#include "Scenario8_VisitsBackgroundTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
Classes | Namespaces

Scenario8_VisitsBackgroundTask.h File Reference

#include "Scenario8_VisitsBackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | Scenario8_VisitsBackgroundTask
struct | Scenario8_VisitsBackgroundTask

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Namespaces

GeofenceBackgroundTask.cpp File Reference

#include "pch.h"
#include "Helpers.h"
#include "GeofenceBackgroundTask.h"
#include "GeofenceBackgroundTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Classes | Namespaces

GeofenceBackgroundTask.h File Reference

#include "GeofenceBackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | GeofenceBackgroundTask
struct | GeofenceBackgroundTask

Namespaces

namespace | winrt::BackgroundTask::factory_implementation
namespace | winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/Helpers.cpp File Reference

  • Geolocation
  • cppwinrt
  • Tasks

Helpers.cpp File Reference

#include "pch.h"
#include "Helpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/Helpers.h File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Namespaces | Functions

Helpers.h File Reference

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::BackgroundTask

Functions

void | DisplayToast (hstring const &message)
hstring | FormatDateTime (Windows::Foundation::DateTime value, hstring const &format)
Windows::Data::Json::JsonArray | LoadSavedJson (hstring const &key)
hstring | to_brief_hstring (double value)
hstring | to_hstring (Windows::Devices::Geolocation::VisitStateChange value)
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/LocationBackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Namespaces

LocationBackgroundTask.cpp File Reference

#include "pch.h"
#include "Helpers.h"
#include "LocationBackgroundTask.h"
#include "LocationBackgroundTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/LocationBackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Classes | Namespaces

LocationBackgroundTask.h File Reference

#include "LocationBackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | LocationBackgroundTask
struct | LocationBackgroundTask

Namespaces

namespace | winrt::BackgroundTask::factory_implementation
namespace | winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/pch.cpp File Reference

  • Geolocation
  • cppwinrt
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/pch.h File Reference

  • Geolocation
  • cppwinrt
  • Tasks

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.ApplicationModel.Background.h>
#include <winrt/Windows.Data.Json.h>
#include <winrt/Windows.Data.Xml.Dom.h>
#include <winrt/Windows.Devices.Geolocation.h>
#include <winrt/Windows.Devices.Geolocation.Geofencing.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Globalization.DateTimeFormatting.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.UI.Notifications.h>
#include <ctime>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/Tasks.idl File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Namespaces | Variables

Tasks.idl File Reference

Go to the source code of this file.

Namespaces

namespace | BackgroundTask

Variables

runtimeclass | GeofenceBackgroundTask
runtimeclass | LocationBackgroundTask
runtimeclass | VisitBackgroundTask
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/VisitBackgroundTask.cpp File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Namespaces

VisitBackgroundTask.cpp File Reference

#include "pch.h"
#include "Helpers.h"
#include "VisitBackgroundTask.h"
#include "VisitBackgroundTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/VisitBackgroundTask.h File Reference

  • Geolocation
  • cppwinrt
  • Tasks
Classes | Namespaces

VisitBackgroundTask.h File Reference

#include "VisitBackgroundTask.g.h"

Go to the source code of this file.

Classes

struct | VisitBackgroundTask
struct | VisitBackgroundTask

Namespaces

namespace | winrt::BackgroundTask::factory_implementation
namespace | winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/SampleConfiguration.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario1_TrackPosition.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario1_TrackPosition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_TrackPosition

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario2_GetPosition.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario2_GetPosition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_GetPosition

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario3_BackgroundTask.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario3_BackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_BackgroundTask

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario4_ForegroundGeofence.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario4_ForegroundGeofence.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ForegroundGeofence

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario5_GeofenceBackgroundTask.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario5_GeofenceBackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_GeofenceBackgroundTask

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario6_GetLastVisit.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario6_GetLastVisit.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_GetLastVisit

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario7_ForegroundVisits.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario7_ForegroundVisits.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_ForegroundVisits

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario8_VisitsBackgroundTask.xaml.cs File Reference

  • Geolocation
  • cs
Classes | Namespaces

Scenario8_VisitsBackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_VisitsBackgroundTask

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/GeofenceBackgroundTask.cs File Reference

  • Geolocation
  • cs
  • Tasks
Classes | Namespaces

GeofenceBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | GeofenceBackgroundTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/Helpers.cs File Reference

  • Geolocation
  • cs
  • Tasks
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/LocationBackgroundTask.cs File Reference

  • Geolocation
  • cs
  • Tasks
Classes | Namespaces

LocationBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | LocationBackgroundTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/VisitBackgroundTask.cs File Reference

  • Geolocation
  • cs
  • Tasks
Classes | Namespaces

VisitBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | VisitBackgroundTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • Geolocation
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/pch.cpp File Reference

  • Geotag
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/pch.h File Reference

  • Geotag
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/SampleConfiguration.cpp File Reference

  • Geotag
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/SampleConfiguration.h File Reference

  • Geotag
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/Scenario1_Geotag.xaml.cpp File Reference

  • Geotag
  • cpp

Scenario1_Geotag.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Geotag.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/Scenario1_Geotag.xaml.h File Reference

  • Geotag
  • cpp
Classes | Namespaces

Scenario1_Geotag.xaml.h File Reference

#include "Scenario1_Geotag.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cs/SampleConfiguration.cs File Reference

  • Geotag
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cs/Scenario1_Geotag.xaml.cs File Reference

  • Geotag
  • cs
Classes | Namespaces

Scenario1_Geotag.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Geotag

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/pch.cpp File Reference

  • GlobalizationPreferences
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/pch.h File Reference

  • GlobalizationPreferences
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/SampleConfiguration.cpp File Reference

  • GlobalizationPreferences
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/SampleConfiguration.h File Reference

  • GlobalizationPreferences
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate

Functions

Platform::String | StringJoin (Platform::String^delimeter, Windows::Foundation::Collections::IVectorView< Platform::String^>^vector)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.cpp File Reference

  • GlobalizationPreferences
  • cpp

Scenario1_Prefs.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Prefs.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.h File Reference

  • GlobalizationPreferences
  • cpp
Classes | Namespaces

Scenario1_Prefs.xaml.h File Reference

#include "Scenario1_Prefs.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario2_Lang.xaml.cpp File Reference

  • GlobalizationPreferences
  • cpp

Scenario2_Lang.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Lang.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario2_Lang.xaml.h File Reference

  • GlobalizationPreferences
  • cpp
Classes | Namespaces

Scenario2_Lang.xaml.h File Reference

#include "Scenario2_Lang.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario3_Region.xaml.cpp File Reference

  • GlobalizationPreferences
  • cpp

Scenario3_Region.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Region.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario3_Region.xaml.h File Reference

  • GlobalizationPreferences
  • cpp
Classes | Namespaces

Scenario3_Region.xaml.h File Reference

#include "Scenario3_Region.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario4_Input.xaml.cpp File Reference

  • GlobalizationPreferences
  • cpp

Scenario4_Input.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Input.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario4_Input.xaml.h File Reference

  • GlobalizationPreferences
  • cpp
Classes | Namespaces

Scenario4_Input.xaml.h File Reference

#include "Scenario4_Input.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/pch.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/pch.h File Reference

  • GlobalizationPreferences
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.System.UserProfile.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Project.idl File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Prefs
runtimeclass | Scenario2_Lang
runtimeclass | Scenario3_Region
runtimeclass | Scenario4_Input
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/SampleConfiguration.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/SampleConfiguration.h File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

hstring | StringJoin (hstring const &delimiter, Windows::Foundation::Collections::IVectorView< hstring > const &vector)
hstring | to_hstring (Windows::Globalization::DayOfWeek value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario1_Prefs.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces

Scenario1_Prefs.cpp File Reference

#include "pch.h"
#include "Scenario1_Prefs.h"
#include "Scenario1_Prefs.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario1_Prefs.h File Reference

  • GlobalizationPreferences
  • cppwinrt
Classes | Namespaces

Scenario1_Prefs.h File Reference

#include "Scenario1_Prefs.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Prefs
struct | Scenario1_Prefs

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario2_Lang.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces | Functions

Scenario2_Lang.cpp File Reference

#include "pch.h"
#include "Scenario2_Lang.h"
#include "Scenario2_Lang.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario2_Lang.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

hstring | ReportLanguageData (Language const &lang)
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario2_Lang.h File Reference

  • GlobalizationPreferences
  • cppwinrt
Classes | Namespaces

Scenario2_Lang.h File Reference

#include "Scenario2_Lang.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Lang
struct | Scenario2_Lang

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario3_Region.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces | Functions

Scenario3_Region.cpp File Reference

#include "pch.h"
#include "Scenario3_Region.h"
#include "Scenario3_Region.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario3_Region.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

hstring | ReportRegionData (GeographicRegion const &region)
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario3_Region.h File Reference

  • GlobalizationPreferences
  • cppwinrt
Classes | Namespaces

Scenario3_Region.h File Reference

#include "Scenario3_Region.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_Region
struct | Scenario3_Region

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario4_Input.cpp File Reference

  • GlobalizationPreferences
  • cppwinrt
Namespaces

Scenario4_Input.cpp File Reference

#include "pch.h"
#include "Scenario4_Input.h"
#include "Scenario4_Input.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario4_Input.h File Reference

  • GlobalizationPreferences
  • cppwinrt
Classes | Namespaces

Scenario4_Input.h File Reference

#include "Scenario4_Input.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_Input
struct | Scenario4_Input

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/SampleConfiguration.cs File Reference

  • GlobalizationPreferences
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario1_Prefs.xaml.cs File Reference

  • GlobalizationPreferences
  • cs
Classes | Namespaces

Scenario1_Prefs.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Prefs

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario2_Lang.xaml.cs File Reference

  • GlobalizationPreferences
  • cs
Classes | Namespaces

Scenario2_Lang.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Lang

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario3_Region.xaml.cs File Reference

  • GlobalizationPreferences
  • cs
Classes | Namespaces

Scenario3_Region.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Region

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario4_Input.xaml.cs File Reference

  • GlobalizationPreferences
  • cs
Classes | Namespaces

Scenario4_Input.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Input

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/pch.cpp File Reference

  • Gyrometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/pch.h File Reference

  • Gyrometer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/SampleConfiguration.cpp File Reference

  • Gyrometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/SampleConfiguration.h File Reference

  • Gyrometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Gyrometer
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Gyrometer
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario2_Polling.xaml.cpp File Reference

  • Gyrometer
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario2_Polling.xaml.h File Reference

  • Gyrometer
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario3_Porting.xaml.cpp File Reference

  • Gyrometer
  • cpp

Scenario3_Porting.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Porting.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario3_Porting.xaml.h File Reference

  • Gyrometer
  • cpp
Classes | Namespaces

Scenario3_Porting.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Porting.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/SampleConfiguration.cs File Reference

  • Gyrometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Gyrometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | GyrometerCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario2_Polling.xaml.cs File Reference

  • Gyrometer
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | GyrometerCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario3_Porting.xaml.cs File Reference

  • Gyrometer
  • cs
Classes | Namespaces

Scenario3_Porting.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Porting
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | GyrometerCS
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/AppView.cpp File Reference

  • HolographicFaceTracking
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 28 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/AppView.h File Reference

  • HolographicFaceTracking
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicFaceTrackerMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/HolographicFaceTrackerMain.cpp File Reference

  • HolographicFaceTracking
  • cpp

HolographicFaceTrackerMain.cpp File Reference

#include "pch.h"
#include "HolographicFaceTrackerMain.h"
#include "Common\DirectXHelper.h"
#include "Content\VideoFrameProcessor.h"
#include "Content\FaceTrackerProcessor.h"
#include "Content\SpinningCubeRenderer.h"
#include "Content\QuadRenderer.h"
#include "Content\TextRenderer.h"
#include "Content\NV12VideoTexture.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/HolographicFaceTrackerMain.h File Reference

  • HolographicFaceTracking
  • cpp
Classes | Namespaces

HolographicFaceTrackerMain.h File Reference

#include "Common\StepTimer.h"
#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicFaceTrackerMain

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/pch.cpp File Reference

  • HolographicFaceTracking
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/pch.h File Reference

  • HolographicFaceTracking
  • cpp

pch.h File Reference

#include <agile.h>
#include <collection.h>
#include <concrt.h>
#include <ppltasks.h>
#include <wincodec.h>
#include <wrl.h>
#include <WindowsNumerics.h>
#include <d2d1_2.h>
#include <d2d1effects_1.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <dwrite_2.h>
#include <dxgi1_5.h>
#include <memory>
#include <map>
#include <vector>
#include <mutex>
#include <shared_mutex>
#include <string>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/CameraResources.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/CameraResources.h File Reference

  • HolographicFaceTracking
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/DeviceResources.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/DeviceResources.h File Reference

  • HolographicFaceTracking
  • cpp
  • Common
Classes | Namespaces | Functions

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources
class | Resource

Namespaces

namespace | DX

Functions

template<typename ObjectType , typename... Args>
concurrency::task< void > | CreateAndInitializeAsync (std::shared_ptr< ObjectType > &target, Args &&...args)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/DirectXHelper.h File Reference

  • HolographicFaceTracking
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/StepTimer.h File Reference

  • HolographicFaceTracking
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

FaceTrackerProcessor.cpp File Reference

#include "pch.h"
#include "FaceTrackerProcessor.h"
#include "VideoFrameProcessor.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/FaceTrackerProcessor.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

FaceTrackerProcessor.h File Reference

Go to the source code of this file.

Classes

class | FaceTrackerProcessor

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/NV12VideoTexture.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

NV12VideoTexture.cpp File Reference

#include "pch.h"
#include "NV12VideoTexture.h"
#include "Common\DirectXHelper.h"
#include <MemoryBuffer.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/NV12VideoTexture.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

NV12VideoTexture.h File Reference

#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | NV12VideoTexture

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/QuadRenderer.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

QuadRenderer.cpp File Reference

#include "pch.h"
#include "QuadRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/QuadRenderer.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

QuadRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | QuadRenderer

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/ShaderStructures.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | CubeModelConstantBuffer
struct | QuadModelConstantBuffer
struct | VertexPositionColor
struct | VertexPositionTex

Namespaces

namespace | HolographicFaceTracker

Functions

static_assert ((sizeof(CubeModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(QuadModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

SpinningCubeRenderer.cpp File Reference

#include "pch.h"
#include "SpinningCubeRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

SpinningCubeRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SpinningCubeRenderer

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/TextRenderer.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

TextRenderer.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "TextRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/TextRenderer.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

TextRenderer.h File Reference

#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | TextRenderer

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/VideoFrameProcessor.cpp File Reference

  • HolographicFaceTracking
  • cpp
  • Content

VideoFrameProcessor.cpp File Reference

#include "pch.h"
#include "VideoFrameProcessor.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/VideoFrameProcessor.h File Reference

  • HolographicFaceTracking
  • cpp
  • Content
Classes | Namespaces

VideoFrameProcessor.h File Reference

Go to the source code of this file.

Classes

class | VideoFrameProcessor

Namespaces

namespace | HolographicFaceTracker
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/AppView.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 19 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/AppView.h File Reference

  • HolographicMixedRealityCapture
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicMRCSampleMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp

HolographicMRCSampleMain.cpp File Reference

#include "pch.h"
#include "HolographicMRCSampleMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/HolographicMRCSampleMain.h File Reference

  • HolographicMixedRealityCapture
  • cpp
Classes | Namespaces | Defines

HolographicMRCSampleMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicMRCSampleMain

Namespaces

namespace | HolographicMRCSample

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 11 of file HolographicMRCSampleMain.h.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MediaCaptureManager.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp

MediaCaptureManager.cpp File Reference

#include "pch.h"
#include "MediaCaptureManager.h"
#include <windows.media.mediaproperties.h>
#include <mfmediacapture.h>
#include <collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MediaCaptureManager.h File Reference

  • HolographicMixedRealityCapture
  • cpp
Classes | Namespaces

MediaCaptureManager.h File Reference

#include <ppltasks.h>
#include <mfapi.h>

Go to the source code of this file.

Classes

class | MediaCaptureManager

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/pch.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/pch.h File Reference

  • HolographicMixedRealityCapture
  • cpp

pch.h File Reference

#include <agile.h>
#include <concrt.h>
#include <d2d1_2.h>
#include <d2d1effects_1.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <dwrite_2.h>
#include <dxgi1_5.h>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <wrl.h>
#include <memory>
#include <map>
#include <mutex>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/CameraResources.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/CameraResources.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DeviceResources.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DeviceResources.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common
Classes | Namespaces | Enumerations

DeviceResources.h File Reference

#include "CameraResources.h"
#include <ppltasks.h>
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX

Enumerations

enum | GeometryShaderIndex { GeometryShader_Simple = 0, GeometryShader_Texture, GeometryShader_Max }
enum | PixelShaderIndex { PixelShader_Simple = 0, PixelShader_Cursor, PixelShader_Texture, PixelShader_Max }
enum TextureIndex {
Texture_Cursor = 0, Texture_Init, Texture_Hologram, Texture_SysAudio,
Texture_Photo, Texture_Video, Texture_Max
}
enum | VertexShaderIndex { VertexShader_Simple = 0, VertexShader_Texture, VertexShader_Max }
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DirectXHelper.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common
Classes

DirectXHelper.cpp File Reference

#include <pch.h>
#include "DirectXHelper.h"
#include <wincodec.h>

Go to the source code of this file.

Classes

struct | WICConvert
struct | WICTranslate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DirectXHelper.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
HRESULT | CreateWICTextureFromMemory (ID3D11Device *d3dDevice, const uint8_t *wicData, size_t wicDataSize, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, size_t maxsize=0)
HRESULT | CreateWICTextureFromMemoryEx (ID3D11Device *d3dDevice, const uint8_t *wicData, size_t wicDataSize, size_t maxsize, D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/StepTimer.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Button.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

Button.cpp File Reference

#include "pch.h"
#include "Button.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Button.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

Button.h File Reference

#include "ControlBase.h"

Go to the source code of this file.

Classes

class | Button

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/ControlBase.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

ControlBase.cpp File Reference

#include "pch.h"
#include "ControlBase.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/ControlBase.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

ControlBase.h File Reference

#include "IControl.h"
#include "ShaderStructures.h"
#include <vector>
#include <ppltasks.h>
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | ControlBase

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Cursor.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

Cursor.cpp File Reference

#include "pch.h"
#include "Cursor.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Cursor.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

Cursor.h File Reference

#include "Panel.h"

Go to the source code of this file.

Classes

class | Cursor

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/IControl.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces | Enumerations

IControl.h File Reference

#include <memory>
#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include <DirectXCollision.h>

Go to the source code of this file.

Classes

class | IControl

Namespaces

namespace | HolographicMRCSample

Enumerations

enum | ControlType { Control_Unknown = 0, Control_Panel, Control_Button, Control_CameraPreview }
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Panel.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

Panel.cpp File Reference

#include "pch.h"
#include "Panel.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Panel.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

Panel.h File Reference

#include "ControlBase.h"

Go to the source code of this file.

Classes

class | Panel

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelColorConstantBuffer
struct | ModelConstantBuffer
struct | VertexPosition
struct | VertexPositionColor
struct | VertexPositionTexture

Namespaces

namespace | HolographicMRCSample

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ModelColorConstantBuffer)%(sizeof(float)*4))==0,"Model color constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

SpinningCubeRenderer.cpp File Reference

#include "pch.h"
#include "SpinningCubeRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpinningCubeRenderer.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content
Classes | Namespaces

SpinningCubeRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SpinningCubeRenderer

Namespaces

namespace | HolographicMRCSample
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcAudioEffectDefinition.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

MrcAudioEffectDefinition.cpp File Reference

#include "pch.h"
#include "MrcAudioEffectDefinition.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcAudioEffectDefinition.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions
Classes | Namespaces | Defines | Enumerations

MrcAudioEffectDefinition.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | MrcEffectDefinitions

Defines

#define | PROPERTY_LOOPBACKGAIN L"LoopbackGain"
#define | PROPERTY_MICROPHONEGAIN L"MicrophoneGain"
#define | PROPERTY_MIXERMODE L"MixerMode"
#define | RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT L"Windows.Media.MixedRealityCapture.MixedRealityCaptureAudioEffect"

Enumerations

enum | AudioMixerMode { Mic = 0, Loopback = 1, MicAndLoopback = 2 }

Define Documentation

#define PROPERTY_LOOPBACKGAIN L"LoopbackGain"

Definition at line 23 of file MrcAudioEffectDefinition.h.

#define PROPERTY_MICROPHONEGAIN L"MicrophoneGain"

Definition at line 30 of file MrcAudioEffectDefinition.h.

#define PROPERTY_MIXERMODE L"MixerMode"

Definition at line 16 of file MrcAudioEffectDefinition.h.

#define RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT L"Windows.Media.MixedRealityCapture.MixedRealityCaptureAudioEffect"

Definition at line 7 of file MrcAudioEffectDefinition.h.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcVideoEffectDefinition.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

MrcVideoEffectDefinition.cpp File Reference

#include "pch.h"
#include "MrcVideoEffectDefinition.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/MrcVideoEffectDefinition.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions
Classes | Namespaces | Defines | Enumerations

MrcVideoEffectDefinition.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | MrcEffectDefinitions

Defines

#define | PROPERTY_BLANKONPROTECTEDCONTENT L"BlankOnProtectedContent"
#define | PROPERTY_GLOBALOPACITYCOEFFICIENT L"GlobalOpacityCoefficient"
#define | PROPERTY_HOLOGRAMCOMPOSITIONENABLED L"HologramCompositionEnabled"
#define | PROPERTY_MAX_VSBUFFER 30U
#define | PROPERTY_OUTPUTSIZE L"OutputSize"
#define | PROPERTY_PREFERREDHOLOGRAMPERSPECTIVE L"PreferredHologramPerspective"
#define | PROPERTY_RECORDINGINDICATORENABLED L"RecordingIndicatorEnabled"
#define | PROPERTY_SHOWHIDDENMESH L"ShowHiddenMesh"
#define | PROPERTY_STREAMTYPE L"StreamType"
#define | PROPERTY_VIDEOSTABILIZATIONBUFFERLENGTH L"VideoStabilizationBufferLength"
#define | PROPERTY_VIDEOSTABILIZATIONENABLED L"VideoStabilizationEnabled"
#define | RUNTIMECLASS_MIXEDREALITYCAPTURE_VIDEO_EFFECT L"Windows.Media.MixedRealityCapture.MixedRealityCaptureVideoEffect"

Enumerations

enum | MixedRealityCapturePerspective { Display = 0, PhotoVideoCamera = 1 }

Define Documentation

#define PROPERTY_BLANKONPROTECTEDCONTENT L"BlankOnProtectedContent"

Definition at line 59 of file MrcVideoEffectDefinition.h.

#define PROPERTY_GLOBALOPACITYCOEFFICIENT L"GlobalOpacityCoefficient"

Definition at line 50 of file MrcVideoEffectDefinition.h.

#define PROPERTY_HOLOGRAMCOMPOSITIONENABLED L"HologramCompositionEnabled"

Definition at line 21 of file MrcVideoEffectDefinition.h.

#define PROPERTY_MAX_VSBUFFER 30U

Definition at line 88 of file MrcVideoEffectDefinition.h.

#define PROPERTY_OUTPUTSIZE L"OutputSize"

Definition at line 73 of file MrcVideoEffectDefinition.h.

#define PROPERTY_PREFERREDHOLOGRAMPERSPECTIVE L"PreferredHologramPerspective"

Definition at line 82 of file MrcVideoEffectDefinition.h.

#define PROPERTY_RECORDINGINDICATORENABLED L"RecordingIndicatorEnabled"

Definition at line 28 of file MrcVideoEffectDefinition.h.

#define PROPERTY_SHOWHIDDENMESH L"ShowHiddenMesh"

Definition at line 66 of file MrcVideoEffectDefinition.h.

#define PROPERTY_STREAMTYPE L"StreamType"

Definition at line 14 of file MrcVideoEffectDefinition.h.

#define PROPERTY_VIDEOSTABILIZATIONBUFFERLENGTH L"VideoStabilizationBufferLength"

Definition at line 43 of file MrcVideoEffectDefinition.h.

#define PROPERTY_VIDEOSTABILIZATIONENABLED L"VideoStabilizationEnabled"

Definition at line 36 of file MrcVideoEffectDefinition.h.

#define RUNTIMECLASS_MIXEDREALITYCAPTURE_VIDEO_EFFECT L"Windows.Media.MixedRealityCapture.MixedRealityCaptureVideoEffect"

Definition at line 7 of file MrcVideoEffectDefinition.h.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.cpp File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.h File Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions
Functions

pch.h File Reference

#include <algorithm>

Go to the source code of this file.

Functions

template<typename T , typename U >
U GetValueFromPropertySet (Windows::Foundation::Collections::IPropertySet^propertySet, Platform::String^key, U defaultValue)

Function Documentation

U GetValueFromPropertySet | ( | Windows::Foundation::Collections::IPropertySet^ | propertySet,
 |  | Platform::String^ | key,
 |  | U | defaultValue
 | ) |  |

Definition at line 6 of file pch.h.

{
    try
    {
        return static_cast<U>(safe_cast<T>(propertySet->Lookup(key)));
    }
    catch (Platform::OutOfBoundsException^)
    {
        // The key is not present in the PropertySet. Return the default value.
        return defaultValue;
    }
}

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/AppView.cpp File Reference

  • HolographicSpatialMapping
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 30 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/AppView.h File Reference

  • HolographicSpatialMapping
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicSpatialMappingMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicSpatialMapping
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.cpp File Reference

  • HolographicSpatialMapping
  • cpp

HolographicSpatialMappingMain.cpp File Reference

#include "pch.h"
#include "HolographicSpatialMappingMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.h File Reference

  • HolographicSpatialMapping
  • cpp
Classes | Namespaces | Defines

HolographicSpatialMappingMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicSpatialMappingMain

Namespaces

namespace | HolographicSpatialMapping

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 18 of file HolographicSpatialMappingMain.h.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/pch.cpp File Reference

  • HolographicSpatialMapping
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/pch.h File Reference

  • HolographicSpatialMapping
  • cpp

pch.h File Reference

#include <agile.h>
#include <concrt.h>
#include <d2d1_2.h>
#include <d2d1effects_1.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <dwrite_2.h>
#include <dxgi1_5.h>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <wrl.h>
#include <memory>
#include <map>
#include <mutex>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/CameraResources.cpp File Reference

  • HolographicSpatialMapping
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/CameraResources.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Common
Classes | Namespaces

CameraResources.h File Reference

#include "Content\ShaderStructures.h"

Go to the source code of this file.

Classes

class | CameraResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/DeviceResources.cpp File Reference

  • HolographicSpatialMapping
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/DeviceResources.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/DirectXHelper.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/StepTimer.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/GetDataFromIBuffer.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Content
Namespaces | Functions

GetDataFromIBuffer.h File Reference

#include <streambuf>
#include <robuffer.h>
#include <wrl.h>

Go to the source code of this file.

Namespaces

namespace | WindowsHolographicCodeSamples

Functions

template<typename t = byte>
t * | GetDataFromIBuffer (Windows::Storage::Streams::IBuffer^container)
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.cpp File Reference

  • HolographicSpatialMapping
  • cpp
  • Content

RealtimeSurfaceMeshRenderer.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "RealtimeSurfaceMeshRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/RealtimeSurfaceMeshRenderer.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Content
Classes | Namespaces

RealtimeSurfaceMeshRenderer.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\SurfaceMesh.h"
#include "Content\ShaderStructures.h"
#include <memory>
#include <map>
#include <ppltasks.h>

Go to the source code of this file.

Classes

class | RealtimeSurfaceMeshRenderer

Namespaces

namespace | WindowsHolographicCodeSamples
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/ShaderStructures.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | ModelNormalConstantBuffer
struct | VertexPositionColor
struct | VertexPositionNormalColor
struct | ViewProjectionConstantBuffer

Namespaces

namespace | WindowsHolographicCodeSamples

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"View/projection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
static_assert ((sizeof(ModelNormalConstantBuffer)%(sizeof(float)*4))==0,"Model/normal constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SpatialInputHandler.cpp File Reference

  • HolographicSpatialMapping
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SpatialInputHandler.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | HolographicSpatialMapping
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SurfaceMesh.cpp File Reference

  • HolographicSpatialMapping
  • cpp
  • Content

SurfaceMesh.cpp File Reference

#include "pch.h"
#include <ppltasks.h>
#include "Common\DirectXHelper.h"
#include "Common\StepTimer.h"
#include "GetDataFromIBuffer.h"
#include "SurfaceMesh.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SurfaceMesh.h File Reference

  • HolographicSpatialMapping
  • cpp
  • Content
Classes | Namespaces

SurfaceMesh.h File Reference

#include "Common\DeviceResources.h"
#include "ShaderStructures.h"
#include <ppltasks.h>
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | final
struct | SurfaceMeshProperties

Namespaces

namespace | WindowsHolographicCodeSamples
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/AppView.cpp File Reference

  • HolographicSpatialStage
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 19 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/AppView.h File Reference

  • HolographicSpatialStage
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicSpatialStageMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicSpatialStage
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/HolographicSpatialStageMain.cpp File Reference

  • HolographicSpatialStage
  • cpp

HolographicSpatialStageMain.cpp File Reference

#include "pch.h"
#include "HolographicSpatialStageMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/HolographicSpatialStageMain.h File Reference

  • HolographicSpatialStage
  • cpp
Classes | Namespaces

HolographicSpatialStageMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\SceneController.h"
#include "SpatialStageManager.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicSpatialStageMain

Namespaces

namespace | HolographicSpatialStage
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/pch.cpp File Reference

  • HolographicSpatialStage
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/pch.h File Reference

  • HolographicSpatialStage
  • cpp

pch.h File Reference

#include <agile.h>
#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <vector>
#include <wincodec.h>
#include <WindowsNumerics.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/SpatialStageManager.cpp File Reference

  • HolographicSpatialStage
  • cpp

SpatialStageManager.cpp File Reference

#include "pch.h"
#include "SpatialStageManager.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/SpatialStageManager.h File Reference

  • HolographicSpatialStage
  • cpp
Classes | Namespaces

SpatialStageManager.h File Reference

#include "Common\DeviceResources.h"
#include "Content\SceneController.h"

Go to the source code of this file.

Classes

class | SpatialStageManager

Namespaces

namespace | HolographicSpatialStage
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/CameraResources.cpp File Reference

  • HolographicSpatialStage
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/CameraResources.h File Reference

  • HolographicSpatialStage
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/DeviceResources.cpp File Reference

  • HolographicSpatialStage
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/DeviceResources.h File Reference

  • HolographicSpatialStage
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/DirectXHelper.h File Reference

  • HolographicSpatialStage
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/StepTimer.h File Reference

  • HolographicSpatialStage
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneController.cpp File Reference

  • HolographicSpatialStage
  • cpp
  • Content

SceneController.cpp File Reference

#include "pch.h"
#include "SceneController.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneController.h File Reference

  • HolographicSpatialStage
  • cpp
  • Content
Classes | Namespaces

SceneController.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "SceneObject.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SceneController

Namespaces

namespace | HolographicSpatialStage
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneObject.cpp File Reference

  • HolographicSpatialStage
  • cpp
  • Content

SceneObject.cpp File Reference

#include "pch.h"
#include "SceneObject.h"
#include "Common\DirectXHelper.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneObject.h File Reference

  • HolographicSpatialStage
  • cpp
  • Content
Classes | Namespaces

SceneObject.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\ShaderStructures.h"

Go to the source code of this file.

Classes

class | SceneObject

Namespaces

namespace | HolographicSpatialStage
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/ShaderStructures.h File Reference

  • HolographicSpatialStage
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | VertexPositionColor

Namespaces

namespace | HolographicSpatialStage

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/AppView.cpp File Reference

  • HolographicTagAlong
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 30 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/AppView.h File Reference

  • HolographicTagAlong
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicTagAlongSampleMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicTagAlongSample
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/HolographicTagAlongSampleMain.cpp File Reference

  • HolographicTagAlong
  • cpp

HolographicTagAlongSampleMain.cpp File Reference

#include "pch.h"
#include "HolographicTagAlongSampleMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/HolographicTagAlongSampleMain.h File Reference

  • HolographicTagAlong
  • cpp
Classes | Namespaces | Defines

HolographicTagAlongSampleMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicTagAlongSampleMain

Namespaces

namespace | HolographicTagAlongSample

Defines

#define | DRAW_SAMPLE_CONTENT

Define Documentation

#define DRAW_SAMPLE_CONTENT

Definition at line 16 of file HolographicTagAlongSampleMain.h.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/pch.cpp File Reference

  • HolographicTagAlong
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/pch.h File Reference

  • HolographicTagAlong
  • cpp

pch.h File Reference

#include <agile.h>
#include <array>
#include <concrt.h>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <string>
#include <wincodec.h>
#include <WindowsNumerics.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/CameraResources.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/CameraResources.h File Reference

  • HolographicTagAlong
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/DeviceResources.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/DeviceResources.h File Reference

  • HolographicTagAlong
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/DirectXHelper.h File Reference

  • HolographicTagAlong
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/StepTimer.h File Reference

  • HolographicTagAlong
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DDSTextureLoader.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces | Defines | Typedefs | Enumerations | Functions | Variables

DDSTextureLoader.cpp File Reference

#include "pch.h"
#include <assert.h>
#include <algorithm>
#include <memory>
#include "DDSTextureLoader.h"

Go to the source code of this file.

Classes

struct | handle_closer
struct | DDS_HEADER
struct | DDS_HEADER_DXT10
struct | DDS_PIXELFORMAT

Namespaces

namespace | anonymous_namespace{DDSTextureLoader.cpp}

Defines

#define | DDS_ALPHA 0x00000002
#define | DDS_CUBEMAP 0x00000200
#define | DDS_CUBEMAP_ALLFACES
#define | DDS_CUBEMAP_NEGATIVEX 0x00000a00
#define | DDS_CUBEMAP_NEGATIVEY 0x00002200
#define | DDS_CUBEMAP_NEGATIVEZ 0x00008200
#define | DDS_CUBEMAP_POSITIVEX 0x00000600
#define | DDS_CUBEMAP_POSITIVEY 0x00001200
#define | DDS_CUBEMAP_POSITIVEZ 0x00004200
#define | DDS_FOURCC 0x00000004
#define | DDS_HEADER_FLAGS_VOLUME 0x00800000
#define | DDS_HEIGHT 0x00000002
#define | DDS_LUMINANCE 0x00020000
#define | DDS_RGB 0x00000040
#define | DDS_WIDTH 0x00000004
#define | ISBITMASK(r, g, b, a) ( ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a )
#define | MAKEFOURCC(ch0, ch1, ch2, ch3)

Typedefs

typedef public std::unique_ptr
< void, handle_closer > 		ScopedHandle

Enumerations

enum | DDS_MISC_FLAGS2 { DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L }

Functions

HANDLE | safe_handle (HANDLE h)
template<UINT TNameLength>
void | SetDebugObjectName (_In_ ID3D11DeviceChild *resource, _In_ const char(&name)[TNameLength])

Variables

const uint32_t | DDS_MAGIC = 0x20534444

Define Documentation

#define DDS_ALPHA 0x00000002

Definition at line 68 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP 0x00000200

Definition at line 86 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_ALLFACES
Value:
( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
                               DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
                               DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )

Definition at line 82 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEX 0x00000a00

Definition at line 76 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEY 0x00002200

Definition at line 78 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEZ 0x00008200

Definition at line 80 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEX 0x00000600

Definition at line 75 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEY 0x00001200

Definition at line 77 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEZ 0x00004200

Definition at line 79 of file DDSTextureLoader.cpp.

#define DDS_FOURCC 0x00000004

Definition at line 65 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_VOLUME 0x00800000

Definition at line 70 of file DDSTextureLoader.cpp.

#define DDS_HEIGHT 0x00000002

Definition at line 72 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCE 0x00020000

Definition at line 67 of file DDSTextureLoader.cpp.

#define DDS_RGB 0x00000040

Definition at line 66 of file DDSTextureLoader.cpp.

#define DDS_WIDTH 0x00000004

Definition at line 73 of file DDSTextureLoader.cpp.

#define ISBITMASK | ( | r,
 |  | g,
 |  | b,
 |  | a |
 | ) |  | ( ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a )

Definition at line 578 of file DDSTextureLoader.cpp.

#define MAKEFOURCC | ( | ch0,
 |  | ch1,
 |  | ch2,
 |  | ch3
 | ) |
Value:
((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) |       \
                ((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24 ))

Definition at line 39 of file DDSTextureLoader.cpp.

Enumeration Type Documentation

enum DDS_MISC_FLAGS2
Enumerator:
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK

Definition at line 88 of file DDSTextureLoader.cpp.

{
    DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};

Variable Documentation

const uint32_t DDS_MAGIC = 0x20534444

Definition at line 51 of file DDSTextureLoader.cpp.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DDSTextureLoader.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Namespaces | Enumerations | Functions

DDSTextureLoader.h File Reference

#include <d3d11_1.h>
#include <stdint.h>

Go to the source code of this file.

Namespaces

namespace | DirectX

Enumerations

enum DDS_ALPHA_MODE {
DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4
}

Functions

HRESULT | CreateDDSTextureFromFile (_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFile (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_z_ const wchar_t *szFileName, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFileEx (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_z_ const wchar_t *szFileName, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromFileEx (_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
HRESULT | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ DDS_ALPHA_MODE *alphaMode=nullptr)
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DistanceFieldRenderer.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Content

DistanceFieldRenderer.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "Content\ShaderStructures.h"
#include "DistanceFieldRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DistanceFieldRenderer.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces

DistanceFieldRenderer.h File Reference

#include "common\DeviceResources.h"

Go to the source code of this file.

Classes

class | DistanceFieldRenderer

Namespaces

namespace | HolographicTagAlongSample
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/QuadRenderer.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Content

QuadRenderer.cpp File Reference

#include "pch.h"
#include "DDSTextureLoader.h"
#include "QuadRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/QuadRenderer.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces

QuadRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | QuadRenderer

Namespaces

namespace | HolographicTagAlongSample
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/ShaderStructures.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | VertexPositionColorTex

Namespaces

namespace | HolographicTagAlongSample

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/SpatialInputHandler.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/SpatialInputHandler.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | HolographicTagAlongSample
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/TextRenderer.cpp File Reference

  • HolographicTagAlong
  • cpp
  • Content

TextRenderer.cpp File Reference

#include "pch.h"
#include "Common\DirectXHelper.h"
#include "TextRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/TextRenderer.h File Reference

  • HolographicTagAlong
  • cpp
  • Content
Classes | Namespaces

TextRenderer.h File Reference

#include "common\DeviceResources.h"

Go to the source code of this file.

Classes

class | TextRenderer

Namespaces

namespace | HolographicTagAlongSample
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/AppView.cpp File Reference

  • HolographicVoiceInput
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 29 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/AppView.h File Reference

  • HolographicVoiceInput
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicVoiceInputMain.h"
#include "Common\DeviceResources.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicVoiceInput
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/HolographicVoiceInputMain.cpp File Reference

  • HolographicVoiceInput
  • cpp

HolographicVoiceInputMain.cpp File Reference

#include "pch.h"
#include "HolographicVoiceInputMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>
#include "Audio/OmnidirectionalSound.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/HolographicVoiceInputMain.h File Reference

  • HolographicVoiceInput
  • cpp
Classes | Namespaces

HolographicVoiceInputMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\SpinningCubeRenderer.h"
#include "Content\SpatialInputHandler.h"
#include "Audio/OmnidirectionalSound.h"
#include "Common\StepTimer.h"

Go to the source code of this file.

Classes

class | HolographicVoiceInputMain

Namespaces

namespace | HolographicVoiceInput
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/pch.cpp File Reference

  • HolographicVoiceInput
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/pch.h File Reference

  • HolographicVoiceInput
  • cpp

pch.h File Reference

#include <agile.h>
#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <wrl.h>
#include <Mfidl.h>
#include <Mfapi.h>
#include <Mfreadwrite.h>
#include <xaudio2.h>
#include <xapo.h>
#include <hrtfapoapi.h>
#include <collection.h>
#include <vector>
#include <ppltasks.h>
#include "Common\PrintWstringToDebugConsole.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/AudioFileReader.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Audio

AudioFileReader.cpp File Reference

#include "pch.h"
#include "AudioFileReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/AudioFileReader.h File Reference

  • HolographicVoiceInput
  • cpp
  • Audio
Classes

AudioFileReader.h File Reference

#include <vector>

Go to the source code of this file.

Classes

class AudioFileReader
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/AudioStreamReader.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Audio

AudioStreamReader.cpp File Reference

#include "pch.h"
#include "AudioStreamReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/AudioStreamReader.h File Reference

  • HolographicVoiceInput
  • cpp
  • Audio
Classes

AudioStreamReader.h File Reference

#include <vector>

Go to the source code of this file.

Classes

class AudioStreamReader
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Audio
Defines

OmnidirectionalSound.cpp File Reference

#include "pch.h"
#include "OmnidirectionalSound.h"
#include "XAudio2Helpers.h"

Go to the source code of this file.

Defines

#define HRTF_2PI 6.283185307f

Define Documentation

#define HRTF_2PI 6.283185307f

Definition at line 22 of file OmnidirectionalSound.cpp.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.h File Reference

  • HolographicVoiceInput
  • cpp
  • Audio
Classes

OmnidirectionalSound.h File Reference

#include "AudioFileReader.h"
#include "AudioStreamReader.h"
#include "AudioFileReader.h"

Go to the source code of this file.

Classes

class OmnidirectionalSound
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/XAudio2Helpers.h File Reference

  • HolographicVoiceInput
  • cpp
  • Audio

XAudio2Helpers.h File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/CameraResources.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/CameraResources.h File Reference

  • HolographicVoiceInput
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/DeviceResources.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/DeviceResources.h File Reference

  • HolographicVoiceInput
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"
#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/DirectXHelper.h File Reference

  • HolographicVoiceInput
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/PrintWstringToDebugConsole.h File Reference

  • HolographicVoiceInput
  • cpp
  • Common
Namespaces

PrintWstringToDebugConsole.h File Reference

Go to the source code of this file.

Namespaces

namespace HolographicVoiceInput
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/StepTimer.h File Reference

  • HolographicVoiceInput
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/ShaderStructures.h File Reference

  • HolographicVoiceInput
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelColorConstantBuffer
struct | VertexPositionColor

Namespaces

namespace | HolographicVoiceInput

Functions

static_assert ((sizeof(ModelColorConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/SpatialInputHandler.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Content

SpatialInputHandler.cpp File Reference

#include "pch.h"
#include "SpatialInputHandler.h"
#include <functional>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/SpatialInputHandler.h File Reference

  • HolographicVoiceInput
  • cpp
  • Content
Classes | Namespaces

SpatialInputHandler.h File Reference

Go to the source code of this file.

Classes

class | SpatialInputHandler

Namespaces

namespace | HolographicVoiceInput
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.cpp File Reference

  • HolographicVoiceInput
  • cpp
  • Content

SpinningCubeRenderer.cpp File Reference

#include "pch.h"
#include "SpinningCubeRenderer.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/SpinningCubeRenderer.h File Reference

  • HolographicVoiceInput
  • cpp
  • Content
Classes | Namespaces

SpinningCubeRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Classes

class | SpinningCubeRenderer

Namespaces

namespace | HolographicVoiceInput
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/SampleConfiguration.cs File Reference

  • HotspotAuthentication
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/Scenario1_Initialization.xaml.cs File Reference

  • HotspotAuthentication
  • cs
Classes | Namespaces

Scenario1_Initialization.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Initialization
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/Scenario2_BackgroundTask.xaml.cs File Reference

  • HotspotAuthentication
  • cs
Classes | Namespaces

Scenario2_BackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_BackgroundTask
This page is used to handle authentication by background task scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/Scenario3_ForegroundApp.xaml.cs File Reference

  • HotspotAuthentication
  • cs
Classes | Namespaces

Scenario3_ForegroundApp.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ForegroundApp
The page is used to handle authenticate by foreground app scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/ScenarioCommon.cs File Reference

  • HotspotAuthentication
  • cs
Classes | Namespaces | Functions

ScenarioCommon.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundAuthenticationCompletedEventArgs
class | ScenarioCommon

Namespaces

namespace | SDKTemplate

Functions

delegate void | BackgroundAuthenticationCompletedEventHandler (ScenarioCommon sender, BackgroundAuthenticationCompletedEventArgs e)
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/BackgroundTask.cs File Reference

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask
Classes | Namespaces

BackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | AuthenticationTask

Namespaces

namespace | HotspotAuthenticationTask
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/ConfigStore.cs File Reference

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask
Classes | Namespaces

ConfigStore.cs File Reference

Go to the source code of this file.

Classes

class | ConfigStore

Namespaces

namespace | HotspotAuthenticationTask
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/Properties/AssemblyInfo.cs File Reference

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Helpers.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces | Functions

Helpers.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::Helpers

Functions

HttpClient | CreateHttpClientWithCustomHeaders ()
IAsyncAction | DisplayTextResultAsync (HttpResponseMessage response, TextBox output)
void | DisplayWebError (MainPage const &rootPage, hresult const &error)
void | ReplaceQueryString (TextBox const &addressField, hstring const &newQueryString)
void | ScenarioCompleted (Button const &startButton, Button const &cancelButton)
void | ScenarioStarted (Button const &startButton, Button const &cancelButton, TextBox const &outputField)
hstring | SerializeHeaders (HttpResponseMessage const &response)
hstring | ToSimpleString (Windows::Foundation::DateTime dateTime)
Uri | TryParseHttpUri (hstring const &uriString)
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Helpers.h File Reference

  • HttpClient
  • cppwinrt
Namespaces | Functions

Helpers.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::Helpers

Functions

HttpClient | CreateHttpClientWithCustomHeaders ()
Windows::Foundation::IAsyncAction | DisplayTextResultAsync (Windows::Web::Http::HttpResponseMessage response, Windows::UI::Xaml::Controls::TextBox output)
void | DisplayWebError (MainPage const &rootPage, hresult const &error)
void | ReplaceQueryString (Windows::UI::Xaml::Controls::TextBox const &addressField, hstring const &newQueryString)
void | ScenarioCompleted (Windows::UI::Xaml::Controls::Button const &startButton, Windows::UI::Xaml::Controls::Button const &cancelButton)
void | ScenarioStarted (Windows::UI::Xaml::Controls::Button const &startButton, Windows::UI::Xaml::Controls::Button const &cancelButton, Windows::UI::Xaml::Controls::TextBox const &outputField)
hstring | SerializeHeaders (Windows::Web::Http::HttpResponseMessage const &response)
hstring | ToSimpleString (Windows::Foundation::DateTime dateTime)
Uri | TryParseHttpUri (hstring const &uriString)
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/HttpJsonContent.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

HttpJsonContent.cpp File Reference

#include "pch.h"
#include "HttpJsonContent.h"
#include "HttpJsonContent.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/HttpJsonContent.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

HttpJsonContent.h File Reference

#include "HttpJsonContent.g.h"

Go to the source code of this file.

Classes

struct | HttpJsonContent
struct | HttpJsonContent

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/pch.cpp File Reference

  • HttpClient
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/pch.h File Reference

  • HttpClient
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/HttpFilters.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Data.Json.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Security.Cryptography.Certificates.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Web.h"
#include "winrt/Windows.Web.Http.h"
#include "winrt/Windows.Web.Http.Filters.h"
#include "winrt/Windows.Web.Http.Headers.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/PlugInFilter.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

PlugInFilter.cpp File Reference

#include "pch.h"
#include "PlugInFilter.h"
#include "PlugInFilter.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/PlugInFilter.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

PlugInFilter.h File Reference

#include "PlugInFilter.g.h"

Go to the source code of this file.

Classes

struct | PlugInFilter
struct | PlugInFilter

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Project.idl File Reference

  • HttpClient
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | HttpJsonContent
runtimeclass | PlugInFilter
runtimeclass | Scenario01_GetText
runtimeclass | Scenario02_GetStream
runtimeclass | Scenario03_GetList
runtimeclass | Scenario04_PostText
runtimeclass | Scenario05_PostStream
runtimeclass | Scenario06_PostMultipart
runtimeclass | Scenario07_PostStreamWithProgress
runtimeclass | Scenario08_PostCustomContent
runtimeclass | Scenario09_GetCookie
runtimeclass | Scenario10_SetCookie
runtimeclass | Scenario11_DeleteCookie
runtimeclass | Scenario12_DisableCookies
runtimeclass | Scenario13_RetryFilter
runtimeclass | Scenario14_MeteredConnectionFilter
runtimeclass | Scenario15_ServerCertificateValidation
runtimeclass | SlowInputStream
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/SampleConfiguration.cpp File Reference

  • HttpClient
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/SampleConfiguration.h File Reference

  • HttpClient
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

hstring | to_hstring (Windows::Web::WebErrorStatus value)
hstring | to_hstring (Windows::Web::Http::HttpProgressStage value)
hstring | to_hstring (Windows::Web::Http::HttpVersion value)
hstring | to_hstring (Windows::Web::Http::HttpResponseMessageSource value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario01_GetText.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario01_GetText.cpp File Reference

#include "pch.h"
#include "Scenario01_GetText.h"
#include "Scenario01_GetText.g.cpp"
#include "SampleConfiguration.h"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario01_GetText.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario01_GetText.h File Reference

#include "Scenario01_GetText.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario01_GetText
struct | Scenario01_GetText

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario02_GetStream.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario02_GetStream.cpp File Reference

#include "pch.h"
#include "Scenario02_GetStream.h"
#include "Scenario02_GetStream.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario02_GetStream.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario02_GetStream.h File Reference

#include "Scenario02_GetStream.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario02_GetStream
struct | Scenario02_GetStream

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario03_GetList.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario03_GetList.cpp File Reference

#include "pch.h"
#include "Scenario03_GetList.h"
#include "Scenario03_GetList.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario03_GetList.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario03_GetList.h File Reference

#include "Scenario03_GetList.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario03_GetList
struct | Scenario03_GetList

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario04_PostText.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario04_PostText.cpp File Reference

#include "pch.h"
#include "Scenario04_PostText.h"
#include "Scenario04_PostText.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario04_PostText.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario04_PostText.h File Reference

#include "Scenario04_PostText.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario04_PostText
struct | Scenario04_PostText

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario05_PostStream.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces | Functions

Scenario05_PostStream.cpp File Reference

#include "pch.h"
#include "Scenario05_PostStream.h"
#include "Scenario05_PostStream.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario05_PostStream.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

IAsyncOperation
< IRandomAccessStream > 		GenerateSampleStreamAsync (int contentLength)
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario05_PostStream.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario05_PostStream.h File Reference

#include "Scenario05_PostStream.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario05_PostStream
struct | Scenario05_PostStream

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario06_PostMultipart.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario06_PostMultipart.cpp File Reference

#include "pch.h"
#include "Scenario06_PostMultipart.h"
#include "Scenario06_PostMultipart.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario06_PostMultipart.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario06_PostMultipart.h File Reference

#include "Scenario06_PostMultipart.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario06_PostMultipart
struct | Scenario06_PostMultipart

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario07_PostStreamWithProgress.cpp File Reference

#include "pch.h"
#include "Scenario07_PostStreamWithProgress.h"
#include "Scenario07_PostStreamWithProgress.g.cpp"
#include "SampleConfiguration.h"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario07_PostStreamWithProgress.h File Reference

#include "Scenario07_PostStreamWithProgress.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario07_PostStreamWithProgress
struct | Scenario07_PostStreamWithProgress

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario08_PostCustomContent.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario08_PostCustomContent.cpp File Reference

#include "pch.h"
#include "Scenario08_PostCustomContent.h"
#include "Scenario08_PostCustomContent.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario08_PostCustomContent.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario08_PostCustomContent.h File Reference

#include "Scenario08_PostCustomContent.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario08_PostCustomContent
struct | Scenario08_PostCustomContent

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario09_GetCookie.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario09_GetCookie.cpp File Reference

#include "pch.h"
#include "Scenario09_GetCookie.h"
#include "Scenario09_GetCookie.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario09_GetCookie.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario09_GetCookie.h File Reference

#include "Scenario09_GetCookie.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario09_GetCookie
struct | Scenario09_GetCookie

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario10_SetCookie.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario10_SetCookie.cpp File Reference

#include "pch.h"
#include "Scenario10_SetCookie.h"
#include "Scenario10_SetCookie.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario10_SetCookie.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario10_SetCookie.h File Reference

#include "Scenario10_SetCookie.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario10_SetCookie
struct | Scenario10_SetCookie

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario11_DeleteCookie.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario11_DeleteCookie.cpp File Reference

#include "pch.h"
#include "Scenario11_DeleteCookie.h"
#include "Scenario11_DeleteCookie.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario11_DeleteCookie.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario11_DeleteCookie.h File Reference

#include "Scenario11_DeleteCookie.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario11_DeleteCookie
struct | Scenario11_DeleteCookie

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario12_DisableCookies.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario12_DisableCookies.cpp File Reference

#include "pch.h"
#include "Scenario12_DisableCookies.h"
#include "Scenario12_DisableCookies.g.cpp"
#include "SampleConfiguration.h"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario12_DisableCookies.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario12_DisableCookies.h File Reference

#include "Scenario12_DisableCookies.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario12_DisableCookies
struct | Scenario12_DisableCookies

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario13_RetryFilter.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario13_RetryFilter.cpp File Reference

#include "pch.h"
#include "Scenario13_RetryFilter.h"
#include "Scenario13_RetryFilter.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario13_RetryFilter.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario13_RetryFilter.h File Reference

#include "Scenario13_RetryFilter.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario13_RetryFilter
struct | Scenario13_RetryFilter

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario14_MeteredConnectionFilter.cpp File Reference

#include "pch.h"
#include "Scenario14_MeteredConnectionFilter.h"
#include "Scenario14_MeteredConnectionFilter.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario14_MeteredConnectionFilter.h File Reference

#include "Scenario14_MeteredConnectionFilter.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario14_MeteredConnectionFilter
struct | Scenario14_MeteredConnectionFilter

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

Scenario15_ServerCertificateValidation.cpp File Reference

#include "pch.h"
#include "Scenario15_ServerCertificateValidation.h"
#include "Scenario15_ServerCertificateValidation.g.cpp"
#include "Helpers.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario15_ServerCertificateValidation.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

Scenario15_ServerCertificateValidation.h File Reference

#include "Scenario15_ServerCertificateValidation.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario15_ServerCertificateValidation
struct | Scenario15_ServerCertificateValidation

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/SlowInputStream.cpp File Reference

  • HttpClient
  • cppwinrt
Namespaces

SlowInputStream.cpp File Reference

#include "pch.h"
#include "SlowInputStream.h"
#include "SlowInputStream.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/SlowInputStream.h File Reference

  • HttpClient
  • cppwinrt
Classes | Namespaces

SlowInputStream.h File Reference

#include "SlowInputStream.g.h"

Go to the source code of this file.

Classes

struct | SlowInputStream
struct | SlowInputStream

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Helpers.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/HttpJsonContent.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

HttpJsonContent.cs File Reference

Go to the source code of this file.

Classes

class | HttpJsonContent

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/PlugInFilter.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

PlugInFilter.cs File Reference

Go to the source code of this file.

Classes

class | PlugInFilter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/SampleConfiguration.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario01_GetText.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario01_GetText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario01_GetText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario02_GetStream.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario02_GetStream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario02_GetStream

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario03_GetList.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario03_GetList.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario03_GetList

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario04_PostText.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario04_PostText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario04_PostText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario05_PostStream.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario05_PostStream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario05_PostStream

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario06_PostMultipart.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario06_PostMultipart.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario06_PostMultipart

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario07_PostStreamWithProgress.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario07_PostStreamWithProgress.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario07_PostStreamWithProgress

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario08_PostCustomContent.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario08_PostCustomContent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario08_PostCustomContent

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario09_GetCookie.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario09_GetCookie.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario09_GetCookie

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario10_SetCookie.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario10_SetCookie.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10_SetCookie

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario11_DeleteCookie.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario11_DeleteCookie.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11_DeleteCookie
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario12_DisableCookies.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario12_DisableCookies.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario12_DisableCookies

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario13_RetryFilter.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario13_RetryFilter.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario13_RetryFilter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario14_MeteredConnectionFilter.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario14_MeteredConnectionFilter.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario14_MeteredConnectionFilter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario15_ServerCertificateValidation.xaml.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

Scenario15_ServerCertificateValidation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario15_ServerCertificateValidation

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/SlowInputStream.cs File Reference

  • HttpClient
  • cs
Classes | Namespaces

SlowInputStream.cs File Reference

Go to the source code of this file.

Classes

class | SlowInputStream

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpMeteredConnectionFilter.cpp File Reference

  • HttpClient
  • HttpFilters
Namespaces

HttpMeteredConnectionFilter.cpp File Reference

#include "pch.h"
#include "HttpMeteredConnectionFilter.h"
#include "HttpMeteredConnectionFilter.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::HttpFilters::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpMeteredConnectionFilter.h File Reference

  • HttpClient
  • HttpFilters
Classes | Namespaces

HttpMeteredConnectionFilter.h File Reference

#include "HttpMeteredConnectionFilter.g.h"

Go to the source code of this file.

Classes

struct | HttpMeteredConnectionFilter
struct | HttpMeteredConnectionFilter

Namespaces

namespace | winrt::HttpFilters::factory_implementation
namespace | winrt::HttpFilters::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpRetryFilter.cpp File Reference

  • HttpClient
  • HttpFilters
Namespaces

HttpRetryFilter.cpp File Reference

#include "pch.h"
#include "HttpRetryFilter.h"
#include "HttpRetryFilter.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::HttpFilters::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpRetryFilter.h File Reference

  • HttpClient
  • HttpFilters
Classes | Namespaces

HttpRetryFilter.h File Reference

#include "HttpRetryFilter.g.h"

Go to the source code of this file.

Classes

struct | HttpRetryFilter
struct | HttpRetryFilter

Namespaces

namespace | winrt::HttpFilters::factory_implementation
namespace | winrt::HttpFilters::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/pch.cpp File Reference

  • HttpClient
  • HttpFilters

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/pch.h File Reference

  • HttpClient
  • HttpFilters

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Networking.Connectivity.h>
#include <winrt/Windows.Web.Http.h>
#include <winrt/Windows.Web.Http.Filters.h>
#include <winrt/Windows.Web.Http.Headers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/Project.idl File Reference

  • HttpClient
  • HttpFilters
Namespaces | Enumerations | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | HttpFilters

Enumerations

enum | MeteredConnectionPriority { Low = 0, Medium, High }

Variables

runtimeclass | HttpMeteredConnectionFilter
runtimeclass | HttpRetryFilter
Boolean | OptIn
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/CalibrationBar.xaml.cpp File Reference

  • Inclinometer
  • cpp

CalibrationBar.xaml.cpp File Reference

#include "pch.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/CalibrationBar.xaml.h File Reference

  • Inclinometer
  • cpp
Classes | Namespaces

CalibrationBar.xaml.h File Reference

#include "pch.h"
#include "CalibrationBar.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/pch.cpp File Reference

  • Inclinometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/pch.h File Reference

  • Inclinometer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/SampleConfiguration.cpp File Reference

  • Inclinometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/SampleConfiguration.h File Reference

  • Inclinometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • Inclinometer
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario1_DataEvents.xaml.h File Reference

  • Inclinometer
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario2_Polling.xaml.cpp File Reference

  • Inclinometer
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario2_Polling.xaml.h File Reference

  • Inclinometer
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario3_Calibration.xaml.cpp File Reference

  • Inclinometer
  • cpp

Scenario3_Calibration.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Calibration.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario3_Calibration.xaml.h File Reference

  • Inclinometer
  • cpp
Classes | Namespaces

Scenario3_Calibration.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Calibration.g.h"
#include "MainPage.xaml.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/CalibrationBar.xaml.cs File Reference

  • Inclinometer
  • cs
Classes | Namespaces

CalibrationBar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CalibrationBar

Namespaces

namespace | Microsoft::Samples::Devices::Sensors::Calibration
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/SampleConfiguration.cs File Reference

  • Inclinometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Inclinometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | InclinometerCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/Scenario2_Polling.xaml.cs File Reference

  • Inclinometer
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | InclinometerCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/Scenario3_Calibration.xaml.cs File Reference

  • Inclinometer
  • cs
Classes | Namespaces

Scenario3_Calibration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Calibration

Namespaces

namespace | InclinometerCS
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/cs/SampleConfiguration.cs File Reference

  • InkAnalysis
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/cs/Scenario1.xaml.cs File Reference

  • InkAnalysis
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/cs/Scenario2.xaml.cs File Reference

  • InkAnalysis
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/pch.cpp File Reference

  • IoT-GPIO
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/pch.h File Reference

  • IoT-GPIO
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/SampleConfiguration.cpp File Reference

  • IoT-GPIO
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/SampleConfiguration.h File Reference

  • IoT-GPIO
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.cpp File Reference

  • IoT-GPIO
  • cpp

Scenario1_GetAndSetPin.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_GetAndSetPin.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/Scenario1_GetAndSetPin.xaml.h File Reference

  • IoT-GPIO
  • cpp
Classes | Namespaces

Scenario1_GetAndSetPin.xaml.h File Reference

#include "Scenario1_GetAndSetPin.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/Scenario2_Listen.xaml.cpp File Reference

  • IoT-GPIO
  • cpp

Scenario2_Listen.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Listen.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/Scenario2_Listen.xaml.h File Reference

  • IoT-GPIO
  • cpp
Classes | Namespaces

Scenario2_Listen.xaml.h File Reference

#include "Scenario2_Listen.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/pch.cpp File Reference

  • IoT-GPIO
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/pch.h File Reference

  • IoT-GPIO
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.Gpio.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Project.idl File Reference

  • IoT-GPIO
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_GetAndSetPin
runtimeclass | Scenario2_Listen
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/SampleConfiguration.cpp File Reference

  • IoT-GPIO
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/SampleConfiguration.h File Reference

  • IoT-GPIO
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

hstring | PinValueToString (Windows::Devices::Gpio::GpioPinValue value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.cpp File Reference

  • IoT-GPIO
  • cppwinrt
Namespaces

Scenario1_GetAndSetPin.cpp File Reference

#include "pch.h"
#include "Scenario1_GetAndSetPin.h"
#include "Scenario1_GetAndSetPin.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.h File Reference

  • IoT-GPIO
  • cppwinrt
Classes | Namespaces

Scenario1_GetAndSetPin.h File Reference

#include "Scenario1_GetAndSetPin.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_GetAndSetPin
struct | Scenario1_GetAndSetPin

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario2_Listen.cpp File Reference

  • IoT-GPIO
  • cppwinrt
Namespaces

Scenario2_Listen.cpp File Reference

#include "pch.h"
#include "Scenario2_Listen.h"
#include "Scenario2_Listen.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario2_Listen.h File Reference

  • IoT-GPIO
  • cppwinrt
Classes | Namespaces

Scenario2_Listen.h File Reference

#include "Scenario2_Listen.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Listen
struct | Scenario2_Listen

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cs/SampleConfiguration.cs File Reference

  • IoT-GPIO
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cs/Scenario1_GetAndSetPin.xaml.cs File Reference

  • IoT-GPIO
  • cs
Classes | Namespaces

Scenario1_GetAndSetPin.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_GetAndSetPin

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cs/Scenario2_Listen.xaml.cs File Reference

  • IoT-GPIO
  • cs
Classes | Namespaces

Scenario2_Listen.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Listen
Scenario describing how to listen for changes to a GPIO pin value. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/pch.cpp File Reference

  • IoT-I2C
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/pch.h File Reference

  • IoT-I2C
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/SampleConfiguration.cpp File Reference

  • IoT-I2C
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/SampleConfiguration.h File Reference

  • IoT-I2C
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/Scenario1_ReadData.xaml.cpp File Reference

  • IoT-I2C
  • cpp

Scenario1_ReadData.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_ReadData.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/Scenario1_ReadData.xaml.h File Reference

  • IoT-I2C
  • cpp
Classes | Namespaces

Scenario1_ReadData.xaml.h File Reference

#include "Scenario1_ReadData.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/pch.cpp File Reference

  • IoT-I2C
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/pch.h File Reference

  • IoT-I2C
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.I2c.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/Project.idl File Reference

  • IoT-I2C
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_ReadData
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/SampleConfiguration.cpp File Reference

  • IoT-I2C
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/SampleConfiguration.h File Reference

  • IoT-I2C
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/Scenario1_ReadData.cpp File Reference

  • IoT-I2C
  • cppwinrt
Namespaces

Scenario1_ReadData.cpp File Reference

#include "pch.h"
#include "Scenario1_ReadData.h"
#include "Scenario1_ReadData.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/Scenario1_ReadData.h File Reference

  • IoT-I2C
  • cppwinrt
Classes | Namespaces

Scenario1_ReadData.h File Reference

#include "Scenario1_ReadData.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ReadData
struct | Scenario1_ReadData

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cs/SampleConfiguration.cs File Reference

  • IoT-I2C
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cs/Scenario1_ReadData.xaml.cs File Reference

  • IoT-I2C
  • cs
Classes | Namespaces

Scenario1_ReadData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ReadData

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/pch.cpp File Reference

  • IoT-SPI
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/pch.h File Reference

  • IoT-SPI
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/SampleConfiguration.cpp File Reference

  • IoT-SPI
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/SampleConfiguration.h File Reference

  • IoT-SPI
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/Scenario1_ReadData.xaml.cpp File Reference

  • IoT-SPI
  • cpp

Scenario1_ReadData.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_ReadData.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/Scenario1_ReadData.xaml.h File Reference

  • IoT-SPI
  • cpp
Classes | Namespaces

Scenario1_ReadData.xaml.h File Reference

#include "Scenario1_ReadData.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/pch.cpp File Reference

  • IoT-SPI
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/pch.h File Reference

  • IoT-SPI
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Spi.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/Project.idl File Reference

  • IoT-SPI
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/SampleConfiguration.cpp File Reference

  • IoT-SPI
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/SampleConfiguration.h File Reference

  • IoT-SPI
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/Scenario1_ReadData.cpp File Reference

  • IoT-SPI
  • cppwinrt
Namespaces

Scenario1_ReadData.cpp File Reference

#include "pch.h"
#include "Scenario1_ReadData.h"
#include "Scenario1_ReadData.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/Scenario1_ReadData.h File Reference

  • IoT-SPI
  • cppwinrt
Classes | Namespaces

Scenario1_ReadData.h File Reference

#include "Scenario1_ReadData.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ReadData
struct | Scenario1_ReadData

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cs/SampleConfiguration.cs File Reference

  • IoT-SPI
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cs/Scenario1_ReadData.xaml.cs File Reference

  • IoT-SPI
  • cs
Classes | Namespaces

Scenario1_ReadData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ReadData

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/pch.cpp File Reference

  • JapanesePhoneticAnalysis
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/pch.h File Reference

  • JapanesePhoneticAnalysis
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/SampleConfiguration.cpp File Reference

  • JapanesePhoneticAnalysis
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/SampleConfiguration.h File Reference

  • JapanesePhoneticAnalysis
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.cpp File Reference

  • JapanesePhoneticAnalysis
  • cpp

Scenario1_Analyze.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "Scenario1_Analyze.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/Scenario1_Analyze.xaml.h File Reference

  • JapanesePhoneticAnalysis
  • cpp
Classes | Namespaces

Scenario1_Analyze.xaml.h File Reference

#include "Scenario1_Analyze.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/pch.cpp File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/pch.h File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/Project.idl File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Analyze
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.cpp File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.h File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.cpp File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt
Namespaces

Scenario1_Analyze.cpp File Reference

#include "pch.h"
#include "Scenario1_Analyze.h"
#include "Scenario1_Analyze.g.cpp"
#include "MainPage.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.h File Reference

  • JapanesePhoneticAnalysis
  • cppwinrt
Classes | Namespaces

Scenario1_Analyze.h File Reference

#include "Scenario1_Analyze.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Analyze
struct | Scenario1_Analyze

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cs/SampleConfiguration.cs File Reference

  • JapanesePhoneticAnalysis
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cs/Scenario1_Analyze.xaml.cs File Reference

  • JapanesePhoneticAnalysis
  • cs
Classes | Namespaces

Scenario1_Analyze.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Analyze

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/pch.cpp File Reference

  • Json
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/pch.h File Reference

  • Json
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Data.Json.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include "School.h"
#include "User.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/Project.idl File Reference

  • Json
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_ParseAndStringify
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/SampleConfiguration.cpp File Reference

  • Json
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/SampleConfiguration.h File Reference

  • Json
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/Scenario1_ParseAndStringify.cpp File Reference

  • Json
  • cppwinrt
Namespaces

Scenario1_ParseAndStringify.cpp File Reference

#include "pch.h"
#include "Scenario1_ParseAndStringify.h"
#include "Scenario1_ParseAndStringify.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/Scenario1_ParseAndStringify.h File Reference

  • Json
  • cppwinrt
Classes | Namespaces

Scenario1_ParseAndStringify.h File Reference

#include <winrt/SDKTemplate.h>
#include "Scenario1_ParseAndStringify.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ParseAndStringify
struct | Scenario1_ParseAndStringify

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/School.cpp File Reference

  • Json
  • cppwinrt
Namespaces

School.cpp File Reference

#include "pch.h"
#include "School.h"
#include "School.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/School.h File Reference

  • Json
  • cppwinrt
Classes | Namespaces

School.h File Reference

#include "School.g.h"

Go to the source code of this file.

Classes

struct | School
struct | School

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/User.cpp File Reference

  • Json
  • cppwinrt
Namespaces

User.cpp File Reference

#include "pch.h"
#include "User.h"
#include "User.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/User.h File Reference

  • Json
  • cppwinrt
Classes | Namespaces

User.h File Reference

#include <winrt/SDKTemplate.h>
#include "User.g.h"

Go to the source code of this file.

Classes

struct | User
struct | User

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/SampleConfiguration.cs File Reference

  • Json
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/Scenario1_ParseAndStringify.xaml.cs File Reference

  • Json
  • cs
Classes | Namespaces

Scenario1_ParseAndStringify.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ParseAndStringify

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/School.cs File Reference

  • Json
  • cs
Classes | Namespaces

School.cs File Reference

Go to the source code of this file.

Classes

class | School

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/User.cs File Reference

  • Json
  • cs
Classes | Namespaces

User.cs File Reference

Go to the source code of this file.

Classes

class | User

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/pch.cpp File Reference

  • JumpList
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/pch.h File Reference

  • JumpList
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/SampleConfiguration.cpp File Reference

  • JumpList
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/SampleConfiguration.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario1_Launched.xaml.cpp File Reference

  • JumpList
  • cpp

Scenario1_Launched.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Launched.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario1_Launched.xaml.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

Scenario1_Launched.xaml.h File Reference

#include "Scenario1_Launched.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario2_Remove.xaml.cpp File Reference

  • JumpList
  • cpp

Scenario2_Remove.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Remove.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario2_Remove.xaml.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

Scenario2_Remove.xaml.h File Reference

#include "Scenario2_Remove.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario3_CustomItems.xaml.cpp File Reference

  • JumpList
  • cpp

Scenario3_CustomItems.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomItems.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario3_CustomItems.xaml.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

Scenario3_CustomItems.xaml.h File Reference

#include "Scenario3_CustomItems.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.cpp File Reference

  • JumpList
  • cpp

Scenario4_ChangeSystemGroup.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_ChangeSystemGroup.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

Scenario4_ChangeSystemGroup.xaml.h File Reference

#include "Scenario4_ChangeSystemGroup.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario5_IsSupported.xaml.cpp File Reference

  • JumpList
  • cpp

Scenario5_IsSupported.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_IsSupported.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario5_IsSupported.xaml.h File Reference

  • JumpList
  • cpp
Classes | Namespaces

Scenario5_IsSupported.xaml.h File Reference

#include "Scenario5_IsSupported.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/pch.cpp File Reference

  • JumpList
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/pch.h File Reference

  • JumpList
  • cppwinrt

pch.h File Reference

#include <unknwn.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.AccessCache.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.StartScreen.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Project.idl File Reference

  • JumpList
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Launched
runtimeclass | Scenario2_Remove
runtimeclass | Scenario3_CustomItems
runtimeclass | Scenario4_ChangeSystemGroup
runtimeclass | Scenario5_IsSupported
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/SampleConfiguration.cpp File Reference

  • JumpList
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/SampleConfiguration.h File Reference

  • JumpList
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"
#include "App.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

void | App_LaunchCompleted (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e)
void | App_OnFileActivated (Windows::ApplicationModel::Activation::FileActivatedEventArgs const &e)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario1_Launched.cpp File Reference

  • JumpList
  • cppwinrt
Namespaces

Scenario1_Launched.cpp File Reference

#include "pch.h"
#include "Scenario1_Launched.h"
#include "Scenario1_Launched.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario1_Launched.h File Reference

  • JumpList
  • cppwinrt
Classes | Namespaces

Scenario1_Launched.h File Reference

#include "Scenario1_Launched.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Launched
struct | Scenario1_Launched

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario2_Remove.cpp File Reference

  • JumpList
  • cppwinrt
Namespaces

Scenario2_Remove.cpp File Reference

#include "pch.h"
#include "Scenario2_Remove.h"
#include "Scenario2_Remove.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario2_Remove.h File Reference

  • JumpList
  • cppwinrt
Classes | Namespaces

Scenario2_Remove.h File Reference

#include "Scenario2_Remove.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Remove
struct | Scenario2_Remove

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario3_CustomItems.cpp File Reference

  • JumpList
  • cppwinrt
Namespaces

Scenario3_CustomItems.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomItems.h"
#include "Scenario3_CustomItems.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario3_CustomItems.h File Reference

  • JumpList
  • cppwinrt
Classes | Namespaces

Scenario3_CustomItems.h File Reference

#include "Scenario3_CustomItems.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_CustomItems
struct | Scenario3_CustomItems

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario4_ChangeSystemGroup.cpp File Reference

  • JumpList
  • cppwinrt
Namespaces

Scenario4_ChangeSystemGroup.cpp File Reference

#include "pch.h"
#include "Scenario4_ChangeSystemGroup.h"
#include "Scenario4_ChangeSystemGroup.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario4_ChangeSystemGroup.h File Reference

  • JumpList
  • cppwinrt
Classes | Namespaces

Scenario4_ChangeSystemGroup.h File Reference

#include "Scenario4_ChangeSystemGroup.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_ChangeSystemGroup
struct | Scenario4_ChangeSystemGroup

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario5_IsSupported.cpp File Reference

  • JumpList
  • cppwinrt
Namespaces

Scenario5_IsSupported.cpp File Reference

#include "pch.h"
#include "Scenario5_IsSupported.h"
#include "Scenario5_IsSupported.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario5_IsSupported.h File Reference

  • JumpList
  • cppwinrt
Classes | Namespaces

Scenario5_IsSupported.h File Reference

#include "Scenario5_IsSupported.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_IsSupported
struct | Scenario5_IsSupported

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/SampleConfiguration.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario1_Launched.xaml.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

Scenario1_Launched.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Launched

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario2_Remove.xaml.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

Scenario2_Remove.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Remove

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario3_CustomItems.xaml.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

Scenario3_CustomItems.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_CustomItems

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario4_ChangeSystemGroup.xaml.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

Scenario4_ChangeSystemGroup.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ChangeSystemGroup

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario5_IsSupported.xaml.cs File Reference

  • JumpList
  • cs
Classes | Namespaces

Scenario5_IsSupported.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_IsSupported

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Account.cpp File Reference

  • KeyCredentialManager
  • cpp

Account.cpp File Reference

#include "pch.h"
#include "Account.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Account.h File Reference

  • KeyCredentialManager
  • cpp
Classes | Namespaces

Account.h File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/App.xaml.cpp File Reference

  • KeyCredentialManager
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Content.xaml.cpp File Reference

  • KeyCredentialManager
  • cpp

Content.xaml.cpp File Reference

#include "pch.h"
#include "Content.xaml.h"
#include "UserSelect.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Content.xaml.h File Reference

  • KeyCredentialManager
  • cpp
Classes | Namespaces

Content.xaml.h File Reference

#include "Content.g.h"
#include "MainPage.xaml.h"
#include "Account.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/pch.cpp File Reference

  • KeyCredentialManager
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/pch.h File Reference

  • KeyCredentialManager
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SampleConfiguration.cpp File Reference

  • KeyCredentialManager
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SampleConfiguration.h File Reference

  • KeyCredentialManager
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SignIn.xaml.cpp File Reference

  • KeyCredentialManager
  • cpp

SignIn.xaml.cpp File Reference

#include "pch.h"
#include "SignIn.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SignIn.xaml.h File Reference

  • KeyCredentialManager
  • cpp
Classes | Namespaces

SignIn.xaml.h File Reference

#include "SignIn.g.h"
#include "MainPage.xaml.h"
#include "Account.h"
#include "pch.h"
#include "SignIn.xaml.h"
#include "UserSelect.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/UserSelect.xaml.cpp File Reference

  • KeyCredentialManager
  • cpp

UserSelect.xaml.cpp File Reference

#include "pch.h"
#include "UserSelect.xaml.h"
#include "Account.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/UserSelect.xaml.h File Reference

  • KeyCredentialManager
  • cpp
Classes | Namespaces

UserSelect.xaml.h File Reference

#include "UserSelect.g.h"
#include "MainPage.xaml.h"
#include "Account.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/Account.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

Account.cs File Reference

Go to the source code of this file.

Classes

class | Account

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/AccountsHelper.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

AccountsHelper.cs File Reference

Go to the source code of this file.

Classes

class | AccountsHelper

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/Content.xaml.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

Content.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Content

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/SampleConfiguration.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/SignIn.xaml.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

SignIn.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SignIn
The sign in form that contains username and password fields and the option to sign in with either Microsoft Passport or traditional username/password authentication. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/UserSelect.xaml.cs File Reference

  • KeyCredentialManager
  • cs
Classes | Namespaces

UserSelect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | UserSelect
The user select page, if users successfully log into the app they will be added to a saved set of users. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/pch.cpp File Reference

  • LampArray
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/pch.h File Reference

  • LampArray
  • cppwinrt
Defines

pch.h File Reference

#include <algorithm>
#include <array>
#include <memory>
#include <numeric>
#include <random>
#include <vector>
#include <hstring.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Devices.Lights.h>
#include <winrt/Windows.Devices.Lights.Effects.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Graphics.Imaging.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Microsoft.Graphics.Canvas.h>
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Defines

#define NOMINMAX

Define Documentation

#define NOMINMAX

Definition at line 10 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Project.idl File Reference

  • LampArray
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Basics
runtimeclass | Scenario2_Effects
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/SampleConfiguration.cpp File Reference

  • LampArray
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/SampleConfiguration.h File Reference

  • LampArray
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | LampArrayInfo

Namespaces

namespace | std
namespace | winrt::SDKTemplate

Functions

std::wstring | to_wstring (winrt::Windows::Devices::Lights::LampArrayKind lampArrayKind)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario1_Basics.cpp File Reference

  • LampArray
  • cppwinrt
Namespaces

Scenario1_Basics.cpp File Reference

#include "pch.h"
#include "Scenario1_Basics.h"
#include "Scenario1_Basics.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario1_Basics.h File Reference

  • LampArray
  • cppwinrt
Classes | Namespaces

Scenario1_Basics.h File Reference

#include "Scenario1_Basics.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Basics
struct | Scenario1_Basics

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario2_Effects.cpp File Reference

  • LampArray
  • cppwinrt
Namespaces | Variables

Scenario2_Effects.cpp File Reference

#include "pch.h"
#include "Scenario2_Effects.h"
#include "Scenario2_Effects.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario2_Effects.cpp}
namespace | winrt::SDKTemplate::implementation

Variables

constexpr TimeSpan | ColorRampDuration = std::chrono::milliseconds(500)
constexpr int | CustomEffectFrameCount = 30
constexpr TimeSpan | EffectUpdateInterval = std::chrono::milliseconds(33)
constexpr int | GeneratedBitmapEffectFrameCount = 60
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario2_Effects.h File Reference

  • LampArray
  • cppwinrt
Classes | Namespaces

Scenario2_Effects.h File Reference

#include "Scenario2_Effects.g.h"
#include <numeric>

Go to the source code of this file.

Classes

struct | Scenario2_Effects
struct | CustomEffectState
struct | GeneratedBitmapState
struct | Scenario2_Effects

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/SampleConfiguration.cs File Reference

  • LampArray
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | LampArrayInfo
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/Scenario1_Basics.xaml.cs File Reference

  • LampArray
  • cs
Classes | Namespaces

Scenario1_Basics.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basics
This page uses methods of the ApiInformation class to detect the presence of types, methods, events, and enumerated values. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/Scenario2_Effects.xaml.cs File Reference

  • LampArray
  • cs
Classes | Namespaces

Scenario2_Effects.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomEffectState
class | GeneratedBitmapState
class | Scenario2_Effects

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/pch.cpp File Reference

  • LampDevice
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/pch.h File Reference

  • LampDevice
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/SampleConfiguration.cpp File Reference

  • LampDevice
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/SampleConfiguration.h File Reference

  • LampDevice
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario1_GetLamp.xaml.cpp File Reference

  • LampDevice
  • cpp

Scenario1_GetLamp.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_GetLamp.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario1_GetLamp.xaml.h File Reference

  • LampDevice
  • cpp
Classes | Namespaces

Scenario1_GetLamp.xaml.h File Reference

#include "Scenario1_GetLamp.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario2_EnableSettings.xaml.cpp File Reference

  • LampDevice
  • cpp

Scenario2_EnableSettings.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_EnableSettings.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario2_EnableSettings.xaml.h File Reference

  • LampDevice
  • cpp
Classes | Namespaces

Scenario2_EnableSettings.xaml.h File Reference

#include "Scenario2_EnableSettings.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.cpp File Reference

  • LampDevice
  • cpp

Scenario3_AvailabilityChanged.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_AvailabilityChanged.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.h File Reference

  • LampDevice
  • cpp
Classes | Namespaces

Scenario3_AvailabilityChanged.xaml.h File Reference

#include "Scenario3_AvailabilityChanged.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/SampleConfiguration.cs File Reference

  • LampDevice
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/Scenario1_GetLamp.xaml.cs File Reference

  • LampDevice
  • cs
Classes | Namespaces

Scenario1_GetLamp.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_GetLamp
Scenario 1 Get Lamp Page. More...

Namespaces

namespace | Lamp
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/Scenario2_EnableSettings.xaml.cs File Reference

  • LampDevice
  • cs
Classes | Namespaces

Scenario2_EnableSettings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_EnableSettings
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Lamp
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/Scenario3_AvailabilityChanged.xaml.cs File Reference

  • LampDevice
  • cs
Classes | Namespaces

Scenario3_AvailabilityChanged.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AvailabilityChanged
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Lamp
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/pch.cpp File Reference

  • LanguageFont
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/pch.h File Reference

  • LanguageFont
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.Fonts.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Project.idl File Reference

  • LanguageFont
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_UIFonts
runtimeclass | Scenario2_DocumentFonts
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/SampleConfiguration.cpp File Reference

  • LanguageFont
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/SampleConfiguration.h File Reference

  • LanguageFont
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

template<typename T >
void | ApplyLanguageFont (T const &element, Windows::Globalization::Fonts::LanguageFont const &languageFont)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Scenario1_UIFonts.cpp File Reference

  • LanguageFont
  • cppwinrt
Namespaces

Scenario1_UIFonts.cpp File Reference

#include "pch.h"
#include "Scenario1_UIFonts.h"
#include "Scenario1_UIFonts.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Scenario1_UIFonts.h File Reference

  • LanguageFont
  • cppwinrt
Classes | Namespaces

Scenario1_UIFonts.h File Reference

#include "Scenario1_UIFonts.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_UIFonts
struct | Scenario1_UIFonts

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Scenario2_DocumentFonts.cpp File Reference

  • LanguageFont
  • cppwinrt
Namespaces

Scenario2_DocumentFonts.cpp File Reference

#include "pch.h"
#include "Scenario2_DocumentFonts.h"
#include "Scenario2_DocumentFonts.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Scenario2_DocumentFonts.h File Reference

  • LanguageFont
  • cppwinrt
Classes | Namespaces

Scenario2_DocumentFonts.h File Reference

#include "Scenario2_DocumentFonts.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_DocumentFonts
struct | Scenario2_DocumentFonts

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cs/SampleConfiguration.cs File Reference

  • LanguageFont
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cs/Scenario1_UIFonts.xaml.cs File Reference

  • LanguageFont
  • cs
Classes | Namespaces

Scenario1_UIFonts.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_UIFonts

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cs/Scenario2_DocumentFonts.xaml.cs File Reference

  • LanguageFont
  • cs
Classes | Namespaces

Scenario2_DocumentFonts.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DocumentFonts
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/pch.cpp File Reference

  • LibraryManagement
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/pch.h File Reference

  • LibraryManagement
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S1_AddFolder.xaml.cpp File Reference

  • LibraryManagement
  • cpp

S1_AddFolder.xaml.cpp File Reference

#include "pch.h"
#include "S1_AddFolder.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S1_AddFolder.xaml.h File Reference

  • LibraryManagement
  • cpp
Classes | Namespaces

S1_AddFolder.xaml.h File Reference

#include "S1_AddFolder.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S2_ListFolders.xaml.cpp File Reference

  • LibraryManagement
  • cpp

S2_ListFolders.xaml.cpp File Reference

#include "pch.h"
#include "S2_ListFolders.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S2_ListFolders.xaml.h File Reference

  • LibraryManagement
  • cpp
Classes | Namespaces

S2_ListFolders.xaml.h File Reference

#include "S2_ListFolders.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S3_RemoveFolder.xaml.cpp File Reference

  • LibraryManagement
  • cpp

S3_RemoveFolder.xaml.cpp File Reference

#include "pch.h"
#include "S3_RemoveFolder.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S3_RemoveFolder.xaml.h File Reference

  • LibraryManagement
  • cpp
Classes | Namespaces

S3_RemoveFolder.xaml.h File Reference

#include "S3_RemoveFolder.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/SampleConfiguration.cpp File Reference

  • LibraryManagement
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/SampleConfiguration.h File Reference

  • LibraryManagement
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/S1_AddFolder.xaml.cs File Reference

  • LibraryManagement
  • cs
Classes | Namespaces

S1_AddFolder.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/S2_ListFolders.xaml.cs File Reference

  • LibraryManagement
  • cs
Classes | Namespaces

S2_ListFolders.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/S3_RemoveFolder.xaml.cs File Reference

  • LibraryManagement
  • cs
Classes | Namespaces

S3_RemoveFolder.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/SampleConfiguration.cs File Reference

  • LibraryManagement
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/pch.cpp File Reference

  • LightSensor
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/pch.h File Reference

  • LightSensor
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/SampleConfiguration.cpp File Reference

  • LightSensor
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/SampleConfiguration.h File Reference

  • LightSensor
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • LightSensor
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/Scenario1_DataEvents.xaml.h File Reference

  • LightSensor
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/Scenario2_Polling.xaml.cpp File Reference

  • LightSensor
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/Scenario2_Polling.xaml.h File Reference

  • LightSensor
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cs/SampleConfiguration.cs File Reference

  • LightSensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cs/Scenario1_DataEvents.xaml.cs File Reference

  • LightSensor
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | LightSensorCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cs/Scenario2_Polling.xaml.cs File Reference

  • LightSensor
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | LightSensorCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/pch.cpp File Reference

  • LineDisplay
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/pch.h File Reference

  • LineDisplay
  • cpp

pch.h File Reference

#include <collection.h>
#include <experimental/resumable>
#include <ppltasks.h>
#include <pplawait.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/SampleConfiguration.cpp File Reference

  • LineDisplay
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/SampleConfiguration.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Helpers

Functions

void | AddItem (Windows::UI::Xaml::Controls::ComboBox^comboBox, Platform::Object^value, Platform::String^name)
template<typename T >
void | AddItem (Windows::UI::Xaml::Controls::ComboBox^comboBox, T value)
template<typename T >
T | GetSelectedItemTag (Windows::UI::Xaml::Controls::Primitives::Selector^selector)
template<typename TLambda >
Concurrency::task< void > | invoke_async_lambda (TLambda lambda)
double | MillisecondsFromTimeSpan (Windows::Foundation::TimeSpan value)
template<typename T >
T | ParseUIntWithFallback (Windows::UI::Xaml::Controls::TextBox^textBox, T fallback)
Windows::Foundation::TimeSpan | TimeSpanFromMilliseconds (double value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario1_SelectDisplay.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario1_SelectDisplay.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SelectDisplay.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario1_SelectDisplay.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario1_SelectDisplay.xaml.h File Reference

#include "Scenario1_SelectDisplay.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario2_DisplayText.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario2_DisplayText.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_DisplayText.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario2_DisplayText.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario2_DisplayText.xaml.h File Reference

#include "Scenario2_DisplayText.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario3_UsingWindows.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario3_UsingWindows.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_UsingWindows.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario3_UsingWindows.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario3_UsingWindows.xaml.h File Reference

#include "Scenario3_UsingWindows.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario4_UpdatingLineDisplayAttributes.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_UpdatingLineDisplayattributes.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario4_UpdatingLineDisplayAttributes.xaml.h File Reference

#include "Scenario4_UpdatingLineDisplayAttributes.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario5_DefiningCustomGlyphs.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_DefiningCustomGlyphs.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario5_DefiningCustomGlyphs.xaml.h File Reference

#include "Scenario5_DefiningCustomGlyphs.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario6_ManipulatingCursorAttributes.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_ManipulatingCursorAttributes.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario6_ManipulatingCursorAttributes.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario6_ManipulatingCursorAttributes.xaml.h File Reference

#include "Scenario6_ManipulatingCursorAttributes.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.cpp File Reference

  • LineDisplay
  • cpp

Scenario7_ScrollingContentUsingMarquee.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_ScrollingContentUsingMarquee.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.h File Reference

  • LineDisplay
  • cpp
Classes | Namespaces

Scenario7_ScrollingContentUsingMarquee.xaml.h File Reference

#include "Scenario7_ScrollingContentUsingMarquee.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/SampleConfiguration.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | Helpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario1_SelectDisplay.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario1_SelectDisplay.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SelectDisplay

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario2_DisplayText.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario2_DisplayText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DisplayText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario3_UsingWindows.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario3_UsingWindows.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_UsingWindows
class | WindowInfo

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario4_UpdatingLineDisplayAttributes.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario4_UpdatingLineDisplayAttributes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_UpdatingLineDisplayAttributes

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario5_DefiningCustomGlyphs.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario5_DefiningCustomGlyphs.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_DefiningCustomGlyphs

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario6_ManipulatingCursorAttributes.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario6_ManipulatingCursorAttributes.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_ManipulatingCursorAttributes

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario7_ScrollingContentUsingMarquee.xaml.cs File Reference

  • LineDisplay
  • cs
Classes | Namespaces

Scenario7_ScrollingContentUsingMarquee.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_ScrollingContentUsingMarquee

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/pch.cpp File Reference

  • LinguisticServices
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/pch.h File Reference

  • LinguisticServices
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Globalization.Collation.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Project.idl File Reference

  • LinguisticServices
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_LanguageDetection
runtimeclass | Scenario2_ScriptDetection
runtimeclass | Scenario3_Transliteration
runtimeclass | Scenario4_CharacterGrouping
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/SampleConfiguration.cpp File Reference

  • LinguisticServices
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/SampleConfiguration.h File Reference

  • LinguisticServices
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario1_LanguageDetection.cpp File Reference

  • LinguisticServices
  • cppwinrt
Namespaces

Scenario1_LanguageDetection.cpp File Reference

#include "pch.h"
#include "Scenario1_LanguageDetection.h"
#include "Scenario1_LanguageDetection.g.cpp"
#include "elsutil.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario1_LanguageDetection.h File Reference

  • LinguisticServices
  • cppwinrt
Classes | Namespaces

Scenario1_LanguageDetection.h File Reference

#include "Scenario1_LanguageDetection.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_LanguageDetection
struct | Scenario1_LanguageDetection

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario2_ScriptDetection.cpp File Reference

  • LinguisticServices
  • cppwinrt
Namespaces

Scenario2_ScriptDetection.cpp File Reference

#include "pch.h"
#include "Scenario2_ScriptDetection.h"
#include "Scenario2_ScriptDetection.g.cpp"
#include "elsutil.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario2_ScriptDetection.h File Reference

  • LinguisticServices
  • cppwinrt
Classes | Namespaces

Scenario2_ScriptDetection.h File Reference

#include "Scenario2_ScriptDetection.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_ScriptDetection
struct | Scenario2_ScriptDetection

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario3_Transliteration.cpp File Reference

  • LinguisticServices
  • cppwinrt
Namespaces

Scenario3_Transliteration.cpp File Reference

#include "pch.h"
#include "Scenario3_Transliteration.h"
#include "Scenario3_Transliteration.g.cpp"
#include "elsutil.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario3_Transliteration.h File Reference

  • LinguisticServices
  • cppwinrt
Classes | Namespaces

Scenario3_Transliteration.h File Reference

#include "Scenario3_Transliteration.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_Transliteration
struct | Scenario3_Transliteration

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.cpp File Reference

  • LinguisticServices
  • cppwinrt
Namespaces

Scenario4_CharacterGrouping.cpp File Reference

#include "pch.h"
#include "Scenario4_CharacterGrouping.h"
#include "Scenario4_CharacterGrouping.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.h File Reference

  • LinguisticServices
  • cppwinrt
Classes | Namespaces

Scenario4_CharacterGrouping.h File Reference

#include "Scenario4_CharacterGrouping.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_CharacterGrouping
struct | Scenario4_CharacterGrouping

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/SampleConfiguration.cs File Reference

  • LinguisticServices
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/Scenario1_LanguageDetection.xaml.cs File Reference

  • LinguisticServices
  • cs
Classes | Namespaces

Scenario1_LanguageDetection.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_LanguageDetection

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/Scenario2_ScriptDetection.xaml.cs File Reference

  • LinguisticServices
  • cs
Classes | Namespaces

Scenario2_ScriptDetection.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ScriptDetection

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/Scenario3_Transliteration.xaml.cs File Reference

  • LinguisticServices
  • cs
Classes | Namespaces

Scenario3_Transliteration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Transliteration

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/Scenario4_CharacterGrouping.xaml.cs File Reference

  • LinguisticServices
  • cs
Classes | Namespaces

Scenario4_CharacterGrouping.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_CharacterGrouping
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.cpp File Reference

  • LinguisticServices
  • RuntimeComponent
Namespaces

LinguisticServices.cpp File Reference

#include "pch.h"
#include "LinguisticServices.h"
#include "LinguisticServices.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::Sample::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.h File Reference

  • LinguisticServices
  • RuntimeComponent
Classes | Namespaces

LinguisticServices.h File Reference

#include "LinguisticServices.g.h"

Go to the source code of this file.

Classes

struct | LinguisticServices
struct | LinguisticServices

Namespaces

namespace | winrt::Sample::factory_implementation
namespace | winrt::Sample::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.idl File Reference

  • LinguisticServices
  • RuntimeComponent
Classes | Namespaces

LinguisticServices.idl File Reference

Go to the source code of this file.

Classes

struct | RecognizedTextRun

Namespaces

namespace | Sample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/pch.cpp File Reference

  • LinguisticServices
  • RuntimeComponent

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/pch.h File Reference

  • LinguisticServices
  • RuntimeComponent

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <elsutil.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/shared/elsutil.h File Reference

  • LinguisticServices
  • shared
Classes | Namespaces | Functions

elsutil.h File Reference

#include <windows.h>
#include <elscore.h>
#include <elssrvc.h>

Go to the source code of this file.

Classes

struct | unique_bag
struct | unique_services

Namespaces

namespace | ELS
namespace | ELS::Private

Functions

void | MappingRecognizeTextFromService (REFGUID service, wchar_t const *text, DWORD length, unique_bag &bag)
template<typename Lambda >
void | RecognizeTextLanguages (wchar_t const *text, DWORD length, Lambda &&callback)
template<typename Lambda >
void | RecognizeTextScripts (wchar_t const *text, DWORD length, Lambda &&callback)
template<typename Lambda >
void | TransliterateFromCyrillicToLatin (wchar_t const *text, DWORD length, Lambda &&callback)
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/ILivePlayer.cs File Reference

  • LiveDash
  • cs
  • LiveDash
Classes | Namespaces

ILivePlayer.cs File Reference

Go to the source code of this file.

Classes

interface | ILivePlayer

Namespaces

namespace | LiveDash
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/LiveDashPlayer.cs File Reference

  • LiveDash
  • cs
  • LiveDash
Classes | Namespaces

LiveDashPlayer.cs File Reference

Go to the source code of this file.

Classes

class | LiveDashPlayer

Namespaces

namespace | LiveDash
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/LiveSourceBufferManager.cs File Reference

  • LiveDash
  • cs
  • LiveDash
Classes | Namespaces

LiveSourceBufferManager.cs File Reference

Go to the source code of this file.

Classes

class | LiveSourceBufferManager
This class extends a source buffer manager but handles cases for live playback such as setting a live offset and the logic to pick the next segment to play. More...

Namespaces

namespace | LiveDash
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Player.cs File Reference

  • LiveDash
  • cs
  • LiveDash
Classes | Namespaces

Player.cs File Reference

Go to the source code of this file.

Classes

class | Player
This class manages the source buffers (audio and video) and takes care of setting the mse stream source on the media element. More...

Namespaces

namespace | LiveDash
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/SourceBufferManager.cs File Reference

  • LiveDash
  • cs
  • LiveDash
Classes | Namespaces

SourceBufferManager.cs File Reference

Go to the source code of this file.

Classes

class | SourceBufferManager
Handles the source buffer for each stream of data. More...

Namespaces

namespace | LiveDash
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/Manifest.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Models
Classes | Namespaces

Manifest.cs File Reference

Go to the source code of this file.

Classes

class | Manifest
Represents a DASH manifest of type .mpd. More...

Namespaces

namespace | LiveDash::Models
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/MediaSegment.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Models
Classes | Namespaces

MediaSegment.cs File Reference

Go to the source code of this file.

Classes

class | MediaSegment
Represents a media segment withing a media stream. More...

Namespaces

namespace | LiveDash::Models
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/MediaSegmentInformation.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Models
Classes | Namespaces

MediaSegmentInformation.cs File Reference

Go to the source code of this file.

Classes

class | MediaSegmentInformation

Namespaces

namespace | LiveDash::Models
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/MediaStream.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Models
Classes | Namespaces

MediaStream.cs File Reference

Go to the source code of this file.

Classes

class | MediaStream
Represents a stream of data, such as audio or video. More...

Namespaces

namespace | LiveDash::Models
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/Period.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Models
Classes | Namespaces

Period.cs File Reference

Go to the source code of this file.

Classes

class | Period
Represents a period within a media presentation description. More...

Namespaces

namespace | LiveDash::Models
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Util/DashManifestParser.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Util
Classes | Namespaces

DashManifestParser.cs File Reference

Go to the source code of this file.

Classes

class | DashManifestParser

Namespaces

namespace | LiveDash::Util
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Util/Utils.cs File Reference

  • LiveDash
  • cs
  • LiveDash
  • Util
Classes | Namespaces

Utils.cs File Reference

Go to the source code of this file.

Classes

class | Downloader

Namespaces

namespace | LiveDash::Util
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/MainPage.xaml.cs File Reference

  • LiveDash
  • cs
  • LiveDashApp
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/SampleConfiguration.cs File Reference

  • LiveDash
  • cs
  • LiveDashApp
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/Views/LiveDashPlayer.xaml.cs File Reference

  • LiveDash
  • cs
  • LiveDashApp
  • Views
Classes | Namespaces

LiveDashPlayer.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DASHEntry
class | LiveDashPlayer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | LiveDashApp
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/Views/Log.xaml.cs File Reference

  • LiveDash
  • cs
  • LiveDashApp
  • Views

Log.xaml.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/pch.cpp File Reference

  • LockScreenApps
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/pch.h File Reference

  • LockScreenApps
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/NotificationsExtensions.h"
#include "winrt/NotificationsExtensions.Badges.h"
#include "winrt/NotificationsExtensions.Tiles.h"
#include "winrt/NotificationsExtensions.Toasts.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Notifications.h"
#include "winrt/Windows.UI.Popups.h"
#include "winrt/Windows.UI.StartScreen.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Project.idl File Reference

  • LockScreenApps
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Configure
runtimeclass | Scenario2_Notifications
runtimeclass | Scenario3_SecondaryTiles
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/SampleConfiguration.cpp File Reference

  • LockScreenApps
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/SampleConfiguration.h File Reference

  • LockScreenApps
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario1_Configure.cpp File Reference

  • LockScreenApps
  • cppwinrt
Namespaces

Scenario1_Configure.cpp File Reference

#include "pch.h"
#include "Scenario1_Configure.h"
#include "Scenario1_Configure.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario1_Configure.h File Reference

  • LockScreenApps
  • cppwinrt
Classes | Namespaces

Scenario1_Configure.h File Reference

#include "Scenario1_Configure.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_Configure
struct | Scenario1_Configure

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario2_Notifications.cpp File Reference

  • LockScreenApps
  • cppwinrt
Namespaces

Scenario2_Notifications.cpp File Reference

#include "pch.h"
#include "Scenario2_Notifications.h"
#include "Scenario2_Notifications.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario2_Notifications.h File Reference

  • LockScreenApps
  • cppwinrt
Classes | Namespaces

Scenario2_Notifications.h File Reference

#include "Scenario2_Notifications.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Notifications
struct | Scenario2_Notifications

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.cpp File Reference

  • LockScreenApps
  • cppwinrt
Namespaces

Scenario3_SecondaryTiles.cpp File Reference

#include "pch.h"
#include "Scenario3_SecondaryTiles.h"
#include "Scenario3_SecondaryTiles.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.h File Reference

  • LockScreenApps
  • cppwinrt
Classes | Namespaces

Scenario3_SecondaryTiles.h File Reference

#include "Scenario3_SecondaryTiles.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_SecondaryTiles
struct | Scenario3_SecondaryTiles

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/SampleConfiguration.cs File Reference

  • LockScreenApps
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/Scenario1_Configure.xaml.cs File Reference

  • LockScreenApps
  • cs
Classes | Namespaces

Scenario1_Configure.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Configure

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/Scenario2_Notifications.xaml.cs File Reference

  • LockScreenApps
  • cs
Classes | Namespaces

Scenario2_Notifications.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Notifications

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/Scenario3_SecondaryTiles.xaml.cs File Reference

  • LockScreenApps
  • cs
Classes | Namespaces

Scenario3_SecondaryTiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_SecondaryTiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/FileLoggingSessionScenario.cpp File Reference

  • Logging
  • cpp
Defines

FileLoggingSessionScenario.cpp File Reference

#include "pch.h"
#include "FileLoggingSessionScenario.h"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Defines

#define | DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"
#define | DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"
#define | LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME SCENARIO_PREFIX L"LogFileGeneratedBeforeSuspend"
#define | LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"
#define | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
#define | SCENARIO_PREFIX L"FileLoggingSessionScenario_"

Define Documentation

#define DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"

Definition at line 13 of file FileLoggingSessionScenario.cpp.

#define DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"

Definition at line 12 of file FileLoggingSessionScenario.cpp.

#define LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME SCENARIO_PREFIX L"LogFileGeneratedBeforeSuspend"

Definition at line 16 of file FileLoggingSessionScenario.cpp.

#define LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"

Definition at line 15 of file FileLoggingSessionScenario.cpp.

#define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"

Definition at line 14 of file FileLoggingSessionScenario.cpp.

#define SCENARIO_PREFIX L"FileLoggingSessionScenario_"

Definition at line 11 of file FileLoggingSessionScenario.cpp.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/FileLoggingSessionScenario.h File Reference

  • Logging
  • cpp
Classes | Namespaces

FileLoggingSessionScenario.h File Reference

#include "LoggingScenarioEventArgs.h"
#include "LoggingScenarioEventArgs.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingChannelScenario.cpp File Reference

  • Logging
  • cpp

LoggingChannelScenario.cpp File Reference

#include "pch.h"
#include "LoggingChannelScenario.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingChannelScenario.h File Reference

  • Logging
  • cpp
Classes | Namespaces

LoggingChannelScenario.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingScenarioEventArgs.h File Reference

  • Logging
  • cpp
Classes | Namespaces | Enumerations | Functions

LoggingScenarioEventArgs.h File Reference

#include "pch.h"
#include <string>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}

Functions

delegate void | StatusChangedHandler (Platform::Object^sender, LoggingScenarioEventArgs^args)
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingScenarioHelpers.h File Reference

  • Logging
  • cpp
Namespaces | Functions

LoggingScenarioHelpers.h File Reference

#include <chrono>
#include <string>
#include <agents.h>

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

template<typename Func >
auto | create_delayed_task (std::chrono::milliseconds delay, Func func, concurrency::cancellation_token token=concurrency::cancellation_token::none())-> decltype(create_task(func))
std::wstring | GetTimeStamp ()
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingSessionScenario.cpp File Reference

  • Logging
  • cpp
Defines

LoggingSessionScenario.cpp File Reference

#include "pch.h"
#include "LoggingSessionScenario.h"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Defines

#define | DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"
#define | DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"
#define | LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"
#define | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
#define | SCENARIO_PREFIX L"LoggingSessionScenario_"

Define Documentation

#define DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"

Definition at line 13 of file LoggingSessionScenario.cpp.

#define DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"

Definition at line 12 of file LoggingSessionScenario.cpp.

#define LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"

Definition at line 15 of file LoggingSessionScenario.cpp.

#define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"

Definition at line 14 of file LoggingSessionScenario.cpp.

#define SCENARIO_PREFIX L"LoggingSessionScenario_"

Definition at line 11 of file LoggingSessionScenario.cpp.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingSessionScenario.h File Reference

  • Logging
  • cpp
Classes | Namespaces

LoggingSessionScenario.h File Reference

#include "LoggingScenarioEventArgs.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/pch.cpp File Reference

  • Logging
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/pch.h File Reference

  • Logging
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/SampleConfiguration.cpp File Reference

  • Logging
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/SampleConfiguration.h File Reference

  • Logging
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario1.xaml.cpp File Reference

  • Logging
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"
#include "LoggingChannelScenario.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario1.xaml.h File Reference

  • Logging
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario2.xaml.cpp File Reference

  • Logging
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario2.xaml.h File Reference

  • Logging
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "Scenario2.g.h"
#include "LoggingSessionScenario.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario3.xaml.cpp File Reference

  • Logging
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario3.xaml.h File Reference

  • Logging
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "Scenario3.g.h"
#include "FileLoggingSessionScenario.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/FileLoggingSessionScenario.cpp File Reference

  • Logging
  • cppwinrt
Defines

FileLoggingSessionScenario.cpp File Reference

#include "pch.h"
#include "FileLoggingSessionScenario.h"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Defines

#define | DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"
#define | DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"
#define | LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME SCENARIO_PREFIX L"LogFileGeneratedBeforeSuspend"
#define | LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"
#define | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
#define | SCENARIO_PREFIX L"FileLoggingSessionScenario_"

Define Documentation

#define DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"

Definition at line 18 of file FileLoggingSessionScenario.cpp.

#define DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"

Definition at line 17 of file FileLoggingSessionScenario.cpp.

#define LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME SCENARIO_PREFIX L"LogFileGeneratedBeforeSuspend"

Definition at line 21 of file FileLoggingSessionScenario.cpp.

#define LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"

Definition at line 20 of file FileLoggingSessionScenario.cpp.

#define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"

Definition at line 19 of file FileLoggingSessionScenario.cpp.

#define SCENARIO_PREFIX L"FileLoggingSessionScenario_"

Definition at line 16 of file FileLoggingSessionScenario.cpp.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/FileLoggingSessionScenario.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

FileLoggingSessionScenario.h File Reference

#include "LoggingScenarioEventArgs.h"

Go to the source code of this file.

Classes

class | FileLoggingSessionScenario
struct | FileLoggingSessionScenario::BusySetter

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingChannelScenario.cpp File Reference

  • Logging
  • cppwinrt

LoggingChannelScenario.cpp File Reference

#include "pch.h"
#include "LoggingChannelScenario.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingChannelScenario.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

LoggingChannelScenario.h File Reference

Go to the source code of this file.

Classes

class | LoggingChannelScenario

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingScenarioEventArgs.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

LoggingScenarioEventArgs.h File Reference

#include "LoggingScenarioEventArgs.g.h"

Go to the source code of this file.

Classes

struct | LoggingScenarioEventArgs

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingScenarioHelpers.h File Reference

  • Logging
  • cppwinrt
Namespaces | Functions

LoggingScenarioHelpers.h File Reference

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

Windows::UI::Xaml::Controls::ScrollViewer | FindScrollViewer (Windows::UI::Xaml::DependencyObject const &control)
std::wstring | GetTimeStamp ()
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingSessionScenario.cpp File Reference

  • Logging
  • cppwinrt
Defines

LoggingSessionScenario.cpp File Reference

#include "pch.h"
#include "LoggingSessionScenario.h"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Defines

#define | DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"
#define | DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"
#define | LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"
#define | OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
#define | SCENARIO_PREFIX L"LoggingSessionScenario_"

Define Documentation

#define DEFAULT_CHANNEL_NAME SCENARIO_PREFIX L"Channel"

Definition at line 18 of file LoggingSessionScenario.cpp.

#define DEFAULT_SESSION_NAME SCENARIO_PREFIX L"Session"

Definition at line 17 of file LoggingSessionScenario.cpp.

#define LOGGING_ENABLED_SETTING_KEY_NAME SCENARIO_PREFIX L"LoggingEnabled"

Definition at line 20 of file LoggingSessionScenario.cpp.

#define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"

Definition at line 19 of file LoggingSessionScenario.cpp.

#define SCENARIO_PREFIX L"LoggingSessionScenario_"

Definition at line 16 of file LoggingSessionScenario.cpp.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingSessionScenario.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

LoggingSessionScenario.h File Reference

#include "LoggingScenarioEventArgs.h"

Go to the source code of this file.

Classes

class | LoggingSessionScenario
struct | LoggingSessionScenario::BusySetter

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/pch.cpp File Reference

  • Logging
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/pch.h File Reference

  • Logging
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Foundation.Diagnostics.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <string>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Project.idl File Reference

  • Logging
  • cppwinrt
Namespaces | Enumerations

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate

Enumerations

enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/SampleConfiguration.cpp File Reference

  • Logging
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "MainPage.h"
#include <winrt/SDKTemplate.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/SampleConfiguration.h File Reference

  • Logging
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario1.cpp File Reference

  • Logging
  • cppwinrt

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include "LoggingChannelScenario.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario1.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario2.cpp File Reference

  • Logging
  • cppwinrt

Scenario2.cpp File Reference

#include "pch.h"
#include "Scenario2.h"
#include "Scenario2.g.cpp"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario2.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

Scenario2.h File Reference

#include "Scenario2.g.h"
#include "LoggingSessionScenario.h"

Go to the source code of this file.

Classes

struct | Scenario2
struct | Scenario2
Getting a file's parent folder. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario3.cpp File Reference

  • Logging
  • cppwinrt

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"
#include "LoggingScenarioHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario3.h File Reference

  • Logging
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "Scenario3.g.h"
#include "FileLoggingSessionScenario.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/FileLoggingSessionScenario.cs File Reference

  • Logging
  • cs
Classes | Namespaces

FileLoggingSessionScenario.cs File Reference

Go to the source code of this file.

Classes

class | FileLoggingSessionScenario
FileLoggingSessionScenario is a central singleton class which contains the logging-specific sample code. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/LoggingChannelScenario.cs File Reference

  • Logging
  • cs
Classes | Namespaces

LoggingChannelScenario.cs File Reference

Go to the source code of this file.

Classes

class | LoggingChannelScenario
Demonstrate usage of LoggingChannel and LoggingActivity. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/LoggingScenarioEventArgs.cs File Reference

  • Logging
  • cs
Classes | Namespaces | Enumerations

LoggingScenarioEventArgs.cs File Reference

Go to the source code of this file.

Classes

class | LoggingScenarioEventArgs

Namespaces

namespace | SDKTemplate

Enumerations

enum LoggingScenarioEventType {
BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend,
LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated, LogFileGeneratedAtDisable,
LogFileGeneratedAtSuspend, LoggingEnabledDisabled, BusyStatusChanged, LogFileGenerated,
LogFileGeneratedAtDisable, LogFileGeneratedAtSuspend, LoggingEnabledDisabled
}
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/LoggingSessionScenario.cs File Reference

  • Logging
  • cs
Classes | Namespaces

LoggingSessionScenario.cs File Reference

Go to the source code of this file.

Classes

class | AppException
class | LoggingSessionScenario
LoggingSessionScenario is a central singleton class which contains the logging-specific sample code. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/SampleConfiguration.cs File Reference

  • Logging
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/Scenario1.xaml.cs File Reference

  • Logging
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/Scenario2.xaml.cs File Reference

  • Logging
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/Scenario3.xaml.cs File Reference

  • Logging
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/App.xaml.cpp File Reference

  • LowLatencyInput
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/LowLatencyInputMain.cpp File Reference

  • LowLatencyInput
  • cpp

LowLatencyInputMain.cpp File Reference

#include "pch.h"
#include "LowLatencyInputMain.h"
#include "Common\DirectXHelper.h"
#include "Content\RectRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/LowLatencyInputMain.h File Reference

  • LowLatencyInput
  • cpp
Classes | Namespaces

LowLatencyInputMain.h File Reference

#include "Common\DeviceResources.h"
#include "Content\RectRenderer.h"

Go to the source code of this file.

Classes

class | LowLatencyInputMain

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/pch.cpp File Reference

  • LowLatencyInput
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/pch.h File Reference

  • LowLatencyInput
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include <wrl.h>
#include <wrl/client.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1effects_1.h>
#include <dwrite_2.h>
#include <wincodec.h>
#include <DirectXColors.h>
#include <DirectXMath.h>
#include <memory>
#include <agile.h>
#include <concrt.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/SampleConfiguration.cpp File Reference

  • LowLatencyInput
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/SampleConfiguration.h File Reference

  • LowLatencyInput
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.cpp File Reference

  • LowLatencyInput
  • cpp

Scenario1_LowLatencyInput.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_LowLatencyInput.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.h File Reference

  • LowLatencyInput
  • cpp
Classes | Namespaces

Scenario1_LowLatencyInput.xaml.h File Reference

#include "Scenario1_LowLatencyInput.g.h"
#include "MainPage.xaml.h"
#include "Common\DeviceResources.h"
#include "LowLatencyInputMain.h"
#include "Common\Constants.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/Constants.h File Reference

  • LowLatencyInput
  • cpp
  • Common
Namespaces | Variables

Constants.h File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

const float | bigRectSize = 200
const float | minScreenWidth = 720
const float | smallRectSize = 125
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/DeviceResources.cpp File Reference

  • LowLatencyInput
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/DeviceResources.h File Reference

  • LowLatencyInput
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/DirectXHelper.h File Reference

  • LowLatencyInput
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Content/RectRenderer.cpp File Reference

  • LowLatencyInput
  • cpp
  • Content

RectRenderer.cpp File Reference

#include "pch.h"
#include "RectRenderer.h"
#include "..\Common\DirectXHelper.h"
#include "..\Common\Constants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Content/RectRenderer.h File Reference

  • LowLatencyInput
  • cpp
  • Content
Classes | Namespaces

RectRenderer.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\Constants.h"
#include "..\Common\Constants.h"

Go to the source code of this file.

Classes

class | RectRenderer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/pch.cpp File Reference

  • MagneticStripeReader
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/pch.h File Reference

  • MagneticStripeReader
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/SampleConfiguration.cpp File Reference

  • MagneticStripeReader
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/SampleConfiguration.h File Reference

  • MagneticStripeReader
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::DeviceHelpers

Functions

Concurrency::task
< Windows::Devices::PointOfService::MagneticStripeReader^> 		GetFirstMagneticStripeReaderAsync (Windows::Devices::PointOfService::PosConnectionTypes connectionTypes=Windows::Devices::PointOfService::PosConnectionTypes::All)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario1_BankCards.xaml.cpp File Reference

  • MagneticStripeReader
  • cpp

Scenario1_BankCards.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_BankCards.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario1_BankCards.xaml.h File Reference

  • MagneticStripeReader
  • cpp
Classes | Namespaces

Scenario1_BankCards.xaml.h File Reference

#include "Scenario1_BankCards.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.cpp File Reference

  • MagneticStripeReader
  • cpp

Scenario2_AamvaCards.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_AamvaCards.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.h File Reference

  • MagneticStripeReader
  • cpp
Classes | Namespaces

Scenario2_AamvaCards.xaml.h File Reference

#include "Scenario2_AamvaCards.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/SampleConfiguration.cs File Reference

  • MagneticStripeReader
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | DeviceHelpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/Scenario1_BankCards.xaml.cs File Reference

  • MagneticStripeReader
  • cs
Classes | Namespaces

Scenario1_BankCards.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_BankCards
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MagneticStripeReaderSample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/Scenario2_AamvaCards.xaml.cs File Reference

  • MagneticStripeReader
  • cs
Classes | Namespaces

Scenario2_AamvaCards.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_AamvaCards
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MagneticStripeReaderSample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/cs/SampleConfiguration.cs File Reference

  • Magnetometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • Magnetometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/cs/Scenario2_Polling.xaml.cs File Reference

  • Magnetometer
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/pch.cpp File Reference

  • MapControl
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/pch.h File Reference

  • MapControl
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/SampleConfiguration.cpp File Reference

  • MapControl
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/SampleConfiguration.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | GeoEquals
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario1.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario1.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario10.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario10.xaml.cpp File Reference

#include "pch.h"
#include "Scenario10.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario10.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario10.xaml.h File Reference

#include "Scenario10.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario11.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario11.xaml.cpp File Reference

#include "pch.h"
#include "Scenario11.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario11.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario11.xaml.h File Reference

#include "Scenario11.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario12.xaml.cpp File Reference

  • MapControl
  • cpp
Variables

Scenario12.xaml.cpp File Reference

#include "pch.h"
#include "Scenario12.xaml.h"

Go to the source code of this file.

Variables

const std::wstring urlTemplate = "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-{timestamp}/{zoomlevel}/{x}/{y}.png"

Variable Documentation

const std::wstring urlTemplate = "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-{timestamp}/{zoomlevel}/{x}/{y}.png"

Definition at line 28 of file Scenario12.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario12.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario12.xaml.h File Reference

#include "Scenario12.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario2.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include "WindowsNumerics.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario2.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario3.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario3.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario4.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario4.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario5.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario5.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario5.xaml.h File Reference

#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario6.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario6.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario6.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario6.xaml.h File Reference

#include "Scenario6.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario7.xaml.cpp File Reference

  • MapControl
  • cpp
Functions

Scenario7.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7.xaml.h"

Go to the source code of this file.

Functions

MapCoordinates (GetMapCoordinates(latitude, longitude))

Function Documentation

MapCoordinates ( GetMapCoordinates(latitude, longitude) )

Definition at line 32 of file Scenario7.xaml.cpp.

{
}

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario7.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario7.xaml.h File Reference

#include "Scenario7.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | Cluster
class | PlaceInfo
struct | PlaceLocation
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario8.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario8.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario8.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario8.xaml.h File Reference

#include "Scenario8.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario9.xaml.cpp File Reference

  • MapControl
  • cpp

Scenario9.xaml.cpp File Reference

#include "pch.h"
#include "Scenario9.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario9.xaml.h File Reference

  • MapControl
  • cpp
Classes | Namespaces

Scenario9.xaml.h File Reference

#include "Scenario9.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/SampleConfiguration.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario1.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario10.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario10.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario11.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario11.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario12.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario12.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario12
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario2.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario3.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PointOfInterest
class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario4.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario5.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario6.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario7.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario7.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Cluster
class | PlaceInfo
struct | PlaceLocation
class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario8.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario9.xaml.cs File Reference

  • MapControl
  • cs
Classes | Namespaces

Scenario9.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/pch.cpp File Reference

  • MediaEditing
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/pch.h File Reference

  • MediaEditing
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/SampleConfiguration.cpp File Reference

  • MediaEditing
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/SampleConfiguration.h File Reference

  • MediaEditing
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.cpp File Reference

  • MediaEditing
  • cpp

Scenario1_TrimAndSaveClip.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_TrimAndSaveClip.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.h File Reference

  • MediaEditing
  • cpp
Classes | Namespaces

Scenario1_TrimAndSaveClip.xaml.h File Reference

#include "Scenario1_TrimAndSaveClip.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario2_AppendClips.xaml.cpp File Reference

  • MediaEditing
  • cpp

Scenario2_AppendClips.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_AppendClips.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario2_AppendClips.xaml.h File Reference

  • MediaEditing
  • cpp
Classes | Namespaces

Scenario2_AppendClips.xaml.h File Reference

#include "Scenario2_AppendClips.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.cpp File Reference

  • MediaEditing
  • cpp

Scenario3_AddAudioTracks.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_AddAudioTracks.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.h File Reference

  • MediaEditing
  • cpp
Classes | Namespaces

Scenario3_AddAudioTracks.xaml.h File Reference

#include "Scenario3_AddAudioTracks.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario4_AddOverlays.xaml.cpp File Reference

  • MediaEditing
  • cpp

Scenario4_AddOverlays.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_AddOverlays.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario4_AddOverlays.xaml.h File Reference

  • MediaEditing
  • cpp
Classes | Namespaces

Scenario4_AddOverlays.xaml.h File Reference

#include "Scenario4_AddOverlays.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/SampleConfiguration.cs File Reference

  • MediaEditing
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario1_TrimAndSaveClip.xaml.cs File Reference

  • MediaEditing
  • cs
Classes | Namespaces

Scenario1_TrimAndSaveClip.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_TrimAndSaveClip

Namespaces

namespace | MediaEditingSample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario2_AppendClips.xaml.cs File Reference

  • MediaEditing
  • cs
Classes | Namespaces

Scenario2_AppendClips.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_AppendClips

Namespaces

namespace | MediaEditingSample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario3_AddAudioTracks.xaml.cs File Reference

  • MediaEditing
  • cs
Classes | Namespaces

Scenario3_AddAudioTracks.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AddAudioTracks

Namespaces

namespace | MediaEditingSample
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario4_AddOverlays.xaml.cs File Reference

  • MediaEditing
  • cs
Classes | Namespaces

Scenario4_AddOverlays.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_AddOverlays

Namespaces

namespace | MediaEditingSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/App.xaml.cs File Reference

  • MediaImport
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/ImportableItemWrapper.cs File Reference

  • MediaImport
  • cs
Classes | Namespaces

ImportableItemWrapper.cs File Reference

Go to the source code of this file.

Classes

class | ImportableItemWrapper
Wrapper for the thumbnail and the ImportableItem. More...

Namespaces

namespace | ImportSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/MainPage.xaml.cs File Reference

  • MediaImport
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/SampleConfiguration.cs File Reference

  • MediaImport
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/Scenario1.xaml.cs File Reference

  • MediaImport
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | ImportSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/DataBinding/GeneratorIncrementalLoadingClass.cs File Reference

  • MediaImport
  • cs
  • DataBinding
Classes | Namespaces

GeneratorIncrementalLoadingClass.cs File Reference

Go to the source code of this file.

Classes

class | GeneratorIncrementalLoadingClass-g< T >

Namespaces

namespace | DataBinding
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/DataBinding/IncrementalLoadingBase.cs File Reference

  • MediaImport
  • cs
  • DataBinding
Classes | Namespaces

IncrementalLoadingBase.cs File Reference

Go to the source code of this file.

Classes

class | IncrementalLoadingBase

Namespaces

namespace | DataBinding
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/pch.cpp File Reference

  • MediaTranscoding
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/pch.h File Reference

  • MediaTranscoding
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/SampleConfiguration.cpp File Reference

  • MediaTranscoding
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/SampleConfiguration.h File Reference

  • MediaTranscoding
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario1_Default.xaml.cpp File Reference

  • MediaTranscoding
  • cpp

Scenario1_Default.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Default.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario1_Default.xaml.h File Reference

  • MediaTranscoding
  • cpp
Classes | Namespaces

Scenario1_Default.xaml.h File Reference

#include "Scenario1_Default.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario2_Custom.xaml.cpp File Reference

  • MediaTranscoding
  • cpp

Scenario2_Custom.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Custom.xaml.h"
#include <codecapi.h>
#include <initguid.h>
#include <mfapi.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario2_Custom.xaml.h File Reference

  • MediaTranscoding
  • cpp
Classes | Namespaces

Scenario2_Custom.xaml.h File Reference

#include "Scenario2_Custom.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario3_Trim.xaml.cpp File Reference

  • MediaTranscoding
  • cpp

Scenario3_Trim.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Trim.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario3_Trim.xaml.h File Reference

  • MediaTranscoding
  • cpp
Classes | Namespaces

Scenario3_Trim.xaml.h File Reference

#include "Scenario3_Trim.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.cpp File Reference

  • MediaTranscoding
  • cpp

Scenario4_AddOverlays.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_AddOverlays.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.h File Reference

  • MediaTranscoding
  • cpp
Classes | Namespaces

Scenario4_AddOverlays.xaml.h File Reference

#include "Scenario4_AddOverlays.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/MediaFoundationConstants.cs File Reference

  • MediaTranscoding
  • cs
Classes | Namespaces

MediaFoundationConstants.cs File Reference

Go to the source code of this file.

Classes

class | MediaFoundationConstants
Assorted Media Foundation constants from the Windows SDK C headers. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/SampleConfiguration.cs File Reference

  • MediaTranscoding
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/Scenario1_Default.xaml.cs File Reference

  • MediaTranscoding
  • cs
Classes | Namespaces

Scenario1_Default.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Default

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/Scenario2_Custom.xaml.cs File Reference

  • MediaTranscoding
  • cs
Classes | Namespaces

Scenario2_Custom.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Custom

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/Scenario3_Trim.xaml.cs File Reference

  • MediaTranscoding
  • cs
Classes | Namespaces

Scenario3_Trim.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Trim

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CancelCommand.xaml.cpp File Reference

  • MessageDialog
  • cpp

CancelCommand.xaml.cpp File Reference

#include "pch.h"
#include "CancelCommand.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CancelCommand.xaml.h File Reference

  • MessageDialog
  • cpp
Classes | Namespaces

CancelCommand.xaml.h File Reference

#include "CancelCommand.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CompletedCallback.xaml.cpp File Reference

  • MessageDialog
  • cpp

CompletedCallback.xaml.cpp File Reference

#include "pch.h"
#include "CompletedCallback.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CompletedCallback.xaml.h File Reference

  • MessageDialog
  • cpp
Classes | Namespaces

CompletedCallback.xaml.h File Reference

#include "CompletedCallback.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CustomCommand.xaml.cpp File Reference

  • MessageDialog
  • cpp

CustomCommand.xaml.cpp File Reference

#include "pch.h"
#include "CustomCommand.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CustomCommand.xaml.h File Reference

  • MessageDialog
  • cpp
Classes | Namespaces

CustomCommand.xaml.h File Reference

#include "CustomCommand.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/DefaultCloseCommand.xaml.cpp File Reference

  • MessageDialog
  • cpp

DefaultCloseCommand.xaml.cpp File Reference

#include "pch.h"
#include "DefaultCloseCommand.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/DefaultCloseCommand.xaml.h File Reference

  • MessageDialog
  • cpp
Classes | Namespaces

DefaultCloseCommand.xaml.h File Reference

#include "DefaultCloseCommand.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/pch.cpp File Reference

  • MessageDialog
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/pch.h File Reference

  • MessageDialog
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/SampleConfiguration.cpp File Reference

  • MessageDialog
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/SampleConfiguration.h File Reference

  • MessageDialog
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/CancelCommand.xaml.cs File Reference

  • MessageDialog
  • cs
Classes | Namespaces

CancelCommand.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CancelCommand

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/CompletedCallback.xaml.cs File Reference

  • MessageDialog
  • cs
Classes | Namespaces

CompletedCallback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CompletedCallback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/CustomCommand.xaml.cs File Reference

  • MessageDialog
  • cs
Classes | Namespaces

CustomCommand.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomCommand

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/DefaultCloseCommand.xaml.cs File Reference

  • MessageDialog
  • cs
Classes | Namespaces

DefaultCloseCommand.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DefaultCloseCommand

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/SampleConfiguration.cs File Reference

  • MessageDialog
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/AccountOverviewPage.xaml.cs File Reference

  • MicrosoftPassport
  • cs
Classes | Namespaces

AccountOverviewPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | AccountOverviewPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/EnableHelloPage.xaml.cs File Reference

  • MicrosoftPassport
  • cs
Classes | Namespaces

EnableHelloPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | EnableHelloPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/MainPage.xaml.cs File Reference

  • MicrosoftPassport
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/Util.cs File Reference

  • MicrosoftPassport
  • cs
Classes | Namespaces

Util.cs File Reference

Go to the source code of this file.

Classes

class | JsonRequest
class | Util

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Global.asax.cs File Reference

  • MicrosoftPassport
  • Server
Classes | Namespaces

Global.asax.cs File Reference

Go to the source code of this file.

Classes

class | WebApiApplication

Namespaces

namespace | MicrosoftPassport::Server
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/FilterConfig.cs File Reference

  • MicrosoftPassport
  • Server
  • App_Start
Classes | Namespaces

FilterConfig.cs File Reference

Go to the source code of this file.

Classes

class | FilterConfig

Namespaces

namespace | MicrosoftPassport::Server
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/RouteConfig.cs File Reference

  • MicrosoftPassport
  • Server
  • App_Start
Classes | Namespaces

RouteConfig.cs File Reference

Go to the source code of this file.

Classes

class | RouteConfig

Namespaces

namespace | MicrosoftPassport::Server
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/WebApiConfig.cs File Reference

  • MicrosoftPassport
  • Server
  • App_Start
Classes | Namespaces

WebApiConfig.cs File Reference

Go to the source code of this file.

Classes

class | WebApiConfig

Namespaces

namespace | MicrosoftPassport::Server
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Controllers/AuthenticationController.cs File Reference

  • MicrosoftPassport
  • Server
  • Controllers
Classes | Namespaces

AuthenticationController.cs File Reference

Go to the source code of this file.

Classes

class | AuthenticationController

Namespaces

namespace | MicrosoftPassport::Server::Controllers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Controllers/HomeController.cs File Reference

  • MicrosoftPassport
  • Server
  • Controllers
Classes | Namespaces

HomeController.cs File Reference

Go to the source code of this file.

Classes

class | HomeController

Namespaces

namespace | MicrosoftPassport::Server::Controllers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Data/DAL.cs File Reference

  • MicrosoftPassport
  • Server
  • Data
Classes | Namespaces

DAL.cs File Reference

Go to the source code of this file.

Classes

class | DAL
class | DAL::RegisteredUser

Namespaces

namespace | MicrosoftPassport::Server::Data
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Models/Messages.cs File Reference

  • MicrosoftPassport
  • Server
  • Models
Classes | Namespaces

Messages.cs File Reference

Go to the source code of this file.

Classes

class | RegisterMessage
class | SignatureMessage
class | UserAndKeyHintMessage

Namespaces

namespace | MicrosoftPassport::Models
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Models/SubjectPublicKeyInfo.cs File Reference

  • MicrosoftPassport
  • Server
  • Models
Classes | Namespaces

SubjectPublicKeyInfo.cs File Reference

Go to the source code of this file.

Classes

class | SubjectPublicKeyInfo
class | SubjectPublicKeyInfo::NativeMethods
class | SubjectPublicKeyInfo::SafeBCryptKeyHandle
class | SubjectPublicKeyInfo::SafeLocalAllocHandle

Namespaces

namespace | MicrosoftPassport::Models
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Properties/AssemblyInfo.cs File Reference

  • MicrosoftPassport
  • Server
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/MidiDeviceWatcher.cs File Reference

  • MIDI
  • cs
Classes | Namespaces

MidiDeviceWatcher.cs File Reference

Go to the source code of this file.

Classes

class | MidiDeviceWatcher
DeviceWatcher class to monitor adding/removing MIDI devices on the fly. More...

Namespaces

namespace | MIDI
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/SampleConfiguration.cs File Reference

  • MIDI
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/Scenario1_MIDIDeviceEnumeration.xaml.cs File Reference

  • MIDI
  • cs
Classes | Namespaces

Scenario1_MIDIDeviceEnumeration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_MIDIDeviceEnumeration
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MIDI
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/Scenario2_ReceiveMIDIMessages.xaml.cs File Reference

  • MIDI
  • cs
Classes | Namespaces

Scenario2_ReceiveMIDIMessages.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ReceiveMIDIMessages
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MIDI
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/Scenario3_SendMIDIMessages.xaml.cs File Reference

  • MIDI
  • cs
Classes | Namespaces

Scenario3_SendMIDIMessages.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_SendMIDIMessages
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MIDI
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/cs/SampleConfiguration.cs File Reference

  • MixedRealityModel
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/cs/Scenario1_CreateTile.xaml.cs File Reference

  • MixedRealityModel
  • cs
Classes | Namespaces

Scenario1_CreateTile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CreateTile

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/AccountWatcher.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

AccountWatcher.xaml.cs File Reference

Go to the source code of this file.

Classes

class | AccountWatcher
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/BroadbandDevice.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

BroadbandDevice.xaml.cs File Reference

Go to the source code of this file.

Classes

class | BroadbandDevice
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/GetConnectionProfiles.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

GetConnectionProfiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | GetConnectionProfiles
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ModemDeviceServices.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

ModemDeviceServices.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ModemDeviceServices
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ModemInformation.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

ModemInformation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ModemInformation
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/SampleConfiguration.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ShowConnection.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

ShowConnection.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShowConnection
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/SimCard.xaml.cs File Reference

  • MobileBroadband
  • cs
Classes | Namespaces

SimCard.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SimCard
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | MobileBroadband
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/pch.cpp File Reference

  • MobileHotspot
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/pch.h File Reference

  • MobileHotspot
  • cppwinrt

pch.h File Reference

#include <unknwn.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Networking.Connectivity.h"
#include "winrt/Windows.Networking.NetworkOperators.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Project.idl File Reference

  • MobileHotspot
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_ConfigureMobileHotspot
runtimeclass | Scenario2_ToggleMobileHotspot
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/SampleConfiguration.cpp File Reference

  • MobileHotspot
  • cppwinrt
Namespaces | Functions

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

hstring | GetFriendlyName (TetheringWiFiBand value)
bool | IsBandSupported (NetworkOperatorTetheringAccessPointConfiguration const &configuration, TetheringWiFiBand band)
NetworkOperatorTetheringManager | TryGetCurrentNetworkOperatorTetheringManager ()
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/SampleConfiguration.h File Reference

  • MobileHotspot
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

hstring | GetFriendlyName (Windows::Networking::NetworkOperators::TetheringWiFiBand value)
bool | IsBandSupported (Windows::Networking::NetworkOperators::NetworkOperatorTetheringAccessPointConfiguration const &configuration, Windows::Networking::NetworkOperators::TetheringWiFiBand band)
NetworkOperatorTetheringManager | TryGetCurrentNetworkOperatorTetheringManager ()
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.cpp File Reference

  • MobileHotspot
  • cppwinrt
Namespaces

Scenario1_ConfigureMobileHotspot.cpp File Reference

#include "pch.h"
#include "Scenario1_ConfigureMobileHotspot.h"
#include "Scenario1_ConfigureMobileHotspot.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.h File Reference

  • MobileHotspot
  • cppwinrt
Classes | Namespaces

Scenario1_ConfigureMobileHotspot.h File Reference

#include "Scenario1_ConfigureMobileHotspot.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ConfigureMobileHotspot
struct | Scenario1_ConfigureMobileHotspot

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.cpp File Reference

  • MobileHotspot
  • cppwinrt
Namespaces

Scenario2_ToggleMobileHotspot.cpp File Reference

#include "pch.h"
#include "Scenario2_ToggleMobileHotspot.h"
#include "Scenario2_ToggleMobileHotspot.g.cpp"
#include "MainPage.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Scenario2_ToggleMobileHotspot.h File Reference

  • MobileHotspot
  • cppwinrt
Classes | Namespaces

Scenario2_ToggleMobileHotspot.h File Reference

#include "Scenario2_ToggleMobileHotspot.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_ToggleMobileHotspot
struct | Scenario2_ToggleMobileHotspot

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/SampleConfiguration.cs File Reference

  • MobileHotspot
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | Helpers
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/Scenario1_ConfigureMobileHotspot.xaml.cs File Reference

  • MobileHotspot
  • cs
Classes | Namespaces

Scenario1_ConfigureMobileHotspot.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ConfigureMobileHotspot

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/Scenario2_ToggleMobileHotspot.xaml.cs File Reference

  • MobileHotspot
  • cs
Classes | Namespaces

Scenario2_ToggleMobileHotspot.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ToggleMobileHotspot

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/pch.cpp File Reference

  • MultipleViews
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/pch.h File Reference

  • MultipleViews
  • cppwinrt
Defines

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Foundation.Metadata.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.Core.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Core.AnimationMetrics.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Animation.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Defines

#define NOMINMAX

Define Documentation

#define NOMINMAX

Definition at line 3 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Project.idl File Reference

  • MultipleViews
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SampleConfiguration.cpp File Reference

  • MultipleViews
  • cppwinrt
Namespaces | Functions

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{SampleConfiguration.cpp}

Functions

ViewLifetimeControl | TryFindViewLifetimeControlForViewId (int32_t viewId)
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SampleConfiguration.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"
#include "App.h"

Go to the source code of this file.

Classes

struct | SampleState

Namespaces

namespace | winrt::SDKTemplate

Functions

void | App_Construct (implementation::App *app)
fire_and_forget | App_OnActivated (Windows::ApplicationModel::Activation::IActivatedEventArgs const &)
bool | App_OverrideOnLaunched (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario1.cpp File Reference

  • MultipleViews
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"
#include "SampleConfiguration.h"
#include "SizePreferenceString.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario1.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario3.cpp File Reference

  • MultipleViews
  • cppwinrt
Namespaces | Functions

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"
#include "SampleConfiguration.h"
#include "SecondaryViewPage.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario3.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

handle | duplicate (handle const &other)
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario3.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "Scenario3.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SecondaryViewPage.cpp File Reference

  • MultipleViews
  • cppwinrt
Namespaces | Variables

SecondaryViewPage.cpp File Reference

#include "pch.h"
#include "SecondaryViewPage.h"
#include "SecondaryViewPage.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{SecondaryViewPage.cpp}
namespace | winrt::SDKTemplate::implementation

Variables

const int | ANIMATION_OPACITY_END = 1
const int | ANIMATION_OPACITY_START = 0
const int | ANIMATION_TRANSLATION_END = 0
const int | ANIMATION_TRANSLATION_START = 100
hstring | EMPTY_TITLE = "<title cleared>"
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SecondaryViewPage.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces

SecondaryViewPage.h File Reference

#include "SecondaryViewPage.g.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

struct | SecondaryViewPage
struct | SecondaryViewPage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SizePreferenceString.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces

SizePreferenceString.h File Reference

#include "SizePreferenceString.g.h"

Go to the source code of this file.

Classes

struct | SizePreferenceString

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/ViewLifetimeControl.cpp File Reference

  • MultipleViews
  • cppwinrt
Namespaces

ViewLifetimeControl.cpp File Reference

#include "pch.h"
#include "ViewLifetimeControl.h"
#include "ViewLifetimeControl.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/ViewLifetimeControl.h File Reference

  • MultipleViews
  • cppwinrt
Classes | Namespaces

ViewLifetimeControl.h File Reference

#include "ViewLifetimeControl.g.h"

Go to the source code of this file.

Classes

struct | ViewLifetimeControl
struct | ViewLifetimeControl

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/App.xaml.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/SampleConfiguration.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/Scenario1.xaml.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...
class | SizePreferenceString

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/Scenario3.xaml.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/SecondaryViewPage.xaml.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces

SecondaryViewPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SecondaryViewPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/ViewLifetimeControl.cs File Reference

  • MultipleViews
  • cs
Classes | Namespaces | Functions

ViewLifetimeControl.cs File Reference

Go to the source code of this file.

Classes

class | ViewLifetimeControl

Namespaces

namespace | SecondaryViewsHelpers

Functions

delegate void | ViewReleasedHandler (Object sender, EventArgs e)
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/pch.cpp File Reference

  • NetworkConnectivity
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/pch.h File Reference

  • NetworkConnectivity
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Globalization.DateTimeFormatting.h>
#include <winrt/Windows.Networking.Connectivity.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.Web.Http.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Project.idl File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_NetworkConnectivity
runtimeclass | Scenario2_NetworkCost
runtimeclass | Scenario3_NetworkConnectivityChanges
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/SampleConfiguration.cpp File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces | Functions

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{SampleConfiguration.cpp}

Functions

IAsyncOperation< hstring > | SendHttpGetRequestAsync ()
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/SampleConfiguration.h File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces | Enumerations | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Enumerations

enum | CostGuidance { Normal, OptIn, Conservative }

Functions

void | AppendLine (Windows::UI::Xaml::Controls::TextBlock const &textBlock, hstring const &message)
void | EvaluateAndReportConnectionCost (Windows::Networking::Connectivity::ConnectionCost cost, Windows::UI::Xaml::Controls::TextBlock const &textBlock)
winrt::Windows::Foundation::IAsyncAction | EvaluateCostAndConnectAsync (Windows::Networking::Connectivity::ConnectionCost cost, bool optedInToCharges, Windows::UI::Xaml::Controls::TextBlock textBlock)
CostGuidance | GetNetworkCostGuidance (Windows::Networking::Connectivity::ConnectionCost cost)
bool | ShouldAttemptToConnectToInternet (Windows::Networking::Connectivity::NetworkConnectivityLevel level)
hstring | to_hstring (Windows::Networking::Connectivity::NetworkConnectivityLevel value)
hstring | to_hstring (Windows::Networking::Connectivity::NetworkCostType type)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.cpp File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces

Scenario1_NetworkConnectivity.cpp File Reference

#include "pch.h"
#include "Scenario1_NetworkConnectivity.h"
#include "Scenario1_NetworkConnectivity.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.h File Reference

  • NetworkConnectivity
  • cppwinrt
Classes | Namespaces

Scenario1_NetworkConnectivity.h File Reference

#include "Scenario1_NetworkConnectivity.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_NetworkConnectivity
struct | Scenario1_NetworkConnectivity

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.cpp File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces

Scenario2_NetworkCost.cpp File Reference

#include "pch.h"
#include "Scenario2_NetworkCost.h"
#include "Scenario2_NetworkCost.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.h File Reference

  • NetworkConnectivity
  • cppwinrt
Classes | Namespaces

Scenario2_NetworkCost.h File Reference

#include "Scenario2_NetworkCost.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_NetworkCost
struct | Scenario2_NetworkCost

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.cpp File Reference

  • NetworkConnectivity
  • cppwinrt
Namespaces

Scenario3_NetworkConnectivityChanges.cpp File Reference

#include "pch.h"
#include "Scenario3_NetworkConnectivityChanges.h"
#include "Scenario3_NetworkConnectivityChanges.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.h File Reference

  • NetworkConnectivity
  • cppwinrt
Classes | Namespaces

Scenario3_NetworkConnectivityChanges.h File Reference

#include "Scenario3_NetworkConnectivityChanges.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_NetworkConnectivityChanges
struct | Scenario3_NetworkConnectivityChanges

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/Helpers.cs File Reference

  • NetworkConnectivity
  • cs
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/SampleConfiguration.cs File Reference

  • NetworkConnectivity
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/Scenario1_NetworkConnectivity.xaml.cs File Reference

  • NetworkConnectivity
  • cs
Classes | Namespaces

Scenario1_NetworkConnectivity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_NetworkConnectivity

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/Scenario2_NetworkCost.xaml.cs File Reference

  • NetworkConnectivity
  • cs
Classes | Namespaces

Scenario2_NetworkCost.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_NetworkCost

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/Scenario3_NetworkConnectivityChanges.xaml.cs File Reference

  • NetworkConnectivity
  • cs
Classes | Namespaces

Scenario3_NetworkConnectivityChanges.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_NetworkConnectivityChanges

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/App.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/CardReader.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

CardReader.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CardReader
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | NfcSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/MainPage.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/ManageCard.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

ManageCard.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ManageCardScenario
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | NfcSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/NfcUtils.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces | Enumerations

NfcUtils.cs File Reference

Go to the source code of this file.

Classes

class | NfcUtils

Namespaces

namespace | NfcSample

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage }
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/ReceiptView.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

ReceiptView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ReceiptView
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | NfcSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/SampleConfiguration.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/SetCardData.xaml.cs File Reference

  • Nfc
  • Nfc
Classes | Namespaces

SetCardData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SetCardDataScenario

Namespaces

namespace | NfcSample
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/TlvEntry.cs File Reference

  • Nfc
  • Nfc
Classes

TlvEntry.cs File Reference

Go to the source code of this file.

Classes

class TlvEntry
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/BgTask.cpp File Reference

  • Nfc
  • NfcHceBackgroundTask
Defines | Variables

BgTask.cpp File Reference

#include "pch.h"
#include "BgTask.h"
#include "Utilities.h"

Go to the source code of this file.

Defines

#define | CLAINS_COMPUTE_CRYPTO_CSUM 0x802A
#define | CLAINS_GET_PROCESSING_OPTIONS 0x80A8
#define | CLAINS_READ_RECORD 0x00B2
#define | CLAINS_SELECT 0x00A4

Variables

BYTE | AID_MC [] = { 0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10 }
BYTE | AID_NONPAYMENT [] = { 0x12, 0x34, 0x56, 0x78, 0x90 }
BYTE | AID_PPSE [] = { '2', 'P', 'A', 'Y', '.', 'S', 'Y', 'S', '.', 'D', 'D', 'F', '0', '1' }
BYTE | AID_V [] = { 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10 }

Define Documentation

#define CLAINS_COMPUTE_CRYPTO_CSUM 0x802A

Definition at line 30 of file BgTask.cpp.

#define CLAINS_GET_PROCESSING_OPTIONS 0x80A8

Definition at line 28 of file BgTask.cpp.

#define CLAINS_READ_RECORD 0x00B2

Definition at line 29 of file BgTask.cpp.

#define CLAINS_SELECT 0x00A4

Definition at line 27 of file BgTask.cpp.

Variable Documentation

BYTE AID_MC[] = { 0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10 }

Definition at line 34 of file BgTask.cpp.

BYTE AID_NONPAYMENT[] = { 0x12, 0x34, 0x56, 0x78, 0x90 }

Definition at line 35 of file BgTask.cpp.

BYTE AID_PPSE[] = { '2', 'P', 'A', 'Y', '.', 'S', 'Y', 'S', '.', 'D', 'D', 'F', '0', '1' }

Definition at line 32 of file BgTask.cpp.

BYTE AID_V[] = { 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10 }

Definition at line 33 of file BgTask.cpp.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/BgTask.h File Reference

  • Nfc
  • NfcHceBackgroundTask
Classes | Namespaces

BgTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | NfcHceBackgroundTask
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/pch.cpp File Reference

  • Nfc
  • NfcHceBackgroundTask

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/pch.h File Reference

  • Nfc
  • NfcHceBackgroundTask

pch.h File Reference

#include <ppltasks.h>
#include <robuffer.h>
#include <winsock2.h>
#include <wrl.h>
#include <wrl\wrappers\corewrappers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/Utilities.cpp File Reference

  • Nfc
  • NfcHceBackgroundTask
Functions

Utilities.cpp File Reference

#include <pch.h>
#include "Utilities.h"

Go to the source code of this file.

Functions

void | AppendFile (String^filename, String^data)
_Use_decl_annotations_ std::wstring | ByteArrayToString (Array< byte >^byteArray)
void | ChkHR (HRESULT hr)
String | GetCurrentTimeString ()
_Use_decl_annotations_ IBuffer | IBufferFromArray (Array< unsigned char >^data)
_Use_decl_annotations_ IBuffer | IBufferFromPointer (LPBYTE pbData, DWORD cbData)
_Use_decl_annotations_ HRESULT | ParseApdu (BYTE *pbCommandApdu, DWORD cbCommandApdu, USHORT *pusClaIns, BYTE *pbP1, BYTE *pbP2, BYTE **ppbPayload, DWORD *pcbPayload, DWORD *pcbLE)
_Use_decl_annotations_ LPBYTE | PointerFromIBuffer (IBuffer^buffer, DWORD *pcbLength)
task< Array< byte >^> | ReadAndUnprotectFileAsync (String^filename)
task< IBuffer^> | ReadFileToBufferAsync (String^filename)

Function Documentation

void AppendFile | ( | String^ | filename,
 |  | String^ | data
 | ) |  |

Definition at line 176 of file Utilities.cpp.

{
    auto file = create_task(ApplicationData::Current->LocalFolder->CreateFileAsync(
        filename,
        CreationCollisionOption::OpenIfExists)).get();

    create_task(FileIO::AppendTextAsync(file, data)).wait();
}

_Use_decl_annotations_ std::wstring ByteArrayToString ( Array< byte >^ byteArray )

Definition at line 87 of file Utilities.cpp.

{
    std::wstring str = L"";
    for (auto b : byteArray)
    {
        wchar_t strByte[3];
        swprintf_s(strByte, L"%02X", b);
        str += strByte;
    }

    return str;
}

void ChkHR ( HRESULT hr )

Definition at line 100 of file Utilities.cpp.

{
    if (FAILED(hr))
    {
        throw ref new COMException(hr);
    }
}

String GetCurrentTimeString ( )

Definition at line 23 of file Utilities.cpp.

{
    auto calendar = ref new Calendar();
    calendar->SetToNow();

    int milliseconds = calendar->Nanosecond / 1000000;
    String^ strMilliseconds = milliseconds.ToString();

    // Pad zeros
    if (strMilliseconds->Length() == 1)
    {
        strMilliseconds = "00" + strMilliseconds;
    }
    else if (strMilliseconds->Length() == 2)
    {
        strMilliseconds = "0" + strMilliseconds;
    }

    return
        calendar->HourAsPaddedString(2) + ":" +
        calendar->MinuteAsPaddedString(2) + ":" +
        calendar->SecondAsPaddedString(2) + "." +
        strMilliseconds;
}

_Use_decl_annotations_ IBuffer IBufferFromArray ( Array< unsigned char >^ data )

Definition at line 79 of file Utilities.cpp.

{
    DataWriter^ dataWriter = ref new DataWriter();
    dataWriter->WriteBytes(data);
    return dataWriter->DetachBuffer();
}

_Use_decl_annotations_ IBuffer IBufferFromPointer | ( | LPBYTE | pbData,
 |  | DWORD | cbData
 | ) |  |

Definition at line 72 of file Utilities.cpp.

{
    auto byteArray = new ArrayReference<unsigned char>(pbData, cbData);
    return IBufferFromArray(reinterpret_cast<Array<unsigned char>^>(byteArray));
}

_Use_decl_annotations_ HRESULT ParseApdu | ( | BYTE * | pbCommandApdu,
 |  | DWORD | cbCommandApdu,
 |  | USHORT * | pusClaIns,
 |  | BYTE * | pbP1,
 |  | BYTE * | pbP2,
 |  | BYTE ** | ppbPayload,
 |  | DWORD * | pcbPayload,
 |  | DWORD * | pcbLE
 | ) |  |

Definition at line 186 of file Utilities.cpp.

{
    if (cbCommandApdu < 4)
    {
        // Invalid data, APDU should be minimum 4 bytes
        return E_FAIL;
    }

    // APDU Format is:
    // 0   1   2  3  4
    // CLA INS P1 P2 <NC> <cmd> <LE>

    // Grab the CLA, INS, P1 and P2
    memcpy(pusClaIns, pbCommandApdu, sizeof(USHORT));
    *pusClaIns = ntohs(*pusClaIns);
    *pbP1 = pbCommandApdu[2];
    *pbP2 = pbCommandApdu[3];
    *ppbPayload = nullptr;
    *pcbPayload = 0;
    *pcbLE = 0;
    if (cbCommandApdu == 5)
    {
        // Non-extended APDU with an LE byte
        *pcbLE = pbCommandApdu[4];
        if (*pcbLE == 0)
        {
            *pcbLE = 256;
        }
    }
    else if (cbCommandApdu > 5)
    {
        if (pbCommandApdu[4] != 0)
        {
            // Non-extended APDU with command data
            *pcbPayload = pbCommandApdu[4];

            if ((*pcbPayload + 5) == cbCommandApdu)
            {
                // No LE
            }
            else if ((*pcbPayload + 6) == cbCommandApdu)
            {
                // LE byte at the end
                *pcbLE = pbCommandApdu[*pcbPayload + 5];
                if (*pcbLE == 0)
                {
                    *pcbLE = 256;
                }
            }
            else
            {
                // Invalid length
                return E_FAIL;
            }
            *ppbPayload = pbCommandApdu + 5;
        }
        else
        {
            // Extended APDU

            if (cbCommandApdu == 7)
            {
                // Extended APDU with no command payload and only LE
                memcpy(pcbLE, pbCommandApdu + 5, sizeof(USHORT));
                *pcbLE = ntohs((u_short)*pcbLE);
                if (*pcbLE == 0)
                {
                    *pcbLE = 65536;
                }
            }
            else if (cbCommandApdu >= 8)
            {
                // We have an extended command payload
                memcpy(pcbPayload, pbCommandApdu + 5, sizeof(USHORT));
                *pcbPayload = ntohs((u_short)*pcbPayload);

                if (*pcbPayload + 9 == cbCommandApdu)
                {
                    // There is an extended LE at the end
                    memcpy(pcbLE, pbCommandApdu + 7 + *pcbPayload, sizeof(USHORT));
                    *pcbLE = ntohs((u_short)*pcbLE);
                    if (*pcbLE == 0)
                    {
                        *pcbLE = 65536;
                    }
                }
                else if (*pcbPayload + 7 == cbCommandApdu)
                {
                    // No LE
                }
                else
                {
                    return E_FAIL;
                }

                *ppbPayload = pbCommandApdu + 7;
            }
            else
            {
                return E_FAIL;
            }
        }
    }

    return S_OK;
}

_Use_decl_annotations_ LPBYTE PointerFromIBuffer | ( | IBuffer^ | buffer,
 |  | DWORD * | pcbLength
 | ) |  |

Definition at line 54 of file Utilities.cpp.

{
    if (pcbLength != nullptr)
    {
        *pcbLength = buffer->Length;
    }

    // Query the IBufferByteAccess interface.
    ComPtr<IBufferByteAccess> bufferByteAccess;
    ChkHR(reinterpret_cast<IInspectable*>(buffer)->QueryInterface(IID_PPV_ARGS(&bufferByteAccess)));

    // Retrieve the buffer data.
    LPBYTE pbData = nullptr;
    ChkHR(bufferByteAccess->Buffer(&pbData));
    return pbData;
}

task<Array<byte>^> ReadAndUnprotectFileAsync ( String^ filename )

Definition at line 108 of file Utilities.cpp.

{
    return create_task(ApplicationData::Current->LocalFolder->TryGetItemAsync(filename)).then(
        [](IStorageItem^ item)
        {
            if (item != nullptr
                && item->IsOfType(StorageItemTypes::File))
            {
                // File exists, read it
                return create_task(dynamic_cast<StorageFile^>(item)->OpenReadAsync()).then([](IRandomAccessStreamWithContentType^ stream)
                {
                    if (stream->Size > MAXDWORD32)
                    {
                        throw ref new Exception(E_FAIL);
                    }

                    auto size = static_cast<unsigned int>(stream->Size);
                    auto buffer = ref new Buffer(size);
                    return stream->ReadAsync(buffer, size, InputStreamOptions::None);
                }).then([](IBuffer^ buffer)
                {
                    // Now unprotect/decrypt it
                    auto provider = ref new DataProtectionProvider();
                    return provider->UnprotectAsync(buffer);
                }).then([](IBuffer^ buffer) -> Array<byte>^
                {
                    auto data = ref new Array<byte>(buffer->Length);
                    DataReader::FromBuffer(buffer)->ReadBytes(data);
                    return data;
                });
            }
            else
            {
                // File doesn't exist, return nullptr
                return task_from_result<Array<byte>^>(nullptr);
            }
    });
}

task<IBuffer^> ReadFileToBufferAsync ( String^ filename )

Definition at line 147 of file Utilities.cpp.

{
    return create_task(ApplicationData::Current->LocalFolder->TryGetItemAsync(filename)).then(
        [](IStorageItem^ item)
    {
        if (item != nullptr
            && item->IsOfType(StorageItemTypes::File))
        {
            // File exists, read it
            return create_task(dynamic_cast<StorageFile^>(item)->OpenReadAsync()).then([](IRandomAccessStreamWithContentType^ stream)
            {
                if (stream->Size > MAXDWORD32)
                {
                    throw ref new Exception(E_FAIL);
                }

                auto size = static_cast<unsigned int>(stream->Size);
                auto buffer = ref new Buffer(size);
                return stream->ReadAsync(buffer, size, InputStreamOptions::None);
            });
        }
        else
        {
            // File doesn't exist, return nullptr
            return task_from_result<IBuffer^>(nullptr);
        }
    });
}

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/Utilities.h File Reference

  • Nfc
  • NfcHceBackgroundTask
Defines | Functions

Utilities.h File Reference

Go to the source code of this file.

Defines

#define | SAFE_DELETE(x) if ((x) != nullptr) { delete (x); (x) = nullptr; }
#define | SAFE_DELETEARRAY(x) if ((x) != nullptr) { delete [] (x); (x) = nullptr; }

Functions

void | AppendFile (Platform::String^filename, Platform::String^data)
std::wstring | ByteArrayToString (_In_ Platform::Array< byte >^byteArray)
void | ChkHR (HRESULT hr)
Platform::String | GetCurrentTimeString ()
Windows::Storage::Streams::IBuffer | IBufferFromArray (_In_ Platform::Array< unsigned char >^data)
Windows::Storage::Streams::IBuffer | IBufferFromPointer (_In_ LPBYTE pbData, _In_ DWORD cbData)
HRESULT | ParseApdu (_In_ BYTE *pbCommandApdu, _In_ DWORD cbCommandApdu, _Out_ USHORT *pusClaIns, _Out_ BYTE *pbP1, _Out_ BYTE *pbP2, _Out_ BYTE **ppbPayload, _Out_ DWORD *pcbPayload, _Out_ DWORD *pcbLE)
LPBYTE | PointerFromIBuffer (_In_ Windows::Storage::Streams::IBuffer^buffer, _Out_opt_ DWORD *pcbLength)
Concurrency::task
< Platform::Array< byte >^> 		ReadAndUnprotectFileAsync (Platform::String^filename)
Concurrency::task
< Windows::Storage::Streams::IBuffer^> 		ReadFileToBufferAsync (Platform::String^filename)

Define Documentation

#define SAFE_DELETE ( x ) if ((x) != nullptr) { delete (x); (x) = nullptr; }

Definition at line 35 of file Utilities.h.

#define SAFE_DELETEARRAY ( x ) if ((x) != nullptr) { delete [] (x); (x) = nullptr; }

Definition at line 31 of file Utilities.h.

Function Documentation

void AppendFile | ( | Platform::String^ | filename,
 |  | Platform::String^ | data
 | ) |  |
std::wstring ByteArrayToString ( _In_ Platform::Array< byte >^ byteArray )
void ChkHR ( HRESULT hr )

Definition at line 100 of file Utilities.cpp.

{
    if (FAILED(hr))
    {
        throw ref new COMException(hr);
    }
}

Platform::String GetCurrentTimeString ( )

Definition at line 23 of file Utilities.cpp.

{
    auto calendar = ref new Calendar();
    calendar->SetToNow();

    int milliseconds = calendar->Nanosecond / 1000000;
    String^ strMilliseconds = milliseconds.ToString();

    // Pad zeros
    if (strMilliseconds->Length() == 1)
    {
        strMilliseconds = "00" + strMilliseconds;
    }
    else if (strMilliseconds->Length() == 2)
    {
        strMilliseconds = "0" + strMilliseconds;
    }

    return
        calendar->HourAsPaddedString(2) + ":" +
        calendar->MinuteAsPaddedString(2) + ":" +
        calendar->SecondAsPaddedString(2) + "." +
        strMilliseconds;
}

Windows::Storage::Streams::IBuffer IBufferFromArray ( _In_ Platform::Array< unsigned char >^ data )
Windows::Storage::Streams::IBuffer IBufferFromPointer | ( | _In_ LPBYTE | pbData,
 |  | _In_ DWORD | cbData
 | ) |  |
HRESULT ParseApdu | ( | _In_ BYTE * | pbCommandApdu,
 |  | _In_ DWORD | cbCommandApdu,
 |  | _Out_ USHORT * | pusClaIns,
 |  | _Out_ BYTE * | pbP1,
 |  | _Out_ BYTE * | pbP2,
 |  | _Out_ BYTE ** | ppbPayload,
 |  | _Out_ DWORD * | pcbPayload,
 |  | _Out_ DWORD * | pcbLE
 | ) |  |
LPBYTE PointerFromIBuffer | ( | _In_ Windows::Storage::Streams::IBuffer^ | buffer,
 |  | _Out_opt_ DWORD * | pcbLength
 | ) |  |
Concurrency::task<Platform::Array<byte>^> ReadAndUnprotectFileAsync ( Platform::String^ filename )
Concurrency::task<Windows::Storage::Streams::IBuffer^> ReadFileToBufferAsync ( Platform::String^ filename )
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/AtrParser.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

AtrParser.cs File Reference

Go to the source code of this file.

Classes

class | AtrInfo
class | AtrParser
Helper class that parses the ATR and populate the AtrInfo class. More...
class | ByteExtension
Extensions to the Byte primitive data type.

Namespaces

namespace | Pcsc::Common
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/CommonDefs.cs File Reference

  • Nfc
  • PcscSdk
Namespaces | Enumerations

CommonDefs.cs File Reference

Go to the source code of this file.

Namespaces

namespace | Pcsc::Common

Enumerations

enum | DeviceClass { Unknown = 0x00, StorageClass = 0x01, Iso14443P4 = 0x02, MifareDesfire = 0x03 }
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/DesfireAccessHandler.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

DesfireAccessHandler.cs File Reference

Go to the source code of this file.

Classes

class | AccessHandler
Access handler class for Desfire based ICC. More...
class | CardDetails
Class hodls Desfire card details information. More...

Namespaces

namespace | Desfire
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/DesfireCommand.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

DesfireCommand.cs File Reference

Go to the source code of this file.

Classes

class | DesfireCommand
Class DesfireCommand extends the Iso7816.ApduCommand and provides mappings to Iso7816 command fields. More...
class | DesfireResponse
Class DesfireResponse extends the Iso7816.ApduResponse. More...

Namespaces

namespace | Desfire
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/FelicaAccessHandler.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

FelicaAccessHandler.cs File Reference

Go to the source code of this file.

Classes

class | AccessHandler
Access handler class for Felica based ICC. More...

Namespaces

namespace | Felica
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/FelicaCommands.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

FelicaCommands.cs File Reference

Go to the source code of this file.

Classes

class | ApduResponse
Felica response APDU. More...
class | Check
Felica Check command when sent to the card the card is expected to read the byte of blocks specified in the block list. More...
class | GetHistoricalBytes
Felica GetHistoricalBytes command. More...
class | GetUid
Felica GetUid command. More...
class | Update
Felica Update command when sent to the card the card is expected to write the byte of blocks specified in the block list. More...

Namespaces

namespace | Felica
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/IccDetection.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

IccDetection.cs File Reference

Go to the source code of this file.

Classes

class | IccDetection
Class used to detect the type of the ICC card detected. More...

Namespaces

namespace | Pcsc::Common
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso15693AccessHandler.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

Iso15693AccessHandler.cs File Reference

Go to the source code of this file.

Classes

class | AccessHandler
Access handler class for Iso15693 based ICC. More...

Namespaces

namespace | Iso15693
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso15693Commands.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

Iso15693Commands.cs File Reference

Go to the source code of this file.

Classes

class | ApduResponse
Iso15693 response APDU. More...
class | GetHistoricalBytes
Iso15693 GetHistoricalBytes command. More...
class | GetUid
Iso15693 GetUid command. More...
class | Read
Iso15693 read command. More...
class | Write
Iso15693 write command. More...

Namespaces

namespace | Iso15693
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso7816.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

Iso7816.cs File Reference

Go to the source code of this file.

Classes

class | ApduCommand
Class ApduCommand implments the ISO 7816 apdu commands. More...
class | ApduResponse
Class ApduResponse implments handler for the ISO 7816 apdu response. More...
class | SelectCommand
Class that implements select command. More...

Namespaces

namespace | Iso7816
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso7816Defs.cs File Reference

  • Nfc
  • PcscSdk
Namespaces | Enumerations

Iso7816Defs.cs File Reference

Go to the source code of this file.

Namespaces

namespace | Iso7816

Enumerations

enum Cla {
CompliantCmd0x = 0x00, AppCompliantCmdAx = 0xA0, ProprietaryCla8x = 0x80, ProprietaryCla9x = 0x90,
ReservedForPts = 0xFF
}
enum | ClaXx { NoSmOrNoSmIndication = 0x00, ProprietarySmFormat = 0x01, SecureMessageNoHeaderSM = 0x10, SecureMessage1p6 = 0x11 }
enum Ins {
EraseBinary = 0x0E, Verify = 0x20, ManageChannel = 0x70, ExternalAuthenticate = 0x82,
GetChallenge = 0x84, InternalAuthenticate = 0x88, SelectFile = 0xA4, ReadBinary = 0xB0,
ReadRecords = 0xB2, GetResponse = 0xC0, Envelope = 0xC2, GetData = 0xCA,
WriteBinary = 0xD0, WriteRecord = 0xD2, UpdateBinary = 0xD6, PutData = 0xDA,
UpdateData = 0xDC, AppendRecord = 0xE2
}
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareStandardAccessHandler.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

MifareStandardAccessHandler.cs File Reference

Go to the source code of this file.

Classes

class | AccessHandler
Access handler class for Mifare Standard/Classic based ICC commands. More...
class | DefaultKeys

Namespaces

namespace | MifareStandard
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareStandardCommands.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

MifareStandardCommands.cs File Reference

Go to the source code of this file.

Classes

class | ApduResponse
Mifare response APDU. More...
class | GeneralAuthenticate
Mifare Standard GetHistoricalBytes command. More...
class | GetHistoricalBytes
Mifare Standard GetHistoricalBytes command. More...
class | GetUid
Mifare Standard GetUid command. More...
class | LoadKey
Mifare Standard Load Keys commad which stores the supplied key into the specified numbered key slot for subsequent use by the General Authenticate command. More...
class | Read
Mifare Standard Read commad when sent to the card the card is expected to return 16 bytes. More...
class | Write
Mifare Standard Write commad when sent to the card, writes 16 bytes at a time. More...

Namespaces

namespace | MifareStandard
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareUltralightAccessHandler.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

MifareUltralightAccessHandler.cs File Reference

Go to the source code of this file.

Classes

class | AccessHandler
Access handler class for MifareUL based ICC. More...

Namespaces

namespace | MifareUltralight
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareUltralightCommands.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

MifareUltralightCommands.cs File Reference

Go to the source code of this file.

Classes

class | ApduResponse
Mifare response APDU. More...
class | GetHistoricalBytes
Mifare UL GetHistoricalBytes command. More...
class | GetUid
Mifare UL GetUid command. More...
class | Read
Mifare UL Read commad when sent to the card the card is expected to return 16 byte of 4 Mifare pages starting at address addr. More...
class | Write
Mifare UL Write commad when sent to the card, writes 4 bytes (1 Mifare block) at given block address addr. More...

Namespaces

namespace | MifareUltralight
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Pcsc.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

Pcsc.cs File Reference

Go to the source code of this file.

Classes

class | ApduResponse
PCSC Apdu response. More...
class | GeneralAuthenticate
PCSC GeneralAuthenticate command. More...
class | GetData
PCSC GetData command. More...
class | GetHistoricalBytes
PCSC GetHistoricalBytes command. More...
class | GetUid
PCSC GetUid command. More...
class | IncrementDecrement
PCSC IncrementDecrement command. More...
class | LoadKeys
PCSC LoadKeys command. More...
class | ManageSession
PCSC ManageSession command. More...
class | ManageSessionResponse
PCSC ManageSession response. More...
class | ReadBinary
PCSC ReadBinary command. More...
class | TransparentExchange
PCSC TransparentExchange command. More...
class | TransparentExchangeResponse
PCSC TransparentExchange response. More...
class | UpdateBinary
PCSC Updatebinary Command. More...

Namespaces

namespace | Pcsc
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/PcscDefs.cs File Reference

  • Nfc
  • PcscSdk
Namespaces | Enumerations

PcscDefs.cs File Reference

Go to the source code of this file.

Namespaces

namespace Pcsc

Enumerations

enum CardName {
Unknown = 0x0000, MifareStandard1K = 0x0001, MifareStandard4K = 0x0002, MifareUltralight = 0x0003,
SLE55R = 0x0004, SR176 = 0x0006, SRIX4K = 0x0007, AT88RF020 = 0x0008,
AT88SC0204CRF = 0x0009, AT88SC0808CRF = 0x000A, AT88SC1616CRF = 0x000B, AT88SC3216CRF = 0x000C,
AT88SC6416CRF = 0x000D, SRF55V10P = 0x000E, SRF55V02P = 0x000F, SRF55V10S = 0x0010,
SRF55V02S = 0x0011, TAG_IT = 0x0012, LRI512 = 0x0013, ICODESLI = 0x0014,
TEMPSENS = 0x0015, ICODE1 = 0x0016, PicoPass2K = 0x0017, PicoPass2KS = 0x0018,
PicoPass16K = 0x0019, PicoPass16Ks = 0x001A, PicoPass16K8x2 = 0x001B, PicoPass16KS8x2 = 0x001C,
PicoPass32KS16p16 = 0x001D, PicoPass32KS16p8x2 = 0x001E, PicoPass32KS8x2p16 = 0x001F, PicoPass32KS8x2p8x2 = 0x0020,
LRI64 = 0x0021, ICODEUID = 0x0022, ICODEEPC = 0x0023, LRI12 = 0x0024,
LRI128 = 0x0025, MifareMini = 0x0026, SLE66R01P = 0x0027, SLE66RxxP = 0x0028,
SLE66RxxS = 0x0029, SLE55RxxE = 0x002A, SRF55V01P = 0x002B, SRF66V10ST = 0x002C,
SRF66V10IT = 0x002D, SRF66V01ST = 0x002E, JewelTag = 0x002F, TopazTag = 0x0030,
AT88SC0104CRF = 0x0031, AT88SC0404CRF = 0x0032, AT88RF01C = 0x0033, AT88RF04C = 0x0034,
iCodeSL2 = 0x0035, MifarePlusSL1_2K = 0x0036, MifarePlusSL1_4K = 0x0037, MifarePlusSL2_2K = 0x0038,
MifarePlusSL2_4K = 0x0039, MifareUltralightC = 0x003A, FeliCa = 0x003B, MelexisSensorTagMLX90129 = 0x003C,
MifareUltralightEV1 = 0x003D, CardNameMaxValue = MifareUltralightEV1
}
enum Ins {
GetData = 0xCA, LoadKeys = 0x82, GeneralAuthenticate = 0x86, Verify = 0x20,
ReadBinary = 0xB0, UpdateBinary = 0xD6
}
enum StorageStandard {
Unknown = 0x00, Iso14443AP1 = 0x01, Iso14443AP2 = 0x02, Iso14443AP3 = 0x03,
Iso14443ARfu = 0x04, Iso14443BP1 = 0x05, Iso14443BP2 = 0x06, Iso14443BP3 = 0x07,
Iso14443BRfu = 0x08, Iso15693P1 = 0x09, Iso15693P2 = 0x0A, Iso15693P3 = 0x0B,
Iso15693P4 = 0x0C, Iso7816CI2C = 0x0D, Iso7816CEI2C = 0x0E, Iso7816C2WBP = 0x0F,
Iso7816C3WBP = 0x10, FeliCa = 0x11, LowFreqCContactless = 0x40
}
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/PcscUtils.cs File Reference

  • Nfc
  • PcscSdk
Classes | Namespaces

PcscUtils.cs File Reference

Go to the source code of this file.

Classes

class | SmartCardConnectionExtension
class | SmartCardReaderUtils

Namespaces

namespace | Pcsc
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner/cs/SampleConfiguration.cs File Reference

  • NfcProvisioner
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner/cs/Scenario1.xaml.cs File Reference

  • NfcProvisioner
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

struct | NfcProvHeader
The NfcProvHeader is a prefix to each NFC provisioning message which contains information about the protocol version, message index, total message count, and etc. More...
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | NfcProvisioner
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/BadgeNotificationHistoryChangedTriggerTask.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
Classes | Namespaces

BadgeNotificationHistoryChangedTriggerTask.cs File Reference

Go to the source code of this file.

Classes

class | BadgeNotificationHistoryChangedTriggerTask
class | BadgeNumericNotificationContent
Notification content object to display a number on a tile's badge. More...
class | Util

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/ToastActivationTypeBackgroundClosedTask.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
Classes | Namespaces

ToastActivationTypeBackgroundClosedTask.cs File Reference

Go to the source code of this file.

Classes

class | ToastActivationTypeBackgroundClosedTask

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/ToastNotificationHistoryChangedTriggerTask.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
Classes | Namespaces

ToastNotificationHistoryChangedTriggerTask.cs File Reference

Go to the source code of this file.

Classes

class | ToastNotificationHistoryChangedTriggerTask

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/ToastNotificationQuickReplyTask.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
Classes | Namespaces

ToastNotificationQuickReplyTask.cs File Reference

Go to the source code of this file.

Classes

class | ToastNotificationQuickReplyTask

Namespaces

namespace | BackgroundTasks
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/BackgroundTaskStatus.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers
Namespaces | Enumerations

BackgroundTaskStatus.cs File Reference

Go to the source code of this file.

Namespaces

namespace | BackgroundTasks::Helpers

Enumerations

enum | BackgroundTaskStatus { Error, Success }
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/BackgroundTaskStorage.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers
Classes | Namespaces

BackgroundTaskStorage.cs File Reference

Go to the source code of this file.

Classes

class | BackgroundTaskStorage

Namespaces

namespace | BackgroundTasks::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/BadgeHelper.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers
Classes | Namespaces

BadgeHelper.cs File Reference

Go to the source code of this file.

Classes

class | BadgeHelper

Namespaces

namespace | BackgroundTasks::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/Settings.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers
Classes | Namespaces

Settings.cs File Reference

Go to the source code of this file.

Classes

class | Settings

Namespaces

namespace | BackgroundTasks::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/ToastHelper.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers
Classes | Namespaces

ToastHelper.cs File Reference

Go to the source code of this file.

Classes

class | ToastHelper

Namespaces

namespace | BackgroundTasks::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Properties/AssemblyInfo.cs File Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/App.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | Notifications
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/MainPage.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPage.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
Classes | Namespaces

ScenarioPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/InstructionControl.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

InstructionControl.cs File Reference

Go to the source code of this file.

Classes

class | InstructionControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/InstructionsControl.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

InstructionsControl.cs File Reference

Go to the source code of this file.

Classes

class | InstructionsControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/PopToastControl.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

PopToastControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PopToastControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/StepsControl.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

StepsControl.cs File Reference

Go to the source code of this file.

Classes

class | StepsControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/StepsHelperControl.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

StepsHelperControl.cs File Reference

Go to the source code of this file.

Classes

class | StepsHelperControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/UpdateFourTilesControl.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Controls
Classes | Namespaces

UpdateFourTilesControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | UpdateFourTilesControl

Namespaces

namespace | Notifications::Controls
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Converters/TypeToUIElementConverter.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Converters
Classes | Namespaces

TypeToUIElementConverter.cs File Reference

Go to the source code of this file.

Classes

class | TypeToUIElementConverter

Namespaces

namespace | Notifications::Converters
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Converters/XmlDocumentToStringConverter.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Converters
Classes | Namespaces

XmlDocumentToStringConverter.cs File Reference

Go to the source code of this file.

Classes

class | XmlDocumentToStringConverter

Namespaces

namespace | Notifications::Converters
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/BackButtonPage.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Helpers
Classes | Namespaces

BackButtonPage.cs File Reference

Go to the source code of this file.

Classes

class | BackButtonPage

Namespaces

namespace | Notifications::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/BindableBase.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Helpers
Classes | Namespaces

BindableBase.cs File Reference

Go to the source code of this file.

Classes

class | BindableBase
From http://danrigby.com/2012/04/01/inotifypropertychanged-the-net-4-5-way-revisited/. More...

Namespaces

namespace | Notifications::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/StringHelper.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Helpers
Classes | Namespaces

StringHelper.cs File Reference

Go to the source code of this file.

Classes

class | StringHelper

Namespaces

namespace | BackgroundTasks::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/TilesHelper.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Helpers
Classes | Namespaces

TilesHelper.cs File Reference

Go to the source code of this file.

Classes

class | TilesHelper

Namespaces

namespace | Notifications::Helpers
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/IScenario.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Model
Classes | Namespaces

IScenario.cs File Reference

Go to the source code of this file.

Classes

interface | IScenario

Namespaces

namespace | Notifications::Model
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/Scenario.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Model
Classes | Namespaces

Scenario.cs File Reference

Go to the source code of this file.

Classes

class | Scenario

Namespaces

namespace | Notifications::Model
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/ScenarioGroup.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Model
Classes | Namespaces

ScenarioGroup.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioGroup

Namespaces

namespace | Notifications::Model
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/Scenarios.cs File Reference

  • Notifications
  • cs
  • Notifications
  • Model
Classes | Namespaces

Scenarios.cs File Reference

Go to the source code of this file.

Classes

class | Scenarios

Namespaces

namespace | Notifications::Model
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ClearBadge/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • ClearBadge
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Badges::Local::PrimaryTile::ClearBadge
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeGlyph/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeGlyph
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeGlyph
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeNumber/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeNumber
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeNumber
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/SecondaryTileBadges/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • SecondaryTileBadges
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Badges::Local::SecondaryTileBadges
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Default/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Default
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Default
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Logo/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Logo
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Logo
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Name/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Name
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Name
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/NameAndLogo/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • NameAndLogo
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::NameAndLogo
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/None/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • None
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::None
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Custom/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Custom
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Custom
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Contact/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Contact
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Contact
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/People/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • People
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::People
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Photos/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Photos
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Photos
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppData/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppData
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppData
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppPackage/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppPackage
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppPackage
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromInternet/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromInternet
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromInternet
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextStyles/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextStyles
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextStyles
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextWrap/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextWrap
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextWrap
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Custom/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Custom
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Custom
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/InheritFromPrimary/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • InheritFromPrimary
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::InheritFromPrimary
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Transparent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Transparent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Transparent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/CheckAllPropertiesCorrect/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • CheckAllPropertiesCorrect
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState::CheckAllPropertiesCorrect
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppData/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppData
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppData
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppPackage/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppPackage
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppPackage
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/FindAllAsync/Visualizer/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync
  • Visualizer
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::FindAllAsync::Visualizer
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ExpiringNotification/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • ExpiringNotification
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Notifications::ExpiringNotification
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Clearing/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Clearing
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Clearing
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Sending/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Sending
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Sending
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/SecondaryTiles/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • SecondaryTiles
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Notifications::SecondaryTiles
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Pinning/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Pinning
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Pinning
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/UnpinEverything/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • UnpinEverything
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::UnpinEverything
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Updating/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Updating
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::LiveTiles::Updating
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/QuickReply/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • QuickReply
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::Action::QuickReply
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/Text/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • Text
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::Action::Text
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/TextAndImage/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • TextAndImage
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::Action::TextAndImage
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/DefaultInput/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • DefaultInput
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::InputText::DefaultInput
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/PlaceholderContent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • PlaceholderContent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::InputText::PlaceholderContent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/RetrievingArgs/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • RetrievingArgs
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::InputText::RetrievingArgs
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/Title/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • Title
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::InputText::Title
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/SystemCommands/SnoozeAndDismiss/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands
  • SnoozeAndDismiss
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Actions::SystemCommands::SnoozeAndDismiss
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppClosed/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppClosed
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppClosed
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppOpen/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppOpen
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppOpen
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppClosed/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppClosed
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppClosed
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppOpen/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppOpen
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppOpen
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/Protocol/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • Protocol
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::Protocol
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/AutoContent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • AutoContent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::AutoContent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/CustomContent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • CustomContent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::CustomContent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/Dismissing/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • Dismissing
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::Dismissing
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/AutoContent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • AutoContent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::AutoContent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/CustomContent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • CustomContent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::CustomContent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/Snoozing/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • Snoozing
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::Snoozing
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppData
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppData
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppPackage/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppPackage
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppPackage
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromInternet/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromInternet
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromInternet
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Default/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Default
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Audio::Default
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/EmailSound/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • EmailSound
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Audio::EmailSound
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Looping/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Looping
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Audio::Looping
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Silent/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Silent
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Audio::Silent
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ExpiringToast/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ExpiringToast
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ExpiringToast
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/GhostToast/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • GhostToast
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::GhostToast
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/BadgeControl/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • BadgeControl
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::BadgeControl
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/RespondingToToasts/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • RespondingToToasts
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::RespondingToToasts
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Alarm/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Alarm
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Scenarios::Alarm
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Default/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Default
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Scenarios::Default
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/IncomingCall/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • IncomingCall
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Scenarios::IncomingCall
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Reminder/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Reminder
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::Scenarios::Reminder
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ClearAll/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • ClearAll
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::ClearAll
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/GetHistory/Visualizer/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory
  • Visualizer
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory::Visualizer
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTag/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTag
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTag
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTagAndGroup/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTagAndGroup
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTagAndGroup
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ByGroup/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
  • ByGroup
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup::ByGroup
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/UpdateToast/ScenarioElement.xaml.cs File Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • UpdateToast
Classes | Namespaces

ScenarioElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ScenarioElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Notifications::ScenarioPages::Toasts::UpdateToast
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/pch.cpp File Reference

  • NumberFormatting
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/pch.h File Reference

  • NumberFormatting
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/SampleConfiguration.cpp File Reference

  • NumberFormatting
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/SampleConfiguration.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario1_PercentPermilleFormatting.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_PercentPermilleFormatting.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario1_PercentPermilleFormatting.xaml.h File Reference

#include "pch.h"
#include "Scenario1_PercentPermilleFormatting.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario2_DecimalFormatting.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_DecimalFormatting.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario2_DecimalFormatting.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario2_DecimalFormatting.xaml.h File Reference

#include "pch.h"
#include "Scenario2_DecimalFormatting.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario3_CurrencyFormatting.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CurrencyFormatting.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario3_CurrencyFormatting.xaml.h File Reference

#include "pch.h"
#include "Scenario3_CurrencyFormatting.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario4_NumberParsing.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario4_NumberParsing.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_NumberParsing.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario4_NumberParsing.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario4_NumberParsing.xaml.h File Reference

#include "pch.h"
#include "Scenario4_NumberParsing.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario5_RoundingAndPadding.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_RoundingAndPadding.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario5_RoundingAndPadding.xaml.h File Reference

#include "pch.h"
#include "Scenario5_RoundingAndPadding.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario6_NumeralSystemTranslation.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_NumeralSystemTranslation.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario6_NumeralSystemTranslation.xaml.h File Reference

#include "pch.h"
#include "Scenario6_NumeralSystemTranslation.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.cpp File Reference

  • NumberFormatting
  • cpp

Scenario7_UsingUnicodeExtensions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_UsingUnicodeExtensions.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.h File Reference

  • NumberFormatting
  • cpp
Classes | Namespaces

Scenario7_UsingUnicodeExtensions.xaml.h File Reference

#include "pch.h"
#include "Scenario7_UsingUnicodeExtensions.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/pch.cpp File Reference

  • NumberFormatting
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/pch.h File Reference

  • NumberFormatting
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.Globalization.NumberFormatting.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.System.UserProfile.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Project.idl File Reference

  • NumberFormatting
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_PercentPermilleFormatting
runtimeclass | Scenario2_DecimalFormatting
runtimeclass | Scenario3_CurrencyFormatting
runtimeclass | Scenario4_NumberParsing
runtimeclass | Scenario5_RoundingAndPadding
runtimeclass | Scenario6_NumeralSystemTranslation
runtimeclass | Scenario7_UsingUnicodeExtensions
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/SampleConfiguration.cpp File Reference

  • NumberFormatting
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/SampleConfiguration.h File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario1_PercentPermilleFormatting.cpp File Reference

#include "pch.h"
#include "Scenario1_PercentPermilleFormatting.h"
#include "Scenario1_PercentPermilleFormatting.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario1_PercentPermilleFormatting.h File Reference

#include "Scenario1_PercentPermilleFormatting.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_PercentPermilleFormatting
struct | Scenario1_PercentPermilleFormatting

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario2_DecimalFormatting.cpp File Reference

#include "pch.h"
#include "Scenario2_DecimalFormatting.h"
#include "Scenario2_DecimalFormatting.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario2_DecimalFormatting.h File Reference

#include "Scenario2_DecimalFormatting.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_DecimalFormatting
struct | Scenario2_DecimalFormatting

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario3_CurrencyFormatting.cpp File Reference

#include "pch.h"
#include "Scenario3_CurrencyFormatting.h"
#include "Scenario3_CurrencyFormatting.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario3_CurrencyFormatting.h File Reference

#include "Scenario3_CurrencyFormatting.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_CurrencyFormatting
struct | Scenario3_CurrencyFormatting

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario4_NumberParsing.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario4_NumberParsing.cpp File Reference

#include "pch.h"
#include "Scenario4_NumberParsing.h"
#include "Scenario4_NumberParsing.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario4_NumberParsing.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario4_NumberParsing.h File Reference

#include "Scenario4_NumberParsing.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_NumberParsing
struct | Scenario4_NumberParsing

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces | Functions

Scenario5_RoundingAndPadding.cpp File Reference

#include "pch.h"
#include "Scenario5_RoundingAndPadding.h"
#include "Scenario5_RoundingAndPadding.g.cpp"

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

std::wstring | DisplayRoundingAlgorithmAsString (RoundingAlgorithm roundingAlgorithm)
void | DoCurrencyRoundingScenarios (std::wostream &results, hstring const &currencyCode, RoundingAlgorithm roundingAlgorithm)
void | DoIncrementRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm)
void | DoPaddingAndRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm, unsigned int significantDigits, int integerDigits, int fractionalDigits)
void | DoPaddingScenarios (std::wostream &results, INumberFormatter const &formatter)
void | DoSignificantDigitRoundingScenarios (std::wostream &results, RoundingAlgorithm roundingAlgorithm)
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario5_RoundingAndPadding.h File Reference

#include "Scenario5_RoundingAndPadding.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_RoundingAndPadding
struct | Scenario5_RoundingAndPadding

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario6_NumeralSystemTranslation.cpp File Reference

#include "pch.h"
#include "Scenario6_NumeralSystemTranslation.h"
#include "Scenario6_NumeralSystemTranslation.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario6_NumeralSystemTranslation.h File Reference

#include "Scenario6_NumeralSystemTranslation.g.h"

Go to the source code of this file.

Classes

struct | Scenario6_NumeralSystemTranslation
struct | Scenario6_NumeralSystemTranslation

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.cpp File Reference

  • NumberFormatting
  • cppwinrt
Namespaces

Scenario7_UsingUnicodeExtensions.cpp File Reference

#include "pch.h"
#include "Scenario7_UsingUnicodeExtensions.h"
#include "Scenario7_UsingUnicodeExtensions.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.h File Reference

  • NumberFormatting
  • cppwinrt
Classes | Namespaces

Scenario7_UsingUnicodeExtensions.h File Reference

#include "Scenario7_UsingUnicodeExtensions.g.h"

Go to the source code of this file.

Classes

struct | Scenario7_UsingUnicodeExtensions
struct | Scenario7_UsingUnicodeExtensions

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/SampleConfiguration.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario1_PercentPermilleFormatting.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario1_PercentPermilleFormatting.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_PercentPermilleFormatting

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario2_DecimalFormatting.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario2_DecimalFormatting.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DecimalFormatting

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario3_CurrencyFormatting.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario3_CurrencyFormatting.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_CurrencyFormatting

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario4_NumberParsing.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario4_NumberParsing.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_NumberParsing

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario5_RoundingAndPadding.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario5_RoundingAndPadding.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_RoundingAndPadding

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario6_NumeralSystemTranslation.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario6_NumeralSystemTranslation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_NumeralSystemTranslation

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario7_UsingUnicodeExtensions.xaml.cs File Reference

  • NumberFormatting
  • cs
Classes | Namespaces

Scenario7_UsingUnicodeExtensions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_UsingUnicodeExtensions
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrCapturedImage.xaml.cpp File Reference

  • OCR
  • cpp
Functions

OcrCapturedImage.xaml.cpp File Reference

#include "pch.h"
#include "OcrCapturedImage.xaml.h"

Go to the source code of this file.

Functions

concurrency::task< void > create_empty_task ()

Function Documentation

concurrency::task<void> create_empty_task ( )

Definition at line 37 of file OcrCapturedImage.xaml.cpp.

{
    return concurrency::create_task([] {});
}

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrCapturedImage.xaml.h File Reference

  • OCR
  • cpp
Classes | Namespaces

OcrCapturedImage.xaml.h File Reference

#include "OcrCapturedImage.g.h"
#include "MainPage.xaml.h"
#include "WordOverlay.h"
#include <ppl.h>
#include "WordOverlay.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrFileImage.xaml.cpp File Reference

  • OCR
  • cpp

OcrFileImage.xaml.cpp File Reference

#include "pch.h"
#include "OcrFileImage.xaml.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrFileImage.xaml.h File Reference

  • OCR
  • cpp
Classes | Namespaces

OcrFileImage.xaml.h File Reference

#include "OcrFileImage.g.h"
#include "MainPage.xaml.h"
#include "WordOverlay.h"
#include <map>
#include <ppltasks.h>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/pch.cpp File Reference

  • OCR
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/pch.h File Reference

  • OCR
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/SampleConfiguration.cpp File Reference

  • OCR
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/SampleConfiguration.h File Reference

  • OCR
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/WordOverlay.cpp File Reference

  • OCR
  • cpp

WordOverlay.cpp File Reference

#include "pch.h"
#include "WordOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/WordOverlay.h File Reference

  • OCR
  • cpp
Classes | Namespaces

WordOverlay.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrCapturedImage.cpp File Reference

  • OCR
  • cppwinrt
Namespaces

OcrCapturedImage.cpp File Reference

#include "pch.h"
#include "OcrCapturedImage.h"
#include "OcrCapturedImage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrCapturedImage.h File Reference

  • OCR
  • cppwinrt
Classes | Namespaces

OcrCapturedImage.h File Reference

#include "pch.h"
#include "MainPage.h"
#include "WordOverlay.h"
#include "OcrCapturedImage.g.h"

Go to the source code of this file.

Classes

struct | OcrCapturedImage
struct | OcrCapturedImage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrFileImage.cpp File Reference

  • OCR
  • cppwinrt
Namespaces

OcrFileImage.cpp File Reference

#include "pch.h"
#include "OcrFileImage.h"
#include "OcrFileImage.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrFileImage.h File Reference

  • OCR
  • cppwinrt
Classes | Namespaces

OcrFileImage.h File Reference

#include "pch.h"
#include "MainPage.h"
#include "WordOverlay.h"
#include "OcrFileImage.g.h"

Go to the source code of this file.

Classes

struct | OcrFileImage
struct | OcrFileImage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/pch.cpp File Reference

  • OCR
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/pch.h File Reference

  • OCR
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.Graphics.Imaging.h"
#include "winrt/Windows.Graphics.Display.h"
#include "winrt/Windows.Media.h"
#include "winrt/Windows.Media.Capture.h"
#include "winrt/Windows.Media.Devices.h"
#include "winrt/Windows.Media.MediaProperties.h"
#include "winrt/Windows.Media.Ocr.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Data.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Input.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.System.Display.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/Project.idl File Reference

  • OCR
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | OcrCapturedImage
runtimeclass | OcrFileImage
runtimeclass | WordOverlay
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/SampleConfiguration.cpp File Reference

  • OCR
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/SampleConfiguration.h File Reference

  • OCR
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/WordOverlay.cpp File Reference

  • OCR
  • cppwinrt
Namespaces

WordOverlay.cpp File Reference

#include "pch.h"
#include "WordOverlay.h"
#include "WordOverlay.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/WordOverlay.h File Reference

  • OCR
  • cppwinrt
Classes | Namespaces

WordOverlay.h File Reference

#include "pch.h"
#include "MainPage.h"
#include "WordOverlay.g.h"

Go to the source code of this file.

Classes

struct | WordOverlay

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/OcrCapturedImage.xaml.cs File Reference

  • OCR
  • cs
Classes | Namespaces

OcrCapturedImage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OcrCapturedImage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/OcrFileImage.xaml.cs File Reference

  • OCR
  • cs
Classes | Namespaces

OcrFileImage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OcrFileImage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/SampleConfiguration.cs File Reference

  • OCR
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/WordOverlay.cs File Reference

  • OCR
  • cs
Classes | Namespaces

WordOverlay.cs File Reference

Go to the source code of this file.

Classes

class | WordOverlay
Wraps recognized word and provides word overlay position and size based on current scale. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/pch.cpp File Reference

  • OnDemandHotspot
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/pch.h File Reference

  • OnDemandHotspot
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.Background.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.Sensors.h"
#include "winrt/Windows.Devices.WiFi.h"
#include "winrt/Windows.Security.Credentials.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/Project.idl File Reference

  • OnDemandHotspot
  • cppwinrt
Namespaces | Functions | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

void | Button_Click_ApplyNow ()
void | Button_Click_Save ()

Variables

Int32 | Bars
Boolean | BarsVisible
Int32 | BatteryPercent
Boolean | BatteryVisible
String | DisplayName
Boolean | IsAvailable
runtimeclass | ODHModel
String | Password
runtimeclass | Scenario1_ManageHotspot
String | Ssid
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/SampleConfiguration.cpp File Reference

  • OnDemandHotspot
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/SampleConfiguration.h File Reference

  • OnDemandHotspot
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate
namespace | winrt::SDKTemplate::Constants
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.cpp File Reference

  • OnDemandHotspot
  • cppwinrt
Namespaces

Scenario1_ManageHotspot.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario1_ManageHotspot.h"
#include "Scenario1_ManageHotspot.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.h File Reference

  • OnDemandHotspot
  • cppwinrt
Classes | Namespaces

Scenario1_ManageHotspot.h File Reference

#include "Scenario1_ManageHotspot.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_ManageHotspot
struct | Scenario1_ManageHotspot

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/pch.cpp File Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/pch.h File Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include "winrt/Windows.ApplicationModel.Background.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.Devices.WiFi.h"
#include "winrt/Windows.Security.Credentials.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.UI.Notifications.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.cpp File Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask
Namespaces

Tasks.cpp File Reference

#include "pch.h"
#include "Tasks.h"
#include "UpdateMetadataTask.g.cpp"
#include "ConnectTask.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.h File Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask
Classes | Namespaces

Tasks.h File Reference

#include "pch.h"
#include "UpdateMetadataTask.g.h"
#include "ConnectTask.g.h"

Go to the source code of this file.

Classes

struct | ConnectTask
struct | UpdateMetadataTask
struct | ConnectTask
struct | UpdateMetadataTask

Namespaces

namespace | winrt::BackgroundTask::factory_implementation
namespace | winrt::BackgroundTask::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/Tasks.idl File Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask
Namespaces | Variables

Tasks.idl File Reference

Go to the source code of this file.

Namespaces

namespace | BackgroundTask

Variables

runtimeclass | ConnectTask
runtimeclass | UpdateMetadataTask
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/SampleConfiguration.cs File Reference

  • OnDemandHotspot
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | Constants
Class containing Attributes and UUIDs that will populate the SDP record. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/Scenario1_ManageHotspot.xaml.cs File Reference

  • OnDemandHotspot
  • cs
Classes | Namespaces

Scenario1_ManageHotspot.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ManageHotspot

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/BackgroundTask/Tasks.cs File Reference

  • OnDemandHotspot
  • cs
  • BackgroundTask
Classes | Namespaces

Tasks.cs File Reference

Go to the source code of this file.

Classes

class | ConnectTask
class | UpdateMetadataTask

Namespaces

namespace | BackgroundTask
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/BackgroundTask/Properties/AssemblyInfo.cs File Reference

  • OnDemandHotspot
  • cs
  • BackgroundTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/CalibrationBar.xaml.cpp File Reference

  • OrientationSensor
  • cpp

CalibrationBar.xaml.cpp File Reference

#include "pch.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/CalibrationBar.xaml.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

CalibrationBar.xaml.h File Reference

#include "pch.h"
#include "CalibrationBar.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/pch.cpp File Reference

  • OrientationSensor
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/pch.h File Reference

  • OrientationSensor
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/SampleConfiguration.cpp File Reference

  • OrientationSensor
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/SampleConfiguration.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario0_Choose.xaml.cpp File Reference

  • OrientationSensor
  • cpp

Scenario0_Choose.xaml.cpp File Reference

#include "pch.h"
#include "Scenario0_Choose.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario0_Choose.xaml.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

Scenario0_Choose.xaml.h File Reference

#include "pch.h"
#include "Scenario0_Choose.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • OrientationSensor
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario1_DataEvents.xaml.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario2_Polling.xaml.cpp File Reference

  • OrientationSensor
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario2_Polling.xaml.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario3_Calibration.xaml.cpp File Reference

  • OrientationSensor
  • cpp

Scenario3_Calibration.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Calibration.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario3_Calibration.xaml.h File Reference

  • OrientationSensor
  • cpp
Classes | Namespaces

Scenario3_Calibration.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Calibration.g.h"
#include "MainPage.xaml.h"
#include "CalibrationBar.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/CalibrationBar.xaml.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

CalibrationBar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CalibrationBar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/SampleConfiguration.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/Scenario0_Choose.xaml.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

Scenario0_Choose.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario0_Choose

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/Scenario1_DataEvents.xaml.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/Scenario2_Polling.xaml.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/Scenario3_Calibration.xaml.cs File Reference

  • OrientationSensor
  • cs
Classes | Namespaces

Scenario3_Calibration.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Calibration

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/pch.cpp File Reference

  • Package
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/pch.h File Reference

  • Package
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/SampleConfiguration.cpp File Reference

  • Package
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/SampleConfiguration.h File Reference

  • Package
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario1_identity.xaml.cpp File Reference

  • Package
  • cpp

scenario1_identity.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Identity.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario1_identity.xaml.h File Reference

  • Package
  • cpp
Classes | Namespaces

scenario1_identity.xaml.h File Reference

#include "pch.h"
#include "Scenario1_Identity.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario2_installedlocation.xaml.cpp File Reference

  • Package
  • cpp

scenario2_installedlocation.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_InstalledLocation.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario2_installedlocation.xaml.h File Reference

  • Package
  • cpp
Classes | Namespaces

scenario2_installedlocation.xaml.h File Reference

#include "pch.h"
#include "Scenario2_InstalledLocation.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario3_dependencies.xaml.cpp File Reference

  • Package
  • cpp

scenario3_dependencies.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Dependencies.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario3_dependencies.xaml.h File Reference

  • Package
  • cpp
Classes | Namespaces

scenario3_dependencies.xaml.h File Reference

#include "pch.h"
#include "Scenario3_Dependencies.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cs/SampleConfiguration.cs File Reference

  • Package
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cs/scenario1_identity.xaml.cs File Reference

  • Package
  • cs
Classes | Namespaces

scenario1_identity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cs/scenario2_installedlocation.xaml.cs File Reference

  • Package
  • cs
Classes | Namespaces

scenario2_installedlocation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cs/scenario3_dependencies.xaml.cs File Reference

  • Package
  • cs
Classes | Namespaces

scenario3_dependencies.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/pch.cpp File Reference

  • PasswordVault
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/pch.h File Reference

  • PasswordVault
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/SampleConfiguration.cpp File Reference

  • PasswordVault
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/SampleConfiguration.h File Reference

  • PasswordVault
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario1_Save.xaml.cpp File Reference

  • PasswordVault
  • cpp

Scenario1_Save.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Save.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario1_Save.xaml.h File Reference

  • PasswordVault
  • cpp
Classes | Namespaces

Scenario1_Save.xaml.h File Reference

#include "Scenario1_Save.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario2_Manage.xaml.cpp File Reference

  • PasswordVault
  • cpp

Scenario2_Manage.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Manage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario2_Manage.xaml.h File Reference

  • PasswordVault
  • cpp
Classes | Namespaces

Scenario2_Manage.xaml.h File Reference

#include "Scenario2_Manage.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/pch.cpp File Reference

  • PasswordVault
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/pch.h File Reference

  • PasswordVault
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Security.Credentials.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Project.idl File Reference

  • PasswordVault
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Save
runtimeclass | Scenario2_Manage
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/SampleConfiguration.cpp File Reference

  • PasswordVault
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/SampleConfiguration.h File Reference

  • PasswordVault
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario1_Save.cpp File Reference

  • PasswordVault
  • cppwinrt
Namespaces

Scenario1_Save.cpp File Reference

#include "pch.h"
#include "Scenario1_Save.h"
#include "Scenario1_Save.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario1_Save.h File Reference

  • PasswordVault
  • cppwinrt
Classes | Namespaces

Scenario1_Save.h File Reference

#include "Scenario1_Save.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Save
struct | Scenario1_Save

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario2_Manage.cpp File Reference

  • PasswordVault
  • cppwinrt
Namespaces | Variables

Scenario2_Manage.cpp File Reference

#include "pch.h"
#include "Scenario2_Manage.h"
#include "Scenario2_Manage.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate::implementation

Variables

constexpr auto | hresult_not_found = winrt::hresult{ static_cast<int32_t>(0x80070490) }

Variable Documentation

constexpr auto hresult_not_found = winrt::hresult{ static_cast<int32_t>(0x80070490) }

Definition at line 23 of file Scenario2_Manage.cpp.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario2_Manage.h File Reference

  • PasswordVault
  • cppwinrt
Classes | Namespaces

Scenario2_Manage.h File Reference

#include "Scenario2_Manage.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Manage
struct | Scenario2_Manage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/SampleConfiguration.cs File Reference

  • PasswordVault
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/Scenario1_Save.xaml.cs File Reference

  • PasswordVault
  • cs
Classes | Namespaces

Scenario1_Save.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Save

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/Scenario2_Manage.xaml.cs File Reference

  • PasswordVault
  • cs
Classes | Namespaces

Scenario2_Manage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Manage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/pch.cpp File Reference

  • PdfDocument
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/pch.h File Reference

  • PdfDocument
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/SampleConfiguration.cpp File Reference

  • PdfDocument
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/SampleConfiguration.h File Reference

  • PdfDocument
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/Scenario1_Render.xaml.cpp File Reference

  • PdfDocument
  • cpp

Scenario1_Render.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Render.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/Scenario1_Render.xaml.h File Reference

  • PdfDocument
  • cpp
Classes | Namespaces

Scenario1_Render.xaml.h File Reference

#include "Scenario1_Render.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/pch.cpp File Reference

  • PdfDocument
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/pch.h File Reference

  • PdfDocument
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Data.Pdf.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/Project.idl File Reference

  • PdfDocument
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Render
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/SampleConfiguration.cpp File Reference

  • PdfDocument
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/SampleConfiguration.h File Reference

  • PdfDocument
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/Scenario1_Render.cpp File Reference

  • PdfDocument
  • cppwinrt
Namespaces

Scenario1_Render.cpp File Reference

#include "pch.h"
#include "Scenario1_Render.h"
#include "Scenario1_Render.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/Scenario1_Render.h File Reference

  • PdfDocument
  • cppwinrt
Classes | Namespaces

Scenario1_Render.h File Reference

#include "Scenario1_Render.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Render
struct | Scenario1_Render

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cs/SampleConfiguration.cs File Reference

  • PdfDocument
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cs/Scenario1_Render.xaml.cs File Reference

  • PdfDocument
  • cs
Classes | Namespaces

Scenario1_Render.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Render

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/pch.cpp File Reference

  • Pedometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/pch.h File Reference

  • Pedometer
  • cpp
Variables

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Variables

const GUID GUID_Pedometer_ClassId = { 0XB19F89AF, 0XE3EB, 0X444B, 0X8D, 0XEA, 0X20, 0X25, 0X75, 0XA7, 0X15, 0X99 }

Variable Documentation

const GUID GUID_Pedometer_ClassId = { 0XB19F89AF, 0XE3EB, 0X444B, 0X8D, 0XEA, 0X20, 0X25, 0X75, 0XA7, 0X15, 0X99 }

Definition at line 20 of file pch.h.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/SampleConfiguration.cpp File Reference

  • Pedometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/SampleConfiguration.h File Reference

  • Pedometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario1_Events.xaml.cpp File Reference

  • Pedometer
  • cpp
Variables

Scenario1_Events.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Events.xaml.h"

Go to the source code of this file.

Variables

const unsigned int HundredNanoSecondsToMilliseconds = 10000

Variable Documentation

const unsigned int HundredNanoSecondsToMilliseconds = 10000

Definition at line 15 of file Scenario1_Events.xaml.cpp.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario1_Events.xaml.h File Reference

  • Pedometer
  • cpp
Classes | Namespaces

Scenario1_Events.xaml.h File Reference

#include "Scenario1_Events.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario2_History.xaml.cpp File Reference

  • Pedometer
  • cpp

Scenario2_History.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_History.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario2_History.xaml.h File Reference

  • Pedometer
  • cpp
Classes | Namespaces

Scenario2_History.xaml.h File Reference

#include "Scenario2_History.g.h"
#include <collection.h>
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario3_CurrentStepCount.xaml.cpp File Reference

  • Pedometer
  • cpp

Scenario3_CurrentStepCount.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CurrentStepCount.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario3_CurrentStepCount.xaml.h File Reference

  • Pedometer
  • cpp
Classes | Namespaces

Scenario3_CurrentStepCount.xaml.h File Reference

#include "Scenario3_CurrentStepCount.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario4_BackgroundTask.xaml.cpp File Reference

  • Pedometer
  • cpp

Scenario4_BackgroundTask.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_BackgroundTask.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario4_BackgroundTask.xaml.h File Reference

  • Pedometer
  • cpp
Classes | Namespaces

Scenario4_BackgroundTask.xaml.h File Reference

#include "Scenario4_BackgroundTask.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/pch.cpp File Reference

  • Pedometer
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/pch.h File Reference

  • Pedometer
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/PedometerBackgroundTask.cpp File Reference

  • Pedometer
  • cpp
  • Tasks

PedometerBackgroundTask.cpp File Reference

#include "pch.h"
#include "PedometerBackgroundTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/PedometerBackgroundTask.h File Reference

  • Pedometer
  • cpp
  • Tasks
Classes | Namespaces

PedometerBackgroundTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/SampleConfiguration.cs File Reference

  • Pedometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Scenario1_Events.xaml.cs File Reference

  • Pedometer
  • cs
Classes | Namespaces

Scenario1_Events.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Events
'Events' scenario page that gets navigated to when the user selected the 'Events' scenario. More...

Namespaces

namespace | PedometerCS
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Scenario2_History.xaml.cs File Reference

  • Pedometer
  • cs
Classes | Namespaces

Scenario2_History.xaml.cs File Reference

Go to the source code of this file.

Classes

class | HistoryRecord
Represents a history record object that gets binded to the ListView controller in the XAML. More...
class | Scenario2_History
History Page that gets loaded when 'History' scenario is selected. More...

Namespaces

namespace | PedometerCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Scenario3_CurrentStepCount.xaml.cs File Reference

  • Pedometer
  • cs
Classes | Namespaces

Scenario3_CurrentStepCount.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_CurrentStepCount
'Current step count' illustration page More...

Namespaces

namespace | PedometerCS
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Scenario4_BackgroundTask.xaml.cs File Reference

  • Pedometer
  • cs
Classes | Namespaces

Scenario4_BackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_BackgroundPedometer
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PedometerCS
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/PedometerBackgroundTask.cs File Reference

  • Pedometer
  • cs
  • Tasks
Classes | Namespaces

PedometerBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | PedometerBackgroundTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • Pedometer
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/pch.cpp File Reference

  • PenHaptics
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/pch.h File Reference

  • PenHaptics
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Foundation.Numerics.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Haptics.h"
#include "winrt/Windows.Devices.Input.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Input.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.UI.Xaml.Shapes.h"
#include <math.h>
#include <map>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Project.idl File Reference

  • PenHaptics
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_InkCanvasTactileFeedback
runtimeclass | Scenario2_SupportedTactileFeedback
runtimeclass | Scenario3_InkingFeedback
runtimeclass | Scenario4_InteractionFeedback
runtimeclass | Scenario5_InkingAndInteractionFeedback
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/SampleConfiguration.cpp File Reference

  • PenHaptics
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/SampleConfiguration.h File Reference

  • PenHaptics
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

Windows::Devices::Haptics::SimpleHapticsControllerFeedback | FindSupportedFeedback (Windows::Devices::Haptics::SimpleHapticsController const &hapticsController, uint16_t waveform)
std::map< hstring, uint16_t >
const & 		WaveformNamesMap ()
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.cpp File Reference

  • PenHaptics
  • cppwinrt
Namespaces

Scenario1_InkCanvasTactileFeedback.cpp File Reference

#include "pch.h"
#include "Scenario1_InkCanvasTactileFeedback.h"
#include "Scenario1_InkCanvasTactileFeedback.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario1_InkCanvasTactileFeedback.h File Reference

  • PenHaptics
  • cppwinrt
Classes | Namespaces

Scenario1_InkCanvasTactileFeedback.h File Reference

#include "Scenario1_InkCanvasTactileFeedback.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_InkCanvasTactileFeedback
struct | Scenario1_InkCanvasTactileFeedback

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.cpp File Reference

  • PenHaptics
  • cppwinrt
Namespaces

Scenario2_SupportedTactileFeedback.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario2_SupportedTactileFeedback.h"
#include "Scenario2_SupportedTactileFeedback.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.h File Reference

  • PenHaptics
  • cppwinrt
Classes | Namespaces

Scenario2_SupportedTactileFeedback.h File Reference

#include "Scenario2_SupportedTactileFeedback.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_SupportedTactileFeedback
struct | Scenario2_SupportedTactileFeedback

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario3_InkingFeedback.cpp File Reference

  • PenHaptics
  • cppwinrt
Namespaces

Scenario3_InkingFeedback.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario3_InkingFeedback.h"
#include "Scenario3_InkingFeedback.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario3_InkingFeedback.h File Reference

  • PenHaptics
  • cppwinrt
Classes | Namespaces

Scenario3_InkingFeedback.h File Reference

#include "Scenario3_InkingFeedback.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_InkingFeedback
struct | Scenario3_InkingFeedback

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario4_InteractionFeedback.cpp File Reference

  • PenHaptics
  • cppwinrt
Namespaces

Scenario4_InteractionFeedback.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario4_InteractionFeedback.h"
#include "Scenario4_InteractionFeedback.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario4_InteractionFeedback.h File Reference

  • PenHaptics
  • cppwinrt
Classes | Namespaces

Scenario4_InteractionFeedback.h File Reference

#include "Scenario4_InteractionFeedback.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_InteractionFeedback
struct | Scenario4_InteractionFeedback

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.cpp File Reference

  • PenHaptics
  • cppwinrt
Namespaces

Scenario5_InkingAndInteractionFeedback.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario5_InkingAndInteractionFeedback.h"
#include "Scenario5_InkingAndInteractionFeedback.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.h File Reference

  • PenHaptics
  • cppwinrt
Classes | Namespaces

Scenario5_InkingAndInteractionFeedback.h File Reference

#include "Scenario5_InkingAndInteractionFeedback.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5_InkingAndInteractionFeedback
struct | Scenario5_InkingAndInteractionFeedback

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/SampleConfiguration.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario1_InkCanvasTactileFeedback.xaml.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

Scenario1_InkCanvasTactileFeedback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_InkCanvasTactileFeedback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario2_SupportedTactileFeedback.xaml.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

Scenario2_SupportedTactileFeedback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_SupportedTactileFeedback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario3_InkingFeedback.xaml.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

Scenario3_InkingFeedback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_InkingFeedback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario4_InteractionFeedback.xaml.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

Scenario4_InteractionFeedback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_InteractionFeedback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario5_InkingAndInteractionFeedback.xaml.cs File Reference

  • PenHaptics
  • cs
Classes | Namespaces

Scenario5_InkingAndInteractionFeedback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_InkingAndInteractionFeedback

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/pch.cpp File Reference

  • PersonalDataEncryption
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/pch.h File Reference

  • PersonalDataEncryption
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Security.DataProtection.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Pickers.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Project.idl File Reference

  • PersonalDataEncryption
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario2_Memory
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp File Reference

  • PersonalDataEncryption
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/SampleConfiguration.h File Reference

  • PersonalDataEncryption
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp File Reference

  • PersonalDataEncryption
  • cppwinrt
Namespaces

Scenario1_Files.cpp File Reference

#include "pch.h"
#include "Scenario1_Files.h"
#include "Scenario1_Files.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario1_Files.h File Reference

  • PersonalDataEncryption
  • cppwinrt
Classes | Namespaces

Scenario1_Files.h File Reference

#include "Scenario1_Files.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Files
struct | Scenario1_Files

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp File Reference

  • PersonalDataEncryption
  • cppwinrt
Namespaces

Scenario2_Memory.cpp File Reference

#include "pch.h"
#include "Scenario2_Memory.h"
#include "Scenario2_Memory.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario2_Memory.h File Reference

  • PersonalDataEncryption
  • cppwinrt
Classes | Namespaces

Scenario2_Memory.h File Reference

#include "Scenario2_Memory.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Memory
struct | Scenario2_Memory

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cs/SampleConfiguration.cs File Reference

  • PersonalDataEncryption
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cs/Scenario1_Files.xaml.cs File Reference

  • PersonalDataEncryption
  • cs
Classes | Namespaces

Scenario1_Files.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Files

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs File Reference

  • PersonalDataEncryption
  • cs
Classes | Namespaces

Scenario2_Memory.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Memory

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/AddImageFeedScenario.xaml.cpp File Reference

  • Personalization
  • cpp

AddImageFeedScenario.xaml.cpp File Reference

#include "pch.h"
#include "AddImageFeedScenario.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/AddImageFeedScenario.xaml.h File Reference

  • Personalization
  • cpp
Classes | Namespaces

AddImageFeedScenario.xaml.h File Reference

#include "AddImageFeedScenario.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/pch.cpp File Reference

  • Personalization
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/pch.h File Reference

  • Personalization
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/SampleConfiguration.cpp File Reference

  • Personalization
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/SampleConfiguration.h File Reference

  • Personalization
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/SetLockScreenImage.xaml.cpp File Reference

  • Personalization
  • cpp

SetLockScreenImage.xaml.cpp File Reference

#include "pch.h"
#include "SetLockScreenImage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/SetLockScreenImage.xaml.h File Reference

  • Personalization
  • cpp
Classes | Namespaces

SetLockScreenImage.xaml.h File Reference

#include "pch.h"
#include "SetLockScreenImage.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cs/SampleConfiguration.cs File Reference

  • Personalization
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cs/SetLockScreenImage.xaml.cs File Reference

  • Personalization
  • cs
Classes | Namespaces

SetLockScreenImage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SetLockScreenImage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/pch.cpp File Reference

  • Playlists
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/pch.h File Reference

  • Playlists
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/SampleConfiguration.cpp File Reference

  • Playlists
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/SampleConfiguration.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario1_Create.xaml.cpp File Reference

  • Playlists
  • cpp

Scenario1_Create.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Create.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario1_Create.xaml.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

Scenario1_Create.xaml.h File Reference

#include "Scenario1_Create.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario2_Display.xaml.cpp File Reference

  • Playlists
  • cpp

Scenario2_Display.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Display.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario2_Display.xaml.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

Scenario2_Display.xaml.h File Reference

#include "Scenario2_Display.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario3_Add.xaml.cpp File Reference

  • Playlists
  • cpp

Scenario3_Add.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Add.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario3_Add.xaml.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

Scenario3_Add.xaml.h File Reference

#include "Scenario3_Add.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario4_Remove.xaml.cpp File Reference

  • Playlists
  • cpp

Scenario4_Remove.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Remove.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario4_Remove.xaml.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

Scenario4_Remove.xaml.h File Reference

#include "Scenario4_Remove.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario5_Clear.xaml.cpp File Reference

  • Playlists
  • cpp

Scenario5_Clear.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_Clear.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario5_Clear.xaml.h File Reference

  • Playlists
  • cpp
Classes | Namespaces

Scenario5_Clear.xaml.h File Reference

#include "Scenario5_Clear.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/SampleConfiguration.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario1_Create.xaml.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

Scenario1_Create.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Create

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario2_Display.xaml.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

Scenario2_Display.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Display

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario3_Add.xaml.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

Scenario3_Add.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Add

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario4_Remove.xaml.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

Scenario4_Remove.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Remove

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario5_Clear.xaml.cs File Reference

  • Playlists
  • cs
Classes | Namespaces

Scenario5_Clear.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_Clear

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/SampleConfiguration.cs File Reference

  • PlayReady
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario1_ReactiveRequest.xaml.cs File Reference

  • PlayReady
  • cs
Classes | Namespaces

Scenario1_ReactiveRequest.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ReactiveRequest
This Scenario demonstrates simple Reactive license Acquisition. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario2_ProactiveRequest.xaml.cs File Reference

  • PlayReady
  • cs
Classes | Namespaces

Scenario2_ProactiveRequest.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ProactiveRequest

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario3_HardwareDRM.xaml.cs File Reference

  • PlayReady
  • cs
Classes | Namespaces

Scenario3_HardwareDRM.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_HardwareDRM

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario4_SecureStop.xaml.cs File Reference

  • PlayReady
  • cs
Classes | Namespaces

Scenario4_SecureStop.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_SecureStop

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Controls/PlayReadyInfo.xaml.cs File Reference

  • PlayReady
  • cs
  • Controls
Classes | Namespaces

PlayReadyInfo.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PlayReadyInfo

Namespaces

namespace | SDKTemplate::Controls
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Shared/PlayReadyHelpers.cs File Reference

  • PlayReady
  • cs
  • Shared
Classes | Namespaces

PlayReadyHelpers.cs File Reference

Go to the source code of this file.

Classes

class | PlayReadyHelpers

Namespaces

namespace | SDKTemplate::Shared
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Shared/RelayCommand.cs File Reference

  • PlayReady
  • cs
  • Shared
Classes | Namespaces

RelayCommand.cs File Reference

Go to the source code of this file.

Classes

class | RelayCommand
A command whose sole purpose is to relay its functionality to other objects by invoking delegates. More...

Namespaces

namespace | SDKTemplate::Shared
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/HardwareDRMViewModel.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

HardwareDRMViewModel.cs File Reference

Go to the source code of this file.

Classes

class | HardwareDRMViewModel

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/PlayReadyInfoViewModel.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

PlayReadyInfoViewModel.cs File Reference

Go to the source code of this file.

Classes

class | PlayReadyInfoViewModel

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ProactiveViewModel.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

ProactiveViewModel.cs File Reference

Go to the source code of this file.

Classes

class | ProactiveViewModel

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ReactiveViewModel.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

ReactiveViewModel.cs File Reference

Go to the source code of this file.

Classes

class | ReactiveViewModel

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/SecureStopViewModel.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

SecureStopViewModel.cs File Reference

Go to the source code of this file.

Classes

class | SecureStopViewModel

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ViewModelBase.cs File Reference

  • PlayReady
  • cs
  • ViewModels
Classes | Namespaces

ViewModelBase.cs File Reference

Go to the source code of this file.

Classes

class | ViewModelBase

Namespaces

namespace | SDKTemplate::ViewModels
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/pch.cpp File Reference

  • PosPrinter
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/pch.h File Reference

  • PosPrinter
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/SampleConfiguration.cpp File Reference

  • PosPrinter
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "DeviceHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/SampleConfiguration.h File Reference

  • PosPrinter
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.cpp File Reference

  • PosPrinter
  • cpp

Scenario1_FindClaimEnable.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_FindClaimEnable.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.h File Reference

  • PosPrinter
  • cpp
Classes | Namespaces

Scenario1_FindClaimEnable.xaml.h File Reference

#include "Scenario1_FindClaimEnable.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario1_ReceiptPrinter.xaml.cpp File Reference

  • PosPrinter
  • cpp

Scenario1_ReceiptPrinter.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_ReceiptPrinter.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario1_ReceiptPrinter.xaml.h File Reference

  • PosPrinter
  • cpp
Classes | Namespaces

Scenario1_ReceiptPrinter.xaml.h File Reference

#include "Scenario1_ReceiptPrinter.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario2_PrintReceipt.xaml.cpp File Reference

  • PosPrinter
  • cpp

Scenario2_PrintReceipt.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_PrintReceipt.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario2_PrintReceipt.xaml.h File Reference

  • PosPrinter
  • cpp
Classes | Namespaces

Scenario2_PrintReceipt.xaml.h File Reference

#include "Scenario2_PrintReceipt.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario3_MultipleClaims.xaml.cpp File Reference

  • PosPrinter
  • cpp

Scenario3_MultipleClaims.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_MultipleClaims.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario3_MultipleClaims.xaml.h File Reference

  • PosPrinter
  • cpp
Classes | Namespaces

Scenario3_MultipleClaims.xaml.h File Reference

#include "Scenario3_MultipleClaims.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/SampleConfiguration.cs File Reference

  • PosPrinter
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/Scenario1_FindClaimEnable.xaml.cs File Reference

  • PosPrinter
  • cs
Classes | Namespaces

Scenario1_FindClaimEnable.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_FindClaimEnable

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/Scenario2_PrintReceipt.xaml.cs File Reference

  • PosPrinter
  • cs
Classes | Namespaces

Scenario2_PrintReceipt.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_PrintReceipt

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/Scenario3_MultipleClaims.xaml.cs File Reference

  • PosPrinter
  • cs
Classes | Namespaces

Scenario3_MultipleClaims.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_MultipleClaims

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/pch.cpp File Reference

  • PresenceSensor
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/pch.h File Reference

  • PresenceSensor
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.Sensors.h"
#include "winrt/Windows.Globalization.DateTimeFormatting.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Project.idl File Reference

  • PresenceSensor
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_DataEvents
runtimeclass | Scenario2_Polling
runtimeclass | Scenario3_Choosing
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/SampleConfiguration.cpp File Reference

  • PresenceSensor
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/SampleConfiguration.h File Reference

  • PresenceSensor
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt

Functions

hstring | to_hstring (Windows::Devices::Sensors::HumanPresence value)
hstring | to_hstring (Windows::Devices::Sensors::HumanEngagement value)
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario1_DataEvents.cpp File Reference

  • PresenceSensor
  • cppwinrt
Namespaces

Scenario1_DataEvents.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario1_DataEvents.h"
#include "Scenario1_DataEvents.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario1_DataEvents.h File Reference

  • PresenceSensor
  • cppwinrt
Classes | Namespaces

Scenario1_DataEvents.h File Reference

#include "Scenario1_DataEvents.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_DataEvents
struct | Scenario1_DataEvents

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario2_Polling.cpp File Reference

  • PresenceSensor
  • cppwinrt
Namespaces

Scenario2_Polling.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario2_Polling.h"
#include "Scenario2_Polling.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario2_Polling.h File Reference

  • PresenceSensor
  • cppwinrt
Classes | Namespaces

Scenario2_Polling.h File Reference

#include "Scenario2_Polling.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Polling
struct | Scenario2_Polling

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario3_Choosing.cpp File Reference

  • PresenceSensor
  • cppwinrt
Namespaces

Scenario3_Choosing.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario3_Choosing.h"
#include "Scenario3_Choosing.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario3_Choosing.h File Reference

  • PresenceSensor
  • cppwinrt
Classes | Namespaces

Scenario3_Choosing.h File Reference

#include "Scenario3_Choosing.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_Choosing
struct | Scenario3_Choosing

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/SampleConfiguration.cs File Reference

  • PresenceSensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario1_DataEvents.xaml.cs File Reference

  • PresenceSensor
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario2_Polling.xaml.cs File Reference

  • PresenceSensor
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario3_Choosing.xaml.cs File Reference

  • PresenceSensor
  • cs
Classes | Namespaces

Scenario3_Choosing.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Choosing

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/ContinuationPage.xaml.cpp File Reference

  • Printing
  • cpp

ContinuationPage.xaml.cpp File Reference

#include "pch.h"
#include "ContinuationPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/ContinuationPage.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

ContinuationPage.xaml.h File Reference

#include "ContinuationPage.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PageToPrint.xaml.cpp File Reference

  • Printing
  • cpp

PageToPrint.xaml.cpp File Reference

#include "pch.h"
#include "PageToPrint.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PageToPrint.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

PageToPrint.xaml.h File Reference

#include "PageToPrint.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/pch.cpp File Reference

  • Printing
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/pch.h File Reference

  • Printing
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PreviewUnavailable.xaml.cpp File Reference

  • Printing
  • cpp

PreviewUnavailable.xaml.cpp File Reference

#include "pch.h"
#include "PreviewUnavailable.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PreviewUnavailable.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

PreviewUnavailable.xaml.h File Reference

#include "PreviewUnavailable.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PrintHelper.cpp File Reference

  • Printing
  • cpp

PrintHelper.cpp File Reference

#include "pch.h"
#include "PrintHelper.h"
#include "ContinuationPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PrintHelper.h File Reference

  • Printing
  • cpp
Classes | Namespaces

PrintHelper.h File Reference

#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | PrintHelper

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/SampleConfiguration.cpp File Reference

  • Printing
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/SampleConfiguration.h File Reference

  • Printing
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario1Basic.xaml.cpp File Reference

  • Printing
  • cpp

Scenario1Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1Basic.xaml.h"
#include "PageToPrint.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario1Basic.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

Scenario1Basic.xaml.h File Reference

#include "Scenario1Basic.g.h"
#include "PrintHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario2StandardOptions.xaml.cpp File Reference

  • Printing
  • cpp

Scenario2StandardOptions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2StandardOptions.xaml.h"
#include "PageToPrint.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario2StandardOptions.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

Scenario2StandardOptions.xaml.h File Reference

#include "Scenario2StandardOptions.g.h"
#include "PrintHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario3CustomOptions.xaml.cpp File Reference

  • Printing
  • cpp
Functions

Scenario3CustomOptions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3CustomOptions.xaml.h"
#include "PageToPrint.xaml.h"

Go to the source code of this file.

Functions

DisplayContent GetDisplayContent (int option)

Function Documentation

DisplayContent GetDisplayContent ( int option )

Definition at line 41 of file Scenario3CustomOptions.xaml.cpp.

{
    DisplayContent displayContent;
    switch (option)
    {
    case 1:
        displayContent = DisplayContent::Text;
        break;
    case 2:
        displayContent = DisplayContent::Images;
        break;
    default:
        displayContent = DisplayContent::TextAndImages;
        break;
    }

    return displayContent;
}

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario3CustomOptions.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces | Enumerations

Scenario3CustomOptions.xaml.h File Reference

#include "Scenario3CustomOptions.g.h"
#include "PrintHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum | DisplayContent { Text = 1, Images = 2, TextAndImages = 3 }
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario4PageRange.xaml.cpp File Reference

  • Printing
  • cpp

Scenario4PageRange.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4PageRange.xaml.h"
#include "PageToPrint.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario4PageRange.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

Scenario4PageRange.xaml.h File Reference

#include "Scenario4PageRange.g.h"
#include "PrintHelper.h"

Go to the source code of this file.

Classes

class | InvalidPageException
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario5Photos.xaml.cpp File Reference

  • Printing
  • cpp

Scenario5Photos.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5Photos.xaml.h"
#include "PageToPrint.xaml.h"
#include "PreviewUnavailable.xaml.h"
#include <robuffer.h>
#include <wrl\client.h>
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario5Photos.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces | Enumerations

Scenario5Photos.xaml.h File Reference

#include "Scenario5Photos.g.h"
#include "PrintHelper.h"
#include <concrt.h>

Go to the source code of this file.

Classes

class | PageDescription
Printable page description. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum | PhotoSize { SizeFullPage, Size4x6, Size5x7, Size8x10 }
enum | Scaling { ShrinkToFit, Crop }
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario6DisablePreview.xaml.cpp File Reference

  • Printing
  • cpp

Scenario6DisablePreview.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6DisablePreview.xaml.h"
#include "PageToPrint.xaml.h"
#include "ContinuationPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario6DisablePreview.xaml.h File Reference

  • Printing
  • cpp
Classes | Namespaces

Scenario6DisablePreview.xaml.h File Reference

#include "Scenario6DisablePreview.g.h"
#include "PrintHelper.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/ContinuationPage.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

ContinuationPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ContinuationPage
A paged used to flow text from a given text container Usage: Output scenarios 1-4 might not fit entirely on a given "printer page" In that case simply add new continuation pages of the given size until all the content can be displayed. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/PageToPrint.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

PageToPrint.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PageToPrint
Page content to send to the printer. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/PreviewUnavailable.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

PreviewUnavailable.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PreviewUnavailable
Used in scenario 5 to display a custom print preview unavailable page. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/PrintHelper.cs File Reference

  • Printing
  • cs
Classes | Namespaces

PrintHelper.cs File Reference

Go to the source code of this file.

Classes

class | PrintHelper

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/SampleConfiguration.cs File Reference

  • Printing
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario1Basic.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

Scenario1Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1Basic
Scenario that demonstrates how to invoke the Print UI. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario2StandardOptons.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

Scenario2StandardOptons.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2StandardOptions
Scenario that demos how to add customizations in the displayed options list. More...
class | StandardOptionsPrintHelper

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario3CustomOptions.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces | Enumerations

Scenario3CustomOptions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomOptionsPrintHelper
class | Scenario3CustomOptions
Scenario that demos how to add custom options (specific for the application). More...

Namespaces

namespace | PrintSample

Enumerations

enum | DisplayContent { Text = 1, Images = 2, TextAndImages = 3 }
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario4PageRange.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

Scenario4PageRange.xaml.cs File Reference

Go to the source code of this file.

Classes

class | InvalidPageException
class | PageRangePrintHelper
class | Scenario4PageRange
Scenario that demonstrates a page range implementation. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario5Photos.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces | Enumerations

Scenario5Photos.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PageDescription
Printable page description. More...
class | PhotosPrintHelper
class | Scenario5Photos
Photo printing scenario. More...

Namespaces

namespace | PrintSample

Enumerations

enum | PhotoSize { SizeFullPage, Size4x6, Size5x7, Size8x10 }
enum | Scaling { ShrinkToFit, Crop }
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario6DisablePreview.xaml.cs File Reference

  • Printing
  • cs
Classes | Namespaces

Scenario6DisablePreview.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DisablePreviewPrintHelper
This class customizes the standard PrintHelper in order to disable print preview. More...
class | Scenario6DisablePreview
Scenario that demos how to disable the print preview in the Modern Print Dialog window. More...

Namespaces

namespace | PrintSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/App.xaml.cpp File Reference

  • Projection
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/App.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/MainPage.xaml.cpp File Reference

  • Projection
  • cpp

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "App.xaml.h"
#include <collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/MainPage.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces | Enumerations

MainPage.xaml.h File Reference

#include "pch.h"
#include "MainPage.g.h"
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage, StatusMessage, ErrorMessage }
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/pch.cpp File Reference

  • Projection
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/pch.h File Reference

  • Projection
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ProjectionViewPage.xaml.cpp File Reference

  • Projection
  • cpp

ProjectionViewPage.xaml.cpp File Reference

#include "pch.h"
#include "ProjectionViewPage.xaml.h"
#include "MainPage.xaml.h"
#include "ViewLifetimeControl.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ProjectionViewPage.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces

ProjectionViewPage.xaml.h File Reference

#include "ProjectionViewPage.g.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/SampleConfiguration.cpp File Reference

  • Projection
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/SampleConfiguration.h File Reference

  • Projection
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Classes

class | MainPage
struct | Scenario
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario1.xaml.cpp File Reference

  • Projection
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"
#include "MainPage.xaml.h"
#include "ProjectionViewPage.xaml.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario1.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario2.xaml.cpp File Reference

  • Projection
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include "MainPage.xaml.h"
#include "ProjectionViewPage.xaml.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario2.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario3.xaml.cpp File Reference

  • Projection
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"
#include "MainPage.xaml.h"
#include "ProjectionViewPage.xaml.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario3.xaml.h File Reference

  • Projection
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...
class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ViewLifetimeControl.cpp File Reference

  • Projection
  • cpp

ViewLifetimeControl.cpp File Reference

#include "pch.h"
#include "ViewLifetimeControl.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ViewLifetimeControl.h File Reference

  • Projection
  • cpp
Classes | Namespaces | Functions

ViewLifetimeControl.h File Reference

#include <mutex>

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::SecondaryViewsHelpers

Functions

public delegate void | ViewReleasedHandler (Platform::Object^sender, Platform::Object^e)
Generated on Fri Nov 15 2024 22:22:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/App.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/MainPage.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/ProjectionViewPage.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces

ProjectionViewPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ProjectionViewPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/SampleConfiguration.cs File Reference

  • Projection
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/Scenario1.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ProjectionViewPageInitializationData
class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/Scenario2.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/Scenario3.xaml.cs File Reference

  • Projection
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/ViewLifetimeControl.cs File Reference

  • Projection
  • cs
Classes | Namespaces | Functions

ViewLifetimeControl.cs File Reference

Go to the source code of this file.

Classes

class | ViewLifetimeControl

Namespaces

namespace | SecondaryViewsHelpers

Functions

delegate void | ViewReleasedHandler (Object sender, EventArgs e)
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/pch.cpp File Reference

  • ProximitySensor
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/pch.h File Reference

  • ProximitySensor
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/SampleConfiguration.cpp File Reference

  • ProximitySensor
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/SampleConfiguration.h File Reference

  • ProximitySensor
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • ProximitySensor
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario1_DataEvents.xaml.h File Reference

  • ProximitySensor
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario2_Polling.xaml.cpp File Reference

  • ProximitySensor
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario2_Polling.xaml.h File Reference

  • ProximitySensor
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.cpp File Reference

  • ProximitySensor
  • cpp

Scenario3_DisplayOnOff.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_DisplayOnOff.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.h File Reference

  • ProximitySensor
  • cpp
Classes | Namespaces

Scenario3_DisplayOnOff.xaml.h File Reference

#include "pch.h"
#include "Scenario3_DisplayOnOff.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.cpp File Reference

  • ProximitySensor
  • cpp

Scenario4_BackgroundProximitySensor.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_BackgroundProximitySensor.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.h File Reference

  • ProximitySensor
  • cpp
Classes | Namespaces

Scenario4_BackgroundProximitySensor.xaml.h File Reference

#include "pch.h"
#include "Scenario4_BackgroundProximitySensor.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/pch.cpp File Reference

  • ProximitySensor
  • cpp
  • Tasks

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/pch.h File Reference

  • ProximitySensor
  • cpp
  • Tasks

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.cpp File Reference

  • ProximitySensor
  • cpp
  • Tasks

ProximitySensorBackgroundTask.cpp File Reference

#include "pch.h"
#include "ProximitySensorBackgroundTask.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.h File Reference

  • ProximitySensor
  • cpp
  • Tasks
Classes | Namespaces

ProximitySensorBackgroundTask.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/SampleConfiguration.cs File Reference

  • ProximitySensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario1_DataEvents.xaml.cs File Reference

  • ProximitySensor
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | ProximityCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario2_Polling.xaml.cs File Reference

  • ProximitySensor
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | ProximityCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario3_DisplayOnOff.xaml.cs File Reference

  • ProximitySensor
  • cs
Classes | Namespaces

Scenario3_DisplayOnOff.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_DisplayOnOff

Namespaces

namespace | ProximityCS
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario4_BackgroundProximitySensor.xaml.cs File Reference

  • ProximitySensor
  • cs
Classes | Namespaces

Scenario4_BackgroundProximitySensor.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_BackgroundProximitySensor

Namespaces

namespace | ProximityCS
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Tasks/ProximitySensorBackgroundTask.cs File Reference

  • ProximitySensor
  • cs
  • Tasks
Classes | Namespaces

ProximitySensorBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | ProximitySensorBackgroundTask

Namespaces

namespace | Tasks
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Tasks/Properties/AssemblyInfo.cs File Reference

  • ProximitySensor
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/pch.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/pch.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

pch.h File Reference

#include <wrl\event.h>
#include <wrl\implements.h>
#include <wrl\wrappers\corewrappers.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OvenClient.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp
Classes | Namespaces

Scenario1_OvenClient.xaml.h File Reference

#include "Scenario1_OvenClient.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_OvenClientWRL.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp
Classes | Namespaces

Scenario2_OvenClientWRL.xaml.h File Reference

#include "Scenario2_OvenClientWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario3_CustomException.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomException.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp
Classes | Namespaces

Scenario3_CustomException.xaml.h File Reference

#include "Scenario3_CustomException.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_CustomExceptionWRL.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp
Classes | Namespaces

Scenario4_CustomExceptionWRL.xaml.h File Reference

#include "Scenario4_CustomExceptionWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/SampleConfiguration.cs File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/Scenario1_OvenClient.xaml.cs File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cs
Classes | Namespaces

Scenario1_OvenClient.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/Scenario2_CustomException.xaml.cs File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cs
Classes | Namespaces

Scenario2_CustomException.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomException

Namespaces

namespace | ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/BreadServer.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server
Namespaces

BreadServer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | Microsoft
namespace | Microsoft::SDKSamples
namespace | Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/BreadServer.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server
Classes | Namespaces

BreadServer.h File Reference

Go to the source code of this file.

Classes

interface | IBread
class | sealed

Namespaces

namespace | Microsoft
namespace | Microsoft::SDKSamples
namespace | Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/BreadTypes.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server
Classes | Namespaces | Enumerations

BreadTypes.h File Reference

Go to the source code of this file.

Classes

struct | Dimensions

Namespaces

namespace | Microsoft
namespace | Microsoft::SDKSamples
namespace | Microsoft::SDKSamples::Kitchen

Enumerations

enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/OvenServer.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server
Namespaces

OvenServer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | Microsoft
namespace | Microsoft::SDKSamples
namespace | Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/OvenServer.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server
Classes | Namespaces

OvenServer.h File Reference

Go to the source code of this file.

Classes

interface | IAppliance
interface | IOven
class | sealed

Namespaces

namespace | Microsoft
namespace | Microsoft::SDKSamples
namespace | Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/pch.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/pch.h File Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

pch.h File Reference

#include <agile.h>
#include "BreadTypes.h"
#include "BreadServer.h"
#include "OvenServer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/pch.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/pch.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

pch.h File Reference

#include <wrl\event.h>
#include <wrl\implements.h>
#include <wrl\wrappers\corewrappers.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/SampleConfiguration.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario1_OvenClient.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario1_OvenClient.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OvenClient.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario1_OvenClient.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp
Classes | Namespaces

Scenario1_OvenClient.xaml.h File Reference

#include "Scenario1_OvenClient.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario2_OvenClientWRL.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario2_OvenClientWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_OvenClientWRL.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario2_OvenClientWRL.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp
Classes | Namespaces

Scenario2_OvenClientWRL.xaml.h File Reference

#include "Scenario2_OvenClientWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario3_CustomException.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomException.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp
Classes | Namespaces

Scenario3_CustomException.xaml.h File Reference

#include "Scenario3_CustomException.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.cpp File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_CustomExceptionWRL.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.h File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp
Classes | Namespaces

Scenario4_CustomExceptionWRL.xaml.h File Reference

#include "Scenario4_CustomExceptionWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/SampleConfiguration.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/Scenario1_OvenClient.xaml.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cs
Classes | Namespaces

Scenario1_OvenClient.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/Scenario2_CustomException.xaml.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cs
Classes | Namespaces

Scenario2_CustomException.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomException

Namespaces

namespace | ProxyStubsForWinRTComponents
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/BreadServer.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • Server
Classes | Namespaces

BreadServer.cs File Reference

Go to the source code of this file.

Classes

class | Bread
interface | IBread

Namespaces

namespace | Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/OvenServer.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • Server
Classes | Namespaces | Enumerations

OvenServer.cs File Reference

Go to the source code of this file.

Classes

struct | Dimensions
interface | IAppliance
interface | IOven
class | Oven

Namespaces

namespace | Microsoft::SDKSamples::Kitchen

Enumerations

enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/Properties/AssemblyInfo.cs File Reference

  • ProxyStubsForWinRTComponents
  • cs
  • Server
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/pch.cpp File Reference

  • RadialController
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/pch.h File Reference

  • RadialController
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/SampleConfiguration.cpp File Reference

  • RadialController
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/SampleConfiguration.h File Reference

  • RadialController
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.cpp File Reference

  • RadialController
  • cpp

Scenario1_EventAndMenuHookup.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_EventAndMenuHookup.xaml.h"
#include <string>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.h File Reference

  • RadialController
  • cpp
Classes | Namespaces

Scenario1_EventAndMenuHookup.xaml.h File Reference

#include "Scenario1_EventAndMenuHookup.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/SampleConfiguration.cs File Reference

  • RadialController
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/Scenario1_EventAndMenuHookup.xaml.cs File Reference

  • RadialController
  • cs
Classes | Namespaces

Scenario1_EventAndMenuHookup.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_EventAndMenuHookup

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/Scenario2_SystemDefaultMenu.xaml.cs File Reference

  • RadialController
  • cs
Classes | Namespaces

Scenario2_SystemDefaultMenu.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_SystemDefaultMenu

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/pch.cpp File Reference

  • RadioManager
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/pch.h File Reference

  • RadioManager
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Radios.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/Project.idl File Reference

  • RadioManager
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

Boolean | IsRadioOn
runtimeclass | RadioModel
runtimeclass | Scenario1_Toggle
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/RadioModel.cpp File Reference

  • RadioManager
  • cppwinrt
Namespaces

RadioModel.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "RadioModel.h"
#include "RadioModel.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/RadioModel.h File Reference

  • RadioManager
  • cppwinrt
Classes | Namespaces

RadioModel.h File Reference

#include "pch.h"
#include "RadioModel.g.h"

Go to the source code of this file.

Classes

struct | RadioModel

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/SampleConfiguration.cpp File Reference

  • RadioManager
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/SampleConfiguration.h File Reference

  • RadioManager
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/Scenario1_Toggle.cpp File Reference

  • RadioManager
  • cppwinrt
Namespaces

Scenario1_Toggle.cpp File Reference

#include "pch.h"
#include "RadioModel.h"
#include "Scenario1_Toggle.h"
#include "Scenario1_Toggle.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/Scenario1_Toggle.h File Reference

  • RadioManager
  • cppwinrt
Classes | Namespaces

Scenario1_Toggle.h File Reference

#include "Scenario1_Toggle.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Toggle
struct | Scenario1_Toggle

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/RadioModel.cs File Reference

  • RadioManager
  • cs
Classes | Namespaces

RadioModel.cs File Reference

Go to the source code of this file.

Classes

class | RadioModel

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/SampleConfiguration.cs File Reference

  • RadioManager
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/Scenario1_Toggle.xaml.cs File Reference

  • RadioManager
  • cs
Classes | Namespaces

Scenario1_Toggle.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Toggle

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/pch.cpp File Reference

  • RelativeInclinometer
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/pch.h File Reference

  • RelativeInclinometer
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/SampleConfiguration.cpp File Reference

  • RelativeInclinometer
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/SampleConfiguration.h File Reference

  • RelativeInclinometer
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • RelativeInclinometer
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.h File Reference

  • RelativeInclinometer
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario2_Polling.xaml.cpp File Reference

  • RelativeInclinometer
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario2_Polling.xaml.h File Reference

  • RelativeInclinometer
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/SampleConfiguration.cs File Reference

  • RelativeInclinometer
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/Scenario1_DataEvents.xaml.cs File Reference

  • RelativeInclinometer
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | RelativeInclinometerCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/Scenario2_Polling.xaml.cs File Reference

  • RelativeInclinometer
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | RelativeInclinometerCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/BooleanToVisibilityConverter.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

BooleanToVisibilityConverter.cs File Reference

Go to the source code of this file.

Classes

class | BooleanToVisibilityConverter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/SampleConfiguration.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario1_Discovery.xaml.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

Scenario1_Discovery.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Discovery

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario2_LaunchUri.xaml.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

Scenario2_LaunchUri.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_LaunchUri
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario3_LaunchAppServices.xaml.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

Scenario3_LaunchAppServices.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_LaunchAppServices

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario4_Settings.xaml.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

Scenario4_Settings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Settings

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario5_Capabilities.xaml.cs File Reference

  • RemoteSystems
  • cs
Classes | Namespaces

Scenario5_Capabilities.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_Capabilities
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/pch.cpp File Reference

  • ResizeAppView
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/pch.h File Reference

  • ResizeAppView
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/SampleConfiguration.cpp File Reference

  • ResizeAppView
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/SampleConfiguration.h File Reference

  • ResizeAppView
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/Scenario1_Basic.xaml.cpp File Reference

  • ResizeAppView
  • cpp
Classes

Scenario1_Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.xaml.h"

Go to the source code of this file.

Classes

interface | IUIContentRootClone
class | MockUIContentRoot
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/Scenario1_Basic.xaml.h File Reference

  • ResizeAppView
  • cpp
Classes | Namespaces

Scenario1_Basic.xaml.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/Scenario2_Launch.xaml.cpp File Reference

  • ResizeAppView
  • cpp

Scenario2_Launch.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Launch.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/Scenario2_Launch.xaml.h File Reference

  • ResizeAppView
  • cpp
Classes | Namespaces

Scenario2_Launch.xaml.h File Reference

#include "Scenario2_Launch.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/pch.cpp File Reference

  • ResizeAppView
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/pch.h File Reference

  • ResizeAppView
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Project.idl File Reference

  • ResizeAppView
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/SampleConfiguration.cpp File Reference

  • ResizeAppView
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/SampleConfiguration.h File Reference

  • ResizeAppView
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario1_Basic.cpp File Reference

  • ResizeAppView
  • cppwinrt
Namespaces

Scenario1_Basic.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.h"
#include "Scenario1_Basic.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario1_Basic.h File Reference

  • ResizeAppView
  • cppwinrt
Classes | Namespaces

Scenario1_Basic.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Basic
struct | Scenario1_Basic

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario2_Launch.cpp File Reference

  • ResizeAppView
  • cppwinrt
Namespaces

Scenario2_Launch.cpp File Reference

#include "pch.h"
#include "Scenario2_Launch.h"
#include "Scenario2_Launch.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario2_Launch.h File Reference

  • ResizeAppView
  • cppwinrt
Classes | Namespaces

Scenario2_Launch.h File Reference

#include "Scenario2_Launch.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Launch
struct | Scenario2_Launch

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/SampleConfiguration.cs File Reference

  • ResizeAppView
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/Scenario1_Basic.xaml.cs File Reference

  • ResizeAppView
  • cs
Classes | Namespaces

Scenario1_Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basic

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/Scenario2_Launch.xaml.cs File Reference

  • ResizeAppView
  • cs
Classes | Namespaces

Scenario2_Launch.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Launch

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/pch.cpp File Reference

  • SecondaryTiles
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/pch.h File Reference

  • SecondaryTiles
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Data.Xml.Dom.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Notifications.h"
#include "winrt/Windows.UI.StartScreen.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/NotificationsExtensions.h"
#include "winrt/NotificationsExtensions.Badges.h"
#include "winrt/NotificationsExtensions.Tiles.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Project.idl File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_PinTile
runtimeclass | Scenario2_UnpinTile
runtimeclass | Scenario3_EnumerateTiles
runtimeclass | Scenario4_TilePinned
runtimeclass | Scenario5_LaunchedFromSecondaryTile
runtimeclass | Scenario6_SecondaryTileNotification
runtimeclass | Scenario7_PinFromAppbar
runtimeclass | Scenario8_UpdateAsync
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/SampleConfiguration.cpp File Reference

  • SecondaryTiles
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include <ctime>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/SampleConfiguration.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | SampleHelpers

Namespaces

namespace | winrt::SDKTemplate

Functions

void | App_LaunchCompleted (Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario1_PinTile.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario1_PinTile.cpp File Reference

#include "pch.h"
#include "Scenario1_PinTile.h"
#include "Scenario1_PinTile.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario1_PinTile.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario1_PinTile.h File Reference

#include "Scenario1_PinTile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_PinTile
struct | Scenario1_PinTile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario2_UnpinTile.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario2_UnpinTile.cpp File Reference

#include "pch.h"
#include "Scenario2_UnpinTile.h"
#include "Scenario2_UnpinTile.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario2_UnpinTile.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario2_UnpinTile.h File Reference

#include "Scenario2_UnpinTile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_UnpinTile
struct | Scenario2_UnpinTile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario3_EnumerateTiles.cpp File Reference

#include "pch.h"
#include "Scenario3_EnumerateTiles.h"
#include "Scenario3_EnumerateTiles.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario3_EnumerateTiles.h File Reference

#include "Scenario3_EnumerateTiles.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_EnumerateTiles
struct | Scenario3_EnumerateTiles

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario4_TilePinned.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario4_TilePinned.cpp File Reference

#include "pch.h"
#include "Scenario4_TilePinned.h"
#include "Scenario4_TilePinned.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario4_TilePinned.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario4_TilePinned.h File Reference

#include "Scenario4_TilePinned.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_TilePinned
struct | Scenario4_TilePinned

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario5_LaunchedFromSecondaryTile.cpp File Reference

#include "pch.h"
#include "Scenario5_LaunchedFromSecondaryTile.h"
#include "Scenario5_LaunchedFromSecondaryTile.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario5_LaunchedFromSecondaryTile.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario5_LaunchedFromSecondaryTile.h File Reference

#include "Scenario5_LaunchedFromSecondaryTile.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario5_LaunchedFromSecondaryTile
struct | Scenario5_LaunchedFromSecondaryTile

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario6_SecondaryTileNotification.cpp File Reference

#include "pch.h"
#include "Scenario6_SecondaryTileNotification.h"
#include "Scenario6_SecondaryTileNotification.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario6_SecondaryTileNotification.h File Reference

#include "Scenario6_SecondaryTileNotification.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario6_SecondaryTileNotification
struct | Scenario6_SecondaryTileNotification

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario7_PinFromAppbar.cpp File Reference

#include "pch.h"
#include "Scenario7_PinFromAppbar.h"
#include "Scenario7_PinFromAppbar.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario7_PinFromAppbar.h File Reference

#include "Scenario7_PinFromAppbar.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario7_PinFromAppbar
struct | Scenario7_PinFromAppbar

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.cpp File Reference

  • SecondaryTiles
  • cppwinrt
Namespaces

Scenario8_UpdateAsync.cpp File Reference

#include "pch.h"
#include "Scenario8_UpdateAsync.h"
#include "Scenario8_UpdateAsync.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.h File Reference

  • SecondaryTiles
  • cppwinrt
Classes | Namespaces

Scenario8_UpdateAsync.h File Reference

#include "Scenario8_UpdateAsync.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario8_UpdateAsync
struct | Scenario8_UpdateAsync

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/SampleConfiguration.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario1_PinTile.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario1_PinTile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_PinTile

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario2_UnpinTile.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario2_UnpinTile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_UnpinTile

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario3_EnumerateTiles.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario3_EnumerateTiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_EnumerateTiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario4_TilePinned.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario4_TilePinned.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_TilePinned

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario5_LaunchedFromSecondaryTile.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario5_LaunchedFromSecondaryTile.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_LaunchedFromSecondaryTile

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario6_SecondaryTileNotification.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario6_SecondaryTileNotification.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_SecondaryTileNotification

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario7_PinFromAppbar.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario7_PinFromAppbar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_PinFromAppbar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario8_UpdateAsync.xaml.cs File Reference

  • SecondaryTiles
  • cs
Classes | Namespaces

Scenario8_UpdateAsync.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_UpdateAsync

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/Find.xaml.cpp File Reference

  • SemanticTextQuery
  • cpp

Find.xaml.cpp File Reference

#include "pch.h"
#include <ppltasks.h>
#include "Find.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/Find.xaml.h File Reference

  • SemanticTextQuery
  • cpp
Classes | Namespaces

Find.xaml.h File Reference

#include "Find.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/FindInProperty.xaml.cpp File Reference

  • SemanticTextQuery
  • cpp

FindInProperty.xaml.cpp File Reference

#include "pch.h"
#include <ppltasks.h>
#include "FindInProperty.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/FindInProperty.xaml.h File Reference

  • SemanticTextQuery
  • cpp
Classes | Namespaces

FindInProperty.xaml.h File Reference

#include "FindInProperty.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.cpp File Reference

  • SemanticTextQuery
  • cpp

GetMatchingPropertiesWithRanges.xaml.cpp File Reference

#include "pch.h"
#include <ppltasks.h>
#include "GetMatchingPropertiesWithRanges.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.h File Reference

  • SemanticTextQuery
  • cpp
Classes | Namespaces

GetMatchingPropertiesWithRanges.xaml.h File Reference

#include "GetMatchingPropertiesWithRanges.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/pch.cpp File Reference

  • SemanticTextQuery
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/pch.h File Reference

  • SemanticTextQuery
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/SampleConfiguration.cpp File Reference

  • SemanticTextQuery
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/SampleConfiguration.h File Reference

  • SemanticTextQuery
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate

Functions

void | HighlightRanges (Windows::UI::Xaml::Controls::TextBlock^tb, Platform::String^strText, Windows::Foundation::Collections::IVectorView< Windows::Data::Text::TextSegment >^ranges)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/Find.xaml.cs File Reference

  • SemanticTextQuery
  • cs
Classes | Namespaces

Find.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/FindInProperty.xaml.cs File Reference

  • SemanticTextQuery
  • cs
Classes | Namespaces

FindInProperty.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/GetMatchingPropertiesWithRanges.xaml.cs File Reference

  • SemanticTextQuery
  • cs
Classes | Namespaces

GetMatchingPropertiesWithRanges.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/SampleConfiguration.cs File Reference

  • SemanticTextQuery
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/Constants.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

Constants.cs File Reference

Go to the source code of this file.

Classes

class | ArduinoDevice
class | DeviceProperties

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/DeviceListEntry.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

DeviceListEntry.cs File Reference

Go to the source code of this file.

Classes

class | DeviceListEntry
The class will only expose properties from DeviceInformation that are going to be used in this sample. More...

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/EventHandlerForDevice.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

EventHandlerForDevice.cs File Reference

Go to the source code of this file.

Classes

class | EventHandlerForDevice
The purpose of this class is to demonstrate the expected application behavior for app events such as suspension and resume or when the device is disconnected. More...

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:22:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/SampleConfiguration.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/Scenario1_ConnectDisconnect.xaml.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

Scenario1_ConnectDisconnect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ConnectDisconnect
Demonstrates how to connect to a Serial Device and respond to device disconnects, app suspending and resuming events. More...

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/Scenario2_LEDTemp.xaml.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

Scenario2_LEDTemp.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_LEDTemp
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/Utilities.cs File Reference

  • SerialArduino
  • cs
Classes | Namespaces

Utilities.cs File Reference

Go to the source code of this file.

Classes

class | Utilities
This class is intended to host any functionality that will be shared among different scenario/pages such as common error messages. More...

Namespaces

namespace | SerialArduino
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/pch.cpp File Reference

  • ShareSource
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/pch.h File Reference

  • ShareSource
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SampleConfiguration.cpp File Reference

  • ShareSource
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SharePage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SampleConfiguration.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SetErrorMessage.xaml.cpp File Reference

  • ShareSource
  • cpp

SetErrorMessage.xaml.cpp File Reference

#include "pch.h"
#include "SharePage.h"
#include "SetErrorMessage.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SetErrorMessage.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

SetErrorMessage.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "SetErrorMessage.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareApplicationLink.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareApplicationLink.xaml.cpp File Reference

#include "pch.h"
#include "ShareApplicationLink.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareApplicationLink.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareApplicationLink.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareApplicationLink.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomData.xaml.cpp File Reference

  • ShareSource
  • cpp
Variables

ShareCustomData.xaml.cpp File Reference

#include "pch.h"
#include "ShareCustomData.xaml.h"

Go to the source code of this file.

Variables

json

Variable Documentation

json

Definition at line 43 of file ShareCustomData.xaml.cpp.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomData.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareCustomData.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareCustomData.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomProvider.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareCustomProvider.xaml.cpp File Reference

#include "pch.h"
#include "ShareCustomProvider.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomProvider.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareCustomProvider.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareCustomProvider.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareDelayRenderedFiles.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareDelayRenderedFiles.xaml.cpp File Reference

#include "pch.h"
#include "ShareDelayRenderedFiles.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareDelayRenderedFiles.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareDelayRenderedFiles.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareDelayRenderedFiles.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareFiles.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareFiles.xaml.cpp File Reference

#include "pch.h"
#include "ShareFiles.xaml.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareFiles.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareFiles.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareFiles.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareHtml.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareHtml.xaml.cpp File Reference

#include "pch.h"
#include "ShareHtml.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareHtml.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareHtml.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareHtml.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareImage.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareImage.xaml.cpp File Reference

#include "pch.h"
#include "ShareImage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareImage.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareImage.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareImage.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SharePage.cpp File Reference

  • ShareSource
  • cpp

SharePage.cpp File Reference

#include "pch.h"
#include "SharePage.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SharePage.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

SharePage.h File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | SharePage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareText.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareText.xaml.cpp File Reference

#include "pch.h"
#include "ShareText.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareText.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareText.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareText.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareWebLink.xaml.cpp File Reference

  • ShareSource
  • cpp

ShareWebLink.xaml.cpp File Reference

#include "pch.h"
#include "ShareWebLink.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareWebLink.xaml.h File Reference

  • ShareSource
  • cpp
Classes | Namespaces

ShareWebLink.xaml.h File Reference

#include "pch.h"
#include "SharePage.h"
#include "ShareWebLink.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/SampleConfiguration.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/SetErrorMessage.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

SetErrorMessage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SetErrorMessage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareApplicationLink.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareApplicationLink.xaml.cs File Reference

Go to the source code of this file.

Classes

class | NegatingBoolConverter
A value converter which negates a bool. More...
class | ShareApplicationLink

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareCustomData.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareCustomData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareCustomData

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareCustomProvider.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareCustomProvider.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareCustomProvider

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareDelayRenderedFiles.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareDelayRenderedFiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareDelayRenderedFiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareFiles.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareFiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareFiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareHtml.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareHtml.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareHtml

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareImage.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareImage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareImage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/SharePage.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

SharePage.cs File Reference

Go to the source code of this file.

Classes

class | SharePage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareText.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareWebLink.xaml.cs File Reference

  • ShareSource
  • cs
Classes | Namespaces

ShareWebLink.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareWebLink

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/cs/SampleConfiguration.cs File Reference

  • ShareTarget
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/cs/Scenario1_Welcome.xaml.cs File Reference

  • ShareTarget
  • cs
Classes | Namespaces

Scenario1_Welcome.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Welcome

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/cs/ShareTarget.xaml.cs File Reference

  • ShareTarget
  • cs
Classes | Namespaces

ShareTarget.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ShareTarget

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/App.cpp File Reference

  • Simple3DGameDX
  • cpp
Functions

App.cpp File Reference

#include "pch.h"
#include "App.h"

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 32 of file App.cpp.

{
    auto directXApplicationSource = ref new DirectXApplicationSource();
    CoreApplication::Run(directXApplicationSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/App.h File Reference

  • Simple3DGameDX
  • cpp
Classes | Namespaces

App.h File Reference

#include "DeviceResources.h"
#include "GameMain.h"
#include "GameMain.h"

Go to the source code of this file.

Classes

class | DirectXApplicationSource
class | sealed

Namespaces

namespace | Simple3DGameDX
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameHud.cpp File Reference

  • Simple3DGameDX
  • cpp

GameHud.cpp File Reference

#include "pch.h"
#include "GameHud.h"
#include "GameConstants.h"
#include "GameUIConstants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameHud.h File Reference

  • Simple3DGameDX
  • cpp
Classes

GameHud.h File Reference

#include "Simple3DGame.h"
#include "DirectXSample.h"
#include "Simple3DGame.h"

Go to the source code of this file.

Classes

class GameHud
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameInfoOverlay.cpp File Reference

  • Simple3DGameDX
  • cpp

GameInfoOverlay.cpp File Reference

#include "pch.h"
#include "GameUIConstants.h"
#include "DeviceResources.h"
#include "DirectXSample.h"
#include "GameInfoOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameInfoOverlay.h File Reference

  • Simple3DGameDX
  • cpp
Classes

GameInfoOverlay.h File Reference

#include "GameUIControl.h"
#include "GameUIControl.h"

Go to the source code of this file.

Classes

class GameInfoOverlay
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameMain.cpp File Reference

  • Simple3DGameDX
  • cpp

GameMain.cpp File Reference

#include "pch.h"
#include "MoveLookController.h"
#include "GameMain.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameMain.h File Reference

  • Simple3DGameDX
  • cpp
Classes | Namespaces | Enumerations

GameMain.h File Reference

#include "DeviceResources.h"
#include "MoveLookController.h"
#include "GameRenderer.h"
#include "Simple3DGame.h"
#include "GameUIControl.h"
#include "GameRenderer.h"

Go to the source code of this file.

Classes

class | GameMain

Namespaces

namespace | GameControl

Enumerations

enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameRenderer.cpp File Reference

  • Simple3DGameDX
  • cpp

GameRenderer.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "ConstantBuffers.h"
#include "TargetTexture.h"
#include "BasicLoader.h"
#include "CylinderMesh.h"
#include "FaceMesh.h"
#include "SphereMesh.h"
#include "WorldMesh.h"
#include "Face.h"
#include "Sphere.h"
#include "Cylinder.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameRenderer.h File Reference

  • Simple3DGameDX
  • cpp
Classes

GameRenderer.h File Reference

#include "DeviceResources.h"
#include "GameUIConstants.h"
#include "GameInfoOverlay.h"
#include "GameHud.h"
#include "Simple3DGame.h"
#include "GameUIConstants.h"
#include "GameInfoOverlay.h"
#include "GameHud.h"

Go to the source code of this file.

Classes

class GameRenderer
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameUIConstants.h File Reference

  • Simple3DGameDX
  • cpp
Namespaces

GameUIConstants.h File Reference

Go to the source code of this file.

Namespaces

namespace | GameConstants
namespace | GameInfoOverlayConstant
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameUIControl.h File Reference

  • Simple3DGameDX
  • cpp
Classes | Namespaces | Enumerations

GameUIControl.h File Reference

Go to the source code of this file.

Classes

interface | IGameUIControl

Namespaces

namespace | Simple3DGameDX

Enumerations

enum GameInfoOverlayCommand {
None, TapToContinue, PleaseWait, PlayAgain,
None, TapToContinue, PleaseWait, PlayAgain
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Simple3DGame.cpp File Reference

  • Simple3DGameDX
  • cpp

Simple3DGame.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "Level1.h"
#include "Level2.h"
#include "Level3.h"
#include "Level4.h"
#include "Level5.h"
#include "Level6.h"
#include "Animate.h"
#include "Sphere.h"
#include "Cylinder.h"
#include "Face.h"
#include "MediaReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Simple3DGame.h File Reference

  • Simple3DGameDX
  • cpp
Classes | Typedefs | Enumerations

Simple3DGame.h File Reference

#include "GameConstants.h"
#include "Audio.h"
#include "Camera.h"
#include "Level.h"
#include "GameObject.h"
#include "GameTimer.h"
#include "MoveLookController.h"
#include "PersistentState.h"
#include "Sphere.h"
#include "GameRenderer.h"

Go to the source code of this file.

Classes

struct | HighScoreEntry
class | Simple3DGame

Typedefs

typedef std::vector
< HighScoreEntry > 		HighScoreEntries

Enumerations

enum GameState {
Waiting, Active, LevelComplete, TimeExpired,
GameComplete, Waiting, Active, LevelComplete,
TimeExpired, GameComplete, Waiting, Active,
LevelComplete, TimeExpired, GameComplete
}

Typedef Documentation

typedef std::vector<HighScoreEntry> HighScoreEntries

Definition at line 62 of file Simple3DGame.h.

Enumeration Type Documentation

enum GameState
Enumerator:
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete

Definition at line 45 of file Simple3DGame.h.

{
    Waiting,
    Active,
    LevelComplete,
    TimeExpired,
    GameComplete,
};

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicLoader.cpp File Reference

  • Simple3DGameDX
  • cpp
  • Common

BasicLoader.cpp File Reference

#include "pch.h"
#include "BasicLoader.h"
#include "BasicShapes.h"
#include "DDSTextureLoader.h"
#include "DirectXSample.h"
#include <memory>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicLoader.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes

BasicLoader.h File Reference

#include "BasicReaderWriter.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Classes

class BasicLoader
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicMath.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes | Defines | Typedefs | Functions

BasicMath.h File Reference

#include <math.h>

Go to the source code of this file.

Classes

struct | Matrix4x4< T >
struct | Vector2< T >
struct | Vector3< T >
struct | Vector4< T >

Defines

#define | _USE_MATH_DEFINES
#define | PI_F 3.1415927f

Typedefs

typedef Vector2< float > | float2
typedef Vector3< float > | float3
typedef Vector4< float > | float4
typedef Matrix4x4< float > | float4x4
typedef unsigned int | uint

Functions

template<class T >
Vector3< T > | cross (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector2< T > a, Vector2< T > b)
template<class T >
T | dot (Vector4< T > a, Vector4< T > b)
float4x4 identity ()
template<class T >
T | length (Vector2< T > a)
template<class T >
T | length (Vector3< T > a)
template<class T >
T | length (Vector4< T > a)
template<class T >
Matrix4x4< T > | mul (Matrix4x4< T > m1, Matrix4x4< T > m2)
template<class T >
Vector2< T > | normalize (Vector2< T > a)
template<class T >
Vector3< T > | normalize (Vector3< T > a)
template<class T >
Vector4< T > | normalize (Vector4< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, T s)
template<class T >
Vector2< T > | operator* (T s, Vector2< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator* (Vector3< T > a, T s)
template<class T >
Vector3< T > | operator* (T s, Vector3< T > a)
template<class T >
Vector3< T > | operator* (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator* (Vector4< T > a, T s)
template<class T >
Vector4< T > | operator* (T s, Vector4< T > a)
template<class T >
Vector4< T > | operator* (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator+ (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator+ (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator+ (Vector4< T > a, Vector4< T > b)
template<class T >
Vector4< T > | operator- (Vector4< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a)
template<class T >
Vector4< T > | operator- (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a, Vector2< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a, Vector3< T > b)
template<class T >
Vector3< T > | operator/ (Vector3< T > a, T s)
template<class T >
Vector4< T > | operator/ (Vector4< T > a, T s)
template<class T >
Vector2< T > | operator/ (Vector2< T > a, T s)
float4x4 | rotationArbitrary (float3 axis, float degree)
float4x4 | rotationX (float degreeX)
float4x4 | rotationY (float degreeY)
float4x4 | rotationZ (float degreeZ)
float4x4 | scale (float x, float y, float z)
float4x4 | translation (float x, float y, float z)
template<class T >
Matrix4x4< T > | transpose (Matrix4x4< T > m)

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 10 of file BasicMath.h.

#define PI_F 3.1415927f

Definition at line 18 of file BasicMath.h.

Typedef Documentation

typedef Vector2<float> float2

Definition at line 389 of file BasicMath.h.

typedef Vector3<float> float3

Definition at line 390 of file BasicMath.h.

typedef Vector4<float> float4

Definition at line 391 of file BasicMath.h.

typedef Matrix4x4<float> float4x4

Definition at line 393 of file BasicMath.h.

typedef unsigned int uint

Definition at line 387 of file BasicMath.h.

Function Documentation

Vector3<T> cross | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 197 of file BasicMath.h.

{
    return Vector3<T>((a.y*b.z)-(a.z*b.y), (a.z*b.x)-(a.x*b.z), (a.x*b.y)-(a.y*b.x));
}

T dot | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 167 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z;
}

T dot | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 161 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y;
}

T dot | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 173 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z + a.w + b.w;
}

float4x4 identity ( ) [inline]

Definition at line 397 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

T length ( Vector2< T > a )

Definition at line 179 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y);
}

T length ( Vector3< T > a )

Definition at line 185 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
}

T length ( Vector4< T > a )

Definition at line 191 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y + a.z * a.z + a.w * a.w);
}

Matrix4x4<T> mul | ( | Matrix4x4< T > | m1,
 |  | Matrix4x4< T > | m2
 | ) |  |

Definition at line 367 of file BasicMath.h.

{
    Matrix4x4<T> mOut;

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 4; k++)
            {
                mOut[i][j] += m1[i][k] * m2[k][j];
            }
        }
    }

    return mOut;
}

Vector2<T> normalize ( Vector2< T > a )

Definition at line 203 of file BasicMath.h.

{
    T len = length(a);
    return Vector2<T>(a.x / len, a.y / len);
}

Vector3<T> normalize ( Vector3< T > a )

Definition at line 210 of file BasicMath.h.

{
    T len = length(a);
    return Vector3<T>(a.x / len, a.y / len, a.z / len);
}

Vector4<T> normalize ( Vector4< T > a )

Definition at line 217 of file BasicMath.h.

{
    T len = length(a);
    return Vector4<T>(a.x / len, a.y / len, a.z / len, a.w / len);
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 280 of file BasicMath.h.

{
    return Vector2<T>(a.x * s, a.y * s);
}

Vector2<T> operator* | ( | T | s,
 |  | Vector2< T > | a
 | ) |  |

Definition at line 286 of file BasicMath.h.

{
    return a * s;
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 292 of file BasicMath.h.

{
    return Vector2<T>(a.x * b.x, a.y * b.y);
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 304 of file BasicMath.h.

{
    return Vector3<T>(a.x * s, a.y * s, a.z * s);
}

Vector3<T> operator* | ( | T | s,
 |  | Vector3< T > | a
 | ) |  |

Definition at line 310 of file BasicMath.h.

{
    return a * s;
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 316 of file BasicMath.h.

{
    return Vector3<T>(a.x * b.x, a.y * b.y, a.z * b.z);
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 328 of file BasicMath.h.

{
    return Vector4<T>(a.x * s, a.y * s, a.z * s, a.w * s);
}

Vector4<T> operator* | ( | T | s,
 |  | Vector4< T > | a
 | ) |  |

Definition at line 334 of file BasicMath.h.

{
    return a * s;
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 340 of file BasicMath.h.

{
    return Vector4<T>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
}

Vector2<T> operator+ | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 262 of file BasicMath.h.

{
    return Vector2<T>(a.x + b.x, a.y + b.y);
}

Vector3<T> operator+ | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 268 of file BasicMath.h.

{
    return Vector3<T>(a.x + b.x, a.y + b.y, a.z + b.z);
}

Vector4<T> operator+ | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 274 of file BasicMath.h.

{
    return Vector4<T>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
}

Vector4<T> operator- ( Vector4< T > a )

Definition at line 256 of file BasicMath.h.

{
    return Vector4<T>(-a.x, -a.y, -a.z, -a.w);
}

Vector3<T> operator- ( Vector3< T > a )

Definition at line 244 of file BasicMath.h.

{
    return Vector3<T>(-a.x, -a.y, -a.z);
}

Vector4<T> operator- | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 250 of file BasicMath.h.

{
    return Vector4<T>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
}

Vector2<T> operator- | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 226 of file BasicMath.h.

{
    return Vector2<T>(a.x - b.x, a.y - b.y);
}

Vector2<T> operator- ( Vector2< T > a )

Definition at line 232 of file BasicMath.h.

{
    return Vector2<T>(-a.x, -a.y);
}

Vector3<T> operator- | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 238 of file BasicMath.h.

{
    return Vector3<T>(a.x - b.x, a.y - b.y, a.z - b.z);
}

Vector3<T> operator/ | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 322 of file BasicMath.h.

{
    return Vector3<T>(a.x / s, a.y / s, a.z / s);
}

Vector4<T> operator/ | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 346 of file BasicMath.h.

{
    return Vector4<T>(a.x / s, a.y / s, a.z / s, a.w / s);
}

Vector2<T> operator/ | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 298 of file BasicMath.h.

{
    return Vector2<T>(a.x / s, a.y / s);
}

float4x4 rotationArbitrary | ( | float3 | axis,
 |  | float | degree |
 | ) |  |  | [inline]

Definition at line 485 of file BasicMath.h.

{
    axis = normalize(axis);

    float angleInRadians = degree * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);
    float oneMinusCosAngle = 1 - cosAngle;

    float4x4 mOut;

    mOut._11 = 1.0f + oneMinusCosAngle * (axis.x * axis.x - 1.0f);
    mOut._12 = axis.z * sinAngle + oneMinusCosAngle * axis.x * axis.y;
    mOut._13 = -axis.y * sinAngle + oneMinusCosAngle * axis.x * axis.z;
    mOut._41 = 0.0f;

    mOut._21 = -axis.z * sinAngle + oneMinusCosAngle * axis.y * axis.x;
    mOut._22 = 1.0f + oneMinusCosAngle * (axis.y * axis.y - 1.0f);
    mOut._23 = axis.x * sinAngle + oneMinusCosAngle * axis.y * axis.z;
    mOut._24 = 0.0f;

    mOut._31 = axis.y * sinAngle + oneMinusCosAngle * axis.z * axis.x;
    mOut._32 = -axis.x * sinAngle + oneMinusCosAngle * axis.z * axis.y;
    mOut._33 = 1.0f + oneMinusCosAngle * (axis.z * axis.z - 1.0f);
    mOut._34 = 0.0f;

    mOut._41 = 0.0f;
    mOut._42 = 0.0f;
    mOut._43 = 0.0f;
    mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationX ( float degreeX ) [inline]

Definition at line 433 of file BasicMath.h.

{
    float angleInRadians = degreeX * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f;     mOut._13 = 0.0f;      mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = cosAngle; mOut._23 = -sinAngle; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = sinAngle; mOut._33 = cosAngle;  mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f;     mOut._43 = 0.0f;      mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationY ( float degreeY ) [inline]

Definition at line 450 of file BasicMath.h.

{
    float angleInRadians = degreeY * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = cosAngle;  mOut._12 = 0.0f; mOut._13 = sinAngle; mOut._14 = 0.0f;
    mOut._21 = 0.0f;      mOut._22 = 1.0f; mOut._23 = 0.0f;     mOut._24 = 0.0f;
    mOut._31 = -sinAngle; mOut._32 = 0.0f; mOut._33 = cosAngle; mOut._34 = 0.0f;
    mOut._41 = 0.0f;      mOut._42 = 0.0f; mOut._43 = 0.0f;     mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationZ ( float degreeZ ) [inline]

Definition at line 467 of file BasicMath.h.

{
    float angleInRadians = degreeZ * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = cosAngle; mOut._12 = -sinAngle; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = sinAngle; mOut._22 = cosAngle;  mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f;     mOut._32 = 0.0f;      mOut._33 = 1.0f; mOut._34 = 0.0f;
    mOut._41 = 0.0f;     mOut._42 = 0.0f;      mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

float4x4 scale | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 421 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = x;    mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = y;    mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = z;    mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

float4x4 translation | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 409 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = x;
    mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = y;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = z;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

Matrix4x4<T> transpose ( Matrix4x4< T > m )

Definition at line 356 of file BasicMath.h.

{
    return Matrix4x4<T>(
        m._11, m._21, m._31, m._41,
        m_.12, m._22, m._32, m._42,
        m._13, m._23, m._33, m._43,
        m._14, m._24, m._34, m._44
        );
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicReaderWriter.cpp File Reference

  • Simple3DGameDX
  • cpp
  • Common

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicReaderWriter.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicShapes.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes

BasicShapes.h File Reference

#include "BasicMath.h"
#include "BasicMath.h"

Go to the source code of this file.

Classes

class | BasicShapes
struct | BasicVertex
struct | TangentVertex
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes | Defines | Enumerations | Functions

DDSTextureLoader.cpp File Reference

#include "pch.h"
#include <dxgiformat.h>
#include <assert.h>
#include <memory>
#include <algorithm>
#include "DDSTextureLoader.h"
#include "DirectXSample.h"

Go to the source code of this file.

Classes

struct | DDS_HEADER
struct | DDS_HEADER_DXT10
struct | DDS_PIXELFORMAT

Defines

#define | DDS_ALPHA 0x00000002
#define | DDS_CUBEMAP 0x00000200
#define | DDS_CUBEMAP_ALLFACES
#define | DDS_CUBEMAP_NEGATIVEX 0x00000a00
#define | DDS_CUBEMAP_NEGATIVEY 0x00002200
#define | DDS_CUBEMAP_NEGATIVEZ 0x00008200
#define | DDS_CUBEMAP_POSITIVEX 0x00000600
#define | DDS_CUBEMAP_POSITIVEY 0x00001200
#define | DDS_CUBEMAP_POSITIVEZ 0x00004200
#define | DDS_FLAGS_VOLUME 0x00200000
#define | DDS_FOURCC 0x00000004
#define | DDS_HEADER_FLAGS_LINEARSIZE 0x00080000
#define | DDS_HEADER_FLAGS_MIPMAP 0x00020000
#define | DDS_HEADER_FLAGS_PITCH 0x00000008
#define | DDS_HEADER_FLAGS_TEXTURE 0x00001007
#define | DDS_HEADER_FLAGS_VOLUME 0x00800000
#define | DDS_HEIGHT 0x00000002
#define | DDS_LUMINANCE 0x00020000
#define | DDS_LUMINANCEA 0x00020001
#define | DDS_MAGIC 0x20534444
#define | DDS_PAL8 0x00000020
#define | DDS_RGB 0x00000040
#define | DDS_RGBA 0x00000041
#define | DDS_SURFACE_FLAGS_CUBEMAP 0x00000008
#define | DDS_SURFACE_FLAGS_MIPMAP 0x00400008
#define | DDS_SURFACE_FLAGS_TEXTURE 0x00001000
#define | DDS_WIDTH 0x00000004
#define | ISBITMASK(r, g, b, a) (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)
#define | MAKEFOURCC(ch0, ch1, ch2, ch3)

Enumerations

enum DDS_ALPHA_MODE {
DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2,
DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1,
DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4
}
enum | DDS_MISC_FLAGS2 { DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L }

Functions

_Use_decl_annotations_ void | CreateDDSTextureFromMemory (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, size_t maxsize, D2D1_ALPHA_MODE *alphaMode)
_Use_decl_annotations_ void | CreateDDSTextureFromMemoryEx (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, size_t maxsize, D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, D2D1_ALPHA_MODE *alphaMode)

Define Documentation

#define DDS_ALPHA 0x00000002

Definition at line 66 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP 0x00000200

Definition at line 93 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_ALLFACES
Value:
(DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
                              DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
                              DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ)

Definition at line 89 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEX 0x00000a00

Definition at line 83 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEY 0x00002200

Definition at line 85 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEZ 0x00008200

Definition at line 87 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEX 0x00000600

Definition at line 82 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEY 0x00001200

Definition at line 84 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEZ 0x00004200

Definition at line 86 of file DDSTextureLoader.cpp.

#define DDS_FLAGS_VOLUME 0x00200000

Definition at line 95 of file DDSTextureLoader.cpp.

#define DDS_FOURCC 0x00000004

Definition at line 61 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_LINEARSIZE 0x00080000

Definition at line 73 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_MIPMAP 0x00020000

Definition at line 70 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_PITCH 0x00000008

Definition at line 72 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_TEXTURE 0x00001007

Definition at line 69 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_VOLUME 0x00800000

Definition at line 71 of file DDSTextureLoader.cpp.

#define DDS_HEIGHT 0x00000002

Definition at line 75 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCE 0x00020000

Definition at line 64 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCEA 0x00020001

Definition at line 65 of file DDSTextureLoader.cpp.

#define DDS_MAGIC 0x20534444

Definition at line 47 of file DDSTextureLoader.cpp.

#define DDS_PAL8 0x00000020

Definition at line 67 of file DDSTextureLoader.cpp.

#define DDS_RGB 0x00000040

Definition at line 62 of file DDSTextureLoader.cpp.

#define DDS_RGBA 0x00000041

Definition at line 63 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008

Definition at line 80 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_MIPMAP 0x00400008

Definition at line 79 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_TEXTURE 0x00001000

Definition at line 78 of file DDSTextureLoader.cpp.

#define DDS_WIDTH 0x00000004

Definition at line 76 of file DDSTextureLoader.cpp.

#define ISBITMASK | ( | r,
 |  | g,
 |  | b,
 |  | a |
 | ) |  | (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)

Definition at line 371 of file DDSTextureLoader.cpp.

#define MAKEFOURCC | ( | ch0,
 |  | ch1,
 |  | ch2,
 |  | ch3
 | ) |
Value:
((uint32)(byte)(ch0) | ((uint32)(byte)(ch1) << 8) |       \
                ((uint32)(byte)(ch2) << 16) | ((uint32)(byte)(ch3) << 24))

Definition at line 35 of file DDSTextureLoader.cpp.

Enumeration Type Documentation

enum DDS_ALPHA_MODE
Enumerator:
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM

Definition at line 102 of file DDSTextureLoader.cpp.

{
    DDS_ALPHA_MODE_UNKNOWN       = 0,
    DDS_ALPHA_MODE_STRAIGHT      = 1,
    DDS_ALPHA_MODE_PREMULTIPLIED = 2,
    DDS_ALPHA_MODE_OPAQUE        = 3,
    DDS_ALPHA_MODE_CUSTOM        = 4,
};

enum DDS_MISC_FLAGS2
Enumerator:
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK

Definition at line 97 of file DDSTextureLoader.cpp.

{
    DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};

Function Documentation

_Use_decl_annotations_ void CreateDDSTextureFromMemory | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | size_t | maxsize,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1192 of file DDSTextureLoader.cpp.

{
    return CreateDDSTextureFromMemoryEx(d3dDevice, ddsData, ddsDataSize, maxsize, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false, texture, textureView, alphaMode);
}

_Use_decl_annotations_ void CreateDDSTextureFromMemoryEx | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | size_t | maxsize,
 |  | D3D11_USAGE | usage,
 |  | unsigned int | bindFlags,
 |  | unsigned int | cpuAccessFlags,
 |  | unsigned int | miscFlags,
 |  | bool | forceSRGB,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1208 of file DDSTextureLoader.cpp.

{
    if (texture)
    {
        *texture = nullptr;
    }
    if (textureView)
    {
        *textureView = nullptr;
    }
    if (alphaMode)
    {
        *alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
    }

    if (!d3dDevice || !ddsData || (!texture && !textureView))
    {
        throw ref new Platform::InvalidArgumentException();
    }

    // Validate DDS file in memory
    if (ddsDataSize < (sizeof(uint32) + sizeof(DDS_HEADER)))
    {
        throw ref new Platform::FailureException();
    }

    uint32 dwMagicNumber = *(const uint32*)(ddsData);
    if (dwMagicNumber != DDS_MAGIC)
    {
        throw ref new Platform::FailureException();
    }

    auto header = reinterpret_cast<const DDS_HEADER*>(ddsData + sizeof(uint32));

    // Verify header to validate DDS file
    if (header->size != sizeof(DDS_HEADER) ||
        header->ddspf.size != sizeof(DDS_PIXELFORMAT))
    {
        throw ref new Platform::FailureException();
    }

    // Check for DX10 extension
    bool bDXT10Header = false;
    if ((header->ddspf.flags & DDS_FOURCC) &&
        (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC))
    {
        // Must be long enough for both headers and magic value
        if (ddsDataSize < (sizeof(DDS_HEADER) + sizeof(uint32) + sizeof(DDS_HEADER_DXT10)))
        {
            throw ref new Platform::FailureException();
        }

        bDXT10Header = true;
    }

    ptrdiff_t offset = sizeof(uint32) + sizeof(DDS_HEADER) + (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0);

    CreateTextureFromDDS(d3dDevice, header, ddsData + offset, ddsDataSize - offset, maxsize, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, texture, textureView);

    if (alphaMode)
        *alphaMode = GetAlphaMode(header);
}

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DDSTextureLoader.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Functions

DDSTextureLoader.h File Reference

Go to the source code of this file.

Functions

void | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const byte *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)
void | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)

Function Documentation

void CreateDDSTextureFromMemory | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const byte * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
void CreateDDSTextureFromMemoryEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DeviceResources.cpp File Reference

  • Simple3DGameDX
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXSample.h"

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DeviceResources.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DirectXSample.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Namespaces | Functions

DirectXSample.h File Reference

#include <math.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/PersistentState.cpp File Reference

  • Simple3DGameDX
  • cpp
  • Common

PersistentState.cpp File Reference

#include "pch.h"
#include "PersistentState.h"
#include "DirectXSample.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/PersistentState.h File Reference

  • Simple3DGameDX
  • cpp
  • Common
Classes

PersistentState.h File Reference

Go to the source code of this file.

Classes

class PersistentState
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/App.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
Classes | Functions

App.cpp File Reference

#include "pch.h"
#include "GameMain.h"

Go to the source code of this file.

Classes

struct | App

Functions

int __stdcall | wWinMain (HINSTANCE, HINSTANCE, PWSTR, int)

Function Documentation

int __stdcall wWinMain | ( | HINSTANCE | ,
 |  | HINSTANCE | ,
 |  | PWSTR | ,
 |  | int |
 | ) |  |

Definition at line 170 of file App.cpp.

{
    CoreApplication::Run(winrt::make<App>());
}

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameHud.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

GameHud.cpp File Reference

#include "pch.h"
#include "GameHud.h"
#include "GameConstants.h"
#include "GameUIConstants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameHud.h File Reference

  • Simple3DGameDX
  • cppwinrt
Classes

GameHud.h File Reference

#include "DeviceResources.h"
#include "Simple3DGame.h"
#include "Simple3DGame.h"

Go to the source code of this file.

Classes

class GameHud
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameInfoOverlay.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

GameInfoOverlay.cpp File Reference

#include "pch.h"
#include "GameUIConstants.h"
#include "DeviceResources.h"
#include "GameInfoOverlay.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameInfoOverlay.h File Reference

  • Simple3DGameDX
  • cppwinrt
Classes

GameInfoOverlay.h File Reference

#include "GameUIControl.h"
#include "GameUIControl.h"

Go to the source code of this file.

Classes

class GameInfoOverlay
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameMain.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

GameMain.cpp File Reference

#include "pch.h"
#include "GameMain.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameMain.h File Reference

  • Simple3DGameDX
  • cppwinrt
Classes | Namespaces | Enumerations

GameMain.h File Reference

#include "GameRenderer.h"
#include "GameRenderer.h"

Go to the source code of this file.

Classes

class | GameMain

Namespaces

namespace | GameControl

Enumerations

enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameRenderer.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

GameRenderer.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "TargetTexture.h"
#include "BasicLoader.h"
#include "CylinderMesh.h"
#include "FaceMesh.h"
#include "SphereMesh.h"
#include "WorldMesh.h"
#include "Face.h"
#include "Cylinder.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameRenderer.h File Reference

  • Simple3DGameDX
  • cppwinrt
Classes

GameRenderer.h File Reference

#include "GameHud.h"
#include "GameInfoOverlay.h"
#include "GameUIConstants.h"
#include "GameHud.h"
#include "GameUIConstants.h"

Go to the source code of this file.

Classes

class GameRenderer
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameUIConstants.h File Reference

  • Simple3DGameDX
  • cppwinrt
Namespaces

GameUIConstants.h File Reference

Go to the source code of this file.

Namespaces

namespace | GameInfoOverlayConstant
namespace | GameUIConstants
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameUIControl.h File Reference

  • Simple3DGameDX
  • cppwinrt
Namespaces | Enumerations

GameUIControl.h File Reference

Go to the source code of this file.

Namespaces

namespace Simple3DGameDX

Enumerations

enum GameInfoOverlayCommand {
None, TapToContinue, PleaseWait, PlayAgain,
None, TapToContinue, PleaseWait, PlayAgain
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/pch.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/pch.h File Reference

  • Simple3DGameDX
  • cppwinrt

pch.h File Reference

#include <unknwn.h>
#include <winrt/Windows.ApplicationModel.Core.h>
#include <winrt/Windows.Devices.Input.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Gaming.Input.h>
#include <winrt/Windows.Graphics.Display.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.System.Threading.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Input.h>
#include <d3d11_3.h>
#include <d2d1_3.h>
#include <dwrite_3.h>
#include <wincodec.h>
#include <xaudio2.h>
#include <mfidl.h>
#include <mfapi.h>
#include <mfreadwrite.h>
#include <iterator>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Simple3DGame.cpp File Reference

  • Simple3DGameDX
  • cppwinrt

Simple3DGame.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "Level1.h"
#include "Level2.h"
#include "Level3.h"
#include "Level4.h"
#include "Level5.h"
#include "Level6.h"
#include "Cylinder.h"
#include "Face.h"
#include "MediaReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Simple3DGame.h File Reference

  • Simple3DGameDX
  • cppwinrt
Classes | Enumerations

Simple3DGame.h File Reference

#include "GameConstants.h"
#include "Audio.h"
#include "Camera.h"
#include "Level.h"
#include "GameTimer.h"
#include "Sphere.h"
#include "MoveLookController.h"

Go to the source code of this file.

Classes

struct | HighScoreEntry
class | Simple3DGame

Enumerations

enum GameState {
Waiting, Active, LevelComplete, TimeExpired,
GameComplete, Waiting, Active, LevelComplete,
TimeExpired, GameComplete, Waiting, Active,
LevelComplete, TimeExpired, GameComplete
}

Enumeration Type Documentation

enum GameState
Enumerator:
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete

Definition at line 40 of file Simple3DGame.h.

{
    Waiting,
    Active,
    LevelComplete,
    TimeExpired,
    GameComplete,
};

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicLoader.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common

BasicLoader.cpp File Reference

#include "pch.h"
#include "BasicLoader.h"
#include "BasicShapes.h"
#include "DDSTextureLoader.h"
#include <cwctype>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicLoader.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes

BasicLoader.h File Reference

#include "BasicReaderWriter.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Classes

class BasicLoader
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicMath.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes | Defines | Typedefs | Functions

BasicMath.h File Reference

#include <math.h>

Go to the source code of this file.

Classes

struct | Matrix4x4< T >
struct | Vector2< T >
struct | Vector3< T >
struct | Vector4< T >

Defines

#define | _USE_MATH_DEFINES
#define | PI_F 3.1415927f

Typedefs

typedef Vector2< float > | float2
typedef Vector3< float > | float3
typedef Vector4< float > | float4
typedef Matrix4x4< float > | float4x4
typedef unsigned int | uint

Functions

template<class T >
Vector3< T > | cross (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector2< T > a, Vector2< T > b)
template<class T >
T | dot (Vector4< T > a, Vector4< T > b)
float4x4 identity ()
template<class T >
T | length (Vector2< T > a)
template<class T >
T | length (Vector3< T > a)
template<class T >
T | length (Vector4< T > a)
template<class T >
Matrix4x4< T > | mul (Matrix4x4< T > m1, Matrix4x4< T > m2)
template<class T >
Vector2< T > | normalize (Vector2< T > a)
template<class T >
Vector3< T > | normalize (Vector3< T > a)
template<class T >
Vector4< T > | normalize (Vector4< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, T s)
template<class T >
Vector2< T > | operator* (T s, Vector2< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator* (Vector3< T > a, T s)
template<class T >
Vector3< T > | operator* (T s, Vector3< T > a)
template<class T >
Vector3< T > | operator* (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator* (Vector4< T > a, T s)
template<class T >
Vector4< T > | operator* (T s, Vector4< T > a)
template<class T >
Vector4< T > | operator* (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator+ (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator+ (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator+ (Vector4< T > a, Vector4< T > b)
template<class T >
Vector4< T > | operator- (Vector4< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a)
template<class T >
Vector4< T > | operator- (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a, Vector2< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a, Vector3< T > b)
template<class T >
Vector3< T > | operator/ (Vector3< T > a, T s)
template<class T >
Vector4< T > | operator/ (Vector4< T > a, T s)
template<class T >
Vector2< T > | operator/ (Vector2< T > a, T s)
float4x4 | rotationArbitrary (float3 axis, float degree)
float4x4 | rotationX (float degreeX)
float4x4 | rotationY (float degreeY)
float4x4 | rotationZ (float degreeZ)
float4x4 | scale (float x, float y, float z)
float4x4 | translation (float x, float y, float z)
template<class T >
Matrix4x4< T > | transpose (Matrix4x4< T > m)

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 10 of file BasicMath.h.

#define PI_F 3.1415927f

Definition at line 18 of file BasicMath.h.

Typedef Documentation

typedef Vector2<float> float2

Definition at line 389 of file BasicMath.h.

typedef Vector3<float> float3

Definition at line 390 of file BasicMath.h.

typedef Vector4<float> float4

Definition at line 391 of file BasicMath.h.

typedef Matrix4x4<float> float4x4

Definition at line 393 of file BasicMath.h.

typedef unsigned int uint

Definition at line 387 of file BasicMath.h.

Function Documentation

Vector3<T> cross | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 197 of file BasicMath.h.

{
    return Vector3<T>((a.y * b.z) - (a.z * b.y), (a.z * b.x) - (a.x * b.z), (a.x * b.y) - (a.y * b.x));
}

T dot | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 167 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z;
}

T dot | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 161 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y;
}

T dot | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 173 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z + a.w + b.w;
}

float4x4 identity ( ) [inline]

Definition at line 397 of file BasicMath.h.

{
    float4x4 mOut;

    mOut.onebased._11 = 1.0f; mOut.onebased._12 = 0.0f; mOut.onebased._13 = 0.0f; mOut.onebased._14 = 0.0f;
    mOut.onebased._21 = 0.0f; mOut.onebased._22 = 1.0f; mOut.onebased._23 = 0.0f; mOut.onebased._24 = 0.0f;
    mOut.onebased._31 = 0.0f; mOut.onebased._32 = 0.0f; mOut.onebased._33 = 1.0f; mOut.onebased._34 = 0.0f;
    mOut.onebased._41 = 0.0f; mOut.onebased._42 = 0.0f; mOut.onebased._43 = 0.0f; mOut.onebased._44 = 1.0f;

    return mOut;
}

T length ( Vector2< T > a )

Definition at line 179 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y);
}

T length ( Vector3< T > a )

Definition at line 185 of file BasicMath.h.

{
    return sqrt(a.coord.x * a.coord.x + a.coord.y * a.coord.y + a.coord.z * a.coord.z);
}

T length ( Vector4< T > a )

Definition at line 191 of file BasicMath.h.

{
    return sqrt(a.coord.x * a.coord.x + a.coord.y * a.coord.y + a.coord.z * a.coord.z + a.coord.w * a.coord.w);
}

Matrix4x4<T> mul | ( | Matrix4x4< T > | m1,
 |  | Matrix4x4< T > | m2
 | ) |  |

Definition at line 367 of file BasicMath.h.

{
    Matrix4x4<T> mOut;

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 4; k++)
            {
                mOut[i][j] += m1[i][k] * m2[k][j];
            }
        }
    }

    return mOut;
}

Vector2<T> normalize ( Vector2< T > a )

Definition at line 203 of file BasicMath.h.

{
    T len = length(a);
    return Vector2<T>(a.x / len, a.y / len);
}

Vector3<T> normalize ( Vector3< T > a )

Definition at line 210 of file BasicMath.h.

{
    T len = length(a);
    return Vector3<T>(a.coord.x / len, a.coord.y / len, a.coord.z / len);
}

Vector4<T> normalize ( Vector4< T > a )

Definition at line 217 of file BasicMath.h.

{
    T len = length(a);
    return Vector4<T>(a.coord.x / len, a.coord.y / len, a.coord.z / len, a.coord.w / len);
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 280 of file BasicMath.h.

{
    return Vector2<T>(a.x * s, a.y * s);
}

Vector2<T> operator* | ( | T | s,
 |  | Vector2< T > | a
 | ) |  |

Definition at line 286 of file BasicMath.h.

{
    return a * s;
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 292 of file BasicMath.h.

{
    return Vector2<T>(a.x * b.x, a.y * b.y);
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 304 of file BasicMath.h.

{
    return Vector3<T>(a.x * s, a.y * s, a.z * s);
}

Vector3<T> operator* | ( | T | s,
 |  | Vector3< T > | a
 | ) |  |

Definition at line 310 of file BasicMath.h.

{
    return a * s;
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 316 of file BasicMath.h.

{
    return Vector3<T>(a.x * b.x, a.y * b.y, a.z * b.z);
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 328 of file BasicMath.h.

{
    return Vector4<T>(a.x * s, a.y * s, a.z * s, a.w * s);
}

Vector4<T> operator* | ( | T | s,
 |  | Vector4< T > | a
 | ) |  |

Definition at line 334 of file BasicMath.h.

{
    return a * s;
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 340 of file BasicMath.h.

{
    return Vector4<T>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
}

Vector2<T> operator+ | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 262 of file BasicMath.h.

{
    return Vector2<T>(a.x + b.x, a.y + b.y);
}

Vector3<T> operator+ | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 268 of file BasicMath.h.

{
    return Vector3<T>(a.x + b.x, a.y + b.y, a.z + b.z);
}

Vector4<T> operator+ | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 274 of file BasicMath.h.

{
    return Vector4<T>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
}

Vector4<T> operator- ( Vector4< T > a )

Definition at line 256 of file BasicMath.h.

{
    return Vector4<T>(-a.x, -a.y, -a.z, -a.w);
}

Vector3<T> operator- ( Vector3< T > a )

Definition at line 244 of file BasicMath.h.

{
    return Vector3<T>(-a.x, -a.y, -a.z);
}

Vector4<T> operator- | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 250 of file BasicMath.h.

{
    return Vector4<T>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
}

Vector2<T> operator- | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 226 of file BasicMath.h.

{
    return Vector2<T>(a.x - b.x, a.y - b.y);
}

Vector2<T> operator- ( Vector2< T > a )

Definition at line 232 of file BasicMath.h.

{
    return Vector2<T>(-a.x, -a.y);
}

Vector3<T> operator- | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 238 of file BasicMath.h.

{
    return Vector3<T>(a.x - b.x, a.y - b.y, a.z - b.z);
}

Vector3<T> operator/ | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 322 of file BasicMath.h.

{
    return Vector3<T>(a.x / s, a.y / s, a.z / s);
}

Vector4<T> operator/ | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 346 of file BasicMath.h.

{
    return Vector4<T>(a.x / s, a.y / s, a.z / s, a.w / s);
}

Vector2<T> operator/ | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 298 of file BasicMath.h.

{
    return Vector2<T>(a.x / s, a.y / s);
}

float4x4 rotationArbitrary | ( | float3 | axis,
 |  | float | degree |
 | ) |  |  | [inline]

Definition at line 485 of file BasicMath.h.

{
    axis = normalize(axis);

    float angleInRadians = degree * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);
    float oneMinusCosAngle = 1 - cosAngle;

    float4x4 mOut;

    mOut.onebased._11 = 1.0f + oneMinusCosAngle * (axis.coord.x * axis.coord.x - 1.0f);
    mOut.onebased._12 = axis.coord.z * sinAngle + oneMinusCosAngle * axis.coord.x * axis.coord.y;
    mOut.onebased._13 = -axis.coord.y * sinAngle + oneMinusCosAngle * axis.coord.x * axis.coord.z;
    mOut.onebased._41 = 0.0f;

    mOut.onebased._21 = -axis.coord.z * sinAngle + oneMinusCosAngle * axis.coord.y * axis.coord.x;
    mOut.onebased._22 = 1.0f + oneMinusCosAngle * (axis.coord.y * axis.coord.y - 1.0f);
    mOut.onebased._23 = axis.coord.x * sinAngle + oneMinusCosAngle * axis.coord.y * axis.coord.z;
    mOut.onebased._24 = 0.0f;

    mOut.onebased._31 = axis.coord.y * sinAngle + oneMinusCosAngle * axis.coord.z * axis.coord.x;
    mOut.onebased._32 = -axis.coord.x * sinAngle + oneMinusCosAngle * axis.coord.z * axis.coord.y;
    mOut.onebased._33 = 1.0f + oneMinusCosAngle * (axis.coord.z * axis.coord.z - 1.0f);
    mOut.onebased._34 = 0.0f;

    mOut.onebased._41 = 0.0f;
    mOut.onebased._42 = 0.0f;
    mOut.onebased._43 = 0.0f;
    mOut.onebased._44 = 1.0f;

    return mOut;
}

float4x4 rotationX ( float degreeX ) [inline]

Definition at line 433 of file BasicMath.h.

{
    float angleInRadians = degreeX * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut.onebased._11 = 1.0f; mOut.onebased._12 = 0.0f;     mOut.onebased._13 = 0.0f;      mOut.onebased._14 = 0.0f;
    mOut.onebased._21 = 0.0f; mOut.onebased._22 = cosAngle; mOut.onebased._23 = -sinAngle; mOut.onebased._24 = 0.0f;
    mOut.onebased._31 = 0.0f; mOut.onebased._32 = sinAngle; mOut.onebased._33 = cosAngle;  mOut.onebased._34 = 0.0f;
    mOut.onebased._41 = 0.0f; mOut.onebased._42 = 0.0f;     mOut.onebased._43 = 0.0f;      mOut.onebased._44 = 1.0f;

    return mOut;
}

float4x4 rotationY ( float degreeY ) [inline]

Definition at line 450 of file BasicMath.h.

{
    float angleInRadians = degreeY * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut.onebased._11 = cosAngle;  mOut.onebased._12 = 0.0f; mOut.onebased._13 = sinAngle; mOut.onebased._14 = 0.0f;
    mOut.onebased._21 = 0.0f;      mOut.onebased._22 = 1.0f; mOut.onebased._23 = 0.0f;     mOut.onebased._24 = 0.0f;
    mOut.onebased._31 = -sinAngle; mOut.onebased._32 = 0.0f; mOut.onebased._33 = cosAngle; mOut.onebased._34 = 0.0f;
    mOut.onebased._41 = 0.0f;      mOut.onebased._42 = 0.0f; mOut.onebased._43 = 0.0f;     mOut.onebased._44 = 1.0f;

    return mOut;
}

float4x4 rotationZ ( float degreeZ ) [inline]

Definition at line 467 of file BasicMath.h.

{
    float angleInRadians = degreeZ * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut.onebased._11 = cosAngle; mOut.onebased._12 = -sinAngle; mOut.onebased._13 = 0.0f; mOut.onebased._14 = 0.0f;
    mOut.onebased._21 = sinAngle; mOut.onebased._22 = cosAngle;  mOut.onebased._23 = 0.0f; mOut.onebased._24 = 0.0f;
    mOut.onebased._31 = 0.0f;     mOut.onebased._32 = 0.0f;      mOut.onebased._33 = 1.0f; mOut.onebased._34 = 0.0f;
    mOut.onebased._41 = 0.0f;     mOut.onebased._42 = 0.0f;      mOut.onebased._43 = 0.0f; mOut.onebased._44 = 1.0f;

    return mOut;
}

float4x4 scale | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 421 of file BasicMath.h.

{
    float4x4 mOut;

    mOut.onebased._11 = x;    mOut.onebased._12 = 0.0f; mOut.onebased._13 = 0.0f; mOut.onebased._14 = 0.0f;
    mOut.onebased._21 = 0.0f; mOut.onebased._22 = y;    mOut.onebased._23 = 0.0f; mOut.onebased._24 = 0.0f;
    mOut.onebased._31 = 0.0f; mOut.onebased._32 = 0.0f; mOut.onebased._33 = z;    mOut.onebased._34 = 0.0f;
    mOut.onebased._41 = 0.0f; mOut.onebased._42 = 0.0f; mOut.onebased._43 = 0.0f; mOut.onebased._44 = 1.0f;

    return mOut;
}

float4x4 translation | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 409 of file BasicMath.h.

{
    float4x4 mOut;

    mOut.onebased._11 = 1.0f; mOut.onebased._12 = 0.0f; mOut.onebased._13 = 0.0f; mOut.onebased._14 = x;
    mOut.onebased._21 = 0.0f; mOut.onebased._22 = 1.0f; mOut.onebased._23 = 0.0f; mOut.onebased._24 = y;
    mOut.onebased._31 = 0.0f; mOut.onebased._32 = 0.0f; mOut.onebased._33 = 1.0f; mOut.onebased._34 = z;
    mOut.onebased._41 = 0.0f; mOut.onebased._42 = 0.0f; mOut.onebased._43 = 0.0f; mOut.onebased._44 = 1.0f;

    return mOut;
}

Matrix4x4<T> transpose ( Matrix4x4< T > m )

Definition at line 356 of file BasicMath.h.

{
    return Matrix4x4<T>(
        m._11, m._21, m._31, m._41,
        m_.12, m._22, m._32, m._42,
        m._13, m._23, m._33, m._43,
        m._14, m._24, m._34, m._44
        );
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicReaderWriter.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes

BasicReaderWriter.h File Reference

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicShapes.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes

BasicShapes.h File Reference

#include "BasicMath.h"
#include "BasicMath.h"

Go to the source code of this file.

Classes

class | BasicShapes
struct | BasicVertex
struct | TangentVertex
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes | Defines | Enumerations | Functions

DDSTextureLoader.cpp File Reference

#include "pch.h"
#include <dxgiformat.h>
#include <assert.h>
#include <memory>
#include <algorithm>
#include "DDSTextureLoader.h"
#include "DirectXSample.h"

Go to the source code of this file.

Classes

struct | DDS_HEADER
struct | DDS_HEADER_DXT10
struct | DDS_PIXELFORMAT

Defines

#define | DDS_ALPHA 0x00000002
#define | DDS_CUBEMAP 0x00000200
#define | DDS_CUBEMAP_ALLFACES
#define | DDS_CUBEMAP_NEGATIVEX 0x00000a00
#define | DDS_CUBEMAP_NEGATIVEY 0x00002200
#define | DDS_CUBEMAP_NEGATIVEZ 0x00008200
#define | DDS_CUBEMAP_POSITIVEX 0x00000600
#define | DDS_CUBEMAP_POSITIVEY 0x00001200
#define | DDS_CUBEMAP_POSITIVEZ 0x00004200
#define | DDS_FLAGS_VOLUME 0x00200000
#define | DDS_FOURCC 0x00000004
#define | DDS_HEADER_FLAGS_LINEARSIZE 0x00080000
#define | DDS_HEADER_FLAGS_MIPMAP 0x00020000
#define | DDS_HEADER_FLAGS_PITCH 0x00000008
#define | DDS_HEADER_FLAGS_TEXTURE 0x00001007
#define | DDS_HEADER_FLAGS_VOLUME 0x00800000
#define | DDS_HEIGHT 0x00000002
#define | DDS_LUMINANCE 0x00020000
#define | DDS_LUMINANCEA 0x00020001
#define | DDS_MAGIC 0x20534444
#define | DDS_PAL8 0x00000020
#define | DDS_RGB 0x00000040
#define | DDS_RGBA 0x00000041
#define | DDS_SURFACE_FLAGS_CUBEMAP 0x00000008
#define | DDS_SURFACE_FLAGS_MIPMAP 0x00400008
#define | DDS_SURFACE_FLAGS_TEXTURE 0x00001000
#define | DDS_WIDTH 0x00000004
#define | ISBITMASK(r, g, b, a) (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)
#define | MAKEFOURCC(ch0, ch1, ch2, ch3)

Enumerations

enum DDS_ALPHA_MODE {
DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2,
DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1,
DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4
}
enum | DDS_MISC_FLAGS2 { DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L }

Functions

_Use_decl_annotations_ void | CreateDDSTextureFromMemory (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, size_t maxsize, D2D1_ALPHA_MODE *alphaMode)
_Use_decl_annotations_ void | CreateDDSTextureFromMemoryEx (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, size_t maxsize, D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, D2D1_ALPHA_MODE *alphaMode)

Define Documentation

#define DDS_ALPHA 0x00000002

Definition at line 64 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP 0x00000200

Definition at line 91 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_ALLFACES
Value:
(DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
                              DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
                              DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ)

Definition at line 87 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEX 0x00000a00

Definition at line 81 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEY 0x00002200

Definition at line 83 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEZ 0x00008200

Definition at line 85 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEX 0x00000600

Definition at line 80 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEY 0x00001200

Definition at line 82 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEZ 0x00004200

Definition at line 84 of file DDSTextureLoader.cpp.

#define DDS_FLAGS_VOLUME 0x00200000

Definition at line 93 of file DDSTextureLoader.cpp.

#define DDS_FOURCC 0x00000004

Definition at line 59 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_LINEARSIZE 0x00080000

Definition at line 71 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_MIPMAP 0x00020000

Definition at line 68 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_PITCH 0x00000008

Definition at line 70 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_TEXTURE 0x00001007

Definition at line 67 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_VOLUME 0x00800000

Definition at line 69 of file DDSTextureLoader.cpp.

#define DDS_HEIGHT 0x00000002

Definition at line 73 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCE 0x00020000

Definition at line 62 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCEA 0x00020001

Definition at line 63 of file DDSTextureLoader.cpp.

#define DDS_MAGIC 0x20534444

Definition at line 45 of file DDSTextureLoader.cpp.

#define DDS_PAL8 0x00000020

Definition at line 65 of file DDSTextureLoader.cpp.

#define DDS_RGB 0x00000040

Definition at line 60 of file DDSTextureLoader.cpp.

#define DDS_RGBA 0x00000041

Definition at line 61 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008

Definition at line 78 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_MIPMAP 0x00400008

Definition at line 77 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_TEXTURE 0x00001000

Definition at line 76 of file DDSTextureLoader.cpp.

#define DDS_WIDTH 0x00000004

Definition at line 74 of file DDSTextureLoader.cpp.

#define ISBITMASK | ( | r,
 |  | g,
 |  | b,
 |  | a |
 | ) |  | (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)

Definition at line 367 of file DDSTextureLoader.cpp.

#define MAKEFOURCC | ( | ch0,
 |  | ch1,
 |  | ch2,
 |  | ch3
 | ) |
Value:
((uint32_t)(byte)(ch0) | ((uint32_t)(byte)(ch1) << 8) |       \
                ((uint32_t)(byte)(ch2) << 16) | ((uint32_t)(byte)(ch3) << 24))

Definition at line 33 of file DDSTextureLoader.cpp.

Enumeration Type Documentation

enum DDS_ALPHA_MODE
Enumerator:
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM

Definition at line 100 of file DDSTextureLoader.cpp.

{
    DDS_ALPHA_MODE_UNKNOWN = 0,
    DDS_ALPHA_MODE_STRAIGHT = 1,
    DDS_ALPHA_MODE_PREMULTIPLIED = 2,
    DDS_ALPHA_MODE_OPAQUE = 3,
    DDS_ALPHA_MODE_CUSTOM = 4,
};

enum DDS_MISC_FLAGS2
Enumerator:
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK

Definition at line 95 of file DDSTextureLoader.cpp.

{
    DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};

Function Documentation

_Use_decl_annotations_ void CreateDDSTextureFromMemory | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | size_t | maxsize,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1177 of file DDSTextureLoader.cpp.

{
    return CreateDDSTextureFromMemoryEx(d3dDevice, ddsData, ddsDataSize, maxsize, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false, texture, textureView, alphaMode);
}

_Use_decl_annotations_ void CreateDDSTextureFromMemoryEx | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | size_t | maxsize,
 |  | D3D11_USAGE | usage,
 |  | unsigned int | bindFlags,
 |  | unsigned int | cpuAccessFlags,
 |  | unsigned int | miscFlags,
 |  | bool | forceSRGB,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1191 of file DDSTextureLoader.cpp.

{
    if (texture)
    {
        *texture = nullptr;
    }
    if (textureView)
    {
        *textureView = nullptr;
    }
    if (alphaMode)
    {
        *alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
    }

    if (!d3dDevice || !ddsData || (!texture && !textureView))
    {
        winrt::throw_hresult(E_INVALIDARG);
    }

    // Validate DDS file in memory
    if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
    {
        winrt::throw_hresult(E_FAIL);
    }

    uint32_t dwMagicNumber = *(const uint32_t*)(ddsData);
    if (dwMagicNumber != DDS_MAGIC)
    {
        winrt::throw_hresult(E_FAIL);
    }

    auto header = reinterpret_cast<const DDS_HEADER*>(ddsData + sizeof(uint32_t));

    // Verify header to validate DDS file
    if (header->size != sizeof(DDS_HEADER) ||
        header->ddspf.size != sizeof(DDS_PIXELFORMAT))
    {
        winrt::throw_hresult(E_FAIL);
    }

    // Check for DX10 extension
    bool bDXT10Header = false;
    if ((header->ddspf.flags & DDS_FOURCC) &&
        (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC))
    {
        // Must be long enough for both headers and magic value
        if (ddsDataSize < (sizeof(DDS_HEADER) + sizeof(uint32_t) + sizeof(DDS_HEADER_DXT10)))
        {
            winrt::throw_hresult(E_FAIL);
        }

        bDXT10Header = true;
    }

    ptrdiff_t offset = sizeof(uint32_t) + sizeof(DDS_HEADER) + (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0);

    CreateTextureFromDDS(d3dDevice, header, ddsData + offset, ddsDataSize - offset, maxsize, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, texture, textureView);

    if (alphaMode)
        *alphaMode = GetAlphaMode(header);
}

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DDSTextureLoader.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Functions

DDSTextureLoader.h File Reference

Go to the source code of this file.

Functions

void | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const byte *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)
void | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)

Function Documentation

void CreateDDSTextureFromMemory | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const byte * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
void CreateDDSTextureFromMemoryEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DeviceResources.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXSample.h"

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DeviceResources.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DirectXSample.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Namespaces | Functions

DirectXSample.h File Reference

#include <math.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/PersistentState.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common

PersistentState.cpp File Reference

#include "pch.h"
#include "PersistentState.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/PersistentState.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • Common
Classes

PersistentState.h File Reference

Go to the source code of this file.

Classes

class PersistentState
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Animate.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Animate.cpp File Reference

#include "pch.h"
#include "Animate.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Animate.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Animate.h File Reference

Go to the source code of this file.

Classes

class | Animate
class | AnimateCirclePosition
class | AnimateLineListPosition
class | AnimateLinePosition
struct | LineSegment
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Audio.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Audio.cpp File Reference

#include "pch.h"
#include "Audio.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Audio.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Audio.h File Reference

Go to the source code of this file.

Classes

class Audio
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Camera.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Camera.cpp File Reference

#include "pch.h"
#include "Camera.h"
#include "StereoProjection.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Camera.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Camera.h File Reference

Go to the source code of this file.

Classes

class Camera
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

ConstantBuffers.h File Reference

Go to the source code of this file.

Classes

struct | ConstantBufferChangeOnResize
struct | ConstantBufferChangesEveryFrame
struct | ConstantBufferChangesEveryPrim
struct | ConstantBufferNeverChanges
struct | PNTVertex
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Cylinder.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Cylinder.cpp File Reference

#include "pch.h"
#include "Cylinder.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Cylinder.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Cylinder.h File Reference

#include "GameObject.h"

Go to the source code of this file.

Classes

class Cylinder
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

CylinderMesh.cpp File Reference

#include "pch.h"
#include "CylinderMesh.h"
#include "ConstantBuffers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

CylinderMesh.h File Reference

#include "MeshObject.h"

Go to the source code of this file.

Classes

class CylinderMesh
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Face.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Face.cpp File Reference

#include "pch.h"
#include "Face.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Face.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Face.h File Reference

#include "GameObject.h"

Go to the source code of this file.

Classes

class Face
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/FaceMesh.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

FaceMesh.cpp File Reference

#include "pch.h"
#include "FaceMesh.h"
#include "ConstantBuffers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/FaceMesh.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

FaceMesh.h File Reference

#include "MeshObject.h"

Go to the source code of this file.

Classes

class FaceMesh
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameConstants.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Namespaces

GameConstants.h File Reference

Go to the source code of this file.

Namespaces

namespace | GameConstants
namespace | GameConstants::Physics
namespace | GameConstants::Sound
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameObject.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

GameObject.cpp File Reference

#include "pch.h"
#include "GameObject.h"
#include "GameConstants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameObject.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

GameObject.h File Reference

#include "MeshObject.h"
#include "SoundEffect.h"
#include "Animate.h"
#include "Material.h"

Go to the source code of this file.

Classes

class GameObject
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameTimer.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

GameTimer.cpp File Reference

#include "pch.h"
#include "GameTimer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameTimer.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

GameTimer.h File Reference

Go to the source code of this file.

Classes

class GameTimer
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level.cpp File Reference

#include "pch.h"
#include "Level.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level.h File Reference

#include "GameObject.h"
#include "PersistentState.h"

Go to the source code of this file.

Classes

class Level
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level1.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level1.cpp File Reference

#include "pch.h"
#include "Level1.h"
#include "Face.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level1.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level1.h File Reference

#include "Level.h"

Go to the source code of this file.

Classes

class Level1
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level2.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level2.cpp File Reference

#include "pch.h"
#include "Level2.h"
#include "Face.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level2.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level2.h File Reference

#include "Level1.h"

Go to the source code of this file.

Classes

class Level2
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level3.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level3.cpp File Reference

#include "pch.h"
#include "Level3.h"
#include "Face.h"
#include "Animate.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level3.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level3.h File Reference

#include "Level.h"

Go to the source code of this file.

Classes

class Level3
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level4.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level4.cpp File Reference

#include "pch.h"
#include "Level4.h"
#include "Face.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level4.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level4.h File Reference

#include "Level3.h"

Go to the source code of this file.

Classes

class Level4
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level5.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level5.cpp File Reference

#include "pch.h"
#include "Level5.h"
#include "Cylinder.h"
#include "Animate.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level5.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level5.h File Reference

#include "Level3.h"

Go to the source code of this file.

Classes

class Level5
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level6.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level6.cpp File Reference

#include "pch.h"
#include "Level6.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level6.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Level6.h File Reference

#include "Level5.h"

Go to the source code of this file.

Classes

class Level6
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Material.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Material.cpp File Reference

#include "pch.h"
#include "Material.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Material.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Material.h File Reference

#include "ConstantBuffers.h"

Go to the source code of this file.

Classes

class Material
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MediaReader.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

MediaReader.cpp File Reference

#include "pch.h"
#include "MediaReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MediaReader.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

MediaReader.h File Reference

Go to the source code of this file.

Classes

class MediaReader
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MeshObject.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

MeshObject.cpp File Reference

#include "pch.h"
#include "MeshObject.h"
#include "ConstantBuffers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MeshObject.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

MeshObject.h File Reference

Go to the source code of this file.

Classes

class MeshObject
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MoveLookController.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Defines

MoveLookController.cpp File Reference

#include "pch.h"
#include "MoveLookController.h"

Go to the source code of this file.

Defines

#define | THUMBSTICK_DEADZONE 0.25f
#define | TRIGGER_DEADZONE 0.1f

Define Documentation

#define THUMBSTICK_DEADZONE 0.25f

Definition at line 25 of file MoveLookController.cpp.

#define TRIGGER_DEADZONE 0.1f

Definition at line 28 of file MoveLookController.cpp.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MoveLookController.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes | Namespaces | Enumerations

MoveLookController.h File Reference

Go to the source code of this file.

Classes

class | MoveLookController

Namespaces

namespace | MoveLookConstants

Enumerations

enum | MoveLookControllerState { None, WaitForInput, Active }

Enumeration Type Documentation

enum MoveLookControllerState
Enumerator:
None
WaitForInput
Active

Definition at line 100 of file MoveLookController.h.

{
    None,
    WaitForInput,
    Active,
};

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SoundEffect.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

SoundEffect.cpp File Reference

#include "pch.h"
#include "SoundEffect.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SoundEffect.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

SoundEffect.h File Reference

Go to the source code of this file.

Classes

class SoundEffect
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Sphere.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Sphere.cpp File Reference

#include "pch.h"
#include "Sphere.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Sphere.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

Sphere.h File Reference

#include "GameObject.h"

Go to the source code of this file.

Classes

class Sphere
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SphereMesh.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

SphereMesh.cpp File Reference

#include "pch.h"
#include "SphereMesh.h"
#include "ConstantBuffers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SphereMesh.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

SphereMesh.h File Reference

#include "MeshObject.h"

Go to the source code of this file.

Classes

class SphereMesh
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/StereoProjection.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Defines | Functions

StereoProjection.cpp File Reference

#include "pch.h"
#include "StereoProjection.h"

Go to the source code of this file.

Defines

#define | XMASSERT(Expression) ((void)0)

Functions

__forceinline bool | _XMMatrixStereoProjectionHelper (const STEREO_PARAMETERS *stereoParameters, _Out_ float *virtualProjection, _Out_ float *zNearWidth, _Out_ float *zNearHeight, float fovAngleY, float aspectHByW, float nearZ)
XMMATRIX | MatrixStereoProjectionFovLH (_In_opt_ const STEREO_PARAMETERS *stereoParameters, STEREO_CHANNEL channel, float fovAngleY, float aspectHByW, float nearZ, float farZ, STEREO_MODE stereoMode)
void | StereoCreateDefaultParameters (_Out_ STEREO_PARAMETERS *stereoParameters)

Define Documentation

#define XMASSERT ( Expression ) ((void)0)

Definition at line 16 of file StereoProjection.cpp.

Function Documentation

__forceinline bool _XMMatrixStereoProjectionHelper | ( | const STEREO_PARAMETERS * | stereoParameters,
 |  | _Out_ float * | virtualProjection,
 |  | _Out_ float * | zNearWidth,
 |  | _Out_ float * | zNearHeight,
 |  | float | fovAngleY,
 |  | float | aspectHByW,
 |  | float | nearZ
 | ) |  |

Definition at line 35 of file StereoProjection.cpp.

{
    // note that most people have difficulty fusing images into 3D
    // if the separation equals even just the human average. by
    // reducing the separation (interocular distance) by 1/2, we
    // guarantee a larger subset of people will see full 3D

    // the conservative setting should always be used. the only problem
    // with the conservative setting is that the 3D effect will be less
    // impressive on smaller screens (which makes sense, since your eye
    // cannot be tricked as easily based on the smaller fov). to simulate
    // the effect of a larger screen, use the liberal settings (debug only)

    // Conservative Settings: * max acuity angle: 0.8f degrees * interoc distance: 1.25 inches

    // Liberal Settings: * max acuity angle: 1.6f degrees * interoc distance: 2.5f inches

    // maximum visual accuity angle allowed is 3.2 degrees for
    // a physical scene, and 1.6 degrees for a virtual one.
    // thus we cannot allow an object to appear any closer to
    // the viewer than 1.6 degrees (divided by two for most
    // half-angle calculations)

    static const float maxStereoDistance = 85; // 780 inches (should be between 10 and 20m)
    static const float maxVisualAcuityAngle = 0.8f * (XM_PI / 180.0f);  // radians
    static const float interocularDistance = 1.25f; // inches

    bool comfortableResult = true;

    float displayHeight = stereoParameters->displaySizeInches / sqrtf(aspectHByW * aspectHByW + 1.0f);
    float displayWidth = displayHeight * aspectHByW;
    float halfInterocular = 0.5f * interocularDistance * stereoParameters->stereoExaggerationFactor;
    float halfPixelWidth = displayWidth / stereoParameters->pixelResolutionWidth * 0.5f;
    float halfMaximumAcuityAngle = maxVisualAcuityAngle * 0.5f * stereoParameters->stereoExaggerationFactor;

    float maxSeparationAcuityAngle = atanf(halfInterocular / maxStereoDistance);
    float maxSeparationDistance = halfPixelWidth / tanf(maxSeparationAcuityAngle);
    float refinedMaxStereoDistance = maxStereoDistance - maxSeparationDistance;
    float fovHalfAngle = fovAngleY / 2.0f;

    if (refinedMaxStereoDistance < 0.0f || maxSeparationDistance > 0.1f * maxStereoDistance)
    {
        // Pixel resolution is too low to offer a comfortable stereo experience
        comfortableResult = false;
    }

    float refinedMaxSeparationAcuityAngle = atanf(halfInterocular / refinedMaxStereoDistance);
    float physicalZNearDistance = halfInterocular / tanf(halfMaximumAcuityAngle);

    float nearZSeparation = tanf(refinedMaxSeparationAcuityAngle) * (refinedMaxStereoDistance - physicalZNearDistance);

    *zNearHeight = cosf(fovHalfAngle) / sinf(fovHalfAngle);
    *zNearWidth = *zNearHeight / aspectHByW;
    *virtualProjection = (nearZSeparation * nearZ * (*zNearWidth * 4.0f)) / (2.0f * nearZ);

    return comfortableResult;
}

XMMATRIX MatrixStereoProjectionFovLH | ( | _In_opt_ const STEREO_PARAMETERS * | stereoParameters,
 |  | STEREO_CHANNEL | channel,
 |  | float | fovAngleY,
 |  | float | aspectHByW,
 |  | float | nearZ,
 |  | float | farZ,
 |  | STEREO_MODE | stereoMode
 | ) |  |

Definition at line 102 of file StereoProjection.cpp.

{
    float virtualProjection = 0.0f;
    float zNearWidth = 0.0f;
    float zNearHeight = 0.0f;
    float invertedAngle;
    XMMATRIX patchedProjection;
    XMMATRIX proj;
    STEREO_PARAMETERS defaultParameters;

    XMASSERT(channel == STEREO_CHANNEL::LEFT || channel == STEREO_CHANNEL::RIGHT);
    XMASSERT(stereoMode == STEREO_MODE::NORMAL || stereoMode == STEREO_MODE::INVERTED);
    XMASSERT(!XMScalarNearEqual(fovAngleY, 0.0f, 0.00001f * 2.0f));
    XMASSERT(!XMScalarNearEqual(aspectHByW, 0.0f, 0.00001f));
    XMASSERT(!XMScalarNearEqual(farZ, nearZ, 0.00001f));

    proj = XMMatrixIdentity();

    if (stereoParameters == nullptr)
    {
        StereoCreateDefaultParameters(&defaultParameters);
        stereoParameters = &defaultParameters;
    }

    XMASSERT(pStereoParameters->stereoSeparationFactor >= 0.0f && stereoParameters->stereoSeparationFactor <= 1.0f);
    XMASSERT(pStereoParameters->stereoExaggerationFactor >= 1.0f && stereoParameters->stereoExaggerationFactor <= 2.0f);

    _XMMatrixStereoProjectionHelper(stereoParameters, &virtualProjection, &zNearWidth, &zNearHeight, fovAngleY, aspectHByW, nearZ);

    virtualProjection *= stereoParameters->stereoSeparationFactor; // incorporate developer defined bias

    //
    // By applying a translation, we are forcing our cameras to be parallel
    //

    invertedAngle = atanf(virtualProjection / (2.0f * nearZ));

    proj = XMMatrixPerspectiveFovLH(fovAngleY, aspectHByW, nearZ, farZ);

    if (channel == STEREO_CHANNEL::LEFT)
    {
        if (stereoMode > STEREO_MODE::NORMAL)
        {
            XMMATRIX rots, trans;
            rots = XMMatrixRotationY(invertedAngle);
            trans = XMMatrixTranslation(-virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(XMMatrixMultiply(rots, trans), proj);
        }
        else
        {
            XMMATRIX trans;
            trans = XMMatrixTranslation(-virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(trans, proj);
        }
    }
    else
    {
        if (stereoMode > STEREO_MODE::NORMAL)
        {
            XMMATRIX rots, trans;
            rots = XMMatrixRotationY(-invertedAngle);
            trans = XMMatrixTranslation(virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(XMMatrixMultiply(rots, trans), proj);
        }
        else
        {
            XMMATRIX trans;
            trans = XMMatrixTranslation(virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(trans, proj);
        }
    }

    return patchedProjection;
}

void StereoCreateDefaultParameters ( _Out_ STEREO_PARAMETERS * stereoParameters )

Definition at line 21 of file StereoProjection.cpp.

{
    XMASSERT(stereoParameters != nullptr);

    // Default assumption is 1920x1200 resolution, a 22" LCD monitor, and a 2' viewing distance
    stereoParameters->viewerDistanceInches = 24.0f;
    stereoParameters->pixelResolutionWidth = 1920.0f;
    stereoParameters->pixelResolutionHeight = 1024.0f; // 480.0f; // 1200
    stereoParameters->displaySizeInches = 22.0f;

    stereoParameters->stereoSeparationFactor = 1.0f;
    stereoParameters->stereoExaggerationFactor = 1.0f;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/StereoProjection.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes | Typedefs | Enumerations | Functions

StereoProjection.h File Reference

Go to the source code of this file.

Classes

struct | STEREO_PARAMETERS

Typedefs

typedef enum STEREO_CHANNEL | STEREO_CHANNEL
typedef enum STEREO_MODE | STEREO_MODE
typedef struct STEREO_PARAMETERS | STEREO_PARAMETERS

Enumerations

enum | STEREO_CHANNEL { LEFT = 0, RIGHT }
enum | STEREO_MODE { NORMAL = 0, INVERTED }

Functions

DirectX::XMMATRIX | MatrixStereoProjectionFovLH (_In_opt_ const STEREO_PARAMETERS *stereoParameters, STEREO_CHANNEL channel, float fovAngleY, float aspectHByW, float nearZ, float farZ, STEREO_MODE stereoMode)
void | StereoCreateDefaultParameters (_Out_ STEREO_PARAMETERS *pStereoParameters)

Typedef Documentation

typedef enum STEREO_CHANNEL STEREO_CHANNEL
typedef enum STEREO_MODE STEREO_MODE
typedef struct STEREO_PARAMETERS STEREO_PARAMETERS

Enumeration Type Documentation

enum STEREO_CHANNEL
Enumerator:
LEFT
RIGHT

Definition at line 25 of file StereoProjection.h.

{
    LEFT = 0,
    RIGHT
} STEREO_CHANNEL;

enum STEREO_MODE
Enumerator:
NORMAL
INVERTED

Definition at line 32 of file StereoProjection.h.

{
    NORMAL = 0,
    INVERTED,
} STEREO_MODE;

Function Documentation

DirectX::XMMATRIX MatrixStereoProjectionFovLH | ( | _In_opt_ const STEREO_PARAMETERS * | stereoParameters,
 |  | STEREO_CHANNEL | channel,
 |  | float | fovAngleY,
 |  | float | aspectHByW,
 |  | float | nearZ,
 |  | float | farZ,
 |  | STEREO_MODE | stereoMode
 | ) |  |

Definition at line 102 of file StereoProjection.cpp.

{
    float virtualProjection = 0.0f;
    float zNearWidth = 0.0f;
    float zNearHeight = 0.0f;
    float invertedAngle;
    XMMATRIX patchedProjection;
    XMMATRIX proj;
    STEREO_PARAMETERS defaultParameters;

    XMASSERT(channel == STEREO_CHANNEL::LEFT || channel == STEREO_CHANNEL::RIGHT);
    XMASSERT(stereoMode == STEREO_MODE::NORMAL || stereoMode == STEREO_MODE::INVERTED);
    XMASSERT(!XMScalarNearEqual(fovAngleY, 0.0f, 0.00001f * 2.0f));
    XMASSERT(!XMScalarNearEqual(aspectHByW, 0.0f, 0.00001f));
    XMASSERT(!XMScalarNearEqual(farZ, nearZ, 0.00001f));

    proj = XMMatrixIdentity();

    if (stereoParameters == nullptr)
    {
        StereoCreateDefaultParameters(&defaultParameters);
        stereoParameters = &defaultParameters;
    }

    XMASSERT(pStereoParameters->stereoSeparationFactor >= 0.0f && stereoParameters->stereoSeparationFactor <= 1.0f);
    XMASSERT(pStereoParameters->stereoExaggerationFactor >= 1.0f && stereoParameters->stereoExaggerationFactor <= 2.0f);

    _XMMatrixStereoProjectionHelper(stereoParameters, &virtualProjection, &zNearWidth, &zNearHeight, fovAngleY, aspectHByW, nearZ);

    virtualProjection *= stereoParameters->stereoSeparationFactor; // incorporate developer defined bias

    //
    // By applying a translation, we are forcing our cameras to be parallel
    //

    invertedAngle = atanf(virtualProjection / (2.0f * nearZ));

    proj = XMMatrixPerspectiveFovLH(fovAngleY, aspectHByW, nearZ, farZ);

    if (channel == STEREO_CHANNEL::LEFT)
    {
        if (stereoMode > STEREO_MODE::NORMAL)
        {
            XMMATRIX rots, trans;
            rots = XMMatrixRotationY(invertedAngle);
            trans = XMMatrixTranslation(-virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(XMMatrixMultiply(rots, trans), proj);
        }
        else
        {
            XMMATRIX trans;
            trans = XMMatrixTranslation(-virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(trans, proj);
        }
    }
    else
    {
        if (stereoMode > STEREO_MODE::NORMAL)
        {
            XMMATRIX rots, trans;
            rots = XMMatrixRotationY(-invertedAngle);
            trans = XMMatrixTranslation(virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(XMMatrixMultiply(rots, trans), proj);
        }
        else
        {
            XMMATRIX trans;
            trans = XMMatrixTranslation(virtualProjection, 0, 0);
            patchedProjection = XMMatrixMultiply(trans, proj);
        }
    }

    return patchedProjection;
}

void StereoCreateDefaultParameters ( _Out_ STEREO_PARAMETERS * pStereoParameters )

Definition at line 21 of file StereoProjection.cpp.

{
    XMASSERT(stereoParameters != nullptr);

    // Default assumption is 1920x1200 resolution, a 22" LCD monitor, and a 2' viewing distance
    stereoParameters->viewerDistanceInches = 24.0f;
    stereoParameters->pixelResolutionWidth = 1920.0f;
    stereoParameters->pixelResolutionHeight = 1024.0f; // 480.0f; // 1200
    stereoParameters->displaySizeInches = 22.0f;

    stereoParameters->stereoSeparationFactor = 1.0f;
    stereoParameters->stereoExaggerationFactor = 1.0f;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/TargetTexture.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

TargetTexture.cpp File Reference

#include "pch.h"
#include "TargetTexture.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/TargetTexture.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

TargetTexture.h File Reference

Go to the source code of this file.

Classes

class TargetTexture
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

WorldMesh.cpp File Reference

#include "pch.h"
#include "WorldMesh.h"
#include "ConstantBuffers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h File Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent
Classes

WorldMesh.h File Reference

#include "MeshObject.h"

Go to the source code of this file.

Classes

class | WorldCeilingMesh
class | WorldFloorMesh
class | WorldWallsMesh
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/App.xaml.cpp File Reference

  • Simple3DGameXaml
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/App.xaml.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "DirectXPage.xaml.h"
#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
A page that hosts a DirectX SwapChainPanel. More...

Namespaces

namespace | Simple3DGameXaml
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/DirectXPage.xaml.cpp File Reference

  • Simple3DGameXaml
  • cpp

DirectXPage.xaml.cpp File Reference

#include "pch.h"
#include "App.xaml.h"
#include "DirectXPage.xaml.h"
#include "ProductItem.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/DirectXPage.xaml.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Namespaces | Defines

DirectXPage.xaml.h File Reference

#include "DirectXPage.g.h"
#include "GameMain.h"
#include "ProductItem.h"

Go to the source code of this file.

Classes

class | sealed
A page that hosts a DirectX SwapChainPanel. More...

Namespaces

namespace | Simple3DGameXaml

Defines

#define | USE_STORE_SIMULATOR 1

Define Documentation

#define USE_STORE_SIMULATOR 1

Definition at line 19 of file DirectXPage.xaml.h.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameHud.cpp File Reference

  • Simple3DGameXaml
  • cpp

GameHud.cpp File Reference

#include "pch.h"
#include "GameHud.h"
#include "GameConstants.h"
#include "GameUIConstants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameHud.h File Reference

  • Simple3DGameXaml
  • cpp
Classes

GameHud.h File Reference

#include "Simple3DGame.h"
#include "DirectXSample.h"

Go to the source code of this file.

Classes

class GameHud
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameMain.cpp File Reference

  • Simple3DGameXaml
  • cpp

GameMain.cpp File Reference

#include "pch.h"
#include "MoveLookController.h"
#include "GameMain.h"
#include "GameUIConstants.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameMain.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Namespaces | Enumerations

GameMain.h File Reference

#include "DeviceResources.h"
#include "MoveLookController.h"
#include "GameRenderer.h"
#include "Simple3DGame.h"
#include "GameUIControl.h"

Go to the source code of this file.

Classes

class | GameMain

Namespaces

namespace | GameControl

Enumerations

enum GameInfoOverlayState {
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause, Loading, GameStats,
GameOverExpired, GameOverCompleted, LevelStart, Pause,
Loading, GameStats, GameOverExpired, GameOverCompleted,
LevelStart, Pause
}
enum PressResultState {
LoadGame, PlayLevel, ContinueLevel, LoadGame,
PlayLevel, ContinueLevel, LoadGame, PlayLevel,
ContinueLevel
}
enum UpdateEngineState {
WaitingForResources, ResourcesLoaded, WaitingForPress, Dynamics,
TooSmall, Suspended, Deactivated, WaitingForResources,
ResourcesLoaded, WaitingForPress, Dynamics, TooSmall,
Suspended, Deactivated, WaitingForResources, ResourcesLoaded,
WaitingForPress, Dynamics, TooSmall, Suspended,
Deactivated
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameRenderer.cpp File Reference

  • Simple3DGameXaml
  • cpp

GameRenderer.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "ConstantBuffers.h"
#include "TargetTexture.h"
#include "BasicLoader.h"
#include "CylinderMesh.h"
#include "FaceMesh.h"
#include "SphereMesh.h"
#include "WorldMesh.h"
#include "Face.h"
#include "Sphere.h"
#include "Cylinder.h"
#include "windows.ui.xaml.media.dxinterop.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameRenderer.h File Reference

  • Simple3DGameXaml
  • cpp
Classes

GameRenderer.h File Reference

#include "DeviceResources.h"
#include "GameHud.h"
#include "Simple3DGame.h"

Go to the source code of this file.

Classes

class GameRenderer
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameUIConstants.h File Reference

  • Simple3DGameXaml
  • cpp
Namespaces

GameUIConstants.h File Reference

Go to the source code of this file.

Namespaces

namespace | GameConstants
namespace | GameInfoOverlayConstant
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameUIControl.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Namespaces | Enumerations

GameUIControl.h File Reference

Go to the source code of this file.

Classes

interface | IGameUIControl

Namespaces

namespace | Simple3DGameXaml

Enumerations

enum | GameInfoOverlayCommand { None, TapToContinue, PleaseWait, PlayAgain }
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/ProductItem.cpp File Reference

  • Simple3DGameXaml
  • cpp

ProductItem.cpp File Reference

#include "pch.h"
#include "ProductItem.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/ProductItem.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Namespaces

ProductItem.h File Reference

Go to the source code of this file.

Classes

class | sealed
A page that hosts a DirectX SwapChainPanel. More...

Namespaces

namespace | Simple3DGameXaml
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Simple3DGame.cpp File Reference

  • Simple3DGameXaml
  • cpp

Simple3DGame.cpp File Reference

#include "pch.h"
#include "GameRenderer.h"
#include "Level1.h"
#include "Level2.h"
#include "Level3.h"
#include "Level4.h"
#include "Level5.h"
#include "Level6.h"
#include "Animate.h"
#include "Sphere.h"
#include "Cylinder.h"
#include "Face.h"
#include "MediaReader.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Simple3DGame.h File Reference

  • Simple3DGameXaml
  • cpp
Classes | Typedefs | Enumerations

Simple3DGame.h File Reference

#include "GameConstants.h"
#include "GameUIConstants.h"
#include "Audio.h"
#include "Camera.h"
#include "Level.h"
#include "GameObject.h"
#include "GameTimer.h"
#include "MoveLookController.h"
#include "PersistentState.h"
#include "Sphere.h"
#include "GameRenderer.h"

Go to the source code of this file.

Classes

struct | GameConfig
struct | HighScoreEntry
class | Simple3DGame

Typedefs

typedef std::vector
< HighScoreEntry > 		HighScoreEntries

Enumerations

enum GameState {
Waiting, Active, LevelComplete, TimeExpired,
GameComplete, Waiting, Active, LevelComplete,
TimeExpired, GameComplete, Waiting, Active,
LevelComplete, TimeExpired, GameComplete
}

Typedef Documentation

typedef std::vector<HighScoreEntry> HighScoreEntries

Definition at line 63 of file Simple3DGame.h.

Enumeration Type Documentation

enum GameState
Enumerator:
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete
Waiting
Active
LevelComplete
TimeExpired
GameComplete

Definition at line 46 of file Simple3DGame.h.

{
    Waiting,
    Active,
    LevelComplete,
    TimeExpired,
    GameComplete,
};

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicLoader.cpp File Reference

  • Simple3DGameXaml
  • cpp
  • Common

BasicLoader.cpp File Reference

#include "pch.h"
#include "BasicLoader.h"
#include "BasicShapes.h"
#include "DDSTextureLoader.h"
#include "DirectXSample.h"
#include <memory>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicLoader.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes

BasicLoader.h File Reference

#include "BasicReaderWriter.h"

Go to the source code of this file.

Classes

class BasicLoader
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicMath.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes | Defines | Typedefs | Functions

BasicMath.h File Reference

#include <math.h>

Go to the source code of this file.

Classes

struct | Matrix4x4< T >
struct | Vector2< T >
struct | Vector3< T >
struct | Vector4< T >

Defines

#define | _USE_MATH_DEFINES
#define | PI_F 3.1415927f

Typedefs

typedef Vector2< float > | float2
typedef Vector3< float > | float3
typedef Vector4< float > | float4
typedef Matrix4x4< float > | float4x4
typedef unsigned int | uint

Functions

template<class T >
Vector3< T > | cross (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector3< T > a, Vector3< T > b)
template<class T >
T | dot (Vector2< T > a, Vector2< T > b)
template<class T >
T | dot (Vector4< T > a, Vector4< T > b)
float4x4 identity ()
template<class T >
T | length (Vector2< T > a)
template<class T >
T | length (Vector3< T > a)
template<class T >
T | length (Vector4< T > a)
template<class T >
Matrix4x4< T > | mul (Matrix4x4< T > m1, Matrix4x4< T > m2)
template<class T >
Vector2< T > | normalize (Vector2< T > a)
template<class T >
Vector3< T > | normalize (Vector3< T > a)
template<class T >
Vector4< T > | normalize (Vector4< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, T s)
template<class T >
Vector2< T > | operator* (T s, Vector2< T > a)
template<class T >
Vector2< T > | operator* (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator* (Vector3< T > a, T s)
template<class T >
Vector3< T > | operator* (T s, Vector3< T > a)
template<class T >
Vector3< T > | operator* (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator* (Vector4< T > a, T s)
template<class T >
Vector4< T > | operator* (T s, Vector4< T > a)
template<class T >
Vector4< T > | operator* (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator+ (Vector2< T > a, Vector2< T > b)
template<class T >
Vector3< T > | operator+ (Vector3< T > a, Vector3< T > b)
template<class T >
Vector4< T > | operator+ (Vector4< T > a, Vector4< T > b)
template<class T >
Vector4< T > | operator- (Vector4< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a)
template<class T >
Vector4< T > | operator- (Vector4< T > a, Vector4< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a, Vector2< T > b)
template<class T >
Vector2< T > | operator- (Vector2< T > a)
template<class T >
Vector3< T > | operator- (Vector3< T > a, Vector3< T > b)
template<class T >
Vector3< T > | operator/ (Vector3< T > a, T s)
template<class T >
Vector4< T > | operator/ (Vector4< T > a, T s)
template<class T >
Vector2< T > | operator/ (Vector2< T > a, T s)
float4x4 | rotationArbitrary (float3 axis, float degree)
float4x4 | rotationX (float degreeX)
float4x4 | rotationY (float degreeY)
float4x4 | rotationZ (float degreeZ)
float4x4 | scale (float x, float y, float z)
float4x4 | translation (float x, float y, float z)
template<class T >
Matrix4x4< T > | transpose (Matrix4x4< T > m)

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 10 of file BasicMath.h.

#define PI_F 3.1415927f

Definition at line 18 of file BasicMath.h.

Typedef Documentation

typedef Vector2<float> float2

Definition at line 389 of file BasicMath.h.

typedef Vector3<float> float3

Definition at line 390 of file BasicMath.h.

typedef Vector4<float> float4

Definition at line 391 of file BasicMath.h.

typedef Matrix4x4<float> float4x4

Definition at line 393 of file BasicMath.h.

typedef unsigned int uint

Definition at line 387 of file BasicMath.h.

Function Documentation

Vector3<T> cross | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 197 of file BasicMath.h.

{
    return Vector3<T>((a.y*b.z)-(a.z*b.y), (a.z*b.x)-(a.x*b.z), (a.x*b.y)-(a.y*b.x));
}

T dot | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 167 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z;
}

T dot | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 161 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y;
}

T dot | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 173 of file BasicMath.h.

{
    return a.x * b.x + a.y * b.y + a.z * b.z + a.w + b.w;
}

float4x4 identity ( ) [inline]

Definition at line 397 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

T length ( Vector2< T > a )

Definition at line 179 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y);
}

T length ( Vector3< T > a )

Definition at line 185 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
}

T length ( Vector4< T > a )

Definition at line 191 of file BasicMath.h.

{
    return sqrt(a.x * a.x + a.y * a.y + a.z * a.z + a.w * a.w);
}

Matrix4x4<T> mul | ( | Matrix4x4< T > | m1,
 |  | Matrix4x4< T > | m2
 | ) |  |

Definition at line 367 of file BasicMath.h.

{
    Matrix4x4<T> mOut;

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 4; k++)
            {
                mOut[i][j] += m1[i][k] * m2[k][j];
            }
        }
    }

    return mOut;
}

Vector2<T> normalize ( Vector2< T > a )

Definition at line 203 of file BasicMath.h.

{
    T len = length(a);
    return Vector2<T>(a.x / len, a.y / len);
}

Vector3<T> normalize ( Vector3< T > a )

Definition at line 210 of file BasicMath.h.

{
    T len = length(a);
    return Vector3<T>(a.x / len, a.y / len, a.z / len);
}

Vector4<T> normalize ( Vector4< T > a )

Definition at line 217 of file BasicMath.h.

{
    T len = length(a);
    return Vector4<T>(a.x / len, a.y / len, a.z / len, a.w / len);
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 280 of file BasicMath.h.

{
    return Vector2<T>(a.x * s, a.y * s);
}

Vector2<T> operator* | ( | T | s,
 |  | Vector2< T > | a
 | ) |  |

Definition at line 286 of file BasicMath.h.

{
    return a * s;
}

Vector2<T> operator* | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 292 of file BasicMath.h.

{
    return Vector2<T>(a.x * b.x, a.y * b.y);
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 304 of file BasicMath.h.

{
    return Vector3<T>(a.x * s, a.y * s, a.z * s);
}

Vector3<T> operator* | ( | T | s,
 |  | Vector3< T > | a
 | ) |  |

Definition at line 310 of file BasicMath.h.

{
    return a * s;
}

Vector3<T> operator* | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 316 of file BasicMath.h.

{
    return Vector3<T>(a.x * b.x, a.y * b.y, a.z * b.z);
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 328 of file BasicMath.h.

{
    return Vector4<T>(a.x * s, a.y * s, a.z * s, a.w * s);
}

Vector4<T> operator* | ( | T | s,
 |  | Vector4< T > | a
 | ) |  |

Definition at line 334 of file BasicMath.h.

{
    return a * s;
}

Vector4<T> operator* | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 340 of file BasicMath.h.

{
    return Vector4<T>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
}

Vector2<T> operator+ | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 262 of file BasicMath.h.

{
    return Vector2<T>(a.x + b.x, a.y + b.y);
}

Vector3<T> operator+ | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 268 of file BasicMath.h.

{
    return Vector3<T>(a.x + b.x, a.y + b.y, a.z + b.z);
}

Vector4<T> operator+ | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 274 of file BasicMath.h.

{
    return Vector4<T>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
}

Vector4<T> operator- ( Vector4< T > a )

Definition at line 256 of file BasicMath.h.

{
    return Vector4<T>(-a.x, -a.y, -a.z, -a.w);
}

Vector3<T> operator- ( Vector3< T > a )

Definition at line 244 of file BasicMath.h.

{
    return Vector3<T>(-a.x, -a.y, -a.z);
}

Vector4<T> operator- | ( | Vector4< T > | a,
 |  | Vector4< T > | b
 | ) |  |

Definition at line 250 of file BasicMath.h.

{
    return Vector4<T>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
}

Vector2<T> operator- | ( | Vector2< T > | a,
 |  | Vector2< T > | b
 | ) |  |

Definition at line 226 of file BasicMath.h.

{
    return Vector2<T>(a.x - b.x, a.y - b.y);
}

Vector2<T> operator- ( Vector2< T > a )

Definition at line 232 of file BasicMath.h.

{
    return Vector2<T>(-a.x, -a.y);
}

Vector3<T> operator- | ( | Vector3< T > | a,
 |  | Vector3< T > | b
 | ) |  |

Definition at line 238 of file BasicMath.h.

{
    return Vector3<T>(a.x - b.x, a.y - b.y, a.z - b.z);
}

Vector3<T> operator/ | ( | Vector3< T > | a,
 |  | T | s
 | ) |  |

Definition at line 322 of file BasicMath.h.

{
    return Vector3<T>(a.x / s, a.y / s, a.z / s);
}

Vector4<T> operator/ | ( | Vector4< T > | a,
 |  | T | s
 | ) |  |

Definition at line 346 of file BasicMath.h.

{
    return Vector4<T>(a.x / s, a.y / s, a.z / s, a.w / s);
}

Vector2<T> operator/ | ( | Vector2< T > | a,
 |  | T | s
 | ) |  |

Definition at line 298 of file BasicMath.h.

{
    return Vector2<T>(a.x / s, a.y / s);
}

float4x4 rotationArbitrary | ( | float3 | axis,
 |  | float | degree |
 | ) |  |  | [inline]

Definition at line 485 of file BasicMath.h.

{
    axis = normalize(axis);

    float angleInRadians = degree * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);
    float oneMinusCosAngle = 1 - cosAngle;

    float4x4 mOut;

    mOut._11 = 1.0f + oneMinusCosAngle * (axis.x * axis.x - 1.0f);
    mOut._12 = axis.z * sinAngle + oneMinusCosAngle * axis.x * axis.y;
    mOut._13 = -axis.y * sinAngle + oneMinusCosAngle * axis.x * axis.z;
    mOut._41 = 0.0f;

    mOut._21 = -axis.z * sinAngle + oneMinusCosAngle * axis.y * axis.x;
    mOut._22 = 1.0f + oneMinusCosAngle * (axis.y * axis.y - 1.0f);
    mOut._23 = axis.x * sinAngle + oneMinusCosAngle * axis.y * axis.z;
    mOut._24 = 0.0f;

    mOut._31 = axis.y * sinAngle + oneMinusCosAngle * axis.z * axis.x;
    mOut._32 = -axis.x * sinAngle + oneMinusCosAngle * axis.z * axis.y;
    mOut._33 = 1.0f + oneMinusCosAngle * (axis.z * axis.z - 1.0f);
    mOut._34 = 0.0f;

    mOut._41 = 0.0f;
    mOut._42 = 0.0f;
    mOut._43 = 0.0f;
    mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationX ( float degreeX ) [inline]

Definition at line 433 of file BasicMath.h.

{
    float angleInRadians = degreeX * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f;     mOut._13 = 0.0f;      mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = cosAngle; mOut._23 = -sinAngle; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = sinAngle; mOut._33 = cosAngle;  mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f;     mOut._43 = 0.0f;      mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationY ( float degreeY ) [inline]

Definition at line 450 of file BasicMath.h.

{
    float angleInRadians = degreeY * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = cosAngle;  mOut._12 = 0.0f; mOut._13 = sinAngle; mOut._14 = 0.0f;
    mOut._21 = 0.0f;      mOut._22 = 1.0f; mOut._23 = 0.0f;     mOut._24 = 0.0f;
    mOut._31 = -sinAngle; mOut._32 = 0.0f; mOut._33 = cosAngle; mOut._34 = 0.0f;
    mOut._41 = 0.0f;      mOut._42 = 0.0f; mOut._43 = 0.0f;     mOut._44 = 1.0f;

    return mOut;
}

float4x4 rotationZ ( float degreeZ ) [inline]

Definition at line 467 of file BasicMath.h.

{
    float angleInRadians = degreeZ * (PI_F / 180.0f);

    float sinAngle = sinf(angleInRadians);
    float cosAngle = cosf(angleInRadians);

    float4x4 mOut;

    mOut._11 = cosAngle; mOut._12 = -sinAngle; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = sinAngle; mOut._22 = cosAngle;  mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f;     mOut._32 = 0.0f;      mOut._33 = 1.0f; mOut._34 = 0.0f;
    mOut._41 = 0.0f;     mOut._42 = 0.0f;      mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

float4x4 scale | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 421 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = x;    mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
    mOut._21 = 0.0f; mOut._22 = y;    mOut._23 = 0.0f; mOut._24 = 0.0f;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = z;    mOut._34 = 0.0f;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

float4x4 translation | ( | float | x,
 |  | float | y,
 |  | float | z |
 | ) |  |  | [inline]

Definition at line 409 of file BasicMath.h.

{
    float4x4 mOut;

    mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = x;
    mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = y;
    mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = z;
    mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;

    return mOut;
}

Matrix4x4<T> transpose ( Matrix4x4< T > m )

Definition at line 356 of file BasicMath.h.

{
    return Matrix4x4<T>(
        m._11, m._21, m._31, m._41,
        m_.12, m._22, m._32, m._42,
        m._13, m._23, m._33, m._43,
        m._14, m._24, m._34, m._44
        );
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicReaderWriter.cpp File Reference

  • Simple3DGameXaml
  • cpp
  • Common

BasicReaderWriter.cpp File Reference

#include "pch.h"
#include "BasicReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicReaderWriter.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes

BasicReaderWriter.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Classes

class BasicReaderWriter
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/BasicShapes.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes

BasicShapes.h File Reference

#include "BasicMath.h"

Go to the source code of this file.

Classes

class | BasicShapes
struct | BasicVertex
struct | TangentVertex
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DDSTextureLoader.cpp File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes | Defines | Enumerations | Functions

DDSTextureLoader.cpp File Reference

#include "pch.h"
#include <dxgiformat.h>
#include <assert.h>
#include <memory>
#include <algorithm>
#include "DDSTextureLoader.h"
#include "DirectXSample.h"

Go to the source code of this file.

Classes

struct | DDS_HEADER
struct | DDS_HEADER_DXT10
struct | DDS_PIXELFORMAT

Defines

#define | DDS_ALPHA 0x00000002
#define | DDS_CUBEMAP 0x00000200
#define | DDS_CUBEMAP_ALLFACES
#define | DDS_CUBEMAP_NEGATIVEX 0x00000a00
#define | DDS_CUBEMAP_NEGATIVEY 0x00002200
#define | DDS_CUBEMAP_NEGATIVEZ 0x00008200
#define | DDS_CUBEMAP_POSITIVEX 0x00000600
#define | DDS_CUBEMAP_POSITIVEY 0x00001200
#define | DDS_CUBEMAP_POSITIVEZ 0x00004200
#define | DDS_FLAGS_VOLUME 0x00200000
#define | DDS_FOURCC 0x00000004
#define | DDS_HEADER_FLAGS_LINEARSIZE 0x00080000
#define | DDS_HEADER_FLAGS_MIPMAP 0x00020000
#define | DDS_HEADER_FLAGS_PITCH 0x00000008
#define | DDS_HEADER_FLAGS_TEXTURE 0x00001007
#define | DDS_HEADER_FLAGS_VOLUME 0x00800000
#define | DDS_HEIGHT 0x00000002
#define | DDS_LUMINANCE 0x00020000
#define | DDS_LUMINANCEA 0x00020001
#define | DDS_MAGIC 0x20534444
#define | DDS_PAL8 0x00000020
#define | DDS_RGB 0x00000040
#define | DDS_RGBA 0x00000041
#define | DDS_SURFACE_FLAGS_CUBEMAP 0x00000008
#define | DDS_SURFACE_FLAGS_MIPMAP 0x00400008
#define | DDS_SURFACE_FLAGS_TEXTURE 0x00001000
#define | DDS_WIDTH 0x00000004
#define | ISBITMASK(r, g, b, a) (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)
#define | MAKEFOURCC(ch0, ch1, ch2, ch3)

Enumerations

enum DDS_ALPHA_MODE {
DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1, DDS_ALPHA_MODE_PREMULTIPLIED = 2,
DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4, DDS_ALPHA_MODE_UNKNOWN = 0, DDS_ALPHA_MODE_STRAIGHT = 1,
DDS_ALPHA_MODE_PREMULTIPLIED = 2, DDS_ALPHA_MODE_OPAQUE = 3, DDS_ALPHA_MODE_CUSTOM = 4
}
enum | DDS_MISC_FLAGS2 { DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L, DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L }

Functions

_Use_decl_annotations_ void | CreateDDSTextureFromMemory (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, size_t maxsize, D2D1_ALPHA_MODE *alphaMode)
_Use_decl_annotations_ void | CreateDDSTextureFromMemoryEx (ID3D11Device *d3dDevice, const uint8_t *ddsData, size_t ddsDataSize, size_t maxsize, D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB, ID3D11Resource **texture, ID3D11ShaderResourceView **textureView, D2D1_ALPHA_MODE *alphaMode)

Define Documentation

#define DDS_ALPHA 0x00000002

Definition at line 66 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP 0x00000200

Definition at line 93 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_ALLFACES
Value:
(DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
                              DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
                              DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ)

Definition at line 89 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEX 0x00000a00

Definition at line 83 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEY 0x00002200

Definition at line 85 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_NEGATIVEZ 0x00008200

Definition at line 87 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEX 0x00000600

Definition at line 82 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEY 0x00001200

Definition at line 84 of file DDSTextureLoader.cpp.

#define DDS_CUBEMAP_POSITIVEZ 0x00004200

Definition at line 86 of file DDSTextureLoader.cpp.

#define DDS_FLAGS_VOLUME 0x00200000

Definition at line 95 of file DDSTextureLoader.cpp.

#define DDS_FOURCC 0x00000004

Definition at line 61 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_LINEARSIZE 0x00080000

Definition at line 73 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_MIPMAP 0x00020000

Definition at line 70 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_PITCH 0x00000008

Definition at line 72 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_TEXTURE 0x00001007

Definition at line 69 of file DDSTextureLoader.cpp.

#define DDS_HEADER_FLAGS_VOLUME 0x00800000

Definition at line 71 of file DDSTextureLoader.cpp.

#define DDS_HEIGHT 0x00000002

Definition at line 75 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCE 0x00020000

Definition at line 64 of file DDSTextureLoader.cpp.

#define DDS_LUMINANCEA 0x00020001

Definition at line 65 of file DDSTextureLoader.cpp.

#define DDS_MAGIC 0x20534444

Definition at line 47 of file DDSTextureLoader.cpp.

#define DDS_PAL8 0x00000020

Definition at line 67 of file DDSTextureLoader.cpp.

#define DDS_RGB 0x00000040

Definition at line 62 of file DDSTextureLoader.cpp.

#define DDS_RGBA 0x00000041

Definition at line 63 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008

Definition at line 80 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_MIPMAP 0x00400008

Definition at line 79 of file DDSTextureLoader.cpp.

#define DDS_SURFACE_FLAGS_TEXTURE 0x00001000

Definition at line 78 of file DDSTextureLoader.cpp.

#define DDS_WIDTH 0x00000004

Definition at line 76 of file DDSTextureLoader.cpp.

#define ISBITMASK | ( | r,
 |  | g,
 |  | b,
 |  | a |
 | ) |  | (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)

Definition at line 371 of file DDSTextureLoader.cpp.

#define MAKEFOURCC | ( | ch0,
 |  | ch1,
 |  | ch2,
 |  | ch3
 | ) |
Value:
((uint32)(byte)(ch0) | ((uint32)(byte)(ch1) << 8) |       \
                ((uint32)(byte)(ch2) << 16) | ((uint32)(byte)(ch3) << 24))

Definition at line 35 of file DDSTextureLoader.cpp.

Enumeration Type Documentation

enum DDS_ALPHA_MODE
Enumerator:
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM
DDS_ALPHA_MODE_UNKNOWN
DDS_ALPHA_MODE_STRAIGHT
DDS_ALPHA_MODE_PREMULTIPLIED
DDS_ALPHA_MODE_OPAQUE
DDS_ALPHA_MODE_CUSTOM

Definition at line 102 of file DDSTextureLoader.cpp.

{
    DDS_ALPHA_MODE_UNKNOWN       = 0,
    DDS_ALPHA_MODE_STRAIGHT      = 1,
    DDS_ALPHA_MODE_PREMULTIPLIED = 2,
    DDS_ALPHA_MODE_OPAQUE        = 3,
    DDS_ALPHA_MODE_CUSTOM        = 4,
};

enum DDS_MISC_FLAGS2
Enumerator:
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK
DDS_MISC_FLAGS2_ALPHA_MODE_MASK

Definition at line 97 of file DDSTextureLoader.cpp.

{
    DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};

Function Documentation

_Use_decl_annotations_ void CreateDDSTextureFromMemory | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | size_t | maxsize,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1192 of file DDSTextureLoader.cpp.

{
    return CreateDDSTextureFromMemoryEx(d3dDevice, ddsData, ddsDataSize, maxsize, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false, texture, textureView, alphaMode);
}

_Use_decl_annotations_ void CreateDDSTextureFromMemoryEx | ( | ID3D11Device * | d3dDevice,
 |  | const uint8_t * | ddsData,
 |  | size_t | ddsDataSize,
 |  | size_t | maxsize,
 |  | D3D11_USAGE | usage,
 |  | unsigned int | bindFlags,
 |  | unsigned int | cpuAccessFlags,
 |  | unsigned int | miscFlags,
 |  | bool | forceSRGB,
 |  | ID3D11Resource ** | texture,
 |  | ID3D11ShaderResourceView ** | textureView,
 |  | D2D1_ALPHA_MODE * | alphaMode
 | ) |  |

Definition at line 1208 of file DDSTextureLoader.cpp.

{
    if (texture)
    {
        *texture = nullptr;
    }
    if (textureView)
    {
        *textureView = nullptr;
    }
    if (alphaMode)
    {
        *alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
    }

    if (!d3dDevice || !ddsData || (!texture && !textureView))
    {
        throw ref new Platform::InvalidArgumentException();
    }

    // Validate DDS file in memory
    if (ddsDataSize < (sizeof(uint32) + sizeof(DDS_HEADER)))
    {
        throw ref new Platform::FailureException();
    }

    uint32 dwMagicNumber = *(const uint32*)(ddsData);
    if (dwMagicNumber != DDS_MAGIC)
    {
        throw ref new Platform::FailureException();
    }

    auto header = reinterpret_cast<const DDS_HEADER*>(ddsData + sizeof(uint32));

    // Verify header to validate DDS file
    if (header->size != sizeof(DDS_HEADER) ||
        header->ddspf.size != sizeof(DDS_PIXELFORMAT))
    {
        throw ref new Platform::FailureException();
    }

    // Check for DX10 extension
    bool bDXT10Header = false;
    if ((header->ddspf.flags & DDS_FOURCC) &&
        (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC))
    {
        // Must be long enough for both headers and magic value
        if (ddsDataSize < (sizeof(DDS_HEADER) + sizeof(uint32) + sizeof(DDS_HEADER_DXT10)))
        {
            throw ref new Platform::FailureException();
        }

        bDXT10Header = true;
    }

    ptrdiff_t offset = sizeof(uint32) + sizeof(DDS_HEADER) + (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0);

    CreateTextureFromDDS(d3dDevice, header, ddsData + offset, ddsDataSize - offset, maxsize, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, texture, textureView);

    if (alphaMode)
        *alphaMode = GetAlphaMode(header);
}

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DDSTextureLoader.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Functions

DDSTextureLoader.h File Reference

Go to the source code of this file.

Functions

void | CreateDDSTextureFromMemory (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const byte *ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)
void | CreateDDSTextureFromMemoryEx (_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView, _Out_opt_ D2D1_ALPHA_MODE *alphaMode=nullptr)

Function Documentation

void CreateDDSTextureFromMemory | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const byte * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _In_ size_t | maxsize = 0,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
void CreateDDSTextureFromMemoryEx | ( | _In_ ID3D11Device * | d3dDevice,
 |  | _In_reads_bytes_(ddsDataSize) const uint8_t * | ddsData,
 |  | _In_ size_t | ddsDataSize,
 |  | _In_ size_t | maxsize,
 |  | _In_ D3D11_USAGE | usage,
 |  | _In_ unsigned int | bindFlags,
 |  | _In_ unsigned int | cpuAccessFlags,
 |  | _In_ unsigned int | miscFlags,
 |  | _In_ bool | forceSRGB,
 |  | _Outptr_opt_ ID3D11Resource ** | texture,
 |  | _Outptr_opt_ ID3D11ShaderResourceView ** | textureView,
 |  | _Out_opt_ D2D1_ALPHA_MODE * | alphaMode = nullptr
 | ) |  |
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DeviceResources.cpp File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Namespaces

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXSample.h"
#include <windows.ui.xaml.media.dxinterop.h>

Go to the source code of this file.

Namespaces

namespace ScreenRotation
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DeviceResources.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DirectXSample.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Namespaces | Functions

DirectXSample.h File Reference

#include <math.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
float | ConvertPixelsToDips (float pixels, float dpi)
float | ConvertPixelsToDips (float pixels)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/PersistentState.cpp File Reference

  • Simple3DGameXaml
  • cpp
  • Common

PersistentState.cpp File Reference

#include "pch.h"
#include "PersistentState.h"
#include "DirectXSample.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/PersistentState.h File Reference

  • Simple3DGameXaml
  • cpp
  • Common
Classes

PersistentState.h File Reference

Go to the source code of this file.

Classes

class PersistentState
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/AsyncCB.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes

AsyncCB.h File Reference

Go to the source code of this file.

Classes

class AsyncCallback< T >
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BaseAttributes.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

BaseAttributes.h File Reference

Go to the source code of this file.

Classes

class | CBaseAttributes< TBase >

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::Common
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Functions

BufferPacket.cpp File Reference

#include "pch.h"
#include "BufferPacket.h"

Go to the source code of this file.

Functions

IFACEMETHODIMP_ (ULONG) CBufferPacket
IFACEMETHODIMP_ (bool) CBufferEnumerator
IFACEMETHODIMP_ (size_t) CBufferPacket

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 553 of file BufferPacket.cpp.

{
    long cRef = InterlockedDecrement(&_cRef);
    if (cRef == 0)
    {
        delete this;
    }
    return cRef;
}

IFACEMETHODIMP_ ( bool )

Definition at line 564 of file BufferPacket.cpp.

{
    return _currentIt != _buffers.end();
}

IFACEMETHODIMP_ ( size_t )

Definition at line 203 of file BufferPacket.cpp.

{
    return _buffers.size();
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

BufferPacket.h File Reference

#include <list>
#include <StspNetwork.h>

Go to the source code of this file.

Classes

class | CBufferEnumerator
class | CBufferPacket

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/CritSec.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes

CritSec.h File Reference

Go to the source code of this file.

Classes

class | AutoLock
class | CritSec
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes

LinkList.h File Reference

Go to the source code of this file.

Classes

class | ComAutoRelease
class | ComPtrList< T, NULLABLE >
class | List< T >
struct | List< T >::Node
class | List< T >::POSITION
class | MemDelete
struct | NoOp< T >
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Functions

Marker.cpp File Reference

#include "pch.h"
#include "Marker.h"

Go to the source code of this file.

Functions

IFACEMETHODIMP_ (ULONG) CMarker

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 92 of file Marker.cpp.

{
    ULONG cRef = InterlockedDecrement(&_cRef);
    if (cRef == 0)
    {
        delete this;
    }

    return cRef;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Marker.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

Marker.h File Reference

#include "StspDefs.h"

Go to the source code of this file.

Classes

class | CMarker

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

MediaBufferWrapper.cpp File Reference

#include "pch.h"
#include "MediaBufferWrapper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

MediaBufferWrapper.h File Reference

#include <StspNetwork.h>
#include <robuffer.h>
#include <windows.storage.streams.h>

Go to the source code of this file.

Classes

class | CMediaBufferWrapper

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

NetworkChannel.cpp File Reference

#include "pch.h"
#include "NetworkChannel.h"

Go to the source code of this file.

Classes

class | CSendOperationStatus

Namespaces

namespace | anonymous_namespace{NetworkChannel.cpp}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

NetworkChannel.h File Reference

#include "StspNetwork.h"

Go to the source code of this file.

Classes

class | CNetworkChannel

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

NetworkClient.cpp File Reference

#include "pch.h"
#include "NetworkClient.h"
#include "StspDefs.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

NetworkClient.h File Reference

#include "NetworkChannel.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkServer.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

NetworkServer.cpp File Reference

#include "pch.h"
#include "NetworkServer.h"
#include "StspDefs.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkServer.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

NetworkServer.h File Reference

#include "NetworkChannel.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/OpQueue.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes

OpQueue.h File Reference

#include "linklist.h"
#include "AsyncCB.h"

Go to the source code of this file.

Classes

class OpQueue< T, TOperation >
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/pch.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/pch.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

pch.h File Reference

#include <windows.h>
#include <mfidl.h>
#include <mfapi.h>
#include <mferror.h>
#include <assert.h>
#include <tchar.h>
#include <Strsafe.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
#include <windows.media.h>
#include <windows.media.capture.h>
#include <windows.media.mediaproperties.h>
#include <windows.networking.sockets.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl\ftm.h>
#include <wrl\event.h>
#include <wrl\wrappers\corewrappers.h>
#include "Trace.h"
#include <CritSec.h>
#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces | Defines | Enumerations | Functions | Variables

StspDefs.h File Reference

Go to the source code of this file.

Classes

struct | StspDescription
struct | StspOperationHeader
struct | StspSampleHeader
struct | StspStreamDescription

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication

Defines

#define | DECLSPEC_NOVTABLE __declspec(novtable)
#define | DECLSPEC_UUID(x) __declspec(uuid(x))

Enumerations

enum SourceState {
SourceState_Invalid, SourceState_Opening, SourceState_Starting, SourceState_Started,
SourceState_Stopped, SourceState_Shutdown
}
enum | StspNetworkType { StspNetworkType_IPv4, StspNetworkType_IPv6 }
enum StspOperation {
StspOperation_Unknown, StspOperation_ClientRequestDescription, StspOperation_ClientRequestStart, StspOperation_ClientRequestStop,
StspOperation_ServerDescription, StspOperation_ServerSample, StspOperation_ServerFormatChange, StspOperation_Last
}
enum StspSampleFlags {
StspSampleFlag_BottomFieldFirst = 1, StspSampleFlag_CleanPoint = 2, StspSampleFlag_DerivedFromTopField = 4, StspSampleFlag_Discontinuity = 8,
StspSampleFlag_Interlaced = 16, StspSampleFlag_RepeatFirstField = 32, StspSampleFlag_SingleField = 64
}

Functions

wchar_t const | __declspec (selectany) c_szStspScheme[] = "stsp:"
HRESULT | CreateMarker (MFSTREAMSINK_MARKER_TYPE eMarkerType, const PROPVARIANT *pvarMarkerValue, const PROPVARIANT *pvarContextValue, IMarker **ppMarker)
interface | DECLSPEC_UUID ("3AC82233-933C-43a9-AF3D-ADC94EABF406") DECLSPEC_NOVTABLE IMarker
interface | DECLSPEC_UUID ("09CFFBBF-67AC-4AD6-8463-9CF82CA3E52F") DECLSPEC_NOVTABLE IStspSinkInternal
void | FilterOutputMediaType (IMFMediaType *pSourceMediaType, IMFMediaType *pDestinationMediaType)
void | ValidateInputMediaType (REFGUID guidMajorType, REFGUID guidSubtype, IMFMediaType *pMediaType)

Variables

unsigned short const | c_wStspDefaultPort = 10010

Define Documentation

#define DECLSPEC_NOVTABLE __declspec(novtable)

Definition at line 14 of file StspDefs.h.

#define DECLSPEC_UUID ( x ) __declspec(uuid(x))

Definition at line 10 of file StspDefs.h.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces | Functions | Variables

StspMediaSink.cpp File Reference

#include "pch.h"
#include <InitGuid.h>
#include "StspMediaSink.h"
#include "StspStreamSink.h"
#include "StspMediaSinkProxy.h"

Go to the source code of this file.

Classes

class | SetConnectedFunc
class | ShutdownFunc
class | StartFunc
class | StopFunc

Namespaces

namespace | anonymous_namespace{StspMediaSink.cpp}

Functions

void | ConvertPropertiesToMediaType (_In_ IMediaEncodingProperties^mep, _Outptr_ IMFMediaType **ppMT)
template<class T , class TFunc >
HRESULT | ForEach (ComPtrList< T > &col, TFunc fn)
DWORD | GetStreamId (Windows::Media::Capture::MediaStreamType mediaStreamType)

Variables

const DWORD | c_cbReceiveBuffer = 8 * 1024
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSink.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspMediaSink.h File Reference

#include <CritSec.h>
#include <linklist.h>
#include <BaseAttributes.h>
#include <StspDefs.h>
#include <StspNetwork.h>

Go to the source code of this file.

Classes

class | CMediaSink

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspMediaSinkProxy.cpp File Reference

#include "pch.h"
#include "StspMediaSinkProxy.h"
#include "StspDefs.h"
#include "StspMediaSink.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspMediaSinkProxy.h File Reference

#include "StspNetwork.h"
#include "StspDefs.h"
#include <queue>

Go to the source code of this file.

Classes

interface | ISinkCallback
class | sealed
class | sealed
class | sealed::sealed

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Namespaces | Functions | Variables

StspMediaSource.cpp File Reference

#include "pch.h"
#include "StspMediaSource.h"
#include "StspMediaStream.h"
#include <IntSafe.h>

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{StspMediaSource.cpp}

Functions

_Acquires_lock_ (_critSec) HRESULT CMediaSource
_Releases_lock_ (_critSec) HRESULT CMediaSource
IFACEMETHODIMP_ (ULONG) CSourceOperation

Variables

const DWORD | c_cbMaxPacketSize = 1024 * 1024
const DWORD | c_cbReceiveBufferSize = 2 * 1024

Function Documentation

_Acquires_lock_ ( _critSec )

Definition at line 590 of file StspMediaSource.cpp.

{
    _critSec.Lock();
    return S_OK;
}

_Releases_lock_ ( _critSec )

Definition at line 597 of file StspMediaSource.cpp.

{
    _critSec.Unlock();
    return S_OK;
}

IFACEMETHODIMP_ ( ULONG )

Definition at line 171 of file StspMediaSource.cpp.

{
    long cRef = InterlockedDecrement(&_cRef);
    if (cRef == 0)
    {
        delete this;
    }
    return cRef;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSource.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspMediaSource.h File Reference

#include <CritSec.h>
#include <OpQueue.h>
#include <linklist.h>
#include <BaseAttributes.h>
#include <StspNetwork.h>
#include <StspDefs.h>

Go to the source code of this file.

Classes

class | CMediaSource
class | CSetRateOperation
class | CSourceOperation
class | CStartOperation

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Defines | Functions

StspMediaStream.cpp File Reference

#include "pch.h"
#include "StspMediaStream.h"
#include "StspMediaSource.h"

Go to the source code of this file.

Classes

class | CMediaStream::CSourceLock

Defines

#define | SET_SAMPLE_ATTRIBUTE(flag, mask, pSample, flagName)

Functions

IFACEMETHODIMP_ (ULONG) CMediaStream

Define Documentation

#define SET_SAMPLE_ATTRIBUTE | ( | flag,
 |  | mask,
 |  | pSample,
 |  | flagName
 | ) |
Value:
if ((StspSampleFlag_##flagName & mask) == StspSampleFlag_##flagName) \
{ \
    ThrowIfError(pSample->SetUINT32(MFSampleExtension_##flagName, (StspSampleFlag_##flagName & flag) == StspSampleFlag_##flagName)); \
}

Definition at line 15 of file StspMediaStream.cpp.

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 138 of file StspMediaStream.cpp.

{
    long cRef = InterlockedDecrement(&_cRef);
    if (cRef == 0)
    {
        delete this;
    }
    return cRef;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspMediaStream.h File Reference

#include <CritSec.h>
#include <linklist.h>
#include <StspDefs.h>

Go to the source code of this file.

Classes

class | CMediaStream

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces | Functions

StspNetwork.h File Reference

Go to the source code of this file.

Classes

class | abstract
interface | INetworkClient
interface | INetworkServer

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
namespace | Microsoft::Samples::SimpleCommunication::Network

Functions

HRESULT | CreateBufferPacket (_Outptr_ IBufferPacket **ppBufferPacket)
HRESULT | CreateBufferPacketFromMFSample (_In_ IMFSample *pSample, _Outptr_ IBufferPacket **ppBufferPacket)
HRESULT | CreateMediaBufferWrapper (_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)
HRESULT | CreateMediaBufferWrapper (DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper)
INetworkClient CreateNetworkClient ()
INetworkServer | CreateNetworkServer (unsigned short listeningPort)
interface | DECLSPEC_UUID ("3FEBFE65-E515-4448-8DB4-10D7DBC030A8") DECLSPEC_NOVTABLE IBufferEnumerator
interface | DECLSPEC_UUID ("D30E9A4E-31BD-484C-940D-0E5FF536036D") DECLSPEC_NOVTABLE IMediaBufferWrapper
interface | DECLSPEC_UUID ("E6D1193E-8B68-4526-885A-9C858613807D") DECLSPEC_NOVTABLE IBufferPacket
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Functions

StspSchemeHandler.cpp File Reference

#include "pch.h"
#include <InitGuid.h>
#include "StspSchemeHandler.h"
#include "StspMediaSource.h"
#include <wrl/module.h>

Go to the source code of this file.

Functions

ActivatableClass (CSchemeHandler)

Function Documentation

ActivatableClass ( CSchemeHandler )
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspSchemeHandler.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspSchemeHandler.h File Reference

Go to the source code of this file.

Classes

class | CSchemeHandler

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Defines | Functions

StspStreamSink.cpp File Reference

#include "pch.h"
#include "StspStreamSink.h"
#include "StspMediaSink.h"

Go to the source code of this file.

Defines

#define SET_SAMPLE_FLAG(dest, destMask, pSample, flagName)

Functions

IFACEMETHODIMP_ (ULONG) CStreamSink

Define Documentation

#define SET_SAMPLE_FLAG | ( | dest,
 |  | destMask,
 |  | pSample,
 |  | flagName
 | ) |
Value:
{ \
        UINT32 unValue; \
        if (SUCCEEDED(pSample->GetUINT32(MFSampleExtension_##flagName, &unValue))) \
        { \
            dest |= (unValue != FALSE) ? StspSampleFlag_##flagName : 0; \
            destMask |= StspSampleFlag_##flagName; \
        } \
    }

Definition at line 15 of file StspStreamSink.cpp.

Function Documentation

IFACEMETHODIMP_ ( ULONG )

Definition at line 112 of file StspStreamSink.cpp.

{
    long cRef = InterlockedDecrement(&_cRef);
    if (cRef == 0)
    {
        delete this;
    }
    return cRef;
}

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces

StspStreamSink.h File Reference

#include <CritSec.h>
#include <AsyncCB.h>
#include <linklist.h>
#include <StspNetwork.h>
#include <StspDefs.h>

Go to the source code of this file.

Classes

class | CStreamSink
class | CStreamSink::CAsyncOperation

Namespaces

namespace | Microsoft
namespace | Microsoft::Samples
namespace | Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Trace.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Functions | Variables

Trace.cpp File Reference

#include "pch.h"
#include "Trace.h"

Go to the source code of this file.

Functions

void | PrintAttributes (IMFAttributes *pAttributes)
void | PrintSampleInfo (IMFSample *pSample)
void | Trace (DWORD dwLevel, LPCWSTR pszFormat,...)
void | TraceError (LPCSTR pszFile, long nLine, LPCSTR pszFunc, const void *pThis, HRESULT hr)
void | TraceError (LPCSTR pszFile, long nLine, LPCSTR pszFunc, Object^pThis, HRESULT hr)

Variables

DWORD | g_dwLogLevel = TRACE_LEVEL_NORMAL

Function Documentation

void PrintAttributes ( IMFAttributes * pAttributes )

Definition at line 79 of file Trace.cpp.

{
    UINT32 cAttr;
    pAttributes->GetCount(&cAttr);
    Trace(TRACE_LEVEL_HIGH, L"No attributes %d\n", cAttr);

    for (UINT32 i = 0; i < cAttr; ++i)
    {
        const DWORD CHARS_IN_GUID = 39;
        PROPVARIANT var = {0};
        GUID gui;
        OLECHAR szAttrId[CHARS_IN_GUID];

        pAttributes->GetItemByIndex(i, &gui, &var);
        StringFromGUID2(gui, szAttrId, CHARS_IN_GUID);

        switch (var.vt)
        {
        case MF_ATTRIBUTE_UINT32:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %d\n", szAttrId, var.uintVal);
            break;
        case MF_ATTRIBUTE_UINT64:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %I64d\n", szAttrId, var.uhVal.QuadPart);
            break;
        case MF_ATTRIBUTE_DOUBLE:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %f\n", szAttrId, var.dblVal);
            break;
        case MF_ATTRIBUTE_GUID:
            OLECHAR szAttrVal[CHARS_IN_GUID];
            StringFromGUID2(*var.puuid, szAttrVal, CHARS_IN_GUID);
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %s\n", szAttrId, szAttrVal);
            break;
        case MF_ATTRIBUTE_BLOB:
            if (var.caub.cElems >= 8)
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s BLOB - %I64x\n", szAttrId, *(LONGLONG*)var.caub.pElems);
            }
            else if (var.caub.cElems > 0)
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s BLOB - %c\n", szAttrId, var.caub.pElems[0]);
            }
            else
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s empty blob\n", szAttrId, var.caub.pElems[0]);
            }
            break;
        case MF_ATTRIBUTE_STRING:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s %s\n", szAttrId, var.pwszVal);
            break;
        default:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s TYPE %hd\n", szAttrId, var.vt);
            break;
        }

        PropVariantClear(&var);
    }
}

void PrintSampleInfo ( IMFSample * pSample )

Definition at line 54 of file Trace.cpp.

{
    ComPtr<IMFMediaBuffer> spBuffer;
    pSample->GetBufferByIndex(0, &spBuffer);

    DWORD cbTotalLen;
    DWORD cbMaxLen;
    DWORD cbCurLen;
    LONGLONG llDur;
    LONGLONG llTs;
    pSample->GetTotalLength(&cbTotalLen);
    pSample->GetSampleDuration(&llDur);
    pSample->GetSampleTime(&llTs);

    Trace(TRACE_LEVEL_HIGH, L"Sample - Ts: %I64d Dur: %I64d Len: %d\n", llTs, llDur, cbTotalLen);
    BYTE *pByte;
    spBuffer->Lock(&pByte, &cbMaxLen, &cbCurLen);
    if (cbCurLen >= sizeof(LONGLONG))
    {
        Trace(TRACE_LEVEL_HIGH, L"Sample beginning - Ts: 0x%I64x\n", *(LONGLONG*)pByte);
    }

    PrintAttributes(pSample);
}

void Trace | ( | DWORD | dwLevel,
 |  | LPCWSTR | pszFormat,
 |  |  | ...
 | ) |  |

Definition at line 13 of file Trace.cpp.

{
    if (g_dwLogLevel > dwLevel)
    {
        return;
    }
    WCHAR szTextBuf[256];
    va_list args;
    va_start(args, pszFormat);

    StringCchVPrintf(szTextBuf, _countof(szTextBuf), pszFormat, args);

    OutputDebugString(szTextBuf);
}

void TraceError | ( | LPCSTR | pszFile,
 |  | long | nLine,
 |  | LPCSTR | pszFunc,
 |  | const void * | pThis,
 |  | HRESULT | hr
 | ) |  |

Definition at line 33 of file Trace.cpp.

{
    if (SUCCEEDED(hr))
    {
        return;
    }
    LPCSTR psz = pszFile + strlen(pszFile);
    for(;psz > pszFile; psz--)
    {
        if(*psz == '\\')
        {
            pszFile = psz+1;
            break;
        }
    }
    WCHAR szTextBuf[256];
    szTextBuf[0] = 0;
    StringCchPrintf(szTextBuf, _countof(szTextBuf), L"%S:%d (%S@%p) FAILED hr=%x\n", pszFile, nLine, pszFunc, pThis, hr);
    OutputDebugString(szTextBuf);
}

void TraceError | ( | LPCSTR | pszFile,
 |  | long | nLine,
 |  | LPCSTR | pszFunc,
 |  | Object^ | pThis,
 |  | HRESULT | hr
 | ) |  |

Definition at line 28 of file Trace.cpp.

{
    TraceError(pszFile, nLine, pszFunc, reinterpret_cast<IInspectable*>(pThis), hr);
}

Variable Documentation

DWORD g_dwLogLevel = TRACE_LEVEL_NORMAL

Definition at line 11 of file Trace.cpp.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Trace.h File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Defines | Enumerations | Functions | Variables

Trace.h File Reference

Go to the source code of this file.

Defines

#define | TRACE
#define | TRACEHR(hrVal)
#define | TRACEHR_RET(hrVal) {return hrVal;}

Enumerations

enum | { TRACE_LEVEL_LOW, TRACE_LEVEL_NORMAL, TRACE_LEVEL_HIGH }

Functions

void | PrintAttributes (IMFAttributes *pAttributes)
void | PrintSampleInfo (IMFSample *pSample)
void | Throw (HRESULT hr)
void | ThrowIfError (HRESULT hr)
void | Trace (DWORD dwLevel, LPCWSTR pszFormat,...)
void | TraceError (LPCSTR pszFile, long nLine, LPCSTR pszFunc, Object^pThis, HRESULT hr)
void | TraceError (LPCSTR pszFile, long nLine, LPCSTR pszFunc, const void *pThis, HRESULT hr)

Variables

DWORD | g_dwTraceLevel

Define Documentation

#define TRACE

Definition at line 61 of file Trace.h.

#define TRACEHR ( hrVal )

Definition at line 62 of file Trace.h.

#define TRACEHR_RET ( hrVal ) {return hrVal;}

Definition at line 63 of file Trace.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
TRACE_LEVEL_LOW
TRACE_LEVEL_NORMAL
TRACE_LEVEL_HIGH

Definition at line 10 of file Trace.h.

{
    TRACE_LEVEL_LOW,
    TRACE_LEVEL_NORMAL,
    TRACE_LEVEL_HIGH,
};

Function Documentation

void PrintAttributes ( IMFAttributes * pAttributes )

Definition at line 79 of file Trace.cpp.

{
    UINT32 cAttr;
    pAttributes->GetCount(&cAttr);
    Trace(TRACE_LEVEL_HIGH, L"No attributes %d\n", cAttr);

    for (UINT32 i = 0; i < cAttr; ++i)
    {
        const DWORD CHARS_IN_GUID = 39;
        PROPVARIANT var = {0};
        GUID gui;
        OLECHAR szAttrId[CHARS_IN_GUID];

        pAttributes->GetItemByIndex(i, &gui, &var);
        StringFromGUID2(gui, szAttrId, CHARS_IN_GUID);

        switch (var.vt)
        {
        case MF_ATTRIBUTE_UINT32:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %d\n", szAttrId, var.uintVal);
            break;
        case MF_ATTRIBUTE_UINT64:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %I64d\n", szAttrId, var.uhVal.QuadPart);
            break;
        case MF_ATTRIBUTE_DOUBLE:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %f\n", szAttrId, var.dblVal);
            break;
        case MF_ATTRIBUTE_GUID:
            OLECHAR szAttrVal[CHARS_IN_GUID];
            StringFromGUID2(*var.puuid, szAttrVal, CHARS_IN_GUID);
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s - %s\n", szAttrId, szAttrVal);
            break;
        case MF_ATTRIBUTE_BLOB:
            if (var.caub.cElems >= 8)
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s BLOB - %I64x\n", szAttrId, *(LONGLONG*)var.caub.pElems);
            }
            else if (var.caub.cElems > 0)
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s BLOB - %c\n", szAttrId, var.caub.pElems[0]);
            }
            else
            {
                Trace(TRACE_LEVEL_HIGH, L"Attr: %s empty blob\n", szAttrId, var.caub.pElems[0]);
            }
            break;
        case MF_ATTRIBUTE_STRING:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s %s\n", szAttrId, var.pwszVal);
            break;
        default:
            Trace(TRACE_LEVEL_HIGH, L"Attr: %s TYPE %hd\n", szAttrId, var.vt);
            break;
        }

        PropVariantClear(&var);
    }
}

void PrintSampleInfo ( IMFSample * pSample )

Definition at line 54 of file Trace.cpp.

{
    ComPtr<IMFMediaBuffer> spBuffer;
    pSample->GetBufferByIndex(0, &spBuffer);

    DWORD cbTotalLen;
    DWORD cbMaxLen;
    DWORD cbCurLen;
    LONGLONG llDur;
    LONGLONG llTs;
    pSample->GetTotalLength(&cbTotalLen);
    pSample->GetSampleDuration(&llDur);
    pSample->GetSampleTime(&llTs);

    Trace(TRACE_LEVEL_HIGH, L"Sample - Ts: %I64d Dur: %I64d Len: %d\n", llTs, llDur, cbTotalLen);
    BYTE *pByte;
    spBuffer->Lock(&pByte, &cbMaxLen, &cbCurLen);
    if (cbCurLen >= sizeof(LONGLONG))
    {
        Trace(TRACE_LEVEL_HIGH, L"Sample beginning - Ts: 0x%I64x\n", *(LONGLONG*)pByte);
    }

    PrintAttributes(pSample);
}

void Throw ( HRESULT hr ) [inline]

Definition at line 72 of file Trace.h.

{
    assert(FAILED(hr));
    throw ref new Exception(hr);
}

void ThrowIfError ( HRESULT hr ) [inline]

Definition at line 64 of file Trace.h.

{
    if (FAILED(hr))
    {
        throw ref new Exception(hr);
    }
}

void Trace | ( | DWORD | dwLevel,
 |  | LPCWSTR | pszFormat,
 |  |  | ...
 | ) |  |

Definition at line 13 of file Trace.cpp.

{
    if (g_dwLogLevel > dwLevel)
    {
        return;
    }
    WCHAR szTextBuf[256];
    va_list args;
    va_start(args, pszFormat);

    StringCchVPrintf(szTextBuf, _countof(szTextBuf), pszFormat, args);

    OutputDebugString(szTextBuf);
}

void TraceError | ( | LPCSTR | pszFile,
 |  | long | nLine,
 |  | LPCSTR | pszFunc,
 |  | Object^ | pThis,
 |  | HRESULT | hr
 | ) |  |

Definition at line 28 of file Trace.cpp.

{
    TraceError(pszFile, nLine, pszFunc, reinterpret_cast<IInspectable*>(pThis), hr);
}

void TraceError | ( | LPCSTR | pszFile,
 |  | long | nLine,
 |  | LPCSTR | pszFunc,
 |  | const void * | pThis,
 |  | HRESULT | hr
 | ) |  |

Definition at line 33 of file Trace.cpp.

{
    if (SUCCEEDED(hr))
    {
        return;
    }
    LPCSTR psz = pszFile + strlen(pszFile);
    for(;psz > pszFile; psz--)
    {
        if(*psz == '\\')
        {
            pszFile = psz+1;
            break;
        }
    }
    WCHAR szTextBuf[256];
    szTextBuf[0] = 0;
    StringCchPrintf(szTextBuf, _countof(szTextBuf), L"%S:%d (%S@%p) FAILED hr=%x\n", pszFile, nLine, pszFunc, pThis, hr);
    OutputDebugString(szTextBuf);
}

Variable Documentation

DWORD g_dwTraceLevel
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Validation.cpp File Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication
Classes | Namespaces | Functions | Variables

Validation.cpp File Reference

#include "pch.h"
#include "StspDefs.h"

Go to the source code of this file.

Classes

struct | AttributeValidationDescriptor
struct | MediaTypeValidationDescriptor

Namespaces

namespace | anonymous_namespace{Validation.cpp}

Functions

const
MediaTypeValidationDescriptor * 		FindMediaTypeDescriptor (REFGUID guidMajorType, REFGUID guidSubtype)
bool | IsAttributeValid (const MediaTypeValidationDescriptor *validationDescriptor, REFGUID guidKey, PROPVARIANT *pValue)
bool | ValidateBlob (PROPVARIANT *pValue)
template<VARTYPE vt>
bool | ValidateDataType (PROPVARIANT *pValue)

Variables

const AttributeValidationDescriptor | AACValidAttributes []
const AttributeValidationDescriptor | H264ValidAttributes []
const MediaTypeValidationDescriptor | ValidMediaTypes []
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/pch.cpp File Reference

  • SimpleCommunication
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/pch.h File Reference

  • SimpleCommunication
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/SampleConfiguration.cpp File Reference

  • SimpleCommunication
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/SampleConfiguration.h File Reference

  • SimpleCommunication
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario1_LowLatency.xaml.cpp File Reference

  • SimpleCommunication
  • cpp
Enumerations

Scenario1_LowLatency.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_LowLatency.xaml.h"

Go to the source code of this file.

Enumerations

enum Action {
previewButtonClicked, localClientButtonClicked, previewSetupCompleted, recordingStarted,
latencyModeToggled
}

Enumeration Type Documentation

enum Action
Enumerator:
previewButtonClicked
localClientButtonClicked
previewSetupCompleted
recordingStarted
latencyModeToggled

Definition at line 30 of file Scenario1_LowLatency.xaml.cpp.

{
    previewButtonClicked,
    localClientButtonClicked,
    previewSetupCompleted,
    recordingStarted,
    latencyModeToggled,
};

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario1_LowLatency.xaml.h File Reference

  • SimpleCommunication
  • cpp
Classes | Namespaces

Scenario1_LowLatency.xaml.h File Reference

#include "Scenario1_LowLatency.g.h"
#include "Utils.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
struct | sealed::StreamFilteringCriteria

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario2_VideoChat.xaml.cpp File Reference

  • SimpleCommunication
  • cpp

Scenario2_VideoChat.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_VideoChat.xaml.h"
#include <wrl\wrappers\corewrappers.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario2_VideoChat.xaml.h File Reference

  • SimpleCommunication
  • cpp
Classes | Namespaces

Scenario2_VideoChat.xaml.h File Reference

#include "Utils.h"
#include "Scenario2_VideoChat.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Utils.cpp File Reference

  • SimpleCommunication
  • cpp

Utils.cpp File Reference

#include "pch.h"
#include "Utils.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Utils.h File Reference

  • SimpleCommunication
  • cpp
Classes | Namespaces | Functions

Utils.h File Reference

#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | CaptureFailedEventArgs
class | SdkSample
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Functions

delegate void | CaptureFailedHandler (CaptureDevice^sender, CaptureFailedEventArgs^errorEventArgs)
delegate void | IncomingConnectionEventHandler (Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^args)
delegate bool | VideoSettingsFilter (Windows::Media::MediaProperties::IMediaEncodingProperties^, unsigned int)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/CaptureDevice.cs File Reference

  • SimpleCommunication
  • cs
Classes | Namespaces

CaptureDevice.cs File Reference

Go to the source code of this file.

Classes

class | CaptureDevice

Namespaces

namespace | SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/SampleConfiguration.cs File Reference

  • SimpleCommunication
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/Scenario1_LowLatency.xaml.cs File Reference

  • SimpleCommunication
  • cs
Classes | Namespaces

Scenario1_LowLatency.xaml.cs File Reference

Go to the source code of this file.

Classes

class | LowLatency
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/Scenario2_VideoChat.xaml.cs File Reference

  • SimpleCommunication
  • cs
Classes | Namespaces

Scenario2_VideoChat.xaml.cs File Reference

Go to the source code of this file.

Classes

class | VideoChat
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SimpleCommunication
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/Helpers.cs File Reference

  • SimpleImaging
  • cs
Classes | Namespaces

Helpers.cs File Reference

Go to the source code of this file.

Classes

class | Helpers
Contains helper functionality, including handling/converting EXIF orientation values.

Namespaces

namespace | SimpleImaging
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/SampleConfiguration.cs File Reference

  • SimpleImaging
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/Scenario1.xaml.cs File Reference

  • SimpleImaging
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
Code-behind for Scenario 1, which demonstrates image properties with FileProperties. More...

Namespaces

namespace | SimpleImaging
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/Scenario2.xaml.cs File Reference

  • SimpleImaging
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
Code-behind for Scenario 2, which demonstrates image editing using BitmapDecoder and BitmapEncoder. More...

Namespaces

namespace | SimpleImaging
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/pch.cpp File Reference

  • SimpleInk
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/pch.h File Reference

  • SimpleInk
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/RecognizerHelper.cpp File Reference

  • SimpleInk
  • cpp
Namespaces

RecognizerHelper.cpp File Reference

#include "pch.h"
#include "RecognizerHelper.h"

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/RecognizerHelper.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

RecognizerHelper.h File Reference

#include <map>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/SampleConfiguration.cpp File Reference

  • SimpleInk
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/SampleConfiguration.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | HelperFunctions
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario1.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario1.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario10.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario10.xaml.cpp File Reference

#include "pch.h"
#include "Scenario10.xaml.h"
#include <robuffer.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario10.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario10.xaml.h File Reference

#include "Scenario10.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario11.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario11.xaml.cpp File Reference

#include "pch.h"
#include "Scenario11.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario11.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario11.xaml.h File Reference

#include "Scenario11.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario12.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario12.xaml.cpp File Reference

#include "pch.h"
#include "Scenario12.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario12.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario12.xaml.h File Reference

#include "Scenario12.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario2.xaml.cpp File Reference

  • SimpleInk
  • cpp
Defines

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include <WindowsNumerics.h>
#include <math.h>

Go to the source code of this file.

Defines

#define _USE_MATH_DEFINES

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 16 of file Scenario2.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario2.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario3.xaml.cpp File Reference

  • SimpleInk
  • cpp
Defines

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"
#include <WindowsNumerics.h>
#include <math.h>
#include <ppltasks.h>

Go to the source code of this file.

Defines

#define _USE_MATH_DEFINES

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 16 of file Scenario3.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario3.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario4.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"
#include "RecognizerHelper.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario4.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario5.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario5.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario5.xaml.h File Reference

#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario6.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario6.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario6.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario6.xaml.h File Reference

#include "Scenario6.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario7.xaml.cpp File Reference

  • SimpleInk
  • cpp
Defines

Scenario7.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7.xaml.h"
#include <WindowsNumerics.h>
#include <math.h>

Go to the source code of this file.

Defines

#define _USE_MATH_DEFINES

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 16 of file Scenario7.xaml.cpp.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario7.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario7.xaml.h File Reference

#include "Scenario7.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario8.xaml.cpp File Reference

  • SimpleInk
  • cpp

Scenario8.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8.xaml.h"
#include <math.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario8.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario8.xaml.h File Reference

#include "Scenario8.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario9.xaml.cpp File Reference

  • SimpleInk
  • cpp
Functions

Scenario9.xaml.cpp File Reference

#include "pch.h"
#include "Scenario9.xaml.h"
#include <WindowsNumerics.h>

Go to the source code of this file.

Functions

DateTime GetCurrentDateTime ()

Function Documentation

DateTime GetCurrentDateTime ( )

Definition at line 82 of file Scenario9.xaml.cpp.

{
    FILETIME fileTime;
    GetSystemTimeAsFileTime(&fileTime);
    return DateTime{ (static_cast<uint64_t>(fileTime.dwHighDateTime) << 32) | fileTime.dwLowDateTime };
}

Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario9.xaml.h File Reference

  • SimpleInk
  • cpp
Classes | Namespaces

Scenario9.xaml.h File Reference

#include "Scenario9.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/RecognizerHelper.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

RecognizerHelper.cs File Reference

Go to the source code of this file.

Classes

class | RecognizerHelper

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/SampleConfiguration.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | HelperFunctions
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MoreSymbols
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario1.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario10.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario10.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario11.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario11.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario11
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario12.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario12.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario12
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario2.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CalligraphicPen
class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario3.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario4.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario5.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario6.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario7.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario7.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario8.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario9.xaml.cs File Reference

  • SimpleInk
  • cs
Classes | Namespaces

Scenario9.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/pch.cpp File Reference

  • SimpleOrientationSensor
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/pch.h File Reference

  • SimpleOrientationSensor
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/SampleConfiguration.cpp File Reference

  • SimpleOrientationSensor
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/SampleConfiguration.h File Reference

  • SimpleOrientationSensor
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp File Reference

  • SimpleOrientationSensor
  • cpp

Scenario1_DataEvents.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DataEvents.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/Scenario1_DataEvents.xaml.h File Reference

  • SimpleOrientationSensor
  • cpp
Classes | Namespaces

Scenario1_DataEvents.xaml.h File Reference

#include "pch.h"
#include "Scenario1_DataEvents.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.cpp File Reference

  • SimpleOrientationSensor
  • cpp

Scenario2_Polling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Polling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.h File Reference

  • SimpleOrientationSensor
  • cpp
Classes | Namespaces

Scenario2_Polling.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cs/SampleConfiguration.cs File Reference

  • SimpleOrientationSensor
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cs/Scenario1_DataEvents.xaml.cs File Reference

  • SimpleOrientationSensor
  • cs
Classes | Namespaces

Scenario1_DataEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_DataEvents

Namespaces

namespace | SimpleOrientationCS
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cs/Scenario2_Polling.xaml.cs File Reference

  • SimpleOrientationSensor
  • cs
Classes | Namespaces

Scenario2_Polling.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Polling

Namespaces

namespace | SimpleOrientationCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/ChallengeResponseAlgorithm.cpp File Reference

  • SmartCard
  • cpp

ChallengeResponseAlgorithm.cpp File Reference

#include "pch.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/ChallengeResponseAlgorithm.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

ChallengeResponseAlgorithm.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/pch.cpp File Reference

  • SmartCard
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/pch.h File Reference

  • SmartCard
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/SampleConfiguration.cpp File Reference

  • SmartCard
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/SampleConfiguration.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces | Defines

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::SmartCardSample

Defines

#define | ADMIN_KEY_LENGTH_IN_BYTES 24

Define Documentation

#define ADMIN_KEY_LENGTH_IN_BYTES 24

Definition at line 6 of file SampleConfiguration.h.

Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario1_CreateTPMVSC.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_CreateTPMVSC.xaml.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario1_CreateTPMVSC.xaml.h File Reference

#include "Scenario1_CreateTPMVSC.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario2_ChangePin.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario2_ChangePin.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ChangePin.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario2_ChangePin.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario2_ChangePin.xaml.h File Reference

#include "Scenario2_ChangePin.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario3_ResetPin.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario3_ResetPin.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ResetPin.xaml.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario3_ResetPin.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario3_ResetPin.xaml.h File Reference

#include "Scenario3_ResetPin.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario4_ChangeAdminKey.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_ChangeAdminKey.xaml.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario4_ChangeAdminKey.xaml.h File Reference

#include "Scenario4_ChangeAdminKey.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario5_VerifyResponse.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario5_VerifyResponse.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_VerifyResponse.xaml.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario5_VerifyResponse.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario5_VerifyResponse.xaml.h File Reference

#include "Scenario5_VerifyResponse.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario6_DeleteTPMVSC.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_DeleteTPMVSC.xaml.h"
#include "ChallengeResponseAlgorithm.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario6_DeleteTPMVSC.xaml.h File Reference

#include "Scenario6_DeleteTPMVSC.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario7_ListSmartCards.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario7_ListSmartCards.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_ListSmartCards.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario7_ListSmartCards.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario7_ListSmartCards.xaml.h File Reference

#include "Scenario7_ListSmartCards.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario8_Transmit.xaml.cpp File Reference

  • SmartCard
  • cpp

Scenario8_Transmit.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8_Transmit.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario8_Transmit.xaml.h File Reference

  • SmartCard
  • cpp
Classes | Namespaces

Scenario8_Transmit.xaml.h File Reference

#include "Scenario8_Transmit.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/pch.cpp File Reference

  • SmartCard
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/pch.h File Reference

  • SmartCard
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.SmartCards.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Security.Cryptography.Core.h"
#include "SmartCardHelpers.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Project.idl File Reference

  • SmartCard
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_ProvisionTPM
runtimeclass | Scenario2_ChangePIN
runtimeclass | Scenario3_ResetPIN
runtimeclass | Scenario4_ChangeAdminKey
runtimeclass | Scenario5_VerifyResponse
runtimeclass | Scenario6_DeleteTPM
runtimeclass | Scenario7_ListAllCards
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/SampleConfiguration.cpp File Reference

  • SmartCard
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/SampleConfiguration.h File Reference

  • SmartCard
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario1_ProvisionTPM.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces | Functions

Scenario1_ProvisionTPM.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario1_ProvisionTPM.h"
#include "Scenario1_ProvisionTPM.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation

Functions

SmartCardPinCharacterPolicyOption | ParsePinPolicyOption (hstring const &value)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario1_ProvisionTPM.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario1_ProvisionTPM.h File Reference

#include <string>
#include "Scenario1_ProvisionTPM.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ProvisionTPM
struct | Scenario1_ProvisionTPM

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario2_ChangePIN.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario2_ChangePIN.cpp File Reference

#include "pch.h"
#include "Scenario2_ChangePIN.h"
#include "Scenario2_ChangePIN.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario2_ChangePIN.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario2_ChangePIN.h File Reference

#include <string>
#include "SampleConfiguration.h"
#include "Scenario2_ChangePIN.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_ChangePIN
struct | Scenario2_ChangePIN

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario3_ResetPIN.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario3_ResetPIN.cpp File Reference

#include "pch.h"
#include "Scenario3_ResetPIN.h"
#include "Scenario3_ResetPIN.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario3_ResetPIN.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario3_ResetPIN.h File Reference

#include "Scenario3_ResetPIN.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_ResetPIN
struct | Scenario3_ResetPIN

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario4_ChangeAdminKey.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario4_ChangeAdminKey.cpp File Reference

#include "pch.h"
#include "Scenario4_ChangeAdminKey.h"
#include "Scenario4_ChangeAdminKey.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario4_ChangeAdminKey.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario4_ChangeAdminKey.h File Reference

#include "Scenario4_ChangeAdminKey.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_ChangeAdminKey
struct | Scenario4_ChangeAdminKey

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario5_VerifyResponse.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario5_VerifyResponse.cpp File Reference

#include "pch.h"
#include "Scenario5_VerifyResponse.h"
#include "Scenario5_VerifyResponse.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario5_VerifyResponse.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario5_VerifyResponse.h File Reference

#include "Scenario5_VerifyResponse.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_VerifyResponse
struct | Scenario5_VerifyResponse

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario6_DeleteTPM.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario6_DeleteTPM.cpp File Reference

#include "pch.h"
#include "Scenario6_DeleteTPM.h"
#include "Scenario6_DeleteTPM.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario6_DeleteTPM.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario6_DeleteTPM.h File Reference

#include "Scenario6_DeleteTPM.g.h"

Go to the source code of this file.

Classes

struct | Scenario6_DeleteTPM
struct | Scenario6_DeleteTPM

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario7_ListAllCards.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario7_ListAllCards.cpp File Reference

#include "pch.h"
#include "Scenario7_ListAllCards.h"
#include "Scenario7_ListAllCards.g.cpp"
#include "SmartCardListItem.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario7_ListAllCards.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario7_ListAllCards.h File Reference

#include "Scenario7_ListAllCards.g.h"
#include "SmartCardListItem.g.h"

Go to the source code of this file.

Classes

struct | Scenario7_ListAllCards
struct | SmartCardListItem
struct | Scenario7_ListAllCards
struct | SmartCardListItem

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario8_TransmitAPDU.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces

Scenario8_TransmitAPDU.cpp File Reference

#include "pch.h"
#include "Scenario8_TransmitAPDU.h"
#include "Scenario8_TransmitAPDU.g.cpp"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario8_TransmitAPDU.h File Reference

  • SmartCard
  • cppwinrt
Classes | Namespaces

Scenario8_TransmitAPDU.h File Reference

#include "Scenario8_TransmitAPDU.g.h"

Go to the source code of this file.

Classes

struct | Scenario8_TransmitAPDU
struct | Scenario8_TransmitAPDU

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/SmartCardHelpers.cpp File Reference

  • SmartCard
  • cppwinrt
Namespaces | Functions | Variables

SmartCardHelpers.cpp File Reference

#include "pch.h"
#include "SmartCardHelpers.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

IBuffer | CalculateChallengeResponse (IBuffer const &challenge, IBuffer const &adminKey)
IBuffer | GetAdminKey ()
IAsyncOperation< SmartCard > | GetSmartCardAsync ()
hstring | GetSmartCardReaderDeviceId ()
void | SetAdminKey (IBuffer const &buffer)
void | SetSmartCardReaderDeviceId (hstring const &id)
bool | ValidateTPMSmartCard ()

Variables

IBuffer | g_adminKey
hstring | g_smartCardReaderDeviceId
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/SmartCardHelpers.h File Reference

  • SmartCard
  • cppwinrt
Namespaces | Functions | Variables

SmartCardHelpers.h File Reference

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

Windows::Storage::Streams::IBuffer | CalculateChallengeResponse (Windows::Storage::Streams::IBuffer const &challenge, Windows::Storage::Streams::IBuffer const &adminKey)
IBuffer | GetAdminKey ()
IAsyncOperation< SmartCard > | GetSmartCardAsync ()
hstring | GetSmartCardReaderDeviceId ()
void | SetAdminKey (winrt::Windows::Storage::Streams::IBuffer const &buffer)
void | SetSmartCardReaderDeviceId (winrt::hstring const &id)
bool | ValidateTPMSmartCard ()

Variables

const uint32_t | ADMIN_KEY_LENGTH_IN_BYTES = 24
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/ChallengeResponseAlgorithm.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

ChallengeResponseAlgorithm.cs File Reference

Go to the source code of this file.

Classes

class | ChallengeResponseAlgorithm

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/SampleConfiguration.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario1_ProvisionTPM.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario1_ProvisionTPM.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ProvisionTPM

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario2_ChangePIN.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario2_ChangePIN.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ChangePIN

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario3_ResetPIN.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario3_ResetPIN.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ResetPIN

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario4_ChangeAdminKey.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario4_ChangeAdminKey.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ChangeAdminKey

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario5_VerifyResponse.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario5_VerifyResponse.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_VerifyResponse

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario6_DeleteTPM.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario6_DeleteTPM.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_DeleteTPM

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario7_ListAllCards.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario7_ListAllCards.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_ListAllCards
class | SmartCardListItem

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario8_TransmitAPDU.xaml.cs File Reference

  • SmartCard
  • cs
Classes | Namespaces

Scenario8_TransmitAPDU.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_TransmitAPDU

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsBackgroundTask/SmsBackgroundTask.cs File Reference

  • SmsSendAndReceive
  • cs
  • SmsBackgroundTask
Classes | Namespaces

SmsBackgroundTask.cs File Reference

Go to the source code of this file.

Classes

class | SampleSmsBackgroundTask

Namespaces

namespace | SmsBackgroundTask
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsBackgroundTask/Properties/AssemblyInfo.cs File Reference

  • SmsSendAndReceive
  • cs
  • SmsBackgroundTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsSendAndReceive/RegisterWithBackgroundTask.xaml.cs File Reference

  • SmsSendAndReceive
  • cs
  • SmsSendAndReceive
Classes | Namespaces

RegisterWithBackgroundTask.xaml.cs File Reference

Go to the source code of this file.

Classes

class | RegisterWithBackgroundTask
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SmsSendAndReceive
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsSendAndReceive/SampleConfiguration.cs File Reference

  • SmsSendAndReceive
  • cs
  • SmsSendAndReceive
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsSendAndReceive/SendTextMessage.xaml.cs File Reference

  • SmsSendAndReceive
  • cs
  • SmsSendAndReceive
Classes | Namespaces

SendTextMessage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SendTextMessage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SmsSendAndReceive
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/Server/SampleConfiguration.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • Server
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/Server/Scenario1_Send.xaml.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • Server
Classes | Namespaces

Scenario1_Send.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Send

Namespaces

namespace | StreamSocketListenerServer
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/SocketActivityTask.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityBackgroundTask
Classes | Namespaces

SocketActivityTask.cs File Reference

Go to the source code of this file.

Classes

class | SocketActivityTask

Namespaces

namespace | SocketActivityBackgroundTask
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/Properties/AssemblyInfo.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityBackgroundTask
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityStreamSocket/SampleConfiguration.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityStreamSocket
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityStreamSocket/Scenario1_Connect.xaml.cs File Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityStreamSocket
Classes | Namespaces

Scenario1_Connect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Connect

Namespaces

namespace | SocketActivityStreamSocket
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/AppView.cpp File Reference

  • SpatialInteractionSource
  • cpp
Functions

AppView.cpp File Reference

#include "pch.h"
#include "AppView.h"
#include <ppltasks.h>

Go to the source code of this file.

Functions

int main (Platform::Array< Platform::String^>^)

Function Documentation

int main ( Platform::Array< Platform::String^>^ )

Definition at line 19 of file AppView.cpp.

{
    AppViewSource^ appViewSource = ref new ::AppViewSource();
    CoreApplication::Run(appViewSource);
    return 0;
}

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/AppView.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces

AppView.h File Reference

#include "Common\DeviceResources.h"
#include "HolographicPaintMain.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/DPadHelper.cpp File Reference

  • SpatialInteractionSource
  • cpp

DPadHelper.cpp File Reference

#include "pch.h"
#include "DPadHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/DPadHelper.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces | Enumerations

DPadHelper.h File Reference

Go to the source code of this file.

Classes

class | IDPadHelper
class | ThumbstickDPadHelper
class | TouchpadDPadHelper

Namespaces

namespace | HolographicPaint

Enumerations

enum DPadAction {
None, Left, Right, Top,
Bottom
}
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HandHandler.cpp File Reference

  • SpatialInteractionSource
  • cpp

HandHandler.cpp File Reference

#include "pch.h"
#include "HandHandler.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HandHandler.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces

HandHandler.h File Reference

#include "SourceHandler.h"

Go to the source code of this file.

Classes

class | HandHandler

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HolographicPaintMain.cpp File Reference

  • SpatialInteractionSource
  • cpp

HolographicPaintMain.cpp File Reference

#include "pch.h"
#include "HolographicPaintMain.h"
#include "Common\DirectXHelper.h"
#include <windows.graphics.directx.direct3d11.interop.h>
#include <Collection.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HolographicPaintMain.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces

HolographicPaintMain.h File Reference

#include "Common\DeviceResources.h"
#include "Common\StepTimer.h"
#include "Content\RenderingHelper.h"
#include "Content\Stroke.h"
#include "Content\RenderingInterfaces.h"
#include "Content\Tool.h"
#include "Content\ToolCarousel.h"
#include "Content\Whiteboard.h"
#include "SourceHandler.h"
#include "DPadHelper.h"

Go to the source code of this file.

Classes

class | HolographicPaintMain

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/pch.cpp File Reference

  • SpatialInteractionSource
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/pch.h File Reference

  • SpatialInteractionSource
  • cpp
Defines | Typedefs

pch.h File Reference

#include <agile.h>
#include <array>
#include <d2d1_2.h>
#include <d3d11_4.h>
#include <DirectXColors.h>
#include <DirectXCollision.h>
#include <dwrite_2.h>
#include <map>
#include <mutex>
#include <wincodec.h>
#include <WindowsNumerics.h>
#include <vector>
#include <memory>
#include <wrl.h>

Go to the source code of this file.

Defines

#define | _USE_MATH_DEFINES

Typedefs

typedef unsigned int | VertexIndex_t

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 3 of file pch.h.

Typedef Documentation

typedef unsigned int VertexIndex_t

Definition at line 22 of file pch.h.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SourceHandler.cpp File Reference

  • SpatialInteractionSource
  • cpp

SourceHandler.cpp File Reference

#include "pch.h"
#include "SourceHandler.h"
#include "SpatialControllerHandler.h"
#include "HandHandler.h"
#include "..\Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SourceHandler.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces | Enumerations | Variables

SourceHandler.h File Reference

#include "Content\Stroke.h"
#include "Content\RenderingInterfaces.h"
#include "Content\Tool.h"
#include "Content\Whiteboard.h"
#include "DPadHelper.h"

Go to the source code of this file.

Classes

class | SourceHandler
struct | SourceHandler::PositionInformation

Namespaces

namespace | HolographicPaint

Enumerations

enum | ApplicationMode { Drawing, ChooseTool }
enum | HandAssignment { Unknown, LeftHand, RightHand }

Variables

constexpr unsigned int | AnyHandSourceId = static_cast<unsigned int>(-2)
constexpr float | DefaultControllerScale = .05f
constexpr unsigned int | NoSourceId = static_cast<unsigned int>(-1)
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SpatialControllerHandler.cpp File Reference

  • SpatialInteractionSource
  • cpp

SpatialControllerHandler.cpp File Reference

#include "pch.h"
#include "SpatialControllerHandler.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SpatialControllerHandler.h File Reference

  • SpatialInteractionSource
  • cpp
Classes | Namespaces

SpatialControllerHandler.h File Reference

#include "SourceHandler.h"

Go to the source code of this file.

Classes

class | SpatialControllerHandler

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/CameraResources.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Common

CameraResources.cpp File Reference

#include "pch.h"
#include "CameraResources.h"
#include "Common\DirectXHelper.h"
#include "DeviceResources.h"
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/CameraResources.h File Reference

  • SpatialInteractionSource
  • cpp
  • Common
Classes | Namespaces | Functions

CameraResources.h File Reference

Go to the source code of this file.

Classes

class | CameraResources
struct | ViewProjectionConstantBuffer

Namespaces

namespace | DX

Functions

static_assert ((sizeof(ViewProjectionConstantBuffer)%(sizeof(float)*4))==0,"ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/DeviceResources.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Common

DeviceResources.cpp File Reference

#include "pch.h"
#include "DeviceResources.h"
#include "DirectXHelper.h"
#include <Collection.h>
#include <windows.graphics.directx.direct3d11.interop.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/DeviceResources.h File Reference

  • SpatialInteractionSource
  • cpp
  • Common
Classes | Namespaces

DeviceResources.h File Reference

#include "CameraResources.h"

Go to the source code of this file.

Classes

class | DeviceResources

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/DirectXHelper.h File Reference

  • SpatialInteractionSource
  • cpp
  • Common
Namespaces | Functions

DirectXHelper.h File Reference

#include <ppltasks.h>

Go to the source code of this file.

Namespaces

namespace | DX

Functions

float | ConvertDipsToPixels (float dips, float dpi)
DirectX::XMFLOAT4 | GetDXColor (Windows::UI::Color color)
DXGI_FORMAT | GetDxgiFormat ()
DirectX::XMVECTOR | GetQuaternionVectorFromRay (Windows::Foundation::Numerics::float3 forward, Windows::Foundation::Numerics::float3 up)
Concurrency::task< std::vector
< byte > > 		ReadDataAsync (const std::wstring &filename)
void | ThrowIfFailed (HRESULT hr)
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/StepTimer.h File Reference

  • SpatialInteractionSource
  • cpp
  • Common
Classes | Namespaces

StepTimer.h File Reference

Go to the source code of this file.

Classes

class | StepTimer

Namespaces

namespace | DX
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/RenderingHelper.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Content

RenderingHelper.cpp File Reference

#include "pch.h"
#include "RenderingHelper.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/RenderingHelper.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces

RenderingHelper.h File Reference

#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
#include "SourceHandler.h"
#include "RenderingInterfaces.h"

Go to the source code of this file.

Classes

class | RenderingHelper

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/RenderingInterfaces.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Namespaces

RenderingInterfaces.h File Reference

#include "Common\DeviceResources.h"
#include "ShaderStructures.h"

Go to the source code of this file.

Namespaces

namespace HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/ShaderStructures.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces | Functions

ShaderStructures.h File Reference

Go to the source code of this file.

Classes

struct | ModelConstantBuffer
struct | VertexPosition

Namespaces

namespace | HolographicPaint

Functions

static_assert ((sizeof(ModelConstantBuffer)%(sizeof(float)*4))==0,"Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).")
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Stroke.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Content

Stroke.cpp File Reference

#include "pch.h"
#include "stroke.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Stroke.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces

Stroke.h File Reference

#include "Common\DeviceResources.h"
#include "ShaderStructures.h"
#include "RenderingInterfaces.h"

Go to the source code of this file.

Classes

class | Stroke
struct | Stroke::Square

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Tool.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Content

Tool.cpp File Reference

#include "pch.h"
#include "Tool.h"
#include "Common\DirectXHelper.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Tool.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces

Tool.h File Reference

#include "Common\DeviceResources.h"
#include "ShaderStructures.h"
#include "RenderingInterfaces.h"

Go to the source code of this file.

Classes

class | ClearTool
class | Tool

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/ToolCarousel.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Content

ToolCarousel.cpp File Reference

#include "pch.h"
#include "ToolCarousel.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/ToolCarousel.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces | Enumerations

ToolCarousel.h File Reference

#include "Tool.h"
#include "..\Common\StepTimer.h"

Go to the source code of this file.

Classes

class | ToolCarousel

Namespaces

namespace | HolographicPaint

Enumerations

enum | RotationDirection { RotateLeft = -1, RotateRight = 1 }
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Whiteboard.cpp File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Variables

Whiteboard.cpp File Reference

#include "pch.h"
#include "Whiteboard.h"
#include "..\Common\DirectXHelper.h"

Go to the source code of this file.

Variables

const float WhiteboardDepth = .005f

Variable Documentation

const float WhiteboardDepth = .005f

Definition at line 10 of file Whiteboard.cpp.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Whiteboard.h File Reference

  • SpatialInteractionSource
  • cpp
  • Content
Classes | Namespaces

Whiteboard.h File Reference

#include "RenderingInterfaces.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | HolographicPaint
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/AudioFileReader.cpp File Reference

  • SpatialSound
  • cpp

AudioFileReader.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/AudioFileReader.h File Reference

  • SpatialSound
  • cpp
Classes

AudioFileReader.h File Reference

Go to the source code of this file.

Classes

class AudioFileReader
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CardioidSound.cpp File Reference

  • SpatialSound
  • cpp

CardioidSound.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CardioidSound.h File Reference

  • SpatialSound
  • cpp
Classes

CardioidSound.h File Reference

Go to the source code of this file.

Classes

class CardioidSound
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CustomDecay.cpp File Reference

  • SpatialSound
  • cpp

CustomDecay.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CustomDecay.h File Reference

  • SpatialSound
  • cpp
Classes

CustomDecay.h File Reference

Go to the source code of this file.

Classes

class CustomDecaySound
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/OmnidirectionalSound.cpp File Reference

  • SpatialSound
  • cpp

OmnidirectionalSound.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/OmnidirectionalSound.h File Reference

  • SpatialSound
  • cpp
Classes

OmnidirectionalSound.h File Reference

Go to the source code of this file.

Classes

class OmnidirectionalSound
Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/pch.cpp File Reference

  • SpatialSound
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/pch.h File Reference

  • SpatialSound
  • cpp
Defines

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <XAudio2.h>
#include <xapo.h>
#include <hrtfapoapi.h>
#include <DirectXMath.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <strsafe.h>
#include "AudioFileReader.h"
#include "XAudio2Helpers.h"
#include "App.xaml.h"
#include "OmnidirectionalSound.h"
#include "CardioidSound.h"
#include "CustomDecay.h"

Go to the source code of this file.

Defines

#define HRTF_2PI 6.283185307f

Define Documentation

#define HRTF_2PI 6.283185307f

Definition at line 43 of file pch.h.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Resource.h File Reference

  • SpatialSound
  • cpp

Resource.h File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/SampleConfiguration.cpp File Reference

  • SpatialSound
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/SampleConfiguration.h File Reference

  • SpatialSound
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.cpp File Reference

  • SpatialSound
  • cpp

Scenario1_OmnidirectionalSound.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OmnidirectionalSound.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.h File Reference

  • SpatialSound
  • cpp
Classes | Namespaces

Scenario1_OmnidirectionalSound.xaml.h File Reference

#include "Scenario1_OmnidirectionalSound.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario2_CardioidSound.xaml.cpp File Reference

  • SpatialSound
  • cpp

Scenario2_CardioidSound.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_CardioidSound.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario2_CardioidSound.xaml.h File Reference

  • SpatialSound
  • cpp
Classes | Namespaces | Enumerations

Scenario2_CardioidSound.xaml.h File Reference

#include "Scenario2_CardioidSound.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum | PlayState { Stopped = 0, Playing }

Enumeration Type Documentation

enum PlayState
Enumerator:
Stopped
Playing

Definition at line 18 of file Scenario2_CardioidSound.xaml.h.

{ Stopped = 0, Playing };

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario3_CustomDecay.xaml.cpp File Reference

  • SpatialSound
  • cpp

Scenario3_CustomDecay.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomDecay.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario3_CustomDecay.xaml.h File Reference

  • SpatialSound
  • cpp
Classes | Namespaces

Scenario3_CustomDecay.xaml.h File Reference

#include "Scenario3_CustomDecay.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/XAudio2Helpers.h File Reference

  • SpatialSound
  • cpp

XAudio2Helpers.h File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

AudioCapturePermissions.cpp File Reference

#include "pch.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

AudioCapturePermissions.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/pch.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/pch.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousDictation.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_ContinuousDictation.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_ContinuousDictation.xaml.h File Reference

#include "Scenario_ContinuousDictation.g.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousRecognitionListGrammar.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_ContinuousRecognitionListGrammar.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_ContinuousRecognitionListGrammar.xaml.h File Reference

#include "Scenario_ContinuousRecognitionListGrammar.g.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_ContinuousRecognitionSRGSGrammar.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_ContinuousRecognitionSRGSGrammar.xaml.h File Reference

#include "Scenario_ContinuousRecognitionSRGSGrammar.g.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ListConstraint.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_ListConstraint.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_ListConstraint.xaml.h File Reference

#include "Scenario_ListConstraint.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PauseAsync.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_PauseAsync.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_PauseAsync.xaml.h File Reference

#include "Scenario_PauseAsync.g.h"
#include "MainPage.xaml.h"
#include <sstream>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PredefinedDictationGrammar.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_PredefinedDictationGrammar.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_PredefinedDictationGrammar.xaml.h File Reference

#include "Scenario_PredefinedDictationGrammar.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PredefinedWebSearchGrammar.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_PredefinedWebSearchGrammar.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_PredefinedWebSearchGrammar.xaml.h File Reference

#include "Scenario_PredefinedWebSearchGrammar.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SRGSConstraint.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SRGSConstraint.xaml.h"
#include "AudioCapturePermissions.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_SRGSConstraint.xaml.h File Reference

#include "Scenario_SRGSConstraint.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeSSML.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SynthesizeSSML.xaml.h"
#include <pplawait.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_SynthesizeSSML.xaml.h File Reference

#include "Scenario_SynthesizeSSML.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeText.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SynthesizeText.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_SynthesizeText.xaml.h File Reference

#include "Scenario_SynthesizeText.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp File Reference

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeTextBoundaries.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SynthesizeTextBoundaries.xaml.h"
#include <pplawait.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h File Reference

  • SpeechRecognitionAndSynthesis
  • cpp
Classes | Namespaces

Scenario_SynthesizeTextBoundaries.xaml.h File Reference

#include "Scenario_SynthesizeTextBoundaries.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

AudioCapturePermissions.cs File Reference

Go to the source code of this file.

Classes

class | AudioCapturePermissions

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_ContinuousDictation.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_ContinuousDictation

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_ContinuousRecognitionListGrammar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_ContinuousRecognitionListGrammar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_ContinuousRecognitionSRGSGrammar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_ListConstraint.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_ListConstraint

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_PauseAsync.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_PauseAsync

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_PredefinedDictationGrammar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_PredefinedDictationGrammar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_PredefinedWebSearchGrammar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_PredefinedWebSearchGrammar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_SRGSConstraint.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_SRGSConstraint

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_SynthesizeSSML.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_SynthesizeSSML

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_SynthesizeText.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_SynthesizeText

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs File Reference

  • SpeechRecognitionAndSynthesis
  • cs
Classes | Namespaces

Scenario_SynthesizeTextBoundaries.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_SynthesizeTextBoundaries

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/App.xaml.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/ExtendedSplash.xaml.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces

ExtendedSplash.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ExtendedSplash

Namespaces

namespace | SplashScreenSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/MainPage.xaml.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/SampleConfiguration.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces | Enumerations

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MainPageSizeChangedEventArgs
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/Scenario1_SplashScreenDismiss.xaml.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces

Scenario1_SplashScreenDismiss.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SplashScreenSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/Scenario2_ExtendedSplash.xaml.cs File Reference

  • SplashScreen
  • cs
Classes | Namespaces

Scenario2_ExtendedSplash.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SplashScreenSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/common/SuspensionManager.cs File Reference

  • SplashScreen
  • cs
  • common
Classes | Namespaces

SuspensionManager.cs File Reference

Go to the source code of this file.

Classes

class | SuspensionManager
SuspensionManager captures global session state to simplify process lifetime management for an application. More...
class | SuspensionManagerException

Namespaces

namespace | SDKTemplate::Common
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/ItemsListViewModel.h File Reference

  • Store
  • cpp
Classes | Namespaces

ItemsListViewModel.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/pch.cpp File Reference

  • Store
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/pch.h File Reference

  • Store
  • cpp

pch.h File Reference

#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/SampleConfiguration.cpp File Reference

  • Store
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"
#include "ItemsListViewModel.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/SampleConfiguration.h File Reference

  • Store
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include <collection.h>

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Utils

Functions

Platform::Collections::Vector
< ItemDetails^> 		CreateProductListFromQueryResult (Windows::Services::Store::StoreProductQueryResult^addOns, Platform::String^description)
int64_t | DaysUntil (Windows::Foundation::DateTime endDate)
void | ReportExtendedError (Windows::Foundation::HResult extendedError)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario1_TrialMode.xaml.cpp File Reference

  • Store
  • cpp

Scenario1_TrialMode.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_TrialMode.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario1_TrialMode.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario1_TrialMode.xaml.h File Reference

#include "pch.h"
#include "Scenario1_TrialMode.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario2_InAppPurchase.xaml.cpp File Reference

  • Store
  • cpp

Scenario2_InAppPurchase.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_InAppPurchase.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario2_InAppPurchase.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario2_InAppPurchase.xaml.h File Reference

#include "pch.h"
#include "Scenario2_InAppPurchase.g.h"
#include "MainPage.xaml.h"
#include "ItemsListViewModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario3_UnmanagedConsumable.xaml.cpp File Reference

  • Store
  • cpp

Scenario3_UnmanagedConsumable.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_UnmanagedConsumable.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario3_UnmanagedConsumable.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario3_UnmanagedConsumable.xaml.h File Reference

#include "pch.h"
#include "Scenario3_UnmanagedConsumable.g.h"
#include "MainPage.xaml.h"
#include "ItemsListViewModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario4_ConsumableProduct.xaml.cpp File Reference

  • Store
  • cpp

Scenario4_ConsumableProduct.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_ConsumableProduct.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario4_ConsumableProduct.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario4_ConsumableProduct.xaml.h File Reference

#include "pch.h"
#include "Scenario4_ConsumableProduct.g.h"
#include "MainPage.xaml.h"
#include "ItemsListViewModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario5_UserCollection.xaml.cpp File Reference

  • Store
  • cpp

Scenario5_UserCollection.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_UserCollection.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario5_UserCollection.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario5_UserCollection.xaml.h File Reference

#include "pch.h"
#include "Scenario5_UserCollection.g.h"
#include "MainPage.xaml.h"
#include "ItemsListViewModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario6_AppListingURI.xaml.cpp File Reference

  • Store
  • cpp

Scenario6_AppListingURI.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_AppListingURI.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario6_AppListingURI.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario6_AppListingURI.xaml.h File Reference

#include "pch.h"
#include "Scenario6_AppListingURI.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario7_B2B.xaml.cpp File Reference

  • Store
  • cpp
Variables

Scenario7_B2B.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_B2B.xaml.h"

Go to the source code of this file.

Variables

String | appIdUri = "https://contoso.onmicrosoft.com"
String | clientId = "00000000-0000-0000-0000-000000000000"
String | clientSecret = "00000000000000000000000000000000000000000000"
String | tenantId = "00000000-0000-0000-0000-000000000000"

Variable Documentation

String appIdUri = "https://contoso.onmicrosoft.com"

Definition at line 35 of file Scenario7_B2B.xaml.cpp.

String clientId = "00000000-0000-0000-0000-000000000000"

Definition at line 33 of file Scenario7_B2B.xaml.cpp.

String clientSecret = "00000000000000000000000000000000000000000000"

Definition at line 34 of file Scenario7_B2B.xaml.cpp.

String tenantId = "00000000-0000-0000-0000-000000000000"

Definition at line 32 of file Scenario7_B2B.xaml.cpp.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario7_B2B.xaml.h File Reference

  • Store
  • cpp
Classes | Namespaces

Scenario7_B2B.xaml.h File Reference

#include "pch.h"
#include "Scenario7_B2B.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/ItemsListViewModel.cs File Reference

  • Store
  • cs
Classes | Namespaces

ItemsListViewModel.cs File Reference

Go to the source code of this file.

Classes

class | ItemDetails

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/SampleConfiguration.cs File Reference

  • Store
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | BindingUtils
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | Utils

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario1_TrialMode.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario1_TrialMode.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_TrialMode

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario2_InAppPurchase.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario2_InAppPurchase.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_InAppPurchase

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario3_UnmanagedConsumable.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario3_UnmanagedConsumable.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_UnmanagedConsumable

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario4_ConsumableProduct.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario4_ConsumableProduct.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ConsumableProduct
A page for fourth scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario5_UserCollection.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario5_UserCollection.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_UserCollection

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario6_AppListingURI.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario6_AppListingURI.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_AppListingURI
A page for sixth scenario. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario7_B2B.xaml.cs File Reference

  • Store
  • cs
Classes | Namespaces

Scenario7_B2B.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_B2B
For more details on the business to business APIs, see: https://msdn.microsoft.com/en-us/library/windows/apps/mt609002.aspx. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/pch.cpp File Reference

  • StreamSocket
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/pch.h File Reference

  • StreamSocket
  • cpp

pch.h File Reference

#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/SampleConfiguration.cpp File Reference

  • StreamSocket
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/SampleConfiguration.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include <collection.h>

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario1.xaml.cpp File Reference

  • StreamSocket
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario1.xaml.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::StreamSocketSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario2.xaml.cpp File Reference

  • StreamSocket
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario2.xaml.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::StreamSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario3.xaml.cpp File Reference

  • StreamSocket
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario3.xaml.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::StreamSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario4.xaml.cpp File Reference

  • StreamSocket
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario4.xaml.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

Scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::StreamSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario5.xaml.cpp File Reference

  • StreamSocket
  • cpp

Scenario5.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario5.xaml.h File Reference

  • StreamSocket
  • cpp
Classes | Namespaces

Scenario5.xaml.h File Reference

#include "pch.h"
#include "Scenario5.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::StreamSocketSample
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/SampleConfiguration.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario1_Start.xaml.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

Scenario1_Start.xaml.cs File Reference

Go to the source code of this file.

Classes

class | LocalHostItem
Helper class describing a NetworkAdapter and its associated IP address. More...
class | Scenario1
A page for first scenario. More...

Namespaces

namespace | StreamSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario2_Connect.xaml.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

Scenario2_Connect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
A page for second scenario. More...

Namespaces

namespace | StreamSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario3_Send.xaml.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

Scenario3_Send.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
A page for third scenario. More...

Namespaces

namespace | StreamSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario4_Close.xaml.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

Scenario4_Close.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
A page for fourth scenario. More...

Namespaces

namespace | StreamSocketSample
Generated on Fri Nov 15 2024 22:22:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario5_Certificates.xaml.cs File Reference

  • StreamSocket
  • cs
Classes | Namespaces

Scenario5_Certificates.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
A page for fifth scenario. More...

Namespaces

namespace | StreamSocketSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/pch.cpp File Reference

  • Syndication
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/pch.h File Reference

  • Syndication
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/SampleConfiguration.cpp File Reference

  • Syndication
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/SampleConfiguration.h File Reference

  • Syndication
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | StringTrimmer

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/Scenario1_GetFeed.xaml.cpp File Reference

  • Syndication
  • cpp

Scenario1_GetFeed.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_GetFeed.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/Scenario1_GetFeed.xaml.h File Reference

  • Syndication
  • cpp
Classes | Namespaces

Scenario1_GetFeed.xaml.h File Reference

#include "pch.h"
#include "Scenario1_GetFeed.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Syndication
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cs/SampleConfiguration.cs File Reference

  • Syndication
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cs/Scenario1_GetFeed.xaml.cs File Reference

  • Syndication
  • cs
Classes | Namespaces

Scenario1_GetFeed.xaml.cs File Reference

Go to the source code of this file.

Classes

class | S1_GetAFeed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Syndication
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SystemMediaTransportControls/cs/SampleConfiguration.cs File Reference

  • SystemMediaTransportControls
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SystemMediaTransportControls/cs/Scenario1.xaml.cs File Reference

  • SystemMediaTransportControls
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/pch.cpp File Reference

  • TextSegmentation
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/pch.h File Reference

  • TextSegmentation
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/SampleConfiguration.cpp File Reference

  • TextSegmentation
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/SampleConfiguration.h File Reference

  • TextSegmentation
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.cpp File Reference

  • TextSegmentation
  • cpp

Scenario1_ExtractTextSegments.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_ExtractTextSegments.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/Scenario1_ExtractTextSegments.xaml.h File Reference

  • TextSegmentation
  • cpp
Classes | Namespaces

Scenario1_ExtractTextSegments.xaml.h File Reference

#include "Scenario1_ExtractTextSegments.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cpp File Reference

  • TextSegmentation
  • cpp

Scenario2_GetCurrentTextSegmentFromIndex.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_GetCurrentTextSegmentFromIndex.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.h File Reference

  • TextSegmentation
  • cpp
Classes | Namespaces

Scenario2_GetCurrentTextSegmentFromIndex.xaml.h File Reference

#include "Scenario2_GetCurrentTextSegmentFromIndex.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/pch.cpp File Reference

  • TextSegmentation
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/pch.h File Reference

  • TextSegmentation
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Data.Text.h"
#include "winrt/Windows.Globalization.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Project.idl File Reference

  • TextSegmentation
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_ExtractTextSegments
runtimeclass | Scenario2_GetCurrentTextSegmentFromIndex
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/SampleConfiguration.cpp File Reference

  • TextSegmentation
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/SampleConfiguration.h File Reference

  • TextSegmentation
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.cpp File Reference

  • TextSegmentation
  • cppwinrt
Namespaces

Scenario1_ExtractTextSegments.cpp File Reference

#include "pch.h"
#include "Scenario1_ExtractTextSegments.h"
#include "Scenario1_ExtractTextSegments.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Scenario1_ExtractTextSegments.h File Reference

  • TextSegmentation
  • cppwinrt
Classes | Namespaces

Scenario1_ExtractTextSegments.h File Reference

#include "Scenario1_ExtractTextSegments.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_ExtractTextSegments
struct | Scenario1_ExtractTextSegments

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.cpp File Reference

  • TextSegmentation
  • cppwinrt
Namespaces

Scenario2_GetCurrentTextSegmentFromIndex.cpp File Reference

#include "pch.h"
#include "Scenario2_GetCurrentTextSegmentFromIndex.h"
#include "Scenario2_GetCurrentTextSegmentFromIndex.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.h File Reference

  • TextSegmentation
  • cppwinrt
Classes | Namespaces

Scenario2_GetCurrentTextSegmentFromIndex.h File Reference

#include "Scenario2_GetCurrentTextSegmentFromIndex.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_GetCurrentTextSegmentFromIndex
struct | Scenario2_GetCurrentTextSegmentFromIndex

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/SampleConfiguration.cs File Reference

  • TextSegmentation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/Scenario1_ExtractTextSegments.xaml.cs File Reference

  • TextSegmentation
  • cs
Classes | Namespaces

Scenario1_ExtractTextSegments.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ExtractTextSegments
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs File Reference

  • TextSegmentation
  • cs
Classes | Namespaces

Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_GetCurrentTextSegmentFromIndex
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/pch.cpp File Reference

  • TextSuggestion
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/pch.h File Reference

  • TextSuggestion
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/SampleConfiguration.cpp File Reference

  • TextSuggestion
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/SampleConfiguration.h File Reference

  • TextSuggestion
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario1_Conversion.xaml.cpp File Reference

  • TextSuggestion
  • cpp

Scenario1_Conversion.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Conversion.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario1_Conversion.xaml.h File Reference

  • TextSuggestion
  • cpp
Classes | Namespaces

Scenario1_Conversion.xaml.h File Reference

#include "Scenario1_Conversion.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario2_Prediction.xaml.cpp File Reference

  • TextSuggestion
  • cpp

Scenario2_Prediction.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Prediction.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario2_Prediction.xaml.h File Reference

  • TextSuggestion
  • cpp
Classes | Namespaces

Scenario2_Prediction.xaml.h File Reference

#include "Scenario2_Prediction.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.cpp File Reference

  • TextSuggestion
  • cpp

Scenario3_ReverseConversion.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ReverseConversion.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.h File Reference

  • TextSuggestion
  • cpp
Classes | Namespaces

Scenario3_ReverseConversion.xaml.h File Reference

#include "Scenario3_ReverseConversion.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/SampleConfiguration.cs File Reference

  • TextSuggestion
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/Scenario1_Conversion.xaml.cs File Reference

  • TextSuggestion
  • cs
Classes | Namespaces

Scenario1_Conversion.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Conversion

Namespaces

namespace | TextSuggestion
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/Scenario2_Prediction.xaml.cs File Reference

  • TextSuggestion
  • cs
Classes | Namespaces

Scenario2_Prediction.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Prediction

Namespaces

namespace | TextSuggestion
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/Scenario3_ReverseConversion.xaml.cs File Reference

  • TextSuggestion
  • cs
Classes | Namespaces

Scenario3_ReverseConversion.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ReverseConversion

Namespaces

namespace | TextSuggestion
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/CustomTitleBar.xaml.cpp File Reference

  • TitleBar
  • cpp

CustomTitleBar.xaml.cpp File Reference

#include "pch.h"
#include "CustomTitleBar.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/CustomTitleBar.xaml.h File Reference

  • TitleBar
  • cpp
Classes | Namespaces

CustomTitleBar.xaml.h File Reference

#include "CustomTitleBar.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/pch.cpp File Reference

  • TitleBar
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/pch.h File Reference

  • TitleBar
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "SampleConfiguration.h"
#include "App.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/SampleConfiguration.cpp File Reference

  • TitleBar
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/SampleConfiguration.h File Reference

  • TitleBar
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "CustomTitleBar.xaml.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario1_Colors.xaml.cpp File Reference

  • TitleBar
  • cpp

Scenario1_Colors.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Colors.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario1_Colors.xaml.h File Reference

  • TitleBar
  • cpp
Classes | Namespaces

Scenario1_Colors.xaml.h File Reference

#include "Scenario1_Colors.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario2_Extend.xaml.cpp File Reference

  • TitleBar
  • cpp

Scenario2_Extend.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Extend.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario2_Extend.xaml.h File Reference

  • TitleBar
  • cpp
Classes | Namespaces

Scenario2_Extend.xaml.h File Reference

#include "Scenario2_Extend.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/CustomTitleBar.cpp File Reference

  • TitleBar
  • cppwinrt
Namespaces

CustomTitleBar.cpp File Reference

#include "pch.h"
#include "CustomTitleBar.h"
#include "CustomTitleBar.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/CustomTitleBar.h File Reference

  • TitleBar
  • cppwinrt
Classes | Namespaces

CustomTitleBar.h File Reference

#include "CustomTitleBar.g.h"

Go to the source code of this file.

Classes

struct | CustomTitleBar
struct | CustomTitleBar

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/pch.cpp File Reference

  • TitleBar
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/pch.h File Reference

  • TitleBar
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.ApplicationModel.Core.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/Windows.UI.Xaml.Shapes.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Project.idl File Reference

  • TitleBar
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_Colors
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/SampleConfiguration.cpp File Reference

  • TitleBar
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"
#include "CustomTitleBar.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/SampleConfiguration.h File Reference

  • TitleBar
  • cppwinrt
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

struct | SampleState

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario1_Colors.cpp File Reference

  • TitleBar
  • cppwinrt
Namespaces

Scenario1_Colors.cpp File Reference

#include "pch.h"
#include "Scenario1_Colors.h"
#include "Scenario1_Colors.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario1_Colors.h File Reference

  • TitleBar
  • cppwinrt
Classes | Namespaces | Functions

Scenario1_Colors.h File Reference

#include "Scenario1_Colors.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Colors
struct | Scenario1_Colors

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation

Functions

hstring | to_hstring (Windows::Foundation::IReference< Windows::UI::Color > const &value)
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario2_Extend.cpp File Reference

  • TitleBar
  • cppwinrt
Namespaces

Scenario2_Extend.cpp File Reference

#include "pch.h"
#include "Scenario2_Extend.h"
#include "Scenario2_Extend.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario2_Extend.h File Reference

  • TitleBar
  • cppwinrt
Classes | Namespaces

Scenario2_Extend.h File Reference

#include "Scenario2_Extend.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_Extend
struct | Scenario2_Extend

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/CustomTitleBar.xaml.cs File Reference

  • TitleBar
  • cs
Classes | Namespaces

CustomTitleBar.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomTitleBar

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/SampleConfiguration.cs File Reference

  • TitleBar
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/Scenario1_Colors.xaml.cs File Reference

  • TitleBar
  • cs
Classes | Namespaces

Scenario1_Colors.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Colors

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/Scenario2_Extend.xaml.cs File Reference

  • TitleBar
  • cs
Classes | Namespaces

Scenario2_Extend.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Extend

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/pch.cpp File Reference

  • TouchKeyboard
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/pch.h File Reference

  • TouchKeyboard
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.ViewManagement.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Input.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Animation.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Project.idl File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | CustomTextBox
runtimeclass | Scenario1_Launch
runtimeclass | Scenario2_ShowHideEvents
runtimeclass | Scenario3_ShowHideMethods
runtimeclass | Scenario4_ShowView
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/SampleConfiguration.cpp File Reference

  • TouchKeyboard
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/SampleConfiguration.h File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario1_Launch.cpp File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces

Scenario1_Launch.cpp File Reference

#include "pch.h"
#include "Scenario1_Launch.h"
#include "Scenario1_Launch.g.cpp"
#include "CustomTextBox.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario1_Launch.h File Reference

  • TouchKeyboard
  • cppwinrt
Classes | Namespaces

Scenario1_Launch.h File Reference

#include "Scenario1_Launch.g.h"
#include "MainPage.h"
#include "CustomTextBox.g.h"

Go to the source code of this file.

Classes

struct | CustomTextBox
struct | Scenario1_Launch
struct | CustomTextBox
struct | Scenario1_Launch

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.cpp File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces

Scenario2_ShowHideEvents.cpp File Reference

#include "pch.h"
#include "Scenario2_ShowHideEvents.h"
#include "Scenario2_ShowHideEvents.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.h File Reference

  • TouchKeyboard
  • cppwinrt
Classes | Namespaces

Scenario2_ShowHideEvents.h File Reference

#include "Scenario2_ShowHideEvents.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_ShowHideEvents
struct | Scenario2_ShowHideEvents
Sample page to subscribe show/hide event of Touch Keyboard. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.cpp File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces

Scenario3_ShowHideMethods.cpp File Reference

#include "pch.h"
#include "Scenario3_ShowHideMethods.h"
#include "Scenario3_ShowHideMethods.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.h File Reference

  • TouchKeyboard
  • cppwinrt
Classes | Namespaces

Scenario3_ShowHideMethods.h File Reference

#include "Scenario3_ShowHideMethods.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_ShowHideMethods
struct | Scenario3_ShowHideMethods
Sample page to call TryShow/TryHide methods. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario4_ShowView.cpp File Reference

  • TouchKeyboard
  • cppwinrt
Namespaces

Scenario4_ShowView.cpp File Reference

#include "pch.h"
#include "Scenario4_ShowView.h"
#include "Scenario4_ShowView.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario4_ShowView.h File Reference

  • TouchKeyboard
  • cppwinrt
Classes | Namespaces

Scenario4_ShowView.h File Reference

#include "Scenario4_ShowView.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario4_ShowView
struct | Scenario4_ShowView

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/CustomTextBox.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

CustomTextBox.cs File Reference

Go to the source code of this file.

Classes

class | CustomTextBox
Custom Text box control derived from Textbox class. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/SampleConfiguration.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/Scenario1_Launch.xaml.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

Scenario1_Launch.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Launch
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/Scenario2_ShowHideEvents.xaml.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

Scenario2_ShowHideEvents.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ShowHideEvents
Sample page to subscribe show/hide event of Touch Keyboard. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/Scenario3_ShowHideMethods.xaml.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

Scenario3_ShowHideMethods.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ShowHideMethods
Sample page to call TryShow/TryHide methods. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/Scenario4_ShowView.xaml.cs File Reference

  • TouchKeyboard
  • cs
Classes | Namespaces

Scenario4_ShowView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ShowView

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/pch.cpp File Reference

  • TouchKeyboardTextInput
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/pch.h File Reference

  • TouchKeyboardTextInput
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/SampleConfiguration.cpp File Reference

  • TouchKeyboardTextInput
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/SampleConfiguration.h File Reference

  • TouchKeyboardTextInput
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.cpp File Reference

  • TouchKeyboardTextInput
  • cpp

Scenario1_SpellingTextSuggestions.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_SpellingTextSuggestions.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.h File Reference

  • TouchKeyboardTextInput
  • cpp
Classes | Namespaces

Scenario1_SpellingTextSuggestions.xaml.h File Reference

#include "Scenario1_SpellingTextSuggestions.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.cpp File Reference

  • TouchKeyboardTextInput
  • cpp

Scenario2_ScopedViews.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ScopedViews.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/Scenario2_ScopedViews.xaml.h File Reference

  • TouchKeyboardTextInput
  • cpp
Classes | Namespaces

Scenario2_ScopedViews.xaml.h File Reference

#include "Scenario2_ScopedViews.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cs/SampleConfiguration.cs File Reference

  • TouchKeyboardTextInput
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cs/Scenario1_SpellingTextSuggestions.xaml.cs File Reference

  • TouchKeyboardTextInput
  • cs
Classes | Namespaces

Scenario1_SpellingTextSuggestions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SpellingTextSuggestions
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cs/Scenario2_ScopedViews.xaml.cs File Reference

  • TouchKeyboardTextInput
  • cs
Classes | Namespaces

Scenario2_ScopedViews.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ScopedViews
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/pch.cpp File Reference

  • Unicode
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/pch.h File Reference

  • Unicode
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.Data.Text.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/Project.idl File Reference

  • Unicode
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_FindId
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/SampleConfiguration.cpp File Reference

  • Unicode
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/SampleConfiguration.h File Reference

  • Unicode
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/Scenario1_FindId.cpp File Reference

  • Unicode
  • cppwinrt
Namespaces | Functions

Scenario1_FindId.cpp File Reference

#include "pch.h"
#include "Scenario1_FindId.h"
#include "Scenario1_FindId.g.cpp"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Scenario1_FindId.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

std::vector< std::wstring > | FindIdsInString (std::wstring_view const &inputString)
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/Scenario1_FindId.h File Reference

  • Unicode
  • cppwinrt
Classes | Namespaces

Scenario1_FindId.h File Reference

#include "Scenario1_FindId.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_FindId
struct | Scenario1_FindId

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cs/SampleConfiguration.cs File Reference

  • Unicode
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cs/Scenario1_FindId.xaml.cs File Reference

  • Unicode
  • cs
Classes | Namespaces

Scenario1_FindId.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_FindId

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/cs/SampleConfiguration.cs File Reference

  • UserActivity
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/cs/Scenario1_BasicUserActivity.xaml.cs File Reference

  • UserActivity
  • cs
Classes | Namespaces

Scenario1_BasicUserActivity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_BasicUserActivity
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/cs/Scenario2_AdvancedUserActivity.xaml.cs File Reference

  • UserActivity
  • cs
Classes | Namespaces

Scenario2_AdvancedUserActivity.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_AdvancedUserActivity
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/cs/Scenario3_AdaptiveCard.xaml.cs File Reference

  • UserActivity
  • cs
Classes | Namespaces

Scenario3_AdaptiveCard.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AdaptiveCard
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/pch.cpp File Reference

  • UserCertificateStore
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/pch.h File Reference

  • UserCertificateStore
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Security.Cryptography.Certificates.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Project.idl File Reference

  • UserCertificateStore
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_MoveCertificate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/SampleConfiguration.cpp File Reference

  • UserCertificateStore
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/SampleConfiguration.h File Reference

  • UserCertificateStore
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.cpp File Reference

  • UserCertificateStore
  • cppwinrt
Namespaces

Scenario1_MoveCertificate.cpp File Reference

#include "pch.h"
#include "Scenario1_MoveCertificate.h"
#include "Scenario1_MoveCertificate.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.h File Reference

  • UserCertificateStore
  • cppwinrt
Classes | Namespaces

Scenario1_MoveCertificate.h File Reference

#include "Scenario1_MoveCertificate.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_MoveCertificate
struct | Scenario1_MoveCertificate

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cs/SampleConfiguration.cs File Reference

  • UserCertificateStore
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cs/Scenario1_MoveCertificate.xaml.cs File Reference

  • UserCertificateStore
  • cs
Classes | Namespaces

Scenario1_MoveCertificate.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_MoveCertificate

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/pch.cpp File Reference

  • UserConsentVerifier
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/pch.h File Reference

  • UserConsentVerifier
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/SampleConfiguration.cpp File Reference

  • UserConsentVerifier
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/SampleConfiguration.h File Reference

  • UserConsentVerifier
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.cpp File Reference

  • UserConsentVerifier
  • cpp

Scenario1_CheckConsentAvailability.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_CheckConsentAvailability.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/Scenario1_CheckConsentAvailability.xaml.h File Reference

  • UserConsentVerifier
  • cpp
Classes | Namespaces

Scenario1_CheckConsentAvailability.xaml.h File Reference

#include "Scenario1_CheckConsentAvailability.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.cpp File Reference

  • UserConsentVerifier
  • cpp

Scenario2_RequestConsent.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_RequestConsent.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.h File Reference

  • UserConsentVerifier
  • cpp
Classes | Namespaces

Scenario2_RequestConsent.xaml.h File Reference

#include "Scenario2_RequestConsent.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/pch.cpp File Reference

  • UserConsentVerifier
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/pch.h File Reference

  • UserConsentVerifier
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Security.Credentials.UI.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Project.idl File Reference

  • UserConsentVerifier
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_CheckConsentAvailability
runtimeclass | Scenario2_RequestConsent
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/SampleConfiguration.cpp File Reference

  • UserConsentVerifier
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/SampleConfiguration.h File Reference

  • UserConsentVerifier
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.cpp File Reference

  • UserConsentVerifier
  • cppwinrt
Namespaces

Scenario1_CheckConsentAvailability.cpp File Reference

#include "pch.h"
#include "Scenario1_CheckConsentAvailability.h"
#include "Scenario1_CheckConsentAvailability.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.h File Reference

  • UserConsentVerifier
  • cppwinrt
Classes | Namespaces

Scenario1_CheckConsentAvailability.h File Reference

#include "Scenario1_CheckConsentAvailability.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_CheckConsentAvailability
struct | Scenario1_CheckConsentAvailability

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.cpp File Reference

  • UserConsentVerifier
  • cppwinrt
Namespaces

Scenario2_RequestConsent.cpp File Reference

#include "pch.h"
#include "Scenario2_RequestConsent.h"
#include "Scenario2_RequestConsent.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.h File Reference

  • UserConsentVerifier
  • cppwinrt
Classes | Namespaces

Scenario2_RequestConsent.h File Reference

#include "Scenario2_RequestConsent.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_RequestConsent
struct | Scenario2_RequestConsent

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cs/SampleConfiguration.cs File Reference

  • UserConsentVerifier
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cs/Scenario1_CheckConsentAvailability.xaml.cs File Reference

  • UserConsentVerifier
  • cs
Classes | Namespaces

Scenario1_CheckConsentAvailability.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CheckConsentAvailability

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cs/Scenario2_RequestConsent.xaml.cs File Reference

  • UserConsentVerifier
  • cs
Classes | Namespaces

Scenario2_RequestConsent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_RequestConsent

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/pch.cpp File Reference

  • UserDataAccountManager
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/pch.h File Reference

  • UserDataAccountManager
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/SampleConfiguration.cpp File Reference

  • UserDataAccountManager
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/SampleConfiguration.h File Reference

  • UserDataAccountManager
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.cpp File Reference

  • UserDataAccountManager
  • cpp

Scenario1_AddAccount.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_AddAccount.xaml.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.h File Reference

  • UserDataAccountManager
  • cpp
Classes | Namespaces

Scenario1_AddAccount.xaml.h File Reference

#include "Scenario1_AddAccount.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.cpp File Reference

  • UserDataAccountManager
  • cpp

Scenario2_ManageAccount.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_ManageAccount.xaml.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.h File Reference

  • UserDataAccountManager
  • cpp
Classes | Namespaces

Scenario2_ManageAccount.xaml.h File Reference

#include "Scenario2_ManageAccount.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.cpp File Reference

  • UserDataAccountManager
  • cpp

Scenario3_FixAccount.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_FixAccount.xaml.h"
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.h File Reference

  • UserDataAccountManager
  • cpp
Classes | Namespaces

Scenario3_FixAccount.xaml.h File Reference

#include "Scenario3_FixAccount.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/SampleConfiguration.cs File Reference

  • UserDataAccountManager
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/Scenario1_AddAccount.xaml.cs File Reference

  • UserDataAccountManager
  • cs
Classes | Namespaces

Scenario1_AddAccount.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_AddAccount

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/Scenario2_ManageAccount.xaml.cs File Reference

  • UserDataAccountManager
  • cs
Classes | Namespaces

Scenario2_ManageAccount.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_ManageAccount

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/Scenario3_FixAccount.xaml.cs File Reference

  • UserDataAccountManager
  • cs
Classes | Namespaces

Scenario3_FixAccount.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_FixAccount

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/pch.cpp File Reference

  • UserInfo
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/pch.h File Reference

  • UserInfo
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Data.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Media.Imaging.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Project.idl File Reference

  • UserInfo
  • cppwinrt
Namespaces | Functions | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

void | ShowProperties ()
void | StartWatching ()
void | StopWatching ()

Variables

runtimeclass | Scenario1_FindUsers
runtimeclass | Scenario2_WatchUsers
runtimeclass | Scenario3_CheckUserConsentGroup
runtimeclass | UserViewModel
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/SampleConfiguration.cpp File Reference

  • UserInfo
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "UserViewModel.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/SampleConfiguration.h File Reference

  • UserInfo
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate::Helpers

Functions

Windows::Foundation::IAsyncOperation
< Windows::Foundation::Collections::IObservableVector
< Windows::Foundation::IInspectable > > 		GetUserViewModelsAsync ()
hstring | to_hstring (Windows::System::UserType value)
hstring | to_hstring (Windows::System::UserAuthenticationStatus value)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario1_FindUsers.cpp File Reference

  • UserInfo
  • cppwinrt
Namespaces

Scenario1_FindUsers.cpp File Reference

#include "pch.h"
#include "Scenario1_FindUsers.h"
#include "SampleConfiguration.h"
#include "Scenario1_FindUsers.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario1_FindUsers.h File Reference

  • UserInfo
  • cppwinrt
Classes | Namespaces

Scenario1_FindUsers.h File Reference

#include "Scenario1_FindUsers.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_FindUsers
struct | Scenario1_FindUsers

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario2_WatchUsers.cpp File Reference

  • UserInfo
  • cppwinrt
Namespaces

Scenario2_WatchUsers.cpp File Reference

#include "pch.h"
#include "Scenario2_WatchUsers.h"
#include "UserViewModel.h"
#include "Scenario2_WatchUsers.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario2_WatchUsers.h File Reference

  • UserInfo
  • cppwinrt
Classes | Namespaces

Scenario2_WatchUsers.h File Reference

#include "Scenario2_WatchUsers.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_WatchUsers
struct | Scenario2_WatchUsers

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.cpp File Reference

  • UserInfo
  • cppwinrt
Namespaces

Scenario3_CheckUserConsentGroup.cpp File Reference

#include "pch.h"
#include "Scenario3_CheckUserConsentGroup.h"
#include "SampleConfiguration.h"
#include "Scenario3_CheckUserConsentGroup.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.h File Reference

  • UserInfo
  • cppwinrt
Classes | Namespaces

Scenario3_CheckUserConsentGroup.h File Reference

#include "Scenario3_CheckUserConsentGroup.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_CheckUserConsentGroup
struct | Scenario3_CheckUserConsentGroup

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/UserViewModel.cpp File Reference

  • UserInfo
  • cppwinrt

UserViewModel.cpp File Reference

#include "pch.h"
#include "UserViewModel.h"
#include "UserViewModel.g.cpp"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/UserViewModel.h File Reference

  • UserInfo
  • cppwinrt
Classes | Namespaces

UserViewModel.h File Reference

#include "UserViewModel.g.h"

Go to the source code of this file.

Classes

struct | UserViewModel

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/SampleConfiguration.cs File Reference

  • UserInfo
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...
class | UserViewModel

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/Scenario1_FindUsers.xaml.cs File Reference

  • UserInfo
  • cs
Classes | Namespaces

Scenario1_FindUsers.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_FindUsers

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/Scenario2_WatchUsers.xaml.cs File Reference

  • UserInfo
  • cs
Classes | Namespaces

Scenario2_WatchUsers.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_WatchUsers

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/Scenario3_CheckUserConsentGroup.xaml.cs File Reference

  • UserInfo
  • cs
Classes | Namespaces

Scenario3_CheckUserConsentGroup.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_CheckUserConsentGroup

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/pch.cpp File Reference

  • UserInteractionMode
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/pch.h File Reference

  • UserInteractionMode
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/SampleConfiguration.cpp File Reference

  • UserInteractionMode
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/SampleConfiguration.h File Reference

  • UserInteractionMode
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/Scenario1_Basic.xaml.cpp File Reference

  • UserInteractionMode
  • cpp

Scenario1_Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/Scenario1_Basic.xaml.h File Reference

  • UserInteractionMode
  • cpp
Classes | Namespaces

Scenario1_Basic.xaml.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/pch.cpp File Reference

  • UserInteractionMode
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/pch.h File Reference

  • UserInteractionMode
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.ViewManagement.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/Project.idl File Reference

  • UserInteractionMode
  • cppwinrt
Namespaces

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/SampleConfiguration.cpp File Reference

  • UserInteractionMode
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/SampleConfiguration.h File Reference

  • UserInteractionMode
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

hstring | to_hstring (Windows::UI::ViewManagement::UserInteractionMode value)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/Scenario1_Basic.cpp File Reference

  • UserInteractionMode
  • cppwinrt
Namespaces

Scenario1_Basic.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.h"
#include "Scenario1_Basic.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/Scenario1_Basic.h File Reference

  • UserInteractionMode
  • cppwinrt
Classes | Namespaces

Scenario1_Basic.h File Reference

#include "Scenario1_Basic.g.h"
#include "SampleConfiguration.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Basic
struct | Scenario1_Basic

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cs/SampleConfiguration.cs File Reference

  • UserInteractionMode
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cs/Scenario1_Basic.xaml.cs File Reference

  • UserInteractionMode
  • cs
Classes | Namespaces

Scenario1_Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basic

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/cs/RequestResponse.xaml.cs File Reference

  • UssdProtcol
  • cs
Classes | Namespaces

RequestResponse.xaml.cs File Reference

Go to the source code of this file.

Classes

class | RequestResponse
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | UssdApi
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/cs/SampleConfiguration.cs File Reference

  • UssdProtcol
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/IsApiPropertyPresentTrigger.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

IsApiPropertyPresentTrigger.cs File Reference

Go to the source code of this file.

Classes

class | IsApiPropertyPresentTrigger

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/MEUserControl.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

MEUserControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MEUserControl

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/MPEUserControl.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

MPEUserControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MPEUserControl

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/SampleConfiguration.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario1_Basics.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

Scenario1_Basics.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basics
This page uses methods of the ApiInformation class to detect the presence of types, methods, events, and enumerated values. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario2_Conditional.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

Scenario2_Conditional.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Conditional
This page shows how to use the ApiInformation class in app code to. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario3_ChooseControl.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

Scenario3_ChooseControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ChooseControl
This scenario shows how to choose a user control based on whether a class is present. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario4_StateTrigger.xaml.cs File Reference

  • VersionAdaptiveCode
  • cs
Classes | Namespaces

Scenario4_StateTrigger.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_StateTrigger
this page shows how to use a state trigger to manipulate setter properties if the property is available. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/SampleConfiguration.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | MediaPlayerHelper
Allows for disposal of the underlying MediaSources attached to a MediaPlayer, regardless of if a MediaSource or MediaPlaybackItem was passed to the MediaPlayer.
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario1_PlayingVideos.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario1_PlayingVideos.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario2_DisplayingInBandClosedCaptions.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario2_DisplayingInBandClosedCaptions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario4_SelectingVideoTracks.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario4_SelectingVideoTracks.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario5_SelectingAudioTracks.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario5_SelectingAudioTracks.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario6_PlayingVideoLists.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario6_PlayingVideoLists.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MediaModel
class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario7_VideoComposition.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario7_VideoComposition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario8_TransferMediaPlayer1.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario8_TransferMediaPlayer1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_TransferMediaPlayer1
This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario9_TransferMediaPlayer2.xaml.cs File Reference

  • VideoPlayback
  • cs
Classes | Namespaces

Scenario9_TransferMediaPlayer2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9_TransferMediaPlayer2
This scenario demonstrates how the lifetime of a MediaPlayer is independent of the MediaPlayerElement. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/SampleConfiguration.cs File Reference

  • VideoPlaybackSynchronization
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario1_MultiVideoPlayback.xaml.cs File Reference

  • VideoPlaybackSynchronization
  • cs
Classes | Namespaces

Scenario1_MultiVideoPlayback.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_MultiVideoPlayback
Multi-video playback control. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario2_SynchronizingPlayers.xaml.cs File Reference

  • VideoPlaybackSynchronization
  • cs
Classes | Namespaces

Scenario2_SynchronizingPlayers.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_SynchronizingPlayers
Multi-video playback syncronization using TimelineControllerPositionOffset. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario3_AdaptiveSync.xaml.cs File Reference

  • VideoPlaybackSynchronization
  • cs
Classes | Namespaces

Scenario3_AdaptiveSync.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_AdaptiveSync
Multi-video live playback synchronization using an AdaptiveMediaSource. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/pch.cpp File Reference

  • WebAccountManagement
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/pch.h File Reference

  • WebAccountManagement
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/SampleConfiguration.cpp File Reference

  • WebAccountManagement
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/SampleConfiguration.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario1_DefaultAccount.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_DefaultAccount.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario1_DefaultAccount.xaml.h File Reference

#include "Scenario1_DefaultAccount.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario2_MSA.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario2_MSA.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Msa.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario2_MSA.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario2_MSA.xaml.h File Reference

#include "Scenario2_Msa.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario3_AAD.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario3_AAD.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Aad.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario3_AAD.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario3_AAD.xaml.h File Reference

#include "Scenario3_Aad.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario4_ManyProviders.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_ManyProviders.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario4_ManyProviders.xaml.h File Reference

#include "Scenario4_ManyProviders.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario5_ManyProvidersManyAccounts.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_ManyProvidersManyAccounts.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario5_ManyProvidersManyAccounts.xaml.h File Reference

#include "Scenario5_ManyProvidersManyAccounts.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.cpp File Reference

  • WebAccountManagement
  • cpp

Scenario6_CustomProvider.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_CustomProvider.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.h File Reference

  • WebAccountManagement
  • cpp
Classes | Namespaces

Scenario6_CustomProvider.xaml.h File Reference

#include "Scenario6_CustomProvider.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/DefaultAccountScenario.xaml.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

DefaultAccountScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DefaultAccountScenario
This scenario covers getting the default account. More...

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/IdentityChecker.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

IdentityChecker.cs File Reference

Go to the source code of this file.

Classes

class | IdentityChecker

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/MultipleAccountsScenario.xaml.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

MultipleAccountsScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MultipleAccountsScenario

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SampleConfiguration.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SingleAccountScenario.xaml.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

SingleAccountScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SingleAccountScenario

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SingleAzureADScenario.xaml.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

SingleAzureADScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SingleAzureADScenario

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SingleMicrosoftAccountScenario.xaml.cs File Reference

  • WebAccountManagement
  • cs
Classes | Namespaces

SingleMicrosoftAccountScenario.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SingleMicrosoftAccountScenario

Namespaces

namespace | Accounts
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/pch.cpp File Reference

  • WebAuthenticationBroker
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/pch.h File Reference

  • WebAuthenticationBroker
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/SampleConfiguration.cpp File Reference

  • WebAuthenticationBroker
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/SampleConfiguration.h File Reference

  • WebAuthenticationBroker
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.cpp File Reference

  • WebAuthenticationBroker
  • cpp

Scenario2_oAuthFacebook.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_oAuthFacebook.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.h File Reference

  • WebAuthenticationBroker
  • cpp
Classes | Namespaces

Scenario2_oAuthFacebook.xaml.h File Reference

#include "MainPage.xaml.h"
#include "Scenario2_oAuthFacebook.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/SampleConfiguration.cs File Reference

  • WebAuthenticationBroker
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | FormDecoderExtensions
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/Scenario1_Facebook.xaml.cs File Reference

  • WebAuthenticationBroker
  • cs
Classes | Namespaces

Scenario1_Facebook.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Facebook

Namespaces

namespace | WebAuthentication
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/Scenario2_Twitter.xaml.cs File Reference

  • WebAuthenticationBroker
  • cs
Classes | Namespaces

Scenario2_Twitter.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Twitter

Namespaces

namespace | WebAuthentication
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/Scenario3_Flickr.xaml.cs File Reference

  • WebAuthenticationBroker
  • cs
Classes | Namespaces

Scenario3_Flickr.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Flickr

Namespaces

namespace | WebAuthentication
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/pch.cpp File Reference

  • WebSocket
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/pch.h File Reference

  • WebSocket
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/SampleConfiguration.cpp File Reference

  • WebSocket
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/SampleConfiguration.h File Reference

  • WebSocket
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include <collection.h>

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario1_UTF8.xaml.cpp File Reference

  • WebSocket
  • cpp

Scenario1_UTF8.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_UTF8.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario1_UTF8.xaml.h File Reference

  • WebSocket
  • cpp
Classes | Namespaces

Scenario1_UTF8.xaml.h File Reference

#include "pch.h"
#include "Scenario1_UTF8.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario2_Binary.xaml.cpp File Reference

  • WebSocket
  • cpp

Scenario2_Binary.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Binary.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario2_Binary.xaml.h File Reference

  • WebSocket
  • cpp
Classes | Namespaces

Scenario2_Binary.xaml.h File Reference

#include "pch.h"
#include "Scenario2_Binary.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario3_ClientAuthentication.xaml.cpp File Reference

  • WebSocket
  • cpp

Scenario3_ClientAuthentication.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_ClientAuthentication.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario3_ClientAuthentication.xaml.h File Reference

  • WebSocket
  • cpp
Classes | Namespaces

Scenario3_ClientAuthentication.xaml.h File Reference

#include "pch.h"
#include "Scenario3_ClientAuthentication.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario4_PartialReadWrite.xaml.cpp File Reference

  • WebSocket
  • cpp

Scenario4_PartialReadWrite.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_PartialReadWrite.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario4_PartialReadWrite.xaml.h File Reference

  • WebSocket
  • cpp
Classes | Namespaces

Scenario4_PartialReadWrite.xaml.h File Reference

#include "pch.h"
#include "Scenario4_PartialReadWrite.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/pch.cpp File Reference

  • WebSocket
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/pch.h File Reference

  • WebSocket
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Networking.Sockets.h>
#include <winrt/Windows.Security.Cryptography.Certificates.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.Web.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Project.idl File Reference

  • WebSocket
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_UTF8
runtimeclass | Scenario2_Binary
runtimeclass | Scenario3_ClientAuthentication
runtimeclass | Scenario4_PartialReadWrite
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/SampleConfiguration.cpp File Reference

  • WebSocket
  • cppwinrt
Functions

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Functions

IAsyncOperation< bool > IsCertificateValidAsync (Certificate serverCert)

Function Documentation

IAsyncOperation<bool> IsCertificateValidAsync ( Certificate serverCert )

Definition at line 140 of file SampleConfiguration.cpp.

{
    // This is a placeholder call to simulate long-running async calls. Note that this code runs synchronously as part
    // of the SSL/TLS handshake. Avoid performing lengthy operations here - else, the remote server may terminate the
    // connection abruptly.
    co_await winrt::resume_after(100ms);

    // In this sample, we check the issuer of the certificate - this is purely for illustration
    // purposes and should not be considered as a recommendation for certificate validation.
    co_return serverCert.Issuer() == L"www.fabrikam.com";
}

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/SampleConfiguration.h File Reference

  • WebSocket
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

Windows::Foundation::IAsyncOperation
< bool > 		AreCertificateAndCertChainValidAsync (Windows::Security::Cryptography::Certificates::Certificate serverCert, Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate > certChain)
hstring | BuildWebSocketError (hresult_error const &ex)
hstring | to_hstring (Windows::Web::WebErrorStatus value)
hstring | to_hstring (Windows::Networking::Sockets::SocketMessageType value)
Windows::Foundation::Uri | TryGetUri (MainPage const &rootPage, hstring const &uriString)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario1_UTF8.cpp File Reference

  • WebSocket
  • cppwinrt
Namespaces

Scenario1_UTF8.cpp File Reference

#include "pch.h"
#include "Scenario1_UTF8.h"
#include "Scenario1_UTF8.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario1_UTF8.h File Reference

  • WebSocket
  • cppwinrt
Classes | Namespaces

Scenario1_UTF8.h File Reference

#include "Scenario1_UTF8.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_UTF8
struct | Scenario1_UTF8

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario2_Binary.cpp File Reference

  • WebSocket
  • cppwinrt
Namespaces

Scenario2_Binary.cpp File Reference

#include "pch.h"
#include "Scenario2_Binary.h"
#include "Scenario2_Binary.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario2_Binary.h File Reference

  • WebSocket
  • cppwinrt
Classes | Namespaces

Scenario2_Binary.h File Reference

#include "Scenario2_Binary.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Binary
struct | Scenario2_Binary

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario3_ClientAuthentication.cpp File Reference

  • WebSocket
  • cppwinrt
Namespaces

Scenario3_ClientAuthentication.cpp File Reference

#include "pch.h"
#include "Scenario3_ClientAuthentication.h"
#include "Scenario3_ClientAuthentication.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario3_ClientAuthentication.h File Reference

  • WebSocket
  • cppwinrt
Classes | Namespaces

Scenario3_ClientAuthentication.h File Reference

#include "Scenario3_ClientAuthentication.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_ClientAuthentication
struct | Scenario3_ClientAuthentication

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario4_PartialReadWrite.cpp File Reference

  • WebSocket
  • cppwinrt
Namespaces

Scenario4_PartialReadWrite.cpp File Reference

#include "pch.h"
#include "Scenario4_PartialReadWrite.h"
#include "Scenario4_PartialReadWrite.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario4_PartialReadWrite.h File Reference

  • WebSocket
  • cppwinrt
Classes | Namespaces

Scenario4_PartialReadWrite.h File Reference

#include "Scenario4_PartialReadWrite.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_PartialReadWrite
struct | Scenario4_PartialReadWrite

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/SampleConfiguration.cs File Reference

  • WebSocket
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario1_UTF8.xaml.cs File Reference

  • WebSocket
  • cs
Classes | Namespaces

Scenario1_UTF8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_UTF8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario2_Binary.xaml.cs File Reference

  • WebSocket
  • cs
Classes | Namespaces

Scenario2_Binary.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Binary
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario3_ClientAuthentication.xaml.cs File Reference

  • WebSocket
  • cs
Classes | Namespaces

Scenario3_ClientAuthentication.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_ClientAuthentication

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario4_PartialReadWrite.xaml.cs File Reference

  • WebSocket
  • cs
Classes | Namespaces

Scenario4_PartialReadWrite.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_PartialReadWrite
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/pch.cpp File Reference

  • WiFiDirect
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/pch.h File Reference

  • WiFiDirect
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SampleConfiguration.cpp File Reference

  • WiFiDirect
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SampleConfiguration.h File Reference

  • WiFiDirect
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/Scenario1_Advertiser.xaml.cpp File Reference

  • WiFiDirect
  • cpp

Scenario1_Advertiser.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Advertiser.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/Scenario1_Advertiser.xaml.h File Reference

  • WiFiDirect
  • cpp
Classes | Namespaces

Scenario1_Advertiser.xaml.h File Reference

#include "Scenario1_Advertiser.g.h"
#include "MainPage.xaml.h"
#include "SocketReaderWriter.h"
#include "SocketReaderWriter.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/Scenario2_Connector.xaml.cpp File Reference

  • WiFiDirect
  • cpp

Scenario2_Connector.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Connector.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/Scenario2_Connector.xaml.h File Reference

  • WiFiDirect
  • cpp
Classes | Namespaces

Scenario2_Connector.xaml.h File Reference

#include "Scenario2_Connector.g.h"
#include "MainPage.xaml.h"
#include "SocketReaderWriter.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SocketReaderWriter.cpp File Reference

  • WiFiDirect
  • cpp

SocketReaderWriter.cpp File Reference

#include "pch.h"
#include "SocketReaderWriter.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SocketReaderWriter.h File Reference

  • WiFiDirect
  • cpp
Classes | Namespaces | Variables

SocketReaderWriter.h File Reference

#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Variables

Platform::Array< byte > | CustomOui = ref new Platform::Array<byte>{ 0xAA, 0xBB, 0xCC }
byte | CustomOuiType = 0xDD
Platform::Array< byte > | MsftOui = ref new Platform::Array<byte>{ 0x00, 0x50, 0xF2 }
Platform::String | strServerPort = "50001"
Platform::Array< byte > | WfaOui = ref new Platform::Array<byte>{ 0x50, 0x6F, 0x9A }
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/ConnectionSettingsPanel.cpp File Reference

  • WiFiDirect
  • cppwinrt
Namespaces

ConnectionSettingsPanel.cpp File Reference

#include "pch.h"
#include "ConnectionSettingsPanel.h"
#include "SampleConfiguration.h"
#include "ConnectionSettingsPanel.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/ConnectionSettingsPanel.h File Reference

  • WiFiDirect
  • cppwinrt
Classes | Namespaces

ConnectionSettingsPanel.h File Reference

#include "ConnectionSettingsPanel.g.h"

Go to the source code of this file.

Classes

struct | ConnectionSettingsPanel
struct | ConnectionSettingsPanel

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/pch.cpp File Reference

  • WiFiDirect
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/pch.h File Reference

  • WiFiDirect
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Devices.Enumeration.h"
#include "winrt/Windows.Devices.WiFiDirect.h"
#include "winrt/Windows.Networking.Sockets.h"
#include "winrt/Windows.Security.Credentials.h"
#include "winrt/Windows.Security.Cryptography.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Popups.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Project.idl File Reference

  • WiFiDirect
  • cppwinrt
Namespaces | Functions | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Functions

Windows Foundation
IAsyncOperation< Boolean > 		RequestPairDeviceAsync (Windows.Devices.Enumeration.DeviceInformationPairing pairing)
void | Reset ()

Variables

runtimeclass | ConnectedDevice
runtimeclass | ConnectionSettingsPanel
runtimeclass | DiscoveredDevice
runtimeclass | Scenario1_Advertiser
runtimeclass | Scenario2_Connector
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SampleConfiguration.cpp File Reference

  • WiFiDirect
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SampleConfiguration.h File Reference

  • WiFiDirect
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt
namespace | winrt::SDKTemplate

Functions

template<typename T , typename Control >
T | GetSelectedItemTag (Control &&control)
fire_and_forget | HandlePairing (Windows::UI::Core::CoreDispatcher dispatcher, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs e)
template<typename T , typename V >
bool | RemoveByValue (T &&collection, V &&value)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectConfigurationMethod)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatus)
hstring | to_hstring (Windows::Devices::Enumeration::DeviceUnpairingResultStatus status)
hstring | to_hstring (Windows::Devices::Enumeration::DevicePairingResultStatus status)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectError)
hstring | to_hstring (Windows::Devices::WiFiDirect::WiFiDirectConnectionStatus)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario1_Advertiser.cpp File Reference

  • WiFiDirect
  • cppwinrt
Namespaces

Scenario1_Advertiser.cpp File Reference

#include "pch.h"
#include "Scenario1_Advertiser.h"
#include "SampleConfiguration.h"
#include "SocketReaderWriter.h"
#include "Scenario1_Advertiser.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario1_Advertiser.h File Reference

  • WiFiDirect
  • cppwinrt
Classes | Namespaces

Scenario1_Advertiser.h File Reference

#include "Scenario1_Advertiser.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1_Advertiser
struct | Scenario1_Advertiser

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario2_Connector.cpp File Reference

  • WiFiDirect
  • cppwinrt
Namespaces

Scenario2_Connector.cpp File Reference

#include "pch.h"
#include "Scenario2_Connector.h"
#include "SampleConfiguration.h"
#include "SocketReaderWriter.h"
#include "Scenario2_Connector.g.cpp"
#include <chrono>
#include <sstream>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario2_Connector.h File Reference

  • WiFiDirect
  • cppwinrt
Classes | Namespaces

Scenario2_Connector.h File Reference

#include "Scenario2_Connector.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_Connector
struct | Scenario2_Connector

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SocketReaderWriter.cpp File Reference

  • WiFiDirect
  • cppwinrt
Namespaces

SocketReaderWriter.cpp File Reference

#include "pch.h"
#include "SocketReaderWriter.h"
#include "ConnectedDevice.g.cpp"
#include "Utils.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SocketReaderWriter.h File Reference

  • WiFiDirect
  • cppwinrt
Classes | Namespaces

SocketReaderWriter.h File Reference

#include "MainPage.h"
#include "DiscoveredDevice.g.h"
#include "ConnectedDevice.g.h"
#include "Utils.g.h"

Go to the source code of this file.

Classes

struct | Utils
struct | ConnectedDevice
struct | DiscoveredDevice
struct | Utils
struct | SocketReaderWriter

Namespaces

namespace | winrt::SDKTemplate
namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/ConnectionSettingsPanel.xaml.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

ConnectionSettingsPanel.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ConnectionSettingsPanel

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/SampleConfiguration.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/Scenario1_Advertiser.xaml.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

Scenario1_Advertiser.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Advertiser
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/Scenario2_Connector.xaml.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

Scenario2_Connector.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Connector
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/SocketReaderWriter.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

SocketReaderWriter.cs File Reference

Go to the source code of this file.

Classes

class | ConnectedDevice
class | DiscoveredDevice
class | SocketReaderWriter

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/Utils.cs File Reference

  • WiFiDirect
  • cs
Classes | Namespaces

Utils.cs File Reference

Go to the source code of this file.

Classes

class | Globals
class | Utils

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/pch.cpp File Reference

  • WiFiDirectServices
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/pch.h File Reference

  • WiFiDirectServices
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <concrt.h>
#include <sstream>
#include "Helpers\BufferConverter.h"
#include "Helpers\ServiceStatusConverter.h"
#include "App.xaml.h"
#include "MainPage.xaml.h"
#include "WiFiDirectServicesManager.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/SampleConfiguration.cpp File Reference

  • WiFiDirectServices
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/SampleConfiguration.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.cpp File Reference

  • WiFiDirectServices
  • cpp

Scenario1_AdvertiserCreate.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_AdvertiserCreate.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

Scenario1_AdvertiserCreate.xaml.h File Reference

#include "Helpers\ServiceStatusConverter.h"
#include "Scenario1_AdvertiserCreate.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.cpp File Reference

  • WiFiDirectServices
  • cpp

Scenario2_AdvertiserAccept.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_AdvertiserAccept.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

Scenario2_AdvertiserAccept.xaml.h File Reference

#include "Scenario2_AdvertiserAccept.g.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.cpp File Reference

  • WiFiDirectServices
  • cpp

Scenario3_SeekerDiscover.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_SeekerDiscover.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

Scenario3_SeekerDiscover.xaml.h File Reference

#include "Scenario3_SeekerDiscover.g.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.cpp File Reference

  • WiFiDirectServices
  • cpp

Scenario4_SeekerSession.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_SeekerSession.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

Scenario4_SeekerSession.xaml.h File Reference

#include "Scenario4_SeekerSession.g.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario5_SendData.xaml.cpp File Reference

  • WiFiDirectServices
  • cpp

Scenario5_SendData.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_SendData.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario5_SendData.xaml.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

Scenario5_SendData.xaml.h File Reference

#include "Scenario5_SendData.g.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/WiFiDirectServicesManager.cpp File Reference

  • WiFiDirectServices
  • cpp

WiFiDirectServicesManager.cpp File Reference

#include "pch.h"
#include "WiFiDirectServicesManager.h"
#include "Scenario1_AdvertiserCreate.xaml.h"
#include "Scenario2_AdvertiserAccept.xaml.h"
#include "Scenario3_SeekerDiscover.xaml.h"
#include "Scenario4_SeekerSession.xaml.h"
#include "Scenario5_SendData.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/WiFiDirectServicesManager.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

WiFiDirectServicesManager.h File Reference

#include <collection.h>
#include "WiFiDirectServicesWrappers.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/WiFiDirectServicesWrappers.cpp File Reference

  • WiFiDirectServices
  • cpp

WiFiDirectServicesWrappers.cpp File Reference

#include "pch.h"
#include "WiFiDirectServicesWrappers.h"
#include <iomanip>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/WiFiDirectServicesWrappers.h File Reference

  • WiFiDirectServices
  • cpp
Classes | Namespaces

WiFiDirectServicesWrappers.h File Reference

#include <condition_variable>

Go to the source code of this file.

Classes

class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...
class | sealed
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Helpers/BufferConverter.h File Reference

  • WiFiDirectServices
  • cpp
  • Helpers
Classes | Namespaces

BufferConverter.h File Reference

Go to the source code of this file.

Classes

class | Helpers::sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Helpers/ServiceStatusConverter.h File Reference

  • WiFiDirectServices
  • cpp
  • Helpers
Classes | Namespaces

ServiceStatusConverter.h File Reference

Go to the source code of this file.

Classes

class | Helpers::sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/SampleConfiguration.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario1_AdvertiserCreate.xaml.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

Scenario1_AdvertiserCreate.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
UI that exposes properties to begin advertising a Wi-Fi Direct Service. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario2_AdvertiserAccept.xaml.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

Scenario2_AdvertiserAccept.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
UI exposing an interface to accept/decline incoming connection requests as an advertiser and to interact with connected sessions. More...
class | SessionRequestWrapper
Helper class to display session requests in list with extra data. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario3_SeekerDiscover.xaml.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

Scenario3_SeekerDiscover.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
UI that provides a way to discover any Wi-Fi Direct service by name A real application would likely hard-code the service name to a well-known service rather than expose this in the UI. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario4_SeekerSession.xaml.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

Scenario4_SeekerSession.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario5_SendData.xaml.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

Scenario5_SendData.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services This sample just demonstrates setting up the connection and sending strings A real application would likely open pre-determined ports for application communication. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/WiFiDirectServiceManager.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

WiFiDirectServiceManager.cs File Reference

Go to the source code of this file.

Classes

class | WiFiDirectServiceManager
Common class to wrap all of the services objects and state behind the UI. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/WiFiDirectServiceWrappers.cs File Reference

  • WiFiDirectServices
  • cs
Classes | Namespaces

WiFiDirectServiceWrappers.cs File Reference

Go to the source code of this file.

Classes

class | AdvertisementWrapper
Wraps WiFiDirectServiceAdvertiser and handles callbacks and related state. More...
class | DiscoveredDeviceWrapper
class | SessionWrapper
class | SocketWrapper
class | StreamSocketListenerWrapper

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiDirectServices
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Helpers/BufferConverter.cs File Reference

  • WiFiDirectServices
  • cs
  • Helpers
Classes | Namespaces

BufferConverter.cs File Reference

Go to the source code of this file.

Classes

class | Helpers::BufferConverter

Namespaces

namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Helpers/ServiceStatusConverter.cs File Reference

  • WiFiDirectServices
  • cs
  • Helpers
Classes | Namespaces

ServiceStatusConverter.cs File Reference

Go to the source code of this file.

Classes

class | Helpers::ServiceStatusConverter

Namespaces

namespace | SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/DisplayHelpers.cpp File Reference

  • WiFiScan
  • cpp
Namespaces

DisplayHelpers.cpp File Reference

#include "pch.h"
#include <ppltasks.h>
#include "DisplayHelpers.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/DisplayHelpers.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

DisplayHelpers.h File Reference

#include "Objbase.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:22:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/pch.cpp File Reference

  • WiFiScan
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/pch.h File Reference

  • WiFiScan
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/SampleConfiguration.cpp File Reference

  • WiFiScan
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/SampleConfiguration.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario1_CachedNetworks.xaml.cpp File Reference

  • WiFiScan
  • cpp

Scenario1_CachedNetworks.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_CachedNetworks.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario1_CachedNetworks.xaml.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

Scenario1_CachedNetworks.xaml.h File Reference

#include "Scenario1_CachedNetworks.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario2_Scan.xaml.cpp File Reference

  • WiFiScan
  • cpp

Scenario2_Scan.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Scan.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario2_Scan.xaml.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

Scenario2_Scan.xaml.h File Reference

#include "Scenario2_Scan.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario3_RegisterForUpdates.xaml.cpp File Reference

  • WiFiScan
  • cpp

Scenario3_RegisterForUpdates.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_RegisterForUpdates.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario3_RegisterForUpdates.xaml.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

Scenario3_RegisterForUpdates.xaml.h File Reference

#include "Scenario3_RegisterForUpdates.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario4_Connect.xaml.cpp File Reference

  • WiFiScan
  • cpp

Scenario4_Connect.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Connect.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario4_Connect.xaml.h File Reference

  • WiFiScan
  • cpp
Classes | Namespaces

Scenario4_Connect.xaml.h File Reference

#include "Scenario4_Connect.g.h"
#include "MainPage.xaml.h"
#include "DisplayHelpers.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/DisplayHelpers.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

DisplayHelpers.cs File Reference

Go to the source code of this file.

Classes

class | WiFiNetworkDisplay

Namespaces

namespace | WiFiScan
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/SampleConfiguration.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario1_CachedNetworks.xaml.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

Scenario1_CachedNetworks.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_CachedNetworks

Namespaces

namespace | WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario2_Scan.xaml.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

Scenario2_Scan.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Scan

Namespaces

namespace | WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario3_RegisterForUpdates.xaml.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

Scenario3_RegisterForUpdates.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_RegisterForUpdates

Namespaces

namespace | WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario4_Connect.xaml.cs File Reference

  • WiFiScan
  • cs
Classes | Namespaces

Scenario4_Connect.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_Connect
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | WiFiScan
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/App.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/App.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Common.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Defines | Enumerations | Functions

Common.h File Reference

#include <Windows.h>
#include <wrl\implements.h>
#include <mmreg.h>
#include <mfapi.h>

Go to the source code of this file.

Classes

class | CAsyncState
struct | RenderBuffer

Defines

#define | METHODASYNCCALLBACK(Parent, AsyncCallback, pfnCallback)
#define | SAFE_ARRAYDELETE(x) { delete[] x; x = nullptr; }
#define | SAFE_DELETE(x) { delete x; x = nullptr; }
#define | SAFE_RELEASE(x) { SafeRelease(&x); }

Enumerations

enum | RenderSampleType { SampleTypeUnknown, SampleTypeFloat, SampleType16BitPCM, SampleType24in32BitPCM }

Functions

RenderSampleType | GetRenderSampleType (WAVEFORMATEX *wfx)
template<class T >
void | SafeRelease (__deref_inout_opt T **ppT)
void | ThrowIfFailed (HRESULT hr)

Define Documentation

#define METHODASYNCCALLBACK | ( | Parent,
 |  | AsyncCallback,
 |  | pfnCallback
 | ) |

Definition at line 60 of file Common.h.

#define SAFE_ARRAYDELETE ( x ) { delete[] x; x = nullptr; }

Definition at line 56 of file Common.h.

#define SAFE_DELETE ( x ) { delete x; x = nullptr; }

Definition at line 52 of file Common.h.

#define SAFE_RELEASE ( x ) { SafeRelease(&x); }

Definition at line 48 of file Common.h.

Enumeration Type Documentation

enum RenderSampleType
Enumerator:
SampleTypeUnknown
SampleTypeFloat
SampleType16BitPCM
SampleType24in32BitPCM

Definition at line 155 of file Common.h.

{
    SampleTypeUnknown,
    SampleTypeFloat,
    SampleType16BitPCM,
    SampleType24in32BitPCM,
};

Function Documentation

RenderSampleType GetRenderSampleType ( WAVEFORMATEX * wfx ) [inline]

Definition at line 168 of file Common.h.

{
    WAVEFORMATEXTENSIBLE* wfext = reinterpret_cast<WAVEFORMATEXTENSIBLE*>(wfx);

    if ( (wfx->wFormatTag == WAVE_FORMAT_PCM) ||
         (  (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
            (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) ) )
    {
        if (wfx->wBitsPerSample == 16)
        {
            return RenderSampleType::SampleType16BitPCM;
        }
        else if (wfx->wBitsPerSample == 32)
        {
            if ((wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
                (wfext->Samples.wValidBitsPerSample == 24))
            {
                return RenderSampleType::SampleType24in32BitPCM;
            }
        }
    }
    else if ( (wfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) ||
              ( (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
                (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) ) )
    {
        return RenderSampleType::SampleTypeFloat;
    }

    return RenderSampleType::SampleTypeUnknown;
}

void SafeRelease ( __deref_inout_opt T ** ppT )

Definition at line 27 of file Common.h.

{
    T *pTTemp = *ppT; // temp copy
    *ppT = nullptr;   // zero the input
    if (pTTemp)
    {
        pTTemp->Release();
    }
}

void ThrowIfFailed ( HRESULT hr ) [inline]

Definition at line 38 of file Common.h.

{
    if (FAILED( hr ))
    {
        // Set a breakpoint on this line to catch API errors.
        throw Platform::Exception::CreateException( hr );
    }
}

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/DeviceState.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Enumerations | Functions

DeviceState.h File Reference

#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Enumerations

enum DeviceState {
DeviceStateUnInitialized, DeviceStateInError, DeviceStateDiscontinuity, DeviceStateFlushing,
DeviceStateActivated, DeviceStateInitialized, DeviceStateStarting, DeviceStatePlaying,
DeviceStateCapturing, DeviceStatePausing, DeviceStatePaused, DeviceStateStopping,
DeviceStateStopped
}

Functions

public delegate void | DeviceStateChangedHandler (Platform::Object^sender, DeviceStateChangedEventArgs^e)
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MainPage.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MainPage.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Enumerations

MainPage.xaml.h File Reference

#include "MainPage.g.h"
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | SDKSample

Enumerations

enum | NotifyType { StatusMessage, ErrorMessage, StatusMessage, ErrorMessage }
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MFSampleGenerator.cpp File Reference

  • WindowsAudioSession
  • cpp

MFSampleGenerator.cpp File Reference

#include "pch.h"
#include "MFSampleGenerator.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MFSampleGenerator.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Defines

MFSampleGenerator.h File Reference

#include <windows.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <mferror.h>
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | MFSampleGenerator

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Defines

#define | PREROLL_DURATION_SEC 3

Define Documentation

#define PREROLL_DURATION_SEC 3

Definition at line 24 of file MFSampleGenerator.h.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/pch.cpp File Reference

  • WindowsAudioSession
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/pch.h File Reference

  • WindowsAudioSession
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"
#include "Common.h"
#include "App.xaml.h"
#include "Common.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/PlotData.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Defines | Functions

PlotData.h File Reference

#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Defines

#define | MILLISECONDS_TO_VISUALIZE 20

Functions

public delegate void | PlotDataReadyHandler (Platform::Object^sender, PlotDataReadyEventArgs^e)

Define Documentation

#define MILLISECONDS_TO_VISUALIZE 20

Definition at line 19 of file PlotData.h.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/SampleConfiguration.cpp File Reference

  • WindowsAudioSession
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/SampleConfiguration.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
struct | Scenario

Namespaces

namespace | SDKSample
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario1.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario1.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "pch.h"
#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario2.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"
#include <ppl.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario2.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"
#include "WASAPIRenderer.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario3.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"
#include <ppl.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario3.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.xaml.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario4.xaml.cpp File Reference

  • WindowsAudioSession
  • cpp

Scenario4.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario4.xaml.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Defines

Scenario4.xaml.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "MainPage.xaml.h"
#include "WASAPICapture.h"
#include "WASAPICapture.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Defines

#define | OSC_START_X 100
#define | OSC_START_Y 100
#define | OSC_TOTAL_HEIGHT 200
#define | OSC_X_LENGTH 700

Define Documentation

#define OSC_START_X 100

Definition at line 23 of file Scenario4.xaml.h.

#define OSC_START_Y 100

Definition at line 24 of file Scenario4.xaml.h.

#define OSC_TOTAL_HEIGHT 200

Definition at line 26 of file Scenario4.xaml.h.

#define OSC_X_LENGTH 700

Definition at line 25 of file Scenario4.xaml.h.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/ToneSampleGenerator.cpp File Reference

  • WindowsAudioSession
  • cpp
Classes | Functions | Variables

ToneSampleGenerator.cpp File Reference

#include "pch.h"
#include "ToneSampleGenerator.h"

Go to the source code of this file.

Classes

struct | int24in32

Functions

template<>
float | Convert< float > (double Value)
template<>
int24in32 | Convert< int24in32 > (double Value)
template<>
short | Convert< short > (double Value)

Variables

const double | TONE_AMPLITUDE = 0.5
const int | TONE_DURATION_SEC = 30

Function Documentation

float Convert< float > ( double Value )
int24in32 Convert< int24in32 > ( double Value )
short Convert< short > ( double Value )

Definition at line 30 of file ToneSampleGenerator.cpp.

{
    return (short)(Value * _I16_MAX);
};

Variable Documentation

const double TONE_AMPLITUDE = 0.5

Definition at line 21 of file ToneSampleGenerator.cpp.

const int TONE_DURATION_SEC = 30

Definition at line 20 of file ToneSampleGenerator.cpp.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/ToneSampleGenerator.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Defines | Functions

ToneSampleGenerator.h File Reference

#include <math.h>
#include <limits.h>
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | ToneSampleGenerator

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Defines

#define | _USE_MATH_DEFINES

Functions

template<typename T >
T | Convert (double Value)

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 17 of file ToneSampleGenerator.h.

Function Documentation

T Convert ( double Value )
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPICapture.cpp File Reference

  • WindowsAudioSession
  • cpp
Defines

WASAPICapture.cpp File Reference

#include "pch.h"
#include "WASAPICapture.h"

Go to the source code of this file.

Defines

#define BITS_PER_BYTE 8

Define Documentation

#define BITS_PER_BYTE 8

Definition at line 22 of file WASAPICapture.cpp.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPICapture.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Defines

WASAPICapture.h File Reference

#include <Windows.h>
#include <wrl\implements.h>
#include <mfapi.h>
#include <AudioClient.h>
#include <mmdeviceapi.h>
#include "MainPage.xaml.h"
#include "DeviceState.h"
#include "PlotData.h"
#include "PlotData.h"

Go to the source code of this file.

Classes

struct | CAPTUREDEVICEPROPS
class | WASAPICapture

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Defines

#define | AUDIO_FILE_NAME "WASAPIAudioCapture.wav"
#define | FLUSH_INTERVAL_SEC 3

Define Documentation

#define AUDIO_FILE_NAME "WASAPIAudioCapture.wav"

Definition at line 28 of file WASAPICapture.h.

#define FLUSH_INTERVAL_SEC 3

Definition at line 29 of file WASAPICapture.h.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPIRenderer.cpp File Reference

  • WindowsAudioSession
  • cpp

WASAPIRenderer.cpp File Reference

#include "pch.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPIRenderer.h File Reference

  • WindowsAudioSession
  • cpp
Classes | Namespaces | Enumerations

WASAPIRenderer.h File Reference

#include <Windows.h>
#include <wrl\implements.h>
#include <mfapi.h>
#include <AudioClient.h>
#include <mmdeviceapi.h>
#include "MainPage.xaml.h"
#include "DeviceState.h"
#include "ToneSampleGenerator.h"
#include "MFSampleGenerator.h"
#include "DeviceState.h"
#include "ToneSampleGenerator.h"

Go to the source code of this file.

Classes

struct | DEVICEPROPS
class | WASAPIRenderer

Namespaces

namespace | SDKSample
namespace | SDKSample::WASAPIAudio

Enumerations

enum | ContentType { ContentTypeTone, ContentTypeFile }
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Common.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces | Enumerations | Functions

Common.h File Reference

Go to the source code of this file.

Classes

struct | EmbeddedMFAsyncCallback< Callback >
struct | MediaFoundationInitializer
struct | RenderBuffer
struct | scope_exit< Lambda >
struct | unique_cotaskmem_ptr< T >
struct | unique_shared_work_queue

Namespaces

namespace | winrt::SDKTemplate

Enumerations

enum | RenderSampleType { Unknown, Float, Pcm16Bit, Pcm24In32Bit }

Functions

RenderSampleType | GetRenderSampleType (WAVEFORMATEX const *wfx)
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/DeviceState.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

DeviceState.h File Reference

#include "DeviceStateChangedEventArgs.g.h"

Go to the source code of this file.

Classes

struct | DeviceStateChangedEventArgs
struct | DeviceStateSourceT< D >

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/MFSampleGenerator.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces | Defines

MFSampleGenerator.cpp File Reference

#include "pch.h"
#include "MFSampleGenerator.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Defines

#define | PREROLL_DURATION_SEC 3

Define Documentation

#define PREROLL_DURATION_SEC 3

Definition at line 18 of file MFSampleGenerator.cpp.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/MFSampleGenerator.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

MFSampleGenerator.h File Reference

Go to the source code of this file.

Classes

struct | MFSampleGenerator

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/pch.cpp File Reference

  • WindowsAudioSession
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/pch.h File Reference

  • WindowsAudioSession
  • cppwinrt

pch.h File Reference

#include <windows.h>
#include <hstring.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Media.Devices.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Pickers.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.System.Threading.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.UI.Xaml.Shapes.h>
#include <winrt/SDKTemplate.h>
#include <forward_list>
#include <mmreg.h>
#include <mmdeviceapi.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <mferror.h>
#include <AudioClient.h>
#include "Common.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/PlotData.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

PlotData.h File Reference

#include "PlotDataReadyEventArgs.g.h"

Go to the source code of this file.

Classes

struct | PlotDataReadyEventArgs
struct | PlotDataSourceT< D >

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Project.idl File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces | Enumerations

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace SDKTemplate

Enumerations

enum DeviceState {
Uninitialized, Error, Discontinuity, Flushing,
Activated, Initialized, Starting, Playing,
Capturing, Pausing, Paused, Stopping,
Stopped
}
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/SampleConfiguration.cpp File Reference

  • WindowsAudioSession
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/SampleConfiguration.h File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario1.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

Scenario1.cpp File Reference

#include "pch.h"
#include "Scenario1.h"
#include "Scenario1.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario1.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

Scenario1.h File Reference

#include "Scenario1.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario1
struct | Scenario1
Creating a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario2.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

Scenario2.cpp File Reference

#include "pch.h"
#include "Scenario2.h"
#include "Scenario2.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario2.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

Scenario2.h File Reference

#include "Scenario2.g.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Classes

struct | Scenario2
struct | Scenario2
Getting a file's parent folder. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario3.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

Scenario3.cpp File Reference

#include "pch.h"
#include "Scenario3.h"
#include "Scenario3.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario3.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

Scenario3.h File Reference

#include "pch.h"
#include "Scenario3.g.h"
#include "MainPage.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Classes

struct | Scenario3
struct | Scenario3

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario4.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

Scenario4.cpp File Reference

#include "pch.h"
#include "Scenario4.h"
#include "Scenario4.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario4.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

Scenario4.h File Reference

#include "pch.h"
#include "Scenario4.g.h"
#include "WASAPICapture.h"

Go to the source code of this file.

Classes

struct | Scenario4
struct | Scenario4
Writing and reading bytes in a file. More...

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/ToneSampleGenerator.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

ToneSampleGenerator.cpp File Reference

#include "pch.h"
#include "ToneSampleGenerator.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/ToneSampleGenerator.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces | Defines

ToneSampleGenerator.h File Reference

#include <math.h>
#include <limits.h>

Go to the source code of this file.

Classes

class | ToneSampleGenerator
struct | ToneSampleGenerator::SineSampleInfo

Namespaces

namespace | winrt::SDKTemplate

Defines

#define | _USE_MATH_DEFINES

Define Documentation

#define _USE_MATH_DEFINES

Definition at line 13 of file ToneSampleGenerator.h.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPICapture.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

WASAPICapture.cpp File Reference

#include "pch.h"
#include "WASAPICapture.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPICapture.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces

WASAPICapture.h File Reference

#include "DeviceState.h"
#include "PlotData.h"

Go to the source code of this file.

Classes

struct | WASAPICapture

Namespaces

namespace | winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPIRenderer.cpp File Reference

  • WindowsAudioSession
  • cppwinrt
Namespaces

WASAPIRenderer.cpp File Reference

#include "pch.h"
#include "WASAPIRenderer.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPIRenderer.h File Reference

  • WindowsAudioSession
  • cppwinrt
Classes | Namespaces | Enumerations

WASAPIRenderer.h File Reference

#include "DeviceState.h"
#include "ToneSampleGenerator.h"
#include "MFSampleGenerator.h"

Go to the source code of this file.

Classes

struct | WASAPIRenderer

Namespaces

namespace | winrt::SDKTemplate

Enumerations

enum | ContentType { Tone, File }
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/pch.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/pch.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

pch.h File Reference

#include <wrl\event.h>
#include <wrl\implements.h>
#include <wrl\wrappers\corewrappers.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OvenClient.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario1_OvenClient.xaml.h File Reference

#include "Scenario1_OvenClient.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_OvenClientWRL.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario2_OvenClientWRL.xaml.h File Reference

#include "Scenario2_OvenClientWRL.g.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario3_CustomException.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomException.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario3_CustomException.xaml.h File Reference

#include "Scenario3_CustomException.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_CustomExceptionWRL.xaml.h"
#include "MainPage.xaml.h"
#include "..\Server\Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario4_CustomExceptionWRL.xaml.h File Reference

#include "Scenario4_CustomExceptionWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cs/SampleConfiguration.cs File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

Scenario1_OvenClient.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

Scenario2_CustomException.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomException

Namespaces

namespace | WRLInProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • Server
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables

Microsoft.SDKSamples.Kitchen.idl File Reference

#include <sdkddkver.h>

Go to the source code of this file.

Classes

struct | Dimensions
interface | IAppliance
interface | IBread
interface | IBreadBakedEventArgs
interface | IOven
interface | IOvenFactory

Namespaces

namespace | Microsoft::SDKSamples::Kitchen

Typedefs

typedef struct
Microsoft::SDKSamples::Kitchen::Dimensions 		Dimensions
typedef enum
Microsoft::SDKSamples::Kitchen::OvenTemperature 		OvenTemperature

Enumerations

enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}

Functions

activatable (1.0)
activatable (IOvenFactory, 1.0)] runtimeclass Oven

Variables

runtimeclass | Bread
runtimeclass | BreadBakedEventArgs
runtimeclass | Oven
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/Server/module.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • Server
Functions

module.cpp File Reference

#include <wrl\module.h>

Go to the source code of this file.

Functions

STDAPI | DllCanUnloadNow ()
STDAPI | DllGetActivationFactory (_In_ HSTRING activatibleClassId, _COM_Outptr_ IActivationFactory **factory)

Function Documentation

STDAPI DllCanUnloadNow ( )

Definition at line 15 of file module.cpp.

{
    auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
    return module.Terminate() ? S_OK : S_FALSE;
}

STDAPI DllGetActivationFactory | ( | _In_ HSTRING | activatibleClassId,
 |  | _COM_Outptr_ IActivationFactory ** | factory
 | ) |  |

Definition at line 9 of file module.cpp.

{
    auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
    return module.GetActivationFactory(activatibleClassId, factory);
}

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/Server/OvenServer.cpp File Reference

  • WRLInProcessWinRTComponent
  • cpp
  • Server
Classes | Namespaces

OvenServer.cpp File Reference

#include <wrl.h>
#include <winerror.h>
#include <Windows.Foundation.h>
#include <wrl\implements.h>
#include <wrl\event.h>
#include <windows.system.threading.h>
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Classes

class | WrlFinal
class | WrlFinal
class | WrlFinal
class | WrlFinal

Namespaces

namespace | ABI
namespace | ABI::Microsoft
namespace | ABI::Microsoft::SDKSamples
namespace | ABI::Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/pch.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/pch.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

pch.h File Reference

#include <wrl\event.h>
#include <wrl\implements.h>
#include <wrl\wrappers\corewrappers.h>
#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/SampleConfiguration.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_OvenClient.xaml.h"
#include "MainPage.xaml.h"
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario1_OvenClient.xaml.h File Reference

#include "Scenario1_OvenClient.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_OvenClientWRL.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario2_OvenClientWRL.xaml.h File Reference

#include "Scenario2_OvenClientWRL.g.h"
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario3_CustomException.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_CustomException.xaml.h"
#include "MainPage.xaml.h"
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario3_CustomException.xaml.h File Reference

#include "Scenario3_CustomException.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_CustomExceptionWRL.xaml.h"
#include "MainPage.xaml.h"
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp
Classes | Namespaces

Scenario4_CustomExceptionWRL.xaml.h File Reference

#include "Scenario4_CustomExceptionWRL.g.h"

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/SampleConfiguration.cs File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

Scenario1_OvenClient.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OvenClient
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/Scenario2_CustomException.xaml.cs File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs
Classes | Namespaces

Scenario2_CustomException.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomException

Namespaces

namespace | WRLOutOfProcessWinRTComponent
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/Microsoft.SDKSamples.Kitchen.idl File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server
Classes | Namespaces | Enumerations | Functions

Microsoft.SDKSamples.Kitchen.idl File Reference

#include <sdkddkver.h>

Go to the source code of this file.

Classes

struct | Dimensions
interface | IAppliance
interface | IBread
interface | IBreadBakedEventArgs
interface | IOven
interface | IOvenFactory

Namespaces

namespace | Microsoft::SDKSamples::Kitchen

Enumerations

enum OvenTemperature {
Low, Medium, High, Low,
Medium, High, Low, Medium,
High, Low, Medium, High
}

Functions

activatable (1.0)
activatable (IOvenFactory, 1.0)] runtimeclass Oven
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/module.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server
Classes | Functions

module.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | WrlFinal

Functions

int CALLBACK | WinMain (_In_ HINSTANCE, _In_ HINSTANCE, _In_ LPSTR, _In_ int)

Function Documentation

int CALLBACK WinMain | ( | _In_ | HINSTANCE,
 |  | _In_ | HINSTANCE,
 |  | _In_ | LPSTR,
 |  | _In_ | int
 | ) |  |

Definition at line 30 of file module.cpp.

{
    Microsoft::WRL::Wrappers::RoInitializeWrapper roInit(RO_INIT_MULTITHREADED);
    if (FAILED(roInit)) return 0;

    ComPtr<ICoreApplication> coreApp;
    if (FAILED(GetActivationFactory(HStringReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(), &coreApp))) return 0;

    auto activationFactory = Make<ExeServerGetActivationFactory>();
    if (!activationFactory) return 0;

    coreApp->RunWithActivationFactories(activationFactory.Get());

    return 0;
}

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/OvenServer.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server
Classes | Namespaces

OvenServer.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | WrlFinal
class | WrlFinal
class | WrlFinal
class | WrlFinal

Namespaces

namespace | ABI
namespace | ABI::Microsoft
namespace | ABI::Microsoft::SDKSamples
namespace | ABI::Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:23:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/pch.cpp File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/pch.h File Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

pch.h File Reference

#include <roapi.h>
#include <wrl.h>
#include <winerror.h>
#include <Windows.Foundation.h>
#include <Windows.ApplicationModel.Core.h>
#include <windows.System.Threading.h>
#include "Microsoft.SDKSamples.Kitchen.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/pch.cpp File Reference

  • XamlAnimatedGif
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/pch.h File Reference

  • XamlAnimatedGif
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/SampleConfiguration.cpp File Reference

  • XamlAnimatedGif
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/SampleConfiguration.h File Reference

  • XamlAnimatedGif
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/Scenario1_Basic.xaml.cpp File Reference

  • XamlAnimatedGif
  • cpp

Scenario1_Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/Scenario1_Basic.xaml.h File Reference

  • XamlAnimatedGif
  • cpp
Classes | Namespaces

Scenario1_Basic.xaml.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cs/SampleConfiguration.cs File Reference

  • XamlAnimatedGif
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cs/Scenario1_Basic.xaml.cs File Reference

  • XamlAnimatedGif
  • cs
Classes | Namespaces

Scenario1_Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basic

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/App.xaml.cpp File Reference

  • XamlBind
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/App.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

App.xaml.h File Reference

#include "App.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/BasicTests.xaml.cpp File Reference

  • XamlBind
  • cpp

BasicTests.xaml.cpp File Reference

#include "pch.h"
#include "BasicTests.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/BasicTests.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

BasicTests.xaml.h File Reference

#include "BasicTests.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/EventTests.xaml.cpp File Reference

  • XamlBind
  • cpp

EventTests.xaml.cpp File Reference

#include "pch.h"
#include "EventTests.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/EventTests.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

EventTests.xaml.h File Reference

#include "EventTests.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/Functions.xaml.cpp File Reference

  • XamlBind
  • cpp
Functions | Variables

Functions.xaml.cpp File Reference

#include "pch.h"
#include "Functions.xaml.h"
#include "Strsafe.h"

Go to the source code of this file.

Functions

int | CountEmployeesInternal (xBindSampleModel::IEmployee^e)
int | GetHexDigit (const WCHAR hexDigit)
int | ParseColorDoubleByte (PCWSTR colorString, int start)

Variables

Platform::String | _colorNames []
Windows::UI::Color | _colors []

Function Documentation

int CountEmployeesInternal ( xBindSampleModel::IEmployee^ e )

Definition at line 89 of file Functions.xaml.cpp.

{
    int reports = 1;
    if (e->IsManager)
    {
        xBindSampleModel::Manager^ manager = safe_cast<xBindSampleModel::Manager^>(e);
        for (xBindSampleModel::IEmployee^ employee : manager->ReportsList)
        {
            reports += CountEmployeesInternal(employee);
        }
    }
    return reports;
}

int GetHexDigit ( const WCHAR hexDigit )

Definition at line 125 of file Functions.xaml.cpp.

{
    int digit = 0;

    if( hexDigit >= 'a' && hexDigit <= 'f')
    {
        return 10 + hexDigit - 'a';
    }
    if (hexDigit >= 'A' && hexDigit <= 'F')
    {
        return 10 + hexDigit - 'A';
    }
    if (isdigit(hexDigit))
    {
        return hexDigit - '0';
    }
    throw ref new InvalidArgumentException();
}

int ParseColorDoubleByte | ( | PCWSTR | colorString,
 |  | int | start
 | ) |  |

Definition at line 144 of file Functions.xaml.cpp.

{
    int firstDigit = GetHexDigit(colorString[start]);
    int secondDigit = GetHexDigit(colorString[start +1]);

    return firstDigit * 16 + secondDigit;
}

Variable Documentation

Platform::String _colorNames[]
Initial value:
{
    "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod",
    "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite",
    "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow",
    "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue",
    "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff",
    "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent",
    "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"
}

Definition at line 171 of file Functions.xaml.cpp.

Windows::UI::Color _colors[]
Initial value:

{
    Windows::UI::Colors::AliceBlue, Windows::UI::Colors::AntiqueWhite, Windows::UI::Colors::Aqua, Windows::UI::Colors::Aquamarine, Windows::UI::Colors::Azure, Windows::UI::Colors::Beige, Windows::UI::Colors::Bisque, Windows::UI::Colors::Black, Windows::UI::Colors::BlanchedAlmond,
    Windows::UI::Colors::Blue, Windows::UI::Colors::BlueViolet, Windows::UI::Colors::Brown, Windows::UI::Colors::BurlyWood, Windows::UI::Colors::CadetBlue, Windows::UI::Colors::Chartreuse, Windows::UI::Colors::Chocolate, Windows::UI::Colors::Coral, Windows::UI::Colors::CornflowerBlue,
    Windows::UI::Colors::Cornsilk, Windows::UI::Colors::Crimson, Windows::UI::Colors::Cyan, Windows::UI::Colors::DarkBlue, Windows::UI::Colors::DarkCyan, Windows::UI::Colors::DarkGoldenrod, Windows::UI::Colors::DarkGray, Windows::UI::Colors::DarkGreen, Windows::UI::Colors::DarkKhaki,
    Windows::UI::Colors::DarkMagenta, Windows::UI::Colors::DarkOliveGreen, Windows::UI::Colors::DarkOrange, Windows::UI::Colors::DarkOrchid, Windows::UI::Colors::DarkRed, Windows::UI::Colors::DarkSalmon, Windows::UI::Colors::DarkSeaGreen, Windows::UI::Colors::DarkSlateBlue,
    Windows::UI::Colors::DarkSlateGray, Windows::UI::Colors::DarkTurquoise, Windows::UI::Colors::DarkViolet, Windows::UI::Colors::DeepPink, Windows::UI::Colors::DeepSkyBlue, Windows::UI::Colors::DimGray, Windows::UI::Colors::DodgerBlue, Windows::UI::Colors::Firebrick,
    Windows::UI::Colors::FloralWhite, Windows::UI::Colors::ForestGreen, Windows::UI::Colors::Fuchsia, Windows::UI::Colors::Gainsboro, Windows::UI::Colors::GhostWhite, Windows::UI::Colors::Gold, Windows::UI::Colors::Goldenrod, Windows::UI::Colors::Gray, Windows::UI::Colors::Green,
    Windows::UI::Colors::GreenYellow, Windows::UI::Colors::Honeydew, Windows::UI::Colors::HotPink, Windows::UI::Colors::IndianRed, Windows::UI::Colors::Indigo, Windows::UI::Colors::Ivory, Windows::UI::Colors::Khaki, Windows::UI::Colors::Lavender, Windows::UI::Colors::LavenderBlush,
    Windows::UI::Colors::LawnGreen, Windows::UI::Colors::LemonChiffon, Windows::UI::Colors::LightBlue, Windows::UI::Colors::LightCoral, Windows::UI::Colors::LightCyan, Windows::UI::Colors::LightGoldenrodYellow, Windows::UI::Colors::LightGray, Windows::UI::Colors::LightGreen,
    Windows::UI::Colors::LightPink, Windows::UI::Colors::LightSalmon, Windows::UI::Colors::LightSeaGreen, Windows::UI::Colors::LightSkyBlue, Windows::UI::Colors::LightSlateGray, Windows::UI::Colors::LightSteelBlue, Windows::UI::Colors::LightYellow, Windows::UI::Colors::Lime,
    Windows::UI::Colors::LimeGreen, Windows::UI::Colors::Linen, Windows::UI::Colors::Magenta, Windows::UI::Colors::Maroon, Windows::UI::Colors::MediumAquamarine, Windows::UI::Colors::MediumBlue, Windows::UI::Colors::MediumOrchid, Windows::UI::Colors::MediumPurple,
    Windows::UI::Colors::MediumSeaGreen, Windows::UI::Colors::MediumSlateBlue, Windows::UI::Colors::MediumSpringGreen, Windows::UI::Colors::MediumTurquoise, Windows::UI::Colors::MediumVioletRed, Windows::UI::Colors::MidnightBlue, Windows::UI::Colors::MintCream, Windows::UI::Colors::MistyRose,
    Windows::UI::Colors::Moccasin, Windows::UI::Colors::NavajoWhite, Windows::UI::Colors::Navy, Windows::UI::Colors::OldLace, Windows::UI::Colors::Olive, Windows::UI::Colors::OliveDrab, Windows::UI::Colors::Orange, Windows::UI::Colors::OrangeRed, Windows::UI::Colors::Orchid,
    Windows::UI::Colors::PaleGoldenrod, Windows::UI::Colors::PaleGreen, Windows::UI::Colors::PaleTurquoise, Windows::UI::Colors::PaleVioletRed, Windows::UI::Colors::PapayaWhip, Windows::UI::Colors::PeachPuff, Windows::UI::Colors::Peru, Windows::UI::Colors::Pink, Windows::UI::Colors::Plum,
    Windows::UI::Colors::PowderBlue, Windows::UI::Colors::Purple, Windows::UI::Colors::Red, Windows::UI::Colors::RosyBrown, Windows::UI::Colors::RoyalBlue, Windows::UI::Colors::SaddleBrown, Windows::UI::Colors::Salmon, Windows::UI::Colors::SandyBrown, Windows::UI::Colors::SeaGreen,
    Windows::UI::Colors::SeaShell, Windows::UI::Colors::Sienna, Windows::UI::Colors::Silver, Windows::UI::Colors::SkyBlue, Windows::UI::Colors::SlateBlue, Windows::UI::Colors::SlateGray, Windows::UI::Colors::Snow, Windows::UI::Colors::SpringGreen, Windows::UI::Colors::SteelBlue,
    Windows::UI::Colors::Tan, Windows::UI::Colors::Teal, Windows::UI::Colors::Thistle, Windows::UI::Colors::Tomato, Windows::UI::Colors::Transparent, Windows::UI::Colors::Turquoise, Windows::UI::Colors::Violet, Windows::UI::Colors::Wheat, Windows::UI::Colors::White,
    Windows::UI::Colors::WhiteSmoke, Windows::UI::Colors::Yellow, Windows::UI::Colors::YellowGreen
}

Definition at line 182 of file Functions.xaml.cpp.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/Functions.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

Functions.xaml.h File Reference

#include "Functions.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/ListsAndTemplates.xaml.cpp File Reference

  • XamlBind
  • cpp

ListsAndTemplates.xaml.cpp File Reference

#include "pch.h"
#include "ListsAndTemplates.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/ListsAndTemplates.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

ListsAndTemplates.xaml.h File Reference

#include "ListsAndTemplates.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MainPage.xaml.cpp File Reference

  • XamlBind
  • cpp

MainPage.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MainPage.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces | Enumerations

MainPage.xaml.h File Reference

#include "MainPage.g.h"
#include "SampleConfiguration.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MyUserControl1.xaml.cpp File Reference

  • XamlBind
  • cpp

MyUserControl1.xaml.cpp File Reference

#include "pch.h"
#include "MyUserControl1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MyUserControl1.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

MyUserControl1.xaml.h File Reference

#include "MyUserControl1.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/OtherBindings.xaml.cpp File Reference

  • XamlBind
  • cpp

OtherBindings.xaml.cpp File Reference

#include "pch.h"
#include "OtherBindings.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/OtherBindings.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

OtherBindings.xaml.h File Reference

#include "OtherBindings.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/pch.cpp File Reference

  • XamlBind
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/pch.h File Reference

  • XamlBind
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/PhasingTests.xaml.cpp File Reference

  • XamlBind
  • cpp

PhasingTests.xaml.cpp File Reference

#include "pch.h"
#include "PhasingTests.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/PhasingTests.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

PhasingTests.xaml.h File Reference

#include "PhasingTests.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/SampleConfiguration.cpp File Reference

  • XamlBind
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/SampleConfiguration.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/Templates.xaml.cpp File Reference

  • XamlBind
  • cpp

Templates.xaml.cpp File Reference

#include "pch.h"
#include "Templates.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/Templates.xaml.h File Reference

  • XamlBind
  • cpp
Classes | Namespaces

Templates.xaml.h File Reference

#include "Templates.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/BoolToVisibilityConverter.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

BoolToVisibilityConverter.cs File Reference

Go to the source code of this file.

Classes

class | BoolToVisibilityConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/ColorToStringConverter.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

ColorToStringConverter.cs File Reference

Go to the source code of this file.

Classes

class | ColorToStringConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Converters.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

Converters.cs File Reference

Go to the source code of this file.

Classes

class | ColorToStringConverter

Namespaces

namespace | BindTestbedModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/DOModel.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

DOModel.cs File Reference

Go to the source code of this file.

Classes

class | DOModel
class | YangContainer

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/DoubleToIntConverter.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

DoubleToIntConverter.cs File Reference

Go to the source code of this file.

Classes

class | DoubleToIntConverter
class | IntToDoubleConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Employee.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

Employee.cs File Reference

Go to the source code of this file.

Classes

class | Employee

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/EmployeeCollection.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

EmployeeCollection.cs File Reference

Go to the source code of this file.

Classes

class | EmployeeCollection
class | EmployeeDictionary
class | MapChangedEventArgs< K >
class | VectorChangedEventArgs

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/FileSystemDataSource.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

FileSystemDataSource.cs File Reference

Go to the source code of this file.

Classes

class | FileDataSource
class | FileItem

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/IEmployee.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

IEmployee.cs File Reference

Go to the source code of this file.

Classes

interface | IEmployee

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Manager.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

Manager.cs File Reference

Go to the source code of this file.

Classes

class | Manager

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Model.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

Model.cs File Reference

Go to the source code of this file.

Classes

class | DataModel

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/VeryObservableCollection.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
Classes | Namespaces

VeryObservableCollection.cs File Reference

Go to the source code of this file.

Classes

class | VeryObservableCollection-g< T >

Namespaces

namespace | BindTestbedModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Properties/AssemblyInfo.cs File Reference

  • XamlBind
  • cpp
  • xBindSampleModel
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/BasicTests.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

BasicTests.xaml.cs File Reference

Go to the source code of this file.

Classes

class | BasicTests

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/CSharpModel.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

CSharpModel.cs File Reference

Go to the source code of this file.

Classes

class | CSharpModel

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/EventTests.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

EventTests.xaml.cs File Reference

Go to the source code of this file.

Classes

class | EventTests
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/Functions.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

Functions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ColorEntry
class | Functions

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/ListsAndTemplates.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

ListsAndTemplates.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ListsAndTemplates

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/MainPage.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/MyUserControl1.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

MyUserControl1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MyUserControl1

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/OtherBindings.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

OtherBindings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | OtherBindings

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/PhasingTests.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

PhasingTests.xaml.cs File Reference

Go to the source code of this file.

Classes

class | PhasingTests

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/SampleConfiguration.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/Templates.xaml.cs File Reference

  • XamlBind
  • cs
Classes | Namespaces

Templates.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Templates

Namespaces

namespace | xBindSampleCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/BoolToVisibilityConverter.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

BoolToVisibilityConverter.cs File Reference

Go to the source code of this file.

Classes

class | BoolToVisibilityConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/ColorToStringConverter.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

ColorToStringConverter.cs File Reference

Go to the source code of this file.

Classes

class | ColorToStringConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Converters.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

Converters.cs File Reference

Go to the source code of this file.

Classes

class | ColorToStringConverter

Namespaces

namespace | BindTestbedModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/DOModel.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

DOModel.cs File Reference

Go to the source code of this file.

Classes

class | DOModel
class | YangContainer

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/DoubleToIntConverter.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

DoubleToIntConverter.cs File Reference

Go to the source code of this file.

Classes

class | DoubleToIntConverter
class | IntToDoubleConverter

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Employee.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

Employee.cs File Reference

Go to the source code of this file.

Classes

class | Employee

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/EmployeeCollection.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

EmployeeCollection.cs File Reference

Go to the source code of this file.

Classes

class | EmployeeCollection
class | EmployeeDictionary
class | MapChangedEventArgs< K >
class | VectorChangedEventArgs

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/FileSystemDataSource.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

FileSystemDataSource.cs File Reference

Go to the source code of this file.

Classes

class | FileDataSource
class | FileItem

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/IEmployee.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

IEmployee.cs File Reference

Go to the source code of this file.

Classes

interface | IEmployee

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Manager.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

Manager.cs File Reference

Go to the source code of this file.

Classes

class | Manager

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Model.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

Model.cs File Reference

Go to the source code of this file.

Classes

class | DataModel

Namespaces

namespace | xBindSampleModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/VeryObservableCollection.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
Classes | Namespaces

VeryObservableCollection.cs File Reference

Go to the source code of this file.

Classes

class | VeryObservableCollection-g< T >

Namespaces

namespace | BindTestbedModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Properties/AssemblyInfo.cs File Reference

  • XamlBind
  • cs
  • xBindSampleModel
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/pch.cpp File Reference

  • XamlBottomUpList
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/pch.h File Reference

  • XamlBottomUpList
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/SampleConfiguration.cpp File Reference

  • XamlBottomUpList
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/SampleConfiguration.h File Reference

  • XamlBottomUpList
  • cpp
Classes | Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::Helpers

Functions

Concurrency::task< void > | DelayAsync (Windows::Foundation::TimeSpan duration, Concurrency::cancellation_token cancel=Concurrency::cancellation_token::none())
Platform::String | GetCurrentDateTimeAsString ()
Windows::Foundation::TimeSpan | TimeSpanFromSeconds (int seconds)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario1_Basic.xaml.cpp File Reference

  • XamlBottomUpList
  • cpp

Scenario1_Basic.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_Basic.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario1_Basic.xaml.h File Reference

  • XamlBottomUpList
  • cpp
Classes | Namespaces

Scenario1_Basic.xaml.h File Reference

#include "Scenario1_Basic.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp File Reference

  • XamlBottomUpList
  • cpp
Classes | Namespaces

Scenario2_Load.xaml.cpp File Reference

#include "pch.h"
#include "SampleConfiguration.h"
#include "Scenario2_Load.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario2_Load.xaml.h File Reference

  • XamlBottomUpList
  • cpp
Classes | Namespaces

Scenario2_Load.xaml.h File Reference

#include "Scenario2_Load.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...
class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/SampleConfiguration.cs File Reference

  • XamlBottomUpList
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/Scenario1_Basic.xaml.cs File Reference

  • XamlBottomUpList
  • cs
Classes | Namespaces

Scenario1_Basic.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Basic

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/Scenario2_Load.xaml.cs File Reference

  • XamlBottomUpList
  • cs
Classes | Namespaces

Scenario2_Load.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ChatListView
This ListView is tailored to a Chat experience where the focus is on the last item in the list and as the user scrolls up the older messages are incrementally loaded. More...
class | Conversation
class | Scenario2_Load
class | TextMessage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/pch.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/pch.h File Reference

  • XamlCloudFontIntegration
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/SampleConfiguration.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/SampleConfiguration.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

Scenario_CloudFontOverview.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_CloudFontOverview.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

Scenario_CloudFontOverview.xaml.h File Reference

#include "Scenario_CloudFontOverview.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

Scenario_Document1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

Scenario_Document1.xaml.h File Reference

#include "Scenario_Document1.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

Scenario_Document2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

Scenario_Document2.xaml.h File Reference

#include "Scenario_Document2.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

Scenario_Document3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_Document3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

Scenario_Document3.xaml.h File Reference

#include "Scenario_Document3.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.cpp File Reference

  • XamlCloudFontIntegration
  • cpp

Scenario_SampleOverview.xaml.cpp File Reference

#include "pch.h"
#include "Scenario_SampleOverview.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.h File Reference

  • XamlCloudFontIntegration
  • cpp
Classes | Namespaces

Scenario_SampleOverview.xaml.h File Reference

#include "Scenario_SampleOverview.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/SampleConfiguration.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_CloudFontOverview.xaml.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

Scenario_CloudFontOverview.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_CloudFontOverview

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_Document1.xaml.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

Scenario_Document1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_Document1

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_Document2.xaml.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

Scenario_Document2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_Document2

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_Document3.xaml.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

Scenario_Document3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_Document3

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_SampleOverview.xaml.cs File Reference

  • XamlCloudFontIntegration
  • cs
Classes | Namespaces

Scenario_SampleOverview.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario_SampleOverview

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/App.xaml.cpp File Reference

  • XamlCommanding
  • cpp

App.xaml.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/DynamicCommandBar.cpp File Reference

  • XamlCommanding
  • cpp
Namespaces

DynamicCommandBar.cpp File Reference

#include "pch.h"
#include "DynamicCommandBar.h"

Go to the source code of this file.

Namespaces

namespace SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/DynamicCommandBar.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

DynamicCommandBar.h File Reference

#include <list>
#include <queue>
#include <stack>
#include <tuple>

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/pch.cpp File Reference

  • XamlCommanding
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/pch.h File Reference

  • XamlCommanding
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/SampleConfiguration.cpp File Reference

  • XamlCommanding
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/SampleConfiguration.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario1_AppBarButtons.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_AppBarButtons.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario1_AppBarButtons.xaml.h File Reference

#include "Scenario1_AppBarButtons.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario2_Icons.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario2_Icons.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_Icons.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario2_Icons.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario2_Icons.xaml.h File Reference

#include "Scenario2_Icons.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario3_Events.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario3_Events.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_Events.xaml.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario3_Events.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario3_Events.xaml.h File Reference

#include "Scenario3_Events.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario4_Control.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario4_Control.xaml.cpp File Reference

#include "pch.h"
#include "Scenario4_Control.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario4_Control.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario4_Control.xaml.h File Reference

#include "Scenario4_Control.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario5_Multiple.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario5_Multiple.xaml.cpp File Reference

#include "pch.h"
#include "Scenario5_Multiple.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario5_Multiple.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario5_Multiple.xaml.h File Reference

#include "Scenario5_Multiple.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario6_Styling.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario6_Styling.xaml.cpp File Reference

#include "pch.h"
#include "Scenario6_Styling.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario6_Styling.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario6_Styling.xaml.h File Reference

#include "Scenario6_Styling.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario7_CustomContent.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario7_CustomContent.xaml.cpp File Reference

#include "pch.h"
#include "Scenario7_CustomContent.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario7_CustomContent.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario7_CustomContent.xaml.h File Reference

#include "Scenario7_CustomContent.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario8_Reflow.xaml.cpp File Reference

  • XamlCommanding
  • cpp

Scenario8_Reflow.xaml.cpp File Reference

#include "pch.h"
#include "Scenario8_Reflow.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario8_Reflow.xaml.h File Reference

  • XamlCommanding
  • cpp
Classes | Namespaces

Scenario8_Reflow.xaml.h File Reference

#include "DynamicCommandBar.h"
#include "Scenario8_Reflow.g.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/DynamicCommandBar.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

DynamicCommandBar.cs File Reference

Go to the source code of this file.

Classes

class | DynamicCommandBar
We extend the CommandBar by adding logic to reflow commands as space is reduced. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/MainPage.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/SampleConfiguration.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario1.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario2.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario3.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario4.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario4.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario5.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario5.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario6.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario6.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario7.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario7.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario8.xaml.cs File Reference

  • XamlCommanding
  • cs
Classes | Namespaces

Scenario8.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Commanding
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/pch.cpp File Reference

  • XamlContextMenu
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/pch.h File Reference

  • XamlContextMenu
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/SampleConfiguration.cpp File Reference

  • XamlContextMenu
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/SampleConfiguration.h File Reference

  • XamlContextMenu
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/SampleDataModel.h File Reference

  • XamlContextMenu
  • cpp
Classes | Namespaces

SampleDataModel.h File Reference

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario1.xaml.cpp File Reference

  • XamlContextMenu
  • cpp

Scenario1.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario1.xaml.h File Reference

  • XamlContextMenu
  • cpp
Classes | Namespaces

Scenario1.xaml.h File Reference

#include "Scenario1.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario2.xaml.cpp File Reference

  • XamlContextMenu
  • cpp

Scenario2.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario2.xaml.h File Reference

  • XamlContextMenu
  • cpp
Classes | Namespaces

Scenario2.xaml.h File Reference

#include "Scenario2.g.h"
#include "MainPage.xaml.h"
#include "SampleDataModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario3.xaml.cpp File Reference

  • XamlContextMenu
  • cpp

Scenario3.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario3.xaml.h File Reference

  • XamlContextMenu
  • cpp
Classes | Namespaces

Scenario3.xaml.h File Reference

#include "Scenario3.g.h"
#include "MainPage.xaml.h"
#include "SampleDataModel.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/SampleConfiguration.cs File Reference

  • XamlContextMenu
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/SampleData.cs File Reference

  • XamlContextMenu
  • cs
Classes | Namespaces

SampleData.cs File Reference

Go to the source code of this file.

Classes

class | SampleDataModel

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/Scenario1.xaml.cs File Reference

  • XamlContextMenu
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/Scenario2.xaml.cs File Reference

  • XamlContextMenu
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/Scenario3.xaml.cs File Reference

  • XamlContextMenu
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/App.xaml.cs File Reference

  • XamlCustomMediaTransportControls
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | CustomMediaTransportControls
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/CustomMediaTransportControls.cs File Reference

  • XamlCustomMediaTransportControls
  • cs
Classes | Namespaces

CustomMediaTransportControls.cs File Reference

Go to the source code of this file.

Classes

class | CustomMediaTransportControls

Namespaces

namespace | CustomMediaTransportControls
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/MainPage.xaml.cs File Reference

  • XamlCustomMediaTransportControls
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | CustomMediaTransportControls
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/Properties/AssemblyInfo.cs File Reference

  • XamlCustomMediaTransportControls
  • cs
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/MainPage.xaml.cs File Reference

  • XamlDataVirtualization
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/SampleConfiguration.cs File Reference

  • XamlDataVirtualization
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/FileDataSource.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

FileDataSource.cs File Reference

Go to the source code of this file.

Classes

class | FileDataSource
A custom datasource over the file system that supports data virtualization. More...

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/FileItem.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

FileItem.cs File Reference

Go to the source code of this file.

Classes

class | FileItem
Represents a file and its properties. More...

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

ItemCacheManager.cs File Reference

Go to the source code of this file.

Classes

class | CacheChangedEventArgs-g< T >
class | ItemCacheManager< T >
class | ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemIndexRangeExtensions.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

ItemIndexRangeExtensions.cs File Reference

Go to the source code of this file.

Classes

class | ItemIndexRangeExtensions

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemIndexRangeList.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

ItemIndexRangeList.cs File Reference

Go to the source code of this file.

Classes

class | ItemIndexRangeList
Represents a sorted collection of discontiguous ItemIndexRanges. More...

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/Scenario1.xaml.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario1
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario2/FileDataSource2.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario2
Classes | Namespaces

FileDataSource2.cs File Reference

Go to the source code of this file.

Classes

class | FileDataSource2
A custom datasource over the file system that supports data virtualization. More...

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario2/Scenario2.xaml.cs File Reference

  • XamlDataVirtualization
  • cs
  • Scenario2
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2

Namespaces

namespace | DataVirtualizationSample
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/MainPage.xaml.cs File Reference

  • XamlDeferLoadStrategy
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/SampleConfiguration.cs File Reference

  • XamlDeferLoadStrategy
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/TitledImage.cs File Reference

  • XamlDeferLoadStrategy
  • cs
Classes | Namespaces

TitledImage.cs File Reference

Go to the source code of this file.

Classes

class | TitledImage

Namespaces

namespace | xDeferLoadStrategy
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs File Reference

  • XamlDeferLoadStrategy
  • cs
  • Scenarios
Classes | Namespaces

AdaptivePage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Account
class | AdaptivePage
An empty page that can be used on its own or navigated to within a Frame. More...
class | Email

Namespaces

namespace | xDeferLoadStrategy
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/BasicDeferral.xaml.cs File Reference

  • XamlDeferLoadStrategy
  • cs
  • Scenarios
Classes | Namespaces

BasicDeferral.xaml.cs File Reference

Go to the source code of this file.

Classes

class | BasicDeferral
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | xDeferLoadStrategy
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/DeferredControlTemplatePart.xaml.cs File Reference

  • XamlDeferLoadStrategy
  • cs
  • Scenarios
Classes | Namespaces

DeferredControlTemplatePart.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DeferredControlTemplatePart
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | xDeferLoadStrategy
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/pch.cpp File Reference

  • XamlDragAndDrop
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/pch.h File Reference

  • XamlDragAndDrop
  • cpp

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <random>
#include "App.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/SampleConfiguration.cpp File Reference

  • XamlDragAndDrop
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/SampleConfiguration.h File Reference

  • XamlDragAndDrop
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario1_ListView.xaml.cpp File Reference

  • XamlDragAndDrop
  • cpp

Scenario1_ListView.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_ListView.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario1_ListView.xaml.h File Reference

  • XamlDragAndDrop
  • cpp
Classes | Namespaces

Scenario1_ListView.xaml.h File Reference

#include "Scenario1_ListView.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario2_DragUICustomization.xaml.cpp File Reference

  • XamlDragAndDrop
  • cpp

Scenario2_DragUICustomization.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_DragUICustomization.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario2_DragUICustomization.xaml.h File Reference

  • XamlDragAndDrop
  • cpp
Classes | Namespaces

Scenario2_DragUICustomization.xaml.h File Reference

#include "Scenario2_DragUICustomization.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.cpp File Reference

  • XamlDragAndDrop
  • cpp

Scenario3_StartDragAsync.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_StartDragAsync.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.h File Reference

  • XamlDragAndDrop
  • cpp
Classes | Namespaces

Scenario3_StartDragAsync.xaml.h File Reference

#include "Scenario3_StartDragAsync.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/SampleConfiguration.cs File Reference

  • XamlDragAndDrop
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/Scenario1_ListView.xaml.cs File Reference

  • XamlDragAndDrop
  • cs
Classes | Namespaces

Scenario1_ListView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_ListView
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | DragAndDropSampleManaged
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/Scenario2_DragUICustomization.xaml.cs File Reference

  • XamlDragAndDrop
  • cs
Classes | Namespaces

Scenario2_DragUICustomization.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_DragUICustomization
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | DragAndDropSampleManaged
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/Scenario3_StartDragAsync.xaml.cs File Reference

  • XamlDragAndDrop
  • cs
Classes | Namespaces

Scenario3_StartDragAsync.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_StartDragAsync
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | DragAndDropSampleManaged
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/MainPage.xaml.cs File Reference

  • XamlFocusVisuals
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/SampleConfiguration.cs File Reference

  • XamlFocusVisuals
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/SocialMediaCounter.cs File Reference

  • XamlFocusVisuals
  • cs
Classes | Namespaces

SocialMediaCounter.cs File Reference

Go to the source code of this file.

Classes

class | SocialMediaCounter

Namespaces

namespace | FocusVisualsSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/Scenarios/CustomControlUsage.xaml.cs File Reference

  • XamlFocusVisuals
  • cs
  • Scenarios
Classes | Namespaces

CustomControlUsage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomControlUsage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FocusVisualsSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/Scenarios/CustomFocusVisuals.xaml.cs File Reference

  • XamlFocusVisuals
  • cs
  • Scenarios
Classes | Namespaces

CustomFocusVisuals.xaml.cs File Reference

Go to the source code of this file.

Classes

class | CustomFocusVisuals
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | FocusVisualsSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/SampleConfiguration.cs File Reference

  • XamlGamepadNavigation
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...
class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/Scenario1_Directions.xaml.cs File Reference

  • XamlGamepadNavigation
  • cs
Classes | Namespaces

Scenario1_Directions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_Directions

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/Scenario2_Engage.xaml.cs File Reference

  • XamlGamepadNavigation
  • cs
Classes | Namespaces

Scenario2_Engage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_Engage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/Scenario3_Legacy.xaml.cs File Reference

  • XamlGamepadNavigation
  • cs
Classes | Namespaces

Scenario3_Legacy.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_Legacy

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/TransportOptions.xaml.cs File Reference

  • XamlGamepadNavigation
  • cs
Classes | Namespaces

TransportOptions.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TransportOptions

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Contact.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces | Functions

Contact.cpp File Reference

#include "pch.h"
#include "Contact.h"
#include "Contact.g.cpp"
#include <random>

Go to the source code of this file.

Namespaces

namespace | anonymous_namespace{Contact.cpp}
namespace | winrt::SDKTemplate::implementation

Functions

template<typename T >
T | random_below (T limit)
auto & | random_generator ()
template<typename T >
T | random_in_range (T minValue, T maxValue)
template<typename T >
T const & | random_select (std::vector< T > const &source)
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Contact.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Contact.h File Reference

#include "Contact.g.h"

Go to the source code of this file.

Classes

struct | Contact

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/DetailsPage.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

DetailsPage.cpp File Reference

#include "pch.h"
#include "DetailsPage.h"
#include "DetailsPage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/DetailsPage.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

DetailsPage.h File Reference

#include "DetailsPage.g.h"

Go to the source code of this file.

Classes

struct | DetailsPage
struct | DetailsPage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/EdgeTappedListView.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

EdgeTappedListView.cpp File Reference

#include "pch.h"
#include "EdgeTappedListView.h"
#include "EdgeTappedListView.g.cpp"
#include "ListViewEdgeTappedEventArgs.g.cpp"
#include <mutex>

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/EdgeTappedListView.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

EdgeTappedListView.h File Reference

#include "ListViewEdgeTappedEventArgs.g.h"
#include "EdgeTappedListView.g.h"

Go to the source code of this file.

Classes

struct | EdgeTappedListView
struct | EdgeTappedListView
struct | EdgeTappedListView::ContainerEventTokens
struct | ListViewEdgeTappedEventArgs

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/GroupInfoList.cpp File Reference

  • XamlListView
  • cppwinrt

GroupInfoList.cpp File Reference

#include "pch.h"
#include "GroupInfoList.h"
#include "GroupInfoList.g.cpp"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/GroupInfoList.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

GroupInfoList.h File Reference

#include "GroupInfoList.g.h"

Go to the source code of this file.

Classes

struct | GroupInfoList
struct | GroupInfoList

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/ImagePage.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

ImagePage.cpp File Reference

#include "pch.h"
#include "ImagePage.h"
#include "ImagePage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/ImagePage.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

ImagePage.h File Reference

#include "ImagePage.g.h"

Go to the source code of this file.

Classes

struct | ImagePage
struct | ImagePage

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Item.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Item.cpp File Reference

#include "pch.h"
#include "Item.h"
#include "Item.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Item.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Item.h File Reference

#include "Item.g.h"

Go to the source code of this file.

Classes

struct | Item

Namespaces

namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/pch.cpp File Reference

  • XamlListView
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/pch.h File Reference

  • XamlListView
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Devices.Input.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Input.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Input.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Media.Animation.h>
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.UI.Xaml.Shapes.h>
#include <winrt/SDKTemplate.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Project.idl File Reference

  • XamlListView
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_SimpleListView
runtimeclass | Scenario2_SimpleGridView
runtimeclass | Scenario3_MasterDetail
runtimeclass | Scenario4_EdgeTappedListView
runtimeclass | Scenario5_RestoreScrollPosition
runtimeclass | Scenario6_ScrollIntoView
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/SampleConfiguration.cpp File Reference

  • XamlListView
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/SampleConfiguration.h File Reference

  • XamlListView
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario1_SimpleListView.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario1_SimpleListView.cpp File Reference

#include "pch.h"
#include "Contact.h"
#include "Scenario1_SimpleListView.h"
#include "Scenario1_SimpleListView.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario1_SimpleListView.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario1_SimpleListView.h File Reference

#include "Scenario1_SimpleListView.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_SimpleListView
struct | Scenario1_SimpleListView

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario2_SimpleGridView.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario2_SimpleGridView.cpp File Reference

#include "pch.h"
#include "Contact.h"
#include "Scenario2_SimpleGridView.h"
#include "Scenario2_SimpleGridView.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario2_SimpleGridView.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario2_SimpleGridView.h File Reference

#include "Scenario2_SimpleGridView.g.h"

Go to the source code of this file.

Classes

struct | Scenario2_SimpleGridView
struct | Scenario2_SimpleGridView

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario3_MasterDetail.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario3_MasterDetail.cpp File Reference

#include "pch.h"
#include "Contact.h"
#include "Scenario3_MasterDetail.h"
#include "Scenario3_MasterDetail.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario3_MasterDetail.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario3_MasterDetail.h File Reference

#include "Scenario3_MasterDetail.g.h"

Go to the source code of this file.

Classes

struct | Scenario3_MasterDetail
struct | Scenario3_MasterDetail

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario4_EdgeTappedListView.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario4_EdgeTappedListView.cpp File Reference

#include "pch.h"
#include "Contact.h"
#include "Scenario4_EdgeTappedListView.h"
#include "Scenario4_EdgeTappedListView.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario4_EdgeTappedListView.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario4_EdgeTappedListView.h File Reference

#include "EdgeTappedListView.h"
#include "Scenario4_EdgeTappedListView.g.h"

Go to the source code of this file.

Classes

struct | Scenario4_EdgeTappedListView
struct | Scenario4_EdgeTappedListView

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario5_RestoreScrollPosition.cpp File Reference

#include "pch.h"
#include "Scenario5_RestoreScrollPosition.h"
#include "Scenario5_RestoreScrollPosition.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario5_RestoreScrollPosition.h File Reference

#include "Item.h"
#include "Scenario5_RestoreScrollPosition.g.h"

Go to the source code of this file.

Classes

struct | Scenario5_RestoreScrollPosition
struct | Scenario5_RestoreScrollPosition

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario6_ScrollIntoView.cpp File Reference

  • XamlListView
  • cppwinrt
Namespaces

Scenario6_ScrollIntoView.cpp File Reference

#include "pch.h"
#include "Scenario6_ScrollIntoView.h"
#include "Scenario6_ScrollIntoView.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario6_ScrollIntoView.h File Reference

  • XamlListView
  • cppwinrt
Classes | Namespaces

Scenario6_ScrollIntoView.h File Reference

#include "Item.h"
#include "Scenario6_ScrollIntoView.g.h"

Go to the source code of this file.

Classes

struct | Scenario6_ScrollIntoView
struct | Scenario6_ScrollIntoView

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Contact.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Contact.cs File Reference

Go to the source code of this file.

Classes

class | Contact

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/DetailsPage.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

DetailsPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DetailsPage

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/EdgeTappedListView.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

EdgeTappedListView.cs File Reference

Go to the source code of this file.

Classes

class | EdgeTappedListView
class | ListViewEdgeTappedEventArgs

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/GroupInfoList.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

GroupInfoList.cs File Reference

Go to the source code of this file.

Classes

class | GroupInfoList

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/ImagePage.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

ImagePage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ImagePage
Page2 is simply a blank page with a button to navigate back to the MainPage. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Item.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Item.cs File Reference

Go to the source code of this file.

Classes

class | Item
items that are in the observable collection (ItemList) More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/SampleConfiguration.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario1_SimpleListView.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario1_SimpleListView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_SimpleListView

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario2_SimpleGridView.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario2_SimpleGridView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_SimpleGridView

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario3_MasterDetail.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario3_MasterDetail.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_MasterDetail

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario4_EdgeTappedListView.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario4_EdgeTappedListView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_EdgeTappedListView

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario5_RestoreScrollPosition.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario5_RestoreScrollPosition.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_RestoreScrollPosition

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario6_ScrollIntoView.xaml.cs File Reference

  • XamlListView
  • cs
Classes | Namespaces

Scenario6_ScrollIntoView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_ScrollIntoView

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/App.cpp File Reference

  • XamlMasterDetail
  • cppwinrt

App.cpp File Reference

#include "pch.h"
#include "App.h"
#include "MasterDetailPage.h"
#include "DetailPage.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/App.h File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

App.h File Reference

#include "App.xaml.g.h"

Go to the source code of this file.

Classes

struct | App

Namespaces

namespace | winrt::MasterDetailApp::implementation
Generated on Fri Nov 15 2024 22:22:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/DetailPage.cpp File Reference

  • XamlMasterDetail
  • cppwinrt
Namespaces

DetailPage.cpp File Reference

#include "pch.h"
#include "DetailPage.h"
#include "DetailPage.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::MasterDetailApp::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/DetailPage.h File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

DetailPage.h File Reference

#include "DetailPage.g.h"

Go to the source code of this file.

Classes

struct | DetailPage
struct | DetailPage

Namespaces

namespace | winrt::MasterDetailApp::factory_implementation
namespace | winrt::MasterDetailApp::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/Item.cpp File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

Item.cpp File Reference

#include "pch.h"
#include <winrt/MasterDetailApp.Data.h>
#include "Data.Item.g.h"
#include "Data.Item.g.cpp"

Go to the source code of this file.

Classes

struct | Item
struct | Item

Namespaces

namespace | winrt::MasterDetailApp::Data::factory_implementation
namespace | winrt::MasterDetailApp::Data::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/ItemsDataSource.h File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

ItemsDataSource.h File Reference

Go to the source code of this file.

Classes

struct | ItemsDataSource

Namespaces

namespace | winrt::MasterDetailApp
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/ItemViewModel.cpp File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

ItemViewModel.cpp File Reference

#include "pch.h"
#include "ViewModels.ItemViewModel.g.h"
#include "ViewModels.ItemViewModel.g.cpp"

Go to the source code of this file.

Classes

struct | ItemViewModel
struct | ItemViewModel

Namespaces

namespace | winrt::MasterDetailApp::ViewModels::factory_implementation
namespace | winrt::MasterDetailApp::ViewModels::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/MasterDetailPage.cpp File Reference

  • XamlMasterDetail
  • cppwinrt
Namespaces

MasterDetailPage.cpp File Reference

#include "pch.h"
#include "MasterDetailPage.h"
#include "MasterDetailPage.g.cpp"
#include "ItemsDataSource.h"
#include <algorithm>

Go to the source code of this file.

Namespaces

namespace winrt::MasterDetailApp::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/MasterDetailPage.h File Reference

  • XamlMasterDetail
  • cppwinrt
Classes | Namespaces

MasterDetailPage.h File Reference

#include "MasterDetailPage.g.h"

Go to the source code of this file.

Classes

struct | MasterDetailPage
struct | MasterDetailPage

Namespaces

namespace | winrt::MasterDetailApp::factory_implementation
namespace | winrt::MasterDetailApp::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/pch.cpp File Reference

  • XamlMasterDetail
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/pch.h File Reference

  • XamlMasterDetail
  • cppwinrt

pch.h File Reference

#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Globalization.DateTimeFormatting.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.Animation.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include "winrt/MasterDetailApp.h"
#include "winrt/MasterDetailApp.Data.h"
#include "winrt/MasterDetailApp.ViewModels.h"
#include "ItemsDataSource.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/Project.idl File Reference

  • XamlMasterDetail
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | MasterDetailApp
namespace | MasterDetailApp::Data
namespace | MasterDetailApp::ViewModels

Variables

runtimeclass | DetailPage
runtimeclass | MasterDetailPage
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/SampleConfiguration.cpp File Reference

  • XamlMasterDetail
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/SampleConfiguration.h File Reference

  • XamlMasterDetail
  • cppwinrt
Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/App.xaml.cs File Reference

  • XamlMasterDetail
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | MasterDetailApp
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/DetailPage.xaml.cs File Reference

  • XamlMasterDetail
  • cs
Classes | Namespaces

DetailPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | DetailPage

Namespaces

namespace | MasterDetailApp
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/MasterDetailPage.xaml.cs File Reference

  • XamlMasterDetail
  • cs
Classes | Namespaces

MasterDetailPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MasterDetailPage

Namespaces

namespace | MasterDetailApp
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Data/Item.cs File Reference

  • XamlMasterDetail
  • cs
  • Data
Classes | Namespaces

Item.cs File Reference

Go to the source code of this file.

Classes

class | Item

Namespaces

namespace | MasterDetailApp::Data
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Data/ItemsDataSource.cs File Reference

  • XamlMasterDetail
  • cs
  • Data
Classes | Namespaces

ItemsDataSource.cs File Reference

Go to the source code of this file.

Classes

class | ItemsDataSource

Namespaces

namespace | MasterDetailApp::Data
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Properties/AssemblyInfo.cs File Reference

  • XamlMasterDetail
  • cs
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/ViewModels/ItemViewModel.cs File Reference

  • XamlMasterDetail
  • cs
  • ViewModels
Classes | Namespaces

ItemViewModel.cs File Reference

Go to the source code of this file.

Classes

class | ItemViewModel

Namespaces

namespace | MasterDetailApp::ViewModels
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/MainPage.xaml.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces | Enumerations

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
class | ScenarioBindingConverter

Namespaces

namespace | SDKTemplate

Enumerations

enum NotifyType {
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage,
StatusMessage, ErrorMessage, StatusMessage, ErrorMessage
}
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/SampleConfiguration.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/SampleData.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

SampleData.cs File Reference

Go to the source code of this file.

Classes

class | SampleDataModel

Namespaces

namespace | PivotCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/Scenario1.xaml.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

Scenario1.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PivotCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/Scenario2.xaml.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

Scenario2.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | PivotCS
Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/Scenario3.xaml.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

Scenario3.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3

Namespaces

namespace | PivotCS
Generated on Fri Nov 15 2024 22:22:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/TabHeader.xaml.cs File Reference

  • XamlPivot
  • cs
Classes | Namespaces

TabHeader.xaml.cs File Reference

Go to the source code of this file.

Classes

class | TabHeader

Namespaces

namespace | PivotCS
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/App.xaml.cs File Reference

  • XamlStateTriggers
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | StateTriggersSample
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ItemTemplateControl.xaml.cs File Reference

  • XamlStateTriggers
  • cs
Classes | Namespaces

ItemTemplateControl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ItemTemplateControl

Namespaces

namespace | StateTriggersSample
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/MainPage.xaml.cs File Reference

  • XamlStateTriggers
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | StateTriggersSample
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/CustomTriggers/ControlSizeTrigger.cs File Reference

  • XamlStateTriggers
  • cs
  • CustomTriggers
Classes | Namespaces

ControlSizeTrigger.cs File Reference

Go to the source code of this file.

Classes

class | ControlSizeTrigger

Namespaces

namespace | StateTriggersSample::CustomTriggers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/CustomTriggers/DeviceFamilyTrigger.cs File Reference

  • XamlStateTriggers
  • cs
  • CustomTriggers
Classes | Namespaces

DeviceFamilyTrigger.cs File Reference

Go to the source code of this file.

Classes

class | DeviceFamilyTrigger

Namespaces

namespace | StateTriggersSample::CustomTriggers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/CustomTriggers/InputTypeTrigger.cs File Reference

  • XamlStateTriggers
  • cs
  • CustomTriggers
Classes | Namespaces

InputTypeTrigger.cs File Reference

Go to the source code of this file.

Classes

class | InputTypeTrigger

Namespaces

namespace | StateTriggersSample::CustomTriggers
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/Properties/AssemblyInfo.cs File Reference

  • XamlStateTriggers
  • cs
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ViewModel/MainViewModel.cs File Reference

  • XamlStateTriggers
  • cs
  • ViewModel
Classes | Namespaces

MainViewModel.cs File Reference

Go to the source code of this file.

Classes

class | MainViewModel

Namespaces

namespace | StateTriggersSample::ViewModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ViewModel/Model.cs File Reference

  • XamlStateTriggers
  • cs
  • ViewModel
Classes | Namespaces

Model.cs File Reference

Go to the source code of this file.

Classes

class | Model

Namespaces

namespace | StateTriggersSample::ViewModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/App.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | OneHandedUse_TailoredMultipleViews
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | OneHandedUse_TailoredMultipleViews
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage_OneHanded.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
Classes | Namespaces

MainPage_OneHanded.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage_OneHanded
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | OneHandedUse_TailoredMultipleViews
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.cpp File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

DisplaySizeClass.cpp File Reference

#include "pch.h"
#include "DisplaySizeClass.h"
#include "sysinfoapi.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.h File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper
Classes | Namespaces

DisplaySizeClass.h File Reference

Go to the source code of this file.

Classes

class | sealed

Namespaces

namespace | DisplaySizeHelper
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/pch.cpp File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/pch.h File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/Properties/AssemblyInfo.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Albums.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • UserControls
Classes | Namespaces

Albums.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Albums

Namespaces

namespace | OneHandedUse_TailoredMultipleViews::UserControls
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Collections.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • UserControls
Classes | Namespaces

Collections.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Collections

Namespaces

namespace | OneHandedUse_TailoredMultipleViews::UserControls
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/Settings.xaml.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • UserControls
Classes | Namespaces

Settings.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Settings

Namespaces

namespace | OneHandedUse_TailoredMultipleViews::UserControls
Generated on Fri Nov 15 2024 22:22:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/MainViewModel.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • ViewModel
Classes | Namespaces

MainViewModel.cs File Reference

Go to the source code of this file.

Classes

class | MainViewModel

Namespaces

namespace | OneHandedUse_TailoredMultipleViews::ViewModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/Model.cs File Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • ViewModel
Classes | Namespaces

Model.cs File Reference

Go to the source code of this file.

Classes

class | Model

Namespaces

namespace | OneHandedUse_TailoredMultipleViews::ViewModel
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/App.xaml.cs File Reference

  • XamlTransform3DAnimations
  • cs
Classes | Namespaces

App.xaml.cs File Reference

Go to the source code of this file.

Classes

class | App
Provides application-specific behavior to supplement the default Application class. More...

Namespaces

namespace | Transform3DAnimations
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ArticlePage.xaml.cs File Reference

  • XamlTransform3DAnimations
  • cs
Classes | Namespaces

ArticlePage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | ArticlePage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Transform3DAnimations
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/MainPage.xaml.cs File Reference

  • XamlTransform3DAnimations
  • cs
Classes | Namespaces

MainPage.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Transform3DAnimations
Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/SectionView.xaml.cs File Reference

  • XamlTransform3DAnimations
  • cs
Classes | Namespaces

SectionView.xaml.cs File Reference

Go to the source code of this file.

Classes

class | SectionView

Namespaces

namespace | Transform3DAnimations
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/Properties/AssemblyInfo.cs File Reference

  • XamlTransform3DAnimations
  • cs
  • Properties

AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ViewModels/ArticleViewModel.cs File Reference

  • XamlTransform3DAnimations
  • cs
  • ViewModels
Classes | Namespaces

ArticleViewModel.cs File Reference

Go to the source code of this file.

Classes

class | ArticleViewModel

Namespaces

namespace | Transform3DAnimations::ViewModels
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ViewModels/HeroArticlesViewModel.cs File Reference

  • XamlTransform3DAnimations
  • cs
  • ViewModels
Classes | Namespaces

HeroArticlesViewModel.cs File Reference

Go to the source code of this file.

Classes

class | HeroArticlesViewModel

Namespaces

namespace | Transform3DAnimations::ViewModels
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/SampleConfiguration.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario10_UnviewableContent.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario10_UnviewableContent.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario10_UnviewableContent
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario1_NavToUrl.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario1_NavToUrl.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario1_NavToUrl

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario2_NavToString.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario2_NavToString.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario2_NavToString
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario3_InvokeScript.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario3_InvokeScript.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario3_InvokeScript

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario4_ScriptNotify.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario4_ScriptNotify.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario4_ScriptNotify

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario5_NavToFiles.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario5_NavToFiles.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario5_NavToFiles

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario6_NavToStream.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario6_NavToStream.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario6_NavToStream
An empty page that can be used on its own or navigated to within a Frame. More...
class | Scenario6_NavToStream::StreamUriWinRTResolver
Sample URI resolver object for use with NavigateToLocalStreamUri. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario7_Share.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario7_Share.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario7_Share
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario8_CaptureBitmap.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario8_CaptureBitmap.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario8_CaptureBitmap

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario9_ContainsFullScreenElement.xaml.cs File Reference

  • XamlWebView
  • cs
Classes | Namespaces

Scenario9_ContainsFullScreenElement.xaml.cs File Reference

Go to the source code of this file.

Classes

class | Scenario9_ContainsFullScreenElement
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/SampleConfiguration.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

SampleConfiguration.cs File Reference

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario1_BuildNewRss.xaml.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

Scenario1_BuildNewRss.xaml.cs File Reference

Go to the source code of this file.

Classes

class | BuildNewRss
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Xml
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario2_MarkHotProducts.xaml.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

Scenario2_MarkHotProducts.xaml.cs File Reference

Go to the source code of this file.

Classes

class | MarkHotProducts
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Xml
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario3_XmlLoading.xaml.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

Scenario3_XmlLoading.xaml.cs File Reference

Go to the source code of this file.

Classes

class | XmlLoading
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Xml
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario4_GiftDispatch.xaml.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

Scenario4_GiftDispatch.xaml.cs File Reference

Go to the source code of this file.

Classes

class | GiftDispatch
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Xml
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario5_XSLTTransform.xaml.cs File Reference

  • XmlDocument
  • cs
Classes | Namespaces

Scenario5_XSLTTransform.xaml.cs File Reference

Go to the source code of this file.

Classes

class | XSLTTransform
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | Xml
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/pch.cpp File Reference

  • XmlLite
  • cpp

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/pch.h File Reference

  • XmlLite
  • cpp
Defines

pch.h File Reference

#include <collection.h>
#include <ppltasks.h>
#include <shcore.h>
#include <wrl.h>
#include <xmllite.h>
#include "App.xaml.h"

Go to the source code of this file.

Defines

#define ChkHr(stmt) do { hr = stmt; if (FAILED(hr)) return hr; } while(0)

Define Documentation

#define ChkHr ( stmt ) do { hr = stmt; if (FAILED(hr)) return hr; } while(0)

Definition at line 13 of file pch.h.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/SampleConfiguration.cpp File Reference

  • XmlLite
  • cpp

SampleConfiguration.cpp File Reference

#include "pch.h"
#include "MainPage.xaml.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/SampleConfiguration.h File Reference

  • XmlLite
  • cpp
Classes | Namespaces

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Classes

class | MainPage
An empty page that can be used on its own or navigated to within a Frame. More...
struct | Scenario
Scenario Class Object. More...

Namespaces

namespace | SDKTemplate
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario1_XmlReader.xaml.cpp File Reference

  • XmlLite
  • cpp

Scenario1_XmlReader.xaml.cpp File Reference

#include "pch.h"
#include "Scenario1_XmlReader.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario1_XmlReader.xaml.h File Reference

  • XmlLite
  • cpp
Classes | Namespaces

Scenario1_XmlReader.xaml.h File Reference

#include "Scenario1_XmlReader.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::XmlLite
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario2_XmlWriter.xaml.cpp File Reference

  • XmlLite
  • cpp

Scenario2_XmlWriter.xaml.cpp File Reference

#include "pch.h"
#include "Scenario2_XmlWriter.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario2_XmlWriter.xaml.h File Reference

  • XmlLite
  • cpp
Classes | Namespaces

Scenario2_XmlWriter.xaml.h File Reference

#include "pch.h"
#include "Scenario2_XmlWriter.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::XmlLite
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario3_XmlWriterLite.xaml.cpp File Reference

  • XmlLite
  • cpp

Scenario3_XmlWriterLite.xaml.cpp File Reference

#include "pch.h"
#include "Scenario3_XmlWriterLite.xaml.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario3_XmlWriterLite.xaml.h File Reference

  • XmlLite
  • cpp
Classes | Namespaces

Scenario3_XmlWriterLite.xaml.h File Reference

#include "pch.h"
#include "Scenario3_XmlWriterLite.g.h"
#include "MainPage.xaml.h"

Go to the source code of this file.

Classes

class | sealed
An empty page that can be used on its own or navigated to within a Frame. More...

Namespaces

namespace | SDKTemplate
namespace | SDKTemplate::XmlLite
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/pch.cpp File Reference

  • XmlLite
  • cppwinrt

pch.cpp File Reference

#include "pch.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/pch.h File Reference

  • XmlLite
  • cppwinrt

pch.h File Reference

#include <shcore.h>
#include <xmllite.h>
#include <hstring.h>
#include "winrt/Windows.Foundation.h"
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.ApplicationModel.h"
#include "winrt/Windows.ApplicationModel.Activation.h"
#include "winrt/Windows.Storage.h"
#include "winrt/Windows.Storage.Streams.h"
#include "winrt/Windows.System.h"
#include "winrt/Windows.UI.Core.h"
#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
#include "winrt/Windows.UI.Xaml.Controls.h"
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
#include "winrt/Windows.UI.Xaml.Documents.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Media.h"
#include "winrt/Windows.UI.Xaml.Navigation.h"
#include <sstream>

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Project.idl File Reference

  • XmlLite
  • cppwinrt
Namespaces | Variables

Project.idl File Reference

Go to the source code of this file.

Namespaces

namespace | SDKTemplate

Variables

runtimeclass | Scenario1_XmlReader
runtimeclass | Scenario2_XmlWriter
runtimeclass | Scenario3_XmlWriterLite
Generated on Fri Nov 15 2024 22:22:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/SampleConfiguration.cpp File Reference

  • XmlLite
  • cppwinrt

SampleConfiguration.cpp File Reference

#include "pch.h"
#include <winrt/SDKTemplate.h>
#include "MainPage.h"
#include "SampleConfiguration.h"

Go to the source code of this file.

Generated on Fri Nov 15 2024 22:22:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/SampleConfiguration.h File Reference

  • XmlLite
  • cppwinrt
Namespaces | Functions

SampleConfiguration.h File Reference

#include "pch.h"

Go to the source code of this file.

Namespaces

namespace | winrt::SDKTemplate

Functions

bool | check_enumerator (hresult hr)
Generated on Fri Nov 15 2024 22:22:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario1_XmlReader.cpp File Reference

  • XmlLite
  • cppwinrt
Namespaces

Scenario1_XmlReader.cpp File Reference

#include "pch.h"
#include "Scenario1_XmlReader.h"
#include "Scenario1_XmlReader.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario1_XmlReader.h File Reference

  • XmlLite
  • cppwinrt
Classes | Namespaces

Scenario1_XmlReader.h File Reference

#include "Scenario1_XmlReader.g.h"

Go to the source code of this file.

Classes

struct | Scenario1_XmlReader
struct | Scenario1_XmlReader

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario2_XmlWriter.cpp File Reference

  • XmlLite
  • cppwinrt
Namespaces

Scenario2_XmlWriter.cpp File Reference

#include "pch.h"
#include "Scenario2_XmlWriter.h"
#include "Scenario2_XmlWriter.g.cpp"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario2_XmlWriter.h File Reference

  • XmlLite
  • cppwinrt
Classes | Namespaces

Scenario2_XmlWriter.h File Reference

#include "Scenario2_XmlWriter.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario2_XmlWriter
struct | Scenario2_XmlWriter

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario3_XmlWriterLite.cpp File Reference

  • XmlLite
  • cppwinrt
Namespaces

Scenario3_XmlWriterLite.cpp File Reference

#include "pch.h"
#include "Scenario3_XmlWriterLite.h"
#include "Scenario3_XmlWriterLite.g.cpp"
#include "SampleConfiguration.h"

Go to the source code of this file.

Namespaces

namespace winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario3_XmlWriterLite.h File Reference

  • XmlLite
  • cppwinrt
Classes | Namespaces

Scenario3_XmlWriterLite.h File Reference

#include "Scenario3_XmlWriterLite.g.h"
#include "MainPage.h"

Go to the source code of this file.

Classes

struct | Scenario3_XmlWriterLite
struct | Scenario3_XmlWriterLite

Namespaces

namespace | winrt::SDKTemplate::factory_implementation
namespace | winrt::SDKTemplate::implementation
Generated on Fri Nov 15 2024 22:23:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Directory Hierarchy

Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • 360VideoPlayback
    • cpp
      • Common
      • Content
    • cs
      • Common
      • Content
  • 3DPrinting
    • cppwinrt
    • cs
  • 3DPrintingFromUnity
    • Assets
      • Script
  • Accelerometer
    • cpp
    • cs
  • ActivitySensor
    • cpp
      • Tasks
    • cs
      • Tasks
        • Properties
  • AdaptiveStreaming
    • cs
      • Controls
      • Helpers
      • Models
      • Shared
  • AdvancedCasting
    • cs
      • Controls
      • Data
        • Azure
        • Common
      • Util
  • AllJoyn
    • Common
      • Scenario1WinRTComponent
      • Scenario2WinRTComponent
    • ConsumerExperiences
      • cs
    • ProducerExperiences
      • cs
    • shared
  • Altimeter
    • cpp
    • cs
  • AnimationMetrics
    • cpp
    • cs
  • ApplicationData
    • cppwinrt
    • cs
  • ApplicationResources
    • cpp
    • cs
      • AppResourceClassLibrary
        • Properties
  • Appointments
    • cs
  • AppServices
    • cppwinrt
      • AppServicesClient
      • AppServicesProvider
      • RandomNumberService
    • cs
      • AppServicesClient
      • AppServicesProvider
      • RandomNumberService
        • Properties
  • AppWindow
    • cppwinrt
    • cs
  • AssociationLaunching
    • cs
  • AudioCategory
    • cs
      • AudioCategory
  • AudioCreation
    • cs
      • AudioCreation
      • CustomEffect
        • Properties
  • BackButton
    • cpp
    • cs
  • BackgroundActivation
    • cpp
    • cs
  • BackgroundMediaPlayback
    • cs
      • DataModels
      • Services
      • ViewModels
      • Views
  • BackgroundSensors
    • cpp
      • BackgroundTask
    • cs
      • BackgroundTask
        • Properties
  • BackgroundTask
    • cpp
      • BackgroundTask
      • Tasks
    • cs
      • BackgroundTask
      • Tasks
        • Properties
  • BackgroundTransfer
    • cpp
      • BackgroundTransfer
      • Tasks
    • cs
      • BackgroundTransfer
      • Tasks
        • Properties
  • BarcodeScanner
    • cppwinrt
    • cs
  • BarcodeScannerProvider
    • cpp
      • BarcodeDecoder
      • BarcodeScannerProvider
    • cs
      • BarcodeDecoder
        • Properties
      • BarcodeScannerProvider
  • Barometer
    • cpp
    • cs
  • BasicFaceDetection
    • cppwinrt
    • cs
  • BasicFaceTracking
    • cppwinrt
    • cs
  • BasicHologram
    • cpp
      • Common
      • Content
    • cppwinrt
      • Common
      • Content
    • cs
      • Common
      • Content
  • BasicInput
    • cpp
    • cs
  • BasicMediaCasting
    • cs
  • BasicSuspension
    • cs
      • Common
  • BluetoothAdvertisement
    • cs
      • Tasks
        • Properties
  • BluetoothLE
    • cppwinrt
    • cs
  • BluetoothRfcommChat
    • cs
      • Tasks
        • Properties
  • Calendar
    • cpp
    • cppwinrt
    • cs
  • CameraAdvancedCapture
    • cpp
    • cs
  • CameraFaceDetection
    • cpp
    • cs
  • CameraFrames
    • cpp
    • cs
  • CameraGetPreviewFrame
    • cpp
    • cs
  • CameraManualControls
    • cs
  • CameraOpenCV
    • cs
    • shared
      • OpenCVBridge
  • CameraProfile
    • cpp
    • cs
  • CameraResolution
    • cpp
    • cs
  • CameraStarterKit
    • cpp
    • cs
  • CameraStreamCoordinateMapper
    • cpp
      • Common
      • Content
  • CameraStreamCorrelation
    • cpp
      • PoseTrackingPreview
  • CameraVideoStabilization
    • cpp
    • cs
  • Capabilities
    • cppwinrt
    • cs
  • CashDrawer
    • cpp
    • cs
  • ClientDeviceInformation
    • cpp
    • cs
  • Clipboard
    • cppwinrt
    • cs
  • Compass
    • cpp
    • cs
  • ComplexInk
    • cpp
      • Common
      • Controls
      • Renderers
  • CompositionVisual
    • cpp
    • cs
  • Compression
    • cpp
    • cs
  • ContactCardIntegration
    • cs
  • ContactCards
    • cpp
    • cs
  • ContactPanel
    • cs
  • ContactPicker
    • cpp
    • cs
  • ContentIndexer
    • cpp
    • cs
  • ContextMenu
    • cpp
    • cs
  • CortanaVoiceCommand
    • cpp
      • AdventureWorks
        • Common
        • View
        • ViewModel
      • AdventureWorks.Shared
      • VoiceCommandService
    • cs
      • AdventureWorks
        • Common
        • View
        • ViewModel
      • AdventureWorks.shared
        • Model
        • Properties
      • VoiceCommandService
        • Properties
  • CredentialPicker
    • cpp
    • cs
  • CustomCapability
    • cpp
    • cs
    • Service
      • Client
      • Interface
      • Osrusbfx2Task
      • Server
  • CustomEditControl
    • cs
  • CustomHidDeviceAccess
    • cpp
    • cs
  • CustomSensors
    • cpp
    • cs
  • CustomSerialDeviceAccess
    • cs
  • CustomUsbDeviceAccess
    • cs
      • BackgroundTask
        • Properties
  • D2DAdvancedColorImages
    • cpp
      • D2DAdvancedColorImages
  • D2DCustomEffects
    • cpp
      • ComputeShader
      • PixelShader
      • VertexShader
  • D2DGradientMesh
    • cpp
  • D2DPhotoAdjustment
    • cpp
      • Common
  • D2DSvgImage
    • cpp
      • Common
  • DatagramSocket
    • cpp
    • cs
  • DataReaderWriter
    • cpp
    • cs
  • DateTimeFormatting
    • cpp
    • cppwinrt
    • cs
  • DeviceEnumerationAndPairing
    • cpp
      • Tasks
    • cppwinrt
      • Tasks
    • cs
      • Tasks
        • Properties
  • DisablingScreenCapture
    • cpp
    • cppwinrt
    • cs
  • DisplayOrientation
    • cpp
    • cppwinrt
    • cs
  • DpiScaling
    • cpp
    • cs
  • DWriteColorGlyph
    • cpp
  • DWriteLineSpacingModes
    • cpp
      • DWriteLineSpacingModes
      • DWriteTextLayoutImplementation
  • DWriteTextLayoutCloudFont
    • cpp
      • DWriteTextLayoutCloudFont
      • DWriteTextLayoutCloudFontImplementation
  • EnterpriseDataProtection
    • cs
      • Tasks
        • Properties
  • ExtendedExecution
    • cpp
    • cs
  • FileAccess
    • cpp
    • cppwinrt
    • cs
  • FilePicker
    • cpp
    • cppwinrt
    • cs
  • FilePickerContracts
    • cs
      • Tasks
  • FileSearch
    • cpp
    • cppwinrt
    • cs
  • FileThumbnails
    • cpp
    • cppwinrt
    • cs
  • FolderEnumeration
    • cpp
    • cppwinrt
    • cs
  • FullScreenMode
    • cpp
    • cppwinrt
    • cs
  • Geolocation
    • cppwinrt
      • Tasks
    • cs
      • Tasks
        • Properties
  • Geotag
    • cpp
    • cs
  • GlobalizationPreferences
    • cpp
    • cppwinrt
    • cs
  • Gyrometer
    • cpp
    • cs
  • HolographicFaceTracking
    • cpp
      • Common
      • Content
  • HolographicMixedRealityCapture
    • cpp
      • Common
      • Content
      • MrcEffectDefinitions
  • HolographicSpatialMapping
    • cpp
      • Common
      • Content
  • HolographicSpatialStage
    • cpp
      • Common
      • Content
  • HolographicTagAlong
    • cpp
      • Common
      • Content
  • HolographicVoiceInput
    • cpp
      • Audio
      • Common
      • Content
  • HotspotAuthentication
    • cs
      • HotspotAuthenticationTask
        • Properties
  • HttpClient
    • cppwinrt
    • cs
    • HttpFilters
  • Inclinometer
    • cpp
    • cs
  • InkAnalysis
    • cs
  • IoT-GPIO
    • cpp
    • cppwinrt
    • cs
  • IoT-I2C
    • cpp
    • cppwinrt
    • cs
  • IoT-SPI
    • cpp
    • cppwinrt
    • cs
  • JapanesePhoneticAnalysis
    • cpp
    • cppwinrt
    • cs
  • Json
    • cppwinrt
    • cs
  • JumpList
    • cpp
    • cppwinrt
    • cs
  • KeyCredentialManager
    • cpp
    • cs
  • LampArray
    • cppwinrt
    • cs
  • LampDevice
    • cpp
    • cs
  • LanguageFont
    • cppwinrt
    • cs
  • LibraryManagement
    • cpp
    • cs
  • LightSensor
    • cpp
    • cs
  • LineDisplay
    • cpp
    • cs
  • LinguisticServices
    • cppwinrt
    • cs
    • RuntimeComponent
    • shared
  • LiveDash
    • cs
      • LiveDash
        • Models
        • Util
      • LiveDashApp
        • Views
  • LockScreenApps
    • cppwinrt
    • cs
  • Logging
    • cpp
    • cppwinrt
    • cs
  • LowLatencyInput
    • cpp
      • Common
      • Content
  • MagneticStripeReader
    • cpp
    • cs
  • Magnetometer
    • cs
  • MapControl
    • cpp
    • cs
  • MediaEditing
    • cpp
    • cs
  • MediaImport
    • cs
      • DataBinding
  • MediaTranscoding
    • cpp
    • cs
  • MessageDialog
    • cpp
    • cs
  • MicrosoftPassport
    • cs
    • Server
      • App_Start
      • Controllers
      • Data
      • Models
      • Properties
  • MIDI
    • cs
  • MixedRealityModel
    • cs
  • MobileBroadband
    • cs
  • MobileHotspot
    • cppwinrt
    • cs
  • MultipleViews
    • cppwinrt
    • cs
  • NetworkConnectivity
    • cppwinrt
    • cs
  • Nfc
    • Nfc
    • NfcHceBackgroundTask
    • PcscSdk
  • NfcProvisioner
    • cs
  • Notifications
    • cs
      • BackgroundTasks
        • Helpers
        • Properties
      • Notifications
        • Controls
        • Converters
        • Helpers
        • Model
        • ScenarioPages
          • Badges
            • Local
              • PrimaryTile
                • ClearBadge
                • SetBadgeGlyph
                • SetBadgeNumber
              • SecondaryTileBadges
          • LiveTiles
            • AdaptiveTemplates
              • Branding
                • Default
                • Logo
                • Name
                • NameAndLogo
                • None
              • Custom
              • HintPresentation
                • Contact
                • People
                • Photos
              • Images
                • Source
                  • FromAppData
                  • FromAppPackage
                  • FromInternet
              • TextStyles
              • TextWrap
            • BasicState
              • BackgroundColor
                • Custom
                • InheritFromPrimary
                • Transparent
              • CheckAllPropertiesCorrect
              • Logos
                • Source
                  • AppData
                  • AppPackage
            • FindAllAsync
              • Visualizer
            • Notifications
              • ExpiringNotification
              • PrimaryTile
                • Clearing
                • Sending
              • SecondaryTiles
            • Pinning
            • UnpinEverything
            • Updating
          • Toasts
            • Actions
              • Action
                • QuickReply
                • Text
                • TextAndImage
              • InputText
                • DefaultInput
                • PlaceholderContent
                • RetrievingArgs
                • Title
              • SystemCommands
                • SnoozeAndDismiss
            • ActivationTypes
              • BackgroundWithAppClosed
              • BackgroundWithAppOpen
              • ForegroundWithAppClosed
              • ForegroundWithAppOpen
              • Protocol
              • System
                • Dismiss
                  • AutoContent
                  • CustomContent
                  • Dismissing
                • Snooze
                  • AutoContent
                  • CustomContent
                  • Snoozing
            • AdaptiveTemplates
              • Image
                • Src
                  • FromAppData
                  • FromAppPackage
                  • FromInternet
            • Audio
              • Default
              • EmailSound
              • Looping
              • Silent
            • ExpiringToast
            • GhostToast
            • HistoryChangedTrigger
              • BadgeControl
              • RespondingToToasts
            • Scenarios
              • Alarm
              • Default
              • IncomingCall
              • Reminder
            • ToastNotificationManagerHistory
              • ClearAll
              • GetHistory
                • Visualizer
              • Remove
                • ByTag
                • ByTagAndGroup
              • RemoveGroup
                • ByGroup
            • UpdateToast
  • NumberFormatting
    • cpp
    • cppwinrt
    • cs
  • OCR
    • cpp
    • cppwinrt
    • cs
  • OnDemandHotspot
    • cppwinrt
      • BackgroundTask
    • cs
      • BackgroundTask
        • Properties
  • OrientationSensor
    • cpp
    • cs
  • Package
    • cpp
    • cs
  • PasswordVault
    • cpp
    • cppwinrt
    • cs
  • PdfDocument
    • cpp
    • cppwinrt
    • cs
  • Pedometer
    • cpp
      • Tasks
    • cs
      • Tasks
        • Properties
  • PenHaptics
    • cppwinrt
    • cs
  • PersonalDataEncryption
    • cppwinrt
    • cs
  • Personalization
    • cpp
    • cs
  • Playlists
    • cpp
    • cs
  • PlayReady
    • cs
      • Controls
      • Shared
      • ViewModels
  • PosPrinter
    • cpp
    • cs
  • PresenceSensor
    • cppwinrt
    • cs
  • Printing
    • cpp
    • cs
  • Projection
    • cpp
    • cs
  • ProximitySensor
    • cpp
      • Tasks
    • cs
      • Tasks
        • Properties
  • ProxyStubsForWinRTComponents
    • cpp
      • cpp
      • cs
      • Server
    • cs
      • cpp
      • cs
      • Server
        • Properties
  • RadialController
    • cpp
    • cs
  • RadioManager
    • cppwinrt
    • cs
  • RelativeInclinometer
    • cpp
    • cs
  • RemoteSystems
    • cs
  • ResizeAppView
    • cpp
    • cppwinrt
    • cs
  • SecondaryTiles
    • cppwinrt
    • cs
  • SemanticTextQuery
    • cpp
    • cs
  • SerialArduino
    • cs
  • ShareSource
    • cpp
    • cs
  • ShareTarget
    • cs
  • Simple3DGameDX
    • cpp
      • Common
    • cppwinrt
      • Common
      • GameContent
  • Simple3DGameXaml
    • cpp
      • Common
  • SimpleCommunication
    • common
      • MediaExtensions
        • Microsoft.Samples.SimpleCommunication
    • cpp
    • cs
  • SimpleImaging
    • cs
  • SimpleInk
    • cpp
    • cs
  • SimpleOrientationSensor
    • cpp
    • cs
  • SmartCard
    • cpp
    • cppwinrt
    • cs
  • SmsSendAndReceive
    • cs
      • SmsBackgroundTask
        • Properties
      • SmsSendAndReceive
  • SocketActivityStreamSocket
    • cs
      • Server
      • SocketActivityBackgroundTask
        • Properties
      • SocketActivityStreamSocket
  • SpatialInteractionSource
    • cpp
      • Common
      • Content
  • SpatialSound
    • cpp
  • SpeechRecognitionAndSynthesis
    • cpp
    • cs
  • SplashScreen
    • cs
      • common
  • Store
    • cpp
    • cs
  • StreamSocket
    • cpp
    • cs
  • Syndication
    • cpp
    • cs
  • SystemMediaTransportControls
    • cs
  • TextSegmentation
    • cpp
    • cppwinrt
    • cs
  • TextSuggestion
    • cpp
    • cs
  • TitleBar
    • cpp
    • cppwinrt
    • cs
  • TouchKeyboard
    • cppwinrt
    • cs
  • TouchKeyboardTextInput
    • cpp
    • cs
  • Unicode
    • cppwinrt
    • cs
  • UserActivity
    • cs
  • UserCertificateStore
    • cppwinrt
    • cs
  • UserConsentVerifier
    • cpp
    • cppwinrt
    • cs
  • UserDataAccountManager
    • cpp
    • cs
  • UserInfo
    • cppwinrt
    • cs
  • UserInteractionMode
    • cpp
    • cppwinrt
    • cs
  • UssdProtcol
    • cs
  • VersionAdaptiveCode
    • cs
  • VideoPlayback
    • cs
  • VideoPlaybackSynchronization
    • cs
  • WebAccountManagement
    • cpp
    • cs
  • WebAuthenticationBroker
    • cpp
    • cs
  • WebSocket
    • cpp
    • cppwinrt
    • cs
  • WiFiDirect
    • cpp
    • cppwinrt
    • cs
  • WiFiDirectServices
    • cpp
      • Helpers
    • cs
      • Helpers
  • WiFiScan
    • cpp
    • cs
  • WindowsAudioSession
    • cpp
    • cppwinrt
  • WRLInProcessWinRTComponent
    • cpp
      • cpp
      • cs
      • Server
  • WRLOutOfProcessWinRTComponent
    • cpp
      • cpp
      • cs
      • Server
  • XamlAnimatedGif
    • cpp
    • cs
  • XamlBind
    • cpp
      • xBindSampleModel
        • Properties
    • cs
      • xBindSampleModel
        • Properties
  • XamlBottomUpList
    • cpp
    • cs
  • XamlCloudFontIntegration
    • cpp
    • cs
  • XamlCommanding
    • cpp
    • cs
  • XamlContextMenu
    • cpp
    • cs
  • XamlCustomMediaTransportControls
    • cs
      • Properties
  • XamlDataVirtualization
    • cs
      • Scenario1
      • Scenario2
  • XamlDeferLoadStrategy
    • cs
      • Scenarios
  • XamlDragAndDrop
    • cpp
    • cs
  • XamlFocusVisuals
    • cs
      • Scenarios
  • XamlGamepadNavigation
    • cs
  • XamlListView
    • cppwinrt
    • cs
  • XamlMasterDetail
    • cppwinrt
    • cs
      • Data
      • Properties
      • ViewModels
  • XamlPivot
    • cs
  • XamlStateTriggers
    • cs
      • CustomTriggers
      • Properties
      • ViewModel
  • XamlTailoredMultipleViews
    • cs
      • TailoredMultipleViews
        • DisplaySizeHelper
        • Properties
        • UserControls
        • ViewModel
  • XamlTransform3DAnimations
    • cs
      • Properties
      • ViewModels
  • XamlWebView
    • cs
  • XmlDocument
    • cs
  • XmlLite
    • cpp
    • cppwinrt
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/ Directory Reference

  • 360VideoPlayback

360VideoPlayback Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/ Directory Reference

  • 360VideoPlayback
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | 360VideoPlaybackMain.cpp [code]
file | 360VideoPlaybackMain.h [code]
file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | AppView.cpp [code]
file | AppView.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PlaybackPage.xaml.cpp [code]
file | PlaybackPage.xaml.h [code]
file | VideoGallery.xaml.cpp [code]
file | VideoGallery.xaml.h [code]
file | VideoItem.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/ Directory Reference

  • 360VideoPlayback
  • cpp
  • Common

Common Directory Reference

Files

file | BaseControl.cpp [code]
file | BaseControl.h [code]
file | BaseElement.cpp [code]
file | BaseElement.h [code]
file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | Controls.cpp [code]
file | Controls.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | MeshGeometry.cpp [code]
file | MeshGeometry.h [code]
file | SeekBarElement.cpp [code]
file | SeekBarElement.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/ Directory Reference

  • 360VideoPlayback
  • cpp
  • Content

Content Directory Reference

Files

file | MediaTransportControls.cpp [code]
file | MediaTransportControls.h [code]
file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | VideoRenderer.cpp [code]
file | VideoRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/ Directory Reference

  • 360VideoPlayback
  • cs

cs Directory Reference

Directories

directory | Common
directory | Content

Files

file | _360VideoPlaybackMain.cs [code]
file | App.xaml.cs [code]
file | AppView.cs [code]
file | AppViewSource.cs [code]
file | FxCompile.cs [code]
file | Helpers.cs [code]
file | HolographicApp1Main.cs [code]
file | MainPage.xaml.cs [code]
file | PlaybackPage.xaml.cs [code]
file | Program.cs [code]
file | VideoGallery.xaml.cs [code]
file | VideoItem.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/ Directory Reference

  • 360VideoPlayback
  • cs
  • Common

Common Directory Reference

Files

file | CameraResources.cs [code]
file | DeviceResources.cs [code]
file | DirectXHelper.cs [code]
file | Disposer.cs [code]
file | InteropStatics.cs [code]
file | StepTimer.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/ Directory Reference

  • 360VideoPlayback
  • cs
  • Content

Content Directory Reference

Files

file | ShaderStructures.cs [code]
file | SpatialInputHandler.cs [code]
file | VideoRenderer.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/ Directory Reference

  • 3DPrinting

3DPrinting Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/ Directory Reference

  • 3DPrinting
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Print.cpp [code]
file | Scenario1_Print.h [code]
file | Scenario2_Launch.cpp [code]
file | Scenario2_Launch.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cs/ Directory Reference

  • 3DPrinting
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Print.xaml.cs [code]
file | Scenario2_Launch.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrintingFromUnity/ Directory Reference

  • 3DPrintingFromUnity

3DPrintingFromUnity Directory Reference

Directories

directory Assets
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrintingFromUnity/Assets/ Directory Reference

  • 3DPrintingFromUnity
  • Assets

Assets Directory Reference

Directories

directory Script
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrintingFromUnity/Assets/Script/ Directory Reference

  • 3DPrintingFromUnity
  • Assets
  • Script

Script Directory Reference

Files

file | Print3D.cs [code]
file | Turn.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/ Directory Reference

  • Accelerometer

Accelerometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/ Directory Reference

  • Accelerometer
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario0_Choose.xaml.cpp [code]
file | Scenario0_Choose.xaml.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_ShakeEvents.xaml.cpp [code]
file | Scenario2_ShakeEvents.xaml.h [code]
file | Scenario3_Polling.xaml.cpp [code]
file | Scenario3_Polling.xaml.h [code]
file | Scenario4_OrientationChanged.xaml.cpp [code]
file | Scenario4_OrientationChanged.xaml.h [code]
file | Scenario5_DataEventsBatching.xaml.cpp [code]
file | Scenario5_DataEventsBatching.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/ Directory Reference

  • Accelerometer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario0_Choose.xaml.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_ShakeEvents.xaml.cs [code]
file | Scenario3_Polling.xaml.cs [code]
file | Scenario4_OrientationChanged.xaml.cs [code]
file | Scenario5_DataEventsBatching.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/ Directory Reference

  • ActivitySensor

ActivitySensor Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/ Directory Reference

  • ActivitySensor
  • cpp

cpp Directory Reference

Directories

directory | Tasks

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CurrentActivity.xaml.cpp [code]
file | Scenario1_CurrentActivity.xaml.h [code]
file | Scenario2_History.xaml.cpp [code]
file | Scenario2_History.xaml.h [code]
file | Scenario3_ChangeEvents.xaml.cpp [code]
file | Scenario3_ChangeEvents.xaml.h [code]
file | Scenario4_BackgroundActivity.xaml.cpp [code]
file | Scenario4_BackgroundActivity.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/ Directory Reference

  • ActivitySensor
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | ActivitySensorBackgroundTask.cpp [code]
file | ActivitySensorBackgroundTask.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/ Directory Reference

  • ActivitySensor
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_CurrentActivity.xaml.cs [code]
file | Scenario2_History.xaml.cs [code]
file | Scenario3_ChangeEvents.xaml.cs [code]
file | Scenario4_BackgroundActivity.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/ Directory Reference

  • ActivitySensor
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | ActivitySensorBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/Properties/ Directory Reference

  • ActivitySensor
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/ Directory Reference

  • AdaptiveStreaming

AdaptiveStreaming Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/ Directory Reference

  • AdaptiveStreaming
  • cs

cs Directory Reference

Directories

directory | Controls
directory | Helpers
directory | Models
directory | Shared

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SimplestAdaptiveStreaming.xaml.cs [code]
file | Scenario2_EventHandlers.xaml.cs [code]
file | Scenario3_RequestModification.xaml.cs [code]
file | Scenario4_Tuning.xaml.cs [code]
file | Scenario5_Metadata.xaml.cs [code]
file | Scenario6_AdInsertion.xaml.cs [code]
file | Scenario7_LiveSeekableRange.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Controls/ Directory Reference

  • AdaptiveStreaming
  • cs
  • Controls

Controls Directory Reference

Files

file ContentSelector.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Helpers/ Directory Reference

  • AdaptiveStreaming
  • cs
  • Helpers

Helpers Directory Reference

Files

file | CommonLicenseRequest.cs [code]
file | PlayReadyHelper.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Models/ Directory Reference

  • AdaptiveStreaming
  • cs
  • Models

Models Directory Reference

Files

file AdaptiveContentModel.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Shared/ Directory Reference

  • AdaptiveStreaming
  • cs
  • Shared

Shared Directory Reference

Files

file TrackingEventCue.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/ Directory Reference

  • AdvancedCasting

AdvancedCasting Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/ Directory Reference

  • AdvancedCasting
  • cs

cs Directory Reference

Directories

directory | Controls
directory | Data
directory | Util

Files

file | 01_MediaElement.xaml.cs [code]
file | 02_Casting_API_CastButton.xaml.cs [code]
file | 03_DIAL_Sender_API.xaml.cs [code]
file | 04_DIAL_Receiver_App.xaml.cs [code]
file | 05_Multi_View_Media_Application.xaml.cs [code]
file | 06_Combine_Casting_Tech.xaml.cs [code]
file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | ProjectionViewPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | UnhandledExceptionPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Controls/ Directory Reference

  • AdvancedCasting
  • cs
  • Controls

Controls Directory Reference

Files

file | MediaTransportControlsWithCustomCastButton.cs [code]
file | ProjectedMediaTransportControls.cs [code]
file | ProjectionViewBroker.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/ Directory Reference

  • AdvancedCasting
  • cs
  • Data

Data Directory Reference

Directories

directory | Azure
directory | Common
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Azure/ Directory Reference

  • AdvancedCasting
  • cs
  • Data
  • Azure

Azure Directory Reference

Files

file AzureDataProvider.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Common/ Directory Reference

  • AdvancedCasting
  • cs
  • Data
  • Common

Common Directory Reference

Files

file | ItemsDataProvider.cs [code]
file | VideoMetaData.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/ Directory Reference

  • AdvancedCasting
  • cs
  • Util

Util Directory Reference

Files

file | ApiInformation.cs [code]
file | CustomDevicePickerFilter.cs [code]
file | DialLaunchArguments.cs [code]
file | RequiredDeviceProperties.cs [code]
file | ViewLifetimeControl.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ Directory Reference

  • AllJoyn

AllJoyn Directory Reference

Directories

directory | Common
directory | ConsumerExperiences
directory | ProducerExperiences
directory | shared
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/ Directory Reference

  • AllJoyn
  • Common

Common Directory Reference

Directories

directory | Scenario1WinRTComponent
directory | Scenario2WinRTComponent
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/ Directory Reference

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

Scenario1WinRTComponent Directory Reference

Files

file | AllJoynHelpers.h [code]
file | ISecureInterfaceService.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SecureInterfaceConsumer.cpp [code]
file | SecureInterfaceConsumer.h [code]
file | SecureInterfaceEventArgs.h [code]
file | SecureInterfaceLegacySignals.cpp [code]
file | SecureInterfaceLegacySignals.h [code]
file | SecureInterfaceMethodResults.h [code]
file | SecureInterfaceProducer.cpp [code]
file | SecureInterfaceProducer.h [code]
file | SecureInterfaceServiceEventAdapter.cpp [code]
file | SecureInterfaceServiceEventAdapter.h [code]
file | SecureInterfaceServiceEventArgs.cpp [code]
file | SecureInterfaceServiceEventArgs.h [code]
file | SecureInterfaceSignals.cpp [code]
file | SecureInterfaceSignals.h [code]
file | SecureInterfaceStructures.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/ Directory Reference

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

Scenario2WinRTComponent Directory Reference

Files

file | AllJoynHelpers.h [code]
file | IOnboardingService.h [code]
file | OnboardingConsumer.cpp [code]
file | OnboardingConsumer.h [code]
file | OnboardingEventArgs.h [code]
file | OnboardingLegacySignals.cpp [code]
file | OnboardingLegacySignals.h [code]
file | OnboardingMethodResults.h [code]
file | OnboardingProducer.cpp [code]
file | OnboardingProducer.h [code]
file | OnboardingServiceEventAdapter.cpp [code]
file | OnboardingServiceEventAdapter.h [code]
file | OnboardingServiceEventArgs.cpp [code]
file | OnboardingServiceEventArgs.h [code]
file | OnboardingSignals.cpp [code]
file | OnboardingSignals.h [code]
file | OnboardingStructures.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/ Directory Reference

  • AllJoyn
  • ConsumerExperiences

ConsumerExperiences Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/ Directory Reference

  • AllJoyn
  • ConsumerExperiences
  • cs

cs Directory Reference

Files

file | OnboardingEnumTypes.cs [code]
file | RelayCommand.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario1ViewModel.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario2ViewModel.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/ Directory Reference

  • AllJoyn
  • ProducerExperiences

ProducerExperiences Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/ Directory Reference

  • AllJoyn
  • ProducerExperiences
  • cs

cs Directory Reference

Files

file | AppData.cs [code]
file | OnboardingEnumTypes.cs [code]
file | OnboardingService.cs [code]
file | RelayCommand.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario1ViewModel.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario2ViewModel.cs [code]
file | SecureInterfaceService.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/ Directory Reference

  • AllJoyn
  • shared

shared Directory Reference

Files

file | AllJoynBusObjectManager.cpp [code]
file | AllJoynBusObjectManager.h [code]
file | AllJoynHelpers.cpp [code]
file | TypeConversionHelpers.cpp [code]
file | TypeConversionHelpers.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/ Directory Reference

  • Altimeter

Altimeter Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/ Directory Reference

  • Altimeter
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/ Directory Reference

  • Altimeter
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/ Directory Reference

  • AnimationMetrics

AnimationMetrics Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/ Directory Reference

  • AnimationMetrics
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Metrics.xaml.cpp [code]
file | Scenario1_Metrics.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cs/ Directory Reference

  • AnimationMetrics
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Metrics.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/ Directory Reference

  • ApplicationData

ApplicationData Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/ Directory Reference

  • ApplicationData
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Files.cpp [code]
file | Scenario1_Files.h [code]
file | Scenario2_Settings.cpp [code]
file | Scenario2_Settings.h [code]
file | Scenario3_SettingContainer.cpp [code]
file | Scenario3_SettingContainer.h [code]
file | Scenario4_CompositeSettings.cpp [code]
file | Scenario4_CompositeSettings.h [code]
file | Scenario5_Msappdata.cpp [code]
file | Scenario5_Msappdata.h [code]
file | Scenario6_ClearScenario.cpp [code]
file | Scenario6_ClearScenario.h [code]
file | Scenario7_SetVersion.cpp [code]
file | Scenario7_SetVersion.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/ Directory Reference

  • ApplicationData
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Files.xaml.cs [code]
file | Scenario2_Settings.xaml.cs [code]
file | Scenario3_SettingContainer.xaml.cs [code]
file | Scenario4_CompositeSettings.xaml.cs [code]
file | Scenario5_Msappdata.xaml.cs [code]
file | Scenario6_ClearScenario.xaml.cs [code]
file | Scenario7_SetVersion.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/ Directory Reference

  • ApplicationResources

ApplicationResources Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/ Directory Reference

  • ApplicationResources
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | scenario1.xaml.cpp [code]
file | scenario1.xaml.h [code]
file | scenario10.xaml.cpp [code]
file | scenario10.xaml.h [code]
file | scenario11.xaml.cpp [code]
file | scenario11.xaml.h [code]
file | scenario12.xaml.cpp [code]
file | scenario12.xaml.h [code]
file | scenario13.xaml.cpp [code]
file | scenario13.xaml.h [code]
file | scenario2.xaml.cpp [code]
file | scenario2.xaml.h [code]
file | scenario3.xaml.cpp [code]
file | scenario3.xaml.h [code]
file | scenario4.xaml.cpp [code]
file | scenario4.xaml.h [code]
file | scenario5.xaml.cpp [code]
file | scenario5.xaml.h [code]
file | scenario7.xaml.cpp [code]
file | scenario7.xaml.h [code]
file | scenario8.xaml.cpp [code]
file | scenario8.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/ Directory Reference

  • ApplicationResources
  • cs

cs Directory Reference

Directories

directory | AppResourceClassLibrary

Files

file | constants.cs [code]
file | scenario1.xaml.cs [code]
file | scenario10.xaml.cs [code]
file | scenario11.xaml.cs [code]
file | scenario12.xaml.cs [code]
file | scenario13.xaml.cs [code]
file | scenario2.xaml.cs [code]
file | scenario3.xaml.cs [code]
file | scenario4.xaml.cs [code]
file | scenario5.xaml.cs [code]
file | scenario6.xaml.cs [code]
file | scenario7.xaml.cs [code]
file | scenario8.xaml.cs [code]
file | scenario9.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/AppResourceClassLibrary/ Directory Reference

  • ApplicationResources
  • cs
  • AppResourceClassLibrary

AppResourceClassLibrary Directory Reference

Directories

directory | Properties

Files

file | class1.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/AppResourceClassLibrary/Properties/ Directory Reference

  • ApplicationResources
  • cs
  • AppResourceClassLibrary
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/ Directory Reference

  • Appointments

Appointments Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/ Directory Reference

  • Appointments
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Define.xaml.cs [code]
file | Scenario2_Add.xaml.cs [code]
file | Scenario3_Replace.xaml.cs [code]
file | Scenario4_Remove.xaml.cs [code]
file | Scenario5_Show.xaml.cs [code]
file | Scenario6_Recurrence.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/ Directory Reference

  • AppServices

AppServices Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/ Directory Reference

  • AppServices
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | AppServicesClient
directory | AppServicesProvider
directory | RandomNumberService
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/ Directory Reference

  • AppServices
  • cppwinrt
  • AppServicesClient

AppServicesClient Directory Reference

Files

file | KeepConnectionOpenScenario.cpp [code]
file | KeepConnectionOpenScenario.h [code]
file | OpenCloseConnectionScenario.cpp [code]
file | OpenCloseConnectionScenario.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/ Directory Reference

  • AppServices
  • cppwinrt
  • AppServicesProvider

AppServicesProvider Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | ShowPackageFamilyName.cpp [code]
file | ShowPackageFamilyName.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/ Directory Reference

  • AppServices
  • cppwinrt
  • RandomNumberService

RandomNumberService Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | RandomNumberGeneratorTask.cpp [code]
file | RandomNumberGeneratorTask.h [code]
file | RandomNumberGeneratorTask.idl [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/ Directory Reference

  • AppServices
  • cs

cs Directory Reference

Directories

directory | AppServicesClient
directory | AppServicesProvider
directory | RandomNumberService
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/ Directory Reference

  • AppServices
  • cs
  • AppServicesClient

AppServicesClient Directory Reference

Files

file | KeepConnectionOpenScenario.xaml.cs [code]
file | OpenCloseConnectionScenario.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesProvider/ Directory Reference

  • AppServices
  • cs
  • AppServicesProvider

AppServicesProvider Directory Reference

Files

file | SampleConfiguration.cs [code]
file | ShowPackageFamilyName.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/ Directory Reference

  • AppServices
  • cs
  • RandomNumberService

RandomNumberService Directory Reference

Directories

directory | Properties

Files

file | RandomNumberGeneratorTask.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/Properties/ Directory Reference

  • AppServices
  • cs
  • RandomNumberService
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/ Directory Reference

  • AppWindow

AppWindow Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/ Directory Reference

  • AppWindow
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SecondaryWindow.cpp [code]
file | Scenario1_SecondaryWindow.h [code]
file | Scenario2_DisplayRegion.cpp [code]
file | Scenario2_DisplayRegion.h [code]
file | Scenario3_Size.cpp [code]
file | Scenario3_Size.h [code]
file | Scenario4_CompactOverlay.cpp [code]
file | Scenario4_CompactOverlay.h [code]
file | Scenario5_RelativePositioning.cpp [code]
file | Scenario5_RelativePositioning.h [code]
file | SecondaryAppWindowPage.cpp [code]
file | SecondaryAppWindowPage.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/ Directory Reference

  • AppWindow
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SecondaryWindow.xaml.cs [code]
file | Scenario2_DisplayRegion.xaml.cs [code]
file | Scenario3_Size.xaml.cs [code]
file | Scenario4_CompactOverlay.xaml.cs [code]
file | Scenario5_RelativePositioning.xaml.cs [code]
file | SecondaryAppWindowPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/ Directory Reference

  • AssociationLaunching

AssociationLaunching Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/ Directory Reference

  • AssociationLaunching
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_LaunchFile.xaml.cs [code]
file | Scenario2_LaunchUri.xaml.cs [code]
file | Scenario3_ReceiveFile.xaml.cs [code]
file | Scenario4_ReceiveUri.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/ Directory Reference

  • AudioCategory

AudioCategory Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/ Directory Reference

  • AudioCategory
  • cs

cs Directory Reference

Directories

directory AudioCategory
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/ Directory Reference

  • AudioCategory
  • cs
  • AudioCategory

AudioCategory Directory Reference

Files

file | PlaybackControl.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario10.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
file | Scenario5.xaml.cs [code]
file | Scenario6.xaml.cs [code]
file | Scenario7.xaml.cs [code]
file | Scenario8.xaml.cs [code]
file | Scenario9.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/ Directory Reference

  • AudioCreation

AudioCreation Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/ Directory Reference

  • AudioCreation
  • cs

cs Directory Reference

Directories

directory | AudioCreation
directory | CustomEffect
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/ Directory Reference

  • AudioCreation
  • cs
  • AudioCreation

AudioCreation Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_FilePlayback.xaml.cs [code]
file | Scenario2_DeviceCapture.xaml.cs [code]
file | Scenario3_FrameInputNode.xaml.cs [code]
file | Scenario4_Submix.xaml.cs [code]
file | Scenario5_InboxEffects.xaml.cs [code]
file | Scenario6_CustomEffects.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/CustomEffect/ Directory Reference

  • AudioCreation
  • cs
  • CustomEffect

CustomEffect Directory Reference

Directories

directory | Properties

Files

file | CustomEffect.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/CustomEffect/Properties/ Directory Reference

  • AudioCreation
  • cs
  • CustomEffect
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/ Directory Reference

  • BackButton

BackButton Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/ Directory Reference

  • BackButton
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | SecondaryPage.xaml.cpp [code]
file | SecondaryPage.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cs/ Directory Reference

  • BackButton
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | SecondaryPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/ Directory Reference

  • BackgroundActivation

BackgroundActivation Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/ Directory Reference

  • BackgroundActivation
  • cpp

cpp Directory Reference

Files

file | BackgroundActivity.cpp [code]
file | BackgroundActivity.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SampleBackgroundTask.xaml.cpp [code]
file | Scenario1_SampleBackgroundTask.xaml.h [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.h [code]
file | Scenario3_ServicingCompleteTask.xaml.cpp [code]
file | Scenario3_ServicingCompleteTask.xaml.h [code]
file | Scenario4_TimeTriggeredTask.xaml.cpp [code]
file | Scenario4_TimeTriggeredTask.xaml.h [code]
file | Scenario5_ApplicationTriggerTask.xaml.cpp [code]
file | Scenario5_ApplicationTriggerTask.xaml.h [code]
file | Scenario6_GroupedTask.xaml.cpp [code]
file | Scenario6_GroupedTask.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/ Directory Reference

  • BackgroundActivation
  • cs

cs Directory Reference

Files

file | BackgroundActivity.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_SampleBackgroundTask.xaml.cs [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.cs [code]
file | Scenario3_ServicingCompleteTask.xaml.cs [code]
file | Scenario4_TimeTriggeredTask.xaml.cs [code]
file | Scenario5_ApplicationTriggerTask.xaml.cs [code]
file | Scenario6_GroupedTask.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/ Directory Reference

  • BackgroundMediaPlayback

BackgroundMediaPlayback Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ Directory Reference

  • BackgroundMediaPlayback
  • cs

cs Directory Reference

Directories

directory | DataModels
directory | Services
directory | ViewModels
directory | Views

Files

file | App.xaml.cs [code]
file | BackgroundApp.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Settings.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/ Directory Reference

  • BackgroundMediaPlayback
  • cs
  • DataModels

DataModels Directory Reference

Files

file | MediaItem.cs [code]
file | MediaList.cs [code]
file | MusicItem.cs [code]
file | VideoItem.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Services/ Directory Reference

  • BackgroundMediaPlayback
  • cs
  • Services

Services Directory Reference

Files

file | PlaybackService.cs [code]
file | SettingsService.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/ Directory Reference

  • BackgroundMediaPlayback
  • cs
  • ViewModels

ViewModels Directory Reference

Files

file | MediaItemViewModel.cs [code]
file | MediaListViewModel.cs [code]
file | PlaybackSessionViewModel.cs [code]
file | PlaybackStateToButtonIconConverter.cs [code]
file | PlayerViewModel.cs [code]
file | SettingsViewModel.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Views/ Directory Reference

  • BackgroundMediaPlayback
  • cs
  • Views

Views Directory Reference

Files

file PlaylistView.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/ Directory Reference

  • BackgroundSensors

BackgroundSensors Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/ Directory Reference

  • BackgroundSensors
  • cpp

cpp Directory Reference

Directories

directory | BackgroundTask

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DeviceUse.xaml.cpp [code]
file | Scenario1_DeviceUse.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/ Directory Reference

  • BackgroundSensors
  • cpp
  • BackgroundTask

BackgroundTask Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Scenario1_BackgroundTask.cpp [code]
file | Scenario1_BackgroundTask.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/ Directory Reference

  • BackgroundSensors
  • cs

cs Directory Reference

Directories

directory | BackgroundTask

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DeviceUse.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/BackgroundTask/ Directory Reference

  • BackgroundSensors
  • cs
  • BackgroundTask

BackgroundTask Directory Reference

Directories

directory | Properties

Files

file | Scenario1_BackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/BackgroundTask/Properties/ Directory Reference

  • BackgroundSensors
  • cs
  • BackgroundTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/ Directory Reference

  • BackgroundTask

BackgroundTask Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/ Directory Reference

  • BackgroundTask
  • cpp

cpp Directory Reference

Directories

directory | BackgroundTask
directory | Tasks
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/ Directory Reference

  • BackgroundTask
  • cpp
  • BackgroundTask

BackgroundTask Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SampleBackgroundTask.xaml.cpp [code]
file | Scenario1_SampleBackgroundTask.xaml.h [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.h [code]
file | Scenario3_ServicingCompleteTask.xaml.cpp [code]
file | Scenario3_ServicingCompleteTask.xaml.h [code]
file | Scenario4_TimeTriggeredTask.xaml.cpp [code]
file | Scenario4_TimeTriggeredTask.xaml.h [code]
file | Scenario5_ApplicationTriggerTask.xaml.cpp [code]
file | Scenario5_ApplicationTriggerTask.xaml.h [code]
file | Scenario6_GroupedTask.xaml.cpp [code]
file | Scenario6_GroupedTask.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/ Directory Reference

  • BackgroundTask
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleBackgroundTask.cpp [code]
file | SampleBackgroundTask.h [code]
file | ServicingComplete.cpp [code]
file | ServicingComplete.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/ Directory Reference

  • BackgroundTask
  • cs

cs Directory Reference

Directories

directory | BackgroundTask
directory | Tasks
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/ Directory Reference

  • BackgroundTask
  • cs
  • BackgroundTask

BackgroundTask Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SampleBackgroundTask.xaml.cs [code]
file | Scenario2_SampleBackgroundTaskWithCondition.xaml.cs [code]
file | Scenario3_ServicingCompleteTask.xaml.cs [code]
file | Scenario4_TimeTriggeredTask.xaml.cs [code]
file | Scenario5_ApplicationTriggerTask.xaml.cs [code]
file | Scenario6_GroupedTask.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/ Directory Reference

  • BackgroundTask
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | SampleBackgroundTask.cs [code]
file | ServicingComplete.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/Properties/ Directory Reference

  • BackgroundTask
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/ Directory Reference

  • BackgroundTransfer

BackgroundTransfer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/ Directory Reference

  • BackgroundTransfer
  • cpp

cpp Directory Reference

Directories

directory | BackgroundTransfer
directory | Tasks
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/ Directory Reference

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

BackgroundTransfer Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Download.xaml.cpp [code]
file | Scenario1_Download.xaml.h [code]
file | Scenario2_Upload.xaml.cpp [code]
file | Scenario2_Upload.xaml.h [code]
file | Scenario3_Notifications.xaml.cpp [code]
file | Scenario3_Notifications.xaml.h [code]
file | Scenario4_CompletionGroups.xaml.cpp [code]
file | Scenario4_CompletionGroups.xaml.h [code]
file | Scenario5_RandomAccess.xaml.cpp [code]
file | Scenario5_RandomAccess.xaml.h [code]
file | Scenario6_RecoverableErrors.xaml.cpp [code]
file | Scenario6_RecoverableErrors.xaml.h [code]
file | Scenario7_DownloadReordering.xaml.cpp [code]
file | Scenario7_DownloadReordering.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/ Directory Reference

  • BackgroundTransfer
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | CompletionGroupTask.cpp [code]
file | CompletionGroupTask.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/ Directory Reference

  • BackgroundTransfer
  • cs

cs Directory Reference

Directories

directory | BackgroundTransfer
directory | Tasks
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/ Directory Reference

  • BackgroundTransfer
  • cs
  • BackgroundTransfer

BackgroundTransfer Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Download.xaml.cs [code]
file | Scenario2_Upload.xaml.cs [code]
file | Scenario3_Notifications.xaml.cs [code]
file | Scenario4_CompletionGroups.xaml.cs [code]
file | Scenario5_RandomAccess.xaml.cs [code]
file | Scenario6_RecoverableErrors.xaml.cs [code]
file | Scenario7_DownloadReordering.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/Tasks/ Directory Reference

  • BackgroundTransfer
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | CompletionGroupTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/Tasks/Properties/ Directory Reference

  • BackgroundTransfer
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/ Directory Reference

  • BarcodeScanner

BarcodeScanner Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/ Directory Reference

  • BarcodeScanner
  • cppwinrt

cppwinrt Directory Reference

Files

file | BarcodeScannerInfo.cpp [code]
file | BarcodeScannerInfo.h [code]
file | BindingHelpers.cpp [code]
file | BindingHelpers.h [code]
file | DataHelpers.cpp [code]
file | DataHelpers.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_BasicFunctionality.cpp [code]
file | Scenario1_BasicFunctionality.h [code]
file | Scenario2_MultipleScanners.cpp [code]
file | Scenario2_MultipleScanners.h [code]
file | Scenario3_ActiveSymbologies.cpp [code]
file | Scenario3_ActiveSymbologies.h [code]
file | Scenario4_SymbologyAttributes.cpp [code]
file | Scenario4_SymbologyAttributes.h [code]
file | Scenario5_DisplayingBarcodePreview.cpp [code]
file | Scenario5_DisplayingBarcodePreview.h [code]
file | SymbologyListEntry.cpp [code]
file | SymbologyListEntry.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/ Directory Reference

  • BarcodeScanner
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_BasicFunctionality.xaml.cs [code]
file | Scenario2_MultipleScanners.xaml.cs [code]
file | Scenario3_ActiveSymbologies.xaml.cs [code]
file | Scenario4_SymbologyAttributes.xaml.cs [code]
file | Scenario5_DisplayingBarcodePreview.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/ Directory Reference

  • BarcodeScannerProvider

BarcodeScannerProvider Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/ Directory Reference

  • BarcodeScannerProvider
  • cpp

cpp Directory Reference

Directories

directory | BarcodeDecoder
directory | BarcodeScannerProvider
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/ Directory Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

BarcodeDecoder Directory Reference

Files

file | BarcodeDecoder.cpp [code]
file | BarcodeDecoder.h [code]
file | DecodeEngine.cpp [code]
file | DecodeEngine.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Provider.cpp [code]
file | Provider.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/ Directory Reference

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

BarcodeScannerProvider Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Configuration.xaml.cpp [code]
file | Scenario1_Configuration.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/ Directory Reference

  • BarcodeScannerProvider
  • cs

cs Directory Reference

Directories

directory | BarcodeDecoder
directory | BarcodeScannerProvider
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/ Directory Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder

BarcodeDecoder Directory Reference

Directories

directory | Properties

Files

file | BarcodeDecoder.cs [code]
file | DecodeEngine.cs [code]
file | Provider.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/Properties/ Directory Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeScannerProvider/ Directory Reference

  • BarcodeScannerProvider
  • cs
  • BarcodeScannerProvider

BarcodeScannerProvider Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Configuration.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/ Directory Reference

  • Barometer

Barometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/ Directory Reference

  • Barometer
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cs/ Directory Reference

  • Barometer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/ Directory Reference

  • BasicFaceDetection

BasicFaceDetection Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/ Directory Reference

  • BasicFaceDetection
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DetectInPhoto.cpp [code]
file | Scenario1_DetectInPhoto.h [code]
file | Scenario2_DetectInWebcam.cpp [code]
file | Scenario2_DetectInWebcam.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/ Directory Reference

  • BasicFaceDetection
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DetectInPhoto.xaml.cs [code]
file | Scenario2_DetectInWebcam.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/ Directory Reference

  • BasicFaceTracking

BasicFaceTracking Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/ Directory Reference

  • BasicFaceTracking
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_TrackInWebcam.cpp [code]
file | Scenario1_TrackInWebcam.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cs/ Directory Reference

  • BasicFaceTracking
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_TrackInWebcam.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/ Directory Reference

  • BasicHologram

BasicHologram Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/ Directory Reference

  • BasicHologram
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | BasicHologramMain.cpp [code]
file | BasicHologramMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/ Directory Reference

  • BasicHologram
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/ Directory Reference

  • BasicHologram
  • cpp
  • Content

Content Directory Reference

Files

file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | SpinningCubeRenderer.cpp [code]
file | SpinningCubeRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/ Directory Reference

  • BasicHologram
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | BasicHologramMain.cpp [code]
file | BasicHologramMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/ Directory Reference

  • BasicHologram
  • cppwinrt
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/ Directory Reference

  • BasicHologram
  • cppwinrt
  • Content

Content Directory Reference

Files

file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | SpinningCubeRenderer.cpp [code]
file | SpinningCubeRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/ Directory Reference

  • BasicHologram
  • cs

cs Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cs [code]
file | AppViewSource.cs [code]
file | BasicHologramMain.cs [code]
file | FxCompile.cs [code]
file | Program.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/ Directory Reference

  • BasicHologram
  • cs
  • Common

Common Directory Reference

Files

file | CameraResources.cs [code]
file | DeviceResources.cs [code]
file | DirectXHelper.cs [code]
file | Disposer.cs [code]
file | InteropStatics.cs [code]
file | StepTimer.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Content/ Directory Reference

  • BasicHologram
  • cs
  • Content

Content Directory Reference

Files

file | ShaderStructures.cs [code]
file | SpatialInputHandler.cs [code]
file | SpinningCubeRenderer.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/ Directory Reference

  • BasicInput

BasicInput Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/ Directory Reference

  • BasicInput
  • cpp

cpp Directory Reference

Files

file | 1-InputEvents.xaml.cpp [code]
file | 1-InputEvents.xaml.h [code]
file | 2-PointerPointProperties.xaml.cpp [code]
file | 2-PointerPointProperties.xaml.h [code]
file | 3-DeviceCapabilities.xaml.cpp [code]
file | 3-DeviceCapabilities.xaml.h [code]
file | 4-XAMLManipulations.xaml.cpp [code]
file | 4-XAMLManipulations.xaml.h [code]
file | 5-GestureRecognizer.xaml.cpp [code]
file | 5-GestureRecognizer.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/ Directory Reference

  • BasicInput
  • cs

cs Directory Reference

Files

file | 1-InputEvents.xaml.cs [code]
file | 2-PointerPointProperties.xaml.cs [code]
file | 3-DeviceCapabilities.xaml.cs [code]
file | 4-XAMLManipulations.xaml.cs [code]
file | 5-GestureRecognizer.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/ Directory Reference

  • BasicMediaCasting

BasicMediaCasting Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/ Directory Reference

  • BasicMediaCasting
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_BuiltInCasting.xaml.cs [code]
file | Scenario2_CastingDevicePicker.xaml.cs [code]
file | Scenario3_CustomPicker.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/ Directory Reference

  • BasicSuspension

BasicSuspension Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/ Directory Reference

  • BasicSuspension
  • cs

cs Directory Reference

Directories

directory | Common

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | SubPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/Common/ Directory Reference

  • BasicSuspension
  • cs
  • Common

Common Directory Reference

Files

file | NavigationHelper.cs [code]
file | SuspensionManager.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/ Directory Reference

  • BluetoothAdvertisement

BluetoothAdvertisement Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/ Directory Reference

  • BluetoothAdvertisement
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Watcher.xaml.cs [code]
file | Scenario2_Publisher.xaml.cs [code]
file | Scenario3_BackgroundWatcher.xaml.cs [code]
file | Scenario4_BackgroundPublisher.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Tasks/ Directory Reference

  • BluetoothAdvertisement
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | AdvertisementBackgroundTasks.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Tasks/Properties/ Directory Reference

  • BluetoothAdvertisement
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/ Directory Reference

  • BluetoothLE

BluetoothLE Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/ Directory Reference

  • BluetoothLE
  • cppwinrt

cppwinrt Directory Reference

Files

file | BluetoothLEAttributeDisplay.cpp [code]
file | BluetoothLEAttributeDisplay.h [code]
file | BluetoothLEDeviceDisplay.cpp [code]
file | BluetoothLEDeviceDisplay.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PresentationFormats.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Discovery.cpp [code]
file | Scenario1_Discovery.h [code]
file | Scenario2_Client.cpp [code]
file | Scenario2_Client.h [code]
file | Scenario3_ServerForeground.cpp [code]
file | Scenario3_ServerForeground.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/ Directory Reference

  • BluetoothLE
  • cs

cs Directory Reference

Files

file | Constants.cs [code]
file | DispatcherTaskExtensions.cs [code]
file | DisplayHelpers.cs [code]
file | PresentationFormats.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Discovery.xaml.cs [code]
file | Scenario2_Client.xaml.cs [code]
file | Scenario3_ServerForeground.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/ Directory Reference

  • BluetoothRfcommChat

BluetoothRfcommChat Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/ Directory Reference

  • BluetoothRfcommChat
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ChatClient.xaml.cs [code]
file | Scenario2_ChatServer.xaml.cs [code]
file | Scenario3_BgChatServer.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Tasks/ Directory Reference

  • BluetoothRfcommChat
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | RfcommServerTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Tasks/Properties/ Directory Reference

  • BluetoothRfcommChat
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/ Directory Reference

  • Calendar

Calendar Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/ Directory Reference

  • Calendar
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Data.xaml.cpp [code]
file | Scenario1_Data.xaml.h [code]
file | Scenario2_Stats.xaml.cpp [code]
file | Scenario2_Stats.xaml.h [code]
file | Scenario3_Enum.xaml.cpp [code]
file | Scenario3_Enum.xaml.h [code]
file | Scenario4_UnicodeExtensions.xaml.cpp [code]
file | Scenario4_UnicodeExtensions.xaml.h [code]
file | Scenario5_TimeZone.xaml.cpp [code]
file | Scenario5_TimeZone.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/ Directory Reference

  • Calendar
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Data.cpp [code]
file | Scenario1_Data.h [code]
file | Scenario2_Stats.cpp [code]
file | Scenario2_Stats.h [code]
file | Scenario3_Enum.cpp [code]
file | Scenario3_Enum.h [code]
file | Scenario4_UnicodeExtensions.cpp [code]
file | Scenario4_UnicodeExtensions.h [code]
file | Scenario5_TimeZone.cpp [code]
file | Scenario5_TimeZone.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/ Directory Reference

  • Calendar
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Data.xaml.cs [code]
file | Scenario2_Stats.xaml.cs [code]
file | Scenario3_Enum.xaml.cs [code]
file | Scenario4_UnicodeExtensions.xaml.cs [code]
file | Scenario5_TimeZone.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/ Directory Reference

  • CameraAdvancedCapture

CameraAdvancedCapture Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cpp/ Directory Reference

  • CameraAdvancedCapture
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraAdvancedCapture/cs/ Directory Reference

  • CameraAdvancedCapture
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/ Directory Reference

  • CameraFaceDetection

CameraFaceDetection Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/ Directory Reference

  • CameraFaceDetection
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cs/ Directory Reference

  • CameraFaceDetection
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/ Directory Reference

  • CameraFrames

CameraFrames Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/ Directory Reference

  • CameraFrames
  • cpp

cpp Directory Reference

Files

file | FrameRenderer.cpp [code]
file | FrameRenderer.h [code]
file | FrameSourceViewModels.cpp [code]
file | FrameSourceViewModels.h [code]
file | LookupTable.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DisplayDepthColorIR.xaml.cpp [code]
file | Scenario1_DisplayDepthColorIR.xaml.h [code]
file | Scenario2_FindAvailableSourceGroups.xaml.cpp [code]
file | Scenario2_FindAvailableSourceGroups.xaml.h [code]
file | SimpleLogger.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/ Directory Reference

  • CameraFrames
  • cs

cs Directory Reference

Files

file | FrameSourceViewModels.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_DisplayDepthColorIR.xaml.cs [code]
file | Scenario2_FindAvailableSourceGroups.xaml.cs [code]
file | SimpleLogger.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/ Directory Reference

  • CameraGetPreviewFrame

CameraGetPreviewFrame Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/ Directory Reference

  • CameraGetPreviewFrame
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cs/ Directory Reference

  • CameraGetPreviewFrame
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/ Directory Reference

  • CameraManualControls

CameraManualControls Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/ Directory Reference

  • CameraManualControls
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.ExposureValue.xaml.cs [code]
file | MainPage.Flash.xaml.cs [code]
file | MainPage.Focus.xaml.cs [code]
file | MainPage.IsoSpeed.xaml.cs [code]
file | MainPage.Shutter.xaml.cs [code]
file | MainPage.WhiteBalance.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | MainPage.Zoom.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/ Directory Reference

  • CameraOpenCV

CameraOpenCV Directory Reference

Directories

directory | cs
directory | shared
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/cs/ Directory Reference

  • CameraOpenCV
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ExampleOperations.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/ Directory Reference

  • CameraOpenCV
  • shared

shared Directory Reference

Directories

directory OpenCVBridge
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/ Directory Reference

  • CameraOpenCV
  • shared
  • OpenCVBridge

OpenCVBridge Directory Reference

Files

file | OpenCVHelper.cpp [code]
file | OpenCVHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/ Directory Reference

  • CameraProfile

CameraProfile Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/ Directory Reference

  • CameraProfile
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SetRecordProfile.xaml.cpp [code]
file | Scenario1_SetRecordProfile.xaml.h [code]
file | Scenario2_ConcurrentProfile.xaml.cpp [code]
file | Scenario2_ConcurrentProfile.xaml.h [code]
file | Scenario3_EnableHdrProfile.xaml.cpp [code]
file | Scenario3_EnableHdrProfile.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/ Directory Reference

  • CameraProfile
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SetRecordProfile.xaml.cs [code]
file | Scenario2_ConcurrentProfile.xaml.cs [code]
file | Scenario3_EnableHdrProfile.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/ Directory Reference

  • CameraResolution

CameraResolution Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/ Directory Reference

  • CameraResolution
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_PreviewSettings.xaml.cpp [code]
file | Scenario1_PreviewSettings.xaml.h [code]
file | Scenario2_PhotoSettings.xaml.cpp [code]
file | Scenario2_PhotoSettings.xaml.h [code]
file | Scenario3_AspectRatio.xaml.cpp [code]
file | Scenario3_AspectRatio.xaml.h [code]
file | StreamResolutionHelper.cpp [code]
file | StreamResolutionHelper.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/ Directory Reference

  • CameraResolution
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_PreviewSettings.xaml.cs [code]
file | Scenario2_PhotoSettings.xaml.cs [code]
file | Scenario3_AspectRatio.xaml.cs [code]
file | StreamResolution.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/ Directory Reference

  • CameraStarterKit

CameraStarterKit Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/ Directory Reference

  • CameraStarterKit
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | CameraRotationHelper.cpp [code]
file | CameraRotationHelper.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/ Directory Reference

  • CameraStarterKit
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | CameraRotationHelper.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/ Directory Reference

  • CameraStreamCoordinateMapper

CameraStreamCoordinateMapper Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/ Directory Reference

  • CameraStreamCoordinateMapper
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | App.cpp [code]
file | App.h [code]
file | CameraStreamCoordinateMapperMain.cpp [code]
file | CameraStreamCoordinateMapperMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/ Directory Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Common

Common Directory Reference

Files

file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.cpp [code]
file | DirectXHelper.h [code]
file | GraphicsCamera.cpp [code]
file | GraphicsCamera.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/ Directory Reference

  • CameraStreamCoordinateMapper
  • cpp
  • Content

Content Directory Reference

Files

file | CameraCoordinateMapper.cpp [code]
file | CameraCoordinateMapper.h [code]
file | CameraStreamProcessor.cpp [code]
file | CameraStreamProcessor.h [code]
file | GpuCoordinateMapper.cpp [code]
file | GpuCoordinateMapper.h [code]
file | QuadRenderer.cpp [code]
file | QuadRenderer.h [code]
file | ShaderStructures.h [code]
file | TextRenderer.cpp [code]
file | TextRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/ Directory Reference

  • CameraStreamCorrelation

CameraStreamCorrelation Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/ Directory Reference

  • CameraStreamCorrelation
  • cpp

cpp Directory Reference

Directories

directory | PoseTrackingPreview

Files

file | FrameRenderer.cpp [code]
file | FrameRenderer.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CorrelateStreams.xaml.cpp [code]
file | Scenario1_CorrelateStreams.xaml.h [code]
file | SimpleLogger.h [code]
file | SkeletalFrameRenderer.cpp [code]
file | SkeletalFrameRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/ Directory Reference

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

PoseTrackingPreview Directory Reference

Files

file | BufferHelper.h [code]
file | MFPoseTrackingFrame.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PoseTrackingFrame.cpp [code]
file | PoseTrackingFrame.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/ Directory Reference

  • CameraVideoStabilization

CameraVideoStabilization Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/ Directory Reference

  • CameraVideoStabilization
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cs/ Directory Reference

  • CameraVideoStabilization
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/ Directory Reference

  • Capabilities

Capabilities Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/ Directory Reference

  • Capabilities
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Check.cpp [code]
file | Scenario1_Check.h [code]
file | Scenario2_RequestMany.cpp [code]
file | Scenario2_RequestMany.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cs/ Directory Reference

  • Capabilities
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Check.xaml.cs [code]
file | Scenario2_RequestMany.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/ Directory Reference

  • CashDrawer

CashDrawer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/ Directory Reference

  • CashDrawer
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OpenDrawer.xaml.cpp [code]
file | Scenario1_OpenDrawer.xaml.h [code]
file | Scenario2_CloseDrawer.xaml.cpp [code]
file | Scenario2_CloseDrawer.xaml.h [code]
file | Scenario3_MultipleDrawers.xaml.cpp [code]
file | Scenario3_MultipleDrawers.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/ Directory Reference

  • CashDrawer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_OpenDrawer.xaml.cs [code]
file | Scenario2_CloseDrawer.xaml.cs [code]
file | Scenario3_MultipleDrawers.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/ Directory Reference

  • ClientDeviceInformation

ClientDeviceInformation Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/ Directory Reference

  • ClientDeviceInformation
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_GetDeviceInformation.xaml.cpp [code]
file | Scenario1_GetDeviceInformation.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cs/ Directory Reference

  • ClientDeviceInformation
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_GetDeviceInformation.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/ Directory Reference

  • Clipboard

Clipboard Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/ Directory Reference

  • Clipboard
  • cppwinrt

cppwinrt Directory Reference

Files

file | CopyFiles.cpp [code]
file | CopyFiles.h [code]
file | CopyImage.cpp [code]
file | CopyImage.h [code]
file | CopyText.cpp [code]
file | CopyText.h [code]
file | HistoryAndRoaming.cpp [code]
file | HistoryAndRoaming.h [code]
file | OtherScenarios.cpp [code]
file | OtherScenarios.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/ Directory Reference

  • Clipboard
  • cs

cs Directory Reference

Files

file | CopyFiles.xaml.cs [code]
file | CopyImage.xaml.cs [code]
file | CopyText.xaml.cs [code]
file | HistoryAndRoaming.xaml.cs [code]
file | OtherScenarios.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/ Directory Reference

  • Compass

Compass Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/ Directory Reference

  • Compass
  • cpp

cpp Directory Reference

Files

file | CalibrationBar.xaml.cpp [code]
file | CalibrationBar.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
file | Scenario3_Calibration.xaml.cpp [code]
file | Scenario3_Calibration.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/ Directory Reference

  • Compass
  • cs

cs Directory Reference

Files

file | CalibrationBar.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_Calibration.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/ Directory Reference

  • ComplexInk

ComplexInk Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/ Directory Reference

  • ComplexInk
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Controls
directory | Renderers

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CustomDry.xaml.cpp [code]
file | Scenario1_CustomDry.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/ Directory Reference

  • ComplexInk
  • cpp
  • Common

Common Directory Reference

Files

file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | InkEventLogger.cpp [code]
file | InkEventLogger.h [code]
file | Resources.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Controls/ Directory Reference

  • ComplexInk
  • cpp
  • Controls

Controls Directory Reference

Files

file | ContextMenuFlyout.xaml.cpp [code]
file | ContextMenuFlyout.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/ Directory Reference

  • ComplexInk
  • cpp
  • Renderers

Renderers Directory Reference

Files

file | InkRenderer.cpp [code]
file | InkRenderer.h [code]
file | SceneComposer.cpp [code]
file | SceneComposer.h [code]
file | ShapeRenderer.cpp [code]
file | ShapeRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/ Directory Reference

  • CompositionVisual

CompositionVisual Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/ Directory Reference

  • CompositionVisual
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | VisualProperties.cpp [code]
file | VisualProperties.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cs/ Directory Reference

  • CompositionVisual
  • cs

cs Directory Reference

Files

file VisualProperties.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/ Directory Reference

  • Compression

Compression Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/ Directory Reference

  • Compression
  • cpp

cpp Directory Reference

Files

file | CompressionUtils.cpp [code]
file | CompressionUtils.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cs/ Directory Reference

  • Compression
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/ Directory Reference

  • ContactCardIntegration

ContactCardIntegration Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/ Directory Reference

  • ContactCardIntegration
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_CreateContacts.xaml.cs [code]
file | Scenario2_ReceiveContact.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/ Directory Reference

  • ContactCards

ContactCards Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/ Directory Reference

  • ContactCards
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Mini.xaml.cpp [code]
file | Scenario1_Mini.xaml.h [code]
file | Scenario2_DelayMini.xaml.cpp [code]
file | Scenario2_DelayMini.xaml.h [code]
file | Scenario3_Full.xaml.cpp [code]
file | Scenario3_Full.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/ Directory Reference

  • ContactCards
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Mini.xaml.cs [code]
file | Scenario2_DelayMini.xaml.cs [code]
file | Scenario3_Full.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/ Directory Reference

  • ContactPanel

ContactPanel Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/ Directory Reference

  • ContactPanel
  • cs

cs Directory Reference

Files

file | AppContactPanel.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_CreateContact.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/ Directory Reference

  • ContactPicker

ContactPicker Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/ Directory Reference

  • ContactPicker
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Single.xaml.cpp [code]
file | Scenario1_Single.xaml.h [code]
file | Scenario2_Multiple.xaml.cpp [code]
file | Scenario2_Multiple.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cs/ Directory Reference

  • ContactPicker
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Single.xaml.cs [code]
file | Scenario2_Multiple.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/ Directory Reference

  • ContentIndexer

ContentIndexer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/ Directory Reference

  • ContentIndexer
  • cpp

cpp Directory Reference

Files

file | Helpers.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | S1_AddWithAPI.xaml.cpp [code]
file | S1_AddWithAPI.xaml.h [code]
file | S2_UpdateAndDeleteWithAPI.xaml.cpp [code]
file | S2_UpdateAndDeleteWithAPI.xaml.h [code]
file | S3_RetrieveWithAPI.xaml.cpp [code]
file | S3_RetrieveWithAPI.xaml.h [code]
file | S4_CheckIndexRevision.xaml.cpp [code]
file | S4_CheckIndexRevision.xaml.h [code]
file | S5_AddWithAppContent.xaml.cpp [code]
file | S5_AddWithAppContent.xaml.h [code]
file | S6_DeleteWithAppContent.xaml.cpp [code]
file | S6_DeleteWithAppContent.xaml.h [code]
file | S7_RetrieveWithAppContent.xaml.cpp [code]
file | S7_RetrieveWithAppContent.xaml.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/ Directory Reference

  • ContentIndexer
  • cs

cs Directory Reference

Files

file | Helpers.cs [code]
file | S1_AddWithAPI.xaml.cs [code]
file | S2_UpdateAndDeleteWithAPI.xaml.cs [code]
file | S3_RetrieveWithAPI.xaml.cs [code]
file | S4_CheckIndexRevision.xaml.cs [code]
file | S5_AddWithAppContent.xaml.cs [code]
file | S6_DeleteWithAppContent.xaml.cs [code]
file | S7_RetrieveWithAppContent.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/ Directory Reference

  • ContextMenu

ContextMenu Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/ Directory Reference

  • ContextMenu
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cs/ Directory Reference

  • ContextMenu
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/ Directory Reference

  • CortanaVoiceCommand

CortanaVoiceCommand Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/ Directory Reference

  • CortanaVoiceCommand
  • cpp

cpp Directory Reference

Directories

directory | AdventureWorks
directory | AdventureWorks.Shared
directory | VoiceCommandService
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

AdventureWorks Directory Reference

Directories

directory | Common
directory | View
directory | ViewModel

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

Common Directory Reference

Files

file | BoolToVisibilityConverter.cpp [code]
file | BoolToVisibilityConverter.h [code]
file | CalendarConverter.cpp [code]
file | CalendarConverter.h [code]
file | RelayCommand.cpp [code]
file | RelayCommand.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

View Directory Reference

Files

file | TripDetails.xaml.cpp [code]
file | TripDetails.xaml.h [code]
file | TripListView.xaml.cpp [code]
file | TripListView.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

ViewModel Directory Reference

Files

file | TripListViewModel.cpp [code]
file | TripListViewModel.h [code]
file | TripViewModel.cpp [code]
file | TripViewModel.h [code]
file | TripVoiceCommand.cpp [code]
file | TripVoiceCommand.h [code]
file | ViewModelBase.cpp [code]
file | ViewModelBase.h [code]
file | ViewModelLocator.cpp [code]
file | ViewModelLocator.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

AdventureWorks.Shared Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Trip.cpp [code]
file | Trip.h [code]
file | TripStore.cpp [code]
file | TripStore.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/ Directory Reference

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

VoiceCommandService Directory Reference

Files

file | AdventureworksVoiceCommandService.cpp [code]
file | AdventureworksVoiceCommandService.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/ Directory Reference

  • CortanaVoiceCommand
  • cs

cs Directory Reference

Directories

directory | AdventureWorks
directory | AdventureWorks.shared
directory | VoiceCommandService
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks

AdventureWorks Directory Reference

Directories

directory | Common
directory | View
directory | ViewModel

Files

file | App.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common

Common Directory Reference

Files

file | DateTimeOffsetConverter.cs [code]
file | INavigationService.cs [code]
file | NavigationHelper.cs [code]
file | NavigationService.cs [code]
file | RelayCommand.cs [code]
file | SuspensionManager.cs [code]
file | VisibilityConverter.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/View/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • View

View Directory Reference

Files

file | TripDetails.xaml.cs [code]
file | TripListView.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel

ViewModel Directory Reference

Files

file | TripListViewModel.cs [code]
file | TripViewModel.cs [code]
file | TripVoiceCommand.cs [code]
file | ViewModelBase.cs [code]
file | ViewModelLocator.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared

AdventureWorks.shared Directory Reference

Directories

directory | Model
directory | Properties
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Model/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Model

Model Directory Reference

Files

file | Trip.cs [code]
file | TripStore.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Properties/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/VoiceCommandService/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • VoiceCommandService

VoiceCommandService Directory Reference

Directories

directory | Properties

Files

file | AdventureWorksVoiceCommandService.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/VoiceCommandService/Properties/ Directory Reference

  • CortanaVoiceCommand
  • cs
  • VoiceCommandService
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/ Directory Reference

  • CredentialPicker

CredentialPicker Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/ Directory Reference

  • CredentialPicker
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Message.xaml.cpp [code]
file | Scenario1_Message.xaml.h [code]
file | Scenario2_MessageCaption.xaml.cpp [code]
file | Scenario2_MessageCaption.xaml.h [code]
file | Scenario3_CredentialPickerOptions.xaml.cpp [code]
file | Scenario3_CredentialPickerOptions.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/ Directory Reference

  • CredentialPicker
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Message.xaml.cs [code]
file | Scenario2_MessageCaption.xaml.cs [code]
file | Scenario3_CredentialPickerOptions.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/ Directory Reference

  • CustomCapability

CustomCapability Directory Reference

Directories

directory | cpp
directory | cs
directory | Service
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/ Directory Reference

  • CustomCapability
  • cpp

cpp Directory Reference

Files

file | DeviceList.cpp [code]
file | DeviceList.h [code]
file | Fx2Driver.cpp [code]
file | Fx2Driver.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_MeteringData.xaml.cpp [code]
file | Scenario1_MeteringData.xaml.h [code]
file | Scenario2_DeviceConnect.xaml.cpp [code]
file | Scenario2_DeviceConnect.xaml.h [code]
file | Scenario3_DeviceIO.xaml.cpp [code]
file | Scenario3_DeviceIO.xaml.h [code]
file | Scenario4_DeviceEvents.xaml.cpp [code]
file | Scenario4_DeviceEvents.xaml.h [code]
file | Scenario5_DeviceReadWrite.xaml.cpp [code]
file | Scenario5_DeviceReadWrite.xaml.h [code]
file | Scenario6_CustomTrigger.xaml.cpp [code]
file | Scenario6_CustomTrigger.xaml.h [code]
file | Scenario7_FirmwareAccess.xaml.cpp [code]
file | Scenario7_FirmwareAccess.xaml.h [code]
file | ServiceViewModel.cpp [code]
file | ServiceViewModel.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/ Directory Reference

  • CustomCapability
  • cs

cs Directory Reference

Files

file | DeviceList.cs [code]
file | Fx2Driver.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_MeteringData.xaml.cs [code]
file | Scenario2_DeviceConnect.xaml.cs [code]
file | Scenario3_DeviceIO.xaml.cs [code]
file | Scenario4_DeviceEvents.xaml.cs [code]
file | Scenario5_DeviceReadWrite.xaml.cs [code]
file | Scenario6_CustomTrigger.xaml.cs [code]
file | Scenario7_FirmwareAccess.xaml.cs [code]
file | ServiceViewModel.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/ Directory Reference

  • CustomCapability
  • Service

Service Directory Reference

Directories

directory | Client
directory | Interface
directory | Osrusbfx2Task
directory | Server
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/ Directory Reference

  • CustomCapability
  • Service
  • Client

Client Directory Reference

Files

file | FirmwareAccess.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | RpcClient.cpp [code]
file | RpcClient.h [code]
file | RpcClientApi.cpp [code]
file | RpcClientApi.h [code]
file | smbios.cpp [code]
file | targetver.h [code]
file | uefi.cpp [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Interface/ Directory Reference

  • CustomCapability
  • Service
  • Interface

Interface Directory Reference

Files

file RpcInterface.Idl [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Osrusbfx2Task/ Directory Reference

  • CustomCapability
  • Service
  • Osrusbfx2Task

Osrusbfx2Task Directory Reference

Files

file ConnectedTask.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ Directory Reference

  • CustomCapability
  • Service
  • Server

Server Directory Reference

Files

file | HsaService.cpp [code]
file | Metering.cpp [code]
file | Metering.h [code]
file | RpcServer.cpp [code]
file | RpcServer.h [code]
file | SampleService.cpp [code]
file | SampleService.h [code]
file | ServiceBase.cpp [code]
file | ServiceBase.h [code]
file | ServiceInstaller.cpp [code]
file | ServiceInstaller.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | targetver.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/ Directory Reference

  • CustomEditControl

CustomEditControl Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/cs/ Directory Reference

  • CustomEditControl
  • cs

cs Directory Reference

Files

file | CustomEditControl.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Input.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/ Directory Reference

  • CustomHidDeviceAccess

CustomHidDeviceAccess Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/ Directory Reference

  • CustomHidDeviceAccess
  • cpp

cpp Directory Reference

Files

file | DeviceListEntry.cpp [code]
file | DeviceListEntry.h [code]
file | EventHandlerForDevice.cpp [code]
file | EventHandlerForDevice.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DeviceConnect.xaml.cpp [code]
file | Scenario1_DeviceConnect.xaml.h [code]
file | Scenario2_FeatureReports.xaml.cpp [code]
file | Scenario2_FeatureReports.xaml.h [code]
file | Scenario3_InputReportEvents.xaml.cpp [code]
file | Scenario3_InputReportEvents.xaml.h [code]
file | Scenario4_InputOutputReports.xaml.cpp [code]
file | Scenario4_InputOutputReports.xaml.h [code]
file | Utilities.cpp [code]
file | Utilities.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/ Directory Reference

  • CustomHidDeviceAccess
  • cs

cs Directory Reference

Files

file | DeviceListEntry.cs [code]
file | EventHandlerForDevice.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_DeviceConnect.xaml.cs [code]
file | Scenario2_FeatureReports.xaml.cs [code]
file | Scenario3_InputReportEvents.xaml.cs [code]
file | Scenario4_InputOutputReports.xaml.cs [code]
file | Utilities.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/ Directory Reference

  • CustomSensors

CustomSensors Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/ Directory Reference

  • CustomSensors
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cs/ Directory Reference

  • CustomSensors
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/ Directory Reference

  • CustomSerialDeviceAccess

CustomSerialDeviceAccess Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/ Directory Reference

  • CustomSerialDeviceAccess
  • cs

cs Directory Reference

Files

file | Constants.cs [code]
file | DeviceListEntry.cs [code]
file | EventHandlerForDevice.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_ConnectDisconnect.xaml.cs [code]
file | Scenario2_ConfigureDevice.xaml.cs [code]
file | Scenario3_ReadWrite.xaml.cs [code]
file | Scenario4_Events.xaml.cs [code]
file | Utilities.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/ Directory Reference

  • CustomUsbDeviceAccess

CustomUsbDeviceAccess Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/ Directory Reference

  • CustomUsbDeviceAccess
  • cs

cs Directory Reference

Directories

directory | BackgroundTask

Files

file | DeviceListEntry.cs [code]
file | EventHandlerForDevice.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_ConnectDisconnect.xaml.cs [code]
file | Scenario2_ControlTransfer.xaml.cs [code]
file | Scenario3_InterruptPipes.xaml.cs [code]
file | Scenario4_BulkPipes.xaml.cs [code]
file | Scenario5_UsbDescriptors.xaml.cs [code]
file | Scenario6_InterfaceSettings.xaml.cs [code]
file | Scenario7_SyncDevice.xaml.cs [code]
file | Utilities.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/ Directory Reference

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask

BackgroundTask Directory Reference

Directories

directory | Properties

Files

file | Constants.cs [code]
file | IoSyncBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/Properties/ Directory Reference

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/ Directory Reference

  • D2DAdvancedColorImages

D2DAdvancedColorImages Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/ Directory Reference

  • D2DAdvancedColorImages
  • cpp

cpp Directory Reference

Directories

directory D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ Directory Reference

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

D2DAdvancedColorImages Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | D2DAdvancedColorImagesRenderer.cpp [code]
file | D2DAdvancedColorImagesRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | DirectXPage.xaml.cpp [code]
file | DirectXPage.xaml.h [code]
file | FilmicEffect.cpp [code]
file | FilmicEffect.h [code]
file | LuminanceHeatmapEffect.cpp [code]
file | LuminanceHeatmapEffect.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | ReinhardEffect.cpp [code]
file | ReinhardEffect.h [code]
file | RenderOptions.h [code]
file | SdrOverlayEffect.cpp [code]
file | SdrOverlayEffect.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/ Directory Reference

  • D2DCustomEffects

D2DCustomEffects Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ Directory Reference

  • D2DCustomEffects
  • cpp

cpp Directory Reference

Directories

directory | ComputeShader
directory | PixelShader
directory | VertexShader
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/ Directory Reference

  • D2DCustomEffects
  • cpp
  • ComputeShader

ComputeShader Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | CustomComputeShaderMain.cpp [code]
file | CustomComputeShaderMain.h [code]
file | CustomComputeShaderRenderer.cpp [code]
file | CustomComputeShaderRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DftEffect.cpp [code]
file | DftEffect.h [code]
file | DftTransform.cpp [code]
file | DftTransform.h [code]
file | DirectXHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleOverlay.cpp [code]
file | SampleOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/ Directory Reference

  • D2DCustomEffects
  • cpp
  • PixelShader

PixelShader Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | BasicTimer.cpp [code]
file | BasicTimer.h [code]
file | CustomPixelShaderMain.cpp [code]
file | CustomPixelShaderMain.h [code]
file | CustomPixelShaderRenderer.cpp [code]
file | CustomPixelShaderRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | RippleEffect.cpp [code]
file | RippleEffect.h [code]
file | SampleOverlay.cpp [code]
file | SampleOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/ Directory Reference

  • D2DCustomEffects
  • cpp
  • VertexShader

VertexShader Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | BasicTimer.cpp [code]
file | BasicTimer.h [code]
file | CustomVertexShaderMain.cpp [code]
file | CustomVertexShaderMain.h [code]
file | CustomVertexShaderRenderer.cpp [code]
file | CustomVertexShaderRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleOverlay.cpp [code]
file | SampleOverlay.h [code]
file | WaveEffect.cpp [code]
file | WaveEffect.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/ Directory Reference

  • D2DGradientMesh

D2DGradientMesh Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/ Directory Reference

  • D2DGradientMesh
  • cpp

cpp Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | D2DGradientMeshMain.cpp [code]
file | D2DGradientMeshMain.h [code]
file | D2DGradientMeshRenderer.cpp [code]
file | D2DGradientMeshRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleOverlay.cpp [code]
file | SampleOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/ Directory Reference

  • D2DPhotoAdjustment

D2DPhotoAdjustment Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/ Directory Reference

  • D2DPhotoAdjustment
  • cpp

cpp Directory Reference

Directories

directory | Common

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | DirectXPage.xaml.cpp [code]
file | DirectXPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PhotoAdjustmentProperties.h [code]
file | PhotoAdjustmentRenderer.cpp [code]
file | PhotoAdjustmentRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/ Directory Reference

  • D2DPhotoAdjustment
  • cpp
  • Common

Common Directory Reference

Files

file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/ Directory Reference

  • D2DSvgImage

D2DSvgImage Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/ Directory Reference

  • D2DSvgImage
  • cpp

cpp Directory Reference

Directories

directory | Common

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | D2DSvgImageRenderer.cpp [code]
file | D2DSvgImageRenderer.h [code]
file | DirectXPage.xaml.cpp [code]
file | DirectXPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/Common/ Directory Reference

  • D2DSvgImage
  • cpp
  • Common

Common Directory Reference

Files

file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/ Directory Reference

  • DatagramSocket

DatagramSocket Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/ Directory Reference

  • DatagramSocket
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | Scenario5.xaml.cpp [code]
file | Scenario5.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/ Directory Reference

  • DatagramSocket
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Start.xaml.cs [code]
file | Scenario2_Connect.xaml.cs [code]
file | Scenario3_Send.xaml.cs [code]
file | Scenario4_Close.xaml.cs [code]
file | Scenario5_MulticastAndBroadcast.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/ Directory Reference

  • DataReaderWriter

DataReaderWriter Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/ Directory Reference

  • DataReaderWriter
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_WriteReadStream.xaml.cpp [code]
file | Scenario1_WriteReadStream.xaml.h [code]
file | Scenario2_ReadBytes.xaml.cpp [code]
file | Scenario2_ReadBytes.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cs/ Directory Reference

  • DataReaderWriter
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_WriteReadStream.xaml.cs [code]
file | Scenario2_ReadBytes.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/ Directory Reference

  • DateTimeFormatting

DateTimeFormatting Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/ Directory Reference

  • DateTimeFormatting
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_LongAndShortFormats.xaml.cpp [code]
file | Scenario1_LongAndShortFormats.xaml.h [code]
file | Scenario2_StringTemplate.xaml.cpp [code]
file | Scenario2_StringTemplate.xaml.h [code]
file | Scenario3_ParameterizedTemplate.xaml.cpp [code]
file | Scenario3_ParameterizedTemplate.xaml.h [code]
file | Scenario4_Override.xaml.cpp [code]
file | Scenario4_Override.xaml.h [code]
file | Scenario5_UnicodeExtensions.xaml.cpp [code]
file | Scenario5_UnicodeExtensions.xaml.h [code]
file | Scenario6_TimeZone.xaml.cpp [code]
file | Scenario6_TimeZone.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/ Directory Reference

  • DateTimeFormatting
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_LongAndShortFormats.cpp [code]
file | Scenario1_LongAndShortFormats.h [code]
file | Scenario2_StringTemplate.cpp [code]
file | Scenario2_StringTemplate.h [code]
file | Scenario3_ParameterizedTemplate.cpp [code]
file | Scenario3_ParameterizedTemplate.h [code]
file | Scenario4_Override.cpp [code]
file | Scenario4_Override.h [code]
file | Scenario5_UnicodeExtensions.cpp [code]
file | Scenario5_UnicodeExtensions.h [code]
file | Scenario6_TimeZone.cpp [code]
file | Scenario6_TimeZone.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/ Directory Reference

  • DateTimeFormatting
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_LongAndShortFormats.xaml.cs [code]
file | Scenario2_StringTemplate.xaml.cs [code]
file | Scenario3_ParameterizedTemplate.xaml.cs [code]
file | Scenario4_Override.xaml.cs [code]
file | Scenario5_UnicodeExtensions.xaml.cs [code]
file | Scenario6_TimeZone.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/ Directory Reference

  • DeviceEnumerationAndPairing

DeviceEnumerationAndPairing Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/ Directory Reference

  • DeviceEnumerationAndPairing
  • cpp

cpp Directory Reference

Directories

directory | Tasks

Files

file | DeviceWatcherHelper.cpp [code]
file | DeviceWatcherHelper.h [code]
file | DisplayHelpers.cpp [code]
file | DisplayHelpers.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DevicePicker.xaml.cpp [code]
file | Scenario1_DevicePicker.xaml.h [code]
file | Scenario2_DeviceWatcher.xaml.cpp [code]
file | Scenario2_DeviceWatcher.xaml.h [code]
file | Scenario3_BackgroundDeviceWatcher.xaml.cpp [code]
file | Scenario3_BackgroundDeviceWatcher.xaml.h [code]
file | Scenario4_Snapshot.xaml.cpp [code]
file | Scenario4_Snapshot.xaml.h [code]
file | Scenario5_GetSingleDevice.xaml.cpp [code]
file | Scenario5_GetSingleDevice.xaml.h [code]
file | Scenario6_CustomFilterAddedProps.xaml.cpp [code]
file | Scenario6_CustomFilterAddedProps.xaml.h [code]
file | Scenario7_DeviceInformationKind.xaml.cpp [code]
file | Scenario7_DeviceInformationKind.xaml.h [code]
file | Scenario8_PairDevice.xaml.cpp [code]
file | Scenario8_PairDevice.xaml.h [code]
file | Scenario9_CustomPairDevice.xaml.cpp [code]
file | Scenario9_CustomPairDevice.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/ Directory Reference

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | BackgroundDeviceWatcherTask.cpp [code]
file | BackgroundDeviceWatcherTask.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/ Directory Reference

  • DeviceEnumerationAndPairing
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | Tasks

Files

file | DeviceHelpers.cpp [code]
file | DeviceHelpers.h [code]
file | DeviceWatcherHelper.cpp [code]
file | DeviceWatcherHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DevicePicker.cpp [code]
file | Scenario1_DevicePicker.h [code]
file | Scenario2_DeviceWatcher.cpp [code]
file | Scenario2_DeviceWatcher.h [code]
file | Scenario3_BackgroundDeviceWatcher.cpp [code]
file | Scenario3_BackgroundDeviceWatcher.h [code]
file | Scenario4_Snapshot.cpp [code]
file | Scenario4_Snapshot.h [code]
file | Scenario5_GetSingleDevice.cpp [code]
file | Scenario5_GetSingleDevice.h [code]
file | Scenario6_CustomFilterAddedProps.cpp [code]
file | Scenario6_CustomFilterAddedProps.h [code]
file | Scenario7_DeviceInformationKind.cpp [code]
file | Scenario7_DeviceInformationKind.h [code]
file | Scenario8_PairDevice.cpp [code]
file | Scenario8_PairDevice.h [code]
file | Scenario9_CustomPairDevice.cpp [code]
file | Scenario9_CustomPairDevice.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/ Directory Reference

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

Tasks Directory Reference

Files

file | BackgroundDeviceWatcher.cpp [code]
file | BackgroundDeviceWatcher.h [code]
file | BackgroundDeviceWatcher.idl [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/ Directory Reference

  • DeviceEnumerationAndPairing
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | DeviceWatcherHelper.cs [code]
file | DisplayHelpers.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_DevicePicker.xaml.cs [code]
file | Scenario2_DeviceWatcher.xaml.cs [code]
file | Scenario3_BackgroundDeviceWatcher.xaml.cs [code]
file | Scenario4_Snapshot.xaml.cs [code]
file | Scenario5_GetSingleDevice.xaml.cs [code]
file | Scenario6_CustomFilterAddedProps.xaml.cs [code]
file | Scenario7_DeviceInformationKind.xaml.cs [code]
file | Scenario8_PairDevice.xaml.cs [code]
file | Scenario9_CustomPairDevice.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Tasks/ Directory Reference

  • DeviceEnumerationAndPairing
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | BackgroundDeviceWatcher.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Tasks/Properties/ Directory Reference

  • DeviceEnumerationAndPairing
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/ Directory Reference

  • DisablingScreenCapture

DisablingScreenCapture Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/ Directory Reference

  • DisablingScreenCapture
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Enable.xaml.cpp [code]
file | Scenario1_Enable.xaml.h [code]
file | Scenario2_Disable.xaml.cpp [code]
file | Scenario2_Disable.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/ Directory Reference

  • DisablingScreenCapture
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Enable.cpp [code]
file | Scenario1_Enable.h [code]
file | Scenario2_Disable.cpp [code]
file | Scenario2_Disable.h [code]
file | Scenario3_AppCapture.cpp [code]
file | Scenario3_AppCapture.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/ Directory Reference

  • DisablingScreenCapture
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Enable.xaml.cs [code]
file | Scenario2_Disable.xaml.cs [code]
file | Scenario3_AppCapture.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/ Directory Reference

  • DisplayOrientation

DisplayOrientation Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/ Directory Reference

  • DisplayOrientation
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Orientation.xaml.cpp [code]
file | Scenario1_Orientation.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/ Directory Reference

  • DisplayOrientation
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Orientation.cpp [code]
file | Scenario1_Orientation.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cs/ Directory Reference

  • DisplayOrientation
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Orientation.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/ Directory Reference

  • DpiScaling

DpiScaling Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/ Directory Reference

  • DpiScaling
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/ Directory Reference

  • DpiScaling
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/ Directory Reference

  • DWriteColorGlyph

DWriteColorGlyph Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/ Directory Reference

  • DWriteColorGlyph
  • cpp

cpp Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | CustomTextRenderer.cpp [code]
file | CustomTextRenderer.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | DWriteColorTextRendererMain.cpp [code]
file | DWriteColorTextRendererMain.h [code]
file | DWriteColorTextRendererRenderer.cpp [code]
file | DWriteColorTextRendererRenderer.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleOverlay.cpp [code]
file | SampleOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/ Directory Reference

  • DWriteLineSpacingModes

DWriteLineSpacingModes Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/ Directory Reference

  • DWriteLineSpacingModes
  • cpp

cpp Directory Reference

Directories

directory | DWriteLineSpacingModes
directory | DWriteTextLayoutImplementation
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/ Directory Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

DWriteLineSpacingModes Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DefaultSpacing.xaml.cpp [code]
file | Scenario1_DefaultSpacing.xaml.h [code]
file | Scenario2_UniformSpacing.xaml.cpp [code]
file | Scenario2_UniformSpacing.xaml.h [code]
file | Scenario3_ProportionalSpacing.xaml.cpp [code]
file | Scenario3_ProportionalSpacing.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/ Directory Reference

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

DWriteTextLayoutImplementation Directory Reference

Files

file | DirectXHelper.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | TextLayout.cpp [code]
file | TextLayout.h [code]
file | TextLayoutImageSource.cpp [code]
file | TextLayoutImageSource.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/ Directory Reference

  • DWriteTextLayoutCloudFont

DWriteTextLayoutCloudFont Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/ Directory Reference

  • DWriteTextLayoutCloudFont
  • cpp

cpp Directory Reference

Directories

directory | DWriteTextLayoutCloudFont
directory | DWriteTextLayoutCloudFontImplementation
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/ Directory Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

DWriteTextLayoutCloudFont Directory Reference

Files

file | DocumentPresenter.cpp [code]
file | DocumentPresenter.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario_CloudFontOverview.xaml.cpp [code]
file | Scenario_CloudFontOverview.xaml.h [code]
file | Scenario_Document1.xaml.cpp [code]
file | Scenario_Document1.xaml.h [code]
file | Scenario_Document2.xaml.cpp [code]
file | Scenario_Document2.xaml.h [code]
file | Scenario_Document3.xaml.cpp [code]
file | Scenario_Document3.xaml.h [code]
file | Scenario_SampleOverview.xaml.cpp [code]
file | Scenario_SampleOverview.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/ Directory Reference

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

DWriteTextLayoutCloudFontImplementation Directory Reference

Files

file | DirectXHelper.h [code]
file | FontDownloadListener.cpp [code]
file | FontDownloadListener.h [code]
file | FontNameCollector.cpp [code]
file | FontNameCollector.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | TextLayout.cpp [code]
file | TextLayout.h [code]
file | TextLayoutImageSource.cpp [code]
file | TextLayoutImageSource.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/ Directory Reference

  • EnterpriseDataProtection

EnterpriseDataProtection Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/ Directory Reference

  • EnterpriseDataProtection
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario10_CpToClipboard.xaml.cs [code]
file | Scenario11_CPDNoUI.xaml.cs [code]
file | Scenario12_ShareData.xaml.cs [code]
file | Scenario13_ShareTarget.xaml.cs [code]
file | Scenario14_QueryCpPaste.xaml.cs [code]
file | Scenario15_DPLFileCreateEvents.xaml.cs [code]
file | Scenario16_NetworkResource.xaml.cs [code]
file | Scenario1_Setup.xaml.cs [code]
file | Scenario2_IdManaged.xaml.cs [code]
file | Scenario3_UIPolicy.xaml.cs [code]
file | Scenario4_FilePMgr.xaml.cs [code]
file | Scenario5_Revoke.xaml.cs [code]
file | Scenario6_ProtectBuffer.xaml.cs [code]
file | Scenario7_ProtectStream.xaml.cs [code]
file | Scenario8_ClipboardSource.xaml.cs [code]
file | Scenario9_ClipboardTarget.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/ Directory Reference

  • EnterpriseDataProtection
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | EdpBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/Properties/ Directory Reference

  • EnterpriseDataProtection
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/ Directory Reference

  • ExtendedExecution

ExtendedExecution Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/ Directory Reference

  • ExtendedExecution
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_UnspecifiedReason.xaml.cpp [code]
file | Scenario1_UnspecifiedReason.xaml.h [code]
file | Scenario2_SavingDataReason.xaml.cpp [code]
file | Scenario2_SavingDataReason.xaml.h [code]
file | Scenario3_LocationTrackingReason.xaml.cpp [code]
file | Scenario3_LocationTrackingReason.xaml.h [code]
file | Scenario4_MultipleTasks.xaml.cpp [code]
file | Scenario4_MultipleTasks.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cs/ Directory Reference

  • ExtendedExecution
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_UnspecifiedReason.xaml.cs [code]
file | Scenario2_SavingDataReason.xaml.cs [code]
file | Scenario3_LocationTrackingReason.xaml.cs [code]
file | Scenario4_MultipleTasks.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/ Directory Reference

  • FileAccess

FileAccess Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/ Directory Reference

  • FileAccess
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario10_Delete.xaml.cpp [code]
file | Scenario10_Delete.xaml.h [code]
file | Scenario11_TryGet.xaml.cpp [code]
file | Scenario11_TryGet.xaml.h [code]
file | Scenario1_Create.xaml.cpp [code]
file | Scenario1_Create.xaml.h [code]
file | Scenario2_GetParent.xaml.cpp [code]
file | Scenario2_GetParent.xaml.h [code]
file | Scenario3_Text.xaml.cpp [code]
file | Scenario3_Text.xaml.h [code]
file | Scenario4_Bytes.xaml.cpp [code]
file | Scenario4_Bytes.xaml.h [code]
file | Scenario5_Stream.xaml.cpp [code]
file | Scenario5_Stream.xaml.h [code]
file | Scenario6_Properties.xaml.cpp [code]
file | Scenario6_Properties.xaml.h [code]
file | Scenario7_FutureAccess.xaml.cpp [code]
file | Scenario7_FutureAccess.xaml.h [code]
file | Scenario8_Copy.xaml.cpp [code]
file | Scenario8_Copy.xaml.h [code]
file | Scenario9_Compare.xaml.cpp [code]
file | Scenario9_Compare.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/ Directory Reference

  • FileAccess
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario10.cpp [code]
file | Scenario10.h [code]
file | Scenario11.cpp [code]
file | Scenario11.h [code]
file | Scenario2.cpp [code]
file | Scenario2.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
file | Scenario4.cpp [code]
file | Scenario4.h [code]
file | Scenario5.cpp [code]
file | Scenario5.h [code]
file | Scenario6.cpp [code]
file | Scenario6.h [code]
file | Scenario7.cpp [code]
file | Scenario7.h [code]
file | Scenario8.cpp [code]
file | Scenario8.h [code]
file | Scenario9.cpp [code]
file | Scenario9.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/ Directory Reference

  • FileAccess
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario10_Delete.xaml.cs [code]
file | Scenario11_TryGet.xaml.cs [code]
file | Scenario1_Create.xaml.cs [code]
file | Scenario2_GetParent.xaml.cs [code]
file | Scenario3_Text.xaml.cs [code]
file | Scenario4_Bytes.xaml.cs [code]
file | Scenario5_Stream.xaml.cs [code]
file | Scenario6_Properties.xaml.cs [code]
file | Scenario7_FutureAccess.xaml.cs [code]
file | Scenario8_Copy.xaml.cs [code]
file | Scenario9_Compare.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/ Directory Reference

  • FilePicker

FilePicker Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/ Directory Reference

  • FilePicker
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SingleFile.xaml.cpp [code]
file | Scenario1_SingleFile.xaml.h [code]
file | Scenario2_MultiFile.xaml.cpp [code]
file | Scenario2_MultiFile.xaml.h [code]
file | Scenario3_SingleFolder.xaml.cpp [code]
file | Scenario3_SingleFolder.xaml.h [code]
file | Scenario4_SaveFile.xaml.cpp [code]
file | Scenario4_SaveFile.xaml.h [code]
file | Scenario5_TriggerCFU.xaml.cpp [code]
file | Scenario5_TriggerCFU.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/ Directory Reference

  • FilePicker
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SingleFile.cpp [code]
file | Scenario1_SingleFile.h [code]
file | Scenario2_MultiFile.cpp [code]
file | Scenario2_MultiFile.h [code]
file | Scenario3_SingleFolder.cpp [code]
file | Scenario3_SingleFolder.h [code]
file | Scenario4_SaveFile.cpp [code]
file | Scenario4_SaveFile.h [code]
file | Scenario5_TriggerCFU.cpp [code]
file | Scenario5_TriggerCFU.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/ Directory Reference

  • FilePicker
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SingleFile.xaml.cs [code]
file | Scenario2_MultiFile.xaml.cs [code]
file | Scenario3_SingleFolder.xaml.cs [code]
file | Scenario4_SaveFile.xaml.cs [code]
file | Scenario5_TriggerCFU.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/ Directory Reference

  • FilePickerContracts

FilePickerContracts Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/ Directory Reference

  • FilePickerContracts
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | App.xaml.cs [code]
file | App.xaml.custom.cs [code]
file | CachedFileUpdater_Local.xaml.cs [code]
file | CachedFileUpdater_Remote.xaml.cs [code]
file | CachedFileUpdaterPage.xaml.cs [code]
file | FileOpenPicker_PickAppFile.xaml.cs [code]
file | FileOpenPicker_PickCachedFile.xaml.cs [code]
file | FileOpenPicker_PickURLFile.xaml.cs [code]
file | FileOpenPickerPage.xaml.cs [code]
file | FileSavePicker_FailToSave.xaml.cs [code]
file | FileSavePicker_SaveToAppStorage.xaml.cs [code]
file | FileSavePicker_SaveToCachedFile.xaml.cs [code]
file | FileSavePickerPage.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | MainPage_CachedFile.xaml.cs [code]
file | MainPage_PickFile.xaml.cs [code]
file | MainPage_SaveFile.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/Tasks/ Directory Reference

  • FilePickerContracts
  • cs
  • Tasks

Tasks Directory Reference

Files

file UpdateFileTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/ Directory Reference

  • FileSearch

FileSearch Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/ Directory Reference

  • FileSearch
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/ Directory Reference

  • FileSearch
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cs/ Directory Reference

  • FileSearch
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/ Directory Reference

  • FileThumbnails

FileThumbnails Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/ Directory Reference

  • FileThumbnails
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | Scenario5.xaml.cpp [code]
file | Scenario5.xaml.h [code]
file | Scenario6.xaml.cpp [code]
file | Scenario6.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/ Directory Reference

  • FileThumbnails
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario2.cpp [code]
file | Scenario2.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
file | Scenario4.cpp [code]
file | Scenario4.h [code]
file | Scenario5.cpp [code]
file | Scenario5.h [code]
file | Scenario6.cpp [code]
file | Scenario6.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/ Directory Reference

  • FileThumbnails
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
file | Scenario5.xaml.cs [code]
file | Scenario6.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/ Directory Reference

  • FolderEnumeration

FolderEnumeration Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/ Directory Reference

  • FolderEnumeration
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/ Directory Reference

  • FolderEnumeration
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario2.cpp [code]
file | Scenario2.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
file | Scenario4.cpp [code]
file | Scenario4.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/ Directory Reference

  • FolderEnumeration
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/ Directory Reference

  • FullScreenMode

FullScreenMode Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/ Directory Reference

  • FullScreenMode
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.xaml.cpp [code]
file | Scenario1_Basic.xaml.h [code]
file | Scenario2_Launch.xaml.cpp [code]
file | Scenario2_Launch.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/ Directory Reference

  • FullScreenMode
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.cpp [code]
file | Scenario1_Basic.h [code]
file | Scenario2_Launch.cpp [code]
file | Scenario2_Launch.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/ Directory Reference

  • FullScreenMode
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basic.xaml.cs [code]
file | Scenario2_Launch.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/ Directory Reference

  • Geolocation

Geolocation Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/ Directory Reference

  • Geolocation
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | Tasks

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_TrackPosition.cpp [code]
file | Scenario1_TrackPosition.h [code]
file | Scenario2_GetPosition.cpp [code]
file | Scenario2_GetPosition.h [code]
file | Scenario3_BackgroundTask.cpp [code]
file | Scenario3_BackgroundTask.h [code]
file | Scenario4_ForegroundGeofence.cpp [code]
file | Scenario4_ForegroundGeofence.h [code]
file | Scenario5_GeofenceBackgroundTask.cpp [code]
file | Scenario5_GeofenceBackgroundTask.h [code]
file | Scenario6_GetLastVisit.cpp [code]
file | Scenario6_GetLastVisit.h [code]
file | Scenario7_ForegroundVisits.cpp [code]
file | Scenario7_ForegroundVisits.h [code]
file | Scenario8_VisitsBackgroundTask.cpp [code]
file | Scenario8_VisitsBackgroundTask.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/ Directory Reference

  • Geolocation
  • cppwinrt
  • Tasks

Tasks Directory Reference

Files

file | GeofenceBackgroundTask.cpp [code]
file | GeofenceBackgroundTask.h [code]
file | Helpers.cpp [code]
file | Helpers.h [code]
file | LocationBackgroundTask.cpp [code]
file | LocationBackgroundTask.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Tasks.idl [code]
file | VisitBackgroundTask.cpp [code]
file | VisitBackgroundTask.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/ Directory Reference

  • Geolocation
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_TrackPosition.xaml.cs [code]
file | Scenario2_GetPosition.xaml.cs [code]
file | Scenario3_BackgroundTask.xaml.cs [code]
file | Scenario4_ForegroundGeofence.xaml.cs [code]
file | Scenario5_GeofenceBackgroundTask.xaml.cs [code]
file | Scenario6_GetLastVisit.xaml.cs [code]
file | Scenario7_ForegroundVisits.xaml.cs [code]
file | Scenario8_VisitsBackgroundTask.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/ Directory Reference

  • Geolocation
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | GeofenceBackgroundTask.cs [code]
file | Helpers.cs [code]
file | LocationBackgroundTask.cs [code]
file | VisitBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/Properties/ Directory Reference

  • Geolocation
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/ Directory Reference

  • Geotag

Geotag Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/ Directory Reference

  • Geotag
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Geotag.xaml.cpp [code]
file | Scenario1_Geotag.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cs/ Directory Reference

  • Geotag
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Geotag.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/ Directory Reference

  • GlobalizationPreferences

GlobalizationPreferences Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/ Directory Reference

  • GlobalizationPreferences
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Prefs.xaml.cpp [code]
file | Scenario1_Prefs.xaml.h [code]
file | Scenario2_Lang.xaml.cpp [code]
file | Scenario2_Lang.xaml.h [code]
file | Scenario3_Region.xaml.cpp [code]
file | Scenario3_Region.xaml.h [code]
file | Scenario4_Input.xaml.cpp [code]
file | Scenario4_Input.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/ Directory Reference

  • GlobalizationPreferences
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Prefs.cpp [code]
file | Scenario1_Prefs.h [code]
file | Scenario2_Lang.cpp [code]
file | Scenario2_Lang.h [code]
file | Scenario3_Region.cpp [code]
file | Scenario3_Region.h [code]
file | Scenario4_Input.cpp [code]
file | Scenario4_Input.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/ Directory Reference

  • GlobalizationPreferences
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Prefs.xaml.cs [code]
file | Scenario2_Lang.xaml.cs [code]
file | Scenario3_Region.xaml.cs [code]
file | Scenario4_Input.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/ Directory Reference

  • Gyrometer

Gyrometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/ Directory Reference

  • Gyrometer
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
file | Scenario3_Porting.xaml.cpp [code]
file | Scenario3_Porting.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/ Directory Reference

  • Gyrometer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_Porting.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/ Directory Reference

  • HolographicFaceTracking

HolographicFaceTracking Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/ Directory Reference

  • HolographicFaceTracking
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicFaceTrackerMain.cpp [code]
file | HolographicFaceTrackerMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/ Directory Reference

  • HolographicFaceTracking
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/ Directory Reference

  • HolographicFaceTracking
  • cpp
  • Content

Content Directory Reference

Files

file | FaceTrackerProcessor.cpp [code]
file | FaceTrackerProcessor.h [code]
file | NV12VideoTexture.cpp [code]
file | NV12VideoTexture.h [code]
file | QuadRenderer.cpp [code]
file | QuadRenderer.h [code]
file | ShaderStructures.h [code]
file | SpinningCubeRenderer.cpp [code]
file | SpinningCubeRenderer.h [code]
file | TextRenderer.cpp [code]
file | TextRenderer.h [code]
file | VideoFrameProcessor.cpp [code]
file | VideoFrameProcessor.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/ Directory Reference

  • HolographicMixedRealityCapture

HolographicMixedRealityCapture Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/ Directory Reference

  • HolographicMixedRealityCapture
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content
directory | MrcEffectDefinitions

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicMRCSampleMain.cpp [code]
file | HolographicMRCSampleMain.h [code]
file | MediaCaptureManager.cpp [code]
file | MediaCaptureManager.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/ Directory Reference

  • HolographicMixedRealityCapture
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.cpp [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/ Directory Reference

  • HolographicMixedRealityCapture
  • cpp
  • Content

Content Directory Reference

Files

file | Button.cpp [code]
file | Button.h [code]
file | ControlBase.cpp [code]
file | ControlBase.h [code]
file | Cursor.cpp [code]
file | Cursor.h [code]
file | IControl.h [code]
file | Panel.cpp [code]
file | Panel.h [code]
file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | SpinningCubeRenderer.cpp [code]
file | SpinningCubeRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/ Directory Reference

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

MrcEffectDefinitions Directory Reference

Files

file | MrcAudioEffectDefinition.cpp [code]
file | MrcAudioEffectDefinition.h [code]
file | MrcVideoEffectDefinition.cpp [code]
file | MrcVideoEffectDefinition.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/ Directory Reference

  • HolographicSpatialMapping

HolographicSpatialMapping Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/ Directory Reference

  • HolographicSpatialMapping
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicSpatialMappingMain.cpp [code]
file | HolographicSpatialMappingMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/ Directory Reference

  • HolographicSpatialMapping
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/ Directory Reference

  • HolographicSpatialMapping
  • cpp
  • Content

Content Directory Reference

Files

file | GetDataFromIBuffer.h [code]
file | RealtimeSurfaceMeshRenderer.cpp [code]
file | RealtimeSurfaceMeshRenderer.h [code]
file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | SurfaceMesh.cpp [code]
file | SurfaceMesh.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/ Directory Reference

  • HolographicSpatialStage

HolographicSpatialStage Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/ Directory Reference

  • HolographicSpatialStage
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicSpatialStageMain.cpp [code]
file | HolographicSpatialStageMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SpatialStageManager.cpp [code]
file | SpatialStageManager.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/ Directory Reference

  • HolographicSpatialStage
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/ Directory Reference

  • HolographicSpatialStage
  • cpp
  • Content

Content Directory Reference

Files

file | SceneController.cpp [code]
file | SceneController.h [code]
file | SceneObject.cpp [code]
file | SceneObject.h [code]
file | ShaderStructures.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/ Directory Reference

  • HolographicTagAlong

HolographicTagAlong Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/ Directory Reference

  • HolographicTagAlong
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicTagAlongSampleMain.cpp [code]
file | HolographicTagAlongSampleMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Common/ Directory Reference

  • HolographicTagAlong
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/ Directory Reference

  • HolographicTagAlong
  • cpp
  • Content

Content Directory Reference

Files

file | DDSTextureLoader.cpp [code]
file | DDSTextureLoader.h [code]
file | DistanceFieldRenderer.cpp [code]
file | DistanceFieldRenderer.h [code]
file | QuadRenderer.cpp [code]
file | QuadRenderer.h [code]
file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | TextRenderer.cpp [code]
file | TextRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/ Directory Reference

  • HolographicVoiceInput

HolographicVoiceInput Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/ Directory Reference

  • HolographicVoiceInput
  • cpp

cpp Directory Reference

Directories

directory | Audio
directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | HolographicVoiceInputMain.cpp [code]
file | HolographicVoiceInputMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/ Directory Reference

  • HolographicVoiceInput
  • cpp
  • Audio

Audio Directory Reference

Files

file | AudioFileReader.cpp [code]
file | AudioFileReader.h [code]
file | AudioStreamReader.cpp [code]
file | AudioStreamReader.h [code]
file | OmnidirectionalSound.cpp [code]
file | OmnidirectionalSound.h [code]
file | XAudio2Helpers.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/ Directory Reference

  • HolographicVoiceInput
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | PrintWstringToDebugConsole.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Content/ Directory Reference

  • HolographicVoiceInput
  • cpp
  • Content

Content Directory Reference

Files

file | ShaderStructures.h [code]
file | SpatialInputHandler.cpp [code]
file | SpatialInputHandler.h [code]
file | SpinningCubeRenderer.cpp [code]
file | SpinningCubeRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/ Directory Reference

  • HotspotAuthentication

HotspotAuthentication Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/ Directory Reference

  • HotspotAuthentication
  • cs

cs Directory Reference

Directories

directory | HotspotAuthenticationTask

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Initialization.xaml.cs [code]
file | Scenario2_BackgroundTask.xaml.cs [code]
file | Scenario3_ForegroundApp.xaml.cs [code]
file | ScenarioCommon.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/ Directory Reference

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask

HotspotAuthenticationTask Directory Reference

Directories

directory | Properties

Files

file | BackgroundTask.cs [code]
file | ConfigStore.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/Properties/ Directory Reference

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/ Directory Reference

  • HttpClient

HttpClient Directory Reference

Directories

directory | cppwinrt
directory | cs
directory | HttpFilters
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/ Directory Reference

  • HttpClient
  • cppwinrt

cppwinrt Directory Reference

Files

file | Helpers.cpp [code]
file | Helpers.h [code]
file | HttpJsonContent.cpp [code]
file | HttpJsonContent.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PlugInFilter.cpp [code]
file | PlugInFilter.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario01_GetText.cpp [code]
file | Scenario01_GetText.h [code]
file | Scenario02_GetStream.cpp [code]
file | Scenario02_GetStream.h [code]
file | Scenario03_GetList.cpp [code]
file | Scenario03_GetList.h [code]
file | Scenario04_PostText.cpp [code]
file | Scenario04_PostText.h [code]
file | Scenario05_PostStream.cpp [code]
file | Scenario05_PostStream.h [code]
file | Scenario06_PostMultipart.cpp [code]
file | Scenario06_PostMultipart.h [code]
file | Scenario07_PostStreamWithProgress.cpp [code]
file | Scenario07_PostStreamWithProgress.h [code]
file | Scenario08_PostCustomContent.cpp [code]
file | Scenario08_PostCustomContent.h [code]
file | Scenario09_GetCookie.cpp [code]
file | Scenario09_GetCookie.h [code]
file | Scenario10_SetCookie.cpp [code]
file | Scenario10_SetCookie.h [code]
file | Scenario11_DeleteCookie.cpp [code]
file | Scenario11_DeleteCookie.h [code]
file | Scenario12_DisableCookies.cpp [code]
file | Scenario12_DisableCookies.h [code]
file | Scenario13_RetryFilter.cpp [code]
file | Scenario13_RetryFilter.h [code]
file | Scenario14_MeteredConnectionFilter.cpp [code]
file | Scenario14_MeteredConnectionFilter.h [code]
file | Scenario15_ServerCertificateValidation.cpp [code]
file | Scenario15_ServerCertificateValidation.h [code]
file | SlowInputStream.cpp [code]
file | SlowInputStream.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/ Directory Reference

  • HttpClient
  • cs

cs Directory Reference

Files

file | Helpers.cs [code]
file | HttpJsonContent.cs [code]
file | PlugInFilter.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario01_GetText.xaml.cs [code]
file | Scenario02_GetStream.xaml.cs [code]
file | Scenario03_GetList.xaml.cs [code]
file | Scenario04_PostText.xaml.cs [code]
file | Scenario05_PostStream.xaml.cs [code]
file | Scenario06_PostMultipart.xaml.cs [code]
file | Scenario07_PostStreamWithProgress.xaml.cs [code]
file | Scenario08_PostCustomContent.xaml.cs [code]
file | Scenario09_GetCookie.xaml.cs [code]
file | Scenario10_SetCookie.xaml.cs [code]
file | Scenario11_DeleteCookie.xaml.cs [code]
file | Scenario12_DisableCookies.xaml.cs [code]
file | Scenario13_RetryFilter.xaml.cs [code]
file | Scenario14_MeteredConnectionFilter.xaml.cs [code]
file | Scenario15_ServerCertificateValidation.xaml.cs [code]
file | SlowInputStream.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/ Directory Reference

  • HttpClient
  • HttpFilters

HttpFilters Directory Reference

Files

file | HttpMeteredConnectionFilter.cpp [code]
file | HttpMeteredConnectionFilter.h [code]
file | HttpRetryFilter.cpp [code]
file | HttpRetryFilter.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/ Directory Reference

  • Inclinometer

Inclinometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/ Directory Reference

  • Inclinometer
  • cpp

cpp Directory Reference

Files

file | CalibrationBar.xaml.cpp [code]
file | CalibrationBar.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
file | Scenario3_Calibration.xaml.cpp [code]
file | Scenario3_Calibration.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cs/ Directory Reference

  • Inclinometer
  • cs

cs Directory Reference

Files

file | CalibrationBar.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_Calibration.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/ Directory Reference

  • InkAnalysis

InkAnalysis Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/cs/ Directory Reference

  • InkAnalysis
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/ Directory Reference

  • IoT-GPIO

IoT-GPIO Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/ Directory Reference

  • IoT-GPIO
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_GetAndSetPin.xaml.cpp [code]
file | Scenario1_GetAndSetPin.xaml.h [code]
file | Scenario2_Listen.xaml.cpp [code]
file | Scenario2_Listen.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/ Directory Reference

  • IoT-GPIO
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_GetAndSetPin.cpp [code]
file | Scenario1_GetAndSetPin.h [code]
file | Scenario2_Listen.cpp [code]
file | Scenario2_Listen.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cs/ Directory Reference

  • IoT-GPIO
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_GetAndSetPin.xaml.cs [code]
file | Scenario2_Listen.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/ Directory Reference

  • IoT-I2C

IoT-I2C Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/ Directory Reference

  • IoT-I2C
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ReadData.xaml.cpp [code]
file | Scenario1_ReadData.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/ Directory Reference

  • IoT-I2C
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ReadData.cpp [code]
file | Scenario1_ReadData.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cs/ Directory Reference

  • IoT-I2C
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ReadData.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/ Directory Reference

  • IoT-SPI

IoT-SPI Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/ Directory Reference

  • IoT-SPI
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ReadData.xaml.cpp [code]
file | Scenario1_ReadData.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/ Directory Reference

  • IoT-SPI
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ReadData.cpp [code]
file | Scenario1_ReadData.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cs/ Directory Reference

  • IoT-SPI
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ReadData.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/ Directory Reference

  • JapanesePhoneticAnalysis

JapanesePhoneticAnalysis Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/ Directory Reference

  • JapanesePhoneticAnalysis
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Analyze.xaml.cpp [code]
file | Scenario1_Analyze.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/ Directory Reference

  • JapanesePhoneticAnalysis
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Analyze.cpp [code]
file | Scenario1_Analyze.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cs/ Directory Reference

  • JapanesePhoneticAnalysis
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Analyze.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/ Directory Reference

  • Json

Json Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/ Directory Reference

  • Json
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ParseAndStringify.cpp [code]
file | Scenario1_ParseAndStringify.h [code]
file | School.cpp [code]
file | School.h [code]
file | User.cpp [code]
file | User.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/ Directory Reference

  • Json
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ParseAndStringify.xaml.cs [code]
file | School.cs [code]
file | User.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/ Directory Reference

  • JumpList

JumpList Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/ Directory Reference

  • JumpList
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Launched.xaml.cpp [code]
file | Scenario1_Launched.xaml.h [code]
file | Scenario2_Remove.xaml.cpp [code]
file | Scenario2_Remove.xaml.h [code]
file | Scenario3_CustomItems.xaml.cpp [code]
file | Scenario3_CustomItems.xaml.h [code]
file | Scenario4_ChangeSystemGroup.xaml.cpp [code]
file | Scenario4_ChangeSystemGroup.xaml.h [code]
file | Scenario5_IsSupported.xaml.cpp [code]
file | Scenario5_IsSupported.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/ Directory Reference

  • JumpList
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Launched.cpp [code]
file | Scenario1_Launched.h [code]
file | Scenario2_Remove.cpp [code]
file | Scenario2_Remove.h [code]
file | Scenario3_CustomItems.cpp [code]
file | Scenario3_CustomItems.h [code]
file | Scenario4_ChangeSystemGroup.cpp [code]
file | Scenario4_ChangeSystemGroup.h [code]
file | Scenario5_IsSupported.cpp [code]
file | Scenario5_IsSupported.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/ Directory Reference

  • JumpList
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Launched.xaml.cs [code]
file | Scenario2_Remove.xaml.cs [code]
file | Scenario3_CustomItems.xaml.cs [code]
file | Scenario4_ChangeSystemGroup.xaml.cs [code]
file | Scenario5_IsSupported.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/ Directory Reference

  • KeyCredentialManager

KeyCredentialManager Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/ Directory Reference

  • KeyCredentialManager
  • cpp

cpp Directory Reference

Files

file | Account.cpp [code]
file | Account.h [code]
file | App.xaml.cpp [code]
file | Content.xaml.cpp [code]
file | Content.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | SignIn.xaml.cpp [code]
file | SignIn.xaml.h [code]
file | UserSelect.xaml.cpp [code]
file | UserSelect.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/ Directory Reference

  • KeyCredentialManager
  • cs

cs Directory Reference

Files

file | Account.cs [code]
file | AccountsHelper.cs [code]
file | Content.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SignIn.xaml.cs [code]
file | UserSelect.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/ Directory Reference

  • LampArray

LampArray Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/ Directory Reference

  • LampArray
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basics.cpp [code]
file | Scenario1_Basics.h [code]
file | Scenario2_Effects.cpp [code]
file | Scenario2_Effects.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/ Directory Reference

  • LampArray
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basics.xaml.cs [code]
file | Scenario2_Effects.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/ Directory Reference

  • LampDevice

LampDevice Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/ Directory Reference

  • LampDevice
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_GetLamp.xaml.cpp [code]
file | Scenario1_GetLamp.xaml.h [code]
file | Scenario2_EnableSettings.xaml.cpp [code]
file | Scenario2_EnableSettings.xaml.h [code]
file | Scenario3_AvailabilityChanged.xaml.cpp [code]
file | Scenario3_AvailabilityChanged.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/ Directory Reference

  • LampDevice
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_GetLamp.xaml.cs [code]
file | Scenario2_EnableSettings.xaml.cs [code]
file | Scenario3_AvailabilityChanged.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/ Directory Reference

  • LanguageFont

LanguageFont Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/ Directory Reference

  • LanguageFont
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_UIFonts.cpp [code]
file | Scenario1_UIFonts.h [code]
file | Scenario2_DocumentFonts.cpp [code]
file | Scenario2_DocumentFonts.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cs/ Directory Reference

  • LanguageFont
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_UIFonts.xaml.cs [code]
file | Scenario2_DocumentFonts.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/ Directory Reference

  • LibraryManagement

LibraryManagement Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/ Directory Reference

  • LibraryManagement
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | S1_AddFolder.xaml.cpp [code]
file | S1_AddFolder.xaml.h [code]
file | S2_ListFolders.xaml.cpp [code]
file | S2_ListFolders.xaml.h [code]
file | S3_RemoveFolder.xaml.cpp [code]
file | S3_RemoveFolder.xaml.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/ Directory Reference

  • LibraryManagement
  • cs

cs Directory Reference

Files

file | S1_AddFolder.xaml.cs [code]
file | S2_ListFolders.xaml.cs [code]
file | S3_RemoveFolder.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/ Directory Reference

  • LightSensor

LightSensor Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/ Directory Reference

  • LightSensor
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cs/ Directory Reference

  • LightSensor
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/ Directory Reference

  • LineDisplay

LineDisplay Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/ Directory Reference

  • LineDisplay
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SelectDisplay.xaml.cpp [code]
file | Scenario1_SelectDisplay.xaml.h [code]
file | Scenario2_DisplayText.xaml.cpp [code]
file | Scenario2_DisplayText.xaml.h [code]
file | Scenario3_UsingWindows.xaml.cpp [code]
file | Scenario3_UsingWindows.xaml.h [code]
file | Scenario4_UpdatingLineDisplayAttributes.xaml.cpp [code]
file | Scenario4_UpdatingLineDisplayAttributes.xaml.h [code]
file | Scenario5_DefiningCustomGlyphs.xaml.cpp [code]
file | Scenario5_DefiningCustomGlyphs.xaml.h [code]
file | Scenario6_ManipulatingCursorAttributes.xaml.cpp [code]
file | Scenario6_ManipulatingCursorAttributes.xaml.h [code]
file | Scenario7_ScrollingContentUsingMarquee.xaml.cpp [code]
file | Scenario7_ScrollingContentUsingMarquee.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/ Directory Reference

  • LineDisplay
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SelectDisplay.xaml.cs [code]
file | Scenario2_DisplayText.xaml.cs [code]
file | Scenario3_UsingWindows.xaml.cs [code]
file | Scenario4_UpdatingLineDisplayAttributes.xaml.cs [code]
file | Scenario5_DefiningCustomGlyphs.xaml.cs [code]
file | Scenario6_ManipulatingCursorAttributes.xaml.cs [code]
file | Scenario7_ScrollingContentUsingMarquee.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/ Directory Reference

  • LinguisticServices

LinguisticServices Directory Reference

Directories

directory | cppwinrt
directory | cs
directory | RuntimeComponent
directory | shared
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/ Directory Reference

  • LinguisticServices
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_LanguageDetection.cpp [code]
file | Scenario1_LanguageDetection.h [code]
file | Scenario2_ScriptDetection.cpp [code]
file | Scenario2_ScriptDetection.h [code]
file | Scenario3_Transliteration.cpp [code]
file | Scenario3_Transliteration.h [code]
file | Scenario4_CharacterGrouping.cpp [code]
file | Scenario4_CharacterGrouping.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/ Directory Reference

  • LinguisticServices
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_LanguageDetection.xaml.cs [code]
file | Scenario2_ScriptDetection.xaml.cs [code]
file | Scenario3_Transliteration.xaml.cs [code]
file | Scenario4_CharacterGrouping.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/ Directory Reference

  • LinguisticServices
  • RuntimeComponent

RuntimeComponent Directory Reference

Files

file | LinguisticServices.cpp [code]
file | LinguisticServices.h [code]
file | LinguisticServices.idl [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/shared/ Directory Reference

  • LinguisticServices
  • shared

shared Directory Reference

Files

file elsutil.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/ Directory Reference

  • LiveDash

LiveDash Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/ Directory Reference

  • LiveDash
  • cs

cs Directory Reference

Directories

directory | LiveDash
directory | LiveDashApp
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/ Directory Reference

  • LiveDash
  • cs
  • LiveDash

LiveDash Directory Reference

Directories

directory | Models
directory | Util

Files

file | ILivePlayer.cs [code]
file | LiveDashPlayer.cs [code]
file | LiveSourceBufferManager.cs [code]
file | Player.cs [code]
file | SourceBufferManager.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/ Directory Reference

  • LiveDash
  • cs
  • LiveDash
  • Models

Models Directory Reference

Files

file | Manifest.cs [code]
file | MediaSegment.cs [code]
file | MediaSegmentInformation.cs [code]
file | MediaStream.cs [code]
file | Period.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Util/ Directory Reference

  • LiveDash
  • cs
  • LiveDash
  • Util

Util Directory Reference

Files

file | DashManifestParser.cs [code]
file | Utils.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/ Directory Reference

  • LiveDash
  • cs
  • LiveDashApp

LiveDashApp Directory Reference

Directories

directory | Views

Files

file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/Views/ Directory Reference

  • LiveDash
  • cs
  • LiveDashApp
  • Views

Views Directory Reference

Files

file | LiveDashPlayer.xaml.cs [code]
file | Log.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/ Directory Reference

  • LockScreenApps

LockScreenApps Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/ Directory Reference

  • LockScreenApps
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Configure.cpp [code]
file | Scenario1_Configure.h [code]
file | Scenario2_Notifications.cpp [code]
file | Scenario2_Notifications.h [code]
file | Scenario3_SecondaryTiles.cpp [code]
file | Scenario3_SecondaryTiles.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/ Directory Reference

  • LockScreenApps
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Configure.xaml.cs [code]
file | Scenario2_Notifications.xaml.cs [code]
file | Scenario3_SecondaryTiles.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/ Directory Reference

  • Logging

Logging Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/ Directory Reference

  • Logging
  • cpp

cpp Directory Reference

Files

file | FileLoggingSessionScenario.cpp [code]
file | FileLoggingSessionScenario.h [code]
file | LoggingChannelScenario.cpp [code]
file | LoggingChannelScenario.h [code]
file | LoggingScenarioEventArgs.h [code]
file | LoggingScenarioHelpers.h [code]
file | LoggingSessionScenario.cpp [code]
file | LoggingSessionScenario.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/ Directory Reference

  • Logging
  • cppwinrt

cppwinrt Directory Reference

Files

file | FileLoggingSessionScenario.cpp [code]
file | FileLoggingSessionScenario.h [code]
file | LoggingChannelScenario.cpp [code]
file | LoggingChannelScenario.h [code]
file | LoggingScenarioEventArgs.h [code]
file | LoggingScenarioHelpers.h [code]
file | LoggingSessionScenario.cpp [code]
file | LoggingSessionScenario.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario2.cpp [code]
file | Scenario2.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/ Directory Reference

  • Logging
  • cs

cs Directory Reference

Files

file | FileLoggingSessionScenario.cs [code]
file | LoggingChannelScenario.cs [code]
file | LoggingScenarioEventArgs.cs [code]
file | LoggingSessionScenario.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/ Directory Reference

  • LowLatencyInput

LowLatencyInput Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/ Directory Reference

  • LowLatencyInput
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | App.xaml.cpp [code]
file | LowLatencyInputMain.cpp [code]
file | LowLatencyInputMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_LowLatencyInput.xaml.cpp [code]
file | Scenario1_LowLatencyInput.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/ Directory Reference

  • LowLatencyInput
  • cpp
  • Common

Common Directory Reference

Files

file | Constants.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Content/ Directory Reference

  • LowLatencyInput
  • cpp
  • Content

Content Directory Reference

Files

file | RectRenderer.cpp [code]
file | RectRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/ Directory Reference

  • MagneticStripeReader

MagneticStripeReader Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/ Directory Reference

  • MagneticStripeReader
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_BankCards.xaml.cpp [code]
file | Scenario1_BankCards.xaml.h [code]
file | Scenario2_AamvaCards.xaml.cpp [code]
file | Scenario2_AamvaCards.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/ Directory Reference

  • MagneticStripeReader
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_BankCards.xaml.cs [code]
file | Scenario2_AamvaCards.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/ Directory Reference

  • Magnetometer

Magnetometer Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/cs/ Directory Reference

  • Magnetometer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/ Directory Reference

  • MapControl

MapControl Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/ Directory Reference

  • MapControl
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario10.xaml.cpp [code]
file | Scenario10.xaml.h [code]
file | Scenario11.xaml.cpp [code]
file | Scenario11.xaml.h [code]
file | Scenario12.xaml.cpp [code]
file | Scenario12.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | Scenario5.xaml.cpp [code]
file | Scenario5.xaml.h [code]
file | Scenario6.xaml.cpp [code]
file | Scenario6.xaml.h [code]
file | Scenario7.xaml.cpp [code]
file | Scenario7.xaml.h [code]
file | Scenario8.xaml.cpp [code]
file | Scenario8.xaml.h [code]
file | Scenario9.xaml.cpp [code]
file | Scenario9.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/ Directory Reference

  • MapControl
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario10.xaml.cs [code]
file | Scenario11.xaml.cs [code]
file | Scenario12.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
file | Scenario5.xaml.cs [code]
file | Scenario6.xaml.cs [code]
file | Scenario7.xaml.cs [code]
file | Scenario8.xaml.cs [code]
file | Scenario9.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/ Directory Reference

  • MediaEditing

MediaEditing Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/ Directory Reference

  • MediaEditing
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_TrimAndSaveClip.xaml.cpp [code]
file | Scenario1_TrimAndSaveClip.xaml.h [code]
file | Scenario2_AppendClips.xaml.cpp [code]
file | Scenario2_AppendClips.xaml.h [code]
file | Scenario3_AddAudioTracks.xaml.cpp [code]
file | Scenario3_AddAudioTracks.xaml.h [code]
file | Scenario4_AddOverlays.xaml.cpp [code]
file | Scenario4_AddOverlays.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/ Directory Reference

  • MediaEditing
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_TrimAndSaveClip.xaml.cs [code]
file | Scenario2_AppendClips.xaml.cs [code]
file | Scenario3_AddAudioTracks.xaml.cs [code]
file | Scenario4_AddOverlays.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/ Directory Reference

  • MediaImport

MediaImport Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/ Directory Reference

  • MediaImport
  • cs

cs Directory Reference

Directories

directory | DataBinding

Files

file | App.xaml.cs [code]
file | ImportableItemWrapper.cs [code]
file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/DataBinding/ Directory Reference

  • MediaImport
  • cs
  • DataBinding

DataBinding Directory Reference

Files

file | GeneratorIncrementalLoadingClass.cs [code]
file | IncrementalLoadingBase.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/ Directory Reference

  • MediaTranscoding

MediaTranscoding Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/ Directory Reference

  • MediaTranscoding
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Default.xaml.cpp [code]
file | Scenario1_Default.xaml.h [code]
file | Scenario2_Custom.xaml.cpp [code]
file | Scenario2_Custom.xaml.h [code]
file | Scenario3_Trim.xaml.cpp [code]
file | Scenario3_Trim.xaml.h [code]
file | Scenario4_AddOverlays.xaml.cpp [code]
file | Scenario4_AddOverlays.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/ Directory Reference

  • MediaTranscoding
  • cs

cs Directory Reference

Files

file | MediaFoundationConstants.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Default.xaml.cs [code]
file | Scenario2_Custom.xaml.cs [code]
file | Scenario3_Trim.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/ Directory Reference

  • MessageDialog

MessageDialog Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/ Directory Reference

  • MessageDialog
  • cpp

cpp Directory Reference

Files

file | CancelCommand.xaml.cpp [code]
file | CancelCommand.xaml.h [code]
file | CompletedCallback.xaml.cpp [code]
file | CompletedCallback.xaml.h [code]
file | CustomCommand.xaml.cpp [code]
file | CustomCommand.xaml.h [code]
file | DefaultCloseCommand.xaml.cpp [code]
file | DefaultCloseCommand.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/ Directory Reference

  • MessageDialog
  • cs

cs Directory Reference

Files

file | CancelCommand.xaml.cs [code]
file | CompletedCallback.xaml.cs [code]
file | CustomCommand.xaml.cs [code]
file | DefaultCloseCommand.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/ Directory Reference

  • MicrosoftPassport

MicrosoftPassport Directory Reference

Directories

directory | cs
directory | Server
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/ Directory Reference

  • MicrosoftPassport
  • cs

cs Directory Reference

Files

file | AccountOverviewPage.xaml.cs [code]
file | EnableHelloPage.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | Util.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/ Directory Reference

  • MicrosoftPassport
  • Server

Server Directory Reference

Directories

directory | App_Start
directory | Controllers
directory | Data
directory | Models
directory | Properties

Files

file | Global.asax.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/ Directory Reference

  • MicrosoftPassport
  • Server
  • App_Start

App_Start Directory Reference

Files

file | FilterConfig.cs [code]
file | RouteConfig.cs [code]
file | WebApiConfig.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Controllers/ Directory Reference

  • MicrosoftPassport
  • Server
  • Controllers

Controllers Directory Reference

Files

file | AuthenticationController.cs [code]
file | HomeController.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Data/ Directory Reference

  • MicrosoftPassport
  • Server
  • Data

Data Directory Reference

Files

file DAL.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Models/ Directory Reference

  • MicrosoftPassport
  • Server
  • Models

Models Directory Reference

Files

file | Messages.cs [code]
file | SubjectPublicKeyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Properties/ Directory Reference

  • MicrosoftPassport
  • Server
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/ Directory Reference

  • MIDI

MIDI Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/ Directory Reference

  • MIDI
  • cs

cs Directory Reference

Files

file | MidiDeviceWatcher.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_MIDIDeviceEnumeration.xaml.cs [code]
file | Scenario2_ReceiveMIDIMessages.xaml.cs [code]
file | Scenario3_SendMIDIMessages.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/ Directory Reference

  • MixedRealityModel

MixedRealityModel Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/cs/ Directory Reference

  • MixedRealityModel
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_CreateTile.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/ Directory Reference

  • MobileBroadband

MobileBroadband Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ Directory Reference

  • MobileBroadband
  • cs

cs Directory Reference

Files

file | AccountWatcher.xaml.cs [code]
file | BroadbandDevice.xaml.cs [code]
file | GetConnectionProfiles.xaml.cs [code]
file | ModemDeviceServices.xaml.cs [code]
file | ModemInformation.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | ShowConnection.xaml.cs [code]
file | SimCard.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/ Directory Reference

  • MobileHotspot

MobileHotspot Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/ Directory Reference

  • MobileHotspot
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ConfigureMobileHotspot.cpp [code]
file | Scenario1_ConfigureMobileHotspot.h [code]
file | Scenario2_ToggleMobileHotspot.cpp [code]
file | Scenario2_ToggleMobileHotspot.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/ Directory Reference

  • MobileHotspot
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ConfigureMobileHotspot.xaml.cs [code]
file | Scenario2_ToggleMobileHotspot.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/ Directory Reference

  • MultipleViews

MultipleViews Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/ Directory Reference

  • MultipleViews
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
file | SecondaryViewPage.cpp [code]
file | SecondaryViewPage.h [code]
file | SizePreferenceString.h [code]
file | ViewLifetimeControl.cpp [code]
file | ViewLifetimeControl.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/ Directory Reference

  • MultipleViews
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | SecondaryViewPage.xaml.cs [code]
file | ViewLifetimeControl.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/ Directory Reference

  • NetworkConnectivity

NetworkConnectivity Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/ Directory Reference

  • NetworkConnectivity
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_NetworkConnectivity.cpp [code]
file | Scenario1_NetworkConnectivity.h [code]
file | Scenario2_NetworkCost.cpp [code]
file | Scenario2_NetworkCost.h [code]
file | Scenario3_NetworkConnectivityChanges.cpp [code]
file | Scenario3_NetworkConnectivityChanges.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/ Directory Reference

  • NetworkConnectivity
  • cs

cs Directory Reference

Files

file | Helpers.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_NetworkConnectivity.xaml.cs [code]
file | Scenario2_NetworkCost.xaml.cs [code]
file | Scenario3_NetworkConnectivityChanges.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/ Directory Reference

  • Nfc

Nfc Directory Reference

Directories

directory | Nfc
directory | NfcHceBackgroundTask
directory | PcscSdk
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/ Directory Reference

  • Nfc
  • Nfc

Nfc Directory Reference

Files

file | App.xaml.cs [code]
file | CardReader.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | ManageCard.xaml.cs [code]
file | NfcUtils.cs [code]
file | ReceiptView.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SetCardData.xaml.cs [code]
file | TlvEntry.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/ Directory Reference

  • Nfc
  • NfcHceBackgroundTask

NfcHceBackgroundTask Directory Reference

Files

file | BgTask.cpp [code]
file | BgTask.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Utilities.cpp [code]
file | Utilities.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/ Directory Reference

  • Nfc
  • PcscSdk

PcscSdk Directory Reference

Files

file | AtrParser.cs [code]
file | CommonDefs.cs [code]
file | DesfireAccessHandler.cs [code]
file | DesfireCommand.cs [code]
file | FelicaAccessHandler.cs [code]
file | FelicaCommands.cs [code]
file | IccDetection.cs [code]
file | Iso15693AccessHandler.cs [code]
file | Iso15693Commands.cs [code]
file | Iso7816.cs [code]
file | Iso7816Defs.cs [code]
file | MifareStandardAccessHandler.cs [code]
file | MifareStandardCommands.cs [code]
file | MifareUltralightAccessHandler.cs [code]
file | MifareUltralightCommands.cs [code]
file | Pcsc.cs [code]
file | PcscDefs.cs [code]
file | PcscUtils.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner/ Directory Reference

  • NfcProvisioner

NfcProvisioner Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner/cs/ Directory Reference

  • NfcProvisioner
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/ Directory Reference

  • Notifications

Notifications Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/ Directory Reference

  • Notifications
  • cs

cs Directory Reference

Directories

directory | BackgroundTasks
directory | Notifications
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/ Directory Reference

  • Notifications
  • cs
  • BackgroundTasks

BackgroundTasks Directory Reference

Directories

directory | Helpers
directory | Properties

Files

file | BadgeNotificationHistoryChangedTriggerTask.cs [code]
file | ToastActivationTypeBackgroundClosedTask.cs [code]
file | ToastNotificationHistoryChangedTriggerTask.cs [code]
file | ToastNotificationQuickReplyTask.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/ Directory Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers

Helpers Directory Reference

Files

file | BackgroundTaskStatus.cs [code]
file | BackgroundTaskStorage.cs [code]
file | BadgeHelper.cs [code]
file | Settings.cs [code]
file | ToastHelper.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Properties/ Directory Reference

  • Notifications
  • cs
  • BackgroundTasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ Directory Reference

  • Notifications
  • cs
  • Notifications

Notifications Directory Reference

Directories

directory | Controls
directory | Converters
directory | Helpers
directory | Model
directory | ScenarioPages

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | ScenarioPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • Controls

Controls Directory Reference

Files

file | InstructionControl.cs [code]
file | InstructionsControl.cs [code]
file | PopToastControl.xaml.cs [code]
file | StepsControl.cs [code]
file | StepsHelperControl.cs [code]
file | UpdateFourTilesControl.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Converters/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • Converters

Converters Directory Reference

Files

file | TypeToUIElementConverter.cs [code]
file | XmlDocumentToStringConverter.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • Helpers

Helpers Directory Reference

Files

file | BackButtonPage.cs [code]
file | BindableBase.cs [code]
file | StringHelper.cs [code]
file | TilesHelper.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • Model

Model Directory Reference

Files

file | IScenario.cs [code]
file | Scenario.cs [code]
file | ScenarioGroup.cs [code]
file | Scenarios.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages

ScenarioPages Directory Reference

Directories

directory | Badges
directory | LiveTiles
directory | Toasts
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges

Badges Directory Reference

Directories

directory Local
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local

Local Directory Reference

Directories

directory | PrimaryTile
directory | SecondaryTileBadges
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile

PrimaryTile Directory Reference

Directories

directory | ClearBadge
directory | SetBadgeGlyph
directory | SetBadgeNumber
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ClearBadge/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • ClearBadge

ClearBadge Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeGlyph/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeGlyph

SetBadgeGlyph Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/SetBadgeNumber/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • SetBadgeNumber

SetBadgeNumber Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/SecondaryTileBadges/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • SecondaryTileBadges

SecondaryTileBadges Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles

LiveTiles Directory Reference

Directories

directory | AdaptiveTemplates
directory | BasicState
directory | FindAllAsync
directory | Notifications
directory | Pinning
directory | UnpinEverything
directory | Updating
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates

AdaptiveTemplates Directory Reference

Directories

directory | Branding
directory | Custom
directory | HintPresentation
directory | Images
directory | TextStyles
directory | TextWrap
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding

Branding Directory Reference

Directories

directory | Default
directory | Logo
directory | Name
directory | NameAndLogo
directory | None
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Default/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Default

Default Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Logo/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Logo

Logo Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Name/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Name

Name Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/NameAndLogo/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • NameAndLogo

NameAndLogo Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/None/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • None

None Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Custom/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Custom

Custom Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation

HintPresentation Directory Reference

Directories

directory | Contact
directory | People
directory | Photos
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Contact/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Contact

Contact Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/People/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • People

People Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Photos/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Photos

Photos Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images

Images Directory Reference

Directories

directory Source
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source

Source Directory Reference

Directories

directory | FromAppData
directory | FromAppPackage
directory | FromInternet
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppData/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppData

FromAppData Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromAppPackage/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromAppPackage

FromAppPackage Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Images/Source/FromInternet/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Images
  • Source
  • FromInternet

FromInternet Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextStyles/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextStyles

TextStyles Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextWrap/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextWrap

TextWrap Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState

BasicState Directory Reference

Directories

directory | BackgroundColor
directory | CheckAllPropertiesCorrect
directory | Logos
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor

BackgroundColor Directory Reference

Directories

directory | Custom
directory | InheritFromPrimary
directory | Transparent
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Custom/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Custom

Custom Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/InheritFromPrimary/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • InheritFromPrimary

InheritFromPrimary Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Transparent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Transparent

Transparent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/CheckAllPropertiesCorrect/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • CheckAllPropertiesCorrect

CheckAllPropertiesCorrect Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos

Logos Directory Reference

Directories

directory Source
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source

Source Directory Reference

Directories

directory | AppData
directory | AppPackage
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppData/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppData

AppData Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppPackage/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppPackage

AppPackage Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/FindAllAsync/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync

FindAllAsync Directory Reference

Directories

directory Visualizer
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/FindAllAsync/Visualizer/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • FindAllAsync
  • Visualizer

Visualizer Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications

Notifications Directory Reference

Directories

directory | ExpiringNotification
directory | PrimaryTile
directory | SecondaryTiles
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ExpiringNotification/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • ExpiringNotification

ExpiringNotification Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile

PrimaryTile Directory Reference

Directories

directory | Clearing
directory | Sending
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Clearing/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Clearing

Clearing Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Sending/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Sending

Sending Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/SecondaryTiles/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • SecondaryTiles

SecondaryTiles Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Pinning/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Pinning

Pinning Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/UnpinEverything/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • UnpinEverything

UnpinEverything Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Updating/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Updating

Updating Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts

Toasts Directory Reference

Directories

directory | Actions
directory | ActivationTypes
directory | AdaptiveTemplates
directory | Audio
directory | ExpiringToast
directory | GhostToast
directory | HistoryChangedTrigger
directory | Scenarios
directory | ToastNotificationManagerHistory
directory | UpdateToast
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions

Actions Directory Reference

Directories

directory | Action
directory | InputText
directory | SystemCommands
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action

Action Directory Reference

Directories

directory | QuickReply
directory | Text
directory | TextAndImage
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/QuickReply/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • QuickReply

QuickReply Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/Text/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • Text

Text Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/TextAndImage/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • TextAndImage

TextAndImage Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText

InputText Directory Reference

Directories

directory | DefaultInput
directory | PlaceholderContent
directory | RetrievingArgs
directory | Title
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/DefaultInput/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • DefaultInput

DefaultInput Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/PlaceholderContent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • PlaceholderContent

PlaceholderContent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/RetrievingArgs/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • RetrievingArgs

RetrievingArgs Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/Title/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • Title

Title Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/SystemCommands/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands

SystemCommands Directory Reference

Directories

directory SnoozeAndDismiss
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/SystemCommands/SnoozeAndDismiss/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • SystemCommands
  • SnoozeAndDismiss

SnoozeAndDismiss Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes

ActivationTypes Directory Reference

Directories

directory | BackgroundWithAppClosed
directory | BackgroundWithAppOpen
directory | ForegroundWithAppClosed
directory | ForegroundWithAppOpen
directory | Protocol
directory | System
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppClosed/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppClosed

BackgroundWithAppClosed Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppOpen/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppOpen

BackgroundWithAppOpen Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppClosed/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppClosed

ForegroundWithAppClosed Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppOpen/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppOpen

ForegroundWithAppOpen Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/Protocol/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • Protocol

Protocol Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System

System Directory Reference

Directories

directory | Dismiss
directory | Snooze
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss

Dismiss Directory Reference

Directories

directory | AutoContent
directory | CustomContent
directory | Dismissing
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/AutoContent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • AutoContent

AutoContent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/CustomContent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • CustomContent

CustomContent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/Dismissing/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • Dismissing

Dismissing Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze

Snooze Directory Reference

Directories

directory | AutoContent
directory | CustomContent
directory | Snoozing
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/AutoContent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • AutoContent

AutoContent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/CustomContent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • CustomContent

CustomContent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/Snoozing/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • Snoozing

Snoozing Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates

AdaptiveTemplates Directory Reference

Directories

directory Image
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image

Image Directory Reference

Directories

directory Src
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src

Src Directory Reference

Directories

directory | FromAppData
directory | FromAppPackage
directory | FromInternet
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppData

FromAppData Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppPackage/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppPackage

FromAppPackage Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromInternet/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromInternet

FromInternet Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio

Audio Directory Reference

Directories

directory | Default
directory | EmailSound
directory | Looping
directory | Silent
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Default/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Default

Default Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/EmailSound/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • EmailSound

EmailSound Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Looping/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Looping

Looping Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/Silent/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • Silent

Silent Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ExpiringToast/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ExpiringToast

ExpiringToast Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/GhostToast/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • GhostToast

GhostToast Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger

HistoryChangedTrigger Directory Reference

Directories

directory | BadgeControl
directory | RespondingToToasts
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/BadgeControl/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • BadgeControl

BadgeControl Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/RespondingToToasts/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • RespondingToToasts

RespondingToToasts Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios

Scenarios Directory Reference

Directories

directory | Alarm
directory | Default
directory | IncomingCall
directory | Reminder
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Alarm/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Alarm

Alarm Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Default/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Default

Default Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/IncomingCall/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • IncomingCall

IncomingCall Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Reminder/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Reminder

Reminder Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory

ToastNotificationManagerHistory Directory Reference

Directories

directory | ClearAll
directory | GetHistory
directory | Remove
directory | RemoveGroup
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ClearAll/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • ClearAll

ClearAll Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/GetHistory/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory

GetHistory Directory Reference

Directories

directory Visualizer
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/GetHistory/Visualizer/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • GetHistory
  • Visualizer

Visualizer Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove

Remove Directory Reference

Directories

directory | ByTag
directory | ByTagAndGroup
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTag/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTag

ByTag Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTagAndGroup/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTagAndGroup

ByTagAndGroup Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup

RemoveGroup Directory Reference

Directories

directory ByGroup
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ByGroup/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
  • ByGroup

ByGroup Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/UpdateToast/ Directory Reference

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • UpdateToast

UpdateToast Directory Reference

Files

file ScenarioElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/ Directory Reference

  • NumberFormatting

NumberFormatting Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/ Directory Reference

  • NumberFormatting
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_PercentPermilleFormatting.xaml.cpp [code]
file | Scenario1_PercentPermilleFormatting.xaml.h [code]
file | Scenario2_DecimalFormatting.xaml.cpp [code]
file | Scenario2_DecimalFormatting.xaml.h [code]
file | Scenario3_CurrencyFormatting.xaml.cpp [code]
file | Scenario3_CurrencyFormatting.xaml.h [code]
file | Scenario4_NumberParsing.xaml.cpp [code]
file | Scenario4_NumberParsing.xaml.h [code]
file | Scenario5_RoundingAndPadding.xaml.cpp [code]
file | Scenario5_RoundingAndPadding.xaml.h [code]
file | Scenario6_NumeralSystemTranslation.xaml.cpp [code]
file | Scenario6_NumeralSystemTranslation.xaml.h [code]
file | Scenario7_UsingUnicodeExtensions.xaml.cpp [code]
file | Scenario7_UsingUnicodeExtensions.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/ Directory Reference

  • NumberFormatting
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_PercentPermilleFormatting.cpp [code]
file | Scenario1_PercentPermilleFormatting.h [code]
file | Scenario2_DecimalFormatting.cpp [code]
file | Scenario2_DecimalFormatting.h [code]
file | Scenario3_CurrencyFormatting.cpp [code]
file | Scenario3_CurrencyFormatting.h [code]
file | Scenario4_NumberParsing.cpp [code]
file | Scenario4_NumberParsing.h [code]
file | Scenario5_RoundingAndPadding.cpp [code]
file | Scenario5_RoundingAndPadding.h [code]
file | Scenario6_NumeralSystemTranslation.cpp [code]
file | Scenario6_NumeralSystemTranslation.h [code]
file | Scenario7_UsingUnicodeExtensions.cpp [code]
file | Scenario7_UsingUnicodeExtensions.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/ Directory Reference

  • NumberFormatting
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_PercentPermilleFormatting.xaml.cs [code]
file | Scenario2_DecimalFormatting.xaml.cs [code]
file | Scenario3_CurrencyFormatting.xaml.cs [code]
file | Scenario4_NumberParsing.xaml.cs [code]
file | Scenario5_RoundingAndPadding.xaml.cs [code]
file | Scenario6_NumeralSystemTranslation.xaml.cs [code]
file | Scenario7_UsingUnicodeExtensions.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/ Directory Reference

  • OCR

OCR Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/ Directory Reference

  • OCR
  • cpp

cpp Directory Reference

Files

file | OcrCapturedImage.xaml.cpp [code]
file | OcrCapturedImage.xaml.h [code]
file | OcrFileImage.xaml.cpp [code]
file | OcrFileImage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | WordOverlay.cpp [code]
file | WordOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/ Directory Reference

  • OCR
  • cppwinrt

cppwinrt Directory Reference

Files

file | OcrCapturedImage.cpp [code]
file | OcrCapturedImage.h [code]
file | OcrFileImage.cpp [code]
file | OcrFileImage.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | WordOverlay.cpp [code]
file | WordOverlay.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/ Directory Reference

  • OCR
  • cs

cs Directory Reference

Files

file | OcrCapturedImage.xaml.cs [code]
file | OcrFileImage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | WordOverlay.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/ Directory Reference

  • OnDemandHotspot

OnDemandHotspot Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/ Directory Reference

  • OnDemandHotspot
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | BackgroundTask

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ManageHotspot.cpp [code]
file | Scenario1_ManageHotspot.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/ Directory Reference

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask

BackgroundTask Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Tasks.cpp [code]
file | Tasks.h [code]
file | Tasks.idl [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/ Directory Reference

  • OnDemandHotspot
  • cs

cs Directory Reference

Directories

directory | BackgroundTask

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ManageHotspot.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/BackgroundTask/ Directory Reference

  • OnDemandHotspot
  • cs
  • BackgroundTask

BackgroundTask Directory Reference

Directories

directory | Properties

Files

file | Tasks.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/BackgroundTask/Properties/ Directory Reference

  • OnDemandHotspot
  • cs
  • BackgroundTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/ Directory Reference

  • OrientationSensor

OrientationSensor Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/ Directory Reference

  • OrientationSensor
  • cpp

cpp Directory Reference

Files

file | CalibrationBar.xaml.cpp [code]
file | CalibrationBar.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario0_Choose.xaml.cpp [code]
file | Scenario0_Choose.xaml.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
file | Scenario3_Calibration.xaml.cpp [code]
file | Scenario3_Calibration.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/ Directory Reference

  • OrientationSensor
  • cs

cs Directory Reference

Files

file | CalibrationBar.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario0_Choose.xaml.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_Calibration.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/ Directory Reference

  • Package

Package Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/ Directory Reference

  • Package
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | scenario1_identity.xaml.cpp [code]
file | scenario1_identity.xaml.h [code]
file | scenario2_installedlocation.xaml.cpp [code]
file | scenario2_installedlocation.xaml.h [code]
file | scenario3_dependencies.xaml.cpp [code]
file | scenario3_dependencies.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cs/ Directory Reference

  • Package
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | scenario1_identity.xaml.cs [code]
file | scenario2_installedlocation.xaml.cs [code]
file | scenario3_dependencies.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/ Directory Reference

  • PasswordVault

PasswordVault Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/ Directory Reference

  • PasswordVault
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Save.xaml.cpp [code]
file | Scenario1_Save.xaml.h [code]
file | Scenario2_Manage.xaml.cpp [code]
file | Scenario2_Manage.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/ Directory Reference

  • PasswordVault
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Save.cpp [code]
file | Scenario1_Save.h [code]
file | Scenario2_Manage.cpp [code]
file | Scenario2_Manage.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/ Directory Reference

  • PasswordVault
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Save.xaml.cs [code]
file | Scenario2_Manage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/ Directory Reference

  • PdfDocument

PdfDocument Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/ Directory Reference

  • PdfDocument
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Render.xaml.cpp [code]
file | Scenario1_Render.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/ Directory Reference

  • PdfDocument
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Render.cpp [code]
file | Scenario1_Render.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cs/ Directory Reference

  • PdfDocument
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Render.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/ Directory Reference

  • Pedometer

Pedometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/ Directory Reference

  • Pedometer
  • cpp

cpp Directory Reference

Directories

directory | Tasks

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Events.xaml.cpp [code]
file | Scenario1_Events.xaml.h [code]
file | Scenario2_History.xaml.cpp [code]
file | Scenario2_History.xaml.h [code]
file | Scenario3_CurrentStepCount.xaml.cpp [code]
file | Scenario3_CurrentStepCount.xaml.h [code]
file | Scenario4_BackgroundTask.xaml.cpp [code]
file | Scenario4_BackgroundTask.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/ Directory Reference

  • Pedometer
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | PedometerBackgroundTask.cpp [code]
file | PedometerBackgroundTask.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/ Directory Reference

  • Pedometer
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Events.xaml.cs [code]
file | Scenario2_History.xaml.cs [code]
file | Scenario3_CurrentStepCount.xaml.cs [code]
file | Scenario4_BackgroundTask.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/ Directory Reference

  • Pedometer
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | PedometerBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/Properties/ Directory Reference

  • Pedometer
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/ Directory Reference

  • PenHaptics

PenHaptics Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/ Directory Reference

  • PenHaptics
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_InkCanvasTactileFeedback.cpp [code]
file | Scenario1_InkCanvasTactileFeedback.h [code]
file | Scenario2_SupportedTactileFeedback.cpp [code]
file | Scenario2_SupportedTactileFeedback.h [code]
file | Scenario3_InkingFeedback.cpp [code]
file | Scenario3_InkingFeedback.h [code]
file | Scenario4_InteractionFeedback.cpp [code]
file | Scenario4_InteractionFeedback.h [code]
file | Scenario5_InkingAndInteractionFeedback.cpp [code]
file | Scenario5_InkingAndInteractionFeedback.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/ Directory Reference

  • PenHaptics
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_InkCanvasTactileFeedback.xaml.cs [code]
file | Scenario2_SupportedTactileFeedback.xaml.cs [code]
file | Scenario3_InkingFeedback.xaml.cs [code]
file | Scenario4_InteractionFeedback.xaml.cs [code]
file | Scenario5_InkingAndInteractionFeedback.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/ Directory Reference

  • PersonalDataEncryption

PersonalDataEncryption Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/ Directory Reference

  • PersonalDataEncryption
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Files.cpp [code]
file | Scenario1_Files.h [code]
file | Scenario2_Memory.cpp [code]
file | Scenario2_Memory.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cs/ Directory Reference

  • PersonalDataEncryption
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Files.xaml.cs [code]
file | Scenario2_Memory.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/ Directory Reference

  • Personalization

Personalization Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/ Directory Reference

  • Personalization
  • cpp

cpp Directory Reference

Files

file | AddImageFeedScenario.xaml.cpp [code]
file | AddImageFeedScenario.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | SetLockScreenImage.xaml.cpp [code]
file | SetLockScreenImage.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cs/ Directory Reference

  • Personalization
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | SetLockScreenImage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/ Directory Reference

  • Playlists

Playlists Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/ Directory Reference

  • Playlists
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Create.xaml.cpp [code]
file | Scenario1_Create.xaml.h [code]
file | Scenario2_Display.xaml.cpp [code]
file | Scenario2_Display.xaml.h [code]
file | Scenario3_Add.xaml.cpp [code]
file | Scenario3_Add.xaml.h [code]
file | Scenario4_Remove.xaml.cpp [code]
file | Scenario4_Remove.xaml.h [code]
file | Scenario5_Clear.xaml.cpp [code]
file | Scenario5_Clear.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/ Directory Reference

  • Playlists
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Create.xaml.cs [code]
file | Scenario2_Display.xaml.cs [code]
file | Scenario3_Add.xaml.cs [code]
file | Scenario4_Remove.xaml.cs [code]
file | Scenario5_Clear.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/ Directory Reference

  • PlayReady

PlayReady Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ Directory Reference

  • PlayReady
  • cs

cs Directory Reference

Directories

directory | Controls
directory | Shared
directory | ViewModels

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ReactiveRequest.xaml.cs [code]
file | Scenario2_ProactiveRequest.xaml.cs [code]
file | Scenario3_HardwareDRM.xaml.cs [code]
file | Scenario4_SecureStop.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Controls/ Directory Reference

  • PlayReady
  • cs
  • Controls

Controls Directory Reference

Files

file PlayReadyInfo.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Shared/ Directory Reference

  • PlayReady
  • cs
  • Shared

Shared Directory Reference

Files

file | PlayReadyHelpers.cs [code]
file | RelayCommand.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ Directory Reference

  • PlayReady
  • cs
  • ViewModels

ViewModels Directory Reference

Files

file | HardwareDRMViewModel.cs [code]
file | PlayReadyInfoViewModel.cs [code]
file | ProactiveViewModel.cs [code]
file | ReactiveViewModel.cs [code]
file | SecureStopViewModel.cs [code]
file | ViewModelBase.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/ Directory Reference

  • PosPrinter

PosPrinter Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/ Directory Reference

  • PosPrinter
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_FindClaimEnable.xaml.cpp [code]
file | Scenario1_FindClaimEnable.xaml.h [code]
file | Scenario1_ReceiptPrinter.xaml.cpp [code]
file | Scenario1_ReceiptPrinter.xaml.h [code]
file | Scenario2_PrintReceipt.xaml.cpp [code]
file | Scenario2_PrintReceipt.xaml.h [code]
file | Scenario3_MultipleClaims.xaml.cpp [code]
file | Scenario3_MultipleClaims.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/ Directory Reference

  • PosPrinter
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_FindClaimEnable.xaml.cs [code]
file | Scenario2_PrintReceipt.xaml.cs [code]
file | Scenario3_MultipleClaims.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/ Directory Reference

  • PresenceSensor

PresenceSensor Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/ Directory Reference

  • PresenceSensor
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.cpp [code]
file | Scenario1_DataEvents.h [code]
file | Scenario2_Polling.cpp [code]
file | Scenario2_Polling.h [code]
file | Scenario3_Choosing.cpp [code]
file | Scenario3_Choosing.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/ Directory Reference

  • PresenceSensor
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_Choosing.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/ Directory Reference

  • Printing

Printing Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/ Directory Reference

  • Printing
  • cpp

cpp Directory Reference

Files

file | ContinuationPage.xaml.cpp [code]
file | ContinuationPage.xaml.h [code]
file | PageToPrint.xaml.cpp [code]
file | PageToPrint.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PreviewUnavailable.xaml.cpp [code]
file | PreviewUnavailable.xaml.h [code]
file | PrintHelper.cpp [code]
file | PrintHelper.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1Basic.xaml.cpp [code]
file | Scenario1Basic.xaml.h [code]
file | Scenario2StandardOptions.xaml.cpp [code]
file | Scenario2StandardOptions.xaml.h [code]
file | Scenario3CustomOptions.xaml.cpp [code]
file | Scenario3CustomOptions.xaml.h [code]
file | Scenario4PageRange.xaml.cpp [code]
file | Scenario4PageRange.xaml.h [code]
file | Scenario5Photos.xaml.cpp [code]
file | Scenario5Photos.xaml.h [code]
file | Scenario6DisablePreview.xaml.cpp [code]
file | Scenario6DisablePreview.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/ Directory Reference

  • Printing
  • cs

cs Directory Reference

Files

file | ContinuationPage.xaml.cs [code]
file | PageToPrint.xaml.cs [code]
file | PreviewUnavailable.xaml.cs [code]
file | PrintHelper.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1Basic.xaml.cs [code]
file | Scenario2StandardOptons.xaml.cs [code]
file | Scenario3CustomOptions.xaml.cs [code]
file | Scenario4PageRange.xaml.cs [code]
file | Scenario5Photos.xaml.cs [code]
file | Scenario6DisablePreview.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/ Directory Reference

  • Projection

Projection Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ Directory Reference

  • Projection
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | ProjectionViewPage.xaml.cpp [code]
file | ProjectionViewPage.xaml.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | ViewLifetimeControl.cpp [code]
file | ViewLifetimeControl.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/ Directory Reference

  • Projection
  • cs

cs Directory Reference

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | ProjectionViewPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | ViewLifetimeControl.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/ Directory Reference

  • ProximitySensor

ProximitySensor Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/ Directory Reference

  • ProximitySensor
  • cpp

cpp Directory Reference

Directories

directory | Tasks

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
file | Scenario3_DisplayOnOff.xaml.cpp [code]
file | Scenario3_DisplayOnOff.xaml.h [code]
file | Scenario4_BackgroundProximitySensor.xaml.cpp [code]
file | Scenario4_BackgroundProximitySensor.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/ Directory Reference

  • ProximitySensor
  • cpp
  • Tasks

Tasks Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | ProximitySensorBackgroundTask.cpp [code]
file | ProximitySensorBackgroundTask.h [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/ Directory Reference

  • ProximitySensor
  • cs

cs Directory Reference

Directories

directory | Tasks

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
file | Scenario3_DisplayOnOff.xaml.cs [code]
file | Scenario4_BackgroundProximitySensor.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Tasks/ Directory Reference

  • ProximitySensor
  • cs
  • Tasks

Tasks Directory Reference

Directories

directory | Properties

Files

file | ProximitySensorBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Tasks/Properties/ Directory Reference

  • ProximitySensor
  • cs
  • Tasks
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/ Directory Reference

  • ProxyStubsForWinRTComponents

ProxyStubsForWinRTComponents Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cpp

cpp Directory Reference

Directories

directory | cpp
directory | cs
directory | Server
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OvenClient.xaml.cpp [code]
file | Scenario1_OvenClient.xaml.h [code]
file | Scenario2_OvenClientWRL.xaml.cpp [code]
file | Scenario2_OvenClientWRL.xaml.h [code]
file | Scenario3_CustomException.xaml.cpp [code]
file | Scenario3_CustomException.xaml.h [code]
file | Scenario4_CustomExceptionWRL.xaml.cpp [code]
file | Scenario4_CustomExceptionWRL.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_OvenClient.xaml.cs [code]
file | Scenario2_CustomException.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

Server Directory Reference

Files

file | BreadServer.cpp [code]
file | BreadServer.h [code]
file | BreadTypes.h [code]
file | OvenServer.cpp [code]
file | OvenServer.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cs

cs Directory Reference

Directories

directory | cpp
directory | cs
directory | Server
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OvenClient.xaml.cpp [code]
file | Scenario1_OvenClient.xaml.h [code]
file | Scenario2_OvenClientWRL.xaml.cpp [code]
file | Scenario2_OvenClientWRL.xaml.h [code]
file | Scenario3_CustomException.xaml.cpp [code]
file | Scenario3_CustomException.xaml.h [code]
file | Scenario4_CustomExceptionWRL.xaml.cpp [code]
file | Scenario4_CustomExceptionWRL.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cs
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_OvenClient.xaml.cs [code]
file | Scenario2_CustomException.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cs
  • Server

Server Directory Reference

Directories

directory | Properties

Files

file | BreadServer.cs [code]
file | OvenServer.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/Properties/ Directory Reference

  • ProxyStubsForWinRTComponents
  • cs
  • Server
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/ Directory Reference

  • RadialController

RadialController Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/ Directory Reference

  • RadialController
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_EventAndMenuHookup.xaml.cpp [code]
file | Scenario1_EventAndMenuHookup.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/ Directory Reference

  • RadialController
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_EventAndMenuHookup.xaml.cs [code]
file | Scenario2_SystemDefaultMenu.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/ Directory Reference

  • RadioManager

RadioManager Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/ Directory Reference

  • RadioManager
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | RadioModel.cpp [code]
file | RadioModel.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Toggle.cpp [code]
file | Scenario1_Toggle.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/ Directory Reference

  • RadioManager
  • cs

cs Directory Reference

Files

file | RadioModel.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Toggle.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/ Directory Reference

  • RelativeInclinometer

RelativeInclinometer Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/ Directory Reference

  • RelativeInclinometer
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/ Directory Reference

  • RelativeInclinometer
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/ Directory Reference

  • RemoteSystems

RemoteSystems Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/ Directory Reference

  • RemoteSystems
  • cs

cs Directory Reference

Files

file | BooleanToVisibilityConverter.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Discovery.xaml.cs [code]
file | Scenario2_LaunchUri.xaml.cs [code]
file | Scenario3_LaunchAppServices.xaml.cs [code]
file | Scenario4_Settings.xaml.cs [code]
file | Scenario5_Capabilities.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/ Directory Reference

  • ResizeAppView

ResizeAppView Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/ Directory Reference

  • ResizeAppView
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.xaml.cpp [code]
file | Scenario1_Basic.xaml.h [code]
file | Scenario2_Launch.xaml.cpp [code]
file | Scenario2_Launch.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/ Directory Reference

  • ResizeAppView
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.cpp [code]
file | Scenario1_Basic.h [code]
file | Scenario2_Launch.cpp [code]
file | Scenario2_Launch.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/ Directory Reference

  • ResizeAppView
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basic.xaml.cs [code]
file | Scenario2_Launch.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/ Directory Reference

  • SecondaryTiles

SecondaryTiles Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/ Directory Reference

  • SecondaryTiles
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_PinTile.cpp [code]
file | Scenario1_PinTile.h [code]
file | Scenario2_UnpinTile.cpp [code]
file | Scenario2_UnpinTile.h [code]
file | Scenario3_EnumerateTiles.cpp [code]
file | Scenario3_EnumerateTiles.h [code]
file | Scenario4_TilePinned.cpp [code]
file | Scenario4_TilePinned.h [code]
file | Scenario5_LaunchedFromSecondaryTile.cpp [code]
file | Scenario5_LaunchedFromSecondaryTile.h [code]
file | Scenario6_SecondaryTileNotification.cpp [code]
file | Scenario6_SecondaryTileNotification.h [code]
file | Scenario7_PinFromAppbar.cpp [code]
file | Scenario7_PinFromAppbar.h [code]
file | Scenario8_UpdateAsync.cpp [code]
file | Scenario8_UpdateAsync.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/ Directory Reference

  • SecondaryTiles
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_PinTile.xaml.cs [code]
file | Scenario2_UnpinTile.xaml.cs [code]
file | Scenario3_EnumerateTiles.xaml.cs [code]
file | Scenario4_TilePinned.xaml.cs [code]
file | Scenario5_LaunchedFromSecondaryTile.xaml.cs [code]
file | Scenario6_SecondaryTileNotification.xaml.cs [code]
file | Scenario7_PinFromAppbar.xaml.cs [code]
file | Scenario8_UpdateAsync.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/ Directory Reference

  • SemanticTextQuery

SemanticTextQuery Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/ Directory Reference

  • SemanticTextQuery
  • cpp

cpp Directory Reference

Files

file | Find.xaml.cpp [code]
file | Find.xaml.h [code]
file | FindInProperty.xaml.cpp [code]
file | FindInProperty.xaml.h [code]
file | GetMatchingPropertiesWithRanges.xaml.cpp [code]
file | GetMatchingPropertiesWithRanges.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/ Directory Reference

  • SemanticTextQuery
  • cs

cs Directory Reference

Files

file | Find.xaml.cs [code]
file | FindInProperty.xaml.cs [code]
file | GetMatchingPropertiesWithRanges.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/ Directory Reference

  • SerialArduino

SerialArduino Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/ Directory Reference

  • SerialArduino
  • cs

cs Directory Reference

Files

file | Constants.cs [code]
file | DeviceListEntry.cs [code]
file | EventHandlerForDevice.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_ConnectDisconnect.xaml.cs [code]
file | Scenario2_LEDTemp.xaml.cs [code]
file | Utilities.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/ Directory Reference

  • ShareSource

ShareSource Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ Directory Reference

  • ShareSource
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | SetErrorMessage.xaml.cpp [code]
file | SetErrorMessage.xaml.h [code]
file | ShareApplicationLink.xaml.cpp [code]
file | ShareApplicationLink.xaml.h [code]
file | ShareCustomData.xaml.cpp [code]
file | ShareCustomData.xaml.h [code]
file | ShareCustomProvider.xaml.cpp [code]
file | ShareCustomProvider.xaml.h [code]
file | ShareDelayRenderedFiles.xaml.cpp [code]
file | ShareDelayRenderedFiles.xaml.h [code]
file | ShareFiles.xaml.cpp [code]
file | ShareFiles.xaml.h [code]
file | ShareHtml.xaml.cpp [code]
file | ShareHtml.xaml.h [code]
file | ShareImage.xaml.cpp [code]
file | ShareImage.xaml.h [code]
file | SharePage.cpp [code]
file | SharePage.h [code]
file | ShareText.xaml.cpp [code]
file | ShareText.xaml.h [code]
file | ShareWebLink.xaml.cpp [code]
file | ShareWebLink.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ Directory Reference

  • ShareSource
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | SetErrorMessage.xaml.cs [code]
file | ShareApplicationLink.xaml.cs [code]
file | ShareCustomData.xaml.cs [code]
file | ShareCustomProvider.xaml.cs [code]
file | ShareDelayRenderedFiles.xaml.cs [code]
file | ShareFiles.xaml.cs [code]
file | ShareHtml.xaml.cs [code]
file | ShareImage.xaml.cs [code]
file | SharePage.cs [code]
file | ShareText.xaml.cs [code]
file | ShareWebLink.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/ Directory Reference

  • ShareTarget

ShareTarget Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/cs/ Directory Reference

  • ShareTarget
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Welcome.xaml.cs [code]
file | ShareTarget.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/ Directory Reference

  • Simple3DGameDX

Simple3DGameDX Directory Reference

Directories

directory | cpp
directory | cppwinrt
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/ Directory Reference

  • Simple3DGameDX
  • cpp

cpp Directory Reference

Directories

directory | Common

Files

file | App.cpp [code]
file | App.h [code]
file | GameHud.cpp [code]
file | GameHud.h [code]
file | GameInfoOverlay.cpp [code]
file | GameInfoOverlay.h [code]
file | GameMain.cpp [code]
file | GameMain.h [code]
file | GameRenderer.cpp [code]
file | GameRenderer.h [code]
file | GameUIConstants.h [code]
file | GameUIControl.h [code]
file | Simple3DGame.cpp [code]
file | Simple3DGame.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/ Directory Reference

  • Simple3DGameDX
  • cpp
  • Common

Common Directory Reference

Files

file | BasicLoader.cpp [code]
file | BasicLoader.h [code]
file | BasicMath.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | BasicShapes.h [code]
file | DDSTextureLoader.cpp [code]
file | DDSTextureLoader.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXSample.h [code]
file | PersistentState.cpp [code]
file | PersistentState.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/ Directory Reference

  • Simple3DGameDX
  • cppwinrt

cppwinrt Directory Reference

Directories

directory | Common
directory | GameContent

Files

file | App.cpp [code]
file | GameHud.cpp [code]
file | GameHud.h [code]
file | GameInfoOverlay.cpp [code]
file | GameInfoOverlay.h [code]
file | GameMain.cpp [code]
file | GameMain.h [code]
file | GameRenderer.cpp [code]
file | GameRenderer.h [code]
file | GameUIConstants.h [code]
file | GameUIControl.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Simple3DGame.cpp [code]
file | Simple3DGame.h [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/ Directory Reference

  • Simple3DGameDX
  • cppwinrt
  • Common

Common Directory Reference

Files

file | BasicLoader.cpp [code]
file | BasicLoader.h [code]
file | BasicMath.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | BasicShapes.h [code]
file | DDSTextureLoader.cpp [code]
file | DDSTextureLoader.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXSample.h [code]
file | PersistentState.cpp [code]
file | PersistentState.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/ Directory Reference

  • Simple3DGameDX
  • cppwinrt
  • GameContent

GameContent Directory Reference

Files

file | Animate.cpp [code]
file | Animate.h [code]
file | Audio.cpp [code]
file | Audio.h [code]
file | Camera.cpp [code]
file | Camera.h [code]
file | ConstantBuffers.h [code]
file | Cylinder.cpp [code]
file | Cylinder.h [code]
file | CylinderMesh.cpp [code]
file | CylinderMesh.h [code]
file | Face.cpp [code]
file | Face.h [code]
file | FaceMesh.cpp [code]
file | FaceMesh.h [code]
file | GameConstants.h [code]
file | GameObject.cpp [code]
file | GameObject.h [code]
file | GameTimer.cpp [code]
file | GameTimer.h [code]
file | Level.cpp [code]
file | Level.h [code]
file | Level1.cpp [code]
file | Level1.h [code]
file | Level2.cpp [code]
file | Level2.h [code]
file | Level3.cpp [code]
file | Level3.h [code]
file | Level4.cpp [code]
file | Level4.h [code]
file | Level5.cpp [code]
file | Level5.h [code]
file | Level6.cpp [code]
file | Level6.h [code]
file | Material.cpp [code]
file | Material.h [code]
file | MediaReader.cpp [code]
file | MediaReader.h [code]
file | MeshObject.cpp [code]
file | MeshObject.h [code]
file | MoveLookController.cpp [code]
file | MoveLookController.h [code]
file | SoundEffect.cpp [code]
file | SoundEffect.h [code]
file | Sphere.cpp [code]
file | Sphere.h [code]
file | SphereMesh.cpp [code]
file | SphereMesh.h [code]
file | StereoProjection.cpp [code]
file | StereoProjection.h [code]
file | TargetTexture.cpp [code]
file | TargetTexture.h [code]
file | WorldMesh.cpp [code]
file | WorldMesh.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/ Directory Reference

  • Simple3DGameXaml

Simple3DGameXaml Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/ Directory Reference

  • Simple3DGameXaml
  • cpp

cpp Directory Reference

Directories

directory | Common

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | DirectXPage.xaml.cpp [code]
file | DirectXPage.xaml.h [code]
file | GameHud.cpp [code]
file | GameHud.h [code]
file | GameMain.cpp [code]
file | GameMain.h [code]
file | GameRenderer.cpp [code]
file | GameRenderer.h [code]
file | GameUIConstants.h [code]
file | GameUIControl.h [code]
file | ProductItem.cpp [code]
file | ProductItem.h [code]
file | Simple3DGame.cpp [code]
file | Simple3DGame.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/ Directory Reference

  • Simple3DGameXaml
  • cpp
  • Common

Common Directory Reference

Files

file | BasicLoader.cpp [code]
file | BasicLoader.h [code]
file | BasicMath.h [code]
file | BasicReaderWriter.cpp [code]
file | BasicReaderWriter.h [code]
file | BasicShapes.h [code]
file | DDSTextureLoader.cpp [code]
file | DDSTextureLoader.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXSample.h [code]
file | PersistentState.cpp [code]
file | PersistentState.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/ Directory Reference

  • SimpleCommunication

SimpleCommunication Directory Reference

Directories

directory | common
directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/ Directory Reference

  • SimpleCommunication
  • common

common Directory Reference

Directories

directory MediaExtensions
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/ Directory Reference

  • SimpleCommunication
  • common
  • MediaExtensions

MediaExtensions Directory Reference

Directories

directory Microsoft.Samples.SimpleCommunication
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/ Directory Reference

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

Microsoft.Samples.SimpleCommunication Directory Reference

Files

file | AsyncCB.h [code]
file | BaseAttributes.h [code]
file | BufferPacket.cpp [code]
file | BufferPacket.h [code]
file | CritSec.h [code]
file | LinkList.h [code]
file | Marker.cpp [code]
file | Marker.h [code]
file | MediaBufferWrapper.cpp [code]
file | MediaBufferWrapper.h [code]
file | NetworkChannel.cpp [code]
file | NetworkChannel.h [code]
file | NetworkClient.cpp [code]
file | NetworkClient.h [code]
file | NetworkServer.cpp [code]
file | NetworkServer.h [code]
file | OpQueue.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | StspDefs.h [code]
file | StspMediaSink.cpp [code]
file | StspMediaSink.h [code]
file | StspMediaSinkProxy.cpp [code]
file | StspMediaSinkProxy.h [code]
file | StspMediaSource.cpp [code]
file | StspMediaSource.h [code]
file | StspMediaStream.cpp [code]
file | StspMediaStream.h [code]
file | StspNetwork.h [code]
file | StspSchemeHandler.cpp [code]
file | StspSchemeHandler.h [code]
file | StspStreamSink.cpp [code]
file | StspStreamSink.h [code]
file | Trace.cpp [code]
file | Trace.h [code]
file | Validation.cpp [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/ Directory Reference

  • SimpleCommunication
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_LowLatency.xaml.cpp [code]
file | Scenario1_LowLatency.xaml.h [code]
file | Scenario2_VideoChat.xaml.cpp [code]
file | Scenario2_VideoChat.xaml.h [code]
file | Utils.cpp [code]
file | Utils.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/ Directory Reference

  • SimpleCommunication
  • cs

cs Directory Reference

Files

file | CaptureDevice.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_LowLatency.xaml.cs [code]
file | Scenario2_VideoChat.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/ Directory Reference

  • SimpleImaging

SimpleImaging Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/ Directory Reference

  • SimpleImaging
  • cs

cs Directory Reference

Files

file | Helpers.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/ Directory Reference

  • SimpleInk

SimpleInk Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/ Directory Reference

  • SimpleInk
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | RecognizerHelper.cpp [code]
file | RecognizerHelper.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario10.xaml.cpp [code]
file | Scenario10.xaml.h [code]
file | Scenario11.xaml.cpp [code]
file | Scenario11.xaml.h [code]
file | Scenario12.xaml.cpp [code]
file | Scenario12.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | Scenario5.xaml.cpp [code]
file | Scenario5.xaml.h [code]
file | Scenario6.xaml.cpp [code]
file | Scenario6.xaml.h [code]
file | Scenario7.xaml.cpp [code]
file | Scenario7.xaml.h [code]
file | Scenario8.xaml.cpp [code]
file | Scenario8.xaml.h [code]
file | Scenario9.xaml.cpp [code]
file | Scenario9.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/ Directory Reference

  • SimpleInk
  • cs

cs Directory Reference

Files

file | RecognizerHelper.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario10.xaml.cs [code]
file | Scenario11.xaml.cs [code]
file | Scenario12.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
file | Scenario5.xaml.cs [code]
file | Scenario6.xaml.cs [code]
file | Scenario7.xaml.cs [code]
file | Scenario8.xaml.cs [code]
file | Scenario9.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/ Directory Reference

  • SimpleOrientationSensor

SimpleOrientationSensor Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/ Directory Reference

  • SimpleOrientationSensor
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DataEvents.xaml.cpp [code]
file | Scenario1_DataEvents.xaml.h [code]
file | Scenario2_Polling.xaml.cpp [code]
file | Scenario2_Polling.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cs/ Directory Reference

  • SimpleOrientationSensor
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_DataEvents.xaml.cs [code]
file | Scenario2_Polling.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/ Directory Reference

  • SmartCard

SmartCard Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/ Directory Reference

  • SmartCard
  • cpp

cpp Directory Reference

Files

file | ChallengeResponseAlgorithm.cpp [code]
file | ChallengeResponseAlgorithm.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CreateTPMVSC.xaml.cpp [code]
file | Scenario1_CreateTPMVSC.xaml.h [code]
file | Scenario2_ChangePin.xaml.cpp [code]
file | Scenario2_ChangePin.xaml.h [code]
file | Scenario3_ResetPin.xaml.cpp [code]
file | Scenario3_ResetPin.xaml.h [code]
file | Scenario4_ChangeAdminKey.xaml.cpp [code]
file | Scenario4_ChangeAdminKey.xaml.h [code]
file | Scenario5_VerifyResponse.xaml.cpp [code]
file | Scenario5_VerifyResponse.xaml.h [code]
file | Scenario6_DeleteTPMVSC.xaml.cpp [code]
file | Scenario6_DeleteTPMVSC.xaml.h [code]
file | Scenario7_ListSmartCards.xaml.cpp [code]
file | Scenario7_ListSmartCards.xaml.h [code]
file | Scenario8_Transmit.xaml.cpp [code]
file | Scenario8_Transmit.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/ Directory Reference

  • SmartCard
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ProvisionTPM.cpp [code]
file | Scenario1_ProvisionTPM.h [code]
file | Scenario2_ChangePIN.cpp [code]
file | Scenario2_ChangePIN.h [code]
file | Scenario3_ResetPIN.cpp [code]
file | Scenario3_ResetPIN.h [code]
file | Scenario4_ChangeAdminKey.cpp [code]
file | Scenario4_ChangeAdminKey.h [code]
file | Scenario5_VerifyResponse.cpp [code]
file | Scenario5_VerifyResponse.h [code]
file | Scenario6_DeleteTPM.cpp [code]
file | Scenario6_DeleteTPM.h [code]
file | Scenario7_ListAllCards.cpp [code]
file | Scenario7_ListAllCards.h [code]
file | Scenario8_TransmitAPDU.cpp [code]
file | Scenario8_TransmitAPDU.h [code]
file | SmartCardHelpers.cpp [code]
file | SmartCardHelpers.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/ Directory Reference

  • SmartCard
  • cs

cs Directory Reference

Files

file | ChallengeResponseAlgorithm.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_ProvisionTPM.xaml.cs [code]
file | Scenario2_ChangePIN.xaml.cs [code]
file | Scenario3_ResetPIN.xaml.cs [code]
file | Scenario4_ChangeAdminKey.xaml.cs [code]
file | Scenario5_VerifyResponse.xaml.cs [code]
file | Scenario6_DeleteTPM.xaml.cs [code]
file | Scenario7_ListAllCards.xaml.cs [code]
file | Scenario8_TransmitAPDU.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/ Directory Reference

  • SmsSendAndReceive

SmsSendAndReceive Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/ Directory Reference

  • SmsSendAndReceive
  • cs

cs Directory Reference

Directories

directory | SmsBackgroundTask
directory | SmsSendAndReceive
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsBackgroundTask/ Directory Reference

  • SmsSendAndReceive
  • cs
  • SmsBackgroundTask

SmsBackgroundTask Directory Reference

Directories

directory | Properties

Files

file | SmsBackgroundTask.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsBackgroundTask/Properties/ Directory Reference

  • SmsSendAndReceive
  • cs
  • SmsBackgroundTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsSendAndReceive/ Directory Reference

  • SmsSendAndReceive
  • cs
  • SmsSendAndReceive

SmsSendAndReceive Directory Reference

Files

file | RegisterWithBackgroundTask.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SendTextMessage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/ Directory Reference

  • SocketActivityStreamSocket

SocketActivityStreamSocket Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/ Directory Reference

  • SocketActivityStreamSocket
  • cs

cs Directory Reference

Directories

directory | Server
directory | SocketActivityBackgroundTask
directory | SocketActivityStreamSocket
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/Server/ Directory Reference

  • SocketActivityStreamSocket
  • cs
  • Server

Server Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Send.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/ Directory Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityBackgroundTask

SocketActivityBackgroundTask Directory Reference

Directories

directory | Properties

Files

file | SocketActivityTask.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/Properties/ Directory Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityBackgroundTask
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityStreamSocket/ Directory Reference

  • SocketActivityStreamSocket
  • cs
  • SocketActivityStreamSocket

SocketActivityStreamSocket Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Connect.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/ Directory Reference

  • SpatialInteractionSource

SpatialInteractionSource Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/ Directory Reference

  • SpatialInteractionSource
  • cpp

cpp Directory Reference

Directories

directory | Common
directory | Content

Files

file | AppView.cpp [code]
file | AppView.h [code]
file | DPadHelper.cpp [code]
file | DPadHelper.h [code]
file | HandHandler.cpp [code]
file | HandHandler.h [code]
file | HolographicPaintMain.cpp [code]
file | HolographicPaintMain.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SourceHandler.cpp [code]
file | SourceHandler.h [code]
file | SpatialControllerHandler.cpp [code]
file | SpatialControllerHandler.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/ Directory Reference

  • SpatialInteractionSource
  • cpp
  • Common

Common Directory Reference

Files

file | CameraResources.cpp [code]
file | CameraResources.h [code]
file | DeviceResources.cpp [code]
file | DeviceResources.h [code]
file | DirectXHelper.h [code]
file | StepTimer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/ Directory Reference

  • SpatialInteractionSource
  • cpp
  • Content

Content Directory Reference

Files

file | RenderingHelper.cpp [code]
file | RenderingHelper.h [code]
file | RenderingInterfaces.h [code]
file | ShaderStructures.h [code]
file | Stroke.cpp [code]
file | Stroke.h [code]
file | Tool.cpp [code]
file | Tool.h [code]
file | ToolCarousel.cpp [code]
file | ToolCarousel.h [code]
file | Whiteboard.cpp [code]
file | Whiteboard.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/ Directory Reference

  • SpatialSound

SpatialSound Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/ Directory Reference

  • SpatialSound
  • cpp

cpp Directory Reference

Files

file | AudioFileReader.cpp [code]
file | AudioFileReader.h [code]
file | CardioidSound.cpp [code]
file | CardioidSound.h [code]
file | CustomDecay.cpp [code]
file | CustomDecay.h [code]
file | OmnidirectionalSound.cpp [code]
file | OmnidirectionalSound.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Resource.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OmnidirectionalSound.xaml.cpp [code]
file | Scenario1_OmnidirectionalSound.xaml.h [code]
file | Scenario2_CardioidSound.xaml.cpp [code]
file | Scenario2_CardioidSound.xaml.h [code]
file | Scenario3_CustomDecay.xaml.cpp [code]
file | Scenario3_CustomDecay.xaml.h [code]
file | XAudio2Helpers.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/ Directory Reference

  • SpeechRecognitionAndSynthesis

SpeechRecognitionAndSynthesis Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/ Directory Reference

  • SpeechRecognitionAndSynthesis
  • cpp

cpp Directory Reference

Files

file | AudioCapturePermissions.cpp [code]
file | AudioCapturePermissions.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario_ContinuousDictation.xaml.cpp [code]
file | Scenario_ContinuousDictation.xaml.h [code]
file | Scenario_ContinuousRecognitionListGrammar.xaml.cpp [code]
file | Scenario_ContinuousRecognitionListGrammar.xaml.h [code]
file | Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp [code]
file | Scenario_ContinuousRecognitionSRGSGrammar.xaml.h [code]
file | Scenario_ListConstraint.xaml.cpp [code]
file | Scenario_ListConstraint.xaml.h [code]
file | Scenario_PauseAsync.xaml.cpp [code]
file | Scenario_PauseAsync.xaml.h [code]
file | Scenario_PredefinedDictationGrammar.xaml.cpp [code]
file | Scenario_PredefinedDictationGrammar.xaml.h [code]
file | Scenario_PredefinedWebSearchGrammar.xaml.cpp [code]
file | Scenario_PredefinedWebSearchGrammar.xaml.h [code]
file | Scenario_SRGSConstraint.xaml.cpp [code]
file | Scenario_SRGSConstraint.xaml.h [code]
file | Scenario_SynthesizeSSML.xaml.cpp [code]
file | Scenario_SynthesizeSSML.xaml.h [code]
file | Scenario_SynthesizeText.xaml.cpp [code]
file | Scenario_SynthesizeText.xaml.h [code]
file | Scenario_SynthesizeTextBoundaries.xaml.cpp [code]
file | Scenario_SynthesizeTextBoundaries.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/ Directory Reference

  • SpeechRecognitionAndSynthesis
  • cs

cs Directory Reference

Files

file | AudioCapturePermissions.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario_ContinuousDictation.xaml.cs [code]
file | Scenario_ContinuousRecognitionListGrammar.xaml.cs [code]
file | Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs [code]
file | Scenario_ListConstraint.xaml.cs [code]
file | Scenario_PauseAsync.xaml.cs [code]
file | Scenario_PredefinedDictationGrammar.xaml.cs [code]
file | Scenario_PredefinedWebSearchGrammar.xaml.cs [code]
file | Scenario_SRGSConstraint.xaml.cs [code]
file | Scenario_SynthesizeSSML.xaml.cs [code]
file | Scenario_SynthesizeText.xaml.cs [code]
file | Scenario_SynthesizeTextBoundaries.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/ Directory Reference

  • SplashScreen

SplashScreen Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/ Directory Reference

  • SplashScreen
  • cs

cs Directory Reference

Directories

directory | common

Files

file | App.xaml.cs [code]
file | ExtendedSplash.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_SplashScreenDismiss.xaml.cs [code]
file | Scenario2_ExtendedSplash.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SplashScreen/cs/common/ Directory Reference

  • SplashScreen
  • cs
  • common

common Directory Reference

Files

file SuspensionManager.cs [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/ Directory Reference

  • Store

Store Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/ Directory Reference

  • Store
  • cpp

cpp Directory Reference

Files

file | ItemsListViewModel.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_TrialMode.xaml.cpp [code]
file | Scenario1_TrialMode.xaml.h [code]
file | Scenario2_InAppPurchase.xaml.cpp [code]
file | Scenario2_InAppPurchase.xaml.h [code]
file | Scenario3_UnmanagedConsumable.xaml.cpp [code]
file | Scenario3_UnmanagedConsumable.xaml.h [code]
file | Scenario4_ConsumableProduct.xaml.cpp [code]
file | Scenario4_ConsumableProduct.xaml.h [code]
file | Scenario5_UserCollection.xaml.cpp [code]
file | Scenario5_UserCollection.xaml.h [code]
file | Scenario6_AppListingURI.xaml.cpp [code]
file | Scenario6_AppListingURI.xaml.h [code]
file | Scenario7_B2B.xaml.cpp [code]
file | Scenario7_B2B.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/ Directory Reference

  • Store
  • cs

cs Directory Reference

Files

file | ItemsListViewModel.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_TrialMode.xaml.cs [code]
file | Scenario2_InAppPurchase.xaml.cs [code]
file | Scenario3_UnmanagedConsumable.xaml.cs [code]
file | Scenario4_ConsumableProduct.xaml.cs [code]
file | Scenario5_UserCollection.xaml.cs [code]
file | Scenario6_AppListingURI.xaml.cs [code]
file | Scenario7_B2B.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/ Directory Reference

  • StreamSocket

StreamSocket Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/ Directory Reference

  • StreamSocket
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | Scenario5.xaml.cpp [code]
file | Scenario5.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/ Directory Reference

  • StreamSocket
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Start.xaml.cs [code]
file | Scenario2_Connect.xaml.cs [code]
file | Scenario3_Send.xaml.cs [code]
file | Scenario4_Close.xaml.cs [code]
file | Scenario5_Certificates.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/ Directory Reference

  • Syndication

Syndication Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/ Directory Reference

  • Syndication
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_GetFeed.xaml.cpp [code]
file | Scenario1_GetFeed.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cs/ Directory Reference

  • Syndication
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_GetFeed.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SystemMediaTransportControls/ Directory Reference

  • SystemMediaTransportControls

SystemMediaTransportControls Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SystemMediaTransportControls/cs/ Directory Reference

  • SystemMediaTransportControls
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/ Directory Reference

  • TextSegmentation

TextSegmentation Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/ Directory Reference

  • TextSegmentation
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ExtractTextSegments.xaml.cpp [code]
file | Scenario1_ExtractTextSegments.xaml.h [code]
file | Scenario2_GetCurrentTextSegmentFromIndex.xaml.cpp [code]
file | Scenario2_GetCurrentTextSegmentFromIndex.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/ Directory Reference

  • TextSegmentation
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ExtractTextSegments.cpp [code]
file | Scenario1_ExtractTextSegments.h [code]
file | Scenario2_GetCurrentTextSegmentFromIndex.cpp [code]
file | Scenario2_GetCurrentTextSegmentFromIndex.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/ Directory Reference

  • TextSegmentation
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ExtractTextSegments.xaml.cs [code]
file | Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/ Directory Reference

  • TextSuggestion

TextSuggestion Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/ Directory Reference

  • TextSuggestion
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Conversion.xaml.cpp [code]
file | Scenario1_Conversion.xaml.h [code]
file | Scenario2_Prediction.xaml.cpp [code]
file | Scenario2_Prediction.xaml.h [code]
file | Scenario3_ReverseConversion.xaml.cpp [code]
file | Scenario3_ReverseConversion.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/ Directory Reference

  • TextSuggestion
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Conversion.xaml.cs [code]
file | Scenario2_Prediction.xaml.cs [code]
file | Scenario3_ReverseConversion.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/ Directory Reference

  • TitleBar

TitleBar Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/ Directory Reference

  • TitleBar
  • cpp

cpp Directory Reference

Files

file | CustomTitleBar.xaml.cpp [code]
file | CustomTitleBar.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Colors.xaml.cpp [code]
file | Scenario1_Colors.xaml.h [code]
file | Scenario2_Extend.xaml.cpp [code]
file | Scenario2_Extend.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/ Directory Reference

  • TitleBar
  • cppwinrt

cppwinrt Directory Reference

Files

file | CustomTitleBar.cpp [code]
file | CustomTitleBar.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Colors.cpp [code]
file | Scenario1_Colors.h [code]
file | Scenario2_Extend.cpp [code]
file | Scenario2_Extend.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/ Directory Reference

  • TitleBar
  • cs

cs Directory Reference

Files

file | CustomTitleBar.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Colors.xaml.cs [code]
file | Scenario2_Extend.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/ Directory Reference

  • TouchKeyboard

TouchKeyboard Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/ Directory Reference

  • TouchKeyboard
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Launch.cpp [code]
file | Scenario1_Launch.h [code]
file | Scenario2_ShowHideEvents.cpp [code]
file | Scenario2_ShowHideEvents.h [code]
file | Scenario3_ShowHideMethods.cpp [code]
file | Scenario3_ShowHideMethods.h [code]
file | Scenario4_ShowView.cpp [code]
file | Scenario4_ShowView.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/ Directory Reference

  • TouchKeyboard
  • cs

cs Directory Reference

Files

file | CustomTextBox.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Launch.xaml.cs [code]
file | Scenario2_ShowHideEvents.xaml.cs [code]
file | Scenario3_ShowHideMethods.xaml.cs [code]
file | Scenario4_ShowView.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/ Directory Reference

  • TouchKeyboardTextInput

TouchKeyboardTextInput Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/ Directory Reference

  • TouchKeyboardTextInput
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SpellingTextSuggestions.xaml.cpp [code]
file | Scenario1_SpellingTextSuggestions.xaml.h [code]
file | Scenario2_ScopedViews.xaml.cpp [code]
file | Scenario2_ScopedViews.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cs/ Directory Reference

  • TouchKeyboardTextInput
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_SpellingTextSuggestions.xaml.cs [code]
file | Scenario2_ScopedViews.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/ Directory Reference

  • Unicode

Unicode Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/ Directory Reference

  • Unicode
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_FindId.cpp [code]
file | Scenario1_FindId.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cs/ Directory Reference

  • Unicode
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_FindId.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/ Directory Reference

  • UserActivity

UserActivity Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserActivity/cs/ Directory Reference

  • UserActivity
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_BasicUserActivity.xaml.cs [code]
file | Scenario2_AdvancedUserActivity.xaml.cs [code]
file | Scenario3_AdaptiveCard.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/ Directory Reference

  • UserCertificateStore

UserCertificateStore Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/ Directory Reference

  • UserCertificateStore
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_MoveCertificate.cpp [code]
file | Scenario1_MoveCertificate.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cs/ Directory Reference

  • UserCertificateStore
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_MoveCertificate.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/ Directory Reference

  • UserConsentVerifier

UserConsentVerifier Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/ Directory Reference

  • UserConsentVerifier
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CheckConsentAvailability.xaml.cpp [code]
file | Scenario1_CheckConsentAvailability.xaml.h [code]
file | Scenario2_RequestConsent.xaml.cpp [code]
file | Scenario2_RequestConsent.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/ Directory Reference

  • UserConsentVerifier
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CheckConsentAvailability.cpp [code]
file | Scenario1_CheckConsentAvailability.h [code]
file | Scenario2_RequestConsent.cpp [code]
file | Scenario2_RequestConsent.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cs/ Directory Reference

  • UserConsentVerifier
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_CheckConsentAvailability.xaml.cs [code]
file | Scenario2_RequestConsent.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/ Directory Reference

  • UserDataAccountManager

UserDataAccountManager Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/ Directory Reference

  • UserDataAccountManager
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_AddAccount.xaml.cpp [code]
file | Scenario1_AddAccount.xaml.h [code]
file | Scenario2_ManageAccount.xaml.cpp [code]
file | Scenario2_ManageAccount.xaml.h [code]
file | Scenario3_FixAccount.xaml.cpp [code]
file | Scenario3_FixAccount.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/ Directory Reference

  • UserDataAccountManager
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_AddAccount.xaml.cs [code]
file | Scenario2_ManageAccount.xaml.cs [code]
file | Scenario3_FixAccount.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/ Directory Reference

  • UserInfo

UserInfo Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/ Directory Reference

  • UserInfo
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_FindUsers.cpp [code]
file | Scenario1_FindUsers.h [code]
file | Scenario2_WatchUsers.cpp [code]
file | Scenario2_WatchUsers.h [code]
file | Scenario3_CheckUserConsentGroup.cpp [code]
file | Scenario3_CheckUserConsentGroup.h [code]
file | UserViewModel.cpp [code]
file | UserViewModel.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/ Directory Reference

  • UserInfo
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_FindUsers.xaml.cs [code]
file | Scenario2_WatchUsers.xaml.cs [code]
file | Scenario3_CheckUserConsentGroup.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/ Directory Reference

  • UserInteractionMode

UserInteractionMode Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/ Directory Reference

  • UserInteractionMode
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.xaml.cpp [code]
file | Scenario1_Basic.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/ Directory Reference

  • UserInteractionMode
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.cpp [code]
file | Scenario1_Basic.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cs/ Directory Reference

  • UserInteractionMode
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basic.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/ Directory Reference

  • UssdProtcol

UssdProtcol Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/cs/ Directory Reference

  • UssdProtcol
  • cs

cs Directory Reference

Files

file | RequestResponse.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/ Directory Reference

  • VersionAdaptiveCode

VersionAdaptiveCode Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/ Directory Reference

  • VersionAdaptiveCode
  • cs

cs Directory Reference

Files

file | IsApiPropertyPresentTrigger.cs [code]
file | MEUserControl.xaml.cs [code]
file | MPEUserControl.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Basics.xaml.cs [code]
file | Scenario2_Conditional.xaml.cs [code]
file | Scenario3_ChooseControl.xaml.cs [code]
file | Scenario4_StateTrigger.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/ Directory Reference

  • VideoPlayback

VideoPlayback Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/ Directory Reference

  • VideoPlayback
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_PlayingVideos.xaml.cs [code]
file | Scenario2_DisplayingInBandClosedCaptions.xaml.cs [code]
file | Scenario3_DisplayingOutOfBandClosedCaptions.xaml.cs [code]
file | Scenario4_SelectingVideoTracks.xaml.cs [code]
file | Scenario5_SelectingAudioTracks.xaml.cs [code]
file | Scenario6_PlayingVideoLists.xaml.cs [code]
file | Scenario7_VideoComposition.xaml.cs [code]
file | Scenario8_TransferMediaPlayer1.xaml.cs [code]
file | Scenario9_TransferMediaPlayer2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/ Directory Reference

  • VideoPlaybackSynchronization

VideoPlaybackSynchronization Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/ Directory Reference

  • VideoPlaybackSynchronization
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_MultiVideoPlayback.xaml.cs [code]
file | Scenario2_SynchronizingPlayers.xaml.cs [code]
file | Scenario3_AdaptiveSync.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/ Directory Reference

  • WebAccountManagement

WebAccountManagement Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/ Directory Reference

  • WebAccountManagement
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_DefaultAccount.xaml.cpp [code]
file | Scenario1_DefaultAccount.xaml.h [code]
file | Scenario2_MSA.xaml.cpp [code]
file | Scenario2_MSA.xaml.h [code]
file | Scenario3_AAD.xaml.cpp [code]
file | Scenario3_AAD.xaml.h [code]
file | Scenario4_ManyProviders.xaml.cpp [code]
file | Scenario4_ManyProviders.xaml.h [code]
file | Scenario5_ManyProvidersManyAccounts.xaml.cpp [code]
file | Scenario5_ManyProvidersManyAccounts.xaml.h [code]
file | Scenario6_CustomProvider.xaml.cpp [code]
file | Scenario6_CustomProvider.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/ Directory Reference

  • WebAccountManagement
  • cs

cs Directory Reference

Files

file | DefaultAccountScenario.xaml.cs [code]
file | IdentityChecker.cs [code]
file | MultipleAccountsScenario.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SingleAccountScenario.xaml.cs [code]
file | SingleAzureADScenario.xaml.cs [code]
file | SingleMicrosoftAccountScenario.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/ Directory Reference

  • WebAuthenticationBroker

WebAuthenticationBroker Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/ Directory Reference

  • WebAuthenticationBroker
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario2_oAuthFacebook.xaml.cpp [code]
file | Scenario2_oAuthFacebook.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/ Directory Reference

  • WebAuthenticationBroker
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Facebook.xaml.cs [code]
file | Scenario2_Twitter.xaml.cs [code]
file | Scenario3_Flickr.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/ Directory Reference

  • WebSocket

WebSocket Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/ Directory Reference

  • WebSocket
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_UTF8.xaml.cpp [code]
file | Scenario1_UTF8.xaml.h [code]
file | Scenario2_Binary.xaml.cpp [code]
file | Scenario2_Binary.xaml.h [code]
file | Scenario3_ClientAuthentication.xaml.cpp [code]
file | Scenario3_ClientAuthentication.xaml.h [code]
file | Scenario4_PartialReadWrite.xaml.cpp [code]
file | Scenario4_PartialReadWrite.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/ Directory Reference

  • WebSocket
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_UTF8.cpp [code]
file | Scenario1_UTF8.h [code]
file | Scenario2_Binary.cpp [code]
file | Scenario2_Binary.h [code]
file | Scenario3_ClientAuthentication.cpp [code]
file | Scenario3_ClientAuthentication.h [code]
file | Scenario4_PartialReadWrite.cpp [code]
file | Scenario4_PartialReadWrite.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/ Directory Reference

  • WebSocket
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_UTF8.xaml.cs [code]
file | Scenario2_Binary.xaml.cs [code]
file | Scenario3_ClientAuthentication.xaml.cs [code]
file | Scenario4_PartialReadWrite.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/ Directory Reference

  • WiFiDirect

WiFiDirect Directory Reference

Directories

directory | cpp
directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/ Directory Reference

  • WiFiDirect
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Advertiser.xaml.cpp [code]
file | Scenario1_Advertiser.xaml.h [code]
file | Scenario2_Connector.xaml.cpp [code]
file | Scenario2_Connector.xaml.h [code]
file | SocketReaderWriter.cpp [code]
file | SocketReaderWriter.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/ Directory Reference

  • WiFiDirect
  • cppwinrt

cppwinrt Directory Reference

Files

file | ConnectionSettingsPanel.cpp [code]
file | ConnectionSettingsPanel.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Advertiser.cpp [code]
file | Scenario1_Advertiser.h [code]
file | Scenario2_Connector.cpp [code]
file | Scenario2_Connector.h [code]
file | SocketReaderWriter.cpp [code]
file | SocketReaderWriter.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/ Directory Reference

  • WiFiDirect
  • cs

cs Directory Reference

Files

file | ConnectionSettingsPanel.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_Advertiser.xaml.cs [code]
file | Scenario2_Connector.xaml.cs [code]
file | SocketReaderWriter.cs [code]
file | Utils.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/ Directory Reference

  • WiFiDirectServices

WiFiDirectServices Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/ Directory Reference

  • WiFiDirectServices
  • cpp

cpp Directory Reference

Directories

directory | Helpers

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_AdvertiserCreate.xaml.cpp [code]
file | Scenario1_AdvertiserCreate.xaml.h [code]
file | Scenario2_AdvertiserAccept.xaml.cpp [code]
file | Scenario2_AdvertiserAccept.xaml.h [code]
file | Scenario3_SeekerDiscover.xaml.cpp [code]
file | Scenario3_SeekerDiscover.xaml.h [code]
file | Scenario4_SeekerSession.xaml.cpp [code]
file | Scenario4_SeekerSession.xaml.h [code]
file | Scenario5_SendData.xaml.cpp [code]
file | Scenario5_SendData.xaml.h [code]
file | WiFiDirectServicesManager.cpp [code]
file | WiFiDirectServicesManager.h [code]
file | WiFiDirectServicesWrappers.cpp [code]
file | WiFiDirectServicesWrappers.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Helpers/ Directory Reference

  • WiFiDirectServices
  • cpp
  • Helpers

Helpers Directory Reference

Files

file | BufferConverter.h [code]
file | ServiceStatusConverter.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/ Directory Reference

  • WiFiDirectServices
  • cs

cs Directory Reference

Directories

directory | Helpers

Files

file | SampleConfiguration.cs [code]
file | Scenario1_AdvertiserCreate.xaml.cs [code]
file | Scenario2_AdvertiserAccept.xaml.cs [code]
file | Scenario3_SeekerDiscover.xaml.cs [code]
file | Scenario4_SeekerSession.xaml.cs [code]
file | Scenario5_SendData.xaml.cs [code]
file | WiFiDirectServiceManager.cs [code]
file | WiFiDirectServiceWrappers.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Helpers/ Directory Reference

  • WiFiDirectServices
  • cs
  • Helpers

Helpers Directory Reference

Files

file | BufferConverter.cs [code]
file | ServiceStatusConverter.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/ Directory Reference

  • WiFiScan

WiFiScan Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/ Directory Reference

  • WiFiScan
  • cpp

cpp Directory Reference

Files

file | DisplayHelpers.cpp [code]
file | DisplayHelpers.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_CachedNetworks.xaml.cpp [code]
file | Scenario1_CachedNetworks.xaml.h [code]
file | Scenario2_Scan.xaml.cpp [code]
file | Scenario2_Scan.xaml.h [code]
file | Scenario3_RegisterForUpdates.xaml.cpp [code]
file | Scenario3_RegisterForUpdates.xaml.h [code]
file | Scenario4_Connect.xaml.cpp [code]
file | Scenario4_Connect.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/ Directory Reference

  • WiFiScan
  • cs

cs Directory Reference

Files

file | DisplayHelpers.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_CachedNetworks.xaml.cs [code]
file | Scenario2_Scan.xaml.cs [code]
file | Scenario3_RegisterForUpdates.xaml.cs [code]
file | Scenario4_Connect.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/ Directory Reference

  • WindowsAudioSession

WindowsAudioSession Directory Reference

Directories

directory | cpp
directory | cppwinrt
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/ Directory Reference

  • WindowsAudioSession
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | Common.h [code]
file | DeviceState.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | MFSampleGenerator.cpp [code]
file | MFSampleGenerator.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PlotData.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
file | Scenario4.xaml.cpp [code]
file | Scenario4.xaml.h [code]
file | ToneSampleGenerator.cpp [code]
file | ToneSampleGenerator.h [code]
file | WASAPICapture.cpp [code]
file | WASAPICapture.h [code]
file | WASAPIRenderer.cpp [code]
file | WASAPIRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/ Directory Reference

  • WindowsAudioSession
  • cppwinrt

cppwinrt Directory Reference

Files

file | Common.h [code]
file | DeviceState.h [code]
file | MFSampleGenerator.cpp [code]
file | MFSampleGenerator.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PlotData.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1.cpp [code]
file | Scenario1.h [code]
file | Scenario2.cpp [code]
file | Scenario2.h [code]
file | Scenario3.cpp [code]
file | Scenario3.h [code]
file | Scenario4.cpp [code]
file | Scenario4.h [code]
file | ToneSampleGenerator.cpp [code]
file | ToneSampleGenerator.h [code]
file | WASAPICapture.cpp [code]
file | WASAPICapture.h [code]
file | WASAPIRenderer.cpp [code]
file | WASAPIRenderer.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/ Directory Reference

  • WRLInProcessWinRTComponent

WRLInProcessWinRTComponent Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/ Directory Reference

  • WRLInProcessWinRTComponent
  • cpp

cpp Directory Reference

Directories

directory | cpp
directory | cs
directory | Server
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/ Directory Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OvenClient.xaml.cpp [code]
file | Scenario1_OvenClient.xaml.h [code]
file | Scenario2_OvenClientWRL.xaml.cpp [code]
file | Scenario2_OvenClientWRL.xaml.h [code]
file | Scenario3_CustomException.xaml.cpp [code]
file | Scenario3_CustomException.xaml.h [code]
file | Scenario4_CustomExceptionWRL.xaml.cpp [code]
file | Scenario4_CustomExceptionWRL.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cs/ Directory Reference

  • WRLInProcessWinRTComponent
  • cpp
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_OvenClient.xaml.cs [code]
file | Scenario2_CustomException.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/Server/ Directory Reference

  • WRLInProcessWinRTComponent
  • cpp
  • Server

Server Directory Reference

Files

file | Microsoft.SDKSamples.Kitchen.idl [code]
file | module.cpp [code]
file | OvenServer.cpp [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/ Directory Reference

  • WRLOutOfProcessWinRTComponent

WRLOutOfProcessWinRTComponent Directory Reference

Directories

directory cpp
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/ Directory Reference

  • WRLOutOfProcessWinRTComponent
  • cpp

cpp Directory Reference

Directories

directory | cpp
directory | cs
directory | Server
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/ Directory Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_OvenClient.xaml.cpp [code]
file | Scenario1_OvenClient.xaml.h [code]
file | Scenario2_OvenClientWRL.xaml.cpp [code]
file | Scenario2_OvenClientWRL.xaml.h [code]
file | Scenario3_CustomException.xaml.cpp [code]
file | Scenario3_CustomException.xaml.h [code]
file | Scenario4_CustomExceptionWRL.xaml.cpp [code]
file | Scenario4_CustomExceptionWRL.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/ Directory Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_OvenClient.xaml.cs [code]
file | Scenario2_CustomException.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/ Directory Reference

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

Server Directory Reference

Files

file | Microsoft.SDKSamples.Kitchen.idl [code]
file | module.cpp [code]
file | OvenServer.cpp [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/ Directory Reference

  • XamlAnimatedGif

XamlAnimatedGif Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/ Directory Reference

  • XamlAnimatedGif
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.xaml.cpp [code]
file | Scenario1_Basic.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cs/ Directory Reference

  • XamlAnimatedGif
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basic.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/ Directory Reference

  • XamlBind

XamlBind Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/ Directory Reference

  • XamlBind
  • cpp

cpp Directory Reference

Directories

directory | xBindSampleModel

Files

file | App.xaml.cpp [code]
file | App.xaml.h [code]
file | BasicTests.xaml.cpp [code]
file | BasicTests.xaml.h [code]
file | EventTests.xaml.cpp [code]
file | EventTests.xaml.h [code]
file | Functions.xaml.cpp [code]
file | Functions.xaml.h [code]
file | ListsAndTemplates.xaml.cpp [code]
file | ListsAndTemplates.xaml.h [code]
file | MainPage.xaml.cpp [code]
file | MainPage.xaml.h [code]
file | MyUserControl1.xaml.cpp [code]
file | MyUserControl1.xaml.h [code]
file | OtherBindings.xaml.cpp [code]
file | OtherBindings.xaml.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | PhasingTests.xaml.cpp [code]
file | PhasingTests.xaml.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Templates.xaml.cpp [code]
file | Templates.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/ Directory Reference

  • XamlBind
  • cpp
  • xBindSampleModel

xBindSampleModel Directory Reference

Directories

directory | Properties

Files

file | BoolToVisibilityConverter.cs [code]
file | ColorToStringConverter.cs [code]
file | Converters.cs [code]
file | DOModel.cs [code]
file | DoubleToIntConverter.cs [code]
file | Employee.cs [code]
file | EmployeeCollection.cs [code]
file | FileSystemDataSource.cs [code]
file | IEmployee.cs [code]
file | Manager.cs [code]
file | Model.cs [code]
file | VeryObservableCollection.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Properties/ Directory Reference

  • XamlBind
  • cpp
  • xBindSampleModel
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/ Directory Reference

  • XamlBind
  • cs

cs Directory Reference

Directories

directory | xBindSampleModel

Files

file | BasicTests.xaml.cs [code]
file | CSharpModel.cs [code]
file | EventTests.xaml.cs [code]
file | Functions.xaml.cs [code]
file | ListsAndTemplates.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | MyUserControl1.xaml.cs [code]
file | OtherBindings.xaml.cs [code]
file | PhasingTests.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Templates.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/ Directory Reference

  • XamlBind
  • cs
  • xBindSampleModel

xBindSampleModel Directory Reference

Directories

directory | Properties

Files

file | BoolToVisibilityConverter.cs [code]
file | ColorToStringConverter.cs [code]
file | Converters.cs [code]
file | DOModel.cs [code]
file | DoubleToIntConverter.cs [code]
file | Employee.cs [code]
file | EmployeeCollection.cs [code]
file | FileSystemDataSource.cs [code]
file | IEmployee.cs [code]
file | Manager.cs [code]
file | Model.cs [code]
file | VeryObservableCollection.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Properties/ Directory Reference

  • XamlBind
  • cs
  • xBindSampleModel
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/ Directory Reference

  • XamlBottomUpList

XamlBottomUpList Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/ Directory Reference

  • XamlBottomUpList
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_Basic.xaml.cpp [code]
file | Scenario1_Basic.xaml.h [code]
file | Scenario2_Load.xaml.cpp [code]
file | Scenario2_Load.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/ Directory Reference

  • XamlBottomUpList
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Basic.xaml.cs [code]
file | Scenario2_Load.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/ Directory Reference

  • XamlCloudFontIntegration

XamlCloudFontIntegration Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/ Directory Reference

  • XamlCloudFontIntegration
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario_CloudFontOverview.xaml.cpp [code]
file | Scenario_CloudFontOverview.xaml.h [code]
file | Scenario_Document1.xaml.cpp [code]
file | Scenario_Document1.xaml.h [code]
file | Scenario_Document2.xaml.cpp [code]
file | Scenario_Document2.xaml.h [code]
file | Scenario_Document3.xaml.cpp [code]
file | Scenario_Document3.xaml.h [code]
file | Scenario_SampleOverview.xaml.cpp [code]
file | Scenario_SampleOverview.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/ Directory Reference

  • XamlCloudFontIntegration
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario_CloudFontOverview.xaml.cs [code]
file | Scenario_Document1.xaml.cs [code]
file | Scenario_Document2.xaml.cs [code]
file | Scenario_Document3.xaml.cs [code]
file | Scenario_SampleOverview.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/ Directory Reference

  • XamlCommanding

XamlCommanding Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/ Directory Reference

  • XamlCommanding
  • cpp

cpp Directory Reference

Files

file | App.xaml.cpp [code]
file | DynamicCommandBar.cpp [code]
file | DynamicCommandBar.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_AppBarButtons.xaml.cpp [code]
file | Scenario1_AppBarButtons.xaml.h [code]
file | Scenario2_Icons.xaml.cpp [code]
file | Scenario2_Icons.xaml.h [code]
file | Scenario3_Events.xaml.cpp [code]
file | Scenario3_Events.xaml.h [code]
file | Scenario4_Control.xaml.cpp [code]
file | Scenario4_Control.xaml.h [code]
file | Scenario5_Multiple.xaml.cpp [code]
file | Scenario5_Multiple.xaml.h [code]
file | Scenario6_Styling.xaml.cpp [code]
file | Scenario6_Styling.xaml.h [code]
file | Scenario7_CustomContent.xaml.cpp [code]
file | Scenario7_CustomContent.xaml.h [code]
file | Scenario8_Reflow.xaml.cpp [code]
file | Scenario8_Reflow.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/ Directory Reference

  • XamlCommanding
  • cs

cs Directory Reference

Files

file | DynamicCommandBar.cs [code]
file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | Scenario4.xaml.cs [code]
file | Scenario5.xaml.cs [code]
file | Scenario6.xaml.cs [code]
file | Scenario7.xaml.cs [code]
file | Scenario8.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/ Directory Reference

  • XamlContextMenu

XamlContextMenu Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/ Directory Reference

  • XamlContextMenu
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | SampleDataModel.h [code]
file | Scenario1.xaml.cpp [code]
file | Scenario1.xaml.h [code]
file | Scenario2.xaml.cpp [code]
file | Scenario2.xaml.h [code]
file | Scenario3.xaml.cpp [code]
file | Scenario3.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/ Directory Reference

  • XamlContextMenu
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | SampleData.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/ Directory Reference

  • XamlCustomMediaTransportControls

XamlCustomMediaTransportControls Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/ Directory Reference

  • XamlCustomMediaTransportControls
  • cs

cs Directory Reference

Directories

directory | Properties

Files

file | App.xaml.cs [code]
file | CustomMediaTransportControls.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/Properties/ Directory Reference

  • XamlCustomMediaTransportControls
  • cs
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/ Directory Reference

  • XamlDataVirtualization

XamlDataVirtualization Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/ Directory Reference

  • XamlDataVirtualization
  • cs

cs Directory Reference

Directories

directory | Scenario1
directory | Scenario2

Files

file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ Directory Reference

  • XamlDataVirtualization
  • cs
  • Scenario1

Scenario1 Directory Reference

Files

file | FileDataSource.cs [code]
file | FileItem.cs [code]
file | ItemCacheManager.cs [code]
file | ItemIndexRangeExtensions.cs [code]
file | ItemIndexRangeList.cs [code]
file | Scenario1.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario2/ Directory Reference

  • XamlDataVirtualization
  • cs
  • Scenario2

Scenario2 Directory Reference

Files

file | FileDataSource2.cs [code]
file | Scenario2.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/ Directory Reference

  • XamlDeferLoadStrategy

XamlDeferLoadStrategy Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/ Directory Reference

  • XamlDeferLoadStrategy
  • cs

cs Directory Reference

Directories

directory | Scenarios

Files

file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | TitledImage.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/ Directory Reference

  • XamlDeferLoadStrategy
  • cs
  • Scenarios

Scenarios Directory Reference

Files

file | AdaptivePage.xaml.cs [code]
file | BasicDeferral.xaml.cs [code]
file | DeferredControlTemplatePart.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/ Directory Reference

  • XamlDragAndDrop

XamlDragAndDrop Directory Reference

Directories

directory | cpp
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/ Directory Reference

  • XamlDragAndDrop
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_ListView.xaml.cpp [code]
file | Scenario1_ListView.xaml.h [code]
file | Scenario2_DragUICustomization.xaml.cpp [code]
file | Scenario2_DragUICustomization.xaml.h [code]
file | Scenario3_StartDragAsync.xaml.cpp [code]
file | Scenario3_StartDragAsync.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/ Directory Reference

  • XamlDragAndDrop
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_ListView.xaml.cs [code]
file | Scenario2_DragUICustomization.xaml.cs [code]
file | Scenario3_StartDragAsync.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/ Directory Reference

  • XamlFocusVisuals

XamlFocusVisuals Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/ Directory Reference

  • XamlFocusVisuals
  • cs

cs Directory Reference

Directories

directory | Scenarios

Files

file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SocialMediaCounter.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/Scenarios/ Directory Reference

  • XamlFocusVisuals
  • cs
  • Scenarios

Scenarios Directory Reference

Files

file | CustomControlUsage.xaml.cs [code]
file | CustomFocusVisuals.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/ Directory Reference

  • XamlGamepadNavigation

XamlGamepadNavigation Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/ Directory Reference

  • XamlGamepadNavigation
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_Directions.xaml.cs [code]
file | Scenario2_Engage.xaml.cs [code]
file | Scenario3_Legacy.xaml.cs [code]
file | TransportOptions.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/ Directory Reference

  • XamlListView

XamlListView Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/ Directory Reference

  • XamlListView
  • cppwinrt

cppwinrt Directory Reference

Files

file | Contact.cpp [code]
file | Contact.h [code]
file | DetailsPage.cpp [code]
file | DetailsPage.h [code]
file | EdgeTappedListView.cpp [code]
file | EdgeTappedListView.h [code]
file | GroupInfoList.cpp [code]
file | GroupInfoList.h [code]
file | ImagePage.cpp [code]
file | ImagePage.h [code]
file | Item.cpp [code]
file | Item.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_SimpleListView.cpp [code]
file | Scenario1_SimpleListView.h [code]
file | Scenario2_SimpleGridView.cpp [code]
file | Scenario2_SimpleGridView.h [code]
file | Scenario3_MasterDetail.cpp [code]
file | Scenario3_MasterDetail.h [code]
file | Scenario4_EdgeTappedListView.cpp [code]
file | Scenario4_EdgeTappedListView.h [code]
file | Scenario5_RestoreScrollPosition.cpp [code]
file | Scenario5_RestoreScrollPosition.h [code]
file | Scenario6_ScrollIntoView.cpp [code]
file | Scenario6_ScrollIntoView.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/ Directory Reference

  • XamlListView
  • cs

cs Directory Reference

Files

file | Contact.cs [code]
file | DetailsPage.xaml.cs [code]
file | EdgeTappedListView.cs [code]
file | GroupInfoList.cs [code]
file | ImagePage.xaml.cs [code]
file | Item.cs [code]
file | SampleConfiguration.cs [code]
file | Scenario1_SimpleListView.xaml.cs [code]
file | Scenario2_SimpleGridView.xaml.cs [code]
file | Scenario3_MasterDetail.xaml.cs [code]
file | Scenario4_EdgeTappedListView.xaml.cs [code]
file | Scenario5_RestoreScrollPosition.xaml.cs [code]
file | Scenario6_ScrollIntoView.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/ Directory Reference

  • XamlMasterDetail

XamlMasterDetail Directory Reference

Directories

directory | cppwinrt
directory | cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/ Directory Reference

  • XamlMasterDetail
  • cppwinrt

cppwinrt Directory Reference

Files

file | App.cpp [code]
file | App.h [code]
file | DetailPage.cpp [code]
file | DetailPage.h [code]
file | Item.cpp [code]
file | ItemsDataSource.h [code]
file | ItemViewModel.cpp [code]
file | MasterDetailPage.cpp [code]
file | MasterDetailPage.h [code]
file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/ Directory Reference

  • XamlMasterDetail
  • cs

cs Directory Reference

Directories

directory | Data
directory | Properties
directory | ViewModels

Files

file | App.xaml.cs [code]
file | DetailPage.xaml.cs [code]
file | MasterDetailPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Data/ Directory Reference

  • XamlMasterDetail
  • cs
  • Data

Data Directory Reference

Files

file | Item.cs [code]
file | ItemsDataSource.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Properties/ Directory Reference

  • XamlMasterDetail
  • cs
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/ViewModels/ Directory Reference

  • XamlMasterDetail
  • cs
  • ViewModels

ViewModels Directory Reference

Files

file ItemViewModel.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/ Directory Reference

  • XamlPivot

XamlPivot Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/ Directory Reference

  • XamlPivot
  • cs

cs Directory Reference

Files

file | MainPage.xaml.cs [code]
file | SampleConfiguration.cs [code]
file | SampleData.cs [code]
file | Scenario1.xaml.cs [code]
file | Scenario2.xaml.cs [code]
file | Scenario3.xaml.cs [code]
file | TabHeader.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/ Directory Reference

  • XamlStateTriggers

XamlStateTriggers Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ Directory Reference

  • XamlStateTriggers
  • cs

cs Directory Reference

Directories

directory | CustomTriggers
directory | Properties
directory | ViewModel

Files

file | App.xaml.cs [code]
file | ItemTemplateControl.xaml.cs [code]
file | MainPage.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/CustomTriggers/ Directory Reference

  • XamlStateTriggers
  • cs
  • CustomTriggers

CustomTriggers Directory Reference

Files

file | ControlSizeTrigger.cs [code]
file | DeviceFamilyTrigger.cs [code]
file | InputTypeTrigger.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/Properties/ Directory Reference

  • XamlStateTriggers
  • cs
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ViewModel/ Directory Reference

  • XamlStateTriggers
  • cs
  • ViewModel

ViewModel Directory Reference

Files

file | MainViewModel.cs [code]
file | Model.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/ Directory Reference

  • XamlTailoredMultipleViews

XamlTailoredMultipleViews Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/ Directory Reference

  • XamlTailoredMultipleViews
  • cs

cs Directory Reference

Directories

directory TailoredMultipleViews
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ Directory Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews

TailoredMultipleViews Directory Reference

Directories

directory | DisplaySizeHelper
directory | Properties
directory | UserControls
directory | ViewModel

Files

file | App.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | MainPage_OneHanded.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/ Directory Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

DisplaySizeHelper Directory Reference

Files

file | DisplaySizeClass.cpp [code]
file | DisplaySizeClass.h [code]
file | pch.cpp [code]
file | pch.h [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/Properties/ Directory Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/UserControls/ Directory Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • UserControls

UserControls Directory Reference

Files

file | Albums.xaml.cs [code]
file | Collections.xaml.cs [code]
file | Settings.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/ Directory Reference

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • ViewModel

ViewModel Directory Reference

Files

file | MainViewModel.cs [code]
file | Model.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/ Directory Reference

  • XamlTransform3DAnimations

XamlTransform3DAnimations Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ Directory Reference

  • XamlTransform3DAnimations
  • cs

cs Directory Reference

Directories

directory | Properties
directory | ViewModels

Files

file | App.xaml.cs [code]
file | ArticlePage.xaml.cs [code]
file | MainPage.xaml.cs [code]
file | SectionView.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/Properties/ Directory Reference

  • XamlTransform3DAnimations
  • cs
  • Properties

Properties Directory Reference

Files

file AssemblyInfo.cs [code]
Generated on Fri Nov 15 2024 22:24:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ViewModels/ Directory Reference

  • XamlTransform3DAnimations
  • cs
  • ViewModels

ViewModels Directory Reference

Files

file | ArticleViewModel.cs [code]
file | HeroArticlesViewModel.cs [code]
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/ Directory Reference

  • XamlWebView

XamlWebView Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/ Directory Reference

  • XamlWebView
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario10_UnviewableContent.xaml.cs [code]
file | Scenario1_NavToUrl.xaml.cs [code]
file | Scenario2_NavToString.xaml.cs [code]
file | Scenario3_InvokeScript.xaml.cs [code]
file | Scenario4_ScriptNotify.xaml.cs [code]
file | Scenario5_NavToFiles.xaml.cs [code]
file | Scenario6_NavToStream.xaml.cs [code]
file | Scenario7_Share.xaml.cs [code]
file | Scenario8_CaptureBitmap.xaml.cs [code]
file | Scenario9_ContainsFullScreenElement.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/ Directory Reference

  • XmlDocument

XmlDocument Directory Reference

Directories

directory cs
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/ Directory Reference

  • XmlDocument
  • cs

cs Directory Reference

Files

file | SampleConfiguration.cs [code]
file | Scenario1_BuildNewRss.xaml.cs [code]
file | Scenario2_MarkHotProducts.xaml.cs [code]
file | Scenario3_XmlLoading.xaml.cs [code]
file | Scenario4_GiftDispatch.xaml.cs [code]
file | Scenario5_XSLTTransform.xaml.cs [code]
Generated on Fri Nov 15 2024 22:24:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/ Directory Reference

  • XmlLite

XmlLite Directory Reference

Directories

directory | cpp
directory | cppwinrt
Generated on Fri Nov 15 2024 22:24:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/ Directory Reference

  • XmlLite
  • cpp

cpp Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_XmlReader.xaml.cpp [code]
file | Scenario1_XmlReader.xaml.h [code]
file | Scenario2_XmlWriter.xaml.cpp [code]
file | Scenario2_XmlWriter.xaml.h [code]
file | Scenario3_XmlWriterLite.xaml.cpp [code]
file | Scenario3_XmlWriterLite.xaml.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/ Directory Reference

  • XmlLite
  • cppwinrt

cppwinrt Directory Reference

Files

file | pch.cpp [code]
file | pch.h [code]
file | Project.idl [code]
file | SampleConfiguration.cpp [code]
file | SampleConfiguration.h [code]
file | Scenario1_XmlReader.cpp [code]
file | Scenario1_XmlReader.h [code]
file | Scenario2_XmlWriter.cpp [code]
file | Scenario2_XmlWriter.h [code]
file | Scenario3_XmlWriterLite.cpp [code]
file | Scenario3_XmlWriterLite.h [code]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- _ -

  • __declspec() : FirmwareAccess.h , RpcClientApi.h , ServiceBase.cpp
  • __STDC_WANT_SECURE_LIB__ : pch.h
  • _Acquires_lock_() : StspMediaSource.cpp
  • _captureFolder() : MainPage.xaml.cpp
  • _colorNames : Functions.xaml.cpp
  • _colors : Functions.xaml.cpp
  • _inputElements : Scenario1_WriteReadStream.xaml.cpp
  • _inputPropertiesBackup() : MainPage.xaml.cpp
  • _outputPropertiesBackup() : MainPage.xaml.cpp
  • _Releases_lock_() : StspMediaSource.cpp
  • _rotationHelper() : MainPage.xaml.cpp
  • _USE_MATH_DEFINES : BasicMath.h , Scenario7.xaml.cpp , ToneSampleGenerator.h , BasicMath.h , ToneSampleGenerator.h , Scenario2.xaml.cpp , pch.h , Scenario3.xaml.cpp , BasicMath.h
  • _videoStabilizationEffect() : MainPage.xaml.cpp
  • _XMMatrixStereoProjectionHelper() : StereoProjection.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Alphabetical List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Class Index

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | _
A
Period (LiveDash::Models) Scenario3_ReverseConversion (TextSuggestion)
abstract (Microsoft::Samples::SimpleCommunication::Network) PersistentState Scenario3_SecondaryTiles (winrt::SDKTemplate::implementation)
AccessHandler (MifareUltralight) PhasingTests (xBindSampleCS) Scenario3_SecondaryTiles (winrt::SDKTemplate::factory_implementation)
AccessHandler (MifareStandard) PhotoAdjustmentProperties (D2DPhotoAdjustment) Scenario3_SecondaryTiles (SDKTemplate)
AccessHandler (Iso15693) PhotoAdjustmentRenderer (D2DPhotoAdjustment) Scenario3_SendMIDIMessages (MIDI)
AccessHandler (Felica) PhotosPrintHelper (PrintSample) Scenario3_ServerForeground (winrt::SDKTemplate::implementation)
AccessHandler (Desfire) SuperMutt::Pipe (CustomUsbDeviceAccess) Scenario3_ServerForeground (winrt::SDKTemplate::factory_implementation)
Account (xDeferLoadStrategy) OsrFx2::Pipe (CustomUsbDeviceAccess) Scenario3_ServerForeground (SDKTemplate)
Account (SDKTemplate) PipeEvents Scenario3_SettingContainer (winrt::SDKTemplate::implementation)
AccountOverviewPage (SDKTemplate) PipeIn Scenario3_SettingContainer (winrt::SDKTemplate::factory_implementation)
AccountsHelper (SDKTemplate) PipeOut Scenario3_SettingContainer (SDKTemplate)
AccountWatcher (MobileBroadband) PlaceInfo (SDKTemplate) Scenario3_ShowHideMethods (winrt::SDKTemplate::implementation)
ActivitySensorBackgroundTask (Tasks) PlaceLocation (SDKTemplate) Scenario3_ShowHideMethods (winrt::SDKTemplate::factory_implementation)
AdaptiveContentModel (SDKTemplate::Models) PlaybackControl (PlaybackManager) Scenario3_ShowHideMethods (SDKTemplate)
AdaptivePage (xDeferLoadStrategy) PlaybackPage (_360VideoPlayback) Scenario3_SingleFolder (winrt::SDKTemplate::implementation)
AddAuthorizationHeaderFilter (SDKTemplate) PlaybackService (BackgroundMediaPlayback::Services) Scenario3_SingleFolder (winrt::SDKTemplate::factory_implementation)
MainPage::AdvancedCaptureContext (CameraAdvancedCapture) PlaybackSessionViewModel (BackgroundMediaPlayback::ViewModels) Scenario3_SingleFolder (SDKTemplate)
AdvancedCaptureContext (CameraAdvancedCapture) PlaybackStateToButtonIconConverter (BackgroundMediaPlayback::ViewModels) Scenario3_Size (winrt::SDKTemplate::implementation)
AdventureWorksVoiceCommandService (AdventureWorks::VoiceCommands) Player (LiveDash) Scenario3_Size (winrt::SDKTemplate::factory_implementation)
AdvertisementPublisherTask (BackgroundTasks) PlayerViewModel (BackgroundMediaPlayback::ViewModels) Scenario3_Size (SDKTemplate)
AdvertisementWatcherTask (BackgroundTasks) PlaylistView (BackgroundMediaPlayback) Scenario3_StartDragAsync (DragAndDropSampleManaged)
AdvertisementWrapper (SDKTemplate::WiFiDirectServices) PlayPauseButton (DX) Scenario3_Transliteration (winrt::SDKTemplate::implementation)
Albums (OneHandedUse_TailoredMultipleViews::UserControls) Helpers::PlayReadyHelper (SDKTemplate) Scenario3_Transliteration (winrt::SDKTemplate::factory_implementation)
AllJoynBusObjectManager PlayReadyHelpers (SDKTemplate::Shared) Scenario3_Transliteration (SDKTemplate)
AllJoynHelpers PlayReadyInfo (SDKTemplate::Controls) Scenario3_Trim (SDKTemplate)
Animate PlayReadyInfoViewModel (SDKTemplate::ViewModels) Scenario3_UnmanagedConsumable (SDKTemplate)
AnimateCirclePosition PlotDataReadyEventArgs (winrt::SDKTemplate::implementation) Scenario3_UsingWindows (SDKTemplate)
AnimateLineListPosition PlotDataSourceT (winrt::SDKTemplate::implementation) Scenario3_XmlWriterLite (winrt::SDKTemplate::implementation)
AnimateLinePosition PlugInFilter (winrt::SDKTemplate::implementation) Scenario3_XmlWriterLite (winrt::SDKTemplate::factory_implementation)
ApduCommand (Iso7816) PlugInFilter (winrt::SDKTemplate::factory_implementation) Scenario3CustomOptions (PrintSample)
ApduResponse (Pcsc) PlugInFilter (SDKTemplate) Scenario4 (winrt::SDKTemplate::implementation)
ApduResponse (MifareUltralight) PNTVertex Scenario4 (winrt::SDKTemplate::factory_implementation)
ApduResponse (MifareStandard) PointOfInterest (SDKTemplate) Scenario4 (StreamSocketSample)
ApduResponse (Iso7816) PopToastControl (Notifications::Controls) Scenario4 (SDKTemplate::WiFiDirectServices)
ApduResponse (Iso15693) PoseTrackingEntityData (MFPoseTrackingPreview) Scenario4 (SDKTemplate)
ApduResponse (Felica) PoseTrackingFrameHeader (MFPoseTrackingPreview) Scenario4 (PlaybackManager)
ApiInformation (ScreenCasting::Util) List::POSITION Scenario4 (EdpSample)
App (winrt::MasterDetailApp::implementation) SourceHandler::PositionInformation (HolographicPaint) Scenario4 (DatagramSocketSample)
App (Transform3DAnimations) PresentationFormats (winrt::SDKTemplate) Scenario4 (Commanding)
App (StateTriggersSample) PresentationFormats (SDKTemplate) Scenario4_AddOverlays (MediaEditingSample)
App (SDKTemplate) PreviewUnavailable (PrintSample) Scenario4_BackgroundActivity (SDKTemplate)
App (ScreenCasting) Print3D Scenario4_BackgroundPedometer (PedometerCS)
App (OneHandedUse_TailoredMultipleViews) PrintHelper (SDKTemplate) Scenario4_BackgroundProximitySensor (ProximityCS)
App (Notifications) PrintHelper (PrintSample) Scenario4_BackgroundPublisher (BluetoothAdvertisement)
App (MasterDetailApp) ProactiveViewModel (SDKTemplate::ViewModels) Scenario4_BulkPipes (CustomUsbDeviceAccess)
App (FaceDetection) Program (BasicHologram) Scenario4_ChangeAdminKey (winrt::SDKTemplate::implementation)
App (CustomMediaTransportControls) Program (_360VideoPlayback) Scenario4_ChangeAdminKey (winrt::SDKTemplate::factory_implementation)
App (CameraVideoStabilization) ProjectedMediaTransportControls (ScreenCasting::Controls) Scenario4_ChangeAdminKey (SDKTemplate)
App (CameraStarterKit) ProjectionViewBroker (ScreenCasting) Scenario4_ChangeSystemGroup (winrt::SDKTemplate::implementation)
App (CameraManualControls) ProjectionViewPage (SDKSample) Scenario4_ChangeSystemGroup (winrt::SDKTemplate::factory_implementation)
App (CameraGetPreviewFrame) ProjectionViewPage (ScreenCasting) Scenario4_ChangeSystemGroup (SDKTemplate)
App (CameraAdvancedCapture) ProjectionViewPageInitializationData (SDKSample) Scenario4_CharacterGrouping (winrt::SDKTemplate::implementation)
App PropertyGetContext Scenario4_CharacterGrouping (winrt::SDKTemplate::factory_implementation)
App (AdventureWorks) PropertySetContext Scenario4_CharacterGrouping (SDKTemplate)
App (_360VideoPlayback) ProtectionLevelSelectorInfo (winrt::SDKTemplate::implementation) Scenario4_CompactOverlay (winrt::SDKTemplate::implementation)
AppContactPanel (SDKTemplate) ProtectionLevelSelectorInfo (SDKTemplate) Scenario4_CompactOverlay (winrt::SDKTemplate::factory_implementation)
AppData (AllJoynProducerExperiences) ProtectionSelectorChoices (winrt::SDKTemplate::implementation) Scenario4_CompactOverlay (SDKTemplate)
AppException (SDKTemplate) Provider (BarcodeDecoder) Scenario4_CompletionGroups (SDKTemplate)
ApplicationTriggerTask (SDKTemplate) ProximitySensorBackgroundTask (Tasks) Scenario4_CompositeSettings (winrt::SDKTemplate::implementation)
AppView (BasicHologram)
Q
Scenario4_CompositeSettings (winrt::SDKTemplate::factory_implementation)
AppView (_360VideoPlayback) QuadModelConstantBuffer (HolographicFaceTracker) Scenario4_CompositeSettings (SDKTemplate)
AppViewSource (BasicHologram) QuadRenderer (HolographicTagAlongSample) Scenario4_Connect (WiFiScan)
AppViewSource (_360VideoPlayback) QuadRenderer (HolographicFaceTracker) Scenario4_ConsumableProduct (SDKTemplate)
ArduinoDevice (SerialArduino) QuadRenderer (CameraStreamCoordinateMapper) Scenario4_EdgeTappedListView (winrt::SDKTemplate::implementation)
ArticlePage (Transform3DAnimations)
R
Scenario4_EdgeTappedListView (winrt::SDKTemplate::factory_implementation)
ArticleViewModel (Transform3DAnimations::ViewModels) RadioModel (winrt::SDKTemplate::implementation) Scenario4_EdgeTappedListView (SDKTemplate)
AsyncCallback RadioModel (SDKTemplate) Scenario4_Events (CustomSerialDeviceAccess)
AtrInfo (Pcsc::Common) RandomNumberGeneratorTask (winrt::RandomNumberService::implementation) Scenario4_ForegroundGeofence (winrt::SDKTemplate::implementation)
AtrParser (Pcsc::Common) RandomNumberGeneratorTask (winrt::RandomNumberService::factory_implementation) Scenario4_ForegroundGeofence (winrt::SDKTemplate::factory_implementation)
AttributeValidationDescriptor (anonymous_namespace{Validation.cpp}) RandomNumberGeneratorTask (RandomNumberService) Scenario4_ForegroundGeofence (SDKTemplate)
Audio GpuCoordinateMapper::RasterizedFrameBlob (CameraStreamCoordinateMapper) Scenario4_Input (winrt::SDKTemplate::implementation)
AudioCapturePermissions (SDKTemplate) RawSMBIOSData Scenario4_Input (winrt::SDKTemplate::factory_implementation)
AudioEchoEffect (CustomEffect) RawSMBIOSSystemInfo Scenario4_Input (SDKTemplate)
AudioFileReader RawSMBIOSTable Scenario4_InteractionFeedback (winrt::SDKTemplate::implementation)
AudioStreamReader ReactiveViewModel (SDKTemplate::ViewModels) Scenario4_InteractionFeedback (winrt::SDKTemplate::factory_implementation)
AuthenticationController (MicrosoftPassport::Server::Controllers) Read (MifareUltralight) Scenario4_InteractionFeedback (SDKTemplate)
AuthenticationTask (HotspotAuthenticationTask) Read (MifareStandard) Scenario4_NumberParsing (winrt::SDKTemplate::implementation)
AuthTypeToStringConverter (AllJoynConsumerExperiences) Read (Iso15693) Scenario4_NumberParsing (winrt::SDKTemplate::factory_implementation)
AutoLock ReadBinary (Pcsc) Scenario4_NumberParsing (SDKTemplate)
AzureDataProvider (ScreenCasting::Data::Azure) ReadBytes (SDKTemplate) Scenario4_OrientationChanged (SDKTemplate)
B
ReadStreamTask Scenario4_Override (winrt::SDKTemplate::implementation)
BackButtonPage (Notifications::Helpers) ReadStreamTask::ReadStreamTaskImpl Scenario4_Override (winrt::SDKTemplate::factory_implementation)
BackgroundActivity (SDKTemplate) SuperMutt::ReadWriteBufferControlInformation (CustomHidDeviceAccess) Scenario4_Override (SDKTemplate)
BackgroundAuthenticationCompletedEventArgs (SDKTemplate) RealtimeSurfaceMeshRenderer (WindowsHolographicCodeSamples) Scenario4_PartialReadWrite (winrt::SDKTemplate::implementation)
BackgroundDeviceWatcher (winrt::BackgroundDeviceWatcherTask::implementation) ReceiptView (NfcSample) Scenario4_PartialReadWrite (winrt::SDKTemplate::factory_implementation)
BackgroundDeviceWatcher (winrt::BackgroundDeviceWatcherTask::factory_implementation) RecognizedTextRun (Sample) Scenario4_PartialReadWrite (SDKTemplate)
BackgroundDeviceWatcher (BackgroundDeviceWatcherTaskCs) Rectangle (DX) Scenario4_ReceiveUri (SDKTemplate)
BackgroundTaskInformation (BackgroundTask) RectRenderer (SDKTemplate) Scenario4_Remove (SDKTemplate)
BackgroundTaskSample (SDKTemplate) DAL::RegisteredUser (MicrosoftPassport::Server::Data) Scenario4_SaveFile (winrt::SDKTemplate::implementation)
BadgeNotificationHistoryChangedTriggerTask (BackgroundTasks) RegisterMessage (MicrosoftPassport::Models) Scenario4_SaveFile (winrt::SDKTemplate::factory_implementation)
BadgeNumericNotificationContent (BackgroundTasks) RegisterWithBackgroundTask (SmsSendAndReceive) Scenario4_SaveFile (SDKTemplate)
BarcodeDecodeTask (BarcodeDecoder) ReinhardEffect Scenario4_ScriptNotify (SDKTemplate)
BarcodeScannerInfo (winrt::SDKTemplate::implementation) RelayCommand (SDKTemplate::Shared) Scenario4_SecureStop (SDKTemplate)
BarcodeScannerInfo (winrt::SDKTemplate::factory_implementation) RelayCommand (AllJoynProducerExperiences) Scenario4_Settings (SDKTemplate)
BarcodeScannerInfo (SDKTemplate) RelayCommand (AllJoynConsumerExperiences) Scenario4_ShowView (winrt::SDKTemplate::implementation)
BaseControl (DX) RelayCommand (AdventureWorks::Common) Scenario4_ShowView (winrt::SDKTemplate::factory_implementation)
BaseElement (DX) RemotePeer (DatagramSocketSample) Scenario4_ShowView (SDKTemplate)
BasicDeferral (xDeferLoadStrategy) RenderBuffer (winrt::SDKTemplate) Scenario4_Snapshot (winrt::SDKTemplate::implementation)
BasicHologramMain (BasicHologram) RenderBuffer Scenario4_Snapshot (winrt::SDKTemplate::factory_implementation)
BasicLoader RenderingHelper (HolographicPaint) Scenario4_Snapshot (SDKTemplate)
BasicReaderWriter RequestResponse (UssdApi) Scenario4_StateTrigger (SDKTemplate)
BasicShapes RequiredDeviceProperties (ScreenCasting::Util) Scenario4_Submix (AudioCreation)
BasicTests (xBindSampleCS) Resource (DX) Scenario4_SymbologyAttributes (winrt::SDKTemplate::implementation)
BasicTimer RfcommChatDeviceDisplay (SDKTemplate) Scenario4_SymbologyAttributes (winrt::SDKTemplate::factory_implementation)
BasicVertex RfcommServerTask (BackgroundTasks) Scenario4_SymbologyAttributes (SDKTemplate)
BindableBase (Notifications::Helpers) RippleEffect Scenario4_TilePinned (winrt::SDKTemplate::implementation)
BindingHelpers (winrt::SDKTemplate::implementation) RootFrameNavigationHelper (SDKTemplate::Common) Scenario4_TilePinned (winrt::SDKTemplate::factory_implementation)
BindingHelpers (winrt::SDKTemplate::factory_implementation) RootFrameNavigationHelper (AdventureWorks::Common) Scenario4_TilePinned (SDKTemplate)
BindingHelpers (SDKTemplate) RoundingConverter (CameraManualControls) Scenario4_Tuning (SDKTemplate)
BitrateHelper (SDKTemplate) RouteConfig (MicrosoftPassport::Server) Scenario4_UnicodeExtensions (winrt::SDKTemplate::implementation)
BitrateItem (SDKTemplate)
S
Scenario4_UnicodeExtensions (winrt::SDKTemplate::factory_implementation)
BluetoothLEDeviceDisplay (winrt::SDKTemplate::implementation) S1_AddWithAPI (SDKTemplate) Scenario4_UnicodeExtensions (SDKTemplate)
BluetoothLEDeviceDisplay (SDKTemplate) S1_GetAFeed (Syndication) Scenario4_UpdatingLineDisplayAttributes (SDKTemplate)
BooleanToVisibilityConverter (SDKTemplate) S2_UpdateAndDeleteWithAPI (SDKTemplate) Scenario4PageRange (PrintSample)
BoolToVisibilityConverter (xBindSampleModel) S3_RetrieveWithAPI (SDKTemplate) Scenario5 (winrt::SDKTemplate::implementation)
Bread (Microsoft::SDKSamples::Kitchen) S4_CheckIndexRevision (SDKTemplate) Scenario5 (winrt::SDKTemplate::factory_implementation)
BroadbandDevice (MobileBroadband) S5_AddWithAppContent (SDKTemplate) Scenario5 (StreamSocketSample)
Helpers::BufferConverter (SDKTemplate) S6_DeleteWithAppContent (SDKTemplate) Scenario5 (SDKTemplate::WiFiDirectServices)
BufferHelper (WindowsPreview::Media::Capture::Frames) S7_RetrieveWithAppContent (SDKTemplate) Scenario5 (SDKTemplate)
BuildNewRss (Xml) SubjectPublicKeyInfo::SafeBCryptKeyHandle (MicrosoftPassport::Models) Scenario5 (PlaybackManager)
LoggingSessionScenario::BusySetter (winrt::SDKTemplate) SubjectPublicKeyInfo::SafeLocalAllocHandle (MicrosoftPassport::Models) Scenario5 (EdpSample)
FileLoggingSessionScenario::BusySetter (winrt::SDKTemplate) SampleBackgroundTask (Tasks) Scenario5 (DatagramSocketSample)
Button (HolographicMRCSample) SampleBackgroundTask (SDKTemplate) Scenario5 (Commanding)
Button (DX) SampleBackgroundTaskWithCondition (SDKTemplate) Scenario5_Capabilities (SDKTemplate)
C
SampleConstants (SDKTemplate) Scenario5_Clear (SDKTemplate)
CacheChangedEventArgs-g (DataVirtualizationSample) SampleDataModel (SDKTemplate) Scenario5_DataEventsBatching (SDKTemplate)
CachedFileUpdater_Local (FilePickerContracts) SampleDataModel (PivotCS) Scenario5_DefiningCustomGlyphs (SDKTemplate)
CachedFileUpdater_Remote (FilePickerContracts) SampleHelpers (winrt::SDKTemplate) Scenario5_DisplayingBarcodePreview (winrt::SDKTemplate::implementation)
CachedFileUpdaterPage (SDKTemplate) SampleOverlay (DWriteColorTextRenderer) Scenario5_DisplayingBarcodePreview (winrt::SDKTemplate::factory_implementation)
CachedFileUpdaterPageSizeChangedEventArgs (SDKTemplate) SampleOverlay (D2DGradientMesh) Scenario5_DisplayingBarcodePreview (SDKTemplate)
ItemCacheManager-g::CacheEntryBlock-g (DataVirtualizationSample) SampleOverlay (CustomVertexShader) Scenario5_GeofenceBackgroundTask (winrt::SDKTemplate::implementation)
CalibrationBar (SDKTemplate) SampleOverlay (CustomPixelShader) Scenario5_GeofenceBackgroundTask (winrt::SDKTemplate::factory_implementation)
CalibrationBar (Microsoft::Samples::Devices::Sensors::Calibration) SampleOverlay (CustomComputeShader) Scenario5_GeofenceBackgroundTask (SDKTemplate)
CalligraphicPen (SDKTemplate) SampleSmsBackgroundTask (SmsBackgroundTask) Scenario5_GetSingleDevice (winrt::SDKTemplate::implementation)
Camera SampleState (winrt::SDKTemplate) Scenario5_GetSingleDevice (winrt::SDKTemplate::factory_implementation)
CameraCoordinateMapper (CameraStreamCoordinateMapper) SaveStateEventArgs (SDKTemplate::Common) Scenario5_GetSingleDevice (SDKTemplate)
GpuCoordinateMapper::CameraIntrinsics (CameraStreamCoordinateMapper) SaveStateEventArgs (AdventureWorks::Common) Scenario5_InboxEffects (AudioCreation)
CameraResources (DX) SavingDataReason (SDKTemplate) Scenario5_InkingAndInteractionFeedback (winrt::SDKTemplate::implementation)
CameraResources (BasicHologram::Common) Scenario (SDKTemplate) Scenario5_InkingAndInteractionFeedback (winrt::SDKTemplate::factory_implementation)
CameraResources (_360VideoPlayback::Common) Scenario (SDKSample) Scenario5_InkingAndInteractionFeedback (SDKTemplate)
CameraRotationHelper (CameraStarterKit) Scenario (ScreenCasting) Scenario5_IsSupported (winrt::SDKTemplate::implementation)
CameraStreamCoordinateMapperMain (CameraStreamCoordinateMapper) Scenario (Notifications::Model) Scenario5_IsSupported (winrt::SDKTemplate::factory_implementation)
CameraStreamProcessor (CameraStreamCoordinateMapper) Scenario01 (ScreenCasting) Scenario5_IsSupported (SDKTemplate)
CancelCommand (SDKTemplate) Scenario01_GetText (winrt::SDKTemplate::implementation) Scenario5_LaunchedFromSecondaryTile (winrt::SDKTemplate::implementation)
CaptureDevice (SimpleCommunication) Scenario01_GetText (winrt::SDKTemplate::factory_implementation) Scenario5_LaunchedFromSecondaryTile (winrt::SDKTemplate::factory_implementation)
CAPTUREDEVICEPROPS (SDKSample::WASAPIAudio) Scenario01_GetText (SDKTemplate) Scenario5_LaunchedFromSecondaryTile (SDKTemplate)
CaptureFailedEventArgs (SDKTemplate) Scenario02 (ScreenCasting) Scenario5_Metadata (SDKTemplate)
CardDetails (Desfire) Scenario02_GetStream (winrt::SDKTemplate::implementation) Scenario5_Msappdata (winrt::SDKTemplate::implementation)
CardioidSound Scenario02_GetStream (winrt::SDKTemplate::factory_implementation) Scenario5_Msappdata (winrt::SDKTemplate::factory_implementation)
CardReader (NfcSample) Scenario02_GetStream (SDKTemplate) Scenario5_Msappdata (SDKTemplate)
CStreamSink::CAsyncOperation (Microsoft::Samples::SimpleCommunication) Scenario03 (ScreenCasting) Scenario5_NavToFiles (SDKTemplate)
CAsyncState Scenario03_GetList (winrt::SDKTemplate::implementation) Scenario5_RandomAccess (SDKTemplate)
CBaseAttributes (Microsoft::Samples::Common) Scenario03_GetList (winrt::SDKTemplate::factory_implementation) Scenario5_RelativePositioning (winrt::SDKTemplate::implementation)
CBufferEnumerator (Microsoft::Samples::SimpleCommunication::Network) Scenario03_GetList (SDKTemplate) Scenario5_RelativePositioning (winrt::SDKTemplate::factory_implementation)
CBufferPacket (Microsoft::Samples::SimpleCommunication::Network) Scenario04 (ScreenCasting) Scenario5_RelativePositioning (SDKTemplate)
ChatListView (SDKTemplate) Scenario04_PostText (winrt::SDKTemplate::implementation) Scenario5_RestoreScrollPosition (winrt::SDKTemplate::implementation)
Check (Felica) Scenario04_PostText (winrt::SDKTemplate::factory_implementation) Scenario5_RestoreScrollPosition (winrt::SDKTemplate::factory_implementation)
ClearTool (HolographicPaint) Scenario04_PostText (SDKTemplate) Scenario5_RestoreScrollPosition (SDKTemplate)
Cluster (SDKTemplate) Scenario05 (ScreenCasting) Scenario5_RoundingAndPadding (winrt::SDKTemplate::implementation)
CMarker (Microsoft::Samples::SimpleCommunication) Scenario05_PostStream (winrt::SDKTemplate::implementation) Scenario5_RoundingAndPadding (winrt::SDKTemplate::factory_implementation)
CMediaBufferWrapper (Microsoft::Samples::SimpleCommunication::Network) Scenario05_PostStream (winrt::SDKTemplate::factory_implementation) Scenario5_RoundingAndPadding (SDKTemplate)
CMediaSink (Microsoft::Samples::SimpleCommunication) Scenario05_PostStream (SDKTemplate) Scenario5_Show (SDKTemplate)
CMediaSource (Microsoft::Samples::SimpleCommunication) Scenario06 (ScreenCasting) Scenario5_TimeZone (winrt::SDKTemplate::implementation)
CMediaStream (Microsoft::Samples::SimpleCommunication) Scenario06_PostMultipart (winrt::SDKTemplate::implementation) Scenario5_TimeZone (winrt::SDKTemplate::factory_implementation)
CNetworkChannel (Microsoft::Samples::SimpleCommunication::Network) Scenario06_PostMultipart (winrt::SDKTemplate::factory_implementation) Scenario5_TimeZone (SDKTemplate)
Collections (OneHandedUse_TailoredMultipleViews::UserControls) Scenario06_PostMultipart (SDKTemplate) Scenario5_TriggerCFU (winrt::SDKTemplate::implementation)
ColorBGRA Scenario07_PostStreamWithProgress (winrt::SDKTemplate::implementation) Scenario5_TriggerCFU (winrt::SDKTemplate::factory_implementation)
ColorEntry (xBindSampleCS) Scenario07_PostStreamWithProgress (winrt::SDKTemplate::factory_implementation) Scenario5_TriggerCFU (SDKTemplate)
ColorToStringConverter (xBindSampleModel) Scenario07_PostStreamWithProgress (SDKTemplate) Scenario5_UnicodeExtensions (winrt::SDKTemplate::implementation)
ColorToStringConverter (BindTestbedModel) Scenario08_PostCustomContent (winrt::SDKTemplate::implementation) Scenario5_UnicodeExtensions (winrt::SDKTemplate::factory_implementation)
ComAutoRelease Scenario08_PostCustomContent (winrt::SDKTemplate::factory_implementation) Scenario5_UnicodeExtensions (SDKTemplate)
Helpers::CommonLicenseRequest (SDKTemplate) Scenario08_PostCustomContent (SDKTemplate) Scenario5_UsbDescriptors (CustomUsbDeviceAccess)
CompletedCallback (SDKTemplate) Scenario09_GetCookie (winrt::SDKTemplate::implementation) Scenario5_UserCollection (SDKTemplate)
CompletionGroupTask (Tasks) Scenario09_GetCookie (winrt::SDKTemplate::factory_implementation) Scenario5_VerifyResponse (winrt::SDKTemplate::implementation)
ComPtrList Scenario09_GetCookie (SDKTemplate) Scenario5_VerifyResponse (winrt::SDKTemplate::factory_implementation)
ConfigStore (HotspotAuthenticationTask) Scenario0_Choose (SDKTemplate) Scenario5_VerifyResponse (SDKTemplate)
ConnectedDevice (winrt::SDKTemplate::implementation) Scenario1 (winrt::SDKTemplate::implementation) Scenario5Photos (PrintSample)
ConnectedDevice (SDKTemplate) Scenario1 (winrt::SDKTemplate::factory_implementation) Scenario6 (winrt::SDKTemplate::implementation)
ConnectedTask (Osrusbfx2Task) Scenario1 (StreamSocketSample) Scenario6 (winrt::SDKTemplate::factory_implementation)
ConnectionSettingsPanel (winrt::SDKTemplate::implementation) Scenario1 (SplashScreenSample) Scenario6 (SDKTemplate)
ConnectionSettingsPanel (winrt::SDKTemplate::factory_implementation) Scenario1 (SimpleImaging) Scenario6 (PlaybackManager)
ConnectionSettingsPanel (SDKTemplate) Scenario1 (SDKTemplate::WiFiDirectServices) Scenario6 (EdpSample)
ConnectTask (winrt::BackgroundTask::implementation) Scenario1 (SDKTemplate) Scenario6 (Commanding)
ConnectTask (winrt::BackgroundTask::factory_implementation) Scenario1 (SDKSample) Scenario6_AdInsertion (SDKTemplate)
ConnectTask (BackgroundTask) Scenario1 (PlaybackManager) Scenario6_AppListingURI (SDKTemplate)
ConstantBufferChangeOnResize Scenario1 (PivotCS) Scenario6_ClearScenario (winrt::SDKTemplate::implementation)
ConstantBufferChangesEveryFrame Scenario1 (NfcProvisioner) Scenario6_ClearScenario (winrt::SDKTemplate::factory_implementation)
ConstantBufferChangesEveryPrim Scenario1 (ImportSample) Scenario6_ClearScenario (SDKTemplate)
ConstantBufferNeverChanges Scenario1 (EdpSample) Scenario6_CustomEffects (AudioCreation)
Constants (winrt::SDKTemplate) Scenario1 (DataVirtualizationSample) Scenario6_CustomFilterAddedProps (winrt::SDKTemplate::implementation)
Constants (SDKTemplate) Scenario1 (DatagramSocketSample) Scenario6_CustomFilterAddedProps (winrt::SDKTemplate::factory_implementation)
Contact (winrt::SDKTemplate::implementation) Scenario1 (Compression) Scenario6_CustomFilterAddedProps (SDKTemplate)
Contact (SDKTemplate) Scenario1 (Commanding) Scenario6_DeleteTPM (winrt::SDKTemplate::implementation)
EdgeTappedListView::ContainerEventTokens (winrt::SDKTemplate::implementation) Scenario1 (BasicMediaCasting) Scenario6_DeleteTPM (winrt::SDKTemplate::factory_implementation)
Content (SDKTemplate) Scenario1 (BackgroundMediaPlayback) Scenario6_DeleteTPM (SDKTemplate)
ContentSelector (SDKTemplate::Controls) Scenario1 (AllJoynProducerExperiences) Scenario6_GetLastVisit (winrt::SDKTemplate::implementation)
ContinuationPage (PrintSample) Scenario1 (AllJoynConsumerExperiences) Scenario6_GetLastVisit (winrt::SDKTemplate::factory_implementation)
ControlBase (HolographicMRCSample) Scenario10 (winrt::SDKTemplate::implementation) Scenario6_GetLastVisit (SDKTemplate)
ControlSizeTrigger (StateTriggersSample::CustomTriggers) Scenario10 (winrt::SDKTemplate::factory_implementation) Scenario6_InterfaceSettings (CustomUsbDeviceAccess)
Conversation (SDKTemplate) Scenario10 (SDKTemplate) Scenario6_ManipulatingCursorAttributes (SDKTemplate)
CopyFiles (winrt::SDKTemplate::implementation) Scenario10 (PlaybackManager) Scenario6_NavToStream (SDKTemplate)
CopyFiles (winrt::SDKTemplate::factory_implementation) Scenario10_CpToClipboard (EdpSample) Scenario6_NumeralSystemTranslation (winrt::SDKTemplate::implementation)
CopyFiles (SDKTemplate) Scenario10_SetCookie (winrt::SDKTemplate::implementation) Scenario6_NumeralSystemTranslation (winrt::SDKTemplate::factory_implementation)
CopyImage (winrt::SDKTemplate::implementation) Scenario10_SetCookie (winrt::SDKTemplate::factory_implementation) Scenario6_NumeralSystemTranslation (SDKTemplate)
CopyImage (winrt::SDKTemplate::factory_implementation) Scenario10_SetCookie (SDKTemplate) Scenario6_RecoverableErrors (SDKTemplate)
CopyImage (SDKTemplate) Scenario10_UnviewableContent (SDKTemplate) Scenario6_Recurrence (SDKTemplate)
CopyText (winrt::SDKTemplate::implementation) Scenario11 (winrt::SDKTemplate::implementation) Scenario6_ScrollIntoView (winrt::SDKTemplate::implementation)
CopyText (winrt::SDKTemplate::factory_implementation) Scenario11 (winrt::SDKTemplate::factory_implementation) Scenario6_ScrollIntoView (winrt::SDKTemplate::factory_implementation)
CopyText (SDKTemplate) Scenario11 (SDKTemplate) Scenario6_ScrollIntoView (SDKTemplate)
CritSec Scenario11_CPDNoUI (EdpSample) Scenario6_SecondaryTileNotification (winrt::SDKTemplate::implementation)
CSampleService Scenario11_DeleteCookie (winrt::SDKTemplate::implementation) Scenario6_SecondaryTileNotification (winrt::SDKTemplate::factory_implementation)
CSchemeHandler (Microsoft::Samples::SimpleCommunication) Scenario11_DeleteCookie (winrt::SDKTemplate::factory_implementation) Scenario6_SecondaryTileNotification (SDKTemplate)
CSendOperationStatus (anonymous_namespace{NetworkChannel.cpp}) Scenario11_DeleteCookie (SDKTemplate) Scenario6_TimeZone (winrt::SDKTemplate::implementation)
CServiceBase Scenario12 (SDKTemplate) Scenario6_TimeZone (winrt::SDKTemplate::factory_implementation)
CSetRateOperation (Microsoft::Samples::SimpleCommunication) Scenario12_DisableCookies (winrt::SDKTemplate::implementation) Scenario6_TimeZone (SDKTemplate)
CSharpModel (xBindSampleCS) Scenario12_DisableCookies (winrt::SDKTemplate::factory_implementation) Scenario6DisablePreview (PrintSample)
CMediaStream::CSourceLock Scenario12_DisableCookies (SDKTemplate) Scenario7 (winrt::SDKTemplate::implementation)
CSourceOperation (Microsoft::Samples::SimpleCommunication) Scenario12_ShareData (EdpSample) Scenario7 (winrt::SDKTemplate::factory_implementation)
CStartOperation (Microsoft::Samples::SimpleCommunication) Scenario13 (SDKTemplate) Scenario7 (SDKTemplate)
CStreamSink (Microsoft::Samples::SimpleCommunication) Scenario13_RetryFilter (winrt::SDKTemplate::implementation) Scenario7 (PlaybackManager)
CubeModelConstantBuffer (HolographicFaceTracker) Scenario13_RetryFilter (winrt::SDKTemplate::factory_implementation) Scenario7 (EdpSample)
Cursor (HolographicMRCSample) Scenario13_RetryFilter (SDKTemplate) Scenario7 (Commanding)
CustomCommand (SDKTemplate) Scenario13_ShareTarget (EdpSample) Scenario7_B2B (SDKTemplate)
CustomComputeShaderMain (CustomComputeShader) Scenario14_MeteredConnectionFilter (winrt::SDKTemplate::implementation) Scenario7_DeviceInformationKind (winrt::SDKTemplate::implementation)
CustomComputeShaderRenderer (CustomComputeShader) Scenario14_MeteredConnectionFilter (winrt::SDKTemplate::factory_implementation) Scenario7_DeviceInformationKind (winrt::SDKTemplate::factory_implementation)
CustomControlUsage (FocusVisualsSample) Scenario14_MeteredConnectionFilter (SDKTemplate) Scenario7_DeviceInformationKind (SDKTemplate)
CustomDecaySound Scenario14_QueryCpPaste (EdpSample) Scenario7_DownloadReordering (SDKTemplate)
CustomDevicePickerFilter (ScreenCasting::Util) Scenario15_DPLCreateFileEvents (EdpSample) Scenario7_ForegroundVisits (winrt::SDKTemplate::implementation)
CustomEditControl (SDKTemplate) Scenario15_ServerCertificateValidation (winrt::SDKTemplate::implementation) Scenario7_ForegroundVisits (winrt::SDKTemplate::factory_implementation)
CustomEffectState (winrt::SDKTemplate::implementation) Scenario15_ServerCertificateValidation (winrt::SDKTemplate::factory_implementation) Scenario7_ForegroundVisits (SDKTemplate)
CustomEffectState (SDKTemplate) Scenario15_ServerCertificateValidation (SDKTemplate) Scenario7_ListAllCards (winrt::SDKTemplate::implementation)
CustomException (WRLOutOfProcessWinRTComponent) Scenario16_NetworkResource (EdpSample) Scenario7_ListAllCards (winrt::SDKTemplate::factory_implementation)
CustomException (WRLInProcessWinRTComponent) Scenario1_AddAccount (SDKTemplate) Scenario7_ListAllCards (SDKTemplate)
CustomException (ProxyStubsForWinRTComponents) Scenario1_Advertiser (winrt::SDKTemplate::implementation) Scenario7_LiveSeekableRange (SDKTemplate)
CustomFocusVisuals (FocusVisualsSample) Scenario1_Advertiser (winrt::SDKTemplate::factory_implementation) Scenario7_PinFromAppbar (winrt::SDKTemplate::implementation)
CustomMediaTransportControls (CustomMediaTransportControls) Scenario1_Advertiser (SDKTemplate) Scenario7_PinFromAppbar (winrt::SDKTemplate::factory_implementation)
CustomOptionsPrintHelper (PrintSample) Scenario1_Analyze (winrt::SDKTemplate::implementation) Scenario7_PinFromAppbar (SDKTemplate)
CustomPixelShaderMain (CustomPixelShader) Scenario1_Analyze (winrt::SDKTemplate::factory_implementation) Scenario7_ScrollingContentUsingMarquee (SDKTemplate)
CustomPixelShaderRenderer (CustomPixelShader) Scenario1_Analyze (SDKTemplate) Scenario7_SetVersion (winrt::SDKTemplate::implementation)
CustomTextBox (winrt::SDKTemplate::implementation) Scenario1_BackgroundTask (BackgroundTask) Scenario7_SetVersion (winrt::SDKTemplate::factory_implementation)
CustomTextBox (winrt::SDKTemplate::factory_implementation) Scenario1_BankCards (MagneticStripeReaderSample) Scenario7_SetVersion (SDKTemplate)
CustomTextBox (SDKTemplate) Scenario1_Basic (winrt::SDKTemplate::implementation) Scenario7_Share (SDKTemplate)
CustomTextRenderer (DWriteColorTextRenderer) Scenario1_Basic (winrt::SDKTemplate::factory_implementation) Scenario7_SyncDevice (CustomUsbDeviceAccess)
CustomTitleBar (winrt::SDKTemplate::implementation) Scenario1_Basic (SDKTemplate) Scenario7_UsingUnicodeExtensions (winrt::SDKTemplate::implementation)
CustomTitleBar (winrt::SDKTemplate::factory_implementation) Scenario1_BasicFunctionality (winrt::SDKTemplate::implementation) Scenario7_UsingUnicodeExtensions (winrt::SDKTemplate::factory_implementation)
CustomTitleBar (SDKTemplate) Scenario1_BasicFunctionality (winrt::SDKTemplate::factory_implementation) Scenario7_UsingUnicodeExtensions (SDKTemplate)
CustomTrigger (SDKTemplate) Scenario1_BasicFunctionality (SDKTemplate) Scenario8 (winrt::SDKTemplate::implementation)
CustomVertexShaderMain (CustomVertexShader) Scenario1_Basics (winrt::SDKTemplate::implementation) Scenario8 (winrt::SDKTemplate::factory_implementation)
CustomVertexShaderRenderer (CustomVertexShader) Scenario1_Basics (winrt::SDKTemplate::factory_implementation) Scenario8 (SDKTemplate)
Cylinder Scenario1_Basics (SDKTemplate) Scenario8 (PlaybackManager)
CylinderMesh Scenario1_BasicUserActivity (SDKTemplate) Scenario8 (Commanding)
D
Scenario1_CachedNetworks (WiFiScan) Scenario8_CaptureBitmap (SDKTemplate)
D2DAdvancedColorImagesRenderer (D2DAdvancedColorImages) Scenario1_ChatClient (SDKTemplate) Scenario8_ClipboardSource (EdpSample)
D2DGradientMeshMain (D2DGradientMesh) Scenario1_Check (winrt::SDKTemplate::implementation) Scenario8_PairDevice (winrt::SDKTemplate::implementation)
D2DGradientMeshRenderer (D2DGradientMesh) Scenario1_Check (winrt::SDKTemplate::factory_implementation) Scenario8_PairDevice (winrt::SDKTemplate::factory_implementation)
D2DSvgImageRenderer (SDKTemplate) Scenario1_Check (SDKTemplate) Scenario8_PairDevice (SDKTemplate)
DAL (MicrosoftPassport::Server::Data) Scenario1_CheckConsentAvailability (winrt::SDKTemplate::implementation) Scenario8_TransferMediaPlayer1 (SDKTemplate)
DASHEntry (LiveDashApp) Scenario1_CheckConsentAvailability (winrt::SDKTemplate::factory_implementation) Scenario8_TransmitAPDU (winrt::SDKTemplate::implementation)
DashManifestParser (LiveDash::Util) Scenario1_CheckConsentAvailability (SDKTemplate) Scenario8_TransmitAPDU (winrt::SDKTemplate::factory_implementation)
DataHelpers (SDKTemplate) Scenario1_Colors (winrt::SDKTemplate::implementation) Scenario8_TransmitAPDU (SDKTemplate)
DataModel (xBindSampleModel) Scenario1_Colors (winrt::SDKTemplate::factory_implementation) Scenario8_UpdateAsync (winrt::SDKTemplate::implementation)
DateTimeOffsetConverter (AdventureWorks::Common) Scenario1_Colors (SDKTemplate) Scenario8_UpdateAsync (winrt::SDKTemplate::factory_implementation)
DDS_HEADER Scenario1_Configuration (SDKTemplate) Scenario8_UpdateAsync (SDKTemplate)
DDS_HEADER_DXT10 Scenario1_Configure (winrt::SDKTemplate::implementation) Scenario8_VisitsBackgroundTask (winrt::SDKTemplate::implementation)
DDS_PIXELFORMAT Scenario1_Configure (winrt::SDKTemplate::factory_implementation) Scenario8_VisitsBackgroundTask (winrt::SDKTemplate::factory_implementation)
DecodeEngine (BarcodeDecoder) Scenario1_Configure (SDKTemplate) Scenario8_VisitsBackgroundTask (SDKTemplate)
DecodeResult (BarcodeDecoder) Scenario1_ConfigureMobileHotspot (winrt::SDKTemplate::implementation) Scenario9 (winrt::SDKTemplate::implementation)
DefaultAccountScenario (Accounts) Scenario1_ConfigureMobileHotspot (winrt::SDKTemplate::factory_implementation) Scenario9 (winrt::SDKTemplate::factory_implementation)
DefaultCloseCommand (SDKTemplate) Scenario1_ConfigureMobileHotspot (SDKTemplate) Scenario9 (SDKTemplate)
DefaultKeys (MifareStandard) Scenario1_Connect (SocketActivityStreamSocket) Scenario9 (PlaybackManager)
DeferredControlTemplatePart (xDeferLoadStrategy) Scenario1_ConnectDisconnect (SerialArduino) Scenario9_ClipboardTarget (EdpSample)
DescriptorTypeEntry (CustomUsbDeviceAccess) Scenario1_ConnectDisconnect (CustomUsbDeviceAccess) Scenario9_ContainsFullScreenElement (SDKTemplate)
DesfireCommand (Desfire) Scenario1_ConnectDisconnect (CustomSerialDeviceAccess) Scenario9_CustomPairDevice (winrt::SDKTemplate::implementation)
DesfireResponse (Desfire) Scenario1_Conversion (TextSuggestion) Scenario9_CustomPairDevice (winrt::SDKTemplate::factory_implementation)
DetailPage (winrt::MasterDetailApp::implementation) Scenario1_Create (SDKTemplate) Scenario9_CustomPairDevice (SDKTemplate)
DetailPage (winrt::MasterDetailApp::factory_implementation) Scenario1_CreateContact (SDKTemplate) Scenario9_TransferMediaPlayer2 (SDKTemplate)
DetailPage (MasterDetailApp) Scenario1_CreateContacts (SDKTemplate) Scenario_CloudFontOverview (SDKTemplate)
DetailsPage (winrt::SDKTemplate::implementation) Scenario1_CreateTile (SDKTemplate) Scenario_ContinuousDictation (SDKTemplate)
DetailsPage (winrt::SDKTemplate::factory_implementation) Scenario1_CurrentActivity (SDKTemplate) Scenario_ContinuousRecognitionListGrammar (SDKTemplate)
DetailsPage (SDKTemplate) Scenario1_Data (winrt::SDKTemplate::implementation) Scenario_ContinuousRecognitionSRGSGrammar (SDKTemplate)
SuperMutt::Device (CustomHidDeviceAccess) Scenario1_Data (winrt::SDKTemplate::factory_implementation) Scenario_Document1 (SDKTemplate)
DeviceConfiguration (CustomSerialDeviceAccess) Scenario1_Data (SDKTemplate) Scenario_Document2 (SDKTemplate)
DeviceConnect (SDKTemplate) Scenario1_DataEvents (winrt::SDKTemplate::implementation) Scenario_Document3 (SDKTemplate)
DeviceConnect (CustomHidDeviceAccess) Scenario1_DataEvents (winrt::SDKTemplate::factory_implementation) Scenario_ListConstraint (SDKTemplate)
DeviceEvents (SDKTemplate) Scenario1_DataEvents (SimpleOrientationCS) Scenario_PauseAsync (SDKTemplate)
DeviceFamilyTrigger (StateTriggersSample::CustomTriggers) Scenario1_DataEvents (SDKTemplate) Scenario_PredefinedDictationGrammar (SDKTemplate)
DeviceHelpers (SDKTemplate) Scenario1_DataEvents (RelativeInclinometerCS) Scenario_PredefinedWebSearchGrammar (SDKTemplate)
DeviceInformationDisplay (winrt::SDKTemplate::implementation) Scenario1_DataEvents (ProximityCS) Scenario_SampleOverview (SDKTemplate)
DeviceInformationDisplay (SDKTemplate) Scenario1_DataEvents (LightSensorCS) Scenario_SRGSConstraint (SDKTemplate)
DeviceInformationKindChoice (winrt::SDKTemplate::implementation) Scenario1_DataEvents (InclinometerCS) Scenario_SynthesizeSSML (SDKTemplate)
DeviceInformationKindChoice (SDKTemplate) Scenario1_DataEvents (GyrometerCS) Scenario_SynthesizeText (SDKTemplate)
DeviceInformationKindChoices (winrt::SDKTemplate::implementation) Scenario1_DataEvents (CustomSensors) Scenario_SynthesizeTextBoundaries (SDKTemplate)
SuperMutt::DeviceInputReportControlInformation (CustomHidDeviceAccess) Scenario1_Default (SDKTemplate) ScenarioBindingConverter (SDKTemplate)
DeviceIO (SDKTemplate) Scenario1_Define (SDKTemplate) ScenarioCommon (SDKTemplate)
DeviceList (SDKTemplate) Scenario1_DetectInPhoto (winrt::SDKTemplate::implementation) ScenarioContext
DeviceListEntry (SerialArduino) Scenario1_DetectInPhoto (winrt::SDKTemplate::factory_implementation) ScenarioElement (OneNotifications_UWP::ScenarioPages::LiveTiles::BasicState::CheckAllPropertiesCorrect)
DeviceListEntry (SDKTemplate) Scenario1_DetectInPhoto (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::UpdateToast)
DeviceListEntry (CustomUsbDeviceAccess) Scenario1_DevicePicker (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::RemoveGroup::ByGroup)
DeviceListEntry (CustomSerialDeviceAccess) Scenario1_DevicePicker (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTagAndGroup)
DeviceListEntry (CustomHidDeviceAccess) Scenario1_DevicePicker (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::Remove::ByTag)
DeviceProperties (SerialArduino) Scenario1_DeviceUse (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::GetHistory::Visualizer)
DeviceProperties (CustomUsbDeviceAccess) Scenario1_Directions (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ToastNotificationManagerHistory::ClearAll)
DeviceProperties (CustomSerialDeviceAccess) Scenario1_Discovery (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Scenarios::Reminder)
DeviceProperties (CustomHidDeviceAccess) Scenario1_Discovery (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Scenarios::IncomingCall)
DEVICEPROPS (SDKSample::WASAPIAudio) Scenario1_Discovery (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Scenarios::Default)
DeviceReadWrite (SDKTemplate) Scenario1_DisplayDepthColorIR (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Scenarios::Alarm)
DeviceResources (DX) Scenario1_Download (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::RespondingToToasts)
DeviceResources (BasicHologram::Common) Scenario1_Enable (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::HistoryChangedTrigger::BadgeControl)
DeviceResources (_360VideoPlayback::Common) Scenario1_Enable (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::GhostToast)
DeviceSelectorChoices (winrt::SDKTemplate::implementation) Scenario1_Enable (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ExpiringToast)
DeviceSelectorInfo (winrt::SDKTemplate::implementation) Scenario1_EventAndMenuHookup (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Audio::Silent)
DeviceSelectorInfo (SDKTemplate) Scenario1_Events (PedometerCS) ScenarioElement (Notifications::ScenarioPages::Toasts::Audio::Looping)
DeviceStateChangedEventArgs (winrt::SDKTemplate::implementation) Scenario1_ExampleOperations (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Audio::EmailSound)
DeviceStateSourceT (winrt::SDKTemplate::implementation) Scenario1_ExtractTextSegments (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Audio::Default)
DeviceWatcherHelper (winrt::SDKTemplate) Scenario1_ExtractTextSegments (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromInternet)
DeviceWatcherHelper (SDKTemplate) Scenario1_ExtractTextSegments (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppPackage)
DftEffect Scenario1_Facebook (WebAuthentication) ScenarioElement (Notifications::ScenarioPages::Toasts::AdaptiveTemplates::Image::Src::FromAppData)
DftTransform Scenario1_FilePlayback (AudioCreation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::Snoozing)
DialLaunchArguments (ScreenCasting::Util) Scenario1_Files (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::CustomContent)
Dimensions (Microsoft::SDKSamples::Kitchen) Scenario1_Files (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Snooze::AutoContent)
DirectXApplicationSource Scenario1_Files (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::Dismissing)
DisablePreviewPrintHelper (PrintSample) Scenario1_FindClaimEnable (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::CustomContent)
DiscoveredDevice (winrt::SDKTemplate::implementation) Scenario1_FindId (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::System::Dismiss::AutoContent)
DiscoveredDevice (SDKTemplate) Scenario1_FindId (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::Protocol)
DiscoveredDeviceWrapper (SDKTemplate::WiFiDirectServices) Scenario1_FindId (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppOpen)
Disposer (BasicHologram::Common) Scenario1_FindUsers (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::ForegroundWithAppClosed)
Disposer (_360VideoPlayback::Common) Scenario1_FindUsers (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppOpen)
DistanceFieldRenderer (HolographicTagAlongSample) Scenario1_FindUsers (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::ActivationTypes::BackgroundWithAppClosed)
DOModel (xBindSampleModel) Scenario1_Geotag (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::SystemCommands::SnoozeAndDismiss)
DoubleToIntConverter (xBindSampleModel) Scenario1_GetAndSetPin (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::InputText::Title)
Downloader (LiveDash::Util) Scenario1_GetAndSetPin (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::InputText::RetrievingArgs)
DownloadOperationItem (SDKTemplate) Scenario1_GetAndSetPin (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::InputText::PlaceholderContent)
DWriteColorTextRendererMain (DWriteColorTextRenderer) Scenario1_GetDeviceInformation (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::InputText::DefaultInput)
DWriteColorTextRendererRenderer (DWriteColorTextRenderer) Scenario1_GetLamp (Lamp) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::Action::TextAndImage)
DynamicCommandBar (Commanding) Scenario1_Initialization (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::Action::Text)
E
Scenario1_InkCanvasTactileFeedback (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Toasts::Actions::Action::QuickReply)
EdgeTappedListView (winrt::SDKTemplate::implementation) Scenario1_InkCanvasTactileFeedback (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Updating)
EdgeTappedListView (winrt::SDKTemplate::factory_implementation) Scenario1_InkCanvasTactileFeedback (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::UnpinEverything)
EdgeTappedListView (SDKTemplate) Scenario1_Input (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Pinning)
EdpBackgroundTask (Tasks) Scenario1_LanguageDetection (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Notifications::SecondaryTiles)
ElementMargin (DX) Scenario1_LanguageDetection (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Sending)
Ellipse (DX) Scenario1_LanguageDetection (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Notifications::PrimaryTile::Clearing)
Email (xDeferLoadStrategy) Scenario1_Launch (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::Notifications::ExpiringNotification)
EmbeddedMFAsyncCallback (winrt::SDKTemplate) Scenario1_Launch (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::FindAllAsync::Visualizer)
Employee (xBindSampleModel) Scenario1_Launch (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppPackage)
EmployeeCollection (xBindSampleModel) Scenario1_Launched (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::BasicState::Logos::Source::AppData)
EmployeeDictionary (xBindSampleModel) Scenario1_Launched (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Transparent)
EnableHelloPage (SDKTemplate) Scenario1_Launched (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::InheritFromPrimary)
ensure_close (winrt::SDKTemplate) Scenario1_LaunchFile (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::BasicState::BackgroundColor::Custom)
Errors (winrt::SDKTemplate) Scenario1_ListView (DragAndDropSampleManaged) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextWrap)
Errors (SDKTemplate) Scenario1_LongAndShortFormats (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::TextStyles)
EventHandlerForDevice (SerialArduino) Scenario1_LongAndShortFormats (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromInternet)
EventHandlerForDevice (CustomUsbDeviceAccess) Scenario1_LongAndShortFormats (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppPackage)
EventHandlerForDevice (CustomSerialDeviceAccess) Scenario1_ManageHotspot (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Images::Source::FromAppData)
EventHandlerForDevice (CustomHidDeviceAccess) Scenario1_ManageHotspot (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Photos)
EventTests (xBindSampleCS) Scenario1_ManageHotspot (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::People)
ExitButton (DX) Scenario1_Message (CredentialPicker) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::HintPresentation::Contact)
ExtendedSplash (SplashScreenSample) Scenario1_Metrics (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Custom)
F
Scenario1_MIDIDeviceEnumeration (MIDI) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::None)
Face Scenario1_Mini (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::NameAndLogo)
FaceMesh Scenario1_MoveCertificate (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Name)
FaceTrackerProcessor (HolographicFaceTracker) Scenario1_MoveCertificate (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Logo)
FeatureReports (CustomHidDeviceAccess) Scenario1_MoveCertificate (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::LiveTiles::AdaptiveTemplates::Branding::Default)
FileDataSource (xBindSampleModel) Scenario1_MultiVideoPlayback (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Badges::Local::SecondaryTileBadges)
FileDataSource (DataVirtualizationSample) Scenario1_NavToUrl (SDKTemplate) ScenarioElement (Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeNumber)
FileDataSource2 (DataVirtualizationSample) Scenario1_NetworkConnectivity (winrt::SDKTemplate::implementation) ScenarioElement (Notifications::ScenarioPages::Badges::Local::PrimaryTile::SetBadgeGlyph)
FileExtensions (winrt::SDKTemplate) Scenario1_NetworkConnectivity (winrt::SDKTemplate::factory_implementation) ScenarioElement (Notifications::ScenarioPages::Badges::Local::PrimaryTile::ClearBadge)
FileExtensions (SDKTemplate) Scenario1_NetworkConnectivity (SDKTemplate) ScenarioGroup (Notifications::Model)
FileItem (xBindSampleModel) Scenario1_OpenDrawer (SDKTemplate) ScenarioPage (Notifications)
FileItem (DataVirtualizationSample) Scenario1_Orientation (winrt::SDKTemplate::implementation) SceneComposer (SDKTemplate)
FileLoggingSessionScenario (winrt::SDKTemplate) Scenario1_Orientation (winrt::SDKTemplate::factory_implementation) SceneController (HolographicSpatialStage)
FileLoggingSessionScenario (SDKTemplate) Scenario1_Orientation (SDKTemplate) SceneComposer::SceneObject (SDKTemplate)
FileOpenPicker_PickAppFile (FilePickerContracts) Scenario1_ParseAndStringify (winrt::SDKTemplate::implementation) SceneObject (HolographicSpatialStage)
FileOpenPicker_PickCachedFile (FilePickerContracts) Scenario1_ParseAndStringify (winrt::SDKTemplate::factory_implementation) School (winrt::SDKTemplate::implementation)
FileOpenPicker_PickURLFile (FilePickerContracts) Scenario1_ParseAndStringify (SDKTemplate) School (winrt::SDKTemplate::factory_implementation)
FileOpenPickerPage (SDKTemplate) Scenario1_PercentPermilleFormatting (winrt::SDKTemplate::implementation) School (SDKTemplate)
FileSavePicker_FailToSave (FilePickerContracts) Scenario1_PercentPermilleFormatting (winrt::SDKTemplate::factory_implementation) scope_exit (winrt::SDKTemplate)
FileSavePicker_SaveToAppStorage (FilePickerContracts) Scenario1_PercentPermilleFormatting (SDKTemplate) SdkSample (SDKTemplate)
FileSavePicker_SaveToCachedFile (FilePickerContracts) Scenario1_PinTile (winrt::SDKTemplate::implementation) SdrOverlayEffect
FileSavePickerPage (SDKTemplate) Scenario1_PinTile (winrt::SDKTemplate::factory_implementation) sealed (WindowsPreview::Media::Capture::Frames)
FileSavePickerPageSizeChangedEventArgs (SDKTemplate) Scenario1_PinTile (SDKTemplate) sealed (VoiceCommandService)
FilledEllipse (DX) Scenario1_Prefs (winrt::SDKTemplate::implementation) sealed (Tasks)
FilledRectangle (DX) Scenario1_Prefs (winrt::SDKTemplate::factory_implementation) sealed (Simple3DGameXaml)
FilmicEffect Scenario1_Prefs (SDKTemplate) sealed (Simple3DGameDX)
FilterConfig (MicrosoftPassport::Server) Scenario1_PreviewSettings (SDKTemplate) sealed
final (WindowsHolographicCodeSamples) Scenario1_Print (winrt::SDKTemplate::implementation) sealed (SDKTemplate::XmlLite)
FirmwareAccess (SDKTemplate) Scenario1_Print (winrt::SDKTemplate::factory_implementation) sealed (SDKTemplate::WRLOutOfProcessWinRTComponent)
FocusableElement (DX) Scenario1_Print (SDKTemplate) sealed (SDKTemplate::WRLInProcessWinRTComponent)
FocusPointConstantBuffer (_360VideoPlayback) Scenario1_ProvisionTPM (winrt::SDKTemplate::implementation) sealed (SDKTemplate::WiFiScan)
FontNameCollector (DWriteTextLayoutCloudFontImplementation) Scenario1_ProvisionTPM (winrt::SDKTemplate::factory_implementation) sealed (SDKTemplate::WiFiDirectServices)
CameraStreamProcessor::FrameData (CameraStreamCoordinateMapper) Scenario1_ProvisionTPM (SDKTemplate) sealed (SDKTemplate::Syndication)
FrameFormatModel (SDKTemplate) Scenario1_ReactiveRequest (SDKTemplate) sealed (SDKTemplate::StreamSocketSample)
FrameRenderer (SDKTemplate) Scenario1_ReadData (winrt::SDKTemplate::implementation) sealed::sealed (SDKTemplate)
FrameSourceGroupModel (SDKTemplate) Scenario1_ReadData (winrt::SDKTemplate::factory_implementation) sealed (SDKTemplate)
FrameSourceInfoModel (SDKTemplate) Scenario1_ReadData (SDKTemplate) Helpers::sealed (SDKTemplate)
FrameSourceState (SDKTemplate) Scenario1_Render (winrt::SDKTemplate::implementation) sealed (SDKTemplate::DatagramSocketSample)
Functions (xBindSampleCS) Scenario1_Render (winrt::SDKTemplate::factory_implementation) sealed (SDKTemplate::Compression)
Fx2Driver (SDKTemplate) Scenario1_Render (SDKTemplate) sealed (SDKSample::WASAPIAudio)
FxCompile (Microsoft::Build::Tasks) Scenario1_Save (winrt::SDKTemplate::implementation) sealed (SDKSample::SecondaryViewsHelpers)
G
Scenario1_Save (winrt::SDKTemplate::factory_implementation) sealed (SDKSample)
GameConfig Scenario1_Save (SDKTemplate) sealed (SDKSample::ProxyStubsForWinRTComponents)
GameHud Scenario1_SecondaryWindow (winrt::SDKTemplate::implementation) sealed (org::alljoyn::Onboarding)
GameInfoOverlay Scenario1_SecondaryWindow (winrt::SDKTemplate::factory_implementation) sealed (OpenCVBridge)
GameMain Scenario1_SecondaryWindow (SDKTemplate) sealed (NfcHceBackgroundTask)
GameObject Scenario1_SelectDisplay (SDKTemplate) sealed (MrcEffectDefinitions)
HolographicTemplateAppMain::GamepadWithButtonState (BasicHologram) Scenario1_Send (StreamSocketListenerServer) sealed (Microsoft::SDKSamples::Kitchen)
BasicHologramMain::GamepadWithButtonState (BasicHologram) Scenario1_SetRecordProfile (CameraProfile) sealed::sealed (Microsoft::Samples::SimpleCommunication)
GameRenderer Scenario1_SimpleListView (winrt::SDKTemplate::implementation) sealed (Microsoft::Samples::SimpleCommunication)
GameTimer Scenario1_SimpleListView (winrt::SDKTemplate::factory_implementation) sealed (Microsoft::Samples::SimpleCommunication::Network)
GeneralAuthenticate (Pcsc) Scenario1_SimpleListView (SDKTemplate) sealed (HolographicVoiceInput)
GeneralAuthenticate (MifareStandard) Scenario1_SimplestAdaptiveStreaming (SDKTemplate) sealed (HolographicTagAlongSample)
GeneratedBitmapState (winrt::SDKTemplate::implementation) Scenario1_Single (SDKTemplate) sealed (HolographicSpatialStage)
GeneratedBitmapState (SDKTemplate) Scenario1_SingleFile (winrt::SDKTemplate::implementation) sealed (HolographicSpatialMapping)
GeneratorIncrementalLoadingClass-g (DataBinding) Scenario1_SingleFile (winrt::SDKTemplate::factory_implementation) sealed (HolographicPaint)
GeoEquals (SDKTemplate) Scenario1_SingleFile (SDKTemplate) sealed (HolographicMRCSample)
GeofenceBackgroundTask (winrt::BackgroundTask::implementation) Scenario1_SpellingTextSuggestions (SDKTemplate) sealed (HolographicFaceTracker)
GeofenceBackgroundTask (winrt::BackgroundTask::factory_implementation) Scenario1_Toggle (winrt::SDKTemplate::implementation) sealed (FaceDetection)
GeofenceBackgroundTask (BackgroundTask) Scenario1_Toggle (winrt::SDKTemplate::factory_implementation) sealed (DWriteTextLayoutImplementation)
GetConnectionProfiles (MobileBroadband) Scenario1_Toggle (SDKTemplate) sealed (DWriteTextLayoutCloudFontImplementation)
GetData (Pcsc) Scenario1_TrackInWebcam (winrt::SDKTemplate::implementation) sealed (DWriteColorTextRenderer)
GetHistoricalBytes (Pcsc) Scenario1_TrackInWebcam (winrt::SDKTemplate::factory_implementation) sealed (DisplaySizeHelper)
GetHistoricalBytes (MifareUltralight) Scenario1_TrackInWebcam (SDKTemplate) sealed (D2DPhotoAdjustment)
GetHistoricalBytes (MifareStandard) Scenario1_TrackPosition (winrt::SDKTemplate::implementation) sealed (D2DGradientMesh)
GetHistoricalBytes (Iso15693) Scenario1_TrackPosition (winrt::SDKTemplate::factory_implementation) sealed (D2DAdvancedColorImages)
GetHistoricalBytes (Felica) Scenario1_TrackPosition (SDKTemplate) sealed (CustomVertexShader)
GetUid (Pcsc) Scenario1_TrialMode (SDKTemplate) sealed (CustomPixelShader)
GetUid (MifareUltralight) Scenario1_TrimAndSaveClip (MediaEditingSample) sealed (CustomComputeShader)
GetUid (MifareStandard) Scenario1_UIFonts (winrt::SDKTemplate::implementation) sealed (com::microsoft::Samples::SecureInterface)
GetUid (Iso15693) Scenario1_UIFonts (winrt::SDKTemplate::factory_implementation) sealed (CameraVideoStabilization)
GetUid (Felica) Scenario1_UIFonts (SDKTemplate) sealed (CameraStreamCoordinateMapper)
GiftDispatch (Xml) Scenario1_UTF8 (winrt::SDKTemplate::implementation) sealed (CameraStarterKit)
GpuCoordinateMapper (CameraStreamCoordinateMapper) Scenario1_UTF8 (winrt::SDKTemplate::factory_implementation) sealed (CameraGetPreviewFrame)
GpuPerformanceTimer (DX) Scenario1_UTF8 (SDKTemplate) sealed (CameraAdvancedCapture)
GroupedBackgroundTask (SDKTemplate) Scenario1_Watcher (BluetoothAdvertisement) sealed (BasicHologram)
GroupInfoList (winrt::SDKTemplate::implementation) Scenario1_Welcome (SDKTemplate) sealed (BarcodeDecoder)
GroupInfoList (winrt::SDKTemplate::factory_implementation) Scenario1_XmlReader (winrt::SDKTemplate::implementation) sealed (BackgroundTask)
GroupInfoList (SDKTemplate) Scenario1_XmlReader (winrt::SDKTemplate::factory_implementation) sealed (BackgroundDeviceWatcherTaskCpp)
GuidComparer (SDKTemplate) Scenario1Basic (PrintSample) sealed (AdventureWorks_Shared)
H
Scenario1ViewModel (AllJoynProducerExperiences) sealed (AdventureWorks)
HandHandler (HolographicPaint) Scenario1ViewModel (AllJoynConsumerExperiences) sealed (_360VideoPlayback)
handle_closer (anonymous_namespace{DDSTextureLoader.cpp}) Scenario2 (winrt::SDKTemplate::implementation) SecondaryAppWindowPage (winrt::SDKTemplate::implementation)
HardwareDRMViewModel (SDKTemplate::ViewModels) Scenario2 (winrt::SDKTemplate::factory_implementation) SecondaryAppWindowPage (winrt::SDKTemplate::factory_implementation)
HelperFunctions (SDKTemplate) Scenario2 (StreamSocketSample) SecondaryAppWindowPage (SDKTemplate)
Helpers (winrt::SDKTemplate) Scenario2 (SplashScreenSample) SecondaryPage (SDKTemplate)
Helpers (SDKTemplate) Scenario2 (SimpleImaging) SecondaryViewPage (winrt::SDKTemplate::implementation)
Helpers (_360VideoPlayback) Scenario2 (SDKTemplate::WiFiDirectServices) SecondaryViewPage (winrt::SDKTemplate::factory_implementation)
HeroArticlesViewModel (Transform3DAnimations::ViewModels) Scenario2 (SDKTemplate) SecondaryViewPage (SDKTemplate)
HighScoreEntry Scenario2 (SDKSample) SectionView (Transform3DAnimations)
HistoryAndRoaming (winrt::SDKTemplate::implementation) Scenario2 (PlaybackManager) SecureInterfaceService (AllJoynProducerExperiences)
HistoryAndRoaming (winrt::SDKTemplate::factory_implementation) Scenario2 (PivotCS) SecureStopViewModel (SDKTemplate::ViewModels)
HistoryAndRoaming (SDKTemplate) Scenario2 (EdpSample) SeekBarElement (DX)
HistoryRecord (PedometerCS) Scenario2 (DataVirtualizationSample) SelectCommand (Iso7816)
HolographicApp1Main (HolographicApp2) Scenario2 (DatagramSocketSample) SendTextMessage (SmsSendAndReceive)
HolographicFaceTrackerMain (HolographicFaceTracker) Scenario2 (Commanding) Helpers::ServiceStatusConverter (SDKTemplate)
HolographicMRCSampleMain (HolographicMRCSample) Scenario2 (BasicMediaCasting) ServiceViewModel (SDKTemplate)
HolographicPaintMain (HolographicPaint) Scenario2 (AllJoynProducerExperiences) ServicingComplete (Tasks)
HolographicSpatialMappingMain (HolographicSpatialMapping) Scenario2 (AllJoynConsumerExperiences) ServicingCompleteTask (SDKTemplate)
HolographicSpatialStageMain (HolographicSpatialStage) Scenario2_AamvaCards (MagneticStripeReaderSample) SessionRequestWrapper (SDKTemplate::WiFiDirectServices)
HolographicTagAlongSampleMain (HolographicTagAlongSample) Scenario2_Add (SDKTemplate) SessionWrapper (SDKTemplate::WiFiDirectServices)
HolographicTemplateAppMain (BasicHologram) Scenario2_AdvancedUserActivity (SDKTemplate) SetCardDataScenario (NfcSample)
HolographicVoiceInputMain (HolographicVoiceInput) Scenario2_AppendClips (MediaEditingSample) SetConnectedFunc (anonymous_namespace{StspMediaSink.cpp})
HomeController (MicrosoftPassport::Server::Controllers) Scenario2_BackgroundTask (SDKTemplate) SetErrorMessage (SDKTemplate)
HttpJsonContent (winrt::SDKTemplate::implementation) Scenario2_Binary (winrt::SDKTemplate::implementation) SetLockScreenImage (SDKTemplate)
HttpJsonContent (winrt::SDKTemplate::factory_implementation) Scenario2_Binary (winrt::SDKTemplate::factory_implementation) Settings (OneHandedUse_TailoredMultipleViews::UserControls)
HttpJsonContent (SDKTemplate) Scenario2_Binary (SDKTemplate) Settings (BackgroundMediaPlayback)
HttpMeteredConnectionFilter (winrt::HttpFilters::implementation) Scenario2_ChangePIN (winrt::SDKTemplate::implementation) SettingsService (BackgroundMediaPlayback::Services)
HttpMeteredConnectionFilter (winrt::HttpFilters::factory_implementation) Scenario2_ChangePIN (winrt::SDKTemplate::factory_implementation) SettingsViewModel (BackgroundMediaPlayback::ViewModels)
HttpRetryFilter (winrt::HttpFilters::implementation) Scenario2_ChangePIN (SDKTemplate) Shape (SDKTemplate)
HttpRetryFilter (winrt::HttpFilters::factory_implementation) Scenario2_ChatServer (SDKTemplate) SceneComposer::ShapeObject (SDKTemplate)
I
Scenario2_Client (winrt::SDKTemplate::implementation) ShapeRenderer (SDKTemplate)
IAppliance (Microsoft::SDKSamples::Kitchen) Scenario2_Client (winrt::SDKTemplate::factory_implementation) ShareApplicationLink (SDKTemplate)
IBread (Microsoft::SDKSamples::Kitchen) Scenario2_Client (SDKTemplate) ShareCustomData (SDKTemplate)
IBreadBakedEventArgs (Microsoft::SDKSamples::Kitchen) Scenario2_CloseDrawer (SDKTemplate) ShareCustomProvider (SDKTemplate)
IccDetection (Pcsc::Common) Scenario2_ConcurrentProfile (CameraProfile) ShareDelayRenderedFiles (SDKTemplate)
IControl (HolographicMRCSample) Scenario2_Conditional (SDKTemplate) ShareFiles (SDKTemplate)
IdentityChecker (Accounts) Scenario2_ConfigureDevice (CustomSerialDeviceAccess) ShareHtml (SDKTemplate)
InteropStatics::IDirect3DDxgiInterfaceAccess (BasicHologram::Common) Scenario2_Connector (winrt::SDKTemplate::implementation) ShareImage (SDKTemplate)
InteropStatics::IDirect3DDxgiInterfaceAccess (_360VideoPlayback::Common) Scenario2_Connector (winrt::SDKTemplate::factory_implementation) SharePage (SDKTemplate)
IDPadHelper (HolographicPaint) Scenario2_Connector (SDKTemplate) ShareTarget (SDKTemplate)
IEmployee (xBindSampleModel) Scenario2_ControlTransfer (CustomUsbDeviceAccess) ShareText (SDKTemplate)
IGameUIControl (Simple3DGameXaml) Scenario2_Custom (SDKTemplate) ShareWebLink (SDKTemplate)
IGameUIControl (Simple3DGameDX) Scenario2_DecimalFormatting (winrt::SDKTemplate::implementation) ShowConnection (MobileBroadband)
ILivePlayer (LiveDash) Scenario2_DecimalFormatting (winrt::SDKTemplate::factory_implementation) ShowPackageFamilyName (winrt::SDKTemplate::implementation)
ImageInfo (D2DAdvancedColorImages) Scenario2_DecimalFormatting (SDKTemplate) ShowPackageFamilyName (winrt::SDKTemplate::factory_implementation)
ImagePage (winrt::SDKTemplate::implementation) Scenario2_DelayMini (SDKTemplate) ShowPackageFamilyName (SDKTemplate)
ImagePage (winrt::SDKTemplate::factory_implementation) Scenario2_DetectInWebcam (winrt::SDKTemplate::implementation) ShutdownFunc (anonymous_namespace{StspMediaSink.cpp})
ImagePage (SDKTemplate) Scenario2_DetectInWebcam (winrt::SDKTemplate::factory_implementation) SignatureMessage (MicrosoftPassport::Models)
IMemoryBufferByteAccess (CustomEffect) Scenario2_DetectInWebcam (SDKTemplate) SignIn (SDKTemplate)
IMemoryBufferByteAccess (CameraGetPreviewFrame) Scenario2_DeviceCapture (AudioCreation) SimCard (MobileBroadband)
IMemoryBufferByteAccess (AudioCreation) Scenario2_DeviceWatcher (winrt::SDKTemplate::implementation) Simple3DGame
IMFAsyncCallback Scenario2_DeviceWatcher (winrt::SDKTemplate::factory_implementation) SimpleLogger (SDKTemplate)
IMFAttributes Scenario2_DeviceWatcher (SDKTemplate) SimpleTaskCompletionSource (winrt::SDKTemplate)
ImportableItemWrapper (ImportSample) Scenario2_Disable (winrt::SDKTemplate::implementation) SimpleTaskCompletionSource< void > (winrt::SDKTemplate)
INavigationService (AdventureWorks::Common) Scenario2_Disable (winrt::SDKTemplate::factory_implementation) ToneSampleGenerator::SineSampleInfo (winrt::SDKTemplate)
IncrementalLoadingBase (DataBinding) Scenario2_Disable (SDKTemplate) SingleAccountScenario (Accounts)
IncrementDecrement (Pcsc) Scenario2_Display (SDKTemplate) SingleAzureADScenario (Accounts)
INetworkClient (Microsoft::Samples::SimpleCommunication::Network) Scenario2_DisplayRegion (winrt::SDKTemplate::implementation) SingleMicrosoftAccountScenario (Accounts)
INetworkServer (Microsoft::Samples::SimpleCommunication::Network) Scenario2_DisplayRegion (winrt::SDKTemplate::factory_implementation) SizePreferenceString (winrt::SDKTemplate::implementation)
InkEventLogger Scenario2_DisplayRegion (SDKTemplate) SizePreferenceString (SDKTemplate)
SceneComposer::InkObject (SDKTemplate) Scenario2_DisplayText (SDKTemplate) SlowInputStream (winrt::SDKTemplate::implementation)
InkRenderer (SDKTemplate) Scenario2_DocumentFonts (winrt::SDKTemplate::implementation) SlowInputStream (winrt::SDKTemplate::factory_implementation)
InputOutputReports (CustomHidDeviceAccess) Scenario2_DocumentFonts (winrt::SDKTemplate::factory_implementation) SlowInputStream (SDKTemplate)
InputReportEvents (CustomHidDeviceAccess) Scenario2_DocumentFonts (SDKTemplate) SmartCardListItem (winrt::SDKTemplate::implementation)
InputTypeTrigger (StateTriggersSample::CustomTriggers) Scenario2_DragUICustomization (DragAndDropSampleManaged) SmartCardListItem (winrt::SDKTemplate::factory_implementation)
InstructionControl (Notifications::Controls) Scenario2_Effects (winrt::SDKTemplate::implementation) SmartCardListItem (SDKTemplate)
InstructionsControl (Notifications::Controls) Scenario2_Effects (winrt::SDKTemplate::factory_implementation) SmartCardReaderUtils (Pcsc)
int24in32 Scenario2_Effects (SDKTemplate) SocialMediaCounter (FocusVisualsSample)
IntToDoubleConverter (xBindSampleModel) Scenario2_EnableSettings (Lamp) SocketActivityTask (SocketActivityBackgroundTask)
InvalidPageException (SDKTemplate) Scenario2_Engage (SDKTemplate) SocketReaderWriter (winrt::SDKTemplate)
InvalidPageException (PrintSample) Scenario2_EventHandlers (SDKTemplate) SocketReaderWriter (SDKTemplate)
InvertBoolConverter (CameraManualControls) Scenario2_Extend (winrt::SDKTemplate::implementation) SocketWrapper (SDKTemplate::WiFiDirectServices)
IOnboardingConsumer (org::alljoyn::Onboarding) Scenario2_Extend (winrt::SDKTemplate::factory_implementation) SoundEffect
IOnboardingLegacySignals (org::alljoyn::Onboarding) Scenario2_Extend (SDKTemplate) SourceBufferManager (LiveDash)
IOnboardingProducer (org::alljoyn::Onboarding) Scenario2_FindAvailableSourceGroups (SDKTemplate) SourceGroupCollection (SDKTemplate)
IOnboardingService (org::alljoyn::Onboarding) Scenario2_GetCurrentTextSegmentFromIndex (winrt::SDKTemplate::implementation) SourceHandler (HolographicPaint)
IOnboardingSignals (org::alljoyn::Onboarding) Scenario2_GetCurrentTextSegmentFromIndex (winrt::SDKTemplate::factory_implementation) SpatialControllerHandler (HolographicPaint)
IoSyncBackgroundTask (BackgroundTask) Scenario2_GetCurrentTextSegmentFromIndex (SDKTemplate) SpatialInputHandler (HolographicVoiceInput)
IOven (Microsoft::SDKSamples::Kitchen) Scenario2_GetPosition (winrt::SDKTemplate::implementation) SpatialInputHandler (HolographicTagAlongSample)
IOvenFactory (Microsoft::SDKSamples::Kitchen) Scenario2_GetPosition (winrt::SDKTemplate::factory_implementation) SpatialInputHandler (HolographicSpatialMapping)
IsApiPropertyPresentTrigger (SDKTemplate) Scenario2_GetPosition (SDKTemplate) SpatialInputHandler (HolographicMRCSample)
IScenario (Notifications::Model) Scenario2_History (SDKTemplate) SpatialInputHandler (BasicHologram)
ISecureInterfaceConsumer (com::microsoft::Samples::SecureInterface) Scenario2_History (PedometerCS) SpatialInputHandler (BasicHologram::Common)
ISecureInterfaceLegacySignals (com::microsoft::Samples::SecureInterface) Scenario2_InAppPurchase (SDKTemplate) SpatialInputHandler (_360VideoPlayback)
ISecureInterfaceProducer (com::microsoft::Samples::SecureInterface) Scenario2_Lang (winrt::SDKTemplate::implementation) SpatialInputHandler (_360VideoPlayback::Common)
ISecureInterfaceService (com::microsoft::Samples::SecureInterface) Scenario2_Lang (winrt::SDKTemplate::factory_implementation) SpatialStageManager (HolographicSpatialStage)
ISecureInterfaceSignals (com::microsoft::Samples::SecureInterface) Scenario2_Lang (SDKTemplate) Sphere
ISignalEmitter (org::alljoyn::Onboarding) Scenario2_Launch (winrt::SDKTemplate::implementation) SphereMesh
ISignalEmitter (com::microsoft::Samples::SecureInterface) Scenario2_Launch (winrt::SDKTemplate::factory_implementation) SpinningCubeRenderer (HolographicVoiceInput)
ISinkCallback (Microsoft::Samples::SimpleCommunication) Scenario2_Launch (SDKTemplate) SpinningCubeRenderer (HolographicMRCSample)
Item (winrt::SDKTemplate::implementation) Scenario2_LaunchUri (SDKTemplate) SpinningCubeRenderer (HolographicFaceTracker)
Item (winrt::MasterDetailApp::Data::implementation) Scenario2_LEDTemp (SerialArduino) SpinningCubeRenderer (BasicHologram)
Item (winrt::MasterDetailApp::Data::factory_implementation) Scenario2_Listen (winrt::SDKTemplate::implementation) SpinningCubeRenderer (BasicHologram::Content)
Item (SDKTemplate) Scenario2_Listen (winrt::SDKTemplate::factory_implementation) Stroke::Square (HolographicPaint)
Item (MasterDetailApp::Data) Scenario2_Listen (SDKTemplate) StandardOptionsPrintHelper (PrintSample)
ItemCacheManager-g (DataVirtualizationSample) Scenario2_Load (SDKTemplate) StartFunc (anonymous_namespace{StspMediaSink.cpp})
ItemDetails (SDKTemplate) Scenario2_Manage (winrt::SDKTemplate::implementation) Status (SDKTemplate)
ItemIndexRangeList (DataVirtualizationSample) Scenario2_Manage (winrt::SDKTemplate::factory_implementation) StepsControl (Notifications::Controls)
ItemList (SDKTemplate) Scenario2_Manage (SDKTemplate) StepsHelperControl (Notifications::Controls)
ItemsDataProvider (ScreenCasting::Data::Common) Scenario2_ManageAccount (SDKTemplate) StepTimer (DX)
ItemsDataSource (winrt::MasterDetailApp) Scenario2_Memory (winrt::SDKTemplate::implementation) StepTimer (BasicHologram::Common)
ItemsDataSource (MasterDetailApp::Data) Scenario2_Memory (winrt::SDKTemplate::factory_implementation) StepTimer (_360VideoPlayback::Common)
ItemTemplateControl (StateTriggersSample) Scenario2_Memory (SDKTemplate) STEREO_PARAMETERS
ItemViewModel (winrt::MasterDetailApp::ViewModels::implementation) Scenario2_MessageCaption (CredentialPicker) StopFunc (anonymous_namespace{StspMediaSink.cpp})
ItemViewModel (winrt::MasterDetailApp::ViewModels::factory_implementation) Scenario2_MultiFile (winrt::SDKTemplate::implementation) sealed::StreamFilteringCriteria (SDKTemplate)
ItemViewModel (MasterDetailApp::ViewModels) Scenario2_MultiFile (winrt::SDKTemplate::factory_implementation) StreamResolution (SDKTemplate)
IUIContentRootClone Scenario2_MultiFile (SDKTemplate) StreamSocketListenerWrapper (SDKTemplate::WiFiDirectServices)
J
Scenario2_Multiple (SDKTemplate) Scenario6_NavToStream::StreamUriWinRTResolver (SDKTemplate)
JsonRequest (SDKTemplate) Scenario2_MultipleScanners (winrt::SDKTemplate::implementation) StringTrimmer
K
Scenario2_MultipleScanners (winrt::SDKTemplate::factory_implementation) StringTrimmer (SDKTemplate)
KeepConnectionOpenScenario (winrt::SDKTemplate::implementation) Scenario2_MultipleScanners (SDKTemplate) Stroke (HolographicPaint)
KeepConnectionOpenScenario (winrt::SDKTemplate::factory_implementation) Scenario2_NavToString (SDKTemplate) StspDescription (Microsoft::Samples::SimpleCommunication)
KeepConnectionOpenScenario (SDKTemplate) Scenario2_NetworkCost (winrt::SDKTemplate::implementation) StspOperationHeader (Microsoft::Samples::SimpleCommunication)
L
Scenario2_NetworkCost (winrt::SDKTemplate::factory_implementation) StspSampleHeader (Microsoft::Samples::SimpleCommunication)
LampArrayInfo (winrt::SDKTemplate) Scenario2_NetworkCost (SDKTemplate) StspStreamDescription (Microsoft::Samples::SimpleCommunication)
LampArrayInfo (SDKTemplate) Scenario2_Notifications (winrt::SDKTemplate::implementation) SubjectPublicKeyInfo (MicrosoftPassport::Models)
LARGE_INTEGER Scenario2_Notifications (winrt::SDKTemplate::factory_implementation) SubPage (SDKTemplate)
SuperMutt::LedPattern (CustomHidDeviceAccess) Scenario2_Notifications (SDKTemplate) SuperMutt (CustomUsbDeviceAccess)
Level Scenario2_PhotoSettings (SDKTemplate) SuperMutt (CustomHidDeviceAccess)
Level1 Scenario2_Polling (winrt::SDKTemplate::implementation) SurfaceMeshProperties (WindowsHolographicCodeSamples)
Level2 Scenario2_Polling (winrt::SDKTemplate::factory_implementation) SuspensionManager (SDKTemplate::Common)
Level3 Scenario2_Polling (SimpleOrientationCS) SuspensionManager (AdventureWorks::Common)
Level4 Scenario2_Polling (SDKTemplate) SuspensionManagerException (SDKTemplate::Common)
Level5 Scenario2_Polling (RelativeInclinometerCS) SuspensionManagerException (AdventureWorks::Common)
Level6 Scenario2_Polling (ProximityCS) SymbologyListEntry (winrt::SDKTemplate::implementation)
Line (DX) Scenario2_Polling (LightSensorCS) SymbologyListEntry (winrt::SDKTemplate::factory_implementation)
LineSegment Scenario2_Polling (InclinometerCS) SymbologyListEntry (SDKTemplate)
LinguisticServices (winrt::Sample::implementation) Scenario2_Polling (GyrometerCS) Sync (BackgroundTask)
LinguisticServices (winrt::Sample::factory_implementation) Scenario2_Polling (CustomSensors) SyncBackgroundTaskInformation (CustomUsbDeviceAccess)
List Scenario2_Prediction (TextSuggestion)
T
Listener (DWriteTextLayoutCloudFontImplementation) Scenario2_PrintReceipt (SDKTemplate) TabHeader (PivotCS)
ListsAndTemplates (xBindSampleCS) Scenario2_ProactiveRequest (SDKTemplate) TangentVertex
ListViewEdgeTappedEventArgs (winrt::SDKTemplate::implementation) Scenario2_Publisher (BluetoothAdvertisement) TargetTexture
ListViewEdgeTappedEventArgs (SDKTemplate) Scenario2_ReceiveContact (SDKTemplate) Templates (xBindSampleCS)
LiveDashPlayer (LiveDashApp) Scenario2_ReceiveMIDIMessages (MIDI) Text (DX)
LiveDashPlayer (LiveDash) Scenario2_Remove (winrt::SDKTemplate::implementation) TextMessage (SDKTemplate)
LiveSourceBufferManager (LiveDash) Scenario2_Remove (winrt::SDKTemplate::factory_implementation) TextRenderer (HolographicTagAlongSample)
LoadKey (MifareStandard) Scenario2_Remove (SDKTemplate) TextRenderer (HolographicFaceTracker)
LoadKeys (Pcsc) Scenario2_RequestConsent (winrt::SDKTemplate::implementation) TextRenderer (CameraStreamCoordinateMapper)
LoadStateEventArgs (SDKTemplate::Common) Scenario2_RequestConsent (winrt::SDKTemplate::factory_implementation) TextureData (DX)
LoadStateEventArgs (AdventureWorks::Common) Scenario2_RequestConsent (SDKTemplate) ThumbstickDPadHelper (HolographicPaint)
LocalHostItem (StreamSocketSample) Scenario2_RequestMany (winrt::SDKTemplate::implementation) TilesHelper (Notifications::Helpers)
LocalHostItem (DatagramSocketSample) Scenario2_RequestMany (winrt::SDKTemplate::factory_implementation) TimeTriggeredTask (SDKTemplate)
LocalSettingKeys (CustomUsbDeviceAccess) Scenario2_RequestMany (SDKTemplate) TitledImage (xDeferLoadStrategy)
LocalSettingKeys (BackgroundTask) Scenario2_Scan (WiFiScan) TlvEntry
LocationBackgroundTask (winrt::BackgroundTask::implementation) Scenario2_ScopedViews (SDKTemplate) ToastActivationTypeBackgroundClosedTask (BackgroundTasks)
LocationBackgroundTask (winrt::BackgroundTask::factory_implementation) Scenario2_ScriptDetection (winrt::SDKTemplate::implementation) ToastNotificationHistoryChangedTriggerTask (BackgroundTasks)
LocationBackgroundTask (BackgroundTask) Scenario2_ScriptDetection (winrt::SDKTemplate::factory_implementation) ToastNotificationQuickReplyTask (BackgroundTasks)
LocationTrackingReason (SDKTemplate) Scenario2_ScriptDetection (SDKTemplate) ToneSampleGenerator (winrt::SDKTemplate)
LoggingChannelScenario (winrt::SDKTemplate) Scenario2_Settings (winrt::SDKTemplate::implementation) ToneSampleGenerator (SDKSample::WASAPIAudio)
LoggingChannelScenario (SDKTemplate) Scenario2_Settings (winrt::SDKTemplate::factory_implementation) Tool (HolographicPaint)
LoggingScenarioEventArgs (winrt::SDKTemplate::implementation) Scenario2_Settings (SDKTemplate) ToolCarousel (HolographicPaint)
LoggingScenarioEventArgs (SDKTemplate) Scenario2_ShakeEvents (SDKTemplate) TouchpadDPadHelper (HolographicPaint)
LoggingSessionScenario (winrt::SDKTemplate) Scenario2_ShowHideEvents (winrt::SDKTemplate::implementation) TrackedPose (WindowsPreview::Media::Capture::Frames)
LoggingSessionScenario (SDKTemplate) Scenario2_ShowHideEvents (winrt::SDKTemplate::factory_implementation) TrackedPose (MFPoseTrackingPreview)
LookupTable (SDKTemplate) Scenario2_ShowHideEvents (SDKTemplate) TrackingEventCue (SDKTemplate)
LowLatency (SimpleCommunication) Scenario2_SimpleGridView (winrt::SDKTemplate::implementation) TransparentExchange (Pcsc)
LowLatencyInputMain (SDKTemplate) Scenario2_SimpleGridView (winrt::SDKTemplate::factory_implementation) TransparentExchangeResponse (Pcsc)
LuminanceHeatmapEffect Scenario2_SimpleGridView (SDKTemplate) TransportOptions (SDKTemplate)
M
Scenario2_Stats (winrt::SDKTemplate::implementation) Trip (AdventureWorks::Model)
MainPage (Transform3DAnimations) Scenario2_Stats (winrt::SDKTemplate::factory_implementation) TripDetails (AdventureWorks::View)
MainPage (StateTriggersSample) Scenario2_Stats (SDKTemplate) TripListView (AdventureWorks::View)
MainPage (SDKTemplate) Scenario2_StringTemplate (winrt::SDKTemplate::implementation) TripListViewModel (AdventureWorks::ViewModel)
MainPage (SDKSample) Scenario2_StringTemplate (winrt::SDKTemplate::factory_implementation) TripStore (AdventureWorks::Model)
MainPage (ScreenCasting) Scenario2_StringTemplate (SDKTemplate) TripViewModel (AdventureWorks::ViewModel)
MainPage (OneHandedUse_TailoredMultipleViews) Scenario2_SupportedTactileFeedback (winrt::SDKTemplate::implementation) TripVoiceCommand (AdventureWorks::ViewModel)
MainPage (Notifications) Scenario2_SupportedTactileFeedback (winrt::SDKTemplate::factory_implementation) Turn
MainPage (FaceDetection) Scenario2_SupportedTactileFeedback (SDKTemplate) TypeConversionHelpers
MainPage (CustomMediaTransportControls) Scenario2_SynchronizingPlayers (SDKTemplate) TypeToUIElementConverter (Notifications::Converters)
MainPage (CameraVideoStabilization) Scenario2_SystemDefaultMenu (SDKTemplate)
U
MainPage (CameraStarterKit) Scenario2_ToggleMobileHotspot (winrt::SDKTemplate::implementation) UnhandledExceptionPage (ScreenCasting)
MainPage (CameraManualControls) Scenario2_ToggleMobileHotspot (winrt::SDKTemplate::factory_implementation) unique_bag (ELS::Private)
MainPage (CameraGetPreviewFrame) Scenario2_ToggleMobileHotspot (SDKTemplate) unique_cotaskmem_ptr (winrt::SDKTemplate)
MainPage (CameraAdvancedCapture) Scenario2_Twitter (WebAuthentication) unique_disabled_control (winrt::SDKTemplate)
MainPage (_360VideoPlayback) Scenario2_UnpinTile (winrt::SDKTemplate::implementation) unique_services (ELS::Private)
MainPage_CachedFile (FilePickerContracts) Scenario2_UnpinTile (winrt::SDKTemplate::factory_implementation) unique_shared_work_queue (winrt::SDKTemplate)
MainPage_OneHanded (OneHandedUse_TailoredMultipleViews) Scenario2_UnpinTile (SDKTemplate) UnspecifiedReason (SDKTemplate)
MainPage_PickFile (FilePickerContracts) Scenario2_Upload (SDKTemplate) Update (Felica)
MainPage_SaveFile (FilePickerContracts) Scenario2_WatchUsers (winrt::SDKTemplate::implementation) UpdateBinary (Pcsc)
MainPageSizeChangedEventArgs (SDKTemplate) Scenario2_WatchUsers (winrt::SDKTemplate::factory_implementation) UpdateFileTask (FilePickerContractsTasks)
MainViewModel (StateTriggersSample::ViewModel) Scenario2_WatchUsers (SDKTemplate) UpdateFourTilesControl (Notifications::Controls)
MainViewModel (OneHandedUse_TailoredMultipleViews::ViewModel) Scenario2_XmlWriter (winrt::SDKTemplate::implementation) UpdateMetadataTask (winrt::BackgroundTask::implementation)
ManageCardScenario (NfcSample) Scenario2_XmlWriter (winrt::SDKTemplate::factory_implementation) UpdateMetadataTask (winrt::BackgroundTask::factory_implementation)
Manager (xBindSampleModel) Scenario2StandardOptions (PrintSample) UpdateMetadataTask (BackgroundTask)
ManageSession (Pcsc) Scenario2ViewModel (AllJoynProducerExperiences) User (winrt::SDKTemplate::implementation)
ManageSessionResponse (Pcsc) Scenario2ViewModel (AllJoynConsumerExperiences) User (winrt::SDKTemplate::factory_implementation)
Manifest (LiveDash::Models) Scenario3 (winrt::SDKTemplate::implementation) User (SDKTemplate)
ManipulationInputProcessor (SDKTemplate) Scenario3 (winrt::SDKTemplate::factory_implementation) UserAndKeyHintMessage (MicrosoftPassport::Models)
MapChangedEventArgs-g (xBindSampleModel) Scenario3 (StreamSocketSample) UserSelect (SDKTemplate)
MarkHotProducts (Xml) Scenario3 (SDKTemplate::WiFiDirectServices) UserViewModel (winrt::SDKTemplate::implementation)
MasterDetailPage (winrt::MasterDetailApp::implementation) Scenario3 (SDKTemplate) UserViewModel (SDKTemplate)
MasterDetailPage (winrt::MasterDetailApp::factory_implementation) Scenario3 (SDKSample) Util (SDKTemplate)
MasterDetailPage (MasterDetailApp) Scenario3 (PlaybackManager) Utilities (SerialArduino)
Material Scenario3 (PivotCS) Utilities (CustomUsbDeviceAccess)
Matrix4x4 Scenario3 (EdpSample) Utilities (CustomSerialDeviceAccess)
MediaCaptureManager (HolographicMRCSample) Scenario3 (DatagramSocketSample) Utilities (CustomHidDeviceAccess)
MediaCapturePreviewer (SDKTemplate) Scenario3 (Commanding) Utils (winrt::SDKTemplate::implementation)
MediaFoundationConstants (SDKTemplate) Scenario3 (BasicMediaCasting) Utils (winrt::SDKTemplate::factory_implementation)
MediaFoundationInitializer (winrt::SDKTemplate) Scenario3_ActiveSymbologies (winrt::SDKTemplate::implementation)
V
MediaItem (BackgroundMediaPlayback::DataModels) Scenario3_ActiveSymbologies (winrt::SDKTemplate::factory_implementation) Vector2
MediaItemViewModel (BackgroundMediaPlayback::ViewModels) Scenario3_ActiveSymbologies (SDKTemplate) Vector3
MediaList (BackgroundMediaPlayback::DataModels) Scenario3_AdaptiveCard (SDKTemplate) Vector4
MediaListViewModel (BackgroundMediaPlayback::ViewModels) Scenario3_AdaptiveSync (SDKTemplate) VectorChangedEventArgs (xBindSampleModel)
MediaModel (SDKTemplate) Scenario3_Add (SDKTemplate) SuperMutt::VendorCommand (CustomUsbDeviceAccess)
MediaReader Scenario3_AddAudioTracks (MediaEditingSample) WaveEffect::Vertex
MediaSegment (LiveDash::Models) Scenario3_AppCapture (winrt::SDKTemplate::implementation) VertexPosition (HolographicPaint)
MediaSegmentInformation (LiveDash::Models) Scenario3_AppCapture (winrt::SDKTemplate::factory_implementation) VertexPosition (HolographicMRCSample)
MediaStream (LiveDash::Models) Scenario3_AppCapture (SDKTemplate) VertexPositionColor (WindowsHolographicCodeSamples)
MediaTransportControls (_360VideoPlayback) Scenario3_AspectRatio (SDKTemplate) VertexPositionColor (HolographicVoiceInput)
MediaTransportControlsWithCustomCastButton (ScreenCasting::Controls) Scenario3_AvailabilityChanged (Lamp) VertexPositionColor (HolographicSpatialStage)
MediaTypeValidationDescriptor (anonymous_namespace{Validation.cpp}) Scenario3_BackgroundDeviceWatcher (winrt::SDKTemplate::implementation) VertexPositionColor (HolographicMRCSample)
MemDelete Scenario3_BackgroundDeviceWatcher (winrt::SDKTemplate::factory_implementation) VertexPositionColor (HolographicFaceTracker)
MeshGeometry (DX) Scenario3_BackgroundDeviceWatcher (SDKTemplate) VertexPositionColor (BasicHologram)
MeshObject Scenario3_BackgroundTask (winrt::SDKTemplate::implementation) VertexPositionColor (BasicHologram::Content)
Metering (RpcServer) Scenario3_BackgroundTask (winrt::SDKTemplate::factory_implementation) VertexPositionColor (_360VideoPlayback::Content)
METERING_CONTEXT Scenario3_BackgroundTask (SDKTemplate) VertexPositionColorTex (HolographicTagAlongSample)
MeteringData (SDKTemplate) Scenario3_BackgroundWatcher (BluetoothAdvertisement) VertexPositionNormalColor (WindowsHolographicCodeSamples)
MEUserControl (SDKTemplate) Scenario3_BgChatServer (SDKTemplate) VertexPositionTex (HolographicFaceTracker)
MFSampleGenerator (winrt::SDKTemplate) Scenario3_Calibration (SDKTemplate) VertexPositionTex (CameraStreamCoordinateMapper)
MFSampleGenerator (SDKSample::WASAPIAudio) Scenario3_Calibration (InclinometerCS) VertexPositionTexture (HolographicMRCSample)
MidiDeviceWatcher (MIDI) Scenario3_ChangeEvents (SDKTemplate) VertexPositionTexture (_360VideoPlayback)
MockUIContentRoot Scenario3_CheckUserConsentGroup (winrt::SDKTemplate::implementation) VertexPositionTexture (_360VideoPlayback::Content)
Model (StateTriggersSample::ViewModel) Scenario3_CheckUserConsentGroup (winrt::SDKTemplate::factory_implementation) VeryObservableCollection-g (BindTestbedModel)
Model (OneHandedUse_TailoredMultipleViews::ViewModel) Scenario3_CheckUserConsentGroup (SDKTemplate) VideoChat (SimpleCommunication)
ModelColorConstantBuffer (HolographicVoiceInput) Scenario3_ChooseControl (SDKTemplate) VideoFrameProcessor (HolographicFaceTracker)
ModelColorConstantBuffer (HolographicMRCSample) Scenario3_Choosing (winrt::SDKTemplate::implementation) VideoGallery (_360VideoPlayback)
ModelConstantBuffer (WindowsHolographicCodeSamples) Scenario3_Choosing (winrt::SDKTemplate::factory_implementation) VideoItem (BackgroundMediaPlayback::DataModels)
ModelConstantBuffer (HolographicTagAlongSample) Scenario3_Choosing (SDKTemplate) VideoItem (_360VideoPlayback)
ModelConstantBuffer (HolographicSpatialStage) Scenario3_ClientAuthentication (winrt::SDKTemplate::implementation) VideoItemInfo
ModelConstantBuffer (HolographicPaint) Scenario3_ClientAuthentication (winrt::SDKTemplate::factory_implementation) VideoGallery::VideoItemInfo (_360VideoPlayback)
ModelConstantBuffer (HolographicMRCSample) Scenario3_ClientAuthentication (SDKTemplate) VideoMetaData (ScreenCasting::Data::Common)
ModelConstantBuffer (BasicHologram) Scenario3_CredentialPickerOptions (CredentialPicker) VideoRenderer (_360VideoPlayback)
ModelConstantBuffer (BasicHologram::Content) Scenario3_CurrencyFormatting (winrt::SDKTemplate::implementation) VideoRenderer (_360VideoPlayback::Content)
ModelConstantBuffer (_360VideoPlayback) Scenario3_CurrencyFormatting (winrt::SDKTemplate::factory_implementation) ViewLifetimeControl (winrt::SDKTemplate::implementation)
ModelConstantBuffer (_360VideoPlayback::Content) Scenario3_CurrencyFormatting (SDKTemplate) ViewLifetimeControl (winrt::SDKTemplate::factory_implementation)
ModelNormalConstantBuffer (WindowsHolographicCodeSamples) Scenario3_CurrentStepCount (PedometerCS) ViewLifetimeControl (SecondaryViewsHelpers)
ModemDeviceServices (MobileBroadband) Scenario3_CustomItems (winrt::SDKTemplate::implementation) ViewLifetimeControl (ScreenCasting::Util)
ModemInformation (MobileBroadband) Scenario3_CustomItems (winrt::SDKTemplate::factory_implementation) ViewModelBase (SDKTemplate::ViewModels)
MoveLookController Scenario3_CustomItems (SDKTemplate) ViewModelBase (AdventureWorks)
MPEUserControl (SDKTemplate) Scenario3_DisplayOnOff (ProximityCS) ViewModelBase (AdventureWorks::ViewModel)
MultipleAccountsScenario (Accounts) Scenario3_EnableHdrProfile (CameraProfile) ViewModelLocator (AdventureWorks::ViewModel)
MultipleTasks (SDKTemplate) Scenario3_Enum (winrt::SDKTemplate::implementation) ViewProjectionConstantBuffer (WindowsHolographicCodeSamples)
MusicItem (BackgroundMediaPlayback::DataModels) Scenario3_Enum (winrt::SDKTemplate::factory_implementation) ViewProjectionConstantBuffer (DX)
MyUserControl1 (xBindSampleCS) Scenario3_Enum (SDKTemplate) ViewProjectionConstantBuffer (BasicHologram::Common)
N
Scenario3_EnumerateTiles (winrt::SDKTemplate::implementation) ViewProjectionConstantBuffer (_360VideoPlayback::Common)
NavigationHelper (SDKTemplate::Common) Scenario3_EnumerateTiles (winrt::SDKTemplate::factory_implementation) VisibilityConverter (AdventureWorks::Common)
NavigationHelper (AdventureWorks::Common) Scenario3_EnumerateTiles (SDKTemplate) VisitBackgroundTask (winrt::BackgroundTask::implementation)
NavigationService (AdventureWorks::Common) Scenario3_FixAccount (SDKTemplate) VisitBackgroundTask (winrt::BackgroundTask::factory_implementation)
NegatingBoolConverter (SDKTemplate) Scenario3_Flickr (WebAuthentication) VisitBackgroundTask (BackgroundTask)
NfcProvHeader (NfcProvisioner) Scenario3_ForegroundApp (SDKTemplate) GpuCoordinateMapper::VisualizeFrameBlob (CameraStreamCoordinateMapper)
NfcUtils (NfcSample) Scenario3_FrameInput (AudioCreation) VisualProperties (CompositionVisual)
List::Node Scenario3_Full (SDKTemplate) VisualPropertiesFactory
NoOp Scenario3_HardwareDRM (SDKTemplate) VisualPropertiesFactory (CompositionVisual)
NV12VideoTexture (HolographicFaceTracker) Scenario3_InkingFeedback (winrt::SDKTemplate::implementation)
W
O
Scenario3_InkingFeedback (winrt::SDKTemplate::factory_implementation) WASAPICapture (winrt::SDKTemplate)
OcrCapturedImage (winrt::SDKTemplate::implementation) Scenario3_InkingFeedback (SDKTemplate) WASAPICapture (SDKSample::WASAPIAudio)
OcrCapturedImage (winrt::SDKTemplate::factory_implementation) Scenario3_InterruptPipes (CustomUsbDeviceAccess) WASAPIRenderer (winrt::SDKTemplate)
OcrCapturedImage (SDKTemplate) Scenario3_InvokeScript (SDKTemplate) WASAPIRenderer (SDKSample::WASAPIAudio)
OcrFileImage (winrt::SDKTemplate::implementation) Scenario3_LaunchAppServices (SDKTemplate) WaveEffect
OcrFileImage (winrt::SDKTemplate::factory_implementation) Scenario3_Legacy (SDKTemplate) WebApiApplication (MicrosoftPassport::Server)
OcrFileImage (SDKTemplate) Scenario3_MasterDetail (winrt::SDKTemplate::implementation) WICConvert
OmnidirectionalSound Scenario3_MasterDetail (winrt::SDKTemplate::factory_implementation) WICTranslate
OnboardingService (AllJoynProducerExperiences) Scenario3_MasterDetail (SDKTemplate) WiFiDirectServiceManager (SDKTemplate::WiFiDirectServices)
OnDeviceConnectedEventArgs (CustomUsbDeviceAccess) Scenario3_MultipleClaims (SDKTemplate) WiFiNetworkDisplay (WiFiScan)
OnDeviceConnectedEventArgs (CustomHidDeviceAccess) Scenario3_MultipleDrawers (SDKTemplate) WindowInfo (SDKTemplate)
OpenCloseConnectionScenario (winrt::SDKTemplate::implementation) Scenario3_NetworkConnectivityChanges (winrt::SDKTemplate::implementation) WordOverlay (winrt::SDKTemplate::implementation)
OpenCloseConnectionScenario (winrt::SDKTemplate::factory_implementation) Scenario3_NetworkConnectivityChanges (winrt::SDKTemplate::factory_implementation) WordOverlay (SDKTemplate)
OpenCloseConnectionScenario (SDKTemplate) Scenario3_NetworkConnectivityChanges (SDKTemplate) WorldCeilingMesh
OpQueue Scenario3_Notifications (SDKTemplate) WorldFloorMesh
OsrFx2 (CustomUsbDeviceAccess) Scenario3_ParameterizedTemplate (winrt::SDKTemplate::implementation) WorldWallsMesh
OtherBindings (xBindSampleCS) Scenario3_ParameterizedTemplate (winrt::SDKTemplate::factory_implementation) Write (MifareUltralight)
OtherScenarios (winrt::SDKTemplate::implementation) Scenario3_ParameterizedTemplate (SDKTemplate) Write (MifareStandard)
OtherScenarios (winrt::SDKTemplate::factory_implementation) Scenario3_Polling (SDKTemplate) Write (Iso15693)
OtherScenarios (SDKTemplate) Scenario3_Porting (GyrometerCS) WriteReadStream (SDKTemplate)
Oven (Microsoft::SDKSamples::Kitchen) Scenario3_ReadWrite (CustomSerialDeviceAccess) WrlFinal
OvenClient (WRLOutOfProcessWinRTComponent) Scenario3_ReceiveFile (SDKTemplate) WrlFinal (ABI::Microsoft::SDKSamples::Kitchen)
OvenClient (WRLInProcessWinRTComponent) Scenario3_Region (winrt::SDKTemplate::implementation)
X
OvenClient (ProxyStubsForWinRTComponents) Scenario3_Region (winrt::SDKTemplate::factory_implementation) XmlDocumentToStringConverter (Notifications::Converters)
P
Scenario3_Region (SDKTemplate) XmlLoading (Xml)
PageDescription (SDKTemplate) Scenario3_RegisterForUpdates (WiFiScan) XSLTTransform (Xml)
PageDescription (PrintSample) Scenario3_Replace (SDKTemplate)
Y
PageRangePrintHelper (PrintSample) Scenario3_RequestModification (SDKTemplate) YangContainer (xBindSampleModel)
PageToPrint (PrintSample) Scenario3_ResetPIN (winrt::SDKTemplate::implementation)
_
Panel (HolographicMRCSample) Scenario3_ResetPIN (winrt::SDKTemplate::factory_implementation) _360VideoPlaybackMain (_360VideoPlayback)
PedometerBackgroundTask (Tasks) Scenario3_ResetPIN (SDKTemplate) _RPC_CLIENT
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | _
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- j -

  • joiner : sealed
  • jsonValue : HttpJsonContent
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- k -

  • KeepConnectionOpenScenario() : KeepConnectionOpenScenario
  • KeepOriginalFolder_checked() : Scenario1
  • Key : Scenario1ViewModel , FileItem , GroupInfoList , Scenario2ViewModel , GroupInfoList , MapChangedEventArgs< K >
  • key : PersistentState , GroupInfoList
  • Key : FileItem
  • KeyboardKey_Pressed() : Scenario3_BgChatServer , Scenario1_ChatClient , Scenario2_ChatServer
  • KeyData : LoadKeys
  • keyDownToken : sealed , Scenario1_Basic
  • KeyHost : AddAuthorizationHeaderFilter
  • keyId : ProactiveViewModel
  • KeyId : ProactiveViewModel
  • KeyNumber : LoadKeys , GeneralAuthenticate
  • Keys : EmployeeDictionary
  • KeyType : LoadKeys , GeneralAuthenticate
  • Kind() : DeviceInformationDisplay
  • kind : sealed , DeviceSelectorInfo
  • Kind : DeviceSelectorInfo , sealed
  • kinds : DeviceInformationKindChoice
  • Kinds() : DeviceInformationKindChoice
  • knownAzureMediaServiceModels : AdaptiveContentModel
  • KnownDevices : Scenario1_Discovery
  • KnownTypes : SuspensionManager
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- l -

  • Label : TabHeader
  • LabelProperty : TabHeader
  • labelText : Print3D
  • lamp : Scenario3_AvailabilityChanged
  • Lamp_AvailabilityChanged() : sealed , Scenario3_AvailabilityChanged
  • lampArray : LampArrayInfo , CustomEffectState , LampArrayInfo
  • LampArray_AvailabilityChanged() : Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects
  • LampArrayInfo() : LampArrayInfo
  • lampColors : CustomEffectState
  • lampNormalizedX : CustomEffectState
  • lampToggle_Toggled() : sealed , Scenario3_AvailabilityChanged
  • language : MediaStream
  • Language : MediaStream
  • LanguageList_SelectionChanged() : sealed , Scenario1_Configuration , sealed , OcrFileImage
  • languageMap : sealed
  • LanguageOverrideCombo_SelectionChanged() : Scenario8
  • LanguageTagToRecognizerName() : sealed
  • lasso : sealed , Scenario2
  • LassoSelect : sealed , Scenario2
  • Last : RecognizedTextRun
  • LastErrorCode : AppData
  • LastErrorMessage : AppData
  • lastErrorMessage : CommonLicenseRequest
  • lastFadeOutTime : Scenario3
  • lastFileName : Scenario1_CreateTile
  • lastFileUri : Scenario1_CreateTile
  • lastIndex : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • LastName : Employee , IEmployee , Manager , Contact
  • lastName : Contact
  • lastPeriodDuration : Manifest
  • LastPeriodDuration : Manifest
  • LastPositionUpdate : Scenario3_AdaptiveSync
  • lastProcessedAdId : Scenario5_Metadata
  • lastSelectedIndex : sealed , Scenario8
  • lastUpdateTime : sealed , ServiceViewModel
  • LastValueTime : SourceHandler::PositionInformation
  • LatencyMode : LowLatency
  • LatencyModes : sealed
  • LatencyModeToggle_Toggled() : LowLatency
  • LatencyModeToggled() : sealed
  • latestFrame : FrameSourceState
  • Launch_Click() : sealed , Scenario1_GetDeviceInformation , sealed , Scenario1_Message , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions , sealed , Scenario1_Facebook , Scenario2_Twitter , Scenario3_Flickr
  • Launch_Clicked() : Scenario2_LaunchUri
  • LaunchAppInForeground() : sealed , AdventureWorksVoiceCommandService
  • LaunchArgs : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage , App , MainPage
  • LaunchAtSize_Click() : sealed , Scenario2_Launch
  • LaunchCompleted() : App
  • LaunchContextMenu() : sealed
  • LaunchedEventArgs : App
  • LaunchFileDefault() : Scenario1_LaunchFile
  • LaunchFileIn3DBuilder_Click() : Scenario2_Launch
  • LaunchFileOpenWith() : Scenario1_LaunchFile
  • LaunchFileSplitScreen() : Scenario1_LaunchFile
  • LaunchFileWithWarning() : Scenario1_LaunchFile
  • LaunchForegroundApp() : sealed
  • LaunchHyperlink() : EnableHelloPage
  • LaunchInFullScreenModeCheckBox_Click() : sealed , Scenario2_Launch
  • LaunchNfcPaymentsSettingsPage() : NfcUtils
  • LaunchNfcProximitySettingsPage() : NfcUtils
  • launchParam : MainPage
  • LaunchParam : MainPage
  • LaunchProducer : Scenario1ViewModel , Scenario2ViewModel
  • LaunchType : sealed
  • LaunchUri() : XmlLoading
  • LaunchUriDefault() : Scenario2_LaunchUri
  • LaunchUriOpenWith() : Scenario2_LaunchUri
  • LaunchUriSplitScreen() : Scenario2_LaunchUri
  • LaunchUriWithWarning() : Scenario2_LaunchUri
  • LAYOUT_WIDTH_768 : CalibrationBar
  • layoutMetricsChangedToken : CustomTitleBar
  • LayoutRoot_Loaded() : MasterDetailPage
  • LayoutRoot_SizeChanged() : SectionView
  • Le : ApduCommand
  • leading : NfcProvHeader
  • LearnMoreButton_Click() : ExtendedSplash
  • LED3Switch_Toggled() : Scenario2_LEDTemp
  • LED4Switch_Toggled() : Scenario2_LEDTemp
  • LED5Switch_Toggled() : Scenario2_LEDTemp
  • LED6Switch_Toggled() : Scenario2_LEDTemp
  • LED_PIN : sealed , Scenario1_GetAndSetPin
  • LedState : Scenario2_LEDTemp
  • left : ElementMargin
  • LeftEdgeBrush : EdgeTappedListView
  • LeftEyeProjection() : Camera
  • leftOverTicks : StepTimer
  • LegacyControl_KeyUp() : Scenario3_Legacy
  • length : SlowInputStream , LineSegment
  • Length : RawSMBIOSData , RawSMBIOSTable , TlvEntry , ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • LengthAngstrom : PresentationFormats
  • LengthFoot : PresentationFormats
  • LengthInch : PresentationFormats
  • LengthMetre : PresentationFormats
  • LengthMile : PresentationFormats
  • LengthNauticalMile : PresentationFormats
  • LengthParsec : PresentationFormats
  • LengthYard : PresentationFormats
  • Level1() : Level1
  • Level2() : Level2
  • Level3() : Level3
  • Level4() : Level4
  • Level5() : Level5
  • Level6() : Level6
  • LevelActive() : Simple3DGame
  • LevelCompleted() : Simple3DGame
  • levelCompleted : HighScoreEntry
  • License : VideoMetaData
  • license : sealed
  • LicenseAcquisitionRequest() : PlayReadyHelper
  • LicenseChanged() : GameMain
  • licenseSession : SecureStopViewModel
  • licenseUrl : HardwareDRMViewModel , ProactiveViewModel , SecureStopViewModel
  • licenseURL : ReactiveViewModel
  • lightColor : ConstantBufferNeverChanges
  • lightContact : AppContactPanel
  • lightPosition : ViewProjectionConstantBuffer , ConstantBufferNeverChanges
  • LikeButton_Click() : CustomMediaTransportControls
  • Liked : CustomMediaTransportControls
  • likes : MainPage
  • limiterEffectDefinition : Scenario5_InboxEffects
  • LimiterEffectToggle_Toggled() : Scenario5_InboxEffects
  • Line() : Line
  • lineBrush : Scenario1_DetectInPhoto
  • lineDisplay : sealed , Scenario2_DisplayText , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee
  • LineDisplayId : MainPage
  • lineThickness : Scenario1_DetectInPhoto
  • LineTo() : sealed
  • LinkField_Click() : sealed , S1_GetAFeed
  • List() : List< T >
  • List< T > : List< T >::POSITION
  • list_SelectionChanged() : MainPage
  • ListboxVoiceChooser_SelectionChanged() : sealed , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries
  • LISTEN_PIN : sealed , Scenario2_Listen
  • ListenButton_Click() : Scenario2_ChatServer , Scenario3_BgChatServer
  • listener : sealed
  • ListenerContext() : sealed
  • listenerSocket : sealed , Scenario5
  • listenPin : sealed , Scenario2_Listen
  • ListFoldersButton_Click() : sealed , Scenario2
  • listInputDevicesButton_Click() : Scenario1_MIDIDeviceEnumeration
  • listOfDescriptorTypes : Scenario5_UsbDescriptors
  • listOfDevices : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • listOfSymbologies : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • listOutputDevicesButton_Click() : Scenario1_MIDIDeviceEnumeration
  • ListsAndTemplates() : sealed , ListsAndTemplates
  • ListSmartCard_Click() : Scenario7_ListAllCards
  • ListSmartCards_Click() : sealed
  • listUiccApps_SelectionChanged() : SimCard
  • ListView_ContextCanceled() : sealed , Scenario3
  • ListView_ContextRequested() : sealed , Scenario3
  • ListView_ItemClick() : MainPage
  • ListView_ItemClicked() : Scenario2
  • ListView_SelectionChanged() : MainPage , Scenario1
  • ListViewEdgeTappedEventArgs() : ListViewEdgeTappedEventArgs
  • ListViewEdgeTappedEventHandler() : EdgeTappedListView
  • listViewItem : ListViewEdgeTappedEventArgs
  • ListViewItem : ListViewEdgeTappedEventArgs
  • listViewItemHighlighted : EdgeTappedListView
  • listViewModel : MediaItemViewModel
  • Live : AdaptiveContentModel
  • LiveDashPlayer() : LiveDashPlayer
  • liveOffset : LiveDashPlayer , Player , LiveDashPlayer
  • LiveOffset : Player
  • LiveProfile : DashManifestParser
  • LiveSegmentCount : DashManifestParser
  • LiveSourceBufferManager() : LiveSourceBufferManager
  • llTimestamp : MFSampleGenerator
  • lnames : DataModel
  • Load() : sealed , AppView , sealed , AppView , sealed , VisualProperties , sealed , App , sealed
  • Load_Click() : Scenario1_SimplestAdaptiveStreaming , Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • LoadAccount() : sealed
  • LoadAccountList() : AccountsHelper
  • LoadAccounts() : sealed
  • LoadAndDisplayScreens_Click() : sealed , Scenario3
  • LoadAndFinalizeLevelInBackground() : GameMain
  • LoadAppState() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain
  • LoadAsHtml() : Scenario2_NavToString
  • LoadBitmapAsync() : sealed , PhotosPrintHelper
  • LoadBool() : PersistentState
  • LoadButton_Click() : OcrFileImage
  • loadButton_Click() : Scenario1 , Scenario2 , Scenario3
  • LoadButton_Tapped() : sealed
  • LoadDataAccountsAsync() : MainPage
  • LoadDefaultImage() : sealed
  • LoadDocument() : sealed , Scenario1_Render
  • loaded : sealed , TripStore
  • LoadFileAsync() : Scenario1 , Scenario2
  • LoadFromApplicationUriAsync() : MediaList
  • LoadFromLocalState_Click() : Scenario5_NavToFiles
  • LoadFromPackage_Click() : Scenario5_NavToFiles
  • LoadGame() : Simple3DGame
  • LoadHighScore() : Simple3DGame
  • LoadHtml() : Scenario3_InvokeScript
  • LoadId_Click() : ContentSelector
  • LoadImage() : sealed
  • LoadImageAsync() : OcrFileImage
  • LoadImageCommon() : D2DAdvancedColorImagesRenderer
  • LoadImageFromWic() : D2DAdvancedColorImagesRenderer
  • loadingComplete : VideoRenderer , SpinningCubeRenderer
  • LoadInt32() : PersistentState
  • LoadInternalState() : CustomVertexShaderMain , sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , CustomPixelShaderMain , CustomPixelShaderRenderer , CustomVertexShaderRenderer , sealed
  • LoadItem() : MediaList
  • LoadKey() : LoadKey
  • LoadKeyAsync() : AccessHandler
  • LoadKeys() : LoadKeys
  • LoadKeysKeyType : LoadKeys
  • LoadKeysStorageType : LoadKeys
  • LoadKeysTransmissionType : LoadKeys
  • LoadLevelAsync() : Simple3DGame
  • LoadLevelResourcesAsync() : GameRenderer
  • LoadLogoBitmapAsync() : sealed , Scenario2_PrintReceipt
  • LoadManifestAsync() : Manifest
  • LoadMedia() : MediaReader
  • LoadMesh() : BasicLoader
  • LoadMeshAsync() : BasicLoader
  • LoadMoreItemsAsync() : IncrementalLoadingBase , Conversation
  • LoadMoreItemsOverrideAsync() : GeneratorIncrementalLoadingClass-g< T > , IncrementalLoadingBase
  • LoadPackagedLibrary() : ServiceViewModel
  • LoadPackageFromFile_Click() : Scenario1_Print
  • LoadPlaceInfoAsync() : Scenario7 , sealed
  • LoadSampleImage() : sealed
  • LoadSampleImageAsync() : OcrFileImage
  • LoadSaveFileAsync() : Scenario2
  • LoadScenario() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • LoadScenarioForProtocolActivation() : MainPage
  • LoadScenarios() : MainPage
  • LoadShader() : BasicLoader
  • LoadShaderAsync() : BasicLoader
  • LoadShaders() : VideoRenderer , DeviceResources , VideoRenderer
  • LoadSingle() : PersistentState
  • LoadSourceFromUriAsync() : Scenario6_AdInsertion , Scenario4_Tuning , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario5_Metadata , Scenario7_LiveSeekableRange
  • LoadState() : Simple3DGame , Level , NavigationHelper , Simple3DGame , NavigationHelper , Level4 , Simple3DGame , Level2 , SubPage
  • LoadStateEventArgs() : LoadStateEventArgs
  • LoadString() : PersistentState
  • LoadStringFromPackageFileAsync() : MainPage
  • LoadTexture() : BasicLoader
  • LoadTextureAsync() : BasicLoader
  • LoadThumbnail() : ImportableItemWrapper
  • LoadTimer_Tick() : ArticlePage
  • LoadTripFromStore() : TripViewModel
  • LoadTrips() : TripListViewModel , TripStore
  • LoadTripsAsync() : sealed
  • LoadTripsSync() : sealed
  • LoadTripsTask() : sealed
  • LoadUri_Click() : ContentSelector
  • LoadXMFLOAT3() : PersistentState
  • LoadXmlFile() : Scenario
  • localCacheCounter : Scenario1_Files
  • localCacheFolder : Scenario1_Files
  • LocalClientButtonClicked() : sealed
  • localCounter : Scenario1_Files
  • localFolder : Scenario1_Files
  • localHost : sealed
  • LocalHost : LocalHostItem
  • localHost : sealed
  • LocalHost : LocalHostItem
  • LocalHostItem() : LocalHostItem , sealed
  • localHostItems : sealed , Scenario1 , sealed
  • LocalhostVideo : LowLatency
  • localSettings : Scenario2_Settings , Scenario3_SettingContainer , DecodeEngine , Scenario4_CompositeSettings , Scenario1_Configuration , Scenario2_Settings , AppData , Scenario4_CompositeSettings , Scenario3_SettingContainer
  • Location : sealed , PointOfInterest , Cluster , PlaceInfo
  • LocationBackgroundTask() : LocationBackgroundTask
  • locationCapability : Scenario1_Check
  • LocationTrackingReason() : sealed , LocationTrackingReason
  • locator : _360VideoPlaybackMain , HolographicApp1Main
  • lock : sealed
  • LockScenarioChange() : sealed
  • LockStore() : CBaseAttributes< TBase >
  • LockToXAxis() : sealed , ManipulationInputProcessor
  • LockToYAxis() : sealed , ManipulationInputProcessor
  • Log() : Scenario4_Tuning , InkEventLogger , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario7_LiveSeekableRange , Scenario1_Download , Scenario2_Upload , ViewModelBase , sealed , Scenario6_AdInsertion , sealed , SimpleLogger , Scenario3_Notifications , sealed , PlayReadyHelper , SdkSample , Scenario5_Metadata
  • LogarithmicRadioQuantityBel : PresentationFormats
  • LogarithmicRadioQuantityNeper : PresentationFormats
  • LogContactInfo() : sealed , Scenario1_EventAndMenuHookup
  • LogCurrentTimeCorrelation_Click() : Scenario7_LiveSeekableRange
  • LogException() : sealed
  • LogFileFullPath() : LoggingScenarioEventArgs
  • LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME : FileLoggingSessionScenario
  • LogFileGeneratedCount() : LoggingSessionScenario , FileLoggingSessionScenario
  • LogFileGeneratedHandler() : FileLoggingSessionScenario
  • LogFilePath : LoggingScenarioEventArgs
  • logger : PlayReadyHelper
  • loggerControl : ContentSelector
  • LOGGING_ENABLED_SETTING_KEY_NAME : FileLoggingSessionScenario
  • LoggingEnabled() : FileLoggingSessionScenario , LoggingSessionScenario
  • LoggingEnabledKey : LoggingSessionScenario
  • LoggingScenario : Scenario3
  • loggingScenario : FileLoggingSessionScenario
  • LoggingScenario_StatusChanged() : Scenario3
  • LoggingScenarioEventArgs() : sealed , LoggingScenarioEventArgs , sealed , LoggingScenarioEventArgs
  • LoggingSessionScenario() : sealed , LoggingSessionScenario , Scenario2
  • loggingSessionScenario : LoggingSessionScenario
  • LoggingSessionScenario_StatusChanged() : Scenario2
  • LogMessage() : sealed , NfcUtils , DeviceReadWrite
  • LogoffAndRemoveAccount() : sealed , SingleAccountScenario , sealed , SingleMicrosoftAccountScenario , MultipleAccountsScenario , SingleAzureADScenario , sealed
  • LogoffAndRemoveAllAccounts() : MultipleAccountsScenario , sealed
  • logoSecondaryTileId : MainPage
  • LogoSecondaryTileId : SampleHelpers
  • LogStatus() : Scenario1_Download , sealed , Scenario3_Notifications , Scenario1_SetRecordProfile , Scenario2_Upload , sealed , Scenario3_EnableHdrProfile , Scenario2_ConcurrentProfile
  • LogStatusAsync() : sealed , Scenario2_EnableSettings , Scenario1_GetLamp , Scenario3_AvailabilityChanged , sealed
  • LogStatusToOutputBox() : Scenario1_SetRecordProfile , Scenario3_EnableHdrProfile , Scenario2_ConcurrentProfile
  • LogStatusToOutputBoxAsync() : sealed , Scenario3_AvailabilityChanged , sealed , Scenario2_EnableSettings , sealed , Scenario1_GetLamp , sealed
  • LogToggleSwitch_Toggled() : sealed
  • LogWithWin10Constructor() : LoggingChannelScenario , sealed
  • LogWithWin81Constructor() : LoggingChannelScenario , sealed , LoggingChannelScenario
  • LongRunningShareLabel_Tapped() : Scenario13_ShareTarget
  • LookAt() : Camera
  • LookDirection() : MoveLookController , Camera
  • LookupBackgroundTask() : MainPage
  • LookupBooleanProperty() : BluetoothLEDeviceDisplay
  • LookupSavedString() : MainPage
  • LookupTable() : LookupTable< T, LookupTableSize >
  • LookupTableGenerator : LookupTable< T, LookupTableSize >
  • LoopbackClientButton_Click() : LowLatency
  • LoopToggle_Toggled() : Scenario1_FilePlayback
  • LoudnessSlider_ValueChanged() : Scenario5_InboxEffects
  • lowLatency : sealed
  • LowLatency() : LowLatency
  • LowLatencyInputMain() : LowLatencyInputMain
  • LowPart : LARGE_INTEGER
  • lstCards_SelectionChanged() : ManageCardScenario
  • LuminanceCandelaPerSquareMetre : PresentationFormats
  • LuminanceHeatmapEffect() : LuminanceHeatmapEffect
  • LuminousFluxLumen : PresentationFormats
  • LuminousIntensityCandela : PresentationFormats
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- m -

  • m_account : sealed , SignIn , sealed
  • m_accountCommandsRequestedRegistrationToken : sealed
  • m_accountListView : sealed
  • m_accounts : sealed
  • m_actionBrush : GameInfoOverlay
  • m_actionRectangle : GameInfoOverlay
  • m_actionString : GameInfoOverlay
  • m_activatableClassId : sealed
  • m_active : GameObject , GameTimer
  • m_activeAccount : sealed
  • m_activeBackground : Simple3DGame
  • m_activeGamePad : sealed
  • m_activeSymbologies : DecodeEngine
  • m_activitySensor : sealed
  • m_addingAccount : sealed , SignIn
  • m_afterWriteFile : sealed , Scenario5_TriggerCFU
  • m_ammo : Simple3DGame
  • m_ammoCount : Simple3DGame
  • m_ammoNext : Simple3DGame
  • m_anchor : List< T >
  • m_animatePosition : GameObject
  • m_applicationContentMarginLeft : PrintHelper
  • m_applicationContentMarginTop : PrintHelper
  • m_applying : Scenario1_ConfigureMobileHotspot
  • m_appViewConsolidated : sealed
  • m_areKeysDropped : EdpBackgroundTask
  • m_aspectRatio : Camera
  • m_attachedLampArrays : Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects
  • m_attachedReferenceFrame : HolographicTagAlongSampleMain
  • m_audioAvailable : Audio , SoundEffect
  • m_audioCaptureClient : WASAPICapture
  • m_AudioCaptureClient : WASAPICapture
  • m_AudioClient : WASAPICapture , WASAPIRenderer
  • m_audioClient : WASAPICapture
  • m_audioController : Simple3DGame
  • m_audioEffectAdded : MediaCaptureManager
  • m_audioMediaType : MFSampleGenerator
  • m_AudioMT : MFSampleGenerator
  • m_AudioRenderClient : WASAPIRenderer
  • m_authenticateClicked : Scenario1ViewModel , Scenario2ViewModel
  • m_authenticationVisibility : Scenario2ViewModel
  • m_authVisibility : Scenario1ViewModel
  • m_autoFire : MoveLookController
  • m_axis : Cylinder
  • m_back : MoveLookController
  • m_backBuffer : sealed , FrameRenderer
  • m_backgroundBrush : GameInfoOverlay
  • m_backgroundColor : sealed
  • m_backgroundTask : sealed
  • m_baseControls : MediaTransportControls
  • m_baseTime : GameTimer
  • m_basicReaderWriter : BasicLoader
  • m_beforeReadFile : sealed , Scenario5_TriggerCFU
  • m_blackBrush : TargetTexture
  • m_blendState : CameraResources
  • m_blueBrush : TargetTexture
  • m_bodyRectangle : GameInfoOverlay
  • m_bodyString : GameInfoOverlay
  • m_boundingBox : ControlBase , sealed
  • m_boundsBrush : sealed
  • m_boundsStrokeStyle : sealed
  • m_bread : WrlFinal
  • m_brightnessAdjust : D2DAdvancedColorImagesRenderer
  • m_brush : Button , SeekBarElement
  • m_brushColor : Ellipse , FilledEllipse , Rectangle , FilledRectangle
  • m_brushes : sealed
  • m_buffer : PlotDataReadyEventArgs
  • m_bufferFrames : WASAPICapture
  • m_BufferFrames : WASAPICapture , WASAPIRenderer
  • m_busAttachment : sealed , Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • m_busAttachmentStateChangedToken : sealed
  • m_busObject : sealed
  • m_buttonInUse : MoveLookController
  • m_buttonLowerRight : MoveLookController
  • m_buttonPointerID : MoveLookController
  • m_buttonPressed : MoveLookController
  • m_buttonState : Button
  • m_buttonUpperLeft : MoveLookController
  • m_BytesPerPeriod : MFSampleGenerator
  • m_bytesPerPeriod : MFSampleGenerator
  • m_bytesPerSecond : MFSampleGenerator
  • m_bytesSinceLastFlush : WASAPICapture
  • m_calculateTextureDimensionsFromScale : BaseControl
  • m_callSetProperty : Scenario1ViewModel
  • m_camera : CameraStreamCoordinateMapperMain , Simple3DGame
  • m_cameraAddedToken : HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain , _360VideoPlaybackMain , BasicHologramMain
  • m_cameraCoordinateMapper : CameraStreamCoordinateMapperMain
  • m_cameraPitchAngle : Camera
  • m_cameraRemovedToken : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_cameraResources : DeviceResources
  • m_cameraResourcesLock : DeviceResources
  • m_cameraYawAngle : Camera
  • m_cancelRequested : EdpBackgroundTask
  • m_canCommitDirect3D11DepthBuffer : BasicHologramMain
  • m_canGenerateSegmentsDynamically : MediaStream
  • m_canGetDefaultHolographicDisplay : BasicHologramMain
  • m_canGetHolographicDisplayForCamera : BasicHologramMain
  • m_canRenderThisFrame : SceneObject
  • m_caption : SampleOverlay
  • m_capture : Scenario4
  • m_cardAddedToken : Scenario1_ProvisionTPM
  • m_cardName : SmartCardListItem
  • m_cardReader : CardReader
  • m_cardRemovedToken : Scenario6_DeleteTPM
  • m_cbDataSize : WASAPICapture
  • m_cbFlushCounter : WASAPICapture
  • m_cbHeaderSize : WASAPICapture
  • m_ceilingTexture : GameRenderer
  • m_center : AnimateCirclePosition , ToolCarousel
  • m_centerX : sealed
  • m_centerY : sealed
  • m_ChannelVolume : WASAPIRenderer
  • m_channelVolume : WASAPIRenderer
  • m_children : ControlBase
  • m_chrominanceView : NV12VideoTexture
  • m_circleGeometry1 : TargetTexture
  • m_circleGeometry2 : TargetTexture
  • m_circleGeometry3 : TargetTexture
  • m_circleGeometry4 : TargetTexture
  • m_circleGeometry5 : TargetTexture
  • m_claimedScannerDataReceivedToken : Scenario1_BasicFunctionality
  • m_claimedScannerReleaseDeviceRequestedToken : Scenario1_BasicFunctionality
  • m_clearBrush : TargetTexture
  • m_clearPolicyText : Scenario3
  • m_clearToolIndex : HolographicPaintMain
  • m_clockwise : AnimateCirclePosition
  • m_closable : ensure_close
  • m_color : Button , Panel , Tool
  • m_colorCameraStreamProcessor : CameraCoordinateMapper
  • m_colorDistortionMapTexture : CameraCoordinateMapper
  • m_colorDistortionMapTextureSRV : CameraCoordinateMapper
  • m_colorFadeTimeout : final
  • m_colorFadeTimer : final
  • m_colorFocus : Button
  • m_colorFrameIndex : CameraCoordinateMapper
  • m_colorIntrinsics : CameraCoordinateMapper
  • m_colorManagement : PhotoAdjustmentRenderer
  • m_colorManagementEffect : D2DAdvancedColorImagesRenderer
  • m_colorOn : Button
  • m_colorPixelShader : RealtimeSurfaceMeshRenderer
  • m_colorSpacePoints : FrameRenderer
  • m_colorTexture : CameraCoordinateMapper
  • m_colorTextureSRV : CameraCoordinateMapper
  • m_completionsRequired : sealed
  • m_compositionScaleX : DeviceResources
  • m_compositionScaleY : DeviceResources
  • m_connection : sealed
  • m_connectPanelVisibility : Scenario2ViewModel
  • m_consolidatedToken : ViewLifetimeControl
  • m_constantBuffer : QuadRenderer , DftTransform
  • m_constantBufferChangeOnResize : GameRenderer
  • m_constantBufferChangesEveryFrame : GameRenderer
  • m_constantBufferChangesEveryPrim : GameRenderer
  • m_constantBufferCreated : final
  • m_constantBufferData : QuadRenderer , final
  • m_constantBufferNeverChanges : GameRenderer
  • m_constants : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • m_consumer : sealed , Scenario1ViewModel , Scenario2ViewModel
  • m_consumerOptionsVisibility : Scenario1ViewModel
  • m_ContentStream : MFSampleGenerator , sealed , WASAPICapture , WASAPIRenderer
  • m_contentStream : WASAPICapture
  • m_ContentType : sealed
  • m_contentType : Scenario2 , Scenario3 , WASAPIRenderer
  • m_continuous : Animate
  • m_contrast : PhotoAdjustmentRenderer
  • m_controller : GameMain , Simple3DGame , GameMain , Simple3DGame
  • m_coordinateSystem : HandHandler , SceneObject
  • m_copyPasteScenarioText : Scenario3
  • m_copyProtectionScenarioDesc : Scenario4
  • m_CoreDispatcher : sealed
  • m_correlatedFrameRenderer : sealed
  • m_count : AnimateLineListPosition , List< T >
  • m_cPlotDataFilled : WASAPICapture
  • m_cPlotDataMax : WASAPICapture
  • m_cRef : DftEffect , DftTransform
  • m_critical : VideoRenderer
  • m_criticalSection : GameMain , CritSec
  • m_CritSec : WASAPICapture , WASAPIRenderer
  • m_critsec : OpQueue< T, TOperation >
  • m_CritsecCustomSensor : sealed
  • m_csDebugLog : sealed
  • m_csLock : sealed
  • m_csPrintSync : sealed
  • m_currentConnectionId : sealed
  • m_currentCoordinateSystem : SpatialStageManager
  • m_currentFrameIndex : GpuPerformanceTimer
  • m_currentLevel : Simple3DGame
  • m_currentMode : HolographicPaintMain , SourceHandler
  • m_currentOrientation : DeviceResources
  • m_currentPageDescription : sealed
  • m_currentPlayPosition : SeekBarElement
  • m_currentQuery : GpuPerformanceTimer
  • m_currentSourceId : HolographicPaintMain
  • m_currentStage : SpatialStageManager
  • m_currentState : MediaCaptureManager
  • m_currentStroke : SourceHandler
  • m_currentTask : sealed
  • m_currentTime : BasicTimer , GameTimer
  • m_currentTool : SourceHandler
  • m_currentToolIndex : HolographicPaintMain
  • m_currentVideoDuration : SeekBarElement
  • m_cursorTextureView : Cursor
  • m_CustomSensor : sealed
  • m_cylinderTexture : GameRenderer
  • m_d2dContext : DeviceResources , sealed , DeviceResources , TargetTexture
  • m_d2dContextTargetToRestore : BaseControl
  • m_d2dDevice : DeviceResources , sealed , DeviceResources
  • m_d2dDeviceContext : CustomTextRenderer
  • m_d2dFactory : DeviceResources , CustomTextRenderer , DeviceResources , TargetTexture
  • m_d2dRenderTarget : TextRenderer
  • m_d2dTargetBitmap : DeviceResources
  • m_d2dTargetBitmapRight : DeviceResources
  • m_d3dBackBuffer : CameraResources
  • m_d3dContext : DeviceResources
  • m_d3dDepthBuffer : CameraResources
  • m_d3dDepthStencil : CameraResources
  • m_d3dDepthStencilView : CameraResources , DeviceResources , DistanceFieldRenderer , DeviceResources
  • m_d3dDevice : DeviceResources , sealed , BasicLoader , BasicShapes , BasicLoader , BasicShapes , DeviceResources , TargetTexture
  • m_d3dFeatureLevel : DeviceResources
  • m_d3dInteropDevice : DeviceResources
  • m_d3dRenderTargetSize : CameraResources , DeviceResources
  • m_d3dRenderTargetView : CameraResources , DeviceResources
  • m_d3dRenderTargetViewRight : DeviceResources
  • m_d3dViewport : CameraResources
  • m_Data : CAsyncState
  • m_dataSize : WASAPICapture
  • m_dateCreated : Item , ItemViewModel
  • m_decodeEngine : sealed
  • m_defaultPeriodInFrames : WASAPICapture
  • m_DefaultPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_defaultRasterizerState : RealtimeSurfaceMeshRenderer , SceneObject
  • m_defaultXAxis : GameObject
  • m_defaultYAxis : GameObject
  • m_defaultZAxis : GameObject
  • m_deferral : sealed
  • m_degreesPerSecond : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer
  • m_delta : BasicTimer
  • m_deltaTime : GameTimer
  • m_depthCameraStreamProcessor : CameraCoordinateMapper
  • m_depthFrameIndex : CameraCoordinateMapper
  • m_depthIntrinsics : CameraCoordinateMapper
  • m_depthSpacePoints : FrameRenderer
  • m_depthTexture : CameraCoordinateMapper
  • m_depthTextureSRV : CameraCoordinateMapper
  • m_depthUnprojectionMapTexture : CameraCoordinateMapper
  • m_depthUnprojectionMapTextureSRV : CameraCoordinateMapper
  • m_DesiredReportInterval : sealed
  • m_dev1DataReceivedToken : Scenario2_MultipleScanners
  • m_dev1ReleaseRequestedToken : Scenario2_MultipleScanners
  • m_dev2DataReceivedToken : Scenario2_MultipleScanners
  • m_dev2ReleaseRequestedToken : Scenario2_MultipleScanners
  • m_Device : sealed
  • m_deviceAccessInfo : sealed
  • m_DeviceAccessInfo : sealed
  • m_deviceAddedRevoker : Scenario1_Basics
  • m_deviceClassSelector : DeviceSelectorInfo
  • m_deviceId : BarcodeScannerInfo
  • m_DeviceIdString : WASAPICapture , WASAPIRenderer
  • m_deviceName : BarcodeScannerInfo
  • m_deviceNotify : DeviceResources
  • m_DeviceProps : WASAPICapture , WASAPIRenderer
  • m_deviceRemovedRevoker : Scenario1_Basics
  • m_deviceResources : _360VideoPlaybackMain , sealed , BaseControl , BaseElement , VideoRenderer , sealed , BasicHologramMain , SpinningCubeRenderer , sealed , CameraStreamCoordinateMapperMain , GpuPerformanceTimer , CameraCoordinateMapper , GpuCoordinateMapper , QuadRenderer , TextRenderer , D2DAdvancedColorImagesRenderer , sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , SampleOverlay , sealed , CustomPixelShaderMain , CustomPixelShaderRenderer , SampleOverlay , sealed , CustomVertexShaderMain , CustomVertexShaderRenderer , SampleOverlay , sealed , D2DGradientMeshMain , D2DGradientMeshRenderer , SampleOverlay , sealed , PhotoAdjustmentRenderer , D2DSvgImageRenderer , sealed , DWriteColorTextRendererMain , DWriteColorTextRendererRenderer , SampleOverlay , sealed , Resource , HolographicFaceTrackerMain , sealed , ControlBase , Cursor , SpinningCubeRenderer , HolographicMRCSampleMain , sealed , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , sealed , SceneController , SceneObject , HolographicSpatialStageMain , SpatialStageManager , sealed , DistanceFieldRenderer , QuadRenderer , TextRenderer , HolographicTagAlongSampleMain , sealed , SpinningCubeRenderer , HolographicVoiceInputMain , sealed , GameHud , GameInfoOverlay , GameMain , GameRenderer , App , sealed , RenderingHelper , HolographicPaintMain
  • m_DevicesList : sealed
  • m_DeviceState : sealed
  • m_deviceState : DeviceStateChangedEventArgs , DeviceStateSourceT< D >
  • m_DeviceStateChanged : WASAPICapture , WASAPIRenderer
  • m_deviceStateChanged : DeviceStateSourceT< D >
  • m_deviceStateChangeToken : sealed , Scenario2 , Scenario3 , Scenario4
  • m_deviceSupportsRawMode : sealed , Scenario2 , Scenario3
  • m_deviceWatcher : Scenario1_Basics , Scenario2_Effects
  • m_dftEffect : CustomComputeShaderRenderer
  • m_dftType : DftTransform
  • m_diameter : Tool
  • m_diffuseColor : Material
  • m_directXPage : sealed
  • m_disableExifOrientation : Scenario2
  • m_disableScannerRequestedToken : sealed
  • m_DiscontinuityCount : sealed
  • m_discontinuityCount : Scenario4
  • m_disjointQuery : GpuPerformanceTimer
  • m_dispatcher : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel , sealed
  • m_Dispatcher : sealed
  • m_dispInfo : D2DAdvancedColorImagesRenderer , sealed
  • m_displayHeightNonScaled : Scenario2
  • m_displayInformation : sealed
  • m_displayMessage : InvalidPageException
  • m_displayName : UserViewModel
  • m_displayRequest : Scenario5_DisplayingBarcodePreview
  • m_displayWidthNonScaled : Scenario2
  • m_distance : Cursor
  • m_documentPresenter : sealed
  • m_down : MoveLookController
  • m_downloadableFontName : sealed
  • m_downloadCompletedEventToken : sealed
  • m_downloadQueue : sealed
  • m_dpi : DeviceResources , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , sealed
  • m_dpiChangedEventToken : sealed
  • m_drawInfo : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • m_drawOverlay : SampleOverlay
  • m_drawWireframe : HolographicSpatialMappingMain
  • m_dropHologram : HolographicTagAlongSampleMain
  • m_dTransferMgr : Scenario12_ShareData
  • m_duration : Animate
  • m_dwQueueID : WASAPICapture
  • m_dwriteFactory : DeviceResources , CustomTextRenderer , DeviceResources , sealed , DeviceResources , TargetTexture
  • m_dwriteTextFormat : DWriteColorTextRendererRenderer
  • m_dwriteTextLayout : DWriteColorTextRendererRenderer
  • m_dxgiAdapter : DeviceResources
  • m_dxgiFactory : DeviceResources
  • m_dxgiFormat : CameraResources
  • m_education : User
  • m_effectContext : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect
  • m_effectiveDpi : DeviceResources
  • m_elapsedTicks : StepTimer
  • m_elapsedTimeString : SeekBarElement
  • m_elapsedTimeText : SeekBarElement
  • m_elementCoordIntersectionPoint : FocusableElement
  • m_elementMargin : BaseElement
  • m_elementSize : BaseElement
  • m_ElliFocusOutline : Button
  • m_ElliPressedBackgroundFill : Button
  • m_ellipse : Ellipse , FilledEllipse
  • m_emitter : sealed
  • m_emptyList : Scenario2_Effects
  • m_emulator : sealed
  • m_enabled : SymbologyListEntry , ControlBase
  • m_enableScannerRequestedToken : sealed
  • m_endPosition : AnimateLinePosition
  • m_endSegmentBrush : SeekBarElement
  • m_endTimestampQuery : GpuPerformanceTimer
  • m_EnterpriseId : Scenario1
  • m_enterpriseId : Scenario1
  • m_EnterpriseID : EdpBackgroundTask
  • m_error : DeviceStateChangedEventArgs
  • m_etwRegHandle : CServiceBase
  • m_event : PropertyGetContext< T > , PropertySetContext
  • m_eventsHandler : SourceHandler
  • m_exifOrientation : Scenario2
  • m_exitButtonControl : MediaTransportControls
  • m_exitText : ExitButton
  • m_eye : Camera
  • m_faceTracker : FaceTrackerProcessor
  • m_faceTrackerProcessor : HolographicFaceTrackerMain
  • m_fadeTime : QuadRenderer
  • m_fadingIn : QuadRenderer
  • m_farPlane : Camera
  • m_faToken : sealed , Scenario5_TriggerCFU
  • m_fDenyTransactions : sealed
  • m_fieldOfView : Camera
  • m_file : Scenario4
  • m_FileCopyName : Scenario4
  • m_fileProtStatus : EdpBackgroundTask
  • m_fileToken : Scenario1 , Scenario2
  • m_filmicEffect : D2DAdvancedColorImagesRenderer
  • m_finalOutput : D2DAdvancedColorImagesRenderer
  • m_fireInUse : MoveLookController
  • m_fireLastPoint : MoveLookController
  • m_fireLowerRight : MoveLookController
  • m_firePointerID : MoveLookController
  • m_firePressed : MoveLookController
  • m_fireUpperLeft : MoveLookController
  • m_flavor : WrlFinal
  • m_floorTexture : GameRenderer
  • m_focused : ControlBase
  • m_focusPoint : HolographicPaintMain
  • m_focusPointConstantBuffer : BaseControl
  • m_focusPointConstantBufferData : BaseControl
  • m_fontDownloadListener : sealed
  • m_fontFamily : sealed
  • m_fontNameCollector : sealed
  • m_fontSize : sealed
  • m_fontWeight : Text
  • m_forceIconCentered : Button
  • m_forceWarpDevice : DeviceResources
  • m_foreground : sealed
  • m_formatConvert : D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_formattedPrice : sealed
  • m_forward : MoveLookController
  • m_frameArrivedToken : sealed , CameraStreamProcessor
  • m_frameCount : StepTimer , CameraStreamProcessor
  • m_frameLatencyWaitableObject : DeviceResources
  • m_frameLock : sealed
  • m_framePending : CameraResources
  • m_frameReader : sealed
  • m_frameRenderer : sealed
  • m_frameRenderers : sealed
  • m_frameSources : sealed
  • m_framesPerSecond : StepTimer
  • m_framesThisSecond : StepTimer
  • m_freeRoamCameraEnabled : CameraStreamCoordinateMapperMain
  • m_Frequency : WASAPIRenderer
  • m_frequency : BasicTimer
  • m_frontSegmentBrush : SeekBarElement
  • m_fTaskEnded : sealed
  • m_fTransactionCompleted : sealed
  • m_fundamentalPeriodInFrames : WASAPICapture
  • m_FundamentalPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_futureAccess : Scenario1 , Scenario2
  • m_fWriting : WASAPICapture
  • m_Fx2Device : DeviceList
  • m_Fx2DeviceId : DeviceList
  • m_Fx2Devices : DeviceList
  • m_Fx2Watcher : DeviceList
  • m_game : GameMain , GameRenderer , GameMain , GameRenderer
  • m_gameActive : Simple3DGame
  • m_gameConfig : Simple3DGame
  • m_gameHud : GameRenderer
  • m_gameInfoOverlay : GameRenderer
  • m_gameInfoOverlayCommand : GameMain
  • m_gameInfoOverlayRect : GameRenderer
  • m_gameInfoOverlaySize : GameRenderer
  • m_gameInfoOverlayState : GameMain
  • m_gamepadAddedEventToken : BasicHologramMain , HolographicSpatialStageMain
  • m_gamepadRemovedEventToken : BasicHologramMain , HolographicSpatialStageMain
  • m_gamepads : BasicHologramMain
  • m_gamepadsChanged : MoveLookController
  • m_gamepadStartButtonInUse : MoveLookController
  • m_gamepadTriggerInUse : MoveLookController
  • m_gameResourcesLoaded : GameRenderer
  • m_geolocTask : Scenario3_BackgroundTask
  • m_geometry : BaseControl
  • m_geometryShader : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_geometryShaders : DeviceResources
  • m_gestureRecognizer : sealed , CustomVertexShaderRenderer , PhotoAdjustmentRenderer , HandHandler , SpatialControllerHandler
  • m_getActiveSymbologiesRequestedToken : sealed
  • m_getBarcodeSymbologyAttributesRequestedToken : sealed
  • m_getProtectScenarioDesc : Scenario4
  • m_getstreamStreamScenario : Scenario7
  • m_gpuCoordinateMapper : CameraCoordinateMapper
  • m_gpuPerformanceTimer : CameraStreamCoordinateMapperMain
  • m_gradientMesh : D2DGradientMeshRenderer
  • m_greenBrush : TargetTexture
  • m_ground : GameObject
  • m_groupCollection : sealed
  • m_hapticsBuzzFeedback : SpatialControllerHandler
  • m_hapticsController : SpatialControllerHandler
  • m_haveFocus : GameMain
  • m_headers : HttpJsonContent
  • m_headerSize : WASAPICapture
  • m_heading : sealed
  • m_heatmapEffect : D2DAdvancedColorImagesRenderer
  • m_height : sealed , NV12VideoTexture , Face , sealed
  • m_heightVector : Face
  • m_helpTextRenderer : CameraStreamCoordinateMapperMain
  • m_hideVideoPreviewRequestedToken : sealed
  • m_highlightsShadows : PhotoAdjustmentRenderer
  • m_histogramEffect : D2DAdvancedColorImagesRenderer
  • m_histogramPrescale : D2DAdvancedColorImagesRenderer
  • m_hit : GameObject
  • m_hitColor : Material
  • m_hitMaterial : GameObject
  • m_hitSound : GameObject
  • m_hitTime : GameObject
  • m_hnsBufferDuration : WASAPIRenderer
  • m_hologramEnabled : MediaCaptureManager
  • m_holographicCamera : CameraResources
  • m_holographicDisplayIsAvailableChangedEventToken : BasicHologramMain
  • m_holographicSpace : _360VideoPlaybackMain , sealed , DeviceResources , sealed , BasicHologramMain , sealed , BasicHologramMain , DeviceResources , sealed , HolographicFaceTrackerMain , sealed , HolographicMRCSampleMain , sealed , HolographicSpatialMappingMain , sealed , HolographicSpatialStageMain , sealed , HolographicTagAlongSampleMain , sealed , HolographicVoiceInputMain , sealed , HolographicPaintMain
  • m_hr : sealed
  • m_hsMaskRadiusDips : PhotoAdjustmentRenderer
  • m_id : SymbologyListEntry , School , User
  • m_idIncrement : SampleOverlay
  • m_ignoreLayout : BaseElement
  • m_imageElement : sealed , FrameRenderer
  • m_imageInfo : D2DAdvancedColorImagesRenderer , sealed
  • m_imageMaxCLL : sealed
  • m_imageOffset : D2DAdvancedColorImagesRenderer
  • m_imagePath : sealed
  • m_imageProperties : Scenario1
  • m_imageSize : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_imageSource : D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_imageTarget : sealed
  • m_imageText : sealed
  • m_inactiveSecondsCounter : MediaTransportControls
  • m_indexBuffer : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , MeshObject , RenderingHelper , Stroke , ClearTool
  • m_indexCount : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , MeshObject , RenderingHelper , Stroke , ClearTool
  • m_indices : SceneObject
  • m_initialized : GameRenderer
  • m_initialPosition : HandHandler
  • m_initSegmentData : MediaStream
  • m_innerFilter : PlugInFilter , HttpMeteredConnectionFilter , HttpRetryFilter
  • m_inputLayout : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_inputLayouts : DeviceResources
  • m_inputLoopWorker : sealed , PlaybackPage
  • m_inputRect : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftTransform , RippleEffect , WaveEffect
  • m_insideTargetBoard : SpatialControllerHandler
  • m_installedLocationPath : MediaReader
  • m_interactionDetectedToken : HolographicPaintMain
  • m_interactionManager : SpatialInputHandler
  • m_interactionMode : Scenario1_Basic
  • m_interfaceMemberAge : sealed
  • m_interfaceMemberArg : sealed
  • m_interfaceMemberAuthType : sealed
  • m_interfaceMemberInStr1 : sealed
  • m_interfaceMemberInStr2 : sealed
  • m_interfaceMemberMessage : sealed
  • m_interfaceMemberOutStr : sealed
  • m_interfaceMemberPassphrase : sealed
  • m_interfaceMemberScanList : sealed
  • m_interfaceMemberSSID : sealed
  • m_interfaceMemberStatus2 : sealed
  • m_interfaceName : sealed
  • m_internalReleased : ViewLifetimeControl
  • m_inverseView : Camera
  • m_isActive : final
  • m_isApp : sealed
  • m_isAppActive : sealed
  • m_isAppTrial : sealed
  • m_isAuthenticated : Scenario1ViewModel
  • m_isAvailableForPurchase : sealed
  • m_IsBackground : WASAPIRenderer
  • m_isBusAttachmentConnected : Scenario1ViewModel , Scenario2ViewModel
  • m_isComputeSupported : D2DAdvancedColorImagesRenderer
  • m_isCredentialsRequested : Scenario1ViewModel
  • m_isFixedTimeStep : StepTimer
  • m_isFocused : BaseControl , FocusableElement
  • m_isFocusIntersectionCalculated : FocusableElement
  • m_isGamepadPressed : _360VideoPlaybackMain
  • m_IsHWOffload : WASAPIRenderer
  • m_isImageValid : sealed
  • m_IsInitialized : MFSampleGenerator
  • m_isInitialized : BaseControl , BaseElement , MFSampleGenerator
  • m_isInitSegmentDownloading : MediaStream
  • m_isLayoutHorizontal : BaseElement
  • m_IsLowLatency : sealed , WASAPIRenderer
  • m_isLowLatency : Scenario4 , WASAPICapture
  • m_IsMFLoaded : sealed
  • m_IsMinimumLatency : sealed
  • m_isMinimumLatency : Scenario3
  • m_isMouseLeftKeyPressed : _360VideoPlaybackMain
  • m_isNetworkStatusChangeCallbackRegistered : Scenario3_NetworkConnectivityChanges
  • m_isNetworkStatusUpdatePending : Scenario3_NetworkConnectivityChanges
  • m_isParentFocused : FocusableElement
  • m_isPointerPress : sealed
  • m_isPreviewing : Scenario5_DisplayingBarcodePreview
  • m_isProductActive : sealed
  • m_IsRawAudio : WASAPIRenderer
  • m_isReadyToRender : HolographicFaceTrackerMain
  • m_isRenderPassNeeded : BaseElement
  • m_isRippleAnimating : CustomPixelShaderRenderer
  • m_isRoamableScenarioDesc : Scenario4
  • m_isRotating : ToolCarousel
  • m_isRunning : FaceTrackerProcessor
  • m_isScannerClaimed : Scenario5_DisplayingBarcodePreview
  • m_isSelectionChanging : Scenario5_DisplayingBarcodePreview
  • m_isStereo : CameraResources
  • m_isStreaming : CameraStreamProcessor
  • m_isTrial : sealed
  • m_isUITextureRenderNeeded : BaseControl
  • m_isUpdatingNetworkStatus : Scenario3_NetworkConnectivityChanges
  • m_isUpperCaseEnabled : Scenario1ViewModel
  • m_isVisible : BaseControl , BaseElement , MediaTransportControls
  • m_isWindowClosed : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer , D2DSvgImageRenderer
  • m_isWindowVisible : sealed
  • m_items : MasterDetailPage
  • m_jsonValue : HttpJsonContent
  • m_key : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • m_keyDownEventToken : sealed
  • m_keyName : PersistentState
  • m_kind : DeviceSelectorInfo
  • m_knownDevices : Scenario1_Discovery
  • m_lambda : scope_exit< Lambda >
  • m_languages : sealed
  • m_languageTag : sealed
  • m_lastActiveTime : final
  • m_lastCommand : HolographicVoiceInputMain
  • m_lastPosition : QuadRenderer
  • m_lastTime : BasicTimer
  • m_lastUpdateTime : final
  • m_latestFaces : FaceTrackerProcessor
  • m_latestFrame : VideoFrameProcessor
  • m_latestFrameData : CameraStreamProcessor
  • m_layoutUpdateInProgress : sealed
  • m_left : MoveLookController
  • m_leftOverTicks : StepTimer
  • m_leftRightPadding : SeekBarElement
  • m_length : SlowInputStream , AnimateLinePosition , Cylinder
  • m_level : Simple3DGame
  • m_levelActive : Simple3DGame
  • m_levelBitmap : GameInfoOverlay
  • m_levelBonusTime : Simple3DGame
  • m_levelCount : Simple3DGame
  • m_levelDuration : Simple3DGame
  • m_levelResourcesLoaded : GameRenderer
  • m_levelTimeRemaining : Simple3DGame
  • m_licenseInfoChanged : GameHud
  • m_licenseInformation : sealed , GameMain
  • m_licenseState : sealed
  • m_lightingPixelShader : RealtimeSurfaceMeshRenderer
  • m_lineEnd : Line
  • m_lineMetrics : sealed
  • m_lineSpacing : sealed
  • m_lineStart : Line
  • m_List : DeviceList
  • m_listening : HolographicVoiceInputMain
  • m_listingInformation : sealed , GameMain
  • m_loadingComplete : VideoRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , final , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_loadingCount : GameMain
  • m_localSettings : Scenario1 , Scenario2
  • m_locatabilityChangedToken : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_location : BasicReaderWriter
  • m_locator : _360VideoPlaybackMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_lock : sealed , CameraStreamProcessor , MediaCaptureManager , WASAPICapture , WASAPIRenderer
  • m_logger : sealed
  • m_logicalSize : DeviceResources
  • m_logoBitmap : SampleOverlay , GameHud
  • m_logoSize : SampleOverlay , GameHud
  • m_lookAt : Camera
  • m_lookInUse : MoveLookController
  • m_lookLastDelta : MoveLookController
  • m_lookLastPoint : MoveLookController
  • m_lookPointerID : MoveLookController
  • m_lookuptable : LookupTable< T, LookupTableSize >
  • m_luminanceView : NV12VideoTexture
  • m_main : sealed , App , sealed
  • m_mainPage : sealed
  • m_mainWindowReactivated : sealed
  • m_manipulationCanceledToken : HandHandler
  • m_manipulationCompletedToken : HandHandler
  • m_manipulationStartedToken : HandHandler
  • m_manipulationUpdatedToken : HandHandler
  • m_manualSsid : Scenario2ViewModel
  • m_manualSsidIsChecked : Scenario2ViewModel
  • m_manualSsidTextBoxVisibility : Scenario2ViewModel
  • m_maxBound : Simple3DGame
  • m_maxCLL : D2DAdvancedColorImagesRenderer
  • m_maximumValue : Scenario3_LaunchAppServices
  • m_maxLevelSupported : DftTransform
  • m_maxPeriodInFrames : WASAPICapture
  • m_MaxPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_maxSecondsInPressingState : Button
  • m_maxTitleSize : GameHud
  • m_maxTrianglesPerCubicMeter : RealtimeSurfaceMeshRenderer
  • m_maxZoom : PhotoAdjustmentRenderer
  • m_mediaCapture : sealed , CameraStreamProcessor , VideoFrameProcessor , HolographicMRCSampleMain , MediaCaptureManager
  • M_mediaElement_CurrentStateChanged() : Player
  • m_mediaFrameReader : CameraStreamProcessor , VideoFrameProcessor
  • m_mediaFrameSource : VideoFrameProcessor
  • m_mediaPlayer : sealed , VideoRenderer
  • M_mediaPlayer_VideoFrameAvailable() : VideoRenderer
  • m_mediaTransportControls : _360VideoPlaybackMain
  • m_memberConnectionResult : sealed
  • m_memberTextSent : sealed
  • m_memoryPreference : CameraStreamProcessor
  • m_mesh : GameObject
  • m_meshCollection : RealtimeSurfaceMeshRenderer
  • m_meshCollectionLock : RealtimeSurfaceMeshRenderer
  • m_meshColor : Material
  • m_meshProperties : final
  • m_meshResourcesMutex : final
  • m_messageCount : sealed
  • m_messageInfo : sealed
  • m_MFSource : WASAPIRenderer
  • m_MFSourceReader : MFSampleGenerator
  • m_minBound : Simple3DGame
  • m_minimumValue : Scenario3_LaunchAppServices
  • m_MinPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_minPeriodInFrames : WASAPICapture
  • m_minZoom : D2DAdvancedColorImagesRenderer
  • m_MixFormat : MFSampleGenerator , WASAPICapture , WASAPIRenderer
  • m_mixFormat : WASAPICapture
  • m_modelConstantBuffer : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_modelConstantBufferData : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , Stroke , Tool , sealed , SourceHandler
  • m_modelMatrix : GameObject
  • m_modelTransformBuffer : final
  • m_moderateMarginsIconAsyncOperation : sealed
  • m_mouseInUse : MoveLookController
  • m_mouseLastPoint : MoveLookController
  • m_mouseLeftInUse : MoveLookController
  • m_mousePointerID : MoveLookController
  • m_mouseRightInUse : MoveLookController
  • m_moveCommand : MoveLookController
  • m_moveFirstDown : MoveLookController
  • m_moveInUse : MoveLookController
  • m_moveLowerRight : MoveLookController
  • m_movePointerID : MoveLookController
  • m_movePointerPosition : MoveLookController
  • m_moveUpperLeft : MoveLookController
  • M_mse_Closed() : Player
  • M_mse_Opened() : Player
  • m_mtcGrid : sealed
  • m_musicEngine : Audio
  • m_musicMasteringVoice : Audio
  • m_mutex : LocationBackgroundTask , ViewLifetimeControl
  • m_Name : sealed
  • m_name : CServiceBase , School , User
  • m_narrowMarginsIconAsyncOperation : sealed
  • m_nativeBusAttachment : sealed
  • m_nativeBusObject : sealed
  • m_nativeOrientation : DeviceResources
  • m_navigationCompletedToken : HandHandler
  • m_navigationStartedToken : HandHandler
  • m_nearPlane : Camera
  • m_network : Scenario1_ManageHotspot
  • m_nextId : Level2 , Level4
  • m_normal : QuadRenderer , Face
  • m_normalMaterial : GameObject
  • m_Number : BadgeNumericNotificationContent
  • m_numFramesWithoutFaces : FaceTrackerProcessor
  • m_numVertices : WaveEffect
  • m_objective : Level
  • m_objects : Simple3DGame
  • m_ocrEngine : DecodeEngine
  • m_onAirTapCallback : ControlBase
  • m_onboardeeNetworkList : Scenario2ViewModel
  • m_onboardeeSsidListVisibility : Scenario2ViewModel
  • m_onboarderNetworkList : Scenario2ViewModel
  • m_onboarderSsidListVisibility : Scenario2ViewModel
  • m_onboardingConfigurationVisibility : Scenario2ViewModel
  • m_onboardingPassword : Scenario2ViewModel
  • m_onboardingProducerIsChecked : Scenario2ViewModel
  • m_onboardSessionAlreadyJoined : Scenario2ViewModel
  • m_OnProcessQueue : OpQueue< T, TOperation >
  • m_op : CStreamSink::CAsyncOperation
  • m_OpQueue : OpQueue< T, TOperation >
  • m_optIn : HttpMeteredConnectionFilter
  • m_orientation : Tool
  • m_orientationTransform2D : DeviceResources
  • m_orientationTransform3D : DeviceResources
  • m_Oscilloscope : sealed
  • m_outlineBrush : CustomTextRenderer
  • m_outputEffect : PhotoAdjustmentRenderer
  • m_outputSize : DeviceResources
  • m_OutputStream : WASAPICapture
  • m_outputStream : WASAPICapture
  • m_overlayWidth : SampleOverlay
  • m_p : unique_cotaskmem_ptr< T >
  • m_padding : SampleOverlay
  • m_pageCollection : sealed
  • m_panelSize : PhotoAdjustmentRenderer
  • m_parent : EmbeddedMFAsyncCallback< Callback >
  • m_parentControlTransform : Button
  • m_parentFocusedPosition : FocusableElement
  • m_parentTextureHeight : FocusableElement
  • m_parentTextureWidth : FocusableElement
  • m_parentTransform : BaseControl
  • m_parentTranslation : BaseElement
  • m_passportAvailable : sealed , SignIn
  • m_passwordVisibility : Scenario2ViewModel
  • m_pause : MoveLookController
  • m_pausedTime : GameTimer
  • m_pausePressed : MoveLookController
  • m_pauseRequested : GameMain
  • m_pauseText : PlayPauseButton
  • m_paymentAidRegistration : sealed
  • m_pbCurrentAppletId : sealed
  • m_pCriticalSection : AutoLock
  • m_pendingOperation : Scenario2_GetPosition , Scenario4_ForegroundGeofence , LocationBackgroundTask
  • m_pendingSelectionDeviceId : Scenario5_DisplayingBarcodePreview
  • m_pendingSurfaceMesh : final
  • m_phone : User
  • m_photoEffectAdded : MediaCaptureManager
  • m_photoScale : sealed
  • m_photoSize : sealed
  • m_physicalDeviceIsChecked : Scenario2ViewModel
  • m_pInvokeFn : AsyncCallback< T >
  • m_pitch : sealed , MoveLookController
  • m_pitchAngle : sealed
  • m_pixelHeight : sealed
  • m_pixelShader : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , GameRenderer , Material , GameRenderer , RenderingHelper
  • m_pixelShaderFlat : GameRenderer
  • m_pixelShaderNV12 : QuadRenderer
  • m_pixelShaderRGB : QuadRenderer
  • m_pixelShaders : DeviceResources
  • m_pixelWidth : sealed
  • m_planeNormal : AnimateCirclePosition
  • m_playActive : sealed
  • m_PlaybackPositionMaxTime : Scenario7_LiveSeekableRange
  • m_PlaybackPositionMinTime : Scenario7_LiveSeekableRange
  • m_player : sealed , Simple3DGame
  • m_playPauseButtonControl : MediaTransportControls
  • m_playText : PlayPauseButton
  • m_PlotData : WASAPICapture
  • m_plotDataBuffer : WASAPICapture
  • m_plotDataMaxPoints : WASAPICapture
  • m_plotDataPointsFilled : WASAPICapture
  • m_plotDataReady : PlotDataSourceT< D >
  • m_plotDataReadyToken : sealed , Scenario4
  • m_point : Face
  • m_PointArray : sealed
  • m_pointBufferMutex : FrameRenderer
  • m_pointerPos : D2DAdvancedColorImagesRenderer
  • m_pointerPressed : BasicHologramMain
  • m_pointerPressedEventToken : sealed
  • m_pointSampler : TextRenderer
  • m_position : BaseControl , MediaTransportControls , SpinningCubeRenderer , sealed , QuadRenderer , SpinningCubeRenderer , ControlBase , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , SlowInputStream , GameObject , Tool , sealed , SourceHandler
  • m_positionalTrackingDeactivatingToken : HolographicSpatialMappingMain
  • m_possiblePurchaseUpgrade : sealed
  • m_pParent : AsyncCallback< T >
  • m_preference : SizePreferenceString
  • m_pressComplete : GameMain
  • m_pressingTimeOut : Button
  • m_pressResult : GameMain
  • m_prevCursor : sealed
  • m_previousBufferHeight : FrameRenderer
  • m_previousBufferWidth : FrameRenderer
  • m_previousDecodeResult : sealed
  • m_previousFrameTimestamp : HolographicFaceTrackerMain
  • m_previousTime : GameTimer
  • m_printDocument : PrintHelper
  • m_printDocumentSource : PrintHelper
  • m_printPages : sealed
  • m_printPreviewPages : PrintHelper
  • m_printTaskRequestedEventToken : PrintHelper
  • m_processingTimeAvgMs : GpuPerformanceTimer
  • m_processingTimeHistory : GpuPerformanceTimer
  • m_processingTimeHistoryIndex : GpuPerformanceTimer
  • m_processingTimeMaxMs : GpuPerformanceTimer
  • m_processingTimeMinMs : GpuPerformanceTimer
  • m_processingTimeMs : GpuPerformanceTimer
  • m_producer : Scenario1ViewModel , Scenario2ViewModel
  • m_producerOptionsVisibility : Scenario1ViewModel
  • m_productId : sealed
  • m_projectionMatrix : Camera
  • m_projectionMatrixLeft : Camera
  • m_projectionMatrixRight : Camera
  • m_properties : sealed
  • m_propertiesLock : FaceTrackerProcessor , VideoFrameProcessor
  • m_propertyChanged : Scenario5_DisplayingBarcodePreview , BluetoothLEDeviceDisplay , DeviceInformationDisplay , ViewLifetimeControl , WordOverlay , Scenario1_Colors , UserViewModel , Scenario1_Basic
  • m_propertySet : sealed
  • m_protectBufferScenario : Scenario6
  • m_protectedBuffer : Scenario6 , EdpBackgroundTask
  • m_protectedMessage : Scenario6
  • m_protectedStream : Scenario7
  • m_protectScenarioDesc : Scenario4
  • m_protectStreamScenario : Scenario7
  • m_provider : sealed
  • m_providers : sealed
  • m_proxyBusObject : sealed
  • m_qpcFrequency : StepTimer
  • m_qpcLastTime : StepTimer
  • m_qpcMaxDelta : StepTimer
  • m_qpcSecondCounter : StepTimer
  • m_quadRenderer : CameraStreamCoordinateMapperMain , HolographicFaceTrackerMain
  • m_quadTexture : QuadRenderer
  • m_quadTextureSamplerState : VideoRenderer , QuadRenderer
  • m_quadTextureView : QuadRenderer
  • m_queueId : unique_shared_work_queue , EmbeddedMFAsyncCallback< Callback >
  • m_radius : AnimateCirclePosition , Cylinder , Sphere , ToolCarousel
  • m_radiusX : Ellipse , FilledEllipse
  • m_radiusY : Ellipse , FilledEllipse
  • m_raised : sealed
  • m_random : Scenario2_Effects
  • m_rasterizeDepthMeshConstants : GpuCoordinateMapper
  • m_rasterizeDepthMeshInputLayout : GpuCoordinateMapper
  • m_rasterizeDepthMeshPixelShader : GpuCoordinateMapper
  • m_rasterizeDepthMeshVertexShader : GpuCoordinateMapper
  • m_rasterizeFrameBlob : CameraCoordinateMapper
  • m_reader : sealed
  • m_readerName : SmartCardListItem
  • m_readers : sealed
  • m_ReaderState : MFSampleGenerator
  • m_readerState : MFSampleGenerator
  • m_ReadingToken : sealed
  • m_readingToken : sealed
  • m_readyPlaylists : Scenario2_Effects
  • m_readyToRender : CameraStreamCoordinateMapperMain
  • m_recognitionSound : HolographicVoiceInputMain
  • m_recording : HolographicMRCSampleMain
  • m_rect : Rectangle , FilledRectangle
  • m_RectFocusOutline : Button
  • m_RectPressedBackgroundFill : Button
  • m_redBrush : TargetTexture
  • m_Ref : MFSampleGenerator
  • m_refCount : FontNameCollector , RippleEffect , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , WaveEffect , CustomTextRenderer , Listener , ViewLifetimeControl
  • m_referenceFrame : HolographicMRCSampleMain , _360VideoPlaybackMain , HolographicFaceTrackerMain , HolographicSpatialMappingMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_refreshModelConstantBufferData : Tool , SourceHandler
  • m_registeredListener : sealed
  • m_reinhardEffect : D2DAdvancedColorImagesRenderer
  • m_relativeIntersectionPoint : BaseControl
  • m_released : ViewLifetimeControl
  • m_releasedToken : SecondaryViewPage
  • m_remainingTimeString : SeekBarElement
  • m_remainingTimeText : SeekBarElement
  • m_remoteSystemWatcher : Scenario1_Discovery
  • m_renderCount : DistanceFieldRenderer
  • m_renderEffectKind : D2DAdvancedColorImagesRenderer
  • m_renderer : Scenario3 , sealed , GameMain , Simple3DGame , GameMain , Simple3DGame , Scenario2
  • m_renderingHelper : HolographicPaintMain
  • m_renderItem : BaseControl
  • m_renderLoopWorker : GameMain
  • m_renderNeeded : GameMain
  • m_renderObjects : Simple3DGame
  • m_renderOptionsViewModel : sealed
  • m_renderTargetView : TextRenderer , DistanceFieldRenderer , TextRenderer
  • m_requestCount : sealed
  • m_resetBuffers : Stroke , ClearTool
  • m_result : sealed
  • m_resumingEventToken : sealed
  • m_revokeEventScenarioText : Scenario5
  • m_revokeScenarioTxt : Scenario5
  • m_right : MoveLookController
  • m_rippleEffect : CustomPixelShaderRenderer
  • m_rootPage : Scenario5_Capabilities , sealed , Scenario1ViewModel , Scenario2ViewModel , Scenario1_Discovery , Scenario2_LaunchUri , Scenario3_LaunchAppServices
  • m_RootPage : sealed
  • m_rotation : ControlBase , BaseControl , MediaTransportControls
  • m_rotationAxis : ToolCarousel
  • m_rotationdelta : sealed
  • m_rotationDirection : ToolCarousel
  • m_rotationMatrix : AnimateCirclePosition , Cylinder , Face
  • m_rotationStart : ToolCarousel
  • m_runningInConsole : CSampleService
  • m_sampleNetworkInfoVisibility : Scenario2ViewModel
  • m_sampleOverlay : CustomVertexShaderMain , CustomComputeShaderMain , CustomPixelShaderMain , D2DGradientMeshMain , DWriteColorTextRendererMain
  • m_SampleQueue : ToneSampleGenerator , MFSampleGenerator
  • m_sampleQueue : MFSampleGenerator , ToneSampleGenerator
  • m_SampleQueueTail : MFSampleGenerator , ToneSampleGenerator
  • m_sampleQueueTail : MFSampleGenerator
  • m_sampler : BaseControl
  • m_SampleReadyAsyncResult : WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • m_sampleReadyAsyncResult : WASAPICapture
  • m_SampleReadyEvent : WASAPIRenderer , WASAPICapture
  • m_sampleReadyKey : WASAPICapture
  • m_SampleReadyKey : WASAPICapture , WASAPIRenderer
  • m_samplerLinear : GameRenderer
  • m_samplerState : GpuCoordinateMapper , QuadRenderer , Button , Cursor
  • m_saturation : PhotoAdjustmentRenderer
  • m_savedProfileName : Scenario2ViewModel
  • m_savedState : Simple3DGame
  • m_scale : CustomComputeShaderRenderer , BaseControl , CustomPixelShaderRenderer , ControlBase
  • m_scaledImage : PhotoAdjustmentRenderer , D2DAdvancedColorImagesRenderer
  • m_scaleFactor : Scenario2
  • m_scaleValue : D2DSvgImageRenderer
  • m_scannerDataReceivedToken : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • m_scannerEnabled : sealed
  • m_scannerReleaseRequestedToken : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • m_scannerSupportsPreview : Scenario5_DisplayingBarcodePreview
  • m_scanPanelVisibility : Scenario2ViewModel
  • m_scenario1ViewModel : Scenario1
  • m_scenario2ViewModel : Scenario2
  • m_scenarioPage : PrintHelper
  • m_scenarioText : Scenario2
  • m_sceneController : HolographicSpatialStageMain , SpatialStageManager
  • m_sceneObjects : SceneController
  • m_sceneRenderer : CustomComputeShaderMain , CustomPixelShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , DWriteColorTextRendererMain
  • m_screenViewport : DeviceResources
  • m_sdrOverlayEffect : D2DAdvancedColorImagesRenderer
  • m_secondsElapsedSinceTimeUpdate : SeekBarElement
  • m_secondsPerCount : GameTimer
  • m_secondsUntilSoundIsComplete : HolographicVoiceInputMain
  • m_SecretMessage : EdpBackgroundTask
  • m_seekbarControl : MediaTransportControls
  • m_segment : AnimateLineListPosition
  • m_segmentInformation : MediaStream
  • m_segmentInfoType : MediaStream
  • m_segments : MediaStream
  • m_segmentTemplateIdentifier : MediaStream
  • m_selectedAccountAction : sealed
  • m_selectedAuthType : Scenario2ViewModel
  • m_selectedOnboardeeNetwork : Scenario2ViewModel
  • m_selectedOnboarderNetwork : Scenario2ViewModel
  • m_selectedSampleNetwork : Scenario2ViewModel
  • m_selectedSoftAPNetwork : Scenario2ViewModel
  • m_selectedSourceGroupIndex : sealed
  • m_selectedWiFiAdapterIndex : Scenario2ViewModel
  • m_selector : DeviceSelectorInfo
  • m_serviceInterface : sealed
  • m_ServiceObjectPath : sealed
  • m_session : sealed
  • m_sessionId : sealed
  • m_sessionListener : sealed
  • m_sessionPort : sealed
  • m_sessionPortListener : sealed
  • m_setBarcodeSymbologyAttributesRequestedToken : sealed
  • m_settingsValues : PersistentState
  • m_shaderResourceView : DistanceFieldRenderer , TextRenderer
  • m_ShadersCreated : sealed
  • m_shadersLoaded : MediaTransportControls
  • m_ShadersNeed : sealed
  • m_shape : Button
  • m_ShareContent : Scenario12_ShareData
  • m_sharedApplicationLink : Scenario13_ShareTarget
  • m_sharedBitmapStreamRef : Scenario13_ShareTarget
  • m_sharedCustomData : Scenario13_ShareTarget
  • m_sharedDataContentSourceApplicationLink : Scenario13_ShareTarget
  • m_sharedDataContentSourceWebLink : Scenario13_ShareTarget
  • m_sharedDataDescription : Scenario13_ShareTarget
  • m_sharedDataLogoBackgroundColor : Scenario13_ShareTarget
  • m_sharedDataPackageFamilyName : Scenario13_ShareTarget
  • m_sharedDataSquare30x30Logo : Scenario13_ShareTarget
  • m_sharedDataTitle : Scenario13_ShareTarget
  • m_sharedHtmlFormat : Scenario13_ShareTarget
  • m_sharedResourceMap : Scenario13_ShareTarget
  • m_sharedStorageItems : Scenario13_ShareTarget
  • m_sharedText : Scenario13_ShareTarget
  • m_sharedThumbnailStreamRef : Scenario13_ShareTarget
  • m_sharedWebLink : Scenario13_ShareTarget
  • m_shareOperation : Scenario13_ShareTarget
  • m_showHeader : sealed
  • m_showHelpText : CameraStreamCoordinateMapperMain
  • m_showOnboardeeSsidList : Scenario2ViewModel
  • m_showOnboarderSsidList : Scenario2ViewModel
  • m_showTitle : GameHud
  • m_signals : sealed
  • m_Size : CAsyncState , sealed
  • m_size : Button , Cursor , Panel
  • m_sizeX : WaveEffect
  • m_sizeY : WaveEffect
  • m_skewX : CustomVertexShaderRenderer , WaveEffect
  • m_skewY : WaveEffect , CustomVertexShaderRenderer
  • m_sliderFrontSegment : SeekBarElement
  • m_sliderFrontSegmentEnd : SeekBarElement
  • m_sliderFrontSegmentStart : SeekBarElement
  • m_SliderFullScale : Scenario7_LiveSeekableRange
  • m_sliderHeight : SeekBarElement
  • m_sliderPosition : SeekBarElement
  • m_sliderRemainingSegment : SeekBarElement
  • m_sliderRemainingSegmentEnd : SeekBarElement
  • m_sliderRemainingSegmentStart : SeekBarElement
  • m_sliderWidth : SeekBarElement
  • m_snapSizeToRootElement : BaseControl
  • m_softAPPassword : Scenario2ViewModel
  • m_softwareTriggerStarted : Scenario5_DisplayingBarcodePreview
  • m_soundData : SoundEffect
  • m_soundEffectEngine : Audio
  • m_soundEffectMasteringVoice : Audio
  • m_source : sealed
  • m_sourceCollection : sealed
  • m_sourceDetectedToken : HolographicPaintMain
  • m_sourceFormat : CameraStreamProcessor
  • m_sourceId : SourceHandler
  • m_sourceKind : CameraStreamProcessor , SourceHandler
  • m_sourceLostToken : HolographicPaintMain
  • m_sourceMap : HolographicPaintMain
  • m_sourcePressedEventToken : SpatialInputHandler
  • m_sourcePressedToken : HolographicPaintMain
  • m_sourceReader : MFSampleGenerator
  • m_sources : HolographicPaintMain
  • m_sourceState : SpatialInputHandler
  • m_sourceUpdatedToken : HolographicPaintMain
  • m_sourceUri : sealed
  • m_sourceVoice : SoundEffect
  • m_spatialInputHandler : _360VideoPlaybackMain , HolographicVoiceInputMain
  • m_spatialInteractionManager : HolographicPaintMain
  • m_spatialLocator : BasicHologramMain
  • m_spatialPerceptionAccessRequested : HolographicSpatialMappingMain
  • m_spatialStageChangedEventToken : SpatialStageManager
  • m_spatialStageManager : HolographicSpatialStageMain
  • m_spCapture : sealed
  • m_spDPadHelper : SpatialControllerHandler
  • m_specularColor : Material
  • m_specularExponent : Material
  • m_speechCommandData : HolographicVoiceInputMain
  • m_speechRecognitionQualityDegradedToken : HolographicVoiceInputMain
  • m_speechRecognizer : HolographicVoiceInputMain
  • m_speechRecognizerResultEventToken : HolographicVoiceInputMain
  • m_speechSynthesisSound : HolographicVoiceInputMain
  • m_sphereTexture : GameRenderer
  • m_spinningCubeRenderer : HolographicFaceTrackerMain , HolographicVoiceInputMain
  • m_spMFDXGIDeviceManager : MediaCaptureManager
  • m_spRenderer : sealed
  • m_squares : Stroke
  • m_stageBoundsShape : SpatialStageManager
  • m_stageVisibleAreaIndicatorShape : SpatialStageManager
  • m_startPosition : AnimateLinePosition , AnimateCirclePosition
  • m_startRecognitionSound : HolographicVoiceInputMain
  • m_startSoftwareTriggerRequestedToken : sealed
  • m_startTime : BasicTimer , Animate
  • m_startTimestampQuery : GpuPerformanceTimer
  • m_state : MoveLookController
  • m_stateBlock : SampleOverlay , BaseControl , TextRenderer , SampleOverlay
  • m_StateChangedEvent : sealed
  • m_stationaryFrameOfReference : SpatialStageManager
  • m_stationaryReferenceFrame : BasicHologramMain , HolographicTagAlongSampleMain
  • m_statisticsTextRenderer : CameraStreamCoordinateMapperMain
  • m_status : sealed , PropertyGetContext< T > , PropertySetContext , sealed , CServiceBase , sealed
  • m_statusBufferScenario : Scenario6
  • m_statusHandle : CServiceBase
  • m_stereoEnabled : DeviceResources
  • m_stopSoftwareTriggerRequestedToken : sealed
  • m_stopTime : GameTimer
  • m_straighten : PhotoAdjustmentRenderer
  • m_streaming : sealed
  • m_streamingEnabled : CameraStreamCoordinateMapperMain
  • m_streams : Period
  • m_strokeInsideTargetBoard : SpatialControllerHandler
  • m_strokes : HolographicPaintMain
  • m_strokeThickness : Rectangle , Line , Ellipse
  • m_supportedSymbologies : DecodeEngine
  • m_supportsVprt : DeviceResources
  • m_suppressRendererUpdates : sealed
  • m_surface : VideoRenderer
  • m_surfaceAccessAllowed : HolographicSpatialMappingMain
  • m_surfaceMesh : final
  • m_surfaceMeshCount : RealtimeSurfaceMeshRenderer
  • m_surfaceMeshOptions : HolographicSpatialMappingMain
  • m_surfaceObserver : HolographicSpatialMappingMain
  • m_surfacesChangedToken : HolographicSpatialMappingMain
  • m_suspendEventHandlerRegistrationToken : sealed
  • m_suspendingEventToken : sealed
  • m_svgDocument : D2DSvgImageRenderer
  • m_swapChain : DeviceResources
  • m_swapChainPanel : DeviceResources
  • m_symbologyAttributes : sealed
  • m_sysAudioEnabled : MediaCaptureManager
  • m_SystemMediaControls : sealed
  • m_systemMediaControlsButtonToken : Scenario2 , Scenario3
  • m_SystemMediaControlsButtonToken : sealed
  • m_tappedToken : HandHandler , SpatialControllerHandler
  • m_target : GameObject
  • m_targetBoard : SourceHandler
  • m_targetElapsedTicks : StepTimer
  • m_targetForward : QuadRenderer
  • m_targetId : GameObject
  • m_targetPosition : QuadRenderer , SpinningCubeRenderer
  • m_targetRasterizedDepthTexture : CameraCoordinateMapper
  • m_targetRasterizedDepthTextureDSV : CameraCoordinateMapper
  • m_targetRasterizedDepthTextureSRV : CameraCoordinateMapper
  • m_targetTexCoordOffset : QuadRenderer
  • m_targetTexCoordScale : QuadRenderer
  • m_targetTexture : CameraCoordinateMapper
  • m_targetTextureRTV : CameraCoordinateMapper
  • m_targetTextureSRV : CameraCoordinateMapper
  • m_targetUp : QuadRenderer
  • m_taskInstance : sealed
  • m_taskName : EdpBackgroundTask
  • m_taskRunning : sealed , FrameRenderer
  • m_tce : sealed
  • m_tempBrush : CustomTextRenderer
  • m_temperatureTint : PhotoAdjustmentRenderer
  • m_testDataToCopy : Scenario3
  • m_tetheringManager : Scenario1_ConfigureMobileHotspot , Scenario2_ToggleMobileHotspot
  • m_texCoordOffset : QuadRenderer
  • m_texCoordScale : QuadRenderer
  • m_text : sealed , Text , DecodeResult , sealed , Item , ItemViewModel
  • m_textAscentBrush : sealed
  • m_textBackgroundBrush : sealed
  • m_textBackgroundColor : sealed
  • m_textBlock : sealed
  • m_textBrush : GameHud , sealed , GameHud , GameInfoOverlay
  • m_textBrushGrey : GameHud
  • m_textColor : sealed
  • m_textDescentBrush : sealed
  • m_textFormat : Text , TextRenderer , TargetTexture
  • m_textFormatBody : GameHud , GameInfoOverlay
  • m_textFormatBodySymbol : GameHud
  • m_textFormatTitle : GameInfoOverlay
  • m_textFormatTitleBody : GameHud
  • m_textFormatTitleHeader : GameHud
  • m_textFormatTitleLicense : GameHud
  • m_textLayout : SampleOverlay , Text , TextRenderer , SampleOverlay , sealed
  • m_textLayoutImageSource : sealed
  • m_textLayoutLineMetrics : sealed
  • m_textLineGapBrush : sealed
  • m_textMetrics : TextRenderer
  • m_textRenderer : DWriteColorTextRendererRenderer , HolographicFaceTrackerMain
  • m_textSize : SeekBarElement
  • m_texture : DistanceFieldRenderer , BaseControl , VideoRenderer , NV12VideoTexture , TextRenderer , VideoRenderer
  • m_textureHeight : BaseControl , TextRenderer , DistanceFieldRenderer
  • m_textureIndex : Button , Cursor
  • m_textureRV : Material
  • m_textures : DeviceResources
  • m_textureShaderResourceView : BaseControl
  • m_textureTarget : BaseControl
  • m_textureView : Button , VideoRenderer
  • m_textureWidth : TextRenderer , BaseControl , DistanceFieldRenderer
  • m_textVerticalOffset : SampleOverlay
  • m_threshold : ThumbstickDPadHelper , TouchpadDPadHelper
  • m_timeLimit : Level
  • m_timer : sealed , HolographicMRCSampleMain , HolographicSpatialMappingMain , Simple3DGame , CustomVertexShaderMain , HolographicFaceTrackerMain , CameraStreamCoordinateMapperMain , HolographicVoiceInputMain , _360VideoPlaybackMain , BasicHologramMain , CustomPixelShaderRenderer , CustomVertexShaderRenderer , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicPaintMain
  • m_timezone : User
  • m_title : SizePreferenceString , ViewLifetimeControl , sealed , ItemViewModel , Item , sealed
  • m_titleBody : GameHud
  • m_titleBodyLayout : GameHud
  • m_titleBodyVerticalOffset : GameHud
  • m_titleHeader : GameHud
  • m_titleHeaderLayout : GameHud
  • m_titleLicenseInfo : GameHud
  • m_titleLicenseInfoLayout : GameHud
  • m_titleLicenseVerticalOffset : GameHud
  • m_titleRectangle : GameInfoOverlay
  • m_titleString : GameInfoOverlay
  • m_toggling : Scenario2_ToggleMobileHotspot
  • m_token : sealed
  • m_ToneSource : WASAPIRenderer
  • m_toolPosition : SourceHandler
  • m_tools : HolographicPaintMain
  • m_toolsCarousel : HolographicPaintMain
  • m_tooSmallActive : GameInfoOverlay
  • m_tooSmallBitmap : GameInfoOverlay
  • m_topBottomPadding : SeekBarElement
  • m_topScore : Simple3DGame
  • m_total : BasicTimer
  • m_totalHits : Simple3DGame
  • m_totalLength : AnimateLineListPosition
  • m_totalShots : Simple3DGame
  • m_totalTicks : StepTimer
  • m_trackingFaces : HolographicFaceTrackerMain
  • m_transform : ControlBase , Scenario2 , BaseControl , MediaTransportControls
  • m_transformedFontSize : Text
  • m_transformedImage : CustomPixelShaderRenderer , CustomComputeShaderRenderer , CustomVertexShaderRenderer
  • m_transformedTranslation : BaseElement
  • m_transformMatrix : BaseElement
  • m_transformRecalculationNeeded : BaseElement
  • m_translation : BaseElement
  • m_triangleIndices : final
  • m_triggerDetails : sealed
  • m_turnedOn : Button
  • m_type : School , ControlBase
  • m_uiControl : GameMain
  • m_uniqueFontNames : FontNameCollector
  • m_unprotectedBuffer : Scenario6
  • m_unprotectedStream : Scenario7
  • m_up : MoveLookController , Camera
  • m_updatedMeshProperties : final
  • m_updatedTriangleIndices : final
  • m_updatedVertexNormals : final
  • m_updatedVertexPositions : final
  • m_updateReady : final
  • m_updateState : GameMain
  • m_updateStateNext : GameMain
  • m_updateVertexResourcesTask : final
  • m_usedFontNames : sealed
  • m_userId : UserViewModel
  • m_userRotation : Scenario2
  • m_useWireframe : SceneObject
  • m_usingVprtShaders : SpinningCubeRenderer , Cursor , SpinningCubeRenderer , SceneObject , VideoRenderer , Button , SpinningCubeRenderer , RenderingHelper , RealtimeSurfaceMeshRenderer , QuadRenderer , Panel , SpinningCubeRenderer , QuadRenderer
  • m_value : PropertyGetContext< T > , sealed
  • m_value2 : sealed
  • m_velocity : SpinningCubeRenderer , GameObject , QuadRenderer , MoveLookController , QuadRenderer
  • m_verified : User
  • m_vertexBuffer : QuadRenderer , WaveEffect , QuadRenderer , Button , SceneObject , QuadRenderer , MeshObject , SpinningCubeRenderer , GpuCoordinateMapper , SpinningCubeRenderer , Stroke , ClearTool , SpinningCubeRenderer , RenderingHelper , DistanceFieldRenderer , Cursor , VideoRenderer , Panel
  • m_vertexCount : GpuCoordinateMapper , MeshObject
  • m_vertexLayout : GameRenderer
  • m_vertexNormals : final
  • m_vertexPositions : final
  • m_vertexShader : SpinningCubeRenderer , QuadRenderer , Button , RealtimeSurfaceMeshRenderer , SceneObject , DistanceFieldRenderer , SpinningCubeRenderer , RenderingHelper , BaseControl , VideoRenderer , Panel , SpinningCubeRenderer , QuadRenderer , GameRenderer , QuadRenderer , SpinningCubeRenderer , Cursor , Material , GameRenderer
  • m_vertexShaderFlat : GameRenderer
  • m_vertexShaders : DeviceResources
  • m_vertexStride : DistanceFieldRenderer
  • m_vertices : SceneObject
  • m_videoEffectAdded : MediaCaptureManager
  • m_videoFrameAvailToken : VideoRenderer
  • m_videoFrameProcessor : HolographicFaceTrackerMain
  • m_videoProcessor : FaceTrackerProcessor
  • m_videoRenderer : _360VideoPlaybackMain
  • m_videoTexture : HolographicFaceTrackerMain
  • m_viewId : ViewLifetimeControl
  • m_viewMatrix : Camera
  • m_viewProjectionConstantBuffer : CameraResources
  • m_visibilityChangedEventToken : sealed
  • m_visibilityEventRegistrationToken : sealed
  • m_VisibilityToken : sealed
  • m_visible : GameMain , GameInfoOverlay
  • m_visitTask : Scenario8_VisitsBackgroundTask
  • m_visualizeDepthMeshConstants : GpuCoordinateMapper
  • m_visualizeDepthMeshInputLayout : GpuCoordinateMapper
  • m_visualizeDepthMeshPixelShader : GpuCoordinateMapper
  • m_visualizeDepthMeshVertexShader : GpuCoordinateMapper
  • m_visualizeFrameBlob : CameraCoordinateMapper
  • m_waitForCenter : ThumbstickDPadHelper
  • m_waitForRelease : SpatialControllerHandler
  • m_waitingForSpeechCue : HolographicVoiceInputMain
  • m_waitingForSpeechPrompt : HolographicVoiceInputMain
  • m_wallsTexture : GameRenderer
  • m_watcher : Scenario2ViewModel
  • m_Watcher : sealed
  • m_watcher : sealed , Scenario1ViewModel
  • m_watcherDeviceAddedToken : sealed
  • m_watcherDeviceRemovedToken : sealed
  • m_watcherDeviceUpdatedToken : sealed
  • m_WatcherStarted : DeviceList
  • m_WatcherSuspended : DeviceList
  • m_WAVDataWriter : WASAPICapture
  • m_waveEffect : CustomVertexShaderRenderer
  • m_waveFormat : MediaReader
  • m_waveOffset : WaveEffect
  • m_weak : sealed
  • m_whiteboard : HolographicPaintMain
  • m_whiteBrush : SampleOverlay , TextRenderer , TargetTexture , TextRenderer , SampleOverlay , TextRenderer , SampleOverlay
  • m_whiteScaleEffect : D2DAdvancedColorImagesRenderer
  • m_wicColorContext : PhotoAdjustmentRenderer , D2DAdvancedColorImagesRenderer
  • m_wicFactory : DeviceResources , BasicLoader , DeviceResources
  • m_wideMarginsIconAsyncOperation : sealed
  • m_width : sealed , Face , NV12VideoTexture , sealed
  • m_widthVector : Face
  • m_wiFiAdapter : Scenario2ViewModel
  • m_wiFiAdapterDisplayNames : Scenario2ViewModel
  • m_wiFiAdapterList : Scenario2ViewModel
  • m_wiFiAdapterListVisibility : Scenario2ViewModel
  • m_window : ViewLifetimeControl , DeviceResources
  • m_windowClosed : sealed , GameMain , sealed
  • m_windowClosedEventToken : sealed
  • m_windowVisible : sealed
  • m_wireframeRasterizerState : RealtimeSurfaceMeshRenderer , SceneObject
  • m_wordBoundingBox : WordOverlay
  • m_work : CSampleService
  • m_workerThread : FaceTrackerProcessor
  • m_writing : WASAPICapture
  • m_wsDebugLog : sealed
  • m_yaw : MoveLookController
  • m_yawAngle : sealed
  • m_yellowBrush : TargetTexture
  • m_zoom : D2DAdvancedColorImagesRenderer , PhotoAdjustmentRenderer
  • madeVisible : sealed , ViewLifetimeControl
  • MagneticFieldStrengthAmperePerMetre : PresentationFormats
  • MagneticFluxDensityTesla : PresentationFormats
  • MagneticFluxWeber : PresentationFormats
  • magnitudeScale : DftTransform
  • main : AppView
  • Main() : Program , VisualPropertiesFactory
  • main : sealed
  • MainDispatcher : ProjectionViewPageInitializationData
  • mainDispatcher : App , SecondaryViewPage , ProjectionViewPage , sealed
  • MainDispatcher : SampleState , App
  • MainGrid_Entered() : Scenario4_InteractionFeedback
  • MainGrid_Exited() : Scenario4_InteractionFeedback
  • MainPage() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed
  • MainPage_BackRequested() : MainPage
  • MainPage_CachedFile() : MainPage_CachedFile
  • MainPage_Loaded() : MainPage
  • MainPage_OneHanded() : MainPage_OneHanded
  • MainPage_PickFile() : MainPage_PickFile
  • MainPage_SaveFile() : MainPage_SaveFile
  • MainPageDispatcher : ProjectionViewBroker
  • mainviewId : VideoGallery
  • MainViewId : SampleState , sealed
  • mainViewId : sealed , ProjectionViewPage
  • MainViewId : App , ProjectionViewPageInitializationData
  • mainViewId : App , SecondaryViewPage
  • MainViewId : ProjectionViewBroker
  • mainviewId : sealed
  • MainViewModel() : MainViewModel
  • mainWindowReactivated : AppView
  • Make() : SourceHandler
  • MakeColor() : sealed , Functions
  • MakeCurrent_Click() : Scenario7_DownloadReordering , sealed
  • MakeCylinderFaceIndices() : MeshGeometry
  • MakeCylinderFaceVertices() : MeshGeometry
  • MakeCylinderSideIndices() : MeshGeometry
  • MakeNumberBaseSegmentInfo() : DashManifestParser
  • MakeTexturedCube() : MeshGeometry
  • MakeTexturedCylinder() : MeshGeometry
  • MakeTimelineInfo() : DashManifestParser
  • Manage_Click() : Scenario2_ManageAccount , sealed
  • ManageAccount : sealed
  • ManageCardScenario() : ManageCardScenario
  • manager : SessionWrapper , AdvertisementWrapper , SocketWrapper , DiscoveredDeviceWrapper
  • Manager() : Manager
  • manager : StreamSocketListenerWrapper
  • ManagerProp : DataModel
  • ManageSession() : ManageSession
  • ManageSessionResponse() : ManageSessionResponse
  • manifest : DashManifestParser , LiveSourceBufferManager , Player
  • Manifest() : Manifest , LiveSourceBufferManager
  • manifestReloadTimer : Player
  • ManifestUri : AdaptiveContentModel
  • ManipulateMe_ManipulationCompleted() : Scenario4 , sealed
  • ManipulateMe_ManipulationDelta() : Scenario4 , sealed
  • ManipulateMe_ManipulationInertiaStarting() : Scenario4 , sealed
  • ManipulateMe_ManipulationStarted() : Scenario4 , sealed
  • ManipulationInputProcessor() : ManipulationInputProcessor , sealed
  • manipulationProcessor : Scenario5 , sealed
  • ManipulationProcessor() : sealed
  • ManualControlButton_Click() : MainPage
  • ManualFocusRadioButton_Checked() : MainPage
  • ManualSsid : Scenario2ViewModel
  • ManualSsidIsChecked : Scenario2ViewModel
  • ManualSsidTextBoxVisibility : Scenario2ViewModel
  • Manufacturer : RawSMBIOSSystemInfo
  • mapBillboardAddButton_Click() : Scenario2 , sealed
  • mapBillboardStreamReference : Scenario2 , sealed
  • MapChanged : EmployeeDictionary
  • mapClearButton_Click() : sealed , Scenario2
  • MapCoordinates : PlaceLocation
  • MapDepthToColor() : FrameRenderer
  • mapDeviceWatchersToDeviceSelector : Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect
  • mapElement3DAddButton_Click() : Scenario2 , sealed
  • mapElementsLayer1Button_Click() : Scenario10 , sealed
  • mapElementsLayer2Button_Click() : Scenario10 , sealed
  • mapIconAddButton_Click() : Scenario2 , sealed
  • MapIconState : Scenario11 , sealed
  • MapIconStateToStyleEntryState : sealed , Scenario11
  • mapIconStreamReference : Scenario2 , sealed
  • MapInputRectsToOutputRect() : SdrOverlayEffect , RippleEffect , ReinhardEffect , LuminanceHeatmapEffect , FilmicEffect , DftTransform , WaveEffect
  • MapInvalidRect() : DftTransform , ReinhardEffect , SdrOverlayEffect , LuminanceHeatmapEffect , FilmicEffect , WaveEffect , RippleEffect
  • mapItemButton_Click() : Scenario3 , sealed
  • MapLayers : sealed
  • mapModelStreamReference : Scenario2 , sealed
  • MapOutputRectToInputRects() : FilmicEffect , RippleEffect , WaveEffect , LuminanceHeatmapEffect , DftTransform , SdrOverlayEffect , ReinhardEffect
  • mapPolygonAddButton_Click() : Scenario2 , sealed
  • mapPolylineAddButton_Click() : Scenario2 , sealed
  • Margin : PageDescription
  • MarkAsManualConnect : ConfigStore
  • MarkHotProducts() : MarkHotProducts
  • MarkIn() : Scenario3_Trim , sealed
  • MarkOut() : Scenario3_Trim , sealed
  • MarshalInterface() : CMediaBufferWrapper
  • MarshalLog() : sealed , Scenario1_Download , Scenario2_Upload
  • MarshalNotifyUser() : sealed
  • MassConcentrationKilogramPerCubicMetre : PresentationFormats
  • MassDensityMilligramPerdeciLitre : PresentationFormats
  • MassDensityMillimolePerLitre : PresentationFormats
  • MassKilogram : PresentationFormats
  • MassPound : PresentationFormats
  • MassTonne : PresentationFormats
  • MasterDetailPage() : MasterDetailPage
  • MasterListView_ItemClick() : MasterDetailPage
  • Matched : DeviceListEntry
  • MatchPreviewAspectRatio() : sealed , Scenario3_AspectRatio
  • Material() : Material
  • matrix : WaveEffect
  • Matrix4x4() : Matrix4x4< T >
  • MAX_RESULTS : Scenario06 , AzureDataProvider
  • maxBatchFetchSize : ItemCacheManager< T >
  • MaxBuffering : SourceBufferManager
  • maxEventDescriptors : VisitBackgroundTask , GeofenceBackgroundTask , VisitBackgroundTask , GeofenceBackgroundTask
  • MaxGap : SourceBufferManager
  • MaxHttpVersionToggle_Toggled() : Scenario01_GetText
  • MAXIMUM_ATR_CODES : AtrInfo
  • maxNaturalDurationForController : Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync , Scenario1_MultiVideoPlayback
  • maxUploadFileSize : sealed , Scenario2_Upload
  • maxWindows : Scenario3_UsingWindows , sealed
  • mbrr : Scenario1_Basic
  • MeasureOverride() : StepsHelperControl , sealed , DynamicCommandBar
  • media_MediaEnded() : Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries , sealed
  • MediaButtonPressed() : Scenario2 , sealed , Scenario3
  • mediaCapture : Scenario2_DetectInWebcam , Scenario5_DisplayingBarcodePreview , sealed , Scenario1_TrackInWebcam , OcrCapturedImage , CaptureDevice
  • MediaCapture : MediaCapturePreviewer
  • MediaCapture_CameraStreamFailed() : Scenario1_TrackInWebcam
  • MediaCapture_CameraStreamStateChanged() : Scenario2_DetectInWebcam
  • MediaCapture_Failed() : sealed , MainPage , sealed , Scenario5_DisplayingBarcodePreview , MediaCapturePreviewer , sealed , MainPage , OcrCapturedImage , MainPage , sealed , OcrCapturedImage , sealed , MainPage , sealed
  • mediaCapture_Failed() : CaptureDevice
  • MediaCapture_RecordLimitationExceeded() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • mediaCaptureFailedEventToken : sealed
  • mediaCaptureFailedToken : OcrCapturedImage
  • MediaCaptureManager() : MediaCaptureManager
  • MediaCapturePreviewer() : MediaCapturePreviewer
  • mediaElement : Player
  • mediaEncodingProperties : sealed
  • mediaExtensionManager : MainPage
  • mediaExtensionMgr : MainPage
  • MediaFoundationInitializer() : MediaFoundationInitializer
  • MediaItem : MediaItemViewModel , MediaItem
  • MediaItemIdKey : MediaItem
  • MediaItemViewModel() : MediaItemViewModel
  • MediaList : MediaListViewModel , Scenario1
  • mediaList : PlayerViewModel
  • MediaList : PlayerViewModel , MediaList
  • mediaList : PlaylistView
  • MediaList : PlaylistView
  • MediaListViewModel() : MediaListViewModel
  • MediaModel() : MediaModel
  • mediaPlaybackItem : Scenario1
  • MediaPlaybackItem : ContentSelector , MediaModel
  • mediaPlaybackItemLogger : Scenario6_AdInsertion , Scenario2_EventHandlers , Scenario4_Tuning , Scenario5_Metadata , Scenario7_LiveSeekableRange , Scenario3_RequestModification
  • mediaPlayer : AppView , Scenario1 , PlaybackPage , Scenario7 , ContentSelector
  • mediaPlayer_MediaEnded() : Scenario1
  • mediaPlayer_MediaFailed() : Scenario1
  • MediaPlayer_MediaOpened() : Scenario2_SynchronizingPlayers
  • mediaPlayer_MediaOpened() : Scenario1
  • MediaPlayer_MediaOpened() : AppView , PlaybackPage , Scenario1_MultiVideoPlayback , Scenario3_AdaptiveSync
  • MediaPlayer_PlaybackSession_PlaybackStateChanged() : Scenario7_LiveSeekableRange
  • mediaPlayer_PlaybackStateChanged() : Scenario1
  • mediaPlayerButton_Click() : Scenario7
  • mediaPlayerElements : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • mediaPlayerLogger : Scenario4_Tuning , Scenario6_AdInsertion , Scenario7_LiveSeekableRange , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario5_Metadata
  • MediaPresentationDuration : Manifest
  • mediaPresentationDuration : Manifest
  • MediaProtectionContainerGuid : PlayReadyHelper
  • MediaProtectionSystemId : PlayReadyHelper
  • MediaProtectionSystemIdMapping : PlayReadyHelper
  • MediaReader() : MediaReader
  • MediaSegment() : MediaSegment
  • mediaSink : CaptureDevice
  • mediaSink_IncomingConnectionEvent() : CaptureDevice
  • mediaSourceLogger : Scenario2_EventHandlers , Scenario4_Tuning , Scenario3_RequestModification , Scenario7_LiveSeekableRange , Scenario6_AdInsertion , Scenario5_Metadata
  • MediaStream() : MediaStream
  • mediaStreamSource : Scenario2_AppendClips , Scenario3_AddAudioTracks , sealed , Scenario1_TrimAndSaveClip , Scenario4_AddOverlays
  • MediaTimelineController_PositionChanged() : Scenario1_MultiVideoPlayback , Scenario3_AdaptiveSync , Scenario2_SynchronizingPlayers
  • MediaTimelineController_StateChanged() : Scenario2_SynchronizingPlayers , Scenario1_MultiVideoPlayback , Scenario3_AdaptiveSync
  • MediaTransportControls() : MediaTransportControls
  • MediaTransportControlsWithCustomCastButton() : MediaTransportControlsWithCustomCastButton
  • MediaUri : MediaItem
  • mediaUris : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers
  • mediaUrlTemplate : MediaSegmentInformation
  • MemoryManager_AppMemoryUsageIncreased() : App
  • MemoryManager_AppMemoryUsageLimitChanging() : App
  • menuItems : Scenario1_EventAndMenuHookup , sealed
  • Mesh() : GameObject
  • meshColor : ConstantBufferChangesEveryPrim
  • MeshGeometry() : MeshGeometry
  • MeshObject() : MeshObject
  • message : JsonRequest , CaptureFailedEventArgs
  • messageCount : Conversation
  • messageNumber : Scenario1_Basic , sealed
  • MessageReceived() : sealed , Scenario1 , sealed , Scenario2 , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed , Scenario5
  • MessageTextBox_KeyUp() : Scenario2_Load , sealed
  • messageType_SelectionChanged() : Scenario3_SendMIDIMessages
  • messageTypes : Scenario3_SendMIDIMessages
  • messageWebSocket : Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed
  • messageWriter : sealed , Scenario1_UTF8
  • metadata_emsg_mp4_CueEntered() : Scenario5_Metadata
  • metadata_extm3u_CueEntered() : Scenario5_Metadata
  • metadata_id3_CueEntered() : Scenario5_Metadata
  • metadata_MarkCueEntered() : sealed , Scenario_SynthesizeSSML
  • metadata_SpeechCueEntered() : Scenario_SynthesizeTextBoundaries , sealed
  • metadata_TrackingEvents_CueEntered() : Scenario5_Metadata , Scenario6_AdInsertion
  • metadata_TrackingEvents_CueExited() : Scenario5_Metadata
  • MetadataUpdateEntryPoint : Constants
  • MetadataUpdateTaskName : Constants
  • MeteredConnectionBehavior : HttpMeteredConnectionFilter
  • meteredConnectionFilter : Scenario14_MeteredConnectionFilter
  • MeteredConnectionPriorityPropertyName() : HttpMeteredConnectionFilter
  • MeteredConnectionPriorityPropertyNameLiteral : HttpMeteredConnectionFilter
  • metering : METERING_CONTEXT
  • Metering() : Metering
  • MeteringData() : sealed , MeteringData , sealed
  • meteringOn : ServiceViewModel , sealed
  • meteringOnWhileSuspension : ServiceViewModel , sealed
  • MeteringWorker() : Metering
  • METHODASYNCCALLBACK() : WASAPIRenderer , WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • Methods_SelectionChanged() : sealed , Scenario2_Prediction , sealed , Scenario1_Conversion
  • MEUserControl() : MEUserControl
  • MF_MT_VIDEO_LEVEL : MediaFoundationConstants
  • MFSampleGenerator() : MFSampleGenerator
  • MICROSOFT_PROVIDER_ID : sealed
  • MicrosoftAccountAuthority : SingleAccountScenario , MultipleAccountsScenario , DefaultAccountScenario
  • MicrosoftAccountClientId : SingleAccountScenario , DefaultAccountScenario , MultipleAccountsScenario
  • MicrosoftAccountProviderId : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • MicrosoftAccountScopeRequested : DefaultAccountScenario , SingleAccountScenario , MultipleAccountsScenario
  • MicrosoftProviderId : MultipleAccountsScenario , SingleAccountScenario , DefaultAccountScenario
  • MidiDeviceWatcher() : MidiDeviceWatcher
  • midiInDeviceWatcher : Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages
  • midiInPorts : Scenario2_ReceiveMIDIMessages
  • MidiInputDevice_MessageReceived() : Scenario2_ReceiveMIDIMessages
  • midiOutDeviceWatcher : Scenario3_SendMIDIMessages , Scenario1_MIDIDeviceEnumeration
  • midiOutPorts : Scenario3_SendMIDIMessages
  • midiSelector : MidiDeviceWatcher
  • MilliliterPerKilogramPerminute : PresentationFormats
  • mimeType : SourceBufferManager
  • MimeType : MediaStream
  • mimeType : MediaStream
  • MinBufferTime : Manifest
  • minBufferTime : Manifest
  • MinConfig() : ReactiveViewModel
  • MinHeight : ControlSizeTrigger
  • minimumUpdatePeriod : Manifest
  • MinimumUpdatePeriod : Manifest
  • MinMinimumUpdatePeriod : Manifest
  • minPenSize : sealed , Scenario3
  • MinReadChunkSize : ReadStreamTask
  • MinWidth : ControlSizeTrigger
  • MinWindowHeight : Scenario3_Size
  • MinWindowWidth : Scenario3_Size
  • mipMapCount : DDS_HEADER
  • mirroringPreview : sealed , OcrCapturedImage
  • MirrorOrientation() : sealed , CameraRotationHelper
  • miscFlag : DDS_HEADER_DXT10
  • miscFlags2 : DDS_HEADER_DXT10
  • MissingTitleError : MainPage
  • Mix : AudioEchoEffect
  • MobileHotspotToggle_Toggled() : Scenario2_ToggleMobileHotspot
  • mode : LowLatency
  • model : ModelConstantBuffer
  • Model : BasicTests
  • model : ModelConstantBuffer
  • Model : EventTests , OtherBindings
  • model : ModelConstantBuffer , QuadModelConstantBuffer , ModelConstantBuffer
  • Model : Functions , ListsAndTemplates , sealed
  • model : ModelConstantBuffer , CubeModelConstantBuffer , ModelColorConstantBuffer , ModelConstantBuffer
  • modelConstantBuffer : VideoRenderer , SpinningCubeRenderer
  • modelConstantBufferData : VideoRenderer , SpinningCubeRenderer
  • ModelMatrix() : GameObject
  • modelSet : ViewModelLocator , sealed
  • modelToWorld : ModelConstantBuffer , ModelNormalConstantBuffer
  • ModemDeviceServices() : ModemDeviceServices
  • ModemInformation() : ModemInformation
  • moderateMarginsIconTask : CustomOptionsPrintHelper
  • modeSelected : HardwareDRMViewModel
  • ModifyBusObjectMap : AllJoynBusObjectManager
  • ModifyKeyRequestUri() : Scenario3_RequestModification
  • ModifySystemDefaults() : Scenario2_SystemDefaultMenu
  • MolarEnergyJoulePermole : PresentationFormats
  • MolarentropyJoulePermoleKelvin : PresentationFormats
  • MomentOfForceNewtonMetre : PresentationFormats
  • moreButton : DynamicCommandBar
  • MoreLess_Click() : Scenario4_ScriptNotify
  • MotionDetector() : sealed
  • mouseWheelData : PlaybackPage
  • MovableRect_Entered() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_Exited() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationCompleted() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationDelta() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationStarted() : Scenario5_InkingAndInteractionFeedback
  • MoveAlongX() : sealed
  • MoveAlongY() : sealed
  • MoveAlongZ() : sealed
  • MoveAppCertificateToUserCertificateStore() : Scenario1_MoveCertificate
  • MoveItem() : MediaListViewModel
  • MoveItemBetweenListViews() : Scenario1_MoveCertificate
  • MoveLeft() : CBufferPacket
  • MoveLookController() : MoveLookController
  • movementAxis_Changed() : Scenario5 , sealed , Scenario4
  • MoveNext() : CBufferEnumerator
  • MoveOnXAndYAxes() : sealed , ManipulationInputProcessor
  • MoveToBadgeStep() : ScenarioElement
  • MoveToSecondaryTileStep() : ScenarioElement
  • MoveUserCertificateToAppCertificateStore() : Scenario1_MoveCertificate
  • MoviePath : ReactiveViewModel
  • moviePath : SecureStopViewModel
  • MoviePath : SecureStopViewModel , HardwareDRMViewModel
  • moviePath : ReactiveViewModel , HardwareDRMViewModel , ProactiveViewModel
  • MoviePath : ProactiveViewModel
  • mp : Scenario6
  • MPE : MPEUserControl
  • MPEUserControl() : MPEUserControl
  • mpiLogger : Scenario5 , Scenario4 , Scenario3 , Scenario2
  • mpiLoggerList : Scenario6
  • mplLogger : Scenario6
  • mpLogger : Scenario6
  • MrcAudioEffectDefinition() : sealed
  • MrcVideoEffectDefinition() : sealed
  • mruToken : SampleState
  • MruToken() : SampleState
  • mruToken : sealed , MainPage
  • MSA_CLIENT_ID : sealed
  • MSA_SCOPE_REQUESTED : sealed
  • mse : SourceBufferManager , Player
  • MseSourceBuffer : SourceBufferManager
  • msLogger : Scenario3 , Scenario2
  • MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED : PlayReadyHelper
  • mtcGrid : PlaybackPage
  • MultibyteToPlatformString() : AllJoynHelpers
  • MulticastRadioButton_Checked() : Scenario5 , sealed
  • MulticastRadioButton_Unchecked() : sealed , Scenario5
  • MultipleAccountsScenario() : MultipleAccountsScenario
  • MultipleTasks() : sealed , MultipleTasks
  • Multiply : Scenario3_ServerForeground
  • MultiTrackVideoMediaUri : MainPage
  • Music() : FileExtensions
  • MusicEngine() : Audio
  • MusicItem() : MusicItem
  • MyCustomServerCertificateValidator() : Scenario15_ServerCertificateValidation
  • myGridView_ContainerContentChanging() : sealed , PhasingTests
  • MyInt : OtherBindings , BasicTests , sealed
  • myLayer1 : Scenario10 , sealed , Scenario11
  • myLayer2 : sealed , Scenario11 , Scenario10
  • myLayers : Scenario11 , Scenario10
  • MyMap_Loaded() : sealed
  • myMap_Loaded() : Scenario8
  • MyMap_Loaded() : sealed , Scenario1
  • myMap_Loaded() : sealed , Scenario4
  • MyMap_Loaded() : Scenario2
  • myMap_Loaded() : sealed
  • MyMap_Loaded() : Scenario9
  • myMap_Loaded() : Scenario5
  • MyMap_Loaded() : sealed , Scenario3
  • myMap_Loaded() : sealed
  • MyMap_Loaded() : Scenario10
  • myMap_Loaded() : Scenario7
  • MyMap_Loaded() : sealed , Scenario11
  • MyMap_MapTapped() : Scenario1 , sealed
  • myMap_ZoomLevelChanged() : Scenario7 , sealed
  • MyMapLoaded() : Scenario12 , sealed
  • myResolver : Scenario6_NavToStream
  • MyUserControl1() : MyUserControl1 , sealed
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- n -

  • Name : BarcodeScannerInfo , SymbologyListEntry , BluetoothLEDeviceDisplay , School , ScenarioGroup , User , RadioModel , sealed , Contact , User , RadioModel , AdvertisementWrapper , RfcommChatDeviceDisplay , Account , Employee , IEmployee , WindowInfo , Manager , Contact , Item , SyncBackgroundTaskInformation , PlaceInfo , Model , BarcodeScannerInfo , PlaceInfo , SymbologyListEntry , BluetoothLEDeviceDisplay , DeviceInformationDisplay , IScenario , DeviceInformationDisplay , School , Scenario , School , User
  • nameKey : School , User , School , User
  • NamespaceId : PresentationFormats
  • narrowMarginsIconTask : CustomOptionsPrintHelper
  • Navigate() : INavigationService , NavigationService
  • Navigate< T >() : INavigationService , NavigationService
  • NavigateBackForWideState() : DetailsPage , DetailPage
  • NavigateBackward_Click() : Scenario1_NavToUrl
  • navigatedAway : sealed , InputReportEvents , Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario7_SyncDevice
  • NavigateForward_Click() : Scenario1_NavToUrl
  • NavigateToAutoPlay() : MainPage
  • NavigateToPageWithParameter() : MainPage
  • NavigateToReconnect() : MainPage
  • NavigateToScenario() : MainPage
  • NavigateToScenarioWithParameter() : MainPage
  • NavigateWebview() : Scenario1_NavToUrl
  • Navigation_BackRequested() : SubPage
  • NavigationHelper : MainPage , TripDetails , TripListView , NavigationHelper
  • navigationHelper : MainPage , SubPage , TripDetails , TripListView
  • NavigationHelper_Load() : MainPage
  • navigationHelper_LoadState() : TripDetails , TripListView
  • NavigationHelper_Save() : MainPage
  • navigationHelper_SaveState() : TripDetails , TripListView
  • NavigationParameter : LoadStateEventArgs
  • NavigationService : App , NavigationService
  • NearClipPlane() : Camera
  • nearestMegabyte() : sealed , Scenario8
  • needToPrintClipboardFormat : SampleState , MainPage
  • NetErrorToString() : AccountWatcher , BroadbandDevice
  • networkAccountWatcher : AccountWatcher
  • NetworkInformation_NetworkStatusChanged() : Scenario2ViewModel , Scenario4_Connect
  • newButtonText : sealed
  • newItem : CacheChangedEventArgs-g< T >
  • NewItems : Scenario1 , Scenario2
  • NewTrip() : sealed , TripViewModel
  • NewWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Next : RenderBuffer , List< T >
  • next : List< T >::Node
  • nextButton_Click() : Scenario1 , Scenario6
  • NextButton_Click() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • NextButtonVisibility : StepsControl
  • NextButtonVisibilityProperty : StepsControl
  • nextId : AdvertisementWrapper
  • NextItem_Click() : sealed , S1_GetAFeed
  • nextSegmentIndex : LiveSourceBufferManager
  • NextSegmentIndex : LiveSourceBufferManager
  • nextSegmentNumber : LiveSourceBufferManager
  • NextSegmentNumber : LiveSourceBufferManager
  • nextWindowId : sealed , Scenario3_UsingWindows
  • NFC_PROV_MESSAGE_CURRENT_VERSION : Scenario1
  • NFC_PROV_MESSAGE_LEADING_BYTE : Scenario1
  • NFC_PROV_MESSAGE_PROTOCOL_NAME : Scenario1
  • NfcMessageHandlerAsync() : Scenario1
  • NoAlbumArt : Errors
  • noButton_Click() : sealed , Scenario9_CustomPairDevice
  • NoCaptureDevicesHResult : sealed , AudioCapturePermissions
  • Node() : List< T >::Node
  • node_QuantumStarted() : Scenario3_FrameInput
  • nodeNamespace : sealed
  • nodeValue : sealed
  • NoExifThumbnail : Errors
  • NoIcon : Errors
  • NoImages : Errors
  • NonDPProperty : MyUserControl1
  • None : HttpMeteredConnectionFilter , sealed
  • norm : BasicVertex
  • normal : PNTVertex
  • Normal : HttpMeteredConnectionFilter
  • normal : VertexPositionNormalColor
  • NormalizedAnchorPoint : sealed , PointOfInterest
  • NormalizeRanges() : ItemIndexRangeList , ItemCacheManager< T >
  • NormalMaterial() : GameObject
  • normalStride : SurfaceMeshProperties
  • normalToWorld : ModelNormalConstantBuffer
  • NoSubFolder_checked() : Scenario1
  • Not() : BindingHelpers , Scenario1_Discovery , sealed
  • notes : sealed
  • Notes : Trip
  • notes : Trip
  • NoThumbnail : Errors
  • notificationsGroup : sealed , Scenario3_Notifications
  • notificationsToken : Scenario2_Client
  • NotifyCancelingTask() : Scenario4_BulkPipes
  • NotifyClientDevices() : Scenario3_ServerForeground
  • NotifyDeviceNotConnected() : Utilities
  • NotifyIfAnyError() : sealed , ServiceViewModel
  • NotifyOfInsertedItems() : IncrementalLoadingBase
  • NotifyProjectionStopping() : ProjectionViewBroker
  • NotifyProperty() : ImportableItemWrapper
  • NotifyPropertyChanged() : RadioModel , YangContainer , sealed , YangContainer , ViewModelBase , HeroArticlesViewModel , sealed , ViewModelBase , Trip , RadioModel , DataModel , Manager , DataModel
  • NotifyPropertyChangedAsync() : ServiceViewModel
  • NotifyQualityEvent() : CMediaStream
  • NotifyReadCancelingTask() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyReadTaskCanceled() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyStatusMessage() : ServiceViewModel
  • NotifyTaskCanceled() : Scenario4_BulkPipes
  • NotifyUser() : sealed , MainPage , sealed , FileOpenPickerPage , MainPage , sealed , MainPage , CachedFileUpdaterPage , FileSavePickerPage , MainPage , sealed , MainPage , ShareTarget , WiFiDirectServiceManager , MainPage , sealed
  • NotifyUserBackgroundThread() : ShareTarget , Scenario13_ShareTarget
  • NotifyUserFileNotExist() : SampleState , MainPage
  • NotifyUserFromAsyncThread() : sealed , Scenario1 , sealed , Scenario1 , Scenario5 , sealed , Scenario2 , sealed
  • NotifyUserFromBackground() : MainPage
  • NotifyWriteCancelingTask() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyWriteTaskCanceled() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NTE_DEVICE_NOT_FOUND : Scenario1_ProvisionTPM
  • NTE_DEVICE_NOT_READY : Scenario1_ProvisionTPM
  • NTE_NO_KEY : Util
  • NTE_PERM : Util
  • NullEmployee : OtherBindings , BasicTests , Functions
  • NullImageSource : Manager , Employee , IEmployee
  • NullStringProperty : sealed , IEmployee , Employee , OtherBindings , Functions , BasicTests , Manager
  • Number : MediaSegment , BadgeNumericNotificationContent
  • numberIconReferences : sealed , Scenario7
  • NumberOfAvailableDisplayRegions() : Scenario2_DisplayRegion
  • NumberOfPhotos : PhotosPrintHelper , sealed
  • NumberOfTimesToWrite : Sync
  • NumDownloads : sealed , Scenario7_DownloadReordering
  • numInputReportEventsReceived : InputReportEvents , sealed
  • numInterruptsReceived : Scenario3_InterruptPipes
  • NumOfShares : SocialMediaCounter
  • NumOfSharesProperty : SocialMediaCounter
  • numProfiles : ImageInfo
  • NV12VideoTexture() : NV12VideoTexture
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- o -

  • ObjectFileOutput : FxCompile
  • Objective() : Level
  • ObjectToPrint : Print3D
  • OcrCapturedImage() : sealed , OcrCapturedImage
  • ocrEngine : DecodeEngine
  • OcrFileImage() : sealed , OcrFileImage
  • ocrLanguage : sealed , OcrCapturedImage
  • OffboardAsync() : OnboardingService , IOnboardingService , sealed
  • OfflineLicensesChanged() : sealed , Scenario1_TrialMode
  • offscreenCanvas : GeneratedBitmapState
  • offscreenDrawingSession : GeneratedBitmapState
  • offset : sealed
  • okButton_Click() : sealed , Scenario9_CustomPairDevice
  • oldItem : CacheChangedEventArgs-g< T >
  • on_read : PipeEvents
  • on_write : PipeEvents
  • OnAamvaCardDataReceived() : sealed , Scenario2_AamvaCards
  • OnAccessChanged() : Scenario1_DataEvents , Scenario2_Polling , sealed
  • OnAccountCommandsRequested() : sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • OnActivated() : App , sealed , App , AppContactPanel , App , sealed , App , sealed , App , sealed , App
  • OnAdvancedColorInfoChanged() : sealed
  • OnAdvertisementReceived() : Scenario1_Watcher
  • OnAdvertisementStatusChanged() : sealed , AdvertisementWrapper
  • OnAdvertisementWatcherStopped() : Scenario1_Watcher
  • OnAppBarOpened() : sealed
  • OnApplyTemplate() : MediaTransportControlsWithCustomCastButton , ProjectedMediaTransportControls , StepsControl , sealed , ChatListView , sealed , DynamicCommandBar , CustomMediaTransportControls , TitledImage
  • OnAppResume() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect
  • OnAppResuming() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnApproximateAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • OnAppSuspendCallback : EventHandlerForDevice
  • OnAppSuspending() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnAppSuspension() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , Scenario4_BulkPipes , EventHandlerForDevice , Scenario1_ConnectDisconnect
  • OnAudioSampleRequested() : WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • OnAutoAcceptSessionConnected() : sealed , AdvertisementWrapper
  • OnAutoDismissTimerExpired() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • OnAvailableNetworksChanged() : sealed
  • OnBackgroundActivated() : App
  • OnBackgroundAuthenticationCompleted() : Scenario3_ForegroundApp
  • OnBackgroundTaskCompleted() : sealed , Scenario1_DeviceUse , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , ScenarioCommon
  • OnBackRequested() : sealed , BackButtonPage , MoveLookController , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailPage
  • OnBankCardDataReceived() : sealed , Scenario1_BankCards
  • Onboard : Scenario2ViewModel
  • OnboardeeNetworkList : Scenario2ViewModel
  • OnboardeeSsidListVisibility : Scenario2ViewModel
  • OnboarderNetworkList : Scenario2ViewModel
  • OnboarderSsidListVisibility : Scenario2ViewModel
  • OnboardingConfigurationState : AppData
  • onboardingConfigurationStateKey : AppData
  • OnboardingConfigurationVisibility : Scenario2ViewModel
  • onboardingConfigureAuthenticationTypeKey : AppData
  • OnboardingConfigureAuthType : AppData
  • OnboardingConfigurePassphrase : AppData
  • onboardingConfigurePassphraseKey : AppData
  • OnboardingConfigureSsid : AppData
  • onboardingConfigureSsidKey : AppData
  • OnboardingConfigureWiFiCalledEventArgs() : sealed
  • OnboardingConnectCalledEventArgs() : sealed
  • OnboardingConsumer() : sealed
  • OnboardingConsumer::Initialize() : sealed
  • OnboardingGetLastErrorRequestedEventArgs() : sealed
  • OnboardingGetScanInfoCalledEventArgs() : sealed
  • OnboardingGetStateRequestedEventArgs() : sealed
  • OnboardingGetVersionRequestedEventArgs() : sealed
  • onboardingLastErrorCodeKey : AppData
  • onboardingLastErrorMessageKey : AppData
  • OnboardingOffboardCalledEventArgs() : sealed
  • OnboardingPassword : Scenario2ViewModel
  • OnboardingProducer() : sealed
  • OnboardingProducerIsChecked : Scenario2ViewModel
  • OnboardingService_ConnectRequestRecieved() : Scenario2ViewModel
  • OnBringIntoView() : sealed , Scenario7
  • OnButtonClicked() : sealed
  • OnButtonHologramTapped() : HolographicMRCSampleMain
  • OnButtonInitTapped() : HolographicMRCSampleMain
  • OnButtonPhotoTapped() : HolographicMRCSampleMain
  • OnButtonSysAudioTapped() : HolographicMRCSampleMain
  • OnButtonVideoTapped() : HolographicMRCSampleMain
  • OnBuyAppButtonTapped() : sealed
  • OnBuySelectorClicked() : sealed
  • OnCachedFileUpdaterActivated() : App
  • OnCameraAdded() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnCameraRemoved() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnCancelButtonClicked() : Scenario1
  • OnCanceled() : sealed , ActivitySensorBackgroundTask , sealed , BackgroundActivity , sealed , Scenario1_BackgroundTask , sealed , SampleBackgroundTask , ServicingComplete , RfcommServerTask , sealed , IoSyncBackgroundTask , EdpBackgroundTask , LocationBackgroundTask , AuthenticationTask , sealed , PedometerBackgroundTask , sealed , ProximitySensorBackgroundTask , SampleSmsBackgroundTask
  • OnCapabilityAccessChanged() : Scenario1_Check
  • OnCaptureFailed() : sealed
  • OnChangeBackgroundButtonClicked() : sealed
  • OnChannelLoggingEnabled() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnChatViewContainerContentChanging() : sealed , Scenario2_Load
  • OnClear() : sealed , Scenario3 , Scenario4
  • OnClipboardChanged() : SampleState , MainPage
  • OnClockPause() : CMediaSink
  • OnClockRestart() : CMediaSink
  • OnClockSetRate() : CMediaSink
  • OnClockStart() : CMediaSink
  • OnClockStop() : CMediaSink
  • OnClose() : CNetworkChannel , sealed
  • OnClosed() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • OnColorProfileChanged() : sealed , PhotoAdjustmentRenderer
  • OnCompleted() : sealed , Scenario4_BackgroundActivity , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , GroupedBackgroundTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , GroupedBackgroundTask , Scenario3_BgChatServer , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , sealed , Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor , RegisterWithBackgroundTask
  • OnCompositionScaleChanged() : sealed
  • OnConnect() : sealed , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • OnConnected() : Scenario1_Send
  • OnConnection() : sealed , Scenario1
  • OnConnectionReceived() : Scenario2_ChatServer , sealed , StreamSocketListenerWrapper
  • OnConnectionRequested() : sealed , Scenario1_Advertiser
  • OnConnectionStatusChanged() : sealed , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector
  • OnConsolidated() : sealed
  • OnContainerContentChanging() : EdgeTappedListView
  • OnContinue() : CServiceBase
  • OnControlAcquired() : sealed
  • OnControlLost() : sealed
  • OnCopy() : sealed , Scenario2
  • OnCreateGeofence() : Scenario4_ForegroundGeofence
  • OnCurrentChanged() : SpatialStageManager
  • OnCurrentStateChanged() : Scenario3_MasterDetail
  • OnCustomSensorAdded() : sealed , Scenario1_DataEvents , Scenario2_Polling
  • OnCut() : sealed , Scenario2
  • OnDataRequested() : Scenario12_ShareData , SharePage
  • OnDeferredImageRequestedHandler() : CopyImage , sealed , ShareDelayRenderedFiles
  • OnDeleteButtonClicked() : Scenario1
  • OnDeviceAccessChanged() : sealed , EventHandlerForDevice
  • OnDeviceAdded() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , sealed , Scenario2_Connector
  • OnDeviceClose : EventHandlerForDevice
  • OnDeviceClosing() : sealed , DeviceConnect , InputReportEvents , Scenario1_ConnectDisconnect , Scenario3_InterruptPipes , Scenario1_ConnectDisconnect
  • OnDeviceConnected : EventHandlerForDevice , sealed , DeviceConnect , Scenario1_ConnectDisconnect , Scenario4_BulkPipes , Scenario1_ConnectDisconnect
  • OnDeviceConnectedEventArgs() : sealed , OnDeviceConnectedEventArgs
  • OnDeviceEnumerationComplete() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • OnDeviceListChanged() : sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • OnDeviceLost() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , CameraStreamCoordinateMapperMain , D2DAdvancedColorImagesRenderer , CustomComputeShaderMain , CustomPixelShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , LowLatencyInputMain , GameMain , HolographicPaintMain
  • OnDevicePickerDismissed() : Scenario1_DevicePicker
  • OnDeviceRemoved() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , sealed , Scenario2_Connector
  • OnDeviceRestored() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , CameraStreamCoordinateMapperMain , D2DAdvancedColorImagesRenderer , CustomComputeShaderMain , CustomPixelShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , LowLatencyInputMain , GameMain , HolographicPaintMain
  • OnDeviceSelected() : Scenario1_DevicePicker
  • OnDeviceStateChange() : sealed , Scenario2 , Scenario3 , Scenario4
  • OnDeviceUpdated() : sealed , Scenario2_Connector
  • OnDisconnect() : sealed , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , sealed
  • OnDispatchWorkItem() : CStreamSink
  • OnDisplayContentsInvalidated() : sealed , App , sealed
  • OnDownloadCompleted() : Scenario4_CompletionGroups
  • OnDownloadProgress() : sealed , Scenario5_RandomAccess , Scenario6_RecoverableErrors
  • OnDPadAction() : HolographicPaintMain
  • OnDpiChanged() : sealed , App , sealed
  • OnDrawingAttributesChanged() : sealed , Scenario12
  • OneAndHalfSpace_Click() : sealed
  • onebased : Matrix4x4< T >
  • OnEdgeTapped() : Scenario4_EdgeTappedListView
  • ONEHANDEDSIZE : App
  • OnEnterToolChoice() : HolographicPaintMain
  • OnEnumerationCompleted() : Scenario2_WatchUsers , sealed , Scenario2_Connector
  • OnFadeOutCompleted() : Scenario3_ShowHideMethods
  • OnFileActivated() : App , sealed , App
  • OnFileOpenPickerActivated() : App
  • OnFileSavePickerActivated() : App
  • OnFindAllItemsClicked() : Scenario1
  • OnFindNewItemsClicked() : Scenario1
  • OnFindSourcesClicked() : Scenario1
  • OnFinishCapture() : WASAPICapture
  • OnFocusEngaged() : TransportOptions
  • OnFrameArrived() : CameraStreamProcessor , VideoFrameProcessor
  • OnFx2Added() : DeviceList
  • OnFx2EnumerationComplete() : DeviceList
  • OnFx2Removed() : DeviceList
  • OnGameInfoOverlayTapped() : sealed
  • OnGamepadAdded() : BasicHologramMain , HolographicTemplateAppMain , MoveLookController
  • OnGamepadRemoved() : BasicHologramMain , HolographicTemplateAppMain , MoveLookController
  • OnGeneralInterruptEvent() : Scenario3_InterruptPipes
  • OnGeofenceStateChanged() : Scenario4_ForegroundGeofence
  • OnGeofenceStatusChanged() : Scenario4_ForegroundGeofence
  • OnGround() : GameObject
  • OnGUI() : Print3D
  • OnHiding() : Scenario2_ShowHideEvents
  • OnHighAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • OnHistoryChanged() : ScenarioElement
  • OnHistoryEnabledChanged() : HistoryAndRoaming
  • OnHolding() : sealed
  • OnHolographicDisplayIsAvailableChanged() : BasicHologramMain , HolographicTemplateAppMain
  • OnHumanPresenceSensorAdded() : Scenario3_Choosing
  • OnHumanPresenceSensorEnumerationCompleted() : Scenario3_Choosing
  • OnHumanPresenceSensorRemoved() : Scenario3_Choosing
  • OnHumanPresenceSensorUpdated() : Scenario3_Choosing
  • OnImportButtonClicked() : Scenario1
  • OnIncomingConnection() : sealed
  • OnIndexerOperationBegin() : Helpers
  • OnIndexerOperationComplete() : Helpers
  • OnInitializeCompleted() : sealed
  • OnInitializeCompletedDispatchedHandler() : sealed
  • OnInputReportEvent() : sealed , InputReportEvents
  • OnInsertShape() : sealed
  • OnInteractionDetected() : HandHandler , HolographicPaintMain , SourceHandler , SpatialControllerHandler
  • OnIsVisibleChanged() : sealed , CustomTitleBar
  • OnItemClick() : Scenario3_MasterDetail
  • OnItemInvoked() : sealed , Scenario1_EventAndMenuHookup
  • OnKeyDown() : sealed , PlaybackPage , sealed , Scenario1_Basic , MoveLookController
  • OnKeyDownToken : sealed
  • OnKeyPressed() : sealed , AppView , sealed , AppView , sealed
  • OnKeyUp() : sealed , MoveLookController
  • OnLaunched() : sealed , App , sealed , App , sealed , AppView , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App
  • OnLayerMapElementClicked() : sealed
  • OnLayoutMetricsChanged() : sealed , CustomTitleBar
  • OnLayoutUpdated() : sealed
  • OnLayoutUpdatedToken : sealed
  • OnLicenseChanged() : sealed , GameMain
  • OnLoadAsync() : sealed , Scenario3
  • OnLoaded() : sealed , TransportOptions , DetailsPage , Scenario3_MasterDetail , DetailsPage , Scenario3_MasterDetail
  • OnLoadedActions() : sealed , UserSelect
  • OnLoadStoreClicked() : sealed
  • OnLocatabilityChanged() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnLogFileGenerated() : sealed , FileLoggingSessionScenario
  • OnLoggingEnabled() : sealed , LoggingChannelScenario
  • OnLogSizeChanged() : sealed , Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • OnlyImages_Checked() : Scenario1
  • OnlyVideo_Checked() : Scenario1
  • OnMainViewActivated() : sealed
  • OnmainWindowActivated() : AppView
  • OnManipulationCanceled() : HandHandler
  • OnManipulationCompleted() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnManipulationInertiaStarting() : sealed , ManipulationInputProcessor , sealed
  • OnManipulationStarted() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnManipulationUpdated() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnMediaCaptureFailed() : sealed
  • OnMediaFailed() : sealed
  • OnMediaOpened() : sealed
  • OnMediaOpenedToken : sealed
  • OnMessage() : sealed
  • OnMouseMoved() : MoveLookController
  • OnMTCPointerMovedToken : sealed
  • OnMTCPointerPressedToken : sealed
  • OnMTCPointerReleasedToken : sealed
  • OnMTCPointerWheelChangedToken : sealed
  • OnNavigated() : sealed
  • OnNavigatedFrom() : sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays , sealed , Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages , Scenario3_SendMIDIMessages , Scenario3 , Scenario3_NetworkConnectivityChanges , BackButtonPage , ScenarioPage , sealed , Scenario1_Events , sealed , Scenario1_FindClaimEnable , Scenario1_DataEvents , Scenario3_Choosing , Scenario1_DataEvents , Scenario3_Choosing , sealed , Scenario1Basic , Scenario2StandardOptions , Scenario3CustomOptions , Scenario4PageRange , Scenario5Photos , Scenario6DisablePreview , sealed , Scenario2 , sealed , Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu , sealed , Scenario1_Basic , Scenario7_PinFromAppbar , Scenario1_ConnectDisconnect , Scenario2_LEDTemp , sealed , SharePage , ShareCustomProvider , SharePage , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PauseAsync , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint , Scenario1 , sealed , Scenario2_Extend , Scenario2_ShowHideEvents , Scenario3_ShowHideMethods , Scenario2_ShowHideEvents , Scenario3_ShowHideMethods , Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard , Scenario2_WatchUsers , sealed , Scenario1_Basic , Scenario1_Basics , Scenario1 , Scenario2 , Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8_TransferMediaPlayer1 , Scenario9_TransferMediaPlayer2 , sealed , DefaultAccountScenario , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario , sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector , sealed , Scenario2 , Scenario3 , Scenario4 , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailPage , ArticlePage , Scenario7_Share , sealed , PlaybackPage , sealed , Scenario1_SimplestAdaptiveStreaming , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange , sealed , Scenario9 , KeepConnectionOpenScenario , Scenario1_SecondaryWindow , Scenario2_DisplayRegion , Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario1_SecondaryWindow , Scenario2_DisplayRegion , Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects , sealed , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview , sealed , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , NavigationHelper , MainPage , SubPage , Scenario1_Discovery , Scenario2_Client , Scenario3_ServerForeground , Scenario1_Discovery , Scenario2_Client , Scenario3_ServerForeground , Scenario1_ChatClient , Scenario2_ChatServer , sealed , Scenario1_DisplayDepthColorIR , Scenario2_FindAvailableSourceGroups , Scenario1_ExampleOperations , sealed , Scenario1_Check , sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers , HistoryAndRoaming , sealed , NavigationHelper , TripDetails , TripListView , sealed , DeviceEvents , CustomTrigger , sealed , DeviceConnect , InputReportEvents , sealed , Scenario1_ConnectDisconnect , Scenario3_ReadWrite , Scenario4_Events , Scenario1_ConnectDisconnect , Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario7_SyncDevice , sealed , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , sealed , Scenario2_Disable , Scenario3_AppCapture , Scenario2_Disable , Scenario3_AppCapture , sealed , Scenario1_Orientation , sealed , FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePicker_SaveToCachedFile , sealed , Scenario1_Basic , Scenario1_TrackPosition , Scenario2_GetPosition , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario7_ForegroundVisits , Scenario1_TrackPosition , Scenario2_GetPosition , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario7_ForegroundVisits , sealed , Scenario3_ForegroundApp , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , sealed , Scenario1_GetAndSetPin , Scenario2_Listen , Scenario1_GetAndSetPin , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , sealed , Scenario1_SelectDisplay , Scenario2_DisplayText , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee , LiveDashPlayer , Scenario2 , Scenario3 , sealed , Scenario1_BankCards , Scenario2_AamvaCards , sealed
  • OnNavigatedTo() : sealed , PlaybackPage , sealed , Scenario8 , Scenario7 , sealed , Scenario3 , sealed , Scenario1_DataEvents , Scenario2 , Scenario1 , VideoChat , Scenario2_ShakeEvents , sealed , Scenario3_Polling , Scenario4_OrientationChanged , Scenario5_DataEventsBatching , ShareCustomProvider , sealed , Scenario3_ChangeEvents , Scenario3 , Scenario4_BackgroundActivity , Scenario01 , Scenario02 , Scenario7_PinFromAppbar , Scenario03 , Scenario04 , Scenario05 , Scenario06 , MainPage , ProjectionViewPage , UnhandledExceptionPage , Scenario1_Discovery , sealed , Scenario1_DataEvents , Scenario1_Metrics , sealed , Scenario1_Files , Scenario2_Settings , Scenario3_SettingContainer , CustomException , Scenario4_CompositeSettings , Scenario5_Msappdata , Scenario7_SetVersion , Scenario1_Files , Scenario2_Settings , Scenario3_SettingContainer , Scenario4_CompositeSettings , sealed , Scenario5_Msappdata , Scenario7_SetVersion , sealed , MainPage , sealed , Scenario6DisablePreview , sealed , Scenario1 , sealed , Scenario10 , Scenario11 , Scenario12 , Scenario1_FindClaimEnable , Scenario13 , Scenario2 , Scenario3 , sealed , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario9 , OpenCloseConnectionScenario , Scenario2_DisplayRegion , Scenario3 , Scenario2_DisplayRegion , Scenario3_ReceiveFile , Scenario4_ReceiveUri , sealed , Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario3_FrameInput , sealed , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects , sealed , MainPage , sealed , Scenario1 , SecondaryPage , sealed , BackButtonPage , sealed , MainPage , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , Scenario1 , GroupedBackgroundTask , Scenario1_DeviceUse , sealed , Scenario1_ConfigureMobileHotspot , sealed , BroadbandDevice , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , GroupedBackgroundTask , sealed , Scenario2_Custom , sealed , Scenario1_Download , Scenario2_Upload , Scenario3_Notifications , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario7_DownloadReordering , Scenario1 , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario1_BankCards , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario2 , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , sealed , Scenario1_DataEvents , Scenario2_DetectInWebcam , Scenario1_DetectInPhoto , Scenario2_DetectInWebcam , Scenario7_ScrollingContentUsingMarquee , Scenario1_TrackInWebcam , Scenario1 , Scenario3_UsingWindows , Scenario2 , Scenario3 , NavigationHelper , sealed , MainPage , SubPage , Scenario1_Watcher , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario2_Client , Scenario3 , Scenario3_ServerForeground , Scenario2_Client , Scenario3_ServerForeground , Scenario2_EnableSettings , Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , sealed , MainPage , sealed , MainPage , sealed , Scenario1_DisplayDepthColorIR , sealed , Scenario2_FindAvailableSourceGroups , sealed , MainPage , Scenario1_Launched , MainPage , Scenario1_ExampleOperations , sealed , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile , Scenario3_EnableHdrProfile , sealed , MainPage , sealed , MainPage , Scenario13_RetryFilter , Scenario1_Check , sealed , Scenario07_PostStreamWithProgress , sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers , HistoryAndRoaming , OtherScenarios , Scenario14_MeteredConnectionFilter , HistoryAndRoaming , OtherScenarios , sealed , Scenario08_PostCustomContent , sealed , Scenario1_DataEvents , Scenario04_PostText , Scenario2_Polling , Scenario3_Calibration , sealed , Scenario2_ReceiveContact , Scenario2_Polling , sealed , Scenario1_Mini , sealed , Scenario2_DelayMini , S1_AddWithAPI , S2_UpdateAndDeleteWithAPI , S3_RetrieveWithAPI , S4_CheckIndexRevision , S5_AddWithAppContent , S6_DeleteWithAppContent , S7_RetrieveWithAppContent , sealed , NavigationHelper , Scenario6 , TripDetails , TripListView , sealed , Scenario2 , sealed , DeviceConnect , DeviceEvents , Scenario4 , sealed , DeviceConnect , FeatureReports , InputReportEvents , sealed , InputOutputReports , sealed , FileSavePicker_SaveToCachedFile , Scenario1_DataEvents , Scenario1_ConnectDisconnect , Scenario2_ConfigureDevice , FileOpenPicker_PickURLFile , Scenario3_ReadWrite , Scenario4_Events , Scenario1_ConnectDisconnect , Scenario2_ControlTransfer , Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario5_UsbDescriptors , Scenario5 , Scenario6_InterfaceSettings , Scenario7_SyncDevice , sealed , Scenario10 , sealed , Scenario6 , sealed , Scenario1 , Scenario2 , Scenario3 , Scenario4 , Scenario5 , sealed , WriteReadStream , ReadBytes , sealed , Scenario1_DevicePicker , Scenario2 , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario4_Snapshot , Scenario14_QueryCpPaste , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario10_CpToClipboard , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , sealed , Scenario2_Disable , Scenario3_AppCapture , Scenario2_Disable , Scenario3_AppCapture , sealed , Scenario1_Orientation , sealed , Scenario1 , Scenario2 , Scenario11_CPDNoUI , Scenario12_ShareData , Scenario13_ShareTarget , Scenario15_DPLCreateFileEvents , Scenario16_NetworkResource , Scenario1 , Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8_ClipboardSource , Scenario9_ClipboardTarget , SavingDataReason , sealed , Scenario10 , Scenario2 , Scenario3 , Scenario4 , Scenario5 , Scenario7 , Scenario8 , Scenario9 , Scenario2 , Scenario3 , Scenario4 , Scenario6 , Scenario7 , Scenario8 , Scenario9 , CachedFileUpdaterPage , FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , FileOpenPickerPage , FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePickerPage , MainPage , sealed , Scenario1 , Scenario2 , Scenario3 , Scenario5 , Scenario6 , Scenario1 , Scenario3 , Scenario4 , Scenario5 , sealed , Scenario1_Basic , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , sealed , Scenario1_DataEvents , Scenario3_Porting , Scenario1_Initialization , Scenario2_BackgroundTask , Scenario3_ForegroundApp , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario3_Calibration , Scenario1 , sealed , Scenario1_Launched , Scenario4_ChangeSystemGroup , Scenario5_IsSupported , Scenario4_ChangeSystemGroup , Scenario5_IsSupported , sealed , Content , SignIn , UserSelect , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , sealed , Scenario1_GetLamp , Scenario3_AvailabilityChanged , Scenario1 , Scenario2 , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_SelectDisplay , Scenario2_DisplayText , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , MainPage , LiveDashPlayer , sealed , Scenario2 , Scenario3 , Scenario1 , Scenario3 , sealed , Scenario2_AamvaCards , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays , MainPage , Scenario1 , sealed , Scenario1_Default , Scenario3_Trim , sealed , EnableHelloPage , MainPage , Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages , Scenario3_SendMIDIMessages , AccountWatcher , GetConnectionProfiles , ModemInformation , ShowConnection , Scenario2_ToggleMobileHotspot , Scenario1_ConfigureMobileHotspot , Scenario2_ToggleMobileHotspot , Scenario3 , SecondaryViewPage , Scenario3 , SecondaryViewPage , Scenario3_NetworkConnectivityChanges , CardReader , ManageCardScenario , ReceiptView , Scenario1 , MainPage , ScenarioPage , sealed , OcrCapturedImage , OcrFileImage , OcrCapturedImage , OcrFileImage , Scenario1_ManageHotspot , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1 , Scenario2 , sealed , Scenario1_Events , Scenario4_BackgroundPedometer , Scenario1_Files , Scenario2_Memory , Scenario1_Files , Scenario2_Memory , SetLockScreenImage , sealed , Scenario1Basic , Scenario2StandardOptions , Scenario3CustomOptions , Scenario4PageRange , Scenario5Photos , sealed , ProjectionViewPage , Scenario2 , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , OvenClient , CustomException , OvenClient , Scenario1_EventAndMenuHookup , Scenario1_Toggle , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario10_UnviewableContent , Scenario2_LaunchUri , Scenario3_LaunchAppServices , Scenario5_Capabilities , sealed , Scenario1_Basic , Scenario5_LaunchedFromSecondaryTile , Scenario7_PinFromAppbar , Scenario1 , Scenario2 , Scenario1_ConnectDisconnect , Scenario2_LEDTemp , sealed , Scenario9_ContainsFullScreenElement , SharePage , ShareTarget , sealed , BuildNewRss , LowLatency , MarkHotProducts , Scenario3_InvokeScript , sealed , Scenario11 , Scenario2 , Scenario4 , Scenario6 , Scenario7_Share , DetailsPage , Scenario9 , sealed , Scenario1_DataEvents , RegisterWithBackgroundTask , SendTextMessage , Scenario1_Send , sealed , MainPage , Scenario3_MasterDetail , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario4_EdgeTappedListView , Scenario_PauseAsync , DetailPage , Scenario3_MasterDetail , MainPage , Scenario1 , Scenario2 , Scenario1_TrialMode , sealed , DetailsPage , sealed , MainPage , sealed , Scenario1 , CustomFocusVisuals , Scenario3 , Scenario5 , S1_GetAFeed , Scenario1 , Scenario1_Conversion , Scenario3_ReverseConversion , sealed , MainPage , OvenClient , Scenario2_ShowHideEvents , Scenario1_BasicUserActivity , CustomException , Scenario3_AdaptiveCard , sealed , Scenario2 , sealed , Scenario1_AddAccount , Scenario2_ManageAccount , Scenario1_FindUsers , Scenario3_CheckUserConsentGroup , OvenClient , Scenario1 , sealed , Scenario3_CheckUserConsentGroup , Scenario1_Basic , RequestResponse , Scenario1_Basics , Scenario2_Conditional , Scenario2 , Scenario4 , Scenario5 , Scenario6 , Scenario9_TransferMediaPlayer2 , DefaultAccountScenario , Scenario4_Connect , sealed , SingleAzureADScenario , SingleMicrosoftAccountScenario , sealed , Scenario2 , Scenario3 , Scenario4 , sealed , Scenario5 , Scenario3 , sealed , Scenario1_CachedNetworks , Scenario2_Scan , Scenario3_RegisterForUpdates , sealed , Scenario3 , CustomException , sealed , MainPage , MultipleAccountsScenario , Scenario1_ListView , SingleAccountScenario , ImagePage , Scenario4_EdgeTappedListView , ImagePage , Scenario8_TransferMediaPlayer1 , sealed , MasterDetailPage , DetailPage , MasterDetailPage , Scenario1 , ArticlePage , MainPage , Scenario2_NavToString , Scenario6_NavToStream , Scenario8_CaptureBitmap , XmlLoading , GiftDispatch , XSLTTransform , Scenario1_FindUsers , Scenario2_WatchUsers , Scenario3_FixAccount , sealed , Scenario1_MoveCertificate , Scenario2_AdvancedUserActivity , Scenario2_Extend , Scenario2_Prediction , Scenario_SRGSConstraint , Scenario4 , Scenario2 , sealed , Scenario1_Connect , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_ListConstraint , sealed
  • OnNavigatingFrom() : sealed , Scenario1_Watcher , Scenario5 , Scenario5_RestoreScrollPosition , sealed , Scenario3 , sealed , Scenario1_TrialMode , Scenario1_DataEvents , Scenario3_Polling , Scenario0_Choose , Scenario2 , Scenario5_Msappdata , Scenario1_DataEvents , sealed , Scenario1_PreviewSettings , Scenario6 , Scenario2_PhotoSettings , sealed , Scenario2_Polling , sealed , Scenario5 , MultipleTasks , OcrCapturedImage , Scenario2_Polling , sealed , Scenario1_DataEvents , LowLatency , sealed , Scenario2 , Scenario1_DataEvents , Scenario8 , Scenario4 , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario0_Choose , Scenario2_Polling , Scenario1_DataEvents , Scenario1 , Scenario3_Calibration , sealed , Scenario1_DataEvents , sealed , MainPage , Scenario4_BackgroundPublisher , sealed , Scenario3_BackgroundWatcher , Scenario4_OrientationChanged , Scenario2 , Scenario3_ChangeEvents , Scenario2_ShakeEvents , Scenario1_DataEvents , Scenario5_DataEventsBatching , Scenario1 , Scenario5_Msappdata , Scenario1_DeviceUse , Scenario1_DataEvents , Scenario2_Publisher , MainPage , Scenario3_AspectRatio , sealed , MainPage , Scenario1_Input , sealed , UnspecifiedReason , SavingDataReason , LocationTrackingReason , Scenario1_DataEvents , Scenario2_Polling , Scenario3_Calibration , Scenario2 , Scenario3_AvailabilityChanged , Scenario1_DataEvents , Scenario2_Polling , CardReader , OcrCapturedImage , Scenario3_Calibration , Scenario3_DisplayOnOff , Scenario2_Polling , VideoChat , sealed , Scenario11 , Scenario3 , Scenario9 , sealed , Scenario1 , Scenario2 , Scenario4
  • OnNavigationCompleted() : HandHandler
  • OnNavigationFailed() : sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed
  • OnNavigationStarted() : HandHandler
  • OnNetworkStatusChanged() : sealed , Scenario3_NetworkConnectivityChanges
  • OnOrientationChanged() : sealed , Scenario1_Orientation , App , sealed , Scenario1_Orientation , sealed
  • OnOsrFx2SwitchStateChangeEvent() : Scenario3_InterruptPipes
  • OnPairingRequested() : ConnectionSettingsPanel
  • OnPaste() : sealed , Scenario2
  • OnPause() : CServiceBase
  • OnPausePlayback() : WASAPIRenderer
  • OnPenColorChanged() : Scenario3 , sealed
  • OnPenThicknessChanged() : sealed , Scenario3
  • OnPenTypeChanged() : Scenario3 , sealed
  • OnPickFileAsync() : sealed , Scenario2 , Scenario3
  • OnPlaybackStateChanged() : sealed
  • OnPlaybackStateChangedToken : sealed
  • OnPlayButtonClicked() : sealed
  • OnPlotDataReady() : Scenario4 , sealed
  • OnPointerCanceled() : sealed , ManipulationInputProcessor
  • OnPointerCaptureLost() : EdgeTappedListView
  • OnPointerExited() : EdgeTappedListView , MoveLookController , sealed
  • OnPointerMoved() : sealed , VisualProperties , sealed , MoveLookController , PlaybackPage , ManipulationInputProcessor , sealed
  • OnPointerMovedToken : sealed
  • OnPointerPressed() : BasicHologramMain , sealed , AppView , PlaybackPage , sealed , EdgeTappedListView , ManipulationInputProcessor , sealed , HolographicTemplateAppMain , MoveLookController , sealed , VisualProperties , sealed , BasicHologramMain , sealed
  • OnPointerPressedToken : sealed
  • OnPointerReleased() : sealed , MoveLookController , PlaybackPage , VisualProperties , sealed , ManipulationInputProcessor , EdgeTappedListView , sealed
  • OnPointerReleasedToken : sealed
  • OnPointerWheelChanged() : PlaybackPage , sealed
  • OnPointerWheelChangedToken : sealed
  • OnPositionalTrackingDeactivating() : HolographicSpatialMappingMain
  • OnPositionChanged() : Scenario1_TrackPosition
  • OnPreviewPagesCreated() : sealed , PrintHelper
  • OnPrintButtonClick() : sealed , Scenario2StandardOptions , Scenario3CustomOptions , Scenario6DisablePreview , sealed , Scenario5Photos , Scenario1Basic , sealed , Scenario4PageRange
  • OnProgress() : sealed , SampleBackgroundTaskWithCondition , GroupedBackgroundTask , sealed , SampleBackgroundTaskWithCondition , GroupedBackgroundTask , sealed , TimeTriggeredTask , ServicingCompleteTask , SampleBackgroundTask , Scenario15_DPLCreateFileEvents , Scenario3_BgChatServer , ApplicationTriggerTask , ServicingCompleteTask , SampleBackgroundTask , sealed , ApplicationTriggerTask , sealed , TimeTriggeredTask , sealed
  • OnProjectionDisplayAvailableChanged() : sealed
  • OnPropertyChanged() : BluetoothLEDeviceDisplay , sealed , BindableBase , WordOverlay , sealed , WiFiNetworkDisplay , WordOverlay , DeviceInformationDisplay , sealed , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay
  • OnPropertyGet() : sealed
  • OnPropertySet() : sealed
  • OnProximitySensorAdded() : sealed , Scenario3_DisplayOnOff , Scenario2_Polling , Scenario4_BackgroundProximitySensor , sealed , Scenario1_DataEvents
  • OnPublisherStatusChanged() : Scenario2_Publisher
  • OnRangesDownloaded() : Scenario5_RandomAccess , sealed
  • OnReadingChanged() : sealed , Scenario1_DataEvents , sealed
  • OnRecognizeAsync() : sealed , Scenario4
  • OnRecognizerChanged() : Scenario4 , sealed
  • OnRegisteredGeofenceListBoxSelectionChanged() : Scenario4_ForegroundGeofence
  • OnReleaseDeviceRequested() : Scenario1_BankCards , sealed , Scenario2_AamvaCards
  • OnRemotePortAdded() : SessionWrapper , sealed
  • OnRemoveGeofenceItem() : Scenario4_ForegroundGeofence
  • OnRendering() : sealed
  • OnReplay() : Scenario9 , sealed
  • OnRequestReceived() : RandomNumberGeneratorTask
  • OnReset() : Scenario9 , sealed
  • OnResetButtonClicked() : sealed
  • OnResetLicenseButtonClicked() : sealed
  • OnResizeCompleted() : sealed
  • OnResultGenerated() : HolographicVoiceInputMain
  • OnResultReceived() : ScenarioElement
  • OnResuming() : Simple3DGame , sealed , AppView , sealed , App , Simple3DGame , sealed , Simple3DGame , sealed , CameraStreamCoordinateMapperMain , AppView , sealed
  • OnRightTapped() : sealed
  • OnRoamingEnabledChanged() : HistoryAndRoaming
  • OnRotationChanged() : sealed
  • OnSampleReady() : WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • OnSaveAsync() : Scenario3 , sealed
  • OnScenarioSelectionChanged() : FileOpenPickerPage
  • OnScreenContactContinued() : sealed
  • OnScreenContactEnded() : sealed
  • OnScreenContactStarted() : sealed
  • OnSelectAllButtonClicked() : Scenario1
  • OnSelectionChanged() : Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • OnSelectNewButtonClicked() : Scenario1
  • OnSelectNoneButtonClicked() : Scenario1
  • OnSelectTool() : HolographicPaintMain
  • OnSend() : sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8
  • OnSendScopeData() : WASAPICapture
  • OnServerCustomValidationRequested() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario1_UTF8 , sealed , Scenario2_Binary
  • OnSessionDeferred() : DiscoveredDeviceWrapper , sealed
  • OnSessionJoined() : sealed
  • OnSessionLost() : sealed
  • OnSessionMemberAdded() : sealed
  • OnSessionMemberRemoved() : sealed
  • OnSessionRequested() : sealed , AdvertisementWrapper
  • OnSessionStatusChanged() : SessionWrapper , sealed
  • OnSetPositionToHere() : Scenario4_ForegroundGeofence
  • OnSetVolume() : sealed , Scenario2 , sealed , Scenario3
  • OnShareCompleted() : SharePage
  • OnShareProvidersRequested() : sealed , ShareCustomProvider
  • OnShareTargetActivated() : App
  • OnShareToContosoChat() : sealed , ShareCustomProvider
  • OnShowing() : Scenario2_ShowHideEvents
  • OnShutdown() : CServiceBase , sealed::sealed , sealed , ISinkCallback
  • OnSignInInfoChanged() : MainPage
  • OnSizeChanged() : Scenario1_InkCanvasTactileFeedback , sealed , Scenario10 , Scenario3 , Scenario9 , sealed , Scenario1_InkCanvasTactileFeedback , Scenario11 , sealed , Scenario1 , sealed , Scenario4 , Scenario2 , Scenario6 , Scenario5 , sealed , Scenario12 , sealed
  • OnSocketConnectionReceived() : sealed , Scenario1_Advertiser
  • OnSourceDetected() : HolographicPaintMain
  • OnSourceLost() : HolographicPaintMain
  • OnSourcePressed() : SpatialInputHandler , SourceHandler , SpatialInputHandler , SpatialControllerHandler , HolographicPaintMain
  • OnSourceUpdated() : HandHandler , SourceHandler , HolographicPaintMain , SpatialControllerHandler
  • OnSpeechQualityDegraded() : HolographicVoiceInputMain
  • OnStart() : CSampleService , sealed , Scenario2_Binary , CServiceBase , sealed , Scenario2_Binary
  • OnStartCapture() : WASAPICapture
  • OnStartPlayback() : WASAPIRenderer
  • OnStatusChanged() : Scenario2 , sealed , Scenario1_Advertiser , Scenario1_TrackPosition , Scenario1_Advertiser , sealed , Scenario3 , Scenario1_TrackPosition , sealed
  • OnStepChanged() : StepsHelperControl
  • OnStepPropertyChanged() : StepsControl
  • OnStereoEnabledChanged() : App , sealed
  • OnStop() : Scenario2_Binary , CServiceBase , CSampleService , sealed
  • OnStopCapture() : WASAPICapture
  • OnStopped() : sealed , Scenario2_Connector
  • OnStopPlayback() : WASAPIRenderer
  • OnStoreReturnClicked() : sealed
  • OnStrokeAdded() : HolographicPaintMain
  • OnStrokeCanceled() : sealed
  • OnStrokeContinued() : sealed
  • OnStrokeEnded() : sealed
  • OnStrokesCollected() : sealed
  • OnStrokeStarted() : sealed
  • OnSurfacesChanged() : HolographicSpatialMappingMain
  • OnSuspending() : sealed , Scenario2_DetectInWebcam , App , Simple3DGame , sealed , App , sealed , App , sealed , Simple3DGame , sealed , App , sealed , Simple3DGame , sealed , App , sealed , AppView , sealed , App , Scenario1_TrackInWebcam , App , sealed , App , sealed , App , AppView , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , sealed , SavingDataReason , sealed , App , sealed
  • OnSuspendingAsync() : CameraStreamCoordinateMapperMain
  • OnSwapChainPanelSizeChanged() : sealed
  • OnSyncWithDeviceCompleted() : Scenario7_SyncDevice
  • OnSyncWithDeviceProgress() : Scenario7_SyncDevice
  • OnTapped() : HandHandler , SpatialControllerHandler
  • OnTargetApplicationChosen() : SharePage
  • OnTargetFileRequested() : FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePicker_SaveToCachedFile
  • OnTargetFormatChanged() : sealed , Scenario3_Trim , Scenario2_Custom , Scenario1_Default , sealed
  • OnTaskCanceled() : RandomNumberGeneratorTask , AdventureWorksVoiceCommandService
  • OnTaskCompleted() : Scenario3_BackgroundDeviceWatcher , MultipleTasks , Scenario3_BackgroundDeviceWatcher , sealed
  • OnTaskRequested() : Scenario1_Print
  • OnTick() : sealed , Scenario3_StartDragAsync
  • OnTimer() : sealed , UnspecifiedReason , LocationTrackingReason , sealed
  • OnTimerTick() : sealed
  • OnUDPMessageReceived() : sealed , SocketWrapper
  • OnUnloaded() : DetailsPage
  • OnUnreliableAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed
  • OnUpdate() : CustomDecaySound , CardioidSound , OmnidirectionalSound
  • OnUserAdded() : Scenario2_WatchUsers
  • OnUserRemoved() : Scenario2_WatchUsers
  • OnUserUpdated() : Scenario2_WatchUsers
  • OnVideoFrameAvailable() : VideoRenderer
  • OnViewActivated() : sealed , AppView , sealed , AppView , sealed
  • OnViewChanged() : sealed
  • OnViewModelChanged() : SectionView
  • OnViewModelPropertyChanged() : SectionView
  • OnViewSizeChanged() : SceneComposer
  • OnVisibilityChanged() : AppView , sealed , Scenario4_ForegroundGeofence , sealed , App , sealed , AppView , Scenario1_DataEvents , Scenario4_ForegroundGeofence , sealed
  • OnVisitStateChanged() : Scenario7_ForegroundVisits
  • OnVoiceCommandCompleted() : AdventureWorksVoiceCommandService , sealed
  • OnWatcherStopped() : Scenario2_WatchUsers
  • OnWindowActivated() : MainPage , SampleState , AppContactPanel
  • OnWindowActivationChanged() : sealed , App , sealed
  • OnWindowClosed() : sealed , Scenario2_DisplayRegion , AppView , sealed , Scenario4_CompactOverlay , sealed , App , Scenario5_RelativePositioning , sealed , AppView , Scenario1_SecondaryWindow , Scenario3_Size , sealed
  • OnWindowResize() : Scenario1_Basic , sealed
  • OnWindowSizeChanged() : CustomTitleBar , sealed , DetailsPage , sealed , Scenario1_Basic , sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar , sealed , App , DetailsPage , Scenario2_Extend , sealed
  • op1Characteristic : Scenario3_ServerForeground
  • Op1Characteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • Op1CharacteristicUuid : Constants
  • op1CharacteristicWriteToken : Scenario3_ServerForeground
  • op2Characteristic : Scenario3_ServerForeground
  • Op2Characteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • Op2CharacteristicUuid : Constants
  • op2CharacteristicWriteToken : Scenario3_ServerForeground
  • Op_Count : CStreamSink
  • Open_Click() : Scenario2 , Scenario1
  • OpenAppSettings() : Scenario1_Configure
  • OpenAsync() : CMediaSource
  • OpenCashDrawer() : Scenario1_OpenDrawer
  • OpenCloseConnectionScenario() : OpenCloseConnectionScenario
  • OpenConnection_Click() : KeepConnectionOpenScenario
  • OpenCVHelper() : sealed
  • OpenDevice() : IoSyncBackgroundTask
  • OpenDeviceAsync() : EventHandlerForDevice
  • OpenDrawerButton_Click() : sealed , Scenario1_OpenDrawer
  • opened : Player
  • openedMediaCount : Scenario3_AdaptiveSync
  • OpenFile_Click() : Scenario1_DetectInPhoto
  • OpenFromListButton_Click() : Scenario7 , sealed , Scenario7
  • OpenFx2DeviceAsync() : sealed , DeviceConnect
  • OpenLockscreenSettings() : Scenario1_Configure
  • OpenMenuItem_Click() : Scenario1 , sealed , Scenario2 , Scenario3
  • openPrivacySettings_Click() : sealed , Scenario_PredefinedDictationGrammar , sealed , Scenario_PredefinedWebSearchGrammar , Scenario_ContinuousDictation
  • OpenScenario() : MainPage
  • OpenSessionAsync() : DiscoveredDeviceWrapper
  • Operand1 : Scenario3_ServerForeground
  • operand1Received : Scenario3_ServerForeground
  • Operand2 : Scenario3_ServerForeground
  • operand2Received : Scenario3_ServerForeground
  • Operation_SetRate : CSourceOperation
  • Operation_Start : CSourceOperation
  • Operation_Stop : CSourceOperation
  • OperationComboBox_SelectionChanged() : Scenario1_ExampleOperations
  • OperationType : Scenario1_ExampleOperations
  • Operator : Scenario3_ServerForeground
  • operator MAPPING_SERVICE_INFO *() : unique_services
  • operator!=() : List< T >::POSITION , PageDescription , GpuCoordinateMapper::CameraIntrinsics
  • operator&() : unique_services
  • operator()() : SetConnectedFunc , handle_closer , ShutdownFunc , StartFunc , StopFunc , NoOp< T > , MemDelete , GeoEquals , GuidComparer , ComAutoRelease
  • operator->() : unique_cotaskmem_ptr< T >
  • operator=() : GameHud , ensure_close , unique_disabled_control , scope_exit< Lambda > , Camera , ReadStreamTask , ensure_close , unique_shared_work_queue , unique_cotaskmem_ptr< T >
  • operator==() : List< T >::POSITION , PageDescription
  • operator[]() : Matrix4x4< T > , Vector4< T > , Vector2< T > , Vector3< T > , Vector4< T > , Vector3< T > , Vector2< T > , Vector3< T > , Matrix4x4< T > , Vector2< T > , Matrix4x4< T >
  • operatorCharacteristic : Scenario3_ServerForeground
  • OperatorCharacteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • OperatorCharacteristicUuid : Constants
  • operatorCharacteristicWriteToken : Scenario3_ServerForeground
  • operatorReceived : Scenario3_ServerForeground
  • OpList : OpQueue< T, TOperation >
  • OpPause : CStreamSink
  • OpPlaceMarker : CStreamSink
  • OpProcessSample : CStreamSink
  • OpQueue() : OpQueue< T, TOperation >
  • OpRestart : CStreamSink
  • OpSetMediaType : CStreamSink
  • OpStart : CStreamSink
  • OpStop : CStreamSink
  • optCardTypeGroup_CheckedUnchecked() : SetCardDataScenario
  • optedIn : Scenario1 , sealed
  • OptIn : HttpMeteredConnectionFilter
  • OptInOutComboBox_SelectionChanged() : Scenario3_NetworkConnectivityChanges
  • OptInSwitch_Toggled() : Scenario14_MeteredConnectionFilter
  • optionalHttpClient : ContentSelector
  • OptionalTrialUpgrade() : sealed
  • opts : sealed
  • OrderSlider_ValudChanged() : sealed
  • ORGANIZATION_AUTHORITY : sealed
  • OrganizerRadioButton_Checked() : Scenario1_Define
  • Orientation : sealed , TrackedPose , SourceHandler::PositionInformation , sealed , TrackedPose
  • OrientationChanged() : sealed , Scenario1_DataEvents , sealed , CameraRotationHelper
  • orientationChangedEventToken : sealed , OcrCapturedImage
  • orientationChangedToken : sealed
  • OrientationFromAngles() : CardioidSound
  • OrientationSensor_OrientationChanged() : MainPage , sealed , MainPage , sealed
  • OrientationStatus : TrackedPose
  • OrientationsToString() : Scenario1_Orientation , sealed
  • orientationToken : sealed
  • originalData : ScenarioContext
  • originalPosition : Scenario04
  • OtherBindings() : sealed , OtherBindings
  • OtherLinkInvoked() : sealed , SingleMicrosoftAccountScenario , MultipleAccountsScenario , sealed , SingleAccountScenario , SingleAzureADScenario
  • OtherScenarios() : OtherScenarios
  • OtherShareOperationMethodsSection_Checked() : ShareTarget
  • OtherShareOperationMethodsSection_Unchecked() : ShareTarget
  • OtherShareOperations_Tapped() : ShareTarget
  • OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME : FileLoggingSessionScenario , LoggingSessionScenario
  • outputDevices : Scenario2_DeviceCapture
  • outputDevices_SelectionChanged() : Scenario1_MIDIDeviceEnumeration , Scenario3_SendMIDIMessages
  • outputDevicesListBox_SelectionChanged() : Scenario2_DeviceCapture
  • OutputFileAsync() : CachedFileUpdater_Local , CachedFileUpdater_Remote
  • OutputLog : ViewModelBase
  • outputLog : ViewModelBase
  • OutputPathText() : Scenario3_Trim , Scenario1_Default , Scenario2_Custom
  • OutputPauseButton_Click() : sealed , Scenario1_Default , sealed , Scenario3_Trim , Scenario2_Custom
  • OutputPlayButton_Click() : Scenario2_Custom , Scenario3_Trim , sealed , Scenario1_Default
  • OutputSettings() : sealed , Scenario2
  • OutputStopButton_Click() : Scenario2_Custom , Scenario3_Trim , sealed , Scenario1_Default , sealed
  • OutputStream : RemotePeer
  • outputStream : RemotePeer , sealed
  • OutputText() : Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • OutputToken() : Scenario2_Twitter , Scenario3_Flickr
  • OutputTokenResult() : sealed , SingleMicrosoftAccountScenario , MultipleAccountsScenario , sealed , DefaultAccountScenario , SingleAzureADScenario , SingleAccountScenario
  • OutputToTextBox() : Scenario15_DPLCreateFileEvents
  • Oven() : sealed , Oven , sealed , Oven
  • OvenClient() : OvenClient , sealed , OvenClient , sealed , OvenClient , sealed
  • OvenClientWRL() : sealed
  • overflow : sealed , DynamicCommandBar
  • overlayVideoFile : sealed , Scenario4_AddOverlays
  • OverrideOnLaunched() : App
  • OverwriteButton_Click() : CachedFileUpdater_Remote
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- z -

  • z : Vector3< T > , Vector4< T >
  • zerobased : Matrix4x4< T >
  • ZoomSlider_ValueChanged() : MainPage
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- ~ -

  • ~_360VideoPlaybackMain() : _360VideoPlaybackMain
  • ~ActivitySensorBackgroundTask() : sealed
  • ~AdvertisementWrapper() : AdvertisementWrapper , sealed
  • ~AudioFileReader() : AudioFileReader
  • ~AudioStreamReader() : AudioStreamReader
  • ~BaseElement() : BaseElement
  • ~BasicHologramMain() : BasicHologramMain
  • ~BufferConverter() : Helpers::sealed
  • ~BusySetter()
: FileLoggingSessionScenario::BusySetter
, LoggingSessionScenario::BusySetter
  • ~CAcceptOperation() : sealed
  • ~CameraStreamCoordinateMapperMain() : CameraStreamCoordinateMapperMain
  • ~CameraStreamProcessor() : CameraStreamProcessor
  • ~CardioidSound() : CardioidSound
  • ~CAsyncOperation() : CStreamSink::CAsyncOperation
  • ~CAsyncState() : CAsyncState
  • ~CBaseAttributes() : CBaseAttributes< TBase >
  • ~CBufferEnumerator() : CBufferEnumerator
  • ~CBufferPacket() : CBufferPacket
  • ~CMarker() : CMarker
  • ~CMediaBufferWrapper() : CMediaBufferWrapper
  • ~CMediaSink() : CMediaSink
  • ~CMediaSource() : CMediaSource
  • ~CMediaStream() : CMediaStream
  • ~CNetworkChannel() : CNetworkChannel
  • ~CNetworkClient() : sealed
  • ~CNetworkServer() : sealed
  • ~ComPtrList() : ComPtrList< T, NULLABLE >
  • ~ControlBase() : ControlBase
  • ~Conversation() : sealed
  • ~CritSec() : CritSec
  • ~CSampleService() : CSampleService
  • ~CSchemeHandler() : CSchemeHandler
  • ~CServiceBase() : CServiceBase
  • ~CSetRateOperation() : CSetRateOperation
  • ~CSourceLock() : CMediaStream::CSourceLock
  • ~CSourceOperation() : CSourceOperation
  • ~CStartOperation() : CStartOperation
  • ~CStreamSink() : CStreamSink
  • ~CustomComputeShaderMain() : CustomComputeShaderMain
  • ~CustomDecaySound() : CustomDecaySound
  • ~CustomPixelShaderMain() : CustomPixelShaderMain
  • ~CustomVertexShaderMain() : CustomVertexShaderMain
  • ~D2DAdvancedColorImagesRenderer() : D2DAdvancedColorImagesRenderer
  • ~D2DGradientMeshMain() : D2DGradientMeshMain
  • ~D2DSvgImageRenderer() : D2DSvgImageRenderer
  • ~DirectXPage() : sealed
  • ~DiscoveredDeviceWrapper() : sealed , DiscoveredDeviceWrapper
  • ~DocumentPresenter() : sealed
  • ~DWriteColorTextRendererMain() : DWriteColorTextRendererMain
  • ~ensure_close() : ensure_close
  • ~EventHandlerForDevice() : sealed
  • ~FaceTrackerProcessor() : FaceTrackerProcessor
  • ~FileLoggingSessionScenario() : sealed , FileLoggingSessionScenario
  • ~FocusableElement() : FocusableElement
  • ~FontDownloadListener() : sealed
  • ~GameMain() : GameMain
  • ~HandHandler() : HandHandler
  • ~HolographicFaceTrackerMain() : HolographicFaceTrackerMain
  • ~HolographicMRCSampleMain() : HolographicMRCSampleMain
  • ~HolographicPaintMain() : HolographicPaintMain
  • ~HolographicSpatialMappingMain() : HolographicSpatialMappingMain
  • ~HolographicSpatialStageMain() : HolographicSpatialStageMain
  • ~HolographicTagAlongSampleMain() : HolographicTagAlongSampleMain
  • ~HolographicVoiceInputMain() : HolographicVoiceInputMain
  • ~List() : List< T >
  • ~ListenerContext() : sealed
  • ~LoggingSessionScenario() : sealed , LoggingSessionScenario
  • ~LowLatencyInputMain() : LowLatencyInputMain
  • ~MainPage() : sealed
  • ~MediaCaptureManager() : MediaCaptureManager
  • ~MediaFoundationInitializer() : MediaFoundationInitializer
  • ~Metering() : Metering
  • ~MFSampleGenerator() : MFSampleGenerator
  • ~MidiDeviceWatcher() : MidiDeviceWatcher
  • ~OmnidirectionalSound() : OmnidirectionalSound
  • ~OnboardingConsumer() : sealed
  • ~OnboardingProducer() : sealed
  • ~OpQueue() : OpQueue< T, TOperation >
  • ~PedometerBackgroundTask() : sealed
  • ~PhotoAdjustmentRenderer() : PhotoAdjustmentRenderer
  • ~PipeIn() : PipeIn
  • ~PipeOut() : PipeOut
  • ~PlaybackControl() : PlaybackControl
  • ~Provider() : sealed , Provider
  • ~ProximitySensorBackgroundTask() : sealed
  • ~RelayCommand() : sealed
  • ~RenderBuffer() : RenderBuffer
  • ~Resource() : Resource
  • ~RpcClient() : sealed
  • ~Scenario1_BackgroundTask() : sealed
  • ~Scenario1_DeviceUse() : sealed
  • ~Scenario1_Download() : sealed
  • ~Scenario1_LowLatencyInput() : sealed
  • ~Scenario1_OmnidirectionalSound() : sealed
  • ~Scenario1_PreviewSettings() : sealed
  • ~Scenario2() : sealed
  • ~Scenario2_CardioidSound() : sealed
  • ~Scenario2_PhotoSettings() : sealed
  • ~Scenario2_Upload() : sealed
  • ~Scenario3() : sealed
  • ~Scenario3_AspectRatio() : sealed
  • ~Scenario3_CustomDecay() : sealed
  • ~Scenario3_Notifications() : sealed
  • ~Scenario4() : sealed
  • ~SceneComposer() : SceneComposer
  • ~scope_exit() : scope_exit< Lambda >
  • ~SecureInterfaceConsumer() : sealed
  • ~SecureInterfaceProducer() : sealed
  • ~ServiceStatusConverter() : Helpers::sealed
  • ~ServicingComplete() : sealed
  • ~SessionWrapper() : sealed , SessionWrapper
  • ~SocketContext() : sealed
  • ~SocketWrapper() : SocketWrapper , sealed
  • ~SourceGroupCollection() : sealed
  • ~SpatialControllerHandler() : SpatialControllerHandler
  • ~SpatialInputHandler() : SpatialInputHandler
  • ~SpatialStageManager() : SpatialStageManager
  • ~StreamSocketListenerWrapper() : StreamSocketListenerWrapper , sealed
  • ~StspMediaSinkProxy() : sealed
  • ~SurfaceMesh() : final
  • ~TextLayoutImageSource() : sealed
  • ~ToneSampleGenerator() : ToneSampleGenerator
  • ~unique_bag() : unique_bag
  • ~unique_cotaskmem_ptr() : unique_cotaskmem_ptr< T >
  • ~unique_disabled_control() : unique_disabled_control
  • ~unique_services() : unique_services
  • ~unique_shared_work_queue() : unique_shared_work_queue
  • ~WASAPICapture() : WASAPICapture
  • ~WASAPIRenderer() : WASAPIRenderer
  • ~WiFiDirectServiceManager() : WiFiDirectServiceManager
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- a -

  • A : ColorBGRA
  • a : Print3D , Vector4< T >
  • AAD_CLIENT_ID : sealed
  • AAD_SCOPE_REQUESTED : sealed
  • AbandonStreaming() : Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • ABitMask : DDS_PIXELFORMAT
  • AbortButton_Click() : Scenario3_ForegroundApp
  • abortButtonId : sealed , Scenario5
  • AbortDownload() : SourceBufferManager
  • ABSOLUTE_FILE_NAME : ScenarioElement
  • AbsorbedDoseGray : PresentationFormats
  • AbsorbeddoserateGrayPerSecond : PresentationFormats
  • AccelerationMetresPerSecondSquared : PresentationFormats
  • accelerometer : sealed , Scenario5_DataEventsBatching
  • Accelerometer : Scenario1_BackgroundTask , Scenario1_DeviceUse
  • accelerometerOriginal : sealed , Scenario4_OrientationChanged
  • accelerometerReadingTransform : sealed , Scenario4_OrientationChanged
  • accelerometerReadingType : MainPage
  • AccelerometerReadingType : MainPage
  • Accept_Click() : sealed , Scenario2
  • AcceptAsync() : sealed , INetworkServer , sealed
  • AcceptSessionJoinerHandler() : AllJoynHelpers
  • AcceptSessionRequest() : AdvertisementWrapper
  • AccessChanged() : sealed , Scenario3_ChangeEvents , Scenario1_Events
  • accessChangedToken : Scenario1_Check
  • AccessHandler() : AccessHandler
  • accessibility : sealed , Scenario11
  • Accessibility_HighContrastChanged() : sealed , Scenario11
  • AccountAction : sealed
  • AccountClientId : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • accountList : UserSelect
  • accountListView : UserSelect
  • AccountName : Account
  • AccountOverviewPage() : AccountOverviewPage
  • Accounts : AdaptivePage
  • ACCOUNTS_CONTAINER : sealed
  • AccountsContainer : MultipleAccountsScenario
  • AccountScopeRequested : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AccountsList_Loading() : AdaptivePage
  • AccountWatcher() : AccountWatcher
  • AcquireLicenseAsync() : CommonLicenseRequest
  • ActionTransition() : sealed
  • actionTransitionFunctions : sealed
  • Activate() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • ActivateCompleted() : WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • Activated : App
  • activated : VideoChat
  • ActivatedEventArgs : App
  • activatedToken : SampleState
  • ActivateInstance() : WrlFinal
  • Active() : GameObject , GameTimer , MoveLookController
  • active : sealed
  • activeAccount : Content
  • activeCastConnectionHandler : Scenario06
  • ActiveChallenge : DAL::RegisteredUser
  • activeDevice : Scenario05 , Scenario06
  • activeDeviceInformation : Scenario03
  • activeDialDevice : Scenario03
  • activeDownload : SourceBufferManager
  • activeDownloads : sealed , Scenario1_Download
  • activeGamePad : PlaybackPage
  • ActiveGroupings : Scenario4_CharacterGrouping
  • activeItemIndex : sealed , Scenario1_EventAndMenuHookup
  • activePlayReadyHeader : SecureStopViewModel
  • ActiveSymbologies : DecodeEngine
  • activeToolChangedToken : sealed
  • ActivityReferredToARadioNuclideBecquerel : PresentationFormats
  • ActivitySensorBackgroundTask() : sealed
  • ActivitySensorClassId : Scenario1_CurrentActivity , Scenario2_History , Scenario3_ChangeEvents , Scenario4_BackgroundActivity
  • actualRpcCallbackRate : sealed , ServiceViewModel
  • ActualRpcCallbackRate : ServiceViewModel
  • adapter : sealed , Scenario2 , sealed , WiFiNetworkDisplay
  • AdaptiveContentModel() : AdaptiveContentModel
  • adaptiveContentModels : ContentSelector
  • adaptiveMediaSource : Scenario3_RequestModification , Scenario4_Tuning
  • adaptiveMediaSourceLogger : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange
  • AdaptivePage() : AdaptivePage
  • AdaptivePage_VisibleBoundsChanged() : AdaptivePage
  • AdaptiveStates_CurrentStateChanged() : MasterDetailPage
  • Add : Scenario3_ServerForeground , sealed::sealed , IncrementalLoadingBase , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2
  • add_BreadBaked() : WrlFinal
  • Add_Click() : Scenario2_Add , Scenario1_ParseAndStringify
  • AddAccount : sealed
  • AddAccount_Click() : sealed , Scenario1_AddAccount
  • addAccountLaunched : sealed
  • AddAdvertiser() : sealed , Scenario2 , WiFiDirectServiceManager
  • AddAnimatedTilesClick() : sealed , Scenario12
  • AddAppContentFilesToIndexedFolder() : Helpers
  • AddAudio_Click() : sealed , Scenario3_AddAudioTracks , sealed
  • AddAudioAndVideoSourceBuffers() : Player
  • AddAuthorizationHeaderFilter() : AddAuthorizationHeaderFilter
  • AddBuffer() : CBufferPacket
  • AddChild() : ControlBase , IControl
  • AddChildElement() : BaseElement
  • AddClipboardFormatsOutputString() : SampleState
  • AddComboBoxItem() : Scenario1_ConfigureMobileHotspot
  • AddCommandLineCommands() : FxCompile
  • AddContentValue() : Scenario13_ShareTarget , ShareTarget
  • AddCustomEffect() : Scenario6_CustomEffects
  • AddCustomIconItems() : sealed , Scenario1_EventAndMenuHookup
  • AddCustomItem() : Scenario2_SystemDefaultMenu
  • AddCustomProvider() : sealed
  • AddCustomTitleBar() : SampleState , MainPage
  • AddDatagramSocketAsync() : sealed , SessionWrapper
  • AddDeviceAsync() : sealed , SourceGroupCollection
  • AddDeviceToList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • AddDeviceWatcher() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • AddEllipseToCanvas() : Scenario1
  • AddEventDescription() : Scenario4_ForegroundGeofence
  • AddExitButton() : MediaTransportControls
  • AddFileButton_Click() : FileOpenPicker_PickCachedFile
  • AddFolderButton_Click() : sealed , Scenario1
  • AddFontGlyphItems() : sealed , Scenario1_EventAndMenuHookup
  • AddGeofenceToRegisteredGeofenceListBox() : Scenario4_ForegroundGeofence
  • AddGroup() : Scenario4_CharacterGrouping
  • AddHolographicCamera() : DeviceResources
  • AddImageFeedScenario() : sealed
  • AddItem() : MainPage , sealed , Scenario1_EventAndMenuHookup , Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • AddItemForLanguageTag() : sealed , Scenario8
  • AddItemsToIndex() : Helpers
  • AddItemToEnd() : sealed , Scenario1_Basic
  • AdditionalIncludeDirectories : FxCompile
  • AddKnownIconItems() : sealed , Scenario1_EventAndMenuHookup
  • AddLayer1() : sealed , Scenario10 , Scenario11
  • AddLayer2() : Scenario11 , sealed , Scenario10
  • AddLinks() : sealed
  • AddLinksAndDescription() : sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddLocalFileButton_Click() : FileOpenPicker_PickAppFile
  • AddLogFileMessage() : Scenario3
  • AddLogFileMessageDispatch() : sealed , Scenario2 , Scenario3
  • AddMessage() : sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • AddMessageDispatch() : sealed , Scenario2 , Scenario3
  • AddMethodHandler() : sealed
  • AddOnePrintPage() : DisablePreviewPrintHelper
  • AddOnePrintPreviewPage() : PrintHelper , sealed , PrintHelper , CustomOptionsPrintHelper
  • AddOptimizationGoal() : sealed
  • AddOrExtendBlock() : ItemCacheManager< T >
  • AddOrientations() : sealed , CameraRotationHelper
  • AddOrUpdateSurfaceAsync() : RealtimeSurfaceMeshRenderer
  • AddPassportToAccountOnServer() : SignIn
  • AddPassportToAccountOnServerAsync() : sealed
  • AddPeriod() : Manifest
  • AddPlayPauseButton() : MediaTransportControls
  • AddPolygonToCanvas() : Scenario1
  • AddPort_Click() : sealed , Scenario5
  • AddPosition() : Stroke
  • AddPrefix_Click() : sealed , Scenario1
  • AddPrintPages() : PrintHelper , sealed , PrintHelper , PageRangePrintHelper , PhotosPrintHelper , DisablePreviewPrintHelper
  • AddProps() : RequiredDeviceProperties
  • AddQuickLink_Checked() : Scenario13_ShareTarget , ShareTarget
  • AddQuickLink_Unchecked() : Scenario13_ShareTarget , ShareTarget
  • AddReadingType() : sealed
  • AddRef() : SceneComposer , Listener , FontNameCollector
  • AddResponseFileCommands() : FxCompile
  • Address : GeneralAuthenticate , ReadBinary , UpdateBinary
  • Address_KeyUp() : Scenario1_NavToUrl
  • AddSamplesToQueue() : MFSampleGenerator
  • AddSceneObject() : SceneController
  • AddSeekbar() : MediaTransportControls
  • AddSession() : sealed , Scenario2 , Scenario4 , WiFiDirectServiceManager
  • AddSessionRequest() : sealed , Scenario2 , WiFiDirectServiceManager
  • AddSignalHandler() : sealed
  • AddSocket() : sealed , Scenario5 , WiFiDirectServiceManager
  • AddStream() : Period , CMediaSource
  • AddStreamSink() : CMediaSink
  • AddStreamSocketInternal() : sealed , SessionWrapper
  • AddStreamSocketListenerAsync() : sealed , SessionWrapper
  • AddString() : JsonRequest
  • AddSurface() : RealtimeSurfaceMeshRenderer
  • AddToIndex_Click() : sealed , S1_AddWithAPI , S2_UpdateAndDeleteWithAPI , S3_RetrieveWithAPI , S5_AddWithAppContent , S6_DeleteWithAppContent , S7_RetrieveWithAppContent
  • AddToJumpList_Click() : sealed , Scenario3_CustomItems
  • AddToListButton_Click() : sealed , Scenario7
  • addToResultGrid() : sealed , Scenario8
  • AddTrip() : sealed , TripListViewModel
  • addTripCommand : sealed , TripListViewModel
  • AddTripCommand : TripListViewModel
  • AddUriFileButton_Click() : FileOpenPicker_PickURLFile
  • AddValueChangedHandler() : Scenario2_Client
  • AddWebAccount() : sealed , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddWebAccountProvider() : sealed , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddWebAccountProviders() : sealed
  • AddWebAccountProvidersToPane() : MultipleAccountsScenario , SingleAccountScenario
  • AddWebAccounts() : sealed
  • AddWebAccountsToPane() : MultipleAccountsScenario
  • AddWebAccountToPane() : SingleAccountScenario
  • addXamlChildrenButton_Click() : sealed , Scenario3
  • AdjustDurationIfLive() : TrackingEventCue
  • AdjustSelectionEndpoint() : CustomEditControl
  • AdjustUpdateRect() : DeviceResources
  • ADMIN_KEY_LENGTH_IN_BYTES : MainPage
  • adminkey : MainPage
  • AdminKey : MainPage
  • AdvancedCapture_AllPhotosCaptured() : sealed , MainPage
  • AdvancedCapture_OptionalReferencePhotoCaptured() : sealed , MainPage
  • Advertisement : sealed , SessionRequestWrapper
  • AdvertisementId : sealed , DiscoveredDeviceWrapper , SessionWrapper
  • AdvertisementWrapper() : sealed , AdvertisementWrapper
  • advertiser : AdvertisementWrapper
  • Advertiser : AdvertisementWrapper
  • advertisers : WiFiDirectServiceManager
  • Advertisers : WiFiDirectServiceManager
  • AdvertiserStatusChanged() : sealed , WiFiDirectServiceManager
  • adxl345Sensor : sealed , Scenario1_ReadData
  • Aes : AdaptiveContentModel
  • AesToken : AdaptiveContentModel
  • AID : SelectCommand
  • AID_MC : SetCardDataScenario
  • AID_NONPAYMENT : SetCardDataScenario
  • AID_PPSE : SetCardDataScenario
  • AID_V : SetCardDataScenario
  • AlbumArtUri : MusicItem
  • AlbumItems : MainViewModel
  • Albums() : Albums
  • AllHistory_Checked() : Scenario2_History , sealed
  • AllItems : Scenario1 , sealed , Scenario2 , Scenario3 , Scenario2
  • AlljoynBusAttachment_AuthenticationComplete() : Scenario1ViewModel , Scenario2ViewModel
  • AlljoynBusAttachment_CredentialsRequested() : Scenario1ViewModel , Scenario2ViewModel
  • AlljoynBusAttachment_StateChanged() : Scenario1ViewModel , Scenario2ViewModel
  • AllJoynMessageArgStructure() : sealed
  • Alloc() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • AllocateTexture() : BaseControl
  • AllocCore() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • AllowAccess_Click() : AppContactPanel
  • AllowAppCaptureCheckBox_Toggled() : Scenario3_AppCapture
  • AmountConcentrationMolePerCubicMetre : PresentationFormats
  • AmountOfSubstanceMole : PresentationFormats
  • amplitude : RippleEffect
  • Amplitude : ToneSampleGenerator::SineSampleInfo
  • AnalyzeButton_Click() : sealed , Scenario1_Analyze
  • AngularAccelerationRadianPerSecondSquared : PresentationFormats
  • AngularVelocityRadianPerSecond : PresentationFormats
  • AngularVelocityRevolutionPerminute : PresentationFormats
  • AngularVelocitySlider_ValueChanged() : sealed
  • Animate() : Animate
  • AnimateCirclePosition() : AnimateCirclePosition
  • AnimatedSwitch_Click() : Scenario3
  • AnimateLineListPosition() : AnimateLineListPosition
  • AnimateLinePosition() : AnimateLinePosition
  • AnimatePosition() : GameObject
  • ANIMATION_OPACITY_END : SecondaryViewPage
  • ANIMATION_OPACITY_START : SecondaryViewPage
  • ANIMATION_TRANSLATION_END : SecondaryViewPage
  • ANIMATION_TRANSLATION_START : SecondaryViewPage
  • animationCompleteEvent : Scenario3
  • Animations_SelectionChanged() : sealed , Scenario1_Metrics
  • animationTask : Scenario3
  • AnnotateContactAsync() : Scenario1_CreateContact
  • ApduCommand() : ApduCommand
  • ApduReceived() : sealed
  • ApduResponse() : ApduResponse
  • ApduResponseType : ApduCommand
  • App() : App , sealed , App , sealed , App , sealed , App , sealed , App , sealed
  • App_Activated() : ScenarioElement
  • App_BackRequested() : App , sealed
  • App_EnteredBackground() : App
  • App_LeavingBackground() : App
  • App_Resuming() : Scenario1_Watcher , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , App
  • APP_SPECIFIC_PROVIDER_ID : sealed
  • APP_SPECIFIC_PROVIDER_NAME : sealed
  • App_Suspending() : App , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario1_ChatClient , Scenario1_Watcher
  • APP_TITLE : MainPage
  • App_UnhandledException() : App
  • AppBarTileId : SampleHelpers
  • appbarTileId : MainPage
  • appCapture : Scenario3_AppCapture
  • AppCapture_CapturingChanged() : Scenario3_AppCapture
  • AppContactPanel() : AppContactPanel
  • AppContactPanel_LaunchFullAppRequested() : AppContactPanel
  • appData : Scenario7_SetVersion
  • AppData_IsUpperCaseEnabledPropertyDataChanged() : Scenario1ViewModel
  • AppDownloadedKeyRequest() : Scenario3_RequestModification
  • Append() : GroupInfoList
  • Appending : SourceBufferManager
  • AppendLine() : Helpers
  • AppendLog() : Scenario1_NavToUrl
  • AppendOutputLine() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario4_PartialReadWrite , Scenario3_ClientAuthentication , sealed
  • AppendParameterSets() : CStreamSink
  • AppendSessionDateToDestinationFolder : Scenario1
  • AppendToBaseUrl() : Manifest
  • AppendVideos_Click() : sealed , Scenario2_AppendClips
  • AppException() : AppException
  • appIdUri : Scenario7_B2B
  • Application_Resuming() : sealed , OcrCapturedImage , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , OcrCapturedImage
  • Application_Start() : WebApiApplication
  • Application_Suspending() : MainPage , OcrCapturedImage , sealed , MainPage , sealed , MainPage , sealed , MainPage , OcrCapturedImage , sealed
  • Application_UnhandledException() : App
  • ApplicationContentMarginLeft : PrintHelper
  • ApplicationContentMarginTop : PrintHelper
  • ApplicationLink : SharePage
  • applicationResumingToken : OcrCapturedImage
  • applicationSuspendingToken : OcrCapturedImage
  • ApplicationTriggerTask() : sealed , ApplicationTriggerTask , sealed , ApplicationTriggerTask
  • ApplicationTriggerTaskName : BackgroundTaskSample
  • ApplicationTriggerTaskProgress : BackgroundTaskSample
  • ApplicationTriggerTaskRegistered : BackgroundTaskSample
  • ApplicationTriggerTaskResult : BackgroundTaskSample
  • Apply_Click() : Scenario1
  • Apply_Clicked() : Scenario1_Basics
  • ApplyChanges_Click() : Scenario1_ConfigureMobileHotspot
  • ApplyFonts_Click() : Scenario2_DocumentFonts , Scenario1_UIFonts , Scenario2_DocumentFonts , Scenario1_UIFonts
  • ApplyGreenFilter() : MainPage , sealed
  • ApplyLanguageFont() : MainPage
  • ApplyPixelShader() : BaseControl
  • ApplyRotationLock_Click() : Scenario1_Orientation , sealed
  • ApplyScale() : MainPage
  • ApplySettingsToLampArray() : Scenario1_Basics
  • ApplyShaders() : BaseControl , MediaTransportControls
  • AppMuted() : PlaybackControl
  • appResumeEventHandler : EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect
  • appResumeEventToken : sealed
  • AppSpecificProviderId : MultipleAccountsScenario , SingleAccountScenario
  • AppSpecificProviderName : SingleAccountScenario , MultipleAccountsScenario
  • appStore : Scenario1_MoveCertificate
  • appSuspendCallback : EventHandlerForDevice
  • appSuspendEventHandler : EventHandlerForDevice , Scenario1_ConnectDisconnect , DeviceConnect
  • appSuspendEventToken : sealed
  • AppUnmuted() : PlaybackControl
  • AppView() : sealed , AppView , sealed , AppView , sealed
  • AppView_Consolidated() : AppView
  • appViewConsolidated : AppView
  • AppViewSource() : AppViewSource , sealed
  • appWindow : Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario3_Size , Scenario1_SecondaryWindow , Scenario2_DisplayRegion
  • appWindowFrame : Scenario4_CompactOverlay , Scenario1_SecondaryWindow , Scenario3_Size , Scenario5_RelativePositioning , Scenario2_DisplayRegion
  • ArchitectureString() : sealed
  • architectureString() : Scenario1
  • AreaBarn : PresentationFormats
  • AreaHectare : PresentationFormats
  • AreaNone : sealed
  • AreaSquareMetres : PresentationFormats
  • AreCamerasStreaming() : CameraCoordinateMapper
  • AreCertificateAndCertChainValidAsync() : MainPage
  • areControlsInTitleBar : SampleState
  • AreControlsInTitleBar() : SampleState , MainPage , SampleState
  • areControlsInTitleBar : MainPage
  • ArePointsNear() : Scenario7 , sealed
  • arguments : Scenario1
  • ArrangeElements() : BaseElement , Button
  • ArrangeOverride() : StepsHelperControl , ChatListView , sealed
  • ArrangeTools() : ToolCarousel
  • arraySize : DDS_HEADER_DXT10
  • Article : ArticlePage
  • Article0 : HeroArticlesViewModel
  • Article1 : HeroArticlesViewModel
  • ArticlePage() : ArticlePage
  • ArticlePage_BackRequested() : ArticlePage
  • ArticleProperty : ArticlePage
  • ArticleSelected : SectionView
  • ArticleTapped() : SectionView
  • ArticleViewModel() : ArticleViewModel
  • ArtUri : MediaModel
  • AspectRatio() : sealed , StreamResolution
  • aspectRatio : sealed::StreamFilteringCriteria
  • AssemblerOutput : FxCompile
  • AssemblerOutputFile : FxCompile
  • AssignGroup_Click() : Scenario4_CharacterGrouping
  • aStreams : StspDescription
  • AsyncCallback() : AsyncCallback< T >
  • AsyncInitializeAudioDevice() : WASAPIRenderer , WASAPICapture
  • AsyncStartCapture() : WASAPICapture
  • AsyncStopCapture() : WASAPICapture
  • AsyncStoreData() : WASAPICapture
  • Atr : IccDetection
  • AtrHeader : AtrParser
  • AtrInfo() : AtrInfo
  • AtrInformation : IccDetection
  • AttachDownloads() : sealed
  • AttachmentImage_RightTapped() : sealed , Scenario1
  • AttachProgressAndCompletedHandlers() : GroupedBackgroundTask , sealed , SampleBackgroundTask , ServicingCompleteTask , sealed , SampleBackgroundTaskWithCondition , sealed , Scenario15_DPLCreateFileEvents , sealed , ServicingCompleteTask , sealed , ApplicationTriggerTask , sealed , SampleBackgroundTaskWithCondition , sealed , SampleBackgroundTask , Scenario3_BgChatServer , TimeTriggeredTask , ApplicationTriggerTask
  • AttachRef() : Scenario1_Basic
  • attachreferenceFrame : _360VideoPlaybackMain , HolographicApp1Main
  • AttachViewProjectionBuffer() : CameraResources
  • AttemptAuthentication : Scenario1ViewModel , Scenario2ViewModel
  • AttemptConnectionAsync() : Scenario2ViewModel
  • AttemptOnboardingAsync() : Scenario2ViewModel
  • attributes : MediaTypeValidationDescriptor
  • Audio() : Audio
  • AudioCategories : PlayerViewModel
  • AudioEchoEffect() : AudioEchoEffect
  • audioExtensions : MainPage
  • audioExtensionsInner : MainPage
  • AudioMimeType : Manifest
  • AudioTracks_SelectedIndexChanged() : Scenario5
  • Authenticate() : Scenario2ViewModel , Scenario1ViewModel
  • AuthenticateButton_Click() : Scenario3_ForegroundApp
  • AuthenticateInBackgroundAsync() : AuthenticationTask
  • AuthenticatePassportAsync() : SignIn , sealed
  • AuthenticatePasswordCredentialsAsync() : SignIn , sealed
  • AuthenticateThroughBackgroundTask : ConfigStore
  • AuthenticateWithRequestToken() : sealed , DefaultAccountScenario , MultipleAccountsScenario , sealed , SingleAccountScenario
  • AuthenticateWithRequestTokenSilent() : sealed
  • authenticationContext : Scenario3_ForegroundApp
  • AuthenticationHost : ConfigStore
  • AuthenticationToken : ConfigStore
  • AuthenticationVisibility : Scenario2ViewModel , Scenario1ViewModel
  • AUTHORITY_SUBCONTAINER : sealed
  • AuthoritySubContainer : MultipleAccountsScenario
  • AuthorizationHeader : AddAuthorizationHeaderFilter
  • AuthTypeArray : Scenario2ViewModel
  • authzInProgress : Scenario1_Facebook
  • AutoFire() : MoveLookController
  • autoFire : GameConfig
  • AutoPlay_Checked() : ContentSelector
  • AutoSuggestBox_QuerySubmitted() : Scenario2
  • AutoSuggestBox_TextChanged() : Scenario2
  • availabilityChangedRevoker : LampArrayInfo
  • availabilityStartTime : Manifest
  • AvailableNetwork : WiFiNetworkDisplay
  • availableNetwork : WiFiNetworkDisplay
  • AvailibilityStartTime : Manifest
  • averageContainerHeight : sealed , ChatListView
  • AzureActiveDirectoryAuthority : DefaultAccountScenario , MultipleAccountsScenario , SingleAccountScenario
  • AzureActiveDirectoryClientId : SingleAccountScenario , MultipleAccountsScenario , DefaultAccountScenario
  • AzureActiveDirectoryScopeRequested : SingleAccountScenario , DefaultAccountScenario , MultipleAccountsScenario
  • AzureADAuthority : SingleAzureADScenario
  • AzureKeyAcquisitionMethod : Scenario3_RequestModification
  • AzureMethodSelected_Click() : Scenario3_RequestModification
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- b -

  • B : ColorBGRA
  • b : Print3D , Vector4< T > , Vector3< T >
  • Back() : List< T >
  • BackBufferDxgiFormat : CameraResources
  • BackBufferRenderTargetView : CameraResources
  • BackBufferTexture2D : CameraResources
  • BackButton_Click() : Scenario2 , ArticlePage
  • BackButtonPage_BackRequested() : BackButtonPage
  • BackButtonVisibility : BackButtonPage
  • BACKGROUND_ENTRY_POINT : ScenarioElement
  • BACKGROUND_TASK_NAME : ScenarioElement
  • BackgroundAuthenticationCompleted : ScenarioCommon
  • BackgroundAuthenticationCompletedEventArgs() : BackgroundAuthenticationCompletedEventArgs
  • backgroundAvailable : GameConfig
  • BackgroundDeviceWatcher() : sealed , BackgroundDeviceWatcher
  • BackgroundDeviceWatcherSelectors() : DeviceSelectorChoices
  • backgroundSyncTaskRegistration : Scenario7_SyncDevice
  • backgroundTask : Provider
  • BackgroundTask_Canceled() : sealed , Provider
  • BackgroundTask_Completed() : ScenarioElement
  • BackgroundTask_Progress() : ScenarioElement
  • BackgroundTaskEntryPoint : Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioCommon , RegisterWithBackgroundTask
  • BackgroundTaskGroupFriendlyName : BackgroundTaskSample
  • BackgroundTaskGroupId : BackgroundTaskSample
  • backgroundTaskInstance : AdvertisementWatcherTask , AdvertisementPublisherTask , IoSyncBackgroundTask
  • backgroundTaskName : sealed , Scenario3_BackgroundDeviceWatcher
  • BackgroundTaskName : Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioCommon , RegisterWithBackgroundTask
  • backgroundTaskRegistered : sealed , Scenario4_BackgroundPedometer
  • backgroundTaskRegistration : sealed , Scenario3_BackgroundDeviceWatcher
  • BADGE_TILE_ID : Scenario3_SecondaryTiles
  • BadgeNumericNotificationContent() : BadgeNumericNotificationContent
  • bag : FxCompile
  • Bag : FxCompile
  • BakeBread() : IOven , sealed , IOven , Oven , IOven , WrlFinal , IOven , WrlFinal
  • BarcodeScannerInfo() : BarcodeScannerInfo
  • BarcodeScannerInstance : Scenario2_MultipleScanners
  • barcodeScannerInstance1 : Scenario2_MultipleScanners
  • barcodeScannerInstance2 : Scenario2_MultipleScanners
  • BarcodeScannerProviderConnection_DisableScannerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_EnableScannerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_HideVideoPreviewRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_SetActiveSymbologiesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_StartSoftwareTriggerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_StopSoftwareTriggerRequested() : sealed , Provider
  • barcodeScanners : Scenario5_DisplayingBarcodePreview
  • BaseControl() : BaseControl
  • BaseElement() : BaseElement
  • baseUri : Scenario3_Notifications
  • baseUrl : Manifest
  • BaseUrl : Manifest
  • baseVideoFile : sealed , Scenario4_AddOverlays
  • BasicDeferral() : BasicDeferral
  • BasicHologramMain() : BasicHologramMain
  • BasicLoader() : BasicLoader
  • BasicReaderWriter() : BasicReaderWriter
  • BasicShapes() : BasicShapes
  • BasicTests() : sealed , BasicTests
  • BATCHSIZE : FileDataSource
  • BaudRate : DeviceConfiguration
  • BaudRateSetButton_Click() : Scenario2_ConfigureDevice
  • BBitMask : DDS_PIXELFORMAT
  • Bcp47ToRecognizerNameDictionary : sealed
  • BeginCreateObject() : CSchemeHandler
  • BeginDownload() : sealed
  • BeginDraw() : sealed , DeviceResources , sealed
  • BeginExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • BeginGetEvent() : CMediaSource , CMediaStream , CStreamSink
  • beginTimeOfRecordedSession : sealed , Scenario9
  • beginTimeOfReplay : sealed , Scenario9
  • BeginVoiceUIPrompt() : HolographicVoiceInputMain
  • BgTask() : sealed
  • BgTask_Completed() : NfcUtils
  • BgTask_Progress() : NfcUtils
  • BindableNode() : sealed
  • BindMediaPlayerToUIElement() : Scenario7
  • BindToAny_Checked() : sealed , Scenario1 , sealed , Scenario1
  • BindToAny_Unchecked() : sealed , Scenario1 , sealed , Scenario1
  • biography : Contact
  • Biography : Contact
  • Bitmap() : GameInfoOverlay
  • bitmap : sealed , OcrFileImage
  • bitmapHeight : GeneratedBitmapState
  • bitmapWidth : GeneratedBitmapState
  • bitrate : MediaSegmentInformation
  • Bitrate : BitrateItem , MediaSegmentInformation
  • BitrateHelper() : BitrateHelper
  • bitrateHelper : Scenario2_EventHandlers , Scenario4_Tuning
  • BitrateItem() : BitrateItem
  • bitsPerChannel : ImageInfo
  • bitsPerPixel : ImageInfo
  • blah() : ScenarioElement
  • BlockCount : Check , Update
  • BlockList : Check , Update
  • BlockUIThread_Toggled() : sealed
  • bluetoothDevice : Scenario1_ChatClient
  • bluetoothLeDevice : Scenario2_Client
  • BluetoothLEDeviceDisplay() : BluetoothLEDeviceDisplay
  • BluetoothSigAssignedNumber : PresentationFormats
  • Blur() : sealed
  • Body : TextMessage , Email
  • BonusTime() : Simple3DGame
  • BoolPropWithINPC : DataModel
  • BoolToVisibilityConverter() : sealed
  • bottom : ElementMargin
  • BottomAppBar_Opened() : Scenario7_PinFromAppbar
  • BottomLeft : TextRenderer , Stroke::Square
  • BottomRight : TextRenderer , Stroke::Square
  • BoundaryError : DesfireResponse
  • boundingRect : sealed , Scenario2
  • Bread() : Bread , IBreadBakedEventArgs
  • BreadBaked : IOven , sealed , IOven , Oven , IOven
  • BreadCompletedHandler1() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreadCompletedHandler2() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreadCompletedHandler3() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreakSignalState_false : DeviceConfiguration
  • BreakSignalState_true : DeviceConfiguration
  • BreakStateSignalToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • BrightnessBtn_Click() : sealed , Scenario2_EnableSettings
  • BroadbandDevice() : BroadbandDevice
  • broker : ProjectionViewPage
  • Browse_Click() : Scenario1
  • brush : Shape , RectRenderer
  • Brushify() : sealed , ColorEntry
  • Bssid : WiFiNetworkDisplay
  • btnAddCard_Click() : SetCardDataScenario
  • btnAddConfigMethods_Click() : ConnectionSettingsPanel
  • btnAddIe_Click() : sealed , Scenario1_Advertiser
  • btnCancel_Click() : SetCardDataScenario
  • btnClearText_Click() : sealed , Scenario_ContinuousDictation
  • btnClose_Click() : sealed , Scenario2_Connector
  • btnCloseDevice_Click() : Scenario1_Advertiser
  • btnDebugLog_Click() : ManageCardScenario , ReceiptView
  • btnDeviceService_Click() : ModemDeviceServices
  • btnDisableCard_Click() : ManageCardScenario
  • btnEnableCard_Click() : ManageCardScenario
  • btnFilePicker_Click() : sealed , Scenario2 , Scenario3
  • btnForegroundOverrideCard_Click() : ManageCardScenario
  • btnFromId_Click() : sealed , Scenario2_Connector
  • btnGetRecord_Click() : SimCard
  • btnGetUICC_Click() : SimCard
  • btnIe_Click() : sealed , Scenario2_Connector
  • btnMainMenu_Click() : ReceiptView
  • btnPause_Click() : sealed , Scenario2 , Scenario3
  • btnPlay_Click() : sealed , Scenario2 , Scenario3
  • btnPlayPause_Click() : sealed , Scenario2 , Scenario3
  • btnRefresh_Click() : ModemInformation
  • btnRegisterBgTask_Click() : ManageCardScenario
  • btnRegisterSamplePaymentCard_Click() : ManageCardScenario
  • btnSendMessage_Click() : sealed , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector , sealed
  • btnStartAdvertisement_Click() : sealed , Scenario1_Advertiser
  • btnStartCapture_Click() : Scenario4 , sealed
  • btnStop_Click() : sealed , Scenario3 , Scenario2
  • btnStopAdvertisement_Click() : sealed , Scenario1_Advertiser
  • btnStopCapture_Click() : sealed , Scenario4
  • btnUnpair_Click() : Scenario2_Connector
  • btnUnregisterCard_Click() : ManageCardScenario
  • btnWatcher_Click() : sealed , Scenario2_Connector
  • Buffer : RenderBuffer , CMediaBufferWrapper
  • buffer : TextureData
  • BufferAllAsync() : HttpJsonContent
  • BufferBitmapForRendering() : FrameRenderer
  • BufferConverter() : Helpers::sealed
  • BufferHelper() : BufferHelper
  • BufferSize : RenderBuffer
  • BuildClipboardFormatsOutputString() : SampleState , MainPage
  • BuildClustersForZoomLevel() : sealed , Scenario7
  • BuildFilters() : Scenario1_Discovery
  • BuildNewRss() : BuildNewRss
  • BuildReadRecordResponseMC() : SetCardDataScenario
  • BuildReadRecordResponseV() : SetCardDataScenario
  • BuildWebSocketError() : MainPage
  • BulkInPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • BulkOutPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • BulkRead_Click() : Scenario4_BulkPipes
  • BulkReadAsync() : Scenario4_BulkPipes
  • BulkReadWrite_Click() : Scenario4_BulkPipes
  • BulkReadWriteAsync() : Scenario4_BulkPipes
  • BulkWrite_Click() : Scenario4_BulkPipes
  • BulkWriteAsync() : Scenario4_BulkPipes
  • BusAttachment_AuthenticationComplete() : Scenario1ViewModel , Scenario2ViewModel
  • BusAttachment_CredentialsRequested() : Scenario2ViewModel , Scenario1ViewModel
  • BusAttachment_StateChanged() : Scenario1ViewModel , Scenario2ViewModel
  • BusAttachmentMap : AllJoynBusObjectManager
  • BusAttachmentStateChanged() : sealed
  • BusObjectExists() : AllJoynBusObjectManager
  • BusObjectIsRegistered() : AllJoynBusObjectManager
  • busy : Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario1_TrackInWebcam , sealed , Scenario4_PartialReadWrite , Scenario2_Binary
  • BusySetter()
: FileLoggingSessionScenario::BusySetter
, LoggingSessionScenario::BusySetter
  • Button() : Button
  • Button_AddNewAccount_Click() : sealed
  • Button_AddProvider_Click() : sealed
  • Button_AddUser_Click() : UserSelect , sealed
  • Button_Click() : MainPage , sealed , MainPage , sealed , MainPage , Scenario3_FrameInput , Scenario2_DisplayRegion , MainPage , Scenario1_SecondaryWindow , sealed , Scenario1 , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , Scenario2_DisplayRegion , sealed , MainPage , sealed , Scenario1_CachedNetworks , Scenario2_Scan
  • Button_Click_1() : sealed
  • Button_Click_2() : sealed
  • Button_Click_3() : sealed
  • Button_Click_Register() : sealed , Scenario3_RegisterForUpdates
  • button_Click_StartMetering() : sealed , MeteringData
  • button_Click_StopMetering() : sealed , MeteringData
  • Button_Click_Unregister() : Scenario3_RegisterForUpdates , sealed
  • Button_DefaultSignIn_Click() : sealed , DefaultAccountScenario
  • Button_Forget_Click() : sealed , Content
  • Button_GetTokenSilently_Click() : sealed , DefaultAccountScenario , sealed
  • Button_ManageAccount_Click() : sealed
  • Button_ManageAccounts_Click() : sealed
  • Button_ManageSignedInAccounts_Click() : sealed
  • Button_Passport_Click() : SignIn , sealed
  • Button_Pause_Click() : PlaybackControl
  • Button_Play_Click() : PlaybackControl
  • Button_Reset() : SingleAzureADScenario , SingleAccountScenario , SingleMicrosoftAccountScenario , MultipleAccountsScenario
  • Button_Reset_Click() : sealed , DefaultAccountScenario
  • Button_Restart_Click() : sealed , Content
  • Button_SelectUser_Click() : UserSelect , sealed
  • Button_ShowAccountSettings() : SingleAccountScenario , MultipleAccountsScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • Button_SignIn_Click() : sealed , SignIn , sealed
  • Button_Stop_Click() : PlaybackControl
  • buttonAWasPressedLastFrame : HolographicTemplateAppMain::GamepadWithButtonState , BasicHologramMain::GamepadWithButtonState
  • ButtonClearAll_Click() : ScenarioElement
  • ButtonClearBadge_Click() : ScenarioElement
  • ButtonClearNotifications_Click() : ScenarioElement
  • ButtonDataMask : SuperMutt::ReadWriteBufferControlInformation
  • ButtonEndScanningInstance1_Click() : Scenario2_MultipleScanners
  • ButtonEndScanningInstance2_Click() : Scenario2_MultipleScanners
  • ButtonNameDisableReconnectToDevice : DeviceConnect , Scenario1_ConnectDisconnect , sealed
  • ButtonNameDisconnectFromDevice : DeviceConnect , Scenario1_ConnectDisconnect , sealed
  • ButtonNext_Click() : StepsControl
  • ButtonPickImage_Click() : ScenarioElement
  • ButtonPin_Click() : ScenarioElement , UpdateFourTilesControl , ScenarioElement
  • ButtonPinSecondaryTile_Click() : ScenarioElement
  • ButtonPinTile_Click() : ScenarioElement
  • ButtonPopToast_Click() : PopToastControl
  • ButtonPopToasts_Click() : ScenarioElement
  • ButtonRemoveGroup1_Click() : ScenarioElement
  • ButtonRemoveToast2_Click() : ScenarioElement
  • ButtonSendNotification_Click() : ScenarioElement
  • ButtonStartScanningInstance1_Click() : Scenario2_MultipleScanners
  • ButtonStartScanningInstance2_Click() : Scenario2_MultipleScanners
  • ButtonToggleShowPayload_Click() : UpdateFourTilesControl , PopToastControl
  • ButtonTriggerGhostToast_Click() : ScenarioElement
  • ButtonUnpinEverything_Click() : ScenarioElement
  • ButtonUpdate_Click() : ScenarioElement
  • ButtonUpdateBadgeGlyph_Click() : ScenarioElement
  • ButtonUpdateBadgeNumber_Click() : ScenarioElement
  • ButtonUpdateTile_Click() : ScenarioElement
  • ButtonUsageId : SuperMutt::ReadWriteBufferControlInformation
  • ButtonUsagePage : SuperMutt::ReadWriteBufferControlInformation
  • BytesFilled : RenderBuffer
  • BytesPerMegaByte : Scenario5_RandomAccess , sealed
  • bytesPerPixel : TextureData
  • bytesPerRow : ReadBytes , sealed
  • bytesPerSegment : sealed , ReadBytes
  • BytesToWriteAtATime : Sync
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- c -

  • c : unique_disabled_control
  • c_cubeIndices : SceneObject
  • c_cubeVertices : SceneObject
  • c_lerpRate : QuadRenderer , SpinningCubeRenderer , QuadRenderer
  • c_maxFadeTime : QuadRenderer
  • c_maxInactiveMeshTime : RealtimeSurfaceMeshRenderer
  • c_surfaceMeshFadeInTime : RealtimeSurfaceMeshRenderer
  • cacheBlocks : ItemCacheManager< T >
  • CacheChanged : ItemCacheManager< T >
  • CachedFileUpdater_Local() : CachedFileUpdater_Local
  • CachedFileUpdater_Remote() : CachedFileUpdater_Remote
  • CachedFileUpdaterPage() : CachedFileUpdaterPage
  • CachedFileUpdaterPage_SizeChanged() : CachedFileUpdaterPage
  • CachedFileUpdaterPageResized : CachedFileUpdaterPage
  • cachedFileUpdaterUI : CachedFileUpdaterPage
  • CachedFileUpdaterUI_FileUpdateRequested() : CachedFileUpdaterPage
  • CachedFileUpdaterUI_UIRequested() : CachedFileUpdaterPage
  • cachedResults : ItemCacheManager< T >
  • CafFocusRadioButton_Checked() : MainPage
  • CalcServiceUuid : Constants
  • CalculateCenter() : sealed , Scenario7
  • CalculateInitialSize() : BaseControl
  • CalculateNumberIdentifierForLive() : DashManifestParser
  • CalculatePreviewRotation() : sealed , OcrCapturedImage
  • CalculateResponse() : sealed
  • CalculateThreadgroups() : DftTransform
  • CalculatorCharacteristics : Scenario3_ServerForeground
  • CalculatorOperators : Scenario3_ServerForeground
  • CalendarConverter() : sealed
  • CALIBRATION_POPUP_AUTO_DIMSMISS_TIME : CalibrationBar
  • CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS : sealed
  • CalibrationBar() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • calibrationBar : sealed , Scenario3_Calibration
  • CallbackCount : sealed
  • CallButton_Click() : sealed , VideoChat
  • CallConcatenateHandler() : sealed
  • CallConfigureWiFiHandler() : sealed
  • CallConnectHandler() : sealed
  • CallConnectionResultReceived() : sealed
  • CallConnectionResultSignalHandler() : sealed
  • CallGetScanInfoHandler() : sealed
  • CalligraphicPen() : CalligraphicPen
  • CallOffboardHandler() : sealed
  • CallTextSentReceived() : sealed
  • CallTextSentSignalHandler() : sealed
  • Camera() : Camera
  • CameraButton_Click() : OcrCapturedImage
  • CameraButton_Tapped() : sealed
  • CameraButtonPressCount : Scenario1_Basics
  • CameraCoordinateMapper() : CameraCoordinateMapper
  • CameraIntrinsics() : GpuCoordinateMapper::CameraIntrinsics
  • cameraPosition : ViewProjectionConstantBuffer
  • CameraResources() : CameraResources
  • cameraResourcesDictionary : DeviceResources
  • cameraResourcesLock : DeviceResources
  • CameraRotationHelper() : sealed , CameraRotationHelper
  • CameraSnapshotButton_Click() : Scenario2_DetectInWebcam
  • CameraStreamCoordinateMapperMain() : CameraStreamCoordinateMapperMain
  • CameraStreamingButton_Click() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • CameraStreamProcessor() : CameraStreamProcessor
  • Cancel : Errors
  • Cancel_Click() : Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies
  • CancelableInitialRequestAsync() : Scenario12_DisableCookies
  • CancelableNextRequestAsync() : Scenario12_DisableCookies
  • CancelableRequestAsync() : Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation
  • CancelActiveDownloads() : sealed
  • CancelActiveDownloadsAsync() : sealed , Scenario3_Notifications , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario7_DownloadReordering
  • CancelAll_Click() : sealed , Scenario1_Download , Scenario2_Upload
  • CancelAllIoTasks() : Scenario3_ReadWrite , Scenario4_BulkPipes , Scenario2_LEDTemp
  • CancelAllIoTasks_Click() : Scenario4_BulkPipes
  • CancelCommand() : sealed , CancelCommand
  • CancelCommandButton_Click() : sealed , CancelCommand
  • CancelGetGeolocationButtonClicked() : Scenario2_GetPosition
  • cancelIoLock : Scenario4_BulkPipes
  • cancellationToken : sealed
  • cancellationTokenSource : sealed , IoSyncBackgroundTask , Scenario4_BulkPipes , SavingDataReason , MultipleTasks
  • CancelObjectCreation() : CSchemeHandler
  • CancelReadTask() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • CancelReason : sealed
  • cancelReason : RfcommServerTask
  • cancelRequested : RfcommServerTask
  • CancelRequested : sealed
  • CancelSelection() : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • cancelSource : sealed , DeviceEvents
  • CancelSync_Click() : Scenario7_SyncDevice
  • CancelSyncWithDevice() : Scenario7_SyncDevice
  • cancelTokenSource : ItemCacheManager< T >
  • CancelTransfer_Click() : Scenario1
  • CancelWriteTask() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • canCommitDirect3D11DepthBuffer : HolographicTemplateAppMain
  • CanCreateNewWindow() : Scenario3_UsingWindows
  • CanDestroyWindow() : Scenario3_UsingWindows
  • canDownload() : sealed , Scenario8
  • canExecute : RelayCommand
  • CanExecute() : RelayCommand , sealed , RelayCommand
  • CanExecuteChanged : RelayCommand , sealed , RelayCommand
  • CanGenerateSegmentsDynamically : MediaStream
  • canGetDefaultHolographicDisplay : HolographicTemplateAppMain
  • canGetHolographicDisplayForCamera : HolographicTemplateAppMain
  • CanPair : DeviceInformationDisplay
  • CanPaste() : SceneComposer
  • CanSecure() : AllJoynHelpers
  • CanSendMessage() : Utils
  • CanShowCalibrationBar() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • canSkipNext : PlayerViewModel
  • CanSkipNext : PlayerViewModel
  • canSkipPrevious : PlayerViewModel
  • CanSkipPrevious : PlayerViewModel
  • CanTakePhoto() : MediaCaptureManager
  • CanToggleVideo() : MediaCaptureManager
  • canvasDevice : GeneratedBitmapState
  • Capabilities_Click() : Scenario5_Capabilities
  • CapacitanceFarad : PresentationFormats
  • caps : DDS_HEADER
  • caps2 : DDS_HEADER
  • caps3 : DDS_HEADER
  • caps4 : DDS_HEADER
  • CaptionedMediaUri : MainPage
  • Captions : AdaptiveContentModel
  • CaptureButton_Click() : Scenario8_CaptureBitmap
  • CaptureDevice() : sealed , CaptureDevice
  • CaptureFailed : CaptureDevice
  • CaptureFileName : MainPage::AdvancedCaptureContext
  • CaptureOrientation : AdvancedCaptureContext , MainPage::AdvancedCaptureContext
  • CaptureSource : CaptureDevice
  • CardName() : SmartCardListItem
  • cardName : sealed
  • CardName : SmartCardListItem
  • CardReader() : CardReader
  • cardReader_CardAdded() : CardReader
  • cardReader_CardRemoved() : CardReader
  • CashDrawerInstance : sealed , Scenario3_MultipleDrawers
  • cashDrawerInstance1 : sealed , Scenario3_MultipleDrawers
  • cashDrawerInstance2 : sealed , Scenario3_MultipleDrawers
  • CastButton : MediaTransportControlsWithCustomCastButton
  • CastButton_Click() : MediaTransportControlsWithCustomCastButton
  • castButton_Click() : Scenario2
  • CastButtonClicked : MediaTransportControlsWithCustomCastButton
  • castingDevicesList_SelectionChanged() : Scenario3
  • CAsyncOperation() : CStreamSink::CAsyncOperation
  • CAsyncState() : CAsyncState
  • CatalyticActivityConcentrationKatalPerCubicMetre : PresentationFormats
  • CatalyticActivityKatal : PresentationFormats
  • CategoryIndicator : IccDetection
  • cAttributes : MediaTypeValidationDescriptor
  • CBaseAttributes() : CBaseAttributes< TBase >
  • cbAttributesSize : StspStreamDescription
  • cbDataSize : StspOperationHeader
  • cbLanguageSelection_SelectionChanged() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • CBufferEnumerator() : CBufferEnumerator
  • CBufferPacket() : CBufferPacket
  • CCCEventHandler : sealed
  • CelsiusTemperatureDegreeCelsius : PresentationFormats
  • center : RippleEffect
  • centerX : PlaybackPage
  • centerY : PlaybackPage
  • CERTAINTY_CAP : sealed , MainPage
  • ChangeAdminKey_Click() : sealed , Scenario4_ChangeAdminKey
  • ChangeFolderClick() : sealed , PhasingTests
  • ChangeMediaFormatAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • ChangePin_Click() : sealed , Scenario2_ChangePIN
  • ChangeScenarioStateAsync() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • channel : FileLoggingSessionScenario , LoggingSessionScenario
  • ChannelCenterFrequency : WiFiNetworkDisplay
  • ChannelCount : ToneSampleGenerator::SineSampleInfo
  • channelLoggingLevel : FileLoggingSessionScenario , LoggingSessionScenario
  • Characteristic_ValueChanged() : Scenario2_Client
  • CharacteristicList_SelectionChanged() : Scenario2_Client
  • CharacteristicReadButton_Click() : Scenario2_Client
  • CharacteristicWriteButton_Click() : Scenario2_Client
  • CharacteristicWriteButtonInt_Click() : Scenario2_Client
  • ChatListView() : sealed , ChatListView
  • chatService : Scenario1_ChatClient
  • chatSocket : Scenario1_ChatClient
  • chatWriter : Scenario1_ChatClient
  • Check() : Check
  • CheckAvailability_Click() : sealed , Scenario1_CheckConsentAvailability
  • CheckBackgroundAccessStatus() : Scenario1_Basics
  • CheckBackgroundAndRequestLocationAccess() : MainPage
  • CheckBox_Click() : Scenario1
  • CheckBox_Toggle() : sealed , Scenario1
  • CheckBoxChanged() : sealed
  • checkBoxStyle : sealed , Scenario1_Basic
  • CheckBoxStyle : Scenario1_Basic
  • CheckBufferSize() : BufferHelper
  • CheckClosed() : CNetworkChannel
  • CheckConcurrentProfileBtn_Click() : sealed , Scenario2_ConcurrentProfile
  • CheckDisposed() : FileLoggingSessionScenario , LoggingSessionScenario
  • CheckException() : CSendOperationStatus
  • CheckForInput() : SpatialInputHandler
  • CheckForMediaPresentationDuration() : Player
  • CheckForNullOrEmptyField() : ModemInformation
  • CheckForRecordingDeviceAsync() : CaptureDevice
  • CheckHceSupport() : NfcUtils
  • CheckHdrSupportBtn_Click() : sealed , Scenario3_EnableHdrProfile
  • CheckHistoryAndRoaming() : HistoryAndRoaming
  • CheckIf3DBuilderIsInstalled_Click() : Scenario2_Launch
  • CheckIfObsolete() : SourceHandler::PositionInformation
  • CheckIfStreamsAreIdentical() : sealed , Scenario2_PhotoSettings , Scenario3_AspectRatio
  • CheckIndexRevision_Click() : sealed , S4_CheckIndexRevision
  • CheckMarshal() : CMediaBufferWrapper
  • CheckNow_Clicked() : Scenario4_Settings
  • CheckPeripheralRoleSupportAsync() : Scenario3_ServerForeground
  • CheckPriority() : HttpMeteredConnectionFilter
  • CheckShutdown() : CMediaSink , sealed , CMediaSource , CMediaStream , CStreamSink
  • CheckStereoEnabledStatus() : DeviceResources
  • CheckUriIdentity_Click() : Scenario16_NetworkResource
  • Children : ScenarioGroup
  • chkDenyIfPhoneLocked_Checked() : ManageCardScenario
  • chkDenyIfPhoneLocked_Unchecked() : ManageCardScenario
  • chkLaunchAboveLock_Checked() : ManageCardScenario
  • chkLaunchAboveLock_Unchecked() : ManageCardScenario
  • Choices() : DeviceInformationKindChoices
  • ChooseBaseVideo_Click() : sealed , Scenario4_AddOverlays , sealed
  • ChooseFile_Click() : sealed , Scenario1_TrimAndSaveClip , Scenario1_Files
  • ChooseFileButton_Click() : sealed , Scenario1_Geotag
  • ChooseFirstVideo_Click() : sealed , Scenario2_AppendClips
  • ChooseFolder_Click() : Scenario1_Files
  • ChooseOverlayVideo_Click() : sealed , Scenario4_AddOverlays , sealed
  • ChooseSecondVideo_Click() : sealed , Scenario2_AppendClips
  • ChooseVideo_Click() : sealed , Scenario3_AddAudioTracks , sealed
  • ChunkedResponseToggle_Toggled() : Scenario07_PostStreamWithProgress
  • chunkSize : sealed , ReadBytes
  • circleCenter : sealed , Scenario8
  • circleStrokeThickness : sealed , Scenario8
  • CLA : ApduCommand
  • ClaimAndEnable_Click() : sealed , Scenario1_FindClaimEnable
  • ClaimBarcodeScannerAsync() : Scenario2_MultipleScanners
  • ClaimButton1_Click() : sealed , Scenario3_MultipleDrawers
  • ClaimButton2_Click() : sealed , Scenario3_MultipleDrawers
  • ClaimCashDrawer() : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers
  • claimedBarcodeScannerInstance1 : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance1_DataReceived() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance1_ReleaseDeviceRequested() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2 : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2_DataReceived() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2_ReleaseDeviceRequested() : Scenario2_MultipleScanners
  • claimedCashDrawerInstance1 : sealed , Scenario3_MultipleDrawers
  • claimedCashDrawerInstance1_ReleaseDeviceRequested() : sealed , Scenario3_MultipleDrawers
  • claimedCashDrawerInstance2 : sealed , Scenario3_MultipleDrawers
  • claimedCashDrawerInstance2_ReleaseDeviceRequested() : sealed , Scenario3_MultipleDrawers
  • claimedDrawer : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • ClaimedPrinter : MainPage
  • claimedPrinter : sealed
  • ClaimedPrinter_ReleaseDeviceRequested() : MainPage , sealed , MainPage
  • claimedScanner : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview
  • ClaimedScanner_Closed() : Scenario5_DisplayingBarcodePreview
  • claimedScanner_DataReceived() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ClaimedScanner_DataReceived() : Scenario5_DisplayingBarcodePreview
  • claimedScanner_ReleaseDeviceRequested() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ClaimPrinter() : sealed
  • ClaimReader() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ClaimSamePrinter_Click() : sealed , Scenario3_MultipleClaims
  • ClaimScenarioLineDisplayAsync() : MainPage
  • Clamp() : WaveEffect , D2DAdvancedColorImagesRenderer , FilmicEffect , ReinhardEffect , RippleEffect
  • ClarityValue : PhotoAdjustmentProperties
  • ClassName : Scenario , sealed
  • ClassType : Scenario
  • CleanBuffer() : SourceBufferManager
  • CleanSampleQueue() : CMediaStream
  • CleanSceneAnalysisEffectAsync() : sealed , MainPage
  • Cleanup() : sealed
  • CleanUp() : sealed
  • Cleanup_Click() : Scenario1_CreateContact
  • CleanupAccountsControlDialog() : sealed
  • CleanupAsync() : sealed , LowLatency
  • CleanUpAsync() : CaptureDevice
  • CleanupCameraAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MediaCapturePreviewer , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • CleanUpFaceDetectionEffectAsync() : sealed , MainPage
  • CleanupMediaCaptureAsync() : sealed , Scenario1_DisplayDepthColorIR , Scenario1_ExampleOperations , sealed
  • CleanUpMediaPlayerSource() : MainPage
  • CleanupPreviousEffect() : Scenario2_Effects
  • CleanupSink() : sealed , CaptureDevice
  • CleanupUiAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • CleanUpUserList() : SignIn
  • CleanUpVideoStabilizationEffectAsync() : sealed , MainPage
  • Clear() : sealed , InkRenderer , sealed , IncrementalLoadingBase , CBufferPacket , List< T > , ComPtrList< T, NULLABLE > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • Clear_Click() : Scenario6_ClearScenario
  • ClearAllDeviceValues() : Scenario1_MIDIDeviceEnumeration
  • ClearAuthenticationToken() : Scenario3_ForegroundApp
  • ClearBadge_Click() : Scenario2_Notifications
  • ClearBluetoothLEDeviceAsync() : Scenario2_Client
  • ClearButton_Click() : Scenario1 , Scenario2
  • ClearCanvasStrokeCache() : sealed , Scenario9
  • ClearCapture() : Scenario4
  • ClearColorsClick() : sealed , Functions
  • ClearDeviceEntries() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • ClearDrawnBoundingRect() : sealed , Scenario2
  • ClearExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • ClearItems() : MediaListViewModel
  • ClearLastStatus() : SdkSample
  • ClearLog() : InkEventLogger
  • ClearMapClick() : sealed , Scenario12
  • ClearNames() : FontNameCollector
  • ClearOutput() : OtherScenarios
  • ClearOutputButton_Click() : OtherScenarios
  • ClearOutputs() : sealed , Scenario1_Single , Scenario2_Multiple
  • ClearPageCollection() : sealed , PhotosPrintHelper
  • ClearPasswords() : Scenario2ViewModel
  • ClearProcessUIPolicy_Click() : Scenario3
  • ClearResults() : sealed , OcrFileImage
  • ClearScene() : SceneComposer
  • ClearSceneObjects() : SceneController
  • ClearSelectedDevice() : DeviceList
  • ClearSelection() : sealed , Scenario2
  • ClearStrokeContainerForTemp() : InkRenderer
  • ClearSurfaces() : RealtimeSurfaceMeshRenderer
  • ClearSwitchStateTable() : sealed , DeviceEvents , Scenario3_InterruptPipes
  • ClearTarget() : DeviceResources
  • ClearTile_Click() : Scenario2_Notifications
  • ClearTitle_Click() : SecondaryViewPage
  • ClearTool() : ClearTool
  • ClearVisual() : EdgeTappedListView
  • ClearVisualization() : Scenario1_DetectInPhoto
  • Click_BaseArgs() : sealed , EventTests
  • Click_NoArgs() : sealed , EventTests
  • Click_RegularArgs() : sealed , EventTests
  • clickDelegate : EventTests
  • ClickToPlaySource_ImageOpened() : sealed , Scenario1_Basic
  • ClientCertFriendlyName : Scenario3_ClientAuthentication
  • ClientCertIssuerName : Scenario3_ClientAuthentication
  • ClientCertPassword : Scenario3_ClientAuthentication
  • ClientCertUriPath : Scenario3_ClientAuthentication
  • clientId : Scenario7_B2B
  • clientSecret : Scenario7_B2B
  • ClientTypeChanged() : Scenario16_NetworkResource
  • clipboardContentChangedToken : SampleState
  • Close() : AudioEchoEffect , HttpJsonContent , PlugInFilter , SlowInputStream , HttpMeteredConnectionFilter , HttpRetryFilter , LiveDashPlayer , Player , SourceBufferManager , GameMain , CNetworkChannel , abstract , sealed , SocketReaderWriter , ConnectedDevice , SessionWrapper
  • Close_Click() : Scenario1 , Scenario2
  • CloseConnection_Click() : KeepConnectionOpenScenario
  • CloseCurrentlyConnectedDevice() : sealed , EventHandlerForDevice
  • CloseDevice() : sealed , EventHandlerForDevice
  • CloseFx2Device() : sealed , DeviceConnect
  • CloseListener_Click() : sealed , Scenario5
  • CloseListenerSocket() : sealed , Scenario5
  • CloseScannerResourcesAsync() : Scenario5_DisplayingBarcodePreview
  • CloseSession() : sealed , WiFiDirectServiceManager
  • CloseSession_Click() : sealed , Scenario2 , Scenario4
  • CloseSessionSaveFinalLogFile() : sealed , FileLoggingSessionScenario
  • CloseSocket() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • CloseSockets_Click() : sealed , Scenario4 , sealed , Scenario4
  • clustersForZoomLevel : sealed , Scenario7
  • CMarker() : CMarker
  • CmdGetLicense : ProactiveViewModel
  • CmdGetPublisherCert : SecureStopViewModel
  • CmdPlayMovie : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • CmdRenewLicense : SecureStopViewModel
  • CmdStopMovie : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • CmdUseHardware : HardwareDRMViewModel
  • CmdUseSoftware : HardwareDRMViewModel
  • CMediaBufferWrapper() : CMediaBufferWrapper
  • CMediaSource() : CMediaSource
  • CMediaStream() : CMediaStream
  • cMovementMetersPerSecond : sealed
  • cNumStreams : StspDescription
  • CO2LevelKey : Scenario1_DataEvents , Scenario2_Polling
  • CollapsedIf() : BindingHelpers , sealed
  • CollectExpensiveData() : sealed , LoggingChannelScenario
  • CollectionChange : VectorChangedEventArgs , MapChangedEventArgs< K >
  • CollectionChanged : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , FileDataSource2
  • CollectionItems : MainViewModel
  • Collections() : Collections
  • Color : sealed , ColorEntry
  • color : VertexPositionColor , ModelColorConstantBuffer , VertexPositionColor , VertexPositionNormalColor , VertexPositionColor , VertexPositionColorTex , ModelColorConstantBuffer , VertexPositionColor , CustomEffectState , Vector2< T > , Vector3< T > , Vector4< T > , ModelConstantBuffer
  • ColorEntries : sealed , Functions
  • colorFadeFactor : ModelNormalConstantBuffer
  • ColorFrameReader_FrameArrivedAsync() : Scenario1_ExampleOperations
  • ColorizeCustomButtonAsync() : sealed , Scenario10
  • ColorLampBtn_Click() : sealed , Scenario2_EnableSettings
  • colorLookup : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • ColorName : sealed , ColorEntry
  • colorNames : ColorToStringConverter
  • ColorPropWithINPC : DataModel
  • ColorRampDuration : Scenario2_Effects
  • ColorSpaceProperty : sealed , Scenario3
  • ColorValue() : sealed , Functions
  • colorValues : ColorToStringConverter
  • ComboBox_SelectionChanged() : LiveDashPlayer
  • ComboBoxSettings_Changed() : sealed , Scenario1_PreviewSettings
  • ComboChanged() : sealed
  • Command : DesfireCommand
  • CommandBar_Closed() : sealed , Scenario3 , Scenario7
  • CommandBar_Closing() : sealed , Scenario3
  • CommandBar_Opened() : sealed , Scenario3
  • CommandBar_Opening() : sealed , Scenario3 , Scenario7
  • CommandData : ApduCommand
  • CommandInvokedHandler() : sealed , CancelCommand
  • commandMode : sealed , TripVoiceCommand
  • CommandType : DesfireCommand
  • CommonDeviceSelectors() : DeviceSelectorChoices
  • CommonLicenseRequest() : CommonLicenseRequest
  • commonMediaPlayer : MainPage
  • Compare() : CBaseAttributes< TBase >
  • CompareFilesButton_Click() : sealed , Scenario9
  • CompareItem() : CBaseAttributes< TBase >
  • compass : sealed
  • Complete : sealed
  • CompleteConfirmPinTask() : sealed , Scenario9_CustomPairDevice
  • CompleteCurrentAnimation() : Scenario3
  • Completed_Tapped() : StepsControl
  • CompletedCallback() : sealed , CompletedCallback
  • CompletedCallbackButton_Click() : sealed , CompletedCallback
  • CompleteOpen() : CMediaSource
  • CompletePasswordCredential() : sealed , Scenario9_CustomPairDevice
  • CompleteProvidePinTask() : sealed , Scenario9_CustomPairDevice
  • CompletionGroupTask() : sealed
  • ComponentLoadFailed() : PlayReadyHelpers
  • ComposeStroke() : SourceHandler
  • composition : sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays
  • CompressAlgorithmComboBox_SelectionChanged() : sealed , Scenario1
  • CompressAlgorithmFromComboBoxItem() : sealed , Scenario1
  • compressedData : ScenarioContext
  • CompressFile() : Scenario1
  • CompressFileButton_Click() : sealed , Scenario1
  • compressor : ScenarioContext
  • ComputeDisplayRotation() : DeviceResources
  • ComputeHdrMetadata() : D2DAdvancedColorImagesRenderer
  • ComputeLookAtQuaternion() : MediaTransportControls
  • ComputePositionInOrbit() : OmnidirectionalSound
  • ComputeResult() : Scenario3_ServerForeground
  • ComputeScalingTransformForSourceImage() : Scenario1_DetectInPhoto
  • ComputeSphere() : VideoRenderer
  • ConcatenateAsync() : ISecureInterfaceService , sealed , Scenario1ViewModel , SecureInterfaceService
  • ConcatToOutput() : sealed
  • ConcentrationCountPerCubicMetre : PresentationFormats
  • config : Scenario2_SystemDefaultMenu
  • ConfigMethods : sealed , DiscoveredDeviceWrapper
  • ConfigureApo() : CardioidSound
  • ConfigureCurrentlyConnectedDevice() : EventHandlerForDevice
  • ConfigureDeviceInternal() : WASAPIRenderer
  • ConfigureHardwareDRM() : HardwareDRMViewModel
  • ConfigureMse() : Player
  • ConfigurePreheatTemperature() : IOven , Oven , IOven , WrlFinal , IOven , WrlFinal
  • ConfigureSoftwareDRM() : HardwareDRMViewModel
  • ConfigureSource() : WASAPIRenderer
  • ConfigureStreams() : MFSampleGenerator
  • ConfigureWiFiAsync() : IOnboardingService , sealed , OnboardingService
  • confirmPinTaskSrc : sealed , Scenario9_CustomPairDevice
  • Connect : Scenario2ViewModel
  • ConnectAsync() : IOnboardingService , sealed , OnboardingService , sealed , INetworkClient , sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario4_PartialReadWrite , sealed , DiscoveredDeviceWrapper
  • ConnectButton_Click() : Scenario2_Client , Scenario1_ChatClient , Scenario1_Connect , sealed , Scenario4_Connect
  • connected : sealed
  • ConnectedDevice() : sealed , ConnectedDevice
  • ConnectedDevices : Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector
  • ConnectedSessionList : WiFiDirectServiceManager
  • connectedSessions : WiFiDirectServiceManager
  • connectedSocket : Scenario1_Send
  • ConnectEntryPoint : Constants
  • connection : Scenario02 , KeepConnectionOpenScenario , RandomNumberGeneratorTask , Provider , Scenario3
  • Connection_ErrorOccurred() : Scenario02 , Scenario06 , Scenario2 , Scenario3
  • Connection_ServiceClosed() : KeepConnectionOpenScenario
  • Connection_StateChanged() : Scenario02 , Scenario06 , Scenario2 , Scenario3
  • connectionId : sealed
  • connectionObject : AccessHandler , IccDetection , AccessHandler
  • ConnectionResult() : sealed
  • ConnectionResultReceived : IOnboardingLegacySignals , IOnboardingSignals
  • ConnectionSettingsPanel() : ConnectionSettingsPanel
  • ConnectivityLevel : sealed , WiFiNetworkDisplay
  • ConnectPanelVisibility : Scenario2ViewModel
  • ConnectRequestRecieved : OnboardingService
  • ConnectSocket_Click() : sealed , Scenario2 , sealed , Scenario2 , Scenario5
  • ConnectSocketWithRetry() : sealed
  • ConnectSocketWithRetryHandleSslErrorAsync() : sealed
  • ConnectTaskName : Constants
  • ConnectToDevice_Click() : sealed , Scenario1_ConnectDisconnect , DeviceConnect
  • ConnectToProducer : Scenario1ViewModel
  • ConnectToRemoteAppServiceAsync() : Scenario3_LaunchAppServices
  • ConnectToSoftAPAsync() : Scenario2ViewModel
  • ConnectToUri() : Scenario16_NetworkResource
  • ConnectUsingBackgroundTransfer() : Scenario16_NetworkResource
  • ConnectUsingNetHttpClient() : Scenario16_NetworkResource
  • ConnectUsingWebHttpClient() : Scenario16_NetworkResource
  • ConnectWebSocketAsync() : sealed , Scenario3_ClientAuthentication
  • Conservative : HttpMeteredConnectionFilter
  • ConsoleRun() : CSampleService
  • Consolidated : ViewLifetimeControl
  • consolidated : ViewLifetimeControl , sealed
  • Consolidated : ViewLifetimeControl
  • Construct() : App
  • ConstructInBackground() : GameMain
  • CONSUMER_AUTHORITY : sealed
  • Consumer_IsUpperCaseEnabledChanged() : Scenario1ViewModel
  • Consumer_SessionLost() : Scenario1ViewModel , Scenario2ViewModel
  • ConsumerAuthority : SingleMicrosoftAccountScenario
  • ConsumerOptionsVisibility : Scenario1ViewModel
  • Contact() : Contact
  • ContactEmail : Constants
  • ContactFirstName : Constants
  • ContactImageSource : Constants
  • ContactLastName : Constants
  • ContactListName : Constants
  • ContactPhone : Constants
  • ContactRemoteId : Constants
  • Contacts : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail
  • Container : CBufferPacket
  • containerName : Scenario3_SettingContainer
  • Contains() : IncrementalLoadingBase , IScenario , Scenario , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , FileDataSource2 , ItemIndexRangeList , EmployeeCollection , FileDataSource , ScenarioGroup
  • ContainsKey() : EmployeeDictionary
  • Content() : sealed , Content
  • ContentManagementSystemStub : MainPage
  • ContentMinWidth : DynamicCommandBar
  • ContentMinWidthProperty : DynamicCommandBar
  • ContentSelector() : ContentSelector
  • ContentStream : DEVICEPROPS
  • ContentTransitionStoryboard_Completed() : SectionView
  • contentTypeFilder : Scenario1
  • context : sealed
  • ContextChanged() : sealed
  • ContinuationPage() : sealed , ContinuationPage
  • Continue() : CServiceBase
  • ContinueAuthenticationInForeground() : AuthenticationTask
  • continueButtonId : sealed , Scenario5
  • ContinueGame() : Simple3DGame
  • Continuous() : Animate
  • continuousRecognitionCompletedToken : sealed
  • continuousRecognitionResultGeneratedToken : sealed
  • ContinuousRecognitionSession_Completed() : sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_PauseAsync , sealed , Scenario_ContinuousDictation
  • ContinuousRecognitionSession_ResultGenerated() : sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_PauseAsync , Scenario_ContinuousDictation
  • ContinuousRecognize_Click() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ContinuousRecognitionListGrammar , sealed
  • Contours() : sealed
  • ContrastingColorButtonCheckedChanged() : sealed , Scenario11
  • ContrastValue : PhotoAdjustmentProperties
  • Control_Loaded() : MPEUserControl
  • Control_Unloaded() : MPEUserControl
  • ControlBase() : ControlBase
  • controller : sealed , Scenario2_SystemDefaultMenu
  • Controller : Scenario1_EventAndMenuHookup
  • Controller_ButtonClicked() : Scenario1_EventAndMenuHookup
  • Controller_ControlAcquired() : Scenario1_EventAndMenuHookup
  • Controller_ControlLost() : Scenario1_EventAndMenuHookup
  • Controller_RotationChanged() : Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • Controller_ScreenContactContinued() : Scenario1_EventAndMenuHookup
  • Controller_ScreenContactEnded() : Scenario1_EventAndMenuHookup
  • Controller_ScreenContactStarted() : Scenario1_EventAndMenuHookup
  • conversation : sealed , Scenario2_Load
  • Conversation() : sealed , Conversation
  • Convert() : ScenarioBindingConverter , PlaybackStateToButtonIconConverter , InvertBoolConverter , sealed , DateTimeOffsetConverter , sealed , ScenarioBindingConverter , TypeToUIElementConverter , XmlDocumentToStringConverter , BooleanToVisibilityConverter , sealed , NegatingBoolConverter , Helpers::sealed , Helpers::BufferConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , ScenarioBindingConverter , ColorToStringConverter , ScenarioBindingConverter , Helpers::ServiceStatusConverter , ScenarioBindingConverter , VisibilityConverter , AuthTypeToStringConverter , RoundingConverter
  • ConvertACKindToString() : sealed
  • ConvertBack() : AuthTypeToStringConverter , ScenarioBindingConverter , PlaybackStateToButtonIconConverter , InvertBoolConverter , RoundingConverter , sealed , VisibilityConverter , sealed , ScenarioBindingConverter , TypeToUIElementConverter , ScenarioBindingConverter , BooleanToVisibilityConverter , sealed , NegatingBoolConverter , ScenarioBindingConverter , Helpers::sealed , Helpers::ServiceStatusConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , ScenarioBindingConverter , ColorToStringConverter , Helpers::BufferConverter , ColorToStringConverter , XmlDocumentToStringConverter , DateTimeOffsetConverter , ScenarioBindingConverter
  • ConvertClockwiseDegreesToSimpleOrientation() : sealed , CameraRotationHelper
  • ConvertDeviceOrientationToDegrees() : sealed , MainPage , sealed
  • ConvertDipProperty() : PhotoAdjustmentRenderer
  • ConvertDisplayOrientationToDegrees() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • ConvertDisplayOrientationToSimpleOrientation() : CameraRotationHelper , sealed
  • ConvertFromDIPToPixelUnit() : DeviceResources
  • ConvertFromPixelToDIPUnit() : DeviceResources
  • ConvertOrientationToPhotoOrientation() : MainPage , sealed , MainPage , sealed , MainPage , sealed
  • ConvertPreviewToUiRectangle() : sealed , MainPage
  • ConvertRange() : Scenario5_InboxEffects
  • ConvertShapes() : Scenario1
  • ConvertSimpleOrientationToClockwiseDegrees() : sealed , CameraRotationHelper
  • ConvertSimpleOrientationToPhotoOrientation() : sealed , CameraRotationHelper
  • ConvertSimpleOrientationToVideoRotation() : sealed , CameraRotationHelper
  • ConvertToDisplayableImage() : sealed
  • ConvertToNfcMessageAsync() : Scenario1
  • ConvertUiTapToPreviewRect() : MainPage
  • ConvertUpdateRect() : SceneComposer
  • ConvertUtf8ToHex() : Scenario2ViewModel
  • coord : Vector2< T > , Vector4< T > , Vector3< T >
  • coordinateSystem : SurfaceMeshProperties
  • CopyAllItems() : CBaseAttributes< TBase >
  • CopyAssetToFolderIfNecessaryAsync() : Scenario5_Msappdata
  • CopyBitmap() : CopyImage
  • CopyButton_Click() : CopyFiles , CopyText , HistoryAndRoaming , CopyFiles , CopyImage , CopyText , HistoryAndRoaming , CopyImage
  • CopyFileButton_Click() : sealed , Scenario8
  • CopyFiles() : CopyFiles
  • CopyFlyoutItem_Click() : sealed
  • CopyFromVideoMediaFrame() : NV12VideoTexture
  • CopyImage() : CopyImage
  • CopyProtectionAsync() : Scenario4
  • CopyProtectionAsync_Click() : Scenario4
  • CopyRequestMessage() : HttpRetryFilter
  • CopyrightProperty : sealed , Scenario3
  • CopySelected() : SceneComposer
  • CopyText() : CopyText
  • CopyTo() : FileDataSource , CBufferPacket , EmployeeCollection , FileDataSource2 , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , VeryObservableCollection-g< T > , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , IncrementalLoadingBase , FileDataSource , EmployeeDictionary
  • CopyToClipboard_Click() : Scenario10_CpToClipboard
  • CopyWithDelayedRenderingButton_Click() : CopyImage
  • coreDispatcher : MidiDeviceWatcher
  • CoreDispatcher_AcceleratorKeyActivated() : RootFrameNavigationHelper
  • coreInput : sealed
  • coreTitleBar : CustomTitleBar , sealed
  • CoreTitleBarHeight : CustomTitleBar
  • CoreTitleBarPadding : CustomTitleBar
  • coreWetStrokeUpdateSource : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeCanceled() : Scenario8 , sealed
  • CoreWetStrokeUpdateSource_WetStrokeCompleted() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeContinuing() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeStarting() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeStopping() : Scenario8 , sealed
  • CoreWindow_KeyDown() : CustomEditControl
  • CoreWindow_PointerPressed() : RootFrameNavigationHelper , CustomEditControl
  • CoreWindow_VisibilityChanged() : TripListView
  • cortanaContext : AdventureWorksVoiceCommandService
  • cortanaResourceMap : AdventureWorksVoiceCommandService
  • CostBasedSuggestions() : GetConnectionProfiles
  • CostGuidance : Helpers
  • Count : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource2 , FileDataSource , EmployeeCollection , ItemIndexRangeList
  • CountEmployees() : Functions , sealed
  • CountEmployeesinternal() : Functions
  • countVowels() : sealed , Functions
  • cPixelsToMeters : sealed
  • cPixelsToMetersPerSecond : sealed
  • cPixelsToRadians : sealed
  • cPixelsToRadiansPerSecond : sealed
  • Create() : JsonRequest , DftEffect , CMarker
  • Create_Click() : Scenario1_ProvisionTPM , Scenario1_Define , Scenario6_Recurrence , Scenario1_ProvisionTPM , sealed
  • CreateAdvertiser_Click() : Scenario1 , sealed
  • CreateAndStartAsync() : CameraStreamProcessor , CameraCoordinateMapper
  • CreateAsync() : FaceTrackerProcessor , VideoFrameProcessor
  • CreateAudioGraph() : Scenario4_Submix , Scenario3_FrameInput , Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario5_InboxEffects , Scenario6_CustomEffects
  • CreateAudioType() : MFSampleGenerator
  • CreateBackgroundDownloader() : sealed , CompletionGroupTask
  • CreateBadgeAndTextTile_Click() : Scenario3_SecondaryTiles
  • CreateBadgeTile_Click() : Scenario3_SecondaryTiles
  • CreateBarcodeScannerReportFromString() : sealed , Provider
  • CreateBinding() : WordOverlay
  • CreateBooleanChartInTable() : Scenario3_InterruptPipes
  • CreateBooleanTable() : DeviceList
  • CreateBorder() : WordOverlay
  • CreateBox() : BasicShapes
  • CreateBrush() : ShapeRenderer
  • CreateBusObject() : AllJoynBusObjectManager , AllJoynHelpers
  • CreateChildElement() : sealed , VisualProperties
  • CreateCircle() : SpatialStageManager
  • CreateCityBuildingsCollection() : MainPage
  • CreateCityParksCollection() : MainPage
  • CreateContactAsync() : Scenario1_CreateContact
  • CreateContactFromUserInput() : MainPage
  • CreateContainer_Click() : Scenario3_SettingContainer
  • CreateCube() : BasicShapes
  • CreateD3D11Surface() : VideoRenderer
  • CreateDefaultCashDrawerObject() : sealed , Scenario3_MultipleDrawers , Scenario1_OpenDrawer , Scenario2_CloseDrawer , sealed
  • CreateDefaultItemList() : ItemList
  • CreateDefaultMagneticStripeReaderObject() : Scenario1_BankCards , Scenario2_AamvaCards
  • CreateDefaultReaderObject() : sealed
  • CreateDefaultScannerObjectAsync() : Scenario2_MultipleScanners
  • CreateDeviceDependentResources() : SpinningCubeRenderer , SampleOverlay , RealtimeSurfaceMeshRenderer , CameraCoordinateMapper , PhotoAdjustmentRenderer , CustomComputeShaderRenderer , VideoRenderer , SampleOverlay , D2DAdvancedColorImagesRenderer , SpinningCubeRenderer , QuadRenderer , TextRenderer , SampleOverlay , D2DSvgImageRenderer , Cursor , IControl , SpinningCubeRenderer , final , QuadRenderer , SpinningCubeRenderer , GameHud , GameInfoOverlay , GameRenderer , GameHud , RenderingHelper , TextRenderer , RectRenderer , CustomPixelShaderRenderer , GpuCoordinateMapper , D2DGradientMeshRenderer , DWriteColorTextRendererRenderer , CustomVertexShaderRenderer , SceneController , SceneObject , ControlBase , GameRenderer , GameInfoOverlay , GameRenderer , GameHud , DistanceFieldRenderer
  • CreateDeviceDependentResourcesAsync() : NV12VideoTexture , VideoRenderer , QuadRenderer , SpinningCubeRenderer , TextRenderer , Resource
  • CreateDeviceIndependentResources() : DeviceResources , D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , CustomVertexShaderRenderer , DeviceResources , PhotoAdjustmentRenderer , DeviceResources , Audio , DeviceResources , D2DSvgImageRenderer , DeviceResources , CustomPixelShaderRenderer , DeviceResources
  • CreateDeviceResources() : DeviceResources , sealed , DeviceResources , sealed
  • CreateDirectXBuffer() : final
  • CreateDownload() : Scenario7_DownloadReordering , Scenario3_Notifications
  • CreateDownloadAsync() : sealed
  • createdShaders : AppView
  • CreateEchoEffect() : Scenario5_InboxEffects
  • CreateEnterAnimation() : SecondaryViewPage
  • CreateEqEffect() : Scenario5_InboxEffects
  • CreateFaceDetectionEffectAsync() : MainPage , sealed
  • CreateFileAndProtect() : Scenario4
  • CreateFileButton_Click() : sealed , Scenario5_TriggerCFU , Scenario1 , sealed , Scenario5_TriggerCFU , Scenario1
  • CreateFilePicker() : MainPage
  • CreateFilmicImpl() : FilmicEffect
  • CreateForCurrentView() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • CreateFromHeadingPitchRoll() : Helpers
  • CreateFromXml_Click() : Scenario1_Print
  • CreateGameDeviceResourcesAsync() : GameRenderer
  • CreateGeneratorButton_Click() : Scenario1_Conversion , sealed , Scenario3_ReverseConversion , Scenario2_Prediction
  • CreateGraphButton_Click() : Scenario2_DeviceCapture
  • CreateHeaderTextBlock() : Helpers , Scenario2 , Scenario3 , sealed
  • CreateHistogramResources() : D2DAdvancedColorImagesRenderer
  • CreateHitTextureResourceView() : TargetTexture
  • CreateHttpClientWithPlugIn() : Helpers
  • CreateImageDependentResources() : D2DAdvancedColorImagesRenderer
  • CreateIndexBuffer() : BasicShapes , MeshGeometry , BasicShapes
  • CreateInkDrawingAttributesCore() : sealed , CalligraphicPen
  • CreateInputLayout() : BasicLoader
  • CreateInstance() : CMediaStream , CBufferPacket , CMediaSource , CMediaBufferWrapper , CBufferEnumerator
  • CreateInterfaces() : AllJoynHelpers
  • CreateItems() : ItemsDataSource
  • CreateItemString() : Helpers
  • CreateLayers() : Scenario10 , sealed
  • createLicenseSession() : PlayReadyHelpers
  • CreateLimiterEffect() : Scenario5_InboxEffects
  • CreateLineItemTextBlock() : sealed , Scenario4 , Scenario3 , sealed , Scenario2 , sealed , Helpers
  • CreateLocalDataContainers() : MultipleAccountsScenario , sealed
  • CreateLuminanceHeatmapImpl() : LuminanceHeatmapEffect
  • CreateManagerEmployeeTree() : DataModel
  • CreateMediaBreaksForItem() : Scenario6_AdInsertion
  • CreateMediaEncodingProfile() : Scenario2_DeviceCapture
  • CreateMediaPlaybackItem : ContentSelector
  • CreateMediaPlayer_Click() : Scenario8_TransferMediaPlayer1
  • CreateMenuItems() : Scenario1_EventAndMenuHookup , sealed
  • CreateMesh() : BasicLoader
  • CreateMessages() : Conversation
  • CreateNewEventHandlerForDevice() : EventHandlerForDevice
  • CreateNewMediaPlaybackItem() : ContentSelector
  • CreateNotification() : BadgeNumericNotificationContent
  • CreateOrUpdatePropertyPopUp() : sealed , Scenario2
  • CreateOven() : WrlFinal , IOvenFactory , WrlFinal , IOvenFactory
  • CreateOverlays() : Scenario4_AddOverlays , sealed
  • CreatePackageAsync() : Scenario1_Print
  • CreatePackageFromXmlAsync() : Scenario1_Print
  • CreatePartsAsync() : sealed
  • CreatePassportKeyAsync() : sealed , SignIn
  • CreatePassportKeyCredentialAsync() : EnableHelloPage
  • CreatePlaceholderContact() : Scenario2_DelayMini , sealed
  • CreatePresentationDescriptor() : CMediaSource
  • CreatePrintPreviewPages() : PageRangePrintHelper , PrintHelper , PhotosPrintHelper , sealed , CustomOptionsPrintHelper , PrintHelper
  • CreateProducerSession() : AllJoynHelpers
  • CreateProgrammatically_Click() : Scenario1_Print
  • CreateRandomMessage() : Conversation
  • CreateReaderAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • CreateReferenceAxis() : BasicShapes
  • CreateReinhardImpl() : ReinhardEffect
  • CreateReports() : DataModel
  • CreateResourcesAsync() : CameraStreamCoordinateMapperMain
  • CreateResourcesForBackBuffer() : CameraResources
  • CreateResultFileAsync() : Scenario4_CompletionGroups
  • CreateReverbEffect() : Scenario5_InboxEffects
  • CreateRippleImpl() : RippleEffect
  • CreateRootFrame() : App
  • CreateScaledBitmapFromStreamAsync() : Scenario8_CaptureBitmap
  • CreateSceneAnalysisEffectAsync() : MainPage , sealed
  • CreateSdrOverlayImpl() : SdrOverlayEffect
  • CreateSecondaryTile() : Scenario1_CreateTile
  • createShaders : AppView
  • CreateSolidGlyphBuffer() : Scenario5_DefiningCustomGlyphs , sealed
  • CreateSphere() : BasicShapes
  • CreateSwitchStateArray() : sealed , DeviceEvents
  • CreateTangentSphere() : BasicShapes
  • CreateTangentVertexBuffer() : BasicShapes
  • CreateTestContacts() : Scenario1_CreateContacts
  • CreateTestData() : PhasingTests
  • CreateTestFile() : Scenario3_ReceiveFile
  • CreateTestFileWithNoExtension() : Scenario3_ReceiveFile
  • CreateTextContext() : Text
  • CreateTexture() : BasicLoader
  • CreateTextureResourceView() : TargetTexture
  • CreateTrackingEventsTrack() : TrackingEventCue
  • CreateTransferGroup() : sealed
  • CreateUserActivityAsync() : Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard
  • CreateVertexBuffer() : BasicShapes , MeshGeometry , BasicShapes
  • CreateVideoShaders() : _360VideoPlaybackMain , HolographicApp1Main
  • CreateVideoStabilizationEffectAsync() : MainPage , sealed
  • CreateView() : sealed , VisualPropertiesFactory , sealed , VisualPropertiesFactory , sealed , DirectXApplicationSource , sealed , App , AppViewSource , sealed , AppViewSource
  • CreateView_Click() : Scenario1
  • CreateWaveImpl() : WaveEffect
  • CreateWAVFile() : WASAPICapture
  • CreateWindowSizeDependentResources() : DeviceResources , CustomComputeShaderMain , QuadRenderer , CameraStreamCoordinateMapperMain , D2DSvgImageRenderer , SampleOverlay , DeviceResources , DWriteColorTextRendererRenderer , DeviceResources , CustomVertexShaderMain , GameMain , SampleOverlay , GameHud , D2DAdvancedColorImagesRenderer , CustomPixelShaderMain , DeviceResources , SampleOverlay , DeviceResources , CustomComputeShaderRenderer , DeviceResources , GameMain , GameRenderer , GameHud , GameRenderer , GameMain , GameInfoOverlay , D2DGradientMeshRenderer , DeviceResources , GameHud , PhotoAdjustmentRenderer , CustomPixelShaderRenderer , DeviceResources , CustomVertexShaderRenderer , SampleOverlay , DeviceResources , GameRenderer , SampleOverlay , DeviceResources , GameInfoOverlay
  • CreateWordHeightBinding() : sealed
  • CreateWordPositionBinding() : sealed
  • CreateWordWidthBinding() : sealed
  • criticalSection : LowLatencyInputMain
  • CritSec() : CritSec
  • critSec : sealed
  • cRotationRadiansPerSecond : sealed
  • CSampleService() : CSampleService
  • CServiceBase() : CServiceBase
  • CSetRateOperation() : CSetRateOperation
  • CSharpModel : OtherBindings , BasicTests , Functions , CSharpModel
  • CSourceLock() : CMediaStream::CSourceLock
  • CSourceOperation() : CSourceOperation
  • CStartOperation() : CStartOperation
  • CStreamSink() : CStreamSink
  • cts : Scenario1 , Scenario01_GetText , Scenario14_MeteredConnectionFilter , Scenario1_Download , Scenario07_PostStreamWithProgress , Scenario2_Upload , Scenario04_PostText , Scenario08_PostCustomContent , Scenario15_ServerCertificateValidation , Scenario09_GetCookie , Scenario03_GetList , Scenario02_GetStream , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario05_PostStream , Scenario06_PostMultipart
  • ctsForAppHttpClientForKeys : Scenario3_RequestModification
  • ctsForInboundBitsPerSecondUiRefresh : Scenario4_Tuning
  • cumulativeTransform : sealed , ManipulationInputProcessor
  • currChunk : sealed
  • Current : EventHandlerForDevice , DeviceList , EventHandlerForDevice , MainPage , FileOpenPickerPage , EventHandlerForDevice , FileSavePickerPage , ServiceViewModel , CachedFileUpdaterPage , MainPage
  • Current_UnhandledException() : App
  • Current_VisibilityChanged() : Scenario4_OrientationChanged , Scenario3
  • currentActiveSampleIndex : AudioEchoEffect
  • CurrentApp : SampleState
  • CurrentDensityAmperePerSquareMetre : PresentationFormats
  • currentEncodingProperties : AudioEchoEffect
  • currentFeed : S1_GetAFeed , sealed
  • currentFeedback : Scenario4_InteractionFeedback , Scenario3_InkingFeedback
  • CurrentItem : MediaListViewModel
  • currentItemIndex : sealed , MediaListViewModel
  • CurrentItemIndex : MediaListViewModel
  • currentItemIndex : Scenario1 , S1_GetAFeed
  • CurrentLevel() : Simple3DGame
  • currentMessageType : Scenario3_SendMIDIMessages
  • currentMidiOutputDevice : Scenario3_SendMIDIMessages
  • currentOperation : Scenario1_ExampleOperations
  • currentPackage : Scenario1_Print
  • currentPageDescription : PhotosPrintHelper
  • CurrentPlaylist : PlaybackService
  • CurrentSession : WiFiDirectServiceManager
  • currentState : LowLatency , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam
  • CurrentTimeAsString() : SampleHelpers
  • CurrentToolChanged() : Scenario2 , sealed
  • currentTransferCancelToken : Scenario1
  • currentUiccApp : SimCard
  • CurrentUser() : Scenario1_ParseAndStringify
  • currentValue : Scenario2_Listen , sealed , Scenario2_Listen
  • Cursor() : Cursor
  • CustomCommand() : CustomCommand , sealed
  • CustomCommandButton_Click() : CustomCommand , sealed
  • CustomComputeShaderMain() : CustomComputeShaderMain
  • CustomComputeShaderRenderer() : CustomComputeShaderRenderer
  • CustomControlUsage() : CustomControlUsage
  • CustomDataTypeGuid : PoseTrackingFrameHeader
  • CustomEditControl() : CustomEditControl
  • CustomEffect_UpdateRequested() : Scenario2_Effects
  • CustomEffectButton_Click() : Scenario2_Effects
  • CustomEffectFrameCount : Scenario2_Effects
  • CustomEffectState() : CustomEffectState
  • CustomException() : CustomException , sealed , CustomException , sealed , CustomException
  • CustomExceptionWRL() : sealed
  • CustomFocusVisuals() : CustomFocusVisuals
  • customItem : Scenario2_SystemDefaultMenu
  • CustomMediaTransportControls() : CustomMediaTransportControls
  • CustomMTC_Liked() : MainPage
  • CustomOptionsPrintHelper() : sealed , CustomOptionsPrintHelper
  • CustomPixelShaderMain() : CustomPixelShaderMain
  • CustomPixelShaderRenderer() : CustomPixelShaderRenderer
  • customSensor : Scenario1_DataEvents , Scenario2_Polling
  • CustomTextBox() : CustomTextBox
  • CustomTextRenderer() : CustomTextRenderer
  • customTitleBar : MainPage , SampleState
  • CustomTitleBar() : CustomTitleBar , sealed
  • CustomTitleBar_Loaded() : CustomTitleBar , sealed
  • CustomTitleBar_Unloaded() : sealed , CustomTitleBar
  • CustomTrigger() : CustomTrigger , sealed
  • customTriggerTaskName : CustomTrigger
  • CustomVertexShaderMain() : CustomVertexShaderMain
  • CustomVertexShaderRenderer() : CustomVertexShaderRenderer
  • CutFlyoutItem_Click() : sealed
  • CutSelected() : SceneComposer
  • cw : PlaybackControl
  • CycleAdvancedCaptureMode() : sealed , MainPage
  • CycleBackground() : GameMain , Simple3DGame
  • CycleButton_Click() : Scenario2_Effects
  • CycleModeButton_Click() : sealed
  • Cylinder() : Cylinder
  • CylinderMesh() : CylinderMesh
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- d -

  • d : MediaSegment
  • D2DAdvancedColorImagesRenderer() : D2DAdvancedColorImagesRenderer
  • d2dFactory : DeviceResources
  • D2DFactory : DeviceResources
  • d2dFactory : DeviceResources
  • D2DFactory : DeviceResources
  • D2DGradientMeshMain() : D2DGradientMeshMain
  • D2DGradientMeshRenderer() : D2DGradientMeshRenderer
  • D2DSvgImageRenderer() : D2DSvgImageRenderer
  • d3dBackBuffer : CameraResources
  • d3dContext : DeviceResources
  • d3dDepthBuffer : CameraResources
  • d3dDepthStencilView : CameraResources
  • d3dDevice : DeviceResources
  • D3DDevice : DeviceResources
  • D3DDeviceContext : DeviceResources
  • D3DDeviceFeatureLevel : DeviceResources
  • d3dDeviceSupportsVprt : DeviceResources
  • D3DDeviceSupportsVprt : DeviceResources
  • d3dFeatureLevel : DeviceResources
  • d3dInteropDevice : DeviceResources
  • D3DInteropDevice : DeviceResources
  • d3dInteropDevice : DeviceResources
  • d3dInteropSurface : VideoRenderer
  • d3dRenderTargetSize : CameraResources
  • d3dRenderTargetView : CameraResources
  • d3dViewport : CameraResources
  • DAL() : DAL
  • DASHEntry() : DASHEntry
  • DashManifestParser() : DashManifestParser
  • data : EmployeeCollection , EmployeeDictionary , VeryObservableCollection-g< T >
  • Data : DesfireCommand , Write
  • Data_CollectionChanged() : EmployeeCollection , VeryObservableCollection-g< T > , EmployeeCollection , VeryObservableCollection-g< T >
  • DataBits : DeviceConfiguration
  • DataBitsComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • dataFormatName : Scenario13_ShareTarget , ShareTarget
  • datagramSocket : SocketWrapper
  • DataModel() : DataModel
  • DataObjectType : IncrementDecrement , ManageSessionResponse , TransparentExchangeResponse , ManageSession , TransparentExchange
  • dataReader : SocketReaderWriter
  • DataReaderObject : Scenario3_ReadWrite , Scenario2_LEDTemp
  • DataSizeInBytes : PoseTrackingEntityData
  • dataSource : PhasingTests
  • DataSource_CollectionChanged() : PhasingTests
  • DataSource_VectorChanged() : sealed
  • DataTerminalReadyEnabledToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • dataTransferManager : ShareCustomProvider , SharePage
  • DataTransferManager_DataRequested() : Scenario7_Share
  • DataTurnOff : SuperMutt::DeviceInputReportControlInformation
  • DataTurnOn : SuperMutt::DeviceInputReportControlInformation
  • DataWriteObject : Scenario3_ReadWrite
  • dataWriter : SocketReaderWriter
  • DataWriterObject : Scenario2_LEDTemp
  • Date : FileItem
  • dateAccessedProperty : Scenario6
  • DateCreated : Item , ItemViewModel
  • DateCreatedHourMinute : ItemViewModel
  • dateFormatInfo : AdventureWorksVoiceCommandService
  • ddspf : DDS_HEADER
  • Deactivate() : sealed
  • DebugLog() : sealed
  • DebugLogString() : sealed
  • DecaySlider_ValueChanged() : Scenario5_InboxEffects
  • Decline_Click() : sealed , Scenario2
  • DeclineSessionRequest() : sealed , AdvertisementWrapper
  • DecodeAsync() : DecodeEngine
  • DecodeEngine() : DecodeEngine
  • decodeEngine : Provider
  • decompressedData : ScenarioContext
  • DEFAULT_ACCOUNT_PROVIDER_ID : sealed
  • DEFAULT_CHANNEL_NAME : FileLoggingSessionScenario , LoggingSessionScenario
  • Default_Click() : Scenario1 , Scenario10 , Scenario2 , Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8 , Scenario9 , Scenario1_FindId
  • DEFAULT_DPI : DeviceResources
  • DEFAULT_SESSION_NAME : FileLoggingSessionScenario , LoggingSessionScenario
  • DEFAULT_TITLE : Scenario1
  • defaultAccount : DefaultAccountScenario
  • DefaultAccountScenario() : DefaultAccountScenario
  • DefaultAndCustomValidation_Checked() : Scenario15_ServerCertificateValidation
  • DefaultBlankOnProtectedContent : sealed
  • DefaultCloseCommand() : sealed , DefaultCloseCommand
  • DefaultCloseCommandButton_Click() : sealed , DefaultCloseCommand
  • defaultContextForCurrentView : sealed , Scenario7
  • defaultDwellTime : Scenario4_ForegroundGeofence
  • DefaultGlobalOpacityCoefficient : sealed
  • DefaultHologramCompositionEnabled : sealed
  • DefaultLoopBackGain : sealed
  • DefaultMicrophoneGain : sealed
  • defaultMode : LowLatency
  • DefaultOSValidation_Checked() : Scenario15_ServerCertificateValidation
  • DefaultOutputSize : sealed
  • DefaultPreferredHologramPerspective : sealed
  • defaultProvider : DefaultAccountScenario
  • DefaultProviderId : DefaultAccountScenario
  • DefaultRecordingIndicatorEnabled : sealed
  • DefaultShowHiddenMesh : sealed
  • DefaultVideoStabilizationBufferLength : sealed
  • DefaultVideoStabilizationEnabled : sealed
  • DefaultViewModel : MainPage , TripDetails , TripListView
  • defaultViewModel : MainPage , sealed , TripDetails , TripListView
  • Deferral : Scenario1_BackgroundTask
  • deferral : Provider , RfcommServerTask , IoSyncBackgroundTask
  • DeferredControlTemplatePart() : DeferredControlTemplatePart
  • DefineGlyphButton_Click() : sealed , Scenario5_DefiningCustomGlyphs
  • degreesPerSecond : SpinningCubeRenderer
  • DegreetoRadians() : Helpers
  • Deinitialize() : SdkSample
  • Delete_Click() : sealed , Scenario6_DeleteTPM
  • DeleteAllItems() : CBaseAttributes< TBase >
  • DeleteAllItems_Click() : sealed , S2_UpdateAndDeleteWithAPI , S6_DeleteWithAppContent
  • DeleteCompositeSetting_Click() : Scenario4_CompositeSettings
  • DeleteContainer_Click() : Scenario3_SettingContainer
  • DeleteCookie_Click() : Scenario11_DeleteCookie
  • DeleteFileButton_Click() : sealed , Scenario10
  • DeleteFunction() : S2_UpdateAndDeleteWithAPI
  • DeleteItem() : CBaseAttributes< TBase > , DetailsPage , Scenario3_MasterDetail , DetailsPage , Scenario3_MasterDetail
  • DeleteItems() : Scenario3_MasterDetail
  • DeleteItemsHelper() : sealed , S2_UpdateAndDeleteWithAPI
  • DeleteKeywords_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • DeleteMenuItem_Click() : sealed , Scenario1 , Scenario2 , Scenario3
  • DeleteMultipleItems_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • DeletePassportServerSide() : sealed , Content
  • deleteResult : Scenario1
  • DeleteSceneObjects() : SceneComposer
  • DeleteSchool_Click() : Scenario1_ParseAndStringify
  • DeleteSelectedAndUpdate() : SceneComposer
  • DeleteSelectedItem() : sealed , Scenario1_Basic
  • DeleteSelectedStrokes() : InkRenderer
  • DeleteSetting_Click() : Scenario2_Settings , Scenario3_SettingContainer , Scenario2_Settings , Scenario3_SettingContainer
  • DeleteSingleItem_Click() : sealed , S2_UpdateAndDeleteWithAPI , S6_DeleteWithAppContent
  • DeleteTestContacts() : Scenario1_CreateContacts
  • DeleteTrip() : sealed , TripViewModel , TripStore
  • DeleteTripAsync() : sealed
  • deleteTripCommand : sealed , TripViewModel
  • DeleteTripCommand : TripViewModel
  • DeliverSamples() : CMediaStream
  • DeltaTime() : GameTimer
  • deltaTransform : sealed , Scenario4 , ManipulationInputProcessor , Scenario5_InkingAndInteractionFeedback
  • DemonstrateLogging() : sealed , LoggingChannelScenario
  • Denied : sealed
  • DensityKilogramperCubicMetre : PresentationFormats
  • depth : DDS_HEADER
  • Depth : Dimensions
  • DepthBufferTexture2D : CameraResources
  • depthImage : GpuCoordinateMapper::RasterizedFrameBlob
  • depthIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • depthRangeMaximumInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • depthRangeMinimumInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • depthScaleInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • DepthStencilView : CameraResources
  • depthToSource : GpuCoordinateMapper::RasterizedFrameBlob
  • depthToTarget : GpuCoordinateMapper::RasterizedFrameBlob
  • depthUnprojectionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • Description : PresentationFormats , Trip , sealed , Scenario , Model
  • description : sealed , Trip
  • Description : PresentationFormats
  • DescriptionLocalizedResource_Click() : sealed , Scenario3_CustomItems
  • Descriptor_SelectChanged() : Scenario5_UsbDescriptors
  • DescriptorType : DescriptorTypeEntry
  • descriptorType : DescriptorTypeEntry
  • DescriptorTypeEntry() : DescriptorTypeEntry
  • DeselectRange() : FileDataSource2
  • DeserializeFromBlob() : CBaseAttributes< TBase >
  • DeserializeFromStream() : CBaseAttributes< TBase >
  • DeserializeXmlToAccountList() : AccountsHelper
  • DesfireCommand() : DesfireCommand
  • desfireCommand : AccessHandler
  • DesfireResponse() : DesfireResponse
  • desfireResponse : AccessHandler
  • DesiredLiveOffset : LiveSourceBufferManager , ILivePlayer , LiveDashPlayer
  • DesiredLiveOffsetButton_Click() : Scenario7_LiveSeekableRange
  • DesiredMaxBitrateList_SelectionChanged() : Scenario4_Tuning
  • DesiredMinBitrateList_SelectionChanged() : Scenario4_Tuning
  • DesiredReportInterval : Scenario1_DataEvents
  • desiredReportInterval : sealed , Scenario5_DataEventsBatching , Scenario1_DataEvents
  • desiredReportIntervalMs : sealed , Scenario1_DataEvents
  • desiredReportLatency : sealed , Scenario5_DataEventsBatching
  • DesiredSeekableWindowSizeButton_Click() : Scenario7_LiveSeekableRange
  • destination : sealed , TripVoiceCommand , Trip
  • Destination : Trip
  • destinationValidationError : sealed , TripViewModel
  • DestinationValidationError : TripViewModel
  • DestroyWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Detach() : sealed
  • DetailPage() : DetailPage
  • DetailPage_BackRequested() : DetailPage
  • DetailsPage() : DetailsPage
  • DetectCard() : IccDetection
  • DetectCardTypeAync() : IccDetection
  • determinedStartingSegmentIndex : LiveSourceBufferManager
  • DeterminePeriodStart() : DashManifestParser
  • DetermineStartingSegmentIndex() : LiveSourceBufferManager
  • Device : DeviceListEntry , EventHandlerForDevice
  • device : sealed , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , IoSyncBackgroundTask , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , LowLatency , VideoChat , SendTextMessage
  • Device_CaptureFailed() : LowLatency , VideoChat
  • Device_IncomingConnectionArrived() : LowLatency , VideoChat
  • deviceAccessChangedEventToken : sealed
  • deviceAccessEventHandler : EventHandlerForDevice
  • deviceAccessInfo : sealed
  • deviceAccessInformation : sealed , EventHandlerForDevice , Scenario1_DataEvents , Scenario2_Polling , EventHandlerForDevice , Scenario1_Events , EventHandlerForDevice
  • DeviceAccessInformation : EventHandlerForDevice
  • deviceAccountId : BroadbandDevice , GetConnectionProfiles , ShowConnection
  • deviceAddedEventHandler : EventHandlerForDevice
  • deviceAddedEventToken : sealed
  • DeviceAutoDetectToggle_Toggled() : Scenario1_MIDIDeviceEnumeration
  • DeviceChanged : sealed , DeviceWatcherHelper
  • deviceChanged : DeviceWatcherHelper
  • DeviceChangedHandler() : DeviceWatcherHelper
  • DeviceClassSelector : sealed , DeviceSelectorInfo
  • deviceCloseCallback : sealed , EventHandlerForDevice
  • DeviceClosing : DeviceList
  • DeviceConnect() : sealed , DeviceConnect , sealed , DeviceConnect
  • deviceConnectDevices_SelectionChanged() : sealed , DeviceConnect
  • deviceConnectedCallback : sealed , EventHandlerForDevice
  • deviceConnectStart_Click() : sealed , DeviceConnect
  • deviceConnectStop_Click() : sealed , DeviceConnect
  • DeviceEvent : MainPage
  • DeviceEvents() : sealed , DeviceEvents
  • deviceEventsBegin_Click() : sealed , DeviceEvents
  • deviceEventsCancel_Click() : sealed , DeviceEvents
  • deviceEventsGet_Click() : sealed , DeviceEvents
  • DeviceFamily : DeviceFamilyTrigger
  • DeviceId : BarcodeScannerInfo
  • deviceId : sealed , MainPage
  • DeviceInfo : DiscoveredDevice
  • deviceInfo : RfcommChatDeviceDisplay , sealed , MainPage , DiscoveredDevice , DiscoveredDeviceWrapper
  • DeviceInformation : BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , DeviceListEntry , EventHandlerForDevice , OnDeviceConnectedEventArgs , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , OnDeviceConnectedEventArgs , DeviceInformationDisplay , DeviceListEntry , EventHandlerForDevice , BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • deviceInformation : sealed , EventHandlerForDevice , OnDeviceConnectedEventArgs , EventHandlerForDevice , OnDeviceConnectedEventArgs , EventHandlerForDevice
  • deviceInformationCollection : MidiDeviceWatcher
  • DeviceInformationDisplay() : sealed , DeviceInformationDisplay
  • deviceInformationKind : sealed , Scenario5_GetSingleDevice
  • DeviceInformationKindChoice() : sealed , DeviceInformationKindChoice
  • DeviceInformationKinds : sealed , DeviceInformationKindChoice
  • deviceInputNode : Scenario2_DeviceCapture
  • DeviceInstanceId : DeviceProperties
  • DeviceInterfaceClass : SuperMutt
  • DeviceInterfaceGuid : Fx2Driver
  • DeviceIO() : sealed , DeviceIO
  • DeviceIOGet_Click() : sealed , DeviceIO
  • DeviceIOSet_Click() : sealed , DeviceIO
  • DeviceList() : DeviceList
  • DeviceListEntry() : sealed , DeviceListEntry
  • DeviceLost : DeviceResources
  • DeviceName : BarcodeScannerInfo , DAL::RegisteredUser , RegisterMessage
  • deviceOutput : Scenario1_FilePlayback
  • deviceOutputNode : Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects
  • DevicePickerSelectors() : DeviceSelectorChoices
  • DevicePid : OsrFx2 , SuperMutt
  • DeviceReadWrite() : sealed , DeviceReadWrite
  • deviceRemovedEventHandler : EventHandlerForDevice
  • deviceRemovedEventToken : sealed
  • DeviceResources() : DeviceResources
  • deviceResources : _360VideoPlaybackMain , AppView , VideoRenderer , HolographicApp1Main , AppView , HolographicTemplateAppMain , SpinningCubeRenderer , RectRenderer , LowLatencyInputMain , sealed
  • DeviceResources() : DeviceResources
  • DeviceRestored : DeviceResources
  • deviceSelected : BroadbandDevice
  • deviceSelector : sealed , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice
  • DeviceSelector : DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice
  • DeviceSelectorInfo() : sealed , DeviceSelectorInfo
  • DeviceState() : DeviceStateChangedEventArgs , DeviceStateSourceT< D >
  • DeviceStateChanged() : DeviceStateSourceT< D >
  • DeviceStateChangedEvent() : sealed
  • DeviceStateChangedEventArgs() : DeviceStateChangedEventArgs
  • deviceSyncDetails : IoSyncBackgroundTask
  • DeviceType : Fx2Driver
  • DeviceVid : OsrFx2 , SuperMutt
  • DeviceWatcher : DeviceWatcherHelper
  • deviceWatcher : Scenario1_Discovery , Scenario1_ChatClient , sealed , EventHandlerForDevice , DeviceWatcherHelper , MidiDeviceWatcher , EventHandlerForDevice
  • DeviceWatcher_Added() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_EnumerationCompleted() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_Removed() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_Stopped() : Scenario1_Discovery
  • DeviceWatcher_Updated() : Scenario1_Discovery , MidiDeviceWatcher
  • deviceWatcherAddedToken : Scenario1_Discovery
  • deviceWatcherEnumerationCompletedToken : Scenario1_Discovery
  • deviceWatcherHelper : sealed , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • DeviceWatcherHelper() : sealed , DeviceWatcherHelper
  • deviceWatcherHelpers : sealed , Scenario7_DeviceInformationKind
  • deviceWatcherRemovedToken : Scenario1_Discovery
  • deviceWatchers : sealed
  • DeviceWatcherSelectors() : DeviceSelectorChoices
  • deviceWatcherStoppedToken : Scenario1_Discovery
  • DeviceWatcherTaskName : Constants
  • deviceWatcherUpdatedToken : Scenario1_Discovery
  • DEVPKEY_AepContainer_Categories : RequiredDeviceProperties
  • DEVPKEY_AepContainer_FriendlyName : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportedUriSchemes : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsAudio : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsImages : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsVideo : RequiredDeviceProperties
  • DEVPKEY_Device_ContainerId : RequiredDeviceProperties
  • DEVPKEY_Device_InstanceId : RequiredDeviceProperties
  • DEVPKEY_DeviceContainer_Manufacturer : RequiredDeviceProperties
  • DEVPKEY_DeviceContainer_ModelName : RequiredDeviceProperties
  • DftEffect() : DftEffect
  • DftTransform() : DftTransform
  • DialLaunchArguments() : DialLaunchArguments
  • dictatedTextBuilder : sealed , Scenario_ContinuousDictation
  • dictationTextBox_TextChanged() : sealed , Scenario_ContinuousDictation
  • diffuseColor : ConstantBufferChangesEveryPrim
  • DigitToSevenSegment() : Fx2Driver
  • DirectManager : Employee , IEmployee , Manager
  • directXGestureRecognizer : sealed
  • DirectXPage() : sealed
  • DisableAdvancedCaptureAsync() : sealed , MainPage
  • DisableAllButtons() : HolographicMRCSampleMain
  • DisableButtons() : Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • DisableContentTransitions() : MasterDetailPage
  • DisableContentUI() : Scenario2 , Scenario3
  • Disabled : sealed
  • disableFollowCircle : Scenario8 , sealed
  • DisableNonSquarePARProfiles() : sealed , Scenario1_Default , Scenario3_Trim
  • DisableOptimizations : FxCompile
  • DisablePreviewPrintHelper() : DisablePreviewPrintHelper
  • DisambiguateTrips() : AdventureWorksVoiceCommandService , sealed
  • DiscardChanges_Click() : Scenario1_ConfigureMobileHotspot
  • DiscardQueuedFrames() : AudioEchoEffect
  • Disconnect() : abstract , Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , CNetworkChannel
  • disconnectButton_Click() : Scenario3
  • DisconnectButton_Click() : Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , sealed , Scenario4_Connect
  • DisconnectFromDevice_Click() : DeviceConnect , sealed , Scenario1_ConnectDisconnect
  • DisconnectObject() : CMediaBufferWrapper
  • discontinueStroke : sealed , Scenario8
  • Discover_Click() : sealed , Scenario3
  • DiscoverActiveDownloads() : sealed
  • DiscoverActiveDownloadsAsync() : Scenario1_Download , Scenario16_NetworkResource
  • DiscoverActiveUploads() : sealed
  • DiscoverActiveUploadsAsync() : Scenario2_Upload
  • DiscoveredDevice() : sealed , DiscoveredDevice
  • DiscoveredDevices : Scenario2_Connector , WiFiDirectServiceManager , Scenario2_Connector
  • discoveredDevices : WiFiDirectServiceManager
  • DiscoveredDeviceWrapper() : sealed , DiscoveredDeviceWrapper
  • DiscoverServicesAsync() : WiFiDirectServiceManager , sealed
  • dismissed : ExtendedSplash
  • Dismissed : MainPage
  • DismissedEventHandler() : ExtendedSplash
  • DismissPopup_Click() : sealed , CalibrationBar , sealed , CalibrationBar
  • DismissUI_Click() : Scenario13_ShareTarget , ShareTarget
  • dispatcher : ViewLifetimeControl
  • Dispatcher : ViewLifetimeControl
  • dispatcher : sealed , MediaListViewModel , PlaybackSessionViewModel , PlayerViewModel , sealed , ServiceViewModel , DeviceWatcherHelper , CachedFileUpdaterPage , FileOpenPicker_PickCachedFile , FileOpenPicker_PickURLFile , FileSavePicker_FailToSave , sealed , Scenario2 , RadioModel , FileDataSource , RadioModel , ViewLifetimeControl , FileOpenPicker_PickAppFile
  • dispatcherTimer : sealed , Scenario1 , Scenario2
  • DispatcherTimer_Tick() : Scenario1 , Scenario2 , sealed
  • DispatchOperation() : OpQueue< T, TOperation > , CMediaSource
  • DispatchProcessSample() : CStreamSink
  • Display() : sealed , Scenario1_LongAndShortFormats , Scenario2_StringTemplate , Scenario3_ParameterizedTemplate , Scenario4_Override , Scenario5_UnicodeExtensions , Scenario6_TimeZone , Functions , sealed
  • Display_Click() : Scenario1_LongAndShortFormats , Scenario2_StringTemplate , Scenario4_Override , Scenario5_UnicodeExtensions , Scenario6_TimeZone , sealed , Scenario1_PercentPermilleFormatting , Scenario3_CurrencyFormatting , Scenario4_NumberParsing , Scenario5_RoundingAndPadding , Scenario7_UsingUnicodeExtensions , Scenario1_PercentPermilleFormatting , Scenario2_DecimalFormatting , Scenario4_NumberParsing , Scenario5_RoundingAndPadding , Scenario6_NumeralSystemTranslation , Scenario7_UsingUnicodeExtensions , Scenario3_CurrencyFormatting , Scenario6_NumeralSystemTranslation , Scenario2_DecimalFormatting , sealed , Scenario3_ParameterizedTemplate
  • DisplayChangedFormats() : SampleState , MainPage
  • displayChangeToken : sealed
  • displayController : Scenario3_DisplayOnOff , sealed
  • DisplayCurrentItem() : sealed , S1_GetAFeed
  • DisplayCurrentReading() : Scenario3_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed
  • DisplayDeletedResults() : Scenario1
  • DisplayDeviceProperties() : Scenario1_MIDIDeviceEnumeration
  • DisplayError() : SdkSample
  • DisplayFeed() : S1_GetAFeed , sealed
  • DisplayFindItemsResult() : Scenario1
  • DisplayFormats() : OtherScenarios
  • DisplayImageFileAsync() : Scenario2
  • DisplayImageUIAsync() : Scenario1
  • DisplayImportedSummary() : Scenario1
  • displayInfo : sealed , Scenario1_Orientation
  • displayInformation : sealed , OcrCapturedImage , Scenario4_OrientationChanged , sealed
  • DisplayInformation_DpiChanged() : sealed
  • DisplayInformation_OrientationChanged() : CameraRotationHelper , sealed , MainPage
  • displayInformation_OrientationChanged() : Scenario4_OrientationChanged
  • DisplayInformation_OrientationChanged() : MainPage , sealed , OcrCapturedImage , sealed , MainPage , sealed , OcrCapturedImage
  • DisplayLink() : sealed , Scenario6_AppListingURI
  • displayList_listview_SelectionChanged() : Scenario3 , sealed
  • DisplayMetrics() : sealed , Scenario1_Metrics
  • DisplayMultipleCandidates() : sealed
  • DisplayName : DeviceInformationKindChoice , ProtectionLevelSelectorInfo , ConnectedDevice , DiscoveredDevice , DeviceInformationKindChoice
  • displayName : LampArrayInfo
  • DisplayName : DeviceSelectorInfo , sealed
  • displayName : UserViewModel
  • DisplayName() : ProtectionLevelSelectorInfo , ConnectedDevice
  • displayName : DeviceInformationKindChoice , LampArrayInfo , ProtectionLevelSelectorInfo
  • DisplayName : AdaptiveContentModel , FrameFormatModel , PointOfInterest , UserViewModel , FileItem , DiscoveredDevice , UserViewModel , FrameSourceGroupModel
  • displayName : sealed , ConnectedDevice
  • DisplayName : FrameSourceInfoModel , UserViewModel
  • DisplayNameLocalizedResource_Click() : Scenario3_CustomItems , sealed
  • DisplayNetworkIdentity() : Scenario16_NetworkResource
  • DisplayNetworkReport() : Scenario4_Connect , Scenario1_CachedNetworks , Scenario3_RegisterForUpdates , sealed , Scenario2_Scan , sealed
  • DisplayOrientation() : sealed , Scenario1_DataEvents , sealed , Scenario2_Polling
  • DisplayOutput() : Scenario1_Files , Scenario4_CompositeSettings , Scenario7_SetVersion , Scenario4_CompositeSettings , Scenario3_SettingContainer , Scenario2_Settings , Scenario1_Files , Scenario2_Settings , Scenario3_SettingContainer , Scenario7_SetVersion
  • DisplayProperties_DpiChanged() : Scenario1 , sealed , Scenario2
  • displayRequest : OcrCapturedImage , Scenario5_DisplayingBarcodePreview , sealed , OcrCapturedImage
  • DisplayResourceMapAsync() : CopyText
  • DisplayResult() : MainPage , Helpers , MainPage
  • DisplayRoundingAlgorithmAsString() : Scenario5_RoundingAndPadding , sealed
  • DisplaySizeClass() : sealed
  • displaySizeInches : STEREO_PARAMETERS
  • DisplaySourceProperties() : Scenario1
  • DisplayStatus() : PlaybackControl , SdkSample
  • DisplayString : LocalHostItem
  • DisplayTextButton_Click() : sealed , Scenario2_DisplayText , Scenario3_UsingWindows , sealed , Scenario6_ManipulatingCursorAttributes
  • DisplayTextResultAsync() : Helpers
  • DisplayTime : TextMessage
  • DisplayToast() : SampleState , MainPage , ConnectTask , MainPage , SampleSmsBackgroundTask
  • DisplayUserInformationAsync() : sealed , Scenario1_AddAccount
  • DisplayWatcherOutputFromCallback() : AccountWatcher
  • DisplayWebError() : Helpers
  • Dispose() : MediaListViewModel , Disposer , SourceGroupCollection , Provider , AppView , HolographicTemplateAppMain , PlayerViewModel , Scenario1_BackgroundTask , Scenario1_Download , StreamSocketListenerWrapper , AddAuthorizationHeaderFilter , _360VideoPlaybackMain , AppView , StreamSocketListenerWrapper , AdvertisementWrapper , FileDataSource2 , SocketWrapper , FileDataSource , SlowInputStream , SocketWrapper , WiFiDirectServiceManager , Scenario4_BulkPipes , Scenario1_Default , Provider , Disposer , Scenario2_LEDTemp , Scenario3_Trim , AdvertisementWrapper , HolographicApp1Main , Scenario2_Custom , WiFiDirectServiceManager , SessionWrapper , PlaybackSessionViewModel , Scenario2_Upload , DiscoveredDeviceWrapper , Scenario3_ReadWrite , IoSyncBackgroundTask , PlugInFilter , FileLoggingSessionScenario , ConnectedDevice , SocketReaderWriter , SessionWrapper , HttpJsonContent , LoggingSessionScenario , FileLoggingSessionScenario , Scenario12_DisableCookies
  • DisposeCollector : Disposer
  • DisposeConsumer() : Scenario2ViewModel , Scenario1ViewModel
  • disposed : MediaListViewModel , SessionWrapper , WiFiDirectServiceManager , DiscoveredDeviceWrapper , Provider , PlayerViewModel , PlaybackSessionViewModel , SocketWrapper , StreamSocketListenerWrapper , AdvertisementWrapper
  • DisposeDeviceAndContext() : DeviceResources
  • DisposeLamp() : sealed , Scenario3_AvailabilityChanged
  • DisposeMediaCapture() : sealed , Scenario2_FindAvailableSourceGroups
  • DisposeMediaPlayer_Click() : Scenario9_TransferMediaPlayer2
  • Disposer() : Disposer
  • DisposeWatcher() : Scenario1ViewModel , Scenario2ViewModel
  • Distance() : Scenario1
  • DistanceFieldRenderer() : DistanceFieldRenderer
  • DistanceFromCenter() : Scenario8 , sealed
  • Divide : Scenario3_ServerForeground
  • DmiRevision : RawSMBIOSData
  • DoBackgroundRequestAccess() : NfcUtils
  • DoBufferWork() : EdpBackgroundTask
  • DoCleanup() : sealed , CaptureDevice
  • DoConnect_Click() : Scenario3 , sealed
  • DoCreateDeviceDependentResources() : Button , ControlBase , Panel
  • Document : FileExtensions
  • document : DashManifestParser
  • Document() : FileExtensions
  • DocumentPresenter() : sealed
  • DoCurrencyRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoCustomDry() : SceneComposer
  • DoErase() : SceneComposer
  • DoesSecondaryTileExist() : ScenarioElement
  • DoFileWork() : EdpBackgroundTask
  • DoIncrementRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DOModel() : DOModel
  • done : Scenario1_Basic
  • DoPaddingAndRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoPaddingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoReleaseDeviceDependentResources() : Panel , ControlBase , Button
  • DoRender() : Panel , ControlBase , Button
  • DoScenario() : sealed , Scenario3 , Scenario1 , sealed , Scenario2 , Scenario3 , Scenario2 , sealed
  • DoScenarioAsync() : LoggingSessionScenario , sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , sealed
  • DoseEquivalentSievert : PresentationFormats
  • DoSend_Click() : Scenario5 , sealed
  • DoSetRate() : CMediaSource
  • DoSignificantDigitRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoSomething() : LoggingChannelScenario , sealed , LoggingChannelScenario
  • DoSomething_Click() : Scenario2_XmlWriter , Scenario3_XmlWriterLite , sealed
  • DoStart() : CMediaSource
  • DoStop() : CMediaSource
  • DoubleSpace_Click() : sealed
  • DoubleSpaceHalfLeading_Click() : sealed
  • DoUpdate() : Button , Panel , ControlBase
  • DoWin10Mode() : Scenario1 , sealed , Scenario1
  • DoWin81Mode() : sealed , Scenario1
  • download : DownloadOperationItem , Scenario6_RecoverableErrors , Scenario5_RandomAccess , sealed
  • DownloadAsync() : Scenario3_Notifications , sealed , Scenario7_DownloadReordering
  • DownloadBitrateChanged() : Scenario4_Tuning , Scenario2_EventHandlers
  • DownloadBufferAsync() : Downloader
  • downloadCancellationTokenSource : Scenario6_RecoverableErrors
  • downloadCollection : Scenario7_DownloadReordering
  • DownloadCompleted : sealed , Listener
  • DownloadContactDataAsync() : sealed , Scenario2_DelayMini
  • DownloadFailed() : Scenario3_RequestModification
  • DownloadOperationItem() : DownloadOperationItem , sealed
  • DownloadProgress() : Scenario1_Download , Scenario7_DownloadReordering , sealed
  • DownloadRequested() : Scenario3_RequestModification
  • downloadsCompleted : Scenario4_CompletionGroups
  • dpi : ReinhardEffect , LuminanceHeatmapEffect , FilmicEffect , RippleEffect , SdrOverlayEffect
  • DPI96 : PhotosPrintHelper , sealed
  • DPOnPage : OtherBindings , BasicTests
  • DPOnPageName : OtherBindings , sealed , BasicTests
  • DPOnPageProperty : BasicTests , OtherBindings
  • DragCompleted() : Scenario3_StartDragAsync , sealed
  • DrainBackBufferAsync() : sealed
  • Draw() : PhotoAdjustmentRenderer , sealed , SceneComposer , D2DSvgImageRenderer , final , D2DAdvancedColorImagesRenderer
  • DrawBoundingRect() : sealed , Scenario2
  • DrawCube() : RenderingHelper
  • drawer : Scenario2_CloseDrawer , sealed , Scenario1_OpenDrawer
  • drawer_AlarmExpired() : Scenario2_CloseDrawer , sealed
  • drawer_StatusUpdated() : Scenario2_CloseDrawer , sealed
  • DrawGlyphRun() : FontNameCollector , CustomTextRenderer
  • DrawInlineObject() : FontNameCollector , CustomTextRenderer
  • DrawLasso() : SceneComposer
  • DrawLineMetricsDecorations() : sealed
  • DrawSelectionRect() : InkRenderer
  • DrawStrikethrough() : FontNameCollector , CustomTextRenderer
  • DrawText() : sealed
  • DrawUnderline() : FontNameCollector , CustomTextRenderer
  • DropBorder_DragEnter() : Scenario3_StartDragAsync , sealed
  • DropBorder_Drop() : sealed , Scenario3_StartDragAsync
  • DropSamplesFromQueue() : CStreamSink
  • DropTime() : CMediaStream
  • DumpAccountDeviceInformation() : AccountWatcher
  • DumpAccountNetwork() : AccountWatcher
  • DumpPropertyData() : AccountWatcher
  • duration : Period
  • Duration() : Animate , MediaSegmentInformation , MediaSegment , TrackingEventCue , Animate
  • duration : MediaSegmentInformation
  • Duration : Period
  • durationOfRecordedSession : Scenario9 , sealed
  • dwFlagMasks : StspSampleHeader
  • dwFlags : StspSampleHeader
  • DWriteColorTextRendererMain() : DWriteColorTextRendererMain
  • DWriteColorTextRendererRenderer() : DWriteColorTextRendererRenderer
  • dwriteFactory : DeviceResources
  • DWriteFactory : DeviceResources
  • dwStreamFlags : MFSampleGenerator
  • dwStreamId : StspSampleHeader , StspStreamDescription
  • dwStreamIndex : MFSampleGenerator
  • DXFLOptionCombo_SelectionChanged() : sealed , Scenario13
  • dxgiAdapter : DeviceResources
  • DxgiAdapter : DeviceResources
  • dxgiFormat : CameraResources , DDS_HEADER_DXT10
  • dynamicTileId : MainPage
  • DynamicTileId : SampleHelpers
  • DynamicViscosityPascalSecond : PresentationFormats
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- e -

  • E_ACCESSDENIED : Scenario2_Client
  • E_BLUETOOTH_ATT_INVALID_PDU : Scenario2_Client
  • E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED : Scenario2_Client
  • E_BOUNDS : Provider
  • E_DEVICE_NOT_AVAILABLE : Scenario2_Client
  • E_INVALID_STATE : Helpers
  • E_INVALIDARG : Scenario1
  • E_NO_UNICODE_TRANSLATION : MainPage
  • E_WINHTTP_CANNOT_CONNECT : JsonRequest
  • E_WINHTTP_CONNECTION_ERROR : JsonRequest
  • E_WINHTTP_NAME_NOT_RESOLVED : JsonRequest
  • E_WINHTTP_TIMEOUT : JsonRequest
  • eAVEncH264VLevel : MediaFoundationConstants
  • echoBuffer : AudioEchoEffect
  • echoEffect : Scenario4_Submix
  • echoEffectDefinition : Scenario5_InboxEffects
  • EchoEffectToggle_Toggled() : Scenario4_Submix , Scenario5_InboxEffects
  • EchoMessage() : sealed , Scenario1
  • EchoSlider_ValueChanged() : Scenario5_InboxEffects
  • EdgeTappedListView() : EdgeTappedListView
  • EditContext_CompositionCompleted() : CustomEditControl
  • EditContext_CompositionStarted() : CustomEditControl
  • EditContext_FocusRemoved() : CustomEditControl
  • EditContext_FormatUpdating() : CustomEditControl
  • EditContext_LayoutRequested() : CustomEditControl
  • EditContext_SelectionRequested() : CustomEditControl
  • EditContext_SelectionUpdating() : CustomEditControl
  • EditContext_TextRequested() : CustomEditControl
  • EditContext_TextUpdating() : CustomEditControl
  • Education : User
  • educationKey : User
  • EffectOption() : sealed
  • EffectUpdateInterval : Scenario2_Effects
  • ElapsedSeconds : StepTimer
  • elapsedTicks : StepTimer
  • ElapsedTicks : StepTimer
  • ElectricchargeAmpereHours : PresentationFormats
  • ElectricChargeCoulomb : PresentationFormats
  • ElectricchargeDensityCoulombPerCubicMetre : PresentationFormats
  • ElectricConductanceSiemens : PresentationFormats
  • ElectricCurrentAmpere : PresentationFormats
  • ElectricfieldstrengthVoltPerMetre : PresentationFormats
  • ElectricFluxDensityCoulombPerSquareMetre : PresentationFormats
  • ElectricPotentialDifferenceVolt : PresentationFormats
  • ElectricResistanceOhm : PresentationFormats
  • element : sealed , ManipulationInputProcessor , sealed
  • Element_PointerCaptureLost() : EdgeTappedListView
  • Element_PointerExited() : EdgeTappedListView
  • Element_PointerPressed() : EdgeTappedListView
  • Element_PointerReleased() : EdgeTappedListView
  • Element_Unloaded() : CustomEditControl
  • ElementMargin() : ElementMargin
  • ElementNotFound : Scenario2_Manage , sealed
  • Ellipse() : Ellipse
  • Email : sealed , Account
  • EmailButton_Click() : sealed , Scenario_PauseAsync
  • emailConstraint : sealed , Scenario_PauseAsync
  • Emails : AdaptivePage
  • EmbeddedMFAsyncCallback() : EmbeddedMFAsyncCallback< Callback >
  • EmitHdrMetadata() : D2DAdvancedColorImagesRenderer
  • Employee() : Employee
  • EmployeeCollection() : EmployeeCollection
  • EmployeePropertyDP : DataModel
  • EmployeePropertyDPName : DataModel
  • EmployeePropertyDPProperty : DataModel
  • EmployeePropNoINPC : DataModel
  • EmployeePropWithINPC : DataModel
  • Employees : sealed , DataModel , ListsAndTemplates
  • EMPTY_TITLE : SecondaryViewPage
  • EmptyClipboardButton_Click() : OtherScenarios
  • EmptyTask() : sealed
  • EnableAdvancedCaptureAsync() : sealed , MainPage
  • EnableAsync() : sealed
  • EnableBarcodeScannerAsync() : Scenario2_MultipleScanners
  • enableButton : Print3D
  • EnableButtons() : sealed , Scenario1_TrimAndSaveClip , sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • EnableCashDrawer() : Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • EnableCharacteristicPanels() : Scenario2_Client
  • EnableClipboardContentChangedNotifications() : SampleState , MainPage
  • EnableContentTransitions() : Scenario3_MasterDetail , MasterDetailPage
  • EnableControls_Click() : sealed , Scenario2_Extend
  • EnableControlsInTitleBar() : sealed , CustomTitleBar
  • Enabled : LoggingScenarioEventArgs
  • enabled : sealed , FrameSourceState
  • EnableDebuggingInformation : FxCompile
  • EnableDisableLogging() : sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • EnableHelloPage() : EnableHelloPage
  • EnableIndependentInputEventHandlers() : sealed
  • EnableInkingEventHandlers() : sealed
  • EnableLoggingConfiguration() : InkEventLogger
  • EnableLoggingIndependentInputEventHandlers() : sealed
  • EnableLoggingStrokeEventHandlers() : sealed
  • EnableLoggingUnprocessedInputEventHandlers() : sealed
  • EnableNonSquarePARProfiles() : sealed , Scenario1_Default , Scenario3_Trim
  • EnablePackageOperationButtons() : Scenario1_Print
  • EnablePasteItemOnly() : sealed
  • EnablePlaybackControls() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • EnableUI() : sealed
  • EnableUnprocessedInputEventHandlers() : sealed
  • EnableWireframe() : SceneObject
  • Encoder : sealed
  • EncodingProperties : StreamResolution
  • end : sealed
  • EndCall() : sealed
  • EndCallAsync() : VideoChat
  • EndCallButton_Click() : sealed , VideoChat
  • EndCreateObject() : CSchemeHandler
  • endDate : sealed , Trip
  • EndDate : Trip
  • EndDraw() : DeviceResources , sealed
  • EndExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • EndGetEvent() : CMediaSource , CMediaStream , CStreamSink
  • EndOfStream : MFSampleGenerator
  • EndPosition() : List< T >
  • EndRound() : sealed , Scenario3_StartDragAsync
  • EndScenario_Click() : sealed
  • EndTask() : sealed
  • endTimeOfRecordedSession : sealed , Scenario9
  • EndTimerForFrame() : GpuPerformanceTimer
  • EnergyDensityJoulePerCubicMetre : PresentationFormats
  • EnergyGramcalorie : PresentationFormats
  • EnergyJoule : PresentationFormats
  • EnergyKilogramcalorie : PresentationFormats
  • EnergyKiloWattHour : PresentationFormats
  • ensure_close() : ensure_close
  • EnsureCachedLineMetrics() : sealed
  • EnsureCameraResources() : DeviceResources
  • EnsureMediaExtensionManager() : MainPage
  • EnteredKey : Scenario1ViewModel , Scenario2ViewModel
  • EntitiesCount : PoseTrackingFrameHeader
  • entityHeader : sealed
  • EntityId : PoseTrackingEntityData
  • entityIndex : sealed
  • EntityOffsets : PoseTrackingFrameHeader
  • entryName : DescriptorTypeEntry
  • EntryName : DescriptorTypeEntry
  • EntryPointName : FxCompile
  • entryTitle : DASHEntry
  • Enumerate_Click() : sealed , Scenario1
  • EnumerateAudioDevicesAsync() : sealed
  • EnumerateButton_Click() : Scenario1_Discovery
  • EnumerateMidiInputDevices() : Scenario1_MIDIDeviceEnumeration
  • EnumerateMidiOutputDevices() : Scenario1_MIDIDeviceEnumeration
  • EnumerateSecondaryTiles_Click() : Scenario3_EnumerateTiles
  • enumerationCompleted : MidiDeviceWatcher
  • EnvironmentComboBox_SelectionChanged() : sealed
  • eOperation : StspOperationHeader
  • Eq1Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq2Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq3Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq4Slider_ValueChanged() : Scenario5_InboxEffects
  • eqEffectDefinition : Scenario5_InboxEffects
  • EqToggle_Toggled() : Scenario5_InboxEffects
  • Equals() : PageDescription , DecodeResult
  • eraseAllClickedToken : sealed
  • Erasing : sealed
  • ErasingMode : sealed
  • ErasingModeCheckBox_Checked() : sealed , Scenario3
  • ErasingModeCheckBox_Unchecked() : Scenario3 , sealed
  • Error() : ScenarioElement
  • ERROR_INVALID_FUNCTION : FirmwareAccess
  • ERROR_SUCCESS : FirmwareAccess
  • ErrorReceivedEvent() : Scenario4_Events
  • ErrorReceivedEventHandler : Scenario4_Events
  • ErrorReceivedToggleSwitch_Toggled() : Scenario4_Events
  • Evaluate() : AnimateLinePosition , AnimateLineListPosition , AnimateCirclePosition , Animate
  • EvaluateAndReportConnectionCost() : Helpers
  • EvaluateConsentResult() : Scenario3_CheckUserConsentGroup
  • EvaluateCostAndConnectAsync() : Helpers
  • event : MFSampleGenerator , Metering
  • eventHandlerForDevice : EventHandlerForDevice
  • EventHandlerForDevice() : EventHandlerForDevice , sealed , EventHandlerForDevice
  • eventHandlerForDevice : EventHandlerForDevice
  • EventHandlerForDevice() : EventHandlerForDevice
  • eventHandlerForDevice : sealed
  • eventRegistrationToken : sealed
  • events : PipeOut , PipeIn
  • EventTests() : sealed , EventTests
  • eventToken : sealed
  • EvSlider_ValueChanged() : MainPage
  • EvStepCountToString() : MainPage
  • Execute() : RelayCommand
  • execute : RelayCommand
  • Execute() : sealed , RelayCommand
  • Execute_Click() : Scenario1_Conversion , sealed , Scenario3_ReverseConversion , Scenario2_Prediction , sealed
  • executeCallback : sealed
  • ExecuteJobAndReportResultAsync() : Scenario2_PrintReceipt , sealed
  • ExecuteQueryHelper() : S3_RetrieveWithAPI
  • ExifDateSubfolder_checked() : Scenario1
  • ExitButton() : ExitButton
  • ExpandDASHUrlSegmentTemplate() : DashManifestParser
  • ExpandLongRunningShareSection_Checked() : Scenario13_ShareTarget
  • ExpandLongRunningShareSection_Unchecked() : Scenario13_ShareTarget
  • expectedRpcCallbackRate : sealed , ServiceViewModel
  • ExpectedRpcCallbackRate : ServiceViewModel
  • Exponent : PresentationFormats
  • ExposureCoulombPerKilogram : PresentationFormats
  • ExtendedError() : DeviceStateChangedEventArgs , BackgroundAuthenticationCompletedEventArgs
  • ExtendedExecutionSessionRevoked() : SavingDataReason , sealed
  • ExtendedSplash() : ExtendedSplash
  • ExtendedSplash_OnResize() : ExtendedSplash
  • ExtendView_Click() : sealed , Scenario2_Extend
  • Extension : Scenario3_ReceiveFile
  • externalCamera : sealed , OcrCapturedImage
  • ExtractButton_Click() : OcrCapturedImage , OcrFileImage , OcrCapturedImage
  • ExtractButton_Tapped() : sealed
  • ExtractResponse() : ApduResponse
  • ExtractTextFromParagraph() : Scenario2
  • ExtractTlvDataObject() : ApduResponse
  • ExtraParameters : ConfigStore
  • Eye() : Camera
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- f -

  • FA_E_MAX_PERSISTED_ITEMS_REACHED : Scenario7
  • Face() : Face
  • FaceDetectionButton_Click() : sealed , MainPage
  • FaceDetectionEffect_FaceDetected() : sealed , MainPage
  • faceDetector : Scenario2_DetectInWebcam
  • FaceMesh() : FaceMesh
  • faceTracker : Scenario1_TrackInWebcam
  • FaceTrackerProcessor() : FaceTrackerProcessor
  • FactoryDefault : DefaultKeys
  • Fade_Completed() : Scenario3
  • FadeButton_Click() : Scenario2_Effects
  • FadeOutContents() : Scenario3
  • fadeOutStoryboard : Scenario3
  • fadeOutToken : Scenario3
  • Failed : sealed
  • falToken : sealed , SampleState , MainPage
  • FalToken() : SampleState
  • Family : RawSMBIOSSystemInfo
  • FarClipPlane() : Camera
  • FEATURE_NAME : FileOpenPickerPage , FileSavePickerPage , MainPage , CachedFileUpdaterPage
  • FeatureReports() : sealed , FeatureReports
  • fetchBatch() : FileDataSource
  • fetchData() : ItemCacheManager< T >
  • FetchData() : FileDataSource
  • fetchDataCallback : ItemCacheManager< T > , FileDataSource , FileDataSource2
  • fetchDataCallbackHandler() : ItemCacheManager< T >
  • FetchImageAsync() : FileItem
  • fetchSelectionDataCallback() : FileDataSource2
  • fgMaskMOG2 : sealed
  • file : sealed , Scenario1_Geotag
  • File : sealed , OmnidirectionalSound
  • File1_Click() : Scenario4_Submix
  • File2_Click() : Scenario4_Submix
  • File_Click() : Scenario1_FilePlayback , Scenario5_InboxEffects , Scenario6_CustomEffects
  • FILE_NAME : ScenarioElement
  • FileAdded : Status
  • FileAddFailed : Status
  • FileButton_Click() : Scenario2_DeviceCapture
  • FileDataSource() : FileDataSource
  • FileDataSource2() : FileDataSource2
  • FileDateSubfolder_checked() : Scenario1
  • FileGroupEmpty : Errors
  • FileGroupLocation : Errors
  • fileInput : Scenario1_FilePlayback
  • FileInput_FileCompleted() : Scenario6_CustomEffects
  • fileInputNode : Scenario5_InboxEffects , Scenario6_CustomEffects
  • fileInputNode1 : Scenario4_Submix
  • fileInputNode2 : Scenario4_Submix
  • FileIsCurrentButton_Click() : CachedFileUpdater_Local
  • FileLoggingSessionScenario() : sealed , FileLoggingSessionScenario
  • fileName : SampleState
  • Filename : FileItem
  • filename : Scenario1_Files , MainPage
  • FileName() : SampleState
  • fileNotFound404Hresult : Downloader
  • FileOpenPicker_PickAppFile() : FileOpenPicker_PickAppFile
  • FileOpenPicker_PickCachedFile() : FileOpenPicker_PickCachedFile
  • FileOpenPicker_PickURLFile() : FileOpenPicker_PickURLFile
  • FileOpenPickerPage() : FileOpenPickerPage
  • FileOpenPickerPage_SizeChanged() : FileOpenPickerPage
  • fileOpenPickerUI : FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , FileOpenPicker_PickURLFile , FileOpenPickerPage
  • fileOutputNode : Scenario2_DeviceCapture
  • fileOwnerProperty : Scenario6
  • FilePickerBt_Click() : Scenario4
  • FileRemoved : Status
  • FileSavePicker_FailToSave() : FileSavePicker_FailToSave
  • FileSavePicker_SaveToAppStorage() : FileSavePicker_SaveToAppStorage
  • FileSavePicker_SaveToCachedFile() : FileSavePicker_SaveToCachedFile
  • FileSavePickerPage() : FileSavePickerPage
  • FileSavePickerPage_SizeChanged() : FileSavePickerPage
  • FileSavePickerPageResized : FileSavePickerPage
  • fileSavePickerUI : FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePicker_SaveToCachedFile , FileSavePickerPage
  • FileSize : FileItem
  • fileToLaunch : Scenario1_LaunchFile
  • fileUpdateRequest : CachedFileUpdaterPage
  • fileUpdateRequestDeferral : CachedFileUpdaterPage
  • fillBrush : Scenario1_DetectInPhoto
  • FillComboBox() : sealed , Scenario3
  • FilledEllipse() : FilledEllipse
  • FilledRectangle() : FilledRectangle
  • fillerText : Conversation
  • FillEventListBoxWithExistingEvents() : Scenario8_VisitsBackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario5_GeofenceBackgroundTask
  • FillItemsFromSavedJson() : MainPage
  • FillSampleBuffer() : MFSampleGenerator , ToneSampleGenerator , MFSampleGenerator , ToneSampleGenerator
  • FillStreamDescription() : CMediaSink , CStreamSink
  • FillTextBox() : sealed , Scenario_SynthesizeSSML
  • FillTextBoxes() : sealed , Scenario_SynthesizeTextBoundaries
  • FilmicEffect() : FilmicEffect
  • filter : Scenario01_GetText , Scenario12_DisableCookies , Scenario15_ServerCertificateValidation
  • FinalizeCreateGameDeviceResources() : GameRenderer
  • FinalizeLoadLevel() : Simple3DGame
  • FinalizeLoadLevelResources() : GameRenderer
  • FinalizeRelease() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • Find_Click() : sealed , Scenario1 , Scenario2 , Scenario3
  • FindAllAsyncSelectors() : DeviceSelectorChoices
  • FindAndCancelExistingBackgroundTask() : sealed , Scenario1_DeviceUse
  • findAtCenterButton_Click() : sealed , Scenario8
  • FindBluetoothLEDeviceDisplay() : Scenario1_Discovery
  • FindButton_Click() : sealed , Scenario4_Snapshot
  • FindCameraDeviceByPanelAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • FindCertificateFromStoreAsync() : sealed , Scenario3_ClientAuthentication
  • FindClaimEnable_Click() : sealed
  • FindContentById() : MainPage
  • FindDevice() : DeviceList , sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • FindExisting() : TilesHelper
  • FindHitParagraph() : Scenario2
  • FindIdsInString() : Scenario1_FindId
  • FindInList() : DeviceList
  • findItems() : Scenario1
  • FindModelByUserId() : Scenario2_WatchUsers
  • FindParent() : ScenarioGroup
  • FindPrinter_Click() : sealed , Scenario1_FindClaimEnable
  • FindReceiptPrinter() : sealed
  • FindScenario() : IScenario , Scenario , ScenarioGroup
  • FindScrollViewer() : sealed , Scenario2 , Scenario3
  • FindSupportedFeedback() : MainPage
  • FindSyncTask() : Scenario7_SyncDevice
  • FindToolIndex() : HolographicPaintMain
  • FindUnknownDevices() : Scenario1_Discovery
  • FinishCaptureAsync() : WASAPICapture
  • FireIncomingConnection() : ISinkCallback , sealed , sealed::sealed
  • FireMapChanged() : EmployeeDictionary
  • FirmwareAccess() : sealed , FirmwareAccess
  • First() : sealed , RecognizedTextRun , sealed , GroupInfoList
  • firstAdapter : Scenario3_RegisterForUpdates , Scenario2_Scan , Scenario4_Connect
  • FirstAdapter_AvailableNetworksChanged() : Scenario3_RegisterForUpdates
  • FirstIndex : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • FirstName : Employee , IEmployee , Manager , Contact
  • firstName : Contact
  • FirstPage : PrintHelper
  • firstPage : PrintHelper
  • FirstPersonCamera() : sealed
  • firstVideoFile : sealed , Scenario2_AppendClips
  • FitImageToWindow() : D2DAdvancedColorImagesRenderer
  • Fix_Click() : sealed , Scenario3_FixAccount
  • FixTextureContentTypeAsync() : Scenario1_Print
  • FixWAVHeader() : WASAPICapture
  • FlaggedItems : Scenario1 , Scenario2
  • flags : DDS_PIXELFORMAT , DDS_HEADER , DDS_PIXELFORMAT , DDS_HEADER
  • FlashAutoRadioButton_Checked() : MainPage
  • FlashOffRadioButton_Checked() : MainPage
  • FlashOnRadioButton_Checked() : MainPage
  • Flavor : IBread , Bread , IBread
  • FlipPreview_Click() : Scenario5_DisplayingBarcodePreview
  • Flush() : CStreamSink , MFSampleGenerator , ToneSampleGenerator , CMediaStream
  • FlushAsync() : PipeOut
  • FlushDebugLog() : sealed
  • Flyout_Closed() : Scenario2_Conditional
  • Flyout_Opened() : Scenario2_Conditional
  • fnames : DataModel
  • focalLength : GpuCoordinateMapper::CameraIntrinsics
  • FocusableElement() : FocusableElement
  • FocusCamera() : MainPage
  • FocusLightCheckBox_CheckedChanged() : MainPage
  • focusPointColor : FocusPointConstantBuffer
  • focusPointDirection : FocusPointConstantBuffer
  • focusPointIntensity : FocusPointConstantBuffer
  • focusPointOrigin : FocusPointConstantBuffer
  • focusPointRadius : FocusPointConstantBuffer
  • FocusSlider_ValueChanged() : MainPage
  • FocusUpdate() : FocusableElement , Button
  • Folder : FileDataSource
  • followCircle : sealed , Scenario8
  • FollowCircleTest() : Scenario8 , sealed
  • FontDownloadListener() : sealed
  • FontDownloadListener_DownloadCompleted() : sealed
  • Footer_Click() : sealed , MainPage , FileOpenPickerPage , MainPage , TripListView , CachedFileUpdaterPage , MainPage , TripDetails , FileSavePickerPage , MainPage , sealed , MainPage , ShareTarget , MainPage
  • ForceEquirectangularSphericalVideoFrameFormat() : ContentSelector
  • forceManipulationsToEnd : sealed , Scenario4
  • ForceNewton : PresentationFormats
  • ForceReset_Click() : Scenario2
  • Format : FrameFormatModel
  • format : WICTranslate
  • Format : sealed
  • FormatComboBox_SelectionChanged() : sealed , Scenario2_FindAvailableSourceGroups
  • FormatDownloadedRanges() : Scenario5_RandomAccess , sealed
  • FormatError() : SdkSample
  • FormattedTitle : ItemDetails
  • FormatTimeString() : SeekBarElement
  • FormatValueByPresentation() : Scenario2_Client
  • forwardEvents : CaptureDevice
  • fourCC : DDS_PIXELFORMAT
  • FPS : sealed , Scenario9
  • Frame : NavigationHelper
  • frame : CameraStreamProcessor::FrameData
  • Frame : RootFrameNavigationHelper
  • frame : NavigationService
  • Frame : RootFrameNavigationHelper
  • frameArrivedEventToken : FrameSourceState
  • frameCount : StepTimer
  • FrameCount : StepTimer
  • FrameFormatModel() : FrameFormatModel , sealed
  • frameInputNode : Scenario3_FrameInput
  • frameNumber : CustomEffectState , GeneratedBitmapState
  • framePending : CameraResources
  • frameProcessingTimer : Scenario1_TrackInWebcam
  • FrameRate : StreamResolution , sealed
  • frameReader : Provider
  • FrameReader_FrameArrived() : Scenario1_DisplayDepthColorIR , sealed , Provider , sealed
  • FrameRenderer() : sealed , FrameRenderer
  • FrameRenderer::DrainBackBufferAsync() : FrameRenderer
  • FrameSessionBaseKeyProperty : SuspensionManager
  • FrameSessionStateKeyProperty : SuspensionManager
  • FrameSessionStateProperty : SuspensionManager
  • FrameSourceGroupModel() : FrameSourceGroupModel , sealed
  • FrameSourceGroups : SourceGroupCollection
  • FrameSourceInfoModel() : FrameSourceInfoModel , sealed
  • framesPerSecond : StepTimer
  • FramesPerSecond : StepTimer
  • FrameStepBackward_Click() : MPEUserControl
  • FrameStepForward_Click() : MPEUserControl
  • framesThisSecond : StepTimer
  • Frequency : ToneSampleGenerator::SineSampleInfo
  • frequency : RippleEffect
  • Frequency : DEVICEPROPS
  • FrequencyHertz : PresentationFormats
  • From : Email
  • FromIdAsync() : sealed
  • FromItem() : ItemViewModel
  • FromMFSample() : CBufferPacket
  • fromStorageFile() : FileItem
  • Front() : List< T >
  • FrontPosition() : List< T >
  • FulfillConsumableButton_Click() : Scenario3_UnmanagedConsumable , sealed , Scenario4_ConsumableProduct , sealed
  • fullContact : AppContactPanel
  • FullName() : Manager , Employee , Manager , IEmployee
  • FullText : ArticleViewModel
  • FunctionBase : Fx2Driver
  • Functions() : sealed , Functions
  • fVideo : MediaTypeValidationDescriptor
  • Fx2Devices : DeviceList
  • FxCompile() : FxCompile
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- g -

  • G : ColorBGRA
  • g : Print3D , Vector3< T > , Vector4< T > , Vector2< T >
  • GalleryGridView_ItemClick() : sealed , VideoGallery
  • GameActive() : Simple3DGame
  • GameCamera() : Simple3DGame
  • GameHud() : GameHud
  • GameInfoOverlay() : GameInfoOverlay
  • GameInfoOverlayLowerRight() : GameRenderer
  • GameInfoOverlayUpperLeft() : GameRenderer
  • GameInfoOverlayVisible() : GameRenderer
  • GameMain() : GameMain
  • GameObject() : GameObject
  • gamepad : BasicHologramMain::GamepadWithButtonState , HolographicTemplateAppMain::GamepadWithButtonState
  • gamepads : HolographicTemplateAppMain
  • GamepadWithButtonState()
: HolographicTemplateAppMain::GamepadWithButtonState
, BasicHologramMain::GamepadWithButtonState
  • GameRenderer() : GameRenderer
  • GameTimer() : GameTimer
  • GameUIControl() : GameRenderer
  • gattOperandParameters : Constants
  • gattOperatorParameters : Constants
  • gattResultParameters : Constants
  • GBitMask : DDS_PIXELFORMAT
  • GeneralAuthenticate() : GeneralAuthenticate
  • GeneralAuthenticateKeyType : GeneralAuthenticate
  • GeneralAuthenticateVersionNumber : GeneralAuthenticate
  • GenerateAudioData() : Scenario3_FrameInput
  • GenerateBiography() : Contact
  • GenerateCommandLineCommands() : FxCompile
  • GeneratedBitmapButton_Click() : Scenario2_Effects
  • GeneratedBitmapEffect_UpdateRequested() : Scenario2_Effects
  • GeneratedBitmapEffectFrameCount : Scenario2_Effects
  • GenerateDefaultSettings() : sealed , ManipulationInputProcessor
  • GenerateFirstName() : Contact
  • GenerateFullPathToTool() : FxCompile
  • GenerateGeofence() : Scenario4_ForegroundGeofence
  • GenerateImageSource() : Item
  • GenerateLastName() : Contact
  • GenerateMesh() : WaveEffect
  • GeneratePageAsync() : sealed , PhotosPrintHelper
  • GeneratePhoneNumber() : Contact
  • GeneratePosition() : Contact
  • GenerateRandomNumber_Click() : KeepConnectionOpenScenario , OpenCloseConnectionScenario , KeepConnectionOpenScenario , OpenCloseConnectionScenario
  • GenerateRandomNumber_Clicked() : Scenario3_LaunchAppServices
  • GenerateReportDescription() : GeofenceBackgroundTask
  • GenerateResponseFileCommands() : FxCompile
  • GenerateSampleBuffer() : ToneSampleGenerator
  • GenerateSamples() : ToneSampleGenerator::SineSampleInfo
  • GenerateSampleStream() : Scenario05_PostStream
  • GenerateSecondaryTile() : TilesHelper
  • GenerateSineSamples() : ToneSampleGenerator
  • GenerateSizePreferenceBinding() : Scenario1
  • GenerateTileId() : Scenario1_CreateTile
  • GenerateVisitDescription() : VisitBackgroundTask
  • generator : sealed , Scenario1_Conversion , Scenario2_Prediction , Scenario3_ReverseConversion
  • GeneratorIncrementalLoadingClass() : GeneratorIncrementalLoadingClass-g< T >
  • GenericFail : Scenario1_Render
  • GeofenceBackgroundTask() : GeofenceBackgroundTask
  • geofenceMonitor : Scenario4_ForegroundGeofence
  • geolocator : sealed
  • geometryShader : VideoRenderer , SpinningCubeRenderer
  • Geoposition : PlaceLocation
  • get() : unique_shared_work_queue , unique_cotaskmem_ptr< T >
  • get_Bread() : WrlFinal
  • get_Capacity() : CMediaBufferWrapper
  • get_DisplayMessage() : InvalidPageException
  • get_Flavor() : WrlFinal
  • get_Length() : CMediaBufferWrapper
  • get_Volume() : WrlFinal
  • GetAccounts() : sealed
  • GetActivationFactory() : WrlFinal
  • GetActivitySensorAsync() : sealed
  • GetAddress() : sealed
  • GetAidGroupById() : NfcUtils
  • GetAlbums() : MainViewModel
  • GetAll() : AzureDataProvider , ItemsDataProvider
  • GetAllAccounts() : MultipleAccountsScenario
  • getAllHistory : sealed , Scenario2_History
  • GetAllItems() : ItemsDataSource
  • GetAllJoynMessageArg() : TypeConversionHelpers
  • GetAllocatedBlob() : CBaseAttributes< TBase >
  • GetAllocatedString() : CBaseAttributes< TBase >
  • GetAllProviders() : MultipleAccountsScenario
  • GetAmplitude() : RippleEffect
  • GetAppLanguagesAsFormattedString() : sealed , Scenario8
  • GetApplicationLink() : SharePage
  • GetAppLocalSettingsValueAsBool() : sealed
  • GetAppLocalSettingsValueAsObject() : sealed
  • GetAppLocalSettingsValueAsString() : sealed
  • GetAssociatedProductsButton_Click() : sealed , Scenario2_InAppPurchase
  • GetAt() : sealed , GroupInfoList
  • GetAudioBuffer() : Player
  • GetAudioStream() : Period
  • GetAvgFrameTime() : GpuPerformanceTimer
  • GetBack() : List< T >
  • GetBackBufferDXGIFormat() : CameraResources
  • GetBackBufferRenderTargetView() : CameraResources , DeviceResources , CameraResources , DeviceResources , CameraResources
  • GetBackBufferRenderTargetViewRight() : DeviceResources
  • GetBackBufferTexture2D() : CameraResources
  • GetBackgroundTaskStatus() : BackgroundTaskSample
  • GetBehavior() : HttpMeteredConnectionFilter
  • GetBitrateSymbol() : BitrateHelper
  • GetBlendState() : CameraResources
  • GetBlob() : CBaseAttributes< TBase >
  • GetBlobSize() : CBaseAttributes< TBase >
  • GetBooleanInputReport_Click() : sealed , InputOutputReports
  • GetBooleanInputReportAsync() : sealed , InputOutputReports
  • GetBoolParameterWithDefault() : FxCompile
  • GetBoundingBox() : ControlBase , IControl
  • GetBuffer() : IMemoryBufferByteAccess , ApduCommand
  • GetBufferFramesPerPeriod() : WASAPIRenderer
  • GetBufferFromString() : MainPage , SampleState , MainPage
  • GetBufferLength() : ToneSampleGenerator
  • GetBuffersStatus_Click() : Scenario6
  • GetBusObject() : AllJoynBusObjectManager
  • GetButton_Click() : sealed , Scenario5_GetSingleDevice
  • GetBytes() : Scenario1
  • GetCallbackCount() : ServiceViewModel
  • GetCameraCaptureOrientation() : sealed , CameraRotationHelper
  • GetCameraOrientation() : MainPage , sealed , MainPage , sealed , MainPage , sealed
  • GetCameraOrientationRelativeToNativeOrientation() : sealed , CameraRotationHelper
  • GetCameraPreviewOrientation() : sealed , CameraRotationHelper
  • GetCameraToWorld() : sealed
  • GetCenter() : RippleEffect
  • GetCertificateInformation() : sealed , Scenario5
  • GetCharacteristics() : CMediaSink , CMediaSource
  • GetChrominanceTexture() : NV12VideoTexture
  • GetClientCertificateAsync() : sealed , Scenario3_ClientAuthentication
  • GetClustersForZoomLevel() : sealed , Scenario7
  • GetCO2Level() : sealed , Scenario2_Polling
  • GetCollections() : MainViewModel
  • GetColor() : Tool
  • getColor() : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • GetConfigurationDescriptorAsString() : Scenario5_UsbDescriptors
  • GetConnectionCostInfo() : GetConnectionProfiles
  • GetConnectionProfile() : GetConnectionProfiles
  • GetConnectionProfiles() : GetConnectionProfiles
  • GetConnectionProfilesButton_Click() : GetConnectionProfiles
  • GetConnectivityLevelAsString() : sealed
  • GetConsumableBalanceButton_Click() : sealed , Scenario3_UnmanagedConsumable , Scenario4_ConsumableProduct
  • GetContactListAsync() : Scenario1_CreateContact
  • GetContactResult() : MainPage
  • GetContacts() : Contact
  • GetContactsGrouped() : Contact
  • GetContent() : BadgeNumericNotificationContent
  • GetContentAsync() : Scenario6_NavToStream::StreamUriWinRTResolver
  • GetContentSize() : DeviceResources
  • GetContentZoomFactor() : DeviceResources
  • GetContext() : CMarker
  • GetCookies_Click() : Scenario09_GetCookie
  • GetCoordinateSystemForCurrentStage() : SpatialStageManager
  • GetCount() : CBaseAttributes< TBase > , List< T >
  • GetCriticalSection() : LowLatencyInputMain , GameMain
  • GetCurrent() : CBufferEnumerator
  • GetCurrentButton_Click() : sealed , Scenario3_CurrentStepCount
  • GetCurrentDeviceInfo() : BroadbandDevice
  • GetCurrentFormat() : VideoFrameProcessor
  • GetCurrentLength() : CMediaBufferWrapper
  • GetCurrentMediaType() : CStreamSink
  • GetCurrentMessage() : sealed
  • GetCurrentStrokesView() : sealed , Scenario9
  • GetCurrentTool() : SourceHandler
  • GetCurrentTransform() : CustomTextRenderer , FontNameCollector
  • GetCustomData() : sealed
  • GetCustomDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetCustomerCollectionsId() : sealed , Scenario7_B2B
  • GetCustomerFooter() : sealed , Scenario2_PrintReceipt
  • GetCustomerPurchaseId() : sealed , Scenario7_B2B
  • GetCustomProfile() : sealed , Scenario2_Custom
  • GetD2DDevice() : DeviceResources
  • GetD2DDeviceContext() : DeviceResources
  • GetD2DFactory() : DeviceResources
  • GetD2DTargetBitmap() : DeviceResources
  • GetD2DTargetBitmapRight() : DeviceResources
  • GetD3DDevice() : DeviceResources
  • GetD3DDeviceContext() : DeviceResources
  • GetD3DInteropDevice() : DeviceResources
  • GetData() : AudioFileReader , AudioStreamReader , TlvEntry , GetData , sealed , Scenario2_Polling , CSourceOperation , AudioFileReader
  • GetDataDataType : GetData
  • GetDataIn() : Check , Update
  • GetDataLabelString() : DataHelpers
  • GetDataModelForCurrentListViewFlyout() : sealed , Scenario2 , Scenario3
  • GetDataPlanStatusInfo() : GetConnectionProfiles
  • GetDataSoure() : FileDataSource , FileDataSource2
  • GetDataString() : DataHelpers
  • GetDefaultAsyncBtn_Click() : sealed , Scenario1_GetLamp
  • GetDefaultProvidersAndAccounts() : sealed
  • GetDefaultStrokeSize() : SceneComposer::InkObject
  • GetDependencies_Click() : sealed , Scenario3
  • GetDepthBufferTexture2D() : CameraResources
  • GetDepthStencilTexture2D() : CameraResources
  • GetDepthStencilView() : CameraResources , DeviceResources , CameraResources , DeviceResources
  • GetDeviceDescriptorAsString() : Scenario5_UsbDescriptors
  • GetDeviceFeatureLevel() : DeviceResources
  • GetDeviceInformationCollection() : MidiDeviceWatcher
  • GetDeviceResources() : _360VideoPlaybackMain
  • GetDeviceSpecificProperties() : sealed , Scenario2
  • GetDeviceStateEvent() : WASAPICapture , WASAPIRenderer
  • GetDeviceSupportsVprt() : DeviceResources
  • GetDeviceType() : Utilities
  • GetDiameter() : Tool
  • GetDictionaryTypeSignatures() : TypeConversionHelpers
  • GetDisplayNameOrGenericNameAsync() : Scenario2_WatchUsers
  • GetDisplaySizeInInches() : sealed
  • GetDouble() : CBaseAttributes< TBase >
  • GetDpi() : DeviceResources
  • GetDPI() : DeviceResources , SceneComposer
  • GetDropMode() : CMediaStream
  • GetDuration() : OmnidirectionalSound
  • GetDWriteFactory() : DeviceResources
  • GetDXGIAdapter() : DeviceResources
  • GetElapsedSeconds() : StepTimer
  • GetElapsedTicks() : StepTimer
  • GetElementLocation() : MainPage
  • GetElementMargin() : BaseElement
  • GetElementRect() : MainPage , Scenario1 , CustomEditControl , Scenario3_SecondaryTiles , SampleHelpers , MainPage
  • GetElementSize() : BaseElement
  • GetEndpointDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetEnumerator() : IncrementalLoadingBase , CBufferPacket , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2
  • GetEnvironment() : OmnidirectionalSound , CardioidSound , CustomDecaySound , OmnidirectionalSound
  • GetEvent() : CMediaSource , CMediaStream , CStreamSink
  • GetExecutionDeferral() : sealed , MultipleTasks
  • GetExtension() : BasicLoader
  • GetFacebookUserNameAsync() : Scenario1_Facebook
  • GetFeed_Click() : sealed , S1_GetAFeed
  • GetFileButton_Click() : sealed , Scenario11
  • GetFileFromFutureAccessListButton_Click() : sealed , Scenario5_TriggerCFU
  • GetFilesAndFoldersButton_Click() : sealed , Scenario1
  • GetFilesButton_Click() : sealed , Scenario3 , Scenario4 , Scenario3 , Scenario4
  • GetFileStatusStringAsync() : Scenario4
  • GetFileToLaunch() : Scenario1_LaunchFile
  • GetFirmwareEnvironmentVariable() : FirmwareAccess
  • GetFirstBarcodeScannerAsync() : DeviceHelpers
  • GetFirstCashDrawerAsync() : DeviceHelpers
  • GetFirstMagneticStripeReaderAsync() : DeviceHelpers
  • GetFirstRequestBlock() : ItemCacheManager< T >
  • GetFirstSmartCardReaderInfo() : SmartCardReaderUtils
  • GetFontNames() : FontNameCollector , sealed
  • GetFormat() : AudioFileReader , AudioStreamReader , AudioFileReader
  • GetFrameCount() : StepTimer
  • GetFramesPerSecond() : StepTimer
  • GetFrameTime() : GpuPerformanceTimer
  • GetFrequency() : RippleEffect
  • GetFriendlyName() : sealed , StreamResolution , Helpers
  • GetFromFile() : Scenario1_CreateTile
  • GetFromID() : AzureDataProvider , ItemsDataProvider
  • GetFromPackage() : Scenario1_CreateTile
  • GetFront() : List< T >
  • GetGeolocationButtonClicked() : Scenario2_GetPosition
  • GetGeometryShader() : DeviceResources
  • GetGeotagButton_Click() : sealed , Scenario1_Geotag
  • GetGroups_Click() : Scenario4_CharacterGrouping
  • GetGUID() : CBaseAttributes< TBase >
  • GetGyrometerSample() : sealed , Scenario3_Porting
  • GetHashCode() : DecodeResult
  • GetHistoricalBytes() : GetHistoricalBytes
  • GetHistory_Click() : sealed , Scenario2_History
  • GetHitTestState() : sealed
  • GetHolographicCamera() : CameraResources
  • GetId() : CMediaStream
  • GetIdentifier() : CStreamSink
  • GetIgnoreLayout() : BaseElement
  • GetImageInformationAsync() : Scenario2
  • GetImagePropertiesForDisplay() : Scenario1
  • GetImageSource() : DeviceResources
  • GetImageSourceNative() : DeviceResources
  • GetInitializationStatus() : OmnidirectionalSound
  • GetInkingSubstate() : sealed
  • GetInkStroke() : SceneComposer::InkObject
  • GetInputLayout() : DeviceResources
  • GetInstalledLocation_Click() : sealed , Scenario2
  • GetInterface() : InteropStatics::IDirect3DDxgiInterfaceAccess
  • GetInterfaceDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetInterfaceSetting() : Scenario6_InterfaceSettings
  • GetInterfaceSetting_Click() : Scenario6_InterfaceSettings
  • GetInternalBusAttachment() : AllJoynHelpers
  • GetInternalBusObject() : AllJoynHelpers
  • GetInterruptMessage : Fx2Driver
  • GetIsActive() : final
  • GetIsRenderPassNeeded() : BaseElement
  • GetIsUpperCaseEnabledAsync() : sealed , ISecureInterfaceService , SecureInterfaceService
  • GetIsVisible() : BaseElement
  • GetItem() : List< T > , CBaseAttributes< TBase > , ComPtrList< T, NULLABLE > , Scenario5_RestoreScrollPosition
  • GetItemById() : ItemsDataSource
  • GetItemByIndex() : CBaseAttributes< TBase >
  • GetItemIndex() : sealed
  • GetItemPos() : List< T >
  • GetItems() : Item
  • GetItemType() : CBaseAttributes< TBase >
  • GetKey() : Scenario5_RestoreScrollPosition
  • GetKnownAzureMediaServicesModels() : AdaptiveContentModel
  • GetLampArrayIndices() : Scenario2_Effects
  • GetLastActiveTime() : final
  • GetLastError() : FirmwareAccess
  • GetLastErrorAsync() : sealed , IOnboardingService , sealed , OnboardingService
  • GetLastErrorMessage() : CommonLicenseRequest
  • GetLastUpdateTime() : RealtimeSurfaceMeshRenderer , final
  • GetLastVisitButtonClicked() : Scenario6_GetLastVisit
  • GetLatestFaces() : FaceTrackerProcessor
  • GetLatestFrame() : CameraStreamProcessor , VideoFrameProcessor
  • GetLedBlinkPattern : SuperMutt::VendorCommand
  • GetLedBlinkPattern_Click() : sealed , FeatureReports
  • GetLedBlinkPatternAsync() : sealed , FeatureReports
  • GetLength() : HttpJsonContent
  • GetLicense() : ProactiveViewModel
  • GetLicenseState() : sealed , Scenario1_TrialMode
  • GetLineMetrics() : sealed
  • GetLog() : InkEventLogger
  • GetLogicalSize() : DeviceResources
  • GetLogoBackgroundColor() : sealed , ShareApplicationLink
  • GetLowestBitrateRepresentation() : DashManifestParser
  • GetLuminanceTexture() : NV12VideoTexture
  • GetMainViewId() : sealed
  • GetMajorType() : CStreamSink
  • GetManagedConsumablesButton_Click() : sealed , Scenario4_ConsumableProduct
  • GetManufacturerName_Click() : sealed , FirmwareAccess
  • GetManufacturerNameFromSmbios() : FirmwareAccess
  • GetMany() : GroupInfoList
  • GetMapCoordinates() : PlaceLocation
  • GetMapFromVariant() : TypeConversionHelpers
  • GetMarkerType() : CMarker
  • GetMarkerValue() : CMarker
  • GetMarshalSizeMax() : CMediaBufferWrapper
  • GetMaxFrameTime() : GpuPerformanceTimer
  • GetMediaPlayer() : sealed
  • GetMediaSink() : CStreamSink
  • GetMediaSource() : CMediaStream
  • GetMediaTypeByIndex() : CStreamSink
  • GetMediaTypeCount() : CStreamSink
  • GetMediaTypeFromFileContentType() : Scenario1
  • GetMediaTypeHandler() : CStreamSink
  • GetMemoryUsageText() : App
  • GetMerchantFooter() : sealed , Scenario2_PrintReceipt
  • GetMeteringData() : ServiceViewModel , Metering
  • GetMFExtensions() : sealed
  • GetMFSample() : WASAPIRenderer
  • GetMinFrameTime() : GpuPerformanceTimer
  • GetMouseProperties() : sealed , Scenario2
  • GetNetworkAuthenticationTypeAsString() : sealed
  • GetNetworkCost_Click() : Scenario2_NetworkCost
  • GetNetworkCostGuidance() : Helpers
  • GetNetworkEncryptionTypeAsString() : sealed
  • GetNetworkSecuritySettingsInfo() : GetConnectionProfiles
  • GetNewContact() : Contact
  • GetNewItem() : Item
  • GetNewSegmentIndexFromNewStream() : LiveSourceBufferManager
  • GetNextSegment() : LiveSourceBufferManager
  • GetNfcProvHeaderSize() : Scenario1
  • GetNonce() : Scenario2_Twitter
  • GetNormal() : QuadRenderer
  • GetNumericInputReport_Click() : sealed , InputOutputReports
  • GetNumericInputReportAsync() : sealed , InputOutputReports
  • GetObjectPath() : AllJoynHelpers
  • GetOnboardeeNetworkListAsync() : Scenario2ViewModel
  • GetOnboardingConfiguration() : Scenario2ViewModel
  • GetOpenWithPosition() : Scenario1_LaunchFile
  • GetOperationType() : CSourceOperation
  • GetOrientationReport() : Scenario1_Basics
  • GetOrientationTransform2D() : DeviceResources
  • GetOrientationTransform3D() : DeviceResources
  • GetOrRegisterHceBackgroundTask() : NfcUtils
  • GetOsrFx2SevenSegmentAsync() : Scenario2_ControlTransfer
  • GetOsrFx2SevenSegmentSetting_Click() : Scenario2_ControlTransfer
  • GetOtherDisplayRegion() : Scenario2_DisplayRegion
  • GetOutputSize() : DeviceResources
  • GetOutputWaveFormatEx() : MediaReader
  • GetPackage_Click() : sealed , Scenario1
  • GetParameters() : AsyncCallback< T > , EmbeddedMFAsyncCallback< Callback >
  • GetParent_Click() : sealed , Scenario2
  • GetPartialStroke() : Scenario9 , sealed
  • GetPassportAuthenticationMessageAsync() : sealed , SignIn
  • GetPasswordCredentialFromUserAsync() : Scenario9_CustomPairDevice , sealed , Scenario9_CustomPairDevice
  • GetPathToScenario() : ScenarioGroup
  • GetPathToScenarioHelper() : ScenarioGroup
  • GetPenProperties() : sealed , Scenario2
  • GetPerformanceFrequency() : StepTimer
  • GetPhase() : RippleEffect
  • GetPicturesLibrary() : sealed , Scenario3
  • GetPinFromUserAsync() : Scenario9_CustomPairDevice , sealed , Scenario9_CustomPairDevice
  • GetPinValue_Click() : sealed , Scenario1_GetAndSetPin
  • GetPixelShader() : DeviceResources
  • GetPixelsPerDip() : CustomTextRenderer , FontNameCollector
  • GetPlaceHolderImage() : MainPage
  • GetPlaybackPosition() : Scenario7_LiveSeekableRange
  • GetPointerProperties() : sealed , Scenario2
  • GetPointerToPixelData() : sealed
  • GetPoses() : sealed
  • GetPosition() : SpinningCubeRenderer , SourceHandler , SpinningCubeRenderer , ControlBase , IControl , QuadRenderer , SpinningCubeRenderer , QuadRenderer
  • GetPresentationClock() : CMediaSink
  • GetPresentationDescriptor() : CStartOperation
  • GetPresetProfile() : Scenario1_Default , sealed , Scenario3_Trim
  • GetPreviewFrameAsD3DSurfaceAsync() : sealed , MainPage
  • GetPreviewFrameAsSoftwareBitmapAsync() : MainPage , sealed
  • GetPreviewFrameButton_Click() : sealed , MainPage
  • GetPreviewStreamRectInControl() : MainPage , sealed
  • GetPrintPreviewPage() : PrintHelper , PhotosPrintHelper , sealed , PrintHelper
  • GetProductName() : Scenario5_UsbDescriptors
  • GetPropertyDisplayValue() : Scenario3 , sealed
  • GetPropertyForDisplay() : DeviceInformationDisplay , sealed
  • GetProvider() : MultipleAccountsScenario , SingleAccountScenario
  • GetProviders() : sealed
  • GetProvidersAndAccounts() : sealed
  • GetProvisioningInfo_Click() : sealed , Scenario3
  • GetProvisioningInfoAsync() : sealed , DiscoveredDeviceWrapper
  • GetPtrAt() : BufferHelper
  • GetPublicKey() : SubjectPublicKeyInfo
  • GetPublicKeyForUser() : DAL
  • GetPublisherCert() : SecureStopViewModel
  • GetQualityLevel() : CMediaStream
  • GetQueryDelegate() : S7_RetrieveWithAppContent
  • GetRadialControllerMenuItemFromSender() : sealed , Scenario1_EventAndMenuHookup
  • GetRandomVideo() : AzureDataProvider , ItemsDataProvider
  • GetRate() : CMediaSource , CSetRateOperation
  • GetRatio() : CBaseAttributes< TBase >
  • GetRemoteIdForContactAsync() : AppContactPanel
  • GetRenderCount() : DistanceFieldRenderer
  • GetRenderTargetSize() : CameraResources , DeviceResources , CameraResources , DeviceResources , CameraResources
  • GetResourceString() : sealed
  • GetResourceStringAndFormat() : sealed
  • GetResultAsync() : sealed
  • GetRetriesValue() : HttpRetryFilter
  • GetRotation() : ControlBase , IControl
  • GetSampleData() : sealed , SampleDataModel , Scenario1_ListView , sealed
  • GetSampler() : TextRenderer
  • GetScale() : ControlBase , IControl
  • GetScanInfoAsync() : sealed , OnboardingService , IOnboardingService
  • GetScenarioIdForLaunch() : MainPage
  • GetSceneSelectionRect() : SceneComposer
  • GetScreenViewport() : DeviceResources
  • GetSecureBootEnabledFromUefi() : FirmwareAccess
  • GetSelectedCeremonies() : sealed , Scenario9_CustomPairDevice
  • GetSelectedDevice() : DeviceList
  • GetSelectedDeviceId() : DeviceList
  • GetSelectedFeedbackOrFallback() : Scenario3_InkingFeedback , Scenario4_InteractionFeedback
  • GetSelectedItemTag< T >() : Helpers
  • GetSelectedPeriod() : Manifest
  • GetSelectedRanges() : FileDataSource2
  • GetSelectedStrokes() : InkRenderer
  • GetSelectedStrokeSize() : SceneComposer::InkObject
  • GetSelectionRectangle() : InkRenderer
  • GetService() : CMediaStream , CMediaSource
  • GetSevenSegmentDisplay : Fx2Driver
  • getShape() : SceneComposer::ShapeObject
  • GetShareContent() : sealed , SetErrorMessage , ShareCustomData , ShareHtml , SharePage , ShareWebLink , ShareText , ShareImage , ShareFiles , sealed , ShareApplicationLink , sealed , SharePage , sealed , ShareDelayRenderedFiles , ShareCustomProvider
  • GetSignature() : Scenario2_Twitter
  • GetSize() : AudioStreamReader , CBaseAttributes< TBase > , AudioFileReader , sealed::sealed , AudioFileReader
  • GetSkewX() : WaveEffect
  • GetSkewY() : WaveEffect
  • GetSliderPositionAtPlaybackPosition() : Scenario7_LiveSeekableRange
  • GetSmartCard() : MainPage
  • GetSnappedPoint() : Scenario5_InkingAndInteractionFeedback
  • GetSocket() : CNetworkChannel
  • GetSourceHandler() : HolographicPaintMain
  • GetSourceKind() : SourceHandler
  • GetSpread() : RippleEffect
  • GetStartingSegmentIndexForLive() : MediaStream
  • GetStartTime() : CMediaSink
  • GetState() : sealed , CMediaStream
  • GetStateAsync() : IOnboardingService , sealed , OnboardingService , sealed
  • GetStatus() : PropertySetContext , PropertyGetContext< T > , PropertySetContext
  • GetStepsHelperControl() : StepsControl
  • GetStereoState() : DeviceResources
  • GetStreamById() : CMediaSource
  • GetStreamDescriptor() : CMediaStream
  • GetStreamSinkById() : CMediaSink
  • GetStreamSinkByIndex() : CMediaSink
  • GetStreamSinkCount() : CMediaSink
  • GetStreamStatus_Click() : Scenario7
  • GetString() : CBaseAttributes< TBase >
  • GetStringFromBuffer() : MainPage , SampleState , MainPage
  • GetStringLength() : CBaseAttributes< TBase >
  • GetStrokeContainer() : InkRenderer
  • GetStrokeContainerForTemp() : InkRenderer
  • getStrokes() : SceneComposer::InkObject
  • GetStrokeThickness() : Rectangle
  • GetSubtypeForFrameReader() : sealed
  • GetSuperMuttLedBlinkPattern_Click() : Scenario2_ControlTransfer
  • GetSuperMuttLedBlinkPatternAsync() : Scenario2_ControlTransfer
  • GetSwapChain() : DeviceResources
  • GetSwapChainPanel() : DeviceResources
  • GetSwitch() : Button
  • GetSystemTimeAsFileTime() : ServiceViewModel
  • GetTargetAspectRatio() : CameraCoordinateMapper
  • GetTargetShaderResourceView() : CameraCoordinateMapper
  • GetTaskGroup() : BackgroundTaskSample
  • GetTextboxSelectionRect() : Scenario2
  • GetTextLayoutLineMetrics() : sealed
  • GetTexture() : TextRenderer , DistanceFieldRenderer , NV12VideoTexture , DeviceResources , TextRenderer
  • GetThumbnailButton_Click() : sealed , Scenario4 , Scenario3 , sealed , Scenario1 , Scenario4 , sealed , Scenario2 , Scenario5 , sealed , Scenario5 , Scenario1
  • GetTicks() : StepTimer
  • GetTime() : sealed , Functions
  • GetTimeStamp() : Scenario2_Twitter , LoggingSessionScenario , FileLoggingSessionScenario
  • GetTimeStampedMessage() : PlaybackControl
  • GetTimeStr() : sealed
  • gettingFileProperties : FileItem
  • GetTitleHeightInDips() : SampleOverlay
  • GetTokenFromAzureOAuthAsync() : sealed , Scenario7_B2B
  • GetTokenSilent() : DefaultAccountScenario
  • GetToneSample() : WASAPIRenderer
  • GetToolPosition() : SourceHandler
  • GetToolScale() : SourceHandler , SpatialControllerHandler
  • GetTotalLength() : CBufferPacket
  • GetTotalSeconds() : StepTimer
  • GetTotalTicks() : StepTimer
  • GetTouchProperties() : Scenario2 , sealed
  • GetTwitterRequestTokenAsync() : Scenario2_Twitter
  • GetTwitterUserNameAsync() : Scenario2_Twitter
  • getType()
: SceneComposer::InkObject
, SceneComposer::ShapeObject
, SceneComposer::SceneObject
  • GetUid() : GetUid
  • GetUidAsync() : AccessHandler
  • GetUINT32() : CBaseAttributes< TBase >
  • GetUINT64() : CBaseAttributes< TBase >
  • GetUIOrientation() : CameraRotationHelper , sealed
  • GetUnknown() : CBaseAttributes< TBase >
  • GetUnmanagedConsumablesButton_Click() : Scenario3_UnmanagedConsumable , sealed
  • GetUnmarshalClass() : CMediaBufferWrapper
  • GetUpdateRects() : DeviceResources
  • GetUserCollectionButton_Click() : sealed , Scenario5_UserCollection
  • GetUserConfirmationAsync() : Scenario9_CustomPairDevice , sealed
  • GetUserViewModelsAsync() : MainPage
  • GetValue() : PropertyGetContext< T > , LookupTable< T, LookupTableSize > , PropertyGetContext< T >
  • GetValueFromVariant() : TypeConversionHelpers
  • GetValueWithDefault< T >() : ConfigStore
  • GetVariantArg() : TypeConversionHelpers
  • GetVariantStructureArg() : TypeConversionHelpers
  • GetVelocity() : QuadRenderer , SpinningCubeRenderer
  • GetVersionAsync() : IOnboardingService , sealed , OnboardingService
  • GetVertexShader() : DeviceResources
  • GetVideoBuffer() : Player
  • GetVideoProfileSupportedDeviceIdAsync() : sealed , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile , sealed , Scenario3_EnableHdrProfile
  • GetVideoStream() : Period
  • GetView() : GroupInfoList
  • GetViewport() : CameraResources
  • GetViewSize() : DeviceResources
  • GetWallClockTime() : DashManifestParser
  • GetWaveOffset() : WaveEffect
  • GetWebAccount() : SingleAccountScenario
  • GetWicImagingFactory() : DeviceResources
  • GetWindow() : DeviceResources
  • GetWlanConnectionProfileDetailsInfo() : GetConnectionProfiles
  • GetWorldToCamera() : sealed
  • GetWriter() : sealed
  • GetWwanConnectionProfileDetailsInfo() : GetConnectionProfiles
  • GiftDispatch() : GiftDispatch
  • glbName : Scenario1_CreateTile
  • glbUri : Scenario1_CreateTile
  • globalMutex : sealed
  • GlobeString : Scenario4_CharacterGrouping
  • Glyph : TabHeader
  • GlyphBitmapImage() : BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , DeviceInformationDisplay , BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • glyphBuffer : sealed , Scenario5_DefiningCustomGlyphs
  • GlyphProperty : TabHeader
  • Go_Click() : Scenario2_ScriptDetection , Scenario3_Transliteration , Scenario1_LanguageDetection , Scenario3_Transliteration , Scenario2_ScriptDetection , Scenario1_LanguageDetection
  • GoBack() : NavigationService , INavigationService
  • goBack() : MainPage
  • GoButton_Click() : Scenario1_NavToUrl
  • GoToLive() : ILivePlayer , LiveDashPlayer
  • GoToLive_Click() : Scenario7_LiveSeekableRange
  • GoToLiveEdge() : Player , LiveSourceBufferManager
  • GoToMain_Click() : SecondaryViewPage
  • GoToScenario() : MainPage
  • GoToStart_Click() : Scenario7_LiveSeekableRange
  • gotToLiveButton_Click() : LiveDashPlayer
  • GpuCoordinateMapper() : GpuCoordinateMapper
  • GpuPerformanceTimer() : GpuPerformanceTimer
  • graph : Scenario1_FilePlayback , Scenario5_InboxEffects , Scenario3_FrameInput , Scenario2_DeviceCapture , Scenario4_Submix , Scenario6_CustomEffects
  • Graph_Click() : Scenario1_FilePlayback , Scenario6_CustomEffects , Scenario5_InboxEffects
  • Graph_UnrecoverableErrorOccurred() : Scenario2_DeviceCapture
  • GraphButton_Click() : Scenario4_Submix
  • GreenButton_Click() : sealed
  • Grid1_ContainerContentChanging() : Scenario1 , Scenario2
  • gridSize : Scenario5_InkingAndInteractionFeedback
  • group : sealed , GroupedBackgroundTask
  • GROUP_1 : ScenarioElement
  • GROUP_2 : ScenarioElement
  • GroupByHelper() : sealed
  • GroupByHelperAsync() : Scenario2
  • GroupByMonthButton_Click() : sealed , Scenario2
  • GroupByRatingButton_Click() : Scenario2 , sealed , Scenario2
  • GroupByTagButton_Click() : Scenario2 , sealed , Scenario2
  • GroupComboBox_SelectionChanged() : sealed , Scenario2_FindAvailableSourceGroups
  • GroupedBackgroundTask() : sealed , GroupedBackgroundTask
  • GroupedBackgroundTaskName : BackgroundTaskSample
  • GroupedBackgroundTaskProgress : BackgroundTaskSample
  • GroupedBackgroundTaskRegistered : BackgroundTaskSample
  • groupId : Print3D
  • GroupInfoList() : GroupInfoList
  • GroupNameLocalizedResource_Click() : sealed , Scenario3_CustomItems
  • groups : Scenario4_CharacterGrouping
  • Groups : Scenario4_CharacterGrouping
  • GUIDCustomSensorDeviceVendorDefinedTypeID : Scenario1_DataEvents , Scenario2_Polling
  • guidCustomSystemEventId_OsrUsbFx2 : CustomTrigger
  • guidKey : AttributeValidationDescriptor
  • guidSubtype : MediaTypeValidationDescriptor
  • guiMajorType : StspStreamDescription
  • guiSubType : StspStreamDescription
  • gyrometer : sealed
  • gyrometerWindows : sealed , Scenario3_Porting
  • gyrometerWP : sealed , Scenario3_Porting
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- h -

  • HandHandler() : HandHandler
  • Handle : RawSMBIOSTable
  • HandleCard() : CardReader
  • HandleCardAdded() : sealed , Scenario1_ProvisionTPM
  • HandleCardRemoved() : Scenario6_DeleteTPM , sealed
  • HandleClipboardChanged() : SampleState , MainPage
  • HandleConnectionRequestAsync() : Scenario1_Advertiser
  • HandleDeviceLost() : DeviceResources
  • HandleDeviceRestored() : GameMain
  • HandleDownloadAsync() : sealed , Scenario1_Download , Scenario6_RecoverableErrors , Scenario16_NetworkResource
  • HandleError() : CMediaSink , CMediaSource , CMediaStream , CStreamSink , sealed
  • HandleFollowCircleInput() : sealed , Scenario8
  • HandleHceActivation() : sealed
  • HandleIoException() : MainPage
  • HandleManifestReload() : LiveSourceBufferManager
  • HandlePlaybackListChanges() : PlayerViewModel
  • HandleProtocolLaunch() : SecondaryViewPage
  • HandleReceivedMessage() : SocketWrapper
  • HandleRecognitionResult() : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • HandleRegularInput() : Scenario8 , sealed
  • HandleUploadAsync() : sealed , Scenario2_Upload
  • Handshake : DeviceConfiguration
  • HandShakeComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • HapticCanvas_Entered() : Scenario3_InkingFeedback
  • HapticCanvas_Exited() : Scenario3_InkingFeedback
  • hapticsController : Scenario2_SupportedTactileFeedback , Scenario3_InkingFeedback , Scenario4_InteractionFeedback , Scenario5_InkingAndInteractionFeedback
  • HardwareButtons_CameraPress() : sealed
  • HardwareButtons_CameraPressed() : MainPage , sealed , MainPage , sealed , MainPage , sealed , Scenario1_Basics
  • HardwareDRMViewModel() : HardwareDRMViewModel
  • HardwareMajorVersion : CardDetails
  • HardwareMinorVersion : CardDetails
  • HardwareProtocolType : CardDetails
  • HardwareStorageSize : CardDetails
  • HardwareSubType : CardDetails
  • HardwareType : CardDetails
  • HardwareVendorID : CardDetails
  • HasAccountStored() : SingleAccountScenario
  • hasAlwaysAllowedAccess : Scenario1_Basics
  • hasCameraButton : Scenario1_Basics
  • hasHardwareDRM : PlayReadyInfoViewModel
  • HasHardwareDRM : PlayReadyInfoViewModel
  • hasHEVCSupport : PlayReadyInfoViewModel
  • HasHEVCSupport : PlayReadyInfoViewModel
  • hasLiveOffsetValue : Player
  • HasLiveOffsetValue : Player
  • hasMinimumUpdatePeriod : Manifest
  • HasMinimumUpdatePeriod : Manifest
  • HasMoreItems : IncrementalLoadingBase , Conversation
  • HasMoreItemsOverride() : GeneratorIncrementalLoadingClass-g< T > , IncrementalLoadingBase
  • hasMultiplePeriods : Manifest
  • HasMultiplePeriods : Manifest
  • hasOrientationWithOptimizationGoal : Scenario1_Basics
  • hasPeriodStartAttribute : DashManifestParser
  • hasPresentationDuration : Manifest
  • HasPresentationDuration : Manifest
  • HasRangesChanged() : ItemCacheManager< T >
  • HasRegisteredBackgroundTaskHandler : ScenarioCommon
  • HasSameFormat() : sealed , FrameFormatModel
  • HasSelection() : CustomEditControl
  • HasStrokesToErase() : InkRenderer
  • HasSurface() : RealtimeSurfaceMeshRenderer
  • HasValue : SourceHandler::PositionInformation
  • haveSetLiveOffset : LiveDashPlayer
  • haveSetSource : LiveDashPlayer
  • HdcpDesiredMinimumProtection_Click() : Scenario3_RequestModification
  • hdcpSession : Scenario3_RequestModification
  • Header : TitledImage
  • HeaderChanged() : TitledImage
  • HeaderFileOutput : FxCompile
  • HeaderProperty : TitledImage
  • Headers : HttpJsonContent
  • headers : HttpJsonContent
  • heading : PlaybackPage
  • Headline : ArticleViewModel
  • HeatCapacityJoulePerKelvin : PresentationFormats
  • HeatFluxDensityWattPerSquareMetre : PresentationFormats
  • height : DDS_HEADER
  • Height : StreamResolution , Dimensions , sealed
  • HeightSlider_ValueChanged() : sealed
  • HeroArticlesViewModel() : HeroArticlesViewModel
  • HexDump() : sealed , ReadBytes
  • HexStringToBytes() : NfcUtils
  • HiddenFrame : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • HiddenVideo : LowLatency
  • Hide() : MediaTransportControls , sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • HideCursor() : MoveLookController
  • HideDescriptionOnSmallScreen() : Scenario6_AdInsertion , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario7_LiveSeekableRange
  • HideGameInfoOverlay() : GameInfoOverlay , IGameUIControl , sealed , IGameUIControl
  • HideGuidance() : CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • HideGuidanceButton_Click() : CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • HideInactiveMeshes() : RealtimeSurfaceMeshRenderer
  • HideLoadUri() : ContentSelector
  • HidePairingPanel() : sealed , Scenario9_CustomPairDevice
  • HidePreviewButton_Click() : Scenario5_DisplayingBarcodePreview
  • HidePropertyPopUp() : sealed , Scenario2
  • HideStatus() : MainPage
  • HideTooSmall() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , IGameUIControl , sealed
  • HideView_Click() : SecondaryViewPage
  • highLatency : sealed
  • HighlightDetectedFaces() : sealed , MainPage
  • HighlightFaces() : MainPage
  • HighlightRanges() : MainPage
  • HighlightsValue : PhotoAdjustmentProperties
  • HighlightTextOnScreen() : Scenario_SynthesizeTextBoundaries
  • HighlightWordOnScreen() : sealed
  • HighPart : LARGE_INTEGER
  • HighScore() : Simple3DGame
  • Histogram() : sealed
  • HistoricalBytes : AtrInfo
  • HistoryAndRoaming() : HistoryAndRoaming
  • historyEnabledToken : HistoryAndRoaming
  • HistoryRecord() : HistoryRecord
  • historyRecords : sealed , Scenario2_History
  • Hit() : GameObject
  • HIT_TARGET : EdgeTappedListView
  • HitMaterial() : GameObject
  • HitSound() : GameObject
  • HitTest() : RectRenderer , LowLatencyInputMain
  • HitTestTargetWithGaze() : HandHandler
  • HitTime() : GameObject
  • hnsBufferDuration : DEVICEPROPS
  • hnsDesiredLiveOffset : LiveSourceBufferManager
  • hologramColorFadeMultiplier : ModelConstantBuffer
  • HolographicApp1Main() : HolographicApp1Main
  • HolographicCamera : CameraResources
  • holographicCamera : CameraResources
  • HolographicFaceTrackerMain() : HolographicFaceTrackerMain
  • HolographicMRCSampleMain() : HolographicMRCSampleMain
  • HolographicPaintMain() : HolographicPaintMain
  • holographicSpace : HolographicApp1Main , AppView , _360VideoPlaybackMain , DeviceResources , AppView , HolographicTemplateAppMain
  • HolographicSpatialMappingMain() : HolographicSpatialMappingMain
  • HolographicSpatialStageMain() : HolographicSpatialStageMain
  • HolographicTagAlongSampleMain() : HolographicTagAlongSampleMain
  • HolographicTemplateAppMain() : HolographicTemplateAppMain
  • holographicView : sealed
  • HolographicVoiceInputMain() : HolographicVoiceInputMain
  • horizontalResolution : sealed::StreamFilteringCriteria
  • horizontalScrollableWindow : Scenario7_ScrollingContentUsingMarquee , sealed
  • hostName : RemotePeer , sealed
  • HoughLines() : sealed
  • Hover : sealed
  • hr : sealed
  • HResultPrivacyStatementDeclined : sealed , Scenario_PredefinedDictationGrammar , Scenario_SRGSConstraint , Scenario_PredefinedWebSearchGrammar , Scenario_ListConstraint , Scenario_ContinuousDictation
  • HResultRecognizerNotFound : sealed , Scenario_SRGSConstraint , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_ContinuousRecognitionListGrammar
  • hRpcBinding : sealed
  • HsMaskRadiusValue : PhotoAdjustmentProperties
  • htmlFragment : CopyText
  • httpClient : Scenario01_GetText , Scenario02_GetStream , Scenario09_GetCookie , CommonLicenseRequest , Scenario03_GetList , Scenario06_PostMultipart , Scenario15_ServerCertificateValidation , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario08_PostCustomContent , Scenario04_PostText , Scenario07_PostStreamWithProgress , Scenario05_PostStream
  • httpClientFilter : Scenario3_RequestModification
  • HttpJsonContent() : HttpJsonContent
  • HttpMapTileDataSourceUriRequested() : Scenario12 , sealed
  • HttpMeteredConnectionFilter() : HttpMeteredConnectionFilter
  • HttpPrefix : DashManifestParser
  • HttpRetryFilter() : HttpRetryFilter
  • HttpsPrefix : DashManifestParser
  • httpTileSource : Scenario12 , sealed
  • htu21dSensor : sealed , Scenario1_ReadData
  • Hud() : GameRenderer
  • hypothesisGeneratedToken : sealed
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- i -

  • IccDetection() : IccDetection
  • IccResponse : TransparentExchangeResponse
  • IconUri : Account
  • id : FileOpenPicker_PickAppFile , LampArrayInfo
  • Id : ViewLifetimeControl , sealed , SessionRequestWrapper , SymbologyListEntry , Contact , Item
  • id : sealed
  • Id : BluetoothLEDeviceDisplay , Item , SymbologyListEntry , RfcommChatDeviceDisplay , BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • id : FileOpenPicker_PickCachedFile , Period
  • Id : sealed , School , FrameSourceGroupModel , User
  • id : Contact
  • Id : FrameSourceInfoModel , ViewLifetimeControl , Contact , DeviceListEntry , Item
  • id : FileOpenPicker_PickURLFile , Item
  • Id : DeviceInformationDisplay , School , AdaptiveContentModel , User , WindowInfo
  • id : LampArrayInfo
  • Id : TrackingEventCue , Period , ViewLifetimeControl , VideoMetaData , Scenario , sealed
  • idKey : School , User , School , User
  • Idle : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • IFACEMETHOD_() : CMediaBufferWrapper , CSourceOperation , CMediaSource , CMediaStream , CStreamSink , CustomTextRenderer , CBufferPacket , CBufferEnumerator , CMarker , CMediaBufferWrapper
  • IFACEMETHODIMP_() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftEffect , DftTransform , RippleEffect , WaveEffect
  • IgnoreErrorsAndCustomValidation_Checked() : Scenario15_ServerCertificateValidation
  • IlluminanceLux : PresentationFormats
  • Image : FileExtensions
  • IMAGE_COLS : Scenario1_ExampleOperations
  • IMAGE_ENCODING_STRING : sealed
  • IMAGE_ROWS : Scenario1_ExampleOperations
  • imageBase : Scenario1
  • ImageData : FileItem
  • imageFile : sealed , ShareImage
  • ImageHeight : FileItem
  • imageHeight : GpuCoordinateMapper::CameraIntrinsics
  • imageKind : ImageInfo
  • ImagePage() : ImagePage
  • ImagePath : SampleDataModel
  • ImagesAndVideo_Checked() : Scenario1
  • ImageSource : Item , ArticleViewModel , Item
  • ImageSourceUri : sealed , PointOfInterest
  • imageText : CustomOptionsPrintHelper
  • ImageUri : Model
  • ImageWidth : FileItem
  • imageWidth : GpuCoordinateMapper::CameraIntrinsics
  • imgSrc : CopyText
  • ImportableItem : ImportableItemWrapper
  • ImportableItemWrapper() : ImportableItemWrapper
  • importedResult : Scenario1
  • ImportOperation : MainPage
  • importSource : Scenario1
  • InCircleEdgeZone() : sealed , Scenario8
  • inclinometer : sealed
  • inCollection : sealed
  • InCollection : ItemDetails
  • IncomingConnectionArrived : CaptureDevice
  • IncomingConnectionEvent : sealed
  • Increment_Local_Click() : Scenario1_Files
  • Increment_LocalCache_Click() : Scenario1_Files
  • Increment_Temporary_Click() : Scenario1_Files
  • IncrementDecrement() : IncrementDecrement
  • IndependentEvent_Click() : sealed
  • IndependentInputOnPointerEntering() : sealed
  • IndependentInputOnPointerExiting() : sealed
  • IndependentInputOnPointerHovering() : sealed
  • IndependentInputOnPointerLost() : sealed
  • IndependentInputOnPointerMoving() : sealed
  • IndependentInputOnPointerPressing() : sealed
  • IndependentInputOnPointerReleasing() : sealed
  • index : MainPage , CameraStreamProcessor::FrameData , NfcProvHeader
  • Index : VectorChangedEventArgs , HomeController
  • indexBuffer : VideoRenderer , SpinningCubeRenderer
  • IndexBuffer : MeshGeometry
  • indexCount : VideoRenderer , SpinningCubeRenderer , SurfaceMeshProperties
  • IndexCount : MeshGeometry
  • indexFormat : SurfaceMeshProperties
  • IndexOf() : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemCacheManager< T > , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • indicesCount : Print3D
  • indicesMaterialPrint : Print3D
  • indicesPrint : Print3D
  • Individualize() : HardwareDRMViewModel
  • IndividualizeIfNeeded() : ProactiveViewModel
  • InductanceHenry : PresentationFormats
  • InertiaSwitch_Toggled() : sealed , Scenario4 , Scenario5
  • informationElements : Scenario1_Advertiser
  • InitalizeAccountsControlDialog() : sealed
  • InitCustomProfileBtn_Click() : sealed , Scenario1_SetRecordProfile
  • initdata() : Scenario1 , Scenario2
  • InitDeviceWatcher() : DeviceList
  • InitDrawerButton_Click() : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • InitialBitrateList_SelectionChanged() : Scenario4_Tuning
  • Initialize() : ControlBase , Cursor , IControl , sealed , AudioFileReader , AudioStreamReader , OmnidirectionalSound , ILivePlayer , LiveDashPlayer , Player , SourceBufferManager , App , ScenarioElement , sealed , Simple3DGame , App , PersistentState , Audio , Cylinder , Level , Level1 , Level2 , Level3 , Level4 , Level5 , SoundEffect , Simple3DGame , CBaseAttributes< TBase > , CMediaSource , CMediaStream , CStreamSink , sealed , AudioFileReader , CardioidSound , CustomDecaySound , OmnidirectionalSound , MFSampleGenerator
  • initialize : MainPage
  • Initialize() : sealed , BaseControl , BaseElement , Ellipse , FilledEllipse , Rectangle , FilledRectangle , Button , PlayPauseButton , ExitButton , SeekBarElement , MediaTransportControls , AppView , ContentSelector , sealed , Provider , sealed , AppView , sealed , SceneComposer , sealed , VisualProperties , sealed , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , sealed , DftEffect , sealed , RippleEffect , sealed , WaveEffect , sealed
  • InitializeAmmo() : Simple3DGame
  • InitializeAsync() : MediaCaptureManager , sealed , Scenario2_DisplayText , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee , sealed , CaptureDevice , LowLatency , VideoChat
  • InitializeAudioDeviceAsync() : WASAPICapture , WASAPIRenderer
  • InitializeBitrateLists() : Scenario4_Tuning
  • InitializeCameraAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MediaCapturePreviewer , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • InitializeCameraButton_Click() : sealed , Scenario1_PreviewSettings , Scenario2_PhotoSettings , Scenario3_AspectRatio
  • InitializeCapture() : sealed , Scenario4
  • InitializeCaptureAsync() : Scenario2_FindAvailableSourceGroups
  • InitializeController() : sealed , Scenario1_EventAndMenuHookup
  • initialized : sealed
  • Initialized : MediaCaptureManager , PhasingTests
  • InitializeDevice() : sealed , Scenario2 , Scenario3
  • InitializeDeviceWatchers() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • InitializeFocusPoint() : BaseControl
  • InitializeForegroundAppAuthentication() : Scenario3_ForegroundApp
  • InitializeGameConfig() : Simple3DGame
  • InitializeGameState() : GameMain
  • InitializeGridLines() : Scenario5_InkingAndInteractionFeedback
  • InitializeLampAsync() : sealed , Scenario3_AvailabilityChanged
  • InitializeLicense() : sealed , GameMain
  • InitializeLicenseCore() : sealed , GameMain
  • InitializeListboxVoiceChooser() : sealed , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries
  • InitializeMainPage() : App
  • InitializeManipulationTransforms() : Scenario5_InkingAndInteractionFeedback
  • InitializeMediaCaptureAsync() : Scenario1_DisplayDepthColorIR , Scenario1_ExampleOperations
  • InitializeOsrFx2DeviceWatcher() : sealed , Scenario1_ConnectDisconnect
  • InitializePageAsync() : AppContactPanel
  • InitializePasswordVaultInTheBackground() : MainPage
  • InitializePlaybackList() : Scenario6
  • InitializeProtectionManager() : PlayReadyHelpers
  • InitializeRecognizer() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PauseAsync , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • InitializeRegisteredSmsBackgroundTasks() : RegisterWithBackgroundTask
  • InitializeRevisionNumber() : Helpers
  • InitializeRfcommServer() : Scenario2_ChatServer
  • InitializeRootFrame() : App
  • InitializeScenario() : ScenarioElement
  • InitializeScopeData() : WASAPICapture
  • InitializeServiceSdpAttributes() : Scenario2_ChatServer
  • InitializeSpeechCommandList() : HolographicVoiceInputMain
  • InitializeSpeechRecognizer() : HolographicVoiceInputMain
  • InitializeStore() : ViewModelLocator
  • InitializeSuperMuttDeviceWatcher() : sealed , Scenario1_ConnectDisconnect
  • InitializeTetheringControls() : Scenario1_ConfigureMobileHotspot
  • InitializeTransforms() : sealed , ManipulationInputProcessor , sealed
  • InitializeUIControls() : sealed
  • InitializeUsingHolographicSpace() : DeviceResources
  • InitializeValues() : sealed , DataModel , BasicTests , CSharpModel , Functions , ListsAndTemplates , OtherBindings , DataModel
  • initializing : MediaListViewModel , sealed
  • initializing_previewSetupCompleted() : sealed
  • InitialOf() : Contact
  • Initials : Contact
  • InitLampBtn_Click() : sealed , Scenario1_GetLamp
  • InitManipulationTransforms() : sealed , Scenario4
  • InitNewComposition() : sealed , VisualProperties
  • InitOptions() : sealed , Scenario4 , Scenario5
  • InitPresentationDescription() : CMediaSource
  • InitRecordProfileBtn_Click() : sealed , Scenario1_SetRecordProfile
  • InitSegmentData : MediaStream
  • initSegmentUrl : MediaStream
  • InitSegmentUrl : MediaStream
  • InitWindow() : MoveLookController
  • inkAnalyzer : Scenario1 , Scenario2
  • InkCanvas_DoubleTapped() : Scenario2
  • InkCanvas_Tapped() : Scenario2
  • inkDrawingAttributesChangedToken : sealed
  • InkEventLogger() : InkEventLogger
  • InkingAreaSubStates : sealed
  • InkingEvent_Click() : sealed
  • InkingMode : sealed
  • InkingModeSelectionChanged() : sealed
  • InkObject() : SceneComposer::InkObject
  • inkPresenter : Scenario1 , Scenario2
  • InkPresenter_StrokesCollected() : Scenario1 , Scenario2 , sealed , Scenario3 , Scenario9
  • InkPresenter_StrokesErased() : Scenario1 , Scenario2 , sealed , Scenario2 , Scenario3
  • inkRecognizerContainer : sealed , Scenario4
  • InkRenderer() : InkRenderer
  • inkReplayTimer : sealed , Scenario9
  • InkReplayTimer_Tick() : sealed , Scenario9
  • InkStackPanel_Loaded() : sealed , Scenario8
  • InkToolbar_ActiveToolChanged() : sealed , Scenario6
  • InkToolbar_EraseAllClicked() : sealed , Scenario6
  • inkToolbar_InkDrawingAttributesChanged() : sealed , Scenario10
  • InkToolbar_InkDrawingAttributesChanged() : sealed , Scenario6
  • InkToolbar_IsStencilButtonCheckedChanged() : sealed , Scenario6 , Scenario7
  • inkToolbar_Loaded() : sealed , Scenario10
  • InkToolbar_SelectedStencilChanged() : sealed , Scenario6
  • InkToolbarMode : sealed
  • innerFilter : AddAuthorizationHeaderFilter , PlugInFilter
  • inputDevices : Scenario2_DeviceCapture
  • inputDevices_SelectionChanged() : Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages
  • inputDevicesListBox_SelectionChanged() : Scenario2_DeviceCapture
  • inputElements : WriteReadStream
  • inputLayout : VideoRenderer , SpinningCubeRenderer
  • inputLoopWorker : sealed
  • InputModes : sealed
  • InputOutputReports() : sealed , InputOutputReports
  • InputPauseButton_Click() : Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • InputPlayButton_Click() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • inputReportEventHandler : InputReportEvents
  • InputReportEvents() : sealed , InputReportEvents
  • inputReportEventToken : sealed
  • InputStopButton_Click() : Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • InputString1 : Scenario1ViewModel
  • InputString2 : Scenario1ViewModel
  • INS : ApduCommand
  • Insert() : FileDataSource2 , VeryObservableCollection-g< T > , EmployeeCollection , IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList
  • InsertAfter() : List< T > , ComPtrList< T, NULLABLE >
  • InsertAt() : GroupInfoList
  • InsertBack() : List< T >
  • InsertBuffer() : CBufferPacket
  • InsertFront() : List< T >
  • InsertItem() : MediaListViewModel
  • InsertPos() : List< T >
  • InsideInkingArea : sealed
  • InsideSelectionRect : sealed
  • InspectableClass() : CMediaBufferWrapper , WrlFinal
  • InstallClientCertificateAsync() : sealed , Scenario3_ClientAuthentication
  • instance : PlaybackService , SettingsService , WiFiDirectServiceManager
  • Instance : SettingsService , ScenarioCommon , FileLoggingSessionScenario , DAL , WiFiDirectServiceManager , FileLoggingSessionScenario , LoggingSessionScenario , PlaybackService
  • Instance1 : Scenario2_MultipleScanners , sealed
  • Instance2 : Scenario2_MultipleScanners , sealed
  • InstanceId : DeviceListEntry
  • Instruction : InstructionControl
  • InstructionControl() : InstructionControl
  • InstructionProperty : InstructionControl
  • InstructionsControl() : InstructionsControl
  • interactionManager : SpatialInputHandler
  • interactionMode : Scenario1_Basic
  • InteractionMode : Scenario1_Basic
  • interactionMode : sealed
  • internalAppending : SourceBufferManager
  • InternalId : AdvertisementWrapper
  • InternalReleased : ViewLifetimeControl , sealed
  • InternalTransferHandlerAsync() : Scenario1
  • interruptEventHandler : Scenario3_InterruptPipes
  • InterruptInPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • InterruptMessageWorker() : sealed
  • InterruptOutPipeIndex : SuperMutt::Pipe
  • Intersects() : sealed , ItemIndexRangeList
  • IntField : CSharpModel
  • IntPropertyDP : DOModel , DataModel
  • IntPropertyDPName : DOModel , DataModel
  • IntPropertyDPProperty : DOModel , DataModel
  • IntPropNoINPC : DataModel
  • IntPropWithINPC : DataModel
  • INVALID_PUBLISHED_MESSAGE_ID : Scenario1
  • Invalidate() : SceneComposer
  • InvalidateAndResizeVSIS() : DeviceResources
  • InvalidateContentRect() : DeviceResources
  • InvalidateLayout() : sealed , CalibrationBar , sealed , CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage , sealed , CalibrationBar , sealed , CalibrationBar , sealed
  • InvalidateRect() : DeviceResources
  • InvalidateSize() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • InvalidPageException() : InvalidPageException
  • InvalidSize : Errors
  • InviteeRadioButton_Checked() : Scenario1_Define
  • Invoke() : AsyncCallback< T > , EmbeddedMFAsyncCallback< Callback >
  • InvokeAllFinished() : sealed
  • InvokeCompleteHandler() : sealed
  • InvokeFn : AsyncCallback< T >
  • InvokeScript() : Scenario3_InvokeScript
  • InvokeSimpleToast() : sealed , CompletionGroupTask
  • IrradianceWattPerSquareMetre : PresentationFormats
  • IsActive() : Animate , CMediaStream
  • IsActivePlay() : Simple3DGame
  • IsAepPairedAsync() : Scenario1_Advertiser
  • isAllDevicesEnumerated : Scenario1_ConnectDisconnect , sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • isAngleDetected : sealed
  • IsAnImportantTransaction : MainPage , sealed , MainPage
  • isApp : sealed
  • isApplicationWindowActive : MainPage , SampleState
  • IsAppLocalSettingsValue() : sealed
  • IsAudio : SourceBufferManager
  • IsBackground : DEVICEPROPS
  • IsBackgroundTaskName() : Scenario1_ManageHotspot
  • IsBandSupported() : Helpers
  • isBoundRect : sealed , Scenario2
  • IsBusy : LoggingSessionScenario , FileLoggingSessionScenario
  • isBusy : LoggingSessionScenario , Scenario1_Discovery , FileLoggingSessionScenario , Scenario1_FindClaimEnable
  • IsBusy() : LoggingSessionScenario
  • isBusy : sealed
  • IsBusy() : FileLoggingSessionScenario
  • IsCertificateValidAsync() : Scenario15_ServerCertificateValidation , MainPage
  • isChannelEnabled : LoggingSessionScenario , FileLoggingSessionScenario
  • IsChecked() : sealed
  • isClipboardContentChangedEnabled : SampleState
  • IsClipboardContentChangedEnabled() : SampleState , MainPage
  • IsClipboardPeekAllowedAsync() : Scenario14_QueryCpPaste
  • IsColorEnabled : Model
  • isColorOn : CustomEffectState
  • IsConnectable : BluetoothLEDeviceDisplay
  • IsConnected : BluetoothLEDeviceDisplay , sealed
  • IsConsoleRun() : CSampleService
  • IsContentCropped : PageDescription
  • IsCurrent : SourceHandler::PositionInformation
  • IsDataTerminalReady_false : DeviceConfiguration
  • IsDataTerminalReady_true : DeviceConfiguration
  • IsDeviceConnected : EventHandlerForDevice
  • IsDeviceSuccessfullyConnected : OnDeviceConnectedEventArgs
  • isDeviceSuccessfullyConnected : OnDeviceConnectedEventArgs
  • IsDeviceSuccessfullyConnected : OnDeviceConnectedEventArgs
  • IsDisposed : Disposer
  • isDisposed : LoggingSessionScenario , FileLoggingSessionScenario
  • IsEmpty() : List< T >
  • IsEmptyRect() : InkRenderer
  • isEnabled : RadioModel
  • IsEnabled : RadioModel , SymbologyListEntry , ControlBase , IControl , RadioModel , SymbologyListEntry
  • isEnabled : RadioModel
  • IsEnabledAutoReconnect : EventHandlerForDevice
  • isEnabledAutoReconnect : EventHandlerForDevice , sealed , EventHandlerForDevice
  • IsEnabledAutoReconnect : EventHandlerForDevice
  • IsEnclosureLocationExternal() : CameraRotationHelper , sealed
  • IsEndOfStream : SourceBufferManager
  • isEndOfStream : SourceBufferManager
  • IsEOF() : ToneSampleGenerator , MFSampleGenerator , ToneSampleGenerator , MFSampleGenerator
  • IsExceptionHandled() : Scenario1_ParseAndStringify , Scenario1_Download , Scenario2_Upload , Scenario1_ParseAndStringify , Scenario3_Notifications
  • IsFailed() : sealed , CompletionGroupTask
  • isFilterUsed : Scenario01_GetText
  • IsFinished() : Animate
  • IsFiring() : MoveLookController
  • isFirstSegment : SourceBufferManager
  • IsFixedSize : EmployeeCollection , FileDataSource , IncrementalLoadingBase , FileDataSource2 , VeryObservableCollection-g< T > , FileDataSource
  • IsFixedTimeStep : StepTimer
  • isFixedTimeStep : StepTimer
  • IsFixNeededAsync() : sealed , Scenario3_FixAccount
  • IsFlagged : SampleDataModel
  • isFloat : ImageInfo
  • IsFocused() : FocusableElement , IControl , ControlBase , BaseControl , MediaTransportControls
  • IsFocusOnControl() : BaseControl
  • IsFx2CustomTriggerTaskRegistered() : CustomTrigger , sealed
  • IsGamepadSupported : TransportOptions
  • isHceSupported : ManageCardScenario
  • IsHologramEnabled() : MediaCaptureManager
  • IsHWOffload : DEVICEPROPS
  • IsIdentityManaged_Click() : Scenario2
  • IsImportantTransaction_Click() : sealed , Scenario1_FindClaimEnable
  • isInBackgroundMode : App
  • IsIndividualized : PlayReadyHelpers
  • isInitialized : Scenario1 , OcrCapturedImage , sealed , OcrCapturedImage , SourceBufferManager
  • isInitSegmentDownloading : MediaStream
  • IsInSnapRange() : Scenario5_InkingAndInteractionFeedback
  • IsInverse : BooleanToVisibilityConverter
  • IsItemInMenu() : sealed
  • IsItemLeftEdgeTapEnabled() : EdgeTappedListView
  • isItemLeftEdgeTapEnabled : EdgeTappedListView
  • isLastKnownFullScreen : sealed , Scenario1_Basic
  • isLaunched : Scenario2_ManageAccount , Scenario3_FixAccount , Scenario1_AddAccount , sealed
  • IsLicenseAvailable() : ProactiveViewModel
  • isListening : Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_PauseAsync
  • IsLive : Manifest
  • isLive : Manifest
  • IsLoadingComplete() : RenderingHelper
  • IsLoggingEnabled : FileLoggingSessionScenario , LoggingSessionScenario
  • IsLowLatency : CAPTUREDEVICEPROPS , DEVICEPROPS
  • IsManager : Manager , Employee , IEmployee
  • IsMatching() : sealed , RemotePeer
  • IsMediaAlreadyOpened() : sealed , PlaybackPage
  • IsMediaTypeSupported() : CStreamSink
  • IsNavigatedAway : Scenario2_LEDTemp , Scenario3_ReadWrite
  • IsNew : SampleDataModel , sealed
  • IsNextEnabled : StepsControl
  • IsNextEnabledProperty : StepsControl
  • IsNonEmptyString() : Utils
  • IsNonNull() : sealed , Scenario3_UsingWindows , sealed , Utils , Scenario1_SelectDisplay , Scenario5_DefiningCustomGlyphs , sealed
  • IsoAutoCheckBox_CheckedChanged() : MainPage
  • IsoSlider_ValueChanged() : MainPage
  • IsPaired() : BluetoothLEDeviceDisplay , DeviceInformationDisplay , BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • isPaused : Player
  • IsPauseRequested() : MoveLookController
  • IsPerformingIo() : Scenario4_BulkPipes
  • IsPerformingRead() : Scenario3_ReadWrite
  • IsPerformingWrite() : Scenario3_ReadWrite
  • IsPixelSnappingDisabled() : CustomTextRenderer , FontNameCollector
  • IsPlaying : PlaybackControl
  • isPointerPress : PlaybackPage
  • isPopulatingLanguages : Scenario_SRGSConstraint , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint , sealed
  • IsPositionCurrent() : SourceHandler
  • IsPreparingForSuspend : FileLoggingSessionScenario
  • IsPreRollFilled() : MFSampleGenerator
  • IsPresent : IsApiPropertyPresentTrigger
  • IsPressComplete() : MoveLookController
  • IsPreviewing() : Scenario5_DisplayingBarcodePreview , MediaCapturePreviewer
  • isPreviewing : OcrCapturedImage , sealed
  • IsPreviewing : Scenario5_DisplayingBarcodePreview
  • isPreviewing : OcrCapturedImage
  • IsPrinterClaimed() : sealed , Scenario2_PrintReceipt
  • isPropertyChangedObserved : sealed
  • IsRadioOn() : RadioModel
  • IsRateSupported() : CMediaSource
  • IsRawChosen : DEVICEPROPS
  • IsRawSupported : DEVICEPROPS
  • IsReadOnly : EmployeeDictionary , EmployeeCollection , IncrementalLoadingBase , VeryObservableCollection-g< T > , FileDataSource , VeryObservableCollection-g< T > , FileDataSource2 , FileDataSource , ItemIndexRangeList , FileDataSource
  • IsReadTaskPending : Scenario3_ReadWrite
  • IsReadyToRender() : HolographicFaceTrackerMain
  • IsReceived : TextMessage
  • IsRecording : MediaCapturePreviewer
  • isRegisteredForInputReportEvents : sealed , InputReportEvents
  • IsRenderingStereoscopic() : CameraResources
  • IsRequestToSendEnabled_false : DeviceConfiguration
  • IsRequestToSendEnabled_true : DeviceConfiguration
  • IsRotating() : ToolCarousel
  • IsScannerClaimed : Scenario5_DisplayingBarcodePreview
  • IsSelected() : FileDataSource2
  • isSelected : Period
  • IsSelected : Period
  • isSelectionChanging : Scenario5_DisplayingBarcodePreview
  • IsSent : TextMessage
  • isStereo : CameraResources
  • isStopPending : Scenario5_DisplayingBarcodePreview
  • IsStreaming() : CameraStreamProcessor
  • IsStrokeSelected() : SceneComposer::InkObject
  • IsSuperMuttDevice() : Utilities
  • isSupported : ServiceViewModel
  • isSupportedProfile : Manifest
  • IsSupportedProfile : Manifest
  • IsSymbolTargetBorder() : Scenario3_StartDragAsync
  • IsSynchronized : EmployeeCollection , FileDataSource , FileDataSource2 , VeryObservableCollection-g< T > , FileDataSource , IncrementalLoadingBase
  • isSyncing : Scenario7_SyncDevice
  • IsSystemAudioEnabled() : MediaCaptureManager
  • IsTargetBorder() : sealed
  • isTerminator : VideoChat
  • IsThin() : CSetRateOperation
  • isThisPageActive : Scenario1
  • IsTonePlayback : DEVICEPROPS
  • IsTouching() : Face , Sphere , Cylinder , GameObject
  • IsTracked : PoseTrackingEntityData
  • IsTrackingFaces() : FaceTrackerProcessor
  • isTrial : GameConfig
  • IsTrial() : Simple3DGame
  • IsTypePresent() : ApiInformation
  • IsUpperCaseEnabled : Scenario1ViewModel , AppData
  • IsUpperCaseEnabledChanged : ISecureInterfaceConsumer
  • IsUpperCaseEnabledPropertyDataChanged : AppData
  • isUpperCaseEnabledPropertyKey : AppData
  • IsValid : AttributeValidationDescriptor
  • IsValidBitrateCombination() : Scenario4_Tuning
  • IsValidOperator() : Scenario3_ServerForeground
  • IsValidPosition() : sealed
  • IsVideo : SourceBufferManager , CStreamSink
  • IsVisible() : MediaTransportControls
  • isVisibleChangedToken : CustomTitleBar
  • IsWatcherRunning() : sealed , DeviceWatcherHelper
  • IsWatcherStarted() : DeviceWatcherHelper , sealed , DeviceWatcherHelper
  • IsWebException() : Scenario6_RecoverableErrors , Scenario7_DownloadReordering , sealed , Scenario5_RandomAccess
  • IsWriteTaskPending : Scenario3_ReadWrite
  • item : Scenario4
  • Item() : DetailPage
  • item : Scenario5 , List< T >::Node
  • Item() : ListViewEdgeTappedEventArgs , DetailPage
  • item : ListViewEdgeTappedEventArgs
  • Item() : Item , List< T >::Node
  • Item_TimedMetadataTracksChanged() : Scenario6_AdInsertion , Scenario5_Metadata
  • itemCache : FileDataSource2 , FileDataSource
  • ItemCache_CacheChanged() : FileDataSource2 , FileDataSource
  • ItemCacheManager() : ItemCacheManager< T >
  • ItemClick : PlaylistView
  • ItemDetails() : ItemDetails , sealed
  • ItemId : ItemViewModel , MediaItem
  • itemIndex : CacheChangedEventArgs-g< T >
  • ItemIndexRangeList() : ItemIndexRangeList
  • ItemLeftEdgeTapped : EdgeTappedListView
  • itemLeftEdgeTappedEvent : EdgeTappedListView
  • ItemList() : ItemList
  • ItemProperty() : DetailPage
  • items : Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView
  • Items : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE > , MainViewModel
  • Items_VectorChanged() : PlayerViewModel
  • ItemsListView_ContainerContentChanging() : Scenario5_RestoreScrollPosition
  • ItemsListView_ItemClick() : Scenario5_RestoreScrollPosition
  • itemsResult : Scenario1
  • itemsSeen : sealed , ChatListView
  • itemsToImport : Scenario1
  • ItemTemplateControl() : ItemTemplateControl
  • ItemViewModel() : ItemViewModel
  • IterativeSearch() : LiveSourceBufferManager
  • Iterator : CBufferPacket
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- p -

  • P1 : ApduCommand
  • P2 : ApduCommand
  • PackageFamilyName3DBuilder : Scenario2_Launch
  • Page : NavigationHelper
  • Page_Loaded() : Scenario5_GetSingleDevice , Scenario5_RestoreScrollPosition , Scenario5_GetSingleDevice , sealed , Scenario_Document1 , sealed , Scenario_Document2 , Scenario_Document3
  • Page_OnLoaded() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange , Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Page_OnUnloaded() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Page_Tapped() : SubPage
  • pageCollection : PhotosPrintHelper
  • pageContent : sealed , CustomTitleBar
  • pageIsLoading : Scenario1_NavToUrl
  • PageRangePrintHelper() : sealed , PageRangePrintHelper
  • PageRoot_Loaded() : DetailPage
  • PageRoot_Unloaded() : DetailPage
  • PageSize : PageDescription
  • PageState : LoadStateEventArgs , SaveStateEventArgs , LoadStateEventArgs , SaveStateEventArgs
  • PageToPrint() : sealed , PageToPrint
  • PairButton_Click() : Scenario1_Discovery , sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • PairingCode : DialLaunchArguments
  • PairingRequestedHandler() : sealed , Scenario9_CustomPairDevice
  • PairingSelectors() : DeviceSelectorChoices
  • Panel() : Panel
  • paragraphSelected : Scenario2
  • Parameter1_SelectionChanged() : Scenario3_SendMIDIMessages
  • Parameter2_SelectionChanged() : Scenario3_SendMIDIMessages
  • Parameter3_SelectionChanged() : Scenario3_SendMIDIMessages
  • parent_finder() : EmbeddedMFAsyncCallback< Callback >
  • Parity : DeviceConfiguration
  • ParityComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • Parse() : DialLaunchArguments , DashManifestParser , AtrParser
  • Parse_Click() : Scenario1_ParseAndStringify
  • ParseCurrentBuffer() : CMediaSource
  • ParseDoubleFromTextBox() : Scenario4_ForegroundGeofence
  • ParseFloatOrDefault() : Scenario1_CreateTile
  • ParseHeartRateValue() : Scenario2_Client
  • ParseMPDElement() : DashManifestParser
  • ParsePeriodElement() : DashManifestParser
  • ParsePinPolicy() : sealed , Scenario1_ProvisionTPM
  • ParseProperties() : sealed , DiscoveredDeviceWrapper
  • ParseRepresentationElement() : DashManifestParser
  • ParseSegmentTemplateElement() : DashManifestParser
  • ParseServerUrl() : CMediaSource
  • ParseTimeSpan() : Scenario4_ForegroundGeofence
  • ParseUIntWithFallback() : Helpers
  • Partial_Construct() : App
  • Partial_LaunchCompleted() : App
  • passive : sealed
  • PassportAvailableCheckAsync() : sealed , SignIn
  • PassportDelete() : sealed , Content
  • Password : ConfigStore
  • PasswordVisibility : Scenario2ViewModel
  • PasteButton_Click() : CopyFiles , CopyImage , CopyText , CopyFiles , CopyImage , CopyText , Scenario9_ClipboardTarget
  • PasteFlyoutItem_Click() : sealed
  • PasteSelected() : SceneComposer
  • Path : FileItem
  • Pause() : PlaybackControl , CServiceBase , CMediaSource , CStreamSink
  • Pause_Click() : Scenario7_LiveSeekableRange
  • PauseAll_Click() : sealed , Scenario1_Download
  • PauseAnimationTapped() : sealed , Scenario12
  • PauseButton_Click() : Scenario2_Effects
  • pausedDueToMute : Scenario1
  • PauseDevice() : sealed , Scenario2 , Scenario3
  • PauseDownload_Click() : sealed , Scenario5_RandomAccess
  • PauseGame() : Simple3DGame
  • PausePlaybackAsync() : WASAPIRenderer
  • PauseRequested() : GameMain
  • Payload : PopToastControl
  • PayloadProperty : PopToastControl
  • PcscCardName : IccDetection
  • PcscDeviceClass : IccDetection
  • pdfDocument : sealed , Scenario1_Render
  • pedometer : sealed , Scenario1_Events
  • Pedometer_ReadingChanged() : Scenario1_Events
  • PedometerBackgroundTask() : sealed
  • PedometerClassId : Scenario1_Events , Scenario2_History , Scenario3_CurrentStepCount
  • penDevice : Scenario2_SupportedTactileFeedback , Scenario3_InkingFeedback , Scenario4_InteractionFeedback , Scenario5_InkingAndInteractionFeedback
  • pendingConnections : Scenario1_Advertiser
  • pendingConnectionsMutex : Scenario1_Advertiser
  • pendingSelectionDeviceId : Scenario5_DisplayingBarcodePreview
  • penSize : sealed , Scenario3 , Scenario8
  • penSizeIncrement : sealed , Scenario3
  • Percentage : PresentationFormats
  • percentComplete : DownloadOperationItem
  • PerformAction() : FocusableElement , Button , PlayPauseButton , ExitButton , SeekBarElement
  • PerformPressedAction() : BaseControl , MediaTransportControls
  • Period() : Period
  • PeriodBeatsPerMinute : PresentationFormats
  • periodicTimer : RfcommServerTask , sealed , UnspecifiedReason , LocationTrackingReason
  • PeriodicTimer : sealed
  • PeriodicTimerCallback() : BackgroundActivity , SampleBackgroundTask , RfcommServerTask
  • periods : Manifest
  • periodStart : DashManifestParser
  • peripheralSupported : Scenario3_ServerForeground
  • PermeabilityHenryPerMetre : PresentationFormats
  • PerMille : PresentationFormats
  • PermittivityFaradPerMetre : PresentationFormats
  • pfnLink_Click() : sealed , Scenario6
  • phase : RippleEffect
  • PhasedTemplate_Checked() : sealed , PhasingTests
  • PhasingTests() : sealed , PhasingTests
  • phContext : sealed
  • Phone : User
  • PhoneButton_Click() : sealed , Scenario_PauseAsync
  • phoneConstraint : sealed , Scenario_PauseAsync
  • phoneKey : User
  • PhoneNumber : Contact
  • phoneNumber : Contact
  • Photo : AdvancedCaptureContext
  • PhotoAdjustmentRenderer() : PhotoAdjustmentRenderer
  • PhotoButton_Click() : sealed , MainPage , sealed , MainPage , sealed , Scenario2_PhotoSettings , sealed , MainPage
  • PhotoCanvas_SizeChanged() : Scenario1_DetectInPhoto
  • photoScale : PhotosPrintHelper
  • PhotoSettings_Changed() : sealed , Scenario2_PhotoSettings
  • photoSize : PhotosPrintHelper
  • PhotosPrintHelper() : sealed , PhotosPrintHelper
  • PhysicalDeviceIsChecked : Scenario2ViewModel
  • PickAFileButton_Click() : sealed , Scenario1_SingleFile , Scenario5_TriggerCFU , Scenario1_SingleFile , Scenario5_TriggerCFU
  • PickAndLaunchFile() : Scenario1_LaunchFile
  • PickAndSetButton_Click() : sealed , SetLockScreenImage
  • PickAudioButton_Click() : sealed , Scenario1_Create , Scenario3_Add
  • PickContactEmail() : sealed , Scenario1_Single
  • PickContactPhone() : sealed , Scenario1_Single
  • PickContactsEmail() : sealed , Scenario2_Multiple
  • PickContactsPhone() : sealed , Scenario2_Multiple
  • pickedFile : sealed , Scenario1_TrimAndSaveClip , Scenario3_AddAudioTracks
  • picker : Scenario03 , Scenario05 , Scenario06 , Scenario2 , Scenario02
  • Picker_CastingDevicePickerDismissed() : Scenario02
  • Picker_CastingDeviceSelected() : Scenario02 , Scenario2
  • Picker_DevicePickerDismissed() : Scenario03 , Scenario05 , Scenario06
  • Picker_DeviceSelected() : Scenario03 , Scenario05 , Scenario06
  • Picker_DisconnectButtonClicked() : Scenario03 , Scenario05 , Scenario06
  • PickFile() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , Scenario1_CreateTile
  • PickFileButton_Click() : MainPage_PickFile
  • pickFileButton_Click() : Scenario1 , Scenario7
  • PickFilesButton_Click() : sealed , Scenario2_MultiFile
  • PickFolderButton_Click() : sealed , Scenario3_SingleFolder
  • PickNextMediaSourceAsync() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • PickNextMediaSourceWorkerAsync() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • PickOutput() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • PickPlaylistAsync() : MainPage
  • PickPlaylistButton_Click() : sealed , Scenario2_Display , Scenario3_Add , Scenario4_Remove , Scenario5_Clear
  • PickSingleDeviceButton_Click() : sealed , Scenario1_DevicePicker
  • picturesLibrary : sealed , Scenario2 , Scenario3
  • PictureViewSize : PageDescription
  • Pid : SuperMutt::Device , ArduinoDevice
  • Pin : sealed , SessionRequestWrapper , AdvertisementWrapper
  • pin : sealed , Scenario1_GetAndSetPin , AdvertisementWrapper
  • Pin_Click() : Scenario1_CreateContact
  • Pin_ValueChanged() : sealed , Scenario2_Listen
  • PinButton_Click() : Scenario1_PinTile
  • PinChangedEvent() : Scenario4_Events
  • PinChangedEventHandler : Scenario4_Events
  • PinChangedToggleSwitch_Toggled() : Scenario4_Events
  • PinContactAsync() : Scenario1_CreateContact
  • PinLiveTile_Click() : Scenario6_SecondaryTileNotification
  • PinNewSecondaryTile() : TilesHelper
  • pinPolicyAllowed : Scenario1_ProvisionTPM
  • pinPolicyAllowedIndex : sealed
  • pinPolicyDisallowed : Scenario1_ProvisionTPM
  • pinPolicyDisallowedIndex : sealed
  • pinPolicyRequireOne : Scenario1_ProvisionTPM
  • pinPolicyRequireOneIndex : sealed
  • PinTile() : ScenarioElement
  • PinToAppBar_Click() : Scenario7_PinFromAppbar
  • Pitch() : Camera , MoveLookController
  • pitch : PlaybackPage
  • pitchOrLinearSize : DDS_HEADER
  • PitchSlider_ValueChanged() : sealed
  • pixelResolutionHeight : STEREO_PARAMETERS
  • pixelResolutionWidth : STEREO_PARAMETERS
  • pixelShader : VideoRenderer , SpinningCubeRenderer
  • PlaceholderImage() : Helpers
  • PlaceHolderImage : MainPage
  • PlaceLocation() : PlaceLocation
  • PlaceMarker() : CStreamSink
  • Places : Cluster
  • places : sealed , Scenario7
  • PlaneAngleDegree : PresentationFormats
  • PlaneAngleMinute : PresentationFormats
  • PlaneAngleRadian : PresentationFormats
  • PlaneAngleSecond : PresentationFormats
  • PlatformToMultibyteString() : AllJoynHelpers
  • Play() : PlaybackControl
  • Play_Click() : Scenario7_LiveSeekableRange
  • PlayAnimationTapped() : sealed , Scenario12
  • PlaybackBitrateChanged() : Scenario2_EventHandlers , Scenario4_Tuning
  • PlaybackControl() : PlaybackControl
  • playbackEnabled : ViewModelBase
  • PlaybackEnabled : ViewModelBase
  • playbackItem : MediaItemViewModel
  • PlaybackItem : MediaItemViewModel
  • playbackList : Scenario6
  • PlaybackList : Scenario1 , MediaListViewModel
  • PlaybackList_CurrentItemChanged() : MediaListViewModel , Scenario6
  • PlaybackList_ItemFailed() : Scenario1
  • PlaybackPage() : sealed , PlaybackPage
  • PlaybackPage_LayoutUpdated() : PlaybackPage
  • PlaybackService() : PlaybackService
  • playbackSession : PlaybackSessionViewModel
  • PlaybackSession : PlayerViewModel
  • PlaybackSession_PlaybackRateChanged() : Scenario6
  • PlaybackSession_PlaybackStateChanged() : PlaybackPage , PlaybackSessionViewModel , Scenario6
  • PlaybackSessionViewModel() : PlaybackSessionViewModel
  • PlaybackState : PlaybackSessionViewModel
  • playbackTimer : Player
  • PlayButton_Click() : Scenario2_Effects , sealed
  • playButton_Click() : LiveDashPlayer , Scenario6
  • Player : ProjectionViewPage , Scenario1 , PlaybackService , Player
  • player : PlaybackSessionViewModel , PlayerViewModel , LiveDashPlayer
  • Player_CurrentStateChanged() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • Player_MediaEnded() : Scenario04
  • Player_MediaFailed() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • Player_MediaOpened() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06 , ProjectionViewPage
  • Player_MediaPlayerRateChanged() : Scenario1
  • PlayerViewModel : Scenario1 , PlayerViewModel
  • PlayFile() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • Playing : MFSampleGenerator
  • PlayingTime() : GameTimer
  • playlist : sealed , Scenario3_Add , Scenario1
  • playlistExtensions : MainPage
  • playlistExtensionsInner : MainPage
  • PlaylistView() : PlaylistView
  • PlaylistView_ItemClick() : Scenario6
  • PlayPause_Click() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • PlayPauseButton() : PlayPauseButton
  • playPauseButton_Click() : Scenario1
  • PlayPauseToggleDevice() : sealed , Scenario2 , Scenario3
  • PlayReady : AdaptiveContentModel
  • playReadyChallengeCustomData : PlayReadyHelper
  • PlayReadyHelper() : PlayReadyHelper
  • PlayReadyInfo : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel , PlayReadyInfo
  • playReadyLicenseUrl : PlayReadyHelper
  • playReadySecurityVersion : PlayReadyInfoViewModel
  • PlayReadySecurityVersion : PlayReadyInfoViewModel
  • PlayReadyWinRTTrustedInput : PlayReadyHelper
  • PlayRecognitionBeginSound() : HolographicVoiceInputMain
  • PlayRecognitionSound() : HolographicVoiceInputMain
  • PlaySound() : GameObject , SoundEffect
  • PlaySpeedSlider_ValueChanged() : Scenario1_FilePlayback
  • PlotDataReady() : PlotDataSourceT< D >
  • PlotDataReadyEvent() : sealed
  • PlotDataReadyEventArgs() : PlotDataReadyEventArgs
  • PlugInFilter() : PlugInFilter
  • pMOG2 : sealed
  • pngBytes : Print3D
  • pNode : List< T >::POSITION
  • Pointer_Entered() : sealed , Scenario2 , Scenario2_SupportedTactileFeedback
  • Pointer_Exited() : Scenario2_SupportedTactileFeedback
  • Pointer_Moved() : sealed , Scenario2
  • Pointer_Pressed() : sealed , Scenario2
  • Pointer_Released() : sealed , Scenario2
  • Pointer_Wheel_Changed() : sealed , Scenario2
  • PointerHitTestStates : sealed
  • pointerMovedToken : sealed
  • pointerPressed : HolographicTemplateAppMain
  • pointerPressedToken : sealed
  • pointerReleasedToken : sealed
  • PointerType : InputTypeTrigger
  • points : sealed
  • Points() : PlotDataReadyEventArgs
  • Poke() : Employee , IEmployee , Manager , Employee , IEmployee , Manager
  • PollForInboundBitsPerSecond() : Scenario4_Tuning
  • PollingFireInUse() : MoveLookController
  • PopToastControl() : PopToastControl
  • PopulateAdapterList() : sealed , Scenario1 , sealed , Scenario1
  • PopulateColorsClick() : sealed , Functions
  • PopulateComboBox() : sealed , Scenario8 , sealed , Scenario2_PhotoSettings , LiveDashPlayer
  • PopulateComboBoxes() : sealed , Scenario3_AspectRatio
  • PopulateImageInfoACKind() : D2DAdvancedColorImagesRenderer
  • PopulateInputDeviceList() : Scenario2_DeviceCapture
  • PopulateLanguageDropdown() : Scenario_ContinuousRecognitionSRGSGrammar
  • PopulateLanguageDropDown() : Scenario_PredefinedWebSearchGrammar
  • PopulateLanguageDropdown() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_SRGSConstraint
  • PopulateMessageTypes() : Scenario3_SendMIDIMessages
  • PopulateOutputDeviceList() : Scenario2_DeviceCapture
  • PopulateParameterList() : Scenario3_SendMIDIMessages
  • PopulateScenarios() : FileOpenPickerPage , CachedFileUpdaterPage , FileSavePickerPage
  • PopulateSettingsComboBox() : sealed , Scenario1_PreviewSettings
  • popups : sealed , Scenario2
  • port : RemotePeer
  • Port : SocketWrapper
  • port : sealed , Scenario1_Send , Scenario1_Connect
  • portList : MidiDeviceWatcher
  • pos : VertexPositionTexture , VertexPositionColor , VertexPositionTex , VertexPosition , VertexPositionColor , VertexPositionTexture , VertexPositionColor , VertexPositionNormalColor , VertexPositionColorTex , VertexPositionColor , BasicVertex , VertexPosition , VertexPositionColor , TangentVertex , VertexPositionColor , VertexPositionTex
  • Poses : PoseTrackingEntityData
  • PosesCount : PoseTrackingEntityData
  • PoseSet : PoseTrackingEntityData
  • PoseTrackingFrame() : sealed
  • Position : DialLaunchArguments , SpinningCubeRenderer , TrackedPose , SourceHandler::PositionInformation , Contact , GameObject , Sphere , Contact
  • POSITION() : List< T >::POSITION
  • position : SpinningCubeRenderer , SlowInputStream , LineSegment , PNTVertex , Contact , VertexPositionTexture
  • Position() : Sphere , GameObject
  • PositionChangeThreshold : Scenario3_AdaptiveSync
  • PositionCursor() : Cursor
  • PositionHologram() : SpinningCubeRenderer
  • PositionImage() : ExtendedSplash
  • PositionStatus : TrackedPose
  • PositionTools() : HolographicPaintMain
  • positionUpdate_TimerTick() : Scenario1
  • PositionUpdateControl_PositionChanged() : Scenario7_LiveSeekableRange
  • PositionUpdateControl_SeekableRangesChanged() : Scenario7_LiveSeekableRange
  • PositionUpdateControl_SourceChanged() : Scenario7_LiveSeekableRange
  • PostAsync() : JsonRequest
  • PowerWatt : PresentationFormats
  • Preference : SizePreferenceString
  • Prefix : FileLoggingSessionScenario , LoggingSessionScenario
  • PrepareFormatChange() : CStreamSink
  • PrepareForRender() : LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect , FilmicEffect , DftEffect
  • PreparePrintContent() : PrintHelper
  • PrepareRemoteUrl() : CMediaSink
  • PrepareRendering() : RenderingHelper
  • PrepareSample() : CStreamSink
  • PrepareSampleFiles_Click() : Scenario4_ChangeSystemGroup , sealed
  • PrepareScenario() : GetConnectionProfiles , ShowConnection
  • PrepareToSuspend() : sealed , LoggingSessionScenario
  • PrepareToSuspendAsync() : FileLoggingSessionScenario , sealed
  • PreprocessorDefinitions : FxCompile
  • PrepScenario1Sample() : BroadbandDevice
  • PrepScenario2Sample() : AccountWatcher
  • PreRoll : MFSampleGenerator
  • Present() : DeviceResources
  • presentationFormat : Scenario2_Client
  • PresentTextLayout() : sealed
  • PreserveTrailingSpaces() : CustomEditControl
  • PressComplete() : GameMain
  • PressureBar : PresentationFormats
  • PressureMilliMetreofmercury : PresentationFormats
  • PressurePascal : PresentationFormats
  • PressurePoundForcePerSquareinch : PresentationFormats
  • prettyDate : FileItem
  • prettyFileSize : FileItem
  • prettyImageSize : FileItem
  • prev : List< T >::Node
  • prevButton_Click() : Scenario6
  • PreviewButton_Click() : LowLatency
  • PreviewButtonClicked() : sealed
  • PreviewControl_ManipulationDelta() : MainPage
  • PreviewControl_Tapped() : MainPage
  • previewEncodingProperties : LowLatency
  • previewImage : MediaItemViewModel
  • PreviewImage : MediaItemViewModel
  • PreviewImage_SizeChanged() : sealed , OcrFileImage , OcrCapturedImage , OcrFileImage , OcrCapturedImage
  • PreviewImageUri : MediaItem , MusicItem , VideoItem
  • previewImageUri : MediaItem
  • previewing : sealed
  • previewing_localClientButtonClicked() : sealed
  • previewing_previewButtonClicked() : sealed
  • Previewing_PreviewButtonClicked() : LowLatency
  • previewing_recordingStarted() : sealed
  • PreviewOptionsPrintHelper() : sealed
  • PreviewOptionsPrintHelper::AddOnePrintPage() : sealed
  • PreviewPagesCreated : PrintHelper
  • PreviewSettings_Changed() : sealed , Scenario3_AspectRatio , Scenario2_PhotoSettings , sealed
  • PreviewSetupCompleted() : LowLatency
  • previewTopLeft : Scenario5_InkingAndInteractionFeedback
  • PreviewUnavailable() : sealed , PreviewUnavailable , sealed
  • previousButton_Click() : Scenario1
  • previousDecodeResult : Provider
  • previousInputLanguage : sealed , Scenario4
  • PreviousItem_Click() : S1_GetAFeed , sealed
  • previousState : LowLatency
  • previousSwitchStates : Scenario3_InterruptPipes
  • previousSwitchValues : DeviceEvents , sealed
  • previousTransform : ManipulationInputProcessor , sealed , Scenario4 , Scenario5_InkingAndInteractionFeedback
  • previousZoomLevel : sealed , Scenario7
  • price : sealed
  • Price : ItemDetails
  • principalPoint : GpuCoordinateMapper::CameraIntrinsics
  • PrintBarcode_Click() : sealed , Scenario2_PrintReceipt
  • PrintBitmap_Click() : sealed , Scenario2_PrintReceipt
  • PrintCanvas : PrintHelper
  • PrintConnectionProfiles() : GetConnectionProfiles
  • PrintDescriptor() : Scenario5_UsbDescriptors
  • printDetailedOptions_OptionChanged() : sealed , PageRangePrintHelper , CustomOptionsPrintHelper
  • PrintDetailedOptionsOptionChanged() : PhotosPrintHelper , sealed
  • printDocument : PrintHelper
  • printDocumentSource : PrintHelper
  • printer : sealed
  • Printer : MainPage
  • PrintFrame : sealed
  • printHelper : Scenario5Photos , Scenario1Basic , sealed , Scenario4PageRange
  • PrintHelper() : PrintHelper
  • printHelper : Scenario2StandardOptions , Scenario3CustomOptions , Scenario6DisablePreview
  • PrintLine_Click() : sealed , Scenario2_PrintReceipt , sealed
  • PrintLineFeedAndCutPaper() : sealed , Scenario2_PrintReceipt
  • PrintMenuItem_Click() : Scenario1 , Scenario2 , sealed , Scenario3 , sealed
  • PrintPackage_Click() : Scenario1_Print
  • printPages : DisablePreviewPrintHelper
  • printPreviewPages : PrintHelper
  • PrintProfileInformation() : sealed
  • PrintReceipt() : sealed
  • PrintReceipt_Click() : sealed , Scenario2_PrintReceipt
  • PrintRow() : ReadBytes , sealed
  • PrintSelectedItem() : sealed , Scenario1_EventAndMenuHookup , sealed , Scenario2_SystemDefaultMenu
  • printSync : PhotosPrintHelper
  • PrintTaskRequested() : sealed , PageRangePrintHelper , sealed , DisablePreviewPrintHelper , sealed , PrintHelper , sealed , PrintHelper , StandardOptionsPrintHelper , CustomOptionsPrintHelper , PhotosPrintHelper
  • PrintTotalReadWriteBytes() : Scenario4_BulkPipes
  • PrivacyPolicyInvoked() : sealed , MultipleAccountsScenario , sealed , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • privatePropertyChanged : sealed
  • ProactiveIndividualization() : PlayReadyHelpers
  • ProactiveIndividualizationRequest() : PlayReadyHelper
  • ProactiveLicenseAcquisition() : PlayReadyHelpers
  • ProactiveViewModel() : ProactiveViewModel
  • ProcessColor() : sealed , Functions
  • ProcessColorFrame() : FrameRenderer
  • ProcessCommandApdu() : sealed
  • ProcessCurrentVideoFrame() : Scenario1_TrackInWebcam
  • ProcessCurrentVideoFrameAsync() : Scenario1_TrackInWebcam
  • ProcessDataVirtualizationScrollOffsetsAsync() : sealed , ChatListView
  • ProcessDepthAndColorFrames() : FrameRenderer
  • ProcessFaces() : HolographicFaceTrackerMain
  • ProcessFormatChange() : CStreamSink , CMediaStream
  • ProcessFrame() : sealed , FaceTrackerProcessor , AudioEchoEffect
  • ProcessGeofenceStateChangedReports() : GeofenceBackgroundTask
  • processingScrollOffsets : sealed , ChatListView
  • processingScrollOffsetsDeferred : sealed , ChatListView
  • ProcessPacket() : CMediaSource
  • ProcessQueue() : OpQueue< T, TOperation >
  • ProcessQueueAsync() : OpQueue< T, TOperation >
  • ProcessSample() : CStreamSink , CMediaStream
  • ProcessSamplesFromQueue() : CStreamSink
  • ProcessScopeData() : WASAPICapture
  • ProcessServerDescription() : CMediaSource
  • ProcessServerFormatChange() : CMediaSource
  • ProcessServerSample() : CMediaSource
  • ProcessServiceRequest() : ProactiveViewModel , HardwareDRMViewModel , ReactiveViewModel , SecureStopViewModel
  • ProcessVisitReports() : VisitBackgroundTask
  • ProcessWriteCharacteristic() : Scenario3_ServerForeground
  • ProducerOptionsVisibility : Scenario1ViewModel
  • productId : sealed
  • ProductionBatchNumber : CardDetails
  • productKind : sealed
  • ProductKind : ItemDetails
  • ProductName : RawSMBIOSSystemInfo
  • Progress : sealed
  • ProgressHandler() : Scenario07_PostStreamWithProgress
  • ProjectedMediaTransportControls() : ProjectedMediaTransportControls
  • ProjectedPage : ProjectionViewBroker
  • Projection() : Camera
  • projection : ConstantBufferChangeOnResize
  • projectionCombobox_SelectionChanged() : Scenario1 , sealed
  • ProjectionManager_ProjectionDisplayAvailableChanged() : Scenario2
  • ProjectionStopping : ProjectionViewBroker
  • ProjectionViewPage() : sealed , ProjectionViewPage
  • ProjectionViewPage_StopProjectingButtonClick() : ProjectionViewPage
  • ProjectionViewPageControl : sealed , ProjectionViewBroker , ProjectionViewPageInitializationData , MainPage
  • Properties : BluetoothLEDeviceDisplay , DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • PropertyChanged : BluetoothLEDeviceDisplay , Scenario1_Basic , Scenario1_Colors , Scenario1ViewModel , DataModel , Scenario5_DisplayingBarcodePreview
  • propertyChanged : CustomTitleBar
  • PropertyChanged : WiFiNetworkDisplay , Manager , UserViewModel , Scenario5_DisplayingBarcodePreview , YangContainer
  • propertyChanged : DiscoveredDevice
  • PropertyChanged : RfcommChatDeviceDisplay , WordOverlay , CustomTitleBar , sealed , Scenario1 , RadioModel , DeviceInformationDisplay , WordOverlay , Scenario1_Colors , UserViewModel , DiscoveredDevice , sealed , ServiceViewModel , Trip , DeviceInformationDisplay , BluetoothLEDeviceDisplay , PlayerViewModel , RadioModel , DownloadOperationItem , PlaybackSessionViewModel , MediaItemViewModel , Scenario5_DisplayingBarcodePreview , Scenario1_Basic , Scenario2ViewModel , ViewLifetimeControl , SettingsViewModel , Scenario1ViewModel , MyUserControl1 , BluetoothLEDeviceDisplay , HeroArticlesViewModel , ViewModelBase , PlaylistView , ViewLifetimeControl , ViewModelBase , CustomTitleBar , ImportableItemWrapper
  • propertyChanged : RadioModel
  • PropertyChanged : CustomTitleBar , DeviceInformationDisplay , UserViewModel , sealed , Scenario1_Basic , Scenario2ViewModel , sealed , Scenario1_Colors , ViewModelBase , DiscoveredDevice , WordOverlay , RadioModel , BindableBase , ViewLifetimeControl , DiscoveredDevice
  • PropertyChangedHandler() : AllJoynHelpers
  • PropertyGetHandler() : AllJoynHelpers
  • PropertyName : IsApiPropertyPresentTrigger
  • propertyPresence : IsApiPropertyPresentTrigger
  • propertySet : AudioEchoEffect
  • PropertySetHandler() : AllJoynHelpers
  • Props : RequiredDeviceProperties
  • ProtectAsyncBuffer_Click() : Scenario6
  • ProtectAsyncFile_Click() : Scenario4
  • ProtectAsyncFileStatus_Click() : Scenario4
  • ProtectDataAsync() : SetCardDataScenario
  • ProtectedAccessResumed() : EdpBackgroundTask
  • ProtectedAccessSuspending() : EdpBackgroundTask
  • protectedBuffer : Scenario2_Memory
  • ProtectedContentRevoked() : Scenario5
  • ProtectionLevel : sealed
  • protectionLevel : ProtectionLevelSelectorInfo
  • ProtectionLevel : ProtectionLevelSelectorInfo
  • ProtectionLevelSelectorInfo() : sealed , ProtectionLevelSelectorInfo
  • protectionManager : ViewModelBase
  • ProtectionManager : ViewModelBase
  • ProtectionManager_ComponentLoadFailed() : PlayReadyHelper
  • ProtectionManager_ServiceRequested() : PlayReadyHelper
  • ProtectL1_Click() : Scenario1_Files , Scenario2_Memory
  • ProtectL2_Click() : Scenario1_Files , Scenario2_Memory , Scenario1_Files
  • ProtectStreamAsync_Click() : Scenario7
  • Protocol : Scenario4_ReceiveUri , SocketWrapper , Constants
  • Protocol_SelectionChanged() : sealed , Scenario3_CredentialPickerOptions
  • ProtocolInterfaceA : AtrInfo
  • ProtocolInterfaceB : AtrInfo
  • ProtocolInterfaceC : AtrInfo
  • ProtocolInterfaceD : AtrInfo
  • ProtocolLaunch_Click() : SecondaryViewPage
  • providePasswordCredential : Scenario9_CustomPairDevice
  • providePasswordCredentialSrc : sealed
  • providePasswordCredentialTaskSrc : Scenario9_CustomPairDevice
  • providePinTaskSrc : sealed , Scenario9_CustomPairDevice
  • Provider() : sealed , Provider
  • provider : BarcodeDecodeTask
  • PROVIDER_ID_SUBCONTAINER : sealed
  • ProviderIdSubContainer : MultipleAccountsScenario
  • ProvideUpdatedVersionButton_Click() : CachedFileUpdater_Local
  • ProvisionButton_Click() : Scenario1_Initialization
  • provisioningInfo : Scenario3
  • ProvisioningInfo : sealed , SessionRequestWrapper
  • provisioningPackageFile : Scenario1
  • ProximitySensorBackgroundTask() : sealed
  • pSample : MFSampleGenerator
  • PtFromPx() : sealed , Scenario2
  • Ptr : ComPtrList< T, NULLABLE >
  • PubDate : VideoMetaData
  • PublicKey : RegisterMessage , DAL::RegisteredUser
  • PublicKeyHash : DAL::RegisteredUser
  • publicKeyHint : MainPage
  • PublicKeyHint : UserAndKeyHintMessage , SignatureMessage
  • PublishButton_ClickAsync() : Scenario3_ServerForeground
  • publisher : Scenario2_Connector , Scenario2_Publisher
  • publisherCert : SecureStopViewModel
  • publisherID : SecureStopViewModel
  • publishTime : Manifest
  • PublishTime : Manifest
  • PurchaseAddOnButton_Click() : sealed , Scenario4_ConsumableProduct , sealed , Scenario3_UnmanagedConsumable , sealed , Scenario2_InAppPurchase
  • PurchaseFullLicense() : Scenario1_TrialMode , sealed
  • PurpleButton_Click() : sealed
  • PushBackSegment() : MediaStream
  • PushFrontSegment() : MediaStream
  • put() : unique_cotaskmem_ptr< T >
  • put_Length() : CMediaBufferWrapper
  • pvb : Scenario05 , Scenario06
  • Pvb_ProjectionStopping() : Scenario06 , Scenario05
  • PxFromPt() : sealed , Scenario2
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- q -

  • qpcFrequency : StepTimer
  • qpcLastTime : StepTimer
  • qpcMaxDelta : StepTimer
  • qpcSecondCounter : StepTimer
  • QuadPart : LARGE_INTEGER
  • QuadRenderer() : QuadRenderer
  • QueryCount : GpuPerformanceTimer
  • QueryCp_Click() : Scenario14_QueryCpPaste
  • QueryCurrentNetworkConnectivityButton_Click() : Scenario1_NetworkConnectivity
  • QueryInterface() : CMarker , CSourceOperation , SceneComposer , CBufferEnumerator , CBufferPacket , AsyncCallback< T > , CMediaSource , Listener , FilmicEffect , CStreamSink::CAsyncOperation , LuminanceHeatmapEffect , DftTransform , ReinhardEffect , SdrOverlayEffect , DftEffect , CMediaStream , RippleEffect , WaveEffect , CustomTextRenderer , EmbeddedMFAsyncCallback< Callback > , CStreamSink , FontNameCollector
  • QueryResult_ContentsChanged() : FileDataSource , FileDataSource2 , FileDataSource
  • QueueAsyncOperation() : CStreamSink
  • QueueEvent() : CMediaSource , CMediaStream , CStreamSink
  • QueueOperation() : OpQueue< T, TOperation >
  • QuickLinkSectionLabel_Tapped() : ShareTarget , Scenario13_ShareTarget
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- r -

  • r : Print3D , Vector2< T > , Vector4< T >
  • R : ColorBGRA
  • r : Vector3< T >
  • radialDistortion : GpuCoordinateMapper::CameraIntrinsics
  • RadianceWattPerSquareMetreSteradian : PresentationFormats
  • RadiantintensityWattPerSteradian : PresentationFormats
  • radio : RadioModel
  • Radio_StateChanged() : RadioModel
  • radioFile_Checked() : Scenario3 , sealed , Scenario2
  • RadioModel() : RadioModel
  • radioTone_Checked() : sealed , Scenario2 , Scenario3
  • Radius() : Sphere
  • radius : sealed , Scenario8
  • RadiusSlider_ValueChanged() : sealed
  • RaiseCanExecuteChanged() : sealed , RelayCommand
  • RaiseDeviceChanged() : DeviceWatcherHelper , sealed
  • RaisePropertyChanged() : MediaItemViewModel , PlaybackSessionViewModel , PlayerViewModel , SettingsViewModel , PlaylistView , Scenario5_DisplayingBarcodePreview , Scenario1 , ViewModelBase , UserViewModel
  • RaisePropertyChangedEventAsync() : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • RaiseToastAfterDelay() : sealed , MultipleTasks
  • rand : Conversation
  • random : Contact
  • randomAccessStream : sealed , Scenario5_RandomAccess
  • randomNumberGenerator : RandomNumberGeneratorTask
  • RandomNumberGeneratorTask() : RandomNumberGeneratorTask
  • RangesChanged() : FileDataSource , FileDataSource2
  • raStream : ScenarioContext
  • RBitMask : DDS_PIXELFORMAT
  • ReactiveIndividualization() : PlayReadyHelpers
  • ReactiveIndividualizationRequestAsync() : PlayReadyHelper
  • ReactiveLicenseAcquisition() : PlayReadyHelpers
  • ReactiveViewModel() : ReactiveViewModel
  • Read() : Read
  • read_bytes : PipeEvents
  • Read_Local_Counter() : Scenario1_Files
  • Read_LocalCache_Counter() : Scenario1_Files
  • Read_Temporary_Counter() : Scenario1_Files
  • ReadAndWrite() : sealed , Scenario3_XmlWriterLite
  • ReadAsBufferAsync() : HttpJsonContent
  • ReadAsInputStreamAsync() : HttpJsonContent
  • ReadAsStringAsync() : HttpJsonContent
  • ReadAsync() : PipeIn , Scenario3_ReadWrite , SlowInputStream , AccessHandler , Scenario2_LEDTemp
  • ReadAttributes() : sealed , Scenario1_XmlReader
  • ReadBinary() : ReadBinary
  • ReadBlock_Click() : sealed , DeviceReadWrite
  • ReadButton_Click() : Scenario3_ReadWrite
  • ReadBytes() : sealed , ReadBytes
  • ReadBytesButton_Click() : sealed , Scenario4
  • ReadBytesCounter : Scenario3_ReadWrite
  • ReadCancelButton_Click() : Scenario3_ReadWrite
  • readCancellationTokenSource : sealed , Scenario5_RandomAccess
  • ReadCancellationTokenSource : Scenario3_ReadWrite , Scenario2_LEDTemp
  • ReadCancelLock : Scenario3_ReadWrite , Scenario2_LEDTemp
  • ReadCardDetailsAsync() : AccessHandler
  • ReadChunk() : ReadStreamTask::ReadStreamTaskImpl
  • readCounter : sealed , DeviceReadWrite
  • ReadData() : BasicReaderWriter
  • ReadDataAsync() : BasicReaderWriter , AccessHandler
  • reader : RfcommServerTask , FrameSourceState , sealed , Scenario1_ProvisionTPM , Scenario6_DeleteTPM , SocketWrapper
  • Reader_FrameArrived() : sealed , Scenario2_FindAvailableSourceGroups
  • ReaderKeyNumber : LoadKeys
  • ReaderName : SmartCardListItem
  • ReaderState : MFSampleGenerator
  • ReaderStateEOS : MFSampleGenerator
  • ReaderStatePlaying : MFSampleGenerator
  • ReaderStatePreRoll : MFSampleGenerator
  • ReaderStateStopped : MFSampleGenerator
  • ReadFromStreamButton_Click() : sealed , Scenario5
  • ReadingChanged() : sealed , Scenario1_DataEvents , Scenario5_DataEventsBatching , sealed , Scenario3_ChangeEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_BackgroundTask , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • ReadingChangedOriginal() : sealed
  • ReadingChangedReadingTransform() : sealed
  • readingToken : sealed
  • readingTokenOriginal : sealed
  • readingTokenReadingTransform : sealed
  • ReadInterruptMessagesAsync() : DeviceEvents
  • ReadLoop() : sealed
  • ReadMessage() : sealed
  • ReadMessageAsync() : SocketReaderWriter
  • ReadOneReadingFromSensorAsync() : Scenario3_Choosing
  • ReadOnlyTextBox_ContextMenuOpening() : sealed , Scenario2
  • readOperation : sealed , Scenario5_RandomAccess
  • ReadRecordAsync() : AccessHandler
  • ReadStreamAsync() : sealed
  • ReadStreamTask() : ReadStreamTask
  • ReadStreamTaskImpl() : ReadStreamTask::ReadStreamTaskImpl
  • ReadSwitches : Fx2Driver
  • ReadTextButton_Click() : sealed , Scenario3
  • ReadTimeoutButton_Click() : Scenario3_ReadWrite
  • ReadXml() : sealed , Scenario1_XmlReader
  • ReadXmlClick() : sealed , Scenario1_XmlReader
  • RealizeElements_Click() : BasicDeferral
  • RealtimeSurfaceMeshRenderer() : RealtimeSurfaceMeshRenderer
  • ReceiptView() : ReceiptView
  • Receive() : CMediaSource
  • ReceiveAsync() : CNetworkChannel , abstract
  • ReceiveDataAsync() : RfcommServerTask , Scenario2_Binary
  • ReceiveDataLoop() : sealed
  • ReceivedDate : Email
  • ReceiveMessageAsync() : sealed , SocketWrapper
  • ReceiveStringLoop() : Scenario1_ChatClient , sealed
  • RecoButton_Click() : Scenario4
  • recognitionOperation : Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • Recognize_Click() : sealed , Scenario_PauseAsync
  • recognizer : sealed , Scenario5 , ManipulationInputProcessor
  • RecognizeTextLanguages() : LinguisticServices
  • RecognizeTextScripts() : LinguisticServices
  • RecognizeWithoutUI_Click() : sealed , Scenario_SRGSConstraint
  • RecognizeWithoutUIDictationGrammar_Click() : sealed , Scenario_PredefinedDictationGrammar
  • RecognizeWithoutUIListConstraint_Click() : sealed , Scenario_ListConstraint
  • RecognizeWithoutUIWebSearchGrammar_Click() : sealed , Scenario_PredefinedWebSearchGrammar
  • RecognizeWithUI_Click() : sealed , Scenario_SRGSConstraint
  • RecognizeWithUIDictationGrammar_Click() : sealed , Scenario_PredefinedDictationGrammar
  • RecognizeWithUIListConstraint_Click() : sealed , Scenario_ListConstraint
  • RecognizeWithUIWebSearchGrammar_Click() : sealed , Scenario_PredefinedWebSearchGrammar
  • RecolorSubtree() : D2DSvgImageRenderer
  • RecolorSvg() : D2DSvgImageRenderer
  • recordCollection : sealed
  • Recording : MediaCaptureManager
  • recordingStarted : CaptureDevice
  • RecordStopButton_Click() : Scenario2_DeviceCapture
  • recordTimestamp : HistoryRecord
  • recoView : sealed , Scenario4
  • rect : RectRenderer
  • Rectangle() : Rectangle
  • RectRenderer() : RectRenderer
  • rectSize : RectRenderer
  • rectTransform : RectRenderer
  • RedEyeFlashCheckBox_CheckedChanged() : MainPage
  • ReduceMemoryUsage() : App
  • ReencodeAndSavePhotoAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • refCount : ViewLifetimeControl , sealed
  • reference : sealed , ManipulationInputProcessor
  • referenceFrame : HolographicApp1Main
  • RefractiveIndex : PresentationFormats
  • RefreshButton_Click() : sealed , Scenario1_SelectDisplay
  • RefreshControlsFromGeofence() : Scenario4_ForegroundGeofence
  • refreshMapIcons() : sealed , Scenario7
  • RefreshPreview() : sealed
  • RefreshScaleFactor() : DeviceResources
  • RefreshSize() : ShapeRenderer
  • RefreshStatics() : PlayReadyInfoViewModel
  • RefreshTimer_Tick() : sealed , Scenario1_DeviceUse
  • RefreshWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Refuse() : sealed
  • Register() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftEffect , RippleEffect , WaveEffect , AuthenticationController
  • Register_Click() : Scenario15_DPLCreateFileEvents , RegisterWithBackgroundTask
  • RegisterAidGroup() : NfcUtils
  • RegisterBackgroundTask() : sealed , Scenario4_BackgroundActivity , BackgroundTaskSample , sealed , BackgroundTaskSample , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , BackgroundTaskSample , sealed , BackgroundTaskSample , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , Scenario3_BackgroundDeviceWatcher , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioElement , sealed , Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor
  • RegisterBackgroundTaskAsync() : FileSavePicker_SaveToCachedFile
  • RegisterBtn_Click() : sealed , Scenario3_AvailabilityChanged
  • RegisterButton_Click() : Scenario1_Initialization , Scenario1_Events
  • RegisterClipboardContentChanged_Click() : OtherScenarios
  • registerContentChanged : OtherScenarios
  • RegisterCustomTrigger_Click() : sealed , CustomTrigger
  • RegisterDependencyProperties() : DetailPage
  • RegisterDependencyPropertiesOnce() : EdgeTappedListView
  • RegisterDeviceNotify() : DeviceResources
  • registered : sealed , Scenario4_BackgroundActivity , Scenario4_BackgroundProximitySensor
  • registeredCharacteristic : Scenario2_Client
  • RegisteredCompletionHandlerForBackgroundTask() : ScenarioCommon
  • registeredDevice : sealed , InputReportEvents
  • registeredForEvents : sealed , Scenario1_Events
  • registeredInterrupt : Scenario3_InterruptPipes
  • registeredInterruptPipeIndex : Scenario3_InterruptPipes
  • RegisterEventHandlers() : sealed , Provider , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • RegisterForAdaptiveMediaSourceEvents() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning
  • RegisterForAppEvents() : sealed , EventHandlerForDevice
  • RegisterForBoundaryEvents() : sealed
  • RegisterForDeviceAccessStatusChange() : sealed , EventHandlerForDevice
  • RegisterForDeviceWatcherEvents() : sealed , EventHandlerForDevice
  • RegisterForDiscreteControls() : Scenario7_LiveSeekableRange
  • RegisterForEvents() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • RegisterForInputReportEvents() : sealed , InputReportEvents
  • RegisterForInputReportEvents_Click() : sealed , InputReportEvents
  • RegisterForInterruptEvent() : Scenario3_InterruptPipes
  • RegisterForMarkEvents() : sealed , Scenario_SynthesizeSSML
  • RegisterForMediaPlaybackItemEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterForMediaSourceEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterForPositionUpdateControls() : Scenario7_LiveSeekableRange
  • RegisterForPrinting() : PrintHelper
  • RegisterForWordBoundaryEvents() : Scenario_SynthesizeTextBoundaries
  • RegisterFrame() : SuspensionManager
  • RegisterGlobalFilters() : FilterConfig
  • RegisterGroupedBackgroundTask() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • RegisterMetadataHandlerForMarks() : sealed , Scenario_SynthesizeSSML
  • RegisterMetadataHandlerForSentences() : sealed , Scenario_SynthesizeTextBoundaries
  • RegisterMetadataHandlerForWords() : sealed , Scenario_SynthesizeTextBoundaries
  • RegisterMetadataHandlers() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterNetworkStatusChanged() : Scenario3_NetworkConnectivityChanges
  • RegisterOsrFx2InterruptEvent_Click() : Scenario3_InterruptPipes
  • RegisterPassportCredentialWithServerAsync() : EnableHelloPage
  • RegisterRoutes() : RouteConfig
  • RegisterSuperMuttInterruptEvent_Click() : Scenario3_InterruptPipes
  • RegisterTasks_Click() : Scenario1_ManageHotspot
  • RegisterUnregisterButton_Click() : Scenario3_NetworkConnectivityChanges
  • RegisterUser() : DAL
  • RegisterWithBackgroundTask() : RegisterWithBackgroundTask
  • ReinhardEffect() : ReinhardEffect
  • RelativePermeability : PresentationFormats
  • RelayCommand() : RelayCommand
  • Release() : SceneComposer , Listener , FontNameCollector
  • ReleaseAll_Click() : sealed , Scenario1_FindClaimEnable
  • ReleaseAllDeviceResources() : CameraResources
  • ReleaseAllPrinters() : MainPage
  • ReleaseBusObject() : AllJoynBusObjectManager
  • ReleaseButton1_Click() : sealed , Scenario3_MultipleDrawers
  • ReleaseButton2_Click() : sealed , Scenario3_MultipleDrawers
  • ReleaseClaim_Click() : sealed , Scenario1_FindClaimEnable
  • ReleaseClaimedPrinter() : MainPage
  • Released() : ViewLifetimeControl
  • released : ViewLifetimeControl , sealed
  • Released : ViewLifetimeControl
  • ReleaseDeviceDependentResources() : VideoRenderer , SpinningCubeRenderer , CameraCoordinateMapper , GpuCoordinateMapper , QuadRenderer , TextRenderer , D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , SampleOverlay , CustomPixelShaderRenderer , SampleOverlay , CustomVertexShaderRenderer , SampleOverlay , D2DGradientMeshRenderer , SampleOverlay , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererRenderer , SampleOverlay , Resource , NV12VideoTexture , QuadRenderer , SpinningCubeRenderer , TextRenderer , ControlBase , Cursor , IControl , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , final , SceneController , SceneObject , DistanceFieldRenderer , QuadRenderer , TextRenderer , SpinningCubeRenderer , RectRenderer , GameHud , GameInfoOverlay , GameRenderer , GameHud , GameInfoOverlay , GameRenderer , GameHud , GameRenderer , RenderingHelper
  • releaseDeviceRequestedToken : MainPage , sealed
  • releasedToken : sealed
  • ReleaseHandle()
: SubjectPublicKeyInfo::SafeBCryptKeyHandle
, SubjectPublicKeyInfo::SafeLocalAllocHandle
  • ReleaseImageDependentResources() : D2DAdvancedColorImagesRenderer
  • ReleaseMarshalData() : CMediaBufferWrapper
  • releaseRequestedToken1 : sealed
  • releaseRequestedToken2 : sealed
  • ReleaseResourcesForBackBuffer() : CameraResources
  • ReleaseVertexResources() : final
  • ReloadManifest() : LiveSourceBufferManager , Player
  • RemapSelection() : FileDataSource2
  • ReminderCheckBox_Checked() : Scenario1_Define
  • ReminderCheckBox_UnChecked() : Scenario1_Define
  • remoteDevice : RfcommServerTask
  • RemotePeer() : RemotePeer
  • RemoteSystemWatcher_RemoteSystemAdded() : Scenario1_Discovery
  • RemoteSystemWatcher_RemoteSystemRemoved() : Scenario1_Discovery
  • RemoteSystemWatcher_RemoteSystemUpdated() : Scenario1_Discovery
  • remoteUrl : sealed
  • RemoteVideo_MediaFailed() : VideoChat
  • Remove() : IncrementalLoadingBase , List< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2
  • remove_BreadBaked() : WrlFinal
  • Remove_Click() : Scenario4_Remove
  • Remove_Defaults() : Scenario2_SystemDefaultMenu
  • RemoveAccountData() : SingleAccountScenario
  • RemoveAdvertiser() : sealed , Scenario2 , WiFiDirectServiceManager
  • RemoveAndDispose< T >() : Disposer
  • RemoveAt() : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • RemoveAtEnd() : GroupInfoList
  • RemoveBack() : List< T >
  • RemoveBackgroundTaskStatus() : BackgroundTaskSample
  • RemoveBuffer() : CBufferPacket
  • RemoveCredentials_Click() : sealed , Scenario2_Manage
  • RemoveCustomItem() : Scenario2_SystemDefaultMenu
  • RemoveCustomProviders() : sealed
  • RemoveCustomTitleBar() : MainPage , SampleState , MainPage
  • RemoveDevice() : SourceGroupCollection
  • RemoveDeviceAsync() : sealed
  • RemoveDeviceFromList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • RemoveFeedButton_Click() : sealed
  • RemoveFileButton_Click() : FileOpenPicker_PickCachedFile
  • RemoveFolderButton_Click() : sealed , Scenario3
  • RemoveFront() : List< T >
  • RemoveHolographicCamera() : DeviceResources
  • RemoveInternalFocus() : CustomEditControl
  • RemoveInternalFocusWorker() : CustomEditControl
  • RemoveItem() : MediaListViewModel , sealed , Scenario1_EventAndMenuHookup , List< T > , ComPtrList< T, NULLABLE > , Scenario4_EdgeTappedListView
  • RemoveJumpList_Click() : sealed , Scenario2_Remove
  • RemoveLocalFileButton_Click() : FileOpenPicker_PickAppFile
  • RemoveMemberFromSession() : sealed
  • RemovePrefix_Click() : sealed , Scenario1
  • RemoveRegisteredKey() : AuthenticationController , DAL
  • RemoveSelectedStrokesFromSceneObjects() : SceneComposer
  • RemoveSession() : sealed , Scenario2 , Scenario4 , WiFiDirectServiceManager
  • RemoveSessionRequest() : sealed , Scenario2 , WiFiDirectServiceManager
  • RemoveSocket() : sealed , Scenario5
  • RemoveStreamSink() : CMediaSink
  • RemoveSurface() : RealtimeSurfaceMeshRenderer
  • RemoveTabStops() : TransportOptions
  • RemoveTestFiles() : Scenario3_ReceiveFile
  • RemoveToDispose< T >() : Disposer
  • RemoveUriFileButton_Click() : FileOpenPicker_PickURLFile
  • RemoveValueChangedHandler() : Scenario2_Client
  • RenameButton_Click() : CachedFileUpdater_Remote
  • Render() : _360VideoPlaybackMain , BaseControl , BaseElement , Text , Line , Ellipse , FilledEllipse , Rectangle , FilledRectangle , MediaTransportControls , VideoRenderer , _360VideoPlaybackMain , VideoRenderer , HolographicApp1Main , BasicHologramMain , SpinningCubeRenderer , BasicHologramMain , SpinningCubeRenderer , HolographicTemplateAppMain , SpinningCubeRenderer , CameraStreamCoordinateMapperMain , QuadRenderer , TextRenderer , sealed , InkRenderer , SceneComposer , ShapeRenderer , CustomComputeShaderMain , CustomComputeShaderRenderer , SampleOverlay , CustomPixelShaderMain , CustomPixelShaderRenderer , SampleOverlay , CustomVertexShaderMain , CustomVertexShaderRenderer , SampleOverlay , D2DGradientMeshMain , D2DGradientMeshRenderer , SampleOverlay , DWriteColorTextRendererMain , DWriteColorTextRendererRenderer , SampleOverlay , SpinningCubeRenderer , HolographicFaceTrackerMain , ControlBase , Cursor , IControl , SpinningCubeRenderer , HolographicMRCSampleMain , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , SceneController , SceneObject , HolographicSpatialStageMain , QuadRenderer , HolographicTagAlongSampleMain , SpinningCubeRenderer , HolographicVoiceInputMain , RectRenderer , LowLatencyInputMain , GameHud , GameRenderer , GameObject , MeshObject , GameHud , GameRenderer , GameHud , GameRenderer , Stroke , Tool , ClearTool , sealed , HolographicPaintMain , SourceHandler
  • RenderBuffer() : RenderBuffer
  • RenderDistanceField() : DistanceFieldRenderer
  • RenderingHelper() : RenderingHelper
  • RenderInternal() : QuadRenderer
  • renderLoopWorker : LowLatencyInputMain
  • RenderNV12() : QuadRenderer
  • RenderObjects() : Simple3DGame
  • RenderOffscreenTexture() : HolographicTagAlongSampleMain
  • RenderOptionsViewModel() : sealed
  • RenderPropertyPopUp() : sealed , Scenario2
  • RenderRGB() : QuadRenderer
  • RenderSetup() : Material
  • renderTarget : GpuCoordinateMapper::VisualizeFrameBlob
  • renderTargetDepthBuffer : GpuCoordinateMapper::VisualizeFrameBlob
  • RenderTargetSize : CameraResources
  • RenderTextOffscreen() : TextRenderer
  • RenewActiveLicense() : SecureStopViewModel
  • reorderGroup : sealed , Scenario7_DownloadReordering
  • repeatPlaylist : Scenario1
  • Replace_Click() : Scenario3_Replace , ScenarioElement
  • ReplaceAll() : GroupInfoList
  • ReplaceLastBackStackEntryParameter() : DetailPage
  • ReplaceQueryString() : Helpers
  • ReplaceText() : CustomEditControl
  • ReportCalendarData() : sealed , Scenario1_Data , Scenario2_Stats , Scenario4_UnicodeExtensions , Scenario5_TimeZone
  • ReportCapabilityAsync() : Scenario5_Capabilities
  • ReportColors() : sealed
  • ReportCompleted_Click() : Scenario13_ShareTarget , ShareTarget
  • ReportContactResult() : sealed , Scenario1_Single
  • ReportContactResults() : sealed , Scenario2_Multiple
  • ReportDataRetrieved_Click() : Scenario13_ShareTarget , ShareTarget
  • ReportEndOfStream() : CMediaSink
  • ReportErrorButton_Click() : Scenario13_ShareTarget , ShareTarget
  • ReportFormatChange() : CMediaSink
  • ReportId
: SuperMutt::LedPattern
, SuperMutt::ReadWriteBufferControlInformation
, SuperMutt::DeviceInputReportControlInformation
  • ReportLanguageData() : sealed , Scenario2_Lang
  • ReportPlotDataReady() : PlotDataSourceT< D >
  • ReportProtectedBuffer() : Scenario2_Memory
  • ReportRegionData() : sealed , Scenario3_Region
  • ReportSavedStatus() : MainPage
  • ReportsDict : Manager
  • ReportsEnum : Manager
  • ReportsList : Manager
  • ReportsOC : Manager
  • ReportStarted_Click() : Scenario13_ShareTarget
  • ReportStatus() : Scenario1_Files
  • ReportSubmittedBackgroundTask_Click() : Scenario13_ShareTarget
  • RepositionFaces() : MainPage
  • RepresentationID : MediaSegmentInformation
  • representationID : MediaSegmentInformation
  • RequestAccessButton_Click() : Scenario1_ChatClient , Scenario2_RequestMany
  • RequestAndStartProjecting_Click() : Scenario2 , sealed
  • RequestCalibration() : CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • RequestChallenge() : AuthenticationController
  • RequestConcatenate : Scenario1ViewModel
  • RequestConsent_Click() : sealed , Scenario2_RequestConsent
  • requestCount : PhotosPrintHelper
  • requestInProgress : ItemCacheManager< T >
  • requestList : AdvertisementWrapper
  • RequestMicrophonePermission() : AudioCapturePermissions
  • RequestMicrophonePermissionAsync() : sealed
  • RequestPairDeviceAsync() : ConnectionSettingsPanel
  • RequestResponse() : RequestResponse
  • requests : ItemCacheManager< T >
  • RequestSample() : CMediaStream
  • RequestTextLayoutUpdate() : sealed
  • RequestTokenAndSaveAccount() : SingleMicrosoftAccountScenario , SingleAzureADScenario
  • RequestToSendEnabledToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • RequiredDeviceProperties() : RequiredDeviceProperties
  • reserved1 : DDS_HEADER
  • reserved2 : DDS_HEADER
  • ReservedForFutureUse : PresentationFormats
  • Reset() : GameTimer , BasicTimer , sealed , ManipulationInputProcessor , sealed , BasicTimer , sealed , DeviceWatcherHelper , CBufferEnumerator , CMediaBufferWrapper , sealed , ConnectionSettingsPanel
  • Reset_Click() : sealed , Scenario1_GetDeviceInformation , sealed , PhasingTests
  • Reset_ToDefault() : Scenario2_SystemDefaultMenu
  • ResetButton_Click() : Scenario5_DefiningCustomGlyphs
  • resetButton_Click() : Scenario3_SendMIDIMessages
  • ResetButton_Click() : sealed , Scenario6_ManipulatingCursorAttributes
  • resetButton_Pressed() : sealed , Scenario4 , Scenario5
  • ResetButton_Pressed() : sealed
  • ResetButtonClick() : sealed
  • ResetCancellationTokenSource() : Scenario4_BulkPipes
  • ResetCollection() : FileDataSource2 , FileDataSource
  • ResetControls() : Scenario2ViewModel
  • ResetDropTime() : CMediaStream
  • ResetElapsedTime() : StepTimer
  • ResetFields() : Scenario07_PostStreamWithProgress , sealed , Scenario1
  • ResetGame() : GameMain
  • ResetItems() : MainPage
  • ResetLicenseFromFile() : sealed
  • ResetMainUI() : Scenario1_ChatClient
  • ResetMessageTypeAndParameters() : Scenario3_SendMIDIMessages
  • ResetOutput() : MainPage , sealed , Scenario1 , Scenario2 , Helpers
  • ResetPersistedState() : Scenario1 , Scenario2
  • ResetPhotoAdjustmentValues() : sealed
  • ResetPin_Click() : sealed , Scenario3_ResetPIN
  • ResetPosition() : QuadRenderer
  • ResetReadCancellationTokenSource() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • ResetRect() : sealed , RectRenderer , LowLatencyInputMain
  • ResetScenarioState() : Scenario1_OpenDrawer , sealed , Scenario2_CloseDrawer , Scenario3_MultipleDrawers
  • ResetSessionState() : Scenario2 , Scenario1
  • ResetState() : sealed , PlaybackPage , MoveLookController
  • ResetTexCoordScaleAndOffset() : QuadRenderer
  • ResetTheScenarioState() : sealed , Scenario2_AamvaCards , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , sealed , Scenario1_BankCards
  • ResetUI() : Scenario2_MultipleScanners
  • ResetValuesClick() : sealed , BasicTests , Functions , ListsAndTemplates , OtherBindings
  • ResetWriteCancellationTokenSource() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • ResizeArray() : Write
  • ResizeView_Click() : Scenario1_Basic , sealed
  • ResolvePadding() : DashManifestParser
  • Resource() : Resource
  • resourceDimension : DDS_HEADER_DXT10
  • resourceMap : sealed
  • ResponseData : ApduResponse
  • ResponseStatus : TransparentExchangeResponse
  • Restart() : CStreamSink
  • RestartWatcher() : sealed , Scenario1_SelectDisplay
  • RestoreAsync() : SuspensionManager
  • RestoreDataFromPersistedState() : Scenario2 , Scenario1
  • RestoreDefaultStrokeSize() : SceneComposer
  • RestoreFrameNavigationState() : SuspensionManager
  • RestoreScrollPosition() : sealed , Scenario1_Basic
  • RestoreStateAsync() : ExtendedSplash
  • resultCharacteristic : Scenario3_ServerForeground
  • ResultCharacteristic_ReadRequestedAsync() : Scenario3_ServerForeground
  • ResultCharacteristic_SubscribedClientsChanged() : Scenario3_ServerForeground
  • resultCharacteristicClientsChangedToken : Scenario3_ServerForeground
  • resultCharacteristicReadToken : Scenario3_ServerForeground
  • ResultCharacteristicUuid : Constants
  • resultCollection : sealed , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario9_CustomPairDevice , DeviceWatcherHelper , Scenario1_DevicePicker , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • ResultCollection : Scenario1_ChatClient , sealed , Scenario1_CachedNetworks , Scenario2_Scan , Scenario3_RegisterForUpdates , Scenario4_Connect
  • resultCollection : Scenario7_DeviceInformationKind , Scenario2_DeviceWatcher , Scenario8_PairDevice
  • ResultsListView_SelectionChanged() : Scenario1_ChatClient , sealed , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario4_Connect , sealed , Scenario8_PairDevice
  • resultVal : Scenario3_ServerForeground
  • Resume() : GameMain
  • ResumeAll_Click() : sealed , Scenario1_Download
  • ResumeAudio() : Audio
  • ResumeDeviceWatcher() : DeviceList
  • ResumeDownload_Click() : Scenario5_RandomAccess , sealed
  • ResumeLoggingIfApplicable() : sealed , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario
  • ResumeMeteringService() : ServiceViewModel
  • RETRIES : Downloader
  • RetriesPropertyName : HttpRetryFilter
  • RetrieveAllItems_Click() : sealed , S3_RetrieveWithAPI , S7_RetrieveWithAppContent , sealed
  • RetrieveAppContentHelper() : S7_RetrieveWithAppContent
  • RetrieveCredentials_Click() : Scenario2_Manage
  • RetrieveMatchedItems_Click() : sealed , S7_RetrieveWithAppContent
  • RetrieveMatchingItems_Click() : S3_RetrieveWithAPI , sealed
  • RetryAfterSwitch_Toggled() : Scenario13_RetryFilter
  • RetryDownloadsAsync() : sealed , CompletionGroupTask
  • RevealPasswords_Click() : sealed , Scenario2_Manage
  • reverbEffectDefinition : Scenario5_InboxEffects
  • ReverbEffectToggle_Toggled() : Scenario5_InboxEffects
  • Revoke_Click() : Scenario5
  • RfcommChatDeviceDisplay() : RfcommChatDeviceDisplay
  • RfcommChatServiceUuid : Constants
  • rfcommProvider : Scenario2_ChatServer
  • RGBBitCount : DDS_PIXELFORMAT
  • RichEditBoxSetError() : Scenario
  • RichEditBoxSetMsg() : Scenario
  • RichEditBoxSetText() : Scenario
  • right : ElementMargin
  • RightEyeProjection() : Camera
  • RippleEffect() : RippleEffect
  • roamingEnabledToken : HistoryAndRoaming
  • Role : sealed
  • roleIsActive : VideoChat
  • RollSlider_ValueChanged() : sealed
  • rootFrame : ExtendedSplash
  • RootFrameNavigationHelper() : RootFrameNavigationHelper
  • rootFrameNavigationHelper : App
  • RootFrameNavigationHelper() : RootFrameNavigationHelper
  • rootPage : Scenario4_OrientationChanged , OcrCapturedImage , Scenario6 , Scenario6_ManipulatingCursorAttributes , Scenario3_SendMIDIMessages , Scenario5_DataEventsBatching , Scenario1_ParseAndStringify , GetConnectionProfiles , Scenario03 , Scenario4_AddOverlays , Scenario1_Files , Scenario10_UnviewableContent , Scenario2_DeviceCapture , Scenario09_GetCookie , Scenario3_AspectRatio , CustomCommand , Scenario3_SettingContainer , Scenario1_Print , SingleAzureADScenario , Scenario15_ServerCertificateValidation , Scenario1_BankCards , Scenario1_Download , Scenario4 , Scenario2_Upload , SignIn , Scenario13 , SampleBackgroundTaskWithCondition , Scenario11_DeleteCookie , ApplicationTriggerTask , Scenario1_GetLamp , Scenario4_Submix , Scenario4_CharacterGrouping , SampleBackgroundTask , Scenario1_Basics , Scenario3_Calibration , Scenario6_InterfaceSettings , Scenario3_AvailabilityChanged , Scenario5_Show , Scenario6 , OvenClient , PlaybackControl , Scenario7 , Scenario4_UpdatingLineDisplayAttributes , Scenario1_LaunchFile , Scenario4_ReceiveUri , Scenario2_LaunchUri , Scenario2_DisplayText , Scenario2_Notifications , Scenario1_ListView , Scenario3 , Scenario2_ScriptDetection , Scenario1_Define , Scenario4_Remove , Scenario2_Add , Scenario2_Custom , S3_RetrieveWithAPI , Scenario5 , Scenario2_Polling , Scenario06 , OvenClient , Scenario4 , Scenario1_TrimAndSaveClip , Scenario03_GetList , FeatureReports , Scenario2_ChatServer , Scenario6_RecoverableErrors , Scenario05_PostStream , Scenario4_SymbologyAttributes , BuildNewRss , Scenario1 , Scenario8_UpdateAsync , Scenario1_MIDIDeviceEnumeration , Scenario2_Polling , Scenario1_DetectInPhoto , Scenario2_ConcurrentProfile , ServicingCompleteTask , AccountWatcher , Scenario04 , Scenario4_BackgroundPublisher , sealed , Scenario1_DeviceUse , Scenario3_BackgroundWatcher , Scenario4_BackgroundActivity , Scenario01 , Scenario10 , Scenario6_Recurrence , XmlLoading , Scenario1 , EventHandlerForDevice , Scenario1_ManageHotspot , Scenario1_DataEvents , Scenario9_ClipboardTarget , Scenario2 , Scenario1_CurrentActivity , Scenario1_OpenDrawer , SimCard , Scenario1 , Scenario4_BackgroundPedometer , Scenario1 , Scenario1_Events , Scenario3_CurrentStepCount , sealed , Scenario1_Render , OtherScenarios , Scenario2_Launch , Scenario2_ShakeEvents , Scenario3_InvokeScript , Scenario2_Manage , Scenario2_History , OcrFileImage , Scenario05
  • RootPage : Scenario2_Polling
  • rootPage : sealed , Scenario2_Display , Scenario3_Polling , Scenario3_Add , Scenario1_Create , Scenario5_Clear , ManageCardScenario
  • RootPage : WiFiDirectServiceManager
  • rootPage : Scenario0_Choose , Scenario2_History , Scenario6_NumeralSystemTranslation , Scenario6_CustomEffects , ModemInformation , XSLTTransform , ModemDeviceServices , Scenario1_FilePlayback , Scenario5_InboxEffects , Scenario2_PrintReceipt , Scenario02 , Scenario3_MultipleClaims , Scenario1_FindClaimEnable , Scenario1_CreateTile , Scenario4_CompletionGroups , GiftDispatch , Scenario3_ChangeEvents , SetLockScreenImage , Scenario1_ExtractTextSegments , Scenario2_ConfigureDevice , BroadbandDevice , DefaultCloseCommand , Scenario2_ControlTransfer , Scenario3_ReverseConversion , Scenario2_Prediction , EventHandlerForDevice , Scenario4 , Scenario5_UsbDescriptors , Scenario2_Extend , Scenario1_Conversion , Scenario8_TransmitAPDU , Scenario1_Watcher , Scenario1_CheckConsentAvailability , Scenario3 , Scenario2_GetCurrentTextSegmentFromIndex , Scenario5_NavToFiles , MarkHotProducts , Scenario2 , Scenario3_BackgroundDeviceWatcher , Scenario1_FindUsers , Scenario1_Metrics , Scenario4_Snapshot , Scenario4_ConsumableProduct , Scenario6_CustomFilterAddedProps , ReadBytes , Scenario2_ManageAccount , Scenario1_CreateContacts , Scenario3_AppCapture , RequestResponse , Scenario11_CPDNoUI , Scenario_PauseAsync , Scenario3_Calibration , Scenario3 , Scenario1 , CopyFiles , CopyImage , Scenario1_MultiVideoPlayback , Scenario4_ScriptNotify , Scenario1_Connect , Scenario2_CloseDrawer , DefaultAccountScenario , Scenario1_DataEvents , Scenario2_LEDTemp , SocketReaderWriter , Scenario1_UTF8 , SingleMicrosoftAccountScenario , Scenario3_Trim , Scenario2_MessageCaption , Scenario7_Share , Scenario1ViewModel , Scenario4_SaveFile , Scenario3_Flickr , Scenario2_Twitter , Scenario1 , Scenario4_ChangeAdminKey , Scenario1_Discovery , Scenario_ContinuousDictation , RegisterWithBackgroundTask , Scenario2_BackgroundTask , Scenario1_Initialization , Scenario3_ClientAuthentication , SharePage , Scenario2_Polling , Scenario1_TrackInWebcam , Scenario1_Toggle , Scenario4_BackgroundProximitySensor , Scenario06_PostMultipart , Scenario5_DisplayingBarcodePreview , Scenario1_Advertiser , Scenario04_PostText , VideoChat , Scenario1_BasicFunctionality , Scenario1 , ShowConnection , Scenario14_MeteredConnectionFilter , Scenario2_ReceiveMIDIMessages , Scenario3 , Scenario1_Default , Scenario2_AppendClips , Scenario3_SecondaryTiles , Scenario3_Transliteration , Scenario2 , UserSelect , GroupedBackgroundTask , Scenario1_CachedNetworks , Content , Scenario2_EnableSettings , Scenario10_SetCookie , Scenario3_RegisterForUpdates , WiFiDirectServiceManager , Scenario1_SelectDisplay , OvenClient , sealed , Scenario8 , UnspecifiedReason , Scenario3_ReceiveFile , Scenario2 , Scenario11 , Scenario10_CpToClipboard , KeepConnectionOpenScenario , CustomException , WriteReadStream , Scenario2 , Scenario3_Replace , CustomFocusVisuals , CompletedCallback , Scenario2_Polling , Scenario3_Choosing , CustomTrigger , Scenario3_AddAudioTracks , S7_RetrieveWithAppContent , LocationTrackingReason , CancelCommand , Scenario2_Polling , SingleAccountScenario , Scenario1_Mini , Scenario1 , Scenario1_Single , Scenario2_Multiple , Scenario3_DisplayOnOff , Scenario2_AamvaCards , DeviceConnect , Scenario12 , Scenario1_EventAndMenuHookup , LiveDashPlayer , Scenario3_ReadWrite , CustomException , Scenario1_DataEvents , Scenario7_ScrollingContentUsingMarquee , Scenario9 , Scenario2_Polling , Scenario3_UsingWindows , Scenario14_QueryCpPaste , Scenario4_Connect , Scenario2_UnpinTile , Scenario1_PinTile , Scenario1_DataEvents , OpenCloseConnectionScenario , Scenario2_Scan , Scenario2_Effects , Scenario02_GetStream , Scenario6_SecondaryTileNotification , Scenario5_LaunchedFromSecondaryTile , MultipleAccountsScenario , Scenario3_FrameInput , Scenario7_DownloadReordering , Scenario2_Memory , MultipleTasks , Scenario1_DataEvents , Scenario5_DefiningCustomGlyphs , SavingDataReason , Scenario3 , Scenario12_DisableCookies , Scenario4_TilePinned , Scenario3_EnumerateTiles , LowLatency , Scenario08_PostCustomContent , Scenario1_Welcome , Scenario2_DetectInWebcam , Scenario1 , Scenario5_RandomAccess , Scenario1_Geotag , Scenario1_DataEvents , Scenario3_SingleFolder , ScenarioCommon , Scenario1_DataEvents , Scenario2 , Scenario3_Porting , Scenario4_PartialReadWrite , Scenario1_SetRecordProfile , Scenario2_ChangePIN , Scenario1_Basic , Scenario3_ResetPIN , Scenario5_VerifyResponse , Scenario2_MultiFile , Scenario2_Publisher , Scenario5 , Scenario1_Save , Scenario07_PostStreamWithProgress , Scenario2_Connector , Scenario2_Binary , Scenario01_GetText , Scenario3_ForegroundApp , Scenario3 , Scenario7_B2B , Scenario1_TrialMode , Scenario5_TriggerCFU , Scenario1_ChatClient , Scenario1_AddAccount , Scenario2_RequestConsent , Scenario1_ExampleOperations , Scenario3_EnableHdrProfile , Scenario3_BgChatServer , CustomException , Scenario2_RequestMany , Scenario3_AdaptiveSync , Scenario3_FixAccount , Scenario13_ShareTarget , Scenario2_WatchUsers , Scenario7_ListAllCards , Scenario6_DeleteTPM , Scenario1_CreateContact , Scenario8_ClipboardSource , Scenario1_ProvisionTPM , Scenario4 , S6_DeleteWithAppContent , Scenario5 , TimeTriggeredTask , Scenario9_TransferMediaPlayer2 , Scenario1_Send , DeviceEvents , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_DataEvents , EventHandlerForDevice , S1_GetAFeed , SendTextMessage , DeviceIO , Scenario5 , Scenario3 , Scenario4_BulkPipes , Scenario1 , sealed , Scenario16_NetworkResource , Scenario2_DelayMini , Scenario1_DevicePicker , Scenario2_InAppPurchase , Scenario5_GetSingleDevice , Scenario2_Conditional , Scenario9_CustomPairDevice , Scenario1_Check , Scenario_ContinuousRecognitionSRGSGrammar , Scenario12_ShareData , Scenario3_CheckUserConsentGroup , Scenario8_PairDevice , Scenario7_DeviceInformationKind , Scenario_ContinuousRecognitionListGrammar , S2_UpdateAndDeleteWithAPI , Scenario3_UnmanagedConsumable , Scenario5_UserCollection , Scenario3_CredentialPickerOptions , Scenario4 , Scenario4_ShowView , Scenario7_SyncDevice , Scenario6_AppListingURI , DeviceReadWrite , Scenario3_InterruptPipes , Scenario2 , Scenario1_ConnectDisconnect , sealed , InputReportEvents , InputOutputReports , FirmwareAccess , DeviceConnect , Scenario4_Events , Scenario13_RetryFilter , Scenario1_Message , Scenario2_PhotoSettings , Scenario1_ConnectDisconnect , S4_CheckIndexRevision , S5_AddWithAppContent , S1_AddWithAPI , Scenario2_DeviceWatcher , Scenario3_Full , sealed , Scenario1 , CopyText , HistoryAndRoaming , Scenario3_MultipleDrawers , Scenario1_GetDeviceInformation , Scenario15_DPLCreateFileEvents , Scenario1_Facebook , Scenario7 , Scenario3_Notifications , Scenario1_PreviewSettings , Scenario8_TransferMediaPlayer1 , Scenario2_Client , Scenario3_ServerForeground , Scenario1_SingleFile , Scenario1 , Scenario2 , Scenario1_Configuration , Scenario2_Polling , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , ConnectionSettingsPanel
  • RootPage_OnKeyDown() : Scenario1_Basic
  • RootPage_SizeChanged() : Scenario04
  • RotateLeft_Click() : Scenario2
  • RotatePitch() : sealed
  • RotateRight_Click() : Scenario2
  • RotateYaw() : sealed
  • rotationDegrees : sealed
  • rotationdelta : PlaybackPage
  • rotationGuid : Scenario5_DisplayingBarcodePreview
  • RotationHelper_OrientationChanged() : sealed , MainPage
  • RotationKey : MainPage , sealed , OcrCapturedImage , MainPage , sealed , MainPage , sealed
  • RotationSpeedSlider_ValueChanged() : sealed
  • Round() : FilmicEffect , RippleEffect , ReinhardEffect
  • rpcclient : sealed
  • rpcClient : ServiceViewModel
  • RpcClient : _RPC_CLIENT
  • RpcClientClose() : ServiceViewModel
  • RpcClientInitialize() : ServiceViewModel
  • rpcDataCountOld : sealed , ServiceViewModel
  • Rssi : WiFiNetworkDisplay
  • Run() : ServicingComplete , VisitBackgroundTask , ConnectTask , App , sealed , ProximitySensorBackgroundTask , ToastNotificationQuickReplyTask , IoSyncBackgroundTask , GeofenceBackgroundTask , GameMain , BackgroundDeviceWatcher , sealed , GeofenceBackgroundTask , ConnectTask , AdvertisementWatcherTask , sealed , AuthenticationTask , UpdateMetadataTask , sealed , GameMain , sealed , RandomNumberGeneratorTask , sealed , VisitBackgroundTask , sealed , SocketActivityTask , sealed , Scenario1_BackgroundTask , sealed , LocationBackgroundTask , sealed , EdpBackgroundTask , CompletionGroupTask , LocationBackgroundTask , ToastNotificationHistoryChangedTriggerTask , ToastActivationTypeBackgroundClosedTask , sealed , AdventureWorksVoiceCommandService , RfcommServerTask , SampleBackgroundTask , sealed , AppView , sealed , SampleSmsBackgroundTask , AdvertisementPublisherTask , sealed , UpdateFileTask , BackgroundActivity , BadgeNotificationHistoryChangedTriggerTask , BackgroundDeviceWatcher , sealed , BarcodeDecodeTask , sealed , CServiceBase , sealed , UpdateMetadataTask , sealed , PedometerBackgroundTask , sealed , ActivitySensorBackgroundTask , VisualProperties , AppView , ConnectedTask
  • RunAsync() : AuthenticationTask
  • RunButton_Click() : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario2_Publisher , Scenario1_Watcher , Scenario1_ChatClient
  • RunCoordinateMapping() : GpuCoordinateMapper , CameraCoordinateMapper
  • RunDownload() : sealed
  • RunDownloads() : sealed
  • RunDownloadsAsync() : sealed , Scenario3_Notifications , Scenario7_DownloadReordering
  • RunGame() : Simple3DGame
  • runId : Scenario3_Notifications , sealed
  • running : sealed
  • runningReadTask : Scenario4_BulkPipes
  • runningReadWriteTask : Scenario4_BulkPipes
  • runningStepCount : sealed , Scenario1_Events
  • runningWriteTask : Scenario4_BulkPipes
  • RunTask() : ReadStreamTask::ReadStreamTaskImpl , ReadStreamTask
  • RuntimeClassInitialize() : CMediaSink , WrlFinal , CMediaBufferWrapper
Generated on Fri Nov 15 2024 22:23:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- s -

  • s : MediaSegment
  • S1_AddWithAPI() : sealed , S1_AddWithAPI
  • S1_GetAFeed() : S1_GetAFeed
  • S2_UpdateAndDeleteWithAPI() : sealed , S2_UpdateAndDeleteWithAPI
  • S3_RetrieveWithAPI() : S3_RetrieveWithAPI , sealed
  • S4_CheckIndexRevision() : sealed , S4_CheckIndexRevision
  • S5_AddWithAppContent() : sealed , S5_AddWithAppContent
  • S6_DeleteWithAppContent() : sealed , S6_DeleteWithAppContent
  • S7_RetrieveWithAppContent() : S7_RetrieveWithAppContent , sealed
  • s_articleProperty : ArticlePage
  • s_containerEventTokensProperty : EdgeTappedListView
  • s_itemProperty : DetailPage
  • s_metaDataList : AzureDataProvider
  • s_random : ArticleViewModel
  • s_service : CServiceBase
  • s_viewModelProperty : SectionView
  • SafeAdd() : FilmicEffect , ReinhardEffect , RippleEffect
  • SafeBCryptKeyHandle() : SubjectPublicKeyInfo::SafeBCryptKeyHandle
  • SafeLocalAllocHandle() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • sample : MFSampleGenerator
  • SAMPLE_NAME : MainPage
  • SAMPLE_TASK_ENTRY_POINT : Scenario15_DPLCreateFileEvents
  • SAMPLE_TASK_NAME : Scenario15_DPLCreateFileEvents
  • sampleArray : sealed , ServiceViewModel
  • SampleBackgroundTask() : sealed , SampleBackgroundTask , sealed , SampleBackgroundTask
  • SampleBackgroundTaskEntryPoint : Scenario4_BackgroundActivity , BackgroundTaskSample , Scenario4_BackgroundPedometer , Scenario4_BackgroundProximitySensor
  • SampleBackgroundTaskName : Scenario4_BackgroundActivity , BackgroundTaskSample , Scenario4_BackgroundPedometer , Scenario4_BackgroundProximitySensor
  • SampleBackgroundTaskProgress : BackgroundTaskSample
  • SampleBackgroundTaskRegistered : BackgroundTaskSample
  • SampleBackgroundTaskWithCondition() : sealed , SampleBackgroundTaskWithCondition , sealed , SampleBackgroundTaskWithCondition
  • SampleBackgroundTaskWithConditionName : BackgroundTaskSample
  • SampleBackgroundTaskWithConditionProgress : BackgroundTaskSample
  • SampleBackgroundTaskWithConditionRegistered : BackgroundTaskSample
  • SampleButton_Click() : OcrFileImage
  • SampleButton_Tapped() : sealed
  • SampleCount : Scenario1_BackgroundTask
  • SampleDataModel() : SampleDataModel
  • sampleDispatcher : RegisterWithBackgroundTask
  • sampleFile : MainPage , SampleState , MainPage
  • SampleFile() : SampleState
  • SampleHotspotGuid : Constants
  • SampleIdentityConfigurationCorrect() : IdentityChecker
  • sampleMessage : sealed , ServiceViewModel
  • SampleMessage : ServiceViewModel
  • SampleMovieURL : MainPage
  • SampleNetworkInfoVisibility : Scenario2ViewModel
  • SampleNetworkList : Scenario2ViewModel
  • SampleNetworkPassword : AppData
  • SampleNetworkScanList : AppData
  • SampleOverlay() : SampleOverlay
  • samplePeriod : sealed , ServiceViewModel , Metering
  • sampleRefreshCount : sealed , ServiceViewModel
  • SampleSize : ToneSampleGenerator::SineSampleInfo
  • SamplesPerSecond : ToneSampleGenerator::SineSampleInfo
  • sampleVideos : VideoGallery
  • SaturationValue : PhotoAdjustmentProperties
  • Save_Click() : sealed , Scenario1_TrimAndSaveClip , Scenario2
  • SaveAccount() : sealed
  • SaveAccountList() : AccountsHelper
  • SaveAppState() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain
  • SaveAs_Click() : Scenario2
  • SaveAsync() : SuspensionManager
  • SaveBool() : PersistentState
  • SaveBusObject() : AllJoynBusObjectManager
  • SaveCredential_Click() : Scenario1_Save
  • SaveDataToPersistedState() : Scenario1 , Scenario2
  • savedProfileName : Scenario4_Connect
  • savedScrollPosition : sealed , Scenario1_Basic
  • SaveFileButton_Click() : sealed , Scenario4_SaveFile , MainPage_SaveFile
  • SaveFrameNavigationState() : SuspensionManager
  • SaveHighScore() : Simple3DGame
  • SaveInt32() : PersistentState
  • SaveInternalState() : sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , CustomPixelShaderMain , CustomPixelShaderRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer , sealed
  • SaveLogInMemoryToFileAsync() : sealed , LoggingSessionScenario
  • SavePackage_Click() : Scenario1_Print
  • SavePropertiesForBackgroundTask() : Scenario1_ManageHotspot
  • SaveScrollPosition() : sealed , Scenario1_Basic
  • SaveSingle() : PersistentState
  • SaveSoftwareBitmapAsync() : sealed , MainPage
  • SaveState : NavigationHelper , SubPage , Simple3DGame , Level , Level2 , Level4 , Simple3DGame
  • SaveStateEventArgs() : SaveStateEventArgs
  • SaveString() : PersistentState
  • SaveToFutureAccessListButton_Click() : sealed , Scenario5_TriggerCFU
  • SaveTrip() : sealed , TripViewModel , TripStore
  • SaveTripAsync() : sealed
  • SaveTripCommand : TripViewModel
  • saveTripCommand : sealed , TripViewModel
  • SaveXMFLOAT3() : PersistentState
  • SavingDataReason() : sealed , SavingDataReason
  • sb : SourceBufferManager
  • ScaleFactor : ExtendedSplash
  • ScaleRect() : CustomEditControl
  • ScaleSlider_ValueChanged() : Scenario2
  • ScalingSlider_ValueChanged() : sealed
  • ScanButton_Click() : sealed , Scenario4_Connect
  • ScanForOnboardingInterfaces() : Scenario2ViewModel
  • ScanForWiFiAdaptersAsync() : Scenario2ViewModel
  • ScanForWiFiNetworksAsync() : Scenario2ViewModel
  • scanner : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • scannerEnabled : Provider
  • ScannerSelection_Changed() : Scenario5_DisplayingBarcodePreview
  • ScannerSupportsPreview : Scenario5_DisplayingBarcodePreview
  • ScanPanelVisibility : Scenario2ViewModel
  • Scenario : ScenarioPage , Scenario , sealed
  • Scenario01() : Scenario01
  • Scenario01_GetText() : Scenario01_GetText
  • Scenario02() : Scenario02
  • Scenario02_GetStream() : Scenario02_GetStream
  • Scenario03() : Scenario03
  • Scenario03_GetList() : Scenario03_GetList
  • Scenario04() : Scenario04
  • Scenario04_PostText() : Scenario04_PostText
  • Scenario05() : Scenario05
  • Scenario05_PostStream() : Scenario05_PostStream
  • Scenario06() : Scenario06
  • Scenario06_PostMultipart() : Scenario06_PostMultipart
  • Scenario07_PostStreamWithProgress() : Scenario07_PostStreamWithProgress
  • Scenario08_PostCustomContent() : Scenario08_PostCustomContent
  • Scenario09_GetCookie() : Scenario09_GetCookie
  • Scenario0_Choose() : sealed , Scenario0_Choose , sealed , Scenario0_Choose
  • Scenario1() : sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed
  • scenario1 : WiFiDirectServiceManager
  • Scenario1 : WiFiDirectServiceManager , Scenario1 , sealed , Scenario1 , sealed , Scenario1
  • Scenario10() : sealed , Scenario10 , sealed , Scenario10 , sealed , Scenario10 , sealed , Scenario10
  • Scenario10_CpToClipboard() : Scenario10_CpToClipboard
  • Scenario10_SearchMultipleResourceIds() : sealed , Scenario10
  • Scenario10_SetCookie() : Scenario10_SetCookie
  • Scenario10_ShowCandidates() : sealed , Scenario10
  • Scenario10_UnviewableContent() : Scenario10_UnviewableContent
  • Scenario10Button_Show_Click() : sealed , Scenario10
  • Scenario11() : sealed , Scenario11 , sealed , Scenario11 , sealed , Scenario11 , sealed , Scenario11
  • Scenario11_CPDNoUI() : Scenario11_CPDNoUI
  • Scenario11_DeleteCookie() : Scenario11_DeleteCookie
  • Scenario11Button_Show_Click() : sealed , Scenario11
  • Scenario12() : sealed , Scenario12 , sealed , Scenario12 , sealed , Scenario12
  • Scenario12_DisableCookies() : Scenario12_DisableCookies
  • Scenario12_ShareData() : Scenario12_ShareData
  • Scenario12Button_Show_Click() : sealed , Scenario12
  • Scenario13() : sealed , Scenario13
  • Scenario13_RetryFilter() : Scenario13_RetryFilter
  • Scenario13_ShareTarget() : Scenario13_ShareTarget
  • Scenario14_MeteredConnectionFilter() : Scenario14_MeteredConnectionFilter
  • Scenario14_QueryCpPaste() : Scenario14_QueryCpPaste
  • Scenario15_DPLCreateFileEvents() : Scenario15_DPLCreateFileEvents
  • Scenario15_ServerCertificateValidation() : Scenario15_ServerCertificateValidation
  • Scenario16_NetworkResource() : Scenario16_NetworkResource
  • Scenario1::GetElementRect() : sealed
  • Scenario1_AddAccount() : sealed , Scenario1_AddAccount
  • Scenario1_Advertiser() : sealed , Scenario1_Advertiser
  • Scenario1_Analyze() : sealed , Scenario1_Analyze
  • Scenario1_AppBarButtons() : sealed
  • Scenario1_BackgroundTask() : sealed
  • Scenario1_BankCards() : sealed , Scenario1_BankCards
  • Scenario1_Basic() : sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic
  • Scenario1_BasicFunctionality() : Scenario1_BasicFunctionality
  • Scenario1_Basics() : Scenario1_Basics
  • Scenario1_BasicUserActivity() : Scenario1_BasicUserActivity
  • Scenario1_CachedNetworks() : sealed , Scenario1_CachedNetworks
  • Scenario1_ChatClient() : Scenario1_ChatClient
  • Scenario1_Check() : Scenario1_Check
  • Scenario1_CheckConsentAvailability() : sealed , Scenario1_CheckConsentAvailability
  • Scenario1_Colors() : sealed , Scenario1_Colors
  • Scenario1_Configuration() : sealed , Scenario1_Configuration
  • Scenario1_Configure() : Scenario1_Configure
  • Scenario1_ConfigureMobileHotspot() : Scenario1_ConfigureMobileHotspot
  • Scenario1_Connect() : Scenario1_Connect
  • Scenario1_ConnectDisconnect() : Scenario1_ConnectDisconnect
  • Scenario1_Conversion() : sealed , Scenario1_Conversion
  • Scenario1_CorrelateStreams() : sealed
  • Scenario1_Create() : sealed , Scenario1_Create
  • Scenario1_CreateContact() : Scenario1_CreateContact
  • Scenario1_CreateContacts() : Scenario1_CreateContacts
  • Scenario1_CreateTile() : Scenario1_CreateTile
  • Scenario1_CreateTPMVSC() : sealed
  • Scenario1_CurrentActivity() : sealed , Scenario1_CurrentActivity
  • Scenario1_CustomDry() : sealed
  • Scenario1_Data() : sealed , Scenario1_Data
  • Scenario1_DataEvents() : sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • Scenario1_Default() : sealed , Scenario1_Default
  • Scenario1_DefaultAccount() : sealed
  • Scenario1_DefaultSpacing() : sealed
  • Scenario1_Define() : Scenario1_Define
  • Scenario1_DetectInPhoto() : Scenario1_DetectInPhoto
  • Scenario1_DevicePicker() : sealed , Scenario1_DevicePicker
  • Scenario1_DeviceUse() : sealed , Scenario1_DeviceUse
  • Scenario1_DeviceUse_TaskEntryPoint : SampleConstants
  • Scenario1_DeviceUse_TaskName : SampleConstants
  • Scenario1_Directions() : Scenario1_Directions
  • Scenario1_Discovery() : Scenario1_Discovery
  • Scenario1_DisplayDepthColorIR() : sealed , Scenario1_DisplayDepthColorIR
  • Scenario1_Download() : sealed , Scenario1_Download
  • Scenario1_Enable() : sealed , Scenario1_Enable
  • Scenario1_EventAndMenuHookup() : sealed , Scenario1_EventAndMenuHookup
  • Scenario1_Events() : sealed , Scenario1_Events
  • Scenario1_ExampleOperations() : Scenario1_ExampleOperations
  • Scenario1_ExtractTextSegments() : sealed , Scenario1_ExtractTextSegments
  • Scenario1_Facebook() : Scenario1_Facebook
  • Scenario1_FilePlayback() : Scenario1_FilePlayback
  • Scenario1_Files() : Scenario1_Files
  • Scenario1_FindClaimEnable() : sealed , Scenario1_FindClaimEnable
  • Scenario1_FindId() : Scenario1_FindId
  • Scenario1_FindUsers() : Scenario1_FindUsers
  • Scenario1_Geotag() : sealed , Scenario1_Geotag
  • Scenario1_GetAndSetPin() : sealed , Scenario1_GetAndSetPin
  • Scenario1_GetDeviceInformation() : sealed , Scenario1_GetDeviceInformation
  • Scenario1_GetLamp() : sealed , Scenario1_GetLamp
  • Scenario1_Initialization() : Scenario1_Initialization
  • Scenario1_InkCanvasTactileFeedback() : Scenario1_InkCanvasTactileFeedback
  • Scenario1_Input() : Scenario1_Input
  • Scenario1_LanguageDetection() : Scenario1_LanguageDetection
  • Scenario1_Launch() : Scenario1_Launch
  • Scenario1_Launched() : sealed , Scenario1_Launched
  • Scenario1_LaunchFile() : Scenario1_LaunchFile
  • Scenario1_ListView() : sealed , Scenario1_ListView
  • Scenario1_Loaded() : Scenario1
  • Scenario1_LongAndShortFormats() : sealed , Scenario1_LongAndShortFormats
  • Scenario1_LowLatency() : sealed
  • Scenario1_LowLatencyInput() : sealed
  • Scenario1_ManageHotspot() : Scenario1_ManageHotspot
  • Scenario1_Message() : sealed , Scenario1_Message
  • Scenario1_Metrics() : sealed , Scenario1_Metrics
  • Scenario1_MIDIDeviceEnumeration() : Scenario1_MIDIDeviceEnumeration
  • Scenario1_Mini() : sealed , Scenario1_Mini
  • Scenario1_MoveCertificate() : Scenario1_MoveCertificate
  • Scenario1_MultiVideoPlayback() : Scenario1_MultiVideoPlayback
  • Scenario1_NavToUrl() : Scenario1_NavToUrl
  • Scenario1_NetworkConnectivity() : Scenario1_NetworkConnectivity
  • Scenario1_OmnidirectionalSound() : sealed
  • Scenario1_OpenDrawer() : sealed , Scenario1_OpenDrawer
  • Scenario1_Orientation() : sealed , Scenario1_Orientation
  • Scenario1_ParseAndStringify() : Scenario1_ParseAndStringify
  • Scenario1_PercentPermilleFormatting() : sealed , Scenario1_PercentPermilleFormatting
  • Scenario1_PinTile() : Scenario1_PinTile
  • Scenario1_Prefs() : sealed , Scenario1_Prefs
  • Scenario1_PreviewSettings() : sealed , Scenario1_PreviewSettings
  • Scenario1_Print() : Scenario1_Print
  • Scenario1_ProvisionTPM() : Scenario1_ProvisionTPM
  • Scenario1_ReactiveRequest() : Scenario1_ReactiveRequest
  • Scenario1_ReadData() : sealed , Scenario1_ReadData , sealed , Scenario1_ReadData
  • Scenario1_ReceiptPrinter() : sealed
  • Scenario1_Render() : sealed , Scenario1_Render
  • Scenario1_Save() : sealed , Scenario1_Save
  • Scenario1_SecondaryWindow() : Scenario1_SecondaryWindow
  • Scenario1_SelectDisplay() : sealed , Scenario1_SelectDisplay
  • Scenario1_Send() : Scenario1_Send
  • Scenario1_SetRecordProfile() : sealed , Scenario1_SetRecordProfile
  • Scenario1_SimpleListView() : Scenario1_SimpleListView
  • Scenario1_SimplestAdaptiveStreaming() : Scenario1_SimplestAdaptiveStreaming
  • Scenario1_Single() : sealed , Scenario1_Single
  • Scenario1_SingleFile() : sealed , Scenario1_SingleFile
  • Scenario1_SpellingTextSuggestions() : sealed , Scenario1_SpellingTextSuggestions
  • Scenario1_TaskEntryPoint : SampleConstants
  • Scenario1_TaskName : SampleConstants
  • Scenario1_Toggle() : Scenario1_Toggle
  • Scenario1_TrackInWebcam() : Scenario1_TrackInWebcam
  • Scenario1_TrackPosition() : Scenario1_TrackPosition
  • Scenario1_TrialMode() : sealed , Scenario1_TrialMode
  • Scenario1_TrimAndSaveClip() : sealed , Scenario1_TrimAndSaveClip
  • Scenario1_UIFonts() : Scenario1_UIFonts
  • Scenario1_Unloaded() : Scenario1
  • Scenario1_UTF8() : Scenario1_UTF8
  • Scenario1_Watcher() : Scenario1_Watcher
  • Scenario1_Welcome() : Scenario1_Welcome
  • Scenario1_XmlReader() : Scenario1_XmlReader
  • Scenario1Basic() : sealed , Scenario1Basic
  • Scenario1BtnDefault_Click() : BuildNewRss
  • Scenario1Init() : BuildNewRss
  • Scenario1ViewModel() : Scenario1ViewModel
  • scenario2 : WiFiDirectServiceManager
  • Scenario2 : WiFiDirectServiceManager , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed
  • Scenario2::GetTextboxSelectionRect() : sealed
  • Scenario2_AamvaCards() : sealed , Scenario2_AamvaCards
  • Scenario2_Add() : Scenario2_Add
  • Scenario2_AdvancedUserActivity() : Scenario2_AdvancedUserActivity
  • Scenario2_AppendClips() : sealed , Scenario2_AppendClips
  • Scenario2_BackgroundTask() : Scenario2_BackgroundTask
  • Scenario2_Binary() : Scenario2_Binary
  • Scenario2_CardioidSound() : sealed
  • Scenario2_ChangePin() : sealed
  • Scenario2_ChangePIN() : Scenario2_ChangePIN
  • Scenario2_ChatServer() : Scenario2_ChatServer
  • Scenario2_Click() : Scenario1
  • Scenario2_Client() : Scenario2_Client
  • Scenario2_CloseDrawer() : sealed , Scenario2_CloseDrawer
  • Scenario2_ConcurrentProfile() : sealed , Scenario2_ConcurrentProfile
  • Scenario2_Conditional() : Scenario2_Conditional
  • Scenario2_ConfigureDevice() : Scenario2_ConfigureDevice
  • Scenario2_Connector() : sealed , Scenario2_Connector
  • Scenario2_ControlTransfer() : Scenario2_ControlTransfer
  • Scenario2_Custom() : sealed , Scenario2_Custom
  • Scenario2_DecimalFormatting() : sealed , Scenario2_DecimalFormatting
  • Scenario2_DelayMini() : sealed , Scenario2_DelayMini
  • Scenario2_DetectInWebcam() : Scenario2_DetectInWebcam
  • Scenario2_DeviceCapture() : Scenario2_DeviceCapture
  • Scenario2_DeviceWatcher() : sealed , Scenario2_DeviceWatcher
  • Scenario2_Disable() : sealed , Scenario2_Disable
  • Scenario2_Display() : sealed , Scenario2_Display
  • Scenario2_DisplayRegion() : Scenario2_DisplayRegion
  • Scenario2_DisplayText() : sealed , Scenario2_DisplayText
  • Scenario2_DocumentFonts() : Scenario2_DocumentFonts
  • Scenario2_DragUICustomization() : sealed , Scenario2_DragUICustomization
  • Scenario2_Effects() : Scenario2_Effects
  • Scenario2_EnableSettings() : sealed , Scenario2_EnableSettings
  • Scenario2_Engage() : Scenario2_Engage
  • Scenario2_EventHandlers() : Scenario2_EventHandlers
  • Scenario2_Extend() : sealed , Scenario2_Extend
  • Scenario2_FindAvailableSourceGroups() : sealed , Scenario2_FindAvailableSourceGroups
  • Scenario2_GetCurrentTextSegmentFromIndex() : sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • Scenario2_GetPosition() : Scenario2_GetPosition
  • Scenario2_History() : sealed , Scenario2_History , sealed , Scenario2_History
  • Scenario2_Icons() : sealed
  • Scenario2_InAppPurchase() : sealed , Scenario2_InAppPurchase
  • Scenario2_Lang() : sealed , Scenario2_Lang
  • Scenario2_Launch() : Scenario2_Launch , sealed , Scenario2_Launch , sealed , Scenario2_Launch
  • Scenario2_LaunchUri() : Scenario2_LaunchUri
  • Scenario2_LEDTemp() : Scenario2_LEDTemp
  • Scenario2_Listen() : sealed , Scenario2_Listen
  • Scenario2_Load() : sealed , Scenario2_Load
  • Scenario2_Manage() : sealed , Scenario2_Manage
  • Scenario2_ManageAccount() : sealed , Scenario2_ManageAccount
  • Scenario2_Memory() : Scenario2_Memory
  • Scenario2_MessageCaption() : sealed , Scenario2_MessageCaption
  • Scenario2_Msa() : sealed
  • Scenario2_MultiFile() : sealed , Scenario2_MultiFile
  • Scenario2_Multiple() : sealed , Scenario2_Multiple
  • Scenario2_MultipleScanners() : Scenario2_MultipleScanners
  • Scenario2_NavToString() : Scenario2_NavToString
  • Scenario2_NetworkCost() : Scenario2_NetworkCost
  • Scenario2_Notifications() : Scenario2_Notifications
  • Scenario2_oAuthFacebook() : sealed
  • Scenario2_PhotoSettings() : sealed , Scenario2_PhotoSettings
  • Scenario2_Polling() : sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling
  • Scenario2_Prediction() : sealed , Scenario2_Prediction
  • Scenario2_PrintReceipt() : sealed , Scenario2_PrintReceipt
  • Scenario2_ProactiveRequest() : Scenario2_ProactiveRequest
  • Scenario2_Publisher() : Scenario2_Publisher
  • Scenario2_ReceiveContact() : Scenario2_ReceiveContact
  • Scenario2_ReceiveMIDIMessages() : Scenario2_ReceiveMIDIMessages
  • Scenario2_Remove() : sealed , Scenario2_Remove
  • Scenario2_RequestConsent() : sealed , Scenario2_RequestConsent
  • Scenario2_RequestMany() : Scenario2_RequestMany
  • Scenario2_Scan() : sealed , Scenario2_Scan
  • Scenario2_ScopedViews() : sealed , Scenario2_ScopedViews
  • Scenario2_ScriptDetection() : Scenario2_ScriptDetection
  • Scenario2_Settings() : Scenario2_Settings
  • Scenario2_ShakeEvents() : sealed , Scenario2_ShakeEvents
  • Scenario2_ShowHideEvents() : Scenario2_ShowHideEvents
  • Scenario2_SimpleGridView() : Scenario2_SimpleGridView
  • Scenario2_Stats() : sealed , Scenario2_Stats
  • Scenario2_StringTemplate() : sealed , Scenario2_StringTemplate
  • Scenario2_SupportedTactileFeedback() : Scenario2_SupportedTactileFeedback
  • Scenario2_SynchronizingPlayers() : Scenario2_SynchronizingPlayers
  • Scenario2_SystemDefaultMenu() : Scenario2_SystemDefaultMenu
  • Scenario2_ToggleMobileHotspot() : Scenario2_ToggleMobileHotspot
  • Scenario2_Twitter() : Scenario2_Twitter
  • Scenario2_UniformSpacing() : sealed
  • Scenario2_UnpinTile() : Scenario2_UnpinTile
  • Scenario2_Upload() : sealed , Scenario2_Upload
  • Scenario2_VideoChat() : sealed
  • Scenario2_WatchUsers() : Scenario2_WatchUsers
  • Scenario2_XmlWriter() : Scenario2_XmlWriter
  • Scenario2BtnDefault_Click() : MarkHotProducts
  • Scenario2BtnSave_Click() : MarkHotProducts
  • Scenario2Init() : MarkHotProducts
  • Scenario2StandardOptions() : sealed , Scenario2StandardOptions
  • Scenario2ViewModel() : Scenario2ViewModel
  • scenario3 : WiFiDirectServiceManager
  • Scenario3 : WiFiDirectServiceManager , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed
  • Scenario3_Aad() : sealed
  • Scenario3_ActiveSymbologies() : Scenario3_ActiveSymbologies
  • Scenario3_AdaptiveCard() : Scenario3_AdaptiveCard
  • Scenario3_AdaptiveSync() : Scenario3_AdaptiveSync
  • Scenario3_Add() : sealed , Scenario3_Add
  • Scenario3_AddAudioTracks() : sealed , Scenario3_AddAudioTracks
  • Scenario3_AppCapture() : Scenario3_AppCapture
  • Scenario3_AspectRatio() : sealed , Scenario3_AspectRatio
  • Scenario3_AvailabilityChanged() : sealed , Scenario3_AvailabilityChanged
  • Scenario3_BackgroundDeviceWatcher() : sealed , Scenario3_BackgroundDeviceWatcher
  • Scenario3_BackgroundTask() : Scenario3_BackgroundTask
  • Scenario3_BackgroundWatcher() : Scenario3_BackgroundWatcher
  • Scenario3_BgChatServer() : Scenario3_BgChatServer
  • Scenario3_Calibration() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • Scenario3_ChangeEvents() : sealed , Scenario3_ChangeEvents
  • Scenario3_CheckUserConsentGroup() : Scenario3_CheckUserConsentGroup
  • Scenario3_ChooseControl() : Scenario3_ChooseControl
  • Scenario3_Choosing() : Scenario3_Choosing
  • Scenario3_Click() : Scenario1
  • Scenario3_ClientAuthentication() : Scenario3_ClientAuthentication
  • Scenario3_CredentialPickerOptions() : sealed , Scenario3_CredentialPickerOptions
  • Scenario3_CurrencyFormatting() : sealed , Scenario3_CurrencyFormatting
  • Scenario3_CurrentStepCount() : sealed , Scenario3_CurrentStepCount
  • Scenario3_CustomDecay() : sealed
  • Scenario3_CustomItems() : sealed , Scenario3_CustomItems
  • Scenario3_DisplayOnOff() : sealed , Scenario3_DisplayOnOff
  • Scenario3_EnableHdrProfile() : sealed , Scenario3_EnableHdrProfile
  • Scenario3_Enum() : sealed , Scenario3_Enum
  • Scenario3_EnumerateTiles() : Scenario3_EnumerateTiles
  • Scenario3_Events() : sealed
  • Scenario3_FixAccount() : sealed , Scenario3_FixAccount
  • Scenario3_Flickr() : Scenario3_Flickr
  • Scenario3_ForegroundApp() : Scenario3_ForegroundApp
  • Scenario3_FrameInput() : Scenario3_FrameInput
  • Scenario3_Full() : sealed , Scenario3_Full
  • Scenario3_HardwareDRM() : Scenario3_HardwareDRM
  • Scenario3_InkingFeedback() : Scenario3_InkingFeedback
  • Scenario3_InterruptPipes() : Scenario3_InterruptPipes
  • Scenario3_InvokeScript() : Scenario3_InvokeScript
  • Scenario3_LaunchAppServices() : Scenario3_LaunchAppServices
  • Scenario3_Legacy() : Scenario3_Legacy
  • Scenario3_MasterDetail() : Scenario3_MasterDetail
  • Scenario3_MultipleClaims() : sealed , Scenario3_MultipleClaims
  • Scenario3_MultipleDrawers() : sealed , Scenario3_MultipleDrawers
  • Scenario3_NetworkConnectivityChanges() : Scenario3_NetworkConnectivityChanges
  • Scenario3_Notifications() : sealed , Scenario3_Notifications
  • Scenario3_ParameterizedTemplate() : sealed , Scenario3_ParameterizedTemplate
  • Scenario3_Polling() : sealed , Scenario3_Polling
  • Scenario3_Porting() : sealed , Scenario3_Porting
  • Scenario3_ProportionalSpacing() : sealed
  • Scenario3_ReadWrite() : Scenario3_ReadWrite
  • Scenario3_ReceiveFile() : Scenario3_ReceiveFile
  • Scenario3_Region() : sealed , Scenario3_Region
  • Scenario3_RegisterForUpdates() : sealed , Scenario3_RegisterForUpdates
  • Scenario3_Replace() : Scenario3_Replace
  • Scenario3_RequestModification() : Scenario3_RequestModification
  • Scenario3_ResetPIN() : Scenario3_ResetPIN
  • Scenario3_ResetPin() : sealed
  • Scenario3_ReverseConversion() : sealed , Scenario3_ReverseConversion
  • Scenario3_SecondaryTiles() : Scenario3_SecondaryTiles
  • Scenario3_SendMIDIMessages() : Scenario3_SendMIDIMessages
  • Scenario3_ServerForeground() : Scenario3_ServerForeground
  • Scenario3_SettingContainer() : Scenario3_SettingContainer
  • Scenario3_ShowHideMethods() : Scenario3_ShowHideMethods
  • Scenario3_SingleFolder() : sealed , Scenario3_SingleFolder
  • Scenario3_Size() : Scenario3_Size
  • Scenario3_StartDragAsync() : sealed , Scenario3_StartDragAsync
  • Scenario3_StartDragAsync_Loaded() : Scenario3_StartDragAsync
  • Scenario3_Transliteration() : Scenario3_Transliteration
  • Scenario3_Trim() : sealed , Scenario3_Trim
  • Scenario3_UnmanagedConsumable() : sealed , Scenario3_UnmanagedConsumable
  • Scenario3_UsingWindows() : sealed , Scenario3_UsingWindows
  • Scenario3_XmlWriterLite() : Scenario3_XmlWriterLite
  • Scenario3BtnBuffer_Click() : XmlLoading
  • Scenario3BtnFile_Click() : XmlLoading
  • Scenario3Button_Show_Click() : sealed , Scenario3
  • Scenario3CustomOptions() : sealed , Scenario3CustomOptions
  • Scenario3Init() : XmlLoading
  • scenario4 : WiFiDirectServiceManager
  • Scenario4 : WiFiDirectServiceManager , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4
  • Scenario4::RecoButton_Click() : sealed
  • Scenario4_AddOverlays() : sealed , Scenario4_AddOverlays , sealed
  • Scenario4_BackgroundActivity() : sealed , Scenario4_BackgroundActivity
  • Scenario4_BackgroundPedometer() : Scenario4_BackgroundPedometer
  • Scenario4_BackgroundProximitySensor() : sealed , Scenario4_BackgroundProximitySensor
  • Scenario4_BackgroundPublisher() : Scenario4_BackgroundPublisher
  • Scenario4_BackgroundTask() : sealed
  • Scenario4_BulkPipes() : Scenario4_BulkPipes
  • Scenario4_ChangeAdminKey() : sealed , Scenario4_ChangeAdminKey
  • Scenario4_ChangeSystemGroup() : sealed , Scenario4_ChangeSystemGroup
  • Scenario4_CharacterGrouping() : Scenario4_CharacterGrouping
  • Scenario4_CompactOverlay() : Scenario4_CompactOverlay
  • Scenario4_CompletionGroups() : sealed , Scenario4_CompletionGroups
  • Scenario4_CompositeSettings() : Scenario4_CompositeSettings
  • Scenario4_Connect() : sealed , Scenario4_Connect
  • Scenario4_ConsumableProduct() : sealed , Scenario4_ConsumableProduct
  • Scenario4_Control() : sealed
  • Scenario4_EdgeTappedListView() : Scenario4_EdgeTappedListView
  • Scenario4_Events() : Scenario4_Events
  • Scenario4_ForegroundGeofence() : Scenario4_ForegroundGeofence
  • Scenario4_Input() : sealed , Scenario4_Input
  • Scenario4_InteractionFeedback() : Scenario4_InteractionFeedback
  • Scenario4_ManyProviders() : sealed
  • Scenario4_NumberParsing() : sealed , Scenario4_NumberParsing
  • Scenario4_OrientationChanged() : sealed , Scenario4_OrientationChanged
  • Scenario4_Override() : sealed , Scenario4_Override
  • Scenario4_PartialReadWrite() : Scenario4_PartialReadWrite
  • Scenario4_ReceiveUri() : Scenario4_ReceiveUri
  • Scenario4_Remove() : Scenario4_Remove , sealed , Scenario4_Remove
  • Scenario4_SaveFile() : sealed , Scenario4_SaveFile
  • Scenario4_ScriptNotify() : Scenario4_ScriptNotify
  • Scenario4_SecureStop() : Scenario4_SecureStop
  • Scenario4_Settings() : Scenario4_Settings
  • Scenario4_ShowView() : Scenario4_ShowView
  • Scenario4_Snapshot() : sealed , Scenario4_Snapshot
  • Scenario4_StateTrigger() : Scenario4_StateTrigger
  • Scenario4_Submix() : Scenario4_Submix
  • Scenario4_SymbologyAttributes() : Scenario4_SymbologyAttributes
  • Scenario4_TilePinned() : Scenario4_TilePinned
  • Scenario4_Tuning() : Scenario4_Tuning
  • Scenario4_UnicodeExtensions() : sealed , Scenario4_UnicodeExtensions
  • Scenario4_UpdatingLineDisplayAttributes() : sealed , Scenario4_UpdatingLineDisplayAttributes
  • Scenario4BtnDefault_Click() : GiftDispatch
  • Scenario4Init() : GiftDispatch
  • Scenario4PageRange() : sealed , Scenario4PageRange
  • scenario5 : WiFiDirectServiceManager
  • Scenario5 : WiFiDirectServiceManager , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5
  • Scenario5::nearbyStreetside() : sealed
  • Scenario5::OnSizeChanged() : sealed
  • Scenario5_Capabilities() : Scenario5_Capabilities
  • Scenario5_Clear() : sealed , Scenario5_Clear
  • Scenario5_DataEventsBatching() : sealed , Scenario5_DataEventsBatching
  • Scenario5_DefiningCustomGlyphs() : sealed , Scenario5_DefiningCustomGlyphs
  • Scenario5_DisplayingBarcodePreview() : Scenario5_DisplayingBarcodePreview
  • Scenario5_GeofenceBackgroundTask() : Scenario5_GeofenceBackgroundTask
  • Scenario5_GetSingleDevice() : sealed , Scenario5_GetSingleDevice
  • Scenario5_InboxEffects() : Scenario5_InboxEffects
  • Scenario5_InkingAndInteractionFeedback() : Scenario5_InkingAndInteractionFeedback
  • Scenario5_IsSupported() : sealed , Scenario5_IsSupported
  • Scenario5_LaunchedFromSecondaryTile() : Scenario5_LaunchedFromSecondaryTile
  • Scenario5_ManyProvidersManyAccounts() : sealed
  • Scenario5_Metadata() : Scenario5_Metadata
  • Scenario5_Msappdata() : Scenario5_Msappdata
  • Scenario5_Multiple() : sealed
  • Scenario5_NavToFiles() : Scenario5_NavToFiles
  • Scenario5_RandomAccess() : sealed , Scenario5_RandomAccess
  • Scenario5_RelativePositioning() : Scenario5_RelativePositioning
  • Scenario5_RestoreScrollPosition() : Scenario5_RestoreScrollPosition
  • Scenario5_RoundingAndPadding() : sealed , Scenario5_RoundingAndPadding
  • Scenario5_Show() : Scenario5_Show
  • Scenario5_TimeZone() : sealed , Scenario5_TimeZone
  • Scenario5_TriggerCFU() : sealed , Scenario5_TriggerCFU
  • Scenario5_UnicodeExtensions() : sealed , Scenario5_UnicodeExtensions
  • Scenario5_UsbDescriptors() : Scenario5_UsbDescriptors
  • Scenario5_UserCollection() : sealed , Scenario5_UserCollection
  • Scenario5_VerifyResponse() : sealed , Scenario5_VerifyResponse
  • Scenario5BtnTransformToDocument_Click() : XSLTTransform
  • Scenario5BtnTransformToString_Click() : XSLTTransform
  • Scenario5Button_Show_Click() : sealed , Scenario5
  • Scenario5Init() : XSLTTransform
  • Scenario5Photos() : sealed , Scenario5Photos
  • Scenario6() : Scenario6 , sealed , Scenario6 , sealed , Scenario6 , sealed , Scenario6 , sealed , Scenario6
  • Scenario6_AdInsertion() : Scenario6_AdInsertion
  • Scenario6_AppListingURI() : sealed , Scenario6_AppListingURI
  • Scenario6_ClearScenario() : Scenario6_ClearScenario
  • Scenario6_CustomEffects() : Scenario6_CustomEffects
  • Scenario6_CustomFilterAddedProps() : sealed , Scenario6_CustomFilterAddedProps
  • Scenario6_CustomProvider() : sealed
  • Scenario6_DeleteTPM() : Scenario6_DeleteTPM
  • Scenario6_DeleteTPMVSC() : sealed
  • Scenario6_GetLastVisit() : Scenario6_GetLastVisit
  • Scenario6_InterfaceSettings() : Scenario6_InterfaceSettings
  • Scenario6_ManipulatingCursorAttributes() : sealed , Scenario6_ManipulatingCursorAttributes
  • Scenario6_NavToStream() : Scenario6_NavToStream
  • Scenario6_NumeralSystemTranslation() : sealed , Scenario6_NumeralSystemTranslation
  • Scenario6_RecoverableErrors() : sealed , Scenario6_RecoverableErrors
  • Scenario6_Recurrence() : Scenario6_Recurrence
  • Scenario6_ScrollIntoView() : Scenario6_ScrollIntoView
  • Scenario6_SecondaryTileNotification() : Scenario6_SecondaryTileNotification
  • Scenario6_Styling() : sealed
  • Scenario6_TimeZone() : sealed , Scenario6_TimeZone
  • Scenario6Button_Show_Click() : Scenario6
  • Scenario6DisablePreview() : sealed , Scenario6DisablePreview
  • Scenario7() : sealed , Scenario7 , sealed , Scenario7 , sealed , Scenario7 , sealed , Scenario7
  • Scenario7_B2B() : sealed , Scenario7_B2B
  • Scenario7_CustomContent() : sealed
  • Scenario7_DeviceInformationKind() : sealed , Scenario7_DeviceInformationKind
  • Scenario7_DownloadReordering() : sealed , Scenario7_DownloadReordering
  • Scenario7_DownloadReordering::IsWebException() : sealed
  • Scenario7_ForegroundVisits() : Scenario7_ForegroundVisits
  • Scenario7_ListAllCards() : Scenario7_ListAllCards
  • Scenario7_ListSmartCards() : sealed
  • Scenario7_LiveSeekableRange() : Scenario7_LiveSeekableRange
  • Scenario7_PinFromAppbar() : Scenario7_PinFromAppbar
  • Scenario7_ScrollingContentUsingMarquee() : sealed , Scenario7_ScrollingContentUsingMarquee
  • Scenario7_SetVersion() : Scenario7_SetVersion
  • Scenario7_Share() : Scenario7_Share
  • Scenario7_SyncDevice() : Scenario7_SyncDevice
  • Scenario7_UsingUnicodeExtensions() : sealed , Scenario7_UsingUnicodeExtensions
  • Scenario7Button_Show_Click() : sealed , Scenario7
  • Scenario8() : sealed , Scenario8 , sealed , Scenario8 , sealed , Scenario8 , sealed , Scenario8
  • Scenario8::LanguageOverrideCombo_SelectionChanged() : sealed
  • Scenario8_CaptureBitmap() : Scenario8_CaptureBitmap
  • Scenario8_ClipboardSource() : Scenario8_ClipboardSource
  • Scenario8_Loaded() : Scenario7
  • Scenario8_PairDevice() : sealed , Scenario8_PairDevice
  • Scenario8_Reflow() : sealed
  • Scenario8_TransferMediaPlayer1() : Scenario8_TransferMediaPlayer1
  • Scenario8_Transmit() : sealed
  • Scenario8_TransmitAPDU() : Scenario8_TransmitAPDU
  • Scenario8_UpdateAsync() : Scenario8_UpdateAsync
  • Scenario8_VisitsBackgroundTask() : Scenario8_VisitsBackgroundTask
  • Scenario9() : Scenario9 , sealed , Scenario9 , sealed , Scenario9 , sealed , Scenario9
  • Scenario9_ClipboardTarget() : Scenario9_ClipboardTarget
  • Scenario9_ContainsFullScreenElement() : Scenario9_ContainsFullScreenElement
  • Scenario9_CustomPairDevice() : sealed , Scenario9_CustomPairDevice
  • Scenario9_TransferMediaPlayer2() : Scenario9_TransferMediaPlayer2
  • Scenario9Button_Show_Click() : Scenario9
  • Scenario_CloudFontOverview() : sealed , Scenario_CloudFontOverview
  • Scenario_ContinuousDictation() : sealed , Scenario_ContinuousDictation
  • Scenario_ContinuousRecognitionListGrammar() : sealed , Scenario_ContinuousRecognitionListGrammar
  • Scenario_ContinuousRecognitionSRGSGrammar() : sealed , Scenario_ContinuousRecognitionSRGSGrammar
  • Scenario_Document1() : sealed , Scenario_Document1
  • Scenario_Document2() : sealed , Scenario_Document2
  • Scenario_Document3() : sealed , Scenario_Document3
  • Scenario_ListConstraint() : sealed , Scenario_ListConstraint
  • Scenario_PauseAsync() : sealed , Scenario_PauseAsync
  • Scenario_PredefinedDictationGrammar() : sealed , Scenario_PredefinedDictationGrammar
  • Scenario_PredefinedWebSearchGrammar() : sealed , Scenario_PredefinedWebSearchGrammar
  • Scenario_SampleOverview() : sealed , Scenario_SampleOverview
  • Scenario_SRGSConstraint() : sealed , Scenario_SRGSConstraint
  • Scenario_SynthesizeSSML() : sealed , Scenario_SynthesizeSSML
  • Scenario_SynthesizeText() : sealed , Scenario_SynthesizeText
  • Scenario_SynthesizeTextBoundaries() : sealed , Scenario_SynthesizeTextBoundaries
  • ScenarioCleanup() : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • ScenarioCompleted() : Helpers
  • ScenarioControl_SelectionChanged() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • ScenarioDisable() : sealed , Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling , Scenario4_OrientationChanged , Scenario5_DataEventsBatching , sealed , Scenario1_DataEvents , sealed , Scenario1_DeviceUse , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • ScenarioDisableReadingChanged() : sealed , Scenario3_ChangeEvents
  • ScenarioElement() : ScenarioElement
  • ScenarioElement_Loaded() : ScenarioElement
  • ScenarioEnable() : sealed , Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling , Scenario4_OrientationChanged , Scenario5_DataEventsBatching , sealed , Scenario1_DataEvents , sealed , Scenario1_DeviceUse , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • ScenarioEnableReadingChanged() : sealed , Scenario3_ChangeEvents
  • ScenarioEndReadButton_Click() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ScenarioEndScanButton_Click() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ScenarioGet() : sealed , Scenario2_Polling
  • ScenarioGetActivityHistory() : sealed , Scenario2_History
  • ScenarioGetCurrentActivity() : sealed , Scenario1_CurrentActivity
  • ScenarioGetData() : sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling
  • ScenarioGetData_Click() : Scenario2_Polling
  • ScenarioGetSensor_Click() : Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling
  • ScenarioGroup : MainPage , ScenarioGroup
  • ScenarioGroupProperty : MainPage
  • ScenarioLoaded : CachedFileUpdaterPage , FileSavePickerPage
  • ScenarioOneStates : sealed
  • ScenarioPage() : ScenarioPage
  • scenarioPage : PrintHelper
  • ScenarioPick_Click() : Scenario3_Choosing
  • ScenarioProperty : ScenarioPage
  • ScenarioReadSelected_Click() : Scenario3_Choosing
  • ScenarioRegisterTask() : sealed , Scenario4_BackgroundActivity , sealed
  • ScenarioRegisterTask_Click() : Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor
  • scenarios : MainPage , CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • Scenarios : MainPage
  • Scenarios_SelectionChanged() : CachedFileUpdaterPage , FileSavePickerPage
  • scenariosInner : MainPage
  • ScenarioStart_Click() : Scenario3_Choosing
  • ScenarioStarted() : Helpers
  • ScenarioStartReadButton_Click() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ScenarioStartScanButton_Click() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ScenarioStartTriggerButton_Click() : Scenario1_BasicFunctionality
  • ScenarioState : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • ScenarioStop_Click() : Scenario3_Choosing
  • ScenarioStopTriggerButton_Click() : Scenario1_BasicFunctionality
  • ScenarioTestPage_VisibleBoundsChanged() : ScenarioPage
  • ScenarioType : sealed , Scenario3_Notifications
  • ScenarioUnregisterTask() : sealed , Scenario4_BackgroundActivity , sealed
  • ScenarioUnregisterTask_Click() : Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor
  • SceneAnalysisEffect_SceneAnalyzed() : sealed , MainPage
  • SceneComposer() : SceneComposer
  • SceneController() : SceneController
  • SceneObject() : SceneObject
  • SCENEOBJECT_TYPES : SceneComposer
  • sceneRenderer : LowLatencyInputMain
  • ScheduleAdFromScte35Payload() : Scenario5_Metadata
  • School() : School
  • schoolKey : School
  • scope_exit() : scope_exit< Lambda >
  • Script : RecognizedTextRun
  • Scroll_Click() : Scenario6_ScrollIntoView
  • scrollStep : PlaybackPage
  • ScrollViewer_ViewChanged() : sealed
  • SDKTemplate::Scenario1_Advertiser::OnConnectionStatusChanged() : sealed
  • SdkToolsPath : FxCompile
  • sdpRecordBlob : Scenario3_BgChatServer
  • SdpServiceName : Constants
  • SdpServiceNameAttributeId : Constants
  • SdpServiceNameAttributeType : Constants
  • SdrOverlayEffect() : SdrOverlayEffect
  • Search_Clicked() : Scenario1_Discovery
  • SearchButton_Click() : sealed , Scenario1
  • SearchByHostNameAsync() : Scenario1_Discovery
  • SearchByRemoteSystemWatcher() : Scenario1_Discovery
  • SearchCleanup() : Scenario1_Discovery
  • SearchForSegment() : LiveSourceBufferManager
  • SearchSegmentIfOutsideBuffer() : Player
  • SeattleGeopoint : MainPage
  • SECONDARY_TILE_ID : ScenarioElement
  • SecondaryAppWindowPage() : SecondaryAppWindowPage
  • SecondaryPage() : sealed , SecondaryPage
  • SecondaryViewPage() : SecondaryViewPage
  • SecondaryViews : SampleState , App
  • SecondsToTicks() : StepTimer
  • secondVideoFile : sealed , Scenario2_AppendClips
  • SectionView() : SectionView
  • SectionView_ArticleSelected() : MainPage
  • SecureBootState_Click() : sealed , FirmwareAccess
  • SecureInterfaceConcatenateCalledEventArgs() : sealed
  • SecureInterfaceConsumer() : sealed
  • SecureInterfaceConsumer::Initialize() : sealed
  • SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs() : sealed
  • SecureInterfaceProducer() : sealed
  • SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs() : sealed
  • secureStopServiceUrl : SecureStopViewModel
  • SecureStopViewModel() : SecureStopViewModel
  • securityLevel : PlayReadyInfoViewModel
  • SecurityLevel : PlayReadyInfoViewModel
  • SecuritySettings : WiFiNetworkDisplay
  • Seek10SecondsBack_Click() : Scenario1_MultiVideoPlayback
  • Seek10SecondsForward_Click() : Scenario1_MultiVideoPlayback
  • Seek2SecondsBack_Click() : Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Seek2SecondsForward_Click() : Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Seek30SecondsBack_Click() : Scenario3_AdaptiveSync
  • Seek30SecondsForward_Click() : Scenario3_AdaptiveSync
  • SeekBarElement() : SeekBarElement
  • SeekDelta() : Scenario3_AdaptiveSync
  • SeekDownload_Click() : sealed , Scenario5_RandomAccess
  • SeekFixedAmount_Click() : Scenario7_LiveSeekableRange
  • SeekToRequestedPosition() : Scenario7_LiveSeekableRange
  • segmentCursor : SourceBufferManager
  • SegmentInformation : MediaStream
  • SegmentInformationType : MediaStream
  • SegmentInfoType : MediaStream
  • Segments : MediaStream
  • SegmentTemplateBase : MediaStream
  • SegmentTemplateIdentifier : MediaStream
  • SegmentUrl : MediaSegment
  • Select() : InkRenderer
  • Select_Volume() : Scenario2_SystemDefaultMenu
  • SelectApplicationAsync() : AccessHandler
  • SelectButton_Click() : sealed , Scenario1_SelectDisplay
  • SelectCommand() : SelectCommand
  • SelectCustomItem() : Scenario2_SystemDefaultMenu
  • SelectDeviceInList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • Selected : sealed
  • SelectedAudioCategory : PlayerViewModel
  • SelectedAuthType : Scenario2ViewModel
  • SelectedBleDeviceId : SampleState , MainPage
  • SelectedBleDeviceName : SampleState , MainPage
  • selectedCharacteristic : Scenario2_Client
  • SelectedContact : DetailsPage
  • selectedImage : ShareDelayRenderedFiles
  • selectedItem : Scenario1_Files
  • selectedLayer : sealed
  • SelectedModel : ContentSelector
  • SelectedOnboardeeNetwork : Scenario2ViewModel
  • SelectedOnboarderNetwork : Scenario2ViewModel
  • SelectedSampleNetwork : Scenario2ViewModel
  • SelectedSampleNetworkAuthentication : Scenario2ViewModel
  • SelectedSampleNetworkPassword : Scenario2ViewModel
  • selectedScanner : Scenario5_DisplayingBarcodePreview
  • selectedSession : WiFiDirectServiceManager
  • SelectedSoftAPNetwork : Scenario2ViewModel
  • selectedStencilChangedToken : sealed , Scenario6
  • SelectedTrip : TripListViewModel
  • selectedTrip : sealed , TripListViewModel
  • SelectedWiFiAdapterIndex : Scenario2ViewModel
  • SelectFile() : PlaybackControl
  • SelectFilesButton_Click() : sealed , ShareFiles , Scenario1
  • SelectImageButton_Click() : sealed , Scenario6 , sealed , ShareDelayRenderedFiles , ShareImage
  • Selecting : sealed
  • SelectingMode : sealed
  • SelectingOrPasting : sealed
  • SelectInkSceneObject() : SceneComposer
  • SelectInputFile() : Scenario6_CustomEffects
  • selection : FileDataSource2
  • selectionCache : FileDataSource2
  • SelectionChanged : PlaylistView , sealed , TripListViewModel
  • SelectionSegmentButton_Click() : sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • SelectionSegmentsButton_Click() : sealed , Scenario1_ExtractTextSegments
  • SelectItem() : sealed , Scenario1_EventAndMenuHookup
  • SelectItems() : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • SelectLayer() : sealed , Scenario10
  • Selector : sealed , DeviceSelectorInfo
  • Selectors() : ProtectionSelectorChoices
  • SelectOutputFile() : Scenario2_DeviceCapture
  • SelectPreferredCameraStreamSettingAsync() : sealed , CaptureDevice
  • SelectPreviouslySelectedItem() : sealed , Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • SelectRange() : FileDataSource2
  • SelectScannerAsync() : Scenario5_DisplayingBarcodePreview
  • SelectSceneObjects() : SceneComposer
  • SelectSession() : sealed , WiFiDirectServiceManager
  • SelectSession_Click() : sealed , Scenario2 , Scenario4
  • SelectSomethingIfPossible() : Scenario3_MasterDetail
  • SelectStreams() : CMediaSource
  • SelectStroke() : SceneComposer::InkObject
  • SelectVisibleElement() : HistoryAndRoaming
  • SemanticInterpretation() : sealed , App
  • Send_Click() : SendTextMessage
  • SendAsync() : CNetworkChannel , sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario4_PartialReadWrite
  • SendBadge_Click() : Scenario2_Notifications
  • SendBadgeNotification_Click() : Scenario6_SecondaryTileNotification
  • SendBadgeNotificationWithStringManipulation_Click() : Scenario6_SecondaryTileNotification
  • SendBadgeWithStringManipulation_Click() : Scenario2_Notifications
  • SendBooleanOutputReport_Click() : sealed , InputOutputReports
  • SendBooleanOutputReportAsync() : sealed , InputOutputReports
  • sendButton_Click() : Scenario3_SendMIDIMessages
  • SendButton_Click() : Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , Scenario1_Send , RequestResponse
  • SendCompletionMessageForCancellation() : sealed , AdventureWorksVoiceCommandService
  • SendCompletionMessageForDestination() : sealed , AdventureWorksVoiceCommandService
  • SendDataAsync() : Scenario2_Twitter , Scenario3_Flickr , Scenario2_Binary
  • SendDataLoop() : sealed
  • SendDescribeRequest() : CMediaSource
  • SendDescription() : CMediaSink
  • SendFeedback_Clicked() : Scenario4_InteractionFeedback
  • SendHeadRequestAsync() : Downloader
  • SendHello_Click() : sealed , Scenario3 , sealed , Scenario3
  • SendHttpGetButton_Click() : Scenario09_GetCookie
  • SendHttpGetRequestAsync() : Helpers
  • SendInitialGetButton_Click() : Scenario12_DisableCookies
  • SendInitSegment() : SourceBufferManager
  • SendMediaSegment() : LiveSourceBufferManager , SourceBufferManager
  • SendMessage() : Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer
  • SendMessage_Click() : sealed , Scenario5
  • SendMessageAsync() : SocketWrapper
  • SendMessageToRemoteAppServiceAsync() : Scenario3_LaunchAppServices
  • SendNextRequestButton_Click() : Scenario12_DisableCookies
  • SendNumericOutputReport_Click() : sealed , InputOutputReports
  • SendNumericOutputReportAsync() : sealed , InputOutputReports
  • SendPacket() : CMediaSink
  • SendRequestAsync() : AddAuthorizationHeaderFilter , PlugInFilter , HttpMeteredConnectionFilter , HttpRetryFilter , CMediaSource
  • SendSampleFromQueue() : CStreamSink
  • SendSecureStopRecords() : SecureStopViewModel
  • SendSignal : Scenario1ViewModel
  • SendStartRequest() : CMediaSource
  • SendTextMessage() : SendTextMessage , sealed , Scenario2_Load
  • SendTextSignal() : Scenario1ViewModel
  • SendTile_Click() : Scenario2_Notifications
  • SendTileNotification_Click() : Scenario6_SecondaryTileNotification
  • SendTileNotificationWithStringManipulation_Click() : Scenario6_SecondaryTileNotification
  • SendTileWithStringManipulation_Click() : Scenario2_Notifications
  • SendVendorControlTransferInToDeviceRecipientAsync() : Scenario2_ControlTransfer
  • sensor : Scenario2_Polling , sealed , Scenario4_BackgroundPedometer , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , sealed
  • Sensor : Scenario1_DataEvents , Scenario2_Polling
  • sensor : sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents
  • SensorDescription : MainPage
  • SensorOptimizationGoal : MainPage
  • sensorOptimizationGoal : MainPage
  • sensorReadingType : MainPage
  • SensorReadingType : MainPage
  • separatorQueue : sealed , DynamicCommandBar
  • separatorQueueWidth : sealed , DynamicCommandBar
  • SerializeAccountListToXml() : AccountsHelper
  • SerializeHeaderCollection() : Helpers
  • SerializeHeaders() : Helpers
  • SerializeToBlob() : CBaseAttributes< TBase >
  • SerializeToStream() : CBaseAttributes< TBase >
  • SerialNumber : RawSMBIOSSystemInfo
  • serverBaseUri : JsonRequest
  • service : DiscoveredDeviceWrapper
  • ServiceAddress : sealed , DiscoveredDeviceWrapper , SessionWrapper
  • ServiceCodeList : Check , Update
  • serviceCompletionNotifier : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • ServiceCount : Check , Update
  • ServiceCtrlHandler() : CServiceBase
  • serviceDeferral : RandomNumberGeneratorTask , sealed , AdventureWorksVoiceCommandService
  • ServiceInfo : sealed , DiscoveredDeviceWrapper
  • ServiceList_SelectionChanged() : Scenario2_Client
  • ServiceMain() : CServiceBase
  • ServiceName : sealed , DiscoveredDeviceWrapper
  • serviceProvider : Scenario3_ServerForeground
  • ServiceProvider_AdvertisementStatusChanged() : Scenario3_ServerForeground
  • serviceProviderAdvertisementChangedToken : Scenario3_ServerForeground
  • ServiceProviderInitAsync() : Scenario3_ServerForeground
  • ServiceRequested() : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • services : unique_services
  • ServiceStatusConverter() : Helpers::sealed
  • ServiceViewModel() : sealed , ServiceViewModel
  • ServiceViewModel::ResumeMeteringService() : sealed
  • ServiceViewModel::SuspendMeteringService() : sealed
  • ServicingComplete() : sealed
  • ServicingCompleteTask() : sealed , ServicingCompleteTask , sealed , ServicingCompleteTask
  • ServicingCompleteTaskEntryPoint : BackgroundTaskSample
  • ServicingCompleteTaskName : BackgroundTaskSample
  • ServicingCompleteTaskProgress : BackgroundTaskSample
  • ServicingCompleteTaskRegistered : BackgroundTaskSample
  • session : Scenario5 , sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks , FileLoggingSessionScenario , LoggingSessionScenario , Scenario1 , SessionWrapper , StreamSocketListenerWrapper
  • Session : SessionWrapper
  • SessionAddress : SessionWrapper
  • sessionClosedEvent : SessionWrapper
  • SessionConnected() : sealed , Scenario3
  • SessionId : SessionWrapper
  • SessionInfo : sealed , SessionRequestWrapper
  • SessionJoinedHandler() : AllJoynHelpers
  • SessionLost : ISecureInterfaceProducer , IOnboardingProducer
  • SessionLostHandler() : AllJoynHelpers
  • SessionMemberAdded : ISecureInterfaceProducer , IOnboardingProducer
  • SessionMemberAddedHandler() : AllJoynHelpers
  • SessionMemberRemoved : ISecureInterfaceProducer , IOnboardingProducer
  • SessionMemberRemovedHandler() : AllJoynHelpers
  • SessionRequestList : AdvertisementWrapper
  • SessionRequestWrapper() : sealed , SessionRequestWrapper
  • SessionRevoked() : LocationTrackingReason , sealed , UnspecifiedReason , MultipleTasks
  • sessionRevokedToken : sealed
  • SessionState : SuspensionManager
  • sessionStateFilename : App , SuspensionManager
  • SessionStateForFrame() : SuspensionManager
  • SessionWrapper() : sealed , SessionWrapper
  • Set_ClipboardNoUI() : Scenario11_CPDNoUI
  • Set_ClipboardSource() : Scenario8_ClipboardSource
  • SET_PIN : sealed , Scenario2_Listen
  • SetAction() : GameInfoOverlay , IGameUIControl , sealed , IGameUIControl , GameInfoOverlay
  • SetActive() : CMediaStream
  • SetActiveChallenge() : DAL
  • SetActiveSymbologies_Click() : Scenario3_ActiveSymbologies
  • SetAllJoynMessageArg() : TypeConversionHelpers
  • SetAmplitude() : RippleEffect
  • SetApplicationMode() : SourceHandler
  • SetAppLocalSettingsValue() : sealed
  • SetAt() : GroupInfoList
  • SetAudioCategory() : PlaybackControl
  • SetAudioClientChannelVolume() : WASAPIRenderer
  • SetAudioDeviceType() : PlaybackControl
  • SetAutoPlay() : ContentSelector
  • SetBackground() : GameMain , GameRenderer , Simple3DGame
  • SetBackgroundAudio() : WASAPIRenderer
  • SetBitrateDowngradeTriggerRatio_Click() : Scenario4_Tuning
  • SetBlob() : CBaseAttributes< TBase >
  • SetBrush() : BaseElement
  • SetBrushColor() : RectRenderer , LowLatencyInputMain
  • SetBufferDuration() : WASAPIRenderer
  • SetBusy() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed
  • setButtonState() : Scenario1
  • SetCancelButton() : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • SetCanvasSize() : sealed , Scenario6
  • SetCardActivationPolicy() : NfcUtils
  • SetCardDataScenario() : SetCardDataScenario
  • SetCenter() : RippleEffect
  • SetChatUI() : Scenario1_ChatClient
  • SetClaimedUI() : sealed , Scenario3_MultipleDrawers
  • SetColor() : SpinningCubeRenderer
  • SetColorFadeTimer() : final
  • SetCommandsVisibility() : Scenario4_EdgeTappedListView
  • SetCompleted() : StepsControl
  • SetCompositionScale() : DeviceResources
  • SetComputeInfo() : DftTransform
  • SetConfiguration() : InkEventLogger
  • SetConnected() : sealed , CStreamSink
  • SetConnectedFunc() : SetConnectedFunc
  • SetConstantBuffer() : RenderingHelper
  • SetContentSize() : DeviceResources , SceneComposer
  • SetContentStream() : WASAPIRenderer
  • SetContentType() : WASAPIRenderer
  • SetContentZoomFactor() : DeviceResources , SceneComposer
  • SetCookie_Click() : Scenario10_SetCookie
  • SetCurrentLength() : CMediaBufferWrapper
  • SetCurrentLevelToSavedState() : Simple3DGame
  • SetCurrentMediaType() : CStreamSink
  • SetCurrentOrientation() : DeviceResources
  • SetCurrentTool() : SourceHandler
  • SetData() : CSourceOperation
  • SetDebugName() : BasicLoader
  • SetDefaultButton_Click() : sealed
  • SetDefaultRecognizerByCurrentInputMethodLanguageTag() : sealed , Scenario4
  • SetDefaultStyleCombobox_SelectionChanged() : sealed , Scenario9
  • SetDesiredBitrateHeadroomRatio_Click() : Scenario4_Tuning
  • setDestinationValidation() : sealed
  • SetDeviceWatcherUI() : Scenario1_ChatClient
  • SetDistance() : Cursor
  • SetDouble() : CBaseAttributes< TBase >
  • SetDPI() : DeviceResources , SceneComposer
  • SetDpi() : DeviceResources
  • SetDrawInfo() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • SetDropMode() : CMediaStream
  • SetElementMargin() : BaseElement
  • SetElementSize() : BaseElement
  • SetEnabled() : IControl , RadioModel , ControlBase
  • SetEncodingProperties() : AudioEchoEffect
  • SetEndPoint() : Line
  • SetEnvironment() : OmnidirectionalSound , CardioidSound , CustomDecaySound , OmnidirectionalSound
  • SetError() : sealed , Scenario1_Message , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions
  • SetErrorMessage() : sealed , SetErrorMessage
  • SetEvent() : PropertyGetContext< T > , PropertySetContext
  • SetExtendedSplashInfo() : MainPage
  • SetFacesCanvasRotation() : MainPage , sealed
  • SetFeatureName() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • SetFireRect() : MoveLookController
  • SetFirstSelectedPeriod() : Manifest
  • SetFixedTimeStep() : StepTimer
  • SetFolder() : FileDataSource , FileDataSource2
  • SetFrequency() : RippleEffect , WASAPIRenderer
  • SetGameInfoOverlay() : GameMain
  • SetGameLoading() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , IGameUIControl , sealed
  • SetGameOver() : GameInfoOverlay , IGameUIControl , sealed , IGameUIControl , GameInfoOverlay
  • SetGameStats() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed , IGameUIControl
  • SetGeotagButton_Click() : Scenario1_Geotag , sealed
  • SetGeotagFromGeolocatorButton_Click() : sealed , Scenario1_Geotag
  • SetGradientPatternToLampArray() : Scenario1_Basics
  • SetGraph() : FilmicEffect , LuminanceHeatmapEffect , SdrOverlayEffect , DftEffect , RippleEffect , WaveEffect , ReinhardEffect
  • SetGUID() : CBaseAttributes< TBase >
  • SetHologramEnabled() : MediaCaptureManager
  • SetHolographicSpace() : _360VideoPlaybackMain , DeviceResources , HolographicApp1Main , DeviceResources , BasicHologramMain , DeviceResources , HolographicFaceTrackerMain , DeviceResources , HolographicMRCSampleMain , DeviceResources , HolographicSpatialMappingMain , HolographicSpatialStageMain , DeviceResources , HolographicTagAlongSampleMain , HolographicVoiceInputMain , DeviceResources , HolographicPaintMain , DeviceResources , BasicHologramMain , HolographicTemplateAppMain , DeviceResources
  • SetHWOffload() : WASAPIRenderer
  • SetIgnoreLayout() : BaseElement
  • setIncrementalFileList() : Scenario1
  • SetInkSynchronizer() : SceneComposer
  • SetInterfaceSetting() : Scenario6_InterfaceSettings
  • SetInternalFocus() : CustomEditControl
  • SetIsActive() : final
  • SetIsUpperCaseEnabledAsync() : ISecureInterfaceService , sealed , Scenario1ViewModel , SecureInterfaceService , sealed
  • SetIsVisible() : BaseElement , BaseControl
  • SetItem() : MediaListViewModel , CBaseAttributes< TBase >
  • SetItemInvokedCallback() : sealed
  • SetLayoutHorizontal() : BaseElement
  • SetLayoutWidth() : sealed
  • SetLedBlinkPattern : SuperMutt::VendorCommand
  • SetLedBlinkPattern_Click() : sealed , FeatureReports
  • SetLedBlinkPatternAsync() : sealed , FeatureReports
  • SetLevelStart() : IGameUIControl , GameInfoOverlay , sealed , IGameUIControl , GameInfoOverlay
  • SetLicenseInfo() : GameHud
  • SetLineSpacing() : sealed
  • SetLineSpacingDefaults() : sealed
  • setLiveOffsetButton_Click() : LiveDashPlayer
  • SetLiveOffsetValue() : Player
  • SetLockScreenImage() : sealed , SetLockScreenImage
  • SetLogicalSize() : DeviceResources
  • SetLowLatency() : WASAPIRenderer
  • SetLowLatencyCapture() : WASAPICapture
  • SetMapProjection() : sealed , Scenario1
  • SetMapStyle() : sealed , Scenario1
  • SetMapStyleSheet() : sealed , Scenario9
  • SetMargins() : sealed
  • SetMaterialIndicesAsync() : Scenario1_Print
  • SetMaxBitrateForProtectionLevel() : Scenario3_RequestModification
  • SetMediaSource() : ProjectionViewPage
  • SetMediaStreamProperties() : CMediaSink
  • SetMediaStreamPropertiesAsync() : MediaCapturePreviewer
  • SetMinimumSize_Click() : sealed , Scenario1_Basic
  • SetMoveRect() : MoveLookController
  • SetNewMediaItem() : Scenario1
  • SetNextSelectedPeriod() : Manifest
  • SetOffset() : CMediaBufferWrapper
  • SetOnAirTapCallback() : ControlBase , IControl
  • SetOrientation() : Tool
  • SetOsrFx2SevenSegmentAsync() : Scenario2_ControlTransfer
  • SetOsrFx2SevenSegmentSetting_Click() : Scenario2_ControlTransfer
  • SetOutputFileButton() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • SetPageContent() : CustomTitleBar
  • SetParentControlInformation() : FocusableElement
  • SetParentTransform() : BaseControl , BaseElement
  • SetPasswordExplainVisibility() : sealed , Scenario3_CredentialPickerOptions
  • SetPause() : GameInfoOverlay , sealed , IGameUIControl
  • SetPhase() : RippleEffect
  • SetPickFileButton() : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • setPin : sealed , Scenario2_Listen
  • SetPinHigh_Click() : sealed , Scenario1_GetAndSetPin
  • SetPinLow_Click() : Scenario1_GetAndSetPin , sealed
  • SetPlane() : Face
  • SetPlaybackEnabled() : ViewModelBase
  • SetPosition() : BaseControl , SpinningCubeRenderer , IControl , SpinningCubeRenderer , Tool , ToolCarousel , ControlBase
  • SetPresentationClock() : CMediaSink
  • SetPreviewRotationAsync() : Scenario5_DisplayingBarcodePreview , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage , sealed , MainPage , Scenario5_DisplayingBarcodePreview
  • SetProductItems() : sealed
  • SetProjParams() : Camera
  • SetProperties() : AudioEchoEffect , CMediaSink , CSchemeHandler , WASAPIRenderer , WASAPICapture
  • SetProperty< T >() : BindableBase
  • SetQualityLevel() : CMediaStream
  • SetQueueID() : EmbeddedMFAsyncCallback< Callback >
  • SetRadioState() : RadioModel
  • SetRadius() : Ellipse , FilledEllipse
  • SetRate() : CMediaSource , CMediaStream
  • SetRatio() : CBaseAttributes< TBase >
  • SetRawAudio() : WASAPIRenderer
  • SetReadingText() : MainPage
  • SetRecognizerByName() : sealed , Scenario4
  • SetRect() : Rectangle , FilledRectangle
  • SetRectSize() : RectRenderer , LowLatencyInputMain
  • SetReleasedUI() : sealed , Scenario3_MultipleDrawers
  • SetRenderElement() : BaseControl
  • SetRenderOptions() : D2DAdvancedColorImagesRenderer
  • SetResult() : sealed , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions , SimpleTaskCompletionSource< T > , SimpleTaskCompletionSource< void > , Scenario1_Message
  • SetRotation() : ControlBase , IControl
  • SetSampleAttributes() : CMediaStream
  • SetSamplePeriod() : ServiceViewModel , Metering , sealed
  • SetSampleRate() : ServiceViewModel , sealed
  • SetScale() : BaseControl , ControlBase , IControl
  • SetScaleValue() : D2DSvgImageRenderer
  • SetSelectedDevice() : DeviceList
  • SetSelectedModel() : ContentSelector
  • SetSelection() : CustomEditControl
  • SetSelectionAndNotify() : CustomEditControl
  • SetServiceOptionsAsync() : sealed , DiscoveredDeviceWrapper
  • SetServiceStatus() : CServiceBase
  • SetSevenSegmentDisplay : Fx2Driver
  • setShowDelete() : sealed
  • setShowDestinationValidation() : sealed
  • SetSingleControl() : MainPage
  • SetSize() : CBaseAttributes< TBase >
  • SetSkewX() : WaveEffect
  • SetSkewY() : WaveEffect
  • SetSocket() : CNetworkChannel
  • SetSource_Click() : ContentSelector
  • SetSourceEnabled() : ContentSelector
  • SetSpread() : RippleEffect
  • SetStartDateTimeToUI() : Scenario4_ForegroundGeofence
  • SetStartPoint() : Line
  • SetState() : DeviceStateSourceT< D >
  • SetStateNoNotify() : DeviceStateSourceT< D >
  • SetStatus() : PropertyGetContext< T > , PropertySetContext , PropertyGetContext< T > , PropertySetContext , sealed
  • SetString() : CBaseAttributes< TBase >
  • SetStyleSheetStateCombobox_SelectionChanged() : sealed , Scenario11
  • SetSubstatus() : Scenario4_CompletionGroups
  • SetSuperMuttInterfaceSetting_Click() : Scenario6_InterfaceSettings
  • SetSuperMuttLedBlinkPattern_Click() : Scenario2_ControlTransfer
  • SetSuperMuttLedBlinkPatternAsync() : Scenario2_ControlTransfer
  • SetSwapChainPanel() : DeviceResources
  • SetSwitch() : Button
  • SetSymbologyAttributes_Click() : Scenario4_SymbologyAttributes
  • SetSystemAudioEnabled() : MediaCaptureManager
  • SetTargetElapsedSeconds() : StepTimer
  • SetTargetElapsedTicks() : StepTimer
  • SetTargetPosition() : SpinningCubeRenderer
  • SetTexCoordScaleAndOffset() : QuadRenderer
  • SetText() : Text
  • SetTextBackgroundColor() : sealed
  • SetTextColor() : sealed
  • SetTexture() : Material
  • SetTextureHeight() : BaseControl
  • SetTextureWidth() : BaseControl
  • SetTilePayload() : UpdateFourTilesControl
  • settingName : Scenario3_SettingContainer , Scenario4_CompositeSettings , Scenario7_SetVersion , Scenario4_CompositeSettings , Scenario7_SetVersion
  • SettingName : Scenario2_Settings
  • settingName : Scenario3_SettingContainer
  • settingName1 : Scenario4_CompositeSettings
  • settingName2 : Scenario4_CompositeSettings
  • settings : SettingsService
  • Settings() : Settings
  • SettingsService_UseCustomControlsChanged() : Scenario1
  • settingValue0 : Scenario7_SetVersion
  • settingValue1 : Scenario7_SetVersion
  • SetTitle() : SecondaryViewPage
  • SetTitle_Click() : SecondaryViewPage
  • SetToolByIndex() : HolographicPaintMain
  • SetTranscodeButton() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • SetTranslation() : BaseElement
  • SetTriangleIndicesAsync() : Scenario1_Print
  • SetUI() : Scenario2_MultipleScanners
  • SetUINT32() : CBaseAttributes< TBase >
  • SetUINT64() : CBaseAttributes< TBase >
  • SetUnknown() : CBaseAttributes< TBase >
  • Setup_Click() : Scenario1
  • SetUpAccounts() : UserSelect , sealed
  • SetupBackgroundTask() : Scenario7_SyncDevice
  • SetUpBasedOnStateAsync() : sealed , MainPage
  • SetupBlur() : Scenario2_Conditional
  • SetupBroadcastScenarioUI() : sealed , Scenario5
  • SetupDataSource() : FileDataSource
  • SetupDataSourceImpl() : FileDataSource
  • SetupDataSourceUsingPicturesFolder() : FileDataSource
  • SetupDataSourceUsingPicturesFolderImpl() : FileDataSource
  • SetupDestinationEffect() : Scenario2_Conditional
  • SetUpDeviceScenarios() : Utilities
  • SetupMulticastScenarioUI() : sealed , Scenario5
  • SetUpProtectionManager() : PlayReadyHelper
  • SetupSystemMediaTransportControls() : Scenario1
  • SetupUiAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed
  • SetUpVideoStabilizationRecommendationAsync() : MainPage , sealed
  • SetupVisualization() : Scenario1_DetectInPhoto , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario1_DetectInPhoto
  • SetValue() : PropertyGetContext< T >
  • SetValuesFromLineDisplay() : sealed , Scenario4_UpdatingLineDisplayAttributes
  • SetVariantArg() : TypeConversionHelpers
  • SetVariantStructureArg() : TypeConversionHelpers
  • SetVersion0_Click() : Scenario7_SetVersion
  • SetVersion1_Click() : Scenario7_SetVersion
  • SetVersionHandler0() : Scenario7_SetVersion
  • SetVersionHandler1() : Scenario7_SetVersion
  • SetVerticesAsync() : Scenario1_Print
  • SetViewParams() : Camera
  • SetViewSize() : DeviceResources
  • SetVisibility() : Scenario2_Client
  • SetVolumeOnSession() : WASAPIRenderer
  • SetWasdPatternToLampArray() : Scenario1_Basics
  • SetWaveOffset() : WaveEffect
  • SetWindow() : sealed , AppView , sealed , DeviceResources , sealed , VisualProperties , DeviceResources , sealed , DeviceResources , sealed , DeviceResources , sealed , DeviceResources , sealed , DeviceResources , App , DeviceResources , sealed , AppView , sealed
  • SetZoomLevel() : MainPage
  • SevenLedSegmentMask : OsrFx2
  • SevenSegmentToDigit() : Fx2Driver
  • SevenSegmentValues : Fx2Driver
  • ShaderModel : FxCompile
  • ShaderType : FxCompile
  • ShadowsValue : PhotoAdjustmentProperties
  • shakeCounter : sealed
  • Shaken() : sealed , Scenario2_ShakeEvents
  • shakenToken : sealed
  • shape : Shape
  • ShapeObject() : SceneComposer::ShapeObject
  • ShapeRenderer() : ShapeRenderer
  • Share_Click() : Scenario12_ShareData
  • ShareApplicationLink() : ShareApplicationLink , sealed
  • ShareContent_Click() : Scenario7_Share
  • ShareCustomData() : sealed , ShareCustomData
  • ShareCustomProvider() : ShareCustomProvider , sealed
  • sharedApplicationLink : ShareTarget
  • sharedBitmapStreamRef : ShareTarget
  • sharedCustomData : ShareTarget
  • sharedDataContentSourceApplicationLink : ShareTarget
  • sharedDataContentSourceWebLink : ShareTarget
  • sharedDataDescription : ShareTarget
  • sharedDataLogoBackgroundColor : ShareTarget
  • sharedDataPackageFamilyName : ShareTarget
  • sharedDataSquare30x30Logo : ShareTarget
  • sharedDataTitle : ShareTarget
  • ShareDelayRenderedFiles() : sealed , ShareDelayRenderedFiles
  • sharedFlyout : sealed , Scenario3
  • sharedHtmlFormat : ShareTarget
  • sharedResourceMap : ShareTarget
  • sharedStorageItems : ShareTarget
  • sharedText : ShareTarget
  • sharedThumbnailStreamRef : ShareTarget
  • sharedWebLink : ShareTarget
  • ShareFiles() : sealed , ShareFiles
  • ShareHtml() : ShareHtml , sealed
  • ShareImage : SocialMediaCounter , ShareImage , sealed
  • ShareImageProperty : SocialMediaCounter
  • shareOperation : ShareTarget
  • shareQuickLinkId : Scenario13_ShareTarget , ShareTarget
  • ShareTarget() : ShareTarget
  • ShareText() : sealed , ShareText
  • ShareWebLink() : sealed , ShareWebLink
  • ShareWebView_NavigationCompleted() : ShareHtml , sealed
  • ShouldApplyContentZoomFactor() : DeviceResources
  • ShouldAttemptToConnectToInternet() : Helpers
  • ShouldDropSample() : CMediaStream
  • ShouldGoToWideState() : DetailPage , DetailsPage , DetailPage , DetailsPage
  • ShouldIgnoreCertificateErrorsAsync() : sealed , Scenario5
  • ShouldMirrorPreview() : sealed , CameraRotationHelper
  • Show() : MediaTransportControls
  • Show_Click() : Scenario5_Show
  • ShowAsStandalone_Click() : Scenario1
  • ShowConnection() : ShowConnection
  • ShowConnectionUI_Click() : ShowConnection
  • ShowConsentGroups() : Scenario3_CheckUserConsentGroup
  • ShowContactCard_Click() : sealed , Scenario1_Mini , sealed , Scenario2_DelayMini , Scenario3_Full
  • ShowContactCardWithOptions_Click() : sealed , Scenario1_Mini
  • ShowContactCardWithPlacement_Click() : Scenario1_Mini , sealed
  • ShowCursor() : MoveLookController
  • ShowDelete : TripViewModel
  • showDelete : sealed , TripViewModel
  • showDestinationValidation : sealed , TripViewModel
  • ShowDestinationValidation : TripViewModel
  • ShowDevicePicker() : Scenario1_DevicePicker , sealed , Scenario1_DevicePicker
  • ShowDevicePickerButton_Click() : Scenario1_DevicePicker , sealed , Scenario1_DevicePicker
  • ShowDialog() : ManageCardScenario
  • ShowFormatButton_Click() : OtherScenarios
  • ShowGameInfoOverlay() : IGameUIControl , GameInfoOverlay , sealed , GameInfoOverlay
  • ShowGuidance() : CalibrationBar , sealed , CalibrationBar
  • ShowGuidanceButton_Click() : sealed , CalibrationBar , sealed , CalibrationBar
  • showHeader : CustomOptionsPrintHelper
  • ShowImage : CustomOptionsPrintHelper
  • ShowItem() : Scenario2 , Scenario1
  • ShowListButton_Click() : sealed , Scenario7
  • ShowOnboardeeSsidList() : Scenario2ViewModel
  • ShowOnboarderSsidList() : Scenario2ViewModel
  • ShowPackageFamilyName() : ShowPackageFamilyName
  • ShowPairingPanel() : sealed , Scenario9_CustomPairDevice
  • ShowPlaceholder() : sealed , Functions
  • ShowPreviewButton_Click() : Scenario5_DisplayingBarcodePreview
  • ShowPrintUIAsync() : PrintHelper
  • ShowProgressScreen() : sealed , AdventureWorksVoiceCommandService
  • ShowProperties() : Scenario1_FindUsers
  • ShowPropertiesButton_Click() : sealed , Scenario6
  • ShowResults_Click() : Scenario2_Lang , Scenario3_Enum , sealed , Scenario4_UnicodeExtensions , sealed , Scenario3_Enum , sealed , Scenario1_Data , Scenario5_TimeZone , Scenario2_Stats , Scenario4_UnicodeExtensions , sealed , Scenario1_Prefs , Scenario3_Region , Scenario2_Stats , sealed , Scenario1_Data , Scenario5_TimeZone , sealed , Scenario4_Input , Scenario1_Prefs , Scenario2_Lang , Scenario4_Input
  • ShowSatelliteData() : Scenario2_GetPosition
  • showSpaceNeedleButton_Click() : sealed , Scenario4
  • ShowStandardSystemOverlaysButton_Click() : Scenario1_Basic , sealed
  • ShowStatusMessage() : sealed
  • ShowStoreFlyout() : sealed
  • showStreetSideNearSpaceneedle_Click() : Scenario5 , sealed
  • ShowText : CustomOptionsPrintHelper , Scenario8 , sealed
  • ShowToast() : App , UpdateFileTask , SocketActivityTask
  • ShowTooSmall() : IGameUIControl , GameInfoOverlay , sealed , GameInfoOverlay
  • ShowTrialPeriodInformation() : Scenario1_TrialMode , sealed
  • ShowTrip() : sealed , TripViewModel
  • ShowUIButton_Click() : SharePage
  • ShowUnhandledException() : UnhandledExceptionPage
  • ShowVisual() : EdgeTappedListView
  • ShowWindowBtn_Click() : Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario4_CompactOverlay , Scenario5_RelativePositioning
  • Shutdown() : MFSampleGenerator , CServiceBase , CStreamSink , CMediaSource , MFSampleGenerator , CMediaStream , CMediaSink
  • ShutdownWebcamAsync() : Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam
  • ShutterCheckBox_CheckedChanged() : MainPage
  • ShutterSlider_ValueChanged() : MainPage
  • SignalBackgroundTask() : sealed , ApplicationTriggerTask , sealed , ApplicationTriggerTask
  • Signals_ConnectionResultReceived() : Scenario2ViewModel
  • Signals_TextSentReceived() : Scenario1ViewModel
  • SignalText : Scenario1ViewModel
  • signature : TypeConversionHelpers
  • Signature : SignatureMessage
  • SignIn() : sealed , SignIn
  • SignInPassportAsync() : SignIn , sealed
  • SignInPasswordAsync() : sealed , SignIn
  • SignInWithHello() : MainPage
  • SignInWithHelloAsync() : MainPage
  • SignInWithPassword() : MainPage
  • SignOut() : AccountOverviewPage
  • SimCard() : SimCard
  • Simple3DGame() : Simple3DGame
  • SimpleLogger() : sealed , SimpleLogger
  • SimpleOrientationSensor_OrientationChanged() : sealed , CameraRotationHelper
  • SimpleTaskCompletionSource() : SimpleTaskCompletionSource< void >
  • Simulate_Update_Collision_Click() : FileSavePicker_SaveToCachedFile
  • simulateUpdateConflict : FileSavePicker_SaveToCachedFile
  • SingleAccountScenario() : SingleAccountScenario
  • SingleAzureADScenario() : SingleAzureADScenario
  • SingleMicrosoftAccountScenario() : SingleMicrosoftAccountScenario
  • SingleSpace_Click() : sealed
  • singletonCreationLock : EventHandlerForDevice
  • SintelMediaUri : MainPage
  • size : DDS_HEADER , ImageInfo , DDS_PIXELFORMAT , sealed , sealed::sealed , sealed , DDS_HEADER
  • Size : FileItem , GroupInfoList
  • SizeCounter() : sealed::sealed
  • SizePreferenceString() : SizePreferenceString
  • sizeX : WaveEffect
  • sizeY : WaveEffect
  • SkeletalFrameRenderer() : sealed
  • skewX : WaveEffect
  • skewY : WaveEffect
  • SkipButton_Click() : Scenario3_ForegroundApp
  • SkipNext() : PlayerViewModel
  • SkipPrevious() : PlayerViewModel
  • SkipSetup() : EnableHelloPage
  • SKUNumber : RawSMBIOSSystemInfo
  • Sleep() : sealed , PhasingTests
  • Slider_ValueChanged() : sealed
  • slider_ValueChanged() : sealed , MeteringData
  • SliderChanged() : sealed
  • sliderEnabled : sealed
  • SliderEnabled : ServiceViewModel
  • sliderEnabled : ServiceViewModel
  • sliderFrequency_ValueChanged() : Scenario2 , Scenario3 , sealed
  • sliders : Scenario1_EventAndMenuHookup , sealed
  • sliderValue : sealed , ServiceViewModel
  • SliderValue : ServiceViewModel
  • sliderVolume_ValueChanged() : sealed , Scenario2 , Scenario3 , sealed
  • SlowInputStream() : SlowInputStream
  • SlowPhasing_Checked() : PhasingTests , sealed
  • SlowPhasing_UnChecked() : PhasingTests , sealed
  • smartCard : IccDetection
  • smartCardItems : sealed
  • SmartCardListItem() : SmartCardListItem
  • SmartCardReaderDeviceId : MainPage
  • SMBIOSMajorVersion : RawSMBIOSData
  • SMBIOSMinorVersion : RawSMBIOSData
  • SMBIOSTableData : RawSMBIOSData
  • smtcPositionUpdateTimer : Scenario1
  • snapDistance : Scenario5_InkingAndInteractionFeedback
  • SnapInitialSizeToRootElement() : BaseControl
  • SnapMovableRectToGridLines() : Scenario5_InkingAndInteractionFeedback
  • Snapshot : Scenario2_DetectInWebcam
  • SnapshotCanvas_SizeChanged() : Scenario2_DetectInWebcam
  • SocialMediaCounter() : SocialMediaCounter
  • socket : Scenario2_ChatServer , sealed , RfcommServerTask , Scenario1_Connect
  • SocketContext() : sealed
  • socketId : SocketActivityTask , Scenario1_Connect
  • SocketList : SessionWrapper
  • socketList : SessionWrapper
  • socketListener : Scenario2_ChatServer
  • SocketReaderWriter() : sealed , SocketReaderWriter
  • socketRW : ConnectedDevice
  • SocketRW() : ConnectedDevice
  • socketRW : sealed
  • SocketWrapper() : SocketWrapper , sealed
  • SoftAPPassword : Scenario2ViewModel
  • SoftwareMajorVersion : CardDetails
  • SoftwareMinorVersion : CardDetails
  • SoftwareProtocolType : CardDetails
  • SoftwareStorageSize : CardDetails
  • SoftwareSubType : CardDetails
  • SoftwareTriggerStarted() : Scenario5_DisplayingBarcodePreview
  • SoftwareType : CardDetails
  • SoftwareVendorID : CardDetails
  • SolidAngleSteradian : PresentationFormats
  • SOT_Generic : SceneComposer
  • SOT_Ink : SceneComposer
  • SOT_Shape : SceneComposer
  • SoundEffect() : SoundEffect
  • SoundEffectEngine() : Audio
  • SoundLevelToString() : PlaybackControl
  • SoundSourceType : OmnidirectionalSound
  • source : WICConvert
  • Source : FxCompile , VideoGallery::VideoItemInfo
  • source : VideoItemInfo
  • Source : TitledImage
  • Source_OpenOperationCompleted() : Scenario6_AdInsertion , Scenario5_Metadata
  • SourceBufferManager() : SourceBufferManager
  • sourceBuffers : Player
  • SourceComboBox_SelectionChanged() : sealed , Scenario2_FindAvailableSourceGroups
  • sourceDistortionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • SourceGrid_DragStarting() : Scenario2_DragUICustomization , sealed
  • SourceGroup : FrameSourceInfoModel , FrameSourceGroupModel , sealed
  • SourceGroupCollection() : sealed , SourceGroupCollection
  • SourceHandler() : SourceHandler
  • SourceId() : SourceHandler
  • sourceImage : GpuCoordinateMapper::RasterizedFrameBlob
  • sourceImageHeightLimit : Scenario1_DetectInPhoto
  • SourceInfo : FrameSourceInfoModel , sealed
  • sourceInfo : FrameSourceState
  • SourceInfos : sealed , FrameSourceGroupModel
  • SourceInterfaces : sealed
  • sourceIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • SourceList_SelectionChanged() : Scenario1
  • SourceListView_DragItemsStarting() : sealed , Scenario1_ListView
  • SourceObjects : sealed
  • SourcePositionX_ValueChanged() : sealed
  • SourcePositionY_ValueChanged() : sealed
  • SourcePositionZ_ValueChanged() : sealed
  • SourcePressed() : IDPadHelper , TouchpadDPadHelper
  • sourceProjectionMatrix : GpuCoordinateMapper::RasterizedFrameBlob
  • SourceProperty : TitledImage
  • sourceRotation : sealed
  • sources : Item
  • sourceState : SpatialInputHandler
  • SourceTextBlock_DragStarting() : sealed , Scenario3_StartDragAsync
  • SourceTextBlock_PointerMoved() : sealed , Scenario3_StartDragAsync
  • SourceUri : VideoItem
  • sourceUri : AppViewSource , AppView
  • sourceUrl : DASHEntry
  • SourceUrl : Manifest
  • sourceUrl : Manifest
  • SpatialControllerHandler() : SpatialControllerHandler
  • SpatialInputHandler() : SpatialInputHandler
  • spatialLocator : HolographicTemplateAppMain
  • SpatialStageManager() : SpatialStageManager
  • Speak_Click() : sealed , Scenario_SynthesizeTextBoundaries , sealed , Scenario_SynthesizeText , Scenario_SynthesizeSSML
  • SpecificEnergyJoulePerKilogram : PresentationFormats
  • SpecificHeatCapacityJoulePerKilogramKelvin : PresentationFormats
  • SpecificHistory_Checked() : sealed , Scenario2_History
  • SpecificVolumeCubicMetrePerKilogram : PresentationFormats
  • specularColor : ConstantBufferChangesEveryPrim
  • specularPower : ConstantBufferChangesEveryPrim
  • speechContext : Scenario_ListConstraint , Scenario_ContinuousRecognitionListGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SynthesizeTextBoundaries , Scenario_SynthesizeText , Scenario_PredefinedDictationGrammar , Scenario_SynthesizeSSML , Scenario_SRGSConstraint , sealed , Scenario_ContinuousRecognitionSRGSGrammar
  • speechRecognizer : Scenario_PauseAsync , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_PredefinedDictationGrammar , Scenario_SRGSConstraint , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint
  • SpeechRecognizer_HypothesisGenerated() : sealed , Scenario_ContinuousDictation
  • SpeechRecognizer_StateChanged() : sealed , Scenario_ContinuousDictation , Scenario_PauseAsync , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ContinuousRecognitionListGrammar , sealed
  • speechResourceMap : Scenario_SynthesizeTextBoundaries , sealed , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint , Scenario_SynthesizeText , Scenario_ListConstraint , Scenario_SynthesizeSSML , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar
  • speedButton_Click() : Scenario1 , Scenario6
  • Sphere() : Sphere
  • SphereMesh() : SphereMesh
  • SpinningCubeRenderer() : SpinningCubeRenderer
  • splash : ExtendedSplash
  • splashImageRect : ExtendedSplash
  • SplashImageRect : MainPage
  • SplitViewButton_Click() : MainPage
  • spread : RippleEffect
  • squareBitmap : GeneratedBitmapState
  • squareBuffer : GeneratedBitmapState
  • squareLength : GeneratedBitmapState
  • squareY : GeneratedBitmapState
  • srwSingletonCreationLock : sealed
  • Ssid : WiFiNetworkDisplay
  • StandardOptionsPrintHelper() : StandardOptionsPrintHelper , sealed
  • Start() : CStreamSink , Turn , Period , Print3D , Scenario1ViewModel , BackgroundActivity , CServiceBase , MidiDeviceWatcher , CardioidSound , CMediaSource
  • start : Period
  • Start() : CustomDecaySound , OmnidirectionalSound , GameTimer , OmnidirectionalSound , Animate , sealed , BackgroundActivity , sealed , Scenario2ViewModel , Scenario1ViewModel , CMediaStream
  • Start_Click() : sealed , OvenClient , sealed , Scenario03_GetList , sealed , Scenario01_GetText , Scenario03_GetList , sealed , Scenario13_RetryFilter , CustomException , Scenario02_GetStream , Scenario14_MeteredConnectionFilter , Scenario01_GetText , Scenario07_PostStreamWithProgress , sealed , Scenario15_ServerCertificateValidation , sealed , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario04_PostText , Scenario02_GetStream , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario08_PostCustomContent , Scenario14_MeteredConnectionFilter , sealed , Scenario13_RetryFilter , Scenario15_ServerCertificateValidation , sealed , OvenClient , sealed , CustomException , sealed , OvenClient , CustomException , sealed , OvenClient
  • StartAdvertisement() : WiFiDirectServiceManager
  • StartAsync() : CameraStreamProcessor , CameraCoordinateMapper , Scenario2_Binary , sealed
  • StartBleDeviceWatcher() : Scenario1_Discovery
  • StartButton_Click() : Scenario2_FindAvailableSourceGroups , sealed , Scenario3_StartDragAsync
  • startButtonEnabled : ServiceViewModel
  • StartButtonEnabled : ServiceViewModel
  • startButtonEnabled : sealed
  • StartCameraAsync() : OcrCapturedImage , sealed , OcrCapturedImage
  • StartCaptureAsync() : WASAPICapture
  • startDate : sealed , Trip
  • StartDate : Trip
  • StartDevice() : sealed , Scenario2 , Scenario3 , sealed
  • StartDeviceWatcher() : EventHandlerForDevice , sealed , EventHandlerForDevice
  • StartDeviceWatchers() : Scenario1_ConnectDisconnect , sealed , Scenario1_ConnectDisconnect , DeviceConnect
  • StartDownload() : Scenario1_Download , sealed
  • StartDownload_Click() : sealed , Scenario5_RandomAccess , Scenario1_Download , Scenario7_DownloadReordering , sealed , Scenario6_RecoverableErrors , sealed
  • StartDownloadAndReadContentsAsync() : Scenario5_RandomAccess , sealed
  • StartDownloadsButton_Click() : Scenario4_CompletionGroups , sealed
  • StartFadeIn() : QuadRenderer
  • StartFadeOut() : QuadRenderer
  • StartFadeOutContents() : Scenario3
  • startFetchData() : ItemCacheManager< T >
  • StartFunc() : StartFunc
  • StartFx2Watcher() : DeviceList
  • StartHandlingAppEvents() : DeviceConnect , Scenario1_ConnectDisconnect , sealed
  • StartHighPriorityDownload_Click() : Scenario1_Download , sealed
  • startImmediately : Scenario4_ForegroundGeofence
  • StartingRecord : MediaCaptureManager
  • StartInputLoop() : PlaybackPage , sealed
  • StartInterruptMessageWorker() : sealed
  • StartLassoSelection() : SceneComposer
  • StartLevel() : Simple3DGame
  • StartListener_Click() : sealed , Scenario1 , Scenario5 , Scenario1 , sealed
  • StartListening() : CMediaSink
  • StartLocationTrackingAsync() : sealed , LocationTrackingReason
  • StartLogging() : sealed , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , sealed
  • StartManifestReloadTimer() : Player
  • StartMediaCaptureAsync() : Scenario5_DisplayingBarcodePreview
  • StartMetering() : ServiceViewModel , Metering , sealed
  • StartMeteringAndWaitForStop() : ServiceViewModel , sealed
  • StartMonitoring() : Scenario7_ForegroundVisits
  • StartMonitoring_Click() : AccountWatcher
  • StartMultipartUpload_Click() : sealed , Scenario2_Upload
  • StartMultipleFilesUpload() : Scenario2_Upload
  • startNumber : MediaSegmentInformation
  • StartNumber : MediaSegmentInformation
  • StartPlayback() : WASAPIRenderer
  • StartPlaybackAsync() : WASAPIRenderer
  • StartPreviewAsync() : sealed , MainPage , sealed , OcrCapturedImage , MainPage , sealed , MainPage , sealed , MainPage , sealed
  • StartPrinting() : Print3D
  • StartProcessingDataVirtualizationScrollOffsets() : ChatListView , sealed
  • StartProjecting() : sealed , Scenario3
  • StartProjecting_Click() : sealed , Scenario1 , Scenario2 , sealed
  • StartReaderAsync() : Scenario2_FindAvailableSourceGroups , sealed
  • StartReceiveData() : sealed
  • StartReceiveLoop() : sealed
  • StartReceiving() : CMediaSink
  • StartRecognizeSpeechCommands() : HolographicVoiceInputMain
  • StartRecordingAsync() : MainPage , sealed , MediaCaptureManager , sealed , MainPage , CaptureDevice , sealed , MainPage
  • StartRecordingToCustomSink() : LowLatency , sealed
  • StartRecordingToCustomSinkAsync() : sealed
  • StartRecordToCustomSink() : VideoChat
  • StartRenderLoop() : GameMain , LowLatencyInputMain
  • StartRotation() : ToolCarousel
  • StartScan : Scenario2ViewModel
  • StartScanning() : Scenario2ViewModel
  • StartScenario() : Scenario1_GetAndSetPin , Scenario2_Listen , sealed
  • StartScenarioAsync() : Scenario1_ReadData , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData
  • StartScrollingButton_Click() : sealed , Scenario7_ScrollingContentUsingMarquee
  • StartSendData() : sealed
  • StartSensorBackgroundTaskAsync() : Scenario1_DeviceUse , sealed
  • StartSingleFileUpload() : Scenario2_Upload
  • StartSoftwareTriggerButton_Click() : Scenario5_DisplayingBarcodePreview
  • StartSource() : MFSampleGenerator
  • StartStopAllEffects() : Scenario2_Effects
  • StartStopScenario_Click() : Scenario2_Listen , Scenario1_ReadData , sealed , Scenario1_ReadData , Scenario2_Listen , sealed , Scenario1_GetAndSetPin , sealed , Scenario1_GetAndSetPin , Scenario1_ReadData , sealed
  • StartStrokeSelection() : sealed
  • StartSuperMuttInputReports() : sealed , InputReportEvents
  • StartSyncBackgroundTaskAsync() : Scenario7_SyncDevice
  • StartTime : TrackingEventCue
  • startTime : sealed
  • StartTimerForFrame() : GpuPerformanceTimer
  • StartTimestamp : MediaSegmentInformation
  • startTimestamp : MediaSegmentInformation
  • StartTracking() : Scenario1_TrackPosition
  • StartUnpairedDeviceWatcher() : Scenario1_ChatClient
  • StartUpload_Click() : Scenario2_Upload , sealed
  • StartUsingWindowsHello() : EnableHelloPage
  • StartViewInUse() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • StartWatcher() : sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , DeviceWatcherHelper , sealed , Scenario3_BackgroundDeviceWatcher , Scenario8_PairDevice , Scenario9_CustomPairDevice , sealed , Scenario3_BackgroundDeviceWatcher , DeviceWatcherHelper , sealed , Scenario6_CustomFilterAddedProps , Scenario2_DeviceWatcher
  • StartWatcherButton_Click() : sealed , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , sealed , Scenario2_DeviceWatcher , sealed , Scenario6_CustomFilterAddedProps , sealed , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario3_BackgroundDeviceWatcher , Scenario9_CustomPairDevice , Scenario8_PairDevice
  • StartWatchers() : Scenario7_DeviceInformationKind , sealed
  • StartWatching() : Scenario2_WatchUsers
  • StartWebcamStreamingAsync() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • State : CStreamSink , MediaCaptureManager , LowLatency
  • State_Count : CStreamSink
  • State_Paused : CStreamSink
  • State_Ready : CStreamSink
  • State_Started : CStreamSink
  • State_Stopped : CStreamSink
  • State_TypeNotSet : CStreamSink
  • StateChanged : MainPage
  • StateChangedEvent : sealed
  • stateChangedToken : sealed
  • stateText : DownloadOperationItem
  • StaticBitmapButton_Click() : Scenario2_Effects
  • StaticBitmapEffect_BitmapRequested() : Scenario2_Effects
  • stationaryReferenceFrame : HolographicTemplateAppMain
  • Status : AdvertisementWrapper
  • STATUS_SUCCESS : SubjectPublicKeyInfo
  • StatusChanged : FileLoggingSessionScenario , LoggingSessionScenario
  • StatusMessage : UnhandledExceptionPage
  • statusUpdatedToken : sealed
  • STDMETHOD_() : EmbeddedMFAsyncCallback< Callback >
  • STDMETHODIMP_() : CStreamSink::CAsyncOperation , MFSampleGenerator , CStreamSink::CAsyncOperation , MFSampleGenerator , AsyncCallback< T >
  • stencilButtonCheckedChangedToken : sealed
  • Step : StepsHelperControl , StepsControl
  • Step1 : Print3D
  • Step2 : Print3D
  • Step3 : Print3D
  • StepChanged : StepsControl
  • stepCount : Scenario4_BackgroundPedometer , sealed
  • stepCountGoalOffset : sealed
  • stepGoal : sealed , Scenario4_BackgroundPedometer
  • stepGoalOffset : Scenario4_BackgroundPedometer
  • stepKind : sealed , HistoryRecord
  • StepKind : HistoryRecord
  • StepProperty : StepsHelperControl , StepsControl
  • StepsControl() : StepsControl
  • StepsControl_Loaded() : StepsControl
  • stepsControl_StepChanged() : ScenarioElement
  • stepsCount : HistoryRecord
  • StepsCount : HistoryRecord
  • stepsCount : sealed
  • stepsDuration : HistoryRecord , sealed
  • StepsDuration : HistoryRecord
  • StepTimer() : StepTimer
  • stereoExaggerationFactor : STEREO_PARAMETERS
  • stereoSeparationFactor : STEREO_PARAMETERS
  • Stop() : CServiceBase , CStreamSink , MidiDeviceWatcher , sealed , PlaybackControl , CMediaStream , CMediaSource , OmnidirectionalSound , CardioidSound , GameTimer , CustomDecaySound , OmnidirectionalSound , sealed
  • StopAdvertisement() : Scenario1_Advertiser
  • StopAdvertisement_Click() : sealed , Scenario2
  • StopAllScrollingAsync() : Scenario7_ScrollingContentUsingMarquee , sealed
  • StopAnimationTapped() : Scenario12 , sealed
  • StopAsync() : sealed , CameraCoordinateMapper , CameraStreamProcessor
  • StopBitCountComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • StopBits : DeviceConfiguration
  • StopBleDeviceWatcher() : Scenario1_Discovery
  • StopButton_Click() : Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario2_Effects , Scenario4_BackgroundPublisher , Scenario2_FindAvailableSourceGroups , sealed , Scenario1_Watcher , sealed
  • stopButtonEnabled : sealed , ServiceViewModel
  • StopButtonEnabled : ServiceViewModel
  • StopCapture() : Scenario4 , sealed
  • StopCaptureAsync() : WASAPICapture
  • StopCurrentRecognizerIfExists() : HolographicVoiceInputMain
  • StopDevice() : sealed , Scenario3 , sealed , Scenario2
  • StopDeviceWatcher() : EventHandlerForDevice , sealed , EventHandlerForDevice
  • StopDeviceWatchers() : Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect , sealed
  • StopFx2Watcher() : DeviceList
  • StopHandlingAppEvents() : Scenario1_ConnectDisconnect , DeviceConnect , sealed
  • StopMetering() : Metering , sealed , ServiceViewModel , sealed
  • StopMeteringData() : ServiceViewModel
  • stopMeteringRequested : Metering , ServiceViewModel , sealed
  • StopMonitoring() : Scenario7_ForegroundVisits
  • StopMonitoring_Click() : AccountWatcher
  • Stopped : MFSampleGenerator , IOnboardingProducer , ISecureInterfaceProducer
  • StoppingRecord : MediaCaptureManager
  • StopPlaybackAsync() : WASAPIRenderer
  • StopPlayers() : sealed , Scenario2_Custom , Scenario1_Default , sealed , Scenario3_Trim
  • StopPreviewAsync() : sealed , MainPage , sealed , OcrCapturedImage , sealed , OcrCapturedImage , sealed , MainPage , sealed , MainPage
  • StopProjecting() : ProjectionViewPage
  • StopProjecting_Click() : ProjectionViewPage , sealed , ProjectionViewPage
  • StopProjectingButton_Click() : ProjectedMediaTransportControls
  • StopProjectingButtonClick : ProjectedMediaTransportControls
  • StopReaderAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • StopRecordingAsync() : CaptureDevice , MainPage , MediaCaptureManager , MainPage , sealed , MainPage , sealed
  • StopRenderLoop() : LowLatencyInputMain , GameMain
  • StopReplay() : sealed , Scenario9
  • StopScenario() : Scenario1_GetAndSetPin , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_GetAndSetPin , Scenario1_ReadData , Scenario2_Listen , Scenario1_ReadData
  • StopScrollingButton_Click() : Scenario7_ScrollingContentUsingMarquee , sealed
  • StopSoftwareTriggerButton_Click() : Scenario5_DisplayingBarcodePreview
  • StopSource() : MFSampleGenerator
  • StopSuperMuttInputReports() : InputReportEvents , sealed
  • StopTracking() : Scenario1_TrackPosition
  • StopViewInUse() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • StopWatcher() : Scenario8_PairDevice , sealed , Scenario2_DeviceWatcher , Scenario1_SelectDisplay , Scenario3_BackgroundDeviceWatcher , DeviceWatcherHelper , Scenario9_CustomPairDevice , DeviceWatcherHelper , Scenario6_CustomFilterAddedProps , Scenario2_DeviceWatcher , sealed , Scenario1_ChatClient , sealed , Scenario3_BackgroundDeviceWatcher , sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario2_Connector , Scenario6_CustomFilterAddedProps , Scenario2_Connector
  • StopWatcherButton_Click() : Scenario9_CustomPairDevice , sealed , Scenario7_DeviceInformationKind , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario9_CustomPairDevice , sealed , Scenario8_PairDevice , Scenario7_DeviceInformationKind , sealed , Scenario8_PairDevice , sealed , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario3_BackgroundDeviceWatcher , sealed , Scenario6_CustomFilterAddedProps
  • StopWatchers() : sealed , Scenario7_DeviceInformationKind
  • StopWatching() : Scenario2_WatchUsers
  • storageItemAccessList : Scenario1_TrimAndSaveClip , sealed
  • storageItems : ShareFiles , sealed
  • StorageType : LoadKeys
  • store : TripListViewModel , sealed , TripViewModel
  • storeContext : Scenario3_UnmanagedConsumable , Scenario5_UserCollection , Scenario4_ConsumableProduct , Scenario7_B2B , Scenario6_AppListingURI , Scenario1_TrialMode , Scenario2_InAppPurchase , sealed
  • STORED_ACCOUNT_AUTHORITY : sealed
  • STORED_ACCOUNT_ID_KEY : sealed
  • STORED_AUTHORITY_ID_KEY : sealed
  • STORED_PROVIDER_ID_KEY : sealed
  • StoredAccountIdKey : SingleAccountScenario
  • StoredAccountKey : SingleMicrosoftAccountScenario , SingleAzureADScenario
  • StoredAuthorityKey : SingleAccountScenario
  • StoredProviderIdKey : SingleAccountScenario
  • StoreId : ItemDetails
  • storeId : sealed
  • StoreNewAccountDataLocally() : SingleAccountScenario , MultipleAccountsScenario
  • StoreSample : ToneSampleGenerator::SineSampleInfo
  • StraightenValue : PhotoAdjustmentProperties
  • Stream : OmnidirectionalSound
  • stream : SourceBufferManager
  • StreamContainer : CMediaSource , CMediaSink
  • streamFlags : MFSampleGenerator
  • streamIndex : MFSampleGenerator
  • Streaming : Scenario1_TrackInWebcam , Scenario2_DetectInWebcam
  • streaming : sealed
  • streaming_latencyModeToggled() : sealed
  • Streaming_PreviewButtonClicked() : LowLatency
  • streaming_previewButtonClicked() : sealed
  • streaming_recordingStarted() : sealed
  • StreamLocationAsync() : Scenario1_Check
  • StreamLocationButton_Click() : Scenario1_Check
  • StreamOperation : CStreamSink
  • StreamResolution() : StreamResolution
  • StreamResolutionHelper() : sealed
  • streamSocket : SocketReaderWriter , SocketWrapper
  • streamSocketListener : StreamSocketListenerWrapper
  • streamSocketListeners : SessionWrapper
  • StreamSocketListenerWrapper() : StreamSocketListenerWrapper , sealed
  • streamWebSocket : Scenario2_Binary , Scenario3_ClientAuthentication , sealed
  • StringField : CSharpModel
  • StringFromDouble() : sealed
  • Stringify() : User
  • Stringify_Click() : Scenario1_ParseAndStringify
  • StringifyProperty() : Helpers
  • StringPropAsInteger : DataModel
  • StringPropertyDP : DataModel
  • StringPropertyDPName : DataModel
  • StringPropertyDPProperty : DataModel
  • StringPropNoINPC : DataModel
  • StringPropWithINPC : DataModel
  • StringReplace() : sealed
  • StringToStreamAsync() : Scenario1_Print
  • Stroke() : Stroke
  • strokeBuilder : sealed , Scenario9
  • StrokeEvent_Click() : sealed
  • StrokeInput_StrokeStarted() : Scenario1 , sealed , Scenario2
  • strokesToReplay : sealed , Scenario9
  • StspMediaSinkProxy() : sealed
  • Stuff() : DeviceInformationDisplay
  • styleCombobox_SelectionChanged() : sealed , Scenario1
  • Subject : Email
  • SubjectPublicKeyInfo() : SubjectPublicKeyInfo
  • SubmitResponse() : AuthenticationController
  • submixNode : Scenario4_Submix
  • SubPage() : SubPage
  • subscribedForNotifications : Scenario2_Client
  • subscribedPlaybackList : PlayerViewModel
  • SubscribedPlaybackList_CurrentItemChanged() : PlayerViewModel
  • SubscribeToReleaseDeviceRequested() : MainPage
  • SubsequentFrame : DesfireResponse
  • SubString() : DataModel
  • Subtitles : AdaptiveContentModel
  • Subtract() : ItemIndexRangeList , Scenario3_ServerForeground
  • SubtractOrientations() : CameraRotationHelper , sealed
  • subType : sealed::StreamFilteringCriteria
  • Succeeded : TransparentExchangeResponse , ApduResponse , ManageSessionResponse , DesfireResponse , BackgroundAuthenticationCompletedEventArgs
  • SuccessfulSignIn() : sealed , SignIn
  • Suggestions : Scenario2
  • supportedAudioFormats : Scenario1
  • supportedConfigMethods : ConnectionSettingsPanel
  • supportedCursorTypes : sealed
  • SupportedDeviceSelectors : CustomDevicePickerFilter
  • supportedDeviceSelectors : CustomDevicePickerFilter
  • supportedEncodingProperties : AudioEchoEffect
  • SupportedEncodingProperties : AudioEchoEffect
  • SupportedSymbologies : DecodeEngine
  • supportedVideoFormats : Scenario1
  • SUPPRESS_DURATION_APPROXIMATE_MIN : CalibrationBar
  • SUPPRESS_DURATION_APPROXIMATE_TICKS : sealed
  • SUPPRESS_DURATION_UNRELIABLE_MIN : CalibrationBar
  • SUPPRESS_DURATION_UNRELIABLE_TICKS : sealed
  • SuppressStartupBanner : FxCompile
  • SurfacechargeDensityCoulombPerSquareMetre : PresentationFormats
  • SurfaceDensityKilogramPerSquareMetre : PresentationFormats
  • SurfaceMesh() : final
  • SurfaceTensionNewtonPerMetre : PresentationFormats
  • Suspend() : GameMain
  • SuspendAudio() : Audio
  • suspendDeferral : SavingDataReason , sealed
  • SuspendDeviceWatcher() : DeviceList
  • suspendingEventToken : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • suspendingToken : sealed
  • SuspendMeteringService() : ServiceViewModel
  • SuspensionManagerException() : SuspensionManagerException
  • SW : ApduResponse
  • SW1 : ApduResponse
  • SW2 : ApduResponse
  • Swap() : sealed
  • Swap< T >() : PhotosPrintHelper
  • SwapChainAction() : DeviceResources
  • SwapChainActionWithResult() : DeviceResources
  • SwapVertexBuffers() : final
  • SwapViews() : ProjectionViewPage
  • SwapViews_Click() : sealed , ProjectionViewPage
  • SwapViewsButton_Click() : ProjectedMediaTransportControls
  • SwapViewsButtonClick : ProjectedMediaTransportControls
  • SwitchAndAnimate() : SecondaryViewPage
  • switchChangedEventsHandler : sealed
  • switchMessageBuffer : DeviceEvents
  • SWTranslation : DesfireResponse , ApduResponse
  • symbolAssignment : BitrateHelper
  • Symbology : DecodeResult
  • symbologyAttributes : Provider , Scenario4_SymbologyAttributes
  • SymbologyListEntry() : SymbologyListEntry , sealed
  • SymbologySelection_Changed() : Scenario4_SymbologyAttributes
  • Sync_Click() : Scenario7_SyncDevice
  • SyncBackgroundTaskResult : LocalSettingKeys
  • SyncBackgroundTaskStatus : LocalSettingKeys
  • syncBackgroundTaskTrigger : Scenario7_SyncDevice
  • syncDeviceInformation : Scenario7_SyncDevice
  • syncDeviceSelector : Scenario7_SyncDevice
  • SyncPlaybackStatusToMediaPlayerState() : Scenario1
  • SyncRoot : FileDataSource , IncrementalLoadingBase , FileDataSource , VeryObservableCollection-g< T > , FileDataSource2 , EmployeeCollection
  • SyncWithDeviceAsync() : Scenario7_SyncDevice
  • synthesisStream : sealed
  • synthesizer : Scenario_SynthesizeSSML , Scenario_SynthesizeTextBoundaries , sealed , Scenario_SynthesizeText
  • SynthesizeSSMLStream() : sealed
  • SynthesizeTextStream() : sealed
  • SystemGroup_Frequent_Click() : Scenario4_ChangeSystemGroup , sealed , Scenario4_ChangeSystemGroup
  • SystemGroup_None_Click() : Scenario4_ChangeSystemGroup , sealed , Scenario4_ChangeSystemGroup
  • SystemGroup_Recent_Click() : Scenario4_ChangeSystemGroup , sealed , Scenario4_ChangeSystemGroup
  • SystemList : Scenario5_Capabilities , Scenario3_LaunchAppServices , Scenario1_Discovery
  • systemList : MainPage
  • SystemList : Scenario2_LaunchUri
  • SystemListBox_SelectionChanged() : Scenario1_Discovery
  • systemMap : MainPage
  • systemMediaControls : Scenario1 , PlaybackControl
  • systemMediaControls_AutoRepeatModeChangeRequested() : Scenario1
  • systemMediaControls_ButtonPressed() : Scenario1
  • SystemMediaControls_ButtonPressed() : PlaybackControl
  • systemMediaControls_PlaybackPositionChangeRequested() : Scenario1
  • systemMediaControls_PlaybackRateChangeRequested() : Scenario1
  • SystemMediaControls_PropertyChanged() : MainPage
  • systemMediaControls_PropertyChanged() : Scenario1
  • SystemMediaControls_PropertyChanged() : MainPage , sealed , MainPage , sealed , MainPage , PlaybackControl
  • systemNavigationManager : RootFrameNavigationHelper
  • SystemNavigationManager_BackRequested() : MainPage , RootFrameNavigationHelper
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- t -

  • t : MediaSegment
  • TabHeader() : TabHeader
  • tag : HighScoreEntry
  • Tag : TlvEntry
  • TAG_1 : ScenarioElement
  • TAG_2 : ScenarioElement
  • TAG_3 : ScenarioElement
  • TAG_COMPREHENSION_MASK : ApduResponse
  • TAG_LENGTH_MULTI_BYTE_MASK : ApduResponse
  • TAG_MULTI_BYTE_MASK : ApduResponse
  • TagLength : TlvEntry
  • TakeAdvancedCapturePhotoAsync() : sealed , MainPage
  • TakePhotoAsync() : sealed , MainPage , sealed , MainPage , MediaCaptureManager
  • TakeSnapshotAndFindFacesAsync() : Scenario2_DetectInWebcam
  • TakingPhoto : MediaCaptureManager
  • tangentialDistortion : GpuCoordinateMapper::CameraIntrinsics
  • tapCount : SubPage
  • TapFocusRadioButton_Checked() : MainPage
  • TapToFocus() : MainPage
  • TapUnfocus() : MainPage
  • target : WICConvert
  • Target() : GameObject
  • target_DoubleTapped() : sealed , Scenario1
  • target_Holding() : sealed , Scenario1
  • target_PointerEntered() : sealed , Scenario1
  • target_PointerExited() : sealed , Scenario1
  • target_PointerPressed() : sealed , Scenario1
  • target_PointerReleased() : sealed , Scenario1
  • target_RightTapped() : sealed , Scenario1
  • target_Tapped() : sealed , Scenario1
  • targetDistortionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • TargetElapsedSeconds : StepTimer
  • targetElapsedTicks : StepTimer
  • TargetElapsedTicks : StepTimer
  • TargetElement : ControlSizeTrigger , InputTypeTrigger
  • TargetId() : GameObject
  • targetImage : GpuCoordinateMapper::RasterizedFrameBlob , GpuCoordinateMapper::VisualizeFrameBlob
  • targetImageDepthBuffer : GpuCoordinateMapper::VisualizeFrameBlob
  • targetIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • TargetListView_DragItemsCompleted() : sealed , Scenario1_ListView
  • TargetListView_DragItemsStarting() : sealed , Scenario1_ListView
  • TargetListView_DragOver() : sealed , Scenario1_ListView
  • TargetListView_Drop() : sealed , Scenario1_ListView
  • targetProjectionMatrix : GpuCoordinateMapper::RasterizedFrameBlob
  • targetRasterizedDepth : GpuCoordinateMapper::RasterizedFrameBlob
  • TargetTextBlock_DragEnter() : sealed , Scenario1_ListView
  • TargetTextBlock_Drop() : sealed , Scenario1_ListView
  • TargetTextBox_DragEnter() : sealed , Scenario2_DragUICustomization
  • TargetTextBox_DragLeave() : sealed , Scenario2_DragUICustomization
  • TargetTextBox_Drop() : sealed , Scenario2_DragUICustomization
  • TargetTexture() : TargetTexture
  • Task() : SimpleTaskCompletionSource< T > , SimpleTaskCompletionSource< void >
  • task : Scenario1_Connect
  • Task_Completed() : sealed , Provider
  • TaskCanceled : BackgroundTaskInformation , SyncBackgroundTaskInformation
  • taskCancelledToken : sealed
  • TaskCompleted : BackgroundTaskInformation , SyncBackgroundTaskInformation
  • taskCount : sealed , MultipleTasks
  • TaskDeferral : sealed
  • taskEntryPoint : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer
  • TaskEntryPoint : SyncBackgroundTaskInformation
  • taskInstance : RfcommServerTask
  • TaskInstance : sealed
  • taskName : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer
  • taskRegistration : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer , sealed , CustomTrigger
  • TaskRequiresBackgroundAccess() : BackgroundTaskSample , Scenario7_SyncDevice
  • TaskStatuses : BackgroundTaskSample
  • TckValid : AtrInfo
  • tcpListener : Scenario1_Send
  • TemperatureButton_Click() : Scenario2_LEDTemp
  • TemperatureValue : PhotoAdjustmentProperties
  • Templates() : Templates , sealed
  • temporaryCounter : Scenario1_Files
  • temporaryFolder : Scenario1_Files
  • tenantId : Scenario7_B2B
  • tenMinutesIn100NanoSecondUnits : sealed
  • TerminateStroke() : SourceHandler
  • tex : VertexPositionTex , BasicVertex , TangentVertex
  • texcoord : Vector3< T >
  • texCoord : VertexPositionColorTex
  • texCoordOffset : QuadModelConstantBuffer
  • texCoordScale : QuadModelConstantBuffer
  • Text : DecodeResult , Item , ItemViewModel , Text
  • TEXT_TILE_ID : Scenario3_SecondaryTiles
  • TextAlignment : TextRenderer
  • TextBox_GotFocus() : Scenario4_ShowView
  • TextColor() : sealed , Functions
  • TextContentBlock : sealed , PageToPrint
  • textcoord : Vector2< T >
  • TextLayout() : sealed
  • TextLayoutFrame_SizeChanged() : sealed
  • TextLayoutImageSource() : sealed
  • TextRenderer() : TextRenderer
  • TextSent() : sealed
  • TextSentReceived : ISecureInterfaceLegacySignals , ISecureInterfaceSignals
  • textServiceManager : sealed , Scenario4
  • TextServiceManager_InputLanguageChanged() : sealed , Scenario4
  • textSpoken : sealed , TripVoiceCommand
  • texture : VertexPositionTexture
  • textureCoordinate : VertexPositionTexture , PNTVertex
  • ThermalConductivityWattPerMetreKelvin : PresentationFormats
  • ThermodynamicTemperatureDegreeFahrenheit : PresentationFormats
  • ThermodynamicTemperatureKelvin : PresentationFormats
  • Theta : ToneSampleGenerator::SineSampleInfo
  • theta : Scenario3_FrameInput
  • this : IncrementalLoadingBase , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemCacheManager< T > , ItemIndexRangeList , FileDataSource2
  • thisLock : VideoRenderer , Scenario2 , Scenario3 , Scenario4 , Scenario5 , WiFiDirectServiceManager , AdvertisementWrapper
  • thisViewControl : SecondaryViewPage , sealed , ProjectionViewPage
  • thisViewControl_Released() : ProjectionViewPage , sealed , ProjectionViewPage
  • thisViewId : Scenario05 , Scenario06 , sealed , Scenario1 , Scenario2 , Scenario3
  • ThrowIfDisposed() : WiFiDirectServiceManager , AdvertisementWrapper , DiscoveredDeviceWrapper , SessionWrapper , StreamSocketListenerWrapper , SocketWrapper
  • Thumbnail : VideoMetaData , ImportableItemWrapper
  • thumbnail : ImportableItemWrapper
  • THUMBSTICK_DEADZONE : PlaybackPage
  • ThumbstickDPadHelper() : ThumbstickDPadHelper
  • Tick() : StepTimer
  • TicksPerSecond : StepTimer
  • TicksToSeconds() : StepTimer
  • Tile : sealed
  • TileExists_Click() : Scenario4_TilePinned
  • TileNotificationButton_Click() : sealed , Scenario3_Notifications
  • TimeDay : PresentationFormats
  • timedMetadataTrackChangedHandler() : sealed
  • TimeHistoryCount : GpuPerformanceTimer
  • TimeHour : PresentationFormats
  • TimeLimit() : Level
  • timelineController : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • TimeMinute : PresentationFormats
  • TimeMonth : PresentationFormats
  • TIMEOUT_LENGTH : Scenario3
  • timer : _360VideoPlaybackMain , HolographicApp1Main , PlaybackPage , HolographicTemplateAppMain , sealed , Scenario2_Listen , Scenario1_ReadData , ItemCacheManager< T >
  • Timer_Tick() : sealed , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData
  • TimeRemaining() : Simple3DGame
  • timerToken : sealed
  • TimerWaitForTwoMins_Tick() : ScenarioElement
  • Timescale : MediaSegmentInformation
  • timescale : MediaSegmentInformation
  • TimeSecond : PresentationFormats
  • timeShiftBufferDepth : Manifest
  • TimeShiftBufferDepth : Manifest
  • timeSpanFormat : Scenario4_ForegroundGeofence
  • timestamp : MFSampleGenerator
  • Timestamp : MediaSegment
  • TimeStamp : HistoryRecord
  • timestamps : Scenario12
  • TimeTriggeredTask() : sealed , TimeTriggeredTask , sealed , TimeTriggeredTask
  • TimeTriggeredTaskName : BackgroundTaskSample
  • TimeTriggeredTaskProgress : BackgroundTaskSample
  • TimeTriggeredTaskRegistered : BackgroundTaskSample
  • TimeYear : PresentationFormats
  • Timezone : User
  • timezoneKey : User
  • TintValue : PhotoAdjustmentProperties
  • title : VideoItemInfo , ViewLifetimeControl , sealed
  • Title : VideoGallery::VideoItemInfo , VideoItem , Scenario , VideoMetaData , Scenario , ViewLifetimeControl , Scenario , MediaItem , MediaList , MediaItemViewModel , DASHEntry , ItemViewModel , SizePreferenceString , ViewLifetimeControl , Scenario , ItemDetails , MediaModel , sealed , Employee , IEmployee , Manager , SampleDataModel , Item , SampleDataModel , SizePreferenceString , ViewLifetimeControl
  • TitleBar() : Scenario1_Colors
  • titleBar : sealed , Scenario1_Colors
  • TitleBar : Scenario1_Colors
  • titleBody : GameHud
  • TitledImage() : TitledImage
  • titleHeader : GameHud
  • titleLicenseInfo : GameHud
  • TlvEntry() : TlvEntry
  • ToArray() : ItemIndexRangeList
  • Toast : sealed
  • ToastNotificationButton_Click() : sealed , Scenario3_Notifications
  • ToastOnAppEvents : SettingsService , SettingsViewModel
  • ToastOnAppEventsKey : SettingsService
  • ToBuffer() : HttpJsonContent
  • ToCustomStyleEntryState() : sealed , Scenario11
  • ToDefaultStyleEntryState() : sealed , Scenario11
  • ToDispose< T >() : Disposer
  • Toggle_Custom() : sealed , Scenario2
  • ToggleButtons() : Scenario_PauseAsync
  • ToggleDepth_Click() : sealed
  • ToggleFullScreenModeButton_Click() : sealed , Scenario1_Basic , sealed , Scenario2_Extend
  • ToggleLoggingEnabledDisabled() : LoggingSessionScenario
  • ToggleLoggingEnabledDisabledAsync() : FileLoggingSessionScenario
  • ToggleLogs() : sealed , Scenario6
  • ToggleMenuSuppression() : sealed , Scenario1_EventAndMenuHookup
  • TogglePlay() : Scenario5_InboxEffects , Scenario1_FilePlayback , Scenario4_Submix , Scenario6_CustomEffects
  • TogglePlayPause() : PlayerViewModel
  • ToggleRecordStop() : Scenario2_DeviceCapture
  • toggles : sealed , Scenario1_EventAndMenuHookup
  • ToggleSkeletons_Click() : sealed
  • ToggleTongue() : D2DSvgImageRenderer
  • ToHex() : sealed
  • ToJsonObject() : School
  • token : sealed
  • tokenMethod : Scenario3_RequestModification
  • ToList() : ItemIndexRangeList
  • ToMFSample() : CBufferPacket
  • ToneSampleGenerator() : ToneSampleGenerator
  • TongueButton_Click() : sealed
  • Tool() : Tool
  • ToolButton_Lasso() : sealed , Scenario2
  • ToolName : FxCompile
  • top : ElementMargin
  • ToPlaybackItem() : VideoItem , MediaItem , MusicItem
  • ToPlaybackList() : MediaList
  • TopLeft : TextRenderer
  • topLeft : Scenario5_InkingAndInteractionFeedback
  • TopLeft : Stroke::Square
  • Topology : MeshGeometry
  • TopRight : Stroke::Square , TextRenderer
  • TorchCheckBox_CheckedChanged() : MainPage
  • ToString() : Scenario , Item , AdaptiveContentModel , BitrateItem , CustomDevicePickerFilter , Scenario , FrameSourceGroupModel , FrameSourceInfoModel , FrameFormatModel , Scenario , RemotePeer , Scenario , Contact , CardDetails , ApduCommand , ApduResponse , SelectCommand , BadgeNumericNotificationContent , Scenario , ScenarioGroup , Scenario , DiscoveredDevice , ConnectedDevice , SampleDataModel , Scenario , SampleDataModel , Scenario
  • total : NfcProvHeader
  • total_pipe_bytes : PipeEvents
  • totalBytesRead : Scenario4_BulkPipes
  • totalBytesWritten : Scenario4_BulkPipes
  • totalCumulativeSteps : sealed , Scenario1_Events
  • totalHits : HighScoreEntry
  • TotalHits() : Simple3DGame
  • totalNumberBytesReceived : sealed , Scenario3_InterruptPipes , InputReportEvents
  • totalNumberBytesWritten : Scenario3_InterruptPipes
  • TotalSeconds : StepTimer
  • totalSegmentCount : LiveSourceBufferManager
  • TotalShots() : Simple3DGame
  • totalShots : HighScoreEntry
  • TotalShots() : Simple3DGame
  • totalTicks : StepTimer
  • TotalTicks : StepTimer
  • TouchInking_Checked() : sealed
  • TouchInking_Unchecked() : sealed
  • TouchInkingCheckBox_Checked() : Scenario3 , sealed
  • TouchInkingCheckBox_Unchecked() : sealed , Scenario3
  • TouchpadDPadHelper() : TouchpadDPadHelper
  • TouchWriting : sealed , Scenario2
  • tpTimer : Metering
  • TrackButton_Click() : Scenario5 , Scenario4
  • TrackingEventUri : TrackingEventCue
  • TrafficFlowVisible_Checked() : sealed , Scenario1
  • trafficFlowVisibleCheckBox_Unchecked() : sealed , Scenario1
  • TranscodeCancel() : Scenario3_Trim , sealed , Scenario1_Default , Scenario2_Custom , sealed
  • TranscodeComplete() : Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • TranscodeCustom() : sealed , Scenario2_Custom
  • TranscodeError() : sealed , Scenario2_Custom , sealed , Scenario3_Trim , Scenario1_Default , sealed
  • TranscodeFailure() : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default , sealed
  • TranscodePreset() : sealed , Scenario1_Default
  • TranscodeProgress() : sealed , Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • TranscodeTrim() : sealed , Scenario3_Trim
  • Transfer_Click() : Scenario1
  • TransferData() : sealed , WriteReadStream
  • Transform() : WordOverlay
  • TransformBitmap() : sealed
  • transforms : Scenario5_InkingAndInteractionFeedback , Scenario4 , sealed
  • TransliterateFromCyrillicToLatin() : LinguisticServices
  • TransmissionType : LoadKeys
  • Transmit_Click() : Scenario8_TransmitAPDU , sealed
  • TransparentExchange() : TransparentExchange
  • TransparentExchangeAsync() : AccessHandler
  • TransparentExchangeResponse() : TransparentExchangeResponse
  • TransportControls_CastButtonClicked() : Scenario02 , Scenario05 , Scenario03 , Scenario06
  • TransportOptions() : TransportOptions
  • TreatAsOnDemand : Manifest
  • treatAsOnDemand : Manifest
  • TreatWarningAsError : FxCompile
  • TriangulatePoints() : SpatialStageManager
  • trigger : Scenario3_BackgroundWatcher , ApplicationTriggerTask , sealed , Scenario3_BgChatServer , Scenario4_BackgroundPublisher
  • TriggerAcceptConnection() : CMediaSink
  • TriggerRefuseConnection() : CMediaSink
  • Trim() : DeviceResources , SceneComposer , DeviceResources , StringTrimmer , DeviceResources , StringTrimmer , DeviceResources
  • TrimClip_Click() : Scenario1_TrimAndSaveClip , sealed
  • TrimLeft() : CMediaBufferWrapper , CBufferPacket
  • TrimRight() : CMediaBufferWrapper
  • Trip() : sealed
  • trip : TripViewModel , sealed
  • Trip : TripViewModel
  • TripDetails() : sealed , TripDetails
  • tripListBox_SelectionChanged() : TripListView , sealed
  • TripListView() : sealed , TripListView
  • TripListViewModel : ViewModelLocator , TripListViewModel , sealed
  • trips : sealed , TripListViewModel , TripStore
  • Trips : TripListViewModel , TripStore
  • trips : sealed
  • tripsLoaded : sealed
  • TripStore() : TripStore , sealed
  • TripViewModel() : TripViewModel , ViewModelLocator , sealed
  • TripVoiceCommand() : sealed , TripVoiceCommand
  • TryAcquireLatestFrameData() : CameraCoordinateMapper
  • TryApplyProcessUIPolicy_Click() : Scenario3
  • TryCastMediaElementAsync() : Scenario06
  • TryCloseWindow() : sealed , AppView
  • TryComputeLength() : HttpJsonContent
  • TryConnectSocketWithRetryAsync() : Scenario5
  • TryConvert() : sealed
  • TryCreateDownloadAsync() : sealed
  • TryDeleteCredentialAccountAsync() : Util
  • TryDisconnectCastingSessionAsync() : Scenario06
  • TryDownloadBuffer() : LiveSourceBufferManager
  • TryFindViewLifetimeControlForViewId() : App
  • TryGetContinousBuzz() : SpatialControllerHandler
  • TryGetCurrentNetworkOperatorTetheringManager() : Helpers
  • TryGetHandedness() : HolographicPaintMain
  • TryGetUri() : MainPage
  • TryGetValue() : EmployeeDictionary
  • TryGoBack() : RootFrameNavigationHelper
  • TryGoForward() : RootFrameNavigationHelper
  • TryInitializeCaptureAsync() : sealed
  • TryInitializeMediaCaptureAsync() : sealed
  • TryLaunchDialAppAsync() : Scenario06
  • TryParseHttpUri() : Helpers
  • TryProjectionManagerCastAsync() : Scenario06
  • TryRegisterBusObject() : AllJoynBusObjectManager
  • TryRender() : BaseElement
  • TrySavePlaylistAsync() : MainPage
  • TryStopDialAppAsync() : Scenario06
  • TryStopProjectionManagerAsync() : Scenario06
  • TryUpdateRenderer() : sealed
  • Tts_Resolved() : Scenario3
  • ttsMap : Scenario3
  • turningSpeed : Turn
  • Type() : ControlBase , School , LoggingScenarioEventArgs , School , GetData , CSourceOperation , LoggingScenarioEventArgs , RawSMBIOSTable , IControl , School
  • typeKey : School
  • TypeName : IsApiPropertyPresentTrigger
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- u -

  • u : Vector2< T > , Vector3< T >
  • uiContext : Scenario6_DeleteTPM
  • UID : CardDetails
  • UIElementType : Scenario
  • uLength : LineSegment
  • ullDuration : StspSampleHeader
  • ullTimestamp : StspSampleHeader
  • UncaptionedMediaUri : MainPage
  • UndeferElementClick() : sealed , OtherBindings
  • UnhandledExceptionPage() : UnhandledExceptionPage
  • Uninitialize() : sealed , App , AppView , sealed , VisualProperties , sealed , AppView , sealed
  • uninitialized : sealed
  • unique_bag() : unique_bag
  • unique_cotaskmem_ptr() : unique_cotaskmem_ptr< T >
  • unique_disabled_control() : unique_disabled_control
  • unique_services() : unique_services
  • unique_shared_work_queue() : unique_shared_work_queue
  • uniqueInternalId : AdvertisementWrapper
  • Unitless : PresentationFormats
  • Units : PresentationFormats
  • Unknown : MediaCaptureManager
  • UnknownDevices : Scenario1_Discovery
  • unknownStepCount : sealed , Scenario1_Events
  • UnlockScenarioChange() : sealed
  • UnlockStore() : CBaseAttributes< TBase >
  • UnmarshalInterface() : CMediaBufferWrapper
  • UnpairButton_Click() : sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • UnpinSecondaryTile_Click() : Scenario2_UnpinTile
  • UnprocessedEvent_Click() : sealed
  • UnprocessedInput_PointerEntered() : sealed , Scenario6
  • UnprocessedInput_PointerEntered1() : sealed , Scenario6
  • UnprocessedInput_PointerMoved() : sealed , Scenario2
  • UnprocessedInput_PointerPressed() : sealed , Scenario2
  • UnprocessedInput_PointerReleased() : sealed , Scenario2
  • UnprocessedInputOnPointerEntered() : sealed
  • UnprocessedInputOnPointerExited() : sealed
  • UnprocessedInputOnPointerHovered() : sealed
  • UnprocessedInputOnPointerLost() : sealed
  • UnprocessedInputOnPointerMoved() : sealed
  • UnprocessedInputOnPointerPressed() : sealed
  • UnprocessedInputOnPointerReleased() : sealed
  • Unprotect_Click() : Scenario1_Files , Scenario2_Memory , Scenario1_Files , Scenario2_Memory
  • UnprotectAsyncBuffer_Click() : Scenario6 , Scenario7
  • UnpublishService() : sealed , WiFiDirectServiceManager
  • unread_buffer : PipeEvents
  • Unregister() : MainPage
  • UnRegister_Click() : Scenario15_DPLCreateFileEvents
  • Unregister_Click() : RegisterWithBackgroundTask
  • UnregisterAndDestroyBusObject() : AllJoynBusObjectManager
  • UnregisterBackgroundTask() : ScenarioElement , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , Scenario3_BackgroundDeviceWatcher , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario1_Initialization
  • UnregisterBackgroundTasks() : BackgroundTaskSample
  • UnRegisterBtn_Click() : sealed , Scenario3_AvailabilityChanged
  • UnregisterButton_Click() : Scenario1_Initialization
  • UnregisterCustomTrigger_Click() : sealed , CustomTrigger
  • UnregisterEventHandlers() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UnregisterForAdaptiveMediaSourceEvents() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning
  • UnregisterForDiscreteControls() : Scenario7_LiveSeekableRange
  • UnregisterForEvents() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • UnregisterForMediaPlaybackItemEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterForMediaSourceEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterForPositionUpdateControl() : Scenario7_LiveSeekableRange
  • UnregisterForPrinting() : PrintHelper
  • UnregisterFrame() : SuspensionManager
  • UnregisterFromAppEvents() : sealed , EventHandlerForDevice
  • UnregisterFromBus() : sealed
  • UnregisterFromDeviceAccessStatusChange() : sealed , EventHandlerForDevice
  • UnregisterFromDeviceWatcherEvents() : sealed , EventHandlerForDevice
  • UnregisterFromInputReportEvent() : sealed , InputReportEvents
  • UnregisterFromInputReportEvents_Click() : sealed , InputReportEvents
  • UnregisterFromInterruptEvent() : Scenario3_InterruptPipes
  • UnregisterGroupedTask() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • UnregisterHandlers() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange
  • UnregisterHolographicEventHandlers() : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • UnregisterInterruptEvent_Click() : Scenario3_InterruptPipes
  • UnregisterMetadataHandlers() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterNetworkStatusChanged() : Scenario3_NetworkConnectivityChanges
  • UnregisterTask() : sealed , CustomTrigger
  • UnregisterTasks_Click() : Scenario1_ManageHotspot
  • UnregisterUngroupedTasks() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • UnselectAll() : InkRenderer
  • UnselectSceneObjects() : SceneComposer
  • UnspecifiedReason() : sealed , UnspecifiedReason
  • Up() : Camera
  • Update() : ShapeRenderer , CustomComputeShaderMain , CustomComputeShaderRenderer , BasicTimer , CustomPixelShaderMain , CustomPixelShaderRenderer , BasicTimer , CustomVertexShaderMain , CustomVertexShaderRenderer , DeviceInformationDisplay , QuadRenderer , SpinningCubeRenderer , HolographicFaceTrackerMain , ControlBase , Cursor , IControl , SpinningCubeRenderer , HolographicMRCSampleMain , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , SceneController , SceneObject , HolographicSpatialStageMain , QuadRenderer , HolographicTagAlongSampleMain , SpinningCubeRenderer , HolographicVoiceInputMain , Update , ScenarioElement , GameMain , GameTimer , Level , Level2 , Level4 , Level6 , MoveLookController , Sphere , GameMain , Stroke , Tool , ClearTool , ToolCarousel , sealed , IDPadHelper , ThumbstickDPadHelper , HolographicPaintMain , SourceHandler , _360VideoPlaybackMain , BaseControl , BaseElement , FocusableElement , Button , PlayPauseButton , SeekBarElement , MediaTransportControls , VideoRenderer , _360VideoPlaybackMain , VideoRenderer , HolographicApp1Main , Print3D , Turn , BasicHologramMain , SpinningCubeRenderer , BasicHologramMain , SpinningCubeRenderer , HolographicTemplateAppMain , SpinningCubeRenderer , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , CameraStreamCoordinateMapperMain , sealed , TextRenderer , InkRenderer
  • UpdateAddressField() : Scenario07_PostStreamWithProgress , Scenario13_RetryFilter , Scenario07_PostStreamWithProgress , Scenario13_RetryFilter
  • UpdateAdvertiserStatus() : sealed , Scenario2
  • UpdateAppBarButton() : Scenario7_PinFromAppbar
  • UpdateAvailableLanguages() : sealed , OcrFileImage
  • UpdateBackButton() : RootFrameNavigationHelper
  • UpdateBackgroundTaskRegistrationStatus() : BackgroundTaskSample
  • UpdateBackgroundTaskUIState() : RegisterWithBackgroundTask
  • UpdateBaseUrl() : DashManifestParser
  • UpdateBaudRateView() : Scenario2_ConfigureDevice
  • UpdateBinary() : UpdateBinary
  • UpdateBreakStateSignalView() : Scenario2_ConfigureDevice
  • UpdateButton_Click() : sealed , Scenario4_UpdatingLineDisplayAttributes , Scenario6_ManipulatingCursorAttributes
  • UpdateButtonOrientation() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UpdateButtons() : sealed , Scenario5_TriggerCFU , sealed , Scenario1_FindClaimEnable
  • UpdateButtonState() : FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , FileOpenPicker_PickURLFile , Scenario1_Initialization
  • UpdateButtonStateAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • UpdateButtonStates() : Scenario4_BulkPipes , Scenario7_SyncDevice , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_NetworkConnectivityChanges
  • UpdateCachedMetrics() : sealed
  • UpdateCanvasSize() : HelperFunctions
  • UpdateCapabilityStatus() : Scenario1_Check
  • UpdateCaptureControls() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UpdateCaptureStatus() : Scenario3_AppCapture
  • UpdateCarrierDetectStateView() : Scenario2_ConfigureDevice
  • UpdateColorResources() : CameraCoordinateMapper
  • UpdateColors() : sealed , Scenario1_Colors
  • UpdateConnectDisconnectButtonsAndList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • UpdateConnectivityLevel() : sealed , WiFiNetworkDisplay
  • UpdateConnectivityLevels() : sealed
  • UpdateConnectivityStatus() : sealed
  • UpdateConnectivityStatusAsync() : Scenario2ViewModel , Scenario4_Connect
  • UpdateConstants() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • UpdateContent() : sealed , Scenario1_Orientation , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic
  • UpdateContentProps() : sealed , Scenario2 , Scenario3
  • UpdateContentUI() : sealed , Scenario2 , Scenario3
  • UpdateControlOrientation() : sealed , MainPage
  • UpdateControls() : sealed , Scenario3 , sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • UpdateControlVisibility() : Scenario1
  • UpdateCount() : FileDataSource , FileDataSource2
  • UpdateCurrentAppLanguageMessage() : sealed , Scenario8
  • UpdateCustomTransportControls() : Scenario1
  • UpdateData() : LiveSourceBufferManager , Player , SourceBufferManager
  • UpdateData_Click() : BroadbandDevice
  • UpdateDataBitsView() : Scenario2_ConfigureDevice
  • UpdateDataSetReadyStateView() : Scenario2_ConfigureDevice
  • UpdateDataTerminalReadyEnabledView() : Scenario2_ConfigureDevice
  • UpdateDefaultLogo_Click() : Scenario8_UpdateAsync
  • UpdateDefaultRenderOptions() : sealed
  • UpdateDepthResources() : CameraCoordinateMapper
  • UpdateDescriptionVisibility() : sealed , Scenario1
  • UpdateDestinationPhraseList() : sealed , TripViewModel
  • UpdateDeviceInfo() : DiscoveredDevice
  • UpdateDevices() : MidiDeviceWatcher
  • UpdateDiscoveryList() : Scenario3 , sealed
  • UpdateDisplayACState() : sealed
  • UpdateDisplayColorContext() : PhotoAdjustmentRenderer
  • UpdateDownloadBitrateAsync() : Scenario4_Tuning , Scenario2_EventHandlers
  • UpdateDynamics() : Simple3DGame
  • UpdateEvControlCapabilities() : MainPage
  • UpdateEventRegistration() : sealed
  • UpdateExposureControlCapabilities() : MainPage
  • UpdateFlashControlCapabilities() : MainPage
  • UpdateFocusControlCapabilities() : MainPage
  • UpdateFocusUI() : CustomEditControl
  • UpdateForSizeChanged() : SectionView
  • UpdateForVisualState() : MasterDetailPage
  • UpdateForWindowSizeChange() : D2DGradientMeshMain , DWriteColorTextRendererMain
  • UpdateFourTilesControl() : UpdateFourTilesControl
  • UpdateFPS() : Scenario1_ExampleOperations
  • UpdateFrameSource() : sealed , Scenario2_FindAvailableSourceGroups
  • UpdateFullScreenModeStatus() : Scenario2_Extend , sealed , Scenario2_Extend
  • UpdateGameConfig() : Simple3DGame
  • UpdateGlyphBitmapImage() : DeviceInformationDisplay , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , sealed , DeviceInformationDisplay
  • UpdateHandShakeView() : Scenario2_ConfigureDevice
  • UpdateHeaderText() : sealed , Scenario2
  • UpdateHologramPosition() : QuadRenderer
  • UpdateImageColorContext() : D2DAdvancedColorImagesRenderer
  • UpdateImageDimensionsUI() : Scenario2
  • UpdateImageRotation() : Scenario2
  • UpdateImageScale() : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer
  • UpdateImageTransformState() : D2DAdvancedColorImagesRenderer
  • UpdateInk() : SceneComposer
  • UpdateIsoControlCapabilities() : MainPage
  • UpdateIsUpperCaseEnabledAsync() : Scenario1ViewModel
  • UpdateItem() : Scenario1_Files
  • UpdateLampArrayList() : Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics
  • UpdateLastVisit() : Scenario6_GetLastVisit
  • UpdateLayoutFromCurrentTime() : SeekBarElement
  • UpdateLayoutMetrics() : CustomTitleBar , sealed
  • UpdateLayoutState() : GameMain
  • UpdateLiveSourceBuffers() : Player
  • UpdateLiveSourceBuffersToLiveEdge() : Player
  • UpdateLocalClientWindow() : sealed
  • UpdateLocationData() : Scenario1_TrackPosition , Scenario2_GetPosition , Scenario1_TrackPosition , Scenario2_GetPosition
  • UpdateManipulationState() : D2DAdvancedColorImagesRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer
  • UpdateManualControlCapabilities() : MainPage
  • UpdateMapElementOnClick() : sealed , Scenario11
  • UpdateMapElementOnPointerEntered() : sealed , Scenario11
  • UpdateMapElementOnPointerExited() : sealed , Scenario11
  • UpdateMatrix() : Face
  • UpdateMediaControlUI() : sealed , Scenario2 , Scenario4 , Scenario3 , sealed
  • UpdateMessageLog() : sealed
  • UpdateName_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • UpdateNetworkStatus() : Scenario3_NetworkConnectivityChanges
  • UpdateNowButton_Click() : Scenario1_ManageHotspot
  • UpdateOnDemandButton_Click() : Scenario1_ManageHotspot
  • UpdatePairingButtons() : Scenario1_ChatClient , sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , sealed
  • UpdateParameterList1() : Scenario3_SendMIDIMessages
  • UpdateParameterList2() : Scenario3_SendMIDIMessages
  • UpdateParameterList3() : Scenario3_SendMIDIMessages
  • UpdateParityView() : Scenario2_ConfigureDevice
  • UpdatePhotoAdjustmentValues() : PhotoAdjustmentRenderer
  • UpdatePlaybackBitrateAsync() : Scenario2_EventHandlers , Scenario4_Tuning
  • UpdatePlaybackSpeed() : Scenario1
  • UpdatePointer() : CustomPixelShaderMain , CustomPixelShaderRenderer
  • UpdatePollingDevices() : MoveLookController
  • UpdatePosition() : Cylinder , Face , GameObject
  • UpdatePositionAndVisibility() : CustomTitleBar , sealed
  • UpdatePresence() : IsApiPropertyPresentTrigger
  • UpdatePreviewRect() : Scenario5_InkingAndInteractionFeedback
  • UpdatePropertyHelper() : sealed , S2_UpdateAndDeleteWithAPI
  • UpdateProps() : sealed , WordOverlay
  • UpdateRandomSection() : MainPage
  • UpdateRanges() : ItemCacheManager< T >
  • UpdateReadButtonStates() : Scenario3_ReadWrite
  • UpdateReadBytesCounterView() : Scenario3_ReadWrite
  • UpdateReadTimeoutView() : Scenario3_ReadWrite
  • UpdateRectTransform() : LowLatencyInputMain , RectRenderer
  • UpdateRegisterButton() : sealed , DeviceEvents
  • UpdateRegisterEventButton() : Scenario3_InterruptPipes
  • UpdateRegisterEventButtons() : sealed , InputReportEvents
  • UpdateRenderOptions() : sealed
  • UpdateRenderTargetSize() : DeviceResources
  • UpdateRequestToSendEnabledView() : Scenario2_ConfigureDevice
  • UpdateRunningAverageContainerHeight() : ChatListView , sealed
  • UpdateRunningAverageContainerHeightHandler : sealed
  • UpdateScalingAndOrder() : sealed
  • UpdateSeekableRangesControl() : Scenario7_LiveSeekableRange
  • UpdateSeekableWindowControls() : Scenario7_LiveSeekableRange
  • UpdateSelectionRectangle() : InkRenderer
  • UpdateSelectionUI() : Scenario4_EdgeTappedListView
  • UpdateShape() : SceneComposer
  • UpdateSliderPosition() : SeekBarElement
  • UpdateSmtcPosition() : Scenario1
  • UpdatesNeeded() : SceneComposer
  • UpdateSourceRun() : Scenario1_CreateTile
  • UpdateSSMLText() : Scenario_SynthesizeSSML , sealed
  • UpdateStartStopButtons() : sealed , DeviceConnect
  • UpdateState() : IsApiPropertyPresentTrigger
  • UpdateStatus : DeviceWatcherHelper , Scenario2_LaunchUri , Scenario1_Discovery , Scenario15_DPLCreateFileEvents , sealed , Scenario3_LaunchAppServices , Scenario5_Capabilities
  • updateStatus : DeviceWatcherHelper
  • UpdateStatus() : DeviceWatcherHelper
  • UpdateStatusAsync() : Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • UpdateStatusOutput() : sealed , Scenario2_CloseDrawer
  • UpdateStereoState() : DeviceResources
  • UpdateStopBitCountView() : Scenario2_ConfigureDevice
  • UpdateSurface() : final , RealtimeSurfaceMeshRenderer
  • UpdateSwitchStateTable() : DeviceEvents , Scenario3_InterruptPipes , sealed
  • UpdateSystemMediaControlsDisplayAsync() : Scenario1
  • UpdateTextBlock() : Scenario2 , sealed
  • UpdateTextLayout() : sealed
  • UpdateTextUI() : CustomEditControl
  • UpdateTile() : TilesHelper
  • UpdateTiles() : TilesHelper
  • UpdateTimer_Tick() : MainPage
  • UpdateTitle() : App , SampleState
  • UpdateTransform() : final
  • UpdateTransportControls() : Scenario6
  • UpdateTrigger() : InputTypeTrigger , ControlSizeTrigger
  • UpdateUI() : LocationTrackingReason
  • UpdateUi() : MainPage
  • UpdateUI() : SampleBackgroundTaskWithCondition , sealed , MultipleTasks
  • UpdateUi() : sealed
  • UpdateUI() : sealed , TimeTriggeredTask , sealed , TimeTriggeredTask , GroupedBackgroundTask , sealed , UnspecifiedReason , CachedFileUpdater_Local , CachedFileUpdater_Remote , MainPage , Scenario_PauseAsync , sealed , CustomTrigger , sealed , SampleBackgroundTask , sealed , ApplicationTriggerTask , ServicingCompleteTask , ApplicationTriggerTask , sealed , GroupedBackgroundTask , sealed , ServicingCompleteTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition
  • UpdateUIAsync() : sealed , Scenario4_BackgroundProximitySensor , Scenario4_BackgroundPedometer , Scenario4_BackgroundActivity
  • UpdateUX() : Scenario3_ServerForeground
  • UpdateValues() : DOModel , DataModel , CSharpModel , DataModel , DOModel
  • UpdateValuesClick() : BasicTests , OtherBindings , sealed , ListsAndTemplates , sealed , Functions
  • UpdateVertexResources() : final
  • UpdateViewProjectionBuffer() : CameraResources
  • UpdateVisibilities() : StepsHelperControl
  • UpdateVisitData() : Scenario7_ForegroundVisits
  • UpdateVisualState() : Scenario2_Binary , Scenario3_ClientAuthentication , sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario4_PartialReadWrite , sealed , Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed , Scenario3_ClientAuthentication , sealed
  • UpdateWbControlCapabilities() : MainPage
  • UpdateWhiteLevelScale() : D2DAdvancedColorImagesRenderer
  • UpdateWiFiImage() : sealed , WiFiNetworkDisplay
  • UpdateWordBoxTransform() : sealed , OcrCapturedImage , OcrFileImage , sealed , OcrCapturedImage , OcrFileImage
  • UpdateWriteButtonStates() : Scenario3_ReadWrite
  • UpdateWriteBytesCounterView() : Scenario3_ReadWrite
  • UpdateWriteTimeoutView() : Scenario3_ReadWrite
  • UpdateZoomControlCapabilities() : MainPage
  • UpdateZoomState() : PhotoAdjustmentRenderer
  • UploadGeometryAndShaders() : BaseControl
  • UploadMultipleFiles() : Scenario2_Upload
  • UploadMultipleFilesAsync() : sealed
  • UploadProgress() : Scenario2_Upload , sealed
  • UploadSingleFile() : Scenario2_Upload
  • UploadSingleFileAsync() : sealed
  • UriToStreamAsync() : Scenario6_NavToStream::StreamUriWinRTResolver
  • UriToString() : Scenario1_NavToUrl
  • Url : DASHEntry
  • url : MediaSegment
  • urls : sealed
  • UrlTemplate : MediaSegmentInformation
  • urlTemplate : Scenario12
  • UsageId
: SuperMutt::DeviceInputReportControlInformation
, SuperMutt::LedPattern
, SuperMutt::Device
  • UsagePage
: SuperMutt::Device
, SuperMutt::DeviceInputReportControlInformation
, SuperMutt::LedPattern
  • UseCustomColors_Click() : Scenario1_Colors , sealed
  • UseCustomControls : SettingsService , SettingsViewModel
  • UseCustomControlsChanged : SettingsService
  • UseCustomControlsKey : SettingsService
  • Used20CallingMethod : RawSMBIOSData
  • UseHolographicCameraResources() : DeviceResources
  • UseInertia() : ManipulationInputProcessor , sealed
  • UseInputFrameForOutput : AudioEchoEffect
  • UseMinimalOverlaysCheckBox_Click() : sealed , Scenario1_Basic
  • UseNativeWISPr : ConfigStore
  • User() : User
  • USER_LIST_FILE_NAME : AccountsHelper
  • UserControl_Loaded() : ScenarioElement
  • UserDataAccountViewModel() : sealed
  • userDataProtectionManager : Scenario2_Memory , Scenario1_Files
  • UserId : UserViewModel
  • userId : EnableHelloPage
  • UserId : RegisterMessage , SignatureMessage , UserViewModel
  • userId : MainPage
  • UserId : DAL::RegisteredUser , UserViewModel , UserAndKeyHintMessage
  • UserLanguageToggle_Toggled() : sealed , OcrFileImage
  • UserName : ConfigStore
  • userNumber : Scenario2_WatchUsers
  • Users : DAL , Scenario2_WatchUsers
  • users : Scenario2_WatchUsers
  • Users : Scenario2_WatchUsers
  • UserSelect() : UserSelect , sealed
  • userStore : Scenario1_MoveCertificate
  • UserViewModel() : UserViewModel
  • userWatcher : Scenario2_WatchUsers
  • UsesPassport : Account , sealed
  • UsingNetworkContext< T >() : Scenario16_NetworkResource
  • usingVprtShaders : VideoRenderer , SpinningCubeRenderer
  • uStart : LineSegment
  • uTan : TangentVertex
  • Utils() : Utils
  • UUID : RawSMBIOSSystemInfo
  • uv : VertexPositionTexture
  • uvPrint : Print3D
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- v -

  • v : Vector2< T > , Vector3< T >
  • ValidateAndGetUri() : ShareWebLink , sealed
  • ValidateBufferValue() : WASAPIRenderer
  • ValidateDevice() : DeviceResources
  • ValidateFile() : SampleState , MainPage
  • ValidateInput() : Scenario3_LaunchAppServices
  • ValidateOperation() : OpQueue< T, TOperation > , CMediaSource , CStreamSink
  • ValidatePageRangeOption() : sealed , PageRangePrintHelper
  • ValidatePresentationDescriptor() : CMediaSource
  • validateStep1() : ScenarioElement
  • ValidateSystemDiscovery() : MainPage
  • ValidateTCK() : AtrParser
  • ValidateTPMSmartCard() : MainPage
  • ValidStateMatrix : CStreamSink
  • Value : TlvEntry , YangContainer
  • value : int24in32
  • ValueChangedSubscribeToggle_Click() : Scenario2_Client
  • ValueLength : TlvEntry
  • Values : EmployeeDictionary
  • VariableName : FxCompile
  • vector : GroupInfoList
  • Vector2() : Vector2< T >
  • Vector3() : Vector3< T >
  • Vector4() : Vector4< T >
  • VectorChanged : EmployeeCollection , FileDataSource , VeryObservableCollection-g< T >
  • VectorPosition() : GameObject
  • VectorVelocity() : GameObject
  • Velocity() : GameObject , MoveLookController
  • VelocityKiloMetrePerHour : PresentationFormats
  • VelocityKnot : PresentationFormats
  • VelocityMetresPerSecond : PresentationFormats
  • VelocityMilePerHour : PresentationFormats
  • Verified : User
  • verifiedKey : User
  • verifyButton_Click() : sealed , Scenario9_CustomPairDevice
  • VerifyResponse_Click() : sealed , Scenario5_VerifyResponse
  • VerifyTileIsPinned() : Scenario6_SecondaryTileNotification
  • version : NfcProvHeader
  • Version : RawSMBIOSSystemInfo , ManageSessionResponse
  • VersionNumber : GeneralAuthenticate
  • versionString() : Scenario1
  • VersionString() : sealed
  • vertexBuffer : VideoRenderer , SpinningCubeRenderer
  • VertexBuffer : MeshGeometry
  • VertexPositionColor() : VertexPositionColor
  • vertexPositionScale : SurfaceMeshProperties
  • VertexPositionTexture() : VertexPositionTexture
  • vertexShader : VideoRenderer , SpinningCubeRenderer
  • vertexStride : SurfaceMeshProperties
  • VertexStride : MeshGeometry
  • verticalScrollableWindow : sealed , Scenario7_ScrollingContentUsingMarquee
  • verticesCount : Print3D
  • verticesMaterialCount : Print3D
  • verticesPrint : Print3D
  • VeryObservableCollection() : VeryObservableCollection-g< T >
  • Vid : SuperMutt::Device , ArduinoDevice
  • video : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • VIDEO_ENCODING_STRING : sealed
  • VideoButton_Click() : sealed , MainPage , sealed , Scenario3_AspectRatio , sealed , MainPage , sealed , MainPage
  • VideoChat() : VideoChat
  • VideoFrameProcessor() : VideoFrameProcessor
  • VideoGallery() : sealed , VideoGallery
  • VideoGallery_Loaded() : VideoGallery
  • VideoId : DialLaunchArguments
  • VideoItem() : sealed , VideoItem
  • VideoLink : VideoMetaData
  • VideoMimeType : Manifest
  • VideoPlaybackErrorHandler() : sealed
  • VideoPreviewImageUri : VideoItem
  • videoProjection : sealed , PlaybackPage
  • videoProperties : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • VideoRenderer() : VideoRenderer
  • VideoSettings_Changed() : sealed , Scenario3_AspectRatio
  • VideoStabilizationEffect_EnabledChanged() : sealed , MainPage
  • VideoTracks_SelectedIndexChanged() : Scenario4
  • view : ConstantBufferChangesEveryFrame
  • View() : Camera
  • View_Released() : SecondaryViewPage
  • ViewablePageSize : PageDescription
  • ViewConsolidated() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • viewerDistanceInches : STEREO_PARAMETERS
  • viewId : ViewLifetimeControl , sealed , ViewLifetimeControl
  • ViewLifetimeControl() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • ViewLifetimeControl_Released() : SecondaryViewPage
  • ViewModel : Settings , sealed , MeteringData , SectionView
  • ViewModelLocator() : sealed , ViewModelLocator
  • ViewModelProperty : SectionView
  • ViewPage() : Scenario1_Render , sealed
  • viewport : GpuCoordinateMapper::VisualizeFrameBlob
  • Viewport : CameraResources
  • viewProjection : ViewProjectionConstantBuffer
  • viewProjectionConstantBuffer : CameraResources
  • viewProjectionLeft : ViewProjectionConstantBuffer
  • viewProjectionRight : ViewProjectionConstantBuffer
  • ViewSizePreferences : MainPage
  • viewToProj : GpuCoordinateMapper::VisualizeFrameBlob
  • Visibility : Employee , IEmployee , Manager , GameMain
  • VisibilityChanged() : Scenario1_DataEvents , Scenario5_DataEventsBatching , Scenario1_DataEvents , ViewLifetimeControl , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DeviceUse , Scenario1_DataEvents , sealed , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario3_Polling , sealed , Scenario1_DataEvents , sealed , Scenario2_Polling , sealed , Scenario2_ShakeEvents
  • visibilityToken : sealed , Scenario3 , sealed
  • Visible() : GameInfoOverlay
  • VisitBackgroundTask() : VisitBackgroundTask
  • VISUAL_INDICATOR_NAME : EdgeTappedListView
  • VISUAL_INDICATOR_WIDTH : EdgeTappedListView
  • visualIndicator : EdgeTappedListView
  • VisualizeCoordinateMapping() : GpuCoordinateMapper , CameraCoordinateMapper
  • VisualProperties() : sealed
  • vm : Albums , Collections
  • voiceCommand : TripVoiceCommand
  • voiceServiceConnection : sealed , AdventureWorksVoiceCommandService
  • Volume() : IAppliance , Oven , IAppliance
  • VolumeCubicMetres : PresentationFormats
  • VolumeDataStartBit : SuperMutt::ReadWriteBufferControlInformation
  • VolumeLitre : PresentationFormats
  • VolumeUsageId : SuperMutt::ReadWriteBufferControlInformation
  • VolumeUsagePage : SuperMutt::ReadWriteBufferControlInformation
  • VsToggleButton_Click() : MainPage , sealed
  • vTan : TangentVertex
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- w -

  • w : Vector3< T > , Vector4< T >
  • Wait() : PropertySetContext , PropertyGetContext< T > , PropertySetContext
  • WaitForDrawerCloseButton_Click() : Scenario2_CloseDrawer , sealed
  • WaitForMeteringData() : Metering
  • WaitForPress() : MoveLookController
  • waiting : sealed
  • waiting_previewButtonClicked() : sealed
  • Waiting_PreviewButtonClicked() : LowLatency
  • WaitingForResourceLoading() : GameMain
  • WaitOnSwapChain() : DeviceResources
  • Wakeup_Type : RawSMBIOSSystemInfo
  • walkingStepCount : sealed , Scenario1_Events
  • WASAPICapture() : WASAPICapture
  • WASAPIRenderer() : WASAPIRenderer
  • watcher : Scenario1_DataEvents , Scenario2_Polling , Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , Scenario5_DisplayingBarcodePreview , Scenario3 , Scenario1_Watcher , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_SelectDisplay , Scenario3_Choosing
  • Watcher_Added() : Scenario1ViewModel , Scenario2ViewModel , Scenario5_DisplayingBarcodePreview , Scenario3 , SourceGroupCollection , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , sealed , Scenario1_SelectDisplay
  • Watcher_DeviceAdded() : sealed , DeviceWatcherHelper
  • Watcher_DeviceRemoved() : sealed , DeviceWatcherHelper
  • Watcher_DeviceUpdated() : sealed , DeviceWatcherHelper
  • Watcher_EnumerationCompleted() : Scenario3 , sealed , DeviceWatcherHelper , sealed , Scenario1_SelectDisplay
  • Watcher_Removed() : Scenario5_DisplayingBarcodePreview , Scenario3 , SourceGroupCollection , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , Scenario5_DisplayingBarcodePreview
  • Watcher_Stopped() : Scenario3 , sealed , DeviceWatcherHelper
  • Watcher_Updated() : Scenario5_DisplayingBarcodePreview , SourceGroupCollection
  • watcherAddedToken : Scenario2_Connector
  • watcherControlButton_Click() : Scenario3
  • watcherEnumerationCompletedToken : Scenario2_Connector
  • watcherRemovedToken : Scenario2_Connector
  • watchersStarted : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • watchersSuspended : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • WatcherStarted : DeviceList
  • watcherStarted : sealed , EventHandlerForDevice
  • watcherStoppedToken : Scenario2_Connector
  • watcherSuspended : sealed , EventHandlerForDevice
  • watcherUpdatedToken : Scenario2_Connector
  • WaveEffect() : WaveEffect
  • WaveformNamesMap : MainPage
  • WaveNumberReciprocalMetre : PresentationFormats
  • waveOffset : WaveEffect
  • WbComboBox_SelectionChanged() : MainPage
  • WbSlider_ValueChanged() : MainPage
  • WebAccountCommandInvoked() : sealed
  • WebAccountInvoked() : MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • WebAccountProviderCommandInvoked() : SingleMicrosoftAccountScenario , sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario
  • WebPageLink : VideoMetaData
  • WebViewControl_ContainsFullScreenElementChanged() : Scenario9_ContainsFullScreenElement
  • WebViewControl_ContentLoading() : Scenario1_NavToUrl
  • WebViewControl_DOMContentLoaded() : Scenario1_NavToUrl
  • WebViewControl_NavigationCompleted() : Scenario1_NavToUrl , Scenario7_Share
  • WebViewControl_NavigationStarting() : Scenario1_NavToUrl , Scenario7_Share
  • WebViewControl_ScriptNotify() : Scenario4_ScriptNotify
  • WebViewControl_UnviewableContentIdentified() : Scenario10_UnviewableContent , Scenario1_NavToUrl
  • WeekOfProduction : CardDetails
  • wfdDevice : sealed , ConnectedDevice
  • WfdDevice : ConnectedDevice
  • Whiteboard() : sealed
  • wic : WICTranslate
  • wicFactory : DeviceResources , BasicLoader
  • WicImagingFactory : DeviceResources
  • wideMarginsIconTask : CustomOptionsPrintHelper
  • width : CachedFileUpdaterPageSizeChangedEventArgs , FileSavePickerPageSizeChangedEventArgs , DDS_HEADER , MainPageSizeChangedEventArgs
  • Width : StreamResolution , CachedFileUpdaterPageSizeChangedEventArgs , FileSavePickerPageSizeChangedEventArgs , Dimensions , MainPageSizeChangedEventArgs , sealed
  • WiFiAdapterDisplayNames : Scenario2ViewModel
  • WiFiAdapterListVisibility : Scenario2ViewModel
  • wiFiAdapters : Scenario1_CachedNetworks
  • WiFiDirectServiceManager() : sealed , WiFiDirectServiceManager
  • WiFiImage : sealed , WiFiNetworkDisplay
  • WiFiNetworkDisplay() : sealed , WiFiNetworkDisplay
  • WINCODEC_ERR_COMPONENTNOTFOUND : Scenario2
  • WINCODEC_ERR_PROPERTYNOTSUPPORTED : Scenario2
  • WINCODEC_ERR_UNSUPPORTEDOPERATION : Scenario2
  • Window : WindowInfo
  • window : ViewLifetimeControl , sealed
  • Window_Activated() : Scenario7_PinFromAppbar
  • Window_SizeChanged() : DetailPage
  • Window_VisibilityChanged() : ManageCardScenario , sealed , MainPage , sealed , LowLatency
  • windowActivatedEventToken : Scenario7_PinFromAppbar
  • WindowActivationChanged() : GameMain
  • windowClosed : AppView
  • WindowInfo() : WindowInfo
  • windowList : sealed
  • WindowList : Scenario3_UsingWindows
  • windowResizeToken : Scenario1_Basic , sealed
  • windowSizeChangedToken : Scenario2_Extend , sealed , Scenario1_Basic , CustomTitleBar
  • windowVisible : AppView , sealed
  • WipeGeolocDataFromAppData() : LocationBackgroundTask
  • word : sealed , WordOverlay
  • wordBoundingRect : WordOverlay
  • wordBoxes : OcrCapturedImage , sealed , OcrCapturedImage , OcrFileImage
  • WordHeight : WordOverlay
  • wordHeight : sealed
  • WordListBox_OnKeyUp() : Scenario3_ShowHideMethods
  • WordOverlay() : sealed , WordOverlay
  • WordPosition : WordOverlay
  • wordPosition : sealed
  • WordSegmentButton_Click() : sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • WordSegmentsButton_Click() : Scenario1_ExtractTextSegments , sealed
  • WordWidth() : WordOverlay
  • wordWidth : sealed
  • WordWidth : WordOverlay
  • workItemHandler : PlaybackPage
  • World() : Camera
  • WorldCeilingMesh() : WorldCeilingMesh
  • WorldFloorMesh() : WorldFloorMesh
  • worldMatrix : ConstantBufferChangesEveryPrim
  • worldToView : GpuCoordinateMapper::VisualizeFrameBlob
  • WorldWallsMesh() : WorldWallsMesh
  • Write() : Write
  • WriteAsync() : AccessHandler , PipeOut , AccessHandler , Scenario2_LEDTemp , AccessHandler , Scenario3_ReadWrite , AccessHandler
  • WriteBlock_Click() : DeviceReadWrite , sealed
  • WriteBufferToSelectedCharacteristicAsync() : Scenario2_Client
  • WriteButton_Click() : Scenario3_ReadWrite
  • WriteBytesAvailable : Scenario3_ReadWrite
  • WriteBytesButton_Click() : sealed , Scenario4
  • WriteBytesCounter : Scenario3_ReadWrite
  • WriteBytesInputValue_GotFocus() : Scenario3_ReadWrite
  • WriteBytesInputValue_TextChanged() : Scenario3_ReadWrite
  • WriteCancelButton_Click() : Scenario3_ReadWrite
  • WriteCancellationTokenSource : Scenario2_LEDTemp , Scenario3_ReadWrite
  • WriteCancelLock : Scenario3_ReadWrite , Scenario2_LEDTemp
  • WriteCompositeSetting_Click() : Scenario4_CompositeSettings
  • writeCounter : sealed , DeviceReadWrite
  • WriteData() : BasicReaderWriter
  • WriteDataAsync() : BasicReaderWriter
  • WriteErrorLogEntry() : CServiceBase
  • WriteEventLogEntry() : CServiceBase , CSampleService
  • WriteException() : sealed
  • WriteGeolocToAppData() : LocationBackgroundTask
  • WriteLedCommand() : Scenario2_LEDTemp
  • WriteLine() : sealed
  • WriteMessage() : sealed
  • WriteMessageAsync() : SocketReaderWriter
  • writer : ScenarioContext , Scenario2_ChatServer , SocketWrapper , sealed , RfcommServerTask
  • WriteReadStream() : WriteReadStream , sealed
  • WriteSetting_Click() : Scenario3_SettingContainer , Scenario2_Settings
  • WriteStatusToAppData() : LocationBackgroundTask
  • WriteSuperMuttInterruptOut_Click() : Scenario3_InterruptPipes
  • WriteTextButton_Click() : sealed , Scenario3
  • WriteTimeoutButton_Click() : Scenario3_ReadWrite
  • WriteToDeviceAsync() : IoSyncBackgroundTask
  • WriteToFileButton_Click() : Scenario5_TriggerCFU , sealed , Scenario5_TriggerCFU
  • WriteToFileWithExplicitCFUButton_Click() : sealed , Scenario5_TriggerCFU
  • WriteToInterruptOut() : Scenario3_InterruptPipes
  • WriteToStreamAsync() : HttpJsonContent
  • WriteToStreamButton_Click() : sealed , Scenario5
  • WriteTrips() : TripStore , sealed
  • WriteXml() : sealed , Scenario2_XmlWriter
  • WrongPassword : Scenario1_Render
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- x -

  • x : WaveEffect::Vertex , Vector2< T > , Vector4< T > , Vector3< T >
  • xamlGestureRecognizer : sealed
  • XmlLoading() : XmlLoading
  • XMScalarSinCos() : VideoRenderer
  • XsltInit() : XSLTTransform
  • XSLTTransform() : XSLTTransform
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- y -

  • y : WaveEffect::Vertex , Vector2< T > , Vector4< T > , Vector3< T >
  • YangContainer() : YangContainer
  • YangObj : DOModel
  • Yaw() : Camera , MoveLookController
  • YawSlider_ValueChanged() : sealed
  • YearOfProduction : CardDetails
  • YellowButton_Click() : sealed
  • yesButton_Click() : Scenario9_CustomPairDevice , sealed
  • YinCallback() : DOModel
  • YinPropertyDP : DOModel
  • YinPropertyDPName : DOModel
  • YinPropertyDPProperty : DOModel
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerations

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u

- _ -

  • _LaunchType : sealed

- a -

  • AccountAction : sealed
  • AtrHeader : AtrParser
  • AzureKeyAcquisitionMethod : Scenario3_RequestModification

- b -

  • BarcodeScannerInstance : Scenario2_MultipleScanners

- c -

  • CalculatorCharacteristics : Scenario3_ServerForeground
  • CalculatorOperators : Scenario3_ServerForeground
  • CashDrawerInstance : sealed , Scenario3_MultipleDrawers
  • CategoryIndicator : IccDetection
  • CommandType : DesfireCommand
  • CostGuidance : Helpers

- d -

  • DataObjectType : ManageSession , TransparentExchangeResponse , ManageSessionResponse , IncrementDecrement , TransparentExchange

- e -

  • eAVEncH264VLevel : MediaFoundationConstants

- g -

  • GeneralAuthenticateKeyType : GeneralAuthenticate
  • GeneralAuthenticateVersionNumber : GeneralAuthenticate
  • GetDataDataType : GetData

- i -

  • InkingAreaSubStates : sealed
  • InputModes : sealed

- l -

  • LatencyMode : LowLatency
  • LatencyModes : sealed
  • LedState : Scenario2_LEDTemp
  • LoadKeysKeyType : LoadKeys
  • LoadKeysStorageType : LoadKeys
  • LoadKeysTransmissionType : LoadKeys

- m -

  • MapIconState : sealed , Scenario11
  • MeteredConnectionBehavior : HttpMeteredConnectionFilter

- n -

  • NamespaceId : PresentationFormats

- o -

  • OperationType : Scenario1_ExampleOperations

- p -

  • PointerHitTestStates : sealed

- r -

  • ReaderState : MFSampleGenerator
  • Role : sealed

- s -

  • ScenarioOneStates : sealed
  • ScenarioState : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam
  • ScenarioType : sealed , Scenario3_Notifications
  • SCENEOBJECT_TYPES : SceneComposer
  • SegmentInformationType : MediaStream
  • SegmentTemplateIdentifier : MediaStream
  • SoundSourceType : OmnidirectionalSound
  • State : LowLatency , CStreamSink , MediaCaptureManager
  • StreamOperation : CStreamSink

- t -

  • TextAlignment : TextRenderer
  • Type : CSourceOperation

- u -

  • Units : PresentationFormats
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • AbsorbedDoseGray : PresentationFormats
  • AbsorbeddoserateGrayPerSecond : PresentationFormats
  • AccelerationMetresPerSecondSquared : PresentationFormats
  • active : sealed
  • ActivityReferredToARadioNuclideBecquerel : PresentationFormats
  • Add : Scenario3_ServerForeground
  • AddAccount : sealed
  • AmountConcentrationMolePerCubicMetre : PresentationFormats
  • AmountOfSubstanceMole : PresentationFormats
  • AngularAccelerationRadianPerSecondSquared : PresentationFormats
  • AngularVelocityRadianPerSecond : PresentationFormats
  • AngularVelocityRevolutionPerminute : PresentationFormats
  • AreaBarn : PresentationFormats
  • AreaHectare : PresentationFormats
  • AreaNone : sealed
  • AreaSquareMetres : PresentationFormats
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- l -

  • LengthAngstrom : PresentationFormats
  • LengthFoot : PresentationFormats
  • LengthInch : PresentationFormats
  • LengthMetre : PresentationFormats
  • LengthMile : PresentationFormats
  • LengthNauticalMile : PresentationFormats
  • LengthParsec : PresentationFormats
  • LengthYard : PresentationFormats
  • LogarithmicRadioQuantityBel : PresentationFormats
  • LogarithmicRadioQuantityNeper : PresentationFormats
  • lowLatency : sealed
  • LuminanceCandelaPerSquareMetre : PresentationFormats
  • LuminousFluxLumen : PresentationFormats
  • LuminousIntensityCandela : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- m -

  • MagneticFieldStrengthAmperePerMetre : PresentationFormats
  • MagneticFluxDensityTesla : PresentationFormats
  • MagneticFluxWeber : PresentationFormats
  • ManageAccount : sealed
  • MassConcentrationKilogramPerCubicMetre : PresentationFormats
  • MassDensityMilligramPerdeciLitre : PresentationFormats
  • MassDensityMillimolePerLitre : PresentationFormats
  • MassKilogram : PresentationFormats
  • MassPound : PresentationFormats
  • MassTonne : PresentationFormats
  • MilliliterPerKilogramPerminute : PresentationFormats
  • MolarEnergyJoulePermole : PresentationFormats
  • MolarentropyJoulePermoleKelvin : PresentationFormats
  • MomentOfForceNewtonMetre : PresentationFormats
  • Multiply : Scenario3_ServerForeground
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- n -

  • None : sealed , HttpMeteredConnectionFilter
  • Normal : HttpMeteredConnectionFilter
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- o -

  • Op_Count : CStreamSink
  • Operand1 : Scenario3_ServerForeground
  • Operand2 : Scenario3_ServerForeground
  • Operation_SetRate : CSourceOperation
  • Operation_Start : CSourceOperation
  • Operation_Stop : CSourceOperation
  • Operator : Scenario3_ServerForeground
  • OpPause : CStreamSink
  • OpPlaceMarker : CStreamSink
  • OpProcessSample : CStreamSink
  • OpRestart : CStreamSink
  • OpSetMediaType : CStreamSink
  • OpStart : CStreamSink
  • OpStop : CStreamSink
  • OptIn : HttpMeteredConnectionFilter
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- b -

  • BluetoothSigAssignedNumber : PresentationFormats
  • BottomLeft : TextRenderer
  • BottomRight : TextRenderer
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- c -

  • CapacitanceFarad : PresentationFormats
  • CatalyticActivityConcentrationKatalPerCubicMetre : PresentationFormats
  • CatalyticActivityKatal : PresentationFormats
  • CelsiusTemperatureDegreeCelsius : PresentationFormats
  • Complete : sealed
  • ConcentrationCountPerCubicMetre : PresentationFormats
  • Conservative : HttpMeteredConnectionFilter
  • CurrentDensityAmperePerSquareMetre : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- d -

  • Denied : sealed
  • DensityKilogramperCubicMetre : PresentationFormats
  • Disabled : sealed
  • Divide : Scenario3_ServerForeground
  • DoseEquivalentSievert : PresentationFormats
  • DynamicViscosityPascalSecond : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- e -

  • ElectricchargeAmpereHours : PresentationFormats
  • ElectricChargeCoulomb : PresentationFormats
  • ElectricchargeDensityCoulombPerCubicMetre : PresentationFormats
  • ElectricConductanceSiemens : PresentationFormats
  • ElectricCurrentAmpere : PresentationFormats
  • ElectricfieldstrengthVoltPerMetre : PresentationFormats
  • ElectricFluxDensityCoulombPerSquareMetre : PresentationFormats
  • ElectricPotentialDifferenceVolt : PresentationFormats
  • ElectricResistanceOhm : PresentationFormats
  • end : sealed
  • EndOfStream : MFSampleGenerator
  • EnergyDensityJoulePerCubicMetre : PresentationFormats
  • EnergyGramcalorie : PresentationFormats
  • EnergyJoule : PresentationFormats
  • EnergyKilogramcalorie : PresentationFormats
  • EnergyKiloWattHour : PresentationFormats
  • Erasing : sealed
  • ErasingMode : sealed
  • ExposureCoulombPerKilogram : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- f -

  • Failed : sealed
  • File : OmnidirectionalSound
  • ForceNewton : PresentationFormats
  • FrequencyHertz : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- h -

  • HeatCapacityJoulePerKelvin : PresentationFormats
  • HeatFluxDensityWattPerSquareMetre : PresentationFormats
  • highLatency : sealed
  • Hover : sealed
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- i -

  • Idle : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • IlluminanceLux : PresentationFormats
  • InductanceHenry : PresentationFormats
  • Initialized : MediaCaptureManager
  • initializing : sealed
  • InkingMode : sealed
  • InkToolbarMode : sealed
  • InsideInkingArea : sealed
  • InsideSelectionRect : sealed
  • Instance1 : Scenario2_MultipleScanners , sealed
  • Instance2 : sealed , Scenario2_MultipleScanners
  • IrradianceWattPerSquareMetre : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- p -

  • passive : sealed
  • Percentage : PresentationFormats
  • PeriodBeatsPerMinute : PresentationFormats
  • PermeabilityHenryPerMetre : PresentationFormats
  • PerMille : PresentationFormats
  • PermittivityFaradPerMetre : PresentationFormats
  • PlaneAngleDegree : PresentationFormats
  • PlaneAngleMinute : PresentationFormats
  • PlaneAngleRadian : PresentationFormats
  • PlaneAngleSecond : PresentationFormats
  • Playing : MFSampleGenerator
  • PowerWatt : PresentationFormats
  • PreRoll : MFSampleGenerator
  • PressureBar : PresentationFormats
  • PressureMilliMetreofmercury : PresentationFormats
  • PressurePascal : PresentationFormats
  • PressurePoundForcePerSquareinch : PresentationFormats
  • previewing : sealed
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- r -

  • RadianceWattPerSquareMetreSteradian : PresentationFormats
  • RadiantintensityWattPerSteradian : PresentationFormats
  • ReaderStateEOS : MFSampleGenerator
  • ReaderStatePlaying : MFSampleGenerator
  • ReaderStatePreRoll : MFSampleGenerator
  • ReaderStateStopped : MFSampleGenerator
  • Recording : MediaCaptureManager
  • RefractiveIndex : PresentationFormats
  • RelativePermeability : PresentationFormats
  • ReservedForFutureUse : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- s -

  • Selected : sealed
  • Selecting : sealed
  • SelectingMode : sealed
  • SelectingOrPasting : sealed
  • Snapshot : Scenario2_DetectInWebcam
  • SolidAngleSteradian : PresentationFormats
  • SOT_Generic : SceneComposer
  • SOT_Ink : SceneComposer
  • SOT_Shape : SceneComposer
  • SpecificEnergyJoulePerKilogram : PresentationFormats
  • SpecificHeatCapacityJoulePerKilogramKelvin : PresentationFormats
  • SpecificVolumeCubicMetrePerKilogram : PresentationFormats
  • StartingRecord : MediaCaptureManager
  • State_Count : CStreamSink
  • State_Paused : CStreamSink
  • State_Ready : CStreamSink
  • State_Started : CStreamSink
  • State_Stopped : CStreamSink
  • State_TypeNotSet : CStreamSink
  • Stopped : MFSampleGenerator
  • StoppingRecord : MediaCaptureManager
  • Stream : OmnidirectionalSound
  • streaming : sealed
  • Streaming : Scenario1_TrackInWebcam , Scenario2_DetectInWebcam
  • Subtract : Scenario3_ServerForeground
  • SurfacechargeDensityCoulombPerSquareMetre : PresentationFormats
  • SurfaceDensityKilogramPerSquareMetre : PresentationFormats
  • SurfaceTensionNewtonPerMetre : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- t -

  • TakingPhoto : MediaCaptureManager
  • ThermalConductivityWattPerMetreKelvin : PresentationFormats
  • ThermodynamicTemperatureDegreeFahrenheit : PresentationFormats
  • ThermodynamicTemperatureKelvin : PresentationFormats
  • Tile : sealed
  • TimeDay : PresentationFormats
  • TimeHour : PresentationFormats
  • TimeMinute : PresentationFormats
  • TimeMonth : PresentationFormats
  • TimeSecond : PresentationFormats
  • TimeYear : PresentationFormats
  • Toast : sealed
  • TopLeft : TextRenderer
  • TopRight : TextRenderer
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- u -

  • uninitialized : sealed
  • Unitless : PresentationFormats
  • Unknown : MediaCaptureManager
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- v -

  • VelocityKiloMetrePerHour : PresentationFormats
  • VelocityKnot : PresentationFormats
  • VelocityMetresPerSecond : PresentationFormats
  • VelocityMilePerHour : PresentationFormats
  • VolumeCubicMetres : PresentationFormats
  • VolumeLitre : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- w -

  • waiting : sealed
  • WaveNumberReciprocalMetre : PresentationFormats
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Events

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • a
  • b
  • c
  • d
  • f
  • i
  • l
  • m
  • o
  • p
  • s
  • u
  • v

- a -

  • ArticleSelected : SectionView

- b -

  • BreadBaked : IOven , Oven

- c -

  • CacheChanged : ItemCacheManager< T >
  • CachedFileUpdaterPageResized : CachedFileUpdaterPage
  • CanExecuteChanged : RelayCommand
  • CaptureFailed : CaptureDevice
  • CastButtonClicked : MediaTransportControlsWithCustomCastButton
  • CollectionChanged : VeryObservableCollection-g< T > , IncrementalLoadingBase , FileDataSource , FileDataSource2 , EmployeeCollection , FileDataSource
  • ConnectRequestRecieved : OnboardingService

- d -

  • DeviceChanged : DeviceWatcherHelper
  • DeviceClosing : DeviceList
  • DeviceLost : DeviceResources
  • DeviceRestored : DeviceResources

- f -

  • FileSavePickerPageResized : FileSavePickerPage

- i -

  • IncomingConnectionArrived : CaptureDevice
  • InternalReleased : ViewLifetimeControl
  • IsUpperCaseEnabledPropertyDataChanged : AppData
  • ItemLeftEdgeTapped : EdgeTappedListView

- l -

  • Liked : CustomMediaTransportControls
  • LoadState : NavigationHelper

- m -

  • MapChanged : EmployeeDictionary

- o -

  • OrientationChanged : CameraRotationHelper

- p -

  • PreviewPagesCreated : PrintHelper
  • ProjectionStopping : ProjectionViewBroker
  • PropertyChanged : MyUserControl1 , DataModel , Manager , YangContainer , WiFiNetworkDisplay , DiscoveredDevice , Scenario1_Basic , UserViewModel , Scenario1_Colors , CustomTitleBar , RadioModel , ViewModelBase , WordOverlay , BindableBase , ViewLifetimeControl , Scenario1 , ImportableItemWrapper , DeviceInformationDisplay , ServiceViewModel , Trip , ViewModelBase , RfcommChatDeviceDisplay , BluetoothLEDeviceDisplay , Scenario5_DisplayingBarcodePreview , DownloadOperationItem , PlaylistView , SettingsViewModel , PlayerViewModel , PlaybackSessionViewModel , MediaItemViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , ViewLifetimeControl , HeroArticlesViewModel

- s -

  • SaveState : NavigationHelper
  • ScenarioLoaded : FileSavePickerPage , CachedFileUpdaterPage
  • StateChanged : MainPage
  • StatusChanged : LoggingSessionScenario , FileLoggingSessionScenario
  • StepChanged : StepsControl
  • StopProjectingButtonClick : ProjectedMediaTransportControls
  • SwapViewsButtonClick : ProjectedMediaTransportControls

- u -

  • UseCustomControlsChanged : SettingsService

- v -

  • VectorChanged : EmployeeCollection , VeryObservableCollection-g< T > , FileDataSource
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- _ -

  • _360VideoPlaybackMain() : _360VideoPlaybackMain
  • _accelerometerOriginal_ReadingChanged() : Scenario4_OrientationChanged
  • _accelerometerReadingTransform_ReadingChanged() : Scenario4_OrientationChanged
  • _Acquires_lock_() : CritSec , AutoLock , CMediaSource
  • _GetContactAnnotationList() : Scenario1_CreateContacts
  • _GetContactList() : Scenario1_CreateContacts
  • _items() : Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView
  • _message() : CaptureFailedEventArgs
  • _offset() : sealed
  • _Releases_lock_() : AutoLock , CMediaSource , CritSec
  • _size() : sealed
  • _status() : sealed
  • _targetElement_PointerPressed() : InputTypeTrigger
  • _targetElement_SizeChanged() : ControlSizeTrigger
  • _timerStep3_Tick() : ScenarioElement
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- k -

  • KeepConnectionOpenScenario() : KeepConnectionOpenScenario
  • KeepOriginalFolder_checked() : Scenario1
  • Key() : GroupInfoList
  • KeyboardKey_Pressed() : Scenario2_ChatServer , Scenario3_BgChatServer , Scenario1_ChatClient
  • Kind() : DeviceInformationDisplay
  • Kinds() : DeviceInformationKindChoice
  • KnownDevices() : Scenario1_Discovery
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- l -

  • Lamp_AvailabilityChanged() : sealed , Scenario3_AvailabilityChanged
  • LampArray_AvailabilityChanged() : Scenario2_Effects , Scenario1_Basics , Scenario2_Effects
  • LampArrayInfo() : LampArrayInfo
  • lampToggle_Toggled() : sealed , Scenario3_AvailabilityChanged
  • LanguageList_SelectionChanged() : sealed , Scenario1_Configuration , sealed , OcrFileImage
  • LanguageOverrideCombo_SelectionChanged() : Scenario8
  • LanguageTagToRecognizerName() : sealed
  • LastName() : Contact
  • LatencyModeToggle_Toggled() : LowLatency
  • LatencyModeToggled() : sealed
  • Launch_Click() : Scenario3_Flickr , sealed , Scenario1_GetDeviceInformation , sealed , Scenario1_Message , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions , sealed , Scenario1_Facebook , Scenario2_Twitter
  • Launch_Clicked() : Scenario2_LaunchUri
  • LaunchAppInForeground() : sealed , AdventureWorksVoiceCommandService
  • LaunchAtSize_Click() : sealed , Scenario2_Launch
  • LaunchCompleted() : App
  • LaunchContextMenu() : sealed
  • LaunchFileDefault() : Scenario1_LaunchFile
  • LaunchFileIn3DBuilder_Click() : Scenario2_Launch
  • LaunchFileOpenWith() : Scenario1_LaunchFile
  • LaunchFileSplitScreen() : Scenario1_LaunchFile
  • LaunchFileWithWarning() : Scenario1_LaunchFile
  • LaunchForegroundApp() : sealed
  • LaunchHyperlink() : EnableHelloPage
  • LaunchInFullScreenModeCheckBox_Click() : sealed , Scenario2_Launch
  • LaunchNfcPaymentsSettingsPage() : NfcUtils
  • LaunchNfcProximitySettingsPage() : NfcUtils
  • LaunchUri() : XmlLoading
  • LaunchUriDefault() : Scenario2_LaunchUri
  • LaunchUriOpenWith() : Scenario2_LaunchUri
  • LaunchUriSplitScreen() : Scenario2_LaunchUri
  • LaunchUriWithWarning() : Scenario2_LaunchUri
  • LayoutRoot_Loaded() : MasterDetailPage
  • LayoutRoot_SizeChanged() : SectionView
  • LearnMoreButton_Click() : ExtendedSplash
  • LED3Switch_Toggled() : Scenario2_LEDTemp
  • LED4Switch_Toggled() : Scenario2_LEDTemp
  • LED5Switch_Toggled() : Scenario2_LEDTemp
  • LED6Switch_Toggled() : Scenario2_LEDTemp
  • LeftEdgeBrush() : EdgeTappedListView
  • LeftEyeProjection() : Camera
  • LegacyControl_KeyUp() : Scenario3_Legacy
  • Level1() : Level1
  • Level2() : Level2
  • Level3() : Level3
  • Level4() : Level4
  • Level5() : Level5
  • Level6() : Level6
  • LevelActive() : Simple3DGame
  • LevelCompleted() : Simple3DGame
  • LicenseAcquisitionRequest() : PlayReadyHelper
  • LicenseChanged() : GameMain
  • LikeButton_Click() : CustomMediaTransportControls
  • LimiterEffectToggle_Toggled() : Scenario5_InboxEffects
  • Line() : Line
  • LineTo() : sealed
  • LinkField_Click() : sealed , S1_GetAFeed
  • List() : List< T >
  • list_SelectionChanged() : MainPage
  • ListboxVoiceChooser_SelectionChanged() : sealed , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries
  • ListenButton_Click() : Scenario2_ChatServer , Scenario3_BgChatServer
  • ListenerContext() : sealed
  • ListFoldersButton_Click() : sealed , Scenario2
  • listInputDevicesButton_Click() : Scenario1_MIDIDeviceEnumeration
  • listOutputDevicesButton_Click() : Scenario1_MIDIDeviceEnumeration
  • ListsAndTemplates() : sealed , ListsAndTemplates
  • ListSmartCard_Click() : Scenario7_ListAllCards
  • ListSmartCards_Click() : sealed
  • listUiccApps_SelectionChanged() : SimCard
  • ListView_ContextCanceled() : sealed , Scenario3
  • ListView_ContextRequested() : sealed , Scenario3
  • ListView_ItemClick() : MainPage
  • ListView_ItemClicked() : Scenario2
  • ListView_SelectionChanged() : MainPage , Scenario1
  • ListViewEdgeTappedEventArgs() : ListViewEdgeTappedEventArgs
  • ListViewEdgeTappedEventHandler() : EdgeTappedListView
  • LiveDashPlayer() : LiveDashPlayer
  • LiveSourceBufferManager() : LiveSourceBufferManager
  • Load() : AppView , sealed , AppView , sealed , VisualProperties , sealed , App , sealed
  • Load_Click() : Scenario1_SimplestAdaptiveStreaming , Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • LoadAccount() : sealed
  • LoadAccountList() : AccountsHelper
  • LoadAccounts() : sealed
  • LoadAndDisplayScreens_Click() : sealed , Scenario3
  • LoadAndFinalizeLevelInBackground() : GameMain
  • LoadAppState() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain
  • LoadAsHtml() : Scenario2_NavToString
  • LoadBitmapAsync() : sealed , PhotosPrintHelper
  • LoadBool() : PersistentState
  • LoadButton_Click() : OcrFileImage
  • loadButton_Click() : Scenario1 , Scenario2 , Scenario3
  • LoadButton_Tapped() : sealed
  • LoadDataAccountsAsync() : MainPage
  • LoadDefaultImage() : sealed
  • LoadDocument() : sealed , Scenario1_Render
  • LoadFileAsync() : Scenario1 , Scenario2
  • LoadFromApplicationUriAsync() : MediaList
  • LoadFromLocalState_Click() : Scenario5_NavToFiles
  • LoadFromPackage_Click() : Scenario5_NavToFiles
  • LoadGame() : Simple3DGame
  • LoadHighScore() : Simple3DGame
  • LoadHtml() : Scenario3_InvokeScript
  • LoadId_Click() : ContentSelector
  • LoadImage() : sealed
  • LoadImageAsync() : OcrFileImage
  • LoadImageCommon() : D2DAdvancedColorImagesRenderer
  • LoadImageFromWic() : D2DAdvancedColorImagesRenderer
  • LoadInt32() : PersistentState
  • LoadInternalState() : sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , CustomPixelShaderMain , CustomPixelShaderRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer , sealed
  • LoadItem() : MediaList
  • LoadKey() : LoadKey
  • LoadKeyAsync() : AccessHandler
  • LoadKeys() : LoadKeys
  • LoadLevelAsync() : Simple3DGame
  • LoadLevelResourcesAsync() : GameRenderer
  • LoadLogoBitmapAsync() : sealed , Scenario2_PrintReceipt
  • LoadManifestAsync() : Manifest
  • LoadMedia() : MediaReader
  • LoadMesh() : BasicLoader
  • LoadMeshAsync() : BasicLoader
  • LoadMoreItemsAsync() : IncrementalLoadingBase , Conversation
  • LoadMoreItemsOverrideAsync() : GeneratorIncrementalLoadingClass-g< T > , IncrementalLoadingBase
  • LoadPackagedLibrary() : ServiceViewModel
  • LoadPackageFromFile_Click() : Scenario1_Print
  • LoadPlaceInfoAsync() : sealed , Scenario7
  • LoadSampleImage() : sealed
  • LoadSampleImageAsync() : OcrFileImage
  • LoadSaveFileAsync() : Scenario2
  • LoadScenario() : FileSavePickerPage , FileOpenPickerPage , CachedFileUpdaterPage
  • LoadScenarioForProtocolActivation() : MainPage
  • LoadScenarios() : MainPage
  • LoadShader() : BasicLoader
  • LoadShaderAsync() : BasicLoader
  • LoadShaders() : VideoRenderer , DeviceResources
  • LoadSingle() : PersistentState
  • LoadSourceFromUriAsync() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario7_LiveSeekableRange , Scenario6_AdInsertion
  • LoadState() : Simple3DGame , SubPage , Simple3DGame , Level2 , Level4 , Simple3DGame , Level
  • LoadStateEventArgs() : LoadStateEventArgs
  • LoadString() : PersistentState
  • LoadStringFromPackageFileAsync() : MainPage
  • LoadTexture() : BasicLoader
  • LoadTextureAsync() : BasicLoader
  • LoadThumbnail() : ImportableItemWrapper
  • LoadTimer_Tick() : ArticlePage
  • LoadTripFromStore() : TripViewModel
  • LoadTrips() : TripStore , TripListViewModel
  • LoadTripsAsync() : sealed
  • LoadTripsSync() : sealed
  • LoadTripsTask() : sealed
  • LoadUri_Click() : ContentSelector
  • LoadXMFLOAT3() : PersistentState
  • LoadXmlFile() : Scenario
  • LocalClientButtonClicked() : sealed
  • LocalHostItem() : LocalHostItem , sealed , LocalHostItem
  • LocationBackgroundTask() : LocationBackgroundTask
  • LocationTrackingReason() : LocationTrackingReason , sealed
  • LockScenarioChange() : sealed
  • LockStore() : CBaseAttributes< TBase >
  • LockToXAxis() : sealed , ManipulationInputProcessor
  • LockToYAxis() : sealed , ManipulationInputProcessor
  • Log() : SdkSample , Scenario1_Download , sealed , PlayReadyHelper , Scenario3_RequestModification , Scenario5_Metadata , sealed , Scenario3_Notifications , InkEventLogger , ViewModelBase , SdkSample , sealed , SimpleLogger , sealed , Scenario6_AdInsertion , Scenario2_Upload , Scenario7_LiveSeekableRange , sealed , Scenario4_Tuning , Scenario2_EventHandlers
  • LogContactInfo() : Scenario1_EventAndMenuHookup , sealed
  • LogCurrentTimeCorrelation_Click() : Scenario7_LiveSeekableRange
  • LogException() : sealed
  • LogFileFullPath() : LoggingScenarioEventArgs
  • LogFileGeneratedCount() : FileLoggingSessionScenario , LoggingSessionScenario
  • LogFileGeneratedHandler() : FileLoggingSessionScenario
  • LoggingEnabled() : LoggingSessionScenario , FileLoggingSessionScenario
  • LoggingScenario_StatusChanged() : Scenario3
  • LoggingScenarioEventArgs() : LoggingScenarioEventArgs , sealed , LoggingScenarioEventArgs , sealed , LoggingScenarioEventArgs
  • LoggingSessionScenario() : LoggingSessionScenario , sealed , LoggingSessionScenario
  • LoggingSessionScenario_StatusChanged() : Scenario2
  • LogMessage() : sealed , NfcUtils , DeviceReadWrite
  • LogoffAndRemoveAccount() : SingleMicrosoftAccountScenario , SingleAccountScenario , sealed , MultipleAccountsScenario , SingleAzureADScenario , sealed
  • LogoffAndRemoveAllAccounts() : MultipleAccountsScenario , sealed
  • LogStatus() : Scenario2_Upload , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile , Scenario3_Notifications , Scenario3_EnableHdrProfile , sealed , Scenario1_Download , sealed
  • LogStatusAsync() : sealed , Scenario1_GetLamp , sealed , Scenario2_EnableSettings , sealed , Scenario3_AvailabilityChanged , sealed
  • LogStatusToOutputBox() : Scenario3_EnableHdrProfile , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile
  • LogStatusToOutputBoxAsync() : Scenario3_AvailabilityChanged , sealed , Scenario2_EnableSettings , Scenario1_GetLamp , sealed
  • LogToggleSwitch_Toggled() : sealed
  • LogWithWin10Constructor() : LoggingChannelScenario , sealed
  • LogWithWin81Constructor() : LoggingChannelScenario , sealed
  • LongRunningShareLabel_Tapped() : Scenario13_ShareTarget
  • LookAt() : Camera
  • LookDirection() : MoveLookController , Camera
  • LookupBackgroundTask() : MainPage
  • LookupBooleanProperty() : BluetoothLEDeviceDisplay
  • LookupSavedString() : MainPage
  • LookupTable() : LookupTable< T, LookupTableSize >
  • LoopbackClientButton_Click() : LowLatency
  • LoopToggle_Toggled() : Scenario1_FilePlayback
  • LoudnessSlider_ValueChanged() : Scenario5_InboxEffects
  • LowLatency() : LowLatency
  • LowLatencyInputMain() : LowLatencyInputMain
  • lstCards_SelectionChanged() : ManageCardScenario
  • LuminanceHeatmapEffect() : LuminanceHeatmapEffect
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- m -

  • m_hr() : sealed
  • m_imagePath() : sealed
  • M_mediaElement_CurrentStateChanged() : Player
  • M_mediaPlayer_VideoFrameAvailable() : VideoRenderer
  • M_mse_Closed() : Player
  • M_mse_Opened() : Player
  • m_Size() : sealed
  • Main() : Program , VisualPropertiesFactory
  • MainGrid_Entered() : Scenario4_InteractionFeedback
  • MainGrid_Exited() : Scenario4_InteractionFeedback
  • MainPage() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • MainPage_BackRequested() : MainPage
  • MainPage_CachedFile() : MainPage_CachedFile
  • MainPage_Loaded() : MainPage
  • MainPage_OneHanded() : MainPage_OneHanded
  • MainPage_PickFile() : MainPage_PickFile
  • MainPage_SaveFile() : MainPage_SaveFile
  • MainViewModel() : MainViewModel
  • Make() : SourceHandler
  • MakeColor() : sealed , Functions
  • MakeCurrent_Click() : sealed , Scenario7_DownloadReordering
  • MakeCylinderFaceIndices() : MeshGeometry
  • MakeCylinderFaceVertices() : MeshGeometry
  • MakeCylinderSideIndices() : MeshGeometry
  • MakeNumberBaseSegmentInfo() : DashManifestParser
  • MakeTexturedCube() : MeshGeometry
  • MakeTexturedCylinder() : MeshGeometry
  • MakeTimelineInfo() : DashManifestParser
  • Manage_Click() : sealed , Scenario2_ManageAccount
  • ManageCardScenario() : ManageCardScenario
  • Manager() : Manager
  • ManageSession() : ManageSession
  • ManageSessionResponse() : ManageSessionResponse
  • Manifest() : Manifest
  • ManipulateMe_ManipulationCompleted() : sealed , Scenario4
  • ManipulateMe_ManipulationDelta() : sealed , Scenario4
  • ManipulateMe_ManipulationInertiaStarting() : sealed , Scenario4
  • ManipulateMe_ManipulationStarted() : sealed , Scenario4
  • ManipulationInputProcessor() : sealed , ManipulationInputProcessor
  • ManipulationProcessor() : sealed
  • ManualControlButton_Click() : MainPage
  • ManualFocusRadioButton_Checked() : MainPage
  • mapBillboardAddButton_Click() : sealed , Scenario2
  • mapClearButton_Click() : sealed , Scenario2
  • MapDepthToColor() : FrameRenderer
  • mapElement3DAddButton_Click() : sealed , Scenario2
  • mapElementsLayer1Button_Click() : sealed , Scenario10
  • mapElementsLayer2Button_Click() : sealed , Scenario10
  • mapIconAddButton_Click() : sealed , Scenario2
  • MapIconStateToStyleEntryState() : Scenario11
  • MapInputRectsToOutputRect() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftTransform , RippleEffect , WaveEffect
  • MapInvalidRect() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftTransform , RippleEffect , WaveEffect
  • mapItemButton_Click() : sealed , Scenario3
  • MapOutputRectToInputRects() : DftTransform , RippleEffect , WaveEffect , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect
  • mapPolygonAddButton_Click() : sealed , Scenario2
  • mapPolylineAddButton_Click() : sealed , Scenario2
  • MarkHotProducts() : MarkHotProducts
  • MarkIn() : sealed , Scenario3_Trim
  • MarkOut() : sealed , Scenario3_Trim
  • MarshalInterface() : CMediaBufferWrapper
  • MarshalLog() : sealed , Scenario1_Download , Scenario2_Upload
  • MarshalNotifyUser() : sealed
  • MasterDetailPage() : MasterDetailPage
  • MasterListView_ItemClick() : MasterDetailPage
  • MatchPreviewAspectRatio() : sealed , Scenario3_AspectRatio
  • Material() : Material
  • Matrix4x4() : Matrix4x4< T >
  • MaxHttpVersionToggle_Toggled() : Scenario01_GetText
  • MeasureOverride() : StepsHelperControl , sealed , DynamicCommandBar
  • media_MediaEnded() : sealed , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries
  • MediaButtonPressed() : sealed , Scenario2 , Scenario3
  • MediaCapture_CameraStreamFailed() : Scenario1_TrackInWebcam
  • MediaCapture_CameraStreamStateChanged() : Scenario2_DetectInWebcam
  • mediaCapture_Failed() : CaptureDevice
  • MediaCapture_Failed() : Scenario5_DisplayingBarcodePreview , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MediaCapturePreviewer , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • MediaCapture_RecordLimitationExceeded() : MainPage , sealed , MainPage , sealed , MainPage
  • MediaCaptureManager() : MediaCaptureManager
  • MediaCapturePreviewer() : MediaCapturePreviewer
  • MediaFoundationInitializer() : MediaFoundationInitializer
  • MediaItem() : MediaItem
  • MediaItemViewModel() : MediaItemViewModel
  • MediaList() : MediaList
  • MediaListViewModel() : MediaListViewModel
  • MediaModel() : MediaModel
  • mediaPlayer_MediaEnded() : Scenario1
  • mediaPlayer_MediaFailed() : Scenario1
  • MediaPlayer_MediaOpened() : Scenario1_MultiVideoPlayback , AppView , PlaybackPage , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • mediaPlayer_MediaOpened() : Scenario1
  • MediaPlayer_PlaybackSession_PlaybackStateChanged() : Scenario7_LiveSeekableRange
  • mediaPlayer_PlaybackStateChanged() : Scenario1
  • mediaPlayerButton_Click() : Scenario7
  • MediaReader() : MediaReader
  • MediaSegment() : MediaSegment
  • mediaSink_IncomingConnectionEvent() : CaptureDevice
  • MediaStream() : MediaStream
  • MediaTimelineController_PositionChanged() : Scenario2_SynchronizingPlayers , Scenario1_MultiVideoPlayback , Scenario3_AdaptiveSync
  • MediaTimelineController_StateChanged() : Scenario3_AdaptiveSync , Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers
  • MediaTransportControls() : MediaTransportControls
  • MediaTransportControlsWithCustomCastButton() : MediaTransportControlsWithCustomCastButton
  • MemoryManager_AppMemoryUsageIncreased() : App
  • MemoryManager_AppMemoryUsageLimitChanging() : App
  • Mesh() : GameObject
  • MeshGeometry() : MeshGeometry
  • MeshObject() : MeshObject
  • MessageReceived() : Scenario1_UTF8 , sealed , Scenario1 , Scenario2 , Scenario5 , sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite
  • MessageTextBox_KeyUp() : sealed , Scenario2_Load
  • messageType_SelectionChanged() : Scenario3_SendMIDIMessages
  • metadata_emsg_mp4_CueEntered() : Scenario5_Metadata
  • metadata_extm3u_CueEntered() : Scenario5_Metadata
  • metadata_id3_CueEntered() : Scenario5_Metadata
  • metadata_MarkCueEntered() : Scenario_SynthesizeSSML , sealed
  • metadata_SpeechCueEntered() : sealed , Scenario_SynthesizeTextBoundaries
  • metadata_TrackingEvents_CueEntered() : Scenario6_AdInsertion , Scenario5_Metadata
  • metadata_TrackingEvents_CueExited() : Scenario5_Metadata
  • MeteredConnectionPriorityPropertyName() : HttpMeteredConnectionFilter
  • Metering() : Metering
  • MeteringData() : sealed , MeteringData
  • MeteringWorker() : Metering
  • METHODASYNCCALLBACK() : WASAPICapture , WASAPIRenderer , WASAPICapture
  • Methods_SelectionChanged() : sealed , Scenario1_Conversion , sealed , Scenario2_Prediction
  • MEUserControl() : MEUserControl
  • MFSampleGenerator() : MFSampleGenerator
  • MidiDeviceWatcher() : MidiDeviceWatcher
  • MidiInputDevice_MessageReceived() : Scenario2_ReceiveMIDIMessages
  • MinConfig() : ReactiveViewModel
  • MirrorOrientation() : sealed , CameraRotationHelper
  • MobileHotspotToggle_Toggled() : Scenario2_ToggleMobileHotspot
  • ModelMatrix() : GameObject
  • ModemDeviceServices() : ModemDeviceServices
  • ModemInformation() : ModemInformation
  • ModifyKeyRequestUri() : Scenario3_RequestModification
  • ModifySystemDefaults() : Scenario2_SystemDefaultMenu
  • MoreLess_Click() : Scenario4_ScriptNotify
  • MotionDetector() : sealed
  • MovableRect_Entered() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_Exited() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationCompleted() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationDelta() : Scenario5_InkingAndInteractionFeedback
  • MovableRect_ManipulationStarted() : Scenario5_InkingAndInteractionFeedback
  • MoveAlongX() : sealed
  • MoveAlongY() : sealed
  • MoveAlongZ() : sealed
  • MoveAppCertificateToUserCertificateStore() : Scenario1_MoveCertificate
  • MoveItem() : MediaListViewModel
  • MoveItemBetweenListViews() : Scenario1_MoveCertificate
  • MoveLeft() : CBufferPacket
  • MoveLookController() : MoveLookController
  • movementAxis_Changed() : sealed , Scenario5 , sealed , Scenario4
  • MoveNext() : CBufferEnumerator
  • MoveOnXAndYAxes() : ManipulationInputProcessor , sealed
  • MoveToBadgeStep() : ScenarioElement
  • MoveToSecondaryTileStep() : ScenarioElement
  • MoveUserCertificateToAppCertificateStore() : Scenario1_MoveCertificate
  • MPEUserControl() : MPEUserControl
  • MrcAudioEffectDefinition() : sealed
  • MrcVideoEffectDefinition() : sealed
  • MruToken() : SampleState
  • MultibyteToPlatformString() : AllJoynHelpers
  • MulticastRadioButton_Checked() : sealed , Scenario5
  • MulticastRadioButton_Unchecked() : Scenario5 , sealed
  • MultipleAccountsScenario() : MultipleAccountsScenario
  • MultipleTasks() : sealed , MultipleTasks
  • Music() : FileExtensions
  • MusicEngine() : Audio
  • MusicItem() : MusicItem
  • MyCustomServerCertificateValidator() : Scenario15_ServerCertificateValidation
  • myGridView_ContainerContentChanging() : sealed , PhasingTests
  • MyMap_Loaded() : Scenario1
  • myMap_Loaded() : sealed , Scenario5 , sealed
  • MyMap_Loaded() : Scenario2
  • myMap_Loaded() : Scenario8
  • MyMap_Loaded() : Scenario3 , Scenario9
  • myMap_Loaded() : sealed
  • MyMap_Loaded() : sealed
  • myMap_Loaded() : Scenario4
  • MyMap_Loaded() : sealed , Scenario11 , Scenario10
  • myMap_Loaded() : Scenario7
  • MyMap_Loaded() : sealed
  • MyMap_MapTapped() : sealed , Scenario1
  • myMap_ZoomLevelChanged() : Scenario7 , sealed
  • MyMapLoaded() : Scenario12 , sealed
  • MyUserControl1() : MyUserControl1 , sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- n -

  • Name() : BarcodeScannerInfo , SymbologyListEntry , DeviceInformationDisplay , User , RadioModel , School , Contact , BluetoothLEDeviceDisplay , School , User
  • Navigate() : INavigationService , NavigationService
  • Navigate< T >() : INavigationService , NavigationService
  • NavigateBackForWideState() : DetailsPage , DetailPage , DetailsPage
  • NavigateBackward_Click() : Scenario1_NavToUrl
  • NavigateForward_Click() : Scenario1_NavToUrl
  • NavigateToAutoPlay() : MainPage
  • NavigateToPageWithParameter() : MainPage
  • NavigateToReconnect() : MainPage
  • NavigateToScenario() : MainPage
  • NavigateToScenarioWithParameter() : MainPage
  • NavigateWebview() : Scenario1_NavToUrl
  • Navigation_BackRequested() : SubPage
  • NavigationHelper() : NavigationHelper
  • NavigationHelper_Load() : MainPage
  • navigationHelper_LoadState() : TripDetails , TripListView
  • NavigationHelper_Save() : MainPage
  • navigationHelper_SaveState() : TripDetails , TripListView
  • NavigationService() : NavigationService
  • NearClipPlane() : Camera
  • nearestMegabyte() : sealed , Scenario8
  • NetErrorToString() : AccountWatcher , BroadbandDevice
  • NetworkInformation_NetworkStatusChanged() : Scenario2ViewModel , Scenario4_Connect
  • NewTrip() : sealed , TripViewModel
  • NewWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Next() : List< T >
  • nextButton_Click() : Scenario1 , Scenario6
  • NextButton_Click() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • NextItem_Click() : sealed , S1_GetAFeed
  • NfcMessageHandlerAsync() : Scenario1
  • noButton_Click() : sealed , Scenario9_CustomPairDevice
  • Node() : List< T >::Node
  • node_QuantumStarted() : Scenario3_FrameInput
  • NormalizeRanges() : ItemCacheManager< T > , ItemIndexRangeList
  • NormalMaterial() : GameObject
  • NoSubFolder_checked() : Scenario1
  • Not() : BindingHelpers , sealed , Scenario1_Discovery
  • NotifyCancelingTask() : Scenario4_BulkPipes
  • NotifyClientDevices() : Scenario3_ServerForeground
  • NotifyDeviceNotConnected() : Utilities
  • NotifyIfAnyError() : sealed , ServiceViewModel
  • NotifyOfInsertedItems() : IncrementalLoadingBase
  • NotifyProjectionStopping() : ProjectionViewBroker
  • NotifyProperty() : ImportableItemWrapper
  • NotifyPropertyChanged() : Trip , ViewModelBase , sealed , ViewModelBase , sealed , RadioModel , Manager , DataModel , YangContainer , Manager , DataModel , HeroArticlesViewModel , YangContainer
  • NotifyPropertyChangedAsync() : ServiceViewModel
  • NotifyQualityEvent() : CMediaStream
  • NotifyReadCancelingTask() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyReadTaskCanceled() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyStatusMessage() : ServiceViewModel
  • NotifyTaskCanceled() : Scenario4_BulkPipes
  • NotifyUser() : MainPage , FileOpenPickerPage , MainPage , FileSavePickerPage , MainPage , CachedFileUpdaterPage , sealed , MainPage , WiFiDirectServiceManager , MainPage , ShareTarget , sealed , MainPage , sealed
  • NotifyUserBackgroundThread() : Scenario13_ShareTarget , ShareTarget
  • NotifyUserFileNotExist() : SampleState , MainPage
  • NotifyUserFromAsyncThread() : sealed , Scenario1 , sealed , Scenario5 , sealed , Scenario2 , Scenario1
  • NotifyUserFromBackground() : MainPage
  • NotifyWriteCancelingTask() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • NotifyWriteTaskCanceled() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • NumberOfAvailableDisplayRegions() : Scenario2_DisplayRegion
  • NV12VideoTexture() : NV12VideoTexture
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- o -

  • Objective() : Level
  • OcrCapturedImage() : sealed , OcrCapturedImage
  • OcrFileImage() : sealed , OcrFileImage
  • OffboardAsync() : IOnboardingService , sealed , OnboardingService
  • OfflineLicensesChanged() : sealed , Scenario1_TrialMode
  • okButton_Click() : Scenario9_CustomPairDevice , sealed , Scenario9_CustomPairDevice
  • OnAamvaCardDataReceived() : sealed , Scenario2_AamvaCards
  • OnAccessChanged() : sealed , Scenario1_DataEvents , Scenario2_Polling , sealed
  • OnAccountCommandsRequested() : SingleMicrosoftAccountScenario , sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario
  • OnActivated() : App , sealed , App , AppContactPanel , App , sealed , App , sealed , App , sealed , App
  • OnAdvancedColorInfoChanged() : sealed
  • OnAdvertisementReceived() : Scenario1_Watcher
  • OnAdvertisementStatusChanged() : sealed , AdvertisementWrapper
  • OnAdvertisementWatcherStopped() : Scenario1_Watcher
  • OnAppBarOpened() : sealed
  • OnApplyTemplate() : ChatListView , sealed , DynamicCommandBar , CustomMediaTransportControls , TitledImage , MediaTransportControlsWithCustomCastButton , ProjectedMediaTransportControls , StepsControl , sealed
  • OnAppResume() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect
  • OnAppResuming() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnApproximateAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • OnAppSuspending() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnAppSuspension() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , Scenario4_BulkPipes , EventHandlerForDevice , Scenario1_ConnectDisconnect
  • OnAudioSampleRequested() : WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • OnAutoAcceptSessionConnected() : sealed , AdvertisementWrapper
  • OnAutoDismissTimerExpired() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • OnAvailableNetworksChanged() : sealed
  • OnBackgroundActivated() : App
  • OnBackgroundAuthenticationCompleted() : Scenario3_ForegroundApp
  • OnBackgroundTaskCompleted() : ScenarioCommon , sealed , Scenario1_DeviceUse , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher
  • OnBackRequested() : sealed , BackButtonPage , MoveLookController , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailPage
  • OnBankCardDataReceived() : sealed , Scenario1_BankCards
  • OnboardingConfigureWiFiCalledEventArgs() : sealed
  • OnboardingConnectCalledEventArgs() : sealed
  • OnboardingConsumer() : sealed
  • OnboardingConsumer::Initialize() : sealed
  • OnboardingGetLastErrorRequestedEventArgs() : sealed
  • OnboardingGetScanInfoCalledEventArgs() : sealed
  • OnboardingGetStateRequestedEventArgs() : sealed
  • OnboardingGetVersionRequestedEventArgs() : sealed
  • OnboardingOffboardCalledEventArgs() : sealed
  • OnboardingProducer() : sealed
  • OnboardingService_ConnectRequestRecieved() : Scenario2ViewModel
  • OnBringIntoView() : sealed , Scenario7
  • OnButtonClicked() : sealed
  • OnButtonHologramTapped() : HolographicMRCSampleMain
  • OnButtonInitTapped() : HolographicMRCSampleMain
  • OnButtonPhotoTapped() : HolographicMRCSampleMain
  • OnButtonSysAudioTapped() : HolographicMRCSampleMain
  • OnButtonVideoTapped() : HolographicMRCSampleMain
  • OnBuyAppButtonTapped() : sealed
  • OnBuySelectorClicked() : sealed
  • OnCachedFileUpdaterActivated() : App
  • OnCameraAdded() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnCameraRemoved() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnCancelButtonClicked() : Scenario1
  • OnCanceled() : sealed , ActivitySensorBackgroundTask , sealed , BackgroundActivity , sealed , Scenario1_BackgroundTask , sealed , SampleBackgroundTask , ServicingComplete , RfcommServerTask , sealed , IoSyncBackgroundTask , EdpBackgroundTask , LocationBackgroundTask , AuthenticationTask , sealed , PedometerBackgroundTask , sealed , ProximitySensorBackgroundTask , SampleSmsBackgroundTask
  • OnCapabilityAccessChanged() : Scenario1_Check
  • OnCaptureFailed() : sealed
  • OnChangeBackgroundButtonClicked() : sealed
  • OnChannelLoggingEnabled() : sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario , LoggingSessionScenario
  • OnChatViewContainerContentChanging() : sealed , Scenario2_Load
  • OnClear() : sealed , Scenario3 , Scenario4
  • OnClipboardChanged() : SampleState , MainPage
  • OnClockPause() : CMediaSink
  • OnClockRestart() : CMediaSink
  • OnClockSetRate() : CMediaSink
  • OnClockStart() : CMediaSink
  • OnClockStop() : CMediaSink
  • OnClose() : CNetworkChannel , sealed
  • OnClosed() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • OnColorProfileChanged() : sealed , PhotoAdjustmentRenderer
  • OnCompleted() : sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , GroupedBackgroundTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , GroupedBackgroundTask , Scenario3_BgChatServer , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , sealed , Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor , RegisterWithBackgroundTask , sealed , Scenario4_BackgroundActivity
  • OnCompositionScaleChanged() : sealed
  • OnConnect() : sealed , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • OnConnected() : Scenario1_Send
  • OnConnection() : sealed , Scenario1
  • OnConnectionReceived() : Scenario2_ChatServer , sealed , StreamSocketListenerWrapper
  • OnConnectionRequested() : sealed , Scenario1_Advertiser
  • OnConnectionStatusChanged() : sealed , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector
  • OnConsolidated() : sealed
  • OnContainerContentChanging() : EdgeTappedListView
  • OnContinue() : CServiceBase
  • OnControlAcquired() : sealed
  • OnControlLost() : sealed
  • OnCopy() : sealed , Scenario2
  • OnCreateGeofence() : Scenario4_ForegroundGeofence
  • OnCurrentChanged() : SpatialStageManager
  • OnCurrentStateChanged() : Scenario3_MasterDetail
  • OnCustomSensorAdded() : sealed , Scenario1_DataEvents , Scenario2_Polling
  • OnCut() : sealed , Scenario2
  • OnDataRequested() : Scenario12_ShareData , SharePage
  • OnDeferredImageRequestedHandler() : CopyImage , sealed , ShareDelayRenderedFiles
  • OnDeleteButtonClicked() : Scenario1
  • OnDeviceAccessChanged() : sealed , EventHandlerForDevice
  • OnDeviceAdded() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , sealed , Scenario2_Connector
  • OnDeviceClosing() : sealed , DeviceConnect , InputReportEvents , Scenario1_ConnectDisconnect , Scenario3_InterruptPipes , Scenario1_ConnectDisconnect
  • OnDeviceConnected() : sealed , DeviceConnect , Scenario1_ConnectDisconnect , Scenario4_BulkPipes , Scenario1_ConnectDisconnect
  • OnDeviceConnectedEventArgs() : sealed , OnDeviceConnectedEventArgs
  • OnDeviceEnumerationComplete() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • OnDeviceListChanged() : sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • OnDeviceLost() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , CameraStreamCoordinateMapperMain , D2DAdvancedColorImagesRenderer , CustomComputeShaderMain , CustomPixelShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , LowLatencyInputMain , GameMain , HolographicPaintMain
  • OnDevicePickerDismissed() : Scenario1_DevicePicker
  • OnDeviceRemoved() : sealed , EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , sealed , Scenario2_Connector
  • OnDeviceRestored() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , CameraStreamCoordinateMapperMain , D2DAdvancedColorImagesRenderer , CustomComputeShaderMain , CustomPixelShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , LowLatencyInputMain , GameMain , HolographicPaintMain
  • OnDeviceSelected() : Scenario1_DevicePicker
  • OnDeviceStateChange() : sealed , Scenario2 , Scenario3 , Scenario4
  • OnDeviceUpdated() : sealed , Scenario2_Connector
  • OnDisconnect() : sealed , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • OnDispatchWorkItem() : CStreamSink
  • OnDisplayContentsInvalidated() : sealed , App , sealed
  • OnDownloadCompleted() : Scenario4_CompletionGroups
  • OnDownloadProgress() : sealed , Scenario5_RandomAccess , Scenario6_RecoverableErrors
  • OnDPadAction() : HolographicPaintMain
  • OnDpiChanged() : sealed , App , sealed
  • OnDrawingAttributesChanged() : sealed , Scenario12
  • OneAndHalfSpace_Click() : sealed
  • OnEdgeTapped() : Scenario4_EdgeTappedListView
  • OnEnterToolChoice() : HolographicPaintMain
  • OnEnumerationCompleted() : Scenario2_WatchUsers , sealed , Scenario2_Connector
  • OnFadeOutCompleted() : Scenario3_ShowHideMethods
  • OnFileActivated() : App , sealed , App
  • OnFileOpenPickerActivated() : App
  • OnFileSavePickerActivated() : App
  • OnFindAllItemsClicked() : Scenario1
  • OnFindNewItemsClicked() : Scenario1
  • OnFindSourcesClicked() : Scenario1
  • OnFinishCapture() : WASAPICapture
  • OnFocusEngaged() : TransportOptions
  • OnFrameArrived() : CameraStreamProcessor , VideoFrameProcessor
  • OnFx2Added() : DeviceList
  • OnFx2EnumerationComplete() : DeviceList
  • OnFx2Removed() : DeviceList
  • OnGameInfoOverlayTapped() : sealed
  • OnGamepadAdded() : BasicHologramMain , HolographicTemplateAppMain , MoveLookController
  • OnGamepadRemoved() : BasicHologramMain , HolographicTemplateAppMain , MoveLookController
  • OnGeneralInterruptEvent() : Scenario3_InterruptPipes
  • OnGeofenceStateChanged() : Scenario4_ForegroundGeofence
  • OnGeofenceStatusChanged() : Scenario4_ForegroundGeofence
  • OnGround() : GameObject
  • OnGUI() : Print3D
  • OnHiding() : Scenario2_ShowHideEvents
  • OnHighAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • OnHistoryChanged() : ScenarioElement
  • OnHistoryEnabledChanged() : HistoryAndRoaming
  • OnHolding() : sealed
  • OnHolographicDisplayIsAvailableChanged() : BasicHologramMain , HolographicTemplateAppMain
  • OnHumanPresenceSensorAdded() : Scenario3_Choosing
  • OnHumanPresenceSensorEnumerationCompleted() : Scenario3_Choosing
  • OnHumanPresenceSensorRemoved() : Scenario3_Choosing
  • OnHumanPresenceSensorUpdated() : Scenario3_Choosing
  • OnImportButtonClicked() : Scenario1
  • OnIncomingConnection() : sealed
  • OnIndexerOperationBegin() : Helpers
  • OnIndexerOperationComplete() : Helpers
  • OnInitializeCompleted() : sealed
  • OnInitializeCompletedDispatchedHandler() : sealed
  • OnInputReportEvent() : sealed , InputReportEvents
  • OnInsertShape() : sealed
  • OnInteractionDetected() : HandHandler , HolographicPaintMain , SourceHandler , SpatialControllerHandler
  • OnIsVisibleChanged() : sealed , CustomTitleBar
  • OnItemClick() : Scenario3_MasterDetail
  • OnItemInvoked() : sealed , Scenario1_EventAndMenuHookup
  • OnKeyDown() : sealed , PlaybackPage , sealed , Scenario1_Basic , MoveLookController
  • OnKeyPressed() : sealed , AppView , sealed , AppView , sealed
  • OnKeyUp() : sealed , MoveLookController
  • OnLaunched() : sealed , App , sealed , App , sealed , AppView , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App
  • OnLayerMapElementClicked() : sealed
  • OnLayoutMetricsChanged() : sealed , CustomTitleBar
  • OnLayoutUpdated() : sealed
  • OnLicenseChanged() : sealed , GameMain
  • OnLoadAsync() : sealed , Scenario3
  • OnLoaded() : sealed , TransportOptions , DetailsPage , Scenario3_MasterDetail , DetailsPage , Scenario3_MasterDetail
  • OnLoadedActions() : sealed , UserSelect
  • OnLoadStoreClicked() : sealed
  • OnLocatabilityChanged() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • OnLogFileGenerated() : sealed , FileLoggingSessionScenario
  • OnLoggingEnabled() : sealed , LoggingChannelScenario
  • OnLogSizeChanged() : sealed , Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • OnlyImages_Checked() : Scenario1
  • OnlyVideo_Checked() : Scenario1
  • OnMainViewActivated() : sealed
  • OnmainWindowActivated() : AppView
  • OnManipulationCanceled() : HandHandler
  • OnManipulationCompleted() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnManipulationInertiaStarting() : sealed , ManipulationInputProcessor , sealed
  • OnManipulationStarted() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnManipulationUpdated() : sealed , ManipulationInputProcessor , sealed , HandHandler
  • OnMediaCaptureFailed() : sealed
  • OnMediaFailed() : sealed
  • OnMediaOpened() : sealed
  • OnMessage() : sealed
  • OnMouseMoved() : MoveLookController
  • OnNavigated() : sealed
  • OnNavigatedFrom() : Scenario2_SystemDefaultMenu , sealed , Scenario1_Basic , Scenario7_PinFromAppbar , Scenario1_ConnectDisconnect , Scenario2_LEDTemp , sealed , SharePage , ShareCustomProvider , SharePage , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PauseAsync , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint , Scenario1 , sealed , Scenario2_Extend , Scenario2_ShowHideEvents , Scenario3_ShowHideMethods , Scenario2_ShowHideEvents , Scenario3_ShowHideMethods , Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard , Scenario2_WatchUsers , sealed , Scenario1_Basic , Scenario1_Basics , Scenario1 , Scenario2 , Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8_TransferMediaPlayer1 , Scenario9_TransferMediaPlayer2 , sealed , DefaultAccountScenario , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario , sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector , sealed , Scenario2 , Scenario3 , Scenario4 , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailsPage , ImagePage , Scenario4_EdgeTappedListView , DetailPage , ArticlePage , Scenario7_Share , sealed , PlaybackPage , sealed , Scenario1_SimplestAdaptiveStreaming , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange , sealed , Scenario9 , KeepConnectionOpenScenario , Scenario1_SecondaryWindow , Scenario2_DisplayRegion , Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario1_SecondaryWindow , Scenario2_DisplayRegion , Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects , sealed , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview , sealed , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , NavigationHelper , MainPage , SubPage , Scenario1_Discovery , Scenario2_Client , Scenario3_ServerForeground , Scenario1_Discovery , Scenario2_Client , Scenario3_ServerForeground , Scenario1_ChatClient , Scenario2_ChatServer , sealed , Scenario1_DisplayDepthColorIR , Scenario2_FindAvailableSourceGroups , Scenario1_ExampleOperations , sealed , Scenario1_Check , sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers , HistoryAndRoaming , sealed , NavigationHelper , TripDetails , TripListView , sealed , DeviceEvents , CustomTrigger , sealed , DeviceConnect , InputReportEvents , sealed , Scenario1_ConnectDisconnect , Scenario3_ReadWrite , Scenario4_Events , Scenario1_ConnectDisconnect , Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario7_SyncDevice , sealed , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , sealed , Scenario2_Disable , Scenario3_AppCapture , Scenario2_Disable , Scenario3_AppCapture , sealed , Scenario1_Orientation , sealed , FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePicker_SaveToCachedFile , sealed , Scenario1_Basic , Scenario1_TrackPosition , Scenario2_GetPosition , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario7_ForegroundVisits , Scenario1_TrackPosition , Scenario2_GetPosition , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario7_ForegroundVisits , sealed , Scenario3_ForegroundApp , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , sealed , Scenario1_GetAndSetPin , Scenario2_Listen , Scenario1_GetAndSetPin , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , sealed , Scenario1_SelectDisplay , Scenario2_DisplayText , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee , LiveDashPlayer , Scenario2 , Scenario3 , sealed , Scenario1_BankCards , Scenario2_AamvaCards , sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays , sealed , Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages , Scenario3_SendMIDIMessages , Scenario3 , Scenario3_NetworkConnectivityChanges , BackButtonPage , ScenarioPage , sealed , Scenario1_Events , sealed , Scenario1_FindClaimEnable , Scenario1_DataEvents , Scenario3_Choosing , Scenario1_DataEvents , Scenario3_Choosing , sealed , Scenario1Basic , Scenario2StandardOptions , Scenario3CustomOptions , Scenario4PageRange , Scenario5Photos , Scenario6DisablePreview , sealed , Scenario2 , sealed , Scenario1_EventAndMenuHookup
  • OnNavigatedTo() : Scenario5_LaunchedFromSecondaryTile , sealed , Scenario1_Basic , PlaybackPage , Scenario5_Capabilities , sealed , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario1_Toggle , Scenario2_ShakeEvents , Scenario3_Polling , Scenario4_OrientationChanged , OvenClient , Scenario5_DataEventsBatching , sealed , Scenario3_ChangeEvents , Scenario4_BackgroundActivity , Scenario01 , Scenario02 , sealed , Scenario03 , Scenario04 , Scenario05 , sealed , Scenario06 , MainPage , ProjectionViewPage , Scenario5Photos , UnhandledExceptionPage , sealed , Scenario1_DataEvents , Scenario1_Metrics , Scenario1_Files , Scenario2_Settings , Scenario3_SettingContainer , sealed , Scenario4_CompositeSettings , Scenario5_Msappdata , Scenario7_SetVersion , sealed , Scenario1_Files , Scenario2_Settings , Scenario3_SettingContainer , Scenario2_Memory , Scenario4_CompositeSettings , Scenario5_Msappdata , Scenario7_SetVersion , sealed , Scenario2 , sealed , Scenario1 , Scenario10 , Scenario11 , Scenario12 , Scenario13 , Scenario2 , Scenario3 , sealed , Scenario4 , Scenario5 , Scenario6 , Scenario1 , Scenario7 , Scenario9 , OpenCloseConnectionScenario , CardReader , Scenario2_DisplayRegion , Scenario3_ReceiveFile , Scenario4_ReceiveUri , Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario2_ToggleMobileHotspot , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects , ShowConnection , sealed , AccountWatcher , MainPage , Scenario1 , SecondaryPage , sealed , SampleBackgroundTask , Scenario1_Default , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , Scenario1 , ApplicationTriggerTask , GroupedBackgroundTask , Scenario1_DeviceUse , sealed , Scenario2_Polling , sealed , SampleBackgroundTask , sealed , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , Scenario1 , ApplicationTriggerTask , GroupedBackgroundTask , sealed , Scenario6_ManipulatingCursorAttributes , sealed , Scenario1_Download , Scenario2_Upload , Scenario2_DisplayText , Scenario3_Notifications , Scenario5_RandomAccess , Scenario6_RecoverableErrors , sealed , Scenario7_DownloadReordering , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario2_MultipleScanners , Scenario2 , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , sealed , Scenario1_GetLamp , Scenario1_DataEvents , Scenario2_DetectInWebcam , Scenario1_DetectInPhoto , Scenario2_Effects , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario1 , Scenario2 , Scenario3 , NavigationHelper , sealed , MainPage , SubPage , Scenario1_Watcher , Scenario5_IsSupported , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario2_Client , Scenario3_ServerForeground , Scenario2_Client , Scenario3_ServerForeground , Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , sealed , MainPage , sealed , MainPage , Scenario12_DisableCookies , sealed , Scenario1_DisplayDepthColorIR , Scenario06_PostMultipart , Scenario2_FindAvailableSourceGroups , sealed , MainPage , Scenario1_ExampleOperations , sealed , Scenario13_RetryFilter , sealed , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile , Scenario07_PostStreamWithProgress , Scenario3_EnableHdrProfile , sealed , MainPage , Scenario03_GetList , sealed , MainPage , Scenario1_Check , sealed , Scenario1_DataEvents , sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario8_VisitsBackgroundTask , Scenario3_MultipleDrawers , HistoryAndRoaming , OtherScenarios , Scenario8_VisitsBackgroundTask , HistoryAndRoaming , OtherScenarios , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario5 , Scenario3_Calibration , sealed , Scenario1 , sealed , Scenario2_ReceiveContact , Scenario3 , sealed , Scenario1_Mini , Scenario2_DelayMini , S1_AddWithAPI , S2_UpdateAndDeleteWithAPI , S3_RetrieveWithAPI , sealed , S4_CheckIndexRevision , S5_AddWithAppContent , S6_DeleteWithAppContent , FileSavePicker_SaveToAppStorage , S7_RetrieveWithAppContent , sealed , FileOpenPicker_PickCachedFile , NavigationHelper , TripDetails , TripListView , sealed , DeviceConnect , DeviceEvents , Scenario4 , sealed , Scenario9 , sealed , DeviceConnect , FeatureReports , Scenario5 , InputReportEvents , InputOutputReports , sealed , Scenario1_DataEvents , Scenario1_ConnectDisconnect , Scenario2_ConfigureDevice , sealed , Scenario3_ReadWrite , Scenario4_Events , Scenario1_ConnectDisconnect , sealed , Scenario2_ControlTransfer , Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario9_ClipboardTarget , Scenario5_UsbDescriptors , Scenario6_InterfaceSettings , Scenario7_SyncDevice , sealed , Scenario1 , sealed , Scenario1 , Scenario2 , Scenario13_ShareTarget , Scenario3 , Scenario4 , Scenario5 , Scenario2 , sealed , WriteReadStream , ReadBytes , sealed , Scenario2_Disable , sealed , Scenario9_CustomPairDevice , sealed , Scenario5_GetSingleDevice , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario3_BackgroundDeviceWatcher , Scenario4_Snapshot , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , sealed , Scenario2_Disable , Scenario3_AppCapture , sealed , Scenario1_Orientation , sealed , Scenario1 , Scenario10_CpToClipboard , Scenario11_CPDNoUI , Scenario12_ShareData , Scenario14_QueryCpPaste , Scenario15_DPLCreateFileEvents , Scenario16_NetworkResource , Scenario2 , Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8_ClipboardSource , sealed , SavingDataReason , sealed , Scenario10 , Scenario2 , Scenario3 , Scenario4 , Scenario6 , Scenario7 , Scenario8 , Scenario10 , Scenario2 , Scenario3 , Scenario5 , Scenario6 , Scenario7 , Scenario8 , Scenario9 , CachedFileUpdaterPage , FileOpenPicker_PickAppFile , FileOpenPicker_PickURLFile , FileOpenPickerPage , FileSavePicker_FailToSave , FileSavePicker_SaveToCachedFile , FileSavePickerPage , MainPage , sealed , Scenario1 , Scenario2 , Scenario4 , Scenario5 , Scenario6 , Scenario2 , Scenario3 , Scenario4 , Scenario6 , sealed , Scenario1_Basic , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario5_GeofenceBackgroundTask , Scenario3_BackgroundTask , Scenario4_ForegroundGeofence , Scenario5_GeofenceBackgroundTask , sealed , Scenario2_Polling , Scenario3_Porting , Scenario1_Initialization , Scenario2_BackgroundTask , Scenario3_ForegroundApp , Scenario01_GetText , Scenario02_GetStream , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario3_Calibration , Scenario1 , sealed , Scenario1_Launched , Scenario4_ChangeSystemGroup , Scenario1_Launched , Scenario4_ChangeSystemGroup , Scenario5_IsSupported , sealed , Content , SignIn , UserSelect , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , sealed , Scenario2_EnableSettings , Scenario3_AvailabilityChanged , Scenario1 , Scenario3 , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_SelectDisplay , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario7_ScrollingContentUsingMarquee , MainPage , LiveDashPlayer , sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3 , sealed , Scenario1_BankCards , Scenario2_AamvaCards , Scenario1_DataEvents , Scenario1 , sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays , MainPage , sealed , Scenario2_Custom , Scenario3_Trim , sealed , EnableHelloPage , MainPage , Scenario1_MIDIDeviceEnumeration , Scenario2_ReceiveMIDIMessages , Scenario3_SendMIDIMessages , BroadbandDevice , GetConnectionProfiles , ModemInformation , Scenario1_ConfigureMobileHotspot , Scenario2_ToggleMobileHotspot , Scenario1_ConfigureMobileHotspot , Scenario1 , Scenario3 , SecondaryViewPage , Scenario3 , SecondaryViewPage , Scenario3_NetworkConnectivityChanges , MainPage , ManageCardScenario , ReceiptView , BackButtonPage , MainPage , ScenarioPage , sealed , OcrCapturedImage , OcrFileImage , OcrCapturedImage , OcrFileImage , Scenario1_ManageHotspot , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1 , Scenario6_NavToStream , Scenario3 , sealed , Scenario1_Events , Scenario4_BackgroundPedometer , Scenario1_Files , Scenario2_Memory , Scenario1_Files , sealed , SetLockScreenImage , sealed , Scenario1_FindClaimEnable , sealed , Scenario1Basic , Scenario2StandardOptions , Scenario3CustomOptions , Scenario4PageRange , Scenario6DisablePreview , sealed , MainPage , ProjectionViewPage , Scenario2 , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , OvenClient , CustomException , Scenario1_EventAndMenuHookup , Scenario1_Toggle , sealed , Scenario1_DataEvents , Scenario8_CaptureBitmap , Scenario1_Discovery , Scenario2_LaunchUri , Scenario3_LaunchAppServices , XSLTTransform , sealed , Scenario1_Basic , Scenario9_ContainsFullScreenElement , Scenario7_PinFromAppbar , Scenario1 , BuildNewRss , Scenario3 , Scenario2_LEDTemp , Scenario3 , Scenario1 , ShareCustomProvider , SharePage , ShareTarget , sealed , LowLatency , VideoChat , ArticlePage , Scenario2_NavToString , Scenario2 , Scenario11 , MainPage , Scenario3 , Scenario6 , ImagePage , Scenario8 , Scenario9 , sealed , MasterDetailPage , Scenario1_DataEvents , SendTextMessage , Scenario3_MasterDetail , Scenario1_Connect , sealed , Scenario4_EdgeTappedListView , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario4_EdgeTappedListView , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , ImagePage , Scenario_SRGSConstraint , MainPage , Scenario1 , CustomFocusVisuals , sealed , CustomException , sealed , MainPage , Scenario2 , Scenario4 , OvenClient , sealed , S1_GetAFeed , Scenario1 , CustomException , Scenario2_Prediction , sealed , Scenario6 , sealed , Scenario2_Extend , Scenario2_ShowHideEvents , Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard , Scenario1_MoveCertificate , sealed , Scenario1_AddAccount , sealed , Scenario3_FixAccount , Scenario3_CheckUserConsentGroup , sealed , Scenario2_WatchUsers , Scenario3_CheckUserConsentGroup , Scenario1_Basic , Scenario3_RegisterForUpdates , RequestResponse , Scenario2_Conditional , sealed , Scenario3 , Scenario4 , Scenario5 , sealed , Scenario8_TransferMediaPlayer1 , DefaultAccountScenario , sealed , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario , Scenario4 , sealed , Scenario2 , Scenario1 , Scenario3 , sealed , Scenario5 , Scenario9_TransferMediaPlayer2 , sealed , Scenario1_CachedNetworks , Scenario2_Scan , sealed , Scenario4_Connect , sealed , Scenario2 , MultipleAccountsScenario , OvenClient , Scenario1_Conversion , Scenario1_Basics , sealed , MainPage , Scenario1_ListView , MainPage , DetailsPage , Scenario3_MasterDetail , Scenario2 , DetailsPage , Scenario1_FindUsers , DetailPage , MasterDetailPage , DetailPage , Scenario1_Basic , MainPage , Scenario10_UnviewableContent , Scenario3_InvokeScript , Scenario1_FindUsers , Scenario7_Share , MarkHotProducts , XmlLoading , GiftDispatch , Scenario2_ManageAccount , Scenario1_MoveCertificate , Scenario3_ReverseConversion , Scenario2_Extend , sealed , Scenario3 , Scenario5 , Scenario1_TrialMode , Scenario1 , sealed , Scenario_PauseAsync , Scenario2 , Scenario_PredefinedWebSearchGrammar , sealed , Scenario2 , RegisterWithBackgroundTask , Scenario1_Send , Scenario4 , sealed , Scenario7 , Scenario2 , sealed , Scenario1 , Scenario1_ConnectDisconnect , sealed
  • OnNavigatingFrom() : Scenario1_DataEvents , Scenario3_Polling , Scenario1 , sealed , MainPage , Scenario3_ChangeEvents , Scenario1_DataEvents , Scenario1 , Scenario4_BackgroundPublisher , MainPage , Scenario1_PreviewSettings , Scenario1_DataEvents , Scenario2_Polling , MainPage , sealed , LocationTrackingReason , sealed , Scenario3_DisplayOnOff , Scenario3_Calibration , Scenario2_Polling , Scenario3_AvailabilityChanged , CardReader , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario11 , Scenario6 , Scenario5_RestoreScrollPosition , Scenario9 , Scenario2 , sealed , Scenario2 , Scenario3 , Scenario4 , sealed , OcrCapturedImage , Scenario3_Calibration , Scenario1_DataEvents , MainPage , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_Input , MainPage , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario2 , Scenario1_DataEvents , Scenario5_DataEventsBatching , Scenario0_Choose , Scenario1_DataEvents , Scenario4 , Scenario5 , Scenario1 , Scenario1_DataEvents , Scenario0_Choose , Scenario2_ShakeEvents , sealed , Scenario4_OrientationChanged , Scenario2 , Scenario5_Msappdata , Scenario1_DeviceUse , Scenario1_Watcher , sealed , Scenario2_PhotoSettings , Scenario3_AspectRatio , sealed , MainPage , Scenario3_Calibration , Scenario1_DataEvents , Scenario5 , sealed , UnspecifiedReason , SavingDataReason , MultipleTasks , Scenario2_Polling , sealed , Scenario1 , sealed , Scenario1_DataEvents , OcrCapturedImage , Scenario2_Polling , Scenario1_DataEvents , LowLatency , VideoChat , Scenario2 , Scenario8 , Scenario1_TrialMode , sealed , Scenario3 , Scenario5_RestoreScrollPosition , Scenario1_DataEvents
  • OnNavigationCompleted() : HandHandler
  • OnNavigationFailed() : App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App
  • OnNavigationStarted() : HandHandler
  • OnNetworkStatusChanged() : Scenario3_NetworkConnectivityChanges , sealed
  • OnOrientationChanged() : sealed , App , sealed , Scenario1_Orientation , sealed , Scenario1_Orientation
  • OnOsrFx2SwitchStateChangeEvent() : Scenario3_InterruptPipes
  • OnPairingRequested() : ConnectionSettingsPanel
  • OnPaste() : Scenario2 , sealed
  • OnPause() : CServiceBase
  • OnPausePlayback() : WASAPIRenderer
  • OnPenColorChanged() : Scenario3 , sealed
  • OnPenThicknessChanged() : sealed , Scenario3
  • OnPenTypeChanged() : Scenario3 , sealed
  • OnPickFileAsync() : sealed , Scenario3 , Scenario2
  • OnPlaybackStateChanged() : sealed
  • OnPlayButtonClicked() : sealed
  • OnPlotDataReady() : Scenario4 , sealed
  • OnPointerCanceled() : sealed , ManipulationInputProcessor
  • OnPointerCaptureLost() : EdgeTappedListView
  • OnPointerExited() : EdgeTappedListView , MoveLookController , sealed
  • OnPointerMoved() : sealed , VisualProperties , sealed , ManipulationInputProcessor , sealed , MoveLookController , sealed , PlaybackPage , sealed
  • OnPointerPressed() : PlaybackPage , BasicHologramMain , HolographicTemplateAppMain , sealed , VisualProperties , sealed , ManipulationInputProcessor , sealed , MoveLookController , EdgeTappedListView , sealed , AppView , sealed , BasicHologramMain
  • OnPointerReleased() : sealed , PlaybackPage , sealed , MoveLookController , sealed , EdgeTappedListView , ManipulationInputProcessor , sealed , VisualProperties , sealed
  • OnPointerWheelChanged() : sealed , PlaybackPage
  • OnPositionalTrackingDeactivating() : HolographicSpatialMappingMain
  • OnPositionChanged() : Scenario1_TrackPosition
  • OnPreviewPagesCreated() : sealed , PrintHelper
  • OnPrintButtonClick() : sealed , Scenario2StandardOptions , Scenario6DisablePreview , sealed , Scenario1Basic , Scenario4PageRange , Scenario5Photos , Scenario3CustomOptions , sealed
  • OnProgress() : sealed , SampleBackgroundTaskWithCondition , TimeTriggeredTask , GroupedBackgroundTask , sealed , SampleBackgroundTaskWithCondition , GroupedBackgroundTask , SampleBackgroundTask , Scenario3_BgChatServer , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , SampleBackgroundTask , sealed , ServicingCompleteTask , sealed , Scenario15_DPLCreateFileEvents , sealed
  • OnProjectionDisplayAvailableChanged() : sealed
  • OnPropertyChanged() : sealed , BindableBase , sealed , DeviceInformationDisplay , WiFiNetworkDisplay , WordOverlay , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , sealed , WordOverlay , DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • OnPropertyGet() : sealed
  • OnPropertySet() : sealed
  • OnProximitySensorAdded() : sealed , Scenario3_DisplayOnOff , Scenario2_Polling , Scenario4_BackgroundProximitySensor , sealed , Scenario1_DataEvents
  • OnPublisherStatusChanged() : Scenario2_Publisher
  • OnRangesDownloaded() : Scenario5_RandomAccess , sealed
  • OnReadingChanged() : Scenario1_DataEvents , sealed
  • OnRecognizeAsync() : sealed , Scenario4
  • OnRecognizerChanged() : sealed , Scenario4
  • OnRegisteredGeofenceListBoxSelectionChanged() : Scenario4_ForegroundGeofence
  • OnReleaseDeviceRequested() : Scenario1_BankCards , sealed , Scenario2_AamvaCards , sealed
  • OnRemotePortAdded() : SessionWrapper , sealed
  • OnRemoveGeofenceItem() : Scenario4_ForegroundGeofence
  • OnRendering() : sealed
  • OnReplay() : sealed , Scenario9
  • OnRequestReceived() : RandomNumberGeneratorTask
  • OnReset() : Scenario9 , sealed
  • OnResetButtonClicked() : sealed
  • OnResetLicenseButtonClicked() : sealed
  • OnResizeCompleted() : sealed
  • OnResultGenerated() : HolographicVoiceInputMain
  • OnResultReceived() : ScenarioElement
  • OnResuming() : sealed , App , Simple3DGame , sealed , Simple3DGame , sealed , AppView , sealed , CameraStreamCoordinateMapperMain , sealed , AppView , sealed
  • OnRightTapped() : sealed
  • OnRoamingEnabledChanged() : HistoryAndRoaming
  • OnRotationChanged() : sealed
  • OnSampleReady() : WASAPICapture , WASAPIRenderer , WASAPICapture
  • OnSaveAsync() : sealed , Scenario3
  • OnScenarioSelectionChanged() : FileOpenPickerPage
  • OnScreenContactContinued() : sealed
  • OnScreenContactEnded() : sealed
  • OnScreenContactStarted() : sealed
  • OnSelectAllButtonClicked() : Scenario1
  • OnSelectionChanged() : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • OnSelectNewButtonClicked() : Scenario1
  • OnSelectNoneButtonClicked() : Scenario1
  • OnSelectTool() : HolographicPaintMain
  • OnSend() : Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed , Scenario4_PartialReadWrite
  • OnSendScopeData() : WASAPICapture
  • OnServerCustomValidationRequested() : Scenario2_Binary , sealed , Scenario1_UTF8 , sealed , Scenario2_Binary
  • OnSessionDeferred() : sealed , DiscoveredDeviceWrapper
  • OnSessionJoined() : sealed
  • OnSessionLost() : sealed
  • OnSessionMemberAdded() : sealed
  • OnSessionMemberRemoved() : sealed
  • OnSessionRequested() : AdvertisementWrapper , sealed
  • OnSessionStatusChanged() : SessionWrapper , sealed
  • OnSetPositionToHere() : Scenario4_ForegroundGeofence
  • OnSetVolume() : sealed , Scenario3 , sealed , Scenario2
  • OnShareCompleted() : SharePage
  • OnShareProvidersRequested() : ShareCustomProvider , sealed
  • OnShareTargetActivated() : App
  • OnShareToContosoChat() : sealed , ShareCustomProvider
  • OnShowing() : Scenario2_ShowHideEvents
  • OnShutdown() : CServiceBase , sealed::sealed , ISinkCallback , sealed
  • OnSignInInfoChanged() : MainPage
  • OnSizeChanged() : sealed , Scenario1_InkCanvasTactileFeedback , Scenario3 , Scenario9 , Scenario6 , Scenario1 , Scenario4 , sealed , Scenario5 , Scenario12 , sealed , Scenario2 , Scenario10 , sealed , Scenario1_InkCanvasTactileFeedback , Scenario11
  • OnSocketConnectionReceived() : Scenario1_Advertiser , sealed , Scenario1_Advertiser
  • OnSourceDetected() : HolographicPaintMain
  • OnSourceLost() : HolographicPaintMain
  • OnSourcePressed() : SourceHandler , SpatialInputHandler , SpatialControllerHandler , SpatialInputHandler , HolographicPaintMain , SpatialInputHandler
  • OnSourceUpdated() : SourceHandler , HandHandler , HolographicPaintMain , SpatialControllerHandler
  • OnSpeechQualityDegraded() : HolographicVoiceInputMain
  • OnStart() : CSampleService , Scenario2_Binary , sealed , Scenario2_Binary , sealed , CServiceBase
  • OnStartCapture() : WASAPICapture
  • OnStartPlayback() : WASAPIRenderer
  • OnStatusChanged() : Scenario3 , Scenario1_TrackPosition , sealed , Scenario2 , sealed , Scenario1_Advertiser , Scenario1_TrackPosition
  • OnStepChanged() : StepsHelperControl
  • OnStepPropertyChanged() : StepsControl
  • OnStereoEnabledChanged() : sealed , App , sealed
  • OnStop() : CServiceBase , Scenario2_Binary , CSampleService , sealed , Scenario2_Binary
  • OnStopCapture() : WASAPICapture
  • OnStopped() : sealed , Scenario2_Connector
  • OnStopPlayback() : WASAPIRenderer
  • OnStoreReturnClicked() : sealed
  • OnStrokeAdded() : HolographicPaintMain
  • OnStrokeCanceled() : sealed
  • OnStrokeContinued() : sealed
  • OnStrokeEnded() : sealed
  • OnStrokesCollected() : sealed
  • OnStrokeStarted() : sealed
  • OnSurfacesChanged() : HolographicSpatialMappingMain
  • OnSuspending() : Scenario1_TrackInWebcam , sealed , App , sealed , App , sealed , App , Simple3DGame , sealed , App , Simple3DGame , sealed , App , sealed , App , sealed , Simple3DGame , Scenario1_TrackInWebcam , sealed , App , sealed , App , SavingDataReason , sealed , App , sealed , Scenario2_DetectInWebcam , sealed , App , AppView , Scenario2_DetectInWebcam , App , sealed , AppView , sealed
  • OnSuspendingAsync() : CameraStreamCoordinateMapperMain
  • OnSwapChainPanelSizeChanged() : sealed
  • OnSyncWithDeviceCompleted() : Scenario7_SyncDevice
  • OnSyncWithDeviceProgress() : Scenario7_SyncDevice
  • OnTapped() : HandHandler , SpatialControllerHandler
  • OnTargetApplicationChosen() : SharePage
  • OnTargetFileRequested() : FileSavePicker_SaveToAppStorage , FileSavePicker_FailToSave , FileSavePicker_SaveToCachedFile
  • OnTargetFormatChanged() : sealed , Scenario3_Trim , Scenario2_Custom , Scenario1_Default , sealed
  • OnTaskCanceled() : RandomNumberGeneratorTask , AdventureWorksVoiceCommandService , RandomNumberGeneratorTask
  • OnTaskCompleted() : sealed , MultipleTasks , Scenario3_BackgroundDeviceWatcher
  • OnTaskRequested() : Scenario1_Print
  • OnTick() : Scenario3_StartDragAsync , sealed
  • OnTimer() : UnspecifiedReason , sealed , LocationTrackingReason
  • OnTimerTick() : sealed
  • OnUDPMessageReceived() : sealed , SocketWrapper
  • OnUnloaded() : DetailsPage
  • OnUnreliableAccuracy() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • OnUpdate() : CustomDecaySound , OmnidirectionalSound , CardioidSound , OmnidirectionalSound
  • OnUserAdded() : Scenario2_WatchUsers
  • OnUserRemoved() : Scenario2_WatchUsers
  • OnUserUpdated() : Scenario2_WatchUsers
  • OnVideoFrameAvailable() : VideoRenderer
  • OnViewActivated() : sealed , AppView , sealed , AppView
  • OnViewChanged() : sealed
  • OnViewModelChanged() : SectionView
  • OnViewModelPropertyChanged() : SectionView
  • OnViewSizeChanged() : SceneComposer
  • OnVisibilityChanged() : sealed , Scenario4_ForegroundGeofence , Scenario1_DataEvents , sealed , AppView , sealed , AppView , sealed , Scenario4_ForegroundGeofence , sealed , App , sealed
  • OnVisitStateChanged() : Scenario7_ForegroundVisits
  • OnVoiceCommandCompleted() : sealed , AdventureWorksVoiceCommandService
  • OnWatcherStopped() : Scenario2_WatchUsers
  • OnWindowActivated() : MainPage , AppContactPanel , SampleState
  • OnWindowActivationChanged() : sealed , App , sealed
  • OnWindowClosed() : AppView , sealed , Scenario3_Size , sealed , App , sealed , Scenario4_CompactOverlay , Scenario2_DisplayRegion , Scenario5_RelativePositioning , sealed , AppView , sealed , Scenario1_SecondaryWindow
  • OnWindowResize() : Scenario1_Basic , sealed
  • OnWindowSizeChanged() : CalibrationBar , sealed , Scenario1_Basic , sealed , CalibrationBar , sealed , DetailsPage , CustomTitleBar , sealed , App , DetailsPage , sealed , Scenario2_Extend , sealed
  • Op1Characteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • Op2Characteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • Open_Click() : Scenario2 , Scenario1
  • OpenAppSettings() : Scenario1_Configure
  • OpenAsync() : CMediaSource
  • OpenCashDrawer() : Scenario1_OpenDrawer
  • OpenCloseConnectionScenario() : OpenCloseConnectionScenario
  • OpenConnection_Click() : KeepConnectionOpenScenario
  • OpenCVHelper() : sealed
  • OpenDevice() : IoSyncBackgroundTask
  • OpenDeviceAsync() : EventHandlerForDevice
  • OpenDrawerButton_Click() : Scenario1_OpenDrawer , sealed
  • OpenFile_Click() : Scenario1_DetectInPhoto
  • OpenFromListButton_Click() : sealed , Scenario7
  • OpenFx2DeviceAsync() : DeviceConnect , sealed
  • OpenLockscreenSettings() : Scenario1_Configure
  • OpenMenuItem_Click() : sealed , Scenario2 , sealed , Scenario1 , Scenario3
  • openPrivacySettings_Click() : Scenario_ContinuousDictation , sealed , Scenario_PredefinedWebSearchGrammar , sealed , Scenario_PredefinedDictationGrammar
  • OpenScenario() : MainPage
  • OpenSessionAsync() : DiscoveredDeviceWrapper
  • OperationComboBox_SelectionChanged() : Scenario1_ExampleOperations
  • operator MAPPING_SERVICE_INFO *() : unique_services
  • operator!=() : List< T >::POSITION , GpuCoordinateMapper::CameraIntrinsics
  • operator&() : unique_services
  • operator()() : MemDelete , GuidComparer , SetConnectedFunc , ShutdownFunc , ComAutoRelease , StartFunc , NoOp< T > , GeoEquals , StopFunc , handle_closer
  • operator->() : unique_cotaskmem_ptr< T >
  • operator=() : scope_exit< Lambda > , ensure_close , GameHud , ReadStreamTask , unique_disabled_control , ensure_close , unique_shared_work_queue , Camera , unique_cotaskmem_ptr< T >
  • operator==() : List< T >::POSITION
  • operator[]() : Matrix4x4< T > , Vector3< T > , Matrix4x4< T > , Vector2< T > , Vector4< T > , Vector2< T > , Vector4< T > , Vector2< T > , Vector3< T > , Vector4< T > , Matrix4x4< T >
  • OperatorCharacteristic_WriteRequestedAsync() : Scenario3_ServerForeground
  • OpQueue() : OpQueue< T, TOperation >
  • optCardTypeGroup_CheckedUnchecked() : SetCardDataScenario
  • OptIn() : HttpMeteredConnectionFilter
  • OptInOutComboBox_SelectionChanged() : Scenario3_NetworkConnectivityChanges
  • OptInSwitch_Toggled() : Scenario14_MeteredConnectionFilter
  • OptionalTrialUpgrade() : sealed
  • OrderSlider_ValudChanged() : sealed
  • OrganizerRadioButton_Checked() : Scenario1_Define
  • OrientationChanged() : sealed , Scenario1_DataEvents
  • OrientationFromAngles() : CardioidSound
  • OrientationSensor_OrientationChanged() : sealed , MainPage
  • OrientationsToString() : Scenario1_Orientation , sealed
  • OtherBindings() : OtherBindings , sealed
  • OtherLinkInvoked() : sealed , MultipleAccountsScenario , sealed , SingleMicrosoftAccountScenario , SingleAccountScenario , SingleAzureADScenario
  • OtherScenarios() : OtherScenarios
  • OtherShareOperationMethodsSection_Checked() : ShareTarget
  • OtherShareOperationMethodsSection_Unchecked() : ShareTarget
  • OtherShareOperations_Tapped() : ShareTarget
  • outputDevices_SelectionChanged() : Scenario1_MIDIDeviceEnumeration , Scenario3_SendMIDIMessages
  • outputDevicesListBox_SelectionChanged() : Scenario2_DeviceCapture
  • OutputFileAsync() : CachedFileUpdater_Local , CachedFileUpdater_Remote
  • OutputPathText() : Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • OutputPauseButton_Click() : Scenario2_Custom , sealed , Scenario3_Trim , Scenario1_Default , sealed
  • OutputPlayButton_Click() : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default , sealed
  • OutputSettings() : Scenario2 , sealed
  • OutputStopButton_Click() : Scenario3_Trim , Scenario2_Custom , Scenario1_Default , sealed
  • OutputText() : Scenario2_Custom , Scenario1_Default , Scenario3_Trim
  • OutputToken() : Scenario2_Twitter , Scenario3_Flickr
  • OutputTokenResult() : sealed , SingleAzureADScenario , DefaultAccountScenario , sealed , MultipleAccountsScenario , sealed , SingleAccountScenario , SingleMicrosoftAccountScenario
  • OutputToTextBox() : Scenario15_DPLCreateFileEvents
  • Oven() : sealed , Oven
  • OvenClient() : OvenClient , sealed , OvenClient , sealed , OvenClient , sealed
  • OvenClientWRL() : sealed
  • OverrideOnLaunched() : App
  • OverwriteButton_Click() : CachedFileUpdater_Remote
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- z -

  • ZoomSlider_ValueChanged() : MainPage
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- ~ -

  • ~_360VideoPlaybackMain() : _360VideoPlaybackMain
  • ~ActivitySensorBackgroundTask() : sealed
  • ~AdvertisementWrapper() : AdvertisementWrapper , sealed
  • ~AudioFileReader() : AudioFileReader
  • ~AudioStreamReader() : AudioStreamReader
  • ~BaseElement() : BaseElement
  • ~BasicHologramMain() : BasicHologramMain
  • ~BufferConverter() : Helpers::sealed
  • ~BusySetter()
: FileLoggingSessionScenario::BusySetter
, LoggingSessionScenario::BusySetter
  • ~CAcceptOperation() : sealed
  • ~CameraStreamCoordinateMapperMain() : CameraStreamCoordinateMapperMain
  • ~CameraStreamProcessor() : CameraStreamProcessor
  • ~CardioidSound() : CardioidSound
  • ~CAsyncOperation() : CStreamSink::CAsyncOperation
  • ~CAsyncState() : CAsyncState
  • ~CBaseAttributes() : CBaseAttributes< TBase >
  • ~CBufferEnumerator() : CBufferEnumerator
  • ~CBufferPacket() : CBufferPacket
  • ~CMarker() : CMarker
  • ~CMediaBufferWrapper() : CMediaBufferWrapper
  • ~CMediaSink() : CMediaSink
  • ~CMediaSource() : CMediaSource
  • ~CMediaStream() : CMediaStream
  • ~CNetworkChannel() : CNetworkChannel
  • ~CNetworkClient() : sealed
  • ~CNetworkServer() : sealed
  • ~ComPtrList() : ComPtrList< T, NULLABLE >
  • ~ControlBase() : ControlBase
  • ~Conversation() : sealed
  • ~CritSec() : CritSec
  • ~CSampleService() : CSampleService
  • ~CSchemeHandler() : CSchemeHandler
  • ~CServiceBase() : CServiceBase
  • ~CSetRateOperation() : CSetRateOperation
  • ~CSourceLock() : CMediaStream::CSourceLock
  • ~CSourceOperation() : CSourceOperation
  • ~CStartOperation() : CStartOperation
  • ~CStreamSink() : CStreamSink
  • ~CustomComputeShaderMain() : CustomComputeShaderMain
  • ~CustomDecaySound() : CustomDecaySound
  • ~CustomPixelShaderMain() : CustomPixelShaderMain
  • ~CustomVertexShaderMain() : CustomVertexShaderMain
  • ~D2DAdvancedColorImagesRenderer() : D2DAdvancedColorImagesRenderer
  • ~D2DGradientMeshMain() : D2DGradientMeshMain
  • ~D2DSvgImageRenderer() : D2DSvgImageRenderer
  • ~DirectXPage() : sealed
  • ~DiscoveredDeviceWrapper() : sealed , DiscoveredDeviceWrapper
  • ~DocumentPresenter() : sealed
  • ~DWriteColorTextRendererMain() : DWriteColorTextRendererMain
  • ~ensure_close() : ensure_close
  • ~EventHandlerForDevice() : sealed
  • ~FaceTrackerProcessor() : FaceTrackerProcessor
  • ~FileLoggingSessionScenario() : sealed , FileLoggingSessionScenario
  • ~FocusableElement() : FocusableElement
  • ~FontDownloadListener() : sealed
  • ~GameMain() : GameMain
  • ~HandHandler() : HandHandler
  • ~HolographicFaceTrackerMain() : HolographicFaceTrackerMain
  • ~HolographicMRCSampleMain() : HolographicMRCSampleMain
  • ~HolographicPaintMain() : HolographicPaintMain
  • ~HolographicSpatialMappingMain() : HolographicSpatialMappingMain
  • ~HolographicSpatialStageMain() : HolographicSpatialStageMain
  • ~HolographicTagAlongSampleMain() : HolographicTagAlongSampleMain
  • ~HolographicVoiceInputMain() : HolographicVoiceInputMain
  • ~List() : List< T >
  • ~ListenerContext() : sealed
  • ~LoggingSessionScenario() : sealed , LoggingSessionScenario
  • ~LowLatencyInputMain() : LowLatencyInputMain
  • ~MainPage() : sealed
  • ~MediaCaptureManager() : MediaCaptureManager
  • ~MediaFoundationInitializer() : MediaFoundationInitializer
  • ~Metering() : Metering
  • ~MFSampleGenerator() : MFSampleGenerator
  • ~MidiDeviceWatcher() : MidiDeviceWatcher
  • ~OmnidirectionalSound() : OmnidirectionalSound
  • ~OnboardingConsumer() : sealed
  • ~OnboardingProducer() : sealed
  • ~OpQueue() : OpQueue< T, TOperation >
  • ~PedometerBackgroundTask() : sealed
  • ~PhotoAdjustmentRenderer() : PhotoAdjustmentRenderer
  • ~PipeIn() : PipeIn
  • ~PipeOut() : PipeOut
  • ~PlaybackControl() : PlaybackControl
  • ~Provider() : sealed , Provider
  • ~ProximitySensorBackgroundTask() : sealed
  • ~RelayCommand() : sealed
  • ~RenderBuffer() : RenderBuffer
  • ~Resource() : Resource
  • ~RpcClient() : sealed
  • ~Scenario1_BackgroundTask() : sealed
  • ~Scenario1_DeviceUse() : sealed
  • ~Scenario1_Download() : sealed
  • ~Scenario1_LowLatencyInput() : sealed
  • ~Scenario1_OmnidirectionalSound() : sealed
  • ~Scenario1_PreviewSettings() : sealed
  • ~Scenario2() : sealed
  • ~Scenario2_CardioidSound() : sealed
  • ~Scenario2_PhotoSettings() : sealed
  • ~Scenario2_Upload() : sealed
  • ~Scenario3() : sealed
  • ~Scenario3_AspectRatio() : sealed
  • ~Scenario3_CustomDecay() : sealed
  • ~Scenario3_Notifications() : sealed
  • ~Scenario4() : sealed
  • ~SceneComposer() : SceneComposer
  • ~scope_exit() : scope_exit< Lambda >
  • ~SecureInterfaceConsumer() : sealed
  • ~SecureInterfaceProducer() : sealed
  • ~ServiceStatusConverter() : Helpers::sealed
  • ~ServicingComplete() : sealed
  • ~SessionWrapper() : sealed , SessionWrapper
  • ~SocketContext() : sealed
  • ~SocketWrapper() : SocketWrapper , sealed
  • ~SourceGroupCollection() : sealed
  • ~SpatialControllerHandler() : SpatialControllerHandler
  • ~SpatialInputHandler() : SpatialInputHandler
  • ~SpatialStageManager() : SpatialStageManager
  • ~StreamSocketListenerWrapper() : StreamSocketListenerWrapper , sealed
  • ~StspMediaSinkProxy() : sealed
  • ~SurfaceMesh() : final
  • ~TextLayoutImageSource() : sealed
  • ~ToneSampleGenerator() : ToneSampleGenerator
  • ~unique_bag() : unique_bag
  • ~unique_cotaskmem_ptr() : unique_cotaskmem_ptr< T >
  • ~unique_disabled_control() : unique_disabled_control
  • ~unique_services() : unique_services
  • ~unique_shared_work_queue() : unique_shared_work_queue
  • ~WASAPICapture() : WASAPICapture
  • ~WASAPIRenderer() : WASAPIRenderer
  • ~WiFiDirectServiceManager() : WiFiDirectServiceManager
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- a -

  • AbandonStreaming() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • AbortButton_Click() : Scenario3_ForegroundApp
  • AbortDownload() : SourceBufferManager
  • Accept_Click() : sealed , Scenario2
  • AcceptAsync() : sealed , INetworkServer
  • AcceptSessionJoinerHandler() : AllJoynHelpers
  • AcceptSessionRequest() : AdvertisementWrapper
  • AccessChanged() : Scenario1_Events , sealed , Scenario3_ChangeEvents
  • AccessHandler() : AccessHandler
  • Accessibility_HighContrastChanged() : sealed , Scenario11
  • AccountOverviewPage() : AccountOverviewPage
  • AccountsList_Loading() : AdaptivePage
  • AccountWatcher() : AccountWatcher
  • AcquireLicenseAsync() : CommonLicenseRequest
  • ActionTransition() : sealed
  • Activate() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • ActivateCompleted() : WASAPICapture , WASAPIRenderer , WASAPICapture , WASAPIRenderer
  • ActivateInstance() : WrlFinal
  • Active() : GameObject , GameTimer , MoveLookController
  • ActivitySensorBackgroundTask() : sealed
  • AdaptiveContentModel() : AdaptiveContentModel
  • AdaptivePage() : AdaptivePage
  • AdaptivePage_VisibleBoundsChanged() : AdaptivePage
  • AdaptiveStates_CurrentStateChanged() : MasterDetailPage
  • Add() : FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , sealed::sealed , IncrementalLoadingBase , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource
  • add_BreadBaked() : WrlFinal
  • Add_Click() : Scenario2_Add , Scenario1_ParseAndStringify
  • AddAccount_Click() : sealed , Scenario1_AddAccount
  • AddAdvertiser() : sealed , Scenario2 , WiFiDirectServiceManager
  • AddAnimatedTilesClick() : sealed , Scenario12
  • AddAppContentFilesToIndexedFolder() : Helpers
  • AddAudio_Click() : sealed , Scenario3_AddAudioTracks , sealed
  • AddAudioAndVideoSourceBuffers() : Player
  • AddAuthorizationHeaderFilter() : AddAuthorizationHeaderFilter
  • AddBuffer() : CBufferPacket
  • AddChild() : ControlBase , IControl
  • AddChildElement() : BaseElement
  • AddClipboardFormatsOutputString() : SampleState
  • AddComboBoxItem() : Scenario1_ConfigureMobileHotspot
  • AddCommandLineCommands() : FxCompile
  • AddContentValue() : Scenario13_ShareTarget , ShareTarget
  • AddCustomEffect() : Scenario6_CustomEffects
  • AddCustomIconItems() : sealed , Scenario1_EventAndMenuHookup
  • AddCustomItem() : Scenario2_SystemDefaultMenu
  • AddCustomProvider() : sealed
  • AddCustomTitleBar() : SampleState , MainPage
  • AddDatagramSocketAsync() : sealed , SessionWrapper
  • AddDeviceAsync() : sealed , SourceGroupCollection
  • AddDeviceToList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • AddDeviceWatcher() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • AddEllipseToCanvas() : Scenario1
  • AddEventDescription() : Scenario4_ForegroundGeofence
  • AddExitButton() : MediaTransportControls
  • AddFileButton_Click() : FileOpenPicker_PickCachedFile
  • AddFolderButton_Click() : sealed , Scenario1
  • AddFontGlyphItems() : sealed , Scenario1_EventAndMenuHookup
  • AddGeofenceToRegisteredGeofenceListBox() : Scenario4_ForegroundGeofence
  • AddGroup() : Scenario4_CharacterGrouping
  • AddHolographicCamera() : DeviceResources
  • AddImageFeedScenario() : sealed
  • AddItem() : MainPage , sealed , Scenario1_EventAndMenuHookup , Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • AddItemForLanguageTag() : sealed , Scenario8
  • AddItemsToIndex() : Helpers
  • AddItemToEnd() : sealed , Scenario1_Basic
  • AddKnownIconItems() : sealed , Scenario1_EventAndMenuHookup
  • AddLayer1() : sealed , Scenario10 , Scenario11
  • AddLayer2() : sealed , Scenario10 , Scenario11
  • AddLinks() : sealed
  • AddLinksAndDescription() : sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddLocalFileButton_Click() : FileOpenPicker_PickAppFile
  • AddLogFileMessage() : Scenario3
  • AddLogFileMessageDispatch() : sealed , Scenario2 , Scenario3
  • AddMessage() : sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • AddMessageDispatch() : sealed , Scenario2 , Scenario3
  • AddMethodHandler() : sealed
  • AddOnePrintPage() : DisablePreviewPrintHelper
  • AddOnePrintPreviewPage() : PrintHelper , sealed , PrintHelper , CustomOptionsPrintHelper
  • AddOptimizationGoal() : sealed
  • AddOrExtendBlock() : ItemCacheManager< T >
  • AddOrientations() : sealed , CameraRotationHelper
  • AddOrUpdateSurfaceAsync() : RealtimeSurfaceMeshRenderer
  • AddPassportToAccountOnServer() : SignIn
  • AddPassportToAccountOnServerAsync() : sealed
  • AddPeriod() : Manifest
  • AddPlayPauseButton() : MediaTransportControls
  • AddPolygonToCanvas() : Scenario1
  • AddPort_Click() : sealed , Scenario5
  • AddPosition() : Stroke
  • AddPrefix_Click() : sealed , Scenario1
  • AddPrintPages() : PrintHelper , sealed , PrintHelper , PageRangePrintHelper , PhotosPrintHelper , DisablePreviewPrintHelper
  • AddProps() : RequiredDeviceProperties
  • AddQuickLink_Checked() : Scenario13_ShareTarget , ShareTarget
  • AddQuickLink_Unchecked() : Scenario13_ShareTarget , ShareTarget
  • AddReadingType() : sealed
  • AddRef() : SceneComposer , Listener , FontNameCollector
  • AddResponseFileCommands() : FxCompile
  • Address_KeyUp() : Scenario1_NavToUrl
  • AddSamplesToQueue() : MFSampleGenerator
  • AddSceneObject() : SceneController
  • AddSeekbar() : MediaTransportControls
  • AddSession() : sealed , Scenario2 , Scenario4 , WiFiDirectServiceManager
  • AddSessionRequest() : sealed , Scenario2 , WiFiDirectServiceManager
  • AddSignalHandler() : sealed
  • AddSocket() : sealed , Scenario5 , WiFiDirectServiceManager
  • AddStream() : Period , CMediaSource
  • AddStreamSink() : CMediaSink
  • AddStreamSocketInternal() : sealed , SessionWrapper
  • AddStreamSocketListenerAsync() : sealed , SessionWrapper
  • AddString() : JsonRequest
  • AddSurface() : RealtimeSurfaceMeshRenderer
  • AddToIndex_Click() : sealed , S1_AddWithAPI , S2_UpdateAndDeleteWithAPI , S3_RetrieveWithAPI , S5_AddWithAppContent , S6_DeleteWithAppContent , S7_RetrieveWithAppContent
  • AddToJumpList_Click() : sealed , Scenario3_CustomItems
  • AddToListButton_Click() : sealed , Scenario7
  • addToResultGrid() : sealed , Scenario8
  • AddTrip() : sealed , TripListViewModel
  • AddUriFileButton_Click() : FileOpenPicker_PickURLFile
  • AddValueChangedHandler() : Scenario2_Client
  • AddWebAccount() : sealed , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddWebAccountProvider() : sealed , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • AddWebAccountProviders() : sealed
  • AddWebAccountProvidersToPane() : MultipleAccountsScenario , SingleAccountScenario
  • AddWebAccounts() : sealed
  • AddWebAccountsToPane() : MultipleAccountsScenario
  • AddWebAccountToPane() : SingleAccountScenario
  • addXamlChildrenButton_Click() : sealed , Scenario3
  • AdjustDurationIfLive() : TrackingEventCue
  • AdjustSelectionEndpoint() : CustomEditControl
  • AdjustUpdateRect() : DeviceResources
  • AdvancedCapture_AllPhotosCaptured() : sealed , MainPage
  • AdvancedCapture_OptionalReferencePhotoCaptured() : sealed , MainPage
  • AdvertisementWrapper() : sealed , AdvertisementWrapper
  • AdvertiserStatusChanged() : sealed , WiFiDirectServiceManager
  • Albums() : Albums
  • AllHistory_Checked() : sealed , Scenario2_History
  • AlljoynBusAttachment_AuthenticationComplete() : Scenario2ViewModel , Scenario1ViewModel
  • AlljoynBusAttachment_CredentialsRequested() : Scenario1ViewModel , Scenario2ViewModel
  • AlljoynBusAttachment_StateChanged() : Scenario2ViewModel , Scenario1ViewModel
  • AllJoynMessageArgStructure() : sealed
  • Alloc() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • AllocateTexture() : BaseControl
  • AllocCore() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • AllowAccess_Click() : AppContactPanel
  • AllowAppCaptureCheckBox_Toggled() : Scenario3_AppCapture
  • AnalyzeButton_Click() : sealed , Scenario1_Analyze
  • AngularVelocitySlider_ValueChanged() : sealed
  • Animate() : Animate
  • AnimateCirclePosition() : AnimateCirclePosition
  • AnimatedSwitch_Click() : Scenario3
  • AnimateLineListPosition() : AnimateLineListPosition
  • AnimateLinePosition() : AnimateLinePosition
  • AnimatePosition() : GameObject
  • Animations_SelectionChanged() : sealed , Scenario1_Metrics
  • AnnotateContactAsync() : Scenario1_CreateContact
  • ApduCommand() : ApduCommand
  • ApduReceived() : sealed
  • ApduResponse() : ApduResponse
  • App() : App , sealed , App , sealed , App , sealed , App , sealed , App , sealed , App
  • App_Activated() : ScenarioElement
  • App_BackRequested() : sealed , App
  • App_EnteredBackground() : App
  • App_LeavingBackground() : App
  • App_Resuming() : App , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario1_Watcher
  • App_Suspending() : Scenario1_Watcher , Scenario2_Publisher , Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario1_ChatClient , App
  • App_UnhandledException() : App
  • AppCapture_CapturingChanged() : Scenario3_AppCapture
  • AppContactPanel() : AppContactPanel
  • AppContactPanel_LaunchFullAppRequested() : AppContactPanel
  • AppData_IsUpperCaseEnabledPropertyDataChanged() : Scenario1ViewModel
  • AppDownloadedKeyRequest() : Scenario3_RequestModification
  • Append() : GroupInfoList
  • AppendLine() : Helpers
  • AppendLog() : Scenario1_NavToUrl
  • AppendOutputLine() : Scenario3_ClientAuthentication , Scenario1_UTF8 , Scenario4_PartialReadWrite , sealed , Scenario2_Binary , sealed , Scenario1_UTF8 , Scenario3_ClientAuthentication
  • AppendParameterSets() : CStreamSink
  • AppendToBaseUrl() : Manifest
  • AppendVideos_Click() : sealed , Scenario2_AppendClips
  • AppException() : AppException
  • Application_Resuming() : sealed , MainPage , OcrCapturedImage , MainPage , sealed , MainPage , sealed , MainPage
  • Application_Start() : WebApiApplication
  • Application_Suspending() : MainPage , OcrCapturedImage , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , OcrCapturedImage
  • Application_UnhandledException() : App
  • ApplicationTriggerTask() : sealed , ApplicationTriggerTask , sealed
  • Apply_Click() : Scenario1
  • Apply_Clicked() : Scenario1_Basics
  • ApplyChanges_Click() : Scenario1_ConfigureMobileHotspot
  • ApplyFonts_Click() : Scenario2_DocumentFonts , Scenario1_UIFonts
  • ApplyGreenFilter() : MainPage , sealed
  • ApplyLanguageFont() : MainPage
  • ApplyPixelShader() : BaseControl
  • ApplyRotationLock_Click() : Scenario1_Orientation , sealed
  • ApplyScale() : MainPage
  • ApplySettingsToLampArray() : Scenario1_Basics
  • ApplyShaders() : BaseControl , MediaTransportControls
  • AppMuted() : PlaybackControl
  • AppUnmuted() : PlaybackControl
  • AppView() : sealed , AppView , sealed , AppView , sealed
  • AppView_Consolidated() : AppView
  • AppViewSource() : sealed , AppViewSource
  • ArchitectureString() : sealed
  • architectureString() : Scenario1
  • AreCamerasStreaming() : CameraCoordinateMapper
  • AreCertificateAndCertChainValidAsync() : MainPage
  • AreControlsInTitleBar() : SampleState
  • ArePointsNear() : Scenario7 , sealed
  • ArrangeElements() : Button , BaseElement
  • ArrangeOverride() : sealed , StepsHelperControl , ChatListView
  • ArrangeTools() : ToolCarousel
  • ArticlePage() : ArticlePage
  • ArticlePage_BackRequested() : ArticlePage
  • ArticleTapped() : SectionView
  • ArticleViewModel() : ArticleViewModel
  • AspectRatio() : sealed
  • AssignGroup_Click() : Scenario4_CharacterGrouping
  • AsyncCallback() : AsyncCallback< T >
  • AsyncInitializeAudioDevice() : WASAPIRenderer , WASAPICapture
  • AsyncStartCapture() : WASAPICapture
  • AsyncStopCapture() : WASAPICapture
  • AsyncStoreData() : WASAPICapture
  • AtrInfo() : AtrInfo
  • AttachDownloads() : sealed
  • AttachmentImage_RightTapped() : Scenario1 , sealed
  • AttachProgressAndCompletedHandlers() : SampleBackgroundTask , sealed , ApplicationTriggerTask , GroupedBackgroundTask , SampleBackgroundTask , sealed , ServicingCompleteTask , Scenario3_BgChatServer , sealed , ServicingCompleteTask , sealed , TimeTriggeredTask , ApplicationTriggerTask , SampleBackgroundTaskWithCondition , sealed , SampleBackgroundTaskWithCondition , Scenario15_DPLCreateFileEvents , sealed , TimeTriggeredTask , sealed
  • AttachRef() : Scenario1_Basic
  • AttachViewProjectionBuffer() : CameraResources
  • AttemptConnectionAsync() : Scenario2ViewModel
  • AttemptOnboardingAsync() : Scenario2ViewModel
  • Audio() : Audio
  • AudioEchoEffect() : AudioEchoEffect
  • AudioTracks_SelectedIndexChanged() : Scenario5
  • Authenticate() : Scenario1ViewModel , Scenario2ViewModel
  • AuthenticateButton_Click() : Scenario3_ForegroundApp
  • AuthenticateInBackgroundAsync() : AuthenticationTask
  • AuthenticatePassportAsync() : SignIn , sealed
  • AuthenticatePasswordCredentialsAsync() : sealed , SignIn
  • AuthenticateWithRequestToken() : sealed , MultipleAccountsScenario , sealed , SingleAccountScenario , DefaultAccountScenario , sealed
  • AuthenticateWithRequestTokenSilent() : sealed
  • AutoFire() : MoveLookController
  • AutoPlay_Checked() : ContentSelector
  • AutoSuggestBox_QuerySubmitted() : Scenario2
  • AutoSuggestBox_TextChanged() : Scenario2
  • AzureMethodSelected_Click() : Scenario3_RequestModification
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- b -

  • Back() : List< T >
  • BackButton_Click() : Scenario2 , ArticlePage
  • BackButtonPage_BackRequested() : BackButtonPage
  • BackgroundAuthenticationCompletedEventArgs() : BackgroundAuthenticationCompletedEventArgs
  • BackgroundDeviceWatcher() : sealed , BackgroundDeviceWatcher
  • BackgroundDeviceWatcherSelectors() : DeviceSelectorChoices
  • BackgroundTask_Canceled() : sealed , Provider
  • BackgroundTask_Completed() : ScenarioElement
  • BackgroundTask_Progress() : ScenarioElement
  • BadgeNumericNotificationContent() : BadgeNumericNotificationContent
  • BakeBread() : IOven , Oven , IOven , WrlFinal , IOven , WrlFinal , IOven , sealed
  • BarcodeScannerInfo() : BarcodeScannerInfo
  • BarcodeScannerProviderConnection_DisableScannerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_EnableScannerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_GetBarcodeSymbologyAttributesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_HideVideoPreviewRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_SetActiveSymbologiesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_SetBarcodeSymbologyAttributesRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_StartSoftwareTriggerRequested() : sealed , Provider
  • BarcodeScannerProviderConnection_StopSoftwareTriggerRequested() : sealed , Provider
  • BaseControl() : BaseControl
  • BaseElement() : BaseElement
  • BasicDeferral() : BasicDeferral
  • BasicHologramMain() : BasicHologramMain
  • BasicLoader() : BasicLoader
  • BasicReaderWriter() : BasicReaderWriter
  • BasicShapes() : BasicShapes
  • BasicTests() : sealed , BasicTests
  • BaudRateSetButton_Click() : Scenario2_ConfigureDevice
  • BeginCreateObject() : CSchemeHandler
  • BeginDownload() : sealed
  • BeginDraw() : DeviceResources , sealed
  • BeginExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • BeginGetEvent() : CMediaSource , CMediaStream , CStreamSink
  • BeginVoiceUIPrompt() : HolographicVoiceInputMain
  • BgTask() : sealed
  • BgTask_Completed() : NfcUtils
  • BgTask_Progress() : NfcUtils
  • BindableNode() : sealed
  • BindMediaPlayerToUIElement() : Scenario7
  • BindToAny_Checked() : sealed , Scenario1 , sealed , Scenario1
  • BindToAny_Unchecked() : sealed , Scenario1 , sealed , Scenario1
  • Biography() : Contact
  • Bitmap() : GameInfoOverlay
  • BitrateHelper() : BitrateHelper
  • BitrateItem() : BitrateItem
  • blah() : ScenarioElement
  • BlockUIThread_Toggled() : sealed
  • BluetoothLEDeviceDisplay() : BluetoothLEDeviceDisplay
  • Blur() : sealed
  • BonusTime() : Simple3DGame
  • BoolToVisibilityConverter() : sealed
  • BottomAppBar_Opened() : Scenario7_PinFromAppbar
  • Bread() : Bread , IBreadBakedEventArgs
  • BreadBaked() : IOven
  • BreadCompletedHandler1() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreadCompletedHandler2() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreadCompletedHandler3() : sealed , OvenClient , sealed , OvenClient , sealed , OvenClient , sealed , OvenClient
  • BreakStateSignalToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • BrightnessBtn_Click() : sealed , Scenario2_EnableSettings
  • BroadbandDevice() : BroadbandDevice
  • Browse_Click() : Scenario1
  • Brushify() : sealed , ColorEntry
  • btnAddCard_Click() : SetCardDataScenario
  • btnAddConfigMethods_Click() : ConnectionSettingsPanel
  • btnAddIe_Click() : sealed , Scenario1_Advertiser
  • btnCancel_Click() : SetCardDataScenario
  • btnClearText_Click() : sealed , Scenario_ContinuousDictation
  • btnClose_Click() : sealed , Scenario2_Connector
  • btnCloseDevice_Click() : Scenario1_Advertiser
  • btnDebugLog_Click() : ManageCardScenario , ReceiptView
  • btnDeviceService_Click() : ModemDeviceServices
  • btnDisableCard_Click() : ManageCardScenario
  • btnEnableCard_Click() : ManageCardScenario
  • btnFilePicker_Click() : sealed , Scenario2 , Scenario3
  • btnForegroundOverrideCard_Click() : ManageCardScenario
  • btnFromId_Click() : sealed , Scenario2_Connector
  • btnGetRecord_Click() : SimCard
  • btnGetUICC_Click() : SimCard
  • btnIe_Click() : sealed , Scenario2_Connector
  • btnMainMenu_Click() : ReceiptView
  • btnPause_Click() : sealed , Scenario2 , Scenario3
  • btnPlay_Click() : sealed , Scenario2 , Scenario3
  • btnPlayPause_Click() : sealed , Scenario2 , Scenario3
  • btnRefresh_Click() : ModemInformation
  • btnRegisterBgTask_Click() : ManageCardScenario
  • btnRegisterSamplePaymentCard_Click() : ManageCardScenario
  • btnSendMessage_Click() : sealed , Scenario1_Advertiser , Scenario2_Connector , Scenario1_Advertiser , Scenario2_Connector
  • btnStartAdvertisement_Click() : sealed , Scenario1_Advertiser
  • btnStartCapture_Click() : sealed , Scenario4
  • btnStop_Click() : Scenario2 , sealed , Scenario3
  • btnStopAdvertisement_Click() : Scenario1_Advertiser , sealed , Scenario1_Advertiser
  • btnStopCapture_Click() : sealed , Scenario4
  • btnUnpair_Click() : Scenario2_Connector
  • btnUnregisterCard_Click() : ManageCardScenario
  • btnWatcher_Click() : Scenario2_Connector , sealed , Scenario2_Connector
  • Buffer() : CMediaBufferWrapper
  • BufferAllAsync() : HttpJsonContent
  • BufferBitmapForRendering() : FrameRenderer
  • BufferConverter() : Helpers::sealed
  • BufferHelper() : BufferHelper
  • BuildClipboardFormatsOutputString() : SampleState , MainPage
  • BuildClustersForZoomLevel() : sealed , Scenario7
  • BuildFilters() : Scenario1_Discovery
  • BuildNewRss() : BuildNewRss
  • BuildReadRecordResponseMC() : SetCardDataScenario
  • BuildReadRecordResponseV() : SetCardDataScenario
  • BuildWebSocketError() : MainPage
  • BulkRead_Click() : Scenario4_BulkPipes
  • BulkReadAsync() : Scenario4_BulkPipes
  • BulkReadWrite_Click() : Scenario4_BulkPipes
  • BulkReadWriteAsync() : Scenario4_BulkPipes
  • BulkWrite_Click() : Scenario4_BulkPipes
  • BulkWriteAsync() : Scenario4_BulkPipes
  • BusAttachment_AuthenticationComplete() : Scenario1ViewModel , Scenario2ViewModel
  • BusAttachment_CredentialsRequested() : Scenario1ViewModel , Scenario2ViewModel
  • BusAttachment_StateChanged() : Scenario1ViewModel , Scenario2ViewModel
  • BusAttachmentStateChanged() : sealed
  • BusObjectExists() : AllJoynBusObjectManager
  • BusObjectIsRegistered() : AllJoynBusObjectManager
  • BusySetter()
: FileLoggingSessionScenario::BusySetter
, LoggingSessionScenario::BusySetter
  • Button() : Button
  • Button_AddNewAccount_Click() : sealed
  • Button_AddProvider_Click() : sealed
  • Button_AddUser_Click() : UserSelect , sealed
  • Button_Click() : MainPage , Scenario1_SecondaryWindow , MainPage , Scenario2_DisplayRegion , MainPage , Scenario3_FrameInput , sealed , MainPage , Scenario1 , sealed , MainPage , Scenario2_DisplayRegion , sealed , MainPage , sealed , MainPage , sealed , Scenario1_CachedNetworks , sealed , MainPage , Scenario2_Scan , sealed
  • Button_Click_1() : sealed
  • Button_Click_2() : sealed
  • Button_Click_3() : sealed
  • Button_Click_Register() : Scenario3_RegisterForUpdates , sealed
  • button_Click_StartMetering() : sealed , MeteringData
  • button_Click_StopMetering() : MeteringData , sealed
  • Button_Click_Unregister() : Scenario3_RegisterForUpdates , sealed
  • Button_DefaultSignIn_Click() : DefaultAccountScenario , sealed
  • Button_Forget_Click() : Content , sealed
  • Button_GetTokenSilently_Click() : sealed , DefaultAccountScenario , sealed
  • Button_ManageAccount_Click() : sealed
  • Button_ManageAccounts_Click() : sealed
  • Button_ManageSignedInAccounts_Click() : sealed
  • Button_Passport_Click() : SignIn , sealed
  • Button_Pause_Click() : PlaybackControl
  • Button_Play_Click() : PlaybackControl
  • Button_Reset() : SingleMicrosoftAccountScenario , SingleAccountScenario , SingleAzureADScenario , MultipleAccountsScenario
  • Button_Reset_Click() : sealed , DefaultAccountScenario , sealed
  • Button_Restart_Click() : Content , sealed
  • Button_SelectUser_Click() : sealed , UserSelect
  • Button_ShowAccountSettings() : SingleAzureADScenario , SingleMicrosoftAccountScenario , SingleAccountScenario , MultipleAccountsScenario
  • Button_SignIn_Click() : sealed , SignIn , sealed
  • Button_Stop_Click() : PlaybackControl
  • ButtonClearAll_Click() : ScenarioElement
  • ButtonClearBadge_Click() : ScenarioElement
  • ButtonClearNotifications_Click() : ScenarioElement
  • ButtonEndScanningInstance1_Click() : Scenario2_MultipleScanners
  • ButtonEndScanningInstance2_Click() : Scenario2_MultipleScanners
  • ButtonNext_Click() : StepsControl
  • ButtonPickImage_Click() : ScenarioElement
  • ButtonPin_Click() : ScenarioElement , UpdateFourTilesControl , ScenarioElement
  • ButtonPinSecondaryTile_Click() : ScenarioElement
  • ButtonPinTile_Click() : ScenarioElement
  • ButtonPopToast_Click() : PopToastControl
  • ButtonPopToasts_Click() : ScenarioElement
  • ButtonRemoveGroup1_Click() : ScenarioElement
  • ButtonRemoveToast2_Click() : ScenarioElement
  • ButtonSendNotification_Click() : ScenarioElement
  • ButtonStartScanningInstance1_Click() : Scenario2_MultipleScanners
  • ButtonStartScanningInstance2_Click() : Scenario2_MultipleScanners
  • ButtonToggleShowPayload_Click() : UpdateFourTilesControl , PopToastControl
  • ButtonTriggerGhostToast_Click() : ScenarioElement
  • ButtonUnpinEverything_Click() : ScenarioElement
  • ButtonUpdate_Click() : ScenarioElement
  • ButtonUpdateBadgeGlyph_Click() : ScenarioElement
  • ButtonUpdateBadgeNumber_Click() : ScenarioElement
  • ButtonUpdateTile_Click() : ScenarioElement
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- c -

  • CachedFileUpdater_Local() : CachedFileUpdater_Local
  • CachedFileUpdater_Remote() : CachedFileUpdater_Remote
  • CachedFileUpdaterPage() : CachedFileUpdaterPage
  • CachedFileUpdaterPage_SizeChanged() : CachedFileUpdaterPage
  • CachedFileUpdaterUI_FileUpdateRequested() : CachedFileUpdaterPage
  • CachedFileUpdaterUI_UIRequested() : CachedFileUpdaterPage
  • CafFocusRadioButton_Checked() : MainPage
  • CalculateCenter() : sealed , Scenario7
  • CalculateInitialSize() : BaseControl
  • CalculateNumberIdentifierForLive() : DashManifestParser
  • CalculatePreviewRotation() : sealed , OcrCapturedImage
  • CalculateResponse() : sealed
  • CalculateThreadgroups() : DftTransform
  • CalendarConverter() : sealed
  • CalibrationBar() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • CallButton_Click() : sealed , VideoChat
  • CallConcatenateHandler() : sealed
  • CallConfigureWiFiHandler() : sealed
  • CallConnectHandler() : sealed
  • CallConnectionResultReceived() : sealed
  • CallConnectionResultSignalHandler() : sealed
  • CallGetScanInfoHandler() : sealed
  • CalligraphicPen() : CalligraphicPen
  • CallOffboardHandler() : sealed
  • CallTextSentReceived() : sealed
  • CallTextSentSignalHandler() : sealed
  • Camera() : Camera
  • CameraButton_Click() : OcrCapturedImage
  • CameraButton_Tapped() : sealed
  • CameraCoordinateMapper() : CameraCoordinateMapper
  • CameraIntrinsics() : GpuCoordinateMapper::CameraIntrinsics
  • CameraResources() : CameraResources
  • CameraRotationHelper() : sealed , CameraRotationHelper
  • CameraSnapshotButton_Click() : Scenario2_DetectInWebcam
  • CameraStreamCoordinateMapperMain() : CameraStreamCoordinateMapperMain
  • CameraStreamingButton_Click() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • CameraStreamProcessor() : CameraStreamProcessor
  • Cancel_Click() : Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation , Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario12_DisableCookies , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation
  • CancelableInitialRequestAsync() : Scenario12_DisableCookies
  • CancelableNextRequestAsync() : Scenario12_DisableCookies
  • CancelableRequestAsync() : Scenario01_GetText , Scenario02_GetStream , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario08_PostCustomContent , Scenario09_GetCookie , Scenario13_RetryFilter , Scenario14_MeteredConnectionFilter , Scenario15_ServerCertificateValidation
  • CancelActiveDownloads() : sealed
  • CancelActiveDownloadsAsync() : sealed , Scenario3_Notifications , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario7_DownloadReordering
  • CancelAll_Click() : sealed , Scenario1_Download , Scenario2_Upload
  • CancelAllIoTasks() : Scenario3_ReadWrite , Scenario4_BulkPipes , Scenario2_LEDTemp
  • CancelAllIoTasks_Click() : Scenario4_BulkPipes
  • CancelCommand() : sealed , CancelCommand
  • CancelCommandButton_Click() : sealed , CancelCommand
  • CancelGetGeolocationButtonClicked() : Scenario2_GetPosition
  • CancelObjectCreation() : CSchemeHandler
  • CancelReadTask() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • CancelSelection() : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • CancelSync_Click() : Scenario7_SyncDevice
  • CancelSyncWithDevice() : Scenario7_SyncDevice
  • CancelTransfer_Click() : Scenario1
  • CancelWriteTask() : Scenario3_ReadWrite , Scenario2_LEDTemp
  • CanCreateNewWindow() : Scenario3_UsingWindows
  • CanDestroyWindow() : Scenario3_UsingWindows
  • canDownload() : sealed , Scenario8
  • CanExecute() : RelayCommand , sealed , RelayCommand
  • CanPair() : DeviceInformationDisplay
  • CanPaste() : SceneComposer
  • CanSecure() : AllJoynHelpers
  • CanSendMessage() : Utils
  • CanShowCalibrationBar() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • CanTakePhoto() : MediaCaptureManager
  • CanToggleVideo() : MediaCaptureManager
  • Capabilities_Click() : Scenario5_Capabilities
  • CaptureButton_Click() : Scenario8_CaptureBitmap
  • CaptureDevice() : sealed , CaptureDevice
  • CardName() : SmartCardListItem
  • CardReader() : CardReader
  • cardReader_CardAdded() : CardReader
  • cardReader_CardRemoved() : CardReader
  • CastButton_Click() : MediaTransportControlsWithCustomCastButton
  • castButton_Click() : Scenario2
  • castingDevicesList_SelectionChanged() : Scenario3
  • CAsyncOperation() : CStreamSink::CAsyncOperation
  • CAsyncState() : CAsyncState
  • CBaseAttributes() : CBaseAttributes< TBase >
  • cbLanguageSelection_SelectionChanged() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • CBufferEnumerator() : CBufferEnumerator
  • CBufferPacket() : CBufferPacket
  • ChangeAdminKey_Click() : sealed , Scenario4_ChangeAdminKey
  • ChangeFolderClick() : sealed , PhasingTests
  • ChangeMediaFormatAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • ChangePin_Click() : sealed , Scenario2_ChangePIN
  • ChangeScenarioStateAsync() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • Characteristic_ValueChanged() : Scenario2_Client
  • CharacteristicList_SelectionChanged() : Scenario2_Client
  • CharacteristicReadButton_Click() : Scenario2_Client
  • CharacteristicWriteButton_Click() : Scenario2_Client
  • CharacteristicWriteButtonInt_Click() : Scenario2_Client
  • ChatListView() : sealed , ChatListView
  • Check() : Check
  • CheckAvailability_Click() : sealed , Scenario1_CheckConsentAvailability
  • CheckBackgroundAccessStatus() : Scenario1_Basics
  • CheckBackgroundAndRequestLocationAccess() : MainPage
  • CheckBox_Click() : Scenario1
  • CheckBox_Toggle() : sealed , Scenario1
  • CheckBoxChanged() : sealed
  • CheckBoxStyle() : Scenario1_Basic
  • CheckBufferSize() : BufferHelper
  • CheckClosed() : CNetworkChannel
  • CheckConcurrentProfileBtn_Click() : sealed , Scenario2_ConcurrentProfile
  • CheckDisposed() : FileLoggingSessionScenario , LoggingSessionScenario
  • CheckException() : CSendOperationStatus
  • CheckForInput() : SpatialInputHandler
  • CheckForMediaPresentationDuration() : Player
  • CheckForNullOrEmptyField() : ModemInformation
  • CheckForRecordingDeviceAsync() : CaptureDevice
  • CheckHceSupport() : NfcUtils
  • CheckHdrSupportBtn_Click() : Scenario3_EnableHdrProfile , sealed
  • CheckHistoryAndRoaming() : HistoryAndRoaming
  • CheckIf3DBuilderIsInstalled_Click() : Scenario2_Launch
  • CheckIfObsolete() : SourceHandler::PositionInformation
  • CheckIfStreamsAreIdentical() : sealed , Scenario2_PhotoSettings , Scenario3_AspectRatio
  • CheckIndexRevision_Click() : sealed , S4_CheckIndexRevision
  • CheckMarshal() : CMediaBufferWrapper
  • CheckNow_Clicked() : Scenario4_Settings
  • CheckPeripheralRoleSupportAsync() : Scenario3_ServerForeground
  • CheckPriority() : HttpMeteredConnectionFilter
  • CheckShutdown() : CMediaSink , sealed , CMediaSource , CMediaStream , CStreamSink
  • CheckStereoEnabledStatus() : DeviceResources
  • CheckUriIdentity_Click() : Scenario16_NetworkResource
  • chkDenyIfPhoneLocked_Checked() : ManageCardScenario
  • chkDenyIfPhoneLocked_Unchecked() : ManageCardScenario
  • chkLaunchAboveLock_Checked() : ManageCardScenario
  • chkLaunchAboveLock_Unchecked() : ManageCardScenario
  • Choices() : DeviceInformationKindChoices
  • ChooseBaseVideo_Click() : sealed , Scenario4_AddOverlays , sealed
  • ChooseFile_Click() : sealed , Scenario1_TrimAndSaveClip , Scenario1_Files
  • ChooseFileButton_Click() : sealed , Scenario1_Geotag
  • ChooseFirstVideo_Click() : sealed , Scenario2_AppendClips
  • ChooseFolder_Click() : Scenario1_Files
  • ChooseOverlayVideo_Click() : sealed , Scenario4_AddOverlays , sealed
  • ChooseSecondVideo_Click() : sealed , Scenario2_AppendClips
  • ChooseVideo_Click() : sealed , Scenario3_AddAudioTracks , sealed
  • ChunkedResponseToggle_Toggled() : Scenario07_PostStreamWithProgress
  • ClaimAndEnable_Click() : sealed , Scenario1_FindClaimEnable
  • ClaimBarcodeScannerAsync() : Scenario2_MultipleScanners
  • ClaimButton1_Click() : sealed , Scenario3_MultipleDrawers
  • ClaimButton2_Click() : sealed , Scenario3_MultipleDrawers
  • ClaimCashDrawer() : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers
  • claimedBarcodeScannerInstance1_DataReceived() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance1_ReleaseDeviceRequested() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2_DataReceived() : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2_ReleaseDeviceRequested() : Scenario2_MultipleScanners
  • claimedCashDrawerInstance1_ReleaseDeviceRequested() : sealed , Scenario3_MultipleDrawers
  • claimedCashDrawerInstance2_ReleaseDeviceRequested() : sealed , Scenario3_MultipleDrawers
  • ClaimedPrinter_ReleaseDeviceRequested() : MainPage , sealed , MainPage
  • ClaimedScanner_Closed() : Scenario5_DisplayingBarcodePreview
  • claimedScanner_DataReceived() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ClaimedScanner_DataReceived() : Scenario5_DisplayingBarcodePreview
  • claimedScanner_ReleaseDeviceRequested() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ClaimPrinter() : sealed
  • ClaimReader() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ClaimSamePrinter_Click() : sealed , Scenario3_MultipleClaims
  • ClaimScenarioLineDisplayAsync() : MainPage
  • Clamp() : D2DAdvancedColorImagesRenderer , FilmicEffect , ReinhardEffect , RippleEffect , WaveEffect
  • CleanBuffer() : SourceBufferManager
  • CleanSampleQueue() : CMediaStream
  • CleanSceneAnalysisEffectAsync() : sealed , MainPage
  • Cleanup() : sealed
  • CleanUp() : sealed
  • Cleanup_Click() : Scenario1_CreateContact
  • CleanupAccountsControlDialog() : sealed
  • CleanupAsync() : sealed , LowLatency
  • CleanUpAsync() : CaptureDevice
  • CleanupCameraAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MediaCapturePreviewer , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • CleanUpFaceDetectionEffectAsync() : sealed , MainPage
  • CleanupMediaCaptureAsync() : sealed , Scenario1_DisplayDepthColorIR , Scenario1_ExampleOperations , sealed
  • CleanUpMediaPlayerSource() : MainPage
  • CleanupPreviousEffect() : Scenario2_Effects
  • CleanupSink() : sealed , CaptureDevice
  • CleanupUiAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • CleanUpUserList() : SignIn
  • CleanUpVideoStabilizationEffectAsync() : sealed , MainPage
  • Clear() : sealed , InkRenderer , sealed , IncrementalLoadingBase , CBufferPacket , List< T > , ComPtrList< T, NULLABLE > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • Clear_Click() : Scenario6_ClearScenario
  • ClearAllDeviceValues() : Scenario1_MIDIDeviceEnumeration
  • ClearAuthenticationToken() : Scenario3_ForegroundApp
  • ClearBadge_Click() : Scenario2_Notifications
  • ClearBluetoothLEDeviceAsync() : Scenario2_Client
  • ClearButton_Click() : Scenario1 , Scenario2
  • ClearCanvasStrokeCache() : sealed , Scenario9
  • ClearCapture() : Scenario4
  • ClearColorsClick() : sealed , Functions
  • ClearDeviceEntries() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • ClearDrawnBoundingRect() : sealed , Scenario2
  • ClearExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • ClearItems() : MediaListViewModel
  • ClearLastStatus() : SdkSample
  • ClearLog() : InkEventLogger
  • ClearMapClick() : sealed , Scenario12
  • ClearNames() : FontNameCollector
  • ClearOutput() : OtherScenarios
  • ClearOutputButton_Click() : OtherScenarios
  • ClearOutputs() : sealed , Scenario1_Single , Scenario2_Multiple
  • ClearPageCollection() : sealed , PhotosPrintHelper
  • ClearPasswords() : Scenario2ViewModel
  • ClearProcessUIPolicy_Click() : Scenario3
  • ClearResults() : sealed , OcrFileImage
  • ClearScene() : SceneComposer
  • ClearSceneObjects() : SceneController
  • ClearSelectedDevice() : DeviceList
  • ClearSelection() : sealed , Scenario2
  • ClearStrokeContainerForTemp() : InkRenderer
  • ClearSurfaces() : RealtimeSurfaceMeshRenderer
  • ClearSwitchStateTable() : DeviceEvents , Scenario3_InterruptPipes , sealed
  • ClearTarget() : DeviceResources
  • ClearTile_Click() : Scenario2_Notifications
  • ClearTitle_Click() : SecondaryViewPage
  • ClearTool() : ClearTool
  • ClearVisual() : EdgeTappedListView
  • ClearVisualization() : Scenario1_DetectInPhoto
  • Click_BaseArgs() : sealed , EventTests
  • Click_NoArgs() : sealed , EventTests
  • Click_RegularArgs() : sealed , EventTests
  • ClickToPlaySource_ImageOpened() : sealed , Scenario1_Basic
  • ClientTypeChanged() : Scenario16_NetworkResource
  • Close() : AudioEchoEffect , HttpJsonContent , PlugInFilter , SlowInputStream , HttpMeteredConnectionFilter , HttpRetryFilter , LiveDashPlayer , Player , SourceBufferManager , GameMain , CNetworkChannel , abstract , sealed , SocketReaderWriter , ConnectedDevice , SessionWrapper
  • Close_Click() : Scenario1 , Scenario2
  • CloseConnection_Click() : KeepConnectionOpenScenario
  • CloseCurrentlyConnectedDevice() : sealed , EventHandlerForDevice
  • CloseDevice() : sealed , EventHandlerForDevice
  • CloseFx2Device() : sealed , DeviceConnect
  • CloseListener_Click() : sealed , Scenario5
  • CloseListenerSocket() : sealed , Scenario5
  • CloseScannerResourcesAsync() : Scenario5_DisplayingBarcodePreview
  • CloseSession() : sealed , WiFiDirectServiceManager
  • CloseSession_Click() : sealed , Scenario2 , Scenario4
  • CloseSessionSaveFinalLogFile() : sealed , FileLoggingSessionScenario
  • CloseSocket() : sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite
  • CloseSockets_Click() : sealed , Scenario4 , sealed , Scenario4
  • CMarker() : CMarker
  • CMediaBufferWrapper() : CMediaBufferWrapper
  • CMediaSource() : CMediaSource
  • CMediaStream() : CMediaStream
  • CollapsedIf() : BindingHelpers , sealed
  • CollectExpensiveData() : sealed , LoggingChannelScenario
  • Collections() : Collections
  • ColorFrameReader_FrameArrivedAsync() : Scenario1_ExampleOperations
  • ColorizeCustomButtonAsync() : sealed , Scenario10
  • ColorLampBtn_Click() : sealed , Scenario2_EnableSettings
  • ColorValue() : sealed , Functions
  • ComboBox_SelectionChanged() : LiveDashPlayer
  • ComboBoxSettings_Changed() : sealed , Scenario1_PreviewSettings
  • ComboChanged() : sealed
  • CommandBar_Closed() : sealed , Scenario3 , Scenario7
  • CommandBar_Closing() : sealed , Scenario3
  • CommandBar_Opened() : sealed , Scenario3
  • CommandBar_Opening() : sealed , Scenario3 , Scenario7
  • CommandInvokedHandler() : sealed , CancelCommand
  • CommonDeviceSelectors() : DeviceSelectorChoices
  • CommonLicenseRequest() : CommonLicenseRequest
  • Compare() : CBaseAttributes< TBase >
  • CompareFilesButton_Click() : sealed , Scenario9
  • CompareItem() : CBaseAttributes< TBase >
  • Complete() : sealed
  • CompleteConfirmPinTask() : sealed , Scenario9_CustomPairDevice
  • CompleteCurrentAnimation() : Scenario3
  • Completed_Tapped() : StepsControl
  • CompletedCallback() : sealed , CompletedCallback
  • CompletedCallbackButton_Click() : sealed , CompletedCallback
  • CompleteOpen() : CMediaSource
  • CompletePasswordCredential() : sealed , Scenario9_CustomPairDevice
  • CompleteProvidePinTask() : sealed , Scenario9_CustomPairDevice
  • CompletionGroupTask() : sealed
  • ComponentLoadFailed() : PlayReadyHelpers
  • ComposeStroke() : SourceHandler
  • CompressAlgorithmComboBox_SelectionChanged() : sealed , Scenario1
  • CompressAlgorithmFromComboBoxItem() : sealed , Scenario1
  • CompressFile() : Scenario1
  • CompressFileButton_Click() : sealed , Scenario1
  • ComputeDisplayRotation() : DeviceResources
  • ComputeHdrMetadata() : D2DAdvancedColorImagesRenderer
  • ComputeLookAtQuaternion() : MediaTransportControls
  • ComputePositionInOrbit() : OmnidirectionalSound
  • ComputeResult() : Scenario3_ServerForeground
  • ComputeScalingTransformForSourceImage() : Scenario1_DetectInPhoto
  • ComputeSphere() : VideoRenderer
  • ConcatenateAsync() : ISecureInterfaceService , sealed , Scenario1ViewModel , SecureInterfaceService
  • ConcatToOutput() : sealed
  • ConfigureApo() : CardioidSound
  • ConfigureCurrentlyConnectedDevice() : EventHandlerForDevice
  • ConfigureDeviceInternal() : WASAPIRenderer
  • ConfigureHardwareDRM() : HardwareDRMViewModel
  • ConfigureMse() : Player
  • ConfigurePreheatTemperature() : IOven , Oven , IOven , WrlFinal , IOven , WrlFinal
  • ConfigureSoftwareDRM() : HardwareDRMViewModel
  • ConfigureSource() : WASAPIRenderer
  • ConfigureStreams() : MFSampleGenerator
  • ConfigureWiFiAsync() : IOnboardingService , sealed , OnboardingService
  • ConnectAsync() : IOnboardingService , sealed , OnboardingService , sealed , INetworkClient , sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario4_PartialReadWrite , sealed , DiscoveredDeviceWrapper
  • ConnectButton_Click() : Scenario2_Client , Scenario1_ChatClient , Scenario1_Connect , sealed , Scenario4_Connect
  • ConnectedDevice() : sealed , ConnectedDevice
  • ConnectedDevices() : Scenario1_Advertiser , Scenario2_Connector
  • Connection_ErrorOccurred() : Scenario02 , Scenario06 , Scenario2 , Scenario3
  • Connection_ServiceClosed() : KeepConnectionOpenScenario
  • Connection_StateChanged() : Scenario02 , Scenario06 , Scenario2 , Scenario3
  • ConnectionResult() : sealed
  • ConnectionSettingsPanel() : ConnectionSettingsPanel
  • ConnectSocket_Click() : sealed , Scenario2 , sealed , Scenario2 , Scenario5
  • ConnectSocketWithRetry() : sealed
  • ConnectSocketWithRetryHandleSslErrorAsync() : sealed
  • ConnectToDevice_Click() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • ConnectToRemoteAppServiceAsync() : Scenario3_LaunchAppServices
  • ConnectToSoftAPAsync() : Scenario2ViewModel
  • ConnectToUri() : Scenario16_NetworkResource
  • ConnectUsingBackgroundTransfer() : Scenario16_NetworkResource
  • ConnectUsingNetHttpClient() : Scenario16_NetworkResource
  • ConnectUsingWebHttpClient() : Scenario16_NetworkResource
  • ConnectWebSocketAsync() : sealed , Scenario3_ClientAuthentication
  • ConsoleRun() : CSampleService
  • Construct() : App
  • ConstructInBackground() : GameMain
  • Consumer_IsUpperCaseEnabledChanged() : Scenario1ViewModel
  • Consumer_SessionLost() : Scenario1ViewModel , Scenario2ViewModel
  • Contact() : Contact
  • Contains() : FileDataSource , ItemIndexRangeList , EmployeeCollection , IncrementalLoadingBase , IScenario , Scenario , ScenarioGroup , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , FileDataSource2
  • ContainsKey() : EmployeeDictionary
  • Content() : sealed , Content
  • ContentSelector() : ContentSelector
  • ContentTransitionStoryboard_Completed() : SectionView
  • ContextChanged() : sealed
  • ContinuationPage() : sealed , ContinuationPage
  • Continue() : CServiceBase
  • ContinueAuthenticationInForeground() : AuthenticationTask
  • ContinueGame() : Simple3DGame
  • Continuous() : Animate
  • ContinuousRecognitionSession_Completed() : Scenario_ContinuousRecognitionSRGSGrammar , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_PauseAsync
  • ContinuousRecognitionSession_ResultGenerated() : Scenario_ContinuousRecognitionSRGSGrammar , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_PauseAsync
  • ContinuousRecognize_Click() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar
  • Contours() : sealed
  • ContrastingColorButtonCheckedChanged() : sealed , Scenario11
  • Control_Loaded() : MPEUserControl
  • Control_Unloaded() : MPEUserControl
  • ControlBase() : ControlBase
  • Controller_ButtonClicked() : Scenario1_EventAndMenuHookup
  • Controller_ControlAcquired() : Scenario1_EventAndMenuHookup
  • Controller_ControlLost() : Scenario1_EventAndMenuHookup
  • Controller_RotationChanged() : Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • Controller_ScreenContactContinued() : Scenario1_EventAndMenuHookup
  • Controller_ScreenContactEnded() : Scenario1_EventAndMenuHookup
  • Controller_ScreenContactStarted() : Scenario1_EventAndMenuHookup
  • Conversation() : sealed , Conversation
  • Convert() : DoubleToIntConverter , ColorToStringConverter , Helpers::ServiceStatusConverter , ScenarioBindingConverter , VisibilityConverter , AuthTypeToStringConverter , ScenarioBindingConverter , PlaybackStateToButtonIconConverter , InvertBoolConverter , RoundingConverter , sealed , DateTimeOffsetConverter , sealed , ScenarioBindingConverter , TypeToUIElementConverter , XmlDocumentToStringConverter , BooleanToVisibilityConverter , sealed , NegatingBoolConverter , ScenarioBindingConverter , Helpers::sealed , Helpers::BufferConverter , BoolToVisibilityConverter , ColorToStringConverter , IntToDoubleConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , ScenarioBindingConverter
  • ConvertACKindToString() : sealed
  • ConvertBack() : ScenarioBindingConverter , ColorToStringConverter , NegatingBoolConverter , Helpers::BufferConverter , XmlDocumentToStringConverter , InvertBoolConverter , DateTimeOffsetConverter , AuthTypeToStringConverter , ScenarioBindingConverter , PlaybackStateToButtonIconConverter , RoundingConverter , sealed , VisibilityConverter , sealed , ScenarioBindingConverter , TypeToUIElementConverter , ScenarioBindingConverter , BooleanToVisibilityConverter , sealed , ScenarioBindingConverter , Helpers::sealed , Helpers::ServiceStatusConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , BoolToVisibilityConverter , ColorToStringConverter , DoubleToIntConverter , IntToDoubleConverter , ScenarioBindingConverter
  • ConvertClockwiseDegreesToSimpleOrientation() : sealed , CameraRotationHelper
  • ConvertDeviceOrientationToDegrees() : sealed , MainPage , sealed , MainPage
  • ConvertDipProperty() : PhotoAdjustmentRenderer
  • ConvertDisplayOrientationToDegrees() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • ConvertDisplayOrientationToSimpleOrientation() : sealed , CameraRotationHelper
  • ConvertFromDIPToPixelUnit() : DeviceResources
  • ConvertFromPixelToDIPUnit() : DeviceResources
  • ConvertOrientationToPhotoOrientation() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • ConvertPreviewToUiRectangle() : MainPage , sealed
  • ConvertRange() : Scenario5_InboxEffects
  • ConvertShapes() : Scenario1
  • ConvertSimpleOrientationToClockwiseDegrees() : sealed , CameraRotationHelper
  • ConvertSimpleOrientationToPhotoOrientation() : sealed , CameraRotationHelper
  • ConvertSimpleOrientationToVideoRotation() : CameraRotationHelper , sealed
  • ConvertToDisplayableImage() : sealed
  • ConvertToNfcMessageAsync() : Scenario1
  • ConvertUiTapToPreviewRect() : MainPage
  • ConvertUpdateRect() : SceneComposer
  • ConvertUtf8ToHex() : Scenario2ViewModel
  • CopyAllItems() : CBaseAttributes< TBase >
  • CopyAssetToFolderIfNecessaryAsync() : Scenario5_Msappdata
  • CopyBitmap() : CopyImage
  • CopyButton_Click() : CopyImage , CopyFiles , CopyImage , CopyText , HistoryAndRoaming , CopyFiles , CopyText , HistoryAndRoaming
  • CopyFileButton_Click() : Scenario8 , sealed , Scenario8
  • CopyFiles() : CopyFiles
  • CopyFlyoutItem_Click() : sealed
  • CopyFromVideoMediaFrame() : NV12VideoTexture
  • CopyImage() : CopyImage
  • CopyProtectionAsync() : Scenario4
  • CopyProtectionAsync_Click() : Scenario4
  • CopyRequestMessage() : HttpRetryFilter
  • CopySelected() : SceneComposer
  • CopyText() : CopyText
  • CopyTo() : IncrementalLoadingBase , CBufferPacket , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource
  • CopyToClipboard_Click() : Scenario10_CpToClipboard
  • CopyWithDelayedRenderingButton_Click() : CopyImage
  • CoreDispatcher_AcceleratorKeyActivated() : RootFrameNavigationHelper
  • CoreTitleBarHeight() : CustomTitleBar
  • CoreTitleBarPadding() : CustomTitleBar
  • CoreWetStrokeUpdateSource_WetStrokeCanceled() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeCompleted() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeContinuing() : Scenario8 , sealed
  • CoreWetStrokeUpdateSource_WetStrokeStarting() : sealed , Scenario8
  • CoreWetStrokeUpdateSource_WetStrokeStopping() : Scenario8 , sealed
  • CoreWindow_KeyDown() : CustomEditControl
  • CoreWindow_PointerPressed() : RootFrameNavigationHelper , CustomEditControl , RootFrameNavigationHelper
  • CoreWindow_VisibilityChanged() : TripListView
  • CostBasedSuggestions() : GetConnectionProfiles
  • CountEmployees() : sealed , Functions
  • CountEmployeesinternal() : Functions
  • countVowels() : sealed , Functions
  • Create() : CMarker , DftEffect , JsonRequest
  • Create_Click() : Scenario1_Define , Scenario1_ProvisionTPM , Scenario6_Recurrence , sealed , Scenario1_ProvisionTPM
  • CreateAdvertiser_Click() : sealed , Scenario1
  • CreateAndStartAsync() : CameraCoordinateMapper , CameraStreamProcessor
  • CreateAsync() : VideoFrameProcessor , FaceTrackerProcessor
  • CreateAudioGraph() : Scenario6_CustomEffects , Scenario2_DeviceCapture , Scenario5_InboxEffects , Scenario1_FilePlayback , Scenario3_FrameInput , Scenario4_Submix
  • CreateAudioType() : MFSampleGenerator
  • CreateBackgroundDownloader() : sealed , CompletionGroupTask
  • CreateBadgeAndTextTile_Click() : Scenario3_SecondaryTiles
  • CreateBadgeTile_Click() : Scenario3_SecondaryTiles
  • CreateBarcodeScannerReportFromString() : sealed , Provider
  • CreateBinding() : WordOverlay
  • CreateBooleanChartInTable() : Scenario3_InterruptPipes
  • CreateBooleanTable() : DeviceList
  • CreateBorder() : WordOverlay
  • CreateBox() : BasicShapes
  • CreateBrush() : ShapeRenderer
  • CreateBusObject() : AllJoynHelpers , AllJoynBusObjectManager
  • CreateChildElement() : sealed , VisualProperties
  • CreateCircle() : SpatialStageManager
  • CreateCityBuildingsCollection() : MainPage
  • CreateCityParksCollection() : MainPage
  • CreateContactAsync() : Scenario1_CreateContact
  • CreateContactFromUserInput() : MainPage
  • CreateContainer_Click() : Scenario3_SettingContainer
  • CreateCube() : BasicShapes
  • CreateD3D11Surface() : VideoRenderer
  • CreateDefaultCashDrawerObject() : sealed , Scenario2_CloseDrawer , sealed , Scenario3_MultipleDrawers , Scenario1_OpenDrawer
  • CreateDefaultItemList() : ItemList
  • CreateDefaultMagneticStripeReaderObject() : Scenario2_AamvaCards , Scenario1_BankCards
  • CreateDefaultReaderObject() : sealed
  • CreateDefaultScannerObjectAsync() : Scenario2_MultipleScanners
  • CreateDeviceDependentResources() : GameInfoOverlay , QuadRenderer , GpuCoordinateMapper , VideoRenderer , SpinningCubeRenderer , CameraCoordinateMapper , D2DAdvancedColorImagesRenderer , SampleOverlay , PhotoAdjustmentRenderer , D2DSvgImageRenderer , SampleOverlay , SpinningCubeRenderer , final , SceneObject , SpinningCubeRenderer , RectRenderer , GameHud , GameRenderer , GameHud , RenderingHelper , CustomComputeShaderRenderer , CustomVertexShaderRenderer , SampleOverlay , ControlBase , Cursor , RealtimeSurfaceMeshRenderer , DistanceFieldRenderer , QuadRenderer , GameHud , GameRenderer , D2DGradientMeshRenderer , GameRenderer , GameInfoOverlay , TextRenderer , SceneController , IControl , DWriteColorTextRendererRenderer , CustomPixelShaderRenderer , TextRenderer , SpinningCubeRenderer
  • CreateDeviceDependentResourcesAsync() : SpinningCubeRenderer , TextRenderer , Resource , NV12VideoTexture , QuadRenderer , VideoRenderer
  • CreateDeviceIndependentResources() : DeviceResources , D2DAdvancedColorImagesRenderer , CustomPixelShaderRenderer , DeviceResources , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DeviceResources , Audio , DeviceResources , CustomVertexShaderRenderer , DeviceResources , CustomComputeShaderRenderer , DeviceResources
  • CreateDeviceResources() : DeviceResources , sealed , DeviceResources
  • CreateDirectXBuffer() : final
  • CreateDownload() : Scenario7_DownloadReordering , Scenario3_Notifications
  • CreateDownloadAsync() : sealed
  • CreateEchoEffect() : Scenario5_InboxEffects
  • CreateEnterAnimation() : SecondaryViewPage
  • CreateEqEffect() : Scenario5_InboxEffects
  • CreateFaceDetectionEffectAsync() : MainPage , sealed
  • CreateFileAndProtect() : Scenario4
  • CreateFileButton_Click() : Scenario1 , sealed , Scenario1 , Scenario5_TriggerCFU , sealed
  • CreateFilePicker() : MainPage
  • CreateFilmicImpl() : FilmicEffect
  • CreateForCurrentView() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • CreateFromHeadingPitchRoll() : Helpers
  • CreateFromXml_Click() : Scenario1_Print
  • CreateGameDeviceResourcesAsync() : GameRenderer
  • CreateGeneratorButton_Click() : Scenario1_Conversion , sealed , Scenario2_Prediction , sealed , Scenario3_ReverseConversion
  • CreateGraphButton_Click() : Scenario2_DeviceCapture
  • CreateHeaderTextBlock() : sealed , Helpers , Scenario2 , Scenario3
  • CreateHistogramResources() : D2DAdvancedColorImagesRenderer
  • CreateHitTextureResourceView() : TargetTexture
  • CreateHttpClientWithPlugIn() : Helpers
  • CreateImageDependentResources() : D2DAdvancedColorImagesRenderer
  • CreateIndexBuffer() : BasicShapes , MeshGeometry , BasicShapes
  • CreateInkDrawingAttributesCore() : sealed , CalligraphicPen
  • CreateInputLayout() : BasicLoader
  • CreateInstance() : CMediaBufferWrapper , CMediaStream , CMediaSource , CBufferPacket , CBufferEnumerator , CMediaBufferWrapper
  • CreateInterfaces() : AllJoynHelpers
  • CreateItems() : ItemsDataSource
  • CreateItemString() : Helpers
  • CreateLayers() : Scenario10 , sealed
  • createLicenseSession() : PlayReadyHelpers
  • CreateLimiterEffect() : Scenario5_InboxEffects
  • CreateLineItemTextBlock() : Scenario4 , Scenario2 , sealed , Helpers , Scenario3
  • CreateLocalDataContainers() : sealed , MultipleAccountsScenario
  • CreateLuminanceHeatmapImpl() : LuminanceHeatmapEffect
  • CreateManagerEmployeeTree() : DataModel
  • CreateMediaBreaksForItem() : Scenario6_AdInsertion
  • CreateMediaEncodingProfile() : Scenario2_DeviceCapture
  • CreateMediaPlayer_Click() : Scenario8_TransferMediaPlayer1
  • CreateMenuItems() : sealed , Scenario1_EventAndMenuHookup
  • CreateMesh() : BasicLoader
  • CreateMessages() : Conversation
  • CreateNewEventHandlerForDevice() : EventHandlerForDevice
  • CreateNewMediaPlaybackItem() : ContentSelector
  • CreateNotification() : BadgeNumericNotificationContent
  • CreateOrUpdatePropertyPopUp() : Scenario2 , sealed
  • CreateOven() : IOvenFactory , WrlFinal , IOvenFactory , WrlFinal
  • CreateOverlays() : Scenario4_AddOverlays , sealed
  • CreatePackageAsync() : Scenario1_Print
  • CreatePackageFromXmlAsync() : Scenario1_Print
  • CreatePartsAsync() : sealed
  • CreatePassportKeyAsync() : SignIn , sealed
  • CreatePassportKeyCredentialAsync() : EnableHelloPage
  • CreatePlaceholderContact() : Scenario2_DelayMini , sealed
  • CreatePresentationDescriptor() : CMediaSource
  • CreatePrintPreviewPages() : PrintHelper , CustomOptionsPrintHelper , PageRangePrintHelper , PrintHelper , PhotosPrintHelper , sealed
  • CreateProducerSession() : AllJoynHelpers
  • CreateProgrammatically_Click() : Scenario1_Print
  • CreateRandomMessage() : Conversation
  • CreateReaderAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • CreateReferenceAxis() : BasicShapes
  • CreateReinhardImpl() : ReinhardEffect
  • CreateReports() : DataModel
  • CreateResourcesAsync() : CameraStreamCoordinateMapperMain
  • CreateResourcesForBackBuffer() : CameraResources
  • CreateResultFileAsync() : Scenario4_CompletionGroups
  • CreateReverbEffect() : Scenario5_InboxEffects
  • CreateRippleImpl() : RippleEffect
  • CreateRootFrame() : App
  • CreateScaledBitmapFromStreamAsync() : Scenario8_CaptureBitmap
  • CreateSceneAnalysisEffectAsync() : MainPage , sealed
  • CreateSdrOverlayImpl() : SdrOverlayEffect
  • CreateSecondaryTile() : Scenario1_CreateTile
  • CreateSolidGlyphBuffer() : sealed , Scenario5_DefiningCustomGlyphs
  • CreateSphere() : BasicShapes
  • CreateSwitchStateArray() : DeviceEvents , sealed
  • CreateTangentSphere() : BasicShapes
  • CreateTangentVertexBuffer() : BasicShapes
  • CreateTestContacts() : Scenario1_CreateContacts
  • CreateTestData() : PhasingTests
  • CreateTestFile() : Scenario3_ReceiveFile
  • CreateTestFileWithNoExtension() : Scenario3_ReceiveFile
  • CreateTextContext() : Text
  • CreateTexture() : BasicLoader
  • CreateTextureResourceView() : TargetTexture
  • CreateTrackingEventsTrack() : TrackingEventCue
  • CreateTransferGroup() : sealed
  • CreateUserActivityAsync() : Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard
  • CreateVertexBuffer() : BasicShapes , MeshGeometry , BasicShapes
  • CreateVideoShaders() : HolographicApp1Main , _360VideoPlaybackMain
  • CreateVideoStabilizationEffectAsync() : MainPage , sealed
  • CreateView() : sealed , App , VisualPropertiesFactory , sealed , AppViewSource , sealed , AppViewSource , sealed , VisualPropertiesFactory , DirectXApplicationSource
  • CreateView_Click() : Scenario1
  • CreateWaveImpl() : WaveEffect
  • CreateWAVFile() : WASAPICapture
  • CreateWindowSizeDependentResources() : GameMain , CustomVertexShaderRenderer , DeviceResources , CustomPixelShaderRenderer , SampleOverlay , DeviceResources , PhotoAdjustmentRenderer , GameHud , SampleOverlay , GameInfoOverlay , DeviceResources , SampleOverlay , D2DSvgImageRenderer , CameraStreamCoordinateMapperMain , CustomComputeShaderRenderer , D2DAdvancedColorImagesRenderer , CustomVertexShaderMain , DeviceResources , D2DGradientMeshRenderer , GameHud , DeviceResources , GameRenderer , GameMain , GameInfoOverlay , GameRenderer , GameMain , GameHud , DeviceResources , QuadRenderer , SampleOverlay , DeviceResources , DWriteColorTextRendererRenderer , DeviceResources , GameRenderer , CustomPixelShaderMain , CustomComputeShaderMain
  • CreateWordHeightBinding() : sealed
  • CreateWordPositionBinding() : sealed
  • CreateWordWidthBinding() : sealed
  • CritSec() : CritSec
  • CSampleService() : CSampleService
  • CServiceBase() : CServiceBase
  • CSetRateOperation() : CSetRateOperation
  • CSharpModel() : CSharpModel
  • CSourceLock() : CMediaStream::CSourceLock
  • CSourceOperation() : CSourceOperation
  • CStartOperation() : CStartOperation
  • CStreamSink() : CStreamSink
  • Current_UnhandledException() : App
  • Current_VisibilityChanged() : Scenario3 , Scenario4_OrientationChanged , Scenario3
  • CurrentLevel() : Simple3DGame
  • CurrentTimeAsString() : SampleHelpers
  • CurrentToolChanged() : Scenario2 , sealed
  • CurrentUser() : Scenario1_ParseAndStringify
  • Cursor() : Cursor
  • CustomCommand() : CustomCommand , sealed
  • CustomCommandButton_Click() : CustomCommand , sealed
  • CustomComputeShaderMain() : CustomComputeShaderMain
  • CustomComputeShaderRenderer() : CustomComputeShaderRenderer
  • CustomControlUsage() : CustomControlUsage
  • CustomEditControl() : CustomEditControl
  • CustomEffect_UpdateRequested() : Scenario2_Effects
  • CustomEffectButton_Click() : Scenario2_Effects
  • CustomEffectState() : CustomEffectState
  • CustomException() : CustomException , sealed , CustomException , sealed , CustomException , sealed , CustomException
  • CustomExceptionWRL() : sealed
  • CustomFocusVisuals() : CustomFocusVisuals
  • CustomMediaTransportControls() : CustomMediaTransportControls
  • CustomMTC_Liked() : MainPage
  • CustomOptionsPrintHelper() : CustomOptionsPrintHelper , sealed
  • CustomPixelShaderMain() : CustomPixelShaderMain
  • CustomPixelShaderRenderer() : CustomPixelShaderRenderer
  • CustomTextBox() : CustomTextBox
  • CustomTextRenderer() : CustomTextRenderer
  • CustomTitleBar() : sealed , CustomTitleBar
  • CustomTitleBar_Loaded() : CustomTitleBar , sealed
  • CustomTitleBar_Unloaded() : sealed , CustomTitleBar
  • CustomTrigger() : sealed , CustomTrigger
  • CustomVertexShaderMain() : CustomVertexShaderMain
  • CustomVertexShaderRenderer() : CustomVertexShaderRenderer
  • CutFlyoutItem_Click() : sealed
  • CutSelected() : SceneComposer
  • CycleAdvancedCaptureMode() : sealed , MainPage
  • CycleBackground() : Simple3DGame , GameMain
  • CycleButton_Click() : Scenario2_Effects
  • CycleModeButton_Click() : sealed
  • Cylinder() : Cylinder
  • CylinderMesh() : CylinderMesh
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- d -

  • D2DAdvancedColorImagesRenderer() : D2DAdvancedColorImagesRenderer
  • D2DGradientMeshMain() : D2DGradientMeshMain
  • D2DGradientMeshRenderer() : D2DGradientMeshRenderer
  • D2DSvgImageRenderer() : D2DSvgImageRenderer
  • DAL() : DAL
  • DASHEntry() : DASHEntry
  • DashManifestParser() : DashManifestParser
  • Data_CollectionChanged() : EmployeeCollection , VeryObservableCollection-g< T > , EmployeeCollection , VeryObservableCollection-g< T >
  • DataBitsComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • DataModel() : DataModel
  • DataSource_CollectionChanged() : PhasingTests
  • DataSource_VectorChanged() : sealed
  • DataTerminalReadyEnabledToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • DataTransferManager_DataRequested() : Scenario7_Share
  • Deactivate() : sealed
  • DebugLog() : sealed
  • DebugLogString() : sealed
  • DecaySlider_ValueChanged() : Scenario5_InboxEffects
  • Decline_Click() : sealed , Scenario2
  • DeclineSessionRequest() : sealed , AdvertisementWrapper
  • DecodeAsync() : DecodeEngine
  • DecodeEngine() : DecodeEngine
  • Default_Click() : Scenario3 , Scenario4 , Scenario5 , Scenario6 , Scenario7 , Scenario8 , Scenario9 , Scenario1_FindId , Scenario1 , Scenario10 , Scenario2
  • DefaultAccountScenario() : DefaultAccountScenario
  • DefaultAndCustomValidation_Checked() : Scenario15_ServerCertificateValidation
  • DefaultCloseCommand() : sealed , DefaultCloseCommand
  • DefaultCloseCommandButton_Click() : sealed , DefaultCloseCommand
  • DefaultOSValidation_Checked() : Scenario15_ServerCertificateValidation
  • DeferredControlTemplatePart() : DeferredControlTemplatePart
  • DefineGlyphButton_Click() : sealed , Scenario5_DefiningCustomGlyphs
  • DegreetoRadians() : Helpers
  • Deinitialize() : SdkSample
  • Delete_Click() : sealed , Scenario6_DeleteTPM
  • DeleteAllItems() : CBaseAttributes< TBase >
  • DeleteAllItems_Click() : sealed , S2_UpdateAndDeleteWithAPI , S6_DeleteWithAppContent
  • DeleteCompositeSetting_Click() : Scenario4_CompositeSettings
  • DeleteContainer_Click() : Scenario3_SettingContainer
  • DeleteCookie_Click() : Scenario11_DeleteCookie
  • DeleteFileButton_Click() : sealed , Scenario10
  • DeleteFunction() : S2_UpdateAndDeleteWithAPI
  • DeleteItem() : CBaseAttributes< TBase > , DetailsPage , Scenario3_MasterDetail , DetailsPage , Scenario3_MasterDetail
  • DeleteItems() : Scenario3_MasterDetail
  • DeleteItemsHelper() : sealed , S2_UpdateAndDeleteWithAPI
  • DeleteKeywords_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • DeleteMenuItem_Click() : sealed , Scenario1 , Scenario2 , Scenario3
  • DeleteMultipleItems_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • DeletePassportServerSide() : sealed , Content
  • DeleteSceneObjects() : SceneComposer
  • DeleteSchool_Click() : Scenario1_ParseAndStringify
  • DeleteSelectedAndUpdate() : SceneComposer
  • DeleteSelectedItem() : sealed , Scenario1_Basic
  • DeleteSelectedStrokes() : InkRenderer
  • DeleteSetting_Click() : Scenario2_Settings , Scenario3_SettingContainer , Scenario2_Settings , Scenario3_SettingContainer
  • DeleteSingleItem_Click() : sealed , S2_UpdateAndDeleteWithAPI , S6_DeleteWithAppContent
  • DeleteTestContacts() : Scenario1_CreateContacts
  • DeleteTrip() : sealed , TripViewModel , TripStore
  • DeleteTripAsync() : sealed
  • DeliverSamples() : CMediaStream
  • DeltaTime() : GameTimer
  • DemonstrateLogging() : sealed , LoggingChannelScenario
  • DescriptionLocalizedResource_Click() : sealed , Scenario3_CustomItems
  • Descriptor_SelectChanged() : Scenario5_UsbDescriptors
  • DescriptorTypeEntry() : DescriptorTypeEntry
  • DeselectRange() : FileDataSource2
  • DeserializeFromBlob() : CBaseAttributes< TBase >
  • DeserializeFromStream() : CBaseAttributes< TBase >
  • DeserializeXmlToAccountList() : AccountsHelper
  • DesfireCommand() : DesfireCommand
  • DesfireResponse() : DesfireResponse
  • DesiredLiveOffset() : ILivePlayer , LiveDashPlayer
  • DesiredLiveOffsetButton_Click() : Scenario7_LiveSeekableRange
  • DesiredMaxBitrateList_SelectionChanged() : Scenario4_Tuning
  • DesiredMinBitrateList_SelectionChanged() : Scenario4_Tuning
  • DesiredSeekableWindowSizeButton_Click() : Scenario7_LiveSeekableRange
  • DestroyWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Detach() : sealed
  • DetailPage() : DetailPage
  • DetailPage_BackRequested() : DetailPage
  • DetailsPage() : DetailsPage
  • DetectCard() : IccDetection
  • DetectCardTypeAync() : IccDetection
  • DeterminePeriodStart() : DashManifestParser
  • DetermineStartingSegmentIndex() : LiveSourceBufferManager
  • Device_CaptureFailed() : LowLatency , VideoChat
  • Device_IncomingConnectionArrived() : LowLatency , VideoChat
  • DeviceAutoDetectToggle_Toggled() : Scenario1_MIDIDeviceEnumeration
  • DeviceChanged() : DeviceWatcherHelper
  • DeviceChangedHandler() : DeviceWatcherHelper
  • DeviceConnect() : sealed , DeviceConnect , sealed , DeviceConnect
  • deviceConnectDevices_SelectionChanged() : sealed , DeviceConnect
  • deviceConnectStart_Click() : sealed , DeviceConnect
  • deviceConnectStop_Click() : sealed , DeviceConnect
  • DeviceEvents() : sealed , DeviceEvents
  • deviceEventsBegin_Click() : sealed , DeviceEvents
  • deviceEventsCancel_Click() : sealed , DeviceEvents
  • deviceEventsGet_Click() : sealed , DeviceEvents
  • DeviceId() : BarcodeScannerInfo
  • DeviceInfo() : DiscoveredDevice
  • DeviceInformation() : BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • DeviceInformationDisplay() : sealed , DeviceInformationDisplay
  • DeviceInformationKindChoice() : sealed , DeviceInformationKindChoice
  • DeviceIO() : sealed , DeviceIO
  • DeviceIOGet_Click() : sealed , DeviceIO
  • DeviceIOSet_Click() : sealed , DeviceIO
  • DeviceList() : DeviceList
  • DeviceListEntry() : sealed , DeviceListEntry
  • DevicePickerSelectors() : DeviceSelectorChoices
  • DeviceReadWrite() : sealed , DeviceReadWrite
  • DeviceResources() : DeviceResources
  • DeviceSelectorInfo() : sealed , DeviceSelectorInfo
  • DeviceState() : DeviceStateChangedEventArgs , DeviceStateSourceT< D >
  • DeviceStateChanged() : DeviceStateSourceT< D >
  • DeviceStateChangedEvent() : sealed
  • DeviceStateChangedEventArgs() : DeviceStateChangedEventArgs
  • DeviceWatcher_Added() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_EnumerationCompleted() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_Removed() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcher_Stopped() : Scenario1_Discovery
  • DeviceWatcher_Updated() : Scenario1_Discovery , MidiDeviceWatcher
  • DeviceWatcherHelper() : sealed , DeviceWatcherHelper
  • DeviceWatcherSelectors() : DeviceSelectorChoices
  • DftEffect() : DftEffect
  • DftTransform() : DftTransform
  • DialLaunchArguments() : DialLaunchArguments
  • dictationTextBox_TextChanged() : sealed , Scenario_ContinuousDictation
  • DigitToSevenSegment() : Fx2Driver
  • DirectXPage() : sealed
  • DisableAdvancedCaptureAsync() : sealed , MainPage
  • DisableAllButtons() : HolographicMRCSampleMain
  • DisableButtons() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • DisableContentTransitions() : MasterDetailPage
  • DisableContentUI() : Scenario2 , Scenario3
  • DisableNonSquarePARProfiles() : sealed , Scenario1_Default , Scenario3_Trim
  • DisablePreviewPrintHelper() : DisablePreviewPrintHelper
  • DisambiguateTrips() : sealed , AdventureWorksVoiceCommandService
  • DiscardChanges_Click() : Scenario1_ConfigureMobileHotspot
  • DiscardQueuedFrames() : AudioEchoEffect
  • Disconnect() : Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , CNetworkChannel , abstract
  • disconnectButton_Click() : Scenario3
  • DisconnectButton_Click() : Scenario1_ChatClient , Scenario2_ChatServer , Scenario3_BgChatServer , sealed , Scenario4_Connect
  • DisconnectFromDevice_Click() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • DisconnectObject() : CMediaBufferWrapper
  • Discover_Click() : sealed , Scenario3
  • DiscoverActiveDownloads() : sealed
  • DiscoverActiveDownloadsAsync() : Scenario1_Download , Scenario16_NetworkResource
  • DiscoverActiveUploads() : sealed
  • DiscoverActiveUploadsAsync() : Scenario2_Upload
  • DiscoveredDevice() : sealed , DiscoveredDevice
  • DiscoveredDevices() : Scenario2_Connector
  • DiscoveredDeviceWrapper() : sealed , DiscoveredDeviceWrapper
  • DiscoverServicesAsync() : sealed , WiFiDirectServiceManager
  • DismissedEventHandler() : ExtendedSplash
  • DismissPopup_Click() : sealed , CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • DismissUI_Click() : Scenario13_ShareTarget , ShareTarget
  • Dispatcher() : ViewLifetimeControl
  • DispatcherTimer_Tick() : Scenario1 , Scenario2 , sealed
  • DispatchOperation() : OpQueue< T, TOperation > , CMediaSource
  • DispatchProcessSample() : CStreamSink
  • Display() : sealed , Scenario1_LongAndShortFormats , Scenario2_StringTemplate , Scenario3_ParameterizedTemplate , Scenario4_Override , Scenario5_UnicodeExtensions , Scenario6_TimeZone , sealed , Functions
  • Display_Click() : Scenario3_CurrencyFormatting , Scenario7_UsingUnicodeExtensions , Scenario2_DecimalFormatting , sealed , Scenario1_LongAndShortFormats , Scenario2_StringTemplate , Scenario3_ParameterizedTemplate , Scenario4_Override , Scenario5_UnicodeExtensions , Scenario6_TimeZone , sealed , Scenario1_PercentPermilleFormatting , Scenario3_CurrencyFormatting , Scenario4_NumberParsing , Scenario5_RoundingAndPadding , Scenario6_NumeralSystemTranslation , Scenario7_UsingUnicodeExtensions , Scenario1_PercentPermilleFormatting , Scenario2_DecimalFormatting , Scenario4_NumberParsing , Scenario5_RoundingAndPadding , Scenario6_NumeralSystemTranslation
  • DisplayChangedFormats() : SampleState , MainPage
  • DisplayCurrentItem() : S1_GetAFeed , sealed
  • DisplayCurrentReading() : Scenario2_Polling , sealed , Scenario3_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling
  • DisplayDeletedResults() : Scenario1
  • DisplayDeviceProperties() : Scenario1_MIDIDeviceEnumeration
  • DisplayError() : SdkSample
  • DisplayFeed() : sealed , S1_GetAFeed
  • DisplayFindItemsResult() : Scenario1
  • DisplayFormats() : OtherScenarios
  • DisplayImageFileAsync() : Scenario2
  • DisplayImageUIAsync() : Scenario1
  • DisplayImportedSummary() : Scenario1
  • DisplayInformation_DpiChanged() : sealed
  • DisplayInformation_OrientationChanged() : OcrCapturedImage , MainPage
  • displayInformation_OrientationChanged() : Scenario4_OrientationChanged
  • DisplayInformation_OrientationChanged() : sealed , MainPage , sealed , MainPage , sealed , CameraRotationHelper , sealed , MainPage , sealed , OcrCapturedImage
  • DisplayLink() : sealed , Scenario6_AppListingURI
  • displayList_listview_SelectionChanged() : Scenario3 , sealed
  • DisplayMetrics() : sealed , Scenario1_Metrics
  • DisplayMultipleCandidates() : sealed
  • DisplayName() : DeviceInformationKindChoice , ProtectionLevelSelectorInfo , UserViewModel , DiscoveredDevice , ConnectedDevice
  • DisplayNameLocalizedResource_Click() : Scenario3_CustomItems , sealed , Scenario3_CustomItems
  • DisplayNetworkIdentity() : Scenario16_NetworkResource
  • DisplayNetworkReport() : sealed , Scenario1_CachedNetworks , Scenario3_RegisterForUpdates , Scenario4_Connect , Scenario2_Scan
  • DisplayOrientation() : sealed , Scenario1_DataEvents , Scenario2_Polling
  • DisplayOutput() : Scenario1_Files , Scenario3_SettingContainer , Scenario4_CompositeSettings , Scenario7_SetVersion , Scenario2_Settings , Scenario3_SettingContainer , Scenario4_CompositeSettings , Scenario7_SetVersion , Scenario1_Files , Scenario2_Settings
  • DisplayProperties_DpiChanged() : Scenario2 , sealed , Scenario1
  • DisplayResourceMapAsync() : CopyText
  • DisplayResult() : MainPage , Helpers , MainPage
  • DisplayRoundingAlgorithmAsString() : sealed , Scenario5_RoundingAndPadding
  • DisplaySizeClass() : sealed
  • DisplaySourceProperties() : Scenario1
  • DisplayStatus() : SdkSample , PlaybackControl
  • DisplayTextButton_Click() : Scenario3_UsingWindows , sealed , Scenario2_DisplayText , sealed , Scenario6_ManipulatingCursorAttributes
  • DisplayTextResultAsync() : Helpers
  • DisplayToast() : ConnectTask , SampleSmsBackgroundTask , MainPage , SampleState , MainPage , ConnectTask
  • DisplayUserInformationAsync() : Scenario1_AddAccount , sealed
  • DisplayWatcherOutputFromCallback() : AccountWatcher
  • DisplayWebError() : Helpers
  • Dispose() : Disposer , SourceGroupCollection , IoSyncBackgroundTask , Scenario2_Upload , Scenario12_DisableCookies , LoggingSessionScenario , Scenario3_Trim , Scenario2_LEDTemp , SocketReaderWriter , WiFiDirectServiceManager , DiscoveredDeviceWrapper , SessionWrapper , StreamSocketListenerWrapper , FileDataSource , FileDataSource2 , StreamSocketListenerWrapper , AddAuthorizationHeaderFilter , Scenario1_BackgroundTask , SocketWrapper , SessionWrapper , LoggingSessionScenario , AdvertisementWrapper , SlowInputStream , AdvertisementWrapper , AppView , DiscoveredDeviceWrapper , ConnectedDevice , Scenario1_Default , WiFiDirectServiceManager , Scenario2_Custom , FileLoggingSessionScenario , Provider , PlugInFilter , Scenario3_ReadWrite , HolographicTemplateAppMain , Scenario4_BulkPipes , MediaListViewModel , PlaybackSessionViewModel , Disposer , FileLoggingSessionScenario , HttpJsonContent , _360VideoPlaybackMain , AppView , Disposer , HolographicApp1Main , PlayerViewModel , Scenario1_Download , Provider
  • DisposeConsumer() : Scenario1ViewModel , Scenario2ViewModel
  • DisposeDeviceAndContext() : DeviceResources
  • DisposeLamp() : Scenario3_AvailabilityChanged , sealed
  • DisposeMediaCapture() : sealed , Scenario2_FindAvailableSourceGroups
  • DisposeMediaPlayer_Click() : Scenario9_TransferMediaPlayer2
  • Disposer() : Disposer
  • DisposeWatcher() : Scenario2ViewModel , Scenario1ViewModel
  • Distance() : Scenario1
  • DistanceFieldRenderer() : DistanceFieldRenderer
  • DistanceFromCenter() : Scenario8 , sealed
  • DoBackgroundRequestAccess() : NfcUtils
  • DoBufferWork() : EdpBackgroundTask
  • DoCleanup() : sealed , CaptureDevice
  • DoConnect_Click() : Scenario3 , sealed
  • DoCreateDeviceDependentResources() : Button , ControlBase , Panel
  • Document() : FileExtensions
  • DocumentPresenter() : sealed
  • DoCurrencyRoundingScenarios() : Scenario5_RoundingAndPadding , sealed
  • DoCustomDry() : SceneComposer
  • DoErase() : SceneComposer
  • DoesSecondaryTileExist() : ScenarioElement
  • DoFileWork() : EdpBackgroundTask
  • DoIncrementRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DOModel() : DOModel
  • DoPaddingAndRoundingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoPaddingScenarios() : sealed , Scenario5_RoundingAndPadding
  • DoReleaseDeviceDependentResources() : Button , ControlBase , Panel
  • DoRender() : ControlBase , Panel , Button
  • DoScenario() : sealed , Scenario2 , sealed , Scenario3 , Scenario1 , Scenario2 , Scenario3 , sealed
  • DoScenarioAsync() : LoggingSessionScenario , FileLoggingSessionScenario , sealed , LoggingSessionScenario , FileLoggingSessionScenario
  • DoSend_Click() : sealed , Scenario5
  • DoSetRate() : CMediaSource
  • DoSignificantDigitRoundingScenarios() : Scenario5_RoundingAndPadding , sealed
  • DoSomething() : LoggingChannelScenario , sealed , LoggingChannelScenario
  • DoSomething_Click() : sealed , Scenario2_XmlWriter , Scenario3_XmlWriterLite , sealed
  • DoStart() : CMediaSource
  • DoStop() : CMediaSource
  • DoubleSpace_Click() : sealed
  • DoubleSpaceHalfLeading_Click() : sealed
  • DoUpdate() : Panel , Button , ControlBase
  • DoWin10Mode() : Scenario1 , sealed , Scenario1
  • DoWin81Mode() : sealed , Scenario1
  • DownloadAsync() : sealed , Scenario3_Notifications , Scenario7_DownloadReordering
  • DownloadBitrateChanged() : Scenario2_EventHandlers , Scenario4_Tuning
  • DownloadBufferAsync() : Downloader
  • DownloadCompleted() : Listener
  • DownloadContactDataAsync() : Scenario2_DelayMini , sealed
  • DownloadFailed() : Scenario3_RequestModification
  • DownloadOperationItem() : DownloadOperationItem , sealed
  • DownloadProgress() : sealed , Scenario7_DownloadReordering , sealed , Scenario1_Download
  • DownloadRequested() : Scenario3_RequestModification
  • DragCompleted() : sealed , Scenario3_StartDragAsync
  • DrainBackBufferAsync() : sealed
  • Draw() : PhotoAdjustmentRenderer , SceneComposer , D2DAdvancedColorImagesRenderer , final , sealed , D2DSvgImageRenderer , sealed
  • DrawBoundingRect() : Scenario2 , sealed
  • DrawCube() : RenderingHelper
  • drawer_AlarmExpired() : sealed , Scenario2_CloseDrawer
  • drawer_StatusUpdated() : Scenario2_CloseDrawer , sealed
  • DrawGlyphRun() : CustomTextRenderer , FontNameCollector
  • DrawInlineObject() : FontNameCollector , CustomTextRenderer
  • DrawLasso() : SceneComposer
  • DrawLineMetricsDecorations() : sealed
  • DrawSelectionRect() : InkRenderer
  • DrawStrikethrough() : CustomTextRenderer , FontNameCollector
  • DrawText() : sealed
  • DrawUnderline() : FontNameCollector , CustomTextRenderer
  • DropBorder_DragEnter() : sealed , Scenario3_StartDragAsync
  • DropBorder_Drop() : sealed , Scenario3_StartDragAsync
  • DropSamplesFromQueue() : CStreamSink
  • DropTime() : CMediaStream
  • DumpAccountDeviceInformation() : AccountWatcher
  • DumpAccountNetwork() : AccountWatcher
  • DumpPropertyData() : AccountWatcher
  • Duration() : Animate
  • DWriteColorTextRendererMain() : DWriteColorTextRendererMain
  • DWriteColorTextRendererRenderer() : DWriteColorTextRendererRenderer
  • DXFLOptionCombo_SelectionChanged() : sealed , Scenario13
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- e -

  • EchoEffectToggle_Toggled() : Scenario4_Submix , Scenario5_InboxEffects
  • EchoMessage() : Scenario1 , sealed
  • EchoSlider_ValueChanged() : Scenario5_InboxEffects
  • EdgeTappedListView() : EdgeTappedListView
  • EditContext_CompositionCompleted() : CustomEditControl
  • EditContext_CompositionStarted() : CustomEditControl
  • EditContext_FocusRemoved() : CustomEditControl
  • EditContext_FormatUpdating() : CustomEditControl
  • EditContext_LayoutRequested() : CustomEditControl
  • EditContext_SelectionRequested() : CustomEditControl
  • EditContext_SelectionUpdating() : CustomEditControl
  • EditContext_TextRequested() : CustomEditControl
  • EditContext_TextUpdating() : CustomEditControl
  • Education() : User
  • EffectOption() : sealed
  • Element_PointerCaptureLost() : EdgeTappedListView
  • Element_PointerExited() : EdgeTappedListView
  • Element_PointerPressed() : EdgeTappedListView
  • Element_PointerReleased() : EdgeTappedListView
  • Element_Unloaded() : CustomEditControl
  • ElementMargin() : ElementMargin
  • Ellipse() : Ellipse
  • EmailButton_Click() : sealed , Scenario_PauseAsync
  • EmbeddedMFAsyncCallback() : EmbeddedMFAsyncCallback< Callback >
  • EmitHdrMetadata() : D2DAdvancedColorImagesRenderer
  • Employee() : Employee
  • EmployeeCollection() : EmployeeCollection
  • EmptyClipboardButton_Click() : OtherScenarios
  • EmptyTask() : sealed
  • EnableAdvancedCaptureAsync() : sealed , MainPage
  • EnableAsync() : sealed
  • EnableBarcodeScannerAsync() : Scenario2_MultipleScanners
  • EnableButtons() : sealed , Scenario1_TrimAndSaveClip , sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • EnableCashDrawer() : Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • EnableCharacteristicPanels() : Scenario2_Client
  • EnableClipboardContentChangedNotifications() : SampleState , MainPage
  • EnableContentTransitions() : Scenario3_MasterDetail , MasterDetailPage
  • EnableControls_Click() : Scenario2_Extend , sealed
  • EnableControlsInTitleBar() : sealed , CustomTitleBar
  • Enabled() : LoggingScenarioEventArgs
  • EnableDisableLogging() : sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • EnableHelloPage() : EnableHelloPage
  • EnableIndependentInputEventHandlers() : sealed
  • EnableInkingEventHandlers() : sealed
  • EnableLoggingConfiguration() : InkEventLogger
  • EnableLoggingIndependentInputEventHandlers() : sealed
  • EnableLoggingStrokeEventHandlers() : sealed
  • EnableLoggingUnprocessedInputEventHandlers() : sealed
  • EnableNonSquarePARProfiles() : sealed , Scenario1_Default , Scenario3_Trim
  • EnablePackageOperationButtons() : Scenario1_Print
  • EnablePasteItemOnly() : sealed
  • EnablePlaybackControls() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • EnableUI() : sealed
  • EnableUnprocessedInputEventHandlers() : sealed
  • EnableWireframe() : SceneObject
  • EndCall() : sealed
  • EndCallAsync() : VideoChat
  • EndCallButton_Click() : sealed , VideoChat
  • EndCreateObject() : CSchemeHandler
  • EndDraw() : DeviceResources , sealed
  • EndExtendedExecution() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • EndGetEvent() : CMediaSource , CMediaStream , CStreamSink
  • EndPosition() : List< T >
  • EndRound() : sealed , Scenario3_StartDragAsync
  • EndScenario_Click() : sealed
  • EndTask() : sealed
  • EndTimerForFrame() : GpuPerformanceTimer
  • ensure_close() : ensure_close
  • EnsureCachedLineMetrics() : sealed
  • EnsureCameraResources() : DeviceResources
  • EnsureMediaExtensionManager() : MainPage
  • Enumerate_Click() : sealed , Scenario1
  • EnumerateAudioDevicesAsync() : sealed
  • EnumerateButton_Click() : Scenario1_Discovery
  • EnumerateMidiInputDevices() : Scenario1_MIDIDeviceEnumeration
  • EnumerateMidiOutputDevices() : Scenario1_MIDIDeviceEnumeration
  • EnumerateSecondaryTiles_Click() : Scenario3_EnumerateTiles
  • EnvironmentComboBox_SelectionChanged() : sealed
  • Eq1Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq2Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq3Slider_ValueChanged() : Scenario5_InboxEffects
  • Eq4Slider_ValueChanged() : Scenario5_InboxEffects
  • EqToggle_Toggled() : Scenario5_InboxEffects
  • Equals() : DecodeResult , PageDescription
  • ErasingModeCheckBox_Checked() : Scenario3 , sealed
  • ErasingModeCheckBox_Unchecked() : sealed , Scenario3
  • Error() : ScenarioElement
  • ErrorReceivedEvent() : Scenario4_Events
  • ErrorReceivedToggleSwitch_Toggled() : Scenario4_Events
  • Evaluate() : AnimateCirclePosition , AnimateLineListPosition , Animate , AnimateLinePosition
  • EvaluateAndReportConnectionCost() : Helpers
  • EvaluateConsentResult() : Scenario3_CheckUserConsentGroup
  • EvaluateCostAndConnectAsync() : Helpers
  • EventHandlerForDevice() : EventHandlerForDevice , sealed , EventHandlerForDevice
  • EventTests() : sealed , EventTests
  • EvSlider_ValueChanged() : MainPage
  • EvStepCountToString() : MainPage
  • Execute() : RelayCommand , sealed , RelayCommand
  • Execute_Click() : Scenario1_Conversion , sealed , Scenario2_Prediction , Scenario3_ReverseConversion , sealed
  • ExecuteJobAndReportResultAsync() : Scenario2_PrintReceipt , sealed
  • ExecuteQueryHelper() : S3_RetrieveWithAPI
  • ExifDateSubfolder_checked() : Scenario1
  • ExitButton() : ExitButton
  • ExpandDASHUrlSegmentTemplate() : DashManifestParser
  • ExpandLongRunningShareSection_Checked() : Scenario13_ShareTarget
  • ExpandLongRunningShareSection_Unchecked() : Scenario13_ShareTarget
  • ExtendedError() : DeviceStateChangedEventArgs
  • ExtendedExecutionSessionRevoked() : sealed , SavingDataReason
  • ExtendedSplash() : ExtendedSplash
  • ExtendedSplash_OnResize() : ExtendedSplash
  • ExtendView_Click() : sealed , Scenario2_Extend
  • ExtractButton_Click() : OcrCapturedImage , OcrFileImage , OcrCapturedImage , OcrFileImage
  • ExtractButton_Tapped() : sealed
  • ExtractResponse() : ApduResponse
  • ExtractTextFromParagraph() : Scenario2
  • ExtractTlvDataObject() : ApduResponse
  • Eye() : Camera
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- f -

  • Face() : Face
  • FaceDetectionButton_Click() : MainPage , sealed
  • FaceDetectionEffect_FaceDetected() : sealed , MainPage
  • FaceMesh() : FaceMesh
  • FaceTrackerProcessor() : FaceTrackerProcessor
  • Fade_Completed() : Scenario3
  • FadeButton_Click() : Scenario2_Effects
  • FadeOutContents() : Scenario3
  • FalToken() : SampleState
  • FarClipPlane() : Camera
  • FeatureReports() : sealed , FeatureReports
  • fetchBatch() : FileDataSource
  • fetchData() : ItemCacheManager< T >
  • FetchData() : FileDataSource
  • fetchDataCallback() : FileDataSource , FileDataSource2
  • fetchDataCallbackHandler() : ItemCacheManager< T >
  • FetchImageAsync() : FileItem
  • fetchSelectionDataCallback() : FileDataSource2
  • File1_Click() : Scenario4_Submix
  • File2_Click() : Scenario4_Submix
  • File_Click() : Scenario1_FilePlayback , Scenario5_InboxEffects , Scenario6_CustomEffects
  • FileButton_Click() : Scenario2_DeviceCapture
  • FileDataSource() : FileDataSource
  • FileDataSource2() : FileDataSource2
  • FileDateSubfolder_checked() : Scenario1
  • FileInput_FileCompleted() : Scenario6_CustomEffects
  • FileIsCurrentButton_Click() : CachedFileUpdater_Local
  • FileLoggingSessionScenario() : sealed , FileLoggingSessionScenario
  • FileName() : SampleState
  • FileOpenPicker_PickAppFile() : FileOpenPicker_PickAppFile
  • FileOpenPicker_PickCachedFile() : FileOpenPicker_PickCachedFile
  • FileOpenPicker_PickURLFile() : FileOpenPicker_PickURLFile
  • FileOpenPickerPage() : FileOpenPickerPage
  • FileOpenPickerPage_SizeChanged() : FileOpenPickerPage
  • FilePickerBt_Click() : Scenario4
  • FileSavePicker_FailToSave() : FileSavePicker_FailToSave
  • FileSavePicker_SaveToAppStorage() : FileSavePicker_SaveToAppStorage
  • FileSavePicker_SaveToCachedFile() : FileSavePicker_SaveToCachedFile
  • FileSavePickerPage() : FileSavePickerPage
  • FileSavePickerPage_SizeChanged() : FileSavePickerPage
  • FillComboBox() : sealed , Scenario3
  • FilledEllipse() : FilledEllipse
  • FilledRectangle() : FilledRectangle
  • FillEventListBoxWithExistingEvents() : Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask
  • FillItemsFromSavedJson() : MainPage
  • FillSampleBuffer() : MFSampleGenerator , ToneSampleGenerator , MFSampleGenerator , ToneSampleGenerator
  • FillStreamDescription() : CMediaSink , CStreamSink
  • FillTextBox() : sealed , Scenario_SynthesizeSSML
  • FillTextBoxes() : sealed , Scenario_SynthesizeTextBoundaries
  • FilmicEffect() : FilmicEffect
  • FinalizeCreateGameDeviceResources() : GameRenderer
  • FinalizeLoadLevel() : Simple3DGame
  • FinalizeLoadLevelResources() : GameRenderer
  • FinalizeRelease() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • Find_Click() : sealed , Scenario1 , Scenario2 , Scenario3
  • FindAllAsyncSelectors() : DeviceSelectorChoices
  • FindAndCancelExistingBackgroundTask() : sealed , Scenario1_DeviceUse
  • findAtCenterButton_Click() : sealed , Scenario8
  • FindBluetoothLEDeviceDisplay() : Scenario1_Discovery
  • FindButton_Click() : sealed , Scenario4_Snapshot
  • FindCameraDeviceByPanelAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • FindCertificateFromStoreAsync() : sealed , Scenario3_ClientAuthentication
  • FindClaimEnable_Click() : sealed
  • FindContentById() : MainPage
  • FindDevice() : sealed , DeviceConnect , Scenario1_ConnectDisconnect , DeviceList
  • FindExisting() : TilesHelper
  • FindHitParagraph() : Scenario2
  • FindIdsInString() : Scenario1_FindId
  • FindInList() : DeviceList
  • findItems() : Scenario1
  • FindModelByUserId() : Scenario2_WatchUsers
  • FindParent() : ScenarioGroup
  • FindPrinter_Click() : sealed , Scenario1_FindClaimEnable
  • FindReceiptPrinter() : sealed
  • FindScenario() : IScenario , Scenario , ScenarioGroup
  • FindScrollViewer() : sealed , Scenario2 , Scenario3
  • FindSupportedFeedback() : MainPage
  • FindSyncTask() : Scenario7_SyncDevice
  • FindToolIndex() : HolographicPaintMain
  • FindUnknownDevices() : Scenario1_Discovery
  • FinishCaptureAsync() : WASAPICapture
  • FireIncomingConnection() : ISinkCallback , sealed , sealed::sealed
  • FireMapChanged() : EmployeeDictionary
  • FirmwareAccess() : sealed , FirmwareAccess
  • First() : sealed , GroupInfoList
  • FirstAdapter_AvailableNetworksChanged() : Scenario3_RegisterForUpdates
  • FirstName() : Contact
  • FirstPersonCamera() : sealed
  • FitImageToWindow() : D2DAdvancedColorImagesRenderer
  • Fix_Click() : Scenario3_FixAccount , sealed
  • FixTextureContentTypeAsync() : Scenario1_Print
  • FixWAVHeader() : WASAPICapture
  • FlashAutoRadioButton_Checked() : MainPage
  • FlashOffRadioButton_Checked() : MainPage
  • FlashOnRadioButton_Checked() : MainPage
  • Flavor() : IBread
  • FlipPreview_Click() : Scenario5_DisplayingBarcodePreview
  • Flush() : ToneSampleGenerator , CStreamSink , MFSampleGenerator , ToneSampleGenerator , CMediaStream
  • FlushAsync() : PipeOut
  • FlushDebugLog() : sealed
  • Flyout_Closed() : Scenario2_Conditional
  • Flyout_Opened() : Scenario2_Conditional
  • FocusableElement() : FocusableElement
  • FocusCamera() : MainPage
  • FocusLightCheckBox_CheckedChanged() : MainPage
  • FocusSlider_ValueChanged() : MainPage
  • FocusUpdate() : Button , FocusableElement
  • FollowCircleTest() : sealed , Scenario8
  • FontDownloadListener() : sealed
  • FontDownloadListener_DownloadCompleted() : sealed
  • Footer_Click() : sealed , MainPage , sealed , CachedFileUpdaterPage , TripDetails , MainPage , FileOpenPickerPage , FileSavePickerPage , MainPage , TripListView , sealed , MainPage , ShareTarget , MainPage
  • ForceEquirectangularSphericalVideoFrameFormat() : ContentSelector
  • ForceReset_Click() : Scenario2
  • FormatComboBox_SelectionChanged() : sealed , Scenario2_FindAvailableSourceGroups
  • FormatDownloadedRanges() : sealed , Scenario5_RandomAccess
  • FormatError() : SdkSample
  • FormatTimeString() : SeekBarElement
  • FormatValueByPresentation() : Scenario2_Client
  • FrameFormatModel() : sealed , FrameFormatModel
  • FrameRate() : sealed
  • FrameReader_FrameArrived() : sealed , Provider , sealed , Scenario1_DisplayDepthColorIR
  • FrameRenderer() : FrameRenderer , sealed
  • FrameRenderer::DrainBackBufferAsync() : FrameRenderer
  • FrameSourceGroupModel() : FrameSourceGroupModel , sealed
  • FrameSourceInfoModel() : FrameSourceInfoModel , sealed
  • FrameStepBackward_Click() : MPEUserControl
  • FrameStepForward_Click() : MPEUserControl
  • FromIdAsync() : sealed
  • FromItem() : ItemViewModel
  • FromMFSample() : CBufferPacket
  • fromStorageFile() : FileItem
  • Front() : List< T >
  • FrontPosition() : List< T >
  • FulfillConsumableButton_Click() : sealed , Scenario3_UnmanagedConsumable , sealed , Scenario4_ConsumableProduct
  • FullName() : IEmployee , Employee , IEmployee , Employee , Manager
  • Functions() : Functions , sealed
  • FxCompile() : FxCompile
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- g -

  • GalleryGridView_ItemClick() : sealed , VideoGallery
  • GameActive() : Simple3DGame
  • GameCamera() : Simple3DGame
  • GameHud() : GameHud
  • GameInfoOverlay() : GameInfoOverlay
  • GameInfoOverlayLowerRight() : GameRenderer
  • GameInfoOverlayUpperLeft() : GameRenderer
  • GameInfoOverlayVisible() : GameRenderer
  • GameMain() : GameMain
  • GameObject() : GameObject
  • GamepadWithButtonState()
: BasicHologramMain::GamepadWithButtonState
, HolographicTemplateAppMain::GamepadWithButtonState
  • GameRenderer() : GameRenderer
  • GameTimer() : GameTimer
  • GameUIControl() : GameRenderer
  • GeneralAuthenticate() : GeneralAuthenticate
  • GenerateAudioData() : Scenario3_FrameInput
  • GenerateBiography() : Contact
  • GenerateCommandLineCommands() : FxCompile
  • GeneratedBitmapButton_Click() : Scenario2_Effects
  • GeneratedBitmapEffect_UpdateRequested() : Scenario2_Effects
  • GenerateDefaultSettings() : sealed , ManipulationInputProcessor
  • GenerateFirstName() : Contact
  • GenerateFullPathToTool() : FxCompile
  • GenerateGeofence() : Scenario4_ForegroundGeofence
  • GenerateImageSource() : Item
  • GenerateLastName() : Contact
  • GenerateMesh() : WaveEffect
  • GeneratePageAsync() : sealed , PhotosPrintHelper
  • GeneratePhoneNumber() : Contact
  • GeneratePosition() : Contact
  • GenerateRandomNumber_Click() : KeepConnectionOpenScenario , OpenCloseConnectionScenario , KeepConnectionOpenScenario , OpenCloseConnectionScenario
  • GenerateRandomNumber_Clicked() : Scenario3_LaunchAppServices
  • GenerateReportDescription() : GeofenceBackgroundTask
  • GenerateResponseFileCommands() : FxCompile
  • GenerateSampleBuffer() : ToneSampleGenerator
  • GenerateSamples() : ToneSampleGenerator::SineSampleInfo
  • GenerateSampleStream() : Scenario05_PostStream
  • GenerateSecondaryTile() : TilesHelper
  • GenerateSineSamples() : ToneSampleGenerator
  • GenerateSizePreferenceBinding() : Scenario1
  • GenerateTileId() : Scenario1_CreateTile
  • GenerateVisitDescription() : VisitBackgroundTask
  • GeneratorIncrementalLoadingClass() : GeneratorIncrementalLoadingClass-g< T >
  • GeofenceBackgroundTask() : GeofenceBackgroundTask
  • get() : unique_shared_work_queue , unique_cotaskmem_ptr< T >
  • get_Bread() : WrlFinal
  • get_Capacity() : CMediaBufferWrapper
  • get_DisplayMessage() : InvalidPageException
  • get_Flavor() : WrlFinal
  • get_Length() : CMediaBufferWrapper
  • get_Volume() : WrlFinal
  • GetAccounts() : sealed
  • GetActivationFactory() : WrlFinal
  • GetActivitySensorAsync() : sealed
  • GetAddress() : sealed
  • GetAidGroupById() : NfcUtils
  • GetAlbums() : MainViewModel
  • GetAll() : AzureDataProvider , ItemsDataProvider
  • GetAllAccounts() : MultipleAccountsScenario
  • GetAllItems() : ItemsDataSource
  • GetAllJoynMessageArg() : TypeConversionHelpers
  • GetAllocatedBlob() : CBaseAttributes< TBase >
  • GetAllocatedString() : CBaseAttributes< TBase >
  • GetAllProviders() : MultipleAccountsScenario
  • GetAmplitude() : RippleEffect
  • GetAppLanguagesAsFormattedString() : sealed , Scenario8
  • GetApplicationLink() : SharePage
  • GetAppLocalSettingsValueAsBool() : sealed
  • GetAppLocalSettingsValueAsObject() : sealed
  • GetAppLocalSettingsValueAsString() : sealed
  • GetAssociatedProductsButton_Click() : Scenario2_InAppPurchase , sealed
  • GetAt() : sealed , GroupInfoList
  • GetAudioBuffer() : Player
  • GetAudioStream() : Period
  • GetAvgFrameTime() : GpuPerformanceTimer
  • GetBack() : List< T >
  • GetBackBufferDXGIFormat() : CameraResources
  • GetBackBufferRenderTargetView() : CameraResources , DeviceResources , CameraResources , DeviceResources , CameraResources
  • GetBackBufferRenderTargetViewRight() : DeviceResources
  • GetBackBufferTexture2D() : CameraResources
  • GetBackgroundTaskStatus() : BackgroundTaskSample
  • GetBehavior() : HttpMeteredConnectionFilter
  • GetBitrateSymbol() : BitrateHelper
  • GetBlendState() : CameraResources
  • GetBlob() : CBaseAttributes< TBase >
  • GetBlobSize() : CBaseAttributes< TBase >
  • GetBooleanInputReport_Click() : sealed , InputOutputReports
  • GetBooleanInputReportAsync() : sealed , InputOutputReports
  • GetBoolParameterWithDefault() : FxCompile
  • GetBoundingBox() : ControlBase , IControl
  • GetBuffer() : IMemoryBufferByteAccess , ApduCommand
  • GetBufferFramesPerPeriod() : WASAPIRenderer
  • GetBufferFromString() : MainPage , SampleState , MainPage
  • GetBufferLength() : ToneSampleGenerator
  • GetBuffersStatus_Click() : Scenario6
  • GetBusObject() : AllJoynBusObjectManager
  • GetButton_Click() : sealed , Scenario5_GetSingleDevice
  • GetBytes() : Scenario1
  • GetCallbackCount() : ServiceViewModel
  • GetCameraCaptureOrientation() : sealed , CameraRotationHelper
  • GetCameraOrientation() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • GetCameraOrientationRelativeToNativeOrientation() : sealed , CameraRotationHelper
  • GetCameraPreviewOrientation() : sealed , CameraRotationHelper
  • GetCameraToWorld() : sealed
  • GetCenter() : RippleEffect
  • GetCertificateInformation() : sealed , Scenario5
  • GetCharacteristics() : CMediaSink , CMediaSource
  • GetChrominanceTexture() : NV12VideoTexture
  • GetClientCertificateAsync() : sealed , Scenario3_ClientAuthentication
  • GetClustersForZoomLevel() : sealed , Scenario7
  • GetCO2Level() : sealed , Scenario2_Polling
  • GetCollections() : MainViewModel
  • GetColor() : Tool
  • getColor() : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • GetConfigurationDescriptorAsString() : Scenario5_UsbDescriptors
  • GetConnectionCostInfo() : GetConnectionProfiles
  • GetConnectionProfile() : GetConnectionProfiles
  • GetConnectionProfiles() : GetConnectionProfiles
  • GetConnectionProfilesButton_Click() : GetConnectionProfiles
  • GetConnectivityLevelAsString() : sealed
  • GetConsumableBalanceButton_Click() : sealed , Scenario3_UnmanagedConsumable , Scenario4_ConsumableProduct , sealed
  • GetContactListAsync() : Scenario1_CreateContact
  • GetContactResult() : MainPage
  • GetContacts() : Contact
  • GetContactsGrouped() : Contact
  • GetContent() : BadgeNumericNotificationContent
  • GetContentAsync() : Scenario6_NavToStream::StreamUriWinRTResolver
  • GetContentSize() : DeviceResources
  • GetContentZoomFactor() : DeviceResources
  • GetContext() : CMarker
  • GetCookies_Click() : Scenario09_GetCookie
  • GetCoordinateSystemForCurrentStage() : SpatialStageManager
  • GetCount() : CBaseAttributes< TBase > , List< T >
  • GetCriticalSection() : LowLatencyInputMain , GameMain
  • GetCurrent() : CBufferEnumerator
  • GetCurrentButton_Click() : sealed , Scenario3_CurrentStepCount
  • GetCurrentDeviceInfo() : BroadbandDevice
  • GetCurrentFormat() : VideoFrameProcessor
  • GetCurrentLength() : CMediaBufferWrapper
  • GetCurrentMediaType() : CStreamSink
  • GetCurrentMessage() : sealed
  • GetCurrentStrokesView() : sealed , Scenario9
  • GetCurrentTool() : SourceHandler
  • GetCurrentTransform() : CustomTextRenderer , FontNameCollector
  • GetCustomData() : sealed
  • GetCustomDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetCustomerCollectionsId() : sealed , Scenario7_B2B
  • GetCustomerFooter() : sealed , Scenario2_PrintReceipt
  • GetCustomerPurchaseId() : sealed , Scenario7_B2B
  • GetCustomProfile() : sealed , Scenario2_Custom
  • GetD2DDevice() : DeviceResources
  • GetD2DDeviceContext() : DeviceResources
  • GetD2DFactory() : DeviceResources
  • GetD2DTargetBitmap() : DeviceResources
  • GetD2DTargetBitmapRight() : DeviceResources
  • GetD3DDevice() : DeviceResources
  • GetD3DDeviceContext() : DeviceResources
  • GetD3DInteropDevice() : DeviceResources
  • GetData() : AudioFileReader , AudioStreamReader , TlvEntry , GetData , sealed , Scenario2_Polling , CSourceOperation , AudioFileReader
  • GetDataIn() : Check , Update
  • GetDataLabelString() : DataHelpers
  • GetDataModelForCurrentListViewFlyout() : sealed , Scenario2 , Scenario3
  • GetDataPlanStatusInfo() : GetConnectionProfiles
  • GetDataSoure() : FileDataSource , FileDataSource2
  • GetDataString() : DataHelpers
  • GetDefaultAsyncBtn_Click() : sealed , Scenario1_GetLamp
  • GetDefaultProvidersAndAccounts() : sealed
  • GetDefaultStrokeSize() : SceneComposer::InkObject
  • GetDependencies_Click() : sealed , Scenario3
  • GetDepthBufferTexture2D() : CameraResources
  • GetDepthStencilTexture2D() : CameraResources
  • GetDepthStencilView() : CameraResources , DeviceResources , CameraResources , DeviceResources , CameraResources
  • GetDeviceDescriptorAsString() : Scenario5_UsbDescriptors
  • GetDeviceFeatureLevel() : DeviceResources
  • GetDeviceInformationCollection() : MidiDeviceWatcher
  • GetDeviceResources() : _360VideoPlaybackMain
  • GetDeviceSpecificProperties() : sealed , Scenario2
  • GetDeviceStateEvent() : WASAPICapture , WASAPIRenderer
  • GetDeviceSupportsVprt() : DeviceResources
  • GetDeviceType() : Utilities
  • GetDiameter() : Tool
  • GetDictionaryTypeSignatures() : TypeConversionHelpers
  • GetDisplayNameOrGenericNameAsync() : Scenario2_WatchUsers
  • GetDisplaySizeInInches() : sealed
  • GetDouble() : CBaseAttributes< TBase >
  • GetDpi() : DeviceResources
  • GetDPI() : DeviceResources , SceneComposer
  • GetDropMode() : CMediaStream
  • GetDuration() : OmnidirectionalSound
  • GetDWriteFactory() : DeviceResources
  • GetDXGIAdapter() : DeviceResources
  • GetElapsedSeconds() : StepTimer
  • GetElapsedTicks() : StepTimer
  • GetElementLocation() : MainPage
  • GetElementMargin() : BaseElement
  • GetElementRect() : MainPage , Scenario1 , CustomEditControl , Scenario3_SecondaryTiles , SampleHelpers , MainPage
  • GetElementSize() : BaseElement
  • GetEndpointDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetEnumerator() : IncrementalLoadingBase , CBufferPacket , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2
  • GetEnvironment() : OmnidirectionalSound , CardioidSound , CustomDecaySound , OmnidirectionalSound
  • GetEvent() : CMediaSource , CMediaStream , CStreamSink
  • GetExecutionDeferral() : sealed , MultipleTasks
  • GetExtension() : BasicLoader
  • GetFacebookUserNameAsync() : Scenario1_Facebook
  • GetFeed_Click() : sealed , S1_GetAFeed
  • GetFileButton_Click() : sealed , Scenario11
  • GetFileFromFutureAccessListButton_Click() : sealed , Scenario5_TriggerCFU
  • GetFilesAndFoldersButton_Click() : sealed , Scenario1
  • GetFilesButton_Click() : sealed , Scenario3 , Scenario4 , Scenario3 , Scenario4
  • GetFileStatusStringAsync() : Scenario4
  • GetFileToLaunch() : Scenario1_LaunchFile
  • GetFirmwareEnvironmentVariable() : FirmwareAccess
  • GetFirstBarcodeScannerAsync() : DeviceHelpers
  • GetFirstCashDrawerAsync() : DeviceHelpers
  • GetFirstMagneticStripeReaderAsync() : DeviceHelpers
  • GetFirstRequestBlock() : ItemCacheManager< T >
  • GetFirstSmartCardReaderInfo() : SmartCardReaderUtils
  • GetFontNames() : FontNameCollector , sealed
  • GetFormat() : AudioFileReader , AudioStreamReader , AudioFileReader
  • GetFrameCount() : StepTimer
  • GetFramesPerSecond() : StepTimer
  • GetFrameTime() : GpuPerformanceTimer
  • GetFrequency() : RippleEffect
  • GetFriendlyName() : sealed , StreamResolution , Helpers
  • GetFromFile() : Scenario1_CreateTile
  • GetFromID() : AzureDataProvider , ItemsDataProvider
  • GetFromPackage() : Scenario1_CreateTile
  • GetFront() : List< T >
  • GetGeolocationButtonClicked() : Scenario2_GetPosition
  • GetGeometryShader() : DeviceResources
  • GetGeotagButton_Click() : sealed , Scenario1_Geotag
  • GetGroups_Click() : Scenario4_CharacterGrouping
  • GetGUID() : CBaseAttributes< TBase >
  • GetGyrometerSample() : sealed , Scenario3_Porting
  • GetHashCode() : DecodeResult
  • GetHistoricalBytes() : GetHistoricalBytes
  • GetHistory_Click() : Scenario2_History , sealed
  • GetHitTestState() : sealed
  • GetHolographicCamera() : CameraResources
  • GetId() : CMediaStream
  • GetIdentifier() : CStreamSink
  • GetIgnoreLayout() : BaseElement
  • GetImageInformationAsync() : Scenario2
  • GetImagePropertiesForDisplay() : Scenario1
  • GetImageSource() : DeviceResources
  • GetImageSourceNative() : DeviceResources
  • GetInitializationStatus() : OmnidirectionalSound
  • GetInkingSubstate() : sealed
  • GetInkStroke() : SceneComposer::InkObject
  • GetInputLayout() : DeviceResources
  • GetInstalledLocation_Click() : Scenario2 , sealed
  • GetInterface() : InteropStatics::IDirect3DDxgiInterfaceAccess
  • GetInterfaceDescriptorsAsString() : Scenario5_UsbDescriptors
  • GetInterfaceSetting() : Scenario6_InterfaceSettings
  • GetInterfaceSetting_Click() : Scenario6_InterfaceSettings
  • GetInternalBusAttachment() : AllJoynHelpers
  • GetInternalBusObject() : AllJoynHelpers
  • GetIsActive() : final
  • GetIsRenderPassNeeded() : BaseElement
  • GetIsUpperCaseEnabledAsync() : ISecureInterfaceService , sealed , SecureInterfaceService
  • GetIsVisible() : BaseElement
  • GetItem() : Scenario5_RestoreScrollPosition , CBaseAttributes< TBase > , List< T > , ComPtrList< T, NULLABLE > , Scenario5_RestoreScrollPosition
  • GetItemById() : ItemsDataSource
  • GetItemByIndex() : CBaseAttributes< TBase >
  • GetItemIndex() : sealed
  • GetItemPos() : List< T >
  • GetItems() : Item
  • GetItemType() : CBaseAttributes< TBase >
  • GetKey() : Scenario5_RestoreScrollPosition
  • GetKnownAzureMediaServicesModels() : AdaptiveContentModel
  • GetLampArrayIndices() : Scenario2_Effects
  • GetLastActiveTime() : final
  • GetLastError() : FirmwareAccess
  • GetLastErrorAsync() : IOnboardingService , sealed , OnboardingService
  • GetLastErrorMessage() : CommonLicenseRequest
  • GetLastUpdateTime() : RealtimeSurfaceMeshRenderer , final
  • GetLastVisitButtonClicked() : Scenario6_GetLastVisit
  • GetLatestFaces() : FaceTrackerProcessor
  • GetLatestFrame() : CameraStreamProcessor , VideoFrameProcessor
  • GetLedBlinkPattern_Click() : sealed , FeatureReports
  • GetLedBlinkPatternAsync() : sealed , FeatureReports
  • GetLength() : HttpJsonContent
  • GetLicense() : ProactiveViewModel
  • GetLicenseState() : Scenario1_TrialMode , sealed
  • GetLineMetrics() : sealed
  • GetLog() : InkEventLogger
  • GetLogicalSize() : DeviceResources
  • GetLogoBackgroundColor() : sealed , ShareApplicationLink
  • GetLowestBitrateRepresentation() : DashManifestParser
  • GetLuminanceTexture() : NV12VideoTexture
  • GetMainViewId() : sealed
  • GetMajorType() : CStreamSink
  • GetManagedConsumablesButton_Click() : sealed , Scenario4_ConsumableProduct
  • GetManufacturerName_Click() : sealed , FirmwareAccess
  • GetManufacturerNameFromSmbios() : FirmwareAccess
  • GetMany() : GroupInfoList
  • GetMapCoordinates() : PlaceLocation
  • GetMapFromVariant() : TypeConversionHelpers
  • GetMarkerType() : CMarker
  • GetMarkerValue() : CMarker
  • GetMarshalSizeMax() : CMediaBufferWrapper
  • GetMaxFrameTime() : GpuPerformanceTimer
  • GetMediaPlayer() : sealed
  • GetMediaSink() : CStreamSink
  • GetMediaSource() : CMediaStream
  • GetMediaTypeByIndex() : CStreamSink
  • GetMediaTypeCount() : CStreamSink
  • GetMediaTypeFromFileContentType() : Scenario1
  • GetMediaTypeHandler() : CStreamSink
  • GetMemoryUsageText() : App
  • GetMerchantFooter() : sealed , Scenario2_PrintReceipt
  • GetMeteringData() : ServiceViewModel , Metering
  • GetMFExtensions() : sealed
  • GetMFSample() : WASAPIRenderer
  • GetMinFrameTime() : GpuPerformanceTimer
  • GetMouseProperties() : sealed , Scenario2
  • GetNetworkAuthenticationTypeAsString() : sealed
  • GetNetworkCost_Click() : Scenario2_NetworkCost
  • GetNetworkCostGuidance() : Helpers
  • GetNetworkEncryptionTypeAsString() : sealed
  • GetNetworkSecuritySettingsInfo() : GetConnectionProfiles
  • GetNewContact() : Contact
  • GetNewItem() : Item
  • GetNewSegmentIndexFromNewStream() : LiveSourceBufferManager
  • GetNextSegment() : LiveSourceBufferManager
  • GetNfcProvHeaderSize() : Scenario1
  • GetNonce() : Scenario2_Twitter
  • GetNormal() : QuadRenderer
  • GetNumericInputReport_Click() : sealed , InputOutputReports
  • GetNumericInputReportAsync() : sealed , InputOutputReports
  • GetObjectPath() : AllJoynHelpers
  • GetOnboardeeNetworkListAsync() : Scenario2ViewModel
  • GetOnboardingConfiguration() : Scenario2ViewModel
  • GetOpenWithPosition() : Scenario1_LaunchFile
  • GetOperationType() : CSourceOperation
  • GetOrientationReport() : Scenario1_Basics
  • GetOrientationTransform2D() : DeviceResources
  • GetOrientationTransform3D() : DeviceResources
  • GetOrRegisterHceBackgroundTask() : NfcUtils
  • GetOsrFx2SevenSegmentAsync() : Scenario2_ControlTransfer
  • GetOsrFx2SevenSegmentSetting_Click() : Scenario2_ControlTransfer
  • GetOtherDisplayRegion() : Scenario2_DisplayRegion
  • GetOutputSize() : DeviceResources
  • GetOutputWaveFormatEx() : MediaReader
  • GetPackage_Click() : Scenario1 , sealed
  • GetParameters() : AsyncCallback< T > , EmbeddedMFAsyncCallback< Callback >
  • GetParent_Click() : Scenario2 , sealed
  • GetPartialStroke() : sealed , Scenario9
  • GetPassportAuthenticationMessageAsync() : sealed , SignIn
  • GetPasswordCredentialFromUserAsync() : sealed , Scenario9_CustomPairDevice
  • GetPathToScenario() : ScenarioGroup
  • GetPathToScenarioHelper() : ScenarioGroup
  • GetPenProperties() : Scenario2 , sealed
  • GetPerformanceFrequency() : StepTimer
  • GetPhase() : RippleEffect
  • GetPicturesLibrary() : sealed , Scenario3
  • GetPinFromUserAsync() : sealed , Scenario9_CustomPairDevice
  • GetPinValue_Click() : Scenario1_GetAndSetPin , sealed , Scenario1_GetAndSetPin
  • GetPixelShader() : DeviceResources
  • GetPixelsPerDip() : CustomTextRenderer , FontNameCollector
  • GetPlaceHolderImage() : MainPage
  • GetPlaybackPosition() : Scenario7_LiveSeekableRange
  • GetPointerProperties() : sealed , Scenario2
  • GetPointerToPixelData() : sealed
  • GetPoses() : sealed
  • GetPosition() : SpinningCubeRenderer , IControl , ControlBase , SourceHandler , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , QuadRenderer
  • GetPresentationClock() : CMediaSink
  • GetPresentationDescriptor() : CStartOperation
  • GetPresetProfile() : sealed , Scenario1_Default , sealed , Scenario3_Trim
  • GetPreviewFrameAsD3DSurfaceAsync() : sealed , MainPage
  • GetPreviewFrameAsSoftwareBitmapAsync() : sealed , MainPage
  • GetPreviewFrameButton_Click() : MainPage , sealed
  • GetPreviewStreamRectInControl() : sealed , MainPage
  • GetPrintPreviewPage() : sealed , PhotosPrintHelper , PrintHelper
  • GetProductName() : Scenario5_UsbDescriptors
  • GetPropertyDisplayValue() : sealed , Scenario3
  • GetPropertyForDisplay() : DeviceInformationDisplay , sealed , DeviceInformationDisplay
  • GetProvider() : SingleAccountScenario , MultipleAccountsScenario
  • GetProviders() : sealed
  • GetProvidersAndAccounts() : sealed
  • GetProvisioningInfo_Click() : Scenario3 , sealed
  • GetProvisioningInfoAsync() : DiscoveredDeviceWrapper , sealed
  • GetPtrAt() : BufferHelper
  • GetPublicKey() : SubjectPublicKeyInfo
  • GetPublicKeyForUser() : DAL
  • GetPublisherCert() : SecureStopViewModel
  • GetQualityLevel() : CMediaStream
  • GetQueryDelegate() : S7_RetrieveWithAppContent
  • GetRadialControllerMenuItemFromSender() : Scenario1_EventAndMenuHookup , sealed
  • GetRandomVideo() : AzureDataProvider , ItemsDataProvider
  • GetRate() : CSetRateOperation , CMediaSource
  • GetRatio() : CBaseAttributes< TBase >
  • GetRemoteIdForContactAsync() : AppContactPanel
  • GetRenderCount() : DistanceFieldRenderer
  • GetRenderTargetSize() : CameraResources , DeviceResources , CameraResources
  • GetResourceString() : sealed
  • GetResourceStringAndFormat() : sealed
  • GetResultAsync() : sealed
  • GetRetriesValue() : HttpRetryFilter
  • GetRotation() : ControlBase , IControl
  • GetSampleData() : sealed , SampleDataModel , Scenario1_ListView , SampleDataModel
  • GetSampler() : TextRenderer
  • GetScale() : IControl , ControlBase
  • GetScanInfoAsync() : sealed , IOnboardingService , OnboardingService , sealed
  • GetScenarioIdForLaunch() : MainPage
  • GetSceneSelectionRect() : SceneComposer
  • GetScreenViewport() : DeviceResources
  • GetSecureBootEnabledFromUefi() : FirmwareAccess
  • GetSelectedCeremonies() : Scenario9_CustomPairDevice , sealed
  • GetSelectedDevice() : DeviceList
  • GetSelectedDeviceId() : DeviceList
  • GetSelectedFeedbackOrFallback() : Scenario3_InkingFeedback , Scenario4_InteractionFeedback , Scenario3_InkingFeedback
  • GetSelectedItemTag< T >() : Helpers
  • GetSelectedPeriod() : Manifest
  • GetSelectedRanges() : FileDataSource2
  • GetSelectedStrokes() : InkRenderer
  • GetSelectedStrokeSize() : SceneComposer::InkObject
  • GetSelectionRectangle() : InkRenderer
  • GetService() : CMediaSource , CMediaStream
  • getShape() : SceneComposer::ShapeObject
  • GetShareContent() : sealed , SetErrorMessage , ShareDelayRenderedFiles , ShareFiles , ShareHtml , SharePage , sealed , ShareText , ShareImage , ShareCustomData , SharePage , ShareCustomProvider , ShareApplicationLink , sealed , ShareWebLink , sealed
  • GetSignature() : Scenario2_Twitter
  • GetSize() : sealed::sealed , AudioStreamReader , AudioFileReader , CBaseAttributes< TBase >
  • GetSkewX() : WaveEffect
  • GetSkewY() : WaveEffect
  • GetSliderPositionAtPlaybackPosition() : Scenario7_LiveSeekableRange
  • GetSmartCard() : MainPage
  • GetSnappedPoint() : Scenario5_InkingAndInteractionFeedback
  • GetSocket() : CNetworkChannel
  • GetSourceHandler() : HolographicPaintMain
  • GetSourceKind() : SourceHandler
  • GetSpread() : RippleEffect
  • GetStartingSegmentIndexForLive() : MediaStream
  • GetStartTime() : CMediaSink
  • GetState() : sealed , CMediaStream
  • GetStateAsync() : sealed , IOnboardingService , sealed , OnboardingService
  • GetStatus() : PropertySetContext , PropertyGetContext< T > , PropertySetContext
  • GetStepsHelperControl() : StepsControl
  • GetStereoState() : DeviceResources
  • GetStreamById() : CMediaSource
  • GetStreamDescriptor() : CMediaStream
  • GetStreamSinkById() : CMediaSink
  • GetStreamSinkByIndex() : CMediaSink
  • GetStreamSinkCount() : CMediaSink
  • GetStreamStatus_Click() : Scenario7
  • GetString() : CBaseAttributes< TBase >
  • GetStringFromBuffer() : SampleState , MainPage
  • GetStringLength() : CBaseAttributes< TBase >
  • GetStrokeContainer() : InkRenderer
  • GetStrokeContainerForTemp() : InkRenderer
  • getStrokes() : SceneComposer::InkObject
  • GetStrokeThickness() : Rectangle
  • GetSubtypeForFrameReader() : sealed
  • GetSuperMuttLedBlinkPattern_Click() : Scenario2_ControlTransfer
  • GetSuperMuttLedBlinkPatternAsync() : Scenario2_ControlTransfer
  • GetSwapChain() : DeviceResources
  • GetSwapChainPanel() : DeviceResources
  • GetSwitch() : Button
  • GetSystemTimeAsFileTime() : ServiceViewModel
  • GetTargetAspectRatio() : CameraCoordinateMapper
  • GetTargetShaderResourceView() : CameraCoordinateMapper
  • GetTaskGroup() : BackgroundTaskSample
  • GetTextboxSelectionRect() : Scenario2
  • GetTextLayoutLineMetrics() : sealed
  • GetTexture() : DistanceFieldRenderer , TextRenderer , NV12VideoTexture , TextRenderer , DeviceResources
  • GetThumbnailButton_Click() : sealed , Scenario5 , sealed , Scenario1 , sealed , Scenario3 , Scenario5 , Scenario2 , sealed , Scenario4 , sealed , Scenario4 , Scenario1 , Scenario3 , Scenario2
  • GetTicks() : StepTimer
  • GetTime() : Functions , sealed
  • GetTimeStamp() : LoggingSessionScenario , FileLoggingSessionScenario , Scenario2_Twitter
  • GetTimeStampedMessage() : PlaybackControl
  • GetTimeStr() : sealed
  • GetTitleHeightInDips() : SampleOverlay
  • GetTokenFromAzureOAuthAsync() : Scenario7_B2B , sealed
  • GetTokenSilent() : DefaultAccountScenario
  • GetToneSample() : WASAPIRenderer
  • GetToolPosition() : SourceHandler
  • GetToolScale() : SourceHandler , SpatialControllerHandler
  • GetTotalLength() : CBufferPacket
  • GetTotalSeconds() : StepTimer
  • GetTotalTicks() : StepTimer
  • GetTouchProperties() : sealed , Scenario2
  • GetTwitterRequestTokenAsync() : Scenario2_Twitter
  • GetTwitterUserNameAsync() : Scenario2_Twitter
  • getType()
: SceneComposer::SceneObject
, SceneComposer::InkObject
, SceneComposer::ShapeObject
  • GetUid() : GetUid
  • GetUidAsync() : AccessHandler
  • GetUINT32() : CBaseAttributes< TBase >
  • GetUINT64() : CBaseAttributes< TBase >
  • GetUIOrientation() : sealed , CameraRotationHelper
  • GetUnknown() : CBaseAttributes< TBase >
  • GetUnmanagedConsumablesButton_Click() : sealed , Scenario3_UnmanagedConsumable
  • GetUnmarshalClass() : CMediaBufferWrapper
  • GetUpdateRects() : DeviceResources
  • GetUserCollectionButton_Click() : Scenario5_UserCollection , sealed
  • GetUserConfirmationAsync() : sealed , Scenario9_CustomPairDevice
  • GetUserViewModelsAsync() : MainPage
  • GetValue() : PropertyGetContext< T > , LookupTable< T, LookupTableSize >
  • GetValueFromVariant() : TypeConversionHelpers
  • GetValueWithDefault< T >() : ConfigStore
  • GetVariantArg() : TypeConversionHelpers
  • GetVariantStructureArg() : TypeConversionHelpers
  • GetVelocity() : QuadRenderer , SpinningCubeRenderer
  • GetVersionAsync() : sealed , OnboardingService , sealed , IOnboardingService
  • GetVertexShader() : DeviceResources
  • GetVideoBuffer() : Player
  • GetVideoProfileSupportedDeviceIdAsync() : sealed , Scenario1_SetRecordProfile , Scenario2_ConcurrentProfile , sealed , Scenario3_EnableHdrProfile
  • GetVideoStream() : Period
  • GetView() : GroupInfoList
  • GetViewport() : CameraResources
  • GetViewSize() : DeviceResources
  • GetWallClockTime() : DashManifestParser
  • GetWaveOffset() : WaveEffect
  • GetWebAccount() : SingleAccountScenario
  • GetWicImagingFactory() : DeviceResources
  • GetWindow() : DeviceResources
  • GetWlanConnectionProfileDetailsInfo() : GetConnectionProfiles
  • GetWorldToCamera() : sealed
  • GetWriter() : sealed
  • GetWwanConnectionProfileDetailsInfo() : GetConnectionProfiles
  • GiftDispatch() : GiftDispatch
  • GlyphBitmapImage() : BluetoothLEDeviceDisplay , DeviceInformationDisplay
  • Go_Click() : Scenario1_LanguageDetection , Scenario2_ScriptDetection , Scenario1_LanguageDetection , Scenario3_Transliteration , Scenario2_ScriptDetection , Scenario3_Transliteration
  • GoBack() : INavigationService
  • goBack() : MainPage
  • GoBack() : NavigationService
  • GoButton_Click() : Scenario1_NavToUrl
  • GoToLive() : LiveDashPlayer , ILivePlayer
  • GoToLive_Click() : Scenario7_LiveSeekableRange
  • GoToLiveEdge() : Player , LiveSourceBufferManager
  • GoToMain_Click() : SecondaryViewPage
  • GoToScenario() : MainPage
  • GoToStart_Click() : Scenario7_LiveSeekableRange
  • gotToLiveButton_Click() : LiveDashPlayer
  • GpuCoordinateMapper() : GpuCoordinateMapper
  • GpuPerformanceTimer() : GpuPerformanceTimer
  • Graph_Click() : Scenario5_InboxEffects , Scenario1_FilePlayback , Scenario6_CustomEffects
  • Graph_UnrecoverableErrorOccurred() : Scenario2_DeviceCapture
  • GraphButton_Click() : Scenario4_Submix
  • GreenButton_Click() : sealed
  • Grid1_ContainerContentChanging() : Scenario1 , Scenario2
  • GroupByHelper() : sealed
  • GroupByHelperAsync() : Scenario2
  • GroupByMonthButton_Click() : Scenario2 , sealed
  • GroupByRatingButton_Click() : Scenario2 , sealed , Scenario2
  • GroupByTagButton_Click() : Scenario2 , sealed
  • GroupComboBox_SelectionChanged() : Scenario2_FindAvailableSourceGroups , sealed
  • GroupedBackgroundTask() : GroupedBackgroundTask , sealed , GroupedBackgroundTask , sealed
  • GroupInfoList() : GroupInfoList
  • GroupNameLocalizedResource_Click() : Scenario3_CustomItems , sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- h -

  • HandHandler() : HandHandler
  • HandleCard() : CardReader
  • HandleCardAdded() : Scenario1_ProvisionTPM , sealed
  • HandleCardRemoved() : Scenario6_DeleteTPM , sealed , Scenario6_DeleteTPM
  • HandleClipboardChanged() : SampleState , MainPage
  • HandleConnectionRequestAsync() : Scenario1_Advertiser
  • HandleDeviceLost() : DeviceResources
  • HandleDeviceRestored() : GameMain
  • HandleDownloadAsync() : sealed , Scenario1_Download , Scenario6_RecoverableErrors , Scenario16_NetworkResource
  • HandleError() : CMediaSink , CMediaSource , CMediaStream , CStreamSink , sealed
  • HandleFollowCircleInput() : sealed , Scenario8
  • HandleHceActivation() : sealed
  • HandleIoException() : MainPage
  • HandleManifestReload() : LiveSourceBufferManager
  • HandlePlaybackListChanges() : PlayerViewModel
  • HandleProtocolLaunch() : SecondaryViewPage
  • HandleReceivedMessage() : SocketWrapper
  • HandleRecognitionResult() : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • HandleRegularInput() : sealed , Scenario8
  • HandleUploadAsync() : sealed , Scenario2_Upload
  • HandShakeComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • HapticCanvas_Entered() : Scenario3_InkingFeedback
  • HapticCanvas_Exited() : Scenario3_InkingFeedback
  • HardwareButtons_CameraPress() : sealed
  • HardwareButtons_CameraPressed() : MainPage , sealed , MainPage , sealed , MainPage , sealed , Scenario1_Basics
  • HardwareDRMViewModel() : HardwareDRMViewModel
  • HasAccountStored() : SingleAccountScenario
  • HasMoreItemsOverride() : GeneratorIncrementalLoadingClass-g< T > , IncrementalLoadingBase
  • HasRangesChanged() : ItemCacheManager< T >
  • HasSameFormat() : sealed , FrameFormatModel
  • HasSelection() : CustomEditControl
  • HasStrokesToErase() : InkRenderer
  • HasSurface() : RealtimeSurfaceMeshRenderer
  • HdcpDesiredMinimumProtection_Click() : Scenario3_RequestModification
  • HeaderChanged() : TitledImage
  • Headers() : HttpJsonContent
  • Height() : sealed
  • HeightSlider_ValueChanged() : sealed
  • HeroArticlesViewModel() : HeroArticlesViewModel
  • HexDump() : sealed , ReadBytes
  • HexStringToBytes() : NfcUtils
  • Hide() : CalibrationBar , MediaTransportControls , sealed , CalibrationBar , sealed
  • HideCursor() : MoveLookController
  • HideDescriptionOnSmallScreen() : Scenario4_Tuning , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange
  • HideGameInfoOverlay() : IGameUIControl , GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed
  • HideGuidance() : CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar
  • HideGuidanceButton_Click() : CalibrationBar , sealed , CalibrationBar , sealed , CalibrationBar , sealed
  • HideInactiveMeshes() : RealtimeSurfaceMeshRenderer
  • HideLoadUri() : ContentSelector
  • HidePairingPanel() : Scenario9_CustomPairDevice , sealed
  • HidePreviewButton_Click() : Scenario5_DisplayingBarcodePreview
  • HidePropertyPopUp() : Scenario2 , sealed
  • HideStatus() : MainPage
  • HideTooSmall() : GameInfoOverlay , sealed , IGameUIControl , GameInfoOverlay , IGameUIControl
  • HideView_Click() : SecondaryViewPage
  • HighlightDetectedFaces() : MainPage , sealed
  • HighlightFaces() : MainPage
  • HighlightRanges() : MainPage
  • HighlightTextOnScreen() : Scenario_SynthesizeTextBoundaries
  • HighlightWordOnScreen() : sealed
  • HighScore() : Simple3DGame
  • Histogram() : sealed
  • HistoryAndRoaming() : HistoryAndRoaming
  • HistoryRecord() : HistoryRecord
  • Hit() : GameObject
  • HitMaterial() : GameObject
  • HitSound() : GameObject
  • HitTest() : LowLatencyInputMain , RectRenderer
  • HitTestTargetWithGaze() : HandHandler
  • HitTime() : GameObject
  • HolographicApp1Main() : HolographicApp1Main
  • HolographicFaceTrackerMain() : HolographicFaceTrackerMain
  • HolographicMRCSampleMain() : HolographicMRCSampleMain
  • HolographicPaintMain() : HolographicPaintMain
  • HolographicSpatialMappingMain() : HolographicSpatialMappingMain
  • HolographicSpatialStageMain() : HolographicSpatialStageMain
  • HolographicTagAlongSampleMain() : HolographicTagAlongSampleMain
  • HolographicTemplateAppMain() : HolographicTemplateAppMain
  • HolographicVoiceInputMain() : HolographicVoiceInputMain
  • HoughLines() : sealed
  • HttpJsonContent() : HttpJsonContent
  • HttpMapTileDataSourceUriRequested() : sealed , Scenario12
  • HttpMeteredConnectionFilter() : HttpMeteredConnectionFilter
  • HttpRetryFilter() : HttpRetryFilter
  • Hud() : GameRenderer
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- i -

  • IccDetection() : IccDetection
  • Id() : SymbologyListEntry , DeviceInformationDisplay , User , ViewLifetimeControl , School , Contact , Item , BluetoothLEDeviceDisplay , School , User
  • IFACEMETHOD_() : CBufferPacket , CStreamSink , CBufferEnumerator , CMarker , CMediaBufferWrapper , CustomTextRenderer , CMediaBufferWrapper , CSourceOperation , CustomTextRenderer , CSourceOperation , CMediaSource , CBufferPacket , CMediaSource , CMediaStream , CBufferPacket , CMediaStream , CStreamSink
  • IFACEMETHODIMP_() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftEffect , DftTransform , RippleEffect , WaveEffect
  • IgnoreErrorsAndCustomValidation_Checked() : Scenario15_ServerCertificateValidation
  • Image() : FileExtensions
  • ImagePage() : ImagePage
  • ImagesAndVideo_Checked() : Scenario1
  • ImageSource() : Item
  • ImportableItemWrapper() : ImportableItemWrapper
  • InCircleEdgeZone() : sealed , Scenario8
  • Increment_Local_Click() : Scenario1_Files
  • Increment_LocalCache_Click() : Scenario1_Files
  • Increment_Temporary_Click() : Scenario1_Files
  • IncrementDecrement() : IncrementDecrement
  • IndependentEvent_Click() : sealed
  • IndependentInputOnPointerEntering() : sealed
  • IndependentInputOnPointerExiting() : sealed
  • IndependentInputOnPointerHovering() : sealed
  • IndependentInputOnPointerLost() : sealed
  • IndependentInputOnPointerMoving() : sealed
  • IndependentInputOnPointerPressing() : sealed
  • IndependentInputOnPointerReleasing() : sealed
  • Index() : HomeController
  • IndexOf() : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemCacheManager< T > , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • Individualize() : HardwareDRMViewModel
  • IndividualizeIfNeeded() : ProactiveViewModel
  • InertiaSwitch_Toggled() : sealed , Scenario4 , Scenario5
  • InitalizeAccountsControlDialog() : sealed
  • InitCustomProfileBtn_Click() : sealed , Scenario1_SetRecordProfile
  • initdata() : Scenario1 , Scenario2
  • InitDeviceWatcher() : DeviceList
  • InitDrawerButton_Click() : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • InitialBitrateList_SelectionChanged() : Scenario4_Tuning
  • Initialize() : FilledRectangle , Button , PlayPauseButton , ExitButton , SeekBarElement , MediaTransportControls , AppView , ContentSelector , sealed , Provider , sealed , AppView , sealed , SceneComposer , sealed , VisualProperties , sealed , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , sealed , DftEffect , sealed , RippleEffect , sealed , WaveEffect , sealed , ControlBase , Cursor , IControl , sealed , AudioFileReader , AudioStreamReader , OmnidirectionalSound , ILivePlayer , LiveDashPlayer , Player , SourceBufferManager , App , ScenarioElement , sealed , Simple3DGame , App , PersistentState , Audio , Cylinder , Level , Level1 , Level2 , Level3 , Level4 , Level5 , SoundEffect , Simple3DGame , CBaseAttributes< TBase > , CMediaSource , CMediaStream , CStreamSink , sealed , AudioFileReader , CardioidSound , CustomDecaySound , OmnidirectionalSound , MFSampleGenerator , sealed , BaseControl , BaseElement , Ellipse , FilledEllipse , Rectangle
  • InitializeAmmo() : Simple3DGame
  • InitializeAsync() : Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee , sealed , CaptureDevice , LowLatency , VideoChat , MediaCaptureManager , sealed , Scenario2_DisplayText , Scenario3_UsingWindows
  • InitializeAudioDeviceAsync() : WASAPICapture , WASAPIRenderer
  • InitializeBitrateLists() : Scenario4_Tuning
  • InitializeCameraAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MediaCapturePreviewer , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage
  • InitializeCameraButton_Click() : sealed , Scenario1_PreviewSettings , Scenario2_PhotoSettings , Scenario3_AspectRatio
  • InitializeCapture() : sealed , Scenario4
  • InitializeCaptureAsync() : Scenario2_FindAvailableSourceGroups
  • InitializeController() : sealed , Scenario1_EventAndMenuHookup
  • InitializeDevice() : sealed , Scenario2 , Scenario3
  • InitializeDeviceWatchers() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • InitializeFocusPoint() : BaseControl
  • InitializeForegroundAppAuthentication() : Scenario3_ForegroundApp
  • InitializeGameConfig() : Simple3DGame
  • InitializeGameState() : GameMain
  • InitializeGridLines() : Scenario5_InkingAndInteractionFeedback
  • InitializeLampAsync() : sealed , Scenario3_AvailabilityChanged
  • InitializeLicense() : sealed , GameMain
  • InitializeLicenseCore() : sealed , GameMain
  • InitializeListboxVoiceChooser() : sealed , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries
  • InitializeMainPage() : App
  • InitializeManipulationTransforms() : Scenario5_InkingAndInteractionFeedback
  • InitializeMediaCaptureAsync() : Scenario1_DisplayDepthColorIR , Scenario1_ExampleOperations
  • InitializeOsrFx2DeviceWatcher() : sealed , Scenario1_ConnectDisconnect
  • InitializePageAsync() : AppContactPanel
  • InitializePasswordVaultInTheBackground() : MainPage
  • InitializePlaybackList() : Scenario6
  • InitializeProtectionManager() : PlayReadyHelpers
  • InitializeRecognizer() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PauseAsync , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • InitializeRegisteredSmsBackgroundTasks() : RegisterWithBackgroundTask
  • InitializeRevisionNumber() : Helpers
  • InitializeRfcommServer() : Scenario2_ChatServer
  • InitializeRootFrame() : App
  • InitializeScenario() : ScenarioElement
  • InitializeScopeData() : WASAPICapture
  • InitializeServiceSdpAttributes() : Scenario2_ChatServer
  • InitializeSpeechCommandList() : HolographicVoiceInputMain
  • InitializeSpeechRecognizer() : HolographicVoiceInputMain
  • InitializeStore() : ViewModelLocator
  • InitializeSuperMuttDeviceWatcher() : sealed , Scenario1_ConnectDisconnect
  • InitializeTetheringControls() : Scenario1_ConfigureMobileHotspot
  • InitializeTransforms() : sealed , ManipulationInputProcessor , sealed
  • InitializeUIControls() : sealed
  • InitializeUsingHolographicSpace() : DeviceResources
  • InitializeValues() : OtherBindings , BasicTests , sealed , DataModel , CSharpModel , Functions , ListsAndTemplates , DataModel
  • initializing_previewSetupCompleted() : sealed
  • InitialOf() : Contact
  • Initials() : Contact
  • InitLampBtn_Click() : sealed , Scenario1_GetLamp
  • InitManipulationTransforms() : sealed , Scenario4
  • InitNewComposition() : sealed , VisualProperties
  • InitOptions() : sealed , Scenario4 , Scenario5
  • InitPresentationDescription() : CMediaSource
  • InitRecordProfileBtn_Click() : sealed , Scenario1_SetRecordProfile
  • InitWindow() : MoveLookController
  • InkCanvas_DoubleTapped() : Scenario2
  • InkCanvas_Tapped() : Scenario2
  • InkEventLogger() : InkEventLogger
  • InkingEvent_Click() : sealed
  • InkingModeSelectionChanged() : sealed
  • InkObject() : SceneComposer::InkObject
  • InkPresenter_StrokesCollected() : sealed , Scenario1 , Scenario2 , sealed , Scenario3 , Scenario9
  • InkPresenter_StrokesErased() : Scenario1 , Scenario2 , sealed , Scenario3
  • InkRenderer() : InkRenderer
  • InkReplayTimer_Tick() : sealed , Scenario9
  • InkStackPanel_Loaded() : sealed , Scenario8
  • InkToolbar_ActiveToolChanged() : Scenario6 , sealed
  • InkToolbar_EraseAllClicked() : sealed , Scenario6
  • inkToolbar_InkDrawingAttributesChanged() : Scenario10 , sealed
  • InkToolbar_InkDrawingAttributesChanged() : sealed , Scenario6
  • InkToolbar_IsStencilButtonCheckedChanged() : sealed , Scenario6 , Scenario7
  • inkToolbar_Loaded() : sealed , Scenario10
  • InkToolbar_SelectedStencilChanged() : sealed , Scenario6
  • inputDevices_SelectionChanged() : Scenario2_ReceiveMIDIMessages , Scenario1_MIDIDeviceEnumeration
  • inputDevicesListBox_SelectionChanged() : Scenario2_DeviceCapture
  • InputOutputReports() : sealed , InputOutputReports
  • InputPauseButton_Click() : Scenario2_Custom , sealed , Scenario1_Default , Scenario3_Trim
  • InputPlayButton_Click() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • InputReportEvents() : sealed , InputReportEvents
  • InputStopButton_Click() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • Insert() : IncrementalLoadingBase , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , EmployeeCollection
  • InsertAfter() : List< T > , ComPtrList< T, NULLABLE >
  • InsertAt() : GroupInfoList
  • InsertBack() : List< T >
  • InsertBuffer() : CBufferPacket
  • InsertFront() : List< T >
  • InsertItem() : MediaListViewModel
  • InsertPos() : List< T >
  • InspectableClass() : WrlFinal , CMediaBufferWrapper , WrlFinal
  • InstallClientCertificateAsync() : Scenario3_ClientAuthentication , sealed
  • Instance() : FileLoggingSessionScenario , LoggingSessionScenario
  • InstructionControl() : InstructionControl
  • InstructionsControl() : InstructionsControl
  • InteractionMode() : Scenario1_Basic
  • InternalTransferHandlerAsync() : Scenario1
  • InterruptMessageWorker() : sealed
  • Intersects() : sealed , ItemIndexRangeList
  • Invalidate() : SceneComposer
  • InvalidateAndResizeVSIS() : DeviceResources
  • InvalidateContentRect() : DeviceResources
  • InvalidateLayout() : FileOpenPickerPage , sealed , CalibrationBar , sealed , FileSavePickerPage , CalibrationBar , sealed , CachedFileUpdaterPage
  • InvalidateRect() : DeviceResources
  • InvalidateSize() : CachedFileUpdaterPage , FileSavePickerPage , FileOpenPickerPage
  • InvalidPageException() : InvalidPageException
  • InviteeRadioButton_Checked() : Scenario1_Define
  • Invoke() : EmbeddedMFAsyncCallback< Callback > , AsyncCallback< T >
  • InvokeAllFinished() : sealed
  • InvokeCompleteHandler() : sealed
  • InvokeScript() : Scenario3_InvokeScript
  • InvokeSimpleToast() : sealed , CompletionGroupTask
  • IsActive() : Animate , CMediaStream
  • IsActivePlay() : Simple3DGame
  • IsAepPairedAsync() : Scenario1_Advertiser
  • IsAppLocalSettingsValue() : sealed
  • IsBackgroundTaskName() : Scenario1_ManageHotspot
  • IsBandSupported() : Helpers
  • IsBusy() : LoggingSessionScenario , FileLoggingSessionScenario
  • IsCertificateValidAsync() : MainPage , Scenario15_ServerCertificateValidation , MainPage , Scenario15_ServerCertificateValidation
  • IsChecked() : sealed
  • IsClipboardContentChangedEnabled() : SampleState
  • IsClipboardPeekAllowedAsync() : Scenario14_QueryCpPaste
  • IsConnectable() : BluetoothLEDeviceDisplay
  • IsConnected() : BluetoothLEDeviceDisplay , sealed
  • IsConsoleRun() : CSampleService
  • IsEmpty() : List< T >
  • IsEmptyRect() : InkRenderer
  • IsEnabled() : ControlBase , SymbologyListEntry , IControl , RadioModel , SymbologyListEntry
  • IsEnclosureLocationExternal() : CameraRotationHelper , sealed
  • IsEOF() : ToneSampleGenerator , MFSampleGenerator
  • IsExceptionHandled() : Scenario1_ParseAndStringify , Scenario1_Download , Scenario1_ParseAndStringify , Scenario3_Notifications , Scenario2_Upload
  • IsFailed() : sealed , CompletionGroupTask
  • IsFinished() : Animate
  • IsFiring() : MoveLookController
  • IsFixNeededAsync() : Scenario3_FixAccount , sealed
  • IsFocused() : BaseControl , FocusableElement , MediaTransportControls , IControl , ControlBase
  • IsFocusOnControl() : BaseControl
  • IsFx2CustomTriggerTaskRegistered() : CustomTrigger , sealed
  • IsHologramEnabled() : MediaCaptureManager
  • IsIdentityManaged_Click() : Scenario2
  • IsImportantTransaction_Click() : Scenario1_FindClaimEnable , sealed
  • IsInSnapRange() : Scenario5_InkingAndInteractionFeedback
  • IsItemInMenu() : sealed
  • IsItemLeftEdgeTapEnabled() : EdgeTappedListView
  • IsLicenseAvailable() : ProactiveViewModel
  • IsLoadingComplete() : RenderingHelper
  • IsMatching() : RemotePeer , sealed
  • IsMediaAlreadyOpened() : sealed , PlaybackPage
  • IsMediaTypeSupported() : CStreamSink
  • IsNonEmptyString() : Utils
  • IsNonNull() : sealed , Utils , Scenario5_DefiningCustomGlyphs , sealed , Scenario1_SelectDisplay , Scenario3_UsingWindows
  • IsoAutoCheckBox_CheckedChanged() : MainPage
  • IsoSlider_ValueChanged() : MainPage
  • IsPaired() : DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • IsPauseRequested() : MoveLookController
  • IsPerformingIo() : Scenario4_BulkPipes
  • IsPerformingRead() : Scenario3_ReadWrite
  • IsPerformingWrite() : Scenario3_ReadWrite
  • IsPixelSnappingDisabled() : FontNameCollector , CustomTextRenderer
  • IsPositionCurrent() : SourceHandler
  • IsPreRollFilled() : MFSampleGenerator
  • IsPressComplete() : MoveLookController
  • IsPreviewing() : Scenario5_DisplayingBarcodePreview
  • IsPrinterClaimed() : Scenario2_PrintReceipt , sealed
  • IsRadioOn() : RadioModel
  • IsRateSupported() : CMediaSource
  • IsReadyToRender() : HolographicFaceTrackerMain
  • IsRenderingStereoscopic() : CameraResources
  • IsRotating() : ToolCarousel
  • IsScannerClaimed() : Scenario5_DisplayingBarcodePreview
  • IsSelected() : FileDataSource2
  • IsStreaming() : CameraStreamProcessor
  • IsStrokeSelected() : SceneComposer::InkObject
  • IsSuperMuttDevice() : Utilities
  • IsSymbolTargetBorder() : Scenario3_StartDragAsync
  • IsSystemAudioEnabled() : MediaCaptureManager
  • IsTargetBorder() : sealed
  • IsThin() : CSetRateOperation
  • IsTouching() : Face , GameObject , Sphere , Cylinder
  • IsTrackingFaces() : FaceTrackerProcessor
  • IsTrial() : Simple3DGame
  • IsTypePresent() : ApiInformation
  • IsValidBitrateCombination() : Scenario4_Tuning
  • IsValidOperator() : Scenario3_ServerForeground
  • IsValidPosition() : sealed
  • IsVideo() : CStreamSink
  • IsVisible() : MediaTransportControls
  • IsWatcherRunning() : DeviceWatcherHelper , sealed
  • IsWatcherStarted() : DeviceWatcherHelper , sealed , DeviceWatcherHelper
  • IsWebException() : sealed , Scenario5_RandomAccess , Scenario6_RecoverableErrors , Scenario7_DownloadReordering , sealed
  • Item() : Item , DetailPage , List< T >::Node , DetailPage , ListViewEdgeTappedEventArgs , Item
  • Item_TimedMetadataTracksChanged() : Scenario6_AdInsertion , Scenario5_Metadata
  • ItemCache_CacheChanged() : FileDataSource , FileDataSource2
  • ItemCacheManager() : ItemCacheManager< T >
  • ItemDetails() : sealed , ItemDetails
  • ItemIndexRangeList() : ItemIndexRangeList
  • ItemLeftEdgeTapped() : EdgeTappedListView
  • ItemList() : ItemList
  • ItemProperty() : DetailPage
  • Items_VectorChanged() : PlayerViewModel
  • ItemsListView_ContainerContentChanging() : Scenario5_RestoreScrollPosition
  • ItemsListView_ItemClick() : Scenario5_RestoreScrollPosition
  • ItemTemplateControl() : ItemTemplateControl
  • ItemViewModel() : ItemViewModel
  • IterativeSearch() : LiveSourceBufferManager
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- p -

  • Page_Loaded() : sealed , Scenario5_GetSingleDevice , sealed , Scenario_Document2 , Scenario_Document3 , sealed , Scenario5_RestoreScrollPosition , Scenario5_GetSingleDevice , sealed , Scenario_Document1
  • Page_OnLoaded() : Scenario6_AdInsertion , Scenario7_LiveSeekableRange , Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync , Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata
  • Page_OnUnloaded() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Page_Tapped() : SubPage
  • PageRangePrintHelper() : sealed , PageRangePrintHelper
  • PageRoot_Loaded() : DetailPage
  • PageRoot_Unloaded() : DetailPage
  • PageToPrint() : PageToPrint , sealed
  • PairButton_Click() : Scenario1_Discovery , sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • PairingRequestedHandler() : sealed , Scenario9_CustomPairDevice
  • PairingSelectors() : DeviceSelectorChoices
  • Panel() : Panel
  • Parameter1_SelectionChanged() : Scenario3_SendMIDIMessages
  • Parameter2_SelectionChanged() : Scenario3_SendMIDIMessages
  • Parameter3_SelectionChanged() : Scenario3_SendMIDIMessages
  • parent_finder() : EmbeddedMFAsyncCallback< Callback >
  • ParityComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • Parse() : DialLaunchArguments , DashManifestParser , AtrParser
  • Parse_Click() : Scenario1_ParseAndStringify
  • ParseCurrentBuffer() : CMediaSource
  • ParseDoubleFromTextBox() : Scenario4_ForegroundGeofence
  • ParseFloatOrDefault() : Scenario1_CreateTile
  • ParseHeartRateValue() : Scenario2_Client
  • ParseMPDElement() : DashManifestParser
  • ParsePeriodElement() : DashManifestParser
  • ParsePinPolicy() : Scenario1_ProvisionTPM , sealed
  • ParseProperties() : sealed , DiscoveredDeviceWrapper
  • ParseRepresentationElement() : DashManifestParser
  • ParseSegmentTemplateElement() : DashManifestParser
  • ParseServerUrl() : CMediaSource
  • ParseTimeSpan() : Scenario4_ForegroundGeofence
  • ParseUIntWithFallback() : Helpers
  • Partial_Construct() : App
  • Partial_LaunchCompleted() : App
  • PassportAvailableCheckAsync() : sealed , SignIn
  • PassportDelete() : sealed , Content
  • PasteButton_Click() : CopyFiles , CopyImage , CopyText , CopyFiles , CopyImage , CopyText , Scenario9_ClipboardTarget
  • PasteFlyoutItem_Click() : sealed
  • PasteSelected() : SceneComposer
  • Pause() : PlaybackControl , CServiceBase , CMediaSource , CStreamSink
  • Pause_Click() : Scenario7_LiveSeekableRange
  • PauseAll_Click() : sealed , Scenario1_Download
  • PauseAnimationTapped() : sealed , Scenario12
  • PauseButton_Click() : Scenario2_Effects
  • PauseDevice() : sealed , Scenario2 , Scenario3
  • PauseDownload_Click() : sealed , Scenario5_RandomAccess
  • PauseGame() : Simple3DGame
  • PausePlaybackAsync() : WASAPIRenderer
  • PauseRequested() : GameMain
  • Pedometer_ReadingChanged() : Scenario1_Events
  • PedometerBackgroundTask() : sealed
  • PerformAction() : FocusableElement , Button , PlayPauseButton , ExitButton , SeekBarElement
  • PerformPressedAction() : BaseControl , MediaTransportControls
  • Period() : Period
  • PeriodicTimerCallback() : BackgroundActivity , SampleBackgroundTask , RfcommServerTask
  • pfnLink_Click() : Scenario6 , sealed
  • PhasedTemplate_Checked() : sealed , PhasingTests
  • PhasingTests() : sealed , PhasingTests
  • Phone() : User
  • PhoneButton_Click() : sealed , Scenario_PauseAsync
  • PhoneNumber() : Contact
  • PhotoAdjustmentRenderer() : PhotoAdjustmentRenderer
  • PhotoButton_Click() : sealed , MainPage , sealed , MainPage , sealed , Scenario2_PhotoSettings , sealed , MainPage
  • PhotoCanvas_SizeChanged() : Scenario1_DetectInPhoto
  • PhotoSettings_Changed() : sealed , Scenario2_PhotoSettings
  • PhotosPrintHelper() : sealed , PhotosPrintHelper
  • PickAFileButton_Click() : sealed , Scenario1_SingleFile , Scenario5_TriggerCFU , Scenario1_SingleFile , Scenario5_TriggerCFU
  • PickAndLaunchFile() : Scenario1_LaunchFile
  • PickAndSetButton_Click() : sealed , SetLockScreenImage
  • PickAudioButton_Click() : sealed , Scenario1_Create , Scenario3_Add
  • PickContactEmail() : sealed , Scenario1_Single
  • PickContactPhone() : sealed , Scenario1_Single
  • PickContactsEmail() : sealed , Scenario2_Multiple
  • PickContactsPhone() : sealed , Scenario2_Multiple
  • Picker_CastingDevicePickerDismissed() : Scenario02
  • Picker_CastingDeviceSelected() : Scenario02 , Scenario2
  • Picker_DevicePickerDismissed() : Scenario03 , Scenario05 , Scenario06
  • Picker_DeviceSelected() : Scenario03 , Scenario05 , Scenario06
  • Picker_DisconnectButtonClicked() : Scenario03 , Scenario05 , Scenario06
  • PickFile() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , Scenario1_CreateTile
  • PickFileButton_Click() : MainPage_PickFile
  • pickFileButton_Click() : Scenario1 , Scenario7
  • PickFilesButton_Click() : sealed , Scenario2_MultiFile
  • PickFolderButton_Click() : sealed , Scenario3_SingleFolder
  • PickNextMediaSourceAsync() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • PickNextMediaSourceWorkerAsync() : sealed , Scenario1_DisplayDepthColorIR , sealed
  • PickOutput() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • PickPlaylistAsync() : MainPage
  • PickPlaylistButton_Click() : sealed , Scenario2_Display , Scenario3_Add , Scenario4_Remove , Scenario5_Clear
  • PickSingleDeviceButton_Click() : sealed , Scenario1_DevicePicker
  • Pin_Click() : Scenario1_CreateContact
  • Pin_ValueChanged() : sealed , Scenario2_Listen
  • PinButton_Click() : Scenario1_PinTile
  • PinChangedEvent() : Scenario4_Events
  • PinChangedToggleSwitch_Toggled() : Scenario4_Events
  • PinContactAsync() : Scenario1_CreateContact
  • PinLiveTile_Click() : Scenario6_SecondaryTileNotification
  • PinNewSecondaryTile() : TilesHelper
  • PinTile() : ScenarioElement
  • PinToAppBar_Click() : Scenario7_PinFromAppbar
  • Pitch() : Camera , MoveLookController
  • PitchSlider_ValueChanged() : sealed
  • PlaceholderImage() : Helpers
  • PlaceLocation() : PlaceLocation
  • PlaceMarker() : CStreamSink
  • PlatformToMultibyteString() : AllJoynHelpers
  • Play() : PlaybackControl
  • Play_Click() : Scenario7_LiveSeekableRange
  • PlayAnimationTapped() : sealed , Scenario12
  • PlaybackBitrateChanged() : Scenario2_EventHandlers , Scenario4_Tuning
  • PlaybackControl() : PlaybackControl
  • PlaybackList_CurrentItemChanged() : MediaListViewModel , Scenario6
  • PlaybackList_ItemFailed() : Scenario1
  • PlaybackPage() : sealed , PlaybackPage
  • PlaybackPage_LayoutUpdated() : PlaybackPage
  • PlaybackService() : PlaybackService
  • PlaybackSession_PlaybackRateChanged() : Scenario6
  • PlaybackSession_PlaybackStateChanged() : PlaybackPage , PlaybackSessionViewModel , Scenario6
  • PlaybackSessionViewModel() : PlaybackSessionViewModel
  • PlayButton_Click() : Scenario2_Effects , sealed
  • playButton_Click() : LiveDashPlayer , Scenario6
  • Player() : Player
  • Player_CurrentStateChanged() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • Player_MediaEnded() : Scenario04
  • Player_MediaFailed() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • Player_MediaOpened() : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06 , ProjectionViewPage
  • Player_MediaPlayerRateChanged() : Scenario1
  • PlayerViewModel() : PlayerViewModel
  • PlayFile() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • PlayingTime() : GameTimer
  • PlaylistView() : PlaylistView
  • PlaylistView_ItemClick() : Scenario6
  • PlayPause_Click() : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • PlayPauseButton() : PlayPauseButton
  • playPauseButton_Click() : Scenario1
  • PlayPauseToggleDevice() : sealed , Scenario2 , Scenario3
  • PlayReadyHelper() : PlayReadyHelper
  • PlayReadyInfo() : PlayReadyInfo
  • PlayRecognitionBeginSound() : HolographicVoiceInputMain
  • PlayRecognitionSound() : HolographicVoiceInputMain
  • PlaySound() : GameObject , SoundEffect
  • PlaySpeedSlider_ValueChanged() : Scenario1_FilePlayback
  • PlotDataReady() : PlotDataSourceT< D >
  • PlotDataReadyEvent() : sealed
  • PlotDataReadyEventArgs() : PlotDataReadyEventArgs
  • PlugInFilter() : PlugInFilter
  • Pointer_Entered() : sealed , Scenario2 , Scenario2_SupportedTactileFeedback
  • Pointer_Exited() : Scenario2_SupportedTactileFeedback
  • Pointer_Moved() : sealed , Scenario2
  • Pointer_Pressed() : sealed , Scenario2
  • Pointer_Released() : sealed , Scenario2
  • Pointer_Wheel_Changed() : sealed , Scenario2
  • Points() : PlotDataReadyEventArgs
  • Poke() : Employee , IEmployee , Manager , Employee , IEmployee , Manager
  • PollForInboundBitsPerSecond() : Scenario4_Tuning
  • PollingFireInUse() : MoveLookController
  • PopToastControl() : PopToastControl
  • PopulateAdapterList() : sealed , Scenario1 , sealed , Scenario1
  • PopulateColorsClick() : sealed , Functions
  • PopulateComboBox() : sealed , Scenario8 , Scenario2_PhotoSettings , LiveDashPlayer
  • PopulateComboBoxes() : sealed , Scenario3_AspectRatio
  • PopulateImageInfoACKind() : D2DAdvancedColorImagesRenderer
  • PopulateInputDeviceList() : Scenario2_DeviceCapture
  • PopulateLanguageDropdown() : Scenario_ContinuousRecognitionListGrammar , sealed
  • PopulateLanguageDropDown() : Scenario_PredefinedWebSearchGrammar
  • PopulateLanguageDropdown() : sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_SRGSConstraint
  • PopulateMessageTypes() : Scenario3_SendMIDIMessages
  • PopulateOutputDeviceList() : Scenario2_DeviceCapture
  • PopulateParameterList() : Scenario3_SendMIDIMessages
  • PopulateScenarios() : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • PopulateSettingsComboBox() : Scenario1_PreviewSettings , sealed
  • PoseTrackingFrame() : sealed
  • Position() : GameObject , Sphere , Contact
  • POSITION() : List< T >::POSITION
  • PositionCursor() : Cursor
  • PositionHologram() : SpinningCubeRenderer
  • PositionImage() : ExtendedSplash
  • PositionTools() : HolographicPaintMain
  • positionUpdate_TimerTick() : Scenario1
  • PositionUpdateControl_PositionChanged() : Scenario7_LiveSeekableRange
  • PositionUpdateControl_SeekableRangesChanged() : Scenario7_LiveSeekableRange
  • PositionUpdateControl_SourceChanged() : Scenario7_LiveSeekableRange
  • PostAsync() : JsonRequest
  • Preference() : SizePreferenceString
  • PrepareFormatChange() : CStreamSink
  • PrepareForRender() : SdrOverlayEffect , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , DftEffect , RippleEffect , WaveEffect
  • PreparePrintContent() : PrintHelper
  • PrepareRemoteUrl() : CMediaSink
  • PrepareRendering() : RenderingHelper
  • PrepareSample() : CStreamSink
  • PrepareSampleFiles_Click() : sealed , Scenario4_ChangeSystemGroup
  • PrepareScenario() : GetConnectionProfiles , ShowConnection
  • PrepareToSuspend() : LoggingSessionScenario , sealed , LoggingSessionScenario
  • PrepareToSuspendAsync() : sealed , FileLoggingSessionScenario
  • PrepScenario1Sample() : BroadbandDevice
  • PrepScenario2Sample() : AccountWatcher
  • Present() : DeviceResources
  • PresentTextLayout() : sealed
  • PreserveTrailingSpaces() : CustomEditControl
  • PressComplete() : GameMain
  • prevButton_Click() : Scenario6
  • PreviewButton_Click() : LowLatency
  • PreviewButtonClicked() : sealed
  • PreviewControl_ManipulationDelta() : MainPage
  • PreviewControl_Tapped() : MainPage
  • PreviewImage_SizeChanged() : OcrFileImage , OcrCapturedImage , sealed , OcrCapturedImage
  • previewing_localClientButtonClicked() : sealed
  • previewing_previewButtonClicked() : sealed
  • Previewing_PreviewButtonClicked() : LowLatency
  • previewing_recordingStarted() : sealed
  • PreviewOptionsPrintHelper() : sealed
  • PreviewOptionsPrintHelper::AddOnePrintPage() : sealed
  • PreviewSettings_Changed() : sealed , Scenario3_AspectRatio , Scenario2_PhotoSettings , sealed
  • PreviewSetupCompleted() : LowLatency
  • PreviewUnavailable() : PreviewUnavailable , sealed , PreviewUnavailable
  • previousButton_Click() : Scenario1
  • PreviousItem_Click() : sealed , S1_GetAFeed
  • PrintBarcode_Click() : Scenario2_PrintReceipt , sealed
  • PrintBitmap_Click() : Scenario2_PrintReceipt , sealed
  • PrintConnectionProfiles() : GetConnectionProfiles
  • PrintDescriptor() : Scenario5_UsbDescriptors
  • printDetailedOptions_OptionChanged() : PageRangePrintHelper , CustomOptionsPrintHelper , sealed
  • PrintDetailedOptionsOptionChanged() : sealed , PhotosPrintHelper
  • PrintHelper() : PrintHelper
  • PrintLine_Click() : sealed , Scenario2_PrintReceipt
  • PrintLineFeedAndCutPaper() : sealed , Scenario2_PrintReceipt , sealed
  • PrintMenuItem_Click() : sealed , Scenario2 , Scenario3 , Scenario1 , sealed
  • PrintPackage_Click() : Scenario1_Print
  • PrintProfileInformation() : sealed
  • PrintReceipt() : sealed
  • PrintReceipt_Click() : sealed , Scenario2_PrintReceipt
  • PrintRow() : ReadBytes , sealed
  • PrintSelectedItem() : Scenario2_SystemDefaultMenu , sealed , Scenario1_EventAndMenuHookup , sealed
  • PrintTaskRequested() : sealed , PrintHelper , PhotosPrintHelper , PrintHelper , PageRangePrintHelper , DisablePreviewPrintHelper , sealed , StandardOptionsPrintHelper , sealed , CustomOptionsPrintHelper
  • PrintTotalReadWriteBytes() : Scenario4_BulkPipes
  • PrivacyPolicyInvoked() : sealed , MultipleAccountsScenario , SingleMicrosoftAccountScenario , SingleAccountScenario , SingleAzureADScenario , sealed
  • ProactiveIndividualization() : PlayReadyHelpers
  • ProactiveIndividualizationRequest() : PlayReadyHelper
  • ProactiveLicenseAcquisition() : PlayReadyHelpers
  • ProactiveViewModel() : ProactiveViewModel
  • ProcessColor() : sealed , Functions
  • ProcessColorFrame() : FrameRenderer
  • ProcessCommandApdu() : sealed
  • ProcessCurrentVideoFrame() : Scenario1_TrackInWebcam
  • ProcessCurrentVideoFrameAsync() : Scenario1_TrackInWebcam
  • ProcessDataVirtualizationScrollOffsetsAsync() : sealed , ChatListView
  • ProcessDepthAndColorFrames() : FrameRenderer
  • ProcessFaces() : HolographicFaceTrackerMain
  • ProcessFormatChange() : CMediaStream , CStreamSink
  • ProcessFrame() : FaceTrackerProcessor , AudioEchoEffect , sealed
  • ProcessGeofenceStateChangedReports() : GeofenceBackgroundTask
  • ProcessPacket() : CMediaSource
  • ProcessQueue() : OpQueue< T, TOperation >
  • ProcessQueueAsync() : OpQueue< T, TOperation >
  • ProcessSample() : CMediaStream , CStreamSink
  • ProcessSamplesFromQueue() : CStreamSink
  • ProcessScopeData() : WASAPICapture
  • ProcessServerDescription() : CMediaSource
  • ProcessServerFormatChange() : CMediaSource
  • ProcessServerSample() : CMediaSource
  • ProcessServiceRequest() : HardwareDRMViewModel , ReactiveViewModel , ProactiveViewModel , SecureStopViewModel
  • ProcessVisitReports() : VisitBackgroundTask
  • ProcessWriteCharacteristic() : Scenario3_ServerForeground
  • ProgressHandler() : Scenario07_PostStreamWithProgress
  • ProjectedMediaTransportControls() : ProjectedMediaTransportControls
  • Projection() : Camera
  • projectionCombobox_SelectionChanged() : Scenario1 , sealed
  • ProjectionManager_ProjectionDisplayAvailableChanged() : Scenario2
  • ProjectionViewPage() : sealed , ProjectionViewPage
  • ProjectionViewPage_StopProjectingButtonClick() : ProjectionViewPage
  • Properties() : DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • PropertyChanged() : RadioModel , BluetoothLEDeviceDisplay , DeviceInformationDisplay , ViewLifetimeControl , CustomTitleBar , UserViewModel , ViewLifetimeControl , Scenario5_DisplayingBarcodePreview , DeviceInformationDisplay , Scenario1_Colors , CustomTitleBar , Scenario5_DisplayingBarcodePreview , DiscoveredDevice , UserViewModel , Scenario1_Colors , BluetoothLEDeviceDisplay , WordOverlay , RadioModel , Scenario1_Basic , DiscoveredDevice , Scenario1_Basic
  • PropertyChangedHandler() : AllJoynHelpers
  • PropertyGetHandler() : AllJoynHelpers
  • PropertySetHandler() : AllJoynHelpers
  • ProtectAsyncBuffer_Click() : Scenario6
  • ProtectAsyncFile_Click() : Scenario4
  • ProtectAsyncFileStatus_Click() : Scenario4
  • ProtectDataAsync() : SetCardDataScenario
  • ProtectedAccessResumed() : EdpBackgroundTask
  • ProtectedAccessSuspending() : EdpBackgroundTask
  • ProtectedContentRevoked() : Scenario5
  • ProtectionLevel() : ProtectionLevelSelectorInfo
  • ProtectionLevelSelectorInfo() : ProtectionLevelSelectorInfo , sealed
  • ProtectionManager_ComponentLoadFailed() : PlayReadyHelper
  • ProtectionManager_ServiceRequested() : PlayReadyHelper
  • ProtectL1_Click() : Scenario1_Files , Scenario2_Memory , Scenario1_Files
  • ProtectL2_Click() : Scenario1_Files , Scenario2_Memory
  • ProtectStreamAsync_Click() : Scenario7
  • Protocol_SelectionChanged() : sealed , Scenario3_CredentialPickerOptions
  • ProtocolLaunch_Click() : SecondaryViewPage
  • Provider() : sealed , Provider
  • ProvideUpdatedVersionButton_Click() : CachedFileUpdater_Local
  • ProvisionButton_Click() : Scenario1_Initialization
  • ProximitySensorBackgroundTask() : sealed
  • PtFromPx() : sealed , Scenario2
  • PublishButton_ClickAsync() : Scenario3_ServerForeground
  • PurchaseAddOnButton_Click() : sealed , Scenario2_InAppPurchase , sealed , Scenario4_ConsumableProduct , Scenario3_UnmanagedConsumable
  • PurchaseFullLicense() : sealed , Scenario1_TrialMode
  • PurpleButton_Click() : sealed
  • PushBackSegment() : MediaStream
  • PushFrontSegment() : MediaStream
  • put() : unique_cotaskmem_ptr< T >
  • put_Length() : CMediaBufferWrapper
  • Pvb_ProjectionStopping() : Scenario05 , Scenario06
  • PxFromPt() : sealed , Scenario2
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- q -

  • QuadRenderer() : QuadRenderer
  • QueryCp_Click() : Scenario14_QueryCpPaste
  • QueryCurrentNetworkConnectivityButton_Click() : Scenario1_NetworkConnectivity
  • QueryInterface() : FilmicEffect , CustomTextRenderer , Listener , LuminanceHeatmapEffect , FontNameCollector , AsyncCallback< T > , EmbeddedMFAsyncCallback< Callback > , CStreamSink , CStreamSink::CAsyncOperation , ReinhardEffect , CBufferPacket , CSourceOperation , CBufferEnumerator , SdrOverlayEffect , CMarker , DftEffect , CMediaSource , CMediaStream , DftTransform , WaveEffect , SceneComposer , RippleEffect
  • QueryResult_ContentsChanged() : FileDataSource , FileDataSource2 , FileDataSource
  • QueueAsyncOperation() : CStreamSink
  • QueueEvent() : CMediaStream , CStreamSink , CMediaSource
  • QueueOperation() : OpQueue< T, TOperation >
  • QuickLinkSectionLabel_Tapped() : Scenario13_ShareTarget , ShareTarget
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- r -

  • Radio_StateChanged() : RadioModel
  • radioFile_Checked() : sealed , Scenario2 , sealed , Scenario3
  • RadioModel() : RadioModel
  • radioTone_Checked() : sealed , Scenario2 , Scenario3
  • Radius() : Sphere
  • RadiusSlider_ValueChanged() : sealed
  • RaiseCanExecuteChanged() : sealed , RelayCommand
  • RaiseDeviceChanged() : sealed , DeviceWatcherHelper
  • RaisePropertyChanged() : MediaItemViewModel , PlaybackSessionViewModel , PlayerViewModel , SettingsViewModel , PlaylistView , Scenario5_DisplayingBarcodePreview , Scenario1 , ViewModelBase , UserViewModel
  • RaisePropertyChangedEventAsync() : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • RaiseToastAfterDelay() : sealed , MultipleTasks
  • RandomNumberGeneratorTask() : RandomNumberGeneratorTask
  • RangesChanged() : FileDataSource , FileDataSource2
  • ReactiveIndividualization() : PlayReadyHelpers
  • ReactiveIndividualizationRequestAsync() : PlayReadyHelper
  • ReactiveLicenseAcquisition() : PlayReadyHelpers
  • ReactiveViewModel() : ReactiveViewModel
  • Read() : Read
  • Read_Local_Counter() : Scenario1_Files
  • Read_LocalCache_Counter() : Scenario1_Files
  • Read_Temporary_Counter() : Scenario1_Files
  • ReadAndWrite() : sealed , Scenario3_XmlWriterLite
  • ReadAsBufferAsync() : HttpJsonContent
  • ReadAsInputStreamAsync() : HttpJsonContent
  • ReadAsStringAsync() : HttpJsonContent
  • ReadAsync() : SlowInputStream , AccessHandler , Scenario2_LEDTemp , PipeIn , Scenario3_ReadWrite
  • ReadAttributes() : sealed , Scenario1_XmlReader
  • ReadBinary() : ReadBinary
  • ReadBlock_Click() : sealed , DeviceReadWrite
  • ReadButton_Click() : Scenario3_ReadWrite
  • ReadBytes() : sealed , ReadBytes
  • ReadBytesButton_Click() : sealed , Scenario4
  • ReadCancelButton_Click() : Scenario3_ReadWrite
  • ReadCardDetailsAsync() : AccessHandler
  • ReadChunk() : ReadStreamTask::ReadStreamTaskImpl
  • ReadData() : BasicReaderWriter
  • ReadDataAsync() : BasicReaderWriter , AccessHandler , BasicReaderWriter
  • Reader_FrameArrived() : sealed , Scenario2_FindAvailableSourceGroups
  • ReaderName() : SmartCardListItem
  • ReadFromStreamButton_Click() : sealed , Scenario5
  • ReadingChanged() : Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario5_DataEventsBatching , sealed , Scenario3_ChangeEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_BackgroundTask , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed
  • ReadingChangedOriginal() : sealed
  • ReadingChangedReadingTransform() : sealed
  • ReadInterruptMessagesAsync() : DeviceEvents
  • ReadLoop() : sealed
  • ReadMessage() : sealed
  • ReadMessageAsync() : SocketReaderWriter
  • ReadOneReadingFromSensorAsync() : Scenario3_Choosing
  • ReadOnlyTextBox_ContextMenuOpening() : sealed , Scenario2
  • ReadRecordAsync() : AccessHandler
  • ReadStreamAsync() : sealed
  • ReadStreamTask() : ReadStreamTask
  • ReadStreamTaskImpl() : ReadStreamTask::ReadStreamTaskImpl
  • ReadTextButton_Click() : sealed , Scenario3
  • ReadTimeoutButton_Click() : Scenario3_ReadWrite
  • ReadXml() : sealed , Scenario1_XmlReader
  • ReadXmlClick() : sealed , Scenario1_XmlReader
  • RealizeElements_Click() : BasicDeferral
  • RealtimeSurfaceMeshRenderer() : RealtimeSurfaceMeshRenderer
  • ReceiptView() : ReceiptView
  • Receive() : CMediaSource
  • ReceiveAsync() : CNetworkChannel , abstract
  • ReceiveDataAsync() : RfcommServerTask , Scenario2_Binary
  • ReceiveDataLoop() : sealed
  • ReceiveMessageAsync() : sealed , SocketWrapper
  • ReceiveStringLoop() : Scenario1_ChatClient , sealed
  • RecoButton_Click() : Scenario4
  • Recognize_Click() : sealed , Scenario_PauseAsync
  • RecognizeTextLanguages() : LinguisticServices
  • RecognizeTextScripts() : LinguisticServices
  • RecognizeWithoutUI_Click() : sealed , Scenario_SRGSConstraint
  • RecognizeWithoutUIDictationGrammar_Click() : sealed , Scenario_PredefinedDictationGrammar
  • RecognizeWithoutUIListConstraint_Click() : sealed , Scenario_ListConstraint
  • RecognizeWithoutUIWebSearchGrammar_Click() : sealed , Scenario_PredefinedWebSearchGrammar
  • RecognizeWithUI_Click() : sealed , Scenario_SRGSConstraint
  • RecognizeWithUIDictationGrammar_Click() : sealed , Scenario_PredefinedDictationGrammar
  • RecognizeWithUIListConstraint_Click() : sealed , Scenario_ListConstraint
  • RecognizeWithUIWebSearchGrammar_Click() : sealed , Scenario_PredefinedWebSearchGrammar
  • RecolorSubtree() : D2DSvgImageRenderer
  • RecolorSvg() : D2DSvgImageRenderer
  • RecordStopButton_Click() : Scenario2_DeviceCapture
  • Rectangle() : Rectangle
  • RectRenderer() : RectRenderer
  • RedEyeFlashCheckBox_CheckedChanged() : MainPage
  • ReduceMemoryUsage() : App
  • ReencodeAndSavePhotoAsync() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • RefreshButton_Click() : sealed , Scenario1_SelectDisplay
  • RefreshControlsFromGeofence() : Scenario4_ForegroundGeofence
  • refreshMapIcons() : sealed , Scenario7
  • RefreshPreview() : sealed
  • RefreshScaleFactor() : DeviceResources
  • RefreshSize() : ShapeRenderer
  • RefreshStatics() : PlayReadyInfoViewModel
  • RefreshTimer_Tick() : sealed , Scenario1_DeviceUse
  • RefreshWindowButton_Click() : sealed , Scenario3_UsingWindows
  • Refuse() : sealed
  • Register() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftEffect , RippleEffect , WaveEffect , AuthenticationController
  • Register_Click() : Scenario15_DPLCreateFileEvents , RegisterWithBackgroundTask
  • RegisterAidGroup() : NfcUtils
  • RegisterBackgroundTask() : sealed , BackgroundTaskSample , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , Scenario3_BackgroundDeviceWatcher , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioElement , sealed , Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor , sealed , Scenario4_BackgroundActivity , BackgroundTaskSample , sealed , BackgroundTaskSample , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , BackgroundTaskSample , sealed
  • RegisterBackgroundTaskAsync() : FileSavePicker_SaveToCachedFile
  • RegisterBtn_Click() : sealed , Scenario3_AvailabilityChanged
  • RegisterButton_Click() : Scenario1_Initialization , Scenario1_Events
  • RegisterClipboardContentChanged_Click() : OtherScenarios
  • RegisterCustomTrigger_Click() : sealed , CustomTrigger
  • RegisterDependencyProperties() : DetailPage
  • RegisterDependencyPropertiesOnce() : EdgeTappedListView
  • RegisterDeviceNotify() : DeviceResources
  • RegisteredCompletionHandlerForBackgroundTask() : ScenarioCommon
  • RegisterEventHandlers() : sealed , Provider , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • RegisterForAdaptiveMediaSourceEvents() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning
  • RegisterForAppEvents() : sealed , EventHandlerForDevice
  • RegisterForBoundaryEvents() : sealed
  • RegisterForDeviceAccessStatusChange() : sealed , EventHandlerForDevice
  • RegisterForDeviceWatcherEvents() : sealed , EventHandlerForDevice
  • RegisterForDiscreteControls() : Scenario7_LiveSeekableRange
  • RegisterForEvents() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • RegisterForInputReportEvents() : sealed , InputReportEvents
  • RegisterForInputReportEvents_Click() : sealed , InputReportEvents
  • RegisterForInterruptEvent() : Scenario3_InterruptPipes
  • RegisterForMarkEvents() : sealed , Scenario_SynthesizeSSML
  • RegisterForMediaPlaybackItemEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterForMediaSourceEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterForPositionUpdateControls() : Scenario7_LiveSeekableRange
  • RegisterForPrinting() : PrintHelper
  • RegisterForWordBoundaryEvents() : Scenario_SynthesizeTextBoundaries
  • RegisterFrame() : SuspensionManager
  • RegisterGlobalFilters() : FilterConfig
  • RegisterGroupedBackgroundTask() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • RegisterMetadataHandlerForMarks() : sealed , Scenario_SynthesizeSSML
  • RegisterMetadataHandlerForSentences() : sealed , Scenario_SynthesizeTextBoundaries
  • RegisterMetadataHandlerForWords() : sealed , Scenario_SynthesizeTextBoundaries
  • RegisterMetadataHandlers() : Scenario5_Metadata , Scenario6_AdInsertion
  • RegisterNetworkStatusChanged() : Scenario3_NetworkConnectivityChanges
  • RegisterOsrFx2InterruptEvent_Click() : Scenario3_InterruptPipes
  • RegisterPassportCredentialWithServerAsync() : EnableHelloPage
  • RegisterRoutes() : RouteConfig
  • RegisterSuperMuttInterruptEvent_Click() : Scenario3_InterruptPipes
  • RegisterTasks_Click() : Scenario1_ManageHotspot
  • RegisterUnregisterButton_Click() : Scenario3_NetworkConnectivityChanges
  • RegisterUser() : DAL
  • RegisterWithBackgroundTask() : RegisterWithBackgroundTask
  • ReinhardEffect() : ReinhardEffect
  • RelayCommand() : RelayCommand
  • Release() : SceneComposer , Listener , FontNameCollector
  • ReleaseAll_Click() : sealed , Scenario1_FindClaimEnable
  • ReleaseAllDeviceResources() : CameraResources
  • ReleaseAllPrinters() : MainPage
  • ReleaseBusObject() : AllJoynBusObjectManager
  • ReleaseButton1_Click() : sealed , Scenario3_MultipleDrawers
  • ReleaseButton2_Click() : sealed , Scenario3_MultipleDrawers
  • ReleaseClaim_Click() : sealed , Scenario1_FindClaimEnable
  • ReleaseClaimedPrinter() : MainPage
  • Released() : ViewLifetimeControl
  • ReleaseDeviceDependentResources() : VideoRenderer , SpinningCubeRenderer , CameraCoordinateMapper , GpuCoordinateMapper , QuadRenderer , TextRenderer , D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , SampleOverlay , CustomPixelShaderRenderer , SampleOverlay , CustomVertexShaderRenderer , SampleOverlay , D2DGradientMeshRenderer , SampleOverlay , PhotoAdjustmentRenderer , D2DSvgImageRenderer , DWriteColorTextRendererRenderer , SampleOverlay , Resource , NV12VideoTexture , QuadRenderer , SpinningCubeRenderer , TextRenderer , ControlBase , Cursor , IControl , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , final , SceneController , SceneObject , DistanceFieldRenderer , QuadRenderer , TextRenderer , SpinningCubeRenderer , RectRenderer , GameHud , GameInfoOverlay , GameRenderer , GameHud , GameInfoOverlay , GameRenderer , GameHud , GameRenderer , RenderingHelper
  • ReleaseHandle()
: SubjectPublicKeyInfo::SafeBCryptKeyHandle
, SubjectPublicKeyInfo::SafeLocalAllocHandle
  • ReleaseImageDependentResources() : D2DAdvancedColorImagesRenderer
  • ReleaseMarshalData() : CMediaBufferWrapper
  • ReleaseResourcesForBackBuffer() : CameraResources
  • ReleaseVertexResources() : final
  • ReloadManifest() : LiveSourceBufferManager , Player
  • RemapSelection() : FileDataSource2
  • ReminderCheckBox_Checked() : Scenario1_Define
  • ReminderCheckBox_UnChecked() : Scenario1_Define
  • RemotePeer() : RemotePeer
  • RemoteSystemWatcher_RemoteSystemAdded() : Scenario1_Discovery
  • RemoteSystemWatcher_RemoteSystemRemoved() : Scenario1_Discovery
  • RemoteSystemWatcher_RemoteSystemUpdated() : Scenario1_Discovery
  • RemoteVideo_MediaFailed() : VideoChat
  • Remove() : EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , IncrementalLoadingBase , List< T > , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection
  • remove_BreadBaked() : WrlFinal
  • Remove_Click() : Scenario4_Remove
  • Remove_Defaults() : Scenario2_SystemDefaultMenu
  • RemoveAccountData() : SingleAccountScenario
  • RemoveAdvertiser() : sealed , Scenario2 , WiFiDirectServiceManager
  • RemoveAndDispose< T >() : Disposer
  • RemoveAt() : IncrementalLoadingBase , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , EmployeeCollection , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemIndexRangeList , FileDataSource2 , GroupInfoList
  • RemoveAtEnd() : GroupInfoList
  • RemoveBack() : List< T >
  • RemoveBackgroundTaskStatus() : BackgroundTaskSample
  • RemoveBuffer() : CBufferPacket
  • RemoveCredentials_Click() : sealed , Scenario2_Manage
  • RemoveCustomItem() : Scenario2_SystemDefaultMenu
  • RemoveCustomProviders() : sealed
  • RemoveCustomTitleBar() : MainPage , SampleState , MainPage
  • RemoveDevice() : SourceGroupCollection
  • RemoveDeviceAsync() : sealed
  • RemoveDeviceFromList() : Scenario1_ConnectDisconnect , sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • RemoveFeedButton_Click() : sealed
  • RemoveFileButton_Click() : FileOpenPicker_PickCachedFile
  • RemoveFolderButton_Click() : sealed , Scenario3
  • RemoveFront() : List< T >
  • RemoveHolographicCamera() : DeviceResources
  • RemoveInternalFocus() : CustomEditControl
  • RemoveInternalFocusWorker() : CustomEditControl
  • RemoveItem() : MediaListViewModel , sealed , List< T > , ComPtrList< T, NULLABLE > , Scenario4_EdgeTappedListView , Scenario1_EventAndMenuHookup
  • RemoveJumpList_Click() : sealed , Scenario2_Remove
  • RemoveLocalFileButton_Click() : FileOpenPicker_PickAppFile
  • RemoveMemberFromSession() : sealed
  • RemovePrefix_Click() : Scenario1 , sealed
  • RemoveRegisteredKey() : AuthenticationController , DAL
  • RemoveSelectedStrokesFromSceneObjects() : SceneComposer
  • RemoveSession() : sealed , Scenario2 , Scenario4 , WiFiDirectServiceManager
  • RemoveSessionRequest() : sealed , Scenario2 , WiFiDirectServiceManager , sealed
  • RemoveSocket() : Scenario5 , sealed
  • RemoveStreamSink() : CMediaSink
  • RemoveSurface() : RealtimeSurfaceMeshRenderer
  • RemoveTabStops() : TransportOptions
  • RemoveTestFiles() : Scenario3_ReceiveFile
  • RemoveToDispose< T >() : Disposer
  • RemoveUriFileButton_Click() : FileOpenPicker_PickURLFile
  • RemoveValueChangedHandler() : Scenario2_Client
  • RenameButton_Click() : CachedFileUpdater_Remote
  • Render() : BaseControl , BaseElement , Text , Ellipse , FilledEllipse , Rectangle , MediaTransportControls , VideoRenderer , _360VideoPlaybackMain , VideoRenderer , HolographicApp1Main , BasicHologramMain , SpinningCubeRenderer , HolographicTemplateAppMain , SpinningCubeRenderer , QuadRenderer , TextRenderer , sealed , SceneComposer , ShapeRenderer , CustomComputeShaderMain , CustomComputeShaderRenderer , SampleOverlay , CustomPixelShaderMain , CustomPixelShaderRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer , SampleOverlay , D2DGradientMeshRenderer , SampleOverlay , DWriteColorTextRendererMain , SampleOverlay , SpinningCubeRenderer , HolographicFaceTrackerMain , ControlBase , Cursor , IControl , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , SceneController , HolographicSpatialStageMain , QuadRenderer , SpinningCubeRenderer , HolographicVoiceInputMain , RectRenderer , LowLatencyInputMain , GameHud , GameRenderer , GameObject , GameHud , GameRenderer , GameHud , Stroke , Tool , ClearTool , HolographicPaintMain , SourceHandler , MeshObject , sealed , GameRenderer , HolographicMRCSampleMain , HolographicTagAlongSampleMain , SceneObject , SampleOverlay , DWriteColorTextRendererRenderer , D2DGradientMeshMain , BasicHologramMain , InkRenderer , CameraStreamCoordinateMapperMain , _360VideoPlaybackMain , FilledRectangle , Line
  • RenderBuffer() : RenderBuffer
  • RenderDistanceField() : DistanceFieldRenderer
  • RenderingHelper() : RenderingHelper
  • RenderInternal() : QuadRenderer
  • RenderNV12() : QuadRenderer
  • RenderObjects() : Simple3DGame
  • RenderOffscreenTexture() : HolographicTagAlongSampleMain
  • RenderOptionsViewModel() : sealed
  • RenderPropertyPopUp() : sealed , Scenario2
  • RenderRGB() : QuadRenderer
  • RenderSetup() : Material
  • RenderTextOffscreen() : TextRenderer
  • RenewActiveLicense() : SecureStopViewModel
  • Replace_Click() : Scenario3_Replace , ScenarioElement
  • ReplaceAll() : GroupInfoList
  • ReplaceLastBackStackEntryParameter() : DetailPage
  • ReplaceQueryString() : Helpers
  • ReplaceText() : CustomEditControl
  • ReportCalendarData() : sealed , Scenario2_Stats , Scenario4_UnicodeExtensions , Scenario5_TimeZone , Scenario1_Data , sealed
  • ReportCapabilityAsync() : Scenario5_Capabilities
  • ReportColors() : sealed
  • ReportCompleted_Click() : Scenario13_ShareTarget , ShareTarget
  • ReportContactResult() : sealed , Scenario1_Single
  • ReportContactResults() : sealed , Scenario2_Multiple
  • ReportDataRetrieved_Click() : ShareTarget , Scenario13_ShareTarget
  • ReportEndOfStream() : CMediaSink
  • ReportErrorButton_Click() : Scenario13_ShareTarget , ShareTarget
  • ReportFormatChange() : CMediaSink
  • ReportLanguageData() : Scenario2_Lang , sealed
  • ReportPlotDataReady() : PlotDataSourceT< D >
  • ReportProtectedBuffer() : Scenario2_Memory
  • ReportRegionData() : sealed , Scenario3_Region
  • ReportSavedStatus() : MainPage
  • ReportStarted_Click() : Scenario13_ShareTarget
  • ReportStatus() : Scenario1_Files
  • ReportSubmittedBackgroundTask_Click() : Scenario13_ShareTarget
  • RepositionFaces() : MainPage
  • RequestAccessButton_Click() : Scenario2_RequestMany , Scenario1_ChatClient
  • RequestAndStartProjecting_Click() : sealed , Scenario2
  • RequestCalibration() : sealed , CalibrationBar , sealed , CalibrationBar , sealed
  • RequestChallenge() : AuthenticationController
  • RequestConsent_Click() : sealed , Scenario2_RequestConsent
  • RequestMicrophonePermission() : AudioCapturePermissions
  • RequestMicrophonePermissionAsync() : sealed
  • RequestPairDeviceAsync() : ConnectionSettingsPanel
  • RequestResponse() : RequestResponse
  • RequestSample() : CMediaStream
  • RequestTextLayoutUpdate() : sealed
  • RequestTokenAndSaveAccount() : SingleMicrosoftAccountScenario , SingleAzureADScenario
  • RequestToSendEnabledToggleSwitch_Toggled() : Scenario2_ConfigureDevice
  • RequiredDeviceProperties() : RequiredDeviceProperties
  • Reset() : ConnectionSettingsPanel , sealed , ManipulationInputProcessor , sealed , BasicTimer , GameTimer , CBufferEnumerator , CMediaBufferWrapper , ConnectionSettingsPanel , DeviceWatcherHelper , BasicTimer , DeviceWatcherHelper , sealed
  • Reset_Click() : Scenario1_GetDeviceInformation , sealed , PhasingTests , sealed
  • Reset_ToDefault() : Scenario2_SystemDefaultMenu
  • ResetButton_Click() : sealed
  • resetButton_Click() : Scenario3_SendMIDIMessages
  • ResetButton_Click() : Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , sealed
  • ResetButton_Pressed() : sealed
  • resetButton_Pressed() : Scenario5 , sealed , Scenario4 , sealed
  • ResetButtonClick() : sealed
  • ResetCancellationTokenSource() : Scenario4_BulkPipes
  • ResetCollection() : FileDataSource , FileDataSource2 , FileDataSource
  • ResetControls() : Scenario2ViewModel
  • ResetDropTime() : CMediaStream
  • ResetElapsedTime() : StepTimer
  • ResetFields() : sealed , Scenario1 , Scenario07_PostStreamWithProgress
  • ResetGame() : GameMain
  • ResetItems() : MainPage
  • ResetLicenseFromFile() : sealed
  • ResetMainUI() : Scenario1_ChatClient
  • ResetMessageTypeAndParameters() : Scenario3_SendMIDIMessages
  • ResetOutput() : Helpers , Scenario1 , sealed , Scenario2 , sealed , MainPage
  • ResetPersistedState() : Scenario2 , Scenario1
  • ResetPhotoAdjustmentValues() : sealed
  • ResetPin_Click() : sealed , Scenario3_ResetPIN
  • ResetPosition() : QuadRenderer
  • ResetReadCancellationTokenSource() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • ResetRect() : RectRenderer , sealed , LowLatencyInputMain
  • ResetScenarioState() : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer , Scenario3_MultipleDrawers , sealed
  • ResetSessionState() : Scenario2 , Scenario1
  • ResetState() : PlaybackPage , sealed , MoveLookController
  • ResetTexCoordScaleAndOffset() : QuadRenderer
  • ResetTheScenarioState() : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , sealed , Scenario1_BasicFunctionality , Scenario4_SymbologyAttributes , Scenario2_MultipleScanners , Scenario2_AamvaCards , Scenario3_ActiveSymbologies , sealed , Scenario2_MultipleScanners , Scenario1_BankCards
  • ResetUI() : Scenario2_MultipleScanners
  • ResetValuesClick() : Functions , sealed , BasicTests , ListsAndTemplates , sealed , OtherBindings
  • ResetWriteCancellationTokenSource() : Scenario2_LEDTemp , Scenario3_ReadWrite
  • ResizeArray() : Write
  • ResizeView_Click() : Scenario1_Basic , sealed , Scenario1_Basic
  • ResolvePadding() : DashManifestParser
  • Resource() : Resource
  • Restart() : CStreamSink
  • RestartWatcher() : sealed , Scenario1_SelectDisplay
  • RestoreAsync() : SuspensionManager
  • RestoreDataFromPersistedState() : Scenario1 , Scenario2
  • RestoreDefaultStrokeSize() : SceneComposer
  • RestoreFrameNavigationState() : SuspensionManager
  • RestoreScrollPosition() : Scenario1_Basic , sealed
  • RestoreStateAsync() : ExtendedSplash
  • ResultCharacteristic_ReadRequestedAsync() : Scenario3_ServerForeground
  • ResultCharacteristic_SubscribedClientsChanged() : Scenario3_ServerForeground
  • ResultsListView_SelectionChanged() : Scenario4_Connect , sealed , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , sealed , Scenario1_ChatClient
  • Resume() : GameMain
  • ResumeAll_Click() : Scenario1_Download , sealed
  • ResumeAudio() : Audio
  • ResumeDeviceWatcher() : DeviceList
  • ResumeDownload_Click() : Scenario5_RandomAccess , sealed
  • ResumeLoggingIfApplicable() : FileLoggingSessionScenario , LoggingSessionScenario , sealed , LoggingSessionScenario , FileLoggingSessionScenario , sealed
  • ResumeMeteringService() : ServiceViewModel
  • RetrieveAllItems_Click() : S7_RetrieveWithAppContent , sealed , S3_RetrieveWithAPI , sealed
  • RetrieveAppContentHelper() : S7_RetrieveWithAppContent
  • RetrieveCredentials_Click() : Scenario2_Manage
  • RetrieveMatchedItems_Click() : S7_RetrieveWithAppContent , sealed
  • RetrieveMatchingItems_Click() : sealed , S3_RetrieveWithAPI
  • RetryAfterSwitch_Toggled() : Scenario13_RetryFilter
  • RetryDownloadsAsync() : sealed , CompletionGroupTask
  • RevealPasswords_Click() : Scenario2_Manage , sealed , Scenario2_Manage
  • ReverbEffectToggle_Toggled() : Scenario5_InboxEffects
  • Revoke_Click() : Scenario5
  • RfcommChatDeviceDisplay() : RfcommChatDeviceDisplay
  • RichEditBoxSetError() : Scenario
  • RichEditBoxSetMsg() : Scenario
  • RichEditBoxSetText() : Scenario
  • RightEyeProjection() : Camera
  • RippleEffect() : RippleEffect
  • RollSlider_ValueChanged() : sealed
  • RootFrameNavigationHelper() : RootFrameNavigationHelper
  • RootPage_OnKeyDown() : Scenario1_Basic
  • RootPage_SizeChanged() : Scenario04
  • RotateLeft_Click() : Scenario2
  • RotatePitch() : sealed
  • RotateRight_Click() : Scenario2
  • RotateYaw() : sealed
  • RotationHelper_OrientationChanged() : sealed , MainPage
  • RotationSpeedSlider_ValueChanged() : sealed
  • Round() : RippleEffect , FilmicEffect , ReinhardEffect
  • RpcClientClose() : ServiceViewModel
  • RpcClientInitialize() : ServiceViewModel
  • Run() : GameMain , RandomNumberGeneratorTask , sealed , AdvertisementPublisherTask , BarcodeDecodeTask , sealed , ConnectTask , ToastNotificationQuickReplyTask , RandomNumberGeneratorTask , sealed , ProximitySensorBackgroundTask , sealed , RfcommServerTask , IoSyncBackgroundTask , sealed , BackgroundDeviceWatcher , sealed , LocationBackgroundTask , sealed , AuthenticationTask , sealed , AdventureWorksVoiceCommandService , GeofenceBackgroundTask , sealed , VisualProperties , sealed , ActivitySensorBackgroundTask , sealed , UpdateFileTask , UpdateMetadataTask , sealed , AppView , BackgroundActivity , SocketActivityTask , sealed , PedometerBackgroundTask , SampleSmsBackgroundTask , ConnectedTask , sealed , ConnectTask , EdpBackgroundTask , VisitBackgroundTask , GeofenceBackgroundTask , sealed , LocationBackgroundTask , Scenario1_BackgroundTask , sealed , ToastNotificationHistoryChangedTriggerTask , SampleBackgroundTask , UpdateMetadataTask , sealed , CompletionGroupTask , sealed , VisitBackgroundTask , AdvertisementWatcherTask , CServiceBase , BackgroundDeviceWatcher , sealed , GameMain , App , ToastActivationTypeBackgroundClosedTask , AppView , sealed , ServicingComplete , sealed , BadgeNotificationHistoryChangedTriggerTask
  • RunAsync() : AuthenticationTask
  • RunButton_Click() : Scenario4_BackgroundPublisher , Scenario3_BackgroundWatcher , Scenario2_Publisher , Scenario1_Watcher , Scenario1_ChatClient
  • RunCoordinateMapping() : GpuCoordinateMapper , CameraCoordinateMapper
  • RunDownload() : sealed
  • RunDownloads() : sealed
  • RunDownloadsAsync() : Scenario7_DownloadReordering , Scenario3_Notifications , sealed
  • RunGame() : Simple3DGame
  • RunTask() : ReadStreamTask , ReadStreamTask::ReadStreamTaskImpl
  • RuntimeClassInitialize() : WrlFinal , CMediaSink , CMediaBufferWrapper , WrlFinal
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- s -

  • S1_AddWithAPI() : sealed , S1_AddWithAPI
  • S1_GetAFeed() : S1_GetAFeed
  • S2_UpdateAndDeleteWithAPI() : sealed , S2_UpdateAndDeleteWithAPI
  • S3_RetrieveWithAPI() : sealed , S3_RetrieveWithAPI
  • S4_CheckIndexRevision() : sealed , S4_CheckIndexRevision
  • S5_AddWithAppContent() : sealed , S5_AddWithAppContent
  • S6_DeleteWithAppContent() : sealed , S6_DeleteWithAppContent
  • S7_RetrieveWithAppContent() : sealed , S7_RetrieveWithAppContent
  • SafeAdd() : FilmicEffect , ReinhardEffect , RippleEffect
  • SafeBCryptKeyHandle() : SubjectPublicKeyInfo::SafeBCryptKeyHandle
  • SafeLocalAllocHandle() : SubjectPublicKeyInfo::SafeLocalAllocHandle
  • SampleBackgroundTask() : sealed , SampleBackgroundTask , sealed , SampleBackgroundTask
  • SampleBackgroundTaskWithCondition() : sealed , SampleBackgroundTaskWithCondition , sealed , SampleBackgroundTaskWithCondition
  • SampleButton_Click() : OcrFileImage
  • SampleButton_Tapped() : sealed
  • SampleDataModel() : SampleDataModel
  • SampleFile() : SampleState
  • SampleIdentityConfigurationCorrect() : IdentityChecker
  • SampleOverlay() : SampleOverlay
  • Save_Click() : sealed , Scenario1_TrimAndSaveClip , Scenario2
  • SaveAccount() : sealed
  • SaveAccountList() : AccountsHelper
  • SaveAppState() : _360VideoPlaybackMain , HolographicApp1Main , BasicHologramMain , HolographicTemplateAppMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain
  • SaveAs_Click() : Scenario2
  • SaveAsync() : SuspensionManager
  • SaveBool() : PersistentState
  • SaveBusObject() : AllJoynBusObjectManager
  • SaveCredential_Click() : Scenario1_Save
  • SaveDataToPersistedState() : Scenario1 , Scenario2
  • SaveFileButton_Click() : sealed , Scenario4_SaveFile , MainPage_SaveFile
  • SaveFrameNavigationState() : SuspensionManager
  • SaveHighScore() : Simple3DGame
  • SaveInt32() : PersistentState
  • SaveInternalState() : sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , CustomPixelShaderMain , CustomPixelShaderRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer , sealed
  • SaveLogInMemoryToFileAsync() : sealed , LoggingSessionScenario
  • SavePackage_Click() : Scenario1_Print
  • SavePropertiesForBackgroundTask() : Scenario1_ManageHotspot
  • SaveScrollPosition() : sealed , Scenario1_Basic
  • SaveSingle() : PersistentState
  • SaveSoftwareBitmapAsync() : sealed , MainPage
  • SaveState() : SubPage , Simple3DGame , Level , Level2 , Level4 , Simple3DGame
  • SaveStateEventArgs() : SaveStateEventArgs
  • SaveString() : PersistentState
  • SaveToFutureAccessListButton_Click() : sealed , Scenario5_TriggerCFU
  • SaveTrip() : sealed , TripViewModel , TripStore
  • SaveTripAsync() : sealed
  • SaveXMFLOAT3() : PersistentState
  • SavingDataReason() : sealed , SavingDataReason
  • ScaleRect() : CustomEditControl
  • ScaleSlider_ValueChanged() : Scenario2
  • ScalingSlider_ValueChanged() : sealed
  • ScanButton_Click() : sealed , Scenario4_Connect
  • ScanForOnboardingInterfaces() : Scenario2ViewModel
  • ScanForWiFiAdaptersAsync() : Scenario2ViewModel
  • ScanForWiFiNetworksAsync() : Scenario2ViewModel
  • ScannerSelection_Changed() : Scenario5_DisplayingBarcodePreview
  • ScannerSupportsPreview() : Scenario5_DisplayingBarcodePreview
  • Scenario() : Scenario , sealed
  • Scenario01() : Scenario01
  • Scenario01_GetText() : Scenario01_GetText
  • Scenario02() : Scenario02
  • Scenario02_GetStream() : Scenario02_GetStream
  • Scenario03() : Scenario03
  • Scenario03_GetList() : Scenario03_GetList
  • Scenario04() : Scenario04
  • Scenario04_PostText() : Scenario04_PostText
  • Scenario05() : Scenario05
  • Scenario05_PostStream() : Scenario05_PostStream
  • Scenario06() : Scenario06
  • Scenario06_PostMultipart() : Scenario06_PostMultipart
  • Scenario07_PostStreamWithProgress() : Scenario07_PostStreamWithProgress
  • Scenario08_PostCustomContent() : Scenario08_PostCustomContent
  • Scenario09_GetCookie() : Scenario09_GetCookie
  • Scenario0_Choose() : sealed , Scenario0_Choose , sealed , Scenario0_Choose
  • Scenario1() : Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed , Scenario1 , sealed
  • Scenario10() : sealed , Scenario10 , sealed , Scenario10 , sealed , Scenario10 , sealed , Scenario10
  • Scenario10_CpToClipboard() : Scenario10_CpToClipboard
  • Scenario10_SearchMultipleResourceIds() : sealed , Scenario10
  • Scenario10_SetCookie() : Scenario10_SetCookie
  • Scenario10_ShowCandidates() : sealed , Scenario10
  • Scenario10_UnviewableContent() : Scenario10_UnviewableContent
  • Scenario10Button_Show_Click() : sealed , Scenario10
  • Scenario11() : sealed , Scenario11 , sealed , Scenario11 , sealed , Scenario11 , sealed , Scenario11
  • Scenario11_CPDNoUI() : Scenario11_CPDNoUI
  • Scenario11_DeleteCookie() : Scenario11_DeleteCookie
  • Scenario11Button_Show_Click() : sealed , Scenario11
  • Scenario12() : sealed , Scenario12 , sealed , Scenario12 , sealed , Scenario12
  • Scenario12_DisableCookies() : Scenario12_DisableCookies
  • Scenario12_ShareData() : Scenario12_ShareData
  • Scenario12Button_Show_Click() : sealed , Scenario12
  • Scenario13() : sealed , Scenario13
  • Scenario13_RetryFilter() : Scenario13_RetryFilter
  • Scenario13_ShareTarget() : Scenario13_ShareTarget
  • Scenario14_MeteredConnectionFilter() : Scenario14_MeteredConnectionFilter
  • Scenario14_QueryCpPaste() : Scenario14_QueryCpPaste
  • Scenario15_DPLCreateFileEvents() : Scenario15_DPLCreateFileEvents
  • Scenario15_ServerCertificateValidation() : Scenario15_ServerCertificateValidation
  • Scenario16_NetworkResource() : Scenario16_NetworkResource
  • Scenario1::GetElementRect() : sealed
  • Scenario1_AddAccount() : sealed , Scenario1_AddAccount
  • Scenario1_Advertiser() : sealed , Scenario1_Advertiser
  • Scenario1_Analyze() : sealed , Scenario1_Analyze
  • Scenario1_AppBarButtons() : sealed
  • Scenario1_BackgroundTask() : sealed
  • Scenario1_BankCards() : sealed , Scenario1_BankCards
  • Scenario1_Basic() : sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic
  • Scenario1_BasicFunctionality() : Scenario1_BasicFunctionality
  • Scenario1_Basics() : Scenario1_Basics
  • Scenario1_BasicUserActivity() : Scenario1_BasicUserActivity
  • Scenario1_CachedNetworks() : sealed , Scenario1_CachedNetworks
  • Scenario1_ChatClient() : Scenario1_ChatClient
  • Scenario1_Check() : Scenario1_Check
  • Scenario1_CheckConsentAvailability() : sealed , Scenario1_CheckConsentAvailability
  • Scenario1_Colors() : sealed , Scenario1_Colors
  • Scenario1_Configuration() : sealed , Scenario1_Configuration
  • Scenario1_Configure() : Scenario1_Configure
  • Scenario1_ConfigureMobileHotspot() : Scenario1_ConfigureMobileHotspot
  • Scenario1_Connect() : Scenario1_Connect
  • Scenario1_ConnectDisconnect() : Scenario1_ConnectDisconnect
  • Scenario1_Conversion() : sealed , Scenario1_Conversion
  • Scenario1_CorrelateStreams() : sealed
  • Scenario1_Create() : sealed , Scenario1_Create
  • Scenario1_CreateContact() : Scenario1_CreateContact
  • Scenario1_CreateContacts() : Scenario1_CreateContacts
  • Scenario1_CreateTile() : Scenario1_CreateTile
  • Scenario1_CreateTPMVSC() : sealed
  • Scenario1_CurrentActivity() : sealed , Scenario1_CurrentActivity
  • Scenario1_CustomDry() : sealed
  • Scenario1_Data() : sealed , Scenario1_Data
  • Scenario1_DataEvents() : sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • Scenario1_Default() : sealed , Scenario1_Default
  • Scenario1_DefaultAccount() : sealed
  • Scenario1_DefaultSpacing() : sealed
  • Scenario1_Define() : Scenario1_Define
  • Scenario1_DetectInPhoto() : Scenario1_DetectInPhoto
  • Scenario1_DevicePicker() : sealed , Scenario1_DevicePicker
  • Scenario1_DeviceUse() : sealed , Scenario1_DeviceUse
  • Scenario1_Directions() : Scenario1_Directions
  • Scenario1_Discovery() : Scenario1_Discovery
  • Scenario1_DisplayDepthColorIR() : sealed , Scenario1_DisplayDepthColorIR
  • Scenario1_Download() : sealed , Scenario1_Download
  • Scenario1_Enable() : sealed , Scenario1_Enable
  • Scenario1_EventAndMenuHookup() : sealed , Scenario1_EventAndMenuHookup
  • Scenario1_Events() : sealed , Scenario1_Events
  • Scenario1_ExampleOperations() : Scenario1_ExampleOperations
  • Scenario1_ExtractTextSegments() : sealed , Scenario1_ExtractTextSegments
  • Scenario1_Facebook() : Scenario1_Facebook
  • Scenario1_FilePlayback() : Scenario1_FilePlayback
  • Scenario1_Files() : Scenario1_Files
  • Scenario1_FindClaimEnable() : sealed , Scenario1_FindClaimEnable
  • Scenario1_FindId() : Scenario1_FindId
  • Scenario1_FindUsers() : Scenario1_FindUsers
  • Scenario1_Geotag() : sealed , Scenario1_Geotag
  • Scenario1_GetAndSetPin() : sealed , Scenario1_GetAndSetPin
  • Scenario1_GetDeviceInformation() : sealed , Scenario1_GetDeviceInformation
  • Scenario1_GetLamp() : sealed , Scenario1_GetLamp
  • Scenario1_Initialization() : Scenario1_Initialization
  • Scenario1_InkCanvasTactileFeedback() : Scenario1_InkCanvasTactileFeedback
  • Scenario1_Input() : Scenario1_Input
  • Scenario1_LanguageDetection() : Scenario1_LanguageDetection
  • Scenario1_Launch() : Scenario1_Launch
  • Scenario1_Launched() : sealed , Scenario1_Launched
  • Scenario1_LaunchFile() : Scenario1_LaunchFile
  • Scenario1_ListView() : sealed , Scenario1_ListView
  • Scenario1_Loaded() : Scenario1
  • Scenario1_LongAndShortFormats() : sealed , Scenario1_LongAndShortFormats
  • Scenario1_LowLatency() : sealed
  • Scenario1_LowLatencyInput() : sealed
  • Scenario1_ManageHotspot() : Scenario1_ManageHotspot
  • Scenario1_Message() : sealed , Scenario1_Message
  • Scenario1_Metrics() : sealed , Scenario1_Metrics
  • Scenario1_MIDIDeviceEnumeration() : Scenario1_MIDIDeviceEnumeration
  • Scenario1_Mini() : sealed , Scenario1_Mini
  • Scenario1_MoveCertificate() : Scenario1_MoveCertificate
  • Scenario1_MultiVideoPlayback() : Scenario1_MultiVideoPlayback
  • Scenario1_NavToUrl() : Scenario1_NavToUrl
  • Scenario1_NetworkConnectivity() : Scenario1_NetworkConnectivity
  • Scenario1_OmnidirectionalSound() : sealed
  • Scenario1_OpenDrawer() : sealed , Scenario1_OpenDrawer
  • Scenario1_Orientation() : sealed , Scenario1_Orientation
  • Scenario1_ParseAndStringify() : Scenario1_ParseAndStringify
  • Scenario1_PercentPermilleFormatting() : sealed , Scenario1_PercentPermilleFormatting
  • Scenario1_PinTile() : Scenario1_PinTile
  • Scenario1_Prefs() : sealed , Scenario1_Prefs
  • Scenario1_PreviewSettings() : sealed , Scenario1_PreviewSettings
  • Scenario1_Print() : Scenario1_Print
  • Scenario1_ProvisionTPM() : Scenario1_ProvisionTPM
  • Scenario1_ReactiveRequest() : Scenario1_ReactiveRequest
  • Scenario1_ReadData() : Scenario1_ReadData , sealed , Scenario1_ReadData , sealed
  • Scenario1_ReceiptPrinter() : sealed
  • Scenario1_Render() : sealed , Scenario1_Render
  • Scenario1_Save() : sealed , Scenario1_Save
  • Scenario1_SecondaryWindow() : Scenario1_SecondaryWindow
  • Scenario1_SelectDisplay() : sealed , Scenario1_SelectDisplay
  • Scenario1_Send() : Scenario1_Send
  • Scenario1_SetRecordProfile() : sealed , Scenario1_SetRecordProfile
  • Scenario1_SimpleListView() : Scenario1_SimpleListView
  • Scenario1_SimplestAdaptiveStreaming() : Scenario1_SimplestAdaptiveStreaming
  • Scenario1_Single() : sealed , Scenario1_Single
  • Scenario1_SingleFile() : sealed , Scenario1_SingleFile
  • Scenario1_SpellingTextSuggestions() : sealed , Scenario1_SpellingTextSuggestions
  • Scenario1_Toggle() : Scenario1_Toggle
  • Scenario1_TrackInWebcam() : Scenario1_TrackInWebcam
  • Scenario1_TrackPosition() : Scenario1_TrackPosition
  • Scenario1_TrialMode() : sealed , Scenario1_TrialMode
  • Scenario1_TrimAndSaveClip() : sealed , Scenario1_TrimAndSaveClip
  • Scenario1_UIFonts() : Scenario1_UIFonts
  • Scenario1_Unloaded() : Scenario1
  • Scenario1_UTF8() : Scenario1_UTF8
  • Scenario1_Watcher() : Scenario1_Watcher
  • Scenario1_Welcome() : Scenario1_Welcome
  • Scenario1_XmlReader() : Scenario1_XmlReader
  • Scenario1Basic() : sealed , Scenario1Basic
  • Scenario1BtnDefault_Click() : BuildNewRss
  • Scenario1Init() : BuildNewRss
  • Scenario1ViewModel() : Scenario1ViewModel
  • Scenario2() : Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed , Scenario2 , sealed
  • Scenario2::GetTextboxSelectionRect() : sealed
  • Scenario2_AamvaCards() : sealed , Scenario2_AamvaCards
  • Scenario2_Add() : Scenario2_Add
  • Scenario2_AdvancedUserActivity() : Scenario2_AdvancedUserActivity
  • Scenario2_AppendClips() : sealed , Scenario2_AppendClips
  • Scenario2_BackgroundTask() : Scenario2_BackgroundTask
  • Scenario2_Binary() : Scenario2_Binary
  • Scenario2_CardioidSound() : sealed
  • Scenario2_ChangePin() : sealed
  • Scenario2_ChangePIN() : Scenario2_ChangePIN
  • Scenario2_ChatServer() : Scenario2_ChatServer
  • Scenario2_Click() : Scenario1
  • Scenario2_Client() : Scenario2_Client
  • Scenario2_CloseDrawer() : sealed , Scenario2_CloseDrawer
  • Scenario2_ConcurrentProfile() : sealed , Scenario2_ConcurrentProfile
  • Scenario2_Conditional() : Scenario2_Conditional
  • Scenario2_ConfigureDevice() : Scenario2_ConfigureDevice
  • Scenario2_Connector() : sealed , Scenario2_Connector
  • Scenario2_ControlTransfer() : Scenario2_ControlTransfer
  • Scenario2_Custom() : sealed , Scenario2_Custom
  • Scenario2_DecimalFormatting() : sealed , Scenario2_DecimalFormatting
  • Scenario2_DelayMini() : sealed , Scenario2_DelayMini
  • Scenario2_DetectInWebcam() : Scenario2_DetectInWebcam
  • Scenario2_DeviceCapture() : Scenario2_DeviceCapture
  • Scenario2_DeviceWatcher() : sealed , Scenario2_DeviceWatcher
  • Scenario2_Disable() : sealed , Scenario2_Disable
  • Scenario2_Display() : sealed , Scenario2_Display
  • Scenario2_DisplayRegion() : Scenario2_DisplayRegion
  • Scenario2_DisplayText() : sealed , Scenario2_DisplayText
  • Scenario2_DocumentFonts() : Scenario2_DocumentFonts
  • Scenario2_DragUICustomization() : sealed , Scenario2_DragUICustomization
  • Scenario2_Effects() : Scenario2_Effects
  • Scenario2_EnableSettings() : sealed , Scenario2_EnableSettings
  • Scenario2_Engage() : Scenario2_Engage
  • Scenario2_EventHandlers() : Scenario2_EventHandlers
  • Scenario2_Extend() : sealed , Scenario2_Extend
  • Scenario2_FindAvailableSourceGroups() : sealed , Scenario2_FindAvailableSourceGroups
  • Scenario2_GetCurrentTextSegmentFromIndex() : sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • Scenario2_GetPosition() : Scenario2_GetPosition
  • Scenario2_History() : sealed , Scenario2_History , sealed , Scenario2_History
  • Scenario2_Icons() : sealed
  • Scenario2_InAppPurchase() : sealed , Scenario2_InAppPurchase
  • Scenario2_Lang() : sealed , Scenario2_Lang
  • Scenario2_Launch() : Scenario2_Launch , sealed , Scenario2_Launch , sealed , Scenario2_Launch
  • Scenario2_LaunchUri() : Scenario2_LaunchUri
  • Scenario2_LEDTemp() : Scenario2_LEDTemp
  • Scenario2_Listen() : sealed , Scenario2_Listen
  • Scenario2_Load() : sealed , Scenario2_Load
  • Scenario2_Manage() : sealed , Scenario2_Manage
  • Scenario2_ManageAccount() : sealed , Scenario2_ManageAccount
  • Scenario2_Memory() : Scenario2_Memory
  • Scenario2_MessageCaption() : sealed , Scenario2_MessageCaption
  • Scenario2_Msa() : sealed
  • Scenario2_MultiFile() : sealed , Scenario2_MultiFile
  • Scenario2_Multiple() : sealed , Scenario2_Multiple
  • Scenario2_MultipleScanners() : Scenario2_MultipleScanners
  • Scenario2_NavToString() : Scenario2_NavToString
  • Scenario2_NetworkCost() : Scenario2_NetworkCost
  • Scenario2_Notifications() : Scenario2_Notifications
  • Scenario2_oAuthFacebook() : sealed
  • Scenario2_PhotoSettings() : sealed , Scenario2_PhotoSettings
  • Scenario2_Polling() : sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling
  • Scenario2_Prediction() : sealed , Scenario2_Prediction
  • Scenario2_PrintReceipt() : sealed , Scenario2_PrintReceipt
  • Scenario2_ProactiveRequest() : Scenario2_ProactiveRequest
  • Scenario2_Publisher() : Scenario2_Publisher
  • Scenario2_ReceiveContact() : Scenario2_ReceiveContact
  • Scenario2_ReceiveMIDIMessages() : Scenario2_ReceiveMIDIMessages
  • Scenario2_Remove() : sealed , Scenario2_Remove
  • Scenario2_RequestConsent() : sealed , Scenario2_RequestConsent
  • Scenario2_RequestMany() : Scenario2_RequestMany
  • Scenario2_Scan() : sealed , Scenario2_Scan
  • Scenario2_ScopedViews() : sealed , Scenario2_ScopedViews
  • Scenario2_ScriptDetection() : Scenario2_ScriptDetection
  • Scenario2_Settings() : Scenario2_Settings
  • Scenario2_ShakeEvents() : sealed , Scenario2_ShakeEvents
  • Scenario2_ShowHideEvents() : Scenario2_ShowHideEvents
  • Scenario2_SimpleGridView() : Scenario2_SimpleGridView
  • Scenario2_Stats() : sealed , Scenario2_Stats
  • Scenario2_StringTemplate() : sealed , Scenario2_StringTemplate
  • Scenario2_SupportedTactileFeedback() : Scenario2_SupportedTactileFeedback
  • Scenario2_SynchronizingPlayers() : Scenario2_SynchronizingPlayers
  • Scenario2_SystemDefaultMenu() : Scenario2_SystemDefaultMenu
  • Scenario2_ToggleMobileHotspot() : Scenario2_ToggleMobileHotspot
  • Scenario2_Twitter() : Scenario2_Twitter
  • Scenario2_UniformSpacing() : sealed
  • Scenario2_UnpinTile() : Scenario2_UnpinTile
  • Scenario2_Upload() : sealed , Scenario2_Upload
  • Scenario2_VideoChat() : sealed
  • Scenario2_WatchUsers() : Scenario2_WatchUsers
  • Scenario2_XmlWriter() : Scenario2_XmlWriter
  • Scenario2BtnDefault_Click() : MarkHotProducts
  • Scenario2BtnSave_Click() : MarkHotProducts
  • Scenario2Init() : MarkHotProducts
  • Scenario2StandardOptions() : sealed , Scenario2StandardOptions
  • Scenario2ViewModel() : Scenario2ViewModel
  • Scenario3() : sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed , Scenario3 , sealed
  • Scenario3_Aad() : sealed
  • Scenario3_ActiveSymbologies() : Scenario3_ActiveSymbologies
  • Scenario3_AdaptiveCard() : Scenario3_AdaptiveCard
  • Scenario3_AdaptiveSync() : Scenario3_AdaptiveSync
  • Scenario3_Add() : sealed , Scenario3_Add
  • Scenario3_AddAudioTracks() : sealed , Scenario3_AddAudioTracks
  • Scenario3_AppCapture() : Scenario3_AppCapture
  • Scenario3_AspectRatio() : sealed , Scenario3_AspectRatio
  • Scenario3_AvailabilityChanged() : sealed , Scenario3_AvailabilityChanged
  • Scenario3_BackgroundDeviceWatcher() : sealed , Scenario3_BackgroundDeviceWatcher
  • Scenario3_BackgroundTask() : Scenario3_BackgroundTask
  • Scenario3_BackgroundWatcher() : Scenario3_BackgroundWatcher
  • Scenario3_BgChatServer() : Scenario3_BgChatServer
  • Scenario3_Calibration() : sealed , Scenario3_Calibration , sealed , Scenario3_Calibration , sealed , Scenario3_Calibration
  • Scenario3_ChangeEvents() : sealed , Scenario3_ChangeEvents
  • Scenario3_CheckUserConsentGroup() : Scenario3_CheckUserConsentGroup
  • Scenario3_ChooseControl() : Scenario3_ChooseControl
  • Scenario3_Choosing() : Scenario3_Choosing
  • Scenario3_Click() : Scenario1
  • Scenario3_ClientAuthentication() : Scenario3_ClientAuthentication
  • Scenario3_CredentialPickerOptions() : sealed , Scenario3_CredentialPickerOptions
  • Scenario3_CurrencyFormatting() : sealed , Scenario3_CurrencyFormatting
  • Scenario3_CurrentStepCount() : sealed , Scenario3_CurrentStepCount
  • Scenario3_CustomDecay() : sealed
  • Scenario3_CustomItems() : sealed , Scenario3_CustomItems
  • Scenario3_DisplayOnOff() : sealed , Scenario3_DisplayOnOff
  • Scenario3_EnableHdrProfile() : sealed , Scenario3_EnableHdrProfile
  • Scenario3_Enum() : sealed , Scenario3_Enum
  • Scenario3_EnumerateTiles() : Scenario3_EnumerateTiles
  • Scenario3_Events() : sealed
  • Scenario3_FixAccount() : sealed , Scenario3_FixAccount
  • Scenario3_Flickr() : Scenario3_Flickr
  • Scenario3_ForegroundApp() : Scenario3_ForegroundApp
  • Scenario3_FrameInput() : Scenario3_FrameInput
  • Scenario3_Full() : sealed , Scenario3_Full
  • Scenario3_HardwareDRM() : Scenario3_HardwareDRM
  • Scenario3_InkingFeedback() : Scenario3_InkingFeedback
  • Scenario3_InterruptPipes() : Scenario3_InterruptPipes
  • Scenario3_InvokeScript() : Scenario3_InvokeScript
  • Scenario3_LaunchAppServices() : Scenario3_LaunchAppServices
  • Scenario3_Legacy() : Scenario3_Legacy
  • Scenario3_MasterDetail() : Scenario3_MasterDetail
  • Scenario3_MultipleClaims() : sealed , Scenario3_MultipleClaims
  • Scenario3_MultipleDrawers() : sealed , Scenario3_MultipleDrawers
  • Scenario3_NetworkConnectivityChanges() : Scenario3_NetworkConnectivityChanges
  • Scenario3_Notifications() : sealed , Scenario3_Notifications
  • Scenario3_ParameterizedTemplate() : sealed , Scenario3_ParameterizedTemplate
  • Scenario3_Polling() : sealed , Scenario3_Polling
  • Scenario3_Porting() : sealed , Scenario3_Porting
  • Scenario3_ProportionalSpacing() : sealed
  • Scenario3_ReadWrite() : Scenario3_ReadWrite
  • Scenario3_ReceiveFile() : Scenario3_ReceiveFile
  • Scenario3_Region() : sealed , Scenario3_Region
  • Scenario3_RegisterForUpdates() : sealed , Scenario3_RegisterForUpdates
  • Scenario3_Replace() : Scenario3_Replace
  • Scenario3_RequestModification() : Scenario3_RequestModification
  • Scenario3_ResetPIN() : Scenario3_ResetPIN
  • Scenario3_ResetPin() : sealed
  • Scenario3_ReverseConversion() : sealed , Scenario3_ReverseConversion
  • Scenario3_SecondaryTiles() : Scenario3_SecondaryTiles
  • Scenario3_SendMIDIMessages() : Scenario3_SendMIDIMessages
  • Scenario3_ServerForeground() : Scenario3_ServerForeground
  • Scenario3_SettingContainer() : Scenario3_SettingContainer
  • Scenario3_ShowHideMethods() : Scenario3_ShowHideMethods
  • Scenario3_SingleFolder() : sealed , Scenario3_SingleFolder
  • Scenario3_Size() : Scenario3_Size
  • Scenario3_StartDragAsync() : sealed , Scenario3_StartDragAsync
  • Scenario3_StartDragAsync_Loaded() : Scenario3_StartDragAsync
  • Scenario3_Transliteration() : Scenario3_Transliteration
  • Scenario3_Trim() : sealed , Scenario3_Trim
  • Scenario3_UnmanagedConsumable() : sealed , Scenario3_UnmanagedConsumable
  • Scenario3_UsingWindows() : sealed , Scenario3_UsingWindows
  • Scenario3_XmlWriterLite() : Scenario3_XmlWriterLite
  • Scenario3BtnBuffer_Click() : XmlLoading
  • Scenario3BtnFile_Click() : XmlLoading
  • Scenario3Button_Show_Click() : sealed , Scenario3
  • Scenario3CustomOptions() : sealed , Scenario3CustomOptions
  • Scenario3Init() : XmlLoading
  • Scenario4() : Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4 , sealed , Scenario4
  • Scenario4::RecoButton_Click() : sealed
  • Scenario4_AddOverlays() : sealed , Scenario4_AddOverlays , sealed
  • Scenario4_BackgroundActivity() : sealed , Scenario4_BackgroundActivity
  • Scenario4_BackgroundPedometer() : Scenario4_BackgroundPedometer
  • Scenario4_BackgroundProximitySensor() : sealed , Scenario4_BackgroundProximitySensor
  • Scenario4_BackgroundPublisher() : Scenario4_BackgroundPublisher
  • Scenario4_BackgroundTask() : sealed
  • Scenario4_BulkPipes() : Scenario4_BulkPipes
  • Scenario4_ChangeAdminKey() : sealed , Scenario4_ChangeAdminKey
  • Scenario4_ChangeSystemGroup() : sealed , Scenario4_ChangeSystemGroup
  • Scenario4_CharacterGrouping() : Scenario4_CharacterGrouping
  • Scenario4_CompactOverlay() : Scenario4_CompactOverlay
  • Scenario4_CompletionGroups() : sealed , Scenario4_CompletionGroups
  • Scenario4_CompositeSettings() : Scenario4_CompositeSettings
  • Scenario4_Connect() : sealed , Scenario4_Connect
  • Scenario4_ConsumableProduct() : sealed , Scenario4_ConsumableProduct
  • Scenario4_Control() : sealed
  • Scenario4_EdgeTappedListView() : Scenario4_EdgeTappedListView
  • Scenario4_Events() : Scenario4_Events
  • Scenario4_ForegroundGeofence() : Scenario4_ForegroundGeofence
  • Scenario4_Input() : sealed , Scenario4_Input
  • Scenario4_InteractionFeedback() : Scenario4_InteractionFeedback
  • Scenario4_ManyProviders() : sealed
  • Scenario4_NumberParsing() : sealed , Scenario4_NumberParsing
  • Scenario4_OrientationChanged() : sealed , Scenario4_OrientationChanged
  • Scenario4_Override() : sealed , Scenario4_Override
  • Scenario4_PartialReadWrite() : Scenario4_PartialReadWrite
  • Scenario4_ReceiveUri() : Scenario4_ReceiveUri
  • Scenario4_Remove() : Scenario4_Remove , sealed , Scenario4_Remove
  • Scenario4_SaveFile() : sealed , Scenario4_SaveFile
  • Scenario4_ScriptNotify() : Scenario4_ScriptNotify
  • Scenario4_SecureStop() : Scenario4_SecureStop
  • Scenario4_Settings() : Scenario4_Settings
  • Scenario4_ShowView() : Scenario4_ShowView
  • Scenario4_Snapshot() : sealed , Scenario4_Snapshot
  • Scenario4_StateTrigger() : Scenario4_StateTrigger
  • Scenario4_Submix() : Scenario4_Submix
  • Scenario4_SymbologyAttributes() : Scenario4_SymbologyAttributes
  • Scenario4_TilePinned() : Scenario4_TilePinned
  • Scenario4_Tuning() : Scenario4_Tuning
  • Scenario4_UnicodeExtensions() : sealed , Scenario4_UnicodeExtensions
  • Scenario4_UpdatingLineDisplayAttributes() : sealed , Scenario4_UpdatingLineDisplayAttributes
  • Scenario4BtnDefault_Click() : GiftDispatch
  • Scenario4Init() : GiftDispatch
  • Scenario4PageRange() : sealed , Scenario4PageRange
  • Scenario5() : sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5 , sealed , Scenario5
  • Scenario5::nearbyStreetside() : sealed
  • Scenario5::OnSizeChanged() : sealed
  • Scenario5_Capabilities() : Scenario5_Capabilities
  • Scenario5_Clear() : sealed , Scenario5_Clear
  • Scenario5_DataEventsBatching() : sealed , Scenario5_DataEventsBatching
  • Scenario5_DefiningCustomGlyphs() : sealed , Scenario5_DefiningCustomGlyphs
  • Scenario5_DisplayingBarcodePreview() : Scenario5_DisplayingBarcodePreview
  • Scenario5_GeofenceBackgroundTask() : Scenario5_GeofenceBackgroundTask
  • Scenario5_GetSingleDevice() : sealed , Scenario5_GetSingleDevice
  • Scenario5_InboxEffects() : Scenario5_InboxEffects
  • Scenario5_InkingAndInteractionFeedback() : Scenario5_InkingAndInteractionFeedback
  • Scenario5_IsSupported() : sealed , Scenario5_IsSupported
  • Scenario5_LaunchedFromSecondaryTile() : Scenario5_LaunchedFromSecondaryTile
  • Scenario5_ManyProvidersManyAccounts() : sealed
  • Scenario5_Metadata() : Scenario5_Metadata
  • Scenario5_Msappdata() : Scenario5_Msappdata
  • Scenario5_Multiple() : sealed
  • Scenario5_NavToFiles() : Scenario5_NavToFiles
  • Scenario5_RandomAccess() : sealed , Scenario5_RandomAccess
  • Scenario5_RelativePositioning() : Scenario5_RelativePositioning
  • Scenario5_RestoreScrollPosition() : Scenario5_RestoreScrollPosition
  • Scenario5_RoundingAndPadding() : sealed , Scenario5_RoundingAndPadding
  • Scenario5_Show() : Scenario5_Show
  • Scenario5_TimeZone() : sealed , Scenario5_TimeZone
  • Scenario5_TriggerCFU() : sealed , Scenario5_TriggerCFU
  • Scenario5_UnicodeExtensions() : sealed , Scenario5_UnicodeExtensions
  • Scenario5_UsbDescriptors() : Scenario5_UsbDescriptors
  • Scenario5_UserCollection() : sealed , Scenario5_UserCollection
  • Scenario5_VerifyResponse() : sealed , Scenario5_VerifyResponse
  • Scenario5BtnTransformToDocument_Click() : XSLTTransform
  • Scenario5BtnTransformToString_Click() : XSLTTransform
  • Scenario5Button_Show_Click() : sealed , Scenario5
  • Scenario5Init() : XSLTTransform
  • Scenario5Photos() : sealed , Scenario5Photos
  • Scenario6() : Scenario6 , sealed , Scenario6 , sealed , Scenario6 , sealed , Scenario6 , sealed , Scenario6
  • Scenario6_AdInsertion() : Scenario6_AdInsertion
  • Scenario6_AppListingURI() : sealed , Scenario6_AppListingURI
  • Scenario6_ClearScenario() : Scenario6_ClearScenario
  • Scenario6_CustomEffects() : Scenario6_CustomEffects
  • Scenario6_CustomFilterAddedProps() : sealed , Scenario6_CustomFilterAddedProps
  • Scenario6_CustomProvider() : sealed
  • Scenario6_DeleteTPM() : Scenario6_DeleteTPM
  • Scenario6_DeleteTPMVSC() : sealed
  • Scenario6_GetLastVisit() : Scenario6_GetLastVisit
  • Scenario6_InterfaceSettings() : Scenario6_InterfaceSettings
  • Scenario6_ManipulatingCursorAttributes() : sealed , Scenario6_ManipulatingCursorAttributes
  • Scenario6_NavToStream() : Scenario6_NavToStream
  • Scenario6_NumeralSystemTranslation() : sealed , Scenario6_NumeralSystemTranslation
  • Scenario6_RecoverableErrors() : sealed , Scenario6_RecoverableErrors
  • Scenario6_Recurrence() : Scenario6_Recurrence
  • Scenario6_ScrollIntoView() : Scenario6_ScrollIntoView
  • Scenario6_SecondaryTileNotification() : Scenario6_SecondaryTileNotification
  • Scenario6_Styling() : sealed
  • Scenario6_TimeZone() : sealed , Scenario6_TimeZone
  • Scenario6Button_Show_Click() : Scenario6
  • Scenario6DisablePreview() : sealed , Scenario6DisablePreview
  • Scenario7() : sealed , Scenario7 , sealed , Scenario7 , sealed , Scenario7 , sealed , Scenario7
  • Scenario7_B2B() : sealed , Scenario7_B2B
  • Scenario7_CustomContent() : sealed
  • Scenario7_DeviceInformationKind() : sealed , Scenario7_DeviceInformationKind
  • Scenario7_DownloadReordering() : sealed , Scenario7_DownloadReordering
  • Scenario7_DownloadReordering::IsWebException() : sealed
  • Scenario7_ForegroundVisits() : Scenario7_ForegroundVisits
  • Scenario7_ListAllCards() : Scenario7_ListAllCards
  • Scenario7_ListSmartCards() : sealed
  • Scenario7_LiveSeekableRange() : Scenario7_LiveSeekableRange
  • Scenario7_PinFromAppbar() : Scenario7_PinFromAppbar
  • Scenario7_ScrollingContentUsingMarquee() : sealed , Scenario7_ScrollingContentUsingMarquee
  • Scenario7_SetVersion() : Scenario7_SetVersion
  • Scenario7_Share() : Scenario7_Share
  • Scenario7_SyncDevice() : Scenario7_SyncDevice
  • Scenario7_UsingUnicodeExtensions() : sealed , Scenario7_UsingUnicodeExtensions
  • Scenario7Button_Show_Click() : sealed , Scenario7
  • Scenario8() : sealed , Scenario8 , sealed , Scenario8 , sealed , Scenario8 , sealed , Scenario8
  • Scenario8::LanguageOverrideCombo_SelectionChanged() : sealed
  • Scenario8_CaptureBitmap() : Scenario8_CaptureBitmap
  • Scenario8_ClipboardSource() : Scenario8_ClipboardSource
  • Scenario8_Loaded() : Scenario7
  • Scenario8_PairDevice() : sealed , Scenario8_PairDevice
  • Scenario8_Reflow() : sealed
  • Scenario8_TransferMediaPlayer1() : Scenario8_TransferMediaPlayer1
  • Scenario8_Transmit() : sealed
  • Scenario8_TransmitAPDU() : Scenario8_TransmitAPDU
  • Scenario8_UpdateAsync() : Scenario8_UpdateAsync
  • Scenario8_VisitsBackgroundTask() : Scenario8_VisitsBackgroundTask
  • Scenario9() : Scenario9 , sealed , Scenario9 , sealed , Scenario9 , sealed , Scenario9
  • Scenario9_ClipboardTarget() : Scenario9_ClipboardTarget
  • Scenario9_ContainsFullScreenElement() : Scenario9_ContainsFullScreenElement
  • Scenario9_CustomPairDevice() : sealed , Scenario9_CustomPairDevice
  • Scenario9_TransferMediaPlayer2() : Scenario9_TransferMediaPlayer2
  • Scenario9Button_Show_Click() : Scenario9
  • Scenario_CloudFontOverview() : sealed , Scenario_CloudFontOverview
  • Scenario_ContinuousDictation() : sealed , Scenario_ContinuousDictation
  • Scenario_ContinuousRecognitionListGrammar() : sealed , Scenario_ContinuousRecognitionListGrammar
  • Scenario_ContinuousRecognitionSRGSGrammar() : sealed , Scenario_ContinuousRecognitionSRGSGrammar
  • Scenario_Document1() : sealed , Scenario_Document1
  • Scenario_Document2() : sealed , Scenario_Document2
  • Scenario_Document3() : sealed , Scenario_Document3
  • Scenario_ListConstraint() : sealed , Scenario_ListConstraint
  • Scenario_PauseAsync() : sealed , Scenario_PauseAsync
  • Scenario_PredefinedDictationGrammar() : sealed , Scenario_PredefinedDictationGrammar
  • Scenario_PredefinedWebSearchGrammar() : sealed , Scenario_PredefinedWebSearchGrammar
  • Scenario_SampleOverview() : sealed , Scenario_SampleOverview
  • Scenario_SRGSConstraint() : sealed , Scenario_SRGSConstraint
  • Scenario_SynthesizeSSML() : sealed , Scenario_SynthesizeSSML
  • Scenario_SynthesizeText() : sealed , Scenario_SynthesizeText
  • Scenario_SynthesizeTextBoundaries() : sealed , Scenario_SynthesizeTextBoundaries
  • ScenarioCleanup() : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • ScenarioCompleted() : Helpers
  • ScenarioControl_SelectionChanged() : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • ScenarioDisable() : sealed , Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling , Scenario4_OrientationChanged , Scenario5_DataEventsBatching , sealed , Scenario1_DataEvents , sealed , Scenario1_DeviceUse , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • ScenarioDisableReadingChanged() : sealed , Scenario3_ChangeEvents
  • ScenarioElement() : ScenarioElement
  • ScenarioElement_Loaded() : ScenarioElement
  • ScenarioEnable() : sealed , Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling , Scenario4_OrientationChanged , Scenario5_DataEventsBatching , sealed , Scenario1_DataEvents , sealed , Scenario1_DeviceUse , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario3_DisplayOnOff , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents
  • ScenarioEnableReadingChanged() : sealed , Scenario3_ChangeEvents
  • ScenarioEndReadButton_Click() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ScenarioEndScanButton_Click() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ScenarioGet() : sealed , Scenario2_Polling
  • ScenarioGetActivityHistory() : sealed , Scenario2_History
  • ScenarioGetCurrentActivity() : sealed , Scenario1_CurrentActivity
  • ScenarioGetData() : sealed , Scenario2_Polling , sealed , Scenario2_Polling , sealed , Scenario2_Polling
  • ScenarioGetData_Click() : Scenario2_Polling
  • ScenarioGetSensor_Click() : Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling
  • ScenarioGroup() : ScenarioGroup
  • ScenarioPage() : ScenarioPage
  • ScenarioPick_Click() : Scenario3_Choosing
  • ScenarioReadSelected_Click() : Scenario3_Choosing
  • ScenarioRegisterTask() : sealed , Scenario4_BackgroundActivity , sealed
  • ScenarioRegisterTask_Click() : Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor
  • Scenarios_SelectionChanged() : CachedFileUpdaterPage , FileSavePickerPage
  • ScenarioStart_Click() : Scenario3_Choosing
  • ScenarioStarted() : Helpers
  • ScenarioStartReadButton_Click() : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • ScenarioStartScanButton_Click() : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • ScenarioStartTriggerButton_Click() : Scenario1_BasicFunctionality
  • ScenarioStop_Click() : Scenario3_Choosing
  • ScenarioStopTriggerButton_Click() : Scenario1_BasicFunctionality
  • ScenarioTestPage_VisibleBoundsChanged() : ScenarioPage
  • ScenarioUnregisterTask() : sealed , Scenario4_BackgroundActivity , sealed
  • ScenarioUnregisterTask_Click() : Scenario4_BackgroundPedometer , sealed , Scenario4_BackgroundProximitySensor
  • SceneAnalysisEffect_SceneAnalyzed() : sealed , MainPage
  • SceneComposer() : SceneComposer
  • SceneController() : SceneController
  • SceneObject() : SceneObject
  • ScheduleAdFromScte35Payload() : Scenario5_Metadata
  • School() : School
  • scope_exit() : scope_exit< Lambda >
  • Scroll_Click() : Scenario6_ScrollIntoView
  • ScrollViewer_ViewChanged() : sealed
  • SDKTemplate::Scenario1_Advertiser::OnConnectionStatusChanged() : sealed
  • SdrOverlayEffect() : SdrOverlayEffect
  • Search_Clicked() : Scenario1_Discovery
  • SearchButton_Click() : sealed , Scenario1
  • SearchByHostNameAsync() : Scenario1_Discovery
  • SearchByRemoteSystemWatcher() : Scenario1_Discovery
  • SearchCleanup() : Scenario1_Discovery
  • SearchForSegment() : LiveSourceBufferManager
  • SearchSegmentIfOutsideBuffer() : Player
  • SecondaryAppWindowPage() : SecondaryAppWindowPage
  • SecondaryPage() : sealed , SecondaryPage
  • SecondaryViewPage() : SecondaryViewPage
  • SecondsToTicks() : StepTimer
  • SectionView() : SectionView
  • SectionView_ArticleSelected() : MainPage
  • SecureBootState_Click() : sealed , FirmwareAccess
  • SecureInterfaceConcatenateCalledEventArgs() : sealed
  • SecureInterfaceConsumer() : sealed
  • SecureInterfaceConsumer::Initialize() : sealed
  • SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs() : sealed
  • SecureInterfaceProducer() : sealed
  • SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs() : sealed
  • SecureStopViewModel() : SecureStopViewModel
  • Seek10SecondsBack_Click() : Scenario1_MultiVideoPlayback
  • Seek10SecondsForward_Click() : Scenario1_MultiVideoPlayback
  • Seek2SecondsBack_Click() : Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Seek2SecondsForward_Click() : Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • Seek30SecondsBack_Click() : Scenario3_AdaptiveSync
  • Seek30SecondsForward_Click() : Scenario3_AdaptiveSync
  • SeekBarElement() : SeekBarElement
  • SeekDelta() : Scenario3_AdaptiveSync
  • SeekDownload_Click() : sealed , Scenario5_RandomAccess
  • SeekFixedAmount_Click() : Scenario7_LiveSeekableRange
  • SeekToRequestedPosition() : Scenario7_LiveSeekableRange
  • Select() : InkRenderer
  • Select_Volume() : Scenario2_SystemDefaultMenu
  • SelectApplicationAsync() : AccessHandler
  • SelectButton_Click() : sealed , Scenario1_SelectDisplay
  • SelectCommand() : SelectCommand
  • SelectCustomItem() : Scenario2_SystemDefaultMenu
  • SelectDeviceInList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • SelectedContact() : DetailsPage
  • SelectFile() : PlaybackControl
  • SelectFilesButton_Click() : sealed , ShareFiles , Scenario1
  • SelectImageButton_Click() : sealed , Scenario6 , sealed , ShareDelayRenderedFiles , ShareImage
  • SelectInkSceneObject() : SceneComposer
  • SelectInputFile() : Scenario6_CustomEffects
  • SelectionChanged() : sealed , TripListViewModel
  • SelectionSegmentButton_Click() : sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • SelectionSegmentsButton_Click() : sealed , Scenario1_ExtractTextSegments
  • SelectItem() : sealed , Scenario1_EventAndMenuHookup
  • SelectItems() : Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView
  • SelectLayer() : sealed , Scenario10
  • Selectors() : ProtectionSelectorChoices
  • SelectOutputFile() : Scenario2_DeviceCapture
  • SelectPreferredCameraStreamSettingAsync() : sealed , CaptureDevice
  • SelectPreviouslySelectedItem() : sealed , Scenario1_EventAndMenuHookup , Scenario2_SystemDefaultMenu
  • SelectRange() : FileDataSource2
  • SelectScannerAsync() : Scenario5_DisplayingBarcodePreview
  • SelectSceneObjects() : SceneComposer
  • SelectSession() : sealed , WiFiDirectServiceManager
  • SelectSession_Click() : Scenario2 , sealed , Scenario4
  • SelectSomethingIfPossible() : Scenario3_MasterDetail
  • SelectStreams() : CMediaSource
  • SelectStroke() : SceneComposer::InkObject
  • SelectVisibleElement() : HistoryAndRoaming
  • SemanticInterpretation() : sealed , App
  • Send_Click() : SendTextMessage
  • SendAsync() : Scenario1_UTF8 , sealed , CNetworkChannel , sealed , Scenario1_UTF8 , Scenario4_PartialReadWrite
  • SendBadge_Click() : Scenario2_Notifications
  • SendBadgeNotification_Click() : Scenario6_SecondaryTileNotification
  • SendBadgeNotificationWithStringManipulation_Click() : Scenario6_SecondaryTileNotification
  • SendBadgeWithStringManipulation_Click() : Scenario2_Notifications
  • SendBooleanOutputReport_Click() : sealed , InputOutputReports
  • SendBooleanOutputReportAsync() : sealed , InputOutputReports
  • SendButton_Click() : Scenario2_ChatServer
  • sendButton_Click() : Scenario3_SendMIDIMessages
  • SendButton_Click() : Scenario1_ChatClient , Scenario3_BgChatServer , Scenario1_Send , RequestResponse
  • SendCompletionMessageForCancellation() : sealed , AdventureWorksVoiceCommandService
  • SendCompletionMessageForDestination() : sealed , AdventureWorksVoiceCommandService
  • SendDataAsync() : Scenario2_Twitter , Scenario3_Flickr , Scenario2_Binary
  • SendDataLoop() : sealed
  • SendDescribeRequest() : CMediaSource
  • SendDescription() : CMediaSink
  • SendFeedback_Clicked() : Scenario4_InteractionFeedback
  • SendHeadRequestAsync() : Downloader
  • SendHello_Click() : sealed , Scenario3 , sealed , Scenario3
  • SendHttpGetButton_Click() : Scenario09_GetCookie
  • SendHttpGetRequestAsync() : Helpers
  • SendInitialGetButton_Click() : Scenario12_DisableCookies
  • SendInitSegment() : SourceBufferManager
  • SendMediaSegment() : LiveSourceBufferManager , SourceBufferManager
  • SendMessage() : Scenario3_BgChatServer , Scenario1_ChatClient , Scenario2_ChatServer
  • SendMessage_Click() : sealed , Scenario5
  • SendMessageAsync() : SocketWrapper
  • SendMessageToRemoteAppServiceAsync() : Scenario3_LaunchAppServices
  • SendNextRequestButton_Click() : Scenario12_DisableCookies
  • SendNumericOutputReport_Click() : InputOutputReports , sealed
  • SendNumericOutputReportAsync() : sealed , InputOutputReports
  • SendPacket() : CMediaSink
  • SendRequestAsync() : HttpRetryFilter , AddAuthorizationHeaderFilter , PlugInFilter , HttpMeteredConnectionFilter , CMediaSource
  • SendSampleFromQueue() : CStreamSink
  • SendSecureStopRecords() : SecureStopViewModel
  • SendStartRequest() : CMediaSource
  • SendTextMessage() : SendTextMessage , sealed , Scenario2_Load
  • SendTextSignal() : Scenario1ViewModel
  • SendTile_Click() : Scenario2_Notifications
  • SendTileNotification_Click() : Scenario6_SecondaryTileNotification
  • SendTileNotificationWithStringManipulation_Click() : Scenario6_SecondaryTileNotification
  • SendTileWithStringManipulation_Click() : Scenario2_Notifications
  • SendVendorControlTransferInToDeviceRecipientAsync() : Scenario2_ControlTransfer
  • SerializeAccountListToXml() : AccountsHelper
  • SerializeHeaderCollection() : Helpers
  • SerializeHeaders() : Helpers
  • SerializeToBlob() : CBaseAttributes< TBase >
  • SerializeToStream() : CBaseAttributes< TBase >
  • ServiceCtrlHandler() : CServiceBase
  • ServiceList_SelectionChanged() : Scenario2_Client
  • ServiceMain() : CServiceBase
  • ServiceProvider_AdvertisementStatusChanged() : Scenario3_ServerForeground
  • ServiceProviderInitAsync() : Scenario3_ServerForeground
  • ServiceRequested() : ProactiveViewModel , HardwareDRMViewModel , ReactiveViewModel , SecureStopViewModel
  • ServiceStatusConverter() : Helpers::sealed
  • ServiceViewModel() : sealed , ServiceViewModel
  • ServiceViewModel::ResumeMeteringService() : sealed
  • ServiceViewModel::SuspendMeteringService() : sealed
  • ServicingComplete() : sealed
  • ServicingCompleteTask() : sealed , ServicingCompleteTask
  • SessionConnected() : sealed , Scenario3
  • SessionJoinedHandler() : AllJoynHelpers
  • SessionLostHandler() : AllJoynHelpers
  • SessionMemberAddedHandler() : AllJoynHelpers
  • SessionMemberRemovedHandler() : AllJoynHelpers
  • SessionRequestWrapper() : sealed , SessionRequestWrapper
  • SessionRevoked() : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks
  • SessionStateForFrame() : SuspensionManager
  • SessionWrapper() : sealed , SessionWrapper
  • Set_ClipboardNoUI() : Scenario11_CPDNoUI
  • Set_ClipboardSource() : Scenario8_ClipboardSource
  • SetAction() : IGameUIControl , GameInfoOverlay , sealed , IGameUIControl
  • SetActive() : CMediaStream
  • SetActiveChallenge() : DAL
  • SetActiveSymbologies_Click() : Scenario3_ActiveSymbologies
  • SetAllJoynMessageArg() : TypeConversionHelpers
  • SetAmplitude() : RippleEffect
  • SetApplicationMode() : SourceHandler
  • SetAppLocalSettingsValue() : sealed
  • SetAt() : GroupInfoList
  • SetAudioCategory() : PlaybackControl
  • SetAudioClientChannelVolume() : WASAPIRenderer
  • SetAudioDeviceType() : PlaybackControl
  • SetAutoPlay() : ContentSelector
  • SetBackground() : GameMain , GameRenderer , Simple3DGame
  • SetBackgroundAudio() : WASAPIRenderer
  • SetBitrateDowngradeTriggerRatio_Click() : Scenario4_Tuning
  • SetBlob() : CBaseAttributes< TBase >
  • SetBrush() : BaseElement
  • SetBrushColor() : RectRenderer , LowLatencyInputMain
  • SetBufferDuration() : WASAPIRenderer
  • SetBusy() : Scenario4_PartialReadWrite , sealed , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario2_Binary , Scenario3_ClientAuthentication
  • setButtonState() : Scenario1
  • SetCancelButton() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • SetCanvasSize() : sealed , Scenario6
  • SetCardActivationPolicy() : NfcUtils
  • SetCardDataScenario() : SetCardDataScenario
  • SetCenter() : RippleEffect
  • SetChatUI() : Scenario1_ChatClient
  • SetClaimedUI() : sealed , Scenario3_MultipleDrawers
  • SetColor() : SpinningCubeRenderer
  • SetColorFadeTimer() : final
  • SetCommandsVisibility() : Scenario4_EdgeTappedListView
  • SetCompleted() : StepsControl
  • SetCompositionScale() : DeviceResources
  • SetComputeInfo() : DftTransform
  • SetConfiguration() : InkEventLogger
  • SetConnected() : sealed , CStreamSink
  • SetConnectedFunc() : SetConnectedFunc
  • SetConstantBuffer() : RenderingHelper
  • SetContentSize() : DeviceResources , SceneComposer
  • SetContentStream() : WASAPIRenderer
  • SetContentType() : WASAPIRenderer
  • SetContentZoomFactor() : DeviceResources , SceneComposer
  • SetCookie_Click() : Scenario10_SetCookie
  • SetCurrentLength() : CMediaBufferWrapper
  • SetCurrentLevelToSavedState() : Simple3DGame
  • SetCurrentMediaType() : CStreamSink
  • SetCurrentOrientation() : DeviceResources
  • SetCurrentTool() : SourceHandler
  • SetData() : CSourceOperation
  • SetDebugName() : BasicLoader
  • SetDefaultButton_Click() : sealed
  • SetDefaultRecognizerByCurrentInputMethodLanguageTag() : sealed , Scenario4
  • SetDefaultStyleCombobox_SelectionChanged() : sealed , Scenario9
  • SetDesiredBitrateHeadroomRatio_Click() : Scenario4_Tuning
  • setDestinationValidation() : sealed
  • SetDeviceWatcherUI() : Scenario1_ChatClient
  • SetDistance() : Cursor
  • SetDouble() : CBaseAttributes< TBase >
  • SetDPI() : DeviceResources , SceneComposer
  • SetDpi() : DeviceResources
  • SetDrawInfo() : LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect , FilmicEffect
  • SetDropMode() : CMediaStream
  • SetElementMargin() : BaseElement
  • SetElementSize() : BaseElement
  • SetEnabled() : ControlBase , IControl , RadioModel
  • SetEncodingProperties() : AudioEchoEffect
  • SetEndPoint() : Line
  • SetEnvironment() : OmnidirectionalSound , CardioidSound , OmnidirectionalSound , CustomDecaySound
  • SetError() : sealed , Scenario1_Message , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions
  • SetErrorMessage() : sealed , SetErrorMessage
  • SetEvent() : PropertySetContext , PropertyGetContext< T > , PropertySetContext , PropertyGetContext< T >
  • SetExtendedSplashInfo() : MainPage
  • SetFacesCanvasRotation() : sealed , MainPage
  • SetFeatureName() : CachedFileUpdaterPage , FileSavePickerPage , FileOpenPickerPage
  • SetFireRect() : MoveLookController
  • SetFirstSelectedPeriod() : Manifest
  • SetFixedTimeStep() : StepTimer
  • SetFolder() : FileDataSource , FileDataSource2
  • SetFrequency() : RippleEffect , WASAPIRenderer
  • SetGameInfoOverlay() : GameMain
  • SetGameLoading() : GameInfoOverlay , IGameUIControl , sealed , IGameUIControl , GameInfoOverlay
  • SetGameOver() : GameInfoOverlay , sealed , IGameUIControl
  • SetGameStats() : IGameUIControl , GameInfoOverlay , sealed , IGameUIControl , GameInfoOverlay
  • SetGeotagButton_Click() : sealed , Scenario1_Geotag
  • SetGeotagFromGeolocatorButton_Click() : sealed , Scenario1_Geotag
  • SetGradientPatternToLampArray() : Scenario1_Basics
  • SetGraph() : FilmicEffect , ReinhardEffect , SdrOverlayEffect , DftEffect , WaveEffect , RippleEffect , LuminanceHeatmapEffect
  • SetGUID() : CBaseAttributes< TBase >
  • SetHologramEnabled() : MediaCaptureManager
  • SetHolographicSpace() : _360VideoPlaybackMain , DeviceResources , _360VideoPlaybackMain , DeviceResources , BasicHologramMain , DeviceResources , BasicHologramMain , HolographicTemplateAppMain , DeviceResources , HolographicMRCSampleMain , DeviceResources , HolographicSpatialMappingMain , DeviceResources , HolographicSpatialStageMain , DeviceResources , HolographicVoiceInputMain , DeviceResources , HolographicTagAlongSampleMain , HolographicPaintMain , HolographicFaceTrackerMain , DeviceResources , HolographicApp1Main
  • SetHWOffload() : WASAPIRenderer
  • SetIgnoreLayout() : BaseElement
  • setIncrementalFileList() : Scenario1
  • SetInkSynchronizer() : SceneComposer
  • SetInterfaceSetting() : Scenario6_InterfaceSettings
  • SetInternalFocus() : CustomEditControl
  • SetIsActive() : final
  • SetIsUpperCaseEnabledAsync() : ISecureInterfaceService , sealed , Scenario1ViewModel , SecureInterfaceService
  • SetIsVisible() : BaseControl , BaseElement
  • SetItem() : MediaListViewModel , CBaseAttributes< TBase >
  • SetItemInvokedCallback() : sealed
  • SetLayoutHorizontal() : BaseElement
  • SetLayoutWidth() : sealed
  • SetLedBlinkPattern_Click() : FeatureReports , sealed
  • SetLedBlinkPatternAsync() : sealed , FeatureReports
  • SetLevelStart() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed , IGameUIControl
  • SetLicenseInfo() : GameHud
  • SetLineSpacing() : sealed
  • SetLineSpacingDefaults() : sealed
  • setLiveOffsetButton_Click() : LiveDashPlayer
  • SetLiveOffsetValue() : Player
  • SetLockScreenImage() : sealed , SetLockScreenImage
  • SetLogicalSize() : DeviceResources
  • SetLowLatency() : WASAPIRenderer
  • SetLowLatencyCapture() : WASAPICapture
  • SetMapProjection() : sealed , Scenario1
  • SetMapStyle() : sealed , Scenario1
  • SetMapStyleSheet() : sealed , Scenario9
  • SetMargins() : sealed
  • SetMaterialIndicesAsync() : Scenario1_Print
  • SetMaxBitrateForProtectionLevel() : Scenario3_RequestModification
  • SetMediaSource() : ProjectionViewPage
  • SetMediaStreamProperties() : CMediaSink
  • SetMediaStreamPropertiesAsync() : MediaCapturePreviewer
  • SetMinimumSize_Click() : sealed , Scenario1_Basic
  • SetMoveRect() : MoveLookController
  • SetNewMediaItem() : Scenario1
  • SetNextSelectedPeriod() : Manifest
  • SetOffset() : CMediaBufferWrapper
  • SetOnAirTapCallback() : ControlBase , IControl
  • SetOrientation() : Tool
  • SetOsrFx2SevenSegmentAsync() : Scenario2_ControlTransfer
  • SetOsrFx2SevenSegmentSetting_Click() : Scenario2_ControlTransfer
  • SetOutputFileButton() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • SetPageContent() : CustomTitleBar
  • SetParentControlInformation() : FocusableElement
  • SetParentTransform() : BaseControl , BaseElement
  • SetPasswordExplainVisibility() : sealed , Scenario3_CredentialPickerOptions
  • SetPause() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed , IGameUIControl
  • SetPhase() : RippleEffect
  • SetPickFileButton() : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • SetPinHigh_Click() : sealed , Scenario1_GetAndSetPin
  • SetPinLow_Click() : sealed , Scenario1_GetAndSetPin
  • SetPlane() : Face
  • SetPlaybackEnabled() : ViewModelBase
  • SetPosition() : BaseControl , SpinningCubeRenderer , ControlBase , IControl , SpinningCubeRenderer , Tool , ToolCarousel , SpinningCubeRenderer
  • SetPresentationClock() : CMediaSink
  • SetPreviewRotationAsync() : Scenario5_DisplayingBarcodePreview , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , OcrCapturedImage , MainPage , OcrCapturedImage , sealed
  • SetProductItems() : sealed
  • SetProjParams() : Camera
  • SetProperties() : AudioEchoEffect , CMediaSink , CSchemeHandler , WASAPICapture , WASAPIRenderer
  • SetProperty< T >() : BindableBase
  • SetQualityLevel() : CMediaStream
  • SetQueueID() : EmbeddedMFAsyncCallback< Callback >
  • SetRadioState() : RadioModel
  • SetRadius() : Ellipse , FilledEllipse
  • SetRate() : CMediaSource , CMediaStream
  • SetRatio() : CBaseAttributes< TBase >
  • SetRawAudio() : WASAPIRenderer
  • SetReadingText() : MainPage
  • SetRecognizerByName() : sealed , Scenario4
  • SetRect() : Rectangle , FilledRectangle
  • SetRectSize() : RectRenderer , LowLatencyInputMain
  • SetReleasedUI() : sealed , Scenario3_MultipleDrawers
  • SetRenderElement() : BaseControl
  • SetRenderOptions() : D2DAdvancedColorImagesRenderer
  • SetResult() : sealed , Scenario1_Message , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions , SimpleTaskCompletionSource< T > , SimpleTaskCompletionSource< void > , sealed
  • SetRotation() : ControlBase , IControl
  • SetSampleAttributes() : CMediaStream
  • SetSamplePeriod() : sealed , ServiceViewModel , Metering
  • SetSampleRate() : ServiceViewModel , sealed
  • SetScale() : BaseControl , IControl , ControlBase
  • SetScaleValue() : D2DSvgImageRenderer
  • SetSelectedDevice() : DeviceList
  • SetSelectedModel() : ContentSelector
  • SetSelection() : CustomEditControl
  • SetSelectionAndNotify() : CustomEditControl
  • SetServiceOptionsAsync() : sealed , DiscoveredDeviceWrapper
  • SetServiceStatus() : CServiceBase
  • setShowDelete() : sealed
  • setShowDestinationValidation() : sealed
  • SetSingleControl() : MainPage
  • SetSize() : CBaseAttributes< TBase >
  • SetSkewX() : WaveEffect
  • SetSkewY() : WaveEffect
  • SetSocket() : CNetworkChannel
  • SetSource_Click() : ContentSelector
  • SetSourceEnabled() : ContentSelector
  • SetSpread() : RippleEffect
  • SetStartDateTimeToUI() : Scenario4_ForegroundGeofence
  • SetStartPoint() : Line
  • SetState() : DeviceStateSourceT< D >
  • SetStateNoNotify() : DeviceStateSourceT< D >
  • SetStatus() : PropertyGetContext< T > , sealed , PropertySetContext
  • SetString() : CBaseAttributes< TBase >
  • SetStyleSheetStateCombobox_SelectionChanged() : sealed , Scenario11
  • SetSubstatus() : Scenario4_CompletionGroups
  • SetSuperMuttInterfaceSetting_Click() : Scenario6_InterfaceSettings
  • SetSuperMuttLedBlinkPattern_Click() : Scenario2_ControlTransfer
  • SetSuperMuttLedBlinkPatternAsync() : Scenario2_ControlTransfer
  • SetSwapChainPanel() : DeviceResources
  • SetSwitch() : Button
  • SetSymbologyAttributes_Click() : Scenario4_SymbologyAttributes
  • SetSystemAudioEnabled() : MediaCaptureManager
  • SetTargetElapsedSeconds() : StepTimer
  • SetTargetElapsedTicks() : StepTimer
  • SetTargetPosition() : SpinningCubeRenderer
  • SetTexCoordScaleAndOffset() : QuadRenderer
  • SetText() : Text
  • SetTextBackgroundColor() : sealed
  • SetTextColor() : sealed
  • SetTexture() : Material
  • SetTextureHeight() : BaseControl
  • SetTextureWidth() : BaseControl
  • SetTilePayload() : UpdateFourTilesControl
  • Settings() : Settings
  • SettingsService_UseCustomControlsChanged() : Scenario1
  • SetTitle() : SecondaryViewPage
  • SetTitle_Click() : SecondaryViewPage
  • SetToolByIndex() : HolographicPaintMain
  • SetTranscodeButton() : sealed , Scenario2_Custom , Scenario1_Default , Scenario3_Trim
  • SetTranslation() : BaseElement
  • SetTriangleIndicesAsync() : Scenario1_Print
  • SetUI() : Scenario2_MultipleScanners
  • SetUINT32() : CBaseAttributes< TBase >
  • SetUINT64() : CBaseAttributes< TBase >
  • SetUnknown() : CBaseAttributes< TBase >
  • Setup_Click() : Scenario1
  • SetUpAccounts() : sealed , UserSelect
  • SetupBackgroundTask() : Scenario7_SyncDevice
  • SetUpBasedOnStateAsync() : MainPage , sealed
  • SetupBlur() : Scenario2_Conditional
  • SetupBroadcastScenarioUI() : sealed , Scenario5
  • SetupDataSource() : FileDataSource
  • SetupDataSourceImpl() : FileDataSource
  • SetupDataSourceUsingPicturesFolder() : FileDataSource
  • SetupDataSourceUsingPicturesFolderImpl() : FileDataSource
  • SetupDestinationEffect() : Scenario2_Conditional
  • SetUpDeviceScenarios() : Utilities
  • SetupMulticastScenarioUI() : sealed , Scenario5
  • SetUpProtectionManager() : PlayReadyHelper
  • SetupSystemMediaTransportControls() : Scenario1
  • SetupUiAsync() : sealed , MainPage , sealed , MainPage , sealed
  • SetUpVideoStabilizationRecommendationAsync() : sealed , MainPage
  • SetupVisualization() : Scenario2_DetectInWebcam , Scenario1_DetectInPhoto , Scenario2_DetectInWebcam , Scenario1_DetectInPhoto , Scenario1_TrackInWebcam
  • SetValue() : PropertyGetContext< T >
  • SetValuesFromLineDisplay() : Scenario4_UpdatingLineDisplayAttributes , sealed
  • SetVariantArg() : TypeConversionHelpers
  • SetVariantStructureArg() : TypeConversionHelpers
  • SetVersion0_Click() : Scenario7_SetVersion
  • SetVersion1_Click() : Scenario7_SetVersion
  • SetVersionHandler0() : Scenario7_SetVersion
  • SetVersionHandler1() : Scenario7_SetVersion
  • SetVerticesAsync() : Scenario1_Print
  • SetViewParams() : Camera
  • SetViewSize() : DeviceResources
  • SetVisibility() : Scenario2_Client
  • SetVolumeOnSession() : WASAPIRenderer
  • SetWasdPatternToLampArray() : Scenario1_Basics
  • SetWaveOffset() : WaveEffect
  • SetWindow() : AppView , DeviceResources , sealed , AppView , sealed , DeviceResources , sealed , App , DeviceResources , VisualProperties , sealed , DeviceResources , sealed , DeviceResources , sealed , DeviceResources , sealed
  • SetZoomLevel() : MainPage
  • SevenSegmentToDigit() : Fx2Driver
  • Shaken() : sealed , Scenario2_ShakeEvents
  • ShapeObject() : SceneComposer::ShapeObject
  • ShapeRenderer() : ShapeRenderer
  • Share_Click() : Scenario12_ShareData
  • ShareApplicationLink() : ShareApplicationLink , sealed
  • ShareContent_Click() : Scenario7_Share
  • ShareCustomData() : sealed , ShareCustomData
  • ShareCustomProvider() : sealed , ShareCustomProvider
  • ShareDelayRenderedFiles() : ShareDelayRenderedFiles , sealed
  • ShareFiles() : sealed , ShareFiles
  • ShareHtml() : sealed , ShareHtml
  • ShareImage() : ShareImage , sealed
  • ShareTarget() : ShareTarget
  • ShareText() : ShareText , sealed
  • ShareWebLink() : ShareWebLink , sealed
  • ShareWebView_NavigationCompleted() : ShareHtml , sealed
  • ShouldApplyContentZoomFactor() : DeviceResources
  • ShouldAttemptToConnectToInternet() : Helpers
  • ShouldDropSample() : CMediaStream
  • ShouldGoToWideState() : DetailsPage , DetailPage
  • ShouldIgnoreCertificateErrorsAsync() : sealed , Scenario5
  • ShouldMirrorPreview() : sealed , CameraRotationHelper
  • Show() : MediaTransportControls
  • Show_Click() : Scenario5_Show
  • ShowAsStandalone_Click() : Scenario1
  • ShowConnection() : ShowConnection
  • ShowConnectionUI_Click() : ShowConnection
  • ShowConsentGroups() : Scenario3_CheckUserConsentGroup
  • ShowContactCard_Click() : sealed , Scenario2_DelayMini , Scenario1_Mini , Scenario3_Full
  • ShowContactCardWithOptions_Click() : sealed , Scenario1_Mini
  • ShowContactCardWithPlacement_Click() : sealed , Scenario1_Mini
  • ShowCursor() : MoveLookController
  • ShowDevicePicker() : Scenario1_DevicePicker , sealed , Scenario1_DevicePicker
  • ShowDevicePickerButton_Click() : Scenario1_DevicePicker , sealed , Scenario1_DevicePicker
  • ShowDialog() : ManageCardScenario
  • ShowFormatButton_Click() : OtherScenarios
  • ShowGameInfoOverlay() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed , IGameUIControl
  • ShowGuidance() : CalibrationBar , sealed , CalibrationBar , sealed
  • ShowGuidanceButton_Click() : CalibrationBar , sealed , CalibrationBar , sealed
  • ShowItem() : Scenario2 , Scenario1
  • ShowListButton_Click() : Scenario7 , sealed , Scenario7
  • ShowOnboardeeSsidList() : Scenario2ViewModel
  • ShowOnboarderSsidList() : Scenario2ViewModel
  • ShowPackageFamilyName() : ShowPackageFamilyName
  • ShowPairingPanel() : Scenario9_CustomPairDevice , sealed
  • ShowPlaceholder() : Functions , sealed
  • ShowPreviewButton_Click() : Scenario5_DisplayingBarcodePreview
  • ShowPrintUIAsync() : PrintHelper
  • ShowProgressScreen() : AdventureWorksVoiceCommandService , sealed
  • ShowProperties() : Scenario1_FindUsers
  • ShowPropertiesButton_Click() : Scenario6 , sealed , Scenario6
  • ShowResults_Click() : Scenario2_Lang , Scenario4_UnicodeExtensions , sealed , Scenario2_Stats , Scenario1_Data , Scenario3_Enum , Scenario5_TimeZone , sealed , Scenario1_Prefs , Scenario4_Input , Scenario2_Lang , Scenario3_Region , Scenario1_Prefs , Scenario5_TimeZone , Scenario3_Region , sealed , Scenario2_Stats , Scenario4_UnicodeExtensions , Scenario3_Enum , sealed , Scenario1_Data
  • ShowSatelliteData() : Scenario2_GetPosition
  • showSpaceNeedleButton_Click() : Scenario4 , sealed
  • ShowStandardSystemOverlaysButton_Click() : sealed , Scenario1_Basic
  • ShowStatusMessage() : sealed
  • ShowStoreFlyout() : sealed
  • showStreetSideNearSpaceneedle_Click() : Scenario5 , sealed
  • ShowText() : Scenario8 , sealed
  • ShowToast() : UpdateFileTask , App , SocketActivityTask
  • ShowTooSmall() : GameInfoOverlay , IGameUIControl , GameInfoOverlay , sealed
  • ShowTrialPeriodInformation() : sealed , Scenario1_TrialMode
  • ShowTrip() : TripViewModel , sealed
  • ShowUIButton_Click() : SharePage
  • ShowUnhandledException() : UnhandledExceptionPage
  • ShowVisual() : EdgeTappedListView
  • ShowWindowBtn_Click() : Scenario3_Size , Scenario5_RelativePositioning , Scenario3_Size , Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario4_CompactOverlay
  • Shutdown() : MFSampleGenerator , CServiceBase , CMediaSink , CMediaSource , CStreamSink , MFSampleGenerator , CMediaStream
  • ShutdownWebcamAsync() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • ShutterCheckBox_CheckedChanged() : MainPage
  • ShutterSlider_ValueChanged() : MainPage
  • SignalBackgroundTask() : ApplicationTriggerTask , sealed , ApplicationTriggerTask , sealed
  • Signals_ConnectionResultReceived() : Scenario2ViewModel
  • Signals_TextSentReceived() : Scenario1ViewModel
  • SignIn() : SignIn , sealed
  • SignInPassportAsync() : SignIn , sealed
  • SignInPasswordAsync() : SignIn , sealed
  • SignInWithHello() : MainPage
  • SignInWithHelloAsync() : MainPage
  • SignInWithPassword() : MainPage
  • SignOut() : AccountOverviewPage
  • SimCard() : SimCard
  • Simple3DGame() : Simple3DGame
  • SimpleLogger() : SimpleLogger , sealed
  • SimpleOrientationSensor_OrientationChanged() : sealed , CameraRotationHelper
  • SimpleTaskCompletionSource() : SimpleTaskCompletionSource< void >
  • Simulate_Update_Collision_Click() : FileSavePicker_SaveToCachedFile
  • SingleAccountScenario() : SingleAccountScenario
  • SingleAzureADScenario() : SingleAzureADScenario
  • SingleMicrosoftAccountScenario() : SingleMicrosoftAccountScenario
  • SingleSpace_Click() : sealed
  • Size() : GroupInfoList
  • SizeCounter() : sealed::sealed
  • SizePreferenceString() : SizePreferenceString
  • SkeletalFrameRenderer() : sealed
  • SkipButton_Click() : Scenario3_ForegroundApp
  • SkipNext() : PlayerViewModel
  • SkipPrevious() : PlayerViewModel
  • SkipSetup() : EnableHelloPage
  • Sleep() : sealed , PhasingTests
  • slider_ValueChanged() : sealed , MeteringData
  • Slider_ValueChanged() : sealed
  • SliderChanged() : sealed
  • sliderFrequency_ValueChanged() : sealed , Scenario3 , sealed , Scenario2
  • sliderVolume_ValueChanged() : Scenario3 , sealed , Scenario2
  • SlowInputStream() : SlowInputStream
  • SlowPhasing_Checked() : PhasingTests , sealed
  • SlowPhasing_UnChecked() : PhasingTests , sealed
  • SmartCardListItem() : SmartCardListItem
  • SnapInitialSizeToRootElement() : BaseControl
  • SnapMovableRectToGridLines() : Scenario5_InkingAndInteractionFeedback
  • SnapshotCanvas_SizeChanged() : Scenario2_DetectInWebcam
  • SocialMediaCounter() : SocialMediaCounter
  • SocketContext() : sealed
  • SocketReaderWriter() : SocketReaderWriter , sealed
  • SocketRW() : ConnectedDevice
  • SocketWrapper() : SocketWrapper , sealed
  • SoftwareTriggerStarted() : Scenario5_DisplayingBarcodePreview
  • SoundEffect() : SoundEffect
  • SoundEffectEngine() : Audio
  • SoundLevelToString() : PlaybackControl
  • Source_OpenOperationCompleted() : Scenario5_Metadata , Scenario6_AdInsertion
  • SourceBufferManager() : SourceBufferManager
  • SourceComboBox_SelectionChanged() : sealed , Scenario2_FindAvailableSourceGroups
  • SourceGrid_DragStarting() : Scenario2_DragUICustomization , sealed
  • SourceGroupCollection() : SourceGroupCollection , sealed
  • SourceHandler() : SourceHandler
  • SourceId() : SourceHandler
  • SourceList_SelectionChanged() : Scenario1
  • SourceListView_DragItemsStarting() : sealed , Scenario1_ListView
  • SourcePositionX_ValueChanged() : sealed
  • SourcePositionY_ValueChanged() : sealed
  • SourcePositionZ_ValueChanged() : sealed
  • SourcePressed() : IDPadHelper , TouchpadDPadHelper
  • SourceTextBlock_DragStarting() : Scenario3_StartDragAsync , sealed
  • SourceTextBlock_PointerMoved() : sealed , Scenario3_StartDragAsync
  • SpatialControllerHandler() : SpatialControllerHandler
  • SpatialInputHandler() : SpatialInputHandler
  • SpatialStageManager() : SpatialStageManager
  • Speak_Click() : sealed , Scenario_SynthesizeSSML , sealed , Scenario_SynthesizeTextBoundaries , Scenario_SynthesizeText , sealed
  • SpecificHistory_Checked() : Scenario2_History , sealed
  • SpeechRecognizer_HypothesisGenerated() : Scenario_ContinuousDictation , sealed
  • SpeechRecognizer_StateChanged() : Scenario_ListConstraint , sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_PredefinedDictationGrammar , sealed , Scenario_ContinuousDictation , sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint , Scenario_PredefinedWebSearchGrammar , Scenario_PauseAsync
  • speedButton_Click() : Scenario1 , Scenario6
  • Sphere() : Sphere
  • SphereMesh() : SphereMesh
  • SpinningCubeRenderer() : SpinningCubeRenderer
  • SplitViewButton_Click() : MainPage
  • StandardOptionsPrintHelper() : StandardOptionsPrintHelper , sealed
  • Start() : Animate , sealed , OmnidirectionalSound , Scenario1ViewModel , BackgroundActivity , MidiDeviceWatcher , CMediaSource , CustomDecaySound , CardioidSound , sealed , Turn , Print3D , Scenario2ViewModel , Scenario1ViewModel , CServiceBase , BackgroundActivity , CStreamSink , GameTimer , CMediaStream , OmnidirectionalSound
  • Start_Click() : Scenario08_PostCustomContent , Scenario03_GetList , sealed , Scenario08_PostCustomContent , Scenario05_PostStream , Scenario04_PostText , Scenario02_GetStream , Scenario07_PostStreamWithProgress , Scenario04_PostText , Scenario01_GetText , Scenario06_PostMultipart , Scenario13_RetryFilter , Scenario15_ServerCertificateValidation , sealed , Scenario14_MeteredConnectionFilter , sealed , CustomException , sealed , OvenClient , sealed , Scenario05_PostStream , sealed , CustomException , sealed , CustomException , sealed , Scenario14_MeteredConnectionFilter , OvenClient , Scenario03_GetList , Scenario15_ServerCertificateValidation , sealed , Scenario07_PostStreamWithProgress , OvenClient , Scenario06_PostMultipart , Scenario13_RetryFilter , Scenario02_GetStream , Scenario01_GetText , sealed
  • StartAdvertisement() : WiFiDirectServiceManager
  • StartAsync() : Scenario2_Binary , CameraCoordinateMapper , sealed , CameraStreamProcessor , Scenario2_Binary
  • StartBleDeviceWatcher() : Scenario1_Discovery
  • StartButton_Click() : Scenario3_StartDragAsync , Scenario2_FindAvailableSourceGroups , sealed
  • StartCameraAsync() : sealed , OcrCapturedImage
  • StartCaptureAsync() : WASAPICapture
  • StartDevice() : sealed , Scenario2 , sealed , Scenario3
  • StartDeviceWatcher() : EventHandlerForDevice , sealed , EventHandlerForDevice
  • StartDeviceWatchers() : Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect , sealed , Scenario1_ConnectDisconnect
  • StartDownload() : Scenario1_Download , sealed
  • StartDownload_Click() : sealed , Scenario7_DownloadReordering , sealed , Scenario5_RandomAccess , sealed , Scenario1_Download , Scenario6_RecoverableErrors
  • StartDownloadAndReadContentsAsync() : sealed , Scenario5_RandomAccess
  • StartDownloadsButton_Click() : Scenario4_CompletionGroups , sealed
  • StartFadeIn() : QuadRenderer
  • StartFadeOut() : QuadRenderer
  • StartFadeOutContents() : Scenario3
  • startFetchData() : ItemCacheManager< T >
  • StartFunc() : StartFunc
  • StartFx2Watcher() : DeviceList
  • StartHandlingAppEvents() : Scenario1_ConnectDisconnect , sealed , Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect
  • StartHighPriorityDownload_Click() : sealed , Scenario1_Download
  • StartInputLoop() : PlaybackPage , sealed
  • StartInterruptMessageWorker() : sealed
  • StartLassoSelection() : SceneComposer
  • StartLevel() : Simple3DGame
  • StartListener_Click() : sealed , Scenario1 , sealed , Scenario1 , Scenario5 , sealed
  • StartListening() : CMediaSink
  • StartLocationTrackingAsync() : sealed , LocationTrackingReason
  • StartLogging() : LoggingSessionScenario , sealed , FileLoggingSessionScenario , LoggingSessionScenario , FileLoggingSessionScenario
  • StartManifestReloadTimer() : Player
  • StartMediaCaptureAsync() : Scenario5_DisplayingBarcodePreview
  • StartMetering() : Metering , sealed , ServiceViewModel
  • StartMeteringAndWaitForStop() : ServiceViewModel , sealed
  • StartMonitoring() : Scenario7_ForegroundVisits
  • StartMonitoring_Click() : AccountWatcher
  • StartMultipartUpload_Click() : Scenario2_Upload , sealed
  • StartMultipleFilesUpload() : Scenario2_Upload
  • StartPlayback() : WASAPIRenderer
  • StartPlaybackAsync() : WASAPIRenderer
  • StartPreviewAsync() : MainPage , OcrCapturedImage , sealed , MainPage , sealed , OcrCapturedImage , sealed , MainPage , sealed
  • StartPrinting() : Print3D
  • StartProcessingDataVirtualizationScrollOffsets() : sealed , ChatListView
  • StartProjecting() : Scenario3 , sealed
  • StartProjecting_Click() : Scenario2 , sealed , Scenario1
  • StartReaderAsync() : Scenario2_FindAvailableSourceGroups , sealed
  • StartReceiveData() : sealed
  • StartReceiveLoop() : sealed
  • StartReceiving() : CMediaSink
  • StartRecognizeSpeechCommands() : HolographicVoiceInputMain
  • StartRecordingAsync() : MediaCaptureManager , sealed , CaptureDevice , MainPage , sealed , MainPage , sealed , MainPage , sealed
  • StartRecordingToCustomSink() : sealed , LowLatency
  • StartRecordingToCustomSinkAsync() : sealed
  • StartRecordToCustomSink() : VideoChat
  • StartRenderLoop() : LowLatencyInputMain , GameMain
  • StartRotation() : ToolCarousel
  • StartScanning() : Scenario2ViewModel
  • StartScenario() : Scenario2_Listen , sealed , Scenario1_GetAndSetPin , sealed , Scenario1_GetAndSetPin , Scenario2_Listen
  • StartScenarioAsync() : sealed , Scenario1_ReadData , sealed , Scenario1_ReadData
  • StartScrollingButton_Click() : Scenario7_ScrollingContentUsingMarquee , sealed
  • StartSendData() : sealed
  • StartSensorBackgroundTaskAsync() : Scenario1_DeviceUse , sealed
  • StartSingleFileUpload() : Scenario2_Upload
  • StartSoftwareTriggerButton_Click() : Scenario5_DisplayingBarcodePreview
  • StartSource() : MFSampleGenerator
  • StartStopAllEffects() : Scenario2_Effects
  • StartStopScenario_Click() : sealed , Scenario2_Listen , Scenario1_ReadData , Scenario1_GetAndSetPin , sealed , Scenario1_ReadData , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData , Scenario1_GetAndSetPin
  • StartStrokeSelection() : sealed
  • StartSuperMuttInputReports() : sealed , InputReportEvents
  • StartSyncBackgroundTaskAsync() : Scenario7_SyncDevice
  • StartTimerForFrame() : GpuPerformanceTimer
  • StartTracking() : Scenario1_TrackPosition
  • StartUnpairedDeviceWatcher() : Scenario1_ChatClient
  • StartUpload_Click() : sealed , Scenario2_Upload
  • StartUsingWindowsHello() : EnableHelloPage
  • StartViewInUse() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • StartWatcher() : sealed , Scenario8_PairDevice , Scenario6_CustomFilterAddedProps , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , sealed , Scenario8_PairDevice , Scenario3_BackgroundDeviceWatcher , sealed , Scenario6_CustomFilterAddedProps , Scenario2_DeviceWatcher , sealed , Scenario3_BackgroundDeviceWatcher , Scenario9_CustomPairDevice , DeviceWatcherHelper
  • StartWatcherButton_Click() : sealed , Scenario7_DeviceInformationKind , Scenario8_PairDevice , sealed , Scenario3_BackgroundDeviceWatcher , sealed , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario9_CustomPairDevice , sealed , Scenario6_CustomFilterAddedProps , Scenario3_BackgroundDeviceWatcher , Scenario2_DeviceWatcher , Scenario9_CustomPairDevice , Scenario7_DeviceInformationKind , Scenario8_PairDevice
  • StartWatchers() : sealed , Scenario7_DeviceInformationKind
  • StartWatching() : Scenario2_WatchUsers
  • StartWebcamStreamingAsync() : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • StaticBitmapButton_Click() : Scenario2_Effects
  • StaticBitmapEffect_BitmapRequested() : Scenario2_Effects
  • StatusChanged() : LoggingSessionScenario , FileLoggingSessionScenario
  • STDMETHOD_() : EmbeddedMFAsyncCallback< Callback >
  • STDMETHODIMP_() : AsyncCallback< T > , CStreamSink::CAsyncOperation , MFSampleGenerator , AsyncCallback< T > , MFSampleGenerator , CStreamSink::CAsyncOperation , MFSampleGenerator
  • StepsControl() : StepsControl
  • StepsControl_Loaded() : StepsControl
  • stepsControl_StepChanged() : ScenarioElement
  • StepTimer() : StepTimer
  • Stop() : sealed , GameTimer , MidiDeviceWatcher , CardioidSound , CMediaSource , CMediaStream , PlaybackControl , CServiceBase , CustomDecaySound , CStreamSink , sealed , OmnidirectionalSound
  • StopAdvertisement() : Scenario1_Advertiser
  • StopAdvertisement_Click() : Scenario2 , sealed
  • StopAllScrollingAsync() : Scenario7_ScrollingContentUsingMarquee , sealed
  • StopAnimationTapped() : Scenario12 , sealed
  • StopAsync() : sealed , CameraStreamProcessor , CameraCoordinateMapper
  • StopBitCountComboBox_SelectionChanged() : Scenario2_ConfigureDevice
  • StopBleDeviceWatcher() : Scenario1_Discovery
  • StopButton_Click() : sealed , Scenario1_Watcher , sealed , Scenario4_BackgroundPublisher , Scenario2_Effects , Scenario3_BackgroundWatcher , sealed , Scenario2_Effects , Scenario2_FindAvailableSourceGroups , Scenario2_Publisher
  • StopCapture() : Scenario4 , sealed
  • StopCaptureAsync() : WASAPICapture
  • StopCurrentRecognizerIfExists() : HolographicVoiceInputMain
  • StopDevice() : Scenario3 , sealed , Scenario2
  • StopDeviceWatcher() : sealed , EventHandlerForDevice
  • StopDeviceWatchers() : Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect , sealed
  • StopFx2Watcher() : DeviceList
  • StopHandlingAppEvents() : Scenario1_ConnectDisconnect , DeviceConnect , sealed , Scenario1_ConnectDisconnect
  • StopMetering() : ServiceViewModel , sealed , Metering
  • StopMeteringData() : ServiceViewModel
  • StopMonitoring() : Scenario7_ForegroundVisits
  • StopMonitoring_Click() : AccountWatcher
  • StopPlaybackAsync() : WASAPIRenderer
  • StopPlayers() : Scenario1_Default , sealed , Scenario3_Trim , Scenario2_Custom , sealed
  • StopPreviewAsync() : sealed , OcrCapturedImage , MainPage , sealed , OcrCapturedImage , sealed , MainPage , sealed , MainPage
  • StopProjecting() : ProjectionViewPage
  • StopProjecting_Click() : ProjectionViewPage , sealed
  • StopProjectingButton_Click() : ProjectedMediaTransportControls
  • StopReaderAsync() : Scenario2_FindAvailableSourceGroups , sealed
  • StopRecordingAsync() : MainPage , sealed , MainPage , CaptureDevice , MainPage , sealed , MediaCaptureManager , sealed
  • StopRenderLoop() : GameMain , LowLatencyInputMain
  • StopReplay() : Scenario9 , sealed
  • StopScenario() : Scenario1_ReadData , sealed , Scenario1_ReadData , sealed , Scenario1_GetAndSetPin , Scenario1_ReadData , Scenario2_Listen , Scenario1_GetAndSetPin , Scenario2_Listen , Scenario1_ReadData
  • StopScrollingButton_Click() : sealed , Scenario7_ScrollingContentUsingMarquee
  • StopSoftwareTriggerButton_Click() : Scenario5_DisplayingBarcodePreview
  • StopSource() : MFSampleGenerator
  • StopSuperMuttInputReports() : sealed , InputReportEvents
  • StopTracking() : Scenario1_TrackPosition
  • StopViewInUse() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • StopWatcher() : DeviceWatcherHelper , Scenario8_PairDevice , Scenario3_BackgroundDeviceWatcher , Scenario2_DeviceWatcher , sealed , Scenario2_Connector , Scenario2_DeviceWatcher , Scenario1_SelectDisplay , Scenario9_CustomPairDevice , DeviceWatcherHelper , sealed , Scenario6_CustomFilterAddedProps , sealed , Scenario2_Connector , Scenario9_CustomPairDevice , Scenario3_BackgroundDeviceWatcher , sealed , Scenario1_ChatClient , Scenario8_PairDevice , Scenario6_CustomFilterAddedProps
  • StopWatcherButton_Click() : sealed , Scenario2_DeviceWatcher , Scenario7_DeviceInformationKind , Scenario3_BackgroundDeviceWatcher , sealed , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario3_BackgroundDeviceWatcher , sealed , Scenario7_DeviceInformationKind , Scenario6_CustomFilterAddedProps , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , sealed , Scenario6_CustomFilterAddedProps , Scenario8_PairDevice
  • StopWatchers() : sealed , Scenario7_DeviceInformationKind
  • StopWatching() : Scenario2_WatchUsers
  • StoreNewAccountDataLocally() : MultipleAccountsScenario , SingleAccountScenario
  • streaming_latencyModeToggled() : sealed
  • Streaming_PreviewButtonClicked() : LowLatency
  • streaming_previewButtonClicked() : sealed
  • streaming_recordingStarted() : sealed
  • StreamLocationAsync() : Scenario1_Check
  • StreamLocationButton_Click() : Scenario1_Check
  • StreamResolution() : StreamResolution
  • StreamResolutionHelper() : sealed
  • StreamSocketListenerWrapper() : StreamSocketListenerWrapper , sealed
  • StringFromDouble() : sealed
  • Stringify() : User
  • Stringify_Click() : Scenario1_ParseAndStringify
  • StringifyProperty() : Helpers
  • StringReplace() : sealed
  • StringToStreamAsync() : Scenario1_Print
  • Stroke() : Stroke
  • StrokeEvent_Click() : sealed
  • StrokeInput_StrokeStarted() : sealed , Scenario2 , Scenario1
  • StspMediaSinkProxy() : sealed
  • Stuff() : DeviceInformationDisplay
  • styleCombobox_SelectionChanged() : sealed , Scenario1
  • SubjectPublicKeyInfo() : SubjectPublicKeyInfo
  • SubmitResponse() : AuthenticationController
  • SubPage() : SubPage
  • SubscribedPlaybackList_CurrentItemChanged() : PlayerViewModel
  • SubscribeToReleaseDeviceRequested() : MainPage
  • SubString() : DataModel
  • Subtract() : ItemIndexRangeList
  • SubtractOrientations() : sealed , CameraRotationHelper
  • SuccessfulSignIn() : SignIn , sealed
  • SurfaceMesh() : final
  • Suspend() : GameMain
  • SuspendAudio() : Audio
  • SuspendDeviceWatcher() : DeviceList
  • SuspendMeteringService() : ServiceViewModel
  • SuspensionManagerException() : SuspensionManagerException
  • Swap() : sealed
  • Swap< T >() : PhotosPrintHelper
  • SwapChainAction() : DeviceResources
  • SwapChainActionWithResult() : DeviceResources
  • SwapVertexBuffers() : final
  • SwapViews() : ProjectionViewPage
  • SwapViews_Click() : sealed , ProjectionViewPage
  • SwapViewsButton_Click() : ProjectedMediaTransportControls
  • SwitchAndAnimate() : SecondaryViewPage
  • SymbologyListEntry() : SymbologyListEntry , sealed , SymbologyListEntry
  • SymbologySelection_Changed() : Scenario4_SymbologyAttributes
  • Sync_Click() : Scenario7_SyncDevice
  • SyncPlaybackStatusToMediaPlayerState() : Scenario1
  • SyncWithDeviceAsync() : Scenario7_SyncDevice
  • SynthesizeSSMLStream() : sealed
  • SynthesizeTextStream() : sealed
  • SystemGroup_Frequent_Click() : Scenario4_ChangeSystemGroup , sealed , Scenario4_ChangeSystemGroup
  • SystemGroup_None_Click() : sealed , Scenario4_ChangeSystemGroup
  • SystemGroup_Recent_Click() : Scenario4_ChangeSystemGroup , sealed , Scenario4_ChangeSystemGroup
  • SystemListBox_SelectionChanged() : Scenario1_Discovery
  • systemMediaControls_AutoRepeatModeChangeRequested() : Scenario1
  • SystemMediaControls_ButtonPressed() : PlaybackControl
  • systemMediaControls_ButtonPressed() : Scenario1
  • systemMediaControls_PlaybackPositionChangeRequested() : Scenario1
  • systemMediaControls_PlaybackRateChangeRequested() : Scenario1
  • systemMediaControls_PropertyChanged() : Scenario1
  • SystemMediaControls_PropertyChanged() : MainPage , sealed , MainPage , sealed , PlaybackControl , MainPage , sealed
  • SystemNavigationManager_BackRequested() : MainPage , RootFrameNavigationHelper
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- t -

  • TabHeader() : TabHeader
  • TakeAdvancedCapturePhotoAsync() : sealed , MainPage
  • TakePhotoAsync() : sealed , MainPage , MediaCaptureManager , MainPage , sealed
  • TakeSnapshotAndFindFacesAsync() : Scenario2_DetectInWebcam
  • TapFocusRadioButton_Checked() : MainPage
  • TapToFocus() : MainPage
  • TapUnfocus() : MainPage
  • Target() : GameObject
  • target_DoubleTapped() : sealed , Scenario1
  • target_Holding() : sealed , Scenario1
  • target_PointerEntered() : sealed , Scenario1
  • target_PointerExited() : sealed , Scenario1
  • target_PointerPressed() : sealed , Scenario1
  • target_PointerReleased() : sealed , Scenario1
  • target_RightTapped() : sealed , Scenario1
  • target_Tapped() : Scenario1 , sealed
  • TargetId() : GameObject
  • TargetListView_DragItemsCompleted() : sealed , Scenario1_ListView
  • TargetListView_DragItemsStarting() : sealed , Scenario1_ListView
  • TargetListView_DragOver() : sealed , Scenario1_ListView
  • TargetListView_Drop() : sealed , Scenario1_ListView
  • TargetTextBlock_DragEnter() : sealed , Scenario1_ListView
  • TargetTextBlock_Drop() : sealed , Scenario1_ListView
  • TargetTextBox_DragEnter() : sealed , Scenario2_DragUICustomization
  • TargetTextBox_DragLeave() : sealed , Scenario2_DragUICustomization
  • TargetTextBox_Drop() : sealed , Scenario2_DragUICustomization
  • TargetTexture() : TargetTexture
  • Task() : SimpleTaskCompletionSource< T > , SimpleTaskCompletionSource< void >
  • Task_Completed() : sealed , Provider
  • TaskRequiresBackgroundAccess() : BackgroundTaskSample , Scenario7_SyncDevice
  • TemperatureButton_Click() : Scenario2_LEDTemp
  • Templates() : sealed , Templates
  • TerminateStroke() : SourceHandler
  • Text() : Text
  • TextBox_GotFocus() : Scenario4_ShowView
  • TextColor() : sealed , Functions
  • TextLayout() : sealed
  • TextLayoutFrame_SizeChanged() : sealed
  • TextLayoutImageSource() : sealed
  • TextRenderer() : TextRenderer
  • TextSent() : sealed
  • TextServiceManager_InputLanguageChanged() : sealed , Scenario4
  • thisViewControl_Released() : ProjectionViewPage , sealed , ProjectionViewPage
  • ThrowIfDisposed() : WiFiDirectServiceManager , AdvertisementWrapper , DiscoveredDeviceWrapper , SessionWrapper , StreamSocketListenerWrapper , SocketWrapper
  • ThumbstickDPadHelper() : ThumbstickDPadHelper
  • Tick() : StepTimer
  • TicksToSeconds() : StepTimer
  • TileExists_Click() : Scenario4_TilePinned
  • TileNotificationButton_Click() : sealed , Scenario3_Notifications
  • timedMetadataTrackChangedHandler() : sealed
  • TimeLimit() : Level
  • Timer_Tick() : sealed , Scenario2_Listen , sealed , Scenario1_ReadData , sealed , Scenario1_ReadData
  • TimeRemaining() : Simple3DGame
  • TimerWaitForTwoMins_Tick() : ScenarioElement
  • TimeTriggeredTask() : sealed , TimeTriggeredTask , sealed , TimeTriggeredTask
  • Timezone() : User
  • Title() : SizePreferenceString , ViewLifetimeControl
  • TitleBar() : Scenario1_Colors
  • TitledImage() : TitledImage
  • TlvEntry() : TlvEntry
  • ToArray() : ItemIndexRangeList
  • ToastNotificationButton_Click() : sealed , Scenario3_Notifications
  • ToBuffer() : HttpJsonContent
  • ToCustomStyleEntryState() : sealed , Scenario11
  • ToDefaultStyleEntryState() : sealed , Scenario11
  • ToDispose< T >() : Disposer
  • Toggle_Custom() : sealed , Scenario2
  • ToggleButtons() : Scenario_PauseAsync
  • ToggleDepth_Click() : sealed
  • ToggleFullScreenModeButton_Click() : sealed , Scenario1_Basic , sealed , Scenario2_Extend
  • ToggleLoggingEnabledDisabled() : LoggingSessionScenario
  • ToggleLoggingEnabledDisabledAsync() : FileLoggingSessionScenario
  • ToggleLogs() : sealed , Scenario6
  • ToggleMenuSuppression() : sealed , Scenario1_EventAndMenuHookup
  • TogglePlay() : Scenario1_FilePlayback , Scenario4_Submix , Scenario5_InboxEffects , Scenario6_CustomEffects
  • TogglePlayPause() : PlayerViewModel
  • ToggleRecordStop() : Scenario2_DeviceCapture
  • ToggleSkeletons_Click() : sealed
  • ToggleTongue() : D2DSvgImageRenderer
  • ToHex() : sealed
  • ToJsonObject() : School
  • ToList() : ItemIndexRangeList
  • ToMFSample() : CBufferPacket
  • ToneSampleGenerator() : ToneSampleGenerator
  • TongueButton_Click() : sealed
  • Tool() : Tool
  • ToolButton_Lasso() : sealed , Scenario2
  • ToPlaybackItem() : MediaItem , MusicItem , VideoItem
  • ToPlaybackList() : MediaList
  • TorchCheckBox_CheckedChanged() : MainPage
  • ToString() : SampleDataModel , Scenario , ApduResponse , FrameFormatModel , BitrateItem , AdaptiveContentModel , CustomDevicePickerFilter , Scenario , Item , FrameSourceGroupModel , FrameSourceInfoModel , Scenario , RemotePeer , Scenario , CardDetails , ApduCommand , SelectCommand , BadgeNumericNotificationContent , Scenario , ScenarioGroup , Scenario , DiscoveredDevice , ConnectedDevice , Contact , SampleDataModel , Scenario
  • TotalHits() : Simple3DGame
  • TotalShots() : Simple3DGame
  • TouchInking_Checked() : sealed
  • TouchInking_Unchecked() : sealed
  • TouchInkingCheckBox_Checked() : sealed , Scenario3
  • TouchInkingCheckBox_Unchecked() : sealed , Scenario3
  • TouchpadDPadHelper() : TouchpadDPadHelper
  • TrackButton_Click() : Scenario4 , Scenario5
  • TrafficFlowVisible_Checked() : Scenario1 , sealed
  • trafficFlowVisibleCheckBox_Unchecked() : sealed , Scenario1
  • TranscodeCancel() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • TranscodeComplete() : Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • TranscodeCustom() : sealed , Scenario2_Custom
  • TranscodeError() : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed
  • TranscodeFailure() : sealed , Scenario2_Custom , sealed , Scenario3_Trim , Scenario1_Default
  • TranscodePreset() : Scenario1_Default , sealed
  • TranscodeProgress() : sealed , Scenario3_Trim , sealed , Scenario1_Default , sealed , Scenario2_Custom
  • TranscodeTrim() : sealed , Scenario3_Trim
  • Transfer_Click() : Scenario1
  • TransferData() : sealed , WriteReadStream
  • Transform() : WordOverlay
  • TransformBitmap() : sealed
  • TransliterateFromCyrillicToLatin() : LinguisticServices
  • Transmit_Click() : sealed , Scenario8_TransmitAPDU
  • TransparentExchange() : TransparentExchange
  • TransparentExchangeAsync() : AccessHandler
  • TransparentExchangeResponse() : TransparentExchangeResponse
  • TransportControls_CastButtonClicked() : Scenario03 , Scenario02 , Scenario05 , Scenario06
  • TransportOptions() : TransportOptions
  • TriangulatePoints() : SpatialStageManager
  • TriggerAcceptConnection() : CMediaSink
  • TriggerRefuseConnection() : CMediaSink
  • Trim() : DeviceResources , StringTrimmer , DeviceResources , StringTrimmer , DeviceResources , SceneComposer , DeviceResources
  • TrimClip_Click() : sealed , Scenario1_TrimAndSaveClip
  • TrimLeft() : CBufferPacket , CMediaBufferWrapper
  • TrimRight() : CMediaBufferWrapper
  • Trip() : sealed
  • TripDetails() : TripDetails , sealed
  • tripListBox_SelectionChanged() : sealed , TripListView
  • TripListView() : sealed , TripListView
  • TripListViewModel() : sealed , TripListViewModel
  • TripStore() : TripStore , sealed
  • TripViewModel() : sealed , TripViewModel
  • TripVoiceCommand() : TripVoiceCommand , sealed
  • TryAcquireLatestFrameData() : CameraCoordinateMapper
  • TryApplyProcessUIPolicy_Click() : Scenario3
  • TryCastMediaElementAsync() : Scenario06
  • TryCloseWindow() : AppView , sealed
  • TryComputeLength() : HttpJsonContent
  • TryConnectSocketWithRetryAsync() : Scenario5
  • TryConvert() : sealed
  • TryCreateDownloadAsync() : sealed
  • TryDeleteCredentialAccountAsync() : Util
  • TryDisconnectCastingSessionAsync() : Scenario06
  • TryDownloadBuffer() : LiveSourceBufferManager
  • TryFindViewLifetimeControlForViewId() : App
  • TryGetContinousBuzz() : SpatialControllerHandler
  • TryGetCurrentNetworkOperatorTetheringManager() : Helpers
  • TryGetHandedness() : HolographicPaintMain
  • TryGetUri() : MainPage
  • TryGetValue() : EmployeeDictionary
  • TryGoBack() : RootFrameNavigationHelper
  • TryGoForward() : RootFrameNavigationHelper
  • TryInitializeCaptureAsync() : sealed
  • TryInitializeMediaCaptureAsync() : sealed
  • TryLaunchDialAppAsync() : Scenario06
  • TryParseHttpUri() : Helpers
  • TryProjectionManagerCastAsync() : Scenario06
  • TryRegisterBusObject() : AllJoynBusObjectManager
  • TryRender() : BaseElement
  • TrySavePlaylistAsync() : MainPage
  • TryStopDialAppAsync() : Scenario06
  • TryStopProjectionManagerAsync() : Scenario06
  • TryUpdateRenderer() : sealed
  • Tts_Resolved() : Scenario3
  • Type() : ControlBase , School , LoggingScenarioEventArgs , School , IControl
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- u -

  • UndeferElementClick() : sealed , OtherBindings
  • UnhandledExceptionPage() : UnhandledExceptionPage
  • Uninitialize() : sealed , AppView , sealed , AppView , sealed , VisualProperties , sealed , App , sealed
  • unique_bag() : unique_bag
  • unique_cotaskmem_ptr() : unique_cotaskmem_ptr< T >
  • unique_disabled_control() : unique_disabled_control
  • unique_services() : unique_services
  • unique_shared_work_queue() : unique_shared_work_queue
  • UnlockScenarioChange() : sealed
  • UnlockStore() : CBaseAttributes< TBase >
  • UnmarshalInterface() : CMediaBufferWrapper
  • UnpairButton_Click() : sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • UnpinSecondaryTile_Click() : Scenario2_UnpinTile
  • UnprocessedEvent_Click() : sealed
  • UnprocessedInput_PointerEntered() : sealed , Scenario6
  • UnprocessedInput_PointerEntered1() : sealed , Scenario6
  • UnprocessedInput_PointerMoved() : sealed , Scenario2
  • UnprocessedInput_PointerPressed() : sealed , Scenario2
  • UnprocessedInput_PointerReleased() : sealed , Scenario2
  • UnprocessedInputOnPointerEntered() : sealed
  • UnprocessedInputOnPointerExited() : sealed
  • UnprocessedInputOnPointerHovered() : sealed
  • UnprocessedInputOnPointerLost() : sealed
  • UnprocessedInputOnPointerMoved() : sealed
  • UnprocessedInputOnPointerPressed() : sealed
  • UnprocessedInputOnPointerReleased() : sealed
  • Unprotect_Click() : Scenario1_Files , Scenario2_Memory , Scenario1_Files , Scenario2_Memory
  • UnprotectAsyncBuffer_Click() : Scenario6 , Scenario7
  • UnpublishService() : sealed , WiFiDirectServiceManager
  • Unregister() : MainPage
  • UnRegister_Click() : Scenario15_DPLCreateFileEvents
  • Unregister_Click() : RegisterWithBackgroundTask
  • UnregisterAndDestroyBusObject() : AllJoynBusObjectManager
  • UnregisterBackgroundTask() : sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , ServicingCompleteTask , TimeTriggeredTask , ApplicationTriggerTask , sealed , Scenario3_BackgroundDeviceWatcher , Scenario15_DPLCreateFileEvents , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario1_Initialization , ScenarioElement
  • UnregisterBackgroundTasks() : BackgroundTaskSample
  • UnRegisterBtn_Click() : sealed , Scenario3_AvailabilityChanged
  • UnregisterButton_Click() : Scenario1_Initialization
  • UnregisterCustomTrigger_Click() : sealed , CustomTrigger
  • UnregisterEventHandlers() : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UnregisterForAdaptiveMediaSourceEvents() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning
  • UnregisterForDiscreteControls() : Scenario7_LiveSeekableRange
  • UnregisterForEvents() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • UnregisterForMediaPlaybackItemEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterForMediaSourceEvents() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterForPositionUpdateControl() : Scenario7_LiveSeekableRange
  • UnregisterForPrinting() : PrintHelper
  • UnregisterFrame() : SuspensionManager
  • UnregisterFromAppEvents() : sealed , EventHandlerForDevice
  • UnregisterFromBus() : sealed
  • UnregisterFromDeviceAccessStatusChange() : sealed , EventHandlerForDevice
  • UnregisterFromDeviceWatcherEvents() : sealed , EventHandlerForDevice
  • UnregisterFromInputReportEvent() : sealed , InputReportEvents
  • UnregisterFromInputReportEvents_Click() : sealed , InputReportEvents
  • UnregisterFromInterruptEvent() : Scenario3_InterruptPipes
  • UnregisterGroupedTask() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • UnregisterHandlers() : Scenario2_EventHandlers , Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange
  • UnregisterHolographicEventHandlers() : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • UnregisterInterruptEvent_Click() : Scenario3_InterruptPipes
  • UnregisterMetadataHandlers() : Scenario5_Metadata , Scenario6_AdInsertion
  • UnregisterNetworkStatusChanged() : Scenario3_NetworkConnectivityChanges
  • UnregisterTask() : sealed , CustomTrigger
  • UnregisterTasks_Click() : Scenario1_ManageHotspot
  • UnregisterUngroupedTasks() : sealed , GroupedBackgroundTask , sealed , GroupedBackgroundTask
  • UnselectAll() : InkRenderer
  • UnselectSceneObjects() : SceneComposer
  • UnspecifiedReason() : sealed , UnspecifiedReason
  • Up() : Camera
  • Update() : HolographicMRCSampleMain , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , SceneController , SceneObject , HolographicSpatialStageMain , QuadRenderer , HolographicTagAlongSampleMain , SpinningCubeRenderer , HolographicVoiceInputMain , Update , ScenarioElement , GameMain , GameTimer , Level , Level2 , Level4 , Level6 , MoveLookController , Sphere , GameMain , Stroke , Tool , ClearTool , ToolCarousel , sealed , IDPadHelper , ThumbstickDPadHelper , HolographicPaintMain , SourceHandler , _360VideoPlaybackMain , BaseControl , BaseElement , FocusableElement , Button , PlayPauseButton , SeekBarElement , MediaTransportControls , VideoRenderer , _360VideoPlaybackMain , VideoRenderer , HolographicApp1Main , Print3D , Turn , BasicHologramMain , SpinningCubeRenderer , BasicHologramMain , SpinningCubeRenderer , HolographicTemplateAppMain , SpinningCubeRenderer , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , CameraStreamCoordinateMapperMain , sealed , TextRenderer , InkRenderer , ShapeRenderer , CustomComputeShaderMain , CustomComputeShaderRenderer , BasicTimer , CustomPixelShaderMain , CustomPixelShaderRenderer , BasicTimer , CustomVertexShaderMain , CustomVertexShaderRenderer , DeviceInformationDisplay , QuadRenderer , SpinningCubeRenderer , HolographicFaceTrackerMain , ControlBase , Cursor , IControl , SpinningCubeRenderer
  • UpdateAddressField() : Scenario07_PostStreamWithProgress , Scenario13_RetryFilter , Scenario07_PostStreamWithProgress , Scenario13_RetryFilter
  • UpdateAdvertiserStatus() : sealed , Scenario2
  • UpdateAppBarButton() : Scenario7_PinFromAppbar
  • UpdateAvailableLanguages() : sealed , OcrFileImage
  • UpdateBackButton() : RootFrameNavigationHelper
  • UpdateBackgroundTaskRegistrationStatus() : BackgroundTaskSample
  • UpdateBackgroundTaskUIState() : RegisterWithBackgroundTask
  • UpdateBaseUrl() : DashManifestParser
  • UpdateBaudRateView() : Scenario2_ConfigureDevice
  • UpdateBinary() : UpdateBinary
  • UpdateBreakStateSignalView() : Scenario2_ConfigureDevice
  • UpdateButton_Click() : sealed , Scenario4_UpdatingLineDisplayAttributes , Scenario6_ManipulatingCursorAttributes
  • UpdateButtonOrientation() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UpdateButtons() : sealed , Scenario5_TriggerCFU , sealed , Scenario1_FindClaimEnable
  • UpdateButtonState() : FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , FileOpenPicker_PickURLFile , Scenario1_Initialization
  • UpdateButtonStateAsync() : sealed , Scenario2_FindAvailableSourceGroups
  • UpdateButtonStates() : Scenario4_BulkPipes , Scenario7_SyncDevice , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_NetworkConnectivityChanges
  • UpdateCachedMetrics() : sealed
  • UpdateCanvasSize() : HelperFunctions
  • UpdateCapabilityStatus() : Scenario1_Check
  • UpdateCaptureControls() : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • UpdateCaptureStatus() : Scenario3_AppCapture
  • UpdateCarrierDetectStateView() : Scenario2_ConfigureDevice
  • UpdateColorResources() : CameraCoordinateMapper
  • UpdateColors() : sealed , Scenario1_Colors
  • UpdateConnectDisconnectButtonsAndList() : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • UpdateConnectivityLevel() : sealed , WiFiNetworkDisplay
  • UpdateConnectivityLevels() : sealed
  • UpdateConnectivityStatus() : sealed
  • UpdateConnectivityStatusAsync() : Scenario2ViewModel , Scenario4_Connect
  • UpdateConstants() : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • UpdateContent() : sealed , Scenario1_Orientation , sealed , Scenario1_Basic , sealed , Scenario1_Basic , sealed , Scenario1_Basic
  • UpdateContentProps() : sealed , Scenario2 , Scenario3
  • UpdateContentUI() : sealed , Scenario2 , Scenario3
  • UpdateControlOrientation() : sealed , MainPage
  • UpdateControls() : sealed , Scenario3 , sealed , Scenario2 , Scenario3 , Scenario2 , Scenario3
  • UpdateControlVisibility() : Scenario1
  • UpdateCount() : FileDataSource , FileDataSource2
  • UpdateCurrentAppLanguageMessage() : sealed , Scenario8
  • UpdateCustomTransportControls() : Scenario1
  • UpdateData() : Player , LiveSourceBufferManager , SourceBufferManager
  • UpdateData_Click() : BroadbandDevice
  • UpdateDataBitsView() : Scenario2_ConfigureDevice
  • UpdateDataSetReadyStateView() : Scenario2_ConfigureDevice
  • UpdateDataTerminalReadyEnabledView() : Scenario2_ConfigureDevice
  • UpdateDefaultLogo_Click() : Scenario8_UpdateAsync
  • UpdateDefaultRenderOptions() : sealed
  • UpdateDepthResources() : CameraCoordinateMapper
  • UpdateDescriptionVisibility() : sealed , Scenario1
  • UpdateDestinationPhraseList() : sealed , TripViewModel
  • UpdateDeviceInfo() : DiscoveredDevice
  • UpdateDevices() : MidiDeviceWatcher
  • UpdateDiscoveryList() : sealed , Scenario3
  • UpdateDisplayACState() : sealed
  • UpdateDisplayColorContext() : PhotoAdjustmentRenderer
  • UpdateDownloadBitrateAsync() : Scenario4_Tuning , Scenario2_EventHandlers
  • UpdateDynamics() : Simple3DGame
  • UpdateEvControlCapabilities() : MainPage
  • UpdateEventRegistration() : sealed
  • UpdateExposureControlCapabilities() : MainPage
  • UpdateFlashControlCapabilities() : MainPage
  • UpdateFocusControlCapabilities() : MainPage
  • UpdateFocusUI() : CustomEditControl
  • UpdateForSizeChanged() : SectionView
  • UpdateForVisualState() : MasterDetailPage
  • UpdateForWindowSizeChange() : D2DGradientMeshMain , DWriteColorTextRendererMain
  • UpdateFourTilesControl() : UpdateFourTilesControl
  • UpdateFPS() : Scenario1_ExampleOperations
  • UpdateFrameSource() : sealed , Scenario2_FindAvailableSourceGroups
  • UpdateFullScreenModeStatus() : Scenario2_Extend , sealed , Scenario2_Extend
  • UpdateGameConfig() : Simple3DGame
  • UpdateGlyphBitmapImage() : BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , sealed , DeviceInformationDisplay
  • UpdateHandShakeView() : Scenario2_ConfigureDevice
  • UpdateHeaderText() : sealed , Scenario2
  • UpdateHologramPosition() : QuadRenderer
  • UpdateImageColorContext() : D2DAdvancedColorImagesRenderer
  • UpdateImageDimensionsUI() : Scenario2
  • UpdateImageRotation() : Scenario2
  • UpdateImageScale() : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer
  • UpdateImageTransformState() : D2DAdvancedColorImagesRenderer
  • UpdateInk() : SceneComposer
  • UpdateIsoControlCapabilities() : MainPage
  • UpdateIsUpperCaseEnabledAsync() : Scenario1ViewModel
  • UpdateItem() : Scenario1_Files
  • UpdateLampArrayList() : Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics
  • UpdateLastVisit() : Scenario6_GetLastVisit
  • UpdateLayoutFromCurrentTime() : SeekBarElement
  • UpdateLayoutMetrics() : sealed , CustomTitleBar
  • UpdateLayoutState() : GameMain
  • UpdateLiveSourceBuffers() : Player
  • UpdateLiveSourceBuffersToLiveEdge() : Player
  • UpdateLocalClientWindow() : sealed
  • UpdateLocationData() : Scenario2_GetPosition , Scenario1_TrackPosition , Scenario2_GetPosition , Scenario1_TrackPosition
  • UpdateManipulationState() : D2DAdvancedColorImagesRenderer , CustomVertexShaderMain , CustomVertexShaderRenderer
  • UpdateManualControlCapabilities() : MainPage
  • UpdateMapElementOnClick() : sealed , Scenario11
  • UpdateMapElementOnPointerEntered() : Scenario11 , sealed
  • UpdateMapElementOnPointerExited() : sealed , Scenario11
  • UpdateMatrix() : Face
  • UpdateMediaControlUI() : sealed , Scenario2 , Scenario4 , Scenario3
  • UpdateMessageLog() : sealed
  • UpdateName_Click() : sealed , S2_UpdateAndDeleteWithAPI
  • UpdateNetworkStatus() : Scenario3_NetworkConnectivityChanges
  • UpdateNowButton_Click() : Scenario1_ManageHotspot
  • UpdateOnDemandButton_Click() : Scenario1_ManageHotspot
  • UpdatePairingButtons() : Scenario1_ChatClient , sealed , Scenario8_PairDevice , Scenario9_CustomPairDevice , Scenario8_PairDevice
  • UpdateParameterList1() : Scenario3_SendMIDIMessages
  • UpdateParameterList2() : Scenario3_SendMIDIMessages
  • UpdateParameterList3() : Scenario3_SendMIDIMessages
  • UpdateParityView() : Scenario2_ConfigureDevice
  • UpdatePhotoAdjustmentValues() : PhotoAdjustmentRenderer
  • UpdatePlaybackBitrateAsync() : Scenario2_EventHandlers , Scenario4_Tuning
  • UpdatePlaybackSpeed() : Scenario1
  • UpdatePointer() : CustomPixelShaderMain , CustomPixelShaderRenderer
  • UpdatePollingDevices() : MoveLookController
  • UpdatePosition() : GameObject , Cylinder , Face
  • UpdatePositionAndVisibility() : CustomTitleBar , sealed
  • UpdatePresence() : IsApiPropertyPresentTrigger
  • UpdatePreviewRect() : Scenario5_InkingAndInteractionFeedback
  • UpdatePropertyHelper() : S2_UpdateAndDeleteWithAPI , sealed
  • UpdateProps() : WordOverlay , sealed
  • UpdateRandomSection() : MainPage
  • UpdateRanges() : ItemCacheManager< T >
  • UpdateReadButtonStates() : Scenario3_ReadWrite
  • UpdateReadBytesCounterView() : Scenario3_ReadWrite
  • UpdateReadTimeoutView() : Scenario3_ReadWrite
  • UpdateRectTransform() : LowLatencyInputMain , RectRenderer
  • UpdateRegisterButton() : DeviceEvents , sealed
  • UpdateRegisterEventButton() : Scenario3_InterruptPipes
  • UpdateRegisterEventButtons() : InputReportEvents , sealed
  • UpdateRenderOptions() : sealed
  • UpdateRenderTargetSize() : DeviceResources
  • UpdateRequestToSendEnabledView() : Scenario2_ConfigureDevice
  • UpdateRunningAverageContainerHeight() : sealed , ChatListView
  • UpdateScalingAndOrder() : sealed
  • UpdateSeekableRangesControl() : Scenario7_LiveSeekableRange
  • UpdateSeekableWindowControls() : Scenario7_LiveSeekableRange
  • UpdateSelectionRectangle() : InkRenderer
  • UpdateSelectionUI() : Scenario4_EdgeTappedListView
  • UpdateShape() : SceneComposer
  • UpdateSliderPosition() : SeekBarElement
  • UpdateSmtcPosition() : Scenario1
  • UpdatesNeeded() : SceneComposer
  • UpdateSourceRun() : Scenario1_CreateTile
  • UpdateSSMLText() : Scenario_SynthesizeSSML , sealed
  • UpdateStartStopButtons() : sealed , DeviceConnect
  • UpdateState() : IsApiPropertyPresentTrigger
  • UpdateStatus() : Scenario1_Discovery , DeviceWatcherHelper , Scenario2_LaunchUri , Scenario5_Capabilities , Scenario15_DPLCreateFileEvents , Scenario3_LaunchAppServices , sealed
  • UpdateStatusAsync() : Scenario2ViewModel , Scenario1ViewModel
  • UpdateStatusOutput() : Scenario2_CloseDrawer , sealed
  • UpdateStereoState() : DeviceResources
  • UpdateStopBitCountView() : Scenario2_ConfigureDevice
  • UpdateSurface() : RealtimeSurfaceMeshRenderer , final
  • UpdateSwitchStateTable() : DeviceEvents , sealed , Scenario3_InterruptPipes
  • UpdateSystemMediaControlsDisplayAsync() : Scenario1
  • UpdateTextBlock() : Scenario2 , sealed
  • UpdateTextLayout() : sealed
  • UpdateTextUI() : CustomEditControl
  • UpdateTile() : TilesHelper
  • UpdateTiles() : TilesHelper
  • UpdateTimer_Tick() : MainPage
  • UpdateTitle() : App , SampleState
  • UpdateTransform() : final
  • UpdateTransportControls() : Scenario6
  • UpdateTrigger() : InputTypeTrigger , ControlSizeTrigger
  • UpdateUI() : sealed , MainPage , ApplicationTriggerTask , GroupedBackgroundTask , sealed , SampleBackgroundTask , SampleBackgroundTaskWithCondition , sealed , TimeTriggeredTask , sealed , MultipleTasks , sealed , ApplicationTriggerTask , GroupedBackgroundTask , ServicingCompleteTask , Scenario_PauseAsync
  • UpdateUi() : MainPage
  • UpdateUI() : sealed
  • UpdateUi() : sealed
  • UpdateUI() : SampleBackgroundTask , sealed , CachedFileUpdater_Remote , CustomTrigger , ServicingCompleteTask , LocationTrackingReason , SampleBackgroundTaskWithCondition , UnspecifiedReason , CachedFileUpdater_Local , sealed , TimeTriggeredTask , sealed
  • UpdateUIAsync() : sealed , Scenario4_BackgroundProximitySensor , Scenario4_BackgroundActivity , Scenario4_BackgroundPedometer
  • UpdateUX() : Scenario3_ServerForeground
  • UpdateValues() : DataModel , DOModel , CSharpModel , DataModel
  • UpdateValuesClick() : sealed , OtherBindings , ListsAndTemplates , BasicTests , Functions
  • UpdateVertexResources() : final
  • UpdateViewProjectionBuffer() : CameraResources
  • UpdateVisibilities() : StepsHelperControl
  • UpdateVisitData() : Scenario7_ForegroundVisits
  • UpdateVisualState() : sealed , Scenario4_PartialReadWrite , Scenario1_UTF8 , Scenario3_ClientAuthentication , sealed , Scenario2_Binary , Scenario1_UTF8 , Scenario3_ClientAuthentication , Scenario2_Binary
  • UpdateWbControlCapabilities() : MainPage
  • UpdateWhiteLevelScale() : D2DAdvancedColorImagesRenderer
  • UpdateWiFiImage() : sealed , WiFiNetworkDisplay
  • UpdateWordBoxTransform() : OcrFileImage , OcrCapturedImage , sealed , OcrFileImage , sealed
  • UpdateWriteButtonStates() : Scenario3_ReadWrite
  • UpdateWriteBytesCounterView() : Scenario3_ReadWrite
  • UpdateWriteTimeoutView() : Scenario3_ReadWrite
  • UpdateZoomControlCapabilities() : MainPage
  • UpdateZoomState() : PhotoAdjustmentRenderer
  • UploadGeometryAndShaders() : BaseControl
  • UploadMultipleFiles() : Scenario2_Upload
  • UploadMultipleFilesAsync() : sealed
  • UploadProgress() : Scenario2_Upload , sealed
  • UploadSingleFile() : Scenario2_Upload
  • UploadSingleFileAsync() : sealed
  • UriToStreamAsync() : Scenario6_NavToStream::StreamUriWinRTResolver
  • UriToString() : Scenario1_NavToUrl
  • UseCustomColors_Click() : Scenario1_Colors , sealed , Scenario1_Colors
  • UseHolographicCameraResources() : DeviceResources
  • UseInertia() : sealed , ManipulationInputProcessor
  • UseMinimalOverlaysCheckBox_Click() : Scenario1_Basic , sealed , Scenario1_Basic
  • User() : User
  • UserControl_Loaded() : ScenarioElement
  • UserDataAccountViewModel() : sealed
  • UserId() : UserViewModel
  • UserLanguageToggle_Toggled() : OcrFileImage , sealed
  • Users() : Scenario2_WatchUsers
  • UserSelect() : sealed , UserSelect
  • UserViewModel() : UserViewModel
  • UsingNetworkContext< T >() : Scenario16_NetworkResource
  • Utils() : Utils
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- v -

  • ValidateAndGetUri() : sealed , ShareWebLink
  • ValidateBufferValue() : WASAPIRenderer
  • ValidateDevice() : DeviceResources
  • ValidateFile() : SampleState , MainPage
  • ValidateInput() : Scenario3_LaunchAppServices
  • ValidateOperation() : OpQueue< T, TOperation > , CMediaSource , CStreamSink
  • ValidatePageRangeOption() : sealed , PageRangePrintHelper
  • ValidatePresentationDescriptor() : CMediaSource
  • validateStep1() : ScenarioElement
  • ValidateSystemDiscovery() : MainPage
  • ValidateTCK() : AtrParser
  • ValidateTPMSmartCard() : MainPage
  • ValueChangedSubscribeToggle_Click() : Scenario2_Client
  • Vector2() : Vector2< T >
  • Vector3() : Vector3< T >
  • Vector4() : Vector4< T >
  • VectorPosition() : GameObject
  • VectorVelocity() : GameObject
  • Velocity() : GameObject , MoveLookController
  • Verified() : User
  • verifyButton_Click() : sealed , Scenario9_CustomPairDevice
  • VerifyResponse_Click() : sealed , Scenario5_VerifyResponse
  • VerifyTileIsPinned() : Scenario6_SecondaryTileNotification
  • versionString() : Scenario1
  • VersionString() : sealed
  • VertexPositionColor() : VertexPositionColor
  • VertexPositionTexture() : VertexPositionTexture
  • VeryObservableCollection() : VeryObservableCollection-g< T >
  • VideoButton_Click() : sealed , MainPage , sealed , Scenario3_AspectRatio , sealed , MainPage , sealed , MainPage
  • VideoChat() : VideoChat
  • VideoFrameProcessor() : VideoFrameProcessor
  • VideoGallery() : sealed , VideoGallery
  • VideoGallery_Loaded() : VideoGallery
  • VideoItem() : sealed , VideoItem
  • VideoPlaybackErrorHandler() : sealed
  • VideoRenderer() : VideoRenderer
  • VideoSettings_Changed() : sealed , Scenario3_AspectRatio
  • VideoStabilizationEffect_EnabledChanged() : sealed , MainPage
  • VideoTracks_SelectedIndexChanged() : Scenario4
  • View() : Camera
  • View_Released() : SecondaryViewPage
  • ViewConsolidated() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • ViewLifetimeControl() : ViewLifetimeControl , sealed , ViewLifetimeControl
  • ViewLifetimeControl_Released() : SecondaryViewPage
  • ViewModelLocator() : sealed , ViewModelLocator
  • ViewPage() : sealed , Scenario1_Render
  • Visibility() : GameMain
  • VisibilityChanged() : Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario2_Polling , Scenario3_Polling , Scenario2_Polling , sealed , ViewLifetimeControl , Scenario1_DataEvents , Scenario5_DataEventsBatching , Scenario2_ShakeEvents , sealed , Scenario1_DataEvents , Scenario1_DeviceUse , sealed , ViewLifetimeControl , Scenario2_Polling , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario1_DataEvents , sealed , Scenario2_Polling , sealed , Scenario2_Polling , Scenario1_DataEvents , sealed
  • Visible() : GameInfoOverlay
  • VisitBackgroundTask() : VisitBackgroundTask
  • VisualizeCoordinateMapping() : CameraCoordinateMapper , GpuCoordinateMapper
  • VisualProperties() : sealed
  • Volume() : IAppliance
  • VsToggleButton_Click() : MainPage , sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- w -

  • Wait() : PropertyGetContext< T > , PropertySetContext , PropertyGetContext< T >
  • WaitForDrawerCloseButton_Click() : sealed , Scenario2_CloseDrawer
  • WaitForMeteringData() : Metering
  • WaitForPress() : MoveLookController
  • waiting_previewButtonClicked() : sealed
  • Waiting_PreviewButtonClicked() : LowLatency
  • WaitingForResourceLoading() : GameMain
  • WaitOnSwapChain() : DeviceResources
  • WASAPICapture() : WASAPICapture
  • WASAPIRenderer() : WASAPIRenderer
  • Watcher_Added() : Scenario1ViewModel , Scenario2ViewModel , Scenario5_DisplayingBarcodePreview , Scenario3 , SourceGroupCollection , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects , sealed , Scenario1_SelectDisplay
  • Watcher_DeviceAdded() : DeviceWatcherHelper , sealed , DeviceWatcherHelper
  • Watcher_DeviceRemoved() : sealed , DeviceWatcherHelper
  • Watcher_DeviceUpdated() : sealed , DeviceWatcherHelper
  • Watcher_EnumerationCompleted() : Scenario3 , sealed , DeviceWatcherHelper , sealed , Scenario1_SelectDisplay
  • Watcher_Removed() : Scenario5_DisplayingBarcodePreview , Scenario3 , SourceGroupCollection , Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects
  • Watcher_Stopped() : Scenario3 , sealed , DeviceWatcherHelper
  • Watcher_Updated() : Scenario5_DisplayingBarcodePreview , SourceGroupCollection
  • watcherControlButton_Click() : Scenario3
  • WaveEffect() : WaveEffect
  • WbComboBox_SelectionChanged() : MainPage
  • WbSlider_ValueChanged() : MainPage
  • WebAccountCommandInvoked() : sealed
  • WebAccountInvoked() : MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • WebAccountProviderCommandInvoked() : sealed , MultipleAccountsScenario , SingleAccountScenario , SingleAzureADScenario , SingleMicrosoftAccountScenario
  • WebViewControl_ContainsFullScreenElementChanged() : Scenario9_ContainsFullScreenElement
  • WebViewControl_ContentLoading() : Scenario1_NavToUrl
  • WebViewControl_DOMContentLoaded() : Scenario1_NavToUrl
  • WebViewControl_NavigationCompleted() : Scenario1_NavToUrl , Scenario7_Share
  • WebViewControl_NavigationStarting() : Scenario1_NavToUrl , Scenario7_Share
  • WebViewControl_ScriptNotify() : Scenario4_ScriptNotify
  • WebViewControl_UnviewableContentIdentified() : Scenario10_UnviewableContent , Scenario1_NavToUrl
  • WfdDevice() : ConnectedDevice
  • Whiteboard() : sealed
  • Width() : sealed
  • WiFiDirectServiceManager() : sealed , WiFiDirectServiceManager
  • WiFiNetworkDisplay() : sealed , WiFiNetworkDisplay
  • Window_Activated() : Scenario7_PinFromAppbar
  • Window_SizeChanged() : DetailPage
  • Window_VisibilityChanged() : sealed , MainPage , sealed , ManageCardScenario , LowLatency
  • WindowActivationChanged() : GameMain
  • WindowInfo() : WindowInfo
  • WipeGeolocDataFromAppData() : LocationBackgroundTask
  • WordHeight() : WordOverlay
  • WordListBox_OnKeyUp() : Scenario3_ShowHideMethods
  • WordOverlay() : WordOverlay , sealed , WordOverlay
  • WordPosition() : WordOverlay
  • WordSegmentButton_Click() : Scenario2_GetCurrentTextSegmentFromIndex , sealed , Scenario2_GetCurrentTextSegmentFromIndex
  • WordSegmentsButton_Click() : sealed , Scenario1_ExtractTextSegments
  • WordWidth() : WordOverlay
  • World() : Camera
  • WorldCeilingMesh() : WorldCeilingMesh
  • WorldFloorMesh() : WorldFloorMesh
  • WorldWallsMesh() : WorldWallsMesh
  • Write() : Write
  • WriteAsync() : Scenario3_ReadWrite , AccessHandler , Scenario2_LEDTemp , PipeOut , AccessHandler
  • WriteBlock_Click() : sealed , DeviceReadWrite
  • WriteBufferToSelectedCharacteristicAsync() : Scenario2_Client
  • WriteButton_Click() : Scenario3_ReadWrite
  • WriteBytesButton_Click() : Scenario4 , sealed
  • WriteBytesInputValue_GotFocus() : Scenario3_ReadWrite
  • WriteBytesInputValue_TextChanged() : Scenario3_ReadWrite
  • WriteCancelButton_Click() : Scenario3_ReadWrite
  • WriteCompositeSetting_Click() : Scenario4_CompositeSettings
  • WriteData() : BasicReaderWriter
  • WriteDataAsync() : BasicReaderWriter
  • WriteErrorLogEntry() : CServiceBase
  • WriteEventLogEntry() : CSampleService , CServiceBase
  • WriteException() : sealed
  • WriteGeolocToAppData() : LocationBackgroundTask
  • WriteLedCommand() : Scenario2_LEDTemp
  • WriteLine() : sealed
  • WriteMessage() : sealed
  • WriteMessageAsync() : SocketReaderWriter
  • WriteReadStream() : sealed , WriteReadStream
  • WriteSetting_Click() : Scenario2_Settings , Scenario3_SettingContainer , Scenario2_Settings , Scenario3_SettingContainer
  • WriteStatusToAppData() : LocationBackgroundTask
  • WriteSuperMuttInterruptOut_Click() : Scenario3_InterruptPipes
  • WriteTextButton_Click() : Scenario3 , sealed , Scenario3
  • WriteTimeoutButton_Click() : Scenario3_ReadWrite
  • WriteToDeviceAsync() : IoSyncBackgroundTask
  • WriteToFileButton_Click() : Scenario5_TriggerCFU , sealed , Scenario5_TriggerCFU
  • WriteToFileWithExplicitCFUButton_Click() : sealed , Scenario5_TriggerCFU
  • WriteToInterruptOut() : Scenario3_InterruptPipes
  • WriteToStreamAsync() : HttpJsonContent
  • WriteToStreamButton_Click() : Scenario5 , sealed
  • WriteTrips() : TripStore , sealed
  • WriteXml() : sealed , Scenario2_XmlWriter , sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- x -

  • XmlLoading() : XmlLoading
  • XMScalarSinCos() : VideoRenderer
  • XsltInit() : XSLTTransform
  • XSLTTransform() : XSLTTransform
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- y -

  • YangContainer() : YangContainer
  • Yaw() : MoveLookController , Camera
  • YawSlider_ValueChanged() : sealed
  • YellowButton_Click() : sealed
  • yesButton_Click() : sealed , Scenario9_CustomPairDevice
  • YinCallback() : DOModel
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- _ -

  • __pad0__ : sealed
  • _connectedDevices : sealed
  • _discoveredDevices : sealed
  • _displayTime : sealed
  • _isSent : sealed
  • _IsUpperCaseEnabledChanged : sealed
  • _message : CaptureFailedEventArgs
  • _offset : sealed
  • _percentComplete : sealed
  • _PropertyChanged : sealed
  • _SessionMemberAdded : sealed
  • _SessionMemberRemoved : sealed
  • _size : sealed
  • _stateText : sealed
  • _storage : sealed
  • _storageChanged : sealed
  • _token : sealed
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- j -

  • joiner : sealed
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- k -

  • Key : Scenario1ViewModel , Scenario2ViewModel , FileItem , MapChangedEventArgs< K > , GroupInfoList
  • KeyData : LoadKeys
  • KeyHost : AddAuthorizationHeaderFilter
  • KeyId : ProactiveViewModel
  • KeyNumber : LoadKeys , GeneralAuthenticate
  • Keys : EmployeeDictionary
  • KeyType : LoadKeys , GeneralAuthenticate
  • kind : sealed
  • Kind : sealed , DeviceSelectorInfo
  • KnownTypes : SuspensionManager
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- l -

  • Label : TabHeader
  • Language : MediaStream
  • LassoSelect : sealed
  • LastErrorCode : AppData
  • LastErrorMessage : AppData
  • lastIndex : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • LastName : IEmployee , Manager , Contact , Employee
  • LastPeriodDuration : Manifest
  • LaunchArgs : MainPage
  • LaunchParam : MainPage
  • LaunchProducer : Scenario1ViewModel , Scenario2ViewModel
  • Le : ApduCommand
  • LeftEdgeBrush : EdgeTappedListView
  • Length : TlvEntry
  • License : VideoMetaData
  • licenseSession : SecureStopViewModel
  • ListViewItem : ListViewEdgeTappedEventArgs
  • LiveOffset : Player
  • LocalHost : LocalHostItem
  • localHost : sealed
  • LocalHost : LocalHostItem
  • localHost : sealed
  • LocalhostVideo : LowLatency
  • Location : sealed , PointOfInterest
  • LogFileGeneratedCount : LoggingSessionScenario , FileLoggingSessionScenario
  • LogFilePath : LoggingScenarioEventArgs
  • LoggingScenario : Scenario3
  • LoggingSessionScenario : Scenario2
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- m -

  • m_accountListView : sealed
  • m_busAttachment : sealed
  • m_busObject : sealed
  • m_deviceResources : sealed
  • m_dispInfo : sealed
  • m_dwriteFactory : sealed
  • m_enterpriseId : Scenario1
  • m_fontFamily : sealed
  • m_fontNameCollector : sealed
  • m_fontSize : sealed
  • m_gestureRecognizer : sealed
  • m_height : sealed
  • m_hr : sealed
  • m_imageInfo : sealed
  • m_imageMaxCLL : sealed
  • m_interfaceMemberArg : sealed
  • m_interfaceMemberMessage : sealed
  • m_interfaceName : sealed
  • m_isImageValid : sealed
  • m_isWindowVisible : sealed
  • m_languageTag : sealed
  • m_moderateMarginsIconAsyncOperation : sealed
  • m_narrowMarginsIconAsyncOperation : sealed
  • m_nativeBusAttachment : sealed
  • m_nativeBusObject : sealed
  • m_properties : sealed
  • m_proxyBusObject : sealed
  • m_renderer : sealed
  • m_renderOptionsViewModel : sealed
  • m_ServiceObjectPath : sealed
  • m_session : sealed
  • m_sessionListener : sealed
  • m_showHeader : sealed
  • m_signals : sealed
  • m_suppressRendererUpdates : sealed
  • m_text : DecodeResult , sealed
  • m_textLayout : sealed
  • m_textLayoutImageSource : sealed
  • m_textLayoutLineMetrics : sealed
  • m_usedFontNames : sealed
  • m_value2 : sealed
  • m_weak : sealed
  • m_wideMarginsIconAsyncOperation : sealed
  • m_width : sealed
  • madeVisible : sealed
  • MainDispatcher : App
  • MainViewId : App
  • ManagerProp : DataModel
  • Manifest : LiveSourceBufferManager
  • ManualSsid : Scenario2ViewModel
  • ManualSsidIsChecked : Scenario2ViewModel
  • ManualSsidTextBoxVisibility : Scenario2ViewModel
  • MapCoordinates : PlaceLocation
  • MediaCapture : MediaCapturePreviewer
  • MediaItem : MediaItemViewModel
  • MediaList : PlayerViewModel , Scenario1 , MediaListViewModel , PlaylistView
  • MediaPlaybackItem : MediaModel
  • MediaPresentationDuration : Manifest
  • MediaUri : MediaItem
  • MimeType : MediaStream
  • MinBufferTime : Manifest
  • MinHeight : ControlSizeTrigger
  • MinimumUpdatePeriod : Manifest
  • MinWidth : ControlSizeTrigger
  • Mix : AudioEchoEffect
  • Model : Functions , BasicTests , ListsAndTemplates , OtherBindings , EventTests , sealed
  • modelSet : sealed
  • MoviePath : ReactiveViewModel , HardwareDRMViewModel , ProactiveViewModel , SecureStopViewModel
  • MseSourceBuffer : SourceBufferManager
  • MultiTrackVideoMediaUri : MainPage
  • MyInt : sealed , OtherBindings , BasicTests
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- n -

  • Name : Item , RfcommChatDeviceDisplay , User , Scenario , Model , ScenarioGroup , Account , sealed , RadioModel , School , PlaceInfo , AdvertisementWrapper , Employee , IScenario , IEmployee , Manager
  • NavigationHelper : MainPage , TripDetails , TripListView
  • NavigationParameter : LoadStateEventArgs
  • NavigationService : App
  • newItem : CacheChangedEventArgs-g< T >
  • NextButtonVisibility : StepsControl
  • NextSegmentIndex : LiveSourceBufferManager
  • NextSegmentNumber : LiveSourceBufferManager
  • nodeNamespace : sealed
  • nodeValue : sealed
  • NonDPProperty : MyUserControl1
  • NormalizedAnchorPoint : sealed , PointOfInterest
  • notes : sealed
  • Notes : Trip
  • NullImageSource : Employee , Manager , IEmployee
  • NullStringProperty : Manager , IEmployee , sealed , Employee
  • Number : BadgeNumericNotificationContent , MediaSegment
  • NumOfShares : SocialMediaCounter
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- o -

  • ObjectFileOutput : FxCompile
  • offset : sealed
  • oldItem : CacheChangedEventArgs-g< T >
  • OnAppSuspendCallback : EventHandlerForDevice
  • Onboard : Scenario2ViewModel
  • OnboardeeNetworkList : Scenario2ViewModel
  • OnboardeeSsidListVisibility : Scenario2ViewModel
  • OnboarderNetworkList : Scenario2ViewModel
  • OnboarderSsidListVisibility : Scenario2ViewModel
  • OnboardingConfigurationState : AppData
  • OnboardingConfigurationVisibility : Scenario2ViewModel
  • OnboardingConfigureAuthType : AppData
  • OnboardingConfigurePassphrase : AppData
  • OnboardingConfigureSsid : AppData
  • OnboardingPassword : Scenario2ViewModel
  • OnboardingProducerIsChecked : Scenario2ViewModel
  • OnDeviceClose : EventHandlerForDevice
  • OnDeviceConnected : EventHandlerForDevice
  • opts : sealed
  • OutputLog : ViewModelBase
  • OutputStream : RemotePeer
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- a -

  • accelerometerReadingType : MainPage
  • AccelerometerReadingType : MainPage
  • AccountName : Account
  • Accounts : AdaptivePage
  • activePlayReadyHeader : SecureStopViewModel
  • ActiveSymbologies : DecodeEngine
  • ActualRpcCallbackRate : ServiceViewModel
  • AdditionalIncludeDirectories : FxCompile
  • Address : GeneralAuthenticate , ReadBinary , UpdateBinary
  • AddTripCommand : TripListViewModel
  • AdminKey : MainPage
  • Advertisement : sealed , SessionRequestWrapper
  • AdvertisementId : sealed , DiscoveredDeviceWrapper , SessionWrapper
  • Advertiser : AdvertisementWrapper
  • Advertisers : WiFiDirectServiceManager
  • AID : SelectCommand
  • AlbumArtUri : MusicItem
  • AlbumItems : MainViewModel
  • AllItems : sealed
  • ApduResponseType : ApduCommand
  • Appending : SourceBufferManager
  • AppendSessionDateToDestinationFolder : Scenario1
  • ApplicationLink : SharePage
  • areControlsInTitleBar : MainPage
  • AreControlsInTitleBar : MainPage
  • Article : ArticlePage
  • Article0 : HeroArticlesViewModel
  • Article1 : HeroArticlesViewModel
  • ArticleProperty : ArticlePage
  • ArtUri : MediaModel
  • AspectRatio : StreamResolution
  • AssemblerOutput : FxCompile
  • AssemblerOutputFile : FxCompile
  • Atr : IccDetection
  • AtrInformation : IccDetection
  • AttemptAuthentication : Scenario2ViewModel , Scenario1ViewModel
  • AudioCategories : PlayerViewModel
  • AuthenticateThroughBackgroundTask : ConfigStore
  • AuthenticationToken : ConfigStore
  • AuthenticationVisibility : Scenario1ViewModel , Scenario2ViewModel
  • AuthTypeArray : Scenario2ViewModel
  • AvailableNetwork : WiFiNetworkDisplay
  • AvailibilityStartTime : Manifest
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- b -

  • BackBufferDxgiFormat : CameraResources
  • BackBufferRenderTargetView : CameraResources
  • BackBufferTexture2D : CameraResources
  • BackButtonVisibility : BackButtonPage
  • Bag : FxCompile
  • BaseUrl : Manifest
  • Biography : Contact
  • Bitrate : BitrateItem , MediaSegmentInformation
  • BlockCount : Update , Check
  • BlockList : Update , Check
  • Body : Email , TextMessage
  • BoolPropWithINPC : DataModel
  • BoundaryError : DesfireResponse
  • Bssid : WiFiNetworkDisplay
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- c -

  • CanExecuteChanged : RelayCommand
  • CanGenerateSegmentsDynamically : MediaStream
  • CanSkipNext : PlayerViewModel
  • CanSkipPrevious : PlayerViewModel
  • CaptionedMediaUri : MainPage
  • CaptureSource : CaptureDevice
  • cardName : sealed
  • CardName : SmartCardListItem
  • CastButton : MediaTransportControlsWithCustomCastButton
  • ChannelCenterFrequency : WiFiNetworkDisplay
  • CheckBoxStyle : Scenario1_Basic
  • Children : ScenarioGroup
  • CLA : ApduCommand
  • ClassName : sealed
  • ClassType : Scenario
  • CmdGetLicense : ProactiveViewModel
  • CmdGetPublisherCert : SecureStopViewModel
  • CmdPlayMovie : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • CmdRenewLicense : SecureStopViewModel
  • CmdStopMovie : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • CmdUseHardware : HardwareDRMViewModel
  • CmdUseSoftware : HardwareDRMViewModel
  • CollectionChange : MapChangedEventArgs< K > , VectorChangedEventArgs
  • CollectionItems : MainViewModel
  • Color : sealed , ColorEntry
  • ColorEntries : sealed
  • ColorName : sealed , ColorEntry
  • ColorPropWithINPC : DataModel
  • Command : DesfireCommand
  • CommandData : ApduCommand
  • commandMode : sealed
  • ConfigMethods : sealed , DiscoveredDeviceWrapper
  • Connect : Scenario2ViewModel
  • ConnectedDevices : Scenario2_Connector
  • ConnectedSessionList : WiFiDirectServiceManager
  • connectionId : sealed
  • connectionObject : AccessHandler , IccDetection , AccessHandler
  • ConnectivityLevel : sealed , WiFiNetworkDisplay
  • ConnectPanelVisibility : Scenario2ViewModel
  • ConnectToProducer : Scenario1ViewModel
  • Consolidated : ViewLifetimeControl
  • consolidated : sealed
  • ConsumerOptionsVisibility : Scenario1ViewModel
  • ContentMinWidth : DynamicCommandBar
  • CoreTitleBarHeight : CustomTitleBar
  • CoreTitleBarPadding : CustomTitleBar
  • Count : FileDataSource , EmployeeCollection , FileDataSource , FileDataSource2 , ItemIndexRangeList , VeryObservableCollection-g< T > , FileDataSource , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , IncrementalLoadingBase , EmployeeCollection
  • CSharpModel : OtherBindings , Functions , BasicTests
  • Current : DeviceList , EventHandlerForDevice , ServiceViewModel , EventHandlerForDevice
  • CurrentItem : MediaListViewModel
  • CurrentItemIndex : MediaListViewModel
  • CurrentPlaylist : PlaybackService
  • CurrentSession : WiFiDirectServiceManager
  • CurrentUser : Scenario1_ParseAndStringify
  • customTitleBar : MainPage
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- d -

  • D2DFactory : DeviceResources
  • D3DDevice : DeviceResources
  • D3DDeviceContext : DeviceResources
  • D3DDeviceFeatureLevel : DeviceResources
  • D3DDeviceSupportsVprt : DeviceResources
  • D3DInteropDevice : DeviceResources
  • Data : Write , DesfireCommand
  • dataSource : PhasingTests
  • Date : FileItem
  • DateCreated : Item , ItemViewModel
  • DateCreatedHourMinute : ItemViewModel
  • DefaultBlankOnProtectedContent : sealed
  • DefaultGlobalOpacityCoefficient : sealed
  • DefaultHologramCompositionEnabled : sealed
  • DefaultLoopBackGain : sealed
  • DefaultMicrophoneGain : sealed
  • DefaultPreferredHologramPerspective : sealed
  • DefaultRecordingIndicatorEnabled : sealed
  • DefaultShowHiddenMesh : sealed
  • DefaultVideoStabilizationBufferLength : sealed
  • DefaultVideoStabilizationEnabled : sealed
  • DefaultViewModel : MainPage , TripDetails , TripListView
  • DeleteTripCommand : TripViewModel
  • DepthBufferTexture2D : CameraResources
  • DepthStencilView : CameraResources
  • Description : sealed , Scenario , Model
  • description : sealed
  • Description : Trip
  • DescriptorType : DescriptorTypeEntry
  • desfireCommand : AccessHandler
  • desfireResponse : AccessHandler
  • DesiredLiveOffset : LiveSourceBufferManager
  • destination : sealed
  • Destination : Trip
  • DestinationValidationError : TripViewModel
  • Device : EventHandlerForDevice
  • DeviceAccessInformation : EventHandlerForDevice
  • DeviceClassSelector : sealed , DeviceSelectorInfo
  • DeviceClosing : DeviceList
  • DeviceEvent : MainPage
  • DeviceFamily : DeviceFamilyTrigger
  • DeviceId : BarcodeScannerInfo
  • deviceId : sealed
  • DeviceInfo : DiscoveredDevice
  • DeviceInformation : OnDeviceConnectedEventArgs , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , OnDeviceConnectedEventArgs , DeviceInformationDisplay , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , DeviceListEntry
  • DeviceInformationKinds : sealed , DeviceInformationKindChoice
  • DeviceSelector : EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry
  • DirectManager : Employee , IEmployee , Manager
  • DisableOptimizations : FxCompile
  • DiscoveredDevices : Scenario2_Connector , WiFiDirectServiceManager
  • Dispatcher : ViewLifetimeControl
  • dispatcher : sealed
  • DisplayName : sealed , DeviceSelectorInfo , ConnectedDevice , FileItem , UserViewModel , PointOfInterest , ProtectionLevelSelectorInfo , FrameSourceGroupModel , FrameFormatModel , DeviceInformationKindChoice , FrameSourceInfoModel
  • DisplayString : LocalHostItem
  • DisplayTime : TextMessage
  • DisposeCollector : Disposer
  • download : DownloadOperationItem
  • downloadCollection : Scenario7_DownloadReordering
  • DPOnPage : BasicTests , OtherBindings
  • DPOnPageProperty : BasicTests , OtherBindings
  • Duration : Period , MediaSegmentInformation , TrackingEventCue , MediaSegment
  • DWriteFactory : DeviceResources
  • DxgiAdapter : DeviceResources
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- e -

  • Education : User
  • ElapsedSeconds : StepTimer
  • ElapsedTicks : StepTimer
  • Email : sealed , Account
  • Emails : AdaptivePage
  • EmployeePropertyDP : DataModel
  • EmployeePropertyDPProperty : DataModel
  • EmployeePropNoINPC : DataModel
  • EmployeePropWithINPC : DataModel
  • Employees : sealed , DataModel
  • Enabled : LoggingScenarioEventArgs
  • enabled : sealed
  • EnableDebuggingInformation : FxCompile
  • EncodingProperties : StreamResolution
  • endDate : sealed
  • EndDate : Trip
  • EnteredKey : Scenario2ViewModel , Scenario1ViewModel
  • entityHeader : sealed
  • entityIndex : sealed
  • EntryName : DescriptorTypeEntry
  • EntryPointName : FxCompile
  • ExpectedRpcCallbackRate : ServiceViewModel
  • ExtendedError : BackgroundAuthenticationCompletedEventArgs
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- f -

  • Filename : FileItem
  • FileSize : FileItem
  • FirstName : IEmployee , Manager , Employee , Contact
  • FirstPage : PrintHelper
  • Flavor : IBread , Bread
  • Folder : FileDataSource
  • Format : sealed , FrameFormatModel
  • Frame : NavigationHelper , RootFrameNavigationHelper , NavigationHelper , RootFrameNavigationHelper
  • FrameCount : StepTimer
  • FrameRate : StreamResolution
  • FrameSourceGroups : SourceGroupCollection
  • FramesPerSecond : StepTimer
  • From : Email
  • FullText : ArticleViewModel
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- g -

  • Geoposition : PlaceLocation
  • globalMutex : sealed
  • Glyph : TabHeader
  • GlyphBitmapImage : BluetoothLEDeviceDisplay , RfcommChatDeviceDisplay , DeviceInformationDisplay
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- h -

  • HardwareMajorVersion : CardDetails
  • HardwareMinorVersion : CardDetails
  • HardwareProtocolType : CardDetails
  • HardwareStorageSize : CardDetails
  • HardwareSubType : CardDetails
  • HardwareType : CardDetails
  • HardwareVendorID : CardDetails
  • HasHardwareDRM : PlayReadyInfoViewModel
  • HasHEVCSupport : PlayReadyInfoViewModel
  • HasLiveOffsetValue : Player
  • HasMinimumUpdatePeriod : Manifest
  • HasMoreItems : IncrementalLoadingBase , Conversation
  • HasMultiplePeriods : Manifest
  • HasPresentationDuration : Manifest
  • Header : TitledImage
  • HeaderFileOutput : FxCompile
  • Headers : HttpJsonContent
  • Headline : ArticleViewModel
  • Height : StreamResolution
  • HiddenVideo : LowLatency
  • HistoricalBytes : AtrInfo
  • HolographicCamera : CameraResources
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- i -

  • IccResponse : TransparentExchangeResponse
  • IconUri : Account
  • Id : TrackingEventCue , RfcommChatDeviceDisplay , ViewLifetimeControl , Scenario , sealed , VideoMetaData , FrameSourceGroupModel , SessionRequestWrapper , Contact , FrameSourceInfoModel , Item
  • id : sealed
  • Id : ViewLifetimeControl , School , User , SymbologyListEntry , WindowInfo , Period
  • ImageData : FileItem
  • ImageHeight : FileItem
  • ImagePath : SampleDataModel
  • ImageSource : Item , ArticleViewModel
  • ImageSourceUri : PointOfInterest , sealed
  • ImageUri : Model
  • ImageWidth : FileItem
  • ImportableItem : ImportableItemWrapper
  • ImportOperation : MainPage
  • inCollection : sealed
  • InCollection : ItemDetails
  • Index : VectorChangedEventArgs
  • InitSegmentData : MediaStream
  • InitSegmentUrl : MediaStream
  • InputString1 : Scenario1ViewModel
  • InputString2 : Scenario1ViewModel
  • INS : ApduCommand
  • Instance : PlaybackService , SettingsService , ScenarioCommon , FileLoggingSessionScenario , LoggingSessionScenario , DAL , WiFiDirectServiceManager
  • InstanceId : DeviceListEntry
  • Instruction : InstructionControl
  • InteractionMode : Scenario1_Basic
  • InternalId : AdvertisementWrapper
  • IntPropertyDP : DOModel , DataModel
  • IntPropertyDPProperty : DOModel , DataModel
  • IntPropNoINPC : DataModel
  • IntPropWithINPC : DataModel
  • IsAudio : SourceBufferManager
  • IsBusy : FileLoggingSessionScenario , LoggingSessionScenario
  • IsClipboardContentChangedEnabled : MainPage
  • IsColorEnabled : Model
  • IsDeviceConnected : EventHandlerForDevice
  • IsDeviceSuccessfullyConnected : OnDeviceConnectedEventArgs
  • IsDisposed : Disposer
  • IsEnabled : RadioModel , SymbologyListEntry
  • IsEnabledAutoReconnect : EventHandlerForDevice
  • IsEndOfStream : SourceBufferManager
  • IsFixedSize : IncrementalLoadingBase , EmployeeCollection , VeryObservableCollection-g< T > , FileDataSource , FileDataSource2 , FileDataSource
  • IsFixedTimeStep : StepTimer
  • IsFlagged : SampleDataModel
  • IsIndividualized : PlayReadyHelpers
  • isInitSegmentDownloading : MediaStream
  • IsInverse : BooleanToVisibilityConverter
  • IsItemLeftEdgeTapEnabled : EdgeTappedListView
  • IsLive : Manifest
  • IsLoggingEnabled : FileLoggingSessionScenario , LoggingSessionScenario
  • IsManager : Employee , Manager , IEmployee
  • IsNew : SampleDataModel , sealed
  • IsNextEnabled : StepsControl
  • IsPreparingForSuspend : FileLoggingSessionScenario
  • IsPresent : IsApiPropertyPresentTrigger
  • IsPreviewing : MediaCapturePreviewer , Scenario5_DisplayingBarcodePreview
  • IsRadioOn : RadioModel
  • IsReadOnly : EmployeeDictionary , FileDataSource , EmployeeCollection , FileDataSource2 , ItemIndexRangeList , VeryObservableCollection-g< T > , IncrementalLoadingBase , FileDataSource
  • IsReceived : TextMessage
  • IsRecording : MediaCapturePreviewer
  • IsRenderingStereoscopic : CameraResources
  • IsScannerClaimed : Scenario5_DisplayingBarcodePreview
  • IsSelected : Period
  • IsSent : TextMessage
  • IsSupportedProfile : Manifest
  • IsSynchronized : EmployeeCollection , VeryObservableCollection-g< T > , FileDataSource , IncrementalLoadingBase , FileDataSource2 , FileDataSource
  • IsUpperCaseEnabled : Scenario1ViewModel , AppData
  • IsVideo : SourceBufferManager
  • Item : DetailPage
  • ItemClick : PlaylistView
  • ItemId : ItemViewModel , MediaItem
  • itemIndex : CacheChangedEventArgs-g< T >
  • ItemProperty : DetailPage
  • Items : MainViewModel
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- p -

  • P1 : ApduCommand
  • P2 : ApduCommand
  • Page : NavigationHelper
  • pageIsLoading : Scenario1_NavToUrl
  • PageState : LoadStateEventArgs , SaveStateEventArgs , LoadStateEventArgs , SaveStateEventArgs
  • PairingCode : DialLaunchArguments
  • PasswordVisibility : Scenario2ViewModel
  • Path : FileItem
  • Payload : PopToastControl
  • PcscCardName : IccDetection
  • PcscDeviceClass : IccDetection
  • percentComplete : DownloadOperationItem
  • Phone : User
  • PhoneNumber : Contact
  • PhysicalDeviceIsChecked : Scenario2ViewModel
  • Pin : sealed , SessionRequestWrapper , AdvertisementWrapper
  • PlaceHolderImage : MainPage
  • Places : Cluster
  • PlaybackEnabled : ViewModelBase
  • PlaybackItem : MediaItemViewModel
  • PlaybackList : Scenario1 , MediaListViewModel
  • PlaybackSession : PlayerViewModel
  • Player : ProjectionViewPage , PlaybackService
  • PlayerViewModel : Scenario1
  • PlayReadyInfo : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • PlayReadySecurityVersion : PlayReadyInfoViewModel
  • PointerType : InputTypeTrigger
  • Port : SocketWrapper
  • Position : DialLaunchArguments , SpinningCubeRenderer , Contact
  • Preference : SizePreferenceString
  • PreprocessorDefinitions : FxCompile
  • prettyDate : FileItem
  • prettyFileSize : FileItem
  • prettyImageSize : FileItem
  • PreviewImage : MediaItemViewModel
  • PreviewImageUri : MediaItem , MusicItem , VideoItem
  • Price : ItemDetails
  • price : sealed
  • PrintCanvas : PrintHelper
  • PrintFrame : sealed
  • ProducerOptionsVisibility : Scenario1ViewModel
  • ProductionBatchNumber : CardDetails
  • productKind : sealed
  • ProductKind : ItemDetails
  • PropertyChanged : sealed
  • PropertyName : IsApiPropertyPresentTrigger
  • Props : RequiredDeviceProperties
  • ProtectionLevel : ProtectionLevelSelectorInfo , sealed
  • ProtectionManager : ViewModelBase
  • Protocol : SocketWrapper
  • ProtocolInterfaceA : AtrInfo
  • ProtocolInterfaceB : AtrInfo
  • ProtocolInterfaceC : AtrInfo
  • ProtocolInterfaceD : AtrInfo
  • ProvisioningInfo : sealed , SessionRequestWrapper
  • PubDate : VideoMetaData
  • PublishTime : Manifest
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- r -

  • ReaderKeyNumber : LoadKeys
  • ReaderName : SmartCardListItem
  • ReceivedDate : Email
  • refCount : sealed
  • Released : ViewLifetimeControl
  • released : sealed
  • remoteUrl : sealed
  • RenderTargetSize : CameraResources
  • ReportsDict : Manager
  • ReportsEnum : Manager
  • ReportsList : Manager
  • ReportsOC : Manager
  • RepresentationID : MediaSegmentInformation
  • RequestConcatenate : Scenario1ViewModel
  • ResponseData : ApduResponse
  • ResponseStatus : TransparentExchangeResponse
  • ResultCollection : Scenario3_RegisterForUpdates , Scenario4_Connect , Scenario2_Scan , Scenario1_ChatClient , sealed , Scenario1_CachedNetworks
  • RootPage : WiFiDirectServiceManager
  • Rssi : WiFiNetworkDisplay
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- s -

  • SampleMessage : ServiceViewModel
  • SampleNetworkInfoVisibility : Scenario2ViewModel
  • SampleNetworkList : Scenario2ViewModel
  • SampleNetworkScanList : AppData
  • SaveTripCommand : TripViewModel
  • ScannerSupportsPreview : Scenario5_DisplayingBarcodePreview
  • ScanPanelVisibility : Scenario2ViewModel
  • Scenario : ScenarioPage
  • Scenario1 : WiFiDirectServiceManager
  • Scenario2 : WiFiDirectServiceManager
  • Scenario3 : WiFiDirectServiceManager
  • Scenario4 : WiFiDirectServiceManager
  • Scenario5 : WiFiDirectServiceManager
  • ScenarioGroup : MainPage
  • Scenarios : MainPage
  • SdkToolsPath : FxCompile
  • SecurityLevel : PlayReadyInfoViewModel
  • SecuritySettings : WiFiNetworkDisplay
  • SegmentInformation : MediaStream
  • SegmentInfoType : MediaStream
  • Segments : MediaStream
  • SegmentTemplateBase : MediaStream
  • SegmentUrl : MediaSegment
  • SelectedAudioCategory : PlayerViewModel
  • SelectedAuthType : Scenario2ViewModel
  • SelectedContact : DetailsPage
  • SelectedOnboardeeNetwork : Scenario2ViewModel
  • SelectedOnboarderNetwork : Scenario2ViewModel
  • SelectedSampleNetwork : Scenario2ViewModel
  • SelectedSampleNetworkAuthentication : Scenario2ViewModel
  • SelectedSampleNetworkPassword : Scenario2ViewModel
  • SelectedSoftAPNetwork : Scenario2ViewModel
  • SelectedTrip : TripListViewModel
  • SelectedWiFiAdapterIndex : Scenario2ViewModel
  • SelectionChanged : PlaylistView
  • Selector : sealed , DeviceSelectorInfo
  • SendSignal : Scenario1ViewModel
  • SensorDescription : MainPage
  • SensorOptimizationGoal : MainPage
  • sensorOptimizationGoal : MainPage
  • sensorReadingType : MainPage
  • SensorReadingType : MainPage
  • ServiceAddress : sealed , DiscoveredDeviceWrapper , SessionWrapper
  • ServiceCodeList : Check , Update
  • ServiceCount : Check , Update
  • ServiceInfo : sealed , DiscoveredDeviceWrapper
  • ServiceName : sealed , DiscoveredDeviceWrapper
  • Session : SessionWrapper
  • SessionAddress : SessionWrapper
  • SessionId : SessionWrapper
  • SessionInfo : sealed , SessionRequestWrapper
  • SessionRequestList : AdvertisementWrapper
  • SessionState : SuspensionManager
  • ShaderModel : FxCompile
  • ShaderType : FxCompile
  • ShareImage : SocialMediaCounter
  • ShowDelete : TripViewModel
  • ShowDestinationValidation : TripViewModel
  • ShowImage : CustomOptionsPrintHelper
  • ShowText : CustomOptionsPrintHelper
  • SignalText : Scenario1ViewModel
  • SintelMediaUri : MainPage
  • size : sealed
  • Size : FileItem
  • SliderEnabled : ServiceViewModel
  • SliderValue : ServiceViewModel
  • smartCard : IccDetection
  • SmartCardReaderDeviceId : MainPage
  • SocketList : SessionWrapper
  • SocketRW : ConnectedDevice
  • SoftAPPassword : Scenario2ViewModel
  • SoftwareMajorVersion : CardDetails
  • SoftwareMinorVersion : CardDetails
  • SoftwareProtocolType : CardDetails
  • SoftwareStorageSize : CardDetails
  • SoftwareSubType : CardDetails
  • SoftwareTriggerStarted : Scenario5_DisplayingBarcodePreview
  • SoftwareType : CardDetails
  • SoftwareVendorID : CardDetails
  • Source : TitledImage , FxCompile
  • SourceGroup : sealed , FrameSourceGroupModel , FrameSourceInfoModel
  • SourceInfo : FrameSourceInfoModel , sealed
  • SourceInfos : sealed , FrameSourceGroupModel
  • SourceInterfaces : sealed
  • SourceUri : VideoItem
  • SourceUrl : Manifest
  • Ssid : WiFiNetworkDisplay
  • Start : Period
  • StartButtonEnabled : ServiceViewModel
  • startDate : sealed
  • StartDate : Trip
  • StartNumber : MediaSegmentInformation
  • StartScan : Scenario2ViewModel
  • StartTime : TrackingEventCue
  • StartTimestamp : MediaSegmentInformation
  • stateText : DownloadOperationItem
  • Status : AdvertisementWrapper
  • StatusMessage : UnhandledExceptionPage
  • Step : StepsControl , StepsHelperControl
  • StepKind : HistoryRecord
  • stepKind : sealed
  • stepsCount : sealed
  • StepsCount : HistoryRecord
  • StepsDuration : HistoryRecord
  • stepsDuration : sealed
  • StopButtonEnabled : ServiceViewModel
  • StorageType : LoadKeys
  • storeId : sealed
  • StoreId : ItemDetails
  • StringPropAsInteger : DataModel
  • StringPropertyDP : DataModel
  • StringPropertyDPProperty : DataModel
  • StringPropNoINPC : DataModel
  • StringPropWithINPC : DataModel
  • Subject : Email
  • SubsequentFrame : DesfireResponse
  • Succeeded : TransparentExchangeResponse , ApduResponse , DesfireResponse , ManageSessionResponse
  • Suggestions : Scenario2
  • SupportedDeviceSelectors : CustomDevicePickerFilter
  • SupportedEncodingProperties : AudioEchoEffect
  • SupportedSymbologies : DecodeEngine
  • SuppressStartupBanner : FxCompile
  • SW : ApduResponse
  • SW1 : ApduResponse
  • SW2 : ApduResponse
  • SWTranslation : ApduResponse , DesfireResponse
  • Symbology : DecodeResult
  • SyncRoot : EmployeeCollection , FileDataSource2 , FileDataSource , IncrementalLoadingBase , VeryObservableCollection-g< T >
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- t -

  • Tag : TlvEntry
  • TagLength : TlvEntry
  • TargetElapsedSeconds : StepTimer
  • TargetElapsedTicks : StepTimer
  • TargetElement : InputTypeTrigger , ControlSizeTrigger
  • TckValid : AtrInfo
  • Text : DecodeResult , Item , ItemViewModel
  • TextContentBlock : sealed , PageToPrint
  • textSpoken : sealed
  • this : IncrementalLoadingBase , EmployeeCollection , EmployeeDictionary , FileDataSource , VeryObservableCollection-g< T > , FileDataSource , ItemCacheManager< T > , ItemIndexRangeList , FileDataSource2
  • Thumbnail : VideoMetaData , ImportableItemWrapper
  • Timescale : MediaSegmentInformation
  • TimeShiftBufferDepth : Manifest
  • Timestamp : MediaSegment
  • TimeStamp : HistoryRecord
  • Timezone : User
  • Title : MediaList , ItemDetails
  • title : sealed
  • Title : VideoItem , Scenario , VideoMetaData , Scenario , ViewLifetimeControl , MediaItem , DASHEntry , SizePreferenceString , ViewLifetimeControl , SampleDataModel , MediaModel , sealed , Employee , Item , Manager , ItemViewModel , SampleDataModel , IEmployee
  • TitleBar : Scenario1_Colors
  • ToastOnAppEvents : SettingsViewModel , SettingsService
  • ToolName : FxCompile
  • TotalSeconds : StepTimer
  • TotalTicks : StepTimer
  • TouchWriting : sealed
  • TrackingEventUri : TrackingEventCue
  • TransmissionType : LoadKeys
  • TreatAsOnDemand : Manifest
  • TreatWarningAsError : FxCompile
  • Trip : TripViewModel
  • TripListViewModel : ViewModelLocator
  • Trips : TripStore , TripListViewModel
  • TripViewModel : ViewModelLocator
  • Type : LoggingScenarioEventArgs , School , GetData
  • TypeName : IsApiPropertyPresentTrigger
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- u -

  • UID : CardDetails
  • UIElementType : Scenario
  • UncaptionedMediaUri : MainPage
  • UpdateStatus : sealed
  • Url : DASHEntry
  • UrlTemplate : MediaSegmentInformation
  • UseCustomControls : SettingsViewModel , SettingsService
  • UseInputFrameForOutput : AudioEchoEffect
  • UseNativeWISPr : ConfigStore
  • UserId : UserViewModel
  • Users : DAL
  • UsesPassport : Account , sealed
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- v -

  • Value : TlvEntry , YangContainer
  • ValueLength : TlvEntry
  • Values : EmployeeDictionary
  • VariableName : FxCompile
  • Verified : User
  • Version : ManageSessionResponse
  • VersionNumber : GeneralAuthenticate
  • VideoId : DialLaunchArguments
  • VideoLink : VideoMetaData
  • VideoPreviewImageUri : VideoItem
  • viewId : sealed
  • ViewModel : SectionView , Settings , sealed
  • ViewModelProperty : SectionView
  • Viewport : CameraResources
  • Visibility : Employee , IEmployee , Manager
  • visibilityToken : sealed
  • Volume : Oven , IAppliance
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- w -

  • WaveformNamesMap : MainPage
  • WebPageLink : VideoMetaData
  • WeekOfProduction : CardDetails
  • WfdDevice : ConnectedDevice
  • WicImagingFactory : DeviceResources
  • Width : FileSavePickerPageSizeChangedEventArgs , MainPageSizeChangedEventArgs , StreamResolution , CachedFileUpdaterPageSizeChangedEventArgs
  • WiFiAdapterDisplayNames : Scenario2ViewModel
  • WiFiAdapterListVisibility : Scenario2ViewModel
  • WiFiImage : WiFiNetworkDisplay , sealed
  • Window : WindowInfo
  • window : sealed
  • WindowList : Scenario3_UsingWindows
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- y -

  • YangObj : DOModel
  • YearOfProduction : CardDetails
  • YinPropertyDP : DOModel
  • YinPropertyDPProperty : DOModel
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Related Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • List< T > : List< T >::POSITION
  • operator!= : PageDescription
  • operator== : PageDescription
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Typedefs

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • CCCEventHandler : sealed
  • Container : CBufferPacket
  • InvokeFn : AsyncCallback< T >
  • Iterator : CBufferPacket
  • LaunchType : sealed
  • LookupTableGenerator : LookupTable< T, LookupTableSize >
  • MapIconStateToStyleEntryState : sealed
  • OpList : OpQueue< T, TOperation >
  • Ptr : ComPtrList< T, NULLABLE >
  • StreamContainer : CMediaSink , CMediaSource
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- _ -

  • _11 : Matrix4x4< T >
  • _12 : Matrix4x4< T >
  • _13 : Matrix4x4< T >
  • _14 : Matrix4x4< T >
  • _21 : Matrix4x4< T >
  • _22 : Matrix4x4< T >
  • _23 : Matrix4x4< T >
  • _24 : Matrix4x4< T >
  • _31 : Matrix4x4< T >
  • _32 : Matrix4x4< T >
  • _33 : Matrix4x4< T >
  • _34 : Matrix4x4< T >
  • _41 : Matrix4x4< T >
  • _42 : Matrix4x4< T >
  • _43 : Matrix4x4< T >
  • _44 : Matrix4x4< T >
  • __pad0__ : ViewModelBase , Fx2Driver , sealed , BasicReaderWriter , BasicTimer , MainPage , sealed , PrintHelper , TypeConversionHelpers , sealed , MainPage , sealed , BasicLoader , DecodeResult , BasicShapes , PersistentState , DecodeEngine , GameHud , GameInfoOverlay , sealed , GameRenderer , Simple3DGame , AdvancedCaptureContext , sealed , CSendOperationStatus , sealed , CNetworkChannel , sealed , sealed::sealed , abstract , sealed , CaptureFailedEventArgs , SdkSample , sealed , PipeOut , sealed , PipeIn , sealed
  • __pad1__ : DecodeResult
  • _aamvaCardDataReceivedToken : sealed
  • _accelerometer : sealed , Scenario1_DataEvents , Scenario2_ShakeEvents , Scenario3_Polling
  • _acceptOperation : sealed
  • _active : sealed
  • _activitySensor : Scenario3_ChangeEvents
  • _advancedCapture : sealed , MainPage
  • _advancedCaptureMode : sealed , MainPage
  • _advertisementStatusChangedToken : sealed
  • _advertiser : sealed
  • _advertiserMutex : sealed
  • _advertisers : sealed
  • _albumItems : MainViewModel
  • _allPhotosCapturedEventToken : sealed
  • _angle : OmnidirectionalSound
  • _angularVelocity : sealed
  • _appContactId : AppContactPanel
  • _applicationResumingEventToken : sealed
  • _applicationSuspendingEventToken : sealed
  • _article0 : HeroArticlesViewModel
  • _article1 : HeroArticlesViewModel
  • _audioData : AudioFileReader , AudioStreamReader
  • _audioFile : OmnidirectionalSound , CardioidSound , CustomDecaySound
  • _audioStream : OmnidirectionalSound
  • _autoAcceptSessionConnectedToken : sealed
  • _bankCardDataReceivedToken : sealed
  • _barDismissed : sealed , CalibrationBar
  • _beginDrawStarted : DeviceResources
  • _BoolPropWithINPC : DataModel
  • _breadBaked : WrlFinal
  • _buffer : BufferHelper
  • _bufferByteAccess : BufferHelper
  • _buffers : CBufferPacket , CBufferEnumerator
  • _busy : IncrementalLoadingBase
  • _bytes : BufferHelper
  • _c_sec0 : Scenario3_Trim
  • _c_sec1 : Scenario3_Trim
  • _cache : FileDataSource
  • _calibrationTimer : sealed , CalibrationBar
  • _callback : CMediaSink
  • _cameraEnclosureLocation : sealed , CameraRotationHelper
  • _cancelReason : BackgroundActivity , SampleBackgroundTask
  • _cancelRequested : AuthenticationTask , BackgroundActivity , SampleBackgroundTask , ServicingComplete
  • _canExecute : RelayCommand
  • _canExecuteCallback : sealed
  • _captureFolder : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , Scenario2_PhotoSettings , Scenario3_AspectRatio , sealed , MainPage , sealed , MainPage
  • _cardioidSound : sealed
  • _CCCToken : sealed
  • _CCToken : sealed
  • _changeEvents : ScenarioElement
  • _channel : sealed
  • _channelLoggingLevel : sealed
  • _claimedReader : sealed , Scenario1_BankCards , Scenario2_AamvaCards
  • _collectionItems : MainViewModel
  • _ColorPropWithINPC : DataModel
  • _compass : Scenario1_DataEvents , Scenario2_Polling
  • _CompletionEvent : ReadStreamTask::ReadStreamTaskImpl
  • _completionEvent : sealed
  • _compositionTarget : sealed , VisualProperties
  • _compositor : sealed , VisualProperties , Scenario2_Conditional
  • _ConcatenateCalled : sealed
  • _config : sealed
  • _ConfigureWiFiCalled : sealed
  • _ConnectCalled : sealed
  • _Connected : CStreamSink
  • _connectedSessions : sealed
  • _connectionId : sealed
  • _connectionReceivedToken : sealed
  • _connectionRequestedToken : sealed
  • _ConnectionResultReceived : sealed
  • _contentSize : DeviceResources
  • _contentZoomFactor : DeviceResources
  • _context : AuthenticationTask
  • _contextMenuFlyout : sealed
  • _coreWindow : CustomEditControl
  • _count : GeneratorIncrementalLoadingClass-g< T > , FileDataSource , FileDataSource2
  • _countOfCoalescedIndependentInput : InkEventLogger
  • _countOfCoalescedStrokeMessages : InkEventLogger
  • _countOfCoalescedUnprocessedInput : InkEventLogger
  • _cRef : CBufferPacket , CBufferEnumerator , CMarker , CMediaSink , CSourceOperation , CMediaSource , CMediaStream , CStreamSink::CAsyncOperation , CStreamSink
  • _criticalSection : sealed
  • _critSec : CNetworkChannel , sealed , CMediaSink , sealed , CMediaSource , CStreamSink
  • _cStreamsEnded : CMediaSink
  • _cts : Scenario2_GetPosition , Scenario4_ForegroundGeofence , LocationBackgroundTask , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • _CTS : sealed
  • _Current : DeviceList , sealed
  • _currentConfig : InkEventLogger
  • _currentDeviceFamily : DeviceFamilyTrigger
  • _currentHeight : ControlSizeTrigger
  • _currentHitTestState : sealed
  • _currentHitTestSubState : sealed
  • _currentIt : CBufferEnumerator
  • _currentMessage : sealed
  • _CurrentReceivedOperationHeader : CMediaSource
  • _currentSession : Scenario1_BasicUserActivity , Scenario2_AdvancedUserActivity , Scenario3_AdaptiveCard
  • _currentState : sealed
  • _currentVisual : sealed , VisualProperties
  • _currentWidth : ControlSizeTrigger
  • _customDataType : sealed
  • _customDecaySound : sealed
  • _d2dContext : DeviceResources
  • _d2dDevice : DeviceResources
  • _d2dFactory : DeviceResources
  • _d3dContext : DeviceResources
  • _d3dDevice : DeviceResources
  • _data : Metering , CSourceOperation
  • _datagramMessageReceivedToken : sealed
  • _datagramSocket : sealed
  • _dataReader : SocketReaderWriter
  • _dataSize : sealed
  • _dataSource : sealed , PhasingTests
  • _dataWriter : SocketReaderWriter
  • _deferral : BackgroundActivity , sealed , SampleBackgroundTask
  • _deletedItem : sealed , Scenario1_ListView
  • _desiredReportInterval : Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario3_Polling , Scenario1_DataEvents , Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling
  • _Destination : ReadStreamTask::ReadStreamTaskImpl
  • _destinationEffectsPresent : Scenario2_Conditional
  • _destVisual : Scenario2_Conditional
  • _details : AuthenticationTask
  • _device : sealed
  • _deviceAccessInformation : Scenario3_ChangeEvents
  • _deviceAddedToken : sealed
  • _deviceEventArgs : MainPage
  • _deviceInfo : sealed
  • _deviceOrientation : sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _deviceRemovedToken : sealed
  • _deviceResources : SceneComposer
  • _deviceUpdatedToken : sealed
  • _deviceUseBackgroundTaskRegistration : sealed , Scenario1_DeviceUse
  • _deviceUseTrigger : sealed , Scenario1_DeviceUse
  • _deviceWatcher : sealed , Scenario2_Connector
  • _deviceWatcherEnumerationCompletedToken : sealed
  • _deviceWatcherStoppedToken : sealed
  • _dimensions : Oven
  • _dims : sealed , WrlFinal
  • _discoveredDevices : sealed
  • _discoveryMutex : sealed
  • _dispatcher : SourceGroupCollection , SimpleLogger , MediaCapturePreviewer , Scenario1_Default , Scenario2_Custom , Scenario3_Trim , sealed , SdkSample , FileDataSource , FileDataSource2
  • _dispatcherTimer : Scenario3_Polling , Scenario2_Polling
  • _displayInformation : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , CameraRotationHelper , sealed , MainPage
  • _displayInformationEventToken : sealed
  • _displayOrientation : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _displayRequest : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _download : DownloadOperationItem
  • _downloadCollection : sealed
  • _dpiAdjustmentRatio : DeviceResources
  • _DPOnPage : sealed , BasicTests , OtherBindings
  • _dragging : sealed , VisualProperties
  • _dragOperation : sealed , Scenario3_StartDragAsync
  • _dropHere : sealed
  • _duration : OmnidirectionalSound
  • _dwId : CMediaStream
  • _dwIdentifier : CStreamSink
  • _editContext : CustomEditControl
  • _eDropMode : CMediaStream
  • _eMarkerType : CMarker
  • _employee : Manager
  • _EmployeePropertyDPProperty : DataModel
  • _EmployeePropWithINPC : DataModel
  • _Employees : DataModel
  • _enabled : sealed , LoggingScenarioEventArgs
  • _encodingProfile : sealed , MainPage
  • _encodingProperties : sealed
  • _EndDryPending : SceneComposer
  • _entities : sealed
  • _entityId : sealed
  • _entityIndex : sealed
  • _environment : OmnidirectionalSound , CardioidSound , CustomDecaySound
  • _error : CSendOperationStatus
  • _eSourceState : CMediaSource , CMediaStream
  • _eventLogger : sealed
  • _execute : RelayCommand
  • _executeCallback : sealed
  • _extendingLeft : CustomEditControl
  • _externalCamera : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _faceDetectedEventToken : sealed
  • _faceDetectionEffect : sealed , MainPage
  • _fActive : CMediaStream
  • _fAsyncOperationInProgress : sealed
  • _fConnected : SetConnectedFunc
  • _fDiscontinuity : CMediaStream
  • _fDropTime : CMediaStream
  • _fFirstSampleAfterConnect : CStreamSink
  • _fGetStartTimeFromSample : CStreamSink
  • _fInitDropTime : CMediaStream
  • _firstAdapter : sealed
  • _FirstName : Employee
  • _fIsVideo : CStreamSink
  • _flavor : Bread
  • _flRate : CSetRateOperation , CMediaSource , CMediaStream
  • _folder : FileDataSource , FileDataSource2
  • _foregroundAppId : AuthenticationTask
  • _format : AudioFileReader , AudioStreamReader
  • _FPSTimer : Scenario1_ExampleOperations
  • _frame : sealed
  • _frameBuffer : sealed
  • _frameCount : Scenario1_ExampleOperations
  • _frameRenderer : Scenario2_FindAvailableSourceGroups
  • _frameRenderers : Scenario1_DisplayDepthColorIR
  • _fShutdown : sealed
  • _fThin : CSetRateOperation
  • _fVideo : CMediaStream
  • _fWaitingForCleanPoint : CMediaStream
  • _fWaitingForFirstSample : CStreamSink
  • _fWatcherStarted : sealed , Scenario2_Connector
  • _generator : ShapeRenderer , GeneratorIncrementalLoadingClass-g< T >
  • _geofenceTask : Scenario5_GeofenceBackgroundTask
  • _geolocator : Scenario1_TrackPosition
  • _geolocTask : Scenario3_BackgroundTask
  • _gestureRecognizer : sealed
  • _GetIsUpperCaseEnabledRequested : sealed
  • _GetLastErrorRequested : sealed
  • _GetScanInfoCalled : sealed
  • _GetStateRequested : sealed
  • _GetVersionRequested : sealed
  • _groupCollection : Scenario2_FindAvailableSourceGroups
  • _groupSelectionIndex : Scenario1_DisplayDepthColorIR
  • _guiCurrentSubtype : CStreamSink
  • _gyrometer : Scenario1_DataEvents , Scenario2_Polling
  • _hardwareCameraButtonEventToken : sealed
  • _header : TitledImage
  • _headline : ArticleViewModel
  • _height : sealed
  • _helper : Scenario1_ExampleOperations
  • _highlighterStroke : SceneComposer::InkObject
  • _hnsAmountToDrop : CMediaStream
  • _hnsStartDroppingAt : CMediaStream
  • _hrtfParams : OmnidirectionalSound , CardioidSound , CustomDecaySound , OmnidirectionalSound
  • _imageData : FileItem
  • _imagePath : ScenarioElement
  • _imageSource : sealed
  • _imageUri : ArticleViewModel
  • _Impl : ReadStreamTask
  • _importOperation : MainPage
  • _inclinometer : Scenario1_DataEvents , Scenario2_Polling
  • _incomingConnectionEventRegistrationToken : sealed
  • _independentInput : sealed
  • _independentInputEnteringToken : sealed
  • _independentInputExitingToken : sealed
  • _independentInputHoveringToken : sealed
  • _independentInputLostToken : sealed
  • _independentInputMovingToken : sealed
  • _independentInputPressingToken : sealed
  • _independentInputReleasingToken : sealed
  • _informationElements : Scenario1_Advertiser
  • _initialization : sealed
  • _initialized : sealed
  • _initialPointerPoint : sealed
  • _initStatus : OmnidirectionalSound
  • _inkRenderer : SceneComposer
  • _inkSynchronizer : SceneComposer
  • _inLassoSelection : SceneComposer
  • _InputFile : sealed , Scenario1_Default , Scenario2_Custom , Scenario3_Trim
  • _inputMode : sealed
  • _inputPane : CustomEditControl
  • _inputPropertiesBackup : sealed , MainPage
  • _insideName : sealed
  • _instance : sealed , Scenario2 , Scenario3 , sealed
  • _internalFocus : CustomEditControl
  • _IntPropertyDPProperty : DOModel , DataModel
  • _IntPropWithINPC : DataModel
  • _isActive : sealed , Scenario3_StartDragAsync
  • _isActivePage : sealed , MainPage
  • _isBusy : LoggingSessionScenario , sealed , FileLoggingSessionScenario
  • _isChannelEnabled : sealed , FileLoggingSessionScenario , LoggingSessionScenario
  • _isClosed : CNetworkChannel
  • _IsConnected : CMediaSink
  • _isFocused : MainPage
  • _isInitialized : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _isLoggingEnabled : sealed
  • _isPreparingForSuspend : sealed , FileLoggingSessionScenario
  • _isPresent : IsApiPropertyPresentTrigger
  • _isPreviewing : MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed
  • _isPropertyPresent : IsApiPropertyPresentTrigger
  • _isRecording : sealed , MainPage , sealed , MainPage
  • _IsShutdown : CMediaSink , CStreamSink
  • _isSuspending : sealed , MainPage
  • _isTerminator : sealed
  • _isTracked : sealed
  • _isUIActive : sealed , MainPage
  • _itemId : ItemViewModel
  • _items : Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView , ItemsDataSource , MainViewModel
  • _knownTypes : SuspensionManager
  • _lamp : sealed
  • _lampAvailabilutyChangedEventToken : sealed
  • _lastCalibrationTime : sealed , CalibrationBar
  • _LastName : Employee
  • _lastPointerType : InputTypeTrigger
  • _lastSelectedItem : MasterDetailPage
  • _lastTick : OmnidirectionalSound
  • _latencyMode : sealed
  • _listener : sealed , Scenario1_Advertiser
  • _listenerSocket : sealed
  • _listeningPort : sealed
  • _llStartTime : StartFunc , CMediaSink , SetConnectedFunc
  • _loadTimer : ArticlePage
  • _localHostVideo : sealed
  • _log : InkEventLogger
  • _logFileFullPath : sealed , LoggingScenarioEventArgs
  • _logFileGeneratedCount : FileLoggingSessionScenario , LoggingSessionScenario , sealed
  • _logger : Scenario1_DisplayDepthColorIR , Scenario2_FindAvailableSourceGroups
  • _logicalDPI : DeviceResources
  • _longTimeFormatter : sealed
  • _m00 : Matrix4x4< T >
  • _m01 : Matrix4x4< T >
  • _m02 : Matrix4x4< T >
  • _m03 : Matrix4x4< T >
  • _m10 : Matrix4x4< T >
  • _m11 : Matrix4x4< T >
  • _m12 : Matrix4x4< T >
  • _m13 : Matrix4x4< T >
  • _m20 : Matrix4x4< T >
  • _m21 : Matrix4x4< T >
  • _m22 : Matrix4x4< T >
  • _m23 : Matrix4x4< T >
  • _m30 : Matrix4x4< T >
  • _m31 : Matrix4x4< T >
  • _m32 : Matrix4x4< T >
  • _m33 : Matrix4x4< T >
  • _magnetometer : Scenario1_DataEvents , Scenario2_Polling
  • _manager : sealed
  • _Manager : Employee
  • _managerMutex : sealed
  • _ManagerProp : DataModel
  • _maxCount : GeneratorIncrementalLoadingClass-g< T >
  • _mediaCapture : sealed , MainPage , Scenario1_DisplayDepthColorIR , Scenario2_FindAvailableSourceGroups , sealed , MainPage , Scenario1_ExampleOperations , sealed , MainPage , sealed , MainPage , sealed
  • _mediaCaptureFailedEventRegistrationToken : sealed
  • _mediaCaptureFailedEventToken : sealed
  • _mediaCaptureLifeLock : MainPage
  • _mediaControlPropChangedEventToken : sealed
  • _mediaElementFailedEventRegistrationToken : sealed
  • _mediaFrameReference : sealed
  • _mediaSink : sealed
  • _mediaSinkIncomingConnectionEventRegistrationToken : sealed
  • _messageCount : SimpleLogger
  • _messageLock : SimpleLogger
  • _messageText : SimpleLogger
  • _minHeight : ControlSizeTrigger
  • _minWidth : ControlSizeTrigger
  • _mirroringPreview : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _moreButton : sealed
  • _mutex : sealed
  • _myOven : sealed , OvenClient , sealed , OvenClient
  • _name : Scenario , ScenarioGroup
  • _navigationDisabled : sealed
  • _networkSender : CMediaSink , CMediaSource , CStreamSink
  • _nextId : sealed
  • _nOffset : CMediaBufferWrapper
  • _nonDPProperty : MyUserControl1
  • _OffboardCalled : sealed
  • _offset : BufferHelper
  • _offsetBias : sealed , VisualProperties
  • _omnidirectionalSound : sealed
  • _onChannelLoggingEnabledToken : sealed
  • _onLogFileGeneratedToken : sealed
  • _openedEvent : CMediaSource
  • _optionalRefPhotoCapturedEventToken : sealed
  • _opType : CSourceOperation
  • _orientationChangedEventToken : sealed
  • _orientationSensor : sealed , MainPage , sealed , CameraRotationHelper , sealed , MainPage , sealed
  • _OutputFile : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • _OutputFileExtension : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • _OutputFileName : sealed , Scenario2_Custom , Scenario3_Trim , Scenario1_Default
  • _outputPropertiesBackup : sealed , MainPage
  • _outputRenderer : Scenario1_ExampleOperations
  • _OutputType : Scenario2_Custom , Scenario1_Default , sealed , Scenario3_Trim
  • _outsideName : sealed
  • _pageIsLoading : Scenario1_NavToUrl
  • _pageKey : NavigationHelper
  • _parent : YangContainer , sealed
  • _pastePosition : sealed
  • _pBuffer : CMediaBufferWrapper
  • _pendingConnections : Scenario1_Advertiser
  • _percentComplete : DownloadOperationItem
  • _periodicTimer : SampleBackgroundTask , BackgroundActivity
  • _persistedItemContainerHeight : Scenario5_RestoreScrollPosition
  • _persistedItemKey : Scenario5_RestoreScrollPosition
  • _persistedPosition : Scenario5_RestoreScrollPosition
  • _pin : sealed
  • _pitch : sealed
  • _placeholder : MainPage
  • _pointerId : sealed
  • _posesCount : sealed
  • _poseSetId : sealed
  • _pParent : CStreamSink
  • _prevErasingPoint : sealed
  • _previewControl : MediaCapturePreviewer
  • _previewer : Scenario2_PhotoSettings , Scenario3_AspectRatio , Scenario1_PreviewSettings
  • _previewProperties : sealed , MainPage
  • _previewRenderer : Scenario1_ExampleOperations
  • _previousState : sealed
  • _Profile : Scenario2_Custom , Scenario1_Default , sealed , Scenario3_Trim
  • _progress : BackgroundActivity , SampleBackgroundTask
  • _properties : StreamResolution
  • _propertyName : IsApiPropertyPresentTrigger
  • _provisioningInfo : sealed
  • _ptCurrent : SceneComposer
  • _ptInitial : SceneComposer
  • _publisher : Scenario1_Advertiser , Scenario2_Connector , sealed
  • _queriedDeviceFamily : DeviceFamilyTrigger
  • _queryResult : FileDataSource2 , FileDataSource
  • _radius : sealed
  • _random : MainPage , VisualProperties
  • _ranges : ItemIndexRangeList
  • _rawCngPublicKeyBlob : SubjectPublicKeyInfo
  • _reader : Scenario2_AamvaCards
  • _Reader : ReadStreamTask::ReadStreamTaskImpl
  • _reader : Scenario1_BankCards , sealed , Scenario1_ExampleOperations , sealed , Scenario2_FindAvailableSourceGroups
  • _readingToken : sealed
  • _recordingStarted : sealed
  • _recordLimitationExceededEventToken : sealed
  • _refCount : SceneComposer
  • _reference : sealed , Scenario1_ListView
  • _refreshTimer : Scenario1_DeviceUse , sealed
  • _registeredFrames : SuspensionManager
  • _registrationToken : sealed
  • _releaseDeviceRequestedToken : sealed
  • _remotePortAddedToken : sealed
  • _remoteUrl : CMediaSink , sealed
  • _reports : Manager
  • _reportsDictionary : Manager
  • _requestList : sealed
  • _rnd : sealed , Scenario3_StartDragAsync
  • _role : sealed
  • _roll : sealed
  • _root : sealed , VisualProperties
  • _rootPage : Scenario2_GetPosition , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , sealed , Scenario4_ForegroundGeofence , Scenario6_GetLastVisit , Scenario8_VisitsBackgroundTask , sealed , SdkSample , sealed , SocketReaderWriter , Scenario1_TrackPosition , Scenario7_ForegroundVisits
  • _rootVisual : Scenario2_Conditional
  • _rotationHelper : MainPage , sealed
  • _sampleCount : sealed
  • _SampleQueue : CStreamSink
  • _samples : CMediaStream
  • _savedProfileName : sealed
  • _scenario : FileLoggingSessionScenario::BusySetter , LoggingSessionScenario::BusySetter
  • _scenario1 : sealed
  • _scenario2 : sealed
  • _scenario3 : sealed
  • _scenario4 : sealed
  • _scenario5 : sealed
  • _sceneAnalysisEffect : MainPage , sealed
  • _sceneAnalyzedEventToken : sealed
  • _sceneComposer : sealed
  • _sceneObjects : SceneComposer
  • _sdkSample : sealed
  • _selectedSession : sealed
  • _selection : CustomEditControl , Scenario1_ListView , sealed
  • _selectionBrush : SceneComposer
  • _selectionPoints : sealed
  • _selectionRect : InkRenderer
  • _sensor : Scenario2_Polling , Scenario1_DataEvents , Scenario2_Polling
  • _serverAddress : CMediaSource
  • _serverPort : CMediaSource
  • _service : sealed
  • _session : sealed
  • _sessionClosedEvent : sealed
  • _sessionDeferredToken : sealed
  • _SessionLost : sealed
  • _sessionMutex : sealed
  • _sessionRequestedToken : sealed
  • _sessionState : SuspensionManager
  • _sessionStatusChangedToken : sealed
  • _SetIsUpperCaseEnabledRequested : sealed
  • _settingUpUi : MainPage
  • _setupTask : sealed , MainPage
  • _shakeCount : Scenario2_ShakeEvents
  • _shape : SceneComposer::ShapeObject
  • _shapeDistributionX : ShapeRenderer
  • _shapeDistributionY : ShapeRenderer
  • _shapeRenderer : SceneComposer
  • _singleControlMode : MainPage
  • _size : BufferHelper
  • _socket : CNetworkChannel
  • _socketList : sealed
  • _socketReader : sealed
  • _socketWriter : sealed
  • _source : Scenario2_FindAvailableSourceGroups
  • _sourceCollection : SourceGroupCollection
  • _sourceReaders : Scenario1_DisplayDepthColorIR
  • _sourceType : OmnidirectionalSound
  • _sourceVoice : OmnidirectionalSound , CustomDecaySound , CardioidSound
  • _sp2DBuffer : CMediaBufferWrapper
  • _spAttributes : CBaseAttributes< TBase >
  • _spBufferMarshal : CMediaBufferWrapper
  • _spByteStream : CStreamSink
  • _spClock : CMediaSink
  • _spCurrentReceiveBuffer : CMediaSource
  • _spCurrentReceivePacket : CMediaSource
  • _spCurrentType : CStreamSink
  • _spEventQueue : CMediaSource , CMediaStream , CStreamSink
  • _spFirstVideoSample : CStreamSink
  • _spFTM : CStreamSink
  • _spInkD2DRenderer : InkRenderer
  • _spMediaBuffer : CMediaBufferWrapper
  • _spMediaSink : sealed
  • _spParent : CBufferEnumerator
  • _spPD : CStartOperation
  • _spPresentationDescriptor : CMediaSource
  • _spReceiveBuffer : CMediaSink
  • _spSink : CStreamSink , sealed
  • _spSource : CMediaStream::CSourceLock , CMediaStream
  • _spStreamDescriptor : CMediaStream
  • _start : sealed
  • _Start : Scenario3_Trim
  • _StartTime : CStreamSink
  • _state : sealed , CStreamSink
  • _stateText : DownloadOperationItem
  • _status : sealed
  • _statusChanged : FileLoggingSessionScenario , LoggingSessionScenario
  • _statusChangedToken : sealed , Scenario3 , Scenario2
  • _step : ScenarioElement
  • _stokeContinuedToken : sealed
  • _stop : sealed
  • _Stop : Scenario3_Trim
  • _Stopped : sealed
  • _storage : IncrementalLoadingBase
  • _StreamData : ReadStreamTask::ReadStreamTaskImpl
  • _streamFilteringCriteria : sealed
  • _streaming : Scenario2_FindAvailableSourceGroups
  • _streams : CMediaSource , CMediaSink
  • _streamSocket : sealed , SocketReaderWriter , sealed
  • _streamSocketListener : sealed
  • _streamSocketListeners : sealed
  • _StringPropertyDPProperty : DataModel
  • _StringPropWithINPC : DataModel
  • _stroke : SceneComposer::InkObject
  • _strokeCanceledToken : sealed
  • _strokeContainer : InkRenderer
  • _StrokeContainerForTemp : InkRenderer
  • _strokeEndedToken : sealed
  • _strokesCollectedToken : sealed
  • _strokeStartedToken : sealed
  • _strokeStyle : InkRenderer , SceneComposer
  • _supportedConfigMethods : ConnectionSettingsPanel
  • _symbol : sealed , Scenario3_StartDragAsync
  • _symbols : Scenario3_StartDragAsync , sealed
  • _systemMediaControls : sealed , MainPage , sealed , MainPage , sealed , MainPage , sealed , MainPage
  • _systemNavigationManager : MainPage
  • _targetElement : ControlSizeTrigger , InputTypeTrigger
  • _taskCompletionToken : sealed
  • _taskInstance : BackgroundActivity , SampleBackgroundTask
  • _temperature : Oven , WrlFinal , sealed
  • _text : CustomEditControl
  • _textBlock : SimpleLogger
  • _TextSentReceived : sealed
  • _tileId : ScenarioElement
  • _timer : Scenario3_StartDragAsync , sealed
  • _timerEventToken : sealed
  • _timerStep3 : ScenarioElement
  • _tokens : CMediaStream
  • _Transcoder : Scenario2_Custom , Scenario3_Trim , Scenario1_Default , sealed
  • _triggerPointerType : InputTypeTrigger
  • _type : LoggingScenarioEventArgs , sealed
  • _typeName : IsApiPropertyPresentTrigger
  • _uiSettings : ArticlePage , SectionView
  • _uniqueInternalId : sealed
  • _unprocessedInputEnteredToken : sealed
  • _unprocessedInputExitedToken : sealed
  • _unprocessedInputHoveredToken : sealed
  • _unprocessedInputLostToken : sealed
  • _unprocessedInputMovedToken : sealed
  • _unprocessedInputPressedToken : sealed
  • _unprocessedInputReleasedToken : sealed
  • _updateTimer : MainPage
  • _UseMp4 : sealed , Scenario2_Custom
  • _value : YangContainer
  • _values : GeofenceBackgroundTask , VisitBackgroundTask , LocationBackgroundTask
  • _varContextValue : CMarker
  • _varMarkerValue : CMarker
  • _videoSettingsFilter : sealed
  • _videoStabilizationEffect : sealed , MainPage
  • _videoStabilizationEnabledToken : sealed
  • _view : sealed , VisualProperties
  • _viewModel : MainPage
  • _viewSize : DeviceResources
  • _visibilityToken : sealed
  • _visitMonitor : Scenario7_ForegroundVisits
  • _visitTask : Scenario8_VisitsBackgroundTask
  • _vsis : DeviceResources
  • _vsisNative : DeviceResources
  • _waitingConnectionId : CMediaSink
  • _watcher : SourceGroupCollection
  • _wiFiAdapters : sealed
  • _window : VisualProperties , sealed
  • _windowSizeEventToken : sealed
  • _windowVisibilityChangedEventToken : sealed
  • _WorkQueueCB : CStreamSink
  • _WorkQueueId : CStreamSink
  • _writer : sealed
  • _x : sealed
  • _xaudio2 : OmnidirectionalSound , CustomDecaySound , CardioidSound , OmnidirectionalSound
  • _y : sealed
  • _yaw : sealed
  • _YinPropertyDPProperty : DOModel
  • _z : sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- j -

  • jsonValue : HttpJsonContent
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- k -

  • key : PersistentState , GroupInfoList
  • keyDownToken : Scenario1_Basic , sealed
  • keyId : ProactiveViewModel
  • Kind : DeviceInformationDisplay
  • kind : DeviceSelectorInfo
  • kinds : DeviceInformationKindChoice
  • knownAzureMediaServiceModels : AdaptiveContentModel
  • KnownDevices : Scenario1_Discovery
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- l -

  • LabelProperty : TabHeader
  • labelText : Print3D
  • lamp : Scenario3_AvailabilityChanged
  • lampArray : LampArrayInfo , CustomEffectState
  • lampColors : CustomEffectState
  • lampNormalizedX : CustomEffectState
  • language : MediaStream
  • languageMap : sealed
  • lasso : sealed , Scenario2
  • LassoSelect : Scenario2
  • Last : RecognizedTextRun
  • lastErrorMessage : CommonLicenseRequest
  • lastFadeOutTime : Scenario3
  • lastFileName : Scenario1_CreateTile
  • lastFileUri : Scenario1_CreateTile
  • lastName : Contact
  • lastPeriodDuration : Manifest
  • LastPositionUpdate : Scenario3_AdaptiveSync
  • lastProcessedAdId : Scenario5_Metadata
  • lastSelectedIndex : sealed , Scenario8
  • lastUpdateTime : sealed , ServiceViewModel
  • LastValueTime : SourceHandler::PositionInformation
  • latestFrame : FrameSourceState
  • LaunchArgs : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage , App
  • LaunchedEventArgs : App
  • launchParam : MainPage
  • LAYOUT_WIDTH_768 : CalibrationBar
  • layoutMetricsChangedToken : CustomTitleBar
  • leading : NfcProvHeader
  • LED_PIN : sealed , Scenario1_GetAndSetPin
  • left : ElementMargin
  • leftOverTicks : StepTimer
  • length : SlowInputStream , LineSegment
  • Length : RawSMBIOSData , RawSMBIOSTable , ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • levelCompleted : HighScoreEntry
  • license : sealed
  • licenseUrl : HardwareDRMViewModel , ProactiveViewModel , SecureStopViewModel
  • licenseURL : ReactiveViewModel
  • lightColor : ConstantBufferNeverChanges
  • lightContact : AppContactPanel
  • lightPosition : ViewProjectionConstantBuffer , ConstantBufferNeverChanges
  • likes : MainPage
  • limiterEffectDefinition : Scenario5_InboxEffects
  • lineBrush : Scenario1_DetectInPhoto
  • lineDisplay : sealed , Scenario2_DisplayText , Scenario3_UsingWindows , Scenario4_UpdatingLineDisplayAttributes , Scenario5_DefiningCustomGlyphs , Scenario6_ManipulatingCursorAttributes , Scenario7_ScrollingContentUsingMarquee
  • LineDisplayId : MainPage
  • lineThickness : Scenario1_DetectInPhoto
  • LISTEN_PIN : sealed , Scenario2_Listen
  • listener : sealed
  • listenerSocket : sealed , Scenario5
  • listenPin : sealed , Scenario2_Listen
  • listOfDescriptorTypes : Scenario5_UsbDescriptors
  • listOfDevices : sealed , Scenario1_ConnectDisconnect , DeviceConnect
  • listOfSymbologies : Scenario4_SymbologyAttributes , Scenario3_ActiveSymbologies
  • listViewItem : ListViewEdgeTappedEventArgs
  • listViewItemHighlighted : EdgeTappedListView
  • listViewModel : MediaItemViewModel
  • Live : AdaptiveContentModel
  • liveOffset : LiveDashPlayer , Player
  • LiveProfile : DashManifestParser
  • LiveSegmentCount : DashManifestParser
  • llTimestamp : MFSampleGenerator
  • lnames : DataModel
  • loaded : TripStore , sealed
  • loadingComplete : VideoRenderer , SpinningCubeRenderer
  • localCacheCounter : Scenario1_Files
  • localCacheFolder : Scenario1_Files
  • localCounter : Scenario1_Files
  • localFolder : Scenario1_Files
  • localHostItems : Scenario1 , sealed , Scenario1 , sealed
  • localSettings : DecodeEngine , Scenario2_Settings , Scenario1_Configuration , Scenario4_CompositeSettings , Scenario3_SettingContainer , Scenario2_Settings , AppData , Scenario3_SettingContainer
  • Location : PlaceInfo , Cluster
  • locationCapability : Scenario1_Check
  • locator : _360VideoPlaybackMain , HolographicApp1Main
  • lock : sealed
  • LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME : FileLoggingSessionScenario
  • logger : PlayReadyHelper
  • loggerControl : ContentSelector
  • LOGGING_ENABLED_SETTING_KEY_NAME : FileLoggingSessionScenario
  • LoggingEnabledKey : LoggingSessionScenario
  • loggingScenario : FileLoggingSessionScenario
  • loggingSessionScenario : LoggingSessionScenario
  • logoSecondaryTileId : MainPage
  • LogoSecondaryTileId : SampleHelpers
  • LowPart : LARGE_INTEGER
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- m -

  • m_account : sealed , SignIn , sealed
  • m_accountCommandsRequestedRegistrationToken : sealed
  • m_accounts : sealed
  • m_actionBrush : GameInfoOverlay
  • m_actionRectangle : GameInfoOverlay
  • m_actionString : GameInfoOverlay
  • m_activatableClassId : sealed
  • m_active : GameObject , GameTimer
  • m_activeAccount : sealed
  • m_activeBackground : Simple3DGame
  • m_activeGamePad : sealed
  • m_activeSymbologies : DecodeEngine
  • m_activitySensor : sealed
  • m_addingAccount : sealed , SignIn
  • m_afterWriteFile : sealed , Scenario5_TriggerCFU
  • m_ammo : Simple3DGame
  • m_ammoCount : Simple3DGame
  • m_ammoNext : Simple3DGame
  • m_anchor : List< T >
  • m_animatePosition : GameObject
  • m_applicationContentMarginLeft : PrintHelper
  • m_applicationContentMarginTop : PrintHelper
  • m_applying : Scenario1_ConfigureMobileHotspot
  • m_appViewConsolidated : sealed
  • m_areKeysDropped : EdpBackgroundTask
  • m_aspectRatio : Camera
  • m_attachedLampArrays : Scenario1_Basics , Scenario2_Effects , Scenario1_Basics , Scenario2_Effects
  • m_attachedReferenceFrame : HolographicTagAlongSampleMain
  • m_audioAvailable : Audio , SoundEffect
  • m_audioCaptureClient : WASAPICapture
  • m_AudioCaptureClient : WASAPICapture
  • m_AudioClient : WASAPICapture , WASAPIRenderer
  • m_audioClient : WASAPICapture
  • m_audioController : Simple3DGame
  • m_audioEffectAdded : MediaCaptureManager
  • m_audioMediaType : MFSampleGenerator
  • m_AudioMT : MFSampleGenerator
  • m_AudioRenderClient : WASAPIRenderer
  • m_authenticateClicked : Scenario1ViewModel , Scenario2ViewModel
  • m_authenticationVisibility : Scenario2ViewModel
  • m_authVisibility : Scenario1ViewModel
  • m_autoFire : MoveLookController
  • m_axis : Cylinder
  • m_back : MoveLookController
  • m_backBuffer : FrameRenderer , sealed
  • m_backgroundBrush : GameInfoOverlay
  • m_backgroundColor : sealed
  • m_backgroundTask : sealed
  • m_baseControls : MediaTransportControls
  • m_baseTime : GameTimer
  • m_basicReaderWriter : BasicLoader
  • m_beforeReadFile : sealed , Scenario5_TriggerCFU
  • m_blackBrush : TargetTexture
  • m_blendState : CameraResources
  • m_blueBrush : TargetTexture
  • m_bodyRectangle : GameInfoOverlay
  • m_bodyString : GameInfoOverlay
  • m_boundingBox : ControlBase , sealed
  • m_boundsBrush : sealed
  • m_boundsStrokeStyle : sealed
  • m_bread : WrlFinal
  • m_brightnessAdjust : D2DAdvancedColorImagesRenderer
  • m_brush : Button , SeekBarElement
  • m_brushColor : Ellipse , FilledEllipse , Rectangle , FilledRectangle
  • m_brushes : sealed
  • m_buffer : PlotDataReadyEventArgs
  • m_bufferFrames : WASAPICapture
  • m_BufferFrames : WASAPICapture , WASAPIRenderer
  • m_busAttachment : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • m_busAttachmentStateChangedToken : sealed
  • m_busObject : sealed
  • m_buttonInUse : MoveLookController
  • m_buttonLowerRight : MoveLookController
  • m_buttonPointerID : MoveLookController
  • m_buttonPressed : MoveLookController
  • m_buttonState : Button
  • m_buttonUpperLeft : MoveLookController
  • m_BytesPerPeriod : MFSampleGenerator
  • m_bytesPerPeriod : MFSampleGenerator
  • m_bytesPerSecond : MFSampleGenerator
  • m_bytesSinceLastFlush : WASAPICapture
  • m_calculateTextureDimensionsFromScale : BaseControl
  • m_callSetProperty : Scenario1ViewModel
  • m_camera : CameraStreamCoordinateMapperMain , Simple3DGame
  • m_cameraAddedToken : HolographicVoiceInputMain , HolographicPaintMain , _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain
  • m_cameraCoordinateMapper : CameraStreamCoordinateMapperMain
  • m_cameraPitchAngle : Camera
  • m_cameraRemovedToken : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_cameraResources : DeviceResources
  • m_cameraResourcesLock : DeviceResources
  • m_cameraYawAngle : Camera
  • m_cancelRequested : EdpBackgroundTask
  • m_canCommitDirect3D11DepthBuffer : BasicHologramMain
  • m_canGenerateSegmentsDynamically : MediaStream
  • m_canGetDefaultHolographicDisplay : BasicHologramMain
  • m_canGetHolographicDisplayForCamera : BasicHologramMain
  • m_canRenderThisFrame : SceneObject
  • m_caption : SampleOverlay
  • m_capture : Scenario4
  • m_cardAddedToken : Scenario1_ProvisionTPM
  • m_cardName : SmartCardListItem
  • m_cardReader : CardReader
  • m_cardRemovedToken : Scenario6_DeleteTPM
  • m_cbDataSize : WASAPICapture
  • m_cbFlushCounter : WASAPICapture
  • m_cbHeaderSize : WASAPICapture
  • m_ceilingTexture : GameRenderer
  • m_center : AnimateCirclePosition , ToolCarousel
  • m_centerX : sealed
  • m_centerY : sealed
  • m_ChannelVolume : WASAPIRenderer
  • m_channelVolume : WASAPIRenderer
  • m_children : ControlBase
  • m_chrominanceView : NV12VideoTexture
  • m_circleGeometry1 : TargetTexture
  • m_circleGeometry2 : TargetTexture
  • m_circleGeometry3 : TargetTexture
  • m_circleGeometry4 : TargetTexture
  • m_circleGeometry5 : TargetTexture
  • m_claimedScannerDataReceivedToken : Scenario1_BasicFunctionality
  • m_claimedScannerReleaseDeviceRequestedToken : Scenario1_BasicFunctionality
  • m_clearBrush : TargetTexture
  • m_clearPolicyText : Scenario3
  • m_clearToolIndex : HolographicPaintMain
  • m_clockwise : AnimateCirclePosition
  • m_closable : ensure_close
  • m_color : Button , Panel , Tool
  • m_colorCameraStreamProcessor : CameraCoordinateMapper
  • m_colorDistortionMapTexture : CameraCoordinateMapper
  • m_colorDistortionMapTextureSRV : CameraCoordinateMapper
  • m_colorFadeTimeout : final
  • m_colorFadeTimer : final
  • m_colorFocus : Button
  • m_colorFrameIndex : CameraCoordinateMapper
  • m_colorIntrinsics : CameraCoordinateMapper
  • m_colorManagement : PhotoAdjustmentRenderer
  • m_colorManagementEffect : D2DAdvancedColorImagesRenderer
  • m_colorOn : Button
  • m_colorPixelShader : RealtimeSurfaceMeshRenderer
  • m_colorSpacePoints : FrameRenderer
  • m_colorTexture : CameraCoordinateMapper
  • m_colorTextureSRV : CameraCoordinateMapper
  • m_completionsRequired : sealed
  • m_compositionScaleX : DeviceResources
  • m_compositionScaleY : DeviceResources
  • m_connection : sealed
  • m_connectPanelVisibility : Scenario2ViewModel
  • m_consolidatedToken : ViewLifetimeControl
  • m_constantBuffer : QuadRenderer , DftTransform
  • m_constantBufferChangeOnResize : GameRenderer
  • m_constantBufferChangesEveryFrame : GameRenderer
  • m_constantBufferChangesEveryPrim : GameRenderer
  • m_constantBufferCreated : final
  • m_constantBufferData : QuadRenderer , final
  • m_constantBufferNeverChanges : GameRenderer
  • m_constants : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • m_consumer : sealed , Scenario1ViewModel , Scenario2ViewModel
  • m_consumerOptionsVisibility : Scenario1ViewModel
  • m_ContentStream : MFSampleGenerator , sealed , WASAPICapture , WASAPIRenderer
  • m_contentStream : WASAPICapture
  • m_ContentType : sealed
  • m_contentType : Scenario2 , Scenario3 , WASAPIRenderer
  • m_continuous : Animate
  • m_contrast : PhotoAdjustmentRenderer
  • m_controller : GameMain , Simple3DGame , GameMain , Simple3DGame
  • m_coordinateSystem : SceneObject , HandHandler
  • m_copyPasteScenarioText : Scenario3
  • m_copyProtectionScenarioDesc : Scenario4
  • m_CoreDispatcher : sealed
  • m_correlatedFrameRenderer : sealed
  • m_count : AnimateLineListPosition , List< T >
  • m_cPlotDataFilled : WASAPICapture
  • m_cPlotDataMax : WASAPICapture
  • m_cRef : DftEffect , DftTransform
  • m_critical : VideoRenderer
  • m_criticalSection : GameMain , CritSec
  • m_CritSec : WASAPICapture , WASAPIRenderer
  • m_critsec : OpQueue< T, TOperation >
  • m_CritsecCustomSensor : sealed
  • m_csDebugLog : sealed
  • m_csLock : sealed
  • m_csPrintSync : sealed
  • m_currentConnectionId : sealed
  • m_currentCoordinateSystem : SpatialStageManager
  • m_currentFrameIndex : GpuPerformanceTimer
  • m_currentLevel : Simple3DGame
  • m_currentMode : HolographicPaintMain , SourceHandler
  • m_currentOrientation : DeviceResources
  • m_currentPageDescription : sealed
  • m_currentPlayPosition : SeekBarElement
  • m_currentQuery : GpuPerformanceTimer
  • m_currentSourceId : HolographicPaintMain
  • m_currentStage : SpatialStageManager
  • m_currentState : MediaCaptureManager
  • m_currentStroke : SourceHandler
  • m_currentTask : sealed
  • m_currentTime : BasicTimer , GameTimer
  • m_currentTool : SourceHandler
  • m_currentToolIndex : HolographicPaintMain
  • m_currentVideoDuration : SeekBarElement
  • m_cursorTextureView : Cursor
  • m_CustomSensor : sealed
  • m_cylinderTexture : GameRenderer
  • m_d2dContext : DeviceResources , sealed , DeviceResources , TargetTexture
  • m_d2dContextTargetToRestore : BaseControl
  • m_d2dDevice : DeviceResources , sealed , DeviceResources
  • m_d2dDeviceContext : CustomTextRenderer
  • m_d2dFactory : DeviceResources , CustomTextRenderer , DeviceResources , TargetTexture
  • m_d2dRenderTarget : TextRenderer
  • m_d2dTargetBitmap : DeviceResources
  • m_d2dTargetBitmapRight : DeviceResources
  • m_d3dBackBuffer : CameraResources
  • m_d3dContext : DeviceResources
  • m_d3dDepthBuffer : CameraResources
  • m_d3dDepthStencil : CameraResources
  • m_d3dDepthStencilView : CameraResources , DeviceResources , DistanceFieldRenderer , DeviceResources
  • m_d3dDevice : DeviceResources , sealed , BasicLoader , BasicShapes , BasicLoader , BasicShapes , DeviceResources , TargetTexture
  • m_d3dFeatureLevel : DeviceResources
  • m_d3dInteropDevice : DeviceResources
  • m_d3dRenderTargetSize : CameraResources , DeviceResources
  • m_d3dRenderTargetView : CameraResources , DeviceResources
  • m_d3dRenderTargetViewRight : DeviceResources
  • m_d3dViewport : CameraResources
  • m_Data : CAsyncState
  • m_dataSize : WASAPICapture
  • m_dateCreated : Item , ItemViewModel
  • m_decodeEngine : sealed
  • m_defaultPeriodInFrames : WASAPICapture
  • m_DefaultPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_defaultRasterizerState : RealtimeSurfaceMeshRenderer , SceneObject
  • m_defaultXAxis : GameObject
  • m_defaultYAxis : GameObject
  • m_defaultZAxis : GameObject
  • m_deferral : sealed
  • m_degreesPerSecond : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer
  • m_delta : BasicTimer
  • m_deltaTime : GameTimer
  • m_depthCameraStreamProcessor : CameraCoordinateMapper
  • m_depthFrameIndex : CameraCoordinateMapper
  • m_depthIntrinsics : CameraCoordinateMapper
  • m_depthSpacePoints : FrameRenderer
  • m_depthTexture : CameraCoordinateMapper
  • m_depthTextureSRV : CameraCoordinateMapper
  • m_depthUnprojectionMapTexture : CameraCoordinateMapper
  • m_depthUnprojectionMapTextureSRV : CameraCoordinateMapper
  • m_DesiredReportInterval : sealed
  • m_dev1DataReceivedToken : Scenario2_MultipleScanners
  • m_dev1ReleaseRequestedToken : Scenario2_MultipleScanners
  • m_dev2DataReceivedToken : Scenario2_MultipleScanners
  • m_dev2ReleaseRequestedToken : Scenario2_MultipleScanners
  • m_Device : sealed
  • m_deviceAccessInfo : sealed
  • m_DeviceAccessInfo : sealed
  • m_deviceAddedRevoker : Scenario1_Basics
  • m_deviceClassSelector : DeviceSelectorInfo
  • m_deviceId : BarcodeScannerInfo
  • m_DeviceIdString : WASAPICapture , WASAPIRenderer
  • m_deviceName : BarcodeScannerInfo
  • m_deviceNotify : DeviceResources
  • m_DeviceProps : WASAPICapture , WASAPIRenderer
  • m_deviceRemovedRevoker : Scenario1_Basics
  • m_deviceResources : _360VideoPlaybackMain , sealed , BaseControl , BaseElement , VideoRenderer , sealed , BasicHologramMain , SpinningCubeRenderer , sealed , CameraStreamCoordinateMapperMain , GpuPerformanceTimer , CameraCoordinateMapper , GpuCoordinateMapper , QuadRenderer , TextRenderer , D2DAdvancedColorImagesRenderer , sealed , CustomComputeShaderMain , CustomComputeShaderRenderer , SampleOverlay , sealed , CustomPixelShaderMain , CustomPixelShaderRenderer , SampleOverlay , sealed , CustomVertexShaderMain , CustomVertexShaderRenderer , SampleOverlay , sealed , D2DGradientMeshMain , D2DGradientMeshRenderer , SampleOverlay , PhotoAdjustmentRenderer , D2DSvgImageRenderer , sealed , DWriteColorTextRendererMain , DWriteColorTextRendererRenderer , SampleOverlay , sealed , Resource , HolographicFaceTrackerMain , sealed , ControlBase , Cursor , SpinningCubeRenderer , HolographicMRCSampleMain , sealed , RealtimeSurfaceMeshRenderer , HolographicSpatialMappingMain , sealed , SceneController , SceneObject , HolographicSpatialStageMain , SpatialStageManager , sealed , DistanceFieldRenderer , QuadRenderer , TextRenderer , HolographicTagAlongSampleMain , sealed , SpinningCubeRenderer , HolographicVoiceInputMain , sealed , GameHud , GameInfoOverlay , GameMain , GameRenderer , App , sealed , RenderingHelper , HolographicPaintMain
  • m_DevicesList : sealed
  • m_DeviceState : sealed
  • m_deviceState : DeviceStateChangedEventArgs , DeviceStateSourceT< D >
  • m_DeviceStateChanged : WASAPICapture , WASAPIRenderer
  • m_deviceStateChanged : DeviceStateSourceT< D >
  • m_deviceStateChangeToken : sealed , Scenario2 , Scenario3 , Scenario4
  • m_deviceSupportsRawMode : sealed , Scenario2 , Scenario3
  • m_deviceWatcher : Scenario1_Basics , Scenario2_Effects
  • m_dftEffect : CustomComputeShaderRenderer
  • m_dftType : DftTransform
  • m_diameter : Tool
  • m_diffuseColor : Material
  • m_directXPage : sealed
  • m_disableExifOrientation : Scenario2
  • m_disableScannerRequestedToken : sealed
  • m_DiscontinuityCount : sealed
  • m_discontinuityCount : Scenario4
  • m_disjointQuery : GpuPerformanceTimer
  • m_dispatcher : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel , sealed
  • m_Dispatcher : sealed
  • m_dispInfo : D2DAdvancedColorImagesRenderer
  • m_displayHeightNonScaled : Scenario2
  • m_displayInformation : sealed
  • m_displayMessage : InvalidPageException
  • m_displayName : UserViewModel
  • m_displayRequest : Scenario5_DisplayingBarcodePreview
  • m_displayWidthNonScaled : Scenario2
  • m_distance : Cursor
  • m_documentPresenter : sealed
  • m_down : MoveLookController
  • m_downloadableFontName : sealed
  • m_downloadCompletedEventToken : sealed
  • m_downloadQueue : sealed
  • m_dpi : DeviceResources , FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , sealed
  • m_dpiChangedEventToken : sealed
  • m_drawInfo : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , WaveEffect
  • m_drawOverlay : SampleOverlay
  • m_drawWireframe : HolographicSpatialMappingMain
  • m_dropHologram : HolographicTagAlongSampleMain
  • m_dTransferMgr : Scenario12_ShareData
  • m_duration : Animate
  • m_dwQueueID : WASAPICapture
  • m_dwriteFactory : DeviceResources , CustomTextRenderer , DeviceResources , sealed , DeviceResources , TargetTexture
  • m_dwriteTextFormat : DWriteColorTextRendererRenderer
  • m_dwriteTextLayout : DWriteColorTextRendererRenderer
  • m_dxgiAdapter : DeviceResources
  • m_dxgiFactory : DeviceResources
  • m_dxgiFormat : CameraResources
  • m_education : User
  • m_effectContext : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect
  • m_effectiveDpi : DeviceResources
  • m_elapsedTicks : StepTimer
  • m_elapsedTimeString : SeekBarElement
  • m_elapsedTimeText : SeekBarElement
  • m_elementCoordIntersectionPoint : FocusableElement
  • m_elementMargin : BaseElement
  • m_elementSize : BaseElement
  • m_ElliFocusOutline : Button
  • m_ElliPressedBackgroundFill : Button
  • m_ellipse : Ellipse , FilledEllipse
  • m_emitter : sealed
  • m_emptyList : Scenario2_Effects
  • m_emulator : sealed
  • m_enabled : SymbologyListEntry , ControlBase
  • m_enableScannerRequestedToken : sealed
  • m_endPosition : AnimateLinePosition
  • m_endSegmentBrush : SeekBarElement
  • m_endTimestampQuery : GpuPerformanceTimer
  • m_EnterpriseId : Scenario1
  • m_EnterpriseID : EdpBackgroundTask
  • m_error : DeviceStateChangedEventArgs
  • m_etwRegHandle : CServiceBase
  • m_event : PropertyGetContext< T > , PropertySetContext
  • m_eventsHandler : SourceHandler
  • m_exifOrientation : Scenario2
  • m_exitButtonControl : MediaTransportControls
  • m_exitText : ExitButton
  • m_eye : Camera
  • m_faceTracker : FaceTrackerProcessor
  • m_faceTrackerProcessor : HolographicFaceTrackerMain
  • m_fadeTime : QuadRenderer
  • m_fadingIn : QuadRenderer
  • m_farPlane : Camera
  • m_faToken : sealed , Scenario5_TriggerCFU
  • m_fDenyTransactions : sealed
  • m_fieldOfView : Camera
  • m_file : Scenario4
  • m_FileCopyName : Scenario4
  • m_fileProtStatus : EdpBackgroundTask
  • m_fileToken : Scenario1 , Scenario2
  • m_filmicEffect : D2DAdvancedColorImagesRenderer
  • m_finalOutput : D2DAdvancedColorImagesRenderer
  • m_fireInUse : MoveLookController
  • m_fireLastPoint : MoveLookController
  • m_fireLowerRight : MoveLookController
  • m_firePointerID : MoveLookController
  • m_firePressed : MoveLookController
  • m_fireUpperLeft : MoveLookController
  • m_flavor : WrlFinal
  • m_floorTexture : GameRenderer
  • m_focused : ControlBase
  • m_focusPoint : HolographicPaintMain
  • m_focusPointConstantBuffer : BaseControl
  • m_focusPointConstantBufferData : BaseControl
  • m_fontDownloadListener : sealed
  • m_fontFamily : sealed
  • m_fontSize : sealed
  • m_fontWeight : Text
  • m_forceIconCentered : Button
  • m_forceWarpDevice : DeviceResources
  • m_foreground : sealed
  • m_formatConvert : D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_formattedPrice : sealed
  • m_forward : MoveLookController
  • m_frameArrivedToken : sealed , CameraStreamProcessor
  • m_frameCount : StepTimer , CameraStreamProcessor
  • m_frameLatencyWaitableObject : DeviceResources
  • m_frameLock : sealed
  • m_framePending : CameraResources
  • m_frameReader : sealed
  • m_frameRenderer : sealed
  • m_frameRenderers : sealed
  • m_frameSources : sealed
  • m_framesPerSecond : StepTimer
  • m_framesThisSecond : StepTimer
  • m_freeRoamCameraEnabled : CameraStreamCoordinateMapperMain
  • m_Frequency : WASAPIRenderer
  • m_frequency : BasicTimer
  • m_frontSegmentBrush : SeekBarElement
  • m_fTaskEnded : sealed
  • m_fTransactionCompleted : sealed
  • m_fundamentalPeriodInFrames : WASAPICapture
  • m_FundamentalPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_futureAccess : Scenario1 , Scenario2
  • m_fWriting : WASAPICapture
  • m_Fx2Device : DeviceList
  • m_Fx2DeviceId : DeviceList
  • m_Fx2Devices : DeviceList
  • m_Fx2Watcher : DeviceList
  • m_game : GameMain , GameRenderer , GameMain , GameRenderer
  • m_gameActive : Simple3DGame
  • m_gameConfig : Simple3DGame
  • m_gameHud : GameRenderer
  • m_gameInfoOverlay : GameRenderer
  • m_gameInfoOverlayCommand : GameMain
  • m_gameInfoOverlayRect : GameRenderer
  • m_gameInfoOverlaySize : GameRenderer
  • m_gameInfoOverlayState : GameMain
  • m_gamepadAddedEventToken : BasicHologramMain , HolographicSpatialStageMain
  • m_gamepadRemovedEventToken : BasicHologramMain , HolographicSpatialStageMain
  • m_gamepads : BasicHologramMain
  • m_gamepadsChanged : MoveLookController
  • m_gamepadStartButtonInUse : MoveLookController
  • m_gamepadTriggerInUse : MoveLookController
  • m_gameResourcesLoaded : GameRenderer
  • m_geolocTask : Scenario3_BackgroundTask
  • m_geometry : BaseControl
  • m_geometryShader : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_geometryShaders : DeviceResources
  • m_gestureRecognizer : sealed , CustomVertexShaderRenderer , PhotoAdjustmentRenderer , HandHandler , SpatialControllerHandler
  • m_getActiveSymbologiesRequestedToken : sealed
  • m_getBarcodeSymbologyAttributesRequestedToken : sealed
  • m_getProtectScenarioDesc : Scenario4
  • m_getstreamStreamScenario : Scenario7
  • m_gpuCoordinateMapper : CameraCoordinateMapper
  • m_gpuPerformanceTimer : CameraStreamCoordinateMapperMain
  • m_gradientMesh : D2DGradientMeshRenderer
  • m_greenBrush : TargetTexture
  • m_ground : GameObject
  • m_groupCollection : sealed
  • m_hapticsBuzzFeedback : SpatialControllerHandler
  • m_hapticsController : SpatialControllerHandler
  • m_haveFocus : GameMain
  • m_headers : HttpJsonContent
  • m_headerSize : WASAPICapture
  • m_heading : sealed
  • m_heatmapEffect : D2DAdvancedColorImagesRenderer
  • m_height : NV12VideoTexture , Face , sealed
  • m_heightVector : Face
  • m_helpTextRenderer : CameraStreamCoordinateMapperMain
  • m_hideVideoPreviewRequestedToken : sealed
  • m_highlightsShadows : PhotoAdjustmentRenderer
  • m_histogramEffect : D2DAdvancedColorImagesRenderer
  • m_histogramPrescale : D2DAdvancedColorImagesRenderer
  • m_hit : GameObject
  • m_hitColor : Material
  • m_hitMaterial : GameObject
  • m_hitSound : GameObject
  • m_hitTime : GameObject
  • m_hnsBufferDuration : WASAPIRenderer
  • m_hologramEnabled : MediaCaptureManager
  • m_holographicCamera : CameraResources
  • m_holographicDisplayIsAvailableChangedEventToken : BasicHologramMain
  • m_holographicSpace : _360VideoPlaybackMain , sealed , DeviceResources , sealed , BasicHologramMain , sealed , BasicHologramMain , DeviceResources , sealed , HolographicFaceTrackerMain , sealed , HolographicMRCSampleMain , sealed , HolographicSpatialMappingMain , sealed , HolographicSpatialStageMain , sealed , HolographicTagAlongSampleMain , sealed , HolographicVoiceInputMain , sealed , HolographicPaintMain
  • m_hsMaskRadiusDips : PhotoAdjustmentRenderer
  • m_id : SymbologyListEntry , School , User
  • m_idIncrement : SampleOverlay
  • m_ignoreLayout : BaseElement
  • m_imageElement : sealed , FrameRenderer
  • m_imageInfo : D2DAdvancedColorImagesRenderer
  • m_imageOffset : D2DAdvancedColorImagesRenderer
  • m_imagePath : sealed
  • m_imageProperties : Scenario1
  • m_imageSize : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_imageSource : D2DAdvancedColorImagesRenderer , CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer
  • m_imageTarget : sealed
  • m_imageText : sealed
  • m_inactiveSecondsCounter : MediaTransportControls
  • m_indexBuffer : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , MeshObject , RenderingHelper , Stroke , ClearTool
  • m_indexCount : VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , MeshObject , RenderingHelper , Stroke , ClearTool
  • m_indices : SceneObject
  • m_initialized : GameRenderer
  • m_initialPosition : HandHandler
  • m_initSegmentData : MediaStream
  • m_innerFilter : PlugInFilter , HttpMeteredConnectionFilter , HttpRetryFilter
  • m_inputLayout : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_inputLayouts : DeviceResources
  • m_inputLoopWorker : sealed , PlaybackPage
  • m_inputRect : FilmicEffect , LuminanceHeatmapEffect , ReinhardEffect , SdrOverlayEffect , DftTransform , RippleEffect , WaveEffect
  • m_insideTargetBoard : SpatialControllerHandler
  • m_installedLocationPath : MediaReader
  • m_interactionDetectedToken : HolographicPaintMain
  • m_interactionManager : SpatialInputHandler
  • m_interactionMode : Scenario1_Basic
  • m_interfaceMemberAge : sealed
  • m_interfaceMemberAuthType : sealed
  • m_interfaceMemberInStr1 : sealed
  • m_interfaceMemberInStr2 : sealed
  • m_interfaceMemberOutStr : sealed
  • m_interfaceMemberPassphrase : sealed
  • m_interfaceMemberScanList : sealed
  • m_interfaceMemberSSID : sealed
  • m_interfaceMemberStatus2 : sealed
  • m_internalReleased : ViewLifetimeControl
  • m_inverseView : Camera
  • m_isActive : final
  • m_isApp : sealed
  • m_isAppActive : sealed
  • m_isAppTrial : sealed
  • m_isAuthenticated : Scenario1ViewModel
  • m_isAvailableForPurchase : sealed
  • m_IsBackground : WASAPIRenderer
  • m_isBusAttachmentConnected : Scenario1ViewModel , Scenario2ViewModel
  • m_isComputeSupported : D2DAdvancedColorImagesRenderer
  • m_isCredentialsRequested : Scenario1ViewModel
  • m_isFixedTimeStep : StepTimer
  • m_isFocused : BaseControl , FocusableElement
  • m_isFocusIntersectionCalculated : FocusableElement
  • m_isGamepadPressed : _360VideoPlaybackMain
  • m_IsHWOffload : WASAPIRenderer
  • m_IsInitialized : MFSampleGenerator
  • m_isInitialized : BaseControl , BaseElement , MFSampleGenerator
  • m_isInitSegmentDownloading : MediaStream
  • m_isLayoutHorizontal : BaseElement
  • m_IsLowLatency : sealed , WASAPIRenderer
  • m_isLowLatency : Scenario4 , WASAPICapture
  • m_IsMFLoaded : sealed
  • m_IsMinimumLatency : sealed
  • m_isMinimumLatency : Scenario3
  • m_isMouseLeftKeyPressed : _360VideoPlaybackMain
  • m_isNetworkStatusChangeCallbackRegistered : Scenario3_NetworkConnectivityChanges
  • m_isNetworkStatusUpdatePending : Scenario3_NetworkConnectivityChanges
  • m_isParentFocused : FocusableElement
  • m_isPointerPress : sealed
  • m_isPreviewing : Scenario5_DisplayingBarcodePreview
  • m_isProductActive : sealed
  • m_IsRawAudio : WASAPIRenderer
  • m_isReadyToRender : HolographicFaceTrackerMain
  • m_isRenderPassNeeded : BaseElement
  • m_isRippleAnimating : CustomPixelShaderRenderer
  • m_isRoamableScenarioDesc : Scenario4
  • m_isRotating : ToolCarousel
  • m_isRunning : FaceTrackerProcessor
  • m_isScannerClaimed : Scenario5_DisplayingBarcodePreview
  • m_isSelectionChanging : Scenario5_DisplayingBarcodePreview
  • m_isStereo : CameraResources
  • m_isStreaming : CameraStreamProcessor
  • m_isTrial : sealed
  • m_isUITextureRenderNeeded : BaseControl
  • m_isUpdatingNetworkStatus : Scenario3_NetworkConnectivityChanges
  • m_isUpperCaseEnabled : Scenario1ViewModel
  • m_isVisible : BaseControl , BaseElement , MediaTransportControls
  • m_isWindowClosed : CustomComputeShaderRenderer , CustomPixelShaderRenderer , CustomVertexShaderRenderer , PhotoAdjustmentRenderer , D2DSvgImageRenderer
  • m_isWindowVisible : sealed
  • m_items : MasterDetailPage
  • m_jsonValue : HttpJsonContent
  • m_key : Scenario1ViewModel , Scenario2ViewModel , Scenario1ViewModel , Scenario2ViewModel
  • m_keyDownEventToken : sealed
  • m_keyName : PersistentState
  • m_kind : DeviceSelectorInfo
  • m_knownDevices : Scenario1_Discovery
  • m_lambda : scope_exit< Lambda >
  • m_languages : sealed
  • m_languageTag : sealed
  • m_lastActiveTime : final
  • m_lastCommand : HolographicVoiceInputMain
  • m_lastPosition : QuadRenderer
  • m_lastTime : BasicTimer
  • m_lastUpdateTime : final
  • m_latestFaces : FaceTrackerProcessor
  • m_latestFrame : VideoFrameProcessor
  • m_latestFrameData : CameraStreamProcessor
  • m_layoutUpdateInProgress : sealed
  • m_left : MoveLookController
  • m_leftOverTicks : StepTimer
  • m_leftRightPadding : SeekBarElement
  • m_length : SlowInputStream , AnimateLinePosition , Cylinder
  • m_level : Simple3DGame
  • m_levelActive : Simple3DGame
  • m_levelBitmap : GameInfoOverlay
  • m_levelBonusTime : Simple3DGame
  • m_levelCount : Simple3DGame
  • m_levelDuration : Simple3DGame
  • m_levelResourcesLoaded : GameRenderer
  • m_levelTimeRemaining : Simple3DGame
  • m_licenseInfoChanged : GameHud
  • m_licenseInformation : sealed , GameMain
  • m_licenseState : sealed
  • m_lightingPixelShader : RealtimeSurfaceMeshRenderer
  • m_lineEnd : Line
  • m_lineMetrics : sealed
  • m_lineSpacing : sealed
  • m_lineStart : Line
  • m_List : DeviceList
  • m_listening : HolographicVoiceInputMain
  • m_listingInformation : sealed , GameMain
  • m_loadingComplete : VideoRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , RealtimeSurfaceMeshRenderer , final , SceneObject , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_loadingCount : GameMain
  • m_localSettings : Scenario1 , Scenario2
  • m_locatabilityChangedToken : _360VideoPlaybackMain , BasicHologramMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialStageMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_location : BasicReaderWriter
  • m_locator : _360VideoPlaybackMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicSpatialMappingMain , HolographicTagAlongSampleMain , HolographicVoiceInputMain , HolographicPaintMain
  • m_lock : sealed , CameraStreamProcessor , MediaCaptureManager , WASAPICapture , WASAPIRenderer
  • m_logger : sealed
  • m_logicalSize : DeviceResources
  • m_logoBitmap : SampleOverlay , GameHud
  • m_logoSize : SampleOverlay , GameHud
  • m_lookAt : Camera
  • m_lookInUse : MoveLookController
  • m_lookLastDelta : MoveLookController
  • m_lookLastPoint : MoveLookController
  • m_lookPointerID : MoveLookController
  • m_lookuptable : LookupTable< T, LookupTableSize >
  • m_luminanceView : NV12VideoTexture
  • m_main : sealed , App , sealed
  • m_mainPage : sealed
  • m_mainWindowReactivated : sealed
  • m_manipulationCanceledToken : HandHandler
  • m_manipulationCompletedToken : HandHandler
  • m_manipulationStartedToken : HandHandler
  • m_manipulationUpdatedToken : HandHandler
  • m_manualSsid : Scenario2ViewModel
  • m_manualSsidIsChecked : Scenario2ViewModel
  • m_manualSsidTextBoxVisibility : Scenario2ViewModel
  • m_maxBound : Simple3DGame
  • m_maxCLL : D2DAdvancedColorImagesRenderer
  • m_maximumValue : Scenario3_LaunchAppServices
  • m_maxLevelSupported : DftTransform
  • m_maxPeriodInFrames : WASAPICapture
  • m_MaxPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_maxSecondsInPressingState : Button
  • m_maxTitleSize : GameHud
  • m_maxTrianglesPerCubicMeter : RealtimeSurfaceMeshRenderer
  • m_maxZoom : PhotoAdjustmentRenderer
  • m_mediaCapture : sealed , CameraStreamProcessor , VideoFrameProcessor , HolographicMRCSampleMain , MediaCaptureManager
  • m_mediaFrameReader : CameraStreamProcessor , VideoFrameProcessor
  • m_mediaFrameSource : VideoFrameProcessor
  • m_mediaPlayer : sealed , VideoRenderer
  • m_mediaTransportControls : _360VideoPlaybackMain
  • m_memberConnectionResult : sealed
  • m_memberTextSent : sealed
  • m_memoryPreference : CameraStreamProcessor
  • m_mesh : GameObject
  • m_meshCollection : RealtimeSurfaceMeshRenderer
  • m_meshCollectionLock : RealtimeSurfaceMeshRenderer
  • m_meshColor : Material
  • m_meshProperties : final
  • m_meshResourcesMutex : final
  • m_messageCount : sealed
  • m_messageInfo : sealed
  • m_MFSource : WASAPIRenderer
  • m_MFSourceReader : MFSampleGenerator
  • m_minBound : Simple3DGame
  • m_minimumValue : Scenario3_LaunchAppServices
  • m_MinPeriodInFrames : WASAPICapture , WASAPIRenderer
  • m_minPeriodInFrames : WASAPICapture
  • m_minZoom : D2DAdvancedColorImagesRenderer
  • m_MixFormat : MFSampleGenerator , WASAPICapture , WASAPIRenderer
  • m_mixFormat : WASAPICapture
  • m_modelConstantBuffer : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , RenderingHelper
  • m_modelConstantBufferData : BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Button , Cursor , Panel , SpinningCubeRenderer , SceneObject , QuadRenderer , SpinningCubeRenderer , Stroke , Tool , sealed , SourceHandler
  • m_modelMatrix : GameObject
  • m_modelTransformBuffer : final
  • m_mouseInUse : MoveLookController
  • m_mouseLastPoint : MoveLookController
  • m_mouseLeftInUse : MoveLookController
  • m_mousePointerID : MoveLookController
  • m_mouseRightInUse : MoveLookController
  • m_moveCommand : MoveLookController
  • m_moveFirstDown : MoveLookController
  • m_moveInUse : MoveLookController
  • m_moveLowerRight : MoveLookController
  • m_movePointerID : MoveLookController
  • m_movePointerPosition : MoveLookController
  • m_moveUpperLeft : MoveLookController
  • m_mtcGrid : sealed
  • m_musicEngine : Audio
  • m_musicMasteringVoice : Audio
  • m_mutex : LocationBackgroundTask , ViewLifetimeControl
  • m_Name : sealed
  • m_name : CServiceBase , School , User
  • m_nativeOrientation : DeviceResources
  • m_navigationCompletedToken : HandHandler
  • m_navigationStartedToken : HandHandler
  • m_nearPlane : Camera
  • m_network : Scenario1_ManageHotspot
  • m_nextId : Level2 , Level4
  • m_normal : QuadRenderer , Face
  • m_normalMaterial : GameObject
  • m_Number : BadgeNumericNotificationContent
  • m_numFramesWithoutFaces : FaceTrackerProcessor
  • m_numVertices : WaveEffect
  • m_objective : Level
  • m_objects : Simple3DGame
  • m_ocrEngine : DecodeEngine
  • m_onAirTapCallback : ControlBase
  • m_onboardeeNetworkList : Scenario2ViewModel
  • m_onboardeeSsidListVisibility : Scenario2ViewModel
  • m_onboarderNetworkList : Scenario2ViewModel
  • m_onboarderSsidListVisibility : Scenario2ViewModel
  • m_onboardingConfigurationVisibility : Scenario2ViewModel
  • m_onboardingPassword : Scenario2ViewModel
  • m_onboardingProducerIsChecked : Scenario2ViewModel
  • m_onboardSessionAlreadyJoined : Scenario2ViewModel
  • m_OnProcessQueue : OpQueue< T, TOperation >
  • m_op : CStreamSink::CAsyncOperation
  • m_OpQueue : OpQueue< T, TOperation >
  • m_optIn : HttpMeteredConnectionFilter
  • m_orientation : Tool
  • m_orientationTransform2D : DeviceResources
  • m_orientationTransform3D : DeviceResources
  • m_Oscilloscope : sealed
  • m_outlineBrush : CustomTextRenderer
  • m_outputEffect : PhotoAdjustmentRenderer
  • m_outputSize : DeviceResources
  • m_OutputStream : WASAPICapture
  • m_outputStream : WASAPICapture
  • m_overlayWidth : SampleOverlay
  • m_p : unique_cotaskmem_ptr< T >
  • m_padding : SampleOverlay
  • m_pageCollection : sealed
  • m_panelSize : PhotoAdjustmentRenderer
  • m_parent : EmbeddedMFAsyncCallback< Callback >
  • m_parentControlTransform : Button
  • m_parentFocusedPosition : FocusableElement
  • m_parentTextureHeight : FocusableElement
  • m_parentTextureWidth : FocusableElement
  • m_parentTransform : BaseControl
  • m_parentTranslation : BaseElement
  • m_passportAvailable : sealed , SignIn
  • m_passwordVisibility : Scenario2ViewModel
  • m_pause : MoveLookController
  • m_pausedTime : GameTimer
  • m_pausePressed : MoveLookController
  • m_pauseRequested : GameMain
  • m_pauseText : PlayPauseButton
  • m_paymentAidRegistration : sealed
  • m_pbCurrentAppletId : sealed
  • m_pCriticalSection : AutoLock
  • m_pendingOperation : Scenario2_GetPosition , Scenario4_ForegroundGeofence , LocationBackgroundTask
  • m_pendingSelectionDeviceId : Scenario5_DisplayingBarcodePreview
  • m_pendingSurfaceMesh : final
  • m_phone : User
  • m_photoEffectAdded : MediaCaptureManager
  • m_photoScale : sealed
  • m_photoSize : sealed
  • m_physicalDeviceIsChecked : Scenario2ViewModel
  • m_pInvokeFn : AsyncCallback< T >
  • m_pitch : sealed , MoveLookController
  • m_pitchAngle : sealed
  • m_pixelHeight : sealed
  • m_pixelShader : Button , GameRenderer , SceneObject , BaseControl , VideoRenderer , SpinningCubeRenderer , QuadRenderer , SpinningCubeRenderer , Cursor , Panel , SpinningCubeRenderer , DistanceFieldRenderer , QuadRenderer , SpinningCubeRenderer , Material , GameRenderer , RenderingHelper
  • m_pixelShaderFlat : GameRenderer
  • m_pixelShaderNV12 : QuadRenderer
  • m_pixelShaderRGB : QuadRenderer
  • m_pixelShaders : DeviceResources
  • m_pixelWidth : sealed
  • m_planeNormal : AnimateCirclePosition
  • m_playActive : sealed
  • m_PlaybackPositionMaxTime : Scenario7_LiveSeekableRange
  • m_PlaybackPositionMinTime : Scenario7_LiveSeekableRange
  • m_player : Simple3DGame , sealed , Simple3DGame
  • m_playPauseButtonControl : MediaTransportControls
  • m_playText : PlayPauseButton
  • m_PlotData : WASAPICapture
  • m_plotDataBuffer : WASAPICapture
  • m_plotDataMaxPoints : WASAPICapture
  • m_plotDataPointsFilled : WASAPICapture
  • m_plotDataReady : PlotDataSourceT< D >
  • m_plotDataReadyToken : sealed , Scenario4
  • m_point : Face
  • m_PointArray : sealed
  • m_pointBufferMutex : FrameRenderer
  • m_pointerPos : D2DAdvancedColorImagesRenderer
  • m_pointerPressed : BasicHologramMain
  • m_pointerPressedEventToken : sealed
  • m_pointSampler : TextRenderer
  • m_position : QuadRenderer , Tool , QuadRenderer , BaseControl , MediaTransportControls , SpinningCubeRenderer , sealed , SpinningCubeRenderer , ControlBase , SpinningCubeRenderer , SlowInputStream , GameObject , sealed , SourceHandler
  • m_positionalTrackingDeactivatingToken : HolographicSpatialMappingMain
  • m_possiblePurchaseUpgrade : sealed
  • m_pParent : AsyncCallback< T >
  • m_preference : SizePreferenceString
  • m_pressComplete : GameMain
  • m_pressingTimeOut : Button
  • m_pressResult : GameMain
  • m_prevCursor : sealed
  • m_previousBufferHeight : FrameRenderer
  • m_previousBufferWidth : FrameRenderer
  • m_previousDecodeResult : sealed
  • m_previousFrameTimestamp : HolographicFaceTrackerMain
  • m_previousTime : GameTimer
  • m_printDocument : PrintHelper
  • m_printDocumentSource : PrintHelper
  • m_printPages : sealed
  • m_printPreviewPages : PrintHelper
  • m_printTaskRequestedEventToken : PrintHelper
  • m_processingTimeAvgMs : GpuPerformanceTimer
  • m_processingTimeHistory : GpuPerformanceTimer
  • m_processingTimeHistoryIndex : GpuPerformanceTimer
  • m_processingTimeMaxMs : GpuPerformanceTimer
  • m_processingTimeMinMs : GpuPerformanceTimer
  • m_processingTimeMs : GpuPerformanceTimer
  • m_producer : Scenario2ViewModel , Scenario1ViewModel
  • m_producerOptionsVisibility : Scenario1ViewModel
  • m_productId : sealed
  • m_projectionMatrix : Camera
  • m_projectionMatrixLeft : Camera
  • m_projectionMatrixRight : Camera
  • m_propertiesLock : FaceTrackerProcessor , VideoFrameProcessor
  • m_propertyChanged : WordOverlay , Scenario5_DisplayingBarcodePreview , BluetoothLEDeviceDisplay , DeviceInformationDisplay , ViewLifetimeControl , Scenario1_Colors , UserViewModel , Scenario1_Basic
  • m_propertySet : sealed
  • m_protectBufferScenario : Scenario6
  • m_protectedBuffer : Scenario6 , EdpBackgroundTask
  • m_protectedMessage : Scenario6
  • m_protectedStream : Scenario7
  • m_protectScenarioDesc : Scenario4
  • m_protectStreamScenario : Scenario7
  • m_provider : sealed
  • m_providers : sealed
  • m_qpcFrequency : StepTimer
  • m_qpcLastTime : StepTimer
  • m_qpcMaxDelta : StepTimer
  • m_qpcSecondCounter : StepTimer
  • m_quadRenderer : CameraStreamCoordinateMapperMain , HolographicFaceTrackerMain
  • m_quadTexture : QuadRenderer
  • m_quadTextureSamplerState : VideoRenderer , QuadRenderer
  • m_quadTextureView : QuadRenderer
  • m_queueId : EmbeddedMFAsyncCallback< Callback > , unique_shared_work_queue
  • m_radius : ToolCarousel , AnimateCirclePosition , Cylinder , Sphere
  • m_radiusX : Ellipse , FilledEllipse
  • m_radiusY : FilledEllipse , Ellipse
  • m_raised : sealed
  • m_random : Scenario2_Effects
  • m_rasterizeDepthMeshConstants : GpuCoordinateMapper
  • m_rasterizeDepthMeshInputLayout : GpuCoordinateMapper
  • m_rasterizeDepthMeshPixelShader : GpuCoordinateMapper
  • m_rasterizeDepthMeshVertexShader : GpuCoordinateMapper
  • m_rasterizeFrameBlob : CameraCoordinateMapper
  • m_reader : sealed
  • m_readerName : SmartCardListItem
  • m_readers : sealed
  • m_ReaderState : MFSampleGenerator
  • m_readerState : MFSampleGenerator
  • m_readingToken : sealed
  • m_ReadingToken : sealed
  • m_readyPlaylists : Scenario2_Effects
  • m_readyToRender : CameraStreamCoordinateMapperMain
  • m_recognitionSound : HolographicVoiceInputMain
  • m_recording : HolographicMRCSampleMain
  • m_rect : Rectangle , FilledRectangle
  • m_RectFocusOutline : Button
  • m_RectPressedBackgroundFill : Button
  • m_redBrush : TargetTexture
  • m_Ref : MFSampleGenerator
  • m_refCount : FilmicEffect , ReinhardEffect , SdrOverlayEffect , RippleEffect , CustomTextRenderer , Listener , FontNameCollector , ViewLifetimeControl , WaveEffect , LuminanceHeatmapEffect
  • m_referenceFrame : _360VideoPlaybackMain , HolographicFaceTrackerMain , HolographicMRCSampleMain , HolographicVoiceInputMain , HolographicPaintMain , HolographicSpatialMappingMain
  • m_refreshModelConstantBufferData : Tool , SourceHandler
  • m_registeredListener : sealed
  • m_reinhardEffect : D2DAdvancedColorImagesRenderer
  • m_relativeIntersectionPoint : BaseControl
  • m_released : ViewLifetimeControl
  • m_releasedToken : SecondaryViewPage
  • m_remainingTimeString : SeekBarElement
  • m_remainingTimeText : SeekBarElement
  • m_remoteSystemWatcher : Scenario1_Discovery
  • m_renderCount : DistanceFieldRenderer
  • m_renderEffectKind : D2DAdvancedColorImagesRenderer
  • m_renderer : sealed , Simple3DGame , GameMain , Simple3DGame , Scenario3 , GameMain , Scenario2
  • m_renderingHelper : HolographicPaintMain
  • m_renderItem : BaseControl
  • m_renderLoopWorker : GameMain
  • m_renderNeeded : GameMain
  • m_renderObjects : Simple3DGame
  • m_renderTargetView : TextRenderer , DistanceFieldRenderer , TextRenderer
  • m_requestCount : sealed
  • m_resetBuffers : ClearTool , Stroke
  • m_result : sealed
  • m_resumingEventToken : sealed
  • m_revokeEventScenarioText : Scenario5
  • m_revokeScenarioTxt : Scenario5
  • m_right : MoveLookController
  • m_rippleEffect : CustomPixelShaderRenderer
  • m_rootPage : Scenario1ViewModel , Scenario2ViewModel , Scenario1_Discovery , Scenario2_LaunchUri , Scenario3_LaunchAppServices
  • m_RootPage : sealed
  • m_rootPage : Scenario5_Capabilities , sealed
  • m_rotation : BaseControl , MediaTransportControls , ControlBase
  • m_rotationAxis : ToolCarousel
  • m_rotationdelta : sealed
  • m_rotationDirection : ToolCarousel
  • m_rotationMatrix : Cylinder , Face , AnimateCirclePosition
  • m_rotationStart : ToolCarousel
  • m_runningInConsole : CSampleService
  • m_sampleNetworkInfoVisibility : Scenario2ViewModel
  • m_sampleOverlay : CustomComputeShaderMain , CustomPixelShaderMain , D2DGradientMeshMain , DWriteColorTextRendererMain , CustomVertexShaderMain
  • m_SampleQueue : MFSampleGenerator , ToneSampleGenerator
  • m_sampleQueue : MFSampleGenerator , ToneSampleGenerator
  • m_SampleQueueTail : MFSampleGenerator
  • m_sampleQueueTail : MFSampleGenerator
  • m_SampleQueueTail : ToneSampleGenerator
  • m_sampler : BaseControl
  • m_SampleReadyAsyncResult : WASAPICapture , WASAPIRenderer
  • m_sampleReadyAsyncResult : WASAPICapture
  • m_SampleReadyAsyncResult : WASAPIRenderer
  • m_SampleReadyEvent : WASAPICapture , WASAPIRenderer
  • m_SampleReadyKey : WASAPICapture , WASAPIRenderer
  • m_sampleReadyKey : WASAPICapture
  • m_samplerLinear : GameRenderer
  • m_samplerState : GpuCoordinateMapper , QuadRenderer , Button , Cursor , QuadRenderer
  • m_saturation : PhotoAdjustmentRenderer
  • m_savedProfileName : Scenario2ViewModel
  • m_savedState : Simple3DGame
  • m_scale : BaseControl , CustomPixelShaderRenderer , ControlBase , CustomComputeShaderRenderer
  • m_scaledImage : D2DAdvancedColorImagesRenderer , PhotoAdjustmentRenderer
  • m_scaleFactor : Scenario2
  • m_scaleValue : D2DSvgImageRenderer
  • m_scannerDataReceivedToken : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • m_scannerEnabled : sealed
  • m_scannerReleaseRequestedToken : Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • m_scannerSupportsPreview : Scenario5_DisplayingBarcodePreview
  • m_scanPanelVisibility : Scenario2ViewModel
  • m_scenario1ViewModel : Scenario1
  • m_scenario2ViewModel : Scenario2
  • m_scenarioPage : PrintHelper
  • m_scenarioText : Scenario2
  • m_sceneController : HolographicSpatialStageMain , SpatialStageManager
  • m_sceneObjects : SceneController
  • m_sceneRenderer : CustomComputeShaderMain , CustomVertexShaderMain , D2DGradientMeshMain , DWriteColorTextRendererMain , CustomPixelShaderMain
  • m_screenViewport : DeviceResources
  • m_sdrOverlayEffect : D2DAdvancedColorImagesRenderer
  • m_secondsElapsedSinceTimeUpdate : SeekBarElement
  • m_secondsPerCount : GameTimer
  • m_secondsUntilSoundIsComplete : HolographicVoiceInputMain
  • m_SecretMessage : EdpBackgroundTask
  • m_seekbarControl : MediaTransportControls
  • m_segment : AnimateLineListPosition
  • m_segmentInformation : MediaStream
  • m_segmentInfoType : MediaStream
  • m_segments : MediaStream
  • m_segmentTemplateIdentifier : MediaStream
  • m_selectedAccountAction : sealed
  • m_selectedAuthType : Scenario2ViewModel
  • m_selectedOnboardeeNetwork : Scenario2ViewModel
  • m_selectedOnboarderNetwork : Scenario2ViewModel
  • m_selectedSampleNetwork : Scenario2ViewModel
  • m_selectedSoftAPNetwork : Scenario2ViewModel
  • m_selectedSourceGroupIndex : sealed
  • m_selectedWiFiAdapterIndex : Scenario2ViewModel
  • m_selector : DeviceSelectorInfo
  • m_serviceInterface : sealed
  • m_sessionId : sealed
  • m_sessionPort : sealed
  • m_sessionPortListener : sealed
  • m_setBarcodeSymbologyAttributesRequestedToken : sealed
  • m_settingsValues : PersistentState
  • m_shaderResourceView : TextRenderer , DistanceFieldRenderer , TextRenderer
  • m_ShadersCreated : sealed
  • m_shadersLoaded : MediaTransportControls
  • m_ShadersNeed : sealed
  • m_shape : Button
  • m_ShareContent : Scenario12_ShareData
  • m_sharedApplicationLink : Scenario13_ShareTarget
  • m_sharedBitmapStreamRef : Scenario13_ShareTarget
  • m_sharedCustomData : Scenario13_ShareTarget
  • m_sharedDataContentSourceApplicationLink : Scenario13_ShareTarget
  • m_sharedDataContentSourceWebLink : Scenario13_ShareTarget
  • m_sharedDataDescription : Scenario13_ShareTarget
  • m_sharedDataLogoBackgroundColor : Scenario13_ShareTarget
  • m_sharedDataPackageFamilyName : Scenario13_ShareTarget
  • m_sharedDataSquare30x30Logo : Scenario13_ShareTarget
  • m_sharedDataTitle : Scenario13_ShareTarget
  • m_sharedHtmlFormat : Scenario13_ShareTarget
  • m_sharedResourceMap : Scenario13_ShareTarget
  • m_sharedStorageItems : Scenario13_ShareTarget
  • m_sharedText : Scenario13_ShareTarget
  • m_sharedThumbnailStreamRef : Scenario13_ShareTarget
  • m_sharedWebLink : Scenario13_ShareTarget
  • m_shareOperation : Scenario13_ShareTarget
  • m_showHelpText : CameraStreamCoordinateMapperMain
  • m_showOnboardeeSsidList : Scenario2ViewModel
  • m_showOnboarderSsidList : Scenario2ViewModel
  • m_showTitle : GameHud
  • m_signals : sealed
  • m_size : Panel
  • m_Size : CAsyncState , sealed
  • m_size : Cursor , Button
  • m_sizeX : WaveEffect
  • m_sizeY : WaveEffect
  • m_skewX : WaveEffect , CustomVertexShaderRenderer
  • m_skewY : WaveEffect , CustomVertexShaderRenderer
  • m_sliderFrontSegment : SeekBarElement
  • m_sliderFrontSegmentEnd : SeekBarElement
  • m_sliderFrontSegmentStart : SeekBarElement
  • m_SliderFullScale : Scenario7_LiveSeekableRange
  • m_sliderHeight : SeekBarElement
  • m_sliderPosition : SeekBarElement
  • m_sliderRemainingSegment : SeekBarElement
  • m_sliderRemainingSegmentEnd : SeekBarElement
  • m_sliderRemainingSegmentStart : SeekBarElement
  • m_sliderWidth : SeekBarElement
  • m_snapSizeToRootElement : BaseControl
  • m_softAPPassword : Scenario2ViewModel
  • m_softwareTriggerStarted : Scenario5_DisplayingBarcodePreview
  • m_soundData : SoundEffect
  • m_soundEffectEngine : Audio
  • m_soundEffectMasteringVoice : Audio
  • m_source : sealed
  • m_sourceCollection : sealed
  • m_sourceDetectedToken : HolographicPaintMain
  • m_sourceFormat : CameraStreamProcessor
  • m_sourceId : SourceHandler
  • m_sourceKind : CameraStreamProcessor , SourceHandler
  • m_sourceLostToken : HolographicPaintMain
  • m_sourceMap : HolographicPaintMain
  • m_sourcePressedEventToken : SpatialInputHandler
  • m_sourcePressedToken : HolographicPaintMain
  • m_sourceReader : MFSampleGenerator
  • m_sources : HolographicPaintMain
  • m_sourceState : SpatialInputHandler
  • m_sourceUpdatedToken : HolographicPaintMain
  • m_sourceUri : sealed
  • m_sourceVoice : SoundEffect
  • m_spatialInputHandler : _360VideoPlaybackMain , HolographicVoiceInputMain
  • m_spatialInteractionManager : HolographicPaintMain
  • m_spatialLocator : BasicHologramMain
  • m_spatialPerceptionAccessRequested : HolographicSpatialMappingMain
  • m_spatialStageChangedEventToken : SpatialStageManager
  • m_spatialStageManager : HolographicSpatialStageMain
  • m_spCapture : sealed
  • m_spDPadHelper : SpatialControllerHandler
  • m_specularColor : Material
  • m_specularExponent : Material
  • m_speechCommandData : HolographicVoiceInputMain
  • m_speechRecognitionQualityDegradedToken : HolographicVoiceInputMain
  • m_speechRecognizer : HolographicVoiceInputMain
  • m_speechRecognizerResultEventToken : HolographicVoiceInputMain
  • m_speechSynthesisSound : HolographicVoiceInputMain
  • m_sphereTexture : GameRenderer
  • m_spinningCubeRenderer : HolographicVoiceInputMain , HolographicFaceTrackerMain
  • m_spMFDXGIDeviceManager : MediaCaptureManager
  • m_spRenderer : sealed
  • m_squares : Stroke
  • m_stageBoundsShape : SpatialStageManager
  • m_stageVisibleAreaIndicatorShape : SpatialStageManager
  • m_startPosition : AnimateLinePosition , AnimateCirclePosition
  • m_startRecognitionSound : HolographicVoiceInputMain
  • m_startSoftwareTriggerRequestedToken : sealed
  • m_startTime : BasicTimer , Animate
  • m_startTimestampQuery : GpuPerformanceTimer
  • m_state : MoveLookController
  • m_stateBlock : BaseControl , SampleOverlay , TextRenderer , SampleOverlay
  • m_StateChangedEvent : sealed
  • m_stationaryFrameOfReference : SpatialStageManager
  • m_stationaryReferenceFrame : BasicHologramMain , HolographicTagAlongSampleMain
  • m_statisticsTextRenderer : CameraStreamCoordinateMapperMain
  • m_status : sealed , PropertySetContext , sealed , CServiceBase , PropertyGetContext< T > , sealed
  • m_statusBufferScenario : Scenario6
  • m_statusHandle : CServiceBase
  • m_stereoEnabled : DeviceResources
  • m_stopSoftwareTriggerRequestedToken : sealed
  • m_stopTime : GameTimer
  • m_straighten : PhotoAdjustmentRenderer
  • m_streaming : sealed
  • m_streamingEnabled : CameraStreamCoordinateMapperMain
  • m_streams : Period
  • m_strokeInsideTargetBoard : SpatialControllerHandler
  • m_strokes : HolographicPaintMain
  • m_strokeThickness : Rectangle , Line , Ellipse
  • m_supportedSymbologies : DecodeEngine
  • m_supportsVprt : DeviceResources
  • m_surface : VideoRenderer
  • m_surfaceAccessAllowed : HolographicSpatialMappingMain
  • m_surfaceMesh : final
  • m_surfaceMeshCount : RealtimeSurfaceMeshRenderer
  • m_surfaceMeshOptions : HolographicSpatialMappingMain
  • m_surfaceObserver : HolographicSpatialMappingMain
  • m_surfacesChangedToken : HolographicSpatialMappingMain
  • m_suspendEventHandlerRegistrationToken : sealed
  • m_suspendingEventToken : sealed
  • m_svgDocument : D2DSvgImageRenderer
  • m_swapChain : DeviceResources
  • m_swapChainPanel : DeviceResources
  • m_symbologyAttributes : sealed
  • m_sysAudioEnabled : MediaCaptureManager
  • m_SystemMediaControls : sealed
  • m_systemMediaControlsButtonToken : Scenario3 , Scenario2
  • m_SystemMediaControlsButtonToken : sealed
  • m_tappedToken : HandHandler , SpatialControllerHandler
  • m_target : GameObject
  • m_targetBoard : SourceHandler
  • m_targetElapsedTicks : StepTimer
  • m_targetForward : QuadRenderer
  • m_targetId : GameObject
  • m_targetPosition : QuadRenderer , SpinningCubeRenderer
  • m_targetRasterizedDepthTexture : CameraCoordinateMapper
  • m_targetRasterizedDepthTextureDSV : CameraCoordinateMapper
  • m_targetRasterizedDepthTextureSRV : CameraCoordinateMapper
  • m_targetTexCoordOffset : QuadRenderer
  • m_targetTexCoordScale : QuadRenderer
  • m_targetTexture : CameraCoordinateMapper
  • m_targetTextureRTV : CameraCoordinateMapper
  • m_targetTextureSRV : CameraCoordinateMapper
  • m_targetUp : QuadRenderer
  • m_taskInstance : sealed
  • m_taskName : EdpBackgroundTask
  • m_taskRunning : FrameRenderer , sealed
  • m_tce : sealed
  • m_tempBrush : CustomTextRenderer
  • m_temperatureTint : PhotoAdjustmentRenderer
  • m_testDataToCopy : Scenario3
  • m_tetheringManager : Scenario1_ConfigureMobileHotspot , Scenario2_ToggleMobileHotspot
  • m_texCoordOffset : QuadRenderer
  • m_texCoordScale : QuadRenderer
  • m_text : sealed , Item , Text , ItemViewModel
  • m_textAscentBrush : sealed
  • m_textBackgroundBrush : sealed
  • m_textBackgroundColor : sealed
  • m_textBlock : sealed
  • m_textBrush : sealed , GameInfoOverlay , sealed , GameHud , GameInfoOverlay
  • m_textBrushGrey : GameHud
  • m_textColor : sealed
  • m_textDescentBrush : sealed
  • m_textFormat : Text , TargetTexture , TextRenderer
  • m_textFormatBody : GameInfoOverlay , GameHud
  • m_textFormatBodySymbol : GameHud
  • m_textFormatTitle : GameInfoOverlay
  • m_textFormatTitleBody : GameHud
  • m_textFormatTitleHeader : GameHud
  • m_textFormatTitleLicense : GameHud
  • m_textLayout : SampleOverlay , sealed , SampleOverlay , Text , TextRenderer , SampleOverlay , sealed
  • m_textLayoutImageSource : sealed
  • m_textLineGapBrush : sealed
  • m_textMetrics : TextRenderer
  • m_textRenderer : DWriteColorTextRendererRenderer , HolographicFaceTrackerMain
  • m_textSize : SeekBarElement
  • m_texture : DistanceFieldRenderer , NV12VideoTexture , TextRenderer , VideoRenderer , BaseControl , VideoRenderer , TextRenderer
  • m_textureHeight : DistanceFieldRenderer , TextRenderer , BaseControl , TextRenderer
  • m_textureIndex : Cursor , Button
  • m_textureRV : Material
  • m_textures : DeviceResources
  • m_textureShaderResourceView : BaseControl
  • m_textureTarget : BaseControl
  • m_textureView : Button , VideoRenderer
  • m_textureWidth : TextRenderer , BaseControl , DistanceFieldRenderer , TextRenderer
  • m_textVerticalOffset : SampleOverlay
  • m_threshold : ThumbstickDPadHelper , TouchpadDPadHelper
  • m_timeLimit : Level
  • m_timer : HolographicVoiceInputMain , Simple3DGame , CustomVertexShaderMain , HolographicTagAlongSampleMain , HolographicSpatialMappingMain , CameraStreamCoordinateMapperMain , CustomPixelShaderRenderer , sealed , HolographicMRCSampleMain , _360VideoPlaybackMain , BasicHologramMain , CustomVertexShaderRenderer , HolographicFaceTrackerMain , HolographicSpatialStageMain , HolographicPaintMain
  • m_timezone : User
  • m_title : ItemViewModel , sealed , Item , ViewLifetimeControl , SizePreferenceString , sealed
  • m_titleBody : GameHud
  • m_titleBodyLayout : GameHud
  • m_titleBodyVerticalOffset : GameHud
  • m_titleHeader : GameHud
  • m_titleHeaderLayout : GameHud
  • m_titleLicenseInfo : GameHud
  • m_titleLicenseInfoLayout : GameHud
  • m_titleLicenseVerticalOffset : GameHud
  • m_titleRectangle : GameInfoOverlay
  • m_titleString : GameInfoOverlay
  • m_toggling : Scenario2_ToggleMobileHotspot
  • m_token : sealed
  • m_ToneSource : WASAPIRenderer
  • m_toolPosition : SourceHandler
  • m_tools : HolographicPaintMain
  • m_toolsCarousel : HolographicPaintMain
  • m_tooSmallActive : GameInfoOverlay
  • m_tooSmallBitmap : GameInfoOverlay
  • m_topBottomPadding : SeekBarElement
  • m_topScore : Simple3DGame
  • m_total : BasicTimer
  • m_totalHits : Simple3DGame
  • m_totalLength : AnimateLineListPosition
  • m_totalShots : Simple3DGame
  • m_totalTicks : StepTimer
  • m_trackingFaces : HolographicFaceTrackerMain
  • m_transform : Scenario2 , BaseControl , ControlBase , MediaTransportControls
  • m_transformedFontSize : Text
  • m_transformedImage : CustomVertexShaderRenderer , CustomComputeShaderRenderer , CustomPixelShaderRenderer
  • m_transformedTranslation : BaseElement
  • m_transformMatrix : BaseElement
  • m_transformRecalculationNeeded : BaseElement
  • m_translation : BaseElement
  • m_triangleIndices : final
  • m_triggerDetails : sealed
  • m_turnedOn : Button
  • m_type : ControlBase , School
  • m_uiControl : GameMain
  • m_uniqueFontNames : FontNameCollector
  • m_unprotectedBuffer : Scenario6
  • m_unprotectedStream : Scenario7
  • m_up : MoveLookController , Camera
  • m_updatedMeshProperties : final
  • m_updatedTriangleIndices : final
  • m_updatedVertexNormals : final
  • m_updatedVertexPositions : final
  • m_updateReady : final
  • m_updateState : GameMain
  • m_updateStateNext : GameMain
  • m_updateVertexResourcesTask : final
  • m_userId : UserViewModel
  • m_userRotation : Scenario2
  • m_useWireframe : SceneObject
  • m_usingVprtShaders : QuadRenderer , Button , QuadRenderer , RenderingHelper , SpinningCubeRenderer , VideoRenderer , SpinningCubeRenderer , Cursor , SceneObject , Panel , RealtimeSurfaceMeshRenderer
  • m_value : sealed , PropertyGetContext< T > , sealed
  • m_velocity : QuadRenderer , MoveLookController , SpinningCubeRenderer , QuadRenderer , GameObject
  • m_verified : User
  • m_vertexBuffer : SpinningCubeRenderer , ClearTool , WaveEffect , GpuCoordinateMapper , SceneObject , Button , RenderingHelper , QuadRenderer , Stroke , SpinningCubeRenderer , Cursor , QuadRenderer , Panel , DistanceFieldRenderer , QuadRenderer , MeshObject , VideoRenderer
  • m_vertexCount : GpuCoordinateMapper , MeshObject
  • m_vertexLayout : GameRenderer
  • m_vertexNormals : final
  • m_vertexPositions : final
  • m_vertexShader : VideoRenderer , SpinningCubeRenderer , GameRenderer , DistanceFieldRenderer , SceneObject , SpinningCubeRenderer , Material , GameRenderer , RenderingHelper , Panel , Cursor , RealtimeSurfaceMeshRenderer , QuadRenderer , BaseControl , SpinningCubeRenderer , Button , SpinningCubeRenderer , QuadRenderer
  • m_vertexShaderFlat : GameRenderer
  • m_vertexShaders : DeviceResources
  • m_vertexStride : DistanceFieldRenderer
  • m_vertices : SceneObject
  • m_videoEffectAdded : MediaCaptureManager
  • m_videoFrameAvailToken : VideoRenderer
  • m_videoFrameProcessor : HolographicFaceTrackerMain
  • m_videoProcessor : FaceTrackerProcessor
  • m_videoRenderer : _360VideoPlaybackMain
  • m_videoTexture : HolographicFaceTrackerMain
  • m_viewId : ViewLifetimeControl
  • m_viewMatrix : Camera
  • m_viewProjectionConstantBuffer : CameraResources
  • m_visibilityChangedEventToken : sealed
  • m_visibilityEventRegistrationToken : sealed
  • m_VisibilityToken : sealed
  • m_visible : GameInfoOverlay , GameMain
  • m_visitTask : Scenario8_VisitsBackgroundTask
  • m_visualizeDepthMeshConstants : GpuCoordinateMapper
  • m_visualizeDepthMeshInputLayout : GpuCoordinateMapper
  • m_visualizeDepthMeshPixelShader : GpuCoordinateMapper
  • m_visualizeDepthMeshVertexShader : GpuCoordinateMapper
  • m_visualizeFrameBlob : CameraCoordinateMapper
  • m_waitForCenter : ThumbstickDPadHelper
  • m_waitForRelease : SpatialControllerHandler
  • m_waitingForSpeechCue : HolographicVoiceInputMain
  • m_waitingForSpeechPrompt : HolographicVoiceInputMain
  • m_wallsTexture : GameRenderer
  • m_watcher : Scenario1ViewModel
  • m_Watcher : sealed
  • m_watcher : Scenario2ViewModel , sealed
  • m_watcherDeviceAddedToken : sealed
  • m_watcherDeviceRemovedToken : sealed
  • m_watcherDeviceUpdatedToken : sealed
  • m_WatcherStarted : DeviceList
  • m_WatcherSuspended : DeviceList
  • m_WAVDataWriter : WASAPICapture
  • m_waveEffect : CustomVertexShaderRenderer
  • m_waveFormat : MediaReader
  • m_waveOffset : WaveEffect
  • m_whiteboard : HolographicPaintMain
  • m_whiteBrush : TargetTexture , SampleOverlay , TextRenderer , SampleOverlay , TextRenderer
  • m_whiteScaleEffect : D2DAdvancedColorImagesRenderer
  • m_wicColorContext : D2DAdvancedColorImagesRenderer , PhotoAdjustmentRenderer
  • m_wicFactory : BasicLoader , DeviceResources
  • m_width : NV12VideoTexture , Face , sealed
  • m_widthVector : Face
  • m_wiFiAdapter : Scenario2ViewModel
  • m_wiFiAdapterDisplayNames : Scenario2ViewModel
  • m_wiFiAdapterList : Scenario2ViewModel
  • m_wiFiAdapterListVisibility : Scenario2ViewModel
  • m_window : DeviceResources , ViewLifetimeControl
  • m_windowClosed : sealed , GameMain , sealed
  • m_windowClosedEventToken : sealed
  • m_windowVisible : sealed
  • m_wireframeRasterizerState : SceneObject , RealtimeSurfaceMeshRenderer
  • m_wordBoundingBox : WordOverlay
  • m_work : CSampleService
  • m_workerThread : FaceTrackerProcessor
  • m_writing : WASAPICapture
  • m_wsDebugLog : sealed
  • m_yaw : MoveLookController
  • m_yawAngle : sealed
  • m_yellowBrush : TargetTexture
  • m_zoom : PhotoAdjustmentRenderer , D2DAdvancedColorImagesRenderer
  • madeVisible : ViewLifetimeControl
  • magnitudeScale : DftTransform
  • main : AppView , sealed , AppView
  • mainDispatcher : App , SecondaryViewPage
  • MainDispatcher : SampleState
  • mainDispatcher : ProjectionViewPage
  • MainDispatcher : ProjectionViewPageInitializationData
  • mainDispatcher : sealed
  • MainPageDispatcher : ProjectionViewBroker
  • MainViewId : ProjectionViewPageInitializationData
  • mainViewId : sealed , SecondaryViewPage , App
  • MainViewId : sealed
  • mainviewId : sealed
  • MainViewId : ProjectionViewBroker
  • mainViewId : ProjectionViewPage
  • MainViewId : SampleState
  • mainviewId : VideoGallery
  • mainWindowReactivated : AppView
  • manager : AdvertisementWrapper , StreamSocketListenerWrapper , SocketWrapper , DiscoveredDeviceWrapper , SessionWrapper
  • manifest : LiveSourceBufferManager , Player , DashManifestParser
  • manifestReloadTimer : Player
  • ManifestUri : AdaptiveContentModel
  • manipulationProcessor : Scenario5 , sealed
  • Manufacturer : RawSMBIOSSystemInfo
  • mapBillboardStreamReference : Scenario2 , sealed
  • MapCoordinates : PlaceLocation
  • mapDeviceWatchersToDeviceSelector : Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect
  • mapIconStreamReference : sealed , Scenario2
  • MapLayers : sealed
  • mapModelStreamReference : sealed , Scenario2
  • Margin : PageDescription
  • MarkAsManualConnect : ConfigStore
  • Matched : DeviceListEntry
  • matrix : WaveEffect
  • MAX_RESULTS : AzureDataProvider , Scenario06
  • maxBatchFetchSize : ItemCacheManager< T >
  • MaxBuffering : SourceBufferManager
  • maxEventDescriptors : VisitBackgroundTask , GeofenceBackgroundTask , VisitBackgroundTask
  • MaxGap : SourceBufferManager
  • MAXIMUM_ATR_CODES : AtrInfo
  • maxNaturalDurationForController : Scenario2_SynchronizingPlayers , Scenario1_MultiVideoPlayback , Scenario3_AdaptiveSync
  • maxUploadFileSize : Scenario2_Upload , sealed
  • maxWindows : sealed , Scenario3_UsingWindows
  • mbrr : Scenario1_Basic
  • mediaCapture : Scenario2_DetectInWebcam , CaptureDevice , Scenario5_DisplayingBarcodePreview , OcrCapturedImage , sealed , Scenario1_TrackInWebcam
  • mediaCaptureFailedEventToken : sealed
  • mediaCaptureFailedToken : OcrCapturedImage
  • mediaElement : Player
  • mediaEncodingProperties : sealed
  • mediaExtensionManager : MainPage
  • mediaExtensionMgr : MainPage
  • MediaItemIdKey : MediaItem
  • mediaList : PlayerViewModel , PlaylistView
  • MediaPlaybackItem : ContentSelector
  • mediaPlaybackItem : Scenario1
  • mediaPlaybackItemLogger : Scenario3_RequestModification , Scenario6_AdInsertion , Scenario5_Metadata , Scenario2_EventHandlers , Scenario4_Tuning , Scenario7_LiveSeekableRange
  • mediaPlayer : PlaybackPage , Scenario7 , ContentSelector , Scenario1 , AppView
  • mediaPlayerElements : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • mediaPlayerLogger : Scenario6_AdInsertion , Scenario2_EventHandlers , Scenario5_Metadata , Scenario4_Tuning , Scenario3_RequestModification , Scenario7_LiveSeekableRange
  • mediaPresentationDuration : Manifest
  • MediaProtectionContainerGuid : PlayReadyHelper
  • MediaProtectionSystemId : PlayReadyHelper
  • MediaProtectionSystemIdMapping : PlayReadyHelper
  • mediaSink : CaptureDevice
  • mediaSourceLogger : Scenario7_LiveSeekableRange , Scenario5_Metadata , Scenario2_EventHandlers , Scenario4_Tuning , Scenario6_AdInsertion , Scenario3_RequestModification
  • mediaStreamSource : Scenario3_AddAudioTracks , Scenario4_AddOverlays , sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips
  • mediaUris : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers
  • mediaUrlTemplate : MediaSegmentInformation
  • menuItems : sealed , Scenario1_EventAndMenuHookup
  • meshColor : ConstantBufferChangesEveryPrim
  • message : CaptureFailedEventArgs , JsonRequest
  • messageCount : Conversation
  • messageNumber : sealed , Scenario1_Basic
  • messageTypes : Scenario3_SendMIDIMessages
  • messageWebSocket : Scenario4_PartialReadWrite , Scenario1_UTF8 , sealed
  • messageWriter : Scenario1_UTF8 , sealed
  • MetadataUpdateEntryPoint : Constants
  • MetadataUpdateTaskName : Constants
  • meteredConnectionFilter : Scenario14_MeteredConnectionFilter
  • MeteredConnectionPriorityPropertyNameLiteral : HttpMeteredConnectionFilter
  • metering : METERING_CONTEXT
  • MeteringData : sealed
  • meteringOn : sealed , ServiceViewModel
  • meteringOnWhileSuspension : sealed , ServiceViewModel
  • MF_MT_VIDEO_LEVEL : MediaFoundationConstants
  • MICROSOFT_PROVIDER_ID : sealed
  • MicrosoftAccountAuthority : MultipleAccountsScenario , SingleAccountScenario , DefaultAccountScenario
  • MicrosoftAccountClientId : DefaultAccountScenario , SingleAccountScenario , MultipleAccountsScenario
  • MicrosoftAccountProviderId : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • MicrosoftAccountScopeRequested : DefaultAccountScenario , SingleAccountScenario , MultipleAccountsScenario
  • MicrosoftProviderId : MultipleAccountsScenario , DefaultAccountScenario , SingleAccountScenario
  • midiInDeviceWatcher : Scenario2_ReceiveMIDIMessages , Scenario1_MIDIDeviceEnumeration
  • midiInPorts : Scenario2_ReceiveMIDIMessages
  • midiOutDeviceWatcher : Scenario3_SendMIDIMessages , Scenario1_MIDIDeviceEnumeration
  • midiOutPorts : Scenario3_SendMIDIMessages
  • midiSelector : MidiDeviceWatcher
  • mimeType : SourceBufferManager , MediaStream
  • minBufferTime : Manifest
  • minimumUpdatePeriod : Manifest
  • MinMinimumUpdatePeriod : Manifest
  • minPenSize : Scenario3 , sealed
  • MinReadChunkSize : ReadStreamTask
  • MinWindowHeight : Scenario3_Size
  • MinWindowWidth : Scenario3_Size
  • mipMapCount : DDS_HEADER
  • mirroringPreview : OcrCapturedImage , sealed
  • miscFlag : DDS_HEADER_DXT10
  • miscFlags2 : DDS_HEADER_DXT10
  • MissingTitleError : MainPage
  • mode : LowLatency
  • model : ModelConstantBuffer , QuadModelConstantBuffer , ModelConstantBuffer , ModelColorConstantBuffer , CubeModelConstantBuffer , ModelConstantBuffer , ModelColorConstantBuffer , ModelConstantBuffer
  • modelConstantBuffer : VideoRenderer , SpinningCubeRenderer
  • modelConstantBufferData : SpinningCubeRenderer , VideoRenderer
  • modelSet : ViewModelLocator
  • modelToWorld : ModelNormalConstantBuffer , ModelConstantBuffer
  • moderateMarginsIconTask : CustomOptionsPrintHelper
  • modeSelected : HardwareDRMViewModel
  • ModifyBusObjectMap : AllJoynBusObjectManager
  • moreButton : DynamicCommandBar
  • mouseWheelData : PlaybackPage
  • moviePath : ProactiveViewModel , ReactiveViewModel , SecureStopViewModel , HardwareDRMViewModel
  • mp : Scenario6
  • MPE : MPEUserControl
  • mpiLogger : Scenario5 , Scenario2 , Scenario4 , Scenario3
  • mpiLoggerList : Scenario6
  • mplLogger : Scenario6
  • mpLogger : Scenario6
  • mruToken : SampleState , MainPage , sealed
  • MSA_CLIENT_ID : sealed
  • MSA_SCOPE_REQUESTED : sealed
  • mse : Player , SourceBufferManager
  • msLogger : Scenario3 , Scenario2
  • MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED : PlayReadyHelper
  • mtcGrid : PlaybackPage
  • Music : FileExtensions
  • myLayer1 : Scenario11 , sealed , Scenario10
  • myLayer2 : Scenario10 , sealed , Scenario11
  • myLayers : Scenario11 , Scenario10
  • myResolver : Scenario6_NavToStream
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- n -

  • Name : BarcodeScannerInfo , SymbologyListEntry , SyncBackgroundTaskInformation , Contact , DeviceInformationDisplay , BluetoothLEDeviceDisplay , WindowInfo , PlaceInfo
  • nameKey : School , User , School , User
  • narrowMarginsIconTask : CustomOptionsPrintHelper
  • navigatedAway : Scenario3_InterruptPipes , Scenario4_BulkPipes , Scenario7_SyncDevice , sealed , InputReportEvents
  • navigationHelper : MainPage , SubPage , TripDetails , TripListView
  • needToPrintClipboardFormat : SampleState , MainPage
  • networkAccountWatcher : AccountWatcher
  • newButtonText : sealed
  • NewItems : Scenario1 , Scenario2
  • Next : RenderBuffer
  • next : List< T >::Node
  • NextButtonVisibilityProperty : StepsControl
  • nextId : AdvertisementWrapper
  • nextSegmentIndex : LiveSourceBufferManager
  • nextSegmentNumber : LiveSourceBufferManager
  • nextWindowId : sealed , Scenario3_UsingWindows
  • NFC_PROV_MESSAGE_CURRENT_VERSION : Scenario1
  • NFC_PROV_MESSAGE_LEADING_BYTE : Scenario1
  • NFC_PROV_MESSAGE_PROTOCOL_NAME : Scenario1
  • NoAlbumArt : Errors
  • NoCaptureDevicesHResult : sealed , AudioCapturePermissions
  • NoExifThumbnail : Errors
  • NoIcon : Errors
  • NoImages : Errors
  • norm : BasicVertex
  • normal : VertexPositionNormalColor , PNTVertex
  • normalStride : SurfaceMeshProperties
  • normalToWorld : ModelNormalConstantBuffer
  • notes : Trip
  • NoThumbnail : Errors
  • notificationsGroup : Scenario3_Notifications , sealed
  • notificationsToken : Scenario2_Client
  • NTE_DEVICE_NOT_FOUND : Scenario1_ProvisionTPM
  • NTE_DEVICE_NOT_READY : Scenario1_ProvisionTPM
  • NTE_NO_KEY : Util
  • NTE_PERM : Util
  • NullEmployee : OtherBindings , Functions , BasicTests
  • NullStringProperty : Functions , OtherBindings , BasicTests
  • numberIconReferences : Scenario7 , sealed
  • NumberOfPhotos : sealed , PhotosPrintHelper
  • NumberOfTimesToWrite : Sync
  • NumDownloads : Scenario7_DownloadReordering , sealed
  • numInputReportEventsReceived : sealed , InputReportEvents
  • numInterruptsReceived : Scenario3_InterruptPipes
  • NumOfSharesProperty : SocialMediaCounter
  • numProfiles : ImageInfo
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- o -

  • ObjectToPrint : Print3D
  • ocrEngine : DecodeEngine
  • ocrLanguage : OcrCapturedImage , sealed
  • offscreenCanvas : GeneratedBitmapState
  • offscreenDrawingSession : GeneratedBitmapState
  • on_read : PipeEvents
  • on_write : PipeEvents
  • onboardingConfigurationStateKey : AppData
  • onboardingConfigureAuthenticationTypeKey : AppData
  • onboardingConfigurePassphraseKey : AppData
  • onboardingConfigureSsidKey : AppData
  • onboardingLastErrorCodeKey : AppData
  • onboardingLastErrorMessageKey : AppData
  • onebased : Matrix4x4< T >
  • ONEHANDEDSIZE : App
  • OnKeyDownToken : sealed
  • OnLayoutUpdatedToken : sealed
  • OnMediaOpenedToken : sealed
  • OnMTCPointerMovedToken : sealed
  • OnMTCPointerPressedToken : sealed
  • OnMTCPointerReleasedToken : sealed
  • OnMTCPointerWheelChangedToken : sealed
  • OnPlaybackStateChangedToken : sealed
  • OnPointerMovedToken : sealed
  • OnPointerPressedToken : sealed
  • OnPointerReleasedToken : sealed
  • OnPointerWheelChangedToken : sealed
  • op1Characteristic : Scenario3_ServerForeground
  • Op1CharacteristicUuid : Constants
  • op1CharacteristicWriteToken : Scenario3_ServerForeground
  • op2Characteristic : Scenario3_ServerForeground
  • Op2CharacteristicUuid : Constants
  • op2CharacteristicWriteToken : Scenario3_ServerForeground
  • opened : Player
  • openedMediaCount : Scenario3_AdaptiveSync
  • operand1Received : Scenario3_ServerForeground
  • operand2Received : Scenario3_ServerForeground
  • operatorCharacteristic : Scenario3_ServerForeground
  • OperatorCharacteristicUuid : Constants
  • operatorCharacteristicWriteToken : Scenario3_ServerForeground
  • operatorReceived : Scenario3_ServerForeground
  • optedIn : sealed , Scenario1
  • optionalHttpClient : ContentSelector
  • ORGANIZATION_AUTHORITY : sealed
  • Orientation : TrackedPose , sealed , SourceHandler::PositionInformation
  • OrientationChanged : sealed
  • orientationChangedEventToken : sealed , OcrCapturedImage
  • orientationChangedToken : sealed
  • OrientationStatus : TrackedPose
  • orientationToken : sealed
  • originalData : ScenarioContext
  • originalPosition : Scenario04
  • OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME : LoggingSessionScenario , FileLoggingSessionScenario
  • outputDevices : Scenario2_DeviceCapture
  • outputLog : ViewModelBase
  • outputStream : sealed , RemotePeer
  • overflow : DynamicCommandBar , sealed
  • overlayVideoFile : sealed , Scenario4_AddOverlays
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- z -

  • z : Vector3< T > , Vector4< T >
  • zerobased : Matrix4x4< T >
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- a -

  • A : ColorBGRA
  • a : Print3D , Vector4< T >
  • AAD_CLIENT_ID : sealed
  • AAD_SCOPE_REQUESTED : sealed
  • ABitMask : DDS_PIXELFORMAT
  • abortButtonId : sealed , Scenario5
  • ABSOLUTE_FILE_NAME : ScenarioElement
  • accelerometer : sealed , Scenario5_DataEventsBatching
  • Accelerometer : Scenario1_BackgroundTask , Scenario1_DeviceUse
  • accelerometerOriginal : Scenario4_OrientationChanged , sealed
  • accelerometerReadingTransform : sealed , Scenario4_OrientationChanged
  • accessChangedToken : Scenario1_Check
  • accessibility : sealed , Scenario11
  • AccountClientId : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • accountList : UserSelect
  • accountListView : UserSelect
  • ACCOUNTS_CONTAINER : sealed
  • AccountsContainer : MultipleAccountsScenario
  • AccountScopeRequested : SingleAzureADScenario , SingleMicrosoftAccountScenario
  • actionTransitionFunctions : sealed
  • activated : VideoChat
  • Activated : App
  • ActivatedEventArgs : App
  • activatedToken : SampleState
  • activeAccount : Content
  • activeCastConnectionHandler : Scenario06
  • ActiveChallenge : DAL::RegisteredUser
  • activeDevice : Scenario05 , Scenario06
  • activeDeviceInformation : Scenario03
  • activeDialDevice : Scenario03
  • activeDownload : SourceBufferManager
  • activeDownloads : sealed , Scenario1_Download
  • activeGamePad : PlaybackPage
  • ActiveGroupings : Scenario4_CharacterGrouping
  • activeItemIndex : sealed , Scenario1_EventAndMenuHookup
  • activeToolChangedToken : sealed
  • ActivitySensorClassId : Scenario1_CurrentActivity , Scenario2_History , Scenario3_ChangeEvents , Scenario4_BackgroundActivity
  • actualRpcCallbackRate : sealed , ServiceViewModel
  • adapter : sealed , Scenario2 , sealed , WiFiNetworkDisplay
  • adaptiveContentModels : ContentSelector
  • adaptiveMediaSource : Scenario3_RequestModification , Scenario4_Tuning
  • adaptiveMediaSourceLogger : Scenario3_RequestModification , Scenario4_Tuning , Scenario5_Metadata , Scenario6_AdInsertion , Scenario7_LiveSeekableRange , Scenario2_EventHandlers
  • addAccountLaunched : sealed
  • addTripCommand : sealed , TripListViewModel
  • ADMIN_KEY_LENGTH_IN_BYTES : MainPage
  • adminkey : MainPage
  • advertiser : AdvertisementWrapper
  • advertisers : WiFiDirectServiceManager
  • adxl345Sensor : sealed , Scenario1_ReadData
  • Aes : AdaptiveContentModel
  • AesToken : AdaptiveContentModel
  • AID_MC : SetCardDataScenario
  • AID_NONPAYMENT : SetCardDataScenario
  • AID_PPSE : SetCardDataScenario
  • AID_V : SetCardDataScenario
  • AllItems : Scenario2 , Scenario3 , Scenario1 , Scenario2
  • amplitude : RippleEffect
  • Amplitude : ToneSampleGenerator::SineSampleInfo
  • ANIMATION_OPACITY_END : SecondaryViewPage
  • ANIMATION_OPACITY_START : SecondaryViewPage
  • ANIMATION_TRANSLATION_END : SecondaryViewPage
  • ANIMATION_TRANSLATION_START : SecondaryViewPage
  • animationCompleteEvent : Scenario3
  • animationTask : Scenario3
  • APP_SPECIFIC_PROVIDER_ID : sealed
  • APP_SPECIFIC_PROVIDER_NAME : sealed
  • APP_TITLE : MainPage
  • AppBarTileId : SampleHelpers
  • appbarTileId : MainPage
  • appCapture : Scenario3_AppCapture
  • appData : Scenario7_SetVersion
  • appIdUri : Scenario7_B2B
  • ApplicationContentMarginLeft : PrintHelper
  • ApplicationContentMarginTop : PrintHelper
  • applicationResumingToken : OcrCapturedImage
  • applicationSuspendingToken : OcrCapturedImage
  • ApplicationTriggerTaskName : BackgroundTaskSample
  • ApplicationTriggerTaskProgress : BackgroundTaskSample
  • ApplicationTriggerTaskRegistered : BackgroundTaskSample
  • ApplicationTriggerTaskResult : BackgroundTaskSample
  • appResumeEventHandler : EventHandlerForDevice , DeviceConnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect
  • appResumeEventToken : sealed
  • AppSpecificProviderId : MultipleAccountsScenario , SingleAccountScenario
  • AppSpecificProviderName : MultipleAccountsScenario , SingleAccountScenario
  • appStore : Scenario1_MoveCertificate
  • appSuspendCallback : EventHandlerForDevice
  • appSuspendEventHandler : DeviceConnect , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice
  • appSuspendEventToken : sealed
  • appViewConsolidated : AppView
  • appWindow : Scenario4_CompactOverlay , Scenario5_RelativePositioning , Scenario1_SecondaryWindow , Scenario2_DisplayRegion , Scenario3_Size
  • appWindowFrame : Scenario3_Size , Scenario5_RelativePositioning , Scenario4_CompactOverlay , Scenario2_DisplayRegion , Scenario1_SecondaryWindow
  • areControlsInTitleBar : SampleState
  • arguments : Scenario1
  • arraySize : DDS_HEADER_DXT10
  • aspectRatio : sealed::StreamFilteringCriteria
  • aStreams : StspDescription
  • attachreferenceFrame : HolographicApp1Main , _360VideoPlaybackMain
  • attributes : MediaTypeValidationDescriptor
  • audioExtensions : MainPage
  • audioExtensionsInner : MainPage
  • AudioMimeType : Manifest
  • authenticationContext : Scenario3_ForegroundApp
  • AuthenticationHost : ConfigStore
  • AUTHORITY_SUBCONTAINER : sealed
  • AuthoritySubContainer : MultipleAccountsScenario
  • AuthorizationHeader : AddAuthorizationHeaderFilter
  • authzInProgress : Scenario1_Facebook
  • autoFire : GameConfig
  • availabilityChangedRevoker : LampArrayInfo
  • availabilityStartTime : Manifest
  • availableNetwork : WiFiNetworkDisplay
  • averageContainerHeight : sealed , ChatListView
  • AzureActiveDirectoryAuthority : SingleAccountScenario , DefaultAccountScenario , MultipleAccountsScenario
  • AzureActiveDirectoryClientId : DefaultAccountScenario , MultipleAccountsScenario , SingleAccountScenario
  • AzureActiveDirectoryScopeRequested : MultipleAccountsScenario , SingleAccountScenario , DefaultAccountScenario
  • AzureADAuthority : SingleAzureADScenario
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- b -

  • B : ColorBGRA
  • b : Print3D , Vector4< T > , Vector3< T >
  • BackBufferDxgiFormat : CameraResources
  • BackBufferRenderTargetView : CameraResources
  • BackBufferTexture2D : CameraResources
  • BACKGROUND_ENTRY_POINT : ScenarioElement
  • BACKGROUND_TASK_NAME : ScenarioElement
  • BackgroundAuthenticationCompleted : ScenarioCommon
  • backgroundAvailable : GameConfig
  • backgroundSyncTaskRegistration : Scenario7_SyncDevice
  • backgroundTask : Provider
  • BackgroundTaskEntryPoint : Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioCommon , RegisterWithBackgroundTask
  • BackgroundTaskGroupFriendlyName : BackgroundTaskSample
  • BackgroundTaskGroupId : BackgroundTaskSample
  • backgroundTaskInstance : AdvertisementWatcherTask , AdvertisementPublisherTask , IoSyncBackgroundTask
  • BackgroundTaskName : Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , Scenario3_BackgroundTask , Scenario5_GeofenceBackgroundTask , Scenario8_VisitsBackgroundTask , ScenarioCommon , RegisterWithBackgroundTask
  • backgroundTaskName : sealed , Scenario3_BackgroundDeviceWatcher
  • BackgroundTaskName : Scenario3_BackgroundTask
  • backgroundTaskRegistered : sealed , Scenario4_BackgroundPedometer
  • backgroundTaskRegistration : sealed , Scenario3_BackgroundDeviceWatcher
  • BADGE_TILE_ID : Scenario3_SecondaryTiles
  • bag : FxCompile
  • barcodeScannerInstance1 : Scenario2_MultipleScanners
  • barcodeScannerInstance2 : Scenario2_MultipleScanners
  • barcodeScanners : Scenario5_DisplayingBarcodePreview
  • baseUri : Scenario3_Notifications
  • baseUrl : Manifest
  • baseVideoFile : sealed , Scenario4_AddOverlays
  • BATCHSIZE : FileDataSource
  • BaudRate : DeviceConfiguration
  • BBitMask : DDS_PIXELFORMAT
  • Bcp47ToRecognizerNameDictionary : sealed
  • beginTimeOfRecordedSession : sealed , Scenario9
  • beginTimeOfReplay : sealed , Scenario9
  • biography : Contact
  • bitmap : OcrFileImage , sealed
  • bitmapHeight : GeneratedBitmapState
  • bitmapWidth : GeneratedBitmapState
  • bitrate : MediaSegmentInformation
  • bitrateHelper : Scenario2_EventHandlers , Scenario4_Tuning
  • bitsPerChannel : ImageInfo
  • bitsPerPixel : ImageInfo
  • bluetoothDevice : Scenario1_ChatClient
  • bluetoothLeDevice : Scenario2_Client
  • bottom : ElementMargin
  • BottomLeft : Stroke::Square
  • BottomRight : Stroke::Square
  • boundingRect : Scenario2 , sealed
  • BreadBaked : IOven , sealed
  • BreakSignalState_false : DeviceConfiguration
  • BreakSignalState_true : DeviceConfiguration
  • broker : ProjectionViewPage
  • brush : Shape , RectRenderer
  • Buffer : RenderBuffer
  • buffer : TextureData
  • Buffer : RenderBuffer
  • BufferSize : RenderBuffer
  • BulkInPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • BulkOutPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • BusAttachmentMap : AllJoynBusObjectManager
  • busy : Scenario3_ClientAuthentication , sealed , Scenario1_TrackInWebcam , Scenario1_UTF8 , Scenario4_PartialReadWrite , Scenario2_Binary
  • buttonAWasPressedLastFrame : BasicHologramMain::GamepadWithButtonState , HolographicTemplateAppMain::GamepadWithButtonState
  • ButtonDataMask : SuperMutt::ReadWriteBufferControlInformation
  • ButtonNameDisableReconnectToDevice : Scenario1_ConnectDisconnect , sealed , Scenario1_ConnectDisconnect , DeviceConnect
  • ButtonNameDisconnectFromDevice : Scenario1_ConnectDisconnect , sealed , Scenario1_ConnectDisconnect , DeviceConnect , Scenario1_ConnectDisconnect
  • ButtonUsageId : SuperMutt::ReadWriteBufferControlInformation
  • ButtonUsagePage : SuperMutt::ReadWriteBufferControlInformation
  • BytesFilled : RenderBuffer
  • BytesPerMegaByte : Scenario5_RandomAccess , sealed
  • bytesPerPixel : TextureData
  • bytesPerRow : sealed , ReadBytes
  • bytesPerSegment : sealed , ReadBytes
  • BytesToWriteAtATime : Sync
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- c -

  • c : unique_disabled_control
  • c_cubeIndices : SceneObject
  • c_cubeVertices : SceneObject
  • c_lerpRate : QuadRenderer , SpinningCubeRenderer , QuadRenderer
  • c_maxFadeTime : QuadRenderer
  • c_maxInactiveMeshTime : RealtimeSurfaceMeshRenderer
  • c_surfaceMeshFadeInTime : RealtimeSurfaceMeshRenderer
  • cacheBlocks : ItemCacheManager< T >
  • cachedFileUpdaterUI : CachedFileUpdaterPage
  • cachedResults : ItemCacheManager< T >
  • CalcServiceUuid : Constants
  • CALIBRATION_POPUP_AUTO_DIMSMISS_TIME : CalibrationBar
  • CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS : sealed
  • calibrationBar : sealed , Scenario3_Calibration
  • CallbackCount : sealed
  • CameraButtonPressCount : Scenario1_Basics
  • cameraPosition : ViewProjectionConstantBuffer
  • cameraResourcesDictionary : DeviceResources
  • cameraResourcesLock : DeviceResources
  • Cancel : Errors
  • cancelIoLock : Scenario4_BulkPipes
  • cancellationToken : sealed
  • cancellationTokenSource : sealed , IoSyncBackgroundTask , Scenario4_BulkPipes , SavingDataReason , MultipleTasks
  • CancelReason : sealed
  • cancelReason : RfcommServerTask
  • cancelRequested : RfcommServerTask
  • CancelRequested : sealed
  • cancelSource : sealed , DeviceEvents
  • cancelTokenSource : ItemCacheManager< T >
  • canCommitDirect3D11DepthBuffer : HolographicTemplateAppMain
  • canExecute : RelayCommand
  • CanExecuteChanged : sealed
  • canGetDefaultHolographicDisplay : HolographicTemplateAppMain
  • canGetHolographicDisplayForCamera : HolographicTemplateAppMain
  • CanPair : DeviceInformationDisplay
  • canSkipNext : PlayerViewModel
  • canSkipPrevious : PlayerViewModel
  • canvasDevice : GeneratedBitmapState
  • caps : DDS_HEADER
  • caps2 : DDS_HEADER
  • caps3 : DDS_HEADER
  • caps4 : DDS_HEADER
  • Captions : AdaptiveContentModel
  • CaptureFileName : MainPage::AdvancedCaptureContext
  • CaptureOrientation : AdvancedCaptureContext , MainPage::AdvancedCaptureContext
  • cashDrawerInstance1 : sealed , Scenario3_MultipleDrawers
  • cashDrawerInstance2 : sealed , Scenario3_MultipleDrawers
  • cAttributes : MediaTypeValidationDescriptor
  • cbAttributesSize : StspStreamDescription
  • cbDataSize : StspOperationHeader
  • center : RippleEffect
  • centerX : PlaybackPage
  • centerY : PlaybackPage
  • CERTAINTY_CAP : sealed , MainPage
  • channel : FileLoggingSessionScenario , LoggingSessionScenario
  • ChannelCount : ToneSampleGenerator::SineSampleInfo
  • channelLoggingLevel : FileLoggingSessionScenario , LoggingSessionScenario
  • chatService : Scenario1_ChatClient
  • chatSocket : Scenario1_ChatClient
  • chatWriter : Scenario1_ChatClient
  • checkBoxStyle : sealed , Scenario1_Basic
  • chunkSize : sealed , ReadBytes
  • circleCenter : sealed , Scenario8
  • circleStrokeThickness : sealed , Scenario8
  • claimedBarcodeScannerInstance1 : Scenario2_MultipleScanners
  • claimedBarcodeScannerInstance2 : Scenario2_MultipleScanners
  • claimedCashDrawerInstance1 : sealed , Scenario3_MultipleDrawers
  • claimedCashDrawerInstance2 : sealed , Scenario3_MultipleDrawers
  • claimedDrawer : sealed , Scenario1_OpenDrawer , Scenario2_CloseDrawer
  • ClaimedPrinter : MainPage
  • claimedPrinter : sealed
  • claimedScanner : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes , Scenario5_DisplayingBarcodePreview
  • ClarityValue : PhotoAdjustmentProperties
  • ClassName : Scenario
  • clickDelegate : EventTests
  • ClientCertFriendlyName : Scenario3_ClientAuthentication
  • ClientCertIssuerName : Scenario3_ClientAuthentication
  • ClientCertPassword : Scenario3_ClientAuthentication
  • ClientCertUriPath : Scenario3_ClientAuthentication
  • clientId : Scenario7_B2B
  • clientSecret : Scenario7_B2B
  • clipboardContentChangedToken : SampleState
  • clustersForZoomLevel : sealed , Scenario7
  • cMovementMetersPerSecond : sealed
  • cNumStreams : StspDescription
  • CO2LevelKey : Scenario1_DataEvents , Scenario2_Polling
  • color : VertexPositionColor , ModelColorConstantBuffer , VertexPositionColor , VertexPositionNormalColor , VertexPositionColor , VertexPositionColorTex , ModelColorConstantBuffer , VertexPositionColor , CustomEffectState , Vector2< T > , Vector3< T > , Vector4< T > , ModelConstantBuffer
  • ColorEntries : Functions
  • colorFadeFactor : ModelNormalConstantBuffer
  • colorLookup : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • colorNames : ColorToStringConverter
  • ColorRampDuration : Scenario2_Effects
  • ColorSpaceProperty : sealed , Scenario3
  • colorValues : ColorToStringConverter
  • commandMode : TripVoiceCommand
  • commonMediaPlayer : MainPage
  • compass : sealed
  • composition : sealed , Scenario1_TrimAndSaveClip , Scenario2_AppendClips , Scenario3_AddAudioTracks , Scenario4_AddOverlays
  • compressedData : ScenarioContext
  • compressor : ScenarioContext
  • config : Scenario2_SystemDefaultMenu
  • confirmPinTaskSrc : Scenario9_CustomPairDevice , sealed , Scenario9_CustomPairDevice
  • connected : sealed
  • ConnectedDevices : Scenario1_Advertiser
  • connectedSessions : WiFiDirectServiceManager
  • connectedSocket : Scenario1_Send
  • ConnectEntryPoint : Constants
  • connection : Scenario02 , KeepConnectionOpenScenario , RandomNumberGeneratorTask , Provider , Scenario3
  • ConnectionResultReceived : IOnboardingLegacySignals , IOnboardingSignals
  • ConnectTaskName : Constants
  • consolidated : ViewLifetimeControl
  • CONSUMER_AUTHORITY : sealed
  • ConsumerAuthority : SingleMicrosoftAccountScenario
  • ContactEmail : Constants
  • ContactFirstName : Constants
  • ContactImageSource : Constants
  • ContactLastName : Constants
  • ContactListName : Constants
  • ContactPhone : Constants
  • ContactRemoteId : Constants
  • Contacts : Scenario4_EdgeTappedListView , Scenario3_MasterDetail , Scenario4_EdgeTappedListView , Scenario3_MasterDetail
  • containerName : Scenario3_SettingContainer
  • ContentManagementSystemStub : MainPage
  • ContentMinWidthProperty : DynamicCommandBar
  • ContentStream : DEVICEPROPS
  • contentTypeFilder : Scenario1
  • context : sealed
  • continueButtonId : Scenario5 , sealed
  • continuousRecognitionCompletedToken : sealed
  • continuousRecognitionResultGeneratedToken : sealed
  • ContrastValue : PhotoAdjustmentProperties
  • controller : Scenario2_SystemDefaultMenu , sealed
  • Controller : Scenario1_EventAndMenuHookup
  • conversation : sealed , Scenario2_Load
  • coord : Vector3< T > , Vector4< T > , Vector2< T >
  • coordinateSystem : SurfaceMeshProperties
  • CopyrightProperty : sealed , Scenario3
  • coreDispatcher : MidiDeviceWatcher
  • coreInput : sealed
  • coreTitleBar : CustomTitleBar , sealed
  • coreWetStrokeUpdateSource : sealed , Scenario8
  • cortanaContext : AdventureWorksVoiceCommandService
  • cortanaResourceMap : AdventureWorksVoiceCommandService
  • cPixelsToMeters : sealed
  • cPixelsToMetersPerSecond : sealed
  • cPixelsToRadians : sealed
  • cPixelsToRadiansPerSecond : sealed
  • createdShaders : AppView
  • CreateMediaPlaybackItem : ContentSelector
  • createShaders : AppView
  • criticalSection : LowLatencyInputMain
  • critSec : sealed
  • cRotationRadiansPerSecond : sealed
  • cts : Scenario1_Download , Scenario12_DisableCookies , Scenario1 , Scenario15_ServerCertificateValidation , Scenario03_GetList , Scenario04_PostText , Scenario05_PostStream , Scenario08_PostCustomContent , Scenario14_MeteredConnectionFilter , Scenario2_Upload , Scenario01_GetText , Scenario02_GetStream , Scenario13_RetryFilter , Scenario06_PostMultipart , Scenario07_PostStreamWithProgress , Scenario09_GetCookie
  • ctsForAppHttpClientForKeys : Scenario3_RequestModification
  • ctsForInboundBitsPerSecondUiRefresh : Scenario4_Tuning
  • cumulativeTransform : sealed , ManipulationInputProcessor
  • currChunk : sealed
  • Current : MainPage , FileOpenPickerPage , FileSavePickerPage , CachedFileUpdaterPage
  • currentActiveSampleIndex : AudioEchoEffect
  • CurrentApp : SampleState
  • currentEncodingProperties : AudioEchoEffect
  • currentFeed : sealed , S1_GetAFeed
  • currentFeedback : Scenario4_InteractionFeedback , Scenario3_InkingFeedback
  • currentItemIndex : S1_GetAFeed , sealed , MediaListViewModel , Scenario1
  • currentMessageType : Scenario3_SendMIDIMessages
  • currentMidiOutputDevice : Scenario3_SendMIDIMessages
  • currentOperation : Scenario1_ExampleOperations
  • currentPackage : Scenario1_Print
  • currentPageDescription : PhotosPrintHelper
  • currentState : Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , LowLatency
  • currentTransferCancelToken : Scenario1
  • currentUiccApp : SimCard
  • currentValue : Scenario2_Listen , sealed
  • CustomDataTypeGuid : PoseTrackingFrameHeader
  • CustomEffectFrameCount : Scenario2_Effects
  • customItem : Scenario2_SystemDefaultMenu
  • customSensor : Scenario2_Polling , Scenario1_DataEvents
  • customTitleBar : SampleState
  • customTriggerTaskName : CustomTrigger
  • cw : PlaybackControl
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- d -

  • d : MediaSegment
  • d2dFactory : DeviceResources
  • D2DFactory : DeviceResources
  • d2dFactory : DeviceResources
  • d3dBackBuffer : CameraResources
  • d3dContext : DeviceResources
  • d3dDepthBuffer : CameraResources
  • d3dDepthStencilView : CameraResources
  • d3dDevice : DeviceResources
  • D3DDevice : DeviceResources
  • D3DDeviceContext : DeviceResources
  • D3DDeviceFeatureLevel : DeviceResources
  • d3dDeviceSupportsVprt : DeviceResources
  • D3DDeviceSupportsVprt : DeviceResources
  • d3dFeatureLevel : DeviceResources
  • d3dInteropDevice : DeviceResources
  • D3DInteropDevice : DeviceResources
  • d3dInteropSurface : VideoRenderer
  • d3dRenderTargetSize : CameraResources
  • d3dRenderTargetView : CameraResources
  • d3dViewport : CameraResources
  • data : EmployeeCollection , EmployeeDictionary , VeryObservableCollection-g< T >
  • DataBits : DeviceConfiguration
  • dataFormatName : Scenario13_ShareTarget , ShareTarget
  • datagramSocket : SocketWrapper
  • dataReader : SocketReaderWriter
  • DataReaderObject : Scenario3_ReadWrite , Scenario2_LEDTemp
  • DataSizeInBytes : PoseTrackingEntityData
  • dataTransferManager : ShareCustomProvider , SharePage
  • DataTurnOff : SuperMutt::DeviceInputReportControlInformation
  • DataTurnOn : SuperMutt::DeviceInputReportControlInformation
  • DataWriteObject : Scenario3_ReadWrite
  • dataWriter : SocketReaderWriter
  • DataWriterObject : Scenario2_LEDTemp
  • dateAccessedProperty : Scenario6
  • dateFormatInfo : AdventureWorksVoiceCommandService
  • ddspf : DDS_HEADER
  • decodeEngine : Provider
  • decompressedData : ScenarioContext
  • DEFAULT_ACCOUNT_PROVIDER_ID : sealed
  • DEFAULT_CHANNEL_NAME : FileLoggingSessionScenario , LoggingSessionScenario
  • DEFAULT_DPI : DeviceResources
  • DEFAULT_SESSION_NAME : FileLoggingSessionScenario , LoggingSessionScenario
  • DEFAULT_TITLE : Scenario1
  • defaultAccount : DefaultAccountScenario
  • defaultContextForCurrentView : Scenario7 , sealed
  • defaultDwellTime : Scenario4_ForegroundGeofence
  • defaultMode : LowLatency
  • DefaultOutputSize : sealed
  • defaultProvider : DefaultAccountScenario
  • DefaultProviderId : DefaultAccountScenario
  • defaultViewModel : MainPage , sealed , TripDetails , TripListView
  • Deferral : Scenario1_BackgroundTask
  • deferral : Provider , RfcommServerTask , IoSyncBackgroundTask
  • degreesPerSecond : SpinningCubeRenderer
  • deleteResult : Scenario1
  • deleteTripCommand : sealed , TripViewModel
  • deltaTransform : sealed , Scenario4 , ManipulationInputProcessor , Scenario5_InkingAndInteractionFeedback
  • depth : DDS_HEADER
  • Depth : Dimensions
  • depthImage : GpuCoordinateMapper::RasterizedFrameBlob
  • depthIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • depthRangeMaximumInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • depthRangeMinimumInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • depthScaleInMeters : GpuCoordinateMapper::RasterizedFrameBlob
  • DepthStencilView : CameraResources
  • depthToSource : GpuCoordinateMapper::RasterizedFrameBlob
  • depthToTarget : GpuCoordinateMapper::RasterizedFrameBlob
  • depthUnprojectionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • Description : PresentationFormats
  • description : Trip
  • descriptorType : DescriptorTypeEntry
  • DesiredReportInterval : Scenario1_DataEvents
  • desiredReportInterval : sealed , Scenario5_DataEventsBatching , Scenario1_DataEvents
  • desiredReportIntervalMs : sealed , Scenario1_DataEvents
  • desiredReportLatency : sealed , Scenario5_DataEventsBatching
  • destination : TripVoiceCommand , Trip
  • destinationValidationError : sealed , TripViewModel
  • determinedStartingSegmentIndex : LiveSourceBufferManager
  • device : EventHandlerForDevice , LowLatency , VideoChat , SendTextMessage
  • Device : DeviceListEntry
  • device : sealed , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , IoSyncBackgroundTask , DeviceListEntry , EventHandlerForDevice , DeviceListEntry
  • deviceAccessChangedEventToken : sealed
  • deviceAccessEventHandler : EventHandlerForDevice
  • deviceAccessInfo : sealed
  • deviceAccessInformation : sealed , EventHandlerForDevice , Scenario1_DataEvents , Scenario2_Polling , EventHandlerForDevice , Scenario1_Events , EventHandlerForDevice
  • deviceAccountId : BroadbandDevice , GetConnectionProfiles , ShowConnection
  • deviceAddedEventHandler : EventHandlerForDevice
  • deviceAddedEventToken : sealed
  • DeviceChanged : sealed
  • deviceChanged : DeviceWatcherHelper
  • deviceCloseCallback : sealed , EventHandlerForDevice
  • deviceConnectedCallback : sealed , EventHandlerForDevice
  • deviceId : MainPage
  • deviceInfo : RfcommChatDeviceDisplay , sealed , MainPage , DiscoveredDevice , DiscoveredDeviceWrapper
  • deviceInformation : sealed , EventHandlerForDevice , OnDeviceConnectedEventArgs , EventHandlerForDevice , OnDeviceConnectedEventArgs , EventHandlerForDevice
  • deviceInformationCollection : MidiDeviceWatcher
  • deviceInformationKind : sealed , Scenario5_GetSingleDevice
  • deviceInputNode : Scenario2_DeviceCapture
  • DeviceInstanceId : DeviceProperties
  • DeviceInterfaceClass : SuperMutt
  • DeviceInterfaceGuid : Fx2Driver
  • DeviceName : BarcodeScannerInfo , DAL::RegisteredUser , RegisterMessage
  • deviceOutput : Scenario1_FilePlayback
  • deviceOutputNode : Scenario5_InboxEffects , Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario4_Submix , Scenario6_CustomEffects
  • DevicePid : OsrFx2 , SuperMutt
  • deviceRemovedEventHandler : EventHandlerForDevice
  • deviceRemovedEventToken : sealed
  • deviceResources : RectRenderer , _360VideoPlaybackMain , AppView , VideoRenderer , HolographicApp1Main , AppView , HolographicTemplateAppMain , SpinningCubeRenderer , LowLatencyInputMain , sealed
  • deviceSelected : BroadbandDevice
  • deviceSelector : sealed , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice , DeviceListEntry , EventHandlerForDevice
  • deviceSyncDetails : IoSyncBackgroundTask
  • DeviceType : Fx2Driver
  • DeviceVid : SuperMutt , OsrFx2
  • deviceWatcher : sealed , DeviceWatcherHelper
  • DeviceWatcher : DeviceWatcherHelper
  • deviceWatcher : Scenario1_Discovery , Scenario1_ChatClient , EventHandlerForDevice , MidiDeviceWatcher , EventHandlerForDevice
  • deviceWatcherAddedToken : Scenario1_Discovery
  • deviceWatcherEnumerationCompletedToken : Scenario1_Discovery
  • deviceWatcherHelper : Scenario8_PairDevice , sealed , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario9_CustomPairDevice , Scenario2_DeviceWatcher , Scenario6_CustomFilterAddedProps , Scenario9_CustomPairDevice
  • deviceWatcherHelpers : sealed , Scenario7_DeviceInformationKind
  • deviceWatcherRemovedToken : Scenario1_Discovery
  • deviceWatchers : sealed
  • deviceWatcherStoppedToken : Scenario1_Discovery
  • DeviceWatcherTaskName : Constants
  • deviceWatcherUpdatedToken : Scenario1_Discovery
  • DEVPKEY_AepContainer_Categories : RequiredDeviceProperties
  • DEVPKEY_AepContainer_FriendlyName : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportedUriSchemes : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsAudio : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsImages : RequiredDeviceProperties
  • DEVPKEY_AepContainer_SupportsVideo : RequiredDeviceProperties
  • DEVPKEY_Device_ContainerId : RequiredDeviceProperties
  • DEVPKEY_Device_InstanceId : RequiredDeviceProperties
  • DEVPKEY_DeviceContainer_Manufacturer : RequiredDeviceProperties
  • DEVPKEY_DeviceContainer_ModelName : RequiredDeviceProperties
  • dictatedTextBuilder : Scenario_ContinuousDictation , sealed
  • diffuseColor : ConstantBufferChangesEveryPrim
  • directXGestureRecognizer : sealed
  • disableFollowCircle : Scenario8 , sealed
  • discontinueStroke : sealed , Scenario8
  • discoveredDevices : WiFiDirectServiceManager
  • dismissed : ExtendedSplash
  • Dismissed : MainPage
  • dispatcher : sealed , MediaListViewModel , ServiceViewModel , DeviceWatcherHelper , CachedFileUpdaterPage , FileOpenPicker_PickCachedFile , sealed , RadioModel , FileDataSource , RadioModel , ViewLifetimeControl , Scenario2 , PlaybackSessionViewModel , FileOpenPicker_PickAppFile , PlayerViewModel , FileOpenPicker_PickURLFile , sealed , ViewLifetimeControl , FileSavePicker_FailToSave
  • dispatcherTimer : Scenario2 , Scenario1 , sealed
  • displayChangeToken : sealed
  • displayController : sealed , Scenario3_DisplayOnOff
  • displayInfo : Scenario1_Orientation , sealed
  • displayInformation : OcrCapturedImage , sealed , Scenario4_OrientationChanged
  • displayName : LampArrayInfo
  • DisplayName : AdaptiveContentModel
  • displayName : DeviceInformationKindChoice , UserViewModel , LampArrayInfo , ConnectedDevice , sealed , ProtectionLevelSelectorInfo
  • DisplayName : DiscoveredDevice
  • displayRequest : OcrCapturedImage , Scenario5_DisplayingBarcodePreview , sealed
  • displaySizeInches : STEREO_PARAMETERS
  • disposed : PlaybackSessionViewModel , WiFiDirectServiceManager , Provider , StreamSocketListenerWrapper , SessionWrapper , PlayerViewModel , DiscoveredDeviceWrapper , SocketWrapper , MediaListViewModel , AdvertisementWrapper
  • DmiRevision : RawSMBIOSData
  • document : DashManifestParser
  • Document : FileExtensions
  • done : Scenario1_Basic
  • download : Scenario5_RandomAccess , Scenario6_RecoverableErrors , sealed
  • downloadCancellationTokenSource : Scenario6_RecoverableErrors
  • DownloadCompleted : sealed
  • downloadsCompleted : Scenario4_CompletionGroups
  • dpi : ReinhardEffect , LuminanceHeatmapEffect , RippleEffect , SdrOverlayEffect , FilmicEffect
  • DPI96 : PhotosPrintHelper , sealed
  • DPOnPageName : BasicTests , sealed , OtherBindings
  • drawer : Scenario1_OpenDrawer , sealed , Scenario2_CloseDrawer
  • duration : Period , MediaSegmentInformation
  • durationOfRecordedSession : sealed , Scenario9
  • dwFlagMasks : StspSampleHeader
  • dwFlags : StspSampleHeader
  • dwriteFactory : DeviceResources
  • DWriteFactory : DeviceResources
  • dwriteFactory : DeviceResources
  • dwStreamFlags : MFSampleGenerator
  • dwStreamId : StspStreamDescription , StspSampleHeader
  • dwStreamIndex : MFSampleGenerator
  • DxgiAdapter : DeviceResources
  • dxgiAdapter : DeviceResources
  • dxgiFormat : CameraResources , DDS_HEADER_DXT10
  • dynamicTileId : MainPage
  • DynamicTileId : SampleHelpers
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- e -

  • E_ACCESSDENIED : Scenario2_Client
  • E_BLUETOOTH_ATT_INVALID_PDU : Scenario2_Client
  • E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED : Scenario2_Client
  • E_BOUNDS : Provider
  • E_DEVICE_NOT_AVAILABLE : Scenario2_Client
  • E_INVALID_STATE : Helpers
  • E_INVALIDARG : Scenario1
  • E_NO_UNICODE_TRANSLATION : MainPage
  • E_WINHTTP_CANNOT_CONNECT : JsonRequest
  • E_WINHTTP_CONNECTION_ERROR : JsonRequest
  • E_WINHTTP_NAME_NOT_RESOLVED : JsonRequest
  • E_WINHTTP_TIMEOUT : JsonRequest
  • echoBuffer : AudioEchoEffect
  • echoEffect : Scenario4_Submix
  • echoEffectDefinition : Scenario5_InboxEffects
  • educationKey : User
  • EffectUpdateInterval : Scenario2_Effects
  • ElapsedSeconds : StepTimer
  • elapsedTicks : StepTimer
  • element : sealed , ManipulationInputProcessor , sealed
  • ElementNotFound : sealed , Scenario2_Manage
  • emailConstraint : sealed , Scenario_PauseAsync
  • EmployeePropertyDPName : DataModel
  • Employees : ListsAndTemplates
  • EMPTY_TITLE : SecondaryViewPage
  • enableButton : Print3D
  • enabled : FrameSourceState
  • Encoder : sealed
  • endDate : Trip
  • endTimeOfRecordedSession : sealed , Scenario9
  • EntitiesCount : PoseTrackingFrameHeader
  • EntityId : PoseTrackingEntityData
  • EntityOffsets : PoseTrackingFrameHeader
  • entryName : DescriptorTypeEntry
  • entryTitle : DASHEntry
  • enumerationCompleted : MidiDeviceWatcher
  • eOperation : StspOperationHeader
  • eqEffectDefinition : Scenario5_InboxEffects
  • eraseAllClickedToken : sealed
  • ERROR_INVALID_FUNCTION : FirmwareAccess
  • ERROR_SUCCESS : FirmwareAccess
  • ErrorReceivedEventHandler : Scenario4_Events
  • event : Metering , MFSampleGenerator
  • eventHandlerForDevice : EventHandlerForDevice , sealed , EventHandlerForDevice
  • eventRegistrationToken : sealed
  • events : PipeOut , PipeIn
  • eventToken : sealed
  • execute : RelayCommand
  • executeCallback : sealed
  • expectedRpcCallbackRate : ServiceViewModel , sealed
  • Exponent : PresentationFormats
  • Extension : Scenario3_ReceiveFile
  • externalCamera : OcrCapturedImage , sealed , OcrCapturedImage
  • ExtraParameters : ConfigStore
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- f -

  • FA_E_MAX_PERSISTED_ITEMS_REACHED : Scenario7
  • faceDetector : Scenario2_DetectInWebcam
  • faceTracker : Scenario1_TrackInWebcam
  • FactoryDefault : DefaultKeys
  • fadeOutStoryboard : Scenario3
  • fadeOutToken : Scenario3
  • falToken : sealed , SampleState , MainPage
  • Family : RawSMBIOSSystemInfo
  • FEATURE_NAME : FileSavePickerPage , MainPage , CachedFileUpdaterPage , FileOpenPickerPage
  • fetchDataCallback : ItemCacheManager< T >
  • fgMaskMOG2 : sealed
  • file : sealed , Scenario1_Geotag
  • File : sealed
  • FILE_NAME : ScenarioElement
  • FileAdded : Status
  • FileAddFailed : Status
  • FileGroupEmpty : Errors
  • FileGroupLocation : Errors
  • fileInput : Scenario1_FilePlayback
  • fileInputNode : Scenario5_InboxEffects , Scenario6_CustomEffects
  • fileInputNode1 : Scenario4_Submix
  • fileInputNode2 : Scenario4_Submix
  • fileName : SampleState
  • filename : Scenario1_Files , MainPage
  • fileNotFound404Hresult : Downloader
  • fileOpenPickerUI : FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , FileOpenPicker_PickURLFile , FileOpenPickerPage
  • fileOutputNode : Scenario2_DeviceCapture
  • fileOwnerProperty : Scenario6
  • FileRemoved : Status
  • fileSavePickerUI : FileSavePicker_FailToSave , FileSavePicker_SaveToAppStorage , FileSavePicker_SaveToCachedFile , FileSavePickerPage
  • fileToLaunch : Scenario1_LaunchFile
  • fileUpdateRequest : CachedFileUpdaterPage
  • fileUpdateRequestDeferral : CachedFileUpdaterPage
  • fillBrush : Scenario1_DetectInPhoto
  • fillerText : Conversation
  • filter : Scenario01_GetText , Scenario12_DisableCookies , Scenario15_ServerCertificateValidation
  • First : RecognizedTextRun
  • firstAdapter : Scenario3_RegisterForUpdates , Scenario4_Connect , Scenario2_Scan
  • FirstIndex : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • firstName : Contact
  • firstPage : PrintHelper
  • firstVideoFile : sealed , Scenario2_AppendClips
  • FlaggedItems : Scenario2 , Scenario1
  • flags : DDS_PIXELFORMAT , DDS_HEADER , DDS_PIXELFORMAT
  • fnames : DataModel
  • focalLength : GpuCoordinateMapper::CameraIntrinsics
  • focusPointColor : FocusPointConstantBuffer
  • focusPointDirection : FocusPointConstantBuffer
  • focusPointIntensity : FocusPointConstantBuffer
  • focusPointOrigin : FocusPointConstantBuffer
  • focusPointRadius : FocusPointConstantBuffer
  • followCircle : Scenario8 , sealed
  • forceManipulationsToEnd : sealed , Scenario4
  • format : WICTranslate
  • FormattedTitle : ItemDetails
  • forwardEvents : CaptureDevice
  • fourCC : DDS_PIXELFORMAT
  • FPS : sealed , Scenario9
  • frame : NavigationService , CameraStreamProcessor::FrameData
  • frameArrivedEventToken : FrameSourceState
  • frameCount : StepTimer
  • frameInputNode : Scenario3_FrameInput
  • frameNumber : CustomEffectState , GeneratedBitmapState
  • framePending : CameraResources
  • frameProcessingTimer : Scenario1_TrackInWebcam
  • frameReader : Provider
  • FrameSessionBaseKeyProperty : SuspensionManager
  • FrameSessionStateKeyProperty : SuspensionManager
  • FrameSessionStateProperty : SuspensionManager
  • framesPerSecond : StepTimer
  • framesThisSecond : StepTimer
  • Frequency : ToneSampleGenerator::SineSampleInfo , DEVICEPROPS
  • frequency : RippleEffect
  • fullContact : AppContactPanel
  • FunctionBase : Fx2Driver
  • fVideo : MediaTypeValidationDescriptor
  • Fx2Devices : DeviceList
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- g -

  • G : ColorBGRA
  • g : Print3D , Vector3< T > , Vector4< T > , Vector2< T >
  • gamepad : HolographicTemplateAppMain::GamepadWithButtonState , BasicHologramMain::GamepadWithButtonState
  • gamepads : HolographicTemplateAppMain
  • gattOperandParameters : Constants
  • gattOperatorParameters : Constants
  • gattResultParameters : Constants
  • GBitMask : DDS_PIXELFORMAT
  • GeneratedBitmapEffectFrameCount : Scenario2_Effects
  • generator : sealed , Scenario1_Conversion , Scenario2_Prediction , Scenario3_ReverseConversion
  • GenericFail : Scenario1_Render
  • geofenceMonitor : Scenario4_ForegroundGeofence
  • geolocator : sealed
  • geometryShader : VideoRenderer , SpinningCubeRenderer
  • Geoposition : PlaceLocation
  • getAllHistory : sealed , Scenario2_History
  • GetInterruptMessage : Fx2Driver
  • GetLedBlinkPattern : SuperMutt::VendorCommand
  • GetSevenSegmentDisplay : Fx2Driver
  • gettingFileProperties : FileItem
  • glbName : Scenario1_CreateTile
  • glbUri : Scenario1_CreateTile
  • GlobeString : Scenario4_CharacterGrouping
  • glyphBuffer : sealed , Scenario5_DefiningCustomGlyphs
  • GlyphProperty : TabHeader
  • graph : Scenario1_FilePlayback , Scenario2_DeviceCapture , Scenario3_FrameInput , Scenario4_Submix , Scenario6_CustomEffects , Scenario5_InboxEffects
  • gridSize : Scenario5_InkingAndInteractionFeedback
  • group : sealed , GroupedBackgroundTask
  • GROUP_1 : ScenarioElement
  • GROUP_2 : ScenarioElement
  • GroupedBackgroundTaskName : BackgroundTaskSample
  • GroupedBackgroundTaskProgress : BackgroundTaskSample
  • GroupedBackgroundTaskRegistered : BackgroundTaskSample
  • groupId : Print3D
  • Groups : Scenario4_CharacterGrouping
  • groups : Scenario4_CharacterGrouping
  • GUIDCustomSensorDeviceVendorDefinedTypeID : Scenario1_DataEvents , Scenario2_Polling
  • guidCustomSystemEventId_OsrUsbFx2 : CustomTrigger
  • guidKey : AttributeValidationDescriptor
  • guidSubtype : MediaTypeValidationDescriptor
  • guiMajorType : StspStreamDescription
  • guiSubType : StspStreamDescription
  • gyrometer : sealed
  • gyrometerWindows : sealed , Scenario3_Porting
  • gyrometerWP : sealed , Scenario3_Porting
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- h -

  • Handle : RawSMBIOSTable
  • Handshake : DeviceConfiguration
  • hapticsController : Scenario3_InkingFeedback , Scenario4_InteractionFeedback , Scenario2_SupportedTactileFeedback , Scenario5_InkingAndInteractionFeedback
  • hasAlwaysAllowedAccess : Scenario1_Basics
  • hasCameraButton : Scenario1_Basics
  • hasHardwareDRM : PlayReadyInfoViewModel
  • hasHEVCSupport : PlayReadyInfoViewModel
  • hasLiveOffsetValue : Player
  • hasMinimumUpdatePeriod : Manifest
  • hasMultiplePeriods : Manifest
  • hasOrientationWithOptimizationGoal : Scenario1_Basics
  • hasPeriodStartAttribute : DashManifestParser
  • hasPresentationDuration : Manifest
  • HasRegisteredBackgroundTaskHandler : ScenarioCommon
  • HasValue : SourceHandler::PositionInformation
  • haveSetLiveOffset : LiveDashPlayer
  • haveSetSource : LiveDashPlayer
  • hdcpSession : Scenario3_RequestModification
  • HeaderProperty : TitledImage
  • headers : HttpJsonContent
  • heading : PlaybackPage
  • height : DDS_HEADER
  • Height : Dimensions
  • HiddenFrame : CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • HighlightsValue : PhotoAdjustmentProperties
  • HighPart : LARGE_INTEGER
  • historyEnabledToken : HistoryAndRoaming
  • historyRecords : sealed , Scenario2_History
  • HIT_TARGET : EdgeTappedListView
  • hnsBufferDuration : DEVICEPROPS
  • hnsDesiredLiveOffset : LiveSourceBufferManager
  • hologramColorFadeMultiplier : ModelConstantBuffer
  • holographicCamera : CameraResources
  • HolographicCamera : CameraResources
  • holographicSpace : _360VideoPlaybackMain , AppView , DeviceResources , HolographicApp1Main , AppView , HolographicTemplateAppMain , DeviceResources
  • holographicView : sealed
  • horizontalResolution : sealed::StreamFilteringCriteria
  • horizontalScrollableWindow : Scenario7_ScrollingContentUsingMarquee , sealed
  • hostName : sealed , RemotePeer
  • hr : sealed
  • HResultPrivacyStatementDeclined : sealed , Scenario_SRGSConstraint , Scenario_PredefinedWebSearchGrammar , Scenario_ContinuousDictation , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar
  • HResultRecognizerNotFound : sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint , Scenario_SRGSConstraint , Scenario_ContinuousRecognitionSRGSGrammar
  • hRpcBinding : sealed
  • HsMaskRadiusValue : PhotoAdjustmentProperties
  • htmlFragment : CopyText
  • httpClient : Scenario14_MeteredConnectionFilter , Scenario02_GetStream , Scenario15_ServerCertificateValidation , CommonLicenseRequest , Scenario07_PostStreamWithProgress , Scenario01_GetText , Scenario06_PostMultipart , Scenario13_RetryFilter , Scenario12_DisableCookies , Scenario05_PostStream , Scenario03_GetList , Scenario04_PostText , Scenario08_PostCustomContent , Scenario09_GetCookie
  • httpClientFilter : Scenario3_RequestModification
  • HttpPrefix : DashManifestParser
  • HttpsPrefix : DashManifestParser
  • httpTileSource : sealed , Scenario12
  • htu21dSensor : sealed , Scenario1_ReadData
  • hypothesisGeneratedToken : sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- i -

  • id : FileOpenPicker_PickAppFile , FileOpenPicker_PickCachedFile , LampArrayInfo , Item
  • Id : AdaptiveContentModel
  • id : LampArrayInfo
  • Id : BluetoothLEDeviceDisplay , DeviceListEntry
  • id : FileOpenPicker_PickURLFile , Period
  • Id : DeviceInformationDisplay
  • id : Contact
  • idKey : User , School , User , School
  • Image : FileExtensions
  • IMAGE_COLS : Scenario1_ExampleOperations
  • IMAGE_ENCODING_STRING : sealed
  • IMAGE_ROWS : Scenario1_ExampleOperations
  • imageBase : Scenario1
  • imageFile : sealed , ShareImage
  • imageHeight : GpuCoordinateMapper::CameraIntrinsics
  • imageKind : ImageInfo
  • imageText : CustomOptionsPrintHelper
  • imageWidth : GpuCoordinateMapper::CameraIntrinsics
  • imgSrc : CopyText
  • importedResult : Scenario1
  • importSource : Scenario1
  • inclinometer : sealed
  • IncomingConnectionEvent : sealed
  • index : MainPage , CameraStreamProcessor::FrameData , NfcProvHeader
  • indexBuffer : VideoRenderer , SpinningCubeRenderer
  • IndexBuffer : MeshGeometry
  • indexCount : VideoRenderer , SpinningCubeRenderer , SurfaceMeshProperties
  • IndexCount : MeshGeometry
  • indexFormat : SurfaceMeshProperties
  • indicesCount : Print3D
  • indicesMaterialPrint : Print3D
  • indicesPrint : Print3D
  • informationElements : Scenario1_Advertiser
  • initialize : MainPage
  • initialized : sealed
  • Initialized : PhasingTests
  • initializing : MediaListViewModel
  • Initials : Contact
  • initSegmentUrl : MediaStream
  • inkAnalyzer : Scenario1 , Scenario2
  • inkDrawingAttributesChangedToken : sealed
  • inkPresenter : Scenario1 , Scenario2
  • inkRecognizerContainer : sealed , Scenario4
  • inkReplayTimer : sealed , Scenario9
  • innerFilter : AddAuthorizationHeaderFilter , PlugInFilter
  • inputDevices : Scenario2_DeviceCapture
  • inputElements : WriteReadStream
  • inputLayout : VideoRenderer , SpinningCubeRenderer
  • inputLoopWorker : sealed
  • inputReportEventHandler : InputReportEvents
  • inputReportEventToken : sealed
  • instance : PlaybackService , SettingsService , WiFiDirectServiceManager
  • InstanceId : DeviceListEntry
  • InstructionProperty : InstructionControl
  • interactionManager : SpatialInputHandler
  • interactionMode : sealed , Scenario1_Basic
  • internalAppending : SourceBufferManager
  • InternalReleased : sealed
  • interruptEventHandler : Scenario3_InterruptPipes
  • InterruptInPipeIndex : OsrFx2::Pipe , SuperMutt::Pipe
  • InterruptOutPipeIndex : SuperMutt::Pipe
  • IntField : CSharpModel
  • IntPropertyDPName : DOModel , DataModel
  • INVALID_PUBLISHED_MESSAGE_ID : Scenario1
  • InvalidSize : Errors
  • isAllDevicesEnumerated : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • isAngleDetected : sealed
  • IsAnImportantTransaction : MainPage , sealed , MainPage
  • isApp : sealed
  • isApplicationWindowActive : SampleState , MainPage
  • IsBackground : DEVICEPROPS
  • isBoundRect : sealed , Scenario2
  • isBusy : Scenario1_Discovery , FileLoggingSessionScenario , LoggingSessionScenario , sealed , Scenario1_FindClaimEnable
  • isChannelEnabled : FileLoggingSessionScenario , LoggingSessionScenario
  • isClipboardContentChangedEnabled : SampleState
  • isColorOn : CustomEffectState
  • IsConnectable : BluetoothLEDeviceDisplay
  • IsConnected : BluetoothLEDeviceDisplay
  • IsContentCropped : PageDescription
  • IsCurrent : SourceHandler::PositionInformation
  • IsDataTerminalReady_false : DeviceConfiguration
  • IsDataTerminalReady_true : DeviceConfiguration
  • isDeviceSuccessfullyConnected : OnDeviceConnectedEventArgs
  • isDisposed : FileLoggingSessionScenario , LoggingSessionScenario
  • isEnabled : RadioModel
  • isEnabledAutoReconnect : sealed , EventHandlerForDevice
  • isEndOfStream : SourceBufferManager
  • isFilterUsed : Scenario01_GetText
  • isFirstSegment : SourceBufferManager
  • isFixedTimeStep : StepTimer
  • isFloat : ImageInfo
  • IsGamepadSupported : TransportOptions
  • isHceSupported : ManageCardScenario
  • IsHWOffload : DEVICEPROPS
  • isInBackgroundMode : App
  • isInitialized : SourceBufferManager , sealed , OcrCapturedImage , Scenario1
  • isItemLeftEdgeTapEnabled : EdgeTappedListView
  • isLastKnownFullScreen : sealed , Scenario1_Basic
  • isLaunched : sealed , Scenario1_AddAccount , Scenario2_ManageAccount , Scenario3_FixAccount
  • isListening : Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousDictation , Scenario_PauseAsync
  • isLive : Manifest
  • IsLowLatency : CAPTUREDEVICEPROPS , DEVICEPROPS
  • IsNavigatedAway : Scenario3_ReadWrite , Scenario2_LEDTemp
  • IsNextEnabledProperty : StepsControl
  • IsPaired : DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • isPaused : Player
  • IsPlaying : PlaybackControl
  • isPointerPress : PlaybackPage
  • isPopulatingLanguages : sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint , Scenario_ListConstraint
  • isPreviewing : OcrCapturedImage , sealed
  • isPropertyChangedObserved : sealed
  • IsRawChosen : DEVICEPROPS
  • IsRawSupported : DEVICEPROPS
  • IsReadTaskPending : Scenario3_ReadWrite
  • isRegisteredForInputReportEvents : InputReportEvents , sealed
  • IsRenderingStereoscopic : CameraResources
  • IsRequestToSendEnabled_false : DeviceConfiguration
  • IsRequestToSendEnabled_true : DeviceConfiguration
  • isSelected : Period
  • isSelectionChanging : Scenario5_DisplayingBarcodePreview
  • isStereo : CameraResources
  • isStopPending : Scenario5_DisplayingBarcodePreview
  • isSupported : ServiceViewModel
  • isSupportedProfile : Manifest
  • isSyncing : Scenario7_SyncDevice
  • isTerminator : VideoChat
  • isThisPageActive : Scenario1
  • IsTonePlayback : DEVICEPROPS
  • IsTracked : PoseTrackingEntityData
  • isTrial : GameConfig
  • IsUpperCaseEnabledChanged : ISecureInterfaceConsumer
  • isUpperCaseEnabledPropertyKey : AppData
  • IsValid : AttributeValidationDescriptor
  • isVisibleChangedToken : CustomTitleBar
  • IsWriteTaskPending : Scenario3_ReadWrite
  • item : Scenario5 , Scenario4 , List< T >::Node , ListViewEdgeTappedEventArgs
  • itemCache : FileDataSource2 , FileDataSource
  • itemLeftEdgeTappedEvent : EdgeTappedListView
  • items : Scenario5_RestoreScrollPosition , Scenario6_ScrollIntoView
  • Items : ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
  • itemsResult : Scenario1
  • itemsSeen : ChatListView , sealed
  • itemsToImport : Scenario1
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- p -

  • PackageFamilyName3DBuilder : Scenario2_Launch
  • pageCollection : PhotosPrintHelper
  • pageContent : sealed , CustomTitleBar
  • PageSize : PageDescription
  • paragraphSelected : Scenario2
  • Parity : DeviceConfiguration
  • Password : ConfigStore
  • pausedDueToMute : Scenario1
  • PayloadProperty : PopToastControl
  • pdfDocument : sealed , Scenario1_Render
  • pedometer : Scenario1_Events , sealed
  • PedometerClassId : Scenario1_Events , Scenario2_History , Scenario3_CurrentStepCount
  • penDevice : Scenario2_SupportedTactileFeedback , Scenario3_InkingFeedback , Scenario4_InteractionFeedback , Scenario5_InkingAndInteractionFeedback
  • pendingConnections : Scenario1_Advertiser
  • pendingConnectionsMutex : Scenario1_Advertiser
  • pendingSelectionDeviceId : Scenario5_DisplayingBarcodePreview
  • penSize : sealed , Scenario3 , Scenario8
  • penSizeIncrement : Scenario3 , sealed
  • periodicTimer : RfcommServerTask , sealed , UnspecifiedReason , LocationTrackingReason
  • PeriodicTimer : sealed
  • periods : Manifest
  • periodStart : DashManifestParser
  • peripheralSupported : Scenario3_ServerForeground
  • phase : RippleEffect
  • phContext : sealed
  • phoneConstraint : sealed , Scenario_PauseAsync
  • phoneKey : User
  • phoneNumber : Contact
  • Photo : AdvancedCaptureContext
  • photoScale : PhotosPrintHelper
  • photoSize : PhotosPrintHelper
  • pickedFile : sealed , Scenario1_TrimAndSaveClip , Scenario3_AddAudioTracks
  • picker : Scenario02 , Scenario03 , Scenario05 , Scenario06 , Scenario2
  • picturesLibrary : sealed , Scenario2 , Scenario3
  • PictureViewSize : PageDescription
  • Pid : SuperMutt::Device , ArduinoDevice
  • pin : sealed , Scenario1_GetAndSetPin , AdvertisementWrapper
  • PinChangedEventHandler : Scenario4_Events
  • pinPolicyAllowed : Scenario1_ProvisionTPM
  • pinPolicyAllowedIndex : sealed
  • pinPolicyDisallowed : Scenario1_ProvisionTPM
  • pinPolicyDisallowedIndex : sealed
  • pinPolicyRequireOne : Scenario1_ProvisionTPM
  • pinPolicyRequireOneIndex : sealed
  • pitch : PlaybackPage
  • pitchOrLinearSize : DDS_HEADER
  • pixelResolutionHeight : STEREO_PARAMETERS
  • pixelResolutionWidth : STEREO_PARAMETERS
  • pixelShader : VideoRenderer , SpinningCubeRenderer
  • Places : Cluster
  • places : sealed , Scenario7
  • playbackEnabled : ViewModelBase
  • playbackItem : MediaItemViewModel
  • playbackList : Scenario6
  • playbackSession : PlaybackSessionViewModel
  • PlaybackState : PlaybackSessionViewModel
  • playbackTimer : Player
  • Player : Scenario1
  • player : PlaybackSessionViewModel , PlayerViewModel , LiveDashPlayer
  • playlist : sealed , Scenario3_Add , Scenario1
  • playlistExtensions : MainPage
  • playlistExtensionsInner : MainPage
  • PlayReady : AdaptiveContentModel
  • playReadyChallengeCustomData : PlayReadyHelper
  • playReadyLicenseUrl : PlayReadyHelper
  • playReadySecurityVersion : PlayReadyInfoViewModel
  • PlayReadyWinRTTrustedInput : PlayReadyHelper
  • pMOG2 : sealed
  • pngBytes : Print3D
  • pNode : List< T >::POSITION
  • pointerMovedToken : sealed
  • pointerPressed : HolographicTemplateAppMain
  • pointerPressedToken : sealed
  • pointerReleasedToken : sealed
  • points : sealed
  • popups : sealed , Scenario2
  • port : sealed , RemotePeer , Scenario1_Send , Scenario1_Connect
  • portList : MidiDeviceWatcher
  • pos : VertexPositionColor , VertexPositionTex , VertexPositionColor , VertexPositionTex , VertexPosition , VertexPositionColor , VertexPositionTexture , VertexPositionNormalColor , VertexPositionColor , VertexPositionColorTex , BasicVertex , TangentVertex , VertexPosition , VertexPositionColor , VertexPositionTexture , VertexPositionColor
  • Poses : PoseTrackingEntityData
  • PosesCount : PoseTrackingEntityData
  • PoseSet : PoseTrackingEntityData
  • Position : TrackedPose , SourceHandler::PositionInformation
  • position : VertexPositionTexture , SpinningCubeRenderer , LineSegment , PNTVertex , Contact , SlowInputStream
  • PositionChangeThreshold : Scenario3_AdaptiveSync
  • PositionStatus : TrackedPose
  • Prefix : FileLoggingSessionScenario , LoggingSessionScenario
  • presentationFormat : Scenario2_Client
  • prev : List< T >::Node
  • previewEncodingProperties : LowLatency
  • previewImage : MediaItemViewModel
  • previewImageUri : MediaItem
  • previewTopLeft : Scenario5_InkingAndInteractionFeedback
  • previousDecodeResult : Provider
  • previousInputLanguage : Scenario4 , sealed
  • previousState : LowLatency
  • previousSwitchStates : Scenario3_InterruptPipes
  • previousSwitchValues : sealed , DeviceEvents
  • previousTransform : Scenario4 , Scenario5_InkingAndInteractionFeedback , sealed , ManipulationInputProcessor
  • previousZoomLevel : Scenario7 , sealed
  • principalPoint : GpuCoordinateMapper::CameraIntrinsics
  • printDocument : PrintHelper
  • printDocumentSource : PrintHelper
  • printer : sealed
  • Printer : MainPage
  • printHelper : Scenario3CustomOptions , sealed , Scenario2StandardOptions , Scenario4PageRange , Scenario5Photos , Scenario1Basic , Scenario6DisablePreview
  • printPages : DisablePreviewPrintHelper
  • printPreviewPages : PrintHelper
  • printSync : PhotosPrintHelper
  • privatePropertyChanged : sealed
  • processingScrollOffsets : ChatListView , sealed
  • processingScrollOffsetsDeferred : ChatListView , sealed
  • productId : sealed
  • ProductName : RawSMBIOSSystemInfo
  • Progress : sealed
  • ProjectedPage : ProjectionViewBroker
  • projection : ConstantBufferChangeOnResize
  • ProjectionViewPageControl : ProjectionViewPageInitializationData , MainPage , ProjectionViewBroker , sealed
  • Properties : DeviceInformationDisplay , BluetoothLEDeviceDisplay
  • propertyChanged : DiscoveredDevice
  • PropertyChanged : sealed , ViewModelBase
  • propertyChanged : CustomTitleBar , RadioModel
  • propertyPresence : IsApiPropertyPresentTrigger
  • propertySet : AudioEchoEffect
  • protectedBuffer : Scenario2_Memory
  • protectionLevel : ProtectionLevelSelectorInfo
  • protectionManager : ViewModelBase
  • Protocol : Constants , Scenario4_ReceiveUri
  • providePasswordCredential : Scenario9_CustomPairDevice
  • providePasswordCredentialSrc : sealed
  • providePasswordCredentialTaskSrc : Scenario9_CustomPairDevice
  • providePinTaskSrc : sealed , Scenario9_CustomPairDevice
  • provider : BarcodeDecodeTask
  • PROVIDER_ID_SUBCONTAINER : sealed
  • ProviderIdSubContainer : MultipleAccountsScenario
  • provisioningInfo : Scenario3
  • provisioningPackageFile : Scenario1
  • pSample : MFSampleGenerator
  • PublicKey : DAL::RegisteredUser , RegisterMessage
  • PublicKeyHash : DAL::RegisteredUser
  • PublicKeyHint : UserAndKeyHintMessage
  • publicKeyHint : MainPage
  • PublicKeyHint : SignatureMessage
  • publisher : Scenario2_Connector , Scenario2_Publisher
  • publisherCert : SecureStopViewModel
  • publisherID : SecureStopViewModel
  • publishTime : Manifest
  • pvb : Scenario05 , Scenario06
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- q -

  • qpcFrequency : StepTimer
  • qpcLastTime : StepTimer
  • qpcMaxDelta : StepTimer
  • qpcSecondCounter : StepTimer
  • QuadPart : LARGE_INTEGER
  • QueryCount : GpuPerformanceTimer
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- r -

  • r : Print3D , Vector2< T > , Vector4< T >
  • R : ColorBGRA
  • r : Vector3< T >
  • radialDistortion : GpuCoordinateMapper::CameraIntrinsics
  • radio : RadioModel
  • radius : sealed , Scenario8
  • rand : Conversation
  • random : Contact
  • randomAccessStream : sealed , Scenario5_RandomAccess
  • randomNumberGenerator : RandomNumberGeneratorTask
  • raStream : ScenarioContext
  • RBitMask : DDS_PIXELFORMAT
  • read_bytes : PipeEvents
  • ReadBytesCounter : Scenario3_ReadWrite
  • readCancellationTokenSource : sealed , Scenario5_RandomAccess
  • ReadCancellationTokenSource : Scenario3_ReadWrite , Scenario2_LEDTemp
  • ReadCancelLock : Scenario3_ReadWrite , Scenario2_LEDTemp
  • readCounter : sealed , DeviceReadWrite
  • reader : sealed , Scenario1_ProvisionTPM , Scenario6_DeleteTPM , SocketWrapper , RfcommServerTask , FrameSourceState
  • readingToken : sealed
  • readingTokenOriginal : sealed
  • readingTokenReadingTransform : sealed
  • readOperation : sealed , Scenario5_RandomAccess
  • ReadSwitches : Fx2Driver
  • recognitionOperation : Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint
  • recognizer : sealed , Scenario5 , ManipulationInputProcessor
  • recordCollection : sealed
  • recordingStarted : CaptureDevice
  • recordTimestamp : HistoryRecord
  • recoView : sealed , Scenario4
  • rect : RectRenderer
  • rectSize : RectRenderer
  • rectTransform : RectRenderer
  • refCount : ViewLifetimeControl
  • reference : sealed , ManipulationInputProcessor
  • referenceFrame : HolographicApp1Main
  • registerContentChanged : OtherScenarios
  • registered : sealed , Scenario4_BackgroundActivity , Scenario4_BackgroundProximitySensor
  • registeredCharacteristic : Scenario2_Client
  • registeredDevice : sealed , InputReportEvents
  • registeredForEvents : sealed , Scenario1_Events
  • registeredInterrupt : Scenario3_InterruptPipes
  • registeredInterruptPipeIndex : Scenario3_InterruptPipes
  • released : ViewLifetimeControl
  • releaseDeviceRequestedToken : MainPage , sealed
  • releasedToken : sealed
  • releaseRequestedToken1 : sealed
  • releaseRequestedToken2 : sealed
  • remoteDevice : RfcommServerTask
  • renderLoopWorker : LowLatencyInputMain
  • renderTarget : GpuCoordinateMapper::VisualizeFrameBlob
  • renderTargetDepthBuffer : GpuCoordinateMapper::VisualizeFrameBlob
  • RenderTargetSize : CameraResources
  • reorderGroup : sealed , Scenario7_DownloadReordering
  • repeatPlaylist : Scenario1
  • ReportId
: SuperMutt::LedPattern
, SuperMutt::ReadWriteBufferControlInformation
, SuperMutt::DeviceInputReportControlInformation
  • representationID : MediaSegmentInformation
  • requestCount : PhotosPrintHelper
  • requestInProgress : ItemCacheManager< T >
  • requestList : AdvertisementWrapper
  • requests : ItemCacheManager< T >
  • reserved1 : DDS_HEADER
  • reserved2 : DDS_HEADER
  • resourceDimension : DDS_HEADER_DXT10
  • resourceMap : sealed
  • resultCharacteristic : Scenario3_ServerForeground
  • resultCharacteristicClientsChangedToken : Scenario3_ServerForeground
  • resultCharacteristicReadToken : Scenario3_ServerForeground
  • ResultCharacteristicUuid : Constants
  • resultCollection : sealed , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice , DeviceWatcherHelper , Scenario1_DevicePicker , Scenario2_DeviceWatcher , Scenario4_Snapshot , Scenario5_GetSingleDevice , Scenario6_CustomFilterAddedProps , Scenario7_DeviceInformationKind , Scenario8_PairDevice , Scenario9_CustomPairDevice
  • resultVal : Scenario3_ServerForeground
  • RETRIES : Downloader
  • RetriesPropertyName : HttpRetryFilter
  • reverbEffectDefinition : Scenario5_InboxEffects
  • RfcommChatServiceUuid : Constants
  • rfcommProvider : Scenario2_ChatServer
  • RGBBitCount : DDS_PIXELFORMAT
  • right : ElementMargin
  • roamingEnabledToken : HistoryAndRoaming
  • roleIsActive : VideoChat
  • rootFrame : ExtendedSplash
  • rootFrameNavigationHelper : App
  • rootPage : Scenario6_SecondaryTileNotification , Scenario4_TilePinned , Scenario3_EnumerateTiles , Scenario2_UnpinTile , Scenario1_PinTile , Scenario1_DataEvents , Scenario1_Toggle , Scenario8_UpdateAsync , EventHandlerForDevice , OvenClient , Scenario4_BackgroundProximitySensor , Scenario3_DisplayOnOff , Scenario2_Polling , Scenario1_DataEvents , Scenario3 , Scenario2 , Scenario1 , Scenario3_Choosing , Scenario3_MultipleClaims , Scenario2_PrintReceipt , Scenario1_FindClaimEnable , Scenario5_Clear , Scenario3_Add , Scenario2_Display , VideoChat , SetLockScreenImage , Scenario2_Memory , Scenario1_Files , Scenario4_BackgroundPedometer , Scenario3_CurrentStepCount , Scenario2_History , Scenario1_Events , Scenario2_GetCurrentTextSegmentFromIndex , Scenario2_Manage , Scenario1_Save , Scenario1_ManageHotspot , OcrFileImage , OcrCapturedImage , Scenario6_NumeralSystemTranslation , Scenario4_PartialReadWrite , Scenario3_Full , SimCard , ShowConnection , ModemInformation , ModemDeviceServices , GetConnectionProfiles , BroadbandDevice , AccountWatcher , Scenario1_CreateTile , Scenario3_SendMIDIMessages , Scenario2_ReceiveMIDIMessages , Scenario1_MIDIDeviceEnumeration , DefaultCloseCommand , CustomCommand , CompletedCallback , CancelCommand , Scenario3_FixAccount , Scenario2_Custom , Scenario1_Default , Scenario1 , Scenario4_AddOverlays , Scenario3_AddAudioTracks , Scenario2_AppendClips , Scenario1_TrimAndSaveClip , Scenario1_CreateContact , Scenario1_BankCards , Scenario3_SecondaryTiles , Scenario2_Notifications , sealed , Scenario4_CharacterGrouping , Scenario3_Transliteration , Scenario1_Single , Scenario2_Multiple , Scenario6_ManipulatingCursorAttributes , Scenario5_DefiningCustomGlyphs , Scenario4_UpdatingLineDisplayAttributes , Scenario3_UsingWindows , Scenario2_DisplayText , Scenario1_SelectDisplay , Scenario2_Polling , Scenario1_DataEvents , Scenario3_AvailabilityChanged , Scenario2_EnableSettings , Scenario1_GetLamp , Scenario2_Effects , Scenario1_Basics , UserSelect , SignIn , Scenario9_TransferMediaPlayer2 , Scenario1_ParseAndStringify , Scenario3_Calibration , Scenario2_Polling , Scenario1_DataEvents , Scenario15_ServerCertificateValidation , Scenario14_MeteredConnectionFilter , Scenario13_RetryFilter , S1_AddWithAPI , Scenario11_DeleteCookie , Scenario10_SetCookie , Scenario09_GetCookie , Scenario08_PostCustomContent , Scenario07_PostStreamWithProgress , Scenario06_PostMultipart , Scenario05_PostStream , Scenario1_MultiVideoPlayback , Scenario03_GetList , Scenario02_GetStream , Scenario01_GetText , ScenarioCommon , Scenario3_ForegroundApp , Scenario2_BackgroundTask , Scenario1_Initialization , Scenario3_Porting , Scenario2_Polling , Scenario1_DataEvents , Scenario1_Geotag , Scenario1_Basic , Scenario5_TriggerCFU , Scenario4_SaveFile , Scenario3_SingleFolder , S2_UpdateAndDeleteWithAPI , Scenario1_SingleFile , Scenario8 , MultipleTasks , LocationTrackingReason , SavingDataReason , UnspecifiedReason , Scenario9_ClipboardTarget , S3_RetrieveWithAPI , Scenario7 , Scenario6 , Scenario5 , SingleAccountScenario , Scenario3 , Scenario2 , S4_CheckIndexRevision , Scenario1 , Scenario15_DPLCreateFileEvents , Scenario14_QueryCpPaste , Scenario13_ShareTarget , Scenario12_ShareData , Scenario11_CPDNoUI , Scenario10_CpToClipboard , Scenario3_AppCapture , Scenario9_CustomPairDevice , Scenario8_PairDevice , Scenario7_DeviceInformationKind , Scenario6_CustomFilterAddedProps , Scenario5_GetSingleDevice , Scenario4_Snapshot , Scenario3_BackgroundDeviceWatcher , Scenario2_Polling , S5_AddWithAppContent , ReadBytes , WriteReadStream , Scenario5 , Scenario4 , Scenario3 , Scenario2 , Scenario1 , Scenario2_Twitter , Scenario7_SyncDevice , Scenario6_InterfaceSettings , Scenario5_UsbDescriptors , Scenario4_BulkPipes , Scenario3_InterruptPipes , Scenario2_ControlTransfer , S6_DeleteWithAppContent , CustomException , Scenario4_Events , Scenario3_ReadWrite , Scenario2_ConfigureDevice , Scenario1_ConnectDisconnect , EventHandlerForDevice , Scenario2_Polling , Scenario1_DataEvents , Scenario7_Share , InputReportEvents , S7_RetrieveWithAppContent , DeviceConnect , EventHandlerForDevice , FirmwareAccess , CustomTrigger , DeviceReadWrite , Scenario1_CachedNetworks , DeviceIO , Scenario1_Message , Scenario2 , Scenario5_NavToFiles , Scenario2_MessageCaption , Scenario3_CredentialPickerOptions , Scenario1_DataEvents , DeviceConnect , Scenario1_ConnectDisconnect , SharePage , Scenario3_Flickr , DeviceEvents , Scenario3_ClientAuthentication , Scenario1_Welcome
  • RootPage : Scenario2_Polling
  • rootPage : FeatureReports , Scenario2_DelayMini , Scenario1_Mini , Scenario1_CreateContacts , Scenario1 , sealed , Scenario3_Calibration , OtherScenarios , Scenario3 , CopyText , CopyImage , CopyFiles , Scenario3_UnmanagedConsumable , Scenario3_MultipleDrawers , Scenario2_CloseDrawer , Scenario1_OpenDrawer , Scenario1_Send , Scenario1_Check , Scenario3_AspectRatio , Scenario2_PhotoSettings , Scenario1_PreviewSettings , Scenario3_EnableHdrProfile , Scenario2_ConcurrentProfile , Scenario1_SetRecordProfile , LowLatency , Scenario3_BgChatServer , Scenario2_ChatServer , Scenario1_ChatClient , Scenario5_LaunchedFromSecondaryTile , Scenario2_Client , Scenario1_Discovery , Scenario4_BackgroundPublisher , Scenario1_EventAndMenuHookup , Scenario2_Publisher , Scenario1_Watcher , Scenario3 , Scenario2 , Scenario1 , Scenario1_TrackInWebcam , Scenario2_DetectInWebcam , Scenario1_Create , Scenario1_Configuration , Scenario5_DisplayingBarcodePreview , Scenario4_SymbologyAttributes , Scenario1_Render , Scenario2_MultipleScanners , Scenario1_BasicFunctionality , Scenario7_DownloadReordering , Scenario2_LEDTemp , Scenario5_RandomAccess , Scenario4_CompletionGroups , Scenario3_Notifications , Scenario2_Upload , Scenario1_Download , Scenario1_DeviceUse , GroupedBackgroundTask , Scenario3_Trim , TimeTriggeredTask , ServicingCompleteTask , SampleBackgroundTaskWithCondition , Scenario2_AamvaCards , Scenario6_CustomEffects , LiveDashPlayer , Scenario4_Submix , Scenario2_ScriptDetection , Scenario2_DeviceCapture , Scenario1_FilePlayback , PlaybackControl , Scenario4_ReceiveUri , Scenario3_ReceiveFile , Scenario2_LaunchUri , Scenario1_LaunchFile , Content , KeepConnectionOpenScenario , Scenario6_Recurrence , Scenario5_Show , Scenario12_DisableCookies , Scenario3_Replace , Scenario2_Add , Scenario1_Define , Scenario04_PostText , Scenario7 , Scenario6 , Scenario5 , Scenario4 , Scenario3 , Scenario2 , Scenario13 , Scenario2_MultiFile , Scenario11 , Scenario10 , Scenario1 , Scenario8_ClipboardSource , Scenario1_Metrics , Scenario4 , Scenario2_Polling , Scenario1 , Scenario06 , Scenario05 , Scenario04 , Scenario03 , Scenario02 , Scenario01 , Scenario4_BackgroundActivity , Scenario2_DeviceWatcher , Scenario2_History , Scenario1_CurrentActivity , Scenario5_DataEventsBatching , sealed , Scenario3_Polling , Scenario2_ShakeEvents , Scenario1_DataEvents , Scenario1_UTF8 , InputOutputReports , Scenario1_Print , Scenario2_Binary , Scenario2_Launch , sealed , SingleAzureADScenario , Scenario0_Choose , EventHandlerForDevice , Scenario1_ConnectDisconnect , XSLTTransform , SingleMicrosoftAccountScenario , Scenario4_OrientationChanged , Scenario1_Facebook , Scenario3_AdaptiveSync , Scenario3_ChangeEvents , Scenario1_DevicePicker , Scenario6_DeleteTPM , Scenario1 , Scenario2_Connector , HistoryAndRoaming , SendTextMessage , Scenario1_GetDeviceInformation , Scenario2 , Scenario2_RequestMany , Scenario_ContinuousRecognitionListGrammar , Scenario5 , Scenario4 , Scenario1_ExampleOperations , ConnectionSettingsPanel , Scenario3_ServerForeground , XmlLoading , CustomException , Scenario6_AppListingURI , Scenario3_RegisterForUpdates , Scenario2_Scan , Scenario1_DetectInPhoto , Scenario2 , Scenario3_ActiveSymbologies , Scenario4_Connect , Scenario1 , sealed , MarkHotProducts , OvenClient , ApplicationTriggerTask , WiFiDirectServiceManager , SampleBackgroundTask , Scenario5_InboxEffects , Scenario7_ScrollingContentUsingMarquee , Scenario4_ShowView , CustomFocusVisuals , Scenario1_ListView , OpenCloseConnectionScenario , Scenario2_ManageAccount , Scenario4_Remove , Scenario1 , Scenario9 , Scenario3_CheckUserConsentGroup , Scenario4_ScriptNotify , Scenario3_InvokeScript , Scenario12 , OvenClient , Scenario3_SettingContainer , sealed , Scenario16_NetworkResource , BuildNewRss , DefaultAccountScenario , GiftDispatch , MultipleAccountsScenario , Scenario1_Conversion , Scenario2_Conditional , Scenario10_UnviewableContent , Scenario1ViewModel , Scenario8_TransferMediaPlayer1 , Scenario1_FindUsers , RequestResponse , Scenario2_WatchUsers , Scenario2_Prediction , Scenario2_RequestConsent , CustomException , Scenario1_AddAccount , Scenario5_VerifyResponse , Scenario7_ListAllCards , RegisterWithBackgroundTask , Scenario1_Advertiser , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionSRGSGrammar , Scenario1_TrialMode , Scenario3_BackgroundWatcher , Scenario5_UserCollection , Scenario7_B2B , Scenario1 , ManageCardScenario , Scenario5 , S1_GetAFeed , SocketReaderWriter , Scenario3_FrameInput , Scenario3_ReverseConversion , Scenario1_CheckConsentAvailability , Scenario2_Extend , Scenario1_ProvisionTPM , Scenario2_InAppPurchase , Scenario1_ExtractTextSegments , sealed , Scenario4 , sealed , Scenario6_RecoverableErrors , Scenario4_ConsumableProduct , Scenario2_ChangePIN , Scenario_PauseAsync , Scenario3 , Scenario1_Connect , Scenario3_ResetPIN , Scenario8_TransmitAPDU , Scenario4_ChangeAdminKey
  • rotationDegrees : sealed
  • rotationdelta : PlaybackPage
  • rotationGuid : Scenario5_DisplayingBarcodePreview
  • RotationKey : sealed , MainPage , sealed , MainPage , OcrCapturedImage , sealed , MainPage , sealed
  • RpcClient : _RPC_CLIENT
  • rpcclient : sealed
  • rpcClient : ServiceViewModel
  • rpcDataCountOld : ServiceViewModel , sealed
  • runId : Scenario3_Notifications , sealed
  • running : sealed
  • runningReadTask : Scenario4_BulkPipes
  • runningReadWriteTask : Scenario4_BulkPipes
  • runningStepCount : Scenario1_Events , sealed
  • runningWriteTask : Scenario4_BulkPipes
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- s -

  • s : MediaSegment
  • s_articleProperty : ArticlePage
  • s_containerEventTokensProperty : EdgeTappedListView
  • s_itemProperty : DetailPage
  • s_metaDataList : AzureDataProvider
  • s_random : ArticleViewModel
  • s_service : CServiceBase
  • s_viewModelProperty : SectionView
  • sample : MFSampleGenerator
  • SAMPLE_NAME : MainPage
  • SAMPLE_TASK_ENTRY_POINT : Scenario15_DPLCreateFileEvents
  • SAMPLE_TASK_NAME : Scenario15_DPLCreateFileEvents
  • sampleArray : sealed , ServiceViewModel
  • SampleBackgroundTaskEntryPoint : Scenario4_BackgroundActivity , BackgroundTaskSample , Scenario4_BackgroundPedometer , Scenario4_BackgroundProximitySensor
  • SampleBackgroundTaskName : Scenario4_BackgroundActivity , BackgroundTaskSample , Scenario4_BackgroundPedometer , Scenario4_BackgroundProximitySensor
  • SampleBackgroundTaskProgress : BackgroundTaskSample
  • SampleBackgroundTaskRegistered : BackgroundTaskSample
  • SampleBackgroundTaskWithConditionName : BackgroundTaskSample
  • SampleBackgroundTaskWithConditionProgress : BackgroundTaskSample
  • SampleBackgroundTaskWithConditionRegistered : BackgroundTaskSample
  • SampleCount : Scenario1_BackgroundTask
  • sampleDispatcher : RegisterWithBackgroundTask
  • sampleFile : MainPage , SampleState , MainPage
  • SampleHotspotGuid : Constants
  • sampleMessage : sealed , ServiceViewModel
  • SampleMovieURL : MainPage
  • SampleNetworkPassword : AppData
  • samplePeriod : sealed , ServiceViewModel , Metering
  • sampleRefreshCount : sealed , ServiceViewModel
  • SampleSize : ToneSampleGenerator::SineSampleInfo
  • SamplesPerSecond : ToneSampleGenerator::SineSampleInfo
  • sampleVideos : VideoGallery
  • SaturationValue : PhotoAdjustmentProperties
  • savedProfileName : Scenario4_Connect
  • savedScrollPosition : sealed , Scenario1_Basic
  • saveTripCommand : sealed , TripViewModel
  • sb : SourceBufferManager
  • ScaleFactor : ExtendedSplash
  • scanner : Scenario1_BasicFunctionality , Scenario3_ActiveSymbologies , Scenario4_SymbologyAttributes
  • scannerEnabled : Provider
  • scenario1 : WiFiDirectServiceManager
  • Scenario1_DeviceUse_TaskEntryPoint : SampleConstants
  • Scenario1_DeviceUse_TaskName : SampleConstants
  • Scenario1_TaskEntryPoint : SampleConstants
  • Scenario1_TaskName : SampleConstants
  • scenario2 : WiFiDirectServiceManager
  • scenario3 : WiFiDirectServiceManager
  • scenario4 : WiFiDirectServiceManager
  • scenario5 : WiFiDirectServiceManager
  • ScenarioGroupProperty : MainPage
  • scenarioPage : PrintHelper
  • ScenarioProperty : ScenarioPage
  • scenarios : MainPage , CachedFileUpdaterPage , FileOpenPickerPage , FileSavePickerPage
  • scenariosInner : MainPage
  • sceneRenderer : LowLatencyInputMain
  • schoolKey : School
  • Script : RecognizedTextRun
  • scrollStep : PlaybackPage
  • sdpRecordBlob : Scenario3_BgChatServer
  • SdpServiceName : Constants
  • SdpServiceNameAttributeId : Constants
  • SdpServiceNameAttributeType : Constants
  • SeattleGeopoint : MainPage
  • SECONDARY_TILE_ID : ScenarioElement
  • SecondaryViews : SampleState , App
  • secondVideoFile : sealed , Scenario2_AppendClips
  • secureStopServiceUrl : SecureStopViewModel
  • securityLevel : PlayReadyInfoViewModel
  • segmentCursor : SourceBufferManager
  • SelectedBleDeviceId : SampleState , MainPage
  • SelectedBleDeviceName : SampleState , MainPage
  • selectedCharacteristic : Scenario2_Client
  • selectedImage : ShareDelayRenderedFiles
  • selectedItem : Scenario1_Files
  • selectedLayer : sealed
  • SelectedModel : ContentSelector
  • selectedScanner : Scenario5_DisplayingBarcodePreview
  • selectedSession : WiFiDirectServiceManager
  • selectedStencilChangedToken : sealed , Scenario6
  • selectedTrip : sealed , TripListViewModel
  • selection : FileDataSource2
  • selectionCache : FileDataSource2
  • sensor : Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , sealed
  • Sensor : Scenario1_DataEvents , Scenario2_Polling
  • sensor : sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario4_BackgroundPedometer , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario1_DataEvents , Scenario2_Polling
  • separatorQueue : sealed , DynamicCommandBar
  • separatorQueueWidth : sealed , DynamicCommandBar
  • SerialNumber : RawSMBIOSSystemInfo
  • serverBaseUri : JsonRequest
  • service : DiscoveredDeviceWrapper
  • serviceCompletionNotifier : HardwareDRMViewModel , ProactiveViewModel , ReactiveViewModel , SecureStopViewModel
  • serviceDeferral : RandomNumberGeneratorTask , sealed , AdventureWorksVoiceCommandService
  • serviceProvider : Scenario3_ServerForeground
  • serviceProviderAdvertisementChangedToken : Scenario3_ServerForeground
  • services : unique_services
  • ServicingCompleteTaskEntryPoint : BackgroundTaskSample
  • ServicingCompleteTaskName : BackgroundTaskSample
  • ServicingCompleteTaskProgress : BackgroundTaskSample
  • ServicingCompleteTaskRegistered : BackgroundTaskSample
  • session : sealed , UnspecifiedReason , LocationTrackingReason , MultipleTasks , FileLoggingSessionScenario , LoggingSessionScenario , Scenario1 , Scenario5 , SessionWrapper , StreamSocketListenerWrapper
  • sessionClosedEvent : SessionWrapper
  • SessionLost : ISecureInterfaceProducer , IOnboardingProducer
  • SessionMemberAdded : ISecureInterfaceProducer , IOnboardingProducer
  • SessionMemberRemoved : ISecureInterfaceProducer , IOnboardingProducer
  • sessionRevokedToken : sealed
  • sessionStateFilename : App , SuspensionManager
  • SET_PIN : sealed , Scenario2_Listen
  • SetLedBlinkPattern : SuperMutt::VendorCommand
  • setPin : sealed , Scenario2_Listen
  • SetSevenSegmentDisplay : Fx2Driver
  • settingName : Scenario3_SettingContainer , Scenario4_CompositeSettings , Scenario7_SetVersion , Scenario3_SettingContainer , Scenario4_CompositeSettings , Scenario7_SetVersion
  • SettingName : Scenario2_Settings
  • settingName1 : Scenario4_CompositeSettings
  • settingName2 : Scenario4_CompositeSettings
  • settings : SettingsService
  • settingValue0 : Scenario7_SetVersion
  • settingValue1 : Scenario7_SetVersion
  • SevenLedSegmentMask : OsrFx2
  • SevenSegmentValues : Fx2Driver
  • ShadowsValue : PhotoAdjustmentProperties
  • shakeCounter : sealed
  • shakenToken : sealed
  • shape : Shape
  • sharedApplicationLink : ShareTarget
  • sharedBitmapStreamRef : ShareTarget
  • sharedCustomData : ShareTarget
  • sharedDataContentSourceApplicationLink : ShareTarget
  • sharedDataContentSourceWebLink : ShareTarget
  • sharedDataDescription : ShareTarget
  • sharedDataLogoBackgroundColor : ShareTarget
  • sharedDataPackageFamilyName : ShareTarget
  • sharedDataSquare30x30Logo : ShareTarget
  • sharedDataTitle : ShareTarget
  • sharedFlyout : sealed , Scenario3
  • sharedHtmlFormat : ShareTarget
  • sharedResourceMap : ShareTarget
  • sharedStorageItems : ShareTarget
  • sharedText : ShareTarget
  • sharedThumbnailStreamRef : ShareTarget
  • sharedWebLink : ShareTarget
  • ShareImageProperty : SocialMediaCounter
  • shareOperation : ShareTarget
  • shareQuickLinkId : Scenario13_ShareTarget , ShareTarget
  • showDelete : sealed , TripViewModel
  • showDestinationValidation : sealed , TripViewModel
  • showHeader : CustomOptionsPrintHelper
  • Signature : SignatureMessage
  • signature : TypeConversionHelpers
  • simulateUpdateConflict : FileSavePicker_SaveToCachedFile
  • singletonCreationLock : EventHandlerForDevice
  • size : DDS_HEADER , sealed::sealed , ImageInfo , DDS_PIXELFORMAT , DDS_HEADER , DDS_PIXELFORMAT , sealed
  • sizeX : WaveEffect
  • sizeY : WaveEffect
  • skewX : WaveEffect
  • skewY : WaveEffect
  • SKUNumber : RawSMBIOSSystemInfo
  • sliderEnabled : ServiceViewModel , sealed
  • sliders : sealed , Scenario1_EventAndMenuHookup
  • sliderValue : sealed , ServiceViewModel
  • smartCardItems : sealed
  • SMBIOSMajorVersion : RawSMBIOSData
  • SMBIOSMinorVersion : RawSMBIOSData
  • SMBIOSTableData : RawSMBIOSData
  • smtcPositionUpdateTimer : Scenario1
  • snapDistance : Scenario5_InkingAndInteractionFeedback
  • socket : RfcommServerTask , sealed , Scenario1_Connect , Scenario2_ChatServer
  • socketId : Scenario1_Connect , SocketActivityTask
  • socketList : SessionWrapper
  • socketListener : Scenario2_ChatServer
  • socketRW : sealed , ConnectedDevice
  • source : VideoItemInfo , WICConvert
  • Source : VideoGallery::VideoItemInfo
  • sourceBuffers : Player
  • sourceDistortionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • sourceImage : GpuCoordinateMapper::RasterizedFrameBlob
  • sourceImageHeightLimit : Scenario1_DetectInPhoto
  • sourceInfo : FrameSourceState
  • sourceIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • SourceObjects : sealed
  • sourceProjectionMatrix : GpuCoordinateMapper::RasterizedFrameBlob
  • SourceProperty : TitledImage
  • sourceRotation : sealed
  • sources : Item
  • sourceState : SpatialInputHandler
  • sourceUri : AppViewSource , AppView
  • sourceUrl : Manifest , DASHEntry
  • spatialLocator : HolographicTemplateAppMain
  • specularColor : ConstantBufferChangesEveryPrim
  • specularPower : ConstantBufferChangesEveryPrim
  • speechContext : sealed , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_ListConstraint , Scenario_PredefinedDictationGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_SRGSConstraint , Scenario_SynthesizeSSML , Scenario_SynthesizeText , Scenario_SynthesizeTextBoundaries , Scenario_ContinuousRecognitionListGrammar
  • speechRecognizer : Scenario_PredefinedWebSearchGrammar , sealed , Scenario_ContinuousDictation , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint , Scenario_PauseAsync , Scenario_PredefinedDictationGrammar , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_SRGSConstraint
  • speechResourceMap : Scenario_SRGSConstraint , Scenario_ContinuousRecognitionSRGSGrammar , Scenario_PredefinedWebSearchGrammar , Scenario_PredefinedDictationGrammar , sealed , Scenario_ContinuousRecognitionListGrammar , Scenario_ListConstraint , Scenario_SynthesizeSSML , Scenario_SynthesizeTextBoundaries , Scenario_SynthesizeText
  • splash : ExtendedSplash
  • SplashImageRect : MainPage
  • splashImageRect : ExtendedSplash
  • spread : RippleEffect
  • squareBitmap : GeneratedBitmapState
  • squareBuffer : GeneratedBitmapState
  • squareLength : GeneratedBitmapState
  • squareY : GeneratedBitmapState
  • srwSingletonCreationLock : sealed
  • start : Period
  • startButtonEnabled : ServiceViewModel , sealed
  • startDate : Trip
  • startImmediately : Scenario4_ForegroundGeofence
  • startNumber : MediaSegmentInformation
  • startTime : sealed
  • startTimestamp : MediaSegmentInformation
  • StateChanged : MainPage
  • StateChangedEvent : sealed
  • stateChangedToken : sealed
  • stationaryReferenceFrame : HolographicTemplateAppMain
  • STATUS_SUCCESS : SubjectPublicKeyInfo
  • statusUpdatedToken : sealed
  • stencilButtonCheckedChangedToken : sealed
  • Step1 : Print3D
  • Step2 : Print3D
  • Step3 : Print3D
  • stepCount : sealed , Scenario4_BackgroundPedometer
  • stepCountGoalOffset : sealed
  • stepGoal : Scenario4_BackgroundPedometer , sealed
  • stepGoalOffset : Scenario4_BackgroundPedometer
  • stepKind : HistoryRecord
  • StepProperty : StepsHelperControl , StepsControl
  • stepsCount : HistoryRecord
  • stepsDuration : HistoryRecord
  • stereoExaggerationFactor : STEREO_PARAMETERS
  • stereoSeparationFactor : STEREO_PARAMETERS
  • StopBits : DeviceConfiguration
  • stopButtonEnabled : sealed , ServiceViewModel
  • stopMeteringRequested : sealed , Metering , ServiceViewModel
  • Stopped : ISecureInterfaceProducer , IOnboardingProducer
  • storageItemAccessList : sealed , Scenario1_TrimAndSaveClip
  • storageItems : sealed , ShareFiles
  • store : TripListViewModel , sealed , TripViewModel
  • storeContext : Scenario2_InAppPurchase , Scenario1_TrialMode , Scenario7_B2B , Scenario6_AppListingURI , sealed , Scenario4_ConsumableProduct , Scenario5_UserCollection , Scenario3_UnmanagedConsumable
  • STORED_ACCOUNT_AUTHORITY : sealed
  • STORED_ACCOUNT_ID_KEY : sealed
  • STORED_AUTHORITY_ID_KEY : sealed
  • STORED_PROVIDER_ID_KEY : sealed
  • StoredAccountIdKey : SingleAccountScenario
  • StoredAccountKey : SingleMicrosoftAccountScenario , SingleAzureADScenario
  • StoredAuthorityKey : SingleAccountScenario
  • StoredProviderIdKey : SingleAccountScenario
  • StoreSample : ToneSampleGenerator::SineSampleInfo
  • StraightenValue : PhotoAdjustmentProperties
  • stream : SourceBufferManager
  • streamFlags : MFSampleGenerator
  • streamIndex : MFSampleGenerator
  • streamSocket : SocketWrapper , SocketReaderWriter
  • streamSocketListener : StreamSocketListenerWrapper
  • streamSocketListeners : SessionWrapper
  • streamWebSocket : Scenario2_Binary , Scenario3_ClientAuthentication , sealed
  • StringField : CSharpModel
  • StringPropertyDPName : DataModel
  • strokeBuilder : Scenario9 , sealed
  • strokesToReplay : Scenario9 , sealed
  • submixNode : Scenario4_Submix
  • subscribedForNotifications : Scenario2_Client
  • subscribedPlaybackList : PlayerViewModel
  • Subtitles : AdaptiveContentModel
  • subType : sealed::StreamFilteringCriteria
  • Succeeded : BackgroundAuthenticationCompletedEventArgs
  • supportedAudioFormats : Scenario1
  • supportedConfigMethods : ConnectionSettingsPanel
  • supportedCursorTypes : sealed
  • supportedDeviceSelectors : CustomDevicePickerFilter
  • supportedEncodingProperties : AudioEchoEffect
  • supportedVideoFormats : Scenario1
  • SUPPRESS_DURATION_APPROXIMATE_MIN : CalibrationBar
  • SUPPRESS_DURATION_APPROXIMATE_TICKS : sealed
  • SUPPRESS_DURATION_UNRELIABLE_MIN : CalibrationBar
  • SUPPRESS_DURATION_UNRELIABLE_TICKS : sealed
  • suspendDeferral : SavingDataReason , sealed
  • suspendingEventToken : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • suspendingToken : sealed
  • switchChangedEventsHandler : sealed
  • switchMessageBuffer : DeviceEvents
  • symbolAssignment : BitrateHelper
  • symbologyAttributes : Scenario4_SymbologyAttributes , Provider
  • SyncBackgroundTaskResult : LocalSettingKeys
  • SyncBackgroundTaskStatus : LocalSettingKeys
  • syncBackgroundTaskTrigger : Scenario7_SyncDevice
  • syncDeviceInformation : Scenario7_SyncDevice
  • syncDeviceSelector : Scenario7_SyncDevice
  • synthesisStream : sealed
  • synthesizer : sealed , Scenario_SynthesizeTextBoundaries , Scenario_SynthesizeSSML , Scenario_SynthesizeText
  • SystemList : Scenario2_LaunchUri
  • systemList : MainPage
  • SystemList : Scenario5_Capabilities , Scenario3_LaunchAppServices , Scenario1_Discovery
  • systemMap : MainPage
  • systemMediaControls : PlaybackControl , Scenario1
  • systemNavigationManager : RootFrameNavigationHelper
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- t -

  • t : MediaSegment
  • tag : HighScoreEntry
  • TAG_1 : ScenarioElement
  • TAG_2 : ScenarioElement
  • TAG_3 : ScenarioElement
  • TAG_COMPREHENSION_MASK : ApduResponse
  • TAG_LENGTH_MULTI_BYTE_MASK : ApduResponse
  • TAG_MULTI_BYTE_MASK : ApduResponse
  • tangentialDistortion : GpuCoordinateMapper::CameraIntrinsics
  • tapCount : SubPage
  • target : WICConvert
  • targetDistortionMap : GpuCoordinateMapper::RasterizedFrameBlob
  • targetElapsedTicks : StepTimer
  • targetImage : GpuCoordinateMapper::RasterizedFrameBlob , GpuCoordinateMapper::VisualizeFrameBlob
  • targetImageDepthBuffer : GpuCoordinateMapper::VisualizeFrameBlob
  • targetIntrinsics : GpuCoordinateMapper::RasterizedFrameBlob
  • targetProjectionMatrix : GpuCoordinateMapper::RasterizedFrameBlob
  • targetRasterizedDepth : GpuCoordinateMapper::RasterizedFrameBlob
  • task : Scenario1_Connect
  • TaskCanceled : BackgroundTaskInformation , SyncBackgroundTaskInformation
  • taskCancelledToken : sealed
  • TaskCompleted : BackgroundTaskInformation , SyncBackgroundTaskInformation
  • taskCount : sealed , MultipleTasks
  • TaskDeferral : sealed
  • taskEntryPoint : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer
  • TaskEntryPoint : SyncBackgroundTaskInformation
  • taskInstance : RfcommServerTask
  • TaskInstance : sealed
  • taskName : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer
  • taskRegistration : Scenario3_BackgroundWatcher , Scenario4_BackgroundPublisher , Scenario3_BgChatServer , sealed , CustomTrigger
  • TaskStatuses : BackgroundTaskSample
  • tcpListener : Scenario1_Send
  • TemperatureValue : PhotoAdjustmentProperties
  • temporaryCounter : Scenario1_Files
  • temporaryFolder : Scenario1_Files
  • tenantId : Scenario7_B2B
  • tenMinutesIn100NanoSecondUnits : sealed
  • tex : VertexPositionTex , BasicVertex , TangentVertex
  • texcoord : Vector3< T >
  • texCoord : VertexPositionColorTex
  • texCoordOffset : QuadModelConstantBuffer
  • texCoordScale : QuadModelConstantBuffer
  • TEXT_TILE_ID : Scenario3_SecondaryTiles
  • textcoord : Vector2< T >
  • TextSentReceived : ISecureInterfaceLegacySignals , ISecureInterfaceSignals
  • textServiceManager : sealed , Scenario4
  • textSpoken : TripVoiceCommand
  • texture : VertexPositionTexture
  • textureCoordinate : VertexPositionTexture , PNTVertex
  • Theta : ToneSampleGenerator::SineSampleInfo
  • theta : Scenario3_FrameInput
  • thisLock : VideoRenderer , Scenario2 , Scenario3 , Scenario4 , Scenario5 , WiFiDirectServiceManager , AdvertisementWrapper
  • thisViewControl : SecondaryViewPage , sealed , ProjectionViewPage
  • thisViewId : Scenario05 , Scenario06 , sealed , Scenario1 , Scenario2 , Scenario3
  • thumbnail : ImportableItemWrapper
  • THUMBSTICK_DEADZONE : PlaybackPage
  • TicksPerSecond : StepTimer
  • TimeHistoryCount : GpuPerformanceTimer
  • timelineController : Scenario1_MultiVideoPlayback , Scenario2_SynchronizingPlayers , Scenario3_AdaptiveSync
  • TIMEOUT_LENGTH : Scenario3
  • timer : HolographicTemplateAppMain , _360VideoPlaybackMain , HolographicApp1Main , PlaybackPage , sealed , Scenario2_Listen , Scenario1_ReadData , ItemCacheManager< T >
  • timerToken : sealed
  • timescale : MediaSegmentInformation
  • timeShiftBufferDepth : Manifest
  • timeSpanFormat : Scenario4_ForegroundGeofence
  • timestamp : MFSampleGenerator
  • timestamps : Scenario12
  • TimeTriggeredTaskName : BackgroundTaskSample
  • TimeTriggeredTaskProgress : BackgroundTaskSample
  • TimeTriggeredTaskRegistered : BackgroundTaskSample
  • timezoneKey : User
  • TintValue : PhotoAdjustmentProperties
  • Title : Scenario
  • title : VideoItemInfo , ViewLifetimeControl
  • Title : VideoGallery::VideoItemInfo , Scenario , MediaItemViewModel
  • title : ViewLifetimeControl
  • titleBar : Scenario1_Colors , sealed
  • titleBody : GameHud
  • titleHeader : GameHud
  • titleLicenseInfo : GameHud
  • ToastOnAppEventsKey : SettingsService
  • toggles : Scenario1_EventAndMenuHookup , sealed
  • token : sealed
  • tokenMethod : Scenario3_RequestModification
  • top : ElementMargin
  • topLeft : Scenario5_InkingAndInteractionFeedback
  • TopLeft : Stroke::Square
  • topLeft : Scenario5_InkingAndInteractionFeedback
  • Topology : MeshGeometry
  • TopRight : Stroke::Square
  • total : NfcProvHeader
  • total_pipe_bytes : PipeEvents
  • totalBytesRead : Scenario4_BulkPipes
  • totalBytesWritten : Scenario4_BulkPipes
  • totalCumulativeSteps : Scenario1_Events , sealed
  • totalHits : HighScoreEntry
  • totalNumberBytesReceived : InputReportEvents , sealed , Scenario3_InterruptPipes
  • totalNumberBytesWritten : Scenario3_InterruptPipes
  • TotalSeconds : StepTimer
  • totalSegmentCount : LiveSourceBufferManager
  • totalShots : HighScoreEntry
  • totalTicks : StepTimer
  • TouchWriting : Scenario2
  • tpTimer : Metering
  • transforms : Scenario4 , Scenario5_InkingAndInteractionFeedback , sealed
  • treatAsOnDemand : Manifest
  • trigger : Scenario4_BackgroundPublisher , sealed , ApplicationTriggerTask , Scenario3_BackgroundWatcher , Scenario3_BgChatServer
  • trip : sealed , TripViewModel
  • trips : TripStore , sealed , TripListViewModel , sealed
  • tripsLoaded : sealed
  • ttsMap : Scenario3
  • turningSpeed : Turn
  • Type : RawSMBIOSTable
  • typeKey : School
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- u -

  • u : Vector2< T > , Vector3< T >
  • uiContext : Scenario6_DeleteTPM
  • uLength : LineSegment
  • ullDuration : StspSampleHeader
  • ullTimestamp : StspSampleHeader
  • uniqueInternalId : AdvertisementWrapper
  • UnknownDevices : Scenario1_Discovery
  • unknownStepCount : sealed , Scenario1_Events
  • unread_buffer : PipeEvents
  • UpdateRunningAverageContainerHeightHandler : sealed
  • UpdateStatus : DeviceWatcherHelper
  • updateStatus : DeviceWatcherHelper
  • url : MediaSegment
  • urls : sealed
  • urlTemplate : Scenario12
  • UsageId
: SuperMutt::LedPattern
, SuperMutt::DeviceInputReportControlInformation
, SuperMutt::Device
  • UsagePage
: SuperMutt::LedPattern
, SuperMutt::DeviceInputReportControlInformation
, SuperMutt::Device
  • UseCustomControlsKey : SettingsService
  • Used20CallingMethod : RawSMBIOSData
  • USER_LIST_FILE_NAME : AccountsHelper
  • userDataProtectionManager : Scenario1_Files , Scenario2_Memory
  • UserId : DAL::RegisteredUser , RegisterMessage , UserAndKeyHintMessage , SignatureMessage
  • userId : MainPage , EnableHelloPage
  • UserName : ConfigStore
  • userNumber : Scenario2_WatchUsers
  • Users : Scenario2_WatchUsers
  • users : Scenario2_WatchUsers
  • userStore : Scenario1_MoveCertificate
  • userWatcher : Scenario2_WatchUsers
  • usingVprtShaders : VideoRenderer , SpinningCubeRenderer
  • uStart : LineSegment
  • uTan : TangentVertex
  • UUID : RawSMBIOSSystemInfo
  • uv : VertexPositionTexture
  • uvPrint : Print3D
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- v -

  • v : Vector2< T > , Vector3< T >
  • ValidStateMatrix : CStreamSink
  • value : int24in32
  • vector : GroupInfoList
  • verifiedKey : User
  • version : NfcProvHeader
  • Version : RawSMBIOSSystemInfo
  • vertexBuffer : VideoRenderer , SpinningCubeRenderer
  • VertexBuffer : MeshGeometry
  • vertexPositionScale : SurfaceMeshProperties
  • vertexShader : VideoRenderer , SpinningCubeRenderer
  • vertexStride : SurfaceMeshProperties
  • VertexStride : MeshGeometry
  • verticalScrollableWindow : sealed , Scenario7_ScrollingContentUsingMarquee
  • verticesCount : Print3D
  • verticesMaterialCount : Print3D
  • verticesPrint : Print3D
  • Vid : SuperMutt::Device , ArduinoDevice
  • video : Scenario01 , Scenario02 , Scenario03 , Scenario04 , Scenario05 , Scenario06
  • VIDEO_ENCODING_STRING : sealed
  • VideoMimeType : Manifest
  • videoProjection : sealed , PlaybackPage
  • videoProperties : Scenario2_DetectInWebcam , Scenario1_TrackInWebcam
  • view : ConstantBufferChangesEveryFrame
  • ViewablePageSize : PageDescription
  • viewerDistanceInches : STEREO_PARAMETERS
  • viewId : ViewLifetimeControl
  • ViewModel : MeteringData
  • viewport : GpuCoordinateMapper::VisualizeFrameBlob
  • Viewport : CameraResources
  • viewProjection : ViewProjectionConstantBuffer
  • viewProjectionConstantBuffer : CameraResources
  • viewProjectionLeft : ViewProjectionConstantBuffer
  • viewProjectionRight : ViewProjectionConstantBuffer
  • ViewSizePreferences : MainPage
  • viewToProj : GpuCoordinateMapper::VisualizeFrameBlob
  • visibilityToken : sealed , Scenario3
  • VISUAL_INDICATOR_NAME : EdgeTappedListView
  • VISUAL_INDICATOR_WIDTH : EdgeTappedListView
  • visualIndicator : EdgeTappedListView
  • vm : Collections , Albums
  • voiceCommand : TripVoiceCommand
  • voiceServiceConnection : sealed , AdventureWorksVoiceCommandService
  • VolumeDataStartBit : SuperMutt::ReadWriteBufferControlInformation
  • VolumeUsageId : SuperMutt::ReadWriteBufferControlInformation
  • VolumeUsagePage : SuperMutt::ReadWriteBufferControlInformation
  • vTan : TangentVertex
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- w -

  • w : Vector3< T > , Vector4< T >
  • Wakeup_Type : RawSMBIOSSystemInfo
  • walkingStepCount : sealed , Scenario1_Events
  • watcher : Scenario1_Watcher , Scenario3_DisplayOnOff , Scenario4_BackgroundProximitySensor , Scenario1_DataEvents , Scenario2_Polling , sealed , Scenario5_DisplayingBarcodePreview , Scenario1_SelectDisplay , Scenario3_Choosing , Scenario3 , Scenario1_DataEvents , Scenario2_Polling
  • watcherAddedToken : Scenario2_Connector
  • watcherEnumerationCompletedToken : Scenario2_Connector
  • watcherRemovedToken : Scenario2_Connector
  • watchersStarted : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • watchersSuspended : sealed , DeviceConnect , Scenario1_ConnectDisconnect
  • watcherStarted : sealed , EventHandlerForDevice
  • WatcherStarted : DeviceList
  • watcherStoppedToken : Scenario2_Connector
  • watcherSuspended : sealed , EventHandlerForDevice
  • watcherUpdatedToken : Scenario2_Connector
  • waveOffset : WaveEffect
  • wfdDevice : sealed , ConnectedDevice
  • wic : WICTranslate
  • wicFactory : DeviceResources , BasicLoader
  • WicImagingFactory : DeviceResources
  • wideMarginsIconTask : CustomOptionsPrintHelper
  • width : CachedFileUpdaterPageSizeChangedEventArgs , FileSavePickerPageSizeChangedEventArgs , DDS_HEADER , MainPageSizeChangedEventArgs
  • Width : Dimensions
  • wiFiAdapters : Scenario1_CachedNetworks
  • WINCODEC_ERR_COMPONENTNOTFOUND : Scenario2
  • WINCODEC_ERR_PROPERTYNOTSUPPORTED : Scenario2
  • WINCODEC_ERR_UNSUPPORTEDOPERATION : Scenario2
  • window : ViewLifetimeControl
  • windowActivatedEventToken : Scenario7_PinFromAppbar
  • windowClosed : AppView
  • windowList : sealed
  • windowResizeToken : sealed , Scenario1_Basic
  • windowSizeChangedToken : Scenario1_Basic , CustomTitleBar , Scenario2_Extend , sealed
  • windowVisible : AppView , sealed , AppView
  • word : sealed , WordOverlay
  • wordBoundingRect : WordOverlay
  • wordBoxes : sealed , OcrCapturedImage , OcrFileImage
  • wordHeight : sealed
  • WordHeight : WordOverlay
  • WordPosition : WordOverlay
  • wordPosition : sealed
  • wordWidth : sealed
  • WordWidth : WordOverlay
  • workItemHandler : PlaybackPage
  • worldMatrix : ConstantBufferChangesEveryPrim
  • worldToView : GpuCoordinateMapper::VisualizeFrameBlob
  • WriteBytesAvailable : Scenario3_ReadWrite
  • WriteBytesCounter : Scenario3_ReadWrite
  • WriteCancellationTokenSource : Scenario2_LEDTemp , Scenario3_ReadWrite
  • WriteCancelLock : Scenario2_LEDTemp , Scenario3_ReadWrite
  • writeCounter : DeviceReadWrite , sealed
  • writer : RfcommServerTask , SocketWrapper , ScenarioContext , sealed , Scenario2_ChatServer
  • WrongPassword : Scenario1_Render
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- x -

  • x : WaveEffect::Vertex , Vector2< T > , Vector4< T > , Vector3< T >
  • xamlGestureRecognizer : sealed
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Events
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- y -

  • y : WaveEffect::Vertex , Vector2< T > , Vector4< T > , Vector3< T >
  • YinPropertyDPName : DOModel
Generated on Fri Nov 15 2024 22:23:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- j -

  • json : ShareCustomData.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- l -

  • LARGE_CANVAS_HEIGHT : Scenario1_CustomDry.xaml.cpp
  • LARGE_CANVAS_WIDTH : Scenario1_CustomDry.xaml.cpp
  • latencyModeToggled : Scenario1_LowLatency.xaml.cpp
  • LEFT : StereoProjection.h
  • length() : BasicMath.h
  • LevelComplete : Simple3DGame.h
  • localClientButtonClicked : Scenario1_LowLatency.xaml.cpp
  • LogEventAction : Resources.h
  • LogEventTypes : Resources.h
  • LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME : FileLoggingSessionScenario.cpp
  • LOGGING_ENABLED_SETTING_KEY_NAME : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- m -

  • m_imageMaxCLL() : DirectXPage.xaml.cpp
  • m_isComputeSupported() : D2DAdvancedColorImagesRenderer.cpp
  • m_isImageValid() : DirectXPage.xaml.cpp
  • m_parentFocusedPosition() : BaseElement.cpp
  • m_parentTextureHeight() : BaseElement.cpp
  • m_parentTextureWidth() : BaseElement.cpp
  • main() : App.cpp , AppView.cpp , VisualProperties.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp
  • MAKEFOURCC : DDSTextureLoader.cpp
  • MANUFACTURER_NAME_LENGTH_MAX : FirmwareAccess.h
  • MapCoordinates() : Scenario7.xaml.cpp
  • MatrixStereoProjectionFovLH() : StereoProjection.cpp , StereoProjection.h
  • MAX_INACTIVE_TIME_TO_HIDE : MediaTransportControls.cpp
  • MAX_SHAPE_SIZE_PERCENTAGE : ShapeRenderer.h
  • MAX_TEXT_LAYOUT_SIZE : BaseElement.cpp
  • MeteringData : RpcClientApi.h
  • MeteringDataEvent() : RpcInterface.Idl , RpcClient.cpp
  • MeteringWorkerTpCallback() : Metering.cpp
  • METHODASYNCCALLBACK : Common.h
  • midl_user_allocate() : RpcServer.cpp , RpcClient.cpp
  • midl_user_free() : RpcServer.cpp , RpcClient.cpp
  • MILLISECONDS_TO_VISUALIZE : PlotData.h
  • millisecondsPerSecond : SeekBarElement.cpp
  • MIN_SHAPE_SIZE_PERCENTAGE : ShapeRenderer.h
  • mouseWheelData : PlaybackPage.xaml.cpp
  • MoveLookControllerState : MoveLookController.h
  • MTC_SPAWN_DISTANCE : 360VideoPlaybackMain.cpp
  • mul() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- n -

  • NOMINMAX : pch.h , stdafx.h , pch.h
  • None : MoveLookController.h
  • NORMAL : StereoProjection.h
  • normalize() : BasicMath.h
  • NotifyStatusMessage() : pch.h , pch.cpp
  • NTDDI_VERSION : pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- o -

  • operator*() : BasicMath.h
  • operator+() : BasicMath.h
  • operator-() : BasicMath.h
  • operator/() : BasicMath.h
  • OSC_START_X : Scenario4.xaml.h
  • OSC_START_Y : Scenario4.xaml.h
  • OSC_TOTAL_HEIGHT : Scenario4.xaml.h
  • OSC_X_LENGTH : Scenario4.xaml.h
  • OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- a -

  • Action : Scenario1_LowLatency.xaml.cpp
  • ActivatableClass() : StspSchemeHandler.cpp
  • Active : MoveLookController.h , Simple3DGame.h
  • ADMIN_KEY_LENGTH_IN_BYTES : SampleConfiguration.h
  • AID_MC : BgTask.cpp
  • AID_NONPAYMENT : BgTask.cpp
  • AID_PPSE : BgTask.cpp
  • AID_V : BgTask.cpp
  • AppendFile() : Utilities.cpp , Utilities.h
  • appIdUri : Scenario7_B2B.xaml.cpp
  • ApplicationTriggerTaskName : SampleConfiguration.h
  • ApplyScale() : SampleConfiguration.cpp
  • AsComPtr() : FrameRenderer.cpp
  • AUDIO_FILE_NAME : WASAPICapture.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- b -

  • BackgroundTaskGroupFriendlyName : SampleConfiguration.h
  • BackgroundTaskGroupId : SampleConfiguration.h
  • backgroundTaskName : Scenario3_BackgroundDeviceWatcher.cpp
  • BITS_PER_BYTE : WASAPICapture.cpp
  • BUTTON_SIZE : BaseElement.h
  • ByteArrayToString() : Utilities.cpp , Utilities.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- c -

  • c_MaximumSignatureLength : AllJoynHelpers.h
  • c_maxSecondsInPerformPressedFeedbackState : Controls.cpp
  • c_MessageTimeoutInMilliseconds : AllJoynHelpers.h
  • CanvasBackgroundColor : pch.h
  • ChkHR() : Utilities.h
  • ChkHr : pch.h
  • ChkHR() : Utilities.cpp
  • CLAINS_COMPUTE_CRYPTO_CSUM : BgTask.cpp
  • CLAINS_GET_PROCESSING_OPTIONS : BgTask.cpp
  • CLAINS_READ_RECORD : BgTask.cpp
  • CLAINS_SELECT : BgTask.cpp
  • clientId : Scenario7_B2B.xaml.cpp
  • clientSecret : Scenario7_B2B.xaml.cpp
  • CO2_LEVEL_KEY : Scenario1_DataEvents.xaml.cpp , Scenario2_Polling.xaml.cpp
  • constantFocusPointColor : BaseControl.cpp
  • constantFocusPointIntensity : BaseControl.cpp
  • constantFocusPointRadius : BaseControl.cpp
  • Convert() : ToneSampleGenerator.h
  • Convert< float >() : ToneSampleGenerator.cpp
  • Convert< int24in32 >() : ToneSampleGenerator.cpp
  • Convert< short >() : ToneSampleGenerator.cpp
  • CountEmployeesInternal() : Functions.xaml.cpp
  • create_empty_task() : OcrCapturedImage.xaml.cpp
  • CreateDDSTextureFromMemory() : DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h
  • CreateDDSTextureFromMemoryEx() : DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp
  • CreateFromHeadingPitchRoll() : PlaybackPage.xaml.cpp
  • cross() : BasicMath.h
  • CustomCapabilityName : RpcServer.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- d -

  • DDS_ALPHA : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_CUSTOM : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_OPAQUE : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_PREMULTIPLIED : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_STRAIGHT : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_UNKNOWN : DDSTextureLoader.cpp
  • DDS_CUBEMAP : DDSTextureLoader.cpp
  • DDS_CUBEMAP_ALLFACES : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEX : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEY : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEZ : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEX : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEY : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEZ : DDSTextureLoader.cpp
  • DDS_FLAGS_VOLUME : DDSTextureLoader.cpp
  • DDS_FOURCC : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_LINEARSIZE : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_MIPMAP : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_PITCH : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_TEXTURE : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_VOLUME : DDSTextureLoader.cpp
  • DDS_HEIGHT : DDSTextureLoader.cpp
  • DDS_LUMINANCE : DDSTextureLoader.cpp
  • DDS_LUMINANCEA : DDSTextureLoader.cpp
  • DDS_MAGIC : DDSTextureLoader.cpp
  • DDS_MISC_FLAGS2 : DDSTextureLoader.cpp
  • DDS_MISC_FLAGS2_ALPHA_MODE_MASK : DDSTextureLoader.cpp
  • DDS_PAL8 : DDSTextureLoader.cpp
  • DDS_RGB : DDSTextureLoader.cpp
  • DDS_RGBA : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_CUBEMAP : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_MIPMAP : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_TEXTURE : DDSTextureLoader.cpp
  • DDS_WIDTH : DDSTextureLoader.cpp
  • DECLSPEC_NOVTABLE : StspDefs.h
  • DECLSPEC_UUID : StspDefs.h
  • DEFAULT_CHANNEL_NAME : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp
  • DEFAULT_METERING_PERIOD : RpcServer.cpp
  • DEFAULT_SESSION_NAME : LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
  • DEFAULT_SIZE : Controls.cpp
  • DEFAULT_TEXTURE_SIZE : BaseControl.h
  • defaultGlassColor : BaseControl.cpp
  • DEFINE_GUID() : RippleEffect.h , WaveEffect.h , DftEffect.h , WaveEffect.h , DftTransform.h , Fx2Driver.cpp , WaveEffect.h , ReinhardEffect.h , LuminanceHeatmapEffect.h , SdrOverlayEffect.h , FilmicEffect.h , LuminanceHeatmapEffect.h , RippleEffect.h , SdrOverlayEffect.h , DftTransform.h , ReinhardEffect.h , DftTransform.h
  • DllCanUnloadNow() : module.cpp
  • DllGetActivationFactory() : module.cpp
  • dot() : BasicMath.h
  • DRAW_SAMPLE_CONTENT : BasicHologramMain.h , 360VideoPlaybackMain.h , HolographicApp1Main.cs , HolographicSpatialMappingMain.h , HolographicTagAlongSampleMain.h , HolographicMRCSampleMain.h , BasicHologramMain.cs , BasicHologramMain.h , _360VideoPlaybackMain.cs
  • dxgiDefaultDPI : DeviceResources.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- e -

  • EFI_GLOBAL_VAR_GUID : uefi.cpp
  • enabledForegroundColor() : Controls.cpp
  • END_OF_PLAYBACK_BUFFER_MS : SeekBarElement.cpp
  • EventNone : Resources.h
  • ExecuteQueryHelper() : S3_RetrieveWithAPI.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- f -

  • FindSmBiosTable() : smbios.cpp
  • float2 : BasicMath.h
  • float3 : BasicMath.h
  • float4 : BasicMath.h
  • float4x4 : BasicMath.h
  • FLUSH_INTERVAL_SEC : WASAPICapture.h
  • focusOutlineColor() : Controls.cpp
  • FONT_SIZE : BaseElement.h
  • FreeSidArray() : RpcServer.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- g -

  • g_dwLogLevel : Trace.cpp
  • g_dwTraceLevel : Trace.h
  • g_listener : FontDownloadListener.cpp
  • GameComplete : Simple3DGame.h
  • GameState : Simple3DGame.h
  • GetArrayFromBuffer() : pch.cpp , pch.h
  • GetCallbackCount() : RpcClientApi.cpp
  • GetCurrentDateTime() : Scenario9.xaml.cpp
  • GetCurrentTimeString() : Utilities.cpp , Utilities.h
  • GetDataLabelString() : DataHelpers.cpp , DataHelpers.h
  • GetDataString() : DataHelpers.cpp , DataHelpers.h
  • GetDisplayContent() : Scenario3CustomOptions.xaml.cpp
  • GetDwriteTextAlignment() : TextRenderer.cpp
  • GetHexDigit() : Functions.xaml.cpp
  • GetManufacturerNameFromSmbios() : smbios.cpp
  • GetMeteringData() : RpcClientApi.cpp
  • GetRenderSampleType() : Common.h
  • GetScreenTranslation() : TextRenderer.cpp
  • GetSecureBootEnabledFromUefi() : uefi.cpp
  • GetSmBiosString() : smbios.cpp
  • GetUnderlyingBuffer() : Scenario1.xaml.cpp
  • GetValueFromPropertySet() : pch.h
  • GroupedBackgroundTaskName : SampleConfiguration.h
  • GUID_ActivitySensor_ClassId : pch.h
  • GUID_CustomSensorDevice_VendorDefinedSubTypeID : Scenario1_DataEvents.xaml.cpp
  • GUID_CustomSensorDevice_VendorDefinedTypeID : Scenario2_Polling.xaml.cpp
  • GUID_CUSTOMSYSTEMEVENTTRIGGERID_OSRUSBFX2 : Scenario6_CustomTrigger.xaml.cpp
  • GUID_Pedometer_ClassId : pch.h
  • GuidBufferLength : PoseTrackingFrame.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- h -

  • HighScoreEntries : Simple3DGame.h
  • Horizontal : DftTransform.h
  • hresult_not_found : Scenario2_Manage.cpp
  • HRTF_2PI : OmnidirectionalSound.cpp , pch.h
  • HundredNanoSecondsToMilliseconds : Scenario1_Events.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- i -

  • IBufferFromArray() : Utilities.cpp , Utilities.h
  • IBufferFromPointer() : Utilities.h , Utilities.cpp
  • identity() : BasicMath.h
  • idl : RpcInterface.Idl
  • IFACEMETHODIMP_() : RippleEffect.cpp , WaveEffect.cpp , FilmicEffect.cpp , CustomTextRenderer.cpp , BufferPacket.cpp , FilmicEffect.cpp , BufferPacket.cpp , ReinhardEffect.cpp , Marker.cpp , StspMediaSource.cpp , ReinhardEffect.cpp , StspMediaStream.cpp , StspStreamSink.cpp , DftEffect.cpp , DftTransform.cpp , RippleEffect.cpp
  • IndependentInputEntered : Resources.h
  • IndependentInputEventType : Resources.h
  • IndependentInputExited : Resources.h
  • IndependentInputHover : Resources.h
  • IndependentInputLost : Resources.h
  • IndependentInputMoved : Resources.h
  • IndependentInputPressed : Resources.h
  • IndependentInputReleased : Resources.h
  • InkingEventType : Resources.h
  • InstallService() : ServiceInstaller.cpp , ServiceInstaller.h
  • InterlockedExchangeRefPointer() : FrameRenderer.cpp
  • INVERTED : StereoProjection.h
  • ISBITMASK : DDSTextureLoader.cpp
  • IsCertificateValidAsync() : SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- p -

  • ParseApdu() : Utilities.cpp , Utilities.h
  • ParseColorDoubleByte() : Functions.xaml.cpp
  • PASTE_ITEM_INDEX : ContextMenuFlyout.xaml.h
  • PCONTEXT_HANDLE_TYPE : RpcInterface.Idl
  • PCONTEXT_HANDLE_TYPE_rundown() : RpcServer.cpp
  • PI_F : BasicMath.h
  • Playing : Scenario2_CardioidSound.xaml.h
  • PLAYPAUSE_CONTAINER_SIZE : MediaTransportControls.cpp
  • PLAYPAUSE_TESSELATION : MediaTransportControls.cpp
  • PLAYPAUSE_TEXT_SIZE : MediaTransportControls.cpp
  • PlayState : Scenario2_CardioidSound.xaml.h
  • PointerFromIBuffer() : Utilities.h , Utilities.cpp
  • PPCONTEXT_HANDLE_TYPE : RpcInterface.Idl
  • PREROLL_DURATION_SEC : MFSampleGenerator.h , MFSampleGenerator.cpp
  • pressedBackgroundFillColor() : Controls.cpp
  • previewButtonClicked : Scenario1_LowLatency.xaml.cpp
  • previewSetupCompleted : Scenario1_LowLatency.xaml.cpp
  • PrintAttributes() : Trace.cpp , Trace.h
  • PrintSampleInfo() : Trace.cpp , Trace.h
  • PROJECT_NAMESPACE : pch.h
  • PROPERTY_BLANKONPROTECTEDCONTENT : MrcVideoEffectDefinition.h
  • PROPERTY_GLOBALOPACITYCOEFFICIENT : MrcVideoEffectDefinition.h
  • PROPERTY_HOLOGRAMCOMPOSITIONENABLED : MrcVideoEffectDefinition.h
  • PROPERTY_LOOPBACKGAIN : MrcAudioEffectDefinition.h
  • PROPERTY_MAX_VSBUFFER : MrcVideoEffectDefinition.h
  • PROPERTY_MICROPHONEGAIN : MrcAudioEffectDefinition.h
  • PROPERTY_MIXERMODE : MrcAudioEffectDefinition.h
  • PROPERTY_OUTPUTSIZE : MrcVideoEffectDefinition.h
  • PROPERTY_PREFERREDHOLOGRAMPERSPECTIVE : MrcVideoEffectDefinition.h
  • PROPERTY_RECORDINGINDICATORENABLED : MrcVideoEffectDefinition.h
  • PROPERTY_SHOWHIDDENMESH : MrcVideoEffectDefinition.h
  • PROPERTY_STREAMTYPE : MrcVideoEffectDefinition.h
  • PROPERTY_VIDEOSTABILIZATIONBUFFERLENGTH : MrcVideoEffectDefinition.h
  • PROPERTY_VIDEOSTABILIZATIONENABLED : MrcVideoEffectDefinition.h
  • PRPC_CLIENT : RpcClientApi.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- r -

  • rate : RpcClientApi.h
  • ReadAndUnprotectFileAsync() : Utilities.cpp , Utilities.h
  • ReadFileToBufferAsync() : Utilities.cpp , Utilities.h
  • recordingStarted : Scenario1_LowLatency.xaml.cpp
  • RECT_DELTA : SceneComposer.h
  • RemoteClose() : RpcInterface.Idl , RpcServer.cpp
  • RemoteOpen() : RpcInterface.Idl , RpcServer.cpp
  • RenderSampleType : Common.h
  • RetrieveAppContentHelper() : S7_RetrieveWithAppContent.xaml.cpp
  • RetriveRpcClientFromHandle() : RpcClientApi.cpp
  • RETURN_IF_QSTATUS_ERROR : AllJoynHelpers.h
  • RIGHT : StereoProjection.h
  • RIPPLE_PROP : RippleEffect.h
  • RIPPLE_PROP_AMPLITUDE : RippleEffect.h
  • RIPPLE_PROP_CENTER : RippleEffect.h
  • RIPPLE_PROP_FREQUENCY : RippleEffect.h
  • RIPPLE_PROP_PHASE : RippleEffect.h
  • RIPPLE_PROP_SPREAD : RippleEffect.h
  • rotationArbitrary() : BasicMath.h
  • rotationX() : BasicMath.h
  • rotationY() : BasicMath.h
  • rotationZ() : BasicMath.h
  • RPC_CLIENT : RpcClientApi.cpp
  • RPC_CLIENT_HANDLE : RpcClientApi.h
  • RPC_STATIC_ENDPOINT : RpcServer.h , RpcClient.h
  • RpcClientClose() : RpcClientApi.cpp
  • RpcClientInitialize() : RpcClientApi.cpp
  • RpcServerDisconnect() : RpcServer.h , RpcServer.cpp
  • RpcServerStart() : RpcServer.cpp , RpcServer.h
  • RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT : MrcAudioEffectDefinition.h
  • RUNTIMECLASS_MIXEDREALITYCAPTURE_VIDEO_EFFECT : MrcVideoEffectDefinition.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- s -

  • s_hnsPerMillisecond : SeekBarElement.cpp
  • SAFE_ARRAYDELETE : Common.h
  • SAFE_DELETE : Common.h , Utilities.h
  • SAFE_DELETEARRAY : Utilities.h
  • SAFE_RELEASE : Common.h
  • SafeRelease() : Common.h
  • SampleBackgroundTaskEntryPoint : SampleConfiguration.h
  • SampleBackgroundTaskName : SampleConfiguration.h
  • SampleBackgroundTaskWithConditionName : SampleConfiguration.h
  • samplePeriod : RpcClientApi.h
  • SampleType16BitPCM : Common.h
  • SampleType24in32BitPCM : Common.h
  • SampleTypeFloat : Common.h
  • SampleTypeUnknown : Common.h
  • sampleVideos : VideoGallery.xaml.cpp
  • scale() : BasicMath.h
  • SCENARIO_PREFIX : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
  • scrollStep : PlaybackPage.xaml.cpp
  • SERVICE_ACCOUNT : HsaService.cpp
  • SERVICE_DEPENDENCIES : HsaService.cpp
  • SERVICE_DISPLAY_NAME : HsaService.cpp
  • SERVICE_NAME : HsaService.cpp
  • SERVICE_PASSWORD : HsaService.cpp
  • SERVICE_START_TYPE : HsaService.cpp
  • ServiceWorkerThread() : SampleService.cpp
  • ServicingCompleteTaskEntryPoint : SampleConfiguration.h
  • ServicingCompleteTaskName : SampleConfiguration.h
  • SET_SAMPLE_ATTRIBUTE : StspMediaStream.cpp
  • SET_SAMPLE_FLAG : StspStreamSink.cpp
  • SetSamplePeriod() : RpcInterface.Idl , RpcServer.cpp
  • SetSampleRate() : RpcClientApi.cpp
  • ShutdownRequested : RpcServer.cpp , stdafx.h
  • Size : FirmwareAccess.h
  • sizeof_composedStructure() : pch.h
  • StartMetering() : RpcInterface.Idl , RpcServer.cpp
  • StartMeteringAndWaitForStop() : RpcClientApi.cpp
  • static_assert() : PoseTrackingFrame.cpp
  • STEREO_CHANNEL : StereoProjection.h
  • STEREO_MODE : StereoProjection.h
  • STEREO_PARAMETERS : StereoProjection.h
  • StereoCreateDefaultParameters() : StereoProjection.cpp , StereoProjection.h
  • StopMetering() : RpcServer.cpp , RpcInterface.Idl
  • StopMeteringData() : RpcClientApi.cpp
  • Stopped : Scenario2_CardioidSound.xaml.h
  • StrokeCanceled : Resources.h
  • StrokeCollected : Resources.h
  • StrokeContinued : Resources.h
  • StrokeEnded : Resources.h
  • StrokeErased : Resources.h
  • StrokeEventType : Resources.h
  • StrokeStarted : Resources.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- t -

  • tenantId : Scenario7_B2B.xaml.cpp
  • Throw() : Trace.h
  • ThrowIfError() : Trace.h
  • ThrowIfFailed() : Common.h
  • THUMBSTICK_DEADZONE : MoveLookController.cpp , PlaybackPage.xaml.cpp
  • ticksPerSecond : SeekBarElement.cpp
  • TimeExpired : Simple3DGame.h
  • TimeSpanToMilliseconds() : Scenario1_Metrics.xaml.cpp
  • TimeTriggeredTaskName : SampleConfiguration.h
  • TONE_AMPLITUDE : ToneSampleGenerator.cpp
  • TONE_DURATION_SEC : ToneSampleGenerator.cpp
  • TRACE : Trace.h
  • Trace() : Trace.cpp , Trace.h
  • TRACE_LEVEL_HIGH : Trace.h
  • TRACE_LEVEL_LOW : Trace.h
  • TRACE_LEVEL_NORMAL : Trace.h
  • TraceError() : Trace.cpp , Trace.h , Trace.cpp
  • TRACEHR : Trace.h
  • TRACEHR_RET : Trace.h
  • TransformType : DftTransform.h
  • translation() : BasicMath.h
  • transpose() : BasicMath.h
  • TRIGGER_DEADZONE : MoveLookController.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- u -

  • uint : BasicMath.h
  • UninstallService() : ServiceInstaller.cpp , ServiceInstaller.h
  • UnprocessedInputEntered : Resources.h
  • UnprocessedInputEventType : Resources.h
  • UnprocessedInputExited : Resources.h
  • UnprocessedInputHover : Resources.h
  • UnprocessedInputLost : Resources.h
  • UnprocessedInputMoved : Resources.h
  • UnprocessedInputPressed : Resources.h
  • UnprocessedInputReleased : Resources.h
  • urlTemplate : Scenario12.xaml.cpp
  • USE_STORE_SIMULATOR : DirectXPage.xaml.h
  • USE_VS_RECOMMENDATION : pch.cpp , MainPage.xaml.cs
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- v -

  • VertexIndex_t : pch.h
  • Vertical : DftTransform.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- w -

  • WaitForInput : MoveLookController.h
  • Waiting : Simple3DGame.h
  • WAVE_PROP : WaveEffect.h
  • WAVE_PROP_FORCE_DWORD : WaveEffect.h
  • WAVE_PROP_OFFSET : WaveEffect.h
  • WAVE_PROP_SKEW_X : WaveEffect.h
  • WAVE_PROP_SKEW_Y : WaveEffect.h
  • WhiteboardDepth : Whiteboard.cpp
  • WINAPI_FAMILY : RpcClient.cpp , RpcClientApi.cpp
  • WinMain() : module.cpp
  • wmain() : HsaService.cpp
  • wWinMain() : App.cpp , AppView.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
Here is a list of all file members with links to the files they belong to:

- x -

  • XMASSERT : StereoProjection.cpp
  • XML : WaveEffect.cpp , RippleEffect.cpp , DftEffect.cpp , SdrOverlayEffect.cpp , ReinhardEffect.cpp , LuminanceHeatmapEffect.cpp , FilmicEffect.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- _ -

  • __STDC_WANT_SECURE_LIB__ : pch.h
  • _USE_MATH_DEFINES : ToneSampleGenerator.h , pch.h , Scenario7.xaml.cpp , Scenario3.xaml.cpp , Scenario2.xaml.cpp , BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- l -

  • LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME : FileLoggingSessionScenario.cpp
  • LOGGING_ENABLED_SETTING_KEY_NAME : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- m -

  • MAKEFOURCC : DDSTextureLoader.cpp
  • MANUFACTURER_NAME_LENGTH_MAX : FirmwareAccess.h
  • MAX_SHAPE_SIZE_PERCENTAGE : ShapeRenderer.h
  • METHODASYNCCALLBACK : Common.h
  • MILLISECONDS_TO_VISUALIZE : PlotData.h
  • MIN_SHAPE_SIZE_PERCENTAGE : ShapeRenderer.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- n -

  • NOMINMAX : pch.h , stdafx.h
  • NTDDI_VERSION : pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- o -

  • OSC_START_X : Scenario4.xaml.h
  • OSC_START_Y : Scenario4.xaml.h
  • OSC_TOTAL_HEIGHT : Scenario4.xaml.h
  • OSC_X_LENGTH : Scenario4.xaml.h
  • OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- a -

  • ADMIN_KEY_LENGTH_IN_BYTES : SampleConfiguration.h
  • ApplicationTriggerTaskName : SampleConfiguration.h
  • AUDIO_FILE_NAME : WASAPICapture.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- b -

  • BackgroundTaskGroupFriendlyName : SampleConfiguration.h
  • BackgroundTaskGroupId : SampleConfiguration.h
  • BITS_PER_BYTE : WASAPICapture.cpp
  • BUTTON_SIZE : BaseElement.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- c -

  • ChkHr : pch.h
  • CLAINS_COMPUTE_CRYPTO_CSUM : BgTask.cpp
  • CLAINS_GET_PROCESSING_OPTIONS : BgTask.cpp
  • CLAINS_READ_RECORD : BgTask.cpp
  • CLAINS_SELECT : BgTask.cpp
  • CO2_LEVEL_KEY : Scenario2_Polling.xaml.cpp , Scenario1_DataEvents.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- d -

  • DDS_ALPHA : DDSTextureLoader.cpp
  • DDS_CUBEMAP : DDSTextureLoader.cpp
  • DDS_CUBEMAP_ALLFACES : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEX : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEY : DDSTextureLoader.cpp
  • DDS_CUBEMAP_NEGATIVEZ : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEX : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEY : DDSTextureLoader.cpp
  • DDS_CUBEMAP_POSITIVEZ : DDSTextureLoader.cpp
  • DDS_FLAGS_VOLUME : DDSTextureLoader.cpp
  • DDS_FOURCC : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_LINEARSIZE : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_MIPMAP : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_PITCH : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_TEXTURE : DDSTextureLoader.cpp
  • DDS_HEADER_FLAGS_VOLUME : DDSTextureLoader.cpp
  • DDS_HEIGHT : DDSTextureLoader.cpp
  • DDS_LUMINANCE : DDSTextureLoader.cpp
  • DDS_LUMINANCEA : DDSTextureLoader.cpp
  • DDS_MAGIC : DDSTextureLoader.cpp
  • DDS_PAL8 : DDSTextureLoader.cpp
  • DDS_RGB : DDSTextureLoader.cpp
  • DDS_RGBA : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_CUBEMAP : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_MIPMAP : DDSTextureLoader.cpp
  • DDS_SURFACE_FLAGS_TEXTURE : DDSTextureLoader.cpp
  • DDS_WIDTH : DDSTextureLoader.cpp
  • DECLSPEC_NOVTABLE : StspDefs.h
  • DECLSPEC_UUID : StspDefs.h
  • DEFAULT_CHANNEL_NAME : LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp
  • DEFAULT_METERING_PERIOD : RpcServer.cpp
  • DEFAULT_SESSION_NAME : LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
  • DEFAULT_TEXTURE_SIZE : BaseControl.h
  • DRAW_SAMPLE_CONTENT : _360VideoPlaybackMain.cs , HolographicTagAlongSampleMain.h , 360VideoPlaybackMain.h , BasicHologramMain.h , HolographicApp1Main.cs , HolographicSpatialMappingMain.h , BasicHologramMain.cs , HolographicMRCSampleMain.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- e -

  • EFI_GLOBAL_VAR_GUID : uefi.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- f -

  • FLUSH_INTERVAL_SEC : WASAPICapture.h
  • FONT_SIZE : BaseElement.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- g -

  • GroupedBackgroundTaskName : SampleConfiguration.h
  • GUID_CUSTOMSYSTEMEVENTTRIGGERID_OSRUSBFX2 : Scenario6_CustomTrigger.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- h -

  • HRTF_2PI : OmnidirectionalSound.cpp , pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- i -

  • ISBITMASK : DDSTextureLoader.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- p -

  • PASTE_ITEM_INDEX : ContextMenuFlyout.xaml.h
  • PI_F : BasicMath.h
  • PREROLL_DURATION_SEC : MFSampleGenerator.h , MFSampleGenerator.cpp
  • PROJECT_NAMESPACE : pch.h
  • PROPERTY_BLANKONPROTECTEDCONTENT : MrcVideoEffectDefinition.h
  • PROPERTY_GLOBALOPACITYCOEFFICIENT : MrcVideoEffectDefinition.h
  • PROPERTY_HOLOGRAMCOMPOSITIONENABLED : MrcVideoEffectDefinition.h
  • PROPERTY_LOOPBACKGAIN : MrcAudioEffectDefinition.h
  • PROPERTY_MAX_VSBUFFER : MrcVideoEffectDefinition.h
  • PROPERTY_MICROPHONEGAIN : MrcAudioEffectDefinition.h
  • PROPERTY_MIXERMODE : MrcAudioEffectDefinition.h
  • PROPERTY_OUTPUTSIZE : MrcVideoEffectDefinition.h
  • PROPERTY_PREFERREDHOLOGRAMPERSPECTIVE : MrcVideoEffectDefinition.h
  • PROPERTY_RECORDINGINDICATORENABLED : MrcVideoEffectDefinition.h
  • PROPERTY_SHOWHIDDENMESH : MrcVideoEffectDefinition.h
  • PROPERTY_STREAMTYPE : MrcVideoEffectDefinition.h
  • PROPERTY_VIDEOSTABILIZATIONBUFFERLENGTH : MrcVideoEffectDefinition.h
  • PROPERTY_VIDEOSTABILIZATIONENABLED : MrcVideoEffectDefinition.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- r -

  • RECT_DELTA : SceneComposer.h
  • RETURN_IF_QSTATUS_ERROR : AllJoynHelpers.h
  • RPC_STATIC_ENDPOINT : RpcServer.h , RpcClient.h
  • RUNTIMECLASS_MIXEDREALITYCAPTURE_AUDIO_EFFECT : MrcAudioEffectDefinition.h
  • RUNTIMECLASS_MIXEDREALITYCAPTURE_VIDEO_EFFECT : MrcVideoEffectDefinition.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- s -

  • SAFE_ARRAYDELETE : Common.h
  • SAFE_DELETE : Utilities.h , Common.h
  • SAFE_DELETEARRAY : Utilities.h
  • SAFE_RELEASE : Common.h
  • SampleBackgroundTaskEntryPoint : SampleConfiguration.h
  • SampleBackgroundTaskName : SampleConfiguration.h
  • SampleBackgroundTaskWithConditionName : SampleConfiguration.h
  • SCENARIO_PREFIX : FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp , FileLoggingSessionScenario.cpp , LoggingSessionScenario.cpp
  • SERVICE_ACCOUNT : HsaService.cpp
  • SERVICE_DEPENDENCIES : HsaService.cpp
  • SERVICE_DISPLAY_NAME : HsaService.cpp
  • SERVICE_NAME : HsaService.cpp
  • SERVICE_PASSWORD : HsaService.cpp
  • SERVICE_START_TYPE : HsaService.cpp
  • ServicingCompleteTaskEntryPoint : SampleConfiguration.h
  • ServicingCompleteTaskName : SampleConfiguration.h
  • SET_SAMPLE_ATTRIBUTE : StspMediaStream.cpp
  • SET_SAMPLE_FLAG : StspStreamSink.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- t -

  • THUMBSTICK_DEADZONE : MoveLookController.cpp
  • TimeTriggeredTaskName : SampleConfiguration.h
  • TRACE : Trace.h
  • TRACEHR : Trace.h
  • TRACEHR_RET : Trace.h
  • TRIGGER_DEADZONE : MoveLookController.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- u -

  • USE_STORE_SIMULATOR : DirectXPage.xaml.h
  • USE_VS_RECOMMENDATION : MainPage.xaml.cs , pch.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- w -

  • WINAPI_FAMILY : RpcClient.cpp , RpcClientApi.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w
  • x

- x -

  • XMASSERT : StereoProjection.cpp
  • XML : WaveEffect.cpp , RippleEffect.cpp , DftEffect.cpp , SdrOverlayEffect.cpp , ReinhardEffect.cpp , LuminanceHeatmapEffect.cpp , FilmicEffect.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Action : Scenario1_LowLatency.xaml.cpp
  • DDS_ALPHA_MODE : DDSTextureLoader.cpp
  • DDS_MISC_FLAGS2 : DDSTextureLoader.cpp
  • GameState : Simple3DGame.h
  • LogEventAction : Resources.h
  • LogEventTypes : Resources.h
  • MoveLookControllerState : MoveLookController.h
  • PlayState : Scenario2_CardioidSound.xaml.h
  • RenderSampleType : Common.h
  • RIPPLE_PROP : RippleEffect.h
  • STEREO_CHANNEL : StereoProjection.h
  • STEREO_MODE : StereoProjection.h
  • TransformType : DftTransform.h
  • WAVE_PROP : WaveEffect.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • d
  • e
  • g
  • h
  • i
  • l
  • n
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • Active : Simple3DGame.h , MoveLookController.h

- d -

  • DDS_ALPHA_MODE_CUSTOM : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_OPAQUE : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_PREMULTIPLIED : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_STRAIGHT : DDSTextureLoader.cpp
  • DDS_ALPHA_MODE_UNKNOWN : DDSTextureLoader.cpp
  • DDS_MISC_FLAGS2_ALPHA_MODE_MASK : DDSTextureLoader.cpp

- e -

  • EventNone : Resources.h

- g -

  • GameComplete : Simple3DGame.h

- h -

  • Horizontal : DftTransform.h

- i -

  • IndependentInputEntered : Resources.h
  • IndependentInputEventType : Resources.h
  • IndependentInputExited : Resources.h
  • IndependentInputHover : Resources.h
  • IndependentInputLost : Resources.h
  • IndependentInputMoved : Resources.h
  • IndependentInputPressed : Resources.h
  • IndependentInputReleased : Resources.h
  • InkingEventType : Resources.h
  • INVERTED : StereoProjection.h

- l -

  • latencyModeToggled : Scenario1_LowLatency.xaml.cpp
  • LEFT : StereoProjection.h
  • LevelComplete : Simple3DGame.h
  • localClientButtonClicked : Scenario1_LowLatency.xaml.cpp

- n -

  • None : MoveLookController.h
  • NORMAL : StereoProjection.h

- p -

  • Playing : Scenario2_CardioidSound.xaml.h
  • previewButtonClicked : Scenario1_LowLatency.xaml.cpp
  • previewSetupCompleted : Scenario1_LowLatency.xaml.cpp

- r -

  • recordingStarted : Scenario1_LowLatency.xaml.cpp
  • RIGHT : StereoProjection.h
  • RIPPLE_PROP_AMPLITUDE : RippleEffect.h
  • RIPPLE_PROP_CENTER : RippleEffect.h
  • RIPPLE_PROP_FREQUENCY : RippleEffect.h
  • RIPPLE_PROP_PHASE : RippleEffect.h
  • RIPPLE_PROP_SPREAD : RippleEffect.h

- s -

  • SampleType16BitPCM : Common.h
  • SampleType24in32BitPCM : Common.h
  • SampleTypeFloat : Common.h
  • SampleTypeUnknown : Common.h
  • Stopped : Scenario2_CardioidSound.xaml.h
  • StrokeCanceled : Resources.h
  • StrokeCollected : Resources.h
  • StrokeContinued : Resources.h
  • StrokeEnded : Resources.h
  • StrokeErased : Resources.h
  • StrokeEventType : Resources.h
  • StrokeStarted : Resources.h

- t -

  • TimeExpired : Simple3DGame.h
  • TRACE_LEVEL_HIGH : Trace.h
  • TRACE_LEVEL_LOW : Trace.h
  • TRACE_LEVEL_NORMAL : Trace.h

- u -

  • UnprocessedInputEntered : Resources.h
  • UnprocessedInputEventType : Resources.h
  • UnprocessedInputExited : Resources.h
  • UnprocessedInputHover : Resources.h
  • UnprocessedInputLost : Resources.h
  • UnprocessedInputMoved : Resources.h
  • UnprocessedInputPressed : Resources.h
  • UnprocessedInputReleased : Resources.h

- v -

  • Vertical : DftTransform.h

- w -

  • WaitForInput : MoveLookController.h
  • Waiting : Simple3DGame.h
  • WAVE_PROP_FORCE_DWORD : WaveEffect.h
  • WAVE_PROP_OFFSET : WaveEffect.h
  • WAVE_PROP_SKEW_X : WaveEffect.h
  • WAVE_PROP_SKEW_Y : WaveEffect.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- _ -

  • __declspec() : FirmwareAccess.h , RpcClientApi.h , ServiceBase.cpp
  • _Acquires_lock_() : StspMediaSource.cpp
  • _captureFolder() : MainPage.xaml.cpp
  • _inputPropertiesBackup() : MainPage.xaml.cpp
  • _outputPropertiesBackup() : MainPage.xaml.cpp
  • _Releases_lock_() : StspMediaSource.cpp
  • _rotationHelper() : MainPage.xaml.cpp
  • _videoStabilizationEffect() : MainPage.xaml.cpp
  • _XMMatrixStereoProjectionHelper() : StereoProjection.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- l -

  • length() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- m -

  • m_imageMaxCLL() : DirectXPage.xaml.cpp
  • m_isComputeSupported() : D2DAdvancedColorImagesRenderer.cpp
  • m_isImageValid() : DirectXPage.xaml.cpp
  • m_parentFocusedPosition() : BaseElement.cpp
  • m_parentTextureHeight() : BaseElement.cpp
  • m_parentTextureWidth() : BaseElement.cpp
  • main() : App.cpp , AppView.cpp , VisualProperties.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp , App.cpp , AppView.cpp
  • MapCoordinates() : Scenario7.xaml.cpp
  • MatrixStereoProjectionFovLH() : StereoProjection.h , StereoProjection.cpp
  • MeteringDataEvent() : RpcInterface.Idl , RpcClient.cpp
  • MeteringWorkerTpCallback() : Metering.cpp
  • midl_user_allocate() : RpcServer.cpp , RpcClient.cpp
  • midl_user_free() : RpcServer.cpp , RpcClient.cpp
  • mul() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- n -

  • normalize() : BasicMath.h
  • NotifyStatusMessage() : pch.cpp , pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- o -

  • operator*() : BasicMath.h
  • operator+() : BasicMath.h
  • operator-() : BasicMath.h
  • operator/() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- a -

  • ActivatableClass() : StspSchemeHandler.cpp
  • AppendFile() : Utilities.cpp , Utilities.h
  • ApplyScale() : SampleConfiguration.cpp
  • AsComPtr() : FrameRenderer.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- b -

  • ByteArrayToString() : Utilities.cpp , Utilities.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- c -

  • ChkHR() : Utilities.cpp , Utilities.h
  • Convert() : ToneSampleGenerator.h
  • Convert< float >() : ToneSampleGenerator.cpp
  • Convert< int24in32 >() : ToneSampleGenerator.cpp
  • Convert< short >() : ToneSampleGenerator.cpp
  • CountEmployeesInternal() : Functions.xaml.cpp
  • create_empty_task() : OcrCapturedImage.xaml.cpp
  • CreateDDSTextureFromMemory() : DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h
  • CreateDDSTextureFromMemoryEx() : DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp , DDSTextureLoader.h , DDSTextureLoader.cpp
  • CreateFromHeadingPitchRoll() : PlaybackPage.xaml.cpp
  • cross() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- d -

  • DEFINE_GUID() : Fx2Driver.cpp , FilmicEffect.h , LuminanceHeatmapEffect.h , SdrOverlayEffect.h , RippleEffect.h , WaveEffect.h , SdrOverlayEffect.h , WaveEffect.h , LuminanceHeatmapEffect.h , DftEffect.h , DftTransform.h , FilmicEffect.h , ReinhardEffect.h , DftTransform.h , RippleEffect.h , ReinhardEffect.h , DftTransform.h
  • DllCanUnloadNow() : module.cpp
  • DllGetActivationFactory() : module.cpp
  • dot() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- e -

  • enabledForegroundColor() : Controls.cpp
  • ExecuteQueryHelper() : S3_RetrieveWithAPI.xaml.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- f -

  • FindSmBiosTable() : smbios.cpp
  • focusOutlineColor() : Controls.cpp
  • FreeSidArray() : RpcServer.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- g -

  • GetArrayFromBuffer() : pch.cpp , pch.h
  • GetCallbackCount() : RpcClientApi.cpp
  • GetCurrentDateTime() : Scenario9.xaml.cpp
  • GetCurrentTimeString() : Utilities.cpp , Utilities.h
  • GetDataLabelString() : DataHelpers.h , DataHelpers.cpp
  • GetDataString() : DataHelpers.cpp , DataHelpers.h
  • GetDisplayContent() : Scenario3CustomOptions.xaml.cpp
  • GetDwriteTextAlignment() : TextRenderer.cpp
  • GetHexDigit() : Functions.xaml.cpp
  • GetManufacturerNameFromSmbios() : smbios.cpp
  • GetMeteringData() : RpcClientApi.cpp
  • GetRenderSampleType() : Common.h
  • GetScreenTranslation() : TextRenderer.cpp
  • GetSecureBootEnabledFromUefi() : uefi.cpp
  • GetSmBiosString() : smbios.cpp
  • GetUnderlyingBuffer() : Scenario1.xaml.cpp
  • GetValueFromPropertySet() : pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- i -

  • IBufferFromArray() : Utilities.cpp , Utilities.h
  • IBufferFromPointer() : Utilities.h , Utilities.cpp
  • identity() : BasicMath.h
  • IFACEMETHODIMP_() : StspMediaStream.cpp , StspMediaSource.cpp , Marker.cpp , FilmicEffect.cpp , BufferPacket.cpp , WaveEffect.cpp , CustomTextRenderer.cpp , RippleEffect.cpp , FilmicEffect.cpp , DftTransform.cpp , ReinhardEffect.cpp , BufferPacket.cpp , ReinhardEffect.cpp , DftEffect.cpp , StspStreamSink.cpp , RippleEffect.cpp
  • InstallService() : ServiceInstaller.h , ServiceInstaller.cpp
  • InterlockedExchangeRefPointer() : FrameRenderer.cpp
  • IsCertificateValidAsync() : SampleConfiguration.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- p -

  • ParseApdu() : Utilities.cpp , Utilities.h
  • ParseColorDoubleByte() : Functions.xaml.cpp
  • PCONTEXT_HANDLE_TYPE_rundown() : RpcServer.cpp
  • PointerFromIBuffer() : Utilities.cpp , Utilities.h
  • pressedBackgroundFillColor() : Controls.cpp
  • PrintAttributes() : Trace.h , Trace.cpp
  • PrintSampleInfo() : Trace.cpp , Trace.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- r -

  • ReadAndUnprotectFileAsync() : Utilities.cpp , Utilities.h
  • ReadFileToBufferAsync() : Utilities.h , Utilities.cpp
  • RemoteClose() : RpcInterface.Idl , RpcServer.cpp
  • RemoteOpen() : RpcServer.cpp , RpcInterface.Idl
  • RetrieveAppContentHelper() : S7_RetrieveWithAppContent.xaml.cpp
  • RetriveRpcClientFromHandle() : RpcClientApi.cpp
  • rotationArbitrary() : BasicMath.h
  • rotationX() : BasicMath.h
  • rotationY() : BasicMath.h
  • rotationZ() : BasicMath.h
  • RpcClientClose() : RpcClientApi.cpp
  • RpcClientInitialize() : RpcClientApi.cpp
  • RpcServerDisconnect() : RpcServer.cpp , RpcServer.h
  • RpcServerStart() : RpcServer.h , RpcServer.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- s -

  • SafeRelease() : Common.h
  • scale() : BasicMath.h
  • ServiceWorkerThread() : SampleService.cpp
  • SetSamplePeriod() : RpcInterface.Idl , RpcServer.cpp
  • SetSampleRate() : RpcClientApi.cpp
  • sizeof_composedStructure() : pch.h
  • StartMetering() : RpcInterface.Idl , RpcServer.cpp
  • StartMeteringAndWaitForStop() : RpcClientApi.cpp
  • static_assert() : PoseTrackingFrame.cpp
  • StereoCreateDefaultParameters() : StereoProjection.h , StereoProjection.cpp
  • StopMetering() : RpcServer.cpp , RpcInterface.Idl
  • StopMeteringData() : RpcClientApi.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- t -

  • Throw() : Trace.h
  • ThrowIfError() : Trace.h
  • ThrowIfFailed() : Common.h
  • TimeSpanToMilliseconds() : Scenario1_Metrics.xaml.cpp
  • Trace() : Trace.cpp , Trace.h
  • TraceError() : Trace.cpp , Trace.h , Trace.cpp
  • translation() : BasicMath.h
  • transpose() : BasicMath.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- u -

  • UninstallService() : ServiceInstaller.cpp , ServiceInstaller.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- w -

  • WinMain() : module.cpp
  • wmain() : HsaService.cpp
  • wWinMain() : AppView.cpp , App.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • float2 : BasicMath.h
  • float3 : BasicMath.h
  • float4 : BasicMath.h
  • float4x4 : BasicMath.h
  • HighScoreEntries : Simple3DGame.h
  • PPCONTEXT_HANDLE_TYPE : RpcInterface.Idl
  • PRPC_CLIENT : RpcClientApi.cpp
  • RPC_CLIENT : RpcClientApi.cpp
  • RPC_CLIENT_HANDLE : RpcClientApi.h
  • STEREO_CHANNEL : StereoProjection.h
  • STEREO_MODE : StereoProjection.h
  • STEREO_PARAMETERS : StereoProjection.h
  • uint : BasicMath.h
  • VertexIndex_t : pch.h
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • w

- _ -

  • _colorNames : Functions.xaml.cpp
  • _colors : Functions.xaml.cpp
  • _inputElements : Scenario1_WriteReadStream.xaml.cpp

- a -

  • AID_MC : BgTask.cpp
  • AID_NONPAYMENT : BgTask.cpp
  • AID_PPSE : BgTask.cpp
  • AID_V : BgTask.cpp
  • appIdUri : Scenario7_B2B.xaml.cpp

- b -

  • backgroundTaskName : Scenario3_BackgroundDeviceWatcher.cpp

- c -

  • c_MaximumSignatureLength : AllJoynHelpers.h
  • c_maxSecondsInPerformPressedFeedbackState : Controls.cpp
  • c_MessageTimeoutInMilliseconds : AllJoynHelpers.h
  • CanvasBackgroundColor : pch.h
  • clientId : Scenario7_B2B.xaml.cpp
  • clientSecret : Scenario7_B2B.xaml.cpp
  • constantFocusPointColor : BaseControl.cpp
  • constantFocusPointIntensity : BaseControl.cpp
  • constantFocusPointRadius : BaseControl.cpp
  • CustomCapabilityName : RpcServer.cpp

- d -

  • DDS_MAGIC : DDSTextureLoader.cpp
  • DEFAULT_SIZE : Controls.cpp
  • defaultGlassColor : BaseControl.cpp
  • dxgiDefaultDPI : DeviceResources.cpp

- e -

  • END_OF_PLAYBACK_BUFFER_MS : SeekBarElement.cpp

- g -

  • g_dwLogLevel : Trace.cpp
  • g_dwTraceLevel : Trace.h
  • g_listener : FontDownloadListener.cpp
  • GUID_ActivitySensor_ClassId : pch.h
  • GUID_CustomSensorDevice_VendorDefinedSubTypeID : Scenario1_DataEvents.xaml.cpp
  • GUID_CustomSensorDevice_VendorDefinedTypeID : Scenario2_Polling.xaml.cpp
  • GUID_Pedometer_ClassId : pch.h
  • GuidBufferLength : PoseTrackingFrame.cpp

- h -

  • hresult_not_found : Scenario2_Manage.cpp
  • HundredNanoSecondsToMilliseconds : Scenario1_Events.xaml.cpp

- i -

  • idl : RpcInterface.Idl

- j -

  • json : ShareCustomData.xaml.cpp

- l -

  • LARGE_CANVAS_HEIGHT : Scenario1_CustomDry.xaml.cpp
  • LARGE_CANVAS_WIDTH : Scenario1_CustomDry.xaml.cpp

- m -

  • MAX_INACTIVE_TIME_TO_HIDE : MediaTransportControls.cpp
  • MAX_TEXT_LAYOUT_SIZE : BaseElement.cpp
  • MeteringData : RpcClientApi.h
  • millisecondsPerSecond : SeekBarElement.cpp
  • mouseWheelData : PlaybackPage.xaml.cpp
  • MTC_SPAWN_DISTANCE : 360VideoPlaybackMain.cpp

- p -

  • PCONTEXT_HANDLE_TYPE : RpcInterface.Idl
  • PLAYPAUSE_CONTAINER_SIZE : MediaTransportControls.cpp
  • PLAYPAUSE_TESSELATION : MediaTransportControls.cpp
  • PLAYPAUSE_TEXT_SIZE : MediaTransportControls.cpp

- r -

  • rate : RpcClientApi.h

- s -

  • s_hnsPerMillisecond : SeekBarElement.cpp
  • samplePeriod : RpcClientApi.h
  • sampleVideos : VideoGallery.xaml.cpp
  • scrollStep : PlaybackPage.xaml.cpp
  • ShutdownRequested : RpcServer.cpp , stdafx.h
  • Size : FirmwareAccess.h

- t -

  • tenantId : Scenario7_B2B.xaml.cpp
  • THUMBSTICK_DEADZONE : PlaybackPage.xaml.cpp
  • ticksPerSecond : SeekBarElement.cpp
  • TONE_AMPLITUDE : ToneSampleGenerator.cpp
  • TONE_DURATION_SEC : ToneSampleGenerator.cpp

- u -

  • urlTemplate : Scenario12.xaml.cpp

- w -

  • WhiteboardDepth : Whiteboard.cpp
Generated on Fri Nov 15 2024 22:24:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Main Page

Windows-Universal-Examples Documentation

End-User License Agreement

Introduction

This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and SIEMA ("Licensor") for the use of SIEMA-REFERENCE ("Software"). This EULA governs your use of the Software provided by the Licensor. By installing or using the Software, you agree to be bound by the terms of this EULA.

License Grant

Licensor grants you a revocable, non-exclusive, non-transferable, limited license to download, install, and use the Software solely for your personal or commercial purposes strictly in accordance with the terms of this Agreement.

Restrictions on Use

You agree not to, and you will not permit others to:

  • Modify, or create derivative works of the Software;
  • Distribute, transfer, sublicense, lease, lend, or rent the Software to any third party;
  • Reverse engineer, decompile or disassemble the Software, except to the extent expressly permitted by applicable law;
  • Remove, alter, or obscure any proprietary notices on the Software;
  • Use the Software in any manner that could damage, disable, overburden, or impair the Software;
  • Use the Software to create or distribute any malicious software or for any unlawful purpose.

Related Agreements

By agreeing to this EULA, you also agree to comply with the terms of Terms and Conditions, Privacy Policy, and any other agreements incorporated herein by reference.

Jurisdiction

This EULA and any disputes arising out of or in connection with it will be governed by and construed in accordance with the laws of Switzerland, without regard to its conflict of laws principles. Any legal actions or proceedings arising out of this EULA shall be brought exclusively in the courts of Switzerland.Intellectual Property & Copyright Infringement

The Software and all rights, title, and interest in and to the Software, including all intellectual property rights therein, are and will remain the exclusive property of the Licensor. You agree to notify the Licensor promptly if you become aware of any infringement of the Licensor’s intellectual property rights in the Software.Termination of Licensing

Licensor may terminate this EULA at any time if you fail to comply with any term(s) of this Agreement. Upon termination, you must cease all use of the Software and destroy all copies, full or partial, of the Software.

Warranty Disclaimer

THE SOFTWARE IS PROVIDED "AS IS". LICENSOR MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. YOU BEAR THE ENTIRE RISK AS TO SELECTING THE SOFTWARE FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.

Limitations of Liability

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES, RESULTING FROM:

  1. YOUR USE OR INABILITY TO USE THE SOFTWARE;
  2. ANY UNAUTHORIZED ACCESS TO OR USE OF OUR SERVERS AND/OR ANY PERSONAL INFORMATION STORED THEREIN;
  3. ANY INTERRUPTION OR CESSATION OF TRANSMISSION TO OR FROM THE SOFTWARE;
  4. ANY ERRORS OR OMISSIONS IN ANY CONTENT OR FOR ANY LOSS OR DAMAGE INCURRED AS A RESULT OF YOUR USE OF ANY CONTENT POSTED, EMAILED, TRANSMITTED, OR OTHERWISE MADE AVAILABLE THROUGH THE SOFTWARE;
  5. THE DEFAMATORY, OFFENSIVE, OR ILLEGAL CONDUCT OF ANY THIRD PARTY.

Business Contact Information

If you have any questions about this EULA, please contact us at:

Siema
siema.switzerland@gmail.com

By installing or using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms and conditions.

Generated on Fri Nov 15 2024 22:16:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- k -

  • KeepConnectionOpenScenario : SDKTemplate
  • KneeLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • KneeRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- l -

  • Left : HolographicPaint
  • LeftHand : HolographicPaint
  • LevelStart : GameControl
  • LineSpacingMethod : DWriteTextLayoutImplementation
  • LoadGame : GameControl
  • Loading : GameControl
  • LoadSavedJson() : winrt::BackgroundTask
  • LoadStateEventHandler()
: SDKTemplate::Common
, AdventureWorks::Common
  • LocalTimeOfDay() : winrt::SDKTemplate::implementation
  • LocationBackgroundTask : BackgroundTask
  • LogFileGenerated : SDKTemplate
  • LogFileGeneratedAtDisable : SDKTemplate
  • LogFileGeneratedAtSuspend : SDKTemplate
  • LoggingEnabledDisabled : SDKTemplate
  • LoggingScenarioEventType : SDKTemplate
  • LookupBackgroundTask() : winrt::SDKTemplate
  • Loopback : MrcEffectDefinitions
  • Low : Microsoft::SDKSamples::Kitchen , HttpFilters
  • LuminanceHeatmap : D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- m -

  • MappingRecognizeTextFromService() : ELS::Private
  • MasterDetailPage : MasterDetailApp
  • Medium : Microsoft::SDKSamples::Kitchen , HttpFilters
  • MeteredConnectionPriority : HttpFilters
  • Mic : MrcEffectDefinitions
  • MicAndLoopback : MrcEffectDefinitions
  • MillisecondsFromTimeSpan() : SDKTemplate::Helpers
  • minScreenWidth : SDKTemplate
  • MinWindowHeight : winrt::SDKTemplate::implementation
  • MinWindowWidth : winrt::SDKTemplate::implementation
  • MixedRealityCapturePerspective : MrcEffectDefinitions
  • MsftOui : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- n -

  • Neck : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • NetworkCamera() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • None : DX , Simple3DGameXaml , HolographicPaint , SDKTemplate , D2DAdvancedColorImages , Simple3DGameDX
  • Normal : winrt::SDKTemplate
  • NoSourceId : HolographicPaint
  • Not() : SDKTemplate
  • NotAPerceptionMediaType : WindowsPreview::Media::Capture::Frames
  • NotAPoseTrackingFrame : WindowsPreview::Media::Capture::Frames
  • NotifyType : NfcSample , SDKTemplate , SDKSample , SDKTemplate , ScreenCasting , SDKTemplate , SDKSample
  • NotTracked : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- o -

  • OcrCapturedImage : SDKTemplate
  • OcrFileImage : SDKTemplate
  • ODHModel : SDKTemplate
  • OnboardingAuthenticationType : AllJoynConsumerExperiences , AllJoynProducerExperiences
  • OnIndexerOperationBegin() : SDKTemplate
  • OnIndexerOperationComplete() : SDKTemplate
  • OpenCloseConnectionScenario : SDKTemplate
  • OptIn : HttpFilters , winrt::SDKTemplate
  • OtherScenarios : SDKTemplate
  • Oven : Microsoft::SDKSamples::Kitchen
  • OvenTemperature : Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- a -

  • AACValidAttributes : anonymous_namespace{Validation.cpp}
  • AccessSoftwareBitmap() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • activatable() : Microsoft::SDKSamples::Kitchen
  • Activated : SDKTemplate
  • AddAppContentFilesToIndexedFolder() : SDKTemplate
  • AddItem() : SDKTemplate::Helpers
  • AddItemsToIndex() : SDKTemplate
  • AddVideoCastingIfSupported() : SDKTemplate , winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • ADMIN_KEY_LENGTH_IN_BYTES : winrt::SDKTemplate
  • alignas() : CameraStreamCoordinateMapper
  • All : SDKTemplate
  • ANIMATION_OPACITY_END : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_OPACITY_START : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_TRANSLATION_END : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_TRANSLATION_START : anonymous_namespace{SecondaryViewPage.cpp}
  • AnkleLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • AnkleRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • AnyHandSourceId : HolographicPaint
  • App_Construct() : winrt::SDKTemplate
  • App_LaunchCompleted() : winrt::SDKTemplate
  • App_OnActivated() : winrt::SDKTemplate
  • App_OnFileActivated() : winrt::SDKTemplate
  • App_OverrideOnLaunched() : winrt::SDKTemplate
  • AppendLine() : winrt::SDKTemplate
  • ApplicationMode : HolographicPaint
  • ApplyLanguageFont() : winrt::SDKTemplate
  • AreCertificateAndCertChainValidAsync() : winrt::SDKTemplate
  • AudioMixerMode : MrcEffectDefinitions
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- b -

  • BackgroundAuthenticationCompletedEventHandler() : SDKTemplate
  • BackgroundDeviceWatcher : BackgroundDeviceWatcherTask
  • BackgroundTaskStatus : BackgroundTasks::Helpers
  • Bars : SDKTemplate
  • BarsVisible : SDKTemplate
  • BatteryPercent : SDKTemplate
  • BatteryVisible : SDKTemplate
  • bigRectSize : SDKTemplate
  • Bluetooth() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLE() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLEDeviceDisplay : SDKTemplate
  • BluetoothLEPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLEUnpairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothUnpairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BodyPart : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • Bottom : HolographicPaint
  • Bread : Microsoft::SDKSamples::Kitchen
  • BreadBakedEventArgs : Microsoft::SDKSamples::Kitchen
  • BuildWebSocketError() : winrt::SDKTemplate
  • BusyStatusChanged : SDKTemplate
  • Button_Click_ApplyNow() : SDKTemplate
  • Button_Click_Save() : SDKTemplate
  • ButtonShape : DX
  • ButtonState : DX
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- c -

  • c_cbMaxPacketSize : anonymous_namespace{StspMediaSource.cpp}
  • c_cbReceiveBuffer : anonymous_namespace{StspMediaSink.cpp}
  • c_cbReceiveBufferSize : anonymous_namespace{StspMediaSource.cpp}
  • c_OnboardingIntrospectionXml : org::alljoyn::Onboarding
  • c_SecureInterfaceIntrospectionXml : com::microsoft::Samples::SecureInterface
  • c_wStspDefaultPort : Microsoft::Samples::SimpleCommunication
  • CalculateChallengeResponse() : winrt::SDKTemplate
  • CaptureFailedHandler() : SDKTemplate
  • Capturing : SDKTemplate
  • CardName : Pcsc
  • CharacteristicList_SelectionChanged() : SDKTemplate
  • CharacteristicReadButton_Click() : SDKTemplate
  • CharacteristicWriteButton_Click() : SDKTemplate
  • CharacteristicWriteButtonInt_Click() : SDKTemplate
  • check_enumerator() : winrt::SDKTemplate
  • CheckBackgroundAndRequestLocationAccess() : winrt::SDKTemplate
  • ChooseTool : HolographicPaint
  • Circle : DX
  • Cla : Iso7816
  • ClaXx : Iso7816
  • ColorRampDuration : anonymous_namespace{Scenario2_Effects.cpp}
  • completed_ui_task() : SDKTemplate
  • ConfigurationState : AllJoynProducerExperiences
  • ConfigureWiFiResultStatus : AllJoynConsumerExperiences , AllJoynProducerExperiences
  • ConnectButton_Click() : SDKTemplate
  • ConnectedDevice : SDKTemplate
  • ConnectionResultCode : AllJoynConsumerExperiences , AllJoynProducerExperiences
  • ConnectionSettingsPanel : SDKTemplate
  • ConnectTask : BackgroundTask
  • Conservative : winrt::SDKTemplate
  • ContentType : SDKSample::WASAPIAudio , winrt::SDKTemplate
  • ContentTypeFile : SDKSample::WASAPIAudio
  • ContentTypeTone : SDKSample::WASAPIAudio
  • ContinueLevel : GameControl
  • Control_Button : HolographicMRCSample
  • Control_CameraPreview : HolographicMRCSample
  • Control_Panel : HolographicMRCSample
  • Control_Unknown : HolographicMRCSample
  • ControlType : HolographicMRCSample
  • ConvertDipsToPixels() : DX
  • ConvertPixelsToDips() : DX
  • ConvertPropertiesToMediaType() : anonymous_namespace{StspMediaSink.cpp}
  • ConvertToColorF() : DX
  • CoordinateTransformationMethod() : SDKTemplate
  • CopyFiles : SDKTemplate
  • CopyImage : SDKTemplate
  • CopySoftwareBitmapToDirect3DTexture() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • CopyText : SDKTemplate
  • CostGuidance : winrt::SDKTemplate
  • create_delayed_task() : SDKTemplate
  • CreateAndInitializeAsync() : DX
  • CreateBuffer() : DX
  • CreateBufferPacket() : Microsoft::Samples::SimpleCommunication::Network
  • CreateBufferPacketFromMFSample() : Microsoft::Samples::SimpleCommunication::Network
  • CreateDDSTextureFromFile() : DirectX
  • CreateDDSTextureFromFileEx() : DirectX
  • CreateDDSTextureFromMemory() : DirectX
  • CreateDDSTextureFromMemoryEx() : DirectX
  • CreateDepthStencilView() : DX
  • CreateDepthTextureInteropObject() : DX
  • CreateHttpClientWithCustomHeaders() : winrt::SDKTemplate::Helpers
  • CreateInputLayout() : DX
  • CreateItemString() : SDKTemplate
  • CreateMarker() : Microsoft::Samples::SimpleCommunication
  • CreateMediaBufferWrapper() : Microsoft::Samples::SimpleCommunication::Network
  • CreateNetworkClient() : Microsoft::Samples::SimpleCommunication::Network
  • CreateNetworkServer() : Microsoft::Samples::SimpleCommunication::Network
  • CreatePackageAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • CreatePackageFromXmlAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • CreatePixelShader() : DX
  • CreateProductListFromQueryResult() : SDKTemplate::Utils
  • CreateRenderTargetView() : DX
  • CreateSamplerState() : DX
  • CreateShaderResourceView() : DX
  • CreateTexture() : DX
  • CreateVertexShader() : DX
  • CreateWICTextureFromMemory() : DX
  • CreateWICTextureFromMemoryEx() : DX
  • Crop : SDKTemplate
  • CustomEffectFrameCount : anonymous_namespace{Scenario2_Effects.cpp}
  • CustomOui : SDKTemplate
  • CustomOuiType : SDKTemplate
  • CustomTextBox : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- d -

  • DaysUntil() : SDKTemplate::Utils
  • DDS_ALPHA_MODE : DirectX
  • DDS_ALPHA_MODE_CUSTOM : DirectX
  • DDS_ALPHA_MODE_OPAQUE : DirectX
  • DDS_ALPHA_MODE_PREMULTIPLIED : DirectX
  • DDS_ALPHA_MODE_STRAIGHT : DirectX
  • DDS_ALPHA_MODE_UNKNOWN : DirectX
  • Deactivated : GameControl
  • DebugWriteLine() : winrt::BackgroundDeviceWatcherTask::implementation
  • DECLSPEC_UUID()
: Microsoft::Samples::SimpleCommunication
, Microsoft::Samples::SimpleCommunication::Network
  • Default : DWriteTextLayoutImplementation
  • DefaultControllerScale : HolographicPaint
  • DEFINE_GUID() : MFPoseTrackingPreview
  • DelayAsync() : SDKTemplate::Helpers
  • Descriptor : CustomUsbDeviceAccess
  • DetailPage : MasterDetailApp
  • DeviceClass : Pcsc::Common
  • DeviceClosingHandler : SDKTemplate
  • DeviceInformationDisplay : SDKTemplate
  • DeviceState : SDKSample::WASAPIAudio , SDKTemplate
  • DeviceStateActivated : SDKSample::WASAPIAudio
  • DeviceStateCapturing : SDKSample::WASAPIAudio
  • DeviceStateChangedHandler() : SDKSample::WASAPIAudio
  • DeviceStateDiscontinuity : SDKSample::WASAPIAudio
  • DeviceStateFlushing : SDKSample::WASAPIAudio
  • DeviceStateInError : SDKSample::WASAPIAudio
  • DeviceStateInitialized : SDKSample::WASAPIAudio
  • DeviceStatePaused : SDKSample::WASAPIAudio
  • DeviceStatePausing : SDKSample::WASAPIAudio
  • DeviceStatePlaying : SDKSample::WASAPIAudio
  • DeviceStateStarting : SDKSample::WASAPIAudio
  • DeviceStateStopped : SDKSample::WASAPIAudio
  • DeviceStateStopping : SDKSample::WASAPIAudio
  • DeviceStateUnInitialized : SDKSample::WASAPIAudio
  • DeviceType : SDKTemplate , CustomUsbDeviceAccess , CustomHidDeviceAccess
  • DialAllApps() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • Dimensions : Microsoft::SDKSamples::Kitchen
  • DipsToPixels() : DX
  • DipsToPixelsCeil() : DX
  • DipsToPixelsFloor() : DX
  • Disabled : DWriteTextLayoutImplementation
  • Discontinuity : SDKTemplate
  • DiscoveredDevice : SDKTemplate
  • Display : MrcEffectDefinitions
  • DisplayContent : SDKTemplate , PrintSample
  • DisplayName : SDKTemplate
  • DisplayRoundingAlgorithmAsString() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DisplayTextResultAsync() : winrt::SDKTemplate::Helpers
  • DisplayToast() : winrt::BackgroundTask
  • DisplayWebError() : winrt::SDKTemplate::Helpers
  • DoCurrencyRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoIncrementRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoPaddingAndRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoPaddingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoSignificantDigitRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DPadAction : HolographicPaint
  • Drawing : HolographicPaint
  • duplicate() : anonymous_namespace{Scenario3.cpp}
  • Dynamics : GameControl
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- e -

  • EffectUpdateInterval : anonymous_namespace{Scenario2_Effects.cpp}
  • ElbowLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ElbowRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • EMPTY_TITLE : anonymous_namespace{SecondaryViewPage.cpp}
  • Enabled : DWriteTextLayoutImplementation
  • EnumerateButton_Click() : SDKTemplate
  • Error : SDKTemplate
  • ErrorMessage : SDKSample , SDKTemplate
  • EvaluateAndReportConnectionCost() : winrt::SDKTemplate
  • EvaluateCostAndConnectAsync() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- f -

  • File : winrt::SDKTemplate
  • FillItemsFromSavedJson() : winrt::SDKTemplate
  • FilmicTonemap : D2DAdvancedColorImages
  • FilterOutputMediaType() : Microsoft::Samples::SimpleCommunication
  • FindIdsInString() : anonymous_namespace{Scenario1_FindId.cpp}
  • FindMediaTypeDescriptor() : anonymous_namespace{Validation.cpp}
  • FindScrollViewer() : winrt::SDKTemplate
  • FindSupportedFeedback() : winrt::SDKTemplate
  • FixTextureContentTypeAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • Float : winrt::SDKTemplate
  • Flushing : SDKTemplate
  • FontDownloadCompletedHandler() : DWriteTextLayoutCloudFontImplementation
  • FontLineGapUsage : DWriteTextLayoutImplementation
  • FootLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • FootRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ForEach() : anonymous_namespace{StspMediaSink.cpp}
  • FormatDateTime()
: winrt::SDKTemplate
, winrt::BackgroundTask
  • FrameBufferReleased : WindowsPreview::Media::Capture::Frames
  • FromInspectable() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- g -

  • g_adminKey : winrt::SDKTemplate
  • g_smartCardReaderDeviceId : winrt::SDKTemplate
  • GameInfoOverlayCommand : Simple3DGameDX , Simple3DGameXaml , Simple3DGameDX
  • GameInfoOverlayState : GameControl
  • GameOverCompleted : GameControl
  • GameOverExpired : GameControl
  • GameStats : GameControl
  • GattNativeCharacteristicUuid : SDKTemplate
  • GattNativeDescriptorUuid : SDKTemplate
  • GattNativeServiceUuid : SDKTemplate
  • GeneratedBitmapEffectFrameCount : anonymous_namespace{Scenario2_Effects.cpp}
  • GenerateIntrinsicsMapping() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • GenerateResult()
: anonymous_namespace{Scenario2_StringTemplate.cpp}
, anonymous_namespace{Scenario3_ParameterizedTemplate.cpp}
, anonymous_namespace{Scenario6_TimeZone.cpp}
  • GenerateSampleStreamAsync() : anonymous_namespace{Scenario05_PostStream.cpp}
  • GeofenceBackgroundTask : BackgroundTask
  • GeometryShader_Max : DX
  • GeometryShader_Simple : DX
  • GeometryShader_Texture : DX
  • GeometryShaderIndex : DX
  • GetAdminKey() : winrt::SDKTemplate
  • GetCameraIntrinsicsConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
  • GetCharacteristicName() : winrt::SDKTemplate::DisplayHelpers
  • GetCurrentDateTimeAsString() : SDKTemplate::Helpers
  • GetDataFromIBuffer() : WindowsHolographicCodeSamples
  • GetDXColor() : DX
  • GetDxgiFormat() : DX
  • GetElementRect() : winrt::SDKTemplate
  • GetFirstBarcodeScannerAsync() : SDKTemplate::DeviceHelpers
  • GetFirstCashDrawerAsync() : SDKTemplate::DeviceHelpers
  • GetFirstMagneticStripeReaderAsync() : SDKTemplate::DeviceHelpers
  • GetFriendlyName() : winrt::SDKTemplate
  • GetNetworkCostGuidance() : winrt::SDKTemplate
  • GetPropertyForDisplay() : SDKTemplate
  • GetQuaternionVectorFromRay() : DX
  • GetRasterizeDepthMeshConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
  • GetRenderSampleType() : winrt::SDKTemplate
  • GetSelectedItemTag()
: SDKTemplate::Helpers
, winrt::SDKTemplate
  • GetServiceName() : winrt::SDKTemplate::DisplayHelpers
  • GetSmartCardAsync() : winrt::SDKTemplate
  • GetSmartCardReaderDeviceId() : winrt::SDKTemplate
  • GetStreamId() : anonymous_namespace{StspMediaSink.cpp}
  • GetTimeStamp() : winrt::SDKTemplate , SDKTemplate
  • GetUserViewModelsAsync() : winrt::SDKTemplate::Helpers
  • GetVisualizeDepthMeshConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- h -

  • H264ValidAttributes : anonymous_namespace{Validation.cpp}
  • HandAssignment : HolographicPaint
  • HandLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • HandlePairing() : winrt::SDKTemplate
  • HandRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HandTipLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HandTipRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • Head : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • High : Microsoft::SDKSamples::Kitchen , HttpFilters
  • HighlightFaces() : winrt::SDKTemplate::SampleHelpers
  • HighlightRanges() : SDKTemplate
  • HipLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HipRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HistoryAndRoaming : SDKTemplate
  • HResultToString() : SDKTemplate
  • HttpJsonContent : SDKTemplate
  • HttpMeteredConnectionFilter : HttpFilters
  • HttpRetryFilter : HttpFilters
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- i -

  • Images : SDKTemplate
  • IncomingConnectionEventHandler() : SDKTemplate
  • Inferred : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • Initialized : SDKTemplate
  • InitializeRevisionNumber() : SDKTemplate
  • Ins : Pcsc , Iso7816
  • InvalidFormat : WindowsPreview::Media::Capture::Frames
  • invoke_async_lambda() : SDKTemplate
  • IsAttributeValid() : anonymous_namespace{Validation.cpp}
  • IsAvailable : SDKTemplate
  • IsBandSupported() : winrt::SDKTemplate
  • IsRadioOn : SDKTemplate
  • IsValidColorFrame() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • IsValidDepthFrame() : anonymous_namespace{CameraCoordinateMapper.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- p -

  • PairButton_Click() : SDKTemplate
  • ParseHeartRateValue() : winrt::SDKTemplate::implementation
  • ParsePinPolicyOption() : winrt::SDKTemplate::implementation
  • ParseUIntWithFallback() : SDKTemplate::Helpers
  • Password : SDKTemplate
  • Pause : GameControl
  • Paused : SDKTemplate
  • Pausing : SDKTemplate
  • Pcm16Bit : winrt::SDKTemplate
  • Pcm24In32Bit : winrt::SDKTemplate
  • PhotoSize : SDKTemplate , PrintSample
  • PhotoVideoCamera : MrcEffectDefinitions
  • PinValueToString() : winrt::SDKTemplate
  • PixelShader_Cursor : DX
  • PixelShader_Max : DX
  • PixelShader_Simple : DX
  • PixelShader_Texture : DX
  • PixelShaderIndex : DX
  • PixelsToDips() : DX
  • PlayAgain : Simple3DGameDX , Simple3DGameXaml
  • Playing : SDKTemplate
  • PlayLevel : GameControl
  • PleaseWait : Simple3DGameDX , Simple3DGameXaml
  • PlotDataReadyHandler() : SDKSample::WASAPIAudio
  • PlugInFilter : SDKTemplate
  • PointOfServicePrinter() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • PoseTrackingFrameCreationStatus : WindowsPreview::Media::Capture::Frames
  • Pressed : DX
  • Pressing : DX
  • PressResultState : GameControl
  • Proportional : DWriteTextLayoutImplementation
  • provider : BarcodeDecoder
  • PublishButton_ClickAsync() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- r -

  • RadioModel : SDKTemplate
  • random_below() : anonymous_namespace{Contact.cpp}
  • random_generator() : anonymous_namespace{Contact.cpp}
  • random_in_range() : anonymous_namespace{Contact.cpp}
  • random_select() : anonymous_namespace{Contact.cpp}
  • RandomNumberGeneratorTask : RandomNumberService
  • Read() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< int32_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< uint32_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< uint8_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • ReadDataAsync() : DX
  • RecognizeTextLanguages() : ELS
  • RecognizeTextScripts() : ELS
  • Rectangle : DX
  • ReinhardTonemap : D2DAdvancedColorImages
  • RemoveByValue()
: anonymous_namespace{Scenario4_ForegroundGeofence.cpp}
, winrt::SDKTemplate
  • RenderEffectKind : D2DAdvancedColorImages
  • RenderSampleType : winrt::SDKTemplate
  • ReplaceQueryString() : winrt::SDKTemplate::Helpers
  • ReportCalendarData()
: anonymous_namespace{Scenario1_Data.cpp}
, anonymous_namespace{Scenario2_Stats.cpp}
, anonymous_namespace{Scenario4_UnicodeExtensions.cpp}
, anonymous_namespace{Scenario5_TimeZone.cpp}
  • ReportExtendedError() : SDKTemplate::Utils
  • ReportLanguageData() : anonymous_namespace{Scenario2_Lang.cpp}
  • ReportRegionData() : anonymous_namespace{Scenario3_Region.cpp}
  • ReportSavedStatus() : winrt::SDKTemplate
  • RepositionFaces() : winrt::SDKTemplate::SampleHelpers
  • RequestPairDeviceAsync() : SDKTemplate
  • Reset() : SDKTemplate
  • ResourcesLoaded : GameControl
  • Right : HolographicPaint
  • RightHand : HolographicPaint
  • RotateLeft : HolographicPaint
  • RotateRight : HolographicPaint
  • RotationDirection : HolographicPaint
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- s -

  • safe_handle() : anonymous_namespace{DDSTextureLoader.cpp}
  • SaveStateEventHandler()
: SDKTemplate::Common
, AdventureWorks::Common
  • Scaling : SDKTemplate , PrintSample
  • Scenario01_GetText : SDKTemplate
  • Scenario02_GetStream : SDKTemplate
  • Scenario03_GetList : SDKTemplate
  • Scenario04_PostText : SDKTemplate
  • Scenario05_PostStream : SDKTemplate
  • Scenario06_PostMultipart : SDKTemplate
  • Scenario07_PostStreamWithProgress : SDKTemplate
  • Scenario08_PostCustomContent : SDKTemplate
  • Scenario09_GetCookie : SDKTemplate
  • Scenario1 : SDKTemplate
  • Scenario10 : SDKTemplate
  • Scenario10_SetCookie : SDKTemplate
  • Scenario11 : SDKTemplate
  • Scenario11_DeleteCookie : SDKTemplate
  • Scenario12_DisableCookies : SDKTemplate
  • Scenario13_RetryFilter : SDKTemplate
  • Scenario14_MeteredConnectionFilter : SDKTemplate
  • Scenario15_ServerCertificateValidation : SDKTemplate
  • Scenario1_Advertiser : SDKTemplate
  • Scenario1_Analyze : SDKTemplate
  • Scenario1_Basic : SDKTemplate
  • Scenario1_BasicFunctionality : SDKTemplate
  • Scenario1_Basics : SDKTemplate
  • Scenario1_Check : SDKTemplate
  • Scenario1_CheckConsentAvailability : SDKTemplate
  • Scenario1_Colors : SDKTemplate
  • Scenario1_Configure : SDKTemplate
  • Scenario1_ConfigureMobileHotspot : SDKTemplate
  • Scenario1_Data : SDKTemplate
  • Scenario1_DataEvents : SDKTemplate
  • Scenario1_DetectInPhoto : SDKTemplate
  • Scenario1_DevicePicker : SDKTemplate
  • Scenario1_Discovery : SDKTemplate
  • Scenario1_Enable : SDKTemplate
  • Scenario1_ExtractTextSegments : SDKTemplate
  • Scenario1_Files : SDKTemplate
  • Scenario1_FindId : SDKTemplate
  • Scenario1_FindUsers : SDKTemplate
  • Scenario1_GetAndSetPin : SDKTemplate
  • Scenario1_InkCanvasTactileFeedback : SDKTemplate
  • Scenario1_LanguageDetection : SDKTemplate
  • Scenario1_Launch : SDKTemplate
  • Scenario1_Launched : SDKTemplate
  • Scenario1_LongAndShortFormats : SDKTemplate
  • Scenario1_ManageHotspot : SDKTemplate
  • Scenario1_MoveCertificate : SDKTemplate
  • Scenario1_NetworkConnectivity : SDKTemplate
  • Scenario1_Orientation : SDKTemplate
  • Scenario1_ParseAndStringify : SDKTemplate
  • Scenario1_PercentPermilleFormatting : SDKTemplate
  • Scenario1_PinTile : SDKTemplate
  • Scenario1_Prefs : SDKTemplate
  • Scenario1_Print : SDKTemplate
  • Scenario1_ProvisionTPM : SDKTemplate
  • Scenario1_ReadData : SDKTemplate
  • Scenario1_Render : SDKTemplate
  • Scenario1_Save : SDKTemplate
  • Scenario1_SecondaryWindow : SDKTemplate
  • Scenario1_SimpleListView : SDKTemplate
  • Scenario1_SingleFile : SDKTemplate
  • Scenario1_Toggle : SDKTemplate
  • Scenario1_TrackInWebcam : SDKTemplate
  • Scenario1_TrackPosition : SDKTemplate
  • Scenario1_UIFonts : SDKTemplate
  • Scenario1_UTF8 : SDKTemplate
  • Scenario1_XmlReader : SDKTemplate
  • Scenario2 : SDKTemplate
  • Scenario2_Binary : SDKTemplate
  • Scenario2_ChangePIN : SDKTemplate
  • Scenario2_Client : SDKTemplate
  • Scenario2_Connector : SDKTemplate
  • Scenario2_DecimalFormatting : SDKTemplate
  • Scenario2_DetectInWebcam : SDKTemplate
  • Scenario2_DeviceWatcher : SDKTemplate
  • Scenario2_Disable : SDKTemplate
  • Scenario2_DisplayRegion : SDKTemplate
  • Scenario2_DocumentFonts : SDKTemplate
  • Scenario2_Effects : SDKTemplate
  • Scenario2_GetCurrentTextSegmentFromIndex : SDKTemplate
  • Scenario2_GetPosition : SDKTemplate
  • Scenario2_Lang : SDKTemplate
  • Scenario2_Launch : SDKTemplate
  • Scenario2_Listen : SDKTemplate
  • Scenario2_Manage : SDKTemplate
  • Scenario2_Memory : SDKTemplate
  • Scenario2_MultiFile : SDKTemplate
  • Scenario2_MultipleScanners : SDKTemplate
  • Scenario2_NetworkCost : SDKTemplate
  • Scenario2_Notifications : SDKTemplate
  • Scenario2_Polling : SDKTemplate
  • Scenario2_Remove : SDKTemplate
  • Scenario2_RequestConsent : SDKTemplate
  • Scenario2_RequestMany : SDKTemplate
  • Scenario2_ScriptDetection : SDKTemplate
  • Scenario2_Settings : SDKTemplate
  • Scenario2_ShowHideEvents : SDKTemplate
  • Scenario2_SimpleGridView : SDKTemplate
  • Scenario2_Stats : SDKTemplate
  • Scenario2_StringTemplate : SDKTemplate
  • Scenario2_SupportedTactileFeedback : SDKTemplate
  • Scenario2_ToggleMobileHotspot : SDKTemplate
  • Scenario2_UnpinTile : SDKTemplate
  • Scenario2_WatchUsers : SDKTemplate
  • Scenario2_XmlWriter : SDKTemplate
  • Scenario3 : SDKTemplate
  • Scenario3_ActiveSymbologies : SDKTemplate
  • Scenario3_AppCapture : SDKTemplate
  • Scenario3_BackgroundDeviceWatcher : SDKTemplate
  • Scenario3_BackgroundTask : SDKTemplate
  • Scenario3_CheckUserConsentGroup : SDKTemplate
  • Scenario3_Choosing : SDKTemplate
  • Scenario3_ClientAuthentication : SDKTemplate
  • Scenario3_CurrencyFormatting : SDKTemplate
  • Scenario3_CustomItems : SDKTemplate
  • Scenario3_Enum : SDKTemplate
  • Scenario3_EnumerateTiles : SDKTemplate
  • Scenario3_InkingFeedback : SDKTemplate
  • Scenario3_MasterDetail : SDKTemplate
  • Scenario3_NetworkConnectivityChanges : SDKTemplate
  • Scenario3_ParameterizedTemplate : SDKTemplate
  • Scenario3_Region : SDKTemplate
  • Scenario3_ResetPIN : SDKTemplate
  • Scenario3_SecondaryTiles : SDKTemplate
  • Scenario3_ServerForeground : SDKTemplate
  • Scenario3_SettingContainer : SDKTemplate
  • Scenario3_ShowHideMethods : SDKTemplate
  • Scenario3_SingleFolder : SDKTemplate
  • Scenario3_Size : SDKTemplate
  • Scenario3_Transliteration : SDKTemplate
  • Scenario3_XmlWriterLite : SDKTemplate
  • Scenario4 : SDKTemplate
  • Scenario4_ChangeAdminKey : SDKTemplate
  • Scenario4_ChangeSystemGroup : SDKTemplate
  • Scenario4_CharacterGrouping : SDKTemplate
  • Scenario4_CompactOverlay : SDKTemplate
  • Scenario4_CompositeSettings : SDKTemplate
  • Scenario4_EdgeTappedListView : SDKTemplate
  • Scenario4_ForegroundGeofence : SDKTemplate
  • Scenario4_Input : SDKTemplate
  • Scenario4_InteractionFeedback : SDKTemplate
  • Scenario4_NumberParsing : SDKTemplate
  • Scenario4_Override : SDKTemplate
  • Scenario4_PartialReadWrite : SDKTemplate
  • Scenario4_SaveFile : SDKTemplate
  • Scenario4_ShowView : SDKTemplate
  • Scenario4_Snapshot : SDKTemplate
  • Scenario4_TilePinned : SDKTemplate
  • Scenario4_UnicodeExtensions : SDKTemplate
  • Scenario5 : SDKTemplate
  • Scenario5_GeofenceBackgroundTask : SDKTemplate
  • Scenario5_GetSingleDevice : SDKTemplate
  • Scenario5_InkingAndInteractionFeedback : SDKTemplate
  • Scenario5_IsSupported : SDKTemplate
  • Scenario5_LaunchedFromSecondaryTile : SDKTemplate
  • Scenario5_Msappdata : SDKTemplate
  • Scenario5_RelativePositioning : SDKTemplate
  • Scenario5_RestoreScrollPosition : SDKTemplate
  • Scenario5_RoundingAndPadding : SDKTemplate
  • Scenario5_TimeZone : SDKTemplate
  • Scenario5_TriggerCFU : SDKTemplate
  • Scenario5_UnicodeExtensions : SDKTemplate
  • Scenario5_VerifyResponse : SDKTemplate
  • Scenario6 : SDKTemplate
  • Scenario6_ClearScenario : SDKTemplate
  • Scenario6_CustomFilterAddedProps : SDKTemplate
  • Scenario6_DeleteTPM : SDKTemplate
  • Scenario6_GetLastVisit : SDKTemplate
  • Scenario6_NumeralSystemTranslation : SDKTemplate
  • Scenario6_ScrollIntoView : SDKTemplate
  • Scenario6_SecondaryTileNotification : SDKTemplate
  • Scenario6_TimeZone : SDKTemplate
  • Scenario7 : SDKTemplate
  • Scenario7_DeviceInformationKind : SDKTemplate
  • Scenario7_ForegroundVisits : SDKTemplate
  • Scenario7_ListAllCards : SDKTemplate
  • Scenario7_PinFromAppbar : SDKTemplate
  • Scenario7_SetVersion : SDKTemplate
  • Scenario7_UsingUnicodeExtensions : SDKTemplate
  • Scenario8 : SDKTemplate
  • Scenario8_PairDevice : SDKTemplate
  • Scenario8_UpdateAsync : SDKTemplate
  • Scenario8_VisitsBackgroundTask : SDKTemplate
  • Scenario9 : SDKTemplate
  • Scenario9_CustomPairDevice : SDKTemplate
  • ScenarioCompleted() : winrt::SDKTemplate::Helpers
  • ScenarioStarted() : winrt::SDKTemplate::Helpers
  • ScopedHandle : anonymous_namespace{DDSTextureLoader.cpp}
  • SdrOverlay : D2DAdvancedColorImages
  • SecondaryAppWindowPage : SDKTemplate
  • SendHttpGetRequestAsync() : anonymous_namespace{SampleConfiguration.cpp}
  • SerializeHeaders() : winrt::SDKTemplate::Helpers
  • ServiceList_SelectionChanged() : SDKTemplate
  • SetAdminKey() : winrt::SDKTemplate
  • SetBufferBytes() : anonymous_namespace{Scenario1_Print.cpp}
  • SetDebugObjectName() : anonymous_namespace{DDSTextureLoader.cpp}
  • SetMaterialIndices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetSmartCardReaderDeviceId() : winrt::SDKTemplate
  • SetTriangleIndices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetVertices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetVisibility() : anonymous_namespace{Scenario2_Client.cpp}
  • ShouldAttemptToConnectToInternet() : winrt::SDKTemplate
  • ShoulderLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • ShoulderRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • ShowPackageFamilyName : SDKTemplate
  • ShowProperties() : SDKTemplate
  • ShrinkToFit : SDKTemplate
  • Size4x6 : SDKTemplate
  • Size5x7 : SDKTemplate
  • Size8x10 : SDKTemplate
  • SizeFullPage : SDKTemplate
  • SlowInputStream : SDKTemplate
  • smallRectSize : SDKTemplate
  • SourceState : Microsoft::Samples::SimpleCommunication
  • SourceState_Invalid : Microsoft::Samples::SimpleCommunication
  • SourceState_Opening : Microsoft::Samples::SimpleCommunication
  • SourceState_Shutdown : Microsoft::Samples::SimpleCommunication
  • SourceState_Started : Microsoft::Samples::SimpleCommunication
  • SourceState_Starting : Microsoft::Samples::SimpleCommunication
  • SourceState_Stopped : Microsoft::Samples::SimpleCommunication
  • SpineBase : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • SpineMid : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • SpineShoulder : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • Ssid : SDKTemplate
  • Starting : SDKTemplate
  • StartWatching() : SDKTemplate
  • static_assert() : HolographicMRCSample , _360VideoPlayback , HolographicTagAlongSample , _360VideoPlayback , DX , HolographicMRCSample , HolographicVoiceInput , HolographicSpatialStage , HolographicFaceTracker , WindowsHolographicCodeSamples , HolographicFaceTracker , WindowsHolographicCodeSamples , HolographicPaint , BasicHologram
  • StatusChangedHandler() : SDKTemplate
  • StatusMessage : SDKSample , SDKTemplate
  • Stopped : SDKTemplate
  • Stopping : SDKTemplate
  • StopWatching() : SDKTemplate
  • StorageStandard : Pcsc
  • StreamToStringAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • StringifyProperty() : SDKTemplate
  • StringJoin() : SDKTemplate , winrt::SDKTemplate
  • StringToStreamAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • strServerPort : SDKTemplate
  • StspNetworkType : Microsoft::Samples::SimpleCommunication
  • StspNetworkType_IPv4 : Microsoft::Samples::SimpleCommunication
  • StspNetworkType_IPv6 : Microsoft::Samples::SimpleCommunication
  • StspOperation : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestDescription : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestStart : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestStop : Microsoft::Samples::SimpleCommunication
  • StspOperation_Last : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerDescription : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerFormatChange : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerSample : Microsoft::Samples::SimpleCommunication
  • StspOperation_Unknown : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_BottomFieldFirst : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_CleanPoint : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_DerivedFromTopField : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_Discontinuity : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_Interlaced : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_RepeatFirstField : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_SingleField : Microsoft::Samples::SimpleCommunication
  • StspSampleFlags : Microsoft::Samples::SimpleCommunication
  • Success : WindowsPreview::Media::Capture::Frames
  • SuperMutt : SDKTemplate
  • Suspended : GameControl
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- t -

  • TapToContinue : Simple3DGameDX , Simple3DGameXaml
  • Text : SDKTemplate
  • TextAndImages : SDKTemplate
  • Texture_Cursor : DX
  • Texture_Hologram : DX
  • Texture_Init : DX
  • Texture_Max : DX
  • Texture_Photo : DX
  • Texture_SysAudio : DX
  • Texture_Video : DX
  • TextureIndex : DX
  • ThrowIfFailed() : DX
  • ThumbLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ThumbRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • TimeSpanFromMilliseconds() : SDKTemplate::Helpers
  • TimeSpanFromSeconds() : SDKTemplate::Helpers
  • to_brief_hstring() : winrt::BackgroundTask
  • to_hstring() : winrt
  • to_message() : winrt::SDKTemplate
  • to_wstring() : std
  • Tone : winrt::SDKTemplate
  • TooSmall : GameControl
  • Top : HolographicPaint
  • ToSimpleString() : winrt::SDKTemplate::Helpers
  • Tracked : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • TrackingStatus : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • TransformScanline : SDKTemplate
  • TransliterateFromCyrillicToLatin() : ELS
  • TryExtract() : anonymous_namespace{Scenario2_Client.cpp}
  • TryFindViewLifetimeControlForViewId() : anonymous_namespace{SampleConfiguration.cpp}
  • TryGetCurrentNetworkOperatorTetheringManager() : winrt::SDKTemplate
  • TryGetUri() : winrt::SDKTemplate
  • TryParseDouble() : winrt::SDKTemplate
  • TryParseFloat() : winrt::SDKTemplate
  • TryParseHttpUri() : winrt::SDKTemplate::Helpers
  • TryParseInt() : anonymous_namespace{Scenario2_Client.cpp}
  • TryParseInt32() : winrt::SDKTemplate
  • TryParseSigDefinedUuid() : anonymous_namespace{BluetoothLEAttributeDisplay.cpp}
  • TryParseUInt()
: anonymous_namespace{Scenario6.cpp}
, winrt::SDKTemplate
  • TryParseUIntPrefix() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- u -

  • Uniform : DWriteTextLayoutImplementation
  • Uninitialized : SDKTemplate
  • Unknown : winrt::SDKTemplate , HolographicPaint
  • Update() : SDKTemplate
  • UpdateEngineState : GameControl
  • UpdateMetadataTask : BackgroundTask
  • Upnp() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • UserViewModel : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- v -

  • ValidateBlob() : anonymous_namespace{Validation.cpp}
  • ValidateDataType() : anonymous_namespace{Validation.cpp}
  • ValidateInputMediaType() : Microsoft::Samples::SimpleCommunication
  • ValidateTPMSmartCard() : winrt::SDKTemplate
  • ValidMediaTypes : anonymous_namespace{Validation.cpp}
  • ValueChangedSubscribeToggle_Click() : SDKTemplate
  • VertexShader_Max : DX
  • VertexShader_Simple : DX
  • VertexShader_Texture : DX
  • VertexShaderIndex : DX
  • VideoCasting() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • VideoSettingsFilter() : SDKTemplate
  • ViewReleasedHandler() : ScreenCasting::Util , SecondaryViewsHelpers , SDKSample::SecondaryViewsHelpers
  • VisitBackgroundTask : BackgroundTask
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all namespace members with links to the namespace documentation for each member:

- w -

  • WaitingForPress : GameControl
  • WaitingForResources : GameControl
  • WaveformNamesMap() : winrt::SDKTemplate
  • WfaOui : SDKTemplate
  • WiFiDirect() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • WiFiDirectPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • WordOverlay : SDKTemplate
  • WristLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • WristRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • Wsd() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v

- a -

  • ApplicationMode : HolographicPaint
  • AudioMixerMode : MrcEffectDefinitions

- b -

  • BackgroundTaskStatus : BackgroundTasks::Helpers
  • BodyPart : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ButtonShape : DX
  • ButtonState : DX

- c -

  • CardName : Pcsc
  • Cla : Iso7816
  • ClaXx : Iso7816
  • ConfigurationState : AllJoynProducerExperiences
  • ConfigureWiFiResultStatus : AllJoynConsumerExperiences , AllJoynProducerExperiences
  • ConnectionResultCode : AllJoynProducerExperiences , AllJoynConsumerExperiences
  • ContentType : winrt::SDKTemplate , SDKSample::WASAPIAudio
  • ControlType : HolographicMRCSample
  • CostGuidance : winrt::SDKTemplate

- d -

  • DDS_ALPHA_MODE : DirectX
  • Descriptor : CustomUsbDeviceAccess
  • DeviceClass : Pcsc::Common
  • DeviceState : SDKSample::WASAPIAudio , SDKTemplate
  • DeviceType : CustomHidDeviceAccess , CustomUsbDeviceAccess , SDKTemplate
  • DisplayContent : PrintSample , SDKTemplate
  • DPadAction : HolographicPaint

- f -

  • FontLineGapUsage : DWriteTextLayoutImplementation

- g -

  • GameInfoOverlayCommand : Simple3DGameDX , Simple3DGameXaml
  • GameInfoOverlayState : GameControl
  • GattNativeCharacteristicUuid : SDKTemplate
  • GattNativeDescriptorUuid : SDKTemplate
  • GattNativeServiceUuid : SDKTemplate
  • GeometryShaderIndex : DX

- h -

  • HandAssignment : HolographicPaint

- i -

  • Ins : Iso7816 , Pcsc

- l -

  • LineSpacingMethod : DWriteTextLayoutImplementation
  • LoggingScenarioEventType : SDKTemplate

- m -

  • MeteredConnectionPriority : HttpFilters
  • MixedRealityCapturePerspective : MrcEffectDefinitions

- n -

  • NotifyType : ScreenCasting , SDKTemplate , SDKSample , SDKTemplate , SDKSample , NfcSample , SDKTemplate

- o -

  • OnboardingAuthenticationType : AllJoynConsumerExperiences , AllJoynProducerExperiences
  • OvenTemperature : Microsoft::SDKSamples::Kitchen

- p -

  • PhotoSize : SDKTemplate , PrintSample
  • PixelShaderIndex : DX
  • PoseTrackingFrameCreationStatus : WindowsPreview::Media::Capture::Frames
  • PressResultState : GameControl

- r -

  • RenderEffectKind : D2DAdvancedColorImages
  • RenderSampleType : winrt::SDKTemplate
  • RotationDirection : HolographicPaint

- s -

  • Scaling : SDKTemplate , PrintSample
  • SourceState : Microsoft::Samples::SimpleCommunication
  • StorageStandard : Pcsc
  • StspNetworkType : Microsoft::Samples::SimpleCommunication
  • StspOperation : Microsoft::Samples::SimpleCommunication
  • StspSampleFlags : Microsoft::Samples::SimpleCommunication

- t -

  • TextureIndex : DX
  • TrackingStatus : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview

- u -

  • UpdateEngineState : GameControl

- v -

  • VertexShaderIndex : DX
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • Activated : SDKTemplate
  • All : SDKTemplate
  • AnkleLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • AnkleRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- k -

  • KneeLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • KneeRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- l -

  • Left : HolographicPaint
  • LeftHand : HolographicPaint
  • LevelStart : GameControl
  • LoadGame : GameControl
  • Loading : GameControl
  • LogFileGenerated : SDKTemplate
  • LogFileGeneratedAtDisable : SDKTemplate
  • LogFileGeneratedAtSuspend : SDKTemplate
  • LoggingEnabledDisabled : SDKTemplate
  • Loopback : MrcEffectDefinitions
  • Low : HttpFilters , Microsoft::SDKSamples::Kitchen
  • LuminanceHeatmap : D2DAdvancedColorImages
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- m -

  • Medium : HttpFilters , Microsoft::SDKSamples::Kitchen
  • Mic : MrcEffectDefinitions
  • MicAndLoopback : MrcEffectDefinitions
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- n -

  • Neck : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • None : SDKTemplate , HolographicPaint , D2DAdvancedColorImages , DX , Simple3DGameDX , Simple3DGameXaml
  • Normal : winrt::SDKTemplate
  • NotAPerceptionMediaType : WindowsPreview::Media::Capture::Frames
  • NotAPoseTrackingFrame : WindowsPreview::Media::Capture::Frames
  • NotTracked : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- o -

  • OptIn : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- b -

  • Bottom : HolographicPaint
  • BusyStatusChanged : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- c -

  • Capturing : SDKTemplate
  • ChooseTool : HolographicPaint
  • Circle : DX
  • Conservative : winrt::SDKTemplate
  • ContentTypeFile : SDKSample::WASAPIAudio
  • ContentTypeTone : SDKSample::WASAPIAudio
  • ContinueLevel : GameControl
  • Control_Button : HolographicMRCSample
  • Control_CameraPreview : HolographicMRCSample
  • Control_Panel : HolographicMRCSample
  • Control_Unknown : HolographicMRCSample
  • Crop : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- d -

  • DDS_ALPHA_MODE_CUSTOM : DirectX
  • DDS_ALPHA_MODE_OPAQUE : DirectX
  • DDS_ALPHA_MODE_PREMULTIPLIED : DirectX
  • DDS_ALPHA_MODE_STRAIGHT : DirectX
  • DDS_ALPHA_MODE_UNKNOWN : DirectX
  • Deactivated : GameControl
  • Default : DWriteTextLayoutImplementation
  • DeviceStateActivated : SDKSample::WASAPIAudio
  • DeviceStateCapturing : SDKSample::WASAPIAudio
  • DeviceStateDiscontinuity : SDKSample::WASAPIAudio
  • DeviceStateFlushing : SDKSample::WASAPIAudio
  • DeviceStateInError : SDKSample::WASAPIAudio
  • DeviceStateInitialized : SDKSample::WASAPIAudio
  • DeviceStatePaused : SDKSample::WASAPIAudio
  • DeviceStatePausing : SDKSample::WASAPIAudio
  • DeviceStatePlaying : SDKSample::WASAPIAudio
  • DeviceStateStarting : SDKSample::WASAPIAudio
  • DeviceStateStopped : SDKSample::WASAPIAudio
  • DeviceStateStopping : SDKSample::WASAPIAudio
  • DeviceStateUnInitialized : SDKSample::WASAPIAudio
  • Disabled : DWriteTextLayoutImplementation
  • Discontinuity : SDKTemplate
  • Display : MrcEffectDefinitions
  • Drawing : HolographicPaint
  • Dynamics : GameControl
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- e -

  • ElbowLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ElbowRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • Enabled : DWriteTextLayoutImplementation
  • Error : SDKTemplate
  • ErrorMessage : SDKSample , SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- f -

  • File : winrt::SDKTemplate
  • FilmicTonemap : D2DAdvancedColorImages
  • Float : winrt::SDKTemplate
  • Flushing : SDKTemplate
  • FootLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • FootRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • FrameBufferReleased : WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- g -

  • GameOverCompleted : GameControl
  • GameOverExpired : GameControl
  • GameStats : GameControl
  • GeometryShader_Max : DX
  • GeometryShader_Simple : DX
  • GeometryShader_Texture : DX
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- h -

  • HandLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HandRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • HandTipLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HandTipRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • Head : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • High : HttpFilters , Microsoft::SDKSamples::Kitchen
  • HipLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • HipRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- i -

  • Images : SDKTemplate
  • Inferred : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • Initialized : SDKTemplate
  • InvalidFormat : WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- p -

  • Pause : GameControl
  • Paused : SDKTemplate
  • Pausing : SDKTemplate
  • Pcm16Bit : winrt::SDKTemplate
  • Pcm24In32Bit : winrt::SDKTemplate
  • PhotoVideoCamera : MrcEffectDefinitions
  • PixelShader_Cursor : DX
  • PixelShader_Max : DX
  • PixelShader_Simple : DX
  • PixelShader_Texture : DX
  • PlayAgain : Simple3DGameDX , Simple3DGameXaml
  • Playing : SDKTemplate
  • PlayLevel : GameControl
  • PleaseWait : Simple3DGameDX , Simple3DGameXaml
  • Pressed : DX
  • Pressing : DX
  • Proportional : DWriteTextLayoutImplementation
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- r -

  • Rectangle : DX
  • ReinhardTonemap : D2DAdvancedColorImages
  • ResourcesLoaded : GameControl
  • Right : HolographicPaint
  • RightHand : HolographicPaint
  • RotateLeft : HolographicPaint
  • RotateRight : HolographicPaint
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- s -

  • SdrOverlay : D2DAdvancedColorImages
  • ShoulderLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ShoulderRight : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ShrinkToFit : SDKTemplate
  • Size4x6 : SDKTemplate
  • Size5x7 : SDKTemplate
  • Size8x10 : SDKTemplate
  • SizeFullPage : SDKTemplate
  • SourceState_Invalid : Microsoft::Samples::SimpleCommunication
  • SourceState_Opening : Microsoft::Samples::SimpleCommunication
  • SourceState_Shutdown : Microsoft::Samples::SimpleCommunication
  • SourceState_Started : Microsoft::Samples::SimpleCommunication
  • SourceState_Starting : Microsoft::Samples::SimpleCommunication
  • SourceState_Stopped : Microsoft::Samples::SimpleCommunication
  • SpineBase : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • SpineMid : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • SpineShoulder : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • Starting : SDKTemplate
  • StatusMessage : SDKTemplate , SDKSample
  • Stopped : SDKTemplate
  • Stopping : SDKTemplate
  • StspNetworkType_IPv4 : Microsoft::Samples::SimpleCommunication
  • StspNetworkType_IPv6 : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestDescription : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestStart : Microsoft::Samples::SimpleCommunication
  • StspOperation_ClientRequestStop : Microsoft::Samples::SimpleCommunication
  • StspOperation_Last : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerDescription : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerFormatChange : Microsoft::Samples::SimpleCommunication
  • StspOperation_ServerSample : Microsoft::Samples::SimpleCommunication
  • StspOperation_Unknown : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_BottomFieldFirst : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_CleanPoint : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_DerivedFromTopField : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_Discontinuity : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_Interlaced : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_RepeatFirstField : Microsoft::Samples::SimpleCommunication
  • StspSampleFlag_SingleField : Microsoft::Samples::SimpleCommunication
  • Success : WindowsPreview::Media::Capture::Frames
  • SuperMutt : SDKTemplate
  • Suspended : GameControl
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- t -

  • TapToContinue : Simple3DGameDX , Simple3DGameXaml
  • Text : SDKTemplate
  • TextAndImages : SDKTemplate
  • Texture_Cursor : DX
  • Texture_Hologram : DX
  • Texture_Init : DX
  • Texture_Max : DX
  • Texture_Photo : DX
  • Texture_SysAudio : DX
  • Texture_Video : DX
  • ThumbLeft : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
  • ThumbRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • Tone : winrt::SDKTemplate
  • TooSmall : GameControl
  • Top : HolographicPaint
  • Tracked : MFPoseTrackingPreview , WindowsPreview::Media::Capture::Frames
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- u -

  • Uniform : DWriteTextLayoutImplementation
  • Uninitialized : SDKTemplate
  • Unknown : HolographicPaint , winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- v -

  • VertexShader_Max : DX
  • VertexShader_Simple : DX
  • VertexShader_Texture : DX
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- w -

  • WaitingForPress : GameControl
  • WaitingForResources : GameControl
  • WristLeft : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
  • WristRight : WindowsPreview::Media::Capture::Frames , MFPoseTrackingPreview
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- _ -

  • __declspec() : Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- l -

  • LoadSavedJson() : winrt::BackgroundTask
  • LoadStateEventHandler()
: SDKTemplate::Common
, AdventureWorks::Common
  • LocalTimeOfDay() : winrt::SDKTemplate::implementation
  • LookupBackgroundTask() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- m -

  • MappingRecognizeTextFromService() : ELS::Private
  • MillisecondsFromTimeSpan() : SDKTemplate::Helpers
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- n -

  • NetworkCamera() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • Not() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- o -

  • OnIndexerOperationBegin() : SDKTemplate
  • OnIndexerOperationComplete() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • AccessSoftwareBitmap() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • activatable() : Microsoft::SDKSamples::Kitchen
  • AddAppContentFilesToIndexedFolder() : SDKTemplate
  • AddItem() : SDKTemplate::Helpers
  • AddItemsToIndex() : SDKTemplate
  • AddVideoCastingIfSupported() : SDKTemplate , winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • alignas() : CameraStreamCoordinateMapper
  • App_Construct() : winrt::SDKTemplate
  • App_LaunchCompleted() : winrt::SDKTemplate
  • App_OnActivated() : winrt::SDKTemplate
  • App_OnFileActivated() : winrt::SDKTemplate
  • App_OverrideOnLaunched() : winrt::SDKTemplate
  • AppendLine() : winrt::SDKTemplate
  • ApplyLanguageFont() : winrt::SDKTemplate
  • AreCertificateAndCertChainValidAsync() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- b -

  • BackgroundAuthenticationCompletedEventHandler() : SDKTemplate
  • Bluetooth() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLE() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLEPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothLEUnpairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BluetoothUnpairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • BuildWebSocketError() : winrt::SDKTemplate
  • Button_Click_ApplyNow() : SDKTemplate
  • Button_Click_Save() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- c -

  • CalculateChallengeResponse() : winrt::SDKTemplate
  • CaptureFailedHandler() : SDKTemplate
  • CharacteristicList_SelectionChanged() : SDKTemplate
  • CharacteristicReadButton_Click() : SDKTemplate
  • CharacteristicWriteButton_Click() : SDKTemplate
  • CharacteristicWriteButtonInt_Click() : SDKTemplate
  • check_enumerator() : winrt::SDKTemplate
  • CheckBackgroundAndRequestLocationAccess() : winrt::SDKTemplate
  • completed_ui_task() : SDKTemplate
  • ConnectButton_Click() : SDKTemplate
  • ConvertDipsToPixels() : DX
  • ConvertPixelsToDips() : DX
  • ConvertPropertiesToMediaType() : anonymous_namespace{StspMediaSink.cpp}
  • ConvertToColorF() : DX
  • CoordinateTransformationMethod() : SDKTemplate
  • CopySoftwareBitmapToDirect3DTexture() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • create_delayed_task() : SDKTemplate
  • CreateAndInitializeAsync() : DX
  • CreateBuffer() : DX
  • CreateBufferPacket() : Microsoft::Samples::SimpleCommunication::Network
  • CreateBufferPacketFromMFSample() : Microsoft::Samples::SimpleCommunication::Network
  • CreateDDSTextureFromFile() : DirectX
  • CreateDDSTextureFromFileEx() : DirectX
  • CreateDDSTextureFromMemory() : DirectX
  • CreateDDSTextureFromMemoryEx() : DirectX
  • CreateDepthStencilView() : DX
  • CreateDepthTextureInteropObject() : DX
  • CreateHttpClientWithCustomHeaders() : winrt::SDKTemplate::Helpers
  • CreateInputLayout() : DX
  • CreateItemString() : SDKTemplate
  • CreateMarker() : Microsoft::Samples::SimpleCommunication
  • CreateMediaBufferWrapper() : Microsoft::Samples::SimpleCommunication::Network
  • CreateNetworkClient() : Microsoft::Samples::SimpleCommunication::Network
  • CreateNetworkServer() : Microsoft::Samples::SimpleCommunication::Network
  • CreatePackageAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • CreatePackageFromXmlAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • CreatePixelShader() : DX
  • CreateProductListFromQueryResult() : SDKTemplate::Utils
  • CreateRenderTargetView() : DX
  • CreateSamplerState() : DX
  • CreateShaderResourceView() : DX
  • CreateTexture() : DX
  • CreateVertexShader() : DX
  • CreateWICTextureFromMemory() : DX
  • CreateWICTextureFromMemoryEx() : DX
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- d -

  • DaysUntil() : SDKTemplate::Utils
  • DebugWriteLine() : winrt::BackgroundDeviceWatcherTask::implementation
  • DECLSPEC_UUID()
: Microsoft::Samples::SimpleCommunication
, Microsoft::Samples::SimpleCommunication::Network
, Microsoft::Samples::SimpleCommunication
, Microsoft::Samples::SimpleCommunication::Network
  • DEFINE_GUID() : MFPoseTrackingPreview
  • DelayAsync() : SDKTemplate::Helpers
  • DeviceStateChangedHandler() : SDKSample::WASAPIAudio
  • DialAllApps() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • DipsToPixels() : DX
  • DipsToPixelsCeil() : DX
  • DipsToPixelsFloor() : DX
  • DisplayRoundingAlgorithmAsString() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DisplayTextResultAsync() : winrt::SDKTemplate::Helpers
  • DisplayToast() : winrt::BackgroundTask
  • DisplayWebError() : winrt::SDKTemplate::Helpers
  • DoCurrencyRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoIncrementRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoPaddingAndRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoPaddingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • DoSignificantDigitRoundingScenarios() : anonymous_namespace{Scenario5_RoundingAndPadding.cpp}
  • duplicate() : anonymous_namespace{Scenario3.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- e -

  • EnumerateButton_Click() : SDKTemplate
  • EvaluateAndReportConnectionCost() : winrt::SDKTemplate
  • EvaluateCostAndConnectAsync() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- f -

  • FillItemsFromSavedJson() : winrt::SDKTemplate
  • FilterOutputMediaType() : Microsoft::Samples::SimpleCommunication
  • FindIdsInString() : anonymous_namespace{Scenario1_FindId.cpp}
  • FindMediaTypeDescriptor() : anonymous_namespace{Validation.cpp}
  • FindScrollViewer() : winrt::SDKTemplate
  • FindSupportedFeedback() : winrt::SDKTemplate
  • FixTextureContentTypeAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • FontDownloadCompletedHandler() : DWriteTextLayoutCloudFontImplementation
  • ForEach() : anonymous_namespace{StspMediaSink.cpp}
  • FormatDateTime()
: winrt::SDKTemplate
, winrt::BackgroundTask
  • FromInspectable() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- g -

  • GenerateIntrinsicsMapping() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • GenerateResult()
: anonymous_namespace{Scenario2_StringTemplate.cpp}
, anonymous_namespace{Scenario6_TimeZone.cpp}
, anonymous_namespace{Scenario3_ParameterizedTemplate.cpp}
  • GenerateSampleStreamAsync() : anonymous_namespace{Scenario05_PostStream.cpp}
  • GetAdminKey() : winrt::SDKTemplate
  • GetCameraIntrinsicsConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
  • GetCharacteristicName() : winrt::SDKTemplate::DisplayHelpers
  • GetCurrentDateTimeAsString() : SDKTemplate::Helpers
  • GetDataFromIBuffer() : WindowsHolographicCodeSamples
  • GetDXColor() : DX
  • GetDxgiFormat() : DX
  • GetElementRect() : winrt::SDKTemplate
  • GetFirstBarcodeScannerAsync() : SDKTemplate::DeviceHelpers
  • GetFirstCashDrawerAsync() : SDKTemplate::DeviceHelpers
  • GetFirstMagneticStripeReaderAsync() : SDKTemplate::DeviceHelpers
  • GetFriendlyName() : winrt::SDKTemplate
  • GetNetworkCostGuidance() : winrt::SDKTemplate
  • GetPropertyForDisplay() : SDKTemplate
  • GetQuaternionVectorFromRay() : DX
  • GetRasterizeDepthMeshConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
  • GetRenderSampleType() : winrt::SDKTemplate
  • GetSelectedItemTag()
: winrt::SDKTemplate
, SDKTemplate::Helpers
  • GetServiceName() : winrt::SDKTemplate::DisplayHelpers
  • GetSmartCardAsync() : winrt::SDKTemplate
  • GetSmartCardReaderDeviceId() : winrt::SDKTemplate
  • GetStreamId() : anonymous_namespace{StspMediaSink.cpp}
  • GetTimeStamp() : SDKTemplate , winrt::SDKTemplate
  • GetUserViewModelsAsync() : winrt::SDKTemplate::Helpers
  • GetVisualizeDepthMeshConstantsForShader() : anonymous_namespace{GpuCoordinateMapper.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- h -

  • HandlePairing() : winrt::SDKTemplate
  • HighlightFaces() : winrt::SDKTemplate::SampleHelpers
  • HighlightRanges() : SDKTemplate
  • HResultToString() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- i -

  • IncomingConnectionEventHandler() : SDKTemplate
  • InitializeRevisionNumber() : SDKTemplate
  • invoke_async_lambda() : SDKTemplate
  • IsAttributeValid() : anonymous_namespace{Validation.cpp}
  • IsBandSupported() : winrt::SDKTemplate
  • IsValidColorFrame() : anonymous_namespace{CameraCoordinateMapper.cpp}
  • IsValidDepthFrame() : anonymous_namespace{CameraCoordinateMapper.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- p -

  • PairButton_Click() : SDKTemplate
  • ParseHeartRateValue() : winrt::SDKTemplate::implementation
  • ParsePinPolicyOption() : winrt::SDKTemplate::implementation
  • ParseUIntWithFallback() : SDKTemplate::Helpers
  • PinValueToString() : winrt::SDKTemplate
  • PixelsToDips() : DX
  • PlotDataReadyHandler() : SDKSample::WASAPIAudio
  • PointOfServicePrinter() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • PublishButton_ClickAsync() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- r -

  • random_below() : anonymous_namespace{Contact.cpp}
  • random_generator() : anonymous_namespace{Contact.cpp}
  • random_in_range() : anonymous_namespace{Contact.cpp}
  • random_select() : anonymous_namespace{Contact.cpp}
  • Read() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< int32_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< uint32_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • Read< uint8_t >() : anonymous_namespace{Scenario2_Client.cpp}
  • ReadDataAsync() : DX
  • RecognizeTextLanguages() : ELS
  • RecognizeTextScripts() : ELS
  • RemoveByValue()
: anonymous_namespace{Scenario4_ForegroundGeofence.cpp}
, winrt::SDKTemplate
  • ReplaceQueryString() : winrt::SDKTemplate::Helpers
  • ReportCalendarData()
: anonymous_namespace{Scenario1_Data.cpp}
, anonymous_namespace{Scenario2_Stats.cpp}
, anonymous_namespace{Scenario4_UnicodeExtensions.cpp}
, anonymous_namespace{Scenario5_TimeZone.cpp}
  • ReportExtendedError() : SDKTemplate::Utils
  • ReportLanguageData() : anonymous_namespace{Scenario2_Lang.cpp}
  • ReportRegionData() : anonymous_namespace{Scenario3_Region.cpp}
  • ReportSavedStatus() : winrt::SDKTemplate
  • RepositionFaces() : winrt::SDKTemplate::SampleHelpers
  • RequestPairDeviceAsync() : SDKTemplate
  • Reset() : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- s -

  • safe_handle() : anonymous_namespace{DDSTextureLoader.cpp}
  • SaveStateEventHandler()
: SDKTemplate::Common
, AdventureWorks::Common
  • ScenarioCompleted() : winrt::SDKTemplate::Helpers
  • ScenarioStarted() : winrt::SDKTemplate::Helpers
  • SendHttpGetRequestAsync() : anonymous_namespace{SampleConfiguration.cpp}
  • SerializeHeaders() : winrt::SDKTemplate::Helpers
  • ServiceList_SelectionChanged() : SDKTemplate
  • SetAdminKey() : winrt::SDKTemplate
  • SetBufferBytes() : anonymous_namespace{Scenario1_Print.cpp}
  • SetDebugObjectName() : anonymous_namespace{DDSTextureLoader.cpp}
  • SetMaterialIndices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetSmartCardReaderDeviceId() : winrt::SDKTemplate
  • SetTriangleIndices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetVertices() : anonymous_namespace{Scenario1_Print.cpp}
  • SetVisibility() : anonymous_namespace{Scenario2_Client.cpp}
  • ShouldAttemptToConnectToInternet() : winrt::SDKTemplate
  • ShowProperties() : SDKTemplate
  • StartWatching() : SDKTemplate
  • static_assert() : HolographicMRCSample , HolographicVoiceInput , HolographicMRCSample , WindowsHolographicCodeSamples , HolographicSpatialStage , WindowsHolographicCodeSamples , _360VideoPlayback , HolographicPaint , HolographicFaceTracker , BasicHologram , _360VideoPlayback , HolographicTagAlongSample , DX , WindowsHolographicCodeSamples
  • StatusChangedHandler() : SDKTemplate
  • StopWatching() : SDKTemplate
  • StreamToStringAsync() : anonymous_namespace{Scenario1_Print.cpp}
  • StringifyProperty() : SDKTemplate
  • StringJoin() : winrt::SDKTemplate , SDKTemplate , winrt::SDKTemplate
  • StringToStreamAsync() : anonymous_namespace{Scenario1_Print.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- t -

  • ThrowIfFailed() : DX
  • TimeSpanFromMilliseconds() : SDKTemplate::Helpers
  • TimeSpanFromSeconds() : SDKTemplate::Helpers
  • to_brief_hstring() : winrt::BackgroundTask
  • to_hstring() : winrt
  • to_message() : winrt::SDKTemplate
  • to_wstring() : std
  • ToSimpleString() : winrt::SDKTemplate::Helpers
  • TransliterateFromCyrillicToLatin() : ELS
  • TryExtract() : anonymous_namespace{Scenario2_Client.cpp}
  • TryFindViewLifetimeControlForViewId() : anonymous_namespace{SampleConfiguration.cpp}
  • TryGetCurrentNetworkOperatorTetheringManager() : winrt::SDKTemplate
  • TryGetUri() : winrt::SDKTemplate
  • TryParseDouble() : winrt::SDKTemplate
  • TryParseFloat() : winrt::SDKTemplate
  • TryParseHttpUri() : winrt::SDKTemplate::Helpers
  • TryParseInt() : anonymous_namespace{Scenario2_Client.cpp}
  • TryParseInt32() : winrt::SDKTemplate
  • TryParseSigDefinedUuid() : anonymous_namespace{BluetoothLEAttributeDisplay.cpp}
  • TryParseUInt()
: winrt::SDKTemplate
, anonymous_namespace{Scenario6.cpp}
  • TryParseUIntPrefix() : winrt::SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- u -

  • Update() : SDKTemplate
  • Upnp() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- v -

  • ValidateBlob() : anonymous_namespace{Validation.cpp}
  • ValidateDataType() : anonymous_namespace{Validation.cpp}
  • ValidateInputMediaType() : Microsoft::Samples::SimpleCommunication
  • ValidateTPMSmartCard() : winrt::SDKTemplate
  • ValueChangedSubscribeToggle_Click() : SDKTemplate
  • VideoCasting() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • VideoSettingsFilter() : SDKTemplate
  • ViewReleasedHandler() : SDKSample::SecondaryViewsHelpers , SecondaryViewsHelpers , ScreenCasting::Util
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

- w -

  • WaveformNamesMap() : winrt::SDKTemplate
  • WiFiDirect() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • WiFiDirectPairedOnly() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
  • Wsd() : winrt::SDKTemplate::implementation::anonymous_namespace{DeviceHelpers.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • DeviceClosingHandler : SDKTemplate
  • Dimensions : Microsoft::SDKSamples::Kitchen
  • OvenTemperature : Microsoft::SDKSamples::Kitchen
  • ScopedHandle : anonymous_namespace{DDSTextureLoader.cpp}
  • TransformScanline : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- a -

  • AACValidAttributes : anonymous_namespace{Validation.cpp}
  • ADMIN_KEY_LENGTH_IN_BYTES : winrt::SDKTemplate
  • ANIMATION_OPACITY_END : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_OPACITY_START : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_TRANSLATION_END : anonymous_namespace{SecondaryViewPage.cpp}
  • ANIMATION_TRANSLATION_START : anonymous_namespace{SecondaryViewPage.cpp}
  • AnyHandSourceId : HolographicPaint
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- k -

  • KeepConnectionOpenScenario : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- l -

  • LocationBackgroundTask : BackgroundTask
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- m -

  • MasterDetailPage : MasterDetailApp
  • minScreenWidth : SDKTemplate
  • MinWindowHeight : winrt::SDKTemplate::implementation
  • MinWindowWidth : winrt::SDKTemplate::implementation
  • MsftOui : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- n -

  • NoSourceId : HolographicPaint
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- o -

  • OcrCapturedImage : SDKTemplate
  • OcrFileImage : SDKTemplate
  • ODHModel : SDKTemplate
  • OpenCloseConnectionScenario : SDKTemplate
  • OptIn : HttpFilters
  • OtherScenarios : SDKTemplate
  • Oven : Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- b -

  • BackgroundDeviceWatcher : BackgroundDeviceWatcherTask
  • Bars : SDKTemplate
  • BarsVisible : SDKTemplate
  • BatteryPercent : SDKTemplate
  • BatteryVisible : SDKTemplate
  • bigRectSize : SDKTemplate
  • BluetoothLEDeviceDisplay : SDKTemplate
  • Bread : Microsoft::SDKSamples::Kitchen
  • BreadBakedEventArgs : Microsoft::SDKSamples::Kitchen
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- c -

  • c_cbMaxPacketSize : anonymous_namespace{StspMediaSource.cpp}
  • c_cbReceiveBuffer : anonymous_namespace{StspMediaSink.cpp}
  • c_cbReceiveBufferSize : anonymous_namespace{StspMediaSource.cpp}
  • c_OnboardingIntrospectionXml : org::alljoyn::Onboarding
  • c_SecureInterfaceIntrospectionXml : com::microsoft::Samples::SecureInterface
  • c_wStspDefaultPort : Microsoft::Samples::SimpleCommunication
  • ColorRampDuration : anonymous_namespace{Scenario2_Effects.cpp}
  • ConnectedDevice : SDKTemplate
  • ConnectionSettingsPanel : SDKTemplate
  • ConnectTask : BackgroundTask
  • CopyFiles : SDKTemplate
  • CopyImage : SDKTemplate
  • CopyText : SDKTemplate
  • CustomEffectFrameCount : anonymous_namespace{Scenario2_Effects.cpp}
  • CustomOui : SDKTemplate
  • CustomOuiType : SDKTemplate
  • CustomTextBox : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- d -

  • DefaultControllerScale : HolographicPaint
  • DetailPage : MasterDetailApp
  • DeviceInformationDisplay : SDKTemplate
  • DiscoveredDevice : SDKTemplate
  • DisplayName : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- e -

  • EffectUpdateInterval : anonymous_namespace{Scenario2_Effects.cpp}
  • EMPTY_TITLE : anonymous_namespace{SecondaryViewPage.cpp}
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- g -

  • g_adminKey : winrt::SDKTemplate
  • g_smartCardReaderDeviceId : winrt::SDKTemplate
  • GeneratedBitmapEffectFrameCount : anonymous_namespace{Scenario2_Effects.cpp}
  • GeofenceBackgroundTask : BackgroundTask
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- h -

  • H264ValidAttributes : anonymous_namespace{Validation.cpp}
  • HistoryAndRoaming : SDKTemplate
  • HttpJsonContent : SDKTemplate
  • HttpMeteredConnectionFilter : HttpFilters
  • HttpRetryFilter : HttpFilters
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- i -

  • IsAvailable : SDKTemplate
  • IsRadioOn : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- p -

  • Password : SDKTemplate
  • PlugInFilter : SDKTemplate
  • provider : BarcodeDecoder
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- r -

  • RadioModel : SDKTemplate
  • RandomNumberGeneratorTask : RandomNumberService
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- s -

  • Scenario01_GetText : SDKTemplate
  • Scenario02_GetStream : SDKTemplate
  • Scenario03_GetList : SDKTemplate
  • Scenario04_PostText : SDKTemplate
  • Scenario05_PostStream : SDKTemplate
  • Scenario06_PostMultipart : SDKTemplate
  • Scenario07_PostStreamWithProgress : SDKTemplate
  • Scenario08_PostCustomContent : SDKTemplate
  • Scenario09_GetCookie : SDKTemplate
  • Scenario1 : SDKTemplate
  • Scenario10 : SDKTemplate
  • Scenario10_SetCookie : SDKTemplate
  • Scenario11 : SDKTemplate
  • Scenario11_DeleteCookie : SDKTemplate
  • Scenario12_DisableCookies : SDKTemplate
  • Scenario13_RetryFilter : SDKTemplate
  • Scenario14_MeteredConnectionFilter : SDKTemplate
  • Scenario15_ServerCertificateValidation : SDKTemplate
  • Scenario1_Advertiser : SDKTemplate
  • Scenario1_Analyze : SDKTemplate
  • Scenario1_Basic : SDKTemplate
  • Scenario1_BasicFunctionality : SDKTemplate
  • Scenario1_Basics : SDKTemplate
  • Scenario1_Check : SDKTemplate
  • Scenario1_CheckConsentAvailability : SDKTemplate
  • Scenario1_Colors : SDKTemplate
  • Scenario1_Configure : SDKTemplate
  • Scenario1_ConfigureMobileHotspot : SDKTemplate
  • Scenario1_Data : SDKTemplate
  • Scenario1_DataEvents : SDKTemplate
  • Scenario1_DetectInPhoto : SDKTemplate
  • Scenario1_DevicePicker : SDKTemplate
  • Scenario1_Discovery : SDKTemplate
  • Scenario1_Enable : SDKTemplate
  • Scenario1_ExtractTextSegments : SDKTemplate
  • Scenario1_Files : SDKTemplate
  • Scenario1_FindId : SDKTemplate
  • Scenario1_FindUsers : SDKTemplate
  • Scenario1_GetAndSetPin : SDKTemplate
  • Scenario1_InkCanvasTactileFeedback : SDKTemplate
  • Scenario1_LanguageDetection : SDKTemplate
  • Scenario1_Launch : SDKTemplate
  • Scenario1_Launched : SDKTemplate
  • Scenario1_LongAndShortFormats : SDKTemplate
  • Scenario1_ManageHotspot : SDKTemplate
  • Scenario1_MoveCertificate : SDKTemplate
  • Scenario1_NetworkConnectivity : SDKTemplate
  • Scenario1_Orientation : SDKTemplate
  • Scenario1_ParseAndStringify : SDKTemplate
  • Scenario1_PercentPermilleFormatting : SDKTemplate
  • Scenario1_PinTile : SDKTemplate
  • Scenario1_Prefs : SDKTemplate
  • Scenario1_Print : SDKTemplate
  • Scenario1_ProvisionTPM : SDKTemplate
  • Scenario1_ReadData : SDKTemplate
  • Scenario1_Render : SDKTemplate
  • Scenario1_Save : SDKTemplate
  • Scenario1_SecondaryWindow : SDKTemplate
  • Scenario1_SimpleListView : SDKTemplate
  • Scenario1_SingleFile : SDKTemplate
  • Scenario1_Toggle : SDKTemplate
  • Scenario1_TrackInWebcam : SDKTemplate
  • Scenario1_TrackPosition : SDKTemplate
  • Scenario1_UIFonts : SDKTemplate
  • Scenario1_UTF8 : SDKTemplate
  • Scenario1_XmlReader : SDKTemplate
  • Scenario2 : SDKTemplate
  • Scenario2_Binary : SDKTemplate
  • Scenario2_ChangePIN : SDKTemplate
  • Scenario2_Client : SDKTemplate
  • Scenario2_Connector : SDKTemplate
  • Scenario2_DecimalFormatting : SDKTemplate
  • Scenario2_DetectInWebcam : SDKTemplate
  • Scenario2_DeviceWatcher : SDKTemplate
  • Scenario2_Disable : SDKTemplate
  • Scenario2_DisplayRegion : SDKTemplate
  • Scenario2_DocumentFonts : SDKTemplate
  • Scenario2_Effects : SDKTemplate
  • Scenario2_GetCurrentTextSegmentFromIndex : SDKTemplate
  • Scenario2_GetPosition : SDKTemplate
  • Scenario2_Lang : SDKTemplate
  • Scenario2_Launch : SDKTemplate
  • Scenario2_Listen : SDKTemplate
  • Scenario2_Manage : SDKTemplate
  • Scenario2_Memory : SDKTemplate
  • Scenario2_MultiFile : SDKTemplate
  • Scenario2_MultipleScanners : SDKTemplate
  • Scenario2_NetworkCost : SDKTemplate
  • Scenario2_Notifications : SDKTemplate
  • Scenario2_Polling : SDKTemplate
  • Scenario2_Remove : SDKTemplate
  • Scenario2_RequestConsent : SDKTemplate
  • Scenario2_RequestMany : SDKTemplate
  • Scenario2_ScriptDetection : SDKTemplate
  • Scenario2_Settings : SDKTemplate
  • Scenario2_ShowHideEvents : SDKTemplate
  • Scenario2_SimpleGridView : SDKTemplate
  • Scenario2_Stats : SDKTemplate
  • Scenario2_StringTemplate : SDKTemplate
  • Scenario2_SupportedTactileFeedback : SDKTemplate
  • Scenario2_ToggleMobileHotspot : SDKTemplate
  • Scenario2_UnpinTile : SDKTemplate
  • Scenario2_WatchUsers : SDKTemplate
  • Scenario2_XmlWriter : SDKTemplate
  • Scenario3 : SDKTemplate
  • Scenario3_ActiveSymbologies : SDKTemplate
  • Scenario3_AppCapture : SDKTemplate
  • Scenario3_BackgroundDeviceWatcher : SDKTemplate
  • Scenario3_BackgroundTask : SDKTemplate
  • Scenario3_CheckUserConsentGroup : SDKTemplate
  • Scenario3_Choosing : SDKTemplate
  • Scenario3_ClientAuthentication : SDKTemplate
  • Scenario3_CurrencyFormatting : SDKTemplate
  • Scenario3_CustomItems : SDKTemplate
  • Scenario3_Enum : SDKTemplate
  • Scenario3_EnumerateTiles : SDKTemplate
  • Scenario3_InkingFeedback : SDKTemplate
  • Scenario3_MasterDetail : SDKTemplate
  • Scenario3_NetworkConnectivityChanges : SDKTemplate
  • Scenario3_ParameterizedTemplate : SDKTemplate
  • Scenario3_Region : SDKTemplate
  • Scenario3_ResetPIN : SDKTemplate
  • Scenario3_SecondaryTiles : SDKTemplate
  • Scenario3_ServerForeground : SDKTemplate
  • Scenario3_SettingContainer : SDKTemplate
  • Scenario3_ShowHideMethods : SDKTemplate
  • Scenario3_SingleFolder : SDKTemplate
  • Scenario3_Size : SDKTemplate
  • Scenario3_Transliteration : SDKTemplate
  • Scenario3_XmlWriterLite : SDKTemplate
  • Scenario4 : SDKTemplate
  • Scenario4_ChangeAdminKey : SDKTemplate
  • Scenario4_ChangeSystemGroup : SDKTemplate
  • Scenario4_CharacterGrouping : SDKTemplate
  • Scenario4_CompactOverlay : SDKTemplate
  • Scenario4_CompositeSettings : SDKTemplate
  • Scenario4_EdgeTappedListView : SDKTemplate
  • Scenario4_ForegroundGeofence : SDKTemplate
  • Scenario4_Input : SDKTemplate
  • Scenario4_InteractionFeedback : SDKTemplate
  • Scenario4_NumberParsing : SDKTemplate
  • Scenario4_Override : SDKTemplate
  • Scenario4_PartialReadWrite : SDKTemplate
  • Scenario4_SaveFile : SDKTemplate
  • Scenario4_ShowView : SDKTemplate
  • Scenario4_Snapshot : SDKTemplate
  • Scenario4_TilePinned : SDKTemplate
  • Scenario4_UnicodeExtensions : SDKTemplate
  • Scenario5 : SDKTemplate
  • Scenario5_GeofenceBackgroundTask : SDKTemplate
  • Scenario5_GetSingleDevice : SDKTemplate
  • Scenario5_InkingAndInteractionFeedback : SDKTemplate
  • Scenario5_IsSupported : SDKTemplate
  • Scenario5_LaunchedFromSecondaryTile : SDKTemplate
  • Scenario5_Msappdata : SDKTemplate
  • Scenario5_RelativePositioning : SDKTemplate
  • Scenario5_RestoreScrollPosition : SDKTemplate
  • Scenario5_RoundingAndPadding : SDKTemplate
  • Scenario5_TimeZone : SDKTemplate
  • Scenario5_TriggerCFU : SDKTemplate
  • Scenario5_UnicodeExtensions : SDKTemplate
  • Scenario5_VerifyResponse : SDKTemplate
  • Scenario6 : SDKTemplate
  • Scenario6_ClearScenario : SDKTemplate
  • Scenario6_CustomFilterAddedProps : SDKTemplate
  • Scenario6_DeleteTPM : SDKTemplate
  • Scenario6_GetLastVisit : SDKTemplate
  • Scenario6_NumeralSystemTranslation : SDKTemplate
  • Scenario6_ScrollIntoView : SDKTemplate
  • Scenario6_SecondaryTileNotification : SDKTemplate
  • Scenario6_TimeZone : SDKTemplate
  • Scenario7 : SDKTemplate
  • Scenario7_DeviceInformationKind : SDKTemplate
  • Scenario7_ForegroundVisits : SDKTemplate
  • Scenario7_ListAllCards : SDKTemplate
  • Scenario7_PinFromAppbar : SDKTemplate
  • Scenario7_SetVersion : SDKTemplate
  • Scenario7_UsingUnicodeExtensions : SDKTemplate
  • Scenario8 : SDKTemplate
  • Scenario8_PairDevice : SDKTemplate
  • Scenario8_UpdateAsync : SDKTemplate
  • Scenario8_VisitsBackgroundTask : SDKTemplate
  • Scenario9 : SDKTemplate
  • Scenario9_CustomPairDevice : SDKTemplate
  • SecondaryAppWindowPage : SDKTemplate
  • ShowPackageFamilyName : SDKTemplate
  • SlowInputStream : SDKTemplate
  • smallRectSize : SDKTemplate
  • Ssid : SDKTemplate
  • strServerPort : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- u -

  • UpdateMetadataTask : BackgroundTask
  • UserViewModel : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- v -

  • ValidMediaTypes : anonymous_namespace{Validation.cpp}
  • VisitBackgroundTask : BackgroundTask
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • u
  • v
  • w

- w -

  • WfaOui : SDKTemplate
  • WordOverlay : SDKTemplate
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/pch.cpp Source File

  • MediaTranscoding
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoggingSessionScenario Member List

This is the complete list of members for LoggingSessionScenario, including all inherited members.
channel | LoggingSessionScenario | [private]
channelLoggingLevel | LoggingSessionScenario | [private]
CheckDisposed() | LoggingSessionScenario | [inline, private]
DEFAULT_CHANNEL_NAME | LoggingSessionScenario |
DEFAULT_SESSION_NAME | LoggingSessionScenario |
Dispose() | LoggingSessionScenario | [inline]
Dispose(bool disposing) | LoggingSessionScenario | [inline, protected, virtual]
DoScenarioAsync() | LoggingSessionScenario | [inline]
GetTimeStamp() | LoggingSessionScenario | [inline, private]
Instance | LoggingSessionScenario | [static]
IsBusy | LoggingSessionScenario |
isBusy | LoggingSessionScenario | [private]
isChannelEnabled | LoggingSessionScenario | [private]
isDisposed | LoggingSessionScenario | [private]
IsLoggingEnabled | LoggingSessionScenario |
LogFileGeneratedCount | LoggingSessionScenario |
LoggingEnabledKey | LoggingSessionScenario | [private]
LoggingSessionScenario() | LoggingSessionScenario | [inline, private]
loggingSessionScenario | LoggingSessionScenario | [private, static]
OnAppResuming(object sender, object e) | LoggingSessionScenario | [inline, private]
OnAppSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) | LoggingSessionScenario | [inline, private]
OnChannelLoggingEnabled(ILoggingChannel sender, object args) | LoggingSessionScenario | [inline, private]
OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME | LoggingSessionScenario |
Prefix | LoggingSessionScenario | [private]
PrepareToSuspend() | LoggingSessionScenario | [inline]
ResumeLoggingIfApplicable() | LoggingSessionScenario | [inline]
SaveLogInMemoryToFileAsync() | LoggingSessionScenario | [inline, private]
session | LoggingSessionScenario | [private]
StartLogging() | LoggingSessionScenario | [inline]
StatusChanged | LoggingSessionScenario |
ToggleLoggingEnabledDisabled() | LoggingSessionScenario | [inline]
~LoggingSessionScenario() | LoggingSessionScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/SampleConfiguration.cpp Source File

  • TouchKeyboardTextInput
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Spelling and Text Suggestions", "SDKTemplate.Scenario1_SpellingTextSuggestions" },
00021     { "Scoped Views", "SDKTemplate.Scenario2_ScopedViews" }
00022 };
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/D2DSvgImageRenderer.h Source File

  • D2DSvgImage
  • cpp

D2DSvgImageRenderer.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Common\DeviceResources.h"
00015
00016 namespace SDKTemplate
00017 {
00018     class D2DSvgImageRenderer : public DX::IDeviceNotify
00019     {
00020     public:
00021         D2DSvgImageRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00022         ~D2DSvgImageRenderer();
00023
00024         void CreateDeviceIndependentResources();
00025         void CreateDeviceDependentResources();
00026         void CreateWindowSizeDependentResources();
00027         void ReleaseDeviceDependentResources();
00028         void Draw();
00029
00030         void RecolorSvg(D2D1_COLOR_F newColor);
00031         void ToggleTongue();
00032         void SetScaleValue(float val);
00033
00034         // IDeviceNotify methods handle device lost and restored.
00035         virtual void OnDeviceLost();
00036         virtual void OnDeviceRestored();
00037
00038     private:
00039         // Private helper for SetNewThemeColor.
00040         void RecolorSubtree(ID2D1SvgElement* element, D2D1_COLOR_F newColor);
00041
00042         // Cached pointer to device resources.
00043         std::shared_ptr<DX::DeviceResources>        m_deviceResources;
00044
00045         // Device-dependent resources.
00046         Microsoft::WRL::ComPtr<ID2D1SvgDocument>    m_svgDocument;
00047
00048         float                                       m_scaleValue;
00049         bool                                        m_isWindowClosed;
00050     };
00051 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/SampleConfiguration.h Source File

  • XamlAnimatedGif
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "XAML Animated GIF Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Model Member List

This is the complete list of members for Model, including all inherited members.
ImageUri Model
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Program.cs Source File

  • 360VideoPlayback
  • cs

Program.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.ApplicationModel.Core;
00003
00004 namespace _360VideoPlayback
00005 {
00006     /// <summary>
00007     /// Windows Holographic application using SharpDX.
00008     /// </summary>
00009     internal class Program
00010     {
00011         /// <summary>
00012         /// Defines the entry point of the application.
00013         /// </summary>
00014         [MTAThread]
00015         private static void Main()
00016         {
00017             var exclusiveViewApplicationSource = new AppViewSource();
00018             CoreApplication.Run(exclusiveViewApplicationSource);
00019         }
00020     }
00021 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/SampleConfiguration.cpp Source File

  • XamlBottomUpList
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace SDKTemplate;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::System::Threading;
00021
00022 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00023 {
00024     { "Create a bottom-up list", "SDKTemplate.Scenario1_Basic" },
00025     { "Incremental loading", "SDKTemplate.Scenario2_Load" },
00026 };
00027
00028 String^ Helpers::GetCurrentDateTimeAsString()
00029 {
00030     static auto calendar = ref new Windows::Globalization::Calendar();
00031     static auto formatter = ref new Windows::Globalization::DateTimeFormatting::DateTimeFormatter("shortdate longtime");
00032     calendar->SetToNow();
00033     return formatter->Format(calendar->GetDateTime());
00034 }
00035
00036 TimeSpan Helpers::TimeSpanFromSeconds(int seconds)
00037 {
00038     TimeSpan timeSpan;
00039     timeSpan.Duration = seconds * 1000LL * 10000LL; // convert seconds to TimeSpan units
00040     return timeSpan;
00041 }
00042
00043 task<void> Helpers::DelayAsync(TimeSpan duration, Concurrency::cancellation_token cancel)
00044 {
00045     task_completion_event<void> tce;
00046     ThreadPoolTimer^ timer = ThreadPoolTimer::CreateTimer(ref new TimerElapsedHandler([tce](ThreadPoolTimer^)
00047     {
00048         tce.set();
00049     }), duration);
00050     return task<void>(tce, cancel);
00051 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/SampleConfiguration.cs Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Proxy and stub generation for Windows Runtime components";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Using Custom Components", ClassType=typeof(ProxyStubsForWinRTComponents.OvenClient)},
00025             new Scenario() { Title="Handling Windows Runtime Exceptions", ClassType=typeof(ProxyStubsForWinRTComponents.CustomException)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/Scenario2_DetectInWebcam.xaml.cs Source File

  • BasicFaceDetection
  • cs

Scenario2_DetectInWebcam.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Foundation;
00016 using Windows.Graphics.Imaging;
00017 using Windows.Media;
00018 using Windows.Media.Capture;
00019 using Windows.Media.FaceAnalysis;
00020 using Windows.Media.MediaProperties;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Media;
00024 using Windows.UI.Xaml.Media.Imaging;
00025 using Windows.UI.Xaml.Navigation;
00026
00027 namespace SDKTemplate
00028 {
00029     /// <summary>
00030     /// Page for demonstrating FaceDetection on a webcam snapshot.
00031     /// </summary>
00032     public sealed partial class Scenario2_DetectInWebcam : Page
00033     {
00034         /// <summary>
00035         /// Reference back to the "root" page of the app.
00036         /// </summary>
00037         private MainPage rootPage = MainPage.Current;
00038
00039         /// <summary>
00040         /// Holds the current scenario state value.
00041         /// </summary>
00042         private ScenarioState currentState;
00043
00044         /// <summary>
00045         /// References a MediaCapture instance; is null when not in Streaming state.
00046         /// </summary>
00047         private MediaCapture mediaCapture;
00048
00049         /// <summary>
00050         /// Cache of properties from the current MediaCapture device which is used for capturing the preview frame.
00051         /// </summary>
00052         private VideoEncodingProperties videoProperties;
00053
00054         /// <summary>
00055         /// References a FaceDetector instance.
00056         /// </summary>
00057         private FaceDetector faceDetector;
00058
00059         /// <summary>
00060         /// Initializes a new instance of the <see cref="Scenario2_DetectInWebcam"/> class.
00061         /// </summary>
00062         public Scenario2_DetectInWebcam()
00063         {
00064             this.InitializeComponent();
00065
00066             this.currentState = ScenarioState.Idle;
00067         }
00068
00069         /// <summary>
00070         /// Values for identifying and controlling scenario states.
00071         /// </summary>
00072         private enum ScenarioState
00073         {
00074             /// <summary>
00075             /// Display is blank - default state.
00076             /// </summary>
00077             Idle,
00078
00079             /// <summary>
00080             /// Webcam is actively engaged and a live video stream is displayed.
00081             /// </summary>
00082             Streaming,
00083
00084             /// <summary>
00085             /// Snapshot image has been captured and is being displayed along with detected faces; webcam is not active.
00086             /// </summary>
00087             Snapshot
00088         }
00089
00090         /// <summary>
00091         /// Called when we navigate to this page.
00092         /// </summary>
00093         /// <param name="e">Event data</param>
00094         protected override void OnNavigatedTo(NavigationEventArgs e)
00095         {
00096             App.Current.Suspending += this.OnSuspending;
00097         }
00098
00099         /// <summary>
00100         /// Called when we navigate away from this page.
00101         /// </summary>
00102         /// <param name="e">Event data</param>
00103         protected override void OnNavigatedFrom(NavigationEventArgs e)
00104         {
00105             App.Current.Suspending -= this.OnSuspending;
00106         }
00107
00108         /// <summary>
00109         /// Responds to App Suspend event to stop/release MediaCapture object if it's running and return to Idle state.
00110         /// </summary>
00111         /// <param name="sender">The source of the Suspending event</param>
00112         /// <param name="e">Event data</param>
00113         private async void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00114         {
00115             if (this.currentState == ScenarioState.Streaming)
00116             {
00117                 var deferral = e.SuspendingOperation.GetDeferral();
00118                 try
00119                 {
00120                     await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00121                 }
00122                 finally
00123                 {
00124                     deferral.Complete();
00125                 }
00126             }
00127         }
00128
00129         /// <summary>
00130         /// Initializes a new MediaCapture instance and starts the Preview streaming to the CamPreview UI element.
00131         /// </summary>
00132         /// <returns>Async Task object returning true if initialization and streaming were successful and false if an exception occurred.</returns>
00133         private async Task<bool> StartWebcamStreamingAsync()
00134         {
00135             bool successful = false;
00136
00137             this.faceDetector = await FaceDetector.CreateAsync();
00138
00139             try
00140             {
00141                 this.mediaCapture = new MediaCapture();
00142
00143                 // For this scenario, we only need Video (not microphone) so specify this in the initializer.
00144                 // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
00145                 // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
00146                 MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
00147                 settings.StreamingCaptureMode = StreamingCaptureMode.Video;
00148                 await this.mediaCapture.InitializeAsync(settings);
00149                 this.mediaCapture.CameraStreamStateChanged += this.MediaCapture_CameraStreamStateChanged;
00150
00151                 // Cache the media properties as we'll need them later.
00152                 var deviceController = this.mediaCapture.VideoDeviceController;
00153                 this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
00154
00155                 // Immediately start streaming to our CaptureElement UI.
00156                 // NOTE: CaptureElement's Source must be set before streaming is started.
00157                 this.CamPreview.Source = this.mediaCapture;
00158                 await this.mediaCapture.StartPreviewAsync();
00159
00160                 successful = true;
00161             }
00162             catch (System.UnauthorizedAccessException)
00163             {
00164                 // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
00165                 this.rootPage.NotifyUser("Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType.ErrorMessage);
00166             }
00167             catch (Exception ex)
00168             {
00169                 this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00170             }
00171
00172             return successful;
00173         }
00174
00175         /// <summary>
00176         /// Safely stops webcam streaming (if running) and releases MediaCapture object.
00177         /// </summary>
00178         private async Task ShutdownWebcamAsync()
00179         {
00180             if (this.mediaCapture != null)
00181             {
00182                 if (this.mediaCapture.CameraStreamState == Windows.Media.Devices.CameraStreamState.Streaming)
00183                 {
00184                     await this.mediaCapture.StopPreviewAsync();
00185                 }
00186
00187                 this.mediaCapture.Dispose();
00188             }
00189
00190             this.CamPreview.Source = null;
00191             this.mediaCapture = null;
00192         }
00193
00194         /// <summary>
00195         /// Captures a single frame from the running webcam stream and executes the FaceDetector on the image. If successful calls SetupVisualization to display the results.
00196         /// </summary>
00197         /// <returns>Async Task object returning true if the capture was successful and false if an exception occurred.</returns>
00198         private async Task<bool> TakeSnapshotAndFindFacesAsync()
00199         {
00200             if (this.currentState != ScenarioState.Streaming)
00201             {
00202                 return false;
00203             }
00204
00205             bool successful = false;
00206
00207             try
00208             {
00209                 // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
00210                 // GetPreviewFrame will convert the native webcam frame into this format.
00211                 const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
00212                 using (VideoFrame previewFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width, (int)this.videoProperties.Height))
00213                 {
00214                     await this.mediaCapture.GetPreviewFrameAsync(previewFrame);
00215
00216                     // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
00217                     if (FaceDetector.IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap.BitmapPixelFormat))
00218                     {
00219                         IList<DetectedFace> faces = await this.faceDetector.DetectFacesAsync(previewFrame.SoftwareBitmap);
00220
00221                         // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to wb's buffer.
00222                         // Note that WriteableBitmap doesn't support NV12 and we have to convert it to 32-bit BGRA.
00223                         WriteableBitmap displaySource;
00224                         using (SoftwareBitmap convertedSource = SoftwareBitmap.Convert(previewFrame.SoftwareBitmap, BitmapPixelFormat.Bgra8))
00225                         {
00226                             displaySource = new WriteableBitmap(convertedSource.PixelWidth, convertedSource.PixelHeight);
00227                             convertedSource.CopyToBuffer(displaySource.PixelBuffer);
00228                         }
00229
00230                         // Create our display using the available image and face results.
00231                         this.SetupVisualization(displaySource, faces);
00232
00233                         successful = true;
00234                     }
00235                     else
00236                     {
00237                         this.rootPage.NotifyUser("PixelFormat '" + InputPixelFormat.ToString() + "' is not supported by FaceDetector", NotifyType.ErrorMessage);
00238                     }
00239                 }
00240             }
00241             catch (Exception ex)
00242             {
00243                 this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00244                 successful = false;
00245             }
00246
00247             return successful;
00248         }
00249
00250         /// <summary>
00251         /// Takes the webcam image and FaceDetector results and assembles the visualization onto the Canvas.
00252         /// </summary>
00253         /// <param name="displaySource">Bitmap object holding the image we're going to display</param>
00254         /// <param name="foundFaces">List of detected faces; output from FaceDetector</param>
00255         private void SetupVisualization(WriteableBitmap displaySource, IList<DetectedFace> foundFaces)
00256         {
00257             this.SnapshotCanvas.Background = new ImageBrush() { ImageSource = displaySource, Stretch = Stretch.Fill };
00258             MainPage.HighlightFaces(displaySource, foundFaces, this.SnapshotCanvas, this.HighlightedFaceBox);
00259         }
00260
00261         /// <summary>
00262         /// Manages the scenario's internal state. Invokes the internal methods and updates the UI according to the
00263         /// passed in state value. Handles failures and resets the state if necessary.
00264         /// </summary>
00265         /// <param name="newState">State to switch to</param>
00266         private async Task ChangeScenarioStateAsync(ScenarioState newState)
00267         {
00268             switch (newState)
00269             {
00270                 case ScenarioState.Idle:
00271
00272                     this.CameraSnapshotButton.IsEnabled = false;
00273                     await this.ShutdownWebcamAsync();
00274
00275                     this.SnapshotCanvas.Background = null;
00276                     this.SnapshotCanvas.Children.Clear();
00277                     this.CameraStreamingButton.Content = "Start Streaming";
00278                     this.CameraSnapshotButton.Content = "Take Snapshot";
00279                     this.currentState = newState;
00280                     break;
00281
00282                 case ScenarioState.Streaming:
00283
00284                     if (!await this.StartWebcamStreamingAsync())
00285                     {
00286                         await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00287                         break;
00288                     }
00289
00290                     this.SnapshotCanvas.Background = null;
00291                     this.SnapshotCanvas.Children.Clear();
00292                     this.CameraSnapshotButton.IsEnabled = true;
00293                     this.CameraStreamingButton.Content = "Stop Streaming";
00294                     this.CameraSnapshotButton.Content = "Take Snapshot";
00295                     this.currentState = newState;
00296                     break;
00297
00298                 case ScenarioState.Snapshot:
00299
00300                     if (!await this.TakeSnapshotAndFindFacesAsync())
00301                     {
00302                         await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00303                         break;
00304                     }
00305
00306                     await this.ShutdownWebcamAsync();
00307
00308                     this.CameraSnapshotButton.IsEnabled = true;
00309                     this.CameraStreamingButton.Content = "Start Streaming";
00310                     this.CameraSnapshotButton.Content = "Clear Display";
00311                     this.currentState = newState;
00312                     break;
00313             }
00314         }
00315
00316         /// <summary>
00317         /// Handles MediaCapture changes by shutting down streaming and returning to Idle state.
00318         /// </summary>
00319         /// <param name="sender">The source of the event, i.e. our MediaCapture object</param>
00320         /// <param name="args">Event data</param>
00321         private async void MediaCapture_CameraStreamStateChanged(MediaCapture sender, object args)
00322         {
00323             // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
00324             // and instead need to schedule the state change on the UI thread.
00325             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00326             {
00327                 await ChangeScenarioStateAsync(ScenarioState.Idle);
00328             });
00329         }
00330
00331         /// <summary>
00332         /// Handles "streaming" button clicks to start/stop webcam streaming.
00333         /// </summary>
00334         /// <param name="sender">Button user clicked</param>
00335         /// <param name="e">Event data</param>
00336         private async void CameraStreamingButton_Click(object sender, RoutedEventArgs e)
00337         {
00338             this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00339             if (this.currentState == ScenarioState.Streaming)
00340             {
00341                 await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00342             }
00343             else
00344             {
00345                 await this.ChangeScenarioStateAsync(ScenarioState.Streaming);
00346             }
00347         }
00348
00349         /// <summary>
00350         /// Handles "snapshot" button clicks to take a snapshot or clear the current display.
00351         /// </summary>
00352         /// <param name="sender">Button user clicked</param>
00353         /// <param name="e">Event data</param>
00354         private async void CameraSnapshotButton_Click(object sender, RoutedEventArgs e)
00355         {
00356             this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00357             if (this.currentState == ScenarioState.Streaming)
00358             {
00359                 await this.ChangeScenarioStateAsync(ScenarioState.Snapshot);
00360             }
00361             else
00362             {
00363                 await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00364             }
00365         }
00366
00367         /// <summary>
00368         /// Updates any existing face bounding boxes in response to changes in the size of the Canvas.
00369         /// </summary>
00370         /// <param name="sender">Canvas whose size has changed</param>
00371         /// <param name="e">Event data</param>
00372         private void SnapshotCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
00373         {
00374             // If the Canvas is resized we must recompute a new scaling factor and
00375             // apply it to each face box.
00376             ImageBrush brush = (ImageBrush)this.SnapshotCanvas.Background;
00377             if (brush != null)
00378             {
00379                 MainPage.RepositionFaces((WriteableBitmap)brush.ImageSource, this.SnapshotCanvas);
00380             }
00381         }
00382     }
00383 }
Generated on Fri Nov 15 2024 22:18:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/IsApiPropertyPresentTrigger.cs Source File

  • VersionAdaptiveCode
  • cs

IsApiPropertyPresentTrigger.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Concurrent;
00014 using System.Threading.Tasks;
00015 using Windows.Foundation.Metadata;
00016 using Windows.UI.Xaml;
00017
00018 namespace SDKTemplate
00019 {
00020     class IsApiPropertyPresentTrigger : StateTriggerBase
00021     {
00022         // IsPresent defaults to true. The others default to null.
00023         private string _typeName;
00024         private string _propertyName;
00025         private bool _isPresent = true;
00026
00027         // Create a process-wide cache of property presence queries.
00028         private static ConcurrentDictionary<Tuple<string, string>, bool> propertyPresence =
00029             new ConcurrentDictionary<Tuple<string, string>, bool>();
00030
00031         private bool _isPropertyPresent;
00032
00033         public string TypeName
00034         {
00035             get { return _typeName; }
00036             set { _typeName = value; UpdatePresence(); }
00037         }
00038
00039         public string PropertyName
00040         {
00041             get { return _propertyName; }
00042             set { _propertyName = value; UpdatePresence(); }
00043         }
00044
00045         public bool IsPresent
00046         {
00047             get { return _isPresent; }
00048             set { _isPresent = value; UpdateState(); }
00049         }
00050
00051         void UpdatePresence()
00052         {
00053             if (string.IsNullOrEmpty(_typeName) || string.IsNullOrEmpty(_propertyName))
00054             {
00055                 // State trigger not yet fully initialized.
00056                 return;
00057             }
00058
00059             // If the answer is not already cached, then call into
00060             // ApiInformation method to determine whether property is present.
00061             _isPropertyPresent = propertyPresence.GetOrAdd(Tuple.Create(_typeName, _propertyName),
00062                (key) => ApiInformation.IsPropertyPresent(key.Item1, key.Item2));
00063
00064             UpdateState();
00065         }
00066
00067         void UpdateState()
00068         {
00069             // If the property presence matches _isPresent then the trigger will be activated.
00070             SetActive(_isPresent == _isPropertyPresent);
00071         }
00072     }
00073 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AppContactPanel Member List

This is the complete list of members for AppContactPanel, including all inherited members.
_appContactId | AppContactPanel | [private]
AllowAccess_Click(object sender, RoutedEventArgs e) | AppContactPanel | [inline, private]
AppContactPanel() | AppContactPanel | [inline]
AppContactPanel_LaunchFullAppRequested(ContactPanel sender, ContactPanelLaunchFullAppRequestedEventArgs args) | AppContactPanel | [inline, private]
fullContact | AppContactPanel | [private]
GetRemoteIdForContactAsync(Contact fullContact) | AppContactPanel | [inline]
InitializePageAsync() | AppContactPanel | [inline]
lightContact | AppContactPanel | [private]
OnActivated(ContactPanelActivatedEventArgs args) | AppContactPanel | [inline]
OnWindowActivated(object sender, WindowActivatedEventArgs e) | AppContactPanel | [inline, private]
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario1.xaml.h Source File

  • FileThumbnails
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.h
00014 // Declaration of the Scenario1 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     [Windows::Foundation::Metadata::WebHostHidden]
00026     public ref class Scenario1 sealed
00027     {
00028     public:
00029         Scenario1();
00030
00031     protected:
00032         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033
00034     private:
00035         MainPage^ rootPage;
00036
00037         void GetThumbnailButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario6_CustomFilterAddedProps.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario6_CustomFilterAddedProps.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_CustomFilterAddedProps.h"
00014 #include "DeviceHelpers.h"
00015 #include "Scenario6_CustomFilterAddedProps.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Devices::Enumeration;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario6_CustomFilterAddedProps::Scenario6_CustomFilterAddedProps()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario6_CustomFilterAddedProps::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         resultsListView().ItemsSource(resultCollection);
00033     }
00034
00035     void Scenario6_CustomFilterAddedProps::OnNavigatedFrom(NavigationEventArgs const&)
00036     {
00037         deviceWatcherHelper->Reset();
00038     }
00039
00040     void Scenario6_CustomFilterAddedProps::StartWatcherButton_Click(IInspectable const&, RoutedEventArgs const&)
00041     {
00042         StartWatcher();
00043     }
00044
00045     void Scenario6_CustomFilterAddedProps::StopWatcherButton_Click(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         StopWatcher();
00048     }
00049
00050     void Scenario6_CustomFilterAddedProps::StartWatcher()
00051     {
00052         aqsFilterTextBox().IsEnabled(false);
00053         startWatcherButton().IsEnabled(false);
00054         resultCollection.Clear();
00055
00056         // Request some additional properties.  In this sample, these extra properties are just used in the ResultsListViewTemplate.
00057         // In general you just look up the property in the DeviceInformation.Properties.
00058         // e.g. DeviceInformation.Properties.TryLookup(L"System.Devices.InterfaceClassGuid").
00059         std::vector<hstring> requestedProperties = {
00060             L"System.Devices.InterfaceClassGuid",
00061             L"System.ItemNameDisplay"
00062         };
00063
00064         // Use AQS string filter from the text box
00065         DeviceWatcher deviceWatcher = DeviceInformation::CreateWatcher(
00066             aqsFilterTextBox().Text(),
00067             requestedProperties);
00068
00069         rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
00070         deviceWatcherHelper->StartWatcher(deviceWatcher);
00071         stopWatcherButton().IsEnabled(true);
00072         stopWatcherButton().Focus(FocusState::Keyboard);
00073         aqsFilterTextBox().IsEnabled(true);
00074     }
00075
00076     void Scenario6_CustomFilterAddedProps::StopWatcher()
00077     {
00078         aqsFilterTextBox().IsEnabled(false);
00079         stopWatcherButton().IsEnabled(false);
00080
00081         deviceWatcherHelper->StopWatcher();
00082
00083         startWatcherButton().IsEnabled(true);
00084         startWatcherButton().Focus(FocusState::Keyboard);
00085         aqsFilterTextBox().IsEnabled(true);
00086     }
00087 }
Generated on Fri Nov 15 2024 22:19:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareCustomProvider.xaml.cs Source File

  • ShareSource
  • cs

ShareCustomProvider.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.ApplicationModel.DataTransfer;
00015 using Windows.Storage.Streams;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class ShareCustomProvider
00023     {
00024         private DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
00025
00026         public ShareCustomProvider()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             base.OnNavigatedTo(e);
00034
00035             // Register the event to add a Share Provider
00036             dataTransferManager.ShareProvidersRequested += OnShareProvidersRequested;
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             this.dataTransferManager.ShareProvidersRequested -= OnShareProvidersRequested;
00042             base.OnNavigatedFrom(e);
00043         }
00044
00045         protected override bool GetShareContent(DataRequest request)
00046         {
00047             DataPackage requestData = request.Data;
00048             requestData.Properties.Title = "I got a new high score!";
00049             requestData.SetText("I got a high score of 15063!");
00050             return true;
00051         }
00052
00053         private void OnShareProvidersRequested(DataTransferManager s, ShareProvidersRequestedEventArgs e)
00054         {
00055             // Take a deferral so that we can perform async operations. (This sample
00056             // doesn't perform any async operations in the ShareProvidersRequested
00057             // event handler, but we take the deferral anyway to demonstrate the pattern.)
00058             using (var deferral = e.GetDeferral())
00059             {
00060                 // Create the custom share provider and add it.
00061                 RandomAccessStreamReference icon = RandomAccessStreamReference.CreateFromUri(new Uri(@"ms-appx:///Assets/windows-sdk.png"));
00062                 ShareProvider provider = new ShareProvider("Contoso Chat", icon, Windows.UI.Colors.LightGray, OnShareToContosoChat);
00063                 e.Providers.Add(provider);
00064             }
00065         }
00066
00067         private async void OnShareToContosoChat(ShareProviderOperation operation)
00068         {
00069             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00070             {
00071                 ShareCompletedText.Text = "";
00072
00073                 // Obtain the text from the data package. This should match
00074                 // the information placed in it by the GetShareContent method.
00075                 String text = await operation.Data.GetTextAsync();
00076
00077                 // The app can display custom UI to complete the Share operation.
00078                 // Here, we simply display a progress control and delay for a while,
00079                 // to simulate posting to the Contoso Chat service.
00080                 ProgressControl.Visibility = Visibility.Visible;
00081                 await Task.Delay(TimeSpan.FromSeconds(2));
00082
00083                 // All done. Show the success message.
00084                 ProgressControl.Visibility = Visibility.Collapsed;
00085                 ShareCompletedText.Text = $"Your message '{text}' has been shared with Contoso Chat.";
00086
00087                 // Completing the operation causes ShareCompleted to be raised.
00088                 operation.ReportCompleted();
00089             });
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Read Member List

This is the complete list of members for Read, including all inherited members.
Address | ReadBinary |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
Read(ushort blockNumber) | Read | [inline]
ReadBinary(ushort address, byte?expectedReturnBytes) | ReadBinary | [inline]
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_DeviceInformationKind Member List

This is the complete list of members for Scenario7_DeviceInformationKind, including all inherited members.
deviceWatcherHelpers | Scenario7_DeviceInformationKind | [private]
OnDeviceListChanged(DeviceWatcher sender, string id) | Scenario7_DeviceInformationKind | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario7_DeviceInformationKind | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario7_DeviceInformationKind | [inline, protected]
resultCollection | Scenario7_DeviceInformationKind | [private]
rootPage | Scenario7_DeviceInformationKind | [private]
Scenario7_DeviceInformationKind() | Scenario7_DeviceInformationKind | [inline]
StartWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario7_DeviceInformationKind | [inline, private]
StartWatchers() | Scenario7_DeviceInformationKind | [inline, private]
StopWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario7_DeviceInformationKind | [inline, private]
StopWatchers(bool reset=false) | Scenario7_DeviceInformationKind | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario2_CloseDrawer.xaml.h Source File

  • CashDrawer
  • cpp

Scenario2_CloseDrawer.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_CloseDrawer.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2_CloseDrawer sealed
00024     {
00025     public:
00026         Scenario2_CloseDrawer();
00027
00028     private:
00029         MainPage^ rootPage;
00030
00031         Windows::Devices::PointOfService::CashDrawer^ drawer = nullptr;
00032         Windows::Devices::PointOfService::ClaimedCashDrawer^ claimedDrawer = nullptr;
00033
00034         void InitDrawerButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035         void WaitForDrawerCloseButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036
00037         concurrency::task<bool> CreateDefaultCashDrawerObject();
00038         concurrency::task<bool> ClaimCashDrawer();
00039
00040         Windows::Foundation::EventRegistrationToken statusUpdatedToken;
00041
00042         void drawer_StatusUpdated(Windows::Devices::PointOfService::CashDrawer^ sender, Windows::Devices::PointOfService::CashDrawerStatusUpdatedEventArgs^ e);
00043         void drawer_AlarmExpired(Windows::Devices::PointOfService::CashDrawerCloseAlarm^ alarm, Platform::Object^ sender);
00044
00045         void ResetScenarioState();
00046         void UpdateStatusOutput(Windows::Devices::PointOfService::CashDrawerStatusKind status);
00047
00048     protected:
00049         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00050         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00051     };
00052 }
Generated on Fri Nov 15 2024 22:18:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario10_Delete.xaml.h Source File

  • FileAccess
  • cpp

Scenario10_Delete.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario10_Delete.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Deleting a file.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario10 sealed
00025     {
00026     public:
00027         Scenario10();
00028         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032
00033         void DeleteFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_PauseAsync Member List

This is the complete list of members for Scenario_PauseAsync, including all inherited members.
ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args) | Scenario_PauseAsync | [inline, private]
ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args) | Scenario_PauseAsync | [inline, private]
EmailButton_Click(object sender, RoutedEventArgs e) | Scenario_PauseAsync | [inline]
emailConstraint | Scenario_PauseAsync | [private]
InitializeRecognizer() | Scenario_PauseAsync | [inline, private]
isListening | Scenario_PauseAsync | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario_PauseAsync | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario_PauseAsync | [inline, protected]
PhoneButton_Click(object sender, RoutedEventArgs e) | Scenario_PauseAsync | [inline]
phoneConstraint | Scenario_PauseAsync | [private]
Recognize_Click(object sender, RoutedEventArgs e) | Scenario_PauseAsync | [inline]
rootPage | Scenario_PauseAsync | [private]
Scenario_PauseAsync() | Scenario_PauseAsync | [inline]
speechRecognizer | Scenario_PauseAsync | [private]
SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) | Scenario_PauseAsync | [inline, private]
ToggleButtons(bool state) | Scenario_PauseAsync | [inline, private]
UpdateUI(bool newState) | Scenario_PauseAsync | [inline, private]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpatialInputHandler Member List

This is the complete list of members for SpatialInputHandler, including all inherited members.
CheckForInput() | SpatialInputHandler |
m_interactionManager | SpatialInputHandler | [private]
m_sourcePressedEventToken | SpatialInputHandler | [private]
m_sourceState | SpatialInputHandler | [private]
OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | SpatialInputHandler | [private]
SpatialInputHandler() | SpatialInputHandler |
~SpatialInputHandler() | SpatialInputHandler |
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Helpers/PlayReadyHelper.cs Source File

  • AdaptiveStreaming
  • cs
  • Helpers

PlayReadyHelper.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using SDKTemplate.Logging;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Net.Http;
00017 using System.Net.Http.Headers;
00018 using System.Runtime.InteropServices;
00019 using System.Text;
00020 using System.Threading.Tasks;
00021 using Windows.Foundation.Collections;
00022 using Windows.Media.Playback;
00023 using Windows.Media.Protection;
00024 using Windows.Media.Protection.PlayReady;
00025 using Windows.UI.Core;
00026 using Windows.UI.Xaml.Controls;
00027
00028 namespace SDKTemplate.Helpers
00029 {
00030
00031     /// <summary>
00032     /// Encapsulates all the required calls to setup a MediaProtectionManger within a MediaPlayer
00033     /// for typical PlayReady scenarios.
00034     ///
00035     /// It is left to the user of these samples to explore other PlayReady rights management scenarios.
00036     ///
00037     /// </summary>
00038     public class PlayReadyHelper
00039     {
00040         public PlayReadyHelper(LogView logger = null)
00041         {
00042             this.logger = logger;
00043         }
00044         private LogView logger;
00045
00046
00047         private const int MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED = -2147174251;
00048         private KeyValuePair<string, object> PlayReadyWinRTTrustedInput = new KeyValuePair<string, object>("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput" );
00049         private KeyValuePair<string, object> MediaProtectionSystemId = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
00050         private KeyValuePair<string, object> MediaProtectionContainerGuid = new KeyValuePair<string, object>("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");
00051         private const string MediaProtectionSystemIdMapping = "Windows.Media.Protection.MediaProtectionSystemIdMapping";
00052
00053         // NOTE: For custom scenarios, you may need these:
00054         public string playReadyLicenseUrl = "";
00055         public string playReadyChallengeCustomData = "";
00056
00057
00058         private void Log(string message)
00059         {
00060             if (logger != null)
00061             {
00062                 logger.Log(message, LogViewLoggingLevel.Information);
00063             }
00064             else
00065             {
00066                 string logEntry = $"{DateTime.Now:HH:mm:ss.fff} - {message}";
00067                 System.Diagnostics.Debug.WriteLine(logEntry);
00068             }
00069         }
00070
00071         public void SetUpProtectionManager(MediaPlayer mediaPlayer)
00072         {
00073             Log("Enter SetUpProtectionManager");
00074
00075             if(mediaPlayer == null)
00076                 throw new ArgumentException("SetUpProtectionManager was passed a null MediaPlayer");
00077
00078             Log("Creating protection system mappings...");
00079             var protectionManager = new MediaProtectionManager();
00080
00081             protectionManager.ComponentLoadFailed += new ComponentLoadFailedEventHandler(ProtectionManager_ComponentLoadFailed);
00082             protectionManager.ServiceRequested += new ServiceRequestedEventHandler(ProtectionManager_ServiceRequested);
00083
00084             // The code here is mandatory and should be just copied directly over to the app
00085             // Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa376846%28v=vs.85%29.aspx
00086
00087             // Setup PlayReady as the ProtectionSystem to use by mediaFoundation:
00088             var contentProtectionSystems = new PropertySet();
00089             contentProtectionSystems.Add(PlayReadyWinRTTrustedInput);
00090             protectionManager.Properties.Add(MediaProtectionSystemIdMapping, contentProtectionSystems);
00091             protectionManager.Properties.Add(MediaProtectionSystemId);
00092             protectionManager.Properties.Add(MediaProtectionContainerGuid);
00093
00094             mediaPlayer.ProtectionManager = protectionManager;
00095
00096             Log("Leave SetUpProtectionManager");
00097         }
00098
00099         private async void ProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e)
00100         {
00101             Log("Enter ProtectionManager_ServiceRequested");
00102
00103             if (e.Request is PlayReadyIndividualizationServiceRequest)
00104             {
00105                 var individualizationRequest = e.Request as PlayReadyIndividualizationServiceRequest;
00106                 bool bResultIndiv = await ReactiveIndividualizationRequestAsync(individualizationRequest, e.Completion);
00107             }
00108             else if (e.Request is PlayReadyLicenseAcquisitionServiceRequest)
00109             {
00110                 var licenseRequest = e.Request as PlayReadyLicenseAcquisitionServiceRequest;
00111                 LicenseAcquisitionRequest(licenseRequest, e.Completion, playReadyLicenseUrl, playReadyChallengeCustomData);
00112             }
00113
00114             Log("Leave ProtectionManager_ServiceRequested");
00115         }
00116
00117         private void ProtectionManager_ComponentLoadFailed(MediaProtectionManager sender, ComponentLoadFailedEventArgs e)
00118         {
00119             Log("Enter ProtectionManager_ComponentLoadFailed");
00120             Log(e.Information.ToString());
00121
00122             // List the failing components - RevocationAndRenewalInformation
00123             foreach (var item in e.Information.Items)
00124             {
00125                 Log(item.Name +
00126                     "\nReasons=0x" + item.Reasons +
00127                     "\nRenewal Id=" + item.RenewalId);
00128             }
00129             e.Completion.Complete(false);
00130
00131             Log("Leave ProtectionManager_ComponentLoadFailed");
00132         }
00133
00134         /// <summary>
00135         /// Invoked to acquire the PlayReady License
00136         /// </summary>
00137         async void LicenseAcquisitionRequest(PlayReadyLicenseAcquisitionServiceRequest licenseRequest, MediaProtectionServiceCompletion completionNotifier, string url, string challengeCustomData)
00138         {
00139             bool bResult = false;
00140             string ExceptionMessage = string.Empty;
00141
00142             try
00143             {
00144                 if (!string.IsNullOrEmpty(url))
00145                 {
00146                     Log("ProtectionManager PlayReady Manual License Acquisition Service Request in progress - URL: " + url);
00147
00148                     if (!string.IsNullOrEmpty(challengeCustomData))
00149                     {
00150                         var encoding = new UTF8Encoding();
00151                         byte[] b = encoding.GetBytes(challengeCustomData);
00152                         licenseRequest.ChallengeCustomData = Convert.ToBase64String(b, 0, b.Length);
00153                     }
00154
00155                     PlayReadySoapMessage soapMessage = licenseRequest.GenerateManualEnablingChallenge();
00156
00157                     byte[] messageBytes = soapMessage.GetMessageBody();
00158                     HttpContent httpContent = new ByteArrayContent(messageBytes);
00159
00160                     IPropertySet propertySetHeaders = soapMessage.MessageHeaders;
00161                     foreach (string strHeaderName in propertySetHeaders.Keys)
00162                     {
00163                         string strHeaderValue = propertySetHeaders[strHeaderName].ToString();
00164
00165                         // The Add method throws an ArgumentException try to set protected headers like "Content-Type"
00166                         // so set it via "ContentType" property
00167                         if (strHeaderName.Equals("Content-Type", StringComparison.OrdinalIgnoreCase))
00168                             httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse(strHeaderValue);
00169                         else
00170                             httpContent.Headers.Add(strHeaderName.ToString(), strHeaderValue);
00171                     }
00172                     var licenseAcquision = new CommonLicenseRequest();
00173                     HttpContent responseHttpContent = await licenseAcquision.AcquireLicenseAsync(new Uri(url), httpContent);
00174                     if (responseHttpContent != null)
00175                     {
00176                         Exception exResult = licenseRequest.ProcessManualEnablingResponse(await responseHttpContent.ReadAsByteArrayAsync());
00177                         if (exResult != null)
00178                         {
00179                             throw exResult;
00180                         }
00181                         bResult = true;
00182                     }
00183                     else
00184                         ExceptionMessage = licenseAcquision.GetLastErrorMessage();
00185                 }
00186                 else
00187                 {
00188                     Log("ProtectionManager PlayReady License Acquisition Service Request in progress - URL: " + licenseRequest.Uri.ToString());
00189                     await licenseRequest.BeginServiceRequest();
00190                     bResult = true;
00191                 }
00192             }
00193             catch (Exception e)
00194             {
00195                 ExceptionMessage = e.Message;
00196             }
00197
00198             if (bResult == true)
00199                 Log(!string.IsNullOrEmpty(url) ? "ProtectionManager Manual PlayReady License Acquisition Service Request successful" :
00200                     "ProtectionManager PlayReady License Acquisition Service Request successful");
00201             else
00202                 Log(!string.IsNullOrEmpty(url) ? "ProtectionManager Manual PlayReady License Acquisition Service Request failed: " + ExceptionMessage :
00203                     "ProtectionManager PlayReady License Acquisition Service Request failed: " + ExceptionMessage);
00204             completionNotifier.Complete(bResult);
00205         }
00206         /// <summary>
00207         /// Proactive Individualization Request
00208         /// </summary>
00209         async void ProactiveIndividualizationRequest()
00210         {
00211             var individualizationRequest = new PlayReadyIndividualizationServiceRequest();
00212             Log("ProtectionManager PlayReady ProActive Individualization Service Request in progress...");
00213             bool bResultIndiv = await ReactiveIndividualizationRequestAsync(individualizationRequest, null);
00214             if (bResultIndiv == true)
00215                 Log("ProtectionManager PlayReady ProActive Individualization Service Request successful");
00216             else
00217                 Log("ProtectionManager PlayReady ProActive Individualization Service Request failed");
00218
00219         }
00220         /// <summary>
00221         /// Invoked to send the Individualization Request
00222         /// </summary>
00223         async Task<bool> ReactiveIndividualizationRequestAsync(PlayReadyIndividualizationServiceRequest individualizationRequest, MediaProtectionServiceCompletion completionNotifier)
00224         {
00225             bool bResult = false;
00226             Log("ProtectionManager PlayReady Individualization Service Request in progress...");
00227             try
00228             {
00229                 await individualizationRequest.BeginServiceRequest();
00230                 bResult = true;
00231             }
00232             catch (COMException comException) when (comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
00233             {
00234                 individualizationRequest.NextServiceRequest();
00235             }
00236             catch (Exception)
00237             {
00238             }
00239
00240             if (bResult == true)
00241                 Log("ProtectionManager PlayReady Individualization Service Request successful");
00242             else
00243                 Log("ProtectionManager PlayReady Individualization Service Request failed");
00244             if (completionNotifier != null) completionNotifier.Complete(bResult);
00245             return bResult;
00246
00247         }
00248
00249     }
00250 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario8.xaml.cs Source File

  • AudioCategory
  • cs
  • AudioCategory

Scenario8.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using Windows.UI.Xaml.Media;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00019
00020 namespace PlaybackManager
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario8 : Page
00026     {
00027         public Scenario8()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         private void Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00033         {
00034             Playback.SetAudioCategory(AudioCategory.GameEffects);
00035             Playback.SelectFile();
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Analyze Member List

This is the complete list of members for Scenario1_Analyze, including all inherited members.
AnalyzeButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Analyze
Scenario1_Analyze() | Scenario1_Analyze
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Level5 Member List

This is the complete list of members for Level5, including all inherited members.
Initialize(std::vector< std::shared_ptr< GameObject >> const &objects) override | Level5 | [virtual]
Level3() | Level3 |
Level5() | Level5 |
LoadState(PersistentState &state) | Level | [virtual]
m_objective | Level | [protected]
m_timeLimit | Level | [protected]
Objective() | Level |
SaveState(PersistentState &state) | Level | [virtual]
TimeLimit() | Level |
Update(float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) | Level | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DDSTextureLoader.cpp Source File

  • Simple3DGameDX
  • cpp
  • Common

DDSTextureLoader.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------------------
00002 // File: DDSTextureLoader.cpp
00003 //
00004 // Functions for loading a DDS texture and creating a Direct3D 11 runtime resource for it
00005 //
00006 // Note these functions are useful as a light-weight runtime loader for DDS files. For
00007 // a full-featured DDS file reader, writer, and texture processing pipeline see
00008 // the 'Texconv' sample and the 'DirectXTex' library.
00009 //
00010 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00011 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00012 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 // PARTICULAR PURPOSE.
00014 //
00015 // Copyright (c) Microsoft Corporation. All rights reserved.
00016 //
00017 // http://go.microsoft.com/fwlink/?LinkId=248926
00018 // http://go.microsoft.com/fwlink/?LinkId=248929
00019 //--------------------------------------------------------------------------------------
00020
00021 #include "pch.h"
00022 #include <dxgiformat.h>
00023 #include <assert.h>
00024 #include <memory>
00025 #include <algorithm>
00026 #include "DDSTextureLoader.h"
00027 #include "DirectXSample.h"
00028
00029 using namespace Microsoft::WRL;
00030
00031 //--------------------------------------------------------------------------------------
00032 // Macros
00033 //--------------------------------------------------------------------------------------
00034 #ifndef MAKEFOURCC
00035     #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
00036                 ((uint32)(byte)(ch0) | ((uint32)(byte)(ch1) << 8) |       \
00037                 ((uint32)(byte)(ch2) << 16) | ((uint32)(byte)(ch3) << 24))
00038 #endif /* defined(MAKEFOURCC) */
00039
00040 //--------------------------------------------------------------------------------------
00041 // DDS file structure definitions
00042 //
00043 // See DDS.h in the 'Texconv' sample and the 'DirectXTex' library
00044 //--------------------------------------------------------------------------------------
00045 #pragma pack(push, 1)
00046
00047 #define DDS_MAGIC 0x20534444 // "DDS "
00048
00049 struct DDS_PIXELFORMAT
00050 {
00051     uint32  size;
00052     uint32  flags;
00053     uint32  fourCC;
00054     uint32  RGBBitCount;
00055     uint32  RBitMask;
00056     uint32  GBitMask;
00057     uint32  BBitMask;
00058     uint32  ABitMask;
00059 };
00060
00061 #define DDS_FOURCC      0x00000004  // DDPF_FOURCC
00062 #define DDS_RGB         0x00000040  // DDPF_RGB
00063 #define DDS_RGBA        0x00000041  // DDPF_RGB | DDPF_ALPHAPIXELS
00064 #define DDS_LUMINANCE   0x00020000  // DDPF_LUMINANCE
00065 #define DDS_LUMINANCEA  0x00020001  // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
00066 #define DDS_ALPHA       0x00000002  // DDPF_ALPHA
00067 #define DDS_PAL8        0x00000020  // DDPF_PALETTEINDEXED8
00068
00069 #define DDS_HEADER_FLAGS_TEXTURE        0x00001007  // DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT
00070 #define DDS_HEADER_FLAGS_MIPMAP         0x00020000  // DDSD_MIPMAPCOUNT
00071 #define DDS_HEADER_FLAGS_VOLUME         0x00800000  // DDSD_DEPTH
00072 #define DDS_HEADER_FLAGS_PITCH          0x00000008  // DDSD_PITCH
00073 #define DDS_HEADER_FLAGS_LINEARSIZE     0x00080000  // DDSD_LINEARSIZE
00074
00075 #define DDS_HEIGHT 0x00000002 // DDSD_HEIGHT
00076 #define DDS_WIDTH  0x00000004 // DDSD_WIDTH
00077
00078 #define DDS_SURFACE_FLAGS_TEXTURE 0x00001000 // DDSCAPS_TEXTURE
00079 #define DDS_SURFACE_FLAGS_MIPMAP  0x00400008 // DDSCAPS_COMPLEX | DDSCAPS_MIPMAP
00080 #define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008 // DDSCAPS_COMPLEX
00081
00082 #define DDS_CUBEMAP_POSITIVEX 0x00000600 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX
00083 #define DDS_CUBEMAP_NEGATIVEX 0x00000a00 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX
00084 #define DDS_CUBEMAP_POSITIVEY 0x00001200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY
00085 #define DDS_CUBEMAP_NEGATIVEY 0x00002200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY
00086 #define DDS_CUBEMAP_POSITIVEZ 0x00004200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ
00087 #define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
00088
00089 #define DDS_CUBEMAP_ALLFACES (DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
00090                               DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
00091                               DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ)
00092
00093 #define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
00094
00095 #define DDS_FLAGS_VOLUME 0x00200000 // DDSCAPS2_VOLUME
00096
00097 enum DDS_MISC_FLAGS2
00098 {
00099     DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
00100 };
00101
00102 enum DDS_ALPHA_MODE
00103 {
00104     DDS_ALPHA_MODE_UNKNOWN       = 0,
00105     DDS_ALPHA_MODE_STRAIGHT      = 1,
00106     DDS_ALPHA_MODE_PREMULTIPLIED = 2,
00107     DDS_ALPHA_MODE_OPAQUE        = 3,
00108     DDS_ALPHA_MODE_CUSTOM        = 4,
00109 };
00110
00111 typedef struct
00112 {
00113     uint32          size;
00114     uint32          flags;
00115     uint32          height;
00116     uint32          width;
00117     uint32          pitchOrLinearSize;
00118     uint32          depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
00119     uint32          mipMapCount;
00120     uint32          reserved1[11];
00121     DDS_PIXELFORMAT ddspf;
00122     uint32          caps;
00123     uint32          caps2;
00124     uint32          caps3;
00125     uint32          caps4;
00126     uint32          reserved2;
00127 } DDS_HEADER;
00128
00129 typedef struct
00130 {
00131     DXGI_FORMAT dxgiFormat;
00132     uint32      resourceDimension;
00133     uint32      miscFlag; // see D3D11_RESOURCE_MISC_FLAG
00134     uint32      arraySize;
00135     uint32      miscFlags2;
00136 } DDS_HEADER_DXT10;
00137
00138 #pragma pack(pop)
00139
00140 //--------------------------------------------------------------------------------------
00141 // Return the BPP for a particular format
00142 //--------------------------------------------------------------------------------------
00143 static size_t BitsPerPixel(_In_ DXGI_FORMAT fmt)
00144 {
00145     switch (fmt)
00146     {
00147     case DXGI_FORMAT_R32G32B32A32_TYPELESS:
00148     case DXGI_FORMAT_R32G32B32A32_FLOAT:
00149     case DXGI_FORMAT_R32G32B32A32_UINT:
00150     case DXGI_FORMAT_R32G32B32A32_SINT:
00151         return 128;
00152
00153     case DXGI_FORMAT_R32G32B32_TYPELESS:
00154     case DXGI_FORMAT_R32G32B32_FLOAT:
00155     case DXGI_FORMAT_R32G32B32_UINT:
00156     case DXGI_FORMAT_R32G32B32_SINT:
00157         return 96;
00158
00159     case DXGI_FORMAT_R16G16B16A16_TYPELESS:
00160     case DXGI_FORMAT_R16G16B16A16_FLOAT:
00161     case DXGI_FORMAT_R16G16B16A16_UNORM:
00162     case DXGI_FORMAT_R16G16B16A16_UINT:
00163     case DXGI_FORMAT_R16G16B16A16_SNORM:
00164     case DXGI_FORMAT_R16G16B16A16_SINT:
00165     case DXGI_FORMAT_R32G32_TYPELESS:
00166     case DXGI_FORMAT_R32G32_FLOAT:
00167     case DXGI_FORMAT_R32G32_UINT:
00168     case DXGI_FORMAT_R32G32_SINT:
00169     case DXGI_FORMAT_R32G8X24_TYPELESS:
00170     case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
00171     case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
00172     case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
00173         return 64;
00174
00175     case DXGI_FORMAT_R10G10B10A2_TYPELESS:
00176     case DXGI_FORMAT_R10G10B10A2_UNORM:
00177     case DXGI_FORMAT_R10G10B10A2_UINT:
00178     case DXGI_FORMAT_R11G11B10_FLOAT:
00179     case DXGI_FORMAT_R8G8B8A8_TYPELESS:
00180     case DXGI_FORMAT_R8G8B8A8_UNORM:
00181     case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
00182     case DXGI_FORMAT_R8G8B8A8_UINT:
00183     case DXGI_FORMAT_R8G8B8A8_SNORM:
00184     case DXGI_FORMAT_R8G8B8A8_SINT:
00185     case DXGI_FORMAT_R16G16_TYPELESS:
00186     case DXGI_FORMAT_R16G16_FLOAT:
00187     case DXGI_FORMAT_R16G16_UNORM:
00188     case DXGI_FORMAT_R16G16_UINT:
00189     case DXGI_FORMAT_R16G16_SNORM:
00190     case DXGI_FORMAT_R16G16_SINT:
00191     case DXGI_FORMAT_R32_TYPELESS:
00192     case DXGI_FORMAT_D32_FLOAT:
00193     case DXGI_FORMAT_R32_FLOAT:
00194     case DXGI_FORMAT_R32_UINT:
00195     case DXGI_FORMAT_R32_SINT:
00196     case DXGI_FORMAT_R24G8_TYPELESS:
00197     case DXGI_FORMAT_D24_UNORM_S8_UINT:
00198     case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
00199     case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
00200     case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
00201     case DXGI_FORMAT_R8G8_B8G8_UNORM:
00202     case DXGI_FORMAT_G8R8_G8B8_UNORM:
00203     case DXGI_FORMAT_B8G8R8A8_UNORM:
00204     case DXGI_FORMAT_B8G8R8X8_UNORM:
00205     case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
00206     case DXGI_FORMAT_B8G8R8A8_TYPELESS:
00207     case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
00208     case DXGI_FORMAT_B8G8R8X8_TYPELESS:
00209     case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
00210         return 32;
00211
00212     case DXGI_FORMAT_R8G8_TYPELESS:
00213     case DXGI_FORMAT_R8G8_UNORM:
00214     case DXGI_FORMAT_R8G8_UINT:
00215     case DXGI_FORMAT_R8G8_SNORM:
00216     case DXGI_FORMAT_R8G8_SINT:
00217     case DXGI_FORMAT_R16_TYPELESS:
00218     case DXGI_FORMAT_R16_FLOAT:
00219     case DXGI_FORMAT_D16_UNORM:
00220     case DXGI_FORMAT_R16_UNORM:
00221     case DXGI_FORMAT_R16_UINT:
00222     case DXGI_FORMAT_R16_SNORM:
00223     case DXGI_FORMAT_R16_SINT:
00224     case DXGI_FORMAT_B5G6R5_UNORM:
00225     case DXGI_FORMAT_B5G5R5A1_UNORM:
00226     case DXGI_FORMAT_B4G4R4A4_UNORM:
00227         return 16;
00228
00229     case DXGI_FORMAT_R8_TYPELESS:
00230     case DXGI_FORMAT_R8_UNORM:
00231     case DXGI_FORMAT_R8_UINT:
00232     case DXGI_FORMAT_R8_SNORM:
00233     case DXGI_FORMAT_R8_SINT:
00234     case DXGI_FORMAT_A8_UNORM:
00235         return 8;
00236
00237     case DXGI_FORMAT_R1_UNORM:
00238         return 1;
00239
00240     case DXGI_FORMAT_BC1_TYPELESS:
00241     case DXGI_FORMAT_BC1_UNORM:
00242     case DXGI_FORMAT_BC1_UNORM_SRGB:
00243     case DXGI_FORMAT_BC4_TYPELESS:
00244     case DXGI_FORMAT_BC4_UNORM:
00245     case DXGI_FORMAT_BC4_SNORM:
00246         return 4;
00247
00248     case DXGI_FORMAT_BC2_TYPELESS:
00249     case DXGI_FORMAT_BC2_UNORM:
00250     case DXGI_FORMAT_BC2_UNORM_SRGB:
00251     case DXGI_FORMAT_BC3_TYPELESS:
00252     case DXGI_FORMAT_BC3_UNORM:
00253     case DXGI_FORMAT_BC3_UNORM_SRGB:
00254     case DXGI_FORMAT_BC5_TYPELESS:
00255     case DXGI_FORMAT_BC5_UNORM:
00256     case DXGI_FORMAT_BC5_SNORM:
00257     case DXGI_FORMAT_BC6H_TYPELESS:
00258     case DXGI_FORMAT_BC6H_UF16:
00259     case DXGI_FORMAT_BC6H_SF16:
00260     case DXGI_FORMAT_BC7_TYPELESS:
00261     case DXGI_FORMAT_BC7_UNORM:
00262     case DXGI_FORMAT_BC7_UNORM_SRGB:
00263         return 8;
00264
00265     default:
00266         return 0;
00267     }
00268 }
00269
00270
00271 //--------------------------------------------------------------------------------------
00272 // Get surface information for a particular format
00273 //--------------------------------------------------------------------------------------
00274 static void GetSurfaceInfo(
00275     _In_ size_t width,
00276     _In_ size_t height,
00277     _In_ DXGI_FORMAT fmt,
00278     _Out_opt_ size_t* outNumBytes,
00279     _Out_opt_ size_t* outRowBytes,
00280     _Out_opt_ size_t* outNumRows
00281     )
00282 {
00283     size_t numBytes = 0;
00284     size_t rowBytes = 0;
00285     size_t numRows = 0;
00286
00287     bool bc = false;
00288     bool packed  = false;
00289     size_t bcnumBytesPerBlock = 0;
00290     switch (fmt)
00291     {
00292     case DXGI_FORMAT_BC1_TYPELESS:
00293     case DXGI_FORMAT_BC1_UNORM:
00294     case DXGI_FORMAT_BC1_UNORM_SRGB:
00295     case DXGI_FORMAT_BC4_TYPELESS:
00296     case DXGI_FORMAT_BC4_UNORM:
00297     case DXGI_FORMAT_BC4_SNORM:
00298         bc = true;
00299         bcnumBytesPerBlock = 8;
00300         break;
00301
00302     case DXGI_FORMAT_BC2_TYPELESS:
00303     case DXGI_FORMAT_BC2_UNORM:
00304     case DXGI_FORMAT_BC2_UNORM_SRGB:
00305     case DXGI_FORMAT_BC3_TYPELESS:
00306     case DXGI_FORMAT_BC3_UNORM:
00307     case DXGI_FORMAT_BC3_UNORM_SRGB:
00308     case DXGI_FORMAT_BC5_TYPELESS:
00309     case DXGI_FORMAT_BC5_UNORM:
00310     case DXGI_FORMAT_BC5_SNORM:
00311     case DXGI_FORMAT_BC6H_TYPELESS:
00312     case DXGI_FORMAT_BC6H_UF16:
00313     case DXGI_FORMAT_BC6H_SF16:
00314     case DXGI_FORMAT_BC7_TYPELESS:
00315     case DXGI_FORMAT_BC7_UNORM:
00316     case DXGI_FORMAT_BC7_UNORM_SRGB:
00317         bc = true;
00318         bcnumBytesPerBlock = 16;
00319         break;
00320
00321     case DXGI_FORMAT_R8G8_B8G8_UNORM:
00322     case DXGI_FORMAT_G8R8_G8B8_UNORM:
00323         packed = true;
00324         break;
00325     }
00326
00327     if (bc)
00328     {
00329         size_t numBlocksWide = 0;
00330         if (width > 0)
00331         {
00332             numBlocksWide = std::max<size_t>(1, (width + 3) / 4);
00333         }
00334         size_t numBlocksHigh = 0;
00335         if (height > 0)
00336         {
00337             numBlocksHigh = std::max<size_t>(1, (height + 3) / 4);
00338         }
00339         rowBytes = numBlocksWide * bcnumBytesPerBlock;
00340         numRows = numBlocksHigh;
00341     }
00342     else if (packed)
00343     {
00344         rowBytes = ((width + 1) >> 1) * 4;
00345         numRows = height;
00346     }
00347     else
00348     {
00349         size_t bpp = BitsPerPixel(fmt);
00350         rowBytes = (width * bpp + 7) / 8; // round up to nearest byte
00351         numRows = height;
00352     }
00353
00354     numBytes = rowBytes * numRows;
00355     if (outNumBytes)
00356     {
00357         *outNumBytes = numBytes;
00358     }
00359     if (outRowBytes)
00360     {
00361         *outRowBytes = rowBytes;
00362     }
00363     if (outNumRows)
00364     {
00365         *outNumRows = numRows;
00366     }
00367 }
00368
00369
00370 //--------------------------------------------------------------------------------------
00371 #define ISBITMASK(r, g, b, a) (ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a)
00372
00373 static DXGI_FORMAT GetDXGIFormat(const DDS_PIXELFORMAT& ddpf)
00374 {
00375     if (ddpf.flags & DDS_RGB)
00376     {
00377         // Note that sRGB formats are written using the "DX10" extended header
00378
00379         switch (ddpf.RGBBitCount)
00380         {
00381         case 32:
00382             if (ISBITMASK(0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000))
00383             {
00384                 return DXGI_FORMAT_R8G8B8A8_UNORM;
00385             }
00386
00387             if (ISBITMASK(0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000))
00388             {
00389                 return DXGI_FORMAT_B8G8R8A8_UNORM;
00390             }
00391
00392             if (ISBITMASK(0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000))
00393             {
00394                 return DXGI_FORMAT_B8G8R8X8_UNORM;
00395             }
00396
00397             // No DXGI format maps to ISBITMASK(0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000) aka D3DFMT_X8B8G8R8
00398
00399             // Note that many common DDS reader/writers (including D3DX) swap the
00400             // the RED/BLUE masks for 10:10:10:2 formats. We assumme
00401             // below that the 'backwards' header mask is being used since it is most
00402             // likely written by D3DX. The more robust solution is to use the 'DX10'
00403             // header extension and specify the DXGI_FORMAT_R10G10B10A2_UNORM format directly
00404
00405             // For 'correct' writers, this should be 0x000003ff, 0x000ffc00, 0x3ff00000 for RGB data
00406             if (ISBITMASK(0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000))
00407             {
00408                 return DXGI_FORMAT_R10G10B10A2_UNORM;
00409             }
00410
00411             // No DXGI format maps to ISBITMASK(0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000) aka D3DFMT_A2R10G10B10
00412
00413             if (ISBITMASK(0x0000ffff, 0xffff0000, 0x00000000, 0x00000000))
00414             {
00415                 return DXGI_FORMAT_R16G16_UNORM;
00416             }
00417
00418             if (ISBITMASK(0xffffffff, 0x00000000, 0x00000000, 0x00000000))
00419             {
00420                 // Only 32-bit color channel format in D3D9 was R32F
00421                 return DXGI_FORMAT_R32_FLOAT; // D3DX writes this out as a FourCC of 114
00422             }
00423             break;
00424
00425         case 24:
00426             // No 24bpp DXGI formats aka D3DFMT_R8G8B8
00427             break;
00428
00429         case 16:
00430             if (ISBITMASK(0x7c00, 0x03e0, 0x001f, 0x8000))
00431             {
00432                 return DXGI_FORMAT_B5G5R5A1_UNORM;
00433             }
00434             if (ISBITMASK(0xf800, 0x07e0, 0x001f, 0x0000))
00435             {
00436                 return DXGI_FORMAT_B5G6R5_UNORM;
00437             }
00438
00439             // No DXGI format maps to ISBITMASK(0x7c00, 0x03e0, 0x001f, 0x0000) aka D3DFMT_X1R5G5B5
00440             if (ISBITMASK(0x0f00, 0x00f0, 0x000f, 0xf000))
00441             {
00442                 return DXGI_FORMAT_B4G4R4A4_UNORM;
00443             }
00444
00445             // No DXGI format maps to ISBITMASK(0x0f00, 0x00f0, 0x000f, 0x0000) aka D3DFMT_X4R4G4B4
00446
00447             // No 3:3:2, 3:3:2:8, or paletted DXGI formats aka D3DFMT_A8R3G3B2, D3DFMT_R3G3B2, D3DFMT_P8, D3DFMT_A8P8, etc.
00448             break;
00449         }
00450     }
00451     else if (ddpf.flags & DDS_LUMINANCE)
00452     {
00453         if (8 == ddpf.RGBBitCount)
00454         {
00455             if (ISBITMASK(0x000000ff, 0x00000000, 0x00000000, 0x00000000))
00456             {
00457                 return DXGI_FORMAT_R8_UNORM; // D3DX10/11 writes this out as DX10 extension
00458             }
00459
00460             // No DXGI format maps to ISBITMASK(0x0f, 0x00, 0x00, 0xf0) aka D3DFMT_A4L4
00461         }
00462
00463         if (16 == ddpf.RGBBitCount)
00464         {
00465             if (ISBITMASK(0x0000ffff, 0x00000000, 0x00000000, 0x00000000))
00466             {
00467                 return DXGI_FORMAT_R16_UNORM; // D3DX10/11 writes this out as DX10 extension
00468             }
00469             if (ISBITMASK(0x000000ff, 0x00000000, 0x00000000, 0x0000ff00))
00470             {
00471                 return DXGI_FORMAT_R8G8_UNORM; // D3DX10/11 writes this out as DX10 extension
00472             }
00473         }
00474     }
00475     else if (ddpf.flags & DDS_ALPHA)
00476     {
00477         if (8 == ddpf.RGBBitCount)
00478         {
00479             return DXGI_FORMAT_A8_UNORM;
00480         }
00481     }
00482     else if (ddpf.flags & DDS_FOURCC)
00483     {
00484         if (MAKEFOURCC('D', 'X', 'T', '1') == ddpf.fourCC)
00485         {
00486             return DXGI_FORMAT_BC1_UNORM;
00487         }
00488         if (MAKEFOURCC('D', 'X', 'T', '3') == ddpf.fourCC)
00489         {
00490             return DXGI_FORMAT_BC2_UNORM;
00491         }
00492         if (MAKEFOURCC('D', 'X', 'T', '5') == ddpf.fourCC)
00493         {
00494             return DXGI_FORMAT_BC3_UNORM;
00495         }
00496
00497         // While pre-mulitplied alpha isn't directly supported by the DXGI formats,
00498         // they are basically the same as these BC formats so they can be mapped
00499         if (MAKEFOURCC('D', 'X', 'T', '2') == ddpf.fourCC)
00500         {
00501             return DXGI_FORMAT_BC2_UNORM;
00502         }
00503         if (MAKEFOURCC('D', 'X', 'T', '4') == ddpf.fourCC)
00504         {
00505             return DXGI_FORMAT_BC3_UNORM;
00506         }
00507
00508         if (MAKEFOURCC('A', 'T', 'I', '1') == ddpf.fourCC)
00509         {
00510             return DXGI_FORMAT_BC4_UNORM;
00511         }
00512         if (MAKEFOURCC('B', 'C', '4', 'U') == ddpf.fourCC)
00513         {
00514             return DXGI_FORMAT_BC4_UNORM;
00515         }
00516         if (MAKEFOURCC('B', 'C', '4', 'S') == ddpf.fourCC)
00517         {
00518             return DXGI_FORMAT_BC4_SNORM;
00519         }
00520
00521         if (MAKEFOURCC('A', 'T', 'I', '2') == ddpf.fourCC)
00522         {
00523             return DXGI_FORMAT_BC5_UNORM;
00524         }
00525         if (MAKEFOURCC('B', 'C', '5', 'U') == ddpf.fourCC)
00526         {
00527             return DXGI_FORMAT_BC5_UNORM;
00528         }
00529         if (MAKEFOURCC('B', 'C', '5', 'S') == ddpf.fourCC)
00530         {
00531             return DXGI_FORMAT_BC5_SNORM;
00532         }
00533
00534         // BC6H and BC7 are written using the "DX10" extended header
00535
00536         if (MAKEFOURCC('R', 'G', 'B', 'G') == ddpf.fourCC)
00537         {
00538             return DXGI_FORMAT_R8G8_B8G8_UNORM;
00539         }
00540         if (MAKEFOURCC('G', 'R', 'G', 'B') == ddpf.fourCC)
00541         {
00542             return DXGI_FORMAT_G8R8_G8B8_UNORM;
00543         }
00544
00545         // Check for D3DFORMAT enums being set here
00546         switch (ddpf.fourCC)
00547         {
00548         case 36: // D3DFMT_A16B16G16R16
00549             return DXGI_FORMAT_R16G16B16A16_UNORM;
00550
00551         case 110: // D3DFMT_Q16W16V16U16
00552             return DXGI_FORMAT_R16G16B16A16_SNORM;
00553
00554         case 111: // D3DFMT_R16F
00555             return DXGI_FORMAT_R16_FLOAT;
00556
00557         case 112: // D3DFMT_G16R16F
00558             return DXGI_FORMAT_R16G16_FLOAT;
00559
00560         case 113: // D3DFMT_A16B16G16R16F
00561             return DXGI_FORMAT_R16G16B16A16_FLOAT;
00562
00563         case 114: // D3DFMT_R32F
00564             return DXGI_FORMAT_R32_FLOAT;
00565
00566         case 115: // D3DFMT_G32R32F
00567             return DXGI_FORMAT_R32G32_FLOAT;
00568
00569         case 116: // D3DFMT_A32B32G32R32F
00570             return DXGI_FORMAT_R32G32B32A32_FLOAT;
00571         }
00572     }
00573
00574     return DXGI_FORMAT_UNKNOWN;
00575 }
00576
00577
00578 //--------------------------------------------------------------------------------------
00579 static DXGI_FORMAT MakeSRGB(_In_ DXGI_FORMAT format)
00580 {
00581     switch (format)
00582     {
00583     case DXGI_FORMAT_R8G8B8A8_UNORM:
00584         return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
00585
00586     case DXGI_FORMAT_BC1_UNORM:
00587         return DXGI_FORMAT_BC1_UNORM_SRGB;
00588
00589     case DXGI_FORMAT_BC2_UNORM:
00590         return DXGI_FORMAT_BC2_UNORM_SRGB;
00591
00592     case DXGI_FORMAT_BC3_UNORM:
00593         return DXGI_FORMAT_BC3_UNORM_SRGB;
00594
00595     case DXGI_FORMAT_B8G8R8A8_UNORM:
00596         return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
00597
00598     case DXGI_FORMAT_B8G8R8X8_UNORM:
00599         return DXGI_FORMAT_B8G8R8X8_UNORM_SRGB;
00600
00601     case DXGI_FORMAT_BC7_UNORM:
00602         return DXGI_FORMAT_BC7_UNORM_SRGB;
00603
00604     default:
00605         return format;
00606     }
00607 }
00608
00609
00610 //--------------------------------------------------------------------------------------
00611 static void FillInitData(
00612     _In_ size_t width,
00613     _In_ size_t height,
00614     _In_ size_t depth,
00615     _In_ size_t mipCount,
00616     _In_ size_t arraySize,
00617     _In_ DXGI_FORMAT format,
00618     _In_ size_t maxsize,
00619     _In_ size_t bitSize,
00620     _In_reads_bytes_(bitSize) const byte* bitData,
00621     _Out_ size_t& twidth,
00622     _Out_ size_t& theight,
00623     _Out_ size_t& tdepth,
00624     _Out_ size_t& skipMip,
00625     _Out_writes_(mipCount*arraySize) D3D11_SUBRESOURCE_DATA* initData
00626     )
00627 {
00628     if (!bitData || !initData)
00629     {
00630         throw ref new Platform::InvalidArgumentException();
00631     }
00632
00633     skipMip = 0;
00634     twidth = 0;
00635     theight = 0;
00636     tdepth = 0;
00637
00638     size_t NumBytes = 0;
00639     size_t RowBytes = 0;
00640     size_t NumRows = 0;
00641     const byte* pSrcBits = bitData;
00642     const byte* pEndBits = bitData + bitSize;
00643
00644     size_t index = 0;
00645     for (size_t j = 0; j < arraySize; j++)
00646     {
00647         size_t w = width;
00648         size_t h = height;
00649         size_t d = depth;
00650         for (size_t i = 0; i < mipCount; i++)
00651         {
00652             GetSurfaceInfo(w, h, format, &NumBytes, &RowBytes, &NumRows);
00653
00654             if ((mipCount <= 1) || !maxsize || (w <= maxsize && h <= maxsize && d <= maxsize))
00655             {
00656                 if (!twidth)
00657                 {
00658                     twidth = w;
00659                     theight = h;
00660                     tdepth = d;
00661                 }
00662
00663                 assert(index < mipCount * arraySize);
00664                 _Analysis_assume_(index < mipCount * arraySize);
00665                 initData[index].pSysMem = (const void*)pSrcBits;
00666                 initData[index].SysMemPitch = static_cast<UINT>(RowBytes);
00667                 initData[index].SysMemSlicePitch = static_cast<UINT>(NumBytes);
00668                 ++index;
00669             }
00670             else if (!j)
00671             {
00672                 // Count number of skipped mipmaps (first item only)
00673                 ++skipMip;
00674             }
00675
00676             if (pSrcBits + (NumBytes*d) > pEndBits)
00677             {
00678                 throw ref new Platform::OutOfBoundsException();
00679             }
00680
00681             pSrcBits += NumBytes * d;
00682
00683             w = w >> 1;
00684             h = h >> 1;
00685             d = d >> 1;
00686             if (w == 0)
00687             {
00688                 w = 1;
00689             }
00690             if (h == 0)
00691             {
00692                 h = 1;
00693             }
00694             if (d == 0)
00695             {
00696                 d = 1;
00697             }
00698         }
00699     }
00700
00701     if (!index)
00702     {
00703         throw ref new Platform::FailureException();
00704     }
00705 }
00706
00707
00708 //--------------------------------------------------------------------------------------
00709 static HRESULT CreateD3DResources(
00710     _In_ ID3D11Device* d3dDevice,
00711     _In_ uint32 resDim,
00712     _In_ size_t width,
00713     _In_ size_t height,
00714     _In_ size_t depth,
00715     _In_ size_t mipCount,
00716     _In_ size_t arraySize,
00717     _In_ DXGI_FORMAT format,
00718     _In_ D3D11_USAGE usage,
00719     _In_ unsigned int bindFlags,
00720     _In_ unsigned int cpuAccessFlags,
00721     _In_ unsigned int miscFlags,
00722     _In_ bool forceSRGB,
00723     _In_ bool isCubeMap,
00724     _In_reads_(mipCount*arraySize) D3D11_SUBRESOURCE_DATA* initData,
00725     _Outptr_opt_ ID3D11Resource** texture,
00726     _Outptr_opt_ ID3D11ShaderResourceView** textureView
00727     )
00728 {
00729     if (!d3dDevice || !initData)
00730     {
00731         return E_INVALIDARG;
00732     }
00733
00734     HRESULT hr = E_FAIL;
00735
00736     if (forceSRGB)
00737     {
00738         format = MakeSRGB(format);
00739     }
00740
00741     switch (resDim)
00742     {
00743         case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
00744             {
00745                 D3D11_TEXTURE1D_DESC desc;
00746                 desc.Width = static_cast<UINT>(width);
00747                 desc.MipLevels = static_cast<UINT>(mipCount);
00748                 desc.ArraySize = static_cast<UINT>(arraySize);
00749                 desc.Format = format;
00750                 desc.Usage = usage;
00751                 desc.BindFlags = bindFlags;
00752                 desc.CPUAccessFlags = cpuAccessFlags;
00753                 desc.MiscFlags = miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
00754
00755                 ID3D11Texture1D* tex = nullptr;
00756                 hr = d3dDevice->CreateTexture1D(&desc, initData, &tex);
00757
00758                 if (SUCCEEDED(hr) && tex != 0)
00759                 {
00760                     if (textureView != 0)
00761                     {
00762                         D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
00763                         memset(&SRVDesc, 0, sizeof(SRVDesc));
00764                         SRVDesc.Format = format;
00765
00766                         if (arraySize > 1)
00767                         {
00768                             SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1DARRAY;
00769                             SRVDesc.Texture1DArray.MipLevels = desc.MipLevels;
00770                             SRVDesc.Texture1DArray.ArraySize = static_cast<UINT>(arraySize);
00771                         }
00772                         else
00773                         {
00774                             SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1D;
00775                             SRVDesc.Texture1D.MipLevels = desc.MipLevels;
00776                         }
00777
00778                         hr = d3dDevice->CreateShaderResourceView(tex, &SRVDesc, textureView);
00779
00780                         if (FAILED(hr))
00781                         {
00782                             tex->Release();
00783                             return hr;
00784                         }
00785                     }
00786
00787                     if (texture != 0)
00788                     {
00789                         *texture = tex;
00790                     }
00791                     else
00792                     {
00793                         tex->Release();
00794                     }
00795                 }
00796             }
00797             break;
00798
00799         case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
00800             {
00801                 D3D11_TEXTURE2D_DESC desc;
00802                 desc.Width = static_cast<UINT>(width);
00803                 desc.Height = static_cast<UINT>(height);
00804                 desc.MipLevels = static_cast<UINT>(mipCount);
00805                 desc.ArraySize = static_cast<UINT>(arraySize);
00806                 desc.Format = format;
00807                 desc.SampleDesc.Count = 1;
00808                 desc.SampleDesc.Quality = 0;
00809                 desc.Usage = usage;
00810                 desc.BindFlags = bindFlags;
00811                 desc.CPUAccessFlags = cpuAccessFlags;
00812                 if (isCubeMap)
00813                 {
00814                     desc.MiscFlags = miscFlags | D3D11_RESOURCE_MISC_TEXTURECUBE;
00815                 }
00816                 else
00817                 {
00818                     desc.MiscFlags = miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
00819                 }
00820
00821                 ID3D11Texture2D* tex = nullptr;
00822                 hr = d3dDevice->CreateTexture2D(&desc, initData, &tex);
00823
00824                 if (SUCCEEDED(hr) && tex != 0)
00825                 {
00826                     if (textureView != 0)
00827                     {
00828                         D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
00829                         memset(&SRVDesc, 0, sizeof(SRVDesc));
00830                         SRVDesc.Format = format;
00831
00832                         if (isCubeMap)
00833                         {
00834                             if (arraySize > 6)
00835                             {
00836                                 SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBEARRAY;
00837                                 SRVDesc.TextureCubeArray.MipLevels = desc.MipLevels;
00838
00839                                 // Earlier we set arraySize to (NumCubes * 6)
00840                                 SRVDesc.TextureCubeArray.NumCubes = static_cast<UINT>(arraySize / 6);
00841                             }
00842                             else
00843                             {
00844                                 SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBE;
00845                                 SRVDesc.TextureCube.MipLevels = desc.MipLevels;
00846                             }
00847                         }
00848                         else if (arraySize > 1)
00849                         {
00850                             SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2DARRAY;
00851                             SRVDesc.Texture2DArray.MipLevels = desc.MipLevels;
00852                             SRVDesc.Texture2DArray.ArraySize = static_cast<UINT>(arraySize);
00853                         }
00854                         else
00855                         {
00856                             SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
00857                             SRVDesc.Texture2D.MipLevels = desc.MipLevels;
00858                         }
00859
00860                         hr = d3dDevice->CreateShaderResourceView(tex, &SRVDesc, textureView);
00861
00862                         if (FAILED(hr))
00863                         {
00864                             tex->Release();
00865                             return hr;
00866                         }
00867                     }
00868
00869                     if (texture != 0)
00870                     {
00871                         *texture = tex;
00872                     }
00873                     else
00874                     {
00875                         tex->Release();
00876                     }
00877                 }
00878             }
00879             break;
00880
00881         case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
00882             {
00883                 D3D11_TEXTURE3D_DESC desc;
00884                 desc.Width = static_cast<UINT>(width);
00885                 desc.Height = static_cast<UINT>(height);
00886                 desc.Depth = static_cast<UINT>(depth);
00887                 desc.MipLevels = static_cast<UINT>(mipCount);
00888                 desc.Format = format;
00889                 desc.Usage = usage;
00890                 desc.BindFlags = bindFlags;
00891                 desc.CPUAccessFlags = cpuAccessFlags;
00892                 desc.MiscFlags = miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
00893
00894                 ID3D11Texture3D* tex = nullptr;
00895                 hr = d3dDevice->CreateTexture3D(&desc, initData, &tex);
00896
00897                 if (SUCCEEDED(hr) && tex != 0)
00898                 {
00899                     if (textureView != 0)
00900                     {
00901                         D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
00902                         memset(&SRVDesc, 0, sizeof(SRVDesc));
00903                         SRVDesc.Format = format;
00904                         SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE3D;
00905                         SRVDesc.Texture3D.MipLevels = desc.MipLevels;
00906
00907                         hr = d3dDevice->CreateShaderResourceView(tex, &SRVDesc, textureView);
00908
00909                         if (FAILED(hr))
00910                         {
00911                             tex->Release();
00912                             return hr;
00913                         }
00914                     }
00915
00916                     if (texture != 0)
00917                     {
00918                         *texture = tex;
00919                     }
00920                     else
00921                     {
00922                         tex->Release();
00923                     }
00924                 }
00925             }
00926             break;
00927     }
00928
00929     return hr;
00930 }
00931
00932
00933 //--------------------------------------------------------------------------------------
00934 static void CreateTextureFromDDS(
00935     _In_ ID3D11Device* d3dDevice,
00936     _In_ const DDS_HEADER* header,
00937     _In_reads_bytes_(bitSize) const byte* bitData,
00938     _In_ size_t bitSize,
00939     _In_ size_t maxsize,
00940     _In_ D3D11_USAGE usage,
00941     _In_ unsigned int bindFlags,
00942     _In_ unsigned int cpuAccessFlags,
00943     _In_ unsigned int miscFlags,
00944     _In_ bool forceSRGB,
00945     _Outptr_opt_ ID3D11Resource** texture,
00946     _Outptr_opt_ ID3D11ShaderResourceView** textureView
00947     )
00948 {
00949     HRESULT hr = S_OK;
00950
00951     size_t width = header->width;
00952     size_t height = header->height;
00953     size_t depth = header->depth;
00954
00955     uint32 resDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
00956     size_t arraySize = 1;
00957     DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN;
00958     bool isCubeMap = false;
00959
00960     size_t mipCount = header->mipMapCount;
00961     if (0 == mipCount)
00962     {
00963         mipCount = 1;
00964     }
00965
00966     if ((header->ddspf.flags & DDS_FOURCC) &&
00967         (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC))
00968     {
00969         auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>((const char*)header + sizeof(DDS_HEADER));
00970
00971         arraySize = d3d10ext->arraySize;
00972         if (arraySize == 0)
00973         {
00974             throw ref new Platform::FailureException();
00975         }
00976
00977         if (BitsPerPixel(d3d10ext->dxgiFormat) == 0)
00978         {
00979             throw ref new Platform::FailureException();
00980         }
00981
00982         format = d3d10ext->dxgiFormat;
00983
00984         switch (d3d10ext->resourceDimension)
00985         {
00986         case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
00987             // D3DX writes 1D textures with a fixed Height of 1
00988             if ((header->flags & DDS_HEIGHT) && height != 1)
00989             {
00990                 throw ref new Platform::FailureException();
00991             }
00992             height = depth = 1;
00993             break;
00994
00995         case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
00996             if (d3d10ext->miscFlag & D3D11_RESOURCE_MISC_TEXTURECUBE)
00997             {
00998                 arraySize *= 6;
00999                 isCubeMap = true;
01000             }
01001             depth = 1;
01002             break;
01003
01004         case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
01005             if (!(header->flags & DDS_HEADER_FLAGS_VOLUME))
01006             {
01007                 throw ref new Platform::FailureException();
01008             }
01009
01010             if (arraySize > 1)
01011             {
01012                 throw ref new Platform::FailureException();
01013             }
01014             break;
01015
01016         default:
01017             return throw ref new Platform::FailureException();
01018         }
01019
01020         resDim = d3d10ext->resourceDimension;
01021     }
01022     else
01023     {
01024         format = GetDXGIFormat(header->ddspf);
01025
01026         if (format == DXGI_FORMAT_UNKNOWN)
01027         {
01028             return throw ref new Platform::FailureException();
01029         }
01030
01031         if (header->flags & DDS_HEADER_FLAGS_VOLUME)
01032         {
01033             resDim = D3D11_RESOURCE_DIMENSION_TEXTURE3D;
01034         }
01035         else
01036         {
01037             if (header->caps2 & DDS_CUBEMAP)
01038             {
01039                 // We require all six faces to be defined
01040                 if ((header->caps2 & DDS_CUBEMAP_ALLFACES) != DDS_CUBEMAP_ALLFACES)
01041                 {
01042                     return throw ref new Platform::FailureException();
01043                 }
01044
01045                 arraySize = 6;
01046                 isCubeMap = true;
01047             }
01048
01049             depth = 1;
01050             resDim = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
01051
01052             // Note there's no way for a legacy Direct3D 9 DDS to express a '1D' texture
01053         }
01054
01055         assert(BitsPerPixel(format) != 0);
01056     }
01057
01058     // Bound sizes (for security purposes we don't trust DDS file metadata larger than the D3D 11.x hardware requirements)
01059     if (mipCount > D3D11_REQ_MIP_LEVELS)
01060     {
01061         return throw ref new Platform::FailureException();
01062     }
01063
01064     switch (resDim)
01065     {
01066         case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
01067             if ((arraySize > D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION) ||
01068                 (width > D3D11_REQ_TEXTURE1D_U_DIMENSION))
01069             {
01070                 return throw ref new Platform::FailureException();
01071             }
01072             break;
01073
01074         case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
01075             if (isCubeMap)
01076             {
01077                 // This is the right bound because we set arraySize to (NumCubes*6) above
01078                 if ((arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION) ||
01079                     (width > D3D11_REQ_TEXTURECUBE_DIMENSION) ||
01080                     (height > D3D11_REQ_TEXTURECUBE_DIMENSION))
01081                 {
01082                     return throw ref new Platform::FailureException();
01083                 }
01084             }
01085             else if ((arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION) ||
01086                     (width > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION) ||
01087                     (height > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION))
01088             {
01089                 return throw ref new Platform::FailureException();
01090             }
01091             break;
01092
01093         case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
01094             if ((arraySize > 1) ||
01095                 (width > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) ||
01096                 (height > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) ||
01097                 (depth > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION))
01098             {
01099                 return throw ref new Platform::FailureException();
01100             }
01101             break;
01102     }
01103
01104     // Create the texture
01105     std::unique_ptr<D3D11_SUBRESOURCE_DATA[]> initData(new D3D11_SUBRESOURCE_DATA[mipCount * arraySize]);
01106
01107     size_t skipMip = 0;
01108     size_t twidth = 0;
01109     size_t theight = 0;
01110     size_t tdepth = 0;
01111     FillInitData(width, height, depth, mipCount, arraySize, format, maxsize, bitSize, bitData, twidth, theight, tdepth, skipMip, initData.get());
01112
01113     hr = CreateD3DResources(d3dDevice, resDim, twidth, theight, tdepth, mipCount - skipMip, arraySize, format, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, isCubeMap, initData.get(), texture, textureView);
01114
01115     if (FAILED(hr) && !maxsize && (mipCount > 1))
01116     {
01117         // Retry with a maxsize determined by feature level
01118         switch (d3dDevice->GetFeatureLevel())
01119         {
01120         case D3D_FEATURE_LEVEL_9_1:
01121         case D3D_FEATURE_LEVEL_9_2:
01122             if (isCubeMap)
01123             {
01124                 maxsize = D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION;
01125             }
01126             else
01127             {
01128                 maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
01129                     ? D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
01130                     : D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
01131             }
01132             break;
01133
01134         case D3D_FEATURE_LEVEL_9_3:
01135             maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
01136                 ? D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
01137                 : D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION;
01138             break;
01139
01140         default: // D3D_FEATURE_LEVEL_10_0 & D3D_FEATURE_LEVEL_10_1
01141             maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
01142                 ? D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
01143                 : D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION;
01144             break;
01145         }
01146
01147         FillInitData(width, height, depth, mipCount, arraySize, format, maxsize, bitSize, bitData, twidth, theight, tdepth, skipMip, initData.get());
01148
01149         hr = CreateD3DResources(d3dDevice, resDim, twidth, theight, tdepth, mipCount - skipMip, arraySize, format, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, isCubeMap, initData.get(), texture, textureView);
01150     }
01151
01152     DX::ThrowIfFailed(hr);
01153 }
01154
01155
01156 //--------------------------------------------------------------------------------------
01157 static D2D1_ALPHA_MODE GetAlphaMode(_In_ const DDS_HEADER* header)
01158 {
01159     if (header->ddspf.flags & DDS_FOURCC)
01160     {
01161         if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
01162         {
01163             auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>((const char*)header + sizeof(DDS_HEADER));
01164             switch (d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK)
01165             {
01166             case DDS_ALPHA_MODE_STRAIGHT:
01167                 return D2D1_ALPHA_MODE_STRAIGHT;
01168
01169             case DDS_ALPHA_MODE_PREMULTIPLIED:
01170                 return D2D1_ALPHA_MODE_PREMULTIPLIED;
01171
01172             case DDS_ALPHA_MODE_OPAQUE:
01173             case DDS_ALPHA_MODE_CUSTOM:
01174                 // No D2D1_ALPHA_MODE equivalent, so return "Ignore" for now
01175                 return D2D1_ALPHA_MODE_IGNORE;
01176             }
01177         }
01178         else if ((MAKEFOURCC('D', 'X', 'T', '2') == header->ddspf.fourCC)
01179                   || (MAKEFOURCC('D', 'X', 'T', '4') == header->ddspf.fourCC))
01180         {
01181             return D2D1_ALPHA_MODE_PREMULTIPLIED;
01182         }
01183         // DXT1, DXT3, and DXT5 legacy files could be straight alpha or something else, so return "Unknown" to leave it up to the app
01184     }
01185
01186     return D2D1_ALPHA_MODE_UNKNOWN;
01187 }
01188
01189
01190 //--------------------------------------------------------------------------------------
01191 _Use_decl_annotations_
01192 void CreateDDSTextureFromMemory(
01193     ID3D11Device* d3dDevice,
01194     const uint8_t* ddsData,
01195     size_t ddsDataSize,
01196     ID3D11Resource** texture,
01197     ID3D11ShaderResourceView** textureView,
01198     size_t maxsize,
01199     D2D1_ALPHA_MODE* alphaMode
01200     )
01201 {
01202     return CreateDDSTextureFromMemoryEx(d3dDevice, ddsData, ddsDataSize, maxsize, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false, texture, textureView, alphaMode);
01203 }
01204
01205
01206 //--------------------------------------------------------------------------------------
01207 _Use_decl_annotations_
01208 void CreateDDSTextureFromMemoryEx(
01209     ID3D11Device* d3dDevice,
01210     const uint8_t* ddsData,
01211     size_t ddsDataSize,
01212     size_t maxsize,
01213     D3D11_USAGE usage,
01214     unsigned int bindFlags,
01215     unsigned int cpuAccessFlags,
01216     unsigned int miscFlags,
01217     bool forceSRGB,
01218     ID3D11Resource** texture,
01219     ID3D11ShaderResourceView** textureView,
01220     D2D1_ALPHA_MODE* alphaMode
01221     )
01222 {
01223     if (texture)
01224     {
01225         *texture = nullptr;
01226     }
01227     if (textureView)
01228     {
01229         *textureView = nullptr;
01230     }
01231     if (alphaMode)
01232     {
01233         *alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
01234     }
01235
01236     if (!d3dDevice || !ddsData || (!texture && !textureView))
01237     {
01238         throw ref new Platform::InvalidArgumentException();
01239     }
01240
01241     // Validate DDS file in memory
01242     if (ddsDataSize < (sizeof(uint32) + sizeof(DDS_HEADER)))
01243     {
01244         throw ref new Platform::FailureException();
01245     }
01246
01247     uint32 dwMagicNumber = *(const uint32*)(ddsData);
01248     if (dwMagicNumber != DDS_MAGIC)
01249     {
01250         throw ref new Platform::FailureException();
01251     }
01252
01253     auto header = reinterpret_cast<const DDS_HEADER*>(ddsData + sizeof(uint32));
01254
01255     // Verify header to validate DDS file
01256     if (header->size != sizeof(DDS_HEADER) ||
01257         header->ddspf.size != sizeof(DDS_PIXELFORMAT))
01258     {
01259         throw ref new Platform::FailureException();
01260     }
01261
01262     // Check for DX10 extension
01263     bool bDXT10Header = false;
01264     if ((header->ddspf.flags & DDS_FOURCC) &&
01265         (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC))
01266     {
01267         // Must be long enough for both headers and magic value
01268         if (ddsDataSize < (sizeof(DDS_HEADER) + sizeof(uint32) + sizeof(DDS_HEADER_DXT10)))
01269         {
01270             throw ref new Platform::FailureException();
01271         }
01272
01273         bDXT10Header = true;
01274     }
01275
01276     ptrdiff_t offset = sizeof(uint32) + sizeof(DDS_HEADER) + (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0);
01277
01278     CreateTextureFromDDS(d3dDevice, header, ddsData + offset, ddsDataSize - offset, maxsize, usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB, texture, textureView);
01279
01280     if (alphaMode)
01281         *alphaMode = GetAlphaMode(header);
01282 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cs/Scenario1_GetAndSetPin.xaml.cs Source File

  • IoT-GPIO
  • cs

Scenario1_GetAndSetPin.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Devices.Gpio;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario1_GetAndSetPin : Page
00021     {
00022         // Use GPIO pin 5 to set values
00023         private const int LED_PIN = 5;
00024         private GpioPin pin;
00025
00026         public Scenario1_GetAndSetPin()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedFrom(NavigationEventArgs e)
00032         {
00033             StopScenario();
00034         }
00035
00036         void StartScenario()
00037         {
00038             var gpio = GpioController.GetDefault();
00039
00040             // Set up our GPIO pin for setting values.
00041             // If this next line crashes with a NullReferenceException,
00042             // then the problem is that there is no GPIO controller on the device.
00043             pin = gpio.OpenPin(LED_PIN);
00044
00045             // Configure pin for output.
00046             pin.SetDriveMode(GpioPinDriveMode.Output);
00047         }
00048
00049         void StopScenario()
00050         {
00051             // Release the GPIO pin.
00052             if (pin != null)
00053             {
00054                 pin.Dispose();
00055                 pin = null;
00056             }
00057         }
00058
00059         void StartStopScenario_Click(object sender, RoutedEventArgs e)
00060         {
00061             if (pin != null)
00062             {
00063                 StopScenario();
00064                 StartStopButton.Content = "Start";
00065                 ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00066             }
00067             else
00068             {
00069                 StartScenario();
00070                 StartStopButton.Content = "Stop";
00071                 ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
00072             }
00073         }
00074
00075         private void SetPinHigh_Click(object sender, RoutedEventArgs e)
00076         {
00077             // Set the pin value to High.
00078             pin.Write(GpioPinValue.High);
00079         }
00080
00081         private void SetPinLow_Click(object sender, RoutedEventArgs e)
00082         {
00083             // Set the pin value to Low.
00084             pin.Write(GpioPinValue.Low);
00085         }
00086
00087         private void GetPinValue_Click(object sender, RoutedEventArgs e)
00088         {
00089             // Change the GUI to reflect the current pin value.
00090             CurrentPinValue.Text = pin.Read().ToString();
00091         }
00092     }
00093 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeTextBoundaries.xaml.h

Go to the documentation of this file.
00001 #pragma once
00002 //*********************************************************
00003 //
00004 // Copyright (c) Microsoft. All rights reserved.
00005 // This code is licensed under the MIT License (MIT).
00006 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00007 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00008 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00009 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00010 //
00011 //*********************************************************
00012
00013 #pragma once
00014
00015 #include "Scenario_SynthesizeTextBoundaries.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario_SynthesizeTextBoundaries sealed
00022     {
00023     public:
00024         Scenario_SynthesizeTextBoundaries();
00025     private:
00026         SDKTemplate::MainPage^ rootPage;
00027
00028
00029         Windows::Media::SpeechSynthesis::SpeechSynthesizer^ synthesizer;
00030         Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ synthesisStream;
00031         Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
00032         Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
00033
00034         void Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035         void ListboxVoiceChooser_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00036         void media_MediaEnded(Windows::Media::Playback::MediaPlayer^ sender, Platform::Object^ e);
00037         Concurrency::task <void> SynthesizeTextStream();
00038         void RegisterForBoundaryEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem);
00039         void RegisterMetadataHandlerForWords(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
00040         void RegisterMetadataHandlerForSentences(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
00041         void metadata_SpeechCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^ args);
00042         void HighlightWordOnScreen(int startPositionInInput, int endPositionInInput);
00043         void FillTextBoxes(Windows::Media::Core::SpeechCue^ cue, Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack);
00044         void timedMetadataTrackChangedHandler(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem,
00045                                               Windows::Foundation::Collections::IVectorChangedEventArgs^ args);
00046
00047         void InitializeListboxVoiceChooser();
00048     };
00049 }
Generated on Fri Nov 15 2024 22:21:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/AudioCapturePermissions.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

AudioCapturePermissions.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012 namespace SDKTemplate
00013 {
00014     ref class AudioCapturePermissions sealed
00015     {
00016     public:
00017         static Windows::Foundation::IAsyncOperation<bool>^ RequestMicrophonePermissionAsync();
00018
00019     private:
00020         // If no recording device is attached, attempting to get access to audio capture devices will throw
00021         // a System.Exception object, with this HResult set.
00022         static const int NoCaptureDevicesHResult = -1072845856;
00023     };
00024 }
00025
Generated on Fri Nov 15 2024 22:21:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario3.xaml.h Source File

  • DatagramSocket
  • cpp

Scenario3.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.h
00014 // Declaration of the Scenario3 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario3.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace DatagramSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario3 sealed
00032         {
00033         public:
00034             Scenario3();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             MainPage^ rootPage;
00040             void SendHello_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         };
00042     }
00043 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S5_AddWithAppContent.xaml.cpp Source File

  • ContentIndexer
  • cpp

S5_AddWithAppContent.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S5_AddWithAppContent.xaml.cpp
00014 // Implementation of the S5_AddWithAppContent class
00015 //
00016
00017 #include "pch.h"
00018 #include "S5_AddWithAppContent.xaml.h"
00019 #include "MainPage.xaml.h"
00020 #include "Helpers.h"
00021
00022 using namespace SDKTemplate;
00023
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026
00027 S5_AddWithAppContent::S5_AddWithAppContent()
00028 {
00029     InitializeComponent();
00030     InitializeRevisionNumber();
00031 }
00032
00033 void S5_AddWithAppContent::AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00034 {
00035     AddAppContentFilesToIndexedFolder();
00036 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario2_Binary.cpp Source File

  • WebSocket
  • cppwinrt

Scenario2_Binary.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Binary.h"
00014 #include "Scenario2_Binary.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Networking::Sockets;
00020 using namespace winrt::Windows::Security::Cryptography;
00021 using namespace winrt::Windows::Security::Cryptography::Certificates;
00022 using namespace winrt::Windows::Storage::Streams;
00023 using namespace winrt::Windows::UI::Xaml;
00024 using namespace winrt::Windows::UI::Xaml::Navigation;
00025 using namespace winrt::Windows::Web;
00026 using namespace std::literals::chrono_literals;
00027
00028 namespace winrt::SDKTemplate::implementation
00029 {
00030     Scenario2_Binary::Scenario2_Binary()
00031     {
00032         InitializeComponent();
00033         UpdateVisualState();
00034     }
00035
00036     void Scenario2_Binary::OnNavigatedFrom(NavigationEventArgs const&)
00037     {
00038         CloseSocket();
00039     }
00040
00041     void Scenario2_Binary::UpdateVisualState()
00042     {
00043         if (m_busy)
00044         {
00045             VisualStateManager::GoToState(*this, L"Busy", false);
00046         }
00047         else if (m_streamWebSocket != nullptr)
00048         {
00049                 VisualStateManager::GoToState(*this, L"Connected", false);
00050             }
00051         else
00052         {
00053             VisualStateManager::GoToState(*this, L"Disconnected", false);
00054         }
00055    }
00056
00057     void Scenario2_Binary::SetBusy(bool value)
00058     {
00059         m_busy = value;
00060         UpdateVisualState();
00061     }
00062
00063     fire_and_forget Scenario2_Binary::OnStart(IInspectable const&, RoutedEventArgs const&)
00064     {
00065         auto lifetime = get_strong();
00066
00067         SetBusy(true);
00068         co_await StartAsync();
00069         SetBusy(false);
00070     }
00071
00072     IAsyncAction Scenario2_Binary::StartAsync()
00073     {
00074         auto lifetime = get_strong();
00075
00076         // Validating the URI is required since it was received from an untrusted source (user input).
00077         // The URI is validated by calling TryGetUri() that will return null for strings that are not
00078         // valid WebSocket URIs.
00079         // Note that when enabling the text box users may provide URIs to machines on the intrAnet
00080         // or intErnet. In these cases the app requires the "Home or Work Networking" or
00081         // "Internet (Client)" capability respectively.
00082         Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
00083         if (server == nullptr)
00084         {
00085             co_return;
00086         }
00087
00088         m_streamWebSocket = StreamWebSocket();
00089         m_streamWebSocket.Closed({ get_weak(), &Scenario2_Binary::OnClosed });
00090
00091         // If we are connecting to wss:// endpoint, by default, the OS performs validation of
00092         // the server certificate based on well-known trusted CAs. We can perform additional custom
00093         // validation if needed.
00094         if (SecureWebSocketCheckBox().IsChecked().Value())
00095         {
00096             // WARNING: Only test applications should ignore SSL errors.
00097             // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
00098             // attacks. (Although the connection is secure, the server is not authenticated.)
00099             // Note that not all certificate validation errors can be ignored.
00100             // In this case, we are ignoring these errors since the certificate assigned to the localhost
00101             // URI is self-signed and has subject name = fabrikam.com
00102             m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
00103             m_streamWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);
00104
00105             // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
00106             // custom validation of the server certificate. The event handler must implement the desired
00107             // custom certificate validation logic.
00108             m_streamWebSocket.ServerCustomValidationRequested({ get_weak(), &Scenario2_Binary::OnServerCustomValidationRequested });
00109
00110             // Certificate validation is meaningful only for secure connections.
00111             if (server.SchemeName() != L"wss")
00112             {
00113                 AppendOutputLine(L"Note: Certificate validation is performed only for the wss: scheme.");
00114             }
00115         }
00116
00117         AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");
00118         try
00119         {
00120             co_await m_streamWebSocket.ConnectAsync(server);
00121         }
00122         catch (winrt::hresult_error const& ex) // For debugging
00123         {
00124             m_streamWebSocket.Close();
00125             m_streamWebSocket = nullptr;
00126
00127             AppendOutputLine(BuildWebSocketError(ex));
00128             AppendOutputLine(ex.message());
00129             co_return;
00130         }
00131         m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);
00132
00133         // Start a task to continuously read for incoming data
00134         auto receiving = ReceiveDataAsync(m_streamWebSocket);
00135
00136         // Start a task to continuously write outgoing data
00137         auto sending = SendDataAsync(m_streamWebSocket);
00138     }
00139
00140     fire_and_forget Scenario2_Binary::OnServerCustomValidationRequested(StreamWebSocket const&, WebSocketServerCustomValidationRequestedEventArgs e)
00141     {
00142         auto lifetime = get_strong();
00143
00144         // In order to call async APIs in this handler, you must first take a deferral and then
00145         // complete it once you are done with the operation. The Deferral destructor
00146         // ensures that the deferral completes when control leaves the function.
00147         bool isValid;
00148         Deferral deferral = e.GetDeferral();
00149
00150         // Get the server certificate and certificate chain from the args parameter.
00151         isValid = co_await AreCertificateAndCertChainValidAsync(e.ServerCertificate(), e.ServerIntermediateCertificates());
00152
00153         if (!isValid)
00154         {
00155             e.Reject();
00156         }
00157
00158         co_await resume_foreground(Dispatcher());
00159
00160         if (isValid)
00161         {
00162             AppendOutputLine(L"Custom validation of server certificate passed.");
00163         }
00164         else
00165         {
00166             AppendOutputLine(L"Custom validation of server certificate failed.");
00167         }
00168     }
00169
00170     IAsyncAction Scenario2_Binary::SendDataAsync(StreamWebSocket activeSocket)
00171     {
00172         auto lifetime = get_strong();
00173
00174         int bytesSent = 0;
00175         const uint8_t data[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
00176
00177         AppendOutputLine(L"Background sending data in " + to_hstring(sizeof(data)) + L" byte chunks each second.");
00178
00179         try
00180         {
00181             // Send until the socket gets closed/stopped
00182             while (true)
00183             {
00184                 co_await resume_foreground(Dispatcher());
00185
00186                 if (m_streamWebSocket != activeSocket)
00187                 {
00188                     // Our socket is no longer active. Stop sending.
00189                     AppendOutputLine(L"Background write stopped.");
00190                     co_return;
00191                 }
00192
00193                 auto buffer = CryptographicBuffer::CreateFromByteArray(data);
00194                 auto bytesSentThisCall = co_await activeSocket.OutputStream().WriteAsync(buffer);
00195                 bytesSent += bytesSentThisCall;
00196
00197                 DataSentField().Text(to_hstring(bytesSent));
00198
00199                 // Delay so the user can watch what's going on.
00200                 co_await winrt::resume_after(1s);
00201             }
00202         }
00203         catch (winrt::hresult_error const& ex)
00204         {
00205             WebErrorStatus status = WebSocketError::GetStatus(ex.code());
00206
00207             switch (status)
00208             {
00209             case WebErrorStatus::OperationCanceled:
00210                 AppendOutputLine(L"Background write canceled.");
00211                 break;
00212
00213             default:
00214                 AppendOutputLine(L"Error: " + to_hstring(status));
00215                 AppendOutputLine(ex.message());
00216                 break;
00217             }
00218         }
00219     }
00220
00221     IAsyncAction Scenario2_Binary::ReceiveDataAsync(StreamWebSocket activeSocket)
00222     {
00223         auto lifetime = get_strong();
00224
00225         int bytesReceived = 0;
00226         try
00227         {
00228             AppendOutputLine(L"Background read starting.");
00229
00230             Buffer readBuffer(1000);
00231
00232             while (true)
00233             {
00234                 co_await resume_foreground(Dispatcher());
00235
00236                 if (m_streamWebSocket != activeSocket)
00237                 {
00238                     // Our socket is no longer active. Stop reading.
00239                     AppendOutputLine(L"Background read stopped.");
00240                     co_return;
00241                 }
00242
00243                 IBuffer resultBuffer = co_await m_streamWebSocket.InputStream().ReadAsync(readBuffer, 1000, InputStreamOptions::Partial);
00244
00245                 // Do something with the data.
00246                 // This sample merely reports that the data was received.
00247
00248                 bytesReceived += resultBuffer.Length();
00249                 DataReceivedField().Text(to_hstring(bytesReceived));
00250             }
00251         }
00252         catch (winrt::hresult_error const& ex)
00253         {
00254             WebErrorStatus status = WebSocketError::GetStatus(ex.code());
00255
00256             switch (status)
00257             {
00258             case WebErrorStatus::OperationCanceled:
00259                 AppendOutputLine(L"Background read canceled.");
00260                 break;
00261
00262             default:
00263                 AppendOutputLine(L"Error: " + to_hstring(status));
00264                 AppendOutputLine(ex.message());
00265                 break;
00266             }
00267         }
00268     }
00269
00270     void Scenario2_Binary::OnStop(IInspectable const&, RoutedEventArgs const&)
00271     {
00272         SetBusy(true);
00273         m_rootPage.NotifyUser(L"Stopping", NotifyType::StatusMessage);
00274         CloseSocket();
00275         SetBusy(false);
00276         m_rootPage.NotifyUser(L"Stopped", NotifyType::StatusMessage);
00277     }
00278
00279     // This may be triggered remotely by the server or locally by Close/Dispose()
00280     fire_and_forget Scenario2_Binary::OnClosed(IWebSocket sender, WebSocketClosedEventArgs e)
00281     {
00282         auto lifetime = get_strong();
00283
00284         // Continue on the UI thread so we do not need to synchronize access to messageWebSocket.
00285         co_await resume_foreground(Dispatcher());
00286
00287         AppendOutputLine(L"Closed; Code: " + to_hstring(e.Code()) + L", Reason: " + e.Reason());
00288
00289         if (m_streamWebSocket == sender)
00290         {
00291             CloseSocket();
00292             UpdateVisualState();
00293         }
00294     }
00295
00296     void Scenario2_Binary::CloseSocket()
00297     {
00298         if (m_streamWebSocket)
00299         {
00300             try
00301             {
00302                 m_streamWebSocket.Close(1000, L"Closed due to user request.");
00303             }
00304             catch (winrt::hresult_error const& ex)
00305             {
00306                 AppendOutputLine(BuildWebSocketError(ex));
00307                 AppendOutputLine(ex.message());
00308             }
00309             m_streamWebSocket = nullptr;
00310         }
00311     }
00312
00313     void Scenario2_Binary::AppendOutputLine(hstring const& value)
00314     {
00315         OutputField().Text(OutputField().Text() + value + L"\r\n");
00316     }
00317 }
Generated on Fri Nov 15 2024 22:22:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario9_ContainsFullScreenElement Member List

This is the complete list of members for Scenario9_ContainsFullScreenElement, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario9_ContainsFullScreenElement | [inline, protected]
Scenario9_ContainsFullScreenElement() | Scenario9_ContainsFullScreenElement | [inline]
WebViewControl_ContainsFullScreenElementChanged(WebView sender, object args) | Scenario9_ContainsFullScreenElement | [inline, private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_HardwareDRM Member List

This is the complete list of members for Scenario3_HardwareDRM, including all inherited members.
Scenario3_HardwareDRM() Scenario3_HardwareDRM [inline]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/SampleConfiguration.cs Source File

  • MessageDialog
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Message dialog C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Use custom commands", ClassType = typeof(CustomCommand) },
00025             new Scenario() { Title = "Use default close command", ClassType = typeof(DefaultCloseCommand) },
00026             new Scenario() { Title = "Use completed callback", ClassType = typeof(CompletedCallback) },
00027             new Scenario() { Title = "Use cancel command", ClassType = typeof(CancelCommand) }
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario5.xaml.cs Source File

  • MapControl
  • cs

Scenario5.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Geolocation;
00014 using Windows.Foundation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Controls.Maps;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario5 : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025
00026         public Scenario5()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         private async void showStreetSideNearSpaceneedle_Click(object sender, RoutedEventArgs e)
00032         {
00033             if (myMap.IsStreetsideSupported)
00034             {
00035                 BasicGeoposition spaceNeedlePosition = new BasicGeoposition();
00036                 spaceNeedlePosition.Latitude = 47.6204;
00037                 spaceNeedlePosition.Longitude = -122.3491;
00038
00039                 Geopoint spaceNeedlePoint = new Geopoint(spaceNeedlePosition);
00040
00041                 StreetsidePanorama panoramaNearSpaceNeedle = await StreetsidePanorama.FindNearbyAsync(spaceNeedlePoint);
00042
00043                 if (panoramaNearSpaceNeedle != null)
00044                 {
00045                     myMap.CustomExperience = new StreetsideExperience(panoramaNearSpaceNeedle);
00046                 }
00047             }
00048             else
00049             {
00050
00051                 string status = "Streetside views are not supported on this device.";
00052                 rootPage.NotifyUser(status, NotifyType.ErrorMessage);
00053             }
00054         }
00055
00056         private void myMap_Loaded(object sender, RoutedEventArgs e)
00057         {
00058             myMap.Center = MainPage.SeattleGeopoint;
00059             myMap.ZoomLevel = 12;
00060         }
00061     }
00062 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/TextRenderer.cpp Source File

  • HolographicTagAlong
  • cpp
  • Content

TextRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #include "Common\DirectXHelper.h"
00015 #include "TextRenderer.h"
00016
00017 using namespace HolographicTagAlongSample;
00018
00019 TextRenderer::TextRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources, unsigned int const& textureWidth, unsigned int const& textureHeight)
00020     : m_deviceResources(deviceResources),
00021       m_textureWidth(textureWidth),
00022       m_textureHeight(textureHeight)
00023 {
00024     CreateDeviceDependentResources();
00025 }
00026
00027 void TextRenderer::RenderTextOffscreen(const std::wstring& str)
00028 {
00029     // Clear the off-screen render target.
00030     m_deviceResources->GetD3DDeviceContext()->ClearRenderTargetView(m_renderTargetView.Get(), DirectX::Colors::Transparent);
00031
00032     // Begin drawing with D2D.
00033     m_d2dRenderTarget->BeginDraw();
00034
00035     // Create a text layout to match the screen.
00036     Microsoft::WRL::ComPtr<IDWriteTextLayout> textLayout;
00037     m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00038         str.c_str(),
00039         static_cast<UINT32>(str.length()),
00040         m_textFormat.Get(),
00041         (float)m_textureWidth,
00042         (float)m_textureHeight,
00043         &textLayout
00044         );
00045
00046     // Get the text metrics from the text layout.
00047     DWRITE_TEXT_METRICS metrics;
00048     DX::ThrowIfFailed(textLayout->GetMetrics(&metrics));
00049
00050     // In this example, we position the text in the center of the off-screen render target.
00051     D2D1::Matrix3x2F screenTranslation = D2D1::Matrix3x2F::Translation(
00052         m_textureWidth * 0.5f,
00053         m_textureHeight * 0.5f + metrics.height * 0.5f
00054         );
00055     m_whiteBrush->SetTransform(screenTranslation);
00056
00057     // Render the text using DirectWrite.
00058     m_d2dRenderTarget->DrawTextLayout(
00059         D2D1::Point2F(0.0f, 0.0f),
00060         textLayout.Get(),
00061         m_whiteBrush.Get()
00062         );
00063
00064     // End drawing with D2D.
00065     HRESULT hr = m_d2dRenderTarget->EndDraw();
00066     if (hr != D2DERR_RECREATE_TARGET)
00067     {
00068         // Catch errors from D2D.
00069         DX::ThrowIfFailed(hr);
00070     }
00071 }
00072
00073 void TextRenderer::ReleaseDeviceDependentResources()
00074 {
00075     m_texture.Reset();
00076     m_shaderResourceView.Reset();
00077     m_pointSampler.Reset();
00078     m_renderTargetView.Reset();
00079     m_d2dRenderTarget.Reset();
00080     m_whiteBrush.Reset();
00081     m_textFormat.Reset();
00082 }
00083
00084 void TextRenderer::CreateDeviceDependentResources()
00085 {
00086     // Create a default sampler state, which will use point sampling.
00087     CD3D11_SAMPLER_DESC desc(D3D11_DEFAULT);
00088     m_deviceResources->GetD3DDevice()->CreateSamplerState(&desc, &m_pointSampler);
00089
00090     // Create the texture that will be used as the offscreen render target.
00091     CD3D11_TEXTURE2D_DESC textureDesc(
00092         DXGI_FORMAT_B8G8R8A8_UNORM,
00093         m_textureWidth,
00094         m_textureHeight,
00095         1,
00096         1,
00097         D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
00098     );
00099     m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);
00100
00101     // Create read and write views for the offscreen render target.
00102     m_deviceResources->GetD3DDevice()->CreateShaderResourceView(m_texture.Get(), nullptr, &m_shaderResourceView);
00103     m_deviceResources->GetD3DDevice()->CreateRenderTargetView(m_texture.Get(), nullptr, &m_renderTargetView);
00104
00105     // In this example, we are using D2D and DirectWrite; so, we need to create a D2D render target as well.
00106     D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(
00107         D2D1_RENDER_TARGET_TYPE_DEFAULT,
00108         D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED),
00109         96,
00110         96
00111     );
00112
00113     // The DXGI surface is used to create the render target.
00114     Microsoft::WRL::ComPtr<IDXGISurface> dxgiSurface;
00115     DX::ThrowIfFailed(m_texture.As(&dxgiSurface));
00116     DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDxgiSurfaceRenderTarget(dxgiSurface.Get(), &props, &m_d2dRenderTarget));
00117
00118     // Create a solid color brush that will be used to render the text.
00119     DX::ThrowIfFailed(m_d2dRenderTarget->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Cornsilk), &m_whiteBrush));
00120
00121     // This is where we format the text that will be written on the render target.
00122     DX::ThrowIfFailed(
00123         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00124             L"Consolas",
00125             NULL,
00126             DWRITE_FONT_WEIGHT_NORMAL,
00127             DWRITE_FONT_STYLE_NORMAL,
00128             DWRITE_FONT_STRETCH_NORMAL,
00129             400.0f,
00130             L"",
00131             m_textFormat.ReleaseAndGetAddressOf()
00132         )
00133     );
00134     DX::ThrowIfFailed(m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
00135     DX::ThrowIfFailed(m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER));
00136 }
00137
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CardioidSound.h Source File

  • SpatialSound
  • cpp

CardioidSound.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 //
00015 // Sound with Cardioid radiation pattern.
00016 //
00017 class CardioidSound
00018 {
00019 public:
00020     virtual ~CardioidSound();
00021     HRESULT Initialize(_In_ LPCWSTR filename);
00022     HRESULT ConfigureApo(_In_ float scaling, _In_ float order);
00023
00024     HRESULT Start();
00025     HRESULT Stop();
00026     HRESULT OnUpdate(_In_ float x, _In_ float, _In_ float z, _In_ float pitch, _In_ float yaw, _In_ float roll);
00027     HRESULT SetEnvironment(_In_ HrtfEnvironment environment);
00028     HrtfEnvironment GetEnvironment() { return _environment; }
00029
00030 private:
00031     HrtfOrientation OrientationFromAngles(float pitch, float yaw, float roll);
00032
00033 private:
00034     AudioFileReader                 _audioFile;
00035     ComPtr<IXAudio2>                _xaudio2;
00036     IXAudio2SourceVoice*            _sourceVoice = nullptr;
00037     ComPtr<IXAPOHrtfParameters>     _hrtfParams;
00038     HrtfEnvironment                 _environment = HrtfEnvironment::Outdoors;
00039 };
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HighScoreEntry Member List

This is the complete list of members for HighScoreEntry, including all inherited members.
levelCompleted | HighScoreEntry
tag | HighScoreEntry
tag | HighScoreEntry
totalHits | HighScoreEntry
totalShots | HighScoreEntry
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/SampleConfiguration.cs Source File

  • ContactPanel
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.Foundation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "Contact Panel C# Sample";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title="Scenario 1", ClassType=typeof(Scenario1_CreateContact)},
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036
00037
00038     internal static class Constants
00039     {
00040         // The protocol we use to launch ourselves.
00041         internal const string Protocol = "cpsdkcs";
00042
00043         // Information about the sample contact.
00044
00045         // The remote ID should be globally unique. This is typically done by
00046         // prefixing it with the name of the app. This sample also prefixes the
00047         // protocol so that multiple versions of the sample can coexist (C++, C#, etc).
00048         internal static string ContactRemoteId = $"ms-{Protocol}:31415";
00049         internal const string ContactListName = "ContactPanelSample";
00050         internal const string ContactEmail = "janedoe@example.com";
00051         internal const string ContactPhone = "4255550123";
00052         internal const string ContactFirstName = "Jane";
00053         internal const string ContactLastName = "Doe";
00054         internal static string ContactImageSource = "https://docs.microsoft.com/en-us/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png";
00055     }
00056
00057
00058
00059     public partial class App : Application
00060     {
00061         protected override void OnActivated(IActivatedEventArgs args)
00062         {
00063             Frame rootFrame = CreateRootFrame();
00064
00065             switch (args.Kind)
00066             {
00067                 case ActivationKind.Protocol:
00068                     {
00069                         if (rootFrame.Content == null)
00070                         {
00071                             rootFrame.Navigate(typeof(MainPage));
00072                         }
00073
00074                         // Parse the contact remote ID from the protocol arguments.
00075                         string contactRemoteId = String.Empty;
00076                         var protocolArgs = (ProtocolActivatedEventArgs)args;
00077                         var decoder = new WwwFormUrlDecoder(protocolArgs.Uri.Query);
00078                         try
00079                         {
00080                             contactRemoteId = decoder.GetFirstValueByName("ContactRemoteId");
00081                         }
00082                         catch (ArgumentException)
00083                         {
00084                             // Value not present in query string.
00085                         }
00086
00087                         //  AppContactPanel_LaunchFullAppRequested passed in the remoteId. Display it to the user.
00088                         MainPage.Current.NotifyUser("Protocol launch with remoteId = " + contactRemoteId, NotifyType.StatusMessage);
00089
00090                         Window.Current.Activate();
00091                         break;
00092                     }
00093
00094                 case ActivationKind.ContactPanel:
00095                     {
00096                         if (rootFrame.Content == null)
00097                         {
00098                             rootFrame.Navigate(typeof(AppContactPanel));
00099                         }
00100
00101                         var appContactPanel = (AppContactPanel)rootFrame.Content;
00102                         appContactPanel.OnActivated((ContactPanelActivatedEventArgs)args);
00103
00104                         Window.Current.Activate();
00105                         break;
00106                     }
00107             }
00108         }
00109     }
00110 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario5_GeofenceBackgroundTask.xaml.cs Source File

  • Geolocation
  • cs

Scenario5_GeofenceBackgroundTask.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Devices.Geolocation;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario5_GeofenceBackgroundTask : Page
00024     {
00025         private const string BackgroundTaskName = "SampleGeofenceBackgroundTask";
00026         private const string BackgroundTaskEntryPoint = "BackgroundTask.GeofenceBackgroundTask";
00027
00028         private IBackgroundTaskRegistration _geofenceTask = null;
00029
00030         // A pointer to the main page.
00031         private MainPage _rootPage = MainPage.Current;
00032
00033         public Scenario5_GeofenceBackgroundTask()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         protected override void OnNavigatedTo(NavigationEventArgs e)
00039         {
00040             // See if our background task is already registered.
00041             _geofenceTask = MainPage.LookupBackgroundTask(BackgroundTaskName);
00042
00043             if (_geofenceTask != null)
00044             {
00045                 // Associate an event handler with the existing background task
00046                 _geofenceTask.Completed += OnCompleted;
00047
00048                 FillEventListBoxWithExistingEvents();
00049             }
00050             UpdateButtonStates();
00051         }
00052
00053         /// <summary>
00054         /// This is the click handler for the 'Register' button.
00055         /// </summary>
00056         /// <param name="sender"></param>
00057         /// <param name="e"></param>
00058         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00059         {
00060             // Register the background task without checking whether the user has enabled background execution.
00061             // If it's disabled, and then the user later enables background execution, the background task will be ready to run.
00062             // Create a new background task builder
00063             BackgroundTaskBuilder geofenceTaskBuilder = new BackgroundTaskBuilder();
00064
00065             geofenceTaskBuilder.Name = BackgroundTaskName;
00066             geofenceTaskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;
00067
00068             // Create a new location trigger
00069             var trigger = new LocationTrigger(LocationTriggerType.Geofence);
00070
00071             // Associate the location trigger with the background task builder
00072             geofenceTaskBuilder.SetTrigger(trigger);
00073
00074             // If it is important that there is user presence and/or
00075             // internet connection when OnCompleted is called
00076             // the following could be called before calling Register()
00077             // SystemCondition condition = new SystemCondition(SystemConditionType.UserPresent | SystemConditionType.InternetAvailable);
00078             // geofenceTaskBuilder.AddCondition(condition);
00079
00080             // Register the background task
00081             _geofenceTask = geofenceTaskBuilder.Register();
00082
00083             // Associate an event handler with the new background task
00084             _geofenceTask.Completed += OnCompleted;
00085
00086             UpdateButtonStates();
00087             MainPage.CheckBackgroundAndRequestLocationAccess();
00088         }
00089
00090         /// <summary>
00091         /// This is the click handler for the 'Unregister' button.
00092         /// </summary>
00093         /// <param name="sender"></param>
00094         /// <param name="e"></param>
00095         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00096         {
00097             // Unregister the background task
00098             if (null != _geofenceTask)
00099             {
00100                 _geofenceTask.Unregister(true);
00101                 _geofenceTask.Completed -= OnCompleted;
00102                 _geofenceTask = null;
00103             }
00104
00105             _rootPage.NotifyUser("Geofence background task unregistered", NotifyType.StatusMessage);
00106             UpdateButtonStates();
00107         }
00108
00109         /// <summary>
00110         /// This is the callback when background event has been handled
00111         /// </summary>
00112         /// <param name="sender"></param>
00113         /// <param name="e"></param>
00114         async private void OnCompleted(IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
00115         {
00116             // Update the UI with progress reported by the background task
00117             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00118             {
00119                 try
00120                 {
00121                     // Rethrow any exception that occurred in the background task.
00122                     e.CheckResult();
00123
00124                     // Update the UI with the completion status of the background task
00125                     // The Run method of the background task sets this status.
00126                     MainPage.ReportSavedStatus();
00127
00128                     FillEventListBoxWithExistingEvents();
00129                 }
00130                 catch (Exception ex)
00131                 {
00132                     // The background task had an error
00133                     _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00134                 }
00135             });
00136         }
00137
00138         /// <summary>
00139         /// Update the enable state of the register/unregister buttons.
00140         /// </summary>
00141         private void UpdateButtonStates()
00142         {
00143             bool registered = (_geofenceTask != null);
00144             RegisterBackgroundTaskButton.IsEnabled = !registered;
00145             UnregisterBackgroundTaskButton.IsEnabled = registered;
00146         }
00147
00148         /// <summary>
00149         /// Populate events list box with entries from BackgroundGeofenceEventCollection.
00150         /// </summary>
00151         private void FillEventListBoxWithExistingEvents()
00152         {
00153             MainPage.FillItemsFromSavedJson(GeofenceBackgroundEventsListBox, "BackgroundGeofenceEventCollection");
00154         }
00155     }
00156 }
00157
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

int24in32 Member List

This is the complete list of members for int24in32, including all inherited members.
value int24in32
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_FindUsers Member List

This is the complete list of members for Scenario1_FindUsers, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1_FindUsers | [inline, protected]
rootPage | Scenario1_FindUsers | [private]
Scenario1_FindUsers() | Scenario1_FindUsers | [inline]
ShowProperties() | Scenario1_FindUsers | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareDelayRenderedFiles.xaml.h Source File

  • ShareSource
  • cpp

ShareDelayRenderedFiles.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareDelayRenderedFiles.xaml.h
00014 // Declaration of the ShareDelayRenderedFiles class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "SharePage.h"
00021 #include "ShareDelayRenderedFiles.g.h"
00022 #include "MainPage.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     [Windows::Foundation::Metadata::WebHostHidden]
00027     public ref class ShareDelayRenderedFiles sealed
00028     {
00029     public:
00030         ShareDelayRenderedFiles();
00031
00032     protected:
00033         virtual bool GetShareContent(Windows::ApplicationModel::DataTransfer::DataRequest^ request) override;
00034
00035     private:
00036         Windows::Storage::StorageFile^ imageFile;
00037
00038         void OnDeferredImageRequestedHandler(Windows::ApplicationModel::DataTransfer::DataProviderRequest^ request);
00039         void SelectImageButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040     };
00041 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/pch.cpp Source File

  • CustomCapability
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // pch.cpp
00014 // Include the standard header and generate the precompiled header.
00015 //
00016
00017 #include "pch.h"
00018 #include "MainPage.xaml.h"
00019
00020 #include <robuffer.h>
00021 #include <wrl\client.h>
00022
00023 using namespace Microsoft::WRL;
00024 using namespace Windows::Storage::Streams;
00025
00026 byte* GetArrayFromBuffer(Windows::Storage::Streams::IBuffer^ buffer)
00027 {
00028     ComPtr<IInspectable> base = reinterpret_cast<IInspectable*>(buffer);
00029     ComPtr<IBufferByteAccess> access;
00030
00031     auto hr = base.As(&access);
00032
00033     if (FAILED(hr))
00034     {
00035         throw Platform::Exception::CreateException(hr);
00036     }
00037
00038     byte* data;
00039
00040     hr = access->Buffer(&data);
00041
00042     if (FAILED(hr))
00043     {
00044         throw Platform::Exception::CreateException(hr);
00045     }
00046
00047     // The returned buffer is valid as long as the IBuffer passed in
00048     // remains valid.
00049     return data;
00050 }
00051
00052 void NotifyStatusMessage(Platform::String^ message, SDKTemplate::NotifyType messageType)
00053 {
00054     SDKTemplate::MainPage::Current->NotifyUser(message, messageType);
00055 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/VoiceCommandService/Properties/AssemblyInfo.cs Source File

  • CortanaVoiceCommand
  • cs
  • VoiceCommandService
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("VoiceCommandService")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("VoiceCommandService")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/pch.h Source File

  • Logging
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <hstring.h>
00015 #include "winrt/Windows.Foundation.h"
00016 #include "winrt/Windows.Foundation.Collections.h"
00017 #include "winrt/Windows.Foundation.Diagnostics.h"
00018 #include "winrt/Windows.Storage.h"
00019 #include "winrt/Windows.ApplicationModel.Activation.h"
00020 #include "winrt/Windows.System.h"
00021 #include "winrt/Windows.UI.Core.h"
00022 #include "winrt/Windows.UI.Xaml.h"
00023 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00024 #include "winrt/Windows.UI.Xaml.Controls.h"
00025 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00026 #include "winrt/Windows.UI.Xaml.Documents.h"
00027 #include "winrt/Windows.UI.Xaml.Interop.h"
00028 #include "winrt/Windows.UI.Xaml.Markup.h"
00029 #include "winrt/Windows.UI.Xaml.Media.h"
00030 #include "winrt/Windows.UI.Xaml.Navigation.h"
00031 #include <string>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/SampleConfiguration.cs Source File

  • VersionAdaptiveCode
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "XamlLightUp C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Basics", ClassType=typeof(Scenario1_Basics) },
00025             new Scenario() { Title="Conditional execution", ClassType=typeof(Scenario2_Conditional) },
00026             new Scenario() { Title="Choosing controls", ClassType=typeof(Scenario3_ChooseControl) },
00027             new Scenario() { Title="Adaptive triggers", ClassType=typeof(Scenario4_StateTrigger) },
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
_captureFolder | MainPage | [private]
_displayInformation | MainPage | [private]
_displayOrientation | MainPage | [private]
_displayRequest | MainPage | [private]
_externalCamera | MainPage | [private]
_isInitialized | MainPage | [private]
_isPreviewing | MainPage | [private]
_mediaCapture | MainPage | [private]
_mediaCaptureLifeLock | MainPage | [private, static]
_mirroringPreview | MainPage | [private]
_systemMediaControls | MainPage | [private]
Application_Resuming(object sender, object o) | MainPage | [inline, private]
Application_Suspending(object sender, SuspendingEventArgs e) | MainPage | [inline, private]
ApplyGreenFilter(SoftwareBitmap bitmap) | MainPage | [inline, private]
CleanupCameraAsync() | MainPage | [inline, private]
ConvertDisplayOrientationToDegrees(DisplayOrientations orientation) | MainPage | [inline, private, static]
DisplayInformation_OrientationChanged(DisplayInformation sender, object args) | MainPage | [inline, private]
FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel) | MainPage | [inline, private, static]
GetPreviewFrameAsD3DSurfaceAsync() | MainPage | [inline, private]
GetPreviewFrameAsSoftwareBitmapAsync() | MainPage | [inline, private]
GetPreviewFrameButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
InitializeCameraAsync() | MainPage | [inline, private]
MainPage() | MainPage | [inline]
MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs) | MainPage | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | MainPage | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | MainPage | [inline, protected]
RotationKey | MainPage | [private, static]
SaveSoftwareBitmapAsync(SoftwareBitmap bitmap, StorageFile file) | MainPage | [inline, private, static]
SetPreviewRotationAsync() | MainPage | [inline, private]
StartPreviewAsync() | MainPage | [inline, private]
StopPreviewAsync() | MainPage | [inline, private]
SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/SampleConfiguration.cpp Source File

  • SecondaryTiles
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016 #include <ctime>
00017
00018 using namespace winrt;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Media;
00024 using namespace SDKTemplate;
00025
00026 hstring implementation::MainPage::FEATURE_NAME()
00027 {
00028     return L"SecondaryTiles C++/WinRT Sample";
00029 }
00030
00031 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00032 {
00033     Scenario{ L"Pin Tile",                            xaml_typename<SDKTemplate::Scenario1_PinTile>() },
00034     Scenario{ L"Unpin Tile",                          xaml_typename<SDKTemplate::Scenario2_UnpinTile>() },
00035     Scenario{ L"Enumerate Tiles",                     xaml_typename<SDKTemplate::Scenario3_EnumerateTiles>() },
00036     Scenario{ L"Is Tile Pinned?",                     xaml_typename<SDKTemplate::Scenario4_TilePinned>() },
00037     Scenario{ L"Show Activation Arguments",           xaml_typename<SDKTemplate::Scenario5_LaunchedFromSecondaryTile>() },
00038     Scenario{ L"Secondary Tile Notifications",        xaml_typename<SDKTemplate::Scenario6_SecondaryTileNotification>() },
00039     Scenario{ L"Pin/Unpin Through Appbar",            xaml_typename<SDKTemplate::Scenario7_PinFromAppbar>() },
00040     Scenario{ L"Update Secondary Tile Default Logo",  xaml_typename<SDKTemplate::Scenario8_UpdateAsync>() },
00041 });
00042
00043 hstring SampleHelpers::CurrentTimeAsString()
00044 {
00045     std::time_t now = clock::to_time_t(clock::now());
00046     char buffer[26];
00047     ctime_s(buffer, ARRAYSIZE(buffer), &now);
00048     return to_hstring(buffer);
00049 }
00050
00051 Rect SampleHelpers::GetElementRect(IInspectable const& e)
00052 {
00053     auto element = e.as<FrameworkElement>();
00054     GeneralTransform transform = element.TransformToVisual(nullptr);
00055     return transform.TransformBounds(Rect{ 0, 0, static_cast<float>(element.ActualWidth()), static_cast<float>(element.ActualHeight()) });
00056 }
00057
00058 void winrt::SDKTemplate::App_LaunchCompleted(LaunchActivatedEventArgs const& e)
00059 {
00060     hstring arguments = e.Arguments();
00061     if (!arguments.empty())
00062     {
00063         implementation::MainPage::Current().Navigate(xaml_typename<Scenario5_LaunchedFromSecondaryTile>(), box_value(arguments));
00064     }
00065 }
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario1_TrackPosition.h Source File

  • Geolocation
  • cppwinrt

Scenario1_TrackPosition.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_TrackPosition.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_TrackPosition : Scenario1_TrackPositionT<Scenario1_TrackPosition>
00019     {
00020         Scenario1_TrackPosition();
00021
00022         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         fire_and_forget StartTracking(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00024         void StopTracking(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025
00026     private:
00027         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00028         Windows::Devices::Geolocation::Geolocator m_geolocator{ nullptr };
00029         event_token m_positionChangedToken{};
00030         event_token m_statusChangedToken{};
00031
00032         fire_and_forget OnPositionChanged(Windows::Devices::Geolocation::Geolocator const&, Windows::Devices::Geolocation::PositionChangedEventArgs e);
00033         fire_and_forget OnStatusChanged(Windows::Devices::Geolocation::Geolocator const&, Windows::Devices::Geolocation::StatusChangedEventArgs e);
00034         void UpdateLocationData(Windows::Devices::Geolocation::Geoposition const& position);
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario1_TrackPosition : Scenario1_TrackPositionT<Scenario1_TrackPosition, implementation::Scenario1_TrackPosition>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Player.cs Source File

  • LiveDash
  • cs
  • LiveDash

Player.cs

Go to the documentation of this file.
00001 ﻿using LiveDash.Models;
00002 using LiveDash.Util;
00003 using System;
00004 using System.Collections.Generic;
00005 using System.Threading.Tasks;
00006 using Windows.Media.Core;
00007 using Windows.UI.Xaml.Media;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.Web.Http;
00011 using Windows.Storage;
00012
00013 namespace LiveDash
00014 {
00015     /// <summary>
00016     /// This class manages the source buffers (audio and video) and takes
00017     /// care of setting the mse stream source on the media element
00018     /// </summary>
00019     public class Player
00020     {
00021         private MediaElement mediaElement;
00022         private MseStreamSource mse;
00023         private Manifest manifest;
00024         private List<SourceBufferManager> sourceBuffers;
00025         private DispatcherTimer playbackTimer;
00026         private DispatcherTimer manifestReloadTimer;
00027         private bool opened = false;
00028         private bool isPaused = false;
00029         private bool hasLiveOffsetValue;
00030         private TimeSpan liveOffset;
00031
00032         public Player(
00033         MediaElement vid,
00034         MseStreamSource mse,
00035         Manifest manifest)
00036         {
00037             sourceBuffers = new List<SourceBufferManager>();
00038             playbackTimer = new DispatcherTimer();
00039             mediaElement = vid;
00040             this.mse = mse;
00041             this.manifest = manifest;
00042
00043             //Add an audio and video source buffer
00044             AddAudioAndVideoSourceBuffers(this.manifest.GetSelectedPeriod());
00045
00046             if (this.manifest.IsLive && this.manifest.HasMinimumUpdatePeriod)
00047             {
00048                 StartManifestReloadTimer();
00049             }
00050
00051         }
00052
00053
00054         #region properties
00055
00056         public bool HasLiveOffsetValue
00057         {
00058             get { return hasLiveOffsetValue; }
00059
00060             set { hasLiveOffsetValue = value; }
00061         }
00062
00063         public TimeSpan LiveOffset
00064         {
00065             get { return liveOffset; }
00066
00067             set { liveOffset = value; }
00068         }
00069
00070         #endregion
00071         private void AddAudioAndVideoSourceBuffers(Period currentPeriod)
00072         {
00073
00074             var audioStream = currentPeriod.GetAudioStream();
00075             if (audioStream != null)
00076             {
00077                 if (manifest.IsLive)
00078                 {
00079                     sourceBuffers.Add(new LiveSourceBufferManager(Manifest.AudioMimeType, audioStream));
00080                     mediaElement.TransportControls.IsSeekEnabled = false;
00081                 }
00082                 else
00083                 {
00084                     sourceBuffers.Add(new SourceBufferManager(Manifest.AudioMimeType, audioStream));
00085                 }
00086             }
00087
00088             var vidStream = currentPeriod.GetVideoStream();
00089             if (vidStream != null)
00090             {
00091                 if (manifest.IsLive)
00092                 {
00093                     sourceBuffers.Add(new LiveSourceBufferManager(Manifest.VideoMimeType, vidStream));
00094                 }
00095                 else
00096                 {
00097                     sourceBuffers.Add(new SourceBufferManager(Manifest.VideoMimeType, vidStream));
00098                 }
00099             }
00100
00101         }
00102
00103         private void StartManifestReloadTimer()
00104         {
00105             UpdateLiveSourceBuffers();
00106             manifestReloadTimer = new DispatcherTimer();
00107
00108             double minUpdatePeriod = manifest.MinimumUpdatePeriod.TotalSeconds;
00109             if (minUpdatePeriod < Manifest.MinMinimumUpdatePeriod)
00110             {
00111                 manifestReloadTimer.Interval = TimeSpan.FromSeconds(Manifest.MinMinimumUpdatePeriod);
00112             }
00113             else
00114             {
00115                 manifestReloadTimer.Interval = manifest.MinimumUpdatePeriod;
00116             }
00117
00118             manifestReloadTimer.Tick +=
00119             async (sender, e) =>
00120                 {
00121                     await ReloadManifest();
00122                     CheckForMediaPresentationDuration();
00123                     UpdateLiveSourceBuffers();
00124                 };
00125             manifestReloadTimer.Start();
00126         }
00127
00128         private void CheckForMediaPresentationDuration()
00129         {
00130             //Stop reloading the manifest because we know the presentation is about
00131             //to end
00132             if (manifest.HasPresentationDuration
00133                 && manifestReloadTimer != null && manifestReloadTimer.IsEnabled)
00134             {
00135                 manifestReloadTimer.Stop();
00136             }
00137         }
00138
00139         private void UpdateLiveSourceBuffers()
00140         {
00141             foreach (var sourceBuffer in sourceBuffers)
00142             {
00143                 ((LiveSourceBufferManager)sourceBuffer).Manifest = manifest;
00144                 ((LiveSourceBufferManager)sourceBuffer).HandleManifestReload();
00145             }
00146         }
00147
00148         private void UpdateLiveSourceBuffersToLiveEdge()
00149         {
00150             foreach (var sourceBuffer in sourceBuffers)
00151             {
00152                 ((LiveSourceBufferManager)sourceBuffer).Manifest = manifest;
00153                 ((LiveSourceBufferManager)sourceBuffer).GoToLiveEdge();
00154             }
00155         }
00156
00157         private async Task ReloadManifest()
00158         {
00159             try
00160             {
00161                 var sourceUrl = manifest.SourceUrl;
00162                 manifest = new Manifest(sourceUrl);
00163                 var document = await manifest.LoadManifestAsync(sourceUrl);
00164
00165                 DashManifestParser mpdParser = new DashManifestParser(document, ref manifest);
00166                 if (!mpdParser.Parse())
00167                 {
00168 #if DEBUG
00169                     Logger.Log("The Parser failed to parse this mpd");
00170 #endif
00171                     return;
00172                 }
00173             }
00174             catch (Exception e)
00175             {
00176 #if DEBUG
00177                 Logger.Log("Error occured reloading manifest: " + e.Message);
00178 #endif
00179             }
00180         }
00181
00182         internal void Initialize()
00183         {
00184             mediaElement.MediaOpened +=
00185                 (sender1, e1) =>
00186                 {
00187                     UpdateData(mediaElement.Position);
00188                 };
00189
00190             ConfigureMse();
00191
00192             SetLiveOffsetValue();
00193
00194             //  Create our timer - for the web we could use the timerupdate
00195             //  method on the mediaelement but that's not available in XAML
00196             playbackTimer.Interval = TimeSpan.FromSeconds(0.2);
00197             playbackTimer.Tick +=
00198                 (sender, e) =>
00199                 {
00200                     UpdateData(mediaElement.Position);
00201                 };
00202             playbackTimer.Start();
00203
00204             //  Hook up the stream source
00205             mediaElement.SetMediaStreamSource(mse);
00206
00207             mediaElement.CurrentStateChanged += M_mediaElement_CurrentStateChanged;
00208             mediaElement.Play();
00209         }
00210
00211         private void M_mediaElement_CurrentStateChanged(object sender, RoutedEventArgs e)
00212         {
00213             if (mediaElement.CurrentState == MediaElementState.Paused &&
00214                 playbackTimer.IsEnabled)
00215             {
00216                 playbackTimer.Stop();
00217                 isPaused = true;
00218
00219             }
00220             else if (mediaElement.CurrentState == MediaElementState.Playing &&
00221                 isPaused)
00222             {
00223                 if (manifest.IsLive)
00224                 {
00225                     //Do a head request on the current segment to see if it is on the server
00226                     //if not we will skip to live edge
00227                     SearchSegmentIfOutsideBuffer();
00228                 }
00229                 playbackTimer.Start();
00230                 isPaused = false;
00231             }
00232
00233
00234         }
00235
00236         private async void SearchSegmentIfOutsideBuffer()
00237         {
00238             LiveSourceBufferManager vidBuffer = (LiveSourceBufferManager)GetVideoBuffer();
00239             if (vidBuffer == null)
00240             {
00241                 return;
00242             }
00243             MediaSegment segment = vidBuffer.GetNextSegment();
00244             HttpResponseMessage response = await Downloader.SendHeadRequestAsync(new Uri(segment.SegmentUrl));
00245
00246             if (response.StatusCode == HttpStatusCode.NotFound)
00247             {
00248 #if DEBUG
00249                 Logger.Log("Trying to go to Live Edge");
00250 #endif
00251                 GoToLiveEdge();
00252             }
00253         }
00254
00255         internal void ConfigureMse()
00256         {
00257             mse.Opened += M_mse_Opened;
00258
00259             mse.Closed += M_mse_Closed;
00260         }
00261
00262         private void M_mse_Closed(MseStreamSource sender, object args)
00263         {
00264 #if DEBUG
00265             Logger.Log("Closing media source");
00266 #endif
00267             foreach (var sourceBuffer in sourceBuffers)
00268             {
00269                 sourceBuffer.Close();
00270             }
00271
00272         }
00273
00274         private void M_mse_Opened(MseStreamSource sender, object args)
00275         {
00276 #if DEBUG
00277             Logger.Log("Opened Stream Source");
00278 #endif
00279             if (opened)
00280             {
00281                 return;
00282             }
00283             opened = true;
00284             foreach (var sourceBuffer in sourceBuffers)
00285             {
00286                 if (manifest.IsLive)
00287                 {
00288                     mse.Duration = null;
00289                 }
00290                 sourceBuffer.Initialize(mse);
00291             }
00292     }
00293
00294         internal void UpdateData(TimeSpan now)
00295         {
00296             var eos = true;
00297             try
00298             {
00299                 var vidBuffer = GetVideoBuffer();
00300                 var audioBuffer = GetAudioBuffer();
00301
00302                 if (vidBuffer == null && audioBuffer == null)
00303                 {
00304                     throw new InvalidOperationException("Video or Audio buffer is null");
00305                 }
00306                 if (manifest.IsLive)
00307                 {
00308                     UpdateLiveSourceBuffers();
00309                 }
00310
00311                 if (vidBuffer != null && !vidBuffer.IsEndOfStream)
00312                 {
00313                     vidBuffer.UpdateData(now);
00314                     eos = false;
00315                 }
00316
00317                 if (audioBuffer != null && !audioBuffer.IsEndOfStream)
00318                 {
00319                     audioBuffer.UpdateData(now);
00320                     eos = false;
00321                 }
00322                 if (eos)
00323                 {
00324                     if (mse.ReadyState == MseReadyState.Open)
00325                     {
00326 #if DEBUG
00327                         Logger.Log("Calling EndOfStream");
00328 #endif
00329                         mse.EndOfStream(MseEndOfStreamStatus.Success);
00330                     }
00331                 }
00332             }
00333             catch (Exception)
00334             {
00335
00336             }
00337         }
00338
00339         private SourceBufferManager GetAudioBuffer()
00340         {
00341             foreach (var sb in sourceBuffers)
00342             {
00343                 if (sb.IsAudio)
00344                 {
00345                     return sb;
00346                 }
00347             }
00348             return null;
00349         }
00350
00351         private SourceBufferManager GetVideoBuffer()
00352         {
00353             foreach (var sb in sourceBuffers)
00354             {
00355                 if (sb.IsVideo)
00356                 {
00357                     return sb;
00358                 }
00359             }
00360             return null;
00361         }
00362
00363         internal void Close()
00364         {
00365             try
00366             {
00367                 if (manifestReloadTimer != null)
00368                 {
00369                     manifestReloadTimer.Stop();
00370                 }
00371                 sourceBuffers.Clear();
00372                 mse = null;
00373                 playbackTimer.Stop();
00374             }
00375             catch (Exception e)
00376             {
00377 #if DEBUG
00378                 Logger.Log("Exception has been thrown: " + e.Message);
00379 #endif
00380             }
00381         }
00382
00383         internal async void GoToLiveEdge()
00384         {
00385             await ReloadManifest();
00386
00387             sourceBuffers.Clear();
00388             mse.EndOfStream(MseEndOfStreamStatus.Success);
00389
00390             opened = false;
00391             mse = new MseStreamSource();
00392             AddAudioAndVideoSourceBuffers(manifest.GetSelectedPeriod());
00393
00394             SetLiveOffsetValue();
00395
00396             ConfigureMse();
00397             mediaElement.SetMediaStreamSource(mse);
00398
00399             CheckForMediaPresentationDuration();
00400             UpdateLiveSourceBuffersToLiveEdge();
00401             mediaElement.Play();
00402         }
00403
00404         internal void SetLiveOffsetValue()
00405         {
00406             if (HasLiveOffsetValue)
00407             {
00408                 var hnsdesiredLiveOffset = (ulong)(liveOffset.TotalMilliseconds * 10000); //hns
00409                 foreach (var sourcebuffer in sourceBuffers)
00410                 {
00411                     ((LiveSourceBufferManager)sourcebuffer).DesiredLiveOffset = hnsdesiredLiveOffset;
00412                 }
00413             }
00414         }
00415
00416     }
00417 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario6DisablePreview.xaml.h Source File

  • Printing
  • cpp

Scenario6DisablePreview.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario6DisablePreview.g.h"
00006 #include "PrintHelper.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// This class customizes the standard PrintHelper in order to disable print preview.
00012     /// </summary>
00013     /// <remarks>
00014     /// The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order
00015     /// to disable print preview.
00016     /// Since print preview is disabled, the Paginate event will not be raised.
00017     /// Instead, the pages to be printed are generated in response to the AddPages event.
00018     /// </remarks>
00019     ref class PreviewOptionsPrintHelper sealed : public PrintHelper
00020     {
00021     public:
00022         PreviewOptionsPrintHelper(Page^ scenarioPage) : PrintHelper(scenarioPage) { }
00023
00024     protected:
00025         /// <summary>
00026         /// This is the event handler for PrintManager.PrintTaskRequested.
00027         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline.
00028         /// Therefore, we use this handler to only create the print task.
00029         /// The print settings customization can be done when the print document source is requested.
00030         /// </summary>
00031         /// <param name="sender">PrintManager</param>
00032         /// <param name="e">PrintTaskRequestedEventArgs</param>
00033         virtual void PrintTaskRequested(Windows::Graphics::Printing::PrintManager^ sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^ e) override;
00034
00035         /// <summary>
00036         /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00037         /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00038         /// into a pages that the Windows print system can deal with.
00039         /// </summary>
00040         /// <param name="sender"></param>
00041         /// <param name="e">Add page event arguments containing a print task options reference</param>
00042         virtual void AddPrintPages(Object^ sender, AddPagesEventArgs^ e) override;
00043
00044         /// <summary>
00045         /// This function creates and adds one print page to the internal cache of print preview
00046         /// pages stored in m_printPages.
00047         /// </summary>
00048         /// <param name="lastRTBOAdded">Last RichTextBlockOverflow element added in the current content</param>
00049         /// <param name="printPageDescription">Printer's page description</param>
00050         RichTextBlockOverflow^ PreviewOptionsPrintHelper::AddOnePrintPage(RichTextBlockOverflow^ lastRTBOAdded, Windows::Graphics::Printing::PrintPageDescription printPageDescription);
00051
00052     private:
00053         /// <summary>
00054         /// A list of UIElements used to store the print pages.  This gives easy access
00055         /// to any desired print page.
00056         /// </summary>
00057         std::vector<UIElement^> m_printPages;
00058
00059     };
00060
00061     /// <summary>
00062     /// Scenario that demos how to disable the print preview in the Modern Print Dialog window.
00063     /// </summary>
00064     [Windows::Foundation::Metadata::WebHostHidden]
00065     public ref class Scenario6DisablePreview sealed
00066     {
00067     public:
00068         Scenario6DisablePreview();
00069
00070
00071     protected:
00072         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00073         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00074
00075     private:
00076         PrintHelper^ printHelper;
00077         void OnPrintButtonClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00078     };
00079 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario2_Icons.xaml.h Source File

  • XamlCommanding
  • cpp

Scenario2_Icons.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include "Scenario2_Icons.g.h"
00014
00015 namespace SDKTemplate
00016 {
00017     /// <summary>
00018     /// An empty page that can be used on its own or navigated to within a Frame.
00019     /// </summary>
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario2_Icons sealed
00022     {
00023     public:
00024         Scenario2_Icons();
00025     };
00026 }
Generated on Fri Nov 15 2024 22:22:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_MultipleDrawers Member List

This is the complete list of members for Scenario3_MultipleDrawers, including all inherited members.
CashDrawerInstance enum name | Scenario3_MultipleDrawers | [private]
cashDrawerInstance1 | Scenario3_MultipleDrawers | [private]
cashDrawerInstance2 | Scenario3_MultipleDrawers | [private]
ClaimButton1_Click(object sender, RoutedEventArgs e) | Scenario3_MultipleDrawers | [inline, private]
ClaimButton2_Click(object sender, RoutedEventArgs e) | Scenario3_MultipleDrawers | [inline, private]
ClaimCashDrawer(CashDrawerInstance instance) | Scenario3_MultipleDrawers | [inline, private]
claimedCashDrawerInstance1 | Scenario3_MultipleDrawers | [private]
claimedCashDrawerInstance1_ReleaseDeviceRequested(ClaimedCashDrawer sender, object e) | Scenario3_MultipleDrawers | [inline, private]
claimedCashDrawerInstance2 | Scenario3_MultipleDrawers | [private]
claimedCashDrawerInstance2_ReleaseDeviceRequested(ClaimedCashDrawer drawer, object e) | Scenario3_MultipleDrawers | [inline, private]
CreateDefaultCashDrawerObject(CashDrawerInstance instance) | Scenario3_MultipleDrawers | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_MultipleDrawers | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_MultipleDrawers | [inline, protected]
ReleaseButton1_Click(object sender, RoutedEventArgs e) | Scenario3_MultipleDrawers | [inline, private]
ReleaseButton2_Click(object sender, RoutedEventArgs e) | Scenario3_MultipleDrawers | [inline, private]
ResetScenarioState() | Scenario3_MultipleDrawers | [inline, private]
rootPage | Scenario3_MultipleDrawers | [private]
Scenario3_MultipleDrawers() | Scenario3_MultipleDrawers | [inline]
SetClaimedUI(CashDrawerInstance instance) | Scenario3_MultipleDrawers | [inline, private]
SetReleasedUI(CashDrawerInstance instance) | Scenario3_MultipleDrawers | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/RemoveGroup/ByGroup/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • RemoveGroup
  • ByGroup

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.Toasts.ToastNotificationManagerHistory.RemoveGroup.ByGroup
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         private static readonly string TAG_1 = "tag1";
00016         private static readonly string TAG_2 = "tag2";
00017         private static readonly string TAG_3 = "tag3";
00018
00019         private static readonly string GROUP_1 = "group1";
00020         private static readonly string GROUP_2 = "group2";
00021
00022         public ScenarioElement()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00028         {
00029             Initialize();
00030         }
00031
00032         private void Initialize()
00033         {
00034             // Clear all existing notifications
00035             ToastNotificationManager.History.Clear();
00036
00037             // Pop the toasts
00038             ToastHelper.PopToast("Group 1, Toast 1 - TO BE REMOVED", "This is the first toast in group one", TAG_1, GROUP_1);
00039             ToastHelper.PopToast("Group 1, Toast 2 - TO BE REMOVED", "This is the second toast in group one", TAG_2, GROUP_1);
00040             ToastHelper.PopToast("Group 1, Toast 3 - TO BE REMOVED", "This is the third toast in group one", TAG_3, GROUP_1);
00041
00042             ToastHelper.PopToast("Group 2, Toast 1", "This is the first toast in group two", TAG_1, GROUP_2);
00043             ToastHelper.PopToast("Group 2, Toast 2", "This is the second toast in group two", TAG_2, GROUP_2);
00044         }
00045
00046         private void ButtonRemoveGroup1_Click(object sender, RoutedEventArgs e)
00047         {
00048             ToastNotificationManager.History.RemoveGroup(GROUP_1);
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DistanceFieldRenderer.h Source File

  • HolographicTagAlong
  • cpp
  • Content

DistanceFieldRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "common\DeviceResources.h"
00015
00016 namespace HolographicTagAlongSample
00017 {
00018     class DistanceFieldRenderer
00019     {
00020     public:
00021         DistanceFieldRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources, unsigned int const& textureWidth, unsigned int const& textureHeight);
00022
00023         void RenderDistanceField(ID3D11ShaderResourceView* texture);
00024
00025         void CreateDeviceDependentResources();
00026         void ReleaseDeviceDependentResources();
00027
00028         ID3D11ShaderResourceView*   GetTexture()        const { return m_shaderResourceView.Get();  };
00029         unsigned int const&         GetRenderCount()    const { return m_renderCount;               };
00030
00031     private:
00032         // Cached pointer to device resources.
00033         const std::shared_ptr<DX::DeviceResources>          m_deviceResources;
00034
00035         // Direct3D resources for filtering a texture to an off-screen render target.
00036         Microsoft::WRL::ComPtr<ID3D11InputLayout>           m_inputLayout;
00037         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_vertexBuffer;
00038         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_indexBuffer;
00039         Microsoft::WRL::ComPtr<ID3D11VertexShader>          m_vertexShader;
00040         Microsoft::WRL::ComPtr<ID3D11PixelShader>           m_pixelShader;
00041         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_texture;
00042         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_shaderResourceView;
00043         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>      m_d3dDepthStencilView;
00044         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>      m_renderTargetView;
00045
00046         // CPU-based variables for configuring the offscreen render target.
00047         const UINT                                          m_textureWidth;
00048         const UINT                                          m_textureHeight;
00049
00050         // System resources for quad geometry.
00051         uint32                                              m_indexCount        = 0;
00052         uint32                                              m_vertexStride      = 0;
00053
00054         // Variables used with the rendering loop.
00055         bool                                                m_loadingComplete   = false;
00056         unsigned int                                        m_renderCount       = 0;
00057     };
00058 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SceneComposer::ShapeObject Member List

This is the complete list of members for SceneComposer::ShapeObject, including all inherited members.
_shape | SceneComposer::ShapeObject | [private]
getShape() | SceneComposer::ShapeObject | [inline]
getType() | SceneComposer::ShapeObject | [inline, virtual]
ShapeObject(Shape s) | SceneComposer::ShapeObject | [inline]
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/SampleConfiguration.cpp Source File

  • Projection
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKSample;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Start projecting", "SDKSample.Scenario1" },
00021     { "Select projector and project", "SDKSample.Scenario2" },
00022     { "Custom display selection and project", "SDKSample.Scenario3" },
00023 };
00024
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/Scenario1_Enable.cpp Source File

  • DisablingScreenCapture
  • cppwinrt

Scenario1_Enable.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Enable.h"
00014 #include "Scenario1_Enable.g.cpp"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     Scenario1_Enable::Scenario1_Enable()
00019     {
00020         InitializeComponent();
00021     }
00022 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/SetCardData.xaml.cs Source File

  • Nfc
  • Nfc

SetCardData.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Iso7816;
00013 using SDKTemplate;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Threading.Tasks;
00018 using Windows.Devices.SmartCards;
00019 using Windows.Security.Cryptography;
00020 using Windows.Security.Cryptography.DataProtection;
00021 using Windows.Storage.Streams;
00022 using Windows.UI.Xaml.Controls;
00023 using static NfcSample.NfcUtils;
00024
00025 namespace NfcSample
00026 {
00027     public sealed partial class SetCardDataScenario : Page
00028     {
00029         private static readonly byte[] AID_PPSE =
00030         {
00031             // File name "2PAY.SYS.DDF01" (14 bytes)
00032             (byte)'2', (byte)'P', (byte)'A', (byte)'Y', (byte)'.',
00033             (byte)'S', (byte)'Y', (byte)'S', (byte)'.',
00034             (byte)'D', (byte)'D', (byte)'F', (byte)'0', (byte)'1'
00035         };
00036
00037         private static readonly byte[] AID_V =
00038         {
00039             0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10
00040         };
00041
00042         private static readonly byte[] AID_MC =
00043         {
00044             0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10
00045         };
00046
00047         private static readonly byte[] AID_NONPAYMENT =
00048         {
00049             0x12, 0x34, 0x56, 0x78, 0x90
00050         };
00051
00052         public SetCardDataScenario()
00053         {
00054             this.InitializeComponent();
00055         }
00056
00057         public async Task<IBuffer> ProtectDataAsync(
00058             byte[] data,
00059             String strDescriptor)
00060         {
00061             // Create a DataProtectionProvider object for the specified descriptor.
00062             DataProtectionProvider Provider = new DataProtectionProvider(strDescriptor);
00063
00064             // Encrypt the message.
00065             return await Provider.ProtectAsync(CryptographicBuffer.CreateFromByteArray(data));
00066         }
00067
00068         private byte[] BuildReadRecordResponseV(string track2, string cardholderName, string track1Discretionary)
00069         {
00070             if (track2.Length % 2 != 0)
00071             {
00072                 track2 += "F";
00073             }
00074
00075             return new TlvEntry(0x70, new TlvEntry[] {
00076                 new TlvEntry(0x57, NfcUtils.HexStringToBytes(track2)),
00077                 new TlvEntry(0x5F20, cardholderName),
00078                 new TlvEntry(0x9F1F, track1Discretionary),
00079                 }).GetData(0x9000);
00080         }
00081
00082         private byte[] BuildReadRecordResponseMC(string pan, string exp, string serviceCode, string cardholderName, string track1Discretionary, string track2Discretionary)
00083         {
00084             var track1 = "B" + pan + "^" + cardholderName + "^" + exp + serviceCode + track1Discretionary;
00085             var track2 = pan + "D" + exp + serviceCode + track2Discretionary;
00086             if (track2.Length % 2 != 0)
00087             {
00088                 track2 += "F";
00089             }
00090
00091             return new TlvEntry(0x70, new TlvEntry[] {
00092                 // Magstripe version
00093                 new TlvEntry(0x9F6C, new byte[] { 0x00, 0x01 }),
00094
00095                 // Track 1 data
00096                 new TlvEntry(0x56, System.Text.Encoding.UTF8.GetBytes(track1)),
00097
00098                 // Track 1 bit map for CVC3
00099                 new TlvEntry(0x9F62,  new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E }),
00100
00101                 // Track 1 bit map for UN and ATC
00102                 new TlvEntry(0x9F63, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }),
00103
00104                 // Track 1 number of ATC digits
00105                 new TlvEntry(0x9F64, new byte[] { 0x00 }),
00106
00107                 // Track 2 data
00108                 new TlvEntry(0x9F6B, NfcUtils.HexStringToBytes(track2)),
00109
00110                 // Track 2 bit map for CVC3
00111                 new TlvEntry(0x9F65, new byte[] { 0x00, 0x0E }),
00112
00113                 // Track 2 bit map for UN and ATC
00114                 new TlvEntry(0x9F66,  new byte[] { 0x00, 0x00 }),
00115
00116                 // Track 2 number of ATC digits
00117                 new TlvEntry(0x9F67, new byte[] { 0x00 }),
00118
00119                 // Magstripe CVM list
00120                 new TlvEntry(0x9F68, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x03, 0x42, 0x03, 0x1F, 0x03 }),
00121                 }).GetData(0x9000);
00122         }
00123
00124         private void btnCancel_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00125         {
00126             this.Frame.GoBack();
00127         }
00128
00129         private async void btnAddCard_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00130         {
00131             // Clear the messages
00132             MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
00133
00134             // Register the AID/applet IDs that this application will handle for our particular card(s)
00135             SmartCardAppletIdGroupRegistration reg;
00136
00137             if (optUICC.IsChecked ?? false)
00138             {
00139                 reg = await NfcUtils.RegisterAidGroup(
00140                     txtDisplayName.Text,
00141                     new[] { AID_PPSE.AsBuffer(), AID_V.AsBuffer(), AID_MC.AsBuffer() },
00142                     SmartCardEmulationCategory.Payment,
00143                     SmartCardEmulationType.Uicc,
00144                     (chkAutomaticEnablement.IsChecked ?? false));
00145             }
00146             else if (optNonPayment.IsChecked ?? false)
00147             {
00148                 reg = await NfcUtils.RegisterAidGroup(
00149                     txtDisplayName.Text,
00150                     new[] { AID_NONPAYMENT.AsBuffer() },
00151                     SmartCardEmulationCategory.Other,
00152                     SmartCardEmulationType.Host,
00153                     (chkAutomaticEnablement.IsChecked ?? false));
00154
00155                 var rule1 = new SmartCardAutomaticResponseApdu(NfcUtils.HexStringToBytes("0012AABB").AsBuffer(), NfcUtils.HexStringToBytes("AABBCCDDEE9000").AsBuffer());
00156                 rule1.AppletId = AID_NONPAYMENT.AsBuffer();
00157                 await reg.SetAutomaticResponseApdusAsync(new List<SmartCardAutomaticResponseApdu>() { rule1 });
00158             }
00159             else
00160             {
00161                 var aid = (optV.IsChecked ?? false) ? AID_V : AID_MC;
00162                 var aidBuffer = aid.AsBuffer();
00163                 reg = await NfcUtils.RegisterAidGroup(
00164                     txtDisplayName.Text,
00165                     new[] { AID_PPSE.AsBuffer(), aidBuffer },
00166                     SmartCardEmulationCategory.Payment,
00167                     SmartCardEmulationType.Host,
00168                     (chkAutomaticEnablement.IsChecked ?? false));
00169
00170                 var rules = new List<SmartCardAutomaticResponseApdu>();
00171
00172                 // Construct SELECT PPSE response and set as auto responder
00173                 rules.Add(new SmartCardAutomaticResponseApdu(
00174                     new SelectCommand(AID_PPSE, 0x00).GetBuffer(),
00175                     new TlvEntry(0x6F, new TlvEntry[]
00176                     {
00177                         new TlvEntry(0x84, "2PAY.SYS.DDF01"),
00178                         new TlvEntry(0xA5, new TlvEntry[]
00179                         {
00180                             new TlvEntry(0xBF0C,
00181                                 new TlvEntry(0x61, new TlvEntry[]
00182                                 {
00183                                     new TlvEntry(0x4F, aidBuffer),
00184                                     new TlvEntry(0x87, new byte[] { 0x01 })
00185                                 }))
00186                         })
00187                     }).GetData(0x9000).AsBuffer()));
00188
00189                 if (optV.IsChecked ?? false)
00190                 {
00191                     rules.Add(new SmartCardAutomaticResponseApdu(
00192                         new SelectCommand(aid, 0x00).GetBuffer(),
00193                         new TlvEntry(0x6F, new TlvEntry[]
00194                         {
00195                             new TlvEntry(0x84, aidBuffer),
00196                             new TlvEntry(0xA5, new TlvEntry[]
00197                             {
00198                                 new TlvEntry(0x50, "CREDIT CARD"),
00199                                 new TlvEntry(0x9F38, new byte[] { 0x9F, 0x66, 0x02 })
00200                             })
00201                         }).GetData(0x9000).AsBuffer()));
00202
00203                     var ruleGpo = new SmartCardAutomaticResponseApdu(
00204                         NfcUtils.HexStringToBytes("80A80000").AsBuffer(),
00205                         new TlvEntry(0x80, new byte[] { 0x00, 0x80, 0x08, 0x01, 0x01, 0x00 }).GetData(0x9000).AsBuffer());
00206                     ruleGpo.AppletId = aidBuffer;
00207                     ruleGpo.ShouldMatchLength = false;
00208                     rules.Add(ruleGpo);
00209                 }
00210                 else
00211                 {
00212                     rules.Add(new SmartCardAutomaticResponseApdu(
00213                         new SelectCommand(aid, 0x00).GetBuffer(),
00214                         new TlvEntry(0x6F, new TlvEntry[]
00215                         {
00216                             new TlvEntry(0x84, aidBuffer),
00217                             new TlvEntry(0xA5, new TlvEntry[]
00218                             {
00219                                 new TlvEntry(0x50, "CREDIT CARD")
00220                             })
00221                         }).GetData(0x9000).AsBuffer()));
00222
00223                     var ruleGpo = new SmartCardAutomaticResponseApdu(
00224                         NfcUtils.HexStringToBytes("80A80000").AsBuffer(),
00225                         new TlvEntry(0x77, new TlvEntry[]
00226                         {
00227                             new TlvEntry(0x82, new byte[] { 0x00, 0x00 }),
00228                             new TlvEntry(0x94, new byte[] { 0x08, 0x01, 0x01, 0x00 }),
00229                             new TlvEntry(0xD7, new byte[] { 0x00, 0x00, 0x80 })
00230                         }).GetData(0x9000).AsBuffer());
00231                     ruleGpo.AppletId = aidBuffer;
00232                     ruleGpo.ShouldMatchLength = false;
00233                     rules.Add(ruleGpo);
00234                 }
00235
00236                 byte[] record;
00237                 if (optV.IsChecked ?? false)
00238                 {
00239                     var track2 = txtPAN.Text + "D" + txtExpiryYear.Text + txtExpiryMonth.Text + txtServiceCode.Text + txtTrack2Discretionary.Text;
00240                     record = BuildReadRecordResponseV(track2, txtCardholderName.Text, txtTrack1Discretionary.Text);
00241                 }
00242                 else
00243                 {
00244                     record = BuildReadRecordResponseMC(txtPAN.Text, txtExpiryYear.Text + txtExpiryMonth.Text, txtServiceCode.Text, txtCardholderName.Text, txtTrack1Discretionary.Text, txtTrack2Discretionary.Text);
00245                 }
00246
00247                 var encryptedRecord = await ProtectDataAsync(record, "LOCAL=user");
00248
00249                 var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("ReadRecordResponse-" + reg.Id.ToString("B") + ".dat", Windows.Storage.CreationCollisionOption.ReplaceExisting);
00250                 await Windows.Storage.FileIO.WriteBufferAsync(file, encryptedRecord);
00251
00252                 await reg.SetAutomaticResponseApdusAsync(rules);
00253             }
00254
00255             LogMessage("Card data saved", NotifyType.StatusMessage);
00256             this.Frame.GoBack();
00257         }
00258
00259         private void optCardTypeGroup_CheckedUnchecked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00260         {
00261             if (stackPayment != null)
00262             {
00263                 if (optNonPayment != null && (optNonPayment.IsChecked ?? false))
00264                 {
00265                     txtDisplayName.Text = "Sample Other/Non-Payment Card";
00266                     stackPayment.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00267                 }
00268                 else if (optUICC != null && (optUICC.IsChecked ?? false))
00269                 {
00270                     txtDisplayName.Text = "Sample UICC Payment Card";
00271                     stackPayment.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00272                 }
00273                 else
00274                 {
00275                     txtDisplayName.Text = "Sample Payment Card";
00276                     stackPayment.Visibility = Windows.UI.Xaml.Visibility.Visible;
00277                 }
00278             }
00279         }
00280     }
00281 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameHud.h Source File

  • Simple3DGameDX
  • cppwinrt

GameHud.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // GameHud:
00015 // This class maintains the resources necessary to draw the Heads Up Display, which is a
00016 // 2D overlay on top of the main 3D graphics generated for the game.
00017 // The GameHud Render method expects to be called within the context of a D2D BeginDraw
00018 // and makes D2D drawing calls to draw the text elements on the window.
00019
00020 #include "DeviceResources.h"
00021 #include "Simple3DGame.h"
00022
00023 class GameHud
00024 {
00025 public:
00026     GameHud(
00027         _In_ std::shared_ptr<DX::DeviceResources> const& deviceResources,
00028         _In_ winrt::hstring const& titleHeader,
00029         _In_ winrt::hstring const& titleBody
00030         );
00031     GameHud(GameHud const&) = delete;
00032     void operator=(GameHud const&) = delete;
00033
00034     void CreateDeviceDependentResources();
00035     void CreateWindowSizeDependentResources();
00036     void ReleaseDeviceDependentResources();
00037     void Render(_In_ std::shared_ptr<Simple3DGame> const& game);
00038
00039 private:
00040     // Cached pointer to device resources.
00041     std::shared_ptr<DX::DeviceResources> m_deviceResources;
00042
00043     winrt::com_ptr<ID2D1SolidColorBrush> m_textBrush;
00044     winrt::com_ptr<IDWriteTextFormat>    m_textFormatBody;
00045     winrt::com_ptr<IDWriteTextFormat>    m_textFormatBodySymbol;
00046
00047     winrt::com_ptr<IDWriteTextFormat>    m_textFormatTitleHeader;
00048     winrt::com_ptr<IDWriteTextFormat>    m_textFormatTitleBody;
00049     winrt::com_ptr<ID2D1Bitmap>          m_logoBitmap;
00050     winrt::com_ptr<IDWriteTextLayout>    m_titleHeaderLayout;
00051     winrt::com_ptr<IDWriteTextLayout>    m_titleBodyLayout;
00052
00053     bool                                 m_showTitle;
00054     winrt::hstring                       m_titleHeader;
00055     winrt::hstring                       m_titleBody;
00056
00057     float                                m_titleBodyVerticalOffset;
00058     D2D1_SIZE_F                          m_logoSize;
00059     D2D1_SIZE_F                          m_maxTitleSize;
00060 };
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/pch.h Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <wrl\event.h>
00008 #include <wrl\implements.h>
00009 #include <wrl\wrappers\corewrappers.h>
00010 #include <collection.h>
00011 #include <ppltasks.h>
00012
00013 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/SampleConfiguration.cpp Source File

  • LampArray
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015
00016 using namespace winrt;
00017 using namespace winrt::SDKTemplate;
00018 using namespace winrt::Windows::Devices::Lights;
00019 using namespace winrt::Windows::Foundation::Collections;
00020
00021 std::wstring std::to_wstring(LampArrayKind lampArrayKind)
00022 {
00023     switch (lampArrayKind)
00024     {
00025     case LampArrayKind::Keyboard:
00026         return L"Keyboard";
00027     case LampArrayKind::Mouse:
00028         return L"Mouse";
00029     case LampArrayKind::GameController:
00030         return L"Game Controller";
00031     case LampArrayKind::Peripheral:
00032         return L"Peripheral";
00033     case LampArrayKind::Scene:
00034         return L"Scene";
00035     case LampArrayKind::Notification:
00036         return L"Notification";
00037     case LampArrayKind::Chassis:
00038         return L"Chassis";
00039     case LampArrayKind::Wearable:
00040         return L"Wearable";
00041     case LampArrayKind::Furniture:
00042         return L"Furniture";
00043     case LampArrayKind::Art:
00044         return L"Art";
00045     case LampArrayKind::Undefined:
00046     default:
00047         // Additional lamp array kinds can be looked up in the USB HID specification.
00048         return std::to_wstring(static_cast<uint32_t>(lampArrayKind));
00049     }
00050 }
00051
00052 hstring implementation::MainPage::FEATURE_NAME()
00053 {
00054     return L"LampArray C++/WinRT Sample";
00055 }
00056
00057 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00058 {
00059     Scenario{ L"LampArray Basics", xaml_typename<SDKTemplate::Scenario1_Basics>() },
00060     Scenario{ L"LampArray Effects", xaml_typename<SDKTemplate::Scenario2_Effects>() },
00061 });
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/SampleConfiguration.cs Source File

  • Altimeter
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Altimeter";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Data Events", ClassType = typeof(Scenario1_DataEvents) },
00025             new Scenario() { Title = "Polling", ClassType = typeof(Scenario2_Polling) }
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Transparent/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Transparent

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI;
00003 using Windows.UI.StartScreen;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.LiveTiles.BasicState.BackgroundColor.Transparent
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private string _tileId;
00022
00023         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00024         {
00025             base.IsEnabled = false;
00026
00027             _tileId = DateTime.Now.Ticks.ToString();
00028
00029             SecondaryTile tile = new SecondaryTile(_tileId, "Transparent", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
00030             tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00031             tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00032             tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00033             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00034             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00035             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00036             tile.VisualElements.BackgroundColor = Colors.Transparent;
00037             await tile.RequestCreateAsync();
00038
00039             base.IsEnabled = true;
00040         }
00041     }
00042 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3 Member List

This is the complete list of members for Scenario3, including all inherited members.
AddLogFileMessageDispatch(string message, string path) | Scenario3 | [inline]
AddMessage(string message) | Scenario3 | [inline]
AddMessageDispatch(string message) | Scenario3 | [inline]
addXamlChildrenButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
AllItems | Scenario3 |
AnimatedSwitch_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
animationTask | Scenario3 | [private]
ColorSpaceProperty | Scenario3 | [private]
CopyrightProperty | Scenario3 | [private]
CreateHeaderTextBlock(string contents) | Scenario3 | [inline, private]
CreateLineItemTextBlock(string contents) | Scenario3 | [inline, private]
Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario3 | [inline, private]
DeleteMenuItem_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
DoScenario(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
EnableDisableLogging(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
ErasingModeCheckBox_Checked(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
ErasingModeCheckBox_Unchecked(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
Fade_Completed(object sender, object e) | Scenario3 | [inline, private]
FadeOutContents() | Scenario3 | [inline, private]
fadeOutStoryboard | Scenario3 | [private]
FillComboBox() | Scenario3 | [inline, private]
Find_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
FindScrollViewer(DependencyObject depObject) | Scenario3 | [inline, private]
GetDataModelForCurrentListViewFlyout() | Scenario3 | [inline, private]
GetDependencies_Click(Object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
GetFilesButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
GetPicturesLibrary() | Scenario3 | [inline, private]
GetPropertyDisplayValue(object property) | Scenario3 | [inline, private]
GetThumbnailButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) | Scenario3 | [inline, private]
InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) | Scenario3 | [inline, private]
lastFadeOutTime | Scenario3 | [private]
ListView_ContextCanceled(UIElement sender, RoutedEventArgs args) | Scenario3 | [inline, private]
ListView_ContextRequested(UIElement sender, ContextRequestedEventArgs e) | Scenario3 | [inline, private]
LoggingScenario | Scenario3 | [private]
LoggingScenario_StatusChanged(object sender, LoggingScenarioEventArgs e) | Scenario3 | [inline, private]
mapItemButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
minPenSize | Scenario3 | [private]
mpiLogger | Scenario3 | [private]
msLogger | Scenario3 | [private]
MyMap_Loaded(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnClear(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnLoadAsync(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario3 | [inline, protected]
OnPenColorChanged(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnPenThicknessChanged(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnPenTypeChanged(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnSaveAsync(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario3 | [inline, private]
OpenMenuItem_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
penSize | Scenario3 | [private]
penSizeIncrement | Scenario3 | [private]
picturesLibrary | Scenario3 | [private]
PrintMenuItem_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
ReadTextButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
RemoveFolderButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
rootPage | Scenario3 | [private]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3() | Scenario3 | [inline]
Scenario3Button_Show_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
sharedFlyout | Scenario3 | [private]
TIMEOUT_LENGTH | Scenario3 | [private]
TouchInkingCheckBox_Checked(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
TouchInkingCheckBox_Unchecked(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
Tts_Resolved(TimedTextSource sender, TimedTextSourceResolveResultEventArgs args) | Scenario3 | [inline, private]
ttsMap | Scenario3 | [private]
UpdateControls() | Scenario3 | [inline, private]
UpdateControls() | Scenario3 | [inline, private]
WriteTextButton_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_UTF8 Member List

This is the complete list of members for Scenario1_UTF8, including all inherited members.
AppendOutputLine(string value) | Scenario1_UTF8 | [inline, private]
busy | Scenario1_UTF8 | [private]
CloseSocket() | Scenario1_UTF8 | [inline, private]
ConnectAsync() | Scenario1_UTF8 | [inline, private]
MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args) | Scenario1_UTF8 | [inline, private]
messageWebSocket | Scenario1_UTF8 | [private]
messageWriter | Scenario1_UTF8 | [private]
OnClosed(IWebSocket sender, WebSocketClosedEventArgs args) | Scenario1_UTF8 | [inline, private]
OnConnect(object sender, RoutedEventArgs args) | Scenario1_UTF8 | [inline, private]
OnDisconnect(object sender, RoutedEventArgs args) | Scenario1_UTF8 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_UTF8 | [inline, protected]
OnSend(object sender, RoutedEventArgs args) | Scenario1_UTF8 | [inline, private]
OnServerCustomValidationRequested(MessageWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args) | Scenario1_UTF8 | [inline, private]
rootPage | Scenario1_UTF8 | [private]
Scenario1_UTF8() | Scenario1_UTF8 | [inline]
SendAsync() | Scenario1_UTF8 | [inline, private]
SetBusy(bool value) | Scenario1_UTF8 | [inline, private]
UpdateVisualState() | Scenario1_UTF8 | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario3_Transliteration.h Source File

  • LinguisticServices
  • cppwinrt

Scenario3_Transliteration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Transliteration.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3_Transliteration : Scenario3_TransliterationT<Scenario3_Transliteration>
00020     {
00021         Scenario3_Transliteration();
00022
00023         void Go_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024     };
00025 }
00026
00027 namespace winrt::SDKTemplate::factory_implementation
00028 {
00029     struct Scenario3_Transliteration : Scenario3_TransliterationT<Scenario3_Transliteration, implementation::Scenario3_Transliteration>
00030     {
00031     };
00032 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/SampleConfiguration.cs Source File

  • VideoPlayback
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Video Playback";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title= "Playing videos", ClassType=typeof(Scenario1)},
00025             new Scenario() { Title= "Displaying in-band closed captions (MKV)", ClassType=typeof(Scenario2)},
00026             new Scenario() { Title= "Displaying out-of-band closed captions (MP4+SRT)", ClassType=typeof(Scenario3)},
00027             new Scenario() { Title= "Selecting video tracks", ClassType=typeof(Scenario4)},
00028             new Scenario() { Title= "Selecting audio tracks", ClassType=typeof(Scenario5)},
00029             new Scenario() { Title= "Playing video lists", ClassType=typeof(Scenario6)},
00030             new Scenario() { Title= "Playing on a composition surface", ClassType=typeof(Scenario7)},
00031             new Scenario() { Title= "Transferring a MediaPlayer 1", ClassType=typeof(Scenario8_TransferMediaPlayer1)},
00032             new Scenario() { Title= "Transferring a MediaPlayer 2", ClassType=typeof(Scenario9_TransferMediaPlayer2)},
00033         };
00034
00035         public Windows.Media.Playback.MediaPlayer commonMediaPlayer = null;
00036
00037         // These are videos we use in many of our scenarios.
00038         public Uri CaptionedMediaUri { get; } =
00039             new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/elephantsdream-clip-h264_sd-aac_eng-aac_spa-aac_eng_commentary-srt_eng-srt_por-srt_swe.mkv");
00040         public Uri UncaptionedMediaUri { get; } =
00041             new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/elephantsdream-clip-h264_sd-aac_eng-aac_spa-aac_eng_commentary.mp4");
00042         public Uri MultiTrackVideoMediaUri { get; } =
00043             new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multivideo-with-captions.mkv");
00044         public Uri SintelMediaUri { get; } =
00045             new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/sintel_trailer-480p.mp4");
00046     }
00047
00048     public class Scenario
00049     {
00050         public string Title { get; set; }
00051         public Type ClassType { get; set; }
00052     }
00053
00054     /// <summary>
00055     /// Allows for disposal of the underlying MediaSources attached to a MediaPlayer, regardless
00056     /// of if a MediaSource or MediaPlaybackItem was passed to the MediaPlayer.
00057     ///
00058     /// It is left to the app to implement a clean-up of the other possible IMediaPlaybackSource
00059     /// type, which is a MediaPlaybackList.
00060     ///
00061     /// </summary>
00062     public static class MediaPlayerHelper
00063     {
00064         public static void CleanUpMediaPlayerSource(Windows.Media.Playback.MediaPlayer mp)
00065         {
00066             if (mp?.Source != null)
00067             {
00068                 var source = mp.Source as Windows.Media.Core.MediaSource;
00069                 source?.Dispose();
00070
00071                 var item = mp.Source as Windows.Media.Playback.MediaPlaybackItem;
00072                 item?.Source?.Dispose();
00073
00074                 mp.Source = null;
00075             }
00076         }
00077     }
00078 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario02_GetStream.h Source File

  • HttpClient
  • cppwinrt

Scenario02_GetStream.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario02_GetStream.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario02_GetStream : Scenario02_GetStreamT<Scenario02_GetStream>
00020     {
00021         Scenario02_GetStream();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         fire_and_forget Start_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void Cancel_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031         Windows::Web::Http::HttpClient httpClient{ nullptr };
00032         Windows::Foundation::IAsyncAction pendingAction{ nullptr };
00033
00034         Windows::Foundation::IAsyncAction CancelableRequestAsync(Windows::Web::Http::HttpRequestMessage request);
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario02_GetStream : Scenario02_GetStreamT<Scenario02_GetStream, implementation::Scenario02_GetStream>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:19:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomOptionsPrintHelper Member List

This is the complete list of members for CustomOptionsPrintHelper, including all inherited members.
AddOnePrintPreviewPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription) | CustomOptionsPrintHelper | [inline, protected, virtual]
AddPrintPages(object sender, AddPagesEventArgs e) | PrintHelper | [inline, protected, virtual]
ApplicationContentMarginLeft | PrintHelper | [protected]
ApplicationContentMarginTop | PrintHelper | [protected]
CreatePrintPreviewPages(object sender, PaginateEventArgs e) | CustomOptionsPrintHelper | [inline, protected, virtual]
CustomOptionsPrintHelper(Page scenarioPage) | CustomOptionsPrintHelper | [inline]
firstPage | PrintHelper | [protected]
GetPrintPreviewPage(object sender, GetPreviewPageEventArgs e) | PrintHelper | [inline, protected, virtual]
imageText | CustomOptionsPrintHelper | [private]
moderateMarginsIconTask | CustomOptionsPrintHelper | [private]
narrowMarginsIconTask | CustomOptionsPrintHelper | [private]
PreparePrintContent(Page page) | PrintHelper | [inline, virtual]
PreviewPagesCreated | PrintHelper | [protected]
PrintCanvas | PrintHelper | [protected]
printDetailedOptions_OptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args) | CustomOptionsPrintHelper | [inline, private]
printDocument | PrintHelper | [protected]
printDocumentSource | PrintHelper | [protected]
PrintHelper(Page scenarioPage) | PrintHelper | [inline]
PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e) | CustomOptionsPrintHelper | [inline, protected, virtual]
RegisterForPrinting() | PrintHelper | [inline, virtual]
scenarioPage | PrintHelper | [protected]
showHeader | CustomOptionsPrintHelper | [private]
ShowImage | CustomOptionsPrintHelper | [private]
ShowPrintUIAsync() | PrintHelper | [inline]
ShowText | CustomOptionsPrintHelper | [private]
UnregisterForPrinting() | PrintHelper | [inline, virtual]
wideMarginsIconTask | CustomOptionsPrintHelper | [private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_UnicodeExtensions Member List

This is the complete list of members for Scenario4_UnicodeExtensions, including all inherited members.
ReportCalendarData(Calendar calendar, string calendarLabel) | Scenario4_UnicodeExtensions | [inline, private]
Scenario4_UnicodeExtensions() | Scenario4_UnicodeExtensions | [inline]
ShowResults_Click(object sender, RoutedEventArgs e) | Scenario4_UnicodeExtensions | [inline, private]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareTarget/cs/SampleConfiguration.cs Source File

  • ShareTarget
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Share target C# sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Welcome", ClassType=typeof(Scenario1_Welcome)},
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035
00036     /// <summary>
00037     /// Provides sample-specific behavior to supplement the default Application class.
00038     /// </summary>
00039     sealed partial class App : Application
00040     {
00041         protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
00042         {
00043             var rootFrame = CreateRootFrame();
00044             rootFrame.Navigate(typeof(ShareTarget), args.ShareOperation);
00045             Window.Current.Activate();
00046         }
00047     }
00048
00049 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario1.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1.xaml.h"
00013 #include "SampleConfiguration.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Core;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Scenario1::Scenario1()
00025 {
00026     InitializeComponent();
00027
00028     // Initialize the InkCanvas
00029     inkCanvas->InkPresenter->InputDeviceTypes =
00030         CoreInputDeviceTypes::Mouse |
00031         CoreInputDeviceTypes::Pen;
00032 }
00033
00034
00035 void Scenario1::OnSizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00036 {
00037     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00038 }
Generated on Fri Nov 15 2024 22:17:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

List< T > Member List

This is the complete list of members for List< T >, including all inherited members.
Back() const | List< T > | [inline, protected]
Clear(FN &clear_fn) | List< T > | [inline]
Clear() | List< T > | [inline, virtual]
EndPosition() const | List< T > | [inline]
Front() const | List< T > | [inline, protected]
FrontPosition() | List< T > | [inline]
GetBack(T *ppItem) | List< T > | [inline]
GetCount() const | List< T > | [inline]
GetFront(T *ppItem) | List< T > | [inline]
GetItem(const Node *pNode, T *ppItem) | List< T > | [inline, protected, virtual]
GetItemPos(POSITION pos, T *ppItem) | List< T > | [inline]
InsertAfter(T item, Node *pBefore) | List< T > | [inline, protected, virtual]
InsertBack(T item) | List< T > | [inline]
InsertFront(T item) | List< T > | [inline]
InsertPos(POSITION pos, T item) | List< T > | [inline]
IsEmpty() const | List< T > | [inline]
List() | List< T > | [inline]
m_anchor | List< T > | [protected]
m_count | List< T > | [protected]
Next(const POSITION pos) | List< T > | [inline]
Remove(POSITION &pos, T *ppItem) | List< T > | [inline]
RemoveBack(T *ppItem) | List< T > | [inline]
RemoveFront(T *ppItem) | List< T > | [inline]
RemoveItem(Node *pNode, T *ppItem) | List< T > | [inline, protected, virtual]
~List() | List< T > | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario5_Msappdata.h Source File

  • ApplicationData
  • cppwinrt

Scenario5_Msappdata.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_Msappdata.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario5_Msappdata : Scenario5_MsappdataT<Scenario5_Msappdata>
00020     {
00021         Scenario5_Msappdata();
00022
00023         fire_and_forget OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const&);
00025
00026     private:
00027         Windows::Foundation::IAsyncAction CopyAssetToFolderIfNecessaryAsync(hstring name, Windows::Storage::StorageFolder const& folder);
00028     };
00029 }
00030
00031 namespace winrt::SDKTemplate::factory_implementation
00032 {
00033     struct Scenario5_Msappdata : Scenario5_MsappdataT<Scenario5_Msappdata, implementation::Scenario5_Msappdata>
00034     {
00035     };
00036 }
00037
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario5.xaml.cpp Source File

  • DatagramSocket
  • cpp

Scenario5.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario5.xaml.h"
00013
00014 using namespace SDKTemplate;
00015 using namespace SDKTemplate::DatagramSocketSample;
00016
00017 using namespace Platform;
00018 using namespace Concurrency;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Networking;
00022 using namespace Windows::Networking::Sockets;
00023 using namespace Windows::Storage::Streams;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Controls::Primitives;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Input;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 Scenario5::Scenario5() :
00034     listenerSocket(nullptr)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 /// <summary>
00040 /// Invoked when this page is about to be displayed in a Frame.
00041 /// </summary>
00042 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043 /// property is typically used to configure the page.</param>
00044 void Scenario5::OnNavigatedTo(NavigationEventArgs^ e)
00045 {
00046     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00047     // as NotifyUser()
00048     rootPage = MainPage::Current;
00049     MulticastRadioButton->IsChecked = true;
00050 }
00051
00052 /// <summary>
00053 /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00054 /// </summary>
00055 /// <param name="e">Event data representative of the navigation that will unload the current Page.</param>
00056 void Scenario5::OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e)
00057 {
00058     CloseListenerSocket();
00059 }
00060
00061 void Scenario5::CloseListenerSocket()
00062 {
00063     if (listenerSocket != nullptr)
00064     {
00065         // DatagramSocket.Close() is exposed through the 'delete' keyword in C++/CX.
00066         // The call below explicitly closes the socket, freeing the UDP port that it is currently bound to.
00067         delete listenerSocket;
00068         listenerSocket = nullptr;
00069     }
00070 }
00071
00072 // Sets up the UI to display the multicast scenario options.
00073 void Scenario5::SetupMulticastScenarioUI()
00074 {
00075     RemoteAddressLabel->Text = "Multicast Group:";
00076     StartListener->Content = "Start listener and join multicast group";
00077     RemoteAddress->Text = "224.3.0.5";
00078     RemoteAddress->IsEnabled = false;
00079     SendMessageButton->IsEnabled = false;
00080     CloseListenerButton->IsEnabled = false;
00081     SendOutput->Text = "";
00082 }
00083
00084 // Sets up the UI to display the broadcast scenario options.
00085 void Scenario5::SetupBroadcastScenarioUI()
00086 {
00087     RemoteAddressLabel->Text = "Broadcast Address:";
00088     StartListener->Content = "Start listener";
00089     RemoteAddress->Text = "255.255.255.255";
00090     RemoteAddress->IsEnabled = false;
00091     SendMessageButton->IsEnabled = false;
00092     CloseListenerButton->IsEnabled = false;
00093     SendOutput->Text = "";
00094 }
00095
00096 void Scenario5::MulticastRadioButton_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00097 {
00098     CloseListenerSocket();
00099     SetupMulticastScenarioUI();
00100 }
00101
00102 void Scenario5::MulticastRadioButton_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00103 {
00104     CloseListenerSocket();
00105     SetupBroadcastScenarioUI();
00106 }
00107
00108 /// <summary>
00109 /// This is the click handler for the 'StartListener' button.
00110 /// </summary>
00111 /// <param name="sender">Object for which the event was generated.</param>
00112 /// <param name="e">Event's parameters.</param>
00113 void Scenario5::StartListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00114 {
00115     if (ServiceName->Text == nullptr)
00116     {
00117         rootPage->NotifyUser("Please provide a service name.", NotifyType::ErrorMessage);
00118         return;
00119     }
00120
00121     if (listenerSocket != nullptr)
00122     {
00123         rootPage->NotifyUser("A listener socket is already set up.", NotifyType::ErrorMessage);
00124         return;
00125     }
00126
00127     bool isMulticastSocket = MulticastRadioButton->IsChecked->Value;
00128     listenerSocket = ref new DatagramSocket();
00129     listenerSocket->MessageReceived += ref new TypedEventHandler<DatagramSocket^, DatagramSocketMessageReceivedEventArgs^>(
00130         this,
00131         &Scenario5::MessageReceived);
00132
00133     if (isMulticastSocket)
00134     {
00135         // DatagramSockets conduct exclusive (SO_EXCLUSIVEADDRUSE) binds by default, effectively blocking
00136         // any other UDP socket on the system from binding to the same local port. This is done to prevent
00137         // other applications from eavesdropping or hijacking a DatagramSocket's unicast traffic.
00138         //
00139         // Setting the MulticastOnly control option to 'true' enables a DatagramSocket instance to share its
00140         // local port with any Win32 sockets that are bound using SO_REUSEADDR/SO_REUSE_MULTICASTPORT and
00141         // with any other DatagramSocket instances that have MulticastOnly set to true. However, note that any
00142         // attempt to use a multicast-only DatagramSocket instance to send or receive unicast data will result
00143         // in an exception being thrown.
00144         //
00145         // This control option is particularly useful when implementing a well-known multicast-based protocol,
00146         // such as mDNS and UPnP, since it enables a DatagramSocket instance to coexist with other applications
00147         // running on the system that also implement that protocol.
00148         listenerSocket->Control->MulticastOnly = true;
00149     }
00150
00151     // Start listen operation.
00152     create_task(listenerSocket->BindServiceNameAsync(ServiceName->Text)).then(
00153         [=](task<void> bindTask)
00154     {
00155         try
00156         {
00157             // Try getting an exception.
00158             bindTask.get();
00159
00160             if (isMulticastSocket)
00161             {
00162                 // Join the multicast group to start receiving datagrams being sent to that group.
00163                 listenerSocket->JoinMulticastGroup(ref new HostName(RemoteAddress->Text));
00164
00165                 rootPage->NotifyUser(
00166                     "Listening on port " + listenerSocket->Information->LocalPort + " and joined to multicast group",
00167                     NotifyType::StatusMessage);
00168             }
00169             else
00170             {
00171                 rootPage->NotifyUser(
00172                     "Listening on port " + listenerSocket->Information->LocalPort,
00173                     NotifyType::StatusMessage);
00174             }
00175
00176             // Enable scenario steps that require us to have an active listening socket.
00177             SendMessageButton->IsEnabled = true;
00178             CloseListenerButton->IsEnabled = true;
00179         }
00180         catch (Exception^ exception)
00181         {
00182             delete listenerSocket;
00183             listenerSocket = nullptr;
00184
00185             rootPage->NotifyUser(
00186                 "Start listening failed with error: " + exception->Message,
00187                 NotifyType::ErrorMessage);
00188         }
00189     });
00190 }
00191
00192 /// <summary>
00193 /// This is the click handler for the 'SendMessage' button.
00194 /// </summary>
00195 /// <param name="sender">Object for which the event was generated.</param>
00196 /// <param name="e">Event's parameters.</param>
00197 void Scenario5::SendMessage_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00198 {
00199     SendOutput->Text = "";
00200     HostName^ remoteHostname = ref new HostName(RemoteAddress->Text);
00201
00202     // GetOutputStreamAsync can be called multiple times on a single DatagramSocket instance to obtain
00203     // IOutputStreams pointing to various different remote endpoints. The remote hostname given to
00204     // GetOutputStreamAsync can be a unicast, multicast or broadcast address.
00205     create_task(listenerSocket->GetOutputStreamAsync(remoteHostname, ServiceName->Text)).then(
00206         [&](task<IOutputStream^> getOutputStreamTask)
00207     {
00208         try
00209         {
00210             // Try getting an exception.
00211             IOutputStream^ outputStream = getOutputStreamTask.get();
00212
00213             // Send out some multicast or broadcast data. Datagrams generated by the IOutputStream will use
00214             // <source host, source port> information obtained from the parent socket (i.e., 'listenSocket' in
00215             // this case).
00216             String^ stringToSend = "Hello";
00217             DataWriter^ writer = ref new DataWriter(outputStream);
00218             writer->WriteString(stringToSend);
00219
00220             create_task(writer->StoreAsync()).then(
00221                 [this, stringToSend](task<unsigned int> writeTask)
00222             {
00223                 try
00224                 {
00225                     // Try getting an exception.
00226                     writeTask.get();
00227                     SendOutput->Text = "\"" + stringToSend + "\" sent successfully";
00228                 }
00229                 catch (Exception^ exception)
00230                 {
00231                     rootPage->NotifyUser("Send failed with error: " + exception->Message, NotifyType::ErrorMessage);
00232                 }
00233             });
00234         }
00235         catch (Exception^ exception)
00236         {
00237             rootPage->NotifyUser("Send failed with error: " + exception->Message, NotifyType::ErrorMessage);
00238         }
00239     });
00240 }
00241
00242 /// <summary>
00243 /// This is the click handler for the 'CloseListener' button.
00244 /// </summary>
00245 /// <param name="sender">Object for which the event was generated.</param>
00246 /// <param name="e">Event's parameters.</param>
00247 void Scenario5::CloseListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00248 {
00249     CloseListenerSocket();
00250
00251     // Disable scenario steps that require us to have an active listening socket.
00252     SendMessageButton->IsEnabled = false;
00253     CloseListenerButton->IsEnabled = false;
00254     SendOutput->Text = "";
00255
00256     rootPage->NotifyUser("Listener closed", NotifyType::StatusMessage);
00257 }
00258
00259 /// <summary>
00260 /// Message received handler
00261 /// </summary>
00262 /// <param name="socket">The socket object</param>
00263 /// <param name="eventArguments">The datagram event information</param>
00264 void Scenario5::MessageReceived(
00265     Windows::Networking::Sockets::DatagramSocket^ socket,
00266     Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ eventArguments)
00267 {
00268     try
00269     {
00270         // Interpret the incoming datagram's entire contents as a string.
00271         unsigned int stringLength = eventArguments->GetDataReader()->UnconsumedBufferLength;
00272         String^ receivedMessage = eventArguments->GetDataReader()->ReadString(stringLength);
00273
00274         NotifyUserFromAsyncThread(
00275             "Received data from remote peer (Remote Address: " +
00276             eventArguments->RemoteAddress->CanonicalName +
00277             ", Remote Port: " +
00278             eventArguments->RemotePort + "): \"" +
00279             receivedMessage + "\"",
00280             NotifyType::StatusMessage);
00281     }
00282     catch (Exception^ exception)
00283     {
00284         rootPage->NotifyUser(
00285             "Error happened when receiving a datagram:" + exception->Message,
00286             NotifyType::ErrorMessage);
00287     }
00288 }
00289
00290 /// <summary>
00291 /// Notifies the user from a non-UI thread
00292 /// </summary>
00293 /// <param name="message">The message</param>
00294 /// <param name="type">The type of notification</param>
00295 void Scenario5::NotifyUserFromAsyncThread(Platform::String^ message, NotifyType type)
00296 {
00297     rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type]()
00298     {
00299         rootPage->NotifyUser(message, type);
00300     }));
00301 }
Generated on Fri Nov 15 2024 22:18:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DynamicCommandBar Member List

This is the complete list of members for DynamicCommandBar, including all inherited members.
ContentMinWidth | DynamicCommandBar |
ContentMinWidthProperty | DynamicCommandBar | [static]
MeasureOverride(Size availableSize) | DynamicCommandBar | [inline, protected]
moreButton | DynamicCommandBar | [private]
OnApplyTemplate() | DynamicCommandBar | [inline, protected]
overflow | DynamicCommandBar | [private]
separatorQueue | DynamicCommandBar | [private]
separatorQueueWidth | DynamicCommandBar | [private]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModelConstantBuffer Member List

This is the complete list of members for ModelConstantBuffer, including all inherited members.
hologramColorFadeMultiplier | ModelConstantBuffer
model | ModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.h Source File

  • MediaTranscoding
  • cpp

Scenario4_AddOverlays.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_AddOverlays.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario4_AddOverlays sealed
00021     {
00022     public:
00023         Scenario4_AddOverlays();
00024
00025     protected:
00026         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027
00028     private:
00029         SDKTemplate::MainPage^ rootPage;
00030         Windows::Media::Editing::MediaComposition^ composition;
00031         Windows::Storage::StorageFile^ baseVideoFile;
00032         Windows::Storage::StorageFile^ overlayVideoFile;
00033         Windows::Media::Core::MediaStreamSource^ mediaStreamSource;
00034
00035         void ChooseVideo_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void AddAudio_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037
00038         void ChooseBaseVideo_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         void ChooseOverlayVideo_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void CreateOverlays();
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.h Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario6_RecoverableErrors.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario6_RecoverableErrors.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario6_RecoverableErrors sealed
00022     {
00023     public:
00024         Scenario6_RecoverableErrors();
00025
00026     protected:
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030         void StartDownload_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031
00032     private:
00033         MainPage^ rootPage = MainPage::Current;
00034
00035         // Scenario instance state.
00036         Windows::Networking::BackgroundTransfer::DownloadOperation^ download;
00037         Concurrency::cancellation_token_source cancellationTokenSource;
00038
00039         //
00040         Concurrency::task<void> CancelActiveDownloadsAsync();
00041         Concurrency::task<void> HandleDownloadAsync();
00042
00043         bool IsWebException(Platform::String^ title, Platform::Exception^ ex);
00044
00045         void OnDownloadProgress(
00046             Windows::Foundation::IAsyncOperationWithProgress<Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^ sender,
00047             Windows::Networking::BackgroundTransfer::DownloadOperation^ progress);
00048     };
00049 }
Generated on Fri Nov 15 2024 22:18:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PresentationFormats Member List

This is the complete list of members for PresentationFormats, including all inherited members.
AbsorbedDoseGray enum value | PresentationFormats |
AbsorbeddoserateGrayPerSecond enum value | PresentationFormats |
AccelerationMetresPerSecondSquared enum value | PresentationFormats |
ActivityReferredToARadioNuclideBecquerel enum value | PresentationFormats |
AmountConcentrationMolePerCubicMetre enum value | PresentationFormats |
AmountOfSubstanceMole enum value | PresentationFormats |
AngularAccelerationRadianPerSecondSquared enum value | PresentationFormats |
AngularVelocityRadianPerSecond enum value | PresentationFormats |
AngularVelocityRevolutionPerminute enum value | PresentationFormats |
AreaBarn enum value | PresentationFormats |
AreaHectare enum value | PresentationFormats |
AreaSquareMetres enum value | PresentationFormats |
BluetoothSigAssignedNumber enum value | PresentationFormats |
CapacitanceFarad enum value | PresentationFormats |
CatalyticActivityConcentrationKatalPerCubicMetre enum value | PresentationFormats |
CatalyticActivityKatal enum value | PresentationFormats |
CelsiusTemperatureDegreeCelsius enum value | PresentationFormats |
ConcentrationCountPerCubicMetre enum value | PresentationFormats |
CurrentDensityAmperePerSquareMetre enum value | PresentationFormats |
DensityKilogramperCubicMetre enum value | PresentationFormats |
Description | PresentationFormats | [static]
DoseEquivalentSievert enum value | PresentationFormats |
DynamicViscosityPascalSecond enum value | PresentationFormats |
ElectricchargeAmpereHours enum value | PresentationFormats |
ElectricChargeCoulomb enum value | PresentationFormats |
ElectricchargeDensityCoulombPerCubicMetre enum value | PresentationFormats |
ElectricConductanceSiemens enum value | PresentationFormats |
ElectricCurrentAmpere enum value | PresentationFormats |
ElectricfieldstrengthVoltPerMetre enum value | PresentationFormats |
ElectricFluxDensityCoulombPerSquareMetre enum value | PresentationFormats |
ElectricPotentialDifferenceVolt enum value | PresentationFormats |
ElectricResistanceOhm enum value | PresentationFormats |
EnergyDensityJoulePerCubicMetre enum value | PresentationFormats |
EnergyGramcalorie enum value | PresentationFormats |
EnergyJoule enum value | PresentationFormats |
EnergyKilogramcalorie enum value | PresentationFormats |
EnergyKiloWattHour enum value | PresentationFormats |
Exponent | PresentationFormats | [static]
ExposureCoulombPerKilogram enum value | PresentationFormats |
ForceNewton enum value | PresentationFormats |
FrequencyHertz enum value | PresentationFormats |
HeatCapacityJoulePerKelvin enum value | PresentationFormats |
HeatFluxDensityWattPerSquareMetre enum value | PresentationFormats |
IlluminanceLux enum value | PresentationFormats |
InductanceHenry enum value | PresentationFormats |
IrradianceWattPerSquareMetre enum value | PresentationFormats |
LengthAngstrom enum value | PresentationFormats |
LengthFoot enum value | PresentationFormats |
LengthInch enum value | PresentationFormats |
LengthMetre enum value | PresentationFormats |
LengthMile enum value | PresentationFormats |
LengthNauticalMile enum value | PresentationFormats |
LengthParsec enum value | PresentationFormats |
LengthYard enum value | PresentationFormats |
LogarithmicRadioQuantityBel enum value | PresentationFormats |
LogarithmicRadioQuantityNeper enum value | PresentationFormats |
LuminanceCandelaPerSquareMetre enum value | PresentationFormats |
LuminousFluxLumen enum value | PresentationFormats |
LuminousIntensityCandela enum value | PresentationFormats |
MagneticFieldStrengthAmperePerMetre enum value | PresentationFormats |
MagneticFluxDensityTesla enum value | PresentationFormats |
MagneticFluxWeber enum value | PresentationFormats |
MassConcentrationKilogramPerCubicMetre enum value | PresentationFormats |
MassDensityMilligramPerdeciLitre enum value | PresentationFormats |
MassDensityMillimolePerLitre enum value | PresentationFormats |
MassKilogram enum value | PresentationFormats |
MassPound enum value | PresentationFormats |
MassTonne enum value | PresentationFormats |
MilliliterPerKilogramPerminute enum value | PresentationFormats |
MolarEnergyJoulePermole enum value | PresentationFormats |
MolarentropyJoulePermoleKelvin enum value | PresentationFormats |
MomentOfForceNewtonMetre enum value | PresentationFormats |
NamespaceId enum name | PresentationFormats |
Percentage enum value | PresentationFormats |
PeriodBeatsPerMinute enum value | PresentationFormats |
PermeabilityHenryPerMetre enum value | PresentationFormats |
PerMille enum value | PresentationFormats |
PermittivityFaradPerMetre enum value | PresentationFormats |
PlaneAngleDegree enum value | PresentationFormats |
PlaneAngleMinute enum value | PresentationFormats |
PlaneAngleRadian enum value | PresentationFormats |
PlaneAngleSecond enum value | PresentationFormats |
PowerWatt enum value | PresentationFormats |
PressureBar enum value | PresentationFormats |
PressureMilliMetreofmercury enum value | PresentationFormats |
PressurePascal enum value | PresentationFormats |
PressurePoundForcePerSquareinch enum value | PresentationFormats |
RadianceWattPerSquareMetreSteradian enum value | PresentationFormats |
RadiantintensityWattPerSteradian enum value | PresentationFormats |
RefractiveIndex enum value | PresentationFormats |
RelativePermeability enum value | PresentationFormats |
ReservedForFutureUse enum value | PresentationFormats |
SolidAngleSteradian enum value | PresentationFormats |
SpecificEnergyJoulePerKilogram enum value | PresentationFormats |
SpecificHeatCapacityJoulePerKilogramKelvin enum value | PresentationFormats |
SpecificVolumeCubicMetrePerKilogram enum value | PresentationFormats |
SurfacechargeDensityCoulombPerSquareMetre enum value | PresentationFormats |
SurfaceDensityKilogramPerSquareMetre enum value | PresentationFormats |
SurfaceTensionNewtonPerMetre enum value | PresentationFormats |
ThermalConductivityWattPerMetreKelvin enum value | PresentationFormats |
ThermodynamicTemperatureDegreeFahrenheit enum value | PresentationFormats |
ThermodynamicTemperatureKelvin enum value | PresentationFormats |
TimeDay enum value | PresentationFormats |
TimeHour enum value | PresentationFormats |
TimeMinute enum value | PresentationFormats |
TimeMonth enum value | PresentationFormats |
TimeSecond enum value | PresentationFormats |
TimeYear enum value | PresentationFormats |
Unitless enum value | PresentationFormats |
Units enum name | PresentationFormats |
VelocityKiloMetrePerHour enum value | PresentationFormats |
VelocityKnot enum value | PresentationFormats |
VelocityMetresPerSecond enum value | PresentationFormats |
VelocityMilePerHour enum value | PresentationFormats |
VolumeCubicMetres enum value | PresentationFormats |
VolumeLitre enum value | PresentationFormats |
WaveNumberReciprocalMetre enum value | PresentationFormats |
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario1_Discovery.h Source File

  • BluetoothLE
  • cppwinrt

Scenario1_Discovery.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Discovery.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Discovery : Scenario1_DiscoveryT<Scenario1_Discovery>
00020     {
00021         Scenario1_Discovery();
00022
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024
00025         Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> KnownDevices()
00026         {
00027             return m_knownDevices;
00028         }
00029
00030         void EnumerateButton_Click();
00031         fire_and_forget PairButton_Click();
00032         bool Not(bool value) { return !value; }
00033
00034     private:
00035         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00036         Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> m_knownDevices = single_threaded_observable_vector<Windows::Foundation::IInspectable>();
00037         std::vector<Windows::Devices::Enumeration::DeviceInformation> UnknownDevices;
00038         Windows::Devices::Enumeration::DeviceWatcher deviceWatcher{ nullptr };
00039         event_token deviceWatcherAddedToken;
00040         event_token deviceWatcherUpdatedToken;
00041         event_token deviceWatcherRemovedToken;
00042         event_token deviceWatcherEnumerationCompletedToken;
00043         event_token deviceWatcherStoppedToken;
00044
00045         void StartBleDeviceWatcher();
00046         void StopBleDeviceWatcher();
00047         std::tuple<SDKTemplate::BluetoothLEDeviceDisplay, uint32_t> FindBluetoothLEDeviceDisplay(hstring const& id);
00048         std::vector<Windows::Devices::Enumeration::DeviceInformation>::iterator FindUnknownDevices(hstring const& id);
00049
00050         fire_and_forget DeviceWatcher_Added(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformation deviceInfo);
00051         fire_and_forget DeviceWatcher_Updated(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate);
00052         fire_and_forget DeviceWatcher_Removed(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate);
00053         fire_and_forget DeviceWatcher_EnumerationCompleted(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Foundation::IInspectable const&);
00054         fire_and_forget DeviceWatcher_Stopped(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Foundation::IInspectable const&);
00055     };
00056 }
00057
00058 namespace winrt::SDKTemplate::factory_implementation
00059 {
00060     struct Scenario1_Discovery : Scenario1_DiscoveryT<Scenario1_Discovery, implementation::Scenario1_Discovery>
00061     {
00062     };
00063 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/VisualProperties.cpp Source File

  • CompositionVisual
  • cpp

VisualProperties.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "VisualProperties.h"
00003
00004 #include "windowsnumerics.h"
00005
00006 using namespace Windows::ApplicationModel::Core;
00007 using namespace Windows::UI::Core;
00008 using namespace Windows::Foundation;
00009 using namespace Windows::UI::Composition;
00010 using namespace Windows::Foundation::Numerics;
00011 using namespace Windows::UI;
00012
00013 //------------------------------------------------------------------------------
00014 //
00015 // main
00016 //
00017 //------------------------------------------------------------------------------
00018
00019
00020 // The main function is only used to initialize our IFrameworkView class.
00021 [Platform::MTAThread]
00022 int main(Platform::Array<Platform::String^>^)
00023 {
00024   auto visualPropertiesFactory = ref new VisualPropertiesFactory();
00025   CoreApplication::Run(visualPropertiesFactory);
00026   return 0;
00027 }
00028
00029
00030 VisualProperties::VisualProperties()
00031 {
00032 }
00033
00034 //------------------------------------------------------------------------------
00035 //
00036 // VisualProperties.Initialize
00037 //
00038 // This method is called during startup to associate the IFrameworkView with the
00039 // CoreApplicationView.
00040 //
00041 //------------------------------------------------------------------------------
00042
00043 void VisualProperties::Initialize(CoreApplicationView^ view)
00044 {
00045   _view = view;
00046 }
00047
00048 //------------------------------------------------------------------------------
00049 //
00050 // VisualProperties.SetWindow
00051 //
00052 // This method is called when the CoreApplication has created a new CoreWindow,
00053 // allowing the application to configure the window and start producing content
00054 // to display.
00055 //
00056 //------------------------------------------------------------------------------
00057
00058 void VisualProperties::SetWindow(Windows::UI::Core::CoreWindow^ window)
00059 {
00060   _window = window;
00061   InitNewComposition();
00062
00063   _window->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &VisualProperties::OnPointerPressed);
00064   _window->PointerMoved += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &VisualProperties::OnPointerMoved);
00065   _window->PointerReleased += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &VisualProperties::OnPointerReleased);
00066 }
00067
00068 //------------------------------------------------------------------------------
00069 //
00070 // VisualProperties.OnPointerPressed
00071 //
00072 // This method is called when the user touches the screen, taps it with a stylus
00073 // or clicks the mouse.
00074 //
00075 //------------------------------------------------------------------------------
00076
00077 void VisualProperties::OnPointerPressed(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args)
00078 {
00079   auto position = args->CurrentPoint->Position;
00080
00081   //
00082   // Walk our list of visuals to determine who, if anybody, was selected
00083   //
00084   for (Visual^ child : _root->Children)
00085   {
00086     //
00087     // Did we hit this child?
00088     //
00089     float3 offset = child->Offset;
00090     float2 size = child->Size;
00091
00092     if ((position.X >= offset.x) &&
00093       (position.X < offset.x + size.x) &&
00094       (position.Y >= offset.y) &&
00095       (position.Y < offset.y + size.y))
00096     {
00097       //
00098       // This child was hit. Since the children are stored back to front,
00099       // the last one hit is the front-most one so it wins
00100       //
00101       _currentVisual = dynamic_cast<ContainerVisual^>(child);
00102       _offsetBias = new float2((float)(offset.x - position.X),
00103         (float)(offset.y - position.Y));
00104     }
00105   }
00106
00107   //
00108   // If a visual was hit, bring it to the front of the Z order
00109   //
00110   if (_currentVisual != nullptr)
00111   {
00112     ContainerVisual^ parent = dynamic_cast<ContainerVisual^>(_currentVisual->Parent);
00113     parent->Children->Remove(_currentVisual);
00114     parent->Children->InsertAtTop(_currentVisual);
00115   }
00116 }
00117
00118 //------------------------------------------------------------------------------
00119 //
00120 // VisualProperties.OnPointerMoved
00121 //
00122 // This method is called when the user moves their finger, stylus or mouse with
00123 // a button pressed over the screen.
00124 //
00125 //------------------------------------------------------------------------------
00126
00127 void VisualProperties::OnPointerMoved(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args)
00128 {
00129   //
00130   // If a visual is selected, drag it with the pointer position and
00131   // make it opaque while we drag it
00132   //
00133   if (_currentVisual != nullptr)
00134   {
00135     //
00136     // Set up the properties of the visual the first time it is
00137     // dragged. This will last for the duration of the drag
00138     //
00139     if (!_dragging)
00140     {
00141       _currentVisual->Opacity = 1.0f;
00142
00143       //
00144       // Transform the first child of the current visual so that
00145       // the image is rotated
00146       //
00147             for (auto child : _currentVisual->Children)
00148       {
00149         child->RotationAngleInDegrees = 45.0f;
00150         child->CenterPoint = float3(_currentVisual->Size.x / 2, _currentVisual->Size.y / 2, 0);
00151                 break;
00152       }
00153
00154       //
00155       // Clip the visual to its original layout rect by using an inset
00156       // clip with a one-pixel margin all around
00157       //
00158       auto clip = _compositor->CreateInsetClip();
00159       clip->LeftInset = 1.0f;
00160       clip->RightInset = 1.0f;
00161       clip->TopInset = 1.0f;
00162       clip->BottomInset = 1.0f;
00163       _currentVisual->Clip = clip;
00164
00165       _dragging = true;
00166     }
00167
00168     Point position = args->CurrentPoint->Position;
00169     _currentVisual->Offset = float3((float)(position.X + _offsetBias->x),
00170       (float)(position.Y + _offsetBias->y),
00171       0.0f);
00172   }
00173 }
00174
00175 //------------------------------------------------------------------------------
00176 //
00177 // VisualProperties.OnPointerReleased
00178 //
00179 // This method is called when the user lifts their finger or stylus from the
00180 // screen, or lifts the mouse button.
00181 //
00182 //------------------------------------------------------------------------------
00183
00184 void VisualProperties::OnPointerReleased(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args)
00185 {
00186   //
00187   // If a visual was selected, make it transparent again when it is
00188   // released and restore the transform and clip
00189   //
00190   if (_currentVisual != nullptr)
00191   {
00192     if (_dragging)
00193     {
00194       //
00195       // Remove the transform from the first child
00196       //
00197             for (auto child : _currentVisual->Children)
00198       {
00199         child->RotationAngleInDegrees = 0;
00200         child->CenterPoint = float3(0, 0, 0);
00201                 break;
00202       }
00203
00204       _currentVisual->Opacity = 0.8f;
00205       _currentVisual->Clip = nullptr;
00206       _dragging = false;
00207     }
00208
00209     _currentVisual = nullptr;
00210   }
00211 }
00212
00213 //------------------------------------------------------------------------------
00214 //
00215 // VisualProperties.InitNewComposition
00216 //
00217 // This method is called by SetWindow(), where we initialize Composition after
00218 // the CoreWindow has been created.
00219 //
00220 //------------------------------------------------------------------------------
00221
00222 void VisualProperties::InitNewComposition()
00223 {
00224   //
00225   // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
00226   // the CoreWindow.
00227   //
00228
00229   _compositor = ref new Compositor();
00230
00231   _root = _compositor->CreateContainerVisual();
00232
00233   _compositionTarget = _compositor->CreateTargetForCurrentView();
00234   _compositionTarget->Root = _root;
00235
00236   //
00237   // Create a few visuals for our window
00238   //
00239   for (int index = 0; index < 20; index++)
00240   {
00241     _root->Children->InsertAtTop(CreateChildElement());
00242   }
00243 }
00244
00245 //------------------------------------------------------------------------------
00246 //
00247 // VisualProperties.CreateChildElement
00248 //
00249 // Creates a small sub-tree to represent a visible element in our application.
00250 //
00251 //------------------------------------------------------------------------------
00252
00253 Visual^ VisualProperties::CreateChildElement()
00254 {
00255   //
00256   // Each element consists of three visuals, which produce the appearance
00257   // of a framed rectangle
00258   //
00259   auto element = _compositor->CreateContainerVisual();
00260   element->Size = float2(100.0f, 100.0f);
00261
00262   //
00263   // Position this visual randomly within our window
00264   //
00265   element->Offset = float3(((float)rand() / RAND_MAX) * 400, ((float)rand() / RAND_MAX) * 400, 0.0f);
00266
00267   //
00268   // The outer rectangle is always white
00269   //
00270   auto visual = _compositor->CreateSpriteVisual();
00271   element->Children->InsertAtTop(visual);
00272
00273   visual->Brush = _compositor->CreateColorBrush(ColorHelper::FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
00274   visual->Size = float2(100.0f, 100.0f);
00275
00276   //
00277   // The inner rectangle is inset from the outer by three pixels all around
00278   //
00279   auto child = _compositor->CreateSpriteVisual();
00280   visual->Children->InsertAtTop(child);
00281   child->Offset = float3(3.0f, 3.0f, 0.0f);
00282   child->Size = float2(94.0f, 94.0f);
00283
00284   //
00285   // Pick a random color for every rectangle
00286   //
00287   byte red = (byte)(0xFF * (0.2f + (((float)rand() / RAND_MAX) / 0.8f)));
00288   byte green = (byte)(0xFF * (0.2f + (((float)rand() / RAND_MAX) / 0.8f)));
00289   byte blue = (byte)(0xFF * (0.2f + (((float)rand() / RAND_MAX) / 0.8f)));
00290   child->Brush = _compositor->CreateColorBrush(ColorHelper::FromArgb(0xFF, red, green, blue));
00291
00292   //
00293   // Make the subtree root visual partially transparent. This will cause each visual in the subtree
00294   // to render partially transparent, since a visual's opacity is multiplied with its parent's
00295   // opacity
00296   //
00297   element->Opacity = 0.8f;
00298
00299   return element;
00300 }
00301
00302 //------------------------------------------------------------------------------
00303 //
00304 // VisualProperties.Load
00305 //
00306 // This method is called when a specific page is being loaded in the
00307 // application.  It is not used for this application.
00308 //
00309 //------------------------------------------------------------------------------
00310
00311 void VisualProperties::Load(Platform::String ^ unused)
00312 {
00313 }
00314
00315 //------------------------------------------------------------------------------
00316 //
00317 // VisualProperties.Run
00318 //
00319 // This method is called by CoreApplication.Run() to actually run the
00320 // dispatcher's message pump.
00321 //
00322 //------------------------------------------------------------------------------
00323
00324 void VisualProperties::Run()
00325 {
00326   _window->Activate();
00327   _window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
00328 }
00329
00330 //------------------------------------------------------------------------------
00331 //
00332 // VisualProperties.Uninitialize
00333 //
00334 // This method is called during shutdown to disconnect the CoreApplicationView,
00335 // and CoreWindow from the IFrameworkView.
00336 //
00337 //------------------------------------------------------------------------------
00338
00339 void VisualProperties::Uninitialize()
00340 {
00341   _window = nullptr;
00342   _view = nullptr;
00343 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario1_SelectDisplay.xaml.h Source File

  • LineDisplay
  • cpp

Scenario1_SelectDisplay.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_SelectDisplay.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_SelectDisplay sealed
00021     {
00022     public:
00023         Scenario1_SelectDisplay();
00024
00025         static bool IsNonNull(Platform::Object^ item)
00026         {
00027             return item != nullptr;
00028         }
00029
00030     protected:
00031         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00032         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033
00034     private:
00035         MainPage^ rootPage = MainPage::Current;
00036         Windows::Devices::Enumeration::DeviceWatcher^ watcher;
00037
00038         void RestartWatcher();
00039         void StopWatcher();
00040
00041         void Watcher_Added(Windows::Devices::Enumeration::DeviceWatcher^ watcher, Windows::Devices::Enumeration::DeviceInformation^ deviceInformation);
00042         void Watcher_EnumerationCompleted(Windows::Devices::Enumeration::DeviceWatcher^ watcher, Platform::Object^ e);
00043
00044         void SelectButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045         void RefreshButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046     };
00047 }
Generated on Fri Nov 15 2024 22:20:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_Document2 Member List

This is the complete list of members for Scenario_Document2, including all inherited members.
Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario_Document2 | [inline, private]
Scenario_Document2() | Scenario_Document2 | [inline]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousRecognitionListGrammar.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_ContinuousRecognitionListGrammar.xaml.h"
00014 #include "AudioCapturePermissions.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::ApplicationModel::Resources::Core;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Media::SpeechRecognition;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Controls::Primitives;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Input;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 Scenario_ContinuousRecognitionListGrammar::Scenario_ContinuousRecognitionListGrammar() : rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036 }
00037
00038 /// <summary>
00039 /// Upon entering the scenario, ensure that we have permissions to use the Microphone. This may entail popping up
00040 /// a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to
00041 /// prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers
00042 /// should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow
00043 /// audio input.
00044 /// </summary>
00045 /// <param name="e">Unused navigation parameters</param>
00046 void Scenario_ContinuousRecognitionListGrammar::OnNavigatedTo(NavigationEventArgs^ e)
00047 {
00048     Page::OnNavigatedTo(e);
00049
00050     // Prompt the user for permission to access the microphone. This request will only happen
00051     // once, it will not re-prompt if the user rejects the permission.
00052     create_task(AudioCapturePermissions::RequestMicrophonePermissionAsync(), task_continuation_context::use_current())
00053         .then([this](bool permissionGained)
00054     {
00055         if (permissionGained)
00056         {
00057             this->btnContinuousRecognize->IsEnabled = true;
00058
00059             Windows::Globalization::Language^ speechLanguage = SpeechRecognizer::SystemSpeechLanguage;
00060             speechContext = ResourceContext::GetForCurrentView();
00061             speechContext->Languages = ref new VectorView<String^>(1, speechLanguage->LanguageTag);
00062
00063             speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationSpeechResources");
00064
00065             PopulateLanguageDropdown();
00066             InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
00067         }
00068         else
00069         {
00070             this->resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00071             this->resultTextBlock->Text = L"Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
00072             this->cbLanguageSelection->IsEnabled = false;
00073         }
00074     });
00075 }
00076
00077 /// <summary>
00078 /// Creates a SpeechRecognizer instance and initializes the grammar.
00079 /// </summary>
00080 void Scenario_ContinuousRecognitionListGrammar::InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage)
00081 {
00082     // If reinitializing the recognizer (ie, changing the speech language), clean up the old recognizer first.
00083     // Avoid doing this while the recognizer is active by disabling the ability to change languages while listening.
00084     if (this->speechRecognizer != nullptr)
00085     {
00086         speechRecognizer->StateChanged -= stateChangedToken;
00087         speechRecognizer->ContinuousRecognitionSession->Completed -= continuousRecognitionCompletedToken;
00088         speechRecognizer->ContinuousRecognitionSession->ResultGenerated -= continuousRecognitionResultGeneratedToken;
00089
00090         delete this->speechRecognizer;
00091         this->speechRecognizer = nullptr;
00092     }
00093
00094     try
00095     {
00096         this->speechRecognizer = ref new SpeechRecognizer(recognizerLanguage);
00097
00098         // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
00099         // of an audio indicator to help the user understand whether they're being heard.
00100         stateChangedToken = speechRecognizer->StateChanged +=
00101             ref new TypedEventHandler<
00102             SpeechRecognizer ^,
00103             SpeechRecognizerStateChangedEventArgs ^>(
00104                 this,
00105                 &Scenario_ContinuousRecognitionListGrammar::SpeechRecognizer_StateChanged);
00106
00107         // Build a command-list grammar. Commands should ideally be drawn from a resource file for localization, and
00108         // be grouped into tags for alternate forms of the same command.
00109         speechRecognizer->Constraints->Append(
00110             ref new SpeechRecognitionListConstraint(
00111                 ref new Vector<String^>({
00112                     speechResourceMap->GetValue(L"ListGrammarGoHome", speechContext)->ValueAsString
00113         }), "Home"));
00114         speechRecognizer->Constraints->Append(
00115             ref new SpeechRecognitionListConstraint(
00116                 ref new Vector<String^>({
00117             speechResourceMap->GetValue(L"ListGrammarGoToContosoStudio", speechContext)->ValueAsString
00118         }), "GoToContosoStudio"));
00119         speechRecognizer->Constraints->Append(
00120             ref new SpeechRecognitionListConstraint(
00121                 ref new Vector<String^>({
00122             speechResourceMap->GetValue(L"ListGrammarShowMessage", speechContext)->ValueAsString,
00123             speechResourceMap->GetValue(L"ListGrammarOpenMessage", speechContext)->ValueAsString
00124         }), "Message"));
00125         speechRecognizer->Constraints->Append(
00126             ref new SpeechRecognitionListConstraint(
00127                 ref new Vector<String^>({
00128             speechResourceMap->GetValue(L"ListGrammarSendEmail", speechContext)->ValueAsString,
00129             speechResourceMap->GetValue(L"ListGrammarCreateEmail", speechContext)->ValueAsString
00130         }), "Email"));
00131         speechRecognizer->Constraints->Append(
00132             ref new SpeechRecognitionListConstraint(
00133                 ref new Vector<String^>({
00134             speechResourceMap->GetValue(L"ListGrammarCallNitaFarley", speechContext)->ValueAsString,
00135             speechResourceMap->GetValue(L"ListGrammarCallNita", speechContext)->ValueAsString
00136         }), "CallNita"));
00137         speechRecognizer->Constraints->Append(
00138             ref new SpeechRecognitionListConstraint(
00139                 ref new Vector<String^>({
00140             speechResourceMap->GetValue(L"ListGrammarCallWayneSigmon", speechContext)->ValueAsString,
00141             speechResourceMap->GetValue(L"ListGrammarCallWayne", speechContext)->ValueAsString
00142         }), "CallWayne"));
00143
00144         // Update the help text in the UI to show localized examples
00145         String^ uiOptionsText = ref new String(L"Try saying ") +
00146             speechResourceMap->GetValue("ListGrammarGoHome", speechContext)->ValueAsString + L"', '" +
00147             speechResourceMap->GetValue("ListGrammarGoToContosoStudio", speechContext)->ValueAsString + L"' or '" +
00148             speechResourceMap->GetValue("ListGrammarShowMessage", speechContext)->ValueAsString + L"'";
00149         listGrammarHelpText->Text =
00150             speechResourceMap->GetValue("ListGrammarHelpText", speechContext)->ValueAsString + L"\n" +
00151             uiOptionsText;
00152
00153         create_task(speechRecognizer->CompileConstraintsAsync(), task_continuation_context::use_current())
00154             .then([this](task<SpeechRecognitionCompilationResult^> previousTask)
00155         {
00156             SpeechRecognitionCompilationResult^ compilationResult = previousTask.get();
00157
00158             if (compilationResult->Status != SpeechRecognitionResultStatus::Success)
00159             {
00160                 // Disable the recognition buttons.
00161                 btnContinuousRecognize->IsEnabled = false;
00162
00163                 // Let the user know that the grammar didn't compile properly.
00164                 rootPage->NotifyUser("Grammar Compilation Failed: " + compilationResult->Status.ToString(), NotifyType::ErrorMessage);
00165             }
00166             else
00167             {
00168                 // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
00169                 // some recognized phrases occur, or the garbage rule is hit.
00170                 continuousRecognitionCompletedToken = speechRecognizer->ContinuousRecognitionSession->Completed +=
00171                     ref new TypedEventHandler<
00172                     SpeechContinuousRecognitionSession ^,
00173                     SpeechContinuousRecognitionCompletedEventArgs ^>(
00174                         this,
00175                         &Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Completed);
00176                 continuousRecognitionResultGeneratedToken = speechRecognizer->ContinuousRecognitionSession->ResultGenerated +=
00177                     ref new TypedEventHandler<
00178                     SpeechContinuousRecognitionSession ^,
00179                     SpeechContinuousRecognitionResultGeneratedEventArgs ^>(
00180                         this,
00181                         &Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_ResultGenerated);
00182
00183                 btnContinuousRecognize->IsEnabled = true;
00184
00185                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00186             }
00187         }, task_continuation_context::use_current());
00188
00189
00190     }
00191     catch (Platform::Exception^ ex)
00192     {
00193         if ((unsigned int)ex->HResult == HResultRecognizerNotFound)
00194         {
00195             btnContinuousRecognize->IsEnabled = false;
00196
00197             resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00198             resultTextBlock->Text = L"Speech Language pack for selected language not installed.";
00199         }
00200         else
00201         {
00202             auto messageDialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Exception");
00203             create_task(messageDialog->ShowAsync());
00204         }
00205     }
00206 }
00207
00208 /// <summary>
00209 /// Upon leaving, clean up the speech recognizer. Ensure we aren't still listening, and disable the event
00210 /// handlers to prevent leaks.
00211 /// </summary>
00212 /// <param name="e">Unused navigation parameters.</param>
00213 void Scenario_ContinuousRecognitionListGrammar::OnNavigatedFrom(NavigationEventArgs^ e)
00214 {
00215     Page::OnNavigatedFrom(e);
00216
00217     this->heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00218     this->resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00219
00220     if (speechRecognizer != nullptr)
00221     {
00222         // If we're currently active, start a cancellation task, and wait for it to finish before shutting down
00223         // the recognizer.
00224         Concurrency::task<void> cleanupTask;
00225         if (speechRecognizer->State != SpeechRecognizerState::Idle)
00226         {
00227             cleanupTask = create_task(speechRecognizer->ContinuousRecognitionSession->CancelAsync(), task_continuation_context::use_current());
00228         }
00229         else
00230         {
00231             cleanupTask = task_from_result();
00232         }
00233
00234         cleanupTask.then([this]()
00235         {
00236             ContinuousRecoButtonText->Text = " Continuous Recognition";
00237
00238             speechRecognizer->StateChanged -= stateChangedToken;
00239             speechRecognizer->ContinuousRecognitionSession->Completed -= continuousRecognitionCompletedToken;
00240             speechRecognizer->ContinuousRecognitionSession->ResultGenerated -= continuousRecognitionResultGeneratedToken;
00241
00242             delete speechRecognizer;
00243             speechRecognizer = nullptr;
00244         }, task_continuation_context::use_current());
00245     }
00246 }
00247
00248 /// <summary>
00249 /// Begin recognition, or finish the recognition session.
00250 /// </summary>
00251 /// <param name="sender">The button that generated this event</param>
00252 /// <param name="e">Unused event details</param>
00253 void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognize_Click(Object^ sender, RoutedEventArgs^ e)
00254 {
00255     btnContinuousRecognize->IsEnabled = false;
00256
00257     // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
00258     // This prevents an exception from occurring.
00259     if (speechRecognizer->State == SpeechRecognizerState::Idle)
00260     {
00261         ContinuousRecoButtonText->Text = " Stop Continuous Recognition";
00262         cbLanguageSelection->IsEnabled = false;
00263
00264         create_task(speechRecognizer->ContinuousRecognitionSession->StartAsync(), task_continuation_context::use_current())
00265             .then([this](task<void> startAsyncTask)
00266         {
00267             try
00268             {
00269                 // Retreive any exceptions that may have been generated by StartAsync.
00270                 startAsyncTask.get();
00271             }
00272             catch (Exception^ exception)
00273             {
00274                 ContinuousRecoButtonText->Text = " Continuous Recognition";
00275                 cbLanguageSelection->IsEnabled = true;
00276
00277                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00278                 create_task(messageDialog->ShowAsync());
00279             }
00280         }).then([this]() {
00281             btnContinuousRecognize->IsEnabled = true;
00282         });
00283     }
00284     else
00285     {
00286         // Cancelling recognition prevents any currently recognized speech from
00287         // generating a ResultGenerated event. StopAsync() will allow the final session to
00288         // complete.
00289         ContinuousRecoButtonText->Text = " Continuous Recognition";
00290         cbLanguageSelection->IsEnabled = true;
00291
00292         create_task(speechRecognizer->ContinuousRecognitionSession->CancelAsync()).then([this]() {
00293             btnContinuousRecognize->IsEnabled = true;
00294         });
00295     }
00296 }
00297
00298 /// <summary>
00299 /// Provide feedback to the user based on whether the recognizer is receiving their voice input.
00300 /// </summary>
00301 /// <param name="sender">The recognizer that is currently running.</param>
00302 /// <param name="args">The current state of the recognizer.</param>
00303 void Scenario_ContinuousRecognitionListGrammar::SpeechRecognizer_StateChanged(SpeechRecognizer ^sender, SpeechRecognizerStateChangedEventArgs ^args)
00304 {
00305     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00306     {
00307         rootPage->NotifyUser("Speech recognizer state: " + args->State.ToString(), NotifyType::StatusMessage);
00308     }));
00309
00310 }
00311
00312 /// <summary>
00313 /// Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if
00314 /// some transient issues occur.
00315 /// </summary>
00316 /// <param name="sender">The continuous recognition session</param>
00317 /// <param name="args">The state of the recognizer</param>
00318 void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession ^sender, SpeechContinuousRecognitionCompletedEventArgs ^args)
00319 {
00320     if (args->Status != SpeechRecognitionResultStatus::Success)
00321     {
00322         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00323         {
00324             rootPage->NotifyUser("Continuous Recognition Completed: " + args->Status.ToString(), NotifyType::ErrorMessage);
00325             ContinuousRecoButtonText->Text = " Continuous Recognition";
00326             cbLanguageSelection->IsEnabled = true;
00327         }));
00328     }
00329 }
00330
00331 /// <summary>
00332 /// Handle events fired when a result is generated. This may include a garbage rule that fires when general room noise
00333 /// or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with
00334 /// low confidence).
00335 /// </summary>
00336 /// <param name="sender">The Recognition session that generated this result</param>
00337 /// <param name="args">Details about the recognized speech</param>
00338 void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession ^sender, SpeechContinuousRecognitionResultGeneratedEventArgs ^args)
00339 {
00340     // The garbage rule will not have a tag associated with it, the other rules will return a string matching the tag provided
00341     // when generating the grammar.
00342     String^ tag = L"unknown";
00343     if (args->Result->Constraint != nullptr)
00344     {
00345         tag = args->Result->Constraint->Tag;
00346     }
00347
00348     // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their
00349     // grammar based on testing.
00350     if (args->Result->Confidence == SpeechRecognitionConfidence::Medium ||
00351         args->Result->Confidence == SpeechRecognitionConfidence::High)
00352     {
00353         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
00354         {
00355             heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00356             resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00357             resultTextBlock->Text = L"Heard: '" + args->Result->Text + L"', Tag( '" + tag + L"', Confidence: " + args->Result->Confidence.ToString() + ")";
00358         }));
00359     }
00360     else
00361     {
00362         // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
00363         // is not the primary input mechanism for the application.
00364         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
00365         {
00366             heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00367             resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00368             resultTextBlock->Text = L"Sorry, I didn't catch that. (Heard: '" + args->Result->Text + L"', (Tag: '" + tag + L"', Confidence: " + args->Result->Confidence.ToString() + L")";
00369         }));
00370     }
00371 }
00372
00373 /// <summary>
00374 /// Populate language dropdown with supported Dictation languages.
00375 /// </summary>
00376 void Scenario_ContinuousRecognitionListGrammar::PopulateLanguageDropdown()
00377 {
00378     // disable callback temporarily.
00379     isPopulatingLanguages = true;
00380
00381     Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
00382     auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
00383     std::for_each(begin(supportedLanguages), end(supportedLanguages), [&](Windows::Globalization::Language^ lang)
00384     {
00385         ComboBoxItem^ item = ref new ComboBoxItem();
00386         item->Tag = lang;
00387         item->Content = lang->DisplayName;
00388
00389         cbLanguageSelection->Items->Append(item);
00390         if (lang->LanguageTag == defaultLanguage->LanguageTag)
00391         {
00392             item->IsSelected = true;
00393             cbLanguageSelection->SelectedItem = item;
00394         }
00395     });
00396
00397     isPopulatingLanguages = false;
00398 }
00399
00400 /// <summary>
00401 /// Re-initialize the recognizer based on selections from the language combobox.
00402 /// </summary>
00403 void Scenario_ContinuousRecognitionListGrammar::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00404 {
00405     if (isPopulatingLanguages)
00406     {
00407         return;
00408     }
00409
00410     ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
00411     Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
00412
00413     if (this->speechRecognizer != nullptr)
00414     {
00415         if (speechRecognizer->CurrentLanguage == newLanguage)
00416         {
00417             return;
00418         }
00419     }
00420
00421     try
00422     {
00423         speechContext->Languages = ref new VectorView<String^>(1, newLanguage->LanguageTag);
00424
00425         InitializeRecognizer(newLanguage);
00426     }
00427     catch (Exception^ exception)
00428     {
00429         auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00430         create_task(messageDialog->ShowAsync());
00431     }
00432
00433 }
Generated on Fri Nov 15 2024 22:21:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
App() | sealed |
DirectXPage() | sealed |
HideGameInfoOverlay() | sealed | [virtual]
HideTooSmall() | sealed | [virtual]
InitializeLicense() | sealed | [private]
InitializeLicenseCore() | sealed | [private]
isApp | sealed |
license | sealed |
m_deviceResources | sealed | [private]
m_foreground | sealed | [private]
m_formattedPrice | sealed | [private]
m_isApp | sealed | [private]
m_isAppActive | sealed | [private]
m_isAppTrial | sealed | [private]
m_isAvailableForPurchase | sealed | [private]
m_isProductActive | sealed | [private]
m_isTrial | sealed | [private]
m_licenseInformation | sealed | [private]
m_licenseState | sealed | [private]
m_listingInformation | sealed | [private]
m_main | sealed | [private]
m_mainPage | sealed | [private]
m_playActive | sealed | [private]
m_possiblePurchaseUpgrade | sealed | [private]
m_productId | sealed | [private]
m_status | sealed | [private]
m_title | sealed | [private]
m_windowVisible | sealed | [private]
OnAppBarOpened(Object^sender, Object^args) | sealed | [private]
OnBuyAppButtonTapped(Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^args) | sealed | [private]
OnBuySelectorClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnChangeBackgroundButtonClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnCompositionScaleChanged(Windows::UI::Xaml::Controls::SwapChainPanel^sender, Object^args) | sealed | [private]
OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [private]
OnDpiChanged(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [private]
OnGameInfoOverlayTapped(Object^sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^args) | sealed | [private]
OnLaunched(_In_ Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args) override | sealed | [virtual]
OnLicenseChanged() | sealed | [private]
OnLoadStoreClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [private]
OnPlayButtonClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnResetButtonClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnResetLicenseButtonClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnResuming(_In_ Platform::Object^sender, _In_ Platform::Object^args) | sealed | [private]
OnResuming() | sealed |
OnStereoEnabledChanged(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [private]
OnStoreReturnClicked(Object^sender, Windows::UI::Xaml::RoutedEventArgs^args) | sealed | [private]
OnSuspending(_In_ Platform::Object^sender, _In_ Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [private]
OnSuspending() | sealed |
OnSwapChainPanelSizeChanged(Platform::Object^sender, Windows::UI::Xaml::SizeChangedEventArgs^e) | sealed | [private]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [private]
OnWindowActivationChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Core::WindowActivatedEventArgs^args) | sealed | [private]
OnWindowActivationChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Core::WindowActivatedEventArgs^args) | sealed | [private]
OnWindowSizeChanged(_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::WindowSizeChangedEventArgs^args) | sealed | [private]
OptionalTrialUpgrade() | sealed | [private]
productId | sealed |
PropertyChanged | sealed |
ResetLicenseFromFile() | sealed | [private]
SetAction(GameInfoOverlayCommand action) | sealed | [virtual]
SetGameLoading() | sealed | [virtual]
SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore) | sealed | [virtual]
SetGameStats(int maxLevel, int hitCount, int shotCount) | sealed | [virtual]
SetLevelStart(int level, Platform::String^objective, float timeLimit, float bonusTime) | sealed | [virtual]
SetPause(int level, int hitCount, int shotCount, float timeRemaining) | sealed | [virtual]
SetProductItems(Windows::ApplicationModel::Store::ListingInformation^listing, Windows::ApplicationModel::Store::LicenseInformation^license) | sealed | [private]
SetStatus(Windows::ApplicationModel::Store::LicenseInformation^license) | sealed | [private]
ShowGameInfoOverlay() | sealed | [virtual]
ShowStoreFlyout() | sealed | [private]
ShowTooSmall() | sealed | [virtual]
UpdateContent(Windows::ApplicationModel::Store::ListingInformation^listing) | sealed |
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/pch.h Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include <collection.h>
00014 #include <ppltasks.h>
00015
00016 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.cpp Source File

  • CustomCapability
  • cpp

Scenario7_FirmwareAccess.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_FirmwareAccess.xaml.h"
00014 #include <string>
00015 #include "firmwareaccess.h"
00016 #include <intsafe.h>
00017
00018 using namespace SDKTemplate;
00019
00020 using namespace Platform;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI::Xaml;
00024
00025 FirmwareAccess::FirmwareAccess()
00026 {
00027     InitializeComponent();
00028 }
00029
00030 void FirmwareAccess::GetManufacturerName_Click(Object^ sender, RoutedEventArgs^ e)
00031 {
00032     wchar_t name[MANUFACTURER_NAME_LENGTH_MAX] = { 0 };
00033
00034     DWORD error = GetManufacturerNameFromSmbios(name, ARRAYSIZE(name));
00035     if (error == ERROR_SUCCESS)
00036     {
00037         ManufacturerName->Text = ref new String(name);
00038     }
00039     else
00040     {
00041         rootPage->NotifyUser("Failed to retrieve manufacturer name from SMBIOS, error " + error.ToString(), NotifyType::ErrorMessage);
00042     }
00043 }
00044
00045 void FirmwareAccess::SecureBootState_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     bool secureBootEnabled = false;
00048
00049     DWORD error = GetSecureBootEnabledFromUefi(&secureBootEnabled);
00050     switch (error)
00051     {
00052     case ERROR_SUCCESS:
00053         SecureBootState->Text = secureBootEnabled.ToString();
00054         break;
00055
00056     case ERROR_INVALID_FUNCTION:
00057         rootPage->NotifyUser("Windows was installed using legacy BIOS", NotifyType::ErrorMessage);
00058         break;
00059
00060     default:
00061         rootPage->NotifyUser("Failed to retrieve secure boot state from UEFI, error " + error.ToString(), NotifyType::ErrorMessage);
00062         break;
00063     }
00064 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/pch.cpp Source File

  • AppServices
  • cppwinrt
  • AppServicesClient

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Material Member List

This is the complete list of members for Material, including all inherited members.
m_diffuseColor | Material | [private]
m_hitColor | Material | [private]
m_meshColor | Material | [private]
m_pixelShader | Material | [private]
m_specularColor | Material | [private]
m_specularExponent | Material | [private]
m_textureRV | Material | [private]
m_vertexShader | Material | [private]
Material(DirectX::XMFLOAT4 meshColor, DirectX::XMFLOAT4 diffuseColor, DirectX::XMFLOAT4 specularColor, float specularExponent, _In_ ID3D11ShaderResourceView *textureResourceView, _In_ ID3D11VertexShader *vertexShader, _In_ ID3D11PixelShader *pixelShader) | Material |
RenderSetup(_In_ ID3D11DeviceContext *context, _Inout_ ConstantBufferChangesEveryPrim *constantBuffer) | Material |
SetTexture(_In_ ID3D11ShaderResourceView *textureResourceView) | Material | [inline]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/CustomTitleBar.xaml.cpp Source File

  • TitleBar
  • cpp

CustomTitleBar.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // CustomTitleBar.xaml.cpp
00003 // Implementation of the CustomTitleBar class
00004 //
00005
00006 #include "pch.h"
00007 #include "CustomTitleBar.xaml.h"
00008
00009 using namespace SDKTemplate;
00010
00011 using namespace Platform;
00012 using namespace Windows::ApplicationModel::Core;
00013 using namespace Windows::Foundation;
00014 using namespace Windows::UI::Core;
00015 using namespace Windows::UI::ViewManagement;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Controls::Primitives;
00019 using namespace Windows::UI::Xaml::Data;
00020 using namespace Windows::UI::Xaml::Input;
00021 using namespace Windows::UI::Xaml::Media;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 CustomTitleBar::CustomTitleBar()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void CustomTitleBar::CustomTitleBar_Loaded(Object^ sender, RoutedEventArgs^ args)
00030 {
00031     layoutMetricsChangedToken = coreTitleBar->LayoutMetricsChanged += ref new TypedEventHandler<CoreApplicationViewTitleBar^, Object^>(this, &CustomTitleBar::OnLayoutMetricsChanged);
00032     isVisibleChangedToken = coreTitleBar->IsVisibleChanged += ref new TypedEventHandler<CoreApplicationViewTitleBar^, Object^>(this, &CustomTitleBar::OnIsVisibleChanged);
00033
00034     // The SizeChanged event is raised when the view enters or exits full screen mode.
00035     windowSizeChangedToken = Window::Current->SizeChanged += ref new WindowSizeChangedEventHandler(this, &CustomTitleBar::OnWindowSizeChanged);
00036
00037     UpdateLayoutMetrics();
00038     UpdatePositionAndVisibility();
00039 }
00040
00041 void CustomTitleBar::CustomTitleBar_Unloaded(Object^ sender, RoutedEventArgs^ args)
00042 {
00043     coreTitleBar->LayoutMetricsChanged -= layoutMetricsChangedToken;
00044     coreTitleBar->IsVisibleChanged -= isVisibleChangedToken;
00045     Window::Current->SizeChanged -= windowSizeChangedToken;
00046 }
00047
00048 void CustomTitleBar::OnLayoutMetricsChanged(CoreApplicationViewTitleBar^ sender, Object^ args)
00049 {
00050     UpdateLayoutMetrics();
00051 }
00052
00053 void CustomTitleBar::UpdateLayoutMetrics()
00054 {
00055     PropertyChanged(this, ref new PropertyChangedEventArgs("CoreTitleBarHeight"));
00056     PropertyChanged(this, ref new PropertyChangedEventArgs("CoreTitleBarPadding"));
00057 }
00058
00059 void CustomTitleBar::OnIsVisibleChanged(CoreApplicationViewTitleBar^ sender, Object^ args)
00060 {
00061     UpdatePositionAndVisibility();
00062 }
00063
00064 void CustomTitleBar::OnWindowSizeChanged(Object^ sender, WindowSizeChangedEventArgs^ args)
00065 {
00066     UpdatePositionAndVisibility();
00067 }
00068
00069 // We wrap the normal contents of the MainPage inside a grid
00070 // so that we can place a title bar on top of it.
00071 //
00072 // When not in full screen mode, the grid looks like this:
00073 //
00074 //      Row 0: Custom-rendered title bar
00075 //      Row 1: Rest of content
00076 //
00077 // In full screen mode, the the grid looks like this:
00078 //
00079 //      Row 0: (empty)
00080 //      Row 1: Custom-rendered title bar
00081 //      Row 1: Rest of content
00082 //
00083 // The title bar is either Visible or Collapsed, depending on the value of
00084 // the IsVisible property.
00085 void CustomTitleBar::UpdatePositionAndVisibility()
00086 {
00087     if (ApplicationView::GetForCurrentView()->IsFullScreenMode)
00088     {
00089         // In full screen mode, the title bar overlays the content.
00090         // and might or might not be visible.
00091         TitleBar->Visibility = coreTitleBar->IsVisible ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00092         Grid::SetRow(TitleBar, 1);
00093     }
00094     else
00095     {
00096         // When not in full screen mode, the title bar is visible and does not overlay content.
00097         TitleBar->Visibility = Windows::UI::Xaml::Visibility::Visible;
00098         Grid::SetRow(TitleBar, 0);
00099     }
00100 }
00101
00102 UIElement^ CustomTitleBar::SetPageContent(UIElement^ newContent)
00103 {
00104     UIElement^ oldContent = pageContent;
00105     if (oldContent != nullptr)
00106     {
00107         pageContent = nullptr;
00108         RootGrid->Children->RemoveAtEnd();
00109     }
00110     pageContent = newContent;
00111     if (newContent != nullptr)
00112     {
00113         RootGrid->Children->Append(newContent);
00114         // The page content is row 1 in our grid. (See diagram above.)
00115         Grid::SetRow(static_cast<FrameworkElement^>(pageContent), 1);
00116     }
00117     return oldContent;
00118 }
00119
00120 void CustomTitleBar::EnableControlsInTitleBar(bool enable)
00121 {
00122     if (enable)
00123     {
00124         TitleBarControl->Visibility = Windows::UI::Xaml::Visibility::Visible;
00125         // Any clicks on the BackgroundElement will be treated as clicks on the title bar.
00126         Window::Current->SetTitleBar(BackgroundElement);
00127     }
00128     else
00129     {
00130         TitleBarControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00131         Window::Current->SetTitleBar(nullptr);
00132     }
00133 }
00134
Generated on Fri Nov 15 2024 22:21:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario3_SingleFolder.h Source File

  • FilePicker
  • cppwinrt

Scenario3_SingleFolder.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_SingleFolder.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3_SingleFolder : Scenario3_SingleFolderT<Scenario3_SingleFolder>
00020     {
00021         Scenario3_SingleFolder();
00022         fire_and_forget PickFolderButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario3_SingleFolder : Scenario3_SingleFolderT<Scenario3_SingleFolder, implementation::Scenario3_SingleFolder>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario2_DecimalFormatting.cpp Source File

  • NumberFormatting
  • cppwinrt

Scenario2_DecimalFormatting.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_DecimalFormatting.h"
00014 #include "Scenario2_DecimalFormatting.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization::NumberFormatting;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario2_DecimalFormatting::Scenario2_DecimalFormatting()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     void Scenario2_DecimalFormatting::Display_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         // This scenario uses the Windows.Globalization.NumberFormatting.DecimalFormatter class
00031         // to format a number.
00032
00033         // Create formatter initialized using the current user's preference settings.
00034         DecimalFormatter decimalFormat;
00035
00036         // Make a random number.
00037         float randomNumber = (float)rand() / RAND_MAX * 100000.0f;
00038
00039         // Format with the user's default preferences.
00040         hstring decimal = decimalFormat.Format(randomNumber);
00041
00042         // Format with grouping.
00043         DecimalFormatter decimalFormat1;
00044         decimalFormat1.IsGrouped(true);
00045         hstring decimal1 = decimalFormat1.Format(randomNumber);
00046
00047         // Format with grouping using French.
00048         DecimalFormatter decimalFormatFR({ L"fr-FR" }, L"ZZ");
00049         decimalFormatFR.IsGrouped(true);
00050         hstring decimalFR = decimalFormatFR.Format(randomNumber);
00051
00052         // Illustrate how automatic digit substitution works
00053         DecimalFormatter decimalFormatAR({ L"ar" }, L"ZZ");
00054         hstring decimalAR = decimalFormatAR.Format(randomNumber);
00055
00056         // Get a fixed number.
00057         long long fixedNumber = 500;
00058
00059         // Format with the user's default preferences.
00060         hstring decimal2 = decimalFormat.Format(fixedNumber);
00061
00062         // Format always with a decimal point.
00063         DecimalFormatter decimalFormat3;
00064         decimalFormat3.IsDecimalPointAlwaysDisplayed(true);
00065         decimalFormat3.FractionDigits(0);
00066         hstring decimal3 = decimalFormat3.Format(fixedNumber);
00067
00068         // Format with no fractional digits or decimal point.
00069         DecimalFormatter decimalFormat4;
00070         decimalFormat4.FractionDigits(0);
00071         hstring decimal4 = decimalFormat4.Format(fixedNumber);
00072
00073         // Display the results.
00074         std::wostringstream results;
00075         results <<
00076             L"Random number (" << randomNumber << L")" << std::endl <<
00077             L"With current user preferences: " << std::wstring_view(decimal) << std::endl <<
00078             L"With grouping separators: " << std::wstring_view(decimal1) << std::endl <<
00079             L"With grouping separators (fr-FR): " << std::wstring_view(decimalFR) << std::endl <<
00080             L"With digit substitution (ar): " << std::wstring_view(decimalAR) << std::endl <<
00081             std::endl <<
00082             L"Fixed number (" << fixedNumber << L")" << std::endl <<
00083             L"With current user preferences: " << std::wstring_view(decimal2) << std::endl <<
00084             L"Always with a decimal point: " << std::wstring_view(decimal3) << std::endl <<
00085             L"With no fraction digits or decimal points: " << std::wstring_view(decimal4);
00086
00087         OutputTextBlock().Text(results.str());
00088     }
00089 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario6_DeleteTPM.cpp Source File

  • SmartCard
  • cppwinrt

Scenario6_DeleteTPM.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_DeleteTPM.h"
00014 #include "Scenario6_DeleteTPM.g.cpp"
00015
00016 namespace winrt
00017 {
00018     using namespace Windows::Foundation;
00019     using namespace Windows::Devices::SmartCards;
00020     using namespace Windows::UI::Xaml;
00021     using namespace Windows::UI::Xaml::Controls;
00022 }
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario6_DeleteTPM::Scenario6_DeleteTPM()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     /// <summary>
00032     /// Click handler for the 'Delete' button.
00033     /// </summary>
00034     /// <param name="sender"></param>
00035     fire_and_forget Scenario6_DeleteTPM::Delete_Click(IInspectable const& sender, RoutedEventArgs const&)
00036     {
00037         auto lifetime = get_strong();
00038         if (!ValidateTPMSmartCard())
00039         {
00040             m_rootPage.NotifyUser(L"Use Scenario One to create a TPM virtual smart card.", NotifyType::ErrorMessage);
00041             co_return;
00042         }
00043
00044         auto b = sender.as<Button>();
00045         b.IsEnabled(false);
00046         m_rootPage.NotifyUser(L"Deleting the TPM virtual smart card...", NotifyType::ErrorMessage);
00047
00048         try
00049         {
00050             SmartCard card = co_await GetSmartCardAsync();
00051
00052             // The following two lines are not directly related to TPM virtual
00053             // smart card creation, but are used to demonstrate how to handle
00054             // CardRemoved events by registering an event handler with a
00055             // SmartCardReader object.  Since we are using a TPM virtual smart
00056             // card in this case, the card cannot actually be added to or
00057             // removed from the reader, but a CardRemoved event will fire
00058             // when the reader and card are deleted.
00059             //
00060             // We must retain a reference to the SmartCardReader object to
00061             // which we are adding the event handler.  We use += to add the
00062             // HandleCardRemoved method as an event handler.  The function
00063             // will be automatically boxed in a TypedEventHandler, but
00064             // the function signature match the template arguments for
00065             // the specific event - in this case,
00066             // <SmartCardReader, CardRemovedEventArgs>
00067             m_reader = card.Reader();
00068             m_cardRemovedToken = m_reader.CardRemoved(winrt::auto_revoke, { get_weak(), &Scenario6_DeleteTPM::HandleCardRemoved });
00069
00070             bool result = co_await SmartCardProvisioning::RequestVirtualSmartCardDeletionAsync(card);
00071
00072             if (result)
00073             {
00074                 m_rootPage.NotifyUser(L"TPM virtual smart card deletion completed.", NotifyType::StatusMessage);
00075                 SetSmartCardReaderDeviceId(winrt::hstring{});
00076             }
00077             else
00078             {
00079                 m_rootPage.NotifyUser(L"TPM virtual smart card deletion was canceled by the user.", NotifyType::StatusMessage);
00080             }
00081         }
00082         catch (hresult_error const& ex)
00083         {
00084             m_rootPage.NotifyUser(L"TPM virtual smartcard deletion failed with exception: " + ex.message(), NotifyType::ErrorMessage);
00085         }
00086
00087         b.IsEnabled(true);
00088     }
00089
00090     void Scenario6_DeleteTPM::HandleCardRemoved(Windows::Devices::SmartCards::SmartCardReader const& evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs const&)
00091     {
00092         // Note that this event is raised from a background thread.
00093         // However, the NotifyUser method is safe to call from background threads.
00094         m_rootPage.NotifyUser(L"Card removed from reader " + evtReader.Name() + L".", NotifyType::StatusMessage);
00095     }
00096 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/EventTests.xaml.h Source File

  • XamlBind
  • cpp

EventTests.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // EventTests.xaml.h
00003 // Declaration of the EventTests class
00004 //
00005
00006 #pragma once
00007
00008 #include "EventTests.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class EventTests sealed
00017     {
00018     public:
00019         EventTests();
00020
00021         property xBindSampleModel::DataModel^ Model;
00022
00023         void Click_RegularArgs(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024         void Click_NoArgs();
00025         void Click_BaseArgs(Platform::Object^ sender, Platform::Object^ e);
00026     };
00027 }
Generated on Fri Nov 15 2024 22:22:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/pch.h Source File

  • XamlMasterDetail
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Globalization.DateTimeFormatting.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Controls.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00013 #include "winrt/Windows.UI.Xaml.Interop.h"
00014 #include "winrt/Windows.UI.Xaml.Markup.h"
00015 #include "winrt/Windows.UI.Xaml.Media.Animation.h"
00016 #include "winrt/Windows.UI.Xaml.Navigation.h"
00017 #include "winrt/MasterDetailApp.h"
00018 #include "winrt/MasterDetailApp.Data.h"
00019 #include "winrt/MasterDetailApp.ViewModels.h"
00020 #include "ItemsDataSource.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/ConfigStore.cs Source File

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask

ConfigStore.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using System.Threading;
00015 using Windows.ApplicationModel.Background;
00016 using Windows.Storage;
00017 using Windows.Networking.NetworkOperators;
00018
00019 // The namespace for the background tasks.
00020 namespace HotspotAuthenticationTask
00021 {
00022     // A helper class for providing the application configuration.
00023     public sealed class ConfigStore
00024     {
00025         // For the sake of simplicity of the sample, the following authentication parameters are hard coded:
00026         public static string AuthenticationHost => "login.contoso.com";
00027         public static string UserName => "MyUserName";
00028         public static string Password => "MyPassword";
00029         public static string ExtraParameters => "";
00030         public static bool MarkAsManualConnect => false;
00031
00032         public static bool UseNativeWISPr
00033         {
00034             get { return GetValueWithDefault("usenativewispr", true); }
00035             set { ApplicationData.Current.LocalSettings.Values["usenativewispr"] = value; }
00036         }
00037
00038         // This flag is set by the foreground app to toogle authentication to be done by the
00039         // background task handler.
00040         public static bool AuthenticateThroughBackgroundTask
00041         {
00042             get { return GetValueWithDefault("background", true); }
00043             set { ApplicationData.Current.LocalSettings.Values["background"] = value; }
00044         }
00045
00046         // This item is set by the background task handler to pass an authentication event
00047         // token to the foreground app.
00048         public static string AuthenticationToken
00049         {
00050             get { return GetValueWithDefault("token", ""); }
00051             set { ApplicationData.Current.LocalSettings.Values["token"] = value; }
00052         }
00053
00054         static T GetValueWithDefault<T>(string name, T defaultValue)
00055         {
00056             object value;
00057             if (ApplicationData.Current.LocalSettings.Values.TryGetValue(name, out value) &&
00058                 value is T)
00059             {
00060                 return (T)value;
00061             }
00062             return defaultValue;
00063         }
00064     }
00065 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_RequestModification Member List

This is the complete list of members for Scenario3_RequestModification, including all inherited members.
adaptiveMediaSource | Scenario3_RequestModification | [private]
adaptiveMediaSourceLogger | Scenario3_RequestModification | [private]
AppDownloadedKeyRequest(AdaptiveMediaSourceDownloadRequestedEventArgs args) | Scenario3_RequestModification | [inline, private]
AzureKeyAcquisitionMethod enum name | Scenario3_RequestModification | [private]
AzureMethodSelected_Click(object sender, RoutedEventArgs e) | Scenario3_RequestModification | [inline, private]
ctsForAppHttpClientForKeys | Scenario3_RequestModification | [private]
DownloadFailed(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadFailedEventArgs args) | Scenario3_RequestModification | [inline, private]
DownloadRequested(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadRequestedEventArgs args) | Scenario3_RequestModification | [inline, private]
HdcpDesiredMinimumProtection_Click(object sender, RoutedEventArgs e) | Scenario3_RequestModification | [inline, private]
hdcpSession | Scenario3_RequestModification | [private]
HideDescriptionOnSmallScreen() | Scenario3_RequestModification | [inline, private]
httpClientFilter | Scenario3_RequestModification | [private]
LoadSourceFromUriAsync(Uri uri, HttpClient httpClient=null) | Scenario3_RequestModification | [inline, private]
Log(string message) | Scenario3_RequestModification | [inline, private]
mediaPlaybackItemLogger | Scenario3_RequestModification | [private]
mediaPlayerLogger | Scenario3_RequestModification | [private]
mediaSourceLogger | Scenario3_RequestModification | [private]
ModifyKeyRequestUri(AdaptiveMediaSourceDownloadRequestedEventArgs args) | Scenario3_RequestModification | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_RequestModification | [inline, protected]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario3_RequestModification | [inline, private]
RegisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource) | Scenario3_RequestModification | [inline, private]
Scenario3_RequestModification() | Scenario3_RequestModification | [inline]
SetMaxBitrateForProtectionLevel(HdcpProtection?protection, AdaptiveMediaSource ams) | Scenario3_RequestModification | [inline, private]
tokenMethod | Scenario3_RequestModification | [private]
UnregisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource) | Scenario3_RequestModification | [inline, private]
UnregisterHandlers(MediaPlayer mediaPlayer) | Scenario3_RequestModification | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario2_GetParent.xaml.cs Source File

  • FileAccess
  • cs

Scenario2_GetParent.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Text;
00015 using Windows.Storage;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// Getting a file's parent folder.
00024     /// </summary>
00025     public sealed partial class Scenario2 : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario2()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             rootPage.ValidateFile();
00037         }
00038
00039         private async void GetParent_Click(object sender, RoutedEventArgs e)
00040         {
00041             StorageFile file = rootPage.sampleFile;
00042             if (file != null)
00043             {
00044                 try
00045                 {
00046                     StorageFolder parentFolder = await file.GetParentAsync();
00047                     if (parentFolder != null)
00048                     {
00049                         StringBuilder outputText = new StringBuilder();
00050                         outputText.AppendLine($"Item: {file.Name} ({file.Path})");
00051                         outputText.Append($"Parent: {parentFolder.Name} ({parentFolder.Path})");
00052
00053                         rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
00054                     }
00055                 }
00056                 catch (FileNotFoundException)
00057                 {
00058                     rootPage.NotifyUserFileNotExist();
00059                 }
00060             }
00061             else
00062             {
00063                 rootPage.NotifyUserFileNotExist();
00064             }
00065         }
00066     }
00067 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario3_CurrencyFormatting.xaml.cs Source File

  • NumberFormatting
  • cs

Scenario3_CurrencyFormatting.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System.Text;
00012 using Windows.Globalization;
00013 using Windows.Globalization.NumberFormatting;
00014 using Windows.System.UserProfile;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario3_CurrencyFormatting : Page
00021     {
00022         public Scenario3_CurrencyFormatting()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         /// <summary>
00028         /// This is the click handler for the 'Display' button.
00029         /// </summary>
00030         /// <param name="sender"></param>
00031         /// <param name="e"></param>
00032         private void Display_Click(object sender, RoutedEventArgs e)
00033         {
00034             // This scenario uses the Windows.Globalization.NumberFormatting.CurrencyFormatter class
00035             // to format a number as a currency.
00036
00037             // Keep results of the scenario in a StringBuilder
00038             StringBuilder results = new StringBuilder();
00039
00040             // Determine the current user's default currency.
00041             string currency = GlobalizationPreferences.Currencies[0];
00042
00043             // Generate numbers used for formatting.
00044             ulong wholeNumber = 12345;
00045             double fractionalNumber = 12345.67;
00046
00047             // Create currency formatter initialized with current number formatting preferences.
00048             CurrencyFormatter defaultCurrencyFormatter = new CurrencyFormatter(currency);
00049
00050             CurrencyFormatter usdCurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.USD);
00051             CurrencyFormatter eurFRCurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.EUR, new[] { "fr-FR" }, "FR");
00052             CurrencyFormatter eurIECurrencyFormatter = new CurrencyFormatter(CurrencyIdentifiers.EUR, new[] { "gd-IE" }, "IE");
00053             CurrencyFormatter currencyFormatEuroModeSwitch = new CurrencyFormatter(CurrencyIdentifiers.EUR);
00054
00055             // Format numbers as currency.
00056             results.AppendLine("Fixed number (" + fractionalNumber + ")");
00057             results.AppendLine("With user's default currency: " + defaultCurrencyFormatter.Format(fractionalNumber));
00058             results.AppendLine("Formatted US Dollar: " + usdCurrencyFormatter.Format(fractionalNumber));
00059             results.AppendLine("Formatted Euro (fr-FR defaults): " + eurFRCurrencyFormatter.Format(fractionalNumber));
00060             results.AppendLine("Formatted Euro (gd-IE defaults): " + eurIECurrencyFormatter.Format(fractionalNumber));
00061
00062             // Format currency with fraction digits always included.
00063             usdCurrencyFormatter.FractionDigits = 2;
00064             results.AppendLine("Formatted US Dollar (with fractional digits): " + usdCurrencyFormatter.Format(wholeNumber));
00065
00066             // Format currenccy with grouping.
00067             usdCurrencyFormatter.IsGrouped = true;
00068             results.AppendLine("Formatted US Dollar (with grouping separators): " + usdCurrencyFormatter.Format(fractionalNumber));
00069
00070             // Format using currency code instead of currency symbol
00071             currencyFormatEuroModeSwitch.Mode = CurrencyFormatterMode.UseCurrencyCode;
00072             results.AppendLine("Formatted Euro (as currency code): " + currencyFormatEuroModeSwitch.Format(fractionalNumber));
00073
00074             // Switch so we can now format using currency symbol
00075             currencyFormatEuroModeSwitch.Mode = CurrencyFormatterMode.UseSymbol;
00076             results.AppendLine("Formatted Euro (as symbol): " + currencyFormatEuroModeSwitch.Format(fractionalNumber));
00077
00078             // Display the results
00079             OutputTextBlock.Text = results.ToString();
00080         }
00081     }
00082 }
Generated on Fri Nov 15 2024 22:20:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario5_InkingAndInteractionFeedback.xaml.cs Source File

  • PenHaptics
  • cs

Scenario5_InkingAndInteractionFeedback.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 using System.Numerics;
00014 using Windows.Devices.Haptics;
00015 using Windows.Devices.Input;
00016 using Windows.Foundation;
00017 using Windows.UI;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Input;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.UI.Xaml.Shapes;
00023
00024 // This sample shows how to use Inking and Interaction tactile signals in
00025 // conjunction with each other.
00026 // Namely, this sample plays the InkContinuous waveform when dragging a movable
00027 // rectangle and then plays the Click waveform when the rectangle is in range
00028 // of a snap gridline and, finally, if the movable rectangle snaps to a gridline
00029 // upon release, it plays the Click waveform one more time.
00030 namespace SDKTemplate
00031 {
00032     public sealed partial class Scenario5_InkingAndInteractionFeedback : Page
00033     {
00034         private readonly int gridSize = 100;
00035         readonly double snapDistance = 20;
00036         private Point topLeft;
00037         private Point previewTopLeft = new Point(-1, -1);
00038         private TransformGroup transforms;
00039         private MatrixTransform previousTransform;
00040         private CompositeTransform deltaTransform;
00041         PenDevice penDevice;
00042         SimpleHapticsController hapticsController;
00043
00044         // Set the initial configuration of the canvas and the rectangles
00045         public Scenario5_InkingAndInteractionFeedback()
00046         {
00047             InitializeComponent();
00048             InitializeGridLines();
00049             InitializeManipulationTransforms();
00050         }
00051
00052         // Draw gridlines based on the gridSize
00053         private void InitializeGridLines()
00054         {
00055             SolidColorBrush darkGray = new SolidColorBrush(Colors.DarkGray);
00056             double width = hapticCanvas.Width;
00057             double height = hapticCanvas.Height;
00058             for (int i = 0; i <= width; i += gridSize)
00059             {
00060                 Line currLine = new Line() {
00061                     Stroke = darkGray,
00062                     X1 = i,
00063                     X2 = i,
00064                     Y1 = 0,
00065                     Y2 = height,
00066                 };
00067                 hapticCanvas.Children.Add(currLine);
00068             }
00069             for (int i = 0; i <= height; i += gridSize)
00070             {
00071                 Line currLine = new Line() {
00072                     Stroke = darkGray,
00073                     X1 = 0,
00074                     X2 = width,
00075                     Y1 = i,
00076                     Y2 = i,
00077                 };
00078                 hapticCanvas.Children.Add(currLine);
00079             }
00080         }
00081
00082         // Configure the Manipulation transforms that are used to drag the rectangle around
00083         private void InitializeManipulationTransforms()
00084         {
00085             previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
00086             topLeft = new Point(75, 75);
00087             deltaTransform = new CompositeTransform() { TranslateX = topLeft.X, TranslateY = topLeft.Y };
00088
00089             transforms = new TransformGroup() { Children = { previousTransform, deltaTransform } };
00090
00091             // Set the render transform on the rect
00092             movableRect.RenderTransform = transforms;
00093         }
00094
00095         // The PointerEnter event will get fired as soon as Pointer input is received in the movableRect.
00096         // This event handler implementation will query the device providing input to see if it's a pen and
00097         // then check to see the pen supports tactile feedback and, if so, configure the PenDevice
00098         // to send the InkContinuous tactile signal.
00099         private void MovableRect_Entered(object sender, PointerRoutedEventArgs e)
00100         {
00101             // If the current Pointer device is not a pen, exit
00102             if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
00103             {
00104                 return;
00105             }
00106
00107             // Attempt to retrieve the PenDevice from the current PointerId
00108             penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);
00109
00110             // If a PenDevice cannot be retrieved based on the PointerId, it does not support
00111             // advanced pen features, such as tactile feedback
00112             if (penDevice == null)
00113             {
00114                 statusText.Text = "Advanced pen features not supported";
00115                 return;
00116             }
00117
00118             // Check to see if the current PenDevice supports tactile feedback by seeing if it
00119             // has a SimpleHapticsController
00120             hapticsController = penDevice.SimpleHapticsController;
00121             if (hapticsController == null)
00122             {
00123                 statusText.Text = "This pen does not provide tactile feedback";
00124                 return;
00125             }
00126
00127             // Send the InkContinuous waveform to the PenDevice's SimpleHapticsController.
00128             // Once sent, inking continuous tactile feedback will be triggered as soon as the pen tip touches
00129             // the screen and will be stopped once the pen tip is lifted from the screen.
00130             // Also, check to see if the current PenDevice's SimpleHapticsController supports
00131             // setting the intensity value of the tactile feedback.  If so, set it to 0.75.
00132             // If not, send the waveform with the default intensity.
00133             foreach (var waveform in hapticsController.SupportedFeedback)
00134             {
00135                 if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.InkContinuous)
00136                 {
00137                     if (hapticsController.IsIntensitySupported)
00138                     {
00139                         hapticsController.SendHapticFeedback(waveform, 0.75);
00140                      }
00141                     else
00142                     {
00143                         hapticsController.SendHapticFeedback(waveform);
00144                     }
00145                 }
00146             }
00147
00148         }
00149
00150         // Stop sending the tactile feedback and clear the current penDevice and hapticsController on PointerExit.
00151         // Stopping the feedback is important as it clears the tactile signal from the PenDevice's
00152         // SimpleHapticsController, ensuring that it has a clean state once it next enters range.
00153         private void MovableRect_Exited(object sender, PointerRoutedEventArgs e)
00154         {
00155             penDevice = null;
00156             statusText.Text = "";
00157             if (hapticsController != null)
00158             {
00159                 hapticsController.StopFeedback();
00160                 hapticsController = null;
00161             }
00162         }
00163
00164         // Change the color of the movableRect once a manipulation is started. This coincides with the pen
00165         // touching down inside the rectangle, so this color change will happen at the same time that the
00166         // InkContinuous waveform begins playing.
00167         private void MovableRect_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
00168         {
00169             movableRect.Style = MovableRectangleDragged;
00170         }
00171
00172         // Update the position of the movableRect and update the previewRect as needed
00173         private void MovableRect_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
00174         {
00175             previousTransform.Matrix = transforms.Value;
00176
00177             // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve the X and Y changes
00178             deltaTransform.TranslateX = e.Delta.Translation.X;
00179             deltaTransform.TranslateY = e.Delta.Translation.Y;
00180             topLeft.X += e.Delta.Translation.X;
00181             topLeft.Y += e.Delta.Translation.Y;
00182             UpdatePreviewRect();
00183         }
00184
00185         // Update the visibilty or position of the previewRect based on the location
00186         // of the movableRect.
00187         // If the previewRect is snapped to a given gridline for the first time,
00188         // play the Click tactile signal.
00189         private void UpdatePreviewRect()
00190         {
00191             if (IsInSnapRange())
00192             {
00193                 previewRect.Visibility = Visibility.Visible;
00194                 Point newPreviewTopLeft = GetSnappedPoint();
00195
00196                 // Check to see if this is the first time that the previewRect is in range of a given gridline
00197                 // and send the Click tactile signal if so
00198                 bool sendHaptics = true;
00199                 if ((previewTopLeft.X == newPreviewTopLeft.X && previewTopLeft.Y == newPreviewTopLeft.Y) ||
00200                     (previewTopLeft.X == newPreviewTopLeft.X && newPreviewTopLeft.Y == topLeft.Y) ||
00201                     (previewTopLeft.Y == newPreviewTopLeft.Y && newPreviewTopLeft.X == topLeft.X))
00202                 {
00203                     sendHaptics = false;
00204                 }
00205                 if (previewTopLeft.X != newPreviewTopLeft.X || previewTopLeft.Y != newPreviewTopLeft.Y)
00206                 {
00207                     previewTopLeft = newPreviewTopLeft;
00208                     previewRect.Translation = new Vector3((float)previewTopLeft.X, (float)previewTopLeft.Y, 0);
00209                     if (hapticsController != null && sendHaptics)
00210                     {
00211                         foreach (var waveform in hapticsController.SupportedFeedback)
00212                         {
00213                             if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.Click)
00214                             {
00215                                 hapticsController.SendHapticFeedback(waveform);
00216                             }
00217                         }
00218                     }
00219                 }
00220             }
00221             else
00222             {
00223                 previewRect.Visibility = Visibility.Collapsed;
00224                 previewTopLeft = new Point(-1, -1);
00225             }
00226         }
00227
00228         // When the manipulation is over, reset the color of the movableRect and
00229         // snap it to a gridline if appropriate
00230         private void MovableRect_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
00231         {
00232             movableRect.Style = MovableRectangle;
00233             if (IsInSnapRange())
00234             {
00235                 SnapMovableRectToGridLines();
00236             }
00237         }
00238
00239         // Updates the position of the movableRect to snap to the appropriate gridline(s).
00240         // In addition, play the Click tactile signal to provide additional feedback to the user that it has snapped.
00241         private void SnapMovableRectToGridLines()
00242         {
00243             topLeft = GetSnappedPoint();
00244             previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
00245             deltaTransform.TranslateX = topLeft.X;
00246             deltaTransform.TranslateY = topLeft.Y;
00247
00248             transforms = new TransformGroup() { Children = { previousTransform, deltaTransform } };
00249
00250             movableRect.RenderTransform = transforms;
00251
00252             if (hapticsController != null)
00253             {
00254                 foreach (var waveform in hapticsController.SupportedFeedback)
00255                 {
00256                     if (waveform.Waveform == KnownSimpleHapticsControllerWaveforms.Click)
00257                     {
00258                         hapticsController.SendHapticFeedback(waveform);
00259                     }
00260                 }
00261             }
00262         }
00263
00264         // Retrieve the point corresponding to the top-left corner of where the movableRect would snap to
00265         // if released.
00266         private Point GetSnappedPoint()
00267         {
00268             Point snappedPoint;
00269             if (topLeft.X % gridSize <= snapDistance)
00270             {
00271                 snappedPoint.X = topLeft.X + topLeft.X % gridSize * -1;
00272             }
00273             else if (topLeft.X % gridSize >= gridSize - snapDistance)
00274             {
00275                 snappedPoint.X = topLeft.X + gridSize - (topLeft.X % gridSize);
00276             }
00277             else
00278             {
00279                 snappedPoint.X = topLeft.X;
00280             }
00281             if (topLeft.Y % gridSize <= snapDistance)
00282             {
00283                 snappedPoint.Y = topLeft.Y + topLeft.Y % gridSize * -1;
00284             }
00285             else if (topLeft.Y % gridSize >= gridSize - snapDistance)
00286             {
00287                 snappedPoint.Y = topLeft.Y + gridSize - (topLeft.Y % gridSize);
00288             }
00289             else
00290             {
00291                 snappedPoint.Y = topLeft.Y;
00292             }
00293             return snappedPoint;
00294         }
00295
00296         // Check to see if the movableRect is currently within snapping range of a gridline
00297         private bool IsInSnapRange()
00298         {
00299             return topLeft.X % gridSize <= snapDistance ||
00300                 topLeft.X % gridSize >= gridSize - snapDistance ||
00301                 topLeft.Y % gridSize <= snapDistance ||
00302                 topLeft.Y % gridSize >= gridSize - snapDistance;
00303         }
00304     }
00305 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CameraRotationHelper Member List

This is the complete list of members for CameraRotationHelper, including all inherited members.
_cameraEnclosureLocation | CameraRotationHelper | [private]
_displayInformation | CameraRotationHelper | [private]
_orientationSensor | CameraRotationHelper | [private]
AddOrientations(SimpleOrientation a, SimpleOrientation b) | CameraRotationHelper | [inline, private, static]
CameraRotationHelper(EnclosureLocation cameraEnclosureLocation) | CameraRotationHelper | [inline]
ConvertClockwiseDegreesToSimpleOrientation(int orientation) | CameraRotationHelper | [inline, private, static]
ConvertDisplayOrientationToSimpleOrientation(DisplayOrientations orientation) | CameraRotationHelper | [inline, private]
ConvertSimpleOrientationToClockwiseDegrees(SimpleOrientation orientation) | CameraRotationHelper | [inline, static]
ConvertSimpleOrientationToPhotoOrientation(SimpleOrientation orientation) | CameraRotationHelper | [inline, static]
ConvertSimpleOrientationToVideoRotation(SimpleOrientation orientation) | CameraRotationHelper | [inline, private, static]
DisplayInformation_OrientationChanged(DisplayInformation sender, object args) | CameraRotationHelper | [inline, private]
GetCameraCaptureOrientation() | CameraRotationHelper | [inline]
GetCameraOrientationRelativeToNativeOrientation() | CameraRotationHelper | [inline, private]
GetCameraPreviewOrientation() | CameraRotationHelper | [inline]
GetUIOrientation() | CameraRotationHelper | [inline]
IsEnclosureLocationExternal(EnclosureLocation enclosureLocation) | CameraRotationHelper | [inline, static]
MirrorOrientation(SimpleOrientation orientation) | CameraRotationHelper | [inline, private, static]
OrientationChanged | CameraRotationHelper |
ShouldMirrorPreview() | CameraRotationHelper | [inline, private]
SimpleOrientationSensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args) | CameraRotationHelper | [inline, private]
SubtractOrientations(SimpleOrientation a, SimpleOrientation b) | CameraRotationHelper | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/SampleConfiguration.cs Source File

  • BasicInput
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Basic Input sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Input Events", ClassType=typeof(Scenario1)},
00025             new Scenario() { Title="PointerPoint Properties", ClassType=typeof(Scenario2)},
00026             new Scenario() { Title="Device Capabilities", ClassType=typeof(Scenario3)},
00027             new Scenario() { Title="XAML Manipulations", ClassType=typeof(Scenario4)},
00028             new Scenario() { Title="Gesture Recognizer", ClassType=typeof(Scenario5)}
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/StreamResolution.cs Source File

  • CameraResolution
  • cs

StreamResolution.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Media.Capture;
00014 using Windows.Media.MediaProperties;
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// Wrapper class around IMediaEncodingProperties to help how devices report supported resolutions
00020     /// </summary>
00021     class StreamResolution
00022     {
00023         private IMediaEncodingProperties _properties;
00024
00025         public StreamResolution(IMediaEncodingProperties properties)
00026         {
00027             if (properties == null)
00028             {
00029                 throw new ArgumentNullException(nameof(properties));
00030             }
00031
00032             // Only handle ImageEncodingProperties and VideoEncodingProperties, which are the two types that GetAvailableMediaStreamProperties can return
00033             if (!(properties is ImageEncodingProperties) && !(properties is VideoEncodingProperties))
00034             {
00035                 throw new ArgumentException("Argument is of the wrong type. Required: " + typeof(ImageEncodingProperties).Name
00036                     + " or " + typeof(VideoEncodingProperties).Name + ".", nameof(properties));
00037             }
00038
00039             // Store the actual instance of the IMediaEncodingProperties for setting them later
00040             _properties = properties;
00041         }
00042
00043         public uint Width
00044         {
00045             get
00046             {
00047                 if (_properties is ImageEncodingProperties)
00048                 {
00049                     return (_properties as ImageEncodingProperties).Width;
00050                 }
00051                 else if (_properties is VideoEncodingProperties)
00052                 {
00053                     return (_properties as VideoEncodingProperties).Width;
00054                 }
00055
00056                 return 0;
00057             }
00058         }
00059
00060         public uint Height
00061         {
00062             get
00063             {
00064                 if (_properties is ImageEncodingProperties)
00065                 {
00066                     return (_properties as ImageEncodingProperties).Height;
00067                 }
00068                 else if (_properties is VideoEncodingProperties)
00069                 {
00070                     return (_properties as VideoEncodingProperties).Height;
00071                 }
00072
00073                 return 0;
00074             }
00075         }
00076
00077         public uint FrameRate
00078         {
00079             get
00080             {
00081                 if (_properties is VideoEncodingProperties)
00082                 {
00083                     if ((_properties as VideoEncodingProperties).FrameRate.Denominator != 0)
00084                     {
00085                         return (_properties as VideoEncodingProperties).FrameRate.Numerator / (_properties as VideoEncodingProperties).FrameRate.Denominator;
00086                     }
00087                 }
00088
00089                 return 0;
00090             }
00091         }
00092
00093         public double AspectRatio
00094         {
00095             get { return Math.Round((Height != 0) ? (Width / (double)Height) : double.NaN, 2); }
00096         }
00097
00098         public IMediaEncodingProperties EncodingProperties
00099         {
00100             get { return _properties; }
00101         }
00102
00103         /// <summary>
00104         /// Output properties to a readable format for UI purposes
00105         /// eg. 1920x1080 [1.78] 30fps MPEG
00106         /// </summary>
00107         /// <returns>Readable string</returns>
00108         public string GetFriendlyName(bool showFrameRate = true)
00109         {
00110             if (_properties is ImageEncodingProperties ||
00111                 !showFrameRate)
00112             {
00113                 return Width + "x" + Height + " [" + AspectRatio + "] " + _properties.Subtype;
00114             }
00115             else if (_properties is VideoEncodingProperties)
00116             {
00117                 return Width + "x" + Height + " [" + AspectRatio + "] " + FrameRate + "FPS " + _properties.Subtype;
00118             }
00119
00120             return String.Empty;
00121         }
00122     }
00123 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/SampleData.cs Source File

  • XamlContextMenu
  • cs

SampleData.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003
00004 namespace SDKTemplate
00005 {
00006     public class SampleDataModel
00007     {
00008         public string Title { get; private set; }
00009         public string ImagePath { get; private set; }
00010
00011         public SampleDataModel(string title, string imagePath)
00012         {
00013             this.Title = title;
00014             this.ImagePath = imagePath;
00015         }
00016
00017         // Not used in sample but makes debugging easier.
00018         public override string ToString() => this.Title;
00019
00020         static public List<SampleDataModel> GetSampleData()
00021         {
00022             return new List<SampleDataModel>() {
00023                 new SampleDataModel("Cliff", "Assets/cliff.jpg"),
00024                 new SampleDataModel("Grapes", "Assets/grapes.jpg"),
00025                 new SampleDataModel("Rainier", "Assets/Rainier.jpg"),
00026                 new SampleDataModel("Sunset", "Assets/Sunset.jpg"),
00027                 new SampleDataModel("Treetops", "Assets/Treetops.jpg"),
00028                 new SampleDataModel("Valley", "Assets/Valley.jpg"),
00029             };
00030         }
00031     }
00032 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DetailPage Member List

This is the complete list of members for DetailPage, including all inherited members.
DetailPage() | DetailPage | [inline]
DetailPage_BackRequested(object sender, BackRequestedEventArgs e) | DetailPage | [inline, private]
Item | DetailPage |
ItemProperty | DetailPage | [static]
NavigateBackForWideState(bool useTransition) | DetailPage | [inline, private]
OnBackRequested() | DetailPage | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | DetailPage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | DetailPage | [inline, protected]
PageRoot_Loaded(object sender, RoutedEventArgs e) | DetailPage | [inline, private]
PageRoot_Unloaded(object sender, RoutedEventArgs e) | DetailPage | [inline, private]
ReplaceLastBackStackEntryParameter(object parameter) | DetailPage | [inline, private]
s_itemProperty | DetailPage | [private, static]
ShouldGoToWideState() | DetailPage | [inline, private]
Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) | DetailPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario3_CustomException.xaml.h Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario3_CustomException.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario3_CustomException.g.h"
00009
00010 namespace SDKSample
00011 {
00012     namespace ProxyStubsForWinRTComponents
00013     {
00014         public ref class CustomException sealed
00015         {
00016         public:
00017             CustomException();
00018
00019         private:
00020             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021         };
00022     }
00023 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario1_DataEvents.xaml.h Source File

  • Inclinometer
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Sensors::Inclinometer^ inclinometer;
00041         Windows::Foundation::EventRegistrationToken visibilityToken;
00042         Windows::Foundation::EventRegistrationToken readingToken;
00043         uint32 desiredReportInterval;
00044
00045         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00046         void ReadingChanged(Windows::Devices::Sensors::Inclinometer^ sender, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^ e);
00047         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/pch.h Source File

  • SimpleInk
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/DeviceListEntry.cs Source File

  • CustomSerialDeviceAccess
  • cs

DeviceListEntry.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 using Windows.Devices.Enumeration;
00019
00020 namespace CustomSerialDeviceAccess
00021 {
00022     /// <summary>
00023     /// The class will only expose properties from DeviceInformation that are going to be used
00024     /// in this sample. Each instance of this class provides information about a single device.
00025     ///
00026     /// This class is used by the UI to display device specific information so that
00027     /// the user can identify which device to use.
00028     /// </summary>
00029     public class DeviceListEntry
00030     {
00031         private DeviceInformation device;
00032         private String deviceSelector;
00033
00034         public String InstanceId
00035         {
00036             get
00037             {
00038                 return device.Properties[DeviceProperties.DeviceInstanceId] as String;
00039             }
00040         }
00041
00042         public DeviceInformation DeviceInformation
00043         {
00044             get
00045             {
00046                 return device;
00047             }
00048         }
00049
00050         public String DeviceSelector
00051         {
00052             get
00053             {
00054                 return deviceSelector;
00055             }
00056         }
00057
00058         /// <summary>
00059         /// The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.
00060         /// </summary>
00061         /// <param name="deviceInformation"></param>
00062         /// <param name="deviceSelector">The AQS used to find this device</param>
00063         public DeviceListEntry(Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)
00064         {
00065             device = deviceInformation;
00066             this.deviceSelector = deviceSelector;
00067         }
00068
00069     }
00070 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceServiceEventAdapter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 // This class, and the associated EventArgs classes, exist for the benefit of JavaScript developers who
00026 // do not have the ability to implement ISecureInterfaceService. Instead, SecureInterfaceServiceEventAdapter
00027 // provides the Interface implementation and exposes a set of compatible events to the developer.
00028 public ref class SecureInterfaceServiceEventAdapter sealed : [Windows::Foundation::Metadata::Default] ISecureInterfaceService
00029 {
00030 public:
00031     // Method Invocation Events
00032     event Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceConcatenateCalledEventArgs^>^ ConcatenateCalled
00033     {
00034         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceConcatenateCalledEventArgs^>^ handler)
00035         {
00036             return _ConcatenateCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
00037             ([handler](Platform::Object^ sender, Platform::Object^ args)
00038             {
00039                 handler->Invoke(safe_cast<SecureInterfaceServiceEventAdapter^>(sender), safe_cast<SecureInterfaceConcatenateCalledEventArgs^>(args));
00040             }, Platform::CallbackContext::Same);
00041         }
00042         void remove(Windows::Foundation::EventRegistrationToken token)
00043         {
00044             _ConcatenateCalled -= token;
00045         }
00046     internal:
00047         void raise(SecureInterfaceServiceEventAdapter^ sender, SecureInterfaceConcatenateCalledEventArgs^ args)
00048         {
00049             _ConcatenateCalled(sender, args);
00050         }
00051     }
00052
00053     // Property Read Events
00054     event Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^>^ GetIsUpperCaseEnabledRequested
00055     {
00056         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^>^ handler)
00057         {
00058             return _GetIsUpperCaseEnabledRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
00059             ([handler](Platform::Object^ sender, Platform::Object^ args)
00060             {
00061                 handler->Invoke(safe_cast<SecureInterfaceServiceEventAdapter^>(sender), safe_cast<SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^>(args));
00062             }, Platform::CallbackContext::Same);
00063         }
00064         void remove(Windows::Foundation::EventRegistrationToken token)
00065         {
00066             _GetIsUpperCaseEnabledRequested -= token;
00067         }
00068     internal:
00069         void raise(SecureInterfaceServiceEventAdapter^ sender, SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^ args)
00070         {
00071             _GetIsUpperCaseEnabledRequested(sender, args);
00072         }
00073     }
00074
00075     // Property Write Events
00076     event Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs^>^ SetIsUpperCaseEnabledRequested
00077     {
00078         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceServiceEventAdapter^, SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs^>^ handler)
00079         {
00080             return _SetIsUpperCaseEnabledRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
00081             ([handler](Platform::Object^ sender, Platform::Object^ args)
00082             {
00083                 handler->Invoke(safe_cast<SecureInterfaceServiceEventAdapter^>(sender), safe_cast<SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs^>(args));
00084             }, Platform::CallbackContext::Same);
00085         }
00086         void remove(Windows::Foundation::EventRegistrationToken token)
00087         {
00088             _SetIsUpperCaseEnabledRequested -= token;
00089         }
00090     internal:
00091         void raise(SecureInterfaceServiceEventAdapter^ sender, SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs^ args)
00092         {
00093             _SetIsUpperCaseEnabledRequested(sender, args);
00094         }
00095     }
00096
00097     // ISecureInterfaceService Implementation
00098     virtual Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^>^ ConcatenateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2);
00099
00100     virtual Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ GetIsUpperCaseEnabledAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00101
00102     virtual Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ SetIsUpperCaseEnabledAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ bool value);
00103
00104 private:
00105     event Windows::Foundation::EventHandler<Platform::Object^>^ _ConcatenateCalled;
00106     event Windows::Foundation::EventHandler<Platform::Object^>^ _GetIsUpperCaseEnabledRequested;
00107     event Windows::Foundation::EventHandler<Platform::Object^>^ _SetIsUpperCaseEnabledRequested;
00108 };
00109
00110 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario3_AddAudioTracks.xaml.cpp Source File

  • MediaEditing
  • cpp

Scenario3_AddAudioTracks.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_AddAudioTracks.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace concurrency;
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027 using namespace Windows::Media::Core;
00028 using namespace Windows::Media::Editing;
00029 using namespace Windows::Storage;
00030 using namespace Windows::Storage::Pickers;
00031 using namespace Windows::Storage::Streams;
00032
00033 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00034
00035 Scenario3_AddAudioTracks::Scenario3_AddAudioTracks() : rootPage(MainPage::Current)
00036 {
00037     InitializeComponent();
00038 }
00039
00040 void Scenario3_AddAudioTracks::OnNavigatedFrom(NavigationEventArgs^ e)
00041 {
00042     mediaElement->Source = nullptr;
00043     mediaStreamSource = nullptr;
00044 }
00045
00046 void Scenario3_AddAudioTracks::ChooseVideo_Click(Object^ sender, RoutedEventArgs^ e)
00047 {
00048     auto picker = ref new FileOpenPicker();
00049     picker->SuggestedStartLocation = PickerLocationId::VideosLibrary;
00050     picker->FileTypeFilter->Append(".mp4");
00051
00052     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ videoFile)
00053     {
00054         if (videoFile == nullptr)
00055         {
00056             rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00057             return;
00058         }
00059
00060         this->pickedFile = videoFile;
00061         create_task(this->pickedFile->OpenReadAsync()).then([this](IRandomAccessStreamWithContentType^ videoSource)
00062         {
00063             mediaElement->SetSource(videoSource, pickedFile->ContentType);
00064             addAudio->IsEnabled = true;
00065
00066             rootPage->NotifyUser("Video file added", NotifyType::StatusMessage);
00067         });
00068     });
00069 }
00070
00071 void Scenario3_AddAudioTracks::AddAudio_Click(Object^ sender, RoutedEventArgs^ e)
00072 {
00073     // Create the original MediaComposition
00074     create_task(MediaClip::CreateFromFileAsync(pickedFile)).then([this](MediaClip^ clip)
00075     {
00076         composition = ref new MediaComposition();
00077         composition->Clips->Append(clip);
00078
00079         // Add background audio
00080         auto picker = ref new FileOpenPicker();
00081         picker->SuggestedStartLocation = PickerLocationId::MusicLibrary;
00082         picker->FileTypeFilter->Append(".mp3");
00083         picker->FileTypeFilter->Append(".wav");
00084         picker->FileTypeFilter->Append(".flac");
00085
00086         create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ audioFile)
00087         {
00088             if (audioFile == nullptr)
00089             {
00090                 rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00091                 return;
00092             }
00093
00094             create_task(BackgroundAudioTrack::CreateFromFileAsync(audioFile)).then([this](BackgroundAudioTrack^ backgroundTrack)
00095             {
00096                 composition->BackgroundAudioTracks->Append(backgroundTrack);
00097
00098                 // Render to MediaElement
00099                 mediaStreamSource = composition->GeneratePreviewMediaStreamSource((int)mediaElement->ActualWidth, (int)mediaElement->ActualHeight);
00100                 mediaElement->SetMediaStreamSource(mediaStreamSource);
00101
00102                 rootPage->NotifyUser("Background audio added", NotifyType::StatusMessage);
00103             });
00104         });
00105     });
00106 }
Generated on Fri Nov 15 2024 22:20:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario2_Icons.xaml.cpp Source File

  • XamlCommanding
  • cpp

Scenario2_Icons.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Icons.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00029
00030 Scenario2_Icons::Scenario2_Icons()
00031 {
00032     InitializeComponent();
00033 }
Generated on Fri Nov 15 2024 22:22:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Constants.cs Source File

  • BluetoothLE
  • cs

Constants.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Devices.Bluetooth.GenericAttributeProfile;
00003
00004 namespace SDKTemplate
00005 {
00006     // Define the characteristics and other properties of our custom service.
00007     public class Constants
00008     {
00009         // BT_Code: Initializes custom local parameters w/ properties, protection levels as well as common descriptors like User Description.
00010         public static readonly GattLocalCharacteristicParameters gattOperandParameters = new GattLocalCharacteristicParameters
00011         {
00012             CharacteristicProperties = GattCharacteristicProperties.Write |
00013                                        GattCharacteristicProperties.WriteWithoutResponse,
00014             WriteProtectionLevel = GattProtectionLevel.Plain,
00015             UserDescription = "Operand Characteristic"
00016         };
00017
00018         public static readonly GattLocalCharacteristicParameters gattOperatorParameters = new GattLocalCharacteristicParameters
00019         {
00020             CharacteristicProperties = GattCharacteristicProperties.Write |
00021                                        GattCharacteristicProperties.WriteWithoutResponse,
00022             WriteProtectionLevel = GattProtectionLevel.Plain,
00023             UserDescription = "Operator Characteristic"
00024         };
00025
00026         public static readonly GattLocalCharacteristicParameters gattResultParameters = new GattLocalCharacteristicParameters
00027         {
00028             CharacteristicProperties = GattCharacteristicProperties.Read |
00029                                        GattCharacteristicProperties.Notify,
00030             WriteProtectionLevel = GattProtectionLevel.Plain,
00031             UserDescription = "Result Characteristic"
00032         };
00033
00034         public static readonly Guid CalcServiceUuid = Guid.Parse("caecface-e1d9-11e6-bf01-fe55135034f0");
00035
00036         public static readonly Guid Op1CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f1");
00037         public static readonly Guid Op2CharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f2");
00038         public static readonly Guid OperatorCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f3");
00039         public static readonly Guid ResultCharacteristicUuid = Guid.Parse("caec2ebc-e1d9-11e6-bf01-fe55135034f4");
00040     };
00041 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/MFSampleGenerator.cpp Source File

  • WindowsAudioSession
  • cppwinrt

MFSampleGenerator.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "MFSampleGenerator.h"
00013
00014 using namespace winrt::Windows::Storage::Streams;
00015
00016 namespace winrt::SDKTemplate
00017 {
00018 #define PREROLL_DURATION_SEC 3     // Arbitrary value for seconds of data in preroll buffer
00019
00020     //
00021     //  Shutdown()
00022     //
00023     void MFSampleGenerator::Shutdown()
00024     {
00025         if (m_isInitialized)
00026         {
00027             m_audioMediaType = nullptr;
00028             m_sourceReader = nullptr;
00029
00030             m_sampleQueue.clear();
00031
00032             m_isInitialized = false;
00033         }
00034     }
00035
00036     //
00037     //  StartSource()
00038     //
00039     //  Start the media source to read samples
00040     //
00041     void MFSampleGenerator::StartSource()
00042     {
00043         if (!m_isInitialized)
00044         {
00045             throw hresult_illegal_state_change();
00046         }
00047
00048         // We can be in EOS if this is a resume from pause
00049         if ((m_readerState == ReaderState::PreRoll) ||
00050             (m_readerState == ReaderState::Playing) ||
00051             (m_readerState == ReaderState::EndOfStream))
00052             return;
00053
00054         // This will start the source reader and asynchronously call OnReadSample
00055         check_hresult(m_sourceReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, nullptr, nullptr, nullptr, nullptr));
00056         m_readerState = ReaderState::PreRoll;
00057     }
00058
00059     //
00060     //  StopSource()
00061     //
00062     //  Stops the media source from reading samples
00063     //
00064     void MFSampleGenerator::StopSource()
00065     {
00066         // We only really need this if Source is still reading samples, otherwise
00067         // we should be in an EndOfStream state and parsing existing samples in the queue
00068         m_readerState = ReaderState::Stopped;
00069     }
00070
00071     //
00072     //  Initialize()
00073     //
00074     //  Configure the Source Reader
00075     //
00076     void MFSampleGenerator::Initialize(IRandomAccessStream const& stream, UINT32 framesPerPeriod, WAVEFORMATEX* wfx)
00077     {
00078         m_audioMediaType = nullptr;
00079         m_sourceReader = nullptr;
00080
00081         com_ptr<IMFAttributes> attributes;
00082         check_hresult(MFCreateAttributes(attributes.put(), 3));
00083
00084         // Specify Source Reader Attributes
00085         check_hresult(attributes->SetUnknown(MF_SOURCE_READER_ASYNC_CALLBACK, this));
00086         check_hresult(attributes->SetString(MF_READWRITE_MMCSS_CLASS_AUDIO, L"Audio"));
00087         check_hresult(attributes->SetUINT32(MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0));
00088
00089         // Create a stream from IRandomAccessStream
00090         com_ptr<IMFByteStream> byteStream;
00091         check_hresult(MFCreateMFByteStreamOnStreamEx(winrt::get_unknown(stream), byteStream.put()));
00092
00093         // Create source reader
00094         com_ptr<IMFSourceReader> sourceReader;
00095         check_hresult(MFCreateSourceReaderFromByteStream(byteStream.get(), attributes.get(), sourceReader.put()));
00096
00097         // Configure media types. If this succeeds, then everything passed and we commit our changes.
00098         m_audioMediaType = ConfigureStreams(sourceReader, wfx);
00099         m_sourceReader = std::move(sourceReader);
00100
00101         m_bytesPerPeriod = framesPerPeriod * wfx->nBlockAlign;
00102
00103         // For uncompressed formats, nAvgBytesPerSec should equal nSamplesPerSecond * nBlockAlign
00104         m_bytesPerSecond = wfx->nAvgBytesPerSec;
00105
00106         m_isInitialized = true;
00107     }
00108
00109
00110     //
00111     //  ConfigureStreams()
00112     //
00113     //  Enables the first audio stream and configures the media type
00114     //
00115     com_ptr<IMFMediaType> MFSampleGenerator::ConfigureStreams(com_ptr<IMFSourceReader> const& reader, WAVEFORMATEX* wfx)
00116     {
00117         // Disable all streams
00118         check_hresult(reader->SetStreamSelection((DWORD)MF_SOURCE_READER_ALL_STREAMS, false));
00119
00120         // Enable first audio stream
00121         check_hresult(reader->SetStreamSelection((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, true));
00122
00123         com_ptr<IMFMediaType> partialMediaType = CreateAudioType(wfx);
00124
00125         // Set type on source reader so necessary converters / decoders will be added
00126         check_hresult(reader->SetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, nullptr, partialMediaType.get()));
00127
00128         // Verify the media type on stream
00129         com_ptr<IMFMediaType> uncompressedMediaType;
00130         check_hresult(reader->GetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, uncompressedMediaType.put()));
00131
00132         unique_cotaskmem_ptr<WAVEFORMATEX> createdWfx;
00133         UINT32 cbFormat = 0;
00134         check_hresult(MFCreateWaveFormatExFromMFMediaType(uncompressedMediaType.get(), createdWfx.put(), &cbFormat));
00135
00136         return uncompressedMediaType;
00137     }
00138
00139     //
00140     //  CreateAudioType()
00141     //
00142     //  Create an audio type based on the default mix format from the renderer
00143     //
00144     com_ptr<IMFMediaType> MFSampleGenerator::CreateAudioType(WAVEFORMATEX* wfx)
00145     {
00146         com_ptr<IMFMediaType> mediaType;
00147
00148         // Create a partial media type for our mix format (PCM or IEEE Float)
00149         check_hresult(MFCreateMediaType(mediaType.put()));
00150
00151         // Set media type attributes
00152         check_hresult(mediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio));
00153
00154         switch (GetRenderSampleType(wfx))
00155         {
00156         case RenderSampleType::Pcm16Bit:
00157         case RenderSampleType::Pcm24In32Bit:
00158             check_hresult(mediaType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
00159             break;
00160         case RenderSampleType::Float:
00161             check_hresult(mediaType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_Float));
00162             break;
00163         default:
00164             throw hresult_error(E_UNEXPECTED);
00165         }
00166
00167         check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, wfx->nChannels));
00168         check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, wfx->nSamplesPerSec));
00169         check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, wfx->nBlockAlign));
00170         check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, wfx->nAvgBytesPerSec));
00171         check_hresult(mediaType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, wfx->wBitsPerSample));
00172         check_hresult(mediaType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, true));
00173
00174         return mediaType;
00175     }
00176
00177     //
00178     //  OnEvent()
00179     //
00180     //  Implementation of IMFSourceReaderCallback::OnEvent()
00181     //
00182     HRESULT MFSampleGenerator::OnEvent([[maybe_unused]] DWORD streamIndex, [[maybe_unused]] IMFMediaEvent* event)
00183     {
00184         return S_OK;
00185     }
00186
00187     //
00188     //  OnFlush()
00189     //
00190     //  Implementation of IMFSourceReaderCallback::OnFlush()
00191     //
00192     HRESULT MFSampleGenerator::OnFlush([[maybe_unused]] DWORD streamIndex)
00193     {
00194         return S_OK;
00195     }
00196
00197     //
00198     //  OnReadSample()
00199     //
00200     //  Implementation of IMFSourceReaderCallback::OnReadSample().  When a sample is ready, add it to the sample queue.
00201     //
00202     HRESULT MFSampleGenerator::OnReadSample(HRESULT error, [[maybe_unused]] DWORD streamIndex,  DWORD streamFlags, [[maybe_unused]] LONGLONG timestamp, IMFSample* sample) try
00203     {
00204         if ((m_readerState != ReaderState::Playing) &&
00205             (m_readerState != ReaderState::PreRoll))
00206         {
00207             return S_OK;
00208         }
00209
00210         // If we have a failure, change in stream format, or hit EOF, then we stop reading samples
00211         if ((FAILED(error)) ||
00212             (streamFlags & MF_SOURCE_READERF_ENDOFSTREAM) ||
00213             (streamFlags & MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED))
00214         {
00215             m_readerState = ReaderState::EndOfStream;
00216             return S_OK;
00217         }
00218
00219         // If there were no samples read, then ignore the callback.
00220         if (!sample)
00221         {
00222             return S_OK;
00223         }
00224
00225         // Add the data from the Media Sample to our buffer queue
00226         AddSamplesToQueue(sample);
00227
00228         // Pre-roll PREROLL_DURATION seconds worth of data
00229         if (m_readerState == ReaderState::PreRoll)
00230         {
00231             if (IsPreRollFilled())
00232             {
00233                 // Once Pre-roll is filled, audio endpoint will stop rendering silence and start
00234                 // picking up data from the queue
00235                 m_readerState = ReaderState::Playing;
00236             }
00237         }
00238
00239         // Call ReadSample for next asynchronous sample event
00240         check_hresult(m_sourceReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, nullptr, nullptr, nullptr, nullptr));
00241
00242         return S_OK;
00243     }
00244     catch (...) { return to_hresult(); }
00245
00246     //
00247     //  FillSampleBuffer()
00248     //
00249     //  Called by the audio endpoint to get data to render, and will set cbWritten to valid number of
00250     //  bytes in the buffer.  The buffers are zeroed out when initialized so the endpoint could feasibly
00251     //  treat the data as silence. If there are no more samples to render, will return false.
00252     //
00253     bool MFSampleGenerator::FillSampleBuffer(array_view<uint8_t> buffer, uint32_t* cbWritten)
00254     {
00255         *cbWritten = 0;
00256
00257         if (!m_isInitialized)
00258         {
00259             throw hresult_error(E_UNEXPECTED);
00260         }
00261
00262         // Not going to return any data here while in a pre-roll state.
00263         if (m_readerState == ReaderState::PreRoll)
00264         {
00265             return true;
00266         }
00267
00268         if (m_sampleQueue.empty())
00269         {
00270             if (m_readerState == ReaderState::EndOfStream)
00271             {
00272                 // We are EOS, should be set from OnReadSample() and the client should check for EOS before
00273                 // calling FillSampleBuffer()
00274                 return false;
00275             }
00276             else
00277             {
00278                 // There shouldn't be a situation where we get here unless the reader has
00279                 // somehow gotten into the wrong state
00280                 throw hresult_error(E_FAIL);
00281             }
00282         }
00283         else
00284         {
00285             RenderBuffer& sampleBuffer = m_sampleQueue.front();
00286
00287             if (sampleBuffer.BufferSize > buffer.size())
00288             {
00289                 // We don't have enough data in the client audio buffer this pass
00290                 // Do nothing and wait for the next sample period
00291             }
00292             else
00293             {
00294                 CopyMemory(buffer.data(), sampleBuffer.Buffer.get(), sampleBuffer.BufferSize);
00295
00296                 *cbWritten = sampleBuffer.BufferSize;
00297                 m_sampleQueue.pop_front();
00298             }
00299         }
00300         return true;
00301     }
00302
00303     //
00304     //  AddSamplesToBuffer()
00305     //
00306     //  Data is added to the end of the sample queue
00307     //
00308     void MFSampleGenerator::AddSamplesToQueue(IMFSample* sample)
00309     {
00310         com_ptr<IMFMediaBuffer> mediaBuffer;
00311
00312         // Since we are storing the raw byte data, convert this to a single buffer
00313         check_hresult(sample->ConvertToContiguousBuffer(mediaBuffer.put()));
00314
00315         // Lock the sample
00316         BYTE* audioData = nullptr;
00317         DWORD cbAudioData = 0;
00318         check_hresult(mediaBuffer->Lock(&audioData, NULL, &cbAudioData));
00319
00320         // Make sure we unlock the buffer.
00321         auto unlock = scope_exit([&] { mediaBuffer->Unlock(); });
00322
00323         DWORD cbBytesCopied = 0;
00324
00325         // First fill up any partial buffers from the previous sample
00326         if ((m_sampleQueueTail != m_sampleQueue.before_begin()) &&
00327             (m_sampleQueueTail->BytesFilled < m_sampleQueueTail->BufferSize))
00328         {
00329             RenderBuffer& PartialBuffer = *m_sampleQueueTail;
00330
00331             DWORD cbBytesRemaining = PartialBuffer.BufferSize - PartialBuffer.BytesFilled;
00332             DWORD cbBytesToCopy = (std::min)(cbAudioData, cbBytesRemaining);
00333
00334             CopyMemory(PartialBuffer.Buffer.get() + PartialBuffer.BytesFilled, audioData, cbBytesToCopy);
00335
00336             PartialBuffer.BytesFilled += cbBytesToCopy;
00337             cbBytesCopied += cbBytesToCopy;
00338         }
00339
00340         // Create buffers for the remainder of the samples
00341         while (cbBytesCopied < cbAudioData)
00342         {
00343             m_sampleQueueTail = m_sampleQueue.emplace_after(m_sampleQueueTail, m_bytesPerPeriod);
00344             RenderBuffer& SampleBuffer = *m_sampleQueueTail;
00345
00346             DWORD cbBytesRemaining = cbAudioData - cbBytesCopied;
00347             DWORD cbBytesToCopy = (std::min)(static_cast<DWORD>(SampleBuffer.BufferSize), cbBytesRemaining);
00348
00349             SampleBuffer.BytesFilled = 0;
00350
00351             ZeroMemory(SampleBuffer.Buffer.get(), m_bytesPerPeriod);
00352             CopyMemory(SampleBuffer.Buffer.get(), audioData + cbBytesCopied, cbBytesToCopy);
00353
00354             SampleBuffer.BytesFilled += cbBytesToCopy;
00355             cbBytesCopied += cbBytesToCopy;
00356         }
00357     }
00358
00359     //
00360     //  IsPreRollFilled()
00361     //
00362     //  Loops through the queue quickly to see if our pre-roll buffer is filled
00363     //
00364     bool MFSampleGenerator::IsPreRollFilled()
00365     {
00366         DWORD totalBytes = 0;
00367
00368         for (RenderBuffer& sampleBuffer : m_sampleQueue)
00369         {
00370             totalBytes += sampleBuffer.BytesFilled;
00371
00372             if (totalBytes >= m_bytesPerSecond * PREROLL_DURATION_SEC)
00373             {
00374                 return true;
00375             }
00376         }
00377
00378         return false;
00379     }
00380 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario2_Polling.xaml.h Source File

  • Inclinometer
  • cpp

Scenario2_Polling.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.h
00014 // Declaration of the Scenario2_Polling class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2_Polling.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario2_Polling sealed
00030     {
00031     public:
00032         Scenario2_Polling();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::UI::Core::CoreDispatcher^ dispatcher;
00041         Windows::Devices::Sensors::Inclinometer^ inclinometer;
00042         Windows::Foundation::EventRegistrationToken visibilityToken;
00043         uint32 desiredReportInterval;
00044         Windows::UI::Xaml::DispatcherTimer^ dispatcherTimer;
00045
00046         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00047         void DisplayCurrentReading(Platform::Object^ sender, Platform::Object^ e);
00048         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00050     };
00051 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cs/Scenario3_NetworkConnectivityChanges.xaml.cs Source File

  • NetworkConnectivity
  • cs

Scenario3_NetworkConnectivityChanges.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Networking.Connectivity;
00014 using Windows.UI.Core;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario3_NetworkConnectivityChanges : Page
00022     {
00023         private bool m_isNetworkStatusChangeCallbackRegistered = false;
00024         private bool m_isUpdatingNetworkStatus = false;
00025         private bool m_isNetworkStatusUpdatePending = false;
00026
00027         public Scenario3_NetworkConnectivityChanges()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         protected override void OnNavigatedTo(NavigationEventArgs e)
00033         {
00034             UpdateButtonStates();
00035         }
00036
00037         protected override void OnNavigatedFrom(NavigationEventArgs e)
00038         {
00039             if (m_isNetworkStatusChangeCallbackRegistered)
00040             {
00041                 UnregisterNetworkStatusChanged();
00042             }
00043         }
00044
00045         async void UpdateNetworkStatus()
00046         {
00047             // This code runs on the UI thread, so there are no race conditions on these
00048             // member variables.
00049             if (m_isUpdatingNetworkStatus)
00050             {
00051                 // Update is already in progress. Let it finish before we re-evaluate.
00052                 m_isNetworkStatusUpdatePending = true;
00053                 return;
00054             }
00055
00056             m_isUpdatingNetworkStatus = true;
00057
00058             do
00059             {
00060                 m_isNetworkStatusUpdatePending = false;
00061                 ResultsText.Text = string.Empty;
00062                 ConnectionProfile internetConnectionProfile = NetworkInformation.GetInternetConnectionProfile();
00063                 NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel.None;
00064                 if (internetConnectionProfile != null)
00065                 {
00066                     connectivityLevel = internetConnectionProfile.GetNetworkConnectivityLevel();
00067                 }
00068
00069                 Helpers.AppendLine(ResultsText, $"Current connectivity is {connectivityLevel}.");
00070                 if (Helpers.ShouldAttemptToConnectToInternet(connectivityLevel))
00071                 {
00072                     Helpers.AppendLine(ResultsText, "Checking network cost before connecting to the Internet.");
00073                     await Helpers.EvaluateCostAndConnectAsync(internetConnectionProfile.GetConnectionCost(), OptedInToNetworkUsageToggle.IsOn, ResultsText);
00074                 }
00075                 else
00076                 {
00077                     Helpers.AppendLine(ResultsText, "Not attempting to connect to the Internet.");
00078                 }
00079             }
00080             while (m_isNetworkStatusUpdatePending);
00081             m_isUpdatingNetworkStatus = false;
00082         }
00083
00084         async private void OnNetworkStatusChanged(object sender)
00085         {
00086             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00087             {
00088                 UpdateNetworkStatus();
00089             });
00090         }
00091
00092         private void RegisterNetworkStatusChanged()
00093         {
00094             NetworkInformation.NetworkStatusChanged += OnNetworkStatusChanged;
00095             m_isNetworkStatusChangeCallbackRegistered = true;
00096             UpdateNetworkStatus();
00097         }
00098
00099         private void UnregisterNetworkStatusChanged()
00100         {
00101             NetworkInformation.NetworkStatusChanged -= OnNetworkStatusChanged;
00102             m_isNetworkStatusChangeCallbackRegistered = false;
00103         }
00104
00105         private void RegisterUnregisterButton_Click(object sender, RoutedEventArgs e)
00106         {
00107             if (m_isNetworkStatusChangeCallbackRegistered)
00108             {
00109                 UnregisterNetworkStatusChanged();
00110             }
00111             else
00112             {
00113                 RegisterNetworkStatusChanged();
00114             }
00115             UpdateButtonStates();
00116         }
00117
00118         /// <summary>
00119         /// Update the UI based on whether we are registered for the event.
00120         /// </summary>
00121         private void UpdateButtonStates()
00122         {
00123             VisualStateManager.GoToState(this, m_isNetworkStatusChangeCallbackRegistered ? "Registered" : "Unregistered", false);
00124         }
00125     }
00126 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario1_Print.h Source File

  • 3DPrinting
  • cppwinrt

Scenario1_Print.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Print.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Print : Scenario1_PrintT<Scenario1_Print>
00020     {
00021         Scenario1_Print();
00022
00023         fire_and_forget CreateProgrammatically_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         fire_and_forget CreateFromXml_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         fire_and_forget LoadPackageFromFile_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         fire_and_forget SavePackage_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         fire_and_forget PrintPackage_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031         Windows::Graphics::Printing3D::Printing3D3MFPackage currentPackage{ nullptr };
00032
00033         void EnablePackageOperationButtons();
00034         void OnTaskRequested(Windows::Graphics::Printing3D::Print3DManager const& sender, Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs const& args);
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario1_Print : Scenario1_PrintT<Scenario1_Print, implementation::Scenario1_Print>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/FileLoggingSessionScenario.h Source File

  • Logging
  • cppwinrt

FileLoggingSessionScenario.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "LoggingScenarioEventArgs.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     class FileLoggingSessionScenario
00018     {
00019         // This is a singleton, only created/destroyed by the Instance() method.
00020         ~FileLoggingSessionScenario();
00021         FileLoggingSessionScenario();
00022
00023     public:
00024
00025         static FileLoggingSessionScenario&
00026         Instance();
00027
00028         event_token
00029         StatusChanged(StatusChangedHandler const& handler);
00030
00031         void
00032         StatusChanged(event_token const& token) noexcept;
00033
00034         bool
00035         IsBusy() const noexcept;
00036
00037         int
00038         LogFileGeneratedCount() const noexcept;
00039
00040         bool
00041         LoggingEnabled() const noexcept;
00042
00043         Windows::Foundation::IAsyncOperation<bool>
00044         ToggleLoggingEnabledDisabledAsync();
00045
00046         Windows::Foundation::IAsyncAction
00047         DoScenarioAsync();
00048
00049     private:
00050
00051         void
00052         StartLogging();
00053
00054         Windows::Foundation::IAsyncAction
00055         PrepareToSuspendAsync();
00056
00057         void
00058         ResumeLoggingIfApplicable();
00059
00060         Windows::Foundation::IAsyncOperation<Windows::Storage::StorageFile>
00061         CloseSessionSaveFinalLogFile();
00062
00063         void
00064         OnChannelLoggingEnabled(
00065             Windows::Foundation::Diagnostics::ILoggingChannel const& sender,
00066             Windows::Foundation::IInspectable const& args);
00067
00068         fire_and_forget
00069         OnLogFileGenerated(
00070             Windows::Foundation::Diagnostics::IFileLoggingSession const& sender,
00071             Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs const& args);
00072
00073         fire_and_forget
00074         OnAppSuspending(Windows::Foundation::IInspectable const& sender,
00075             Windows::ApplicationModel::SuspendingEventArgs const& e);
00076
00077         void
00078         OnAppResuming(Windows::Foundation::IInspectable const& sender,
00079             Windows::Foundation::IInspectable const& args);
00080
00081     private:
00082
00083         struct BusySetter
00084         {
00085             ~BusySetter();
00086             explicit BusySetter(FileLoggingSessionScenario& scenario);
00087             FileLoggingSessionScenario& _scenario;
00088         };
00089
00090         Windows::Foundation::Diagnostics::FileLoggingSession _session{ nullptr };
00091         Windows::Foundation::Diagnostics::LoggingChannel _channel{ nullptr };
00092
00093         std::atomic<int> _logFileGeneratedCount;
00094         std::atomic<int> _isBusy;
00095         bool _isPreparingForSuspend = false;
00096
00097         bool _isChannelEnabled = false;
00098         Windows::Foundation::Diagnostics::LoggingLevel _channelLoggingLevel{};
00099
00100         Windows::Foundation::Collections::IPropertySet _settings{ Windows::Storage::ApplicationData::Current().LocalSettings().Values() };
00101
00102         event<StatusChangedHandler> _statusChanged;
00103     };
00104 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/SampleConfiguration.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using AllJoynProducerExperiences;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "AllJoyn Producer Experiences";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Secure Producer", ClassType=typeof(Scenario1)},
00026             new Scenario() { Title="Onboarding Producer", ClassType=typeof(Scenario2)}
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_NumberParsing Member List

This is the complete list of members for Scenario4_NumberParsing, including all inherited members.
Display_Click(object sender, RoutedEventArgs e) | Scenario4_NumberParsing | [inline, private]
Scenario4_NumberParsing() | Scenario4_NumberParsing | [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/pch.h Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008
00009 #include <agile.h>
00010
00011 #include "BreadTypes.h"
00012 #include "BreadServer.h"
00013 #include "OvenServer.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrFileImage.xaml.h Source File

  • OCR
  • cpp

OcrFileImage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "OcrFileImage.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "WordOverlay.h"
00017 #include <map>
00018 #include <ppltasks.h>
00019
00020 using namespace concurrency;
00021 using namespace Platform;
00022 using namespace Platform::Collections;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Graphics::Imaging;
00026 using namespace Windows::Media::Ocr;
00027 using namespace Windows::Storage;
00028 using namespace Windows::Storage::Streams;
00029 using namespace Windows::Storage::Pickers;
00030 using namespace Windows::UI::Xaml;
00031 using namespace Windows::UI::Xaml::Controls;
00032 using namespace Windows::UI::Xaml::Controls::Primitives;
00033 using namespace Windows::UI::Xaml::Data;
00034 using namespace Windows::UI::Xaml::Input;
00035 using namespace Windows::UI::Xaml::Media;
00036 using namespace Windows::UI::Xaml::Media::Imaging;
00037 using namespace Windows::UI::Xaml::Navigation;
00038
00039 namespace SDKTemplate
00040 {
00041     [Windows::Foundation::Metadata::WebHostHidden]
00042     public ref class OcrFileImage sealed
00043     {
00044     public:
00045         OcrFileImage();
00046
00047     protected:
00048         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00049     private:
00050
00051         MainPage^ rootPage;
00052
00053         bool isAngleDetected;
00054         std::map<String^, Windows::Globalization::Language^> languageMap;
00055
00056         // Bitmap holder of currently loaded image.
00057         Windows::Graphics::Imaging::SoftwareBitmap^ bitmap;
00058
00059         // Recognized words overlay boxes.
00060         std::vector<WordOverlay^> wordBoxes;
00061
00062         task<void> LoadImage(Windows::Storage::StorageFile^ file);
00063         void LoadSampleImage();
00064         void UpdateAvailableLanguages();
00065         void UpdateWordBoxTransform();
00066         void ClearResults();
00067
00068         void LanguageList_SelectionChanged(Platform::Object^ sender, SelectionChangedEventArgs^ e);
00069         void PreviewImage_SizeChanged(Platform::Object^ sender, SizeChangedEventArgs^ e);
00070         void SampleButton_Tapped(Platform::Object^ sender, TappedRoutedEventArgs^ e);
00071         void LoadButton_Tapped(Platform::Object^ sender, TappedRoutedEventArgs^ e);
00072         void ExtractButton_Tapped(Platform::Object^ sender, TappedRoutedEventArgs^ e);
00073         void UserLanguageToggle_Toggled(Platform::Object^ sender, RoutedEventArgs^ e);
00074     };
00075 }
Generated on Fri Nov 15 2024 22:20:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario6_NumeralSystemTranslation.xaml.h Source File

  • NumberFormatting
  • cpp

Scenario6_NumeralSystemTranslation.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "pch.h"
00006 #include "Scenario6_NumeralSystemTranslation.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario6_NumeralSystemTranslation sealed
00012     {
00013     public:
00014         Scenario6_NumeralSystemTranslation();
00015
00016     private:
00017         void Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00018     };
00019 }
Generated on Fri Nov 15 2024 22:20:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario2StandardOptions.xaml.h Source File

  • Printing
  • cpp

Scenario2StandardOptions.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario2StandardOptions.g.h"
00006 #include "PrintHelper.h"
00007
00008 namespace SDKTemplate
00009 {
00010     ref class StandardOptionsPrintHelper sealed : public PrintHelper
00011     {
00012     public:
00013         StandardOptionsPrintHelper(Page^ scenarioPage) : PrintHelper(scenarioPage) { }
00014
00015     protected:
00016         /// <summary>
00017         /// This is the event handler for PrintManager.PrintTaskRequested.
00018         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline.
00019         /// Therefore, we use this handler to only create the print task.
00020         /// The print settings customization can be done when the print document source is requested.
00021         /// </summary>
00022         /// <param name="sender">PrintManager</param>
00023         /// <param name="e">PrintTaskRequestedEventArgs</param>
00024         virtual void PrintTaskRequested(Windows::Graphics::Printing::PrintManager^ sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^ e) override;
00025     };
00026
00027     /// <summary>
00028     /// Scenario that demos how to add customizations in the displayed options list.
00029     /// </summary>
00030     [Windows::Foundation::Metadata::WebHostHidden]
00031     public ref class Scenario2StandardOptions sealed
00032     {
00033     public:
00034         Scenario2StandardOptions();
00035
00036     protected:
00037         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00039
00040     private:
00041         PrintHelper^ printHelper;
00042         void OnPrintButtonClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043     };
00044 }
Generated on Fri Nov 15 2024 22:21:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AccountWatcher Member List

This is the complete list of members for AccountWatcher, including all inherited members.
AccountWatcher() | AccountWatcher | [inline]
DisplayWatcherOutputFromCallback(string value) | AccountWatcher | [inline, private]
DumpAccountDeviceInformation(StringBuilder message, MobileBroadbandDeviceInformation deviceInformation) | AccountWatcher | [inline, private]
DumpAccountNetwork(StringBuilder message, MobileBroadbandNetwork network) | AccountWatcher | [inline, private]
DumpPropertyData(string networkAccountId, bool hasDeviceInformationChanged, bool hasNetworkChanged) | AccountWatcher | [inline, private]
NetErrorToString(uint netError) | AccountWatcher | [inline, private]
networkAccountWatcher | AccountWatcher | [private]
OnNavigatedTo(NavigationEventArgs e) | AccountWatcher | [inline, protected]
PrepScenario2Sample() | AccountWatcher | [inline, private]
rootPage | AccountWatcher | [private]
StartMonitoring_Click(object sender, RoutedEventArgs e) | AccountWatcher | [inline, private]
StopMonitoring_Click(object sender, RoutedEventArgs e) | AccountWatcher | [inline, private]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/ServiceViewModel.cpp Source File

  • CustomCapability
  • cpp

ServiceViewModel.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "ServiceViewModel.h"
00003 #include "MainPage.xaml.h"
00004
00005 using namespace Concurrency;
00006 using namespace Platform;
00007 using namespace SDKTemplate;
00008 using namespace Windows::System::Threading;
00009 using namespace Windows::Foundation;
00010 using namespace Windows::UI::Xaml;
00011 using namespace Windows::UI::Xaml::Data;
00012 using namespace Windows::ApplicationModel;
00013
00014 #if defined (_M_IX86) || defined(_M_AMD64)
00015 #define SERVICE_SUPPORTED 1
00016 #endif
00017
00018 ServiceViewModel::ServiceViewModel()
00019 {
00020     // Set default rate
00021     samplePeriod = 100;
00022
00023     // Initialize UI state
00024     startButtonEnabled = true;
00025     stopButtonEnabled = false;
00026     sliderEnabled = true;
00027     sliderValue = samplePeriod;
00028     actualRpcCallbackRate = "0";
00029     expectedRpcCallbackRate = "0";
00030
00031     meteringOn = false;
00032
00033     // Get the dispatcher for notifying property change
00034     dispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher;
00035
00036     sampleArray = ref new Platform::Array<__int64>(1000);
00037     meteringOnWhileSuspension = false;
00038
00039     // Register for app suspend/resume handlers
00040     App::Current->Suspending += ref new SuspendingEventHandler(this, &ServiceViewModel::SuspendMeteringService);
00041     App::Current->Resuming += ref new EventHandler<Object^>(this, &ServiceViewModel::ResumeMeteringService);
00042 }
00043
00044 void ServiceViewModel::SuspendMeteringService(Object^, SuspendingEventArgs^)
00045 {
00046     if (meteringOn) {
00047         StopMetering();
00048         meteringOnWhileSuspension = true;
00049     }
00050 }
00051
00052 void ServiceViewModel::ResumeMeteringService(Object^, Object^)
00053 {
00054     if (meteringOnWhileSuspension) {
00055         StartMetering(samplePeriod);
00056         meteringOnWhileSuspension = false;
00057     }
00058 }
00059
00060
00061 //
00062 // if errCode represents an error, then display a message and return true.
00063 //
00064 inline bool ServiceViewModel::NotifyIfAnyError(__int64 errCode)
00065 {
00066     if (errCode != 0)
00067     {
00068         meteringOn = false;
00069         NotifyStatusMessage("Error occured while communicating with RPC server: " + errCode.ToString(), NotifyType::ErrorMessage);
00070
00071         // Reset button state
00072         StartButtonEnabled = true;
00073         StopButtonEnabled = false;
00074         return true;
00075     }
00076     return false;
00077 }
00078
00079 // Bindable properties
00080 #pragma region BindableProperties
00081
00082 String^ ServiceViewModel::ExpectedRpcCallbackRate::get() { return expectedRpcCallbackRate; }
00083 void ServiceViewModel::ExpectedRpcCallbackRate::set(String^ value)
00084 {
00085     if (expectedRpcCallbackRate != value)
00086     {
00087         expectedRpcCallbackRate = value;
00088         NotifyPropertyChanged("ExpectedRpcCallbackRate");
00089     }
00090 }
00091
00092 String^ ServiceViewModel::ActualRpcCallbackRate::get() { return actualRpcCallbackRate; }
00093 void ServiceViewModel::ActualRpcCallbackRate::set(String^ value)
00094 {
00095     if (actualRpcCallbackRate != value)
00096     {
00097         actualRpcCallbackRate = value;
00098         NotifyPropertyChanged("ActualRpcCallbackRate");
00099     }
00100 }
00101
00102 String^ ServiceViewModel::SampleMessage::get() { return sampleMessage; }
00103 void ServiceViewModel::SampleMessage::set(String^ value)
00104 {
00105     if (sampleMessage != value)
00106     {
00107         sampleMessage = value;
00108         NotifyPropertyChanged("SampleMessage");
00109     }
00110 }
00111
00112 bool ServiceViewModel::StartButtonEnabled::get() { return startButtonEnabled; }
00113 void ServiceViewModel::StartButtonEnabled::set(bool value)
00114 {
00115     if (startButtonEnabled != value)
00116     {
00117         startButtonEnabled = value;
00118         NotifyPropertyChanged("StartButtonEnabled");
00119     }
00120 }
00121
00122 bool ServiceViewModel::StopButtonEnabled::get() { return stopButtonEnabled; }
00123 void ServiceViewModel::StopButtonEnabled::set(bool value)
00124 {
00125     if (stopButtonEnabled != value)
00126     {
00127         stopButtonEnabled = value;
00128         NotifyPropertyChanged("StopButtonEnabled");
00129     }
00130 }
00131
00132 bool ServiceViewModel::SliderEnabled::get() { return sliderEnabled; }
00133 void ServiceViewModel::SliderEnabled::set(bool value)
00134 {
00135     if (sliderEnabled != value)
00136     {
00137         sliderEnabled = value;
00138         NotifyPropertyChanged("SliderEnabled");
00139     }
00140 }
00141
00142 double ServiceViewModel::SliderValue::get() { return sliderValue; }
00143 void ServiceViewModel::SliderValue::set(double value)
00144 {
00145     if (sliderValue != value)
00146     {
00147         sliderValue = value;
00148         NotifyPropertyChanged("SliderValue");
00149     }
00150 }
00151 #pragma endregion BindableProperties
00152
00153 void SDKTemplate::ServiceViewModel::NotifyPropertyChanged(Platform::String^ prop)
00154 {
00155     if (dispatcher != nullptr)
00156     {
00157         dispatcher->RunAsync(
00158             Windows::UI::Core::CoreDispatcherPriority::Normal,
00159             ref new Windows::UI::Core::DispatchedHandler([this, prop]()
00160         {
00161             PropertyChangedEventArgs^ args =
00162                 ref new PropertyChangedEventArgs(prop);
00163             PropertyChanged(this, args);
00164         }));
00165     }
00166     // else log error
00167 }
00168
00169 ServiceViewModel^ ServiceViewModel::_Current = nullptr;
00170
00171 ServiceViewModel^ ServiceViewModel::Current::get()
00172 {
00173     if (ServiceViewModel::_Current == nullptr) {
00174         ServiceViewModel::_Current = ref new ServiceViewModel();
00175     }
00176     return ServiceViewModel::_Current;
00177 }
00178
00179 //
00180 // Initializes rpcclient and metering
00181 //
00182 void ServiceViewModel::StartMetering(int sampleRate)
00183 {
00184     create_task([this, sampleRate]
00185     {
00186         SampleMessage = "";
00187         StartButtonEnabled = false;
00188         StopButtonEnabled = true;
00189         stopMeteringRequested = false;
00190
00191 #ifdef SERVICE_SUPPORTED
00192         if (NotifyIfAnyError(RpcClientInitialize(&rpcclient))) return;
00193
00194         meteringOn = true;
00195         sampleRefreshCount = 0;
00196         sampleArray[0] = 0;
00197
00198         // Set the sample rate on server
00199         this->samplePeriod = sampleRate;
00200         __int64 retCode = SetSampleRate(rpcclient, sampleRate);
00201
00202         FILETIME initialSystemTime;
00203         GetSystemTimeAsFileTime(&initialSystemTime);
00204         lastUpdateTime.LowPart = initialSystemTime.dwLowDateTime;
00205         lastUpdateTime.HighPart = initialSystemTime.dwHighDateTime;
00206
00207         if (!NotifyIfAnyError(retCode))
00208         {
00209             // Set up worker for UI update.
00210             Windows::Foundation::TimeSpan span{ 100 * 10000 }; // 100ms refresh rate
00211
00212             auto timerHandler = ref new TimerElapsedHandler([this](ThreadPoolTimer^)
00213             {
00214                 __int64 meteringData = 0;
00215                 GetMeteringData(rpcclient, &meteringData);
00216
00217                 // If there is no new data, return
00218                 if (sampleArray[0] == meteringData)
00219                 {
00220                     return;
00221                 }
00222
00223                 // Arithmetic subtraction of time
00224                 // https://msdn.microsoft.com/en-us/library/ms724950%28VS.85%29.aspx?f=255&MSPPError=-2147217396
00225                 FILETIME currentSystemTime;
00226                 ULARGE_INTEGER currentTimeUi;
00227                 GetSystemTimeAsFileTime(&currentSystemTime);
00228                 currentTimeUi.LowPart = currentSystemTime.dwLowDateTime;
00229                 currentTimeUi.HighPart = currentSystemTime.dwHighDateTime;
00230
00231                 // Calculate number of samples received since last callback
00232                 __int64 now = 0, diff = 0;
00233                 GetCallbackCount(rpcclient, &now);
00234
00235                 diff = now - rpcDataCountOld;
00236                 rpcDataCountOld = now;
00237
00238                 // Calculate incoming sample rate
00239                 double rate = (double)diff*1E7 / (currentTimeUi.QuadPart - lastUpdateTime.QuadPart);
00240                 ExpectedRpcCallbackRate = (1E3 / this->samplePeriod).ToString() + " /sec";
00241                 lastUpdateTime = currentTimeUi;
00242
00243                 ActualRpcCallbackRate = rate.ToString() + " /sec";
00244
00245                 // Construct the sample data string
00246                 String^ sampleMessage = meteringData + "\n";
00247                 unsigned int length = sampleArray->Length;
00248                 if (sampleRefreshCount < length)
00249                 {
00250                     ++sampleRefreshCount;
00251                     length = sampleRefreshCount;
00252                 }
00253
00254                 // Insert the new data point at the top of the array.
00255                 // Old data falls off the end of the array.
00256                 for (unsigned int i = 1; i < length; ++i)
00257                 {
00258                     sampleArray[i] = sampleArray[i - 1];
00259                     sampleMessage += sampleArray[i] + "\n";
00260                 }
00261                 sampleArray[0] = meteringData;
00262
00263                 SampleMessage = sampleMessage;
00264             });
00265
00266             ThreadPoolTimer^ periodicTimer = ThreadPoolTimer::CreatePeriodicTimer(timerHandler, span);
00267             NotifyStatusMessage("Metering start command sent successfully", NotifyType::StatusMessage);
00268             retCode = StartMeteringAndWaitForStop(this->rpcclient, sampleRate);
00269             meteringOn = false;
00270             periodicTimer->Cancel();
00271             if (!NotifyIfAnyError(retCode) && !stopMeteringRequested)
00272             {
00273                 NotifyStatusMessage("Rpc server connection closed without stop metering being requested",
00274                                     NotifyType::ErrorMessage);
00275                 StartButtonEnabled = true;
00276                 StopButtonEnabled = false;
00277             }
00278             RpcClientClose(this->rpcclient);
00279         }
00280 #else
00281         NotifyStatusMessage("NT service support has not been compiled for this architecture.", NotifyType::ErrorMessage);
00282 #endif
00283     });
00284 }
00285
00286 //
00287 // Stop metering
00288 //
00289 void ServiceViewModel::StopMetering()
00290 {
00291     create_task([this]
00292     {
00293         StopButtonEnabled = false;
00294         SliderEnabled = false;
00295         stopMeteringRequested = true;
00296
00297 #ifdef SERVICE_SUPPORTED
00298         __int64 retCode = StopMeteringData(this->rpcclient);
00299         if (!NotifyIfAnyError(retCode))
00300         {
00301             NotifyStatusMessage("Metering stop command sent successfully",
00302                                 NotifyType::StatusMessage);
00303         }
00304 #endif
00305
00306         SliderEnabled = true;
00307         StartButtonEnabled = true;
00308     });
00309 }
00310
00311 //
00312 // Set sample period
00313 //
00314 void ServiceViewModel::SetSamplePeriod(int samplePeriod)
00315 {
00316     create_task([this, samplePeriod]
00317     {
00318         this->samplePeriod = samplePeriod;
00319 #ifdef SERVICE_SUPPORTED
00320         if (meteringOn)
00321         {
00322             _int64 retCode = SetSampleRate(rpcclient, samplePeriod);
00323             if (!NotifyIfAnyError(retCode))
00324             {
00325                 NotifyStatusMessage(
00326                     "Sample period set to: " + samplePeriod,
00327                     NotifyType::StatusMessage);
00328             }
00329         }
00330 #endif
00331     });
00332 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario1_BankCards.xaml.h Source File

  • MagneticStripeReader
  • cpp

Scenario1_BankCards.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_BankCards.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Demonstrate how to use read bank cards with MagneticStripeReader
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_BankCards sealed
00024     {
00025     public:
00026         Scenario1_BankCards();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         MainPage^ rootPage;
00034         Windows::Devices::PointOfService::MagneticStripeReader^ _reader;
00035         Windows::Devices::PointOfService::ClaimedMagneticStripeReader^ _claimedReader;
00036         Windows::Foundation::EventRegistrationToken _bankCardDataReceivedToken;
00037         Windows::Foundation::EventRegistrationToken _releaseDeviceRequestedToken;
00038
00039         void ScenarioStartReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void ScenarioEndReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041
00042         Concurrency::task<void> CreateDefaultReaderObject();
00043         Concurrency::task<void> ClaimReader();
00044         void ResetTheScenarioState();
00045
00046         void OnReleaseDeviceRequested(Platform::Object ^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader ^args);
00047
00048         void OnBankCardDataReceived(Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderBankCardDataReceivedEventArgs^args);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:20:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DeviceResources.h Source File

  • Simple3DGameXaml
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetSwapChainPanel(Windows::UI::Xaml::Controls::SwapChainPanel^ panel);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void SetCompositionScale(float compositionScaleX, float compositionScaleY);
00033         void UpdateStereoState();
00034         void ValidateDevice();
00035         void HandleDeviceLost();
00036         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00037         void Trim();
00038         void Present();
00039
00040         // Device Accessors.
00041         Windows::Foundation::Size GetOutputSize() const                     { return m_outputSize; }
00042         Windows::Foundation::Size GetLogicalSize() const                    { return m_logicalSize; }
00043         Windows::Foundation::Size GetRenderTargetSize() const               { return m_d3dRenderTargetSize; }
00044         bool                    GetStereoState() const                      { return m_stereoEnabled; }
00045         Windows::UI::Xaml::Controls::SwapChainPanel^ GetSwapChainPanel() const { return m_swapChainPanel; }
00046
00047         // D3D Accessors.
00048         ID3D11Device2*          GetD3DDevice() const                        { return m_d3dDevice.Get(); }
00049         ID3D11DeviceContext2*   GetD3DDeviceContext() const                 { return m_d3dContext.Get(); }
00050         IDXGISwapChain1*        GetSwapChain() const                        { return m_swapChain.Get(); }
00051         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const               { return m_d3dFeatureLevel; }
00052         ID3D11RenderTargetView* GetBackBufferRenderTargetView() const       { return m_d3dRenderTargetView.Get(); }
00053         ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight() const  { return m_d3dRenderTargetViewRight.Get(); }
00054         ID3D11DepthStencilView* GetDepthStencilView() const                 { return m_d3dDepthStencilView.Get(); }
00055         D3D11_VIEWPORT          GetScreenViewport() const                   { return m_screenViewport; }
00056         DirectX::XMFLOAT4X4     GetOrientationTransform3D() const           { return m_orientationTransform3D; }
00057
00058         // D2D Accessors.
00059         ID2D1Factory2*          GetD2DFactory() const                       { return m_d2dFactory.Get(); }
00060         ID2D1Device1*           GetD2DDevice() const                        { return m_d2dDevice.Get(); }
00061         ID2D1DeviceContext1*    GetD2DDeviceContext() const                 { return m_d2dContext.Get(); }
00062         ID2D1Bitmap1*           GetD2DTargetBitmap() const                  { return m_d2dTargetBitmap.Get(); }
00063         ID2D1Bitmap1*           GetD2DTargetBitmapRight() const             { return m_d2dTargetBitmapRight.Get(); }
00064         IDWriteFactory2*        GetDWriteFactory() const                    { return m_dwriteFactory.Get(); }
00065         IWICImagingFactory2*    GetWicImagingFactory() const                { return m_wicFactory.Get(); }
00066         D2D1::Matrix3x2F        GetOrientationTransform2D() const           { return m_orientationTransform2D; }
00067
00068     private:
00069         void CreateDeviceIndependentResources();
00070         void CreateDeviceResources();
00071         void CreateWindowSizeDependentResources();
00072         DXGI_MODE_ROTATION ComputeDisplayRotation();
00073         void CheckStereoEnabledStatus();
00074
00075         // Direct3D objects.
00076         Microsoft::WRL::ComPtr<ID3D11Device2>           m_d3dDevice;
00077         Microsoft::WRL::ComPtr<ID3D11DeviceContext2>    m_d3dContext;
00078         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00079
00080         // Direct3D rendering objects. Required for 3D.
00081         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00082         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetViewRight;
00083         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00084         D3D11_VIEWPORT                                  m_screenViewport;
00085
00086         // Direct2D drawing components.
00087         Microsoft::WRL::ComPtr<ID2D1Factory2>           m_d2dFactory;
00088         Microsoft::WRL::ComPtr<ID2D1Device1>            m_d2dDevice;
00089         Microsoft::WRL::ComPtr<ID2D1DeviceContext1>     m_d2dContext;
00090         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmap;
00091         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmapRight;
00092
00093         // DirectWrite drawing components.
00094         Microsoft::WRL::ComPtr<IDWriteFactory2>         m_dwriteFactory;
00095         Microsoft::WRL::ComPtr<IWICImagingFactory2>     m_wicFactory;
00096
00097         // Cached reference to the XAML panel.
00098         Windows::UI::Xaml::Controls::SwapChainPanel^    m_swapChainPanel;
00099
00100         // Cached device properties.
00101         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00102         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00103         Windows::Foundation::Size                       m_outputSize;
00104         Windows::Foundation::Size                       m_logicalSize;
00105         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00106         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00107         float                                           m_dpi;
00108         float                                           m_compositionScaleX;
00109         float                                           m_compositionScaleY;
00110         bool                                            m_stereoEnabled;
00111
00112         // Transforms used for display orientation.
00113         D2D1::Matrix3x2F                                m_orientationTransform2D;
00114         DirectX::XMFLOAT4X4                             m_orientationTransform3D;
00115
00116         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00117         IDeviceNotify*                                  m_deviceNotify;
00118     };
00119 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario7_SetVersion.h Source File

  • ApplicationData
  • cppwinrt

Scenario7_SetVersion.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7_SetVersion.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario7_SetVersion : Scenario7_SetVersionT<Scenario7_SetVersion>
00020     {
00021         Scenario7_SetVersion();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         fire_and_forget SetVersion0_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         fire_and_forget SetVersion1_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027         void DisplayOutput();
00028
00029     private:
00030
00031         void SetVersionHandler0(Windows::Storage::SetVersionRequest const& request);
00032         void SetVersionHandler1(Windows::Storage::SetVersionRequest const& request);
00033
00034         Windows::Storage::ApplicationData appData = Windows::Storage::ApplicationData::Current();
00035
00036         inline static const auto settingName = L"SetVersionSetting";
00037         inline static const auto settingValue0 = L"Data.v0";
00038         inline static const auto settingValue1 = L"Data.v1";
00039     };
00040 }
00041
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct Scenario7_SetVersion : Scenario7_SetVersionT<Scenario7_SetVersion, implementation::Scenario7_SetVersion>
00045     {
00046     };
00047 }
00048
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario12.xaml.h Source File

  • SimpleInk
  • cpp

Scenario12.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario12.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario12 sealed
00024     {
00025     public:
00026         Scenario12();
00027
00028     private:
00029         void OnDrawingAttributesChanged(Windows::UI::Xaml::Controls::InkToolbar^ sender, Platform::Object^ args);
00030         void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:17:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewModelBase Member List

This is the complete list of members for ViewModelBase, including all inherited members.
__pad0__ | ViewModelBase |
NotifyPropertyChanged(Platform::String^propertyName) | ViewModelBase | [protected]
PropertyChanged | ViewModelBase |
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/SampleConfiguration.cs Source File

  • ShareSource
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class App
00021     {
00022         /// <summary>
00023         /// Invoked when the application is launched by a protocol.
00024         /// </summary>
00025         /// <param name="args">Container for the activation information including the Uri used to activate this app.</param>
00026         protected override void OnActivated(IActivatedEventArgs args)
00027         {
00028             Frame rootFrame = Window.Current.Content as Frame;
00029             if (rootFrame == null)
00030             {
00031                 rootFrame = new Frame();
00032                 rootFrame.Navigate(typeof(MainPage));
00033                 Window.Current.Content = rootFrame;
00034             }
00035
00036             // Protocol activation is the only type of activation that this app handles
00037             if (args.Kind == ActivationKind.Protocol)
00038             {
00039                 ProtocolActivatedEventArgs protocolArgs = args as ProtocolActivatedEventArgs;
00040                 ((MainPage)rootFrame.Content).LoadScenarioForProtocolActivation(protocolArgs);
00041             }
00042
00043             Window.Current.Activate();
00044         }
00045
00046     }
00047     public partial class MainPage : Page
00048     {
00049         public const string FEATURE_NAME = "Share source C# sample";
00050         public const string MissingTitleError = "Enter a title for what you are sharing and try again.";
00051
00052         public List<Scenario> scenarios = new List<Scenario>
00053         {
00054             new Scenario() { Title = "Share text",                  ClassType = typeof(ShareText) },
00055             new Scenario() { Title = "Share web link",              ClassType = typeof(ShareWebLink) },
00056             new Scenario() { Title = "Share application link",      ClassType = typeof(ShareApplicationLink) },
00057             new Scenario() { Title = "Share image",                 ClassType = typeof(ShareImage) },
00058             new Scenario() { Title = "Share files",                 ClassType = typeof(ShareFiles) },
00059             new Scenario() { Title = "Share delay rendered files",  ClassType = typeof(ShareDelayRenderedFiles) },
00060             new Scenario() { Title = "Share HTML content",          ClassType = typeof(ShareHtml) },
00061             new Scenario() { Title = "Share custom data",           ClassType = typeof(ShareCustomData) },
00062             new Scenario() { Title = "Share with custom provider",  ClassType = typeof(ShareCustomProvider) },
00063             new Scenario() { Title = "Fail with display text",      ClassType = typeof(SetErrorMessage) }
00064         };
00065
00066         /// <summary>
00067         /// Selects the scenario corresponding with the Uri used to activate this app via a protocol. If there is no corresponding
00068         /// scenario then there is no effect.
00069         /// </summary>
00070         /// <param name="protocolArgs">Container for the protocol activation information which includes the Uri that activated this app</param>
00071         public void LoadScenarioForProtocolActivation(ProtocolActivatedEventArgs protocolArgs)
00072         {
00073             foreach (Scenario scenario in scenarios)
00074             {
00075                 if (protocolArgs.Uri.Equals(SharePage.GetApplicationLink(scenario.ClassType.Name)))
00076                 {
00077                     // By setting the selected index, the Scenarios_SelectionChanged(...) method will be called
00078                     ScenarioControl.SelectedIndex = scenarios.IndexOf(scenario);
00079                     break;
00080                 }
00081             }
00082         }
00083     }
00084
00085     public class Scenario
00086     {
00087         public string Title { get; set; }
00088         public Type ClassType { get; set; }
00089     }
00090 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/Scenario2_Polling.xaml.cs Source File

  • RelativeInclinometer
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016 using Windows.Devices.Sensors;
00017
00018 namespace RelativeInclinometerCS
00019 {
00020     public sealed partial class Scenario2_Polling : Page
00021     {
00022         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00023         // as NotifyUser()
00024         MainPage RootPage = MainPage.Current;
00025
00026         private Inclinometer Sensor;
00027
00028         public Scenario2_Polling()
00029         {
00030             this.InitializeComponent();
00031
00032             Sensor = Inclinometer.GetDefaultForRelativeReadings();
00033             if (Sensor == null)
00034             {
00035                 RootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
00036                 GetDataButton.IsEnabled = false;
00037             }
00038             else
00039             {
00040                 GetDataButton.IsEnabled = true;
00041             }
00042         }
00043
00044         /// <summary>
00045         /// Invoked when this page is about to be displayed in a Frame.
00046         /// </summary>
00047         /// <param name="e">Event data that describes how this page was reached. The Parameter
00048         /// property is typically used to configure the page.</param>
00049         protected override void OnNavigatedTo(NavigationEventArgs e)
00050         {
00051         }
00052
00053         /// <summary>
00054         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00055         /// </summary>
00056         /// <param name="e">
00057         /// Event data that can be examined by overriding code. The event data is representative
00058         /// of the navigation that will unload the current Page unless canceled. The
00059         /// navigation can potentially be canceled by setting Cancel.
00060         /// </param>
00061         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00062         {
00063             base.OnNavigatingFrom(e);
00064         }
00065
00066         /// <summary>
00067         /// Invoked when a user clicks on the GetDataButton
00068         /// </summary>
00069         /// <param name="sender"></param>
00070         /// <param name="args"></param>
00071         private void GetData(object sender, object args)
00072         {
00073             InclinometerReading reading = Sensor.GetCurrentReading();
00074             if (reading != null)
00075             {
00076                 ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
00077                 ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
00078                 ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
00079             }
00080         }
00081     }
00082 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S7_RetrieveWithAppContent.xaml.h Source File

  • ContentIndexer
  • cpp

S7_RetrieveWithAppContent.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S7_RetrieveWithAppContent.xaml.h
00014 // Declaration of the S7_RetrieveWithAppContent class
00015 //
00016
00017 #pragma once
00018 #include "S7_RetrieveWithAppContent.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S7_RetrieveWithAppContent sealed
00023     {
00024     public:
00025         S7_RetrieveWithAppContent();
00026
00027     private:
00028         void AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void RetrieveAllItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void RetrieveMatchedItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario2_Listen.h Source File

  • IoT-GPIO
  • cppwinrt

Scenario2_Listen.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Listen.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Listen : Scenario2_ListenT<Scenario2_Listen>
00020     {
00021         Scenario2_Listen();
00022         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023
00024         void StartStopScenario_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025
00026     private:
00027         // Use GPIO pin 5 to set values
00028         static constexpr int SET_PIN = 5;
00029         Windows::Devices::Gpio::GpioPin setPin{ nullptr };
00030
00031         // Use GPIO pin 6 to listen for value changes
00032         static constexpr int LISTEN_PIN = 6;
00033         Windows::Devices::Gpio::GpioPin listenPin{ nullptr };
00034         event_token valueChangedEventToken{};
00035
00036         Windows::Devices::Gpio::GpioPinValue currentValue = Windows::Devices::Gpio::GpioPinValue::High;
00037         Windows::UI::Xaml::DispatcherTimer timer{ nullptr };
00038         event_token timerEventToken{};
00039
00040     private:
00041         void StartScenario();
00042         void StopScenario();
00043         fire_and_forget Pin_ValueChanged(Windows::Devices::Gpio::GpioPin const& sender, Windows::Devices::Gpio::GpioPinValueChangedEventArgs const& e);
00044         void Timer_Tick(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00045     };
00046 }
00047
00048 namespace winrt::SDKTemplate::factory_implementation
00049 {
00050     struct Scenario2_Listen : Scenario2_ListenT<Scenario2_Listen, implementation::Scenario2_Listen>
00051     {
00052     };
00053 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceHelpers.h Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

DeviceHelpers.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "DeviceSelectorInfo.g.h"
00014 #include "DeviceInformationKindChoice.g.h"
00015 #include "ProtectionLevelSelectorInfo.g.h"
00016 #include "DeviceInformationDisplay.g.h"
00017
00018 namespace winrt::SDKTemplate::implementation
00019 {
00020     struct DeviceSelectorInfo : DeviceSelectorInfoT<DeviceSelectorInfo>
00021     {
00022         DeviceSelectorInfo(
00023             hstring displayName,
00024             Windows::Devices::Enumeration::DeviceClass deviceClassSelector,
00025             Windows::Devices::Enumeration::DeviceInformationKind kind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown,
00026             hstring selector = {})
00027             : m_displayName(std::move(displayName)),
00028             m_deviceClassSelector(deviceClassSelector),
00029             m_kind(kind),
00030             m_selector(std::move(selector))
00031         {
00032         }
00033
00034         DeviceSelectorInfo(
00035             hstring const& displayName,
00036             hstring const& selector,
00037             Windows::Devices::Enumeration::DeviceInformationKind kind = Windows::Devices::Enumeration::DeviceInformationKind::Unknown)
00038             : DeviceSelectorInfo(displayName, {}, kind, selector)
00039         {
00040         }
00041
00042         hstring DisplayName() const
00043         {
00044             return m_displayName;
00045         }
00046
00047         Windows::Devices::Enumeration::DeviceClass DeviceClassSelector() const
00048         {
00049             return m_deviceClassSelector;
00050         }
00051
00052         Windows::Devices::Enumeration::DeviceInformationKind Kind() const
00053         {
00054             return m_kind;
00055         }
00056
00057         hstring Selector() const
00058         {
00059             return m_selector;
00060         }
00061
00062     private:
00063         hstring m_displayName;
00064         Windows::Devices::Enumeration::DeviceClass m_deviceClassSelector;
00065         Windows::Devices::Enumeration::DeviceInformationKind m_kind;
00066         hstring m_selector;
00067     };
00068
00069     struct DeviceSelectorChoices
00070     {
00071         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> CommonDeviceSelectors();
00072         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> DevicePickerSelectors();
00073         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> FindAllAsyncSelectors();
00074         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> DeviceWatcherSelectors();
00075         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> BackgroundDeviceWatcherSelectors();
00076         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceSelectorInfo> PairingSelectors();
00077     };
00078
00079     struct DeviceInformationKindChoice : DeviceInformationKindChoiceT<DeviceInformationKindChoice>
00080     {
00081     public:
00082         DeviceInformationKindChoice(hstring displayName, std::vector<Windows::Devices::Enumeration::DeviceInformationKind> kinds)
00083             : displayName(std::move(displayName)),
00084             kinds(std::move(kinds))
00085         {
00086         }
00087
00088         hstring DisplayName() const
00089         {
00090             return displayName;
00091         }
00092
00093         std::vector<Windows::Devices::Enumeration::DeviceInformationKind> const& Kinds() const
00094         {
00095             return kinds;
00096         }
00097
00098     private:
00099         hstring displayName;
00100         std::vector<Windows::Devices::Enumeration::DeviceInformationKind> kinds;
00101     };
00102
00103     struct DeviceInformationKindChoices
00104     {
00105         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationKindChoice> Choices();
00106     };
00107
00108     struct ProtectionLevelSelectorInfo : ProtectionLevelSelectorInfoT<ProtectionLevelSelectorInfo>
00109     {
00110         ProtectionLevelSelectorInfo(hstring displayName, Windows::Devices::Enumeration::DevicePairingProtectionLevel protectionLevel)
00111             : displayName(std::move(displayName)), protectionLevel(protectionLevel)
00112         {
00113         }
00114
00115         hstring DisplayName()
00116         {
00117             return displayName;
00118         }
00119
00120         Windows::Devices::Enumeration::DevicePairingProtectionLevel ProtectionLevel()
00121         {
00122             return protectionLevel;
00123         }
00124
00125     private:
00126         hstring displayName;
00127         Windows::Devices::Enumeration::DevicePairingProtectionLevel protectionLevel;
00128
00129     };
00130
00131     struct ProtectionSelectorChoices
00132     {
00133         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::ProtectionLevelSelectorInfo> Selectors();
00134     };
00135
00136     struct DeviceInformationDisplay : DeviceInformationDisplayT<DeviceInformationDisplay>
00137     {
00138     public:
00139         DeviceInformationDisplay(Windows::Devices::Enumeration::DeviceInformation const& deviceInfoIn);
00140
00141         Windows::Devices::Enumeration::DeviceInformationKind Kind() const
00142         {
00143             return m_deviceInfo.Kind();
00144         }
00145
00146         hstring Id() const
00147         {
00148             return m_deviceInfo.Id();
00149         }
00150
00151         hstring Name() const
00152         {
00153             return m_deviceInfo.Name();
00154         }
00155
00156         Windows::UI::Xaml::Media::Imaging::BitmapImage GlyphBitmapImage() const
00157         {
00158             return m_glyphBitmapImage;
00159         }
00160
00161         bool CanPair() const
00162         {
00163             return m_deviceInfo.Pairing().CanPair();
00164         }
00165
00166         bool IsPaired() const
00167         {
00168             return m_deviceInfo.Pairing().IsPaired();
00169         }
00170
00171         Windows::Foundation::Collections::IMapView<hstring, IInspectable> Properties()
00172         {
00173             return m_deviceInfo.Properties();
00174         }
00175
00176         Windows::Devices::Enumeration::DeviceInformation DeviceInformation() const
00177         {
00178             return m_deviceInfo;
00179         }
00180
00181         void Update(Windows::Devices::Enumeration::DeviceInformationUpdate const& deviceInfoUpdate);
00182         hstring GetPropertyForDisplay(hstring const& key);
00183         Windows::Foundation::Collections::IVectorView<hstring> Stuff() { return nullptr; }
00184
00185         event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
00186         {
00187             return m_propertyChanged.add(handler);
00188         }
00189
00190         void PropertyChanged(event_token const& token)
00191         {
00192             m_propertyChanged.remove(token);
00193         }
00194
00195     private:
00196         Windows::Devices::Enumeration::DeviceInformation m_deviceInfo{ nullptr };
00197         Windows::UI::Xaml::Media::Imaging::BitmapImage m_glyphBitmapImage{ nullptr };
00198         event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged;
00199
00200         fire_and_forget UpdateGlyphBitmapImage();
00201         void OnPropertyChanged(hstring const& name);
00202     };
00203 }
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaStream.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspMediaStream.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #include <CritSec.h>
00010 #include <linklist.h>
00011 #include <StspDefs.h>
00012
00013 namespace Microsoft { namespace Samples { namespace SimpleCommunication {
00014     class CMediaSource;
00015     namespace Network
00016     {
00017         interface IBufferPacket;
00018     }
00019
00020     class CMediaStream :
00021         public IMFMediaStream,
00022         public IMFQualityAdvise2,
00023         public IMFGetService
00024     {
00025     public:
00026         static HRESULT CreateInstance(StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer, CMediaSource *pSource, CMediaStream **ppStream);
00027
00028         // IUnknown
00029         IFACEMETHOD (QueryInterface) (REFIID iid, void **ppv);
00030         IFACEMETHOD_ (ULONG, AddRef) ();
00031         IFACEMETHOD_ (ULONG, Release) ();
00032
00033         // IMFMediaEventGenerator
00034         IFACEMETHOD (BeginGetEvent) (IMFAsyncCallback *pCallback,IUnknown *punkState);
00035         IFACEMETHOD (EndGetEvent) (IMFAsyncResult *pResult, IMFMediaEvent **ppEvent);
00036         IFACEMETHOD (GetEvent) (DWORD dwFlags, IMFMediaEvent **ppEvent);
00037         IFACEMETHOD (QueueEvent) (MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, const PROPVARIANT *pvValue);
00038
00039         // IMFMediaStream
00040         IFACEMETHOD (GetMediaSource) (IMFMediaSource **ppMediaSource);
00041         IFACEMETHOD (GetStreamDescriptor) (IMFStreamDescriptor **ppStreamDescriptor);
00042         IFACEMETHOD (RequestSample) (IUnknown *pToken);
00043
00044         // IMFQualityAdvise
00045         IFACEMETHOD (SetDropMode ) (_In_ MF_QUALITY_DROP_MODE eDropMode);
00046         IFACEMETHOD (SetQualityLevel ) ( _In_ MF_QUALITY_LEVEL eQualityLevel);
00047         IFACEMETHOD (GetDropMode ) (_Out_ MF_QUALITY_DROP_MODE *peDropMode);
00048         IFACEMETHOD (GetQualityLevel )(_Out_ MF_QUALITY_LEVEL *peQualityLevel );
00049         IFACEMETHOD (DropTime) (_In_ LONGLONG hnsAmountToDrop);
00050
00051         // IMFQualityAdvise2
00052         IFACEMETHOD (NotifyQualityEvent) (_In_opt_ IMFMediaEvent *pEvent, _Out_ DWORD *pdwFlags);
00053
00054         // IMFGetService
00055         IFACEMETHOD (GetService) (_In_ REFGUID guidService,
00056                                  _In_ REFIID riid,
00057                                  _Out_ LPVOID *ppvObject);
00058
00059         // Other public methods
00060         HRESULT Start();
00061         HRESULT Stop();
00062         HRESULT SetRate(float flRate);
00063         HRESULT Flush();
00064         HRESULT Shutdown();
00065         void ProcessSample(StspSampleHeader *pSampleHeader, IMFSample *pSample);
00066         void ProcessFormatChange(IMFMediaType *pMediaType);
00067         HRESULT SetActive(bool fActive);
00068         bool IsActive() const {return _fActive;}
00069         SourceState GetState() const {return _eSourceState;}
00070
00071         DWORD GetId() const {return _dwId;}
00072
00073     protected:
00074         CMediaStream(CMediaSource *pSource);
00075         ~CMediaStream(void);
00076
00077     private:
00078         class CSourceLock;
00079
00080     private:
00081         void Initialize(StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer);
00082         void DeliverSamples();
00083         void SetSampleAttributes(StspSampleHeader *pSampleHeader, IMFSample *pSample);
00084         void HandleError(HRESULT hErrorCode);
00085
00086         HRESULT CheckShutdown() const
00087         {
00088             if (_eSourceState == SourceState_Shutdown)
00089             {
00090                 return MF_E_SHUTDOWN;
00091             }
00092             else
00093             {
00094                 return S_OK;
00095             }
00096         }
00097
00098         bool ShouldDropSample(IMFSample *pSample);
00099         void CleanSampleQueue();
00100         void ResetDropTime();
00101
00102     private:
00103         long                        _cRef;                      // reference count
00104         SourceState                 _eSourceState;              // Flag to indicate if Shutdown() method was called.
00105         ComPtr<CMediaSource>        _spSource;                  // Media source
00106         ComPtr<IMFMediaEventQueue>  _spEventQueue;              // Event queue
00107         ComPtr<IMFStreamDescriptor> _spStreamDescriptor;        // Stream descriptor
00108
00109         ComPtrList<IUnknown>        _samples;
00110         ComPtrList<IUnknown, true>  _tokens;
00111
00112         DWORD                       _dwId;
00113         bool                        _fActive;
00114         bool                        _fVideo;
00115         float                       _flRate;
00116
00117         MF_QUALITY_DROP_MODE        _eDropMode;
00118         bool                        _fDiscontinuity;
00119         bool                        _fDropTime;
00120         bool                        _fInitDropTime;
00121         bool                        _fWaitingForCleanPoint;
00122         LONGLONG                    _hnsStartDroppingAt;
00123         LONGLONG                    _hnsAmountToDrop;
00124     };
00125
00126 }}} // namespace Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:21:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StepTimer Member List

This is the complete list of members for StepTimer, including all inherited members.
ElapsedSeconds | StepTimer |
elapsedTicks | StepTimer | [private]
ElapsedTicks | StepTimer |
frameCount | StepTimer | [private]
FrameCount | StepTimer |
framesPerSecond | StepTimer | [private]
FramesPerSecond | StepTimer |
framesThisSecond | StepTimer | [private]
IsFixedTimeStep | StepTimer |
isFixedTimeStep | StepTimer | [private]
leftOverTicks | StepTimer | [private]
qpcFrequency | StepTimer | [private]
qpcLastTime | StepTimer | [private]
qpcMaxDelta | StepTimer | [private]
qpcSecondCounter | StepTimer | [private]
ResetElapsedTime() | StepTimer | [inline]
SecondsToTicks(double seconds) | StepTimer | [inline, private, static]
StepTimer() | StepTimer | [inline]
TargetElapsedSeconds | StepTimer |
TargetElapsedTicks | StepTimer |
targetElapsedTicks | StepTimer | [private]
Tick(Action update) | StepTimer | [inline]
TicksPerSecond | StepTimer | [private]
TicksToSeconds(long ticks) | StepTimer | [inline, private, static]
TotalSeconds | StepTimer |
TotalTicks | StepTimer |
totalTicks | StepTimer | [private]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp

CameraStreamCoordinateMapperMain.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CameraStreamCoordinateMapperMain.h"
00014
00015 #include "Common\DirectXHelper.h"
00016 #include "Common\GraphicsCamera.h"
00017
00018 #include "Content\QuadRenderer.h"
00019 #include "Content\TextRenderer.h"
00020 #include "Content\CameraCoordinateMapper.h"
00021
00022 using namespace CameraStreamCoordinateMapper;
00023
00024 using namespace Microsoft::WRL;
00025 using namespace Microsoft::WRL::Wrappers;
00026
00027 using namespace Windows::Foundation;
00028 using namespace Windows::Foundation::Numerics;
00029 using namespace Windows::Storage;
00030 using namespace Windows::System::Threading;
00031
00032 using namespace Windows::UI;
00033 using namespace Windows::UI::Core;
00034 using namespace Windows::UI::Xaml;
00035
00036 using namespace concurrency;
00037 using namespace DirectX;
00038
00039 CameraStreamCoordinateMapperMain::CameraStreamCoordinateMapperMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00040     m_deviceResources(deviceResources)
00041 {
00042     m_camera = ref new FirstPersonCamera();
00043
00044     m_gpuPerformanceTimer = std::make_unique<DX::GpuPerformanceTimer>(m_deviceResources);
00045     m_quadRenderer = std::make_unique<QuadRenderer>(m_deviceResources);
00046     m_statisticsTextRenderer = std::make_unique<TextRenderer>(m_deviceResources);
00047     m_helpTextRenderer = std::make_unique<TextRenderer>(m_deviceResources);
00048
00049     static constexpr const wchar_t* c_HelpTextDisabledStr =
00050         L"'F1' or 'Gamepad Menu' to toggle help \n";
00051
00052     static constexpr const wchar_t* c_HelpTextEnabledStr =
00053         L"'F1' or 'Gamepad Menu' to toggle help \n"
00054         L"'Space' or 'Gamepad A' to toggle streaming \n"
00055         L"'R' or 'Left Thumbstick' to reset the camera \n"
00056         L"'Y' or 'Gamepad Y' to toggle camera mode \n"
00057         L"'W/A/S/D/Q/E' to translate the free-roam camera \n"
00058         L"'Left thumbstick' to translate the free-roam camera \n"
00059         L"'Left mouse button' to rotate the free-roam camera \n"
00060         L"'Right thumbstick' to rotate the free-roam camera \n";
00061
00062     m_helpTextRenderer->Update(c_HelpTextDisabledStr);
00063
00064     CoreWindow::GetForCurrentThread()->KeyDown +=
00065         ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>([this](CoreWindow^ window, KeyEventArgs^ args)
00066     {
00067         if (args->VirtualKey == Windows::System::VirtualKey::Space ||
00068             args->VirtualKey == Windows::System::VirtualKey::GamepadA)
00069         {
00070             m_streamingEnabled = !m_streamingEnabled;
00071         }
00072
00073         if (args->VirtualKey == Windows::System::VirtualKey::R ||
00074             args->VirtualKey == Windows::System::VirtualKey::GamepadLeftThumbstickButton)
00075         {
00076             m_camera->Reset();
00077         }
00078
00079         if (args->VirtualKey == Windows::System::VirtualKey::Y ||
00080             args->VirtualKey == Windows::System::VirtualKey::GamepadY)
00081         {
00082             m_freeRoamCameraEnabled = !m_freeRoamCameraEnabled;
00083             m_camera->Reset();
00084         }
00085
00086         if (args->VirtualKey == Windows::System::VirtualKey::F1 ||
00087             args->VirtualKey == Windows::System::VirtualKey::GamepadMenu)
00088         {
00089             m_showHelpText = !m_showHelpText;
00090
00091             if (m_showHelpText)
00092             {
00093                 m_helpTextRenderer->Update(c_HelpTextEnabledStr);
00094             }
00095             else
00096             {
00097                 m_helpTextRenderer->Update(c_HelpTextDisabledStr);
00098             }
00099         }
00100     });
00101
00102     CreateResourcesAsync().then([this]
00103     {
00104         m_readyToRender = true;
00105     });
00106
00107     // Register to be notified if the Device is lost or recreated
00108     m_deviceResources->RegisterDeviceNotify(this);
00109 }
00110
00111 task<void> CameraStreamCoordinateMapper::CameraStreamCoordinateMapperMain::CreateResourcesAsync()
00112 {
00113     m_cameraCoordinateMapper = co_await CameraCoordinateMapper::CreateAndStartAsync(m_deviceResources);
00114 }
00115
00116 CameraStreamCoordinateMapperMain::~CameraStreamCoordinateMapperMain()
00117 {
00118     // Deregister device notification
00119     m_deviceResources->RegisterDeviceNotify(nullptr);
00120 }
00121
00122 // Updates application state when the window size changes (e.g. device orientation change)
00123 void CameraStreamCoordinateMapperMain::CreateWindowSizeDependentResources()
00124 {
00125     m_quadRenderer->CreateWindowSizeDependentResources();
00126 }
00127
00128 // Updates the application state once per frame.
00129 void CameraStreamCoordinateMapperMain::Update()
00130 {
00131     if (!m_readyToRender)
00132     {
00133         return;
00134     }
00135
00136     // Update scene objects.
00137     m_timer.Tick([&]()
00138     {
00139         m_camera->Update(static_cast<float>(m_timer.GetElapsedSeconds()));
00140
00141         if (m_cameraCoordinateMapper->AreCamerasStreaming())
00142         {
00143             static wchar_t buffer[256] = {};
00144
00145             const wchar_t* cameraModeStr = m_freeRoamCameraEnabled ? L"[Free-roam camera]" : L"[Target camera]";
00146             const wchar_t* streamingModeStr = m_streamingEnabled ? L"[Streaming]" : L"[Paused]";
00147             const float gpuTime = m_gpuPerformanceTimer->GetAvgFrameTime();
00148
00149             swprintf_s(buffer, L"%s %s [Gpu time: %.3fms] [FPS: %.4u]", streamingModeStr, cameraModeStr, gpuTime, m_timer.GetFramesPerSecond());
00150
00151             m_statisticsTextRenderer->Update(buffer);
00152         }
00153         else
00154         {
00155             m_statisticsTextRenderer->Update(L"No compatible/accessible was camera found\nEnsure the application has permission to access the camera");
00156         }
00157     });
00158
00159     if (!m_streamingEnabled)
00160     {
00161         return;
00162     }
00163
00164     if (m_cameraCoordinateMapper->TryAcquireLatestFrameData())
00165     {
00166         m_gpuPerformanceTimer->StartTimerForFrame();
00167
00168         m_cameraCoordinateMapper->RunCoordinateMapping();
00169
00170         m_gpuPerformanceTimer->EndTimerForFrame();
00171     }
00172 }
00173
00174 // Renders the current frame according to the current application state.
00175 // Returns true if the frame was rendered and is ready to be displayed.
00176 bool CameraStreamCoordinateMapperMain::Render()
00177 {
00178     if (!m_readyToRender)
00179     {
00180         return false;
00181     }
00182
00183     if (m_freeRoamCameraEnabled && m_cameraCoordinateMapper->AreCamerasStreaming())
00184     {
00185         m_cameraCoordinateMapper->VisualizeCoordinateMapping(
00186             m_deviceResources->GetBackBufferRenderTargetView(),
00187             m_deviceResources->GetDepthStencilView(),
00188             m_deviceResources->GetScreenViewport(),
00189             m_camera->GetWorldToCamera());
00190     }
00191     else
00192     {
00193         ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();
00194
00195         // Reset the viewport to target the whole screen.
00196         const D3D11_VIEWPORT viewport = m_deviceResources->GetScreenViewport();
00197         context->RSSetViewports(1, &viewport);
00198
00199         // Reset render targets to the screen.
00200         ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetView() };
00201         context->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());
00202
00203         // Clear the back imageBuffer and depth stencil view.
00204         context->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetView(), DirectX::Colors::CornflowerBlue);
00205         context->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00206
00207         if (m_cameraCoordinateMapper->AreCamerasStreaming())
00208         {
00209             ID3D11ShaderResourceView* targetTexture = m_cameraCoordinateMapper->GetTargetShaderResourceView();
00210             const float targetAspectRatio = m_cameraCoordinateMapper->GetTargetAspectRatio();
00211
00212             // Render the resulting target image as a quad
00213             if (targetTexture)
00214             {
00215                 m_quadRenderer->Render(targetTexture, targetAspectRatio);
00216             }
00217         }
00218     }
00219
00220     m_statisticsTextRenderer->Render(TextRenderer::TextAlignment::BottomRight);
00221     m_helpTextRenderer->Render(TextRenderer::TextAlignment::TopLeft);
00222
00223     return true;
00224 }
00225
00226 task<void> CameraStreamCoordinateMapperMain::OnSuspendingAsync()
00227 {
00228     m_readyToRender = false;
00229     return m_cameraCoordinateMapper->StopAsync();
00230 }
00231
00232 void CameraStreamCoordinateMapperMain::OnResuming()
00233 {
00234     m_cameraCoordinateMapper->StartAsync().then([this]
00235     {
00236         m_readyToRender = true;
00237     });
00238 }
00239
00240 // Notifies renderers that device resources need to be released.
00241 void CameraStreamCoordinateMapperMain::OnDeviceLost()
00242 {
00243     m_readyToRender = false;
00244
00245     m_quadRenderer->ReleaseDeviceDependentResources();
00246     m_statisticsTextRenderer->ReleaseDeviceDependentResources();
00247     m_helpTextRenderer->ReleaseDeviceDependentResources();
00248     m_cameraCoordinateMapper->ReleaseDeviceDependentResources();
00249 }
00250
00251 // Notifies renderers that device resources may now be recreated.
00252 void CameraStreamCoordinateMapperMain::OnDeviceRestored()
00253 {
00254     m_cameraCoordinateMapper->CreateDeviceDependentResources();
00255     m_helpTextRenderer->CreateDeviceDependentResources();
00256     m_statisticsTextRenderer->CreateDeviceDependentResources();
00257     m_quadRenderer->CreateDeviceDependentResources();
00258
00259     CreateWindowSizeDependentResources();
00260
00261     m_readyToRender = true;
00262 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario1_PercentPermilleFormatting.xaml.cs Source File

  • NumberFormatting
  • cs

Scenario1_PercentPermilleFormatting.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Text;
00013 using Windows.Globalization.NumberFormatting;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario1_PercentPermilleFormatting : Page
00020     {
00021         public Scenario1_PercentPermilleFormatting()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         /// <summary>
00027         /// This is the click handler for the 'Display' button.
00028         /// </summary>
00029         /// <param name="sender"></param>
00030         /// <param name="e"></param>
00031         private void Display_Click(object sender, RoutedEventArgs e)
00032         {
00033             // This scenario uses the Windows.Globalization.NumberFormatting.PercentFormatter and
00034             // the Windows.Globalization.NumberFormatting.PermilleFormatter classes to format numbers
00035             // as a percent or a permille.
00036
00037             // Keep results of the scenario in a StringBuilder
00038             StringBuilder results = new StringBuilder();
00039
00040             // Create numbers to format.
00041             double randomNumber = new Random().NextDouble();
00042             ulong fixedNumber = 500;
00043
00044             // Create percent formatters.
00045             PercentFormatter defaultPercentFormatter = new PercentFormatter();
00046             PercentFormatter frPercentFormatter = new PercentFormatter(new[] { "fr-FR" }, "ZZ");
00047             PercentFormatter arPercentFormatter = new PercentFormatter(new[] { "ar" }, "ZZ");
00048
00049             // Create permille formatters.
00050             PermilleFormatter defaultPermilleFormatter = new PermilleFormatter();
00051             PermilleFormatter arPermilleFormatter = new PermilleFormatter(new[] { "ar" }, "ZZ");
00052
00053             // Format random numbers as percent or permille.
00054             results.AppendLine("Random number (" + randomNumber + ")");
00055             results.AppendLine("Percent formatted: " + defaultPercentFormatter.Format(randomNumber));
00056             results.AppendLine("Permille formatted: " + defaultPermilleFormatter.Format(randomNumber));
00057             results.AppendLine();
00058             results.AppendLine("Language-specific percent formatted: " + frPercentFormatter.Format(randomNumber));
00059             results.AppendLine("Language-specific permille formatted: " + arPermilleFormatter.Format(randomNumber));
00060             results.AppendLine();
00061             results.AppendLine("Fixed number (" + fixedNumber + ")");
00062
00063             // Format fixed number with grouping.
00064             defaultPercentFormatter.IsGrouped = true;
00065             results.AppendLine("Percent formatted (grouped): " + defaultPercentFormatter.Format(fixedNumber));
00066
00067             //Format with grouping using French language.
00068             frPercentFormatter.IsGrouped = true;
00069             results.AppendLine("Percent formatted (grouped as fr-FR): " + frPercentFormatter.Format(fixedNumber));
00070
00071             // Format with grouping using Arabic.
00072             results.AppendLine("Percent formatted (grouped w/digits as ar): " + arPercentFormatter.Format(fixedNumber));
00073
00074             // Format with no fraction digits.
00075             defaultPercentFormatter.FractionDigits = 0;
00076             defaultPercentFormatter.IsGrouped = false;
00077             results.AppendLine("Percent formatted (no fractional digits): " + defaultPercentFormatter.Format(fixedNumber));
00078
00079             // Format always with a decimal point.
00080             defaultPercentFormatter.IsDecimalPointAlwaysDisplayed = true;
00081             defaultPercentFormatter.IsGrouped = false;
00082             results.AppendLine("Percent formatted (always with a decimal point): " + defaultPercentFormatter.Format(fixedNumber));
00083
00084             // Display the results
00085             OutputTextBlock.Text = results.ToString();
00086         }
00087     }
00088 }
Generated on Fri Nov 15 2024 22:20:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Simple3DGame.cpp Source File

  • Simple3DGameDX
  • cpp

Simple3DGame.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameRenderer.h"
00014
00015 #include "Level1.h"
00016 #include "Level2.h"
00017 #include "Level3.h"
00018 #include "Level4.h"
00019 #include "Level5.h"
00020 #include "Level6.h"
00021 #include "Animate.h"
00022 #include "Sphere.h"
00023 #include "Cylinder.h"
00024 #include "Face.h"
00025 #include "MediaReader.h"
00026
00027 using namespace concurrency;
00028 using namespace DirectX;
00029 using namespace Microsoft::WRL;
00030 using namespace Windows::Storage;
00031 using namespace Windows::UI::Core;
00032
00033 //----------------------------------------------------------------------
00034
00035 Simple3DGame::Simple3DGame():
00036     m_ammoCount(0),
00037     m_ammoNext(0),
00038     m_gameActive(false),
00039     m_levelActive(false),
00040     m_totalHits(0),
00041     m_totalShots(0),
00042     m_levelBonusTime(0.0),
00043     m_levelTimeRemaining(0.0),
00044     m_levelCount(0),
00045     m_currentLevel(0)
00046 {
00047     m_topScore.totalHits = 0;
00048     m_topScore.totalShots = 0;
00049     m_topScore.levelCompleted = 0;
00050 }
00051
00052 //----------------------------------------------------------------------
00053
00054 void Simple3DGame::Initialize(
00055     _In_ MoveLookController^ controller,
00056     _In_ GameRenderer^ renderer
00057     )
00058 {
00059     // This method is expected to be called as an asynchronous task.
00060     // Care should be taken to not call rendering methods on the
00061     // m_renderer as this would result in the D3D Context being
00062     // used in multiple threads, which is not allowed.
00063
00064     m_controller = controller;
00065     m_renderer = renderer;
00066
00067     m_audioController = ref new Audio;
00068     m_audioController->CreateDeviceIndependentResources();
00069
00070     m_ammo = std::vector<Sphere^>(GameConstants::MaxAmmo);
00071     m_objects = std::vector<GameObject^>();
00072     m_renderObjects = std::vector<GameObject^>();
00073     m_level = std::vector<Level^>();
00074
00075     m_savedState = ref new PersistentState();
00076     m_savedState->Initialize(ApplicationData::Current->LocalSettings->Values, "Game");
00077
00078     m_timer = ref new GameTimer();
00079
00080     // Create a sphere primitive to represent the player.
00081     // The sphere will be used to handle collisions and constrain the player in the world.
00082     // It is not rendered so it is not added to the list of render objects.
00083     // It is added to the object list so it will be included in intersection calculations.
00084     m_player = ref new Sphere(XMFLOAT3(0.0f, -1.3f, 4.0f), 0.2f);
00085     m_objects.push_back(m_player);
00086     m_player->Active(true);
00087
00088     m_camera = ref new Camera;
00089     m_camera->SetProjParams(XM_PI / 2, 1.0f, 0.01f, 100.0f);
00090     m_camera->SetViewParams(
00091         m_player->Position(),            // Eye point in world coordinates.
00092         XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
00093         XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
00094         );
00095
00096     m_controller->Pitch(m_camera->Pitch());
00097     m_controller->Yaw(m_camera->Yaw());
00098
00099     // Instantiate a set of primitives to represent the containing world. These objects
00100     // maintain the geometry and material properties of the walls, floor and ceiling.
00101     // The TargetId is used to identify the world objects so that the right geometry
00102     // and textures can be associated with them later after those resources have
00103     // been created.
00104     GameObject^ world = ref new GameObject();
00105     world->TargetId(GameConstants::WorldFloorId);
00106     world->Active(true);
00107     m_renderObjects.push_back(world);
00108
00109     world = ref new GameObject();
00110     world->TargetId(GameConstants::WorldCeilingId);
00111     world->Active(true);
00112     m_renderObjects.push_back(world);
00113
00114     world = ref new GameObject();
00115     world->TargetId(GameConstants::WorldWallsId);
00116     world->Active(true);
00117     m_renderObjects.push_back(world);
00118
00119     // Min and max Bound are defining the world space of the game.
00120     // All camera motion and dynamics are confined to this space.
00121     m_minBound = XMFLOAT3(-4.0f, -3.0f, -6.0f);
00122     m_maxBound = XMFLOAT3(4.0f, 3.0f, 6.0f);
00123
00124     // Instantiate the Cylinders for use in the various game levels.
00125     // Each cylinder has a different initial position, radius and direction vector,
00126     // but share a common set of material properties.
00127     for (int a = 0; a < GameConstants::MaxCylinders; a++)
00128     {
00129         Cylinder^ cylinder;
00130         switch (a)
00131         {
00132         case 0:
00133             cylinder = ref new Cylinder(XMFLOAT3(-2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00134             break;
00135         case 1:
00136             cylinder = ref new Cylinder(XMFLOAT3(2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00137             break;
00138         case 2:
00139             cylinder = ref new Cylinder(XMFLOAT3(0.0f, -3.0f, -2.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00140             break;
00141         case 3:
00142             cylinder = ref new Cylinder(XMFLOAT3(-1.5f, -3.0f, -4.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00143             break;
00144         case 4:
00145             cylinder = ref new Cylinder(XMFLOAT3(1.5f, -3.0f, -4.0f), 0.50f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00146             break;
00147         }
00148         cylinder->Active(true);
00149         m_objects.push_back(cylinder);
00150         m_renderObjects.push_back(cylinder);
00151     }
00152
00153     MediaReader^ mediaReader = ref new MediaReader;
00154     auto targetHitSound = mediaReader->LoadMedia("Assets\\hit.wav");
00155
00156     // Instantiate the targets for use in the game.
00157     // Each target has a different initial position, size and orientation,
00158     // but share a common set of material properties.
00159     // The target is defined by a position and two vectors that define both
00160     // the plane of the target in world space and the size of the parallelogram
00161     // based on the lengths of the vectors.
00162     // Each target is assigned a number for identification purposes.
00163     // The Target ID number is 1 based.
00164     // All targets have the same material properties.
00165     for (int a = 1; a < GameConstants::MaxTargets; a++)
00166     {
00167         Face^ target;
00168         switch (a)
00169         {
00170         case 1:
00171             target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -1.5f), XMFLOAT3(-1.5f, -1.0f, -2.0f), XMFLOAT3(-2.5f, 1.0f, -1.5f));
00172             break;
00173         case 2:
00174             target = ref new Face(XMFLOAT3(-1.0f, 1.0f, -3.0f), XMFLOAT3(0.0f, 1.0f, -3.0f), XMFLOAT3(-1.0f, 2.0f, -3.0f));
00175             break;
00176         case 3:
00177             target = ref new Face(XMFLOAT3(1.5f, 0.0f, -3.0f), XMFLOAT3(2.5f, 0.0f, -2.0f), XMFLOAT3(1.5f, 2.0f, -3.0f));
00178             break;
00179         case 4:
00180             target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -5.5f), XMFLOAT3(-0.5f, -1.0f, -5.5f), XMFLOAT3(-2.5f, 1.0f, -5.5f));
00181             break;
00182         case 5:
00183             target = ref new Face(XMFLOAT3(0.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, -2.0f, -5.0f), XMFLOAT3(0.5f, 0.0f, -5.0f));
00184             break;
00185         case 6:
00186             target = ref new Face(XMFLOAT3(1.5f, -2.0f, -5.5f), XMFLOAT3(2.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, 0.0f, -5.5f));
00187             break;
00188         case 7:
00189             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00190             break;
00191         case 8:
00192             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00193             break;
00194         case 9:
00195             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00196             break;
00197         }
00198
00199         target->Target(true);
00200         target->TargetId(a);
00201         target->Active(true);
00202         target->HitSound(ref new SoundEffect());
00203         target->HitSound()->Initialize(
00204             m_audioController->SoundEffectEngine(),
00205             mediaReader->GetOutputWaveFormatEx(),
00206             targetHitSound
00207             );
00208
00209         m_objects.push_back(target);
00210         m_renderObjects.push_back(target);
00211     }
00212
00213     // Instantiate a set of spheres to be used as ammunition for the game
00214     // and set the material properties of the spheres.
00215     auto ammoHitSound = mediaReader->LoadMedia("Assets\\bounce.wav");
00216
00217     for (int a = 0; a < GameConstants::MaxAmmo; a++)
00218     {
00219         m_ammo[a] = ref new Sphere;
00220         m_ammo[a]->Radius(GameConstants::AmmoRadius);
00221         m_ammo[a]->HitSound(ref new SoundEffect());
00222         m_ammo[a]->HitSound()->Initialize(
00223             m_audioController->SoundEffectEngine(),
00224             mediaReader->GetOutputWaveFormatEx(),
00225             ammoHitSound
00226             );
00227         m_ammo[a]->Active(false);
00228         m_renderObjects.push_back(m_ammo[a]);
00229     }
00230
00231     // Instantiate each of the game levels. The Level class contains methods
00232     // that initialize the objects in the world for the given level and also
00233     // define any motion paths for the objects in that level.
00234
00235     m_level.push_back(ref new Level1);
00236     m_level.push_back(ref new Level2);
00237     m_level.push_back(ref new Level3);
00238     m_level.push_back(ref new Level4);
00239     m_level.push_back(ref new Level5);
00240     m_level.push_back(ref new Level6);
00241     m_levelCount = static_cast<uint32>(m_level.size());
00242
00243     // Load the top score from disk if it exists.
00244     LoadHighScore();
00245
00246     // Load the currentScore for saved state if it exists.
00247     LoadState();
00248
00249     m_controller->Active(false);
00250 }
00251
00252 //----------------------------------------------------------------------
00253
00254 void Simple3DGame::LoadGame()
00255 {
00256     m_player->Position(XMFLOAT3 (0.0f, -1.3f, 4.0f));
00257
00258     m_camera->SetViewParams(
00259         m_player->Position(),            // Eye point in world coordinates.
00260         XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
00261         XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
00262         );
00263
00264     m_controller->Pitch(m_camera->Pitch());
00265     m_controller->Yaw(m_camera->Yaw());
00266     m_currentLevel = 0;
00267     m_levelTimeRemaining = 0.0f;
00268     m_levelBonusTime = m_levelTimeRemaining;
00269     m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;
00270     InitializeAmmo();
00271     m_totalHits = 0;
00272     m_totalShots = 0;
00273     m_gameActive = false;
00274     m_levelActive = false;
00275     m_timer->Reset();
00276 }
00277
00278 //----------------------------------------------------------------------
00279
00280 task<void> Simple3DGame::LoadLevelAsync()
00281 {
00282     // Initialize the level and spin up the async loading of the rendering
00283     // resources for the level.
00284     // This will run in a separate thread, so for Direct3D 11, only Device
00285     // methods are allowed.  Any DeviceContext method calls need to be
00286     // done in FinalizeLoadLevel.
00287
00288     m_level[m_currentLevel]->Initialize(m_objects);
00289     m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;
00290
00291     return m_renderer->LoadLevelResourcesAsync();
00292 }
00293
00294 //----------------------------------------------------------------------
00295
00296 void Simple3DGame::FinalizeLoadLevel()
00297 {
00298     // This method is called on the main thread, so Direct3D 11 DeviceContext
00299     // method calls are allowable here.
00300
00301     // Finalize the Level loading.
00302     m_renderer->FinalizeLoadLevelResources();
00303 }
00304
00305 //----------------------------------------------------------------------
00306
00307 void Simple3DGame::StartLevel()
00308 {
00309     m_timer->Reset();
00310     m_timer->Start();
00311     if (m_currentLevel == 0)
00312     {
00313         m_gameActive = true;
00314     }
00315     m_levelActive = true;
00316     m_controller->Active(true);
00317 }
00318
00319 //----------------------------------------------------------------------
00320
00321 void Simple3DGame::PauseGame()
00322 {
00323     m_timer->Stop();
00324     SaveState();
00325 }
00326
00327 //----------------------------------------------------------------------
00328
00329 void Simple3DGame::ContinueGame()
00330 {
00331     m_timer->Start();
00332     m_controller->Active(true);
00333 }
00334
00335 //----------------------------------------------------------------------
00336
00337 GameState Simple3DGame::RunGame()
00338 {
00339     // This method is called to execute a single time interval for active game play.
00340     // It returns the resulting state of game play after the interval has been executed.
00341
00342     m_timer->Update();
00343
00344     m_levelTimeRemaining = m_levelDuration - m_timer->PlayingTime();
00345
00346     if (m_levelTimeRemaining <= 0.0f)
00347     {
00348         // Time expired, so the game is over.
00349         m_levelTimeRemaining = 0.0f;
00350         InitializeAmmo();
00351         m_timer->Reset();
00352         m_gameActive = false;
00353         m_levelActive = false;
00354         SaveState();
00355
00356         if (m_totalHits > m_topScore.totalHits)
00357         {
00358             // There is a new high score so save it.
00359             m_topScore.totalHits = m_totalHits;
00360             m_topScore.totalShots = m_totalShots;
00361             m_topScore.levelCompleted = m_currentLevel;
00362
00363             SaveHighScore();
00364         }
00365         return GameState::TimeExpired;
00366     }
00367     else
00368     {
00369         // Time has not expired, so run one frame of game play.
00370         m_player->Velocity(m_controller->Velocity());
00371         m_camera->LookDirection(m_controller->LookDirection());
00372
00373         UpdateDynamics();
00374
00375         // Update the Camera with the player position updates from the dynamics calculations.
00376         m_camera->Eye(m_player->Position());
00377         m_camera->LookDirection(m_controller->LookDirection());
00378
00379         if (m_level[m_currentLevel]->Update(m_timer->PlayingTime(), m_timer->DeltaTime(), m_levelTimeRemaining, m_objects))
00380         {
00381             // The level has been completed.
00382             m_levelActive = false;
00383             InitializeAmmo();
00384
00385             if (m_currentLevel < m_levelCount-1)
00386             {
00387                 // More levels to go so increment the level number.
00388                 // Actual level loading will occur in the LoadLevelAsync / FinalizeLoadLevel
00389                 // methods.
00390                 m_timer->Reset();
00391                 m_currentLevel++;
00392                 m_levelBonusTime = m_levelTimeRemaining;
00393                 SaveState();
00394                 return GameState::LevelComplete;
00395             }
00396             else
00397             {
00398                 // All levels have been completed.
00399                 m_timer->Reset();
00400                 m_gameActive = false;
00401                 m_levelActive = false;
00402                 SaveState();
00403
00404                 if (m_totalHits > m_topScore.totalHits)
00405                 {
00406                     // There is a new high score so save it.
00407                     m_topScore.totalHits = m_totalHits;
00408                     m_topScore.totalShots = m_totalShots;
00409                     m_topScore.levelCompleted = m_currentLevel;
00410
00411                     SaveHighScore();
00412                 }
00413                 return GameState::GameComplete;
00414             }
00415         }
00416     }
00417     return GameState::Active;
00418 }
00419
00420 //----------------------------------------------------------------------
00421
00422 void Simple3DGame::OnSuspending()
00423 {
00424     m_audioController->SuspendAudio();
00425 }
00426
00427 //----------------------------------------------------------------------
00428
00429 void Simple3DGame::OnResuming()
00430 {
00431     m_audioController->ResumeAudio();
00432 }
00433
00434 //----------------------------------------------------------------------
00435
00436 void Simple3DGame::UpdateDynamics()
00437 {
00438     float timeTotal = m_timer->PlayingTime();
00439     float timeFrame = m_timer->DeltaTime();
00440     bool fire = m_controller->IsFiring();
00441
00442 #pragma region Shoot Ammo
00443     // Shoot ammo.
00444     if (fire)
00445     {
00446         static float lastFired;  // Timestamp of last ammo fired.
00447
00448         if (timeTotal < lastFired)
00449         {
00450             // timeTotal is not guarenteed to be monotomically increasing because it is
00451             // reset at each level.
00452             lastFired = timeTotal - GameConstants::Physics::AutoFireDelay;
00453         }
00454
00455         if (timeTotal - lastFired >= GameConstants::Physics::AutoFireDelay)
00456         {
00457             // Get inverse view matrix.
00458             XMMATRIX invView;
00459             XMVECTOR det;
00460             invView = XMMatrixInverse(&det, m_camera->View());
00461
00462             // Compute initial velocity in world space from camera space.
00463             XMFLOAT4 initialVelocity(0.0f, 0.0f, 15.0f, 0.0f);
00464             m_ammo[m_ammoNext]->Velocity(XMVector4Transform(XMLoadFloat4(&initialVelocity), invView));
00465
00466             // Set the initial position of the ammo to be fired. The position is offset from the player
00467             // to avoid an initial collision with the player object.
00468             XMFLOAT4 initialPosition(0.0f, -0.15f, m_player->Radius() + GameConstants::AmmoSize, 1.0f);
00469             m_ammo[m_ammoNext]->Position(XMVector4Transform(XMLoadFloat4(&initialPosition), invView));
00470
00471             // Initially not laying on ground.
00472             m_ammo[m_ammoNext]->OnGround(false);
00473             m_ammo[m_ammoNext]->Active(true);
00474
00475             // Set position in array of next Ammo to use.
00476             // We will re-use ammo taking the least recently used once we have hit the
00477             // MaxAmmo in use.
00478             m_ammoNext = (m_ammoNext + 1) % GameConstants::MaxAmmo;
00479             m_ammoCount = min(m_ammoCount + 1, GameConstants::MaxAmmo);
00480
00481             lastFired = timeTotal;
00482             m_totalShots++;
00483         }
00484     }
00485 #pragma endregion
00486
00487 #pragma region Animate Objects
00488     // Walk the list of objects looking for any objects that have an animation associated with it.
00489     // Update the position of the object based on evaluating the animation object with the current time.
00490     // Once the current time (timeTotal) is past the end of the animation time remove
00491     // the animation object since it is no longer needed.
00492     for (uint32 i = 0; i < m_objects.size(); i++)
00493     {
00494         if (m_objects[i]->AnimatePosition())
00495         {
00496             m_objects[i]->Position(m_objects[i]->AnimatePosition()->Evaluate(timeTotal));
00497             if (m_objects[i]->AnimatePosition()->IsFinished(timeTotal))
00498             {
00499                 m_objects[i]->AnimatePosition(nullptr);
00500             }
00501         }
00502     }
00503 #pragma endregion
00504
00505     // If the elapsed time is too long, we slice up the time and handle physics over several
00506     // smaller time steps to avoid missing collisions.
00507     float timeLeft = timeFrame;
00508     float elapsedFrameTime;
00509     while (timeLeft > 0.0f)
00510     {
00511         elapsedFrameTime = min(timeLeft, GameConstants::Physics::FrameLength);
00512         timeLeft -= elapsedFrameTime;
00513
00514         // Update the player position.
00515         m_player->Position(m_player->VectorPosition() + m_player->VectorVelocity() * elapsedFrameTime);
00516
00517         // Do m_player / object intersections.
00518         for (uint32 a = 0; a < m_objects.size(); a++)
00519         {
00520             if (m_objects[a]->Active() && m_objects[a] != m_player)
00521             {
00522                 XMFLOAT3 contact;
00523                 XMFLOAT3 normal;
00524
00525                 if (m_objects[a]->IsTouching(m_player->Position(), m_player->Radius(), &contact, &normal))
00526                 {
00527                     // Player is in contact with m_objects[a].
00528                     XMVECTOR oneToTwo;
00529                     oneToTwo = -XMLoadFloat3(&normal);
00530
00531                     float impact = XMVectorGetX(
00532                         XMVector3Dot (oneToTwo, m_player->VectorVelocity())
00533                         );
00534                     // Make sure that the player is actually headed towards the object. At grazing angles there
00535                     // could appear to be an impact when the player is actually already hit and moving away.
00536                     if (impact > 0.0f)
00537                     {
00538                         // Compute the normal and tangential components of the player's velocity.
00539                         XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, m_player->VectorVelocity()) * oneToTwo;
00540                         XMVECTOR velocityOneTangent = m_player->VectorVelocity() - velocityOneNormal;
00541
00542                         // Compute post-collision velocity.
00543                         m_player->Velocity(velocityOneTangent - velocityOneNormal);
00544
00545                         // Fix the positions so that the player is just touching the object.
00546                         float distanceToMove = m_player->Radius();
00547                         m_player->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));
00548                     }
00549                 }
00550             }
00551         }
00552         {
00553             // Do collision detection of the player with the bounding world.
00554             XMFLOAT3 position = m_player->Position();
00555             XMFLOAT3 velocity = m_player->Velocity();
00556             float radius = m_player->Radius();
00557
00558             // Check for player collisions with the walls floor or ceiling and adjust the position.
00559             float limit = m_minBound.x + radius;
00560             if (position.x < limit)
00561             {
00562                 position.x = limit;
00563                 velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00564             }
00565             limit = m_maxBound.x - radius;
00566             if (position.x > limit)
00567             {
00568                 position.x = limit;
00569                 velocity.x = -velocity.x + GameConstants::Physics::GroundRestitution;
00570             }
00571             limit = m_minBound.y + radius;
00572             if (position.y < limit)
00573             {
00574                 position.y = limit;
00575                 velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00576             }
00577             limit = m_maxBound.y - radius;
00578             if (position.y > limit)
00579             {
00580                 position.y = limit;
00581                 velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00582             }
00583             limit = m_minBound.z + radius;
00584             if (position.z < limit)
00585             {
00586                 position.z = limit;
00587                 velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00588             }
00589             limit = m_maxBound.z - radius;
00590             if (position.z > limit)
00591             {
00592                 position.z = limit;
00593                 velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00594             }
00595             m_player->Position(position);
00596             m_player->Velocity(velocity);
00597         }
00598
00599         // Animate the ammo.
00600         if (m_ammoCount > 0)
00601         {
00602             // Check for collisions between ammo.
00603 #pragma region inter-ammo collision detection
00604             if (m_ammoCount > 1)
00605             {
00606                 for (uint32 one = 0; one < m_ammoCount; one++)
00607                 {
00608                     for (uint32 two = (one + 1); two < m_ammoCount; two++)
00609                     {
00610                         // Check collision between instances One and Two.
00611                         // OneToTwo is the vector between the centers of the two ammo that are being checked.
00612                         XMVECTOR oneToTwo;
00613                         oneToTwo = m_ammo[two]->VectorPosition() - m_ammo[one]->VectorPosition();
00614                         float distanceSquared;
00615                         distanceSquared = XMVectorGetX(
00616                             XMVector3LengthSq(oneToTwo)
00617                             );
00618                         if (distanceSquared < (GameConstants::AmmoSize * GameConstants::AmmoSize))
00619                         {
00620                             // The two ammo are intersecting.
00621                             oneToTwo = XMVector3Normalize(oneToTwo);
00622
00623                             // Check if the two instances are already moving away from each other.
00624                             // If so, skip collision.  This can happen when a lot of instances are
00625                             // bunched up next to each other.
00626                             float impact;
00627                             impact = XMVectorGetX(
00628                                 XMVector3Dot(oneToTwo, m_ammo[one]->VectorVelocity()) -
00629                                 XMVector3Dot(oneToTwo, m_ammo[two]->VectorVelocity())
00630                                 );
00631                             if (impact > 0.0f)
00632                             {
00633                                 // Compute the normal and tangential components of one's velocity.
00634                                 XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
00635                                 XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
00636                                 XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;
00637                                 // Compute the normal and tangential components of two's velocity.
00638                                 XMVECTOR velocityTwo = (1 - GameConstants::Physics::BounceLost) * m_ammo[two]->VectorVelocity();
00639                                 XMVECTOR velocityTwoNormal = XMVector3Dot(oneToTwo, velocityTwo) * oneToTwo;
00640                                 XMVECTOR velocityTwoTangent = velocityTwo - velocityTwoNormal;
00641
00642                                 // Compute the post-collision velocities.
00643                                 m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer) +
00644                                     velocityTwoNormal * GameConstants::Physics::BounceTransfer
00645                                     );
00646                                 m_ammo[two]->Velocity(velocityTwoTangent - velocityTwoNormal * (1 - GameConstants::Physics::BounceTransfer) +
00647                                     velocityOneNormal * GameConstants::Physics::BounceTransfer
00648                                     );
00649
00650                                 // Fix the positions so that the two balls are exactly GameConstants::AmmoSize apart.
00651                                 float distanceToMove = (GameConstants::AmmoSize - sqrtf(distanceSquared)) * 0.5f;
00652                                 m_ammo[one]->Position(m_ammo[one]->VectorPosition() - (oneToTwo * distanceToMove));
00653                                 m_ammo[two]->Position(m_ammo[two]->VectorPosition() + (oneToTwo * distanceToMove));
00654
00655                                 // Flag the two instances so that they are not laying on ground.
00656                                 m_ammo[one]->OnGround(false);
00657                                 m_ammo[two]->OnGround(false);
00658
00659                                 // Start playing the sounds for the impact between the two balls.
00660                                 m_ammo[one]->PlaySound(impact, m_player->Position());
00661                                 m_ammo[two]->PlaySound(impact, m_player->Position());
00662                             }
00663                         }
00664                     }
00665                 }
00666             }
00667 #pragma endregion
00668
00669 #pragma region Ammo-Object intersections
00670             // Check for intersections between the ammo and the other objects in the scene.
00671             for (uint32 one = 0; one < m_ammoCount; one++)
00672             {
00673                 if (m_objects.size() > 0)
00674                 {
00675                     if (!m_ammo[one]->OnGround())
00676                     {
00677                         for (uint32 i = 0; i < m_objects.size(); i++)
00678                         {
00679                             if (m_objects[i]->Active())
00680                             {
00681                                 // The object is currently active in the scene. There may be objects in the list
00682                                 // that are currently inactive, so those are skipped.
00683                                 XMFLOAT3 contact;
00684                                 XMFLOAT3 normal;
00685
00686                                 if (m_objects[i]->IsTouching(m_ammo[one]->Position(), GameConstants::AmmoRadius, &contact, &normal))
00687                                 {
00688                                     // Ball is in contact with Object.
00689                                     XMVECTOR oneToTwo;
00690                                     oneToTwo = -XMLoadFloat3(&normal);
00691
00692                                     float impact;
00693                                     impact = XMVectorGetX(
00694                                         XMVector3Dot (oneToTwo, m_ammo[one]->VectorVelocity())
00695                                         );
00696                                     // Make sure that the ball is actually headed towards the object. At grazing angles there
00697                                     // could appear to be an impact when the ball is actually already hit and moving away.
00698                                     if (impact > 0.0f)
00699                                     {
00700                                         // Compute the normal and tangential components of the ammo's velocity.
00701                                         XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
00702                                         XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
00703                                         XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;
00704
00705                                         // Compute post-collision velocity of the ammo.
00706                                         m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer));
00707
00708                                         // Fix the position so that the ball is exactly GameConstants::AmmoRadius from target.
00709                                         float distanceToMove = GameConstants::AmmoSize;
00710                                         m_ammo[one]->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));
00711
00712                                         // Flag the Ammo as not laying on ground.
00713                                         m_ammo[one]->OnGround(false);
00714
00715                                         // Play the sound associated with the Ammo hitting something.
00716                                         m_ammo[one]->PlaySound(impact, m_player->Position());
00717
00718                                         if (m_objects[i]->Target() && !m_objects[i]->Hit())
00719                                         {
00720                                             // The object is a target and isn't currently hit, so mark it as hit and
00721                                             // play the sound associated with the impact.
00722                                             m_objects[i]->Hit(true);
00723                                             m_objects[i]->HitTime(timeTotal);
00724                                             m_totalHits++;
00725
00726                                             m_objects[i]->PlaySound(impact, m_player->Position());
00727                                         }
00728                                     }
00729                                 }
00730                             }
00731                         }
00732                     }
00733                 }
00734             }
00735 #pragma endregion
00736
00737 #pragma region Apply Gravity and world intersection
00738             // Apply gravity and check for collision against enclosing volume.
00739             for (uint32 i = 0; i < m_ammoCount; i++)
00740             {
00741                 // Update the position and velocity of the ammo instance.
00742                 m_ammo[i]->Position(m_ammo[i]->VectorPosition() + m_ammo[i]->VectorVelocity() * elapsedFrameTime);
00743
00744                 XMFLOAT3 velocity = m_ammo[i]->Velocity();
00745                 XMFLOAT3 position = m_ammo[i]->Position();
00746
00747                 velocity.x -= velocity.x * 0.1f * elapsedFrameTime;
00748                 velocity.z -= velocity.z * 0.1f * elapsedFrameTime;
00749                 if (!m_ammo[i]->OnGround())
00750                 {
00751                     // Apply gravity if the ammo instance is not already resting on the ground.
00752                     velocity.y -= GameConstants::Physics::Gravity * elapsedFrameTime;
00753                 }
00754
00755                 if (!m_ammo[i]->OnGround())
00756                 {
00757                     float limit = m_minBound.y + GameConstants::AmmoRadius;
00758                     if (position.y < limit)
00759                     {
00760                         // The ammo instance hit the ground.
00761                         // Align the ammo instance to the ground, invert the Y component of the velocity and
00762                         // play the impact sound. The X and Z velocity components will be reduced
00763                         // because of friction.
00764                         position.y = limit;
00765                         m_ammo[i]->PlaySound(-velocity.y, m_player->Position());
00766
00767                         velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00768                         velocity.x *= GameConstants::Physics::Friction;
00769                         velocity.z *= GameConstants::Physics::Friction;
00770                     }
00771                 }
00772                 else
00773                 {
00774                     // The ammo instance is resting or rolling on ground.
00775                     // X and Z velocity components are reduced because of friction.
00776                     velocity.x *= GameConstants::Physics::Friction;
00777                     velocity.z *= GameConstants::Physics::Friction;
00778                 }
00779
00780                 float limit = m_maxBound.y - GameConstants::AmmoRadius;
00781                 if (position.y > limit)
00782                 {
00783                     // The ammo instance hit the ceiling.
00784                     // Align the ammo instance to the ceiling, invert the Y component of the velocity and
00785                     // play the impact sound. The X and Z velocity components will be reduced
00786                     // because of friction.
00787                     position.y = limit;
00788                     m_ammo[i]->PlaySound(-velocity.y, m_player->Position());
00789
00790                     velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00791                     velocity.x *= GameConstants::Physics::Friction;
00792                     velocity.z *= GameConstants::Physics::Friction;
00793                 }
00794
00795                 limit = m_minBound.y + GameConstants::AmmoRadius;
00796                 if ((GameConstants::Physics::Gravity * (position.y - limit) + 0.5f * velocity.y * velocity.y) < GameConstants::Physics::RestThreshold)
00797                 {
00798                     // The Y velocity component is below the resting threshold so flag the instance as
00799                     // laying on the ground and set the Y velocity component to zero.
00800                     position.y = limit;
00801                     velocity.y = 0.0f;
00802                     m_ammo[i]->OnGround(true);
00803                 }
00804
00805                 limit = m_minBound.z + GameConstants::AmmoRadius;
00806                 if (position.z < limit)
00807                 {
00808                     // The ammo instance hit the a wall in the min Z direction.
00809                     // Align the ammo instance to the wall, invert the Z component of the velocity and
00810                     // play the impact sound.
00811                     position.z = limit;
00812                     m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
00813                     velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00814                 }
00815
00816                 limit = m_maxBound.z - GameConstants::AmmoRadius;
00817                 if (position.z > limit)
00818                 {
00819                     // The ammo instance hit the a wall in the max Z direction.
00820                     // Align the ammo instance to the wall, invert the Z component of the velocity and
00821                     // play the impact sound.
00822                     position.z = limit;
00823                     m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
00824                     velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00825                 }
00826
00827                 limit = m_minBound.x + GameConstants::AmmoRadius;
00828                 if (position.x < limit)
00829                 {
00830                     // The ammo instance hit the a wall in the min X direction.
00831                     // Align the ammo instance to the wall, invert the X component of the velocity and
00832                     // play the impact sound.
00833                     position.x = limit;
00834                     m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
00835                     velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00836                 }
00837
00838                 limit = m_maxBound.x - GameConstants::AmmoRadius;
00839                 if (position.x > limit)
00840                 {
00841                     // The ammo instance hit the a wall in the max X direction.
00842                     // Align the ammo instance to the wall, invert the X component of the velocity and
00843                     // play the impact sound.
00844                     position.x = limit;
00845                     m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
00846                     velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00847                 }
00848
00849                 // Save the updated velocity and position for the ammo instance.
00850                 m_ammo[i]->Velocity(velocity);
00851                 m_ammo[i]->Position(position);
00852             }
00853         }
00854     }
00855 #pragma endregion
00856 }
00857
00858 //----------------------------------------------------------------------
00859
00860 void Simple3DGame::SaveState()
00861 {
00862     // Save basic state of the game.
00863     m_savedState->SaveBool(":GameActive", m_gameActive);
00864     m_savedState->SaveBool(":LevelActive", m_levelActive);
00865     m_savedState->SaveInt32(":LevelCompleted", m_currentLevel);
00866     m_savedState->SaveInt32(":TotalShots", m_totalShots);
00867     m_savedState->SaveInt32(":TotalHits", m_totalHits);
00868     m_savedState->SaveSingle(":BonusRoundTime", m_levelBonusTime);
00869     m_savedState->SaveXMFLOAT3(":PlayerPosition", m_player->Position());
00870     m_savedState->SaveXMFLOAT3(":PlayerLookDirection", m_controller->LookDirection());
00871
00872     if (m_levelActive)
00873     {
00874         // The game is currently in the middle of a level, so save the extended state of
00875         // the game.
00876         m_savedState->SaveSingle(":LevelDuration", m_levelDuration);
00877         m_savedState->SaveSingle(":LevelPlayingTime", m_timer->PlayingTime());
00878
00879         m_savedState->SaveInt32(":AmmoCount", m_ammoCount);
00880         m_savedState->SaveInt32(":AmmoNext", m_ammoNext);
00881
00882         const int bufferLength = 16;
00883         char16 str[bufferLength];
00884
00885         for (uint32 i = 0; i < m_ammoCount; i++)
00886         {
00887             int len = swprintf_s(str, bufferLength, L"%d", i);
00888             Platform::String^ string = ref new Platform::String(str, len);
00889
00890             m_savedState->SaveBool(Platform::String::Concat(":AmmoActive", string), m_ammo[i]->Active());
00891             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoPosition", string), m_ammo[i]->Position());
00892             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoVelocity", string), m_ammo[i]->Velocity());
00893         }
00894
00895         m_savedState->SaveInt32(":ObjectCount", static_cast<int>(m_objects.size()));
00896
00897         for (uint32 i = 0; i < m_objects.size(); i++)
00898         {
00899             int len = swprintf_s(str, bufferLength, L"%d", i);
00900             Platform::String^ string = ref new Platform::String(str, len);
00901
00902             m_savedState->SaveBool(Platform::String::Concat(":ObjectActive", string), m_objects[i]->Active());
00903             m_savedState->SaveBool(Platform::String::Concat(":ObjectTarget", string), m_objects[i]->Target());
00904             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":ObjectPosition", string), m_objects[i]->Position());
00905         }
00906
00907         m_level[m_currentLevel]->SaveState(m_savedState);
00908     }
00909 }
00910
00911 //----------------------------------------------------------------------
00912
00913 void Simple3DGame::LoadState()
00914 {
00915     m_gameActive = m_savedState->LoadBool(":GameActive", m_gameActive);
00916     m_levelActive = m_savedState->LoadBool(":LevelActive", m_levelActive);
00917
00918     if (m_gameActive)
00919     {
00920         // Loading from the last known state means the game wasn't finished when it was last played,
00921         // so set the current level.
00922
00923         m_totalShots = m_savedState->LoadInt32(":TotalShots", 0);
00924         m_totalHits = m_savedState->LoadInt32(":TotalHits", 0);
00925         m_currentLevel = m_savedState->LoadInt32(":LevelCompleted", 0);
00926         m_levelBonusTime = m_savedState->LoadSingle(":BonusRoundTime", 0.0f);
00927
00928         m_levelTimeRemaining = m_levelBonusTime;
00929
00930         // Reload the current player position and set both the camera and the controller
00931         // with the current Look Direction.
00932         m_player->Position(
00933             m_savedState->LoadXMFLOAT3(":PlayerPosition", XMFLOAT3(0.0f, 0.0f, 0.0f))
00934             );
00935         m_camera->Eye(m_player->Position());
00936         m_camera->LookDirection(
00937             m_savedState->LoadXMFLOAT3(":PlayerLookDirection", XMFLOAT3(0.0f, 0.0f, 1.0f))
00938             );
00939         m_controller->Pitch(m_camera->Pitch());
00940         m_controller->Yaw(m_camera->Yaw());
00941     }
00942     else
00943     {
00944         // The game was not being played when it was last saved, so initialize to the beginning.
00945         m_currentLevel = 0;
00946         m_levelBonusTime = 0;
00947     }
00948 }
00949
00950 //----------------------------------------------------------------------
00951
00952 void Simple3DGame::SetCurrentLevelToSavedState()
00953 {
00954     if (m_gameActive)
00955     {
00956         if (m_levelActive)
00957         {
00958             // Middle of a level so restart where left off.
00959             m_levelDuration = m_savedState->LoadSingle(":LevelDuration", 0.0f);
00960
00961             m_timer->Reset();
00962             m_timer->PlayingTime(m_savedState->LoadSingle(":LevelPlayingTime", 0.0f));
00963
00964             m_ammoCount = m_savedState->LoadInt32(":AmmoCount", 0);
00965
00966             m_ammoNext = m_savedState->LoadInt32(":AmmoNext", 0);
00967
00968             const int bufferLength = 16;
00969             char16 str[bufferLength];
00970
00971             for (uint32 i = 0; i < m_ammoCount; i++)
00972             {
00973                 int len = swprintf_s(str, bufferLength, L"%d", i);
00974                 Platform::String^ string = ref new Platform::String(str, len);
00975
00976                 m_ammo[i]->Active(
00977                     m_savedState->LoadBool(
00978                         Platform::String::Concat(":AmmoActive", string),
00979                         m_ammo[i]->Active()
00980                         )
00981                     );
00982                 if (m_ammo[i]->Active())
00983                 {
00984                     m_ammo[i]->OnGround(false);
00985                 }
00986
00987                 m_ammo[i]->Position(
00988                     m_savedState->LoadXMFLOAT3(
00989                         Platform::String::Concat(":AmmoPosition", string),
00990                         m_ammo[i]->Position()
00991                         )
00992                     );
00993
00994                 m_ammo[i]->Velocity(
00995                     m_savedState->LoadXMFLOAT3(
00996                         Platform::String::Concat(":AmmoVelocity", string),
00997                         m_ammo[i]->Velocity()
00998                         )
00999                     );
01000             }
01001
01002             int storedObjectCount = 0;
01003             storedObjectCount = m_savedState->LoadInt32(":ObjectCount", 0);
01004
01005             storedObjectCount = min(storedObjectCount, static_cast<int>(m_objects.size()));
01006
01007             for (int i = 0; i < storedObjectCount; i++)
01008             {
01009                 int len = swprintf_s(str, bufferLength, L"%d", i);
01010                 Platform::String^ string = ref new Platform::String(str, len);
01011
01012                 m_objects[i]->Active(
01013                     m_savedState->LoadBool(
01014                         Platform::String::Concat(":ObjectActive", string),
01015                         m_objects[i]->Active()
01016                         )
01017                     );
01018
01019                 m_objects[i]->Target(
01020                     m_savedState->LoadBool(
01021                         Platform::String::Concat(":ObjectTarget", string),
01022                         m_objects[i]->Target()
01023                         )
01024                     );
01025
01026                 m_objects[i]->Position(
01027                     m_savedState->LoadXMFLOAT3(
01028                         Platform::String::Concat(":ObjectPosition", string),
01029                         m_objects[i]->Position()
01030                         )
01031                     );
01032             }
01033
01034             m_level[m_currentLevel]->LoadState(m_savedState);
01035             m_levelTimeRemaining = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime - m_timer->PlayingTime();
01036         }
01037     }
01038 }
01039
01040 //----------------------------------------------------------------------
01041
01042 void Simple3DGame::SaveHighScore()
01043 {
01044     m_savedState->SaveInt32(":HighScore:LevelCompleted", m_topScore.levelCompleted);
01045     m_savedState->SaveInt32(":HighScore:TotalShots", m_topScore.totalShots);
01046     m_savedState->SaveInt32(":HighScore:TotalHits", m_topScore.totalHits);
01047 }
01048
01049 //----------------------------------------------------------------------
01050
01051 void Simple3DGame::LoadHighScore()
01052 {
01053     m_topScore.levelCompleted = m_savedState->LoadInt32(":HighScore:LevelCompleted", 0);
01054     m_topScore.totalShots = m_savedState->LoadInt32(":HighScore:TotalShots", 0);
01055     m_topScore.totalHits = m_savedState->LoadInt32(":HighScore:TotalHits", 0);
01056 }
01057
01058 //----------------------------------------------------------------------
01059
01060 void Simple3DGame::InitializeAmmo()
01061 {
01062     m_ammoCount = 0;
01063     m_ammoNext = 0;
01064     for (uint32 i = 0; i < GameConstants::MaxAmmo; i++)
01065     {
01066         m_ammo[i]->Active(false);
01067     }
01068 }
01069
01070 //----------------------------------------------------------------------
01071
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/WorldMesh.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

WorldMesh.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "WorldMesh.h"
00014 #include "ConstantBuffers.h"
00015
00016 using namespace DirectX;
00017
00018 WorldCeilingMesh::WorldCeilingMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device)
00019 {
00020     static constexpr PNTVertex cellVertices[] =
00021     {
00022         // CEILING
00023         {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(-0.15f, 0.0f)},
00024         {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(1.25f, 0.0f)},
00025         {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(-0.15f, 2.1f)},
00026         {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, -1.0f, 0.0f), XMFLOAT2(1.25f, 2.1f)},
00027     };
00028
00029     static constexpr WORD cellIndices[] = {
00030         0, 1, 2,
00031         1, 3, 2,
00032     };
00033
00034     m_vertexCount = 4;
00035     m_indexCount = 6;
00036
00037     D3D11_BUFFER_DESC bd = { 0 };
00038     D3D11_SUBRESOURCE_DATA initData = { 0 };
00039
00040     bd.Usage = D3D11_USAGE_DEFAULT;
00041     bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
00042     bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
00043     bd.CPUAccessFlags = 0;
00044     initData.pSysMem = cellVertices;
00045     winrt::check_hresult(
00046         device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
00047         );
00048
00049     bd.Usage = D3D11_USAGE_DEFAULT;
00050     bd.ByteWidth = sizeof(WORD) * m_indexCount;
00051     bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
00052     bd.CPUAccessFlags = 0;
00053     initData.pSysMem = cellIndices;
00054     winrt::check_hresult(
00055         device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
00056         );
00057 }
00058
00059 WorldFloorMesh::WorldFloorMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device)
00060 {
00061     static constexpr PNTVertex cellVertices[] =
00062     {
00063         // FLOOR
00064         {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
00065         {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(1.0f, 0.0f)},
00066         {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
00067         {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 1.0f, 0.0f), XMFLOAT2(1.0f, 1.5f)},
00068     };
00069
00070     static constexpr WORD cellIndices[] = {
00071         0, 1, 2,
00072         1, 3, 2,
00073     };
00074
00075     m_vertexCount = 4;
00076     m_indexCount = 6;
00077
00078     D3D11_BUFFER_DESC bd = { 0 };
00079     D3D11_SUBRESOURCE_DATA initData = { 0 };
00080
00081     bd.Usage = D3D11_USAGE_DEFAULT;
00082     bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
00083     bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
00084     bd.CPUAccessFlags = 0;
00085     initData.pSysMem = cellVertices;
00086     winrt::check_hresult(
00087         device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
00088         );
00089
00090     bd.Usage = D3D11_USAGE_DEFAULT;
00091     bd.ByteWidth = sizeof(WORD) * m_indexCount;
00092     bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
00093     bd.CPUAccessFlags = 0;
00094     initData.pSysMem = cellIndices;
00095     winrt::check_hresult(
00096         device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
00097         );
00098 }
00099
00100 WorldWallsMesh::WorldWallsMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device)
00101 {
00102     static constexpr PNTVertex cellVertices[] =
00103     {
00104         // WALL
00105         {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(0.0f, 0.0f)},
00106         {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(2.0f, 0.0f)},
00107         {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(0.0f, 1.5f)},
00108         {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(0.0f, 0.0f, -1.0f), XMFLOAT2(2.0f, 1.5f)},
00109         // WALL
00110         {XMFLOAT3(4.0f,  3.0f,  6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
00111         {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 0.0f)},
00112         {XMFLOAT3(4.0f, -3.0f,  6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
00113         {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(-1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 1.5f)},
00114         // WALL
00115         {XMFLOAT3(4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 0.0f)},
00116         {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(2.0f, 0.0f)},
00117         {XMFLOAT3(4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(0.0f, 1.5f)},
00118         {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(0.0f, 0.0f, 1.0f), XMFLOAT2(2.0f, 1.5f)},
00119         // WALL
00120         {XMFLOAT3(-4.0f,  3.0f, -6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 0.0f)},
00121         {XMFLOAT3(-4.0f,  3.0f,  6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 0.0f)},
00122         {XMFLOAT3(-4.0f, -3.0f, -6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(0.0f, 1.5f)},
00123         {XMFLOAT3(-4.0f, -3.0f,  6.0f), XMFLOAT3(1.0f, 0.0f, 0.0f), XMFLOAT2(3.0f, 1.5f)},
00124     };
00125
00126     static constexpr WORD cellIndices[] = {
00127          0,  1,  2,
00128          1,  3,  2,
00129          4,  5,  6,
00130          5,  7,  6,
00131          8,  9, 10,
00132          9, 11, 10,
00133         12, 13, 14,
00134         13, 15, 14,
00135     };
00136
00137     m_vertexCount = 16;
00138     m_indexCount = 24;
00139
00140     D3D11_BUFFER_DESC bd = { 0 };
00141     D3D11_SUBRESOURCE_DATA initData = { 0 };
00142
00143     bd.Usage = D3D11_USAGE_DEFAULT;
00144     bd.ByteWidth = sizeof(PNTVertex) * m_vertexCount;
00145     bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
00146     bd.CPUAccessFlags = 0;
00147     initData.pSysMem = cellVertices;
00148     winrt::check_hresult(
00149         device->CreateBuffer(&bd, &initData, m_vertexBuffer.put())
00150         );
00151
00152     bd.Usage = D3D11_USAGE_DEFAULT;
00153     bd.ByteWidth = sizeof(WORD) * m_indexCount;
00154     bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
00155     bd.CPUAccessFlags = 0;
00156     initData.pSysMem = cellIndices;
00157     winrt::check_hresult(
00158         device->CreateBuffer(&bd, &initData, m_indexBuffer.put())
00159         );
00160 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.h Source File

  • WebAccountManagement
  • cpp

Scenario1_DefaultAccount.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario1_DefaultAccount.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     // Important Note for running this sample:
00011     // The sample as-is will not be able to get tokens without having it's app manifest being
00012     // modified to use the App Identity of a registered Microsoft Store/registered AAD app.
00013     //
00014     // See 'Related Topics' in the README.md for instructions on how to register an app.
00015
00016     /// <summary>
00017     /// The first scenario. Covers getting the default sign in account.
00018     /// </summary>
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_DefaultAccount sealed
00021     {
00022     public:
00023         Scenario1_DefaultAccount();
00024     protected:
00025         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override;
00026     private:
00027         MainPage^ rootPage;
00028         void Button_DefaultSignIn_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00029         void Button_GetTokenSilently_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00030         void Button_Reset_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00031         void GetDefaultProvidersAndAccounts();
00032         void AuthenticateWithRequestToken(Windows::Security::Credentials::WebAccountProvider ^ Provider, Platform::String^ Scope, Platform::String^ ClientID);
00033         void AuthenticateWithRequestTokenSilent(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID, Windows::Security::Credentials::WebAccount^ account);
00034         void OutputTokenResult(Windows::Security::Authentication::Web::Core::WebTokenRequestResult ^ result);
00035         void SaveAccount(Windows::Security::Credentials::WebAccount ^ account);
00036         void LogoffAndRemoveAccount();
00037
00038         Platform::String^ DEFAULT_ACCOUNT_PROVIDER_ID = "https://login.windows.local";
00039         Platform::String^ CONSUMER_AUTHORITY = "consumers";
00040         Platform::String^ ORGANIZATION_AUTHORITY = "organizations";
00041         Platform::String^ MSA_SCOPE_REQUESTED = "service::wl.basic::DELEGATION";
00042         Platform::String^ MSA_CLIENT_ID = "none";
00043         Platform::String^ AAD_SCOPE_REQUESTED = "";
00044         Platform::String^ AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb";
00045         Platform::String^ STORED_ACCOUNT_ID_KEY = "accountid";
00046         Platform::String^ STORED_ACCOUNT_AUTHORITY = "accountauthority";
00047         Windows::Security::Credentials::WebAccountProvider^ m_provider;
00048         Windows::Security::Credentials::WebAccount^ m_account;
00049         Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken;
00050     };
00051 }
Generated on Fri Nov 15 2024 22:21:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SoundEffect.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

SoundEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // SoundEffect:
00015 // This class plays a sound using XAudio2. It uses a mastering voice provided
00016 // from the Audio class. The sound data can be read from disk using the MediaReader
00017 // class.
00018
00019 class SoundEffect
00020 {
00021 public:
00022     SoundEffect();
00023
00024     void Initialize(
00025         _In_ IXAudio2* masteringEngine,
00026         _In_ WAVEFORMATEX* sourceFormat,
00027         _In_ std::vector<byte> const& soundData
00028         );
00029
00030     void PlaySound(_In_ float volume);
00031
00032 private:
00033     bool                    m_audioAvailable;
00034     IXAudio2SourceVoice* m_sourceVoice;
00035     std::vector<byte> m_soundData;
00036 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario2_DisplayingInBandClosedCaptions.xaml.cs Source File

  • VideoPlayback
  • cs

Scenario2_DisplayingInBandClosedCaptions.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Logging;
00013 using System;
00014 using Windows.Foundation.Collections;
00015 using Windows.Media.Core;
00016 using Windows.Media.Playback;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// Demonstrates closed captions delivered in-band, specifically SRT in an MKV.
00024     /// </summary>
00025     public sealed partial class Scenario2 : Page
00026     {
00027         private MainPage rootPage = MainPage.Current;
00028         private MediaPlaybackItemLogger mpiLogger;
00029         private MediaSourceLogger msLogger;
00030
00031         public Scenario2()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedTo(NavigationEventArgs e)
00037         {
00038             // Create the playback item
00039             var source = MediaSource.CreateFromUri(rootPage.CaptionedMediaUri);
00040             msLogger = new MediaSourceLogger(LoggerControl, source);
00041             var playbackItem = new MediaPlaybackItem(source);
00042             mpiLogger = new MediaPlaybackItemLogger(LoggerControl, playbackItem);
00043
00044             // Turn on English captions by default
00045             playbackItem.TimedMetadataTracksChanged += (item, args) =>
00046             {
00047                 if (args.CollectionChange == CollectionChange.ItemInserted)
00048                 {
00049                     LoggerControl.Log($"TimedMetadataTracksChanged, Number of tracks: {item.TimedMetadataTracks.Count}");
00050
00051                     uint changedTrackIndex = args.Index;
00052                     TimedMetadataTrack changedTrack = playbackItem.TimedMetadataTracks[(int)changedTrackIndex];
00053
00054                     if (changedTrack.Language == "en")
00055                     {
00056                         playbackItem.TimedMetadataTracks.SetPresentationMode(changedTrackIndex, TimedMetadataTrackPresentationMode.PlatformPresented);
00057                     }
00058                 }
00059             };
00060
00061             // Set the source to begin playback of the item
00062             this.mediaPlayerElement.Source = playbackItem;
00063             LoggerControl.Log($"Loaded: {rootPage.CaptionedMediaUri}");
00064         }
00065
00066         protected override void OnNavigatedFrom(NavigationEventArgs e)
00067         {
00068             msLogger?.Dispose();
00069             msLogger = null;
00070             mpiLogger?.Dispose();
00071             mpiLogger = null;
00072             MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WriteReadStream Member List

This is the complete list of members for WriteReadStream, including all inherited members.
inputElements | WriteReadStream | [private]
OnNavigatedTo(NavigationEventArgs e) | WriteReadStream | [inline, protected]
rootPage | WriteReadStream | [private]
TransferData(object sender, RoutedEventArgs e) | WriteReadStream | [inline, private]
WriteReadStream() | WriteReadStream | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario4_ChangeAdminKey.xaml.cpp Source File

  • SmartCard
  • cpp

Scenario4_ChangeAdminKey.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario4_ChangeAdminKey.xaml.h"
00005 #include "ChallengeResponseAlgorithm.h"
00006
00007 using namespace SDKTemplate;
00008
00009 using namespace concurrency;
00010 using namespace Platform;
00011 using namespace Windows::Devices::SmartCards;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::Storage::Streams;
00015 using namespace Windows::Security::Cryptography;
00016 using namespace Windows::Security::Cryptography::Core;
00017 using namespace Windows::UI::Xaml;
00018 using namespace Windows::UI::Xaml::Controls;
00019 using namespace Windows::UI::Xaml::Controls::Primitives;
00020 using namespace Windows::UI::Xaml::Data;
00021 using namespace Windows::UI::Xaml::Input;
00022 using namespace Windows::UI::Xaml::Media;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 Scenario4_ChangeAdminKey::Scenario4_ChangeAdminKey()
00026 {
00027     InitializeComponent();
00028 }
00029
00030 void Scenario4_ChangeAdminKey::ChangeAdminKey_Click(Platform::Object^ sender,
00031     Windows::UI::Xaml::RoutedEventArgs^ e)
00032 {
00033     if (MainPage::Current->SmartCardReaderDeviceId == nullptr)
00034     {
00035         MainPage::Current->NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType::ErrorMessage);
00036         return;
00037     }
00038
00039     Button^ b = dynamic_cast<Button^>(sender);
00040     b->IsEnabled = false;
00041
00042     IBuffer^ newadminkey = CryptographicBuffer::GenerateRandom(ADMIN_KEY_LENGTH_IN_BYTES);
00043
00044     MainPage::Current->NotifyUser("Changing smart card admin key...", NotifyType::StatusMessage);
00045
00046     create_task(MainPage::Current->GetSmartCard()).then(
00047         [=](task<Windows::Devices::SmartCards::SmartCard^> getSmartCardTask)
00048     {
00049         Windows::Devices::SmartCards::SmartCard^ card = getSmartCardTask.get();
00050         return SmartCardProvisioning::FromSmartCardAsync(card);
00051     }).then(
00052         [=](task<SmartCardProvisioning^> getProvisioningTask)
00053     {
00054         SmartCardProvisioning^ provisioning = getProvisioningTask.get();
00055         return provisioning->GetChallengeContextAsync();
00056     }).then(
00057         [=](task<SmartCardChallengeContext^> getChallengeContextTask)
00058     {
00059         SmartCardChallengeContext^ context = getChallengeContextTask.get();
00060         IBuffer^ response = ChallengeResponseAlgorithm::CalculateResponse(context->Challenge, MainPage::Current->AdminKey);
00061
00062         return context->ChangeAdministrativeKeyAsync(response, newadminkey);
00063     }).then(
00064         [=](task<void> changeAdminKeyTask)
00065     {
00066         try
00067         {
00068             changeAdminKeyTask.get();
00069             MainPage::Current->AdminKey = newadminkey;
00070             MainPage::Current->NotifyUser("Smart card change admin key operation completed.", NotifyType::StatusMessage);
00071         }
00072         catch (COMException ^ex)
00073         {
00074             MainPage::Current->NotifyUser("Changing smart card admin key failed with exception." + ex->ToString(), NotifyType::ErrorMessage);
00075         }
00076
00077         b->IsEnabled = true;
00078     });
00079
00080 }
Generated on Fri Nov 15 2024 22:21:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Polling Member List

This is the complete list of members for Scenario3_Polling, including all inherited members.
_accelerometer | Scenario3_Polling | [private]
_desiredReportInterval | Scenario3_Polling | [private]
_dispatcherTimer | Scenario3_Polling | [private]
DisplayCurrentReading(object sender, object args) | Scenario3_Polling | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_Polling | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario3_Polling | [inline, protected]
rootPage | Scenario3_Polling | [private]
Scenario3_Polling() | Scenario3_Polling | [inline]
ScenarioDisable() | Scenario3_Polling | [inline, private]
ScenarioEnable() | Scenario3_Polling | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario3_Polling | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/RequiredDeviceProperties.cs Source File

  • AdvancedCasting
  • cs
  • Util

RequiredDeviceProperties.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 namespace ScreenCasting.Util
00019 {
00020     public class RequiredDeviceProperties
00021     {
00022         public static readonly string DEVPKEY_AepContainer_FriendlyName = "{0bba1ede-7566-4f47-90ec-25fc567ced2a}, 5";
00023         public static readonly string DEVPKEY_AepContainer_SupportsAudio = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 2";
00024         public static readonly string DEVPKEY_AepContainer_SupportsVideo = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 3";
00025         public static readonly string DEVPKEY_AepContainer_SupportsImages = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 4";
00026         public static readonly string DEVPKEY_AepContainer_SupportedUriSchemes = "{6af55d45-38db-4495-acb0-d4728a3b8314}, 5";
00027         public static readonly string DEVPKEY_AepContainer_Categories = "System.Devices.AepContainer.Categories";
00028         public static readonly string DEVPKEY_DeviceContainer_Manufacturer = "System.Devices.Manufacturer";
00029         public static readonly string DEVPKEY_DeviceContainer_ModelName = "System.Devices.ModelName";
00030         public static readonly string DEVPKEY_Device_ContainerId = "System.Devices.ContainerId";
00031         public static readonly string DEVPKEY_Device_InstanceId = "System.Devices.DeviceInstanceId";
00032
00033         private RequiredDeviceProperties() { }
00034
00035         public static void AddProps(IList<string> list)
00036         {
00037             foreach (string s in Props)
00038                 list.Add(s);
00039         }
00040         public static List<string> Props
00041         {
00042             get
00043             {
00044                 List<string> properties = new List<string>();
00045                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_FriendlyName);
00046                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_SupportsAudio);
00047                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_SupportsVideo);
00048                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_SupportsImages);
00049                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_SupportedUriSchemes);
00050                 properties.Add(RequiredDeviceProperties.DEVPKEY_AepContainer_Categories);
00051                 properties.Add(RequiredDeviceProperties.DEVPKEY_DeviceContainer_Manufacturer);
00052                 properties.Add(RequiredDeviceProperties.DEVPKEY_DeviceContainer_ModelName);
00053                 properties.Add(RequiredDeviceProperties.DEVPKEY_Device_ContainerId);
00054                 properties.Add(RequiredDeviceProperties.DEVPKEY_Device_InstanceId);
00055
00056                 return properties;
00057             }
00058         }
00059     }
00060 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IncrementDecrement Member List

This is the complete list of members for IncrementDecrement, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
DataObjectType enum name | IncrementDecrement |
GetBuffer() | ApduCommand | [inline]
IncrementDecrement(byte[] dataObjects) | IncrementDecrement | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.h Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario4_CustomExceptionWRL.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario4_CustomExceptionWRL.g.h"
00009
00010 namespace SDKSample
00011 {
00012     namespace ProxyStubsForWinRTComponents
00013     {
00014         public ref class CustomExceptionWRL sealed
00015         {
00016         public:
00017             CustomExceptionWRL();
00018
00019         private:
00020             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021         };
00022     }
00023 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario14_MeteredConnectionFilter Member List

This is the complete list of members for Scenario14_MeteredConnectionFilter, including all inherited members.
Cancel_Click(object sender, RoutedEventArgs e) | Scenario14_MeteredConnectionFilter | [inline, private]
cts | Scenario14_MeteredConnectionFilter | [private]
httpClient | Scenario14_MeteredConnectionFilter | [private]
meteredConnectionFilter | Scenario14_MeteredConnectionFilter | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario14_MeteredConnectionFilter | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario14_MeteredConnectionFilter | [inline, protected]
OptInSwitch_Toggled(object sender, RoutedEventArgs e) | Scenario14_MeteredConnectionFilter | [inline, private]
rootPage | Scenario14_MeteredConnectionFilter | [private]
Scenario14_MeteredConnectionFilter() | Scenario14_MeteredConnectionFilter | [inline]
Start_Click(object sender, RoutedEventArgs e) | Scenario14_MeteredConnectionFilter | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Toggle Member List

This is the complete list of members for Scenario1_Toggle, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Toggle | [inline, protected]
rootPage | Scenario1_Toggle | [private]
Scenario1_Toggle() | Scenario1_Toggle | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/PhotoAdjustmentProperties.h Source File

  • D2DPhotoAdjustment
  • cpp

PhotoAdjustmentProperties.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace D2DPhotoAdjustment
00015 {
00016     // Stores photo adjustment property values that are set on
00017     // the Direct2D effect pipeline.
00018     struct PhotoAdjustmentProperties
00019     {
00020     public:
00021         double StraightenValue;
00022         double TemperatureValue;
00023         double TintValue;
00024         double SaturationValue;
00025         double ContrastValue;
00026         double ShadowsValue;
00027         double ClarityValue;
00028         double HighlightsValue;
00029         double HsMaskRadiusValue;
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ContentSelector Member List

This is the complete list of members for ContentSelector, including all inherited members.
adaptiveContentModels | ContentSelector | [private]
AutoPlay_Checked(object sender, RoutedEventArgs e) | ContentSelector | [inline, private]
ContentSelector() | ContentSelector | [inline]
CreateMediaPlaybackItem | ContentSelector | [private]
CreateNewMediaPlaybackItem(Uri uri) | ContentSelector | [inline, private]
ForceEquirectangularSphericalVideoFrameFormat() | ContentSelector | [inline, private]
HideLoadUri() | ContentSelector | [inline]
Initialize(MediaPlayer mediaPlayer, IEnumerable< AdaptiveContentModel > adaptiveContentModels, HttpClient optionalHttpClient, LogView loggerControl, Func< Uri, HttpClient, Task< MediaPlaybackItem >> loadSourceFromUriAsync) | ContentSelector | [inline, private]
LoadId_Click(object sender, RoutedEventArgs e) | ContentSelector | [inline, private]
LoadUri_Click(object sender, RoutedEventArgs e) | ContentSelector | [inline, private]
loggerControl | ContentSelector | [private]
MediaPlaybackItem | ContentSelector |
mediaPlayer | ContentSelector | [private]
optionalHttpClient | ContentSelector |
SelectedModel | ContentSelector |
SetAutoPlay(bool IsChecked) | ContentSelector | [inline]
SetSelectedModel(AdaptiveContentModel model) | ContentSelector | [inline]
SetSource_Click(object sender, RoutedEventArgs e) | ContentSelector | [inline, private]
SetSourceEnabled(bool SetEnabled) | ContentSelector | [inline, private]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
AppView(Windows::Foundation::Uri^sourceUri) | sealed |
AppViewSource(Windows::Foundation::Uri^sourceUri) | sealed |
CreateView() | sealed | [virtual]
GalleryGridView_ItemClick(Platform::Object^sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^e) | sealed | [private]
GetMainViewId() | sealed | [inline, static]
GetMediaPlayer() | sealed | [static]
Initialize(Windows::ApplicationModel::Core::CoreApplicationView^applicationView) | sealed | [virtual]
IsMediaAlreadyOpened() | sealed | [private]
Load(Platform::String^entryPoint) | sealed | [virtual]
m_activeGamePad | sealed | [private]
m_appViewConsolidated | sealed | [private]
m_centerX | sealed | [private]
m_centerY | sealed | [private]
m_deviceResources | sealed | [private]
m_heading | sealed | [private]
m_holographicSpace | sealed | [private]
m_inputLoopWorker | sealed | [private]
m_isPointerPress | sealed | [private]
m_main | sealed | [private]
m_mainWindowReactivated | sealed | [private]
m_mediaPlayer | sealed | [private, static]
m_mtcGrid | sealed | [private]
m_pitch | sealed | [private]
m_player | sealed | [private]
m_rotationdelta | sealed | [private]
m_ShadersCreated | sealed | [private]
m_ShadersNeed | sealed | [private]
m_sourceUri | sealed | [private]
m_timer | sealed | [private]
m_windowClosed | sealed | [private]
m_windowVisible | sealed | [private]
MainPage() | sealed |
mainviewId | sealed | [private, static]
OnBackRequested(Platform::Object^sender, Windows::UI::Core::BackRequestedEventArgs^args) | sealed | [private]
OnConsolidated(Windows::UI::ViewManagement::ApplicationView^sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^args) | sealed | [private]
OnKeyDown(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args) | sealed | [private]
OnKeyDownToken | sealed | [private]
OnKeyPressed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args) | sealed | [protected]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnLayoutUpdated(Platform::Object^sender, Platform::Object^args) | sealed | [private]
OnLayoutUpdatedToken | sealed | [private]
OnLoaded(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
OnMainViewActivated(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowActivatedEventArgs^args) | sealed | [protected]
OnMediaOpened(Windows::Media::Playback::MediaPlayer^sender, Platform::Object^args) | sealed | [private]
OnMediaOpened(Windows::Media::Playback::MediaPlayer^sender, Platform::Object^args) | sealed | [private]
OnMediaOpenedToken | sealed | [private]
OnMTCPointerMovedToken | sealed | [private]
OnMTCPointerPressedToken | sealed | [private]
OnMTCPointerReleasedToken | sealed | [private]
OnMTCPointerWheelChangedToken | sealed | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnPlaybackStateChanged(Windows::Media::Playback::MediaPlaybackSession^sender, Platform::Object^args) | sealed | [private]
OnPlaybackStateChangedToken | sealed | [private]
OnPointerMoved(Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed | [private]
OnPointerMovedToken | sealed | [private]
OnPointerPressed(Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed | [private]
OnPointerPressedToken | sealed | [private]
OnPointerReleased(Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed | [private]
OnPointerReleasedToken | sealed | [private]
OnPointerWheelChanged(Platform::Object^sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed | [private]
OnPointerWheelChangedToken | sealed | [private]
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [protected]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [protected]
OnViewActivated(Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args) | sealed | [protected]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [protected]
OnWindowClosed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args) | sealed | [protected]
PlaybackPage() | sealed |
ResetState() | sealed | [private]
Run() | sealed | [virtual]
SetWindow(Windows::UI::Core::CoreWindow^window) | sealed | [virtual]
StartInputLoop() | sealed | [private]
TryCloseWindow() | sealed | [private]
Uninitialize() | sealed | [virtual]
VideoGallery() | sealed |
VideoItem(Platform::String^title, Windows::Foundation::Uri^sourceUri) | sealed | [inline]
videoProjection | sealed | [private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/App.xaml.custom.cs Source File

  • FilePickerContracts
  • cs

App.xaml.custom.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// Provides application-specific behavior to supplement the default Application class.
00023     /// </summary>
00024     sealed partial class App : Application
00025     {
00026         protected override void OnFileOpenPickerActivated(FileOpenPickerActivatedEventArgs args)
00027         {
00028             var FileOpenPickerPage = new SDKTemplate.FileOpenPickerPage();
00029             FileOpenPickerPage.Activate(args);
00030         }
00031
00032         protected override void OnFileSavePickerActivated(FileSavePickerActivatedEventArgs args)
00033         {
00034             var FileSavePickerPage = new SDKTemplate.FileSavePickerPage();
00035             FileSavePickerPage.Activate(args);
00036         }
00037
00038         protected override void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
00039         {
00040             var CachedFileUpdaterPage = new SDKTemplate.CachedFileUpdaterPage();
00041             CachedFileUpdaterPage.Activate(args);
00042         }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Download Member List

This is the complete list of members for Scenario1_Download, including all inherited members.
activeDownloads | Scenario1_Download | [private]
CancelAll_Click(object sender, RoutedEventArgs e) | Scenario1_Download | [inline, private]
cts | Scenario1_Download | [private]
DiscoverActiveDownloadsAsync() | Scenario1_Download | [inline, private]
Dispose() | Scenario1_Download | [inline]
DownloadProgress(DownloadOperation download) | Scenario1_Download | [inline, private]
HandleDownloadAsync(DownloadOperation download, bool start) | Scenario1_Download | [inline, private]
IsExceptionHandled(string title, Exception ex, DownloadOperation download=null) | Scenario1_Download | [inline, private]
Log(string message) | Scenario1_Download | [inline, private]
LogStatus(string message, NotifyType type) | Scenario1_Download | [inline, private]
MarshalLog(string value) | Scenario1_Download | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Download | [inline, protected]
PauseAll_Click(object sender, RoutedEventArgs e) | Scenario1_Download | [inline, private]
ResumeAll_Click(object sender, RoutedEventArgs e) | Scenario1_Download | [inline, private]
rootPage | Scenario1_Download | [private]
Scenario1_Download() | Scenario1_Download | [inline]
StartDownload(BackgroundTransferPriority priority) | Scenario1_Download | [inline, private]
StartDownload_Click(object sender, RoutedEventArgs e) | Scenario1_Download | [inline, private]
StartHighPriorityDownload_Click(object sender, RoutedEventArgs e) | Scenario1_Download | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Employee Member List

This is the complete list of members for Employee, including all inherited members.
_FirstName | Employee | [private]
_LastName | Employee | [private]
_Manager | Employee | [private]
DirectManager | Employee |
Employee() | Employee | [inline, private]
Employee() | Employee | [inline, private]
FirstName | Employee |
FullName() | Employee | [inline]
FullName() | Employee | [inline]
IsManager | Employee |
LastName | Employee |
Name | Employee |
NullImageSource | Employee |
NullStringProperty | Employee |
Poke(object sender, RoutedEventArgs e) | Employee | [inline]
Poke(object sender, RoutedEventArgs e) | Employee | [inline]
Title | Employee |
Visibility | Employee |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Fx2Driver.cs Source File

  • CustomCapability
  • cs

Fx2Driver.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Custom;
00014
00015 namespace SDKTemplate
00016 {
00017     static class Fx2Driver
00018     {
00019         public const ushort DeviceType = 65500;
00020         public const ushort FunctionBase = 0x800;
00021
00022         public static
00023         IOControlCode GetSevenSegmentDisplay = new IOControlCode(DeviceType,
00024                                                                  FunctionBase + 7,
00025                                                                  IOControlAccessMode.Read,
00026                                                                  IOControlBufferingMethod.Buffered);
00027
00028         public static
00029         IOControlCode SetSevenSegmentDisplay = new IOControlCode(DeviceType,
00030                                                                  FunctionBase + 8,
00031                                                                  IOControlAccessMode.Write,
00032                                                                  IOControlBufferingMethod.Buffered);
00033
00034         public static
00035         IOControlCode ReadSwitches = new IOControlCode(DeviceType,
00036                                                        FunctionBase + 6,
00037                                                        IOControlAccessMode.Read,
00038                                                        IOControlBufferingMethod.Buffered);
00039
00040         public static
00041         IOControlCode GetInterruptMessage = new IOControlCode(DeviceType,
00042                                                               FunctionBase + 9,
00043                                                               IOControlAccessMode.Read,
00044                                                               IOControlBufferingMethod.DirectOutput);
00045
00046         static readonly byte[] SevenSegmentValues = {
00047                                             0xD7, // 0
00048                                             0x06, // 1
00049                                             0xB3, // 2
00050                                             0xA7, // 3
00051                                             0x66, // 4
00052                                             0xE5, // 5
00053                                             0xF4, // 6
00054                                             0x07, // 7
00055                                             0xF7, // 8
00056                                             0x67, // 9
00057                                           };
00058
00059         public static
00060         byte DigitToSevenSegment(byte value)
00061         {
00062             return SevenSegmentValues[value];
00063         }
00064
00065         public static
00066         byte SevenSegmentToDigit(byte value)
00067         {
00068             for (byte i = 0; i < SevenSegmentValues.Length; i += 1)
00069             {
00070                 if (SevenSegmentValues[i] == value)
00071                 {
00072                     return i;
00073                 }
00074             }
00075             return 0xff;
00076         }
00077
00078         public static readonly Guid DeviceInterfaceGuid = new Guid("573E8C73-0CB4-4471-A1BF-FAB26C31D384");
00079     }
00080 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ProjectionViewPage Member List

This is the complete list of members for ProjectionViewPage, including all inherited members.
broker | ProjectionViewPage | [private]
OnNavigatedTo(NavigationEventArgs e) | ProjectionViewPage | [inline, protected]
Player | ProjectionViewPage |
Player_MediaOpened(object sender, RoutedEventArgs e) | ProjectionViewPage | [inline, private]
ProjectionViewPage() | ProjectionViewPage | [inline]
ProjectionViewPage_StopProjectingButtonClick(object sender, EventArgs e) | ProjectionViewPage | [inline, private]
SetMediaSource(Uri source, TimeSpan position) | ProjectionViewPage | [inline]
StopProjecting() | ProjectionViewPage | [inline]
StopProjecting_Click(object sender, RoutedEventArgs e) | ProjectionViewPage | [inline, private]
SwapViews() | ProjectionViewPage | [inline]
SwapViews_Click(object sender, RoutedEventArgs e) | ProjectionViewPage | [inline, private]
thisViewControl_Released(object sender, EventArgs e) | ProjectionViewPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpatialInputHandler.cpp Source File

  • BasicHologram
  • cppwinrt
  • Content

SpatialInputHandler.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SpatialInputHandler.h"
00003 #include <functional>
00004
00005 using namespace BasicHologram;
00006
00007 using namespace std::placeholders;
00008 using namespace winrt::Windows::Foundation;
00009 using namespace winrt::Windows::UI::Input::Spatial;
00010
00011 // Creates and initializes a GestureRecognizer that listens to a Person.
00012 SpatialInputHandler::SpatialInputHandler()
00013 {
00014     // The interaction manager provides an event that informs the app when
00015     // spatial interactions are detected.
00016     m_interactionManager = SpatialInteractionManager::GetForCurrentView();
00017
00018     // Bind a handler to the SourcePressed event.
00019     m_sourcePressedEventToken = m_interactionManager.SourcePressed(bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2));
00020
00021     //
00022     // TODO: Expand this class to use other gesture-based input events as applicable to
00023     //       your app.
00024     //
00025 }
00026
00027 SpatialInputHandler::~SpatialInputHandler()
00028 {
00029     // Unregister our handler for the OnSourcePressed event.
00030     m_interactionManager.SourcePressed(m_sourcePressedEventToken);
00031 }
00032
00033 // Checks if the user performed an input gesture since the last call to this method.
00034 // Allows the main update loop to check for asynchronous changes to the user
00035 // input state.
00036 SpatialInteractionSourceState SpatialInputHandler::CheckForInput()
00037 {
00038     SpatialInteractionSourceState sourceState = m_sourceState;
00039     m_sourceState = nullptr;
00040     return sourceState;
00041 }
00042
00043 void SpatialInputHandler::OnSourcePressed(SpatialInteractionManager const& sender, SpatialInteractionSourceEventArgs const& args)
00044 {
00045     m_sourceState = args.State();
00046
00047     //
00048     // TODO: In your app or game engine, rewrite this method to queue
00049     //       input events in your input class or event handler.
00050     //
00051 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario4_Remove.xaml.cpp Source File

  • Playlists
  • cpp

Scenario4_Remove.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario4_Remove.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::Media::Playlists;
00013 using namespace Windows::Storage;
00014 using namespace Windows::Storage::Pickers;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 Scenario4_Remove::Scenario4_Remove() : rootPage(MainPage::Current)
00024 {
00025     InitializeComponent();
00026 }
00027
00028 void Scenario4_Remove::PickPlaylistButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00029 {
00030     // Pick a file, load it as a playlist, then remove the last item in the playlist.
00031     this->rootPage->PickPlaylistAsync().then([this](Playlist^ playlist)
00032     {
00033         if (playlist != nullptr)
00034         {
00035             if (playlist->Files->Size > 0)
00036             {
00037                 // Remove the last item.
00038                 playlist->Files->RemoveAtEnd();
00039
00040                 this->rootPage->TrySavePlaylistAsync(playlist).then([this](bool result)
00041                 {
00042                     if (result)
00043                     {
00044                         this->rootPage->NotifyUser("The last item in the playlist was removed.", NotifyType::StatusMessage);
00045                     }
00046                 });
00047             }
00048             else
00049             {
00050                 this->rootPage->NotifyUser("No items in playlist.", NotifyType::ErrorMessage);
00051             }
00052         }
00053     });
00054 }
Generated on Fri Nov 15 2024 22:20:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Content

CameraStreamProcessor.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CameraStreamProcessor.h"
00014
00015 using namespace CameraStreamCoordinateMapper;
00016 using namespace Windows::Foundation;
00017 using namespace Windows::Foundation::Collections;
00018 using namespace Windows::Foundation::Numerics;
00019
00020 using namespace Windows::Media::Capture;
00021 using namespace Windows::Media::Capture::Frames;
00022
00023 using namespace concurrency;
00024 using namespace Platform;
00025
00026 using namespace std::placeholders;
00027
00028 task<std::shared_ptr<CameraStreamProcessor>> CameraStreamProcessor::CreateAndStartAsync(
00029     MediaFrameSourceKind sourceKind,
00030     Platform::String^ sourceFormat,
00031     MediaCaptureMemoryPreference memoryPreference)
00032 {
00033     auto streamProcessor = std::make_shared<CameraStreamProcessor>(sourceKind, sourceFormat, memoryPreference);
00034
00035     co_await streamProcessor->StartAsync();
00036
00037     return streamProcessor;
00038 }
00039
00040 CameraStreamProcessor::CameraStreamProcessor(
00041     MediaFrameSourceKind sourceKind,
00042     Platform::String^ format,
00043     MediaCaptureMemoryPreference memoryPreference) :
00044     m_sourceKind(sourceKind),
00045     m_sourceFormat(std::move(format)),
00046     m_memoryPreference(memoryPreference)
00047 {}
00048
00049 CameraStreamProcessor::~CameraStreamProcessor()
00050 {
00051     std::lock_guard<std::shared_mutex> lock(m_lock);
00052     m_mediaFrameReader->FrameArrived -= m_frameArrivedToken;
00053 }
00054
00055 CameraStreamProcessor::FrameData CameraStreamProcessor::GetLatestFrame(void) const
00056 {
00057     auto lock = std::shared_lock<std::shared_mutex>(m_lock);
00058     return m_latestFrameData;
00059 }
00060
00061 task<void> CameraStreamProcessor::StartAsync()
00062 {
00063     IVectorView<MediaFrameSourceGroup^>^ groups = co_await MediaFrameSourceGroup::FindAllAsync();
00064
00065     MediaFrameSourceGroup^ selectedGroup;
00066     MediaFrameSourceInfo^ selectedSourceInfo;
00067
00068     // Pick the first group and first matching source from that group
00069     for (MediaFrameSourceGroup^ group : groups)
00070     {
00071         for (MediaFrameSourceInfo^ sourceInfo : group->SourceInfos)
00072         {
00073             if (sourceInfo->SourceKind == m_sourceKind)
00074             {
00075                 selectedSourceInfo = sourceInfo;
00076                 break;
00077             }
00078         }
00079
00080         if (selectedSourceInfo != nullptr)
00081         {
00082             selectedGroup = group;
00083             break;
00084         }
00085     }
00086
00087     if (selectedGroup == nullptr || selectedSourceInfo == nullptr)
00088     {
00089         OutputDebugString(L"Warning: No source found that matched the requested parameters\n");
00090         co_return;
00091     }
00092
00093     MediaCaptureInitializationSettings^ settings = ref new MediaCaptureInitializationSettings();
00094     settings->MemoryPreference = m_memoryPreference;
00095     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00096     settings->SourceGroup = selectedGroup;
00097     settings->SharingMode = MediaCaptureSharingMode::SharedReadOnly;
00098
00099     Platform::Agile<MediaCapture> mediaCapture(ref new MediaCapture());
00100
00101     co_await mediaCapture->InitializeAsync(settings);
00102
00103     MediaFrameSource^ selectedSource = mediaCapture->FrameSources->Lookup(selectedSourceInfo->Id);
00104
00105     MediaFrameReader^ reader = co_await mediaCapture->CreateFrameReaderAsync(selectedSource, m_sourceFormat);
00106
00107     MediaFrameReaderStartStatus status = co_await reader->StartAsync();
00108
00109     if (status == MediaFrameReaderStartStatus::Success)
00110     {
00111         std::lock_guard<std::shared_mutex> lock(m_lock);
00112
00113         m_mediaCapture = std::move(mediaCapture);
00114         m_mediaFrameReader = std::move(reader);
00115
00116         m_frameArrivedToken = m_mediaFrameReader->FrameArrived +=
00117             ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(
00118                 std::bind(&CameraStreamProcessor::OnFrameArrived, this, _1, _2));
00119
00120         m_isStreaming = true;
00121     }
00122     else
00123     {
00124         OutputDebugString(L"Warning: Reader failed to start\n");
00125     }
00126 }
00127
00128 task<void> CameraStreamProcessor::StopAsync()
00129 {
00130     m_isStreaming = false;
00131
00132     std::lock_guard<std::shared_mutex> lock(m_lock);
00133
00134     m_mediaFrameReader->FrameArrived -= m_frameArrivedToken;
00135     co_await m_mediaFrameReader->StopAsync();
00136
00137     m_mediaFrameReader = nullptr;
00138     m_mediaCapture = nullptr;
00139     m_latestFrameData = {};
00140     m_frameArrivedToken = {};
00141     m_frameCount = 0u;
00142 }
00143
00144 bool CameraStreamCoordinateMapper::CameraStreamProcessor::IsStreaming() const
00145 {
00146     return m_isStreaming;
00147 }
00148
00149 void CameraStreamProcessor::OnFrameArrived(MediaFrameReader^ sender, MediaFrameArrivedEventArgs^ args)
00150 {
00151     if (MediaFrameReference^ frame = sender->TryAcquireLatestFrame())
00152     {
00153         std::lock_guard<std::shared_mutex> lock(m_lock);
00154
00155         m_latestFrameData.frame = frame;
00156         m_latestFrameData.index = m_frameCount++;
00157     }
00158 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario1_Launched.xaml.cs Source File

  • JumpList
  • cs

Scenario1_Launched.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario1_Launched : Page
00018     {
00019         public Scenario1_Launched()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         protected override void OnNavigatedTo(NavigationEventArgs e)
00025         {
00026             if (!string.IsNullOrEmpty(MainPage.Current.LaunchParam))
00027             {
00028                 ActivatedBy.Text = MainPage.Current.LaunchParam;
00029             }
00030             else
00031             {
00032                 ActivatedBy.Text = "manual navigation.";
00033             }
00034             MainPage.Current.LaunchParam = null;
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:20:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ColorToStringConverter Member List

This is the complete list of members for ColorToStringConverter, including all inherited members.
colorNames | ColorToStringConverter | [private, static]
colorValues | ColorToStringConverter | [private, static]
Convert(object value, Type targetType, object parameter, string language) | ColorToStringConverter | [inline]
Convert(object value, Type targetType, object parameter, string language) | ColorToStringConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | ColorToStringConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | ColorToStringConverter | [inline]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/SampleConfiguration.cpp Source File

  • SmartCard
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020 using namespace winrt::Windows::Devices::SmartCards;
00021 using namespace winrt::Windows::Foundation;
00022
00023 hstring implementation::MainPage::FEATURE_NAME()
00024 {
00025     return L"Smart Card C++/WinRT Sample";
00026 }
00027
00028 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00029 {
00030     Scenario{L"Create and Provision a TPM Virtual Smart Card", xaml_typename<Scenario1_ProvisionTPM>()},
00031     Scenario{L"Change Smart Card PIN", xaml_typename<Scenario2_ChangePIN>()},
00032     Scenario{L"Reset Smart Card PIN", xaml_typename<Scenario3_ResetPIN>()},
00033     Scenario{L"Change Smart Card Admin Key", xaml_typename<Scenario4_ChangeAdminKey>()},
00034     Scenario{L"Verify Response", xaml_typename<Scenario5_VerifyResponse>()},
00035     Scenario{L"Delete TPM Virtual Smart Card", xaml_typename<Scenario6_DeleteTPM>()},
00036     Scenario{L"List All Smart Cards", xaml_typename<Scenario7_ListAllCards>()},
00037     Scenario{L"Transmit APDU to Smart Card", xaml_typename<Scenario8_TransmitAPDU>()}
00038 });
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/SampleConfiguration.cpp Source File

  • LowLatencyInput
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Low Latency Input", "SDKTemplate.Scenario1_LowLatencyInput" }
00021 };
Generated on Fri Nov 15 2024 22:17:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/Properties/AssemblyInfo.cs Source File

  • XamlTransform3DAnimations
  • cs
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Transform3DAnimations")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("Transform3DAnimations")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_TilePinned Member List

This is the complete list of members for Scenario4_TilePinned, including all inherited members.
Scenario4_TilePinned() | Scenario4_TilePinned
TileExists_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_TilePinned
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/SampleConfiguration.h Source File

  • CredentialPicker
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Credential Picker";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario1_Print.cpp Source File

  • 3DPrinting
  • cppwinrt

Scenario1_Print.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Print.h"
00014 #include "Scenario1_Print.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Data::Xml::Dom;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Numerics;
00020 using namespace winrt::Windows::Graphics::Printing3D;
00021 using namespace winrt::Windows::Security::Cryptography;
00022 using namespace winrt::Windows::Storage;
00023 using namespace winrt::Windows::Storage::Pickers;
00024 using namespace winrt::Windows::Storage::Streams;
00025 using namespace winrt::Windows::UI::Xaml;
00026
00027 #pragma region Creating a package programmatically
00028 namespace
00029 {
00030 #pragma region Buffer, stream, and string helpers
00031     void SetBufferBytes(IBuffer const& buffer, void const* data, uint32_t size)
00032     {
00033         memcpy_s(buffer.data(), buffer.Length(), data, size);
00034     }
00035
00036     IAsyncOperation<hstring> StreamToStringAsync(IRandomAccessStream stream)
00037     {
00038         uint32_t size = static_cast<uint32_t>(stream.Size());
00039         Buffer buffer(size);
00040         IBuffer readBuffer = co_await stream.ReadAsync(buffer, size, InputStreamOptions::None);
00041         co_return CryptographicBuffer::ConvertBinaryToString(BinaryStringEncoding::Utf8, readBuffer);
00042     }
00043
00044     IAsyncOperation<IRandomAccessStream> StringToStreamAsync(hstring const& string)
00045     {
00046         IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(string, BinaryStringEncoding::Utf8);
00047         InMemoryRandomAccessStream outputStream;
00048         co_await outputStream.WriteAsync(buffer);
00049         co_return outputStream;
00050     }
00051 #pragma endregion
00052
00053 #pragma region Mesh buffers
00054     // Create the buffer for vertex positions.
00055     void SetVertices(Printing3DMesh const& mesh)
00056     {
00057         Printing3DBufferDescription description;
00058         description.Format = Printing3DBufferFormat::Printing3DDouble;
00059         description.Stride = 3; // Three values per vertex (x, y, z).
00060         mesh.VertexPositionsDescription(description);
00061         mesh.VertexCount(8); // 8 total vertices in the cube
00062
00063         // Create the buffer into which we will write the vertex positions.
00064         mesh.CreateVertexPositions(sizeof(double) * description.Stride * mesh.VertexCount());
00065
00066         // Fill the buffer with vertex coordinates.
00067         static constexpr double vertices[] =
00068         {
00069             0, 0, 0,
00070             10, 0, 0,
00071             0, 10, 0,
00072             10, 10, 0,
00073             0, 0, 10,
00074             10, 0, 10,
00075             0, 10, 10,
00076             10, 10, 10,
00077         };
00078
00079         SetBufferBytes(mesh.GetVertexPositions(), vertices, sizeof(vertices));
00080     }
00081
00082     // Create the buffer for triangle indices.
00083     void SetTriangleIndices(Printing3DMesh const& mesh)
00084     {
00085         Printing3DBufferDescription description;
00086         description.Format = Printing3DBufferFormat::Printing3DUInt;
00087         description.Stride = 3; // 3 vertex position indices per triangle
00088         mesh.IndexCount(12); // 12 triangles in the cube
00089         mesh.TriangleIndicesDescription(description);
00090
00091         // Create the buffer into which we will write the triangle vertex indices.
00092         mesh.CreateTriangleIndices(sizeof(uint32_t) * description.Stride * mesh.IndexCount());
00093
00094         // Fill the buffer with triangle vertex indices.
00095         static constexpr uint32_t indices[] =
00096         {
00097             1, 0, 2,
00098             1, 2, 3,
00099             0, 1, 5,
00100             0, 5, 4,
00101             1, 3, 7,
00102             1, 7, 5,
00103             2, 7, 3,
00104             2, 6, 7,
00105             0, 6, 2,
00106             0, 4, 6,
00107             6, 5, 7,
00108             4, 5, 6,
00109         };
00110
00111         SetBufferBytes(mesh.GetTriangleIndices(), indices, sizeof(indices));
00112     }
00113
00114
00115     // Create the buffer for material indices.
00116     void SetMaterialIndices(Printing3DMesh const& mesh)
00117     {
00118         Printing3DBufferDescription description;
00119         description.Format = Printing3DBufferFormat::Printing3DUInt;
00120         description.Stride = 4; // 4 indices per material
00121         mesh.IndexCount(12); // 12 triangles with material
00122         mesh.TriangleMaterialIndicesDescription(description);
00123
00124         // Create the buffer into which we will write the material indices.
00125         mesh.CreateTriangleMaterialIndices(sizeof(uint32_t) * description.Stride * mesh.IndexCount());
00126
00127         // Fill the buffer with material indices.
00128         static constexpr uint32_t indices[] =
00129         {
00130             // base materials:
00131             // in  the BaseMaterialGroup, the BaseMaterial with id=0 will be applied to these triangle vertices
00132             2, 0, 0, 0,
00133             2, 0, 0, 0,
00134             // color materials:
00135             // in the ColorMaterialGroup, the ColorMaterials with these ids will be applied to these triangle vertices
00136             1, 1, 1, 1,
00137             1, 1, 1, 1,
00138             1, 0, 0, 0,
00139             1, 0, 0, 0,
00140             1, 0, 1, 0,
00141             1, 0, 1, 1,
00142             // composite materials:
00143             // in the CompositeMaterialGroup, the CompositeMaterial with id=0 will be applied to these triangles
00144             3,0,0,0,
00145             3,0,0,0,
00146             // texture materials:
00147             // in the Texture2CoordMaterialGroup, each texture coordinate is mapped to the appropriate vertex on these
00148             // two adjacent triangle faces, so that the square face they create displays the original rectangular image
00149             4, 0, 3, 1,
00150             4, 2, 3, 0,
00151         };
00152
00153         SetBufferBytes(mesh.GetTriangleMaterialIndices(), indices, sizeof(indices));
00154     }
00155 #pragma endregion
00156
00157     // Works around an issue with Printing3DTextureResource: It does not respect
00158     // the TextureData.ContentType property, and always encodes the content type as "".
00159     // Repair the XML by assuming that a path that ends with ".png" is a PNG file,
00160     // and everything else is a JPG file.
00161     IAsyncAction FixTextureContentTypeAsync(Printing3D3MFPackage package)
00162     {
00163         XmlDocument xmldoc;
00164         xmldoc.LoadXml(co_await StreamToStringAsync(package.ModelPart()));
00165         hstring ns3d = L"xmlns:m='http://schemas.microsoft.com/3dmanufacturing/material/2015/02'";
00166
00167         for (IXmlNode node : xmldoc.SelectNodesNS(L"//m:texture2d[@contenttype='']", box_value(ns3d)))
00168         {
00169             IXmlNode contentType = node.Attributes().GetNamedItem(L"contenttype");
00170             auto path = unbox_value<hstring>(node.Attributes().GetNamedItem(L"path").NodeValue());
00171             std::wstring_view path_view = path;
00172             if (path_view.size() >= 4 && path_view.substr(path_view.size() - 4) == L".png")
00173             {
00174                 contentType.NodeValue(box_value(L"image/png"));
00175             }
00176             else
00177             {
00178                 contentType.NodeValue(box_value(L"image/jpg"));
00179             }
00180         }
00181
00182         // Update the model with the repaired XML.
00183         package.ModelPart(co_await StringToStreamAsync(xmldoc.GetXml()));
00184     }
00185
00186     IAsyncOperation<Printing3D3MFPackage> CreatePackageAsync()
00187     {
00188         Printing3D3MFPackage package;
00189
00190         Printing3DModel model;
00191         model.Unit(Printing3DModelUnit::Millimeter);
00192
00193         // Material indices start at 1. (0 is reserved.)
00194
00195 #pragma region Color materials
00196         // Create color materials.
00197         Printing3DColorMaterial colorMaterial1;
00198         colorMaterial1.Color({ 255, 20, 20, 90 });
00199
00200         Printing3DColorMaterial colorMaterial2;
00201         colorMaterial2.Color({ 255, 250, 120, 45 });
00202
00203         // Create a color group with id 1 and add the colors to it.
00204         Printing3DColorMaterialGroup colorGroup(1);
00205         colorGroup.Colors().ReplaceAll({ colorMaterial1, colorMaterial2 });
00206
00207         // add the color group to the model.
00208         model.Material().ColorGroups().Append(colorGroup);
00209 #pragma endregion
00210
00211 #pragma region Base materials
00212         // Create base materials.
00213         Printing3DBaseMaterial material1;
00214         material1.Name(Printing3DBaseMaterial::Pla());
00215         material1.Color(colorMaterial1);
00216
00217         Printing3DBaseMaterial material2;
00218         material2.Name(Printing3DBaseMaterial::Abs());
00219         material2.Color(colorMaterial2);
00220
00221         // Create a new base material group with id 2 and add the base materials to it.
00222         Printing3DBaseMaterialGroup materialGroup(2);
00223         materialGroup.Bases().ReplaceAll({ material1, material2 });
00224
00225         // Add the material group to the base groups on the model.
00226         model.Material().BaseGroups().Append(materialGroup);
00227
00228 #pragma endregion
00229
00230 #pragma region Composite material groups
00231         // Create a composite material group with id 3.
00232         Printing3DCompositeMaterialGroup compositeMaterialGroup(3);
00233
00234         // Add it to the metadata.
00235         // The key is the string "composite" followed by the composite material group id.
00236         // The value specifies that the default base material group to use is id 2.
00237         model.Metadata().Insert(L"composite3", L"2");
00238
00239         // The indices are relative to the material indices that will be set by SetMaterialIndicesAsync.
00240         compositeMaterialGroup.MaterialIndices().ReplaceAll({ 0, 1 });
00241
00242         // Create new composite materials.
00243         // The Values correspond to the materials added in the compositeMaterialGroup,
00244         // and they must sum to 1.0.
00245
00246         // Composite material 1 consists of 20% material1 and 80% material2.
00247         Printing3DCompositeMaterial compositeMaterial1;
00248         compositeMaterial1.Values().ReplaceAll({ 0.2, 0.8 });
00249
00250         // Composite material 2 consists of 50% material1 and 50% material2.
00251         Printing3DCompositeMaterial compositeMaterial2;
00252         compositeMaterial2.Values().ReplaceAll({ 0.5, 0.5 });
00253
00254         // Composite material 3 consists of 80% material1 and 20% material2.
00255         Printing3DCompositeMaterial compositeMaterial3;
00256         compositeMaterial3.Values().ReplaceAll({ 0.8, 0.2 });
00257
00258         // Composite material 4 consists of 40% material1 and 60% material2.
00259         Printing3DCompositeMaterial compositeMaterial4;
00260         compositeMaterial4.Values().ReplaceAll({ 0.4, 0.6 });
00261
00262         // Add the composite materials to the compositeMaterialGroup.
00263         compositeMaterialGroup.Composites().ReplaceAll({ compositeMaterial1, compositeMaterial2, compositeMaterial3, compositeMaterial4 });
00264
00265         // Add the composite material group to the model.
00266         model.Material().CompositeGroups().Append(compositeMaterialGroup);
00267 #pragma endregion
00268
00269 #pragma region Texture resource
00270         Printing3DTextureResource textureResource;
00271
00272         // Set the texture path in the 3MF file.
00273         textureResource.Name(L"/3D/Texture/msLogo.png");
00274
00275         // Load the texture from our package.
00276         StorageFile file = co_await StorageFile::GetFileFromApplicationUriAsync(Uri(L"ms-appx:///Assets/msLogo.png"));
00277         textureResource.TextureData(co_await file.OpenReadAsync());
00278
00279         package.Textures().Append(textureResource);
00280 #pragma endregion
00281
00282 #pragma region 2D texture materials
00283         // Create a texture material group with id 4.
00284         Printing3DTexture2CoordMaterialGroup texture2CoordGroup(4);
00285
00286         // Add it to the metadata.
00287         // The key is the string "tex" followed by the texture material group id.
00288         // The value is the name of the texture resource (see textureResource.Name above).
00289         model.Metadata().Insert(L"tex4", L"/3D/Texture/msLogo.png");
00290
00291         // Create texture materials and add them to the group.
00292         Printing3DTexture2CoordMaterial coord1;
00293         coord1.U(0.0);
00294         coord1.V(1.0);
00295
00296         Printing3DTexture2CoordMaterial coord2;
00297         coord2.U(1.0);
00298         coord2.V(1.0);
00299
00300         Printing3DTexture2CoordMaterial coord3;
00301         coord3.U(0.0);
00302         coord3.V(0.0);
00303
00304         Printing3DTexture2CoordMaterial coord4;
00305         coord4.U(1.0);
00306         coord4.V(0.0);
00307
00308         texture2CoordGroup.Texture2Coords().ReplaceAll({ coord1, coord2, coord3, coord4 });
00309
00310         // Add the texture material group to the model.
00311         model.Material().Texture2CoordGroups().Append(texture2CoordGroup);
00312 #pragma endregion
00313
00314 #pragma region Mesh
00315         Printing3DMesh mesh;
00316
00317         SetVertices(mesh);
00318         SetTriangleIndices(mesh);
00319         SetMaterialIndices(mesh);
00320
00321         // add the mesh to the model
00322         model.Meshes().Append(mesh);
00323 #pragma endregion
00324
00325 #pragma region Adding a component to the build
00326         // create a component.
00327         Printing3DComponent component;
00328
00329         // assign the mesh to the component's mesh.
00330         component.Mesh(mesh);
00331
00332         // Add the component to the model. A model can have multiple components.
00333         model.Components().Append(component);
00334
00335         // The world matrix for the component is the identity matrix.
00336         Printing3DComponentWithMatrix componentWithMatrix;
00337         componentWithMatrix.Component(component);
00338         componentWithMatrix.Matrix(float4x4::identity());
00339
00340         // add the componentWithMatrix to the build.
00341         // The build defines what is to be printed from within a Printing3DModel.
00342         // If you leave a mesh out of the build, it will not be printed.
00343         model.Build().Components().Append(componentWithMatrix);
00344 #pragma endregion
00345
00346         // Save the completed model into a package.
00347         co_await package.SaveModelToPackageAsync(model);
00348
00349         // fix any textures in the model file.
00350         co_await FixTextureContentTypeAsync(package);
00351
00352         co_return package;
00353     }
00354
00355     IAsyncOperation<Printing3D3MFPackage> CreatePackageFromXmlAsync(hstring rawXml)
00356     {
00357         Printing3D3MFPackage package;
00358         package.ModelPart(co_await StringToStreamAsync(rawXml));
00359         co_return package;
00360     }
00361 }
00362 #pragma endregion
00363
00364 namespace winrt::SDKTemplate::implementation
00365 {
00366     Scenario1_Print::Scenario1_Print()
00367     {
00368         InitializeComponent();
00369     }
00370
00371     void Scenario1_Print::EnablePackageOperationButtons()
00372     {
00373         SaveButton().IsEnabled(true);
00374         PrintButton().IsEnabled(true);
00375     }
00376
00377     fire_and_forget Scenario1_Print::CreateProgrammatically_Click(IInspectable const&, RoutedEventArgs const&)
00378     {
00379         auto lifetime = get_strong();
00380
00381         currentPackage = co_await CreatePackageAsync();
00382         rootPage.NotifyUser(L"Package created programmatically.", NotifyType::StatusMessage);
00383         EnablePackageOperationButtons();
00384     }
00385
00386     fire_and_forget Scenario1_Print::CreateFromXml_Click(IInspectable const&, RoutedEventArgs const&)
00387     {
00388         auto lifetime = get_strong();
00389
00390         static constexpr wchar_t rawXml[] = L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
00391             L"<model unit=\"millimeter\" xml:lang=\"en-US\" xmlns=\"http://schemas.microsoft.com/3dmanufacturing/2013/01\">"
00392             L"<resources><object id=\"0\" type=\"model\"><mesh><vertices>"
00393             L"<vertex x=\"0.000000\" y=\"0.000000\" z=\"10.000000\" />"
00394             L"<vertex x=\"0.000000\" y=\"10.000000\" z=\"10.000000\" />"
00395             L"<vertex x=\"0.000000\" y=\"0.000000\" z=\"0.000000\" />"
00396             L"<vertex x=\"0.000000\" y=\"10.000000\" z=\"0.000000\" />"
00397             L"<vertex x=\"10.000000\" y=\"0.000000\" z=\"10.000000\" />"
00398             L"<vertex x=\"10.000000\" y=\"10.000000\" z=\"10.000000\" />"
00399             L"<vertex x=\"10.000000\" y=\"0.000000\" z=\"0.000000\" />"
00400             L"<vertex x=\"10.000000\" y=\"10.000000\" z=\"0.000000\" />"
00401             L"</vertices><triangles>"
00402             L"<triangle v1=\"0\" v2=\"1\" v3=\"2\" />"
00403             L"<triangle v1=\"2\" v2=\"1\" v3=\"3\" />"
00404             L"<triangle v1=\"0\" v2=\"4\" v3=\"5\" />"
00405             L"<triangle v1=\"1\" v2=\"0\" v3=\"5\" />"
00406             L"<triangle v1=\"2\" v2=\"6\" v3=\"4\" />"
00407             L"<triangle v1=\"0\" v2=\"2\" v3=\"4\" />"
00408             L"<triangle v1=\"3\" v2=\"7\" v3=\"2\" />"
00409             L"<triangle v1=\"2\" v2=\"7\" v3=\"6\" />"
00410             L"<triangle v1=\"1\" v2=\"5\" v3=\"3\" />"
00411             L"<triangle v1=\"3\" v2=\"5\" v3=\"7\" />"
00412             L"<triangle v1=\"6\" v2=\"7\" v3=\"5\" />"
00413             L"<triangle v1=\"4\" v2=\"6\" v3=\"5\" />"
00414             L"</triangles></mesh></object></resources>"
00415             L"<build><item objectid=\"0\" transform=\"10 0 0 0 10 0 0 0 10 0 0 0\" /></build></model>";
00416         currentPackage = co_await CreatePackageFromXmlAsync(rawXml);
00417         rootPage.NotifyUser(L"Package created from XML.", NotifyType::StatusMessage);
00418         EnablePackageOperationButtons();
00419     }
00420
00421     fire_and_forget Scenario1_Print::LoadPackageFromFile_Click(IInspectable const&, RoutedEventArgs const&)
00422     {
00423         auto lifetime = get_strong();
00424
00425         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00426
00427         FileOpenPicker openPicker;
00428         openPicker.ViewMode(PickerViewMode::Thumbnail);
00429         openPicker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
00430         openPicker.FileTypeFilter().Append(L".3mf");
00431
00432         StorageFile file = co_await openPicker.PickSingleFileAsync();
00433         if (file == nullptr)
00434         {
00435             co_return;
00436         }
00437
00438         rootPage.NotifyUser(L"Loading...", NotifyType::StatusMessage);
00439
00440         Printing3D3MFPackage package;
00441         IRandomAccessStream fileStream = co_await file.OpenAsync(FileAccessMode::Read);
00442         Printing3DModel model = co_await package.LoadModelFromPackageAsync(fileStream);
00443         rootPage.NotifyUser(L"Repairing...", NotifyType::StatusMessage);
00444         co_await model.RepairAsync();
00445         rootPage.NotifyUser(L"Saving...", NotifyType::StatusMessage);
00446         co_await package.SaveModelToPackageAsync(model);
00447         co_await FixTextureContentTypeAsync(package);
00448         fileStream.Close();
00449
00450         currentPackage = package;
00451         rootPage.NotifyUser(L"Package created from file.", NotifyType::StatusMessage);
00452         EnablePackageOperationButtons();
00453     }
00454
00455     fire_and_forget Scenario1_Print::SavePackage_Click(IInspectable const&, RoutedEventArgs const&)
00456     {
00457         auto lifetime = get_strong();
00458
00459         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00460
00461         FileSavePicker savePicker;
00462         savePicker.DefaultFileExtension(L".3mf");
00463         savePicker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
00464         savePicker.FileTypeChoices().Insert(L"3MF File", single_threaded_vector<hstring>({ L".3mf" }));
00465         StorageFile storageFile = co_await savePicker.PickSaveFileAsync();
00466         if (storageFile == nullptr)
00467         {
00468             co_return;
00469         }
00470
00471         IRandomAccessStream stream = co_await currentPackage.SaveAsync();
00472         stream.Seek(0);
00473         DataReader dataReader(stream);
00474         auto size = (uint32_t)stream.Size();
00475         co_await dataReader.LoadAsync(size);
00476         IBuffer buffer = dataReader.ReadBuffer(size);
00477         co_await FileIO::WriteBufferAsync(storageFile, buffer);
00478         stream.Close();
00479
00480         rootPage.NotifyUser(L"Saved", NotifyType::StatusMessage);
00481     }
00482
00483     fire_and_forget Scenario1_Print::PrintPackage_Click(IInspectable const&, RoutedEventArgs const&)
00484     {
00485         auto lifetime = get_strong();
00486
00487         // register the PrintTaskRequest callback to get the Printing3D3MFPackage.
00488         auto print3DManager = Print3DManager::GetForCurrentView();
00489         event_token taskRequestedToken = print3DManager.TaskRequested({ this, &Scenario1_Print::OnTaskRequested });
00490
00491         // show the PrintUI
00492         [[maybe_unused]] bool result = co_await Print3DManager::ShowPrintUIAsync();
00493
00494         // Remove the print task request after the dialog is complete.
00495         print3DManager.TaskRequested(taskRequestedToken);
00496     }
00497
00498     void Scenario1_Print::OnTaskRequested(Print3DManager const&, Print3DTaskRequestedEventArgs const& args)
00499     {
00500         Print3DTask print3dTask = args.Request().CreateTask(L"Sample Model", L"Default", [this](auto&& e) { e.SetSource(currentPackage); });
00501
00502         // Optional notification handlers.
00503         print3dTask.Completed([rootPage = rootPage](auto&&, auto&&) { rootPage.NotifyUser(L"Printing completed.", NotifyType::StatusMessage); });
00504         print3dTask.Submitting([rootPage = rootPage](auto&&, auto&&) { rootPage.NotifyUser(L"Submitting print job.", NotifyType::StatusMessage); });
00505     }
00506
00507 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameConstants.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

GameConstants.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace GameConstants
00015 {
00016     using namespace std::literals::chrono_literals;
00017
00018     static const int MaxAmmo = 10;
00019     static const int MaxCylinders = 5;
00020     static const int MaxTargets = 10;
00021     static const float AmmoSize = 0.2f;
00022     static const float AmmoRadius = AmmoSize * 0.5f;
00023     static const int MaxBackgroundTextures = 3;
00024
00025     // Artificial delays introduced to simulate high resource requirements for large games.
00026     static const auto InitialLoadingDelay = 2s;     // Time to wait before completion of initial load.
00027     static const auto LevelLoadingDelay = 500ms;    // Time to wait before completion of level load.
00028
00029     static const int WorldFloorId = 80001;
00030     static const int WorldCeilingId = 80002;
00031     static const int WorldWallsId = 80003;
00032
00033     namespace Physics
00034     {
00035         static const float GroundRestitution = 0.8f;     // Percentage of the velocity transmitted by ground and walls when an ammo hit.
00036         static const float Friction = 0.9f;     // The amount of velocity retained after friction is applied.
00037         static const float AutoFireDelay = 0.2f;     // The period between two successive ammo firing.
00038         static const float Gravity = 5.0f;     // The magnitude of the downward force applied to ammos.
00039         static const float BounceTransfer = 0.8f;     // The proportion of velocity transferred during a collision between 2 ammos.
00040         static const float BounceLost = 0.1f;     // The proportion of velocity lost during a collision between 2 ammos.
00041         static const float RestThreshold = 0.02f;    // The energy below which the ball is flagged as laying on ground.
00042                                                             // It is defined as Gravity * Height_above_ground + 0.5 * Velocity * Velocity.
00043         static const float FrameLength = 0.003f;   // The duration of a frame for physics handling when the graphics frame length is too long.
00044     }
00045
00046     namespace Sound
00047     {
00048         static const float MaxVelocity = 10.0f;    // The velocity at which the bouncing sound is played at maximum volume.
00049         static const float MinVelocity = 0.05f;    // The minimum contact velocity required to make a sound.
00050         static const float MinAdjustment = 0.2f;     // The minimum volume adjustment based on contact velocity.
00051     }
00052 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_CustomEffects Member List

This is the complete list of members for Scenario6_CustomEffects, including all inherited members.
AddCustomEffect() | Scenario6_CustomEffects | [inline, private]
CreateAudioGraph() | Scenario6_CustomEffects | [inline, private]
deviceOutputNode | Scenario6_CustomEffects | [private]
File_Click(object sender, RoutedEventArgs e) | Scenario6_CustomEffects | [inline, private]
FileInput_FileCompleted(AudioFileInputNode sender, object args) | Scenario6_CustomEffects | [inline, private]
fileInputNode | Scenario6_CustomEffects | [private]
graph | Scenario6_CustomEffects | [private]
Graph_Click(object sender, RoutedEventArgs e) | Scenario6_CustomEffects | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario6_CustomEffects | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario6_CustomEffects | [inline, protected]
rootPage | Scenario6_CustomEffects | [private]
Scenario6_CustomEffects() | Scenario6_CustomEffects | [inline]
SelectInputFile() | Scenario6_CustomEffects | [inline, private]
TogglePlay() | Scenario6_CustomEffects | [inline, private]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceListEntry Member List

This is the complete list of members for DeviceListEntry, including all inherited members.
device | DeviceListEntry | [private]
DeviceInformation | DeviceListEntry |
DeviceListEntry(Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector) | DeviceListEntry | [inline]
deviceSelector | DeviceListEntry | [private]
DeviceSelector | DeviceListEntry |
InstanceId | DeviceListEntry |
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ParameterizedTemplate Member List

This is the complete list of members for Scenario3_ParameterizedTemplate, including all inherited members.
Display() | Scenario3_ParameterizedTemplate | [inline, private]
Scenario3_ParameterizedTemplate() | Scenario3_ParameterizedTemplate | [inline]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/Project.idl Source File

  • IoT-I2C
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_ReadData : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_ReadData();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario1_CheckConsentAvailability.cpp Source File

  • UserConsentVerifier
  • cppwinrt

Scenario1_CheckConsentAvailability.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_CheckConsentAvailability.h"
00014 #include "Scenario1_CheckConsentAvailability.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Security::Credentials::UI;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario1_CheckConsentAvailability::Scenario1_CheckConsentAvailability()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     fire_and_forget Scenario1_CheckConsentAvailability::CheckAvailability_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         auto lifetime = get_strong();
00031
00032         CheckAvailabilityButton().IsEnabled(false);
00033
00034         // Check the availability of Windows Hello authentication through User Consent Verifier.
00035         UserConsentVerifierAvailability consentAvailability = co_await UserConsentVerifier::CheckAvailabilityAsync();
00036         switch (consentAvailability)
00037         {
00038         case UserConsentVerifierAvailability::Available:
00039             rootPage.NotifyUser(L"User consent verification available!", NotifyType::StatusMessage);
00040             break;
00041
00042         case UserConsentVerifierAvailability::DeviceNotPresent:
00043             rootPage.NotifyUser(L"No PIN or biometric found, please set one up.", NotifyType::ErrorMessage);
00044             break;
00045
00046         default:
00047             rootPage.NotifyUser(L"User consent verification is currently unavailable.", NotifyType::ErrorMessage);
00048             break;
00049         }
00050
00051         CheckAvailabilityButton().IsEnabled(true);
00052     }
00053 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/pch.cpp Source File

  • LibraryManagement
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/SampleConfiguration.h Source File

  • NumberFormatting
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Number formatting C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/SampleConfiguration.h Source File

  • Printing
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Printing C++ Sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario2_XmlWriter.xaml.h Source File

  • XmlLite
  • cpp

Scenario2_XmlWriter.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario2_XmlWriter.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     namespace XmlLite
00021     {
00022         /// <summary>
00023         /// An empty page that can be used on its own or navigated to within a Frame.
00024         /// </summary>
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         public ref class Scenario2 sealed
00027         {
00028         public:
00029             Scenario2();
00030
00031         private:
00032             MainPage^ rootPage;
00033             void DoSomething_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034
00035             HRESULT WriteXml(Windows::Storage::Streams::IRandomAccessStream^ pStream);
00036         };
00037     }
00038 }
Generated on Fri Nov 15 2024 22:22:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_SampleOverview Member List

This is the complete list of members for Scenario_SampleOverview, including all inherited members.
Scenario_SampleOverview() Scenario_SampleOverview [inline]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario5_TriggerCFU.xaml.cpp Source File

  • FilePicker
  • cpp

Scenario5_TriggerCFU.xaml.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "Scenario5_TriggerCFU.xaml.h"
00003
00004 using namespace SDKTemplate;
00005
00006 using namespace concurrency;
00007 using namespace Platform;
00008 using namespace Platform::Collections;
00009 using namespace Windows::Foundation;
00010 using namespace Windows::Storage;
00011 using namespace Windows::Storage::AccessCache;
00012 using namespace Windows::Storage::Pickers;
00013 using namespace Windows::Storage::Provider;
00014 using namespace Windows::UI::Xaml;
00015
00016 Scenario5_TriggerCFU::Scenario5_TriggerCFU()
00017 {
00018     InitializeComponent();
00019     UpdateButtons();
00020 }
00021
00022 void Scenario5_TriggerCFU::UpdateButtons()
00023 {
00024     WriteToFileButton->IsEnabled = (m_afterWriteFile != nullptr);
00025     WriteToFileWithCFUButton->IsEnabled = (m_afterWriteFile != nullptr);
00026
00027     SaveToFutureAccessListButton->IsEnabled = (m_beforeReadFile != nullptr);
00028     GetFileFromFutureAccessListButton->IsEnabled = !m_faToken->IsEmpty();
00029 }
00030
00031 void Scenario5_TriggerCFU::CreateFileButton_Click(Object^ sender, RoutedEventArgs^ e)
00032 {
00033     rootPage->NotifyUser("", NotifyType::StatusMessage);
00034
00035     FileSavePicker^ savePicker = ref new FileSavePicker();
00036     savePicker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
00037
00038     savePicker->FileTypeChoices->Insert("Plain Text", ref new Vector<String^>{ ".txt" });
00039     savePicker->SuggestedFileName = "New Document";
00040
00041     create_task(savePicker->PickSaveFileAsync()).then([this](StorageFile^ file)
00042     {
00043         m_afterWriteFile = file;
00044         if (m_afterWriteFile)
00045         {
00046             rootPage->NotifyUser("File created.", NotifyType::StatusMessage);
00047         }
00048         else
00049         {
00050             rootPage->NotifyUser("Operation cancelled.", NotifyType::ErrorMessage);
00051         }
00052         UpdateButtons();
00053     });
00054 }
00055
00056 void Scenario5_TriggerCFU::WriteToFileButton_Click(Object^ sender, RoutedEventArgs^ e)
00057 {
00058     create_task(FileIO::WriteTextAsync(m_afterWriteFile, "The File Picker App just wrote to the file!")).then([this]()
00059     {
00060         rootPage->NotifyUser("File write complete. If applicable, a WriteActivationMode.AfterWrite activation will occur in approximately 60 seconds on desktop.", NotifyType::StatusMessage);
00061     });
00062 }
00063
00064 void Scenario5_TriggerCFU::WriteToFileWithExplicitCFUButton_Click(Object^ sender, RoutedEventArgs^ e)
00065 {
00066     StorageFile^ file = m_afterWriteFile;
00067     CachedFileManager::DeferUpdates(file);
00068     create_task(FileIO::WriteTextAsync(file, "The File Picker App just wrote to the file!")).then([this, file]()
00069     {
00070         rootPage->NotifyUser("File write complete. Explicitly completing updates.", NotifyType::StatusMessage);
00071         return create_task(CachedFileManager::CompleteUpdatesAsync(file));
00072     }).then([this, file](FileUpdateStatus status)
00073     {
00074         switch (status)
00075         {
00076         case FileUpdateStatus::Complete:
00077             rootPage->NotifyUser("File " + file->Name + " was saved.", NotifyType::StatusMessage);
00078             break;
00079
00080         case FileUpdateStatus::CompleteAndRenamed:
00081             rootPage->NotifyUser("File " + file->Name + " was renamed and saved.", NotifyType::StatusMessage);
00082             break;
00083
00084         default:
00085             rootPage->NotifyUser("File " + file->Name + " couldn't be saved.", NotifyType::ErrorMessage);
00086             break;
00087         }
00088     });
00089 }
00090
00091 void Scenario5_TriggerCFU::PickAFileButton_Click(Object^ sender, RoutedEventArgs^ e)
00092 {
00093     rootPage->NotifyUser("", NotifyType::StatusMessage);
00094
00095     FileOpenPicker^ openPicker = ref new FileOpenPicker();
00096     openPicker->ViewMode = PickerViewMode::Thumbnail;
00097     openPicker->FileTypeFilter->Append(".txt");
00098
00099     create_task(openPicker->PickSingleFileAsync()).then([this](StorageFile^ file)
00100     {
00101         m_beforeReadFile = file;
00102         if (file)
00103         {
00104             rootPage->NotifyUser("Picked file: " + file->Name, NotifyType::StatusMessage);
00105         }
00106         else
00107         {
00108             rootPage->NotifyUser("Operation cancelled.", NotifyType::ErrorMessage);
00109         }
00110         UpdateButtons();
00111     });
00112 }
00113
00114 void Scenario5_TriggerCFU::SaveToFutureAccessListButton_Click(Object^ sender, RoutedEventArgs^ e)
00115 {
00116     m_faToken = StorageApplicationPermissions::FutureAccessList->Add(m_beforeReadFile);
00117     rootPage->NotifyUser("Saved to Future Access List", NotifyType::StatusMessage);
00118     m_beforeReadFile = nullptr;
00119     UpdateButtons();
00120 }
00121
00122 void Scenario5_TriggerCFU::GetFileFromFutureAccessListButton_Click(Object^ sender, RoutedEventArgs^ e)
00123 {
00124     rootPage->NotifyUser("Getting the file from the Future Access List. If applicable, a ReadActivationMode.BeforeAccess activation will occur in approximately 60 seconds on desktop.", NotifyType::StatusMessage);
00125     create_task(StorageApplicationPermissions::FutureAccessList->GetFileAsync(m_faToken)).then([this](StorageFile^ file)
00126     {
00127         if (file)
00128         {
00129             rootPage->NotifyUser("Retrieved file from Future Access List: " + file->Name, NotifyType::StatusMessage);
00130             m_beforeReadFile = file;
00131         }
00132         else
00133         {
00134             rootPage->NotifyUser("Unable to retrieve file from Future Access List.", NotifyType::ErrorMessage);
00135         }
00136         UpdateButtons();
00137     });
00138 }
00139
Generated on Fri Nov 15 2024 22:19:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ShakeEvents Member List

This is the complete list of members for Scenario2_ShakeEvents, including all inherited members.
_accelerometer | Scenario2_ShakeEvents | [private]
_shakeCount | Scenario2_ShakeEvents | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_ShakeEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2_ShakeEvents | [inline, protected]
rootPage | Scenario2_ShakeEvents | [private]
Scenario2_ShakeEvents() | Scenario2_ShakeEvents | [inline]
ScenarioDisable() | Scenario2_ShakeEvents | [inline, private]
ScenarioEnable() | Scenario2_ShakeEvents | [inline, private]
Shaken(object sender, AccelerometerShakenEventArgs e) | Scenario2_ShakeEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario2_ShakeEvents | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4 Member List

This is the complete list of members for Scenario4, including all inherited members.
AddSession(SessionWrapper session) | Scenario4 | [inline]
CloseSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario4 | [inline, protected]
RemoveSession(int index) | Scenario4 | [inline]
rootPage | Scenario4 | [private]
Scenario4() | Scenario4 | [inline]
SelectSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4 | [inline, private]
thisLock | Scenario4 | [private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/SampleConfiguration.cpp Source File

  • RadioManager
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"RadioManager C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Toggle Radios", xaml_typename<SDKTemplate::Scenario1_Toggle>() },
00029 });
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

CalendarConverter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace AdventureWorks
00014 {
00015     [Windows::UI::Xaml::Data::Bindable]
00016     [Windows::Foundation::Metadata::WebHostHidden]
00017     public ref class CalendarConverter sealed : Windows::UI::Xaml::Data::IValueConverter
00018     {
00019     public:
00020         CalendarConverter();
00021
00022         // Inherited via IValueConverter
00023         virtual Platform::Object ^ Convert(Platform::Object ^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^parameter, Platform::String ^language);
00024         virtual Platform::Object ^ ConvertBack(Platform::Object ^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^parameter, Platform::String ^language);
00025     };
00026 }
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MasterDetailPage Member List

This is the complete list of members for MasterDetailPage, including all inherited members.
AdaptiveStates_CurrentStateChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::VisualStateChangedEventArgs const &e) | MasterDetailPage |
DisableContentTransitions() | MasterDetailPage | [private]
EnableContentTransitions() | MasterDetailPage | [private]
LayoutRoot_Loaded(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | MasterDetailPage |
m_items | MasterDetailPage | [private]
MasterDetailPage() | MasterDetailPage |
MasterListView_ItemClick(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::ItemClickEventArgs const &e) | MasterDetailPage |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | MasterDetailPage |
UpdateForVisualState(Windows::UI::Xaml::VisualState const &newState, Windows::UI::Xaml::VisualState const &oldState=nullptr) | MasterDetailPage | [private]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PointOfInterest Member List

This is the complete list of members for PointOfInterest, including all inherited members.
DisplayName | PointOfInterest
ImageSourceUri | PointOfInterest
Location | PointOfInterest
NormalizedAnchorPoint | PointOfInterest
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXHelper.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 namespace DX
00017 {
00018     inline void ThrowIfFailed(HRESULT hr)
00019     {
00020         if (FAILED(hr))
00021         {
00022             // Set a breakpoint on this line to catch Win32 API errors.
00023             throw Platform::Exception::CreateException(hr);
00024         }
00025     }
00026
00027     // Function that reads from a binary file asynchronously.
00028     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00029     {
00030         using namespace Windows::Storage;
00031         using namespace Concurrency;
00032
00033         auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
00034
00035         return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([] (StorageFile^ file)
00036         {
00037             return FileIO::ReadBufferAsync(file);
00038         }).then([] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00039         {
00040             std::vector<byte> returnBuffer;
00041             returnBuffer.resize(fileBuffer->Length);
00042             Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
00043             return returnBuffer;
00044         });
00045     }
00046
00047     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00048     inline float ConvertDipsToPixels(float dips, float dpi)
00049     {
00050         static const float dipsPerInch = 96.0f;
00051         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00052     }
00053
00054     // Converts a length in physical pixels to a length in device-independent pixels (DIPs).
00055     inline float ConvertPixelsToDips(float pixels)
00056     {
00057         static const float dipsPerInch = 96.0f;
00058         return pixels * dipsPerInch / Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi; // Do not round.
00059     }
00060
00061     // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
00062     // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().
00063     inline float ConvertPixelsToDips(float pixels, float dpi)
00064     {
00065         static const float dipsPerInch = 96.0f;
00066         return pixels * dipsPerInch / dpi; // Do not round.
00067     }
00068
00069 #if defined(_DEBUG)
00070     // Check for SDK Layer support.
00071     inline bool SdkLayersAvailable()
00072     {
00073         HRESULT hr = D3D11CreateDevice(
00074             nullptr,
00075             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00076             0,
00077             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00078             nullptr,                    // Any feature level will do.
00079             0,
00080             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00081             nullptr,                    // No need to keep the D3D device reference.
00082             nullptr,                    // No need to know the feature level.
00083             nullptr                     // No need to keep the D3D device context reference.
00084             );
00085
00086         return SUCCEEDED(hr);
00087     }
00088 #endif
00089 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/PersistentState.cpp Source File

  • Simple3DGameDX
  • cpp
  • Common

PersistentState.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "PersistentState.h"
00010 #include "DirectXSample.h"
00011
00012 using namespace Microsoft::WRL;
00013 using namespace Windows::Foundation;
00014 using namespace Windows::Foundation::Collections;
00015 using namespace Windows::Storage;
00016 using namespace DirectX;
00017
00018 void PersistentState::Initialize(
00019     _In_ IPropertySet^ settingsValues,
00020     _In_ Platform::String^ key
00021     )
00022 {
00023     m_settingsValues = settingsValues;
00024     m_keyName = key;
00025 }
00026
00027 void PersistentState::SaveBool(Platform::String^ key, bool value)
00028 {
00029     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00030     if (m_settingsValues->HasKey(fullKey))
00031     {
00032         m_settingsValues->Remove(fullKey);
00033     }
00034     m_settingsValues->Insert(fullKey, PropertyValue::CreateInt32(value ? 1 : 0));
00035 }
00036
00037 void PersistentState::SaveInt32(Platform::String^ key, int value)
00038 {
00039     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00040     if (m_settingsValues->HasKey(fullKey))
00041     {
00042         m_settingsValues->Remove(fullKey);
00043     }
00044     m_settingsValues->Insert(fullKey, PropertyValue::CreateInt32(value));
00045 }
00046
00047 void PersistentState::SaveSingle(Platform::String^ key, float value)
00048 {
00049     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00050     if (m_settingsValues->HasKey(fullKey))
00051     {
00052         m_settingsValues->Remove(fullKey);
00053     }
00054     m_settingsValues->Insert(fullKey, PropertyValue::CreateSingle(value));
00055 }
00056
00057 void PersistentState::SaveXMFLOAT3(Platform::String^ key, DirectX::XMFLOAT3 value)
00058 {
00059     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00060     if (m_settingsValues->HasKey(fullKey))
00061     {
00062         m_settingsValues->Remove(fullKey);
00063     }
00064     Platform::Array<float>^ array3 = ref new Platform::Array<float>(3);
00065     array3[0] = value.x;
00066     array3[1] = value.y;
00067     array3[2] = value.z;
00068     m_settingsValues->Insert(fullKey, PropertyValue::CreateSingleArray(array3));
00069 }
00070
00071 void PersistentState::SaveString(Platform::String^ key, Platform::String^ string)
00072 {
00073     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00074     if (m_settingsValues->HasKey(fullKey))
00075     {
00076         m_settingsValues->Remove(fullKey);
00077     }
00078     m_settingsValues->Insert(fullKey, PropertyValue::CreateString(string));
00079 }
00080
00081 bool PersistentState::LoadBool(Platform::String^ key, bool defaultValue)
00082 {
00083     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00084     if (m_settingsValues->HasKey(fullKey))
00085     {
00086         int state = safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetInt32();
00087         return state ? true : false;
00088     }
00089     return defaultValue;
00090 }
00091
00092 int PersistentState::LoadInt32(Platform::String^ key, int defaultValue)
00093 {
00094     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00095     if (m_settingsValues->HasKey(fullKey))
00096     {
00097         return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetInt32();
00098     }
00099     return defaultValue;
00100 }
00101
00102 float PersistentState::LoadSingle(Platform::String^ key, float defaultValue)
00103 {
00104     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00105     if (m_settingsValues->HasKey(fullKey))
00106     {
00107         return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetSingle();
00108     }
00109     return defaultValue;
00110 }
00111
00112 XMFLOAT3 PersistentState::LoadXMFLOAT3(Platform::String^ key, DirectX::XMFLOAT3 defaultValue)
00113 {
00114     XMFLOAT3 value;
00115     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00116     if (m_settingsValues->HasKey(fullKey))
00117     {
00118         Platform::Array<float>^ array3;
00119         safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetSingleArray(&array3);
00120         value.x = array3[0];
00121         value.y = array3[1];
00122         value.z = array3[2];
00123         return value;
00124     }
00125     return defaultValue;
00126 }
00127
00128 Platform::String^ PersistentState::LoadString(Platform::String^ key, Platform::String^ defaultValue)
00129 {
00130     Platform::String^ fullKey = Platform::String::Concat(m_keyName, key);
00131     if (m_settingsValues->HasKey(fullKey))
00132     {
00133         return safe_cast<IPropertyValue^>(m_settingsValues->Lookup(fullKey))->GetString();
00134     }
00135     return defaultValue;
00136 }
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetUid Member List

This is the complete list of members for GetUid, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetUid() | GetUid | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/pch.h Source File

  • WindowsAudioSession
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <windows.h>
00008 #include <hstring.h>
00009 #include <winrt/Windows.ApplicationModel.Activation.h>
00010 #include <winrt/Windows.Devices.Enumeration.h>
00011 #include <winrt/Windows.Foundation.h>
00012 #include <winrt/Windows.Foundation.Collections.h>
00013 #include <winrt/Windows.Media.Devices.h>
00014 #include <winrt/Windows.Storage.h>
00015 #include <winrt/Windows.Storage.Pickers.h>
00016 #include <winrt/Windows.Storage.Streams.h>
00017 #include <winrt/Windows.System.h>
00018 #include <winrt/Windows.System.Threading.h>
00019 #include <winrt/Windows.UI.Core.h>
00020 #include <winrt/Windows.UI.Xaml.h>
00021 #include <winrt/Windows.UI.Xaml.Automation.Peers.h>
00022 #include <winrt/Windows.UI.Xaml.Controls.h>
00023 #include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
00024 #include <winrt/Windows.UI.Xaml.Documents.h>
00025 #include <winrt/Windows.UI.Xaml.Interop.h>
00026 #include <winrt/Windows.UI.Xaml.Markup.h>
00027 #include <winrt/Windows.UI.Xaml.Media.h>
00028 #include <winrt/Windows.UI.Xaml.Navigation.h>
00029 #include <winrt/Windows.UI.Xaml.Shapes.h>
00030 #include <winrt/SDKTemplate.h>
00031 #include <forward_list>
00032
00033 #include <mmreg.h>
00034 #include <mmdeviceapi.h>
00035 #include <mfapi.h>
00036 #include <mfidl.h>
00037 #include <mfreadwrite.h>
00038 #include <mferror.h>
00039 #include <AudioClient.h>
00040
00041 #include "Common.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneObject.cpp Source File

  • HolographicSpatialStage
  • cpp
  • Content

SceneObject.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SceneObject.h"
00003
00004 #include "Common\DirectXHelper.h"
00005
00006 #include <ppltasks.h>
00007
00008 using namespace HolographicSpatialStage;
00009
00010 using namespace Concurrency;
00011 using namespace DirectX;
00012 using namespace Windows::Perception::Spatial;
00013
00014
00015 SceneObject::SceneObject(
00016     const std::shared_ptr<DX::DeviceResources>& deviceResources,
00017     DirectX::XMFLOAT3 const& color,
00018     SpatialCoordinateSystem^ coordinateSystem)
00019     : SceneObject(deviceResources, c_cubeVertices, color, coordinateSystem)
00020 {
00021 }
00022
00023 SceneObject::SceneObject(
00024     const std::shared_ptr<DX::DeviceResources>& deviceResources,
00025     std::vector<DirectX::XMFLOAT3> const& vertices,
00026     DirectX::XMFLOAT3 const& color,
00027     SpatialCoordinateSystem^ coordinateSystem)
00028     : SceneObject(deviceResources, vertices, c_cubeIndices, color, coordinateSystem)
00029 {
00030 }
00031
00032 SceneObject::SceneObject(
00033     const std::shared_ptr<DX::DeviceResources>& deviceResources,
00034     std::vector<DirectX::XMFLOAT3> const& vertices,
00035     std::vector<unsigned short> const& indices,
00036     DirectX::XMFLOAT3 const& color,
00037     Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem)
00038 {
00039     m_coordinateSystem = coordinateSystem;
00040     m_deviceResources = deviceResources;
00041
00042     m_vertices.resize(vertices.size());
00043     for (size_t i = 0; i < vertices.size(); ++i)
00044     {
00045         m_vertices[i].pos = vertices[i];
00046         m_vertices[i].color = color;
00047     }
00048
00049     m_indices = indices;
00050     m_indexCount = unsigned int(m_indices.size());
00051
00052     CreateDeviceDependentResources();
00053 }
00054
00055 void SceneObject::Update(const DX::StepTimer& timer, Windows::Perception::Spatial::SpatialCoordinateSystem^ viewCoords)
00056 {
00057     if (viewCoords == nullptr)
00058     {
00059         return;
00060     }
00061
00062     // Try to get transform.
00063     auto transformContainer = m_coordinateSystem->TryGetTransformTo(viewCoords);
00064     if (m_canRenderThisFrame = (transformContainer != nullptr))
00065     {
00066         const XMMATRIX modelTransform = XMLoadFloat4x4(&transformContainer->Value);
00067         XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
00068     }
00069
00070     // Loading is asynchronous. Resources must be created before they can be updated.
00071     if (!m_loadingComplete || !m_canRenderThisFrame)
00072     {
00073         return;
00074     }
00075
00076     // Use the D3D device context to update Direct3D device-based resources.
00077     const auto context = m_deviceResources->GetD3DDeviceContext();
00078
00079     // Update the model transform buffer for the hologram.
00080     context->UpdateSubresource(
00081         m_modelConstantBuffer.Get(),
00082         0,
00083         nullptr,
00084         &m_modelConstantBufferData,
00085         0,
00086         0
00087     );
00088 }
00089
00090 void SceneObject::Render()
00091 {
00092     // Loading is asynchronous. Resources must be created before drawing can occur.
00093     // Our coordinate system must also be locatable.
00094     if (!m_loadingComplete || !m_canRenderThisFrame)
00095     {
00096         return;
00097     }
00098
00099     const auto context = m_deviceResources->GetD3DDeviceContext();
00100
00101     // Each vertex is one instance of the VertexPositionColor struct.
00102     const UINT stride = sizeof(VertexPositionColor);
00103     const UINT offset = 0;
00104     context->IASetVertexBuffers(
00105         0,
00106         1,
00107         m_vertexBuffer.GetAddressOf(),
00108         &stride,
00109         &offset
00110     );
00111     context->IASetIndexBuffer(
00112         m_indexBuffer.Get(),
00113         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00114         0
00115     );
00116     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00117     context->IASetInputLayout(m_inputLayout.Get());
00118
00119     if (m_useWireframe)
00120     {
00121         // Use a wireframe rasterizer state.
00122         m_deviceResources->GetD3DDeviceContext()->RSSetState(m_wireframeRasterizerState.Get());
00123     }
00124     else
00125     {
00126         // Use the default rasterizer state.
00127         m_deviceResources->GetD3DDeviceContext()->RSSetState(m_defaultRasterizerState.Get());
00128     }
00129
00130     // Attach the vertex shader.
00131     context->VSSetShader(
00132         m_vertexShader.Get(),
00133         nullptr,
00134         0
00135     );
00136     // Apply the model constant buffer to the vertex shader.
00137     context->VSSetConstantBuffers(
00138         0,
00139         1,
00140         m_modelConstantBuffer.GetAddressOf()
00141     );
00142
00143     if (!m_usingVprtShaders)
00144     {
00145         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00146         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00147         // a pass-through geometry shader is used to set the render target
00148         // array index.
00149         context->GSSetShader(
00150             m_geometryShader.Get(),
00151             nullptr,
00152             0
00153         );
00154     }
00155
00156     // Attach the pixel shader.
00157     context->PSSetShader(
00158         m_pixelShader.Get(),
00159         nullptr,
00160         0
00161     );
00162
00163     // Draw the objects.
00164     context->DrawIndexedInstanced(
00165         m_indexCount,   // Index count per instance.
00166         2,              // Instance count.
00167         0,              // Start index location.
00168         0,              // Base vertex location.
00169         0               // Start instance location.
00170     );
00171 }
00172
00173 void SceneObject::CreateDeviceDependentResources()
00174 {
00175     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00176
00177     // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00178     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00179     // we can avoid using a pass-through geometry shader to set the render
00180     // target array index, thus avoiding any overhead that would be
00181     // incurred by setting the geometry shader stage.
00182     std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";
00183
00184     // Load shaders asynchronously.
00185     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
00186     task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");
00187
00188     task<std::vector<byte>> loadGSTask;
00189     if (!m_usingVprtShaders)
00190     {
00191         // Load the pass-through geometry shader.
00192         loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
00193     }
00194
00195     // After the vertex shader file is loaded, create the shader and input layout.
00196     task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
00197     {
00198         DX::ThrowIfFailed(
00199             m_deviceResources->GetD3DDevice()->CreateVertexShader(
00200                 fileData.data(),
00201                 fileData.size(),
00202                 nullptr,
00203                 &m_vertexShader
00204             )
00205         );
00206
00207         constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
00208             { {
00209                 { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00210                 { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00211             } };
00212
00213         DX::ThrowIfFailed(
00214             m_deviceResources->GetD3DDevice()->CreateInputLayout(
00215                 vertexDesc.data(),
00216                 static_cast<UINT>(vertexDesc.size()),
00217                 fileData.data(),
00218                 static_cast<UINT>(fileData.size()),
00219                 &m_inputLayout
00220             )
00221         );
00222     });
00223
00224     // After the pixel shader file is loaded, create the shader and constant buffer.
00225     task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
00226     {
00227         DX::ThrowIfFailed(
00228             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00229                 fileData.data(),
00230                 fileData.size(),
00231                 nullptr,
00232                 &m_pixelShader
00233             )
00234         );
00235
00236         const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00237         DX::ThrowIfFailed(
00238             m_deviceResources->GetD3DDevice()->CreateBuffer(
00239                 &constantBufferDesc,
00240                 nullptr,
00241                 &m_modelConstantBuffer
00242             )
00243         );
00244     });
00245
00246     task<void> createGSTask;
00247     if (!m_usingVprtShaders)
00248     {
00249         // After the pass-through geometry shader file is loaded, create the shader.
00250         createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
00251         {
00252             DX::ThrowIfFailed(
00253                 m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00254                     fileData.data(),
00255                     fileData.size(),
00256                     nullptr,
00257                     &m_geometryShader
00258                 )
00259             );
00260         });
00261     }
00262
00263     // Once all shaders are loaded, create the mesh.
00264     task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
00265     task<void> createGeometryTask = shaderTaskGroup.then([this]()
00266     {
00267         // Load mesh vertices. Each vertex has a position and a color.
00268         D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
00269         vertexBufferData.pSysMem = m_vertices.data();
00270         vertexBufferData.SysMemPitch = 0;
00271         vertexBufferData.SysMemSlicePitch = 0;
00272         const CD3D11_BUFFER_DESC vertexBufferDesc(
00273             sizeof(VertexPositionColor) * static_cast<UINT>(m_vertices.size()),
00274             D3D11_BIND_VERTEX_BUFFER);
00275         DX::ThrowIfFailed(
00276             m_deviceResources->GetD3DDevice()->CreateBuffer(
00277                 &vertexBufferDesc,
00278                 &vertexBufferData,
00279                 &m_vertexBuffer
00280             )
00281         );
00282
00283         D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
00284         indexBufferData.pSysMem = m_indices.data();
00285         indexBufferData.SysMemPitch = 0;
00286         indexBufferData.SysMemSlicePitch = 0;
00287         CD3D11_BUFFER_DESC indexBufferDesc(
00288             sizeof(unsigned short) * static_cast<UINT>(m_indices.size()),
00289             D3D11_BIND_INDEX_BUFFER);
00290         DX::ThrowIfFailed(
00291             m_deviceResources->GetD3DDevice()->CreateBuffer(
00292                 &indexBufferDesc,
00293                 &indexBufferData,
00294                 &m_indexBuffer
00295             )
00296         );
00297     });
00298
00299     // Once the geometry is loaded, the object is ready to be rendered.
00300     createGeometryTask.then([this]()
00301     {
00302         // Create the default rasterizer state.
00303         D3D11_RASTERIZER_DESC rasterizerDesc = CD3D11_RASTERIZER_DESC(D3D11_DEFAULT);
00304         m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_defaultRasterizerState.GetAddressOf());
00305
00306         // Create a wireframe rasterizer state.
00307         rasterizerDesc.AntialiasedLineEnable = true;
00308         rasterizerDesc.CullMode = D3D11_CULL_NONE;
00309         rasterizerDesc.FillMode = D3D11_FILL_WIREFRAME;
00310         m_deviceResources->GetD3DDevice()->CreateRasterizerState(&rasterizerDesc, m_wireframeRasterizerState.GetAddressOf());
00311
00312         m_loadingComplete = true;
00313     });
00314 }
00315
00316 void SceneObject::ReleaseDeviceDependentResources()
00317 {
00318     m_loadingComplete = false;
00319     m_usingVprtShaders = false;
00320     m_vertexShader.Reset();
00321     m_inputLayout.Reset();
00322     m_pixelShader.Reset();
00323     m_geometryShader.Reset();
00324     m_modelConstantBuffer.Reset();
00325     m_vertexBuffer.Reset();
00326     m_indexBuffer.Reset();
00327     m_defaultRasterizerState.Reset();
00328     m_wireframeRasterizerState.Reset();
00329 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario2_SupportedTactileFeedback.h Source File

  • PenHaptics
  • cppwinrt

Scenario2_SupportedTactileFeedback.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_SupportedTactileFeedback.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_SupportedTactileFeedback : Scenario2_SupportedTactileFeedbackT<Scenario2_SupportedTactileFeedback>
00019     {
00020         Scenario2_SupportedTactileFeedback();
00021
00022         void Pointer_Entered(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00023         void Pointer_Exited(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00024
00025     private:
00026         Windows::Devices::Haptics::SimpleHapticsController hapticsController{ nullptr };
00027         Windows::Devices::Input::PenDevice penDevice{ nullptr };
00028     };
00029 }
00030
00031 namespace winrt::SDKTemplate::factory_implementation
00032 {
00033     struct Scenario2_SupportedTactileFeedback : Scenario2_SupportedTactileFeedbackT<Scenario2_SupportedTactileFeedback, implementation::Scenario2_SupportedTactileFeedback>
00034     {
00035     };
00036 }
Generated on Fri Nov 15 2024 22:20:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/SampleConfiguration.h Source File

  • LampArray
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace std
00016 {
00017     std::wstring to_wstring(winrt::Windows::Devices::Lights::LampArrayKind lampArrayKind);
00018 }
00019
00020 namespace winrt::SDKTemplate
00021 {
00022     struct LampArrayInfo
00023     {
00024         LampArrayInfo(winrt::hstring const& id, winrt::hstring const& displayName, winrt::Windows::Devices::Lights::LampArray const& lampArray)
00025             : id(id), displayName(displayName), lampArray(lampArray)
00026         {
00027         }
00028
00029         winrt::hstring const id;
00030         winrt::hstring const displayName;
00031         winrt::Windows::Devices::Lights::LampArray const lampArray;
00032
00033         winrt::Windows::Devices::Lights::LampArray::AvailabilityChanged_revoker availabilityChangedRevoker;
00034     };
00035 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario4_CompositeSettings.h Source File

  • ApplicationData
  • cppwinrt

Scenario4_CompositeSettings.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_CompositeSettings.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario4_CompositeSettings : Scenario4_CompositeSettingsT<Scenario4_CompositeSettings>
00020     {
00021         Scenario4_CompositeSettings();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         void WriteCompositeSetting_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         void DeleteCompositeSetting_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027     private:
00028
00029         void DisplayOutput();
00030
00031         Windows::Storage::ApplicationDataContainer localSettings = Windows::Storage::ApplicationData::Current().LocalSettings();
00032
00033         inline static const auto settingName = L"exampleCompositeSetting";
00034         inline static const auto settingName1 = L"one";
00035         inline static const auto settingName2 = L"hello";
00036     };
00037 }
00038
00039 namespace winrt::SDKTemplate::factory_implementation
00040 {
00041     struct Scenario4_CompositeSettings : Scenario4_CompositeSettingsT<Scenario4_CompositeSettings, implementation::Scenario4_CompositeSettings>
00042     {
00043     };
00044 }
00045
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S6_DeleteWithAppContent.xaml.cs Source File

  • ContentIndexer
  • cs

S6_DeleteWithAppContent.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class S6_DeleteWithAppContent
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public S6_DeleteWithAppContent()
00029         {
00030             this.InitializeComponent();
00031             Helpers.InitializeRevisionNumber();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when this page is about to be displayed in a Frame.
00036         /// </summary>
00037         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00038         /// property is typically used to configure the page.</param>
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041         }
00042
00043         private async void AddToIndex_Click(object sender, RoutedEventArgs e)
00044         {
00045             var outputString = await Helpers.AddAppContentFilesToIndexedFolder();
00046             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00047         }
00048
00049         /// <summary>
00050         /// This function deletes a single appcontent-ms file, "sample1.appcontent-ms". Upon deletion, the indexer is notified
00051         /// and the content indexed from this file is removed from the index.
00052         /// </summary>
00053         private async void DeleteSingleItem_Click(object sender, RoutedEventArgs e)
00054         {
00055             var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00056             var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
00057             try
00058             {
00059                 var file = await indexedFolder.GetFileAsync("sample1.appcontent-ms");
00060                 await file.DeleteAsync();
00061                 rootPage.NotifyUser("Items deleted from the \"Indexed\" folder: " + file.DisplayName, NotifyType.StatusMessage);
00062             }
00063             catch (Exception err)
00064             {
00065                 rootPage.NotifyUser("Exception thrown! Did you already delete the \"sample1.appcontent-ms\" file?" +
00066                                     "\nMessage: " + err.Message +
00067                                     "\nHRESULT: " + String.Format("{0,8:X}", err.HResult),
00068                                     NotifyType.ErrorMessage);
00069             }
00070         }
00071
00072         /// <summary>
00073         /// This function deletes all appcontent-ms files in the "LocalState\Indexed" folder. Upon deletion, the indexer is notified and
00074         /// the content indexed from these files is removed from the index.
00075         /// </summary>
00076         private async void DeleteAllItems_Click(object sender, RoutedEventArgs e)
00077         {
00078             var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00079             var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
00080             var files = await indexedFolder.GetFilesAsync();
00081             var outputString = "Items deleted from the \"Indexed\" folder:";
00082             foreach (var file in files)
00083             {
00084                 outputString += "\n" + file.DisplayName;
00085                 await file.DeleteAsync();
00086             }
00087             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00088         }
00089     }
00090 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/D2DAdvancedColorImagesRenderer.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

D2DAdvancedColorImagesRenderer.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "DeviceResources.h"
00015 #include "ReinhardEffect.h"
00016 #include "FilmicEffect.h"
00017 #include "SdrOverlayEffect.h"
00018 #include "LuminanceHeatmapEffect.h"
00019 #include "RenderOptions.h"
00020
00021 namespace D2DAdvancedColorImages
00022 {
00023     struct ImageInfo
00024     {
00025         unsigned int                                    bitsPerPixel;
00026         unsigned int                                    bitsPerChannel;
00027         bool                                            isFloat;
00028         Windows::Foundation::Size                       size;
00029         unsigned int                                    numProfiles;
00030         Windows::Graphics::Display::AdvancedColorKind   imageKind;
00031     };
00032
00033     class D2DAdvancedColorImagesRenderer : public DX::IDeviceNotify
00034     {
00035     public:
00036         D2DAdvancedColorImagesRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00037         ~D2DAdvancedColorImagesRenderer();
00038
00039         void CreateDeviceIndependentResources();
00040         void CreateDeviceDependentResources();
00041         void CreateWindowSizeDependentResources();
00042         void ReleaseDeviceDependentResources();
00043
00044         void Draw();
00045
00046         void CreateImageDependentResources();
00047         void ReleaseImageDependentResources();
00048
00049         void UpdateManipulationState(_In_ Windows::UI::Input::ManipulationUpdatedEventArgs^ args);
00050
00051         // Returns the computed MaxCLL of the image in nits. While HDR metadata is a
00052         // property of the image (and independent of rendering), our implementation
00053         // can't compute it until this point.
00054         float FitImageToWindow();
00055         void SetRenderOptions(
00056             RenderEffectKind effect,
00057             float brightnessAdjustment,
00058             Windows::Graphics::Display::AdvancedColorInfo^ acInfo
00059             );
00060
00061         ImageInfo LoadImageFromWic(_In_ IStream* imageStream);
00062
00063         void PopulateImageInfoACKind(_Inout_ ImageInfo* info);
00064
00065         // IDeviceNotify methods handle device lost and restored.
00066         virtual void OnDeviceLost();
00067         virtual void OnDeviceRestored();
00068
00069     private:
00070         inline static float Clamp(float v, float bound1, float bound2)
00071         {
00072             float low = min(bound1, bound2);
00073             float high = max(bound1, bound2);
00074             return (v < low) ? low : (v > high) ? high : v;
00075         }
00076
00077         ImageInfo LoadImageCommon(_In_ IWICBitmapSource* source);
00078         void CreateHistogramResources();
00079
00080         void UpdateImageColorContext();
00081         void UpdateWhiteLevelScale(float brightnessAdjustment, float sdrWhiteLevel);
00082         void UpdateImageTransformState();
00083         void ComputeHdrMetadata();
00084         void EmitHdrMetadata();
00085
00086         // Cached pointer to device resources.
00087         std::shared_ptr<DX::DeviceResources>                    m_deviceResources;
00088
00089         // WIC and Direct2D resources.
00090         Microsoft::WRL::ComPtr<IWICFormatConverter>             m_formatConvert;
00091         Microsoft::WRL::ComPtr<IWICColorContext>                m_wicColorContext;
00092         Microsoft::WRL::ComPtr<ID2D1ImageSourceFromWic>         m_imageSource;
00093         Microsoft::WRL::ComPtr<ID2D1TransformedImageSource>     m_scaledImage;
00094         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_colorManagementEffect;
00095         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_whiteScaleEffect;
00096         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_reinhardEffect;
00097         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_filmicEffect;
00098         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_sdrOverlayEffect;
00099         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_heatmapEffect;
00100         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_histogramPrescale;
00101         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_histogramEffect;
00102         Microsoft::WRL::ComPtr<ID2D1Effect>                     m_finalOutput;
00103
00104         // Other renderer members.
00105         RenderEffectKind                                        m_renderEffectKind;
00106         float                                                   m_zoom;
00107         float                                                   m_minZoom;
00108         D2D1_POINT_2F                                           m_imageOffset;
00109         D2D1_POINT_2F                                           m_pointerPos;
00110         float                                                   m_maxCLL; // In nits.
00111         float                                                   m_brightnessAdjust;
00112         Windows::Graphics::Display::AdvancedColorInfo^          m_dispInfo;
00113         ImageInfo                                               m_imageInfo;
00114         bool                                                    m_isComputeSupported;
00115     };
00116 }
Generated on Fri Nov 15 2024 22:19:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ServerForeground Member List

This is the complete list of members for Scenario3_ServerForeground, including all inherited members.
CalculatorCharacteristics enum name | Scenario3_ServerForeground | [private]
CalculatorOperators enum name | Scenario3_ServerForeground | [private]
CheckPeripheralRoleSupportAsync() | Scenario3_ServerForeground | [inline, private]
ComputeResult() | Scenario3_ServerForeground | [inline, private]
NotifyClientDevices(int computedValue) | Scenario3_ServerForeground | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_ServerForeground | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_ServerForeground | [inline, protected]
op1Characteristic | Scenario3_ServerForeground | [private]
Op1Characteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [inline, private]
op2Characteristic | Scenario3_ServerForeground | [private]
Op2Characteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [inline, private]
operand1Received | Scenario3_ServerForeground | [private]
operand2Received | Scenario3_ServerForeground | [private]
operatorCharacteristic | Scenario3_ServerForeground | [private]
OperatorCharacteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [inline, private]
operatorReceived | Scenario3_ServerForeground | [private]
peripheralSupported | Scenario3_ServerForeground | [private]
ProcessWriteCharacteristic(GattWriteRequest request, CalculatorCharacteristics opCode) | Scenario3_ServerForeground | [inline, private]
PublishButton_ClickAsync() | Scenario3_ServerForeground | [inline, private]
resultCharacteristic | Scenario3_ServerForeground | [private]
ResultCharacteristic_ReadRequestedAsync(GattLocalCharacteristic sender, GattReadRequestedEventArgs args) | Scenario3_ServerForeground | [inline, private]
ResultCharacteristic_SubscribedClientsChanged(GattLocalCharacteristic sender, object args) | Scenario3_ServerForeground | [inline, private]
resultVal | Scenario3_ServerForeground | [private]
rootPage | Scenario3_ServerForeground | [private]
Scenario3_ServerForeground() | Scenario3_ServerForeground | [inline]
serviceProvider | Scenario3_ServerForeground | [private]
ServiceProvider_AdvertisementStatusChanged(GattServiceProvider sender, GattServiceProviderAdvertisementStatusChangedEventArgs args) | Scenario3_ServerForeground | [inline, private]
ServiceProviderInitAsync() | Scenario3_ServerForeground | [inline, private]
UpdateUX() | Scenario3_ServerForeground | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
_advancedCapture | sealed | [private]
_advancedCaptureMode | sealed | [private]
_allPhotosCapturedEventToken | sealed | [private]
_applicationResumingEventToken | sealed | [private]
_applicationSuspendingEventToken | sealed | [private]
_captureFolder | sealed | [private]
_deviceOrientation | sealed | [private]
_displayInformation | sealed | [private]
_displayInformationEventToken | sealed | [private]
_displayOrientation | sealed | [private]
_displayRequest | sealed | [private]
_externalCamera | sealed | [private]
_hardwareCameraButtonEventToken | sealed | [private]
_isInitialized | sealed | [private]
_isPreviewing | sealed | [private]
_mediaCapture | sealed | [private]
_mediaCaptureFailedEventToken | sealed | [private]
_mediaControlPropChangedEventToken | sealed | [private]
_mirroringPreview | sealed | [private]
_optionalRefPhotoCapturedEventToken | sealed | [private]
_orientationChangedEventToken | sealed | [private]
_orientationSensor | sealed | [private]
_sceneAnalysisEffect | sealed | [private]
_sceneAnalyzedEventToken | sealed | [private]
_systemMediaControls | sealed | [private]
AdvancedCapture_AllPhotosCaptured(Windows::Media::Capture::AdvancedPhotoCapture^sender, Object^args) | sealed | [private]
AdvancedCapture_OptionalReferencePhotoCaptured(Windows::Media::Capture::AdvancedPhotoCapture^sender, Windows::Media::Capture::OptionalReferencePhotoCapturedEventArgs^args) | sealed | [private]
Application_Resuming(Object^sender, Object^args) | sealed | [private]
Application_Suspending(Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
CERTAINTY_CAP | sealed | [private]
CleanSceneAnalysisEffectAsync() | sealed | [private]
CleanupCameraAsync() | sealed | [private]
CleanupUiAsync() | sealed | [private]
ConvertDeviceOrientationToDegrees(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
ConvertDisplayOrientationToDegrees(Windows::Graphics::Display::DisplayOrientations orientation) | sealed | [private]
ConvertOrientationToPhotoOrientation(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
CreateSceneAnalysisEffectAsync() | sealed | [private]
CycleAdvancedCaptureMode() | sealed | [private]
CycleModeButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DisableAdvancedCaptureAsync() | sealed | [private]
DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation^sender, Object^args) | sealed | [private]
EmptyTask() | sealed | [private]
EnableAdvancedCaptureAsync() | sealed | [private]
Encoder | sealed |
File | sealed |
FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel) | sealed | [private]
GetCameraOrientation() | sealed | [private]
GetTimeStr() | sealed | [private, static]
HardwareButtons_CameraPress(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
InitializeCameraAsync() | sealed | [private]
MainPage() | sealed |
MediaCapture_Failed(Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs) | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
Orientation | sealed |
OrientationSensor_OrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^) | sealed | [private]
PhotoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ReencodeAndSavePhotoAsync(Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation) | sealed | [private]
RegisterEventHandlers() | sealed | [private]
RotationKey | sealed | [private]
SceneAnalysisEffect_SceneAnalyzed(Windows::Media::Core::SceneAnalysisEffect^sender, Windows::Media::Core::SceneAnalyzedEventArgs^args) | sealed | [private]
SetPreviewRotationAsync() | sealed | [private]
SetupUiAsync() | sealed | [private]
StartPreviewAsync() | sealed | [private]
StopPreviewAsync() | sealed | [private]
StringReplace(std::wstring &string, const std::wstring &removalStr, const std::wstring &replacementStr) | sealed | [private, static]
SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args) | sealed | [private]
TakeAdvancedCapturePhotoAsync() | sealed | [private]
UnregisterEventHandlers() | sealed | [private]
UpdateControlOrientation() | sealed | [private]
UpdateUi() | sealed | [private]
WriteException(Platform::Exception^ex) | sealed | [private]
WriteLine(Platform::String^str) | sealed | [private]
~MainPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesProvider/SampleConfiguration.cs Source File

  • AppServices
  • cs
  • AppServicesProvider

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "App service provider sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Show Package Family Name", ClassType=typeof(ShowPackageFamilyName)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario6.xaml.cpp Source File

  • FileThumbnails
  • cpp

Scenario6.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.cpp
00014 // Implementation of the Scenario1 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario6.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Storage;
00025 using namespace Windows::Storage::FileProperties;
00026 using namespace Windows::Storage::Pickers;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 Scenario6::Scenario6()
00032 {
00033     InitializeComponent();
00034     rootPage = MainPage::Current;
00035 }
00036
00037 void Scenario6::OnNavigatedTo(NavigationEventArgs^ e)
00038 {
00039     rootPage->ResetOutput(ThumbnailImage, OutputTextBlock, nullptr);
00040 }
00041
00042 void Scenario6::SelectImageButton_Click(Object^ sender, RoutedEventArgs^ e)
00043 {
00044     rootPage->ResetOutput(ThumbnailImage, OutputTextBlock, nullptr);
00045
00046     // Pick a photo
00047     FileOpenPicker^ openPicker = ref new FileOpenPicker();
00048     for (String^ ext : FileExtensions::Image)
00049     {
00050         openPicker->FileTypeFilter->Append(ext);
00051     }
00052
00053     ThumbnailMode thumbnailMode = ThumbnailMode::SingleItem;
00054     String^ thumbnailModeName = thumbnailMode.ToString();
00055
00056     const unsigned int size = _wtoi(RequestSize->Text->Data());
00057     if (size > 0)
00058     {
00059         bool fastThumbnail = FastThumbnailCheckBox->IsChecked->Value;
00060         ThumbnailOptions thumbnailOptions = ThumbnailOptions::UseCurrentScale;
00061         if (fastThumbnail)
00062         {
00063             thumbnailOptions = thumbnailOptions | ThumbnailOptions::ReturnOnlyIfCached;
00064         }
00065
00066         create_task(openPicker->PickSingleFileAsync()).then([this, thumbnailMode, thumbnailModeName, thumbnailOptions, fastThumbnail, size](StorageFile^ file)
00067         {
00068             if (file != nullptr)
00069             {
00070                 create_task(file->GetScaledImageAsThumbnailAsync(thumbnailMode, size, thumbnailOptions)).then([this, file, thumbnailMode, thumbnailModeName, thumbnailOptions, fastThumbnail, size](StorageItemThumbnail^ thumbnail)
00071                 {
00072                     if (thumbnail != nullptr)
00073                     {
00074                         MainPage::DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailModeName, size, file, thumbnail, false);
00075                     }
00076                     else if (fastThumbnail)
00077                     {
00078                         rootPage->NotifyUser(Errors::NoExifThumbnail, NotifyType::StatusMessage);
00079                     }
00080                     else
00081                     {
00082                         rootPage->NotifyUser(Errors::NoThumbnail, NotifyType::StatusMessage);
00083                     }
00084                 });
00085             }
00086             else
00087             {
00088                 rootPage->NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00089             }
00090         });
00091     }
00092     else
00093     {
00094         rootPage->NotifyUser(Errors::InvalidSize, NotifyType::ErrorMessage);
00095     }
00096 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/App.xaml.cpp Source File

  • CameraVideoStabilization
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014
00015 using namespace CameraVideoStabilization;
00016 using namespace Platform;
00017 using namespace Windows::ApplicationModel;
00018 using namespace Windows::ApplicationModel::Activation;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Interop;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 /// <summary>
00031 /// Initializes the singleton application object.  This is the first line of authored code
00032 /// executed, and as such is the logical equivalent of main() or WinMain().
00033 /// </summary>
00034 App::App()
00035 {
00036     InitializeComponent();
00037     Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
00038 }
00039
00040 /// <summary>
00041 /// Invoked when the application is launched normally by the end user.  Other entry points
00042 /// will be used such as when the application is launched to open a specific file.
00043 /// </summary>
00044 /// <param name="e">Details about the launch request and process.</param>
00045 void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
00046 {
00047
00048 #if _DEBUG
00049         // Show graphics profiling information while debugging.
00050         if (IsDebuggerPresent())
00051         {
00052             // Display the current frame rate counters
00053              DebugSettings->EnableFrameRateCounter = true;
00054         }
00055 #endif
00056
00057     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00058
00059     // Do not repeat app initialization when the Window already has content,
00060     // just ensure that the window is active
00061     if (rootFrame == nullptr)
00062     {
00063         // Create a Frame to act as the navigation context and associate it with
00064         // a SuspensionManager key
00065         rootFrame = ref new Frame();
00066
00067         // Set the default language
00068         rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
00069
00070         rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00071
00072         if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00073         {
00074             // Restore the saved session state only when appropriate, scheduling the
00075             // final launch steps after the restore is complete
00076
00077         }
00078
00079         if (rootFrame->Content == nullptr)
00080         {
00081             // When the navigation stack isn't restored navigate to the first page,
00082             // configuring the new page by passing required information as a navigation
00083             // parameter
00084             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00085         }
00086         // Place the frame in the current Window
00087         Window::Current->Content = rootFrame;
00088         // Ensure the current window is active
00089         Window::Current->Activate();
00090     }
00091     else
00092     {
00093         if (rootFrame->Content == nullptr)
00094         {
00095             // When the navigation stack isn't restored navigate to the first page,
00096             // configuring the new page by passing required information as a navigation
00097             // parameter
00098             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00099         }
00100         // Ensure the current window is active
00101         Window::Current->Activate();
00102     }
00103 }
00104
00105 /// <summary>
00106 /// Invoked when application execution is being suspended.  Application state is saved
00107 /// without knowing whether the application will be terminated or resumed with the contents
00108 /// of memory still intact.
00109 /// </summary>
00110 /// <param name="sender">The source of the suspend request.</param>
00111 /// <param name="e">Details about the suspend request.</param>
00112 void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
00113 {
00114     (void) sender;  // Unused parameter
00115     (void) e;   // Unused parameter
00116
00117     // Save application state and stop any background activity
00118 }
00119
00120 /// <summary>
00121 /// Invoked when Navigation to a certain page fails
00122 /// </summary>
00123 /// <param name="sender">The Frame which failed navigation</param>
00124 /// <param name="e">Details about the navigation failure</param>
00125 void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
00126 {
00127     throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
00128 }
Generated on Fri Nov 15 2024 22:16:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMemoryBufferByteAccess Member List

This is the complete list of members for IMemoryBufferByteAccess, including all inherited members.
GetBuffer(out byte *buffer, out uint capacity) IMemoryBufferByteAccess
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
AppView() | sealed |
CreateView() | sealed | [virtual]
CreateView() | sealed |
holographicView | sealed | [private]
Initialize(Windows::ApplicationModel::Core::CoreApplicationView^applicationView) | sealed | [virtual]
Initialize(winrt::Windows::ApplicationModel::Core::CoreApplicationView const &applicationView) | sealed |
Load(Platform::String^entryPoint) | sealed | [virtual]
Load(winrt::hstring const &entryPoint) | sealed |
m_deviceResources | sealed | [private]
m_holographicSpace | sealed | [private]
m_holographicSpace | sealed | [private]
m_keyDownEventToken | sealed | [private]
m_main | sealed | [private]
m_pointerPressedEventToken | sealed | [private]
m_resumingEventToken | sealed | [private]
m_suspendingEventToken | sealed | [private]
m_visibilityChangedEventToken | sealed | [private]
m_windowClosed | sealed | [private]
m_windowClosedEventToken | sealed | [private]
m_windowVisible | sealed | [private]
OnKeyPressed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args) | sealed | [protected]
OnKeyPressed(winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::KeyEventArgs const &args) | sealed | [protected]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args) | sealed | [protected]
OnLaunched(winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &args) | sealed | [protected]
OnPointerPressed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::PointerEventArgs^args) | sealed | [protected]
OnPointerPressed(winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::PointerEventArgs const &args) | sealed | [protected]
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [protected]
OnResuming(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::Foundation::IInspectable const &args) | sealed | [protected]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [protected]
OnSuspending(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::ApplicationModel::SuspendingEventArgs const &args) | sealed | [protected]
OnViewActivated(Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args) | sealed | [protected]
OnViewActivated(winrt::Windows::ApplicationModel::Core::CoreApplicationView const &sender, winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs const &args) | sealed | [protected]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [protected]
OnVisibilityChanged(winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::VisibilityChangedEventArgs const &args) | sealed | [protected]
OnWindowClosed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args) | sealed | [protected]
OnWindowClosed(winrt::Windows::UI::Core::CoreWindow const &sender, winrt::Windows::UI::Core::CoreWindowEventArgs const &args) | sealed | [protected]
Run() | sealed | [virtual]
Run() | sealed |
SetWindow(Windows::UI::Core::CoreWindow^window) | sealed | [virtual]
SetWindow(winrt::Windows::UI::Core::CoreWindow const &window) | sealed |
Uninitialize() | sealed | [virtual]
Uninitialize() | sealed |
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario1.h Source File

  • FolderEnumeration
  • cppwinrt

Scenario1.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1 : Scenario1T<Scenario1>
00019     {
00020         Scenario1();
00021         fire_and_forget GetFilesAndFoldersButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00022     };
00023 }
00024
00025 namespace winrt::SDKTemplate::factory_implementation
00026 {
00027     struct Scenario1 : Scenario1T<Scenario1, implementation::Scenario1>
00028     {
00029     };
00030 }
Generated on Fri Nov 15 2024 22:19:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso15693Commands.cs Source File

  • Nfc
  • PcscSdk

Iso15693Commands.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Runtime.InteropServices.WindowsRuntime;
00014 using Windows.Storage.Streams;
00015
00016 namespace Iso15693
00017 {
00018     /// <summary>
00019     /// Iso15693 read command
00020     /// </summary>
00021     public class Read : Pcsc.ReadBinary
00022     {
00023         public Read(ushort blockNumber)
00024             : base((ushort)((blockNumber & 0xff) << 8), 4)
00025         {
00026         }
00027     }
00028     /// <summary>
00029     /// Iso15693 write command
00030     /// </summary>
00031     public class Write : Pcsc.UpdateBinary
00032     {
00033         public Write(ushort blockNumber, byte[] dataToWrite)
00034             : base((ushort)((blockNumber & 0xff) << 8), dataToWrite)
00035         {
00036         }
00037     }
00038     /// <summary>
00039     /// Iso15693 GetUid command
00040     /// </summary>
00041     public class GetUid : Pcsc.GetUid
00042     {
00043         public GetUid()
00044             : base()
00045         {
00046         }
00047     }
00048     /// <summary>
00049     /// Iso15693 GetHistoricalBytes command
00050     /// </summary>
00051     public class GetHistoricalBytes : Pcsc.GetHistoricalBytes
00052     {
00053         public GetHistoricalBytes()
00054             : base()
00055         {
00056         }
00057     }
00058     /// <summary>
00059     /// Iso15693 response APDU
00060     /// </summary>
00061     public class ApduResponse : Pcsc.ApduResponse
00062     {
00063         public ApduResponse()
00064             : base()
00065         {
00066         }
00067     }
00068 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Render Member List

This is the complete list of members for Scenario1_Render, including all inherited members.
GenericFail | Scenario1_Render | [private]
LoadDocument(object sender, RoutedEventArgs args) | Scenario1_Render | [inline, private]
pdfDocument | Scenario1_Render | [private]
rootPage | Scenario1_Render | [private]
Scenario1_Render() | Scenario1_Render | [inline]
ViewPage(object sender, RoutedEventArgs args) | Scenario1_Render | [inline, private]
WrongPassword | Scenario1_Render | [private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SetRecordProfile Member List

This is the complete list of members for Scenario1_SetRecordProfile, including all inherited members.
GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel panel) | Scenario1_SetRecordProfile | [inline]
InitCustomProfileBtn_Click(object sender, RoutedEventArgs e) | Scenario1_SetRecordProfile | [inline, private]
InitRecordProfileBtn_Click(object sender, RoutedEventArgs e) | Scenario1_SetRecordProfile | [inline, private]
LogStatus(string message, NotifyType type) | Scenario1_SetRecordProfile | [inline, private]
LogStatusToOutputBox(string message) | Scenario1_SetRecordProfile | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_SetRecordProfile | [inline, protected]
rootPage | Scenario1_SetRecordProfile | [private]
Scenario1_SetRecordProfile() | Scenario1_SetRecordProfile | [inline]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario09_GetCookie.cpp Source File

  • HttpClient
  • cppwinrt

Scenario09_GetCookie.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario09_GetCookie.h"
00014 #include "Scenario09_GetCookie.g.cpp"
00015 #include "Helpers.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::UI::Xaml;
00020 using namespace winrt::Windows::UI::Xaml::Navigation;
00021 using namespace winrt::Windows::Web::Http;
00022 using namespace winrt::Windows::Web::Http::Filters;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario09_GetCookie::Scenario09_GetCookie()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario09_GetCookie::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         httpClient = Helpers::CreateHttpClientWithCustomHeaders();
00034     }
00035
00036     void Scenario09_GetCookie::OnNavigatedFrom(NavigationEventArgs const&)
00037     {
00038         httpClient.Close();
00039     }
00040
00041     void Scenario09_GetCookie::GetCookies_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00044         if (!resourceUri)
00045         {
00046             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00047             return;
00048         }
00049         try
00050         {
00051             HttpBaseProtocolFilter filter;
00052             HttpCookieCollection cookieCollection = filter.CookieManager().GetCookies(resourceUri);
00053
00054             std::wostringstream result;
00055
00056             result << cookieCollection.Size() << L" cookies found.\n";
00057
00058             for (HttpCookie cookie : cookieCollection)
00059             {
00060                 result
00061                     << L"--------------------\n"
00062                     << L"Name: " << std::wstring_view(cookie.Name()) << L"\n"
00063                     << L"Domain: " << std::wstring_view(cookie.Domain()) << L"\n"
00064                     << L"Path: " << std::wstring_view(cookie.Path()) << L"\n"
00065                     << L"Value: " << std::wstring_view(cookie.Value()) << L"\n";
00066                 if (auto expires = cookie.Expires())
00067                 {
00068                     result << L"Expires: " << std::wstring_view(Helpers::ToSimpleString(expires.Value())) << L"\n";
00069                 }
00070                 result
00071                     << L"Secure: " << cookie.Secure() << L"\n"
00072                     << L"HttpOnly: " << cookie.HttpOnly() << L"\n";
00073             }
00074             OutputField().Text(result.str());
00075         }
00076         catch (hresult_error const& ex)
00077         {
00078             rootPage.NotifyUser(L"Error: " + ex.message(), NotifyType::ErrorMessage);
00079         }
00080     }
00081
00082     fire_and_forget Scenario09_GetCookie::SendHttpGetButton_Click(IInspectable const&, RoutedEventArgs const&)
00083     {
00084         auto lifetime = get_strong();
00085
00086         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00087         // valid, absolute URI, we'll notify the user about the incorrect input.
00088         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00089         if (!resourceUri)
00090         {
00091             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00092             return;
00093         }
00094
00095         Helpers::ScenarioStarted(SendHttpGetButton(), CancelButton(), OutputField());
00096         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00097
00098         // This sample uses a "try" in order to support cancellation.
00099         // If you don't need to support cancellation, then the "try" is not needed.
00100         try
00101         {
00102             pendingAction = CancelableRequestAsync(resourceUri);
00103             co_await pendingAction;
00104         }
00105         catch (hresult_canceled const&)
00106         {
00107             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00108         }
00109
00110         Helpers::ScenarioCompleted(SendHttpGetButton(), CancelButton());
00111     }
00112
00113     IAsyncAction Scenario09_GetCookie::CancelableRequestAsync(Uri resourceUri)
00114     {
00115         auto lifetime = get_strong();
00116         auto cancellation = co_await get_cancellation_token();
00117         cancellation.enable_propagation();
00118
00119         HttpRequestResult result = co_await httpClient.TryGetAsync(resourceUri);
00120
00121         if (result.Succeeded())
00122         {
00123             co_await Helpers::DisplayTextResultAsync(result.ResponseMessage(), OutputField());
00124
00125             rootPage.NotifyUser(L"Completed", NotifyType::StatusMessage);
00126         }
00127         else
00128         {
00129             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00130         }
00131     }
00132
00133     void Scenario09_GetCookie::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00134     {
00135         if (pendingAction)
00136         {
00137             pendingAction.Cancel();
00138         }
00139     }
00140 }
Generated on Fri Nov 15 2024 22:19:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MoveLookController.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

MoveLookController.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // MoveLookController:
00015 // This is the class that handles input events and turns it into player
00016 // intent for movement ("move") camera ("look") and other actions.
00017 //
00018 // This class aggregates, mouse, keyboard, touch and game controller input
00019 // (like the XBox controller) into a unified single controller.
00020 // The controller has three modes of operation:
00021 //     None - the controller is not active and all input is ignored.
00022 //     WaitForInput - the controller is waiting for the player to acknowledge
00023 //         a message from the app. Only a left mouse click or touch event
00024 //         in the rectangle specified in the WaitForPress method or the
00025 //         'Menu' button being pressed on the game controller will
00026 //         result in IsPressComplete returning true.
00027 //     Active - the controller is in active game play mode.
00028 //
00029 // This class provides input handlers that can be associated directly with a CoreWindow
00030 // object. As an abstract class the association is left to the derived class.
00031 // Input handlers are available for the following events:
00032 //     PointerPressed
00033 //     PointerMoved
00034 //     PointerReleased
00035 //     PointerExited
00036 //     KeyDown
00037 //     KeyUp
00038 //     MouseMoved
00039 //
00040 // During 'Active' mode, the controller will put the mouse into relative mouse
00041 // mode by turning off the pointer cursor. In this mode the controller separates
00042 // mouse movement from pointer movement and uses the relative mouse movements to
00043 // update the controller for the Look Control.
00044 //
00045 // The touch portion of the MoveLookController divides the window area of the app
00046 // into three distinct regions:
00047 //     MoveRect - the rectangle of the screen where touch input is converted into
00048 //         a virtual joystick where the vertical motion will be translated into
00049 //         forward/backward position motion and horizontal motion will be translated
00050 //         into left/right position motion.
00051 //     FireRect - the rectangle of the screen where touch input will be converted
00052 //         into a fire button. A touch sequence of PointerPressed will result in
00053 //         IsFiring method to return true in AutoFire mode, otherwise a PointPressed
00054 //         followed by a PointerReleased event in the FireRect will result in the
00055 //         IsFiring method returning true once.
00056 //     Outside MoveRect & FireRect - this area of the screen controls the Look control
00057 //         and updates the LookDirection.
00058 //
00059 // The keyboard/mouse are used as a pair to provide a typical PC gaming input model in Active
00060 // mode:
00061 //     Mouse - is mapped to the look control. Left mouse is mapped to IsFiring or 'Fire' button
00062 //     W key - is mapped to the 'forward' motion of the move control
00063 //     S key - is mapped to the 'back' motion of the move control
00064 //     A key - is mapped to the 'left' motion of the move control
00065 //     D key - is mapped to the 'right' motion of the move control
00066 //     <space> key - is mapped to the 'up' motion of the move control
00067 //     X key - is mapped to the 'down' motion of the move control
00068 //     P key - is mapped to IsPauseRequested
00069 //
00070 // This class enables game controllers (e.g. Xbox controller) which follow a polling model:
00071 //      UpdatePollingDevices - will be called at the beginning of update
00072 //          and as a part of checking for pause requests
00073 //      PollingFireInUse - can use used to indicate a fire button is
00074 //          currently depressed.
00075 //      ResetState - can be augumented to reset an stored state associated
00076 //          with the polling devices
00077 //
00078 // The following controls are mapped from the game controller using Windows::Gaming::Input:
00079 //     GamepadButtons::Menu - is mapped to IsPressComplete in the WaitForInput state and
00080 //         IsPauseRequested in the Active state.
00081 //     Left Thumb stick - is mapped to the move control in Active mode
00082 //     Right Thumb stick - is mapped to the look control in Active mode
00083 //     Right Trigger - is mapped to IsFiring in Active mode or "Fire" button.
00084 //
00085 // Because the MoveLookController can be use in a variety of environments
00086 // such as on a separate thread, it has the option to be initialized with a CoreDispatcher.
00087 // CoreDispatcher is used to marshall commands such as showing and hiding the cursor
00088 // (ShowCursor, HideCursor) onto the UI thread. This is necessary when
00089 // MoveLookController is used in a XAML app, and is not necessary when it is
00090 // used in a CoreWindow/DirectX app.
00091 //
00092 // The MoveLookController collects input from each of the input events.
00093 // On the Update method it calls UpdatePollingDevices to update state.
00094 // All the inputs are coalesced and merged to generate a velocity vector
00095 // and update the Pitch and Yaw values.
00096
00097 // Uncomment the next line to print debug tracing information.
00098 // #define MOVELOOKCONTROLLER_TRACE 1
00099
00100 enum class MoveLookControllerState
00101 {
00102     None,
00103     WaitForInput,
00104     Active,
00105 };
00106
00107 namespace MoveLookConstants
00108 {
00109     static const float RotationGain = 0.008f;       // Sensitivity adjustment for look controller.
00110     static const float MovementGain = 2.0f;         // Sensitivity adjustment for move controller.
00111 };
00112
00113 class MoveLookController
00114 {
00115 public:
00116     // A CoreDispatcher is needed only when running in a XAML app.
00117     MoveLookController(
00118         _In_ winrt::Windows::UI::Core::CoreWindow const& window,
00119         _In_ winrt::Windows::UI::Core::CoreDispatcher const& dispatcher
00120         );
00121     MoveLookController(_In_ winrt::Windows::UI::Core::CoreWindow const& window);
00122
00123     void InitWindow(_In_ winrt::Windows::UI::Core::CoreWindow const& window);
00124
00125     void SetMoveRect(
00126         _In_ DirectX::XMFLOAT2 upperLeft,
00127         _In_ DirectX::XMFLOAT2 lowerRight
00128         );
00129     void SetFireRect(
00130         _In_ DirectX::XMFLOAT2 upperLeft,
00131         _In_ DirectX::XMFLOAT2 lowerRight
00132         );
00133     void WaitForPress(
00134         _In_ DirectX::XMFLOAT2 UpperLeft,
00135         _In_ DirectX::XMFLOAT2 LowerRight
00136         );
00137     void WaitForPress();
00138
00139     void Update();
00140
00141     bool IsFiring();
00142     bool IsPressComplete();
00143     bool IsPauseRequested();
00144
00145     DirectX::XMFLOAT3 Velocity();
00146     DirectX::XMFLOAT3 LookDirection();
00147     float Pitch();
00148     void  Pitch(_In_ float pitch);
00149     float Yaw();
00150     void  Yaw(_In_ float yaw);
00151     bool  Active();
00152     void  Active(_In_ bool active);
00153
00154     bool AutoFire();
00155     void AutoFire(_In_ bool AutoFire);
00156
00157 private:
00158     void ResetState();
00159     void UpdatePollingDevices();
00160     bool PollingFireInUse() { return m_gamepadTriggerInUse; }
00161     winrt::fire_and_forget ShowCursor();
00162     winrt::fire_and_forget HideCursor();
00163
00164     void OnPointerPressed(
00165         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00166         _In_ winrt::Windows::UI::Core::PointerEventArgs const& args
00167         );
00168     void OnPointerMoved(
00169         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00170         _In_ winrt::Windows::UI::Core::PointerEventArgs const& args
00171         );
00172     void OnPointerReleased(
00173         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00174         _In_ winrt::Windows::UI::Core::PointerEventArgs const& args
00175         );
00176     void OnPointerExited(
00177         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00178         _In_ winrt::Windows::UI::Core::PointerEventArgs const& args
00179         );
00180     void OnKeyDown(
00181         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00182         _In_ winrt::Windows::UI::Core::KeyEventArgs const& args
00183         );
00184     void OnKeyUp(
00185         _In_ winrt::Windows::UI::Core::CoreWindow const& sender,
00186         _In_ winrt::Windows::UI::Core::KeyEventArgs const& args
00187         );
00188     void OnMouseMoved(
00189         _In_ winrt::Windows::Devices::Input::MouseDevice const& mouseDevice,
00190         _In_ winrt::Windows::Devices::Input::MouseEventArgs const& args
00191         );
00192     void OnBackRequested(
00193         _In_ winrt::Windows::Foundation::IInspectable const& sender,
00194         _In_ winrt::Windows::UI::Core::BackRequestedEventArgs const& args
00195         );
00196     void OnGamepadAdded(
00197         _In_ winrt::Windows::Foundation::IInspectable const& sender,
00198         _In_ winrt::Windows::Gaming::Input::Gamepad const& gamepad
00199         );
00200     void OnGamepadRemoved(
00201         _In_ winrt::Windows::Foundation::IInspectable const& sender,
00202         _In_ winrt::Windows::Gaming::Input::Gamepad const& gamepad
00203         );
00204
00205 #ifdef MOVELOOKCONTROLLER_TRACE
00206     void DebugTrace(const wchar_t* format, ...);
00207 #endif
00208
00209 private:
00210     // CoreDispatcher is used to marshal execution back to the UI thread.
00211     // Only used when running in a XAML app.
00212     winrt::Windows::UI::Core::CoreDispatcher  m_dispatcher{ nullptr };
00213
00214     // Properties of the controller object.
00215     MoveLookControllerState     m_state;
00216     DirectX::XMFLOAT3           m_velocity;             // How far we move in this frame.
00217     float                       m_pitch;
00218     float                       m_yaw;                  // Orientation euler angles in radians.
00219
00220     // Properties of the Move control.
00221     DirectX::XMFLOAT2           m_moveUpperLeft;        // Bounding box where this control will activate.
00222     DirectX::XMFLOAT2           m_moveLowerRight;
00223     bool                        m_moveInUse;            // The move control is in use.
00224     uint32_t                    m_movePointerID;        // Id of the pointer in this control.
00225     DirectX::XMFLOAT2           m_moveFirstDown;        // Point where initial contact occurred.
00226     DirectX::XMFLOAT2           m_movePointerPosition;  // Point where the move pointer is currently located.
00227     DirectX::XMFLOAT3           m_moveCommand;          // The net command from the move control.
00228
00229     // Properties of the Look control.
00230     bool                        m_lookInUse;            // The look control is in use.
00231     uint32_t                    m_lookPointerID;        // Id of the pointer in this control.
00232     DirectX::XMFLOAT2           m_lookLastPoint;        // Last point (from last frame).
00233     DirectX::XMFLOAT2           m_lookLastDelta;        // The delta used for smoothing between frames.
00234
00235     // Properties of the Fire control.
00236     bool                        m_autoFire;
00237     bool                        m_firePressed;
00238     DirectX::XMFLOAT2           m_fireUpperLeft;        // Bounding box where this control will activate.
00239     DirectX::XMFLOAT2           m_fireLowerRight;
00240     bool                        m_fireInUse;            // The fire control in in use.
00241     UINT32                      m_firePointerID;        // Id of the pointer in this control.
00242     DirectX::XMFLOAT2           m_fireLastPoint;        // Last fire position.
00243
00244     // Properties of the Mouse control. This is a combination of Look and Fire.
00245     bool                        m_mouseInUse;
00246     uint32_t                    m_mousePointerID;
00247     DirectX::XMFLOAT2           m_mouseLastPoint;
00248     bool                        m_mouseLeftInUse;
00249     bool                        m_mouseRightInUse;
00250
00251     bool                        m_buttonInUse;
00252     uint32_t                    m_buttonPointerID;
00253     DirectX::XMFLOAT2           m_buttonUpperLeft;
00254     DirectX::XMFLOAT2           m_buttonLowerRight;
00255     bool                        m_buttonPressed;
00256     bool                        m_pausePressed;
00257
00258     // Input states for Keyboard.
00259     bool                        m_forward;
00260     bool                        m_back;
00261     bool                        m_left;
00262     bool                        m_right;
00263     bool                        m_up;
00264     bool                        m_down;
00265     bool                        m_pause;
00266
00267     // Game controller related members.
00268     winrt::Windows::Gaming::Input::Gamepad m_activeGamepad{ nullptr };
00269     std::atomic<bool>                      m_gamepadsChanged;
00270     bool                                   m_gamepadStartButtonInUse;
00271     bool                                   m_gamepadTriggerInUse;
00272 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/Scenario2_Polling.xaml.cpp Source File

  • CustomSensors
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2_Polling.xaml.cpp
00013 // Implementation of the Scenario2_Polling class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario2_Polling.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Enumeration;
00026 using namespace Windows::Devices::Sensors;
00027 using namespace Windows::Devices::Sensors::Custom;
00028 using namespace Windows::Foundation;
00029 using namespace Windows::Foundation::Collections;
00030 using namespace Windows::UI::Core;
00031 using namespace Platform;
00032
00033 // The following ID is defined by vendors and is unique to a custom sensor type. Each custom sensor driver should define one unique ID.
00034 //
00035 // The ID below is defined in the custom sensor driver sample available in the SDK. It identifies the custom sensor CO2 emulation sample driver.
00036 const GUID GUID_CustomSensorDevice_VendorDefinedTypeID = { 0x4025a865, 0x638c, 0x43aa, 0xa6, 0x88, 0x98, 0x58, 0x9, 0x61, 0xee, 0xae };
00037
00038 // A property key is defined by vendors for each datafield property a custom sensor driver exposes. Property keys are defined
00039 // per custom sensor driver and is unique to each custom sensor type.
00040 //
00041 // The following property key represents the CO2 level as defined in the custom sensor CO2 emulation driver sample available in the WDK.
00042 // In this example only one key is defined, but other drivers may define more than one key by rev'ing up the property key index.
00043 #define CO2_LEVEL_KEY "{74879888-a3cc-45c6-9ea9-058838256433} 1"
00044
00045 Scenario2_Polling::Scenario2_Polling() : m_RootPage(MainPage::Current)
00046 {
00047     Guid customSensorGuid(GUID_CustomSensorDevice_VendorDefinedTypeID);
00048
00049     InitializeComponent();
00050
00051     m_DeviceAccessInfo = DeviceAccessInformation::CreateFromDeviceClassId(customSensorGuid);
00052     m_DeviceAccessInfo->AccessChanged += ref new TypedEventHandler<DeviceAccessInformation ^, DeviceAccessChangedEventArgs ^>(this, &Scenario2_Polling::OnAccessChanged);
00053
00054     StartWatcher();
00055 }
00056
00057 /// <summary>
00058 /// Invoked each time the custom sensor is created
00059 /// </summary>
00060 void Scenario2_Polling::StartWatcher()
00061 {
00062     Guid customSensorGuid(GUID_CustomSensorDevice_VendorDefinedTypeID);
00063     String^ customSensorSelector = CustomSensor::GetDeviceSelector(customSensorGuid);
00064     m_Watcher = DeviceInformation::CreateWatcher(customSensorSelector);
00065     m_Watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(this, &Scenario2_Polling::OnCustomSensorAdded);
00066     m_Watcher->Start();
00067 }
00068
00069 /// <summary>
00070 /// Invoked when the device watcher finds a matching custom sensor device
00071 /// </summary>
00072 /// <param name="watcher">device watcher</param>
00073 /// <param name="customSensorDevice">device information for the custom sensor that was found</param>
00074 void Scenario2_Polling::OnCustomSensorAdded(DeviceWatcher^ watcher, DeviceInformation^ customSensorDevice)
00075 {
00076     IAsyncOperation<CustomSensor^>^ getCustomSensorRequest = CustomSensor::FromIdAsync(customSensorDevice->Id);
00077
00078     auto getCustomSensorTask = create_task(getCustomSensorRequest);
00079
00080     getCustomSensorTask.then([this](CustomSensor^ customSensor)
00081     {
00082         if (customSensor != nullptr)
00083         {
00084             // When multiple custom sensors exist on the system, OnCustomSensorAdded
00085             // may be called concurrently using multiple threadpool threads
00086             // Lock the section to protect this->customSensor from concurrent accesses
00087             auto lock = m_CritsecCustomSensor.Lock();
00088
00089             // Just pick the first matching custom sensor, ignore the others
00090             if (nullptr == this->m_CustomSensor)
00091             {
00092                 this->m_CustomSensor = customSensor;
00093             }
00094         }
00095         else
00096         {
00097             Dispatcher->RunAsync(
00098                 CoreDispatcherPriority::Normal,
00099                 ref new DispatchedHandler(
00100                     [this]()
00101                     {
00102                         m_RootPage->NotifyUser("Custom sensor not found or access denied", NotifyType::ErrorMessage);
00103                     },
00104                     CallbackContext::Any
00105                 )
00106             );
00107         }
00108     });
00109 }
00110
00111 /// <summary>
00112 /// Invoked when this page is about to be displayed in a Frame.
00113 /// </summary>
00114 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00115 /// property is typically used to configure the page.</param>
00116 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00117 {
00118 }
00119
00120 /// <summary>
00121 /// Invoked when this page is no longer displayed.
00122 /// </summary>
00123 /// <param name="e"></param>
00124 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00125 {
00126 }
00127
00128 /// <summary>
00129 /// Invoked when a user clicks on the GetCO2LevelButton
00130 /// </summary>
00131 /// <param name="sender"></param>
00132 /// <param name="e"></param>
00133 void Scenario2_Polling::GetCO2Level(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00134 {
00135     static int test = 0;
00136     if (m_CustomSensor != nullptr)
00137     {
00138         CustomSensorReading^ reading = m_CustomSensor->GetCurrentReading();
00139         if (reading != nullptr)
00140         {
00141             if (reading->Properties->HasKey(CO2_LEVEL_KEY))
00142             {
00143                 ScenarioOutputCO2Level->Text = reading->Properties->Lookup(CO2_LEVEL_KEY)->ToString();
00144             }
00145         }
00146     }
00147     else
00148     {
00149         m_RootPage->NotifyUser("Custom sensor not found or access denied", NotifyType::ErrorMessage);
00150     }
00151 }
00152
00153
00154 /// <summary>
00155 /// Invoked when the privacy settings for this custom sensor have changed
00156 /// </summary>
00157 /// <param name="sender"></param>
00158 /// <param name="e"></param>
00159 void Scenario2_Polling::OnAccessChanged(DeviceAccessInformation ^sender, DeviceAccessChangedEventArgs ^args)
00160 {
00161     if (args->Status == DeviceAccessStatus::Allowed)
00162     {
00163         StartWatcher();
00164
00165         Dispatcher->RunAsync(
00166             CoreDispatcherPriority::Normal,
00167             ref new DispatchedHandler(
00168                 [this]()
00169                 {
00170                     m_RootPage->NotifyUser("", NotifyType::StatusMessage);
00171                 },
00172                 CallbackContext::Any
00173             )
00174         );
00175     }
00176     else
00177     {
00178         m_CustomSensor = nullptr;
00179         Dispatcher->RunAsync(
00180             CoreDispatcherPriority::Normal,
00181             ref new DispatchedHandler(
00182                 [this]()
00183                 {
00184                     m_RootPage->NotifyUser("Custom sensor access denied", NotifyType::ErrorMessage);
00185                 },
00186                 CallbackContext::Any
00187             )
00188         );
00189     }
00190 }
Generated on Fri Nov 15 2024 22:17:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario3_SecondaryTiles.cpp Source File

  • LockScreenApps
  • cppwinrt

Scenario3_SecondaryTiles.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_SecondaryTiles.h"
00014 #include "Scenario3_SecondaryTiles.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::NotificationsExtensions::Badges;
00018 using namespace winrt::NotificationsExtensions::Tiles;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Notifications;
00021 using namespace winrt::Windows::UI::Popups;
00022 using namespace winrt::Windows::UI::StartScreen;
00023 using namespace winrt::Windows::UI::Xaml;
00024 using namespace winrt::Windows::UI::Xaml::Media;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario3_SecondaryTiles::Scenario3_SecondaryTiles()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     fire_and_forget Scenario3_SecondaryTiles::CreateBadgeTile_Click(IInspectable const& sender, RoutedEventArgs const&)
00034     {
00035         auto lifetime = get_strong();
00036
00037         if (!SecondaryTile::Exists(BADGE_TILE_ID))
00038         {
00039             SecondaryTile secondTile(
00040                 BADGE_TILE_ID,
00041                 L"LockScreen C++/WinRT - Badge only",
00042                 L"BADGE_ARGS",
00043                 Uri(L"ms-appx:///Assets/squareTile-sdk.png"),
00044                 TileSize::Square150x150
00045                 );
00046             secondTile.LockScreenBadgeLogo(Uri(L"ms-appx:///Assets/badgelogo-sdk.png"));
00047
00048             bool isPinned = co_await secondTile.RequestCreateForSelectionAsync(GetElementRect(sender.as<FrameworkElement>()), Placement::Above);
00049             if (isPinned)
00050             {
00051                 BadgeNumericNotificationContent badgeContent(2);
00052                 BadgeUpdateManager::CreateBadgeUpdaterForSecondaryTile(BADGE_TILE_ID).Update(BadgeNotification(badgeContent.GetXml()));
00053                 rootPage.NotifyUser(L"Secondary tile created and badge updated. Go to Settings to add it to the lock screen.", NotifyType::StatusMessage);
00054             }
00055             else
00056             {
00057                 rootPage.NotifyUser(L"Tile not created.", NotifyType::ErrorMessage);
00058             }
00059         }
00060         else
00061         {
00062             rootPage.NotifyUser(L"Badge secondary tile already exists.", NotifyType::ErrorMessage);
00063         }
00064     }
00065
00066     fire_and_forget Scenario3_SecondaryTiles::CreateBadgeAndTextTile_Click(IInspectable const& sender, RoutedEventArgs const&)
00067     {
00068         auto lifetime = get_strong();
00069
00070         if (!SecondaryTile::Exists(TEXT_TILE_ID))
00071         {
00072             SecondaryTile secondTile(
00073                 TEXT_TILE_ID,
00074                 L"LockScreen C++/WinRT - Badge and tile text",
00075                 L"TEXT_ARGS",
00076                 Uri(L"ms-appx:///Assets/squareTile-sdk.png"),
00077                 TileSize::Wide310x150
00078                 );
00079             secondTile.VisualElements().Wide310x150Logo(Uri(L"ms-appx:///Assets/tile-sdk.png"));
00080             secondTile.LockScreenBadgeLogo(Uri(L"ms-appx:///Assets/badgelogo-sdk.png"));
00081             secondTile.LockScreenDisplayBadgeAndTileText(true);
00082
00083             bool isPinned = co_await secondTile.RequestCreateForSelectionAsync(GetElementRect(sender.as<FrameworkElement>()), Placement::Above);
00084             if (isPinned)
00085             {
00086                 auto tileDOM = TileUpdateManager::GetTemplateContent(TileTemplateType::TileWide310x150Text03);
00087                 tileDOM.SelectSingleNode(L"//text[@id=1]").InnerText(L"Text for the lock screen");
00088                 TileUpdateManager::CreateTileUpdaterForSecondaryTile(TEXT_TILE_ID).Update(TileNotification(tileDOM));
00089                 rootPage.NotifyUser(L"Secondary tile created and updated. Go to PC settings to add it to the lock screen.", NotifyType::StatusMessage);
00090             }
00091             else
00092             {
00093                 rootPage.NotifyUser(L"Tile not created.", NotifyType::ErrorMessage);
00094             }
00095         }
00096         else
00097         {
00098             rootPage.NotifyUser(L"Badge and text secondary tile already exists.", NotifyType::ErrorMessage);
00099         }
00100     }
00101
00102     Rect Scenario3_SecondaryTiles::GetElementRect(FrameworkElement const& element)
00103     {
00104         GeneralTransform transform = element.TransformToVisual(nullptr);
00105         return transform.TransformBounds({ {}, Size(static_cast<float>(element.ActualWidth()), static_cast<float>(element.ActualHeight())) });
00106     }
00107 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/PrimaryTile/ClearBadge/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • PrimaryTile
  • ClearBadge

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Notifications;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00006
00007 namespace Notifications.ScenarioPages.Badges.Local.PrimaryTile.ClearBadge
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class ScenarioElement : UserControl
00013     {
00014         public ScenarioElement()
00015         {
00016             this.InitializeComponent();
00017         }
00018
00019         private void ButtonClearBadge_Click(object sender, RoutedEventArgs e)
00020         {
00021             BadgeUpdateManager.CreateBadgeUpdaterForApplication().Clear();
00022         }
00023     }
00024 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/Scenarios/CustomFocusVisuals.xaml.cs Source File

  • XamlFocusVisuals
  • cs
  • Scenarios

CustomFocusVisuals.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016
00017 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00018
00019 namespace FocusVisualsSample
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class CustomFocusVisuals : Page
00025     {
00026         private MainPage rootPage;
00027
00028         public CustomFocusVisuals()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             rootPage = MainPage.Current;
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.h Source File

  • BluetoothLE
  • cppwinrt

BluetoothLEDeviceDisplay.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include "BluetoothLEDeviceDisplay.g.h"
00004
00005 namespace winrt::SDKTemplate::implementation
00006 {
00007     struct BluetoothLEDeviceDisplay : BluetoothLEDeviceDisplayT<BluetoothLEDeviceDisplay>
00008     {
00009         BluetoothLEDeviceDisplay(Windows::Devices::Enumeration::DeviceInformation const& deviceInfoIn);
00010
00011         Windows::Devices::Enumeration::DeviceInformation DeviceInformation()
00012         {
00013             return m_deviceInformation;
00014         }
00015
00016         hstring Id()
00017         {
00018             return m_deviceInformation.Id();
00019         }
00020
00021         hstring Name()
00022         {
00023             return m_deviceInformation.Name();
00024         }
00025
00026         bool IsPaired()
00027         {
00028             return m_deviceInformation.Pairing().IsPaired();
00029         }
00030
00031         bool IsConnected()
00032         {
00033             return LookupBooleanProperty(L"System.Devices.Aep.IsConnected");
00034         }
00035
00036         bool IsConnectable()
00037         {
00038             return LookupBooleanProperty(L"System.Devices.Aep.Bluetooth.Le.IsConnectable");
00039         }
00040
00041         Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable> Properties()
00042         {
00043             return m_deviceInformation.Properties();
00044         }
00045
00046         Windows::UI::Xaml::Media::Imaging::BitmapImage GlyphBitmapImage()
00047         {
00048             return m_glyphBitmapImage;
00049         }
00050
00051         void Update(Windows::Devices::Enumeration::DeviceInformationUpdate const& deviceInfoUpdate);
00052
00053         event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler);
00054         void PropertyChanged(event_token const& token) noexcept;
00055
00056     private:
00057         Windows::Devices::Enumeration::DeviceInformation m_deviceInformation{ nullptr };
00058         Windows::UI::Xaml::Media::Imaging::BitmapImage m_glyphBitmapImage{ nullptr };
00059         event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged;
00060
00061         fire_and_forget UpdateGlyphBitmapImage();
00062         void OnPropertyChanged(param::hstring const& property);
00063         bool LookupBooleanProperty(param::hstring const& property);
00064     };
00065 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/Scenario2_Launch.xaml.cs Source File

  • FullScreenMode
  • cs

Scenario2_Launch.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.ViewManagement;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class Scenario2_Launch : Page
00019     {
00020         public Scenario2_Launch()
00021         {
00022             this.InitializeComponent();
00023             LaunchInFullScreenModeCheckBox.IsChecked = ApplicationView.PreferredLaunchWindowingMode == ApplicationViewWindowingMode.FullScreen;
00024         }
00025
00026         private void LaunchInFullScreenModeCheckBox_Click(object sender, RoutedEventArgs e)
00027         {
00028             ApplicationView.PreferredLaunchWindowingMode = LaunchInFullScreenModeCheckBox.IsChecked.Value ? ApplicationViewWindowingMode.FullScreen : ApplicationViewWindowingMode.Auto;
00029         }
00030     }
00031 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HolographicTemplateAppMain Member List

This is the complete list of members for HolographicTemplateAppMain, including all inherited members.
canCommitDirect3D11DepthBuffer | HolographicTemplateAppMain | [private]
canGetDefaultHolographicDisplay | HolographicTemplateAppMain | [private]
canGetHolographicDisplayForCamera | HolographicTemplateAppMain | [private]
deviceResources | HolographicTemplateAppMain | [private]
Dispose() | HolographicTemplateAppMain | [inline]
gamepads | HolographicTemplateAppMain | [private]
holographicSpace | HolographicTemplateAppMain | [private]
HolographicTemplateAppMain(DeviceResources deviceResources) | HolographicTemplateAppMain | [inline]
LoadAppState() | HolographicTemplateAppMain | [inline]
OnCameraAdded(HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args) | HolographicTemplateAppMain | [inline]
OnCameraRemoved(HolographicSpace sender, HolographicSpaceCameraRemovedEventArgs args) | HolographicTemplateAppMain | [inline]
OnDeviceLost(Object sender, EventArgs e) | HolographicTemplateAppMain | [inline]
OnDeviceRestored(Object sender, EventArgs e) | HolographicTemplateAppMain | [inline]
OnGamepadAdded(Object o, Gamepad args) | HolographicTemplateAppMain | [inline]
OnGamepadRemoved(Object o, Gamepad args) | HolographicTemplateAppMain | [inline]
OnHolographicDisplayIsAvailableChanged(Object o, Object args) | HolographicTemplateAppMain | [inline, private]
OnLocatabilityChanged(SpatialLocator sender, Object args) | HolographicTemplateAppMain | [inline, private]
OnPointerPressed() | HolographicTemplateAppMain | [inline]
pointerPressed | HolographicTemplateAppMain | [private]
Render(HolographicFrame holographicFrame) | HolographicTemplateAppMain | [inline]
SaveAppState() | HolographicTemplateAppMain | [inline]
SetHolographicSpace(HolographicSpace holographicSpace) | HolographicTemplateAppMain | [inline]
spatialLocator | HolographicTemplateAppMain | [private]
stationaryReferenceFrame | HolographicTemplateAppMain | [private]
timer | HolographicTemplateAppMain | [private]
Update() | HolographicTemplateAppMain | [inline]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemsDataSource Member List

This is the complete list of members for ItemsDataSource, including all inherited members.
_items | ItemsDataSource | [private, static]
GetAllItems() | ItemsDataSource | [inline, static]
GetItemById(int id) | ItemsDataSource | [inline, static]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/Scenario3_AppCapture.xaml.cs Source File

  • DisablingScreenCapture
  • cs

Scenario3_AppCapture.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Media.Capture;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario3_AppCapture : Page
00021     {
00022         AppCapture appCapture;
00023         MainPage rootPage = MainPage.Current;
00024
00025         public Scenario3_AppCapture()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             appCapture = AppCapture.GetForCurrentView();
00033             appCapture.CapturingChanged += AppCapture_CapturingChanged;
00034             UpdateCaptureStatus();
00035         }
00036
00037         protected override void OnNavigatedFrom(NavigationEventArgs e)
00038         {
00039             appCapture.CapturingChanged -= AppCapture_CapturingChanged;
00040
00041             // Re-enable app capture when navigating away.
00042             var task = AppCapture.SetAllowedAsync(true);
00043         }
00044
00045         async void AllowAppCaptureCheckBox_Toggled(object sender, RoutedEventArgs e)
00046         {
00047             ToggleSwitch toggleSwitch = (ToggleSwitch)sender;
00048             await AppCapture.SetAllowedAsync(toggleSwitch.IsOn);
00049         }
00050
00051         void AppCapture_CapturingChanged(AppCapture sender, object e)
00052         {
00053             UpdateCaptureStatus();
00054         }
00055
00056         void UpdateCaptureStatus()
00057         {
00058             string audioStatus = appCapture.IsCapturingAudio ? "Audio is being captured." : "Audio is not being captured.";
00059             string videoStatus = appCapture.IsCapturingVideo ? "Video is being captured." : "Video is not being captured.";
00060             rootPage.NotifyUser(audioStatus + "\n" + videoStatus, NotifyType.StatusMessage);
00061         }
00062     }
00063 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/MediaBufferWrapper.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

MediaBufferWrapper.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #include <StspNetwork.h>
00010 #include <robuffer.h>
00011 #include <windows.storage.streams.h>
00012
00013 namespace Microsoft { namespace Samples { namespace SimpleCommunication { namespace Network {
00014
00015     class CMediaBufferWrapper :
00016         public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>,
00017         ABI::Windows::Storage::Streams::IBuffer,
00018         Microsoft::WRL::CloakedIid<Windows::Storage::Streams::IBufferByteAccess>,
00019         Microsoft::WRL::CloakedIid<IMarshal>,
00020         Microsoft::WRL::CloakedIid<IMediaBufferWrapper>,
00021         Microsoft::WRL::FtmBase>
00022     {
00023         InspectableClass(L"Microsoft.Samples.SimpleCommunication.Buffer", BaseTrust);
00024
00025     public:
00026         static HRESULT CreateInstance(DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper);
00027         static HRESULT CreateInstance(_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper);
00028
00029         CMediaBufferWrapper(void);
00030         ~CMediaBufferWrapper(void);
00031
00032         HRESULT RuntimeClassInitialize(IMFMediaBuffer *pMediaBuffer);
00033
00034         // IBuffer
00035         IFACEMETHOD (get_Capacity) (UINT *pcbCapacity);
00036         IFACEMETHOD (get_Length) (UINT *pcbLength);
00037         IFACEMETHOD (put_Length) (UINT cbLength);
00038
00039         // IBufferByteAccess
00040         IFACEMETHOD (Buffer) (_Out_ BYTE **ppBuffer);
00041
00042         // IMarshal
00043         IFACEMETHOD (GetUnmarshalClass) (REFIID riid, _In_opt_ void *pv, DWORD dwDestContext,
00044             _Reserved_ void *pvDestContext, DWORD mshlflags, _Out_ CLSID *pclsid);
00045         IFACEMETHOD (GetMarshalSizeMax) (REFIID riid, _In_opt_ void *pv, DWORD dwDestContext,
00046             _Reserved_ void *pvDestContext, DWORD mshlflags, _Out_ DWORD *pcbSize);
00047         IFACEMETHOD (MarshalInterface) (_In_ IStream *pStm, REFIID riid, _In_opt_ void *pv, DWORD dwDestContext,
00048             _Reserved_ void *pvDestContext, DWORD mshlflags);
00049         IFACEMETHOD (UnmarshalInterface) (_In_ IStream *, _In_ REFIID, _Outptr_ void **);
00050         IFACEMETHOD (ReleaseMarshalData) (_In_ IStream *);
00051         IFACEMETHOD (DisconnectObject) (DWORD);
00052
00053         // IMediaBufferWrapper
00054         IFACEMETHOD_(IMFMediaBuffer *, GetMediaBuffer) () const {return _spMediaBuffer.Get();}
00055         IFACEMETHOD_(BYTE *, GetBuffer) () const {return _pBuffer + _nOffset;}
00056
00057         IFACEMETHOD (SetOffset) (DWORD nOffset);
00058         IFACEMETHOD_(DWORD, GetOffset) () const {return _nOffset;}
00059
00060         IFACEMETHOD (GetCurrentLength) (DWORD *pcbCurrentLength);
00061         IFACEMETHOD (SetCurrentLength) (DWORD cbCurrentLength);
00062
00063         IFACEMETHOD (TrimLeft) (DWORD cbSize);
00064         IFACEMETHOD (TrimRight) (DWORD cbSize, _Out_ IMediaBufferWrapper **pWrapper);
00065
00066         IFACEMETHOD (Reset) ();
00067
00068     protected:
00069         HRESULT CheckMarshal();
00070
00071     private:
00072         ComPtr<IMFMediaBuffer>  _spMediaBuffer;
00073         ComPtr<IMF2DBuffer>     _sp2DBuffer;
00074         BYTE                    *_pBuffer;
00075         DWORD                   _nOffset;
00076         ComPtr<IMarshal>        _spBufferMarshal;
00077     };
00078
00079 }}}}
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SymbologyListEntry Member List

This is the complete list of members for SymbologyListEntry, including all inherited members.
Id | SymbologyListEntry |
IsEnabled | SymbologyListEntry |
Name | SymbologyListEntry |
SymbologyListEntry(uint symbologyId, bool symbologyEnabled=true) | SymbologyListEntry | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario2_WatchUsers.h Source File

  • UserInfo
  • cppwinrt

Scenario2_WatchUsers.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario2_WatchUsers.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct Scenario2_WatchUsers : Scenario2_WatchUsersT<Scenario2_WatchUsers>
00018     {
00019         Scenario2_WatchUsers();
00020
00021         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00022
00023         Windows::Foundation::Collections::IObservableVector<SDKTemplate::UserViewModel> Users()
00024         {
00025             return users;
00026         }
00027
00028         void StartWatching();
00029         void StopWatching();
00030
00031     private:
00032         fire_and_forget OnUserAdded(Windows::System::UserWatcher const&, Windows::System::UserChangedEventArgs const& e);
00033         fire_and_forget OnUserUpdated(Windows::System::UserWatcher const&, Windows::System::UserChangedEventArgs const& e);
00034         fire_and_forget OnUserRemoved(Windows::System::UserWatcher const&, Windows::System::UserChangedEventArgs const& e);
00035         fire_and_forget OnEnumerationCompleted(Windows::System::UserWatcher const&, IInspectable const& e);
00036         fire_and_forget OnWatcherStopped(Windows::System::UserWatcher const&, IInspectable const& e);
00037
00038         SDKTemplate::UserViewModel FindModelByUserId(hstring const& userId);
00039         Windows::Foundation::IAsyncOperation<hstring> GetDisplayNameOrGenericNameAsync(Windows::System::User user);
00040
00041     private:
00042         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00043
00044         Windows::Foundation::Collections::IObservableVector<SDKTemplate::UserViewModel> users = single_threaded_observable_vector<SDKTemplate::UserViewModel>();
00045         Windows::System::UserWatcher userWatcher{ nullptr };
00046         event_token userAddedToken{};
00047         event_token userUpdatedToken{};
00048         event_token userRemovedToken{};
00049         event_token enumerationCompletedToken{};
00050         event_token watcherStoppedToken{};
00051
00052         int userNumber = 1;
00053     };
00054 }
00055
00056 namespace winrt::SDKTemplate::factory_implementation
00057 {
00058     struct Scenario2_WatchUsers : Scenario2_WatchUsersT<Scenario2_WatchUsers, implementation::Scenario2_WatchUsers>
00059     {
00060     };
00061 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Read Member List

This is the complete list of members for Read, including all inherited members.
Address | ReadBinary |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
Read(byte pageAddress) | Read | [inline]
ReadBinary(ushort address, byte?expectedReturnBytes) | ReadBinary | [inline]
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderMain.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

CustomComputeShaderMain.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "DeviceResources.h"
00015 #include "CustomComputeShaderRenderer.h"
00016 #include "SampleOverlay.h"
00017
00018 // Renders Direct2D content on the screen.
00019 namespace CustomComputeShader
00020 {
00021     class CustomComputeShaderMain : public DX::IDeviceNotify
00022     {
00023     public:
00024         CustomComputeShaderMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00025         ~CustomComputeShaderMain();
00026         void CreateWindowSizeDependentResources();
00027         void Update();
00028         bool Render();
00029
00030         // IDeviceNotify
00031         virtual void OnDeviceLost();
00032         virtual void OnDeviceRestored();
00033
00034         // Process lifetime management handlers.
00035         void SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^ state);
00036         void LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^ state);
00037
00038     private:
00039         // Cached pointer to device resources.
00040         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00041
00042         std::unique_ptr<CustomComputeShaderRenderer> m_sceneRenderer;
00043         std::unique_ptr<SampleOverlay> m_sampleOverlay;
00044     };
00045 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/Functions.xaml.h Source File

  • XamlBind
  • cpp

Functions.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // Functions.xaml.h
00003 // Declaration of the Functions class
00004 //
00005
00006 #pragma once
00007
00008 #include "Functions.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     using namespace ::Platform;
00013     using namespace ::Windows::Globalization;
00014     using namespace ::Windows::Globalization::DateTimeFormatting;
00015     using namespace ::Windows::UI::Xaml::Media;
00016     using namespace ::Windows::UI;
00017     using namespace ::Windows::UI::Xaml;
00018
00019     public ref class ColorEntry sealed
00020     {
00021     public:
00022         property Platform::String^ ColorName;
00023         property Windows::UI::Color Color;
00024
00025         Windows::UI::Xaml::Media::SolidColorBrush^ Brushify(Windows::UI::Color c)
00026         {
00027             return ref new SolidColorBrush(c);
00028         }
00029     };
00030
00031     [Windows::Foundation::Metadata::WebHostHidden]
00032     public ref class Functions sealed
00033     {
00034     public:
00035         Functions();
00036
00037         property xBindSampleModel::DataModel^ Model;
00038
00039     private:
00040         void InitializeValues();
00041         void UpdateValuesClick(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void ResetValuesClick(Object^, Windows::UI::Xaml::RoutedEventArgs^ e);
00043         DateTimeFormatter^ _longTimeFormatter = ref new DateTimeFormatter("longtime");
00044
00045     public:
00046         property Windows::Foundation::Collections::IObservableVector<ColorEntry^>^ ColorEntries;
00047
00048         String^ GetTime();
00049         String^ Display(String^ stringArg, int intArg, double floatArg, bool boolArg);
00050         String^  countVowels(String^  words);
00051         String^ CountEmployees(xBindSampleModel::IEmployee^ e);
00052         Windows::UI::Xaml::Media::SolidColorBrush^ MakeColor(double red, double green, double blue);
00053         String^  ColorValue(double red, double green, double blue);
00054         void ProcessColor(String^  value);
00055         void PopulateColorsClick(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00056         void ClearColorsClick(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00057         Windows::UI::Xaml::Visibility ShowPlaceholder(unsigned int count);
00058         static Windows::UI::Xaml::Media::SolidColorBrush^ TextColor(Windows::UI::Color c);
00059         property bool IsNew;
00060     };
00061
00062 }
Generated on Fri Nov 15 2024 22:22:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ForegroundApp Member List

This is the complete list of members for Scenario3_ForegroundApp, including all inherited members.
AbortButton_Click(object sender, RoutedEventArgs e) | Scenario3_ForegroundApp | [inline, private]
AuthenticateButton_Click(object sender, RoutedEventArgs e) | Scenario3_ForegroundApp | [inline, private]
authenticationContext | Scenario3_ForegroundApp | [private]
ClearAuthenticationToken() | Scenario3_ForegroundApp | [inline, private]
InitializeForegroundAppAuthentication() | Scenario3_ForegroundApp | [inline, private]
OnBackgroundAuthenticationCompleted(ScenarioCommon sender, BackgroundAuthenticationCompletedEventArgs e) | Scenario3_ForegroundApp | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_ForegroundApp | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_ForegroundApp | [inline, protected]
rootPage | Scenario3_ForegroundApp | [private]
Scenario3_ForegroundApp() | Scenario3_ForegroundApp | [inline]
SkipButton_Click(object sender, RoutedEventArgs e) | Scenario3_ForegroundApp | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level4.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level4.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Level4.h"
00014 #include "Face.h"
00015
00016 Level4::Level4()
00017 {
00018     m_timeLimit = 30.0f;
00019     m_objective = L"Hit each of the moving targets in ORDER before time runs out.";
00020 }
00021
00022 void Level4::Initialize(std::vector<std::shared_ptr<GameObject>> const& objects)
00023 {
00024     Level3::Initialize(objects);
00025
00026     int targetCount = 0;
00027     for (auto&& object : objects)
00028     {
00029         if (auto target = dynamic_cast<Face*>(object.get()))
00030         {
00031             if (targetCount < 9)
00032             {
00033                 target->Target(targetCount == 0 ? true : false);
00034                 targetCount++;
00035             }
00036         }
00037     }
00038     m_nextId = 1;
00039 }
00040
00041 bool Level4::Update(
00042     float /* time */,
00043     float /* elapsedTime */,
00044     float /* timeRemaining */,
00045     std::vector<std::shared_ptr<GameObject>> const& objects
00046     )
00047 {
00048     int left = 0;
00049     for (auto&& object : objects)
00050     {
00051         if (object->Active() && (object->TargetId() > 0))
00052         {
00053             if (object->Hit() && (object->TargetId() == m_nextId))
00054             {
00055                 object->Active(false);
00056                 m_nextId++;
00057             }
00058             else
00059             {
00060                 left++;
00061             }
00062         }
00063         if (object->Active() && (object->TargetId() == m_nextId))
00064         {
00065             object->Target(true);
00066         }
00067     }
00068     return (left == 0);
00069 }
00070
00071 void Level4::SaveState(PersistentState& state)
00072 {
00073     state.SaveInt32(L":NextTarget", m_nextId);
00074 }
00075
00076 void Level4::LoadState(PersistentState& state)
00077 {
00078     m_nextId = state.LoadInt32(L":NextTarget", 1);
00079 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/Scenario2_SystemDefaultMenu.xaml.cs Source File

  • RadialController
  • cs

Scenario2_SystemDefaultMenu.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.Foundation;
00007 using Windows.Foundation.Collections;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Controls.Primitives;
00011 using Windows.UI.Xaml.Data;
00012 using Windows.UI.Xaml.Input;
00013 using Windows.UI.Xaml.Media;
00014 using Windows.UI.Xaml.Navigation;
00015 using Windows.UI.Input;
00016
00017 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario2_SystemDefaultMenu : Page
00022     {
00023         RadialControllerConfiguration config;
00024         RadialController controller;
00025         RadialControllerMenuItem customItem;
00026
00027         public Scenario2_SystemDefaultMenu()
00028         {
00029             this.InitializeComponent();
00030
00031             controller = RadialController.CreateForCurrentView();
00032             controller.RotationChanged += Controller_RotationChanged;
00033
00034             customItem = RadialControllerMenuItem.CreateFromKnownIcon("Item1", RadialControllerMenuKnownIcon.InkColor);
00035         }
00036
00037         protected override void OnNavigatedFrom(NavigationEventArgs e)
00038         {
00039             controller.Menu.Items.Clear();
00040         }
00041
00042         private void Controller_RotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args)
00043         {
00044             log.Text += "\nRotation Changed Delta = " + args.RotationDeltaInDegrees;
00045             if (args.Contact != null)
00046             {
00047                 log.Text += "\nBounds = " + args.Contact.Bounds.ToString();
00048                 log.Text += "\nPosition = " + args.Contact.Position.ToString();
00049             }
00050
00051             slider1.Value += args.RotationDeltaInDegrees;
00052         }
00053
00054         private void ModifySystemDefaults(object sender, RoutedEventArgs e)
00055         {
00056             config = RadialControllerConfiguration.GetForCurrentView();
00057             config.SetDefaultMenuItems(new[] { RadialControllerSystemMenuItemKind.Volume, RadialControllerSystemMenuItemKind.Scroll });
00058         }
00059
00060         private void Select_Volume(object sender, RoutedEventArgs e)
00061         {
00062             config = RadialControllerConfiguration.GetForCurrentView();
00063             config.TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind.Volume);
00064         }
00065
00066         private void SelectPreviouslySelectedItem(object sender, RoutedEventArgs e)
00067         {
00068             if (controller.Menu.TrySelectPreviouslySelectedMenuItem())
00069             {
00070                 PrintSelectedItem();
00071             }
00072         }
00073
00074         private void OnLogSizeChanged(object sender, object e)
00075         {
00076             logViewer.ChangeView(null, logViewer.ExtentHeight, null);
00077         }
00078
00079         private void PrintSelectedItem()
00080         {
00081             RadialControllerMenuItem selectedMenuItem = controller.Menu.GetSelectedMenuItem();
00082
00083             if (selectedMenuItem == customItem)
00084             {
00085                 log.Text += "\n Selected : " + selectedMenuItem.DisplayText;
00086             }
00087             else
00088             {
00089                 log.Text += "\n Selected System Item";
00090             }
00091         }
00092
00093         private void Reset_ToDefault(object sender, RoutedEventArgs e)
00094         {
00095             config = RadialControllerConfiguration.GetForCurrentView();
00096             config.ResetToDefaultMenuItems();
00097         }
00098
00099         private void AddCustomItem(object sender, RoutedEventArgs e)
00100         {
00101             if (!controller.Menu.Items.Contains(customItem))
00102             {
00103                 controller.Menu.Items.Add(customItem);
00104             }
00105         }
00106
00107         private void RemoveCustomItem(object sender, RoutedEventArgs e)
00108         {
00109             if (controller.Menu.Items.Contains(customItem))
00110             {
00111                 controller.Menu.Items.Remove(customItem);
00112             }
00113         }
00114
00115         private void SelectCustomItem(object sender, RoutedEventArgs e)
00116         {
00117             if (controller.Menu.Items.Contains(customItem))
00118             {
00119                 controller.Menu.SelectMenuItem(customItem);
00120             }
00121         }
00122
00123         private void Remove_Defaults(object sender, RoutedEventArgs e)
00124         {
00125             config = RadialControllerConfiguration.GetForCurrentView();
00126             config.SetDefaultMenuItems(new RadialControllerSystemMenuItemKind[] { });
00127         }
00128     }
00129 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TlvEntry Member List

This is the complete list of members for TlvEntry, including all inherited members.
GetData(ushort?statusWord=null) | TlvEntry | [inline]
Length | TlvEntry | [private]
Tag | TlvEntry | [private]
TagLength | TlvEntry | [private]
TlvEntry(ushort tag, object value) | TlvEntry | [inline]
Value | TlvEntry | [private]
ValueLength | TlvEntry | [private]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Metering Member List

This is the complete list of members for Metering, including all inherited members.
_data | Metering | [private]
event | Metering | [private]
GetMeteringData() const | Metering |
Metering(__int64 period) | Metering |
MeteringWorker() | Metering |
samplePeriod | Metering | [private]
SetSamplePeriod(__int64 period) | Metering |
StartMetering(__int64 samplePeriod, __int64 context) | Metering |
StopMetering() | Metering |
stopMeteringRequested | Metering | [private]
tpTimer | Metering | [private]
WaitForMeteringData() const | Metering |
~Metering() | Metering |
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario3_ChangeEvents.xaml.cs Source File

  • ActivitySensor
  • cs

Scenario3_ChangeEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Enumeration;
00014 using Windows.Devices.Sensors;
00015 using Windows.Foundation;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario3_ChangeEvents : Page
00024     {
00025         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00026         // as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         // Common class ID for activity sensors
00030         Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196");
00031
00032         private DeviceAccessInformation _deviceAccessInformation;
00033         private ActivitySensor _activitySensor;
00034
00035         public Scenario3_ChangeEvents()
00036         {
00037             this.InitializeComponent();
00038             _activitySensor = null;
00039
00040             // Register for access changed notifications for activity sensors
00041             _deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
00042             _deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(AccessChanged);
00043         }
00044
00045         /// <summary>
00046         /// Invoked when this page is about to be displayed in a Frame.
00047         /// </summary>
00048         /// <param name="e">Event data that describes how this page was reached. The Parameter
00049         /// property is typically used to configure the page.</param>
00050         protected override void OnNavigatedTo(NavigationEventArgs e)
00051         {
00052             ScenarioEnableReadingChangedButton.IsEnabled = true;
00053             ScenarioDisableReadingChangedButton.IsEnabled = false;
00054         }
00055
00056         /// <summary>
00057         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00058         /// </summary>
00059         /// <param name="e">
00060         /// Event data that can be examined by overriding code. The event data is representative
00061         /// of the navigation that will unload the current Page unless canceled. The
00062         /// navigation can potentially be canceled by setting Cancel.
00063         /// </param>
00064         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00065         {
00066             if (ScenarioDisableReadingChangedButton.IsEnabled && _activitySensor != null)
00067             {
00068                 _activitySensor.ReadingChanged -= new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);
00069             }
00070
00071             base.OnNavigatingFrom(e);
00072         }
00073
00074         /// <summary>
00075         /// This is the event handler for ReadingChanged events.
00076         /// </summary>
00077         /// <param name="sender"></param>
00078         /// <param name="e"></param>
00079         async private void ReadingChanged(object sender, ActivitySensorReadingChangedEventArgs e)
00080         {
00081             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00082             {
00083                 ActivitySensorReading reading = e.Reading;
00084                 ScenarioOutput_Activity.Text = reading.Activity.ToString();
00085                 ScenarioOutput_Confidence.Text = reading.Confidence.ToString();
00086                 ScenarioOutput_ReadingTimestamp.Text = reading.Timestamp.ToString("u");
00087             });
00088         }
00089
00090         /// <summary>
00091         /// This is the click handler for the 'Reading Changed On' button.
00092         /// </summary>
00093         /// <param name="sender"></param>
00094         /// <param name="e"></param>
00095         private async void ScenarioEnableReadingChanged(object sender, RoutedEventArgs e)
00096         {
00097             // Determine if we can access activity sensors
00098             if (_deviceAccessInformation.CurrentStatus == DeviceAccessStatus.Allowed)
00099             {
00100                 if (_activitySensor == null)
00101                 {
00102                     _activitySensor = await ActivitySensor.GetDefaultAsync();
00103                 }
00104
00105                 if (_activitySensor != null)
00106                 {
00107                     _activitySensor.SubscribedActivities.Add(ActivityType.Walking);
00108                     _activitySensor.SubscribedActivities.Add(ActivityType.Running);
00109                     _activitySensor.SubscribedActivities.Add(ActivityType.InVehicle);
00110                     _activitySensor.SubscribedActivities.Add(ActivityType.Biking);
00111                     _activitySensor.SubscribedActivities.Add(ActivityType.Fidgeting);
00112
00113                     _activitySensor.ReadingChanged += new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);
00114
00115                     ScenarioEnableReadingChangedButton.IsEnabled = false;
00116                     ScenarioDisableReadingChangedButton.IsEnabled = true;
00117                     rootPage.NotifyUser("Subscribed to reading changes", NotifyType.StatusMessage);
00118                 }
00119                 else
00120                 {
00121                     rootPage.NotifyUser("No activity sensor found", NotifyType.ErrorMessage);
00122                 }
00123             }
00124             else
00125             {
00126                 rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
00127             }
00128         }
00129
00130         /// <summary>
00131         /// This is the click handler for the 'Reading Changed Off' button.
00132         /// </summary>
00133         /// <param name="sender"></param>
00134         /// <param name="e"></param>
00135         private void ScenarioDisableReadingChanged(object sender, RoutedEventArgs e)
00136         {
00137             if (_activitySensor != null)
00138             {
00139                 _activitySensor.ReadingChanged -= new TypedEventHandler<ActivitySensor, ActivitySensorReadingChangedEventArgs>(ReadingChanged);
00140                 rootPage.NotifyUser("Unsubscribed from reading changes", NotifyType.StatusMessage);
00141             }
00142
00143             ScenarioEnableReadingChangedButton.IsEnabled = true;
00144             ScenarioDisableReadingChangedButton.IsEnabled = false;
00145         }
00146
00147         /// <summary>
00148         /// This is the event handler for AccessChanged events.
00149         /// </summary>
00150         /// <param name="sender"></param>
00151         /// <param name="e"></param>
00152         private async void AccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
00153         {
00154             var status = e.Status;
00155             if (status != DeviceAccessStatus.Allowed)
00156             {
00157                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00158                 {
00159                     rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
00160                     _activitySensor = null;
00161
00162                     ScenarioEnableReadingChangedButton.IsEnabled = true;
00163                     ScenarioDisableReadingChangedButton.IsEnabled = false;
00164                 });
00165             }
00166         }
00167     }
00168 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/pch.h Source File

  • Barometer
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoGallery.xaml.h Source File

  • 360VideoPlayback
  • cpp

VideoGallery.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // VideoGallery.xaml.h
00003 // Declaration of the VideoGallery class
00004 //
00005
00006 #pragma once
00007
00008 #include "VideoGallery.g.h"
00009 #include "VideoItem.h"
00010
00011 namespace _360VideoPlayback
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public ref class VideoGallery sealed
00017     {
00018     public:
00019         VideoGallery();
00020         static int GetMainViewId() { return mainviewId; }
00021
00022     private:
00023         void GalleryGridView_ItemClick(Platform::Object^ sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^ e);
00024         void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00025         static int mainviewId;
00026     };
00027 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario2_SynchronizingPlayers.xaml.cs Source File

  • VideoPlaybackSynchronization
  • cs

Scenario2_SynchronizingPlayers.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Media;
00015 using Windows.Media.Core;
00016 using Windows.Media.Playback;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// Multi-video playback syncronization using TimelineControllerPositionOffset.
00026     /// </summary>
00027     public sealed partial class Scenario2_SynchronizingPlayers : Page
00028     {
00029         private List<MediaPlayerElement> mediaPlayerElements;
00030         private MediaTimelineController timelineController = null;
00031         private TimeSpan maxNaturalDurationForController = TimeSpan.Zero;
00032
00033         // These videos will be played in the corresponding MediaPlayerElements.
00034         private Uri[] mediaUris = new Uri[2]
00035         {
00036                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back.mp4"),
00037                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back-offset-5-seconds.mp4"),
00038         };
00039
00040         public Scenario2_SynchronizingPlayers()
00041         {
00042             this.InitializeComponent();
00043
00044             mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeCopy };
00045
00046             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00047             {
00048                 // Create a corresponding MediaPlayer for each MediaPlayerElement.
00049                 mpe.SetMediaPlayer(new MediaPlayer());
00050             }
00051         }
00052
00053         private void Page_OnUnloaded(object sender, RoutedEventArgs e)
00054         {
00055             // Dispose the MediaPlayer objects so they will stop streaming.
00056             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00057             {
00058                 MediaPlayer mp = mpe.MediaPlayer;
00059                 mp.MediaOpened -= MediaPlayer_MediaOpened;
00060                 mp.Dispose();
00061             }
00062         }
00063
00064         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00065         {
00066             // Create a single MediaTimelineController which will control all of the MediaPlayers.
00067             timelineController = new MediaTimelineController();
00068
00069             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00070             {
00071                 MediaPlayer mp = mpe.MediaPlayer;
00072
00073                 // The CommandManager object must be disabled when attaching a MediaTimelineController.
00074                 // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
00075                 // and apply additional business logic.
00076                 // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
00077                 mp.CommandManager.IsEnabled = false;
00078                 // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
00079                 mp.TimelineController = timelineController;
00080
00081                 // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
00082                 // To avoid confusing the user, it is best to turn them off.
00083                 mpe.AreTransportControlsEnabled = false;
00084
00085                 // MediaOpened is the right time to find the highest natural duration.
00086                 mp.MediaOpened += MediaPlayer_MediaOpened;
00087             }
00088
00089             // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
00090             timelineController.StateChanged += MediaTimelineController_StateChanged;
00091
00092             // Since this is a sample of video on demand, constrain the MediaTimelineController
00093             // to pause when it reaches the natural end of the last video.
00094             timelineController.PositionChanged += MediaTimelineController_PositionChanged;
00095
00096             // We are now set up to load content.
00097             Load.IsEnabled = true;
00098         }
00099
00100         private void MediaPlayer_MediaOpened(MediaPlayer sender, object args)
00101         {
00102             // Maintain maxNaturalDurationForController so it is as long as the longest media source.
00103             var naturalDurationForController = sender.PlaybackSession.NaturalDuration - sender.TimelineControllerPositionOffset;
00104             if (naturalDurationForController > maxNaturalDurationForController)
00105             {
00106                 maxNaturalDurationForController = naturalDurationForController;
00107             }
00108         }
00109
00110         private async void MediaTimelineController_StateChanged(MediaTimelineController sender, object args)
00111         {
00112             // Update the Play/Pause button based on the new state.
00113             Symbol newSymbol;
00114             switch (sender.State)
00115             {
00116                 case MediaTimelineControllerState.Paused:
00117                     newSymbol = Symbol.Play;
00118                     break;
00119
00120                 case MediaTimelineControllerState.Running:
00121                     newSymbol = Symbol.Pause;
00122                     break;
00123
00124                 default:
00125                     return;
00126             }
00127             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
00128         }
00129
00130         private void MediaTimelineController_PositionChanged(MediaTimelineController sender, object args)
00131         {
00132             // Pause when playback reaches the maximum duration.
00133             if (sender.Position > maxNaturalDurationForController)
00134             {
00135                 sender.Pause();
00136             }
00137         }
00138
00139         private void EnablePlaybackControls(bool enabled)
00140         {
00141             Seek2SecondsBack.IsEnabled = enabled;
00142             PlayPause.IsEnabled = enabled;
00143             Seek2SecondsForward.IsEnabled = enabled;
00144         }
00145
00146         /// <summary>
00147         /// Sets the content on the MediaPlayers
00148         /// </summary>
00149         private void Load_Click(object sender, RoutedEventArgs e)
00150         {
00151             EnablePlaybackControls(false);
00152
00153             // First reset the max duration, as the content is about to change.
00154             maxNaturalDurationForController = TimeSpan.Zero;
00155
00156             // Correct for offset between the two videos.
00157             // Do this before setting the Source on the MediaPlayer to avoid a visible seek on MediaOpened.
00158             mediaPlayerElements[1].MediaPlayer.TimelineControllerPositionOffset = TimeSpan.FromSeconds(5.1);
00159
00160             for (int i = 0; i < mediaUris.Length; i++)
00161             {
00162                 MediaPlayer mp = mediaPlayerElements[i].MediaPlayer;
00163
00164                 // Set the Source property to a MediaSource, MediaPlaybackItem or MediaPlaybackList.
00165                 mp.Source = MediaSource.CreateFromUri(mediaUris[i]);
00166
00167                 // In this demo, all of the videos has the same audio track, so mute all but the first one.
00168                 mp.IsMuted = (i != 0);
00169             }
00170
00171             // Enable our custom playback controls now that everything is set up.
00172             EnablePlaybackControls(true);
00173         }
00174
00175         private void PlayPause_Click(object sender, RoutedEventArgs e)
00176         {
00177             if (timelineController.State == MediaTimelineControllerState.Paused)
00178             {
00179                 timelineController.Resume();
00180             }
00181             else if (timelineController.State == MediaTimelineControllerState.Running)
00182             {
00183                 timelineController.Pause();
00184             }
00185         }
00186
00187         private void Seek2SecondsForward_Click(object sender, RoutedEventArgs e)
00188         {
00189             // Go forward 2 seconds, but not beyond our maximum value.
00190             var requestedPosition = timelineController.Position + TimeSpan.FromSeconds(2);
00191             if (requestedPosition <= maxNaturalDurationForController)
00192             {
00193                 timelineController.Position = requestedPosition;
00194             }
00195             else
00196             {
00197                 timelineController.Position = maxNaturalDurationForController;
00198             }
00199         }
00200
00201         private void Seek2SecondsBack_Click(object sender, RoutedEventArgs e)
00202         {
00203             timelineController.Position -= TimeSpan.FromSeconds(2);
00204         }
00205     }
00206 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/SampleConfiguration.cpp Source File

  • Logging
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "LoggingChannel", "SDKTemplate.Scenario1" },
00021     { "LoggingSession", "SDKTemplate.Scenario2" },
00022     { "FileLoggingSession", "SDKTemplate.Scenario3" }
00023 };
Generated on Fri Nov 15 2024 22:17:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseControl.cpp Source File

  • 360VideoPlayback
  • cpp
  • Common

BaseControl.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "BaseControl.h"
00003 #include "DirectXHelper.h"
00004 #include "DirectXCollision.h"
00005 #include "..\360VideoPlaybackMain.h"
00006
00007 using namespace _360VideoPlayback;
00008 using namespace Concurrency;
00009 using namespace DirectX;
00010 using namespace DirectX::TriangleTests;
00011 using namespace D2D1;
00012 using namespace DX;
00013 using namespace Microsoft::WRL;
00014 using namespace Windows::Foundation::Numerics;
00015 using namespace Windows::UI::Input::Spatial;
00016
00017 const float4 defaultGlassColor = { 0.0f, 0.0f, 0.0f, 0.5f };
00018 const float4 constantFocusPointColor = { 1.0f, 1.0f, 1.0f, 1.0f };
00019 const float constantFocusPointRadius = 0.1f;
00020 const float constantFocusPointIntensity = 1.0f;
00021
00022 BaseControl::BaseControl(const std::shared_ptr<MeshGeometry> geometry)
00023 {
00024     m_deviceResources = _360VideoPlaybackMain::GetDeviceResources();
00025     m_isVisible = false;
00026     m_isInitialized = false;
00027     m_isFocused = false;
00028     m_textureWidth = DEFAULT_TEXTURE_SIZE;
00029     m_textureHeight = DEFAULT_TEXTURE_SIZE;
00030     m_geometry = geometry;
00031     m_scale = float3(1.0f, 1.0f, 1.0f);
00032     m_position = float3(0, 0, 0);
00033     m_isVisible = true;
00034     m_transform = float4x4::identity();
00035     m_parentTransform = float4x4::identity();
00036     m_relativeIntersectionPoint = float2(0.0f);
00037 }
00038
00039 void BaseControl::Initialize()
00040 {
00041     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(_360VideoPlayback::ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00042
00043     DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateBuffer(
00044         &constantBufferDesc,
00045         nullptr,
00046         &m_modelConstantBuffer));
00047
00048     CalculateInitialSize();
00049
00050     AllocateTexture();
00051
00052     InitializeFocusPoint();
00053
00054     m_isInitialized = true;
00055 }
00056
00057 void BaseControl::AllocateTexture()
00058 {
00059     // Create the texture to render the glyph for this control as well as the glyph for the control.
00060     // NOTE: If we want visual fidelity that better matches the distance the user is from the button we should
00061     // have different sizes of textures (and glyphs) depending on how close the user is to the control.
00062     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00063     auto d3ddevice = m_deviceResources->GetD3DDevice();
00064     ComPtr<IDXGISurface> cubeTextureSurface;
00065     CD3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;
00066     D3D11_SAMPLER_DESC samplerDescription;
00067     CD3D11_TEXTURE2D_DESC textureDesc;
00068     FLOAT dpiX;
00069     FLOAT dpiY;
00070
00071     // Create texture for rendering d2d onto
00072     textureDesc = CD3D11_TEXTURE2D_DESC(
00073         DXGI_FORMAT_B8G8R8A8_UNORM,
00074         m_textureWidth,         // Width
00075         m_textureHeight,        // Height
00076         1,                      // MipLevels
00077         1,                      // ArraySize
00078         D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
00079     );
00080
00081     DX::ThrowIfFailed(d3ddevice->CreateTexture2D(
00082         &textureDesc,
00083         nullptr,
00084         &m_texture));
00085     shaderResourceViewDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(
00086         m_texture.Get(),
00087         D3D11_SRV_DIMENSION_TEXTURE2D);
00088     DX::ThrowIfFailed(d3ddevice->CreateShaderResourceView(
00089         m_texture.Get(),
00090         &shaderResourceViewDesc,
00091         &m_textureShaderResourceView));
00092
00093     d2dContext->GetDpi(&dpiX, &dpiY);
00094     D2D1_BITMAP_PROPERTIES1 bitmapProperties =
00095         D2D1::BitmapProperties1(
00096             D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
00097             D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00098             dpiX,
00099             dpiY);
00100     m_texture.As(&cubeTextureSurface);
00101
00102     DX::ThrowIfFailed(d2dContext->CreateBitmapFromDxgiSurface(
00103         cubeTextureSurface.Get(),
00104         &bitmapProperties,
00105         &m_textureTarget));
00106
00107     // create the sampler
00108     ZeroMemory(&samplerDescription, sizeof(D3D11_SAMPLER_DESC));
00109     samplerDescription.Filter = D3D11_FILTER_ANISOTROPIC;
00110     samplerDescription.AddressU = D3D11_TEXTURE_ADDRESS_BORDER;
00111     samplerDescription.AddressV = D3D11_TEXTURE_ADDRESS_BORDER;
00112     samplerDescription.AddressW = D3D11_TEXTURE_ADDRESS_BORDER;
00113     samplerDescription.MipLODBias = 0.0f;
00114     samplerDescription.MaxAnisotropy = 4;
00115     samplerDescription.ComparisonFunc = D3D11_COMPARISON_NEVER;
00116     samplerDescription.BorderColor[0] = defaultGlassColor.x;
00117     samplerDescription.BorderColor[1] = defaultGlassColor.y;
00118     samplerDescription.BorderColor[2] = defaultGlassColor.z;
00119     samplerDescription.BorderColor[3] = defaultGlassColor.w;
00120     // allow use of all mip levels
00121     samplerDescription.MinLOD = 0;
00122     samplerDescription.MaxLOD = D3D11_FLOAT32_MAX;
00123     DX::ThrowIfFailed(d3ddevice->CreateSamplerState(
00124         &samplerDescription,
00125         &m_sampler));
00126     DX::ThrowIfFailed(m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock));
00127 }
00128
00129 void BaseControl::Update(const StepTimer& timer, SpatialPointerPose^ cameraPose)
00130 {
00131     auto scale = m_scale;
00132     const XMMATRIX modelScale = XMMatrixScalingFromVector(XMLoadFloat3(&scale));
00133     const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00134     const XMMATRIX localTransform = XMMatrixMultiply(modelScale, modelTranslation);
00135     const XMMATRIX parentTransform = XMLoadFloat4x4(&m_parentTransform);
00136     const XMMATRIX modelTransform = XMMatrixMultiply(localTransform, parentTransform);
00137
00138     XMStoreFloat4x4(&m_transform, modelTransform);
00139     // Update local copy of Constant buffer
00140     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(XMLoadFloat4x4(&m_transform)));
00141
00142     if (m_isVisible && cameraPose != nullptr)
00143     {
00144         m_isFocused = IsFocusOnControl(XMLoadFloat4x4(&m_transform), cameraPose);
00145     }
00146
00147     // Update spot light parameters
00148     m_focusPointConstantBufferData.focusPointOrigin = { cameraPose->Head->Position.x, cameraPose->Head->Position.y, cameraPose->Head->Position.z, 1.0f };
00149     m_focusPointConstantBufferData.focusPointDirection = { cameraPose->Head->ForwardDirection.x, cameraPose->Head->ForwardDirection.y, cameraPose->Head->ForwardDirection.z, 1.0f };
00150     m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
00151         m_focusPointConstantBuffer.Get(),
00152         0,
00153         nullptr,
00154         &m_focusPointConstantBufferData,
00155         0,
00156         0);
00157     m_renderItem->SetParentControlInformation(m_isFocused, m_relativeIntersectionPoint, m_textureWidth, m_textureHeight);
00158     m_renderItem->Update(timer, cameraPose);
00159     if (m_renderItem->GetIsRenderPassNeeded())
00160     {
00161         m_isUITextureRenderNeeded = true;
00162     }
00163 }
00164
00165 void BaseControl::Render()
00166 {
00167     if (m_isVisible)
00168     {
00169         UploadGeometryAndShaders();
00170         ApplyPixelShader();
00171         // At this point everything should be set, so Draw the objects.
00172         m_deviceResources->GetD3DDeviceContext()->DrawIndexedInstanced(
00173             m_geometry->IndexCount,  // Index count per instance.
00174             2,                       // Instance count.
00175             0,                       // Start index location.
00176             0,                       // Base vertex location.
00177             0);                      // Start instance location.
00178     }
00179 }
00180
00181 void BaseControl::UploadGeometryAndShaders()
00182 {
00183     const auto context = m_deviceResources->GetD3DDeviceContext();
00184
00185     // Update the model transform buffer
00186     context->UpdateSubresource(
00187         m_modelConstantBuffer.Get(),
00188         0,
00189         nullptr,
00190         &m_modelConstantBufferData,
00191         0,
00192         0);
00193
00194     const UINT stride = m_geometry->VertexStride;
00195     const UINT offset = 0;
00196     context->IASetVertexBuffers(
00197         0,
00198         1,
00199         m_geometry->VertexBuffer.GetAddressOf(),
00200         &stride,
00201         &offset);
00202     context->IASetIndexBuffer(
00203         m_geometry->IndexBuffer.Get(),
00204         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00205         0);
00206     context->IASetPrimitiveTopology(m_geometry->Topology);
00207     context->IASetInputLayout(m_inputLayout.Get());
00208
00209     // Attach the vertex shader.
00210     context->VSSetShader(
00211         m_vertexShader.Get(),
00212         nullptr, 0);
00213     // Apply the model constant buffer to the vertex shader.
00214     context->VSSetConstantBuffers(
00215         0,
00216         1,
00217         m_modelConstantBuffer.GetAddressOf());
00218     m_deviceResources->GetD3DDeviceContext()->GSSetShader(
00219         m_geometryShader.Get(),
00220         nullptr,
00221         0);
00222 }
00223
00224 void BaseControl::ApplyPixelShader()
00225 {
00226     m_deviceResources->GetD3DDeviceContext()->PSSetShader(
00227         m_pixelShader.Get(),
00228         nullptr,
00229         0);
00230
00231     m_deviceResources->GetD3DDeviceContext()->PSSetConstantBuffers(
00232         1, /*StartSlot*/
00233         1, /*NumBuffers*/
00234         m_focusPointConstantBuffer.GetAddressOf()
00235     );
00236
00237     if (m_isUITextureRenderNeeded)
00238     {
00239         auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00240         d2dContext->SaveDrawingState(m_stateBlock.Get());
00241         d2dContext->GetTarget(m_d2dContextTargetToRestore.GetAddressOf());
00242         // Set target to current texture
00243         d2dContext->SetTarget(m_textureTarget.Get());
00244         d2dContext->BeginDraw();
00245         ColorF clearColor = D2D1::ColorF(defaultGlassColor.x, defaultGlassColor.y, defaultGlassColor.z, defaultGlassColor.w);
00246         d2dContext->Clear(clearColor);
00247
00248         m_renderItem->TryRender();
00249
00250         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00251         // is lost. It will be handled during the next call to Present.
00252         auto endDrawHR = d2dContext->EndDraw();
00253         if (endDrawHR == D2DERR_RECREATE_TARGET)
00254         {
00255             return;
00256         }
00257         // We need to restore the previously set d2dContext target so
00258         // future draw calls draw to the correct place.
00259         d2dContext->SetTarget(m_d2dContextTargetToRestore.Get());
00260         d2dContext->RestoreDrawingState(m_stateBlock.Get());
00261         m_isUITextureRenderNeeded = false;
00262     }
00263
00264     // Tell the shader to use the texture
00265     m_deviceResources->GetD3DDeviceContext()->PSSetShaderResources(
00266         0,
00267         1,
00268         m_textureShaderResourceView.GetAddressOf());
00269
00270     m_deviceResources->GetD3DDeviceContext()->PSSetSamplers(
00271         0,
00272         1,
00273         m_sampler.GetAddressOf());
00274 }
00275
00276 void BaseControl::SetParentTransform(float4x4 transform)
00277 {
00278     m_parentTransform = transform;
00279 }
00280
00281 void BaseControl::SetScale(float3 value)
00282 {
00283     m_scale = value;
00284 }
00285
00286 void BaseControl::SetPosition(float3 value)
00287 {
00288     m_position = value;
00289 }
00290
00291
00292 void BaseControl::InitializeFocusPoint()
00293 {
00294     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(FocusPointConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00295     DX::ThrowIfFailed(
00296         m_deviceResources->GetD3DDevice()->CreateBuffer(
00297             &constantBufferDesc,
00298             nullptr,
00299             &m_focusPointConstantBuffer));
00300
00301     m_focusPointConstantBufferData.focusPointIntensity = { constantFocusPointIntensity,  constantFocusPointIntensity,  constantFocusPointIntensity, constantFocusPointIntensity };
00302     m_focusPointConstantBufferData.focusPointColor = { constantFocusPointColor.x, constantFocusPointColor.y, constantFocusPointColor.z, constantFocusPointColor.w };
00303     m_focusPointConstantBufferData.focusPointRadius = { constantFocusPointRadius,  constantFocusPointRadius,  constantFocusPointRadius, constantFocusPointRadius };
00304     m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
00305         m_focusPointConstantBuffer.Get(),
00306         0,
00307         nullptr,
00308         &m_focusPointConstantBufferData,
00309         0,
00310         0
00311     );
00312 }
00313
00314 void BaseControl::SetIsVisible(bool value)
00315 {
00316     m_isVisible = value;
00317     if (!m_isVisible) // clear focus if you are turned off
00318     {
00319         m_isFocused = false;
00320     }
00321 }
00322
00323 void BaseControl::PerformPressedAction()
00324 {
00325     if (m_renderItem->IsFocused())
00326     {
00327         m_renderItem->PerformAction();
00328     }
00329 }
00330
00331 void BaseControl::ApplyShaders()
00332 {
00333     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(L"ms-appx:///GlassVertexShader.cso");
00334     task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
00335     {
00336         std::vector<D3D11_INPUT_ELEMENT_DESC> vertexPositionTextureDesc =
00337         { {
00338                 { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00339                 { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00340                 } };
00341         DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateVertexShader(
00342             fileData.data(),
00343             fileData.size(),
00344             nullptr,
00345             &m_vertexShader));
00346
00347         DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateInputLayout(
00348             vertexPositionTextureDesc.data(),
00349             static_cast<UINT>(vertexPositionTextureDesc.size()),
00350             fileData.data(),
00351             fileData.size(),
00352             &m_inputLayout));
00353     });
00354
00355     task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///GlassPixelShader.cso");
00356     task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
00357     {
00358         DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreatePixelShader(
00359             fileData.data(),
00360             fileData.size(),
00361             nullptr,
00362             &m_pixelShader));
00363     });
00364
00365     task<std::vector<byte>> loadGSTask = DX::ReadDataAsync(L"ms-appx:///GlassGeometryShader.cso");
00366
00367     task<void> createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
00368     {
00369         DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00370             fileData.data(),
00371             fileData.size(),
00372             nullptr,
00373             &m_geometryShader));
00374     });
00375
00376     task<void> shaderTaskGroup = (createPSTask && createVSTask && createGSTask);
00377     task<void> createSphereTask = shaderTaskGroup.then([this]()
00378     {
00379     });
00380 }
00381
00382 void BaseControl::SnapInitialSizeToRootElement()
00383 {
00384     m_snapSizeToRootElement = true;
00385 }
00386
00387 void BaseControl::CalculateInitialSize()
00388 {
00389     // Calculate the geometry scale based on the texture dimensions
00390     if (m_snapSizeToRootElement)
00391     {
00392         m_textureWidth = static_cast<UINT>(m_renderItem->GetElementSize().x);
00393         if (m_textureWidth == 0)
00394         {
00395             m_textureWidth = DEFAULT_TEXTURE_SIZE;
00396         }
00397         m_textureHeight = static_cast<UINT>(m_renderItem->GetElementSize().y);
00398         if (m_textureHeight == 0)
00399         {
00400             m_textureHeight = DEFAULT_TEXTURE_SIZE;
00401         }
00402
00403         // Scale the geometry so we fit 128 texture pixels per geometry unit.
00404         float geometryWidth = m_textureWidth / static_cast<float>(DEFAULT_TEXTURE_SIZE);
00405         float geomeryHeight = m_textureHeight / static_cast<float>(DEFAULT_TEXTURE_SIZE);
00406
00407         m_scale.x *= geometryWidth;
00408         m_scale.y *= geomeryHeight;
00409     }
00410     else
00411     {
00412         // Scale the geometry so we fit 128 texture pixels per geometry unit.
00413         float geometryWidth = m_textureWidth / static_cast<float>(DEFAULT_TEXTURE_SIZE);
00414         float geomeryHeight = m_textureHeight / static_cast<float>(DEFAULT_TEXTURE_SIZE);
00415
00416         m_scale.x *= geometryWidth;
00417         m_scale.y *= geomeryHeight;
00418     }
00419 }
00420
00421 void BaseControl::SetRenderElement(std::shared_ptr<FocusableElement> renderItem)
00422 {
00423     m_renderItem = renderItem;
00424 }
00425
00426 bool BaseControl::IsFocusOnControl(const XMMATRIX& transform, SpatialPointerPose^ cameraPose)
00427 {
00428     // Compute Base Plane Cube Bounds
00429     float4 topLeft = float4(-0.5f, 0.5f, 0.5f, 1.0f);
00430     float4 topRight = float4(0.5f, 0.5f, 0.5f, 1.0f);
00431     float4 bottomRight = float4(0.5f, -0.5f, 0.5f, 1.0f);
00432     float4 bottomLeft = float4(-0.5f, -0.5f, 0.5f, 1.0f);
00433
00434     XMVECTOR transformedVerts[4];
00435     transformedVerts[0] = XMVector4Transform(XMLoadFloat4(&topLeft), transform);
00436     transformedVerts[1] = XMVector4Transform(XMLoadFloat4(&topRight), transform);
00437     transformedVerts[2] = XMVector4Transform(XMLoadFloat4(&bottomRight), transform);
00438     transformedVerts[3] = XMVector4Transform(XMLoadFloat4(&bottomLeft), transform);
00439
00440     // After applying trasformation, W component of the transformed 4 value vectors to be 1
00441 #ifdef _XM_SSE_INTRINSICS_
00442     _ASSERTE(transformedVerts[0].m128_f32[3] == 1);
00443 #endif // _XM_SSE_INTRINSICS_
00444 #ifdef _XM_ARM_NEON_INTRINSICS_
00445     _ASSERTE(transformedVerts[0].n128_f32[3] == 1);
00446 #endif // _XM_ARM_NEON_INTRINSICS_
00447
00448     // This is fine to do Vector3
00449     XMVECTOR normal = XMVector3Cross(XMVectorSubtract(transformedVerts[3], transformedVerts[0]), XMVectorSubtract(transformedVerts[1], transformedVerts[0]));
00450
00451     float3 rayPosition = cameraPose->Head->Position;
00452     float3 rayDirection = cameraPose->Head->ForwardDirection;
00453     // If the Dot product between two vectors is less than 0, then the two normals are pointing the same direction
00454     // The normal computed above points in the direction that the front face is facing, so if another vector points the same direction as it, then it is looking at the back side
00455     // When using XMVector3Dot(), the scalar result of the Dot product is copied to all members of the returned XMVECTOR type. To get the result you just need to
00456     // access a member of the XMVECTOR
00457 #ifdef _XM_SSE_INTRINSICS_
00458     if (XMVector3Dot(XMLoadFloat3(&rayDirection), normal).m128_f32[0] < 0.0f) // only perform intersection if we're looking at the front of the plane
00459 #endif // _XM_SSE_INTRINSICS_
00460 #ifdef _XM_ARM_NEON_INTRINSICS_
00461         if (XMVector3Dot(XMLoadFloat3(&rayDirection), normal).n128_f32[0] < 0.0f) // only perform intersection if we're looking at the front of the plane
00462 #endif // _XM_ARM_NEON_INTRINSICS_
00463         {
00464             float t1IntersectDistance;
00465             float t2IntersectDistance;
00466             float focusedDistance;
00467             bool t1Intersects = Intersects(
00468                 XMLoadFloat3(&rayPosition),
00469                 XMLoadFloat3(&rayDirection),
00470                 transformedVerts[0],
00471                 transformedVerts[1],
00472                 transformedVerts[3],
00473                 OUT t1IntersectDistance);
00474             bool t2Intersects = Intersects(
00475                 XMLoadFloat3(&rayPosition),
00476                 XMLoadFloat3(&rayDirection),
00477                 transformedVerts[3],
00478                 transformedVerts[2],
00479                 transformedVerts[1],
00480                 OUT t2IntersectDistance);
00481             if (t1Intersects || t2Intersects)
00482             {
00483                 if (t1Intersects && t2Intersects)
00484                 {
00485                     focusedDistance = t1IntersectDistance < t2IntersectDistance ? t1IntersectDistance : t2IntersectDistance;
00486                 }
00487                 else
00488                 {
00489                     focusedDistance = t1Intersects ? t1IntersectDistance : t2IntersectDistance;
00490                 }
00491                 float3 intersectionPosition = rayPosition + (focusedDistance * rayDirection);
00492                 XMVECTOR modelSpaceIntersectionPoint = XMVector3Transform(XMLoadFloat3(&intersectionPosition), XMMatrixInverse(nullptr, transform));
00493
00494 #ifdef _XM_SSE_INTRINSICS_
00495                 m_relativeIntersectionPoint = float2(abs(modelSpaceIntersectionPoint.m128_f32[0] - (-0.5f)), abs(modelSpaceIntersectionPoint.m128_f32[1] - 0.5f));
00496 #endif // _XM_SSE_INTRINSICS_
00497 #ifdef _XM_ARM_NEON_INTRINSICS_
00498                 m_relativeIntersectionPoint = float2(abs(modelSpaceIntersectionPoint.n128_f32[0] - m_minXY.x), abs(modelSpaceIntersectionPoint.n128_f32[1] - m_minXY.y));
00499 #endif // _XM_ARM_NEON_INTRINSICS_
00500
00501                 return true;
00502             }
00503         }
00504     return false;
00505 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SampleConfiguration.cpp Source File

  • AppWindow
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"AppWindow C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Create and show secondary window", xaml_typename<SDKTemplate::Scenario1_SecondaryWindow>() },
00029     Scenario{ L"Show window on another display", xaml_typename<SDKTemplate::Scenario2_DisplayRegion>() },
00030     Scenario{ L"Specific size for secondary window", xaml_typename<SDKTemplate::Scenario3_Size>() },
00031     Scenario{ L"CompactOverlay secondary window",  xaml_typename < SDKTemplate::Scenario4_CompactOverlay>() },
00032     Scenario{ L"Position secondary window",  xaml_typename < SDKTemplate::Scenario5_RelativePositioning>() },
00033 });
00034
00035 bool winrt::SDKTemplate::TryParseFloat(hstring const& str, float& result)
00036 {
00037     errno = 0;
00038     wchar_t* endptr;
00039     result = wcstof(str.c_str(), &endptr);
00040     return errno == 0 && std::isfinite(result);
00041 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/SampleConfiguration.h Source File

  • Logging
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Logging C++";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S4_CheckIndexRevision.xaml.cs Source File

  • ContentIndexer
  • cs

S4_CheckIndexRevision.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class S4_CheckIndexRevision
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public S4_CheckIndexRevision()
00029         {
00030             this.InitializeComponent();
00031
00032             // This initializes the value used throughout the sample which tracks the expected index revision number. This
00033             // value is used to check if the app's expected revision number matches the actual index revision number and is
00034             // stored in the app's local settings to allow it to persist across termination.
00035             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
00036             if (!localSettings.Values.ContainsKey("expectedIndexRevision"))
00037             {
00038                 localSettings.Values.Add("expectedIndexRevision", (ulong)0);
00039             }
00040         }
00041
00042         /// <summary>
00043         /// Invoked when this page is about to be displayed in a Frame.
00044         /// </summary>
00045         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00046         /// property is typically used to configure the page.</param>
00047         protected override void OnNavigatedTo(NavigationEventArgs e)
00048         {
00049         }
00050
00051         /// <summary>
00052         /// This function displays the app's expected index revision number and the actual index revision number reported by
00053         /// the index. For purposes of this sample, this is done in reaction to a button being pressed. In practice, this should
00054         /// be done when an app is activated.
00055         /// If the reported index revision number is 0, it means the index has been reset and an app should re-push all of its
00056         /// data.
00057         /// If the reported index revision number is not 0, but doesn't match the app's expected index revision number, it
00058         /// indicates that not all of the app's adds/deletes/updates were successfully processed. This should be an edge case,
00059         /// but when hit, the app should re-do the missed operations. Tracking the expected index revision number can be used to
00060         /// create checkpoints in the app so it can only re-do the operations required to match the expected index revision
00061         /// number.
00062         /// </summary>
00063         private void CheckIndexRevision_Click(object sender, RoutedEventArgs e)
00064         {
00065             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00066             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
00067             var expectedRevisionNumber = localSettings.Values["expectedIndexRevision"];
00068             string outputString = "Expected Index Revision Number: " + expectedRevisionNumber;
00069             outputString += "\nReported Index Revision Number: " + indexer.Revision;
00070             if ((ulong)expectedRevisionNumber != indexer.Revision)
00071             {
00072                 // There is a mismatch between the expected and reported index revision numbers.
00073                 if (indexer.Revision == 0)
00074                 {
00075                     // The index has been reset, so code would be added here to re-push all data.
00076                 }
00077                 else
00078                 {
00079                     // The index hasn't been reset, but it doesn't contain all expected updates, so add code to get the index
00080                     // back into the expected state.
00081                 }
00082
00083                 // After doing the necessary work to get back to a synchronized state, set the expected index revision number
00084                 // to match the reported revision number.
00085                 localSettings.Values["expectedIndexRevision"] = indexer.Revision;
00086             }
00087             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00088         }
00089     }
00090 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/SampleOverlay.cpp Source File

  • DWriteColorGlyph
  • cpp

SampleOverlay.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "SampleOverlay.h"
00010
00011 using namespace DWriteColorTextRenderer;
00012
00013 using namespace Windows::UI::Core;
00014 using namespace Windows::Foundation;
00015 using namespace Microsoft::WRL;
00016 using namespace Windows::UI::ViewManagement;
00017 using namespace Windows::Graphics::Display;
00018 using namespace D2D1;
00019
00020 SampleOverlay::SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption) :
00021     m_deviceResources(deviceResources),
00022     m_caption(caption),
00023     m_drawOverlay(true)
00024 {
00025     m_padding = 8.0f;
00026     m_textVerticalOffset = 7.0f;
00027     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00028     m_overlayWidth = 0.0f;
00029
00030     CreateDeviceDependentResources();
00031     CreateWindowSizeDependentResources();
00032 }
00033
00034 void SampleOverlay::CreateDeviceDependentResources()
00035 {
00036     DX::ThrowIfFailed(
00037         m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
00038         );
00039
00040     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00041     DX::ThrowIfFailed(
00042         m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
00043             L"Assets\\storelogo-sdk.png",
00044             nullptr,
00045             GENERIC_READ,
00046             WICDecodeMetadataCacheOnDemand,
00047             &wicBitmapDecoder
00048             )
00049         );
00050
00051     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00052     DX::ThrowIfFailed(
00053         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00054         );
00055
00056     ComPtr<IWICFormatConverter> wicFormatConverter;
00057     DX::ThrowIfFailed(
00058         m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
00059         );
00060
00061     DX::ThrowIfFailed(
00062         wicFormatConverter->Initialize(
00063             wicBitmapFrame.Get(),
00064             GUID_WICPixelFormat32bppPBGRA,
00065             WICBitmapDitherTypeNone,
00066             nullptr,
00067             0.0,
00068             WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
00069             )
00070         );
00071
00072     double dpiX = 96.0;
00073     double dpiY = 96.0;
00074     DX::ThrowIfFailed(
00075         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00076         );
00077
00078     DX::ThrowIfFailed(
00079         m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
00080             wicFormatConverter.Get(),
00081             BitmapProperties(
00082                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00083                 static_cast<float>(dpiX),
00084                 static_cast<float>(dpiY)
00085                 ),
00086             &m_logoBitmap
00087             )
00088         );
00089
00090     m_logoSize = m_logoBitmap->GetSize();
00091
00092     ComPtr<IDWriteTextFormat> nameTextFormat;
00093     DX::ThrowIfFailed(
00094         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00095             L"Segoe UI",
00096             nullptr,
00097             DWRITE_FONT_WEIGHT_LIGHT,
00098             DWRITE_FONT_STYLE_NORMAL,
00099             DWRITE_FONT_STRETCH_NORMAL,
00100             36.0f,
00101             L"en-US",
00102             &nameTextFormat
00103             )
00104         );
00105
00106     DX::ThrowIfFailed(
00107         nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00108         );
00109
00110     DX::ThrowIfFailed(
00111         nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00112         );
00113
00114     DX::ThrowIfFailed(
00115         m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00116             m_caption.c_str(),
00117             static_cast<UINT32>(m_caption.size()),
00118             nameTextFormat.Get(),
00119             4096.0f,
00120             4096.0f,
00121             &m_textLayout
00122             )
00123         );
00124
00125     DWRITE_TEXT_METRICS metrics = {0};
00126     DX::ThrowIfFailed(
00127         m_textLayout->GetMetrics(&metrics)
00128         );
00129
00130     m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;
00131
00132     DX::ThrowIfFailed(
00133         m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
00134         );
00135 }
00136
00137 void SampleOverlay::CreateWindowSizeDependentResources()
00138 {
00139     if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
00140     {
00141         m_drawOverlay = false;
00142     }
00143     else
00144     {
00145         m_drawOverlay = true;
00146     }
00147 }
00148
00149 // Release all references to resources that depend on the graphics device.
00150 // This method is invoked when the device is lost and resources are no longer usable.
00151 void SampleOverlay::ReleaseDeviceDependentResources()
00152 {
00153     m_whiteBrush.Reset();
00154     m_logoBitmap.Reset();
00155 }
00156
00157 void SampleOverlay::Render()
00158 {
00159     if (m_drawOverlay)
00160     {
00161         m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());
00162
00163         m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00164         m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00165         m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
00166             m_logoBitmap.Get(),
00167             D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
00168             );
00169
00170         m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
00171             Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
00172             m_textLayout.Get(),
00173             m_whiteBrush.Get()
00174             );
00175
00176         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00177         // is lost. It will be handled during the next call to Present.
00178         HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00179         if (hr != D2DERR_RECREATE_TARGET)
00180         {
00181             DX::ThrowIfFailed(hr);
00182         }
00183
00184         m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
00185     }
00186 }
00187
00188 float SampleOverlay::GetTitleHeightInDips()
00189 {
00190     return m_logoSize.height + m_padding;
00191 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario1_SingleFile.h Source File

  • FilePicker
  • cppwinrt

Scenario1_SingleFile.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_SingleFile.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_SingleFile : Scenario1_SingleFileT<Scenario1_SingleFile>
00020     {
00021         Scenario1_SingleFile();
00022         fire_and_forget PickAFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario1_SingleFile : Scenario1_SingleFileT<Scenario1_SingleFile, implementation::Scenario1_SingleFile>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/Scenario3.xaml.cs Source File

  • XamlPivot
  • cs

Scenario3.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace PivotCS
00017 {
00018     public sealed partial class Scenario3 : Page
00019     {
00020         public Scenario3()
00021         {
00022             this.InitializeComponent();
00023         }
00024     }
00025 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/UpdateToast/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • UpdateToast

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using System;
00003 using Windows.UI.Notifications;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.UpdateToast
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00021         {
00022             Initialize();
00023         }
00024
00025         private void Initialize()
00026         {
00027             // Clear all existing notifications
00028             ToastNotificationManager.History.Clear();
00029
00030             string textbox = ToastUpdateText.Text;
00031
00032             ToastHelper.PopToast("The Textbox says:", textbox, "Replace", "Toast1");
00033         }
00034
00035         private void Replace_Click(object sender, RoutedEventArgs e)
00036         {
00037             if (String.IsNullOrEmpty(ToastUpdateText.Text))
00038             {
00039                 return;
00040             }
00041             string textbox = ToastUpdateText.Text;
00042             ToastHelper.PopToast("The Textbox says:", textbox, "Replace", "Toast1");
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <agile.h>
00015 #include <algorithm>
00016 #include <collection.h>
00017 #include <concrt.h>
00018 #include <memory>
00019 #include <ppltasks.h>
00020 #include <shcore.h>
00021 #include <string>
00022 #include <sstream>
00023 #include <wrl.h>
00024 #include <wrl/client.h>
00025
00026 // DirectX
00027 #include <dxgi1_6.h>
00028 #include <d3d11_3.h>
00029 #include <d2d1_3.h>
00030 #include <d2d1effectauthor_1.h>
00031 #include <d2d1effecthelpers.h>
00032 #include <dwrite_3.h>
00033 #include <wincodec.h>
00034 #include <DirectXMath.h>
00035
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/SampleConfiguration.cpp Source File

  • Store
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015 #include "ItemsListViewModel.h"
00016
00017 using namespace SDKTemplate;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Services::Store;
00023
00024 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00025 {
00026     // The format here is the following:
00027     //     { "Description for the sample", "Fully qualified name for the class that implements the scenario" }
00028     { "Trial-mode", "SDKTemplate.Scenario1_TrialMode" },
00029     { "In-app purchase", "SDKTemplate.Scenario2_InAppPurchase" },
00030     { "Unmanaged consumable product", "SDKTemplate.Scenario3_UnmanagedConsumable" },
00031     { "Managed consumable product", "SDKTemplate.Scenario4_ConsumableProduct" },
00032     { "User collection", "SDKTemplate.Scenario5_UserCollection" },
00033     { "App listing URI", "SDKTemplate.Scenario6_AppListingURI" },
00034     { "Business to Business", "SDKTemplate.Scenario7_B2B" }
00035 };
00036
00037 int64_t Utils::DaysUntil(DateTime endDate)
00038 {
00039     auto calendar = ref new Windows::Globalization::Calendar();
00040     calendar->SetToNow();
00041     return static_cast<int>((endDate.UniversalTime - calendar->GetDateTime().UniversalTime) / 864000000000);
00042 }
00043
00044 Vector<ItemDetails^>^ Utils::CreateProductListFromQueryResult(StoreProductQueryResult^ addOns, String^ description)
00045 {
00046     auto productList = ref new Vector<ItemDetails^>;
00047
00048     if (addOns->ExtendedError.Value != S_OK)
00049     {
00050         ReportExtendedError(addOns->ExtendedError);
00051     }
00052     else if (addOns->Products->Size == 0)
00053     {
00054         MainPage::Current->NotifyUser("No configured " + description + " found for this Store Product.", NotifyType::ErrorMessage);
00055     }
00056     else
00057     {
00058         for (IKeyValuePair<String^, StoreProduct^>^ addOn : addOns->Products)
00059         {
00060             StoreProduct^ product = addOn->Value;
00061             productList->Append(ref new ItemDetails(product));
00062         }
00063     }
00064
00065     return productList;
00066 }
00067
00068 void Utils::ReportExtendedError(HResult extendedError)
00069 {
00070     static const HRESULT IAP_E_UNEXPECTED = 0x803f6107L;
00071
00072     String^ message;
00073     if (extendedError.Value == IAP_E_UNEXPECTED)
00074     {
00075         message = "This sample has not been properly configured. See the README for instructions.";
00076     }
00077     else
00078     {
00079         // The user may be offline or there might be some other server failure.
00080         message = "ExtendedError: " + extendedError.Value.ToString();
00081     }
00082     MainPage::Current->NotifyUser(message, NotifyType::ErrorMessage);
00083 }
00084
00085 bool BindingUtils::IsNonNull(Platform::Object^ o)
00086 {
00087     return o != nullptr;
00088 }
00089
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AdvertisementWatcherTask Member List

This is the complete list of members for AdvertisementWatcherTask, including all inherited members.
backgroundTaskInstance | AdvertisementWatcherTask | [private]
Run(IBackgroundTaskInstance taskInstance) | AdvertisementWatcherTask | [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ScenarioElement() ScenarioElement [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/SampleConfiguration.cpp Source File

  • UserCertificateStore
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"UserCertificateStore C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Move certificate", xaml_typename<SDKTemplate::Scenario1_MoveCertificate>() },
00029 });
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario3_Polling.xaml.h Source File

  • Accelerometer
  • cpp

Scenario3_Polling.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //
00012 // Scenario3_Polling.xaml.h
00013 // Declaration of the Scenario3_Polling class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario3_Polling.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class Scenario3_Polling sealed
00029     {
00030     public:
00031         Scenario3_Polling();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         void ScenarioEnable();
00038         void ScenarioDisable();
00039
00040     private:
00041         SDKTemplate::MainPage^ rootPage = MainPage::Current;
00042         Windows::UI::Core::CoreDispatcher^ dispatcher;
00043         Windows::Devices::Sensors::Accelerometer^ accelerometer;
00044         Windows::Foundation::EventRegistrationToken visibilityToken;
00045         uint32 desiredReportInterval = 0;
00046         Windows::UI::Xaml::DispatcherTimer^ dispatcherTimer;
00047
00048         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00049         void DisplayCurrentReading(Platform::Object^ sender, Platform::Object^ e);
00050     };
00051 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_CloudFontOverview.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_CloudFontOverview.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028
00029 Scenario_CloudFontOverview::Scenario_CloudFontOverview()
00030 {
00031     InitializeComponent();
00032 }
Generated on Fri Nov 15 2024 22:19:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Engage Member List

This is the complete list of members for Scenario2_Engage, including all inherited members.
Scenario2_Engage() Scenario2_Engage [inline]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/pch.cpp Source File

  • ClientDeviceInformation
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/pch.h Source File

  • D2DPhotoAdjustment
  • cpp

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <agile.h>
00015 #include <concrt.h>
00016 #include <memory>
00017 #include <ppltasks.h>
00018 #include <wrl.h>
00019 #include <wrl/client.h>
00020
00021 #include <d3d11_3.h>
00022 #include <d2d1_3.h>
00023 #include <d2d1effects_2.h>
00024 #include <dwrite_3.h>
00025 #include <wincodec.h>
00026 #include <DirectXMath.h>
00027
00028 #include <d2d1effectauthor_1.h>
00029 #include <d2d1effecthelpers.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cs/Scenario2_CustomException.xaml.cs Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cs

Scenario2_CustomException.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Microsoft.SDKSamples.Kitchen;
00008
00009 using Windows.UI.Xaml;
00010 using Windows.UI.Xaml.Controls;
00011 using Windows.UI.Xaml.Navigation;
00012 using SDKTemplate;
00013 using System;
00014
00015 namespace ProxyStubsForWinRTComponents
00016 {
00017     public sealed partial class CustomException : Page
00018     {
00019         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00020         // as NotifyUser()
00021         MainPage rootPage = MainPage.Current;
00022
00023         public CustomException()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         /// <summary>
00029         /// Invoked when this page is about to be displayed in a Frame.
00030         /// </summary>
00031         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00032         /// property is typically used to configure the page.</param>
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035         }
00036
00037         /// <summary>
00038         /// Handle a Windows Runtime error originated by the Oven Windows Runtime component.
00039         /// </summary>
00040         /// <param name="sender">Contains information about the button that fired the event.</param>
00041         /// <param name="e">Contains state information and event data associated with a routed event.</param>
00042         private void Start_Click(object sender, RoutedEventArgs e)
00043         {
00044             Oven myOven = new Oven();
00045
00046             try
00047             {
00048                 // Intentionally pass a bad parameter
00049                 myOven.ConfigurePreheatTemperature((OvenTemperature)5);
00050             }
00051             catch (System.ArgumentException)
00052             {
00053                 CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00054             }
00055         }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario1_Mini.xaml.h Source File

  • ContactCards
  • cpp

Scenario1_Mini.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Mini.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_Mini sealed
00021     {
00022     public:
00023         Scenario1_Mini();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027
00028     private:
00029         MainPage^ rootPage = MainPage::Current;
00030
00031         void ShowContactCard_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void ShowContactCardWithPlacement_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void ShowContactCardWithOptions_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034     };
00035 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_AvailabilityChanged Member List

This is the complete list of members for Scenario3_AvailabilityChanged, including all inherited members.
DisposeLamp() | Scenario3_AvailabilityChanged | [inline, private]
InitializeLampAsync() | Scenario3_AvailabilityChanged | [inline, private]
lamp | Scenario3_AvailabilityChanged | [private]
Lamp_AvailabilityChanged(Lamp sender, LampAvailabilityChangedEventArgs args) | Scenario3_AvailabilityChanged | [inline, private]
lampToggle_Toggled(object sender, RoutedEventArgs e) | Scenario3_AvailabilityChanged | [inline, private]
LogStatusAsync(string message, NotifyType type) | Scenario3_AvailabilityChanged | [inline, private]
LogStatusToOutputBoxAsync(string message) | Scenario3_AvailabilityChanged | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_AvailabilityChanged | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario3_AvailabilityChanged | [inline, protected]
RegisterBtn_Click(object sender, RoutedEventArgs e) | Scenario3_AvailabilityChanged | [inline, private]
rootPage | Scenario3_AvailabilityChanged | [private]
Scenario3_AvailabilityChanged() | Scenario3_AvailabilityChanged | [inline]
UnRegisterBtn_Click(object sender, RoutedEventArgs e) | Scenario3_AvailabilityChanged | [inline, private]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario1_TrialMode.xaml.cs Source File

  • Store
  • cs

Scenario1_TrialMode.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Services.Store;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario1_TrialMode : Page
00022     {
00023         private MainPage rootPage = MainPage.Current;
00024         private StoreContext storeContext = null;
00025
00026         public Scenario1_TrialMode()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override async void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             storeContext = StoreContext.GetDefault();
00034             storeContext.OfflineLicensesChanged += OfflineLicensesChanged;
00035
00036             StoreProductResult result = await storeContext.GetStoreProductForCurrentAppAsync();
00037             if (result.ExtendedError == null)
00038             {
00039                 PurchasePrice.Text = result.Product.Price.FormattedPrice;
00040             }
00041
00042             await GetLicenseState();
00043         }
00044
00045         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00046         {
00047             storeContext.OfflineLicensesChanged -= OfflineLicensesChanged;
00048         }
00049
00050         private void OfflineLicensesChanged(StoreContext sender, object args)
00051         {
00052             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00053             {
00054                 await GetLicenseState();
00055             });
00056         }
00057
00058         private async Task GetLicenseState()
00059         {
00060             StoreAppLicense license = await storeContext.GetAppLicenseAsync();
00061
00062             if (license.IsActive)
00063             {
00064                 if (license.IsTrial)
00065                 {
00066                     LicenseMode.Text = "Trial license";
00067                 }
00068                 else
00069                 {
00070                     LicenseMode.Text = "Full license";
00071                 }
00072             }
00073             else
00074             {
00075                 LicenseMode.Text = "Inactive license";
00076             }
00077         }
00078
00079         /// <summary>
00080         /// Invoked when the user asks to see trial period information.
00081         /// </summary>
00082         private async void ShowTrialPeriodInformation()
00083         {
00084             StoreAppLicense license = await storeContext.GetAppLicenseAsync();
00085             if (license.IsActive)
00086             {
00087                 if (license.IsTrial)
00088                 {
00089                     int remainingTrialTime = (license.ExpirationDate - DateTime.Now).Days;
00090                     rootPage.NotifyUser($"You can use this app for {remainingTrialTime} more days before the trial period ends.", NotifyType.StatusMessage);
00091                 }
00092                 else
00093                 {
00094                     rootPage.NotifyUser("You have a full license. The trial time is not meaningful.", NotifyType.ErrorMessage);
00095                 }
00096             }
00097             else
00098             {
00099                 rootPage.NotifyUser("You don't have a license. The trial time can't be determined.", NotifyType.ErrorMessage);
00100             }
00101         }
00102
00103         /// <summary>
00104         /// Invoked when the user asks purchase the app.
00105         /// </summary>
00106         private async void PurchaseFullLicense()
00107         {
00108             // Get app store product details
00109             StoreProductResult productResult = await storeContext.GetStoreProductForCurrentAppAsync();
00110             if (productResult.ExtendedError != null)
00111             {
00112                 // The user may be offline or there might be some other server failure
00113                 rootPage.NotifyUser($"ExtendedError: {productResult.ExtendedError.Message}", NotifyType.ErrorMessage);
00114                 return;
00115             }
00116
00117             rootPage.NotifyUser("Buying the full license...", NotifyType.StatusMessage);
00118             StoreAppLicense license = await storeContext.GetAppLicenseAsync();
00119             if (license.IsTrial)
00120             {
00121                 StorePurchaseResult result = await productResult.Product.RequestPurchaseAsync();
00122                 if (result.ExtendedError != null)
00123                 {
00124                     rootPage.NotifyUser($"Purchase failed: ExtendedError: {result.ExtendedError.Message}", NotifyType.ErrorMessage);
00125                     return;
00126                 }
00127
00128                 switch (result.Status)
00129                 {
00130                     case StorePurchaseStatus.AlreadyPurchased:
00131                         rootPage.NotifyUser($"You already bought this app and have a fully-licensed version.", NotifyType.ErrorMessage);
00132                         break;
00133
00134                     case StorePurchaseStatus.Succeeded:
00135                         // License will refresh automatically using the StoreContext.OfflineLicensesChanged event
00136                         break;
00137
00138                     case StorePurchaseStatus.NotPurchased:
00139                         rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
00140                         break;
00141
00142                     case StorePurchaseStatus.NetworkError:
00143                         rootPage.NotifyUser("Product was not purchased due to a Network Error.", NotifyType.ErrorMessage);
00144                         break;
00145
00146                     case StorePurchaseStatus.ServerError:
00147                         rootPage.NotifyUser("Product was not purchased due to a Server Error.", NotifyType.ErrorMessage);
00148                         break;
00149
00150                     default:
00151                         rootPage.NotifyUser("Product was not purchased due to an Unknown Error.", NotifyType.ErrorMessage);
00152                         break;
00153                 }
00154             }
00155             else
00156             {
00157                 rootPage.NotifyUser("You already bought this app and have a fully-licensed version.", NotifyType.ErrorMessage);
00158             }
00159         }
00160     }
00161 }
Generated on Fri Nov 15 2024 22:21:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario3_Transliteration.cpp Source File

  • LinguisticServices
  • cppwinrt

Scenario3_Transliteration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_Transliteration.h"
00014 #include "Scenario3_Transliteration.g.cpp"
00015 #include "elsutil.h"
00016 #include <sstream>
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario3_Transliteration::Scenario3_Transliteration()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario3_Transliteration::Go_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto input = TextInput().Text();
00032
00033         std::wostringstream output;
00034         ELS::TransliterateFromCyrillicToLatin(input.c_str(), input.size(), [&](auto text, auto length)
00035             {
00036                 output << std::wstring_view(text, length);
00037             });
00038
00039         TextOutput().Text(output.str());
00040     }
00041 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Write Member List

This is the complete list of members for Write, including all inherited members.
Address | UpdateBinary |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
Data | Write |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ResizeArray(byte[] data, int size) | Write | [inline, private, static]
ToString() | ApduCommand | [inline]
UpdateBinary(ushort address, byte[] dataToWrite) | UpdateBinary | [inline]
Write(byte address, ref byte[] data) | Write | [inline]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario2_MessageCaption.xaml.cpp Source File

  • CredentialPicker
  • cpp

Scenario2_MessageCaption.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario2_MessageCaption.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::Security::Credentials::UI;
00013 using namespace Windows::UI::Xaml;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Controls::Primitives;
00016 using namespace Windows::UI::Xaml::Data;
00017 using namespace Windows::UI::Xaml::Input;
00018 using namespace Windows::UI::Xaml::Media;
00019 using namespace Windows::UI::Xaml::Navigation;
00020
00021 Scenario2_MessageCaption::Scenario2_MessageCaption()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 void Scenario2_MessageCaption::SetResult(CredentialPickerResults^ result)
00027 {
00028     auto domainName = result->CredentialDomainName;
00029     auto userName = result->CredentialUserName;
00030     auto password = result->CredentialPassword;
00031     auto savedByApi = result->CredentialSaved;
00032     auto saveOption = result->CredentialSaveOption;
00033
00034     Status->Text = "OK";
00035     Domain->Text = domainName;
00036     Username->Text = userName;
00037     Password->Text = password;
00038     CredentialSaved->Text = (savedByApi ? "true" : "false");
00039
00040     switch (result->CredentialSaveOption)
00041     {
00042     case Windows::Security::Credentials::UI::CredentialSaveOption::Hidden:
00043         CheckboxState->Text = "Hidden";
00044         break;
00045     case Windows::Security::Credentials::UI::CredentialSaveOption::Selected:
00046         CheckboxState->Text = "Selected";
00047         break;
00048     case Windows::Security::Credentials::UI::CredentialSaveOption::Unselected:
00049         CheckboxState->Text = "Unselected";
00050         break;
00051     }
00052 }
00053
00054 void Scenario2_MessageCaption::Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00055 {
00056     if ((Message->Text != nullptr) && (Caption->Text != nullptr) && (Target->Text != nullptr))
00057     {
00058         create_task(Windows::Security::Credentials::UI::CredentialPicker::PickAsync(Target->Text, Message->Text, Caption->Text))
00059             .then([this](CredentialPickerResults^ credPickerResult)
00060         {
00061             SetResult(credPickerResult);
00062         });
00063     }
00064
00065 }
Generated on Fri Nov 15 2024 22:19:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Utilities.cs Source File

  • CustomHidDeviceAccess
  • cs

Utilities.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using System.Collections.Generic;
00009 using Windows.Devices.HumanInterfaceDevice;
00010 using Windows.UI.Xaml;
00011 using SDKTemplate;
00012
00013 namespace CustomHidDeviceAccess
00014 {
00015     public class Utilities
00016     {
00017         /// <summary>
00018         /// Displays the compatible scenarios and hides the non-compatible ones.
00019         /// If there are no supported devices, the scenarioContainer will be hidden and an error message
00020         /// will be displayed.
00021         /// </summary>
00022         /// <param name="scenarios">The key is the device type that the value, scenario, supports.</param>
00023         /// <param name="scenarioContainer">The container that encompasses all the scenarios that are specific to devices</param>
00024         public static void SetUpDeviceScenarios(Dictionary<DeviceType, UIElement> scenarios, UIElement scenarioContainer)
00025         {
00026             UIElement supportedScenario = null;
00027
00028             if (EventHandlerForDevice.Current.IsDeviceConnected)
00029             {
00030                 foreach (KeyValuePair<DeviceType, UIElement> deviceScenario in scenarios)
00031                 {
00032                     // Enable the scenario if it's generic or the device type matches
00033                     if ((deviceScenario.Key == DeviceType.Any)
00034                         || (deviceScenario.Key == Utilities.GetDeviceType(EventHandlerForDevice.Current.Device)))
00035                     {
00036                         // Make the scenario visible in case other devices use the same scenario and collapsed it.
00037                         deviceScenario.Value.Visibility = Visibility.Visible;
00038
00039                         supportedScenario = deviceScenario.Value;
00040                     }
00041                     else if (deviceScenario.Value != supportedScenario)    // Don't hide the scenario if it is supported by the current device and is shared by other devices
00042                     {
00043                         deviceScenario.Value.Visibility = Visibility.Collapsed;
00044                     }
00045                 }
00046             }
00047
00048             if (supportedScenario == null)
00049             {
00050                 // Hide the container so that common elements shared across scenarios are also hidden
00051                 scenarioContainer.Visibility = Visibility.Collapsed;
00052
00053                 NotifyDeviceNotConnected();
00054             }
00055         }
00056
00057         /// <summary>
00058         /// Device type of the device provided device.
00059         /// </summary>
00060         /// <param name="device"></param>
00061         /// <returns>The DeviceType of the device or DeviceType.None if there are no devices connected or is not recognized</returns>
00062         public static DeviceType GetDeviceType(HidDevice device)
00063         {
00064             if (device != null)
00065             {
00066                 if (device != null
00067                     && device.VendorId == SuperMutt.Device.Vid
00068                     && device.ProductId == SuperMutt.Device.Pid)
00069                 {
00070                     return DeviceType.SuperMutt;
00071                 }
00072
00073                 return DeviceType.None;
00074             }
00075
00076             return DeviceType.None;
00077         }
00078
00079         public static Boolean IsSuperMuttDevice(HidDevice device)
00080         {
00081             return (GetDeviceType(device) == DeviceType.SuperMutt);
00082         }
00083
00084         /// <summary>
00085         /// Prints an error message stating that device is not connected
00086         /// </summary>
00087         public static void NotifyDeviceNotConnected()
00088         {
00089             MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8 Member List

This is the complete list of members for Scenario8, including all inherited members.
Scenario8() Scenario8 [inline]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Project.idl Source File

  • JumpList
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Launched : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Launched();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_Remove : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_Remove();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_CustomItems : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_CustomItems();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_ChangeSystemGroup : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_ChangeSystemGroup();
00036     }
00037
00038     [default_interface]
00039     runtimeclass Scenario5_IsSupported : Windows.UI.Xaml.Controls.Page
00040     {
00041         Scenario5_IsSupported();
00042     }
00043 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Remove Member List

This is the complete list of members for Scenario4_Remove, including all inherited members.
PickPlaylistButton_Click(object sender, RoutedEventArgs e) | Scenario4_Remove | [inline, private]
Remove_Click(object sender, RoutedEventArgs e) | Scenario4_Remove | [inline, private]
rootPage | Scenario4_Remove | [private]
Scenario4_Remove() | Scenario4_Remove | [inline]
Scenario4_Remove() | Scenario4_Remove | [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cs/Scenario1_DataEvents.xaml.cs Source File

  • CustomSensors
  • cs

Scenario1_DataEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using Windows.Devices.Enumeration;
00015 using Windows.Devices.Sensors.Custom;
00016 using Windows.Foundation;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace CustomSensors
00023 {
00024     public sealed partial class Scenario1_DataEvents : Page
00025     {
00026         // The following ID is defined by vendors and is unique to a custom sensor type. Each custom sensor driver should define one unique ID.
00027         //
00028         // The ID below is defined in the custom sensor driver sample available in the SDK. It identifies the custom sensor CO2 emulation sample driver.
00029         Guid GUIDCustomSensorDeviceVendorDefinedTypeID = new Guid("4025a865-638c-43aa-a688-98580961eeae");
00030
00031         // A property key is defined by vendors for each datafield property a custom sensor driver exposes. Property keys are defined
00032         // per custom sensor driver and is unique to each custom sensor type.
00033         //
00034         // The following property key represents the CO2 level as defined in the custom sensor CO2 emulation driver sample available in the WDK.
00035         // In this example only one key is defined, but other drivers may define more than one key by rev'ing up the property key index.
00036         const String CO2LevelKey = "{74879888-a3cc-45c6-9ea9-058838256433} 1";
00037
00038         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00039         // as NotifyUser()
00040         MainPage rootPage = MainPage.Current;
00041
00042         private CustomSensor customSensor;
00043         private uint desiredReportInterval;
00044         private DeviceWatcher watcher;
00045         private DeviceAccessInformation deviceAccessInformation;
00046
00047         public Scenario1_DataEvents()
00048         {
00049             String customSensorSelector = "";
00050
00051             this.InitializeComponent();
00052
00053             customSensorSelector = CustomSensor.GetDeviceSelector(GUIDCustomSensorDeviceVendorDefinedTypeID);
00054             watcher = DeviceInformation.CreateWatcher(customSensorSelector);
00055             watcher.Added += OnCustomSensorAdded;
00056             watcher.Start();
00057
00058             // Register to be notified when the user disables access to the custom sensor through privacy settings.
00059             deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(GUIDCustomSensorDeviceVendorDefinedTypeID);
00060             deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(OnAccessChanged);
00061         }
00062
00063         /// <summary>
00064         /// Invoked when the device watcher finds a matching custom sensor device
00065         /// </summary>
00066         /// <param name="watcher">device watcher</param>
00067         /// <param name="customSensorDevice">device information for the custom sensor that was found</param>
00068         private async void OnCustomSensorAdded(DeviceWatcher watcher, DeviceInformation customSensorDevice)
00069         {
00070             try
00071             {
00072                 customSensor = await CustomSensor.FromIdAsync(customSensorDevice.Id);
00073                 if (customSensor != null)
00074                 {
00075                     CustomSensorReading reading = customSensor.GetCurrentReading();
00076                     if (!reading.Properties.ContainsKey(CO2LevelKey))
00077                     {
00078                         rootPage.NotifyUser("The found custom sensor doesn't provide CO2 reading", NotifyType.ErrorMessage);
00079                         customSensor = null;
00080                     }
00081                     else
00082                     {
00083                         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00084                         // This value will be used later to activate the sensor.
00085                         // In the case below, we defined a 200ms report interval as being suitable for the purpose of this app.
00086                         UInt32 minReportInterval = customSensor.MinimumReportInterval;
00087                         desiredReportInterval = minReportInterval > 200 ? minReportInterval : 200;
00088                     }
00089
00090                 }
00091                 else
00092                 {
00093                     rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
00094                 }
00095             }
00096             catch(Exception e)
00097             {
00098                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00099                 {
00100                     rootPage.NotifyUser("The user may have denied access to the custom sensor. Error: " + e.Message, NotifyType.ErrorMessage);
00101                 });
00102             }
00103         }
00104
00105         /// <summary>
00106         /// This is the event handler for AccessChanged events.
00107         /// </summary>
00108         /// <param name="sender"></param>
00109         /// <param name="e"></param>
00110         private async void OnAccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
00111         {
00112             var status = e.Status;
00113             if (status != DeviceAccessStatus.Allowed)
00114             {
00115                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00116                 {
00117                     rootPage.NotifyUser("Custom sensor access denied", NotifyType.ErrorMessage);
00118                     customSensor = null;
00119                 });
00120             }
00121         }
00122
00123         /// <summary>
00124         /// Invoked when this page is about to be displayed in a Frame.
00125         /// </summary>
00126         /// <param name="e">Event data that describes how this page was reached. The Parameter
00127         /// property is typically used to configure the page.</param>
00128         protected override void OnNavigatedTo(NavigationEventArgs e)
00129         {
00130             ScenarioEnableButton.IsEnabled = true;
00131             ScenarioDisableButton.IsEnabled = false;
00132         }
00133
00134         /// <summary>
00135         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00136         /// </summary>
00137         /// <param name="e">
00138         /// Event data that can be examined by overriding code. The event data is representative
00139         /// of the navigation that will unload the current Page unless canceled. The
00140         /// navigation can potentially be canceled by setting Cancel.
00141         /// </param>
00142         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00143         {
00144             if (ScenarioDisableButton.IsEnabled)
00145             {
00146                 Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(OnVisibilityChanged);
00147
00148                 if (customSensor != null)
00149                 {
00150                     customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
00151
00152                     // Restore the default report interval to release resources while the sensor is not in use
00153                     customSensor.ReportInterval = 0;
00154                 }
00155             }
00156
00157             base.OnNavigatingFrom(e);
00158         }
00159
00160         /// <summary>
00161         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00162         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00163         /// </summary>
00164         /// <param name="sender"></param>
00165         /// <param name="e">
00166         /// Event data that can be examined for the current visibility state.
00167         /// </param>
00168         private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs e)
00169         {
00170             if (customSensor != null && ScenarioDisableButton.IsEnabled)
00171             {
00172                 if (e.Visible)
00173                 {
00174                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00175                     customSensor.ReadingChanged += new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
00176                 }
00177                 else
00178                 {
00179                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00180                     customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
00181                 }
00182             }
00183         }
00184
00185         /// <summary>
00186         /// This is the event handler for ReadingChanged events.
00187         /// </summary>
00188         /// <param name="sender"></param>
00189         /// <param name="e"></param>
00190         private async void OnReadingChanged(object sender, CustomSensorReadingChangedEventArgs e)
00191         {
00192             CustomSensorReading reading = e.Reading;
00193
00194             string CO2LevelString = String.Format("{0,5:0.00}", reading.Properties[CO2LevelKey]);
00195             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00196             {
00197                 ScenarioOutputCO2Level.Text = CO2LevelString;
00198             });
00199         }
00200
00201         /// <summary>
00202         /// This is the click handler for the 'Enable' button.
00203         /// </summary>
00204         /// <param name="sender"></param>
00205         /// <param name="e"></param>
00206         private void ScenarioEnable(object sender, RoutedEventArgs e)
00207         {
00208             if (customSensor != null)
00209             {
00210                 // Establish the report interval
00211                 customSensor.ReportInterval = desiredReportInterval;
00212
00213                 Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(OnVisibilityChanged);
00214                 customSensor.ReadingChanged += new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
00215
00216                 ScenarioEnableButton.IsEnabled = false;
00217                 ScenarioDisableButton.IsEnabled = true;
00218             }
00219             else
00220             {
00221                 rootPage.NotifyUser("No custom sensor found", NotifyType.ErrorMessage);
00222             }
00223         }
00224
00225         /// <summary>
00226         /// This is the click handler for the 'Disable' button.
00227         /// </summary>
00228         /// <param name="sender"></param>
00229         /// <param name="e"></param>
00230         private void ScenarioDisable(object sender, RoutedEventArgs e)
00231         {
00232             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(OnVisibilityChanged);
00233
00234             if (customSensor != null)
00235             {
00236                 customSensor.ReadingChanged -= new TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs>(OnReadingChanged);
00237
00238                 // Restore the default report interval to release resources while the sensor is not in use
00239                 customSensor.ReportInterval = 0;
00240             }
00241
00242             ScenarioEnableButton.IsEnabled = true;
00243             ScenarioDisableButton.IsEnabled = false;
00244         }
00245     }
00246 }
Generated on Fri Nov 15 2024 22:17:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
_captureFolder | MainPage | [private]
_deviceOrientation | MainPage | [private]
_displayInformation | MainPage | [private]
_displayOrientation | MainPage | [private]
_displayRequest | MainPage | [private]
_externalCamera | MainPage | [private]
_faceDetectionEffect | MainPage | [private]
_isInitialized | MainPage | [private]
_isRecording | MainPage | [private]
_mediaCapture | MainPage | [private]
_mirroringPreview | MainPage | [private]
_orientationSensor | MainPage | [private]
_previewProperties | MainPage | [private]
_systemMediaControls | MainPage | [private]
Application_Resuming(object sender, object o) | MainPage | [inline, private]
Application_Suspending(object sender, SuspendingEventArgs e) | MainPage | [inline, private]
CleanupCameraAsync() | MainPage | [inline, private]
CleanUpFaceDetectionEffectAsync() | MainPage | [inline, private]
CleanupUiAsync() | MainPage | [inline, private]
ConvertDeviceOrientationToDegrees(SimpleOrientation orientation) | MainPage | [inline, private, static]
ConvertDisplayOrientationToDegrees(DisplayOrientations orientation) | MainPage | [inline, private, static]
ConvertOrientationToPhotoOrientation(SimpleOrientation orientation) | MainPage | [inline, private, static]
ConvertPreviewToUiRectangle(BitmapBounds faceBoxInPreviewCoordinates) | MainPage | [inline, private]
CreateFaceDetectionEffectAsync() | MainPage | [inline, private]
DisplayInformation_OrientationChanged(DisplayInformation sender, object args) | MainPage | [inline, private]
FaceDetectionButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
FaceDetectionEffect_FaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args) | MainPage | [inline, private]
FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel) | MainPage | [inline, private, static]
GetCameraOrientation() | MainPage | [inline, private]
GetPreviewStreamRectInControl(VideoEncodingProperties previewResolution, CaptureElement previewControl) | MainPage | [inline]
HardwareButtons_CameraPressed(object sender, CameraEventArgs e) | MainPage | [inline, private]
HighlightDetectedFaces(IReadOnlyList< DetectedFace > faces) | MainPage | [inline, private]
InitializeCameraAsync() | MainPage | [inline, private]
MainPage() | MainPage | [inline]
MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs) | MainPage | [inline, private]
MediaCapture_RecordLimitationExceeded(MediaCapture sender) | MainPage | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | MainPage | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | MainPage | [inline, protected]
OrientationSensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args) | MainPage | [inline, private]
PhotoButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
ReencodeAndSavePhotoAsync(IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation) | MainPage | [inline, private, static]
RegisterEventHandlers() | MainPage | [inline, private]
RotationKey | MainPage | [private, static]
SetFacesCanvasRotation() | MainPage | [inline, private]
SetPreviewRotationAsync() | MainPage | [inline, private]
SetupUiAsync() | MainPage | [inline, private]
StartPreviewAsync() | MainPage | [inline, private]
StartRecordingAsync() | MainPage | [inline, private]
StopPreviewAsync() | MainPage | [inline, private]
StopRecordingAsync() | MainPage | [inline, private]
SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args) | MainPage | [inline, private]
TakePhotoAsync() | MainPage | [inline, private]
UnregisterEventHandlers() | MainPage | [inline, private]
UpdateButtonOrientation() | MainPage | [inline, private]
UpdateCaptureControls() | MainPage | [inline, private]
VideoButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GroupInfoList Member List

This is the complete list of members for GroupInfoList, including all inherited members.
Append(Windows::Foundation::IInspectable const &value) | GroupInfoList | [inline]
Clear() | GroupInfoList | [inline]
First() | GroupInfoList | [inline]
GetAt(uint32_t index) | GroupInfoList | [inline]
GetMany(uint32_t startIndex, array_view< Windows::Foundation::IInspectable > items) | GroupInfoList | [inline]
GetView() | GroupInfoList | [inline]
GroupInfoList() | GroupInfoList |
IndexOf(Windows::Foundation::IInspectable const &value, uint32_t &index) | GroupInfoList | [inline]
InsertAt(uint32_t index, Windows::Foundation::IInspectable const &value) | GroupInfoList | [inline]
Key() | GroupInfoList | [inline]
Key(hstring const &value) | GroupInfoList | [inline]
key | GroupInfoList | [private]
RemoveAt(uint32_t index) | GroupInfoList | [inline]
RemoveAtEnd() | GroupInfoList | [inline]
ReplaceAll(array_view< Windows::Foundation::IInspectable const > items) | GroupInfoList | [inline]
SetAt(uint32_t index, Windows::Foundation::IInspectable const &value) | GroupInfoList | [inline]
Size() | GroupInfoList | [inline]
vector | GroupInfoList | [private]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/AppView.h Source File

  • BasicHologram
  • cppwinrt

AppView.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "BasicHologramMain.h"
00005
00006 namespace BasicHologram
00007 {
00008     // IFrameworkView class. Connects the app with the Windows shell and handles application lifecycle events.
00009     class AppView sealed : public winrt::implements<AppView, winrt::Windows::ApplicationModel::Core::IFrameworkView>
00010     {
00011     public:
00012         // IFrameworkView methods.
00013         void Initialize(winrt::Windows::ApplicationModel::Core::CoreApplicationView const& applicationView);
00014         void SetWindow(winrt::Windows::UI::Core::CoreWindow const& window);
00015         void Load(winrt::hstring const& entryPoint);
00016         void Run();
00017         void Uninitialize();
00018
00019     protected:
00020         // Application lifecycle event handlers.
00021         void OnLaunched(winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const& args);
00022         void OnViewActivated(winrt::Windows::ApplicationModel::Core::CoreApplicationView const& sender, winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs const& args);
00023         void OnSuspending(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::ApplicationModel::SuspendingEventArgs const& args);
00024         void OnResuming(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::Foundation::IInspectable const& args);
00025
00026         // Window event handlers.
00027         void OnVisibilityChanged(winrt::Windows::UI::Core::CoreWindow const& sender, winrt::Windows::UI::Core::VisibilityChangedEventArgs const& args);
00028         void OnWindowClosed(winrt::Windows::UI::Core::CoreWindow const& sender, winrt::Windows::UI::Core::CoreWindowEventArgs const& args);
00029
00030         // CoreWindow input event handlers.
00031         void OnKeyPressed(winrt::Windows::UI::Core::CoreWindow const& sender, winrt::Windows::UI::Core::KeyEventArgs const& args);
00032         void OnPointerPressed(winrt::Windows::UI::Core::CoreWindow const& sender, winrt::Windows::UI::Core::PointerEventArgs const& args);
00033
00034     private:
00035         std::unique_ptr<BasicHologramMain> m_main;
00036
00037         std::shared_ptr<DX::DeviceResources>                    m_deviceResources;
00038         bool                                                    m_windowClosed = false;
00039         bool                                                    m_windowVisible = true;
00040
00041         // Event registration tokens.
00042         winrt::event_token                                      m_suspendingEventToken;
00043         winrt::event_token                                      m_resumingEventToken;
00044         winrt::event_token                                      m_keyDownEventToken;
00045         winrt::event_token                                      m_pointerPressedEventToken;
00046         winrt::event_token                                      m_windowClosedEventToken;
00047         winrt::event_token                                      m_visibilityChangedEventToken;
00048
00049         // The holographic space the app will use for rendering.
00050         winrt::Windows::Graphics::Holographic::HolographicSpace m_holographicSpace = nullptr;
00051     };
00052
00053     class AppViewSource sealed : public winrt::implements<AppViewSource, winrt::Windows::ApplicationModel::Core::IFrameworkViewSource>
00054     {
00055     public:
00056         // IFrameworkViewSource method.
00057         winrt::Windows::ApplicationModel::Core::IFrameworkView CreateView();
00058
00059     private:
00060         AppView holographicView;
00061     };
00062 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/AllJoynHelpers.cpp Source File

  • AllJoyn
  • shared

AllJoynHelpers.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace concurrency;
00024 using namespace Windows::Devices::AllJoyn;
00025 using namespace Windows::UI::Core;
00026 using namespace Microsoft::WRL;
00027 using namespace Platform;
00028
00029 alljoyn_busattachment AllJoynHelpers::GetInternalBusAttachment(_In_ AllJoynBusAttachment^ busAttachment)
00030 {
00031     ComPtr<IUnknown> iUnknown = reinterpret_cast<IUnknown*>(busAttachment);
00032     ComPtr<IWindowsDevicesAllJoynBusAttachmentInterop> interop;
00033     iUnknown.As(&interop);
00034     UINT64 win32handle;
00035     (void)interop->get_Win32Handle(&win32handle);
00036     return reinterpret_cast<alljoyn_busattachment>(win32handle);
00037 }
00038
00039 alljoyn_busobject AllJoynHelpers::GetInternalBusObject(_In_ AllJoynBusObject^ busObject)
00040 {
00041     ComPtr<IUnknown> iUnknown = reinterpret_cast<IUnknown*>(busObject);
00042     ComPtr<IWindowsDevicesAllJoynBusObjectInterop> interop;
00043     iUnknown.As(&interop);
00044     UINT64 win32handle;
00045     (void)interop->get_Win32Handle(&win32handle);
00046     return reinterpret_cast<alljoyn_busobject>(win32handle);
00047 }
00048
00049 String^ AllJoynHelpers::MultibyteToPlatformString(_In_ PCSTR str)
00050 {
00051     size_t length = strlen(str);
00052
00053     UINT32 requiredBytes = MultiByteToWideChar(
00054         CP_UTF8,
00055         0,
00056         str,
00057         (int)length,
00058         nullptr,
00059         0);
00060
00061     if (requiredBytes == 0)
00062     {
00063         return ref new String();
00064     }
00065
00066     std::vector<wchar_t> buffer(requiredBytes + 1);
00067
00068     UINT32 convertedBytes = MultiByteToWideChar(
00069         CP_UTF8,
00070         0,
00071         str,
00072         (int)length,
00073         (LPWSTR)&buffer[0],
00074         requiredBytes);
00075
00076     buffer[convertedBytes] = '\0';
00077     return ref new String(&buffer[0]);
00078 }
00079
00080 std::vector<char> AllJoynHelpers::PlatformToMultibyteString(_In_ String^ str)
00081 {
00082     UINT32 requiredBytes = WideCharToMultiByte(
00083         CP_UTF8,
00084         WC_ERR_INVALID_CHARS,
00085         str->Data(),
00086         str->Length(),
00087         nullptr,
00088         0,
00089         nullptr,
00090         nullptr);
00091
00092     if (requiredBytes == 0)
00093     {
00094         return std::vector<char>();
00095     }
00096
00097     std::vector<char> buffer(requiredBytes + 1);
00098
00099     UINT32 convertedBytes = WideCharToMultiByte(
00100         CP_UTF8,
00101         WC_ERR_INVALID_CHARS,
00102         str->Data(),
00103         str->Length(),
00104         (LPSTR)&buffer[0],
00105         requiredBytes,
00106         nullptr,
00107         nullptr);
00108
00109     buffer[convertedBytes] = '\0';
00110     return buffer;
00111 }
00112
00113 QStatus AllJoynHelpers::CreateInterfaces(_Inout_ AllJoynBusAttachment^ busAttachment, _In_ PCSTR introspectionXml)
00114 {
00115     return alljoyn_busattachment_createinterfacesfromxml(AllJoynHelpers::GetInternalBusAttachment(busAttachment), introspectionXml);
00116 }
00117
00118 Platform::String^ AllJoynHelpers::GetObjectPath(_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName)
00119 {
00120     PCSTR path;
00121     if (alljoyn_aboutobjectdescription_getinterfacepaths(objectDescription, interfaceName, &path, 1) == 0)
00122     {
00123         return nullptr;
00124     }
00125
00126     return AllJoynHelpers::MultibyteToPlatformString(path);
00127 }
00128
00129 bool AllJoynHelpers::CanSecure(_In_ Windows::Foundation::Collections::IVector<Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism>^ authenticationMechanisms)
00130 {
00131     unsigned int noneMechanismIndex = 0;
00132     bool authenticationMechanismsContainsNone = false;
00133
00134     // If there are no AuthenticationMechanisms, authentication
00135     // cannot be performed.
00136     if ((nullptr == authenticationMechanisms) || (authenticationMechanisms->Size == 0))
00137     {
00138         return false;
00139     }
00140
00141     // If authenticationMechanisms contains one or more secure entries,
00142     // authentication can be performed.
00143     authenticationMechanismsContainsNone = authenticationMechanisms->IndexOf(AllJoynAuthenticationMechanism::None, &noneMechanismIndex);
00144     if (false == authenticationMechanismsContainsNone)
00145     {
00146         return true;
00147     }
00148
00149     // If authenticationMechanisms contains any secure mechanisms,
00150     // authentication can be performed.
00151     for (auto authenticationMechanism : authenticationMechanisms)
00152     {
00153         if (authenticationMechanism != AllJoynAuthenticationMechanism::None)
00154         {
00155             return true;
00156         }
00157     }
00158
00159     // If this point is reached, authentication cannot be performed
00160     // because no secure mechanisms are specified.
00161     return false;
00162 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Enable Member List

This is the complete list of members for Scenario1_Enable, including all inherited members.
Scenario1_Enable() Scenario1_Enable [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario1_Prefs.h Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario1_Prefs.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Prefs.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_Prefs : Scenario1_PrefsT<Scenario1_Prefs>
00019     {
00020         Scenario1_Prefs();
00021
00022         void ShowResults_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario1_Prefs : Scenario1_PrefsT<Scenario1_Prefs, implementation::Scenario1_Prefs>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlaceLocation Member List

This is the complete list of members for PlaceLocation, including all inherited members.
Geoposition | PlaceLocation |
Geoposition | PlaceLocation |
GetMapCoordinates(double latitude, double longitude) | PlaceLocation | [private, static]
GetMapCoordinates(BasicGeoposition geoposition) | PlaceLocation | [inline, private, static]
MapCoordinates | PlaceLocation |
MapCoordinates | PlaceLocation |
PlaceLocation(double latitude, double longitude) | PlaceLocation |
PlaceLocation(double latitude, double longitude) | PlaceLocation | [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/Scenario1.xaml.cs Source File

  • SimpleImaging
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.ApplicationModel;
00017 using Windows.Foundation.Collections;
00018 using Windows.Storage;
00019 using Windows.Storage.AccessCache;
00020 using Windows.Storage.FileProperties;
00021 using Windows.Storage.Pickers;
00022 using Windows.Storage.Streams;
00023 using Windows.UI.Xaml;
00024 using Windows.UI.Xaml.Automation;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Media.Imaging;
00027 using Windows.UI.Xaml.Navigation;
00028
00029 namespace SimpleImaging
00030 {
00031     /// <summary>
00032     /// Code-behind for Scenario 1, which demonstrates image properties with FileProperties.
00033     /// </summary>
00034     public sealed partial class Scenario1 : Page
00035     {
00036         // Exception HResult constants. These constants are defined using values from winerror.h.
00037         // Either the requested value to set on the Windows property is not valid, or the Windows property
00038         // is not supported by the file format.
00039         const int E_INVALIDARG = unchecked((int)0x80070057);
00040
00041         StorageItemAccessList m_futureAccess = StorageApplicationPermissions.FutureAccessList;
00042         IPropertySet m_localSettings = Windows.Storage.ApplicationData.Current.LocalSettings.Values;
00043         ImageProperties m_imageProperties;
00044         string m_fileToken;
00045         private MainPage rootPage;
00046
00047         public Scenario1()
00048         {
00049             this.InitializeComponent();
00050         }
00051
00052         /// <summary>
00053         /// Invoked when this page is about to be displayed in a Frame.
00054         /// </summary>
00055         protected override void OnNavigatedTo(NavigationEventArgs e)
00056         {
00057             rootPage = MainPage.Current;
00058             App.Current.Suspending += new SuspendingEventHandler(SaveDataToPersistedState);
00059
00060             // Reset scenario state before starting.
00061             ResetSessionState();
00062
00063             // Attempt to load the previously saved scenario state.
00064             if (m_localSettings.ContainsKey("scenario1FileToken"))
00065             {
00066                 RestoreDataFromPersistedState();
00067             }
00068         }
00069
00070         /// <summary>
00071         /// Invoked when the user clicks on the Open button.
00072         /// </summary>
00073         private async void Open_Click(object sender, RoutedEventArgs e)
00074         {
00075             ResetSessionState();
00076             ResetPersistedState();
00077
00078             FileOpenPicker picker = new FileOpenPicker();
00079             Helpers.FillDecoderExtensions(picker.FileTypeFilter);
00080             picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00081
00082             var file = await picker.PickSingleFileAsync();
00083             if (file != null)
00084             {
00085                 await LoadFileAsync(file);
00086             }
00087         }
00088
00089         /// <summary>
00090         /// When the application is about to enter a suspended state, save the user edited properties text.
00091         /// </summary>
00092         private void SaveDataToPersistedState(object sender, SuspendingEventArgs args)
00093         {
00094             // Only save state if we have valid data.
00095             if (m_fileToken != null)
00096             {
00097                 // Requesting a deferral prevents the application from being immediately suspended.
00098                 SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral();
00099
00100                 // LocalSettings does not support overwriting existing items, so first clear the collection.
00101                 ResetPersistedState();
00102
00103                 m_localSettings.Add("scenario1Title", TitleTextbox.Text);
00104                 m_localSettings.Add("scenario1Keywords", KeywordsTextbox.Text);
00105                 m_localSettings.Add("scenario1DateTaken", DateTakenTextblock.Text);
00106                 m_localSettings.Add("scenario1Make", MakeTextblock.Text);
00107                 m_localSettings.Add("scenario1Model", ModelTextblock.Text);
00108                 m_localSettings.Add("scenario1Orientation", OrientationTextblock.Text);
00109                 m_localSettings.Add("scenario1LatDeg", LatDegTextbox.Text);
00110                 m_localSettings.Add("scenario1LatMin", LatMinTextbox.Text);
00111                 m_localSettings.Add("scenario1LatSec", LatSecTextbox.Text);
00112                 m_localSettings.Add("scenario1LatRef", LatRefTextbox.Text);
00113                 m_localSettings.Add("scenario1LongDeg", LongDegTextbox.Text);
00114                 m_localSettings.Add("scenario1LongMin", LongMinTextbox.Text);
00115                 m_localSettings.Add("scenario1LongSec", LongSecTextbox.Text);
00116                 m_localSettings.Add("scenario1LongRef", LongRefTextbox.Text);
00117                 m_localSettings.Add("scenario1Exposure", ExposureTextblock.Text);
00118                 m_localSettings.Add("scenario1FNumber", FNumberTextblock.Text);
00119                 m_localSettings.Add("scenario1FileToken", m_fileToken);
00120
00121                 deferral.Complete();
00122             }
00123         }
00124
00125         /// <summary>
00126         /// Reads the file token and property text from the persisted state, and calls
00127         /// DisplayImageUIAsync().
00128         /// </summary>
00129         private async void RestoreDataFromPersistedState()
00130         {
00131             try
00132             {
00133                 m_fileToken = m_localSettings["scenario1FileToken"].ToString();
00134                 StorageFile file = await m_futureAccess.GetFileAsync(m_fileToken);
00135                 m_imageProperties = await file.Properties.GetImagePropertiesAsync();
00136
00137                 Dictionary<string, string> propertyText = new Dictionary<string, string>();
00138                 propertyText.Add("Title", m_localSettings["scenario1Title"].ToString());
00139                 propertyText.Add("Keywords", m_localSettings["scenario1Keywords"].ToString());
00140                 propertyText.Add("DateTaken", m_localSettings["scenario1DateTaken"].ToString());
00141                 propertyText.Add("Make", m_localSettings["scenario1Make"].ToString());
00142                 propertyText.Add("Model", m_localSettings["scenario1Model"].ToString());
00143                 propertyText.Add("Orientation", m_localSettings["scenario1Orientation"].ToString());
00144                 propertyText.Add("LatDeg", m_localSettings["scenario1LatDeg"].ToString());
00145                 propertyText.Add("LatMin", m_localSettings["scenario1LatMin"].ToString());
00146                 propertyText.Add("LatSec", m_localSettings["scenario1LatSec"].ToString());
00147                 propertyText.Add("LatRef", m_localSettings["scenario1LatRef"].ToString());
00148                 propertyText.Add("LongDeg", m_localSettings["scenario1LongDeg"].ToString());
00149                 propertyText.Add("LongMin", m_localSettings["scenario1LongMin"].ToString());
00150                 propertyText.Add("LongSec", m_localSettings["scenario1LongSec"].ToString());
00151                 propertyText.Add("LongRef", m_localSettings["scenario1LongRef"].ToString());
00152                 propertyText.Add("Exposure", m_localSettings["scenario1Exposure"].ToString());
00153                 propertyText.Add("FNumber", m_localSettings["scenario1FNumber"].ToString());
00154
00155                 await DisplayImageUIAsync(file, propertyText);
00156
00157                 rootPage.NotifyUser(
00158                     "Loaded file from persisted state: " + file.Name,
00159                     NotifyType.StatusMessage
00160                     );
00161
00162                 CloseButton.IsEnabled = true;
00163                 ApplyButton.IsEnabled = true;
00164             }
00165             catch (Exception err)
00166             {
00167                 rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
00168                 ResetSessionState();
00169                 ResetPersistedState();
00170             }
00171         }
00172
00173         /// <summary>
00174         /// Load an image from a file and display some basic imaging properties.
00175         /// </summary>
00176         /// <param name="file">The image to load.</param>
00177         private async Task LoadFileAsync(StorageFile file)
00178         {
00179             try
00180             {
00181                 // Request persisted access permissions to the file the user selected.
00182                 // This allows the app to directly load the file in the future without relying on a
00183                 // broker such as the file picker.
00184                 m_fileToken = m_futureAccess.Add(file);
00185
00186                 // Windows.Storage.FileProperties.ImageProperties provides convenience access to
00187                 // commonly-used properties such as geolocation and keywords. It also accepts
00188                 // queries for Windows property system keys such as "System.Photo.Aperture".
00189                 m_imageProperties = await file.Properties.GetImagePropertiesAsync();
00190
00191                 string[] requests =
00192                 {
00193                     "System.Photo.ExposureTime",        // In seconds
00194                     "System.Photo.FNumber"              // F-stop values defined by EXIF spec
00195                 };
00196
00197                 IDictionary<string, object> retrievedProps =
00198                     await m_imageProperties.RetrievePropertiesAsync(requests);
00199                 await DisplayImageUIAsync(file, GetImagePropertiesForDisplay(retrievedProps));
00200
00201                 rootPage.NotifyUser(
00202                     "Loaded file from picker: " + file.Name,
00203                     NotifyType.StatusMessage
00204                     );
00205
00206                 CloseButton.IsEnabled = true;
00207                 ApplyButton.IsEnabled = true;
00208             }
00209             catch (Exception err)
00210             {
00211                 rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
00212                 ResetPersistedState();
00213                 ResetSessionState();
00214             }
00215         }
00216
00217         /// <summary>
00218         /// Gathers the imaging properties read from a file and formats them into a single object
00219         /// that can be consumed by DisplayImageUIAsync(). This method also reads from m_imageProperties.
00220         /// </summary>
00221         /// <param name="retrievedProps">Contains System.Photo.ExposureTime and System.Photo.FNumber</param>
00222         /// <returns>Dictionary of strings to be used in DisplayImageUI().</returns>
00223         private IDictionary<string, string> GetImagePropertiesForDisplay(IDictionary<string, object> retrievedProps)
00224         {
00225             var propertyText = new Dictionary<string, string>();
00226
00227             // Some of the properties need to be converted/formatted.
00228             string keywordsText = String.Join(Environment.NewLine, m_imageProperties.Keywords);
00229
00230             string exposureText;
00231             if (retrievedProps.ContainsKey("System.Photo.ExposureTime"))
00232             {
00233                 exposureText = ((double)retrievedProps["System.Photo.ExposureTime"] * 1000).ToString() + " ms";
00234             }
00235             else
00236             {
00237                 exposureText = "";
00238             }
00239
00240             string fNumberText;
00241             if (retrievedProps.ContainsKey("System.Photo.FNumber"))
00242             {
00243                 fNumberText = ((double)retrievedProps["System.Photo.FNumber"]).ToString("F1");
00244             }
00245             else
00246             {
00247                 fNumberText = "";
00248             }
00249
00250             string orientationText = Helpers.GetOrientationString(m_imageProperties.Orientation);
00251
00252             string latRefText, longRefText, latDegText, latMinText, latSecText, longDegText, longMinText, longSecText;
00253
00254             // Do a simple check if GPS data exists.
00255             if ((m_imageProperties.Latitude.HasValue) && (m_imageProperties.Longitude.HasValue))
00256             {
00257                 double latitude = m_imageProperties.Latitude.Value;
00258                 double longitude = m_imageProperties.Longitude.Value;
00259
00260                 // Latitude and longitude are returned as double precision numbers,
00261                 // but we want to convert to degrees/minutes/seconds format.
00262                 latRefText = (latitude >= 0) ? "N" : "S";
00263                 longRefText = (longitude >= 0) ? "E" : "W";
00264                 double latDeg = Math.Floor(Math.Abs(latitude));
00265                 latDegText = latDeg.ToString();
00266                 double latMin = Math.Floor((Math.Abs(latitude) - latDeg) * 60);
00267                 latMinText = latMin.ToString();
00268                 latSecText = ((Math.Abs(latitude) - latDeg - latMin / 60) * 3600).ToString();
00269                 double longDeg = Math.Floor(Math.Abs(longitude));
00270                 longDegText = longDeg.ToString();
00271                 double longMin = Math.Floor((Math.Abs(longitude) - longDeg) * 60);
00272                 longMinText = longMin.ToString();
00273                 longSecText = ((Math.Abs(longitude) - longDeg - longMin / 60) * 3600).ToString();
00274             }
00275             else
00276             {
00277                 latRefText = longRefText = latDegText = latMinText = latSecText = longDegText = longMinText = longSecText = "";
00278             }
00279
00280             propertyText.Add("Title", m_imageProperties.Title);
00281             propertyText.Add("Keywords", keywordsText);
00282             propertyText.Add("DateTaken", m_imageProperties.DateTaken.ToString());
00283             propertyText.Add("Make", m_imageProperties.CameraManufacturer);
00284             propertyText.Add("Model", m_imageProperties.CameraModel);
00285             propertyText.Add("Orientation", orientationText);
00286             propertyText.Add("LatRef", latRefText);
00287             propertyText.Add("LongRef", longRefText);
00288             propertyText.Add("LatDeg", latDegText);
00289             propertyText.Add("LatMin", latMinText);
00290             propertyText.Add("LatSec", latSecText);
00291             propertyText.Add("LongDeg", longDegText);
00292             propertyText.Add("LongMin", longMinText);
00293             propertyText.Add("LongSec", longSecText);
00294             propertyText.Add("Exposure", exposureText);
00295             propertyText.Add("FNumber", fNumberText);
00296
00297             return propertyText;
00298         }
00299
00300         /// <summary>
00301         /// Asynchronously displays the image file and properties text in the UI. This method is called
00302         /// when the user loads a new file, or when the app resumes from a suspended state.
00303         /// </summary>
00304         /// <param name="file">The image to be displayed.</param>
00305         /// <param name="propertyText">Collection of property text to be displayed. Must contain the following keys:
00306         /// Title, Keywords, DateTaken, Make, Model, LatRef, LongRef, LatDeg, LatMin, LatSec, LongDeg, LongMin,
00307         /// LongSec, Orientation, Exposure, FNumber.</param>
00308         private async Task DisplayImageUIAsync(StorageFile file, IDictionary<string, string> propertyText)
00309         {
00310             BitmapImage src = new BitmapImage();
00311             using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
00312             {
00313                 await src.SetSourceAsync(stream);
00314             }
00315
00316             PreviewImage.Source = src;
00317             AutomationProperties.SetName(PreviewImage, file.Name);
00318
00319             TitleTextbox.Text = propertyText["Title"];
00320             KeywordsTextbox.Text = propertyText["Keywords"];
00321             DateTakenTextblock.Text = propertyText["DateTaken"];
00322             MakeTextblock.Text = propertyText["Make"];
00323             ModelTextblock.Text = propertyText["Model"];
00324             OrientationTextblock.Text = propertyText["Orientation"];
00325             LatDegTextbox.Text = propertyText["LatDeg"];
00326             LatMinTextbox.Text = propertyText["LatMin"];
00327             LatRefTextbox.Text = propertyText["LatRef"];
00328             LongDegTextbox.Text = propertyText["LongDeg"];
00329             LongMinTextbox.Text = propertyText["LongMin"];
00330             LongRefTextbox.Text = propertyText["LongRef"];
00331             ExposureTextblock.Text = propertyText["Exposure"];
00332             FNumberTextblock.Text = propertyText["FNumber"];
00333
00334             // Truncate the latitude and longitude seconds data to 4 decimal places (precision of 1/10000th).
00335             if (propertyText["LatSec"].Length > 7)
00336             {
00337                 LatSecTextbox.Text = propertyText["LatSec"].Substring(0, 7);
00338             }
00339             else
00340             {
00341                 LatSecTextbox.Text = propertyText["LatSec"];
00342             }
00343
00344             if (propertyText["LongSec"].Length > 7)
00345             {
00346                 LongSecTextbox.Text = propertyText["LongSec"].Substring(0, 7);
00347             }
00348             else
00349             {
00350                 LongSecTextbox.Text = propertyText["LongSec"];
00351             }
00352         }
00353
00354         /// <summary>
00355         /// Updates the file with the user-edited properties. The m_imageProperties object
00356         /// is still usable after the method completes.
00357         /// </summary>
00358         private async void Apply_Click(object sender, RoutedEventArgs e)
00359         {
00360             rootPage.NotifyUser("Saving file...", NotifyType.StatusMessage);
00361
00362             m_imageProperties.Title = TitleTextbox.Text;
00363
00364             // Keywords are stored as an IList of strings.
00365             if (KeywordsTextbox.Text.Length > 0)
00366             {
00367                 string[] keywordsArray = KeywordsTextbox.Text.Split('\n');
00368                 m_imageProperties.Keywords.Clear();
00369
00370                 for (uint i = 0; i < keywordsArray.Length; i++)
00371                 {
00372                     m_imageProperties.Keywords.Add(keywordsArray[i]);
00373                 }
00374             }
00375
00376             PropertySet propertiesToSave = new PropertySet();
00377
00378             // Perform some simple validation of the GPS data and package it in a format
00379             // better suited for writing to the file.
00380             bool gpsWriteFailed = false;
00381             double[] latitude = new double[3];
00382             double[] longitude = new double[3];
00383             string latitudeRef = String.Empty;
00384             string longitudeRef = String.Empty;
00385
00386             try
00387             {
00388                 latitude[0] = Math.Floor(Double.Parse(LatDegTextbox.Text));
00389                 latitude[1] = Math.Floor(Double.Parse(LatMinTextbox.Text));
00390                 latitude[2] = Double.Parse(LatSecTextbox.Text);
00391
00392                 longitude[0] = Math.Floor(Double.Parse(LongDegTextbox.Text));
00393                 longitude[1] = Math.Floor(Double.Parse(LongMinTextbox.Text));
00394                 longitude[2] = Double.Parse(LongSecTextbox.Text);
00395
00396                 latitudeRef = LatRefTextbox.Text.ToUpper();
00397                 longitudeRef = LongRefTextbox.Text.ToUpper();
00398             }
00399             catch (Exception) // Treat any exception as invalid GPS data.
00400             {
00401                 gpsWriteFailed = true;
00402             }
00403
00404             if ((latitude[0] >= 0 && latitude[0] <= 90) &&
00405                 (latitude[1] >= 0 && latitude[1] <= 60) &&
00406                 (latitude[2] >= 0 && latitude[2] <= 60) &&
00407                 (latitudeRef == "N" || latitudeRef == "S") &&
00408                 (longitude[0] >= 0 && longitude[0] <= 180) &&
00409                 (latitude[1] >= 0 && longitude[1] <= 60) &&
00410                 (longitude[2] >= 0 && longitude[2] <= 60) &&
00411                 (longitudeRef == "E" || longitudeRef == "W"))
00412             {
00413                 propertiesToSave.Add("System.GPS.LatitudeRef", latitudeRef);
00414                 propertiesToSave.Add("System.GPS.LongitudeRef", longitudeRef);
00415
00416                 // The Latitude and Longitude properties are read-only. Instead,
00417                 // write to System.GPS.LatitudeNumerator, LatitudeDenominator, etc.
00418                 // These are length 3 arrays of integers. For simplicity, the
00419                 // seconds data is rounded to the nearest 10000th.
00420                 uint[] latitudeNumerator =
00421                 {
00422                     (uint) latitude[0],
00423                     (uint) latitude[1],
00424                     (uint) (latitude[2] * 10000)
00425                 };
00426
00427                 uint[] longitudeNumerator =
00428                 {
00429                     (uint) longitude[0],
00430                     (uint) longitude[1],
00431                     (uint) (longitude[2] * 10000)
00432                 };
00433
00434                 // LatitudeDenominator and LongitudeDenominator share the same values.
00435                 uint[] denominator =
00436                 {
00437                     1,
00438                     1,
00439                     10000
00440                 };
00441
00442                 propertiesToSave.Add("System.GPS.LatitudeNumerator", latitudeNumerator);
00443                 propertiesToSave.Add("System.GPS.LatitudeDenominator", denominator);
00444                 propertiesToSave.Add("System.GPS.LongitudeNumerator", longitudeNumerator);
00445                 propertiesToSave.Add("System.GPS.LongitudeDenominator", denominator);
00446             }
00447             else
00448             {
00449                 gpsWriteFailed = true;
00450             }
00451
00452             try
00453             {
00454                 // SavePropertiesAsync commits edits to the top level properties (e.g. Title) as
00455                 // well as any Windows properties contained within the propertiesToSave parameter.
00456                 await m_imageProperties.SavePropertiesAsync(propertiesToSave);
00457
00458                 rootPage.NotifyUser(gpsWriteFailed ? "GPS data invalid; other properties successfully updated" :
00459                         "All properties successfully updated", NotifyType.StatusMessage);
00460             }
00461             catch (Exception err)
00462             {
00463                 switch (err.HResult)
00464                 {
00465                     case E_INVALIDARG:
00466                         // Some imaging formats, such as PNG and BMP, do not support Windows properties.
00467                         // Other formats do not support all Windows properties.
00468                         // For example, JPEG does not support System.FlagStatus.
00469                         rootPage.NotifyUser("Error: A property value is invalid, or the file format does " +
00470                             "not support one or more requested properties.", NotifyType.ErrorMessage);
00471
00472                         break;
00473
00474                     default:
00475                         rootPage.NotifyUser("Error: " + err.Message, NotifyType.ErrorMessage);
00476                         break;
00477                 }
00478
00479                 ResetSessionState();
00480                 ResetPersistedState();
00481             }
00482         }
00483
00484         /// <summary>
00485         /// Closing the file brings the scenario back to the default initialized state.
00486         /// </summary>
00487         private void Close_Click(object sender, RoutedEventArgs e)
00488         {
00489             ResetSessionState();
00490             ResetPersistedState();
00491             rootPage.NotifyUser("Closed file", NotifyType.StatusMessage);
00492         }
00493
00494         /// <summary>
00495         /// Clears all of the state for this scenario that is stored in app data.
00496         /// This method does not use the SuspensionManager helper class (defined in SuspensionManager.cs).
00497         /// </summary>
00498         private void ResetPersistedState()
00499         {
00500             m_localSettings.Remove("scenario1FileToken");
00501             m_localSettings.Remove("scenario1Title");
00502             m_localSettings.Remove("scenario1Keywords");
00503             m_localSettings.Remove("scenario1DateTaken");
00504             m_localSettings.Remove("scenario1Make");
00505             m_localSettings.Remove("scenario1Model");
00506             m_localSettings.Remove("scenario1Orientation");
00507             m_localSettings.Remove("scenario1LatDeg");
00508             m_localSettings.Remove("scenario1LatMin");
00509             m_localSettings.Remove("scenario1LatSec");
00510             m_localSettings.Remove("scenario1LatRef");
00511             m_localSettings.Remove("scenario1LongDeg");
00512             m_localSettings.Remove("scenario1LongMin");
00513             m_localSettings.Remove("scenario1LongSec");
00514             m_localSettings.Remove("scenario1LongRef");
00515             m_localSettings.Remove("scenario1Exposure");
00516             m_localSettings.Remove("scenario1FNumber");
00517         }
00518
00519         /// <summary>
00520         /// Clears all of the state that is stored in memory and in the UI.
00521         /// </summary>
00522         private void ResetSessionState()
00523         {
00524             m_imageProperties = null;
00525             m_fileToken = null;
00526
00527             CloseButton.IsEnabled = false;
00528             ApplyButton.IsEnabled = false;
00529             PreviewImage.Source = null;
00530
00531             TitleTextbox.Text = "";
00532             KeywordsTextbox.Text = "";
00533             DateTakenTextblock.Text = "";
00534             MakeTextblock.Text = "";
00535             ModelTextblock.Text = "";
00536             OrientationTextblock.Text = "";
00537             LatDegTextbox.Text = "";
00538             LatMinTextbox.Text = "";
00539             LatSecTextbox.Text = "";
00540             LatRefTextbox.Text = "";
00541             LongDegTextbox.Text = "";
00542             LongMinTextbox.Text = "";
00543             LongSecTextbox.Text = "";
00544             LongRefTextbox.Text = "";
00545             ExposureTextblock.Text = "";
00546             FNumberTextblock.Text = "";
00547         }
00548     }
00549 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/Constants.h Source File

  • LowLatencyInput
  • cpp
  • Common

Constants.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     //constants for changing the size of the rect based on screen size
00017     const float bigRectSize = 200;
00018     const float smallRectSize = 125;
00019     const float minScreenWidth = 720;
00020 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMemoryBufferByteAccess Member List

This is the complete list of members for IMemoryBufferByteAccess, including all inherited members.
GetBuffer(out byte *buffer, out uint capacity) IMemoryBufferByteAccess
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Project.idl Source File

  • WebSocket
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_UTF8 : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_UTF8();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_Binary : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_Binary();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_ClientAuthentication : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_ClientAuthentication();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_PartialReadWrite : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_PartialReadWrite();
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/SampleConfiguration.cs Source File

  • VideoPlaybackSynchronization
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Video Playback Synchronization C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Multi-camera angle", ClassType=typeof(Scenario1_MultiVideoPlayback)},
00025             new Scenario() { Title="Side-by-side offset sync", ClassType=typeof(Scenario2_SynchronizingPlayers)},
00026             new Scenario() { Title="HLS stream sync", ClassType=typeof(Scenario3_AdaptiveSync)}
00027         };
00028
00029         public static void CleanUpMediaPlayerSource(Windows.Media.Playback.MediaPlayer mp)
00030         {
00031             if (mp?.Source != null)
00032             {
00033                 var source = mp.Source as Windows.Media.Core.MediaSource;
00034                 source?.Dispose();
00035
00036                 var item = mp.Source as Windows.Media.Playback.MediaPlaybackItem;
00037                 item?.Source?.Dispose();
00038
00039                 mp.Source = null;
00040             };
00041         }
00042     }
00043
00044     public class Scenario
00045     {
00046         public string Title { get; set; }
00047         public Type ClassType { get; set; }
00048     }
00049 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4 Member List

This is the complete list of members for Scenario4, including all inherited members.
Scenario4() Scenario4 [inline]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario13 Member List

This is the complete list of members for Scenario13, including all inherited members.
DXFLOptionCombo_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario13 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario13 | [inline, protected]
rootPage | Scenario13 | [private]
Scenario13() | Scenario13 | [inline]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/SampleConfiguration.h Source File

  • XamlCommanding
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Commanding";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/SampleConfiguration.cs Source File

  • ContentIndexer
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Content indexer C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Add item to the index using the ContentIndexer",              ClassType = typeof(S1_AddWithAPI) },
00025             new Scenario() { Title = "Update and delete indexed items using the ContentIndexer",    ClassType = typeof(S2_UpdateAndDeleteWithAPI) },
00026             new Scenario() { Title = "Retrieve indexed items added using the ContentIndexer",       ClassType = typeof(S3_RetrieveWithAPI) },
00027             new Scenario() { Title = "Check the index revision number",                             ClassType = typeof(S4_CheckIndexRevision) },
00028             new Scenario() { Title = "Add indexed items by using appcontent-ms files",              ClassType = typeof(S5_AddWithAppContent) },
00029             new Scenario() { Title = "Delete indexed appcontent-ms files",                          ClassType = typeof(S6_DeleteWithAppContent) },
00030             new Scenario() { Title = "Retrieve indexed properties from appcontent-ms files",        ClassType = typeof(S7_RetrieveWithAppContent) }
00031         };
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario3_AddAudioTracks.xaml.cs Source File

  • MediaEditing
  • cs

Scenario3_AddAudioTracks.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using Windows.Storage;
00017 using Windows.Media.Editing;
00018 using Windows.Media.Core;
00019 using SDKTemplate;
00020
00021 namespace MediaEditingSample
00022 {
00023     public sealed partial class Scenario3_AddAudioTracks : Page
00024     {
00025         private MainPage rootPage;
00026         private MediaComposition composition;
00027         private StorageFile pickedFile;
00028         private MediaStreamSource mediaStreamSource;
00029
00030         public Scenario3_AddAudioTracks()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         protected override void OnNavigatedTo(NavigationEventArgs e)
00036         {
00037             rootPage = MainPage.Current;
00038         }
00039
00040         protected override void OnNavigatedFrom(NavigationEventArgs e)
00041         {
00042             mediaElement.Source = null;
00043             mediaStreamSource = null;
00044             base.OnNavigatedFrom(e);
00045         }
00046
00047         private async void ChooseVideo_Click(object sender, RoutedEventArgs e)
00048         {
00049             var picker = new Windows.Storage.Pickers.FileOpenPicker();
00050             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
00051             picker.FileTypeFilter.Add(".mp4");
00052             pickedFile = await picker.PickSingleFileAsync();
00053             if (pickedFile == null)
00054             {
00055                 rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
00056                 return;
00057             }
00058
00059             mediaElement.SetSource(await pickedFile.OpenReadAsync(), pickedFile.ContentType);
00060             addAudio.IsEnabled = true;
00061
00062             rootPage.NotifyUser("Video file added", NotifyType.StatusMessage);
00063         }
00064
00065         private async void AddAudio_Click(object sender, RoutedEventArgs e)
00066         {
00067             // Create the original MediaComposition
00068             var clip = await MediaClip.CreateFromFileAsync(pickedFile);
00069             composition = new MediaComposition();
00070             composition.Clips.Add(clip);
00071
00072             // Add background audio
00073             var picker = new Windows.Storage.Pickers.FileOpenPicker();
00074             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.MusicLibrary;
00075             picker.FileTypeFilter.Add(".mp3");
00076             picker.FileTypeFilter.Add(".wav");
00077             picker.FileTypeFilter.Add(".flac");
00078             var audioFile = await picker.PickSingleFileAsync();
00079             if (audioFile == null)
00080             {
00081                 rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
00082                 return;
00083             }
00084
00085             var backgroundTrack = await BackgroundAudioTrack.CreateFromFileAsync(audioFile);
00086             composition.BackgroundAudioTracks.Add(backgroundTrack);
00087
00088             // Render to MediaElement
00089             mediaElement.Position = TimeSpan.Zero;
00090             mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
00091             mediaElement.SetMediaStreamSource(mediaStreamSource);
00092
00093             rootPage.NotifyUser("Background audio added", NotifyType.StatusMessage);
00094         }
00095     }
00096 }
Generated on Fri Nov 15 2024 22:20:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/DetailPage.cpp Source File

  • XamlMasterDetail
  • cppwinrt

DetailPage.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DetailPage.h"
00014 #include "DetailPage.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace MasterDetailApp::Data;
00018 using namespace MasterDetailApp::ViewModels;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Media::Animation;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 namespace winrt::MasterDetailApp::implementation
00028 {
00029     Windows::UI::Xaml::DependencyProperty DetailPage::s_itemProperty{ nullptr };
00030
00031     void DetailPage::RegisterDependencyProperties()
00032     {
00033         s_itemProperty = DependencyProperty::Register(L"Item", xaml_typename<ItemViewModel>(),
00034             xaml_typename<MasterDetailApp::DetailPage>(), nullptr);
00035     }
00036
00037     DetailPage::DetailPage()
00038     {
00039         InitializeComponent();
00040     }
00041
00042     void DetailPage::OnNavigatedTo(NavigationEventArgs const& e)
00043     {
00044         // Parameter is item ID
00045         auto id = unbox_value<int>(e.Parameter());
00046         Item(ItemViewModel::FromItem(ItemsDataSource::GetItemById(id)));
00047
00048         ReplaceLastBackStackEntryParameter(e.Parameter());
00049
00050         // Register for hardware and software back request from the system
00051         auto systemNavigationManager = SystemNavigationManager::GetForCurrentView();
00052         m_backRequestedEventRegistrationToken =
00053             systemNavigationManager.BackRequested({ this, &DetailPage::DetailPage_BackRequested });
00054         systemNavigationManager.AppViewBackButtonVisibility(AppViewBackButtonVisibility::Visible);
00055     }
00056
00057     void DetailPage::OnNavigatedFrom(NavigationEventArgs const&)
00058     {
00059         auto systemNavigationManager = SystemNavigationManager::GetForCurrentView();
00060         systemNavigationManager.BackRequested(m_backRequestedEventRegistrationToken);
00061         systemNavigationManager.AppViewBackButtonVisibility(AppViewBackButtonVisibility::Collapsed);
00062     }
00063
00064     void DetailPage::OnBackRequested()
00065     {
00066         // Page above us will be our master view.
00067         // Make sure we are using the "drill out" animation in this transition.
00068         ReplaceLastBackStackEntryParameter(nullptr);
00069         Frame().GoBack(DrillInNavigationTransitionInfo());
00070     }
00071
00072     // Doctor the navigation parameter for the master page so it
00073     // will show the correct item in the side-by-side view.
00074     void DetailPage::ReplaceLastBackStackEntryParameter(IInspectable const& parameter)
00075     {
00076         auto backStack = Frame().BackStack();
00077         auto backStackCount = backStack.Size();
00078
00079         if (backStackCount > 0)
00080         {
00081             auto masterPageEntry = backStack.GetAt(backStackCount - 1);
00082
00083             auto modifiedEntry = PageStackEntry(masterPageEntry.SourcePageType(), parameter, masterPageEntry.NavigationTransitionInfo());
00084
00085             backStack.SetAt(backStackCount - 1, modifiedEntry);
00086         }
00087     }
00088
00089     void DetailPage::NavigateBackForWideState(bool useTransition)
00090     {
00091         // Evict this page from the cache as we may not need it again.
00092         NavigationCacheMode(NavigationCacheMode::Disabled);
00093
00094         if (useTransition)
00095         {
00096             Frame().GoBack(EntranceNavigationTransitionInfo());
00097         }
00098         else
00099         {
00100             Frame().GoBack(SuppressNavigationTransitionInfo());
00101         }
00102     }
00103
00104     bool DetailPage::ShouldGoToWideState()
00105     {
00106         return Window::Current().Bounds().Width >= 720.0;
00107     }
00108
00109     void DetailPage::PageRoot_Loaded(IInspectable const&, RoutedEventArgs const&)
00110     {
00111         if (ShouldGoToWideState())
00112         {
00113             // We shouldn't see this page since we are in "wide master-detail" mode.
00114             // Play a transition as we are likely navigating back from a separate page.
00115             NavigateBackForWideState(/* useTransition */ true);
00116         }
00117         else
00118         {
00119             // Realize the main page content.
00120             [[maybe_unused]] auto rootPanel = FindName(L"RootPanel");
00121         }
00122
00123         m_sizeChangedEventRegistrationToken = Window::Current().SizeChanged({ this, &DetailPage::Window_SizeChanged });
00124     }
00125
00126
00127     void DetailPage::PageRoot_Unloaded(IInspectable const&, RoutedEventArgs const&)
00128     {
00129         Window::Current().SizeChanged(m_sizeChangedEventRegistrationToken);
00130         m_sizeChangedEventRegistrationToken = {};
00131     }
00132
00133     void DetailPage::Window_SizeChanged(IInspectable const&, WindowSizeChangedEventArgs const&)
00134     {
00135         if (ShouldGoToWideState())
00136         {
00137             // Make sure we are no longer listening to window change events.
00138             Window::Current().SizeChanged(m_sizeChangedEventRegistrationToken);
00139             m_sizeChangedEventRegistrationToken = {};
00140
00141             // We shouldn't see this page since we are in "wide master-detail" mode.
00142             NavigateBackForWideState(/* useTransition */ false);
00143         }
00144     }
00145
00146     void DetailPage::DetailPage_BackRequested(IInspectable const&, BackRequestedEventArgs const& args)
00147     {
00148         // Mark event as handled so we don't get bounced out of the app.
00149         args.Handled(true);
00150
00151         OnBackRequested();
00152     }
00153 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario16_NetworkResource Member List

This is the complete list of members for Scenario16_NetworkResource, including all inherited members.
CheckUriIdentity_Click(object sender, RoutedEventArgs e) | Scenario16_NetworkResource | [inline, private]
ClientTypeChanged() | Scenario16_NetworkResource | [inline, private]
ConnectToUri() | Scenario16_NetworkResource | [inline, private]
ConnectUsingBackgroundTransfer(string resourceIdentity, Uri resourceUri) | Scenario16_NetworkResource | [inline, private]
ConnectUsingNetHttpClient(string resourceIdentity, Uri resourceUri) | Scenario16_NetworkResource | [inline, private]
ConnectUsingWebHttpClient(string resourceIdentity, Uri resourceUri) | Scenario16_NetworkResource | [inline, private]
DiscoverActiveDownloadsAsync() | Scenario16_NetworkResource | [inline, private]
DisplayNetworkIdentity(string resourceIdentity) | Scenario16_NetworkResource | [inline, private]
HandleDownloadAsync(DownloadOperation download) | Scenario16_NetworkResource | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario16_NetworkResource | [inline, protected]
rootPage | Scenario16_NetworkResource | [private]
Scenario16_NetworkResource() | Scenario16_NetworkResource | [inline]
UsingNetworkContext< T >(string identity, Func< T > lambda) | Scenario16_NetworkResource | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario3_Add.xaml.cpp Source File

  • Playlists
  • cpp

Scenario3_Add.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario3_Add.xaml.h"
00005 #include <sstream>
00006
00007 using namespace SDKTemplate;
00008
00009 using namespace concurrency;
00010 using namespace Platform;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Foundation::Collections;
00013 using namespace Windows::Media::Playlists;
00014 using namespace Windows::Storage;
00015 using namespace Windows::Storage::Pickers;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Controls::Primitives;
00019 using namespace Windows::UI::Xaml::Data;
00020 using namespace Windows::UI::Xaml::Input;
00021 using namespace Windows::UI::Xaml::Media;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 Scenario3_Add::Scenario3_Add() : rootPage(MainPage::Current)
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario3_Add::PickPlaylistButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00030 {
00031     PickAudioButton->IsEnabled = false;
00032     this->rootPage->PickPlaylistAsync().then([this](Playlist^ playlist)
00033     {
00034         this->playlist = playlist;
00035         if (this->playlist != nullptr)
00036         {
00037             this->rootPage->NotifyUser("Playlist loaded", NotifyType::StatusMessage);
00038         }
00039
00040         PickAudioButton->IsEnabled = (this->playlist != nullptr);
00041     });
00042 }
00043
00044 void Scenario3_Add::PickAudioButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00045 {
00046     // Pick some files, then add them to the playlist.
00047     FileOpenPicker^ picker = MainPage::CreateFilePicker(MainPage::audioExtensions);
00048     create_task(picker->PickMultipleFilesAsync()).then([this](IVectorView<StorageFile^>^ files)
00049     {
00050         if (files->Size > 0)
00051         {
00052             for (StorageFile^ file : files)
00053             {
00054                 this->playlist->Files->Append(file);
00055             }
00056
00057             this->rootPage->TrySavePlaylistAsync(playlist).then([this, files](bool result)
00058             {
00059                 if (result)
00060                 {
00061                     this->rootPage->NotifyUser(files->Size + " files added to the playlist.", NotifyType::StatusMessage);
00062                 }
00063             });
00064         }
00065         else
00066         {
00067             this->rootPage->NotifyUser("No file was selected.", NotifyType::ErrorMessage);
00068         }
00069     });
00070 }
Generated on Fri Nov 15 2024 22:20:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage_CachedFile Member List

This is the complete list of members for MainPage_CachedFile, including all inherited members.
MainPage_CachedFile() MainPage_CachedFile [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/pch.cpp Source File

  • DisplayOrientation
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FrameSourceInfoModel Member List

This is the complete list of members for FrameSourceInfoModel, including all inherited members.
DisplayName | FrameSourceInfoModel |
FrameSourceInfoModel(MediaFrameSourceInfo sourceInfo) | FrameSourceInfoModel | [inline]
Id | FrameSourceInfoModel |
SourceGroup | FrameSourceInfoModel |
SourceInfo | FrameSourceInfoModel |
ToString() | FrameSourceInfoModel | [inline]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingLegacySignals.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingLegacySignals.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace org { namespace alljoyn { namespace Onboarding {
00024
00025 ref class OnboardingLegacySignals;
00026
00027 public interface class IOnboardingLegacySignals
00028 {
00029     event Windows::Foundation::TypedEventHandler<OnboardingLegacySignals^, OnboardingConnectionResultReceivedEventArgs^>^ ConnectionResultReceived;
00030 };
00031
00032 public ref class OnboardingLegacySignals sealed : [Windows::Foundation::Metadata::Default] IOnboardingLegacySignals
00033 {
00034 public:
00035     // "This signal is emitted when the connection attempt against the personal AP is completed"
00036     // Calling this method will send the ConnectionResult signal to every member of the session.
00037     void ConnectionResult(_In_ Onboarding^ interfaceMemberArg);
00038
00039     // This event fires whenever the ConnectionResult signal is sent by another member of the session.
00040     virtual event Windows::Foundation::TypedEventHandler<OnboardingLegacySignals^, OnboardingConnectionResultReceivedEventArgs^>^ ConnectionResultReceived
00041     {
00042         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingLegacySignals^, OnboardingConnectionResultReceivedEventArgs^>^ handler)
00043         {
00044             return _ConnectionResultReceived += ref new Windows::Foundation::EventHandler<Platform::Object^>
00045             ([handler](Platform::Object^ sender, Platform::Object^ args)
00046             {
00047                 handler->Invoke(safe_cast<OnboardingLegacySignals^>(sender), safe_cast<OnboardingConnectionResultReceivedEventArgs^>(args));
00048             }, Platform::CallbackContext::Same);
00049         }
00050         void remove(Windows::Foundation::EventRegistrationToken token)
00051         {
00052             _ConnectionResultReceived -= token;
00053         }
00054     internal:
00055         void raise(OnboardingLegacySignals^ sender, OnboardingConnectionResultReceivedEventArgs^ args)
00056         {
00057             _ConnectionResultReceived(sender, args);
00058         }
00059     }
00060
00061 internal:
00062     void Initialize(_In_ alljoyn_busobject busObject, _In_ alljoyn_sessionid sessionId);
00063     void CallConnectionResultReceived(_In_ OnboardingLegacySignals^ sender, _In_ OnboardingConnectionResultReceivedEventArgs^ args);
00064
00065 private:
00066     alljoyn_busobject m_busObject;
00067     alljoyn_sessionid m_sessionId;
00068
00069     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _ConnectionResultReceived;
00070
00071     alljoyn_interfacedescription_member m_memberConnectionResult;
00072 };
00073
00074 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SendTextMessage Member List

This is the complete list of members for SendTextMessage, including all inherited members.
device | SendTextMessage | [private]
OnNavigatedTo(NavigationEventArgs e) | SendTextMessage | [inline, protected]
rootPage | SendTextMessage | [private]
Send_Click(object sender, RoutedEventArgs e) | SendTextMessage | [inline, private]
SendTextMessage() | SendTextMessage | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/pch.h Source File

  • Pedometer
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.xaml.h"
00018
00019 // Common class ID for pedometers
00020 const GUID GUID_Pedometer_ClassId = { 0XB19F89AF, 0XE3EB, 0X444B, 0X8D, 0XEA, 0X20, 0X25, 0X75, 0XA7, 0X15, 0X99 };
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario1_Message.xaml.cs Source File

  • CredentialPicker
  • cs

Scenario1_Message.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009 using SDKTemplate;
00010 using System;
00011 using Windows.Security.Credentials.UI;
00012
00013 namespace CredentialPicker
00014 {
00015     public sealed partial class Scenario1_Message : Page
00016     {
00017         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00018         // as NotifyUser()
00019         MainPage rootPage = MainPage.Current;
00020
00021         public Scenario1_Message()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         void SetError(string err)
00027         {
00028             rootPage.NotifyUser(err, NotifyType.ErrorMessage);
00029         }
00030
00031         void SetResult(CredentialPickerResults res)
00032         {
00033             if (res.ErrorCode == 0)
00034             {
00035                 Status.Text = String.Format("OK");
00036             }
00037             else
00038             {
00039                 Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
00040             }
00041             Domain.Text = res.CredentialDomainName;
00042             Username.Text = res.CredentialUserName;
00043             Password.Text = res.CredentialPassword;
00044             CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
00045             switch (res.CredentialSaveOption)
00046             {
00047                 case CredentialSaveOption.Hidden:
00048                     CheckboxState.Text = "Hidden";
00049                     break;
00050                 case CredentialSaveOption.Selected:
00051                     CheckboxState.Text = "Selected";
00052                     break;
00053                 case CredentialSaveOption.Unselected:
00054                     CheckboxState.Text = "Unselected";
00055                     break;
00056             }
00057         }
00058
00059
00060         #region Sample Click Handlers - modify if you need them, delete them otherwise
00061         private async void Launch_Click(object sender, RoutedEventArgs e)
00062         {
00063             if ((Target.Text.Length != 0) && (Message.Text.Length != 0))
00064             {
00065                 try
00066                 {
00067                     CredentialPickerResults credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(Target.Text, Message.Text);
00068                     SetResult(credPickerResults);
00069                 }
00070                 catch(Exception ex)
00071                 {
00072                     SetError(ex.GetType().ToString() + ": " + ex.Message);
00073                 }
00074             }
00075
00076         }
00077         #endregion
00078     }
00079 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Analyze Member List

This is the complete list of members for Scenario1_Analyze, including all inherited members.
AnalyzeButton_Click(object sender, RoutedEventArgs e) | Scenario1_Analyze | [inline, private]
Scenario1_Analyze() | Scenario1_Analyze | [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/BreadServer.h Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

BreadServer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008
00009 namespace Microsoft { namespace SDKSamples { namespace Kitchen {
00010
00011     // Explicitly declare IIDs to make it easier to author the proxy stub interface registration
00012     [uuid(699B1394-3CEB-4A14-AE23-EFEC518B088B)]
00013     public interface class IBread
00014     {
00015         property Platform::String^ Flavor
00016         {
00017             Platform::String^ get();
00018         }
00019     };
00020
00021     public ref class Bread sealed : public [Windows::Foundation::Metadata::Default] IBread
00022     {
00023     internal:
00024         Bread(Platform::String^ flavor);
00025
00026     public:
00027         virtual property Platform::String^ Flavor
00028         {
00029             // Read only property
00030             virtual Platform::String^ get();
00031         }
00032
00033     private:
00034         Platform::String^ _flavor;
00035     };
00036
00037 } /* Kitchen */ } /* SDKSamples */ } /* Microsoft */
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Render Member List

This is the complete list of members for Scenario1_Render, including all inherited members.
LoadDocument(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Render
Scenario1_Render() | Scenario1_Render
ViewPage(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Render
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/pch.cpp Source File

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/SampleConfiguration.h Source File

  • WiFiScan
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "WiFiScan";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario2_MultiFile.cpp Source File

  • FilePicker
  • cppwinrt

Scenario2_MultiFile.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_MultiFile.h"
00014 #include <sstream>
00015 #include "Scenario2_MultiFile.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::Pickers;
00022 using namespace Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario2_MultiFile::Scenario2_MultiFile()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     fire_and_forget Scenario2_MultiFile::PickFilesButton_Click(IInspectable const&, RoutedEventArgs const&)
00032     {
00033         auto lifetime = get_strong();
00034
00035         // Clear any previously returned files between iterations of this scenario
00036         OutputTextBlock().Text(L"");
00037
00038         FileOpenPicker openPicker;
00039         openPicker.ViewMode(PickerViewMode::List);
00040         openPicker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
00041         openPicker.FileTypeFilter().Append(L"*");
00042         IVectorView<StorageFile> files = co_await openPicker.PickMultipleFilesAsync();
00043         if (files.Size() > 0)
00044         {
00045             std::wstringstream output;
00046             output << L"Picked files:" << std::endl;
00047             // The StorageFile have read/write access to the picked files.
00048             // See the FileAccess sample for code that uses a StorageFile to read and write.
00049             for (StorageFile const& file : files)
00050             {
00051                 output << std::wstring_view{ file.Name() } << std::endl;
00052             }
00053             OutputTextBlock().Text(output.str());
00054         }
00055         else
00056         {
00057             OutputTextBlock().Text(L"Operation cancelled.");
00058         }
00059     }
00060 }
Generated on Fri Nov 15 2024 22:19:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/pch.cpp Source File

  • Accelerometer
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Common/DirectXHelper.h Source File

  • BasicHologram
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include <ppltasks.h>    // For create_task
00004
00005 namespace DX
00006 {
00007     inline void ThrowIfFailed(HRESULT hr)
00008     {
00009         if (FAILED(hr))
00010         {
00011             // Set a breakpoint on this line to catch Win32 API errors.
00012             throw Platform::Exception::CreateException(hr);
00013         }
00014     }
00015
00016     // Function that reads from a binary file asynchronously.
00017     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00018     {
00019         using namespace Windows::Storage;
00020         using namespace Concurrency;
00021
00022         return create_task(PathIO::ReadBufferAsync(Platform::StringReference(filename.c_str()))).then(
00023             [] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00024             {
00025                 std::vector<byte> returnBuffer;
00026                 returnBuffer.resize(fileBuffer->Length);
00027                 Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), static_cast<unsigned int>(returnBuffer.size())));
00028                 return returnBuffer;
00029             });
00030     }
00031
00032     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00033     inline float ConvertDipsToPixels(float dips, float dpi)
00034     {
00035         constexpr float dipsPerInch = 96.0f;
00036         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00037     }
00038
00039 #if defined(_DEBUG)
00040     // Check for SDK Layer support.
00041     inline bool SdkLayersAvailable()
00042     {
00043         HRESULT hr = D3D11CreateDevice(
00044             nullptr,
00045             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00046             0,
00047             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00048             nullptr,                    // Any feature level will do.
00049             0,
00050             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00051             nullptr,                    // No need to keep the D3D device reference.
00052             nullptr,                    // No need to know the feature level.
00053             nullptr                     // No need to keep the D3D device context reference.
00054             );
00055
00056         return SUCCEEDED(hr);
00057     }
00058 #endif
00059 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/SampleConfiguration.cs Source File

  • MagneticStripeReader
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.Enumeration;
00016 using Windows.Devices.PointOfService;
00017 using Windows.UI.Xaml.Controls;
00018 using MagneticStripeReaderSample;
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "Magnetic Stripe Reader";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title = "BankCardDataReceived Event", ClassType = typeof(Scenario1_BankCards) },
00028             new Scenario() { Title = "AamvaCardDataReceived Event", ClassType = typeof(Scenario2_AamvaCards) }
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037
00038     public partial class DeviceHelpers
00039     {
00040         // By default, use all connections types.
00041         public static async Task<MagneticStripeReader> GetFirstMagneticStripeReaderAsync(PosConnectionTypes connectionTypes = PosConnectionTypes.All)
00042         {
00043             return await DeviceHelpers.GetFirstDeviceAsync(MagneticStripeReader.GetDeviceSelector(connectionTypes), async (id) => await MagneticStripeReader.FromIdAsync(id));
00044         }
00045     }
00046 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/pch.cpp Source File

  • HolographicSpatialMapping
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // pch.cpp
00014 // Include the standard header and generate the precompiled header.
00015 //
00016
00017 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PhotoAdjustmentRenderer Member List

This is the complete list of members for PhotoAdjustmentRenderer, including all inherited members.
ConvertDipProperty(float valueInDips) | PhotoAdjustmentRenderer | [private]
CreateDeviceDependentResources() | PhotoAdjustmentRenderer |
CreateDeviceIndependentResources() | PhotoAdjustmentRenderer |
CreateWindowSizeDependentResources() | PhotoAdjustmentRenderer |
Draw() | PhotoAdjustmentRenderer |
m_colorManagement | PhotoAdjustmentRenderer | [private]
m_contrast | PhotoAdjustmentRenderer | [private]
m_deviceResources | PhotoAdjustmentRenderer | [private]
m_formatConvert | PhotoAdjustmentRenderer | [private]
m_gestureRecognizer | PhotoAdjustmentRenderer | [private]
m_highlightsShadows | PhotoAdjustmentRenderer | [private]
m_hsMaskRadiusDips | PhotoAdjustmentRenderer | [private]
m_imageSize | PhotoAdjustmentRenderer | [private]
m_imageSource | PhotoAdjustmentRenderer | [private]
m_isWindowClosed | PhotoAdjustmentRenderer | [private]
m_maxZoom | PhotoAdjustmentRenderer | [private]
m_outputEffect | PhotoAdjustmentRenderer | [private]
m_panelSize | PhotoAdjustmentRenderer | [private]
m_saturation | PhotoAdjustmentRenderer | [private]
m_scaledImage | PhotoAdjustmentRenderer | [private]
m_straighten | PhotoAdjustmentRenderer | [private]
m_temperatureTint | PhotoAdjustmentRenderer | [private]
m_wicColorContext | PhotoAdjustmentRenderer | [private]
m_zoom | PhotoAdjustmentRenderer | [private]
OnColorProfileChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender) | PhotoAdjustmentRenderer |
OnDeviceLost() | PhotoAdjustmentRenderer | [virtual]
OnDeviceRestored() | PhotoAdjustmentRenderer | [virtual]
PhotoAdjustmentRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | PhotoAdjustmentRenderer |
ReleaseDeviceDependentResources() | PhotoAdjustmentRenderer |
UpdateDisplayColorContext(_In_ Windows::Storage::Streams::DataReader^colorProfileDataReader) | PhotoAdjustmentRenderer | [private]
UpdatePhotoAdjustmentValues(PhotoAdjustmentProperties properties) | PhotoAdjustmentRenderer |
UpdateZoomState() | PhotoAdjustmentRenderer | [private]
~PhotoAdjustmentRenderer() | PhotoAdjustmentRenderer |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UnhandledExceptionPage Member List

This is the complete list of members for UnhandledExceptionPage, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | UnhandledExceptionPage | [inline, protected]
ShowUnhandledException(Exception ex) | UnhandledExceptionPage | [inline, static]
StatusMessage | UnhandledExceptionPage |
UnhandledExceptionPage() | UnhandledExceptionPage | [inline]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Item.h Source File

  • XamlListView
  • cppwinrt

Item.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Item.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct Item : ItemT<Item>
00018     {
00019         Item(int index) : id(to_hstring(index)), imageSource(GenerateImageSource(index)) {}
00020
00021         auto Id() { return id; }
00022         auto ImageSource() { return imageSource; }
00023
00024         static Windows::Foundation::Collections::IObservableVector<SDKTemplate::Item> GetItems(int count);
00025
00026     private:
00027         hstring id;
00028         Windows::UI::Xaml::Media::ImageSource imageSource{ nullptr };
00029
00030         static Windows::UI::Xaml::Media::ImageSource GenerateImageSource(int index);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CNetworkChannel Member List

This is the complete list of members for CNetworkChannel, including all inherited members.
__pad0__ | CNetworkChannel |
_critSec | CNetworkChannel | [protected]
_isClosed | CNetworkChannel | [private]
_socket | CNetworkChannel | [private]
CheckClosed() | CNetworkChannel | [inline, protected]
Close() override | CNetworkChannel | [virtual]
Disconnect() override | CNetworkChannel | [virtual]
GetSocket() | CNetworkChannel | [inline, protected]
OnClose() | CNetworkChannel | [inline, protected, virtual]
ReceiveAsync(_In_ IMediaBufferWrapper *pBuffer) override | CNetworkChannel | [virtual]
SendAsync(_In_ IBufferPacket *pPacket) override | CNetworkChannel | [virtual]
SetSocket(IStreamSocket^socket) | CNetworkChannel | [inline, protected]
~CNetworkChannel() | CNetworkChannel | [virtual]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario3_AspectRatio.xaml.cpp Source File

  • CameraResolution
  • cpp

Scenario3_AspectRatio.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_AspectRatio.xaml.h"
00014 #include "StreamResolutionHelper.h"
00015 #include <sstream>
00016 #include <math.h>
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace SDKTemplate;
00021 using namespace Windows::Devices;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Media::Capture;
00026 using namespace Windows::Media::MediaProperties;
00027 using namespace Windows::Storage;
00028 using namespace Windows::UI::Core;
00029 using namespace Windows::UI::Xaml;
00030 using namespace Windows::UI::Xaml::Controls;
00031 using namespace Windows::UI::Xaml::Controls::Primitives;
00032 using namespace Windows::UI::Xaml::Data;
00033 using namespace Windows::UI::Xaml::Input;
00034 using namespace Windows::UI::Xaml::Media;
00035 using namespace Windows::UI::Xaml::Navigation;
00036
00037 /// <summary>
00038 /// Initializes a new instance of the <see cref="Scenario3_AspectRatio"/> class.
00039 /// </summary>
00040 Scenario3_AspectRatio::Scenario3_AspectRatio()
00041     : _rootPage(MainPage::Current)
00042     , _mediaCapture(nullptr)
00043     , _isPreviewing(false)
00044     , _isRecording(false)
00045     , _captureFolder(nullptr)
00046 {
00047     InitializeComponent();
00048 }
00049
00050 Scenario3_AspectRatio::~Scenario3_AspectRatio()
00051 {
00052     CleanupCameraAsync();
00053 }
00054
00055 void Scenario3_AspectRatio::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^)
00056 {
00057     CleanupCameraAsync();
00058 }
00059
00060 /// <summary>
00061 /// Initializes the camera
00062 /// </summary>
00063 task<void> Scenario3_AspectRatio::InitializeCameraAsync()
00064 {
00065     _mediaCapture = ref new MediaCapture();
00066     _mediaCaptureFailedEventToken =
00067         _mediaCapture->Failed += ref new MediaCaptureFailedEventHandler(this, &Scenario3_AspectRatio::MediaCapture_Failed);
00068
00069     return create_task(_mediaCapture->InitializeAsync())
00070         .then([this]()
00071     {
00072         PreviewControl->Source = _mediaCapture.Get();
00073         return create_task(_mediaCapture->StartPreviewAsync());
00074     }).then([this]()
00075     {
00076         return create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Pictures));
00077     }).then([this](StorageLibrary^ picturesLibrary)
00078     {
00079         _captureFolder = picturesLibrary->SaveFolder;
00080         if (_captureFolder == nullptr)
00081         {
00082             // In this case fall back to the local app storage since the Pictures Library is not available
00083             _captureFolder = ApplicationData::Current->LocalFolder;
00084         }
00085     }).then([this](task<void> previousTask)
00086     {
00087         try
00088         {
00089             _isPreviewing = true;
00090             previousTask.get();
00091             return previousTask;
00092         }
00093         catch (AccessDeniedException^)
00094         {
00095             _rootPage->Current->NotifyUser("The app was denied access to the camera", NotifyType::ErrorMessage);
00096             return CleanupCameraAsync();
00097         }
00098     });
00099 }
00100
00101 /// <summary>
00102 /// Cleans up the camera and state variables
00103 /// </summary>
00104 task<void> Scenario3_AspectRatio::CleanupCameraAsync()
00105 {
00106     std::list<task<void>> taskList;
00107     if (_isRecording)
00108     {
00109         auto stopRecordTask = create_task(_mediaCapture->StopRecordAsync());
00110         taskList.push_back(stopRecordTask);
00111         _isRecording = false;
00112     }
00113     if (_isPreviewing)
00114     {
00115         auto stopPreviewTask = create_task(_mediaCapture->StopPreviewAsync());
00116         taskList.push_back(stopPreviewTask);
00117         _isPreviewing = false;
00118     }
00119
00120     return when_all(taskList.begin(), taskList.end()).then([this]()
00121     {
00122         if (_mediaCapture != nullptr)
00123         {
00124             _mediaCapture->Failed -= _mediaCaptureFailedEventToken;
00125             _mediaCapture = nullptr;
00126         }
00127     });
00128 }
00129
00130 /// <summary>
00131 /// Initializes the camera and populates the UI
00132 /// </summary>
00133 /// <param name="sender"></param>
00134 void Scenario3_AspectRatio::InitializeCameraButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^)
00135 {
00136     Button^ button = static_cast<Button^>(sender);
00137     button->IsEnabled = false;
00138
00139     create_task(InitializeCameraAsync())
00140         .then([this, button]()
00141     {
00142         if (_isPreviewing)
00143         {
00144             button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00145             PreviewControl->Visibility = Windows::UI::Xaml::Visibility::Visible;
00146             CheckIfStreamsAreIdentical();
00147             PopulateComboBoxes();
00148             VideoButton->IsEnabled = true;
00149         }
00150     });
00151 }
00152
00153 /// <summary>
00154 /// Records an MP4 video to a StorageFile
00155 /// </summary>
00156 void Scenario3_AspectRatio::VideoButton_Click(Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^)
00157 {
00158     if (_isPreviewing)
00159     {
00160         if (!_isRecording)
00161         {
00162             // Create a storage file and begin recording
00163             create_task(_captureFolder->CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption::GenerateUniqueName))
00164                 .then([this](StorageFile^ file)
00165             {
00166                 return create_task(_mediaCapture->StartRecordToStorageFileAsync(MediaEncodingProfile::CreateMp4(VideoEncodingQuality::Auto), file))
00167                     .then([this, file]()
00168                 {
00169                     // Reflect changes in the UI
00170                     VideoButton->Content = "Stop Video";
00171                     _isRecording = true;
00172
00173                     _rootPage->Current->NotifyUser("Recording file, saving to: " + file->Path, NotifyType::StatusMessage);
00174                 });
00175             }).then([this](task<void> previousTask)
00176             {
00177                 try
00178                 {
00179                     previousTask.get();
00180                 }
00181                 catch (Exception^ ex)
00182                 {
00183                     // File I/O errors are reported as exceptions
00184                     _rootPage->Current->NotifyUser(L"Exception when starting video recording: " + ex->Message, NotifyType::ErrorMessage);
00185                 }
00186             });
00187         }
00188         else
00189         {
00190             // Reflect the changes in the UI and stop recording
00191             VideoButton->Content = "Record Video";
00192             _isRecording = false;
00193
00194             create_task(_mediaCapture->StopRecordAsync())
00195                 .then([this]()
00196             {
00197                 _rootPage->Current->NotifyUser("Stopped recording", NotifyType::StatusMessage);
00198             });
00199         }
00200     }
00201 }
00202
00203 /// <summary>
00204 ///  Event handler for Preview settings combo box. Updates stream resolution based on the selection.
00205 /// </summary>
00206 /// <param name="sender"></param>
00207 void Scenario3_AspectRatio::PreviewSettings_Changed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^)
00208 {
00209     if (_isPreviewing)
00210     {
00211         auto selectedItem = static_cast<ComboBoxItem^>(static_cast<ComboBox^>(sender)->SelectedItem);
00212         auto encodingProperties = static_cast<IMediaEncodingProperties^>(selectedItem->Tag);
00213         create_task(_rootPage->SetMediaStreamPropertiesAsync(_mediaCapture.Get(), PreviewControl, MediaStreamType::VideoPreview, encodingProperties));
00214
00215         // The preview just changed, update the video combo box
00216         MatchPreviewAspectRatio();
00217     }
00218 }
00219
00220 /// <summary>
00221 ///  Event handler for Record settings combo box. Updates stream resolution based on the selection.
00222 /// </summary>
00223 /// <param name="sender"></param>
00224 void Scenario3_AspectRatio::VideoSettings_Changed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^)
00225 {
00226     if (_isPreviewing)
00227     {
00228         auto selectedItem = static_cast<ComboBoxItem^>(static_cast<ComboBox^>(sender)->SelectedItem);
00229         auto encodingProperties = static_cast<IMediaEncodingProperties^>(selectedItem->Tag);
00230         create_task(_rootPage->SetMediaStreamPropertiesAsync(_mediaCapture.Get(), PreviewControl, MediaStreamType::VideoRecord, encodingProperties));
00231     }
00232 }
00233
00234 /// <summary>
00235 /// Populates the combo boxes with preview settings and matching ratio settings for the video stream
00236 /// </summary>
00237 void Scenario3_AspectRatio::PopulateComboBoxes()
00238 {
00239     // Query all properties of the device
00240     auto allProperties = _mediaCapture->VideoDeviceController->GetAvailableMediaStreamProperties(MediaStreamType::VideoPreview);
00241
00242     // Populate the preview combo box with the entries
00243     for (auto encodingProperties : allProperties)
00244     {
00245         ComboBoxItem^ comboBoxItem = ref new ComboBoxItem();
00246         auto streamHelper = ref new StreamResolutionHelper(encodingProperties);
00247         comboBoxItem->Content = streamHelper->GetFriendlyName();
00248         comboBoxItem->Tag = encodingProperties;
00249         PreviewSettings->Items->Append(comboBoxItem);
00250     }
00251
00252     MatchPreviewAspectRatio();
00253 }
00254
00255 /// <summary>
00256 /// Finds all the available video resolutions that match the aspect ratio of the preview stream
00257 /// Note: This should also be done with photos as well. This same method can be modified for photos
00258 /// by changing the MediaStreamType from VideoPreview to Photo.
00259 /// </summary>
00260 void Scenario3_AspectRatio::MatchPreviewAspectRatio()
00261 {
00262     // Clear out old entries
00263     VideoSettings->Items->Clear();
00264
00265     // Query all video properties of the device
00266     auto allProperties = _mediaCapture->VideoDeviceController->GetAvailableMediaStreamProperties(MediaStreamType::VideoRecord);
00267
00268     // Query the current preview settings
00269     auto previewProperties = ref new StreamResolutionHelper(_mediaCapture->VideoDeviceController->GetMediaStreamProperties(MediaStreamType::VideoPreview));
00270
00271     // Get all formats that have the same-ish aspect ratio as the preview and create new entries in the UI
00272     // Allow for some tolerance in the aspect ratio comparison
00273     const double ASPECT_RATIO_TOLERANCE = 0.015;
00274     for (auto properties : allProperties)
00275     {
00276         auto streamHelper = ref new StreamResolutionHelper(properties);
00277         if (abs(streamHelper->AspectRatio() - previewProperties->AspectRatio()) < ASPECT_RATIO_TOLERANCE)
00278         {
00279             ComboBoxItem^ comboBoxItem = ref new ComboBoxItem();
00280             comboBoxItem->Content = streamHelper->GetFriendlyName();
00281             comboBoxItem->Tag = properties;
00282             VideoSettings->Items->Append(comboBoxItem);
00283         }
00284     }
00285 }
00286
00287 /// <summary>
00288 /// On some devices there may not be seperate streams for preview/photo/video. In this case, changing any of them
00289 /// will change all of them since they are the same stream
00290 /// </summary>
00291 void Scenario3_AspectRatio::CheckIfStreamsAreIdentical()
00292 {
00293     if (_mediaCapture->MediaCaptureSettings->VideoDeviceCharacteristic == VideoDeviceCharacteristic::AllStreamsIdentical ||
00294         _mediaCapture->MediaCaptureSettings->VideoDeviceCharacteristic == VideoDeviceCharacteristic::PreviewRecordStreamsIdentical)
00295     {
00296         _rootPage->Current->NotifyUser(L"Warning: Preview and record streams for this device are identical, changing one will affect the other", NotifyType::ErrorMessage);
00297     }
00298 }
00299
00300 void Scenario3_AspectRatio::MediaCapture_Failed(MediaCapture^, MediaCaptureFailedEventArgs^ e)
00301 {
00302     String^ message = e->Message;
00303     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message]()
00304     {
00305         _rootPage->Current->NotifyUser("Preview stopped: " + message, NotifyType::ErrorMessage);
00306         _isPreviewing = false;
00307         CleanupCameraAsync();
00308     }));
00309 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/Scenario1_ReadData.cpp Source File

  • IoT-SPI
  • cppwinrt

Scenario1_ReadData.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_ReadData.h"
00014 #include "Scenario1_ReadData.g.cpp"
00015
00016 using namespace std::literals::chrono_literals;
00017 using namespace winrt;
00018 using namespace winrt::Windows::Devices::Enumeration;
00019 using namespace winrt::Windows::Devices::Spi;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::Foundation::Collections;
00022 using namespace winrt::Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario1_ReadData::Scenario1_ReadData()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario1_ReadData::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&)
00032     {
00033         StopScenario();
00034     }
00035
00036     IAsyncAction Scenario1_ReadData::StartScenarioAsync()
00037     {
00038         auto lifetime = get_strong();
00039
00040         hstring spiDeviceSelector = SpiDevice::GetDeviceSelector();
00041         IVectorView<DeviceInformation> devices = co_await DeviceInformation::FindAllAsync(spiDeviceSelector);
00042
00043         // 0 = Chip select line to use.
00044         SpiConnectionSettings ADXL345_Settings(0);
00045
00046         // 5MHz is the rated speed of the ADXL345 accelerometer.
00047         ADXL345_Settings.ClockFrequency(5000000);
00048
00049         // The accelerometer expects an idle-high clock polarity.
00050         // We use Mode3 to set the clock polarity and phase to: CPOL = 1, CPHA = 1.
00051         ADXL345_Settings.Mode(SpiMode::Mode3);
00052
00053         // If this next line crashes with an ArgumentOutOfRangeException,
00054         // then the problem is that no SPI devices were found.
00055         //
00056         // If the next line crashes with Access Denied, then the problem is
00057         // that access to the SPI device (ADXL345) is denied.
00058         //
00059         // The call to FromIdAsync will also crash if the settings are invalid.
00060         //
00061         // FromIdAsync produces null if there is a sharing violation on the device.
00062         // This will result in a NullReferenceException a few lines later.
00063         adxl345Sensor = co_await SpiDevice::FromIdAsync(devices.GetAt(0).Id(), ADXL345_Settings);
00064
00065         //
00066         // Initialize the accelerometer:
00067         //
00068         // For this device, we create 2-byte write buffers:
00069         // The first byte is the register address we want to write to.
00070         // The second byte is the contents that we want to write to the register.
00071         //
00072
00073         // 0x31 is address of data format register, 0x01 sets range to +- 4Gs.
00074         static constexpr uint8_t WriteBuf_DataFormat[] = { 0x31, 0x01 };
00075
00076         // 0x2D is address of power control register, 0x08 puts the accelerometer into measurement mode.
00077         static constexpr uint8_t WriteBuf_PowerControl[] = { 0x2D, 0x08 };
00078
00079         // Write the register settings.
00080         //
00081         // If this next line crashes with a NullReferenceException, then
00082         // there was a sharing violation on the device.
00083         // (See comment earlier in this function.)
00084         //
00085         // If this next line crashes for some other reason, then there was
00086         // an error communicating with the device.
00087
00088         adxl345Sensor.Write(WriteBuf_DataFormat);
00089         adxl345Sensor.Write(WriteBuf_PowerControl);
00090
00091         // Start the polling timer.
00092         timer = DispatcherTimer();
00093         timer.Interval(100ms);
00094         timerEventToken = timer.Tick({ get_weak(), &Scenario1_ReadData::Timer_Tick });
00095         timer.Start();
00096     }
00097
00098     void Scenario1_ReadData::StopScenario()
00099     {
00100         if (timer != nullptr)
00101         {
00102             timer.Tick(timerEventToken);
00103             timer.Stop();
00104             timer = nullptr;
00105         }
00106
00107         // Release the SPI sensor.
00108         if (adxl345Sensor != nullptr)
00109         {
00110             adxl345Sensor.Close();
00111             adxl345Sensor = nullptr;
00112         }
00113     }
00114
00115     fire_and_forget Scenario1_ReadData::StartStopScenario_Click(IInspectable const&, RoutedEventArgs const&)
00116     {
00117         auto lifetime = get_strong();
00118
00119         if (timer != nullptr)
00120         {
00121             StopScenario();
00122             StartStopButton().Content(box_value(L"Start"));
00123             ScenarioControls().Visibility(Visibility::Collapsed);
00124         }
00125         else
00126         {
00127             StartStopButton().IsEnabled(false);
00128             co_await StartScenarioAsync();
00129             StartStopButton().IsEnabled(true);
00130             StartStopButton().Content(box_value(L"Stop"));
00131             ScenarioControls().Visibility(Visibility::Visible);
00132         }
00133     }
00134
00135     void Scenario1_ReadData::Timer_Tick(IInspectable const&, IInspectable const&)
00136     {
00137         static constexpr uint8_t ACCEL_SPI_RW_BIT = 0x80;   // Bit used in SPI transactions to indicate read/write
00138         static constexpr uint8_t ACCEL_SPI_MB_BIT = 0x40;   // Bit used to indicate multi-byte SPI transactions
00139         static constexpr uint8_t ACCEL_REG_X = 0x32;        // Address of the X Axis data register
00140         static constexpr int32_t ACCEL_RES = 1024;          // The ADXL345 has 10 bit resolution giving 1024 unique values
00141         static constexpr int32_t ACCEL_DYN_RANGE_G = 8;     // The ADXL345 had a total dynamic range of 8G, since we're configuring it to +-4G
00142         static constexpr int32_t UNITS_PER_G = ACCEL_RES / ACCEL_DYN_RANGE_G;  // Ratio of raw int values to G units
00143
00144         uint8_t ReadBuf[6 + 1];                             // Read buffer of size 6 bytes (2 bytes * 3 axes) + 1 byte padding
00145         uint8_t RegAddrBuf[1 + 6] = {};                     // Register address buffer of size 1 byte + 6 bytes padding
00146
00147         // Register address we want to read from with read and multi-byte bit set
00148         RegAddrBuf[0] = ACCEL_REG_X | ACCEL_SPI_RW_BIT | ACCEL_SPI_MB_BIT;
00149
00150         // If this next line crashes, then there was an error communicating with the device.
00151         adxl345Sensor.TransferFullDuplex(RegAddrBuf, ReadBuf);
00152
00153         // In order to get the raw 16-bit data values, we need to concatenate two 8-bit bytes for each axis
00154         short AccelerationRawX = static_cast<short>((ReadBuf[2] << 8) | ReadBuf[1]);
00155         short AccelerationRawY = static_cast<short>((ReadBuf[4] << 8) | ReadBuf[3]);
00156         short AccelerationRawZ = static_cast<short>((ReadBuf[6] << 8) | ReadBuf[5]);
00157
00158         // Convert raw values to G's and display them.
00159         X().Text(to_hstring((double)AccelerationRawX / UNITS_PER_G));
00160         Y().Text(to_hstring((double)AccelerationRawY / UNITS_PER_G));
00161         Z().Text(to_hstring((double)AccelerationRawZ / UNITS_PER_G));
00162     }
00163 }
00164
Generated on Fri Nov 15 2024 22:20:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StepsHelperControl Member List

This is the complete list of members for StepsHelperControl, including all inherited members.
ArrangeOverride(Size finalSize) | StepsHelperControl | [inline, protected]
MeasureOverride(Size availableSize) | StepsHelperControl | [inline, protected]
OnStepChanged(object sender, DependencyPropertyChangedEventArgs args) | StepsHelperControl | [inline, private, static]
OnStepChanged(DependencyPropertyChangedEventArgs args) | StepsHelperControl | [inline, private]
Step | StepsHelperControl |
StepProperty | StepsHelperControl | [static]
UpdateVisibilities() | StepsHelperControl | [inline, private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/SampleConfiguration.cs Source File

  • BackgroundTransfer
  • cs
  • BackgroundTransfer

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "BackgroundTransfer";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="File Download", ClassType=typeof(Scenario1_Download)},
00025             new Scenario() { Title="File Upload", ClassType=typeof(Scenario2_Upload)},
00026             new Scenario() { Title="Completion Notifications", ClassType=typeof(Scenario3_Notifications)},
00027             new Scenario() { Title="Completion Groups", ClassType=typeof(Scenario4_CompletionGroups)},
00028             new Scenario() { Title="Random Access Downloads", ClassType=typeof(Scenario5_RandomAccess)},
00029             new Scenario() { Title="Recoverable Errors", ClassType=typeof(Scenario6_RecoverableErrors)},
00030             new Scenario() { Title="Download Reordering", ClassType=typeof(Scenario7_DownloadReordering)},
00031         };
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Scenario3_ServerForeground.xaml.cs Source File

  • BluetoothLE
  • cs

Scenario3_ServerForeground.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Threading.Tasks;
00014 using Windows.ApplicationModel.Core;
00015 using Windows.Devices.Bluetooth;
00016 using Windows.Devices.Bluetooth.GenericAttributeProfile;
00017 using Windows.Foundation;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Core;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace SDKTemplate
00025 {
00026     // This scenario declares support for a calculator service.
00027     // Remote clients (including this sample on another machine) can supply:
00028     // - Operands 1 and 2
00029     // - an operator (+,-,*,/)
00030     // and get a result
00031     public sealed partial class Scenario3_ServerForeground : Page
00032     {
00033         private MainPage rootPage = MainPage.Current;
00034
00035         GattServiceProvider serviceProvider;
00036
00037         private GattLocalCharacteristic op1Characteristic;
00038         private int operand1Received = 0;
00039
00040         private GattLocalCharacteristic op2Characteristic;
00041         private int operand2Received = 0;
00042
00043         private GattLocalCharacteristic operatorCharacteristic;
00044         CalculatorOperators operatorReceived = 0;
00045
00046         private GattLocalCharacteristic resultCharacteristic;
00047         private int resultVal = 0;
00048
00049         private bool peripheralSupported;
00050
00051         private enum CalculatorCharacteristics
00052         {
00053             Operand1 = 1,
00054             Operand2 = 2,
00055             Operator = 3
00056         }
00057
00058         private enum CalculatorOperators
00059         {
00060             Add = 1,
00061             Subtract = 2,
00062             Multiply = 3,
00063             Divide = 4
00064         }
00065
00066         #region UI Code
00067         public Scenario3_ServerForeground()
00068         {
00069             InitializeComponent();
00070         }
00071
00072         protected override async void OnNavigatedTo(NavigationEventArgs e)
00073         {
00074             peripheralSupported = await CheckPeripheralRoleSupportAsync();
00075             if (peripheralSupported)
00076             {
00077                 ServerPanel.Visibility = Visibility.Visible;
00078             }
00079             else
00080             {
00081                 PeripheralWarning.Visibility = Visibility.Visible;
00082             }
00083         }
00084
00085         protected override void OnNavigatedFrom(NavigationEventArgs e)
00086         {
00087             if (serviceProvider != null)
00088             {
00089                 if (serviceProvider.AdvertisementStatus != GattServiceProviderAdvertisementStatus.Stopped)
00090                 {
00091                     serviceProvider.StopAdvertising();
00092                 }
00093                 serviceProvider = null;
00094             }
00095         }
00096
00097         private async void PublishButton_ClickAsync()
00098         {
00099             // Server not initialized yet - initialize it and start publishing
00100             if (serviceProvider == null)
00101             {
00102                 var serviceStarted = await ServiceProviderInitAsync();
00103                 if (serviceStarted)
00104                 {
00105                     rootPage.NotifyUser("Service successfully started", NotifyType.StatusMessage);
00106                     PublishButton.Content = "Stop Service";
00107                 }
00108                 else
00109                 {
00110                     rootPage.NotifyUser("Service not started", NotifyType.ErrorMessage);
00111                 }
00112             }
00113             else
00114             {
00115                 // BT_Code: Stops advertising support for custom GATT Service
00116                 serviceProvider.StopAdvertising();
00117                 serviceProvider = null;
00118                 PublishButton.Content = "Start Service";
00119             }
00120         }
00121
00122         private async void UpdateUX()
00123         {
00124             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00125             {
00126                 switch (operatorReceived)
00127                 {
00128                     case CalculatorOperators.Add:
00129                         OperationText.Text = "+";
00130                         break;
00131                     case CalculatorOperators.Subtract:
00132                         OperationText.Text = "-";
00133                         break;
00134                     case CalculatorOperators.Multiply:
00135                         OperationText.Text = "*";
00136                         break;
00137                     case CalculatorOperators.Divide:
00138                         OperationText.Text = "/";
00139                         break;
00140                     default:
00141                         OperationText.Text = "INV";
00142                         break;
00143                 }
00144                 Operand1Text.Text = operand1Received.ToString();
00145                 Operand2Text.Text = operand2Received.ToString();
00146                 resultVal = ComputeResult();
00147                 ResultText.Text = resultVal.ToString();
00148             });
00149         }
00150         #endregion
00151
00152         private async Task<bool> CheckPeripheralRoleSupportAsync()
00153         {
00154             // BT_Code: New for Creator's Update - Bluetooth adapter has properties of the local BT radio.
00155             var localAdapter = await BluetoothAdapter.GetDefaultAsync();
00156
00157             if (localAdapter != null)
00158             {
00159                 return localAdapter.IsPeripheralRoleSupported;
00160             }
00161             else
00162             {
00163                 // Bluetooth is not turned on
00164                 return false;
00165             }
00166         }
00167
00168         /// <summary>
00169         /// Uses the relevant Service/Characteristic UUIDs to initialize, hook up event handlers and start a service on the local system.
00170         /// </summary>
00171         /// <returns></returns>
00172         private async Task<bool> ServiceProviderInitAsync()
00173         {
00174             // BT_Code: Initialize and starting a custom GATT Service using GattServiceProvider.
00175             GattServiceProviderResult serviceResult = await GattServiceProvider.CreateAsync(Constants.CalcServiceUuid);
00176             if (serviceResult.Error == BluetoothError.Success)
00177             {
00178                 serviceProvider = serviceResult.ServiceProvider;
00179             }
00180             else
00181             {
00182                 rootPage.NotifyUser($"Could not create service provider: {serviceResult.Error}", NotifyType.ErrorMessage);
00183                 return false;
00184             }
00185
00186             GattLocalCharacteristicResult result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.Op1CharacteristicUuid, Constants.gattOperandParameters);
00187             if (result.Error == BluetoothError.Success)
00188             {
00189                 op1Characteristic = result.Characteristic;
00190             }
00191             else
00192             {
00193                 rootPage.NotifyUser($"Could not create operand1 characteristic: {result.Error}", NotifyType.ErrorMessage);
00194                 return false;
00195             }
00196             op1Characteristic.WriteRequested += Op1Characteristic_WriteRequestedAsync;
00197
00198             result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.Op2CharacteristicUuid, Constants.gattOperandParameters);
00199             if (result.Error == BluetoothError.Success)
00200             {
00201                 op2Characteristic = result.Characteristic;
00202             }
00203             else
00204             {
00205                 rootPage.NotifyUser($"Could not create operand2 characteristic: {result.Error}", NotifyType.ErrorMessage);
00206                 return false;
00207             }
00208
00209             op2Characteristic.WriteRequested += Op2Characteristic_WriteRequestedAsync;
00210
00211             result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.OperatorCharacteristicUuid, Constants.gattOperatorParameters);
00212             if (result.Error == BluetoothError.Success)
00213             {
00214                 operatorCharacteristic = result.Characteristic;
00215             }
00216             else
00217             {
00218                 rootPage.NotifyUser($"Could not create operator characteristic: {result.Error}", NotifyType.ErrorMessage);
00219                 return false;
00220             }
00221
00222             operatorCharacteristic.WriteRequested += OperatorCharacteristic_WriteRequestedAsync;
00223
00224             // Add presentation format - 32-bit unsigned integer, with exponent 0, the unit is unitless, with no company description
00225             GattPresentationFormat intFormat = GattPresentationFormat.FromParts(
00226                 GattPresentationFormatTypes.UInt32,
00227                 PresentationFormats.Exponent,
00228                 Convert.ToUInt16(PresentationFormats.Units.Unitless),
00229                 Convert.ToByte(PresentationFormats.NamespaceId.BluetoothSigAssignedNumber),
00230                 PresentationFormats.Description);
00231
00232             Constants.gattResultParameters.PresentationFormats.Add(intFormat);
00233
00234             result = await serviceProvider.Service.CreateCharacteristicAsync(Constants.ResultCharacteristicUuid, Constants.gattResultParameters);
00235             if (result.Error == BluetoothError.Success)
00236             {
00237                 resultCharacteristic = result.Characteristic;
00238             }
00239             else
00240             {
00241                 rootPage.NotifyUser($"Could not create result characteristic: {result.Error}", NotifyType.ErrorMessage);
00242                 return false;
00243             }
00244             resultCharacteristic.ReadRequested += ResultCharacteristic_ReadRequestedAsync;
00245             resultCharacteristic.SubscribedClientsChanged += ResultCharacteristic_SubscribedClientsChanged;
00246
00247             // BT_Code: Indicate if your sever advertises as connectable and discoverable.
00248             GattServiceProviderAdvertisingParameters advParameters = new GattServiceProviderAdvertisingParameters
00249             {
00250                 // IsConnectable determines whether a call to publish will attempt to start advertising and
00251                 // put the service UUID in the ADV packet (best effort)
00252                 IsConnectable = peripheralSupported,
00253
00254                 // IsDiscoverable determines whether a remote device can query the local device for support
00255                 // of this service
00256                 IsDiscoverable = true
00257             };
00258             serviceProvider.AdvertisementStatusChanged += ServiceProvider_AdvertisementStatusChanged;
00259             serviceProvider.StartAdvertising(advParameters);
00260             return true;
00261         }
00262
00263         private void ResultCharacteristic_SubscribedClientsChanged(GattLocalCharacteristic sender, object args)
00264         {
00265             rootPage.NotifyUser($"New device subscribed. New subscribed count: {sender.SubscribedClients.Count}", NotifyType.StatusMessage);
00266         }
00267
00268         private void ServiceProvider_AdvertisementStatusChanged(GattServiceProvider sender, GattServiceProviderAdvertisementStatusChangedEventArgs args)
00269         {
00270             // Created - The default state of the advertisement, before the service is published for the first time.
00271             // Stopped - Indicates that the application has canceled the service publication and its advertisement.
00272             // Started - Indicates that the system was successfully able to issue the advertisement request.
00273             // Aborted - Indicates that the system was unable to submit the advertisement request, or it was canceled due to resource contention.
00274
00275             rootPage.NotifyUser($"New Advertisement Status: {sender.AdvertisementStatus}", NotifyType.StatusMessage);
00276         }
00277
00278         private async void ResultCharacteristic_ReadRequestedAsync(GattLocalCharacteristic sender, GattReadRequestedEventArgs args)
00279         {
00280             // BT_Code: Process a read request.
00281             using (args.GetDeferral())
00282             {
00283                 // Get the request information.  This requires device access before an app can access the device's request.
00284                 GattReadRequest request = await args.GetRequestAsync();
00285                 if (request == null)
00286                 {
00287                     // No access allowed to the device.  Application should indicate this to the user.
00288                     rootPage.NotifyUser("Access to device not allowed", NotifyType.ErrorMessage);
00289                     return;
00290                 }
00291
00292                 var writer = new DataWriter();
00293                 writer.ByteOrder = ByteOrder.LittleEndian;
00294                 writer.WriteInt32(resultVal);
00295
00296                 // Can get details about the request such as the size and offset, as well as monitor the state to see if it has been completed/cancelled externally.
00297                 // request.Offset
00298                 // request.Length
00299                 // request.State
00300                 // request.StateChanged += <Handler>
00301
00302                 // Gatt code to handle the response
00303                 request.RespondWithValue(writer.DetachBuffer());
00304             }
00305         }
00306
00307         private int ComputeResult()
00308         {
00309             Int32 computedValue = 0;
00310             switch (operatorReceived)
00311             {
00312                 case CalculatorOperators.Add:
00313                     computedValue = operand1Received + operand2Received;
00314                     break;
00315                 case CalculatorOperators.Subtract:
00316                     computedValue = operand1Received - operand2Received;
00317                     break;
00318                 case CalculatorOperators.Multiply:
00319                     computedValue = operand1Received * operand2Received;
00320                     break;
00321                 case CalculatorOperators.Divide:
00322                     if (operand2Received == 0 || (operand1Received == -0x80000000 && operand2Received == -1))
00323                     {
00324                         rootPage.NotifyUser("Division overflow", NotifyType.ErrorMessage);
00325                     }
00326                     else
00327                     {
00328                         computedValue = operand1Received / operand2Received;
00329                     }
00330                     break;
00331                 default:
00332                     rootPage.NotifyUser("Invalid Operator", NotifyType.ErrorMessage);
00333                     break;
00334             }
00335             NotifyClientDevices(computedValue);
00336             return computedValue;
00337         }
00338
00339         private async void NotifyClientDevices(int computedValue)
00340         {
00341             var writer = new DataWriter();
00342             writer.ByteOrder = ByteOrder.LittleEndian;
00343             writer.WriteInt32(computedValue);
00344
00345             // BT_Code: Returns a collection of all clients that the notification was attempted and the result.
00346             IReadOnlyList<GattClientNotificationResult> results = await resultCharacteristic.NotifyValueAsync(writer.DetachBuffer());
00347
00348             rootPage.NotifyUser($"Sent value {computedValue} to clients.", NotifyType.StatusMessage);
00349             foreach (var result in results)
00350             {
00351                 // An application can iterate through each registered client that was notified and retrieve the results:
00352                 //
00353                 // result.SubscribedClient: The details on the remote client.
00354                 // result.Status: The GattCommunicationStatus
00355                 // result.ProtocolError: iff Status == GattCommunicationStatus.ProtocolError
00356             }
00357         }
00358
00359         private async void Op1Characteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
00360         {
00361             // BT_Code: Processing a write request.
00362             using (args.GetDeferral())
00363             {
00364                 // Get the request information.  This requires device access before an app can access the device's request.
00365                 GattWriteRequest request = await args.GetRequestAsync();
00366                 if (request == null)
00367                 {
00368                     // No access allowed to the device.  Application should indicate this to the user.
00369                     return;
00370                 }
00371                 ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operand1);
00372             }
00373         }
00374
00375         private async void Op2Characteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
00376         {
00377             using (args.GetDeferral())
00378             {
00379                 // Get the request information.  This requires device access before an app can access the device's request.
00380                 GattWriteRequest request = await args.GetRequestAsync();
00381                 if (request == null)
00382                 {
00383                     // No access allowed to the device.  Application should indicate this to the user.
00384                     return;
00385                 }
00386                 ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operand2);
00387             }
00388         }
00389
00390         private async void OperatorCharacteristic_WriteRequestedAsync(GattLocalCharacteristic sender, GattWriteRequestedEventArgs args)
00391         {
00392             using (args.GetDeferral())
00393             {
00394                 // Get the request information.  This requires device access before an app can access the device's request.
00395                 GattWriteRequest request = await args.GetRequestAsync();
00396                 if (request == null)
00397                 {
00398                     // No access allowed to the device.  Application should indicate this to the user.
00399                     return;
00400                 }
00401                 ProcessWriteCharacteristic(request, CalculatorCharacteristics.Operator);
00402             }
00403         }
00404
00405         /// <summary>
00406         /// BT_Code: Processing a write request.Takes in a GATT Write request and updates UX based on opcode.
00407         /// </summary>
00408         /// <param name="request"></param>
00409         /// <param name="opCode">Operand (1 or 2) and Operator (3)</param>
00410         private void ProcessWriteCharacteristic(GattWriteRequest request, CalculatorCharacteristics opCode)
00411         {
00412             if (request.Value.Length != 4)
00413             {
00414                 // Input is the wrong length. Respond with a protocol error if requested.
00415                 if (request.Option == GattWriteOption.WriteWithResponse)
00416                 {
00417                     request.RespondWithProtocolError(GattProtocolError.InvalidAttributeValueLength);
00418                 }
00419                 return;
00420             }
00421
00422             var reader = DataReader.FromBuffer(request.Value);
00423             reader.ByteOrder = ByteOrder.LittleEndian;
00424             int val = reader.ReadInt32();
00425
00426             switch (opCode)
00427             {
00428                 case CalculatorCharacteristics.Operand1:
00429                     operand1Received = val;
00430                     break;
00431                 case CalculatorCharacteristics.Operand2:
00432                     operand2Received = val;
00433                     break;
00434                 case CalculatorCharacteristics.Operator:
00435                     if (!Enum.IsDefined(typeof(CalculatorOperators), val))
00436                     {
00437                         if (request.Option == GattWriteOption.WriteWithResponse)
00438                         {
00439                             request.RespondWithProtocolError(GattProtocolError.InvalidPdu);
00440                         }
00441                         return;
00442                     }
00443                     operatorReceived = (CalculatorOperators)val;
00444                     break;
00445             }
00446             // Complete the request if needed
00447             if (request.Option == GattWriteOption.WriteWithResponse)
00448             {
00449                 request.Respond();
00450             }
00451
00452             UpdateUX();
00453         }
00454     }
00455 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Listen Member List

This is the complete list of members for Scenario2_Listen, including all inherited members.
currentValue | Scenario2_Listen | [private]
LISTEN_PIN | Scenario2_Listen | [private, static]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_Listen |
Pin_ValueChanged(Windows::Devices::Gpio::GpioPin const &sender, Windows::Devices::Gpio::GpioPinValueChangedEventArgs const &e) | Scenario2_Listen | [private]
Scenario2_Listen() | Scenario2_Listen |
SET_PIN | Scenario2_Listen | [private, static]
StartScenario() | Scenario2_Listen | [private]
StartStopScenario_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Listen |
StopScenario() | Scenario2_Listen | [private]
Timer_Tick(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e) | Scenario2_Listen | [private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/pch.h Source File

  • Simple3DGameDX
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <unknwn.h>
00015 #include <winrt/Windows.ApplicationModel.Core.h>
00016 #include <winrt/Windows.Devices.Input.h>
00017 #include <winrt/Windows.Foundation.Collections.h>
00018 #include <winrt/Windows.Gaming.Input.h>
00019 #include <winrt/Windows.Graphics.Display.h>
00020 #include <winrt/Windows.Storage.Streams.h>
00021 #include <winrt/Windows.System.Threading.h>
00022 #include <winrt/Windows.UI.Core.h>
00023 #include <winrt/Windows.UI.Input.h>
00024
00025 #include <d3d11_3.h>
00026 #include <d2d1_3.h>
00027 #include <dwrite_3.h>
00028 #include <wincodec.h>
00029
00030 #include <xaudio2.h>
00031
00032 #include <mfidl.h>
00033 #include <mfapi.h>
00034 #include <mfreadwrite.h>
00035
00036 #include <iterator>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h Source File

  • BackgroundActivation
  • cpp

Scenario6_GroupedTask.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario5_GroupedTask.xaml.h
00013 // Declaration of the GroupedBackgroundTask class
00014 //
00015
00016 #pragma once
00017
00018 #include <ppltasks.h>
00019 #include "pch.h"
00020 #include "Scenario6_GroupedTask.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class GroupedBackgroundTask sealed
00030     {
00031     public:
00032         GroupedBackgroundTask();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036     private:
00037         SDKTemplate::MainPage^ rootPage;
00038         BackgroundTaskRegistrationGroup^ group = nullptr;
00039
00040         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00041         void RegisterGroupedBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void UnregisterGroupedTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043         void UnregisterUngroupedTasks(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00045         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00046         void UpdateUI();
00047     };
00048 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario9_CustomPairDevice.h Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario9_CustomPairDevice.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario9_CustomPairDevice.g.h"
00015 #include "MainPage.h"
00016 #include "DeviceWatcherHelper.h"
00017 #include "SampleConfiguration.h"
00018
00019 namespace winrt::SDKTemplate::implementation
00020 {
00021     struct Scenario9_CustomPairDevice : Scenario9_CustomPairDeviceT<Scenario9_CustomPairDevice>
00022     {
00023         Scenario9_CustomPairDevice();
00024
00025         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00026         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00027
00028         void StartWatcherButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029         void StopWatcherButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00030         fire_and_forget PairButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00031         fire_and_forget UnpairButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00032         void okButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00033         void verifyButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00034         void yesButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00035         void noButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00036         void ResultsListView_SelectionChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& e);
00037
00038     private:
00039         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00040         Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>();
00041         com_ptr<DeviceWatcherHelper> deviceWatcherHelper = make_self<DeviceWatcherHelper>(resultCollection, Dispatcher());
00042         SimpleTaskCompletionSource<hstring> providePinTaskSrc;
00043         SimpleTaskCompletionSource<bool> confirmPinTaskSrc;
00044         SimpleTaskCompletionSource<Windows::Security::Credentials::PasswordCredential> providePasswordCredentialTaskSrc;
00045
00046         void StartWatcher();
00047         void StopWatcher();
00048         void OnDeviceListChanged(Windows::Devices::Enumeration::DeviceWatcher const& sender, hstring const& id);
00049         fire_and_forget PairingRequestedHandler(Windows::Devices::Enumeration::DeviceInformationCustomPairing const& sender, Windows::Devices::Enumeration::DevicePairingRequestedEventArgs e);
00050         void ShowPairingPanel(hstring const& text, Windows::Devices::Enumeration::DevicePairingKinds pairingKind);
00051         void HidePairingPanel();
00052         Windows::Foundation::IAsyncOperation<hstring> GetPinFromUserAsync();
00053         void CompleteProvidePinTask(hstring pin = {});
00054         Windows::Foundation::IAsyncOperation<Windows::Security::Credentials::PasswordCredential> GetPasswordCredentialFromUserAsync();
00055         void CompletePasswordCredential(hstring username = {}, hstring password = {});
00056         Windows::Foundation::IAsyncOperation<bool> GetUserConfirmationAsync(hstring const& pin);
00057         void CompleteConfirmPinTask(bool accept);
00058         Windows::Devices::Enumeration::DevicePairingKinds GetSelectedCeremonies();
00059         void UpdatePairingButtons();
00060     };
00061 }
00062
00063 namespace winrt::SDKTemplate::factory_implementation
00064 {
00065     struct Scenario9_CustomPairDevice : Scenario9_CustomPairDeviceT<Scenario9_CustomPairDevice, implementation::Scenario9_CustomPairDevice>
00066     {
00067     };
00068 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Audio.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Audio.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Audio:
00015 // This class uses XAudio2 to provide sound output. It creates two
00016 // engines - one for music and the other for sound effects - each as
00017 // a separate mastering voice.
00018 // The SuspendAudio and ResumeAudio methods can be used to stop
00019 // and start all audio playback.
00020
00021 class Audio
00022 {
00023 public:
00024     Audio();
00025
00026     void Initialize();
00027     void CreateDeviceIndependentResources();
00028     IXAudio2* MusicEngine();
00029     IXAudio2* SoundEffectEngine();
00030     void SuspendAudio();
00031     void ResumeAudio();
00032
00033 private:
00034     bool                        m_audioAvailable;
00035     winrt::com_ptr<IXAudio2>    m_musicEngine;
00036     winrt::com_ptr<IXAudio2>    m_soundEffectEngine;
00037     IXAudio2MasteringVoice* m_musicMasteringVoice;
00038     IXAudio2MasteringVoice* m_soundEffectMasteringVoice;
00039 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AnimateLinePosition Member List

This is the complete list of members for AnimateLinePosition, including all inherited members.
Animate() | Animate |
AnimateLinePosition(_In_ DirectX::XMFLOAT3 startPosition, _In_ DirectX::XMFLOAT3 endPosition, _In_ float duration, _In_ bool continuous) | AnimateLinePosition |
Continuous() | Animate |
Continuous(_In_ bool continuous) | Animate |
Duration() | Animate |
Duration(_In_ float duration) | Animate |
Evaluate(_In_ float t) override | AnimateLinePosition | [virtual]
IsActive(_In_ float t) | Animate | [inline]
IsFinished(_In_ float t) | Animate | [inline]
m_continuous | Animate | [protected]
m_duration | Animate | [protected]
m_endPosition | AnimateLinePosition | [private]
m_length | AnimateLinePosition | [private]
m_startPosition | AnimateLinePosition | [private]
m_startTime | Animate | [protected]
Start() | Animate |
Start(_In_ float start) | Animate |
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/SampleConfiguration.cpp Source File

  • SmartCard
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008 using namespace Concurrency;
00009 using namespace Windows::Devices::SmartCards;
00010 using namespace Windows::Foundation::Collections;
00011
00012 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00013 {
00014     { "Create and provision a TPM virtual smart card", "SDKTemplate.Scenario1_CreateTPMVSC" },
00015     { "Change smart card PIN", "SDKTemplate.Scenario2_ChangePin" },
00016     { "Reset smart card PIN", "SDKTemplate.Scenario3_ResetPin" },
00017     { "Change smart card admin key", "SDKTemplate.Scenario4_ChangeAdminKey" },
00018     { "Verify response", "SDKTemplate.Scenario5_VerifyResponse" },
00019     { "Delete TPM virtual smart card", "SDKTemplate.Scenario6_DeleteTPMVSC" },
00020     { "List all smart cards", "SDKTemplate.Scenario7_ListSmartCards" },
00021     { "Transmit APDU to smart card", "SDKTemplate.Scenario8_Transmit" }
00022 };
00023
00024 task<Windows::Devices::SmartCards::SmartCard^> MainPage::GetSmartCard()
00025 {
00026     return create_task(SmartCardReader::FromIdAsync(deviceId)).then(
00027         [&](task<SmartCardReader^> getReaderTask)
00028     {
00029         SmartCardReader^ reader = getReaderTask.get();
00030         return reader->FindAllCardsAsync();
00031     }).then(
00032         [&](task<IVectorView<SmartCard^>^>
00033         getCardsTask)
00034     {
00035         IVectorView<SmartCard^>^ cards = getCardsTask.get();
00036         return cards->GetAt(0);
00037     });
00038 }
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColor Member List

This is the complete list of members for VertexPositionColor, including all inherited members.
color | VertexPositionColor
pos | VertexPositionColor
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/SampleConfiguration.cpp Source File

  • NetworkConnectivity
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Networking::Connectivity;
00021 using namespace winrt::Windows::UI::Xaml::Controls;
00022 using namespace winrt::Windows::Web::Http;
00023 using namespace winrt::SDKTemplate;
00024
00025 hstring implementation::MainPage::FEATURE_NAME()
00026 {
00027     return L"NetworkConnectivity C++/WinRT Sample";
00028 }
00029
00030 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00031 {
00032     Scenario{ L"Query network connectivity", xaml_typename<SDKTemplate::Scenario1_NetworkConnectivity>() },
00033     Scenario{ L"Get network cost information", xaml_typename<SDKTemplate::Scenario2_NetworkCost>() },
00034     Scenario{ L"Listen to connectivity changes", xaml_typename<SDKTemplate::Scenario3_NetworkConnectivityChanges>() },
00035 });
00036
00037 hstring winrt::to_hstring(NetworkConnectivityLevel value)
00038 {
00039     switch (value)
00040     {
00041     case NetworkConnectivityLevel::None: return L"None";
00042     case NetworkConnectivityLevel::LocalAccess: return L"LocalAccess";
00043     case NetworkConnectivityLevel::ConstrainedInternetAccess: return L"ConstrainedInternetAccess";
00044     case NetworkConnectivityLevel::InternetAccess: return L"InternetAccess";
00045     }
00046     return to_hstring(static_cast<int32_t>(value));
00047 }
00048
00049 hstring winrt::to_hstring(NetworkCostType type)
00050 {
00051     switch (type)
00052     {
00053     case NetworkCostType::Unknown: return L"Unknown";
00054     case NetworkCostType::Unrestricted: return L"Unrestricted";
00055     case NetworkCostType::Fixed: return L"Fixed";
00056     case NetworkCostType::Variable: return L"Variable";
00057     }
00058     return winrt::to_hstring(static_cast<int32_t>(type));
00059 }
00060
00061 void winrt::SDKTemplate::AppendLine(TextBlock const& textBlock, hstring const& message)
00062 {
00063     textBlock.Text(textBlock.Text() + message + L"\n\n");
00064 }
00065
00066 bool winrt::SDKTemplate::ShouldAttemptToConnectToInternet(NetworkConnectivityLevel level)
00067 {
00068     bool shouldConnectToInternet = false;
00069     if (level == NetworkConnectivityLevel::LocalAccess || level == NetworkConnectivityLevel::InternetAccess)
00070     {
00071         shouldConnectToInternet = true;
00072     }
00073
00074     return shouldConnectToInternet;
00075 }
00076
00077 namespace
00078 {
00079     IAsyncOperation<hstring> SendHttpGetRequestAsync()
00080     {
00081         HttpClient httpClient;
00082         HttpGetStringResult result = co_await httpClient.TryGetStringAsync(Uri(L"http://www.msftconnecttest.com/connecttest.txt"));
00083         if (result.Succeeded())
00084         {
00085             co_return L"Success: \"" + result.Value() + L"\"";
00086         }
00087         else if (HttpResponseMessage responseMessage = result.ResponseMessage(); responseMessage != nullptr)
00088         {
00089             co_return L"HTTP error: " + to_hstring(static_cast<int32_t>(responseMessage.StatusCode()));
00090         }
00091         else
00092         {
00093             co_return L"Error: " + hresult_error(result.ExtendedError(), take_ownership_from_abi).message();
00094         }
00095     }
00096 }
00097
00098
00099 CostGuidance winrt::SDKTemplate::GetNetworkCostGuidance(ConnectionCost cost)
00100 {
00101     CostGuidance costGuidance = CostGuidance::Normal;
00102     if (cost.Roaming() || cost.OverDataLimit())
00103     {
00104         costGuidance = CostGuidance::OptIn;
00105     }
00106     else if (cost.NetworkCostType() == NetworkCostType::Fixed || cost.NetworkCostType() == NetworkCostType::Variable)
00107     {
00108         costGuidance = CostGuidance::Conservative;
00109     }
00110     else
00111     {
00112         costGuidance = CostGuidance::Normal;
00113     }
00114     return costGuidance;
00115 }
00116
00117 void winrt::SDKTemplate::EvaluateAndReportConnectionCost(ConnectionCost cost, TextBlock const& textBlock)
00118 {
00119     CostGuidance costGuidance = GetNetworkCostGuidance(cost);
00120     switch (costGuidance)
00121     {
00122         // In opt-in scenarios, apps handle cases where the network access cost is significantly higher than the plan cost.
00123         // For example, when a user is roaming, a mobile carrier may charge a higher rate data usage.
00124     case CostGuidance::OptIn:
00125         AppendLine(textBlock, L"Apps should implement opt-in behavior.");
00126         break;
00127         // In conservative scenarios, apps implement restrictions for optimizing network usage to handle transfers over metered networks.
00128     case CostGuidance::Conservative:
00129         AppendLine(textBlock, L"Apps should implement conservative behavior.");
00130         break;
00131         // In normal scenarios, apps do not implement restrictions. Apps treat the connection as unlimited in cost.
00132     case CostGuidance::Normal:
00133     default:
00134         AppendLine(textBlock, L"Apps should implement normal behavior.");
00135         break;
00136     }
00137 }
00138
00139 IAsyncAction winrt::SDKTemplate::EvaluateCostAndConnectAsync(ConnectionCost cost, bool optedInToCharges, TextBlock textBlock)
00140 {
00141     CostGuidance costGuidance = GetNetworkCostGuidance(cost);
00142
00143     switch (costGuidance)
00144     {
00145     case CostGuidance::OptIn:
00146     {
00147         AppendLine(textBlock, L"Connecting to the Internet may incur charges.");
00148         if (optedInToCharges)
00149         {
00150             AppendLine(textBlock, L"User has opted in to additional network usage charges.");
00151             AppendLine(textBlock, co_await SendHttpGetRequestAsync());
00152         }
00153         else
00154         {
00155             AppendLine(textBlock, L"User has opted out of additional network usage charges. Not connecting to the Internet.");
00156         }
00157     }
00158     break;
00159     case CostGuidance::Conservative:
00160         AppendLine(textBlock, L"Attempting to connect to the Internet, optimizing traffic for conservative network usage.");
00161         AppendLine(textBlock, co_await SendHttpGetRequestAsync());
00162         break;
00163     case CostGuidance::Normal:
00164     default:
00165         AppendLine(textBlock, L"Attempting to connect to the Internet.");
00166         AppendLine(textBlock, co_await SendHttpGetRequestAsync());
00167         break;
00168     }
00169 }
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/pch.h Source File

  • AppServices
  • cppwinrt
  • AppServicesProvider

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.h"
00007 #include "winrt/Windows.ApplicationModel.Activation.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00014 #include "winrt/Windows.UI.Xaml.Documents.h"
00015 #include "winrt/Windows.UI.Xaml.Interop.h"
00016 #include "winrt/Windows.UI.Xaml.Markup.h"
00017 #include "winrt/Windows.UI.Xaml.Media.h"
00018 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario3.xaml.cpp Source File

  • FolderEnumeration
  • cpp

Scenario3.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3.xaml.cpp
00013 // Implementation of the Scenario3 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario3.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Platform;
00023 using namespace Platform::Collections;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::Storage;
00027 using namespace Windows::Storage::BulkAccess;
00028 using namespace Windows::Storage::FileProperties;
00029 using namespace Windows::Storage::Search;
00030 using namespace Windows::UI;
00031 using namespace Windows::UI::Xaml;
00032 using namespace Windows::UI::Xaml::Controls;
00033 using namespace Windows::UI::Xaml::Navigation;
00034
00035 String^ Scenario3::CopyrightProperty = "System.Copyright";
00036 String^ Scenario3::ColorSpaceProperty = "System.Image.ColorSpace";
00037
00038 Scenario3::Scenario3()
00039 {
00040     InitializeComponent();
00041 }
00042
00043 String^ Scenario3::GetPropertyDisplayValue(Object^ property)
00044 {
00045     String^ value;
00046     if (property == nullptr || property->ToString() == "")
00047     {
00048         value = "none";
00049     }
00050     else
00051     {
00052         value = property->ToString();
00053     }
00054
00055     return value;
00056 }
00057
00058 void Scenario3::GetFilesButton_Click(Object^ sender, RoutedEventArgs^ e)
00059 {
00060     // Reset output.
00061     OutputPanel->Children->Clear();
00062
00063     // Set up file type filter.
00064     auto fileTypeFilter = ref new Vector<String^>();
00065     fileTypeFilter->Append(".jpg");
00066     fileTypeFilter->Append(".png");
00067     fileTypeFilter->Append(".bmp");
00068     fileTypeFilter->Append(".gif");
00069
00070     // Create query options.
00071     auto queryOptions = ref new QueryOptions(CommonFileQuery::OrderByName, fileTypeFilter);
00072
00073     // Set up property prefetch - use the PropertyPrefetchOptions for top-level properties
00074     // and a vector for additional properties.
00075     auto propertyNames = ref new Vector<String^>();
00076     propertyNames->Append(CopyrightProperty);
00077     propertyNames->Append(ColorSpaceProperty);
00078     queryOptions->SetPropertyPrefetch(PropertyPrefetchOptions::ImageProperties, propertyNames);
00079
00080     // Set up thumbnail prefetch if needed, e.g. when creating a picture gallery view.
00081     /*
00082     const UINT requestedSize = 190;
00083     const ThumbnailMode thumbnailMode = ThumbnailMode::PicturesView;
00084     const ThumbnailOptions thumbnailOptions = ThumbnailOptions::UseCurrentScale;
00085     queryOptions->SetThumbnailPrefetch(thumbnailMode, requestedSize, thumbnailOptions);
00086     */
00087
00088     // Set up the query and retrieve files.
00089     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary)).then([this, queryOptions](StorageFolder^ picturesFolder)
00090     {
00091         auto query = picturesFolder->CreateFileQueryWithOptions(queryOptions);
00092         return query->GetFilesAsync();
00093     }).then([=](IVectorView<StorageFile^>^ files)
00094     {
00095         std::for_each(begin(files), end(files), [=](StorageFile^ file)
00096         {
00097             // Create UI elements for the output and fill in the contents when they are available.
00098             OutputPanel->Children->Append(CreateHeaderTextBlock(file->Name));
00099             TextBlock^ imagePropTextBlock = CreateLineItemTextBlock();
00100             OutputPanel->Children->Append(imagePropTextBlock);
00101             TextBlock^ copyrightTextBlock = CreateLineItemTextBlock();
00102             OutputPanel->Children->Append(copyrightTextBlock);
00103             TextBlock^ colorspaceTextBlock = CreateLineItemTextBlock();
00104             OutputPanel->Children->Append(colorspaceTextBlock);
00105
00106             // GetImagePropertiesAsync will return synchronously when prefetching has been able to
00107             // retrieve the properties in advance.
00108             create_task(file->Properties->GetImagePropertiesAsync()).then([=](ImageProperties^ properties)
00109             {
00110                 imagePropTextBlock->Text = "Dimensions: " + properties->Width + "x" + properties->Height;
00111             });
00112
00113             // Similarly, extra properties are retrieved asynchronously but may
00114             // return immediately when prefetching has fulfilled its task.
00115             create_task(file->Properties->RetrievePropertiesAsync(propertyNames)).then([=](IMap<String^, Object^>^ extraProperties)
00116             {
00117                 copyrightTextBlock->Text = "Copyright: " + GetPropertyDisplayValue(extraProperties->Lookup(CopyrightProperty));
00118                 colorspaceTextBlock->Text = "Color space: " + GetPropertyDisplayValue(extraProperties->Lookup(ColorSpaceProperty));
00119             });
00120
00121             // Thumbnails can also be retrieved and used.
00122             /*
00123             create_task(file->GetThumbnailAsync(thumbnailMode, requestedSize, thumbnailOptions)).then([=](StorageItemThumbnail^ thumbnail)
00124             {
00125                 // Use the thumbnail.
00126             });
00127             */
00128         });
00129     });
00130 }
00131
00132 TextBlock^ Scenario3::CreateHeaderTextBlock(String^ contents)
00133 {
00134     TextBlock^ textBlock = ref new TextBlock();
00135     textBlock->Text = contents;
00136     textBlock->Style = static_cast<Xaml::Style^>(Application::Current->Resources->Lookup("SampleHeaderTextStyle"));
00137     textBlock->TextWrapping = TextWrapping::Wrap;
00138     return textBlock;
00139 }
00140
00141 TextBlock^ Scenario3::CreateLineItemTextBlock()
00142 {
00143     TextBlock^ textBlock = ref new TextBlock();
00144     textBlock->Style = static_cast<Xaml::Style^>(Application::Current->Resources->Lookup("BasicTextStyle"));
00145     textBlock->TextWrapping = TextWrapping::Wrap;
00146     Thickness margin = textBlock->Margin;
00147     margin.Left = 20;
00148     textBlock->Margin = margin;
00149     return textBlock;
00150 }
Generated on Fri Nov 15 2024 22:18:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario5_TriggerCFU.h Source File

  • FilePicker
  • cppwinrt

Scenario5_TriggerCFU.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_TriggerCFU.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario5_TriggerCFU : Scenario5_TriggerCFUT<Scenario5_TriggerCFU>
00020     {
00021         Scenario5_TriggerCFU();
00022         fire_and_forget CreateFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023         fire_and_forget WriteToFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00024         fire_and_forget WriteToFileWithExplicitCFUButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         fire_and_forget PickAFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026         void SaveToFutureAccessListButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027         fire_and_forget GetFileFromFutureAccessListButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031
00032         Windows::Storage::StorageFile m_afterWriteFile{ nullptr };
00033         Windows::Storage::StorageFile m_beforeReadFile{ nullptr };
00034         hstring m_faToken;
00035
00036         void UpdateButtons();
00037     };
00038 }
00039
00040 namespace winrt::SDKTemplate::factory_implementation
00041 {
00042     struct Scenario5_TriggerCFU : Scenario5_TriggerCFUT<Scenario5_TriggerCFU, implementation::Scenario5_TriggerCFU>
00043     {
00044     };
00045 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario3_ServicingCompleteTask.xaml.h Source File

  • BackgroundActivation
  • cpp

Scenario3_ServicingCompleteTask.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3_ServicingCompleteTask.xaml.h
00013 // Declaration of the ServicingCompleteTask class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario3_ServicingCompleteTask.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class ServicingCompleteTask sealed
00029     {
00030     public:
00031         ServicingCompleteTask();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035     private:
00036         SDKTemplate::MainPage^ rootPage;
00037
00038         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00039         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00042         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00043         void UpdateUI();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:18:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.cpp Source File

  • CameraOpenCV
  • shared
  • OpenCVBridge

OpenCVHelper.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 // OpenCVHelper.cpp
00012
00013 #include "pch.h"
00014 #include "OpenCVHelper.h"
00015 #include "MemoryBuffer.h"
00016 #include <iostream>
00017 using namespace Microsoft::WRL;
00018
00019 using namespace OpenCVBridge;
00020 using namespace Platform;
00021 using namespace Windows::Graphics::Imaging;
00022 using namespace Windows::Storage::Streams;
00023 using namespace Windows::Foundation;
00024
00025 using namespace cv;
00026
00027 OpenCVHelper::OpenCVHelper()
00028 {
00029     pMOG2 = createBackgroundSubtractorMOG2();
00030 }
00031
00032 void OpenCVHelper::Blur(SoftwareBitmap^ input, SoftwareBitmap^ output)
00033 {
00034     Mat inputMat, outputMat;
00035     if (!(TryConvert(input, inputMat) && TryConvert(output, outputMat)))
00036     {
00037         return;
00038     }
00039
00040     blur(inputMat, outputMat, cv::Size(5, 5));
00041 }
00042
00043 void OpenCVHelper::MotionDetector(SoftwareBitmap^ input, SoftwareBitmap^ output)
00044 {
00045     Mat inputMat, outputMat;
00046     if (!(TryConvert(input, inputMat) && TryConvert(output, outputMat)))
00047     {
00048         return;
00049     }
00050
00051     pMOG2->apply(inputMat, fgMaskMOG2);
00052     int type = fgMaskMOG2.type();
00053     Mat temp;
00054     cvtColor(fgMaskMOG2, temp, CV_GRAY2BGRA);
00055
00056     Mat element = getStructuringElement(MORPH_RECT, cv::Size(3, 3));
00057     erode(temp, temp, element);
00058     temp.copyTo(outputMat);
00059 }
00060
00061 void OpenCVHelper::Histogram(SoftwareBitmap^ input, SoftwareBitmap^ output)
00062 {
00063     Mat inputMat, outputMat;
00064     if (!(TryConvert(input, inputMat) && TryConvert(output, outputMat)))
00065     {
00066         return;
00067     }
00068
00069     std::vector<Mat> bgr_planes;
00070     split(inputMat, bgr_planes);
00071     int histSize = 256;
00072     float range[] = { 0, 256 };
00073     const float* histRange = { range };
00074     bool uniform = true; bool accumulate = false;
00075
00076     Mat b_hist, g_hist, r_hist;
00077     calcHist(&bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate);
00078     calcHist(&bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, &histRange, uniform, accumulate);
00079     calcHist(&bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, &histRange, uniform, accumulate);
00080     int hist_w = outputMat.cols; int hist_h = outputMat.rows;
00081     double bin_w = (double)outputMat.cols / histSize;
00082
00083     normalize(b_hist, b_hist, 0, outputMat.rows, NORM_MINMAX, -1, Mat());
00084     normalize(g_hist, g_hist, 0, outputMat.rows, NORM_MINMAX, -1, Mat());
00085     normalize(r_hist, r_hist, 0, outputMat.rows, NORM_MINMAX, -1, Mat());
00086     for (int i = 1; i < histSize; i++)
00087     {
00088         int x1 = cvRound(bin_w * (i - 1));
00089         int x2 = cvRound(bin_w * i);
00090         line(outputMat, cv::Point(x1, hist_h - cvRound(b_hist.at<float>(i - 1))),
00091             cv::Point(x2, hist_h - cvRound(b_hist.at<float>(i))),
00092             Scalar(255, 0, 0, 255), 2, 8, 0);
00093         line(outputMat, cv::Point(x1, hist_h - cvRound(g_hist.at<float>(i - 1))),
00094             cv::Point(x2, hist_h - cvRound(g_hist.at<float>(i))),
00095             Scalar(0, 255, 0, 255), 2, 8, 0);
00096         line(outputMat, cv::Point(x1, hist_h - cvRound(r_hist.at<float>(i - 1))),
00097             cv::Point(x2, hist_h - cvRound(r_hist.at<float>(i))),
00098             Scalar(0, 0, 255, 255), 2, 8, 0);
00099     }
00100 }
00101
00102 void OpenCVHelper::Contours(SoftwareBitmap^ input, SoftwareBitmap^ output)
00103 {
00104     Mat inputMat, outputMat;
00105     if (!(TryConvert(input, inputMat) && TryConvert(output, outputMat)))
00106     {
00107         return;
00108     }
00109
00110     Mat src_gray;
00111     Mat canny_output;
00112     int thresh = 50;
00113     int max_thresh = 255;
00114     std::vector<std::vector<cv::Point> > contours;
00115     std::vector<Vec4i> hierarchy;
00116
00117     cvtColor(inputMat, src_gray, CV_BGRA2GRAY);
00118     blur(src_gray, src_gray, cv::Size(3, 3));
00119     Canny(src_gray, canny_output, thresh, thresh * 3, 3);
00120     findContours(canny_output, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
00121
00122     for (int i = 0; i < contours.size(); i++)
00123     {
00124         drawContours(outputMat, contours, i, Scalar(255, 0, 0, 255), 2, 8, hierarchy, 0);
00125     }
00126 }
00127
00128 void OpenCVHelper::HoughLines(SoftwareBitmap^ input, SoftwareBitmap^ output)
00129 {
00130     Mat inputMat, outputMat;
00131     if (!(TryConvert(input, inputMat) && TryConvert(output, outputMat)))
00132     {
00133         return;
00134     }
00135
00136     inputMat.copyTo(outputMat);
00137
00138     Mat edges, cdst, src_gray;
00139     cvtColor(inputMat, src_gray, CV_BGRA2GRAY);
00140     Canny(src_gray, edges, 100, 200, 3);
00141     std::vector<Vec4i> lines;
00142     HoughLinesP(edges, lines, 1, CV_PI / 180, 50, input->PixelWidth / 4, 10);
00143     for (size_t i = 0; i < lines.size(); i++)
00144     {
00145         Vec4i l = lines[i];
00146         line(outputMat, cv::Point(l[0], l[1]), cv::Point(l[2], l[3]), Scalar(0, 255, 0, 255), 3, CV_AA);
00147     }
00148 }
00149
00150 bool OpenCVHelper::TryConvert(SoftwareBitmap^ from, Mat& convertedMat)
00151 {
00152     unsigned char* pPixels = nullptr;
00153     unsigned int capacity = 0;
00154     if (!GetPointerToPixelData(from, &pPixels, &capacity))
00155     {
00156         return false;
00157     }
00158
00159     Mat mat(from->PixelHeight,
00160         from->PixelWidth,
00161         CV_8UC4, // assume input SoftwareBitmap is BGRA8
00162         (void*)pPixels);
00163
00164     // shallow copy because we want convertedMat.data = pPixels
00165     // don't use .copyTo or .clone
00166     convertedMat = mat;
00167     return true;
00168 }
00169
00170 bool OpenCVHelper::GetPointerToPixelData(SoftwareBitmap^ bitmap, unsigned char** pPixelData, unsigned int* capacity)
00171 {
00172     BitmapBuffer^ bmpBuffer = bitmap->LockBuffer(BitmapBufferAccessMode::ReadWrite);
00173     IMemoryBufferReference^ reference = bmpBuffer->CreateReference();
00174
00175     ComPtr<IMemoryBufferByteAccess> pBufferByteAccess;
00176     if ((reinterpret_cast<IInspectable*>(reference)->QueryInterface(IID_PPV_ARGS(&pBufferByteAccess))) != S_OK)
00177     {
00178         return false;
00179     }
00180
00181     if (pBufferByteAccess->GetBuffer(pPixelData, capacity) != S_OK)
00182     {
00183         return false;
00184     }
00185     return true;
00186 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleOverlay Member List

This is the complete list of members for SampleOverlay, including all inherited members.
CreateDeviceDependentResources() | SampleOverlay |
CreateWindowSizeDependentResources() | SampleOverlay |
GetTitleHeightInDips() | SampleOverlay |
m_caption | SampleOverlay | [private]
m_deviceResources | SampleOverlay | [private]
m_drawOverlay | SampleOverlay | [private]
m_idIncrement | SampleOverlay | [private]
m_logoBitmap | SampleOverlay | [private]
m_logoSize | SampleOverlay | [private]
m_overlayWidth | SampleOverlay | [private]
m_padding | SampleOverlay | [private]
m_stateBlock | SampleOverlay | [private]
m_textLayout | SampleOverlay | [private]
m_textVerticalOffset | SampleOverlay | [private]
m_whiteBrush | SampleOverlay | [private]
ReleaseDeviceDependentResources() | SampleOverlay |
Render() | SampleOverlay |
SampleOverlay(const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption) | SampleOverlay |
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Orientation Member List

This is the complete list of members for Scenario1_Orientation, including all inherited members.
ApplyRotationLock_Click(object sender, RoutedEventArgs e) | Scenario1_Orientation | [inline, private]
displayInfo | Scenario1_Orientation | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_Orientation | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Orientation | [inline, protected]
OnOrientationChanged(DisplayInformation sender, object e) | Scenario1_Orientation | [inline, private]
Scenario1_Orientation() | Scenario1_Orientation | [inline]
UpdateContent() | Scenario1_Orientation | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
CustomMTC_Liked(object sender, EventArgs e) | MainPage | [inline, private]
likes | MainPage | [private]
MainPage() | MainPage | [inline]
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Services/PlaybackService.cs Source File

  • BackgroundMediaPlayback
  • cs
  • Services

PlaybackService.cs

Go to the documentation of this file.
00001 ﻿using BackgroundMediaPlayback.DataModels;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Media.Playback;
00008
00009 namespace BackgroundMediaPlayback.Services
00010 {
00011     /// <summary>
00012     /// The central authority on playback in the application
00013     /// providing access to the player and active playlist.
00014     /// </summary>
00015     class PlaybackService
00016     {
00017         static PlaybackService instance;
00018
00019         public static PlaybackService Instance
00020         {
00021             get
00022             {
00023                 if (instance == null)
00024                     instance = new PlaybackService();
00025
00026                 return instance;
00027             }
00028         }
00029
00030         /// <summary>
00031         /// This application only requires a single shared MediaPlayer
00032         /// that all pages have access to. The instance could have
00033         /// also been stored in Application.Resources or in an
00034         /// application defined data model.
00035         /// </summary>
00036         public MediaPlayer Player { get; private set; }
00037
00038         /// <summary>
00039         /// The data model of the active playlist. An application might
00040         /// have a database of items representing a user's media library,
00041         /// but here we use a simple list loaded from a JSON asset.
00042         /// </summary>
00043         public MediaList CurrentPlaylist { get; set; }
00044
00045         public PlaybackService()
00046         {
00047             // Create the player instance
00048             Player = new MediaPlayer();
00049             Player.AutoPlay = false;
00050         }
00051     }
00052 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario5_RelativePositioning.cpp Source File

  • AppWindow
  • cppwinrt

Scenario5_RelativePositioning.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_RelativePositioning.h"
00014 #include "Scenario5_RelativePositioning.g.cpp"
00015 #include "MainPage.h"
00016 #include "SampleConfiguration.h"
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::WindowManagement;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Hosting;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario5_RelativePositioning::Scenario5_RelativePositioning()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     fire_and_forget Scenario5_RelativePositioning::OnNavigatedFrom(NavigationEventArgs const&)
00034     {
00035         if (appWindow != nullptr)
00036         {
00037             co_await appWindow.CloseAsync();
00038         }
00039     }
00040
00041     fire_and_forget Scenario5_RelativePositioning::ShowWindowBtn_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         auto lifetime = get_strong();
00044
00045         // Clear any previous message.
00046         auto rootPage = MainPage::Current();
00047         rootPage.NotifyUser({}, NotifyType::StatusMessage);
00048
00049         float horizontalOffset = 0.0f;
00050         float verticalOffset = 0.0f;
00051         if (!TryParseFloat(windowOffsetXTxt().Text(), horizontalOffset) ||
00052             !TryParseFloat(windowOffsetYTxt().Text(), verticalOffset))
00053         {
00054             rootPage.NotifyUser(L"Please specify valid numeric offsets.", NotifyType::ErrorMessage);
00055             co_return;
00056         }
00057
00058         unique_disabled_control re_enabled{ showWindowBtn() };
00059
00060         // Only ever create and show one window.
00061         if (appWindow == nullptr)
00062         {
00063             // Create a new window
00064             appWindow = co_await AppWindow::TryCreateAsync();
00065             // Clean up when the window is closed
00066             appWindow.Closed({ get_weak(), &Scenario5_RelativePositioning::OnWindowClosed });
00067             // Navigate the frame to the page we want to show in the new window
00068             appWindowFrame.Navigate(xaml_typename<SDKTemplate::SecondaryAppWindowPage>());
00069             // Attach the XAML content to our window
00070             ElementCompositionPreview::SetAppWindowContent(appWindow, appWindowFrame);
00071         }
00072
00073         // Make a point for our offset.
00074         Point offset{ horizontalOffset, verticalOffset };
00075
00076         // Check if we should be setting our position relative to ApplicationView or DisplayRegion
00077         if (positionOffsetDisplayRegionRB().IsChecked().Value())
00078         {
00079             // Request an offset relative to the DisplayRegion we're on
00080             appWindow.RequestMoveRelativeToDisplayRegion(ApplicationView::GetForCurrentView().GetDisplayRegions().GetAt(0), offset);
00081         }
00082         else
00083         {
00084             // Relative to our ApplicationView
00085             appWindow.RequestMoveRelativeToCurrentViewContent(offset);
00086         }
00087
00088         // If the window is not visible, show it and/or bring it to foreground
00089         if (!appWindow.IsVisible())
00090         {
00091             co_await appWindow.TryShowAsync();
00092         }
00093     }
00094
00095     void Scenario5_RelativePositioning::OnWindowClosed(AppWindow const&, IInspectable const&)
00096     {
00097         // Make sure we release the reference to this window, and release XAML resources.
00098         appWindow = nullptr;
00099         appWindowFrame.Content(nullptr);
00100     }
00101 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Submix Member List

This is the complete list of members for Scenario4_Submix, including all inherited members.
CreateAudioGraph() | Scenario4_Submix | [inline, private]
deviceOutputNode | Scenario4_Submix | [private]
echoEffect | Scenario4_Submix | [private]
EchoEffectToggle_Toggled(object sender, RoutedEventArgs e) | Scenario4_Submix | [inline, private]
File1_Click(object sender, RoutedEventArgs e) | Scenario4_Submix | [inline, private]
File2_Click(object sender, RoutedEventArgs e) | Scenario4_Submix | [inline, private]
fileInputNode1 | Scenario4_Submix | [private]
fileInputNode2 | Scenario4_Submix | [private]
graph | Scenario4_Submix | [private]
GraphButton_Click(object sender, RoutedEventArgs e) | Scenario4_Submix | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario4_Submix | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4_Submix | [inline, protected]
rootPage | Scenario4_Submix | [private]
Scenario4_Submix() | Scenario4_Submix | [inline]
submixNode | Scenario4_Submix | [private]
TogglePlay() | Scenario4_Submix | [inline, private]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VisitBackgroundTask Member List

This is the complete list of members for VisitBackgroundTask, including all inherited members.
_values | VisitBackgroundTask | [private]
GenerateVisitDescription(Geovisit visit) | VisitBackgroundTask | [inline, private]
maxEventDescriptors | VisitBackgroundTask | [private]
ProcessVisitReports(GeovisitTriggerDetails triggerDetails) | VisitBackgroundTask | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | VisitBackgroundTask | [inline, private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/DirectXHelper.h Source File

  • SpatialInteractionSource
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include <ppltasks.h>    // For create_task
00004
00005 namespace DX
00006 {
00007     inline void ThrowIfFailed(HRESULT hr)
00008     {
00009         if (FAILED(hr))
00010         {
00011             // Set a breakpoint on this line to catch Win32 API errors.
00012             throw Platform::Exception::CreateException(hr);
00013         }
00014     }
00015
00016     // Function that reads from a binary file asynchronously.
00017     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00018     {
00019         using namespace Windows::Storage;
00020         using namespace Concurrency;
00021
00022         return create_task(PathIO::ReadBufferAsync(Platform::StringReference(filename.c_str()))).then(
00023             [] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00024             {
00025                 std::vector<byte> returnBuffer;
00026                 returnBuffer.resize(fileBuffer->Length);
00027                 Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), static_cast<unsigned int>(returnBuffer.size())));
00028                 return returnBuffer;
00029             });
00030     }
00031
00032     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00033     inline float ConvertDipsToPixels(float dips, float dpi)
00034     {
00035         constexpr float dipsPerInch = 96.0f;
00036         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00037     }
00038
00039 #if defined(_DEBUG)
00040     // Check for SDK Layer support.
00041     inline bool SdkLayersAvailable()
00042     {
00043         HRESULT hr = D3D11CreateDevice(
00044             nullptr,
00045             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00046             0,
00047             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00048             nullptr,                    // Any feature level will do.
00049             0,
00050             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00051             nullptr,                    // No need to keep the D3D device reference.
00052             nullptr,                    // No need to know the feature level.
00053             nullptr                     // No need to keep the D3D device context reference.
00054             );
00055
00056         return SUCCEEDED(hr);
00057     }
00058 #endif
00059
00060
00061     inline DirectX::XMFLOAT4 GetDXColor(Windows::UI::Color color)
00062     {
00063         return DirectX::XMFLOAT4(
00064             static_cast<float>(color.R) / 255.0f,
00065             static_cast<float>(color.G) / 255.0f,
00066             static_cast<float>(color.B) / 255.0f,
00067             static_cast<float>(color.A) / 255.0f);
00068     }
00069
00070     inline DXGI_FORMAT GetDxgiFormat()
00071     {
00072         return sizeof(VertexIndex_t) == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT;
00073     }
00074
00075     inline DirectX::XMVECTOR GetQuaternionVectorFromRay(Windows::Foundation::Numerics::float3 forward, Windows::Foundation::Numerics::float3 up)
00076     {
00077         Windows::Foundation::Numerics::float3 right;
00078         DirectX::XMStoreFloat3(&right, DirectX::XMVector3Cross(DirectX::XMLoadFloat3(&forward), DirectX::XMLoadFloat3(&up)));
00079         // Create the matrix switching from current coordinatesystem to right, up, backwards
00080         const DirectX::XMMATRIX orientationMatrix = DirectX::XMMatrixSet(
00081             right.x, right.y, right.z, 0.0f,
00082             up.x, up.y, up.z, 0.0f,
00083             -forward.x, -forward.y, -forward.z, 0.0f,
00084             0.0f, 0.0f, 0.0f, 1.0f
00085         );
00086         // And return the associated quaternion
00087         return DirectX::XMQuaternionRotationMatrix(orientationMatrix);
00088     }
00089 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cs/Scenario2.xaml.cs Source File

  • XamlContextMenu
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Linq;
00016 using Windows.Foundation;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Media;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2 : Page
00025     {
00026         private MainPage rootPage = MainPage.Current;
00027         public List<SampleDataModel> AllItems = SampleDataModel.GetSampleData();
00028
00029         public Scenario2()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private SampleDataModel GetDataModelForCurrentListViewFlyout()
00035         {
00036             // Obtain the ListViewItem for which the user requested a context menu.
00037             var listViewItem = SharedFlyout.Target;
00038
00039             // Get the data model for the ListViewItem.
00040             return (SampleDataModel)ItemListView.ItemFromContainer(listViewItem);
00041         }
00042
00043         private void OpenMenuItem_Click(object sender, RoutedEventArgs e)
00044         {
00045             SampleDataModel model = GetDataModelForCurrentListViewFlyout();
00046             rootPage.NotifyUser($"Item: {model.Title}, Action: Open", NotifyType.StatusMessage);
00047         }
00048
00049         private void PrintMenuItem_Click(object sender, RoutedEventArgs e)
00050         {
00051             SampleDataModel model = GetDataModelForCurrentListViewFlyout();
00052             rootPage.NotifyUser($"Item: {model.Title}, Action: Print", NotifyType.StatusMessage);
00053         }
00054
00055         private void DeleteMenuItem_Click(object sender, RoutedEventArgs e)
00056         {
00057             SampleDataModel model = GetDataModelForCurrentListViewFlyout();
00058             rootPage.NotifyUser($"Item: {model.Title}, Action: Delete", NotifyType.StatusMessage);
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Helpers/BufferConverter.h Source File

  • WiFiDirectServices
  • cpp
  • Helpers

BufferConverter.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     namespace Helpers
00017     {
00018
00019         public ref class BufferConverter sealed : Windows::UI::Xaml::Data::IValueConverter
00020         {
00021         public:
00022             BufferConverter() {}
00023             virtual ~BufferConverter() {}
00024
00025             virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language)
00026             {
00027                 Platform::String^ metadata = "";
00028                 Windows::Storage::Streams::IBuffer^ buffer = dynamic_cast<Windows::Storage::Streams::IBuffer^>(value);
00029                 if (buffer != nullptr)
00030                 {
00031                     auto metadataReader = Windows::Storage::Streams::DataReader::FromBuffer(buffer);
00032                     metadata = metadataReader->ReadString(buffer->Length);
00033                     metadata = "(" + metadata + ")";
00034                 }
00035                 return metadata;
00036             }
00037
00038             virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language)
00039             {
00040                 throw ref new Platform::NotImplementedException();
00041             }
00042         };
00043     }
00044 }
Generated on Fri Nov 15 2024 22:22:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BarcodeScannerInfo.h Source File

  • BarcodeScanner
  • cppwinrt

BarcodeScannerInfo.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "BarcodeScannerInfo.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct BarcodeScannerInfo : BarcodeScannerInfoT<BarcodeScannerInfo>
00019     {
00020         BarcodeScannerInfo(winrt::hstring const& deviceName, winrt::hstring const& deviceId) :
00021             m_deviceName(deviceName),
00022             m_deviceId(deviceId)
00023         {
00024         }
00025
00026         winrt::hstring Name() const
00027         {
00028             return m_deviceName;
00029         }
00030
00031         winrt::hstring DeviceId() const
00032         {
00033             return m_deviceId;
00034         }
00035
00036     private:
00037         winrt::hstring m_deviceName;
00038         winrt::hstring m_deviceId;
00039     };
00040 }
00041
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct BarcodeScannerInfo : BarcodeScannerInfoT<BarcodeScannerInfo, implementation::BarcodeScannerInfo>
00045     {
00046     };
00047 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioCommon Member List

This is the complete list of members for ScenarioCommon, including all inherited members.
BackgroundAuthenticationCompleted | ScenarioCommon |
BackgroundTaskEntryPoint | ScenarioCommon |
BackgroundTaskName | ScenarioCommon |
HasRegisteredBackgroundTaskHandler | ScenarioCommon | [private]
Instance | ScenarioCommon | [static]
OnBackgroundTaskCompleted(IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e) | ScenarioCommon | [inline]
RegisteredCompletionHandlerForBackgroundTask() | ScenarioCommon | [inline]
rootPage | ScenarioCommon | [private]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/pch.h Source File

  • SmartCard
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_CredentialPickerOptions Member List

This is the complete list of members for Scenario3_CredentialPickerOptions, including all inherited members.
Launch_Click(object sender, RoutedEventArgs e) | Scenario3_CredentialPickerOptions | [inline, private]
Protocol_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario3_CredentialPickerOptions | [inline, private]
rootPage | Scenario3_CredentialPickerOptions | [private]
Scenario3_CredentialPickerOptions() | Scenario3_CredentialPickerOptions | [inline]
SetError(string err) | Scenario3_CredentialPickerOptions | [inline, private]
SetPasswordExplainVisibility(bool isShown) | Scenario3_CredentialPickerOptions | [inline, private]
SetResult(CredentialPickerResults res) | Scenario3_CredentialPickerOptions | [inline, private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrCapturedImage.xaml.cpp Source File

  • OCR
  • cpp

OcrCapturedImage.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "OcrCapturedImage.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Devices::Enumeration;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Graphics::Imaging;
00022 using namespace Windows::Media;
00023 using namespace Windows::Media::MediaProperties;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Controls::Primitives;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Input;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Media::Imaging;
00032 using namespace Windows::UI::Xaml::Navigation;
00033
00034 using namespace std;
00035
00036 // Creates a task that completes with a void result.
00037 concurrency::task<void> create_empty_task()
00038 {
00039     return concurrency::create_task([] {});
00040 }
00041
00042 OcrCapturedImage::OcrCapturedImage() : rootPage(MainPage::Current)
00043 {
00044     InitializeComponent();
00045
00046     ocrLanguage = ref new Windows::Globalization::Language("en");
00047
00048     // Useful to know when to initialize/clean up the camera.
00049     Application::Current->Suspending += ref new Windows::UI::Xaml::SuspendingEventHandler(this, &OcrCapturedImage::Application_Suspending); ;
00050     Application::Current->Resuming += ref new Windows::Foundation::EventHandler<Platform::Object^>(this, &OcrCapturedImage::Application_Resuming);;
00051 }
00052
00053 /// <summary>
00054 /// Invoked when this page is about to be displayed in a Frame.
00055 /// Ckecks if English language is avaiable for OCR on device and starts camera preview.
00056 /// </summary>
00057 /// <param name="e"></param>
00058 void OcrCapturedImage::OnNavigatedTo(NavigationEventArgs^ e)
00059 {
00060     orientationChangedEventToken = displayInformation->OrientationChanged += ref new Windows::Foundation::TypedEventHandler<Windows::Graphics::Display::DisplayInformation ^, Platform::Object ^>(this, &SDKTemplate ::OcrCapturedImage::DisplayInformation_OrientationChanged);
00061
00062     if (!OcrEngine::IsLanguageSupported(ocrLanguage))
00063     {
00064         rootPage->NotifyUser( ocrLanguage->DisplayName + " language ia not supported.", NotifyType::ErrorMessage);
00065
00066         return;
00067     }
00068
00069     create_task(StartCameraAsync()).then([this](task<void> prevTask)
00070     {
00071         Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([this]()
00072         {
00073             // Update buttons visibility.
00074             ExtractButton->Visibility = isInitialized ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00075             CameraButton->Visibility = isInitialized ? Windows::UI::Xaml::Visibility::Collapsed : Windows::UI::Xaml::Visibility::Visible;
00076         }));
00077     });
00078 }
00079
00080 /// <summary>
00081 /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00082 /// Stops camera if initialized.
00083 /// </summary>
00084 /// <param name="e"></param>
00085 void OcrCapturedImage::OnNavigatedFrom(NavigationEventArgs^ e)
00086 {
00087     displayInformation->OrientationChanged -= orientationChangedEventToken;
00088
00089     create_task(CleanupCameraAsync());
00090 }
00091
00092 /// <summary>
00093 /// Occures on app suspending. Stops camera if initialized.
00094 /// </summary>
00095 /// <param name="sender"></param>
00096 /// <param name="e"></param>
00097 void OcrCapturedImage::Application_Suspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e)
00098 {
00099     // Handle global application events only if this page is active.
00100     if (Frame->CurrentSourcePageType.Name == Windows::UI::Xaml::Interop::TypeName(MainPage::typeid).Name)
00101     {
00102         auto deferral = e->SuspendingOperation->GetDeferral();
00103
00104         create_task(CleanupCameraAsync()).then([this, deferral]()
00105         {
00106             displayInformation->OrientationChanged -= orientationChangedEventToken;
00107
00108             deferral->Complete();
00109         });;
00110     }
00111 }
00112
00113 /// <summary>
00114 /// Occures on app resuming. Initializes camera if available.
00115 /// </summary>
00116 /// <param name="sender"></param>
00117 /// <param name="o"></param>
00118 void OcrCapturedImage::Application_Resuming(Platform::Object^ sender, Platform::Object^ o)
00119 {
00120     // Handle global application events only if this page is active
00121     if (Frame->CurrentSourcePageType.Name == Windows::UI::Xaml::Interop::TypeName(MainPage::typeid).Name)
00122     {
00123         orientationChangedEventToken = displayInformation->OrientationChanged += ref new Windows::Foundation::TypedEventHandler<Windows::Graphics::Display::DisplayInformation ^, Platform::Object ^>(this, &SDKTemplate ::OcrCapturedImage::DisplayInformation_OrientationChanged);
00124
00125         create_task(StartCameraAsync());
00126     }
00127 }
00128
00129 /// <summary>
00130 /// Occures when display orientation changes.
00131 /// Sets camera rotation preview.
00132 /// </summary>
00133 /// <param name="sender"></param>
00134 /// <param name="args"></param>
00135 void OcrCapturedImage::DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation ^sender, Platform::Object ^args)
00136 {
00137     if (isPreviewing)
00138     {
00139         create_task(SetPreviewRotationAsync());
00140     }
00141 }
00142
00143 /// <summary>
00144 /// This is event handler for 'Extract' button.
00145 /// Captures image from camera ,recognizes text and displays it.
00146 /// </summary>
00147 /// <param name="sender"></param>
00148 /// <param name="e"></param>
00149 void OcrCapturedImage::ExtractButton_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
00150 {
00151     // Get information about the preview.
00152     auto previewProperties = safe_cast<VideoEncodingProperties^>(mediaCapture->VideoDeviceController->GetMediaStreamProperties(MediaStreamType::VideoPreview));
00153     int videoFrameWidth = (int)previewProperties->Width;
00154     int videoFrameHeight = (int)previewProperties->Height;
00155
00156     // In portrait modes, the width and height must be swapped for the VideoFrame to have the correct aspect ratio and avoid letterboxing / black bars.
00157     if (!externalCamera && (displayInformation->CurrentOrientation == DisplayOrientations::Portrait || displayInformation->CurrentOrientation == DisplayOrientations::PortraitFlipped))
00158     {
00159         videoFrameWidth = (int)previewProperties->Height;
00160         videoFrameHeight = (int)previewProperties->Width;
00161     }
00162
00163     // Create the video frame to request a SoftwareBitmap preview frame.
00164     auto videoFrame = ref new VideoFrame(BitmapPixelFormat::Bgra8, videoFrameWidth, videoFrameHeight);
00165
00166     OcrEngine^ ocrEngine = OcrEngine::TryCreateFromLanguage(ocrLanguage);
00167
00168     // Capture the preview frame.
00169     auto bitmap = make_shared<SoftwareBitmap^>(nullptr);
00170     create_task(mediaCapture->GetPreviewFrameAsync(videoFrame)).then([this, bitmap, ocrEngine](VideoFrame^ currentFrame)
00171     {
00172         // Collect the resulting frame.
00173         *bitmap = currentFrame->SoftwareBitmap;
00174
00175         auto imgSource = ref new WriteableBitmap((*bitmap)->PixelWidth, (*bitmap)->PixelHeight);
00176         (*bitmap)->CopyToBuffer(imgSource->PixelBuffer);
00177         PreviewImage->Source = imgSource;
00178
00179         return ocrEngine->RecognizeAsync(*bitmap);
00180     }).then([this, bitmap, ocrEngine](OcrResult^ ocrResult)
00181     {
00182         // Used for text overlay.
00183         // Prepare scale transform for words since image is not displayed in original format.
00184         auto scaleTrasform = ref new ScaleTransform();
00185         scaleTrasform->CenterX = 0;
00186         scaleTrasform->CenterY = 0;
00187         scaleTrasform->ScaleX = PreviewControl->ActualWidth / (*bitmap)->PixelWidth;
00188         scaleTrasform->ScaleY = PreviewControl->ActualHeight / (*bitmap)->PixelHeight;
00189
00190         if (ocrResult->TextAngle != nullptr)
00191         {
00192             // If text is detected under some angle in this sample scenario we want to
00193             // overlay word boxes over original image, so we rotate overlay boxes.
00194             auto rotateTransform = ref new RotateTransform();
00195             rotateTransform->Angle = ocrResult->TextAngle->Value;
00196             rotateTransform->CenterX = PreviewImage->ActualWidth / 2;
00197             rotateTransform->CenterY = PreviewImage->ActualHeight / 2;
00198             TextOverlay->RenderTransform = rotateTransform;
00199
00200             isAngleDetected = true;
00201         }
00202
00203         // Iterate over recognized lines of text.
00204         for (auto line : ocrResult->Lines)
00205         {
00206             // Iterate over words in line.
00207             for (auto word : line->Words)
00208             {
00209                 // Define the TextBlock.
00210                 auto wordTextBlock = ref new TextBlock();
00211                 wordTextBlock->Text = word->Text;
00212                 wordTextBlock->Style = (Windows::UI::Xaml::Style^) this->Resources->Lookup("ExtractedWordTextStyle");
00213
00214                 WordOverlay^ wordBoxOverlay = ref new WordOverlay(word);
00215
00216                 // Keep references to word boxes.
00217                 wordBoxes.push_back(wordBoxOverlay);
00218
00219                 // Define position, background, etc.
00220                 auto overlay = ref new Border();
00221                 overlay->Child = wordTextBlock;
00222                 overlay->Style = (Windows::UI::Xaml::Style^) this->Resources->Lookup("HighlightedWordBoxHorizontalLine");
00223
00224                 // Bind word boxes to UI.
00225                 overlay->SetBinding(FrameworkElement::MarginProperty, wordBoxOverlay->CreateWordPositionBinding());
00226                 overlay->SetBinding(FrameworkElement::WidthProperty, wordBoxOverlay->CreateWordWidthBinding());
00227                 overlay->SetBinding(FrameworkElement::HeightProperty, wordBoxOverlay->CreateWordHeightBinding());
00228
00229                 // Put the filled textblock in the results grid.
00230                 TextOverlay->Children->Append(overlay);
00231             }
00232         }
00233
00234         UpdateWordBoxTransform();
00235
00236         PreviewControl->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00237         ImageGrid->Visibility = Windows::UI::Xaml::Visibility::Visible;
00238         ExtractButton->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00239         CameraButton->Visibility = Windows::UI::Xaml::Visibility::Visible;
00240
00241         Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([this, ocrEngine]()
00242         {
00243             rootPage->NotifyUser("Image processed using " + ocrEngine->RecognizerLanguage->DisplayName + " language.", NotifyType::StatusMessage);
00244         }));
00245     });
00246 }
00247
00248 /// <summary>
00249 /// This is event handler for 'Camera' button.
00250 /// Clears previous OCR results and starts camera.
00251 /// </summary>
00252 /// <param name="sender"></param>
00253 /// <param name="e"></param>
00254 void OcrCapturedImage::CameraButton_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
00255 {
00256     create_task(StartCameraAsync());
00257 }
00258
00259 /// <summary>
00260 ///  Update word box transform to match current UI size.
00261 /// </summary>
00262 void OcrCapturedImage::UpdateWordBoxTransform()
00263 {
00264     if (PreviewImage->Source != nullptr)
00265     {
00266         WriteableBitmap^ bitmap = safe_cast<WriteableBitmap^>(PreviewImage->Source);
00267
00268         // Used for text overlay.
00269         // Prepare scale transform for words since image is not displayed in original size.
00270         ScaleTransform^ scaleTrasform = ref new ScaleTransform();
00271         scaleTrasform->CenterX = 0;
00272         scaleTrasform->CenterY = 0;
00273         scaleTrasform->ScaleX = PreviewImage->ActualWidth / bitmap->PixelWidth;
00274         scaleTrasform->ScaleY = PreviewImage->ActualHeight / bitmap->PixelHeight;
00275
00276         for (auto& box : wordBoxes)
00277         {
00278             box->Transform(scaleTrasform);
00279         }
00280     }
00281 }
00282
00283 /// <summary>
00284 /// Occures when displayed image size changes.
00285 /// </summary>
00286 /// <param name="sender"></param>
00287 /// <param name="e"></param>
00288 void OcrCapturedImage::PreviewImage_SizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
00289 {
00290     UpdateWordBoxTransform();
00291
00292     // Update image rotation center.
00293     if (isAngleDetected)
00294     {
00295         const auto& rotate = static_cast<RotateTransform^>(TextOverlay->RenderTransform);
00296
00297         rotate->CenterX = PreviewImage->ActualWidth / 2;
00298         rotate->CenterY = PreviewImage->ActualHeight / 2;
00299     }
00300 }
00301
00302 #pragma region MediaCapture
00303
00304 /// <summary>
00305 /// Starts the camera. Initializes resources and starts preview.
00306 /// </summary>
00307 task<void> OcrCapturedImage::StartCameraAsync()
00308 {
00309     auto cameraTask = create_empty_task();
00310
00311     if (!isInitialized)
00312     {
00313         cameraTask = cameraTask.then([this]()
00314         {
00315             return InitializeCameraAsync();
00316         });
00317     }
00318
00319     cameraTask.then([this](task<void> initTask)
00320     {
00321         try
00322         {
00323             initTask.get();
00324         }
00325         catch (Exception^ e)
00326         {
00327             // Use the dispatcher because this method is sometimes called from non-UI threads.
00328             auto msg = make_shared<String^>(e->Message);
00329             Dispatcher->RunAsync(
00330                 Windows::UI::Core::CoreDispatcherPriority::High,
00331                 ref new Windows::UI::Core::DispatchedHandler([this, msg]()
00332             {
00333                 rootPage->NotifyUser(*msg, NotifyType::ErrorMessage);
00334             }));
00335         }
00336
00337         if (isInitialized)
00338         {
00339             // Use the dispatcher because this method is sometimes called from non-UI threads.
00340             Dispatcher->RunAsync(
00341                 Windows::UI::Core::CoreDispatcherPriority::High,
00342                 ref new Windows::UI::Core::DispatchedHandler([this]()
00343             {
00344                 TextOverlay->Children->Clear();
00345                 wordBoxes.clear();
00346
00347                 PreviewImage->Source = nullptr;
00348
00349                 PreviewControl->Visibility = Windows::UI::Xaml::Visibility::Visible;
00350                 ImageGrid->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00351
00352                 ExtractButton->Visibility = Windows::UI::Xaml::Visibility::Visible;
00353                 CameraButton->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00354
00355                 rootPage->NotifyUser("Camera started.", NotifyType::StatusMessage);
00356             }));
00357         }
00358     });
00359
00360     return cameraTask;
00361 }
00362
00363 /// <summary>
00364 /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.
00365 /// </summary>
00366 task<void> OcrCapturedImage::InitializeCameraAsync()
00367 {
00368     if (mediaCapture.Get() != nullptr)
00369     {
00370         return create_empty_task();
00371     }
00372
00373     // Attempt to get the back camera if one is available, but use any camera device if not.
00374     return create_task(FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel::Back))
00375         .then([this](DeviceInformation^ cameraDevice)
00376     {
00377         if (cameraDevice == nullptr)
00378         {
00379             throw ref new Platform::Exception(E_ABORT, L"No camera device.");
00380         }
00381
00382         // Figure out where the camera is located.
00383         if (cameraDevice->EnclosureLocation == nullptr || cameraDevice->EnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Unknown)
00384         {
00385             // No information on the location of the camera, assume it's an external camera, not integrated on the device.
00386             externalCamera = true;
00387         }
00388         else
00389         {
00390             // Camera is fixed on the device.
00391             externalCamera = false;
00392
00393             // Only mirror the preview if the camera is on the front panel.
00394             mirroringPreview = (cameraDevice->EnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Front);
00395         }
00396
00397         auto settings = ref new MediaCaptureInitializationSettings();
00398         settings->VideoDeviceId = cameraDevice->Id;
00399
00400         // Create MediaCapture and its settings.
00401         mediaCapture = ref new MediaCapture();
00402
00403         mediaCaptureFailedEventToken = mediaCapture->Failed += ref new Windows::Media::Capture::MediaCaptureFailedEventHandler(this, &SDKTemplate ::OcrCapturedImage::MediaCapture_Failed);
00404
00405         // Initialize MediaCapture.
00406         return mediaCapture->InitializeAsync(settings);
00407     }).then([this]()
00408     {
00409         isInitialized = true;
00410
00411         // If initialization succeeded, start the preview.
00412         return StartPreviewAsync();
00413     });
00414 }
00415
00416 /// <summary>
00417 /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.
00418 /// </summary>
00419 task<void> OcrCapturedImage::StartPreviewAsync()
00420 {
00421     // Prevent the device from sleeping while the preview is running.
00422     displayRequest->RequestActive();
00423
00424     return create_task([this]()
00425     {
00426         // Return task to make sure PreviewControl->Source is set before StartPreviewAsync.
00427         return Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([this]()
00428         {
00429             // Set the preview source in the UI and mirror it if necessary.
00430             PreviewControl->Source = mediaCapture.Get();
00431             PreviewControl->FlowDirection = mirroringPreview ? ::FlowDirection::RightToLeft : ::FlowDirection::LeftToRight;
00432         }));
00433     }).then([this]()
00434     {
00435         // Start the preview.
00436         return mediaCapture->StartPreviewAsync();
00437     }).then([this]()
00438     {
00439         isPreviewing = true;
00440
00441         // Initialize the preview to the current orientation.
00442         return SetPreviewRotationAsync();
00443     });
00444 }
00445
00446 /// <summary>
00447 /// Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.
00448 /// </summary>
00449 task<void> OcrCapturedImage::SetPreviewRotationAsync()
00450 {
00451     // Only need to update the orientation if the camera is mounted on the device.
00452     if (externalCamera)
00453     {
00454         return create_empty_task();
00455     }
00456
00457     // Calculate which way and how far to rotate the preview.
00458     return create_task(CalculatePreviewRotation()).then([this]()
00459     {
00460         // Set preview rotation in the preview source.
00461         mediaCapture->SetPreviewRotation(sourceRotation);
00462
00463         // Rotation metadata to apply to the preview stream (MF_MT_VIDEO_ROTATION).
00464         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00465         static const GUID RotationKey = { 0xC380465D, 0x2271, 0x428C,{ 0x9B, 0x83, 0xEC, 0xEA, 0x3B, 0x4A, 0x85, 0xC1 } };
00466
00467         // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames.
00468         const auto& props = mediaCapture->VideoDeviceController->GetMediaStreamProperties(MediaStreamType::VideoPreview);
00469         props->Properties->Insert(RotationKey, rotationDegrees);
00470
00471         return mediaCapture->SetEncodingPropertiesAsync(MediaStreamType::VideoPreview, props, nullptr);
00472     });;
00473 }
00474
00475 /// <summary>
00476 /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI
00477 /// </summary>
00478 /// <returns></returns>
00479 task<void> OcrCapturedImage::StopPreviewAsync()
00480 {
00481     isPreviewing = false;
00482     return create_task(mediaCapture->StopPreviewAsync()).then([this]()
00483     {
00484         // Use the dispatcher because this method is sometimes called from non-UI threads
00485         return Dispatcher->RunAsync(
00486             Windows::UI::Core::CoreDispatcherPriority::High,
00487             ref new Windows::UI::Core::DispatchedHandler([this]()
00488         {
00489             PreviewControl->Source = nullptr;
00490
00491             // Allow the device to sleep now that the preview is stopped
00492             displayRequest->RequestRelease();
00493         }));
00494     }).then([this](task<void> t)
00495     {
00496         try
00497         {
00498             t.get();
00499         }
00500         catch (Exception^ e)
00501         {
00502             auto msg = make_shared<String^>(e->Message);
00503             Dispatcher->RunAsync(
00504                 Windows::UI::Core::CoreDispatcherPriority::High,
00505                 ref new Windows::UI::Core::DispatchedHandler([this, msg]()
00506             {
00507                 rootPage->NotifyUser("Exception stopping preview. " + (*msg), NotifyType::ErrorMessage);
00508             }));
00509         }
00510     });
00511 }
00512
00513 /// <summary>
00514 /// Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.
00515 /// </summary>
00516 task<void> OcrCapturedImage::CleanupCameraAsync()
00517 {
00518     auto cleanUpTask = create_empty_task();
00519
00520     if (isInitialized)
00521     {
00522         if (isPreviewing)
00523         {
00524             // The call to stop the preview is included here for completeness, but can be
00525             // safely removed if a call to MediaCapture.Dispose() is being made later,
00526             // as the preview will be automatically stopped at that point
00527             cleanUpTask = cleanUpTask.then([this]()
00528             {
00529                 return StopPreviewAsync();
00530             });
00531         }
00532     }
00533
00534     cleanUpTask = cleanUpTask.then([this]()
00535     {
00536         isInitialized = false;
00537
00538         if (mediaCapture.Get() != nullptr)
00539         {
00540             mediaCapture->Failed -= mediaCaptureFailedEventToken;
00541             delete(mediaCapture.Get());
00542             mediaCapture = nullptr;
00543         }
00544     });
00545
00546     return cleanUpTask;
00547 }
00548
00549 /// <summary>
00550 /// Queries the available video capture devices to try and find one mounted on the desired panel.
00551 /// </summary>
00552 /// <param name="desiredPanel">The panel on the device that the desired camera is mounted on.</param>
00553 /// <returns>A DeviceInformation instance with a reference to the camera mounted on the desired panel if available,
00554 ///          any other camera if not, or null if no camera is available.</returns>
00555 task<DeviceInformation^> OcrCapturedImage::FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel desiredPanel)
00556 {
00557     // Get available devices for capturing pictures.
00558     return create_task(DeviceInformation::FindAllAsync(DeviceClass::VideoCapture))
00559         .then([this, desiredPanel](DeviceInformationCollection^ allVideoDevices) -> DeviceInformation^
00560     {
00561         if (allVideoDevices == nullptr || allVideoDevices->Size == 0)
00562         {
00563             return nullptr;
00564         }
00565
00566         // Get the desired camera by panel.
00567         for (const auto& device : allVideoDevices)
00568         {
00569             if (device->EnclosureLocation != nullptr && device->EnclosureLocation->Panel == desiredPanel)
00570             {
00571                 return device;
00572             }
00573         }
00574
00575         // If there is no device mounted on the desired panel, return the first device found.
00576         return allVideoDevices->First()->Current;
00577     });
00578 }
00579
00580 /// <summary>
00581 /// Reads the current orientation of the app and calculates the VideoRotation necessary to ensure the preview is rendered in the correct orientation.
00582 /// </summary>
00583 task<void> OcrCapturedImage::CalculatePreviewRotation()
00584 {
00585     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([this]()
00586     {
00587         // Note that in some cases, the rotation direction needs to be inverted if the preview is being mirrored.
00588         switch (displayInformation->CurrentOrientation)
00589         {
00590         case DisplayOrientations::Portrait:
00591             if (mirroringPreview)
00592             {
00593                 rotationDegrees = 270;
00594                 sourceRotation = VideoRotation::Clockwise270Degrees;
00595             }
00596             else
00597             {
00598                 rotationDegrees = 90;
00599                 sourceRotation = VideoRotation::Clockwise90Degrees;
00600             }
00601             break;
00602
00603         case DisplayOrientations::LandscapeFlipped:
00604             // No need to invert this rotation, as rotating 180 degrees is the same either way.
00605             rotationDegrees = 180;
00606             sourceRotation = VideoRotation::Clockwise180Degrees;
00607             break;
00608
00609         case DisplayOrientations::PortraitFlipped:
00610             if (mirroringPreview)
00611             {
00612                 rotationDegrees = 90;
00613                 sourceRotation = VideoRotation::Clockwise90Degrees;
00614             }
00615             else
00616             {
00617                 rotationDegrees = 270;
00618                 sourceRotation = VideoRotation::Clockwise270Degrees;
00619             }
00620             break;
00621
00622         case DisplayOrientations::Landscape:
00623         default:
00624             rotationDegrees = 0;
00625             sourceRotation = VideoRotation::None;
00626             break;
00627         }
00628     })));
00629 }
00630
00631 void OcrCapturedImage::MediaCapture_Failed(MediaCapture^ sender, MediaCaptureFailedEventArgs^ errorEventArgs)
00632 {
00633     auto msg = make_shared<String^>(errorEventArgs->Message);
00634
00635     create_task(CleanupCameraAsync()).then([this, msg]
00636     {
00637         Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([this, msg]()
00638         {
00639             ExtractButton->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00640             CameraButton->Visibility = Windows::UI::Xaml::Visibility::Visible;
00641
00642             rootPage->NotifyUser(*msg, NotifyType::ErrorMessage);
00643         }));
00644     });
00645 }
00646
00647 #pragma endregion MediaCapture
Generated on Fri Nov 15 2024 22:20:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Scenario2_GetCurrentTextSegmentFromIndex.h Source File

  • TextSegmentation
  • cppwinrt

Scenario2_GetCurrentTextSegmentFromIndex.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_GetCurrentTextSegmentFromIndex.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_GetCurrentTextSegmentFromIndex : Scenario2_GetCurrentTextSegmentFromIndexT<Scenario2_GetCurrentTextSegmentFromIndex>
00019     {
00020         Scenario2_GetCurrentTextSegmentFromIndex();
00021
00022         void WordSegmentButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023         void SelectionSegmentButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario2_GetCurrentTextSegmentFromIndex : Scenario2_GetCurrentTextSegmentFromIndexT<Scenario2_GetCurrentTextSegmentFromIndex, implementation::Scenario2_GetCurrentTextSegmentFromIndex>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:21:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario4_Connect.xaml.cpp Source File

  • WiFiScan
  • cpp

Scenario4_Connect.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_Connect.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace SDKTemplate::WiFiScan;
00017
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Devices::WiFi;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Globalization::DateTimeFormatting;
00025 using namespace Windows::Networking::Connectivity;
00026 using namespace Windows::Security::Credentials;
00027 using namespace Windows::System::Threading;
00028 using namespace Windows::UI::Core;
00029 using namespace Windows::UI::Xaml;
00030 using namespace Windows::UI::Xaml::Controls;
00031 using namespace Windows::UI::Xaml::Controls::Primitives;
00032 using namespace Windows::UI::Xaml::Data;
00033 using namespace Windows::UI::Xaml::Input;
00034 using namespace Windows::UI::Xaml::Media;
00035 using namespace Windows::UI::Xaml::Navigation;
00036 using namespace concurrency;
00037
00038 Scenario4_Connect::Scenario4_Connect() : _rootPage(MainPage::Current)
00039 {
00040     InitializeComponent();
00041 }
00042
00043 void Scenario4_Connect::OnNavigatedTo(NavigationEventArgs^ e)
00044 {
00045     ResultCollection = ref new Vector<WiFiNetworkDisplay^>();
00046     DataContext = this;
00047
00048     // RequestAccessAsync must have been called at least once by the app before using the API
00049     // Calling it multiple times is fine but not necessary
00050     // RequestAccessAsync must be called from the UI thread
00051     auto requestAccessOperation = WiFiAdapter::RequestAccessAsync();
00052     auto requestAccessTask = create_task(requestAccessOperation);
00053
00054     requestAccessTask.then([this](WiFiAccessStatus access)
00055     {
00056         if (access != WiFiAccessStatus::Allowed)
00057         {
00058             _rootPage->NotifyUser(L"Access denied", SDKTemplate::NotifyType::ErrorMessage);
00059         }
00060         else
00061         {
00062             auto enumerationOperation = DeviceInformation::FindAllAsync(WiFiAdapter::GetDeviceSelector());
00063             auto enumerationTask = create_task(enumerationOperation);
00064
00065             enumerationTask.then([this](DeviceInformationCollection^ result)
00066             {
00067                 if (result->Size >= 1)
00068                 {
00069                     auto firstAdapterOperation = WiFiAdapter::FromIdAsync(result->GetAt(0)->Id);
00070                     auto firstAdapterTask = create_task(firstAdapterOperation);
00071
00072                     firstAdapterTask.then([this](WiFiAdapter^ adapter)
00073                     {
00074                         _firstAdapter = adapter;
00075                         ScanButton->IsEnabled = true;
00076                         DisconnectButton->IsEnabled = true;
00077                         UpdateConnectivityStatus();
00078                         NetworkInformation::NetworkStatusChanged += ref new NetworkStatusChangedEventHandler(this, &SDKTemplate::WiFiScan::Scenario4_Connect::OnNetworkStatusChanged);
00079                     });
00080                 }
00081                 else
00082                 {
00083                     _rootPage->NotifyUser(L"No WiFi Adapters detected on this machine", SDKTemplate::NotifyType::ErrorMessage);
00084                 }
00085             });
00086         }
00087     });
00088 }
00089
00090 void Scenario4_Connect::DisplayNetworkReport(WiFiNetworkReport^ report)
00091 {
00092     auto timestampString = DateTimeFormatter::LongDate->Format(report->Timestamp);
00093     auto message = L"Network Report Timestamp: " + timestampString;
00094     // there is no guarantee of what thread the AvailableNetworksChanged callback is run on
00095     _rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00096         ref new DispatchedHandler([this, message]
00097     {
00098         _rootPage->NotifyUser(message, SDKTemplate::NotifyType::StatusMessage);
00099     }));
00100
00101     ResultCollection->Clear();
00102     for (auto network : report->AvailableNetworks)
00103     {
00104         ResultCollection->Append(ref new WiFiNetworkDisplay(network, _firstAdapter));
00105     }
00106 }
00107
00108 void Scenario4_Connect::ScanButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00109 {
00110     auto scanOperation = _firstAdapter->ScanAsync();
00111     auto scanTask = create_task(scanOperation);
00112
00113     ConnectionBar->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00114
00115     scanTask.then([this]()
00116     {
00117         DisplayNetworkReport(_firstAdapter->NetworkReport);
00118         WiFiNetworkDisplay::UpdateConnectivityLevels(ResultCollection, 0);
00119     });
00120 }
00121
00122 void Scenario4_Connect::DisconnectButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00123 {
00124     _firstAdapter->Disconnect();
00125 }
00126
00127 void Scenario4_Connect::UpdateConnectivityStatus()
00128 {
00129     auto getConnectedProfileOperation = _firstAdapter->NetworkAdapter->GetConnectedProfileAsync();
00130     auto getConnectedProfileTask = create_task(getConnectedProfileOperation);
00131
00132     getConnectedProfileTask.then([this](ConnectionProfile^ connectedProfile)
00133     {
00134         if (connectedProfile != nullptr && _savedProfileName != connectedProfile->ProfileName)
00135         {
00136             _savedProfileName = connectedProfile->ProfileName;
00137             _rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00138                 ref new DispatchedHandler([this, connectedProfile]
00139             {
00140                 _rootPage->NotifyUser("WiFi adapter connected to: " + connectedProfile->ProfileName +
00141                     " (" + WiFiNetworkDisplay::GetConnectivityLevelAsString(connectedProfile->GetNetworkConnectivityLevel()) + ")",
00142                     SDKTemplate::NotifyType::StatusMessage);
00143             }));
00144         }
00145         else  if (connectedProfile == nullptr && _savedProfileName != nullptr)
00146         {
00147             _savedProfileName = nullptr;
00148             _rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00149                 ref new DispatchedHandler([this, connectedProfile]
00150             {
00151                 _rootPage->NotifyUser("WiFi adapter disconnected", SDKTemplate::NotifyType::StatusMessage);
00152             }));
00153         }
00154     });
00155 }
00156
00157 void Scenario4_Connect::OnNetworkStatusChanged(Platform::Object^ sender)
00158 {
00159     UpdateConnectivityStatus();
00160
00161     // Since the network status was changed, update the connectivity level displayed
00162     WiFiNetworkDisplay::UpdateConnectivityLevels(ResultCollection, 0);
00163 }
00164
00165 void Scenario4_Connect::ResultsListView_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00166 {
00167     WiFiNetworkDisplay^ selectedNetwork = reinterpret_cast<WiFiNetworkDisplay^>(ResultsListView->SelectedItem);
00168     if (selectedNetwork == nullptr)
00169     {
00170         return;
00171     }
00172
00173     // Show the connection bar
00174     ConnectionBar->Visibility = Windows::UI::Xaml::Visibility::Visible;
00175
00176     // Only show the password box if needed
00177     if (selectedNetwork->AvailableNetwork->SecuritySettings->NetworkAuthenticationType == NetworkAuthenticationType::Open80211 &&
00178         selectedNetwork->AvailableNetwork->SecuritySettings->NetworkEncryptionType == NetworkEncryptionType::None)
00179     {
00180         NetworkKeyInfo->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00181     }
00182     else
00183     {
00184         NetworkKeyInfo->Visibility = Windows::UI::Xaml::Visibility::Visible;
00185     }
00186 }
00187
00188
00189 void Scenario4_Connect::ConnectButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00190 {
00191     auto selectedNetwork = reinterpret_cast<WiFiNetworkDisplay^>(ResultsListView->SelectedItem);
00192
00193     if (selectedNetwork == nullptr || _firstAdapter == nullptr)
00194     {
00195         _rootPage->NotifyUser(L"Network not selcted", NotifyType::ErrorMessage);
00196         return;
00197     }
00198     WiFiReconnectionKind reconnectionKind = WiFiReconnectionKind::Manual;
00199     if (IsAutomaticReconnection->IsChecked->Value)
00200     {
00201         reconnectionKind = WiFiReconnectionKind::Automatic;
00202     }
00203
00204     IAsyncOperation<WiFiConnectionResult^>^ connectOperation;
00205
00206     if (selectedNetwork->AvailableNetwork->SecuritySettings->NetworkAuthenticationType == NetworkAuthenticationType::Open80211 &&
00207         selectedNetwork->AvailableNetwork->SecuritySettings->NetworkEncryptionType == NetworkEncryptionType::None)
00208     {
00209         connectOperation = _firstAdapter->ConnectAsync(selectedNetwork->AvailableNetwork, reconnectionKind);
00210     }
00211     else
00212     {
00213         // Only the password portion of the credential need to be supplied
00214         PasswordCredential^ credential = ref new PasswordCredential();
00215
00216         // Make sure Credential.Password property is not set to an empty string.
00217         // Otherwise, a System.ArgumentException will be thrown.
00218         // The default empty password string will still be passed to the ConnectAsync method,
00219         // which should return an "InvalidCredential" error
00220         if (!NetworkKey->Password->IsEmpty())
00221         {
00222             credential->Password = NetworkKey->Password;
00223         }
00224
00225         connectOperation = _firstAdapter->ConnectAsync(selectedNetwork->AvailableNetwork, reconnectionKind, credential);
00226     }
00227
00228     auto connectTask = create_task(connectOperation);
00229     connectTask.then([this, selectedNetwork](WiFiConnectionResult^ result)
00230     {
00231         if (result->ConnectionStatus == WiFiConnectionStatus::Success)
00232         {
00233             _rootPage->NotifyUser(L"Successfully connected to " + selectedNetwork->Ssid, NotifyType::StatusMessage);
00234         }
00235         else
00236         {
00237             _rootPage->NotifyUser(L"Failed to connect to " + selectedNetwork->Ssid + " ConnectionStatus = " +
00238                 WiFiNetworkDisplay::GetConnectionStatusAsString(result->ConnectionStatus), NotifyType::ErrorMessage);
00239         }
00240
00241     });
00242
00243 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileItem Member List

This is the complete list of members for FileItem, including all inherited members.
_imageData | FileItem | [private]
Date | FileItem |
DisplayName | FileItem |
FetchImageAsync() | FileItem | [inline, private]
FetchImageAsync() | FileItem | [inline, private]
FileSize | FileItem |
fromStorageFile(StorageFile f) | FileItem | [inline, private, static]
fromStorageFile(StorageFile f) | FileItem | [inline, private, static]
ImageData | FileItem |
ImageHeight | FileItem |
ImageWidth | FileItem |
Key | FileItem |
Path | FileItem |
prettyDate | FileItem |
prettyFileSize | FileItem |
prettyImageSize | FileItem |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Project.idl Source File

  • MobileHotspot
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_ConfigureMobileHotspot : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_ConfigureMobileHotspot();
00018     }
00019
00020   [default_interface]
00021     runtimeclass Scenario2_ToggleMobileHotspot : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_ToggleMobileHotspot();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SRGSConstraint.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_SRGSConstraint.xaml.h"
00014 #include "AudioCapturePermissions.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::ApplicationModel;
00021 using namespace Windows::ApplicationModel::Resources::Core;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Media::SpeechRecognition;
00025 using namespace Windows::Storage;
00026 using namespace Windows::UI;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Controls::Primitives;
00031 using namespace Windows::UI::Xaml::Data;
00032 using namespace Windows::UI::Xaml::Input;
00033 using namespace Windows::UI::Xaml::Media;
00034 using namespace Windows::UI::Xaml::Navigation;
00035
00036 Scenario_SRGSConstraint::Scenario_SRGSConstraint() : rootPage(MainPage::Current)
00037 {
00038     InitializeComponent();
00039
00040     colorLookup = ref new Map<String^, Color>(
00041     {
00042         { "COLOR_RED",   Colors::Red },    { "COLOR_BLUE",  Colors::Blue },   { "COLOR_BLACK",  Colors::Black },
00043         { "COLOR_BROWN", Colors::Brown },  { "COLOR_PURPLE",Colors::Purple }, { "COLOR_GREEN",  Colors::Green },
00044         { "COLOR_YELLOW",Colors::Yellow }, { "COLOR_CYAN",  Colors::Cyan },   { "COLOR_MAGENTA",Colors::Magenta },
00045         { "COLOR_ORANGE",Colors::Orange }, { "COLOR_GRAY",  Colors::Gray },   { "COLOR_WHITE",  Colors::White }
00046     });
00047 }
00048
00049 /// <summary>
00050 /// When activating the scenario, ensure we have permission from the user to access their microphone, and
00051 /// provide an appropriate path for the user to enable access to the microphone if they haven't
00052 /// given explicit permission for it.
00053 /// </summary>
00054 /// <param name="e">The navigation event details</param>
00055 void Scenario_SRGSConstraint::OnNavigatedTo(NavigationEventArgs^ e)
00056 {
00057     Page::OnNavigatedTo(e);
00058
00059     // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
00060     dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
00061
00062     create_task(AudioCapturePermissions::RequestMicrophonePermissionAsync(), task_continuation_context::use_current())
00063         .then([this](bool permissionGained)
00064     {
00065         if (permissionGained)
00066         {
00067             // Enable the recognition buttons.
00068             this->btnRecognizeWithUI->IsEnabled = true;
00069             this->btnRecognizeWithoutUI->IsEnabled = true;
00070
00071       Windows::Globalization::Language^ speechLanguage = SpeechRecognizer::SystemSpeechLanguage;
00072       speechContext = ResourceContext::GetForCurrentView();
00073       speechContext->Languages = ref new VectorView<String^>(1, speechLanguage->LanguageTag);
00074
00075       speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationSpeechResources");
00076
00077       PopulateLanguageDropdown();
00078       InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
00079         }
00080         else
00081         {
00082             this->resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00083             this->resultTextBlock->Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
00084       this->cbLanguageSelection->IsEnabled = false;
00085         }
00086   });
00087 }
00088
00089 /// <summary>
00090 /// Creates a SpeechRecognizer instance and initializes the grammar.
00091 /// </summary>
00092 void Scenario_SRGSConstraint::InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage)
00093 {
00094     // If reinitializing the recognizer (ie, changing the speech language), clean up the old recognizer first.
00095     // Avoid doing this while the recognizer is active by disabling the ability to change languages while listening.
00096     if (this->speechRecognizer != nullptr)
00097     {
00098         speechRecognizer->StateChanged -= stateChangedToken;
00099
00100         delete this->speechRecognizer;
00101         this->speechRecognizer = nullptr;
00102     }
00103
00104     try
00105     {
00106         // Create an instance of SpeechRecognizer.
00107         this->speechRecognizer = ref new SpeechRecognizer(recognizerLanguage);
00108
00109         // Provide feedback to the user about the state of the recognizer.
00110         stateChangedToken = speechRecognizer->StateChanged +=
00111             ref new Windows::Foundation::TypedEventHandler<
00112             SpeechRecognizer ^,
00113             SpeechRecognizerStateChangedEventArgs ^>(
00114                 this,
00115                 &Scenario_SRGSConstraint::SpeechRecognizer_StateChanged);
00116
00117         // RecognizeWithUIAsync allows developers to customize the prompts.
00118         speechRecognizer->UIOptions->ExampleText = speechResourceMap->GetValue("SRGSUIOptionsExampleText", speechContext)->ValueAsString;
00119
00120         // Initialize the SRGS-compliant XML file.
00121         // For more information about grammars for Windows apps and how to
00122         // define and use SRGS-compliant grammars in your app, see
00123         // https://msdn.microsoft.com/en-us/library/dn596121.aspx
00124         String^ fileName = L"SRGS\\" + recognizerLanguage->LanguageTag + L"\\SRGSColors.xml";
00125         resultTextBlock->Text = speechResourceMap->GetValue("SRGSHelpText", speechContext)->ValueAsString;
00126
00127         create_task(Package::Current->InstalledLocation->GetFileAsync(fileName), task_continuation_context::use_current())
00128             .then([this](task<StorageFile^> getFileTask)
00129         {
00130             StorageFile^ grammarContentFile = getFileTask.get();
00131             SpeechRecognitionGrammarFileConstraint^ grammarConstraint = ref new SpeechRecognitionGrammarFileConstraint(grammarContentFile);
00132             speechRecognizer->Constraints->Append(grammarConstraint);
00133
00134             return create_task(speechRecognizer->CompileConstraintsAsync(), task_continuation_context::use_current());
00135
00136         }).then([this](task<SpeechRecognitionCompilationResult^> previousTask)
00137         {
00138             SpeechRecognitionCompilationResult^ compilationResult = previousTask.get();
00139
00140             // Set EndSilenceTimeout to give users more time to complete speaking a phrase.
00141             TimeSpan endSilenceTime;
00142             endSilenceTime.Duration = 12000000L;
00143             speechRecognizer->Timeouts->EndSilenceTimeout = endSilenceTime; // (1.2 seconds in nanoseconds)
00144
00145             // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
00146             if (compilationResult->Status != SpeechRecognitionResultStatus::Success)
00147             {
00148                 // Disable the recognition buttons.
00149                 btnRecognizeWithUI->IsEnabled = false;
00150                 btnRecognizeWithoutUI->IsEnabled = false;
00151
00152                 // Let the user know that the grammar didn't compile properly.
00153                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00154                 resultTextBlock->Text = "Unable to compile grammar.";
00155             }
00156             else
00157             {
00158                 btnRecognizeWithUI->IsEnabled = true;
00159                 btnRecognizeWithoutUI->IsEnabled = true;
00160
00161                 // Let the user know that the grammar didn't compile properly.
00162                 resultTextBlock->Text = speechResourceMap->GetValue("SRGSHelpText", speechContext)->ValueAsString;
00163                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00164             }
00165         }, task_continuation_context::use_current());
00166     }
00167     catch (Platform::Exception^ ex)
00168     {
00169         if ((unsigned int)ex->HResult == HResultRecognizerNotFound)
00170         {
00171             btnRecognizeWithUI->IsEnabled = false;
00172             btnRecognizeWithoutUI->IsEnabled = false;
00173
00174             resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00175             resultTextBlock->Text = L"Speech Language pack for selected language not installed.";
00176         }
00177         else
00178         {
00179             auto messageDialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Exception");
00180             create_task(messageDialog->ShowAsync());
00181         }
00182     }
00183 }
00184
00185 /// <summary>
00186 /// Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.
00187 /// </summary>
00188 /// <param name="e">Details about the navigation event</param>
00189 void Scenario_SRGSConstraint::OnNavigatedFrom(NavigationEventArgs^ e)
00190 {
00191     Page::OnNavigatedFrom(e);
00192
00193     if (speechRecognizer != nullptr)
00194     {
00195         speechRecognizer->StateChanged -= stateChangedToken;
00196
00197         delete speechRecognizer;
00198         speechRecognizer = nullptr;
00199     }
00200 }
00201
00202 /// <summary>
00203 /// Begin Recognition with RecognizeWithUI, then update the UI with the results.
00204 /// </summary>
00205 void Scenario_SRGSConstraint::RecognizeWithUI_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00206 {
00207     // Reset the text to prompt the user.
00208     resultTextBlock->Text = speechResourceMap->GetValue("SRGSListeningPromptText", speechContext)->ValueAsString;
00209
00210
00211     // Start recognition.
00212     create_task(speechRecognizer->RecognizeWithUIAsync(), task_continuation_context::use_current())
00213         .then([this](task<SpeechRecognitionResult^> recognitionTask)
00214     {
00215         try
00216         {
00217             SpeechRecognitionResult^ speechRecognitionResult = recognitionTask.get();
00218             if (speechRecognitionResult->Status == SpeechRecognitionResultStatus::Success)
00219             {
00220                 HandleRecognitionResult(speechRecognitionResult);
00221             }
00222             else
00223             {
00224                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00225                 resultTextBlock->Text = L"Speech Recognition Failure, Status: " + speechRecognitionResult->Status.ToString();
00226             }
00227         }
00228         catch (ObjectDisposedException^ exception)
00229         {
00230             // ObjectDisposedException will be thrown if you exit the scenario while the recogizer is actively
00231             // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00232             // show a message dialog for this exception.
00233             OutputDebugString(L"ObjectDisposedException caught while recognition in progress (can be ignored):");
00234             OutputDebugString(exception->ToString()->Data());
00235         }
00236         catch (Exception^ exception)
00237         {
00238             // Handle the speech privacy policy error.
00239             if ((unsigned int)exception->HResult == Scenario_SRGSConstraint::HResultPrivacyStatementDeclined)
00240             {
00241                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00242                 resultTextBlock->Text = "The privacy statement was declined. Go to Settings -> Privacy -> Speech, inking and typing, and ensure you have viewed the privacy policy, and Cortana is set to 'Get To Know You'";
00243             }
00244             else
00245             {
00246                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00247                 create_task(messageDialog->ShowAsync());
00248             }
00249         }
00250     });
00251 }
00252
00253 /// <summary>
00254 /// Uses the recognizer constructed earlier to listen for speech from the user before displaying
00255 /// it back on the screen. Uses developer-provided UI for user feedback.
00256 /// </summary>
00257 /// <param name="sender">Button that triggered this event</param>
00258 /// <param name="e">State information about the routed event</param>
00259 void Scenario_SRGSConstraint::RecognizeWithoutUI_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00260 {
00261     // Reset the text to prompt the user.
00262     resultTextBlock->Text = speechResourceMap->GetValue("SRGSListeningPromptText", speechContext)->ValueAsString;
00263
00264     // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
00265     btnRecognizeWithUI->IsEnabled = false;
00266     btnRecognizeWithoutUI->IsEnabled = false;
00267     cbLanguageSelection->IsEnabled = false;
00268     listenWithoutUIButtonText->Text = " listening for speech...";
00269
00270     // Start recognition.
00271     create_task(speechRecognizer->RecognizeAsync(), task_continuation_context::use_current())
00272         .then([this](task<SpeechRecognitionResult^> recognitionTask)
00273     {
00274         try
00275         {
00276             SpeechRecognitionResult^ speechRecognitionResult = recognitionTask.get();
00277             if (speechRecognitionResult->Status == SpeechRecognitionResultStatus::Success)
00278             {
00279                 HandleRecognitionResult(speechRecognitionResult);
00280             }
00281             else
00282             {
00283                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00284                 resultTextBlock->Text = L"Speech Recognition Failure, Status: " + speechRecognitionResult->Status.ToString();
00285             }
00286
00287             // Reset UI state.
00288             listenWithoutUIButtonText->Text = " without UI";
00289             btnRecognizeWithUI->IsEnabled = true;
00290             btnRecognizeWithoutUI->IsEnabled = true;
00291             cbLanguageSelection->IsEnabled = true;
00292         }
00293         catch (ObjectDisposedException^ exception)
00294         {
00295             // ObjectDisposedException will be thrown if you exit the scenario while the recogizer is actively
00296             // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00297             // show a message dialog for this exception.
00298             OutputDebugString(L"ObjectDisposedException caught while recognition in progress (can be ignored):");
00299             OutputDebugString(exception->ToString()->Data());
00300         }
00301         catch (Exception^ exception)
00302         {
00303             // Handle the speech privacy policy error.
00304             if ((unsigned int)exception->HResult == Scenario_SRGSConstraint::HResultPrivacyStatementDeclined)
00305             {
00306                 resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00307                 resultTextBlock->Text = "The privacy statement was declined. Go to Settings -> Privacy -> Speech, inking and typing, and ensure you have viewed the privacy policy, and Cortana is set to 'Get To Know You'";
00308             }
00309             else
00310             {
00311                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00312                 create_task(messageDialog->ShowAsync());
00313             }
00314         }
00315     });
00316 }
00317
00318 /// <summary>
00319 /// Handle SpeechRecognizer state changed events by updating a UI component.
00320 /// </summary>
00321 /// <param name="sender">Speech recognizer that generated this status event</param>
00322 /// <param name="args">The recognizer's status</param>
00323 void Scenario_SRGSConstraint::SpeechRecognizer_StateChanged(SpeechRecognizer ^sender, SpeechRecognizerStateChangedEventArgs ^args)
00324 {
00325     dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00326     {
00327         rootPage->NotifyUser("Speech recognizer state: " + args->State.ToString(), NotifyType::StatusMessage);
00328     }));
00329
00330 }
00331
00332 /// <summary>
00333 /// Uses the result from the speech recognizer to change the colors of the shapes.
00334 /// </summary>
00335 /// <param name="recoResult">The result from the recognition event</param>
00336 void Scenario_SRGSConstraint::HandleRecognitionResult(SpeechRecognitionResult^ recoResult)
00337 {
00338     if (recoResult->Confidence == SpeechRecognitionConfidence::High ||
00339         recoResult->Confidence == SpeechRecognitionConfidence::Medium)
00340     {
00341         String^ garbagePrompt = "";
00342
00343
00344         // BACKGROUND: Check to see if the recognition result contains the semantic key for the background color,
00345         // and not a match for the GARBAGE rule, and change the color.
00346         if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_BACKGROUND") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_BACKGROUND")->GetAt(0) != "...")
00347         {
00348             String^ backgroundColor = recoResult->SemanticInterpretation->Properties->Lookup("KEY_BACKGROUND")->GetAt(0);
00349             colorRectangle->Fill = ref new SolidColorBrush(getColor(backgroundColor));
00350         }
00351
00352         // If "background" was matched, but the color rule matched GARBAGE, prompt the user.
00353         else if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_BACKGROUND") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_BACKGROUND")->GetAt(0) == "...")
00354         {
00355             garbagePrompt += speechResourceMap->GetValue("SRGSBackgroundGarbagePromptText", speechContext)->ValueAsString;
00356             resultTextBlock->Text = garbagePrompt;
00357         }
00358
00359         // BORDER: Check to see if the recognition result contains the semantic key for the border color,
00360         // and not a match for the GARBAGE rule, and change the color.
00361         if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_BORDER") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_BORDER")->GetAt(0) != "...")
00362         {
00363             String^ borderColor = recoResult->SemanticInterpretation->Properties->Lookup("KEY_BORDER")->GetAt(0);
00364             colorRectangle->Stroke = ref new SolidColorBrush(getColor(borderColor));
00365         }
00366
00367         // If "border" was matched, but the color rule matched GARBAGE, prompt the user.
00368         else if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_BORDER") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_BORDER")->GetAt(0) == "...")
00369         {
00370             garbagePrompt += speechResourceMap->GetValue("SRGSBorderGarbagePromptText", speechContext)->ValueAsString;
00371             resultTextBlock->Text = garbagePrompt;
00372         }
00373
00374         // CIRCLE: Check to see if the recognition result contains the semantic key for the circle color,
00375         // and not a match for the GARBAGE rule, and change the color.
00376         if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_CIRCLE") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_CIRCLE")->GetAt(0) != "...")
00377         {
00378             String^ circleColor = recoResult->SemanticInterpretation->Properties->Lookup("KEY_CIRCLE")->GetAt(0);
00379             colorCircle->Fill = ref new SolidColorBrush(getColor(circleColor));
00380         }
00381
00382         // If "circle" was matched, but the color rule matched GARBAGE, prompt the user.
00383         else if (recoResult->SemanticInterpretation->Properties->HasKey("KEY_CIRCLE") && recoResult->SemanticInterpretation->Properties->Lookup("KEY_CIRCLE")->GetAt(0) == "...")
00384         {
00385             garbagePrompt += speechResourceMap->GetValue("SRGSCircleGarbagePromptText", speechContext)->ValueAsString;
00386             resultTextBlock->Text = garbagePrompt;
00387         }
00388
00389         // Initialize a string that will describe the user's color choices.
00390         String^ textBoxColors = "You selected (Semantic Interpretation) -> \n";
00391
00392         std::for_each(begin(recoResult->SemanticInterpretation->Properties),
00393             end(recoResult->SemanticInterpretation->Properties),
00394             [&](IKeyValuePair<String^, IVectorView<String^>^>^ child)
00395         {
00396             // Check to see if any of the semantic values in recognition result contains a match for the GARBAGE rule.
00397             if (!child->Value->Equals("..."))
00398             {
00399                 textBoxColors += child->Value->GetAt(0) + " ";
00400                 if (child->Key != nullptr)
00401                 {
00402                     textBoxColors += child->Key;
00403                 }
00404                 else
00405                 {
00406                     textBoxColors += "null";
00407                 }
00408                 textBoxColors += "\n";
00409
00410                 resultTextBlock->Text = textBoxColors;
00411             }
00412
00413             // If there was no match to the colors rule or if it matched GARBAGE, prompt the user.
00414             else
00415             {
00416                 resultTextBlock->Text = garbagePrompt;
00417             }
00418         });
00419     }
00420     else
00421     {
00422         resultTextBlock->Text = speechResourceMap->GetValue("SRGSGarbagePromptText", speechContext)->ValueAsString;
00423     }
00424 }
00425
00426 /// <summary>
00427 /// Creates a color object from the passed in string.
00428 /// </summary>
00429 /// <param name="colorString">The name of the color</param>
00430 Windows::UI::Color Scenario_SRGSConstraint::getColor(Platform::String^ colorString)
00431 {
00432     Color newColor = Colors::Transparent;
00433
00434     if (colorLookup->HasKey(colorString))
00435     {
00436         newColor = colorLookup->Lookup(colorString);
00437     }
00438
00439     return newColor;
00440 }
00441
00442 /// <summary>
00443 /// Populate language dropdown with supported Dictation languages.
00444 /// </summary>
00445 void Scenario_SRGSConstraint::PopulateLanguageDropdown()
00446 {
00447     // disable callback temporarily.
00448     isPopulatingLanguages = true;
00449
00450     Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
00451     auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
00452     for (Windows::Globalization::Language^ lang : supportedLanguages)
00453     {
00454         ComboBoxItem^ item = ref new ComboBoxItem();
00455         item->Tag = lang;
00456         item->Content = lang->DisplayName;
00457
00458         cbLanguageSelection->Items->Append(item);
00459         if (lang->LanguageTag == defaultLanguage->LanguageTag)
00460         {
00461             item->IsSelected = true;
00462             cbLanguageSelection->SelectedItem = item;
00463         }
00464     }
00465
00466     isPopulatingLanguages = false;
00467 }
00468
00469
00470 /// <summary>
00471 /// Re-initialize the recognizer based on selections from the language combobox.
00472 /// </summary>
00473 void Scenario_SRGSConstraint::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00474 {
00475     if (isPopulatingLanguages)
00476     {
00477         return;
00478     }
00479
00480     ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
00481     Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
00482
00483     if (this->speechRecognizer != nullptr)
00484     {
00485         if (speechRecognizer->CurrentLanguage == newLanguage)
00486         {
00487             return;
00488         }
00489     }
00490
00491     try
00492     {
00493         speechContext->Languages = ref new VectorView<String^>(1, newLanguage->LanguageTag);
00494
00495         InitializeRecognizer(newLanguage);
00496     }
00497     catch (Exception^ exception)
00498     {
00499         auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00500         create_task(messageDialog->ShowAsync());
00501     }
00502 }
Generated on Fri Nov 15 2024 22:21:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario12.xaml.h Source File

  • MapControl
  • cpp

Scenario12.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario12.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario12 sealed
00021     {
00022     public:
00023         Scenario12();
00024     private:
00025         MainPage ^ rootPage = MainPage::Current;
00026
00027         std::vector<Platform::String^> urls;
00028         Windows::UI::Xaml::Controls::Maps::MapTileSource^ httpTileSource;
00029
00030         void MyMapLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void AddAnimatedTilesClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void ClearMapClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void HttpMapTileDataSourceUriRequested(Windows::UI::Xaml::Controls::Maps::HttpMapTileDataSource^ sender, Windows::UI::Xaml::Controls::Maps::MapTileUriRequestedEventArgs^ e);
00034         void PlayAnimationTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
00035         void PauseAnimationTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
00036         void StopAnimationTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/QuadRenderer.h Source File

  • HolographicTagAlong
  • cpp
  • Content

QuadRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "..\Common\DeviceResources.h"
00015 #include "..\Common\StepTimer.h"
00016 #include "ShaderStructures.h"
00017
00018 namespace HolographicTagAlongSample
00019 {
00020     // This sample renderer instantiates a basic rendering pipeline.
00021     class QuadRenderer
00022     {
00023     public:
00024         QuadRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00025         void CreateDeviceDependentResources();
00026         void ReleaseDeviceDependentResources();
00027         void Update(const DX::StepTimer& timer);
00028         void Render(ID3D11ShaderResourceView* texture);
00029         void Render();
00030
00031         void StartFadeIn();
00032         void StartFadeOut();
00033
00034         // Repositions the sample hologram.
00035         void UpdateHologramPosition(Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose, const DX::StepTimer& timer);
00036
00037         // Property accessors.
00038         void ResetPosition(Windows::Foundation::Numerics::float3 pos) {
00039             m_lastPosition = pos;
00040             m_position = pos;
00041         }
00042         const Windows::Foundation::Numerics::float3& GetPosition() const { return m_position; }
00043         const Windows::Foundation::Numerics::float3& GetVelocity() const { return m_velocity; }
00044
00045     private:
00046         // Cached pointer to device resources.
00047         std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00048
00049         // Direct3D resources for quad geometry.
00050         Microsoft::WRL::ComPtr<ID3D11InputLayout>           m_inputLayout;
00051         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_vertexBuffer;
00052         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_indexBuffer;
00053         Microsoft::WRL::ComPtr<ID3D11VertexShader>          m_vertexShader;
00054         Microsoft::WRL::ComPtr<ID3D11GeometryShader>        m_geometryShader;
00055         Microsoft::WRL::ComPtr<ID3D11PixelShader>           m_pixelShader;
00056         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_modelConstantBuffer;
00057
00058         // Direct3D resources for the default texture.
00059         Microsoft::WRL::ComPtr<ID3D11Resource>              m_quadTexture;
00060         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_quadTextureView;
00061         Microsoft::WRL::ComPtr<ID3D11SamplerState>          m_quadTextureSamplerState;
00062
00063         // System resources for quad geometry.
00064         ModelConstantBuffer                                 m_modelConstantBufferData;
00065         uint32                                              m_indexCount = 0;
00066
00067         // Variables used with the rendering loop.
00068         bool                                                m_loadingComplete = false;
00069         float                                               m_degreesPerSecond = 45.f;
00070         Windows::Foundation::Numerics::float3               m_position = { 0.f, 0.f, -2.f };
00071         Windows::Foundation::Numerics::float3               m_lastPosition = { 0.f, 0.f, -2.f };
00072         Windows::Foundation::Numerics::float3               m_velocity = { 0.f, 0.f,  0.f };
00073
00074         // If the current D3D Device supports VPRT, we can avoid using a geometry
00075         // shader just to set the render target array index.
00076         bool                                                m_usingVprtShaders = false;
00077
00078         // This is the rate at which the hologram position is interpolated (LERPed) to the current location.
00079         const float                                         c_lerpRate = 4.0f;
00080
00081         // Number of seconds it takes to fade the hologram in, or out.
00082         const float                                         c_maxFadeTime = 1.f;
00083
00084         // Timer used to fade the hologram in, or out.
00085         float                                               m_fadeTime = 0.f;
00086
00087         // Whether or not the hologram is fading in, or out.
00088         bool                                                m_fadingIn = false;
00089     };
00090 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Audio Member List

This is the complete list of members for Audio, including all inherited members.
Audio() | Audio |
CreateDeviceIndependentResources() | Audio |
Initialize() | Audio |
m_audioAvailable | Audio | [private]
m_musicEngine | Audio | [private]
m_musicMasteringVoice | Audio | [private]
m_soundEffectEngine | Audio | [private]
m_soundEffectMasteringVoice | Audio | [private]
MusicEngine() | Audio |
ResumeAudio() | Audio |
SoundEffectEngine() | Audio |
SuspendAudio() | Audio |
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario2_Settings.h Source File

  • ApplicationData
  • cppwinrt

Scenario2_Settings.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Settings.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Settings : Scenario2_SettingsT<Scenario2_Settings>
00020     {
00021         Scenario2_Settings();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         void WriteSetting_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void DeleteSetting_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027     private:
00028
00029         void DisplayOutput();
00030
00031         Windows::Storage::ApplicationDataContainer localSettings = Windows::Storage::ApplicationData::Current().LocalSettings();
00032
00033         inline static const auto SettingName = L"exampleSetting";
00034     };
00035 }
00036
00037 namespace winrt::SDKTemplate::factory_implementation
00038 {
00039     struct Scenario2_Settings : Scenario2_SettingsT<Scenario2_Settings, implementation::Scenario2_Settings>
00040     {
00041     };
00042 }
00043
Generated on Fri Nov 15 2024 22:17:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/FrameRenderer.cpp Source File

  • CameraStreamCorrelation
  • cpp

FrameRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <MemoryBuffer.h>
00014 #include "FrameRenderer.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace concurrency;
00019 using namespace Platform;
00020 using namespace Microsoft::WRL;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Numerics;
00023 using namespace Windows::Graphics::Imaging;
00024 using namespace Windows::Media::Capture::Frames;
00025 using namespace Windows::Media::Devices::Core;
00026 using namespace Windows::Perception::Spatial;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Media::Imaging;
00029
00030 #pragma region Low-level operations on reference pointers
00031
00032 // InterlockedExchange for reference pointer types.
00033 template<typename T, typename U>
00034 T^ InterlockedExchangeRefPointer(T^* target, U value)
00035 {
00036     static_assert(sizeof(T^) == sizeof(void*), "InterlockedExchangePointer is the wrong size");
00037     T^ exchange = value;
00038     void** rawExchange = reinterpret_cast<void**>(&exchange);
00039     void** rawTarget = reinterpret_cast<void**>(target);
00040     *rawExchange = static_cast<IInspectable*>(InterlockedExchangePointer(rawTarget, *rawExchange));
00041     return exchange;
00042 }
00043
00044 // Convert a reference pointer to a specific ComPtr.
00045 template<typename T>
00046 Microsoft::WRL::ComPtr<T> AsComPtr(Platform::Object^ object)
00047 {
00048     Microsoft::WRL::ComPtr<T> p;
00049     reinterpret_cast<IUnknown*>(object)->QueryInterface(IID_PPV_ARGS(&p));
00050     return p;
00051 }
00052
00053 #pragma endregion
00054
00055 // Structure used to access colors stored in 8-bit BGRA format.
00056 struct ColorBGRA
00057 {
00058     byte B, G, R, A;
00059 };
00060
00061 FrameRenderer::FrameRenderer(Image^ imageElement)
00062 {
00063     m_imageElement = imageElement;
00064     m_imageElement->Source = ref new SoftwareBitmapSource();
00065 }
00066
00067 task<void> FrameRenderer::DrainBackBufferAsync()
00068 {
00069     // Keep draining frames from the backbuffer until the backbuffer is empty.
00070     SoftwareBitmap^ latestBitmap = InterlockedExchangeRefPointer(&m_backBuffer, nullptr);
00071     if (latestBitmap != nullptr)
00072     {
00073         if (SoftwareBitmapSource^ imageSource = dynamic_cast<SoftwareBitmapSource^>(m_imageElement->Source))
00074         {
00075             return create_task(imageSource->SetBitmapAsync(latestBitmap))
00076                 .then([this]()
00077             {
00078                 return DrainBackBufferAsync();
00079             }, task_continuation_context::use_current());
00080         }
00081     }
00082
00083     // To avoid a race condition against ProcessFrame, we cannot let any other
00084     // tasks run on the UI thread between point that the InterlockedExchangeRefPointer
00085     // reports that there is no more work, and we clear the m_taskRunning flag on
00086     // the UI thread.
00087     m_taskRunning = false;
00088
00089     return task_from_result();
00090 }
00091
00092 void FrameRenderer::ProcessColorFrame(MediaFrameReference^ colorFrame)
00093 {
00094     if (colorFrame == nullptr)
00095     {
00096         return;
00097     }
00098
00099     SoftwareBitmap^ inputBitmap = colorFrame->VideoMediaFrame->SoftwareBitmap;
00100
00101     if (inputBitmap == nullptr)
00102     {
00103         return;
00104     }
00105
00106     // If the input bitmap is in the correct format, copy it and then buffer it for rendering.
00107     if ((inputBitmap->BitmapPixelFormat == BitmapPixelFormat::Bgra8) &&
00108         (inputBitmap->BitmapAlphaMode == BitmapAlphaMode::Premultiplied))
00109     {
00110         BufferBitmapForRendering(SoftwareBitmap::Copy(inputBitmap));
00111     }
00112     // Otherwise, convert the bitmap to the correct format before buffering it for rendering.
00113     else
00114     {
00115         BufferBitmapForRendering(SoftwareBitmap::Convert(inputBitmap, BitmapPixelFormat::Bgra8, BitmapAlphaMode::Premultiplied));
00116     }
00117 }
00118
00119 void FrameRenderer::ProcessDepthAndColorFrames(MediaFrameReference^ colorFrame, MediaFrameReference^ depthFrame)
00120 {
00121     if (colorFrame == nullptr || depthFrame == nullptr)
00122     {
00123         return;
00124     }
00125
00126     // Create the coordinate mapper used to map depth pixels from depth space to color space.
00127     DepthCorrelatedCoordinateMapper^ coordinateMapper = depthFrame->VideoMediaFrame->DepthMediaFrame->TryCreateCoordinateMapper(
00128         colorFrame->VideoMediaFrame->CameraIntrinsics, colorFrame->CoordinateSystem);
00129
00130     if (coordinateMapper == nullptr)
00131     {
00132         return;
00133     }
00134
00135     // Map the depth image to color space and buffer the result for rendering.
00136     SoftwareBitmap^ softwareBitmap = MapDepthToColor(
00137         colorFrame->VideoMediaFrame,
00138         depthFrame->VideoMediaFrame,
00139         colorFrame->VideoMediaFrame->CameraIntrinsics,
00140         colorFrame->CoordinateSystem,
00141         coordinateMapper);
00142
00143     if (softwareBitmap)
00144     {
00145         BufferBitmapForRendering(softwareBitmap);
00146     }
00147 }
00148
00149 void FrameRenderer::BufferBitmapForRendering(SoftwareBitmap^ softwareBitmap)
00150 {
00151     if (softwareBitmap != nullptr)
00152     {
00153         // Swap the processed frame to _backBuffer, and trigger the UI thread to render it.
00154         softwareBitmap = InterlockedExchangeRefPointer(&m_backBuffer, softwareBitmap);
00155
00156         // UI thread always resets m_backBuffer before using it. Unused bitmap should be disposed.
00157         delete softwareBitmap;
00158
00159         // Changes to the XAML ImageElement must happen in the UI thread, via the CoreDispatcher.
00160         m_imageElement->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
00161             ref new Windows::UI::Core::DispatchedHandler([this]()
00162         {
00163             // Don't let two copies of this task run at the same time.
00164             if (m_taskRunning)
00165             {
00166                 return;
00167             }
00168
00169             m_taskRunning = true;
00170
00171             // Keep draining frames from the backbuffer until the backbuffer is empty.
00172             DrainBackBufferAsync();
00173         }));
00174     }
00175 }
00176
00177 SoftwareBitmap^ FrameRenderer::MapDepthToColor(
00178     VideoMediaFrame^ colorFrame,
00179     VideoMediaFrame^ depthFrame,
00180     CameraIntrinsics^ colorCameraIntrinsics,
00181     SpatialCoordinateSystem^ colorCoordinateSystem,
00182     DepthCorrelatedCoordinateMapper^ coordinateMapper)
00183 {
00184     SoftwareBitmap^ inputBitmap = colorFrame->SoftwareBitmap;
00185     SoftwareBitmap^ outputBitmap;
00186
00187     // Copy the color input bitmap so we may overlay the depth bitmap on top of it.
00188     if ((inputBitmap->BitmapPixelFormat == BitmapPixelFormat::Bgra8) &&
00189         (inputBitmap->BitmapAlphaMode == BitmapAlphaMode::Premultiplied))
00190     {
00191         outputBitmap = SoftwareBitmap::Copy(inputBitmap);
00192     }
00193     else
00194     {
00195         outputBitmap = SoftwareBitmap::Convert(inputBitmap, BitmapPixelFormat::Bgra8, BitmapAlphaMode::Premultiplied);
00196     }
00197
00198     // Create buffers used to access pixels.
00199     BitmapBuffer^ depthBuffer = depthFrame->SoftwareBitmap->LockBuffer(BitmapBufferAccessMode::Read);
00200     BitmapBuffer^ colorBuffer = colorFrame->SoftwareBitmap->LockBuffer(BitmapBufferAccessMode::Read);
00201     BitmapBuffer^ outputBuffer = outputBitmap->LockBuffer(BitmapBufferAccessMode::Write);
00202
00203     if (depthBuffer == nullptr || colorBuffer == nullptr || outputBuffer == nullptr)
00204     {
00205         return nullptr;
00206     }
00207
00208     BitmapPlaneDescription colorDesc = colorBuffer->GetPlaneDescription(0);
00209     UINT32 colorWidth = static_cast<UINT32>(colorDesc.Width);
00210     UINT32 colorHeight = static_cast<UINT32>(colorDesc.Height);
00211
00212     IMemoryBufferReference^ depthReference = depthBuffer->CreateReference();
00213     IMemoryBufferReference^ outputReference = outputBuffer->CreateReference();
00214
00215     byte* depthBytes = nullptr;
00216     UINT32 depthCapacity;
00217
00218     byte* outputBytes = nullptr;
00219     UINT32 outputCapacity;
00220
00221     AsComPtr<IMemoryBufferByteAccess>(depthReference)->GetBuffer(&depthBytes, &depthCapacity);
00222     AsComPtr<IMemoryBufferByteAccess>(outputReference)->GetBuffer(&outputBytes, &outputCapacity);
00223
00224     if (depthBytes == nullptr || outputBytes == nullptr)
00225     {
00226         return nullptr;
00227     }
00228
00229     ColorBGRA* outputPixels = reinterpret_cast<ColorBGRA*>(outputBytes);
00230
00231     {
00232         // Ensure synchronous read/write access to point buffer cache.
00233         std::lock_guard<std::mutex> guard(m_pointBufferMutex);
00234
00235         // If we don't have point arrays, or the ones we have are the wrong dimensions,
00236         // then create new ones.
00237         Array<Point>^ colorSpacePoints = m_colorSpacePoints;
00238         if (colorSpacePoints == nullptr ||
00239             m_previousBufferWidth != colorWidth ||
00240             m_previousBufferHeight != colorHeight)
00241         {
00242             colorSpacePoints = ref new Array<Point>(colorWidth * colorHeight);
00243
00244             // Prepare array of points we want mapped.
00245             for (UINT y = 0; y < colorHeight; y++)
00246             {
00247                 for (UINT x = 0; x < colorWidth; x++)
00248                 {
00249                     colorSpacePoints[y * colorWidth + x] = Point(static_cast<float>(x), static_cast<float>(y));
00250                 }
00251             }
00252         }
00253
00254         Array<float3>^ depthSpacePoints = m_depthSpacePoints;
00255         if (depthSpacePoints == nullptr ||
00256             m_previousBufferWidth != colorWidth ||
00257             m_previousBufferHeight != colorHeight)
00258         {
00259             depthSpacePoints = ref new Array<float3>(colorWidth * colorHeight);
00260         }
00261
00262         // Save the (possibly updated) values now that they are all known to be good.
00263         m_colorSpacePoints = colorSpacePoints;
00264         m_depthSpacePoints = depthSpacePoints;
00265         m_previousBufferWidth = colorWidth;
00266         m_previousBufferHeight = colorHeight;
00267
00268         // Unproject depth points to color image.
00269         coordinateMapper->UnprojectPoints(
00270             m_colorSpacePoints, colorCoordinateSystem, m_depthSpacePoints);
00271
00272         constexpr float depthFadeStart = 1;
00273         constexpr float depthFadeEnd = 1.5;
00274
00275         // Using the depth values we fade the color pixels of the ouput if they are too far away.
00276         for (UINT y = 0; y < colorHeight; y++)
00277         {
00278             for (UINT x = 0; x < colorWidth; x++)
00279             {
00280                 UINT index = y * colorWidth + x;
00281
00282                 // The z value of each depth space point contains the depth value of the point.
00283                 // This value is mapped to a fade value. Fading starts at depthFadeStart meters
00284                 // and is completely black by depthFadeEnd meters.
00285                 float fadeValue = 1 - max(0, min(((m_depthSpacePoints[index].z - depthFadeStart) / (depthFadeEnd - depthFadeStart)), 1));
00286
00287                 outputPixels[index].R = static_cast<byte>(static_cast<float>(outputPixels[index].R) * fadeValue);
00288                 outputPixels[index].G = static_cast<byte>(static_cast<float>(outputPixels[index].G) * fadeValue);
00289                 outputPixels[index].B = static_cast<byte>(static_cast<float>(outputPixels[index].B) * fadeValue);
00290             }
00291         }
00292     }
00293
00294     return outputBitmap;
00295 }
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cs/Scenario1_TrimAndSaveClip.xaml.cs Source File

  • MediaEditing
  • cs

Scenario1_TrimAndSaveClip.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Foundation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.Storage;
00019 using Windows.Media.Editing;
00020 using Windows.Media.Transcoding;
00021 using Windows.UI.Core;
00022 using SDKTemplate;
00023 using Windows.Storage.AccessCache;
00024 using Windows.Media.Core;
00025
00026 namespace MediaEditingSample
00027 {
00028     public sealed partial class Scenario1_TrimAndSaveClip : Page
00029     {
00030         private StorageItemAccessList storageItemAccessList;
00031         private MainPage rootPage;
00032         private MediaComposition composition;
00033         private StorageFile pickedFile;
00034         private MediaStreamSource mediaStreamSource;
00035
00036         public Scenario1_TrimAndSaveClip()
00037         {
00038             this.InitializeComponent();
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             rootPage = MainPage.Current;
00044
00045             // Make sure we don't run out of entries in StoreItemAccessList.
00046             // As we don't need to persist this across app sessions/pages, clearing
00047             // every time should be sufficient for us.
00048             storageItemAccessList = StorageApplicationPermissions.FutureAccessList;
00049             storageItemAccessList.Clear();
00050         }
00051
00052         protected override void OnNavigatedFrom(NavigationEventArgs e)
00053         {
00054             mediaElement.Source = null;
00055             mediaStreamSource = null;
00056             base.OnNavigatedFrom(e);
00057         }
00058
00059         private async void ChooseFile_Click(object sender, RoutedEventArgs e)
00060         {
00061             // Get file
00062             var picker = new Windows.Storage.Pickers.FileOpenPicker();
00063             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
00064             picker.FileTypeFilter.Add(".mp4");
00065             pickedFile = await picker.PickSingleFileAsync();
00066             if (pickedFile == null)
00067             {
00068                 rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
00069                 return;
00070             }
00071
00072             // These files could be picked from a location that we won't have access to later
00073             // (especially if persisting the MediaComposition to disk and loading it later).
00074             // Use the StorageItemAccessList in order to keep access permissions to that
00075             // file for later use. Be aware that this access list needs to be cleared
00076             // periodically or the app will run out of entries.
00077             storageItemAccessList.Add(pickedFile);
00078
00079             mediaElement.SetSource(await pickedFile.OpenReadAsync(), pickedFile.ContentType);
00080             trimClip.IsEnabled = true;
00081         }
00082
00083         private async void TrimClip_Click(object sender, RoutedEventArgs e)
00084         {
00085             // Trim the front and back 25% from the clip
00086             var clip = await MediaClip.CreateFromFileAsync(pickedFile);
00087             clip.TrimTimeFromStart = new TimeSpan((long)(clip.OriginalDuration.Ticks * 0.25));
00088             clip.TrimTimeFromEnd = new TimeSpan((long)(clip.OriginalDuration.Ticks * 0.25));
00089
00090             // Create a MediaComposition containing the clip and set it on the MediaElement.
00091             composition = new MediaComposition();
00092             composition.Clips.Add(clip);
00093             mediaElement.Position = TimeSpan.Zero;
00094             mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
00095             mediaElement.SetMediaStreamSource(mediaStreamSource);
00096             rootPage.NotifyUser("Clip trimmed", NotifyType.StatusMessage);
00097             save.IsEnabled = true;
00098         }
00099
00100         private async void Save_Click(object sender, RoutedEventArgs e)
00101         {
00102             EnableButtons(false);
00103             rootPage.NotifyUser("Requesting file to save to", NotifyType.StatusMessage);
00104
00105             var picker = new Windows.Storage.Pickers.FileSavePicker();
00106             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
00107             picker.FileTypeChoices.Add("MP4 files", new List<string>() { ".mp4" });
00108             picker.SuggestedFileName = "TrimmedClip.mp4";
00109
00110             StorageFile file = await picker.PickSaveFileAsync();
00111             if (file != null)
00112             {
00113                 var saveOperation = composition.RenderToFileAsync(file, MediaTrimmingPreference.Precise);
00114                 saveOperation.Progress = new AsyncOperationProgressHandler<TranscodeFailureReason, double>(async (info, progress) =>
00115                 {
00116                     await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00117                     {
00118                         rootPage.NotifyUser(string.Format("Saving file... Progress: {0:F0}%", progress), NotifyType.StatusMessage);
00119                     }));
00120                 });
00121                 saveOperation.Completed = new AsyncOperationWithProgressCompletedHandler<TranscodeFailureReason, double>(async (info, status) =>
00122                 {
00123                     await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00124                     {
00125                         try
00126                         {
00127                             var results = info.GetResults();
00128                             if (results != TranscodeFailureReason.None || status != AsyncStatus.Completed)
00129                             {
00130                                 rootPage.NotifyUser("Saving was unsuccessful", NotifyType.ErrorMessage);
00131                             }
00132                             else
00133                             {
00134                                 rootPage.NotifyUser("Trimmed clip saved to file", NotifyType.StatusMessage);
00135                             }
00136                         }
00137                         finally
00138                         {
00139                             // Remember to re-enable controls on both success and failure
00140                             EnableButtons(true);
00141                         }
00142                     }));
00143                 });
00144             }
00145             else
00146             {
00147                 rootPage.NotifyUser("User cancelled the file selection", NotifyType.StatusMessage);
00148                 EnableButtons(true);
00149             }
00150         }
00151
00152         private void EnableButtons(bool isEnabled)
00153         {
00154             chooseFile.IsEnabled = isEnabled;
00155             save.IsEnabled = isEnabled;
00156             trimClip.IsEnabled = isEnabled;
00157         }
00158     }
00159 }
Generated on Fri Nov 15 2024 22:20:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/DynamicCommandBar.cs Source File

  • XamlCommanding
  • cs

DynamicCommandBar.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Diagnostics;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Foundation;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010
00011 namespace Commanding
00012 {
00013     /// <summary>
00014     /// We extend the CommandBar by adding logic to reflow commands as space is reduced
00015     /// </summary>
00016     public class DynamicCommandBar : CommandBar
00017     {
00018         public double ContentMinWidth
00019         {
00020             get { return (double)GetValue(ContentMinWidthProperty); }
00021             set { SetValue(ContentMinWidthProperty, value); }
00022         }
00023
00024         public static readonly DependencyProperty ContentMinWidthProperty =
00025             DependencyProperty.Register("ContentMinWidth", typeof(double), typeof(DynamicCommandBar), new PropertyMetadata(0.0d));
00026
00027
00028         private Button moreButton;
00029         protected override void OnApplyTemplate()
00030         {
00031             base.OnApplyTemplate();
00032             moreButton = this.GetTemplateChild("MoreButton") as Button;
00033         }
00034
00035         // Store the item and the width before moving
00036         private Stack<Tuple<ICommandBarElement, double>> overflow = new Stack<Tuple<ICommandBarElement, double>>();
00037         private Queue<Tuple<ICommandBarElement, double>> separatorQueue = new Queue<Tuple<ICommandBarElement, double>>();
00038         private double separatorQueueWidth = 0.0;
00039
00040         protected override Size MeasureOverride(Size availableSize)
00041         {
00042             var sizeToReport = base.MeasureOverride(availableSize);
00043
00044             // Account for the size of the Content area
00045             var contentWidth = this.ContentMinWidth;
00046
00047             // Account for the size of the More button
00048             var expandButtonWidth = 0.0;
00049             if (moreButton != null && moreButton.Visibility == Visibility.Visible)
00050             {
00051                 expandButtonWidth = moreButton.DesiredSize.Width;
00052             }
00053
00054             double requestedWidth = expandButtonWidth + contentWidth;
00055
00056             // Include the size of all the PrimaryCommands
00057             foreach (var cmd in this.PrimaryCommands)
00058             {
00059                 var uie = cmd as UIElement;
00060                 requestedWidth += uie.DesiredSize.Width;
00061             }
00062
00063             // First, move items to the overflow until the remaining PrimaryCommands fit
00064             for (int i = this.PrimaryCommands.Count - 1; i >= 0 && requestedWidth > availableSize.Width; i--)
00065             {
00066                 var item = this.PrimaryCommands[i];
00067                 var element = item as UIElement;
00068
00069                 if (element == null)
00070                 {
00071                     continue;
00072                 }
00073
00074                 requestedWidth -= element.DesiredSize.Width;
00075
00076                 if (this.overflow.Count == 0 && this.SecondaryCommands.Count > 0 && !(element is AppBarSeparator))
00077                 {
00078                     // Insert a separator to differentiate between the items that were already in the overflow versus
00079                     // those we moved
00080                     var abs = new AppBarSeparator();
00081                     abs.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
00082                     this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(abs, abs.DesiredSize.Width));
00083                     separatorQueueWidth += abs.DesiredSize.Width;
00084                 }
00085
00086                 this.PrimaryCommands.RemoveAt(i);
00087
00088                 // move separators we've queued up
00089                 while (separatorQueue.Count > 0)
00090                 {
00091                     var next = separatorQueue.Dequeue();
00092                     separatorQueueWidth -= next.Item2;
00093                     overflow.Push(next);
00094                     this.SecondaryCommands.Insert(0, next.Item1);
00095                 }
00096
00097                 // We store the measured size before it moves to overflow and will rely on that value
00098                 // when determining how many items to move back out the overflow.
00099                 overflow.Push(new Tuple<ICommandBarElement, double>(item, element.DesiredSize.Width));
00100
00101                 this.SecondaryCommands.Insert(0, (ICommandBarElement)element);
00102
00103                 // if a separator was adjacent to the one we removed then move the separator to our holding queue so that it doesn't appear without actually separating the content
00104                 var last = this.PrimaryCommands.LastOrDefault() as AppBarSeparator;
00105                 if (last != null)
00106                 {
00107                     this.PrimaryCommands.RemoveAt(this.PrimaryCommands.Count - 1);
00108                     this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(last, last.DesiredSize.Width));
00109                     separatorQueueWidth += last.DesiredSize.Width;
00110                     requestedWidth -= last.DesiredSize.Width;
00111                 }
00112             }
00113
00114             // Next move items out of the overflow if room is available
00115             while (overflow.Count > 0 && requestedWidth + separatorQueueWidth + overflow.Peek().Item2 <= availableSize.Width)
00116             {
00117                 var t = overflow.Pop();
00118
00119                 this.SecondaryCommands.RemoveAt(0);
00120
00121                 if (this.overflow.Count == 1 && this.SecondaryCommands.Count > 1)
00122                 {
00123                     // must be the separator injected earlier
00124                     overflow.Pop();
00125                     this.SecondaryCommands.RemoveAt(0);
00126                 }
00127
00128                 if (t.Item1 is AppBarSeparator)
00129                 {
00130                     this.separatorQueue.Enqueue(t);
00131                     separatorQueueWidth += t.Item2;
00132                     continue;
00133                 }
00134                 else
00135                 {
00136                     while (separatorQueue.Count > 0)
00137                     {
00138                         var next = separatorQueue.Dequeue();
00139                         this.PrimaryCommands.Add(next.Item1);
00140                         separatorQueueWidth -= next.Item2;
00141                         requestedWidth += next.Item2;
00142                     }
00143                 }
00144
00145                 // Sometimes this property is being set to disabled
00146                 ((Control)t.Item1).IsEnabled = true;
00147
00148                 this.PrimaryCommands.Add(t.Item1);
00149                 requestedWidth += t.Item2;
00150
00151                 // check to see if after moving this item we leave a separator at the top of the overflow
00152                 if (this.overflow.Count > 0)
00153                 {
00154                     var test = this.overflow.Peek();
00155                     if (test.Item1 is AppBarSeparator)
00156                     {
00157                         // we won't leave an orphaned separator
00158                         this.SecondaryCommands.RemoveAt(0);
00159                         var top = this.overflow.Pop();
00160
00161                         var element = top.Item1 as UIElement;
00162                         element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
00163                         this.separatorQueue.Enqueue(new Tuple<ICommandBarElement, double>(top.Item1, element.DesiredSize.Width));
00164                         separatorQueueWidth += element.DesiredSize.Width;
00165                     }
00166                 }
00167             }
00168
00169             return sizeToReport;
00170         }
00171     }
00172 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/Scenario1_DeviceUse.xaml.cpp Source File

  • BackgroundSensors
  • cpp

Scenario1_DeviceUse.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_DeviceUse.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Concurrency;
00009 using namespace Platform;
00010 using namespace Windows::ApplicationModel::Background;
00011 using namespace Windows::Devices::Sensors;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::Storage;
00015 using namespace Windows::UI::Core;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Controls::Primitives;
00019
00020 Scenario1_DeviceUse::Scenario1_DeviceUse() :
00021     rootPage(MainPage::Current),
00022     _deviceUseBackgroundTaskRegistration(nullptr),
00023     _deviceUseTrigger(nullptr),
00024     _refreshTimer(nullptr)
00025 {
00026     InitializeComponent();
00027
00028     _accelerometer = Accelerometer::GetDefault();
00029     if (nullptr != _accelerometer)
00030     {
00031         // Save trigger so that we may start the background task later.
00032         // Only one instance of the trigger can exist at a time. Since the trigger
00033         // does not implement IDisposable, it may still be in memory when a new
00034         // trigger is created.
00035         _deviceUseTrigger = ref new DeviceUseTrigger();
00036
00037         // Setup a timer to periodically refresh results when the app is visible.
00038         TimeSpan interval;
00039         interval.Duration = 1 * 10000000; // 1 second (in 100-nanosecond units)
00040
00041         _refreshTimer = ref new DispatcherTimer();
00042         _refreshTimer->Interval = interval;
00043         _refreshTimer->Tick += ref new EventHandler<Object^>(this, &Scenario1_DeviceUse::RefreshTimer_Tick);
00044
00045         // If the background task is active, start the refresh timer and activate the "Disable" button.
00046         // The "IsBackgroundTaskActive" state is set by the background task.
00047         const bool isBackgroundTaskActive =
00048             ApplicationData::Current->LocalSettings->Values->HasKey("IsBackgroundTaskActive") &&
00049             (bool)ApplicationData::Current->LocalSettings->Values->Lookup("IsBackgroundTaskActive");
00050
00051         ScenarioEnableButton->IsEnabled = !isBackgroundTaskActive;
00052         ScenarioDisableButton->IsEnabled = isBackgroundTaskActive;
00053
00054         if (isBackgroundTaskActive)
00055         {
00056             _refreshTimer->Start();
00057         }
00058
00059         // Store a setting for the background task to read
00060         ApplicationData::Current->LocalSettings->Values->Insert("IsAppVisible",
00061             dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(true)));
00062
00063         _visibilityToken = Window::Current->VisibilityChanged::add(
00064             ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DeviceUse::VisibilityChanged));
00065     }
00066     else
00067     {
00068         rootPage->NotifyUser("No accelerometer found", NotifyType::StatusMessage);
00069     }
00070 }
00071
00072 Scenario1_DeviceUse::~Scenario1_DeviceUse()
00073 {
00074     ApplicationData::Current->LocalSettings->Values->Insert("IsAppVisible",
00075         dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(false)));
00076
00077     if (nullptr != _accelerometer)
00078     {
00079         if (nullptr != Window::Current)
00080         {
00081             Window::Current->VisibilityChanged::remove(_visibilityToken);
00082         }
00083
00084         _refreshTimer->Stop();
00085
00086         // The default behavior here is to let the background task continue to run when
00087         // this scenario exits. The background task can be canceled by clicking on the "Disable"
00088         // button the next time the app is navigated to.
00089         // To cancel the background task on scenario exit, uncomment this code.
00090         // if (nullptr != _deviceUseBackgroundTaskRegistration)
00091         // {
00092         //    _deviceUseBackgroundTaskRegistration->Unregister(true);
00093         // }
00094
00095         // Unregister from the background task completion event because this object
00096         // is being destroyed (notifications will no longer be valid).
00097         if (nullptr != _deviceUseBackgroundTaskRegistration)
00098         {
00099             _deviceUseBackgroundTaskRegistration->Completed::remove(_taskCompletionToken);
00100         }
00101     }
00102 }
00103
00104 /// <summary>
00105 /// This is the event handler for VisibilityChanged events.
00106 /// </summary>
00107 /// <param name="sender"></param>
00108 /// <param name="e">
00109 /// Event data that can be examined for the current visibility state.
00110 /// </param>
00111 void Scenario1_DeviceUse::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00112 {
00113     if (ScenarioDisableButton->IsEnabled)
00114     {
00115         ApplicationData::Current->LocalSettings->Values->Insert("IsAppVisible",
00116             dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(e->Visible)));
00117
00118         if (e->Visible)
00119         {
00120             _refreshTimer->Start();
00121         }
00122         else
00123         {
00124             _refreshTimer->Stop();
00125         }
00126     }
00127 }
00128
00129 /// <summary>
00130 /// This is the click handler for the 'Enable' button.
00131 /// </summary>
00132 /// <param name="sender"></param>
00133 /// <param name="e"></param>
00134 void Scenario1_DeviceUse::ScenarioEnable(Object^ sender, RoutedEventArgs^ e)
00135 {
00136     if (nullptr != _accelerometer)
00137     {
00138         // Make sure this app is allowed to run background tasks.
00139         // RequestAccessAsync must be called on the UI thread.
00140         create_task(BackgroundExecutionManager::RequestAccessAsync())
00141             .then([this](BackgroundAccessStatus accessStatus)
00142         {
00143             if ((BackgroundAccessStatus::AlwaysAllowed == accessStatus) ||
00144                 (BackgroundAccessStatus::AllowedSubjectToSystemPolicy == accessStatus))
00145             {
00146                 try
00147                 {
00148                     create_task(StartSensorBackgroundTaskAsync(_accelerometer->DeviceId))
00149                         .then([this](task<bool> startedTask)
00150                     {
00151                         try
00152                         {
00153                             bool started = startedTask.get();
00154                             if (started)
00155                             {
00156                                 _refreshTimer->Start();
00157
00158                                 ScenarioEnableButton->IsEnabled = false;
00159                                 ScenarioDisableButton->IsEnabled = true;
00160                             }
00161                         }
00162                         catch (Exception ^ex)
00163                         {
00164                             rootPage->NotifyUser("Exception in background task: " + ex->Message,
00165                                 NotifyType::ErrorMessage);
00166                         }
00167                     });
00168                 }
00169                 catch (Exception ^ex)
00170                 {
00171                     rootPage->NotifyUser("Exception in background task: " + ex->Message,
00172                         NotifyType::ErrorMessage);
00173                 }
00174             }
00175             else
00176             {
00177                 rootPage->NotifyUser("Background tasks may be disabled for this app",
00178                     NotifyType::ErrorMessage);
00179             }
00180         });
00181     }
00182     else
00183     {
00184         rootPage->NotifyUser("No accelerometer found", NotifyType::StatusMessage);
00185     }
00186 }
00187
00188 /// <summary>
00189 /// This is the click handler for the 'Disable' button.
00190 /// </summary>
00191 /// <param name="sender"></param>
00192 /// <param name="e"></param>
00193 void Scenario1_DeviceUse::ScenarioDisable(Object^ sender, RoutedEventArgs^ e)
00194 {
00195     ScenarioEnableButton->IsEnabled = true;
00196     ScenarioDisableButton->IsEnabled = false;
00197
00198     _refreshTimer->Stop();
00199
00200     // Cancel and unregister the background task.
00201     if (nullptr != _deviceUseBackgroundTaskRegistration)
00202     {
00203         // Cancel and unregister the background task from the current app session.
00204         _deviceUseBackgroundTaskRegistration->Unregister(true);
00205         _deviceUseBackgroundTaskRegistration = nullptr;
00206     }
00207     else
00208     {
00209         // Cancel and unregister the background task from the previous app session.
00210         FindAndCancelExistingBackgroundTask();
00211     }
00212
00213     ApplicationData::Current->LocalSettings->Values->Insert("IsBackgroundTaskActive",
00214         dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(false)));
00215
00216     rootPage->NotifyUser("Background task was canceled", NotifyType::StatusMessage);
00217 }
00218
00219 /// <summary>
00220 /// Starts the sensor background task.
00221 /// </summary>
00222 /// <param name="deviceId">Device Id for the sensor to be used by the task.</param>
00223 /// <param name="e"></param>
00224 /// <returns>
00225 ///   A Concurrency::task with a boolean result indicating if the background task
00226 ///   was started successfully.
00227 /// </returns>
00228 task<bool> Scenario1_DeviceUse::StartSensorBackgroundTaskAsync(String^ deviceId)
00229 {
00230     // Make sure only 1 task is running.
00231     FindAndCancelExistingBackgroundTask();
00232
00233     // Register the background task.
00234     auto backgroundTaskBuilder = ref new BackgroundTaskBuilder();
00235     backgroundTaskBuilder->Name = SampleConstants::Scenario1_TaskName;
00236     backgroundTaskBuilder->TaskEntryPoint = SampleConstants::Scenario1_TaskEntryPoint;
00237
00238     backgroundTaskBuilder->SetTrigger(_deviceUseTrigger);
00239     _deviceUseBackgroundTaskRegistration = backgroundTaskBuilder->Register();
00240
00241     // Make sure we're notified when the task completes or if there is an update.
00242     _taskCompletionToken = _deviceUseBackgroundTaskRegistration->Completed::add(
00243         ref new BackgroundTaskCompletedEventHandler(
00244         this, &Scenario1_DeviceUse::OnBackgroundTaskCompleted));
00245
00246     try
00247     {
00248         // Request a DeviceUse task to use the accelerometer.
00249         return create_task(_deviceUseTrigger->RequestAsync(deviceId)).
00250             then([this](DeviceTriggerResult deviceTriggerResult)
00251         {
00252             bool started = false;
00253
00254             switch (deviceTriggerResult)
00255             {
00256             case DeviceTriggerResult::Allowed:
00257                 rootPage->NotifyUser("Background task started",
00258                     NotifyType::StatusMessage);
00259                 started = true;
00260                 break;
00261
00262             case DeviceTriggerResult::LowBattery:
00263                 rootPage->NotifyUser("Insufficient battery to run the background task",
00264                     NotifyType::ErrorMessage);
00265                 break;
00266
00267             case DeviceTriggerResult::DeniedBySystem:
00268                 // The system can deny a task request if the system-wide DeviceUse task limit is reached.
00269                 rootPage->NotifyUser("The system has denied the background task request",
00270                     NotifyType::ErrorMessage);
00271                 break;
00272
00273             default:
00274                 rootPage->NotifyUser("Could not start the background task: " +
00275                     deviceTriggerResult.ToString(), NotifyType::ErrorMessage);
00276                 break;
00277             }
00278
00279             return started;
00280         });
00281     }
00282     catch (Platform::COMException^ e)
00283     {
00284         if (0x8000000E == e->HResult) // HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION)
00285         {
00286             rootPage->NotifyUser("A previous background task is still running, please wait for it to exit",
00287                 NotifyType::ErrorMessage);
00288
00289             FindAndCancelExistingBackgroundTask();
00290
00291             return task<bool>([]()
00292             {
00293                 return false;
00294             });
00295         }
00296         else
00297         {
00298             throw e; // let other exceptions bubble up.
00299         }
00300     }
00301 }
00302
00303 /// <summary>
00304 /// Finds a previously registered background task for this scenario and cancels it (if present)
00305 /// </summary>
00306 void Scenario1_DeviceUse::FindAndCancelExistingBackgroundTask()
00307 {
00308     auto backgroundTaskIter = BackgroundTaskRegistration::AllTasks->First();
00309     auto isBackgroundTask = backgroundTaskIter->HasCurrent;
00310
00311     while (isBackgroundTask)
00312     {
00313         auto backgroundTask = backgroundTaskIter->Current->Value;
00314
00315         if (SampleConstants::Scenario1_TaskName == backgroundTask->Name)
00316         {
00317             backgroundTask->Unregister(true);
00318             break;
00319         }
00320
00321         isBackgroundTask = backgroundTaskIter->MoveNext();
00322     }
00323 }
00324
00325
00326 /// <summary>
00327 /// This is the tick handler for the Refresh timer.
00328 /// </summary>
00329 /// <param name="sender"></param>
00330 /// <param name="e"></param>
00331 void Scenario1_DeviceUse::RefreshTimer_Tick(Object^ /*sender*/, Object^ /*e*/)
00332 {
00333     if (ApplicationData::Current->LocalSettings->Values->HasKey("SampleCount"))
00334     {
00335         uint64 sampleCount = (uint64)ApplicationData::Current->LocalSettings->Values->Lookup("SampleCount");
00336         ScenarioOutput_SampleCount->Text = sampleCount.ToString();
00337     }
00338     else
00339     {
00340         ScenarioOutput_SampleCount->Text = "No data";
00341     }
00342 }
00343
00344 /// <summary>
00345 /// This is the background task completion handler.
00346 /// </summary>
00347 /// <param name="sender"></param>
00348 /// <param name="e"></param>
00349 void Scenario1_DeviceUse::OnBackgroundTaskCompleted(BackgroundTaskRegistration^ /*sender*/,
00350     BackgroundTaskCompletedEventArgs^ e)
00351 {
00352     // Dispatch to the UI thread to display the output.
00353     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00354         [this, e]()
00355         {
00356             // An exception may be thrown if an error occurs in the background task.
00357             try
00358             {
00359                 e->CheckResult();
00360                 if (ApplicationData::Current->LocalSettings->Values->HasKey("TaskCancelationReason"))
00361                 {
00362                     String^ cancelationReason = (String^)ApplicationData::Current->LocalSettings->Values->Lookup("TaskCancelationReason");
00363                     rootPage->NotifyUser("Background task was stopped, reason: " + cancelationReason,
00364                         NotifyType::StatusMessage);
00365                 }
00366             }
00367             catch (Exception^ ex)
00368             {
00369                 rootPage->NotifyUser("Exception in background task: " + ex->Message,
00370                     NotifyType::ErrorMessage);
00371             }
00372         },
00373         CallbackContext::Any
00374     ));
00375
00376     // Unregister the background task and let the remaining task finish until completion.
00377     if (nullptr != _deviceUseBackgroundTaskRegistration)
00378     {
00379         _deviceUseBackgroundTaskRegistration->Unregister(false);
00380         _deviceUseBackgroundTaskRegistration = nullptr;
00381     }
00382 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario2_DeviceCapture.xaml.cs Source File

  • AudioCreation
  • cs
  • AudioCreation

Scenario2_DeviceCapture.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Media.Audio;
00018 using Windows.Media.Capture;
00019 using Windows.Media.Devices;
00020 using Windows.Media.MediaProperties;
00021 using Windows.Media.Render;
00022 using Windows.Media.Transcoding;
00023 using Windows.Storage;
00024 using Windows.Storage.Pickers;
00025 using Windows.UI;
00026 using Windows.UI.Xaml;
00027 using Windows.UI.Xaml.Controls;
00028 using Windows.UI.Xaml.Media;
00029 using Windows.UI.Xaml.Navigation;
00030
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 namespace AudioCreation
00035 {
00036     /// <summary>
00037     /// This scenario shows using AudioGraph for audio capture from a microphone with low latency.
00038     /// </summary>
00039     public sealed partial class Scenario2_DeviceCapture : Page
00040     {
00041         private MainPage rootPage;
00042         private AudioGraph graph;
00043         private AudioFileOutputNode fileOutputNode;
00044         private AudioDeviceOutputNode deviceOutputNode;
00045         private AudioDeviceInputNode deviceInputNode;
00046         private DeviceInformationCollection outputDevices;
00047         private DeviceInformationCollection inputDevices;
00048
00049         public Scenario2_DeviceCapture()
00050         {
00051             this.InitializeComponent();
00052         }
00053
00054         protected override async void OnNavigatedTo(NavigationEventArgs e)
00055         {
00056             rootPage = MainPage.Current;
00057             await PopulateOutputDeviceList();
00058             await PopulateInputDeviceList();
00059         }
00060
00061         protected override void OnNavigatedFrom(NavigationEventArgs e)
00062         {
00063             if (graph != null)
00064             {
00065                 graph.Dispose();
00066             }
00067         }
00068
00069         private async void FileButton_Click(object sender, RoutedEventArgs e)
00070         {
00071             await SelectOutputFile();
00072         }
00073
00074         private async void RecordStopButton_Click(object sender, RoutedEventArgs e)
00075         {
00076             await ToggleRecordStop();
00077         }
00078
00079         private async void CreateGraphButton_Click(object sender, RoutedEventArgs e)
00080         {
00081             await CreateAudioGraph();
00082         }
00083
00084         private async Task SelectOutputFile()
00085         {
00086             FileSavePicker saveFilePicker = new FileSavePicker();
00087             saveFilePicker.FileTypeChoices.Add("Pulse Code Modulation", new List<string>() { ".wav" });
00088             saveFilePicker.FileTypeChoices.Add("Windows Media Audio", new List<string>() { ".wma" });
00089             saveFilePicker.FileTypeChoices.Add("MPEG Audio Layer-3", new List<string>() { ".mp3" });
00090             saveFilePicker.SuggestedFileName = "New Audio Track";
00091             StorageFile file = await saveFilePicker.PickSaveFileAsync();
00092
00093             // File can be null if cancel is hit in the file picker
00094             if (file == null)
00095             {
00096                 return;
00097             }
00098
00099             rootPage.NotifyUser(String.Format("Recording to {0}", file.Name.ToString()), NotifyType.StatusMessage);
00100             MediaEncodingProfile fileProfile = CreateMediaEncodingProfile(file);
00101
00102             // Operate node at the graph format, but save file at the specified format
00103             CreateAudioFileOutputNodeResult fileOutputNodeResult = await graph.CreateFileOutputNodeAsync(file, fileProfile);
00104
00105             if (fileOutputNodeResult.Status != AudioFileNodeCreationStatus.Success)
00106             {
00107                 // FileOutputNode creation failed
00108                 rootPage.NotifyUser(String.Format("Cannot create output file because {0}", fileOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00109                 fileButton.Background = new SolidColorBrush(Colors.Red);
00110                 return;
00111             }
00112
00113             fileOutputNode = fileOutputNodeResult.FileOutputNode;
00114             fileButton.Background = new SolidColorBrush(Colors.YellowGreen);
00115
00116             // Connect the input node to both output nodes
00117             deviceInputNode.AddOutgoingConnection(fileOutputNode);
00118             deviceInputNode.AddOutgoingConnection(deviceOutputNode);
00119             recordStopButton.IsEnabled = true;
00120         }
00121
00122         private MediaEncodingProfile CreateMediaEncodingProfile(StorageFile file)
00123         {
00124             switch(file.FileType.ToString().ToLowerInvariant())
00125             {
00126                 case ".wma":
00127                     return MediaEncodingProfile.CreateWma(AudioEncodingQuality.High);
00128                 case ".mp3":
00129                     return MediaEncodingProfile.CreateMp3(AudioEncodingQuality.High);
00130                 case ".wav":
00131                     return MediaEncodingProfile.CreateWav(AudioEncodingQuality.High);
00132                 default:
00133                     throw new ArgumentException();
00134             }
00135         }
00136
00137         private async Task ToggleRecordStop()
00138         {
00139             if (recordStopButton.Content.Equals("Record"))
00140             {
00141                 graph.Start();
00142                 recordStopButton.Content = "Stop";
00143                 audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
00144                 audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
00145             }
00146             else if (recordStopButton.Content.Equals("Stop"))
00147             {
00148                 // Good idea to stop the graph to avoid data loss
00149                 graph.Stop();
00150                 audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00151                 audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00152
00153                 TranscodeFailureReason finalizeResult = await fileOutputNode.FinalizeAsync();
00154                 if (finalizeResult != TranscodeFailureReason.None)
00155                 {
00156                     // Finalization of file failed. Check result code to see why
00157                     rootPage.NotifyUser(String.Format("Finalization of file failed because {0}", finalizeResult.ToString()), NotifyType.ErrorMessage);
00158                     fileButton.Background = new SolidColorBrush(Colors.Red);
00159                     return;
00160                 }
00161
00162                 recordStopButton.Content = "Record";
00163                 rootPage.NotifyUser("Recording to file completed successfully!", NotifyType.StatusMessage);
00164                 fileButton.Background = new SolidColorBrush(Colors.Green);
00165                 recordStopButton.IsEnabled = false;
00166                 createGraphButton.IsEnabled = false;
00167             }
00168         }
00169
00170         private async Task PopulateOutputDeviceList()
00171         {
00172             outputDevicesListBox.Items.Clear();
00173             outputDevices = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioRenderSelector());
00174             outputDevicesListBox.Items.Add("-- Pick output device --");
00175             foreach (var device in outputDevices)
00176             {
00177                 outputDevicesListBox.Items.Add(device.Name);
00178             }
00179         }
00180
00181         private async Task PopulateInputDeviceList()
00182         {
00183             inputDevicesListBox.Items.Clear();
00184             inputDevices = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioCaptureSelector());
00185             inputDevicesListBox.Items.Add("-- Pick input device --");
00186             foreach (var device in inputDevices)
00187             {
00188                 inputDevicesListBox.Items.Add(device.Name);
00189             }
00190         }
00191
00192         private async Task CreateAudioGraph()
00193         {
00194             AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
00195             settings.QuantumSizeSelectionMode = QuantumSizeSelectionMode.LowestLatency;
00196             settings.PrimaryRenderDevice = outputDevices[outputDevicesListBox.SelectedIndex - 1];
00197
00198             CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);
00199
00200             if (result.Status != AudioGraphCreationStatus.Success)
00201             {
00202                 // Cannot create graph
00203                 rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
00204                 return;
00205             }
00206
00207             graph = result.Graph;
00208             rootPage.NotifyUser("Graph successfully created!", NotifyType.StatusMessage);
00209
00210             // Create a device output node
00211             CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();
00212             if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
00213             {
00214                 // Cannot create device output node
00215                 rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00216                 outputDeviceContainer.Background = new SolidColorBrush(Colors.Red);
00217                 return;
00218             }
00219
00220             deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
00221             rootPage.NotifyUser("Device Output connection successfully created", NotifyType.StatusMessage);
00222             outputDeviceContainer.Background = new SolidColorBrush(Colors.Green);
00223
00224             // Create a device input node using the default audio input device
00225             CreateAudioDeviceInputNodeResult deviceInputNodeResult = await graph.CreateDeviceInputNodeAsync(MediaCategory.Other, graph.EncodingProperties, inputDevices[inputDevicesListBox.SelectedIndex - 1]);
00226
00227             if (deviceInputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
00228             {
00229                 // Cannot create device input node
00230                 rootPage.NotifyUser(String.Format("Audio Device Input unavailable because {0}", deviceInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00231                 inputDeviceContainer.Background = new SolidColorBrush(Colors.Red);
00232                 return;
00233             }
00234
00235             deviceInputNode = deviceInputNodeResult.DeviceInputNode;
00236             rootPage.NotifyUser("Device Input connection successfully created", NotifyType.StatusMessage);
00237             inputDeviceContainer.Background = new SolidColorBrush(Colors.Green);
00238
00239             // Since graph is successfully created, enable the button to select a file output
00240             fileButton.IsEnabled = true;
00241
00242             // Disable the graph button to prevent accidental click
00243             createGraphButton.IsEnabled = false;
00244
00245             // Because we are using lowest latency setting, we need to handle device disconnection errors
00246             graph.UnrecoverableErrorOccurred += Graph_UnrecoverableErrorOccurred;
00247         }
00248
00249         private async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
00250         {
00251             // Recreate the graph and all nodes when this happens
00252             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00253             {
00254                 sender.Dispose();
00255                 // Re-query for devices
00256                 await PopulateOutputDeviceList();
00257                 await PopulateInputDeviceList();
00258                 // Reset UI
00259                 fileButton.IsEnabled = false;
00260                 recordStopButton.IsEnabled = false;
00261                 recordStopButton.Content = "Record";
00262                 outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00263                 audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00264                 audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00265             });
00266         }
00267
00268         private void outputDevicesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00269         {
00270             if (outputDevicesListBox.SelectedIndex == 0)
00271             {
00272                 createGraphButton.IsEnabled = false;
00273                 outputDevice.Foreground = new SolidColorBrush(Color.FromArgb(255, 110, 110, 110));
00274                 outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00275                 fileButton.IsEnabled = false;
00276                 fileButton.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00277                 inputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00278
00279                 // Destroy graph
00280                 if (graph != null)
00281                 {
00282                     graph.Dispose();
00283                     graph = null;
00284                 }
00285             }
00286             else
00287             {
00288                 createGraphButton.IsEnabled = true;
00289                 outputDevice.Foreground = new SolidColorBrush(Colors.White);
00290             }
00291         }
00292
00293         private void inputDevicesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00294         {
00295             if (inputDevicesListBox.SelectedIndex == 0)
00296             {
00297                 createGraphButton.IsEnabled = false;
00298                 fileButton.IsEnabled = false;
00299                 fileButton.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00300                 inputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00301
00302                 // Destroy graph
00303                 if (graph != null)
00304                 {
00305                     graph.Dispose();
00306                     graph = null;
00307                 }
00308             }
00309             else
00310             {
00311                 createGraphButton.IsEnabled = true;
00312             }
00313         }
00314     }
00315 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoItem.h Source File

  • 360VideoPlayback
  • cpp

VideoItem.h

Go to the documentation of this file.
00001 #pragma once
00002 namespace _360VideoPlayback
00003 {
00004     [Windows::UI::Xaml::Data::Bindable]
00005     [Windows::Foundation::Metadata::WebHostHidden]
00006     public ref class VideoItem sealed
00007     {
00008     public:
00009
00010         VideoItem(Platform::String^ title, Windows::Foundation::Uri^ sourceUri)
00011             : m_title(title), m_sourceUri(sourceUri)
00012         {
00013         }
00014
00015         property Platform::String^ Title
00016         {
00017             Platform::String^ get()
00018             {
00019                 return m_title;
00020             }
00021         }
00022
00023         property Windows::Foundation::Uri^ SourceUri
00024         {
00025             Windows::Foundation::Uri^ get()
00026             {
00027                 return m_sourceUri;
00028             }
00029         }
00030
00031     private:
00032         Platform::String^ m_title;
00033         Windows::Foundation::Uri^ m_sourceUri;
00034
00035     };
00036
00037
00038 }
00039
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/SampleConfiguration.h Source File

  • PasswordVault
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/SampleConfiguration.h Source File

  • JumpList
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014 #include "App.h"
00015
00016 namespace winrt::SDKTemplate
00017 {
00018     void App_LaunchCompleted(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const& e);
00019     void App_OnFileActivated(Windows::ApplicationModel::Activation::FileActivatedEventArgs const& e);
00020 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/BindingHelpers.cpp Source File

  • BarcodeScanner
  • cppwinrt

BindingHelpers.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "BindingHelpers.h"
00014 #include "BindingHelpers.g.cpp"
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.h Source File

  • SecondaryTiles
  • cppwinrt

Scenario7_PinFromAppbar.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7_PinFromAppbar.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario7_PinFromAppbar : Scenario7_PinFromAppbarT<Scenario7_PinFromAppbar>
00020     {
00021         Scenario7_PinFromAppbar();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         fire_and_forget PinToAppBar_Click(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027
00028     private:
00029         // Don't use NotifyUser on this page because it conflicts with the AppBar.
00030         event_token windowActivatedEventToken;
00031
00032     private:
00033         void Window_Activated(Windows::Foundation::IInspectable const& sender, Windows::UI::Core::WindowActivatedEventArgs const& e);
00034         void UpdateAppBarButton();
00035         void BottomAppBar_Opened(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00036     };
00037 }
00038
00039 namespace winrt::SDKTemplate::factory_implementation
00040 {
00041     struct Scenario7_PinFromAppbar : Scenario7_PinFromAppbarT<Scenario7_PinFromAppbar, implementation::Scenario7_PinFromAppbar>
00042     {
00043     };
00044 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario2.xaml.cs Source File

  • MapControl
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Numerics;
00015 using Windows.Devices.Geolocation;
00016 using Windows.Foundation;
00017 using Windows.Foundation.Metadata;
00018 using Windows.Storage.Streams;
00019 using Windows.UI;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Controls.Maps;
00023 using Windows.UI.Xaml.Data;
00024
00025 namespace SDKTemplate
00026 {
00027     public sealed partial class Scenario2 : Page
00028     {
00029         RandomAccessStreamReference mapIconStreamReference;
00030         RandomAccessStreamReference mapBillboardStreamReference;
00031         RandomAccessStreamReference mapModelStreamReference;
00032
00033         public Scenario2()
00034         {
00035             this.InitializeComponent();
00036
00037             mapIconStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/MapPin.png"));
00038             mapBillboardStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/billboard.jpg"));
00039             mapModelStreamReference = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/box.3mf"));
00040         }
00041
00042         private void MyMap_Loaded(object sender, RoutedEventArgs e)
00043         {
00044             myMap.Center = MainPage.SeattleGeopoint;
00045             myMap.ZoomLevel = 17;
00046             myMap.DesiredPitch = 45;
00047         }
00048
00049         private void mapClearButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00050         {
00051             myMap.MapElements.Clear();
00052         }
00053
00054         private void mapIconAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00055         {
00056             MapIcon mapIcon1 = new MapIcon();
00057             mapIcon1.Location = myMap.Center;
00058             mapIcon1.NormalizedAnchorPoint = new Point(0.5, 1.0);
00059             mapIcon1.Title = "My Friend";
00060             mapIcon1.Image = mapIconStreamReference;
00061             mapIcon1.ZIndex = 0;
00062             myMap.MapElements.Add(mapIcon1);
00063         }
00064
00065         /// <summary>
00066         /// This method will create a new billboard at the center of the map with the current camera as reference
00067         /// </summary>
00068         private void mapBillboardAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00069         {
00070             // MapBillboard scales with respect to the perspective projection of the 3D camera.
00071             // The reference camera determines at what view distance the billboard image appears at 1x scale.
00072             MapBillboard mapBillboard = new MapBillboard(myMap.ActualCamera);
00073             mapBillboard.Location = myMap.Center;
00074             mapBillboard.NormalizedAnchorPoint = new Point(0.5, 1.0);
00075             mapBillboard.Image = mapBillboardStreamReference;
00076             myMap.MapElements.Add(mapBillboard);
00077         }
00078
00079         private async void mapElement3DAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00080         {
00081             // Compensate for 3D Model's local coordinate system and scale
00082             const float AltitudeOffset = 45.0f;
00083             const float HeadingOffset = -90.0f;
00084             const float ScaleOffset = 0.1f;
00085
00086             MapModel3D model = await MapModel3D.CreateFrom3MFAsync(mapModelStreamReference, MapModel3DShadingOption.Smooth);
00087             if (model != null)
00088             {
00089                 var center = new BasicGeoposition()
00090                 {
00091                     Latitude = myMap.Center.Position.Latitude,
00092                     Longitude = myMap.Center.Position.Longitude,
00093                     Altitude = AltitudeOffset,
00094                 };
00095
00096                 // MapElement3D scales with respect to the perspective projection of the 3D camera
00097                 MapElement3D mapElement3D = new MapElement3D();
00098                 mapElement3D.Location = new Geopoint(center, AltitudeReferenceSystem.Terrain);
00099                 mapElement3D.Model = model;
00100                 mapElement3D.Heading = HeadingOffset + 180;
00101                 mapElement3D.Scale = new Vector3(ScaleOffset, ScaleOffset, ScaleOffset);
00102                 myMap.MapElements.Add(mapElement3D);
00103             }
00104         }
00105
00106         /// <summary>
00107         /// This method will draw a blue rectangle around the center of the map
00108         /// </summary>
00109         private void mapPolygonAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00110         {
00111             double centerLatitude = myMap.Center.Position.Latitude;
00112             double centerLongitude = myMap.Center.Position.Longitude;
00113             MapPolygon mapPolygon = new MapPolygon();
00114             mapPolygon.Path = new Geopath(new List<BasicGeoposition>() {
00115                 new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude-0.001 },
00116                 new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude-0.001 },
00117                 new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude+0.001 },
00118                 new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude+0.001 },
00119             });
00120
00121             mapPolygon.ZIndex = 1;
00122             mapPolygon.FillColor = Colors.Red;
00123             mapPolygon.StrokeColor = Colors.Blue;
00124             mapPolygon.StrokeThickness = 3;
00125             mapPolygon.StrokeDashed = false;
00126             myMap.MapElements.Add(mapPolygon);
00127         }
00128
00129         private void mapPolylineAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00130         {
00131             double centerLatitude = myMap.Center.Position.Latitude;
00132             double centerLongitude = myMap.Center.Position.Longitude;
00133             MapPolyline mapPolyline = new MapPolyline();
00134             mapPolyline.Path = new Geopath(new List<BasicGeoposition>() {
00135                 new BasicGeoposition() {Latitude=centerLatitude-0.0005, Longitude=centerLongitude-0.001 },
00136                 new BasicGeoposition() {Latitude=centerLatitude+0.0005, Longitude=centerLongitude+0.001 },
00137             });
00138
00139             mapPolyline.StrokeColor = Colors.Black;
00140             mapPolyline.StrokeThickness = 3;
00141             mapPolyline.StrokeDashed = true;
00142             myMap.MapElements.Add(mapPolyline);
00143         }
00144     }
00145 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario1_Start.xaml.cs Source File

  • DatagramSocket
  • cs

Scenario1_Start.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Connectivity;
00018 using Windows.Networking.Sockets;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace DatagramSocketSample
00026 {
00027     /// <summary>
00028     /// A page for first scenario.
00029     /// </summary>
00030     public sealed partial class Scenario1 : Page
00031     {
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         private MainPage rootPage = MainPage.Current;
00035
00036         // List containing all available local HostName endpoints
00037         private List<LocalHostItem> localHostItems = new List<LocalHostItem>();
00038
00039         public Scenario1()
00040         {
00041             this.InitializeComponent();
00042         }
00043
00044         /// <summary>
00045         /// Invoked when this page is about to be displayed in a Frame.
00046         /// </summary>
00047         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00048         /// property is typically used to configure the page.</param>
00049         protected override void OnNavigatedTo(NavigationEventArgs e)
00050         {
00051             BindToAny.IsChecked = true;
00052             PopulateAdapterList();
00053         }
00054
00055         private void BindToAny_Checked(object sender, RoutedEventArgs e)
00056         {
00057             AdapterList.IsEnabled = false;
00058         }
00059
00060         private void BindToAny_Unchecked(object sender, RoutedEventArgs e)
00061         {
00062             AdapterList.IsEnabled = true;
00063         }
00064
00065         /// <summary>
00066         /// This is the click handler for the 'StartListener' button.
00067         /// </summary>
00068         /// <param name="sender">Object for which the event was generated.</param>
00069         /// <param name="e">Event's parameters.</param>
00070         private async void StartListener_Click(object sender, RoutedEventArgs e)
00071         {
00072             if (String.IsNullOrEmpty(ServiceNameForListener.Text))
00073             {
00074                 rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
00075                 return;
00076             }
00077
00078             if (CoreApplication.Properties.ContainsKey("listener"))
00079             {
00080                 rootPage.NotifyUser(
00081                     "This step has already been executed. Please move to the next one.",
00082                     NotifyType.ErrorMessage);
00083                 return;
00084             }
00085
00086             CoreApplication.Properties.Remove("serverAddress");
00087
00088             DatagramSocket listener = new DatagramSocket();
00089             listener.MessageReceived += MessageReceived;
00090
00091             if (!String.IsNullOrWhiteSpace(InboundBufferSize.Text))
00092             {
00093                 uint inboundBufferSize = 0;
00094                 if (!uint.TryParse(InboundBufferSize.Text, out inboundBufferSize))
00095                 {
00096                     rootPage.NotifyUser(
00097                         "Please provide a positive numeric Inbound buffer size.",
00098                         NotifyType.ErrorMessage);
00099                     return;
00100                 }
00101
00102                 try
00103                 {
00104                     // Running both client and server on localhost will most likely not reach the buffer limit.
00105                     // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
00106                     listener.Control.InboundBufferSizeInBytes = inboundBufferSize;
00107                 }
00108                 catch (ArgumentException)
00109                 {
00110                     rootPage.NotifyUser("Please provide a valid Inbound buffer size.", NotifyType.ErrorMessage);
00111                     return;
00112                 }
00113             }
00114
00115             LocalHostItem selectedLocalHost = null;
00116             if ((BindToAddress.IsChecked == true) || (BindToAdapter.IsChecked == true))
00117             {
00118                 selectedLocalHost = (LocalHostItem)AdapterList.SelectedItem;
00119                 if (selectedLocalHost == null)
00120                 {
00121                     rootPage.NotifyUser("Please select an address / adapter.", NotifyType.ErrorMessage);
00122                     return;
00123                 }
00124
00125                 // The user selected an address. For demo purposes, we ensure that connect will be using the same
00126                 // address.
00127                 CoreApplication.Properties.Add("serverAddress", selectedLocalHost.LocalHost.CanonicalName);
00128             }
00129
00130             // Save the socket, so subsequent steps can use it.
00131             CoreApplication.Properties.Add("listener", listener);
00132
00133             // Start listen operation.
00134             try
00135             {
00136                 if (BindToAny.IsChecked == true)
00137                 {
00138                     // Don't limit traffic to an address or an adapter.
00139                     await listener.BindServiceNameAsync(ServiceNameForListener.Text);
00140                     rootPage.NotifyUser("Listening", NotifyType.StatusMessage);
00141                 }
00142                 else if (BindToAddress.IsChecked == true)
00143                 {
00144                     // Try to bind to a specific address.
00145                     await listener.BindEndpointAsync(selectedLocalHost.LocalHost, ServiceNameForListener.Text);
00146                     rootPage.NotifyUser(
00147                         "Listening on address " + selectedLocalHost.LocalHost.CanonicalName,
00148                         NotifyType.StatusMessage);
00149                 }
00150                 else if (BindToAdapter.IsChecked == true)
00151                 {
00152                     // Try to limit traffic to the selected adapter.
00153                     // This option will be overriden by interfaces with weak-host or forwarding modes enabled.
00154                     NetworkAdapter selectedAdapter = selectedLocalHost.LocalHost.IPInformation.NetworkAdapter;
00155
00156                     await listener.BindServiceNameAsync(ServiceNameForListener.Text, selectedAdapter);
00157
00158                     rootPage.NotifyUser(
00159                         "Listening on adapter " + selectedAdapter.NetworkAdapterId,
00160                         NotifyType.StatusMessage);
00161                 }
00162             }
00163             catch (Exception exception)
00164             {
00165                 CoreApplication.Properties.Remove("listener");
00166
00167                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00168                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00169                 {
00170                     throw;
00171                 }
00172
00173                 rootPage.NotifyUser(
00174                     "Start listening failed with error: " + exception.Message,
00175                     NotifyType.ErrorMessage);
00176             }
00177         }
00178
00179         /// <summary>
00180         /// Message received handler
00181         /// </summary>
00182         /// <param name="socket">The socket object</param>
00183         /// <param name="eventArguments">The datagram event information</param>
00184         async void MessageReceived(DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
00185         {
00186             object outObj;
00187             if (CoreApplication.Properties.TryGetValue("remotePeer", out outObj))
00188             {
00189                 EchoMessage((RemotePeer)outObj, eventArguments);
00190                 return;
00191             }
00192
00193             // We do not have an output stream yet so create one.
00194             try
00195             {
00196                 IOutputStream outputStream = await socket.GetOutputStreamAsync(
00197                     eventArguments.RemoteAddress,
00198                     eventArguments.RemotePort);
00199
00200                 // It might happen that the OnMessage was invoked more than once before the GetOutputStreamAsync call
00201                 // completed. In this case we will end up with multiple streams - just keep one of them.
00202                 RemotePeer peer;
00203                 lock (this)
00204                 {
00205                     if (CoreApplication.Properties.TryGetValue("remotePeer", out outObj))
00206                     {
00207                         peer = (RemotePeer)outObj;
00208                     }
00209                     else
00210                     {
00211                         peer = new RemotePeer(outputStream, eventArguments.RemoteAddress, eventArguments.RemotePort);
00212                         CoreApplication.Properties.Add("remotePeer", peer);
00213                     }
00214                 }
00215
00216                 EchoMessage(peer, eventArguments);
00217             }
00218             catch (Exception exception)
00219             {
00220                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00221                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00222                 {
00223                     throw;
00224                 }
00225
00226                 NotifyUserFromAsyncThread("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
00227             }
00228         }
00229
00230         /// <summary>
00231         /// Echo the message back to the peer
00232         /// </summary>
00233         /// <param name="peer">The remote peer object</param>
00234         /// <param name="eventArguments">The received message event arguments</param>
00235         async void EchoMessage(RemotePeer peer, DatagramSocketMessageReceivedEventArgs eventArguments)
00236         {
00237             if (!peer.IsMatching(eventArguments.RemoteAddress, eventArguments.RemotePort))
00238             {
00239                 // In the sample we are communicating with just one peer. To communicate with multiple peers, an
00240                 // application should cache output streams (e.g., by using a hash map), because creating an output
00241                 // stream for each received datagram is costly. Keep in mind though, that every cache requires logic
00242                 // to remove old or unused elements; otherwise, the cache will turn into a memory leaking structure.
00243                 NotifyUserFromAsyncThread(
00244                     String.Format(
00245                         "Got datagram from {0}:{1}, but already 'connected' to {2}",
00246                         eventArguments.RemoteAddress,
00247                         eventArguments.RemotePort,
00248                         peer),
00249                     NotifyType.ErrorMessage);
00250             }
00251
00252             try
00253             {
00254                 await peer.OutputStream.WriteAsync(eventArguments.GetDataReader().DetachBuffer());
00255             }
00256             catch (Exception exception)
00257             {
00258                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00259                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00260                 {
00261                     throw;
00262                 }
00263
00264                 NotifyUserFromAsyncThread("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
00265             }
00266         }
00267
00268         /// <summary>
00269         /// Notifies the user from a non-UI thread
00270         /// </summary>
00271         /// <param name="strMessage">The message</param>
00272         /// <param name="type">The type of notification</param>
00273         private void NotifyUserFromAsyncThread(string strMessage, NotifyType type)
00274         {
00275             var ignore = Dispatcher.RunAsync(
00276                 CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
00277         }
00278
00279         /// <summary>
00280         /// Populates the NetworkAdapter list
00281         /// </summary>
00282         private void PopulateAdapterList()
00283         {
00284             localHostItems.Clear();
00285             AdapterList.ItemsSource = localHostItems;
00286             AdapterList.DisplayMemberPath = "DisplayString";
00287
00288             foreach (HostName localHostInfo in NetworkInformation.GetHostNames())
00289             {
00290                 if (localHostInfo.IPInformation != null)
00291                 {
00292                     LocalHostItem adapterItem = new LocalHostItem(localHostInfo);
00293                     localHostItems.Add(adapterItem);
00294                 }
00295             }
00296         }
00297     }
00298
00299     /// <summary>
00300     /// Helper class used to identify and respond to a remote peer
00301     /// </summary>
00302     class RemotePeer
00303     {
00304         IOutputStream outputStream;
00305         HostName hostName;
00306         String port;
00307
00308         public RemotePeer(IOutputStream outputStream, HostName hostName, String port)
00309         {
00310             this.outputStream = outputStream;
00311             this.hostName = hostName;
00312             this.port = port;
00313         }
00314
00315         public bool IsMatching(HostName hostName, String port)
00316         {
00317             return (this.hostName == hostName && this.port == port);
00318         }
00319
00320         public IOutputStream OutputStream
00321         {
00322             get { return outputStream; }
00323         }
00324
00325         public override String ToString()
00326         {
00327             return hostName + port;
00328         }
00329     }
00330
00331     /// <summary>
00332     /// Helper class describing a NetworkAdapter and its associated IP address
00333     /// </summary>
00334     class LocalHostItem
00335     {
00336         public string DisplayString
00337         {
00338             get;
00339             private set;
00340         }
00341
00342         public HostName LocalHost
00343         {
00344             get;
00345             private set;
00346         }
00347
00348         public LocalHostItem(HostName localHostName)
00349         {
00350             if (localHostName == null)
00351             {
00352                 throw new ArgumentNullException("localHostName");
00353             }
00354
00355             if (localHostName.IPInformation == null)
00356             {
00357                 throw new ArgumentException("Adapter information not found");
00358             }
00359
00360             this.LocalHost = localHostName;
00361             this.DisplayString = "Address: " + localHostName.DisplayName +
00362                 " Adapter: " + localHostName.IPInformation.NetworkAdapter.NetworkAdapterId;
00363         }
00364     }
00365 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetHistoricalBytes Member List

This is the complete list of members for GetHistoricalBytes, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetHistoricalBytes() | GetHistoricalBytes | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/SampleConfiguration.cs Source File

  • SimpleCommunication
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using SimpleCommunication;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Simple Communication";
00022         private static Windows.Media.MediaExtensionManager mediaExtensionMgr;
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Low Latency", ClassType=typeof(LowLatency)},
00027             new Scenario() { Title="Video Chat", ClassType=typeof(VideoChat)}
00028         };
00029
00030         public void EnsureMediaExtensionManager()
00031         {
00032             if (mediaExtensionMgr == null)
00033             {
00034                 mediaExtensionMgr = new Windows.Media.MediaExtensionManager();
00035                 mediaExtensionMgr.RegisterSchemeHandler("Microsoft.Samples.SimpleCommunication.StspSchemeHandler", "stsp:");
00036             }
00037         }
00038     }
00039
00040     public class Scenario
00041     {
00042         public string Title { get; set; }
00043         public Type ClassType { get; set; }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/CustomTextBox.cs Source File

  • TouchKeyboard
  • cs

CustomTextBox.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Media;
00015
00016 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Custom Text box control derived from Textbox class.
00022     /// </summary>
00023     public class CustomTextBox : TextBox
00024     {
00025         public CustomTextBox()
00026         {
00027             FontFamily = new FontFamily("Times New Roman");
00028             FontStyle = Windows.UI.Text.FontStyle.Italic;
00029             BorderThickness = new Thickness(1);
00030         }
00031     }
00032 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BadgeNumericNotificationContent Member List

This is the complete list of members for BadgeNumericNotificationContent, including all inherited members.
BadgeNumericNotificationContent(uint number) | BadgeNumericNotificationContent | [inline]
CreateNotification() | BadgeNumericNotificationContent | [inline]
GetContent() | BadgeNumericNotificationContent | [inline]
m_Number | BadgeNumericNotificationContent | [private]
Number | BadgeNumericNotificationContent |
ToString() | BadgeNumericNotificationContent | [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/pch.cpp Source File

  • WiFiDirect
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario12_DisableCookies.xaml.cs Source File

  • HttpClient
  • cs

Scenario12_DisableCookies.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.Web.Http;
00019 using Windows.Web.Http.Filters;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario12_DisableCookies : Page
00024     {
00025         MainPage rootPage = MainPage.Current;
00026
00027         private HttpBaseProtocolFilter filter;
00028         private HttpClient httpClient;
00029         private CancellationTokenSource cts;
00030
00031         public Scenario12_DisableCookies()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedTo(NavigationEventArgs e)
00037         {
00038             filter = new HttpBaseProtocolFilter();
00039             httpClient = new HttpClient(filter);
00040             cts = new CancellationTokenSource();
00041         }
00042
00043         protected override void OnNavigatedFrom(NavigationEventArgs e)
00044         {
00045             cts.Cancel();
00046             cts.Dispose();
00047             httpClient.Dispose();
00048             filter.Dispose();
00049         }
00050
00051         private async void SendInitialGetButton_Click(object sender, RoutedEventArgs e)
00052         {
00053             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00054             // valid, absolute URI, we'll notify the user about the incorrect input.
00055             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00056             if (resourceUri == null)
00057             {
00058                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00059                 return;
00060             }
00061
00062             Helpers.ScenarioStarted(SendInitialGetButton, CancelButton, OutputField);
00063             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00064
00065             try
00066             {
00067                 HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);
00068
00069                 if (result.Succeeded)
00070                 {
00071                     HttpCookieCollection cookieCollection = filter.CookieManager.GetCookies(resourceUri);
00072                     OutputField.Text = cookieCollection.Count + " cookies found.\r\n";
00073                     foreach (HttpCookie cookie in cookieCollection)
00074                     {
00075                         OutputField.Text += "--------------------\r\n";
00076                         OutputField.Text += "Name: " + cookie.Name + "\r\n";
00077                         OutputField.Text += "Domain: " + cookie.Domain + "\r\n";
00078                         OutputField.Text += "Path: " + cookie.Path + "\r\n";
00079                         OutputField.Text += "Value: " + cookie.Value + "\r\n";
00080                         OutputField.Text += "Expires: " + cookie.Expires + "\r\n";
00081                         OutputField.Text += "Secure: " + cookie.Secure + "\r\n";
00082                         OutputField.Text += "HttpOnly: " + cookie.HttpOnly + "\r\n";
00083                     }
00084
00085                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00086                     SendNextRequestButton.IsEnabled = true;
00087                 }
00088                 else
00089                 {
00090                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00091                 }
00092             }
00093             catch (TaskCanceledException)
00094             {
00095                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00096             }
00097
00098             Helpers.ScenarioCompleted(SendInitialGetButton, CancelButton);
00099         }
00100
00101         private async void SendNextRequestButton_Click(object sender, RoutedEventArgs e)
00102         {
00103             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00104
00105             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00106             // valid, absolute URI, we'll notify the user about the incorrect input.
00107             if (resourceUri == null)
00108             {
00109                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00110                 return;
00111             }
00112
00113             Helpers.ScenarioStarted(SendNextRequestButton, CancelButton, OutputField);
00114             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00115             if (CookieUsageBehaviorToggle.IsOn)
00116             {
00117                 filter.CookieUsageBehavior = HttpCookieUsageBehavior.Default;
00118             }
00119             else
00120             {
00121                 // Disable cookie handling - this will do two things: no cookies are attached to outgoing request, and
00122                 // cookies contained in incoming server responses are not added to the CookieManager of the HttpBaseProtocolFilter.
00123                 filter.CookieUsageBehavior = HttpCookieUsageBehavior.NoCookies;
00124             }
00125
00126             // This sample uses a "try" in order to support TaskCanceledException.
00127             // If you don't need to support cancellation, then the "try" is not needed.
00128             try
00129             {
00130                 HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);
00131
00132                 if (result.Succeeded)
00133                 {
00134                     await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
00135
00136                     rootPage.NotifyUser("Completed. Response came from " + result.ResponseMessage.Source.ToString() + ".", NotifyType.StatusMessage);
00137                 }
00138                 else
00139                 {
00140                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00141                 }
00142             }
00143             catch (TaskCanceledException)
00144             {
00145                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00146             }
00147
00148             Helpers.ScenarioCompleted(SendNextRequestButton, CancelButton);
00149         }
00150
00151         private void Cancel_Click(object sender, RoutedEventArgs e)
00152         {
00153             cts.Cancel();
00154             cts.Dispose();
00155
00156             // Re-create the CancellationTokenSource.
00157             cts = new CancellationTokenSource();
00158         }
00159
00160         public void Dispose()
00161         {
00162         }
00163     }
00164 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ElementMargin Member List

This is the complete list of members for ElementMargin, including all inherited members.
bottom | ElementMargin |
ElementMargin() | ElementMargin |
ElementMargin(float l, float t, float r, float b) | ElementMargin | [inline]
left | ElementMargin |
right | ElementMargin |
top | ElementMargin |
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ParseAndStringify Member List

This is the complete list of members for Scenario1_ParseAndStringify, including all inherited members.
Add_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_ParseAndStringify |
CurrentUser() | Scenario1_ParseAndStringify | [inline, private]
CurrentUser(SDKTemplate::User const &user) | Scenario1_ParseAndStringify | [inline, private]
DeleteSchool_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_ParseAndStringify |
IsExceptionHandled(hresult_error const &ex) | Scenario1_ParseAndStringify | [private]
Parse_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_ParseAndStringify |
Scenario1_ParseAndStringify() | Scenario1_ParseAndStringify |
Stringify_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_ParseAndStringify |
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/DisplaySizeClass.h Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

DisplaySizeClass.h

Go to the documentation of this file.
00001 #pragma once
00002 namespace DisplaySizeHelper
00003 {
00004     public ref class DisplaySizeClass sealed
00005     {
00006     public:
00007         DisplaySizeClass();
00008         double GetDisplaySizeInInches();
00009     };
00010 }
00011
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.h Source File

  • JapanesePhoneticAnalysis
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • BluetoothAdvertisement
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Tasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("Tasks")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/App.xaml.cs Source File

  • Projection
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// Provides application-specific behavior to supplement the default Application class.
00025     /// </summary>
00026     sealed partial class App : Application
00027     {
00028
00029         public LaunchActivatedEventArgs LaunchArgs;
00030
00031         /// <summary>
00032         /// Initializes the singleton application object.  This is the first line of authored code
00033         /// executed, and as such is the logical equivalent of main() or WinMain().
00034         /// </summary>
00035         public App()
00036         {
00037             this.InitializeComponent();
00038             this.Suspending += OnSuspending;
00039         }
00040
00041         /// <summary>
00042         /// Invoked when the application is launched normally by the end user.  Other entry points
00043         /// will be used such as when the application is launched to open a specific file.
00044         /// </summary>
00045         /// <param name="e">Details about the launch request and process.</param>
00046         protected override void OnLaunched(LaunchActivatedEventArgs e)
00047         {
00048
00049 #if DEBUG
00050             if (System.Diagnostics.Debugger.IsAttached)
00051             {
00052                 this.DebugSettings.EnableFrameRateCounter = false;
00053             }
00054 #endif
00055
00056             Frame rootFrame = Window.Current.Content as Frame;
00057
00058             // Do not repeat app initialization when the Window already has content,
00059             // just ensure that the window is active
00060             if (rootFrame == null)
00061             {
00062                 // Create a Frame to act as the navigation context and navigate to the first page
00063                 rootFrame = new Frame();
00064                 // Set the default language
00065                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00066
00067                 rootFrame.NavigationFailed += OnNavigationFailed;
00068
00069                 if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
00070                 {
00071                     //TODO: Load state from previously suspended application
00072                 }
00073
00074                 // Place the frame in the current Window
00075                 Window.Current.Content = rootFrame;
00076             }
00077
00078             if (rootFrame.Content == null)
00079             {
00080                 // When the navigation stack isn't restored navigate to the first page,
00081                 // configuring the new page by passing required information as a navigation
00082                 // parameter
00083                 rootFrame.Navigate(typeof(MainPage), e.Arguments);
00084             }
00085             // Ensure the current window is active
00086             Window.Current.Activate();
00087         }
00088
00089         /// <summary>
00090         /// Invoked when Navigation to a certain page fails
00091         /// </summary>
00092         /// <param name="sender">The Frame which failed navigation</param>
00093         /// <param name="e">Details about the navigation failure</param>
00094         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00095         {
00096             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00097         }
00098
00099         /// <summary>
00100         /// Invoked when application execution is being suspended.  Application state is saved
00101         /// without knowing whether the application will be terminated or resumed with the contents
00102         /// of memory still intact.
00103         /// </summary>
00104         /// <param name="sender">The source of the suspend request.</param>
00105         /// <param name="e">Details about the suspend request.</param>
00106         private void OnSuspending(object sender, SuspendingEventArgs e)
00107         {
00108             var deferral = e.SuspendingOperation.GetDeferral();
00109             //TODO: Save application state and stop any background activity
00110             deferral.Complete();
00111         }
00112     }
00113 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario5.xaml.h Source File

  • DatagramSocket
  • cpp

Scenario5.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario5.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     namespace DatagramSocketSample
00021     {
00022         /// <summary>
00023         /// An empty page that can be used on its own or navigated to within a Frame.
00024         /// </summary>
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         public ref class Scenario5 sealed
00027         {
00028         public:
00029             Scenario5();
00030
00031         protected:
00032             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033             virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00034
00035         private:
00036             MainPage^ rootPage;
00037             Windows::Networking::Sockets::DatagramSocket^  listenerSocket;
00038
00039             void CloseListenerSocket();
00040
00041             void SetupMulticastScenarioUI();
00042             void SetupBroadcastScenarioUI();
00043
00044             void MulticastRadioButton_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045             void MulticastRadioButton_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046
00047             void StartListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048             void SendMessage_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049             void CloseListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00050
00051             void MessageReceived(
00052                 Windows::Networking::Sockets::DatagramSocket^ socket,
00053                 Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ eventArguments);
00054             void NotifyUserFromAsyncThread(Platform::String^ message, NotifyType type);
00055         };
00056     }
00057 }
Generated on Fri Nov 15 2024 22:18:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario3_UsingWindows.xaml.cs Source File

  • LineDisplay
  • cs

Scenario3_UsingWindows.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.ObjectModel;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.PointOfService;
00016 using Windows.Foundation;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public class WindowInfo
00024     {
00025         public LineDisplayWindow Window { get; private set; }
00026         public int Id { get; private set; }
00027         public string Name => (Id == 0) ? "(Default)" : String.Empty;
00028
00029         public WindowInfo(LineDisplayWindow window, int id)
00030         {
00031             Window = window;
00032             Id = id;
00033         }
00034     }
00035
00036     public sealed partial class Scenario3_UsingWindows : Page
00037     {
00038         private MainPage rootPage = MainPage.Current;
00039         private ClaimedLineDisplay lineDisplay;
00040
00041         public ObservableCollection<WindowInfo> WindowList { get; } = new ObservableCollection<WindowInfo>();
00042
00043         private int nextWindowId = 0;
00044         private uint maxWindows = 0;
00045
00046         public Scenario3_UsingWindows()
00047         {
00048             this.InitializeComponent();
00049             DataContext = this;
00050         }
00051
00052         protected override async void OnNavigatedTo(NavigationEventArgs e)
00053         {
00054             await InitializeAsync();
00055         }
00056
00057         protected override void OnNavigatedFrom(NavigationEventArgs e)
00058         {
00059             lineDisplay?.Dispose();
00060             lineDisplay = null;
00061         }
00062
00063         private async Task InitializeAsync()
00064         {
00065             lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();
00066
00067             maxWindows = (lineDisplay == null) ? 0 : lineDisplay.Capabilities.SupportedWindows;
00068             if (maxWindows >= 1)
00069             {
00070                 // Create an entry to represent the default window.
00071                 WindowList.Add(new WindowInfo(lineDisplay.DefaultWindow, nextWindowId));
00072                 nextWindowId++;
00073             }
00074         }
00075
00076         private async void NewWindowButton_Click(object sender, RoutedEventArgs e)
00077         {
00078             rootPage.NotifyUser("", NotifyType.StatusMessage);
00079
00080             Rect viewportBounds = new Rect()
00081             {
00082                 X = Helpers.ParseUIntWithFallback(NewViewportX, -1.0),
00083                 Y = Helpers.ParseUIntWithFallback(NewViewportY, -1.0),
00084                 Width = Helpers.ParseUIntWithFallback(NewViewportWidth, 0.0),
00085                 Height = Helpers.ParseUIntWithFallback(NewViewportHeight, 0.0),
00086             };
00087
00088             if ((viewportBounds.Width <= 0) || (viewportBounds.Height <= 0))
00089             {
00090                 rootPage.NotifyUser("Viewport size must be be positive.", NotifyType.ErrorMessage);
00091                 return;
00092             }
00093
00094             // Viewport cannot extend beyond the screen.
00095             Size screenSizeInCharacters = lineDisplay.GetAttributes().ScreenSizeInCharacters;
00096             if ((viewportBounds.X < 0) || (viewportBounds.Y < 0) ||
00097                 (viewportBounds.X + viewportBounds.Width > screenSizeInCharacters.Width) ||
00098                 (viewportBounds.Y + viewportBounds.Height > screenSizeInCharacters.Height))
00099             {
00100                 rootPage.NotifyUser("Viewport cannot extend beyond the screen.", NotifyType.ErrorMessage);
00101                 return;
00102             }
00103
00104             Size windowSize = new Size()
00105             {
00106                 Width = Helpers.ParseUIntWithFallback(NewWindowWidth, 0.0),
00107                 Height = Helpers.ParseUIntWithFallback(NewWindowHeight, 0.0),
00108             };
00109
00110             if ((windowSize.Width <= 0) || (windowSize.Height <= 0))
00111             {
00112                 rootPage.NotifyUser("Window size must be be positive.", NotifyType.ErrorMessage);
00113                 return;
00114             }
00115
00116             // Windows must be at least as large as their viewports.
00117             if ((viewportBounds.Width > windowSize.Width) || (viewportBounds.Height > windowSize.Height))
00118             {
00119                 rootPage.NotifyUser("Window must be at least as large as viewport.", NotifyType.ErrorMessage);
00120                 return;
00121             }
00122
00123             // Window taller than viewport requires IsVerticalMarqueeSupported.
00124             if ((windowSize.Height > viewportBounds.Height) && !lineDisplay.Capabilities.IsVerticalMarqueeSupported)
00125             {
00126                 rootPage.NotifyUser("Window cannot be taller than viewport on this line display.", NotifyType.ErrorMessage);
00127                 return;
00128             }
00129
00130             // Window wider than viewport requires IsHorizontalMarqueeSupported.
00131             if ((windowSize.Width > viewportBounds.Width) && !lineDisplay.Capabilities.IsHorizontalMarqueeSupported)
00132             {
00133                 rootPage.NotifyUser("Window cannot be wider than viewport on this line display.", NotifyType.ErrorMessage);
00134                 return;
00135             }
00136
00137             // Window cannot be larger than viewport in both directions.
00138             // (Two-dimensional scrolling is not supported.)
00139             if ((windowSize.Width > viewportBounds.Width) && (windowSize.Height > viewportBounds.Height))
00140             {
00141                 rootPage.NotifyUser("Window cannot be larger than viewport in both dimensions.", NotifyType.ErrorMessage);
00142                 return;
00143             }
00144
00145             LineDisplayWindow newWindow = await lineDisplay.TryCreateWindowAsync(viewportBounds, windowSize);
00146
00147             if (newWindow != null)
00148             {
00149                 var newWindowInfo = new WindowInfo(newWindow, nextWindowId);
00150                 WindowList.Add(newWindowInfo);
00151                 nextWindowId++;
00152
00153                 rootPage.NotifyUser($"Created window {newWindowInfo.Id}.", NotifyType.StatusMessage);
00154             }
00155             else
00156             {
00157                 // We probably lost our claim.
00158                 rootPage.NotifyUser("Failed to create a new window", NotifyType.ErrorMessage);
00159             }
00160         }
00161
00162         private async void RefreshWindowButton_Click(object sender, RoutedEventArgs e)
00163         {
00164             var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
00165             if (await targetWindow.Window.TryRefreshAsync())
00166             {
00167                 rootPage.NotifyUser($"Refreshed window {targetWindow.Id}.", NotifyType.StatusMessage);
00168             }
00169             else
00170             {
00171                 // We probably lost our claim.
00172                 rootPage.NotifyUser($"Failed to refresh window {targetWindow.Id}.", NotifyType.ErrorMessage);
00173             }
00174         }
00175
00176         private void DestroyWindowButton_Click(object sender, RoutedEventArgs e)
00177         {
00178             var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
00179             WindowList.RemoveAt(WindowsListBox.SelectedIndex);
00180
00181             // The LineDisplayWindow class implements IDispose. Disposing of a LineDisplayWindow
00182             // results in its destruction on the line display device and invalidation of the object.
00183             targetWindow.Window.Dispose();
00184
00185             rootPage.NotifyUser($"Destroyed window {targetWindow.Id}.", NotifyType.StatusMessage);
00186         }
00187
00188         private async void DisplayTextButton_Click(object sender, RoutedEventArgs e)
00189         {
00190             var targetWindow = (WindowInfo)WindowsListBox.SelectedItem;
00191             if (await targetWindow.Window.TryDisplayTextAsync(DisplayTextTextbox.Text))
00192             {
00193                 rootPage.NotifyUser($"Displayed \"{DisplayTextTextbox.Text}\" to window {targetWindow.Id}.", NotifyType.StatusMessage);
00194             }
00195             else
00196             {
00197                 // We probably lost our claim.
00198                 rootPage.NotifyUser($"Failed to display to window {targetWindow.Id}.", NotifyType.ErrorMessage);
00199             }
00200         }
00201
00202         // Helpers that are used by XAML binding to enable and disable buttons.
00203
00204         // The default window cannot be destroyed.
00205         public bool CanDestroyWindow(object item) => (item != null) && (((WindowInfo)item).Id != 0);
00206
00207         // Can create a new window if we haven't reached the maximum.
00208         public bool CanCreateNewWindow(ObservableCollection<WindowInfo> windowsList) => windowsList.Count < maxWindows;
00209
00210         // Some buttons require a selection.
00211         public bool IsNonNull(object item) => item != null;
00212     }
00213 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TransportOptions Member List

This is the complete list of members for TransportOptions, including all inherited members.
IsGamepadSupported | TransportOptions | [private]
OnFocusEngaged(Control sender, FocusEngagedEventArgs e) | TransportOptions | [inline, private]
OnLoaded(object sender, RoutedEventArgs e) | TransportOptions | [inline, private]
RemoveTabStops(DependencyObject root) | TransportOptions | [inline, private]
TransportOptions() | TransportOptions | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WorldFloorMesh Member List

This is the complete list of members for WorldFloorMesh, including all inherited members.
m_indexBuffer | MeshObject | [protected]
m_indexCount | MeshObject | [protected]
m_vertexBuffer | MeshObject | [protected]
m_vertexCount | MeshObject | [protected]
MeshObject() | MeshObject |
Render(_In_ ID3D11DeviceContext *context) | MeshObject | [virtual]
WorldFloorMesh(_In_ winrt::com_ptr< ID3D11Device3 > const &device) | WorldFloorMesh |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/Scenario1_Mini.xaml.cs Source File

  • ContactCards
  • cs

Scenario1_Mini.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.ApplicationModel.Contacts;
00013 using Windows.Foundation;
00014 using Windows.UI.Popups;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario1_Mini : Page
00022     {
00023         private MainPage rootPage = MainPage.Current;
00024
00025         public Scenario1_Mini()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             if (!ContactManager.IsShowContactCardSupported())
00033             {
00034                 NotSupportedWarning.Visibility = Visibility.Visible;
00035             }
00036         }
00037
00038         private void ShowContactCard_Click(object sender, RoutedEventArgs e)
00039         {
00040             Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
00041             if (contact != null)
00042             {
00043                 // Show the contact card next to the button.
00044                 Rect rect = MainPage.GetElementRect(sender as FrameworkElement);
00045
00046                 // Show with default placement.
00047                 ContactManager.ShowContactCard(contact, rect);
00048             }
00049         }
00050
00051         private void ShowContactCardWithPlacement_Click(object sender, RoutedEventArgs e)
00052         {
00053             Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
00054             if (contact != null)
00055             {
00056                 // Show the contact card next to the button.
00057                 Rect rect = MainPage.GetElementRect(sender as FrameworkElement);
00058
00059                 // Show with preferred placement to the right.
00060                 ContactManager.ShowContactCard(contact, rect, Placement.Right);
00061             }
00062         }
00063
00064         private void ShowContactCardWithOptions_Click(object sender, RoutedEventArgs e)
00065         {
00066             Contact contact = rootPage.CreateContactFromUserInput(EmailAddress, PhoneNumber);
00067             if (contact != null)
00068             {
00069                 // Show the contact card next to the button.
00070                 Rect rect = MainPage.GetElementRect(sender as FrameworkElement);
00071
00072                 // Ask for the initial tab to be Phone.
00073                 ContactCardOptions options = new ContactCardOptions() { InitialTabKind = ContactCardTabKind.Phone };
00074
00075                 // Show with default placement.
00076                 ContactManager.ShowContactCard(contact, rect, Placement.Default, options);
00077             }
00078         }
00079
00080     }
00081 }
Generated on Fri Nov 15 2024 22:18:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ScriptNotify Member List

This is the complete list of members for Scenario4_ScriptNotify, including all inherited members.
MoreLess_Click(Hyperlink sender, HyperlinkClickEventArgs args) | Scenario4_ScriptNotify | [inline, private]
rootPage | Scenario4_ScriptNotify | [private]
Scenario4_ScriptNotify() | Scenario4_ScriptNotify | [inline]
WebViewControl_ScriptNotify(object sender, NotifyEventArgs e) | Scenario4_ScriptNotify | [inline, private]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemIndexRangeList Member List

This is the complete list of members for ItemIndexRangeList, including all inherited members.
_ranges | ItemIndexRangeList | [private]
Add(ItemIndexRange newrange) | ItemIndexRangeList | [inline]
Add(uint FirstIndex, uint Length) | ItemIndexRangeList | [inline]
Clear() | ItemIndexRangeList | [inline]
Contains(ItemIndexRange item) | ItemIndexRangeList | [inline]
CopyTo(ItemIndexRange[] array, int arrayIndex) | ItemIndexRangeList | [inline]
Count | ItemIndexRangeList |
GetEnumerator() | ItemIndexRangeList | [inline]
GetEnumerator() | ItemIndexRangeList | [inline, private]
IndexOf(ItemIndexRange item) | ItemIndexRangeList | [inline]
Insert(int index, ItemIndexRange item) | ItemIndexRangeList | [inline]
Intersects(ItemIndexRange range) | ItemIndexRangeList | [inline]
IsReadOnly | ItemIndexRangeList |
ItemIndexRangeList() | ItemIndexRangeList | [inline]
ItemIndexRangeList(List< ItemIndexRange > ranges) | ItemIndexRangeList | [inline]
ItemIndexRangeList(ItemIndexRange[] ranges) | ItemIndexRangeList | [inline]
NormalizeRanges(IEnumerable< ItemIndexRange > ranges) | ItemIndexRangeList | [inline, private]
Remove(ItemIndexRange item) | ItemIndexRangeList | [inline]
RemoveAt(int index) | ItemIndexRangeList | [inline]
Subtract(ItemIndexRange range) | ItemIndexRangeList | [inline]
Subtract(uint FirstIndex, uint Length) | ItemIndexRangeList | [inline]
this | ItemIndexRangeList |
ToArray() | ItemIndexRangeList | [inline]
ToList() | ItemIndexRangeList | [inline]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.cpp Source File

  • BackgroundSensors
  • cpp
  • BackgroundTask

Scenario1_BackgroundTask.cpp

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_BackgroundTask.h"
00005
00006 using namespace Concurrency;
00007 using namespace Platform;
00008 using namespace Windows::ApplicationModel::Background;
00009 using namespace Windows::Devices::Background;
00010 using namespace Windows::Devices::Sensors;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Storage;
00013
00014 using namespace BackgroundTask;
00015
00016 Scenario1_BackgroundTask::Scenario1_BackgroundTask() :
00017     _sampleCount(0)
00018 {
00019 }
00020
00021 Scenario1_BackgroundTask::~Scenario1_BackgroundTask()
00022 {
00023 }
00024
00025 /// <summary>
00026 /// Background task entry point.
00027 /// </summary>
00028 /// <param name="taskInstance"></param>
00029 void Scenario1_BackgroundTask::Run(IBackgroundTaskInstance^ taskInstance)
00030 {
00031     _accelerometer = Accelerometer::GetDefault();
00032
00033     if (nullptr != _accelerometer)
00034     {
00035         // Select a report interval that is both suitable for the purposes
00036         // of the app and supported by the sensor.
00037         uint32 minReportIntervalMsecs = _accelerometer->MinimumReportInterval;
00038         _accelerometer->ReportInterval = minReportIntervalMsecs > 16 ? minReportIntervalMsecs : 16;
00039
00040         // Subscribe to accelerometer ReadingChanged events.
00041         _readingToken = _accelerometer->ReadingChanged::add(
00042             ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(
00043                 this, &Scenario1_BackgroundTask::ReadingChanged));
00044
00045         // Take a deferral that is released when the task is completed.
00046         _deferral = Platform::Agile<BackgroundTaskDeferral^>(taskInstance->GetDeferral());
00047
00048         // Get notified when the task is canceled.
00049         taskInstance->Canceled += ref new BackgroundTaskCanceledEventHandler(
00050             this, &Scenario1_BackgroundTask::OnCanceled);
00051
00052         // Store a setting so that the app knows that the task is running.
00053         ApplicationData::Current->LocalSettings->Values->Insert("IsBackgroundTaskActive",
00054             dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(true)));
00055     }
00056 }
00057
00058 /// <summary>
00059 /// Called when the background task is canceled by the app or by the system.
00060 /// </summary>
00061 /// <param name="sender"></param>
00062 /// <param name="reason"></param>
00063 void Scenario1_BackgroundTask::OnCanceled(IBackgroundTaskInstance^ /*sender*/,
00064     BackgroundTaskCancellationReason reason)
00065 {
00066     ApplicationData::Current->LocalSettings->Values->Insert("TaskCancelationReason",
00067         reason.ToString());
00068
00069     ApplicationData::Current->LocalSettings->Values->Insert("SampleCount",
00070         dynamic_cast<PropertyValue^>(PropertyValue::CreateUInt64(_sampleCount)));
00071
00072     ApplicationData::Current->LocalSettings->Values->Insert("IsBackgroundTaskActive",
00073         dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(false)));
00074
00075     if (nullptr != _accelerometer)
00076     {
00077         _accelerometer->ReadingChanged::remove(_readingToken);
00078     }
00079
00080     // Complete the background task (this raises the OnCompleted event on the corresponding
00081     // BackgroundTaskRegistration).
00082     _deferral->Complete();
00083 }
00084
00085 /// <summary>
00086 /// This is the event handler for acceleroemter ReadingChanged events.
00087 /// </summary>
00088 /// <param name="sender"></param>
00089 /// <param name="e"></param>
00090 void Scenario1_BackgroundTask::ReadingChanged(Accelerometer^ sender,
00091     AccelerometerReadingChangedEventArgs^ e)
00092 {
00093     _sampleCount++;
00094
00095     // Save the sample count if the foreground app is visible.
00096     bool appVisible = (bool)ApplicationData::Current->LocalSettings->Values->Lookup("IsAppVisible");
00097     if (appVisible)
00098     {
00099         ApplicationData::Current->LocalSettings->Values->Insert("SampleCount",
00100             dynamic_cast<PropertyValue^>(PropertyValue::CreateUInt64(_sampleCount)));
00101     }
00102 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/pch.cpp Source File

  • SecondaryTiles
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/pch.cpp Source File

  • UserDataAccountManager
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/BackgroundColor/Custom/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • BackgroundColor
  • Custom

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI;
00003 using Windows.UI.StartScreen;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.LiveTiles.BasicState.BackgroundColor.Custom
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private string _tileId;
00022
00023         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00024         {
00025             base.IsEnabled = false;
00026
00027             _tileId = DateTime.Now.Ticks.ToString();
00028
00029             SecondaryTile tile = new SecondaryTile(_tileId, "Custom Color", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
00030             tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00031             tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00032             tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00033             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00034             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00035             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00036             tile.VisualElements.BackgroundColor = Color.FromArgb(255, 0, 171, 48);
00037             await tile.RequestCreateAsync();
00038
00039             base.IsEnabled = true;
00040         }
00041     }
00042 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HelperFunctions Member List

This is the complete list of members for HelperFunctions, including all inherited members.
UpdateCanvasSize(Windows::UI::Xaml::FrameworkElement^root, Windows::UI::Xaml::FrameworkElement^output, Windows::UI::Xaml::FrameworkElement^inkCanvas) | HelperFunctions | [static]
UpdateCanvasSize(FrameworkElement root, FrameworkElement output, FrameworkElement inkCanvas) | HelperFunctions | [inline, static]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

pch.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include <algorithm>
00004
00005 template<typename T, typename U>
00006 U GetValueFromPropertySet(Windows::Foundation::Collections::IPropertySet^ propertySet, Platform::String^ key, U defaultValue)
00007 {
00008     try
00009     {
00010         return static_cast<U>(safe_cast<T>(propertySet->Lookup(key)));
00011     }
00012     catch (Platform::OutOfBoundsException^)
00013     {
00014         // The key is not present in the PropertySet. Return the default value.
00015         return defaultValue;
00016     }
00017 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/BackgroundWithAppOpen/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • BackgroundWithAppOpen

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using System;
00003 using System.Linq;
00004 using System.Threading.Tasks;
00005 using Windows.ApplicationModel.Background;
00006 using Windows.ApplicationModel.Core;
00007 using Windows.Storage;
00008 using Windows.UI.Notifications;
00009 using Windows.UI.Popups;
00010 using Windows.UI.Xaml.Controls;
00011
00012 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00013
00014 namespace Notifications.ScenarioPages.Toasts.ActivationTypes.BackgroundWithAppOpen
00015 {
00016     /// <summary>
00017     /// An empty page that can be used on its own or navigated to within a Frame.
00018     /// </summary>
00019     public sealed partial class ScenarioElement : UserControl
00020     {
00021         private static readonly string BACKGROUND_ENTRY_POINT = typeof(BackgroundTasks.ToastNotificationQuickReplyTask).FullName;
00022
00023         public ScenarioElement()
00024         {
00025             this.InitializeComponent();
00026
00027             Initialize();
00028         }
00029
00030         private async void Initialize()
00031         {
00032             // Clear all existing notifications
00033             ToastNotificationManager.History.Clear();
00034
00035             // Register background task
00036             if (!await RegisterBackgroundTask())
00037             {
00038                 await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
00039                 return;
00040             }
00041
00042             // Pop notifications
00043             popToastControl.Payload =
00044                 $@"
00045                 <toast activationType='background' launch='args'>
00046                     <visual>
00047                         <binding template='ToastGeneric'>
00048                             <text>Background with App Open</text>
00049                             <text>Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
00050                         </binding>
00051                     </visual>
00052                     <actions>
00053
00054                         <input
00055                             id = 'message'
00056                             type = 'text'
00057                             title = 'Message'
00058                             placeHolderContent = 'Enter ""Windows 10""'
00059                             defaultInput = 'Windows 10' />
00060
00061                         <action activationType = 'background'
00062                                 arguments = 'quickReply'
00063                                 content = 'submit' />
00064
00065                         <action activationType = 'background'
00066                                 arguments = 'cancel'
00067                                 content = 'cancel' />
00068
00069                     </actions>
00070                 </toast>";
00071         }
00072
00073         private async Task<bool> RegisterBackgroundTask()
00074         {
00075             // Unregister any previous exising background task
00076             UnregisterBackgroundTask();
00077
00078             // Request access
00079             BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
00080
00081             // If denied
00082             if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
00083                 return false;
00084
00085             // Construct the background task
00086             BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
00087             {
00088                 Name = BACKGROUND_ENTRY_POINT,
00089                 TaskEntryPoint = BACKGROUND_ENTRY_POINT
00090             };
00091
00092             // Set trigger for Toast History Changed
00093             builder.SetTrigger(new ToastNotificationActionTrigger());
00094
00095             // And register the background task
00096             BackgroundTaskRegistration registration = builder.Register();
00097
00098             // And then listen for when the background task updates progress (it passes the toast change type)
00099             registration.Completed += BackgroundTask_Completed;
00100
00101             return true;
00102         }
00103
00104         private async void BackgroundTask_Completed(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
00105         {
00106             await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
00107             {
00108                 string error = BackgroundTaskStorage.GetError();
00109
00110                 if (error != null)
00111                 {
00112                     new MessageDialog(error, "Error").ShowAsync();
00113                     return;
00114                 }
00115
00116                 ApplicationDataCompositeValue result = (ApplicationDataCompositeValue)BackgroundTaskStorage.GetAnswer();
00117
00118                 OnResultReceived(result);
00119
00120             });
00121         }
00122
00123         private void OnResultReceived(ApplicationDataCompositeValue result)
00124         {
00125             switch (stepsControl.Step)
00126             {
00127                 case 1:
00128                     validateStep1(result);
00129                     break;
00130             }
00131         }
00132
00133         private async void validateStep1(ApplicationDataCompositeValue result)
00134         {
00135             if (result.Count != 1)
00136                 await new MessageDialog("ERROR: Expected 1 user input value, but there were " + result.Count).ShowAsync();
00137
00138             else if (!result.ContainsKey("message"))
00139                 await new MessageDialog("ERROR: Expected a user input value for 'message', but there was none.").ShowAsync();
00140
00141             else if (!(result["message"] as string).Equals("Windows 10"))
00142                 await new MessageDialog("ERROR: User input value for 'message' was not 'Windows 10'").ShowAsync();
00143
00144             else
00145             {
00146                 stepsControl.Step = int.MaxValue;
00147                 UnregisterBackgroundTask();
00148             }
00149         }
00150
00151         private static void UnregisterBackgroundTask()
00152         {
00153             var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_ENTRY_POINT));
00154
00155             if (task != null)
00156                 task.Unregister(true);
00157         }
00158     }
00159 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HttpRetryFilter Member List

This is the complete list of members for HttpRetryFilter, including all inherited members.
Close() | HttpRetryFilter | [inline]
CopyRequestMessage(Windows::Web::Http::HttpRequestMessage const &message) | HttpRetryFilter | [private, static]
GetRetriesValue(Windows::Web::Http::HttpRequestMessage const &request) | HttpRetryFilter | [private, static]
HttpRetryFilter(Windows::Web::Http::Filters::IHttpFilter const &innerFilter) | HttpRetryFilter |
m_innerFilter | HttpRetryFilter | [private]
RetriesPropertyName | HttpRetryFilter | [private, static]
SendRequestAsync(Windows::Web::Http::HttpRequestMessage request) | HttpRetryFilter |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/DirectXPage.xaml.h Source File

  • D2DPhotoAdjustment
  • cpp

DirectXPage.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "DirectXPage.g.h"
00015
00016 #include "Common\DeviceResources.h"
00017 #include "PhotoAdjustmentRenderer.h"
00018 #include "PhotoAdjustmentProperties.h"
00019
00020 namespace D2DPhotoAdjustment
00021 {
00022     /// <summary>
00023     /// A page that hosts the Direct2D photo editor in a SwapChainPanel, and photo pipeline UI.
00024     /// </summary>
00025     [Windows::UI::Xaml::Data::Bindable]
00026     public ref class DirectXPage sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
00027     {
00028     public:
00029         DirectXPage();
00030         virtual ~DirectXPage();
00031
00032         void SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^ state);
00033         void LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^ state);
00034
00035         // INotifyPropertyChanged.
00036         virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00037
00038         // Databinding properties for the photo adjustment pipeline.
00039         property double StraightenValue     { double get(); void set(double val); }
00040         property double TemperatureValue    { double get(); void set(double val); }
00041         property double TintValue           { double get(); void set(double val); }
00042         property double SaturationValue     { double get(); void set(double val); }
00043         property double ContrastValue       { double get(); void set(double val); }
00044         property double ShadowsValue        { double get(); void set(double val); }
00045         property double ClarityValue        { double get(); void set(double val); }
00046         property double HighlightsValue     { double get(); void set(double val); }
00047         property double HsMaskRadiusValue   { double get(); void set(double val); }
00048
00049     private:
00050         void CreateRenderer();
00051         void ResetPhotoAdjustmentValues();
00052         void TryUpdateRenderer();
00053
00054         // UI element event handlers.
00055         void Slider_ValueChanged(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00056         void Reset_Click(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
00057
00058         // XAML low-level rendering event handler.
00059         void OnRendering(_In_ Platform::Object^ sender, _In_ Platform::Object^ args);
00060
00061         // Window event handlers.
00062         void OnVisibilityChanged(_In_ Windows::UI::Core::CoreWindow^ sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^ args);
00063
00064         // DisplayInformation event handlers.
00065         void OnDpiChanged(_In_ Windows::Graphics::Display::DisplayInformation^ sender, _In_ Platform::Object^ args);
00066         void OnOrientationChanged(_In_ Windows::Graphics::Display::DisplayInformation^ sender, _In_ Platform::Object^ args);
00067         void OnDisplayContentsInvalidated(_In_ Windows::Graphics::Display::DisplayInformation^ sender, _In_ Platform::Object^ args);
00068         void OnColorProfileChanged(_In_ Windows::Graphics::Display::DisplayInformation^ sender, _In_ Platform::Object^ args);
00069
00070         // Other event handlers.
00071         void OnCompositionScaleChanged(_In_ Windows::UI::Xaml::Controls::SwapChainPanel^ sender, _In_ Object^ args);
00072         void OnSwapChainPanelSizeChanged(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^ e);
00073
00074         // Resources used to draw the DirectX content in the XAML page.
00075         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00076         std::unique_ptr<PhotoAdjustmentRenderer> m_renderer;
00077         bool m_isWindowVisible;
00078         bool m_suppressRendererUpdates;
00079
00080         PhotoAdjustmentProperties m_properties;
00081
00082         // INotifyPropertyChanged.
00083         void OnPropertyChanged(Platform::String^ propertyName);
00084     };
00085 }
00086
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InstructionsControl Member List

This is the complete list of members for InstructionsControl, including all inherited members.
InstructionsControl() InstructionsControl [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario4.xaml.h Source File

  • ApplicationResources
  • cpp

scenario4.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4.xaml.h
00013 // Declaration of the Scenario4 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario4.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario4 sealed
00030         {
00031         public:
00032             Scenario4();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         private:
00037             MainPage^ rootPage;
00038       };
00039
00040 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/pch.cpp Source File

  • Logging
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.h Source File

  • ContentIndexer
  • cpp

S3_RetrieveWithAPI.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S3_RetrieveWithAPI.xaml.h
00014 // Declaration of the S3_RetrieveWithAPI class
00015 //
00016
00017 #pragma once
00018 #include "S3_RetrieveWithAPI.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S3_RetrieveWithAPI sealed
00023     {
00024     public:
00025         S3_RetrieveWithAPI();
00026
00027     private:
00028         void AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void RetrieveAllItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void RetrieveMatchingItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/01_MediaElement.xaml.cs Source File

  • AdvancedCasting
  • cs

01_MediaElement.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using ScreenCasting.Data.Azure;
00013 using ScreenCasting.Data.Common;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace ScreenCasting
00019 {
00020     public sealed partial class Scenario01 : Page
00021     {
00022         private MainPage rootPage;
00023         private VideoMetaData video;
00024         public Scenario01()
00025         {
00026             this.InitializeComponent();
00027
00028             rootPage = MainPage.Current;
00029
00030             //Subscribe to player events
00031             player.MediaOpened += Player_MediaOpened;
00032             player.MediaFailed += Player_MediaFailed;
00033             player.CurrentStateChanged += Player_CurrentStateChanged;
00034
00035             // Get a video
00036             AzureDataProvider dataProvider = new AzureDataProvider();
00037             video = dataProvider.GetRandomVideo();
00038             this.player.Source = video.VideoLink;
00039             this.LicenseText.Text = "License: " + video.License;
00040
00041             //Set the source on the MediaElement
00042             rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
00043
00044             // Use the compat version of the transport controls
00045             this.player.TransportControls.IsCompact = true;
00046         }
00047
00048         protected override void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             rootPage = MainPage.Current;
00051         }
00052
00053         #region Media Element Methods
00054         private void Player_CurrentStateChanged(object sender, RoutedEventArgs e)
00055         {
00056             if (this.player.CurrentState != Windows.UI.Xaml.Media.MediaElementState.Closed)
00057                 rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
00058         }
00059         private void Player_MediaFailed(object sender, ExceptionRoutedEventArgs e)
00060         {
00061             rootPage.NotifyUser(string.Format("Failed to load '{0}', {1}", video.Title, e.ErrorMessage), NotifyType.ErrorMessage);
00062         }
00063         private void Player_MediaOpened(object sender, RoutedEventArgs e)
00064         {
00065             rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);
00066         }
00067
00068         #endregion
00069
00070     }
00071 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/Scenario1_ConfigureMobileHotspot.xaml.cs Source File

  • MobileHotspot
  • cs

Scenario1_ConfigureMobileHotspot.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Networking.NetworkOperators;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario1_ConfigureMobileHotspot : Page
00021     {
00022         NetworkOperatorTetheringManager m_tetheringManager = null;
00023         bool m_applying = false;
00024
00025         public Scenario1_ConfigureMobileHotspot()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             m_tetheringManager = Helpers.TryGetCurrentNetworkOperatorTetheringManager();
00033
00034             if (m_tetheringManager != null)
00035             {
00036                 InitializeTetheringControls();
00037                 HotspotPanel.Visibility = Visibility.Visible;
00038             }
00039         }
00040
00041         private void AddComboBoxItem(ComboBox comboBox, string name, object value, bool selected)
00042         {
00043             var item = new ComboBoxItem { Tag = value, Content = name };
00044             BandComboBox.Items.Add(item);
00045             if (selected)
00046             {
00047                 BandComboBox.SelectedItem = item;
00048             }
00049         }
00050
00051         private void InitializeTetheringControls()
00052         {
00053             NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();
00054
00055             SsidTextBox.Text = configuration.Ssid;
00056             PassphraseTextBox.Text = configuration.Passphrase;
00057
00058             // Fill the Band combo box with supported bands, and select the current one.
00059             TetheringWiFiBand currentBand = configuration.Band;
00060             BandComboBox.Items.Clear();
00061             for (TetheringWiFiBand band = TetheringWiFiBand.Auto; band <= TetheringWiFiBand.FiveGigahertz; band++)
00062             {
00063                 if (Helpers.IsBandSupported(configuration, band))
00064                 {
00065                     AddComboBoxItem(BandComboBox, Helpers.GetFriendlyName(band), band, band == currentBand);
00066                 }
00067             }
00068             if (BandComboBox.SelectedIndex == -1)
00069             {
00070                 AddComboBoxItem(BandComboBox, Helpers.GetFriendlyName(currentBand), currentBand, true);
00071             }
00072         }
00073
00074         private async void ApplyChanges_Click(object sender, RoutedEventArgs e)
00075         {
00076             if (m_applying)
00077             {
00078                 return;
00079
00080             }
00081             m_applying = true;
00082
00083             NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();
00084
00085             configuration.Ssid = SsidTextBox.Text;
00086             configuration.Passphrase = PassphraseTextBox.Text;
00087             configuration.Band = (TetheringWiFiBand)((ComboBoxItem)BandComboBox.SelectedItem).Tag;
00088
00089             await m_tetheringManager.ConfigureAccessPointAsync(configuration);
00090             m_applying = false;
00091
00092             InitializeTetheringControls();
00093         }
00094
00095         private void DiscardChanges_Click(object sender, RoutedEventArgs e)
00096         {
00097             InitializeTetheringControls();
00098         }
00099     }
00100 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/SampleConfiguration.h Source File

  • XamlListView
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Scenario1_CurrentActivity.xaml.cs Source File

  • ActivitySensor
  • cs

Scenario1_CurrentActivity.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Enumeration;
00014 using Windows.Devices.Sensors;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario1_CurrentActivity : Page
00021     {
00022         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00023         // as NotifyUser()
00024         MainPage rootPage = MainPage.Current;
00025
00026         // Common class ID for activity sensors
00027         Guid ActivitySensorClassId = new Guid("9D9E0118-1807-4F2E-96E4-2CE57142E196");
00028
00029         public Scenario1_CurrentActivity()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// This is the click handler for the 'Get Current Activity' button.
00036         /// </summary>
00037         /// <param name="sender"></param>
00038         /// <param name="e"></param>
00039         async private void ScenarioGetCurrentActivity(object sender, RoutedEventArgs e)
00040         {
00041             // Reset fields and status
00042             ScenarioOutput_Activity.Text = "No data";
00043             ScenarioOutput_Confidence.Text = "No data";
00044             ScenarioOutput_Timestamp.Text = "No data";
00045             rootPage.NotifyUser("", NotifyType.StatusMessage);
00046
00047             // Determine if we can access activity sensors
00048             var deviceAccessInfo = DeviceAccessInformation.CreateFromDeviceClassId(ActivitySensorClassId);
00049             if (deviceAccessInfo.CurrentStatus == DeviceAccessStatus.Allowed)
00050             {
00051                 // Get the default sensor
00052                 var activitySensor = await ActivitySensor.GetDefaultAsync();
00053                 if (activitySensor != null)
00054                 {
00055                     // Get the current activity reading
00056                     var reading = await activitySensor.GetCurrentReadingAsync();
00057                     if (reading != null)
00058                     {
00059                         ScenarioOutput_Activity.Text = reading.Activity.ToString();
00060                         ScenarioOutput_Confidence.Text = reading.Confidence.ToString();
00061                         ScenarioOutput_Timestamp.Text = reading.Timestamp.ToString("u");
00062                     }
00063                 }
00064                 else
00065                 {
00066                     rootPage.NotifyUser("No activity sensor found", NotifyType.ErrorMessage);
00067                 }
00068             }
00069             else
00070             {
00071                 rootPage.NotifyUser("Access denied to activity sensors", NotifyType.ErrorMessage);
00072             }
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/Views/LiveDashPlayer.xaml.cs Source File

  • LiveDash
  • cs
  • LiveDashApp
  • Views

LiveDashPlayer.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using LiveDash.Util;
00018 using System.Collections.Generic;
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00021
00022 namespace LiveDashApp
00023 {
00024
00025     class DASHEntry
00026     {
00027         private string entryTitle;
00028         private string sourceUrl;
00029
00030         public DASHEntry(string title, string url)
00031         {
00032             entryTitle = title;
00033             sourceUrl = url;
00034         }
00035
00036         public string Title
00037         {
00038             get { return entryTitle; }
00039         }
00040
00041         public string Url
00042         {
00043             get { return sourceUrl; }
00044         }
00045     }
00046     /// <summary>
00047     /// An empty page that can be used on its own or navigated to within a Frame.
00048     /// </summary>
00049     public sealed partial class LiveDashPlayer : Page
00050     {
00051         private MainPage rootPage;
00052         private LiveDash.LiveDashPlayer player;
00053         private bool haveSetSource;
00054         private bool haveSetLiveOffset;
00055         private TimeSpan liveOffset;
00056
00057
00058         public LiveDashPlayer()
00059         {
00060             this.InitializeComponent();
00061             scrollView.HorizontalScrollMode = ScrollMode.Enabled;
00062             scrollView.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
00063
00064             PopulateComboBox();
00065         }
00066
00067
00068         protected override void OnNavigatedTo(NavigationEventArgs e)
00069         {
00070             rootPage = MainPage.Current;
00071         }
00072
00073         protected override void OnNavigatedFrom(NavigationEventArgs e)
00074         {
00075             if (player != null)
00076             {
00077                 player.Close();
00078                 player = null;
00079             }
00080             haveSetSource = false;
00081         }
00082
00083         private async void playButton_Click(object sender, RoutedEventArgs e)
00084         {
00085             // Get URI
00086             if (player != null)
00087             {
00088                 player.Close();
00089                 player = null;
00090             }
00091             Uri uri;
00092             try
00093             {
00094                 uri = new Uri(sourceUrl.Text);
00095             }
00096             catch
00097             {
00098                 rootPage.NotifyUser("Invalid URL given", NotifyType.ErrorMessage);
00099                 return;
00100             }
00101
00102             haveSetSource = true;
00103             player = new LiveDash.LiveDashPlayer();
00104
00105             if (haveSetLiveOffset)
00106             {
00107                 player.DesiredLiveOffset(liveOffset);
00108             }
00109
00110             await player.Initialize(uri, mediaElement);
00111
00112             // Clear the status block when you press play
00113             rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
00114
00115         }
00116
00117         private void setLiveOffsetButton_Click(object sender, RoutedEventArgs e)
00118         {
00119             try
00120             {
00121                 double liveOffsetDouble = double.Parse(liveOffsetValue.Text);
00122                 TimeSpan offset = TimeSpan.FromSeconds(liveOffsetDouble);
00123                 liveOffset = offset;
00124
00125                 if (liveOffsetDouble < 0)
00126                 {
00127                     rootPage.NotifyUser("Live offset cannot be negative", NotifyType.ErrorMessage);
00128                     return;
00129                 }
00130
00131                 if (liveOffsetDouble < 30)
00132                 {
00133                     rootPage.NotifyUser("Cannot set a live offset less than 30 seconds", NotifyType.ErrorMessage);
00134                     return;
00135                 }
00136
00137                 if (liveOffsetDouble % 1 != 0)
00138                 {
00139                     rootPage.NotifyUser("Input must be a whole number (no decimals)", NotifyType.ErrorMessage);
00140                     return;
00141                 }
00142
00143                 haveSetLiveOffset = true;
00144                 rootPage.NotifyUser("Live offset has been set to " + offset.TotalSeconds + " seconds", NotifyType.StatusMessage);
00145             }
00146             catch (Exception)
00147             {
00148                 rootPage.NotifyUser("Invalid live offset given", NotifyType.ErrorMessage);
00149             }
00150
00151
00152         }
00153         private void gotToLiveButton_Click(object sender, RoutedEventArgs e)
00154         {
00155             if (haveSetSource)
00156             {
00157                 if (haveSetLiveOffset)
00158                 {
00159                     player.DesiredLiveOffset(liveOffset);
00160                 }
00161                 player.GoToLive();
00162                 rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
00163             }
00164             else
00165             {
00166                 rootPage.NotifyUser("You must set the source first before going to live", NotifyType.ErrorMessage);
00167             }
00168         }
00169         private void PopulateComboBox()
00170         {
00171             IList<DASHEntry> dashEntryList = new List<DASHEntry>();
00172             dashEntryList.Add(new DASHEntry("DASH-IF Live Stream 1 - Counter", "http://54.201.151.65/livesim/testpic_2s/Manifest.mpd"));
00173             dashEntryList.Add(new DASHEntry("DASH-IF Live Stream 2 - Counter", "http://eu1.eastmark.net/pdash/testpic_6s/Manifest.mpd"));
00174
00175             //Add urls to list here
00176
00177             comboBox1.DataContext = dashEntryList;
00178
00179         }
00180
00181
00182         private void ComboBox_SelectionChanged(object sender, RoutedEventArgs e)
00183         {
00184             var selected = ((ComboBox)sender).SelectedItem;
00185             sourceUrl.Text = ((DASHEntry)selected).Url;
00186         }
00187
00188
00189     }
00190 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainViewModel Member List

This is the complete list of members for MainViewModel, including all inherited members.
_albumItems | MainViewModel | [private]
_collectionItems | MainViewModel | [private]
AlbumItems | MainViewModel |
CollectionItems | MainViewModel |
GetAlbums() | MainViewModel | [inline]
GetCollections() | MainViewModel | [inline]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/SpatialInputHandler.cpp Source File

  • HolographicTagAlong
  • cpp
  • Content

SpatialInputHandler.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SpatialInputHandler.h"
00014 #include <functional>
00015
00016 using namespace HolographicTagAlongSample;
00017
00018 using namespace Windows::Foundation;
00019 using namespace Windows::UI::Input::Spatial;
00020 using namespace std::placeholders;
00021
00022 // Creates and initializes a GestureRecognizer that listens to a Person.
00023 SpatialInputHandler::SpatialInputHandler()
00024 {
00025     // The interaction manager provides an event that informs the app when
00026     // spatial interactions are detected.
00027     m_interactionManager = SpatialInteractionManager::GetForCurrentView();
00028
00029     // Bind a handler to the SourcePressed event.
00030     m_sourcePressedEventToken =
00031         m_interactionManager->SourcePressed +=
00032             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00033                 bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
00034                 );
00035 }
00036
00037 SpatialInputHandler::~SpatialInputHandler()
00038 {
00039     // Unregister our handler for the OnSourcePressed event.
00040     m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
00041 }
00042
00043 // Checks if the user performed an input gesture since the last call to this method.
00044 // Allows the main update loop to check for asynchronous changes to the user
00045 // input state.
00046 SpatialInteractionSourceState^ SpatialInputHandler::CheckForInput()
00047 {
00048     SpatialInteractionSourceState^ sourceState = m_sourceState;
00049     m_sourceState = nullptr;
00050     return sourceState;
00051 }
00052
00053 void SpatialInputHandler::OnSourcePressed(SpatialInteractionManager^ sender, SpatialInteractionSourceEventArgs^ args)
00054 {
00055     m_sourceState = args->State;
00056 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/pch.cpp Source File

  • SpatialSound
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/pch.cpp Source File

  • WebSocket
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // pch.cpp
00014 // Include the standard header and generate the precompiled header.
00015 //
00016
00017 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DftTransform.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

DftTransform.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Define unique GUIDs for the shaders.
00015 DEFINE_GUID(GUID_DFT_H_CS4, 0x6716AAA9, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6);
00016 DEFINE_GUID(GUID_DFT_H_CS5, 0x652562A9, 0x0523, 0x460F, 0xDE, 0x1C, 0x8B, 0x8F, 0xA0, 0x43, 0x1E, 0x86);
00017 DEFINE_GUID(GUID_DFT_V_CS4, 0x6716BCD1, 0x04D0, 0x3750, 0xAF, 0x9C, 0x7B, 0x23, 0xC0, 0x63, 0x5C, 0x61);
00018 DEFINE_GUID(GUID_DFT_V_CS5, 0x895136D1, 0x1511, 0x3850, 0xAF, 0x3B, 0x7A, 0xA3, 0xB0, 0x6C, 0x5D, 0xE1);
00019
00020 enum class TransformType
00021 {
00022     Horizontal,
00023     Vertical
00024 };
00025
00026 class DftTransform : public ID2D1ComputeTransform
00027 {
00028 public:
00029     DftTransform(_In_ ID2D1EffectContext* context, TransformType dftType);
00030
00031     // ID2D1ComputeTransform Methods:
00032     IFACEMETHODIMP_(UINT32) GetInputCount() const { return 1; }
00033     IFACEMETHODIMP SetComputeInfo(_In_ ID2D1ComputeInfo* pComputeInfo);
00034     IFACEMETHODIMP CalculateThreadgroups(
00035         _In_ const D2D1_RECT_L* pOutputRect,
00036         _Out_ UINT32* pDimensionX,
00037         _Out_ UINT32* pDimensionY,
00038         _Out_ UINT32* pDimensionZ
00039         );
00040
00041     // ID2D1Transform Methods:
00042     IFACEMETHODIMP MapOutputRectToInputRects(
00043         _In_ const D2D1_RECT_L* pOutputRect,
00044         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00045         UINT32 inputRectCount
00046         ) const;
00047
00048     IFACEMETHODIMP MapInputRectsToOutputRect(
00049         _In_reads_(inputRectCount) const D2D1_RECT_L* pInputRects,
00050         _In_reads_(inputRectCount) const D2D1_RECT_L* pInputOpaqueSubRects,
00051         UINT32 inputRectCount,
00052         _Out_ D2D1_RECT_L* pOutputRect,
00053         _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00054         );
00055
00056     IFACEMETHODIMP MapInvalidRect(
00057         UINT32 inputIndex,
00058         D2D1_RECT_L invalidInputRect,
00059         _Out_ D2D1_RECT_L* pInvalidOutputRect
00060         ) const;
00061
00062     // IUnknown Methods:
00063     IFACEMETHODIMP_(ULONG) AddRef();
00064     IFACEMETHODIMP_(ULONG) Release();
00065     IFACEMETHODIMP QueryInterface(REFIID riid, _Outptr_ void** ppOutput);
00066
00067 private:
00068     LONG m_cRef;
00069     D2D1_RECT_L m_inputRect;
00070     D3D_FEATURE_LEVEL m_maxLevelSupported;
00071     TransformType m_dftType;
00072
00073     // Used to update the constant buffer for the vertex shader.
00074     struct
00075     {
00076         float magnitudeScale;
00077     } m_constantBuffer;
00078 };
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/Scenario3_SendMIDIMessages.xaml.cs Source File

  • MIDI
  • cs

Scenario3_SendMIDIMessages.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Linq;
00016 using System.Threading.Tasks;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Devices.Midi;
00019 using Windows.Storage.Streams;
00020 using Windows.UI;
00021 using Windows.UI.Core;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024 using Windows.UI.Xaml.Media;
00025 using Windows.UI.Xaml.Navigation;
00026
00027 namespace MIDI
00028 {
00029     /// <summary>
00030     /// An empty page that can be used on its own or navigated to within a Frame.
00031     /// </summary>
00032     public sealed partial class Scenario3_SendMIDIMessages : Page
00033     {
00034         /// <summary>
00035         /// Main Page
00036         /// </summary>
00037         private MainPage rootPage;
00038
00039         /// <summary>
00040         /// Collection of active MidiOutPorts
00041         /// </summary>
00042         private List<IMidiOutPort> midiOutPorts;
00043
00044         /// <summary>
00045         /// Device watcher for MIDI out ports
00046         /// </summary>
00047         MidiDeviceWatcher midiOutDeviceWatcher;
00048
00049         /// <summary>
00050         /// Ordered list to keep track of available MIDI message types
00051         /// </summary>
00052         Dictionary<MidiMessageType, string> messageTypes;
00053
00054         /// <summary>
00055         /// Keep track of the type of message the user intends to send
00056         /// </summary>
00057         MidiMessageType currentMessageType = MidiMessageType.None;
00058
00059         /// <summary>
00060         /// Keep track of the current output device (which could also be the GS synth)
00061         /// </summary>
00062         IMidiOutPort currentMidiOutputDevice;
00063
00064         /// <summary>
00065         /// Set the rootpage context when entering the scenario
00066         /// </summary>
00067         /// <param name="e">Event arguments</param>
00068         protected override void OnNavigatedTo(NavigationEventArgs e)
00069         {
00070             this.rootPage = MainPage.Current;
00071         }
00072
00073         /// <summary>
00074         /// Stop the device watcher when leaving the scenario
00075         /// </summary>
00076         /// <param name="e">Event arguments</param>
00077         protected override void OnNavigatedFrom(NavigationEventArgs e)
00078         {
00079             base.OnNavigatedFrom(e);
00080
00081             // Stop the output device watcher
00082             this.midiOutDeviceWatcher.Stop();
00083
00084             // Close all MidiOutPorts
00085             foreach (IMidiOutPort outPort in this.midiOutPorts)
00086             {
00087                 outPort.Dispose();
00088             }
00089             this.midiOutPorts.Clear();
00090         }
00091
00092         /// <summary>
00093         /// Constructor: Start the device watcher and populate MIDI message types
00094         /// </summary>
00095         public Scenario3_SendMIDIMessages()
00096         {
00097             this.InitializeComponent();
00098
00099             // Initialize the list of active MIDI output devices
00100             this.midiOutPorts = new List<IMidiOutPort>();
00101
00102             // Set up the MIDI output device watcher
00103             this.midiOutDeviceWatcher = new MidiDeviceWatcher(MidiOutPort.GetDeviceSelector(), Dispatcher, this.outputDevices);
00104
00105             // Start watching for devices
00106             this.midiOutDeviceWatcher.Start();
00107
00108             // Populate message types into list
00109             PopulateMessageTypes();
00110         }
00111
00112         /// <summary>
00113         /// Add all available MIDI message types to a map (except for MidiMessageType.None)
00114         /// and populate the MIDI message combo box
00115         /// </summary>
00116         private void PopulateMessageTypes()
00117         {
00118             // Build the list of available MIDI messages for reverse lookup later
00119             this.messageTypes = new Dictionary<MidiMessageType, string>();
00120             this.messageTypes.Add(MidiMessageType.ActiveSensing, "Active Sensing");
00121             this.messageTypes.Add(MidiMessageType.ChannelPressure, "Channel Pressure");
00122             this.messageTypes.Add(MidiMessageType.Continue, "Continue");
00123             this.messageTypes.Add(MidiMessageType.ControlChange, "Control Change");
00124             this.messageTypes.Add(MidiMessageType.MidiTimeCode, "MIDI Time Code");
00125             this.messageTypes.Add(MidiMessageType.NoteOff, "Note Off");
00126             this.messageTypes.Add(MidiMessageType.NoteOn, "Note On");
00127             this.messageTypes.Add(MidiMessageType.PitchBendChange, "Pitch Bend Change");
00128             this.messageTypes.Add(MidiMessageType.PolyphonicKeyPressure, "Polyphonic Key Pressure");
00129             this.messageTypes.Add(MidiMessageType.ProgramChange, "Program Change");
00130             this.messageTypes.Add(MidiMessageType.SongPositionPointer, "Song Position Pointer");
00131             this.messageTypes.Add(MidiMessageType.SongSelect, "Song Select");
00132             this.messageTypes.Add(MidiMessageType.Start, "Start");
00133             this.messageTypes.Add(MidiMessageType.Stop, "Stop");
00134             this.messageTypes.Add(MidiMessageType.SystemExclusive, "System Exclusive");
00135             this.messageTypes.Add(MidiMessageType.SystemReset, "System Reset");
00136             this.messageTypes.Add(MidiMessageType.TimingClock, "Timing Clock");
00137             this.messageTypes.Add(MidiMessageType.TuneRequest, "Tune Request");
00138
00139             // Start with a clean slate
00140             this.messageType.Items.Clear();
00141
00142             // Add the message types to the list
00143             foreach (var messageType in this.messageTypes)
00144             {
00145                 this.messageType.Items.Add(messageType.Value);
00146             }
00147         }
00148
00149         /// <summary>
00150         /// Create a new MidiOutPort for the selected device
00151         /// </summary>
00152         /// <param name="sender">Element that fired the event</param>
00153         /// <param name="e">Event arguments</param>
00154         private async void outputDevices_SelectionChanged(object sender, SelectionChangedEventArgs e)
00155         {
00156             // Get the selected output MIDI device
00157             int selectedOutputDeviceIndex = this.outputDevices.SelectedIndex;
00158
00159             // Try to create a MidiOutPort
00160             if (selectedOutputDeviceIndex < 0)
00161             {
00162                 this.rootPage.NotifyUser("Select a MIDI output device to be able to send messages to it", NotifyType.StatusMessage);
00163                 return;
00164             }
00165
00166             DeviceInformationCollection devInfoCollection = this.midiOutDeviceWatcher.GetDeviceInformationCollection();
00167             if (devInfoCollection == null)
00168             {
00169                 this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
00170                 return;
00171             }
00172
00173             DeviceInformation devInfo = devInfoCollection[selectedOutputDeviceIndex];
00174             if (devInfo == null)
00175             {
00176                 this.rootPage.NotifyUser("Device not found!", NotifyType.ErrorMessage);
00177                 return;
00178             }
00179
00180             this.currentMidiOutputDevice = await MidiOutPort.FromIdAsync(devInfo.Id);
00181             if (this.currentMidiOutputDevice == null)
00182             {
00183                 this.rootPage.NotifyUser("Unable to create MidiOutPort from output device", NotifyType.ErrorMessage);
00184                 return;
00185             }
00186
00187             // We have successfully created a MidiOutPort; add the device to the list of active devices
00188             if (!this.midiOutPorts.Contains(this.currentMidiOutputDevice))
00189             {
00190                 this.midiOutPorts.Add(this.currentMidiOutputDevice);
00191             }
00192
00193             // Enable message type list & reset button
00194             this.messageType.IsEnabled = true;
00195             this.resetButton.IsEnabled = true;
00196
00197             this.rootPage.NotifyUser("Output Device selected successfully! Waiting for message type selection...", NotifyType.StatusMessage);
00198         }
00199
00200         /// <summary>
00201         /// Reset all input fields, including message type
00202         /// </summary>
00203         /// <param name="sender">Element that fired the event</param>
00204         /// <param name="e">Event arguments</param>
00205         private void resetButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00206         {
00207             ResetMessageTypeAndParameters(true);
00208         }
00209
00210         /// <summary>
00211         /// Reset all input fields
00212         /// </summary>
00213         /// <param name="resetMessageType">If true, reset message type list as well</param>
00214         private void ResetMessageTypeAndParameters(bool resetMessageType)
00215         {
00216             // If the flag is set, reset the message type list as well
00217             if (resetMessageType)
00218             {
00219                 this.messageType.SelectedIndex = -1;
00220                 this.currentMessageType = MidiMessageType.None;
00221             }
00222
00223             // Ensure the message type list and reset button are enabled
00224             this.messageType.IsEnabled = true;
00225             this.resetButton.IsEnabled = true;
00226
00227             // Reset selections on parameters
00228             this.parameter1.SelectedIndex = -1;
00229             this.parameter2.SelectedIndex = -1;
00230             this.parameter3.SelectedIndex = -1;
00231
00232             // New selection values will cause parameter boxes to be hidden and disabled
00233             UpdateParameterList1();
00234             UpdateParameterList2();
00235             UpdateParameterList3();
00236
00237             // Disable send button & hide/clear the SysEx buffer text
00238             this.sendButton.IsEnabled = false;
00239             this.rawBufferHeader.Visibility = Visibility.Collapsed;
00240             this.sysExMessageContent.Text = "";
00241             this.sysExMessageContent.Visibility = Visibility.Collapsed;
00242         }
00243
00244         /// <summary>
00245         /// Create a new MIDI message based on the message type and parameter(s) values,
00246         /// and send it to the chosen output device
00247         /// </summary>
00248         /// <param name="sender">Element that fired the event</param>
00249         /// <param name="e">Event arguments</param>
00250         private void sendButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00251         {
00252             IMidiMessage midiMessageToSend = null;
00253
00254             switch (this.currentMessageType)
00255             {
00256                 case MidiMessageType.NoteOff:
00257                     midiMessageToSend = new MidiNoteOffMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
00258                     break;
00259                 case MidiMessageType.NoteOn:
00260                     midiMessageToSend = new MidiNoteOnMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
00261                     break;
00262                 case MidiMessageType.PolyphonicKeyPressure:
00263                     midiMessageToSend = new MidiPolyphonicKeyPressureMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
00264                     break;
00265                 case MidiMessageType.ControlChange:
00266                     midiMessageToSend = new MidiControlChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue), Convert.ToByte(this.parameter3.SelectedValue));
00267                     break;
00268                 case MidiMessageType.ProgramChange:
00269                     midiMessageToSend = new MidiProgramChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
00270                     break;
00271                 case MidiMessageType.ChannelPressure:
00272                     midiMessageToSend = new MidiChannelPressureMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
00273                     break;
00274                 case MidiMessageType.PitchBendChange:
00275                     midiMessageToSend = new MidiPitchBendChangeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToUInt16(this.parameter2.SelectedValue));
00276                     break;
00277                 case MidiMessageType.SystemExclusive:
00278                     var dataWriter = new DataWriter();
00279                     var sysExMessage = this.sysExMessageContent.Text;
00280                     var sysExMessageLength = sysExMessage.Length;
00281
00282                     // Do not send a blank SysEx message
00283                     if (sysExMessageLength == 0)
00284                     {
00285                         return;
00286                     }
00287
00288                     // SysEx messages are two characters long with 1-character space in between them
00289                     // So we add 1 to the message length, so that it is perfectly divisible by 3
00290                     // The loop count tracks the number of individual message pieces
00291                     int loopCount = (sysExMessageLength + 1) / 3;
00292
00293                     // Expecting a string of format "F0 NN NN NN NN.... F7", where NN is a byte in hex
00294                     for (int i = 0; i < loopCount; i++)
00295                     {
00296                         var messageString = sysExMessage.Substring(3 * i, 2);
00297                         var messageByte = Convert.ToByte(messageString, 16);
00298                         dataWriter.WriteByte(messageByte);
00299                     }
00300                     midiMessageToSend = new MidiSystemExclusiveMessage(dataWriter.DetachBuffer());
00301                     break;
00302                 case MidiMessageType.MidiTimeCode:
00303                     midiMessageToSend = new MidiTimeCodeMessage(Convert.ToByte(this.parameter1.SelectedValue), Convert.ToByte(this.parameter2.SelectedValue));
00304                     break;
00305                 case MidiMessageType.SongPositionPointer:
00306                     midiMessageToSend = new MidiSongPositionPointerMessage(Convert.ToUInt16(this.parameter1.SelectedValue));
00307                     break;
00308                 case MidiMessageType.SongSelect:
00309                     midiMessageToSend = new MidiSongSelectMessage(Convert.ToByte(this.parameter1.SelectedValue));
00310                     break;
00311                 case MidiMessageType.TuneRequest:
00312                     midiMessageToSend = new MidiTuneRequestMessage();
00313                     break;
00314                 case MidiMessageType.TimingClock:
00315                     midiMessageToSend = new MidiTimingClockMessage();
00316                     break;
00317                 case MidiMessageType.Start:
00318                     midiMessageToSend = new MidiStartMessage();
00319                     break;
00320                 case MidiMessageType.Continue:
00321                     midiMessageToSend = new MidiContinueMessage();
00322                     break;
00323                 case MidiMessageType.Stop:
00324                     midiMessageToSend = new MidiStopMessage();
00325                     break;
00326                 case MidiMessageType.ActiveSensing:
00327                     midiMessageToSend = new MidiActiveSensingMessage();
00328                     break;
00329                 case MidiMessageType.SystemReset:
00330                     midiMessageToSend = new MidiSystemResetMessage();
00331                     break;
00332                 case MidiMessageType.None:
00333                 default:
00334                     return;
00335             }
00336
00337             // Send the message
00338             this.currentMidiOutputDevice.SendMessage(midiMessageToSend);
00339             this.rootPage.NotifyUser("Message sent successfully", NotifyType.StatusMessage);
00340         }
00341
00342         /// <summary>
00343         /// Construct a MIDI message possibly with additional parameters,
00344         /// depending on the type of message
00345         /// </summary>
00346         /// <param name="sender">Element that fired the event</param>
00347         /// <param name="e">Event arguments</param>
00348         private void messageType_SelectionChanged(object sender, SelectionChangedEventArgs e)
00349         {
00350             // Find the index of the user's choice
00351             int messageTypeSelectedIndex = this.messageType.SelectedIndex;
00352
00353             // Return if reset
00354             if (messageTypeSelectedIndex == -1)
00355             {
00356                 return;
00357             }
00358
00359             // Clear the UI
00360             ResetMessageTypeAndParameters(false);
00361
00362             // Find the key by index; that's our message type
00363             int count = 0;
00364             foreach (var messageType in messageTypes)
00365             {
00366                 if (messageTypeSelectedIndex == count)
00367                 {
00368                     this.currentMessageType = messageType.Key;
00369                     break;
00370                 }
00371                 count++;
00372             }
00373
00374             // Some MIDI message types don't need additional parameters
00375             // For them, show the Send button as soon as user selects message type from the list
00376             switch (this.currentMessageType)
00377             {
00378                 // SysEx messages need to be in a particular format
00379                 case MidiMessageType.SystemExclusive:
00380                     this.rawBufferHeader.Visibility = Visibility.Visible;
00381                     this.sysExMessageContent.Visibility = Visibility.Visible;
00382                     // Provide start (0xF0) and end (0xF7) of SysEx values
00383                     sysExMessageContent.Text = "F0 F7";
00384                     // Let the user know the expected format of the message
00385                     this.rootPage.NotifyUser("Expecting a string of format 'NN NN NN NN....', where NN is a byte in hex", NotifyType.StatusMessage);
00386                     this.sendButton.IsEnabled = true;
00387                     break;
00388
00389                 // These messages do not need additional parameters
00390                 case MidiMessageType.ActiveSensing:
00391                 case MidiMessageType.Continue:
00392                 case MidiMessageType.Start:
00393                 case MidiMessageType.Stop:
00394                 case MidiMessageType.SystemReset:
00395                 case MidiMessageType.TimingClock:
00396                 case MidiMessageType.TuneRequest:
00397                     this.sendButton.IsEnabled = true;
00398                     break;
00399
00400                 default:
00401                     this.sendButton.IsEnabled = false;
00402                     break;
00403             }
00404
00405             // Update the first parameter list depending on the MIDI message type
00406             // If no further parameters are required, the list is emptied and hidden
00407             UpdateParameterList1();
00408         }
00409
00410         /// <summary>
00411         /// For MIDI message types that need the first parameter, populate the list
00412         /// based on the message type. For message types that don't need the first
00413         /// parameter, empty and hide it
00414         /// </summary>
00415         private void UpdateParameterList1()
00416         {
00417             // The first parameter is different for different message types
00418             switch (this.currentMessageType)
00419             {
00420                 // For message types that require a first parameter...
00421                 case MidiMessageType.NoteOff:
00422                 case MidiMessageType.NoteOn:
00423                 case MidiMessageType.PolyphonicKeyPressure:
00424                 case MidiMessageType.ControlChange:
00425                 case MidiMessageType.ProgramChange:
00426                 case MidiMessageType.ChannelPressure:
00427                 case MidiMessageType.PitchBendChange:
00428                     // This list is for Channels, of which there are 16
00429                     PopulateParameterList(this.parameter1, 16, "Channel");
00430                     break;
00431
00432                 case MidiMessageType.MidiTimeCode:
00433                     // This list is for further Message Types, of which there are 8
00434                     PopulateParameterList(this.parameter1, 8, "Message Type");
00435                     break;
00436
00437                 case MidiMessageType.SongPositionPointer:
00438                     // This list is for Beats, of which there are 16384
00439                     PopulateParameterList(this.parameter1, 16384, "Beats");
00440                     break;
00441
00442                 case MidiMessageType.SongSelect:
00443                     // This list is for Songs, of which there are 128
00444                     PopulateParameterList(this.parameter1, 128, "Song");
00445                     break;
00446
00447                 case MidiMessageType.SystemExclusive:
00448                     // Start with a clean slate
00449                     this.parameter1.Items.Clear();
00450
00451                     // Hide the first parameter
00452                     this.parameter1.Header = "";
00453                     this.parameter1.IsEnabled = false;
00454                     this.parameter1.Visibility = Visibility.Collapsed;
00455                     this.rootPage.NotifyUser("Please edit the message in the textbox by clicking on 'F0 F7'", NotifyType.StatusMessage);
00456                     break;
00457
00458                 default:
00459                     // Start with a clean slate
00460                     this.parameter1.Items.Clear();
00461
00462                     // Hide the first parameter
00463                     this.parameter1.Header = "";
00464                     this.parameter1.IsEnabled = false;
00465                     this.parameter1.Visibility = Visibility.Collapsed;
00466                     this.rootPage.NotifyUser("", NotifyType.StatusMessage);
00467                     break;
00468             }
00469         }
00470
00471         /// <summary>
00472         /// React to Parameter1 selection change as appropriate
00473         /// </summary>
00474         /// <param name="sender">Element that fired the event</param>
00475         /// <param name="e">Event arguments</param>
00476         private void Parameter1_SelectionChanged(object sender, SelectionChangedEventArgs e)
00477         {
00478             // Find the index of the user's choice
00479             int parameter1SelectedIndex = this.parameter1.SelectedIndex;
00480
00481             // Some MIDI message types don't need additional parameters past parameter 1
00482             // For them, show the Send button as soon as user selects parameter 1 value from the list
00483             switch (this.currentMessageType)
00484             {
00485                 case MidiMessageType.SongPositionPointer:
00486                 case MidiMessageType.SongSelect:
00487
00488                     if (parameter1SelectedIndex != -1)
00489                     {
00490                         this.sendButton.IsEnabled = true;
00491                     }
00492                     break;
00493
00494                 default:
00495                     this.sendButton.IsEnabled = false;
00496                     break;
00497             }
00498
00499             // Update the second parameter list depending on the first parameter selection
00500             // If no further parameters are required, the list is emptied and hidden
00501             UpdateParameterList2();
00502         }
00503
00504         /// <summary>
00505         /// For MIDI message types that need the second parameter, populate the list
00506         /// based on the message type. For message types that don't need the second
00507         /// parameter, empty and hide it
00508         /// </summary>
00509         private void UpdateParameterList2()
00510         {
00511             // Do not proceed if Parameter 1 is not chosen
00512             if (this.parameter1.SelectedIndex == -1)
00513             {
00514                 this.parameter2.Items.Clear();
00515                 this.parameter2.Header = "";
00516                 this.parameter2.IsEnabled = false;
00517                 this.parameter2.Visibility = Visibility.Collapsed;
00518
00519                 return;
00520             }
00521
00522             switch (this.currentMessageType)
00523             {
00524                 case MidiMessageType.NoteOff:
00525                 case MidiMessageType.NoteOn:
00526                 case MidiMessageType.PolyphonicKeyPressure:
00527                     // This list is for Notes, of which there are 128
00528                     PopulateParameterList(this.parameter2, 128, "Note");
00529                     break;
00530
00531                 case MidiMessageType.ControlChange:
00532                     // This list is for Controllers, of which there are 128
00533                     PopulateParameterList(this.parameter2, 128, "Controller");
00534                     break;
00535
00536                 case MidiMessageType.ProgramChange:
00537                     // This list is for Program Numbers, of which there are 128
00538                     PopulateParameterList(this.parameter2, 128, "Program Number");
00539                     break;
00540
00541                 case MidiMessageType.ChannelPressure:
00542                     // This list is for Pressure Values, of which there are 128
00543                     PopulateParameterList(this.parameter2, 128, "Pressure Value");
00544                     break;
00545
00546                 case MidiMessageType.PitchBendChange:
00547                     // This list is for Pitch Bend Values, of which there are 16384
00548                     PopulateParameterList(this.parameter2, 16384, "Pitch Bend Value");
00549                     break;
00550
00551                 case MidiMessageType.MidiTimeCode:
00552                     // This list is for Values, of which there are 16
00553                     PopulateParameterList(this.parameter2, 16, "Value");
00554                     break;
00555
00556                 default:
00557                     // Start with a clean slate
00558                     this.parameter2.Items.Clear();
00559
00560                     // Hide the first parameter
00561                     this.parameter2.Header = "";
00562                     this.parameter2.IsEnabled = false;
00563                     this.parameter2.Visibility = Visibility.Collapsed;
00564                     break;
00565             }
00566         }
00567
00568         /// <summary>
00569         /// React to Parameter2 selection change as appropriate
00570         /// </summary>
00571         /// <param name="sender">Element that fired the event</param>
00572         /// <param name="e">Event arguments</param>
00573         private void Parameter2_SelectionChanged(object sender, SelectionChangedEventArgs e)
00574         {
00575             // Find the index of the user's choice
00576             int parameter2SelectedIndex = this.parameter2.SelectedIndex;
00577
00578             // Some MIDI message types don't need additional parameters past parameter 2
00579             // For them, show the Send button as soon as user selects parameter 2 value from the list
00580             switch (this.currentMessageType)
00581             {
00582                 case MidiMessageType.ProgramChange:
00583                 case MidiMessageType.ChannelPressure:
00584                 case MidiMessageType.PitchBendChange:
00585                 case MidiMessageType.MidiTimeCode:
00586
00587                     if (parameter2SelectedIndex != -1)
00588                     {
00589                         this.sendButton.IsEnabled = true;
00590                     }
00591                     break;
00592
00593                 default:
00594                     this.sendButton.IsEnabled = false;
00595                     break;
00596             }
00597
00598             // Update the third parameter list depending on the second parameter selection
00599             // If no further parameters are required, the list is emptied and hidden
00600             UpdateParameterList3();
00601         }
00602
00603         /// <summary>
00604         /// For MIDI message types that need the third parameter, populate the list
00605         /// based on the message type. For message types that don't need the third
00606         /// parameter, empty and hide it
00607         /// </summary>
00608         private void UpdateParameterList3()
00609         {
00610             // Do not proceed if Parameter 2 is not chosen
00611             if (this.parameter2.SelectedIndex == -1)
00612             {
00613                 this.parameter3.Items.Clear();
00614                 this.parameter3.Header = "";
00615                 this.parameter3.IsEnabled = false;
00616                 this.parameter3.Visibility = Visibility.Collapsed;
00617
00618                 return;
00619             }
00620
00621             switch (this.currentMessageType)
00622             {
00623                 case MidiMessageType.NoteOff:
00624                 case MidiMessageType.NoteOn:
00625                     // This list is for Velocity Values, of which there are 128
00626                     PopulateParameterList(this.parameter3, 128, "Velocity");
00627                     break;
00628
00629                 case MidiMessageType.PolyphonicKeyPressure:
00630                     // This list is for Pressure Values, of which there are 128
00631                     PopulateParameterList(this.parameter3, 128, "Pressure");
00632                     break;
00633
00634                 case MidiMessageType.ControlChange:
00635                     // This list is for Values, of which there are 128
00636                     PopulateParameterList(this.parameter3, 128, "Value");
00637                     break;
00638
00639                 default:
00640                     // Start with a clean slate
00641                     this.parameter3.Items.Clear();
00642
00643                     // Hide the first parameter
00644                     this.parameter3.Header = "";
00645                     this.parameter3.IsEnabled = false;
00646                     this.parameter3.Visibility = Visibility.Collapsed;
00647                     break;
00648             }
00649         }
00650
00651         /// <summary>
00652         /// React to Parameter3 selection change as appropriate
00653         /// </summary>
00654         /// <param name="sender">Element that fired the event</param>
00655         /// <param name="e">Event arguments</param>
00656         private void Parameter3_SelectionChanged(object sender, SelectionChangedEventArgs e)
00657         {
00658             // Find the index of the user's choice
00659             int parameter3SelectedIndex = this.parameter3.SelectedIndex;
00660
00661             // The last set of MIDI message types don't need additional parameters
00662             // For them, show the Send button as soon as user selects parameter 3 value from the list
00663             // Set default to disable Send button for any message types that fall through
00664             switch (this.currentMessageType)
00665             {
00666                 case MidiMessageType.NoteOff:
00667                 case MidiMessageType.NoteOn:
00668                 case MidiMessageType.PolyphonicKeyPressure:
00669                 case MidiMessageType.ControlChange:
00670
00671                     if (parameter3SelectedIndex != -1)
00672                     {
00673                         this.sendButton.IsEnabled = true;
00674                     }
00675                     break;
00676
00677                 default:
00678                     this.sendButton.IsEnabled = false;
00679                     break;
00680             }
00681         }
00682
00683         /// <summary>
00684         /// Helper function to populate a dropdown lists with options
00685         /// </summary>
00686         /// <param name="list">The parameter list to populate</param>
00687         /// <param name="numberOfOptions">Number of options in the list</param>
00688         /// <param name="listName">The header to display to the user</param>
00689         private void PopulateParameterList(ComboBox list, int numberOfOptions, string listName)
00690         {
00691             // Start with a clean slate
00692             list.Items.Clear();
00693
00694             // Add the options to the list
00695             for (int i = 0; i < numberOfOptions; i++)
00696             {
00697                 list.Items.Add(i);
00698             }
00699
00700             // Show the list, so that the user can make the next choice
00701             list.Header = listName;
00702             list.IsEnabled = true;
00703             list.Visibility = Visibility.Visible;
00704         }
00705     }
00706 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs Source File

  • SpeechRecognitionAndSynthesis
  • cs

Scenario_PauseAsync.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.Media.SpeechRecognition;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario_PauseAsync : Page
00025     {
00026         // Reference to the main sample page in order to post status messages.
00027         private MainPage rootPage;
00028
00029         // The speech recognizer used throughout this sample.
00030         private SpeechRecognizer speechRecognizer;
00031
00032         // Keep track of whether the continuous recognizer is currently running, so it can be cleaned up appropriately.
00033         private bool isListening;
00034
00035         // These speech recognition constraints will be added and removed from the recognizer.
00036         private SpeechRecognitionListConstraint emailConstraint;
00037         private SpeechRecognitionListConstraint phoneConstraint;
00038
00039         public Scenario_PauseAsync()
00040         {
00041             InitializeComponent();
00042             isListening = false;
00043         }
00044
00045         /// <summary>
00046         /// Upon entering the scenario, ensure that we have permissions to use the Microphone. This may entail popping up
00047         /// a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to
00048         /// prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers
00049         /// should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow
00050         /// audio input.
00051         /// </summary>
00052         /// <param name="e">Unused navigation parameters</param>
00053         protected async override void OnNavigatedTo(NavigationEventArgs e)
00054         {
00055             rootPage = MainPage.Current;
00056
00057             // Prompt the user for permission to access the microphone. This request will only happen
00058             // once, it will not re-prompt if the user rejects the permission.
00059             bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
00060             if (permissionGained)
00061             {
00062                 btnRecognize.IsEnabled = true;
00063
00064                 await InitializeRecognizer();
00065             }
00066             else
00067             {
00068                 resultTextBlock.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
00069                 btnRecognize.IsEnabled = false;
00070             }
00071         }
00072
00073         /// <summary>
00074         /// Initialize Speech Recognizer and compile constraints.
00075         /// </summary>
00076         /// <param name="recognizerLanguage">Language to use for the speech recognizer</param>
00077         /// <returns>Awaitable task.</returns>
00078         private async Task InitializeRecognizer()
00079         {
00080             if (speechRecognizer != null)
00081             {
00082                 // cleanup prior to re-initializing this scenario.
00083                 speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
00084                 speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
00085                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00086
00087                 speechRecognizer.Dispose();
00088                 speechRecognizer = null;
00089             }
00090
00091             speechRecognizer = new SpeechRecognizer();
00092
00093             // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
00094             // of an audio indicator to help the user understand whether they're being heard.
00095             speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;
00096
00097             // It's not valid to pause a list grammar recognizer and recompile the constraints without at least one
00098             // constraint in place, so create a permanent constraint.
00099             var goHomeConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Go Home" }, "gohome");
00100
00101             // These speech recognition constraints will be added and removed from the recognizer.
00102             emailConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Send email" }, "email");
00103             phoneConstraint = new SpeechRecognitionListConstraint(new List<string>() { "Call phone" }, "phone");
00104
00105             // Add some of the constraints initially, so we don't start with an empty list of constraints.
00106             speechRecognizer.Constraints.Add(goHomeConstraint);
00107             speechRecognizer.Constraints.Add(emailConstraint);
00108
00109             SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
00110             if (result.Status != SpeechRecognitionResultStatus.Success)
00111             {
00112                 // Disable the recognition buttons.
00113                 btnRecognize.IsEnabled = false;
00114
00115                 // Let the user know that the grammar didn't compile properly.
00116                 resultTextBlock.Text = "Unable to compile grammar.";
00117             }
00118
00119             // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
00120             // some recognized phrases occur, or the garbage rule is hit.
00121             speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
00122             speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;
00123         }
00124
00125         /// <summary>
00126         /// Upon leaving, clean up the speech recognizer. Ensure we aren't still listening, and disable the event
00127         /// handlers to prevent leaks.
00128         /// </summary>
00129         /// <param name="e">Unused navigation parameters.</param>
00130         protected async override void OnNavigatedFrom(NavigationEventArgs e)
00131         {
00132             if (speechRecognizer != null)
00133             {
00134                 if (isListening)
00135                 {
00136                     await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
00137                     isListening = false;
00138                 }
00139
00140                 speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
00141                 speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
00142                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00143
00144                 speechRecognizer.Dispose();
00145                 speechRecognizer = null;
00146             }
00147         }
00148
00149         /// <summary>
00150         /// Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if
00151         /// some transient issues occur.
00152         /// </summary>
00153         /// <param name="sender">The continuous recognition session</param>
00154         /// <param name="args">The state of the recognizer</param>
00155         private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
00156         {
00157             if (args.Status != SpeechRecognitionResultStatus.Success)
00158             {
00159                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00160                 {
00161                     rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
00162                     recognizeButtonText.Text = " Continuous Recognition";
00163                     btnEmailGrammar.IsEnabled = false;
00164                     btnPhoneGrammar.IsEnabled = false;
00165                     isListening = false;
00166                 });
00167             }
00168         }
00169
00170         /// <summary>
00171         /// Handle events fired when a result is generated. This may include a garbage rule that fires when general room noise
00172         /// or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with
00173         /// low confidence).
00174         /// </summary>
00175         /// <param name="sender">The Recognition session that generated this result</param>
00176         /// <param name="args">Details about the recognized speech</param>
00177         private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
00178         {
00179             // The garbage rule will not have a tag associated with it, the other rules will return a string matching the tag provided
00180             // when generating the grammar.
00181             string tag = "unknown";
00182             if (args.Result.Constraint != null)
00183             {
00184                 tag = args.Result.Constraint.Tag;
00185             }
00186
00187             // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their
00188             // grammar based on testing.
00189             if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
00190                 args.Result.Confidence == SpeechRecognitionConfidence.High)
00191             {
00192                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00193                 {
00194                     resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
00195                 });
00196             }
00197             else
00198             {
00199                 // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
00200                 // is not the primary input mechanism for the application.
00201                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00202                 {
00203                     resultTextBlock.Text = string.Format("Sorry, I didn't catch that. (Heard: '{0}', Tag: {1}, Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
00204                 });
00205             }
00206         }
00207
00208         /// <summary>
00209         /// Provide feedback to the user based on whether the recognizer is receiving their voice input.
00210         /// </summary>
00211         /// <param name="sender">The recognizer that is currently running.</param>
00212         /// <param name="args">The current state of the recognizer.</param>
00213         private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
00214         {
00215             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00216             {
00217                 rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
00218             });
00219         }
00220
00221         /// <summary>
00222         /// Begin recognition or finish the recognition session.
00223         /// </summary>
00224         /// <param name="sender">The button that generated this event</param>
00225         /// <param name="e">Unused event details</param>
00226         public async void Recognize_Click(object sender, RoutedEventArgs e)
00227         {
00228             UpdateUI(false);
00229             if (isListening == false)
00230             {
00231                 // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
00232                 // This prevents an exception from occurring.
00233                 if (speechRecognizer.State == SpeechRecognizerState.Idle)
00234                 {
00235                     // Reset the text to prompt the user.
00236                     try
00237                     {
00238                         await speechRecognizer.ContinuousRecognitionSession.StartAsync();
00239
00240                         recognizeButtonText.Text = " Stop Continuous Recognition";
00241                         UpdateUI(true);
00242                         infoBoxes.Visibility = Visibility.Visible;
00243                         isListening = true;
00244                     }
00245                     catch (Exception ex)
00246                     {
00247                         var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
00248                         await messageDialog.ShowAsync();
00249                     }
00250                 }
00251             }
00252             else
00253             {
00254                 recognizeButtonText.Text = " Continuous Recognition";
00255                 infoBoxes.Visibility = Visibility.Collapsed;
00256                 isListening = false;
00257
00258                 if (speechRecognizer.State != SpeechRecognizerState.Idle)
00259                 {
00260                     // Cancelling recognition prevents any currently recognized speech from
00261                     // generating a ResultGenerated event. StopAsync() will allow the final session to
00262                     // complete.
00263                     await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
00264                 }
00265
00266                 btnEmailGrammar.IsEnabled = false;
00267                 btnPhoneGrammar.IsEnabled = false;
00268                 btnRecognize.IsEnabled = true;
00269             }
00270
00271         }
00272
00273         /// <summary>
00274         /// Toggle button state while operations are in progress.
00275         /// </summary>
00276         /// <param name="state">State to set the buttons to</param>
00277         private void ToggleButtons(bool state)
00278         {
00279             btnRecognize.IsEnabled = state;
00280             btnEmailGrammar.IsEnabled = state;
00281             btnPhoneGrammar.IsEnabled = state;
00282         }
00283
00284         /// <summary>
00285         /// Adds or removes the 'email' constraint from the recognizer.
00286         /// </summary>
00287         /// <param name="sender">The button that generated this event</param>
00288         /// <param name="e">Unused event details</param>
00289         public async void EmailButton_Click(object sender, RoutedEventArgs e)
00290         {
00291             // Update UI, disabling buttons so the user can't interrupt.
00292             UpdateUI(false);
00293             string newButtonText = "";
00294
00295             long start = DateTime.Now.Ticks;
00296
00297             try
00298             {
00299                 // Pause the session. This allows you to update the grammars without stopping the
00300                 // session and potentially losing audio and a recognition.
00301                 await speechRecognizer.ContinuousRecognitionSession.PauseAsync();
00302
00303                 // Update the grammar appropriately.
00304                 if (emailButtonText.Text.Equals("Remove 'email' grammar"))
00305                 {
00306                     emailButtonText.Text = "Updating...";
00307                     speechRecognizer.Constraints.Remove(emailConstraint);
00308                     newButtonText = "Add 'email' grammar";
00309                     emailInfoTextBlock.Visibility = Visibility.Collapsed;
00310                 }
00311                 else
00312                 {
00313                     emailButtonText.Text = "Updating...";
00314                     speechRecognizer.Constraints.Add(emailConstraint);
00315                     newButtonText = "Remove 'email' grammar";
00316                     emailInfoTextBlock.Visibility = Visibility.Visible;
00317                 }
00318
00319                 // Recompile with the new constraints and resume the session again.
00320                 SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
00321                 if (result.Status != SpeechRecognitionResultStatus.Success)
00322                 {
00323                     // Disable the recognition buttons.
00324                     UpdateUI(false);
00325
00326                     // Let the user know that the grammar didn't compile properly.
00327                     resultTextBlock.Text = "Unable to compile grammar.";
00328
00329                     await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
00330                     return;
00331                 }
00332
00333                 speechRecognizer.ContinuousRecognitionSession.Resume();
00334
00335                 // For diagnostic purposes, display the amount of time it took to update the grammar.
00336                 long elapsed = (DateTime.Now.Ticks - start) / TimeSpan.TicksPerMillisecond;
00337                 msTextBlock.Text = "Grammar update took " + elapsed + " ms";
00338             }
00339             catch (Exception ex)
00340             {
00341                 var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
00342                 await messageDialog.ShowAsync();
00343             }
00344
00345             // Restore the original UI state.
00346             UpdateUI(true);
00347             emailButtonText.Text = newButtonText;
00348         }
00349
00350         /// <summary>
00351         /// Adds or removes the 'phone' constraint from the recognizer.
00352         /// </summary>
00353         /// <param name="sender">The button that generated this event</param>
00354         /// <param name="e">Unused event details</param>
00355         public async void PhoneButton_Click(object sender, RoutedEventArgs e)
00356         {
00357             // Update UI, disabling buttons so the user can't interrupt.
00358             UpdateUI(false);
00359             string newButtonText = "";
00360
00361             long start = DateTime.Now.Ticks;
00362
00363             try
00364             {
00365                 // Pause the session. This allows you to update the grammars without stopping the
00366                 // session and potentially losing audio and a recognition.
00367                 await speechRecognizer.ContinuousRecognitionSession.PauseAsync();
00368
00369                 // Update the grammar appropriately.
00370                 if (phoneButtonText.Text.Equals("Remove 'phone' grammar"))
00371                 {
00372                     phoneButtonText.Text = "Updating...";
00373                     speechRecognizer.Constraints.Remove(phoneConstraint);
00374                     newButtonText = "Add 'phone' grammar";
00375                     phoneInfoTextBlock.Visibility = Visibility.Collapsed;
00376                 }
00377                 else
00378                 {
00379                     phoneButtonText.Text = "Updating...";
00380                     speechRecognizer.Constraints.Add(phoneConstraint);
00381                     newButtonText = "Remove 'phone' grammar";
00382                     phoneInfoTextBlock.Visibility = Visibility.Visible;
00383                 }
00384
00385                 // Recompile with the new constraints and resume the session again.
00386                 SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
00387                 if (result.Status != SpeechRecognitionResultStatus.Success)
00388                 {
00389                     // Disable the recognition buttons.
00390                     UpdateUI(false);
00391
00392                     // Let the user know that the grammar didn't compile properly.
00393                     resultTextBlock.Text = "Unable to compile grammar.";
00394
00395                     await speechRecognizer.ContinuousRecognitionSession.CancelAsync();
00396                     return;
00397                 }
00398
00399                 speechRecognizer.ContinuousRecognitionSession.Resume();
00400
00401                 // For diagnostic purposes, display the amount of time it took to update the grammar.
00402                 long elapsed = (DateTime.Now.Ticks - start) / TimeSpan.TicksPerMillisecond;
00403                 msTextBlock.Text = "Grammar update took " + elapsed + " ms";
00404             }
00405             catch (Exception ex)
00406             {
00407                 var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
00408                 await messageDialog.ShowAsync();
00409             }
00410
00411             // Restore the original UI state.
00412             UpdateUI(true);
00413             phoneButtonText.Text = newButtonText;
00414         }
00415
00416         private void UpdateUI(bool newState)
00417         {
00418             btnRecognize.IsEnabled = newState;
00419             btnEmailGrammar.IsEnabled = newState;
00420             btnPhoneGrammar.IsEnabled = newState;
00421         }
00422     }
00423 }
Generated on Fri Nov 15 2024 22:21:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/pch.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario1_Data.h Source File

  • Calendar
  • cppwinrt

Scenario1_Data.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Data.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_Data : Scenario1_DataT<Scenario1_Data>
00019     {
00020         Scenario1_Data();
00021
00022         void ShowResults_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario1_Data : Scenario1_DataT<Scenario1_Data, implementation::Scenario1_Data>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
Accept_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
AddAdvertiser(AdvertisementWrapper advertiser) | Scenario2 | [inline]
AddSession(SessionWrapper session) | Scenario2 | [inline]
AddSessionRequest(WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser) | Scenario2 | [inline]
CloseSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
Decline_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2 | [inline, protected]
RemoveAdvertiser(int index) | Scenario2 | [inline]
RemoveSession(int index) | Scenario2 | [inline]
RemoveSessionRequest(WiFiDirectServiceSessionRequest request, AdvertisementWrapper advertiser) | Scenario2 | [inline]
rootPage | Scenario2 | [private]
Scenario2() | Scenario2 | [inline]
SelectSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
StopAdvertisement_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
thisLock | Scenario2 | [private]
UpdateAdvertiserStatus(AdvertisementWrapper advertiser) | Scenario2 | [inline]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario2_OvenClientWRL.g.h"
00009 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00010
00011 namespace SDKTemplate
00012 {
00013     namespace WRLInProcessWinRTComponent
00014     {
00015         public ref class OvenClientWRL sealed
00016         {
00017         public:
00018             OvenClientWRL();
00019
00020         private:
00021             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00022
00023             // This scenario uses the Oven as an event source so its lifetime must be maintained
00024             Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> _myOven;
00025         };
00026     }
00027 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
Error(string message) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UserControl_Loaded(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IOnboardingService Member List

This is the complete list of members for IOnboardingService, including all inherited members.
ConfigureWiFiAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType) | IOnboardingService
ConnectAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
GetLastErrorAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
GetScanInfoAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
GetStateAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
GetVersionAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
OffboardAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Scenario2_DocumentFonts.cpp Source File

  • LanguageFont
  • cppwinrt

Scenario2_DocumentFonts.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_DocumentFonts.h"
00014 #include "Scenario2_DocumentFonts.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Globalization::Fonts;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario2_DocumentFonts::Scenario2_DocumentFonts()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario2_DocumentFonts::ApplyFonts_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031
00032         LanguageFontGroup languageFontGroup(L"hi");
00033
00034         ApplyLanguageFont(HeadingTextBlock(), languageFontGroup.DocumentHeadingFont());
00035
00036         // Not all scripts have recommended fonts for "document alternate"
00037         // categories, so need to verify before using it. Note that Hindi does
00038         // have document alternate fonts, so in this case the fallback logic is
00039         // unnecessary, but (for example) Japanese does not have recommendations
00040         // for the document alternate 2 category.
00041         LanguageFont documentFont = languageFontGroup.DocumentAlternate2Font();
00042         if (documentFont == nullptr)
00043         {
00044             documentFont = languageFontGroup.DocumentAlternate1Font();
00045         }
00046         if (documentFont == nullptr)
00047         {
00048             documentFont = languageFontGroup.ModernDocumentFont();
00049         }
00050         ApplyLanguageFont(DocumentTextBlock(), documentFont);
00051     }
00052 }
Generated on Fri Nov 15 2024 22:20:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/SampleConfiguration.cs Source File

  • LiveDash
  • cs
  • LiveDashApp

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "LiveDashPlayer";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Live DASH Player", ClassType=typeof(LiveDashApp.LiveDashPlayer)}
00025 #if DEBUG
00026             ,new Scenario() { Title="Log", ClassType=typeof(LiveDashApp.Log)}
00027
00028 #endif
00029
00030         };
00031     }
00032
00033     public class Scenario
00034     {
00035         public string Title { get; set; }
00036         public Type ClassType { get; set; }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario11.cpp Source File

  • FileAccess
  • cppwinrt

Scenario11.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario11.h"
00014 #include "Scenario11.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario11::Scenario11()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     fire_and_forget Scenario11::GetFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00031     {
00032         auto lifetime = get_strong();
00033
00034         StorageFolder storageFolder = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary);
00035         StorageFile file = (co_await storageFolder.TryGetItemAsync(SampleState::FileName())).try_as<StorageFile>();
00036         if (file != nullptr)
00037         {
00038             rootPage.NotifyUser(L"Operation result: " + file.Name(), NotifyType::StatusMessage);
00039         }
00040         else
00041         {
00042             rootPage.NotifyUser(L"Operation result: null", NotifyType::StatusMessage);
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BindableBase Member List

This is the complete list of members for BindableBase, including all inherited members.
OnPropertyChanged([CallerMemberName] string propertyName=null) | BindableBase | [inline, protected]
PropertyChanged | BindableBase |
SetProperty< T >(ref T storage, T value,[CallerMemberName] String propertyName=null) | BindableBase | [inline, protected]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/Scenario1_Analyze.h Source File

  • JapanesePhoneticAnalysis
  • cppwinrt

Scenario1_Analyze.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Analyze.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_Analyze : Scenario1_AnalyzeT<Scenario1_Analyze>
00019     {
00020         Scenario1_Analyze();
00021
00022         void AnalyzeButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario1_Analyze : Scenario1_AnalyzeT<Scenario1_Analyze, implementation::Scenario1_Analyze>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario1_DevicePicker.h Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario1_DevicePicker.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_DevicePicker.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_DevicePicker : Scenario1_DevicePickerT<Scenario1_DevicePicker>
00020     {
00021         Scenario1_DevicePicker();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         void PickSingleDeviceButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void ShowDevicePickerButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ SDKTemplate::MainPage::Current() };
00031         Windows::Devices::Enumeration::DevicePicker devicePicker{ nullptr };
00032         Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>();
00033
00034         fire_and_forget ShowDevicePicker(bool pickSingle);
00035         fire_and_forget OnDevicePickerDismissed(Windows::Devices::Enumeration::DevicePicker const&, IInspectable const&);
00036         fire_and_forget OnDeviceSelected(Windows::Devices::Enumeration::DevicePicker const&, Windows::Devices::Enumeration::DeviceSelectedEventArgs args);
00037
00038     };
00039 }
00040
00041 namespace winrt::SDKTemplate::factory_implementation
00042 {
00043     struct Scenario1_DevicePicker : Scenario1_DevicePickerT<Scenario1_DevicePicker, implementation::Scenario1_DevicePicker>
00044     {
00045     };
00046 }
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario1_Launch.h Source File

  • TouchKeyboard
  • cppwinrt

Scenario1_Launch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Launch.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Launch : Scenario1_LaunchT<Scenario1_Launch>
00020     {
00021         Scenario1_Launch();
00022     };
00023 }
00024
00025 namespace winrt::SDKTemplate::factory_implementation
00026 {
00027     struct Scenario1_Launch : Scenario1_LaunchT<Scenario1_Launch, implementation::Scenario1_Launch>
00028     {
00029     };
00030 }
00031
00032 #include "CustomTextBox.g.h"
00033
00034 namespace winrt::SDKTemplate::implementation
00035 {
00036     struct CustomTextBox : CustomTextBoxT<CustomTextBox>
00037     {
00038         CustomTextBox()
00039         {
00040             FontFamily(Windows::UI::Xaml::Media::FontFamily{ L"Times New Roman" });
00041             FontStyle(Windows::UI::Text::FontStyle::Italic);
00042             BorderThickness({ 1 });
00043         }
00044
00045     };
00046 }
00047 namespace winrt::SDKTemplate::factory_implementation
00048 {
00049     struct CustomTextBox : CustomTextBoxT<CustomTextBox, implementation::CustomTextBox>
00050     {
00051     };
00052 }
Generated on Fri Nov 15 2024 22:21:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/DeviceResources.cpp Source File

  • SpatialInteractionSource
  • cpp
  • Common

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿
00002 #include "pch.h"
00003 #include "DeviceResources.h"
00004 #include "DirectXHelper.h"
00005
00006 #include <Collection.h>
00007 #include <windows.graphics.directx.direct3d11.interop.h>
00008
00009 using namespace D2D1;
00010 using namespace Microsoft::WRL;
00011 using namespace Windows::Graphics::DirectX::Direct3D11;
00012 using namespace Windows::Graphics::Display;
00013 using namespace Windows::Graphics::Holographic;
00014
00015 // Constructor for DeviceResources.
00016 DX::DeviceResources::DeviceResources()
00017 {
00018     CreateDeviceIndependentResources();
00019 }
00020
00021 // Configures resources that don't depend on the Direct3D device.
00022 void DX::DeviceResources::CreateDeviceIndependentResources()
00023 {
00024     // Initialize Direct2D resources.
00025     D2D1_FACTORY_OPTIONS options {};
00026
00027 #if defined(_DEBUG)
00028     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00029     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00030 #endif
00031
00032     // Initialize the Direct2D Factory.
00033     DX::ThrowIfFailed(
00034         D2D1CreateFactory(
00035             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00036             __uuidof(ID2D1Factory2),
00037             &options,
00038             &m_d2dFactory
00039             )
00040         );
00041
00042     // Initialize the DirectWrite Factory.
00043     DX::ThrowIfFailed(
00044         DWriteCreateFactory(
00045             DWRITE_FACTORY_TYPE_SHARED,
00046             __uuidof(IDWriteFactory2),
00047             &m_dwriteFactory
00048             )
00049         );
00050
00051     // Initialize the Windows Imaging Component (WIC) Factory.
00052     DX::ThrowIfFailed(
00053         CoCreateInstance(
00054             CLSID_WICImagingFactory2,
00055             nullptr,
00056             CLSCTX_INPROC_SERVER,
00057             IID_PPV_ARGS(&m_wicFactory)
00058             )
00059         );
00060 }
00061
00062 void DX::DeviceResources::SetHolographicSpace(HolographicSpace^ holographicSpace)
00063 {
00064     // Cache the holographic space. Used to re-initalize during device-lost scenarios.
00065     m_holographicSpace = holographicSpace;
00066
00067     InitializeUsingHolographicSpace();
00068 }
00069
00070 void DX::DeviceResources::InitializeUsingHolographicSpace()
00071 {
00072     // The holographic space might need to determine which adapter supports
00073     // holograms, in which case it will specify a non-zero PrimaryAdapterId.
00074     LUID id =
00075     {
00076         m_holographicSpace->PrimaryAdapterId.LowPart,
00077         m_holographicSpace->PrimaryAdapterId.HighPart
00078     };
00079
00080     // When a primary adapter ID is given to the app, the app should find
00081     // the corresponding DXGI adapter and use it to create Direct3D devices
00082     // and device contexts. Otherwise, there is no restriction on the DXGI
00083     // adapter the app can use.
00084     if ((id.HighPart != 0) || (id.LowPart != 0))
00085     {
00086         UINT createFlags = 0;
00087 #ifdef DEBUG
00088         if (DX::SdkLayersAvailable())
00089         {
00090             createFlags |= DXGI_CREATE_FACTORY_DEBUG;
00091         }
00092 #endif
00093         // Create the DXGI factory.
00094         ComPtr<IDXGIFactory1> dxgiFactory;
00095         DX::ThrowIfFailed(
00096             CreateDXGIFactory2(
00097                 createFlags,
00098                 IID_PPV_ARGS(&dxgiFactory)
00099                 )
00100             );
00101         ComPtr<IDXGIFactory4> dxgiFactory4;
00102         DX::ThrowIfFailed(dxgiFactory.As(&dxgiFactory4));
00103
00104         // Retrieve the adapter specified by the holographic space.
00105         DX::ThrowIfFailed(
00106             dxgiFactory4->EnumAdapterByLuid(
00107                 id,
00108                 IID_PPV_ARGS(&m_dxgiAdapter)
00109                 )
00110             );
00111     }
00112     else
00113     {
00114         m_dxgiAdapter.Reset();
00115     }
00116
00117     CreateDeviceResources();
00118
00119     m_holographicSpace->SetDirect3D11Device(m_d3dInteropDevice);
00120 }
00121
00122 // Configures the Direct3D device, and stores handles to it and the device context.
00123 void DX::DeviceResources::CreateDeviceResources()
00124 {
00125     // This flag adds support for surfaces with a different color channel ordering
00126     // than the API default. It is required for compatibility with Direct2D.
00127     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00128
00129 #if defined(_DEBUG)
00130     if (DX::SdkLayersAvailable())
00131     {
00132         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00133         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00134     }
00135 #endif
00136
00137     // This array defines the set of DirectX hardware feature levels this app will support.
00138     // Note the ordering should be preserved.
00139     // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
00140     // of running on graphics cards starting with feature level 10.0.
00141     D3D_FEATURE_LEVEL featureLevels [] =
00142     {
00143         D3D_FEATURE_LEVEL_12_1,
00144         D3D_FEATURE_LEVEL_12_0,
00145         D3D_FEATURE_LEVEL_11_1,
00146         D3D_FEATURE_LEVEL_11_0,
00147         D3D_FEATURE_LEVEL_10_1,
00148         D3D_FEATURE_LEVEL_10_0
00149     };
00150
00151     // Create the Direct3D 11 API device object and a corresponding context.
00152     ComPtr<ID3D11Device> device;
00153     ComPtr<ID3D11DeviceContext> context;
00154
00155     const D3D_DRIVER_TYPE driverType = m_dxgiAdapter == nullptr ? D3D_DRIVER_TYPE_HARDWARE : D3D_DRIVER_TYPE_UNKNOWN;
00156     const HRESULT hr = D3D11CreateDevice(
00157         m_dxgiAdapter.Get(),        // Either nullptr, or the primary adapter determined by Windows Holographic.
00158         driverType,                 // Create a device using the hardware graphics driver.
00159         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00160         creationFlags,              // Set debug and Direct2D compatibility flags.
00161         featureLevels,              // List of feature levels this app can support.
00162         ARRAYSIZE(featureLevels),   // Size of the list above.
00163         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00164         &device,                    // Returns the Direct3D device created.
00165         &m_d3dFeatureLevel,         // Returns feature level of device created.
00166         &context                    // Returns the device immediate context.
00167         );
00168
00169     if (FAILED(hr))
00170     {
00171         // If the initialization fails, fall back to the WARP device.
00172         // For more information on WARP, see:
00173         // http://go.microsoft.com/fwlink/?LinkId=286690
00174         DX::ThrowIfFailed(
00175             D3D11CreateDevice(
00176                 nullptr,              // Use the default DXGI adapter for WARP.
00177                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00178                 0,
00179                 creationFlags,
00180                 featureLevels,
00181                 ARRAYSIZE(featureLevels),
00182                 D3D11_SDK_VERSION,
00183                 &device,
00184                 &m_d3dFeatureLevel,
00185                 &context
00186                 )
00187             );
00188     }
00189
00190     // Store pointers to the Direct3D device and immediate context.
00191     DX::ThrowIfFailed(
00192         device.As(&m_d3dDevice)
00193         );
00194
00195     DX::ThrowIfFailed(
00196         context.As(&m_d3dContext)
00197         );
00198
00199     // Acquire the DXGI interface for the Direct3D device.
00200     ComPtr<IDXGIDevice3> dxgiDevice;
00201     DX::ThrowIfFailed(
00202         m_d3dDevice.As(&dxgiDevice)
00203         );
00204
00205     // Wrap the native device using a WinRT interop object.
00206     m_d3dInteropDevice = CreateDirect3DDevice(dxgiDevice.Get());
00207
00208     // Cache the DXGI adapter.
00209     // This is for the case of no preferred DXGI adapter, or fallback to WARP.
00210     ComPtr<IDXGIAdapter> dxgiAdapter;
00211     DX::ThrowIfFailed(
00212         dxgiDevice->GetAdapter(&dxgiAdapter)
00213         );
00214     DX::ThrowIfFailed(
00215         dxgiAdapter.As(&m_dxgiAdapter)
00216         );
00217
00218     // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
00219     D3D11_FEATURE_DATA_D3D11_OPTIONS3 options;
00220     m_d3dDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS3, &options, sizeof(options));
00221     if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
00222     {
00223         m_supportsVprt = true;
00224     }
00225 }
00226
00227 // Validates the back buffer for each HolographicCamera and recreates
00228 // resources for back buffers that have changed.
00229 // Locks the set of holographic camera resources until the function exits.
00230 void DX::DeviceResources::EnsureCameraResources(
00231     HolographicFrame^ frame,
00232     HolographicFramePrediction^ prediction)
00233 {
00234     UseHolographicCameraResources<void>([this, frame, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00235     {
00236         for (HolographicCameraPose^ pose : prediction->CameraPoses)
00237         {
00238             HolographicCameraRenderingParameters^ renderingParameters = frame->GetRenderingParameters(pose);
00239             CameraResources* pCameraResources = cameraResourceMap[pose->HolographicCamera->Id].get();
00240
00241             pCameraResources->CreateResourcesForBackBuffer(this, renderingParameters);
00242         }
00243     });
00244 }
00245
00246 // Prepares to allocate resources and adds resource views for a camera.
00247 // Locks the set of holographic camera resources until the function exits.
00248 void DX::DeviceResources::AddHolographicCamera(HolographicCamera^ camera)
00249 {
00250     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00251     {
00252         cameraResourceMap[camera->Id] = std::make_unique<CameraResources>(camera);
00253     });
00254 }
00255
00256 // Deallocates resources for a camera and removes the camera from the set.
00257 // Locks the set of holographic camera resources until the function exits.
00258 void DX::DeviceResources::RemoveHolographicCamera(HolographicCamera^ camera)
00259 {
00260     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00261     {
00262         CameraResources* pCameraResources = cameraResourceMap[camera->Id].get();
00263
00264         if (pCameraResources != nullptr)
00265         {
00266             pCameraResources->ReleaseResourcesForBackBuffer(this);
00267             cameraResourceMap.erase(camera->Id);
00268         }
00269     });
00270 }
00271
00272 // Recreate all device resources and set them back to the current state.
00273 // Locks the set of holographic camera resources until the function exits.
00274 void DX::DeviceResources::HandleDeviceLost()
00275 {
00276     if (m_deviceNotify != nullptr)
00277     {
00278         m_deviceNotify->OnDeviceLost();
00279     }
00280
00281     UseHolographicCameraResources<void>([this](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00282     {
00283         for (auto& pair : cameraResourceMap)
00284         {
00285             CameraResources* pCameraResources = pair.second.get();
00286             pCameraResources->ReleaseResourcesForBackBuffer(this);
00287         }
00288     });
00289
00290     InitializeUsingHolographicSpace();
00291
00292     if (m_deviceNotify != nullptr)
00293     {
00294         m_deviceNotify->OnDeviceRestored();
00295     }
00296 }
00297
00298 // Register our DeviceNotify to be informed on device lost and creation.
00299 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00300 {
00301     m_deviceNotify = deviceNotify;
00302 }
00303
00304 // Call this method when the app suspends. It provides a hint to the driver that the app
00305 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00306 void DX::DeviceResources::Trim()
00307 {
00308     m_d3dContext->ClearState();
00309
00310     ComPtr<IDXGIDevice3> dxgiDevice;
00311     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00312     dxgiDevice->Trim();
00313 }
00314
00315 // Present the contents of the swap chain to the screen.
00316 // Locks the set of holographic camera resources until the function exits.
00317 void DX::DeviceResources::Present(HolographicFrame^ frame)
00318 {
00319     // By default, this API waits for the frame to finish before it returns.
00320     // Holographic apps should wait for the previous frame to finish before
00321     // starting work on a new frame. This allows for better results from
00322     // holographic frame predictions.
00323     HolographicFramePresentResult presentResult = frame->PresentUsingCurrentPrediction();
00324
00325     HolographicFramePrediction^ prediction = frame->CurrentPrediction;
00326     UseHolographicCameraResources<void>([this, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00327     {
00328         for (auto cameraPose : prediction->CameraPoses)
00329         {
00330             // This represents the device-based resources for a HolographicCamera.
00331             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00332
00333             // Discard the contents of the render target.
00334             // This is a valid operation only when the existing contents will be
00335             // entirely overwritten. If dirty or scroll rects are used, this call
00336             // should be removed.
00337             m_d3dContext->DiscardView(pCameraResources->GetBackBufferRenderTargetView());
00338
00339             // Discard the contents of the depth stencil.
00340             m_d3dContext->DiscardView(pCameraResources->GetDepthStencilView());
00341         }
00342     });
00343
00344     // The PresentUsingCurrentPrediction API will detect when the graphics device
00345     // changes or becomes invalid. When this happens, it is considered a Direct3D
00346     // device lost scenario.
00347     if (presentResult == HolographicFramePresentResult::DeviceRemoved)
00348     {
00349         // The Direct3D device, context, and resources should be recreated.
00350         HandleDeviceLost();
00351     }
00352 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/pch.cpp Source File

  • TouchKeyboard
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/pch.h Source File

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include <collection.h>
00014 #include <ppltasks.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_BackgroundDeviceWatcher Member List

This is the complete list of members for Scenario3_BackgroundDeviceWatcher, including all inherited members.
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3_BackgroundDeviceWatcher |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3_BackgroundDeviceWatcher |
OnTaskCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration const &task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs const &args) | Scenario3_BackgroundDeviceWatcher | [private]
RegisterBackgroundTask(Windows::ApplicationModel::Background::DeviceWatcherTrigger const &deviceWatcherTrigger) | Scenario3_BackgroundDeviceWatcher | [private]
Scenario3_BackgroundDeviceWatcher() | Scenario3_BackgroundDeviceWatcher |
StartWatcher() | Scenario3_BackgroundDeviceWatcher | [private]
StartWatcherButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_BackgroundDeviceWatcher |
StopWatcher() | Scenario3_BackgroundDeviceWatcher | [private]
StopWatcherButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_BackgroundDeviceWatcher |
UnregisterBackgroundTask(Windows::ApplicationModel::Background::IBackgroundTaskRegistration const &taskReg) | Scenario3_BackgroundDeviceWatcher | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BroadbandDevice Member List

This is the complete list of members for BroadbandDevice, including all inherited members.
BroadbandDevice() | BroadbandDevice | [inline]
deviceAccountId | BroadbandDevice | [private]
deviceSelected | BroadbandDevice | [private]
GetCurrentDeviceInfo(string accountId) | BroadbandDevice | [inline, private]
NetErrorToString(uint netError) | BroadbandDevice | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | BroadbandDevice | [inline, protected]
PrepScenario1Sample() | BroadbandDevice | [inline, private]
rootPage | BroadbandDevice | [private]
UpdateData_Click(object sender, RoutedEventArgs e) | BroadbandDevice | [inline, private]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/FileLoggingSessionScenario.cpp Source File

  • Logging
  • cppwinrt

FileLoggingSessionScenario.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "FileLoggingSessionScenario.h"
00014 #include "LoggingScenarioHelpers.h"
00015
00016 #define SCENARIO_PREFIX                     L"FileLoggingSessionScenario_"
00017 #define DEFAULT_SESSION_NAME                SCENARIO_PREFIX L"Session"
00018 #define DEFAULT_CHANNEL_NAME                SCENARIO_PREFIX L"Channel"
00019 #define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
00020 #define LOGGING_ENABLED_SETTING_KEY_NAME    SCENARIO_PREFIX L"LoggingEnabled"
00021 #define LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME SCENARIO_PREFIX L"LogFileGeneratedBeforeSuspend"
00022
00023 using namespace winrt;
00024 using namespace winrt::Windows::Foundation;
00025 using namespace winrt::Windows::Foundation::Diagnostics;
00026 using namespace winrt::Windows::Storage;
00027 using namespace winrt::SDKTemplate;
00028
00029 FileLoggingSessionScenario::~FileLoggingSessionScenario()
00030 {
00031 }
00032
00033 FileLoggingSessionScenario::FileLoggingSessionScenario()
00034 {
00035     // Create the logging channel.
00036     // When an app logs messages to a channel, the messges will go
00037     // to any sessions which are consuming messages from the channel.
00038     _channel = LoggingChannel(DEFAULT_CHANNEL_NAME);
00039
00040     // This sample listens to the channel's events so it can track
00041     // information about the channel's enablement status.
00042     _channel.LoggingEnabled({ this, &FileLoggingSessionScenario::OnChannelLoggingEnabled });
00043
00044     // Attach event handlers for Suspend/Resume.
00045     Windows::UI::Xaml::Application app = Windows::UI::Xaml::Application::Current();
00046     app.Suspending({ this, &FileLoggingSessionScenario::OnAppSuspending });
00047     app.Resuming({ this, &FileLoggingSessionScenario::OnAppResuming });
00048
00049     // If the app is being launched (not resumed), the following call will
00050     // activate logging if it had been active at the time of the last suspend.
00051     ResumeLoggingIfApplicable();
00052 }
00053
00054 // static
00055 FileLoggingSessionScenario&
00056 FileLoggingSessionScenario::Instance()
00057 {
00058     static FileLoggingSessionScenario instance;
00059     return instance;
00060 }
00061
00062 event_token
00063 FileLoggingSessionScenario::StatusChanged(StatusChangedHandler const& handler)
00064 {
00065     return _statusChanged.add(handler);
00066 }
00067
00068 void
00069 FileLoggingSessionScenario::StatusChanged(event_token const& token) noexcept
00070 {
00071     _statusChanged.remove(token);
00072 }
00073
00074 bool
00075 FileLoggingSessionScenario::IsBusy() const noexcept
00076 {
00077     return _isBusy != 0;
00078 }
00079
00080 int
00081 FileLoggingSessionScenario::LogFileGeneratedCount() const noexcept
00082 {
00083     return _logFileGeneratedCount;
00084 }
00085
00086 bool
00087 FileLoggingSessionScenario::LoggingEnabled() const noexcept
00088 {
00089     return _session != nullptr;
00090 }
00091
00092 // Handle a request to toggle logging enable/disable status.
00093 IAsyncOperation<bool>
00094 FileLoggingSessionScenario::ToggleLoggingEnabledDisabledAsync()
00095 {
00096     BusySetter busy(*this);
00097
00098     if (_session != nullptr)
00099     {
00100         // Save any final log file.
00101         StorageFile finalLogFile = co_await CloseSessionSaveFinalLogFile();
00102
00103         // Cleanup the session and let the sample UI know of the new status.
00104         _session.Close();
00105         _session = nullptr;
00106         _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGeneratedAtDisable, finalLogFile == nullptr ? L"" : finalLogFile.Path()));
00107         _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(false));
00108         _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, false));
00109         co_return false;
00110     }
00111     else
00112     {
00113         // Enable logging and let the UI know of the new status.
00114         StartLogging();
00115         _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(true));
00116         _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LoggingEnabledDisabled, true));
00117         co_return true;
00118     }
00119 }
00120
00121 // DoScenarioAsync creates a worker thread to simulate application activity.
00122 // In actual use, logging functions would be called from various parts of a
00123 // larger application. The purpose of the below concise function is to show
00124 // how logging works over periods of time when lots of messages are logged.
00125 // Primarily, it shows how log files are generated when each log file reaches
00126 // its maximum capacity. This function logs information in a loop
00127 // that exits after 3 log files have been generated. After each log file is
00128 // generated, the sample's UI is updated with the log file's name.
00129 IAsyncAction
00130 FileLoggingSessionScenario::DoScenarioAsync()
00131 {
00132     // Tell the UI the scenario is busy working.
00133     BusySetter busy(*this);
00134
00135     std::wstring messageToLog;
00136
00137     int messageIndex = 0; // Increments for each logging call.
00138     int startFileCount = LogFileGeneratedCount();
00139
00140     const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;
00141
00142     // To demo logging, loop and log messages until 3 log files have been produced.
00143     // Each time a new log is created, the FileLoggingSession will notify this sample
00144     // via the FileLoggingSession::LogFileGenerated event.
00145     // While not 3 files yet, execute the following code...
00146     while (LogFileGeneratedCount() - startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
00147     {
00148         // Since the channel is added to the session at level Warning, the following
00149         // message is logged because it is logged at level LoggingLevel.Critical.
00150         messageToLog = L"Message=";
00151         messageToLog += std::to_wstring(++messageIndex);
00152         messageToLog +=
00153             L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
00154             L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
00155         _channel.LogMessage(messageToLog, LoggingLevel::Critical);
00156
00157         // Since the channel is added to the session at level Warning, the following
00158         // message is *not* logged because it is logged at LoggingLevel.Information.
00159         messageToLog = L"Message=";
00160         messageToLog += std::to_wstring(++messageIndex);
00161         messageToLog +=
00162             L": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum "
00163             L"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
00164         _channel.LogMessage(messageToLog, LoggingLevel::Information);
00165
00166         int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
00167         messageToLog = L"Value #";
00168         messageToLog += std::to_wstring(++messageIndex);
00169         messageToLog += L':';
00170         messageToLog += std::to_wstring(value);
00171         _channel.LogMessage(messageToLog, LoggingLevel::Critical); // 'value' is logged as 14 byte wide character string.
00172         ++messageIndex;
00173         _channel.LogValuePair(L"Value", value, LoggingLevel::Critical); // 'value' is logged as a 4-byte integer.
00174
00175         //
00176         // Pause every once in a while to simulate application activity outside of logging.
00177         //
00178
00179         if (messageIndex % 50 == 0)
00180         {
00181             co_await resume_after(std::chrono::milliseconds(5));
00182         }
00183     }
00184 }
00185
00186 void
00187 FileLoggingSessionScenario::StartLogging()
00188 {
00189     // If no session exists, create one.
00190     // NOTE: There are use cases where an application
00191     // may want to create only a channel for sessions outside
00192     // of the application itself. See MSDN for details. This
00193     // sample is the common scenario of an app logging events
00194     // which it wants to place in its own log file, so it creates
00195     // a session and channel as a pair. The channel is created
00196     // during construction of this LoggingScenario class so
00197     // it already exsits by the time this function is called.
00198     if (_session == nullptr)
00199     {
00200         _session = FileLoggingSession(DEFAULT_SESSION_NAME);
00201         _session.LogFileGenerated({ this, &FileLoggingSessionScenario::OnLogFileGenerated }); // event+=handler
00202     }
00203
00204     // This sample adds the channel at level "warning" to
00205     // demonstrated how messages logged at more verbose levels
00206     // are ignored by the session.
00207     _session.AddLoggingChannel(_channel, LoggingLevel::Warning);
00208 }
00209
00210 // Prepare this scenario for suspend.
00211 IAsyncAction
00212 FileLoggingSessionScenario::PrepareToSuspendAsync()
00213 {
00214     if (_session != nullptr)
00215     {
00216         _isPreparingForSuspend = true;
00217
00218         // Before suspend, save any final log file.
00219         StorageFile finalLogFile = co_await CloseSessionSaveFinalLogFile();
00220
00221         // Cleanup the session.
00222         _session.Close();
00223         _session = nullptr;
00224
00225         // Save values used when the app is resumed or started later.
00226         // Logging is enabled.
00227         _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(true));
00228
00229         // If there's a final log file...
00230         if (finalLogFile != nullptr)
00231         {
00232             // Save the log file name saved at suspend so the sample UI can be
00233             // updated on resume with that information.
00234             _settings.Insert(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME, box_value(finalLogFile.Path()));
00235         }
00236         else
00237         {
00238             _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
00239         }
00240
00241         _isPreparingForSuspend = false;
00242     }
00243     else
00244     {
00245         // Save values used when the app is resumed or started later.
00246         // Logging is not enabled and no log file was saved.
00247         _settings.Insert(LOGGING_ENABLED_SETTING_KEY_NAME, box_value(false));
00248         _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
00249     }
00250 }
00251
00252 // This is called when the app is either resuming or starting.
00253 // It will enable logging if the app has never been started before
00254 // or if logging had been enabled the last time the app was running.
00255 void
00256 FileLoggingSessionScenario::ResumeLoggingIfApplicable()
00257 {
00258     bool loggingEnabled = unbox_value_or(_settings.TryLookup(LOGGING_ENABLED_SETTING_KEY_NAME), true);
00259     if (loggingEnabled)
00260     {
00261         StartLogging();
00262     }
00263
00264     // When the sample suspends, it retains state as to whether or not it had
00265     // generated a new log file at the last suspension. This allows any
00266     // UI to be updated on resume to reflect that fact.
00267     hstring pathOfLogFileGeneratedBeforeSuspend = unbox_value_or(_settings.TryLookup(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME), L"");
00268     if (!pathOfLogFileGeneratedBeforeSuspend.empty())
00269     {
00270         _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGeneratedAtSuspend, pathOfLogFileGeneratedBeforeSuspend));
00271         _settings.TryRemove(LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME);
00272     }
00273 }
00274
00275 IAsyncOperation<StorageFile>
00276 FileLoggingSessionScenario::CloseSessionSaveFinalLogFile()
00277 {
00278     // Tell the session to save its final log file.
00279     StorageFile finalFileBeforeSuspend = co_await _session.CloseAndSaveToFileAsync();
00280
00281     if (finalFileBeforeSuspend != nullptr)
00282     {
00283         // A final log file was created.
00284         // Move it to the sample-defined log folder.
00285         // First, get create/open our sample-defined log folder.
00286         StorageFolder ourSampleAppLogFolder =
00287             co_await ApplicationData::Current().LocalFolder().CreateFolderAsync(
00288                 OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
00289                 CreationCollisionOption::OpenIfExists);
00290
00291         std::wstring logFileName;
00292         logFileName += L"Log-";
00293         logFileName += GetTimeStamp();
00294         logFileName += L".etl";
00295         co_await finalFileBeforeSuspend.MoveAsync(ourSampleAppLogFolder, logFileName, NameCollisionOption::FailIfExists);
00296
00297         std::wstring fullPath;
00298         fullPath += ourSampleAppLogFolder.Path();
00299         fullPath += L'\\';
00300         fullPath += logFileName;
00301
00302         StorageFile movedFile = co_await StorageFile::GetFileFromPathAsync(hstring(fullPath));
00303         return movedFile;
00304     }
00305
00306     return nullptr;
00307 }
00308
00309 void
00310 FileLoggingSessionScenario::OnChannelLoggingEnabled(
00311     ILoggingChannel const& sender,
00312     IInspectable const&)
00313 {
00314     // This method is called when the channel is informing us of channel-related state changes.
00315     // Save new channel state. These values can be used for advanced logging scenarios where,
00316     // for example, it's desired to skip blocks of logging code if the channel is not being
00317     // consumed by any sessions.
00318     _isChannelEnabled = sender.Enabled();
00319     _channelLoggingLevel = sender.Level();
00320 }
00321
00322 // When the log file gets large, the system closes it and starts a new one.
00323 // The LogFileGenerated event is raised to give the app a chance to move
00324 // the recently-generated log file to a safe place. When the handler returns,
00325 // the FileLoggingSession may reuse the file name for a new log file.
00326 // This function moves the log file to an app-defined location.
00327 fire_and_forget
00328 FileLoggingSessionScenario::OnLogFileGenerated(
00329     IFileLoggingSession const& sender,
00330     LogFileGeneratedEventArgs const& args)
00331 {
00332     ++_logFileGeneratedCount;
00333
00334     StorageFile generatedLogFile = args.File();
00335
00336     // Create the app-defined folder under the app's local folder.
00337     // An app defines where/how it wants to store log files.
00338     // This sample uses OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME under
00339     // the app's local folder.
00340     StorageFolder ourSampleAppLogFolder =
00341         co_await ApplicationData::Current().LocalFolder().CreateFolderAsync(
00342             OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME,
00343             CreationCollisionOption::OpenIfExists);
00344
00345     std::wstring logFileName;
00346     logFileName += L"Log-";
00347     logFileName += GetTimeStamp();
00348     logFileName += L".etl";
00349
00350     // Move the log file to our sample app's log folder.
00351     co_await generatedLogFile.MoveAsync(ourSampleAppLogFolder, logFileName, NameCollisionOption::FailIfExists);
00352
00353     // Update the UI to show the new log file.
00354     if (_isPreparingForSuspend == false)
00355     {
00356         hstring fullPath = ourSampleAppLogFolder.Path() + L"\\" + logFileName;
00357         _statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::LogFileGenerated, fullPath));
00358     }
00359 }
00360
00361 fire_and_forget
00362 FileLoggingSessionScenario::OnAppSuspending(
00363     IInspectable const&,
00364     Windows::ApplicationModel::SuspendingEventArgs const& e)
00365 {
00366     // Get a deferral before performing any async operations
00367     // to avoid suspension prior to LoggingScenario completing
00368     // PrepareToSuspendAsync().
00369     auto deferral = e.SuspendingOperation().GetDeferral();
00370     co_await PrepareToSuspendAsync();
00371     deferral.Complete();
00372 }
00373
00374 void FileLoggingSessionScenario::OnAppResuming(
00375     IInspectable const&,
00376     IInspectable const&)
00377 {
00378     // If logging was active at the last suspend,
00379     // ResumeLoggingIfApplicable will re-activate
00380     // logging.
00381     ResumeLoggingIfApplicable();
00382 }
00383
00384 FileLoggingSessionScenario::BusySetter::~BusySetter()
00385 {
00386     if (0 == --_scenario._isBusy)
00387     {
00388         _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
00389     }
00390 }
00391
00392 FileLoggingSessionScenario::BusySetter::BusySetter(FileLoggingSessionScenario& scenario)
00393     : _scenario(scenario)
00394 {
00395     if (1 == ++_scenario._isBusy)
00396     {
00397         _scenario._statusChanged(make<implementation::LoggingScenarioEventArgs>(LoggingScenarioEventType::BusyStatusChanged));
00398     }
00399 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameInfoOverlay.h Source File

  • Simple3DGameDX
  • cppwinrt

GameInfoOverlay.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // GameInfoOverlay:
00015 // This class maintains a D2D1 Bitmap surface to provide information to the player
00016 // on the state of the game when the game is not in active play.
00017 // This class has several different status modes:
00018 //     GameLoading - this displays a title and a series of dots to show progress.
00019 //     GameStats - this displays a title and the Max level achieved, the hit and shot counts.
00020 //     GameOver - this displays a title and the game status.
00021 //     Pause - this displays only a title - 'Paused'.
00022 // In addition to the status modes, there is a region at the bottom that displays what the
00023 // player is expected to do next. This can be one of four things:
00024 //     None - the action is blank. This is usually set when the game does not currently have focus.
00025 //     TapToContinue - the game is waiting for the player to provide input that they are ready to
00026 //         proceed.
00027 //     PleaseWait - the game is actively doing some background processing (like loading a level).
00028 //     PlayAgain - the game has completed and is waiting for the player to indicate they are ready
00029 //         to play another round of the game.
00030
00031 #include "GameUIControl.h"
00032
00033 class GameInfoOverlay : public Simple3DGameDX::IGameUIControl
00034 {
00035 public:
00036     GameInfoOverlay(std::shared_ptr<DX::DeviceResources> const& deviceResources);
00037
00038     void CreateDeviceDependentResources();
00039     void CreateWindowSizeDependentResources(D2D_SIZE_F overlaySize);
00040     void ReleaseDeviceDependentResources();
00041
00042     bool Visible() { return m_visible; };
00043     ID2D1Bitmap1* Bitmap();
00044
00045 public:
00046     // IGameUIControl interface
00047     virtual void SetGameLoading(uint32_t dots);
00048     virtual void SetGameStats(int maxLevel, int hitCount, int shotCount);
00049     virtual void SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore);
00050     virtual void SetLevelStart(int level, std::wstring const& objective, float timeLimit, float bonusTime);
00051     virtual void SetPause(int level, int hitCount, int shotCount, float timeRemaining);
00052     virtual void SetAction(Simple3DGameDX::GameInfoOverlayCommand action);
00053     virtual void HideGameInfoOverlay() { m_visible = false; };
00054     virtual void ShowGameInfoOverlay() { m_visible = true; };
00055     virtual void ShowTooSmall();
00056     virtual void HideTooSmall();
00057
00058 private:
00059     // Cached pointer to device resources.
00060     std::shared_ptr<DX::DeviceResources>    m_deviceResources;
00061
00062     bool                                    m_visible{ true };
00063     bool                                    m_tooSmallActive{ false };
00064
00065     D2D1_RECT_F                             m_titleRectangle;
00066     D2D1_RECT_F                             m_bodyRectangle;
00067     D2D1_RECT_F                             m_actionRectangle;
00068
00069     winrt::com_ptr<ID2D1Bitmap1>            m_levelBitmap;
00070     winrt::com_ptr<ID2D1Bitmap1>            m_tooSmallBitmap;
00071     winrt::com_ptr<IDWriteTextFormat>       m_textFormatTitle;
00072     winrt::com_ptr<IDWriteTextFormat>       m_textFormatBody;
00073     winrt::com_ptr<ID2D1SolidColorBrush>    m_textBrush;
00074     winrt::com_ptr<ID2D1SolidColorBrush>    m_backgroundBrush;
00075     winrt::com_ptr<ID2D1SolidColorBrush>    m_actionBrush;
00076     std::wstring                            m_titleString;
00077     std::wstring                            m_bodyString;
00078     std::wstring                            m_actionString;
00079 };
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaListViewModel Member List

This is the complete list of members for MediaListViewModel, including all inherited members.
ClearItems() | MediaListViewModel | [inline, protected]
CurrentItem | MediaListViewModel |
currentItemIndex | MediaListViewModel | [private]
CurrentItemIndex | MediaListViewModel |
dispatcher | MediaListViewModel | [private]
Dispose() | MediaListViewModel | [inline]
disposed | MediaListViewModel | [private]
initializing | MediaListViewModel | [private]
InsertItem(int index, MediaItemViewModel item) | MediaListViewModel | [inline, protected]
MediaList | MediaListViewModel |
MediaListViewModel(MediaList mediaList, MediaPlaybackList playbackList, CoreDispatcher dispatcher) | MediaListViewModel | [inline]
MoveItem(int oldIndex, int newIndex) | MediaListViewModel | [inline, protected]
PlaybackList | MediaListViewModel |
PlaybackList_CurrentItemChanged(MediaPlaybackList sender, CurrentMediaPlaybackItemChangedEventArgs args) | MediaListViewModel | [inline, private]
RemoveItem(int index) | MediaListViewModel | [inline, protected]
SetItem(int index, MediaItemViewModel item) | MediaListViewModel | [inline, protected]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ManipulationInputProcessor Member List

This is the complete list of members for ManipulationInputProcessor, including all inherited members.
cumulativeTransform | ManipulationInputProcessor | [private]
deltaTransform | ManipulationInputProcessor | [private]
element | ManipulationInputProcessor | [private]
GenerateDefaultSettings() | ManipulationInputProcessor | [inline, private]
InitializeTransforms() | ManipulationInputProcessor | [inline]
LockToXAxis() | ManipulationInputProcessor | [inline]
LockToYAxis() | ManipulationInputProcessor | [inline]
ManipulationInputProcessor(GestureRecognizer gestureRecognizer, UIElement target, UIElement referenceFrame) | ManipulationInputProcessor | [inline]
MoveOnXAndYAxes() | ManipulationInputProcessor | [inline]
OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e) | ManipulationInputProcessor | [inline, private]
OnManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e) | ManipulationInputProcessor | [inline, private]
OnManipulationStarted(object sender, ManipulationStartedEventArgs e) | ManipulationInputProcessor | [inline, private]
OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e) | ManipulationInputProcessor | [inline, private]
OnPointerCanceled(object sender, PointerRoutedEventArgs args) | ManipulationInputProcessor | [inline, private]
OnPointerMoved(object sender, PointerRoutedEventArgs args) | ManipulationInputProcessor | [inline, private]
OnPointerPressed(object sender, PointerRoutedEventArgs args) | ManipulationInputProcessor | [inline, private]
OnPointerReleased(object sender, PointerRoutedEventArgs args) | ManipulationInputProcessor | [inline, private]
previousTransform | ManipulationInputProcessor | [private]
recognizer | ManipulationInputProcessor | [private]
reference | ManipulationInputProcessor | [private]
Reset() | ManipulationInputProcessor | [inline]
UseInertia(bool inertia) | ManipulationInputProcessor | [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/SampleConfiguration.h Source File

  • StreamSocket
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015
00016 namespace SDKTemplate
00017 {
00018     public value struct Scenario
00019     {
00020         Platform::String^ Title;
00021         Platform::String^ ClassName;
00022     };
00023
00024     partial ref class MainPage
00025     {
00026     public:
00027         static property Platform::String^ FEATURE_NAME
00028         {
00029             Platform::String^ get()
00030             {
00031                 return ref new Platform::String(L"StreamSocket");
00032             }
00033         }
00034
00035         static property Platform::Array<Scenario>^ scenarios
00036         {
00037             Platform::Array<Scenario>^ get()
00038             {
00039                 return scenariosInner;
00040             }
00041         }
00042     private:
00043         static Platform::Array<Scenario>^ scenariosInner;
00044     };
00045 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario5_TimeZone.cpp Source File

  • Calendar
  • cppwinrt

Scenario5_TimeZone.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_TimeZone.h"
00014 #include "Scenario5_TimeZone.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace
00022 {
00023     void ReportCalendarData(std::wostream& results, Calendar const& calendar)
00024     {
00025         // Display individual date/time elements.
00026         results <<
00027             L"In " << std::wstring_view(calendar.GetTimeZone()) <<
00028             L" time zone:   " << std::wstring_view(calendar.DayOfWeekAsSoloString()) <<
00029             L"   " << std::wstring_view(calendar.MonthAsSoloString()) <<
00030             L" " << std::wstring_view(calendar.DayAsPaddedString(2)) <<
00031             L", " << std::wstring_view(calendar.YearAsString()) <<
00032             L"   " << std::wstring_view(calendar.HourAsPaddedString(2)) <<
00033             L":" << std::wstring_view(calendar.MinuteAsPaddedString(2)) <<
00034             L":" << std::wstring_view(calendar.SecondAsPaddedString(2)) <<
00035             L" " << std::wstring_view(calendar.PeriodAsString()) <<
00036             L"  " << std::wstring_view(calendar.TimeZoneAsString(3)) <<
00037             L"\n";
00038     }
00039 }
00040
00041 namespace winrt::SDKTemplate::implementation
00042 {
00043     Scenario5_TimeZone::Scenario5_TimeZone()
00044     {
00045         InitializeComponent();
00046     }
00047
00048     void Scenario5_TimeZone::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00049     {
00050         // This scenario illustrates time zone support in Windows.Globalization.Calendar class
00051
00052         // Displayed time zones in addition to the local time zone.
00053         std::array timeZones{ L"UTC", L"America/New_York", L"Asia/Kolkata" };
00054
00055         // Store results here.
00056         std::wostringstream results;
00057
00058         // Create default Calendar object
00059         Calendar calendar;
00060         hstring localTimeZone = calendar.GetTimeZone();
00061
00062         // Show current time in local time zone
00063         results << L"Current date and time:\n";
00064         ReportCalendarData(results, calendar);
00065         results << L"\n";
00066
00067         // Show current time in additional time zones
00068         for (auto&& timeZone : timeZones)
00069         {
00070             calendar.ChangeTimeZone(timeZone);
00071             ReportCalendarData(results, calendar);
00072         }
00073         results << L"\n";
00074
00075         // Change back to local time zone
00076         calendar.ChangeTimeZone(localTimeZone);
00077
00078         // Show a time on 14th day of second month of next year.
00079         // Note the effect of daylight saving time on the results.
00080         results << L"Same time on 14th day of second month of next year:\n";
00081         calendar.AddYears(1); calendar.Month(2); calendar.Day(14);
00082         ReportCalendarData(results, calendar);
00083         for (auto&& timeZone : timeZones)
00084         {
00085             calendar.ChangeTimeZone(timeZone);
00086             ReportCalendarData(results, calendar);
00087         }
00088         results << L"\n";
00089
00090         // Change back to local time zone
00091         calendar.ChangeTimeZone(localTimeZone);
00092
00093         // Show a time on 14th day of tenth month of next year.
00094         // Note the effect of daylight saving time on the results.
00095         results << L"Same time on 14th day of tenth month of next year:\n";
00096         calendar.AddMonths(8);
00097         ReportCalendarData(results, calendar);
00098         for (auto&& timeZone : timeZones)
00099         {
00100             calendar.ChangeTimeZone(timeZone);
00101             ReportCalendarData(results, calendar);
00102         }
00103         results << L"\n";
00104
00105         // Display the results
00106         OutputTextBlock().Text(results.str());
00107     }
00108 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/CameraStreamCoordinateMapperMain.h Source File

  • CameraStreamCoordinateMapper
  • cpp

CameraStreamCoordinateMapperMain.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Common\StepTimer.h"
00015 #include "Common\DeviceResources.h"
00016
00017 #include "Content\GpuCoordinateMapper.h"
00018
00019 namespace DX {
00020     class GpuPerformanceTimer;
00021 }
00022
00023 ref class FirstPersonCamera;
00024
00025 // Renders Direct2D and 3D content on the screen.
00026 namespace CameraStreamCoordinateMapper
00027 {
00028     class QuadRenderer;
00029     class TextRenderer;
00030     class CameraCoordinateMapper;
00031
00032     class CameraStreamCoordinateMapperMain : public DX::IDeviceNotify
00033     {
00034     public:
00035         CameraStreamCoordinateMapperMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00036         concurrency::task<void> CreateResourcesAsync();
00037
00038         ~CameraStreamCoordinateMapperMain();
00039         void CreateWindowSizeDependentResources();
00040         void Update();
00041         bool Render();
00042
00043         concurrency::task<void> OnSuspendingAsync();
00044         void OnResuming();
00045
00046         // IDeviceNotify
00047         virtual void OnDeviceLost();
00048         virtual void OnDeviceRestored();
00049
00050     private:
00051         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00052
00053         DX::StepTimer m_timer;
00054
00055         FirstPersonCamera^ m_camera;
00056
00057         std::unique_ptr<QuadRenderer> m_quadRenderer;
00058         std::unique_ptr<TextRenderer> m_statisticsTextRenderer;
00059         std::unique_ptr<TextRenderer> m_helpTextRenderer;
00060
00061         std::unique_ptr<DX::GpuPerformanceTimer> m_gpuPerformanceTimer;
00062         std::shared_ptr<CameraCoordinateMapper> m_cameraCoordinateMapper;
00063
00064         bool m_streamingEnabled = true;
00065         bool m_freeRoamCameraEnabled = true;
00066         bool m_showHelpText = false;
00067         bool m_readyToRender = false;
00068     };
00069 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/EventHandlerForDevice.cs Source File

  • CustomSerialDeviceAccess
  • cs

EventHandlerForDevice.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 using Windows.Devices.Enumeration;
00019 using Windows.Devices.SerialCommunication;
00020
00021 using Windows.ApplicationModel;
00022 using Windows.Foundation;
00023
00024 using Windows.UI.Core;
00025 using Windows.UI.Xaml;
00026
00027 using SDKTemplate;
00028
00029 namespace CustomSerialDeviceAccess
00030 {
00031     /// <summary>
00032     /// The purpose of this class is to demonstrate the expected application behavior for app events
00033     /// such as suspension and resume or when the device is disconnected. In addition to handling
00034     /// the SerialDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).
00035     ///
00036     /// This class will also demonstrate how to handle device watcher events.
00037     ///
00038     /// For simplicity, this class will only allow at most one device to be connected at any given time. In order
00039     /// to make this class support multiple devices, make this class a non-singleton and create multiple instances
00040     /// of this class; each instance should watch one connected device.
00041     /// </summary>
00042     public class EventHandlerForDevice
00043     {
00044         /// <summary>
00045         /// Allows for singleton EventHandlerForDevice
00046         /// </summary>
00047         private static EventHandlerForDevice eventHandlerForDevice;
00048
00049         /// <summary>
00050         /// Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.
00051         /// </summary>
00052         private static Object singletonCreationLock = new Object();
00053
00054         private String deviceSelector;
00055         private DeviceWatcher deviceWatcher;
00056
00057         private DeviceInformation deviceInformation;
00058         private DeviceAccessInformation deviceAccessInformation;
00059         private SerialDevice device;
00060
00061         private SuspendingEventHandler appSuspendEventHandler;
00062         private EventHandler<Object> appResumeEventHandler;
00063
00064         private TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceCloseCallback;
00065         private TypedEventHandler<EventHandlerForDevice, DeviceInformation> deviceConnectedCallback;
00066
00067         private TypedEventHandler<DeviceWatcher, DeviceInformation> deviceAddedEventHandler;
00068         private TypedEventHandler<DeviceWatcher, DeviceInformationUpdate> deviceRemovedEventHandler;
00069         private TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs> deviceAccessEventHandler;
00070
00071         private Boolean watcherSuspended;
00072         private Boolean watcherStarted;
00073         private Boolean isEnabledAutoReconnect;
00074
00075         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00076         // as NotifyUser()
00077         private MainPage rootPage = MainPage.Current;
00078
00079         /// <summary>
00080         /// Enforces the singleton pattern so that there is only one object handling app events
00081         /// as it relates to the SerialDevice because this sample app only supports communicating with one device at a time.
00082         ///
00083         /// An instance of EventHandlerForDevice is globally available because the device needs to persist across scenario pages.
00084         ///
00085         /// If there is no instance of EventHandlerForDevice created before this property is called,
00086         /// an EventHandlerForDevice will be created.
00087         /// </summary>
00088         public static EventHandlerForDevice Current
00089         {
00090             get
00091             {
00092                 if (eventHandlerForDevice == null)
00093                 {
00094                     lock (singletonCreationLock)
00095                     {
00096                         if (eventHandlerForDevice == null)
00097                         {
00098                             CreateNewEventHandlerForDevice();
00099                         }
00100                     }
00101                 }
00102
00103                 return eventHandlerForDevice;
00104             }
00105         }
00106
00107         /// <summary>
00108         /// Creates a new instance of EventHandlerForDevice, enables auto reconnect, and uses it as the Current instance.
00109         /// </summary>
00110         public static void CreateNewEventHandlerForDevice()
00111         {
00112             eventHandlerForDevice = new EventHandlerForDevice();
00113         }
00114
00115         public TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceClose
00116         {
00117             get
00118             {
00119                 return deviceCloseCallback;
00120             }
00121
00122             set
00123             {
00124                 deviceCloseCallback = value;
00125             }
00126         }
00127
00128         public TypedEventHandler<EventHandlerForDevice, DeviceInformation> OnDeviceConnected
00129         {
00130             get
00131             {
00132                 return deviceConnectedCallback;
00133             }
00134
00135             set
00136             {
00137                 deviceConnectedCallback = value;
00138             }
00139         }
00140
00141         public Boolean IsDeviceConnected
00142         {
00143             get
00144             {
00145                 return (device != null);
00146             }
00147         }
00148
00149         public SerialDevice Device
00150         {
00151             get
00152             {
00153                 return device;
00154             }
00155         }
00156
00157         /// <summary>
00158         /// This DeviceInformation represents which device is connected or which device will be reconnected when
00159         /// the device is plugged in again (if IsEnabledAutoReconnect is true);.
00160         /// </summary>
00161         public DeviceInformation DeviceInformation
00162         {
00163             get
00164             {
00165                 return deviceInformation;
00166             }
00167         }
00168
00169         /// <summary>
00170         /// Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice
00171         /// object.
00172         /// </summary>
00173         public DeviceAccessInformation DeviceAccessInformation
00174         {
00175             get
00176             {
00177                 return deviceAccessInformation;
00178             }
00179         }
00180
00181         /// <summary>
00182         /// DeviceSelector AQS used to find this device
00183         /// </summary>
00184         public String DeviceSelector
00185         {
00186             get
00187             {
00188                 return deviceSelector;
00189             }
00190         }
00191
00192         /// <summary>
00193         /// True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again
00194         /// </summary>
00195         public Boolean IsEnabledAutoReconnect
00196         {
00197             get
00198             {
00199                 return isEnabledAutoReconnect;
00200             }
00201             set
00202             {
00203                 isEnabledAutoReconnect = value;
00204             }
00205         }
00206
00207         /// <summary>
00208         /// This method opens the device using the WinRT Serial API. After the device is opened, save the device
00209         /// so that it can be used across scenarios.
00210         ///
00211         /// It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed
00212         /// on the UI thread.
00213         ///
00214         /// This method is used to reopen the device after the device reconnects to the computer and when the app resumes.
00215         /// </summary>
00216         /// <param name="deviceInfo">Device information of the device to be opened</param>
00217         /// <param name="deviceSelector">The AQS used to find this device</param>
00218         /// <returns>True if the device was successfully opened, false if the device could not be opened for well known reasons.
00219         /// An exception may be thrown if the device could not be opened for extraordinary reasons.</returns>
00220         public async Task<Boolean> OpenDeviceAsync(DeviceInformation deviceInfo, String deviceSelector)
00221         {
00222             device = await SerialDevice.FromIdAsync(deviceInfo.Id);
00223
00224             Boolean successfullyOpenedDevice = false;
00225             NotifyType notificationStatus;
00226             String notificationMessage = null;
00227
00228             // Device could have been blocked by user or the device has already been opened by another app.
00229             if (device != null)
00230             {
00231                 successfullyOpenedDevice = true;
00232
00233                 deviceInformation = deviceInfo;
00234                 this.deviceSelector = deviceSelector;
00235
00236                 notificationStatus = NotifyType.StatusMessage;
00237                 notificationMessage = "Device " + deviceInformation.Id + " opened";
00238
00239                 // Notify registered callback handle that the device has been opened
00240                 if (deviceConnectedCallback != null)
00241                 {
00242                     deviceConnectedCallback(this, deviceInformation);
00243                 }
00244
00245                 if (appSuspendEventHandler == null || appResumeEventHandler == null)
00246                 {
00247                     RegisterForAppEvents();
00248                 }
00249
00250                 // Register for DeviceAccessInformation.AccessChanged event and react to any changes to the
00251                 // user access after the device handle was opened.
00252                 if (deviceAccessEventHandler == null)
00253                 {
00254                     RegisterForDeviceAccessStatusChange();
00255                 }
00256
00257                 // Create and register device watcher events for the device to be opened unless we're reopening the device
00258                 if (deviceWatcher == null)
00259                 {
00260                     deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector);
00261
00262                     RegisterForDeviceWatcherEvents();
00263                 }
00264
00265                 if (!watcherStarted)
00266                 {
00267                     // Start the device watcher after we made sure that the device is opened.
00268                     StartDeviceWatcher();
00269                 }
00270             }
00271             else
00272             {
00273                 successfullyOpenedDevice = false;
00274
00275                 notificationStatus = NotifyType.ErrorMessage;
00276
00277                 var deviceAccessStatus = DeviceAccessInformation.CreateFromId(deviceInfo.Id).CurrentStatus;
00278
00279                 if (deviceAccessStatus == DeviceAccessStatus.DeniedByUser)
00280                 {
00281                     notificationMessage = "Access to the device was blocked by the user : " + deviceInfo.Id;
00282                 }
00283                 else if (deviceAccessStatus == DeviceAccessStatus.DeniedBySystem)
00284                 {
00285                     // This status is most likely caused by app permissions (did not declare the device in the app's package.appxmanifest)
00286                     // This status does not cover the case where the device is already opened by another app.
00287                     notificationMessage = "Access to the device was blocked by the system : " + deviceInfo.Id;
00288                 }
00289                 else
00290                 {
00291                     // Most likely the device is opened by another app, but cannot be sure
00292                     notificationMessage = "Unknown error, possibly opened by another app : " + deviceInfo.Id;
00293                 }
00294             }
00295
00296             MainPage.Current.NotifyUser(notificationMessage, notificationStatus);
00297
00298             return successfullyOpenedDevice;
00299         }
00300
00301         /// <summary>
00302         /// Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device
00303         /// was ever connected.
00304         /// </summary>
00305         public void CloseDevice()
00306         {
00307             if (IsDeviceConnected)
00308             {
00309                 CloseCurrentlyConnectedDevice();
00310             }
00311
00312             if (deviceWatcher != null)
00313             {
00314                 if (watcherStarted)
00315                 {
00316                     StopDeviceWatcher();
00317
00318                     UnregisterFromDeviceWatcherEvents();
00319                 }
00320
00321                 deviceWatcher = null;
00322             }
00323
00324             if (deviceAccessInformation != null)
00325             {
00326                 UnregisterFromDeviceAccessStatusChange();
00327
00328                 deviceAccessInformation = null;
00329             }
00330
00331             if (appSuspendEventHandler != null || appResumeEventHandler != null)
00332             {
00333                 UnregisterFromAppEvents();
00334             }
00335
00336             deviceInformation = null;
00337             deviceSelector = null;
00338
00339             deviceConnectedCallback = null;
00340             deviceCloseCallback = null;
00341
00342             isEnabledAutoReconnect = true;
00343         }
00344
00345         private EventHandlerForDevice()
00346         {
00347             watcherStarted = false;
00348             watcherSuspended = false;
00349             isEnabledAutoReconnect = true;
00350         }
00351
00352         /// <summary>
00353         /// This method demonstrates how to close the device properly using the WinRT Serial API.
00354         ///
00355         /// When the SerialDevice is closing, it will cancel all IO operations that are still pending (not complete).
00356         /// The close will not wait for any IO completion callbacks to be called, so the close call may complete before any of
00357         /// the IO completion callbacks are called.
00358         /// The pending IO operations will still call their respective completion callbacks with either a task
00359         /// cancelled error or the operation completed.
00360         /// </summary>
00361         private async void CloseCurrentlyConnectedDevice()
00362         {
00363             if (device != null)
00364             {
00365                 // Notify callback that we're about to close the device
00366                 if (deviceCloseCallback != null)
00367                 {
00368                     deviceCloseCallback(this, deviceInformation);
00369                 }
00370
00371                 // This closes the handle to the device
00372                 device.Dispose();
00373
00374                 device = null;
00375
00376                 // Save the deviceInformation.Id in case deviceInformation is set to null when closing the
00377                 // device
00378                 String deviceId = deviceInformation.Id;
00379
00380                 await rootPage.Dispatcher.RunAsync(
00381                     CoreDispatcherPriority.Normal,
00382                     new DispatchedHandler(() =>
00383                     {
00384                         MainPage.Current.NotifyUser(deviceId + " is closed", NotifyType.StatusMessage);
00385                     }));
00386             }
00387         }
00388
00389         /// <summary>
00390         /// Register for app suspension/resume events. See the comments
00391         /// for the event handlers for more information on the exact device operation performed.
00392         ///
00393         /// We will also register for when the app exists so that we may close the device handle.
00394         /// </summary>
00395         private void RegisterForAppEvents()
00396         {
00397             appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension);
00398             appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume);
00399
00400             // This event is raised when the app is exited and when the app is suspended
00401             App.Current.Suspending += appSuspendEventHandler;
00402
00403             App.Current.Resuming += appResumeEventHandler;
00404         }
00405
00406         private void UnregisterFromAppEvents()
00407         {
00408             // This event is raised when the app is exited and when the app is suspended
00409             App.Current.Suspending -= appSuspendEventHandler;
00410             appSuspendEventHandler = null;
00411
00412             App.Current.Resuming -= appResumeEventHandler;
00413             appResumeEventHandler = null;
00414         }
00415
00416         /// <summary>
00417         /// Register for Added and Removed events.
00418         /// Note that, when disconnecting the device, the device may be closed by the system before the OnDeviceRemoved callback is invoked.
00419         /// </summary>
00420         private void RegisterForDeviceWatcherEvents()
00421         {
00422             deviceAddedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
00423
00424             deviceRemovedEventHandler = new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
00425
00426             deviceWatcher.Added += deviceAddedEventHandler;
00427
00428             deviceWatcher.Removed += deviceRemovedEventHandler;
00429         }
00430
00431         private void UnregisterFromDeviceWatcherEvents()
00432         {
00433             deviceWatcher.Added -= deviceAddedEventHandler;
00434             deviceAddedEventHandler = null;
00435
00436             deviceWatcher.Removed -= deviceRemovedEventHandler;
00437             deviceRemovedEventHandler = null;
00438         }
00439
00440         /// <summary>
00441         /// Listen for any changed in device access permission. The user can block access to the device while the device is in use.
00442         /// If the user blocks access to the device while the device is opened, the device's handle will be closed automatically by
00443         /// the system; it is still a good idea to close the device explicitly so that resources are cleaned up.
00444         ///
00445         /// Note that by the time the AccessChanged event is raised, the device handle may already be closed by the system.
00446         /// </summary>
00447         private void RegisterForDeviceAccessStatusChange()
00448         {
00449             // Enable the following registration ONLY if the Serial device under test is non-internal.
00450             //
00451
00452             //deviceAccessInformation = DeviceAccessInformation.CreateFromId(deviceInformation.Id);
00453             //deviceAccessEventHandler = new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(this.OnDeviceAccessChanged);
00454             //deviceAccessInformation.AccessChanged += deviceAccessEventHandler;
00455         }
00456
00457         private void UnregisterFromDeviceAccessStatusChange()
00458         {
00459             deviceAccessInformation.AccessChanged -= deviceAccessEventHandler;
00460
00461             deviceAccessEventHandler = null;
00462         }
00463
00464         private void StartDeviceWatcher()
00465         {
00466             watcherStarted = true;
00467
00468             if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
00469                 && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
00470             {
00471                 deviceWatcher.Start();
00472             }
00473         }
00474
00475         private void StopDeviceWatcher()
00476         {
00477             if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
00478                 || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
00479             {
00480                 deviceWatcher.Stop();
00481             }
00482
00483             watcherStarted = false;
00484         }
00485
00486         /// <summary>
00487         /// If a Serial object has been instantiated (a handle to the device is opened), we must close it before the app
00488         /// goes into suspension because the API automatically closes it for us if we don't. When resuming, the API will
00489         /// not reopen the device automatically, so we need to explicitly open the device in the app (Scenario1_ConnectDisconnect).
00490         ///
00491         /// Since we have to reopen the device ourselves when the app resumes, it is good practice to explicitly call the close
00492         /// in the app as well (For every open there is a close).
00493         ///
00494         /// We must stop the DeviceWatcher because it will continue to raise events even if
00495         /// the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.
00496         /// </summary>
00497         /// <param name="sender"></param>
00498         /// <param name="eventArgs"></param>
00499         private void OnAppSuspension(Object sender, SuspendingEventArgs args)
00500         {
00501             if (watcherStarted)
00502             {
00503                 watcherSuspended = true;
00504                 StopDeviceWatcher();
00505             }
00506             else
00507             {
00508                 watcherSuspended = false;
00509             }
00510
00511             CloseCurrentlyConnectedDevice();
00512         }
00513
00514         /// <summary>
00515         /// When resume into the application, we should reopen a handle to the Serial device again. This will automatically
00516         /// happen when we start the device watcher again; the device will be re-enumerated and we will attempt to reopen it
00517         /// if IsEnabledAutoReconnect property is enabled.
00518         ///
00519         /// See OnAppSuspension for why we are starting the device watcher again
00520         /// </summary>
00521         /// <param name="sender"></param>
00522         /// <param name="arg"></param>
00523         private void OnAppResume(Object sender, Object args)
00524         {
00525             if (watcherSuspended)
00526             {
00527                 watcherSuspended = false;
00528                 StartDeviceWatcher();
00529             }
00530         }
00531
00532         /// <summary>
00533         /// Close the device that is opened so that all pending operations are canceled properly.
00534         /// </summary>
00535         /// <param name="sender"></param>
00536         /// <param name="deviceInformationUpdate"></param>
00537         private void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
00538         {
00539             if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
00540             {
00541                 // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
00542                 // and stop talking to the disconnected device.
00543                 CloseCurrentlyConnectedDevice();
00544             }
00545         }
00546
00547         /// <summary>
00548         /// Open the device that the user wanted to open if it hasn't been opened yet and auto reconnect is enabled.
00549         /// </summary>
00550         /// <param name="sender"></param>
00551         /// <param name="deviceInfo"></param>
00552         private async void OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInfo)
00553         {
00554             if ((deviceInformation != null) && (deviceInfo.Id == deviceInformation.Id) && !IsDeviceConnected && isEnabledAutoReconnect)
00555             {
00556                 await rootPage.Dispatcher.RunAsync(
00557                     CoreDispatcherPriority.Normal,
00558                     new DispatchedHandler(async () =>
00559                     {
00560                         await OpenDeviceAsync(deviceInformation, deviceSelector);
00561
00562                         // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
00563                     }));
00564             }
00565         }
00566
00567         /// <summary>
00568         /// Close the device if the device access was denied by anyone (system or the user) and reopen it if permissions are allowed again
00569         /// </summary>
00570         /// <param name="sender"></param>
00571         /// <param name="eventArgs"></param>
00572         private async void OnDeviceAccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs)
00573         {
00574             if ((eventArgs.Status == DeviceAccessStatus.DeniedBySystem)
00575                 || (eventArgs.Status == DeviceAccessStatus.DeniedByUser))
00576             {
00577                 CloseCurrentlyConnectedDevice();
00578             }
00579             else if ((eventArgs.Status == DeviceAccessStatus.Allowed) && (deviceInformation != null) && isEnabledAutoReconnect)
00580             {
00581                 await rootPage.Dispatcher.RunAsync(
00582                     CoreDispatcherPriority.Normal,
00583                     new DispatchedHandler(async () =>
00584                     {
00585                         await OpenDeviceAsync(deviceInformation, deviceSelector);
00586
00587                         // Any app specific device intialization should be done here because we don't know the state of the device when it is re-enumerated.
00588                     }));
00589             }
00590         }
00591     }
00592 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario2_ScriptDetection.h Source File

  • LinguisticServices
  • cppwinrt

Scenario2_ScriptDetection.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_ScriptDetection.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_ScriptDetection : Scenario2_ScriptDetectionT<Scenario2_ScriptDetection>
00019     {
00020         Scenario2_ScriptDetection();
00021
00022         void Go_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario2_ScriptDetection : Scenario2_ScriptDetectionT<Scenario2_ScriptDetection, implementation::Scenario2_ScriptDetection>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StepsControl Member List

This is the complete list of members for StepsControl, including all inherited members.
ButtonNext_Click(object sender, RoutedEventArgs e) | StepsControl | [inline, private]
Completed_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) | StepsControl | [inline, private]
GetStepsHelperControl() | StepsControl | [inline, private]
IsNextEnabled | StepsControl |
IsNextEnabledProperty | StepsControl | [static]
NextButtonVisibility | StepsControl |
NextButtonVisibilityProperty | StepsControl | [static]
OnApplyTemplate() | StepsControl | [inline, protected]
OnStepPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) | StepsControl | [inline, private, static]
OnStepPropertyChanged(DependencyPropertyChangedEventArgs e) | StepsControl | [inline, private]
SetCompleted(bool isCompleted) | StepsControl | [inline, private]
Step | StepsControl |
StepChanged | StepsControl |
StepProperty | StepsControl | [static]
StepsControl() | StepsControl | [inline]
StepsControl_Loaded(object sender, RoutedEventArgs e) | StepsControl | [inline, private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/SampleConfiguration.cs Source File

  • FileThumbnails
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Storage;
00015 using Windows.Storage.FileProperties;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Media.Imaging;
00018
00019 namespace SDKTemplate
00020 {
00021     internal class FileExtensions
00022     {
00023         public static readonly string[] Document = new string[] { ".doc", ".xls", ".ppt", ".docx", ".xlsx", ".pptx", ".pdf", ".txt", ".rtf" };
00024         public static readonly string[] Image    = new string[] { ".jpg", ".png", ".bmp", ".gif", ".tif" };
00025         public static readonly string[] Music    = new string[] { ".mp3", ".wma", ".m4a", ".aac" };
00026     }
00027
00028     internal class Errors
00029     {
00030         public static readonly string NoExifThumbnail   = "No result (no EXIF thumbnail or cached thumbnail available for fast retrieval)";
00031         public static readonly string NoThumbnail       = "No result (no thumbnail could be obtained from the selected file)";
00032         public static readonly string NoAlbumArt        = "No result (no album art available for this song)";
00033         public static readonly string NoIcon            = "No result (no icon available for this document type)";
00034         public static readonly string NoImages          = "No result (no thumbnail could be obtained from the selected folder - make sure that the folder contains images)";
00035         public static readonly string FileGroupEmpty    = "No result (unexpected error: retrieved file group was null)";
00036         public static readonly string FileGroupLocation = "File groups are only available for library locations, please select a folder from one of your libraries";
00037         public static readonly string Cancel            = "No result (operation cancelled, no item selected)";
00038         public static readonly string InvalidSize       = "Invalid size (specified size must be numerical and greater than zero)";
00039     }
00040
00041     public partial class MainPage : Page
00042     {
00043         public const string FEATURE_NAME = "File thumbnails C# sample";
00044
00045         List<Scenario> scenarios = new List<Scenario>
00046         {
00047             new Scenario() { Title = "Display a thumbnail for a picture",    ClassType = typeof(Scenario1) },
00048             new Scenario() { Title = "Display album art for a song",         ClassType = typeof(Scenario2) },
00049             new Scenario() { Title = "Display an icon for a document",       ClassType = typeof(Scenario3) },
00050             new Scenario() { Title = "Display a thumbnail for a folder",     ClassType = typeof(Scenario4) },
00051             new Scenario() { Title = "Display a thumbnail for a file group", ClassType = typeof(Scenario5) },
00052             new Scenario() { Title = "Display a scaled image",               ClassType = typeof(Scenario6) },
00053         };
00054
00055         private BitmapImage _placeholder;
00056         private BitmapImage PlaceHolderImage
00057         {
00058             get
00059             {
00060                 if (_placeholder == null)
00061                 {
00062                     _placeholder = new BitmapImage(new Uri(this.BaseUri, "Assets/placeholder-sdk.png"));
00063                 }
00064                 return _placeholder;
00065             }
00066         }
00067
00068
00069         public static void DisplayResult(Image image, TextBlock textBlock, string thumbnailModeName, uint size, IStorageItem item, StorageItemThumbnail thumbnail, bool isGroup)
00070         {
00071             // ErrorMessage.Visibility = Visibility.Collapsed;
00072             BitmapImage bitmapImage = new BitmapImage();
00073
00074             bitmapImage.SetSource(thumbnail);
00075             image.Source = bitmapImage;
00076
00077             textBlock.Text = String.Format("ThumbnailMode.{0}\n"
00078                                            + "{1} used: {2}\n"
00079                                            + "Requested size: {3}\n"
00080                                            + "Returned size: {4}x{5}",
00081                                            thumbnailModeName,
00082                                            isGroup ? "Group" : item.IsOfType(StorageItemTypes.File) ? "File" : "Folder",
00083                                            item.Name,
00084                                            size,
00085                                            thumbnail.OriginalWidth,
00086                                            thumbnail.OriginalHeight);
00087         }
00088
00089         public void ResetOutput(Image image, TextBlock output, TextBlock outputDetails = null)
00090         {
00091             image.Source = PlaceHolderImage;
00092             NotifyUser("", NotifyType.ErrorMessage);
00093             NotifyUser("", NotifyType.StatusMessage);
00094             output.Text = "";
00095             if (outputDetails != null)
00096             {
00097                 outputDetails.Text = "";
00098             }
00099         }
00100     }
00101
00102     public class Scenario
00103     {
00104         public string Title { get; set; }
00105         public Type ClassType { get; set; }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/BasicTests.xaml.h Source File

  • XamlBind
  • cpp

BasicTests.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // BasicTests.xaml.h
00003 // Declaration of the BasicTests class
00004 //
00005
00006 #pragma once
00007
00008 #include "BasicTests.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class BasicTests sealed
00017     {
00018
00019     private:
00020         const Platform::String^ DPOnPageName = "DPOnPage";
00021         static Windows::UI::Xaml::DependencyProperty^ _DPOnPage;
00022
00023     public:
00024         BasicTests();
00025
00026         property int MyInt;
00027         property xBindSampleModel::DataModel^ Model;
00028
00029         property Platform::String^ DPOnPage
00030         {
00031             Platform::String^ get()
00032             {
00033                 return dynamic_cast<Platform::String^>(GetValue(DPOnPageProperty));
00034             }
00035             void set(Platform::String^ value)
00036             {
00037                 SetValue(DPOnPageProperty, value);
00038             }
00039         }
00040
00041         static property Windows::UI::Xaml::DependencyProperty^ DPOnPageProperty
00042         {
00043             Windows::UI::Xaml::DependencyProperty^ get() { return _DPOnPage; }
00044         }
00045
00046         property xBindSampleModel::IEmployee^ NullEmployee;
00047         property Platform::String^ NullStringProperty;
00048
00049     private:
00050         void InitializeValues();
00051         void UpdateValuesClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00052         void ResetValuesClick(Platform::Object^, Windows::UI::Xaml::RoutedEventArgs^ e);
00053
00054     };
00055 }
Generated on Fri Nov 15 2024 22:22:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColor Member List

This is the complete list of members for VertexPositionColor, including all inherited members.
color | VertexPositionColor
pos | VertexPositionColor
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario2_IdManaged.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario2_IdManaged.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Security.EnterpriseData;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace EdpSample
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario2 : Page
00027     {
00028         private MainPage rootPage;
00029         private string m_scenarioText = "An identity being used by an app might be provisioned to have " +
00030                                       "an enterprise policy enforced.When an enterprise policy is enforced on the identity, " +
00031                                       "the app must help the system with policy enforcement by calling APIs under ProtectionPolicyManager " +
00032                                       "during UI activities or network accesses to ensure that the system tags data transfers with this " +
00033                                       "identity when necessary.This scenario example shows how the app can check if an identity is managed " +
00034                                       "by an enterprise policy.";
00035
00036         public Scenario2()
00037         {
00038             this.InitializeComponent();
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             ScenarioTextTbl.Text = m_scenarioText;
00044             rootPage = MainPage.Current;
00045         }
00046
00047         private void IsIdentityManaged_Click(object sender, RoutedEventArgs e)
00048         {
00049             bool isIdentityManaged = ProtectionPolicyManager.IsIdentityManaged(Scenario1.m_enterpriseId);
00050             rootPage.NotifyUser("IsIdentityManaged: " + isIdentityManaged, NotifyType.StatusMessage);
00051         }
00052     }
00053 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/pch.h Source File

  • TouchKeyboard
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.System.h"
00008 #include "winrt/Windows.UI.Core.h"
00009 #include "winrt/Windows.UI.ViewManagement.h"
00010 #include "winrt/Windows.UI.ViewManagement.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Input.h"
00017 #include "winrt/Windows.UI.Xaml.Interop.h"
00018 #include "winrt/Windows.UI.Xaml.Markup.h"
00019 #include "winrt/Windows.UI.Xaml.Media.h"
00020 #include "winrt/Windows.UI.Xaml.Media.Animation.h"
00021 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/SampleConfiguration.cs Source File

  • SemanticTextQuery
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Data.Text;
00015 using Windows.UI.Text;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Documents;
00018
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "Semantic text query C# sample";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title = "Find Scenario",                            ClassType = typeof(Scenario1) },
00028             new Scenario() { Title = "FindInProperty Scenario",                  ClassType = typeof(Scenario2) },
00029             new Scenario() { Title = "GetMatchingPropertiesWithRanges Scenario", ClassType = typeof(Scenario3) }
00030         };
00031
00032         public void HighlightRanges(TextBlock tb, String TextContent, IReadOnlyList<TextSegment> ranges)
00033         {
00034             int currentPosition = 0;
00035             foreach (var range in ranges)
00036             {
00037                 // Add the next chunk of non-range text
00038                 if (range.StartPosition > currentPosition)
00039                 {
00040                     int length = (int)range.StartPosition - currentPosition;
00041                     var subString = TextContent.Substring(currentPosition, length);
00042                     tb.Inlines.Add(new Run() { Text = subString });
00043                     currentPosition += length;
00044                 }
00045                 // Add the next range
00046                 var boldString = TextContent.Substring((int)range.StartPosition, (int)range.Length);
00047                 tb.Inlines.Add(new Run() { Text = boldString, FontWeight = FontWeights.Bold });
00048                 currentPosition += (int)range.Length;
00049             }
00050             // Add the text after the last matching segment
00051             if (currentPosition < TextContent.Length)
00052             {
00053                 var subString = TextContent.Substring(currentPosition);
00054                 tb.Inlines.Add(new Run() { Text = subString });
00055             }
00056             tb.Inlines.Add(new Run() { Text = "\r\n" });
00057         }
00058     }
00059
00060     public class Scenario
00061     {
00062         public string Title { get; set; }
00063         public Type ClassType { get; set; }
00064     }
00065 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/ViewLifetimeControl.cpp Source File

  • MultipleViews
  • cppwinrt

ViewLifetimeControl.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // The objects defined here demonstrate how to make sure each of the views created remains alive as long as
00013 // the app needs them, but only when they're being used by the app or the user. Many of the scenarios contained in this
00014 // sample use these functions to keep track of the views available and ensure that the view is not closed while
00015 // the scenario is attempting to show it.
00016 //
00017 // As you can see in scenario 1, the ApplicationViewSwitcher.TryShowAsStandaloneAsync and
00018 // ProjectionManager.StartProjectingAsync methods let you show one view next to another. The Consolidated event
00019 // is fired when a view stops being visible separately from other views. Common cases where this will occur
00020 // is when the view falls out of the list of recently used apps, or when the user performs the close gesture on the view.
00021 // This is a good time to close the view, provided the app isn't trying to show the view at the same time. This event
00022 // is fired on the thread of the view that becomes consolidated.
00023 //
00024 // Each view lives on its own thread, so concurrency control is necessary. Also, as you'll see in the sample,
00025 // certain objects may be bound to UI on given threads. Properties of those objects should only be updated
00026 // on that UI thread.
00027
00028 #include "pch.h"
00029 #include "ViewLifetimeControl.h"
00030 #include "ViewLifetimeControl.g.cpp"
00031
00032 using namespace winrt;
00033 using namespace SDKTemplate;
00034 using namespace Windows::Foundation;
00035 using namespace Windows::UI::Core;
00036 using namespace Windows::UI::ViewManagement;
00037 using namespace Windows::UI::Xaml::Data;
00038
00039 namespace winrt::SDKTemplate::implementation
00040 {
00041     // A ViewLifetimeControl is instantiated for every secondary view.ViewLifetimeControl's reference count
00042     // keeps track of when the secondary view thinks it's in use and when the main view is interacting with the secondary view (about to show
00043     // it to the user, etc.) When the reference count drops to zero, the secondary view is closed.
00044     // Instantiate views using "CreateForCurrentView".
00045     ViewLifetimeControl::ViewLifetimeControl(CoreWindow const& newWindow)
00046     {
00047         m_dispatcher = newWindow.Dispatcher();
00048         m_window = newWindow;
00049         m_viewId = ApplicationView::GetApplicationViewIdForWindow(newWindow);
00050
00051         // This class will automatically tell the view when its time to close
00052         // or stay alive in a few cases
00053         RegisterForEvents();
00054     }
00055
00056     // Register for events on the current view
00057
00058     void ViewLifetimeControl::RegisterForEvents()
00059     {
00060         // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00061         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00062         // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00063         m_consolidatedToken = ApplicationView::GetForCurrentView().Consolidated({ this, &ViewLifetimeControl::ViewConsolidated });
00064     }
00065
00066     // Unregister for events. Call this method before closing the view to prevent leaks.
00067     void ViewLifetimeControl::UnregisterForEvents()
00068     {
00069         ApplicationView::GetForCurrentView().Consolidated(m_consolidatedToken);
00070     }
00071
00072     void ViewLifetimeControl::ViewConsolidated(ApplicationView const&, ApplicationViewConsolidatedEventArgs const&)
00073     {
00074         // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00075         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00076         // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00077         StopViewInUse();
00078     }
00079
00080     // Called when a view has been "consolidated" (no longer accessible to the user)
00081     // and no other view is trying to interact with it. This should only be closed after the reference
00082     // count goes to 0 (including being consolidated). At the end of this, the view is closed.
00083     void ViewLifetimeControl::FinalizeRelease()
00084     {
00085         bool justReleased = false;
00086         {
00087             auto lock = std::lock_guard(m_mutex);
00088             if (!m_released && m_refCount == 0)
00089             {
00090                 m_released = true;
00091                 justReleased = true;
00092             }
00093         } // lock
00094
00095         // This assumes that released will never be made false after it
00096         // it has been set to true
00097         if (justReleased)
00098         {
00099             UnregisterForEvents();
00100             m_internalReleased(*this, nullptr);
00101         }
00102     }
00103
00104     // Creates ViewLifetimeControl for the particular view.
00105     // Only do this once per view.
00106     SDKTemplate::ViewLifetimeControl ViewLifetimeControl::CreateForCurrentView()
00107     {
00108         return make<ViewLifetimeControl>(CoreWindow::GetForCurrentThread());
00109     }
00110
00111     // For purposes of this sample, the collection of views
00112     // is bound to a UI collection. This property is available for binding
00113     hstring ViewLifetimeControl::Title()
00114     {
00115         // This is expected to only be updated on the thread that this object is bound to
00116         // Hence, it's not necessary to lock
00117         return m_title;
00118     }
00119
00120     void ViewLifetimeControl::Title(hstring const& value)
00121     {
00122         // This is expected to only be updated on the thread that this object is bound to
00123         // Hence, it's not necessary to lock
00124         if (m_title != value)
00125         {
00126             m_title = value;
00127             m_propertyChanged(*this, PropertyChangedEventArgs(L"Title"));
00128         }
00129     }
00130
00131     // Signals that the view is being interacted with by another view,
00132     // so it shouldn't be closed even if it becomes "consolidated"
00133     int32_t ViewLifetimeControl::StartViewInUse()
00134     {
00135         auto lock = std::lock_guard(m_mutex);
00136         if (m_released)
00137         {
00138             throw hresult_error(RO_E_CLOSED, L"The view is being disposed");
00139         }
00140         return ++m_refCount;
00141     }
00142
00143     // Should come after any call to StartViewInUse
00144     // Signals that the another view has finished interacting with the view tracked
00145     // by this object
00146     int32_t ViewLifetimeControl::StopViewInUse()
00147     {
00148         auto lock = std::lock_guard(m_mutex);
00149         if (m_released)
00150         {
00151             throw hresult_error(RO_E_CLOSED, L"The view is being disposed");
00152         }
00153         if (m_refCount <= 0)
00154         {
00155             throw hresult_error(HRESULT_FROM_WIN32(ERROR_INVALID_STATE), L"Object was released too many times");
00156         }
00157
00158         int refCountCopy = --m_refCount;
00159         if (refCountCopy == 0)
00160         {
00161             // If no other view is interacting with this view, and
00162             // the view isn't accessible to the user, it's appropriate
00163             // to close it
00164             //
00165             // Before actually closing the view, make sure there are no
00166             // other important events waiting in the queue (this low-priority item
00167             // will run after other events)
00168             m_dispatcher.RunAsync(CoreDispatcherPriority::Low, { this, &ViewLifetimeControl::FinalizeRelease });
00169         }
00170
00171         return refCountCopy;
00172     }
00173
00174     // Signals to consumers that its time to close the view so that
00175     // they can clean up (including calling Window.Close() when finished)
00176     event_token ViewLifetimeControl::Released(TypedEventHandler<SDKTemplate::ViewLifetimeControl, IInspectable> const& handler)
00177     {
00178         auto lock = std::lock_guard(m_mutex);
00179         if (m_released)
00180         {
00181             throw hresult_error(RO_E_CLOSED, L"The view is being disposed");
00182         }
00183
00184         return m_internalReleased.add(handler);
00185     }
00186
00187     void ViewLifetimeControl::Released(event_token const& token)
00188     {
00189         auto lock = std::lock_guard(m_mutex);
00190         return m_internalReleased.remove(token);
00191     }
00192
00193     event_token ViewLifetimeControl::PropertyChanged(PropertyChangedEventHandler const& handler)
00194     {
00195         return m_propertyChanged.add(handler);
00196     }
00197
00198     void ViewLifetimeControl::PropertyChanged(event_token const& token)
00199     {
00200         return m_propertyChanged.remove(token);
00201     }
00202 }
Generated on Fri Nov 15 2024 22:20:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VisualPropertiesFactory Member List

This is the complete list of members for VisualPropertiesFactory, including all inherited members.
CreateView() | VisualPropertiesFactory | [inline, private]
Main(string[] args) | VisualPropertiesFactory | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/pch.cpp Source File

  • RelativeInclinometer
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/RenderingHelper.h Source File

  • SpatialInteractionSource
  • cpp
  • Content

RenderingHelper.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "..\Common\DeviceResources.h"
00004 #include "..\Common\StepTimer.h"
00005 #include "ShaderStructures.h"
00006 #include "SourceHandler.h"
00007 #include "RenderingInterfaces.h"
00008
00009 namespace HolographicPaint
00010 {
00011
00012     // This class stores the objects required for D3D rendering such as the shaders
00013     // It also provides methods to draw simple shapes such as Cube
00014     class RenderingHelper : public IRenderer
00015     {
00016     public:
00017
00018         RenderingHelper(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00019
00020         void CreateDeviceDependentResources();
00021         void ReleaseDeviceDependentResources();
00022
00023         bool IsLoadingComplete() const { return m_loadingComplete; }
00024
00025         // IRenderer implementation
00026         bool PrepareRendering();
00027
00028         virtual void SetConstantBuffer(ModelConstantBuffer* pModelConstantBuffer) override;
00029
00030         virtual void DrawCube() override;
00031
00032     private:
00033         // Cached pointer to device resources.
00034         std::shared_ptr<DX::DeviceResources>            m_deviceResources;
00035
00036         // Direct3D resources for cube geometry.
00037         Microsoft::WRL::ComPtr<ID3D11InputLayout>       m_inputLayout;
00038         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_vertexBuffer;
00039         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_indexBuffer;
00040         Microsoft::WRL::ComPtr<ID3D11VertexShader>      m_vertexShader;
00041         Microsoft::WRL::ComPtr<ID3D11GeometryShader>    m_geometryShader;
00042         Microsoft::WRL::ComPtr<ID3D11PixelShader>       m_pixelShader;
00043         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_modelConstantBuffer;
00044
00045         bool                                            m_loadingComplete = false;
00046
00047         // If the current D3D Device supports VPRT, we can avoid using a geometry
00048         // shader just to set the render target array index.
00049         bool                                            m_usingVprtShaders = false;
00050
00051         unsigned int                                    m_indexCount;
00052     };
00053 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TripVoiceCommand Member List

This is the complete list of members for TripVoiceCommand, including all inherited members.
commandMode | TripVoiceCommand |
destination | TripVoiceCommand |
textSpoken | TripVoiceCommand |
TripVoiceCommand(string voiceCommand, string commandMode, string textSpoken, string destination) | TripVoiceCommand | [inline]
voiceCommand | TripVoiceCommand |
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PhotoAdjustmentProperties Member List

This is the complete list of members for PhotoAdjustmentProperties, including all inherited members.
ClarityValue | PhotoAdjustmentProperties
ContrastValue | PhotoAdjustmentProperties
HighlightsValue | PhotoAdjustmentProperties
HsMaskRadiusValue | PhotoAdjustmentProperties
SaturationValue | PhotoAdjustmentProperties
ShadowsValue | PhotoAdjustmentProperties
StraightenValue | PhotoAdjustmentProperties
TemperatureValue | PhotoAdjustmentProperties
TintValue | PhotoAdjustmentProperties
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario4.cpp Source File

  • FileAccess
  • cppwinrt

Scenario4.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4.h"
00014 #include "Scenario4.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::Streams;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario4::Scenario4()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario4::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         SampleState::ValidateFile();
00034     }
00035
00036     fire_and_forget Scenario4::WriteBytesButton_Click(IInspectable const&, RoutedEventArgs const&)
00037     {
00038         auto lifetime = get_strong();
00039
00040         StorageFile file = SampleState::SampleFile();
00041         if (file != nullptr)
00042         {
00043             try
00044             {
00045                 hstring userContent = InputTextBox().Text();
00046                 IBuffer buffer = SampleState::GetBufferFromString(userContent);
00047                 co_await FileIO::WriteBufferAsync(file, buffer);
00048                 rootPage.NotifyUser(L"The following " + to_hstring(buffer.Length()) + L" bytes were written to '" + file.Name() + L"':\n" + userContent, NotifyType::StatusMessage);
00049             }
00050             catch (const hresult_error& ex)
00051             {
00052                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00053                 {
00054                     SampleState::NotifyUserFileNotExist();
00055                 }
00056                 else if (ex.code() == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
00057                 {
00058                     rootPage.NotifyUser(L"File is not UTF-8 encoded.", NotifyType::ErrorMessage);
00059                 }
00060                 else
00061                 {
00062                     // I/O errors are reported as exceptions.
00063                     rootPage.NotifyUser(L"Error writing to '" + file.Name() + L"': " + ex.message(), NotifyType::ErrorMessage);
00064                 }
00065             }
00066         }
00067         else
00068         {
00069             SampleState::NotifyUserFileNotExist();
00070         }
00071     }
00072
00073     fire_and_forget Scenario4::ReadBytesButton_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         auto lifetime = get_strong();
00076
00077         StorageFile file = SampleState::SampleFile();
00078         if (file != nullptr)
00079         {
00080             try
00081             {
00082                 IBuffer buffer = co_await FileIO::ReadBufferAsync(file);
00083                 hstring fileContent = SampleState::GetStringFromBuffer(buffer);
00084                 rootPage.NotifyUser(L"The following "+ to_hstring(buffer.Length()) + L"bytes were read from '" + file.Name() + L"':\n" + fileContent, NotifyType::StatusMessage);
00085             }
00086             catch (const hresult_error& ex)
00087             {
00088                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00089                 {
00090                     SampleState::NotifyUserFileNotExist();
00091                 }
00092                 else if (ex.code() == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
00093                 {
00094                     // Thrown by CryptographicBuffer::ConvertBinaryToString
00095                     rootPage.NotifyUser(L"File is not UTF-8 encoded.", NotifyType::ErrorMessage);
00096                 }
00097                 else
00098                 {
00099                     // I/O errors are reported as exceptions.
00100                     rootPage.NotifyUser(L"Error reading from '" + file.Name() + L"': " + ex.message(), NotifyType::ErrorMessage);
00101                 }
00102             }
00103         }
00104         else
00105         {
00106             SampleState::NotifyUserFileNotExist();
00107         }
00108     }
00109 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PageToPrint.xaml.h Source File

  • Printing
  • cpp

PageToPrint.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // PageToPrint.xaml.h
00003 // Declaration of the PageToPrint class
00004 //
00005
00006 #pragma once
00007
00008 #include "PageToPrint.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// Page content to send to the printer
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class PageToPrint sealed
00017     {
00018     public:
00019         PageToPrint();
00020
00021         property Windows::UI::Xaml::Controls::RichTextBlock^ TextContentBlock;
00022     };
00023 }
Generated on Fri Nov 15 2024 22:20:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SignIn Member List

This is the complete list of members for SignIn, including all inherited members.
AddPassportToAccountOnServer() | SignIn | [inline, private]
AuthenticatePassportAsync() | SignIn | [inline, private]
AuthenticatePasswordCredentialsAsync() | SignIn | [inline, private]
Button_Passport_Click(object sender, RoutedEventArgs e) | SignIn | [inline, private]
Button_SignIn_Click(object sender, RoutedEventArgs e) | SignIn | [inline, private]
CleanUpUserList() | SignIn | [inline, private]
CreatePassportKeyAsync(string accountId) | SignIn | [inline, private]
GetPassportAuthenticationMessageAsync(IBuffer message, string accountId) | SignIn | [inline, private]
m_account | SignIn | [private]
m_addingAccount | SignIn | [private]
m_passportAvailable | SignIn | [private]
OnNavigatedTo(NavigationEventArgs e) | SignIn | [inline, protected]
PassportAvailableCheckAsync() | SignIn | [inline, private]
rootPage | SignIn | [private]
SignIn() | SignIn | [inline]
SignInPassportAsync(bool passportIsPrimaryLogin) | SignIn | [inline, private]
SignInPasswordAsync(bool calledFromPassport) | SignIn | [inline, private]
SuccessfulSignIn(Account account) | SignIn | [inline, private]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

METERING_CONTEXT Member List

This is the complete list of members for METERING_CONTEXT, including all inherited members.
metering METERING_CONTEXT
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

D2DAdvancedColorImagesRenderer Member List

This is the complete list of members for D2DAdvancedColorImagesRenderer, including all inherited members.
Clamp(float v, float bound1, float bound2) | D2DAdvancedColorImagesRenderer | [inline, private, static]
ComputeHdrMetadata() | D2DAdvancedColorImagesRenderer | [private]
CreateDeviceDependentResources() | D2DAdvancedColorImagesRenderer |
CreateDeviceIndependentResources() | D2DAdvancedColorImagesRenderer |
CreateHistogramResources() | D2DAdvancedColorImagesRenderer | [private]
CreateImageDependentResources() | D2DAdvancedColorImagesRenderer |
CreateWindowSizeDependentResources() | D2DAdvancedColorImagesRenderer |
D2DAdvancedColorImagesRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | D2DAdvancedColorImagesRenderer |
Draw() | D2DAdvancedColorImagesRenderer |
EmitHdrMetadata() | D2DAdvancedColorImagesRenderer | [private]
FitImageToWindow() | D2DAdvancedColorImagesRenderer |
LoadImageCommon(_In_ IWICBitmapSource *source) | D2DAdvancedColorImagesRenderer | [private]
LoadImageFromWic(_In_ IStream *imageStream) | D2DAdvancedColorImagesRenderer |
m_brightnessAdjust | D2DAdvancedColorImagesRenderer | [private]
m_colorManagementEffect | D2DAdvancedColorImagesRenderer | [private]
m_deviceResources | D2DAdvancedColorImagesRenderer | [private]
m_dispInfo | D2DAdvancedColorImagesRenderer | [private]
m_filmicEffect | D2DAdvancedColorImagesRenderer | [private]
m_finalOutput | D2DAdvancedColorImagesRenderer | [private]
m_formatConvert | D2DAdvancedColorImagesRenderer | [private]
m_heatmapEffect | D2DAdvancedColorImagesRenderer | [private]
m_histogramEffect | D2DAdvancedColorImagesRenderer | [private]
m_histogramPrescale | D2DAdvancedColorImagesRenderer | [private]
m_imageInfo | D2DAdvancedColorImagesRenderer | [private]
m_imageOffset | D2DAdvancedColorImagesRenderer | [private]
m_imageSource | D2DAdvancedColorImagesRenderer | [private]
m_isComputeSupported | D2DAdvancedColorImagesRenderer | [private]
m_maxCLL | D2DAdvancedColorImagesRenderer | [private]
m_minZoom | D2DAdvancedColorImagesRenderer | [private]
m_pointerPos | D2DAdvancedColorImagesRenderer | [private]
m_reinhardEffect | D2DAdvancedColorImagesRenderer | [private]
m_renderEffectKind | D2DAdvancedColorImagesRenderer | [private]
m_scaledImage | D2DAdvancedColorImagesRenderer | [private]
m_sdrOverlayEffect | D2DAdvancedColorImagesRenderer | [private]
m_whiteScaleEffect | D2DAdvancedColorImagesRenderer | [private]
m_wicColorContext | D2DAdvancedColorImagesRenderer | [private]
m_zoom | D2DAdvancedColorImagesRenderer | [private]
OnDeviceLost() | D2DAdvancedColorImagesRenderer | [virtual]
OnDeviceRestored() | D2DAdvancedColorImagesRenderer | [virtual]
PopulateImageInfoACKind(_Inout_ ImageInfo *info) | D2DAdvancedColorImagesRenderer |
ReleaseDeviceDependentResources() | D2DAdvancedColorImagesRenderer |
ReleaseImageDependentResources() | D2DAdvancedColorImagesRenderer |
SetRenderOptions(RenderEffectKind effect, float brightnessAdjustment, Windows::Graphics::Display::AdvancedColorInfo^acInfo) | D2DAdvancedColorImagesRenderer |
UpdateImageColorContext() | D2DAdvancedColorImagesRenderer | [private]
UpdateImageTransformState() | D2DAdvancedColorImagesRenderer | [private]
UpdateManipulationState(_In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args) | D2DAdvancedColorImagesRenderer |
UpdateWhiteLevelScale(float brightnessAdjustment, float sdrWhiteLevel) | D2DAdvancedColorImagesRenderer | [private]
~D2DAdvancedColorImagesRenderer() | D2DAdvancedColorImagesRenderer |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/ISecureInterfaceService.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

ISecureInterfaceService.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 public interface class ISecureInterfaceService
00026 {
00027 public:
00028     // "Concatenate two input strings and returns the concatenated string as output"
00029     // Implement this function to handle calls to the Concatenate method.
00030     Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^>^ ConcatenateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info , _In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2);
00031
00032     // "Determine if the output of the Concatenate method is returned as upper case string or not"
00033     // Implement this function to handle requests for the value of the IsUpperCaseEnabled property.
00034     //
00035     // Currently, info will always be null, because no information is available about the requestor.
00036     Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ GetIsUpperCaseEnabledAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00037
00038     // "Determine if the output of the Concatenate method is returned as upper case string or not"
00039     // Implement this function to handle requests to set the IsUpperCaseEnabled property.
00040     //
00041     // Currently, info will always be null, because no information is available about the requestor.
00042     Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ SetIsUpperCaseEnabledAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, bool value);
00043
00044 };
00045
00046 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cs/Scenario2_EnableSettings.xaml.cs Source File

  • LampDevice
  • cs

Scenario2_EnableSettings.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace Lamp
00013 {
00014     using Windows.UI;
00015     using Windows.UI.Xaml.Controls;
00016     using Windows.UI.Xaml.Navigation;
00017     using SDKTemplate;
00018     using System;
00019     using System.Globalization;
00020     using System.Threading.Tasks;
00021     using Windows.Devices.Lights;
00022
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario2_EnableSettings : Page
00027     {
00028         /// <summary>
00029         /// Private MainPage object for status updates
00030         /// </summary>
00031         private MainPage rootPage;
00032
00033         /// <summary>
00034         /// Initializes a new instance of the <see cref="Scenario2_EnableSettings"/> class.
00035         /// </summary>
00036         public Scenario2_EnableSettings()
00037         {
00038             this.InitializeComponent();
00039         }
00040
00041         /// <summary>
00042         /// Event Handler for OnNavigateTo Event
00043         /// </summary>
00044         /// <param name="e"></param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             rootPage = MainPage.Current;
00048             base.OnNavigatedTo(e);
00049         }
00050
00051         /// <summary>
00052         /// Event Handler for Brightness Button Click
00053         /// </summary>
00054         /// <param name="sender">Contains information regarding button that fired event</param>
00055         /// <param name="e">Contains state information and event data associated with the event</param>
00056         private async void BrightnessBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00057         {
00058             await LogStatusToOutputBoxAsync("Initializing lamp");
00059
00060             // acquiring lamp instance via using statement allows for the
00061             // object to be automatically disposed once the lamp object
00062             // goes out of scope releasing native resources
00063             using (var lamp = await Lamp.GetDefaultAsync())
00064             {
00065                 if (lamp == null)
00066                 {
00067                     await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
00068                     return;
00069                 }
00070
00071                 await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Default lamp instance acquired, Device Id: {0}", lamp.DeviceId), NotifyType.StatusMessage);
00072                 await LogStatusToOutputBoxAsync("Lamp Default settings:");
00073                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}, Brightness: {1}", lamp.IsEnabled, lamp.BrightnessLevel));
00074
00075                 // Set the Brightness Level
00076                 await LogStatusToOutputBoxAsync("Adjusting Brightness");
00077                 lamp.BrightnessLevel = 0.5F;
00078                 await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Settings After Brightness Adjustment: Brightness: {0}", lamp.BrightnessLevel), NotifyType.StatusMessage);
00079
00080                 // Turn Lamp on
00081                 await LogStatusToOutputBoxAsync("Turning Lamp on");
00082                 lamp.IsEnabled = true;
00083                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));
00084
00085                 // Turn Lamp off
00086                 await LogStatusToOutputBoxAsync("Turning Lamp off");
00087                 lamp.IsEnabled = false;
00088                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));
00089
00090             }
00091
00092             await LogStatusToOutputBoxAsync("Lamp Disposed");
00093         }
00094
00095         /// <summary>
00096         /// Event handler for Color Lamp Button. Queries the lamp device for color adjustment
00097         /// support and if device supports being color settable, it sets lamp color to blue.
00098         /// Click Event
00099         /// </summary>
00100         /// <param name="sender">Contains information regarding button that fired event</param>
00101         /// <param name="e">Contains state information and event data associated with the event</param>
00102         private async void ColorLampBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00103         {
00104             await LogStatusToOutputBoxAsync("Initializing lamp");
00105
00106             // Acquiring lamp instance via using statement allows for the
00107             // object to be automatically disposed once the lamp object
00108             // goes out of scope releasing native resources
00109             using (var lamp = await Lamp.GetDefaultAsync())
00110             {
00111                 if (lamp == null)
00112                 {
00113                     await LogStatusAsync("Error: No lamp device was found", NotifyType.ErrorMessage);
00114                     return;
00115                 }
00116
00117                 // With Lamp instance required, query for the default settings of the Lamp
00118                 await LogStatusAsync("Default lamp instance acquired", NotifyType.StatusMessage);
00119                 await LogStatusToOutputBoxAsync("Lamp Default settings:");
00120                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}, Is Color Settable: {1}, Color: {2}", lamp.IsEnabled, lamp.IsColorSettable, lamp.Color));
00121
00122                 // If this lamp device is not Color Settable exit color lamp adjustment
00123                 if (lamp.IsColorSettable == false)
00124                 {
00125                     await LogStatusAsync("Selected Lamp device doesn't support Color lamp adjustment", NotifyType.ErrorMessage);
00126                     return;
00127                 }
00128
00129                 // Change Lamp Color
00130                 await LogStatusToOutputBoxAsync("Adjusting Color");
00131                 lamp.Color = Colors.Blue;
00132                 await LogStatusAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Settings After Color Adjustment: Color: {0}", lamp.Color), NotifyType.StatusMessage);
00133
00134                 // Turn Lamp on
00135                 await LogStatusToOutputBoxAsync("Turning Lamp on");
00136                 lamp.IsEnabled = true;
00137                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));
00138
00139                 // Turn Lamp off
00140                 await LogStatusToOutputBoxAsync("Turning Lamp off");
00141                 lamp.IsEnabled = false;
00142                 await LogStatusToOutputBoxAsync(string.Format(CultureInfo.InvariantCulture, "Lamp Enabled: {0}", lamp.IsEnabled));
00143             }
00144
00145             /// Lamp gets disposed automatically when it goes out of scope of using block
00146             await LogStatusToOutputBoxAsync("Lamp Disposed");
00147         }
00148
00149         /// <summary>
00150         /// Marshall log message to the UI thread
00151         /// and update outputBox, this method is for more general messages
00152         /// </summary>
00153         /// <param name="message">Message to log</param>
00154         private async Task LogStatusToOutputBoxAsync(string message)
00155         {
00156             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00157             {
00158                 outputBox.Text += message + "\r\n";
00159                 outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
00160             });
00161         }
00162
00163         /// <summary>
00164         /// Method to log Status to Main Status block,
00165         /// which shows up in bottom of scenario page status block
00166         /// </summary>
00167         /// <param name="message">Message to log</param>
00168         /// <param name="type">Status Notify Type</param>
00169         private async Task LogStatusAsync(string message, NotifyType type)
00170         {
00171             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00172             {
00173                 rootPage.NotifyUser(message, type);
00174             });
00175             await LogStatusToOutputBoxAsync(message);
00176         }
00177     }
00178 }
Generated on Fri Nov 15 2024 22:20:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingChannelScenario.cpp Source File

  • Logging
  • cpp

LoggingChannelScenario.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "LoggingChannelScenario.h"
00009
00010 using namespace Platform;
00011 using namespace SDKTemplate;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Diagnostics;
00014
00015 /// <summary>
00016 /// Construct a LoggingChannel with the Windows 8.1 constructor, then
00017 /// use the LoggingChannel for the scenario.
00018 /// See this sample's README for further discussion.
00019 /// </summary>
00020 void LoggingChannelScenario::LogWithWin81Constructor()
00021 {
00022     /*
00023     If a LoggingChannel is used as a local or member variable, it should
00024     be closed (disposed) when no longer needed. Use the C++/CX "delete"
00025     operator to close the object.
00026     */
00027
00028     // The 1-parameter constructor creates a channel with Windows 8.1 semantics.
00029 #pragma warning(suppress: 4973) // Disable warning for use of obsolete LoggingChannel constructor.
00030     auto channel = ref new LoggingChannel("SampleProvider");
00031
00032     DemonstrateLogging(channel);
00033
00034     delete channel;
00035 }
00036
00037 /// <summary>
00038 /// Construct a LoggingChannel with the Windows 10 constructor, then
00039 /// use the LoggingChannel for the scenario. Also show the use cases
00040 /// for the two Windows 10 constructors.
00041 // See this sample's README for further discussion.
00042 /// </summary>
00043 void LoggingChannelScenario::LogWithWin10Constructor()
00044 {
00045     {
00046         /*
00047         If a LoggingChannel is used as a local or member variable, it should
00048         be closed (disposed) when no longer needed. Use the C++/CX "delete"
00049         operator to close the object.
00050         */
00051
00052         // The 2-parameter constructor creates a channel with Windows 10 semantics.
00053         auto channel = ref new LoggingChannel(
00054             "SampleProvider",
00055             nullptr); // null means use default options.
00056
00057         // The Id is generated by hashing the string "SampleProvider".
00058         // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
00059         DemonstrateLogging(channel);
00060
00061         delete channel;
00062     }
00063
00064     /*
00065     Demonstrate other (less-common) constructor scenarios:
00066     */
00067
00068     {
00069         // This creates a channel with Windows 10 semantics and declared
00070         // membership in a provider group.
00071         GUID g = { 0x2e0582f3,0xd1b6,0x516a,0x9d,0xe3,0x9f,0xd7,0x9e,0xf9,0x52,0xf8 };
00072         auto channel = ref new LoggingChannel(
00073             "SampleProvider",
00074             ref new LoggingChannelOptions(g)); // Join a provider group
00075         // The Id is generated by hashing the string "SampleProvider".
00076         // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
00077
00078         delete channel;
00079     }
00080
00081     {
00082         // This creates a channel with Windows 10 semantics and a specific
00083         // provider Id.
00084         GUID g = { 0x2e0582f3,0xd1b6,0x516a,0x9d,0xe3,0x9f,0xd7,0x9e,0xf9,0x52,0xf8 };
00085         auto channel = ref new LoggingChannel(
00086             "SampleProvider",
00087             nullptr,
00088             g);
00089         // channel.Id == 2e0582f3-d1b6-516a-9de3-9fd79ef952f8
00090
00091         delete channel;
00092     }
00093 }
00094
00095 /// <summary>
00096 /// This method demonstrates the LoggingChannel and LoggingActivity APIs.
00097 /// </summary>
00098 /// <param name="channel">
00099 /// The channel to use for the demonstration. This channel may have been
00100 /// constructed using a Windows 8.1 constructor or a Windows 10 constructor.
00101 /// The same APIs are supported in both cases, but the ETL events will be
00102 /// formatted a bit differently depending on how the channel was constructed.
00103 /// </param>
00104 void LoggingChannelScenario::DemonstrateLogging(
00105     Windows::Foundation::Diagnostics::LoggingChannel^ channel)
00106 {
00107     // Whenever any ETW session changes the way it is listening to this
00108     // channel, the LoggingEnable event is fired. For example, this might
00109     // be called when a session begins listening, changes the level at
00110     // which it is listening, or stops listening.
00111     channel->LoggingEnabled +=
00112         ref new TypedEventHandler<ILoggingChannel^, Object^>(this, &LoggingChannelScenario::OnLoggingEnabled);
00113
00114     // Log simple string events
00115     channel->LogMessage("Simple message"); // default level is Verbose
00116     channel->LogMessage("Simple error", LoggingLevel::Error);
00117
00118     // Log simple string + integer events.
00119     channel->LogValuePair("Simple message", 123); // default level is Verbose
00120     channel->LogValuePair("Simple error", 456, LoggingLevel::Error);
00121
00122     // The channel.Name property returns the name that was used when the
00123     // channel was constructed. When running in Windows 10 mode, the name
00124     // is already set as the provider name, so no LoggingChannelName is
00125     // automatically added to the event.
00126     channel->LogMessage(channel->Name);
00127
00128     // The channel.Id property is new to Windows 10.
00129     channel->LogMessage(channel->Id.ToString());
00130
00131     // If you want to avoid the overhead of collecting data when nobody is
00132     // listening to your channel, check the Enabled property before logging.
00133     if (channel->Enabled)
00134     {
00135         channel->LogMessage(CollectExpensiveData());
00136     }
00137
00138     // The IsEnabled() method is exactly the same as the Enabled property,
00139     // except that it is a new Windows 10 API.
00140     if (channel->IsEnabled())
00141     {
00142         channel->LogMessage(CollectExpensiveData());
00143     }
00144
00145     // If you want to only collect data if somebody is listening at a specific
00146     // level, you need to check both Enabled and Level. Note that the value of
00147     // the Level is unspecified when Enabled is false.
00148     if (channel->Enabled && channel->Level <= LoggingLevel::Warning)
00149     {
00150         channel->LogMessage(CollectExpensiveData(), LoggingLevel::Warning);
00151     }
00152
00153     // The IsEnabled(LoggingLevel) method is a bit nicer than checking both
00154     // Enabled and Level, but it is only available on Windows 10 or later.
00155     if (channel->IsEnabled(LoggingLevel::Warning))
00156     {
00157         channel->LogMessage(CollectExpensiveData(), LoggingLevel::Warning);
00158     }
00159
00160     // You can also use IsEnabled to check for keywords.
00161     if (channel->IsEnabled(LoggingLevel::Information, 0x10))
00162     {
00163         channel->LogMessage(CollectExpensiveData(), LoggingLevel::Information);
00164     }
00165
00166     // Use LoggingFields with the LogEvent method to write complex events.
00167     auto fields = ref new LoggingFields();
00168     fields->AddDouble("pi", 3.14159);
00169     channel->LogEvent(
00170         "ComplexEvent",
00171         fields,
00172         LoggingLevel::Verbose,
00173         ref new LoggingOptions(0x10)); // Keywords = 0x10
00174
00175     // You can add any number of name-value pairs to a fields object, though
00176     // you may encounter ETW limitations if you add too many. For example,
00177     // ETW is limited to a maximum event size of 64KB, and the current
00178     // TraceLogging decoder can handle no more than 128 fields.
00179
00180     // Performance optimization: You can reuse a LoggingFields object to
00181     // avoid unnecessary allocations. Don't forget to call Clear()
00182     // between uses, and don't try to share a LoggingFields object between
00183     // threads.
00184     __int64 now;
00185     GetSystemTimeAsFileTime(reinterpret_cast<FILETIME*>(&now));
00186     fields->Clear();
00187     fields->AddInt64("Date", now, LoggingFieldFormat::FileTime);
00188     channel->LogEvent("Now", fields);
00189
00190     fields->Clear();
00191
00192     // You can add a formatting hint to affect the way a value is decoded.
00193     // Not all combinations are useful, and the hint may be ignored.
00194     // For example, you can encode an MBCS string by writing a byte array
00195     // with a String hint.
00196     byte abc123[] = { 65, 66, 67, 49, 50, 51 }; // "ABC123"
00197     fields->AddUInt8Array(
00198         "AnsiString",
00199         ref new Array<byte>(abc123, _countof(abc123)),
00200         LoggingFieldFormat::String);
00201
00202     // You can add "tag" bits to a field. These are user-defined bits that
00203     // can be used to communicate with an event processing tool. For example,
00204     // you might define a tag bit to indicate that a field contains private
00205     // data that should not be displayed on-screen.
00206     fields->AddString("Password", "12345", LoggingFieldFormat::Default, 0x10);
00207
00208     // You can add a "structure" to an event. A structure is a name for a
00209     // group of fields. Structures can nest. Call BeginStruct to add a level
00210     // of nesting, and call EndStruct after the last field of the structure.
00211     fields->BeginStruct("Nested");
00212         fields->AddInt16("Nested-1", 1);
00213         fields->AddInt16("Nested-2", 2);
00214         fields->BeginStruct("Nested-Nested");
00215             fields->AddInt16("Nested-Nested-3", 3);
00216         fields->EndStruct();
00217         fields->AddInt16("Nested-4", 4);
00218     fields->EndStruct();
00219
00220     // Advanced scenarios: you can use a LoggingOptions object to control
00221     // detailed event settings such as keywords, opcodes, and activity Ids.
00222     // These have their normal ETW semantics. You can also set event tags,
00223     // which are bit values that can be used to communicate with the event
00224     // processor.
00225     auto options = ref new LoggingOptions();
00226     options->Keywords = 0x123;
00227     options->Tags = 0x10;
00228     channel->LogEvent(
00229         "VeryComplexEvent",
00230         fields,
00231         LoggingLevel::Information,
00232         options);
00233
00234     // Windows 10 introduces the ILoggingTarget interface. LoggingChannel
00235     // implements this interface. This interface allows components to accept
00236     // a logger as an parameter.
00237     DoSomething(channel);
00238
00239     /*
00240     If a LoggingActivity is created using a LoggingActivity constructor,
00241     it will use Windows 8.1 semantics:
00242
00243     - If an activity is destroyed (garbage-collected) without being closed
00244     and the associated LoggingChannel is still open, the activity will
00245     write a default Stop event.
00246     - The default Stop event (written by the destructor or by the Close()
00247     method) is encoded as a "simple" event.
00248
00249     The 8.1 semantics are deprecated because the automatic generation of
00250     a Stop event at garbage-collection can be misleading. The Stop event
00251     is intended to mark the a precise point at which an activity is
00252     completed, while the garbage-collection of an abandoned activity is
00253     inherently imprecise and unpredictable.
00254
00255     If a LoggingActivity is created using a StartActivity method, it will
00256     use Windows 10 semantics:
00257
00258     - If an activity is destroyed (garbage-collected) without being closed,
00259       there will be no Stop event for the activity.
00260     - The default Stop event (written by the Close() method) is encoded as
00261       a TraceLogging event with name "ActivityClosed".
00262     */
00263
00264     {
00265         // This activity is created with Windows 8.1 semantics.
00266         auto a1 = ref new LoggingActivity("Activity1", channel);
00267
00268         // The activity Start event is written by the LoggingActivity constructor.
00269         // You would do your activity's work here.
00270         // The activity Stop event is written when the activity is closed (disposed).
00271
00272         // The Windows 10 LoggingActivity adds new methods for writing events
00273         // that are marked as associated with the activity.
00274         a1->LogEvent("Activity event");
00275
00276         // LoggingActivity also implements the ILoggingTarget interface, so you can
00277         // use either a channel or an activity as a logging target.
00278         DoSomething(a1);
00279
00280         {
00281             // The Windows 10 LoggingActivity adds new methods for creating nested activities.
00282             // Note that nested activities are always created with Windows 10 semantics,
00283             // even when nested under an activity that is using Windows 8.1 semantics.
00284             auto a2 = a1->StartActivity("Activity2");
00285
00286             // Nested task occurs here.
00287
00288             // The Windows 10 LoggingActivity allows you to customize the Stop event.
00289             a2->StopActivity("Activity 2 stop");
00290         }
00291
00292         // Because a1 is using Windows 8.1 semantics, it will write a Stop event when
00293         // it goes out of scope.
00294     }
00295
00296     {
00297         // The Windows 10 StartActivity method creates a new activity, optionally with
00298         // specified fields and characteristics.
00299         // This activity is created with Windows 10 semantics.
00300         auto a3 = channel->StartActivity("Activity3");
00301
00302         // Because a3 is using Windows 10 semantics, if we did not call StopActivity(),
00303         // there would be no Stop event (not even when the activity is garbage
00304         // collected). To get a Stop event, be sure to stop, close, or dispose the
00305         // activity.
00306         a3->StopActivity("ActivityClosed");
00307     }
00308 }
00309
00310 String^ LoggingChannelScenario::CollectExpensiveData()
00311 {
00312     return "ExpensiveData";
00313 }
00314
00315 void LoggingChannelScenario::DoSomething(ILoggingTarget^ logger)
00316 {
00317     logger->LogEvent("Did something");
00318 }
00319
00320 void LoggingChannelScenario::OnLoggingEnabled(ILoggingChannel^ sender, Object^ args)
00321 {
00322     // Here, you could note a change in the level or keywords.
00323 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/pch.cpp Source File

  • XmlLite
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/PlaybackPage.xaml.cpp Source File

  • 360VideoPlayback
  • cpp

PlaybackPage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // PlaybackPage.xaml.cpp
00003 // Implementation of the PlaybackPage class
00004 //
00005
00006 #include "pch.h"
00007 #include "PlaybackPage.xaml.h"
00008 #include "VideoGallery.xaml.h"
00009
00010 using namespace _360VideoPlayback;
00011 using namespace DirectX;
00012 using namespace Platform;
00013 using namespace Windows::Foundation;
00014 using namespace Windows::Foundation::Numerics;
00015 using namespace Windows::Gaming::Input;
00016 using namespace Windows::Media::Core;
00017 using namespace Windows::Media::Playback;
00018 using namespace Windows::System;
00019 using namespace Windows::System::Threading;
00020 using namespace Windows::UI::Core;
00021 using namespace Windows::UI::Popups;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 const double THUMBSTICK_DEADZONE = 0.25f;
00029 const int scrollStep = 2;
00030 const int mouseWheelData = 120;
00031
00032 // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 quaternion CreateFromHeadingPitchRoll(double flHeading, double flPitch, double flRoll)
00035 {
00036     // Here we are creating the quaternion assuming Tait–Bryan angles and applying the
00037     // angles in order of yaw, pitch, roll.
00038     // https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
00039     quaternion result;
00040
00041     const float headingPart = (XMConvertToRadians((float)flHeading) * 0.5f);    // clockwise
00042     const float sin1 = sin(headingPart);
00043     const float cos1 = cos(headingPart);
00044
00045     const float pitchPart = (XMConvertToRadians(-(float)flPitch) * 0.5f);       // counterclockwise
00046     const float sin2 = sin(pitchPart);
00047     const float cos2 = cos(pitchPart);
00048
00049     const float rollPart = (XMConvertToRadians((float)flRoll) * 0.5f);          // clockwise
00050     const float sin3 = sin(rollPart);
00051     const float cos3 = cos(rollPart);
00052
00053     result.w = cos1 * cos2 * cos3 - sin1 * sin2 * sin3;
00054     result.x = cos1 * cos2 * sin3 + sin1 * sin2 * cos3;
00055     result.y = sin1 * cos2 * cos3 + cos1 * sin2 * sin3;
00056     result.z = cos1 * sin2 * cos3 - sin1 * cos2 * sin3;
00057
00058     return result;
00059 }
00060
00061 PlaybackPage::PlaybackPage()
00062 {
00063     m_centerX = 0;
00064     m_centerY = 0;
00065     m_pitch = 0;
00066     m_heading = 0;
00067     m_rotationdelta = 1.8f;
00068     InitializeComponent();
00069     OnLayoutUpdatedToken =
00070         this->LayoutUpdated += ref new EventHandler<Object^>(this, &PlaybackPage::OnLayoutUpdated);
00071 }
00072
00073 void PlaybackPage::OnLayoutUpdated(Object^ sender, Object^ args)
00074 {
00075     m_centerX = this->VideoElement->ActualWidth / 2;
00076     m_centerY = this->VideoElement->ActualHeight / 2;
00077     if (this->m_mtcGrid == nullptr)
00078     {
00079         FrameworkElement^ transportControlsTemplateRoot = (FrameworkElement^)(VisualTreeHelper::GetChild(this->VideoElement->TransportControls, 0));
00080         if (transportControlsTemplateRoot != nullptr)
00081         {
00082             this->m_mtcGrid = (Grid^)transportControlsTemplateRoot->FindName("ControlPanelGrid");
00083             OnMTCPointerPressedToken =
00084                 this->m_mtcGrid->PointerPressed += ref new PointerEventHandler(this, &PlaybackPage::OnPointerPressed);
00085             OnMTCPointerReleasedToken =
00086                 this->m_mtcGrid->PointerReleased += ref new PointerEventHandler(this, &PlaybackPage::OnPointerReleased);
00087             OnMTCPointerWheelChangedToken =
00088                 this->m_mtcGrid->PointerWheelChanged += ref new PointerEventHandler(this, &PlaybackPage::OnPointerWheelChanged);
00089             OnPointerPressedToken =
00090                 this->VideoElement->PointerPressed += ref new PointerEventHandler(this, &PlaybackPage::OnPointerPressed);
00091             OnPointerReleasedToken =
00092                 this->VideoElement->PointerReleased += ref new PointerEventHandler(this, &PlaybackPage::OnPointerReleased);
00093             OnPointerMovedToken =
00094                 this->VideoElement->PointerMoved += ref new PointerEventHandler(this, &PlaybackPage::OnPointerMoved);
00095             OnPointerWheelChangedToken =
00096                 this->VideoElement->PointerWheelChanged += ref new PointerEventHandler(this, &PlaybackPage::OnPointerWheelChanged);
00097             OnKeyDownToken =
00098                 Window::Current->CoreWindow->KeyDown += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &PlaybackPage::OnKeyDown);
00099         }
00100     }
00101 }
00102
00103 void PlaybackPage::OnPointerPressed(Object^ sender, PointerRoutedEventArgs^ e)
00104 {
00105     if (e->OriginalSource != m_mtcGrid && IsMediaAlreadyOpened())
00106     {
00107         m_isPointerPress = true;
00108     }
00109     e->Handled = true;
00110 }
00111
00112
00113 void PlaybackPage::OnPointerReleased(Object^ sender, PointerRoutedEventArgs^ e)
00114 {
00115     ResetState();
00116     e->Handled = true;
00117 }
00118
00119
00120 void PlaybackPage::OnPointerWheelChanged(Object^ sender, PointerRoutedEventArgs^ e)
00121 {
00122     if (e->OriginalSource != m_mtcGrid)
00123     {
00124         double value = videoProjection->HorizontalFieldOfViewInDegrees +
00125             (scrollStep * e->GetCurrentPoint(VideoElement)->Properties->MouseWheelDelta / mouseWheelData);
00126         if (value > 0 && value <= 180)
00127         {
00128             videoProjection->HorizontalFieldOfViewInDegrees = value;
00129         }
00130     }
00131     e->Handled = true;
00132 }
00133
00134
00135 void PlaybackPage::OnPointerMoved(Object^ sender, PointerRoutedEventArgs^ e)
00136 {
00137     if (e->OriginalSource != m_mtcGrid && m_isPointerPress)
00138     {
00139         double ChangeX = e->GetCurrentPoint(this->VideoElement)->Position.X - m_centerX;
00140         double ChangeY = m_centerY - (e->GetCurrentPoint(VideoElement)->Position.Y);
00141         this->videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(ChangeX, ChangeY, 0);
00142     }
00143     e->Handled = true;
00144 }
00145
00146
00147 void PlaybackPage::OnKeyDown(CoreWindow^ sender, KeyEventArgs^ args)
00148 {
00149     if (IsMediaAlreadyOpened())
00150     {
00151         bool isMTCEnabled = this->VideoElement->AreTransportControlsEnabled;
00152
00153         if (args->VirtualKey == VirtualKey::Up)
00154         {
00155             m_pitch = m_pitch + 0.5;
00156             videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(m_heading, m_pitch, 0);
00157         }
00158         if (args->VirtualKey == VirtualKey::Down)
00159         {
00160             m_pitch = m_pitch - 0.5;
00161             videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(m_heading, m_pitch, 0);
00162         }
00163         if (args->VirtualKey == VirtualKey::Right)
00164         {
00165             m_heading = m_heading + 0.5;
00166             videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(m_heading, m_pitch, 0);
00167         }
00168         if (args->VirtualKey == VirtualKey::Left)
00169         {
00170             m_heading = m_heading - 0.5;
00171             videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(m_heading, m_pitch, 0);
00172         }
00173         if (args->VirtualKey == VirtualKey::GamepadA)
00174         {
00175             if (!isMTCEnabled)
00176             {
00177                 this->VideoElement->AreTransportControlsEnabled = true;
00178                 m_inputLoopWorker->Cancel();
00179                 args->Handled = true;
00180             }
00181
00182         }
00183         if (args->VirtualKey == VirtualKey::GamepadB)
00184         {
00185             if (isMTCEnabled)
00186             {
00187                 this->VideoElement->AreTransportControlsEnabled = false;
00188                 StartInputLoop();
00189                 args->Handled = true;
00190             }
00191         }
00192         if (args->VirtualKey == VirtualKey::GamepadLeftTrigger)
00193         {
00194             double value = videoProjection->HorizontalFieldOfViewInDegrees + 2;
00195
00196             if (value <= 180)
00197             {
00198                 videoProjection->HorizontalFieldOfViewInDegrees = value;
00199             }
00200             args->Handled = true;
00201         }
00202         if (args->VirtualKey == VirtualKey::GamepadRightTrigger)
00203         {
00204             double value = videoProjection->HorizontalFieldOfViewInDegrees - 2;
00205
00206             if (value > 0)
00207             {
00208                 videoProjection->HorizontalFieldOfViewInDegrees = value;
00209             }
00210             args->Handled = true;
00211         }
00212     }
00213 }
00214
00215 void PlaybackPage::OnNavigatedTo(NavigationEventArgs^ e)
00216 {
00217     SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Visible;
00218
00219     Uri^ sourceUri = safe_cast<Uri^>(e->Parameter);
00220     if (sourceUri != nullptr)
00221     {
00222         this->m_player = ref new MediaPlayer();
00223         MediaSource^ source = MediaSource::CreateFromUri(sourceUri);
00224         m_player->Source = source;
00225         OnMediaOpenedToken =
00226             m_player->MediaOpened += ref new TypedEventHandler<MediaPlayer^, Object^>(this, &PlaybackPage::OnMediaOpened);
00227         this->VideoElement->SetMediaPlayer(m_player);
00228     }
00229 }
00230
00231
00232 bool PlaybackPage::IsMediaAlreadyOpened()
00233 {
00234     if (m_player != nullptr && videoProjection != nullptr &&
00235         m_player->PlaybackSession->PlaybackState != MediaPlaybackState::Opening &&
00236         m_player->PlaybackSession->PlaybackState != MediaPlaybackState::None)
00237     {
00238         return true;
00239     }
00240     return false;
00241 }
00242
00243
00244 void PlaybackPage::ResetState()
00245 {
00246     m_isPointerPress = false;
00247     m_pitch = 0;
00248     m_heading = 0;
00249 }
00250
00251 void PlaybackPage::OnMediaOpened(MediaPlayer^ sender, Object^ args)
00252 {
00253         videoProjection = m_player->PlaybackSession->SphericalVideoProjection;
00254         Windows::Media::MediaProperties::SphericalVideoFrameFormat videoFormat = videoProjection->FrameFormat;
00255         // Some times Content metadata doesn't provided correct format. Try to force the equirectangular format, if doesn't match
00256         if (videoFormat != Windows::Media::MediaProperties::SphericalVideoFrameFormat::Equirectangular)
00257         {
00258             videoProjection->FrameFormat = Windows::Media::MediaProperties::SphericalVideoFrameFormat::Equirectangular;
00259         }
00260         videoProjection->IsEnabled = true;
00261         videoProjection->HorizontalFieldOfViewInDegrees = 120;
00262         OnPlaybackStateChangedToken =
00263             m_player->PlaybackSession->PlaybackStateChanged += ref new TypedEventHandler<MediaPlaybackSession^, Object^>(this, &PlaybackPage::OnPlaybackStateChanged);
00264
00265     StartInputLoop();
00266 }
00267
00268
00269 void PlaybackPage::OnPlaybackStateChanged(MediaPlaybackSession^ sender, Object^ args)
00270 {
00271     if (m_player->PlaybackSession->PlaybackState == MediaPlaybackState::Playing)
00272     {
00273         m_rotationdelta = 1.8f;
00274     }
00275     else
00276     {
00277         m_rotationdelta = 0.25f;
00278     }
00279 }
00280
00281 void PlaybackPage::OnNavigatedFrom(NavigationEventArgs^ e)
00282 {
00283     if (m_player != nullptr)
00284     {
00285         if (OnPlaybackStateChangedToken.Value)
00286         {
00287             m_player->PlaybackSession->PlaybackStateChanged -= OnPlaybackStateChangedToken;
00288         }
00289         if (OnMediaOpenedToken.Value)
00290         {
00291             m_player->MediaOpened -= OnMediaOpenedToken;
00292         }
00293         m_player->Source = nullptr;
00294     }
00295
00296     if (m_mtcGrid != nullptr)
00297     {
00298         this->m_mtcGrid->PointerPressed -= OnMTCPointerPressedToken;
00299         this->m_mtcGrid->PointerReleased -= OnMTCPointerReleasedToken;
00300         this->m_mtcGrid->PointerWheelChanged -= OnMTCPointerWheelChangedToken;
00301     }
00302
00303     if (this->VideoElement != nullptr)
00304     {
00305         this->VideoElement->PointerPressed -= OnPointerPressedToken;
00306         this->VideoElement->PointerReleased -= OnPointerReleasedToken;
00307         this->VideoElement->PointerMoved -= OnPointerMovedToken;
00308         this->VideoElement->PointerWheelChanged -= OnPointerWheelChangedToken;
00309     }
00310
00311     if (Window::Current != nullptr)
00312     {
00313         Window::Current->CoreWindow->KeyDown -= OnKeyDownToken;
00314     }
00315
00316     this->LayoutUpdated -= OnLayoutUpdatedToken;
00317
00318     SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Collapsed;
00319     this->VideoElement->SetMediaPlayer(nullptr);
00320     m_player = nullptr;
00321 }
00322
00323 void  PlaybackPage::StartInputLoop()
00324 {
00325     if (this->m_inputLoopWorker != nullptr)
00326     {
00327         if (m_inputLoopWorker->Status == AsyncStatus::Started)
00328         {
00329             return;
00330         }
00331         else
00332         {
00333             m_inputLoopWorker->Close();
00334         }
00335     }
00336
00337     auto workItem = ref new WorkItemHandler(
00338         [this](IAsyncAction^ workItem)
00339     {
00340         while (workItem->Status == AsyncStatus::Started)
00341         {
00342             if (this->m_activeGamePad == nullptr)
00343             {
00344                 auto gamepads = Gamepad::Gamepads;
00345                 if (gamepads->Size > 0)
00346                 {
00347                     // Get the Zero based first Gamepad
00348                     m_activeGamePad = gamepads->GetAt(0);
00349                 }
00350             }
00351
00352             if (this->m_activeGamePad != nullptr)
00353             {
00354                 m_timer.Tick([this]()
00355                 {
00356                     // Put time-based updates here. By default this code will run once per frame,
00357                     // but if you change the StepTimer to use a fixed time step this code will
00358                     // run as many times as needed to get to the current step.
00359                     //
00360
00361                     GamepadReading reading = m_activeGamePad->GetCurrentReading();
00362                     double deltax;
00363                     if (reading.LeftThumbstickX > THUMBSTICK_DEADZONE || reading.LeftThumbstickX < -THUMBSTICK_DEADZONE)
00364                     {
00365                         deltax = reading.LeftThumbstickX * reading.LeftThumbstickX * reading.LeftThumbstickX;
00366                     }
00367                     else
00368                     {
00369                         deltax = 0.0f;
00370                     }
00371                     double deltay;
00372                     if (reading.LeftThumbstickY > THUMBSTICK_DEADZONE || reading.LeftThumbstickY < -THUMBSTICK_DEADZONE)
00373                     {
00374                         deltay = reading.LeftThumbstickY * reading.LeftThumbstickY * reading.LeftThumbstickY;
00375                     }
00376                     else
00377                     {
00378                         deltay = 0.0f;
00379                     }
00380
00381                     double rotationX = deltax * m_rotationdelta;
00382                     double rotationY = deltay * m_rotationdelta;
00383
00384                     m_pitch += rotationY;
00385                     m_heading += rotationX;
00386
00387                     // Limit pitch to straight up or straight down.
00388                     this->videoProjection->ViewOrientation = CreateFromHeadingPitchRoll(m_heading, m_pitch, 0);
00389                 });
00390             }
00391         }
00392     });
00393
00394     auto asyncAction = ThreadPool::RunAsync(workItem);
00395     m_inputLoopWorker = asyncAction;
00396 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Project.idl Source File

  • LinguisticServices
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_LanguageDetection : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_LanguageDetection();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_ScriptDetection : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_ScriptDetection();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_Transliteration : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_Transliteration();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_CharacterGrouping : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_CharacterGrouping();
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/SampleConfiguration.h Source File

  • NumberFormatting
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/SampleConfiguration.h Source File

  • SpatialSound
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #pragma once
00014 #include "pch.h"
00015
00016 namespace SDKTemplate
00017 {
00018     value struct Scenario;
00019
00020     partial ref class MainPage
00021     {
00022     internal:
00023         static property Platform::String^ FEATURE_NAME
00024         {
00025             Platform::String^ get()
00026             {
00027                 return "SpatialSound";
00028             }
00029         }
00030
00031         static property Platform::Array<Scenario>^ scenarios
00032         {
00033             Platform::Array<Scenario>^ get()
00034             {
00035                 return scenariosInner;
00036             }
00037         }
00038
00039     private:
00040         static Platform::Array<Scenario>^ scenariosInner;
00041     };
00042
00043     public value struct Scenario
00044     {
00045         Platform::String^ Title;
00046         Platform::String^ ClassName;
00047     };
00048 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • ProximitySensor
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Tasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("Tasks")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario3_Calibration.xaml.cpp Source File

  • Compass
  • cpp

Scenario3_Calibration.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Calibration.xaml.cpp
00014 // Implementation of the Scenario3_Calibration class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_Calibration.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario3_Calibration::Scenario3_Calibration() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033     calibrationBar = ref new CalibrationBar();
00034 }
00035
00036 /// <summary>
00037 /// Invoked when this page is about to be displayed in a Frame.
00038 /// </summary>
00039 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040 /// property is typically used to configure the page.</param>
00041 void Scenario3_Calibration::OnNavigatedTo(NavigationEventArgs^ e)
00042 {
00043 }
00044
00045 /// <summary>
00046 /// Invoked when this page is no longer displayed.
00047 /// </summary>
00048 /// <param name="e"></param>
00049 void Scenario3_Calibration::OnNavigatedFrom(NavigationEventArgs^ e)
00050 {
00051     // If the navigation is external to the app do not clean up.
00052     // This can occur on Phone when suspending the app.
00053     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00054     {
00055         return;
00056     }
00057
00058     calibrationBar->Hide();
00059 }
00060
00061 /// <summary>
00062 /// This is the click handler for high accuracy. Acceptable accuracy met, so
00063 /// hide the calibration bar.
00064 /// </summary>
00065 /// <param name="sender"></param>
00066 /// <param name="e"></param>
00067 void Scenario3_Calibration::OnHighAccuracy(Object^ sender, RoutedEventArgs^ e)
00068 {
00069     calibrationBar->Hide();
00070 }
00071
00072 /// <summary>
00073 /// This is the click handler for approximate accuracy. Acceptable accuracy met, so
00074 /// hide the calibration bar.
00075 /// </summary>
00076 /// <param name="sender"></param>
00077 /// <param name="e"></param>
00078 void Scenario3_Calibration::OnApproximateAccuracy(Object^ sender, RoutedEventArgs^ e)
00079 {
00080     calibrationBar->Hide();
00081 }
00082
00083 /// <summary>
00084 /// This is the click handler for unreliable accuracy. Sensor does not meet accuracy
00085 /// requirements. Request to show the calibration bar per the calibration guidance.
00086 /// </summary>
00087 /// <param name="sender"></param>
00088 /// <param name="e"></param>
00089 void Scenario3_Calibration::OnUnreliableAccuracy(Object^ sender, RoutedEventArgs^ e)
00090 {
00091     calibrationBar->RequestCalibration(MagnetometerAccuracy::Unreliable);
00092 }
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SingleFile Member List

This is the complete list of members for Scenario1_SingleFile, including all inherited members.
PickAFileButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_SingleFile
Scenario1_SingleFile() | Scenario1_SingleFile
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.h Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario1_OvenClient.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario1_OvenClient.g.h"
00009
00010 namespace SDKSample
00011 {
00012     namespace ProxyStubsForWinRTComponents
00013     {
00014         public ref class OvenClient sealed
00015         {
00016         public:
00017             OvenClient();
00018
00019         private:
00020             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021             void BreadCompletedHandler1(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::Bread^ bread);
00022             void BreadCompletedHandler2(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::Bread^ bread);
00023             void BreadCompletedHandler3(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::Bread^ bread);
00024         };
00025     }
00026 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceProperties Member List

This is the complete list of members for DeviceProperties, including all inherited members.
DeviceInstanceId DeviceProperties
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario2_DisplayText.xaml.cpp Source File

  • LineDisplay
  • cpp

Scenario2_DisplayText.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_DisplayText.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Devices::PointOfService;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario2_DisplayText::Scenario2_DisplayText()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void Scenario2_DisplayText::OnNavigatedTo(NavigationEventArgs^ e)
00032 {
00033     InitializeAsync();
00034 }
00035
00036 void Scenario2_DisplayText::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00037 {
00038     delete lineDisplay;
00039     lineDisplay = nullptr;
00040 }
00041
00042 task<void> Scenario2_DisplayText::InitializeAsync()
00043 {
00044     lineDisplay = co_await rootPage->ClaimScenarioLineDisplayAsync();
00045     BlinkCheckBox->IsEnabled = (lineDisplay != nullptr) && (lineDisplay->Capabilities->CanBlink != LineDisplayTextAttributeGranularity::NotSupported);
00046     DisplayTextButton->IsEnabled = (lineDisplay != nullptr);
00047 }
00048
00049 void Scenario2_DisplayText::DisplayTextButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00050 {
00051     invoke_async_lambda([=]() -> task<void>
00052     {
00053         String^ text = "Hello from UWP";
00054
00055         Point position = {};
00056         if (CenterCheckBox->IsChecked->Value)
00057         {
00058             uint32 length = text->Length();
00059             if (length < lineDisplay->DefaultWindow->SizeInCharacters.Width)
00060             {
00061                 position.X = (lineDisplay->DefaultWindow->SizeInCharacters.Width - length) / 2;
00062             }
00063         }
00064
00065         LineDisplayTextAttribute attribute = LineDisplayTextAttribute::Normal;
00066
00067         if (BlinkCheckBox->IsChecked->Value)
00068         {
00069             attribute = LineDisplayTextAttribute::Blink;
00070         }
00071
00072         if (co_await lineDisplay->DefaultWindow->TryClearTextAsync() &&
00073             co_await lineDisplay->DefaultWindow->TryDisplayTextAsync(text, attribute, position))
00074         {
00075             rootPage->NotifyUser("Text displayed sucessfully", NotifyType::StatusMessage);
00076         }
00077         else
00078         {
00079             // We probably lost our claim.
00080             rootPage->NotifyUser("Unable to display text", NotifyType::ErrorMessage);
00081         }
00082     });
00083 }
Generated on Fri Nov 15 2024 22:20:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Name/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Name

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.Branding.Name
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
00017             string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";
00018
00019             updateFourTilesControl.SetTilePayload($@"
00020                 <tile version='3'>
00021                     <visual>
00022
00023                         <binding template='TileSmall' branding='name'>
00024                             <text>name</text>
00025                             {fillerText}
00026                         </binding>
00027
00028                         <binding template='TileMedium' branding='name'>
00029                             <text hint-wrap='true'>branding: name</text>
00030                             {fillerText}
00031                         </binding>
00032
00033                         <binding template='TileWide' branding='name'>
00034                             <text hint-wrap='true'>branding: name</text>
00035                             {fillerText}
00036                         </binding>
00037
00038                         <binding template='TileLarge' branding='name'>
00039                             <text hint-wrap='true'>branding: name</text>
00040                             {fillerText}
00041                         </binding>
00042
00043                     </visual>
00044                 </tile>");
00045         }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Cylinder.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Cylinder.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Cylinder:
00015 // This class is a specialization of GameObject that represents a cylinder primitive.
00016 // The cylinder is defined by a vector starting at 'position' and oriented along the
00017 // 'direction' vector. The length of the cylinder is just the length of the 'direction'
00018 // vector.
00019
00020 #include "GameObject.h"
00021
00022 class Cylinder : public GameObject
00023 {
00024 public:
00025     Cylinder();
00026     Cylinder(
00027         DirectX::XMFLOAT3 position,
00028         float radius,
00029         DirectX::XMFLOAT3 direction
00030         );
00031
00032     virtual bool IsTouching(
00033         DirectX::XMFLOAT3 point,
00034         float radius,
00035         _Out_ DirectX::XMFLOAT3* contact,
00036         _Out_ DirectX::XMFLOAT3* normal
00037         ) override;
00038
00039 protected:
00040     virtual void UpdatePosition() override;
00041
00042 private:
00043     void Initialize(
00044         DirectX::XMFLOAT3 position,
00045         float radius,
00046         DirectX::XMFLOAT3 direction
00047         );
00048
00049     DirectX::XMFLOAT3   m_axis;
00050     float               m_length;
00051     float               m_radius;
00052     DirectX::XMFLOAT4X4 m_rotationMatrix;
00053 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InvalidPageException Member List

This is the complete list of members for InvalidPageException, including all inherited members.
InvalidPageException(string message) InvalidPageException [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_TrackPosition Member List

This is the complete list of members for Scenario1_TrackPosition, including all inherited members.
_geolocator | Scenario1_TrackPosition | [private]
_rootPage | Scenario1_TrackPosition | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_TrackPosition | [inline, protected]
OnPositionChanged(Geolocator sender, PositionChangedEventArgs e) | Scenario1_TrackPosition | [inline, private]
OnStatusChanged(Geolocator sender, StatusChangedEventArgs e) | Scenario1_TrackPosition | [inline, private]
Scenario1_TrackPosition() | Scenario1_TrackPosition | [inline]
StartTracking(object sender, RoutedEventArgs e) | Scenario1_TrackPosition | [inline, private]
StopTracking(object sender, RoutedEventArgs e) | Scenario1_TrackPosition | [inline, private]
UpdateLocationData(Geoposition position) | Scenario1_TrackPosition | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Advertiser Member List

This is the complete list of members for Scenario1_Advertiser, including all inherited members.
btnAddIe_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Advertiser |
btnCloseDevice_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Advertiser |
btnSendMessage_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Advertiser |
btnStartAdvertisement_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Advertiser |
btnStopAdvertisement_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Advertiser |
ConnectedDevices() | Scenario1_Advertiser | [inline]
HandleConnectionRequestAsync(Windows::Devices::WiFiDirect::WiFiDirectConnectionRequest connectionRequest) | Scenario1_Advertiser | [private]
informationElements | Scenario1_Advertiser | [private]
IsAepPairedAsync(hstring deviceId) | Scenario1_Advertiser | [private]
OnConnectionRequested(Windows::Devices::WiFiDirect::WiFiDirectConnectionListener const &, Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs const &e) | Scenario1_Advertiser | [private]
OnConnectionStatusChanged(Windows::Devices::WiFiDirect::WiFiDirectDevice const &sender, Windows::Foundation::IInspectable const &) | Scenario1_Advertiser | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario1_Advertiser |
OnSocketConnectionReceived(Windows::Networking::Sockets::StreamSocketListener sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs e) | Scenario1_Advertiser | [private]
OnStatusChanged(Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher sender, Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs e) | Scenario1_Advertiser | [private]
pendingConnections | Scenario1_Advertiser | [private]
pendingConnectionsMutex | Scenario1_Advertiser | [private]
Scenario1_Advertiser() | Scenario1_Advertiser |
StopAdvertisement() | Scenario1_Advertiser | [private]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/pch.cpp Source File

  • BasicHologram
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GeneratedBitmapState Member List

This is the complete list of members for GeneratedBitmapState, including all inherited members.
bitmapHeight | GeneratedBitmapState
bitmapWidth | GeneratedBitmapState
canvasDevice | GeneratedBitmapState
frameNumber | GeneratedBitmapState
offscreenCanvas | GeneratedBitmapState
offscreenDrawingSession | GeneratedBitmapState
squareBitmap | GeneratedBitmapState
squareBuffer | GeneratedBitmapState
squareLength | GeneratedBitmapState
squareY | GeneratedBitmapState
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S1_AddWithAPI.xaml.cpp Source File

  • ContentIndexer
  • cpp

S1_AddWithAPI.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S1_AddWithAPI.xaml.cpp
00014 // Implementation of the S1_AddWithAPI class
00015 //
00016
00017 #include "pch.h"
00018 #include "S1_AddWithAPI.xaml.h"
00019 #include "MainPage.xaml.h"
00020 #include "Helpers.h"
00021
00022 using namespace SDKTemplate;
00023
00024 using namespace concurrency;
00025 using namespace Platform;
00026 using namespace Platform::Collections;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::Foundation;
00030 using namespace Windows::Foundation::Collections;
00031
00032 S1_AddWithAPI::S1_AddWithAPI()
00033 {
00034     InitializeComponent();
00035     InitializeRevisionNumber();
00036 }
00037
00038 void S1_AddWithAPI::AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00039 {
00040     if (ItemKeyInput->Text == L"")
00041     {
00042         MainPage::Current->NotifyUser(L"You must add an item key to insert an item into the index.", NotifyType::ErrorMessage);
00043     }
00044     else
00045     {
00046         // Retrieve an instance of the ContentIndexer
00047         auto indexer = Windows::Storage::Search::ContentIndexer::GetIndexer();
00048
00049         // Create the property map
00050         struct PropertySetting
00051         {
00052             String^ strProperty;
00053             TextBox^ inputTextBox;
00054         } propertySettings [] =
00055         {
00056             { Windows::Storage::SystemProperties::ItemNameDisplay, NameInput },
00057             { Windows::Storage::SystemProperties::Keywords, KeywordsInput },
00058             { Windows::Storage::SystemProperties::Comment, CommentInput }
00059         };
00060         auto propertyKeys = ref new Vector<String^>();
00061         auto content = ref new Windows::Storage::Search::IndexableContent();
00062         content->Id = ItemKeyInput->Text;
00063         for (const auto& prop : propertySettings)
00064         {
00065             propertyKeys->Append(prop.strProperty);
00066             Object^ propertyValue = prop.inputTextBox->Text;
00067             if (LanguageInput->Text != L"")
00068             {
00069                 auto propertyValueAndLanguage = ref new Windows::Storage::Search::ValueAndLanguage();
00070                 propertyValueAndLanguage->Language = LanguageInput->Text;
00071                 propertyValueAndLanguage->Value = propertyValue;
00072                 propertyValue = propertyValueAndLanguage;
00073             }
00074             content->Properties->Insert(prop.strProperty, propertyValue);
00075         }
00076
00077         // Create the content stream
00078         auto contentStream = ref new Windows::Storage::Streams::InMemoryRandomAccessStream();
00079         auto contentWriter = ref new Windows::Storage::Streams::DataWriter(contentStream);
00080         contentWriter->WriteString(ContentInput->Text);
00081
00082         create_task(contentWriter->StoreAsync()).then([indexer, contentStream, contentWriter, content] (unsigned int bytesStored)
00083         {
00084             contentWriter->DetachStream();
00085             // Write the content stream and properties to the indexer
00086             contentStream->Seek(0);
00087             content->Stream = contentStream;
00088             content->StreamContentType = L"text/plain";
00089             OnIndexerOperationBegin();
00090             return indexer->AddAsync(content);
00091         }).then([indexer, this, propertyKeys]()
00092         {
00093             OnIndexerOperationComplete(indexer);
00094             // Retrieve the properties from the indexer
00095             return indexer->RetrievePropertiesAsync(ItemKeyInput->Text, propertyKeys);
00096         }).then([propertyKeys, this](IMapView<String^, Object^>^ retrievedProperties)
00097         {
00098             MainPage::Current->NotifyUser(CreateItemString(ItemKeyInput->Text, propertyKeys, retrievedProperties), NotifyType::StatusMessage);
00099         });
00100     }
00101 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

KeepConnectionOpenScenario Member List

This is the complete list of members for KeepConnectionOpenScenario, including all inherited members.
CloseConnection_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | KeepConnectionOpenScenario | [inline, private]
connection | KeepConnectionOpenScenario | [private]
Connection_ServiceClosed(AppServiceConnection sender, AppServiceClosedEventArgs args) | KeepConnectionOpenScenario | [inline, private]
GenerateRandomNumber_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | KeepConnectionOpenScenario | [inline, private]
KeepConnectionOpenScenario() | KeepConnectionOpenScenario | [inline]
OnNavigatedFrom(NavigationEventArgs e) | KeepConnectionOpenScenario | [inline, protected]
OpenConnection_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | KeepConnectionOpenScenario | [inline, private]
rootPage | KeepConnectionOpenScenario | [private]
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Email Member List

This is the complete list of members for Email, including all inherited members.
Body | Email
From | Email
ReceivedDate | Email
Subject | Email
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario6_CustomTrigger.xaml.h Source File

  • CustomCapability
  • cpp

Scenario6_CustomTrigger.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6_CustomTrigger.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class CustomTrigger sealed
00020     {
00021     public:
00022         CustomTrigger();
00023
00024     private:
00025         MainPage^ rootPage = MainPage::Current;
00026         Windows::ApplicationModel::Background::BackgroundTaskRegistration^ taskRegistration;
00027
00028         bool IsFx2CustomTriggerTaskRegistered();
00029         void UpdateUI();
00030         void UnregisterTask();
00031
00032         void RegisterCustomTrigger_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void UnregisterCustomTrigger_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034
00035     protected:
00036         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cs/Scenario1_Basic.xaml.cs Source File

  • UserInteractionMode
  • cs

Scenario1_Basic.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.ComponentModel;
00013 using Windows.UI.Core;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario1_Basic : Page, INotifyPropertyChanged
00022     {
00023         private MainPage rootPage;
00024
00025         public Scenario1_Basic()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             rootPage = MainPage.Current;
00033
00034             // The SizeChanged event is raised when the user interaction mode changes.
00035             Window.Current.SizeChanged += OnWindowResize;
00036             UpdateContent();
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             Window.Current.SizeChanged -= OnWindowResize;
00042         }
00043
00044         void OnWindowResize(object sender, WindowSizeChangedEventArgs e)
00045         {
00046             UpdateContent();
00047         }
00048
00049         public event PropertyChangedEventHandler PropertyChanged;
00050
00051         #region InteractionMode data binding
00052         private UserInteractionMode interactionMode;
00053
00054         public UserInteractionMode InteractionMode
00055         {
00056             get { return interactionMode; }
00057             set
00058             {
00059                 if (interactionMode != value)
00060                 {
00061                     interactionMode = value;
00062                     if (PropertyChanged != null)
00063                     {
00064                         PropertyChanged(this, new PropertyChangedEventArgs("InteractionMode"));
00065                     }
00066                 }
00067             }
00068         }
00069         #endregion
00070
00071         #region CheckBoxStyle data binding
00072         private Style checkBoxStyle;
00073
00074         public Style CheckBoxStyle
00075         {
00076             get { return checkBoxStyle; }
00077             set
00078             {
00079                 if (checkBoxStyle != value)
00080                 {
00081                     checkBoxStyle = value;
00082                     if (PropertyChanged != null)
00083                     {
00084                         PropertyChanged(this, new PropertyChangedEventArgs("CheckBoxStyle"));
00085                     }
00086                 }
00087             }
00088         }
00089         #endregion
00090
00091         void UpdateContent()
00092         {
00093             InteractionMode = UIViewSettings.GetForCurrentView().UserInteractionMode;
00094
00095             // Update styles
00096             CheckBoxStyle = InteractionMode == UserInteractionMode.Mouse ? MouseCheckBoxStyle : TouchCheckBoxStyle;
00097         }
00098     }
00099 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoggingChannelScenario Member List

This is the complete list of members for LoggingChannelScenario, including all inherited members.
CollectExpensiveData() | LoggingChannelScenario | [inline, private]
DemonstrateLogging(LoggingChannel channel) | LoggingChannelScenario | [inline, private]
DoSomething(ILoggingTarget logger) | LoggingChannelScenario | [inline, private]
LogWithWin10Constructor() | LoggingChannelScenario | [inline]
LogWithWin81Constructor() | LoggingChannelScenario | [inline]
OnLoggingEnabled(ILoggingChannel sender, object args) | LoggingChannelScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_FindId Member List

This is the complete list of members for Scenario1_FindId, including all inherited members.
Default_Click(object sender, RoutedEventArgs e) | Scenario1_FindId | [inline, private]
FindIdsInString(String inputString) | Scenario1_FindId | [inline, private]
Scenario1_FindId() | Scenario1_FindId | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario4_Submix.xaml.cs Source File

  • AudioCreation
  • cs
  • AudioCreation

Scenario4_Submix.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.Media.Audio;
00016 using Windows.Media.Render;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.UI;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Media;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00026
00027 namespace AudioCreation
00028 {
00029     /// <summary>
00030     /// Shows use of a SubMix node with an effect applied to it.
00031     /// </summary>
00032     public sealed partial class Scenario4_Submix : Page
00033     {
00034         private MainPage rootPage;
00035         private AudioGraph graph;
00036         private AudioFileInputNode fileInputNode1, fileInputNode2;
00037         private AudioSubmixNode submixNode;
00038         private AudioDeviceOutputNode deviceOutputNode;
00039         private EchoEffectDefinition echoEffect;
00040
00041         public Scenario4_Submix()
00042         {
00043             this.InitializeComponent();
00044         }
00045
00046         protected override async void OnNavigatedTo(NavigationEventArgs e)
00047         {
00048             rootPage = MainPage.Current;
00049             await CreateAudioGraph();
00050         }
00051
00052         protected override void OnNavigatedFrom(NavigationEventArgs e)
00053         {
00054             if (graph != null)
00055             {
00056                 graph.Dispose();
00057             }
00058         }
00059
00060         private async void File1_Click(object sender, RoutedEventArgs e)
00061         {
00062             // If another file is already loaded into the FileInput node
00063             if (fileInputNode1 != null)
00064             {
00065                 // Release the file and dispose the contents of the node
00066                 fileInputNode1.Dispose();
00067                 // Stop playback since a new file is being loaded. Also reset the button UI
00068                 if (graphButton.Content.Equals("Stop Graph"))
00069                 {
00070                     TogglePlay();
00071                 }
00072             }
00073
00074             FileOpenPicker filePicker = new FileOpenPicker();
00075             filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
00076             filePicker.FileTypeFilter.Add(".mp3");
00077             filePicker.FileTypeFilter.Add(".wma");
00078             filePicker.FileTypeFilter.Add(".wav");
00079             filePicker.ViewMode = PickerViewMode.Thumbnail;
00080             StorageFile file1 = await filePicker.PickSingleFileAsync();
00081
00082             // File can be null if cancel is hit in the file picker
00083             if (file1 == null)
00084             {
00085                 return;
00086             }
00087
00088             CreateAudioFileInputNodeResult fileInputNodeResult = await graph.CreateFileInputNodeAsync(file1);
00089             if (fileInputNodeResult.Status != AudioFileNodeCreationStatus.Success)
00090             {
00091                 // Cannot read input file
00092                 rootPage.NotifyUser(String.Format("Can't read input file1 because {0}", fileInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00093                 return;
00094             }
00095
00096             fileInputNode1 = fileInputNodeResult.FileInputNode;
00097             // Since we are going to play two files simultaneously, set outgoing gain to 0.5 to prevent clipping
00098             fileInputNode1.AddOutgoingConnection(submixNode, 0.5);
00099
00100             // The graph might already be playing, so set up UI accordingly
00101             if (graphButton.Content.Equals("Stop Graph"))
00102             {
00103                 audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
00104             }
00105
00106             // UI tasks: enable buttons, show status message and change color of the input node box
00107             graphButton.IsEnabled = true;
00108             echoEffectToggle.IsEnabled = true;
00109             rootPage.NotifyUser("Loaded File 1", NotifyType.StatusMessage);
00110             fileButton1.Background = new SolidColorBrush(Colors.Green);
00111         }
00112
00113         private async void File2_Click(object sender, RoutedEventArgs e)
00114         {
00115             // If another file is already loaded into the FileInput node
00116             if (fileInputNode2 != null)
00117             {
00118                 // Release the file and dispose the contents of the node
00119                 fileInputNode2.Dispose();
00120                 // Stop playback since a new file is being loaded. Also reset the button UI
00121                 if (graphButton.Content.Equals("Stop Graph"))
00122                 {
00123                     TogglePlay();
00124                 }
00125             }
00126
00127             FileOpenPicker filePicker = new FileOpenPicker();
00128             filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
00129             filePicker.FileTypeFilter.Add(".mp3");
00130             filePicker.ViewMode = PickerViewMode.Thumbnail;
00131             StorageFile file2 = await filePicker.PickSingleFileAsync();
00132
00133             // File can be null if cancel is hit in the file picker
00134             if (file2 == null)
00135             {
00136                 return;
00137             }
00138
00139             CreateAudioFileInputNodeResult fileInputNodeResult = await graph.CreateFileInputNodeAsync(file2);
00140             if (fileInputNodeResult.Status != AudioFileNodeCreationStatus.Success)
00141             {
00142                 // Cannot read input file
00143                 rootPage.NotifyUser(String.Format("Can't read input file2 because {0}", fileInputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00144                 return;
00145             }
00146
00147             fileInputNode2 = fileInputNodeResult.FileInputNode;
00148             // Since we are going to play two files simultaneously, set outgoing gain to 0.5 to prevent clipping
00149             fileInputNode2.AddOutgoingConnection(submixNode, 0.5);
00150
00151             // The graph might already be playing, so set up UI accordingly
00152             if (graphButton.Content.Equals("Stop Graph"))
00153             {
00154                 audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
00155             }
00156
00157             // UI tasks: enable buttons, show status message and change color of the input node box
00158             graphButton.IsEnabled = true;
00159             echoEffectToggle.IsEnabled = true;
00160             rootPage.NotifyUser("Loaded File 2", NotifyType.StatusMessage);
00161             fileButton2.Background = new SolidColorBrush(Colors.Green);
00162         }
00163
00164         private void GraphButton_Click(object sender, RoutedEventArgs e)
00165         {
00166             TogglePlay();
00167         }
00168
00169         private void TogglePlay()
00170         {
00171             if (graphButton.Content.Equals("Start Graph"))
00172             {
00173                 graph.Start();
00174                 graphButton.Content = "Stop Graph";
00175                 audioPipe3.Fill = new SolidColorBrush(Colors.Blue);
00176                 if (fileInputNode1 != null)
00177                 {
00178                     audioPipe1.Fill = new SolidColorBrush(Colors.Blue);
00179                 }
00180                 if (fileInputNode2 != null)
00181                 {
00182                     audioPipe2.Fill = new SolidColorBrush(Colors.Blue);
00183                 }
00184             }
00185             else if (graphButton.Content.Equals("Stop Graph"))
00186             {
00187                 graph.Stop();
00188                 graphButton.Content = "Start Graph";
00189                 audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00190                 audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00191                 audioPipe3.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00192             }
00193         }
00194
00195         private void EchoEffectToggle_Toggled(object sender, RoutedEventArgs e)
00196         {
00197             // Enable/Disable the echo effect
00198             // Also set the label for the UI
00199             if (echoEffectToggle.IsOn)
00200             {
00201                 submixNode.EnableEffectsByDefinition(echoEffect);
00202             }
00203             else
00204             {
00205                 submixNode.DisableEffectsByDefinition(echoEffect);
00206             }
00207         }
00208
00209         private async Task CreateAudioGraph()
00210         {
00211             // Create an AudioGraph with default setting
00212             AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
00213             CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);
00214
00215             if (result.Status != AudioGraphCreationStatus.Success)
00216             {
00217                 // Can't create the graph
00218                 rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
00219                 return;
00220             }
00221
00222             graph = result.Graph;
00223
00224             // Create a device output node
00225             CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();
00226
00227             if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
00228             {
00229                 // Cannot create device output node
00230                 rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00231                 speakerContainer.Background = new SolidColorBrush(Colors.Red);
00232                 return;
00233             }
00234
00235             deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
00236             rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
00237             speakerContainer.Background = new SolidColorBrush(Colors.Green);
00238
00239             submixNode = graph.CreateSubmixNode();
00240             submixNodeContainer.Background = new SolidColorBrush(Colors.Green);
00241             submixNode.AddOutgoingConnection(deviceOutputNode);
00242
00243             echoEffect = new EchoEffectDefinition(graph);
00244             echoEffect.WetDryMix = 0.7f;
00245             echoEffect.Feedback = 0.5f;
00246             echoEffect.Delay = 500.0f;
00247             submixNode.EffectDefinitions.Add(echoEffect);
00248
00249             // Disable the effect in the beginning. Enable in response to user action (UI toggle switch)
00250             submixNode.DisableEffectsByDefinition(echoEffect);
00251
00252             // All nodes can have an OutgoingGain property
00253             // Setting the gain on the Submix node attenuates the output of the node
00254             submixNode.OutgoingGain = 0.5;
00255
00256             // Graph successfully created. Enable buttons to load files
00257             fileButton1.IsEnabled = true;
00258             fileButton2.IsEnabled = true;
00259         }
00260     }
00261 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/QuadRenderer.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Content

QuadRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "QuadRenderer.h"
00014
00015 #include "Common\DirectXHelper.h"
00016
00017 #include "Shaders\QuadVertexShader.h"
00018 #include "Shaders\QuadPixelShader.h"
00019
00020 using namespace CameraStreamCoordinateMapper;
00021
00022 using namespace DirectX;
00023 using namespace Windows::Foundation;
00024
00025 // Loads vertex and pixel shaders from files and instantiates the cube geometry.
00026 QuadRenderer::QuadRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00027     m_deviceResources(deviceResources)
00028 {
00029     CreateDeviceDependentResources();
00030     CreateWindowSizeDependentResources();
00031 }
00032
00033 // Initializes view parameters when the window size changes.
00034 void QuadRenderer::CreateWindowSizeDependentResources()
00035 {
00036     const Size outputSize = m_deviceResources->GetOutputSize();
00037     const float aspectRatio = outputSize.Width / outputSize.Height;
00038
00039     const XMMATRIX projectionMatrix = XMMatrixOrthographicRH(2.0f, 2.0f / aspectRatio, 0.01f, 100.0f);
00040
00041     XMStoreFloat4x4(&m_constantBufferData.projection, XMMatrixTranspose(projectionMatrix));
00042
00043     const XMMATRIX viewMatrix = XMMatrixTranslation(0.0f, 0.0f, -1.0f);
00044
00045     XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(viewMatrix));
00046 }
00047
00048 // Renders one frame using the vertex and pixel shaders.
00049 void QuadRenderer::Render(ID3D11ShaderResourceView* texture, float aspectRatio)
00050 {
00051     ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();
00052
00053     XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixScaling(1.0f, 1.0f / aspectRatio, 1.0f)));
00054
00055     context->UpdateSubresource(m_constantBuffer.Get(), 0, nullptr, &m_constantBufferData, 0, 0);
00056
00057     const UINT stride = sizeof(VertexPositionTex);
00058     const UINT offset = 0;
00059     context->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
00060     context->IASetIndexBuffer(m_indexBuffer.Get(), DXGI_FORMAT_R16_UINT, 0);
00061     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00062     context->IASetInputLayout(m_inputLayout.Get());
00063
00064     context->VSSetShader(m_vertexShader.Get(), nullptr, 0);
00065
00066     context->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf());
00067
00068     context->PSSetShader(m_pixelShader.Get(), nullptr, 0);
00069     context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());
00070
00071     const Size outputSize = m_deviceResources->GetOutputSize();
00072
00073     const D3D11_VIEWPORT viewport = CD3D11_VIEWPORT(
00074         0.0f,
00075         0.0f,
00076         outputSize.Width,
00077         outputSize.Height
00078     );
00079
00080     context->RSSetViewports(1, &viewport);
00081
00082     ID3D11ShaderResourceView* textures[] = {
00083         texture
00084     };
00085
00086     context->PSSetShaderResources(0, _countof(textures), textures);
00087
00088     context->DrawIndexed(m_indexCount, 0, 0);
00089
00090     ID3D11ShaderResourceView* nullTextures[] = {
00091         nullptr
00092     };
00093
00094     context->PSSetShaderResources(0, _countof(nullTextures), nullTextures);
00095 }
00096
00097 void QuadRenderer::CreateDeviceDependentResources()
00098 {
00099     ID3D11Device* device = m_deviceResources->GetD3DDevice();
00100
00101     m_vertexShader = DX::CreateVertexShader(
00102         device,
00103         g_QuadVertexShader,
00104         _countof(g_QuadVertexShader));
00105
00106     static const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
00107     {
00108         { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00109         { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00110     };
00111
00112     m_inputLayout = DX::CreateInputLayout(
00113         device,
00114         vertexDesc,
00115         _countof(vertexDesc),
00116         g_QuadVertexShader,
00117         _countof(g_QuadVertexShader));
00118
00119     m_pixelShader = DX::CreatePixelShader(
00120         device,
00121         g_QuadPixelShader,
00122         _countof(g_QuadPixelShader));
00123
00124     m_constantBuffer = DX::CreateBuffer(
00125         device,
00126         sizeof(ModelViewProjectionConstantBuffer),
00127         nullptr,
00128         D3D11_BIND_CONSTANT_BUFFER);
00129
00130     m_samplerState = DX::CreateSamplerState(device);
00131
00132     static const VertexPositionTex quadVertices[] =
00133     {
00134         { XMFLOAT3(-1.0f,  1.0f, 0.0f), XMFLOAT2(0.0f, 0.0f) },
00135         { XMFLOAT3( 1.0f,  1.0f, 0.0f), XMFLOAT2(1.0f, 0.0f) },
00136         { XMFLOAT3( 1.0f, -1.0f, 0.0f), XMFLOAT2(1.0f, 1.0f) },
00137         { XMFLOAT3(-1.0f, -1.0f, 0.0f), XMFLOAT2(0.0f, 1.0f) },
00138     };
00139
00140     m_vertexBuffer = DX::CreateBuffer(
00141         device,
00142         sizeof(quadVertices),
00143         quadVertices,
00144         D3D11_BIND_VERTEX_BUFFER);
00145
00146     static const unsigned short quadIndices [] =
00147     {
00148         0,2,3,
00149         0,1,2,
00150     };
00151
00152     m_indexCount = _countof(quadIndices);
00153
00154     m_indexBuffer = DX::CreateBuffer(
00155         device,
00156         sizeof(quadIndices),
00157         quadIndices,
00158         D3D11_BIND_INDEX_BUFFER);
00159 }
00160
00161 void QuadRenderer::ReleaseDeviceDependentResources()
00162 {
00163     m_vertexShader = nullptr;
00164     m_inputLayout = nullptr;
00165     m_pixelShader = nullptr;
00166     m_constantBuffer = nullptr;
00167     m_vertexBuffer = nullptr;
00168     m_indexBuffer = nullptr;
00169     m_samplerState = nullptr;
00170 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_SingleFolder Member List

This is the complete list of members for Scenario3_SingleFolder, including all inherited members.
PickFolderButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_SingleFolder
Scenario3_SingleFolder() | Scenario3_SingleFolder
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/pch.cpp Source File

  • Printing
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/RelayCommand.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common

RelayCommand.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using System.Windows.Input;
00018
00019 namespace AdventureWorks.Common
00020 {
00021     /// <summary>
00022     /// A command whose sole purpose is to relay its functionality
00023     /// to other objects by invoking delegates.
00024     /// The default return value for the CanExecute method is 'true'.
00025     /// <see cref="RaiseCanExecuteChanged"/> needs to be called whenever
00026     /// <see cref="CanExecute"/> is expected to return a different value.
00027     /// </summary>
00028     public class RelayCommand : ICommand
00029     {
00030         private readonly Action _execute;
00031         private readonly Func<bool> _canExecute;
00032
00033         /// <summary>
00034         /// Raised when RaiseCanExecuteChanged is called.
00035         /// </summary>
00036         public event EventHandler CanExecuteChanged;
00037
00038         /// <summary>
00039         /// Creates a new command that can always execute.
00040         /// </summary>
00041         /// <param name="execute">The execution logic.</param>
00042         public RelayCommand(Action execute)
00043             : this(execute, null)
00044         {
00045         }
00046
00047         /// <summary>
00048         /// Creates a new command.
00049         /// </summary>
00050         /// <param name="execute">The execution logic.</param>
00051         /// <param name="canExecute">The execution status logic.</param>
00052         public RelayCommand(Action execute, Func<bool> canExecute)
00053         {
00054             if (execute == null)
00055                 throw new ArgumentNullException("execute");
00056             _execute = execute;
00057             _canExecute = canExecute;
00058         }
00059
00060         /// <summary>
00061         /// Determines whether this <see cref="RelayCommand"/> can execute in its current state.
00062         /// </summary>
00063         /// <param name="parameter">
00064         /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
00065         /// </param>
00066         /// <returns>true if this command can be executed; otherwise, false.</returns>
00067         public bool CanExecute(object parameter)
00068         {
00069             return _canExecute == null ? true : _canExecute();
00070         }
00071
00072         /// <summary>
00073         /// Executes the <see cref="RelayCommand"/> on the current command target.
00074         /// </summary>
00075         /// <param name="parameter">
00076         /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
00077         /// </param>
00078         public void Execute(object parameter)
00079         {
00080             _execute();
00081         }
00082
00083         /// <summary>
00084         /// Method used to raise the <see cref="CanExecuteChanged"/> event
00085         /// to indicate that the return value of the <see cref="CanExecute"/>
00086         /// method has changed.
00087         /// </summary>
00088         public void RaiseCanExecuteChanged()
00089         {
00090             var handler = CanExecuteChanged;
00091             if (handler != null)
00092             {
00093                 handler(this, EventArgs.Empty);
00094             }
00095         }
00096     }
00097 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_Document3.xaml.cs Source File

  • XamlCloudFontIntegration
  • cs

Scenario_Document3.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario_Document3 : Page
00018     {
00019         public Scenario_Document3()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         private void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00025         {
00026             // Font formatting is being applied on page load rather than in XAML markup
00027             // so that the on-demand cloud font behavior can be experienced when the
00028             // app runs rather than when the XAML file is viewed in Visual Studio.
00029
00030             // Formatting will be applied to all content elements in the page that don't
00031             // already have FontFamily set.
00032             this.FontFamily = new Windows.UI.Xaml.Media.FontFamily("Kokila");
00033         }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ScenarioElement() ScenarioElement [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/SampleConfiguration.cpp Source File

  • XamlCloudFontIntegration
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Using this sample app", "SDKTemplate.Scenario_SampleOverview" },
00021     { "Downloadable fonts overview", "SDKTemplate.Scenario_CloudFontOverview" },
00022     { "Document 1", "SDKTemplate.Scenario_Document1" },
00023     { "Document 2", "SDKTemplate.Scenario_Document2" },
00024     { "Document 3", "SDKTemplate.Scenario_Document3" }
00025 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Fx2Driver.cpp Source File

  • CustomCapability
  • cpp

Fx2Driver.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Fx2Driver.h"
00003
00004 using namespace SDKTemplate;
00005 using namespace Platform;
00006 using namespace Windows::Devices::Custom;
00007
00008 IOControlCode^ Fx2Driver::GetSevenSegmentDisplay = ref new IOControlCode(DeviceType,
00009                                                                          FunctionBase + 7,
00010                                                                          IOControlAccessMode::Read,
00011                                                                          IOControlBufferingMethod::Buffered);
00012
00013 IOControlCode^ Fx2Driver::SetSevenSegmentDisplay = ref new IOControlCode(DeviceType,
00014                                                                          FunctionBase + 8,
00015                                                                          IOControlAccessMode::Write,
00016                                                                          IOControlBufferingMethod::Buffered);
00017
00018 IOControlCode^ Fx2Driver::ReadSwitches = ref new IOControlCode(DeviceType,
00019                                                                FunctionBase + 6,
00020                                                                IOControlAccessMode::Read,
00021                                                                IOControlBufferingMethod::Buffered);
00022
00023 IOControlCode^ Fx2Driver::GetInterruptMessage = ref new IOControlCode(DeviceType,
00024                                                                       FunctionBase + 9,
00025                                                                       IOControlAccessMode::Read,
00026                                                                       IOControlBufferingMethod::DirectOutput);
00027
00028
00029 byte Fx2Driver::DigitToSevenSegment(byte value)
00030 {
00031     return SevenSegmentValues[value];
00032 }
00033
00034 byte Fx2Driver::SevenSegmentToDigit(byte value)
00035 {
00036     for (byte i = 0; i < ARRAYSIZE(SevenSegmentValues); i += 1)
00037     {
00038         if (SevenSegmentValues[i] == value)
00039         {
00040             return i;
00041         }
00042     }
00043     return 0xff;
00044 }
00045
00046 const byte Fx2Driver::SevenSegmentValues[10] = {
00047     0xD7, // 0
00048     0x06, // 1
00049     0xB3, // 2
00050     0xA7, // 3
00051     0x66, // 4
00052     0xE5, // 5
00053     0xF4, // 6
00054     0x07, // 7
00055     0xF7, // 8
00056     0x67, // 9
00057 };
00058
00059
00060 #include <initguid.h>
00061 // 573E8C73-0CB4-4471-A1BF-FAB26C31D384
00062 DEFINE_GUID(GUID_DEVINTERFACE_OSRUSBFX2,
00063     0x573e8c73, 0xcb4, 0x4471, 0xa1, 0xbf, 0xfa, 0xb2, 0x6c, 0x31, 0xd3, 0x84);
00064
00065 const Guid Fx2Driver::DeviceInterfaceGuid = Guid(GUID_DEVINTERFACE_OSRUSBFX2);
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario2_Binary.xaml.cs Source File

  • WebSocket
  • cs

Scenario2_Binary.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Runtime.InteropServices.WindowsRuntime;
00015 using System.Threading.Tasks;
00016 using Windows.Foundation;
00017 using Windows.Networking.Sockets;
00018 using Windows.Security.Cryptography.Certificates;
00019 using Windows.UI.Core;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023 using Windows.Web;
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// An empty page that can be used on its own or navigated to within a Frame.
00029     /// </summary>
00030     public sealed partial class Scenario2_Binary : Page
00031     {
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         MainPage rootPage = MainPage.Current;
00035
00036         private StreamWebSocket streamWebSocket;
00037         private bool busy;
00038
00039         public Scenario2_Binary()
00040         {
00041             this.InitializeComponent();
00042             UpdateVisualState();
00043         }
00044
00045         protected override void OnNavigatedFrom(NavigationEventArgs e)
00046         {
00047             CloseSocket();
00048         }
00049
00050         private void UpdateVisualState()
00051         {
00052             if (busy)
00053             {
00054                 VisualStateManager.GoToState(this, "Busy", false);
00055             }
00056             else
00057             {
00058                 bool connected = (streamWebSocket != null);
00059                 VisualStateManager.GoToState(this, connected ? "Connected" : "Disconnected", false);
00060             }
00061         }
00062
00063         private void SetBusy(bool value)
00064         {
00065             busy = value;
00066             UpdateVisualState();
00067         }
00068
00069         private async void OnStart(object sender, RoutedEventArgs args)
00070         {
00071             SetBusy(true);
00072             await StartAsync();
00073             SetBusy(false);
00074         }
00075
00076         private async Task StartAsync()
00077         {
00078             // Validating the URI is required since it was received from an untrusted source (user input).
00079             // The URI is validated by calling TryGetUri() that will return null for strings that are not
00080             // valid WebSocket URIs.
00081             // Note that when enabling the text box users may provide URIs to machines on the intrAnet
00082             // or intErnet. In these cases the app requires the "Home or Work Networking" or
00083             // "Internet (Client)" capability respectively.
00084             Uri server = rootPage.TryGetUri(ServerAddressField.Text);
00085             if (server == null)
00086             {
00087                 return;
00088             }
00089
00090             streamWebSocket = new StreamWebSocket();
00091             streamWebSocket.Closed += OnClosed;
00092
00093             // If we are connecting to wss:// endpoint, by default, the OS performs validation of
00094             // the server certificate based on well-known trusted CAs. We can perform additional custom
00095             // validation if needed.
00096             if (SecureWebSocketCheckBox.IsChecked == true)
00097             {
00098                 // WARNING: Only test applications should ignore SSL errors.
00099                 // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
00100                 // attacks. (Although the connection is secure, the server is not authenticated.)
00101                 // Note that not all certificate validation errors can be ignored.
00102                 // In this case, we are ignoring these errors since the certificate assigned to the localhost
00103                 // URI is self-signed and has subject name = fabrikam.com
00104                 streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
00105                 streamWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);
00106
00107                 // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
00108                 // custom validation of the server certificate. The event handler must implement the desired
00109                 // custom certificate validation logic.
00110                 streamWebSocket.ServerCustomValidationRequested += OnServerCustomValidationRequested;
00111
00112                 // Certificate validation is meaningful only for secure connections.
00113                 if (server.Scheme != "wss")
00114                 {
00115                     AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
00116                 }
00117             }
00118
00119             AppendOutputLine($"Connecting to {server}...");
00120             try
00121             {
00122                 await streamWebSocket.ConnectAsync(server);
00123             }
00124             catch (Exception ex) // For debugging
00125             {
00126                 streamWebSocket.Dispose();
00127                 streamWebSocket = null;
00128
00129                 AppendOutputLine(MainPage.BuildWebSocketError(ex));
00130                 AppendOutputLine(ex.Message);
00131                 return;
00132             }
00133             rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
00134
00135             // Start a task to continuously read for incoming data
00136             Task receiving = ReceiveDataAsync(streamWebSocket);
00137
00138             // Start a task to continuously write outgoing data
00139             Task sending = SendDataAsync(streamWebSocket);
00140         }
00141
00142         private async void OnServerCustomValidationRequested(StreamWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args)
00143         {
00144             // In order to call async APIs in this handler, you must first take a deferral and then
00145             // release it once you are done with the operation. The "using" statement
00146             // ensures that the deferral completes when control leaves the block.
00147             bool isValid;
00148             using (Deferral deferral = args.GetDeferral())
00149             {
00150                 // Get the server certificate and certificate chain from the args parameter.
00151                 isValid = await MainPage.AreCertificateAndCertChainValidAsync(args.ServerCertificate, args.ServerIntermediateCertificates);
00152
00153                 if (!isValid)
00154                 {
00155                     args.Reject();
00156                 }
00157             }
00158
00159             // Continue on the UI thread so we can update UI.
00160             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00161             {
00162                 if (isValid)
00163                 {
00164                     AppendOutputLine("Custom validation of server certificate passed.");
00165                 }
00166                 else
00167                 {
00168                     AppendOutputLine("Custom validation of server certificate failed.");
00169                 }
00170             });
00171         }
00172
00173         // Continuously write outgoing data. For writing data we'll show how to use data.AsBuffer() to get an
00174         // IBuffer for use with activeSocket.OutputStream.WriteAsync.  Alternatively you can call
00175         // activeSocket.OutputStream.AsStreamForWrite() to use .NET streams.
00176         private async Task SendDataAsync(StreamWebSocket activeSocket)
00177         {
00178             int bytesSent = 0;
00179             byte[] data = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
00180
00181             AppendOutputLine($"Background sending data in {data.Length} byte chunks each second.");
00182
00183             try
00184             {
00185                 // Send until the socket gets closed/stopped
00186                 while (true)
00187                 {
00188                     if (streamWebSocket != activeSocket)
00189                     {
00190                         // Our socket is no longer active. Stop sending.
00191                         AppendOutputLine("Background write stopped.");
00192                         return;
00193                     }
00194
00195                     await activeSocket.OutputStream.WriteAsync(data.AsBuffer());
00196
00197                     bytesSent += data.Length;
00198                     DataSentField.Text = bytesSent.ToString();
00199
00200                     // Delay so the user can watch what's going on.
00201                     await Task.Delay(TimeSpan.FromSeconds(1));
00202                 }
00203             }
00204             catch (Exception ex)
00205             {
00206                 WebErrorStatus status = WebSocketError.GetStatus(ex.GetBaseException().HResult);
00207
00208                 switch (status)
00209                 {
00210                     case WebErrorStatus.OperationCanceled:
00211                         AppendOutputLine("Background write canceled.");
00212                         break;
00213
00214                     default:
00215                         AppendOutputLine("Error: " + status);
00216                         AppendOutputLine(ex.Message);
00217                         break;
00218                 }
00219             }
00220         }
00221
00222         // Continuously read incoming data. For reading data we'll show how to use activeSocket.InputStream.AsStream()
00223         // to get a .NET stream. Alternatively you could call readBuffer.AsBuffer() to use IBuffer with
00224         // activeSocket.InputStream.ReadAsync.
00225         private async Task ReceiveDataAsync(StreamWebSocket activeSocket)
00226         {
00227             Stream readStream = streamWebSocket.InputStream.AsStreamForRead();
00228             int bytesReceived = 0;
00229             try
00230             {
00231                 AppendOutputLine("Background read starting.");
00232
00233                 byte[] readBuffer = new byte[1000];
00234
00235                 while (true)
00236                 {
00237                     if (streamWebSocket != activeSocket)
00238                     {
00239                         // Our socket is no longer active. Stop reading.
00240                         AppendOutputLine("Background read stopped.");
00241                         return;
00242                     }
00243
00244                     int read = await readStream.ReadAsync(readBuffer, 0, readBuffer.Length);
00245
00246                     // Do something with the data.
00247                     // This sample merely reports that the data was received.
00248
00249                     bytesReceived += read;
00250                     DataReceivedField.Text = bytesReceived.ToString();
00251                 }
00252             }
00253             catch (Exception ex)
00254             {
00255                 WebErrorStatus status = WebSocketError.GetStatus(ex.GetBaseException().HResult);
00256
00257                 switch (status)
00258                 {
00259                     case WebErrorStatus.OperationCanceled:
00260                         AppendOutputLine("Background read canceled.");
00261                         break;
00262
00263                     default:
00264                         AppendOutputLine("Error: " + status);
00265                         AppendOutputLine(ex.Message);
00266                         break;
00267                 }
00268             }
00269         }
00270
00271         private void OnStop(object sender, RoutedEventArgs args)
00272         {
00273             SetBusy(true);
00274             rootPage.NotifyUser("Stopping", NotifyType.StatusMessage);
00275             CloseSocket();
00276             SetBusy(false);
00277             rootPage.NotifyUser("Stopped", NotifyType.StatusMessage);
00278         }
00279
00280         // This may be triggered remotely by the server or locally by Close/Dispose()
00281         private async void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
00282         {
00283             // Dispatch the event to the UI thread so we do not need to synchronize access to streamWebSocket.
00284             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00285             {
00286                 AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);
00287
00288                 if (streamWebSocket == sender)
00289                 {
00290                     CloseSocket();
00291                     UpdateVisualState();
00292                 }
00293             });
00294         }
00295
00296         private void CloseSocket()
00297         {
00298             if (streamWebSocket != null)
00299             {
00300                 try
00301                 {
00302                     streamWebSocket.Close(1000, "Closed due to user request.");
00303                 }
00304                 catch (Exception ex)
00305                 {
00306                     AppendOutputLine(MainPage.BuildWebSocketError(ex));
00307                     AppendOutputLine(ex.Message);
00308                 }
00309                 streamWebSocket = null;
00310             }
00311         }
00312
00313         private void AppendOutputLine(string value)
00314         {
00315             OutputField.Text += value + "\r\n";
00316         }
00317     }
00318 }
Generated on Fri Nov 15 2024 22:22:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Polling Member List

This is the complete list of members for Scenario2_Polling, including all inherited members.
_desiredReportInterval | Scenario2_Polling | [private]
_dispatcherTimer | Scenario2_Polling | [private]
_gyrometer | Scenario2_Polling | [private]
DisplayCurrentReading(object sender, object args) | Scenario2_Polling | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Polling | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2_Polling | [inline, protected]
rootPage | Scenario2_Polling | [private]
Scenario2_Polling() | Scenario2_Polling | [inline]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario2_Polling | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario2_Polling | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario2_Polling | [inline, private]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MultipleAccountsScenario Member List

This is the complete list of members for MultipleAccountsScenario, including all inherited members.
AccountsContainer | MultipleAccountsScenario | [private]
AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs e) | MultipleAccountsScenario | [inline, private]
AddWebAccountProvidersToPane(AccountsSettingsPaneCommandsRequestedEventArgs e) | MultipleAccountsScenario | [inline, private]
AddWebAccountsToPane(AccountsSettingsPaneCommandsRequestedEventArgs e) | MultipleAccountsScenario | [inline, private]
AppSpecificProviderId | MultipleAccountsScenario | [private]
AppSpecificProviderName | MultipleAccountsScenario | [private]
AuthenticateWithRequestToken(WebAccountProvider Provider, String Scope, String ClientID) | MultipleAccountsScenario | [inline]
AuthoritySubContainer | MultipleAccountsScenario | [private]
AzureActiveDirectoryAuthority | MultipleAccountsScenario | [private]
AzureActiveDirectoryClientId | MultipleAccountsScenario | [private]
AzureActiveDirectoryScopeRequested | MultipleAccountsScenario | [private]
Button_Reset(object sender, RoutedEventArgs e) | MultipleAccountsScenario | [inline, private]
Button_ShowAccountSettings(object sender, RoutedEventArgs e) | MultipleAccountsScenario | [inline, private]
CreateLocalDataContainers() | MultipleAccountsScenario | [inline, private]
GetAllAccounts() | MultipleAccountsScenario | [inline, private]
GetAllProviders() | MultipleAccountsScenario | [inline, private]
GetProvider(string ProviderID, string AuthorityId="") | MultipleAccountsScenario | [inline, private]
LogoffAndRemoveAccount(WebAccount account) | MultipleAccountsScenario | [inline, private]
LogoffAndRemoveAllAccounts() | MultipleAccountsScenario | [inline, private]
MicrosoftAccountAuthority | MultipleAccountsScenario | [private]
MicrosoftAccountClientId | MultipleAccountsScenario | [private]
MicrosoftAccountScopeRequested | MultipleAccountsScenario | [private]
MicrosoftProviderId | MultipleAccountsScenario | [private]
MultipleAccountsScenario() | MultipleAccountsScenario | [inline]
OnAccountCommandsRequested(AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e) | MultipleAccountsScenario | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | MultipleAccountsScenario | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | MultipleAccountsScenario | [inline, protected]
OtherLinkInvoked(IUICommand command) | MultipleAccountsScenario | [inline, private]
OutputTokenResult(WebTokenRequestResult result) | MultipleAccountsScenario | [inline]
PrivacyPolicyInvoked(IUICommand command) | MultipleAccountsScenario | [inline, private]
ProviderIdSubContainer | MultipleAccountsScenario | [private]
rootPage | MultipleAccountsScenario | [private]
StoreNewAccountDataLocally(WebAccount account) | MultipleAccountsScenario | [inline]
WebAccountInvoked(WebAccountCommand command, WebAccountInvokedArgs args) | MultipleAccountsScenario | [inline, private]
WebAccountProviderCommandInvoked(WebAccountProviderCommand command) | MultipleAccountsScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/TextLayoutImageSource.h Source File

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

TextLayoutImageSource.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "TextLayout.h"
00015
00016 namespace DWriteTextLayoutImplementation
00017 {
00018     public ref class TextLayoutImageSource sealed : Windows::UI::Xaml::Media::Imaging::SurfaceImageSource
00019     {
00020     public:
00021         TextLayoutImageSource(TextLayout^ textLayout); // Dimensions determined from layout.
00022         TextLayoutImageSource(TextLayout^ textLayout, uint32 pixelWidth, uint32 pixelHeight); // Explicit dimensions.
00023         virtual ~TextLayoutImageSource();
00024         void Draw();
00025
00026     private:
00027         void CreateDeviceResources();
00028         void BeginDraw();
00029         void BeginDraw(Windows::Foundation::Rect updateRect);
00030         void EndDraw();
00031         void Clear();
00032         void DrawText();
00033         void DrawLineMetricsDecorations();
00034
00035         // event handlers
00036         void OnSuspending(Platform::Object ^sender, Windows::ApplicationModel::SuspendingEventArgs ^e);
00037         Windows::Foundation::EventRegistrationToken         m_suspendEventHandlerRegistrationToken;
00038
00039         // Direct3D device
00040         Microsoft::WRL::ComPtr<ID3D11Device>                m_d3dDevice;
00041
00042         // Direct2D objects
00043         Microsoft::WRL::ComPtr<ID2D1Device>                 m_d2dDevice;
00044         Microsoft::WRL::ComPtr<ID2D1DeviceContext>          m_d2dContext;
00045
00046         // DWrite wrapper object
00047         TextLayout^                                         m_textLayout;
00048
00049         uint32                                              m_pixelWidth;
00050         uint32                                              m_pixelHeight;
00051         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textBrush;
00052         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textBackgroundBrush;
00053         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textAscentBrush;
00054         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textDescentBrush;
00055         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textLineGapBrush;
00056         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_boundsBrush;
00057         Microsoft::WRL::ComPtr<ID2D1StrokeStyle>            m_boundsStrokeStyle;
00058     };
00059
00060 }
Generated on Fri Nov 15 2024 22:19:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/SampleConfiguration.cs Source File

  • AppServices
  • cs
  • AppServicesClient

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "App service client sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Open/Close Connection", ClassType=typeof(OpenCloseConnectionScenario)},
00025             new Scenario() { Title="Keep Connection Open", ClassType=typeof(KeepConnectionOpenScenario)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario1_SimpleListView.cpp Source File

  • XamlListView
  • cppwinrt

Scenario1_SimpleListView.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Contact.h"
00014 #include "Scenario1_SimpleListView.h"
00015 #include "Scenario1_SimpleListView.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario1_SimpleListView::Scenario1_SimpleListView()
00024     {
00025         InitializeComponent();
00026         ContactsCVS().Source(Contact::GetContactsGrouped(250));
00027     }
00028 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AnimateLineListPosition Member List

This is the complete list of members for AnimateLineListPosition, including all inherited members.
Animate() | Animate |
AnimateLineListPosition(_In_ unsigned int count, _In_reads_(count) DirectX::XMFLOAT3 const position[], _In_ float duration, _In_ bool continuous) | AnimateLineListPosition |
Continuous() | Animate |
Continuous(_In_ bool continuous) | Animate |
Duration() | Animate |
Duration(_In_ float duration) | Animate |
Evaluate(_In_ float t) override | AnimateLineListPosition | [virtual]
IsActive(_In_ float t) | Animate | [inline]
IsFinished(_In_ float t) | Animate | [inline]
m_continuous | Animate | [protected]
m_count | AnimateLineListPosition | [private]
m_duration | Animate | [protected]
m_segment | AnimateLineListPosition | [private]
m_startTime | Animate | [protected]
m_totalLength | AnimateLineListPosition | [private]
Start() | Animate |
Start(_In_ float start) | Animate |
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FilledRectangle Member List

This is the complete list of members for FilledRectangle, including all inherited members.
AddChildElement(const std::shared_ptr< BaseElement > &childElement) | BaseElement |
ArrangeElements() | BaseElement | [virtual]
BaseElement() | BaseElement |
FilledRectangle(FLOAT width, FLOAT height, D2D1::ColorF brushColor) | FilledRectangle |
GetElementMargin() | BaseElement | [inline]
GetElementSize() | BaseElement | [inline]
GetIgnoreLayout() | BaseElement | [inline]
GetIsRenderPassNeeded() | BaseElement | [inline]
GetIsVisible() | BaseElement | [inline]
Initialize() override | FilledRectangle | [virtual]
m_brushColor | FilledRectangle | [private]
m_deviceResources | BaseElement | [protected]
m_elementMargin | BaseElement | [protected]
m_elementSize | BaseElement | [protected]
m_ignoreLayout | BaseElement | [protected]
m_isInitialized | BaseElement | [protected]
m_isLayoutHorizontal | BaseElement | [protected]
m_isRenderPassNeeded | BaseElement | [protected]
m_isVisible | BaseElement | [protected]
m_parentTranslation | BaseElement | [protected]
m_rect | FilledRectangle | [private]
m_transformedTranslation | BaseElement | [protected]
m_transformMatrix | BaseElement | [protected]
m_transformRecalculationNeeded | BaseElement | [protected]
m_translation | BaseElement | [protected]
Render() override | FilledRectangle | [protected, virtual]
SetBrush(ID2D1SolidColorBrush *brush) | BaseElement |
SetElementMargin(ElementMargin margin) | BaseElement | [inline]
SetElementSize(Windows::Foundation::Numerics::float2 size) | BaseElement | [inline]
SetIgnoreLayout(bool ignoreLayout) | BaseElement | [inline]
SetIsVisible(bool visible) | BaseElement |
SetLayoutHorizontal(bool isLayoutHorizontal) | BaseElement | [inline]
SetParentTransform(Windows::Foundation::Numerics::float2 translation) | BaseElement |
SetRect(const D2D1_RECT_F &rect) | FilledRectangle | [inline]
SetTranslation(Windows::Foundation::Numerics::float2 translation) | BaseElement | [virtual]
TryRender() | BaseElement |
Update(const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) | BaseElement | [virtual]
~BaseElement() | BaseElement | [virtual]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ReceiveUri Member List

This is the complete list of members for Scenario4_ReceiveUri, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario4_ReceiveUri | [inline, protected]
Protocol | Scenario4_ReceiveUri | [private]
rootPage | Scenario4_ReceiveUri | [private]
Scenario4_ReceiveUri() | Scenario4_ReceiveUri | [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cs/App.xaml.cs Source File

  • CameraFaceDetection
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.Activation;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace FaceDetection
00019 {
00020     /// <summary>
00021     /// Provides application-specific behavior to supplement the default Application class.
00022     /// </summary>
00023     sealed partial class App : Application
00024     {
00025         /// <summary>
00026         /// Initializes the singleton application object.  This is the first line of authored code
00027         /// executed, and as such is the logical equivalent of main() or WinMain().
00028         /// </summary>
00029         public App()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when the application is launched normally by the end user.  Other entry points
00036         /// will be used such as when the application is launched to open a specific file.
00037         /// </summary>
00038         /// <param name="e">Details about the launch request and process.</param>
00039         protected override void OnLaunched(LaunchActivatedEventArgs e)
00040         {
00041
00042 #if DEBUG
00043             if (System.Diagnostics.Debugger.IsAttached)
00044             {
00045                 this.DebugSettings.EnableFrameRateCounter = true;
00046             }
00047 #endif
00048
00049             Frame rootFrame = Window.Current.Content as Frame;
00050
00051             // Do not repeat app initialization when the Window already has content,
00052             // just ensure that the window is active
00053             if (rootFrame == null)
00054             {
00055                 // Create a Frame to act as the navigation context and navigate to the first page
00056                 rootFrame = new Frame();
00057                 // Set the default language
00058                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00059
00060                 rootFrame.NavigationFailed += OnNavigationFailed;
00061
00062                 // Place the frame in the current Window
00063                 Window.Current.Content = rootFrame;
00064             }
00065
00066             if (rootFrame.Content == null)
00067             {
00068                 // When the navigation stack isn't restored navigate to the first page,
00069                 // configuring the new page by passing required information as a navigation
00070                 // parameter
00071                 rootFrame.Navigate(typeof(MainPage), e.Arguments);
00072             }
00073             // Ensure the current window is active
00074             Window.Current.Activate();
00075         }
00076
00077         /// <summary>
00078         /// Invoked when Navigation to a certain page fails
00079         /// </summary>
00080         /// <param name="sender">The Frame which failed navigation</param>
00081         /// <param name="e">Details about the navigation failure</param>
00082         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00083         {
00084             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00085         }
00086     }
00087 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document1.xaml.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_Document1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_Document1.xaml.h"
00014 #include "DocumentPresenter.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace DWriteTextLayoutCloudFontImplementation;
00018
00019 using Platform::Object;
00020 using Platform::String;
00021 using Windows::UI::Color;
00022 using Windows::UI::ColorHelper;
00023 using Windows::UI::Xaml::SizeChangedEventArgs;
00024
00025
00026 // The DocumentPresenter class is used to handle, at a high level, the text layout that
00027 // uses downloadable fonts, the display of that layout, and interaction with DirectWrite's
00028 // font download mechanisms. The lower-level implementation is handled in classes that the
00029 // DocumentPresenter class uses. The TextLayout and FontDownloadListener classes are the
00030 // primary focus for this sample.
00031
00032
00033
00034 Scenario_Document1::Scenario_Document1()
00035 {
00036     InitializeComponent();
00037
00038     String^ text =
00039         L"Lorem ipsum dolor sit amet, pri ea voluptua consetetur. Vel eu altera omittam. Voluptaria reprehendunt vel eu, eum te graeco omnium blandit, mel nullam persius verterem eu. An euismod salutandi vis, vero exerci oblique ex mea. Cu quo audiam verear, esse facilis omittantur usu ei. Eam id dolor corpora oportere, vix dolor tincidunt id, viris dolorem vix ne. Minim gubergren id cum, vim ei quas denique prodesset." L"\xd\xa\xd\xa"
00040         L"Duo quem justo assentior ei. Cu simul quidam mei, ut stet incorrupte definitionem duo. Ne mei utinam graece intellegam, no causae mediocritatem vix, vim mundi aperiri detracto ei. Dictas definiebas ei in appellantur.";
00041
00042     String^ downloadableFontName = ref new String(L"Neue Haas Grotesk Text Pro");
00043
00044     // Set the colors to be used for the text layout. Also apply to the frame background.
00045     Color textColor = ColorHelper::FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
00046     Color textBackgroundColor = ColorHelper::FromArgb(0xFF, 0x30, 0x30, 0x30);
00047
00048     // Create the DocumentPresenter for our document.
00049     m_documentPresenter = ref new DocumentPresenter(
00050         text,
00051         downloadableFontName,
00052         L"hi", // Language tag for the content (Hindi).
00053         textColor,
00054         textBackgroundColor,
00055         TextLayoutImage // The target image control for the SurfaceImageSource presenting the text layout.
00056     );
00057
00058     // As the page is loaded, after this constructor has exited, XAML will be re-sizing
00059     // the TextLayoutFrame scroll viewer element and the TextLayoutFrame_SizeChanged
00060     // handler will get invoked. That's when the image source will first get created.
00061 }
00062
00063
00064
00065 // Event handlers:
00066
00067 void Scenario_Document1::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00068 {
00069     m_documentPresenter = nullptr;
00070 }
00071
00072
00073 void Scenario_Document1::TextLayoutFrame_SizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00074 {
00075     // Get the current available width and update the TextLayout if different.
00076     // The available width will be the actual width less the left and right padding.
00077     //
00078     // Note: when this page is presented in a narrow window, or if this page and
00079     // the navigation pane are both open simultanously on a narrow display, the
00080     // width of our containing frame could become very small, and subtracting the
00081     // left and right padding values could even result in a negative value. That
00082     // would result in an error when we try to revise the text layout. This issue
00083     // is avoided, however, by having a MinWidth set on the grid for this page in
00084     // the XAML markup.
00085     //
00086     // There's a related issue: setting the text layout to a narrow width causes
00087     // it to have a large height. When we create the SurfaceImageSource used for
00088     // displaying the text layout, that large height could exceed the graphics
00089     // device resources on older devices. A check for this is included in the
00090     // TextLayoutImageSource class, but it can result in some of the text layout
00091     // being clipped. This should not happen on devices that support D3D feature
00092     // level 9_3 or later. Managing graphics device resources is beyond the scope
00093     // of this sample, however, so that known issue is left as is.
00094
00095     double width = TextLayoutFrame->ActualWidth;
00096     auto padding = TextLayoutFrame->Padding;
00097     width -= (padding.Left + padding.Right);
00098
00099     // XAML uses DIPs expressed as double. DirectWrite uses DIPs expressed as float.
00100     // casting here.
00101     m_documentPresenter->SetLayoutWidth(static_cast<float>(width));
00102 }
Generated on Fri Nov 15 2024 22:19:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Metrics Member List

This is the complete list of members for Scenario1_Metrics, including all inherited members.
Animations_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario1_Metrics | [inline, private]
DisplayMetrics(AnimationEffect effect, AnimationEffectTarget target) | Scenario1_Metrics | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Metrics | [inline, protected]
rootPage | Scenario1_Metrics | [private]
Scenario1_Metrics() | Scenario1_Metrics | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/SampleConfiguration.h Source File

  • UserInfo
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt
00016 {
00017     hstring to_hstring(Windows::System::UserType value);
00018     hstring to_hstring(Windows::System::UserAuthenticationStatus value);
00019 }
00020
00021 namespace winrt::SDKTemplate::Helpers
00022 {
00023     Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable>> GetUserViewModelsAsync();
00024 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StepTimer Member List

This is the complete list of members for StepTimer, including all inherited members.
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedSeconds() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetElapsedTicks() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFrameCount() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetFramesPerSecond() const | StepTimer | [inline]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetPerformanceFrequency() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTicks() | StepTimer | [inline, static]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalSeconds() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
GetTotalTicks() const | StepTimer | [inline]
m_elapsedTicks | StepTimer | [private]
m_elapsedTicks | StepTimer | [private]
m_frameCount | StepTimer | [private]
m_frameCount | StepTimer | [private]
m_framesPerSecond | StepTimer | [private]
m_framesPerSecond | StepTimer | [private]
m_framesThisSecond | StepTimer | [private]
m_framesThisSecond | StepTimer | [private]
m_isFixedTimeStep | StepTimer | [private]
m_leftOverTicks | StepTimer | [private]
m_leftOverTicks | StepTimer | [private]
m_qpcFrequency | StepTimer | [private]
m_qpcFrequency | StepTimer | [private]
m_qpcFrequency | StepTimer | [private]
m_qpcLastTime | StepTimer | [private]
m_qpcLastTime | StepTimer | [private]
m_qpcLastTime | StepTimer | [private]
m_qpcMaxDelta | StepTimer | [private]
m_qpcMaxDelta | StepTimer | [private]
m_qpcSecondCounter | StepTimer | [private]
m_qpcSecondCounter | StepTimer | [private]
m_targetElapsedTicks | StepTimer | [private]
m_targetElapsedTicks | StepTimer | [private]
m_totalTicks | StepTimer | [private]
m_totalTicks | StepTimer | [private]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
ResetElapsedTime() | StepTimer | [inline]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SecondsToTicks(double seconds) | StepTimer | [inline, static]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetFixedTimeStep(bool isFixedTimestep) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedSeconds(double targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64_t targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
SetTargetElapsedTicks(uint64 targetElapsed) | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
StepTimer() | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
Tick(const TUpdate &update) | StepTimer | [inline]
TicksPerSecond | StepTimer | [static]
TicksPerSecond | StepTimer | [static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64_t ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
TicksToSeconds(uint64 ticks) | StepTimer | [inline, static]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlaybackControl Member List

This is the complete list of members for PlaybackControl, including all inherited members.
AppMuted() | PlaybackControl | [inline, private]
AppUnmuted() | PlaybackControl | [inline, private]
Button_Pause_Click(object sender, RoutedEventArgs e) | PlaybackControl | [inline, private]
Button_Play_Click(object sender, RoutedEventArgs e) | PlaybackControl | [inline, private]
Button_Stop_Click(object sender, RoutedEventArgs e) | PlaybackControl | [inline, private]
cw | PlaybackControl | [private]
DisplayStatus(string text) | PlaybackControl | [inline, private]
GetTimeStampedMessage(string eventText) | PlaybackControl | [inline, private]
IsPlaying | PlaybackControl | [private]
Pause() | PlaybackControl | [inline]
Play() | PlaybackControl | [inline]
PlaybackControl() | PlaybackControl | [inline]
rootPage | PlaybackControl | [private]
SelectFile() | PlaybackControl | [inline]
SetAudioCategory(AudioCategory category) | PlaybackControl | [inline]
SetAudioDeviceType(AudioDeviceType devicetype) | PlaybackControl | [inline]
SoundLevelToString(SoundLevel level) | PlaybackControl | [inline, private]
Stop() | PlaybackControl | [inline]
systemMediaControls | PlaybackControl | [private]
SystemMediaControls_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs e) | PlaybackControl | [inline, private]
SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs e) | PlaybackControl | [inline, private]
~PlaybackControl() | PlaybackControl | [inline, private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/pch.h Source File

  • GlobalizationPreferences
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Globalization.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.System.UserProfile.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario0_Choose.xaml.cpp Source File

  • Accelerometer
  • cpp

Scenario0_Choose.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario0_Choose.xaml.cpp
00014 // Implementation of the Scenario0_Choose class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario0_Choose.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Sensors;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 void Scenario0_Choose::AddReadingType(AccelerometerReadingType readingType)
00029 {
00030     auto item = ref new ComboBoxItem();
00031     item->Content = readingType.ToString();
00032     item->Tag = readingType;
00033     ReadingTypeComboBox->Items->Append(item);
00034     if (readingType == rootPage->AccelerometerReadingType)
00035     {
00036         ReadingTypeComboBox->SelectedItem = item;
00037     }
00038 }
00039
00040 Scenario0_Choose::Scenario0_Choose()
00041 {
00042     InitializeComponent();
00043
00044     AddReadingType(AccelerometerReadingType::Standard);
00045     AddReadingType(AccelerometerReadingType::Linear);
00046     AddReadingType(AccelerometerReadingType::Gravity);
00047 }
00048
00049 void Scenario0_Choose::OnNavigatedFrom(NavigationEventArgs^ e)
00050 {
00051     auto item = safe_cast<ComboBoxItem^>(ReadingTypeComboBox->SelectedItem);
00052     rootPage->AccelerometerReadingType = safe_cast<AccelerometerReadingType>(item->Tag);
00053 }
Generated on Fri Nov 15 2024 22:17:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameMain.cpp Source File

  • Simple3DGameDX
  • cpp

GameMain.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MoveLookController.h"
00014 #include "GameMain.h"
00015
00016 using namespace GameControl;
00017 using namespace Simple3DGameDX;
00018 using namespace concurrency;
00019 using namespace DirectX;
00020 using namespace Windows::ApplicationModel;
00021 using namespace Windows::ApplicationModel::Activation;
00022 using namespace Windows::ApplicationModel::Core;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Graphics::Display;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Input;
00027 using namespace Windows::UI::ViewManagement;
00028 using namespace Windows::System::Threading;
00029 using namespace Concurrency;
00030
00031
00032 GameMain::GameMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00033     m_deviceResources(deviceResources),
00034     m_windowClosed(false),
00035     m_haveFocus(false),
00036     m_gameInfoOverlayCommand(GameInfoOverlayCommand::None),
00037     m_visible(true),
00038     m_loadingCount(0),
00039     m_updateState(UpdateEngineState::WaitingForResources)
00040 {
00041     m_deviceResources->RegisterDeviceNotify(this);
00042
00043     m_renderer = ref new GameRenderer(m_deviceResources);
00044     m_game = ref new Simple3DGame();
00045
00046     m_uiControl = m_renderer->GameUIControl();
00047
00048     m_controller = ref new MoveLookController(CoreWindow::GetForCurrentThread());
00049
00050     auto bounds = m_deviceResources->GetLogicalSize();
00051
00052     m_controller->SetMoveRect(
00053         XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
00054         XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
00055         );
00056     m_controller->SetFireRect(
00057         XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
00058         XMFLOAT2(bounds.Width, bounds.Height)
00059         );
00060
00061     SetGameInfoOverlay(GameInfoOverlayState::Loading);
00062     m_uiControl->SetAction(GameInfoOverlayCommand::None);
00063     m_uiControl->ShowGameInfoOverlay();
00064
00065     create_task([this]()
00066     {
00067         // Asynchronously initialize the game class and load the renderer device resources.
00068         // By doing all this asynchronously, the game gets to its main loop more quickly
00069         // and in parallel all the necessary resources are loaded on other threads.
00070         m_game->Initialize(m_controller, m_renderer);
00071
00072         return m_renderer->CreateGameDeviceResourcesAsync(m_game);
00073
00074     }).then([this]()
00075     {
00076         // The finalize code needs to run in the same thread context
00077         // as the m_renderer object was created because the D3D device context
00078         // can ONLY be accessed on a single thread.
00079         m_renderer->FinalizeCreateGameDeviceResources();
00080
00081         InitializeGameState();
00082
00083         if (m_updateState == UpdateEngineState::WaitingForResources)
00084         {
00085             // In the middle of a game so spin up the async task to load the level.
00086             return m_game->LoadLevelAsync().then([this]()
00087             {
00088                 // The m_game object may need to deal with D3D device context work so
00089                 // again the finalize code needs to run in the same thread
00090                 // context as the m_renderer object was created because the D3D
00091                 // device context can ONLY be accessed on a single thread.
00092                 m_game->FinalizeLoadLevel();
00093                 m_game->SetCurrentLevelToSavedState();
00094                 m_updateState = UpdateEngineState::ResourcesLoaded;
00095
00096             }, task_continuation_context::use_current());
00097         }
00098         else
00099         {
00100             // The game is not in the middle of a level so there aren't any level
00101             // resources to load.  Creating a no-op task so that in both cases
00102             // the same continuation logic is used.
00103             return create_task([]()
00104             {
00105             });
00106         }
00107     }, task_continuation_context::use_current()).then([this]()
00108     {
00109         // Since Game loading is an async task, the app visual state
00110         // may be too small or not have focus.  Put the state machine
00111         // into the correct state to reflect these cases.
00112
00113         if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
00114         {
00115             m_updateStateNext = m_updateState;
00116             m_updateState = UpdateEngineState::TooSmall;
00117             m_controller->Active(false);
00118             m_uiControl->HideGameInfoOverlay();
00119             m_uiControl->ShowTooSmall();
00120             m_renderNeeded = true;
00121         }
00122         else if (!m_haveFocus)
00123         {
00124             m_updateStateNext = m_updateState;
00125             m_updateState = UpdateEngineState::Deactivated;
00126             m_controller->Active(false);
00127             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00128             m_renderNeeded = true;
00129         }
00130     }, task_continuation_context::use_current());
00131 }
00132
00133 //--------------------------------------------------------------------------------------
00134
00135 GameMain::~GameMain()
00136 {
00137     // Deregister device notification
00138     m_deviceResources->RegisterDeviceNotify(nullptr);
00139 }
00140
00141 //--------------------------------------------------------------------------------------
00142
00143 void GameMain::Run()
00144 {
00145     while (!m_windowClosed)
00146     {
00147         if (m_visible)
00148         {
00149             switch (m_updateState)
00150             {
00151             case UpdateEngineState::Deactivated:
00152             case UpdateEngineState::TooSmall:
00153                 if (m_updateStateNext == UpdateEngineState::WaitingForResources)
00154                 {
00155                     WaitingForResourceLoading();
00156                     m_renderNeeded = true;
00157                 }
00158                 else if (m_updateStateNext == UpdateEngineState::ResourcesLoaded)
00159                 {
00160                     // In the device lost case, we transition to the final waiting state
00161                     // and make sure the display is updated.
00162                     switch (m_pressResult)
00163                     {
00164                     case PressResultState::LoadGame:
00165                         SetGameInfoOverlay(GameInfoOverlayState::GameStats);
00166                         break;
00167
00168                     case PressResultState::PlayLevel:
00169                         SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00170                         break;
00171
00172                     case PressResultState::ContinueLevel:
00173                         SetGameInfoOverlay(GameInfoOverlayState::Pause);
00174                         break;
00175                     }
00176                     m_updateStateNext = UpdateEngineState::WaitingForPress;
00177                     m_uiControl->ShowGameInfoOverlay();
00178                     m_renderNeeded = true;
00179                 }
00180
00181                 if (!m_renderNeeded)
00182                 {
00183                     // The App is not currently the active window and not in a transient state so just wait for events.
00184                     CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00185                     break;
00186                 }
00187                 // otherwise fall through and do normal processing to get the rendering handled.
00188             default:
00189                 CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
00190                 Update();
00191                 m_renderer->Render();
00192                 m_deviceResources->Present();
00193                 m_renderNeeded = false;
00194             }
00195         }
00196         else
00197         {
00198             CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00199         }
00200     }
00201     m_game->OnSuspending();  // exiting due to window close.  Make sure to save state.
00202 }
00203
00204 //--------------------------------------------------------------------------------------
00205
00206 void GameMain::InitializeGameState()
00207 {
00208     // Set up the initial state machine for handling Game playing state.
00209     if (m_game->GameActive() && m_game->LevelActive())
00210     {
00211         // The last time the game terminated it was in the middle
00212         // of a level.
00213         // We are waiting for the user to continue the game.
00214         m_updateState = UpdateEngineState::WaitingForResources;
00215         m_pressResult = PressResultState::ContinueLevel;
00216         SetGameInfoOverlay(GameInfoOverlayState::Pause);
00217         m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00218     }
00219     else if (!m_game->GameActive() && (m_game->HighScore().totalHits > 0))
00220     {
00221         // The last time the game terminated the game had been completed.
00222         // Show the high score.
00223         // We are waiting for the user to acknowledge the high score and start a new game.
00224         // The level resources for the first level will be loaded later.
00225         m_updateState = UpdateEngineState::WaitingForPress;
00226         m_pressResult = PressResultState::LoadGame;
00227         SetGameInfoOverlay(GameInfoOverlayState::GameStats);
00228         m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00229         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00230     }
00231     else
00232     {
00233         // This is either the first time the game has run or
00234         // the last time the game terminated the level was completed.
00235         // We are waiting for the user to begin the next level.
00236         m_updateState = UpdateEngineState::WaitingForResources;
00237         m_pressResult = PressResultState::PlayLevel;
00238         SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00239         m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00240     }
00241     m_uiControl->ShowGameInfoOverlay();
00242 }
00243
00244 //--------------------------------------------------------------------------------------
00245
00246 void GameMain::WaitingForResourceLoading()
00247 {
00248     static uint32 loadCount = 0;
00249
00250     // Waiting for initial load.  Display an update once per 60 updates.
00251     if (((loadCount++) % 60) == 0)
00252     {
00253         m_loadingCount++;
00254         SetGameInfoOverlay(m_gameInfoOverlayState);
00255         m_renderNeeded = true;
00256     }
00257 }
00258
00259 //--------------------------------------------------------------------------------------
00260
00261 void GameMain::Update()
00262 {
00263     m_controller->Update();
00264
00265     switch (m_updateState)
00266     {
00267     case UpdateEngineState::WaitingForResources:
00268         WaitingForResourceLoading();
00269         break;
00270
00271     case UpdateEngineState::ResourcesLoaded:
00272         switch (m_pressResult)
00273         {
00274         case PressResultState::LoadGame:
00275             SetGameInfoOverlay(GameInfoOverlayState::GameStats);
00276             break;
00277
00278         case PressResultState::PlayLevel:
00279             SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00280             break;
00281
00282         case PressResultState::ContinueLevel:
00283             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00284             break;
00285         }
00286         m_updateState = UpdateEngineState::WaitingForPress;
00287         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00288         m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00289         m_uiControl->ShowGameInfoOverlay();
00290         m_renderNeeded = true;
00291         break;
00292
00293     case UpdateEngineState::WaitingForPress:
00294         if (m_controller->IsPressComplete())
00295         {
00296             switch (m_pressResult)
00297             {
00298             case PressResultState::LoadGame:
00299                 m_updateState = UpdateEngineState::WaitingForResources;
00300                 m_pressResult = PressResultState::PlayLevel;
00301                 m_controller->Active(false);
00302                 m_game->LoadGame();
00303                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00304                 SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00305                 m_uiControl->ShowGameInfoOverlay();
00306
00307                 m_game->LoadLevelAsync().then([this]()
00308                 {
00309                     m_game->FinalizeLoadLevel();
00310                     m_updateState = UpdateEngineState::ResourcesLoaded;
00311                 }, task_continuation_context::use_current());
00312                 break;
00313
00314             case PressResultState::PlayLevel:
00315                 m_updateState = UpdateEngineState::Dynamics;
00316                 m_uiControl->HideGameInfoOverlay();
00317                 m_controller->Active(true);
00318                 m_game->StartLevel();
00319                 break;
00320
00321             case PressResultState::ContinueLevel:
00322                 m_updateState = UpdateEngineState::Dynamics;
00323                 m_uiControl->HideGameInfoOverlay();
00324                 m_controller->Active(true);
00325                 m_game->ContinueGame();
00326                 break;
00327             }
00328         }
00329         break;
00330
00331     case UpdateEngineState::Dynamics:
00332         if (m_controller->IsPauseRequested())
00333         {
00334             m_game->PauseGame();
00335             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00336             m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00337             m_updateState = UpdateEngineState::WaitingForPress;
00338             m_pressResult = PressResultState::ContinueLevel;
00339             m_uiControl->ShowGameInfoOverlay();
00340         }
00341         else
00342         {
00343             GameState runState = m_game->RunGame();
00344             switch (runState)
00345             {
00346             case GameState::TimeExpired:
00347                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00348                 SetGameInfoOverlay(GameInfoOverlayState::GameOverExpired);
00349                 m_uiControl->ShowGameInfoOverlay();
00350                 m_updateState = UpdateEngineState::WaitingForPress;
00351                 m_pressResult = PressResultState::LoadGame;
00352                 break;
00353
00354             case GameState::LevelComplete:
00355                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00356                 SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00357                 m_uiControl->ShowGameInfoOverlay();
00358                 m_updateState = UpdateEngineState::WaitingForResources;
00359                 m_pressResult = PressResultState::PlayLevel;
00360
00361                 m_game->LoadLevelAsync().then([this]()
00362                 {
00363                     m_game->FinalizeLoadLevel();
00364                     m_updateState = UpdateEngineState::ResourcesLoaded;
00365
00366                 }, task_continuation_context::use_current());
00367                 break;
00368
00369             case GameState::GameComplete:
00370                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00371                 SetGameInfoOverlay(GameInfoOverlayState::GameOverCompleted);
00372                 m_uiControl->ShowGameInfoOverlay();
00373                 m_updateState = UpdateEngineState::WaitingForPress;
00374                 m_pressResult = PressResultState::LoadGame;
00375                 break;
00376             }
00377         }
00378
00379         if (m_updateState == UpdateEngineState::WaitingForPress)
00380         {
00381             // Transitioning state, so enable waiting for the press event
00382             m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00383         }
00384         if (m_updateState == UpdateEngineState::WaitingForResources)
00385         {
00386             // Transitioning state, so shut down the input controller until resources are loaded
00387             m_controller->Active(false);
00388         }
00389         break;
00390     }
00391 }
00392
00393 //--------------------------------------------------------------------------------------
00394
00395 void GameMain::CreateWindowSizeDependentResources()
00396 {
00397     UpdateLayoutState();
00398     m_renderer->CreateWindowSizeDependentResources();
00399
00400     // The location of the Control regions may have changed with the size change so update the controller.
00401     auto bounds = m_deviceResources->GetLogicalSize();
00402
00403     m_controller->SetMoveRect(
00404         XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
00405         XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
00406         );
00407     m_controller->SetFireRect(
00408         XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
00409         XMFLOAT2(bounds.Width, bounds.Height)
00410         );
00411
00412     if (m_updateState == UpdateEngineState::WaitingForPress)
00413     {
00414         // A side effect of m_renderer->UpdateForWindowSizeChange() is that the GameInfoOverlay rectangle may have
00415         // changed as a result of layout, so make sure the WaitForPress rectangle is set to the new size.
00416         m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00417     }
00418
00419     m_renderNeeded = true;
00420 }
00421
00422 //--------------------------------------------------------------------------------------
00423
00424 void GameMain::OnDeviceLost()
00425 {
00426     if (m_updateState == UpdateEngineState::Dynamics)
00427     {
00428         // Game is in the active game play state, Stop Game Timer and Pause play and save state
00429         m_game->PauseGame();
00430     }
00431     m_renderNeeded = false;
00432     m_renderer->ReleaseDeviceDependentResources();
00433 }
00434
00435 //--------------------------------------------------------------------------------------
00436
00437 void GameMain::OnDeviceRestored()
00438 {
00439     m_renderer->CreateDeviceDependentResources();
00440     m_renderer->CreateWindowSizeDependentResources();
00441
00442     m_loadingCount = 0;
00443     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00444     SetGameInfoOverlay(GameInfoOverlayState::Loading);
00445     m_updateState = UpdateEngineState::WaitingForResources;
00446     m_renderNeeded = true;
00447
00448     create_task([this]()
00449     {
00450         return m_renderer->CreateGameDeviceResourcesAsync(m_game);
00451
00452     }).then([this]()
00453     {
00454         // The finalize code needs to run in the same thread context
00455         // as the m_renderer object was created because the D3D device context
00456         // can ONLY be accessed on a single thread.
00457         m_renderer->FinalizeCreateGameDeviceResources();
00458
00459         // Reset the main state machine based on the current game state now
00460         // that the device resources have been restored.
00461         InitializeGameState();
00462
00463         if (m_updateState == UpdateEngineState::WaitingForResources)
00464         {
00465             // In the middle of a game so spin up the async task to load the level.
00466             return m_game->LoadLevelAsync().then([this]()
00467             {
00468                 // The m_game object may need to deal with D3D device context work so
00469                 // again the finalize code needs to run in the same thread
00470                 // context as the m_renderer object was created because the D3D
00471                 // device context can ONLY be accessed on a single thread.
00472                 m_game->FinalizeLoadLevel();
00473                 m_game->SetCurrentLevelToSavedState();
00474                 m_updateState = UpdateEngineState::ResourcesLoaded;
00475                 m_renderNeeded = true;
00476
00477             }, task_continuation_context::use_current());
00478         }
00479         else
00480         {
00481             // The game is not in the middle of a level so there aren't any level
00482             // resources to load.  Creating a no-op task so that in both cases
00483             // the same continuation logic is used.
00484             return create_task([]()
00485             {
00486             });
00487         }
00488
00489     }, task_continuation_context::use_current()).then([this]()
00490     {
00491         // Since Device lost is an unexpected event, the app visual state
00492         // may be TooSmall or not have focus.  Put the state machine
00493         // into the correct state to reflect these cases.
00494         if (CoreWindow::GetForCurrentThread()->Bounds.Width < GameConstants::MinPlayableWidth)
00495         {
00496             m_updateStateNext = m_updateState;
00497             m_updateState = UpdateEngineState::TooSmall;
00498             m_controller->Active(false);
00499             m_uiControl->HideGameInfoOverlay();
00500             m_uiControl->ShowTooSmall();
00501             m_renderNeeded = true;
00502         }
00503         else if (!m_haveFocus)
00504         {
00505             m_updateStateNext = m_updateState;
00506             m_updateState = UpdateEngineState::Deactivated;
00507             m_controller->Active(false);
00508             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00509             m_renderNeeded = true;
00510         }
00511     }, task_continuation_context::use_current());
00512 }
00513
00514 //--------------------------------------------------------------------------------------
00515
00516 void GameMain::UpdateLayoutState()
00517 {
00518     m_renderNeeded = true;
00519
00520     if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
00521     {
00522         switch (m_updateState)
00523         {
00524         case UpdateEngineState::Dynamics:
00525             // From Dynamic mode, when coming out of TooSmall layout rather than going directly back into game play
00526             // go to the paused state waiting for user input to continue
00527             m_updateStateNext = UpdateEngineState::WaitingForPress;
00528             m_pressResult = PressResultState::ContinueLevel;
00529             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00530             m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00531             m_game->PauseGame();
00532             break;
00533
00534         case UpdateEngineState::WaitingForResources:
00535             // There is outstanding async loading in progress.  This state change will be picked up after the
00536             // async task is completed.
00537             return;
00538
00539         case UpdateEngineState::WaitingForPress:
00540             // Avoid corrupting the m_updateStateNext on a transition from TooSmall -> TooSmall.
00541             // Otherwise just cache the current state and return to it when leaving TooSmall layout
00542
00543             m_updateStateNext = m_updateState;
00544             break;
00545
00546         default:
00547             break;
00548         }
00549
00550         m_updateState = UpdateEngineState::TooSmall;
00551         m_controller->Active(false);
00552         m_uiControl->HideGameInfoOverlay();
00553         m_uiControl->ShowTooSmall();
00554     }
00555     else
00556     {
00557         if (m_updateState == UpdateEngineState::TooSmall)
00558         {
00559             m_uiControl->HideTooSmall();
00560             m_uiControl->ShowGameInfoOverlay();
00561             m_renderNeeded = true;
00562
00563             if (m_haveFocus)
00564             {
00565                 if (m_updateStateNext == UpdateEngineState::WaitingForPress)
00566                 {
00567                     m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00568                 }
00569                 else if (m_updateStateNext == UpdateEngineState::WaitingForResources)
00570                 {
00571                     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00572                 }
00573
00574                 m_updateState = m_updateStateNext;
00575             }
00576             else
00577             {
00578                 m_updateState = UpdateEngineState::Deactivated;
00579                 m_uiControl->SetAction(GameInfoOverlayCommand::None);
00580             }
00581         }
00582         else if (m_updateState == UpdateEngineState::Dynamics)
00583         {
00584             // In Dynamic mode, when a resize event happens, go to the paused state waiting for user input to continue.
00585             m_pressResult = PressResultState::ContinueLevel;
00586             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00587             m_game->PauseGame();
00588             if (m_haveFocus)
00589             {
00590                 m_updateState = UpdateEngineState::WaitingForPress;
00591                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00592             }
00593             else
00594             {
00595                 m_updateState = UpdateEngineState::Deactivated;
00596                 m_uiControl->SetAction(GameInfoOverlayCommand::None);
00597             }
00598             m_uiControl->ShowGameInfoOverlay();
00599             m_renderNeeded = true;
00600         }
00601     }
00602 }
00603
00604 //--------------------------------------------------------------------------------------
00605
00606 void GameMain::ResetGame()
00607 {
00608     m_updateState = UpdateEngineState::WaitingForResources;
00609     m_pressResult = PressResultState::PlayLevel;
00610     m_controller->Active(false);
00611     m_game->LoadGame();
00612     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00613     SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00614     m_uiControl->ShowGameInfoOverlay();
00615     m_renderNeeded = true;
00616
00617     m_game->LoadLevelAsync().then([this]()
00618     {
00619         m_game->FinalizeLoadLevel();
00620         m_updateState = UpdateEngineState::ResourcesLoaded;
00621         m_renderNeeded = true;
00622
00623     }, task_continuation_context::use_current());
00624 }
00625
00626 //--------------------------------------------------------------------------------------
00627
00628 void GameMain::SetGameInfoOverlay(GameInfoOverlayState state)
00629 {
00630     m_gameInfoOverlayState = state;
00631     switch (state)
00632     {
00633     case GameInfoOverlayState::Loading:
00634         m_uiControl->SetGameLoading(m_loadingCount);
00635         break;
00636
00637     case GameInfoOverlayState::GameStats:
00638         m_uiControl->SetGameStats(
00639             m_game->HighScore().levelCompleted + 1,
00640             m_game->HighScore().totalHits,
00641             m_game->HighScore().totalShots
00642             );
00643         break;
00644
00645     case GameInfoOverlayState::LevelStart:
00646         m_uiControl->SetLevelStart(
00647             m_game->LevelCompleted() + 1,
00648             m_game->CurrentLevel()->Objective(),
00649             m_game->CurrentLevel()->TimeLimit(),
00650             m_game->BonusTime()
00651             );
00652         break;
00653
00654     case GameInfoOverlayState::GameOverCompleted:
00655         m_uiControl->SetGameOver(
00656             true,
00657             m_game->LevelCompleted() + 1,
00658             m_game->TotalHits(),
00659             m_game->TotalShots(),
00660             m_game->HighScore().totalHits
00661             );
00662         break;
00663
00664     case GameInfoOverlayState::GameOverExpired:
00665         m_uiControl->SetGameOver(
00666             false,
00667             m_game->LevelCompleted(),
00668             m_game->TotalHits(),
00669             m_game->TotalShots(),
00670             m_game->HighScore().totalHits
00671             );
00672         break;
00673
00674     case GameInfoOverlayState::Pause:
00675         m_uiControl->SetPause(
00676             m_game->LevelCompleted() + 1,
00677             m_game->TotalHits(),
00678             m_game->TotalShots(),
00679             m_game->TimeRemaining()
00680             );
00681         break;
00682     }
00683 }
00684
00685 //--------------------------------------------------------------------------------------
00686
00687 void GameMain::WindowActivationChanged(CoreWindowActivationState activationState)
00688 {
00689     if (activationState == CoreWindowActivationState::Deactivated)
00690     {
00691         m_haveFocus = false;
00692
00693         switch (m_updateState)
00694         {
00695         case UpdateEngineState::Dynamics:
00696             // From Dynamic mode, when coming out of Deactivated rather than going directly back into game play
00697             // go to the paused state waiting for user input to continue
00698             m_updateStateNext = UpdateEngineState::WaitingForPress;
00699             m_pressResult = PressResultState::ContinueLevel;
00700             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00701             m_uiControl->ShowGameInfoOverlay();
00702             m_game->PauseGame();
00703             m_updateState = UpdateEngineState::Deactivated;
00704             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00705             m_renderNeeded = true;
00706             break;
00707
00708         case UpdateEngineState::WaitingForResources:
00709         case UpdateEngineState::WaitingForPress:
00710             m_updateStateNext = m_updateState;
00711             m_updateState = UpdateEngineState::Deactivated;
00712             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00713             m_uiControl->ShowGameInfoOverlay();
00714             m_renderNeeded = true;
00715             break;
00716         }
00717         // Don't have focus so shutdown input processing
00718         m_controller->Active(false);
00719     }
00720     else if (activationState == CoreWindowActivationState::CodeActivated
00721         || activationState == CoreWindowActivationState::PointerActivated)
00722     {
00723         m_haveFocus = true;
00724
00725         if (m_updateState == UpdateEngineState::Deactivated)
00726         {
00727             m_updateState = m_updateStateNext;
00728
00729             if (m_updateState == UpdateEngineState::WaitingForPress)
00730             {
00731                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00732                 m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00733             }
00734             else if (m_updateStateNext == UpdateEngineState::WaitingForResources)
00735             {
00736                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00737             }
00738         }
00739     }
00740 }
00741
00742 //--------------------------------------------------------------------------------------
00743
00744 void GameMain::Suspend()
00745 {
00746     // Save application state.
00747     switch (m_updateState)
00748     {
00749     case UpdateEngineState::Dynamics:
00750         // Game is in the active game play state, Stop Game Timer and Pause play and save state
00751         m_uiControl->SetAction(GameInfoOverlayCommand::None);
00752         SetGameInfoOverlay(GameInfoOverlayState::Pause);
00753         m_updateStateNext = UpdateEngineState::WaitingForPress;
00754         m_pressResult = PressResultState::ContinueLevel;
00755         m_game->PauseGame();
00756         break;
00757
00758     case UpdateEngineState::WaitingForResources:
00759     case UpdateEngineState::WaitingForPress:
00760         m_updateStateNext = m_updateState;
00761         break;
00762
00763     default:
00764         // any other state don't save as next state as they are trancient states and have already set m_updateStateNext
00765         break;
00766     }
00767     m_updateState = UpdateEngineState::Suspended;
00768
00769     m_controller->Active(false);
00770     m_game->OnSuspending();
00771 }
00772
00773 //--------------------------------------------------------------------------------------
00774
00775 void GameMain::Resume()
00776 {
00777     if (m_haveFocus)
00778     {
00779         m_updateState = m_updateStateNext;
00780     }
00781     else
00782     {
00783         m_updateState = UpdateEngineState::Deactivated;
00784     }
00785
00786     if (m_updateState == UpdateEngineState::WaitingForPress)
00787     {
00788         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00789         m_controller->WaitForPress(m_renderer->GameInfoOverlayUpperLeft(), m_renderer->GameInfoOverlayLowerRight());
00790     }
00791     m_game->OnResuming();
00792     m_uiControl->ShowGameInfoOverlay();
00793     m_renderNeeded = true;
00794 }
00795
00796 //--------------------------------------------------------------------------------------
00797
00798 void GameMain::Visibility(bool visible)
00799 {
00800     if (visible && !m_visible)
00801     {
00802         m_renderNeeded = true;
00803     }
00804     m_visible = visible;
00805 }
00806
00807 //--------------------------------------------------------------------------------------
00808
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameUIConstants.h Source File

  • Simple3DGameDX
  • cppwinrt

GameUIConstants.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace GameInfoOverlayConstant
00015 {
00016     static const float Width = 750.0f;
00017     static const float Height = 380.0f;
00018     static const float TitlePointSize = 32.0f;
00019     static const float TitleHeight = 50.0f;
00020     static const float Separator = 8.0f;
00021     static const float BodyPointSize = 24.0f;
00022     static const float ActionHeight = 40.0f;
00023     static const float TopMargin = 20.0f;
00024     static const float SideMargin = 20.0f;
00025     static const float BottomMargin = 5.0f;
00026 };
00027
00028 namespace GameUIConstants
00029 {
00030     static const float CrossHairHalfSize = 20.0f;
00031     static const float HudSafeWidth = 200.0f;
00032     static const float HudRightOffset = 175.0f;
00033     static const float HudTopOffset = 15.0f;
00034     static const float Margin = 5.0f;
00035     static const float HudBodyPointSize = 20.0f;
00036     static const float HudTitleHeaderPointSize = 16.0f;
00037     static const float HudTitleBodyPointSize = 20.0f;
00038     static const float HudLicensePointSize = 14.0f;
00039
00040     static const float TouchRectangleSize = 125.0f;
00041     static const float MinPlayableWidth = 320.0f;
00042 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/EdgeTappedListView.h Source File

  • XamlListView
  • cppwinrt

EdgeTappedListView.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "ListViewEdgeTappedEventArgs.g.h"
00014 #include "EdgeTappedListView.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct ListViewEdgeTappedEventArgs : ListViewEdgeTappedEventArgsT<ListViewEdgeTappedEventArgs>
00019     {
00020         ListViewEdgeTappedEventArgs(Windows::UI::Xaml::Controls::ListViewItem const& item) : item(item) {}
00021
00022         auto Item() { return item; }
00023
00024     private:
00025         Windows::UI::Xaml::Controls::ListViewItem item;
00026     };
00027
00028     struct EdgeTappedListView : EdgeTappedListViewT<EdgeTappedListView>
00029     {
00030         using ListViewEdgeTappedEventHandler = Windows::Foundation::TypedEventHandler<SDKTemplate::EdgeTappedListView, SDKTemplate::ListViewEdgeTappedEventArgs>;
00031
00032         EdgeTappedListView();
00033
00034         auto IsItemLeftEdgeTapEnabled() { return isItemLeftEdgeTapEnabled; }
00035         void IsItemLeftEdgeTapEnabled(bool value) { isItemLeftEdgeTapEnabled = value; }
00036         auto LeftEdgeBrush() { return leftEdgeBrush; }
00037         void LeftEdgeBrush(Windows::UI::Xaml::Media::Brush const& value) { leftEdgeBrush = value; }
00038         auto ItemLeftEdgeTapped(ListViewEdgeTappedEventHandler const& handler) { return itemLeftEdgeTappedEvent.add(handler); }
00039         void ItemLeftEdgeTapped(event_token const& token) noexcept { return itemLeftEdgeTappedEvent.remove(token); }
00040
00041     private:
00042         bool isItemLeftEdgeTapEnabled = false;
00043         Windows::UI::Xaml::Media::Brush leftEdgeBrush{ nullptr };
00044         event<ListViewEdgeTappedEventHandler> itemLeftEdgeTappedEvent;
00045         Windows::UI::Xaml::Controls::ListViewItem listViewItemHighlighted{ nullptr };
00046         Windows::UI::Xaml::Shapes::Rectangle visualIndicator{ nullptr };
00047
00048         static constexpr double HIT_TARGET = 32;
00049         static constexpr double VISUAL_INDICATOR_WIDTH = 12;
00050         static constexpr wchar_t VISUAL_INDICATOR_NAME[] = L"VisualIndicator";
00051
00052         void OnContainerContentChanging(Windows::UI::Xaml::Controls::ListViewBase const&, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const& args);
00053         void Element_PointerPressed(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00054         void Element_PointerReleased(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const&);
00055         void Element_PointerCaptureLost(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const&);
00056         void Element_PointerExited(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const&);
00057         void ShowVisual();
00058         void ClearVisual();
00059
00060 #pragma region Managing container event tokens
00061
00062         struct ContainerEventTokens : implements<ContainerEventTokens, Windows::Foundation::IInspectable>
00063         {
00064             event_token pointerPressedToken{};
00065             event_token pointerReleasedToken{};
00066             event_token pointerCaptureLostToken{};
00067             event_token pointerExitedToken{};
00068         };
00069
00070         static Windows::UI::Xaml::DependencyProperty s_containerEventTokensProperty;
00071         static void RegisterDependencyPropertiesOnce();
00072
00073 #pragma endregion
00074     };
00075 }
00076 namespace winrt::SDKTemplate::factory_implementation
00077 {
00078     struct EdgeTappedListView : EdgeTappedListViewT<EdgeTappedListView, implementation::EdgeTappedListView>
00079     {
00080     };
00081 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Stroke.h Source File

  • SpatialInteractionSource
  • cpp
  • Content

Stroke.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "ShaderStructures.h"
00005 #include "RenderingInterfaces.h"
00006
00007 namespace HolographicPaint
00008 {
00009
00010     // This class represent a part of a drawing: it is made of squares positioned in 3D space and joined by quadrilaterals.
00011     class Stroke : public IBaseRenderedObject
00012     {
00013     public:
00014
00015         Stroke(Windows::UI::Color color);
00016
00017         void AddPosition(Windows::Foundation::Numerics::float3 position, Windows::Foundation::Numerics::quaternion orientation, float diameter);
00018
00019         virtual void Update(ID3D11DeviceContext* pDeviceContext) override;
00020         virtual void Render(ID3D11DeviceContext* pDeviceContext, IRenderer* pRenderingHelper) override;
00021
00022     private:
00023
00024         ModelConstantBuffer m_modelConstantBufferData;
00025
00026         struct Square
00027         {
00028             DirectX::XMFLOAT3 TopLeft, TopRight, BottomLeft, BottomRight;
00029         };
00030
00031         std::vector<Square> m_squares;
00032         Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
00033         Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer;
00034         uint32 m_indexCount = 0;
00035         bool m_resetBuffers = true;
00036     };
00037 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoFrameProcessor Member List

This is the complete list of members for VideoFrameProcessor, including all inherited members.
CreateAsync(void) | VideoFrameProcessor | [static]
GetCurrentFormat(void) const | VideoFrameProcessor |
GetLatestFrame(void) const | VideoFrameProcessor |
m_latestFrame | VideoFrameProcessor | [protected]
m_mediaCapture | VideoFrameProcessor | [protected]
m_mediaFrameReader | VideoFrameProcessor | [protected]
m_mediaFrameSource | VideoFrameProcessor | [protected]
m_propertiesLock | VideoFrameProcessor | [mutable, protected]
OnFrameArrived(Windows::Media::Capture::Frames::MediaFrameReader^sender, Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^args) | VideoFrameProcessor | [protected]
VideoFrameProcessor(Platform::Agile< Windows::Media::Capture::MediaCapture > mediaCapture, Windows::Media::Capture::Frames::MediaFrameReader^reader, Windows::Media::Capture::Frames::MediaFrameSource^source) | VideoFrameProcessor |
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Advertiser Member List

This is the complete list of members for Scenario1_Advertiser, including all inherited members.
_informationElements | Scenario1_Advertiser | [private]
_listener | Scenario1_Advertiser | [private]
_pendingConnections | Scenario1_Advertiser | [private]
_publisher | Scenario1_Advertiser | [private]
btnAddIe_Click(object sender, RoutedEventArgs e) | Scenario1_Advertiser | [inline, private]
btnCloseDevice_Click(object sender, RoutedEventArgs e) | Scenario1_Advertiser | [inline, private]
btnSendMessage_Click(object sender, RoutedEventArgs e) | Scenario1_Advertiser | [inline, private]
btnStartAdvertisement_Click(object sender, RoutedEventArgs e) | Scenario1_Advertiser | [inline, private]
btnStopAdvertisement_Click(object sender, RoutedEventArgs e) | Scenario1_Advertiser | [inline, private]
ConnectedDevices | Scenario1_Advertiser | [private]
HandleConnectionRequestAsync(WiFiDirectConnectionRequest connectionRequest) | Scenario1_Advertiser | [inline, private]
IsAepPairedAsync(string deviceId) | Scenario1_Advertiser | [inline, private]
OnConnectionRequested(WiFiDirectConnectionListener sender, WiFiDirectConnectionRequestedEventArgs connectionEventArgs) | Scenario1_Advertiser | [inline, private]
OnConnectionStatusChanged(WiFiDirectDevice sender, object arg) | Scenario1_Advertiser | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_Advertiser | [inline, protected]
OnSocketConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args) | Scenario1_Advertiser | [inline, private]
OnStatusChanged(WiFiDirectAdvertisementPublisher sender, WiFiDirectAdvertisementPublisherStatusChangedEventArgs statusEventArgs) | Scenario1_Advertiser | [inline, private]
rootPage | Scenario1_Advertiser | [private]
Scenario1_Advertiser() | Scenario1_Advertiser | [inline]
StopAdvertisement() | Scenario1_Advertiser | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/SampleConfiguration.cs Source File

  • BluetoothRfcommChat
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Bluetooth Rfcomm Chat Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario()
00025             {
00026                 Title = "Chat Client",
00027                 ClassType = typeof(Scenario1_ChatClient)
00028             },
00029             new Scenario()
00030             {
00031                 Title = "Foreground Chat Server",
00032                 ClassType = typeof(Scenario2_ChatServer)
00033             },
00034             new Scenario()
00035             {
00036                 Title = "Background Chat Server",
00037                 ClassType = typeof(Scenario3_BgChatServer)
00038             },
00039         };
00040     }
00041
00042     public class Scenario
00043     {
00044         public string Title { get; set; }
00045         public Type ClassType { get; set; }
00046     }
00047
00048     /// <summary>
00049     /// Class containing Attributes and UUIDs that will populate the SDP record.
00050     /// </summary>
00051     class Constants
00052     {
00053         // The Chat Server's custom service Uuid: 34B1CF4D-1069-4AD6-89B6-E161D79BE4D8
00054         public static readonly Guid RfcommChatServiceUuid = Guid.Parse("34B1CF4D-1069-4AD6-89B6-E161D79BE4D8");
00055
00056         // The Id of the Service Name SDP attribute
00057         public const UInt16 SdpServiceNameAttributeId = 0x100;
00058
00059         // The SDP Type of the Service Name SDP attribute.
00060         // The first byte in the SDP Attribute encodes the SDP Attribute Type as follows :
00061         //    -  the Attribute Type size in the least significant 3 bits,
00062         //    -  the SDP Attribute Type value in the most significant 5 bits.
00063         public const byte SdpServiceNameAttributeType = (4 << 3) | 5;
00064
00065         // The value of the Service Name SDP attribute
00066         public const string SdpServiceName = "Bluetooth Rfcomm Chat Service";
00067     }
00068 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario3.xaml.h Source File

  • ApplicationResources
  • cpp

scenario3.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3.xaml.h
00013 // Declaration of the Scenario3 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario3.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario3 sealed
00030         {
00031         public:
00032             Scenario3();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         private:
00037             MainPage^ rootPage;
00038             void Scenario3Button_Show_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         };
00040
00041 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileExtensions Member List

This is the complete list of members for FileExtensions, including all inherited members.
Document() | FileExtensions | [static]
Image() | FileExtensions | [static]
Music() | FileExtensions | [static]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/Scenario1_DataEvents.xaml.h Source File

  • LightSensor
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Sensors::LightSensor^ sensor;
00041         Windows::Foundation::EventRegistrationToken visibilityToken;
00042         Windows::Foundation::EventRegistrationToken readingToken;
00043         uint32 desiredReportInterval;
00044
00045         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00046         void ReadingChanged(Windows::Devices::Sensors::LightSensor^ sender, Windows::Devices::Sensors::LightSensorReadingChangedEventArgs^ e);
00047         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DeviceResources.cpp Source File

  • HolographicMixedRealityCapture
  • cpp
  • Common

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿
00002 #include "pch.h"
00003 #include "DeviceResources.h"
00004 #include "DirectXHelper.h"
00005
00006 #include <Collection.h>
00007 #include <windows.graphics.directx.direct3d11.interop.h>
00008
00009 using namespace D2D1;
00010 using namespace Microsoft::WRL;
00011 using namespace Windows::Graphics::DirectX::Direct3D11;
00012 using namespace Windows::Graphics::Display;
00013 using namespace Windows::Graphics::Holographic;
00014
00015 static const std::wstring s_VertexShaderFiles[DX::VertexShader_Max] =
00016 {
00017     L"ms-appx:///VertexShader.cso",
00018     L"ms-appx:///VertexShaderTexture.cso",
00019 };
00020
00021 static const std::wstring s_VprtVertexShaderFiles[DX::VertexShader_Max] =
00022 {
00023     L"ms-appx:///VprtVertexShader.cso",
00024     L"ms-appx:///VprtVertexShaderTexture.cso"
00025 };
00026
00027 static const std::wstring s_PixelShaderFiles[DX::PixelShader_Max] =
00028 {
00029     L"ms-appx:///PixelShader.cso",
00030     L"ms-appx:///PixelShaderCursor.cso",
00031     L"ms-appx:///PixelShaderTexture.cso",
00032 };
00033
00034 static const std::wstring s_GeometryShaderFiles[DX::GeometryShader_Max] =
00035 {
00036     L"ms-appx:///GeometryShader.cso",
00037     L"ms-appx:///GeometryShaderTexture.cso"
00038 };
00039
00040 static const std::wstring s_TextureFiles[DX::Texture_Max] =
00041 {
00042     L"ms-appx:////Assets//Cursor.png",
00043     L"ms-appx:////Assets//Init.png",
00044     L"ms-appx:////Assets//Hologram.png",
00045     L"ms-appx:////Assets//SysAudio.png",
00046     L"ms-appx:////Assets//Photo.png",
00047     L"ms-appx:////Assets//Video.png"
00048 };
00049
00050 // Constructor for DeviceResources.
00051 DX::DeviceResources::DeviceResources()
00052 {
00053     CreateDeviceIndependentResources();
00054 }
00055
00056 // Configures resources that don't depend on the Direct3D device.
00057 void DX::DeviceResources::CreateDeviceIndependentResources()
00058 {
00059     // Initialize Direct2D resources.
00060     D2D1_FACTORY_OPTIONS options {};
00061
00062 #if defined(_DEBUG)
00063     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00064     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00065 #endif
00066
00067     // Initialize the Direct2D Factory.
00068     DX::ThrowIfFailed(
00069         D2D1CreateFactory(
00070             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00071             __uuidof(ID2D1Factory2),
00072             &options,
00073             &m_d2dFactory
00074             )
00075         );
00076
00077     // Initialize the DirectWrite Factory.
00078     DX::ThrowIfFailed(
00079         DWriteCreateFactory(
00080             DWRITE_FACTORY_TYPE_SHARED,
00081             __uuidof(IDWriteFactory2),
00082             &m_dwriteFactory
00083             )
00084         );
00085
00086     // Initialize the Windows Imaging Component (WIC) Factory.
00087     DX::ThrowIfFailed(
00088         CoCreateInstance(
00089             CLSID_WICImagingFactory2,
00090             nullptr,
00091             CLSCTX_INPROC_SERVER,
00092             IID_PPV_ARGS(&m_wicFactory)
00093             )
00094         );
00095 }
00096
00097 Concurrency::task<void> DX::DeviceResources::SetHolographicSpace(HolographicSpace^ holographicSpace)
00098 {
00099     // Cache the holographic space. Used to re-initalize during device-lost scenarios.
00100     m_holographicSpace = holographicSpace;
00101
00102     InitializeUsingHolographicSpace();
00103
00104     return LoadShaders();
00105 }
00106
00107 void DX::DeviceResources::InitializeUsingHolographicSpace()
00108 {
00109     // The holographic space might need to determine which adapter supports
00110     // holograms, in which case it will specify a non-zero PrimaryAdapterId.
00111     LUID id =
00112     {
00113         m_holographicSpace->PrimaryAdapterId.LowPart,
00114         m_holographicSpace->PrimaryAdapterId.HighPart
00115     };
00116
00117     // When a primary adapter ID is given to the app, the app should find
00118     // the corresponding DXGI adapter and use it to create Direct3D devices
00119     // and device contexts. Otherwise, there is no restriction on the DXGI
00120     // adapter the app can use.
00121     if ((id.HighPart != 0) && (id.LowPart != 0))
00122     {
00123         UINT createFlags = 0;
00124 #ifdef DEBUG
00125         if (DX::SdkLayersAvailable())
00126         {
00127             createFlags |= DXGI_CREATE_FACTORY_DEBUG;
00128         }
00129 #endif
00130         // Create the DXGI factory.
00131         ComPtr<IDXGIFactory1> dxgiFactory;
00132         DX::ThrowIfFailed(
00133             CreateDXGIFactory2(
00134                 createFlags,
00135                 IID_PPV_ARGS(&dxgiFactory)
00136                 )
00137             );
00138         ComPtr<IDXGIFactory4> dxgiFactory4;
00139         DX::ThrowIfFailed(dxgiFactory.As(&dxgiFactory4));
00140
00141         // Retrieve the adapter specified by the holographic space.
00142         DX::ThrowIfFailed(
00143             dxgiFactory4->EnumAdapterByLuid(
00144                 id,
00145                 IID_PPV_ARGS(&m_dxgiAdapter)
00146                 )
00147             );
00148     }
00149     else
00150     {
00151         m_dxgiAdapter.Reset();
00152     }
00153
00154     CreateDeviceResources();
00155
00156     m_holographicSpace->SetDirect3D11Device(m_d3dInteropDevice);
00157 }
00158
00159 // Configures the Direct3D device, and stores handles to it and the device context.
00160 void DX::DeviceResources::CreateDeviceResources()
00161 {
00162     // This flag adds support for surfaces with a different color channel ordering
00163     // than the API default. It is required for compatibility with Direct2D.
00164     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00165
00166 #if defined(_DEBUG)
00167     if (DX::SdkLayersAvailable())
00168     {
00169         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00170         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00171     }
00172 #endif
00173
00174     // This array defines the set of DirectX hardware feature levels this app will support.
00175     // Note the ordering should be preserved.
00176     // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
00177     // of running on graphics cards starting with feature level 10.0.
00178     D3D_FEATURE_LEVEL featureLevels [] =
00179     {
00180         D3D_FEATURE_LEVEL_12_1,
00181         D3D_FEATURE_LEVEL_12_0,
00182         D3D_FEATURE_LEVEL_11_1,
00183         D3D_FEATURE_LEVEL_11_0,
00184         D3D_FEATURE_LEVEL_10_1,
00185         D3D_FEATURE_LEVEL_10_0
00186     };
00187
00188     // Create the Direct3D 11 API device object and a corresponding context.
00189     ComPtr<ID3D11Device> device;
00190     ComPtr<ID3D11DeviceContext> context;
00191
00192     const HRESULT hr = D3D11CreateDevice(
00193         m_dxgiAdapter.Get(),        // Either nullptr, or the primary adapter determined by Windows Holographic.
00194         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00195         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00196         creationFlags,              // Set debug and Direct2D compatibility flags.
00197         featureLevels,              // List of feature levels this app can support.
00198         ARRAYSIZE(featureLevels),   // Size of the list above.
00199         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00200         &device,                    // Returns the Direct3D device created.
00201         &m_d3dFeatureLevel,         // Returns feature level of device created.
00202         &context                    // Returns the device immediate context.
00203         );
00204
00205     if (FAILED(hr))
00206     {
00207         // If the initialization fails, fall back to the WARP device.
00208         // For more information on WARP, see:
00209         // http://go.microsoft.com/fwlink/?LinkId=286690
00210         DX::ThrowIfFailed(
00211             D3D11CreateDevice(
00212                 nullptr,              // Use the default DXGI adapter for WARP.
00213                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00214                 0,
00215                 creationFlags,
00216                 featureLevels,
00217                 ARRAYSIZE(featureLevels),
00218                 D3D11_SDK_VERSION,
00219                 &device,
00220                 &m_d3dFeatureLevel,
00221                 &context
00222                 )
00223             );
00224     }
00225
00226     // Store pointers to the Direct3D device and immediate context.
00227     DX::ThrowIfFailed(
00228         device.As(&m_d3dDevice)
00229         );
00230
00231     DX::ThrowIfFailed(
00232         context.As(&m_d3dContext)
00233         );
00234
00235     // Acquire the DXGI interface for the Direct3D device.
00236     ComPtr<IDXGIDevice3> dxgiDevice;
00237     DX::ThrowIfFailed(
00238         m_d3dDevice.As(&dxgiDevice)
00239         );
00240
00241     // Wrap the native device using a WinRT interop object.
00242     m_d3dInteropDevice = CreateDirect3DDevice(dxgiDevice.Get());
00243
00244     // Cache the DXGI adapter.
00245     // This is for the case of no preferred DXGI adapter, or fallback to WARP.
00246     ComPtr<IDXGIAdapter> dxgiAdapter;
00247     DX::ThrowIfFailed(
00248         dxgiDevice->GetAdapter(&dxgiAdapter)
00249         );
00250     DX::ThrowIfFailed(
00251         dxgiAdapter.As(&m_dxgiAdapter)
00252         );
00253
00254     // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
00255     D3D11_FEATURE_DATA_D3D11_OPTIONS3 options;
00256     m_d3dDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS3, &options, sizeof(options));
00257     if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
00258     {
00259         m_supportsVprt = true;
00260     }
00261 }
00262
00263 // Validates the back buffer for each HolographicCamera and recreates
00264 // resources for back buffers that have changed.
00265 // Locks the set of holographic camera resources until the function exits.
00266 void DX::DeviceResources::EnsureCameraResources(
00267     HolographicFrame^ frame,
00268     HolographicFramePrediction^ prediction)
00269 {
00270     UseHolographicCameraResources<void>([this, frame, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00271     {
00272         for (HolographicCameraPose^ pose : prediction->CameraPoses)
00273         {
00274             HolographicCameraRenderingParameters^ renderingParameters = frame->GetRenderingParameters(pose);
00275             CameraResources* pCameraResources = cameraResourceMap[pose->HolographicCamera->Id].get();
00276
00277             pCameraResources->CreateResourcesForBackBuffer(this, renderingParameters);
00278         }
00279     });
00280 }
00281
00282 // Prepares to allocate resources and adds resource views for a camera.
00283 // Locks the set of holographic camera resources until the function exits.
00284 void DX::DeviceResources::AddHolographicCamera(HolographicCamera^ camera)
00285 {
00286     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00287     {
00288         cameraResourceMap[camera->Id] = std::make_unique<CameraResources>(camera);
00289     });
00290 }
00291
00292 // Deallocates resources for a camera and removes the camera from the set.
00293 // Locks the set of holographic camera resources until the function exits.
00294 void DX::DeviceResources::RemoveHolographicCamera(HolographicCamera^ camera)
00295 {
00296     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00297     {
00298         CameraResources* pCameraResources = cameraResourceMap[camera->Id].get();
00299
00300         if (pCameraResources != nullptr)
00301         {
00302             pCameraResources->ReleaseResourcesForBackBuffer(this);
00303             cameraResourceMap.erase(camera->Id);
00304         }
00305     });
00306 }
00307
00308 // Recreate all device resources and set them back to the current state.
00309 // Locks the set of holographic camera resources until the function exits.
00310 void DX::DeviceResources::HandleDeviceLost()
00311 {
00312     if (m_deviceNotify != nullptr)
00313     {
00314         m_deviceNotify->OnDeviceLost();
00315     }
00316
00317     UseHolographicCameraResources<void>([this](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00318     {
00319         for (auto& pair : cameraResourceMap)
00320         {
00321             CameraResources* pCameraResources = pair.second.get();
00322             pCameraResources->ReleaseResourcesForBackBuffer(this);
00323         }
00324     });
00325
00326     InitializeUsingHolographicSpace();
00327
00328     LoadShaders().then([this]()
00329     {
00330         if (m_deviceNotify != nullptr)
00331         {
00332             m_deviceNotify->OnDeviceRestored();
00333         }
00334     });
00335 }
00336
00337 // Register our DeviceNotify to be informed on device lost and creation.
00338 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00339 {
00340     m_deviceNotify = deviceNotify;
00341 }
00342
00343 // Call this method when the app suspends. It provides a hint to the driver that the app
00344 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00345 void DX::DeviceResources::Trim()
00346 {
00347     m_d3dContext->ClearState();
00348
00349     ComPtr<IDXGIDevice3> dxgiDevice;
00350     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00351     dxgiDevice->Trim();
00352 }
00353
00354 // Present the contents of the swap chain to the screen.
00355 // Locks the set of holographic camera resources until the function exits.
00356 void DX::DeviceResources::Present(HolographicFrame^ frame)
00357 {
00358     // By default, this API waits for the frame to finish before it returns.
00359     // Holographic apps should wait for the previous frame to finish before
00360     // starting work on a new frame. This allows for better results from
00361     // holographic frame predictions.
00362     HolographicFramePresentResult presentResult = frame->PresentUsingCurrentPrediction();
00363
00364     HolographicFramePrediction^ prediction = frame->CurrentPrediction;
00365     UseHolographicCameraResources<void>([this, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00366     {
00367         for (auto cameraPose : prediction->CameraPoses)
00368         {
00369             // This represents the device-based resources for a HolographicCamera.
00370             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00371
00372             // Discard the contents of the render target.
00373             // This is a valid operation only when the existing contents will be
00374             // entirely overwritten. If dirty or scroll rects are used, this call
00375             // should be removed.
00376             m_d3dContext->DiscardView(pCameraResources->GetBackBufferRenderTargetView());
00377
00378             // Discard the contents of the depth stencil.
00379             m_d3dContext->DiscardView(pCameraResources->GetDepthStencilView());
00380         }
00381     });
00382
00383     // The PresentUsingCurrentPrediction API will detect when the graphics device
00384     // changes or becomes invalid. When this happens, it is considered a Direct3D
00385     // device lost scenario.
00386     if (presentResult == HolographicFramePresentResult::DeviceRemoved)
00387     {
00388         // The Direct3D device, context, and resources should be recreated.
00389         HandleDeviceLost();
00390     }
00391 }
00392
00393 Concurrency::task<void> DX::DeviceResources::LoadShaders()
00394 {
00395     std::vector<Concurrency::task<void>> shaderTaskGroup;
00396
00397     // Load vertex shaders and input layouts
00398     for (int i = 0; i < VertexShader_Max; i++)
00399     {
00400         Concurrency::task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(m_supportsVprt ? s_VprtVertexShaderFiles[i] : s_VertexShaderFiles[i]);
00401
00402         Concurrency::task<void> createVSTask = loadVSTask.then([this, i](const std::vector<byte>& fileData)
00403         {
00404             DX::ThrowIfFailed(
00405                 m_d3dDevice->CreateVertexShader(
00406                     &fileData[0],
00407                     fileData.size(),
00408                     nullptr,
00409                     m_vertexShaders[i].ReleaseAndGetAddressOf()));
00410
00411             switch (i)
00412             {
00413             case VertexShader_Simple:
00414                 {
00415                     const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
00416                     {
00417                         { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,                            0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00418                         { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00419                     };
00420
00421                     DX::ThrowIfFailed(
00422                         m_d3dDevice->CreateInputLayout(
00423                             vertexDesc,
00424                             ARRAYSIZE(vertexDesc),
00425                             &fileData[0],
00426                             fileData.size(),
00427                             m_inputLayouts[i].ReleaseAndGetAddressOf()));
00428                 }
00429                 break;
00430             case VertexShader_Texture:
00431                 {
00432                     const D3D11_INPUT_ELEMENT_DESC vertexDesc[] =
00433                     {
00434                         { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,                            0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00435                         { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00436                     };
00437
00438                     DX::ThrowIfFailed(
00439                         m_d3dDevice->CreateInputLayout(
00440                             vertexDesc,
00441                             ARRAYSIZE(vertexDesc),
00442                             &fileData[0],
00443                             fileData.size(),
00444                             m_inputLayouts[i].ReleaseAndGetAddressOf()));
00445                 }
00446                 break;
00447             }
00448         });
00449
00450         shaderTaskGroup.push_back(createVSTask);
00451     }
00452
00453     // Load pixel shaders
00454     for (int i = 0; i < PixelShader_Max; i++)
00455     {
00456         Concurrency::task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(s_PixelShaderFiles[i]);
00457
00458         Concurrency::task<void> createPSTask = loadPSTask.then([this, i](const std::vector<byte>& fileData)
00459         {
00460             DX::ThrowIfFailed(
00461                 m_d3dDevice->CreatePixelShader(
00462                     &fileData[0],
00463                     fileData.size(),
00464                     nullptr,
00465                     m_pixelShaders[i].ReleaseAndGetAddressOf()));
00466         });
00467
00468         shaderTaskGroup.push_back(createPSTask);
00469     }
00470
00471     // Load geometry shaders
00472     for (int i = 0; i < GeometryShader_Max; i++)
00473     {
00474         Concurrency::task<std::vector<byte>> loadGSTask = DX::ReadDataAsync(s_GeometryShaderFiles[i]);
00475
00476         Concurrency::task<void> createGSTask = loadGSTask.then([this, i](const std::vector<byte>& fileData)
00477         {
00478             DX::ThrowIfFailed(
00479                 m_d3dDevice->CreateGeometryShader(
00480                     &fileData[0],
00481                     fileData.size(),
00482                     nullptr,
00483                     m_geometryShaders[i].ReleaseAndGetAddressOf()));
00484         });
00485
00486         shaderTaskGroup.push_back(createGSTask);
00487     }
00488
00489     // Load textures
00490     for (int i = 0; i < Texture_Max; i++)
00491     {
00492         Concurrency::task<std::vector<byte>> loadTextureTask = DX::ReadDataAsync(s_TextureFiles[i]);
00493
00494         Concurrency::task<void> createTextureTask = loadTextureTask.then([this, i](const std::vector<byte>& fileData)
00495         {
00496             DX::ThrowIfFailed(
00497                 DX::CreateWICTextureFromMemory(
00498                     m_d3dDevice.Get(),
00499                     &fileData[0],
00500                     fileData.size(),
00501                     m_textures[i].ReleaseAndGetAddressOf(),
00502                     nullptr));
00503         });
00504
00505         shaderTaskGroup.push_back(createTextureTask);
00506     }
00507
00508     return when_all(std::begin(shaderTaskGroup), std::end(shaderTaskGroup));
00509 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/SampleConfiguration.cpp Source File

  • FullScreenMode
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Entering and exiting full screen mode", "SDKTemplate.Scenario1_Basic" },
00021     { "Launching into full screen mode", "SDKTemplate.Scenario2_Launch" },
00022 };
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/SampleConfiguration.cpp Source File

  • XmlLite
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "XmlLite Reader", "SDKTemplate.XmlLite.Scenario1" },
00021     { "Write XML with XmlWriter", "SDKTemplate.XmlLite.Scenario2" },
00022     { "Write XML with XmlWriterLite", "SDKTemplate.XmlLite.Scenario3" }
00023 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario12 Member List

This is the complete list of members for Scenario12, including all inherited members.
AddAnimatedTilesClick(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario12 | [inline, private]
ClearMapClick(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario12 | [inline, private]
HttpMapTileDataSourceUriRequested(HttpMapTileDataSource sender, MapTileUriRequestedEventArgs args) | Scenario12 | [inline, private]
httpTileSource | Scenario12 | [private]
MyMapLoaded(object sender, RoutedEventArgs e) | Scenario12 | [inline, private]
OnDrawingAttributesChanged(InkToolbar sender, object args) | Scenario12 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario12 | [inline, protected]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario12 | [inline, private]
PauseAnimationTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) | Scenario12 | [inline, private]
PlayAnimationTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) | Scenario12 | [inline, private]
rootPage | Scenario12 | [private]
Scenario12() | Scenario12 | [inline]
Scenario12() | Scenario12 | [inline]
Scenario12() | Scenario12 | [inline]
Scenario12Button_Show_Click(object sender, RoutedEventArgs e) | Scenario12 | [inline, private]
StopAnimationTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) | Scenario12 | [inline, private]
timestamps | Scenario12 | [private]
urlTemplate | Scenario12 | [private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/Properties/AssemblyInfo.cs Source File

  • XamlMasterDetail
  • cs
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("NotesApp")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("NotesApp")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario13.xaml.cs Source File

  • ApplicationResources
  • cs

scenario13.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.ApplicationModel.Resources.Core;
00018 using System.Threading.Tasks;
00019 using Windows.Storage;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario13 : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031
00032         public Scenario13()
00033         {
00034             this.InitializeComponent();
00035             DXFLOptionCombo.SelectedIndex = 0;
00036         }
00037
00038         /// <summary>
00039         /// Invoked when this page is about to be displayed in a Frame.
00040         /// </summary>
00041         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00042         /// property is typically used to configure the page.</param>
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045         }
00046
00047
00048         private async void DXFLOptionCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
00049         {
00050             ComboBox combo = sender as ComboBox;
00051
00052             // Setting the DXFeatureLevel qualifier value on all default contexts. This is needed
00053             // since the async operation to retrive appdata.dat as a StorageFile object will happen
00054             // on a background thread. This is the only way to set the qualifier on a default context
00055             // used in a background  thread.
00056
00057             // In a different scenario, rather than obtaining a StorageFile object, another approach
00058             // that could be used would be to use the ResourceMap.GetValue method to get the resolved
00059             // resource candidate, and from that get the absolute file path. In that approach, the
00060             // GetValue method takes a ResourceContext parameter, and so it would be possible to set
00061             // the DXFeatureLevel qualifier value on a specific context rather than setting it in all
00062             // contexts within the app.
00063
00064             ResourceContext.SetGlobalQualifierValue("dxfeaturelevel", combo.SelectedValue.ToString());
00065
00066             // setting up the resource URI -- an ms-appx URI will be used to access the resource using
00067             // a StorageFile method
00068
00069             // In a different scenario, rather than obtaining a StorageFile object, the
00070             // ResourceMap.GetValue method could be used to get the resolved candidate, from which an
00071             // absolute file path could be obtained. However, resource references used by the APIs in
00072             // Windows.ApplicationModel.Resources and Windows.ApplicationModel.Resources.Core use
00073             // ms-resource URIs, not ms-appx URIs. Within a resource map, files are always organized
00074             // under a "Files" top-level subtree. The ms-resource URI string for the file being accessed
00075             // here would be "ms-resource:///Files/appdata/appdata.dat".
00076
00077             // The URI string "ms-appx:///..." is rooted at the app package root.
00078             Uri uri = new Uri("ms-appx:///appdata/appdata.dat");
00079
00080             // The resource candidate will be resolved during the call to GetFileFromApplicationUriAsync
00081             // using the default context from a background thread.
00082
00083             // File IO uses asynchronous techniques. For more info, see
00084             // http://msdn.microsoft.com/en-us/library/windows/apps/hh464924.aspx
00085
00086             StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
00087             string content = await FileIO.ReadTextAsync(file);
00088             ResultText.Text = content;
00089         }
00090
00091
00092     } // end of class
00093 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/MeshGeometry.h Source File

  • 360VideoPlayback
  • cpp
  • Common

MeshGeometry.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "..\Content\ShaderStructures.h"
00003 namespace DX
00004 {
00005     struct MeshGeometry
00006     {
00007     public:
00008         const D3D11_PRIMITIVE_TOPOLOGY Topology;
00009         const Microsoft::WRL::ComPtr<ID3D11Buffer> VertexBuffer;
00010         const Microsoft::WRL::ComPtr<ID3D11Buffer> IndexBuffer;
00011         const uint32 VertexStride;
00012         const uint32 IndexCount;
00013
00014         static std::shared_ptr<MeshGeometry> MakeTexturedCube();
00015         static std::shared_ptr<MeshGeometry> MakeTexturedCylinder(unsigned short tessellation);
00016
00017         MeshGeometry(
00018             D3D11_PRIMITIVE_TOPOLOGY topology,
00019             const Microsoft::WRL::ComPtr<ID3D11Buffer>& vertexBuffer,
00020             const Microsoft::WRL::ComPtr<ID3D11Buffer>& indexBuffer,
00021             uint32 vertexStride,
00022             uint32 indexCount) :
00023                 Topology(topology),
00024                 VertexBuffer(vertexBuffer),
00025                 IndexBuffer(indexBuffer),
00026                 VertexStride(vertexStride),
00027                 IndexCount(indexCount)
00028         {
00029         }
00030
00031     private:
00032         static Microsoft::WRL::ComPtr<ID3D11Buffer> CreateVertexBuffer(unsigned int numVertices, const _360VideoPlayback::VertexPositionTexture* vertexData);
00033         static Microsoft::WRL::ComPtr<ID3D11Buffer> CreateIndexBuffer(unsigned int numIndices, const unsigned short* indexData);
00034
00035         static std::vector<_360VideoPlayback::VertexPositionTexture> MakeCylinderFaceVertices(unsigned short tessellation, float z, std::function<DirectX::XMFLOAT2(float x, float y)> uvGenerator);
00036         static std::vector<unsigned short> MakeCylinderFaceIndices(unsigned short tessellation, unsigned short vertexIndexOffset, unsigned short centerVertexIndex, bool isFrontFace);
00037         static std::vector<unsigned short> MakeCylinderSideIndices(unsigned short tessellation, unsigned short vertexIndexOffset, unsigned short cylinderFaceVertexStride);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/pch.h Source File

  • CustomHidDeviceAccess
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/ForegroundWithAppOpen/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • ForegroundWithAppOpen

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using System;
00003 using Windows.ApplicationModel.Activation;
00004 using Windows.ApplicationModel.Core;
00005 using Windows.Foundation.Collections;
00006 using Windows.UI.Notifications;
00007 using Windows.UI.Popups;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010
00011 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00012
00013 namespace Notifications.ScenarioPages.Toasts.ActivationTypes.ForegroundWithAppOpen
00014 {
00015     /// <summary>
00016     /// An empty page that can be used on its own or navigated to within a Frame.
00017     /// </summary>
00018     public sealed partial class ScenarioElement : UserControl
00019     {
00020         public ScenarioElement()
00021         {
00022             this.InitializeComponent();
00023
00024             Initialize();
00025         }
00026
00027         private void Initialize()
00028         {
00029             // Clear all existing notifications
00030             ToastNotificationManager.History.Clear();
00031
00032             // Listen to activation event
00033             (Application.Current as App).Activated = new EventHandler<IActivatedEventArgs>(App_Activated);
00034
00035             // Pop notifications
00036             popToastControl.Payload =
00037                 $@"
00038                 <toast activationType='foreground' launch='args'>
00039                     <visual>
00040                         <binding template='ToastGeneric'>
00041                             <text>Foreground with App Open</text>
00042                             <text>Make sure ""Windows 10"" is in the first text box. Press ""submit"".</text>
00043                         </binding>
00044                     </visual>
00045                     <actions>
00046
00047                         <input
00048                             id = 'message'
00049                             type = 'text'
00050                             title = 'Message'
00051                             placeHolderContent = 'Enter ""Windows 10""'
00052                             defaultInput = 'Windows 10' />
00053
00054                         <action activationType = 'foreground'
00055                                 arguments = 'quickReply'
00056                                 content = 'submit' />
00057
00058                         <action activationType = 'foreground'
00059                                 arguments = 'cancel'
00060                                 content = 'cancel' />
00061
00062                     </actions>
00063                 </toast>";
00064         }
00065
00066         private async void App_Activated(object sender, IActivatedEventArgs e)
00067         {
00068             await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
00069             {
00070                 if (e.Kind != ActivationKind.ToastNotification)
00071                     return;
00072
00073                 var toastArgs = e as ToastNotificationActivatedEventArgs;
00074                 if (toastArgs == null)
00075                 {
00076                     Error("Activation args was not of type ToastNotificationActivatedEventArgs");
00077                     return;
00078                 }
00079
00080                 string arguments = toastArgs.Argument;
00081
00082                 if (arguments == null || !arguments.Equals("quickReply"))
00083                 {
00084                     Error($"Expected arguments to be 'quickReply' but was '{arguments}'. User input values...\n{ToastHelper.ToString(toastArgs.UserInput)}");
00085                     return;
00086                 }
00087
00088                 switch (stepsControl.Step)
00089                 {
00090                     case 1:
00091                         validateStep1(toastArgs.UserInput);
00092                         break;
00093                 }
00094             });
00095         }
00096
00097         private async void Error(string message)
00098         {
00099             await new MessageDialog(message, "ERROR").ShowAsync();
00100         }
00101
00102         private void validateStep1(ValueSet result)
00103         {
00104             if (result.Count != 1)
00105                 Error("Expected 1 user input value, but there were " + result.Count);
00106
00107             else if (!result.ContainsKey("message"))
00108                 Error("Expected a user input value for 'message', but there was none.");
00109
00110             else if (!(result["message"] as string).Equals("Windows 10"))
00111                 Error("User input value for 'message' was not 'Windows 10'");
00112
00113             else
00114             {
00115                 stepsControl.Step = int.MaxValue;
00116             }
00117         }
00118     }
00119 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_LaunchedFromSecondaryTile Member List

This is the complete list of members for Scenario5_LaunchedFromSecondaryTile, including all inherited members.
rootPage | Scenario5_LaunchedFromSecondaryTile | [private]
Scenario5_LaunchedFromSecondaryTile() | Scenario5_LaunchedFromSecondaryTile | [inline]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

YangContainer Member List

This is the complete list of members for YangContainer, including all inherited members.
_parent | YangContainer | [private]
_value | YangContainer | [private]
NotifyPropertyChanged([CallerMemberName] string propertyName="") | YangContainer | [inline, private]
NotifyPropertyChanged([CallerMemberName] string propertyName="") | YangContainer | [inline, private]
PropertyChanged | YangContainer |
Value | YangContainer |
YangContainer(DOModel parent) | YangContainer | [inline]
YangContainer(DOModel parent) | YangContainer | [inline]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/SampleConfiguration.h Source File

  • CameraProfile
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "CameraProfile";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S5_AddWithAppContent.xaml.h Source File

  • ContentIndexer
  • cpp

S5_AddWithAppContent.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S5_AddWithAppContent.xaml.h
00014 // Declaration of the S5_AddWithAppContent class
00015 //
00016
00017 #pragma once
00018 #include "S5_AddWithAppContent.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S5_AddWithAppContent sealed
00023     {
00024     public:
00025         S5_AddWithAppContent();
00026
00027     private:
00028         void AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.h Source File

  • UserConsentVerifier
  • cppwinrt

Scenario2_RequestConsent.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_RequestConsent.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_RequestConsent : Scenario2_RequestConsentT<Scenario2_RequestConsent>
00019     {
00020         Scenario2_RequestConsent();
00021
00022         fire_and_forget RequestConsent_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario2_RequestConsent : Scenario2_RequestConsentT<Scenario2_RequestConsent, implementation::Scenario2_RequestConsent>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewModelBase Member List

This is the complete list of members for ViewModelBase, including all inherited members.
NotifyPropertyChanged(string propertyName) | ViewModelBase | [inline, protected]
PropertyChanged | ViewModelBase |
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Controls/ContextMenuFlyout.xaml.h Source File

  • ComplexInk
  • cpp
  • Controls

ContextMenuFlyout.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Controls\ContextMenuFlyout.g.h"
00006 #include "..\Renderers\SceneComposer.h"
00007
00008 #define PASTE_ITEM_INDEX    4 // Paste is the last item in the flyout counting the separators
00009
00010 namespace SDKTemplate
00011 {
00012     [Windows::Foundation::Metadata::WebHostHidden]
00013     public ref class ContextMenuFlyout sealed
00014     {
00015     internal :
00016         ContextMenuFlyout(std::shared_ptr<SceneComposer> sceneComposer);
00017         void EnablePasteItemOnly(bool IsEnabled, Windows::Foundation::Point pos);
00018
00019     private:
00020         void CopyFlyoutItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021         void CutFlyoutItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00022         void PasteFlyoutItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00023
00024         std::shared_ptr<SceneComposer>  _sceneComposer;
00025         Windows::Foundation::Point      _pastePosition;
00026     };
00027 }
Generated on Fri Nov 15 2024 22:18:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/ListsAndTemplates.xaml.cs Source File

  • XamlBind
  • cs

ListsAndTemplates.xaml.cs

Go to the documentation of this file.
00001 ﻿using System.Collections.Generic;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004 using xBindSampleModel;
00005
00006
00007 namespace xBindSampleCS
00008 {
00009     public sealed partial class ListsAndTemplates : Page
00010     {
00011         public DataModel Model { get; set; }
00012
00013         public List<IEmployee> Employees = new List<IEmployee>();
00014
00015         public ListsAndTemplates()
00016         {
00017             this.Model = new DataModel();
00018             this.InitializeComponent();
00019             InitializeValues();
00020         }
00021
00022         void InitializeValues()
00023         {
00024             this.Model.InitializeValues();
00025             foreach (IEmployee e in Model.ManagerProp.ReportsList)
00026             {
00027                 if (this.Employees != null)
00028                 {
00029                     this.Employees.Add(e);
00030                 }
00031             }
00032         }
00033
00034         private void UpdateValuesClick(object sender, RoutedEventArgs e)
00035         {
00036             this.Model.UpdateValues();
00037             if (this.Employees != null)
00038             {
00039                 IEmployee temp = Employees[0];
00040                 Employees.RemoveAt(0);
00041                 Employees.Add(temp);
00042             }
00043         }
00044
00045         private void ResetValuesClick(object sender, RoutedEventArgs e)
00046         {
00047             this.InitializeValues();
00048         }
00049
00050     }
00051 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityBackgroundTask/Properties/AssemblyInfo.cs Source File

  • SocketActivityStreamSocket
  • cs
  • SocketActivityBackgroundTask
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("SocketActivityBackgroundTask")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("SocketActivityBackgroundTask")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SecondaryPage.xaml.cpp Source File

  • BackButton
  • cpp

SecondaryPage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // SecondaryPage.xaml.cpp
00003 // Implementation of the SecondaryPage class
00004 //
00005
00006 #include "pch.h"
00007 #include "SecondaryPage.xaml.h"
00008
00009 using namespace SDKTemplate;
00010
00011 using namespace Platform;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::UI::Core;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00024
00025 SecondaryPage::SecondaryPage()
00026 {
00027     InitializeComponent();
00028 }
00029
00030
00031 void SecondaryPage::OnNavigatedTo(NavigationEventArgs^ e)
00032 {
00033     bool optedIn = static_cast<bool>(e->Parameter);
00034
00035
00036     auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content);
00037
00038     if (rootFrame->CanGoBack && optedIn)
00039     {
00040         // If we have pages in our in-app backstack and have opted in to showing back, do so
00041         SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Visible;
00042     }
00043     else
00044     {
00045         // Remove the UI from the title bar if there are no pages in our in-app back stack
00046         SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Collapsed;
00047     }
00048 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Turn Member List

This is the complete list of members for Turn, including all inherited members.
Start() | Turn | [inline, private]
turningSpeed | Turn |
Update() | Turn | [inline, private]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario5Photos.xaml.cs Source File

  • Printing
  • cs

Scenario5Photos.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading;
00015 using System.Threading.Tasks;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using Windows.Foundation;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021 using Windows.UI.Xaml.Printing;
00022 using Windows.UI.Xaml.Media.Imaging;
00023 using Windows.UI.Xaml.Media;
00024 using Windows.Graphics.Printing;
00025 using Windows.Graphics.Printing.OptionDetails;
00026 using Windows.Graphics.Imaging;
00027 using Windows.Storage;
00028 using SDKTemplate;
00029
00030 namespace PrintSample
00031 {
00032     /// <summary>
00033     /// Photo size options
00034     /// </summary>
00035     public enum PhotoSize : byte
00036     {
00037         SizeFullPage,
00038         Size4x6,
00039         Size5x7,
00040         Size8x10
00041     }
00042
00043     /// <summary>
00044     /// Photo scaling options
00045     /// </summary>
00046     public enum Scaling : byte
00047     {
00048         ShrinkToFit,
00049         Crop
00050     }
00051
00052     /// <summary>
00053     /// Printable page description
00054     /// </summary>
00055     public class PageDescription : IEquatable<PageDescription>
00056     {
00057         public Size Margin;
00058         public Size PageSize;
00059         public Size ViewablePageSize;
00060         public Size PictureViewSize;
00061         public bool IsContentCropped;
00062
00063         public bool Equals(PageDescription other)
00064         {
00065             // Detect if PageSize changed
00066             bool equal = (Math.Abs(PageSize.Width - other.PageSize.Width) < double.Epsilon) &&
00067                 (Math.Abs(PageSize.Height - other.PageSize.Height) < double.Epsilon);
00068
00069             // Detect if ViewablePageSize changed
00070             if (equal)
00071             {
00072                 equal = (Math.Abs(ViewablePageSize.Width - other.ViewablePageSize.Width) < double.Epsilon) &&
00073                     (Math.Abs(ViewablePageSize.Height - other.ViewablePageSize.Height) < double.Epsilon);
00074             }
00075
00076             // Detect if PictureViewSize changed
00077             if (equal)
00078             {
00079                 equal = (Math.Abs(PictureViewSize.Width - other.PictureViewSize.Width) < double.Epsilon) &&
00080                     (Math.Abs(PictureViewSize.Height - other.PictureViewSize.Height) < double.Epsilon);
00081             }
00082
00083             // Detect if cropping changed
00084             if (equal)
00085             {
00086                 equal = IsContentCropped == other.IsContentCropped;
00087             }
00088
00089             return equal;
00090         }
00091     }
00092
00093     class PhotosPrintHelper : PrintHelper
00094     {
00095         #region Scenario specific constants.
00096         /// <summary>
00097         /// The app's number of photos
00098         /// </summary>
00099         private const int NumberOfPhotos = 6;
00100
00101         /// <summary>
00102         /// Constant for 96 DPI
00103         /// </summary>
00104         private const int DPI96 = 96;
00105
00106         #endregion
00107
00108         /// <summary>
00109         /// Current size settings for the image
00110         /// </summary>
00111         private PhotoSize photoSize;
00112
00113         /// <summary>
00114         /// Current scale settings for the image
00115         /// </summary>
00116         private Scaling photoScale;
00117
00118         /// <summary>
00119         /// A map of UIElements used to store the print preview pages.
00120         /// </summary>
00121         private Dictionary<int, UIElement> pageCollection = new Dictionary<int, UIElement>();
00122
00123         /// <summary>
00124         /// Synchronization object used to sync access to pageCollection and the visual root(PrintingRoot).
00125         /// </summary>
00126         private static object printSync = new object();
00127
00128         /// <summary>
00129         /// The current printer's page description used to create the content (size, margins, printable area)
00130         /// </summary>
00131         private PageDescription currentPageDescription;
00132
00133         /// <summary>
00134         /// A request "number" used to describe a Paginate - GetPreviewPage session.
00135         /// It is used by GetPreviewPage to determine, before calling SetPreviewPage, if the page content is out of date.
00136         /// Flow:
00137         /// Paginate will increment the request count and all subsequent GetPreviewPage calls will store a local copy and verify it before calling SetPreviewPage.
00138         /// If another Paginate event is triggered while some GetPreviewPage workers are still executing asynchronously
00139         /// their results will be discarded(ignored) because their request number is expired (the photo page description changed).
00140         /// </summary>
00141         private long requestCount;
00142
00143         public PhotosPrintHelper(Page scenarioPage) : base(scenarioPage)
00144         {
00145             photoSize = PhotoSize.SizeFullPage;
00146             photoScale = Scaling.ShrinkToFit;
00147         }
00148
00149         /// <summary>
00150         /// This is the event handler for PrintManager.PrintTaskRequested.
00151         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified
00152         /// by PrintTaskRequestedEventArgs->Request->Deadline.
00153         /// Therefore, we use this handler to only create the print task.
00154         /// The print settings customization can be done when the print document source is requested.
00155         /// </summary>
00156         /// <param name="sender">The print manager for which a print task request was made.</param>
00157         /// <param name="e">The print taks request associated arguments.</param>
00158         protected override void PrintTaskRequested(Windows.Graphics.Printing.PrintManager sender, Windows.Graphics.Printing.PrintTaskRequestedEventArgs e)
00159         {
00160             PrintTask printTask = null;
00161             printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
00162             {
00163                 PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options);
00164
00165                 // Choose the printer options to be shown.
00166                 // The order in which the options are appended determines the order in which they appear in the UI
00167                 printDetailedOptions.DisplayedOptions.Clear();
00168                 printDetailedOptions.DisplayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
00169                 printDetailedOptions.DisplayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
00170
00171                 // Create a new list option.
00172                 PrintCustomItemListOptionDetails photoSize = printDetailedOptions.CreateItemListOption("photoSize", "Photo Size");
00173                 photoSize.AddItem("SizeFullPage", "Full Page");
00174                 photoSize.AddItem("Size4x6", "4 x 6 in");
00175                 photoSize.AddItem("Size5x7", "5 x 7 in");
00176                 photoSize.AddItem("Size8x10", "8 x 10 in");
00177
00178                 // Add the custom option to the option list.
00179                 printDetailedOptions.DisplayedOptions.Add("photoSize");
00180
00181                 PrintCustomItemListOptionDetails scaling = printDetailedOptions.CreateItemListOption("scaling", "Scaling");
00182                 scaling.AddItem("ShrinkToFit", "Shrink To Fit");
00183                 scaling.AddItem("Crop", "Crop");
00184
00185                 // Add the custom option to the option list.
00186                 printDetailedOptions.DisplayedOptions.Add("scaling");
00187
00188                 // Set default orientation to landscape.
00189                 printTask.Options.Orientation = PrintOrientation.Landscape;
00190
00191                 // Register for print task option changed notifications.
00192                 printDetailedOptions.OptionChanged += PrintDetailedOptionsOptionChanged;
00193
00194                 // Register for print task Completed notification.
00195                 // Print Task event handler is invoked when the print job is completed.
00196                 printTask.Completed += async (s, args) =>
00197                 {
00198                     await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00199                     {
00200                         ClearPageCollection();
00201
00202                         // Reset image options to default values.
00203                         this.photoScale = Scaling.ShrinkToFit;
00204                         this.photoSize = PhotoSize.SizeFullPage;
00205
00206                         // Reset the current page description
00207                         currentPageDescription = null;
00208
00209                         // Notify the user when the print operation fails.
00210                         if (args.Completion == PrintTaskCompletion.Failed)
00211                         {
00212                             MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
00213                         }
00214                     });
00215                 };
00216
00217                 // Set the document source.
00218                 sourceRequestedArgs.SetSource(printDocumentSource);
00219             });
00220         }
00221
00222         /// <summary>
00223         /// Option change event handler
00224         /// </summary>
00225         /// <param name="sender">The print task option details for which an option changed.</param>
00226         /// <param name="args">The event arguments containing the id of the changed option.</param>
00227         private async void PrintDetailedOptionsOptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)
00228         {
00229             bool invalidatePreview = false;
00230
00231             // For this scenario we are interested only when the 2 custom options change (photoSize & scaling) in order to trigger a preview refresh.
00232             // Default options that change page aspect will trigger preview invalidation (refresh) automatically.
00233             // It is safe to ignore verifying other options and(or) combinations here because during Paginate event(CreatePrintPreviewPages) we check if the PageDescription changed.
00234             if (args.OptionId == null)
00235             {
00236                 return;
00237             }
00238
00239             string optionId = args.OptionId.ToString();
00240
00241             if (optionId == "photoSize")
00242             {
00243                 IPrintOptionDetails photoSizeOption = sender.Options[optionId];
00244                 string photoSizeValue = photoSizeOption.Value as string;
00245
00246                 if (!string.IsNullOrEmpty(photoSizeValue))
00247                 {
00248                     switch (photoSizeValue)
00249                     {
00250                         case "SizeFullPage":
00251                             photoSize = PhotoSize.SizeFullPage;
00252                             break;
00253                         case "Size4x6":
00254                             photoSize = PhotoSize.Size4x6;
00255                             break;
00256                         case "Size5x7":
00257                             photoSize = PhotoSize.Size5x7;
00258                             break;
00259                         case "Size8x10":
00260                             photoSize = PhotoSize.Size8x10;
00261                             break;
00262                     }
00263                     invalidatePreview = true;
00264                 }
00265             }
00266
00267             if (optionId == "scaling")
00268             {
00269                 IPrintOptionDetails scalingOption = sender.Options[optionId];
00270                 string scalingValue = scalingOption.Value as string;
00271
00272                 if (!string.IsNullOrEmpty(scalingValue))
00273                 {
00274                     switch (scalingValue)
00275                     {
00276                         case "Crop":
00277                             photoScale = Scaling.Crop;
00278                             break;
00279                         case "ShrinkToFit":
00280                             photoScale = Scaling.ShrinkToFit;
00281                             break;
00282                     }
00283                     invalidatePreview = true;
00284                 }
00285             }
00286
00287             // Invalidate preview if one of the 2 options (photoSize, scaling) changed.
00288             if (invalidatePreview)
00289             {
00290                 await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, printDocument.InvalidatePreview);
00291             }
00292         }
00293
00294         /// <summary>
00295         /// This is the event handler for Pagination.
00296         /// </summary>
00297         /// <param name="sender">The document for which pagination occurs.</param>
00298         /// <param name="e">The pagination event arguments containing the print options.</param>
00299         protected override void CreatePrintPreviewPages(object sender, Windows.UI.Xaml.Printing.PaginateEventArgs e)
00300         {
00301
00302             PrintDocument printDoc = (PrintDocument)sender;
00303
00304             // A new "session" starts with each paginate event.
00305             Interlocked.Increment(ref requestCount);
00306
00307             PageDescription pageDescription = new PageDescription();
00308
00309             // Get printer's page description.
00310             PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(e.PrintTaskOptions);
00311             PrintPageDescription printPageDescription = e.PrintTaskOptions.GetPageDescription(0);
00312
00313             // Reset the error state
00314             printDetailedOptions.Options["photoSize"].ErrorText = string.Empty;
00315
00316             // Compute the printing page description (page size & center printable area)
00317             pageDescription.PageSize = printPageDescription.PageSize;
00318
00319             pageDescription.Margin.Width = Math.Max(
00320                 printPageDescription.ImageableRect.Left,
00321                 printPageDescription.ImageableRect.Right - printPageDescription.PageSize.Width);
00322
00323             pageDescription.Margin.Height = Math.Max(
00324                 printPageDescription.ImageableRect.Top,
00325                 printPageDescription.ImageableRect.Bottom - printPageDescription.PageSize.Height);
00326
00327             pageDescription.ViewablePageSize.Width = printPageDescription.PageSize.Width - pageDescription.Margin.Width * 2;
00328             pageDescription.ViewablePageSize.Height = printPageDescription.PageSize.Height - pageDescription.Margin.Height * 2;
00329
00330             // Compute print photo area.
00331             switch (photoSize)
00332             {
00333                 case PhotoSize.Size4x6:
00334                     pageDescription.PictureViewSize.Width = 4 * DPI96;
00335                     pageDescription.PictureViewSize.Height = 6 * DPI96;
00336                     break;
00337                 case PhotoSize.Size5x7:
00338                     pageDescription.PictureViewSize.Width = 5 * DPI96;
00339                     pageDescription.PictureViewSize.Height = 7 * DPI96;
00340                     break;
00341                 case PhotoSize.Size8x10:
00342                     pageDescription.PictureViewSize.Width = 8 * DPI96;
00343                     pageDescription.PictureViewSize.Height = 10 * DPI96;
00344                     break;
00345                 case PhotoSize.SizeFullPage:
00346                     pageDescription.PictureViewSize.Width = pageDescription.ViewablePageSize.Width;
00347                     pageDescription.PictureViewSize.Height = pageDescription.ViewablePageSize.Height;
00348                     break;
00349             }
00350
00351             // Try to maximize photo-size based on it's aspect-ratio
00352             if ((pageDescription.ViewablePageSize.Width > pageDescription.ViewablePageSize.Height) && (photoSize != PhotoSize.SizeFullPage))
00353             {
00354                 var swap = pageDescription.PictureViewSize.Width;
00355                 pageDescription.PictureViewSize.Width = pageDescription.PictureViewSize.Height;
00356                 pageDescription.PictureViewSize.Height = swap;
00357             }
00358
00359             pageDescription.IsContentCropped = photoScale == Scaling.Crop;
00360
00361             // Recreate content only when :
00362             // - there is no current page description
00363             // - the current page description doesn't match the new one
00364             if (currentPageDescription == null || !currentPageDescription.Equals(pageDescription))
00365             {
00366                 ClearPageCollection();
00367
00368                 if (pageDescription.PictureViewSize.Width > pageDescription.ViewablePageSize.Width ||
00369                     pageDescription.PictureViewSize.Height > pageDescription.ViewablePageSize.Height)
00370                 {
00371                     printDetailedOptions.Options["photoSize"].ErrorText = "Photo doesn’t fit on the selected paper";
00372
00373                     // Inform preview that it has only 1 page to show.
00374                     printDoc.SetPreviewPageCount(1, PreviewPageCountType.Intermediate);
00375
00376                     // Add a custom "preview" unavailable page
00377                     lock (printSync)
00378                     {
00379                         pageCollection[0] = new PreviewUnavailable(pageDescription.PageSize, pageDescription.ViewablePageSize);
00380                     }
00381                 }
00382                 else
00383                 {
00384                     // Inform preview that is has #NumberOfPhotos pages to show.
00385                     printDoc.SetPreviewPageCount(NumberOfPhotos, PreviewPageCountType.Intermediate);
00386                 }
00387
00388                 currentPageDescription = pageDescription;
00389             }
00390         }
00391
00392         /// <summary>
00393         /// This is the event handler for PrintDocument.GetPrintPreviewPage. It provides a specific print page preview,
00394         /// in the form of an UIElement, to an instance of PrintDocument.
00395         /// PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.
00396         /// </summary>
00397         /// <param name="sender">The print documet.</param>
00398         /// <param name="e">Arguments containing the requested page preview.</param>
00399         protected async override void GetPrintPreviewPage(object sender, GetPreviewPageEventArgs e)
00400         {
00401             // Store a local copy of the request count to use later to determine if the computed page is out of date.
00402             // If the page preview is unavailable an async operation will generate the content.
00403             // When the operation completes there is a chance that a pagination request was already made therefore making this page obsolete.
00404             // If the page is obsolete throw away the result (don't call SetPreviewPage) since a new GetPrintPreviewPage will server that request.
00405             long requestNumber = 0;
00406             Interlocked.Exchange(ref requestNumber, requestCount);
00407             int pageNumber = e.PageNumber;
00408
00409             UIElement page;
00410             bool pageReady = false;
00411
00412             // Try to get the page if it was previously generated.
00413             lock (printSync)
00414             {
00415                 pageReady = pageCollection.TryGetValue(pageNumber - 1, out page);
00416             }
00417
00418             if (!pageReady)
00419             {
00420                 // The page is not available yet.
00421                 page = await GeneratePageAsync(pageNumber, currentPageDescription);
00422
00423                 // If the ticket changed discard the result since the content is outdated.
00424                 if (Interlocked.CompareExchange(ref requestNumber, requestNumber, requestCount) != requestCount)
00425                 {
00426                     return;
00427                 }
00428
00429                 // Store the page in the list in case an invalidate happens but the content doesn't need to be regenerated.
00430
00431                 lock (printSync)
00432                 {
00433                     pageCollection[pageNumber - 1] = page;
00434
00435                     // Add the newly created page to the printing root which is part of the visual tree and force it to go
00436                     // through layout so that the linked containers correctly distribute the content inside them.
00437                     PrintCanvas.Children.Add(page);
00438                     PrintCanvas.InvalidateMeasure();
00439                     PrintCanvas.UpdateLayout();
00440                 }
00441             }
00442
00443             PrintDocument printDoc = (PrintDocument)sender;
00444
00445             // Send the page to preview.
00446             printDoc.SetPreviewPage(pageNumber, page);
00447         }
00448
00449         /// <summary>
00450         /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00451         /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00452         /// into a pages that the Windows print system can deal with.
00453         /// </summary>
00454         /// <param name="sender">The print document.</param>
00455         /// <param name="e">Arguments containing the print task options.</param>
00456         protected override async void AddPrintPages(object sender, AddPagesEventArgs e)
00457         {
00458             PrintDocument printDoc = (PrintDocument)sender;
00459
00460             // Loop over all of the preview pages
00461             for (int i = 0; i < NumberOfPhotos; i++)
00462             {
00463                 UIElement page = null;
00464                 bool pageReady = false;
00465
00466                 lock (printSync)
00467                 {
00468                     pageReady = pageCollection.TryGetValue(i, out page);
00469                 }
00470
00471                 if (!pageReady)
00472                 {
00473                     // If the page is not ready create a task that will generate its content.
00474                     page = await GeneratePageAsync(i + 1, currentPageDescription);
00475                 }
00476
00477                 printDoc.AddPage(page);
00478             }
00479
00480             // Indicate that all of the print pages have been provided.
00481             printDoc.AddPagesComplete();
00482
00483             // Reset the current page description as soon as possible since the PrintTask.Completed event might fire later (long running job)
00484             currentPageDescription = null;
00485         }
00486
00487         /// <summary>
00488         /// Helper function that clears the page collection and also the pages attached to the "visual root".
00489         /// </summary>
00490         private void ClearPageCollection()
00491         {
00492             lock (printSync)
00493             {
00494                 pageCollection.Clear();
00495                 PrintCanvas.Children.Clear();
00496             }
00497         }
00498
00499         /// <summary>
00500         /// Generic swap of 2 values
00501         /// </summary>
00502         /// <typeparam name="T">typename</typeparam>
00503         /// <param name="v1">Value 1</param>
00504         /// <param name="v2">Value 2</param>
00505         private static void Swap<T>(ref T v1, ref T v2)
00506         {
00507             T swap = v1;
00508             v1 = v2;
00509             v2 = swap;
00510         }
00511
00512         /// <summary>
00513         /// Generates a page containing a photo.
00514         /// The image will be rotated if detected that there is a gain from that regarding size (try to maximize photo size).
00515         /// </summary>
00516         /// <param name="photoNumber">The photo number.</param>
00517         /// <param name="pageDescription">The description of the printer page.</param>
00518         /// <returns>A task that will return the page.</returns>
00519         private async Task<UIElement> GeneratePageAsync(int photoNumber, PageDescription pageDescription)
00520         {
00521             Canvas page = new Canvas
00522             {
00523                 Width = pageDescription.PageSize.Width,
00524                 Height = pageDescription.PageSize.Height
00525             };
00526
00527             Canvas viewablePage = new Canvas()
00528             {
00529                 Width = pageDescription.ViewablePageSize.Width,
00530                 Height = pageDescription.ViewablePageSize.Height
00531             };
00532
00533             viewablePage.SetValue(Canvas.LeftProperty, pageDescription.Margin.Width);
00534             viewablePage.SetValue(Canvas.TopProperty, pageDescription.Margin.Height);
00535
00536             // The image "frame" which also acts as a viewport
00537             Grid photoView = new Grid
00538             {
00539                 Width = pageDescription.PictureViewSize.Width,
00540                 Height = pageDescription.PictureViewSize.Height
00541             };
00542
00543             // Center the frame.
00544             photoView.SetValue(Canvas.LeftProperty, (viewablePage.Width - photoView.Width) / 2);
00545             photoView.SetValue(Canvas.TopProperty, (viewablePage.Height - photoView.Height) / 2);
00546
00547             // Return an async task that will complete when the image is fully loaded.
00548             WriteableBitmap bitmap = await LoadBitmapAsync(
00549                 new Uri(string.Format("ms-appx:///Assets/photo{0}.jpg", photoNumber)),
00550                 pageDescription.PageSize.Width > pageDescription.PageSize.Height);
00551
00552             if (bitmap != null)
00553             {
00554                 Image image = new Image
00555                 {
00556                     Source = bitmap,
00557                     HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
00558                     VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center
00559                 };
00560
00561                 // Use the real image size when croping or if the image is smaller then the target area (prevent a scale-up).
00562                 if (photoScale == Scaling.Crop ||
00563                     (bitmap.PixelWidth <= pageDescription.PictureViewSize.Width &&
00564                     bitmap.PixelHeight <= pageDescription.PictureViewSize.Height))
00565                 {
00566                     image.Stretch = Stretch.None;
00567                     image.Width = bitmap.PixelWidth;
00568                     image.Height = bitmap.PixelHeight;
00569                 }
00570
00571                 // Add the newly created image to the visual root.
00572                 photoView.Children.Add(image);
00573                 viewablePage.Children.Add(photoView);
00574                 page.Children.Add(viewablePage);
00575             }
00576
00577             // Return the page with the image centered.
00578             return page;
00579         }
00580
00581         /// <summary>
00582         /// Loads an image from an uri source and performs a rotation based on the print target aspect.
00583         /// </summary>
00584         /// <param name="source">The location of the image.</param>
00585         /// <param name="landscape">A flag that indicates if the target (printer page) is in landscape mode.</param>
00586         /// <returns>A task that will return the loaded bitmap.</returns>
00587         private async Task<WriteableBitmap> LoadBitmapAsync(Uri source, bool landscape)
00588         {
00589             var file = await StorageFile.GetFileFromApplicationUriAsync(source);
00590             using (var stream = await file.OpenAsync(FileAccessMode.Read))
00591             {
00592                 BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
00593
00594                 BitmapTransform transform = new BitmapTransform();
00595                 transform.Rotation = BitmapRotation.None;
00596                 uint width = decoder.PixelWidth;
00597                 uint height = decoder.PixelHeight;
00598
00599                 if (landscape && width < height)
00600                 {
00601                     transform.Rotation = BitmapRotation.Clockwise270Degrees;
00602                     Swap(ref width, ref height);
00603                 }
00604                 else if (!landscape && width > height)
00605                 {
00606                     transform.Rotation = BitmapRotation.Clockwise90Degrees;
00607                     Swap(ref width, ref height);
00608                 }
00609
00610                 PixelDataProvider pixelData = await decoder.GetPixelDataAsync(
00611                     BitmapPixelFormat.Bgra8,    // WriteableBitmap uses BGRA format.
00612                     BitmapAlphaMode.Straight,
00613                     transform,
00614                     ExifOrientationMode.IgnoreExifOrientation,    // This sample ignores Exif orientation.
00615                     ColorManagementMode.DoNotColorManage);
00616
00617                 WriteableBitmap bitmap = new WriteableBitmap((int)width, (int)height);
00618                 var pixelBuffer = pixelData.DetachPixelData();
00619                 using (var pixelStream = bitmap.PixelBuffer.AsStream())
00620                 {
00621                     pixelStream.Write(pixelBuffer, 0, (int)pixelStream.Length);
00622                 }
00623
00624                 return bitmap;
00625             }
00626         }
00627     }
00628
00629     /// <summary>
00630     /// Photo printing scenario
00631     /// </summary>
00632     public sealed partial class Scenario5Photos : Page
00633     {
00634         private PhotosPrintHelper printHelper;
00635
00636         public Scenario5Photos()
00637         {
00638             this.InitializeComponent();
00639         }
00640
00641         /// <summary>
00642         /// This is the click handler for the 'Print' button.
00643         /// </summary>
00644         /// <param name="sender"></param>
00645         /// <param name="e"></param>
00646         private async void OnPrintButtonClick(object sender, RoutedEventArgs e)
00647         {
00648             await printHelper.ShowPrintUIAsync();
00649         }
00650
00651         protected override void OnNavigatedTo(NavigationEventArgs e)
00652         {
00653             if (PrintManager.IsSupported())
00654             {
00655                 // Tell the user how to print
00656                 MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
00657             }
00658             else
00659             {
00660                 // Remove the print button
00661                 InvokePrintingButton.Visibility = Visibility.Collapsed;
00662
00663                 // Inform user that Printing is not supported
00664                 MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);
00665
00666                 // Printing-related event handlers will never be called if printing
00667                 // is not supported, but it's okay to register for them anyway.
00668             }
00669
00670             // Initalize common helper class and register for printing
00671             printHelper = new PhotosPrintHelper(this);
00672             printHelper.RegisterForPrinting();
00673         }
00674
00675         protected override void OnNavigatedFrom(NavigationEventArgs e)
00676         {
00677             if (printHelper != null)
00678             {
00679                 printHelper.UnregisterForPrinting();
00680             }
00681         }
00682     }
00683 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/pch.cpp Source File

  • IoT-I2C
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario2_GetPosition.xaml.cs Source File

  • Geolocation
  • cs

Scenario2_GetPosition.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.Geolocation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario2_GetPosition : Page
00023     {
00024         private CancellationTokenSource _cts = null;
00025
00026         // A pointer to the main page
00027         private MainPage _rootPage = MainPage.Current;
00028
00029         public Scenario2_GetPosition()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override void OnNavigatedFrom(NavigationEventArgs e)
00035         {
00036             if (_cts != null)
00037             {
00038                 _cts.Cancel();
00039                 _cts = null;
00040             }
00041         }
00042
00043         /// <summary>
00044         /// This is the click handler for the 'getGeolocation' button.
00045         /// </summary>
00046         /// <param name="sender"></param>
00047         /// <param name="e"></param>
00048         async private void GetGeolocationButtonClicked(object sender, RoutedEventArgs e)
00049         {
00050             GetGeolocationButton.IsEnabled = false;
00051             CancelGetGeolocationButton.IsEnabled = true;
00052             LocationDisabledMessage.Visibility = Visibility.Collapsed;
00053
00054             try
00055             {
00056                 // Request permission to access location
00057                 var accessStatus = await Geolocator.RequestAccessAsync();
00058
00059                 switch (accessStatus)
00060                 {
00061                     case GeolocationAccessStatus.Allowed:
00062
00063                         // Get cancellation token
00064                         _cts = new CancellationTokenSource();
00065                         CancellationToken token = _cts.Token;
00066
00067                         _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);
00068
00069                         // If DesiredAccuracy or DesiredAccuracyInMeters are not set (or value is 0), DesiredAccuracy.Default is used.
00070                         uint desiredAccuracyInMetersValue;
00071                         uint.TryParse(DesiredAccuracyInMeters.Text, out desiredAccuracyInMetersValue);
00072                         Geolocator geolocator = new Geolocator { DesiredAccuracyInMeters = desiredAccuracyInMetersValue };
00073
00074                         // Carry out the operation
00075                         Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);
00076
00077                         UpdateLocationData(pos);
00078                         _rootPage.NotifyUser("Location updated.", NotifyType.StatusMessage);
00079                         break;
00080
00081                     case GeolocationAccessStatus.Denied:
00082                         _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
00083                         LocationDisabledMessage.Visibility = Visibility.Visible;
00084                         UpdateLocationData(null);
00085                         break;
00086
00087                     case GeolocationAccessStatus.Unspecified:
00088                         _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
00089                         UpdateLocationData(null);
00090                         break;
00091                 }
00092             }
00093             catch (TaskCanceledException)
00094             {
00095                 _rootPage.NotifyUser("Canceled.", NotifyType.StatusMessage);
00096             }
00097             catch (Exception ex)
00098             {
00099                 _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00100             }
00101             finally
00102             {
00103                 _cts = null;
00104             }
00105
00106             GetGeolocationButton.IsEnabled = true;
00107             CancelGetGeolocationButton.IsEnabled = false;
00108         }
00109
00110         /// <summary>
00111         /// This is the click handler for the 'CancelGetGeolocation' button.
00112         /// </summary>
00113         /// <param name="sender"></param>
00114         /// <param name="e"></param>
00115         private void CancelGetGeolocationButtonClicked(object sender, RoutedEventArgs e)
00116         {
00117             if (_cts != null)
00118             {
00119                 _cts.Cancel();
00120                 _cts = null;
00121             }
00122
00123             GetGeolocationButton.IsEnabled = true;
00124             CancelGetGeolocationButton.IsEnabled = false;
00125         }
00126
00127         /// <summary>
00128         /// Updates the user interface with the Geoposition data provided
00129         /// </summary>
00130         /// <param name="position">Geoposition to display its details</param>
00131         private void UpdateLocationData(Geoposition position)
00132         {
00133             if (position == null)
00134             {
00135                 ScenarioOutput_Latitude.Text = "No data";
00136                 ScenarioOutput_Longitude.Text = "No data";
00137                 ScenarioOutput_Accuracy.Text = "No data";
00138                 ScenarioOutput_Source.Text = "No data";
00139                 ScenarioOutput_IsRemoteSource.Text = "No data";
00140                 ShowSatelliteData(false);
00141             }
00142             else
00143             {
00144                 ScenarioOutput_Latitude.Text = position.Coordinate.Point.Position.Latitude.ToString();
00145                 ScenarioOutput_Longitude.Text = position.Coordinate.Point.Position.Longitude.ToString();
00146                 ScenarioOutput_Accuracy.Text = position.Coordinate.Accuracy.ToString();
00147                 ScenarioOutput_Source.Text = position.Coordinate.PositionSource.ToString();
00148                 ScenarioOutput_IsRemoteSource.Text = position.Coordinate.IsRemoteSource.ToString();
00149
00150                 if (position.Coordinate.PositionSource == PositionSource.Satellite)
00151                 {
00152                     // Show labels and satellite data when available
00153                     ScenarioOutput_PosPrecision.Text = position.Coordinate.SatelliteData.PositionDilutionOfPrecision.ToString();
00154                     ScenarioOutput_HorzPrecision.Text = position.Coordinate.SatelliteData.HorizontalDilutionOfPrecision.ToString();
00155                     ScenarioOutput_VertPrecision.Text = position.Coordinate.SatelliteData.VerticalDilutionOfPrecision.ToString();
00156                     ScenarioOutput_GeomPrecision.Text = position.Coordinate.SatelliteData.GeometricDilutionOfPrecision.ToString();
00157                     ScenarioOutput_TimePrecision.Text = position.Coordinate.SatelliteData.TimeDilutionOfPrecision.ToString();
00158                     ShowSatelliteData(true);
00159                 }
00160                 else
00161                 {
00162                     // Hide labels and satellite data
00163                     ShowSatelliteData(false);
00164                 }
00165             }
00166         }
00167
00168         private void ShowSatelliteData(bool isVisible)
00169         {
00170             var visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
00171             ScenarioOutput_PosPrecision.Visibility = visibility;
00172             ScenarioOutput_HorzPrecision.Visibility = visibility;
00173             ScenarioOutput_VertPrecision.Visibility = visibility;
00174             ScenarioOutput_GeomPrecision.Visibility = visibility;
00175             ScenarioOutput_TimePrecision.Visibility = visibility;
00176         }
00177     }
00178 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoggingSessionScenario Member List

This is the complete list of members for LoggingSessionScenario, including all inherited members.
_isBusy | LoggingSessionScenario | [private]
_isChannelEnabled | LoggingSessionScenario | [private]
_logFileGeneratedCount | LoggingSessionScenario | [private]
_statusChanged | LoggingSessionScenario | [private]
DoScenarioAsync() | LoggingSessionScenario |
Instance() | LoggingSessionScenario | [static]
IsBusy() const noexcept | LoggingSessionScenario |
LogFileGeneratedCount() const noexcept | LoggingSessionScenario |
LoggingEnabled() const noexcept | LoggingSessionScenario |
LoggingSessionScenario() | LoggingSessionScenario | [private]
OnAppResuming(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &args) | LoggingSessionScenario | [private]
OnAppSuspending(Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e) | LoggingSessionScenario | [private]
OnChannelLoggingEnabled(Windows::Foundation::Diagnostics::ILoggingChannel const &sender, Windows::Foundation::IInspectable const &args) | LoggingSessionScenario | [private]
PrepareToSuspend() | LoggingSessionScenario | [private]
ResumeLoggingIfApplicable() | LoggingSessionScenario | [private]
StartLogging() | LoggingSessionScenario | [private]
StatusChanged(StatusChangedHandler const &handler) | LoggingSessionScenario |
StatusChanged(winrt::event_token const &token) noexcept | LoggingSessionScenario |
ToggleLoggingEnabledDisabled() | LoggingSessionScenario |
~LoggingSessionScenario() | LoggingSessionScenario | [private]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DataModel Member List

This is the complete list of members for DataModel, including all inherited members.
_BoolPropWithINPC | DataModel | [private]
_ColorPropWithINPC | DataModel | [private]
_EmployeePropertyDPProperty | DataModel | [private, static]
_EmployeePropWithINPC | DataModel | [private]
_Employees | DataModel | [private]
_IntPropertyDPProperty | DataModel | [private, static]
_IntPropWithINPC | DataModel | [private]
_ManagerProp | DataModel | [private]
_StringPropertyDPProperty | DataModel | [private, static]
_StringPropWithINPC | DataModel | [private]
BoolPropWithINPC | DataModel |
ColorPropWithINPC | DataModel |
CreateManagerEmployeeTree() | DataModel | [inline, static]
CreateManagerEmployeeTree() | DataModel | [inline, static]
CreateReports(int depth, Manager m, Random rnd) | DataModel | [inline, private, static]
CreateReports(int depth, Manager m, Random rnd) | DataModel | [inline, private, static]
DataModel() | DataModel | [inline]
DataModel() | DataModel | [inline]
EmployeePropertyDP | DataModel |
EmployeePropertyDPName | DataModel | [private]
EmployeePropertyDPProperty | DataModel | [static]
EmployeePropNoINPC | DataModel |
EmployeePropWithINPC | DataModel |
Employees | DataModel |
fnames | DataModel | [private, static]
InitializeValues() | DataModel | [inline]
InitializeValues() | DataModel | [inline]
IntPropertyDP | DataModel |
IntPropertyDPName | DataModel | [private]
IntPropertyDPProperty | DataModel | [static]
IntPropNoINPC | DataModel |
IntPropWithINPC | DataModel |
lnames | DataModel | [private, static]
ManagerProp | DataModel |
NotifyPropertyChanged([CallerMemberName] string propertyName="") | DataModel | [inline, private]
NotifyPropertyChanged([CallerMemberName] string propertyName="") | DataModel | [inline, private]
PropertyChanged | DataModel |
StringPropAsInteger | DataModel |
StringPropertyDP | DataModel |
StringPropertyDPName | DataModel | [private]
StringPropertyDPProperty | DataModel | [static]
StringPropNoINPC | DataModel |
StringPropWithINPC | DataModel |
SubString(string data, int startIndex) | DataModel | [inline]
UpdateValues() | DataModel | [inline]
UpdateValues() | DataModel | [inline]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextWrap/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextWrap

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Notifications.Helpers;
00002 using System;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.TextWrap
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private async void ButtonPin_Click(object sender, RoutedEventArgs e)
00022         {
00023             ButtonPin.IsEnabled = false;
00024
00025             string text = "Now, this is the story all about how my tile got text-wrapped upside down. And I'd like to take a minute, just sit right there, I'll tell you how I became the prince of a town called Bellevue. In South Arizona, born and raised, in the mountains is where I spent most of my days, climbin' up, runnin', posin' all cool, and all shootin' some videos outside of school. When a couple of guys who were up to no good, started leavin' trash at the trailhead.";
00026
00027             await TilesHelper.PinNewSecondaryTile("text wrapping",
00028                 $@"
00029                 <tile version='3'>
00030                     <visual>
00031
00032                         <binding template='TileSmall'>
00033                             <text hint-wrap='true'>{text}</text>
00034                         </binding>
00035
00036                         <binding template='TileMedium'>
00037                             <text hint-wrap='true'>{text}</text>
00038                         </binding>
00039
00040                         <binding template='TileWide'>
00041                             <text hint-wrap='true'>{text}</text>
00042                         </binding>
00043
00044                         <binding template='TileLarge'>
00045                             <text hint-wrap='true'>{text}</text>
00046                         </binding>
00047
00048                 </visual>
00049             </tile>");
00050
00051
00052             await new MessageDialog("SUCCESS").ShowAsync();
00053             ButtonPin.IsEnabled = true;
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LocalSettingKeys Member List

This is the complete list of members for LocalSettingKeys, including all inherited members.
SyncBackgroundTaskResult | LocalSettingKeys
SyncBackgroundTaskStatus | LocalSettingKeys
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetUid Member List

This is the complete list of members for GetUid, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetUid() | GetUid | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/GetDataFromIBuffer.h Source File

  • HolographicSpatialMapping
  • cpp
  • Content

GetDataFromIBuffer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <streambuf>
00015 #include <robuffer.h>
00016 #include <wrl.h>
00017
00018 using namespace Microsoft::WRL;
00019 using namespace Windows::Storage::Streams;
00020
00021 namespace WindowsHolographicCodeSamples
00022 {
00023     template <typename t = byte>
00024     t* GetDataFromIBuffer(Windows::Storage::Streams::IBuffer^ container)
00025     {
00026         if (container == nullptr)
00027         {
00028             return nullptr;
00029         }
00030
00031         unsigned int bufferLength = container->Length;
00032
00033         if (!(bufferLength > 0))
00034         {
00035             return nullptr;
00036         }
00037
00038         HRESULT hr = S_OK;
00039
00040         ComPtr<IUnknown> pUnknown = reinterpret_cast<IUnknown*>(container);
00041         ComPtr<IBufferByteAccess> spByteAccess;
00042         hr = pUnknown.As(&spByteAccess);
00043         if (FAILED(hr))
00044         {
00045             return nullptr;
00046         }
00047
00048         byte* pRawData = nullptr;
00049         hr = spByteAccess->Buffer(&pRawData);
00050         if (FAILED(hr))
00051         {
00052             return nullptr;
00053         }
00054
00055         return reinterpret_cast<t*>(pRawData);
00056     }
00057 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/Scenario2_GetCurrentTextSegmentFromIndex.xaml.h Source File

  • TextSegmentation
  • cpp

Scenario2_GetCurrentTextSegmentFromIndex.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "Scenario2_GetCurrentTextSegmentFromIndex.g.h"
00005
00006 namespace SDKTemplate
00007 {
00008     public ref class Scenario2_GetCurrentTextSegmentFromIndex sealed
00009     {
00010     public:
00011         Scenario2_GetCurrentTextSegmentFromIndex();
00012
00013     private:
00014         void WordSegmentButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00015         void SelectionSegmentButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00016     };
00017 }
Generated on Fri Nov 15 2024 22:21:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_GetSingleDevice Member List

This is the complete list of members for Scenario5_GetSingleDevice, including all inherited members.
deviceInformationKind | Scenario5_GetSingleDevice | [private]
GetButton_Click(object sender, RoutedEventArgs e) | Scenario5_GetSingleDevice | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario5_GetSingleDevice | [inline, protected]
Page_Loaded(object sender, RoutedEventArgs e) | Scenario5_GetSingleDevice | [inline, private]
resultCollection | Scenario5_GetSingleDevice | [private]
rootPage | Scenario5_GetSingleDevice | [private]
Scenario5_GetSingleDevice() | Scenario5_GetSingleDevice | [inline]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario2.xaml.h Source File

  • FolderEnumeration
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     public ref class Scenario2 sealed
00025     {
00026     public:
00027         Scenario2();
00028
00029     private:
00030         void GroupByMonthButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void GroupByRatingButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void GroupByTagButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void GroupByHelper(Windows::Storage::Search::QueryOptions^ queryOptions);
00034         Windows::UI::Xaml::Controls::TextBlock^ CreateHeaderTextBlock(Platform::String^ contents);
00035         Windows::UI::Xaml::Controls::TextBlock^ CreateLineItemTextBlock(Platform::String^ contents);
00036     };
00037 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyImage.h Source File

  • Clipboard
  • cppwinrt

CopyImage.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "CopyImage.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct CopyImage : CopyImageT<CopyImage>
00020     {
00021         CopyImage();
00022
00023         void CopyButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         void CopyWithDelayedRenderingButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         fire_and_forget PasteButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026
00027     private:
00028         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00029
00030         fire_and_forget CopyBitmap(bool isDelayRendered);
00031         static fire_and_forget OnDeferredImageRequestedHandler(Windows::ApplicationModel::DataTransfer::DataProviderRequest request, Windows::Storage::StorageFile imageFile);
00032     };
00033 }
00034
00035 namespace winrt::SDKTemplate::factory_implementation
00036 {
00037     struct CopyImage : CopyImageT<CopyImage, implementation::CopyImage>
00038     {
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario4_TimeTriggeredTask.xaml.h Source File

  • BackgroundActivation
  • cpp

Scenario4_TimeTriggeredTask.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4_TimeTriggeredTask.xaml.h
00013 // Declaration of the TimeTriggeredTask class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario4_TimeTriggeredTask.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class TimeTriggeredTask sealed
00029     {
00030     public:
00031         TimeTriggeredTask();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035     private:
00036         SDKTemplate::MainPage^ rootPage;
00037
00038         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00039         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00042         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00043         void UpdateUI();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:18:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/Scenario1_CreateContacts.xaml.cs Source File

  • ContactCardIntegration
  • cs

Scenario1_CreateContacts.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.ApplicationModel.Contacts;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario1_CreateContacts : Page
00026     {
00027         private MainPage rootPage = MainPage.Current;
00028
00029         public Scenario1_CreateContacts()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private async Task<ContactList> _GetContactList()
00035         {
00036             ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
00037             if (null == store)
00038             {
00039                 rootPage.NotifyUser("Unable to get a contacts store.", NotifyType.ErrorMessage);
00040                 return null;
00041             }
00042
00043             ContactList contactList;
00044             IReadOnlyList<ContactList> contactLists = await store.FindContactListsAsync();
00045             if (0 == contactLists.Count)
00046             {
00047                 contactList = await store.CreateContactListAsync("TestContactList");
00048             }
00049             else
00050             {
00051                 contactList = contactLists[0];
00052             }
00053
00054             return contactList;
00055         }
00056
00057         private async Task<ContactAnnotationList> _GetContactAnnotationList()
00058         {
00059             ContactAnnotationStore annotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);
00060             if (null == annotationStore)
00061             {
00062                 rootPage.NotifyUser("Unable to get an annotations store.", NotifyType.ErrorMessage);
00063                 return null;
00064             }
00065
00066             ContactAnnotationList annotationList;
00067             IReadOnlyList<ContactAnnotationList> annotationLists = await annotationStore.FindAnnotationListsAsync();
00068             if (0 == annotationLists.Count)
00069             {
00070                 annotationList = await annotationStore.CreateAnnotationListAsync();
00071             }
00072             else
00073             {
00074                 annotationList = annotationLists[0];
00075             }
00076
00077             return annotationList;
00078         }
00079
00080         private async void CreateTestContacts()
00081         {
00082             //
00083             // Creating two test contacts with email address and phone number.
00084             //
00085
00086             Contact contact1 = new Contact();
00087             contact1.FirstName = "TestContact1";
00088
00089             ContactEmail email1 = new ContactEmail();
00090             email1.Address = "TestContact1@contoso.com";
00091             contact1.Emails.Add(email1);
00092
00093             ContactPhone phone1 = new ContactPhone();
00094             phone1.Number = "4255550100";
00095             contact1.Phones.Add(phone1);
00096
00097             Contact contact2 = new Contact();
00098             contact2.FirstName = "TestContact2";
00099
00100             ContactEmail email2 = new ContactEmail();
00101             email2.Address = "TestContact2@contoso.com";
00102             email2.Kind = ContactEmailKind.Other;
00103             contact2.Emails.Add(email2);
00104
00105             ContactPhone phone2 = new ContactPhone();
00106             phone2.Number = "4255550101";
00107             phone2.Kind = ContactPhoneKind.Mobile;
00108             contact2.Phones.Add(phone2);
00109
00110             // Save the contacts
00111             ContactList contactList = await _GetContactList();
00112             if (null == contactList)
00113             {
00114                 return;
00115             }
00116
00117             await contactList.SaveContactAsync(contact1);
00118             await contactList.SaveContactAsync(contact2);
00119
00120             //
00121             // Create annotations for those test contacts.
00122             // Annotation is the contact meta data that allows People App to generate deep links
00123             // in the contact card that takes the user back into this app.
00124             //
00125
00126             ContactAnnotationList annotationList = await _GetContactAnnotationList();
00127             if (null == annotationList)
00128             {
00129                 return;
00130             }
00131
00132             ContactAnnotation annotation = new ContactAnnotation();
00133             annotation.ContactId = contact1.Id;
00134
00135             // Remote ID: The identifier of the user relevant for this app. When this app is
00136             // launched into from the People App, this id will be provided as context on which user
00137             // the operation (e.g. ContactProfile) is for.
00138             annotation.RemoteId = "user12";
00139
00140             // The supported operations flags indicate that this app can fulfill these operations
00141             // for this contact. These flags are read by apps such as the People App to create deep
00142             // links back into this app. This app must also be registered for the relevant
00143             // protocols in the Package.appxmanifest (in this case, ms-contact-profile).
00144             annotation.SupportedOperations = ContactAnnotationOperations.ContactProfile;
00145
00146             if (!await annotationList.TrySaveAnnotationAsync(annotation))
00147             {
00148                 rootPage.NotifyUser("Failed to save annotation for TestContact1 to the store.", NotifyType.ErrorMessage);
00149                 return;
00150             }
00151
00152             annotation = new ContactAnnotation();
00153             annotation.ContactId = contact2.Id;
00154             annotation.RemoteId = "user22";
00155
00156             // You can also specify multiple supported operations for a contact in a single
00157             // annotation. In this case, this annotation indicates that the user can be
00158             // communicated via VOIP call, Video Call, or IM via this application.
00159             annotation.SupportedOperations = ContactAnnotationOperations.Message |
00160                 ContactAnnotationOperations.AudioCall |
00161                 ContactAnnotationOperations.VideoCall;
00162
00163             if (!await annotationList.TrySaveAnnotationAsync(annotation))
00164             {
00165                 rootPage.NotifyUser("Failed to save annotation for TestContact2 to the store.", NotifyType.ErrorMessage);
00166                 return;
00167             }
00168
00169             rootPage.NotifyUser("Sample data created successfully.", NotifyType.StatusMessage);
00170         }
00171
00172         private async void DeleteTestContacts()
00173         {
00174             ContactList contactList = null;
00175             ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
00176             if (null != store)
00177             {
00178                 IReadOnlyList<ContactList> contactLists = await store.FindContactListsAsync();
00179                 if (0 < contactLists.Count)
00180                 {
00181                     contactList = contactLists[0];
00182                 }
00183             }
00184
00185             if (null != contactList)
00186             {
00187                 await contactList.DeleteAsync();
00188                 rootPage.NotifyUser("Sample data deleted.", NotifyType.StatusMessage);
00189             }
00190             else
00191             {
00192                 rootPage.NotifyUser("Could not delete sample data.", NotifyType.ErrorMessage);
00193             }
00194         }
00195     }
00196 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Cursor.cpp Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

Cursor.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Cursor.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 using namespace HolographicMRCSample;
00006 using namespace Concurrency;
00007 using namespace DirectX;
00008 using namespace Windows::Foundation::Numerics;
00009 using namespace Windows::UI::Input::Spatial;
00010
00011 // Loads vertex and pixel shaders from files and instantiates the cube geometry.
00012 Cursor::Cursor(const float width, const float height) :
00013     m_size(float2(width, height)),
00014     m_textureIndex(DX::Texture_Cursor)
00015 {
00016 }
00017
00018 void Cursor::Initialize(const std::shared_ptr<DX::DeviceResources>& deviceResources)
00019 {
00020     m_deviceResources = deviceResources;
00021
00022     CreateDeviceDependentResources();
00023 }
00024
00025 // Called once per frame. Rotates the cube, and calculates and sets the model matrix
00026 // relative to the position transform indicated by hologramPositionTransform.
00027 void Cursor::Update(
00028     const DX::StepTimer& timer,
00029     HolographicFrame^ holographicFrame,
00030     SpatialCoordinateSystem^ currentCoordinateSystem,
00031     SpatialInteractionSourceState^ interactionSource)
00032 {
00033     XMMATRIX modelTransform;
00034
00035     PositionCursor(SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem,
00036                                                          holographicFrame->CurrentPrediction->Timestamp),
00037                    modelTransform);
00038
00039     // The view and projection matrices are provided by the system; they are associated
00040     // with holographic cameras, and updated on a per-camera basis.
00041     // Here, we provide the model transform for the sample hologram. The model transform
00042     // matrix is transposed to prepare it for the shader.
00043     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
00044     m_modelConstantBufferData.color.x = 0.0f;
00045     m_modelConstantBufferData.color.y = 0.0f;
00046     m_modelConstantBufferData.color.z = 0.0f;
00047     m_modelConstantBufferData.color.w = 0.0f;
00048 }
00049
00050 // Renders one frame using the vertex and pixel shaders.
00051 // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00052 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00053 // a pass-through geometry shader is also used to set the render
00054 // target array index.
00055 void Cursor::Render()
00056 {
00057     // Loading is asynchronous. Resources must be created before drawing can occur.
00058     if (!m_loadingComplete)
00059     {
00060         return;
00061     }
00062
00063     const auto context = m_deviceResources->GetD3DDeviceContext();
00064
00065     // Update the model transform buffer for the hologram.
00066     context->UpdateSubresource(
00067         m_modelConstantBuffer.Get(),
00068         0,
00069         nullptr,
00070         &m_modelConstantBufferData,
00071         0,
00072         0
00073         );
00074
00075     // Each vertex is one instance of the VertexPositionTexture struct.
00076     const UINT stride = sizeof(VertexPositionTexture);
00077     const UINT offset = 0;
00078     context->IASetVertexBuffers(
00079         0,
00080         1,
00081         m_vertexBuffer.GetAddressOf(),
00082         &stride,
00083         &offset
00084         );
00085     context->IASetIndexBuffer(
00086         m_indexBuffer.Get(),
00087         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00088         0
00089         );
00090     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00091     context->IASetInputLayout(m_inputLayout.Get());
00092
00093     // Attach the vertex shader.
00094     context->VSSetShader(
00095         m_vertexShader.Get(),
00096         nullptr,
00097         0
00098         );
00099     // Apply the model constant buffer to the vertex shader.
00100     context->VSSetConstantBuffers(
00101         0,
00102         1,
00103         m_modelConstantBuffer.GetAddressOf()
00104         );
00105
00106     if (!m_usingVprtShaders)
00107     {
00108         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00109         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00110         // a pass-through geometry shader is used to set the render target
00111         // array index.
00112         context->GSSetShader(
00113             m_geometryShader.Get(),
00114             nullptr,
00115             0
00116             );
00117     }
00118
00119     // Set Texture Resource view
00120     context->PSSetShaderResources(0, 1, m_cursorTextureView.GetAddressOf());
00121
00122     // Set Sampler
00123     context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());
00124
00125     // Attach the pixel shader.
00126     context->PSSetShader(
00127         m_pixelShader.Get(),
00128         nullptr,
00129         0
00130         );
00131
00132     // Draw the objects.
00133     context->DrawIndexedInstanced(
00134         m_indexCount,   // Index count per instance.
00135         2,              // Instance count.
00136         0,              // Start index location.
00137         0,              // Base vertex location.
00138         0               // Start instance location.
00139         );
00140 }
00141
00142 void Cursor::CreateDeviceDependentResources()
00143 {
00144     if (m_loadingComplete)
00145     {
00146         return;
00147     }
00148
00149     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00150
00151     // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00152     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00153     // we can avoid using a pass-through geometry shader to set the render
00154     // target array index, thus avoiding any overhead that would be
00155     // incurred by setting the geometry shader stage.
00156
00157     m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Texture);
00158     m_inputLayout = m_deviceResources->GetInputLayout(DX::VertexShader_Texture);
00159     m_pixelShader = m_deviceResources->GetPixelShader(DX::PixelShader_Cursor);
00160
00161     D3D11_TEXTURE2D_DESC texDesc;
00162     D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
00163     ZeroMemory(&viewDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
00164     const auto context = m_deviceResources->GetD3DDeviceContext();
00165
00166     // Load Pressed Button texture and create resource view
00167     Microsoft::WRL::ComPtr<ID3D11Resource> spResource;
00168     Microsoft::WRL::ComPtr<ID3D11Texture2D> spTexture;
00169     spResource = m_deviceResources->GetTexture(DX::Texture_Cursor);
00170     DX::ThrowIfFailed(spResource.As(&spTexture));
00171
00172     spTexture->GetDesc(&texDesc);
00173     viewDesc.Format = texDesc.Format;
00174     viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
00175     viewDesc.Texture2D.MostDetailedMip = 0;
00176     viewDesc.Texture2D.MipLevels = 1;
00177     DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateShaderResourceView(spResource.Get(), &viewDesc, m_cursorTextureView.ReleaseAndGetAddressOf()));
00178
00179     if (!m_usingVprtShaders)
00180     {
00181         // Get the pass-through geometry shader.
00182         m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Texture);
00183     }
00184
00185     // After the pixel shader file is loaded, create the shader and constant buffer.
00186     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelColorConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00187     DX::ThrowIfFailed(
00188         m_deviceResources->GetD3DDevice()->CreateBuffer(
00189             &constantBufferDesc,
00190             nullptr,
00191             &m_modelConstantBuffer));
00192
00193     // Once all shaders are loaded, create the mesh.
00194     {
00195         float halfWidth  = m_size.x * 0.5f;
00196         float halfHeight = m_size.y * 0.5f;
00197
00198         // Load mesh vertices. Each vertex has a position and a texture UV.
00199         const VertexPositionTexture cubeVertices[] =
00200         {
00201             { XMFLOAT3(-halfWidth, -halfHeight,  0.0f), XMFLOAT2(0.0f, 1.0f) }, // 0 (1)
00202             { XMFLOAT3(-halfWidth,  halfHeight,  0.0f), XMFLOAT2(0.0f, 0.0f) }, // 1 (3)
00203             { XMFLOAT3( halfWidth, -halfHeight,  0.0f), XMFLOAT2(1.0f, 1.0f) }, // 2 (5)
00204             { XMFLOAT3( halfWidth,  halfHeight,  0.0f), XMFLOAT2(1.0f, 0.0f) }, // 3 (7)
00205         };
00206
00207         D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
00208         vertexBufferData.pSysMem = cubeVertices;
00209         vertexBufferData.SysMemPitch = 0;
00210         vertexBufferData.SysMemSlicePitch = 0;
00211         const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
00212         DX::ThrowIfFailed(
00213             m_deviceResources->GetD3DDevice()->CreateBuffer(
00214                 &vertexBufferDesc,
00215                 &vertexBufferData,
00216                 &m_vertexBuffer
00217                 )
00218             );
00219
00220         // Load mesh indices. Each trio of indices represents
00221         // a triangle to be rendered on the screen.
00222         // For example: 2,1,0 means that the vertices with indexes
00223         // 2, 1, and 0 from the vertex buffer compose the
00224         // first triangle of this mesh.
00225         // Note that the winding order is clockwise by default.
00226         static const unsigned short cubeIndices [] =
00227         {
00228             0,1,3,
00229             0,3,2,
00230         };
00231
00232         m_indexCount = ARRAYSIZE(cubeIndices);
00233
00234         D3D11_SUBRESOURCE_DATA indexBufferData = {0};
00235         indexBufferData.pSysMem          = cubeIndices;
00236         indexBufferData.SysMemPitch      = 0;
00237         indexBufferData.SysMemSlicePitch = 0;
00238         const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
00239         DX::ThrowIfFailed(
00240             m_deviceResources->GetD3DDevice()->CreateBuffer(
00241                 &indexBufferDesc,
00242                 &indexBufferData,
00243                 &m_indexBuffer
00244                 )
00245             );
00246     }
00247
00248     // Create the sample state
00249     D3D11_SAMPLER_DESC sampDesc;
00250     ZeroMemory(&sampDesc, sizeof(sampDesc));
00251     sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
00252     sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
00253     sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
00254     sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
00255     sampDesc.MaxLOD = D3D11_FLOAT32_MAX;
00256     sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
00257
00258     DX::ThrowIfFailed(
00259         m_deviceResources->GetD3DDevice()->CreateSamplerState(
00260             &sampDesc,
00261             m_samplerState.ReleaseAndGetAddressOf()));
00262
00263
00264     // Once the cube is loaded, the object is ready to be rendered.
00265     m_loadingComplete = true;
00266 }
00267
00268 void Cursor::ReleaseDeviceDependentResources()
00269 {
00270     m_inputLayout.Reset();
00271     m_vertexBuffer.Reset();
00272     m_indexBuffer.Reset();
00273     m_vertexShader.Reset();
00274     m_geometryShader.Reset();
00275     m_pixelShader.Reset();
00276     m_modelConstantBuffer.Reset();
00277     m_samplerState.Reset();
00278     m_cursorTextureView.Reset();
00279
00280     m_loadingComplete = false;
00281     m_usingVprtShaders = false;
00282 }
00283
00284 void Cursor::PositionCursor(
00285     SpatialPointerPose^ pointerPose,
00286     XMMATRIX &modelRotation)
00287 {
00288     if (pointerPose != nullptr)
00289     {
00290         // Get the gaze direction relative to the given coordinate system.
00291         const float3 headPosition  = pointerPose->Head->Position;
00292         const float3 headDirection = pointerPose->Head->ForwardDirection;
00293
00294         const float3 gazeAtTwoMeters = headPosition + (m_distance * headDirection);
00295
00296         // This will be used as the translation component of the hologram's
00297         // model transform.
00298         const float3 position = gazeAtTwoMeters;
00299
00300         XMVECTOR facingNormal = XMVector3Normalize(-XMLoadFloat3(&position));
00301         XMVECTOR xAxisRotation = XMVector3Normalize(XMVectorSet(XMVectorGetZ(facingNormal), 0.0f, -XMVectorGetX(facingNormal), 0.0f));
00302         XMVECTOR yAxisRotation = XMVector3Normalize(XMVector3Cross(facingNormal, xAxisRotation));
00303         modelRotation = XMMATRIX(xAxisRotation,
00304                                  yAxisRotation,
00305                                  facingNormal,
00306                                  XMVectorSet(0.0f, 0.0f, 0.0f, 1.0f)) *
00307                         XMMatrixTranslationFromVector(XMLoadFloat3(&position));
00308     }
00309 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/pch.cpp Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPIRenderer.cpp Source File

  • WindowsAudioSession
  • cppwinrt

WASAPIRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "WASAPIRenderer.h"
00013
00014 using namespace winrt::Windows::Media::Devices;
00015
00016 namespace winrt::SDKTemplate
00017 {
00018     //
00019     //  InitializeAudioDeviceAsync()
00020     //
00021     //  Activates the default audio renderer on a asynchronous callback thread.
00022     //
00023     void WASAPIRenderer::AsyncInitializeAudioDevice() noexcept try
00024     {
00025         // Get a string representing the Default Audio Device Renderer
00026         m_DeviceIdString = MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default);
00027
00028         // This call can be made safely from a background thread because we are asking for the IAudioClient3
00029         // interface of an audio device. Async operation will call back to
00030         // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
00031         com_ptr<IActivateAudioInterfaceAsyncOperation> asyncOp;
00032         check_hresult(ActivateAudioInterfaceAsync(m_DeviceIdString.c_str(), __uuidof(IAudioClient3), nullptr, this, asyncOp.put()));
00033     }
00034     catch (...)
00035     {
00036         SetState(DeviceState::Error, to_hresult());
00037     }
00038
00039     //
00040     //  ActivateCompleted()
00041     //
00042     //  Callback implementation of ActivateAudioInterfaceAsync function.  This will be called on MTA thread
00043     //  when results of the activation are available.
00044     //
00045     HRESULT WASAPIRenderer::ActivateCompleted(IActivateAudioInterfaceAsyncOperation* operation) noexcept try
00046     {
00047         if (m_deviceState != DeviceState::Uninitialized)
00048         {
00049             throw hresult_error(E_NOT_VALID_STATE);
00050         }
00051
00052         // Check for a successful activation result
00053         HRESULT hrActivateResult = S_OK;
00054         com_ptr<::IUnknown> punkAudioInterface;
00055         check_hresult(operation->GetActivateResult(&hrActivateResult, punkAudioInterface.put()));
00056         check_hresult(hrActivateResult);
00057
00058         // Remember that we have been activated, but don't raise the event yet.
00059         SetStateNoNotify(DeviceState::Activated);
00060
00061         // Get the pointer for the Audio Client
00062         m_AudioClient = punkAudioInterface.as<IAudioClient3>();
00063
00064         // Configure user defined properties
00065         check_hresult(ConfigureDeviceInternal());
00066
00067         // Initialize the AudioClient in Shared Mode with the user specified buffer
00068         if (!m_IsLowLatency || m_IsHWOffload)
00069         {
00070             check_hresult(m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
00071                 AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
00072                 m_hnsBufferDuration,
00073                 m_hnsBufferDuration,
00074                 m_MixFormat.get(),
00075                 nullptr));
00076         }
00077         else
00078         {
00079             check_hresult(m_AudioClient->InitializeSharedAudioStream(
00080                 AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
00081                 m_MinPeriodInFrames,
00082                 m_MixFormat.get(),
00083                 nullptr));
00084         }
00085
00086         // Get the maximum size of the AudioClient Buffer
00087         check_hresult(m_AudioClient->GetBufferSize(&m_BufferFrames));
00088
00089         // Get the render client
00090         m_AudioRenderClient.capture(m_AudioClient, &IAudioClient::GetService);
00091
00092         // Create Async callback for sample events
00093         check_hresult(MFCreateAsyncResult(nullptr, &m_SampleReadyCallback, nullptr, m_SampleReadyAsyncResult.put()));
00094
00095         // Sets the event handle that the system signals when an audio buffer is ready to be processed by the client
00096         check_hresult(m_AudioClient->SetEventHandle(m_SampleReadyEvent.get()));
00097
00098         // Everything succeeded
00099         SetState(DeviceState::Initialized, S_OK);
00100
00101         return S_OK;
00102     }
00103     catch (...)
00104     {
00105         SetState(DeviceState::Error, to_hresult());
00106         m_AudioClient = nullptr;
00107         m_AudioRenderClient = nullptr;
00108         m_SampleReadyAsyncResult = nullptr;
00109
00110         // Must return S_OK even on failure.
00111         return S_OK;
00112     }
00113
00114     //
00115     //  GetBufferFramesPerPeriod()
00116     //
00117     //  Get the time in seconds between passes of the audio device
00118     //
00119     UINT32 WASAPIRenderer::GetBufferFramesPerPeriod() noexcept
00120     {
00121         REFERENCE_TIME defaultDevicePeriod = 0;
00122         REFERENCE_TIME minimumDevicePeriod = 0;
00123
00124         if (m_IsHWOffload)
00125         {
00126             return m_BufferFrames;
00127         }
00128
00129         if (m_IsLowLatency)
00130         {
00131             return m_MinPeriodInFrames;
00132         }
00133
00134         // Get the audio device period
00135         HRESULT hr = m_AudioClient->GetDevicePeriod(&defaultDevicePeriod, &minimumDevicePeriod);
00136         if (FAILED(hr))
00137         {
00138             return 0;
00139         }
00140
00141         double devicePeriodInSeconds = defaultDevicePeriod / (10000.0 * 1000.0);
00142         return static_cast<UINT32>(m_MixFormat->nSamplesPerSec * devicePeriodInSeconds + 0.5);
00143     }
00144
00145     //
00146     //  ConfigureDeviceInternal()
00147     //
00148     //  Sets additional playback parameters and opts into hardware offload
00149     //
00150     HRESULT WASAPIRenderer::ConfigureDeviceInternal() noexcept try
00151     {
00152         if (m_deviceState != DeviceState::Activated)
00153         {
00154             return E_NOT_VALID_STATE;
00155         }
00156
00157         // Opt into HW Offloading.  If the endpoint does not support offload it will return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE
00158         AudioClientProperties audioProps = { 0 };
00159         audioProps.cbSize = sizeof(AudioClientProperties);
00160         audioProps.bIsOffload = m_IsHWOffload;
00161         audioProps.eCategory = AudioCategory_Media;
00162
00163         if (m_IsRawAudio)
00164         {
00165             audioProps.Options = AUDCLNT_STREAMOPTIONS_RAW;
00166         }
00167
00168         check_hresult(m_AudioClient->SetClientProperties(&audioProps));
00169
00170         // If application already has a preferred source format available,
00171         // it can test whether the format is supported by the device:
00172         //
00173         // unique_cotaskmem_ptr<WAVEFORMATEX> applicationFormat = { ... };
00174         // if (S_OK == m_AudioClient->IsFormatSupported(applicationFormat.get()))
00175         // {
00176         //     m_MixFormat = std::move(applicationFormat);
00177         // }
00178         // else
00179         // {
00180         //     // device does not support the application format, so ask the device what format it prefers
00181         //     check_hresult(m_AudioClient->GetMixFormat(&m_MixFormat.put()));
00182         // }
00183
00184         // This sample opens the device is shared mode so we need to find the supported WAVEFORMATEX mix format
00185         check_hresult(m_AudioClient->GetMixFormat(m_MixFormat.put()));
00186
00187         if (!audioProps.bIsOffload)
00188         {
00189             // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
00190             // to be the current engine format based on the processing mode for this stream
00191             check_hresult(m_AudioClient->GetSharedModeEnginePeriod(m_MixFormat.get(), &m_DefaultPeriodInFrames, &m_FundamentalPeriodInFrames, &m_MinPeriodInFrames, &m_MaxPeriodInFrames));
00192         }
00193
00194         // Verify the user defined value for hardware buffer
00195         ValidateBufferValue();
00196
00197         return S_OK;
00198     }
00199     catch (...) { return to_hresult(); }
00200
00201     //
00202     //  ValidateBufferValue()
00203     //
00204     //  Verifies the user specified buffer value for hardware offload
00205     //  Throws an exception on failure.
00206     //
00207     void WASAPIRenderer::ValidateBufferValue()
00208     {
00209         if (!m_IsHWOffload)
00210         {
00211             // If we aren't using HW Offload, set this to 0 to use the default value
00212             m_hnsBufferDuration = 0;
00213             return;
00214         }
00215
00216         REFERENCE_TIME hnsMinBufferDuration;
00217         REFERENCE_TIME hnsMaxBufferDuration;
00218
00219         check_hresult(m_AudioClient->GetBufferSizeLimits(m_MixFormat.get(), true, &hnsMinBufferDuration, &hnsMaxBufferDuration));
00220         if (m_hnsBufferDuration < hnsMinBufferDuration)
00221         {
00222             // using MINIMUM size instead
00223             m_hnsBufferDuration = hnsMinBufferDuration;
00224         }
00225         else if (m_hnsBufferDuration > hnsMaxBufferDuration)
00226         {
00227             // using MAXIMUM size instead
00228             m_hnsBufferDuration = hnsMaxBufferDuration;
00229         }
00230     }
00231
00232     HRESULT WASAPIRenderer::SetVolumeOnSession(double volumePercent) noexcept try
00233     {
00234         // Convert [0.100] to [0..1] range and clamp
00235         m_channelVolume = (volumePercent < 0.0) ? 0.0f : (volumePercent > 100.0) ? 1.0f : (float)(volumePercent / 100.0);
00236
00237         // Set the session volume on the endpoint if we have one.
00238         if (m_AudioClient)
00239         {
00240             SetAudioClientChannelVolume();
00241         }
00242
00243         return S_OK;
00244     }
00245     catch (...) { return to_hresult(); }
00246
00247     void WASAPIRenderer::SetAudioClientChannelVolume()
00248     {
00249         check_hresult(capture<ISimpleAudioVolume>(m_AudioClient, &IAudioClient3::GetService)->SetMasterVolume(m_channelVolume, nullptr));
00250     }
00251
00252
00253     //
00254     //  ConfigureSource()
00255     //
00256     //  Configures tone or file playback
00257     //
00258     void WASAPIRenderer::ConfigureSource()
00259     {
00260         UINT32 FramesPerPeriod = GetBufferFramesPerPeriod();
00261
00262         switch (m_contentType)
00263         {
00264         case ContentType::Tone:
00265             // Generate the sine wave sample buffer
00266             m_ToneSource = std::make_unique<ToneSampleGenerator>();
00267             m_ToneSource->GenerateSampleBuffer(m_Frequency, FramesPerPeriod, m_MixFormat.get());
00268             break;
00269
00270         case ContentType::File:
00271             m_MFSource = make_self<MFSampleGenerator>();
00272             // This will throw if the stream cannot be decoded.
00273             m_MFSource->Initialize(m_ContentStream, FramesPerPeriod, m_MixFormat.get());
00274             break;
00275
00276         default:
00277             assert(false);
00278             std::terminate();
00279         }
00280     }
00281
00282     //
00283     //  StartPlaybackAsync()
00284     //
00285     //  Starts asynchronous playback on a separate thread via MF Work Item
00286     //  Errors are reported via the DeviceStateChanged event.
00287     //
00288     void WASAPIRenderer::StartPlayback() noexcept try
00289     {
00290         switch (m_deviceState)
00291         {
00292         // We should be stopped if the user stopped playback, or we should be
00293         // initialized if this is the first time through getting ready to playback.
00294         case DeviceState::Stopped:
00295         case DeviceState::Initialized:
00296             // Setup either ToneGeneration or File Playback
00297             ConfigureSource();
00298
00299             SetState(DeviceState::Starting, S_OK);
00300             check_hresult(MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StartPlaybackCallback, nullptr));
00301             break;
00302
00303         case DeviceState::Paused:
00304             check_hresult(MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StartPlaybackCallback, nullptr));
00305             break;
00306
00307         default:
00308             // Otherwise something else happened
00309             throw hresult_error(E_FAIL);
00310         }
00311     }
00312     catch (...)
00313     {
00314         hresult error = to_hresult();
00315         SetState(DeviceState::Error, error);
00316     }
00317
00318     //
00319     //  OnStartPlayback()
00320     //
00321     //  Callback method to start playback
00322     //
00323     HRESULT WASAPIRenderer::OnStartPlayback(IMFAsyncResult*) noexcept try
00324     {
00325         // Pre-Roll the buffer with silence
00326         OnAudioSampleRequested(true);
00327
00328         // For MF Source playback, need to start the source reader
00329         if (m_contentType == ContentType::File)
00330         {
00331             m_MFSource->StartSource();
00332         }
00333
00334         // Set the initial volume.
00335         SetAudioClientChannelVolume();
00336
00337         // Actually start the playback
00338         check_hresult(m_AudioClient->Start());
00339
00340         SetState(DeviceState::Playing, S_OK);
00341         check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_SampleReadyAsyncResult.get(), &m_SampleReadyKey));
00342
00343         return S_OK;
00344     }
00345     catch (...)
00346     {
00347         SetState(DeviceState::Error, to_hresult());
00348         // Must return S_OK.
00349         return S_OK;
00350     }
00351
00352     //
00353     //  StopPlaybackAsync()
00354     //
00355     //  Stop playback asynchronously via MF Work Item
00356     //
00357     HRESULT WASAPIRenderer::StopPlaybackAsync() noexcept
00358     {
00359         if ((m_deviceState != DeviceState::Playing) &&
00360             (m_deviceState != DeviceState::Paused) &&
00361             (m_deviceState != DeviceState::Error))
00362         {
00363             return E_NOT_VALID_STATE;
00364         }
00365
00366         SetState(DeviceState::Stopping, S_OK);
00367
00368         return MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_StopPlaybackCallback, nullptr);
00369     }
00370
00371     //
00372     //  OnStopPlayback()
00373     //
00374     //  Callback method to stop playback
00375     //
00376     HRESULT WASAPIRenderer::OnStopPlayback(IMFAsyncResult*)
00377     {
00378         // Stop playback by cancelling Work Item
00379         // Cancel the queued work item (if any)
00380         if (0 != m_SampleReadyKey)
00381         {
00382             MFCancelWorkItem(m_SampleReadyKey);
00383             m_SampleReadyKey = 0;
00384         }
00385
00386         // Flush anything left in buffer with silence, best effort.
00387         try
00388         {
00389             OnAudioSampleRequested(true);
00390         }
00391         catch (...) { }
00392
00393         m_AudioClient->Stop();
00394         m_SampleReadyAsyncResult = nullptr;
00395
00396         switch (m_contentType)
00397         {
00398         case ContentType::Tone:
00399             // Flush remaining buffers
00400             m_ToneSource->Flush();
00401             break;
00402
00403         case ContentType::File:
00404             // Stop Source and Flush remaining buffers
00405             m_MFSource->StopSource();
00406             m_MFSource->Shutdown();
00407             break;
00408         }
00409
00410         SetState(DeviceState::Stopped);
00411
00412         return S_OK;
00413     }
00414
00415     //
00416     //  PausePlaybackAsync()
00417     //
00418     //  Pause playback asynchronously via MF Work Item
00419     //
00420     HRESULT WASAPIRenderer::PausePlaybackAsync()
00421     {
00422         if ((m_deviceState != DeviceState::Playing) &&
00423             (m_deviceState != DeviceState::Error))
00424         {
00425             return E_NOT_VALID_STATE;
00426         }
00427
00428         // Change state to stop automatic queueing of samples
00429         // Don't notify clients.
00430         SetStateNoNotify(DeviceState::Pausing);
00431
00432         return MFPutWorkItem2(MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_PausePlaybackCallback, nullptr);
00433
00434     }
00435
00436     //
00437     //  OnPausePlayback()
00438     //
00439     //  Callback method to pause playback
00440     //
00441     HRESULT WASAPIRenderer::OnPausePlayback(IMFAsyncResult*)
00442     {
00443         m_AudioClient->Stop();
00444         SetState(DeviceState::Paused, S_OK);
00445
00446         return S_OK;
00447     }
00448
00449     //
00450     //  OnSampleReady()
00451     //
00452     //  Callback method when ready to fill sample buffer
00453     //
00454     HRESULT WASAPIRenderer::OnSampleReady(IMFAsyncResult*) try
00455     {
00456         OnAudioSampleRequested(false);
00457
00458         // Re-queue work item for next sample
00459         if (m_deviceState == DeviceState::Playing)
00460         {
00461             check_hresult(MFPutWaitingWorkItem(m_SampleReadyEvent.get(), 0, m_SampleReadyAsyncResult.get(), &m_SampleReadyKey));
00462         }
00463
00464         return S_OK;
00465     }
00466     catch (...)
00467     {
00468         hresult error = to_hresult();
00469         SetState(DeviceState::Error, error);
00470         return error;
00471     }
00472
00473     //
00474     //  OnAudioSampleRequested()
00475     //
00476     //  Called when audio device fires m_SampleReadyEvent
00477     //
00478     void WASAPIRenderer::OnAudioSampleRequested(bool IsSilence) try
00479     {
00480
00481         auto guard = slim_lock_guard(m_lock);
00482
00483         // Get padding in existing buffer
00484         UINT32 PaddingFrames = 0;
00485         check_hresult(m_AudioClient->GetCurrentPadding(&PaddingFrames));
00486
00487         // GetCurrentPadding represents the number of queued frames
00488         // so we can subtract that from the overall number of frames we have
00489         uint32_t framesAvailable = m_BufferFrames - PaddingFrames;
00490
00491         // Only continue if we have buffer to write data
00492         if (framesAvailable == 0)
00493         {
00494             return;
00495         }
00496
00497         if (IsSilence)
00498         {
00499             // Fill the buffer with silence
00500             uint8_t* data;
00501             check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
00502             check_hresult(m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT));
00503             return;
00504         }
00505
00506         // Even if we cancel a work item, this may still fire due to the async
00507         // nature of things.  There should be a queued work item already to handle
00508         // the process of stopping or stopped
00509         if (m_deviceState == DeviceState::Playing)
00510         {
00511             // Fill the buffer with a playback sample
00512             switch (m_contentType)
00513             {
00514             case ContentType::Tone:
00515                 GetToneSample(framesAvailable);
00516                 break;
00517
00518             case ContentType::File:
00519                 GetMFSample(framesAvailable);
00520                 break;
00521             }
00522         }
00523     }
00524     catch (hresult_error const& error)
00525     {
00526         if (error.code() != AUDCLNT_E_RESOURCES_INVALIDATED)
00527         {
00528             throw;
00529         }
00530
00531         // Attempt auto-recovery from loss of resources.
00532         SetStateNoNotify(DeviceState::Uninitialized);
00533         m_AudioClient = nullptr;
00534         m_AudioRenderClient = nullptr;
00535         m_SampleReadyAsyncResult = nullptr;
00536
00537         AsyncInitializeAudioDevice();
00538     }
00539
00540     //
00541     //  GetToneSample()
00542     //
00543     //  Fills buffer with a tone sample
00544     //
00545     void WASAPIRenderer::GetToneSample(uint32_t framesAvailable)
00546     {
00547         uint8_t* data;
00548
00549         // Post-Roll Silence
00550         if (m_ToneSource->IsEOF())
00551         {
00552             check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
00553             // Ignore the return
00554             m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);
00555
00556             StopPlaybackAsync();
00557         }
00558         else if (m_ToneSource->GetBufferLength() <= (framesAvailable * m_MixFormat->nBlockAlign))
00559         {
00560             uint32_t actualFramesToRead = m_ToneSource->GetBufferLength() / m_MixFormat->nBlockAlign;
00561             uint32_t actualBytesToRead = actualFramesToRead * m_MixFormat->nBlockAlign;
00562
00563             check_hresult(m_AudioRenderClient->GetBuffer(actualFramesToRead, &data));
00564             if (actualBytesToRead > 0)
00565             {
00566                 m_ToneSource->FillSampleBuffer({ data, actualBytesToRead });
00567             }
00568             check_hresult(m_AudioRenderClient->ReleaseBuffer(actualFramesToRead, 0));
00569         }
00570     }
00571
00572     //
00573     //  GetMFSample()
00574     //
00575     //  Fills buffer with a MF sample
00576     //
00577     void WASAPIRenderer::GetMFSample(uint32_t framesAvailable)
00578     {
00579         BYTE* data = nullptr;
00580
00581         // Post-Roll Silence
00582         if (m_MFSource->IsEOF())
00583         {
00584             check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
00585             // Ignore the return
00586             m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);
00587
00588             StopPlaybackAsync();
00589         }
00590         else
00591         {
00592             uint32_t actualBytesRead = 0;
00593             uint32_t actualBytesToRead = framesAvailable * m_MixFormat->nBlockAlign;
00594
00595             check_hresult(m_AudioRenderClient->GetBuffer(framesAvailable, &data));
00596             if (!m_MFSource->FillSampleBuffer({ data, actualBytesToRead }, &actualBytesRead))
00597             {
00598                 // Hit EOS
00599                 m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT);
00600                 StopPlaybackAsync();
00601             }
00602             else
00603             {
00604                 // This can happen if we are pre-rolling so just insert silence
00605                 if (0 == actualBytesRead)
00606                 {
00607                     check_hresult(m_AudioRenderClient->ReleaseBuffer(framesAvailable, AUDCLNT_BUFFERFLAGS_SILENT));
00608                 }
00609                 else
00610                 {
00611                     check_hresult(m_AudioRenderClient->ReleaseBuffer(actualBytesRead / m_MixFormat->nBlockAlign, 0));
00612                 }
00613             }
00614         }
00615     }
00616 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cppwinrt/pch.h Source File

  • IoT-SPI
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Devices.Spi.h"
00008 #include "winrt/Windows.Devices.Enumeration.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.h Source File

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

BackgroundDeviceWatcherTask.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft Corporation. All rights reserved.
00002
00003 #pragma once
00004
00005 using namespace Windows::ApplicationModel::Background;
00006
00007 namespace BackgroundDeviceWatcherTaskCpp
00008 {
00009     [Windows::Foundation::Metadata::WebHostHidden]
00010     public ref class BackgroundDeviceWatcher sealed : public IBackgroundTask
00011     {
00012     public:
00013         BackgroundDeviceWatcher() {}
00014
00015         virtual void Run(IBackgroundTaskInstance^ taskInstance);
00016     };
00017 }
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario6_CustomFilterAddedProps.xaml.cs Source File

  • DeviceEnumerationAndPairing
  • cs

Scenario6_CustomFilterAddedProps.xaml.cs

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.ObjectModel;
00005 using Windows.Devices.Enumeration;
00006 using Windows.Foundation;
00007 using Windows.UI.Core;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Navigation;
00011
00012 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00013
00014 namespace SDKTemplate
00015 {
00016     /// <summary>
00017     /// An empty page that can be used on its own or navigated to within a Frame.
00018     /// </summary>
00019     public sealed partial class Scenario6_CustomFilterAddedProps : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         private DeviceWatcherHelper deviceWatcherHelper;
00024
00025         private ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>();
00026
00027         public Scenario6_CustomFilterAddedProps()
00028         {
00029             this.InitializeComponent();
00030
00031             deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
00032         }
00033
00034         protected override void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             resultsListView.ItemsSource = resultCollection;
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             deviceWatcherHelper.Reset();
00042         }
00043
00044         private void StartWatcherButton_Click(object sender, RoutedEventArgs e)
00045         {
00046             StartWatcher();
00047         }
00048
00049         private void StopWatcherButton_Click(object sender, RoutedEventArgs e)
00050         {
00051             StopWatcher();
00052         }
00053
00054         private void StartWatcher()
00055         {
00056             aqsFilterTextBox.IsEnabled = false;
00057             startWatcherButton.IsEnabled = false;
00058             resultCollection.Clear();
00059
00060             // Request some additional properties.  In this saample, these extra properties are just used in the ResultsListViewTemplate.
00061             // Take a look there in the XAML. Also look at the converter used by the XAML GeneralPropertyValueConverter.  In general you just use
00062             // DeviceInformation.Properties["<property name>"] to get a property. e.g. DeviceInformation.Properties["System.Devices.InterfaceClassGuid"].
00063             string[] requestedProperties = new string[] {
00064                 "System.Devices.InterfaceClassGuid",
00065                 "System.ItemNameDisplay"
00066             };
00067
00068             // Use AQS string filter from the text box
00069             DeviceWatcher deviceWatcher = DeviceInformation.CreateWatcher(
00070                 aqsFilterTextBox.Text,
00071                 requestedProperties);
00072
00073             rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
00074             deviceWatcherHelper.StartWatcher(deviceWatcher);
00075             stopWatcherButton.IsEnabled = true;
00076             stopWatcherButton.Focus(FocusState.Keyboard);
00077             aqsFilterTextBox.IsEnabled = true;
00078         }
00079
00080         private void StopWatcher()
00081         {
00082             aqsFilterTextBox.IsEnabled = false;
00083             stopWatcherButton.IsEnabled = false;
00084
00085             deviceWatcherHelper.StopWatcher();
00086
00087             startWatcherButton.IsEnabled = true;
00088             startWatcherButton.Focus(FocusState.Keyboard);
00089             aqsFilterTextBox.IsEnabled = true;
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceEvents Member List

This is the complete list of members for DeviceEvents, including all inherited members.
cancelSource | DeviceEvents | [private]
ClearSwitchStateTable() | DeviceEvents | [inline, private]
CreateSwitchStateArray(byte[] output) | DeviceEvents | [inline, private, static]
DeviceEvents() | DeviceEvents | [inline]
deviceEventsBegin_Click(object sender, RoutedEventArgs e) | DeviceEvents | [inline, private]
deviceEventsCancel_Click(object sender, RoutedEventArgs e) | DeviceEvents | [inline, private]
deviceEventsGet_Click(object sender, RoutedEventArgs e) | DeviceEvents | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | DeviceEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | DeviceEvents | [inline, protected]
previousSwitchValues | DeviceEvents | [private]
ReadInterruptMessagesAsync() | DeviceEvents | [inline, private]
rootPage | DeviceEvents | [private]
switchMessageBuffer | DeviceEvents | [private]
UpdateRegisterButton() | DeviceEvents | [inline, private]
UpdateSwitchStateTable(bool[] switchStateArray) | DeviceEvents | [inline, private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario11.xaml.cpp Source File

  • MapControl
  • cpp

Scenario11.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario11.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Devices::Geolocation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Storage;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Maps;
00026
00027 Platform::String^ Scenario11::ToDefaultStyleEntryState(MapIconState state)
00028 {
00029     if (state & MapIconState::Disabled)
00030     {
00031         return MapStyleSheetEntryStates::Disabled;
00032     }
00033     else if (state & MapIconState::Selected)
00034     {
00035         return MapStyleSheetEntryStates::Selected;
00036     }
00037     else if (state & MapIconState::Hover)
00038     {
00039         return MapStyleSheetEntryStates::Hover;
00040     }
00041     else
00042     {
00043         return "";
00044     }
00045 }
00046
00047 Platform::String^ Scenario11::ToCustomStyleEntryState(MapIconState state)
00048 {
00049     if (state & MapIconState::Disabled)
00050     {
00051         return "disabled";
00052     }
00053     else if (state & MapIconState::Selected)
00054     {
00055         return "myNamespace.selected";
00056     }
00057     else if (state & MapIconState::Hover)
00058     {
00059         return "myNamespace.hover";
00060     }
00061     else
00062     {
00063         return "";
00064     }
00065 }
00066
00067 Scenario11::Scenario11()
00068 {
00069     InitializeComponent();
00070 }
00071
00072 void Scenario11::MyMap_Loaded(Object^ sender, RoutedEventArgs^ e)
00073 {
00074     myMap->Center = MainPage::SeattleGeopoint;
00075     myMap->ZoomLevel = 16;
00076
00077     // Specify a style sheet.
00078     create_task(StorageFile::GetFileFromApplicationUriAsync(ref new Uri("ms-appx:///StyleSheets/MyCustomStates.json"))).then([](StorageFile^ file)
00079     {
00080         return create_task(FileIO::ReadTextAsync(file));
00081     }).then([this](String^ myStyleSheetJson)
00082     {
00083         // It is not strictly necessary to Combine since RoadLight is the default.
00084         myMap->StyleSheet = MapStyleSheet::Combine(ref new Vector<MapStyleSheet^>({ MapStyleSheet::RoadLight(), MapStyleSheet::ParseFromJson(myStyleSheetJson) }));
00085
00086         // Populate various layers containing points and connect up states to events.
00087         AddLayer1();
00088         AddLayer2();
00089
00090         // Connect the layers to the map.
00091         myMap->Layers = this->MapLayers;
00092     });
00093 }
00094
00095 // The elements in layer 1 receive a default style.
00096 void Scenario11::AddLayer1()
00097 {
00098     this->myLayer1 = ref new MapElementsLayer();
00099     this->myLayer1->MapElements = MainPage::CreateCityBuildingsCollection();
00100
00101     this->myLayer1->MapElementPointerEntered += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerPointerEnteredEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerPointerEnteredEventArgs^ args)
00102     {
00103         UpdateMapElementOnPointerEntered(args->MapElement, ToDefaultStyleEntryState);
00104     });
00105
00106     this->myLayer1->MapElementPointerExited += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerPointerExitedEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerPointerExitedEventArgs^ args)
00107     {
00108         UpdateMapElementOnPointerExited(args->MapElement, ToDefaultStyleEntryState);
00109     });
00110
00111     this->myLayer1->MapElementClick += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerClickEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerClickEventArgs^ args)
00112     {
00113         UpdateMapElementOnClick(args->MapElements->GetAt(0), ToDefaultStyleEntryState);
00114     });
00115
00116     this->MapLayers->Append(this->myLayer1);
00117 }
00118
00119 // The elements in layer 2 receive a custom style.
00120 void Scenario11::AddLayer2()
00121 {
00122     this->myLayer2 = ref new MapElementsLayer();
00123     this->myLayer2->MapElements = MainPage::CreateCityParksCollection();
00124
00125     for (auto& element : this->myLayer2->MapElements)
00126     {
00127         element->MapStyleSheetEntry = "myNamespace.myPoi";
00128     }
00129
00130     this->myLayer2->MapElementPointerEntered += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerPointerEnteredEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerPointerEnteredEventArgs^ args)
00131     {
00132         UpdateMapElementOnPointerEntered(args->MapElement, ToCustomStyleEntryState);
00133     });
00134
00135     this->myLayer2->MapElementPointerExited += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerPointerExitedEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerPointerExitedEventArgs^ args)
00136     {
00137         UpdateMapElementOnPointerExited(args->MapElement, ToCustomStyleEntryState);
00138     });
00139
00140     this->myLayer2->MapElementClick += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerClickEventArgs^>([](MapElementsLayer^ sender, MapElementsLayerClickEventArgs^ args)
00141     {
00142         if (args->MapElements->Size > 0)
00143         {
00144             UpdateMapElementOnClick(args->MapElements->GetAt(0), ToCustomStyleEntryState);
00145         }
00146     });
00147
00148     this->MapLayers->Append(this->myLayer2);
00149 }
00150
00151 void Scenario11::UpdateMapElementOnPointerEntered(MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState)
00152 {
00153     int state = mapElement->Tag != nullptr ? (int)(mapElement->Tag) : MapIconState::None;
00154     if (!(state & MapIconState::Hover) && !(state & MapIconState::Disabled))
00155     {
00156         state = (state | MapIconState::Hover);
00157         mapElement->Tag = state;
00158         mapElement->MapStyleSheetEntryState = toStyleEntryState((MapIconState)state);
00159     }
00160 }
00161
00162 void Scenario11::UpdateMapElementOnPointerExited(MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState)
00163 {
00164     int state = mapElement->Tag != nullptr ? (int)(mapElement->Tag) : MapIconState::None;
00165     if ((state & MapIconState::Hover) && !(state & MapIconState::Disabled))
00166     {
00167         state = (state & ~MapIconState::Hover);
00168         mapElement->Tag = state;
00169         mapElement->MapStyleSheetEntryState = toStyleEntryState((MapIconState)state);
00170     }
00171 }
00172
00173 void Scenario11::UpdateMapElementOnClick(MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState)
00174 {
00175     int state = mapElement->Tag != nullptr ? (int)(mapElement->Tag) : MapIconState::None;
00176     if (!(state & MapIconState::Disabled))
00177     {
00178         // Toggle Selected flag
00179         state = (state ^ MapIconState::Selected);
00180         mapElement->Tag = state;
00181         mapElement->MapStyleSheetEntryState = toStyleEntryState((MapIconState)state);
00182     }
00183 }
00184
00185 void Scenario11::SetStyleSheetStateCombobox_SelectionChanged(Object^ sender, RoutedEventArgs^ e)
00186 {
00187     // Protect against events that are raised before we are fully initialized.
00188     if (this->myLayer1 == nullptr) return;
00189
00190     Platform::String^ selectedState = "";
00191     switch (setStyleSheetStateCombobox->SelectedIndex)
00192     {
00193         case 1:
00194             selectedState = MapStyleSheetEntryStates::Disabled;
00195             break;
00196         case 2:
00197             selectedState = MapStyleSheetEntryStates::Hover;
00198             break;
00199         case 3:
00200             selectedState = MapStyleSheetEntryStates::Selected;
00201             break;
00202         case 4:
00203             selectedState = "myNamespace.focused";
00204             break;
00205         case 0:
00206         default:
00207             selectedState = "";
00208             break;
00209     }
00210
00211     for (auto& element : this->myLayer1->MapElements)
00212     {
00213         element->MapStyleSheetEntryState = selectedState;
00214     }
00215 }
Generated on Fri Nov 15 2024 22:17:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario2_MultipleScanners.h Source File

  • BarcodeScanner
  • cppwinrt

Scenario2_MultipleScanners.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_MultipleScanners.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_MultipleScanners : Scenario2_MultipleScannersT<Scenario2_MultipleScanners>
00019     {
00020         Scenario2_MultipleScanners();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024
00025         fire_and_forget ButtonStartScanningInstance1_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026         fire_and_forget claimedBarcodeScannerInstance1_ReleaseDeviceRequested(Windows::Foundation::IInspectable const& sender, Windows::Devices::PointOfService::ClaimedBarcodeScanner const&);
00027         fire_and_forget ButtonStartScanningInstance2_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&);
00028         fire_and_forget claimedBarcodeScannerInstance2_ReleaseDeviceRequested(Windows::Foundation::IInspectable const& sender, Windows::Devices::PointOfService::ClaimedBarcodeScanner const&);
00029
00030         void ButtonEndScanningInstance1_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00031         void ButtonEndScanningInstance2_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00032
00033     private:
00034         SDKTemplate::MainPage m_rootPage{ SDKTemplate::MainPage::Current() };
00035
00036         Windows::Devices::PointOfService::BarcodeScanner m_barcodeScannerInstance1{ nullptr };
00037         Windows::Devices::PointOfService::BarcodeScanner m_barcodeScannerInstance2{ nullptr };
00038         Windows::Devices::PointOfService::ClaimedBarcodeScanner m_claimedBarcodeScannerInstance1{ nullptr };
00039         Windows::Devices::PointOfService::ClaimedBarcodeScanner m_claimedBarcodeScannerInstance2{ nullptr };
00040         event_token m_dev1ReleaseRequestedToken;
00041         event_token m_dev1DataReceivedToken;
00042         event_token m_dev2ReleaseRequestedToken;
00043         event_token m_dev2DataReceivedToken;
00044
00045         /// <summary>
00046         /// Enumerator for current active Instance.
00047         /// </summary>
00048         enum class BarcodeScannerInstance
00049         {
00050             Instance1,
00051             Instance2
00052         };
00053
00054         Windows::Foundation::IAsyncOperation<bool> CreateDefaultScannerObjectAsync(BarcodeScannerInstance instance);
00055         Windows::Foundation::IAsyncOperation<bool> ClaimBarcodeScannerAsync(BarcodeScannerInstance instance);
00056         Windows::Foundation::IAsyncOperation<bool> EnableBarcodeScannerAsync(BarcodeScannerInstance instance);
00057
00058         void ResetTheScenarioState();
00059         void ResetUI();
00060
00061         void SetUI(BarcodeScannerInstance instance);
00062
00063         fire_and_forget claimedBarcodeScannerInstance1_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const&, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args);
00064         fire_and_forget claimedBarcodeScannerInstance2_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const&, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args);
00065
00066     };
00067 }
00068
00069 namespace winrt::SDKTemplate::factory_implementation
00070 {
00071     struct Scenario2_MultipleScanners : Scenario2_MultipleScannersT<Scenario2_MultipleScanners, implementation::Scenario2_MultipleScanners>
00072     {
00073     };
00074 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario2_Polling.xaml.h Source File

  • Compass
  • cpp

Scenario2_Polling.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.h
00014 // Declaration of the Scenario2_Polling class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2_Polling.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario2_Polling sealed
00030     {
00031     public:
00032         Scenario2_Polling();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::UI::Core::CoreDispatcher^ dispatcher;
00041         Windows::Devices::Sensors::Compass^ compass;
00042         Windows::Foundation::EventRegistrationToken visibilityToken;
00043         uint32 desiredReportInterval;
00044         Windows::UI::Xaml::DispatcherTimer^ dispatcherTimer;
00045
00046         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00047         void DisplayCurrentReading(Platform::Object^ sender, Platform::Object^ e);
00048         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00050     };
00051 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/SocketActivityStreamSocket/Scenario1_Connect.xaml.cs Source File

  • SocketActivityStreamSocket
  • cs
  • SocketActivityStreamSocket

Scenario1_Connect.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using Windows.Networking.Sockets;
00017 using Windows.ApplicationModel.Background;
00018 using System;
00019 using Windows.Networking;
00020 using Windows.Storage;
00021 using Windows.Storage.Streams;
00022 using Windows.Foundation;
00023
00024 namespace SocketActivityStreamSocket
00025 {
00026     public sealed partial class Scenario1_Connect : Page
00027     {
00028         private MainPage rootPage;
00029         private const string socketId = "SampleSocket";
00030         private StreamSocket socket = null;
00031         private IBackgroundTaskRegistration task = null;
00032         private const string port = "40404";
00033
00034         public Scenario1_Connect()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             rootPage = MainPage.Current;
00042             try
00043             {
00044                 foreach (var current in BackgroundTaskRegistration.AllTasks)
00045                 {
00046                     if (current.Value.Name == "SocketActivityBackgroundTask")
00047                     {
00048                         task = current.Value;
00049                         break;
00050                     }
00051                 }
00052
00053                 // If there is no task allready created, create a new one
00054                 if (task == null)
00055                 {
00056                     var socketTaskBuilder = new BackgroundTaskBuilder();
00057                     socketTaskBuilder.Name = "SocketActivityBackgroundTask";
00058                     socketTaskBuilder.TaskEntryPoint = "SocketActivityBackgroundTask.SocketActivityTask";
00059                     var trigger = new SocketActivityTrigger();
00060                     socketTaskBuilder.SetTrigger(trigger);
00061                     task = socketTaskBuilder.Register();
00062                 }
00063
00064                 SocketActivityInformation socketInformation;
00065                 if (SocketActivityInformation.AllSockets.TryGetValue(socketId, out socketInformation))
00066                 {
00067                     // Application can take ownership of the socket and make any socket operation
00068                     // For sample it is just transfering it back.
00069                     socket = socketInformation.StreamSocket;
00070                     socket.TransferOwnership(socketId);
00071                     socket = null;
00072                     rootPage.NotifyUser("Connected. You may close the application", NotifyType.StatusMessage);
00073                     TargetServerTextBox.IsEnabled = false;
00074                     ConnectButton.IsEnabled = false;
00075                 }
00076
00077             }
00078             catch (Exception exception)
00079             {
00080                 rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
00081             }
00082         }
00083
00084         private async void ConnectButton_Click(object sender, RoutedEventArgs e)
00085         {
00086             ApplicationData.Current.LocalSettings.Values["hostname"] = TargetServerTextBox.Text;
00087             ApplicationData.Current.LocalSettings.Values["port"] = port;
00088
00089             try
00090             {
00091                 SocketActivityInformation socketInformation;
00092                 if (!SocketActivityInformation.AllSockets.TryGetValue(socketId, out socketInformation))
00093                 {
00094                     socket = new StreamSocket();
00095                     socket.EnableTransferOwnership(task.TaskId, SocketActivityConnectedStandbyAction.Wake);
00096                     var targetServer = new HostName(TargetServerTextBox.Text);
00097                     await socket.ConnectAsync(targetServer, port);
00098                     // To demonstrate usage of CancelIOAsync async, have a pending read on the socket and call
00099                     // cancel before transfering the socket.
00100                     DataReader reader = new DataReader(socket.InputStream);
00101                     reader.InputStreamOptions = InputStreamOptions.Partial;
00102                     var read = reader.LoadAsync(250);
00103                     read.Completed += (info, status) =>
00104                     {
00105
00106                     };
00107                     await socket.CancelIOAsync();
00108                     socket.TransferOwnership(socketId);
00109                     socket = null;
00110                 }
00111                 ConnectButton.IsEnabled = false;
00112                 rootPage.NotifyUser("Connected. You may close the application", NotifyType.StatusMessage);
00113             }
00114             catch (Exception exception)
00115             {
00116                 rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
00117             }
00118         }
00119     }
00120 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_PartialReadWrite Member List

This is the complete list of members for Scenario4_PartialReadWrite, including all inherited members.
AppendOutputLine(hstring const &value) | Scenario4_PartialReadWrite | [private]
CloseSocket() | Scenario4_PartialReadWrite | [private]
ConnectAsync() | Scenario4_PartialReadWrite | [private]
MessageReceived(Windows::Networking::Sockets::MessageWebSocket sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs e) | Scenario4_PartialReadWrite | [private]
OnClosed(Windows::Networking::Sockets::IWebSocket sender, Windows::Networking::Sockets::WebSocketClosedEventArgs e) | Scenario4_PartialReadWrite | [private]
OnConnect(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs e) | Scenario4_PartialReadWrite |
OnDisconnect(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_PartialReadWrite |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario4_PartialReadWrite |
OnSend(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs e) | Scenario4_PartialReadWrite |
Scenario4_PartialReadWrite() | Scenario4_PartialReadWrite |
SendAsync() | Scenario4_PartialReadWrite | [private]
SetBusy(bool value) | Scenario4_PartialReadWrite | [private]
UpdateVisualState() | Scenario4_PartialReadWrite | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/pch.cpp Source File

  • LinguisticServices
  • RuntimeComponent

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.cpp Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingServiceEventAdapter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace Microsoft::WRL;
00024 using namespace Platform;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Foundation::Collections;
00027 using namespace Windows::Devices::AllJoyn;
00028 using namespace org::alljoyn::Onboarding;
00029
00030 // Note: Unlike an Interface implementation, which provides a single handler for each member, the event
00031 // model allows for 0 or more listeners to be registered. The EventAdapter implementation deals with this
00032 // difference by implementing a last-writer-wins policy. The lack of any return value (i.e., 0 listeners)
00033 // is handled by returning a null result.
00034
00035 // Methods
00036 IAsyncOperation<OnboardingConfigureWiFiResult^>^ OnboardingServiceEventAdapter::ConfigureWiFiAsync(_In_ AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
00037 {
00038     auto args = ref new OnboardingConfigureWiFiCalledEventArgs(info, interfaceMemberSSID, interfaceMemberPassphrase, interfaceMemberAuthType);
00039     ConfigureWiFiCalled(this, args);
00040     return OnboardingConfigureWiFiCalledEventArgs::GetResultAsync(args);
00041 }
00042
00043 IAsyncOperation<OnboardingConnectResult^>^ OnboardingServiceEventAdapter::ConnectAsync(_In_ AllJoynMessageInfo^ info)
00044 {
00045     auto args = ref new OnboardingConnectCalledEventArgs(info);
00046     ConnectCalled(this, args);
00047     return OnboardingConnectCalledEventArgs::GetResultAsync(args);
00048 }
00049
00050 IAsyncOperation<OnboardingOffboardResult^>^ OnboardingServiceEventAdapter::OffboardAsync(_In_ AllJoynMessageInfo^ info)
00051 {
00052     auto args = ref new OnboardingOffboardCalledEventArgs(info);
00053     OffboardCalled(this, args);
00054     return OnboardingOffboardCalledEventArgs::GetResultAsync(args);
00055 }
00056
00057 IAsyncOperation<OnboardingGetScanInfoResult^>^ OnboardingServiceEventAdapter::GetScanInfoAsync(_In_ AllJoynMessageInfo^ info)
00058 {
00059     auto args = ref new OnboardingGetScanInfoCalledEventArgs(info);
00060     GetScanInfoCalled(this, args);
00061     return OnboardingGetScanInfoCalledEventArgs::GetResultAsync(args);
00062 }
00063
00064 // Property Reads
00065 IAsyncOperation<OnboardingGetVersionResult^>^ OnboardingServiceEventAdapter::GetVersionAsync(_In_ AllJoynMessageInfo^ info)
00066 {
00067     auto args = ref new OnboardingGetVersionRequestedEventArgs(info);
00068     GetVersionRequested(this, args);
00069     return OnboardingGetVersionRequestedEventArgs::GetResultAsync(args);
00070 }
00071
00072 IAsyncOperation<OnboardingGetStateResult^>^ OnboardingServiceEventAdapter::GetStateAsync(_In_ AllJoynMessageInfo^ info)
00073 {
00074     auto args = ref new OnboardingGetStateRequestedEventArgs(info);
00075     GetStateRequested(this, args);
00076     return OnboardingGetStateRequestedEventArgs::GetResultAsync(args);
00077 }
00078
00079 IAsyncOperation<OnboardingGetLastErrorResult^>^ OnboardingServiceEventAdapter::GetLastErrorAsync(_In_ AllJoynMessageInfo^ info)
00080 {
00081     auto args = ref new OnboardingGetLastErrorRequestedEventArgs(info);
00082     GetLastErrorRequested(this, args);
00083     return OnboardingGetLastErrorRequestedEventArgs::GetResultAsync(args);
00084 }
00085
00086 // Property Writes
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
AppView() | sealed |
CreateView() | sealed | [virtual]
Initialize(Windows::ApplicationModel::Core::CoreApplicationView^applicationView) | sealed | [virtual]
Load(Platform::String^entryPoint) | sealed | [virtual]
m_deviceResources | sealed | [private]
m_holographicSpace | sealed | [private]
m_main | sealed | [private]
m_windowClosed | sealed | [private]
m_windowVisible | sealed | [private]
OnKeyPressed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::KeyEventArgs^args) | sealed | [protected]
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [protected]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [protected]
OnViewActivated(Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args) | sealed | [protected]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [protected]
OnWindowClosed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args) | sealed | [protected]
Run() | sealed | [virtual]
SetWindow(Windows::UI::Core::CoreWindow^window) | sealed | [virtual]
Uninitialize() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/SampleConfiguration.cs Source File

  • OnDemandHotspot
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "OnDemandHotspot C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Manage Hotspot", ClassType=typeof(Scenario1_ManageHotspot)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033
00034     internal sealed class Constants
00035     {
00036         // This GUID can be any value. Use it to distinguish among different hotspots
00037         // managed by the same app.
00038         public static readonly Guid SampleHotspotGuid = new Guid("4c6e8b20-b2de-472e-808b-bd423e168cd0");
00039
00040         // Information about our task that updates the hotspot metadata.
00041         // The EntryPoint must match the value declared in the application manifest.
00042         public static readonly string MetadataUpdateTaskName = "UpdateMetadataTask";
00043         public static readonly string MetadataUpdateEntryPoint = "BackgroundTask.UpdateMetadataTask";
00044
00045         // Information about our task that turns on the hotspot.
00046         // The EntryPoint must match the value declared in the application manifest.
00047         public static readonly string ConnectTaskName = "ConnectTask";
00048         public static readonly string ConnectEntryPoint = "BackgroundTask.ConnectTask";
00049
00050         // Information about our task that monitors whether the hotspot is nearby.
00051         // (We don't actually have a device watcher task, but if we did, its entry
00052         // point must match the value declared in the application manifest.)
00053         public static readonly string DeviceWatcherTaskName = "DeviceWatcherTask";
00054     }
00055 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/Scenario1_ParseAndStringify.cpp Source File

  • Json
  • cppwinrt

Scenario1_ParseAndStringify.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_ParseAndStringify.h"
00014 #include "Scenario1_ParseAndStringify.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::Xaml;
00019
00020 namespace winrt::SDKTemplate::implementation
00021 {
00022     Scenario1_ParseAndStringify::Scenario1_ParseAndStringify()
00023     {
00024         InitializeComponent();
00025         CurrentUser(SDKTemplate::User(JsonInput().Text()));
00026     }
00027
00028     void Scenario1_ParseAndStringify::Parse_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         try
00031         {
00032             CurrentUser(SDKTemplate::User(JsonInput().Text()));
00033             rootPage.NotifyUser(L"JSON string parsed successfully.", NotifyType::StatusMessage);
00034         }
00035         catch (hresult_error const& ex)
00036         {
00037             if (!IsExceptionHandled(ex))
00038             {
00039                 throw;
00040             }
00041         }
00042     }
00043
00044     void Scenario1_ParseAndStringify::Stringify_Click(IInspectable const&, RoutedEventArgs const&)
00045     {
00046         JsonInput().Text(L"");
00047
00048         JsonInput().Text(CurrentUser().Stringify());
00049         rootPage.NotifyUser(L"JSON object serialized to string successfully.", NotifyType::StatusMessage);
00050     }
00051
00052     void Scenario1_ParseAndStringify::Add_Click(IInspectable const&, RoutedEventArgs const&)
00053     {
00054         CurrentUser().Education().Append(SDKTemplate::School());
00055         rootPage.NotifyUser(L"New row added.", NotifyType::StatusMessage);
00056     }
00057
00058     void Scenario1_ParseAndStringify::DeleteSchool_Click(IInspectable const& sender, RoutedEventArgs const&)
00059     {
00060         auto school = sender.as<FrameworkElement>().DataContext().as<SDKTemplate::School>();
00061         auto schools = CurrentUser().Education();
00062         uint32_t index;
00063         if (schools.IndexOf(school, index))
00064         {
00065             schools.RemoveAt(index);
00066         }
00067     }
00068
00069     bool Scenario1_ParseAndStringify::IsExceptionHandled(hresult_error const& ex)
00070     {
00071         if (ex.code() == E_ILLEGAL_METHOD_CALL)
00072         {
00073             rootPage.NotifyUser(L"JSON did not match expected schema: " + ex.message(), NotifyType::ErrorMessage);
00074             return true;
00075         }
00076
00077         hstring text;
00078         switch (JsonError::GetJsonStatus(ex.code()))
00079         {
00080         default:
00081         case JsonErrorStatus::Unknown: return false;
00082         case JsonErrorStatus::InvalidJsonString: text = L"Invalid JSON string"; break;
00083         case JsonErrorStatus::InvalidJsonNumber: text = L"Invalid JSON number"; break;
00084         case JsonErrorStatus::JsonValueNotFound: text = L"JSON value not found"; break;
00085         case JsonErrorStatus::ImplementationLimit: text = L"Implementation limit exceeded"; break;
00086         }
00087
00088         rootPage.NotifyUser(text + L": " + ex.message(), NotifyType::ErrorMessage);
00089         return true;
00090     }
00091 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_InterfaceSettings Member List

This is the complete list of members for Scenario6_InterfaceSettings, including all inherited members.
GetInterfaceSetting() | Scenario6_InterfaceSettings | [inline, private]
GetInterfaceSetting_Click(Object sender, RoutedEventArgs e) | Scenario6_InterfaceSettings | [inline, private]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario6_InterfaceSettings | [inline, protected]
rootPage | Scenario6_InterfaceSettings | [private]
Scenario6_InterfaceSettings() | Scenario6_InterfaceSettings | [inline]
SetInterfaceSetting(Byte settingNumber) | Scenario6_InterfaceSettings | [inline, private]
SetSuperMuttInterfaceSetting_Click(Object sender, RoutedEventArgs e) | Scenario6_InterfaceSettings | [inline, private]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/SampleConfiguration.cpp Source File

  • XamlListView
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"ListView/GridView C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Simple ListView", xaml_typename<SDKTemplate::Scenario1_SimpleListView>() },
00029     Scenario{ L"Simple GridView", xaml_typename<SDKTemplate::Scenario2_SimpleGridView>() },
00030     Scenario{ L"Master Detail and Selection", xaml_typename<SDKTemplate::Scenario3_MasterDetail>() },
00031     Scenario{ L"Edge Tapped ListView", xaml_typename<SDKTemplate::Scenario4_EdgeTappedListView>() },
00032     Scenario{ L"Restore Scroll Position", xaml_typename<SDKTemplate::Scenario5_RestoreScrollPosition>() },
00033     Scenario{ L"Scroll Into View", xaml_typename<SDKTemplate::Scenario6_ScrollIntoView>() },
00034 });
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Shared/TrackingEventCue.cs Source File

  • AdaptiveStreaming
  • cs
  • Shared

TrackingEventCue.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.Media.Core;
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// The custom data that can be created, scheduled then consumed as part of a TimedMetadataTrack which has been added by the app.
00012     ///
00013     /// In these samples, it creates a set of cues at the start, 1/4, 1/2, 3/4 and upon completion of playback.
00014     /// For each of these points, it will fire an MediaCue with the custom TrackingEventUri property to be consumed by
00015     /// the app in the CueEntered event handler of the TimedMetadataTrack.
00016     ///
00017     /// We also demonstrate the use of the .Duration IMediaCue property, which will fire CueExited for the midpoint Cue at the 55% mark.
00018     /// </summary>
00019     public class TrackingEventCue : IMediaCue
00020     {
00021         public TimeSpan Duration { get; set; }
00022         public string Id { get; set; }
00023         public TimeSpan StartTime { get; set; }
00024         public Uri TrackingEventUri { get; set; }
00025
00026         /// <summary>
00027         /// Creates a TimedMetadataTrack on the source
00028         /// </summary>
00029         /// <param name="source">the source on which to create a TimedMetadataTrack</param>
00030         /// <param name="contentId">the content id for this source</param>
00031         /// <param name="reportingUriFormat">the format string used to create reporting Uri for each event</param>
00032         public static void CreateTrackingEventsTrack(MediaSource source, string contentId, string reportingUriFormat)
00033         {
00034             if (source.Duration.HasValue && !string.IsNullOrEmpty(contentId))
00035             {
00036                 long sourceDurationTicks = source.Duration.Value.Ticks;
00037                 sourceDurationTicks = AdjustDurationIfLive(sourceDurationTicks);
00038
00039                 var trackingEvents = new TimedMetadataTrack("TrackingEvents", "", TimedMetadataKind.Custom);
00040                 trackingEvents.AddCue(new TrackingEventCue()
00041                 {
00042                     // This method is called once the media has loaded. If it is set to AutoPlay, then
00043                     // we may miss Position=0.0. Avoid the race by "starting" at the 2-second mark.
00044                     StartTime = TimeSpan.FromSeconds(2),
00045                     Id = "2s",
00046                     TrackingEventUri = new Uri(string.Format(reportingUriFormat, "started", contentId)),
00047                 });
00048                 trackingEvents.AddCue(new TrackingEventCue()
00049                 {
00050                     StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.25)),
00051                     Id = "0.25",
00052                     TrackingEventUri = new Uri(string.Format(reportingUriFormat, "firstQuartile", contentId)),
00053                 });
00054                 trackingEvents.AddCue(new TrackingEventCue()
00055                 {
00056                     StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.50)),
00057                     Id = "0.50",
00058                     TrackingEventUri = new Uri(string.Format(reportingUriFormat, "midpoint", contentId)),
00059                     // We can cause CueExited to fire at 55% by setting a Duration:
00060                     Duration = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.05)),
00061                 });
00062                 trackingEvents.AddCue(new TrackingEventCue()
00063                 {
00064                     StartTime = TimeSpan.FromTicks((long)Math.Round(sourceDurationTicks * 0.75)),
00065                     Id = "0.75",
00066                     TrackingEventUri = new Uri(string.Format(reportingUriFormat, "thirdQuartile", contentId)),
00067                 });
00068                 trackingEvents.AddCue(new TrackingEventCue()
00069                 {
00070                     StartTime = TimeSpan.FromTicks(sourceDurationTicks),
00071                     Id = "1.00",
00072                     TrackingEventUri = new Uri(string.Format(reportingUriFormat, "complete", contentId)),
00073                 });
00074                 source.ExternalTimedMetadataTracks.Add(trackingEvents);
00075             }
00076         }
00077
00078         public static long AdjustDurationIfLive(long sourceDurationTicks)
00079         {
00080             // Live sources will have an duration of TimeSpan.MaxValue,
00081             // so assume they are 2 minutes long for these scenarios.
00082             if (sourceDurationTicks == TimeSpan.MaxValue.Ticks)
00083             {
00084                 sourceDurationTicks = TimeSpan.FromMinutes(2).Ticks;
00085             }
00086             return sourceDurationTicks;
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/SampleConfiguration.cpp Source File

  • CameraProfile
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Locate Record Specific Profile", "SDKTemplate.Scenario1_SetRecordProfile" },
00021     { "Query Profile for Concurrency", "SDKTemplate.Scenario2_ConcurrentProfile" },
00022     { "Query Profile for HDR Support", "SDKTemplate.Scenario3_EnableHdrProfile" }
00023 };
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoChat Member List

This is the complete list of members for VideoChat, including all inherited members.
activated | VideoChat | [private]
CallButton_Click(object sender, RoutedEventArgs e) | VideoChat | [inline, private]
device | VideoChat | [private]
Device_CaptureFailed(object sender, Windows.Media.Capture.MediaCaptureFailedEventArgs e) | VideoChat | [inline, private]
Device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e) | VideoChat | [inline, private]
EndCallAsync() | VideoChat | [inline, private]
EndCallButton_Click(object sender, RoutedEventArgs e) | VideoChat | [inline, private]
InitializeAsync(CancellationToken cancel=default(CancellationToken)) | VideoChat | [inline, private]
isTerminator | VideoChat | [private]
OnNavigatedTo(NavigationEventArgs e) | VideoChat | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | VideoChat | [inline, protected]
RemoteVideo_MediaFailed(object sender, ExceptionRoutedEventArgs e) | VideoChat | [inline, private]
roleIsActive | VideoChat | [private]
rootPage | VideoChat | [private]
StartRecordToCustomSink() | VideoChat | [inline, private]
VideoChat() | VideoChat | [inline]
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario6_CustomTrigger.xaml.cs Source File

  • CustomCapability
  • cs

Scenario6_CustomTrigger.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.Background;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class CustomTrigger
00020     {
00021         MainPage rootPage = MainPage.Current;
00022
00023         BackgroundTaskRegistration taskRegistration;
00024
00025         const string customTriggerTaskName = "Osrusbfx2Task.ConnectedTask";
00026         const string guidCustomSystemEventId_OsrUsbFx2 = "{C7BDD245-5CDA-4BBD-B68D-B5E36F7911A3}";
00027
00028         public CustomTrigger()
00029         {
00030             this.InitializeComponent();
00031             UpdateUI();
00032         }
00033
00034         protected override void OnNavigatedFrom(NavigationEventArgs e)
00035         {
00036             UnregisterTask();
00037         }
00038
00039         void UpdateUI()
00040         {
00041             RegisterCustomTrigger.IsEnabled = (taskRegistration == null);
00042             UnregisterCustomTrigger.IsEnabled = (taskRegistration != null);
00043         }
00044
00045         void UnregisterTask()
00046         {
00047             if (taskRegistration != null)
00048             {
00049                 taskRegistration.Unregister(true);
00050                 taskRegistration = null;
00051             }
00052         }
00053
00054         void RegisterCustomTrigger_Click(Object sender, RoutedEventArgs e)
00055         {
00056             if (IsFx2CustomTriggerTaskRegistered())
00057             {
00058                 rootPage.NotifyUser("Osrusbfx2.ConnectedTask background task has already been registered", NotifyType.ErrorMessage);
00059             }
00060
00061             // Create a new background task builder.
00062             BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder();
00063
00064             // Create a new OEM trigger.
00065             CustomSystemEventTrigger fx2Trigger = new CustomSystemEventTrigger(
00066                 guidCustomSystemEventId_OsrUsbFx2, // Trigger Qualifier
00067                 CustomSystemEventTriggerRecurrence.Once); // One-shot trigger
00068
00069             // Associate the fx2Trigger trigger with the background task builder.
00070             taskBuilder.SetTrigger(fx2Trigger);
00071
00072             // Specify the background task to run when the trigger fires.
00073             taskBuilder.TaskEntryPoint = customTriggerTaskName;
00074
00075             // Name the background task.
00076             taskBuilder.Name = customTriggerTaskName;
00077
00078             try
00079             {
00080                 // Register the background task.
00081                 taskRegistration = taskBuilder.Register();
00082             }
00083             catch (Exception ex) {
00084                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00085                 return;
00086             }
00087
00088             UpdateUI();
00089         }
00090
00091         bool IsFx2CustomTriggerTaskRegistered()
00092         {
00093             foreach (var task in BackgroundTaskRegistration.AllTasks)
00094             {
00095                 string taskName = task.Value.Name;
00096                 if (taskName == customTriggerTaskName)
00097                 {
00098                     return true;
00099                 }
00100             }
00101
00102             return false;
00103         }
00104
00105         void UnregisterCustomTrigger_Click(Object sender, RoutedEventArgs e)
00106         {
00107             UnregisterTask();
00108             UpdateUI();
00109         }
00110     }
00111 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WrlFinal Member List

This is the complete list of members for WrlFinal, including all inherited members.
_breadBaked | WrlFinal | [private]
_dims | WrlFinal | [private]
_temperature | WrlFinal | [private]
ActivateInstance(_COM_Outptr_ IInspectable **oven) override | WrlFinal | [inline]
ActivateInstance(_COM_Outptr_ IInspectable **oven) override | WrlFinal | [inline]
add_BreadBaked(_In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > *handler, _Out_ EventRegistrationToken *token) override | WrlFinal |
add_BreadBaked(_In_ ITypedEventHandler< Oven *, BreadBakedEventArgs * > *handler, _Out_ EventRegistrationToken *token) override | WrlFinal |
BakeBread(_In_ HSTRING flavor) override | WrlFinal |
BakeBread(_In_ HSTRING flavor) override | WrlFinal |
ConfigurePreheatTemperature(_In_ OvenTemperature temperature) override | WrlFinal |
ConfigurePreheatTemperature(_In_ OvenTemperature temperature) override | WrlFinal |
CreateOven(_In_ Dimensions dimensions, _COM_Outptr_ IOven **oven) override | WrlFinal | [inline]
CreateOven(_In_ Dimensions dimensions, _COM_Outptr_ IOven **oven) override | WrlFinal | [inline]
get_Bread(_COM_Outptr_ IBread **value) override | WrlFinal | [inline, private]
get_Bread(_COM_Outptr_ IBread **value) override | WrlFinal | [inline, private]
get_Flavor(_COM_Outptr_ HSTRING *value) override | WrlFinal | [inline]
get_Flavor(_COM_Outptr_ HSTRING *value) override | WrlFinal | [inline]
get_Volume(_Out_ double *value) override | WrlFinal |
get_Volume(_Out_ double *value) override | WrlFinal |
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread, TrustLevel::BaseTrust) | WrlFinal | [private]
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven, TrustLevel::BaseTrust) | WrlFinal | [private]
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs, TrustLevel::BaseTrust) public | WrlFinal | [inline, private]
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread, TrustLevel::BaseTrust) | WrlFinal | [private]
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven, TrustLevel::BaseTrust) | WrlFinal | [private]
InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs, TrustLevel::BaseTrust) public | WrlFinal | [inline, private]
m_bread | WrlFinal | [private]
m_flavor | WrlFinal |
remove_BreadBaked(_In_ EventRegistrationToken token) override | WrlFinal |
remove_BreadBaked(_In_ EventRegistrationToken token) override | WrlFinal |
RuntimeClassInitialize(HSTRING flavor) | WrlFinal | [inline]
RuntimeClassInitialize() | WrlFinal | [inline]
RuntimeClassInitialize(_In_ Dimensions dimensions) | WrlFinal | [inline]
RuntimeClassInitialize(HSTRING flavor) | WrlFinal | [inline]
RuntimeClassInitialize() | WrlFinal | [inline]
RuntimeClassInitialize(_In_ Dimensions dimensions) | WrlFinal | [inline]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RootFrameNavigationHelper Member List

This is the complete list of members for RootFrameNavigationHelper, including all inherited members.
CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs e) | RootFrameNavigationHelper | [inline, private]
CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e) | RootFrameNavigationHelper | [inline, private]
Frame | RootFrameNavigationHelper | [private]
RootFrameNavigationHelper(Frame rootFrame) | RootFrameNavigationHelper | [inline]
systemNavigationManager | RootFrameNavigationHelper | [private]
SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e) | RootFrameNavigationHelper | [inline, private]
TryGoBack() | RootFrameNavigationHelper | [inline, private]
TryGoForward() | RootFrameNavigationHelper | [inline, private]
UpdateBackButton() | RootFrameNavigationHelper | [inline, private]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/uefi.cpp Source File

  • CustomCapability
  • Service
  • Client

uefi.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "firmwareaccess.h"
00014
00015 #define EFI_GLOBAL_VAR_GUID   L"{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}"
00016
00017 DWORD
00018 GetSecureBootEnabledFromUefi(
00019     _Out_ bool* SecureBootEnabled
00020     )
00021 {
00022     BYTE secureBootStatus;
00023     DWORD bytesReturned;
00024     DWORD error = ERROR_SUCCESS;
00025     bytesReturned = GetFirmwareEnvironmentVariable(L"SecureBoot",
00026                                                    EFI_GLOBAL_VAR_GUID,
00027                                                    &secureBootStatus,
00028                                                    sizeof(BYTE));
00029     if (bytesReturned <= 0)
00030     {
00031         error = GetLastError();
00032         goto exit;
00033     }
00034
00035     if (bytesReturned != sizeof(BYTE))
00036     {
00037         error = ERROR_INVALID_DATA;
00038         goto exit;
00039     }
00040
00041     *SecureBootEnabled = (secureBootStatus != 0);
00042
00043 exit:
00044     return error;
00045 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppData/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppData

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Storage;
00003 using Windows.Storage.Pickers;
00004 using Windows.UI.StartScreen;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007 using Windows.UI.Xaml.Media.Imaging;
00008
00009 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00010
00011 namespace Notifications.ScenarioPages.LiveTiles.BasicState.Logos.Source.AppData
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public sealed partial class ScenarioElement : UserControl
00017     {
00018         public ScenarioElement()
00019         {
00020             this.InitializeComponent();
00021         }
00022
00023         private Uri _imagePath;
00024
00025         private async void ButtonPickImage_Click(object sender, RoutedEventArgs e)
00026         {
00027             FileOpenPicker picker = new FileOpenPicker();
00028             picker.ViewMode = PickerViewMode.Thumbnail;
00029             picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00030             picker.CommitButtonText = "Open Image";
00031             picker.FileTypeFilter.Add(".jpg");
00032             picker.FileTypeFilter.Add(".jpeg");
00033             picker.FileTypeFilter.Add(".png");
00034
00035             StorageFile file = await picker.PickSingleFileAsync();
00036             if (file != null)
00037             {
00038                 StorageFolder logosFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Logos", CreationCollisionOption.OpenIfExists);
00039
00040                 // Copy the file to local app data
00041                 StorageFile localFile = await file.CopyAsync(logosFolder, file.Name, NameCollisionOption.GenerateUniqueName);
00042
00043                 _imagePath = new Uri("ms-appdata:///Local/Logos/" + localFile.Name);
00044
00045                 ButtonPinTile.IsEnabled = true;
00046                 ImageLogoPreview.Source = new BitmapImage(_imagePath);
00047             }
00048         }
00049
00050         private async void ButtonPinTile_Click(object sender, RoutedEventArgs e)
00051         {
00052             base.IsEnabled = false;
00053
00054             string tileId = DateTime.Now.Ticks.ToString();
00055
00056             SecondaryTile tile = new SecondaryTile(tileId, "Logo App Data", "args", _imagePath, TileSize.Default);
00057             await tile.RequestCreateAsync();
00058
00059             base.IsEnabled = true;
00060         }
00061     }
00062 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PageDescription Member List

This is the complete list of members for PageDescription, including all inherited members.
IsContentCropped | PageDescription |
Margin | PageDescription |
operator!=(PageDescription pageDescriptiopn1, PageDescription pageDescription2) | PageDescription | [friend]
operator==(PageDescription pageDescriptiopn1, PageDescription pageDescription2) | PageDescription | [friend]
PageSize | PageDescription |
PictureViewSize | PageDescription |
ViewablePageSize | PageDescription |
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario7_PinFromAppbar.cpp Source File

  • SecondaryTiles
  • cppwinrt

Scenario7_PinFromAppbar.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_PinFromAppbar.h"
00014 #include "Scenario7_PinFromAppbar.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::StartScreen;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario7_PinFromAppbar::Scenario7_PinFromAppbar()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario7_PinFromAppbar::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         // The appbar is open by default.
00035         Message().Text(L"Tap or click the Pin button to pin a tile.");
00036         UpdateAppBarButton();
00037
00038         windowActivatedEventToken = Window::Current().Activated({ get_weak(), &Scenario7_PinFromAppbar::Window_Activated });
00039     }
00040
00041     void Scenario7_PinFromAppbar::OnNavigatedFrom(NavigationEventArgs const&e)
00042     {
00043         Window::Current().Activated(windowActivatedEventToken);
00044     }
00045
00046     void Scenario7_PinFromAppbar::Window_Activated(IInspectable const&, WindowActivatedEventArgs const&)
00047     {
00048         // When the window regains activation, refresh the pin/unpin button.
00049         UpdateAppBarButton();
00050     }
00051
00052     // This updates the Pin/Unpin button in the app bar based on whether the
00053     // secondary tile is already pinned.
00054     void Scenario7_PinFromAppbar::UpdateAppBarButton()
00055     {
00056         if (SecondaryTile::Exists(SampleHelpers::AppBarTileId))
00057         {
00058             PinUnPinCommandButton().Label(L"Unpin");
00059             PinUnPinCommandButton().Icon(SymbolIcon(Symbol::UnPin));
00060         }
00061         else
00062         {
00063             PinUnPinCommandButton().Label(L"Pin");
00064             PinUnPinCommandButton().Icon(SymbolIcon(Symbol::Pin));
00065         }
00066
00067         PinUnPinCommandButton().UpdateLayout();
00068     }
00069
00070
00071     fire_and_forget Scenario7_PinFromAppbar::PinToAppBar_Click(IInspectable sender, RoutedEventArgs const&)
00072     {
00073         auto lifetime = get_strong();
00074
00075         SecondaryTileCommandBar().IsSticky(true);
00076
00077         // Let us first verify if we need to pin or unpin
00078         if (SecondaryTile::Exists(SampleHelpers::AppBarTileId))
00079         {
00080             // First prepare the tile to be unpinned
00081             SecondaryTile secondaryTile(SampleHelpers::AppBarTileId);
00082
00083             // Now make the delete request.
00084             bool isUnpinned = co_await secondaryTile.RequestDeleteForSelectionAsync(SampleHelpers::GetElementRect(sender), Windows::UI::Popups::Placement::Above);
00085             if (isUnpinned)
00086             {
00087                 Message().Text(hstring(SampleHelpers::AppBarTileId) + L" was unpinned.");
00088             }
00089             else
00090             {
00091                 Message().Text(hstring(SampleHelpers::AppBarTileId) + L" was not unpinned.");
00092             }
00093
00094             UpdateAppBarButton();
00095         }
00096         else
00097         {
00098             // Prepare package images for the medium tile size in our tile to be pinned
00099             Uri square150x150Logo(L"ms-appx:///Assets/square150x150Tile-sdk.png");
00100
00101             // During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation,
00102             // so that the app knows which tile the user is launching. In this sample, we'll pass in the date and time the secondary tile was pinned.
00103             hstring tileActivationArguments = hstring(SampleHelpers::AppBarTileId) + L" WasPinnedAt=" + SampleHelpers::CurrentTimeAsString();
00104
00105             // Create a Secondary tile with all the required arguments.
00106             // Note the last argument specifies what size the Secondary tile should show up as by default in the Pin to start fly out.
00107             // It can be set to TileSize.Square150x150, TileSize.Wide310x150, or TileSize.Default.
00108             // If set to TileSize.Wide310x150, then the asset for the wide size must be supplied as well.
00109             // TileSize.Default will default to the wide size if a wide size is provided, and to the medium size otherwise.
00110             SecondaryTile secondaryTile(SampleHelpers::AppBarTileId,
00111                 L"Secondary tile pinned via AppBar",
00112                 tileActivationArguments,
00113                 square150x150Logo,
00114                 TileSize::Square150x150);
00115
00116             // Whether or not the app name should be displayed on the tile can be controlled for each tile size.  The default is false.
00117             secondaryTile.VisualElements().ShowNameOnSquare150x150Logo(true);
00118
00119             // Specify a foreground text value.
00120             // The tile background color is inherited from the parent unless a separate value is specified.
00121             secondaryTile.VisualElements().ForegroundText(ForegroundText::Dark);
00122
00123             // OK, the tile is created and we can now attempt to pin the tile.
00124             // Note that the status message is updated when the async operation to pin the tile completes.
00125             bool isPinned = co_await secondaryTile.RequestCreateForSelectionAsync(SampleHelpers::GetElementRect(sender), Windows::UI::Popups::Placement::Above);
00126             if (isPinned)
00127             {
00128                 Message().Text(hstring(SampleHelpers::AppBarTileId) + L" was successfully pinned.");
00129             }
00130             else
00131             {
00132                 Message().Text(hstring(SampleHelpers::AppBarTileId) + L" was not pinned.");
00133             }
00134
00135             UpdateAppBarButton();
00136         }
00137
00138         BottomAppBar().IsSticky(false);
00139     }
00140
00141     void Scenario7_PinFromAppbar::BottomAppBar_Opened(IInspectable const&, IInspectable const&)
00142     {
00143         UpdateAppBarButton();
00144     }
00145
00146 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.cpp Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

NetworkClient.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "NetworkClient.h"
00010 #include "StspDefs.h"
00011
00012 using namespace Microsoft::Samples::SimpleCommunication::Network;
00013
00014 INetworkClient ^Microsoft::Samples::SimpleCommunication::Network::CreateNetworkClient()
00015 {
00016     return ref new CNetworkClient();
00017 }
00018
00019 CNetworkClient::CNetworkClient()
00020 {
00021     SetSocket(ref new StreamSocket());
00022 }
00023
00024 CNetworkClient::~CNetworkClient()
00025 {
00026 }
00027
00028 Windows::Foundation::IAsyncAction ^CNetworkClient::ConnectAsync(String ^url, WORD wPort)
00029 {
00030     if (url == nullptr)
00031     {
00032         throw ref new InvalidArgumentException();
00033     }
00034
00035     AutoLock lock(_critSec);
00036     CheckClosed();
00037     WCHAR szPortNumber[6];
00038     HostName ^hostName;
00039     IStreamSocket ^socket = GetSocket();
00040     WORD port = wPort;
00041     HStringReference hostNameId(RuntimeClass_Windows_Networking_HostName);
00042
00043     if (socket == nullptr)
00044     {
00045         Throw(MF_E_NOT_INITIALIZED);
00046     }
00047
00048     if (port == 0)
00049     {
00050         port = c_wStspDefaultPort;
00051     }
00052     ThrowIfError(StringCchPrintf(szPortNumber, _countof(szPortNumber), L"%hu", wPort));
00053
00054     hostName = ref new HostName(url);
00055
00056     // Start asynchronous operation
00057     return socket->ConnectAsync(hostName, ref new String(szPortNumber));
00058 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.h Source File

  • BasicFaceDetection
  • cppwinrt

Scenario1_DetectInPhoto.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_DetectInPhoto.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_DetectInPhoto : Scenario1_DetectInPhotoT<Scenario1_DetectInPhoto>
00020     {
00021         Scenario1_DetectInPhoto();
00022
00023         fire_and_forget OpenFile_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         void PhotoCanvas_SizeChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::SizeChangedEventArgs const& e);
00025
00026     private:
00027         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00028
00029         // Limit on the height of the source image (in pixels) passed into FaceDetector for performance considerations.
00030         // Images larger that this size will be downscaled proportionally.
00031         //
00032         // This is an arbitrary value that was chosen for this scenario, in which FaceDetector performance isn't too important but face
00033         // detection accuracy is; a generous size is used.
00034         // Your application may have different performance and accuracy needs and you'll need to decide how best to control input.
00035         static constexpr uint32_t sourceImageHeightLimit = 1280;
00036
00037         void SetupVisualization(Windows::UI::Xaml::Media::Imaging::WriteableBitmap const& displaySource, Windows::Foundation::Collections::IVector<Windows::Media::FaceAnalysis::DetectedFace> const& foundFaces);
00038         void ClearVisualization();
00039         Windows::Graphics::Imaging::BitmapTransform ComputeScalingTransformForSourceImage(Windows::Graphics::Imaging::BitmapDecoder const& sourceDecoder);
00040     };
00041 }
00042
00043 namespace winrt::SDKTemplate::factory_implementation
00044 {
00045     struct Scenario1_DetectInPhoto : Scenario1_DetectInPhotoT<Scenario1_DetectInPhoto, implementation::Scenario1_DetectInPhoto>
00046     {
00047     };
00048 }
Generated on Fri Nov 15 2024 22:18:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Utils.cpp Source File

  • SimpleCommunication
  • cpp

Utils.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "Utils.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Windows::Devices::Enumeration;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Media::Capture;
00019
00020 using namespace Concurrency;
00021
00022 void SdkSample::Initialize()
00023 {
00024     _rootPage = MainPage::Current;
00025     _dispatcher = _rootPage->Dispatcher;
00026 }
00027
00028 void SdkSample::Deinitialize()
00029 {
00030     _rootPage = nullptr;
00031     _dispatcher = nullptr;
00032 }
00033
00034 void SdkSample::DisplayStatus(Platform::String^ msg)
00035 {
00036     Log(msg);
00037 }
00038
00039 void SdkSample::DisplayError(Platform::String^ msg)
00040 {
00041     Log(msg, nullptr, "error");
00042 }
00043
00044 void SdkSample::FormatError(HResult err, Platform::String^ msg, Platform::String^ prefix)
00045 {
00046     if (err.Value)
00047     {
00048         WCHAR dst[33];
00049         _ultow_s(err.Value, dst, ARRAYSIZE(dst), 16);
00050         Log(
00051             prefix +
00052             msg +
00053             ", Error code: " +
00054             ref new Platform::String(dst),
00055             nullptr,
00056             "error"
00057             );
00058     }
00059     else
00060     {
00061         Log(
00062             prefix +
00063             msg,
00064             nullptr,
00065             "error"
00066             );
00067     }
00068 }
00069
00070 void SdkSample::FormatError(CaptureFailedEventArgs^ e, Platform::String^ prefix)
00071 {
00072     HResult hr;
00073     hr.Value = e->Code;
00074     FormatError(hr, e->Message, prefix);
00075 }
00076
00077 void SdkSample::ClearLastStatus()
00078 {
00079     Log("");
00080 }
00081
00082 void SdkSample::Log(Platform::String^ message)
00083 {
00084     Log(message, nullptr, "status");
00085 }
00086
00087 void SdkSample::Log(Platform::String^ message, Platform::String^ tag, Platform::String^ type)
00088 {
00089     auto isError = (type == "error");
00090     auto isStatus = (type == "status");
00091
00092     if (isError || isStatus)
00093     {
00094         if (_rootPage != nullptr && _dispatcher != nullptr)
00095         {
00096             _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
00097                 ref new Windows::UI::Core::DispatchedHandler([this, message, isError]()
00098             {
00099                 _rootPage->NotifyUser(message, (isError) ? NotifyType::ErrorMessage : NotifyType::StatusMessage);
00100             }));
00101         }
00102     }
00103 }
00104
00105 CaptureDevice::CaptureDevice()
00106     : _mediaCapture(nullptr)
00107 {
00108
00109 }
00110
00111 Platform::Agile<MediaCapture>
00112     CaptureDevice::MediaCapture::get()
00113 {
00114     return _mediaCapture;
00115 }
00116
00117 /// <summary>
00118 /// Initialization of the device.
00119 /// </summary>
00120 task<void> CaptureDevice::InitializeAsync()
00121 {
00122     try
00123     {
00124         auto mediaCapture = ref new Windows::Media::Capture::MediaCapture();
00125         _mediaCapture = mediaCapture;
00126         _mediaCaptureFailedEventRegistrationToken = mediaCapture->Failed += ref new MediaCaptureFailedEventHandler(this, &CaptureDevice::OnCaptureFailed);
00127
00128         return create_task(mediaCapture->InitializeAsync());
00129     }
00130     catch (Platform::Exception^ e)
00131     {
00132         DoCleanup();
00133         throw e;
00134     }
00135
00136     return create_task([](){});
00137 }
00138
00139 /// <summary>
00140 /// Cleaning up the sink.
00141 /// </summary>
00142 void CaptureDevice::CleanupSink()
00143 {
00144     if (_mediaSink)
00145     {
00146         _mediaSink->IncomingConnectionEvent -= _mediaSinkIncomingConnectionEventRegistrationToken;
00147         delete _mediaSink;
00148         _mediaSink = nullptr;
00149         _recordingStarted = false;
00150     }
00151 }
00152
00153 /// <summary>
00154 /// Cleans up the resources.
00155 /// </summary>
00156 void CaptureDevice::DoCleanup()
00157 {
00158     Windows::Media::Capture::MediaCapture ^mediaCapture = _mediaCapture.Get();
00159     if (mediaCapture != nullptr)
00160     {
00161         mediaCapture->Failed -= _mediaCaptureFailedEventRegistrationToken;
00162     }
00163
00164     CleanupSink();
00165 }
00166
00167 /// <summary>
00168 /// Asynchronous method cleaning up resources and stopping recording if necessary.
00169 /// </summary>
00170 task<void> CaptureDevice::CleanupAsync()
00171 {
00172     Windows::Media::Capture::MediaCapture ^mediaCapture = _mediaCapture.Get();
00173     if (mediaCapture == nullptr && !_mediaSink)
00174     {
00175         return create_task([](){});
00176     }
00177
00178     if (mediaCapture != nullptr)
00179     {
00180         mediaCapture->Failed -= _mediaCaptureFailedEventRegistrationToken;
00181     }
00182
00183     if (mediaCapture != nullptr && _recordingStarted)
00184     {
00185         return create_task(mediaCapture->StopRecordAsync()).then([this](task<void>&)
00186         {
00187             DoCleanup();
00188         });
00189     }
00190     else
00191     {
00192         DoCleanup();
00193     }
00194     return create_task([](){});
00195 }
00196
00197 /// <summary>
00198 /// Function allows to select camera settings.
00199 /// </summary>
00200 /// <param name="mediaStreamType" type="Windows.Media.Capture.MediaStreamType">
00201 /// Type of a the media stream.
00202 /// </param>
00203 /// <param name="mediaStreamType">
00204 /// Function which will be called to filter the correct settings.
00205 /// </param>
00206 task<void> CaptureDevice::SelectPreferredCameraStreamSettingAsync(MediaStreamType mediaStreamType, VideoSettingsFilter^ settingsFilterFunc)
00207 {
00208     auto prefferedSettings = _mediaCapture.Get()->VideoDeviceController->GetAvailableMediaStreamProperties(mediaStreamType);
00209
00210     std::vector<Windows::Media::MediaProperties::IVideoEncodingProperties^> vector;
00211     for (unsigned int i = 0; i < prefferedSettings->Size; i ++)
00212     {
00213         auto prop = prefferedSettings->GetAt(i);
00214         if (settingsFilterFunc(prop, i))
00215         {
00216             vector.push_back(static_cast<Windows::Media::MediaProperties::IVideoEncodingProperties^>(prop));
00217         }
00218     }
00219
00220     std::sort(vector.begin(), vector.end(), [](Windows::Media::MediaProperties::IVideoEncodingProperties^ prop1, Windows::Media::MediaProperties::IVideoEncodingProperties^ prop2)
00221     {
00222         return (prop2->Width - prop1->Width);
00223     });
00224
00225     if (vector.size() > 0)
00226     {
00227         return create_task(_mediaCapture.Get()->VideoDeviceController->SetMediaStreamPropertiesAsync(mediaStreamType, vector.front()));
00228     }
00229
00230     return create_task([]()
00231     {
00232         // Nothing to do
00233     });
00234 }
00235
00236 /// <summary>
00237 /// Begins recording
00238 /// </summary>
00239 /// <param name="mediaEncodingProfile">
00240 /// Encoding profile which should be used for the recording session.
00241 /// </param>
00242 task<void> CaptureDevice::StartRecordingAsync(Windows::Media::MediaProperties::MediaEncodingProfile^ mediaEncodingProfile)
00243 {
00244     // We cannot start recording twice.
00245     if (_mediaSink && _recordingStarted)
00246     {
00247         throw ref new Platform::Exception(__HRESULT_FROM_WIN32(ERROR_INVALID_STATE));
00248     }
00249
00250     // Release sink if there is one already.
00251     CleanupSink();
00252
00253     // Create new sink
00254     _mediaSink = ref new Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy();
00255     _mediaSinkIncomingConnectionEventRegistrationToken = _mediaSink->IncomingConnectionEvent += ref new Windows::Foundation::EventHandler<Object^>(this, &CaptureDevice::OnIncomingConnection);
00256
00257     return create_task(_mediaSink->InitializeAsync(mediaEncodingProfile->Audio, mediaEncodingProfile->Video)).then([this, mediaEncodingProfile](Windows::Media::IMediaExtension^ mediaExtension)
00258     {
00259         return create_task(_mediaCapture->StartRecordToCustomSinkAsync(mediaEncodingProfile, mediaExtension)).then([this](task<void>& asyncInfo)
00260         {
00261             try
00262             {
00263                 asyncInfo.get();
00264                 _recordingStarted = true;
00265             }
00266             catch (Platform::Exception^)
00267             {
00268                 CleanupSink();
00269                 throw;
00270             }
00271         });
00272     });
00273 }
00274
00275 /// <summary>
00276 /// Stops recording.
00277 /// </summary>
00278 task<void> CaptureDevice::StopRecordingAsync()
00279 {
00280     if (_recordingStarted)
00281     {
00282         return create_task(_mediaCapture.Get()->StopRecordAsync()).then([this]()
00283         {
00284             CleanupSink();
00285         });
00286     }
00287     else
00288     {
00289         // If recording not started just do nothing
00290     }
00291     return create_task([](){});
00292 }
Generated on Fri Nov 15 2024 22:21:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/pch.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario1_OmnidirectionalSound.xaml.h Source File

  • SpatialSound
  • cpp

Scenario1_OmnidirectionalSound.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #pragma once
00014
00015 #include "Scenario1_OmnidirectionalSound.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario1_OmnidirectionalSound sealed
00025     {
00026     public:
00027         Scenario1_OmnidirectionalSound();
00028         virtual ~Scenario1_OmnidirectionalSound();
00029     private:
00030         void StartButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void StopButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void OnTimerTick(Object^ sender, Object^ e);
00033         void RadiusSlider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00034         void EnvironmentComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00035         void PlayButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void AngularVelocitySlider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00037         void RotationSpeedSlider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00038         void HeightSlider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00039
00040     private:
00041         MainPage^                       _rootPage;
00042         bool                            _initialized = false;
00043         OmnidirectionalSound            _omnidirectionalSound;
00044         DispatcherTimer^                _timer;
00045         EventRegistrationToken          _timerEventToken;
00046         float                           _radius = 2.0f;            // Radius of the orbit
00047         float                           _height = 0;               // Height at which the sound is orbiting (0 for centered around listener's head, +ve for above and -ve for below)
00048         float                           _angularVelocity = 0;      // Speed of orbit, default is stationary
00049     };
00050 }
Generated on Fri Nov 15 2024 22:21:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario1_XmlReader.xaml.h Source File

  • XmlLite
  • cpp

Scenario1_XmlReader.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_XmlReader.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     namespace XmlLite
00020     {
00021         /// <summary>
00022         /// An empty page that can be used on its own or navigated to within a Frame.
00023         /// </summary>
00024         [Windows::Foundation::Metadata::WebHostHidden]
00025         public ref class Scenario1 sealed
00026         {
00027         public:
00028             Scenario1();
00029
00030         private:
00031             MainPage^ rootPage;
00032             void ReadXmlClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033
00034             HRESULT ReadXml(Windows::Storage::Streams::IRandomAccessStream^ readStream);
00035             HRESULT ReadAttributes(IXmlReader* reader);
00036             HRESULT ConcatToOutput(PCWSTR str, UINT strLen);
00037         };
00038     }
00039 }
Generated on Fri Nov 15 2024 22:22:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario03_GetList.xaml.cs Source File

  • HttpClient
  • cs

Scenario03_GetList.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Linq;
00014 using System.Threading;
00015 using System.Threading.Tasks;
00016 using System.Xml.Linq;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020 using Windows.Web.Http;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario03_GetList : Page
00025     {
00026         MainPage rootPage = MainPage.Current;
00027
00028         private HttpClient httpClient;
00029         private CancellationTokenSource cts;
00030
00031         public Scenario03_GetList()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedTo(NavigationEventArgs e)
00037         {
00038             httpClient = Helpers.CreateHttpClientWithPlugIn();
00039             cts = new CancellationTokenSource();
00040         }
00041
00042         protected override void OnNavigatedFrom(NavigationEventArgs e)
00043         {
00044             cts.Cancel();
00045             cts.Dispose();
00046             httpClient.Dispose();
00047         }
00048
00049         private async void Start_Click(object sender, RoutedEventArgs e)
00050         {
00051             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00052             // valid, absolute URI, we'll notify the user about the incorrect input.
00053             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00054             if (resourceUri == null)
00055             {
00056                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00057                 return;
00058             }
00059
00060             Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
00061             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00062
00063             // This sample uses a "try" in order to support TaskCanceledException.
00064             // If you don't need to support cancellation, then the "try" is not needed.
00065             try
00066             {
00067                 HttpRequestResult result = await httpClient.TryGetAsync(resourceUri).AsTask(cts.Token);
00068
00069                 if (result.Succeeded)
00070                 {
00071                     await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
00072                     result.ResponseMessage.EnsureSuccessStatusCode();
00073
00074                     XElement element = XElement.Parse(await result.ResponseMessage.Content.ReadAsStringAsync().AsTask(cts.Token));
00075                     OutputList.ItemsSource = (
00076                         from c in element.Elements("item")
00077                         select c.Attribute("name").Value);
00078
00079                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00080                 }
00081                 else
00082                 {
00083                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00084                 }
00085             }
00086             catch (TaskCanceledException)
00087             {
00088                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00089             }
00090
00091             Helpers.ScenarioCompleted(StartButton, CancelButton);
00092         }
00093
00094         private void Cancel_Click(object sender, RoutedEventArgs e)
00095         {
00096             cts.Cancel();
00097             cts.Dispose();
00098
00099             // Re-create the CancellationTokenSource.
00100             cts = new CancellationTokenSource();
00101         }
00102     }
00103 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario2_Polling.xaml.cpp Source File

  • RelativeInclinometer
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033
00034     inclinometer = Inclinometer::GetDefaultForRelativeReadings();
00035     if (inclinometer == nullptr)
00036     {
00037         rootPage->NotifyUser("No relative inclinometer found", NotifyType::ErrorMessage);
00038         GetDataButton->IsEnabled = false;
00039     }
00040     else
00041     {
00042         GetDataButton->IsEnabled = true;
00043     }
00044 }
00045
00046 /// <summary>
00047 /// Invoked when this page is about to be displayed in a Frame.
00048 /// </summary>
00049 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00050 /// property is typically used to configure the page.</param>
00051 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00052 {
00053 }
00054
00055 /// <summary>
00056 /// Invoked when this page is no longer displayed.
00057 /// </summary>
00058 /// <param name="e"></param>
00059 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00060 {
00061     // If the navigation is external to the app do not clean up.
00062     // This can occur on Phone when suspending the app.
00063     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00064     {
00065         return;
00066     }
00067 }
00068
00069 void Scenario2_Polling::GetData(Object^ sender, Object^ e)
00070 {
00071     InclinometerReading^ reading = inclinometer->GetCurrentReading();
00072     if (reading != nullptr)
00073     {
00074         ScenarioOutput_X->Text = reading->PitchDegrees.ToString();
00075         ScenarioOutput_Y->Text = reading->RollDegrees.ToString();
00076         ScenarioOutput_Z->Text = reading->YawDegrees.ToString();
00077     }
00078 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Face Member List

This is the complete list of members for Face, including all inherited members.
Active(bool active) | GameObject |
Active() | GameObject |
AnimatePosition(_In_ std::shared_ptr< Animate > const &animate) | GameObject |
AnimatePosition() | GameObject |
Face() | Face |
Face(DirectX::XMFLOAT3 origin, DirectX::XMFLOAT3 p1, DirectX::XMFLOAT3 p2) | Face |
GameObject() | GameObject |
Hit(bool hit) | GameObject |
Hit() | GameObject |
HitMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
HitMaterial() | GameObject |
HitSound(_In_ std::shared_ptr< SoundEffect > const &hitSound) | GameObject |
HitSound() | GameObject |
HitTime(float t) | GameObject |
HitTime() | GameObject |
IsTouching(DirectX::XMFLOAT3 point, float radius, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) override | Face | [virtual]
m_height | Face | [private]
m_heightVector | Face | [private]
m_modelMatrix | GameObject | [protected]
m_normal | Face | [private]
m_point | Face | [private]
m_position | GameObject | [protected]
m_rotationMatrix | Face | [private]
m_width | Face | [private]
m_widthVector | Face | [private]
Mesh(_In_ std::shared_ptr< MeshObject > const &mesh) | GameObject |
ModelMatrix() | GameObject |
NormalMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
NormalMaterial() | GameObject |
OnGround(bool ground) | GameObject |
OnGround() | GameObject |
PlaySound(float impactSpeed, DirectX::XMFLOAT3 eyePoint) | GameObject |
Position(DirectX::XMFLOAT3 position) | GameObject |
Position(DirectX::XMVECTOR position) | GameObject |
Position() | GameObject |
Render(_In_ ID3D11DeviceContext *context, _In_ ID3D11Buffer *primitiveConstantBuffer) | GameObject |
SetPlane(DirectX::XMFLOAT3 origin, DirectX::XMFLOAT3 p1, DirectX::XMFLOAT3 p2) | Face |
Target(bool target) | GameObject |
Target() | GameObject |
TargetId(int targetId) | GameObject |
TargetId() | GameObject |
UpdateMatrix() | Face | [private]
UpdatePosition() override | Face | [protected, virtual]
VectorPosition() | GameObject |
VectorVelocity() | GameObject |
Velocity(DirectX::XMFLOAT3 velocity) | GameObject |
Velocity(DirectX::XMVECTOR velocity) | GameObject |
Velocity() | GameObject |
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4 Member List

This is the complete list of members for Scenario4, including all inherited members.
CreateLineItemTextBlock(string contents) | Scenario4 | [inline, private]
deltaTransform | Scenario4 | [private]
forceManipulationsToEnd | Scenario4 | [private]
GetFilesButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
GetThumbnailButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
InertiaSwitch_Toggled(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
InitManipulationTransforms() | Scenario4 | [inline, private]
InitOptions() | Scenario4 | [inline, private]
inkRecognizerContainer | Scenario4 | [private]
item | Scenario4 | [private]
ManipulateMe_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) | Scenario4 | [inline, private]
ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) | Scenario4 | [inline, private]
ManipulateMe_ManipulationInertiaStarting(object sender, ManipulationInertiaStartingRoutedEventArgs e) | Scenario4 | [inline, private]
ManipulateMe_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) | Scenario4 | [inline, private]
movementAxis_Changed(object sender, SelectionChangedEventArgs e) | Scenario4 | [inline, private]
mpiLogger | Scenario4 | [private]
myMap_Loaded(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
OnClear(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario4 | [inline, protected]
OnRecognizeAsync(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
OnRecognizerChanged(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario4 | [inline, private]
previousInputLanguage | Scenario4 | [private]
previousTransform | Scenario4 | [private]
ReadBytesButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
RecoButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
recoView | Scenario4 | [private]
resetButton_Pressed(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
rootPage | Scenario4 | [private]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
Scenario4() | Scenario4 | [inline]
SetDefaultRecognizerByCurrentInputMethodLanguageTag() | Scenario4 | [inline, private]
SetRecognizerByName(string recognizerName) | Scenario4 | [inline, private]
showSpaceNeedleButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
textServiceManager | Scenario4 | [private]
TextServiceManager_InputLanguageChanged(CoreTextServicesManager sender, object args) | Scenario4 | [inline, private]
TrackButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
transforms | Scenario4 | [private]
VideoTracks_SelectedIndexChanged(ISingleSelectMediaTrackList sender, object args) | Scenario4 | [inline, private]
WriteBytesButton_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SocketActivityTask Member List

This is the complete list of members for SocketActivityTask, including all inherited members.
Run(IBackgroundTaskInstance taskInstance) | SocketActivityTask | [inline]
ShowToast(string text) | SocketActivityTask | [inline]
socketId | SocketActivityTask | [private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario2_RequestMany.h Source File

  • Capabilities
  • cppwinrt

Scenario2_RequestMany.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_RequestMany.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_RequestMany : Scenario2_RequestManyT<Scenario2_RequestMany>
00019     {
00020         Scenario2_RequestMany();
00021
00022         fire_and_forget RequestAccessButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario2_RequestMany : Scenario2_RequestManyT<Scenario2_RequestMany, implementation::Scenario2_RequestMany>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CommonLicenseRequest Member List

This is the complete list of members for CommonLicenseRequest, including all inherited members.
AcquireLicenseAsync(Uri licenseServerUri, HttpContent httpRequestContent) | CommonLicenseRequest | [inline, virtual]
CommonLicenseRequest(HttpClient client=null) | CommonLicenseRequest | [inline]
GetLastErrorMessage() | CommonLicenseRequest | [inline]
httpClient | CommonLicenseRequest | [private]
lastErrorMessage | CommonLicenseRequest | [private]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlotDataSourceT< D > Member List

This is the complete list of members for PlotDataSourceT< D >, including all inherited members.
m_plotDataReady | PlotDataSourceT< D > | [protected]
PlotDataReady(Windows::Foundation::TypedEventHandler< IPlotDataSource, SDKTemplate::PlotDataReadyEventArgs > const &handler) | PlotDataSourceT< D > | [inline]
PlotDataReady(event_token token) | PlotDataSourceT< D > | [inline]
ReportPlotDataReady(Windows::Storage::Streams::IBuffer const &buffer) | PlotDataSourceT< D > | [inline, protected]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario5.xaml.cs Source File

  • FileThumbnails
  • cs

Scenario5.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Text;
00015 using Windows.Storage;
00016 using Windows.Storage.FileProperties;
00017 using Windows.Storage.Pickers;
00018 using Windows.Storage.Search;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario5 : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario5()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock, OutputDetails);
00037         }
00038
00039         private async void GetThumbnailButton_Click(object sender, RoutedEventArgs e)
00040         {
00041             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock, OutputDetails);
00042
00043             // Pick a folder
00044             FolderPicker folderPicker = new FolderPicker();
00045             foreach (string extension in FileExtensions.Image)
00046             {
00047                 folderPicker.FileTypeFilter.Add(extension);
00048             }
00049
00050             StorageFolder folder = await folderPicker.PickSingleFolderAsync();
00051             if (folder != null)
00052             {
00053                 const CommonFolderQuery monthShape = CommonFolderQuery.GroupByMonth;
00054                 // Verify queries are supported because they are not supported in all picked locations.
00055                 if (folder.IsCommonFolderQuerySupported(monthShape))
00056                 {
00057                     // Convert folder to file group and query for items
00058                     IReadOnlyList<StorageFolder> months = await folder.CreateFolderQuery(monthShape).GetFoldersAsync();
00059
00060                     if (months != null && months.Count > 0)
00061                     {
00062                         const ThumbnailMode thumbnailMode = ThumbnailMode.PicturesView;
00063                         const uint size = 200;
00064                         StorageFolder firstMonth = months[0];
00065                         using (StorageItemThumbnail thumbnail = await firstMonth.GetThumbnailAsync(thumbnailMode, size))
00066                         {
00067                             if (thumbnail != null)
00068                             {
00069                                 MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, firstMonth, thumbnail, true);
00070
00071                                 // Also display the hierarchy of the file group to better visualize where the thumbnail comes from
00072                                 IReadOnlyList<StorageFile> files = await firstMonth.GetFilesAsync();
00073
00074                                 if (files != null)
00075                                 {
00076                                     StringBuilder output = new StringBuilder("\nList of files in this group:\n\n");
00077                                     foreach (StorageFile file in files)
00078                                     {
00079                                         output.AppendFormat("{0}\n", file.Name);
00080                                     }
00081                                     OutputDetails.Text = output.ToString();
00082                                 }
00083                             }
00084                             else
00085                             {
00086                                 rootPage.NotifyUser(Errors.NoImages, NotifyType.StatusMessage);
00087                             }
00088                         }
00089                     }
00090                     else
00091                     {
00092                         rootPage.NotifyUser(Errors.FileGroupEmpty, NotifyType.StatusMessage);
00093                     }
00094                 }
00095                 else
00096                 {
00097                     rootPage.NotifyUser(Errors.FileGroupLocation, NotifyType.StatusMessage);
00098                 }
00099             }
00100             else
00101             {
00102                 rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
00103             }
00104         }
00105     }
00106 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
App() | sealed |
Initialize(Windows::ApplicationModel::Core::CoreApplicationView^applicationView) | sealed | [virtual]
Load(Platform::String^entryPoint) | sealed | [virtual]
m_deviceResources | sealed | [private]
m_main | sealed | [private]
m_windowClosed | sealed | [private]
m_windowVisible | sealed | [private]
OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^args) | sealed | [protected]
OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [protected]
OnDpiChanged(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [protected]
OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^sender, Platform::Object^args) | sealed | [protected]
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [protected]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [protected]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [protected]
OnWindowClosed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args) | sealed | [protected]
OnWindowSizeChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::WindowSizeChangedEventArgs^args) | sealed | [protected]
Run() | sealed | [virtual]
SetWindow(Windows::UI::Core::CoreWindow^window) | sealed | [virtual]
Uninitialize() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cs/SampleConfiguration.cs Source File

  • UserConsentVerifier
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "User Consent Verifier";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Check Consent Availability", ClassType=typeof(Scenario1_CheckConsentAvailability)},
00025             new Scenario() { Title="Request Consent", ClassType=typeof(Scenario2_RequestConsent)}
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/cs/Scenario1_ExampleOperations.xaml.cs Source File

  • CameraOpenCV
  • cs

Scenario1_ExampleOperations.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using OpenCVBridge;
00012 using System;
00013 using System.Diagnostics;
00014 using System.Linq;
00015 using System.Threading;
00016 using System.Threading.Tasks;
00017 using Windows.Graphics.Imaging;
00018 using Windows.Media.Capture;
00019 using Windows.Media.Capture.Frames;
00020 using Windows.Media.MediaProperties;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// Scenario that illustrates using OpenCV along with camera frames.
00029     /// </summary>
00030     public sealed partial class Scenario1_ExampleOperations : Page
00031     {
00032         private MainPage rootPage;
00033
00034         private MediaCapture _mediaCapture = null;
00035         private MediaFrameReader _reader = null;
00036         private FrameRenderer _previewRenderer = null;
00037         private FrameRenderer _outputRenderer = null;
00038
00039         private int _frameCount = 0;
00040
00041         private const int IMAGE_ROWS = 480;
00042         private const int IMAGE_COLS = 640;
00043
00044         private OpenCVHelper _helper;
00045
00046         private DispatcherTimer _FPSTimer = null;
00047
00048         enum OperationType
00049         {
00050             Blur = 0,
00051             HoughLines,
00052             Contours,
00053             Histogram,
00054             MotionDetector
00055         }
00056         OperationType currentOperation;
00057
00058         public Scenario1_ExampleOperations()
00059         {
00060             this.InitializeComponent();
00061             _previewRenderer = new FrameRenderer(PreviewImage);
00062             _outputRenderer = new FrameRenderer(OutputImage);
00063
00064             _helper = new OpenCVHelper();
00065
00066             _FPSTimer = new DispatcherTimer()
00067             {
00068                 Interval = TimeSpan.FromSeconds(1)
00069             };
00070             _FPSTimer.Tick += UpdateFPS;
00071         }
00072
00073         /// <summary>
00074         /// Initializes the MediaCapture object with the given source group.
00075         /// </summary>
00076         /// <param name="sourceGroup">SourceGroup with which to initialize.</param>
00077         private async Task InitializeMediaCaptureAsync(MediaFrameSourceGroup sourceGroup)
00078         {
00079             if (_mediaCapture != null)
00080             {
00081                 return;
00082             }
00083
00084             _mediaCapture = new MediaCapture();
00085             var settings = new MediaCaptureInitializationSettings()
00086             {
00087                 SourceGroup = sourceGroup,
00088                 SharingMode = MediaCaptureSharingMode.ExclusiveControl,
00089                 StreamingCaptureMode = StreamingCaptureMode.Video,
00090                 MemoryPreference = MediaCaptureMemoryPreference.Cpu
00091             };
00092             await _mediaCapture.InitializeAsync(settings);
00093         }
00094
00095         /// <summary>
00096         /// Unregisters FrameArrived event handlers, stops and disposes frame readers
00097         /// and disposes the MediaCapture object.
00098         /// </summary>
00099         private async Task CleanupMediaCaptureAsync()
00100         {
00101             if (_mediaCapture != null)
00102             {
00103                 await _reader.StopAsync();
00104                 _reader.FrameArrived -= ColorFrameReader_FrameArrivedAsync;
00105                 _reader.Dispose();
00106                 _mediaCapture = null;
00107             }
00108         }
00109
00110         private void UpdateFPS(object sender, object e)
00111         {
00112             var frameCount = Interlocked.Exchange(ref _frameCount, 0);
00113             this.FPSMonitor.Text = "FPS: " + frameCount;
00114         }
00115
00116         protected override async void OnNavigatedTo(NavigationEventArgs e)
00117         {
00118             rootPage = MainPage.Current;
00119
00120             // setting up the combobox, and default operation
00121             OperationComboBox.ItemsSource = Enum.GetValues(typeof(OperationType));
00122             OperationComboBox.SelectedIndex = 0;
00123             currentOperation = OperationType.Blur;
00124
00125             // Find the sources
00126             var allGroups = await MediaFrameSourceGroup.FindAllAsync();
00127             var sourceGroups = allGroups.Select(g => new
00128             {
00129                 Group = g,
00130                 SourceInfo = g.SourceInfos.FirstOrDefault(i => i.SourceKind == MediaFrameSourceKind.Color)
00131             }).Where(g => g.SourceInfo != null).ToList();
00132
00133             if (sourceGroups.Count == 0)
00134             {
00135                 // No camera sources found
00136                 return;
00137             }
00138             var selectedSource = sourceGroups.FirstOrDefault();
00139
00140             // Initialize MediaCapture
00141             try
00142             {
00143                 await InitializeMediaCaptureAsync(selectedSource.Group);
00144             }
00145             catch (Exception exception)
00146             {
00147                 Debug.WriteLine("MediaCapture initialization error: " + exception.Message);
00148                 await CleanupMediaCaptureAsync();
00149                 return;
00150             }
00151
00152             // Create the frame reader
00153             MediaFrameSource frameSource = _mediaCapture.FrameSources[selectedSource.SourceInfo.Id];
00154             BitmapSize size = new BitmapSize() // Choose a lower resolution to make the image processing more performant
00155             {
00156                 Height = IMAGE_ROWS,
00157                 Width = IMAGE_COLS
00158             };
00159             _reader = await _mediaCapture.CreateFrameReaderAsync(frameSource, MediaEncodingSubtypes.Bgra8, size);
00160             _reader.FrameArrived += ColorFrameReader_FrameArrivedAsync;
00161             await _reader.StartAsync();
00162
00163             _FPSTimer.Start();
00164         }
00165
00166         protected override async void OnNavigatedFrom(NavigationEventArgs args)
00167         {
00168             _FPSTimer.Stop();
00169             await CleanupMediaCaptureAsync();
00170         }
00171
00172         /// <summary>
00173         /// Handles a frame arrived event and renders the frame to the screen.
00174         /// </summary>
00175         private void ColorFrameReader_FrameArrivedAsync(MediaFrameReader sender, MediaFrameArrivedEventArgs args)
00176         {
00177             var frame = sender.TryAcquireLatestFrame();
00178             if (frame != null)
00179             {
00180                 SoftwareBitmap originalBitmap = null;
00181                 var inputBitmap = frame.VideoMediaFrame?.SoftwareBitmap;
00182                 if (inputBitmap != null)
00183                 {
00184                     // The XAML Image control can only display images in BRGA8 format with premultiplied or no alpha
00185                     // The frame reader as configured in this sample gives BGRA8 with straight alpha, so need to convert it
00186                     originalBitmap = SoftwareBitmap.Convert(inputBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
00187
00188                     SoftwareBitmap outputBitmap = new SoftwareBitmap(BitmapPixelFormat.Bgra8, originalBitmap.PixelWidth, originalBitmap.PixelHeight, BitmapAlphaMode.Premultiplied);
00189
00190                     // Operate on the image in the manner chosen by the user.
00191                     if (currentOperation == OperationType.Blur)
00192                     {
00193                         _helper.Blur(originalBitmap, outputBitmap);
00194                     }
00195                     else if (currentOperation == OperationType.HoughLines)
00196                     {
00197                         _helper.HoughLines(originalBitmap, outputBitmap);
00198                     }
00199                     else if (currentOperation == OperationType.Contours)
00200                     {
00201                         _helper.Contours(originalBitmap, outputBitmap);
00202                     }
00203                     else if (currentOperation == OperationType.Histogram)
00204                     {
00205                         _helper.Histogram(originalBitmap, outputBitmap);
00206                     }
00207                     else if (currentOperation == OperationType.MotionDetector)
00208                     {
00209                         _helper.MotionDetector(originalBitmap, outputBitmap);
00210                     }
00211
00212                     // Display both the original bitmap and the processed bitmap.
00213                     _previewRenderer.RenderFrame(originalBitmap);
00214                     _outputRenderer.RenderFrame(outputBitmap);
00215                 }
00216
00217                 Interlocked.Increment(ref _frameCount);
00218             }
00219         }
00220
00221         private void OperationComboBox_SelectionChanged(object sender, RoutedEventArgs e)
00222         {
00223             currentOperation = (OperationType)((sender as ComboBox).SelectedItem);
00224             if (OperationType.Blur == currentOperation)
00225             {
00226                 this.CurrentOperationTextBlock.Text = "Current: Blur";
00227             }
00228             else if (OperationType.Contours == currentOperation)
00229             {
00230                 this.CurrentOperationTextBlock.Text = "Current: Contours";
00231             }
00232             else if (OperationType.Histogram == currentOperation)
00233             {
00234                 this.CurrentOperationTextBlock.Text = "Current: Histogram of RGB channels";
00235             }
00236             else if (OperationType.HoughLines == currentOperation)
00237             {
00238                 this.CurrentOperationTextBlock.Text = "Current: Line detection";
00239             }
00240             else if (OperationType.MotionDetector == currentOperation)
00241             {
00242                 this.CurrentOperationTextBlock.Text = "Current: Motion detection";
00243             }
00244             else
00245             {
00246                 this.CurrentOperationTextBlock.Text = string.Empty;
00247             }
00248         }
00249     }
00250 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/pch.cpp Source File

  • LampDevice
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario1_Check.h Source File

  • Capabilities
  • cppwinrt

Scenario1_Check.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Check.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_Check : Scenario1_CheckT<Scenario1_Check>
00019     {
00020         Scenario1_Check();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024
00025         fire_and_forget StreamLocationButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027     private:
00028         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00029         Windows::Security::Authorization::AppCapabilityAccess::AppCapability locationCapability{ nullptr };
00030         event_token accessChangedToken;
00031
00032         fire_and_forget OnCapabilityAccessChanged(Windows::Security::Authorization::AppCapabilityAccess::AppCapability const&, Windows::Foundation::IInspectable const&);
00033         Windows::Foundation::IAsyncAction StreamLocationAsync();
00034         void UpdateCapabilityStatus();
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario1_Check : Scenario1_CheckT<Scenario1_Check, implementation::Scenario1_Check>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Input Member List

This is the complete list of members for Scenario4_Input, including all inherited members.
Scenario4_Input() | Scenario4_Input
ShowResults_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_Input
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaItemViewModel Member List

This is the complete list of members for MediaItemViewModel, including all inherited members.
listViewModel | MediaItemViewModel | [private]
MediaItem | MediaItemViewModel |
MediaItemViewModel(MediaListViewModel listViewModel, MediaItem mediaItem) | MediaItemViewModel | [inline]
PlaybackItem | MediaItemViewModel |
playbackItem | MediaItemViewModel | [private]
PreviewImage | MediaItemViewModel |
previewImage | MediaItemViewModel | [private]
PropertyChanged | MediaItemViewModel |
RaisePropertyChanged(string propertyName) | MediaItemViewModel | [inline, private]
Title | MediaItemViewModel |
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario10_UnviewableContent Member List

This is the complete list of members for Scenario10_UnviewableContent, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario10_UnviewableContent | [inline, protected]
rootPage | Scenario10_UnviewableContent | [private]
Scenario10_UnviewableContent() | Scenario10_UnviewableContent | [inline]
WebViewControl_UnviewableContentIdentified(WebView sender, WebViewUnviewableContentIdentifiedEventArgs args) | Scenario10_UnviewableContent | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/MainPage.xaml.cs Source File

  • XamlCommanding
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Data;
00017 using Windows.UI.Xaml.Media;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class MainPage : Page
00028     {
00029         public static MainPage Current;
00030
00031         public MainPage()
00032         {
00033             this.InitializeComponent();
00034
00035             // This is a static public property that allows downstream pages to get a handle to the MainPage instance
00036             // in order to call methods that are in this class.
00037             Current = this;
00038             SampleTitle.Text = FEATURE_NAME;
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             // Populate the scenario list from the SampleConfiguration.cs file
00044             ScenarioControl.ItemsSource = scenarios;
00045             if (Window.Current.Bounds.Width < 640)
00046             {
00047                 ScenarioControl.SelectedIndex = -1;
00048             }
00049             else
00050             {
00051                 ScenarioControl.SelectedIndex = 0;
00052             }
00053         }
00054
00055         /// <summary>
00056         /// Called whenever the user changes selection in the scenarios list.  This method will navigate to the respective
00057         /// sample scenario page.
00058         /// </summary>
00059         /// <param name="sender"></param>
00060         /// <param name="e"></param>
00061         private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
00062         {
00063             // Clear the status block when navigating scenarios.
00064             NotifyUser(String.Empty, NotifyType.StatusMessage);
00065
00066             ListBox scenarioListBox = sender as ListBox;
00067             Scenario s = scenarioListBox.SelectedItem as Scenario;
00068             if (s != null)
00069             {
00070                 ScenarioFrame.Navigate(s.ClassType);
00071                 if (Window.Current.Bounds.Width < 640)
00072                 {
00073                     Splitter.IsPaneOpen = false;
00074                     StatusBorder.Visibility = Visibility.Collapsed;
00075                 }
00076             }
00077         }
00078
00079         public List<Scenario> Scenarios
00080         {
00081             get { return this.scenarios; }
00082         }
00083
00084         /// <summary>
00085         /// Used to display messages to the user
00086         /// </summary>
00087         /// <param name="strMessage"></param>
00088         /// <param name="type"></param>
00089         public void NotifyUser(string strMessage, NotifyType type)
00090         {
00091             switch (type)
00092             {
00093                 case NotifyType.StatusMessage:
00094                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
00095                     break;
00096                 case NotifyType.ErrorMessage:
00097                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
00098                     break;
00099             }
00100             StatusBlock.Text = strMessage;
00101
00102             // Collapse the StatusBlock if it has no text to conserve real estate.
00103             StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
00104         }
00105
00106         async void Footer_Click(object sender, RoutedEventArgs e)
00107         {
00108             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00109         }
00110
00111         private void Button_Click(object sender, RoutedEventArgs e)
00112         {
00113             Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
00114             StatusBorder.Visibility = Visibility.Collapsed;
00115         }
00116     }
00117     public enum NotifyType
00118     {
00119         StatusMessage,
00120         ErrorMessage
00121     };
00122
00123     public class ScenarioBindingConverter : IValueConverter
00124     {
00125         public object Convert(object value, Type targetType, object parameter, string language)
00126         {
00127             Scenario s = value as Scenario;
00128             return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
00129         }
00130
00131         public object ConvertBack(object value, Type targetType, object parameter, string language)
00132         {
00133             return true;
00134         }
00135     }
00136 }
00137
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/MainViewModel.cs Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • ViewModel

MainViewModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.ObjectModel;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007
00008 namespace OneHandedUse_TailoredMultipleViews.ViewModel
00009 {
00010     public class MainViewModel
00011     {
00012         private ObservableCollection<Model> _albumItems, _collectionItems;
00013         public ObservableCollection<Model> AlbumItems
00014         {
00015             get
00016             {
00017                 return _albumItems;
00018             }
00019
00020             set
00021             {
00022                 _albumItems = value;
00023             }
00024         }
00025         public ObservableCollection<Model> CollectionItems
00026         {
00027             get
00028             {
00029                 return _collectionItems;
00030             }
00031
00032             set
00033             {
00034                 _collectionItems = value;
00035             }
00036         }
00037         public ObservableCollection<Model> GetAlbums()
00038         {
00039             AlbumItems = new ObservableCollection<Model>();
00040             AlbumItems.Clear();
00041             for (int i = 1; i < 13; i++)
00042             {
00043                 AlbumItems.Add(new Model { ImageUri = new Uri("ms-appx:///Images/LandscapeImage" + i.ToString() + ".jpg", UriKind.Absolute) });
00044             }
00045             return AlbumItems;
00046         }
00047
00048         public ObservableCollection<Model> GetCollections()
00049         {
00050             CollectionItems = new ObservableCollection<Model>();
00051             CollectionItems.Clear();
00052             for (int i = 13; i <= 25; i++)
00053             {
00054                 CollectionItems.Add(new Model { ImageUri = new Uri("ms-appx:///Images/LandscapeImage" + i.ToString() + ".jpg", UriKind.Absolute) });
00055             }
00056             return CollectionItems;
00057         }
00058     }
00059 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleOverlay Member List

This is the complete list of members for SampleOverlay, including all inherited members.
CreateDeviceDependentResources() | SampleOverlay |
CreateWindowSizeDependentResources() | SampleOverlay |
GetTitleHeightInDips() | SampleOverlay |
m_caption | SampleOverlay | [private]
m_deviceResources | SampleOverlay | [private]
m_drawOverlay | SampleOverlay | [private]
m_idIncrement | SampleOverlay | [private]
m_logoBitmap | SampleOverlay | [private]
m_logoSize | SampleOverlay | [private]
m_overlayWidth | SampleOverlay | [private]
m_padding | SampleOverlay | [private]
m_stateBlock | SampleOverlay | [private]
m_textLayout | SampleOverlay | [private]
m_textVerticalOffset | SampleOverlay | [private]
m_whiteBrush | SampleOverlay | [private]
ReleaseDeviceDependentResources() | SampleOverlay |
Render() | SampleOverlay |
SampleOverlay(const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption) | SampleOverlay |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Client Member List

This is the complete list of members for Scenario2_Client, including all inherited members.
AddValueChangedHandler() | Scenario2_Client | [inline, private]
bluetoothLeDevice | Scenario2_Client | [private]
Characteristic_ValueChanged(GattCharacteristic sender, GattValueChangedEventArgs args) | Scenario2_Client | [inline, private]
CharacteristicList_SelectionChanged() | Scenario2_Client | [inline, private]
CharacteristicReadButton_Click() | Scenario2_Client | [inline, private]
CharacteristicWriteButton_Click() | Scenario2_Client | [inline, private]
CharacteristicWriteButtonInt_Click() | Scenario2_Client | [inline, private]
ClearBluetoothLEDeviceAsync() | Scenario2_Client | [inline, private]
ConnectButton_Click() | Scenario2_Client | [inline, private]
E_ACCESSDENIED | Scenario2_Client | [private]
E_BLUETOOTH_ATT_INVALID_PDU | Scenario2_Client | [private]
E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED | Scenario2_Client | [private]
E_DEVICE_NOT_AVAILABLE | Scenario2_Client | [private]
EnableCharacteristicPanels(GattCharacteristicProperties properties) | Scenario2_Client | [inline, private]
FormatValueByPresentation(IBuffer buffer, GattPresentationFormat format) | Scenario2_Client | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_Client | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Client | [inline, protected]
ParseHeartRateValue(byte[] data) | Scenario2_Client | [inline, private, static]
presentationFormat | Scenario2_Client | [private]
registeredCharacteristic | Scenario2_Client | [private]
RemoveValueChangedHandler() | Scenario2_Client | [inline, private]
rootPage | Scenario2_Client | [private]
Scenario2_Client() | Scenario2_Client | [inline]
selectedCharacteristic | Scenario2_Client | [private]
ServiceList_SelectionChanged() | Scenario2_Client | [inline, private]
SetVisibility(UIElement element, bool visible) | Scenario2_Client | [inline, private]
subscribedForNotifications | Scenario2_Client | [private]
ValueChangedSubscribeToggle_Click() | Scenario2_Client | [inline, private]
WriteBufferToSelectedCharacteristicAsync(IBuffer buffer) | Scenario2_Client | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/MainPage.xaml.cs Source File

  • MicrosoftPassport
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 // Please refer to the Microsoft Passport and Windows Hello
00012 // whitepaper on the Windows Dev Center for a complete
00013 // explanation of Microsoft Passport and Windows Hello
00014 // implementation:
00015 // http://go.microsoft.com/fwlink/p/?LinkId=522066
00016 //*********************************************************
00017 using System;
00018 using System.Threading.Tasks;
00019 using Windows.Data.Json;
00020 using Windows.Security.Credentials;
00021 using Windows.Security.Cryptography;
00022 using Windows.Storage;
00023 using Windows.Storage.Streams;
00024 using Windows.UI.Popups;
00025 using Windows.UI.Xaml;
00026 using Windows.UI.Xaml.Controls;
00027 using Windows.UI.Xaml.Navigation;
00028
00029 namespace SDKTemplate
00030 {
00031     public sealed partial class MainPage : Page
00032     {
00033         private string userId;
00034         private string publicKeyHint;
00035
00036         public MainPage()
00037         {
00038             InitializeComponent();
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             userId = ApplicationData.Current.LocalSettings.Values["userId"] as string ?? string.Empty;
00044             publicKeyHint = ApplicationData.Current.LocalSettings.Values["publicKeyHint"] as string ?? string.Empty;
00045
00046             UpdateUI();
00047         }
00048
00049         private void UpdateUI()
00050         {
00051             RegisteredUserName.Text = userId;
00052             if (userId.Length != 0 && publicKeyHint.Length != 0)
00053             {
00054                 SignInWithHelloContent.Visibility = Visibility.Visible;
00055                 SignInWithPasswordContent.Visibility = Visibility.Collapsed;
00056             }
00057             else
00058             {
00059                 SignInWithHelloContent.Visibility = Visibility.Collapsed;
00060                 SignInWithPasswordContent.Visibility = Visibility.Visible;
00061             }
00062         }
00063
00064         private async void Unregister()
00065         {
00066             // Don't let the user try a new operation while we are busy with this one.
00067             SignInWithHelloButton.IsEnabled = false;
00068             SignInAsSomeoneElseButton.IsEnabled = false;
00069
00070             // Remove the credential from the key credential manager, to free up space on the device.
00071             await Util.TryDeleteCredentialAccountAsync(userId);
00072
00073             // Remove the credential from the server, to free up space on the server.
00074             JsonValue jsonResult = await JsonRequest.Create()
00075                 .AddString("userId", userId)
00076                 .AddString("publicKeyHint", publicKeyHint)
00077                 .PostAsync("api/Authentication/RemoveRegisteredKey");
00078             if (jsonResult == null || !jsonResult.GetBoolean())
00079             {
00080                 // Could not delete from the server. Nothing we can do; just ignore the error.
00081             }
00082
00083             // Remove our app's knowledge of the user.
00084             ApplicationData.Current.LocalSettings.Values.Remove("userId");
00085             ApplicationData.Current.LocalSettings.Values.Remove("publicKeyHint");
00086             userId = string.Empty;
00087
00088             SignInWithHelloButton.IsEnabled = true;
00089             SignInAsSomeoneElseButton.IsEnabled = true;
00090
00091             UpdateUI();
00092         }
00093
00094         // Signing in requires a non-blank user name and password.
00095         private void OnSignInInfoChanged()
00096         {
00097             SignInWithPasswordButton.IsEnabled = (!string.IsNullOrWhiteSpace(UserNameTextBox.Text) && !string.IsNullOrWhiteSpace(PasswordTextBox.Password));
00098         }
00099
00100         private async void SignInWithPassword()
00101         {
00102             string password = PasswordTextBox.Password;
00103
00104             // Perform traditional standard authentication here.
00105             // Our sample accepts any userid and password.
00106
00107             // Next, see if we can offer to switch to Windows Hello sign-in.
00108             // Check if the device is capable of provisioning Microsoft Passport key credentials and
00109             // the user has set up Windows Hello with a PIN on the device.
00110             if (await KeyCredentialManager.IsSupportedAsync())
00111             {
00112                 // Navigate to Enable Hello Page, passing the account ID (username) as a parameter
00113                 string accountID = UserNameTextBox.Text;
00114                 Frame.Navigate(typeof(EnableHelloPage), accountID);
00115             }
00116             else
00117             {
00118                 // Windows Hello is not available, so go directly to the signed-in state.
00119                 // For the purpose of this sample, we will display a message to indicate
00120                 // that this code path has been reached.
00121                 MessageDialog message = new MessageDialog("Sample note: Since Windows Hello is not set up, we will go directly to the signed-in state.");
00122                 await message.ShowAsync();
00123                 Frame.Navigate(typeof(AccountOverviewPage));
00124             }
00125         }
00126
00127         private async Task<bool> SignInWithHelloAsync()
00128         {
00129             // Open the existing user key credential.
00130             KeyCredentialRetrievalResult retrieveResult = await KeyCredentialManager.OpenAsync(userId);
00131
00132             if (retrieveResult.Status != KeyCredentialStatus.Success)
00133             {
00134                 return false;
00135             }
00136
00137             KeyCredential userCredential = retrieveResult.Credential;
00138
00139             // Request a challenge from the server.
00140             JsonValue jsonChallenge = await JsonRequest.Create()
00141                 .AddString("userId", userId)
00142                 .AddString("publicKeyHint", publicKeyHint)
00143                 .PostAsync("api/Authentication/RequestChallenge");
00144             if (jsonChallenge == null)
00145             {
00146                 return false;
00147             }
00148
00149             // Sign the challenge using the user's KeyCredential.
00150             IBuffer challengeBuffer = CryptographicBuffer.DecodeFromBase64String(jsonChallenge.GetString());
00151             KeyCredentialOperationResult opResult = await userCredential.RequestSignAsync(challengeBuffer);
00152
00153             if (opResult.Status != KeyCredentialStatus.Success)
00154             {
00155                 return false;
00156             }
00157
00158             // Get the signature.
00159             IBuffer signatureBuffer = opResult.Result;
00160
00161             // Send the signature back to the server to confirm our identity.
00162             // The publicKeyHint tells the server which public key to use to verify the signature.
00163             JsonValue jsonResult = await JsonRequest.Create()
00164                 .AddString("userId", userId)
00165                 .AddString("publicKeyHint", publicKeyHint)
00166                 .AddString("signature", CryptographicBuffer.EncodeToBase64String(signatureBuffer))
00167                 .PostAsync("api/Authentication/SubmitResponse");
00168             if (jsonResult == null)
00169             {
00170                 return false;
00171             }
00172
00173             return jsonResult.GetBoolean();
00174         }
00175
00176         private async void SignInWithHello()
00177         {
00178             ProgressRing.IsActive = true;
00179
00180             // Don't let the user try a new operation while we are busy with this one.
00181             SignInWithHelloButton.IsEnabled = false;
00182             SignInAsSomeoneElseButton.IsEnabled = false;
00183
00184             bool result = await SignInWithHelloAsync();
00185
00186             ProgressRing.IsActive = false;
00187             SignInWithHelloButton.IsEnabled = true;
00188             SignInAsSomeoneElseButton.IsEnabled = true;
00189
00190             if (result)
00191             {
00192                 Frame.Navigate(typeof(AccountOverviewPage));
00193             }
00194             else
00195             {
00196                 MessageDialog message = new MessageDialog("Login with Windows Hello failed.");
00197                 await message.ShowAsync();
00198             }
00199         }
00200     }
00201 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshMain.h Source File

  • D2DGradientMesh
  • cpp

D2DGradientMeshMain.h

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "DeviceResources.h"
00011 #include "D2DGradientMeshRenderer.h"
00012 #include "SampleOverlay.h"
00013
00014 // Renders Direct2D and 3D content on the screen.
00015 namespace D2DGradientMesh
00016 {
00017     class D2DGradientMeshMain : public DX::IDeviceNotify
00018     {
00019     public:
00020         D2DGradientMeshMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00021         ~D2DGradientMeshMain();
00022         void UpdateForWindowSizeChange();
00023         bool Render();
00024
00025         // IDeviceNotify
00026         virtual void OnDeviceLost();
00027         virtual void OnDeviceRestored();
00028
00029     private:
00030         // Cached pointer to device resources.
00031         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00032
00033         // Sample renderer class.
00034         std::unique_ptr<D2DGradientMeshRenderer> m_sceneRenderer;
00035
00036         // Sample overlay class.
00037         std::unique_ptr<SampleOverlay> m_sampleOverlay;
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Controls/PlayReadyInfo.xaml.cs Source File

  • PlayReady
  • cs
  • Controls

PlayReadyInfo.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 namespace SDKTemplate.Controls
00004 {
00005     public sealed partial class PlayReadyInfo : UserControl
00006     {
00007         public PlayReadyInfo()
00008         {
00009             this.InitializeComponent();
00010         }
00011     }
00012 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Controls/ProjectedMediaTransportControls.cs Source File

  • AdvancedCasting
  • cs
  • Controls

ProjectedMediaTransportControls.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Controls.Primitives;
00020 using Windows.UI.Xaml.Data;
00021 using Windows.UI.Xaml.Documents;
00022 using Windows.UI.Xaml.Input;
00023 using Windows.UI.Xaml.Media;
00024
00025 namespace ScreenCasting.Controls
00026 {
00027  public sealed class ProjectedMediaTransportControls : MediaTransportControls
00028     {
00029
00030         public ProjectedMediaTransportControls()
00031         {
00032             this.DefaultStyleKey = typeof(ProjectedMediaTransportControls);
00033         }
00034
00035         protected override void OnApplyTemplate()
00036         {
00037             base.OnApplyTemplate();
00038
00039             //Find the Swap Views button and subscribe to the clicked event.
00040             Button swapViewsButton = GetTemplateChild("SwapViewsButton") as Button;
00041             swapViewsButton.Click += SwapViewsButton_Click;
00042
00043             //Find the Stop Projecting button and subscribe to the clicked event.
00044             Button stopProjectingButton = GetTemplateChild("StopProjectingButton") as Button;
00045             stopProjectingButton.Click += StopProjectingButton_Click;
00046
00047             this.IsCompact = true;
00048         }
00049
00050         public event EventHandler StopProjectingButtonClick;
00051         public event EventHandler SwapViewsButtonClick;
00052
00053         private void StopProjectingButton_Click (object sender, RoutedEventArgs e)
00054         {
00055             if (StopProjectingButtonClick != null)
00056                 StopProjectingButtonClick(this, EventArgs.Empty);
00057         }
00058
00059         private void SwapViewsButton_Click(object sender, RoutedEventArgs e)
00060         {
00061             if (SwapViewsButtonClick != null)
00062                 SwapViewsButtonClick(this, EventArgs.Empty);
00063         }
00064     }
00065 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ApduCommand Member List

This is the complete list of members for ApduCommand, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoadStateEventArgs Member List

This is the complete list of members for LoadStateEventArgs, including all inherited members.
LoadStateEventArgs(Object navigationParameter, Dictionary< string, Object > pageState) | LoadStateEventArgs | [inline]
NavigationParameter | LoadStateEventArgs |
PageState | LoadStateEventArgs |
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/SampleConfiguration.cpp Source File

  • Gyrometer
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" },
00022     { "Cross-Platform Porting", "SDKTemplate.Scenario3_Porting" }
00023 };
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/HotspotAuthenticationTask/Properties/AssemblyInfo.cs Source File

  • HotspotAuthentication
  • cs
  • HotspotAuthenticationTask
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Hotspot Authentication CS sample")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("")]
00013 [assembly: AssemblyCopyright("")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.cpp Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

DecodeEngine.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "DecodeEngine.h"
00013
00014 using namespace concurrency;
00015 using namespace Platform;
00016 using namespace Platform::Collections;
00017 using namespace Windows::Devices::PointOfService;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Graphics::Imaging;
00020 using namespace Windows::Media::Ocr;
00021 using namespace Windows::Storage;
00022
00023 namespace BarcodeDecoder
00024 {
00025     DecodeEngine::DecodeEngine()
00026     {
00027         // Create OCR engine from the language set in scenario 1 configuration
00028         auto localSettings = ApplicationData::Current->LocalSettings;
00029         auto decoderLanguageKey = ref new String(L"decoderLanguage");
00030         if (localSettings->Values->HasKey(decoderLanguageKey))
00031         {
00032             String^ languageName = safe_cast<String^>(localSettings->Values->Lookup(decoderLanguageKey));
00033             for (Language^ lang : OcrEngine::AvailableRecognizerLanguages)
00034             {
00035                 if (lang->DisplayName == languageName)
00036                 {
00037                     m_ocrEngine = OcrEngine::TryCreateFromLanguage(lang);
00038                     break;
00039                 }
00040             }
00041         }
00042
00043         if (m_ocrEngine == nullptr)
00044         {
00045             m_ocrEngine = OcrEngine::TryCreateFromUserProfileLanguages();
00046         }
00047
00048         SupportedSymbologies = ref new Platform::Collections::Vector<UINT>();
00049         SupportedSymbologies->Append(BarcodeSymbologies::OcrA);
00050
00051         ActiveSymbologies = ref new Platform::Collections::Vector<UINT>();
00052         ActiveSymbologies->Append(BarcodeSymbologies::OcrA);
00053     }
00054
00055     task<DecodeResult^> DecodeEngine::DecodeAsync(SoftwareBitmap^ bitmap)
00056     {
00057         // The only thing we decode is OCR.
00058         uint32 index;
00059         if (!ActiveSymbologies->IndexOf(BarcodeSymbologies::OcrA, &index))
00060         {
00061             return task_from_result<DecodeResult^>(nullptr);
00062         }
00063
00064         return create_task(m_ocrEngine->RecognizeAsync(bitmap)).then([this, bitmap](OcrResult^ ocrResult) -> DecodeResult^
00065         {
00066             // Get the text in the first non-empty line as result
00067             for (auto line : ocrResult->Lines)
00068             {
00069                 if (!line->Text->IsEmpty())
00070                 {
00071                     auto result = ref new DecodeResult();
00072                     result->Symbology = BarcodeSymbologies::OcrA;
00073                     result->Text = line->Text;
00074                     return result;
00075                 }
00076             }
00077             return nullptr;
00078         });
00079     }
00080 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/Scenario1_DataEvents.xaml.cs Source File

  • RelativeInclinometer
  • cs

Scenario1_DataEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.Sensors;
00018 using Windows.Foundation;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Core;
00021
00022 namespace RelativeInclinometerCS
00023 {
00024     public sealed partial class Scenario1_DataEvents : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private Inclinometer Sensor;
00031         private uint DesiredReportInterval;
00032
00033         public Scenario1_DataEvents()
00034         {
00035             this.InitializeComponent();
00036
00037             Sensor = Inclinometer.GetDefaultForRelativeReadings();
00038             if (Sensor != null)
00039             {
00040                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00041                 // This value will be used later to activate the sensor.
00042                 uint minReportInterval = Sensor.MinimumReportInterval;
00043                 DesiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00044             }
00045             else
00046             {
00047                 rootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
00048             }
00049         }
00050
00051         /// <summary>
00052         /// Invoked when this page is about to be displayed in a Frame.
00053         /// </summary>
00054         /// <param name="e">Event data that describes how this page was reached. The Parameter
00055         /// property is typically used to configure the page.</param>
00056         protected override void OnNavigatedTo(NavigationEventArgs e)
00057         {
00058             ScenarioEnableButton.IsEnabled = true;
00059             ScenarioDisableButton.IsEnabled = false;
00060         }
00061
00062         /// <summary>
00063         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00064         /// </summary>
00065         /// <param name="e">
00066         /// Event data that can be examined by overriding code. The event data is representative
00067         /// of the navigation that will unload the current Page unless canceled. The
00068         /// navigation can potentially be canceled by setting Cancel.
00069         /// </param>
00070         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00071         {
00072             if (ScenarioDisableButton.IsEnabled)
00073             {
00074                 Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00075                 Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
00076
00077                 // Restore the default report interval to release resources while the sensor is not in use
00078                 Sensor.ReportInterval = 0;
00079             }
00080
00081             base.OnNavigatingFrom(e);
00082         }
00083
00084         /// <summary>
00085         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00086         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00087         /// </summary>
00088         /// <param name="sender"></param>
00089         /// <param name="e">
00090         /// Event data that can be examined for the current visibility state.
00091         /// </param>
00092         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00093         {
00094             if (ScenarioDisableButton.IsEnabled)
00095             {
00096                 if (e.Visible)
00097                 {
00098                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00099                     Sensor.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
00100                 }
00101                 else
00102                 {
00103                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00104                     Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
00105                 }
00106             }
00107         }
00108
00109         /// <summary>
00110         /// This is the event handler for ReadingChanged events.
00111         /// </summary>
00112         /// <param name="sender"></param>
00113         /// <param name="e"></param>
00114         async private void ReadingChanged(object sender, InclinometerReadingChangedEventArgs e)
00115         {
00116             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00117             {
00118                 InclinometerReading reading = e.Reading;
00119                 ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.PitchDegrees);
00120                 ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.RollDegrees);
00121                 ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.YawDegrees);
00122             });
00123         }
00124
00125         /// <summary>
00126         /// This is the click handler for the 'Enable' button.
00127         /// </summary>
00128         /// <param name="sender"></param>
00129         /// <param name="e"></param>
00130         private void ScenarioEnable(object sender, RoutedEventArgs e)
00131         {
00132             if (Sensor != null)
00133             {
00134                 // Establish the report interval
00135                 Sensor.ReportInterval = DesiredReportInterval;
00136
00137                 Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
00138                 Sensor.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
00139
00140                 ScenarioEnableButton.IsEnabled = false;
00141                 ScenarioDisableButton.IsEnabled = true;
00142             }
00143             else
00144             {
00145                 rootPage.NotifyUser("No relative inclinometer found", NotifyType.ErrorMessage);
00146             }
00147         }
00148
00149         /// <summary>
00150         /// This is the click handler for the 'Disable' button.
00151         /// </summary>
00152         /// <param name="sender"></param>
00153         /// <param name="e"></param>
00154         private void ScenarioDisable(object sender, RoutedEventArgs e)
00155         {
00156             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00157             Sensor.ReadingChanged -= new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(ReadingChanged);
00158
00159             // Restore the default report interval to release resources while the sensor is not in use
00160             Sensor.ReportInterval = 0;
00161
00162             ScenarioEnableButton.IsEnabled = true;
00163             ScenarioDisableButton.IsEnabled = false;
00164         }
00165     }
00166 }
Generated on Fri Nov 15 2024 22:17:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/CustomTitleBar.cpp Source File

  • TitleBar
  • cppwinrt

CustomTitleBar.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "CustomTitleBar.h"
00003 #include "CustomTitleBar.g.cpp"
00004
00005 using namespace winrt;
00006 using namespace Windows::ApplicationModel::Core;
00007 using namespace Windows::UI::ViewManagement;
00008 using namespace Windows::UI::Xaml;
00009 using namespace Windows::UI::Xaml::Controls;
00010 using namespace Windows::UI::Xaml::Data;
00011
00012 namespace winrt::SDKTemplate::implementation
00013 {
00014     CustomTitleBar::CustomTitleBar()
00015     {
00016         InitializeComponent();
00017     }
00018
00019     // The SystemOverlayLeftInset and SystemOverlayRightInset values are
00020     // in terms of physical left and right. Our OverlayLogicalLeftInset and
00021     // OverlayLogicalRightInset properties flip the values if the flow direction
00022     // is RTL.
00023     Thickness CustomTitleBar::CoreTitleBarPadding()
00024     {
00025         // The SystemOverlayLeftInset and SystemOverlayRightInset values are
00026         // in terms of physical left and right. Therefore, we need to flip
00027         // then when our flow direction is RTL.
00028         if (FlowDirection() == FlowDirection::LeftToRight)
00029         {
00030             return ThicknessHelper::FromLengths(coreTitleBar.SystemOverlayLeftInset(), 0, coreTitleBar.SystemOverlayRightInset(), 0);
00031         }
00032         else
00033         {
00034             return Windows::UI::Xaml::ThicknessHelper::FromLengths(coreTitleBar.SystemOverlayRightInset(), 0, coreTitleBar.SystemOverlayLeftInset(), 0);
00035         }
00036     }
00037
00038     void CustomTitleBar::CustomTitleBar_Loaded(IInspectable const&, RoutedEventArgs const&)
00039     {
00040         layoutMetricsChangedToken = coreTitleBar.LayoutMetricsChanged([this](auto&&, auto&&) { UpdateLayoutMetrics(); });
00041         isVisibleChangedToken = coreTitleBar.IsVisibleChanged([this](auto&&, auto&&) { UpdatePositionAndVisibility(); });
00042
00043         // The SizeChanged event is raised when the view enters or exits full screen mode.
00044         windowSizeChangedToken = Window::Current().SizeChanged([this](auto&&, auto&&) { UpdatePositionAndVisibility(); });
00045
00046         UpdateLayoutMetrics();
00047         UpdatePositionAndVisibility();
00048     }
00049
00050     void CustomTitleBar::CustomTitleBar_Unloaded(IInspectable const&, RoutedEventArgs const&)
00051     {
00052         coreTitleBar.LayoutMetricsChanged(layoutMetricsChangedToken);
00053         coreTitleBar.IsVisibleChanged(isVisibleChangedToken);
00054         Window::Current().SizeChanged(windowSizeChangedToken);
00055     }
00056
00057     void CustomTitleBar::UpdateLayoutMetrics()
00058     {
00059         propertyChanged(*this, PropertyChangedEventArgs(L"CoreTitleBarHeight"));
00060         propertyChanged(*this, PropertyChangedEventArgs(L"CoreTitleBarPadding"));
00061     }
00062
00063     // We wrap the normal contents of the MainPage inside a grid
00064     // so that we can place a title bar on top of it.
00065     //
00066     // When not in full screen mode, the grid looks like this:
00067     //
00068     //      Row 0: Custom-rendered title bar
00069     //      Row 1: Rest of content
00070     //
00071     // In full screen mode, the the grid looks like this:
00072     //
00073     //      Row 0: (empty)
00074     //      Row 1: Custom-rendered title bar
00075     //      Row 1: Rest of content
00076     //
00077     // The title bar is either Visible or Collapsed, depending on the value of
00078     // the IsVisible property.
00079     void CustomTitleBar::UpdatePositionAndVisibility()
00080     {
00081         if (ApplicationView::GetForCurrentView().IsFullScreenMode())
00082         {
00083             // In full screen mode, the title bar overlays the content.
00084             // and might or might not be visible.
00085             TitleBar().Visibility(coreTitleBar.IsVisible() ? Visibility::Visible : Visibility::Collapsed);
00086             Grid::SetRow(TitleBar(), 1);
00087         }
00088         else
00089         {
00090             // When not in full screen mode, the title bar is visible and does not overlay content.
00091             TitleBar().Visibility(Visibility::Visible);
00092             Grid::SetRow(TitleBar(), 0);
00093         }
00094     }
00095
00096     UIElement CustomTitleBar::SetPageContent(UIElement const& newContent)
00097     {
00098         UIElement oldContent = pageContent;
00099         if (oldContent != nullptr)
00100         {
00101             pageContent = nullptr;
00102             RootGrid().Children().RemoveAtEnd();
00103         }
00104         pageContent = newContent;
00105         if (newContent != nullptr)
00106         {
00107             RootGrid().Children().Append(newContent);
00108             // The page content is row 1 in our grid. (See diagram above.)
00109             Grid::SetRow(pageContent.as<FrameworkElement>(), 1);
00110         }
00111         return oldContent;
00112     }
00113
00114     void CustomTitleBar::EnableControlsInTitleBar(bool enable)
00115     {
00116         if (enable)
00117         {
00118             TitleBarControl().Visibility(Visibility::Visible);
00119             // Any clicks on the BackgroundElement will be treated as clicks on the title bar.
00120             Window::Current().SetTitleBar(BackgroundElement());
00121         }
00122         else
00123         {
00124             TitleBarControl().Visibility(Visibility::Collapsed);
00125             Window::Current().SetTitleBar(nullptr);
00126         }
00127     }
00128 }
Generated on Fri Nov 15 2024 22:21:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Launch Member List

This is the complete list of members for Scenario1_Launch, including all inherited members.
Scenario1_Launch() Scenario1_Launch [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cs/Scenario1_DeviceUse.xaml.cs Source File

  • BackgroundSensors
  • cs

Scenario1_DeviceUse.xaml.cs

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Threading.Tasks;
00005 using Windows.ApplicationModel.Background;
00006 using Windows.Devices.Sensors;
00007 using Windows.Foundation;
00008 using Windows.Storage;
00009 using Windows.UI.Core;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Navigation;
00013
00014 namespace SDKTemplate
00015 {
00016     /// <summary>
00017     /// An empty page that can be used on its own or navigated to within a Frame.
00018     /// </summary>
00019     public sealed partial class Scenario1_DeviceUse : Page
00020     {
00021         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00022         // as NotifyUser()
00023         private MainPage rootPage = MainPage.Current;
00024
00025         private Accelerometer Accelerometer;
00026         private DeviceUseTrigger _deviceUseTrigger;
00027
00028         // Used to register the device use background task
00029         private BackgroundTaskRegistration _deviceUseBackgroundTaskRegistration;
00030
00031         // Used for refreshing the number of samples received when the app is visible
00032         private DispatcherTimer _refreshTimer;
00033
00034         public Scenario1_DeviceUse()
00035         {
00036             this.InitializeComponent();
00037
00038             Accelerometer = Accelerometer.GetDefault();
00039             if (null != Accelerometer)
00040             {
00041                 // Save trigger so that we may start the background task later.
00042                 // Only one instance of the trigger can exist at a time. Since the trigger does not implement
00043                 // IDisposable, it may still be in memory when a new trigger is created.
00044                 _deviceUseTrigger = new DeviceUseTrigger();
00045
00046                 // Setup a timer to periodically refresh results when the app is visible.
00047                 _refreshTimer = new DispatcherTimer()
00048                 {
00049                     Interval = new TimeSpan(0, 0, 1) // Refresh once every second
00050                 };
00051                 _refreshTimer.Tick += RefreshTimer_Tick;
00052             }
00053             else
00054             {
00055                 rootPage.NotifyUser("No accelerometer found", NotifyType.StatusMessage);
00056             }
00057         }
00058
00059         /// <summary>
00060         /// Invoked when this page is about to be displayed in a Frame.
00061         /// </summary>
00062         /// <param name="e">Event data that describes how this page was reached. The Parameter
00063         /// property is typically used to configure the page.</param>
00064         protected override void OnNavigatedTo(NavigationEventArgs e)
00065         {
00066             // If the background task is active, start the refresh timer and activate the "Disable" button.
00067             // The "IsBackgroundTaskActive" state is set by the background task.
00068             bool isBackgroundTaskActive =
00069                 ApplicationData.Current.LocalSettings.Values.ContainsKey("IsBackgroundTaskActive") &&
00070                 (bool)ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"];
00071
00072             ScenarioEnableButton.IsEnabled = !isBackgroundTaskActive;
00073             ScenarioDisableButton.IsEnabled = isBackgroundTaskActive;
00074             if (isBackgroundTaskActive)
00075             {
00076                 _refreshTimer.Start();
00077             }
00078
00079             // Store a setting for the background task to read
00080             ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = true;
00081         }
00082
00083         /// <summary>
00084         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00085         /// </summary>
00086         /// <param name="e">
00087         /// Event data that can be examined by overriding code. The event data is representative
00088         /// of the navigation that will unload the current Page unless canceled. The
00089         /// navigation can potentially be canceled by setting Cancel.
00090         /// </param>
00091         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00092         {
00093             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00094             ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = false;
00095
00096             // The default behavior here is to let the background task continue to run when
00097             // this scenario exits. The background task can be canceled by clicking on the "Disable"
00098             // button the next time the app is navigated to.
00099             // To cancel the background task on scenario exit, uncomment this code.
00100             // if (null != _deviceUseBackgroundTaskRegistration)
00101             // {
00102             //    _deviceUseBackgroundTaskRegistration.Unregister(true);
00103             //    _deviceUseBackgroundTaskRegistration = null;
00104             // }
00105
00106             base.OnNavigatingFrom(e);
00107         }
00108
00109
00110         /// <summary>
00111         /// This is the event handler for VisibilityChanged events.
00112         /// </summary>
00113         /// <param name="sender"></param>
00114         /// <param name="e">
00115         /// Event data that can be examined for the current visibility state.
00116         /// </param>
00117         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00118         {
00119             if (ScenarioDisableButton.IsEnabled)
00120             {
00121                 ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = e.Visible;
00122
00123                 if (e.Visible)
00124                 {
00125                     _refreshTimer.Start();
00126                 }
00127                 else
00128                 {
00129                     _refreshTimer.Stop();
00130                 }
00131             }
00132         }
00133
00134         /// <summary>
00135         /// This is the click handler for the 'Enable' button.
00136         /// </summary>
00137         /// <param name="sender"></param>
00138         /// <param name="e"></param>
00139         private async void ScenarioEnable(object sender, RoutedEventArgs e)
00140         {
00141             Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
00142
00143             if (null != Accelerometer)
00144             {
00145                 // Make sure this app is allowed to run background tasks.
00146                 // RequestAccessAsync must be called on the UI thread.
00147                 BackgroundAccessStatus accessStatus = await BackgroundExecutionManager.RequestAccessAsync();
00148
00149                 if ((BackgroundAccessStatus.AlwaysAllowed == accessStatus) ||
00150                     (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == accessStatus))
00151                 {
00152                     if (await StartSensorBackgroundTaskAsync(Accelerometer.DeviceId))
00153                     {
00154                         _refreshTimer.Start();
00155
00156                         ScenarioEnableButton.IsEnabled = false;
00157                         ScenarioDisableButton.IsEnabled = true;
00158                     }
00159                 }
00160                 else
00161                 {
00162                     rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
00163                 }
00164             }
00165             else
00166             {
00167                 rootPage.NotifyUser("No accelerometer found", NotifyType.StatusMessage);
00168             }
00169         }
00170
00171         /// <summary>
00172         /// This is the click handler for the 'Disable' button.
00173         /// </summary>
00174         /// <param name="sender"></param>
00175         /// <param name="e"></param>
00176         private void ScenarioDisable(object sender, RoutedEventArgs e)
00177         {
00178             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00179
00180             ScenarioEnableButton.IsEnabled = true;
00181             ScenarioDisableButton.IsEnabled = false;
00182
00183             _refreshTimer.Stop();
00184
00185             if (null != _deviceUseBackgroundTaskRegistration)
00186             {
00187                 // Cancel and unregister the background task from the current app session.
00188                 _deviceUseBackgroundTaskRegistration.Unregister(true);
00189                 _deviceUseBackgroundTaskRegistration = null;
00190             }
00191             else
00192             {
00193                 // Cancel and unregister the background task from the previous app session.
00194                 FindAndCancelExistingBackgroundTask();
00195             }
00196
00197             rootPage.NotifyUser("Background task was canceled", NotifyType.StatusMessage);
00198         }
00199
00200         /// <summary>
00201         /// Starts the sensor background task.
00202         /// </summary>
00203         /// <param name="deviceId">Device Id for the sensor to be used by the task.</param>
00204         /// <param name="e"></param>
00205         /// <returns>True if the task is started successfully.</returns>
00206         private async Task<bool> StartSensorBackgroundTaskAsync(String deviceId)
00207         {
00208             bool started = false;
00209
00210             // Make sure only 1 task is running.
00211             FindAndCancelExistingBackgroundTask();
00212
00213             // Register the background task.
00214             var backgroundTaskBuilder = new BackgroundTaskBuilder()
00215             {
00216                 Name = SampleConstants.Scenario1_DeviceUse_TaskName,
00217                 TaskEntryPoint = SampleConstants.Scenario1_DeviceUse_TaskEntryPoint
00218             };
00219
00220             backgroundTaskBuilder.SetTrigger(_deviceUseTrigger);
00221             _deviceUseBackgroundTaskRegistration = backgroundTaskBuilder.Register();
00222
00223             // Make sure we're notified when the task completes or if there is an update.
00224             _deviceUseBackgroundTaskRegistration.Completed += new BackgroundTaskCompletedEventHandler(OnBackgroundTaskCompleted);
00225
00226             try
00227             {
00228                 // Request a DeviceUse task to use the accelerometer.
00229                 DeviceTriggerResult deviceTriggerResult = await _deviceUseTrigger.RequestAsync(deviceId);
00230
00231                 switch (deviceTriggerResult)
00232                 {
00233                     case DeviceTriggerResult.Allowed:
00234                         rootPage.NotifyUser("Background task started", NotifyType.StatusMessage);
00235                         started = true;
00236                         break;
00237
00238                     case DeviceTriggerResult.LowBattery:
00239                         rootPage.NotifyUser("Insufficient battery to run the background task", NotifyType.ErrorMessage);
00240                         break;
00241
00242                     case DeviceTriggerResult.DeniedBySystem:
00243                         // The system can deny a task request if the system-wide DeviceUse task limit is reached.
00244                         rootPage.NotifyUser("The system has denied the background task request", NotifyType.ErrorMessage);
00245                         break;
00246
00247                     default:
00248                         rootPage.NotifyUser("Could not start the background task: " + deviceTriggerResult, NotifyType.ErrorMessage);
00249                         break;
00250                 }
00251             }
00252             catch (InvalidOperationException)
00253             {
00254                 // If toggling quickly between 'Disable' and 'Enable', the previous task
00255                 // could still be in the process of cleaning up.
00256                 rootPage.NotifyUser("A previous background task is still running, please wait for it to exit", NotifyType.ErrorMessage);
00257                 FindAndCancelExistingBackgroundTask();
00258             }
00259
00260             return started;
00261         }
00262
00263         /// <summary>
00264         /// Finds a previously registered background task for this scenario and cancels it (if present)
00265         /// </summary>
00266         private void FindAndCancelExistingBackgroundTask()
00267         {
00268             foreach (var backgroundTask in BackgroundTaskRegistration.AllTasks.Values)
00269             {
00270                 if (SampleConstants.Scenario1_DeviceUse_TaskName == backgroundTask.Name)
00271                 {
00272                     ((BackgroundTaskRegistration)backgroundTask).Unregister(true);
00273                     break;
00274                 }
00275             }
00276         }
00277
00278         /// <summary>
00279         /// This is the tick handler for the Refresh timer.
00280         /// </summary>
00281         /// <param name="sender"></param>
00282         /// <param name="e"></param>
00283         private void RefreshTimer_Tick(object sender, object e)
00284         {
00285             if (ApplicationData.Current.LocalSettings.Values.ContainsKey("SampleCount"))
00286             {
00287                 ulong sampleCount = (ulong)ApplicationData.Current.LocalSettings.Values["SampleCount"];
00288                 ScenarioOutput_SampleCount.Text = sampleCount.ToString(System.Globalization.CultureInfo.CurrentCulture);
00289             }
00290             else
00291             {
00292                 ScenarioOutput_SampleCount.Text = "No data";
00293             }
00294         }
00295
00296         /// <summary>
00297         /// This is the background task completion handler.
00298         /// </summary>
00299         /// <param name="sender"></param>
00300         /// <param name="e"></param>
00301         private async void OnBackgroundTaskCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
00302         {
00303             // Dispatch to the UI thread to display the output.
00304             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00305             {
00306                 // An exception may be thrown if an error occurs in the background task.
00307                 try
00308                 {
00309                     e.CheckResult();
00310                     if (ApplicationData.Current.LocalSettings.Values.ContainsKey("TaskCancelationReason"))
00311                     {
00312                         string cancelationReason = (string)ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"];
00313                         rootPage.NotifyUser("Background task was stopped, reason: " + cancelationReason, NotifyType.StatusMessage);
00314                     }
00315                 }
00316                 catch (Exception ex)
00317                 {
00318                     rootPage.NotifyUser("Exception in background task: " + ex.Message, NotifyType.ErrorMessage);
00319                 }
00320
00321                 _refreshTimer.Stop();
00322             });
00323
00324             // Unregister the background task and let the remaining task finish until completion.
00325             if (null != _deviceUseBackgroundTaskRegistration)
00326             {
00327                 _deviceUseBackgroundTaskRegistration.Unregister(false);
00328                 _deviceUseBackgroundTaskRegistration = null;
00329             }
00330         }
00331     }
00332 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario1_Download.xaml.cs Source File

  • BackgroundTransfer
  • cs
  • BackgroundTransfer

Scenario1_Download.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Globalization;
00015 using System.IO;
00016 using System.Threading;
00017 using System.Threading.Tasks;
00018 using Windows.Networking.BackgroundTransfer;
00019 using Windows.Storage;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023 using Windows.Web;
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// An empty page that can be used on its own or navigated to within a Frame.
00029     /// </summary>
00030     public sealed partial class Scenario1_Download : Page, IDisposable
00031     {
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         private MainPage rootPage = MainPage.Current;
00035
00036         private List<DownloadOperation> activeDownloads;
00037         private CancellationTokenSource cts;
00038
00039         public Scenario1_Download()
00040         {
00041             cts = new CancellationTokenSource();
00042
00043             this.InitializeComponent();
00044         }
00045
00046         public void Dispose()
00047         {
00048             if (cts != null)
00049             {
00050                 cts.Dispose();
00051                 cts = null;
00052             }
00053
00054             GC.SuppressFinalize(this);
00055         }
00056
00057         /// <summary>
00058         /// Invoked when this page is about to be displayed in a Frame.
00059         /// </summary>
00060         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00061         /// property is typically used to configure the page.</param>
00062         protected async override void OnNavigatedTo(NavigationEventArgs e)
00063         {
00064             // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
00065             // Typically this can be done in the App class by overriding OnLaunched() and checking for
00066             // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
00067             // We do it here in the sample to keep the sample code consolidated.
00068             await DiscoverActiveDownloadsAsync();
00069         }
00070
00071
00072         // Enumerate the downloads that were going on in the background while the app was closed.
00073         private async Task DiscoverActiveDownloadsAsync()
00074         {
00075             activeDownloads = new List<DownloadOperation>();
00076
00077             IReadOnlyList<DownloadOperation> downloads = null;
00078             try
00079             {
00080                 downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
00081             }
00082             catch (Exception ex)
00083             {
00084                 if (!IsExceptionHandled("Discovery error", ex))
00085                 {
00086                     throw;
00087                 }
00088                 return;
00089             }
00090
00091             Log("Loading background downloads: " + downloads.Count);
00092
00093             if (downloads.Count > 0)
00094             {
00095                 List<Task> tasks = new List<Task>();
00096                 foreach (DownloadOperation download in downloads)
00097                 {
00098                     Log(String.Format(CultureInfo.CurrentCulture,
00099                         "Discovered background download: {0}, Status: {1}", download.Guid,
00100                         download.Progress.Status));
00101
00102                     // Attach progress and completion handlers.
00103                     tasks.Add(HandleDownloadAsync(download, false));
00104                 }
00105
00106                 // Don't await HandleDownloadAsync() in the foreach loop since we would attach to the second
00107                 // download only when the first one completed; attach to the third download when the second one
00108                 // completes etc. We want to attach to all downloads immediately.
00109                 // If there are actions that need to be taken once downloads complete, await tasks here, outside
00110                 // the loop.
00111                 await Task.WhenAll(tasks);
00112             }
00113         }
00114
00115         private async void StartDownload(BackgroundTransferPriority priority)
00116         {
00117             // Validating the URI is required since it was received from an untrusted source (user input).
00118             // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
00119             // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
00120             // the "Private Networks (Client and Server)" capability.
00121             Uri source;
00122             if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out source))
00123             {
00124                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00125                 return;
00126             }
00127
00128             string destination = fileNameField.Text.Trim();
00129
00130             if (string.IsNullOrWhiteSpace(destination))
00131             {
00132                 rootPage.NotifyUser("A local file name is required.", NotifyType.ErrorMessage);
00133                 return;
00134             }
00135
00136             StorageFile destinationFile;
00137             try
00138             {
00139                 StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
00140                 destinationFile = await picturesLibrary.CreateFileAsync(
00141                     destination,
00142                     CreationCollisionOption.GenerateUniqueName);
00143             }
00144             catch (FileNotFoundException ex)
00145             {
00146                 rootPage.NotifyUser("Error while creating file: " + ex.Message, NotifyType.ErrorMessage);
00147                 return;
00148             }
00149
00150             BackgroundDownloader downloader = new BackgroundDownloader();
00151             DownloadOperation download = downloader.CreateDownload(source, destinationFile);
00152
00153             Log(String.Format(CultureInfo.CurrentCulture, "Downloading {0} to {1} with {2} priority, {3}",
00154                 source.AbsoluteUri, destinationFile.Name, priority, download.Guid));
00155
00156             download.Priority = priority;
00157
00158             // Attach progress and completion handlers.
00159             await HandleDownloadAsync(download, true);
00160         }
00161
00162         private void StartDownload_Click(object sender, RoutedEventArgs e)
00163         {
00164             StartDownload(BackgroundTransferPriority.Default);
00165         }
00166
00167         private void StartHighPriorityDownload_Click(object sender, RoutedEventArgs e)
00168         {
00169             StartDownload(BackgroundTransferPriority.High);
00170         }
00171
00172         private void PauseAll_Click(object sender, RoutedEventArgs e)
00173         {
00174             Log("Downloads: " + activeDownloads.Count);
00175
00176             foreach (DownloadOperation download in activeDownloads)
00177             {
00178                 // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00179                 // we must make a local copy so that we can have a consistent view of that ever-changing state
00180                 // throughout this method's lifetime.
00181                 BackgroundDownloadProgress currentProgress = download.Progress;
00182
00183                 if (currentProgress.Status == BackgroundTransferStatus.Running)
00184                 {
00185                     download.Pause();
00186                     Log("Paused: " + download.Guid);
00187                 }
00188                 else
00189                 {
00190                     Log(String.Format(CultureInfo.CurrentCulture, "Skipped: {0}, Status: {1}", download.Guid,
00191                         currentProgress.Status));
00192                 }
00193             }
00194         }
00195
00196         private void ResumeAll_Click(object sender, RoutedEventArgs e)
00197         {
00198             Log("Downloads: " + activeDownloads.Count);
00199
00200             foreach (DownloadOperation download in activeDownloads)
00201             {
00202                 // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00203                 // we must make a local copy so that we can have a consistent view of that ever-changing state
00204                 // throughout this method's lifetime.
00205                 BackgroundDownloadProgress currentProgress = download.Progress;
00206
00207                 if (currentProgress.Status == BackgroundTransferStatus.PausedByApplication)
00208                 {
00209                     download.Resume();
00210                     Log("Resumed: " + download.Guid);
00211                 }
00212                 else
00213                 {
00214                     Log(String.Format(CultureInfo.CurrentCulture, "Skipped: {0}, Status: {1}", download.Guid,
00215                         currentProgress.Status));
00216                 }
00217             }
00218         }
00219
00220         private void CancelAll_Click(object sender, RoutedEventArgs e)
00221         {
00222             Log("Canceling Downloads: " + activeDownloads.Count);
00223
00224             cts.Cancel();
00225             cts.Dispose();
00226
00227             // Re-create the CancellationTokenSource and activeDownloads for future downloads.
00228             cts = new CancellationTokenSource();
00229             activeDownloads = new List<DownloadOperation>();
00230         }
00231
00232         // Note that this event is invoked on a background thread, so we cannot access the UI directly.
00233         private void DownloadProgress(DownloadOperation download)
00234         {
00235             // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00236             // we must make a local copy so that we can have a consistent view of that ever-changing state
00237             // throughout this method's lifetime.
00238             BackgroundDownloadProgress currentProgress = download.Progress;
00239
00240             MarshalLog(String.Format(CultureInfo.CurrentCulture, "Progress: {0}, Status: {1}", download.Guid,
00241                 currentProgress.Status));
00242
00243             double percent = 100;
00244             if (currentProgress.TotalBytesToReceive > 0)
00245             {
00246                 percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
00247             }
00248
00249             MarshalLog(String.Format(
00250                 CultureInfo.CurrentCulture,
00251                 " - Transferred bytes: {0} of {1}, {2}%",
00252                 currentProgress.BytesReceived,
00253                 currentProgress.TotalBytesToReceive,
00254                 percent));
00255
00256             if (currentProgress.HasRestarted)
00257             {
00258                 MarshalLog(" - Download restarted");
00259             }
00260
00261             if (currentProgress.HasResponseChanged)
00262             {
00263                 // We have received new response headers from the server.
00264                 // Be aware that GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
00265                 ResponseInformation response = download.GetResponseInformation();
00266                 int headersCount = response != null ? response.Headers.Count : 0;
00267
00268                 MarshalLog(" - Response updated; Header count: " + headersCount);
00269
00270                 // If you want to stream the response data this is a good time to start.
00271                 // download.GetResultStreamAt(0);
00272             }
00273         }
00274
00275         private async Task HandleDownloadAsync(DownloadOperation download, bool start)
00276         {
00277             try
00278             {
00279                 LogStatus("Running: " + download.Guid, NotifyType.StatusMessage);
00280
00281                 // Store the download so we can pause/resume.
00282                 activeDownloads.Add(download);
00283
00284                 Progress<DownloadOperation> progressCallback = new Progress<DownloadOperation>(DownloadProgress);
00285                 if (start)
00286                 {
00287                     // Start the download and attach a progress handler.
00288                     await download.StartAsync().AsTask(cts.Token, progressCallback);
00289                 }
00290                 else
00291                 {
00292                     // The download was already running when the application started, re-attach the progress handler.
00293                     await download.AttachAsync().AsTask(cts.Token, progressCallback);
00294                 }
00295
00296                 ResponseInformation response = download.GetResponseInformation();
00297
00298                 // GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
00299                 string statusCode = response != null ? response.StatusCode.ToString() : String.Empty;
00300
00301                 LogStatus(
00302                     String.Format(
00303                         CultureInfo.CurrentCulture,
00304                         "Completed: {0}, Status Code: {1}",
00305                         download.Guid,
00306                         statusCode),
00307                     NotifyType.StatusMessage);
00308             }
00309             catch (TaskCanceledException)
00310             {
00311                 LogStatus("Canceled: " + download.Guid, NotifyType.StatusMessage);
00312             }
00313             catch (Exception ex)
00314             {
00315                 if (!IsExceptionHandled("Execution error", ex, download))
00316                 {
00317                     throw;
00318                 }
00319             }
00320             finally
00321             {
00322                 activeDownloads.Remove(download);
00323             }
00324         }
00325
00326         private bool IsExceptionHandled(string title, Exception ex, DownloadOperation download = null)
00327         {
00328             WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
00329             if (error == WebErrorStatus.Unknown)
00330             {
00331                 return false;
00332             }
00333
00334             if (download == null)
00335             {
00336                 LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0}: {1}", title, error),
00337                     NotifyType.ErrorMessage);
00338             }
00339             else
00340             {
00341                 LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0} - {1}: {2}", download.Guid, title,
00342                     error), NotifyType.ErrorMessage);
00343             }
00344
00345             return true;
00346         }
00347
00348         // When operations happen on a background thread we have to marshal UI updates back to the UI thread.
00349         private void MarshalLog(string value)
00350         {
00351             var ignore = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00352             {
00353                 Log(value);
00354             });
00355         }
00356
00357         private void Log(string message)
00358         {
00359             outputField.Text += message + "\r\n";
00360         }
00361
00362         private void LogStatus(string message, NotifyType type)
00363         {
00364             rootPage.NotifyUser(message, type);
00365             Log(message);
00366         }
00367     }
00368 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/ConnectionSettingsPanel.xaml.cs Source File

  • WiFiDirect
  • cs

ConnectionSettingsPanel.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using System.Threading.Tasks;
00007 using Windows.Devices.Enumeration;
00008 using Windows.Devices.WiFiDirect;
00009 using Windows.Foundation;
00010 using Windows.Foundation.Collections;
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Controls.Primitives;
00014 using Windows.UI.Xaml.Data;
00015 using Windows.UI.Xaml.Input;
00016 using Windows.UI.Xaml.Media;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class ConnectionSettingsPanel : UserControl
00024     {
00025         private MainPage rootPage = MainPage.Current;
00026
00027         List<WiFiDirectConfigurationMethod> _supportedConfigMethods = new List<WiFiDirectConfigurationMethod>();
00028
00029         public ConnectionSettingsPanel()
00030         {
00031             this.InitializeComponent();
00032
00033             // Initialize the GroupOwnerIntent combo box.
00034             // The options are "Default", then values 0 through 15.
00035             cmbGOIntent.Items.Add(new ComboBoxItem() { Content = "Default" });
00036             for (int i = 0; i <= 15; i++)
00037             {
00038                 cmbGOIntent.Items.Add(new ComboBoxItem() { Content = i.ToString(), Tag = (short)i });
00039             }
00040             cmbGOIntent.SelectedIndex = 0;
00041         }
00042
00043         public void Reset()
00044         {
00045             _supportedConfigMethods.Clear();
00046         }
00047
00048         private void btnAddConfigMethods_Click(object sender, RoutedEventArgs e)
00049         {
00050             // The configuration methods are added in the order of preference, most preferred first.
00051             // Save the values here so we can apply them in RequestPairDeviceAsync.
00052             // In practice, most apps will have a hard-coded preference list.
00053             WiFiDirectConfigurationMethod method = Utils.GetSelectedItemTag<WiFiDirectConfigurationMethod>(cmbSupportedConfigMethods);
00054             _supportedConfigMethods.Add(method);
00055             rootPage.NotifyUser($"Added configuration method {method}", NotifyType.StatusMessage);
00056         }
00057
00058         public async Task<bool> RequestPairDeviceAsync(DeviceInformationPairing pairing)
00059         {
00060             WiFiDirectConnectionParameters connectionParams = new WiFiDirectConnectionParameters();
00061
00062             short? groupOwnerIntent = Utils.GetSelectedItemTag<short?>(cmbGOIntent);
00063             if (groupOwnerIntent.HasValue)
00064             {
00065                 connectionParams.GroupOwnerIntent = groupOwnerIntent.Value;
00066             }
00067
00068             DevicePairingKinds devicePairingKinds = DevicePairingKinds.None;
00069
00070             // If specific configuration methods were added, then use them.
00071             if (_supportedConfigMethods.Count > 0)
00072             {
00073                 foreach (var configMethod in _supportedConfigMethods)
00074                 {
00075                     connectionParams.PreferenceOrderedConfigurationMethods.Add(configMethod);
00076                     devicePairingKinds |= WiFiDirectConnectionParameters.GetDevicePairingKinds(configMethod);
00077                 }
00078             }
00079             else
00080             {
00081                 // If specific configuration methods were not added, then we'll use these pairing kinds.
00082                 devicePairingKinds = DevicePairingKinds.ConfirmOnly | DevicePairingKinds.DisplayPin | DevicePairingKinds.ProvidePin;
00083             }
00084
00085             connectionParams.PreferredPairingProcedure = Utils.GetSelectedItemTag<WiFiDirectPairingProcedure>(cmbPreferredPairingProcedure);
00086             DeviceInformationCustomPairing customPairing = pairing.Custom;
00087             customPairing.PairingRequested += OnPairingRequested;
00088
00089             DevicePairingResult result = await customPairing.PairAsync(devicePairingKinds, DevicePairingProtectionLevel.Default, connectionParams);
00090             if (result.Status != DevicePairingResultStatus.Paired)
00091             {
00092                 rootPage.NotifyUser($"PairAsync failed, Status: {result.Status}", NotifyType.ErrorMessage);
00093                 return false;
00094             }
00095             return true;
00096         }
00097
00098         private void OnPairingRequested(DeviceInformationCustomPairing sender, DevicePairingRequestedEventArgs args)
00099         {
00100             Utils.HandlePairing(Dispatcher, args);
00101         }
00102     }
00103 }
Generated on Fri Nov 15 2024 22:22:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileSavePickerPage Member List

This is the complete list of members for FileSavePickerPage, including all inherited members.
Activate(FileSavePickerActivatedEventArgs args) | FileSavePickerPage | [inline, private]
Current | FileSavePickerPage | [static]
FEATURE_NAME | FileSavePickerPage |
FileSavePickerPage() | FileSavePickerPage | [inline]
FileSavePickerPage_SizeChanged(object sender, SizeChangedEventArgs e) | FileSavePickerPage | [inline, private]
FileSavePickerPageResized | FileSavePickerPage |
fileSavePickerUI | FileSavePickerPage | [private]
Footer_Click(object sender, RoutedEventArgs e) | FileSavePickerPage | [inline, private]
HiddenFrame | FileSavePickerPage | [private]
InvalidateLayout() | FileSavePickerPage | [inline, private]
InvalidateSize() | FileSavePickerPage | [inline, private]
LaunchArgs | FileSavePickerPage |
LoadScenario(Type scenarioClass) | FileSavePickerPage | [inline]
NotifyUser(string strMessage, NotifyType type) | FileSavePickerPage | [inline]
OnNavigatedTo(NavigationEventArgs e) | FileSavePickerPage | [inline, protected]
PopulateScenarios() | FileSavePickerPage | [inline, private]
ScenarioLoaded | FileSavePickerPage |
scenarios | FileSavePickerPage | [private]
Scenarios_SelectionChanged(object sender, SelectionChangedEventArgs e) | FileSavePickerPage | [inline, private]
SetFeatureName(string str) | FileSavePickerPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/SampleConfiguration.cs Source File

  • DpiScaling
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "DPI scaling";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Load images for different scales",         ClassType = typeof(Scenario1) },
00025             new Scenario() { Title = "Override default scaling of UI elements",  ClassType = typeof(Scenario2) },
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario4_Bytes.xaml.h Source File

  • FileAccess
  • cpp

Scenario4_Bytes.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario4_Bytes.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Writing and reading bytes in a file.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario4 sealed
00025     {
00026     public:
00027         Scenario4();
00028         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032
00033         void WriteBytesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void ReadBytesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035     };
00036 }
Generated on Fri Nov 15 2024 22:19:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_SecureStop Member List

This is the complete list of members for Scenario4_SecureStop, including all inherited members.
Scenario4_SecureStop() Scenario4_SecureStop [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • BackgroundTransfer
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Tasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("Microsoft Corporation")]
00012 [assembly: AssemblyProduct("SDKTemplate")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionTexture Member List

This is the complete list of members for VertexPositionTexture, including all inherited members.
position | VertexPositionTexture
textureCoordinate | VertexPositionTexture
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Notifications Member List

This is the complete list of members for Scenario2_Notifications, including all inherited members.
ClearBadge_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
ClearTile_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
rootPage | Scenario2_Notifications | [private]
Scenario2_Notifications() | Scenario2_Notifications | [inline]
SendBadge_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
SendBadgeWithStringManipulation_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
SendTile_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
SendTileWithStringManipulation_Click(object sender, RoutedEventArgs e) | Scenario2_Notifications | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/SampleConfiguration.h Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015
00016 namespace SDKTemplate
00017 {
00018     value struct Scenario;
00019
00020     partial ref class MainPage
00021     {
00022     internal:
00023         static property Platform::String^ FEATURE_NAME
00024         {
00025             Platform::String^ get()
00026             {
00027                 return "Barcode Scanner Provider C++";
00028             }
00029         }
00030
00031         static property Platform::Array<Scenario>^ scenarios
00032         {
00033             Platform::Array<Scenario>^ get()
00034             {
00035                 return scenariosInner;
00036             }
00037         }
00038
00039     private:
00040         static Platform::Array<Scenario>^ scenariosInner;
00041     };
00042
00043     public value struct Scenario
00044     {
00045         Platform::String^ Title;
00046         Platform::String^ ClassName;
00047     };
00048
00049     namespace DeviceHelpers
00050     {
00051         // By default, use all connections types.
00052         Concurrency::task<Windows::Devices::PointOfService::BarcodeScanner^> GetFirstBarcodeScannerAsync(
00053             Windows::Devices::PointOfService::PosConnectionTypes connectionTypes = Windows::Devices::PointOfService::PosConnectionTypes::All);
00054     }
00055
00056     [Windows::UI::Xaml::Data::Bindable]
00057     public ref class BindingHelpers sealed
00058     {
00059     public:
00060         // Inverters for binding.
00061         static bool Not(bool value)
00062         {
00063             return !value;
00064         }
00065
00066         static Windows::UI::Xaml::Visibility CollapsedIf(bool value)
00067         {
00068             return value ? Windows::UI::Xaml::Visibility::Collapsed : Windows::UI::Xaml::Visibility::Visible;
00069         }
00070     };
00071
00072     // Creates a completed Concurrency::task<void> that is based on an IAsyncAction,
00073     // so that it can be used easily from UI threads.
00074     inline Concurrency::task<void> completed_ui_task()
00075     {
00076         return Concurrency::create_task(concurrency::create_async([] {}));
00077     }
00078
00079     [Windows::UI::Xaml::Data::Bindable]
00080     public ref class BarcodeScannerInfo sealed
00081     {
00082     public:
00083         property Platform::String^ Name
00084         {
00085             Platform::String^ get()
00086             {
00087                 return deviceName + L" (" + deviceId + L")";
00088             }
00089         }
00090
00091         property Platform::String^ DeviceId
00092         {
00093             Platform::String^ get()
00094             {
00095                 return deviceId;
00096             }
00097         }
00098
00099         BarcodeScannerInfo(Platform::String^ deviceName, Platform::String^ deviceId)
00100         {
00101             this->deviceName = deviceName;
00102             this->deviceId = deviceId;
00103         }
00104     private:
00105         Platform::String^ deviceName;
00106         Platform::String^ deviceId;
00107     };
00108
00109     /// <summary>
00110     /// The class is used for data-binding.
00111     /// </summary>
00112     [Windows::UI::Xaml::Data::Bindable]
00113     public ref class SymbologyListEntry sealed
00114     {
00115     public:
00116         SymbologyListEntry(UINT symbologyId) : SymbologyListEntry(symbologyId, true) { }
00117
00118         SymbologyListEntry(UINT symbologyId, bool symbologyEnabled)
00119         {
00120             id = symbologyId;
00121             enabled = symbologyEnabled;
00122         }
00123
00124         property uint32_t Id
00125         {
00126             uint32_t get()
00127             {
00128                 return id;
00129             }
00130         }
00131
00132         property bool IsEnabled
00133         {
00134             bool get()
00135             {
00136                 return enabled;
00137             }
00138             void set(bool value)
00139             {
00140                 enabled = value;
00141             }
00142         }
00143
00144         property Platform::String^ Name
00145         {
00146             Platform::String^ get()
00147             {
00148                 return Windows::Devices::PointOfService::BarcodeSymbologies::GetName(id);
00149             }
00150         }
00151
00152     private:
00153         uint32_t id;
00154         bool enabled;
00155     };
00156
00157 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

BasicReaderWriter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 // A simple reader/writer class that provides support for reading and writing
00017 // files on disk. Provides synchronous and asynchronous methods.
00018 ref class BasicReaderWriter
00019 {
00020 private:
00021     Windows::Storage::StorageFolder^ m_location;
00022
00023 internal:
00024     BasicReaderWriter();
00025     BasicReaderWriter(
00026         _In_ Windows::Storage::StorageFolder^ folder
00027         );
00028
00029     Platform::Array<byte>^ ReadData(
00030         _In_ Platform::String^ filename
00031         );
00032
00033     concurrency::task<Platform::Array<byte>^> ReadDataAsync(
00034         _In_ Platform::String^ filename
00035         );
00036
00037     uint32 WriteData(
00038         _In_ Platform::String^ filename,
00039         _In_ const Platform::Array<byte>^ fileData
00040         );
00041
00042     concurrency::task<void> WriteDataAsync(
00043         _In_ Platform::String^ filename,
00044         _In_ const Platform::Array<byte>^ fileData
00045         );
00046 };
Generated on Fri Nov 15 2024 22:19:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/Scenario2_oAuthFacebook.xaml.h Source File

  • WebAuthenticationBroker
  • cpp

Scenario2_oAuthFacebook.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "MainPage.xaml.h"
00006 #include "Scenario2_oAuthFacebook.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario2_oAuthFacebook sealed
00012     {
00013     public:
00014         Scenario2_oAuthFacebook();
00015     private:
00016         void Launch_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017     };
00018 }
Generated on Fri Nov 15 2024 22:21:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetHistoricalBytes Member List

This is the complete list of members for GetHistoricalBytes, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetHistoricalBytes() | GetHistoricalBytes | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DisablePreviewPrintHelper Member List

This is the complete list of members for DisablePreviewPrintHelper, including all inherited members.
AddOnePrintPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription) | DisablePreviewPrintHelper | [inline, protected]
AddOnePrintPreviewPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription) | PrintHelper | [inline, protected, virtual]
AddPrintPages(object sender, AddPagesEventArgs e) | DisablePreviewPrintHelper | [inline, protected, virtual]
ApplicationContentMarginLeft | PrintHelper | [protected]
ApplicationContentMarginTop | PrintHelper | [protected]
CreatePrintPreviewPages(object sender, PaginateEventArgs e) | PrintHelper | [inline, protected, virtual]
DisablePreviewPrintHelper(Page scenarioPage) | DisablePreviewPrintHelper | [inline]
firstPage | PrintHelper | [protected]
GetPrintPreviewPage(object sender, GetPreviewPageEventArgs e) | PrintHelper | [inline, protected, virtual]
PreparePrintContent(Page page) | PrintHelper | [inline, virtual]
PreviewPagesCreated | PrintHelper | [protected]
PrintCanvas | PrintHelper | [protected]
printDocument | PrintHelper | [protected]
printDocumentSource | PrintHelper | [protected]
PrintHelper(Page scenarioPage) | PrintHelper | [inline]
printPages | DisablePreviewPrintHelper | [private]
PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e) | DisablePreviewPrintHelper | [inline, protected, virtual]
RegisterForPrinting() | PrintHelper | [inline, virtual]
scenarioPage | PrintHelper | [protected]
ShowPrintUIAsync() | PrintHelper | [inline]
UnregisterForPrinting() | PrintHelper | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/pch.cpp Source File

  • XamlListView
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TitledImage Member List

This is the complete list of members for TitledImage, including all inherited members.
_header | TitledImage | [private]
Header | TitledImage |
HeaderChanged(DependencyObject sender, DependencyProperty prop) | TitledImage | [inline, private]
HeaderProperty | TitledImage | [static]
OnApplyTemplate() | TitledImage | [inline, protected]
Source | TitledImage |
SourceProperty | TitledImage | [static]
TitledImage() | TitledImage | [inline]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/pch.h Source File

  • LampDevice
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/SampleConfiguration.cpp Source File

  • Capabilities
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Capabilities C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Check capability and set display message", xaml_typename<SDKTemplate::Scenario1_Check>() },
00029     Scenario{ L"Request multiple capabilities", xaml_typename<SDKTemplate::Scenario2_RequestMany>() },
00030 });
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario5_GetSingleDevice.xaml.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario5_GetSingleDevice.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario5_GetSingleDevice.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Platform::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::UI::Xaml;
00013 using namespace Windows::UI::Xaml::Controls;
00014 using namespace Windows::UI::Xaml::Controls::Primitives;
00015 using namespace Windows::UI::Xaml::Data;
00016 using namespace Windows::UI::Xaml::Input;
00017 using namespace Windows::UI::Xaml::Media;
00018 using namespace Windows::UI::Xaml::Navigation;
00019 using namespace Windows::Devices::Enumeration;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 Scenario5_GetSingleDevice::Scenario5_GetSingleDevice()
00024 {
00025     InitializeComponent();
00026 }
00027
00028 void Scenario5_GetSingleDevice::OnNavigatedTo(NavigationEventArgs^ e)
00029 {
00030     resultsListView->ItemsSource = resultCollection;
00031 }
00032
00033 void Scenario5_GetSingleDevice::Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00034 {
00035     concurrency::create_task(DeviceInformation::FindAllAsync(DeviceClass::AudioRender)).then(
00036         [this](DeviceInformationCollection^ deviceInfoCollection)
00037     {
00038         if (deviceInfoCollection->Size > 0)
00039         {
00040             // When you want to "save" a DeviceInformation to get it back again later,
00041             // use both the DeviceInformation.Kind and the DeviceInformation.Id.
00042             interfaceIdTextBox->Text = deviceInfoCollection->GetAt(0)->Id;
00043             deviceInformationKind = deviceInfoCollection->GetAt(0)->Kind;
00044             InformationKindTextBox->Text = deviceInformationKind.ToString();
00045             getButton->IsEnabled = true;
00046         }
00047     }, concurrency::task_continuation_context::use_current());
00048 }
00049
00050 void Scenario5_GetSingleDevice::GetButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00051 {
00052     resultCollection->Clear();
00053
00054     String^ interfaceId = interfaceIdTextBox->Text;
00055     getButton->IsEnabled = false;
00056
00057     rootPage->NotifyUser("CreateFromIdAsync operation started...", NotifyType::StatusMessage);
00058
00059     // When you want to "save" a DeviceInformation to get it back again later,
00060     // use both the DeviceInformation.Kind and the DeviceInformation.Id.
00061     concurrency::create_task(DeviceInformation::CreateFromIdAsync(interfaceId, nullptr, deviceInformationKind)).then(
00062         [this](DeviceInformation^ deviceInfo)
00063     {
00064         rootPage->NotifyUser("CreateFromIdAsync operation completed.", NotifyType::StatusMessage);
00065
00066         resultCollection->Append(ref new DeviceInformationDisplay(deviceInfo));
00067     }).then([this](concurrency::task<void> precedingTask)
00068     {
00069         try
00070         {
00071             precedingTask.get();
00072         }
00073         catch (COMException^ ex)
00074         {
00075             if (ex->HResult == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00076             {
00077                 rootPage->NotifyUser("Invalid Interface Id", NotifyType::ErrorMessage);
00078             }
00079             else
00080             {
00081                 throw;
00082             }
00083         }
00084         getButton->IsEnabled = true;
00085         getButton->Focus(Windows::UI::Xaml::FocusState::Keyboard);
00086     });
00087 }
Generated on Fri Nov 15 2024 22:19:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
castButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) | Scenario2 | [inline, private]
Connection_StateChanged(CastingConnection sender, object args) | Scenario2 | [inline, private]
loadButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
picker | Scenario2 | [private]
Picker_CastingDeviceSelected(CastingDevicePicker sender, CastingDeviceSelectedEventArgs args) | Scenario2 | [inline, private]
rootPage | Scenario2 | [private]
Scenario2() | Scenario2 | [inline]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage::AdvancedCaptureContext Member List

This is the complete list of members for MainPage::AdvancedCaptureContext, including all inherited members.
CaptureFileName | MainPage::AdvancedCaptureContext
CaptureOrientation | MainPage::AdvancedCaptureContext
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DefaultAccountScenario Member List

This is the complete list of members for DefaultAccountScenario, including all inherited members.
AuthenticateWithRequestToken(WebAccountProvider Provider, String Scope, String ClientID) | DefaultAccountScenario | [inline]
AzureActiveDirectoryAuthority | DefaultAccountScenario | [private]
AzureActiveDirectoryClientId | DefaultAccountScenario | [private]
AzureActiveDirectoryScopeRequested | DefaultAccountScenario | [private]
Button_DefaultSignIn_Click(object sender, RoutedEventArgs e) | DefaultAccountScenario | [inline, private]
Button_GetTokenSilently_Click(object sender, RoutedEventArgs e) | DefaultAccountScenario | [inline, private]
Button_Reset_Click(object sender, RoutedEventArgs e) | DefaultAccountScenario | [inline, private]
defaultAccount | DefaultAccountScenario | [private]
DefaultAccountScenario() | DefaultAccountScenario | [inline]
defaultProvider | DefaultAccountScenario | [private]
DefaultProviderId | DefaultAccountScenario | [private]
GetTokenSilent(WebAccountProvider Provider, WebAccount Account) | DefaultAccountScenario | [inline, private]
MicrosoftAccountAuthority | DefaultAccountScenario | [private]
MicrosoftAccountClientId | DefaultAccountScenario | [private]
MicrosoftAccountScopeRequested | DefaultAccountScenario | [private]
MicrosoftProviderId | DefaultAccountScenario | [private]
OnNavigatedFrom(NavigationEventArgs e) | DefaultAccountScenario | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | DefaultAccountScenario | [inline, protected]
OutputTokenResult(WebTokenRequestResult result) | DefaultAccountScenario | [inline]
rootPage | DefaultAccountScenario | [private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cs/SampleConfiguration.cs Source File

  • Calendar
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Calendar C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Display a calendar", ClassType = typeof(SDKTemplate.Scenario1_Data) },
00025             new Scenario() { Title = "Retrieve calendar statistics", ClassType = typeof(SDKTemplate.Scenario2_Stats) },
00026             new Scenario() { Title = "Calendar enumeration and math", ClassType = typeof(SDKTemplate.Scenario3_Enum) },
00027             new Scenario() { Title = "Calendar with Unicode extensions in languages", ClassType = typeof(SDKTemplate.Scenario4_UnicodeExtensions) },
00028             new Scenario() { Title = "Calendar time zone support", ClassType = typeof(SDKTemplate.Scenario5_TimeZone) }
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonTriggerGhostToast_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/pch.cpp Source File

  • 3DPrinting
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/ProductItem.cpp Source File

  • Simple3DGameXaml
  • cpp

ProductItem.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "ProductItem.h"
00014
00015 using namespace Simple3DGameXaml;
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::UI::Xaml::Interop;
00020 using namespace Windows::UI::Xaml::Data;
00021 using namespace Windows::ApplicationModel::Store;
00022
00023 ProductItem::ProductItem(
00024     ListingInformation^ listing,
00025     LicenseInformation^ license,
00026     Platform::String^ productId,
00027     bool isApp
00028     )
00029 {
00030     m_isApp = isApp;
00031     m_isAppActive = license->IsActive;
00032     m_isAppTrial = license->IsTrial;
00033     m_productId = productId;
00034
00035     if (m_isApp)
00036     {
00037         SetStatus(license);
00038         if (listing != nullptr)
00039         {
00040             m_title = listing->Name;
00041             m_formattedPrice = listing->FormattedPrice;
00042         }
00043         else
00044         {
00045             m_title = productId;
00046             m_formattedPrice = "";
00047         }
00048     }
00049     else
00050     {
00051         if (listing != nullptr)
00052         {
00053             ProductListing^ productListing = listing->ProductListings->Lookup(m_productId);
00054             m_title = productListing->Name;
00055             m_formattedPrice = productListing->FormattedPrice;
00056         }
00057         else
00058         {
00059             m_title = m_productId;
00060             m_formattedPrice = "";
00061         }
00062         SetStatus(license);
00063     }
00064 }
00065
00066 void ProductItem::SetStatus(LicenseInformation^ license)
00067 {
00068     if (m_isApp)
00069     {
00070         if (m_isAppActive)
00071         {
00072             if (m_isAppTrial)
00073             {
00074                 m_isAvailableForPurchase = true;
00075                 m_foreground = "#a0a0a0";
00076                 m_status = "Trial";
00077             }
00078             else
00079             {
00080                 m_isAvailableForPurchase = false;
00081                 m_foreground = "#707070";
00082                 m_status = "Purchased";
00083             }
00084         }
00085         else
00086         {
00087             m_isAvailableForPurchase = true;
00088             m_foreground = "#a0a0a0";
00089             m_status = "No License";
00090         }
00091     }
00092     else
00093     {
00094         if (m_isAppActive)
00095         {
00096             if (m_isAppTrial)
00097             {
00098                 m_isProductActive = false;
00099                 m_isAvailableForPurchase = false;
00100                 m_foreground = "#707070";
00101                 m_status = "unavailable";
00102             }
00103             else
00104             {
00105                 ProductLicense^ productLicense = license->ProductLicenses->Lookup(m_productId);
00106
00107                 m_isProductActive = productLicense->IsActive;
00108                 m_isAvailableForPurchase = !m_isProductActive;
00109                 if (m_isProductActive)
00110                 {
00111                     m_status = "Purchased";
00112                     m_foreground = "#707070";
00113                 }
00114                 else
00115                 {
00116                     m_status = "No License";
00117                     m_foreground = "#a0a0a0";
00118                 }
00119             }
00120         }
00121         else
00122         {
00123             m_isProductActive = false;
00124             m_isAvailableForPurchase = false;
00125             m_foreground = "#707070";
00126         }
00127     }
00128 }
00129
00130 void ProductItem::UpdateContent(LicenseInformation^ license)
00131 {
00132     if (m_isAppActive != license->IsActive ||
00133         m_isAppTrial != license->IsTrial)
00134     {
00135         m_isAppActive = license->IsActive;
00136         m_isAppTrial = license->IsTrial;
00137         SetStatus(license);
00138         PropertyChanged(this, ref new PropertyChangedEventArgs("Status"));
00139         PropertyChanged(this, ref new PropertyChangedEventArgs("BuyVisibility"));
00140         PropertyChanged(this, ref new PropertyChangedEventArgs("Foreground"));
00141     }
00142     else if (!m_isApp && m_isAppActive && !m_isAppTrial)
00143     {
00144         if (license->ProductLicenses->Lookup(m_productId)->IsActive != m_isProductActive)
00145         {
00146             SetStatus(license);
00147             PropertyChanged(this, ref new PropertyChangedEventArgs("Status"));
00148             PropertyChanged(this, ref new PropertyChangedEventArgs("BuyVisibility"));
00149             PropertyChanged(this, ref new PropertyChangedEventArgs("Foreground"));
00150         }
00151     }
00152 }
00153
00154 void ProductItem::UpdateContent(ListingInformation^ listing)
00155 {
00156     if (m_isApp)
00157     {
00158         if (m_title != listing->Name)
00159         {
00160             m_title = listing->Name;
00161             PropertyChanged(this, ref new PropertyChangedEventArgs("Title"));
00162         }
00163         if (m_formattedPrice != listing->FormattedPrice)
00164         {
00165             m_formattedPrice = listing->FormattedPrice;
00166             PropertyChanged(this, ref new PropertyChangedEventArgs("Price"));
00167         }
00168     }
00169     else
00170     {
00171         ProductListing^ productListing = listing->ProductListings->Lookup(m_productId);
00172         if (m_title != productListing->Name)
00173         {
00174             m_title = productListing->Name;
00175             PropertyChanged(this, ref new PropertyChangedEventArgs("Title"));
00176         }
00177         if (m_formattedPrice != productListing->FormattedPrice)
00178         {
00179             m_formattedPrice = productListing->FormattedPrice;
00180             PropertyChanged(this, ref new PropertyChangedEventArgs("Price"));
00181         }
00182     }
00183 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VisibilityConverter Member List

This is the complete list of members for VisibilityConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | VisibilityConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | VisibilityConverter | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario7_DeviceInformationKind.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario7_DeviceInformationKind.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Platform::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::UI::Core;
00013 using namespace Windows::UI::Xaml;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Controls::Primitives;
00016 using namespace Windows::UI::Xaml::Data;
00017 using namespace Windows::UI::Xaml::Input;
00018 using namespace Windows::UI::Xaml::Media;
00019 using namespace Windows::UI::Xaml::Navigation;
00020 using namespace Windows::Devices::Enumeration;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 Scenario7_DeviceInformationKind::Scenario7_DeviceInformationKind()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario7_DeviceInformationKind::OnNavigatedTo(NavigationEventArgs^ e)
00030 {
00031     resultsListView->ItemsSource = resultCollection;
00032
00033     kindComboBox->ItemsSource = DeviceInformationKindChoices::Choices;
00034     kindComboBox->SelectedIndex = 0;
00035 }
00036
00037 void Scenario7_DeviceInformationKind::OnNavigatedFrom(NavigationEventArgs^ e)
00038 {
00039     StopWatchers(/* reset */ true);
00040 }
00041
00042 void Scenario7_DeviceInformationKind::StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00043 {
00044     StartWatchers();
00045 }
00046
00047 void Scenario7_DeviceInformationKind::StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00048 {
00049     StopWatchers();
00050 }
00051
00052 void Scenario7_DeviceInformationKind::StartWatchers()
00053 {
00054     startWatcherButton->IsEnabled = false;
00055     resultCollection->Clear();
00056
00057     DeviceInformationKindChoice^ kindChoice = safe_cast<DeviceInformationKindChoice^>(kindComboBox->SelectedItem);
00058
00059     // Create a watcher for each DeviceInformationKind selected by the user
00060     for (DeviceInformationKind deviceInfoKind : kindChoice->DeviceInformationKinds)
00061     {
00062         DeviceWatcher^ deviceWatcher = DeviceInformation::CreateWatcher(
00063             "", // AQS Filter string
00064             nullptr, // requested properties
00065             deviceInfoKind);
00066
00067         DeviceWatcherHelper^ deviceWatcherHelper = ref new DeviceWatcherHelper(resultCollection, Dispatcher);
00068         deviceWatcherHelper->UpdateStatus = false;
00069         deviceWatcherHelper->DeviceChanged += ref new TypedEventHandler<DeviceWatcher^, String^>(this, &Scenario7_DeviceInformationKind::OnDeviceListChanged);
00070         deviceWatcherHelpers->Append(deviceWatcherHelper);
00071
00072         deviceWatcherHelper->StartWatcher(deviceWatcher);
00073     }
00074
00075     stopWatcherButton->IsEnabled = true;
00076     stopWatcherButton->Focus(::FocusState::Keyboard);
00077 }
00078
00079 void Scenario7_DeviceInformationKind::StopWatchers(bool reset)
00080 {
00081     stopWatcherButton->IsEnabled = false;
00082
00083     for (DeviceWatcherHelper^ deviceWatcherHelper : deviceWatcherHelpers)
00084     {
00085         deviceWatcherHelper->StopWatcher();
00086         if (reset)
00087         {
00088             deviceWatcherHelper->Reset();
00089         }
00090     }
00091     deviceWatcherHelpers->Clear();
00092
00093     startWatcherButton->IsEnabled = true;
00094 }
00095
00096 void Scenario7_DeviceInformationKind::OnDeviceListChanged(DeviceWatcher^ sender, String^ id)
00097 {
00098     int watchersRunning = 0;
00099
00100     // Count running watchers
00101     for (DeviceWatcherHelper^ deviceWatcherHelper : deviceWatcherHelpers)
00102     {
00103         if (deviceWatcherHelper->IsWatcherRunning())
00104         {
00105             watchersRunning++;
00106         }
00107     }
00108
00109     String^ message = watchersRunning.ToString() + "/" + deviceWatcherHelpers->Size.ToString() + " watchers running. " +
00110         resultCollection->Size.ToString() + " devices found.";
00111     rootPage->NotifyUser(message, NotifyType::StatusMessage);
00112 }
00113
Generated on Fri Nov 15 2024 22:19:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_InvokeScript Member List

This is the complete list of members for Scenario3_InvokeScript, including all inherited members.
InvokeScript() | Scenario3_InvokeScript | [inline, private]
LoadHtml() | Scenario3_InvokeScript | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_InvokeScript | [inline, protected]
rootPage | Scenario3_InvokeScript | [private]
Scenario3_InvokeScript() | Scenario3_InvokeScript | [inline]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/BackgroundTask/Scenario1_BackgroundTask.h Source File

  • BackgroundSensors
  • cpp
  • BackgroundTask

Scenario1_BackgroundTask.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 namespace BackgroundTask
00006 {
00007     [Windows::Foundation::Metadata::WebHostHidden]
00008     public ref class Scenario1_BackgroundTask sealed :
00009         public Windows::ApplicationModel::Background::IBackgroundTask
00010     {
00011     public:
00012         Scenario1_BackgroundTask();
00013         virtual ~Scenario1_BackgroundTask();
00014
00015         virtual void Run(
00016             Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
00017
00018     private:
00019         void OnCanceled(
00020             Windows::ApplicationModel::Background::IBackgroundTaskInstance^ sender,
00021             Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason);
00022
00023         void ReadingChanged(
00024             Windows::Devices::Sensors::Accelerometer^ sender,
00025             Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^ e);
00026
00027     private:
00028         // The accelerometer we will be subscribing to.
00029         Windows::Devices::Sensors::Accelerometer^ _accelerometer;
00030
00031         // Used to defer the task from completion until it is canceled.
00032         Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral^> _deferral;
00033
00034         // Used to track the number of received accelerometer readings.
00035         uint64 _sampleCount;
00036
00037         // Used for unregistering from the AccelerometerReadingChanged event.
00038         Windows::Foundation::EventRegistrationToken _readingToken;
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario1_Basic.xaml.cpp Source File

  • FullScreenMode
  • cpp

Scenario1_Basic.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Basic.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Input;
00024
00025 Scenario1_Basic::Scenario1_Basic() : rootPage(MainPage::Current)
00026 {
00027     InitializeComponent();
00028 }
00029
00030 void Scenario1_Basic::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00031 {
00032     windowResizeToken = Window::Current->SizeChanged += ref new WindowSizeChangedEventHandler(this, &Scenario1_Basic::OnWindowResize);
00033     keyDownToken = rootPage->KeyDown += ref new KeyEventHandler(this, &Scenario1_Basic::OnKeyDown);
00034     UpdateContent();
00035 }
00036
00037 void Scenario1_Basic::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00038 {
00039     Window::Current->SizeChanged -= windowResizeToken;
00040     rootPage->KeyDown -= keyDownToken;
00041 }
00042
00043 void Scenario1_Basic::ToggleFullScreenModeButton_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00044 {
00045     ApplicationView^ view = ApplicationView::GetForCurrentView();
00046     if (view->IsFullScreenMode)
00047     {
00048         view->ExitFullScreenMode();
00049         rootPage->NotifyUser("Exiting full screen mode", NotifyType::StatusMessage);
00050         isLastKnownFullScreen = false;
00051         // The SizeChanged event will be raised when the exit from full screen mode is complete.
00052     }
00053     else
00054     {
00055         if (view->TryEnterFullScreenMode())
00056         {
00057             rootPage->NotifyUser("Entering full screen mode", NotifyType::StatusMessage);
00058             isLastKnownFullScreen = true;
00059             // The SizeChanged event will be raised when the entry to full screen mode is complete.
00060         }
00061         else
00062         {
00063             rootPage->NotifyUser("Failed to enter full screen mode", NotifyType::ErrorMessage);
00064         }
00065     }
00066 }
00067
00068 void Scenario1_Basic::ShowStandardSystemOverlaysButton_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00069 {
00070     ApplicationView^ view = ApplicationView::GetForCurrentView();
00071     view->ShowStandardSystemOverlays();
00072 }
00073
00074 void Scenario1_Basic::UseMinimalOverlaysCheckBox_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00075 {
00076     ApplicationView^ view = ApplicationView::GetForCurrentView();
00077     view->FullScreenSystemOverlayMode = UseMinimalOverlaysCheckBox->IsChecked->Value ? FullScreenSystemOverlayMode::Minimal : FullScreenSystemOverlayMode::Standard;
00078 }
00079
00080 void Scenario1_Basic::OnWindowResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e)
00081 {
00082     UpdateContent();
00083 }
00084
00085 void Scenario1_Basic::UpdateContent()
00086 {
00087     ApplicationView^ view = ApplicationView::GetForCurrentView();
00088     bool isFullScreenMode = view->IsFullScreenMode;
00089     ToggleFullScreenModeSymbol->Symbol = isFullScreenMode ? Symbol::BackToWindow : Symbol::FullScreen;
00090     ReportFullScreenMode->Text = isFullScreenMode ? "is in" : "is not in";
00091     FullScreenOptionsPanel->Visibility = isFullScreenMode ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00092
00093     // Did the system force a change in full screen mode?
00094     if (isLastKnownFullScreen != isFullScreenMode)
00095     {
00096         isLastKnownFullScreen = isFullScreenMode;
00097         // Clear any stray messages that talked about the mode we are no longer in.
00098         rootPage->NotifyUser("", NotifyType::StatusMessage);
00099     }
00100 }
00101
00102 void Scenario1_Basic::OnKeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
00103 {
00104     if (e->Key == Windows::System::VirtualKey::Escape)
00105     {
00106         ApplicationView^ view = ApplicationView::GetForCurrentView();
00107         if (view->IsFullScreenMode)
00108         {
00109             view->ExitFullScreenMode();
00110             rootPage->NotifyUser("Exited full screen mode due to keypress", NotifyType::StatusMessage);
00111             isLastKnownFullScreen = false;
00112         }
00113     }
00114 }
Generated on Fri Nov 15 2024 22:19:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Simple3DGame.h Source File

  • Simple3DGameXaml
  • cpp

Simple3DGame.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Simple3DGame:
00015 // This is the main game class.  It controls game play logic and game state.
00016 // Some of the key object classes used by Simple3DGame are:
00017 //     MoveLookController - for handling all input to control player movement, aiming,
00018 //         and firing.
00019 //     GameRenderer - for handling all graphics presentation.
00020 //     Camera - for handling view projections.
00021 //     Audio - for handling sound output.
00022 // This class maintains several lists of objects:
00023 //     m_ammo <Sphere> - is the list of the balls used to throw at targets.  Simple3DGame
00024 //         cycles through the list in a LRU fashion each time a ball is thrown by the player.
00025 //     m_objects <GameObject> - is the list of all objects in the scene that participate in
00026 //         game physics.  This includes m_player <Sphere> to represent the player in the scene.
00027 //         The player object (m_player) is not visible in the scene so it is not rendered.
00028 //     m_renderObjects <GameObject> - is the list of all objects in the scene that may be
00029 //         rendered.  It includes both the m_ammo list, most of the m_objects list excluding m_player
00030 //         object and the objects representing the bounding world.
00031
00032 #include "GameConstants.h"
00033 #include "GameUIConstants.h"
00034 #include "Audio.h"
00035 #include "Camera.h"
00036 #include "Level.h"
00037 #include "GameObject.h"
00038 #include "GameTimer.h"
00039 #include "MoveLookController.h"
00040 #include "PersistentState.h"
00041 #include "Sphere.h"
00042 #include "GameRenderer.h"
00043
00044 //--------------------------------------------------------------------------------------
00045
00046 enum class GameState
00047 {
00048     Waiting,
00049     Active,
00050     LevelComplete,
00051     TimeExpired,
00052     GameComplete,
00053 };
00054
00055 typedef struct
00056 {
00057     Platform::String^ tag;
00058     int totalHits;
00059     int totalShots;
00060     int levelCompleted;
00061 } HighScoreEntry;
00062
00063 typedef std::vector<HighScoreEntry> HighScoreEntries;
00064
00065 typedef struct
00066 {
00067     bool isTrial;
00068     bool autoFire;
00069     bool backgroundAvailable[GameConstants::MaxBackgroundTextures];
00070 } GameConfig;
00071
00072 //--------------------------------------------------------------------------------------
00073
00074 ref class GameRenderer;
00075
00076 ref class Simple3DGame
00077 {
00078 internal:
00079     Simple3DGame();
00080
00081     void Initialize(
00082         _In_ MoveLookController^ controller,
00083         _In_ GameRenderer^ renderer
00084         );
00085
00086     void LoadGame();
00087     concurrency::task<void> LoadLevelAsync();
00088     void FinalizeLoadLevel();
00089     void StartLevel();
00090     void PauseGame();
00091     void ContinueGame();
00092     GameState RunGame();
00093     void SetCurrentLevelToSavedState();
00094
00095     void OnSuspending();
00096     void OnResuming();
00097
00098     bool IsActivePlay()                         { return m_timer->Active(); }
00099     bool IsTrial()                              { return m_gameConfig.isTrial; }
00100     int LevelCompleted()                        { return m_currentLevel; };
00101     int TotalShots()                            { return m_totalShots; };
00102     int TotalHits()                             { return m_totalHits; };
00103     float BonusTime()                           { return m_levelBonusTime; };
00104     bool GameActive()                           { return m_gameActive; };
00105     bool LevelActive()                          { return m_levelActive; };
00106     HighScoreEntry HighScore()                  { return m_topScore; };
00107     Level^ CurrentLevel()                       { return m_level[m_currentLevel]; };
00108     float TimeRemaining()                       { return m_levelTimeRemaining; };
00109     Camera^ GameCamera()                        { return m_camera; };
00110     std::vector<GameObject^> RenderObjects()    { return m_renderObjects; };
00111
00112     void UpdateGameConfig(Windows::ApplicationModel::Store::LicenseInformation^ licenseInformation);
00113     void SetBackground(uint32 background);
00114     void CycleBackground();
00115
00116
00117 private:
00118     void LoadState();
00119     void SaveState();
00120     void SaveHighScore();
00121     void LoadHighScore();
00122     void InitializeAmmo();
00123     void UpdateDynamics();
00124     void InitializeGameConfig();
00125
00126     MoveLookController^                         m_controller;
00127     GameRenderer^                               m_renderer;
00128     Camera^                                     m_camera;
00129
00130     Audio^                                      m_audioController;
00131
00132     std::vector<Sphere^>                        m_ammo;
00133     uint32                                      m_ammoCount;
00134     uint32                                      m_ammoNext;
00135
00136     HighScoreEntry                              m_topScore;
00137     PersistentState^                            m_savedState;
00138
00139     GameTimer^                                  m_timer;
00140     bool                                        m_gameActive;
00141     bool                                        m_levelActive;
00142     int                                         m_totalHits;
00143     int                                         m_totalShots;
00144     float                                       m_levelDuration;
00145     float                                       m_levelBonusTime;
00146     float                                       m_levelTimeRemaining;
00147     std::vector<Level^>                         m_level;
00148     uint32                                      m_levelCount;
00149     uint32                                      m_currentLevel;
00150
00151     GameConfig                                  m_gameConfig;
00152     uint32                                      m_activeBackground;
00153
00154     Sphere^                                     m_player;
00155     std::vector<GameObject^>                    m_objects;           // List of all objects to be included in intersection calculations.
00156     std::vector<GameObject^>                    m_renderObjects;     // List of all objects to be rendered.
00157
00158     DirectX::XMFLOAT3                           m_minBound;
00159     DirectX::XMFLOAT3                           m_maxBound;
00160 };
00161
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/DeferredControlTemplatePart.xaml.cs Source File

  • XamlDeferLoadStrategy
  • cs
  • Scenarios

DeferredControlTemplatePart.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.Foundation;
00007 using Windows.Foundation.Collections;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Controls.Primitives;
00011 using Windows.UI.Xaml.Data;
00012 using Windows.UI.Xaml.Input;
00013 using Windows.UI.Xaml.Media;
00014 using Windows.UI.Xaml.Navigation;
00015
00016 namespace xDeferLoadStrategy
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class DeferredControlTemplatePart : Page
00022     {
00023         public DeferredControlTemplatePart()
00024         {
00025             this.InitializeComponent();
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_PrintReceipt Member List

This is the complete list of members for Scenario2_PrintReceipt, including all inherited members.
ExecuteJobAndReportResultAsync(ReceiptPrintJob job) | Scenario2_PrintReceipt | [inline, private]
GetCustomerFooter() | Scenario2_PrintReceipt | [inline, private]
GetMerchantFooter() | Scenario2_PrintReceipt | [inline, private]
IsPrinterClaimed() | Scenario2_PrintReceipt | [inline, private]
LoadLogoBitmapAsync() | Scenario2_PrintReceipt | [inline, static]
PrintBarcode_Click() | Scenario2_PrintReceipt | [inline, private]
PrintBitmap_Click() | Scenario2_PrintReceipt | [inline, private]
PrintLine_Click() | Scenario2_PrintReceipt | [inline, private]
PrintLineFeedAndCutPaper(ReceiptPrintJob job, string receipt) | Scenario2_PrintReceipt | [inline, private]
PrintReceipt_Click() | Scenario2_PrintReceipt | [inline, private]
rootPage | Scenario2_PrintReceipt | [private]
Scenario2_PrintReceipt() | Scenario2_PrintReceipt | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.h Source File

  • ExtendedExecution
  • cpp

Scenario4_MultipleTasks.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_MultipleTasks.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Page containing the Extended Execution LocationTracking Reason scenario functions.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class MultipleTasks sealed
00024     {
00025     public:
00026         MultipleTasks();
00027
00028     protected:
00029         void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00030         void BeginExtendedExecution();
00031         void EndExtendedExecution();
00032
00033     private:
00034         MainPage^ rootPage = MainPage::Current;
00035         Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionSession^ session;
00036         Concurrency::cancellation_token_source cancellationTokenSource;
00037         Windows::Foundation::EventRegistrationToken sessionRevokedToken;
00038         int taskCount = 0;
00039
00040         void ClearExtendedExecution();
00041         void UpdateUI();
00042         void OnTaskCompleted();
00043         Windows::Foundation::Deferral^ GetExecutionDeferral();
00044         void RaiseToastAfterDelay(int id, int seconds);
00045         void SessionRevoked(Platform::Object^ sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^ args);
00046     };
00047 }
Generated on Fri Nov 15 2024 22:19:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/pch.cpp Source File

  • Logging
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario1_Prefs.xaml.cpp Source File

  • GlobalizationPreferences
  • cpp

Scenario1_Prefs.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Prefs.xaml.h"
00013 #include "SampleConfiguration.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Globalization;
00022 using namespace Windows::System::UserProfile;
00023
00024 Scenario1_Prefs::Scenario1_Prefs()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario1_Prefs::ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00030 {
00031     // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
00032     // obtain the user's globalization preferences.
00033     OutputTextBlock->Text = "Languages: " + StringJoin(", ", GlobalizationPreferences::Languages) + "\n" +
00034         "Home Region: " + GlobalizationPreferences::HomeGeographicRegion + "\n" +
00035         "Calendar System: " + StringJoin(", ", GlobalizationPreferences::Calendars) + "\n" +
00036         "Clock: " + StringJoin(", ", GlobalizationPreferences::Clocks) + "\n" +
00037         "First Day of the Week: " + GlobalizationPreferences::WeekStartsOn.ToString();
00038 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/Functions.xaml.cs Source File

  • XamlBind
  • cs

Functions.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.ObjectModel;
00003 using System.Reflection;
00004 using Windows.UI;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007 using Windows.UI.Xaml.Media;
00008 using xBindSampleModel;
00009
00010 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00011
00012 namespace xBindSampleCS
00013 {
00014     public sealed partial class Functions : Page
00015     {
00016         #region Model fields, properties & DP's
00017         public DataModel Model { get; set; }
00018
00019         public CSharpModel CSharpModel { get; set; }
00020
00021         public xBindSampleModel.IEmployee NullEmployee;
00022         public String NullStringProperty;
00023
00024         ObservableCollection<ColorEntry> ColorEntries = new ObservableCollection<ColorEntry>();
00025
00026         #endregion
00027
00028         public Functions()
00029         {
00030             this.Model = new DataModel();
00031             this.CSharpModel = new CSharpModel();
00032             this.InitializeComponent();
00033             InitializeValues();
00034         }
00035
00036         #region Model initialization & updates
00037         void InitializeValues()
00038         {
00039         }
00040
00041         private void UpdateValuesClick(object sender, RoutedEventArgs e)
00042         {
00043             this.Model.UpdateValues();
00044             this.CSharpModel.UpdateValues();
00045         }
00046
00047         private void ResetValuesClick(object sender, RoutedEventArgs e)
00048         {
00049             this.Model.InitializeValues();
00050             this.CSharpModel.InitializeValues();
00051             this.InitializeValues();
00052         }
00053         #endregion
00054
00055         string GetTime()
00056         {
00057             return DateTime.Now.ToString();
00058         }
00059
00060         string Display(string stringArg, int intArg, double floatArg, bool boolArg)
00061         {
00062             return $"String is: {stringArg}, Integer is: {intArg}, Float is: {floatArg}, Boolean is {boolArg}";
00063         }
00064
00065         string countVowels(string words)
00066         {
00067             int count = 0;
00068             foreach (char c in words.ToLower())
00069             {
00070                 if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
00071                 {
00072                     count++;
00073                 }
00074             }
00075             return count.ToString();
00076         }
00077
00078         public string CountEmployees(IEmployee e)
00079         {
00080             return CountEmployeesinternal(e).ToString();
00081         }
00082
00083         public int CountEmployeesinternal(IEmployee e)
00084         {
00085             int result = 1;
00086             if (e is Manager)
00087                 foreach (IEmployee c in ((Manager)e).ReportsList)
00088                 {
00089                     result += CountEmployeesinternal(c);
00090                 }
00091             return result;
00092         }
00093
00094         public SolidColorBrush MakeColor(double red, double green, double blue)
00095         {
00096             return new SolidColorBrush(Color.FromArgb(255, (byte)red, (byte)green, (byte)blue));
00097         }
00098
00099         public string ColorValue(double red, double green, double blue)
00100         {
00101             return $"#{(int)red:X}{(int)green:X}{(int)blue:X}";
00102         }
00103
00104         public void ProcessColor(string value)
00105         {
00106             try
00107             {
00108                 if (value.Length == 7 && value.StartsWith("#"))
00109                 {
00110                     int red = int.Parse(value.Substring(1, 2), System.Globalization.NumberStyles.HexNumber);
00111                     int green = int.Parse(value.Substring(3, 2), System.Globalization.NumberStyles.HexNumber);
00112                     int blue = int.Parse(value.Substring(5, 2), System.Globalization.NumberStyles.HexNumber);
00113
00114                     RedSlider.Value = red;
00115                     GreenSlider.Value = green;
00116                     BlueSlider.Value = blue;
00117                 }
00118             }
00119             catch (Exception ex)
00120             {
00121                 // raise error in the application
00122             }
00123         }
00124
00125         private void PopulateColorsClick(object sender, RoutedEventArgs e)
00126         {
00127             foreach (var p in typeof(Windows.UI.Colors).GetTypeInfo().DeclaredProperties)
00128             {
00129                 if (p.PropertyType == typeof(Color))
00130                 {
00131                     ColorEntry ce = new ColorEntry() { ColorName = p.Name };
00132                     ce.Color = (Color)p.GetMethod.Invoke(null, new object[0]);
00133                     ColorEntries.Add(ce);
00134                 }
00135             }
00136         }
00137
00138         private void ClearColorsClick(object sender, RoutedEventArgs e)
00139         {
00140             ColorEntries.Clear();
00141         }
00142
00143
00144         public Visibility ShowPlaceholder(int count)
00145         {
00146             return (count > 0) ? Visibility.Collapsed : Visibility.Visible;
00147         }
00148
00149         public static SolidColorBrush TextColor(Color c)
00150         {
00151             return new SolidColorBrush(((c.R * 0.299 + c.G * 0.587 + c.B * 0.114) > 150) ? Colors.Black : Colors.White);
00152         }
00153     }
00154
00155
00156     class ColorEntry
00157     {
00158         public string ColorName { get; set; }
00159         public Color Color { get; set; }
00160
00161         public SolidColorBrush Brushify(Color c)
00162         {
00163             return new SolidColorBrush(c);
00164         }
00165
00166
00167     }
00168 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ViewLifetimeControl.h Source File

  • Projection
  • cpp

ViewLifetimeControl.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <mutex>
00015
00016 namespace SDKSample
00017 {
00018     namespace SecondaryViewsHelpers
00019     {
00020         // A custom event that fires whenever the secondary view is ready to be closed. You should
00021         // clean up any state (including deregistering for events) then close the window in this handler
00022         public delegate void ViewReleasedHandler(Platform::Object^ sender, Platform::Object^ e);
00023
00024         [Windows::UI::Xaml::Data::Bindable]
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         public ref class ViewLifetimeControl sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
00027         {
00028         public:
00029             static ViewLifetimeControl^ CreateForCurrentView();
00030             property Windows::UI::Core::CoreDispatcher^ Dispatcher
00031             {
00032                 Windows::UI::Core::CoreDispatcher^ get();
00033             };
00034
00035             property int Id
00036             {
00037                 int get();
00038             };
00039
00040             property Platform::String^ Title
00041             {
00042                 Platform::String^ get();
00043                 void set(Platform::String^ value);
00044             };
00045
00046             int StartViewInUse();
00047             int StopViewInUse();
00048
00049             event ViewReleasedHandler^ Released
00050             {
00051                 Windows::Foundation::EventRegistrationToken add(ViewReleasedHandler^ handler);
00052                 void remove(Windows::Foundation::EventRegistrationToken token);
00053             }
00054             virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00055
00056         private:
00057             ViewLifetimeControl(Windows::UI::Core::CoreWindow^ newWindow);
00058             void RegisterForEvents();
00059             void UnregisterForEvents();
00060             void FinalizeRelease();
00061             void ViewConsolidated(Windows::UI::ViewManagement::ApplicationView^ sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs^ e);
00062             void VisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00063             event ViewReleasedHandler^ InternalReleased;
00064
00065             // Keeps track of if the consolidated event has fired yet. A view is consolidated with other views
00066             // when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00067             // launched from Start, etc.) A view stops being consolidated when it's visible--at that point
00068             // the user can interact with it, move it on or off screen, etc.
00069             property bool Consolidated
00070             {
00071                 bool get();
00072                 void set(bool value);
00073             }
00074             Windows::Foundation::EventRegistrationToken consolidatedToken, visibilityToken;
00075
00076             // Dispatcher for this view. Kept here for sending messages between this view and the main view.
00077             Windows::UI::Core::CoreDispatcher^ dispatcher;
00078
00079             // Window for this particular view. Used to register and unregister for events
00080             Platform::Agile<Windows::UI::Core::CoreWindow^> window;
00081
00082             // The title for the view shown in the list of recently used apps (by setting the title on
00083             // ApplicationView)
00084             Platform::String^ title;
00085
00086             // This class uses reference counts to make sure the secondary views isn't closed prematurely.
00087             // Whenever the main view is about to interact with the secondary view, it should take a reference
00088             // by calling "StartViewInUse" on this object. When finished interacting, it should release the reference
00089             // by calling "StopViewInUse". You can see examples of this throughout the sample, especially in
00090             // scenario 1.
00091             int refCount;
00092
00093             // Each view has a unique Id, found using the ApplicationView.Id property or
00094             // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00095             // and ProjectionManager APIs.
00096             int viewId;
00097
00098             // Tracks if this ViewLifetimeControl object is still valid. If this is true, then the view is in the process
00099             // of closing itself down
00100             bool consolidated, released;
00101
00102             // Tracks whether the projected view has been made visible for the first time yet. If it has not yet been shown for the
00103             // first time yet, we should not signal for it to be released yet. This protects against the fact that visibilityChanged
00104             // is not guaranteed to fire until after the StartProjectingAsync task has completed, so refCount of the ViewLifeTimeControl
00105             // may temporarily drop to 0 until the visibilityChanged event fires for the projected view first becoming visible.
00106             bool madeVisible;
00107
00108             std::mutex globalMutex;
00109         };
00110     }
00111 }
Generated on Fri Nov 15 2024 22:20:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario5_RestoreScrollPosition.cpp Source File

  • XamlListView
  • cppwinrt

Scenario5_RestoreScrollPosition.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_RestoreScrollPosition.h"
00014 #include "Scenario5_RestoreScrollPosition.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::Xaml;
00019 using namespace winrt::Windows::UI::Xaml::Controls;
00020 using namespace winrt::Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     double Scenario5_RestoreScrollPosition::_persistedItemContainerHeight = -1.0;
00025     hstring Scenario5_RestoreScrollPosition::_persistedItemKey;
00026     hstring Scenario5_RestoreScrollPosition::_persistedPosition;
00027
00028     Scenario5_RestoreScrollPosition::Scenario5_RestoreScrollPosition()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     fire_and_forget Scenario5_RestoreScrollPosition::Page_Loaded(IInspectable const&, RoutedEventArgs const& e)
00034     {
00035         if (!_persistedPosition.empty())
00036         {
00037             // Here we kick off the async function to use the saved string _persistedPosition and the function GetItem to restore the scroll posistion
00038             auto lifetime = get_strong();
00039             co_await ListViewPersistenceHelper::SetRelativeScrollPositionAsync(ItemsListView(), _persistedPosition, { this, &Scenario5_RestoreScrollPosition::GetItem });
00040         }
00041     }
00042
00043     void Scenario5_RestoreScrollPosition::OnNavigatingFrom(NavigatingCancelEventArgs const&)
00044     {
00045         // Before we navigate away from the page, we want to generate a new _persistedPosition string. This string contains the key of the item at the top of the
00046         // viewing window (generated by the function GetKey) and the offset of that item.
00047         _persistedPosition = ListViewPersistenceHelper::GetRelativeScrollPosition(ItemsListView(), { this, &Scenario5_RestoreScrollPosition::GetKey });
00048     }
00049
00050     IAsyncOperation<IInspectable> Scenario5_RestoreScrollPosition::GetItem(hstring const& key)
00051     {
00052         // This function takes a key that ListViewPersistenceHelper parsed out of the _persistedPosition string
00053         // It returns an item that corresponds to the given key
00054         // The implementation of this function is dependent on the data model you are using. Every item in your list should have
00055         // a unique key this function returns
00056         auto found = std::find_if(items.begin(), items.end(), [&](auto&& item) { return item.Id() == key; });
00057         co_return found == items.end() ? nullptr : *found;
00058     }
00059
00060     hstring Scenario5_RestoreScrollPosition::GetKey(IInspectable const& object)
00061     {
00062         // This function takes in the item at the top of the viewport at the moment of navigating away from the page, and returns
00063         // a key corresponding to that item. the implementation of this function is dependent on the data model you are using. In this
00064         // function we also save the fully rendered _persistedItemContainerHeight. You do not need to do this if all of your items have
00065         // the same fixed height. Finally, we save the key into a variable so it can be used outside of ListViewPersistenceHelper functions
00066         SDKTemplate::Item item = object.try_as<SDKTemplate::Item>();
00067         if (item != nullptr)
00068         {
00069             _persistedItemContainerHeight = ItemsListView().ContainerFromItem(item).as<ListViewItem>().ActualHeight();
00070             _persistedItemKey = item.Id();
00071             return _persistedItemKey;
00072         }
00073         else
00074         {
00075             return L"";
00076         }
00077     }
00078
00079     void Scenario5_RestoreScrollPosition::ItemsListView_ContainerContentChanging(ListViewBase const&, ContainerContentChangingEventArgs const& args)
00080     {
00081         // This function manually sets the height of the item ListViewPersistenceHelper is attempting to scroll to. We need to set the height
00082         // because if the item is not fully rendered at the time of scrolling, it can return an incorrect height and cause ListViewPersistenceHelper
00083         // to overscroll.
00084         SDKTemplate::Item item = args.Item().try_as<SDKTemplate::Item>();
00085
00086         if (item != nullptr && item.Id() == _persistedItemKey)
00087         {
00088             if (!args.InRecycleQueue())
00089             {
00090                 // Here we set the container's height equal to the fully rendered container height we had saved before navigating away. If all the items in
00091                 // your list have the same fixed height, you can replace this variable with a hardcoded height value.
00092                 args.ItemContainer().Height(_persistedItemContainerHeight);
00093             }
00094             else
00095             {
00096                 // Containers in a list are recycled when they are scrolled out of view. However, if those containers have their Height property set and the content
00097                 // changes, that set Height is still applied. This creates an incorect UI if the items in your list are supposed to be of variable height.
00098                 // If all the items in your list have the same fixed height, you do not have to do this.
00099                 args.ItemContainer().ClearValue(FrameworkElement::HeightProperty());
00100             }
00101         }
00102     }
00103
00104     void Scenario5_RestoreScrollPosition::ItemsListView_ItemClick(IInspectable const&, RoutedEventArgs const&)
00105     {
00106         Frame().Navigate(xaml_typename<SDKTemplate::ImagePage>());
00107     }
00108
00109 }
Generated on Fri Nov 15 2024 22:22:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SecondaryAppWindowPage Member List

This is the complete list of members for SecondaryAppWindowPage, including all inherited members.
SecondaryAppWindowPage() SecondaryAppWindowPage
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/pch.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/VisibilityConverter.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common

VisibilityConverter.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Data;
00019
00020 namespace AdventureWorks.Common
00021 {
00022     /// <summary>
00023     /// Convert a Boolean status to Visibility.Visible (true) or Visibility.Collapsed (false).
00024     /// Assists in avoiding having the view model keep references to UI types.
00025     /// </summary>
00026     public class VisibilityConverter : IValueConverter
00027     {
00028         /// <summary>
00029         /// Convert a boolean into a member of the Visibility enum, true for Visible, false for Collapsed.
00030         /// </summary>
00031         /// <param name="value">The bool passed in</param>
00032         /// <param name="targetType">Ignored.</param>
00033         /// <param name="parameter">Ignored</param>
00034         /// <param name="language">Ignored</param>
00035         /// <returns>Visibility.Visible if value was a true bool, otherwise Visibility.Collapsed</returns>
00036         public object Convert(object value, Type targetType, object parameter, string language)
00037         {
00038             if(value is bool)
00039             {
00040                 if((bool)value == true)
00041                 {
00042                     return Visibility.Visible;
00043                 }
00044             }
00045             return Visibility.Collapsed;
00046         }
00047
00048         /// <summary>
00049         /// Not used, converter is not intended for two-way binding.
00050         /// </summary>
00051         /// <param name="value">Ignored</param>
00052         /// <param name="targetType">Ignored</param>
00053         /// <param name="parameter">Ignored</param>
00054         /// <param name="language">Ignored</param>
00055         /// <returns></returns>
00056         public object ConvertBack(object value, Type targetType, object parameter, string language)
00057         {
00058             throw new NotImplementedException();
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario4_NumberParsing.xaml.cpp Source File

  • NumberFormatting
  • cpp

Scenario4_NumberParsing.xaml.cpp

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario4_NumberParsing.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Windows::UI::Xaml;
00010 using namespace Windows::UI::Xaml::Controls;
00011 using namespace Windows::UI::Xaml::Navigation;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::Globalization::NumberFormatting;
00015
00016 Scenario4_NumberParsing::Scenario4_NumberParsing()
00017 {
00018     InitializeComponent();
00019 }
00020
00021 void Scenario4_NumberParsing::Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00022 {
00023     // This scenario uses the Windows.Globalization.NumberFormatting.DecimalFormatter,
00024     // Windows.Globalization.NumberFormatting.CurrencyFormatter and
00025     // Windows.Globalization.NumberFormatting.PercentFormatter classes to format and parse a number
00026     // percentage or currency.
00027
00028     // Define percent formatters.
00029     PercentFormatter^ percentFormat = ref new PercentFormatter();
00030
00031     auto ja = ref new Platform::Collections::Vector<String^>();
00032     ja->Append("ja-JP");
00033     PercentFormatter^ percentFormatJP = ref new PercentFormatter(ja, "JP");
00034
00035     auto fr = ref new Platform::Collections::Vector<String^>();
00036     fr->Append("fr-FR");
00037     PercentFormatter^ percentFormatFR = ref new PercentFormatter(fr, "FR");
00038
00039     // Define decimal formatters.
00040     DecimalFormatter^ decimalFormat = ref new DecimalFormatter();
00041     decimalFormat->IsGrouped = true;
00042     DecimalFormatter^ decimalFormatJP = ref new DecimalFormatter(ja, "JP");
00043     decimalFormatJP->IsGrouped = true;
00044     DecimalFormatter^ decimalFormatFR = ref new DecimalFormatter(fr, "FR");
00045     decimalFormatFR->IsGrouped = true;
00046
00047     // Define currency formatters
00048     auto userCurrency = Windows::System::UserProfile::GlobalizationPreferences::Currencies->First()->Current;
00049     CurrencyFormatter^ currencyFormat = ref new CurrencyFormatter(userCurrency);
00050     CurrencyFormatter^ currencyFormatJP = ref new CurrencyFormatter("JPY", ja, "JP");
00051     CurrencyFormatter^ currencyFormatFR = ref new CurrencyFormatter("EUR", fr, "FR");
00052
00053     // Generate numbers for parsing.
00054     double percentNumber = 0.523;
00055     double decimalNumber = 12345.67;
00056     double currencyNumber = 1234.56;
00057
00058     // Roundtrip the percent numbers by formatting and parsing.
00059     String^ percent1 = percentFormat->Format(percentNumber);
00060     double percent1Parsed = percentFormat->ParseDouble(percent1)->Value;
00061
00062     String^ percent1JP = percentFormatJP->Format(percentNumber);
00063     double percent1JPParsed = percentFormatJP->ParseDouble(percent1JP)->Value;
00064
00065     String^ percent1FR = percentFormatFR->Format(percentNumber);
00066     double percent1FRParsed = percentFormatFR->ParseDouble(percent1FR)->Value;
00067
00068     // Generate the results for percent parsing.
00069     String^ results1 = "Percent parsing of " + percentNumber + "\n" +
00070     "Formatted for current user: " + percent1   + " Parsed as current user: " + percent1Parsed   + "\n" +
00071     "Formatted for ja-JP: "        + percent1JP + " Parsed for ja-JP: "       + percent1JPParsed + "\n" +
00072     "Formatted for fr-FR: "        + percent1FR + " Parsed for fr-FR: "       + percent1FRParsed;
00073
00074     // Roundtrip the decimal numbers for formatting and parsing.
00075     String^ decimal1 = decimalFormat->Format(decimalNumber);
00076     double decimal1Parsed = decimalFormat->ParseDouble(decimal1)->Value;
00077
00078     String^ decimal1JP = decimalFormatJP->Format(decimalNumber);
00079     double decimal1JPParsed = decimalFormatJP->ParseDouble(decimal1JP)->Value;
00080
00081     String^ decimal1FR = decimalFormatFR->Format(decimalNumber);
00082     double decimal1FRParsed = decimalFormatFR->ParseDouble(decimal1FR)->Value;
00083
00084     // Generate the results for decimal parsing.
00085     String^ results2 = "Decimal parsing of " + decimalNumber + "\n" +
00086     "Formatted for current user: " + decimal1   + " Parsed as current user: " + decimal1Parsed   + "\n" +
00087     "Formatted for ja-JP: "        + decimal1JP + " Parsed for ja-JP: "       + decimal1JPParsed + "\n" +
00088     "Formatted for fr-FR: "        + decimal1FR + " Parsed for fr-FR: "       + decimal1FRParsed;
00089
00090     // Roundtrip the currency numbers for formatting and parsing.
00091     String^ currency1 = currencyFormat->Format(currencyNumber);
00092     double currency1Parsed = currencyFormat->ParseDouble(currency1)->Value;
00093
00094     String^ currency1JP = currencyFormatJP->Format(currencyNumber);
00095     double currency1JPParsed = currencyFormatJP->ParseDouble(currency1JP)->Value;
00096
00097     String^ currency1FR = currencyFormatFR->Format(currencyNumber);
00098     double currency1FRParsed = currencyFormatFR->ParseDouble(currency1FR)->Value;
00099
00100     // Generate the results for decimal parsing.
00101     String^ results3 = "Currency parsing of " + currencyNumber + "\n" +
00102     "Formatted for current user: " + currency1   + " Parsed as current user: " + currency1Parsed   + "\n" +
00103     "Formatted for ja-JP: "        + currency1JP + " Parsed for ja-JP: "       + currency1JPParsed + "\n" +
00104     "Formatted for fr-FR: "        + currency1FR + " Parsed for fr-FR: "       + currency1FRParsed;
00105
00106     // Display the results.
00107     String^ results = results1 + "\n\n" + results2 + "\n\n" + results3;
00108     OutputTextBlock->Text = results;
00109 }
Generated on Fri Nov 15 2024 22:20:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/Scenario1_Render.cpp Source File

  • PdfDocument
  • cppwinrt

Scenario1_Render.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Render.h"
00014 #include "Scenario1_Render.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Data::Pdf;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Storage;
00020 using namespace winrt::Windows::Storage::Streams;
00021 using namespace winrt::Windows::Storage::Pickers;
00022 using namespace winrt::Windows::UI::Core;
00023 using namespace winrt::Windows::UI::Xaml;
00024 using namespace winrt::Windows::UI::Xaml::Media::Imaging;
00025
00026
00027 namespace winrt::SDKTemplate::implementation
00028 {
00029     Scenario1_Render::Scenario1_Render()
00030     {
00031         InitializeComponent();
00032     }
00033
00034     fire_and_forget Scenario1_Render::LoadDocument(IInspectable const&, RoutedEventArgs const&)
00035     {
00036         auto lifetime = get_strong();
00037
00038         LoadButton().IsEnabled(false);
00039
00040         pdfDocument = nullptr;
00041         Output().Source(nullptr);
00042         PageNumberBox().Text(L"1");
00043         RenderingPanel().Visibility(Visibility::Collapsed);
00044
00045         FileOpenPicker picker;
00046
00047         picker.FileTypeFilter().Append(L".pdf");
00048         StorageFile file = co_await picker.PickSingleFileAsync();
00049
00050         if (file != nullptr)
00051         {
00052             ProgressControl().Visibility(Visibility::Visible);
00053             try
00054             {
00055                 pdfDocument = co_await PdfDocument::LoadFromFileAsync(file, PasswordBox().Password());
00056             }
00057             catch (winrt::hresult_error const& ex)
00058             {
00059                 switch (ex.to_abi())
00060                 {
00061                 case __HRESULT_FROM_WIN32(ERROR_WRONG_PASSWORD):
00062                     rootPage.NotifyUser(L"Document is password-protected and password is incorrect.", NotifyType::ErrorMessage);
00063                     break;
00064
00065                 case E_FAIL:
00066                     rootPage.NotifyUser(L"Document is not a valid PDF.", NotifyType::ErrorMessage);
00067                     break;
00068
00069                 default:
00070                     // File I/O errors are reported as exceptions.
00071                     rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
00072                     break;
00073                 }
00074             }
00075
00076             if (pdfDocument != nullptr)
00077             {
00078                 RenderingPanel().Visibility(Visibility::Visible);
00079                 if (pdfDocument.IsPasswordProtected())
00080                 {
00081                     rootPage.NotifyUser(L"Document is password protected.", NotifyType::StatusMessage);
00082                 }
00083                 else
00084                 {
00085                     rootPage.NotifyUser(L"Document is not password protected.", NotifyType::StatusMessage);
00086                 }
00087                 PageCountText().Text(winrt::to_hstring(pdfDocument.PageCount()));
00088             }
00089             ProgressControl().Visibility(Visibility::Collapsed);
00090         }
00091         LoadButton().IsEnabled(true);
00092     }
00093
00094     fire_and_forget Scenario1_Render::ViewPage(IInspectable const&, RoutedEventArgs const&)
00095     {
00096         auto lifetime = get_strong();
00097
00098         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00099
00100         // If the text is not a valid number, then wcstoul returns 0, which is an invalid
00101         // page number, so we don't need to special-case that possibility.
00102         unsigned long pageNumber = wcstoul(PageNumberBox().Text().data(), nullptr, 10);
00103
00104         if ((pageNumber < 1) || (pageNumber > pdfDocument.PageCount()))
00105         {
00106             rootPage.NotifyUser(L"Invalid page number.", NotifyType::ErrorMessage);
00107             return;
00108         }
00109
00110         Output().Source(nullptr);
00111         ProgressControl().Visibility(Visibility::Visible);
00112
00113         // Convert from 1-based page number to 0-based page index.
00114         unsigned long pageIndex = pageNumber - 1;
00115
00116         PdfPage page = pdfDocument.GetPage(pageIndex);
00117
00118         InMemoryRandomAccessStream stream;
00119
00120         switch (Options().SelectedIndex())
00121         {
00122             // View actual size.
00123         case 0:
00124             co_await page.RenderToStreamAsync(stream);
00125             break;
00126
00127             // View half size on beige background.
00128         case 1:
00129         {
00130             auto options1 = PdfPageRenderOptions();
00131             options1.BackgroundColor(Windows::UI::Colors::Beige());
00132             options1.DestinationHeight(static_cast<unsigned int>(page.Size().Height / 2));
00133             options1.DestinationWidth(static_cast<unsigned int>(page.Size().Width / 2));
00134             co_await page.RenderToStreamAsync(stream, options1);
00135             break;
00136         }
00137
00138         // Crop to center.
00139         case 2:
00140         {
00141             auto options2 = PdfPageRenderOptions();
00142             auto rect = page.Dimensions().TrimBox();
00143             options2.SourceRect({ rect.X + rect.Width / 4, rect.Y + rect.Height / 4, rect.Width / 2, rect.Height / 2 });
00144             co_await page.RenderToStreamAsync(stream, options2);
00145             break;
00146         }
00147         }
00148
00149         BitmapImage src;
00150         Output().Source(src);
00151         co_await src.SetSourceAsync(stream);
00152
00153         ProgressControl().Visibility(Visibility::Collapsed);
00154     }
00155 }
Generated on Fri Nov 15 2024 22:20:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/FelicaAccessHandler.cs Source File

  • Nfc
  • PcscSdk

FelicaAccessHandler.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Threading.Tasks;
00013 using Windows.Devices.SmartCards;
00014 using System.Runtime.InteropServices.WindowsRuntime;
00015 using Windows.Storage.Streams;
00016
00017 using Pcsc;
00018 using System;
00019
00020 namespace Felica
00021 {
00022     /// <summary>
00023     /// Access handler class for Felica based ICC. It provides wrappers for different Felica
00024     /// commands
00025     /// </summary>
00026     public class AccessHandler
00027     {
00028         /// <summary>
00029         /// connection object to smart card
00030         /// </summary>
00031         private SmartCardConnection connectionObject { set; get; }
00032         /// <summary>
00033         /// Class constructor
00034         /// </summary>
00035         /// <param name="ScConnection">
00036         /// connection object to a Felica ICC
00037         /// </param>
00038         public AccessHandler(SmartCardConnection ScConnection)
00039         {
00040             connectionObject = ScConnection;
00041         }
00042         /// <summary>
00043         /// Wrapper method to read data from the felica card
00044         /// </summary>
00045         /// <param name="serviceCount">
00046         /// The number of service
00047         /// </param>
00048         /// <param name="serviceCodeList">
00049         /// The service code list in little endian format
00050         /// </param>
00051         /// </param>
00052         /// <param name="blockCount">
00053         /// The number of blocks to read
00054         /// </param>
00055         /// </param>
00056         /// <param name="blockList">
00057         /// The list of blocks to be read. Must be multiples of 2 or 3.
00058         /// </param>
00059         /// <returns>
00060         /// byte array of the read data
00061         /// </returns>
00062         public async Task<byte[]> ReadAsync(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)
00063         {
00064             if (serviceCount != 1 || serviceCodeList.Length != 2)
00065             {
00066                 throw new NotSupportedException();
00067             }
00068
00069             var apduRes = await connectionObject.TransceiveAsync(new Felica.Check(serviceCount, serviceCodeList, blockCount, blockList));
00070
00071             if (!apduRes.Succeeded)
00072             {
00073                 throw new Exception("Failure reading Felica card, " + apduRes.ToString());
00074             }
00075
00076             return apduRes.ResponseData;
00077         }
00078         /// <summary>
00079         /// Wrapper method to write data to the felica card
00080         /// </summary>
00081         /// <param name="serviceCount">
00082         /// The number of service
00083         /// </param>
00084         /// <param name="serviceCodeList">
00085         /// The service code list in little endian format
00086         /// </param>
00087         /// </param>
00088         /// <param name="blockCount">
00089         /// The number of blocks to read
00090         /// </param>
00091         /// </param>
00092         /// <param name="blockList">
00093         /// The list of blocks to be read. Must be multiples of 2 or 3.
00094         /// </param>
00095         /// /// <param name="blockData">
00096         /// The data to write for the corresponding blocks. Must be multiple of 16 of the block count.
00097         /// </param>
00098         public async Task WriteAsync(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)
00099         {
00100             if (serviceCount != 1 || serviceCodeList.Length != 2)
00101             {
00102                 throw new NotSupportedException();
00103             }
00104
00105             if (blockData.Length != blockCount * 16)
00106             {
00107                 throw new InvalidOperationException("Invalid blockData size");
00108             }
00109
00110             var apduRes = await connectionObject.TransceiveAsync(new Felica.Update(serviceCount, serviceCodeList, blockCount, blockList, blockData));
00111
00112             if (!apduRes.Succeeded)
00113             {
00114                 throw new Exception("Failure writing Felica card, " + apduRes.ToString());
00115             }
00116         }
00117         /// <summary>
00118         /// Wrapper method to perform transparent transceive data to the felica card
00119         /// </summary>
00120         /// <param name="commandData">
00121         /// The command to send to the felica card
00122         /// </param>
00123         /// <returns>
00124         /// byte array of the read data
00125         /// </returns>
00126         public async Task<byte[]> TransparentExchangeAsync(byte[] commandData)
00127         {
00128             byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);
00129
00130             return responseData;
00131         }
00132         /// <summary>
00133         /// Wrapper method get the Felica UID
00134         /// </summary>
00135         /// <returns>
00136         /// byte array UID
00137         /// </returns>
00138         public async Task<byte[]> GetUidAsync()
00139         {
00140             var apduRes = await connectionObject.TransceiveAsync(new Felica.GetUid());
00141
00142             if (!apduRes.Succeeded)
00143             {
00144                 throw new Exception("Failure getting UID of Felica card, " + apduRes.ToString());
00145             }
00146
00147             return apduRes.ResponseData;
00148         }
00149     }
00150 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SystemMediaTransportControls/cs/Scenario1.xaml.cs Source File

  • SystemMediaTransportControls
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Media;
00020 using Windows.UI.Xaml.Navigation;
00021 using Windows.Media;
00022 using Windows.Storage;
00023 using Windows.Storage.Pickers;
00024 using Windows.Storage.Streams;
00025 using System.Diagnostics;
00026 using Windows.Media.Playback;
00027 using Windows.Media.Core;
00028
00029 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00030
00031 namespace SDKTemplate
00032 {
00033     /// <summary>
00034     /// Page for scenario 1 of our sample.
00035     /// </summary>
00036     public sealed partial class Scenario1
00037     {
00038         private MainPage rootPage = null;
00039         private bool isInitialized = false;
00040
00041         /// <summary>
00042         /// Indicates whether this scenario page is still active. Changes value during navigation
00043         /// to or away from the page.
00044         /// </summary>
00045         private bool isThisPageActive = false;
00046
00047         // same type as returned from Windows.Storage.Pickers.FileOpenPicker.PickMultipleFilesAsync()
00048         private IReadOnlyList<StorageFile> playlist = null;
00049
00050         /// <summary>
00051         /// index to current media item in playlist
00052         /// </summary>
00053         private int currentItemIndex = 0;
00054
00055         /// <summary>
00056         /// Indicates whetehr to stat the playlist again upon reaching the end.
00057         /// </summary>
00058         private bool repeatPlaylist = false;
00059
00060         private SystemMediaTransportControls systemMediaControls = null;
00061
00062         private DispatcherTimer smtcPositionUpdateTimer = null;
00063
00064         private bool pausedDueToMute = false;
00065
00066         private MediaPlayer mediaPlayer;
00067
00068         private MediaPlaybackItem mediaPlaybackItem;
00069
00070         public Scenario1()
00071         {
00072             this.InitializeComponent();
00073         }
00074
00075         /// <summary>
00076         /// Invoked when this page is about to be displayed in a Frame.
00077         /// </summary>
00078         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00079         /// property is typically used to configure the page.</param>
00080         protected override void OnNavigatedTo(NavigationEventArgs e)
00081         {
00082             // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00083             // as NotifyUser()
00084             rootPage = MainPage.Current;
00085             isThisPageActive = true;
00086
00087             // retrieve the SystemMediaTransportControls object, register for its events, and configure it
00088             // to a disabled state consistent with how this scenario starts off (ie. no media loaded)
00089             SetupSystemMediaTransportControls();
00090
00091             if (!isInitialized)
00092             {
00093                 isInitialized = true;
00094
00095                 // Create a new MediaPlayer and assign it to the element for video rendering
00096                 mediaPlayer = new MediaPlayer();
00097                 mediaPlayerElement.SetMediaPlayer(mediaPlayer);
00098
00099                 // MediaPlayer has automatic integration with SMTC. This sample demonstrates manual
00100                 // integration with SMTC, and so we disable the MediaPlayer's CommandManager.
00101                 // Unless you have a need to manually integrate with SMTC, it is recommended that
00102                 // you use the built-in integration through CommandManager instead of the
00103                 // procedures demonstrated throughout this sample.
00104                 mediaPlayer.CommandManager.IsEnabled = false;
00105
00106                 mediaPlayer.PlaybackSession.PlaybackStateChanged += mediaPlayer_PlaybackStateChanged;
00107                 mediaPlayer.MediaOpened += mediaPlayer_MediaOpened;
00108                 mediaPlayer.MediaEnded += mediaPlayer_MediaEnded;
00109                 mediaPlayer.MediaFailed += mediaPlayer_MediaFailed;
00110
00111                 smtcPositionUpdateTimer = new DispatcherTimer();
00112                 smtcPositionUpdateTimer.Interval = TimeSpan.FromSeconds(5);
00113                 smtcPositionUpdateTimer.Tick += positionUpdate_TimerTick;
00114             }
00115         }
00116
00117         private void positionUpdate_TimerTick(object sender, object e)
00118         {
00119             UpdateSmtcPosition();
00120         }
00121
00122         /// <summary>
00123         /// Invoked when we are about to leave this page.
00124         /// </summary>
00125         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00126         /// property is typically used to configure the page.</param>
00127         protected override void OnNavigatedFrom(NavigationEventArgs e)
00128         {
00129             isThisPageActive = false;
00130             rootPage = null;
00131
00132             // Because the system media transport control object is associated with the current app view
00133             // (ie. window), all scenario pages in this sample will be using the same instance. Therefore
00134             // we need to remove the event handlers specific to this scenario page before
00135             // user navigates away to another scenario in the sample.
00136             systemMediaControls.ButtonPressed -= systemMediaControls_ButtonPressed;
00137             systemMediaControls.PlaybackRateChangeRequested -= systemMediaControls_PlaybackRateChangeRequested;
00138             systemMediaControls.PlaybackPositionChangeRequested -= systemMediaControls_PlaybackPositionChangeRequested;
00139             systemMediaControls.AutoRepeatModeChangeRequested -= systemMediaControls_AutoRepeatModeChangeRequested;
00140
00141             // Perform other cleanup for this scenario page.
00142             mediaPlayer.Source = null;
00143             playlist = null;
00144             currentItemIndex = 0;
00145         }
00146
00147         /// <summary>
00148         /// Invoked from this scenario page's OnNavigatedTo event handler.  Retrieve and initialize the
00149         /// SystemMediaTransportControls object.
00150         /// </summary>
00151         private void SetupSystemMediaTransportControls()
00152         {
00153             // Retrieve the SystemMediaTransportControls object associated with the current app view
00154             // (ie. window).  There is exactly one instance of the object per view, instantiated by
00155             // the system the first time GetForCurrentView() is called for the view.  All subsequent
00156             // calls to GetForCurrentView() from the same view (eg. from different scenario pages in
00157             // this sample) will return the same instance of the object.
00158             systemMediaControls = SystemMediaTransportControls.GetForCurrentView();
00159
00160             // This scenario will always start off with no media loaded, so we will start off disabling the
00161             // system media transport controls.  Doing so will hide the system UI for media transport controls
00162             // from being displayed, and will prevent the app from receiving any events such as ButtonPressed
00163             // from it, regardless of the current state of event registrations and button enable/disable states.
00164             // This makes IsEnabled a handy way to turn system media transport controls off and back on, as you
00165             // may want to do when the user navigates to and away from certain parts of your app.
00166             systemMediaControls.IsEnabled = false;
00167
00168             // To receive notifications for the user pressing media keys (eg. "Stop") on the keyboard, or
00169             // clicking/tapping on the equivalent software buttons in the system media transport controls UI,
00170             // all of the following needs to be true:
00171             //     1. Register for ButtonPressed event on the SystemMediaTransportControls object.
00172             //     2. IsEnabled property must be true to enable SystemMediaTransportControls itself.
00173             //        [Note: IsEnabled is initialized to true when the system instantiates the
00174             //         SystemMediaTransportControls object for the current app view.]
00175             //     3. For each button you want notifications from, set the corresponding property to true to
00176             //        enable the button.  For example, set IsPlayEnabled to true to enable the "Play" button
00177             //        and media key.
00178             //        [Note: the individual button-enabled properties are initialized to false when the
00179             //         system instantiates the SystemMediaTransportControls object for the current app view.]
00180             //
00181             // Here we'll perform 1, and 3 for the buttons that will always be enabled for this scenario (Play,
00182             // Pause, Stop).  For 2, we purposely set IsEnabled to false to be consistent with the scenario's
00183             // initial state of no media loaded.  Later in the code where we handle the loading of media
00184             // selected by the user, we will enable SystemMediaTransportControls.
00185             systemMediaControls.ButtonPressed += systemMediaControls_ButtonPressed;
00186
00187             // Add event handlers to support requests from the system to change our playback state.
00188             systemMediaControls.PlaybackRateChangeRequested += systemMediaControls_PlaybackRateChangeRequested;
00189             systemMediaControls.PlaybackPositionChangeRequested += systemMediaControls_PlaybackPositionChangeRequested;
00190             systemMediaControls.AutoRepeatModeChangeRequested += systemMediaControls_AutoRepeatModeChangeRequested;
00191
00192             // Subscribe to property changed events to get SoundLevel changes.
00193             systemMediaControls.PropertyChanged += systemMediaControls_PropertyChanged;
00194
00195             // Note: one of the prerequisites for an app to be allowed to play audio while in background,
00196             // is to enable handling Play and Pause ButtonPressed events from SystemMediaTransportControls.
00197             systemMediaControls.IsPlayEnabled = true;
00198             systemMediaControls.IsPauseEnabled = true;
00199             systemMediaControls.IsStopEnabled = true;
00200             systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Closed;
00201         }
00202
00203         private async void systemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
00204         {
00205             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00206             {
00207                 if (args.Property == SystemMediaTransportControlsProperty.SoundLevel)
00208                 {
00209                     // Check for the new Sound level
00210                     switch (systemMediaControls.SoundLevel)
00211                     {
00212                         case SoundLevel.Full:
00213                         case SoundLevel.Low:
00214                             // If we had paused due to system mute, then resume on unmute.
00215                             if (pausedDueToMute)
00216                             {
00217                                 mediaPlayer.Play();
00218                                 pausedDueToMute = false;
00219                             }
00220                             break;
00221                         case SoundLevel.Muted:
00222                             // We've been muted by the system. Pause playback to release resources.
00223                             if (mediaPlayer != null && mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00224                             {
00225                                 mediaPlayer.Pause();
00226                                 pausedDueToMute = true;
00227                             }
00228                             break;
00229                     }
00230                 }
00231             });
00232         }
00233
00234         private async void systemMediaControls_AutoRepeatModeChangeRequested(SystemMediaTransportControls sender, AutoRepeatModeChangeRequestedEventArgs args)
00235         {
00236             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00237             {
00238                 // MediaPlayer only supports repeating a track, if we want to repeat a list we need to handle it ourselves (or use a MediaPlaybackList)
00239                 switch (args.RequestedAutoRepeatMode)
00240                 {
00241                     case MediaPlaybackAutoRepeatMode.None:
00242                         mediaPlayer.IsLoopingEnabled = false;
00243                         repeatPlaylist = false;
00244                         break;
00245                     case MediaPlaybackAutoRepeatMode.List:
00246                         mediaPlayer.IsLoopingEnabled = false;
00247                         repeatPlaylist = true;
00248                         break;
00249                     case MediaPlaybackAutoRepeatMode.Track:
00250                         mediaPlayer.IsLoopingEnabled = true;
00251                         repeatPlaylist = false;
00252                         break;
00253                 }
00254
00255                 // Report back our new state as whatever was requested, seeing as we always honor it.
00256                 systemMediaControls.AutoRepeatMode = args.RequestedAutoRepeatMode;
00257                 rootPage.NotifyUser("Auto repeat mode change requested", NotifyType.StatusMessage);
00258             });
00259         }
00260
00261
00262         /// <summary>
00263         /// Used to update all position/duration related information to the SystemMediaTransport controls.
00264         /// Can be used when some state changes (new track, position changed) or periodically (every 5 seconds or so)
00265         /// to keep the system in sync with this apps playback state.
00266         /// </summary>
00267         private void UpdateSmtcPosition()
00268         {
00269             var timelineProperties = new SystemMediaTransportControlsTimelineProperties();
00270
00271             // This is a simple scenario that supports seeking, therefore start time and min seek are both 0 and
00272             // end time and max seek are both the duration. This allows the system to suggest seeking anywhere in the track.
00273             // Position is the current player position.
00274
00275             // Note: More complex scenarios may alter more of these values, such as only allowing seeking in a section of the content,
00276             // by setting min and max seek differently to start and end. For other scenarios such as live playback, end time may be
00277             // updated frequently too.
00278             timelineProperties.StartTime = TimeSpan.FromSeconds(0);
00279             timelineProperties.MinSeekTime = TimeSpan.FromSeconds(0);
00280             timelineProperties.Position = mediaPlayer.PlaybackSession.Position;
00281             timelineProperties.MaxSeekTime = mediaPlayer.PlaybackSession.NaturalDuration;
00282             timelineProperties.EndTime = mediaPlayer.PlaybackSession.NaturalDuration;
00283
00284             systemMediaControls.UpdateTimelineProperties(timelineProperties);
00285         }
00286
00287         /// <summary>
00288         /// Handles a request from the System Media Transport Controls to change our current playback position.
00289         /// </summary>
00290         private async void systemMediaControls_PlaybackPositionChangeRequested(SystemMediaTransportControls sender, PlaybackPositionChangeRequestedEventArgs args)
00291         {
00292             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00293             {
00294                 // First we validate that the requested position falls within the range of the current piece of content we are playing,
00295                 // this should usually be the case but the content may have changed whilst the request was coming in.
00296                 if (args.RequestedPlaybackPosition.Duration() <= mediaPlayer.PlaybackSession.NaturalDuration.Duration() &&
00297                 args.RequestedPlaybackPosition.Duration().TotalSeconds >= 0)
00298                 {
00299                     // Next we verify that our player is in a state that we think is valid to change the position
00300                     if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused || mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00301                     {
00302                         // Finally if the above conditions are met we update the position and report the new position back to SMTC.
00303                         mediaPlayer.PlaybackSession.Position = args.RequestedPlaybackPosition.Duration();
00304                         UpdateSmtcPosition();
00305                     }
00306                 }
00307
00308                 rootPage.NotifyUser("Playback position change requested", NotifyType.StatusMessage);
00309             });
00310         }
00311
00312         /// <summary>
00313         /// Handles a request from the System Media Transport Controls to change our current playback rate
00314         /// </summary>
00315         private async void systemMediaControls_PlaybackRateChangeRequested(SystemMediaTransportControls sender, PlaybackRateChangeRequestedEventArgs args)
00316         {
00317             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00318             {
00319                 // Check to make sure the requested value is in a range we deem appropriate, if so set it on the MediaPlayer.
00320                 // We then need to turn around and update SMTC so that the system knows the new value.
00321                 if (args.RequestedPlaybackRate >= 0 && args.RequestedPlaybackRate <= 2)
00322                 {
00323                     mediaPlayer.PlaybackSession.PlaybackRate = args.RequestedPlaybackRate;
00324                     systemMediaControls.PlaybackRate = mediaPlayer.PlaybackSession.PlaybackRate;
00325                 }
00326
00327                 rootPage.NotifyUser("Playback rate change requested", NotifyType.StatusMessage);
00328             });
00329         }
00330
00331
00332
00333
00334         // For supported audio and video formats, see:
00335         //     http://msdn.microsoft.com/en-us/library/windows/apps/hh986969.aspx
00336         private static string[] supportedAudioFormats = new string[]
00337         {
00338             ".3g2", ".3gp2", ".3gp", ".3gpp", ".m4a", ".mp4", ".asf", ".wma", ".aac", ".adt", ".adts", ".mp3", ".wav", ".ac3", ".ec3",
00339         };
00340
00341         private static string[] supportedVideoFormats = new string[]
00342         {
00343             ".3g2", ".3gp2", ".3gp", ".3gpp", ".m4v", ".mp4v", ".mp4", ".mov", ".m2ts", ".asf", ".wmv", ".avi",
00344         };
00345
00346         /// <summary>
00347         /// Invoked when user invokes the "Select Files" XAML button in the app.
00348         /// Launches the Windows File Picker to let user select a list of audio or video files
00349         //  to play in the app.
00350         /// </summary>
00351         private async void SelectFilesButton_Click(object sender, RoutedEventArgs e)
00352         {
00353             FileOpenPicker filePicker = new FileOpenPicker();
00354             filePicker.ViewMode = PickerViewMode.List;
00355             filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
00356             filePicker.CommitButtonText = "Play";
00357             foreach (string fileExtension in supportedAudioFormats)
00358             {
00359                 filePicker.FileTypeFilter.Add(fileExtension);
00360             }
00361             foreach (string fileExtension in supportedVideoFormats)
00362             {
00363                 filePicker.FileTypeFilter.Add(fileExtension);
00364             }
00365
00366             IReadOnlyList<StorageFile> selectedFiles = await filePicker.PickMultipleFilesAsync();
00367             if (selectedFiles.Count > 0)
00368             {
00369                 rootPage.NotifyUser(String.Format("{0} file(s) selected", selectedFiles.Count), NotifyType.StatusMessage);
00370                 playlist = selectedFiles;
00371
00372                 // Now that we have a playlist ready, allow the user to control media playback via system media
00373                 // transport controls.  We enable it now even if one or more files may turn out unable to load
00374                 // into the MediaPlayer, to allow the user to invoke Next/Previous to go to another
00375                 // item in the playlist to try playing.
00376                 systemMediaControls.IsEnabled = true;
00377
00378                 // For the design of this sample scenario, we will always automatically start playback after
00379                 // the user has selected new files to play.  Set AutoPlay to true so the MediaPlayer
00380                 // will automatically start playing after we set Source on it in SetNewMediaItem().
00381                 mediaPlayer.AutoPlay = true;
00382                 await SetNewMediaItem(0);   // Start with first file in the list of picked files.
00383             }
00384             else
00385             {
00386                 // user canceled the file picker
00387                 rootPage.NotifyUser("no files selected", NotifyType.StatusMessage);
00388             }
00389         }
00390
00391         private async void mediaPlayer_MediaOpened(MediaPlayer sender, object e)
00392         {
00393             // UI updates must happen on dispatcher thread
00394             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00395             {
00396                 if (isThisPageActive)
00397                 {
00398                     if (mediaPlaybackItem.AudioTracks.Count == 0)
00399                     {
00400                         // Ensure the XAML MediaPlayerElement control has enough height and some reasonable width
00401                         // to display the build-in transport controls for audio-only playback.
00402                         mediaPlayerElement.MinWidth = 456;
00403                         mediaPlayerElement.MinHeight = 120;
00404                         mediaPlayerElement.MaxHeight = 120;
00405
00406                         // Force the MediaPlayerElement out of fullscreen mode in case the user was using that
00407                         // for a video playback but we are now loading audio-only content.  The build-in
00408                         // transport controls for audio-only playback do not have the button to
00409                         // enter/exit fullscreen mode.
00410                         mediaPlayerElement.IsFullWindow = false;
00411                     }
00412                     else
00413                     {
00414                         // For video playback, let XAML resize MediaPlayerElement control based on the dimensions
00415                         // of the video, but also have XAML scale it down as necessary (preserving aspect ratio)
00416                         // to a reasonable maximum height like 300.
00417                         mediaPlayerElement.MinWidth = 0;
00418                         mediaPlayerElement.MinHeight = 0;
00419                         mediaPlayerElement.MaxHeight = 300;
00420                     }
00421                 }
00422             });
00423         }
00424
00425         private async void mediaPlayer_MediaEnded(MediaPlayer sender, object e)
00426         {
00427             if (isThisPageActive)
00428             {
00429                 if (currentItemIndex < playlist.Count - 1)
00430                 {
00431                     // Current media must've been playing if we received an event about it ending.
00432                     // The design of this sample scenario is to automatically start playing the next
00433                     // item in the playlist.  So we'll set the AutoPlay property to true, then in
00434                     // SetNewMediaItem() when we eventually set Source on the MediaPlayer,
00435                     // it will automatically playing the new media item.
00436                     mediaPlayer.AutoPlay = true;
00437                     await SetNewMediaItem(currentItemIndex + 1);
00438                 }
00439                 else
00440                 {
00441                     // End of playlist reached.
00442                     if (repeatPlaylist)
00443                     {
00444                         // Playlist repeat was selected so start again.
00445                         mediaPlayer.AutoPlay = true;
00446                         await SetNewMediaItem(0);
00447                         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => // UI updates must happen on dispatcher thread
00448                         {
00449                             rootPage.NotifyUser("end of playlist, starting playback again at beginning of playlist", NotifyType.StatusMessage);
00450                         });
00451                     }
00452                     else
00453                     {
00454                         // Repeat wasn't selected so just stop playback.
00455                         mediaPlayer.AutoPlay = false;
00456                         mediaPlayer.Pause();
00457                         mediaPlayer.PlaybackSession.Position = TimeSpan.Zero;
00458                         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00459                         {
00460                             rootPage.NotifyUser("end of playlist, stopping playback", NotifyType.StatusMessage);
00461                         });
00462                     }
00463                 }
00464             }
00465         }
00466
00467         private async void mediaPlayer_MediaFailed(MediaPlayer sender, MediaPlayerFailedEventArgs e)
00468         {
00469             // UI updates must happen on dispatcher thread
00470             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00471             {
00472                 if (isThisPageActive)
00473                 {
00474                     string errorMessage = String.Format(@"Cannot play {0} [""{1}""]." +
00475                         "\nPress Next or Previous to continue, or select new files to play.",
00476                         playlist[currentItemIndex].Name,
00477                         e.ErrorMessage.Trim());
00478
00479                     rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
00480                 }
00481             });
00482         }
00483
00484         /// <summary>
00485         /// Updates the SystemMediaTransportControls' PlaybackStatus property based on the PlaybackState property of the
00486         /// MediaPlayer.
00487         /// </summary>
00488         /// <remarks>Invoked mainly from the MediaPlayer's PlaybackStateChanged event handler.</remarks>
00489         private void SyncPlaybackStatusToMediaPlayerState()
00490         {
00491             // Updating PlaybackStatus with accurate information is important; for example, it determines whether the system media
00492             // transport controls UI will show a play vs pause software button, and whether hitting the play/pause toggle key on
00493             // the keyboard will translate to a Play vs a Pause ButtonPressed event.
00494             //
00495             // Even if your app uses its own custom transport controls in place of the built-in ones from XAML, it is still a good
00496             // idea to update PlaybackStatus in response to the MediaPlayer's PlaybackStateChanged event.  Windows supports scenarios
00497             // such as streaming media from a MediaPlayer to a networked device (eg. TV) selected by the user from Devices charm
00498             // (ie. "Play To"), in which case the user may pause and resume media streaming using a TV remote or similar means.
00499             // The CurrentStateChanged event may be the only way to get notified of playback status changes in those cases.
00500             switch (mediaPlayer.PlaybackSession.PlaybackState)
00501             {
00502                 case MediaPlaybackState.None:
00503                     systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Closed;
00504                     break;
00505
00506                 case MediaPlaybackState.Opening:
00507                     // This state is when new media is being loaded to the MediaPlayer [ie.
00508                     // Source].  For this sample the design is to maintain the previous playing/pause
00509                     // state before the new media is being loaded.  So we'll leave the PlaybackStatus alone
00510                     // during loading.  This keeps the system UI from flickering between displaying a "Play"
00511                     // vs "Pause" software button during the transition to a new media item.
00512                     break;
00513
00514                 case MediaPlaybackState.Buffering:
00515                     // No updates in MediaPlaybackStatus necessary--buffering is just
00516                     // a transitional state where the system is still working to get
00517                     // media to start or to continue playing.
00518                     break;
00519
00520                 case MediaPlaybackState.Paused:
00521                     if (mediaPlayer.PlaybackSession.Position == TimeSpan.Zero)
00522                         systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Stopped;
00523                     else
00524                         systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;
00525                     break;
00526
00527                 case MediaPlaybackState.Playing:
00528                     systemMediaControls.PlaybackStatus = MediaPlaybackStatus.Playing;
00529                     break;
00530
00531             }
00532
00533             // If we started playing start our timer else make sure it's stopped.
00534             // On state changed always send an update to keep the system in sync.
00535             if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00536             {
00537                 smtcPositionUpdateTimer.Start();
00538             }
00539             else
00540             {
00541                 smtcPositionUpdateTimer.Stop();
00542             }
00543
00544             UpdateSmtcPosition();
00545
00546             UpdateCustomTransportControls();
00547         }
00548
00549         private async void mediaPlayer_PlaybackStateChanged(MediaPlaybackSession sender, object e)
00550         {
00551             // UI updates must happen on dispatcher thread
00552             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00553             {
00554                 if (!isThisPageActive)
00555                 {
00556                     return;
00557                 }
00558
00559                 // For the design of this sample, the general idea is that if user is playing
00560                 // media when Next/Previous is invoked, we will automatically start playing
00561                 // the new item once it has loaded.  Whereas if the user has paused or stopped
00562                 // media playback when Next/Previous is invoked, we won't automatically start
00563                 // playing the new item.  In other words, we maintain the user's intent to
00564                 // play or not play across changing the media.  This is most easily handled
00565                 // using the AutoPlay property of the MediaPlayer.
00566                 if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00567                 {
00568                     mediaPlayer.AutoPlay = true;
00569                 }
00570                 else if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.None ||
00571                          mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
00572                 {
00573                     mediaPlayer.AutoPlay = false;
00574                 }
00575
00576                 // Update the playback status tracked by SystemMediaTransportControls.  See comments
00577                 // in SyncPlaybackStatusToMediaPlayerState()'s body for why this is important.
00578                 SyncPlaybackStatusToMediaPlayerState();
00579             });
00580         }
00581
00582         private async void systemMediaControls_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs args)
00583         {
00584             // The system media transport control's ButtonPressed event may not fire on the app's UI thread.  XAML controls
00585             // (including the MediaPlayerElement control in our page as well as the scenario page itself) typically can only be
00586             // safely accessed and manipulated on the UI thread, so here for simplicity, we dispatch our entire event handling
00587             // code to execute on the UI thread, as our code here primarily deals with updating the UI and the MediaPlayerElement.
00588             //
00589             // Depending on how exactly you are handling the different button presses (which for your app may include buttons
00590             // not used in this sample scenario), you may instead choose to only dispatch certain parts of your app's
00591             // event handling code (such as those that interact with XAML) to run on UI thread.
00592             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00593             {
00594                 // Because the handling code is dispatched asynchronously, it is possible the user may have
00595                 // navigated away from this scenario page to another scenario page by the time we are executing here.
00596                 // Check to ensure the page is still active before proceeding.
00597                 if (isThisPageActive)
00598                 {
00599                     switch (args.Button)
00600                     {
00601                         case SystemMediaTransportControlsButton.Play:
00602                             rootPage.NotifyUser("Play pressed", NotifyType.StatusMessage);
00603                             mediaPlayer.Play();
00604                             break;
00605
00606                         case SystemMediaTransportControlsButton.Pause:
00607                             rootPage.NotifyUser("Pause pressed", NotifyType.StatusMessage);
00608                             mediaPlayer.Pause();
00609                             break;
00610
00611                         case SystemMediaTransportControlsButton.Stop:
00612                             rootPage.NotifyUser("Stop pressed", NotifyType.StatusMessage);
00613                             mediaPlayer.Pause();
00614                             mediaPlayer.PlaybackSession.Position = TimeSpan.Zero;
00615                             break;
00616
00617                         case SystemMediaTransportControlsButton.Next:
00618                             rootPage.NotifyUser("Next pressed", NotifyType.StatusMessage);
00619                             // range-checking will be performed in SetNewMediaItem()
00620                             await SetNewMediaItem(currentItemIndex + 1);
00621                             break;
00622
00623                         case SystemMediaTransportControlsButton.Previous:
00624                             rootPage.NotifyUser("Previous pressed", NotifyType.StatusMessage);
00625                             // range-checking will be performed in SetNewMediaItem()
00626                             await SetNewMediaItem(currentItemIndex - 1);
00627                             break;
00628
00629                             // Insert additional case statements for other buttons you want to handle in your app.
00630                             // Remember that you also need to first enable those buttons via the corresponding
00631                             // Is****Enabled property on the SystemMediaTransportControls object.
00632                     }
00633                 }
00634             });
00635         }
00636
00637         /// <summary>
00638         /// Returns an appropriate MediaPlaybackType value based on the given StorageFile's ContentType (MIME type).
00639         /// </summary>
00640         /// <returns>
00641         /// One of the three valid MediaPlaybackType enum values, or MediaPlaybackType.Unknown if the ContentType
00642         /// is not a media type (audio, video, image) or cannot be determined.
00643         //  </returns>
00644         /// <remarks>
00645         /// For use with SystemMediaTransportControlsDisplayUpdater.CopyFromFileAsync() in UpdateSystemMediaControlsDisplayAsync().
00646         /// </remarks>
00647         private MediaPlaybackType GetMediaTypeFromFileContentType(StorageFile file)
00648         {
00649             // Determine the appropriate MediaPlaybackType of the media file based on its ContentType (ie. MIME type).
00650             // The MediaPlaybackType determines the information shown in the system UI for the system media transport
00651             // controls.  For example, the CopyFromFileAsync() API method will look for different metadata properties
00652             // from the file to be extracted for eventual display in the system UI, depending on the MediaPlaybackType
00653             // passed to the method.
00654
00655             // NOTE: MediaPlaybackType.Unknown is *not* a valid value to use in SystemMediaTransportControls APIs.
00656             // This method will return MediaPlaybackType.Unknown to indicate no valid MediaPlaybackType exists/can be
00657             // determined for the given StorageFile.
00658             MediaPlaybackType mediaPlaybackType = MediaPlaybackType.Unknown;
00659             string fileMimeType = file.ContentType.ToLowerInvariant();
00660
00661             if (fileMimeType.StartsWith("audio/"))
00662             {
00663                 mediaPlaybackType = MediaPlaybackType.Music;
00664             }
00665             else if (fileMimeType.StartsWith("video/"))
00666             {
00667                 mediaPlaybackType = MediaPlaybackType.Video;
00668             }
00669             else if (fileMimeType.StartsWith("image/"))
00670             {
00671                 mediaPlaybackType = MediaPlaybackType.Image;
00672             }
00673
00674             return mediaPlaybackType;
00675         }
00676
00677         /// <summary>
00678         /// Updates the system UI for media transport controls to display media metadata from the given StorageFile.
00679         /// </summary>
00680         /// <param name="mediaFile">
00681         /// The media file being loaded.  This method will try to extract media metadata from the file for use in
00682         /// the system UI for media transport controls.
00683         /// </param>
00684         private async Task UpdateSystemMediaControlsDisplayAsync(StorageFile mediaFile)
00685         {
00686             MediaPlaybackType mediaType = GetMediaTypeFromFileContentType(mediaFile);
00687
00688             bool copyFromFileAsyncSuccessful = false;
00689             if (MediaPlaybackType.Unknown != mediaType)
00690             {
00691                 // Use the SystemMediaTransportControlsDisplayUpdater's CopyFromFileAsync() API method to try extracting
00692                 // from the StorageFile the relevant media metadata information (eg. track title, artist and album art
00693                 // for MediaPlaybackType.Music), copying them into properties of DisplayUpdater and related classes.
00694                 //
00695                 // In place of using CopyFromFileAsync() [or, you can't use that method because your app's media playback
00696                 // scenario doesn't involve StorageFiles], you can also use other properties in DisplayUpdater and
00697                 // related classes to explicitly set the MediaPlaybackType and media metadata properties to values of
00698                 // your choosing.
00699                 //
00700                 // Usage notes:
00701                 //     - the first argument cannot be MediaPlaybackType.Unknown
00702                 //     - API method may throw an Exception on certain file errors from the passed in StorageFile, such as
00703                 //       file-not-found error (eg. file was deleted after user had picked it from file picker earlier).
00704                 try
00705                 {
00706                     copyFromFileAsyncSuccessful = await systemMediaControls.DisplayUpdater.CopyFromFileAsync(mediaType, mediaFile);
00707                 }
00708                 catch (Exception)
00709
00710                 {
00711                     // For this sample, we will handle this case same as CopyFromFileAsync returning false,
00712                     // though we could provide our own metadata here.
00713                 }
00714             }
00715             else
00716             {
00717                 // If we are here, it means we are unable to determine a MediaPlaybackType based on the StorageFile's
00718                 // ContentType (MIME type).  CopyFromFileAsync() requires a valid MediaPlaybackType (ie. cannot be
00719                 // MediaPlaybackType.Unknown) for the first argument.  One way to handle this is to just pick a valid
00720                 // MediaPlaybackType value to call CopyFromFileAsync() with, based on what your app does (eg. Music
00721                 // if your app is a music player).  The MediaPlaybackType directs the API to look for particular sets
00722                 // of media metadata information from the StorageFile, and extraction is best-effort so in worst case
00723                 // simply no metadata information are extracted.
00724                 //
00725                 // For this sample, we will handle this case the same way as CopyFromFileAsync() returning false
00726             }
00727
00728             if (!isThisPageActive)
00729             {
00730                 // User may have navigated away from this scenario page to another scenario page
00731                 // before the async operation completed.
00732                 return;
00733             }
00734
00735             if (!copyFromFileAsyncSuccessful)
00736             {
00737                 // For this sample, if CopyFromFileAsync() didn't work for us for whatever reasons, we will just
00738                 // clear DisplayUpdater of all previously set metadata, if any.  This makes sure we don't end up
00739                 // displaying in the system UI for media transport controls any stale metadata from the media item
00740                 // we were previously playing.
00741                 systemMediaControls.DisplayUpdater.ClearAll();
00742             }
00743
00744             // Finally update the system UI display for media transport controls with the new values currently
00745             // set in the DisplayUpdater, be it via CopyFrmoFileAsync(), ClearAll(), etc.
00746             systemMediaControls.DisplayUpdater.Update();
00747         }
00748
00749         /// <summary>
00750         /// Performs all necessary actions (including SystemMediaTransportControls related) of loading a new media item
00751         /// in the app for playback.
00752         /// </summary>
00753         /// <param name="newItemIndex">index in playlist of new item to load for playback, can be out of range.</param>
00754         /// <remarks>
00755         /// If the newItemIndex argument is out of range, it will be adjusted accordingly to stay in range.
00756         /// </remarks>
00757         private async Task SetNewMediaItem(int newItemIndex)
00758         {
00759             // enable Next button unless we're on last item of the playlist
00760             if (newItemIndex >= playlist.Count - 1)
00761             {
00762                 systemMediaControls.IsNextEnabled = false;
00763                 newItemIndex = playlist.Count - 1;
00764             }
00765             else
00766             {
00767                 systemMediaControls.IsNextEnabled = true;
00768             }
00769
00770             // enable Previous button unless we're on first item of the playlist
00771             if (newItemIndex <= 0)
00772             {
00773                 systemMediaControls.IsPreviousEnabled = false;
00774                 newItemIndex = 0;
00775             }
00776             else
00777             {
00778                 systemMediaControls.IsPreviousEnabled = true;
00779             }
00780
00781             // note that the Play, Pause and Stop buttons were already enabled via SetupSystemMediaTransportControls()
00782             // invoked during this scenario page's OnNavigateToHandler()
00783
00784
00785             currentItemIndex = newItemIndex;
00786             StorageFile mediaFile = playlist[newItemIndex];
00787             IRandomAccessStream stream = null;
00788             try
00789             {
00790                 stream = await mediaFile.OpenAsync(FileAccessMode.Read);
00791             }
00792             catch (Exception e)
00793             {
00794                 // User may have navigated away from this scenario page to another scenario page
00795                 // before the async operation completed.
00796                 if (isThisPageActive)
00797                 {
00798                     // If the file can't be opened, for this sample we will behave similar to the case of
00799                     // setting a corrupted/invalid media file stream on the MediaPlayer (which triggers a
00800                     // MediaFailed event).  We abort any ongoing playback by nulling the MediaPlayer's
00801                     // source.  The user must press Next or Previous to move to a different media item,
00802                     // or use the file picker to load a new set of files to play.
00803                     mediaPlayer.Source = null;
00804
00805                     string errorMessage = String.Format(@"Cannot open {0} [""{1}""]." +
00806                         "\nPress Next or Previous to continue, or select new files to play.",
00807                         mediaFile.Name,
00808                         e.Message.Trim());
00809                     rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
00810                 }
00811             }
00812
00813             // User may have navigated away from this scenario page to another scenario page
00814             // before the async operation completed. Check to make sure page is still active.
00815             if (!isThisPageActive)
00816             {
00817                 return;
00818             }
00819
00820             if (stream != null)
00821             {
00822                 // We're about to change the MediaPlayer's source media, so put ourselves into a
00823                 // "changing media" state.  We stay in that state until the new media is playing,
00824                 // loaded (if user has currently paused or stopped playback), or failed to load.
00825                 // At those points we will call OnChangingMediaEnded().
00826                 //
00827                 // Note that the SMTC visual state may not update until assigning a source or
00828                 // beginning playback. If using a different API than MediaPlayer, such as AudioGraph,
00829                 // you will need to begin playing a stream to see SMTC update.
00830                 mediaPlaybackItem = new MediaPlaybackItem(MediaSource.CreateFromStream(stream, mediaFile.ContentType));
00831                 mediaPlayer.Source = mediaPlaybackItem;
00832             }
00833
00834             try
00835             {
00836                 // Updates the system UI for media transport controls to display metadata information
00837                 // reflecting the file we are playing (eg. track title, album art/video thumbnail, etc.)
00838                 // We call this even if the mediaFile can't be opened; in that case the method can still
00839                 // update the system UI to remove any metadata information previously displayed.
00840                 await UpdateSystemMediaControlsDisplayAsync(mediaFile);
00841             }
00842             catch (Exception e)
00843             {
00844                 // Check isThisPageActive as user may have navigated away from this scenario page to
00845                 // another scenario page before the async operations completed.
00846                 if (isThisPageActive)
00847                 {
00848                     rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
00849                 }
00850             }
00851         }
00852
00853         /// <summary>
00854         /// Updates the custom transport controls (XAML).
00855         ///
00856         /// For the sake of clarity in this Sample, we'll handle updating our custom transport controls
00857         /// seperately from updating the SystemMediaTransportControls.
00858         ///
00859         /// This should be called on the UI thread.
00860         /// </summary>
00861         private void UpdateCustomTransportControls()
00862         {
00863             // Update the custom controls based upon the state of our playlist.
00864             // We want to match the same state that was previously set on the SystemMediaTransportControls
00865             nextButton.IsEnabled = systemMediaControls.IsNextEnabled;
00866             previousButton.IsEnabled = systemMediaControls.IsPreviousEnabled;
00867
00868             // Update the Play / Pause Toggle button based upon the MediaPlayer's current state
00869             switch (mediaPlayer.PlaybackSession.PlaybackState)
00870             {
00871                 case MediaPlaybackState.None:
00872                     // Revert back to a known play / pause toggle state
00873                     playPauseButton.Content = new SymbolIcon(Symbol.Play);
00874                     playPauseButton.IsEnabled = false;
00875                     break;
00876
00877                 case MediaPlaybackState.Paused:
00878                     playPauseButton.Content = new SymbolIcon(Symbol.Play);
00879                     playPauseButton.IsEnabled = true;
00880                     break;
00881
00882                 case MediaPlaybackState.Playing:
00883                     playPauseButton.Content = new SymbolIcon(Symbol.Pause);
00884                     playPauseButton.IsEnabled = true;
00885                     break;
00886             }
00887         }
00888
00889         /// <summary>
00890         /// Handle the Custom Transport Controls Play / Pause button being clicked.
00891         /// </summary>
00892         /// <param name="sender"></param>
00893         /// <param name="e"></param>
00894         private void playPauseButton_Click(object sender, RoutedEventArgs e)
00895         {
00896             if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
00897             {
00898                 mediaPlayer.Play();
00899                 rootPage.NotifyUser("Custom Transport Controls Play pressed", NotifyType.StatusMessage);
00900             }
00901             else
00902             {
00903                 mediaPlayer.Pause();
00904                 rootPage.NotifyUser("Custom Transport Controls Pause pressed", NotifyType.StatusMessage);
00905             }
00906         }
00907
00908         /// <summary>
00909         /// Handle the Custom Transport Controls SkipNext button click.
00910         /// </summary>
00911         /// <param name="sender"></param>
00912         /// <param name="e"></param>
00913         private async void nextButton_Click(object sender, RoutedEventArgs e)
00914         {
00915             rootPage.NotifyUser("Custom Transport Controls Next pressed", NotifyType.StatusMessage);
00916             // range-checking will be performed in SetNewMediaItem()
00917             await SetNewMediaItem(currentItemIndex + 1);
00918         }
00919
00920         /// <summary>
00921         /// Handle the Custom Transport Controls SkipPrevious button click.
00922         /// </summary>
00923         /// <param name="sender"></param>
00924         /// <param name="e"></param>
00925         private async void previousButton_Click(object sender, RoutedEventArgs e)
00926         {
00927             rootPage.NotifyUser("Custom Transport Controls Previous pressed", NotifyType.StatusMessage);
00928             // range-checking will be performed in SetNewMediaItem()
00929             await SetNewMediaItem(currentItemIndex - 1);
00930         }
00931     }
00932 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario1_Colors.cpp Source File

  • TitleBar
  • cppwinrt

Scenario1_Colors.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Colors.h"
00014 #include "Scenario1_Colors.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI;
00019 using namespace Windows::UI::ViewManagement;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Data;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario1_Colors::Scenario1_Colors()
00026     {
00027         InitializeComponent();
00028
00029         titleBar = ApplicationView::GetForCurrentView().TitleBar();
00030
00031         // Infer the radio button selection from the title bar colors.
00032         if (titleBar.ButtonBackgroundColor() == nullptr)
00033         {
00034             UseStandardColors().IsChecked(true);
00035         }
00036         else if (titleBar.ButtonBackgroundColor().Value().A > 0)
00037         {
00038             UseCustomColors().IsChecked(true);
00039         }
00040         else
00041         {
00042             TransparentWhenExtended().IsChecked(true);
00043         }
00044
00045     }
00046
00047     void Scenario1_Colors::UseCustomColors_Click(IInspectable const&, RoutedEventArgs const&)
00048     {
00049         UpdateColors();
00050     }
00051
00052     void Scenario1_Colors::UpdateColors()
00053     {
00054         if (UseStandardColors().IsChecked().Value())
00055         {
00056             // Setting colors to null returns them to system defaults.
00057             titleBar.BackgroundColor(nullptr);
00058             titleBar.ForegroundColor(nullptr);
00059             titleBar.InactiveBackgroundColor(nullptr);
00060             titleBar.InactiveForegroundColor(nullptr);
00061
00062             titleBar.ButtonBackgroundColor(nullptr);
00063             titleBar.ButtonHoverBackgroundColor(nullptr);
00064             titleBar.ButtonPressedBackgroundColor(nullptr);
00065             titleBar.ButtonInactiveBackgroundColor(nullptr);
00066
00067             titleBar.ButtonForegroundColor(nullptr);
00068             titleBar.ButtonHoverForegroundColor(nullptr);
00069             titleBar.ButtonPressedForegroundColor(nullptr);
00070             titleBar.ButtonInactiveForegroundColor(nullptr);
00071         }
00072         else
00073         {
00074             // Title bar colors. Alpha must be 255.
00075             titleBar.BackgroundColor(ColorHelper::FromArgb(255, 54, 60, 116));
00076             titleBar.ForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
00077             titleBar.InactiveBackgroundColor(ColorHelper::FromArgb(255, 135, 141, 199));
00078             titleBar.InactiveForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
00079
00080             // Title bar button background colors. Alpha is respected when the view is extended
00081             // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
00082             uint8_t buttonAlpha = (uint8_t)(TransparentWhenExtended().IsChecked().Value() ? 0 : 255);
00083             titleBar.ButtonBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 54, 60, 116));
00084             titleBar.ButtonHoverBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 19, 21, 40));
00085             titleBar.ButtonPressedBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 232, 211, 162));
00086             titleBar.ButtonInactiveBackgroundColor(ColorHelper::FromArgb(buttonAlpha, 135, 141, 199));
00087
00088             // Title bar button foreground colors. Alpha must be 255.
00089             titleBar.ButtonForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
00090             titleBar.ButtonHoverForegroundColor(ColorHelper::FromArgb(255, 255, 255, 255));
00091             titleBar.ButtonPressedForegroundColor(ColorHelper::FromArgb(255, 54, 60, 116));
00092             titleBar.ButtonInactiveForegroundColor(ColorHelper::FromArgb(255, 232, 211, 162));
00093         }
00094
00095         m_propertyChanged(*this, PropertyChangedEventArgs(L"TitleBar"));
00096     }
00097
00098     event_token Scenario1_Colors::PropertyChanged(PropertyChangedEventHandler const& handler)
00099     {
00100         return m_propertyChanged.add(handler);
00101     }
00102
00103     void Scenario1_Colors::PropertyChanged(event_token const& token) noexcept
00104     {
00105         m_propertyChanged.remove(token);
00106     }
00107 }
00108
00109 hstring winrt::to_hstring(Windows::Foundation::IReference<Windows::UI::Color> const& value)
00110 {
00111     if (value == nullptr)
00112     {
00113         return L"null";
00114     }
00115
00116     Color color = value.Value();
00117
00118     return L"A: " + to_hstring(color.A) + L",  R: " + to_hstring(color.R) + L", G: " + to_hstring(color.G) + L", B: " + to_hstring(color.B);
00119 }
Generated on Fri Nov 15 2024 22:21:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario3_dependencies.xaml.cpp Source File

  • Package
  • cpp

scenario3_dependencies.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3.xaml.cpp
00013 // Implementation of the Scenario3 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario3_Dependencies.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Platform;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Navigation;
00026 using namespace Windows::ApplicationModel;
00027
00028 Scenario3::Scenario3()
00029 {
00030     InitializeComponent();
00031 }
00032
00033 /// <summary>
00034 /// Invoked when this page is about to be displayed in a Frame.
00035 /// </summary>
00036 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037 /// property is typically used to configure the page.</param>
00038 void Scenario3::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00041     // as NotifyUser()
00042     rootPage = MainPage::Current;
00043 }
00044
00045 void Scenario3::GetDependencies_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     Package^ package = Package::Current;
00048     auto dependencies = package->Dependencies;
00049
00050     String^ output = "Count: " + dependencies->Size.ToString();
00051     for (unsigned i = 0; i < dependencies->Size; i++)
00052     {
00053         Package^ dependency = dependencies->GetAt(i);
00054         output += "\n[" + i.ToString() + "]: " + dependency->Id->FullName;
00055     }
00056
00057     OutputTextBlock->Text = output;
00058 }
Generated on Fri Nov 15 2024 22:20:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UserControl_Loaded(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DOModel Member List

This is the complete list of members for DOModel, including all inherited members.
_IntPropertyDPProperty | DOModel | [private, static]
_YinPropertyDPProperty | DOModel | [private, static]
DOModel() | DOModel | [inline]
DOModel() | DOModel | [inline]
IntPropertyDP | DOModel |
IntPropertyDPName | DOModel | [private]
IntPropertyDPProperty | DOModel | [static]
UpdateValues() | DOModel | [inline]
UpdateValues() | DOModel | [inline]
YangObj | DOModel |
YinCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) | DOModel | [inline, static]
YinCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) | DOModel | [inline, static]
YinPropertyDP | DOModel |
YinPropertyDPName | DOModel | [private]
YinPropertyDPProperty | DOModel | [static]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/AudioFileReader.cpp Source File

  • SpatialSound
  • cpp

AudioFileReader.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012
00013 _Use_decl_annotations_
00014 HRESULT AudioFileReader::Initialize(LPCWSTR filename)
00015 {
00016     BOOL mfStarted = FALSE;
00017     auto hr = MFStartup(MF_VERSION);
00018     mfStarted = SUCCEEDED(hr);
00019
00020     ComPtr<IMFSourceReader> reader;
00021     if (SUCCEEDED(hr))
00022     {
00023         hr = MFCreateSourceReaderFromURL(filename, nullptr, &reader);
00024     }
00025
00026     // Select the first audio stream, and deselect all other streams.
00027     if (SUCCEEDED(hr))
00028     {
00029         hr = reader->SetStreamSelection(static_cast<DWORD>(MF_SOURCE_READER_ALL_STREAMS), FALSE);
00030     }
00031
00032     if (SUCCEEDED(hr))
00033     {
00034         hr = reader->SetStreamSelection(static_cast<DWORD>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), TRUE);
00035     }
00036
00037     // Create a partial media type that specifies uncompressed PCM audio.
00038     ComPtr<IMFMediaType> partialType;
00039     if (SUCCEEDED(hr))
00040     {
00041         hr = MFCreateMediaType(&partialType);
00042     }
00043
00044     if (SUCCEEDED(hr))
00045     {
00046         hr = partialType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio);
00047     }
00048
00049     if (SUCCEEDED(hr))
00050     {
00051         hr = partialType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM);
00052     }
00053
00054     // Set this type on the source reader. The source reader will load the necessary decoder.
00055     if (SUCCEEDED(hr))
00056     {
00057         hr = reader->SetCurrentMediaType(static_cast<DWORD>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), nullptr, partialType.Get());
00058     }
00059
00060     // Get the complete uncompressed format
00061     ComPtr<IMFMediaType> uncompressedAudioType;
00062     if (SUCCEEDED(hr))
00063     {
00064         hr = reader->GetCurrentMediaType(static_cast<DWORD>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), &uncompressedAudioType);
00065     }
00066
00067     // Ensure the stream is selected.
00068     if (SUCCEEDED(hr))
00069     {
00070         hr = reader->SetStreamSelection(static_cast<DWORD>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), TRUE);
00071     }
00072
00073     // Get the audio block size and number of bytes/second from the audio format.
00074     if (SUCCEEDED(hr))
00075     {
00076         WAVEFORMATEX* format = nullptr;
00077         UINT32 size = 0;
00078         hr = MFCreateWaveFormatExFromMFMediaType(uncompressedAudioType.Get(), &format, &size);
00079
00080         // Only mono PCM files are supported for HRTF processing
00081         if (SUCCEEDED(hr) && format->wFormatTag != WAVE_FORMAT_PCM && format->nChannels != 1)
00082         {
00083             hr = E_INVALIDARG;
00084         }
00085
00086         if (SUCCEEDED(hr))
00087         {
00088             CopyMemory(&_format, format, sizeof WAVEFORMATEX);
00089         }
00090
00091         if (format)
00092         {
00093             CoTaskMemFree(format);
00094         }
00095     }
00096
00097     // Get audio samples from the source reader.
00098     _audioData.resize(0);
00099     while (SUCCEEDED(hr))
00100     {
00101         DWORD dwFlags = 0;
00102
00103         // Read the next sample.
00104         ComPtr<IMFSample> sample;
00105         hr = reader->ReadSample(static_cast<DWORD>(MF_SOURCE_READER_FIRST_AUDIO_STREAM), 0, nullptr, &dwFlags, nullptr, &sample);
00106
00107         if (SUCCEEDED(hr) && (dwFlags & MF_SOURCE_READERF_ENDOFSTREAM) != 0)
00108         {
00109             // End of stream
00110             break;
00111         }
00112
00113         if (SUCCEEDED(hr) && sample == nullptr)
00114         {
00115             // No sample, keep going
00116             continue;
00117         }
00118
00119         // Get a pointer to the audio data in the sample.
00120         ComPtr<IMFMediaBuffer> buffer;
00121         if (SUCCEEDED(hr))
00122         {
00123             hr = sample->ConvertToContiguousBuffer(&buffer);
00124         }
00125
00126         DWORD bufferSize = 0;
00127         if (SUCCEEDED(hr))
00128         {
00129             BYTE* data;
00130             hr = buffer->Lock(&data, nullptr, &bufferSize);
00131
00132             auto currentDataSize = _audioData.size();
00133             if (SUCCEEDED(hr))
00134             {
00135                 _audioData.resize(currentDataSize + bufferSize);
00136             }
00137
00138             if (SUCCEEDED(hr))
00139             {
00140                 CopyMemory(_audioData.data() + currentDataSize, data, bufferSize);
00141                 // Unlock the buffer
00142                 hr = buffer->Unlock();
00143             }
00144         }
00145     }
00146
00147     if (mfStarted)
00148     {
00149         MFShutdown();
00150     }
00151
00152     return hr;
00153 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileSavePicker_FailToSave Member List

This is the complete list of members for FileSavePicker_FailToSave, including all inherited members.
dispatcher | FileSavePicker_FailToSave | [private]
FileSavePicker_FailToSave() | FileSavePicker_FailToSave | [inline]
fileSavePickerUI | FileSavePicker_FailToSave | [private]
OnNavigatedFrom(NavigationEventArgs e) | FileSavePicker_FailToSave | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | FileSavePicker_FailToSave | [inline, protected]
OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e) | FileSavePicker_FailToSave | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario8_Copy.xaml.h Source File

  • FileAccess
  • cpp

Scenario8_Copy.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario8_Copy.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Copying a file.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario8 sealed
00025     {
00026     public:
00027         Scenario8();
00028         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032
00033         void CopyFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/ScenarioGroup.cs Source File

  • Notifications
  • cs
  • Notifications
  • Model

ScenarioGroup.cs

Go to the documentation of this file.
00001 ﻿using Notifications.Helpers;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.Linq;
00005
00006 namespace Notifications.Model
00007 {
00008     public class ScenarioGroup : BindableBase, IScenario
00009     {
00010         private string _name;
00011         public string Name
00012         {
00013             get { return _name; }
00014         }
00015
00016         public override string ToString()
00017         {
00018             return Name;
00019         }
00020
00021         public List<IScenario> Children { get; private set; }
00022
00023         public ScenarioGroup(string name, IEnumerable<IScenario> children)
00024         {
00025             _name = name;
00026             Children = new List<IScenario>(children);
00027         }
00028
00029         public bool Contains(Type scenarioType)
00030         {
00031             return this.FindScenario(scenarioType) != null;
00032         }
00033
00034         public Scenario FindScenario(Type scenarioType)
00035         {
00036             foreach (var child in Children)
00037             {
00038                 Scenario found = child.FindScenario(scenarioType);
00039                 if (found != null)
00040                     return found;
00041             }
00042
00043             return null;
00044         }
00045
00046         public ScenarioGroup FindParent(IScenario ofScenario)
00047         {
00048             foreach (var child in Children)
00049             {
00050                 if (child == ofScenario)
00051                     return this;
00052
00053                 if (child is ScenarioGroup)
00054                 {
00055                     ScenarioGroup recursiveFound = (child as ScenarioGroup).FindParent(ofScenario);
00056                     if (recursiveFound != null)
00057                         return recursiveFound;
00058                 }
00059             }
00060
00061             return null;
00062
00063
00064         }
00065
00066         public List<ScenarioGroup> GetPathToScenario(Scenario scenario)
00067         {
00068             List<ScenarioGroup> answer = new List<ScenarioGroup>() { this };
00069
00070             GetPathToScenarioHelper(scenario, answer);
00071
00072             return answer;
00073         }
00074
00075         private void GetPathToScenarioHelper(Scenario scenario, List<ScenarioGroup> listToAppendTo)
00076         {
00077             foreach (Scenario child in Children.OfType<Scenario>())
00078                 if (child == scenario)
00079                 {
00080                     return;
00081                 }
00082
00083             foreach (ScenarioGroup groupChild in Children.OfType<ScenarioGroup>())
00084             {
00085                 if (groupChild.Contains(scenario.UIElementType))
00086                 {
00087                     listToAppendTo.Add(groupChild);
00088                     groupChild.GetPathToScenarioHelper(scenario, listToAppendTo);
00089                 }
00090             }
00091         }
00092     }
00093 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/pch.cpp Source File

  • CompositionVisual
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/Scenario2_Launch.xaml.cpp Source File

  • FullScreenMode
  • cpp

Scenario2_Launch.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Launch.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Scenario2_Launch::Scenario2_Launch()
00025 {
00026     InitializeComponent();
00027     LaunchInFullScreenModeCheckBox->IsChecked = ApplicationView::PreferredLaunchWindowingMode == ApplicationViewWindowingMode::FullScreen;
00028 }
00029
00030
00031 void Scenario2_Launch::LaunchInFullScreenModeCheckBox_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00032 {
00033     ApplicationView::PreferredLaunchWindowingMode = LaunchInFullScreenModeCheckBox->IsChecked->Value ? ApplicationViewWindowingMode::FullScreen : ApplicationViewWindowingMode::Auto;
00034 }
Generated on Fri Nov 15 2024 22:19:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SetLockScreenImage Member List

This is the complete list of members for SetLockScreenImage, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | SetLockScreenImage | [inline, protected]
PickAndSetButton_Click(object sender, RoutedEventArgs e) | SetLockScreenImage | [inline, private]
rootPage | SetLockScreenImage | [private]
SetLockScreenImage() | SetLockScreenImage | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/pch.cpp Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario16_NetworkResource.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario16_NetworkResource.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Globalization;
00015 using System.Threading.Tasks;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019 using SDKTemplate;
00020 using Windows.Security.EnterpriseData;
00021 using Windows.Networking;
00022 using Windows.Networking.BackgroundTransfer;
00023 using Windows.Security.Credentials;
00024 using Windows.Storage;
00025
00026 namespace EdpSample
00027 {
00028     /// <summary>
00029     /// An empty page that can be used on its own or navigated to within a Frame.
00030     /// </summary>
00031     public sealed partial class Scenario16_NetworkResource : Page
00032     {
00033         private MainPage rootPage;
00034
00035         public Scenario16_NetworkResource()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042             rootPage = MainPage.Current;
00043
00044             DiscoverActiveDownloadsAsync();
00045         }
00046
00047         // Enumerate the downloads that were going on in the background while the app was closed.
00048         private async void DiscoverActiveDownloadsAsync()
00049         {
00050             List<DownloadOperation> activeDownloads = new List<DownloadOperation>();
00051
00052             IReadOnlyList<DownloadOperation> downloads = null;
00053             try
00054             {
00055                 downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
00056             }
00057             catch (Exception ex)
00058             {
00059                 // There was a problem with the downloads.
00060                 // Use BackgroundTransferError.GetStatus(ex.HResult) to convert the HResult
00061                 // into something more useful.
00062                 // This sample merely reports the raw error.
00063                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00064             }
00065
00066             rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
00067                 "Loading background downloads: {0}",
00068                 downloads.Count),
00069                 NotifyType.StatusMessage);
00070
00071             if (downloads.Count > 0)
00072             {
00073                 List<Task> tasks = new List<Task>();
00074                 foreach (DownloadOperation download in downloads)
00075                 {
00076                     rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
00077                         "Discovered background download: {0}, Status: {1}",
00078                         download.Guid,
00079                         download.Progress.Status),
00080                         NotifyType.StatusMessage);
00081
00082                     // Attach completion handler.
00083                     var notAwait = HandleDownloadAsync(download);
00084                 }
00085             }
00086         }
00087
00088         private async void CheckUriIdentity_Click(object sender, RoutedEventArgs e)
00089         {
00090             Uri resourceUri;
00091             string resourceIdentity;
00092             try
00093             {
00094                 if (!Uri.TryCreate(ResourceUriText.Text.Trim(), UriKind.Absolute, out resourceUri))
00095                 {
00096                     rootPage.NotifyUser("Invalid URI, please re-enter a valid URI", NotifyType.ErrorMessage);
00097                     return;
00098                 }
00099                 resourceIdentity = await ProtectionPolicyManager.GetPrimaryManagedIdentityForNetworkEndpointAsync(
00100                                            new HostName(resourceUri.Host));
00101                 DisplayNetworkIdentity(resourceIdentity);
00102             }
00103             catch (Exception ex)
00104             {
00105                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00106             }
00107         }
00108
00109         private async void ConnectUsingBackgroundTransfer(string resourceIdentity, Uri resourceUri)
00110         {
00111             ThreadNetworkContext context = null;
00112
00113             try
00114             {
00115                 // For demonstrational purposes, when "Use personal context" is selected,
00116                 // the resourceIdentity is set to null to force personal context.
00117
00118                 // When using Windows.Networking.BackgroundTransfer, the app is responsible for disallowing connections
00119                 // to enterprise owned URLs when in personal context.
00120                 // Otherwise, the app may inadvertently access cached data for a different context.
00121                 if (UsePersonalContext.IsChecked.Value && !string.IsNullOrEmpty(resourceIdentity))
00122                 {
00123                     rootPage.NotifyUser("This app does not have access to the specified URL in personal context", NotifyType.ErrorMessage);
00124                     return;
00125                 }
00126
00127                 rootPage.NotifyUser("Creating file.........", NotifyType.StatusMessage);
00128
00129                 StorageFile resultFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(
00130                     "ResultFile.txt",
00131                     CreationCollisionOption.GenerateUniqueName);
00132
00133                 if (!string.IsNullOrEmpty(resourceIdentity))
00134                 {
00135                     context = ProtectionPolicyManager.CreateCurrentThreadNetworkContext(resourceIdentity);
00136                 }
00137
00138                 rootPage.NotifyUser("Accessing network resource.........", NotifyType.StatusMessage);
00139
00140                 BackgroundDownloader downloader = new BackgroundDownloader();
00141
00142                 if (!string.IsNullOrEmpty(UserNameBox.Text) &&
00143                     !string.IsNullOrEmpty(Passwordbox.Password))
00144                 {
00145                     downloader.ServerCredential = new PasswordCredential(
00146                         resourceUri.AbsoluteUri,
00147                         UserNameBox.Text,
00148                         Passwordbox.Password);
00149                 }
00150
00151                 DownloadOperation download = downloader.CreateDownload(resourceUri, resultFile);
00152
00153                 await HandleDownloadAsync(download);
00154             }
00155             catch (Exception ex)
00156             {
00157                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00158             }
00159             finally
00160             {
00161                 if (context != null)
00162                 {
00163                     context.Dispose();
00164                 }
00165             }
00166         }
00167
00168         private async void ConnectUsingWebHttpClient(string resourceIdentity, Uri resourceUri)
00169         {
00170             try
00171             {
00172                 // Use Windows.Web.Http.HttpClient to access the resource.
00173                 // The code is identical to a normal resource access, except that we create
00174                 // a ThreadNetworkContext around the client.GetAsync() call.
00175
00176                 using (var client = new Windows.Web.Http.HttpClient())
00177                 {
00178                     // When using Windows.Web.Http.HttpClient, the app is responsible for disallowing connections
00179                     // to enterprise owned URLs when in personal context.
00180                     // Otherwise, the app may inadvertently access cached data for a different context.
00181                     if (!string.IsNullOrEmpty(resourceIdentity) && UsePersonalContext.IsChecked.Value)
00182                     {
00183                         rootPage.NotifyUser("This app does not have access to the specified URL in personal context", NotifyType.ErrorMessage);
00184                         return;
00185                     }
00186                     Windows.Web.Http.HttpResponseMessage response = await UsingNetworkContext(resourceIdentity, () => client.GetAsync(resourceUri));
00187                     rootPage.NotifyUser($"Server response = {(int)response.StatusCode} {response.ReasonPhrase}", NotifyType.StatusMessage);
00188                 }
00189             }
00190             catch (Exception ex)
00191             {
00192                 // Access to the network resource was not successful.
00193                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00194             }
00195         }
00196
00197         private async void ConnectUsingNetHttpClient(string resourceIdentity, Uri resourceUri)
00198         {
00199             try
00200             {
00201                 // Use System.Net.Http.HttpClient to access the resource.
00202                 // The code is identical to a normal resource access, except that we specify a header
00203                 // with the Enterprise ID that will allow us to access enterprise owned URLs.
00204                 // The "X-MS-Windows-HttpClient-EnterpriseId" header is used instead of using ThreadNetworkContext
00205                 // because the thread that ultimately carries out the network-bound operations may be different.
00206
00207                 // For demonstrational purposes, when "Use personal context" is selected,
00208                 // the resourceIdentity is set to null to force personal context.
00209                 if (UsePersonalContext.IsChecked.Value)
00210                 {
00211                     resourceIdentity = "";
00212                 }
00213
00214                 var httpHandler = new System.Net.Http.HttpClientHandler();
00215                 httpHandler.Credentials = new System.Net.NetworkCredential(UserNameBox.Text, Passwordbox.Password);
00216                 httpHandler.AllowAutoRedirect = true;
00217                 using (var client = new System.Net.Http.HttpClient(httpHandler))
00218                 {
00219                     var message = new System.Net.Http.HttpRequestMessage(System.Net.Http.HttpMethod.Get, resourceUri);
00220                     message.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)");
00221                     client.DefaultRequestHeaders.Add("X-MS-Windows-HttpClient-EnterpriseId", resourceIdentity);
00222                     System.Net.Http.HttpResponseMessage response = await client.SendAsync(message);
00223                     rootPage.NotifyUser($"Server response = {(int)response.StatusCode} {response.ReasonPhrase}", NotifyType.StatusMessage);
00224                 }
00225             }
00226             catch (Exception ex)
00227             {
00228                 // Access to the network resource was not successful.
00229                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00230             }
00231         }
00232         private async Task HandleDownloadAsync(DownloadOperation download)
00233         {
00234             try
00235             {
00236                 // For more advanced Background Transfer features, please take a look at the
00237                 // BackgroundTransfer sample.
00238                 if (download.Progress.Status == BackgroundTransferStatus.Idle)
00239                 {
00240                     await download.StartAsync();
00241                 }
00242                 else
00243                 {
00244                     await download.AttachAsync();
00245                 }
00246
00247                 ResponseInformation response = download.GetResponseInformation();
00248
00249                 // GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
00250                 string statusCode = response != null ? response.StatusCode.ToString() : String.Empty;
00251
00252                 rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
00253                     "Successfully completed background download: {0}, Status Code: {1}",
00254                     download.Guid,
00255                     statusCode),
00256                     NotifyType.StatusMessage);
00257             }
00258             catch (Exception ex)
00259             {
00260                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00261             }
00262         }
00263
00264         // For the Windows.Web.Http API, by default, a UI dialog is presented
00265         // if the outgoing request is for a resource that requires user authentication.
00266         // For this reason, we hide the Credentials text blocks when Windows.Web.Http is selected.
00267         private void ClientTypeChanged()
00268         {
00269             if (UseWindowsWebHttpClient.IsChecked.Value)
00270             {
00271                 CredentialsContent.Visibility = Visibility.Collapsed;
00272             }
00273             else
00274             {
00275                 CredentialsContent.Visibility = Visibility.Visible;
00276             }
00277         }
00278
00279         static T UsingNetworkContext<T>(string identity, Func<T> lambda)
00280         {
00281             // The "using" statement will Dispose the object when control leaves the block.
00282             using (ThreadNetworkContext context = string.IsNullOrEmpty(identity)
00283                 ? null
00284                 : ProtectionPolicyManager.CreateCurrentThreadNetworkContext(identity))
00285             {
00286                 return lambda();
00287             }
00288         }
00289
00290         private async void ConnectToUri()
00291         {
00292             Uri resourceUri;
00293
00294             if (!Uri.TryCreate(ResourceUriText.Text, UriKind.Absolute, out resourceUri))
00295             {
00296                 rootPage.NotifyUser("Invalid URI", NotifyType.ErrorMessage);
00297                 return;
00298             }
00299
00300             var hostName = new HostName(resourceUri.Host);
00301
00302             try
00303             {
00304                 string resourceIdentity = await ProtectionPolicyManager.GetPrimaryManagedIdentityForNetworkEndpointAsync(hostName);
00305                 // if there is no resourceIdentity, then the resource is considered personal, and no thread network context is needed.
00306                 // Otherwise, it requires the enterprise context.
00307                 DisplayNetworkIdentity(resourceIdentity);
00308
00309                 rootPage.NotifyUser("Accessing network resource...", NotifyType.StatusMessage);
00310
00311                 if (UseSystemNetHttpClient.IsChecked.Value)
00312                 {
00313                     ConnectUsingNetHttpClient(resourceIdentity, resourceUri);
00314                 }
00315                 else if (UseWindowsWebHttpClient.IsChecked.Value)
00316                 {
00317                     ConnectUsingWebHttpClient(resourceIdentity, resourceUri);
00318                 }
00319                 else if (UseBackgroundTransferButton.IsChecked.Value)
00320                 {
00321                     ConnectUsingBackgroundTransfer(resourceIdentity, resourceUri);
00322                 }
00323                 else
00324                 {
00325                     rootPage.NotifyUser("Please select a method to connect.", NotifyType.ErrorMessage);
00326                 }
00327             }
00328             catch (Exception ex)
00329             {
00330                 // Access to the network resource was not successful.
00331                 rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00332             }
00333         }
00334
00335         private void DisplayNetworkIdentity (string resourceIdentity)
00336         {
00337             if (string.IsNullOrEmpty(resourceIdentity))
00338             {
00339                 ActualEnterpriseContextTextBlock.Text = "Network resource is not enterprise protected.";
00340             }
00341             else
00342             {
00343                 ActualEnterpriseContextTextBlock.Text = "Network resource's enterprise identity is " + resourceIdentity;
00344             }
00345         }
00346     }
00347 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/SpatialInputHandler.cpp Source File

  • 360VideoPlayback
  • cpp
  • Content

SpatialInputHandler.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SpatialInputHandler.h"
00003 #include <functional>
00004
00005 using namespace _360VideoPlayback;
00006
00007 using namespace std::placeholders;
00008 using namespace Windows::Foundation;
00009 using namespace Windows::UI::Input::Spatial;
00010
00011 // Creates and initializes a GestureRecognizer that listens to a Person.
00012 SpatialInputHandler::SpatialInputHandler()
00013 {
00014     // The interaction manager provides an event that informs the app when
00015     // spatial interactions are detected.
00016     m_interactionManager = SpatialInteractionManager::GetForCurrentView();
00017
00018     // Bind a handler to the SourcePressed event.
00019     m_sourcePressedEventToken =
00020         m_interactionManager->SourcePressed +=
00021             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00022                 bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
00023                 );
00024
00025     //
00026     // TODO: Expand this class to use other gesture-based input events as applicable to
00027     //       your app.
00028     //
00029 }
00030
00031 SpatialInputHandler::~SpatialInputHandler()
00032 {
00033     // Unregister our handler for the OnSourcePressed event.
00034     m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
00035 }
00036
00037 // Checks if the user performed an input gesture since the last call to this method.
00038 // Allows the main update loop to check for asynchronous changes to the user
00039 // input state.
00040 SpatialInteractionSourceState^ SpatialInputHandler::CheckForInput()
00041 {
00042     SpatialInteractionSourceState^ sourceState = m_sourceState;
00043     m_sourceState = nullptr;
00044     return sourceState;
00045 }
00046
00047 void SpatialInputHandler::OnSourcePressed(SpatialInteractionManager^ sender, SpatialInteractionSourceEventArgs^ args)
00048 {
00049     m_sourceState = args->State;
00050
00051     //
00052     // TODO: In your app or game engine, rewrite this method to queue
00053     //       input events in your input class or event handler.
00054     //
00055 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/SampleConfiguration.h Source File

  • Capabilities
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/Scenario2_Polling.xaml.cpp Source File

  • SimpleOrientationSensor
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033
00034     sensor = SimpleOrientationSensor::GetDefault();
00035     if (sensor == nullptr)
00036     {
00037         rootPage->NotifyUser("No simple orientation sensor found", NotifyType::ErrorMessage);
00038     }
00039 }
00040
00041 /// <summary>
00042 /// Invoked when this page is about to be displayed in a Frame.
00043 /// </summary>
00044 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00045 /// property is typically used to configure the page.</param>
00046 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00047 {
00048 }
00049
00050 void Scenario2_Polling::DisplayOrientation(SimpleOrientation orientation)
00051 {
00052     switch (orientation)
00053     {
00054         case SimpleOrientation::NotRotated:
00055             ScenarioOutput_Orientation->Text = "Not Rotated";
00056             break;
00057         case SimpleOrientation::Rotated90DegreesCounterclockwise:
00058             ScenarioOutput_Orientation->Text = "Rotated 90 Degrees Counterclockwise";
00059             break;
00060         case SimpleOrientation::Rotated180DegreesCounterclockwise:
00061             ScenarioOutput_Orientation->Text = "Rotated 180 Degrees Counterclockwise";
00062             break;
00063         case SimpleOrientation::Rotated270DegreesCounterclockwise:
00064             ScenarioOutput_Orientation->Text = "Rotated 270 Degrees Counterclockwise";
00065             break;
00066         case SimpleOrientation::Faceup:
00067             ScenarioOutput_Orientation->Text = "Faceup";
00068             break;
00069         case SimpleOrientation::Facedown:
00070             ScenarioOutput_Orientation->Text = "Facedown";
00071             break;
00072         default:
00073             ScenarioOutput_Orientation->Text = "Unknown orientation";
00074             break;
00075     }
00076 }
00077
00078 void Scenario2_Polling::ScenarioGet(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00079 {
00080     if (sensor != nullptr)
00081     {
00082         DisplayOrientation(sensor->GetCurrentOrientation());
00083     }
00084     else
00085     {
00086         rootPage->NotifyUser("No simple orientation sensor found", NotifyType::ErrorMessage);
00087     }
00088 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/KeepConnectionOpenScenario.cpp Source File

  • AppServices
  • cppwinrt
  • AppServicesClient

KeepConnectionOpenScenario.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "KeepConnectionOpenScenario.h"
00014 #include "KeepConnectionOpenScenario.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel::AppService;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Foundation::Collections;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     KeepConnectionOpenScenario::KeepConnectionOpenScenario()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void KeepConnectionOpenScenario::OnNavigatedFrom(NavigationEventArgs const&)
00032     {
00033         //Clean up before we go
00034         if (connection != nullptr)
00035         {
00036             connection.Close();
00037             connection = nullptr;
00038         }
00039     }
00040
00041     fire_and_forget KeepConnectionOpenScenario::OpenConnection_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         auto lifetime = get_strong();
00044
00045         //Is a connection already open?
00046         if (connection != nullptr)
00047         {
00048             rootPage.NotifyUser(L"A connection already exists", NotifyType::ErrorMessage);
00049             co_return;
00050         }
00051
00052         //Set up a new app service connection
00053         connection = AppServiceConnection();
00054         connection.AppServiceName(L"com.microsoft.randomnumbergenerator");
00055         connection.PackageFamilyName(L"Microsoft.SDKSamples.AppServicesProvider.CPPWINRT_8wekyb3d8bbwe");
00056         connection.ServiceClosed({ get_weak(), &KeepConnectionOpenScenario::Connection_ServiceClosed });
00057         AppServiceConnectionStatus status = co_await connection.OpenAsync();
00058
00059         //"connection" may have been nulled out while we were awaiting.
00060         if (connection == nullptr)
00061         {
00062             rootPage.NotifyUser(L"Connection was closed", NotifyType::ErrorMessage);
00063             co_return;
00064         }
00065
00066         //If the new connection opened successfully we're done here
00067         if (status == AppServiceConnectionStatus::Success)
00068         {
00069             rootPage.NotifyUser(L"Connection is open", NotifyType::StatusMessage);
00070         }
00071         else
00072         {
00073             //Something went wrong. Lets figure out what it was and show the
00074             //user a meaningful message
00075             switch (status)
00076             {
00077             case AppServiceConnectionStatus::AppNotInstalled:
00078                 rootPage.NotifyUser(L"The app AppServicesProvider is not installed. Deploy AppServicesProvider to this device and try again.", NotifyType::ErrorMessage);
00079                 break;
00080
00081             case AppServiceConnectionStatus::AppUnavailable:
00082                 rootPage.NotifyUser(L"The app AppServicesProvider is not available. This could be because it is currently being updated or was installed to a removable device that is no longer available.", NotifyType::ErrorMessage);
00083                 break;
00084
00085             case AppServiceConnectionStatus::AppServiceUnavailable:
00086                 rootPage.NotifyUser(L"The app AppServicesProvider is installed but it does not provide the app service " + connection.AppServiceName(), NotifyType::ErrorMessage);
00087                 break;
00088
00089             default:
00090             case AppServiceConnectionStatus::Unknown:
00091                 rootPage.NotifyUser(L"An unknown error occurred while we were trying to open an AppServiceConnection.", NotifyType::ErrorMessage);
00092                 break;
00093             }
00094
00095             //Clean up before we go
00096             connection.Close();
00097             connection = nullptr;
00098         }
00099     }
00100
00101     fire_and_forget KeepConnectionOpenScenario::Connection_ServiceClosed(AppServiceConnection const&, AppServiceClosedEventArgs const&)
00102     {
00103         auto lifetime = get_strong();
00104
00105         co_await resume_foreground(Dispatcher());
00106
00107         //Close the connection reference we're holding
00108         if (connection != nullptr)
00109         {
00110             connection.Close();
00111             connection = nullptr;
00112         }
00113     }
00114
00115     void KeepConnectionOpenScenario::CloseConnection_Click(IInspectable const&, RoutedEventArgs const&)
00116     {
00117         //Is there an open connection?
00118         if (connection == nullptr)
00119         {
00120             rootPage.NotifyUser(L"There's no open connection to close", NotifyType::ErrorMessage);
00121             return;
00122         }
00123
00124         //Close the open connection
00125         connection.Close();
00126         connection = nullptr;
00127
00128         //Let the user know we closed the connection
00129         rootPage.NotifyUser(L"Connection is closed", NotifyType::StatusMessage);
00130     }
00131
00132     fire_and_forget KeepConnectionOpenScenario::GenerateRandomNumber_Click(IInspectable const&, RoutedEventArgs const&)
00133     {
00134         auto lifetime = get_strong();
00135
00136         //Is there an open connection?
00137         if (connection == nullptr)
00138         {
00139             rootPage.NotifyUser(L"You need to open a connection before trying to generate a random number.", NotifyType::ErrorMessage);
00140             co_return;
00141         }
00142
00143         //Parse user input
00144         int minValueInput = 0;
00145         bool valueParsed = TryParseInt32(MinValue().Text().c_str(), minValueInput);
00146         if (!valueParsed)
00147         {
00148             rootPage.NotifyUser(L"The Minimum Value should be a valid integer", NotifyType::ErrorMessage);
00149             co_return;
00150         }
00151
00152         int maxValueInput = 0;
00153         valueParsed = TryParseInt32(MaxValue().Text().c_str(), maxValueInput);
00154         if (!valueParsed)
00155         {
00156             rootPage.NotifyUser(L"The Maximum Value should be a valid integer", NotifyType::ErrorMessage);
00157             co_return;
00158         }
00159
00160         if (maxValueInput <= minValueInput)
00161         {
00162             rootPage.NotifyUser(L"Maximum Value must be larger than Minimum Value", NotifyType::ErrorMessage);
00163             co_return;
00164         }
00165
00166         //Send a message to the app service
00167         ValueSet inputs;
00168         inputs.Insert(L"minvalue", box_value(minValueInput));
00169         inputs.Insert(L"maxvalue", box_value(maxValueInput));
00170         AppServiceResponse response = co_await connection.SendMessageAsync(inputs);
00171
00172         //"connection" may have been nulled out while we were awaiting.
00173         if (connection == nullptr)
00174         {
00175             rootPage.NotifyUser(L"Connection was closed", NotifyType::ErrorMessage);
00176             co_return;
00177         }
00178
00179         //If the service responded display the message. We're done!
00180         if (response.Status() == AppServiceResponseStatus::Success)
00181         {
00182             std::optional<int> result = response.Message().TryLookup(L"result").try_as<int>();
00183             if (result.has_value())
00184             {
00185                 Result().Text(to_hstring(result.value()));
00186                 rootPage.NotifyUser(L"App service responded with a result", NotifyType::StatusMessage);
00187             }
00188             else
00189             {
00190                 rootPage.NotifyUser(L"App service did not respond with a result", NotifyType::ErrorMessage);
00191             }
00192         }
00193         else
00194         {
00195             //Something went wrong while sending a message. Let display
00196             //a meaningful error message
00197             switch (response.Status())
00198             {
00199             case AppServiceResponseStatus::Failure:
00200                 rootPage.NotifyUser(L"The service failed to acknowledge the message we sent it. It may have been terminated because the client was suspended.", NotifyType::ErrorMessage);
00201                 co_return;
00202
00203             case AppServiceResponseStatus::ResourceLimitsExceeded:
00204                 rootPage.NotifyUser(L"The service exceeded the resources allocated to it and had to be terminated.", NotifyType::ErrorMessage);
00205                 co_return;
00206
00207             default:
00208             case AppServiceResponseStatus::Unknown:
00209                 rootPage.NotifyUser(L"An unknown error occurred while we were trying to send a message to the service.", NotifyType::ErrorMessage);
00210                 co_return;
00211             }
00212         }
00213     }
00214 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/RelayCommand.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

RelayCommand.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Windows.Input;
00014
00015 namespace AllJoynProducerExperiences
00016 {
00017     /// <summary>
00018     /// Helpful class to execute the command logic (as defined by ViewModel's exposed ICommand properties) via delegates.
00019     /// </summary>
00020     public class RelayCommand : ICommand
00021     {
00022         readonly Action<object> execute;
00023         readonly Predicate<object> canExecute;
00024
00025         public RelayCommand(Action<object> execute)
00026             : this(execute, null)
00027         {
00028         }
00029
00030         public event EventHandler CanExecuteChanged
00031         {
00032             add { }
00033             remove { }
00034         }
00035
00036         public RelayCommand(Action<object> execute, Predicate<object> canExecute)
00037         {
00038             if (execute == null)
00039             {
00040                 throw new ArgumentNullException("execute");
00041             }
00042             this.execute = execute;
00043             this.canExecute = canExecute;
00044         }
00045
00046         public bool CanExecute(object parameter)
00047         {
00048             return canExecute == null ? true : canExecute(parameter);
00049         }
00050
00051         public void Execute(object parameter)
00052         {
00053             execute(parameter);
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/DataHelpers.h Source File

  • BarcodeScanner
  • cppwinrt

DataHelpers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 std::wstring GetDataString(winrt::Windows::Storage::Streams::IBuffer const& data);
00015 winrt::hstring GetDataLabelString(winrt::Windows::Storage::Streams::IBuffer const& data, uint32_t scanDataType);
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/pch.h Source File

  • PdfDocument
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/SampleConfiguration.cs Source File

  • UserDataAccountManager
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.Threading.Tasks;
00016 using Windows.ApplicationModel.UserDataAccounts;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "User Data Account Manager";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title="Add an account", ClassType=typeof(Scenario1_AddAccount)},
00028             new Scenario() { Title="Manage an account", ClassType=typeof(Scenario2_ManageAccount)},
00029             new Scenario() { Title="Fix an account", ClassType=typeof(Scenario3_FixAccount)},
00030         };
00031
00032         // Fill the specified ComboBox with user data accounts.
00033         public async Task LoadDataAccountsAsync(ComboBox comboBox)
00034         {
00035             // Requires the email, contacts, or appointments capability in the app's manifest.
00036             UserDataAccountStore store = await UserDataAccountManager.RequestStoreAsync(UserDataAccountStoreAccessType.AllAccountsReadOnly);
00037
00038             if (store != null)
00039             {
00040                 IReadOnlyList<UserDataAccount> userDataAccounts = await store.FindAccountsAsync();
00041                 comboBox.DataContext = new ObservableCollection<UserDataAccount>(userDataAccounts);
00042
00043                 if (userDataAccounts.Count > 0)
00044                 {
00045                     comboBox.SelectedIndex = 0;
00046                 }
00047             }
00048             else
00049             {
00050                 // If the store is null, that means all access to Contacts, Calendar and Email data
00051                 // has been revoked.
00052                 NotifyUser("Access to Contacts, Calendar and Email has been revoked", NotifyType.ErrorMessage);
00053             }
00054         }
00055     }
00056
00057     public class Scenario
00058     {
00059         public string Title { get; set; }
00060         public Type ClassType { get; set; }
00061     }
00062 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameSourceViewModels.h Source File

  • CameraFrames
  • cpp

FrameSourceViewModels.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     ref class FrameSourceGroupModel;
00017     ref class FrameSourceInfoModel;
00018     ref class FrameFormatModel;
00019
00020     /// <summary>
00021     /// View model for MediaFrameSourceGroup used in XAML ContentControl.
00022     /// </summary>
00023     [Windows::UI::Xaml::Data::Bindable]
00024     public ref class FrameSourceGroupModel sealed
00025     {
00026     public:
00027         FrameSourceGroupModel(Windows::Media::Capture::Frames::MediaFrameSourceGroup^ sourceGroup);
00028
00029     public: // Public properties.
00030         property Platform::String^ Id;
00031         property Platform::String^ DisplayName;
00032         property Windows::Media::Capture::Frames::MediaFrameSourceGroup^ SourceGroup;
00033         property Windows::Foundation::Collections::IVectorView<FrameSourceInfoModel^>^ SourceInfos;
00034     };
00035
00036     /// <summary>
00037     /// View model for MediaFrameSourceInfo used in XAML ContentControl.
00038     /// </summary>
00039     [Windows::UI::Xaml::Data::Bindable]
00040     public ref class FrameSourceInfoModel sealed
00041     {
00042     public:
00043         FrameSourceInfoModel(Windows::Media::Capture::Frames::MediaFrameSourceInfo^ sourceInfo);
00044
00045         property Platform::String^ DisplayName;
00046         property Platform::String^ Id;
00047         property Windows::Media::Capture::Frames::MediaFrameSourceGroup^ SourceGroup;
00048         property Windows::Media::Capture::Frames::MediaFrameSourceInfo^ SourceInfo;
00049     };
00050
00051     /// <summary>
00052     /// View model for MediaFrameFormat used in XAML ContentControl.
00053     /// </summary>
00054     [Windows::UI::Xaml::Data::Bindable]
00055     public ref class FrameFormatModel sealed
00056     {
00057     public:
00058         FrameFormatModel(Windows::Media::Capture::Frames::MediaFrameFormat^ format);
00059
00060         /// <summary>
00061         /// Compares the Format contained by this view model to the given format for equivalency.
00062         /// </summary>
00063         /// <param name="otherFormat">The MediaFrameFormat to compare to the MediaFrameFormat in this view model.</param>
00064         /// <returns></returns>
00065         bool HasSameFormat(Windows::Media::Capture::Frames::MediaFrameFormat^ otherFormat)
00066         {
00067             if (otherFormat == nullptr)
00068             {
00069                 return (Format == nullptr);
00070             }
00071
00072             return Format->MajorType == otherFormat->MajorType &&
00073                 Format->Subtype == otherFormat->Subtype &&
00074                 Format->FrameRate->Numerator == otherFormat->FrameRate->Numerator &&
00075                 Format->FrameRate->Denominator == otherFormat->FrameRate->Denominator &&
00076                 ((Format->VideoFormat == nullptr && otherFormat->VideoFormat == nullptr) ||
00077                  (Format->VideoFormat != nullptr && otherFormat->VideoFormat != nullptr &&
00078                   Format->VideoFormat->Width == otherFormat->VideoFormat->Width &&
00079                   Format->VideoFormat->Height == otherFormat->VideoFormat->Height));
00080         }
00081
00082     public: // Public properties.
00083         property Platform::String^ DisplayName;
00084         property Windows::Media::Capture::Frames::MediaFrameFormat^ Format;
00085     };
00086
00087     /// <summary>
00088     /// View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl.
00089     /// </summary>
00090     [Windows::UI::Xaml::Data::Bindable]
00091     public ref class SourceGroupCollection sealed
00092     {
00093     public:
00094         SourceGroupCollection(Windows::UI::Core::CoreDispatcher^ uiDispatcher);
00095         virtual ~SourceGroupCollection();
00096
00097     public: // public properties
00098         property Windows::Foundation::Collections::IObservableVector<FrameSourceGroupModel^>^ FrameSourceGroups
00099         {
00100             Windows::Foundation::Collections::IObservableVector<FrameSourceGroupModel^>^ get()
00101             {
00102                 return m_sourceCollection;
00103             };
00104         };
00105
00106     private: // private methods
00107         /// <summary>
00108         /// Adds a SourceGroup with given Id to the collection.
00109         /// </summary>
00110         concurrency::task<void> AddDeviceAsync(Platform::String^ id);
00111
00112         /// <summary>
00113         /// Removes a SourceGroup with given id from the collection if it exists
00114         /// </summary>
00115         concurrency::task<void> RemoveDeviceAsync(Platform::String^ id);
00116
00117     private: // private data
00118         Windows::Foundation::Collections::IObservableVector<FrameSourceGroupModel^>^ m_sourceCollection;
00119
00120         Windows::UI::Core::CoreDispatcher^ m_dispatcher;
00121
00122         Windows::Devices::Enumeration::DeviceWatcher^ m_watcher;
00123         Windows::Foundation::EventRegistrationToken m_watcherDeviceAddedToken;
00124         Windows::Foundation::EventRegistrationToken m_watcherDeviceRemovedToken;
00125         Windows::Foundation::EventRegistrationToken m_watcherDeviceUpdatedToken;
00126     };
00127 } // SDKTemplate
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario1_PinTile.xaml.cs Source File

  • SecondaryTiles
  • cs

Scenario1_PinTile.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using Windows.UI.StartScreen;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class Scenario1_PinTile : Page
00019     {
00020         MainPage rootPage = MainPage.Current;
00021
00022         public Scenario1_PinTile()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         private async void PinButton_Click(object sender, RoutedEventArgs e)
00028         {
00029             // Prepare package images for the tile sizes in our tile to be pinned as well as for the square30x30 logo used in the Apps view.
00030             Uri square150x150Logo = new Uri("ms-appx:///Assets/square150x150Tile-sdk.png");
00031             Uri wide310x150Logo = new Uri("ms-appx:///Assets/wide310x150Tile-sdk.png");
00032             Uri square310x310Logo = new Uri("ms-appx:///Assets/square310x310Tile-sdk.png");
00033
00034             // During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation,
00035             // so that the app knows which tile the user is launching. In this sample, we'll pass in the date and time the secondary tile was pinned.
00036             string tileActivationArguments = MainPage.logoSecondaryTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();
00037
00038             // Create a Secondary tile with all the required arguments.
00039             // Note the last argument specifies what size the Secondary tile should show up as by default in the Pin to start fly out.
00040             // It can be set to TileSize.Square150x150, TileSize.Wide310x150, or TileSize.Default.
00041             // If set to TileSize.Wide310x150, then the asset for the wide size must be supplied as well.
00042             // TileSize.Default will default to the wide size if a wide size is provided, and to the medium size otherwise.
00043             SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId,
00044                                                             "Title text shown on the tile",
00045                                                             tileActivationArguments,
00046                                                             square150x150Logo,
00047                                                             TileSize.Square150x150);
00048
00049             secondaryTile.VisualElements.Wide310x150Logo = wide310x150Logo;
00050             secondaryTile.VisualElements.Square310x310Logo = square310x310Logo;
00051
00052             // The display of the secondary tile name can be controlled for each tile size.
00053             // The default is false.
00054             secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;
00055             secondaryTile.VisualElements.ShowNameOnWide310x150Logo = true;
00056             secondaryTile.VisualElements.ShowNameOnSquare310x310Logo = true;
00057
00058             // Specify a foreground text value.
00059             // The tile background color is inherited from the parent unless a separate value is specified.
00060             secondaryTile.VisualElements.ForegroundText = ForegroundText.Dark;
00061
00062             // Set this to false if roaming doesn't make sense for the secondary tile.
00063             // The default is true.
00064             secondaryTile.RoamingEnabled = false;
00065
00066             // The tile is created and we can now attempt to pin the tile.
00067             // Note that the status message is updated when the async operation to pin the tile completes.
00068             bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Below);
00069
00070             if (isPinned)
00071             {
00072                 rootPage.NotifyUser("Secondary tile successfully pinned.", NotifyType.StatusMessage);
00073             }
00074             else
00075             {
00076                 rootPage.NotifyUser("Secondary tile not pinned.", NotifyType.ErrorMessage);
00077             }
00078         }
00079     }
00080 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPageSizeChangedEventArgs Member List

This is the complete list of members for MainPageSizeChangedEventArgs, including all inherited members.
width | MainPageSizeChangedEventArgs | [private]
Width | MainPageSizeChangedEventArgs |
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameRenderer.h Source File

  • CameraFrames
  • cpp

FrameRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "LookupTable.h"
00015
00016 namespace SDKTemplate
00017 {
00018     // Function type used to map a scanline of pixels to an alternate pixel format.
00019     typedef std::function<void(int, byte*, byte*)> TransformScanline;
00020
00021     private ref class FrameRenderer sealed
00022     {
00023     public:
00024         FrameRenderer(Windows::UI::Xaml::Controls::Image^ image);
00025
00026     public: // Public methods.
00027         /// <summary>
00028         /// Buffer and render frames.
00029         /// </summary>
00030         void ProcessFrame(Windows::Media::Capture::Frames::MediaFrameReference^ frame);
00031
00032         /// <summary>
00033         /// Determines the subtype to request from the MediaFrameReader that will result in
00034         /// a frame that can be rendered by ConvertToDisplayableImage.
00035         /// </summary>
00036         /// <returns>Subtype string to request, or null if subtype is not renderable.</returns>
00037         static Platform::String^ GetSubtypeForFrameReader(
00038             Windows::Media::Capture::Frames::MediaFrameSourceKind kind,
00039             Windows::Media::Capture::Frames::MediaFrameFormat^ format);
00040
00041     private: // Private static methods.
00042         /// <summary>
00043         /// Converts the input frame to BGRA8 premultiplied alpha format and returns the result.
00044         /// Returns nullptr if the input frame cannot be converted BGRA8 premultiplied alpha.
00045         /// </summary>
00046         static Windows::Graphics::Imaging::SoftwareBitmap^ ConvertToDisplayableImage(
00047             Windows::Media::Capture::Frames::VideoMediaFrame^ inputFrame);
00048
00049         /// <summary>
00050         /// Transforms pixels of inputBitmap to an output bitmap using the supplied pixel transformation method.
00051         /// Returns nullptr if translation fails.
00052         /// </summary>
00053         static Windows::Graphics::Imaging::SoftwareBitmap^ TransformBitmap(
00054             Windows::Graphics::Imaging::SoftwareBitmap^ inputBitmap,
00055             TransformScanline pixelTransformation);
00056
00057     private: // Private instance methods.
00058         /// <summary>
00059         /// Keep presenting the m_backBuffer until there are no more.
00060         /// </summary>
00061         Concurrency::task<void> DrainBackBufferAsync();
00062
00063     private: // Private data.
00064         Windows::UI::Xaml::Controls::Image^ m_imageElement;
00065         Windows::Graphics::Imaging::SoftwareBitmap^ m_backBuffer;
00066         bool m_taskRunning = false;
00067
00068     };
00069 } // SDKTemplate
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/D2DGradientMeshRenderer.cpp Source File

  • D2DGradientMesh
  • cpp

D2DGradientMeshRenderer.cpp

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "D2DGradientMeshRenderer.h"
00010
00011 #include "DirectXHelper.h"
00012
00013 using namespace D2DGradientMesh;
00014
00015 using namespace DirectX;
00016 using namespace Windows::Foundation;
00017
00018 // Creates a DWriteTextFormat with our text properties. This includes setting our flow and reading direction.
00019 D2DGradientMeshRenderer::D2DGradientMeshRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00020     m_deviceResources(deviceResources)
00021 {
00022     CreateDeviceDependentResources();
00023     CreateWindowSizeDependentResources();
00024 }
00025
00026 // Initialization.
00027 void D2DGradientMeshRenderer::CreateDeviceDependentResources()
00028 {
00029     // Create an array that will hold the patch data. In this case, we have two patches.
00030     D2D1_GRADIENT_MESH_PATCH patchList[2];
00031
00032     // Create the first patch data item using the helper function.
00033     patchList[0] = D2D1::GradientMeshPatch(
00034         D2D1::Point2F(-210, 90),            // Point00 (bottom left corner)
00035         D2D1::Point2F(-150, 30),            // Point01
00036         D2D1::Point2F(-90, 150),            // Point02
00037         D2D1::Point2F(-30, 90),             // Point03 (bottom right corner)
00038         D2D1::Point2F(-190, 30),            // Point10
00039         D2D1::Point2F(-130, 30),            // Point11
00040         D2D1::Point2F(-70, 30),             // Point12
00041         D2D1::Point2F(-10, 30),             // Point13
00042         D2D1::Point2F(-170, -30),           // Point20
00043         D2D1::Point2F(-110, -30),           // Point21
00044         D2D1::Point2F(-50, -30),            // Point22
00045         D2D1::Point2F(10, -30),             // Point23
00046         D2D1::Point2F(-150, -90),           // Point30 (upper left corner)
00047         D2D1::Point2F(-90, -150),           // Point31
00048         D2D1::Point2F(-30, -30),            // Point32
00049         D2D1::Point2F(30, -90),             // Point33 (upper right corner)
00050         D2D1::ColorF(D2D1::ColorF::Black),  // Color00 (bottom left corner)
00051         D2D1::ColorF(D2D1::ColorF::Blue),   // Color03 (bottom right corner)
00052         D2D1::ColorF(D2D1::ColorF::Purple), // Color30 (upper left corner)
00053         D2D1::ColorF(D2D1::ColorF::Red),    // Color33 (upper right corner)
00054         D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Top edge is a boundary of the mesh
00055         D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Left edge is a boundary of the mesh
00056         D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Bottom edge is a boundary of the mesh
00057         D2D1_PATCH_EDGE_MODE_ALIASED        // Right edge is internal to the mesh
00058         );
00059
00060     // The second patch is the same as the first but translated by x.
00061     const int x = 180;
00062
00063     // Create the second patch data item using the helper function.
00064     patchList[1] = D2D1::GradientMeshPatch(
00065         D2D1::Point2F(-210 + x, 90),        // Point00 (bottom left corner)
00066         D2D1::Point2F(-150 + x, 30),        // Point01
00067         D2D1::Point2F(-90 + x, 150),        // Point02
00068         D2D1::Point2F(-30 + x, 90),         // Point03 (bottom right corner)
00069         D2D1::Point2F(-190 + x, 30),        // Point10
00070         D2D1::Point2F(-130 + x, 30),        // Point11
00071         D2D1::Point2F(-70 + x, 30),         // Point12
00072         D2D1::Point2F(-10 + x, 30),         // Point13
00073         D2D1::Point2F(-170 + x, -30),       // Point20
00074         D2D1::Point2F(-110 + x, -30),       // Point21
00075         D2D1::Point2F(-50 + x, -30),        // Point22
00076         D2D1::Point2F(10 + x, -30),         // Point23
00077         D2D1::Point2F(-150 + x, -90),       // Point30 (upper left corner)
00078         D2D1::Point2F(-90 + x, -150),       // Point31
00079         D2D1::Point2F(-30 + x, -30),        // Point32
00080         D2D1::Point2F(30 + x, -90),         // Point33 (upper right corner)
00081         D2D1::ColorF(D2D1::ColorF::Blue),   // Color00 (bottom left corner)
00082         D2D1::ColorF(D2D1::ColorF::Yellow), // Color03 (bottom right corner)
00083         D2D1::ColorF(D2D1::ColorF::Red),    // Color30 (upper left corner)
00084         D2D1::ColorF(D2D1::ColorF::Green),  // Color33 (upper right corner)
00085         D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Top edge is a boundary of the mesh
00086         D2D1_PATCH_EDGE_MODE_ALIASED,       // Left edge is internal to the mesh
00087         D2D1_PATCH_EDGE_MODE_ANTIALIASED,   // Bottom edge is a boundary of the mesh
00088         D2D1_PATCH_EDGE_MODE_ANTIALIASED    // Right edge is a boundary of the mesh
00089         );
00090
00091     // Create the gradient mesh object from the patch data.
00092     DX::ThrowIfFailed(
00093         m_deviceResources->GetD2DDeviceContext()->CreateGradientMesh(
00094             patchList,
00095             ARRAYSIZE(patchList),
00096             &m_gradientMesh
00097             )
00098         );
00099 }
00100
00101 // Initialization.
00102 void D2DGradientMeshRenderer::CreateWindowSizeDependentResources()
00103 {
00104 }
00105
00106 // Release all references to resources that depend on the graphics device.
00107 // This method is invoked when the device is lost and resources are no longer usable.
00108 void D2DGradientMeshRenderer::ReleaseDeviceDependentResources()
00109 {
00110     m_gradientMesh.Reset();
00111 }
00112
00113 // Renders one frame.
00114 void D2DGradientMeshRenderer::Render()
00115 {
00116     m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00117
00118     m_deviceResources->GetD2DDeviceContext()->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));
00119
00120     Windows::Foundation::Size logicalSize = m_deviceResources->GetLogicalSize();
00121
00122     // Translate to the center of the window.
00123     m_deviceResources->GetD2DDeviceContext()->SetTransform(
00124         D2D1::Matrix3x2F::Translation(logicalSize.Width / 2.0f, logicalSize.Height / 2.0f) *
00125         m_deviceResources->GetOrientationTransform2D()
00126         );
00127
00128     // Draw the gradient mesh.
00129     m_deviceResources->GetD2DDeviceContext()->DrawGradientMesh(m_gradientMesh.Get());
00130
00131     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00132     // is lost. It will be handled during the next call to Present.
00133     HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00134     if (hr != D2DERR_RECREATE_TARGET)
00135     {
00136         DX::ThrowIfFailed(hr);
00137     }
00138 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/LoggingChannelScenario.h Source File

  • Logging
  • cppwinrt

LoggingChannelScenario.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace winrt::SDKTemplate
00015 {
00016     class LoggingChannelScenario
00017     {
00018     public:
00019
00020         void
00021         LogWithWin81Constructor();
00022
00023         void
00024         LogWithWin10Constructor();
00025
00026     private:
00027
00028         void
00029         DemonstrateLogging(
00030             Windows::Foundation::Diagnostics::LoggingChannel const& channel);
00031
00032         hstring
00033         CollectExpensiveData();
00034
00035         void
00036         DoSomething(
00037             Windows::Foundation::Diagnostics::ILoggingTarget const& logger);
00038
00039         void
00040         OnLoggingEnabled(
00041             Windows::Foundation::Diagnostics::ILoggingChannel const& sender,
00042             Windows::Foundation::IInspectable const& e);
00043     };
00044 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
MediaList | Scenario1 | [private]
PlaybackList | Scenario1 | [private]
PlaybackList_ItemFailed(MediaPlaybackList sender, MediaPlaybackItemFailedEventArgs args) | Scenario1 | [inline, private]
Player | Scenario1 | [private]
Player_MediaPlayerRateChanged(MediaPlayer sender, MediaPlayerRateChangedEventArgs e) | Scenario1 | [inline, private]
PlayerViewModel | Scenario1 |
Scenario1() | Scenario1 | [inline]
Scenario1_Loaded(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
Scenario1_Unloaded(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
SettingsService_UseCustomControlsChanged(object sender, EventArgs e) | Scenario1 | [inline, private]
speedButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline]
UpdateControlVisibility() | Scenario1 | [inline, private]
UpdatePlaybackSpeed() | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario2_Connect.xaml.cs Source File

  • DatagramSocket
  • cs

Scenario2_Connect.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using Windows.ApplicationModel.Core;
00015 using Windows.Networking;
00016 using Windows.Networking.Sockets;
00017 using Windows.Storage.Streams;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace DatagramSocketSample
00024 {
00025     /// <summary>
00026     /// A page for second scenario.
00027     /// </summary>
00028     public sealed partial class Scenario2 : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public Scenario2()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046             // Make sure we're using the correct server address if an adapter was selected in scenario 1
00047             object serverAddress;
00048             if (CoreApplication.Properties.TryGetValue("serverAddress", out serverAddress))
00049             {
00050                 if (serverAddress is string)
00051                 {
00052                     HostNameForConnect.Text = serverAddress as string;
00053                 }
00054             }
00055         }
00056
00057         /// <summary>
00058         /// This is the click handler for the 'ConnectSocket' button.
00059         /// </summary>
00060         /// <param name="sender">Object for which the event was generated.</param>
00061         /// <param name="e">Event's parameters.</param>
00062         private async void ConnectSocket_Click(object sender, RoutedEventArgs e)
00063         {
00064             if (String.IsNullOrEmpty(ServiceNameForConnect.Text))
00065             {
00066                 rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
00067                 return;
00068             }
00069
00070             // By default 'HostNameForConnect' is disabled and host name validation is not required. When enabling the
00071             // text box validating the host name is required since it was received from an untrusted source (user
00072             // input). The host name is validated by catching ArgumentExceptions thrown by the HostName constructor for
00073             // invalid input.
00074             HostName hostName;
00075             try
00076             {
00077                 hostName = new HostName(HostNameForConnect.Text);
00078             }
00079             catch (ArgumentException)
00080             {
00081                 rootPage.NotifyUser("Error: Invalid host name.", NotifyType.ErrorMessage);
00082                 return;
00083             }
00084
00085             if (CoreApplication.Properties.ContainsKey("clientSocket"))
00086             {
00087                 rootPage.NotifyUser(
00088                     "This step has already been executed. Please move to the next one.",
00089                     NotifyType.ErrorMessage);
00090                 return;
00091             }
00092
00093             DatagramSocket socket = new DatagramSocket();
00094
00095             if (DontFragment.IsOn)
00096             {
00097                 // Set the IP DF (Don't Fragment) flag.
00098                 // This won't have any effect when running both client and server on localhost.
00099                 // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
00100                 socket.Control.DontFragment = true;
00101             }
00102
00103             socket.MessageReceived += MessageReceived;
00104
00105             // Save the socket, so subsequent steps can use it.
00106             CoreApplication.Properties.Add("clientSocket", socket);
00107
00108             rootPage.NotifyUser("Connecting to: " + HostNameForConnect.Text, NotifyType.StatusMessage);
00109
00110             try
00111             {
00112                 // Connect to the server (by default, the listener we created in the previous step).
00113                 await socket.ConnectAsync(hostName, ServiceNameForConnect.Text);
00114
00115                 rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
00116
00117                 // Mark the socket as connected. Set the value to null, as we care only about the fact that the
00118                 // property is set.
00119                 CoreApplication.Properties.Add("connected", null);
00120             }
00121             catch (Exception exception)
00122             {
00123                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00124                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00125                 {
00126                     throw;
00127                 }
00128
00129                 rootPage.NotifyUser("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
00130             }
00131         }
00132
00133         void MessageReceived(DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
00134         {
00135             try
00136             {
00137                 // Interpret the incoming datagram's entire contents as a string.
00138                 uint stringLength = eventArguments.GetDataReader().UnconsumedBufferLength;
00139                 string receivedMessage = eventArguments.GetDataReader().ReadString(stringLength);
00140
00141                 NotifyUserFromAsyncThread(
00142                     "Received data from remote peer: \"" +
00143                     receivedMessage + "\"",
00144                     NotifyType.StatusMessage);
00145             }
00146             catch (Exception exception)
00147             {
00148                 SocketErrorStatus socketError = SocketError.GetStatus(exception.HResult);
00149                 if (socketError == SocketErrorStatus.ConnectionResetByPeer)
00150                 {
00151                     // This error would indicate that a previous send operation resulted in an
00152                     // ICMP "Port Unreachable" message.
00153                     NotifyUserFromAsyncThread(
00154                         "Peer does not listen on the specific port. Please make sure that you run step 1 first " +
00155                         "or you have a server properly working on a remote server.",
00156                         NotifyType.ErrorMessage);
00157                 }
00158                 else if (socketError != SocketErrorStatus.Unknown)
00159                 {
00160                     NotifyUserFromAsyncThread(
00161                         "Error happened when receiving a datagram: " + socketError.ToString(),
00162                         NotifyType.ErrorMessage);
00163                 }
00164                 else
00165                 {
00166                     throw;
00167                 }
00168             }
00169         }
00170
00171         private void NotifyUserFromAsyncThread(string strMessage, NotifyType type)
00172         {
00173             var ignore = Dispatcher.RunAsync(
00174                 CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
00175         }
00176     }
00177 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/DetailsPage.xaml.cs Source File

  • XamlListView
  • cs

DetailsPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using Windows.UI.Core;
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Media.Animation;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class DetailsPage : Page
00020     {
00021         private Contact SelectedContact { set; get; }
00022
00023         public DetailsPage()
00024         {
00025             InitializeComponent();
00026         }
00027         private void OnLoaded(object sender, RoutedEventArgs e)
00028         {
00029             if (ShouldGoToWideState())
00030             {
00031                 // We shouldn't see this page since we are in "wide master-detail" mode.
00032                 // Play a transition as we are navigating from a separate page.
00033                 NavigateBackForWideState(useTransition: true);
00034             }
00035             else
00036             {
00037                 // Realize the main page content.
00038                 FindName("RootPanel");
00039             }
00040
00041             Window.Current.SizeChanged += OnWindowSizeChanged;
00042         }
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045             SelectedContact = e.Parameter as Contact;
00046             // Register for hardware and software back request from the system
00047             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00048             systemNavigationManager.BackRequested += OnBackRequested;
00049             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
00050         }
00051         protected override void OnNavigatedFrom(NavigationEventArgs e)
00052         {
00053             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00054             systemNavigationManager.BackRequested -= OnBackRequested;
00055             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
00056         }
00057         private void OnBackRequested(object sender, BackRequestedEventArgs e)
00058         {
00059             // Mark event as handled so we don't get bounced out of the app.
00060             e.Handled = true;
00061             // Page above us will be our master view.
00062             // Make sure we are using the "drill out" animation in this transition.
00063             Frame.Navigate(typeof(Scenario3_MasterDetail), "S" + SelectedContact.Id, new EntranceNavigationTransitionInfo());
00064         }
00065         void NavigateBackForWideState(bool useTransition)
00066         {
00067             // Evict this page from the cache as we may not need it again.
00068             NavigationCacheMode = NavigationCacheMode.Disabled;
00069
00070             if (useTransition)
00071             {
00072                 Frame.GoBack(new EntranceNavigationTransitionInfo());
00073             }
00074             else
00075             {
00076                 Frame.GoBack(new SuppressNavigationTransitionInfo());
00077             }
00078         }
00079         private bool ShouldGoToWideState()
00080         {
00081             return Window.Current.Bounds.Width >= 720;
00082         }
00083         private void OnUnloaded(object sender, RoutedEventArgs e)
00084         {
00085             Window.Current.SizeChanged -= OnWindowSizeChanged;
00086         }
00087         private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
00088         {
00089             if (ShouldGoToWideState())
00090             {
00091                 // Make sure we are no longer listening to window change events.
00092                 Window.Current.SizeChanged -= OnWindowSizeChanged;
00093
00094                 // We shouldn't see this page since we are in "wide master-detail" mode.
00095                 NavigateBackForWideState(useTransition: false);
00096             }
00097         }
00098         private void DeleteItem(object sender, RoutedEventArgs e)
00099         {
00100             Frame.Navigate(typeof(Scenario3_MasterDetail), "D" + SelectedContact.Id, new EntranceNavigationTransitionInfo());
00101         }
00102     }
00103 }
Generated on Fri Nov 15 2024 22:22:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/Scenario1_Basic.xaml.cpp Source File

  • XamlAnimatedGif
  • cpp

Scenario1_Basic.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Basic.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::UI::Xaml;
00018
00019 Scenario1_Basic::Scenario1_Basic()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void Scenario1_Basic::ClickToPlaySource_ImageOpened(Object^ sender, RoutedEventArgs^ e)
00025 {
00026     // Once ImageOpened is raised, we can query whether an image is animated.
00027     if (ClickToPlaySource->IsAnimatedBitmap)
00028     {
00029         PlaybackButtons->Visibility = Windows::UI::Xaml::Visibility::Visible;
00030     }
00031 }
Generated on Fri Nov 15 2024 22:19:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario02_GetStream.xaml.cs Source File

  • HttpClient
  • cs

Scenario02_GetStream.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Text;
00015 using System.Threading;
00016 using System.Threading.Tasks;
00017 using Windows.Security.Cryptography;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022 using Windows.Web.Http;
00023
00024 namespace SDKTemplate
00025 {
00026     public sealed partial class Scenario02_GetStream : Page
00027     {
00028         MainPage rootPage = MainPage.Current;
00029
00030         private HttpClient httpClient;
00031         private CancellationTokenSource cts;
00032
00033         public Scenario02_GetStream()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         protected override void OnNavigatedTo(NavigationEventArgs e)
00039         {
00040             httpClient = Helpers.CreateHttpClientWithPlugIn();
00041             cts = new CancellationTokenSource();
00042         }
00043
00044         protected override void OnNavigatedFrom(NavigationEventArgs e)
00045         {
00046             cts.Cancel();
00047             cts.Dispose();
00048             httpClient.Dispose();
00049         }
00050
00051         private async void Start_Click(object sender, RoutedEventArgs e)
00052         {
00053             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00054             // valid, absolute URI, we'll notify the user about the incorrect input.
00055             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00056             if (resourceUri == null)
00057             {
00058                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00059                 return;
00060             }
00061
00062             Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
00063             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00064
00065             HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, resourceUri);
00066
00067             // This sample uses a "try" in order to support TaskCanceledException.
00068             // If you don't need to support cancellation, then the "try" is not needed.
00069             try
00070             {
00071                 // Do not buffer the response.
00072                 HttpRequestResult result = await httpClient.TrySendRequestAsync(
00073                     request,
00074                     HttpCompletionOption.ResponseHeadersRead).AsTask(cts.Token);
00075
00076                 if (result.Succeeded)
00077                 {
00078                     OutputField.Text += Helpers.SerializeHeaders(result.ResponseMessage);
00079
00080                     StringBuilder responseBody = new StringBuilder();
00081                     using (Stream responseStream = (await result.ResponseMessage.Content.ReadAsInputStreamAsync()).AsStreamForRead())
00082                     {
00083                         int read = 0;
00084                         byte[] responseBytes = new byte[1000];
00085                         do
00086                         {
00087                             read = await responseStream.ReadAsync(responseBytes, 0, responseBytes.Length);
00088
00089                             responseBody.AppendFormat("Bytes read from stream: {0}", read);
00090                             responseBody.AppendLine();
00091
00092                             // Use the buffer contents for something. We can't safely display it as a string though, since encodings
00093                             // like UTF-8 and UTF-16 have a variable number of bytes per character and so the last bytes in the buffer
00094                             // may not contain a whole character. Instead, we'll convert the bytes to hex and display the result.
00095                             IBuffer responseBuffer = CryptographicBuffer.CreateFromByteArray(responseBytes);
00096                             responseBuffer.Length = (uint)read;
00097                             responseBody.AppendFormat(CryptographicBuffer.EncodeToHexString(responseBuffer));
00098                             responseBody.AppendLine();
00099                         } while (read != 0);
00100                     }
00101                     OutputField.Text += responseBody.ToString();
00102
00103                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00104                 }
00105                 else
00106                 {
00107                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00108                 }
00109             }
00110             catch (TaskCanceledException)
00111             {
00112                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00113             }
00114
00115             Helpers.ScenarioCompleted(StartButton, CancelButton);
00116         }
00117
00118         private void Cancel_Click(object sender, RoutedEventArgs e)
00119         {
00120             cts.Cancel();
00121             cts.Dispose();
00122
00123             // Re-create the CancellationTokenSource.
00124             cts = new CancellationTokenSource();
00125         }
00126     }
00127 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.h Source File

  • LinguisticServices
  • RuntimeComponent

LinguisticServices.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include "LinguisticServices.g.h"
00004
00005 namespace winrt::Sample::implementation
00006 {
00007     struct LinguisticServices
00008     {
00009         static Windows::Foundation::Collections::IVectorView<hstring> RecognizeTextLanguages(hstring const& text);
00010         static Windows::Foundation::Collections::IVectorView<RecognizedTextRun> RecognizeTextScripts(hstring const& text);
00011         static hstring TransliterateFromCyrillicToLatin(hstring const& text);
00012
00013     };
00014 }
00015
00016 namespace winrt::Sample::factory_implementation
00017 {
00018     struct LinguisticServices : LinguisticServicesT<LinguisticServices, implementation::LinguisticServices>
00019     {
00020     };
00021 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario1 | [inline, private]
Scenario1() | Scenario1 | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BitrateHelper Member List

This is the complete list of members for BitrateHelper, including all inherited members.
BitrateHelper(IEnumerable< uint > availableBitRates) | BitrateHelper | [inline]
GetBitrateSymbol(uint currentBitrate) | BitrateHelper | [inline]
symbolAssignment | BitrateHelper | [private]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SessionWrapper Member List

This is the complete list of members for SessionWrapper, including all inherited members.
AddDatagramSocketAsync(UInt16 port) | SessionWrapper | [inline]
AddStreamSocketInternal(StreamSocket socket) | SessionWrapper | [inline]
AddStreamSocketListenerAsync(UInt16 port) | SessionWrapper | [inline]
AdvertisementId | SessionWrapper |
Close() | SessionWrapper | [inline]
Dispose() | SessionWrapper | [inline]
Dispose(bool disposing) | SessionWrapper | [inline, protected, virtual]
disposed | SessionWrapper | [private]
manager | SessionWrapper | [private]
OnRemotePortAdded(WiFiDirectServiceSession sender, WiFiDirectServiceRemotePortAddedEventArgs args) | SessionWrapper | [inline, private]
OnSessionStatusChanged(WiFiDirectServiceSession sender, object args) | SessionWrapper | [inline, private]
ServiceAddress | SessionWrapper |
session | SessionWrapper | [private]
Session | SessionWrapper |
SessionAddress | SessionWrapper |
sessionClosedEvent | SessionWrapper | [private]
SessionId | SessionWrapper |
SessionWrapper(WiFiDirectServiceSession session, WiFiDirectServiceManager manager) | SessionWrapper | [inline]
socketList | SessionWrapper | [private]
SocketList | SessionWrapper |
streamSocketListeners | SessionWrapper | [private]
ThrowIfDisposed() | SessionWrapper | [inline, private]
~SessionWrapper() | SessionWrapper | [inline, private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario1_ListView.xaml.cpp Source File

  • XamlDragAndDrop
  • cpp

Scenario1_ListView.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_ListView.xaml.h"
00013
00014 using namespace concurrency;
00015 using namespace SDKTemplate;
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027 using namespace Windows::ApplicationModel::DataTransfer;
00028
00029 Scenario1_ListView::Scenario1_ListView() : rootPage(MainPage::Current)
00030 {
00031     InitializeComponent();
00032
00033     _reference = GetSampleData();
00034     _selection = ref new Vector<String^>();
00035     SourceListView->ItemsSource = _reference;
00036     TargetListView->ItemsSource = _selection;
00037 }
00038
00039 Vector<String^>^ Scenario1_ListView::GetSampleData()
00040 {
00041     return ref new Vector<String^>(
00042     {
00043         ref new String(L"My Research Paper"),
00044         ref new String(L"Electricity Bill"),
00045         ref new String(L"My To-do list"),
00046         ref new String(L"TV sales receipt"),
00047         ref new String(L"Water Bill"),
00048         ref new String(L"Grocery List"),
00049         ref new String(L"Superbowl schedule"),
00050         ref new String(L"World Cup E-ticket")
00051     });
00052 }
00053
00054 /// <summary>
00055 /// DragItemsStarting is called when the Drag and Drop operation starts
00056 /// We take advantage of it to set the content of the DataPackage
00057 /// as well as indicate which operations are supported
00058 /// </summary>
00059 /// <param name="sender"></param>
00060 /// <param name="e"></param>
00061 void Scenario1_ListView::SourceListView_DragItemsStarting(Platform::Object^ sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^ e)
00062 {
00063     // Prepare a string with one dragged item per line
00064     String^ items = nullptr;
00065     unsigned int n = e->Items->Size;
00066     for (unsigned int i = 0; i < n; i++)
00067     {
00068         if (items != nullptr) items += ref new String(L"\n");
00069         items += dynamic_cast<String^>(e->Items->GetAt(i));
00070     }
00071     // Set the content of the DataPackage
00072     e->Data->SetText(items);
00073     // As we want our Reference list to say intact, we only allow Copy
00074     e->Data->RequestedOperation = DataPackageOperation::Copy;
00075 }
00076
00077 /// <summary>
00078 /// DragOver is called when the dragged pointer moves over a UIElement with AllowDrop=True
00079 /// We need to return an AcceptedOperation != None in either DragOver or DragEnter
00080 /// </summary>
00081 /// <param name="sender"></param>
00082 /// <param name="e"></param>
00083 void Scenario1_ListView::TargetListView_DragOver(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e)
00084 {
00085     // Our list only accepts text
00086     e->AcceptedOperation = (e->DataView->Contains(StandardDataFormats::Text)) ? DataPackageOperation::Copy : DataPackageOperation::None;
00087 }
00088
00089 /// <summary>
00090 /// We need to return the effective operation from Drop
00091 /// This is not important for our source ListView, but it might be if the user
00092 /// drags text from another source
00093 /// </summary>
00094 /// <param name="sender"></param>
00095 /// <param name="e"></param>
00096 void Scenario1_ListView::TargetListView_Drop(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e)
00097 {
00098     // This test is in theory not needed as we returned DataPackageOperation.None if
00099     // the DataPackage did not contained text. However, it is always better if each
00100     // method is robust by itself
00101     if (e->DataView->Contains(StandardDataFormats::Text))
00102     {
00103         // We need to take a Deferral as we won't be able to confirm the end
00104         // of the operation synchronously
00105         auto def = e->GetDeferral();
00106         create_task(e->DataView->GetTextAsync()).then([def, this, e](String^ s)
00107         {
00108             // Parse the string to add items corresponding to each line
00109             auto wsText = s->Data();
00110             while (wsText) {
00111                 auto wsNext = wcschr(wsText, L'\n');
00112                 if (wsNext == nullptr)
00113                 {
00114                     // No more separator
00115                     _selection->Append(ref new String(wsText));
00116                     wsText = wsNext;
00117                 }
00118                 else
00119                 {
00120                     _selection->Append(ref new String(wsText, wsNext - wsText));
00121                     wsText = wsNext + 1;
00122                 }
00123
00124             }
00125             e->AcceptedOperation = DataPackageOperation::Copy;
00126             def->Complete();
00127         });
00128     }
00129 }
00130
00131 /// <summary>
00132 /// DragtemsStarting is called for D&D and reorder as the framework does not
00133 /// know wherer the user will drop the items. Reorder means that the target
00134 /// and the source ListView are the same.
00135 /// </summary>
00136 /// <param name="sender"></param>
00137 /// <param name="e"></param>
00138 void Scenario1_ListView::TargetListView_DragItemsStarting(Platform::Object^ sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^ e)
00139 {
00140     // The ListView is declared with selection mode set to Single.
00141     // But we want the code to be robust
00142     if (e->Items->Size == 1)
00143     {
00144         e->Data->SetText(dynamic_cast<String^>(e->Items->GetAt(0)));
00145         // Reorder or move to trash are always a move
00146         e->Data->RequestedOperation = DataPackageOperation::Move;
00147         _deletedItem = nullptr;
00148     }
00149 }
00150
00151 /// <summary>
00152 /// Called at the end of the operation, whether it was a reorder or move to trash
00153 /// </summary>
00154 /// <param name="sender"></param>
00155 /// <param name="args"></param>
00156 void Scenario1_ListView::TargetListView_DragItemsCompleted(Windows::UI::Xaml::Controls::ListViewBase^ sender, Windows::UI::Xaml::Controls::DragItemsCompletedEventArgs^ args)
00157 {
00158     // args.DropResult is always Move and therefore we have to rely on _deletedItem to distinguish
00159     // between reorder and move to trash
00160     // Another solution would be to listen for events in the ObservableCollection
00161     unsigned index;
00162     if ((_deletedItem != nullptr) && _selection->IndexOf(_deletedItem, &index))
00163     {
00164         _selection->RemoveAt(index);
00165         _deletedItem = nullptr;
00166     }
00167 }
00168
00169 /// <summary>
00170 /// Entering the Trash icon
00171 /// </summary>
00172 /// <param name="sender"></param>
00173 /// <param name="e"></param>
00174 void Scenario1_ListView::TargetTextBlock_DragEnter(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e)
00175 {
00176     // Trash only accepts text
00177     e->AcceptedOperation = (e->DataView->Contains(StandardDataFormats::Text) ? DataPackageOperation::Move : DataPackageOperation::None);
00178     // We don't want to show the Move icon
00179     e->DragUIOverride->IsGlyphVisible = false;
00180     e->DragUIOverride->Caption = ref new String(L"Drop item here to remove it from selection");
00181 }
00182
00183 /// <summary>
00184 /// Drop on the Trash
00185 /// </summary>
00186 /// <param name="sender"></param>
00187 /// <param name="e"></param>
00188 void Scenario1_ListView::TargetTextBlock_Drop(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e)
00189 {
00190     if (e->DataView->Contains(StandardDataFormats::Text))
00191     {
00192         // We need to take the deferral as the source will read _deletedItem which
00193         // we cannot set synchronously
00194         auto def = e->GetDeferral();
00195         create_task(e->DataView->GetTextAsync()).then([this, e, def](String^ s)
00196         {
00197             _deletedItem = s;
00198             e->AcceptedOperation = DataPackageOperation::Move;
00199             def->Complete();
00200         });
00201     }
00202 }
00203
Generated on Fri Nov 15 2024 22:22:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MediaCaptureManager.h Source File

  • HolographicMixedRealityCapture
  • cpp

MediaCaptureManager.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <ppltasks.h>
00004 #include <mfapi.h>
00005
00006 namespace HolographicMRCSample
00007 {
00008     class MediaCaptureManager
00009     {
00010     private:
00011         typedef enum
00012         {
00013             Unknown = 0,
00014             Initialized,
00015             StartingRecord,
00016             Recording,
00017             StoppingRecord,
00018             TakingPhoto
00019         } State;
00020
00021     public:
00022         MediaCaptureManager();
00023         virtual ~MediaCaptureManager();
00024
00025         Concurrency::task<void> InitializeAsync(IMFDXGIDeviceManager *pDxgiDeviceManager = nullptr);
00026
00027         Concurrency::task<void> StartRecordingAsync();
00028         Concurrency::task<void> StopRecordingAsync();
00029
00030         Concurrency::task<void> TakePhotoAsync();
00031
00032         void SetHologramEnabled(const bool enabled)    { auto lock = m_lock.LockExclusive(); m_hologramEnabled = enabled; }
00033         void SetSystemAudioEnabled(const bool enabled) { auto lock = m_lock.LockExclusive(); m_sysAudioEnabled = enabled; }
00034
00035         bool IsHologramEnabled()    { auto lock = m_lock.LockShared(); return m_hologramEnabled; }
00036         bool IsSystemAudioEnabled() { auto lock = m_lock.LockShared(); return m_sysAudioEnabled; }
00037         bool CanTakePhoto();
00038         bool CanToggleVideo();
00039
00040     private:
00041         Microsoft::WRL::Wrappers::SRWLock m_lock;
00042         Platform::Agile<Windows::Media::Capture::MediaCapture>  m_mediaCapture;
00043
00044         State m_currentState;
00045
00046         bool m_hologramEnabled;
00047         bool m_sysAudioEnabled;
00048
00049         bool m_videoEffectAdded;
00050         bool m_photoEffectAdded;
00051         bool m_audioEffectAdded;
00052
00053         Microsoft::WRL::ComPtr<IMFDXGIDeviceManager>    m_spMFDXGIDeviceManager;
00054     };
00055 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario8.xaml.cs Source File

  • ApplicationResources
  • cs

scenario8.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Text;
00014 using Windows.ApplicationModel.Resources.Core;
00015 using Windows.Globalization;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario8 : Page
00026     {
00027         int lastSelectedIndex;
00028
00029         public Scenario8()
00030         {
00031             this.InitializeComponent();
00032             PopulateComboBox();
00033             UpdateCurrentAppLanguageMessage();
00034         }
00035
00036         private void ShowText()
00037         {
00038             ResourceContext defaultContextForCurrentView = ResourceContext.GetForCurrentView();
00039             ResourceMap stringResourcesResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
00040             Scenario8MessageTextBlock.Text = stringResourcesResourceMap.GetValue("string1", defaultContextForCurrentView).ValueAsString;
00041         }
00042
00043         private void LanguageOverrideCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
00044         {
00045             var combo = sender as ComboBox;
00046             var item = combo.SelectedValue as ComboBoxItem;
00047             var languageTag = item.Tag as string;
00048
00049             // Ignore the divider (tag = "-")
00050             if (languageTag == "-")
00051             {
00052                 combo.SelectedIndex = lastSelectedIndex;
00053             }
00054             else
00055             {
00056                 lastSelectedIndex = combo.SelectedIndex;
00057
00058                 // Set the persistent language override
00059                 ApplicationLanguages.PrimaryLanguageOverride = languageTag;
00060
00061                 // update current app languages message
00062                 UpdateCurrentAppLanguageMessage();
00063             }
00064         }
00065
00066         void AddItemForLanguageTag(string languageTag)
00067         {
00068             var language = new Language(languageTag);
00069             var item = new ComboBoxItem { Content = language.DisplayName, Tag = languageTag };
00070             LanguageOverrideCombo.Items.Add(item);
00071
00072             // Select this item if it is the primary language override.
00073             if (languageTag == ApplicationLanguages.PrimaryLanguageOverride)
00074             {
00075                 LanguageOverrideCombo.SelectedItem = item;
00076             }
00077         }
00078
00079         void PopulateComboBox()
00080         {
00081             // First show the default setting
00082             LanguageOverrideCombo.Items.Add(new ComboBoxItem { Content = "Use language preferences (recommended)", Tag = "" });
00083             LanguageOverrideCombo.SelectedIndex = 0;
00084
00085             // If there are app languages that the user speaks, show them next
00086
00087             // Note: the first (non-override) language, if set as the primary language override
00088             // would give the same result as not having any primary language override. There's
00089             // still a difference, though: If the user changes their language preferences, the
00090             // default setting (no override) would mean that the actual primary app language
00091             // could change. But if it's set as an override, then it will remain the primary
00092             // app language after the user changes their language preferences.
00093
00094             foreach (var languageTag in ApplicationLanguages.Languages)
00095             {
00096                 AddItemForLanguageTag(languageTag);
00097             }
00098
00099             // Now add a divider followed by all the app manifest languages (in case the user
00100             // wants to pick a language not currently in their profile)
00101
00102             // NOTE: If an app is deployed using a bundle with resource packages, the following
00103             // addition to the list may not be useful: The set of languages returned by
00104             // ApplicationLanguages.ManifestLanguages will consist of only those manifest
00105             // languages in the main app package or in the resource packages that are installed
00106             // and registered for the current user. Language resource packages get deployed for
00107             // the user if the language is in the user's profile. Therefore, the only difference
00108             // from the set returned by ApplicationLanguages.Languages above would depend on
00109             // which languages are included in the main app package.
00110
00111             LanguageOverrideCombo.Items.Add(new ComboBoxItem { Content = "——————", Tag = "-" });
00112
00113             // In a production app, this list should be sorted, but that's beyond the
00114             // focus of this sample.
00115             foreach (var languageTag in ApplicationLanguages.ManifestLanguages)
00116             {
00117                 AddItemForLanguageTag(languageTag);
00118             }
00119
00120             LanguageOverrideCombo.SelectionChanged += LanguageOverrideCombo_SelectionChanged;
00121
00122             lastSelectedIndex = LanguageOverrideCombo.SelectedIndex;
00123         }
00124
00125         private void UpdateCurrentAppLanguageMessage()
00126         {
00127             this.Scenario8AppLanguagesTextBlock.Text = "Current app language(s): " + GetAppLanguagesAsFormattedString();
00128         }
00129
00130         private string GetAppLanguagesAsFormattedString()
00131         {
00132             return String.Join(", ", ApplicationLanguages.Languages);
00133         }
00134     }
00135 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/Content.xaml.cs Source File

  • KeyCredentialManager
  • cs

Content.xaml.cs

Go to the documentation of this file.
00001 ﻿using SDKTemplate;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009 using Windows.UI.Xaml.Navigation;
00010 using Windows.Security.Credentials;
00011
00012 namespace SDKTemplate
00013 {
00014     public sealed partial class Content : Page
00015     {
00016         private MainPage rootPage;
00017         private Account activeAccount;
00018
00019         public Content()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         protected override void OnNavigatedTo(NavigationEventArgs e)
00025         {
00026             rootPage = MainPage.Current;
00027             activeAccount = (Account) e.Parameter;
00028         }
00029
00030         private void Button_Restart_Click(object sender, RoutedEventArgs e)
00031         {
00032             this.Frame.Navigate(typeof(UserSelect));
00033         }
00034
00035         private void Button_Forget_Click(object sender, RoutedEventArgs e)
00036         {
00037             if (activeAccount.UsesPassport == true)
00038             {
00039                 PassportDelete();
00040             }
00041
00042             UserSelect.accountList.Remove(activeAccount);
00043             AccountsHelper.SaveAccountList(UserSelect.accountList);
00044
00045             rootPage.NotifyUser("User " + activeAccount.Email + " deleted.", NotifyType.StatusMessage);
00046             button_Forget.IsEnabled = false;
00047             button_Forget.Content = "User Forgotten.";
00048         }
00049
00050         /// <summary>
00051         /// Checks the KeyCredentialManager to see if there is a Passport for the current user and
00052         /// sends the informaton to the server to unregister it.
00053         ///
00054         /// Then deletes the local key associated with the Passport.
00055         /// </summary>
00056         private async void PassportDelete()
00057         {
00058             KeyCredentialRetrievalResult keyOpenResult = await KeyCredentialManager.OpenAsync(activeAccount.Email);
00059
00060             if (keyOpenResult.Status == KeyCredentialStatus.Success)
00061             {
00062                 var userKey = keyOpenResult.Credential;
00063                 var publicKey = userKey.RetrievePublicKey();
00064
00065                 // Send key information to server to unregister it
00066                 DeletePassportServerSide();
00067             }
00068
00069             await KeyCredentialManager.DeleteAsync(activeAccount.Email);
00070         }
00071
00072         /// <summary>
00073         /// Function used to unregister user's Passport on the server side
00074         /// </summary>
00075         /// <returns></returns>
00076         private async Task<bool> DeletePassportServerSide()
00077         {
00078             return true;
00079         }
00080     }
00081 }
Generated on Fri Nov 15 2024 22:20:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/SampleConfiguration.cpp Source File

  • ApplicationResources
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     // The format here is the following:
00021     //     { "Description for the sample", "Fully quaified name for the class that implements the scenario" }
00022     { "String Resources In XAML", "SDKTemplate.Scenario1" },
00023     { "File Resources In XAML", "SDKTemplate.Scenario2" },
00024     { "String Resources In Code", "SDKTemplate.Scenario3" },
00025     { "Resources in the AppX manifest", "SDKTemplate.Scenario4" },
00026     { "Additional Resource Files", "SDKTemplate.Scenario5" },
00027     { "Runtime Changes/Events", "SDKTemplate.Scenario7" },
00028     { "Application Languages", "SDKTemplate.Scenario8" },
00029     { "Multi-dimensional fallback", "SDKTemplate.Scenario10" },
00030     { "Working with webservices", "SDKTemplate.Scenario11" },
00031     { "Retrieving resources in non-UI threads", "SDKTemplate.Scenario12" },
00032     { "File resources in code", "SDKTemplate.Scenario13" }
00033 };
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.cpp Source File

  • CameraProfile
  • cpp

Scenario1_SetRecordProfile.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_SetRecordProfile.xaml.h"
00014 #include <math.h>
00015 #include <sstream>
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace SDKTemplate;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Media::Capture;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Input;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 /// <summary>
00034 /// Initializes a new instance of the <see cref="Scenario1_SetRecordProfile"/> class.
00035 /// </summary>
00036 Scenario1_SetRecordProfile::Scenario1_SetRecordProfile() : _rootPage(MainPage::Current)
00037 {
00038     InitializeComponent();
00039 }
00040
00041 /// <summary>
00042 /// Override default OnNavigateTo to initialize
00043 /// the rootPage object for Status message updates
00044 /// </summary>
00045 /// <param name="e">Contains state information and event data associated with the event</param>
00046 void Scenario1_SetRecordProfile::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00047 {
00048     _rootPage = MainPage::Current;
00049 }
00050
00051 /// <summary>
00052 /// Locates a video profile for the back camera and then queries if
00053 /// the discovered profile supports 640x480 30 FPS recording.
00054 /// If a supported profile is located, then we configure media
00055 /// settings to the matching profile. Else we use default profile.
00056 /// </summary>
00057 /// <param name="sender">Contains information regarding button that fired event</param>
00058 /// <param name="e">Contains state information and event data associated with the event</param>
00059 void Scenario1_SetRecordProfile::InitRecordProfileBtn_Click(Object^, RoutedEventArgs^)
00060 {
00061     // Look for a video capture device Id with a video profile matching panel location
00062     GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel::Back)
00063         .then([this](String^ videoDeviceId)
00064     {
00065         if (videoDeviceId == nullptr)
00066         {
00067             LogStatusAsync("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType::ErrorMessage);
00068             return;
00069         }
00070
00071         std::wstringstream ss;
00072         ss << "Found video capture device that supports Video Profile, Device ID: \r\n" << videoDeviceId->Data();
00073         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00074         LogStatusToOutputBoxAsync("Retrieving all Video Profiles");
00075
00076         MediaCapture^ mediaCapture = ref new MediaCapture();
00077         auto profiles = mediaCapture->FindAllVideoProfiles(videoDeviceId);
00078
00079         ss.str(std::wstring());
00080         ss << "Number of Video Profiles found: " << profiles->Size;
00081         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00082         LogStatusToOutputBoxAsync("Querying for matching WVGA 30FPS Profile");
00083
00084         // Output all Video Profiles found, frame rate is rounded up for display purposes
00085         // Also looking for WVGA 30FPS profile
00086         MediaCaptureInitializationSettings^ mediaInitSettings = ref new MediaCaptureInitializationSettings();
00087         bool profileFound = false;
00088         for (auto profile : profiles)
00089         {
00090             auto description = profile->SupportedRecordMediaDescription;
00091             for (auto desc : description)
00092             {
00093                 PrintProfileInformation(profile, desc);
00094
00095                 if (!profileFound)
00096                 {
00097                     if (desc->Width == 640 &&
00098                         desc->Height == 480 &&
00099                         round(desc->FrameRate) == 30)
00100                     {
00101                         mediaInitSettings->VideoProfile = profile;
00102                         mediaInitSettings->RecordMediaDescription = desc;
00103                         profileFound = true;;
00104                     }
00105                 }
00106             }
00107         }
00108
00109         if (profileFound)
00110         {
00111             LogStatusToOutputBoxAsync("WVGA 30FPS profile found");
00112             PrintProfileInformation(mediaInitSettings->VideoProfile, mediaInitSettings->RecordMediaDescription);
00113         }
00114         else
00115         {
00116             // Could not locate a WVGA 30FPS profile, use default video recording profile
00117             mediaInitSettings->VideoProfile = profiles->GetAt(0);
00118             LogStatusAsync("Could not locate a matching profile, setting to default recording profile", NotifyType::ErrorMessage);
00119         }
00120
00121         create_task(mediaCapture->InitializeAsync(mediaInitSettings))
00122             .then([this]()
00123         {
00124             LogStatusToOutputBoxAsync("Media Capture settings initialized to selected profile");
00125         });
00126     });
00127 }
00128
00129 /// <summary>
00130 /// Locates a video profile for the back camera and then queries if
00131 /// the discovered profile is a matching custom profile.
00132 /// If a custom profile is located, we configure media
00133 /// settings to the custom profile. Else we use default profile.
00134 /// </summary>
00135 /// <param name="sender">Contains information regarding button that fired event</param>
00136 /// <param name="e">Contains state information and event data associated with the event</param>
00137 void Scenario1_SetRecordProfile::InitCustomProfileBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00138 {
00139     GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel::Back)
00140         .then([this](String^ videoDeviceId)
00141     {
00142         if (videoDeviceId == nullptr)
00143         {
00144             _rootPage->NotifyUser("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType::ErrorMessage);
00145             return;
00146         }
00147
00148         MediaCapture^ mediaCapture = ref new MediaCapture();
00149         MediaCaptureInitializationSettings^ mediaInitSettings = ref new MediaCaptureInitializationSettings();
00150
00151         // For demonstration purposes, we use the Profile Id from WVGA 640x480 30 FPS profile available
00152         // on desktop simulator and phone emulators
00153         String^ customProfileId = "{A0E517E8-8F8C-4F6F-9A57-46FC2F647EC0},0";
00154
00155         std::wstringstream ss;
00156         ss << "Found video capture device that supports Video Profile, Device ID: \r\n" << videoDeviceId->Data();
00157         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00158
00159         LogStatusToOutputBoxAsync("Querying device for custom profile support");
00160         mediaInitSettings->VideoProfile = nullptr;
00161         auto allVideoProfiles = mediaCapture->FindAllVideoProfiles(videoDeviceId);
00162         for (auto profile : allVideoProfiles)
00163         {
00164             if (profile->Id == customProfileId)
00165             {
00166                 mediaInitSettings->VideoProfile = profile;
00167                 break;
00168             }
00169         }
00170
00171         // In the event the profile isn't located, we set Video Profile to the default
00172         if (mediaInitSettings->VideoProfile == nullptr)
00173         {
00174             LogStatusAsync("Could not locate a matching profile, setting to default recording profile", NotifyType::ErrorMessage);
00175             mediaInitSettings->VideoProfile = allVideoProfiles->GetAt(0);
00176         }
00177
00178         ss.str(std::wstring());
00179         ss << "Custom recording profile located: " << customProfileId->Data();
00180         LogStatusAsync(ref new String(ss.str().c_str()), NotifyType::StatusMessage);
00181         create_task(mediaCapture->InitializeAsync(mediaInitSettings));
00182     });
00183 }
00184
00185 /// <summary>
00186 /// Helper method to obtain a device Id that supports a Video Profile.
00187 /// If no Video Profile is found we return empty string indicating that there isn't a device on
00188 /// the desired panel with a supported Video Profile.
00189 /// </summary>
00190 /// <param name="panel">Contains Device Enumeration information regarding camera panel we are looking for</param>
00191 /// <returns>Device Information Id string</returns>
00192 task<String^> Scenario1_SetRecordProfile::GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel panel)
00193 {
00194     // Find all video capture devices
00195     LogStatusToOutputBoxAsync("Looking for all video capture devices");
00196
00197     return create_task(DeviceInformation::FindAllAsync(DeviceClass::VideoCapture))
00198         .then([this, panel](DeviceInformationCollection^ devices)
00199     {
00200         String^ deviceId = nullptr;
00201         std::wstringstream ss;
00202         ss << "Number of video capture devices found: " << devices->Size;
00203         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00204
00205         // Loop through devices looking for device that supports Video Profile
00206         for (auto cameraDeviceInfo : devices)
00207         {
00208             if (MediaCapture::IsVideoProfileSupported(cameraDeviceInfo->Id) && cameraDeviceInfo->EnclosureLocation->Panel == panel)
00209             {
00210                 deviceId = cameraDeviceInfo->Id;
00211                 break;
00212             }
00213         }
00214
00215         return deviceId;
00216     });
00217 }
00218
00219 /// <summary>
00220 /// Marshall log message to the UI thread and update outputBox, this method is for more general messages
00221 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00222 /// which they were called without task chaining
00223 /// </summary>
00224 /// <param name="message">Message to log to the outputBox</param>
00225 /// <returns></returns>
00226 task<void> Scenario1_SetRecordProfile::LogStatusToOutputBoxAsync(String^ message)
00227 {
00228     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message]()
00229     {
00230         outputBox->Text += message + "\r\n";
00231         outputScrollViewer->ChangeView(0.0, outputBox->ActualHeight, 1.0f);
00232     })));
00233 }
00234
00235 /// <summary>
00236 /// Method to log Status to Main Status block, this method is for important status messages to be
00237 /// displayed at bottom of scenario page
00238 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00239 /// which they were called without task chaining
00240 /// </summary>
00241 /// <param name="message">Message to log to the output box</param>
00242 /// <param name="type">Notification Type for status message</param>
00243 /// <returns></returns>
00244 task<void> Scenario1_SetRecordProfile::LogStatusAsync(String^ message, NotifyType type)
00245 {
00246     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type]()
00247     {
00248         _rootPage->NotifyUser(message, type);
00249     }))).then([this, message]()
00250     {
00251         return LogStatusToOutputBoxAsync(message);
00252     });
00253 }
00254
00255 /// <summary>
00256 /// Helper to print MediaCapture profile information
00257 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00258 /// which they were called without task chaining
00259 /// </summary>
00260 /// <param name="message">MediaCapture video profile</param>
00261 /// <param name="type">MediaCapture video profile description</param>
00262 /// <returns></returns>
00263 task<void> Scenario1_SetRecordProfile::PrintProfileInformation(MediaCaptureVideoProfile^ profile, MediaCaptureVideoProfileMediaDescription^ description)
00264 {
00265     std::wstringstream ss;
00266     ss << "VideoProfile: Profile Id:" << profile->Id->Data() << "\r\n" << \
00267         "Width: " << description->Width << \
00268         "Height:" << description->Height << \
00269         "FrameRate" << round(description->FrameRate);
00270     return LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00271 }
Generated on Fri Nov 15 2024 22:18:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_AddAudioTracks Member List

This is the complete list of members for Scenario3_AddAudioTracks, including all inherited members.
AddAudio_Click(object sender, RoutedEventArgs e) | Scenario3_AddAudioTracks | [inline, private]
ChooseVideo_Click(object sender, RoutedEventArgs e) | Scenario3_AddAudioTracks | [inline, private]
composition | Scenario3_AddAudioTracks | [private]
mediaStreamSource | Scenario3_AddAudioTracks | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_AddAudioTracks | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_AddAudioTracks | [inline, protected]
pickedFile | Scenario3_AddAudioTracks | [private]
rootPage | Scenario3_AddAudioTracks | [private]
Scenario3_AddAudioTracks() | Scenario3_AddAudioTracks | [inline]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ChangePIN Member List

This is the complete list of members for Scenario2_ChangePIN, including all inherited members.
ChangePin_Click(object sender, RoutedEventArgs e) | Scenario2_ChangePIN | [inline, private]
rootPage | Scenario2_ChangePIN | [private]
Scenario2_ChangePIN() | Scenario2_ChangePIN | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/pch.h Source File

  • Gyrometer
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SampleConfiguration.cpp Source File

  • WiFiDirect
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Windows::UI::Core;
00018
00019 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00020 {
00021     { "Advertiser", "SDKTemplate.Scenario1_Advertiser" },
00022     { "Connector", "SDKTemplate.Scenario2_Connector" }
00023 };
00024
00025 void MainPage::NotifyUserFromBackground(Platform::String^ strMessage, SDKTemplate::NotifyType type)
00026 {
00027     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00028         ref new DispatchedHandler([this, strMessage, type]()
00029     {
00030         NotifyUser(strMessage, type);
00031     }));
00032 }
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Tool.cpp Source File

  • SpatialInteractionSource
  • cpp
  • Content

Tool.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Tool.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 using namespace HolographicPaint;
00006 using namespace DirectX;
00007 using namespace Windows::Foundation::Numerics;
00008
00009
00010 Tool::Tool(Windows::UI::Color color, float diameter)
00011     : m_color(color), m_diameter(diameter)
00012 {
00013     m_modelConstantBufferData.color = DX::GetDXColor(color);
00014 }
00015
00016 void Tool::SetPosition(float3 position)
00017 {
00018     m_position = position;
00019     m_refreshModelConstantBufferData = true;
00020 }
00021
00022 void Tool::SetOrientation(quaternion orientation)
00023 {
00024     m_orientation = quaternion(orientation.x, orientation.y, orientation.z, orientation.w);
00025     m_refreshModelConstantBufferData = true;
00026 }
00027
00028 void Tool::Update(ID3D11DeviceContext*)
00029 {
00030     if (m_refreshModelConstantBufferData)
00031     {
00032         const XMMATRIX modelRotation = XMMatrixRotationQuaternion(XMLoadQuaternion(&m_orientation));
00033
00034         const XMMATRIX modelScale = XMMatrixScaling(m_diameter, m_diameter, max(m_diameter, .01f));
00035         // Position the cube.
00036         const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00037
00038         // Multiply to get the transform matrix.
00039         // Note that this transform does not enforce a particular coordinate system. The calling
00040         // class is responsible for rendering this content in a consistent manner.
00041         const XMMATRIX modelTransform = modelScale * modelRotation * modelTranslation;
00042
00043         // The view and projection matrices are provided by the system; they are associated
00044         // with holographic cameras, and updated on a per-camera basis.
00045         // Here, we provide the model transform for the sample hologram. The model transform
00046         // matrix is transposed to prepare it for the shader.
00047         XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
00048
00049         m_refreshModelConstantBufferData = false;
00050     }
00051 }
00052
00053 void Tool::Render(ID3D11DeviceContext* pDeviceContext, IRenderer* pRenderingHelper)
00054 {
00055     pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
00056     pRenderingHelper->DrawCube();
00057 }
00058
00059 ClearTool::ClearTool(Windows::UI::Color color, float diameter) : Tool(color, diameter)
00060 {}
00061
00062 void ClearTool::Update(ID3D11DeviceContext* pDeviceContext)
00063 {
00064     __super::Update(pDeviceContext);
00065     if (m_resetBuffers)
00066     {
00067         Microsoft::WRL::ComPtr<ID3D11Device> spDevice;
00068         pDeviceContext->GetDevice(spDevice.ReleaseAndGetAddressOf());
00069         std::vector<VertexPosition> vertices;
00070
00071         vertices.push_back({ XMFLOAT3(-0.5f,  0.5f, -0.5f) });
00072         vertices.push_back({ XMFLOAT3( 0.0f,  0.5f, -0.5f) });
00073         vertices.push_back({ XMFLOAT3( 0.5f,  0.5f, -0.5f) });
00074         vertices.push_back({ XMFLOAT3(-0.2f,  0.4f, -0.5f) });
00075         vertices.push_back({ XMFLOAT3( 0.2f,  0.4f, -0.5f) });
00076         vertices.push_back({ XMFLOAT3(-0.4f,  0.2f, -0.5f) });
00077         vertices.push_back({ XMFLOAT3( 0.0f,  0.2f, -0.5f) });
00078         vertices.push_back({ XMFLOAT3( 0.4f,  0.2f, -0.5f) });
00079         vertices.push_back({ XMFLOAT3(-0.5f,  0.0f, -0.5f) });
00080         vertices.push_back({ XMFLOAT3(-0.2f,  0.0f, -0.5f) });
00081         vertices.push_back({ XMFLOAT3( 0.2f,  0.0f, -0.5f) });
00082         vertices.push_back({ XMFLOAT3( 0.5f,  0.0f, -0.5f) });
00083         vertices.push_back({ XMFLOAT3(-0.4f, -0.2f, -0.5f) });
00084         vertices.push_back({ XMFLOAT3( 0.0f, -0.2f, -0.5f) });
00085         vertices.push_back({ XMFLOAT3( 0.4f, -0.2f, -0.5f) });
00086         vertices.push_back({ XMFLOAT3(-0.2f, -0.4f, -0.5f) });
00087         vertices.push_back({ XMFLOAT3( 0.2f, -0.4f, -0.5f) });
00088         vertices.push_back({ XMFLOAT3(-0.5f, -0.5f, -0.5f) });
00089         vertices.push_back({ XMFLOAT3( 0.0f, -0.5f, -0.5f) });
00090         vertices.push_back({ XMFLOAT3( 0.5f, -0.5f, -0.5f) });
00091
00092         vertices.push_back({ XMFLOAT3(-0.5f,  0.5f,  0.5f) });
00093         vertices.push_back({ XMFLOAT3( 0.5f,  0.5f,  0.5f) });
00094         vertices.push_back({ XMFLOAT3( 0.5f, -0.5f,  0.5f) });
00095         vertices.push_back({ XMFLOAT3(-0.5f, -0.5f,  0.5f) });
00096
00097         D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
00098         vertexBufferData.pSysMem = vertices.data();
00099         vertexBufferData.SysMemPitch = 0;
00100         vertexBufferData.SysMemSlicePitch = 0;
00101         const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPosition) * static_cast<UINT>(vertices.size()), D3D11_BIND_VERTEX_BUFFER);
00102         DX::ThrowIfFailed(
00103             spDevice->CreateBuffer(
00104                 &vertexBufferDesc,
00105                 &vertexBufferData,
00106                 m_vertexBuffer.ReleaseAndGetAddressOf()
00107             )
00108         );
00109
00110         static const VertexIndex_t indices[] =
00111         {
00112              0,  1,  3,
00113              0,  1,  3,
00114              1,  2,  4,
00115              0,  3,  5,
00116              1,  6,  3,
00117              1,  4,  6,
00118              2,  7,  4,
00119              0,  5,  8,
00120              2, 11,  7,
00121              8,  5,  9,
00122              7, 11, 10,
00123              8,  9, 12,
00124              8, 12, 17,
00125             10, 11, 14,
00126             17, 12, 15,
00127             18, 15, 18,
00128             13, 18, 15,
00129             13, 16, 18,
00130             16, 19, 18,
00131             14, 19, 16,
00132             11, 19, 14,
00133             17, 15, 18,
00134         };
00135         m_indexCount = _countof(indices);
00136
00137         D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
00138         indexBufferData.pSysMem = indices;
00139         indexBufferData.SysMemPitch = 0;
00140         indexBufferData.SysMemSlicePitch = 0;
00141         CD3D11_BUFFER_DESC indexBufferDesc(static_cast<UINT>(sizeof(VertexIndex_t) * m_indexCount), D3D11_BIND_INDEX_BUFFER);
00142         DX::ThrowIfFailed(
00143             spDevice->CreateBuffer(
00144                 &indexBufferDesc,
00145                 &indexBufferData,
00146                 m_indexBuffer.ReleaseAndGetAddressOf()
00147             )
00148         );
00149         m_resetBuffers = false;
00150     }
00151
00152 }
00153
00154 void ClearTool::Render(ID3D11DeviceContext* pDeviceContext, IRenderer* pRenderingHelper)
00155 {
00156     const UINT stride = sizeof(VertexPosition);
00157     const UINT offset = 0;
00158     pRenderingHelper->SetConstantBuffer(&m_modelConstantBufferData);
00159     pDeviceContext->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
00160     pDeviceContext->IASetIndexBuffer(m_indexBuffer.Get(), DX::GetDxgiFormat(), 0);
00161     pDeviceContext->DrawIndexedInstanced(m_indexCount, 2, 0, 0, 0);
00162 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Cylinder Member List

This is the complete list of members for Cylinder, including all inherited members.
Active(bool active) | GameObject |
Active() | GameObject |
AnimatePosition(_In_ std::shared_ptr< Animate > const &animate) | GameObject |
AnimatePosition() | GameObject |
Cylinder() | Cylinder |
Cylinder(DirectX::XMFLOAT3 position, float radius, DirectX::XMFLOAT3 direction) | Cylinder |
GameObject() | GameObject |
Hit(bool hit) | GameObject |
Hit() | GameObject |
HitMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
HitMaterial() | GameObject |
HitSound(_In_ std::shared_ptr< SoundEffect > const &hitSound) | GameObject |
HitSound() | GameObject |
HitTime(float t) | GameObject |
HitTime() | GameObject |
Initialize(DirectX::XMFLOAT3 position, float radius, DirectX::XMFLOAT3 direction) | Cylinder | [private]
IsTouching(DirectX::XMFLOAT3 point, float radius, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) override | Cylinder | [virtual]
m_axis | Cylinder | [private]
m_length | Cylinder | [private]
m_modelMatrix | GameObject | [protected]
m_position | GameObject | [protected]
m_radius | Cylinder | [private]
m_rotationMatrix | Cylinder | [private]
Mesh(_In_ std::shared_ptr< MeshObject > const &mesh) | GameObject |
ModelMatrix() | GameObject |
NormalMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
NormalMaterial() | GameObject |
OnGround(bool ground) | GameObject |
OnGround() | GameObject |
PlaySound(float impactSpeed, DirectX::XMFLOAT3 eyePoint) | GameObject |
Position(DirectX::XMFLOAT3 position) | GameObject |
Position(DirectX::XMVECTOR position) | GameObject |
Position() | GameObject |
Render(_In_ ID3D11DeviceContext *context, _In_ ID3D11Buffer *primitiveConstantBuffer) | GameObject |
Target(bool target) | GameObject |
Target() | GameObject |
TargetId(int targetId) | GameObject |
TargetId() | GameObject |
UpdatePosition() override | Cylinder | [protected, virtual]
VectorPosition() | GameObject |
VectorVelocity() | GameObject |
Velocity(DirectX::XMFLOAT3 velocity) | GameObject |
Velocity(DirectX::XMVECTOR velocity) | GameObject |
Velocity() | GameObject |
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/Find.xaml.cpp Source File

  • SemanticTextQuery
  • cpp

Find.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 //
00008 // Scenario1.xaml.cpp
00009 // Implementation of the Scenario1 class
00010 //
00011
00012 #include "pch.h"
00013 #include <ppltasks.h>
00014 #include "Find.xaml.h"
00015 #include "MainPage.xaml.h"
00016
00017 using namespace SDKTemplate;
00018 using namespace concurrency;
00019 using namespace Platform;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Storage;
00023 using namespace Windows::Storage::FileProperties;
00024 using namespace Windows::UI::Text;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Documents;
00028
00029 Scenario1::Scenario1()
00030 {
00031     InitializeComponent();
00032     FindQueryText->Text = "continent OR can OR rain";
00033     ContentText->Text = "Mount Rainier is on the North American Continent.";
00034 }
00035
00036 void Scenario1::Find_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00037 {
00038     ContentTextOutput->Text = "";
00039     auto mySemanticTextQuery = ref new Windows::Data::Text::SemanticTextQuery(FindQueryText->Text);
00040     IVectorView<Windows::Data::Text::TextSegment>^ ranges = mySemanticTextQuery->Find(ContentText->Text);
00041     HighlightRanges(ContentTextOutput, ContentText->Text, ranges);
00042 }
00043
Generated on Fri Nov 15 2024 22:21:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario2_Disable.xaml.h Source File

  • DisablingScreenCapture
  • cpp

Scenario2_Disable.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Disable.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario2_Disable sealed
00020     {
00021     public:
00022         Scenario2_Disable();
00023
00024     protected:
00025         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00026         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027     };
00028 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Common/DirectXHelper.h Source File

  • LowLatencyInput
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>   // For create_task
00015
00016 namespace DX
00017 {
00018     inline void ThrowIfFailed(HRESULT hr)
00019     {
00020         if (FAILED(hr))
00021         {
00022             // Set a breakpoint on this line to catch Win32 API errors.
00023             throw Platform::Exception::CreateException(hr);
00024         }
00025     }
00026
00027     // Function that reads from a binary file asynchronously.
00028     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00029     {
00030         using namespace Windows::Storage;
00031         using namespace Concurrency;
00032
00033         auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
00034
00035         return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([] (StorageFile^ file)
00036         {
00037             return FileIO::ReadBufferAsync(file);
00038         }).then([] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00039         {
00040             std::vector<byte> returnBuffer;
00041             returnBuffer.resize(fileBuffer->Length);
00042             Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
00043             return returnBuffer;
00044         });
00045     }
00046
00047     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00048     inline float ConvertDipsToPixels(float dips, float dpi)
00049     {
00050         static const float dipsPerInch = 96.0f;
00051         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00052     }
00053
00054 #if defined(_DEBUG)
00055     // Check for SDK Layer support.
00056     inline bool SdkLayersAvailable()
00057     {
00058         HRESULT hr = D3D11CreateDevice(
00059             nullptr,
00060             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00061             0,
00062             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00063             nullptr,                    // Any feature level will do.
00064             0,
00065             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00066             nullptr,                    // No need to keep the D3D device reference.
00067             nullptr,                    // No need to know the feature level.
00068             nullptr                     // No need to keep the D3D device context reference.
00069             );
00070
00071         return SUCCEEDED(hr);
00072     }
00073 #endif
00074 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cs/Scenario2_Polling.xaml.cs Source File

  • Altimeter
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.Sensors;
00015 using Windows.Foundation;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario2_Polling : Page
00024     {
00025         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00026         // as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         private Altimeter sensor;
00030
00031         public Scenario2_Polling()
00032         {
00033             this.InitializeComponent();
00034
00035             sensor = Altimeter.GetDefault();
00036             if (null == sensor)
00037             {
00038                 rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
00039             }
00040         }
00041
00042         /// <summary>
00043         /// This is the click handler for the 'GetData' button.
00044         /// </summary>
00045         /// <param name="sender"></param>
00046         /// <param name="e"></param>
00047         private void ScenarioGetData(object sender, RoutedEventArgs e)
00048         {
00049             if (null != sensor)
00050             {
00051                 AltimeterReading reading = sensor.GetCurrentReading();
00052                 if (null != reading)
00053                 {
00054                     ScenarioOutput_M.Text = String.Format("{0,5:0.00}", reading.AltitudeChangeInMeters);
00055                 }
00056             }
00057             else
00058             {
00059                 rootPage.NotifyUser("No altimeter found", NotifyType.ErrorMessage);
00060             }
00061         }
00062     }
00063 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario1_Basics.cpp Source File

  • LampArray
  • cppwinrt

Scenario1_Basics.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Basics.h"
00014 #include "Scenario1_Basics.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Devices::Enumeration;
00018 using namespace winrt::Windows::Devices::Lights;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::System;
00021 using namespace winrt::Windows::UI;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario1_Basics::Scenario1_Basics()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario1_Basics::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         UpdateLampArrayList();
00035
00036         // Start watching for newly attached LampArrays.
00037         m_deviceWatcher = DeviceInformation::CreateWatcher(LampArray::GetDeviceSelector());
00038
00039         m_deviceAddedRevoker = m_deviceWatcher.Added(winrt::auto_revoke, { get_weak(), &Scenario1_Basics::Watcher_Added});
00040         m_deviceRemovedRevoker = m_deviceWatcher.Removed(winrt::auto_revoke, { get_weak(), &Scenario1_Basics::Watcher_Removed });
00041
00042         m_deviceWatcher.Start();
00043     }
00044
00045     void Scenario1_Basics::OnNavigatedFrom(NavigationEventArgs const&)
00046     {
00047         m_deviceWatcher.Stop();
00048     }
00049
00050     winrt::fire_and_forget Scenario1_Basics::Watcher_Added(DeviceWatcher const&, DeviceInformation const& deviceInformation)
00051     {
00052         auto lifetime = get_strong();
00053
00054         auto info = std::make_shared<LampArrayInfo>(
00055             deviceInformation.Id(),
00056             deviceInformation.Name(),
00057             LampArray::FromIdAsync(deviceInformation.Id()).get());
00058
00059         // DeviceWatcher events are invoked on a background thread.
00060         // We need to switch to the foreground thread to update our app UI
00061         // and access member variables without race conditions.
00062
00063         co_await winrt::resume_foreground(Dispatcher());
00064
00065         if (info->lampArray == nullptr)
00066         {
00067             // A LampArray was found, but Windows couldn't initialize it.
00068             // This suggests a device error.
00069             rootPage.NotifyUser(L"Problem with LampArray " + info->displayName + L".", NotifyType::ErrorMessage);
00070             co_return;
00071         }
00072
00073         // Set up the AvailabilityChanged event callback for being notified whether this process can control
00074         // RGB lighting for the newly attached LampArray.
00075         info->availabilityChangedRevoker = info->lampArray.AvailabilityChanged(winrt::auto_revoke, { this, &Scenario1_Basics::LampArray_AvailabilityChanged });
00076
00077         // Remember this new LampArray and add it to the list.
00078         m_attachedLampArrays.push_back(std::move(info));
00079         UpdateLampArrayList();
00080     }
00081
00082     winrt::fire_and_forget Scenario1_Basics::Watcher_Removed(DeviceWatcher const&, DeviceInformationUpdate deviceInformationUpdate)
00083     {
00084         auto lifetime = get_strong();
00085
00086         // DeviceWatcher events are invoked on a background thread.
00087         // We need to switch to the foreground thread to update our app UI
00088         // and access member variables without race conditions.
00089         co_await winrt::resume_foreground(Dispatcher());
00090
00091         m_attachedLampArrays.erase(
00092             std::remove_if(m_attachedLampArrays.begin(), m_attachedLampArrays.end(), [id = deviceInformationUpdate.Id()](auto&& info) { return info->id == id; }),
00093             m_attachedLampArrays.end());
00094
00095         UpdateLampArrayList();
00096     }
00097
00098     // The AvailabilityChanged event will fire when this calling process gains or loses control of RGB lighting
00099     // for the specified LampArray.
00100     winrt::fire_and_forget Scenario1_Basics::LampArray_AvailabilityChanged(const LampArray& sender, const IInspectable&)
00101     {
00102         co_await winrt::resume_foreground(Dispatcher());
00103
00104         UpdateLampArrayList();
00105     }
00106
00107     void Scenario1_Basics::UpdateLampArrayList()
00108     {
00109         std::wstring message = std::wstring(L"Attached LampArrays: ") + std::to_wstring(m_attachedLampArrays.size()) + L"\n";
00110
00111         for (auto&& info : m_attachedLampArrays)
00112         {
00113             message += std::wstring(L"\t") + std::wstring(info->displayName) + L" ("
00114                 + std::to_wstring(info->lampArray.LampArrayKind()) + L", " + std::to_wstring(info->lampArray.LampCount()) + L" lamps, "
00115                 + std::wstring(info->lampArray.IsAvailable() ? L"Available" : L"Unavailable") + L")\n";
00116         }
00117
00118         LampArraysSummary().Text(message);
00119     }
00120
00121     void Scenario1_Basics::Apply_Clicked(IInspectable const&, RoutedEventArgs const&)
00122     {
00123         for (auto&& info : m_attachedLampArrays)
00124         {
00125             ApplySettingsToLampArray(info->lampArray);
00126         }
00127     }
00128
00129     void Scenario1_Basics::ApplySettingsToLampArray(LampArray const& lampArray)
00130     {
00131         // Apply the light pattern.
00132         if (OffButton().IsChecked().Value())
00133         {
00134             // Set all Lamps on the LampArray to black, turning them off.
00135             lampArray.SetColor(Colors::Black());
00136         }
00137         else if (SetColorButton().IsChecked().Value())
00138         {
00139             // Set all Lamps on the LampArray to green.
00140             lampArray.SetColor(Colors::Green());
00141         }
00142         else if (GradientButton().IsChecked().Value())
00143         {
00144             SetGradientPatternToLampArray(lampArray);
00145         }
00146         else if (WasdButton().IsChecked().Value())
00147         {
00148             SetWasdPatternToLampArray(lampArray);
00149         }
00150
00151         // Apply the brightness. Convert the percentage value in the slider to the range [0, 1] expected by BrightnessLevel.
00152         lampArray.BrightnessLevel(BrightnessSlider().Value() / BrightnessSlider().Maximum());
00153     }
00154
00155     void Scenario1_Basics::SetGradientPatternToLampArray(LampArray const& lampArray)
00156     {
00157         // Create a static gradient on the LampArray from black to red, blending from left to right.
00158
00159         // For this effect, we want to set the colors of all Lamps. Create an array containing all the Lamp indices
00160         // and an array of Colors. Both arrays must be of the same length. We will use these for SetColorsForIndices later.
00161         std::vector<int> indices(lampArray.LampCount());
00162         std::iota(indices.begin(), indices.end(), 0);
00163
00164         std::vector<Color> colors(lampArray.LampCount());
00165
00166         // A LampArray provides information about its size using a three-dimensional logical bounding box,
00167         // as well as the location of each of its Lamps within that bounding box.
00168         // The origin point of the bounding box is the leftmost (X), farthest (Y), uppermost (Z) corner relative to the user.
00169         // LampArray bounding boxes and Lamp positions are measured in meters.
00170
00171         // Because our gradient will blend from left to right, we will set the Lamp colors according to each Lamp's X position.
00172         // We will make two passes over the LampArray. First, calculate the minimum and maximum X position values of all Lamps.
00173         // This is to "trim" the margins of the bounding box where no Lamps are present.
00174         double maxX = 0;
00175         double minX = lampArray.BoundingBox().x;
00176
00177         for (int i : indices)
00178         {
00179             LampInfo lampInfo = lampArray.GetLampInfo(i);
00180
00181             if (lampInfo.Position().x > maxX)
00182             {
00183                 maxX = lampInfo.Position().x;
00184             }
00185
00186             if (lampInfo.Position().x < minX)
00187             {
00188                 minX = lampInfo.Position().x;
00189             }
00190         }
00191
00192         // In the second pass, we will calculate the gradient colors for each Lamp.
00193         for (int i : indices)
00194         {
00195             LampInfo lampInfo = lampArray.GetLampInfo(i);
00196
00197             // Calculate the X position for this Lamp relative to the rightmost Lamp. We will scale the Lamp's color by this relative value below.
00198             // (We also want to avoid dividing by zero here in case all Lamps share the same X position, including the single-Lamp case.)
00199             double xProgress = 1.0;
00200             if (maxX != minX)
00201             {
00202                 xProgress = (lampInfo.Position().x - minX) / (maxX - minX);
00203             }
00204
00205             // Apply that value to the expected color for the lamp.
00206             // Maximize the Alpha value to give the color full opacity.
00207             colors[i].A = std::numeric_limits<uint8_t>::max();
00208
00209             // Set the color's R value based on the Lamp's X position.
00210             // As the X position of the Lamp increases (i.e., is further to the right),
00211             // the Red value of the Lamp's color will also increase.
00212             // This means that the leftmost Lamp(s) will be black (turned off), and the rightmost Lamp(s) will be the brightest red.
00213             colors[i].R = (uint8_t)(xProgress * std::numeric_limits<uint8_t>::max());
00214         }
00215
00216         lampArray.SetColorsForIndices(colors, indices);
00217     }
00218
00219     void Scenario1_Basics::SetWasdPatternToLampArray(LampArray const& lampArray)
00220     {
00221         // Set a background color of blue.
00222         lampArray.SetColor(Colors::Blue());
00223
00224         // Highlight the WASD keys in white, if the LampArray supports addressing its Lamps using a virtual key to Lamp mapping.
00225         // This is typically found on keyboard LampArrays. Other LampArrays will not usually support virtual key based lighting.
00226         if (lampArray.SupportsVirtualKeys())
00227         {
00228             auto white = Colors::White();
00229             std::array<Color, 4> colors{ white, white, white, white };
00230             std::array<VirtualKey, 4> virtualKeys{ VirtualKey::W, VirtualKey::A, VirtualKey::S, VirtualKey::D };
00231
00232             lampArray.SetColorsForKeys(colors, virtualKeys);
00233         }
00234     }
00235 }
Generated on Fri Nov 15 2024 22:20:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Level2 Member List

This is the complete list of members for Level2, including all inherited members.
Initialize(std::vector< std::shared_ptr< GameObject >> const &objects) override | Level2 | [virtual]
Level1() | Level1 |
Level2() | Level2 |
LoadState(PersistentState &state) override | Level2 | [virtual]
m_nextId | Level2 | [private]
m_objective | Level | [protected]
m_timeLimit | Level | [protected]
Objective() | Level |
SaveState(PersistentState &state) override | Level2 | [virtual]
TimeLimit() | Level |
Update(float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) override | Level2 | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonRemoveGroup1_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
GROUP_1 | ScenarioElement | [private, static]
GROUP_2 | ScenarioElement | [private, static]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
TAG_1 | ScenarioElement | [private, static]
TAG_2 | ScenarioElement | [private, static]
TAG_3 | ScenarioElement | [private, static]
UserControl_Loaded(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/MainPage.xaml.h Source File

  • 360VideoPlayback
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // MainPage.xaml.h
00003 // Declaration of the MainPage class
00004 //
00005
00006 #pragma once
00007
00008 #include "MainPage.g.h"
00009 #include "VideoGallery.xaml.h"
00010
00011 namespace _360VideoPlayback
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public ref class MainPage sealed
00017     {
00018     public:
00019         MainPage();
00020     private:
00021         void OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args);
00022     };
00023 }
Generated on Fri Nov 15 2024 22:17:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Add Member List

This is the complete list of members for Scenario3_Add, including all inherited members.
PickAudioButton_Click(object sender, RoutedEventArgs e) | Scenario3_Add | [inline, private]
PickPlaylistButton_Click(object sender, RoutedEventArgs e) | Scenario3_Add | [inline, private]
playlist | Scenario3_Add | [private]
rootPage | Scenario3_Add | [private]
Scenario3_Add() | Scenario3_Add | [inline]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BasicDeferral Member List

This is the complete list of members for BasicDeferral, including all inherited members.
BasicDeferral() | BasicDeferral | [inline]
RealizeElements_Click(object sender, RoutedEventArgs e) | BasicDeferral | [inline, private]
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario1.xaml.cpp Source File

  • Logging
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1.xaml.h"
00013 #include "LoggingChannelScenario.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::UI::Xaml;
00019
00020 Scenario1::Scenario1()
00021     : rootPage(MainPage::Current)
00022 {
00023     InitializeComponent();
00024 }
00025
00026 /// <summary>
00027 /// This method demonstrates logging with a LoggingChannel constructed
00028 /// in Windows 8.1 compatibility mode.
00029 /// </summary>
00030 void Scenario1::DoWin81Mode(
00031     Object^ sender,
00032     RoutedEventArgs^ e)
00033 {
00034     (ref new LoggingChannelScenario())->LogWithWin81Constructor();
00035     rootPage->NotifyUser("Complete: Windows 8.1 mode", NotifyType::StatusMessage);
00036 }
00037
00038 /// <summary>
00039 /// This method demonstrates LoggingChannel in Windows 10 mode.
00040 /// </summary>
00041 void Scenario1::DoWin10Mode(
00042     Object^ sender,
00043     RoutedEventArgs^ e)
00044 {
00045     (ref new LoggingChannelScenario())->LogWithWin10Constructor();
00046     rootPage->NotifyUser("Complete: Windows 10 mode", NotifyType::StatusMessage);
00047 }
Generated on Fri Nov 15 2024 22:17:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario7_FutureAccess.xaml.h Source File

  • FileAccess
  • cpp

Scenario7_FutureAccess.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario7_FutureAccess.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Persisting access to a storage item for future use.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario7 sealed
00025     {
00026     public:
00027         Scenario7();
00028         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032         Platform::String^ mruToken;
00033         Platform::String^ falToken;
00034
00035         void AddToListButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void ShowListButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037         void OpenFromListButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuperMutt::DeviceInputReportControlInformation Member List

This is the complete list of members for SuperMutt::DeviceInputReportControlInformation, including all inherited members.
DataTurnOff | SuperMutt::DeviceInputReportControlInformation
DataTurnOn | SuperMutt::DeviceInputReportControlInformation
ReportId | SuperMutt::DeviceInputReportControlInformation
UsageId | SuperMutt::DeviceInputReportControlInformation
UsagePage | SuperMutt::DeviceInputReportControlInformation
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
list_SelectionChanged(object sender, SelectionChangedEventArgs e) | MainPage | [inline, private]
MainPage() | MainPage | [inline]
MainPage_Loaded(object sender, RoutedEventArgs e) | MainPage | [inline, private]
SplitViewButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileDataSource Member List

This is the complete list of members for FileDataSource, including all inherited members.
_cache | FileDataSource | [private]
_count | FileDataSource | [private]
_queryResult | FileDataSource | [private]
Add(object item) | FileDataSource | [inline, private]
Add(FileItem item) | FileDataSource | [inline, private]
Add(object item) | FileDataSource | [inline, private]
Add(FileItem item) | FileDataSource | [inline, private]
BATCHSIZE | FileDataSource | [private]
Clear() | FileDataSource | [inline, private]
Clear() | FileDataSource | [inline, private]
Clear() | FileDataSource | [inline, private]
Clear() | FileDataSource | [inline, private]
CollectionChanged | FileDataSource |
Contains(object item) | FileDataSource | [inline, private]
Contains(FileItem item) | FileDataSource | [inline, private]
Contains(object item) | FileDataSource | [inline, private]
Contains(FileItem item) | FileDataSource | [inline, private]
CopyTo(Array array, int index) | FileDataSource | [inline, private]
CopyTo(FileItem[] array, int arrayIndex) | FileDataSource | [inline, private]
CopyTo(Array array, int index) | FileDataSource | [inline, private]
CopyTo(FileItem[] array, int arrayIndex) | FileDataSource | [inline, private]
Count | FileDataSource |
Count | FileDataSource | [private]
Count | FileDataSource | [private]
dispatcher | FileDataSource | [private]
fetchBatch(int index) | FileDataSource | [inline, private]
fetchBatch(int index) | FileDataSource | [inline, private]
FetchData() | FileDataSource | [inline, private]
FetchData() | FileDataSource | [inline, private]
FileDataSource() | FileDataSource | [inline]
FileDataSource() | FileDataSource | [inline]
Folder | FileDataSource |
GetEnumerator() | FileDataSource | [inline, private]
GetEnumerator() | FileDataSource | [inline, private]
GetEnumerator() | FileDataSource | [inline, private]
GetEnumerator() | FileDataSource | [inline, private]
IndexOf(object item) | FileDataSource | [inline, private]
IndexOf(FileItem item) | FileDataSource | [inline, private]
IndexOf(object item) | FileDataSource | [inline, private]
IndexOf(FileItem item) | FileDataSource | [inline, private]
Insert(int index, object value) | FileDataSource | [inline, private]
Insert(int index, FileItem item) | FileDataSource | [inline, private]
Insert(int index, object value) | FileDataSource | [inline, private]
Insert(int index, FileItem item) | FileDataSource | [inline, private]
IsFixedSize | FileDataSource | [private]
IsReadOnly | FileDataSource | [private]
IsReadOnly | FileDataSource | [private]
IsSynchronized | FileDataSource | [private]
QueryResult_ContentsChanged(IStorageQueryResultBase sender, object args) | FileDataSource | [inline, private]
QueryResult_ContentsChanged(IStorageQueryResultBase sender, object args) | FileDataSource | [inline, private]
Remove(object value) | FileDataSource | [inline, private]
Remove(FileItem item) | FileDataSource | [inline, private]
Remove(object value) | FileDataSource | [inline, private]
Remove(FileItem item) | FileDataSource | [inline, private]
RemoveAt(int index) | FileDataSource | [inline, private]
RemoveAt(int index) | FileDataSource | [inline, private]
RemoveAt(int index) | FileDataSource | [inline, private]
RemoveAt(int index) | FileDataSource | [inline, private]
ResetCollection() | FileDataSource | [inline]
ResetCollection() | FileDataSource | [inline]
SetupDataSource(StorageFolder folder) | FileDataSource | [inline]
SetupDataSource(StorageFolder folder) | FileDataSource | [inline]
SetupDataSourceImpl(StorageFolder folder) | FileDataSource | [inline, private]
SetupDataSourceImpl(StorageFolder folder) | FileDataSource | [inline, private]
SetupDataSourceUsingPicturesFolder() | FileDataSource | [inline]
SetupDataSourceUsingPicturesFolder() | FileDataSource | [inline]
SetupDataSourceUsingPicturesFolderImpl() | FileDataSource | [inline, private]
SetupDataSourceUsingPicturesFolderImpl() | FileDataSource | [inline, private]
SyncRoot | FileDataSource | [private]
this | FileDataSource | [private]
this | FileDataSource | [private]
this | FileDataSource | [private]
VectorChanged | FileDataSource |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario1_SingleFile.xaml.h Source File

  • FilePicker
  • cpp

Scenario1_SingleFile.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario1_SingleFile.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     public ref class Scenario1_SingleFile sealed
00021     {
00022     public:
00023         Scenario1_SingleFile();
00024
00025     private:
00026         MainPage^ rootPage;
00027
00028         void PickAFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:19:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario4_ManyProviders.xaml.h Source File

  • WebAccountManagement
  • cpp

Scenario4_ManyProviders.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario4_ManyProviders.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// The fourth scenario. Covers keeping and managing a single active account and having multiple account provider types.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario4_ManyProviders sealed
00015     {
00016     public:
00017         Scenario4_ManyProviders();
00018     protected:
00019         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override;
00020     private:
00021         MainPage^ rootPage;
00022         void Button_SignIn_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00023         void Button_GetTokenSilently_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00024         void Button_ManageAccounts_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00025         void Button_Reset_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00026         void InitalizeAccountsControlDialog();
00027         void CleanupAccountsControlDialog();
00028         void OnAccountCommandsRequested(Windows::UI::ApplicationSettings::AccountsSettingsPane^ sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^ e);
00029         void GetProvidersAndAccounts();
00030         void LoadAccount();
00031         void AddWebAccountProviders(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00032         void AddWebAccount(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00033         void AddLinksAndDescription(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00034         void WebAccountProviderCommandInvoked(Windows::UI::ApplicationSettings::WebAccountProviderCommand^ command);
00035         void WebAccountCommandInvoked(Windows::UI::ApplicationSettings::WebAccountCommand ^ command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^ args);
00036         void PrivacyPolicyInvoked(Windows::UI::Popups::IUICommand^ command);
00037         void OtherLinkInvoked(Windows::UI::Popups::IUICommand ^ command);
00038         void AuthenticateWithRequestToken(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID);
00039         void AuthenticateWithRequestTokenSilent(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID, Windows::Security::Credentials::WebAccount^ account);
00040         void OutputTokenResult(Windows::Security::Authentication::Web::Core::WebTokenRequestResult ^ result);
00041         void SaveAccount(Windows::Security::Credentials::WebAccountProvider ^ provider, Windows::Security::Credentials::WebAccount ^ account);
00042         void LogoffAndRemoveAccount();
00043
00044         Platform::String^ MICROSOFT_PROVIDER_ID = "https://login.microsoft.com";
00045         Platform::String^ CONSUMER_AUTHORITY = "consumers";
00046         Platform::String^ ORGANIZATION_AUTHORITY = "organizations";
00047         Platform::String^ MSA_SCOPE_REQUESTED = "wl.basic";
00048         Platform::String^ MSA_CLIENT_ID = "none";
00049         Platform::String^ AAD_SCOPE_REQUESTED = "";
00050         Platform::String^ AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb";
00051         Platform::String^ STORED_ACCOUNT_ID_KEY = "accountid";
00052         Platform::String^ STORED_PROVIDER_ID_KEY = "providerid";
00053         Platform::String^ STORED_AUTHORITY_ID_KEY = "authority";
00054         Platform::String^ APP_SPECIFIC_PROVIDER_ID = "myproviderid";
00055         Platform::String^ APP_SPECIFIC_PROVIDER_NAME = "App specific provider";
00056         Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccountProvider^>^ m_providers;
00057         Windows::Security::Credentials::WebAccount^ m_account;
00058         Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken;
00059     };
00060 }
Generated on Fri Nov 15 2024 22:21:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/ChallengeResponseAlgorithm.cs Source File

  • SmartCard
  • cs

ChallengeResponseAlgorithm.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Security.Cryptography.Core;
00003 using Windows.Storage.Streams;
00004
00005 namespace SDKTemplate
00006 {
00007     static class ChallengeResponseAlgorithm
00008     {
00009         /// <summary>
00010         /// Calculates the response by encrypting the challenge by using Triple DES (3DES).
00011         /// If the resulting values are the same, the authentication is successful.
00012         /// </summary>
00013         /// <param name="challenge">a block of challenge data generated by smart card using its admin key</param>
00014         /// <param name="adminkey">the admin key of the smart card, which is normally saved on the server side or management tool.</param>
00015         /// <returns>the response</returns>
00016         public static IBuffer CalculateResponse(IBuffer challenge, IBuffer adminkey)
00017         {
00018             if (challenge == null)
00019             {
00020                 throw new ArgumentNullException("challenge");
00021             }
00022             if (adminkey == null)
00023             {
00024                 throw new ArgumentNullException("adminkey");
00025             }
00026
00027             SymmetricKeyAlgorithmProvider objAlg = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.TripleDesCbc);
00028             var symmetricKey = objAlg.CreateSymmetricKey(adminkey);
00029             var buffEncrypted = CryptographicEngine.Encrypt(symmetricKey, challenge, null);
00030             return buffEncrypted;
00031         }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/pch.h Source File

  • FolderEnumeration
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario6_Recurrence.xaml.cs Source File

  • Appointments
  • cs

Scenario6_Recurrence.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario6_Recurrence : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario6_Recurrence()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         /// <summary>
00029         /// Creates a Recurrence object based on input fields and validates it.
00030         /// </summary>
00031         /// <param name="sender"></param>
00032         /// <param name="e"></param>
00033         private void Create_Click(object sender, RoutedEventArgs e)
00034         {
00035             string errorMessage = null;
00036             var recurrence = new Windows.ApplicationModel.Appointments.AppointmentRecurrence();
00037
00038             // Unit
00039             switch (UnitComboBox.SelectedIndex)
00040             {
00041                 case 0:
00042                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Daily;
00043                     break;
00044                 case 1:
00045                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Weekly;
00046                     break;
00047                 case 2:
00048                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Monthly;
00049                     break;
00050                 case 3:
00051                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.MonthlyOnDay;
00052                     break;
00053                 case 4:
00054                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Yearly;
00055                     break;
00056                 case 5:
00057                     recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.YearlyOnDay;
00058                     break;
00059             }
00060
00061             // Occurrences
00062             // Note: Occurrences and Until properties are mutually exclusive.
00063             if (OccurrencesRadioButton.IsChecked.Value)
00064             {
00065                 recurrence.Occurrences = (uint)OccurrencesSlider.Value;
00066             }
00067
00068             // Until
00069             // Note: Until and Occurrences properties are mutually exclusive.
00070             if (UntilRadioButton.IsChecked.Value)
00071             {
00072                 recurrence.Until = UntilDatePicker.Date;
00073             }
00074
00075             // Interval
00076             recurrence.Interval = (uint)IntervalSlider.Value;
00077
00078             // Week of the month
00079             switch (WeekOfMonthComboBox.SelectedIndex)
00080             {
00081                 case 0:
00082                     recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.First;
00083                     break;
00084                 case 1:
00085                     recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Second;
00086                     break;
00087                 case 2:
00088                     recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Third;
00089                     break;
00090                 case 3:
00091                     recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Fourth;
00092                     break;
00093                 case 4:
00094                     recurrence.WeekOfMonth = Windows.ApplicationModel.Appointments.AppointmentWeekOfMonth.Last;
00095                     break;
00096             }
00097
00098             // Days of the Week
00099             // Note: For Weekly, MonthlyOnDay or YearlyOnDay recurrence unit values, at least one day must be specified.
00100             if (SundayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Sunday; }
00101             if (MondayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Monday; }
00102             if (TuesdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Tuesday; }
00103             if (WednesdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Wednesday; }
00104             if (ThursdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Thursday; }
00105             if (FridayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Friday; }
00106             if (SaturdayCheckBox.IsChecked.Value) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Saturday; }
00107
00108             if (((recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Weekly) ||
00109                  (recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.MonthlyOnDay) ||
00110                  (recurrence.Unit == Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.YearlyOnDay)) &&
00111                 (recurrence.DaysOfWeek == Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.None))
00112             {
00113                 errorMessage = "The recurrence specified is invalid. For Weekly, MonthlyOnDay or YearlyOnDay recurrence unit values, at least one day must be specified.";
00114             }
00115
00116             // Month of the year
00117             recurrence.Month = (uint)MonthSlider.Value;
00118
00119             // Day of the month
00120             recurrence.Day = (uint)DaySlider.Value;
00121
00122             if (errorMessage == null)
00123             {
00124                 rootPage.NotifyUser("The recurrence specified was created successfully and is valid.", NotifyType.StatusMessage);
00125             }
00126             else
00127             {
00128                 rootPage.NotifyUser(errorMessage, NotifyType.ErrorMessage);
00129             }
00130         }
00131     }
00132 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/AppView.cs Source File

  • 360VideoPlayback
  • cs

AppView.cs

Go to the documentation of this file.
00001 ﻿using _360VideoPlayback.Common;
00002 using System;
00003 using System.Threading.Tasks;
00004 using Windows.ApplicationModel;
00005 using Windows.ApplicationModel.Activation;
00006 using Windows.ApplicationModel.Core;
00007 using Windows.Graphics.Holographic;
00008 using Windows.Media.Core;
00009 using Windows.Media.Playback;
00010 using Windows.UI.Core;
00011 using Windows.UI.ViewManagement;
00012
00013 namespace _360VideoPlayback
00014 {
00015     /// <summary>
00016     /// The IFrameworkView connects the app with Windows and handles application lifecycle events.
00017     /// </summary>
00018     internal class AppView : IFrameworkView, IDisposable
00019     {
00020         private _360VideoPlaybackMain main;
00021
00022         private DeviceResources deviceResources;
00023         private bool windowClosed = false;
00024         private bool windowVisible = true;
00025         private bool createShaders = false;
00026         private bool createdShaders = false;
00027
00028         // The holographic space the app will use for rendering.
00029         private HolographicSpace holographicSpace = null;
00030         bool appViewConsolidated = false;
00031         bool mainWindowReactivated = false;
00032
00033         static public MediaPlayer mediaPlayer = null;
00034         private Uri sourceUri;
00035
00036         public AppView(Uri sourceUri)
00037         {
00038             windowVisible = true;
00039             mediaPlayer = new MediaPlayer();
00040             this.sourceUri = sourceUri;
00041         }
00042
00043         private void MediaPlayer_MediaOpened(MediaPlayer sender, object args)
00044         {
00045             createShaders = true;
00046         }
00047
00048         public void Dispose()
00049         {
00050             if (deviceResources != null)
00051             {
00052                 deviceResources.Dispose();
00053                 deviceResources = null;
00054             }
00055
00056             if (main != null)
00057             {
00058                 main.Dispose();
00059                 main = null;
00060             }
00061
00062             if (mediaPlayer != null)
00063             {
00064                 mediaPlayer.Dispose();
00065                 mediaPlayer = null;
00066             }
00067         }
00068
00069         #region IFrameworkView Members
00070
00071         /// <summary>
00072         /// The first method called when the IFrameworkView is being created.
00073         /// Use this method to subscribe for Windows shell events and to initialize your app.
00074         /// </summary>
00075         public void Initialize(CoreApplicationView applicationView)
00076         {
00077             CoreWindow window = CoreWindow.GetForCurrentThread();
00078             if (window != null)
00079             {
00080                 window.Activated += OnmainWindowActivated;
00081             }
00082             applicationView.Activated += this.OnViewActivated;
00083         }
00084
00085         private void OnmainWindowActivated(CoreWindow sender, WindowActivatedEventArgs args)
00086         {
00087             mainWindowReactivated = true;
00088             windowClosed = true;
00089             TryCloseWindow();
00090         }
00091
00092         /// <summary>
00093         /// Called when the CoreWindow object is created (or re-created).
00094         /// </summary>
00095         public void SetWindow(CoreWindow window)
00096         {
00097             ApplicationView.GetForCurrentView().Consolidated += AppView_Consolidated;
00098
00099             // Register event handlers for app lifecycle.
00100             CoreApplication.Suspending += this.OnSuspending;
00101             CoreApplication.Resuming += this.OnResuming;
00102
00103             // Register for keypress notifications.
00104             window.KeyDown += this.OnKeyPressed;
00105
00106             // Register for notification that the app window is being closed.
00107             window.Closed += this.OnWindowClosed;
00108
00109             // Register for notifications that the app window is losing focus.
00110             window.VisibilityChanged += this.OnVisibilityChanged;
00111
00112             // At this point we have access to the device and we can create device-dependent
00113             // resources.
00114             deviceResources = new DeviceResources();
00115
00116             main = new _360VideoPlaybackMain(deviceResources);
00117
00118             // Create a holographic space for the core window for the current view.
00119             // Presenting holographic frames that are created by this holographic space will put
00120             // the app into exclusive mode.
00121             holographicSpace = HolographicSpace.CreateForCoreWindow(window);
00122
00123             // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
00124             // space (when available) to create a Direct3D device. The HolographicSpace
00125             // uses this ID3D11Device to create and manage device-based resources such as
00126             // swap chains.
00127             deviceResources.SetHolographicSpace(holographicSpace);
00128
00129             // The main class uses the holographic space for updates and rendering.
00130             main.SetHolographicSpace(holographicSpace);
00131
00132             MediaSource source = MediaSource.CreateFromUri(sourceUri);
00133             mediaPlayer.MediaOpened += MediaPlayer_MediaOpened;
00134             mediaPlayer.Source = source;// Windows.Media.Core.MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/video.mp4"));
00135
00136             mediaPlayer.IsVideoFrameServerEnabled = true;
00137             mediaPlayer.IsLoopingEnabled = true;
00138         }
00139
00140         private void AppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args)
00141         {
00142             appViewConsolidated = true;
00143             windowClosed = true;
00144             TryCloseWindow();
00145             Dispose();
00146         }
00147
00148         private void TryCloseWindow()
00149         {
00150             CoreWindow window = CoreWindow.GetForCurrentThread();
00151             window?.Close();
00152         }
00153
00154         /// <summary>
00155         /// The Load method can be used to initialize scene resources or to load a
00156         /// previously saved app state.
00157         /// </summary>
00158         public void Load(string entryPoint)
00159         {
00160         }
00161
00162         /// <summary>
00163         /// This method is called after the window becomes active. It oversees the
00164         /// update, draw, and present loop, and also oversees window message processing.
00165         /// </summary>
00166         public void Run()
00167         {
00168             CoreWindow window = CoreWindow.GetForCurrentThread();
00169             window.Activate();
00170             while (!windowClosed)
00171             {
00172                 if (createShaders)
00173                 {
00174                     if (!createdShaders)
00175                     {
00176                         main.CreateVideoShaders();
00177                         createdShaders = true;
00178                     }
00179                 }
00180                 else
00181                 {
00182                     window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessOneAndAllPending);
00183                     continue;
00184                 }
00185
00186                 if (appViewConsolidated || mainWindowReactivated)
00187                 {
00188                     TryCloseWindow();
00189                     windowClosed = true;
00190
00191                 }
00192                 else
00193                 {
00194                     window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessAllIfPresent);
00195                     if (windowVisible && (null != holographicSpace))
00196                     {
00197                         HolographicFrame frame = main.Update();
00198
00199                         if (main.Render(ref frame))
00200                         {
00201                             deviceResources.Present(ref frame);
00202                         }
00203                     }
00204                 }
00205             }
00206         }
00207
00208         /// <summary>
00209         /// Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00210         /// class is torn down while the app is in the foreground.
00211         // This method is not often used, but IFrameworkView requires it and it will be called for
00212         // holographic apps.
00213         /// </summary>
00214         public void Uninitialize()
00215         {
00216         }
00217
00218         #endregion
00219
00220         #region Application lifecycle event handlers
00221
00222         /// <summary>
00223         /// Called when the app view is activated. Activates the app's CoreWindow.
00224         /// </summary>
00225         private void OnViewActivated(CoreApplicationView sender, IActivatedEventArgs args)
00226         {
00227             // Run() won't start until the CoreWindow is activated.
00228             sender.CoreWindow.Activate();
00229         }
00230
00231         private void OnSuspending(object sender, SuspendingEventArgs args)
00232         {
00233             // Save app state asynchronously after requesting a deferral. Holding a deferral
00234             // indicates that the application is busy performing suspending operations. Be
00235             // aware that a deferral may not be held indefinitely; after about five seconds,
00236             // the app will be forced to exit.
00237             var deferral = args.SuspendingOperation.GetDeferral();
00238
00239             Task.Run(() =>
00240                 {
00241                     deviceResources.Trim();
00242
00243                     if (null != main)
00244                     {
00245                         main.SaveAppState();
00246                     }
00247
00248                     //
00249                     // TODO: Insert code here to save your app state.
00250                     //
00251
00252                     deferral.Complete();
00253                 });
00254         }
00255
00256         private void OnResuming(object sender, object args)
00257         {
00258             // Restore any data or state that was unloaded on suspend. By default, data
00259             // and state are persisted when resuming from suspend. Note that this event
00260             // does not occur if the app was previously terminated.
00261
00262             if (null != main)
00263             {
00264                 main.LoadAppState();
00265             }
00266
00267             //
00268             // TODO: Insert code here to load your app state.
00269             //
00270         }
00271
00272         #endregion;
00273
00274         #region Window event handlers
00275
00276         private void OnVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
00277         {
00278             windowVisible = args.Visible;
00279         }
00280
00281         private void OnWindowClosed(CoreWindow sender, CoreWindowEventArgs arg)
00282         {
00283             windowClosed = true;
00284         }
00285
00286         #endregion
00287
00288         #region Input event handlers
00289
00290         private async void OnKeyPressed(CoreWindow sender, KeyEventArgs args)
00291         {
00292             if (args.VirtualKey == Windows.System.VirtualKey.Escape)
00293             {
00294                 await ApplicationViewSwitcher.SwitchAsync(VideoGallery.mainviewId, ApplicationView.GetForCurrentView().Id, ApplicationViewSwitchingOptions.ConsolidateViews);
00295             }
00296             //
00297             // TODO: Bluetooth keyboards are supported by HoloLens. You can use this method for
00298             //       keyboard input if you want to support it as an optional input method for
00299             //       your holographic app.
00300             //
00301         }
00302
00303         #endregion
00304     }
00305 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/SampleConfiguration.cs Source File

  • Projection
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKSample;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Projection";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Start projecting", ClassType=typeof(Scenario1)},
00026             new Scenario() { Title="Select projector and project", ClassType=typeof(Scenario2)},
00027             new Scenario() { Title="Custom display selection and project", ClassType=typeof(Scenario3)}
00028         };
00029
00030         // Keep track of the view that's being projected
00031         public SecondaryViewsHelpers.ViewLifetimeControl ProjectionViewPageControl;
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cs/Scenario1_GetDeviceInformation.xaml.cs Source File

  • ClientDeviceInformation
  • cs

Scenario1_GetDeviceInformation.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Security.ExchangeActiveSyncProvisioning;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario1_GetDeviceInformation : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario1_GetDeviceInformation()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         private void Launch_Click(object sender, RoutedEventArgs e)
00029         {
00030             try
00031             {
00032                 EasClientDeviceInformation CurrentDeviceInfor = new EasClientDeviceInformation();
00033                 DeviceID.Text = CurrentDeviceInfor.Id.ToString();
00034                 OperatingSystem.Text = CurrentDeviceInfor.OperatingSystem;
00035                 FriendlyName.Text = CurrentDeviceInfor.FriendlyName;
00036                 SystemManufacturer.Text = CurrentDeviceInfor.SystemManufacturer;
00037                 SystemProductName.Text = CurrentDeviceInfor.SystemProductName;
00038                 SystemSku.Text = CurrentDeviceInfor.SystemSku;
00039             }
00040             catch (Exception Error)
00041             {
00042                 rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
00043             }
00044         }
00045
00046         private void Reset_Click(object sender, RoutedEventArgs e)
00047         {
00048             DeviceID.Text = "";
00049             OperatingSystem.Text = "";
00050             FriendlyName.Text = "";
00051             SystemManufacturer.Text = "";
00052             SystemProductName.Text = "";
00053             SystemSku.Text = "";
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:18:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE > Member List

This is the complete list of members for ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >, including all inherited members.
FirstIndex | ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
Items | ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
lastIndex | ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
Length | ItemCacheManager< T >::CacheEntryBlock< ITEMTYPE >
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario10.cpp Source File

  • FileAccess
  • cppwinrt

Scenario10.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario10.h"
00014 #include "Scenario10.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario10::Scenario10()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario10::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         SampleState::ValidateFile();
00033     }
00034
00035     fire_and_forget Scenario10::DeleteFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00036     {
00037         auto lifetime = get_strong();
00038
00039         StorageFile file = SampleState::SampleFile();
00040         if (file != nullptr)
00041         {
00042             hstring filename = file.Name();
00043             try
00044             {
00045                 co_await file.DeleteAsync();
00046                 SampleState::SampleFile(nullptr);
00047                 rootPage.NotifyUser(L"The file '" + filename + L"' was deleted.", NotifyType::StatusMessage);
00048             }
00049             catch (const hresult_error& ex)
00050             {
00051                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00052                 {
00053                     SampleState::NotifyUserFileNotExist();
00054                 }
00055                 else
00056                 {
00057                     // I/O errors are reported as exceptions.
00058                     rootPage.NotifyUser(L"Error deleting file '" + filename + L"': " + ex.message(), NotifyType::ErrorMessage);
00059                 }
00060             }
00061         }
00062         else
00063         {
00064             SampleState::NotifyUserFileNotExist();
00065         }
00066     }
00067 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/PopToastControl.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • Controls

PopToastControl.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00006
00007 namespace Notifications.Controls
00008 {
00009     public sealed partial class PopToastControl : UserControl
00010     {
00011         public PopToastControl()
00012         {
00013             this.InitializeComponent();
00014         }
00015
00016         private void ButtonPopToast_Click(object sender, RoutedEventArgs e)
00017         {
00018             ToastHelper.PopCustomToast(TextBoxPayload.Text);
00019         }
00020
00021         private void ButtonToggleShowPayload_Click(object sender, RoutedEventArgs e)
00022         {
00023             if (TextBoxPayload.Visibility == Visibility.Visible)
00024             {
00025                 TextBoxPayload.Visibility = Visibility.Collapsed;
00026                 ButtonToggleShowPayload.Content = "Show Payload";
00027             }
00028
00029             else
00030             {
00031                 TextBoxPayload.Visibility = Visibility.Visible;
00032                 ButtonToggleShowPayload.Content = "Hide Payload";
00033             }
00034         }
00035
00036         private static readonly DependencyProperty PayloadProperty = DependencyProperty.Register("Payload", typeof(string), typeof(PopToastControl), new PropertyMetadata(""));
00037
00038         public string Payload
00039         {
00040             get { return GetValue(PayloadProperty) as string; }
00041             set { SetValue(PayloadProperty, value); }
00042         }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage_PickFile Member List

This is the complete list of members for MainPage_PickFile, including all inherited members.
MainPage_PickFile() | MainPage_PickFile | [inline]
PickFileButton_Click(object sender, RoutedEventArgs e) | MainPage_PickFile | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameMain.h Source File

  • Simple3DGameXaml
  • cpp

GameMain.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // GameMain:
00013 // This class is the main class required for Windows Runtime apps.
00014 // It it called on Launch activation and maintains the overall state of the game.
00015 // The GameMain class drives and maintains a state machine for the game.  It can be in
00016 // one of seven major states defined by the UpdateEngineState enum class.
00017 // These are:
00018 //     WaitingForResources - the game has requested the game object or the renderer object
00019 //         to load resources asynchronously.
00020 //     ResourcesLoaded - the asynchronous loading of resources has been completed.  This
00021 //         is a transient state.
00022 //     WaitingForPress - the game is waiting for the player to indicate they are ready to proceed.
00023 //         There are three possible actions from this state.  This is controlled by m_pressResult.
00024 //         The possible outcomes are:
00025 //             LoadGame - The player is ready to start a new game and has acknowledged the status
00026 //                 information provided about the previous state.
00027 //             PlayLevel - The player is ready to play the next level.  The level has already been
00028 //                 loaded so active game play will start.
00029 //             ContinueLevel - The player is ready to continue playing the current level.  Part of the
00030 //                 current level has already been played.
00031 //     Dynamics - the game is active play mode.
00032 //     TooSmall - the window is currently too small to play the game.
00033 //     Suspended - the game was suspended by PLM.
00034 //     Deactivated - the game has lost focus.
00035 //
00036 // GameMain creates and maintains references to three major objects used for the game:
00037 //     MoveLookController (m_controller) - this object handles all the game specific user input and
00038 //         aggregates touch, mouse/keyboard and Xbox controller input into a unified input control.
00039 //     Simple3DGame (m_game) - this object handles all the game specific logic and game dynamics.
00040 //     GameRenderer (m_renderer) - This object handles all the graphics rendering for the game.
00041 //
00042
00043 #pragma once
00044
00045 #include "DeviceResources.h"
00046 #include "MoveLookController.h"
00047 #include "GameRenderer.h"
00048 #include "Simple3DGame.h"
00049 #include "GameUIControl.h"
00050
00051
00052 namespace GameControl
00053 {
00054     private enum class UpdateEngineState
00055     {
00056         WaitingForResources,
00057         ResourcesLoaded,
00058         WaitingForPress,
00059         Dynamics,
00060         TooSmall,
00061         Suspended,
00062         Deactivated,
00063     };
00064
00065     private enum class PressResultState
00066     {
00067         LoadGame,
00068         PlayLevel,
00069         ContinueLevel,
00070     };
00071
00072     private enum class GameInfoOverlayState
00073     {
00074         Loading,
00075         GameStats,
00076         GameOverExpired,
00077         GameOverCompleted,
00078         LevelStart,
00079         Pause,
00080     };
00081 };
00082
00083 class GameMain : public DX::IDeviceNotify
00084 {
00085 public:
00086     GameMain(const std::shared_ptr<DX::DeviceResources>& deviceResources, Simple3DGameXaml::IGameUIControl^ UIControl);
00087     ~GameMain();
00088     void CreateWindowSizeDependentResources();
00089     void StartRenderLoop();
00090     void StopRenderLoop();
00091     void Suspend();
00092     void Resume();
00093     Concurrency::critical_section& GetCriticalSection() { return m_criticalSection; }
00094
00095     // IDeviceNotify
00096     virtual void OnDeviceLost();
00097     virtual void OnDeviceRestored();
00098
00099     void PauseRequested() { if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };
00100     void PressComplete()  { if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };
00101     void ResetGame();
00102     void SetBackground(unsigned int background);
00103     void CycleBackground();
00104     void LicenseChanged(
00105         Windows::ApplicationModel::Store::ListingInformation^ listing,
00106         Windows::ApplicationModel::Store::LicenseInformation^ license
00107         );
00108
00109     void WindowActivationChanged(Windows::UI::Core::CoreWindowActivationState activationState);
00110
00111 private:
00112     void SetGameInfoOverlay(GameControl::GameInfoOverlayState state);
00113     void InitializeGameState();
00114     void UpdateLayoutState();
00115     void Update();
00116
00117     void InitializeLicense();
00118     void InitializeLicenseCore();
00119     void OnLicenseChanged();
00120
00121 private:
00122     bool                                                m_pauseRequested;
00123     bool                                                m_pressComplete;
00124     bool                                                m_haveFocus;
00125
00126     std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00127     Simple3DGameXaml::IGameUIControl^                   m_uiControl;
00128
00129     MoveLookController^                                 m_controller;
00130     GameRenderer^                                       m_renderer;
00131     Simple3DGame^                                       m_game;
00132
00133     GameControl::UpdateEngineState                      m_updateState;
00134     GameControl::UpdateEngineState                      m_updateStateNext;
00135     GameControl::PressResultState                       m_pressResult;
00136     GameControl::GameInfoOverlayState                   m_gameInfoOverlayState;
00137     Windows::ApplicationModel::Store::LicenseInformation^ m_licenseInformation;
00138     Windows::ApplicationModel::Store::ListingInformation^ m_listingInformation;
00139 #ifdef USE_STORE_SIMULATOR
00140     PersistentState^                                    m_licenseState;
00141     bool                                                m_isTrial;
00142 #endif
00143     Concurrency::critical_section                       m_criticalSection;
00144     Windows::Foundation::IAsyncAction^                  m_renderLoopWorker;
00145 };
00146
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_CloudFontOverview.xaml.h Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_CloudFontOverview.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_CloudFontOverview.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario_CloudFontOverview sealed
00020     {
00021     public:
00022         Scenario_CloudFontOverview();
00023     };
00024 }
Generated on Fri Nov 15 2024 22:19:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario12.xaml.cs Source File

  • ApplicationResources
  • cs

scenario12.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016 using Windows.ApplicationModel.Resources.Core;
00017 using System.Collections.Generic;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class Scenario12 : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         public Scenario12()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         /// <summary>
00036         /// Invoked when this page is about to be displayed in a Frame.
00037         /// </summary>
00038         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042         }
00043
00044         private async void Scenario12Button_Show_Click(object sender, RoutedEventArgs e)
00045         {
00046             // Two coding patterns will be used:
00047             //   1. Get a ResourceContext on the UI thread using GetForCurrentView and pass
00048             //      to the non-UI thread
00049             //   2. Get a ResourceContext on the non-UI thread using GetForViewIndependentUse
00050             //
00051             // Two analogous patterns could be used for ResourceLoader instead of ResourceContext.
00052
00053
00054             // pattern 1: get a ResourceContext for the UI thread
00055             ResourceContext defaultContextForUiThread = ResourceContext.GetForCurrentView();
00056
00057             // pattern 2: we'll create a view-independent context in the non-UI worker thread
00058
00059
00060             // We need some things in order to display results in the UI (doing that
00061             // for purposes of this sample, to show that work was actually done in the
00062             // worker thread):
00063             List<string> uiDependentResourceList = new List<string>();
00064             List<string> uiIndependentResourceList = new List<string>();
00065
00066
00067             // use a worker thread for the heavy lifting so the UI isn't blocked
00068             await Windows.System.Threading.ThreadPool.RunAsync(
00069                 (source) =>
00070                 {
00071                     ResourceMap stringResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
00072
00073                     // pattern 1: the defaultContextForUiThread variable was created above and is visible here
00074
00075                     // pattern 2: get a view-independent ResourceContext
00076                     ResourceContext defaultViewIndependentResourceContext = ResourceContext.GetForViewIndependentUse();
00077
00078                     // NOTE: The ResourceContext obtained using GetForViewIndependentUse() has no scale qualifier
00079                     // value set. If this ResourceContext is used in its default state to retrieve a resource, that
00080                     // will work provided that the resource does not have any scale-qualified variants. But if the
00081                     // resource has any scale-qualified variants, then that will fail at runtime.
00082                     //
00083                     // A scale qualifier value on this ResourceContext can be set programmatically. If that is done,
00084                     // then the ResourceContext can be used to retrieve a resource that has scale-qualified variants.
00085                     // But if the scale qualifier is reset (e.g., using the ResourceContext.Reset() method), then
00086                     // it will return to the default state with no scale qualifier value set, and cannot be used
00087                     // to retrieve any resource that has scale-qualified variants.
00088
00089
00090                     // simulate processing a number of items
00091                     // just using a single string resource: that's sufficient to demonstrate
00092                     for (var i = 0; i < 4; i++)
00093                     {
00094                         // pattern 1: use the ResourceContext from the UI thread
00095                         string listItem1 = stringResourceMap.GetValue("string1", defaultContextForUiThread).ValueAsString;
00096                         uiDependentResourceList.Add(listItem1);
00097
00098                         // pattern 2: use the view-independent ResourceContext
00099                         string listItem2 = stringResourceMap.GetValue("string1", defaultViewIndependentResourceContext).ValueAsString;
00100                         uiIndependentResourceList.Add(listItem2);
00101                     }
00102
00103                 });
00104
00105             // Display the results in one go. (A more finessed design might add results
00106             // in the UI asynchronously, but that goes beyond what this sample is
00107             // demonstrating.)
00108             ViewDependentResourcesList.ItemsSource = uiDependentResourceList;
00109             ViewIndependentResourcesList.ItemsSource = uiIndependentResourceList;
00110         }
00111
00112     }
00113 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/TextStyles/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • TextStyles

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Notifications.Helpers;
00002 using System;
00003 using System.Threading.Tasks;
00004 using Windows.Data.Xml.Dom;
00005 using Windows.UI.Notifications;
00006 using Windows.UI.Popups;
00007 using Windows.UI.StartScreen;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010
00011 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00012
00013 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.TextStyles
00014 {
00015     /// <summary>
00016     /// An empty page that can be used on its own or navigated to within a Frame.
00017     /// </summary>
00018     public sealed partial class ScenarioElement : UserControl
00019     {
00020         public ScenarioElement()
00021         {
00022             this.InitializeComponent();
00023         }
00024
00025         private async void ButtonPin_Click(object sender, RoutedEventArgs e)
00026         {
00027             ButtonPin.IsEnabled = false;
00028
00029             await PinTile("caption");
00030             await PinTile("body");
00031             await PinTile("base");
00032             await PinTile("subtitle");
00033             await PinTile("title");
00034             await PinTile("subheader");
00035             await PinTile("header");
00036             await PinTile("captionsubtle");
00037             await PinTile("bodysubtle");
00038             await PinTile("basesubtle");
00039             await PinTile("subtitlesubtle");
00040             await PinTile("titlesubtle");
00041             await PinTile("subheadersubtle");
00042             await PinTile("headersubtle");
00043             await PinTile("subheadernumeral");
00044             await PinTile("headernumeral");
00045
00046
00047             await new MessageDialog("SUCCESS").ShowAsync();
00048             ButtonPin.IsEnabled = true;
00049         }
00050
00051         private async Task PinTile(string style)
00052         {
00053             SecondaryTile tile = TilesHelper.GenerateSecondaryTile(style);
00054             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00055             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00056             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00057
00058             await tile.RequestCreateAsync();
00059
00060             string xml = $@"
00061                 <tile version='3'>
00062                     <visual>
00063
00064                         <binding template='TileSmall'>
00065                             <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
00066                         </binding>
00067
00068                         <binding template='TileMedium'>
00069                             <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
00070                         </binding>
00071
00072                         <binding template='TileWide'>
00073                             <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
00074                         </binding>
00075
00076                         <binding template='TileLarge'>
00077                             <text hint-style='{style}'>This is a string of text that will be styled to the desired effect</text>
00078                         </binding>
00079                     </visual>
00080                 </tile>";
00081
00082             XmlDocument doc = new XmlDocument();
00083             doc.LoadXml(xml);
00084
00085             TileNotification notification = new TileNotification(doc);
00086             TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notification);
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/ColorToStringConverter.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

ColorToStringConverter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Data;
00005
00006
00007 namespace xBindSampleModel
00008 {
00009     public sealed class ColorToStringConverter : IValueConverter
00010     {
00011         static string[] colorNames = { "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "Firebrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Gray", "Green", "GreenYellow", "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Transparent", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen" };
00012         static Color[] colorValues = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen };
00013
00014         public object Convert(object value, Type targetType, object parameter, string language)
00015         {
00016             Color src = (Color)value;
00017             for (int i = 0; i < colorValues.Length; i++)
00018             {
00019                 if (src == colorValues[i])
00020                 {
00021                     return colorNames[i];
00022                 }
00023             }
00024             return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", src.A, src.R, src.G, src.B);
00025         }
00026
00027         public object ConvertBack(object value, Type targetType, object parameter, string language)
00028         {
00029             string src = (string)value;
00030             for (int i = 0; i < colorValues.Length; i++)
00031             {
00032                 if (src == colorNames[i])
00033                 {
00034                     return colorValues[i];
00035                 }
00036             }
00037             if (src.StartsWith("#"))
00038             {
00039                 return Color.FromArgb(Byte.Parse(src.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
00040                     Byte.Parse(src.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
00041                     Byte.Parse(src.Substring(5, 2), System.Globalization.NumberStyles.HexNumber),
00042                     Byte.Parse(src.Substring(7, 2), System.Globalization.NumberStyles.HexNumber));
00043             }
00044             throw new ArgumentException("Cannot parse the color");
00045         }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario1.xaml.cpp Source File

  • FolderEnumeration
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.cpp
00013 // Implementation of the Scenario1 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario1.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Platform;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Storage;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Scenario1::Scenario1()
00030 {
00031     InitializeComponent();
00032 }
00033
00034 void Scenario1::GetFilesAndFoldersButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00035 {
00036     OutputTextBlock->Text = "";
00037
00038     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary)).then([this](StorageFolder^ picturesFolder)
00039     {
00040         create_task(picturesFolder->GetFoldersAsync()).then([this, picturesFolder](IVectorView<StorageFolder^>^ folders)
00041         {
00042             create_task(picturesFolder->GetFilesAsync()).then([this, picturesFolder, folders](IVectorView<StorageFile^>^ files)
00043             {
00044                 auto count = folders->Size + files->Size;
00045                 String^ outputText = ref new String();
00046                 outputText = picturesFolder->Name + " (" + count.ToString() + ")\n\n";
00047                 std::for_each(begin(folders), end(folders), [this, &outputText](StorageFolder^ folder)
00048                 {
00049                     outputText += "    " + folder->DisplayName + "\\\n";
00050                 });
00051                 std::for_each(begin(files), end(files), [this, &outputText](StorageFile^ file)
00052                 {
00053                     outputText += "    " + file->Name + "\n";
00054                 });
00055                 OutputTextBlock->Text = outputText;
00056             });
00057         });
00058     });
00059 }
Generated on Fri Nov 15 2024 22:17:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.cpp Source File

  • NetworkConnectivity
  • cppwinrt

Scenario2_NetworkCost.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_NetworkCost.h"
00014 #include "Scenario2_NetworkCost.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Networking::Connectivity;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario2_NetworkCost::Scenario2_NetworkCost()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario2_NetworkCost::GetNetworkCost_Click(IInspectable const&, RoutedEventArgs const&)
00031     {
00032         ResultsText().Text(L"");
00033
00034         ConnectionProfile profile = NetworkInformation::GetInternetConnectionProfile();
00035         if (profile != nullptr)
00036         {
00037             ConnectionCost connectionCost = profile.GetConnectionCost();
00038             AppendLine(ResultsText(), L"Network cost is: " + to_hstring(connectionCost.NetworkCostType()) + L".");
00039             EvaluateAndReportConnectionCost(connectionCost, ResultsText());
00040         }
00041         else
00042         {
00043             AppendLine(ResultsText(), L"No internet connection profile.");
00044         }
00045     }
00046 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Scenario1_Events.xaml.cs Source File

  • Pedometer
  • cs

Scenario1_Events.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013
00014 using System;
00015 using Windows.Devices.Sensors;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Foundation;
00018 using Windows.Globalization.DateTimeFormatting;
00019 using Windows.UI.Core;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace PedometerCS
00025 {
00026     /// <summary>
00027     /// 'Events' scenario page that gets navigated to when the user selected the 'Events' scenario.
00028     /// </summary>
00029     public sealed partial class Scenario1_Events : Page
00030     {
00031         // Common class ID for pedometers
00032         Guid PedometerClassId = new Guid("B19F89AF-E3EB-444B-8DEA-202575A71599");
00033
00034         MainPage rootPage = MainPage.Current;
00035
00036         public Scenario1_Events()
00037         {
00038             this.InitializeComponent();
00039
00040             // Register for access changed notifications for pedometers
00041             deviceAccessInformation = DeviceAccessInformation.CreateFromDeviceClassId(PedometerClassId);
00042             deviceAccessInformation.AccessChanged += new TypedEventHandler<DeviceAccessInformation, DeviceAccessChangedEventArgs>(AccessChanged);
00043         }
00044
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             rootPage = MainPage.Current;
00048         }
00049
00050         protected override void OnNavigatedFrom(NavigationEventArgs e)
00051         {
00052             base.OnNavigatedFrom(e);
00053         }
00054
00055         /// <summary>
00056         /// 'Register ReadingChanged' button click handler. Registers for the
00057         /// 'ReadingChanged' event of the default pedometer.
00058         /// </summary>
00059         /// <param name="sender">unused</param>
00060         /// <param name="e">unused</param>
00061         async private void RegisterButton_Click(object sender, RoutedEventArgs e)
00062         {
00063             // Get the default sensor
00064             if (!registeredForEvents)
00065             {
00066                 RegisterButton.IsEnabled = false;
00067                 try
00068                 {
00069                     pedometer = await Pedometer.GetDefaultAsync();
00070                     if (null == pedometer)
00071                     {
00072                         rootPage.NotifyUser("No pedometer available", NotifyType.ErrorMessage);
00073                     }
00074                     else
00075                     {
00076                         RegisterButton.Content = "Unregister ReadingChanged";
00077                         RegisterButton.IsEnabled = true;
00078                         rootPage.NotifyUser("Registered for step count changes", NotifyType.StatusMessage);
00079                         pedometer.ReportInterval = pedometer.MinimumReportInterval;
00080                         pedometer.ReadingChanged += Pedometer_ReadingChanged;
00081                         registeredForEvents = true;
00082                     }
00083                 }
00084                 catch (System.UnauthorizedAccessException)
00085                 {
00086                     rootPage.NotifyUser("Access to the default pedometer is denied", NotifyType.ErrorMessage);
00087                 }
00088                 RegisterButton.IsEnabled = true;
00089             }
00090             else
00091             {
00092                 if (pedometer != null)
00093                 {
00094                     pedometer.ReadingChanged -= Pedometer_ReadingChanged;
00095                     pedometer = null;
00096                     rootPage.NotifyUser("Pedometer available - Not registered for events", NotifyType.StatusMessage);
00097                 }
00098                 RegisterButton.Content = "Register ReadingChanged";
00099                 registeredForEvents = false;
00100             }
00101         }
00102
00103         /// <summary>
00104         /// Invoked when the underlying Pedometer sees a change in the step count for a step kind
00105         /// </summary>
00106         /// <param name="sender">unused</param>
00107         /// <param name="args">Pedometer reading that is being notified</param>
00108         async private void Pedometer_ReadingChanged(Pedometer sender, PedometerReadingChangedEventArgs args)
00109         {
00110             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00111             {
00112                 PedometerReading reading = args.Reading;
00113                 int newCount = 0;
00114
00115                 // update step counts based on the step kind
00116                 switch (reading.StepKind)
00117                 {
00118                     case PedometerStepKind.Unknown:
00119                         if (reading.CumulativeSteps < unknownStepCount)
00120                         {
00121                             unknownStepCount = 0;
00122                         }
00123                         newCount = reading.CumulativeSteps - unknownStepCount;
00124                         unknownStepCount = reading.CumulativeSteps;
00125                         ScenarioOutput_UnknownCount.Text = unknownStepCount.ToString();
00126                         ScenarioOutput_UnknownDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
00127                         break;
00128                     case PedometerStepKind.Walking:
00129                         if (reading.CumulativeSteps < walkingStepCount)
00130                         {
00131                             walkingStepCount = 0;
00132                         }
00133                         newCount = reading.CumulativeSteps - walkingStepCount;
00134                         walkingStepCount = reading.CumulativeSteps;
00135                         ScenarioOutput_WalkingCount.Text = walkingStepCount.ToString();
00136                         ScenarioOutput_WalkingDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
00137                         break;
00138                     case PedometerStepKind.Running:
00139                         if (reading.CumulativeSteps < runningStepCount)
00140                         {
00141                             runningStepCount = 0;
00142                         }
00143                         newCount = reading.CumulativeSteps - runningStepCount;
00144                         runningStepCount = reading.CumulativeSteps;
00145                         ScenarioOutput_RunningCount.Text = runningStepCount.ToString();
00146                         ScenarioOutput_RunningDuration.Text = reading.CumulativeStepsDuration.TotalMilliseconds.ToString();
00147                         break;
00148                     default:
00149                         break;
00150                 }
00151
00152                 totalCumulativeSteps += newCount;
00153                 ScenarioOutput_TotalStepCount.Text = totalCumulativeSteps.ToString();
00154
00155                 DateTimeFormatter timestampFormatter = new DateTimeFormatter("shortdate longtime");
00156                 ScenarioOutput_Timestamp.Text = timestampFormatter.Format(reading.Timestamp);
00157             });
00158         }
00159
00160         /// <summary>
00161         /// This is the event handler for AccessChanged events.
00162         /// </summary>
00163         /// <param name="sender"></param>
00164         /// <param name="e"></param>
00165         async private void AccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs e)
00166         {
00167             var status = e.Status;
00168             if (status != DeviceAccessStatus.Allowed)
00169             {
00170                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00171                 {
00172                     rootPage.NotifyUser("Access denied to pedometers", NotifyType.ErrorMessage);
00173                     pedometer = null;
00174
00175                     registeredForEvents = false;
00176                     RegisterButton.Content = "Register ReadingChanged";
00177                 });
00178             }
00179         }
00180
00181         private DeviceAccessInformation deviceAccessInformation = null;
00182         private Pedometer pedometer = null;
00183         private bool registeredForEvents = false;
00184         private Int32 totalCumulativeSteps;
00185         private Int32 unknownStepCount;
00186         private Int32 walkingStepCount;
00187         private Int32 runningStepCount;
00188     }
00189 }
Generated on Fri Nov 15 2024 22:20:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SimpleLogger Member List

This is the complete list of members for SimpleLogger, including all inherited members.
_dispatcher | SimpleLogger | [private]
_messageCount | SimpleLogger | [private]
_messageLock | SimpleLogger | [private]
_messageText | SimpleLogger | [private]
_textBlock | SimpleLogger | [private]
Log(string message) | SimpleLogger | [inline, private]
SimpleLogger(TextBlock textBlock) | SimpleLogger | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/BooleanToVisibilityConverter.cs Source File

  • RemoteSystems
  • cs

BooleanToVisibilityConverter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Data;
00004
00005 namespace SDKTemplate
00006 {
00007     class BooleanToVisibilityConverter : IValueConverter
00008     {
00009         public bool IsInverse { get; set; }
00010         public object Convert(object value, Type targetType, object parameter, string language)
00011         {
00012             bool visibility = (bool)value;
00013             if (IsInverse)
00014             {
00015                 visibility = !visibility;
00016             }
00017
00018             return visibility ? Visibility.Visible : Visibility.Collapsed;
00019         }
00020
00021         public object ConvertBack(object value, Type targetType, object parameter, string language)
00022         {
00023             throw new NotImplementedException();
00024         }
00025     }
00026 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPIRenderer.cpp Source File

  • WindowsAudioSession
  • cpp

WASAPIRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // wasapirenderer.h
00013 //
00014
00015 #include "pch.h"
00016 #include "WASAPIRenderer.h"
00017
00018 using namespace Windows::System::Threading;
00019 using namespace SDKSample::WASAPIAudio;
00020
00021 //
00022 //  WASAPIRenderer()
00023 //
00024 WASAPIRenderer::WASAPIRenderer() :
00025     m_BufferFrames( 0 ),
00026     m_ChannelVolume( 1.0f ),
00027     m_DeviceStateChanged( nullptr ),
00028     m_AudioClient( nullptr ),
00029     m_AudioRenderClient( nullptr ),
00030     m_SampleReadyAsyncResult( nullptr ),
00031     m_ToneSource( nullptr ),
00032     m_MFSource( nullptr )
00033 {
00034     // Create events for sample ready or user stop
00035     m_SampleReadyEvent = CreateEventEx( nullptr, nullptr, 0, EVENT_ALL_ACCESS );
00036     if (nullptr == m_SampleReadyEvent)
00037     {
00038         ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
00039     }
00040
00041     if (!InitializeCriticalSectionEx( &m_CritSec, 0, 0 ))
00042     {
00043         ThrowIfFailed( HRESULT_FROM_WIN32( GetLastError() ) );
00044     }
00045
00046     m_DeviceStateChanged = ref new DeviceStateChangedEvent();
00047     if (nullptr == m_DeviceStateChanged)
00048     {
00049         ThrowIfFailed( E_OUTOFMEMORY );
00050     }
00051 }
00052
00053 //
00054 //  ~WASAPIRenderer()
00055 //
00056 WASAPIRenderer::~WASAPIRenderer()
00057 {
00058     SAFE_RELEASE( m_AudioClient );
00059     SAFE_RELEASE( m_AudioRenderClient );
00060     SAFE_RELEASE( m_SampleReadyAsyncResult );
00061     SAFE_RELEASE( m_MFSource );
00062     SAFE_DELETE( m_ToneSource );
00063
00064     if (INVALID_HANDLE_VALUE != m_SampleReadyEvent)
00065     {
00066         CloseHandle( m_SampleReadyEvent );
00067         m_SampleReadyEvent = INVALID_HANDLE_VALUE;
00068     }
00069
00070     DeleteCriticalSection( &m_CritSec );
00071
00072     CoTaskMemFree( m_MixFormat );
00073
00074     m_DeviceStateChanged = nullptr;
00075 }
00076
00077 //
00078 //  InitializeAudioDeviceAsync()
00079 //
00080 //  Activates the default audio renderer on a asynchronous callback thread.  This needs
00081 //  to be called from the main UI thread.
00082 //
00083 HRESULT WASAPIRenderer::InitializeAudioDeviceAsync()
00084 {
00085     IActivateAudioInterfaceAsyncOperation *asyncOp;
00086     HRESULT hr = S_OK;
00087
00088     // Get a string representing the Default Audio Device Renderer
00089     m_DeviceIdString = MediaDevice::GetDefaultAudioRenderId( Windows::Media::Devices::AudioDeviceRole::Default );
00090
00091    // This call must be made on the main UI thread.  Async operation will call back to
00092     // IActivateAudioInterfaceCompletionHandler::ActivateCompleted, which must be an agile interface implementation
00093     hr = ActivateAudioInterfaceAsync( m_DeviceIdString->Data(), __uuidof(IAudioClient3), nullptr, this, &asyncOp );
00094     if (FAILED( hr ))
00095     {
00096         m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
00097     }
00098
00099     SAFE_RELEASE( asyncOp );
00100
00101     return hr;
00102 }
00103
00104 //
00105 //  ActivateCompleted()
00106 //
00107 //  Callback implementation of ActivateAudioInterfaceAsync function.  This will be called on MTA thread
00108 //  when results of the activation are available.
00109 //
00110 HRESULT WASAPIRenderer::ActivateCompleted( IActivateAudioInterfaceAsyncOperation *operation )
00111 {
00112     HRESULT hr = S_OK;
00113     HRESULT hrActivateResult = S_OK;
00114     IUnknown *punkAudioInterface = nullptr;
00115
00116     if (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateUnInitialized)
00117     {
00118         hr = E_NOT_VALID_STATE;
00119         goto exit;
00120     }
00121
00122     // Check for a successful activation result
00123     hr = operation->GetActivateResult( &hrActivateResult, &punkAudioInterface );
00124     if (SUCCEEDED( hr ) && SUCCEEDED( hrActivateResult ))
00125     {
00126         m_DeviceStateChanged->SetState( DeviceState::DeviceStateActivated, S_OK, false );
00127
00128         // Get the pointer for the Audio Client
00129         punkAudioInterface->QueryInterface( IID_PPV_ARGS(&m_AudioClient) );
00130         if( nullptr == m_AudioClient )
00131         {
00132             hr = E_FAIL;
00133             goto exit;
00134         }
00135
00136         // Configure user defined properties
00137         hr = ConfigureDeviceInternal();
00138         if (FAILED( hr ))
00139         {
00140             goto exit;
00141         }
00142
00143         // Initialize the AudioClient in Shared Mode with the user specified buffer
00144         if (!m_DeviceProps.IsLowLatency || m_DeviceProps.IsHWOffload)
00145         {
00146             hr = m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
00147                 AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
00148                 m_DeviceProps.hnsBufferDuration,
00149                 m_DeviceProps.hnsBufferDuration,
00150                 m_MixFormat,
00151                 nullptr);
00152         }
00153         else
00154         {
00155             hr = m_AudioClient->InitializeSharedAudioStream(
00156                 AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
00157                 m_MinPeriodInFrames,
00158                 m_MixFormat,
00159                 nullptr);
00160         }
00161         if (FAILED( hr ))
00162         {
00163             goto exit;
00164         }
00165
00166         // Get the maximum size of the AudioClient Buffer
00167         hr = m_AudioClient->GetBufferSize( &m_BufferFrames );
00168         if (FAILED( hr ))
00169         {
00170             goto exit;
00171         }
00172
00173         // Get the render client
00174         hr = m_AudioClient->GetService( __uuidof(IAudioRenderClient), (void**) &m_AudioRenderClient );
00175         if (FAILED( hr ))
00176         {
00177             goto exit;
00178         }
00179
00180         // Create Async callback for sample events
00181         hr = MFCreateAsyncResult( nullptr, &m_xSampleReady, nullptr, &m_SampleReadyAsyncResult );
00182         if (FAILED( hr ))
00183         {
00184             goto exit;
00185         }
00186
00187         // Sets the event handle that the system signals when an audio buffer is ready to be processed by the client
00188         hr = m_AudioClient->SetEventHandle( m_SampleReadyEvent );
00189         if (FAILED( hr ))
00190         {
00191             goto exit;
00192         }
00193
00194         // Everything succeeded
00195         m_DeviceStateChanged->SetState( DeviceState::DeviceStateInitialized, S_OK, true );
00196
00197     }
00198
00199 exit:
00200     SAFE_RELEASE( punkAudioInterface );
00201
00202     if (FAILED( hr ))
00203     {
00204         m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
00205         SAFE_RELEASE( m_AudioClient );
00206         SAFE_RELEASE( m_AudioRenderClient );
00207         SAFE_RELEASE( m_SampleReadyAsyncResult );
00208     }
00209
00210     // Need to return S_OK
00211     return S_OK;
00212 }
00213
00214 //
00215 //  SetProperties()
00216 //
00217 //  Sets various properties that the user defines in the scenario
00218 //
00219 HRESULT WASAPIRenderer::SetProperties( DEVICEPROPS props )
00220 {
00221     m_DeviceProps = props;
00222     return S_OK;
00223 }
00224
00225 //
00226 //  GetBufferFramesPerPeriod()
00227 //
00228 //  Get the time in seconds between passes of the audio device
00229 //
00230 UINT32 WASAPIRenderer::GetBufferFramesPerPeriod()
00231 {
00232     REFERENCE_TIME defaultDevicePeriod = 0;
00233     REFERENCE_TIME minimumDevicePeriod = 0;
00234
00235     if (m_DeviceProps.IsHWOffload)
00236     {
00237         return m_BufferFrames;
00238     }
00239
00240     if (m_DeviceProps.IsLowLatency)
00241     {
00242         return m_MinPeriodInFrames;
00243     }
00244
00245     // Get the audio device period
00246     HRESULT hr = m_AudioClient->GetDevicePeriod( &defaultDevicePeriod, &minimumDevicePeriod);
00247     if (FAILED( hr ))
00248     {
00249         return 0;
00250     }
00251
00252     double devicePeriodInSeconds = defaultDevicePeriod / (10000.0*1000.0);
00253     return static_cast<UINT32>( m_MixFormat->nSamplesPerSec * devicePeriodInSeconds + 0.5 );
00254 }
00255
00256 //
00257 //  ConfigureDeviceInternal()
00258 //
00259 //  Sets additional playback parameters and opts into hardware offload
00260 //
00261 HRESULT WASAPIRenderer::ConfigureDeviceInternal()
00262 {
00263     if (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateActivated)
00264     {
00265         return E_NOT_VALID_STATE;
00266     }
00267
00268     HRESULT hr = S_OK;
00269
00270     // Opt into HW Offloading.  If the endpoint does not support offload it will return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE
00271     AudioClientProperties audioProps = {0};
00272     audioProps.cbSize = sizeof( AudioClientProperties );
00273     audioProps.bIsOffload = m_DeviceProps.IsHWOffload;
00274     audioProps.eCategory = AudioCategory_Media;
00275
00276     if (m_DeviceProps.IsRawChosen && m_DeviceProps.IsRawSupported)
00277     {
00278         audioProps.Options = AUDCLNT_STREAMOPTIONS_RAW;
00279     }
00280
00281     hr = m_AudioClient->SetClientProperties( &audioProps );
00282     if (FAILED( hr ))
00283     {
00284         return hr;
00285     }
00286
00287     // If application already has a preferred source format available,
00288     // it can test whether the format is supported by the device:
00289     //
00290     // WAVEFORMATEX* applicationFormat = ...;
00291     // if (S_OK == m_AudioClient->IsFormatSupported(applicationFormat))
00292     // {
00293     //     m_MixFormat = applicationFormat;
00294     // }
00295     // else
00296     // {
00297     //     //device does not support the application format, so ask the device what format it prefers
00298     //     m_AudioClient->GetMixFormat( &m_MixFormat );
00299     // }
00300
00301     // In this sample we do not have a format already available, so we go ahead and ask the device which format it prefers
00302     // This sample opens the device is shared mode so we need to find the supported WAVEFORMATEX mix format
00303     hr = m_AudioClient->GetMixFormat( &m_MixFormat );
00304     if (FAILED( hr ))
00305     {
00306         return hr;
00307     }
00308
00309     if (!audioProps.bIsOffload)
00310     {
00311         // The wfx parameter below is optional (Its needed only for MATCH_FORMAT clients). Otherwise, wfx will be assumed
00312         // to be the current engine format based on the processing mode for this stream
00313         hr = m_AudioClient->GetSharedModeEnginePeriod(m_MixFormat, &m_DefaultPeriodInFrames, &m_FundamentalPeriodInFrames, &m_MinPeriodInFrames, &m_MaxPeriodInFrames);
00314         if (FAILED(hr))
00315         {
00316             return hr;
00317         }
00318     }
00319
00320     // Verify the user defined value for hardware buffer
00321     hr = ValidateBufferValue();
00322
00323     return hr;
00324 }
00325
00326 //
00327 //  ValidateBufferValue()
00328 //
00329 //  Verifies the user specified buffer value for hardware offload
00330 //
00331 HRESULT WASAPIRenderer::ValidateBufferValue()
00332 {
00333     HRESULT hr = S_OK;
00334
00335     if (!m_DeviceProps.IsHWOffload)
00336     {
00337         // If we aren't using HW Offload, set this to 0 to use the default value
00338         m_DeviceProps.hnsBufferDuration = 0;
00339         return hr;
00340     }
00341
00342     REFERENCE_TIME hnsMinBufferDuration;
00343     REFERENCE_TIME hnsMaxBufferDuration;
00344
00345     hr = m_AudioClient->GetBufferSizeLimits( m_MixFormat, true, &hnsMinBufferDuration, &hnsMaxBufferDuration );
00346     if (SUCCEEDED( hr ))
00347     {
00348         if (m_DeviceProps.hnsBufferDuration < hnsMinBufferDuration)
00349         {
00350             // using MINIMUM size instead
00351             m_DeviceProps.hnsBufferDuration = hnsMinBufferDuration;
00352         }
00353         else if (m_DeviceProps.hnsBufferDuration > hnsMaxBufferDuration)
00354         {
00355             // using MAXIMUM size instead
00356             m_DeviceProps.hnsBufferDuration = hnsMaxBufferDuration;
00357         }
00358     }
00359
00360     return hr;
00361 }
00362
00363 //
00364 //  SetVolumeOnSession()
00365 //
00366 HRESULT WASAPIRenderer::SetVolumeOnSession(UINT32 volume)
00367 {
00368     if (volume > 100)
00369     {
00370         return E_INVALIDARG;
00371     }
00372
00373     HRESULT hr = S_OK;
00374     m_ChannelVolume = volume / (float)100.0;
00375
00376     // Set the session volume on the endpoint if we have one.
00377     if (m_AudioClient != nullptr)
00378     {
00379         hr = SetAudioClientChannelVolume();
00380     }
00381     return hr;
00382 }
00383
00384 HRESULT WASAPIRenderer::SetAudioClientChannelVolume()
00385 {
00386     ISimpleAudioVolume* SessionAudioVolume = nullptr;
00387     HRESULT hr = m_AudioClient->GetService(__uuidof(ISimpleAudioVolume), reinterpret_cast<void**>(&SessionAudioVolume));
00388     if (FAILED(hr))
00389     {
00390         goto exit;
00391     }
00392
00393     // Set the session volume on the endpoint
00394     hr = SessionAudioVolume->SetMasterVolume( m_ChannelVolume, nullptr );
00395
00396 exit:
00397     SAFE_RELEASE( SessionAudioVolume );
00398     return hr;
00399 }
00400
00401 //
00402 //  ConfigureSource()
00403 //
00404 //  Configures tone or file playback
00405 //
00406 HRESULT WASAPIRenderer::ConfigureSource()
00407 {
00408     HRESULT hr = S_OK;
00409     UINT32 FramesPerPeriod = GetBufferFramesPerPeriod();
00410
00411     if (m_DeviceProps.IsTonePlayback)
00412     {
00413         // Generate the sine wave sample buffer
00414         m_ToneSource = new ToneSampleGenerator();
00415         if (m_ToneSource)
00416         {
00417             hr = m_ToneSource->GenerateSampleBuffer( m_DeviceProps.Frequency, FramesPerPeriod, m_MixFormat );
00418         }
00419         else
00420         {
00421             hr = E_OUTOFMEMORY;
00422         }
00423     }
00424     else
00425     {
00426         m_MFSource = new MFSampleGenerator();
00427         if (m_MFSource)
00428         {
00429             hr = m_MFSource->Initialize( m_DeviceProps.ContentStream, FramesPerPeriod, m_MixFormat );
00430         }
00431         else
00432         {
00433             hr = E_OUTOFMEMORY;
00434         }
00435     }
00436
00437     return hr;
00438 }
00439
00440 //
00441 //  StartPlaybackAsync()
00442 //
00443 //  Starts asynchronous playback on a separate thread via MF Work Item
00444 //
00445 HRESULT WASAPIRenderer::StartPlaybackAsync()
00446 {
00447     HRESULT hr = S_OK;
00448
00449     // We should be stopped if the user stopped playback, or we should be
00450     // initialzied if this is the first time through getting ready to playback.
00451     if ( (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateStopped) ||
00452          (m_DeviceStateChanged->GetState() == DeviceState::DeviceStateInitialized) )
00453     {
00454         // Setup either ToneGeneration or File Playback
00455         hr = ConfigureSource();
00456         if (FAILED( hr ))
00457         {
00458             m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
00459             return hr;
00460         }
00461
00462         m_DeviceStateChanged->SetState( DeviceState::DeviceStateStarting, S_OK, true );
00463         return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStartPlayback, nullptr );
00464     }
00465     else if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStatePaused)
00466     {
00467         return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStartPlayback, nullptr );
00468     }
00469
00470     // Otherwise something else happened
00471     return E_FAIL;
00472 }
00473
00474 //
00475 //  OnStartPlayback()
00476 //
00477 //  Callback method to start playback
00478 //
00479 HRESULT WASAPIRenderer::OnStartPlayback( IMFAsyncResult* pResult )
00480 {
00481     HRESULT hr = S_OK;
00482
00483     // Pre-Roll the buffer with silence
00484     hr = OnAudioSampleRequested( true );
00485     if (FAILED( hr ))
00486     {
00487         goto exit;
00488     }
00489
00490     // For MF Source playback, need to start the source reader
00491     if (!m_DeviceProps.IsTonePlayback)
00492     {
00493         hr = m_MFSource->StartSource();
00494         if (FAILED( hr ))
00495         {
00496             goto exit;
00497         }
00498     }
00499
00500     // Set the initial volume.
00501     SetAudioClientChannelVolume();
00502
00503     // Actually start the playback
00504     hr = m_AudioClient->Start();
00505     if (SUCCEEDED( hr ))
00506     {
00507         m_DeviceStateChanged->SetState( DeviceState::DeviceStatePlaying, S_OK, true );
00508         hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
00509     }
00510
00511 exit:
00512     if (FAILED( hr ))
00513     {
00514         m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
00515     }
00516
00517     return S_OK;
00518 }
00519
00520 //
00521 //  StopPlaybackAsync()
00522 //
00523 //  Stop playback asynchronously via MF Work Item
00524 //
00525 HRESULT WASAPIRenderer::StopPlaybackAsync()
00526 {
00527     if ( (m_DeviceStateChanged->GetState() != DeviceState::DeviceStatePlaying) &&
00528          (m_DeviceStateChanged->GetState() != DeviceState::DeviceStatePaused) &&
00529          (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateInError) )
00530     {
00531         return E_NOT_VALID_STATE;
00532     }
00533
00534     m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopping, S_OK, true );
00535
00536     return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xStopPlayback, nullptr );
00537 }
00538
00539 //
00540 //  OnStopPlayback()
00541 //
00542 //  Callback method to stop playback
00543 //
00544 HRESULT WASAPIRenderer::OnStopPlayback( IMFAsyncResult* pResult )
00545 {
00546     // Stop playback by cancelling Work Item
00547     // Cancel the queued work item (if any)
00548     if (0 != m_SampleReadyKey)
00549     {
00550         MFCancelWorkItem( m_SampleReadyKey );
00551         m_SampleReadyKey = 0;
00552     }
00553
00554     // Flush anything left in buffer with silence
00555     OnAudioSampleRequested( true );
00556
00557     m_AudioClient->Stop();
00558     SAFE_RELEASE( m_SampleReadyAsyncResult );
00559
00560     if (m_DeviceProps.IsTonePlayback)
00561     {
00562         // Flush remaining buffers
00563         m_ToneSource->Flush();
00564     }
00565     else
00566     {
00567         // Stop Source and Flush remaining buffers
00568         m_MFSource->StopSource();
00569         m_MFSource->Shutdown();
00570     }
00571
00572     m_DeviceStateChanged->SetState( DeviceState::DeviceStateStopped, S_OK, true );
00573     return S_OK;
00574 }
00575
00576 //
00577 //  PausePlaybackAsync()
00578 //
00579 //  Pause playback asynchronously via MF Work Item
00580 //
00581 HRESULT WASAPIRenderer::PausePlaybackAsync()
00582 {
00583     if ( (m_DeviceStateChanged->GetState() !=  DeviceState::DeviceStatePlaying) &&
00584          (m_DeviceStateChanged->GetState() != DeviceState::DeviceStateInError) )
00585     {
00586         return E_NOT_VALID_STATE;
00587     }
00588
00589     // Change state to stop automatic queueing of samples
00590     m_DeviceStateChanged->SetState( DeviceState::DeviceStatePausing, S_OK, false );
00591     return MFPutWorkItem2( MFASYNC_CALLBACK_QUEUE_MULTITHREADED, 0, &m_xPausePlayback, nullptr );
00592
00593 }
00594
00595 //
00596 //  OnPausePlayback()
00597 //
00598 //  Callback method to pause playback
00599 //
00600 HRESULT WASAPIRenderer::OnPausePlayback( IMFAsyncResult* pResult )
00601 {
00602     m_AudioClient->Stop();
00603     m_DeviceStateChanged->SetState( DeviceState::DeviceStatePaused, S_OK, true );
00604     return S_OK;
00605 }
00606
00607 //
00608 //  OnSampleReady()
00609 //
00610 //  Callback method when ready to fill sample buffer
00611 //
00612 HRESULT WASAPIRenderer::OnSampleReady( IMFAsyncResult* pResult )
00613 {
00614     HRESULT hr = S_OK;
00615
00616     hr = OnAudioSampleRequested( false );
00617
00618     if (SUCCEEDED( hr ))
00619     {
00620         // Re-queue work item for next sample
00621         if (m_DeviceStateChanged->GetState() ==  DeviceState::DeviceStatePlaying)
00622         {
00623             hr = MFPutWaitingWorkItem( m_SampleReadyEvent, 0, m_SampleReadyAsyncResult, &m_SampleReadyKey );
00624         }
00625     }
00626     if (FAILED( hr ))
00627     {
00628         m_DeviceStateChanged->SetState( DeviceState::DeviceStateInError, hr, true );
00629     }
00630
00631     return hr;
00632 }
00633
00634 //
00635 //  OnAudioSampleRequested()
00636 //
00637 //  Called when audio device fires m_SampleReadyEvent
00638 //
00639 HRESULT WASAPIRenderer::OnAudioSampleRequested( Platform::Boolean IsSilence )
00640 {
00641     HRESULT hr = S_OK;
00642     UINT32 PaddingFrames = 0;
00643     UINT32 FramesAvailable = 0;
00644
00645     EnterCriticalSection( &m_CritSec );
00646
00647     // Get padding in existing buffer
00648     hr = m_AudioClient->GetCurrentPadding( &PaddingFrames );
00649     if (FAILED( hr ))
00650     {
00651         goto exit;
00652     }
00653
00654     // GetCurrentPadding represents the number of queued frames
00655     // so we can subtract that from the overall number of frames we have
00656     FramesAvailable = m_BufferFrames - PaddingFrames;
00657
00658     // Only continue if we have buffer to write data
00659     if (FramesAvailable > 0)
00660     {
00661         if (IsSilence)
00662         {
00663             BYTE *Data;
00664
00665             // Fill the buffer with silence
00666             hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
00667             if (FAILED( hr ))
00668             {
00669                 goto exit;
00670             }
00671
00672             hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
00673             goto exit;
00674         }
00675
00676         // Even if we cancel a work item, this may still fire due to the async
00677         // nature of things.  There should be a queued work item already to handle
00678         // the process of stopping or stopped
00679         if (m_DeviceStateChanged->GetState() == DeviceState::DeviceStatePlaying)
00680         {
00681             // Fill the buffer with a playback sample
00682             if (m_DeviceProps.IsTonePlayback)
00683             {
00684                 hr = GetToneSample( FramesAvailable );
00685             }
00686             else
00687             {
00688                 hr = GetMFSample( FramesAvailable );
00689             }
00690         }
00691     }
00692
00693 exit:
00694     LeaveCriticalSection( &m_CritSec );
00695
00696     if (AUDCLNT_E_RESOURCES_INVALIDATED == hr)
00697     {
00698         m_DeviceStateChanged->SetState( DeviceState::DeviceStateUnInitialized, hr, false );
00699         SAFE_RELEASE( m_AudioClient );
00700         SAFE_RELEASE( m_AudioRenderClient );
00701         SAFE_RELEASE( m_SampleReadyAsyncResult );
00702
00703         hr = InitializeAudioDeviceAsync();
00704     }
00705
00706     return hr;
00707 }
00708
00709 //
00710 //  GetToneSample()
00711 //
00712 //  Fills buffer with a tone sample
00713 //
00714 HRESULT WASAPIRenderer::GetToneSample( UINT32 FramesAvailable )
00715 {
00716     HRESULT hr = S_OK;
00717     BYTE *Data;
00718
00719     // Post-Roll Silence
00720     if (m_ToneSource->IsEOF())
00721     {
00722         hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
00723         if (SUCCEEDED( hr ))
00724         {
00725             // Ignore the return
00726             hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
00727         }
00728
00729         StopPlaybackAsync();
00730     }
00731     else if (m_ToneSource->GetBufferLength() <= ( FramesAvailable * m_MixFormat->nBlockAlign ))
00732     {
00733         UINT32 ActualFramesToRead = m_ToneSource->GetBufferLength() / m_MixFormat->nBlockAlign;
00734         UINT32 ActualBytesToRead = ActualFramesToRead * m_MixFormat->nBlockAlign;
00735
00736         hr = m_AudioRenderClient->GetBuffer( ActualFramesToRead, &Data );
00737         if (SUCCEEDED( hr ))
00738         {
00739             hr = m_ToneSource->FillSampleBuffer( ActualBytesToRead, Data );
00740             if (SUCCEEDED( hr ))
00741             {
00742                 hr = m_AudioRenderClient->ReleaseBuffer( ActualFramesToRead, 0 );
00743             }
00744         }
00745     }
00746
00747     return hr;
00748 }
00749
00750 //
00751 //  GetMFSample()
00752 //
00753 //  Fills buffer with a MF sample
00754 //
00755 HRESULT WASAPIRenderer::GetMFSample( UINT32 FramesAvailable )
00756 {
00757     HRESULT hr = S_OK;
00758     BYTE *Data = nullptr;
00759
00760     // Post-Roll Silence
00761     if (m_MFSource->IsEOF())
00762     {
00763         hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
00764         if (SUCCEEDED( hr ))
00765         {
00766             // Ignore the return
00767             hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
00768         }
00769
00770         StopPlaybackAsync();
00771     }
00772     else
00773     {
00774         UINT32 ActualBytesRead = 0;
00775         UINT32 ActualBytesToRead = FramesAvailable * m_MixFormat->nBlockAlign;
00776
00777         hr = m_AudioRenderClient->GetBuffer( FramesAvailable, &Data );
00778         if (SUCCEEDED( hr ))
00779         {
00780             hr = m_MFSource->FillSampleBuffer( ActualBytesToRead, Data, &ActualBytesRead );
00781             if (hr == S_FALSE)
00782             {
00783                 // Hit EOS
00784                 hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
00785                 StopPlaybackAsync();
00786             }
00787             else if (SUCCEEDED( hr ))
00788             {
00789                 // This can happen if we are pre-rolling so just insert silence
00790                 if (0 == ActualBytesRead)
00791                 {
00792                     hr = m_AudioRenderClient->ReleaseBuffer( FramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT );
00793                 }
00794                 else
00795                 {
00796                     hr = m_AudioRenderClient->ReleaseBuffer( ( ActualBytesRead / m_MixFormat->nBlockAlign ), 0 );
00797                 }
00798             }
00799         }
00800     }
00801
00802     return hr;
00803 }
00804
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ExampleOperations Member List

This is the complete list of members for Scenario1_ExampleOperations, including all inherited members.
_FPSTimer | Scenario1_ExampleOperations | [private]
_frameCount | Scenario1_ExampleOperations | [private]
_helper | Scenario1_ExampleOperations | [private]
_mediaCapture | Scenario1_ExampleOperations | [private]
_outputRenderer | Scenario1_ExampleOperations | [private]
_previewRenderer | Scenario1_ExampleOperations | [private]
_reader | Scenario1_ExampleOperations | [private]
CleanupMediaCaptureAsync() | Scenario1_ExampleOperations | [inline, private]
ColorFrameReader_FrameArrivedAsync(MediaFrameReader sender, MediaFrameArrivedEventArgs args) | Scenario1_ExampleOperations | [inline, private]
currentOperation | Scenario1_ExampleOperations | [private]
IMAGE_COLS | Scenario1_ExampleOperations | [private]
IMAGE_ROWS | Scenario1_ExampleOperations | [private]
InitializeMediaCaptureAsync(MediaFrameSourceGroup sourceGroup) | Scenario1_ExampleOperations | [inline, private]
OnNavigatedFrom(NavigationEventArgs args) | Scenario1_ExampleOperations | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_ExampleOperations | [inline, protected]
OperationComboBox_SelectionChanged(object sender, RoutedEventArgs e) | Scenario1_ExampleOperations | [inline, private]
OperationType enum name | Scenario1_ExampleOperations | [private]
rootPage | Scenario1_ExampleOperations | [private]
Scenario1_ExampleOperations() | Scenario1_ExampleOperations | [inline]
UpdateFPS(object sender, object e) | Scenario1_ExampleOperations | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario4_SymbologyAttributes.h Source File

  • BarcodeScanner
  • cppwinrt

Scenario4_SymbologyAttributes.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_SymbologyAttributes.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario4_SymbologyAttributes : Scenario4_SymbologyAttributesT<Scenario4_SymbologyAttributes>
00019     {
00020         Scenario4_SymbologyAttributes();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024
00025         fire_and_forget ScenarioStartScanButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026         void ScenarioEndScanButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027         fire_and_forget SymbologySelection_Changed(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const&);
00028         fire_and_forget SetSymbologyAttributes_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00029
00030     private:
00031         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00032         Windows::Devices::PointOfService::BarcodeScanner m_scanner{ nullptr };
00033         Windows::Devices::PointOfService::ClaimedBarcodeScanner m_claimedScanner{ nullptr };
00034
00035         Windows::Foundation::Collections::IObservableVector<SymbologyListEntry> m_listOfSymbologies{ nullptr };
00036         Windows::Devices::PointOfService::BarcodeSymbologyAttributes m_symbologyAttributes{ nullptr };
00037         Windows::Devices::PointOfService::ClaimedBarcodeScanner::ReleaseDeviceRequested_revoker m_scannerReleaseRequestedToken;
00038         Windows::Devices::PointOfService::ClaimedBarcodeScanner::DataReceived_revoker m_scannerDataReceivedToken;
00039
00040         void claimedScanner_ReleaseDeviceRequested(Windows::Foundation::IInspectable const&, Windows::Devices::PointOfService::ClaimedBarcodeScanner const& args);
00041         fire_and_forget claimedScanner_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const&, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args);
00042
00043         void ResetTheScenarioState();
00044
00045     };
00046 }
00047
00048 namespace winrt::SDKTemplate::factory_implementation
00049 {
00050     struct Scenario4_SymbologyAttributes : Scenario4_SymbologyAttributesT<Scenario4_SymbologyAttributes, implementation::Scenario4_SymbologyAttributes>
00051     {
00052     };
00053 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario7_DeviceInformationKind.xaml.h Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario7_DeviceInformationKind.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario7_DeviceInformationKind.g.h"
00006 #include "MainPage.xaml.h"
00007 #include "DisplayHelpers.h"
00008 #include "DeviceWatcherHelper.h"
00009
00010 namespace SDKTemplate
00011 {
00012     [Windows::Foundation::Metadata::WebHostHidden]
00013     public ref class Scenario7_DeviceInformationKind sealed
00014     {
00015     public:
00016         Scenario7_DeviceInformationKind();
00017
00018     protected:
00019         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00020         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00021
00022     private:
00023         void StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024         void StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00025
00026         void StartWatchers();
00027         void StopWatchers(bool reset = false);
00028
00029         void OnDeviceListChanged(Windows::Devices::Enumeration::DeviceWatcher^ sender, Platform::String^ id);
00030
00031         MainPage^ rootPage = MainPage::Current;
00032         Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>();
00033         Platform::Collections::Vector<DeviceWatcherHelper^>^ deviceWatcherHelpers = ref new Platform::Collections::Vector<DeviceWatcherHelper^>();
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso15693AccessHandler.cs Source File

  • Nfc
  • PcscSdk

Iso15693AccessHandler.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Threading.Tasks;
00013 using Windows.Devices.SmartCards;
00014 using System.Runtime.InteropServices.WindowsRuntime;
00015 using Windows.Storage.Streams;
00016
00017 using Pcsc;
00018 using System;
00019
00020 namespace Iso15693
00021 {
00022     /// <summary>
00023     /// Access handler class for Iso15693 based ICC. It provides wrappers for different Iso15693
00024     /// commands
00025     /// </summary>
00026     public class AccessHandler
00027     {
00028         /// <summary>
00029         /// connection object to smart card
00030         /// </summary>
00031         private SmartCardConnection connectionObject { set; get; }
00032         /// <summary>
00033         /// Class constructor
00034         /// </summary>
00035         /// <param name="ScConnection">
00036         /// connection object to a Iso15693 ICC
00037         /// </param>
00038         public AccessHandler(SmartCardConnection ScConnection)
00039         {
00040             connectionObject = ScConnection;
00041         }
00042         /// <summary>
00043         /// Wrapper method to read data from the Iso15693 card
00044         /// </summary>
00045         /// <returns>
00046         /// byte array of the read data
00047         /// </returns>
00048         public async Task<byte[]> ReadAsync(byte blockNumber)
00049         {
00050             var apduRes = await connectionObject.TransceiveAsync(new Iso15693.Read(blockNumber));
00051
00052             if (!apduRes.Succeeded)
00053             {
00054                 throw new Exception("Failure reading Iso15693 card, " + apduRes.ToString());
00055             }
00056
00057             return apduRes.ResponseData;
00058         }
00059         /// <summary>
00060         /// Wrapper method to write data to the Iso15693 card
00061         /// </summary>
00062         public async Task WriteAsync(byte blockNumber, byte[] dataToWrite)
00063         {
00064             if (dataToWrite.Length != 4)
00065             {
00066                 throw new InvalidOperationException("Invalid size of data to write");
00067             }
00068
00069             var apduRes = await connectionObject.TransceiveAsync(new Iso15693.Write(blockNumber, dataToWrite));
00070
00071             if (!apduRes.Succeeded)
00072             {
00073                 throw new Exception("Failure writing Iso15693 card, " + apduRes.ToString());
00074             }
00075         }
00076         /// <summary>
00077         /// Wrapper method to perform transparent transceive data to the Iso15693 card
00078         /// </summary>
00079         /// <param name="commandData">
00080         /// The command to send to the Iso15693 card
00081         /// </param>
00082         /// <returns>
00083         /// byte array of the read data
00084         /// </returns>
00085         public async Task <byte[]> TransparentExchangeAsync(byte[] commandData)
00086         {
00087             byte[] responseData = await connectionObject.TransparentExchangeAsync(commandData);
00088
00089             return responseData;
00090         }
00091         /// <summary>
00092         /// Wrapper method get the Iso15693 UID
00093         /// </summary>
00094         /// <returns>
00095         /// byte array UID
00096         /// </returns>
00097         public async Task<byte[]> GetUidAsync()
00098         {
00099             var apduRes = await connectionObject.TransceiveAsync(new Iso15693.GetUid());
00100
00101             if (!apduRes.Succeeded)
00102             {
00103                 throw new Exception("Failure getting UID of Iso15693 card, " + apduRes.ToString());
00104             }
00105
00106             return apduRes.ResponseData;
00107         }
00108     }
00109 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/App.xaml.h Source File

  • BackButton
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// Provides application-specific behavior to supplement the default Application class.
00020     /// </summary>
00021     ref class App sealed
00022     {
00023     protected:
00024         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00025
00026     internal:
00027         App();
00028
00029     private:
00030         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00031         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00032         void App_BackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e);
00033     };
00034 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/Scenario2_Multiple.xaml.cpp Source File

  • ContactPicker
  • cpp

Scenario2_Multiple.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Multiple.xaml.h"
00014
00015 using namespace Concurrency;
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::ApplicationModel::Contacts;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024
00025 Scenario2_Multiple::Scenario2_Multiple()
00026 {
00027     InitializeComponent();
00028 }
00029
00030 void Scenario2_Multiple::ClearOutputs()
00031 {
00032     // Reset the output fields.
00033     OutputText->Text = "";
00034     rootPage->NotifyUser("", NotifyType::StatusMessage);
00035 }
00036
00037 void Scenario2_Multiple::ReportContactResults(IVector<Contact^>^ contacts)
00038 {
00039     if (contacts != nullptr && contacts->Size > 0)
00040     {
00041         for (Contact^ contact : contacts)
00042         {
00043             OutputText->Text += MainPage::GetContactResult(contact) + "\n";
00044         }
00045     }
00046     else
00047     {
00048         rootPage->NotifyUser("No contacts were selected.", NotifyType::ErrorMessage);
00049     }
00050 }
00051
00052 void Scenario2_Multiple::PickContactsEmail()
00053 {
00054     ClearOutputs();
00055
00056     // Ask the user to pick contact email addresses.
00057     auto contactPicker = ref new ContactPicker();
00058     contactPicker->DesiredFieldsWithContactFieldType->Append(ContactFieldType::Email);
00059
00060     create_task(contactPicker->PickContactsAsync()).then([this](IVector<Contact^>^ contacts)
00061     {
00062         ReportContactResults(contacts);
00063     });
00064 }
00065
00066 void Scenario2_Multiple::PickContactsPhone()
00067 {
00068     ClearOutputs();
00069
00070     // Ask the user to pick contact phone numbers.
00071     auto contactPicker = ref new ContactPicker();
00072     contactPicker->DesiredFieldsWithContactFieldType->Append(ContactFieldType::PhoneNumber);
00073
00074     create_task(contactPicker->PickContactsAsync()).then([this](IVector<Contact^>^ contacts)
00075     {
00076         ReportContactResults(contacts);
00077     });
00078 }
Generated on Fri Nov 15 2024 22:18:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
BreadCompletedHandler1(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
BreadCompletedHandler1(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
BreadCompletedHandler2(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
BreadCompletedHandler2(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
BreadCompletedHandler3(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
BreadCompletedHandler3(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::Bread^bread) | sealed | [private]
CustomException() | sealed |
CustomException() | sealed |
CustomExceptionWRL() | sealed |
CustomExceptionWRL() | sealed |
OvenClient() | sealed |
OvenClient() | sealed |
OvenClientWRL() | sealed |
OvenClientWRL() | sealed |
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/pch.h Source File

  • TextSegmentation
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Data.Text.h"
00008 #include "winrt/Windows.Globalization.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
00020 #include <sstream>
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario0_Choose.xaml.h Source File

  • Accelerometer
  • cpp

Scenario0_Choose.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario0_Choose.xaml.h
00014 // Declaration of the Scenario0_Choose class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario0_Choose.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario0_Choose sealed
00030     {
00031     public:
00032         Scenario0_Choose();
00033
00034     protected:
00035         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037     private:
00038         SDKTemplate::MainPage^ rootPage = MainPage::Current;
00039
00040         void AddReadingType(Windows::Devices::Sensors::AccelerometerReadingType readingType);
00041     };
00042 }
Generated on Fri Nov 15 2024 22:17:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SurfaceMesh.cpp Source File

  • HolographicSpatialMapping
  • cpp
  • Content

SurfaceMesh.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #include <ppltasks.h>
00015
00016 #include "Common\DirectXHelper.h"
00017 #include "Common\StepTimer.h"
00018 #include "GetDataFromIBuffer.h"
00019 #include "SurfaceMesh.h"
00020
00021 using namespace WindowsHolographicCodeSamples;
00022 using namespace DirectX;
00023 using namespace Windows::Perception::Spatial;
00024 using namespace Windows::Perception::Spatial::Surfaces;
00025 using namespace Windows::Foundation::Numerics;
00026
00027 SurfaceMesh::SurfaceMesh()
00028 {
00029     std::lock_guard<std::mutex> lock(m_meshResourcesMutex);
00030
00031     ReleaseDeviceDependentResources();
00032     m_lastUpdateTime.UniversalTime = 0;
00033 }
00034
00035 SurfaceMesh::~SurfaceMesh()
00036 {
00037     std::lock_guard<std::mutex> lock(m_meshResourcesMutex);
00038
00039     ReleaseDeviceDependentResources();
00040 }
00041
00042 void SurfaceMesh::UpdateSurface(
00043     SpatialSurfaceMesh^ surfaceMesh)
00044 {
00045     m_pendingSurfaceMesh = surfaceMesh;
00046 }
00047
00048 // Spatial Mapping surface meshes each have a transform. This transform is updated every frame.
00049 void SurfaceMesh::UpdateTransform(
00050     ID3D11Device* device,
00051     ID3D11DeviceContext* context,
00052     DX::StepTimer const& timer,
00053     SpatialCoordinateSystem^ baseCoordinateSystem)
00054 {
00055     UpdateVertexResources(device);
00056
00057     {
00058         std::lock_guard<std::mutex> lock(m_meshResourcesMutex);
00059
00060         if (m_updateReady)
00061         {
00062             // Surface mesh resources are created off-thread so that they don't affect rendering latency.
00063             // When a new update is ready, we should begin using the updated vertex position, normal, and
00064             // index buffers.
00065             SwapVertexBuffers();
00066             m_updateReady = false;
00067         }
00068     }
00069
00070     XMMATRIX transform;
00071     if (m_isActive)
00072     {
00073         // In this example, new surfaces are treated differently by highlighting them in a different
00074         // color. This allows you to observe changes in the spatial map that are due to new meshes,
00075         // as opposed to mesh updates.
00076         if (m_colorFadeTimeout > 0.f)
00077         {
00078             m_colorFadeTimer += static_cast<float>(timer.GetElapsedSeconds());
00079             if (m_colorFadeTimer < m_colorFadeTimeout)
00080             {
00081                 float colorFadeFactor = min(1.f, m_colorFadeTimeout - m_colorFadeTimer);
00082                 m_constantBufferData.colorFadeFactor = XMFLOAT4(colorFadeFactor, colorFadeFactor, colorFadeFactor, 1.f);
00083             }
00084             else
00085             {
00086                 m_constantBufferData.colorFadeFactor = XMFLOAT4(0.f, 0.f, 0.f, 0.f);
00087                 m_colorFadeTimer = m_colorFadeTimeout = -1.f;
00088             }
00089         }
00090
00091         // The transform is updated relative to a SpatialCoordinateSystem. In the SurfaceMesh class, we
00092         // expect to be given the same SpatialCoordinateSystem that will be used to generate view
00093         // matrices, because this class uses the surface mesh for rendering.
00094         // Other applications could potentially involve using a SpatialCoordinateSystem from a stationary
00095         // reference frame that is being used for physics simulation, etc.
00096         auto tryTransform = m_meshProperties.coordinateSystem ? m_meshProperties.coordinateSystem->TryGetTransformTo(baseCoordinateSystem) : nullptr;
00097         if (tryTransform != nullptr)
00098         {
00099             // If the transform can be acquired, this spatial mesh is valid right now and
00100             // we have the information we need to draw it this frame.
00101             transform = XMLoadFloat4x4(&tryTransform->Value);
00102             m_lastActiveTime = static_cast<float>(timer.GetTotalSeconds());
00103         }
00104         else
00105         {
00106             // If the transform cannot be acquired, the spatial mesh is not valid right now
00107             // because its location cannot be correlated to the current space.
00108             m_isActive = false;
00109         }
00110     }
00111
00112     if (!m_isActive)
00113     {
00114         // If for any reason the surface mesh is not active this frame - whether because
00115         // it was not included in the observer's collection, or because its transform was
00116         // not located - we don't have the information we need to update it.
00117         return;
00118     }
00119
00120     // Set up a transform from surface mesh space, to world space.
00121     XMMATRIX scaleTransform = XMMatrixScalingFromVector(XMLoadFloat3(&m_meshProperties.vertexPositionScale));
00122     XMStoreFloat4x4(
00123         &m_constantBufferData.modelToWorld,
00124         XMMatrixTranspose(scaleTransform * transform)
00125         );
00126
00127     // Surface meshes come with normals, which are also transformed from surface mesh space, to world space.
00128     XMMATRIX normalTransform = transform;
00129     // Normals are not translated, so we remove the translation component here.
00130     normalTransform.r[3] = XMVectorSet(0.f, 0.f, 0.f, XMVectorGetW(normalTransform.r[3]));
00131     XMStoreFloat4x4(
00132         &m_constantBufferData.normalToWorld,
00133         XMMatrixTranspose(normalTransform)
00134         );
00135
00136     if (!m_constantBufferCreated)
00137     {
00138         // If loading is not yet complete, we cannot actually update the graphics resources.
00139         // This return is intentionally placed after the surface mesh updates so that this
00140         // code may be copied and re-used for CPU-based processing of surface data.
00141         CreateDeviceDependentResources(device);
00142         return;
00143     }
00144
00145     context->UpdateSubresource(
00146         m_modelTransformBuffer.Get(),
00147         0,
00148         NULL,
00149         &m_constantBufferData,
00150         0,
00151         0
00152     );
00153 }
00154
00155 // Does an indexed, instanced draw call after setting the IA stage to use the mesh's geometry, and
00156 // after setting up the constant buffer for the surface mesh.
00157 // The caller is responsible for the rest of the shader pipeline.
00158 void SurfaceMesh::Draw(
00159     ID3D11Device* device,
00160     ID3D11DeviceContext* context,
00161     bool usingVprtShaders,
00162     bool isStereo)
00163 {
00164     if (!m_constantBufferCreated || !m_loadingComplete)
00165     {
00166         // Resources are still being initialized.
00167         return;
00168     }
00169
00170     if (!m_isActive)
00171     {
00172         // Mesh is not active this frame, and should not be drawn.
00173         return;
00174     }
00175
00176     // The vertices are provided in {vertex, normal} format
00177
00178     UINT strides [] = { m_meshProperties.vertexStride, m_meshProperties.normalStride };
00179     UINT offsets [] = { 0, 0 };
00180     ID3D11Buffer* buffers [] = { m_vertexPositions.Get(), m_vertexNormals.Get() };
00181
00182     context->IASetVertexBuffers(
00183         0,
00184         ARRAYSIZE(buffers),
00185         buffers,
00186         strides,
00187         offsets
00188         );
00189
00190     context->IASetIndexBuffer(
00191         m_triangleIndices.Get(),
00192         m_meshProperties.indexFormat,
00193         0
00194         );
00195
00196     context->VSSetConstantBuffers(
00197         0,
00198         1,
00199         m_modelTransformBuffer.GetAddressOf()
00200         );
00201
00202     if (!usingVprtShaders)
00203     {
00204         context->GSSetConstantBuffers(
00205             0,
00206             1,
00207             m_modelTransformBuffer.GetAddressOf()
00208             );
00209     }
00210
00211     context->PSSetConstantBuffers(
00212         0,
00213         1,
00214         m_modelTransformBuffer.GetAddressOf()
00215         );
00216
00217     context->DrawIndexedInstanced(
00218         m_meshProperties.indexCount,       // Index count per instance.
00219         isStereo ? 2 : 1,   // Instance count.
00220         0,                  // Start index location.
00221         0,                  // Base vertex location.
00222         0                   // Start instance location.
00223         );
00224 }
00225
00226 void SurfaceMesh::CreateDirectXBuffer(
00227     ID3D11Device* device,
00228     D3D11_BIND_FLAG binding,
00229     IBuffer^ buffer,
00230     ID3D11Buffer** target)
00231 {
00232     auto length = buffer->Length;
00233
00234     CD3D11_BUFFER_DESC bufferDescription(buffer->Length, binding);
00235     D3D11_SUBRESOURCE_DATA bufferBytes = { GetDataFromIBuffer(buffer), 0, 0 };
00236     device->CreateBuffer(&bufferDescription, &bufferBytes, target);
00237 }
00238
00239 void SurfaceMesh::UpdateVertexResources(
00240     ID3D11Device* device)
00241 {
00242     SpatialSurfaceMesh^ surfaceMesh = std::move(m_pendingSurfaceMesh);
00243     if (!surfaceMesh || surfaceMesh->TriangleIndices->ElementCount < 3)
00244     {
00245         // Not enough indices to draw a triangle.
00246         return;
00247     }
00248
00249     // Surface mesh resources are created off-thread, so that they don't affect rendering latency.
00250     m_updateVertexResourcesTask.then([this, device, surfaceMesh]()
00251     {
00252         // Create new Direct3D device resources for the updated buffers. These will be set aside
00253         // for now, and then swapped into the active slot next time the render loop is ready to draw.
00254
00255         // First, we acquire the raw data buffers.
00256         Windows::Storage::Streams::IBuffer^ positions = surfaceMesh->VertexPositions->Data;
00257         Windows::Storage::Streams::IBuffer^ normals   = surfaceMesh->VertexNormals->Data;
00258         Windows::Storage::Streams::IBuffer^ indices   = surfaceMesh->TriangleIndices->Data;
00259
00260         // Then, we create Direct3D device buffers with the mesh data provided by HoloLens.
00261         Microsoft::WRL::ComPtr<ID3D11Buffer> updatedVertexPositions;
00262         Microsoft::WRL::ComPtr<ID3D11Buffer> updatedVertexNormals;
00263         Microsoft::WRL::ComPtr<ID3D11Buffer> updatedTriangleIndices;
00264         CreateDirectXBuffer(device, D3D11_BIND_VERTEX_BUFFER, positions, updatedVertexPositions.GetAddressOf());
00265         CreateDirectXBuffer(device, D3D11_BIND_VERTEX_BUFFER, normals,   updatedVertexNormals.GetAddressOf());
00266         CreateDirectXBuffer(device, D3D11_BIND_INDEX_BUFFER,  indices,   updatedTriangleIndices.GetAddressOf());
00267
00268         // Before updating the meshes, check to ensure that there wasn't a more recent update.
00269         {
00270             std::lock_guard<std::mutex> lock(m_meshResourcesMutex);
00271
00272             auto meshUpdateTime = surfaceMesh->SurfaceInfo->UpdateTime;
00273             if (meshUpdateTime.UniversalTime > m_lastUpdateTime.UniversalTime)
00274             {
00275                 // Prepare to swap in the new meshes.
00276                 // Here, we use ComPtr.Swap() to avoid unnecessary overhead from ref counting.
00277                 m_updatedVertexPositions.Swap(updatedVertexPositions);
00278                 m_updatedVertexNormals.Swap(updatedVertexNormals);
00279                 m_updatedTriangleIndices.Swap(updatedTriangleIndices);
00280
00281                 // Cache properties for the buffers we will now use.
00282                 m_updatedMeshProperties.coordinateSystem    = surfaceMesh->CoordinateSystem;
00283                 m_updatedMeshProperties.vertexPositionScale = surfaceMesh->VertexPositionScale;
00284                 m_updatedMeshProperties.vertexStride        = surfaceMesh->VertexPositions->Stride;
00285                 m_updatedMeshProperties.normalStride        = surfaceMesh->VertexNormals->Stride;
00286                 m_updatedMeshProperties.indexCount          = surfaceMesh->TriangleIndices->ElementCount;
00287                 m_updatedMeshProperties.indexFormat         = static_cast<DXGI_FORMAT>(surfaceMesh->TriangleIndices->Format);
00288
00289                 // Send a signal to the render loop indicating that new resources are available to use.
00290                 m_updateReady    = true;
00291                 m_lastUpdateTime = meshUpdateTime;
00292                 m_loadingComplete = true;
00293             }
00294         }
00295     });
00296 }
00297
00298 void SurfaceMesh::CreateDeviceDependentResources(
00299     ID3D11Device* device)
00300 {
00301     UpdateVertexResources(device);
00302
00303     // Create a constant buffer to control mesh position.
00304     CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelNormalConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00305     DX::ThrowIfFailed(
00306         device->CreateBuffer(
00307             &constantBufferDesc,
00308             nullptr,
00309             &m_modelTransformBuffer
00310             )
00311         );
00312
00313     m_constantBufferCreated = true;
00314 }
00315
00316 void SurfaceMesh::ReleaseVertexResources()
00317 {
00318     if (m_surfaceMesh)
00319     {
00320         m_pendingSurfaceMesh = m_surfaceMesh;
00321         m_surfaceMesh = nullptr;
00322     }
00323
00324     m_meshProperties = {};
00325     m_vertexPositions.Reset();
00326     m_vertexNormals.Reset();
00327     m_triangleIndices.Reset();
00328 }
00329
00330 void SurfaceMesh::SwapVertexBuffers()
00331 {
00332     // Swap out the previous vertex position, normal, and index buffers, and replace
00333     // them with up-to-date buffers.
00334     m_vertexPositions = m_updatedVertexPositions;
00335     m_vertexNormals   = m_updatedVertexNormals;
00336     m_triangleIndices = m_updatedTriangleIndices;
00337
00338     // Swap out the metadata: index count, index format, .
00339     m_meshProperties  = m_updatedMeshProperties;
00340
00341     m_updatedMeshProperties = {};
00342     m_updatedVertexPositions.Reset();
00343     m_updatedVertexNormals.Reset();
00344     m_updatedTriangleIndices.Reset();
00345 }
00346
00347 void SurfaceMesh::ReleaseDeviceDependentResources()
00348 {
00349     // Wait for pending vertex creation work to complete.
00350     m_updateVertexResourcesTask.wait();
00351
00352     // Clear out any pending resources.
00353     SwapVertexBuffers();
00354
00355     // Clear out active resources.
00356     ReleaseVertexResources();
00357
00358     m_modelTransformBuffer.Reset();
00359
00360     m_constantBufferCreated = false;
00361     m_loadingComplete = false;
00362 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Flickr Member List

This is the complete list of members for Scenario3_Flickr, including all inherited members.
Launch_Click(object sender, RoutedEventArgs e) | Scenario3_Flickr | [inline, private]
OutputToken(String TokenUri) | Scenario3_Flickr | [inline, private]
rootPage | Scenario3_Flickr | [private]
Scenario3_Flickr() | Scenario3_Flickr | [inline]
SendDataAsync(String Url) | Scenario3_Flickr | [inline, private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario3.h Source File

  • FileThumbnails
  • cppwinrt

Scenario3.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3 : Scenario3T<Scenario3>
00020     {
00021         Scenario3();
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         fire_and_forget GetThumbnailButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario3 : Scenario3T<Scenario3, implementation::Scenario3>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/App.cpp Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

App.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "App.h"
00014
00015 #include <ppltasks.h>
00016
00017 using namespace CustomComputeShader;
00018
00019 using namespace Windows::ApplicationModel;
00020 using namespace Windows::ApplicationModel::Core;
00021 using namespace Windows::ApplicationModel::Activation;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Graphics::Display;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Input;
00026 using namespace Windows::Storage;
00027 using namespace Windows::System;
00028
00029 using namespace concurrency;
00030
00031 // The main function is only used to initialize our IFrameworkView class.
00032 [Platform::MTAThread]
00033 int main(Platform::Array<Platform::String^>^)
00034 {
00035     auto direct3DApplicationSource = ref new Direct3DApplicationSource();
00036     CoreApplication::Run(direct3DApplicationSource);
00037     return 0;
00038 }
00039
00040 IFrameworkView^ Direct3DApplicationSource::CreateView()
00041 {
00042     return ref new App();
00043 }
00044
00045 App::App() :
00046     m_windowClosed(false),
00047     m_windowVisible(true)
00048 {
00049 }
00050
00051 // The first method called when the IFrameworkView is being created.
00052 void App::Initialize(_In_ CoreApplicationView^ applicationView)
00053 {
00054     // Register event handlers for app lifecycle. This example includes Activated, so that we
00055     // can make the CoreWindow active and start rendering on the window.
00056     applicationView->Activated +=
00057         ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
00058
00059     CoreApplication::Suspending +=
00060         ref new EventHandler<SuspendingEventArgs^>(this, &App::OnSuspending);
00061
00062     CoreApplication::Resuming +=
00063         ref new EventHandler<Platform::Object^>(this, &App::OnResuming);
00064
00065     // At this point we have access to the device.
00066     // We can create the device-dependent resources.
00067     m_deviceResources = std::make_shared<DX::DeviceResources>();
00068
00069     auto device = m_deviceResources->GetD3DDevice();
00070
00071     // Check whether the graphics hardware supports compute shaders. If not, switch to a WARP device
00072     // which is guaranteed to support at least D3D_FEATURE_LEVEL_11_0.
00073     if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_11_0)
00074     {
00075         D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS hwopts = { 0 };
00076         DX::ThrowIfFailed(device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts)));
00077         if (!hwopts.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x)
00078         {
00079             m_deviceResources.reset(new DX::DeviceResources(true));
00080         }
00081     }
00082 }
00083
00084 // Called when the CoreWindow object is created (or re-created).
00085 void App::SetWindow(_In_ CoreWindow^ window)
00086 {
00087     window->SizeChanged +=
00088         ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
00089
00090     window->VisibilityChanged +=
00091         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
00092
00093     window->Closed +=
00094         ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
00095
00096     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00097
00098     currentDisplayInformation->DpiChanged +=
00099         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
00100
00101     currentDisplayInformation->OrientationChanged +=
00102         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
00103
00104     DisplayInformation::DisplayContentsInvalidated +=
00105         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDisplayContentsInvalidated);
00106
00107     // Disable all pointer visual feedback for better performance when touching.
00108     auto pointerVisualizationSettings = PointerVisualizationSettings::GetForCurrentView();
00109     pointerVisualizationSettings->IsContactFeedbackEnabled = false;
00110     pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
00111
00112     m_deviceResources->SetWindow(window);
00113 }
00114
00115 // Initializes scene resources, or loads a previously saved app state.
00116 void App::Load(_In_ Platform::String^ entryPoint)
00117 {
00118     if (m_main == nullptr)
00119     {
00120         m_main = std::unique_ptr<CustomComputeShaderMain>(new CustomComputeShaderMain(m_deviceResources));
00121     }
00122 }
00123
00124 // This method is called after the window becomes active.
00125 void App::Run()
00126 {
00127     while (!m_windowClosed)
00128     {
00129         // Unlike the pixel and vertex shader effects, the compute shader effect does not animate over time.
00130         // Therefore, the calling app runs exclusively in a "wait for events" mode (ProcessOneAndAllPending).
00131         CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00132
00133         m_main->Update();
00134
00135         if (m_main->Render())
00136         {
00137             m_deviceResources->Present();
00138         }
00139     }
00140 }
00141
00142 // Required for IFrameworkView.
00143 // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00144 // class is torn down while the app is in the foreground.
00145 void App::Uninitialize()
00146 {
00147 }
00148
00149 // Application lifecycle event handlers.
00150
00151 void App::OnActivated(_In_ CoreApplicationView^ applicationView, _In_ IActivatedEventArgs^ args)
00152 {
00153     // Run() won't start until the CoreWindow is activated.
00154     CoreWindow::GetForCurrentThread()->Activate();
00155 }
00156
00157 void App::OnSuspending(_In_ Platform::Object^ sender, _In_ SuspendingEventArgs^ args)
00158 {
00159     // Save app state asynchronously after requesting a deferral. Holding a deferral
00160     // indicates that the application is busy performing suspending operations. Be
00161     // aware that a deferral may not be held indefinitely. After about five seconds,
00162     // the app will be forced to exit.
00163     SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
00164
00165     create_task([this, deferral]()
00166     {
00167         m_deviceResources->Trim();
00168
00169         m_main->SaveInternalState(ApplicationData::Current->LocalSettings->Values);
00170
00171         deferral->Complete();
00172     });
00173 }
00174
00175 void App::OnResuming(_In_ Platform::Object^ sender, _In_ Platform::Object^ args)
00176 {
00177     // Restore any data or state that was unloaded on suspend. By default, data
00178     // and state are persisted when resuming from suspend. Note that this event
00179     // does not occur if the app was previously terminated.
00180
00181     m_main->LoadInternalState(ApplicationData::Current->LocalSettings->Values);
00182 }
00183
00184 // Window event handlers.
00185
00186 void App::OnWindowSizeChanged(_In_ CoreWindow^ sender, _In_ WindowSizeChangedEventArgs^ args)
00187 {
00188     m_deviceResources->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height));
00189     m_main->CreateWindowSizeDependentResources();
00190 }
00191
00192 void App::OnVisibilityChanged(_In_ CoreWindow^ sender, _In_ VisibilityChangedEventArgs^ args)
00193 {
00194     m_windowVisible = args->Visible;
00195 }
00196
00197 void App::OnWindowClosed(_In_ CoreWindow^ sender, _In_ CoreWindowEventArgs^ args)
00198 {
00199     m_windowClosed = true;
00200 }
00201
00202 // DisplayInformation event handlers.
00203
00204 void App::OnDpiChanged(_In_ DisplayInformation^ sender, _In_ Object^ args)
00205 {
00206     m_deviceResources->SetDpi(sender->LogicalDpi);
00207     m_main->CreateWindowSizeDependentResources();
00208 }
00209
00210 void App::OnOrientationChanged(_In_ DisplayInformation^ sender, _In_ Object^ args)
00211 {
00212     m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
00213     m_main->CreateWindowSizeDependentResources();
00214 }
00215
00216 void App::OnDisplayContentsInvalidated(_In_ DisplayInformation^ sender, _In_ Object^ args)
00217 {
00218     m_deviceResources->ValidateDevice();
00219 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_UsingUnicodeExtensions Member List

This is the complete list of members for Scenario7_UsingUnicodeExtensions, including all inherited members.
Display_Click(object sender, RoutedEventArgs e) | Scenario7_UsingUnicodeExtensions | [inline, private]
Scenario7_UsingUnicodeExtensions() | Scenario7_UsingUnicodeExtensions | [inline]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayoutImageSource.h Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

TextLayoutImageSource.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "TextLayout.h"
00015
00016 namespace DWriteTextLayoutCloudFontImplementation
00017 {
00018     [Windows::Foundation::Metadata::WebHostHiddenAttribute]
00019     public ref class TextLayoutImageSource sealed : Windows::UI::Xaml::Media::Imaging::SurfaceImageSource
00020     {
00021     public:
00022         TextLayoutImageSource(TextLayout^ textLayout, float dpi);
00023         TextLayoutImageSource(TextLayout^ textLayout, float dpi, Windows::UI::Color textColor, Windows::UI::Color backgroundColor);
00024         virtual ~TextLayoutImageSource();
00025
00026     private:
00027         void CreateDeviceResources();
00028         void SetTextBackgroundColor(Windows::UI::Color color);
00029         void SetTextColor(Windows::UI::Color color);
00030         void Draw();
00031         void BeginDraw();
00032         void EndDraw();
00033         void Clear();
00034         void DrawText();
00035
00036         // event handlers
00037         void OnSuspending(Platform::Object ^sender, Windows::ApplicationModel::SuspendingEventArgs ^e);
00038         Windows::Foundation::EventRegistrationToken         m_suspendEventHandlerRegistrationToken;
00039
00040         // Direct3D device
00041         Microsoft::WRL::ComPtr<ID3D11Device>                m_d3dDevice;
00042
00043         // Direct2D objects
00044         Microsoft::WRL::ComPtr<ID2D1Device>                 m_d2dDevice;
00045         Microsoft::WRL::ComPtr<ID2D1DeviceContext>          m_d2dContext;
00046
00047         // DWrite wrapper object
00048         TextLayout^                                         m_textLayout;
00049
00050         float                                               m_dpi;
00051         float                                               m_width; // width in DIPs -- for interaction with D2D
00052         float                                               m_height; // height in DIPs
00053         uint32                                              m_pixelWidth; // width in device pixels -- for interaction with SurfaceImageSource
00054         uint32                                              m_pixelHeight; // height in device pixels
00055         D2D1_COLOR_F                                        m_backgroundColor;
00056         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textBrush;
00057         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_textBackgroundBrush;
00058     };
00059 }
Generated on Fri Nov 15 2024 22:19:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TrackedPose Member List

This is the complete list of members for TrackedPose, including all inherited members.
Orientation | TrackedPose
OrientationStatus | TrackedPose
Position | TrackedPose
PositionStatus | TrackedPose
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario4_ChangeSystemGroup.xaml.cs Source File

  • JumpList
  • cs

Scenario4_ChangeSystemGroup.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using Windows.UI.StartScreen;
00017 using Windows.Storage;
00018 using Windows.Storage.AccessCache;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario4_ChangeSystemGroup : Page
00023     {
00024         public Scenario4_ChangeSystemGroup()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         protected override async void OnNavigatedTo(NavigationEventArgs e)
00030         {
00031             var jumpList = await JumpList.LoadCurrentAsync();
00032             switch(jumpList.SystemGroupKind)
00033             {
00034                 case JumpListSystemGroupKind.Recent:
00035                     SystemGroup_Recent.IsChecked = true;
00036                     break;
00037                 case JumpListSystemGroupKind.Frequent:
00038                     SystemGroup_Frequent.IsChecked = true;
00039                     break;
00040                 case JumpListSystemGroupKind.None:
00041                     SystemGroup_None.IsChecked = true;
00042                     break;
00043             }
00044         }
00045
00046         private async void SystemGroup_Recent_Click(object sender, RoutedEventArgs e)
00047         {
00048             var jumpList = await JumpList.LoadCurrentAsync();
00049             jumpList.SystemGroupKind = JumpListSystemGroupKind.Recent;
00050             await jumpList.SaveAsync();
00051         }
00052
00053         private async void SystemGroup_Frequent_Click(object sender, RoutedEventArgs e)
00054         {
00055             var jumpList = await JumpList.LoadCurrentAsync();
00056             jumpList.SystemGroupKind = JumpListSystemGroupKind.Frequent;
00057             await jumpList.SaveAsync();
00058         }
00059
00060         private async void SystemGroup_None_Click(object sender, RoutedEventArgs e)
00061         {
00062             var jumpList = await JumpList.LoadCurrentAsync();
00063             jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
00064             await jumpList.SaveAsync();
00065         }
00066
00067         private async void PrepareSampleFiles_Click(object sender, RoutedEventArgs e)
00068         {
00069             // NOTE: This is for the sake of the sample only. Real apps should allow
00070             // the system list to be populated by user activity.
00071
00072             var localFolder = ApplicationData.Current.LocalFolder;
00073             for (int i = 0; i < 5; ++i)
00074             {
00075                 string fileName = $"Temp{i}.ms-jumplist-sample";
00076                 var file = await localFolder.CreateFileAsync(fileName, CreationCollisionOption.OpenIfExists);
00077                 StorageApplicationPermissions.MostRecentlyUsedList.Add(file, "", RecentStorageItemVisibility.AppAndSystem);
00078             }
00079         }
00080     }
00081 }
Generated on Fri Nov 15 2024 22:20:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/RadioModel.h Source File

  • RadioManager
  • cppwinrt

RadioModel.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014 #include "RadioModel.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct RadioModel : RadioModelT<RadioModel>
00019     {
00020         RadioModel(Windows::Devices::Radios::Radio const& radio, Windows::UI::Core::CoreDispatcher const& dispatcher);
00021
00022         hstring Name()
00023         {
00024             return radio.Name();
00025         }
00026
00027         bool IsEnabled()
00028         {
00029             return isEnabled;
00030         }
00031
00032         bool IsRadioOn()
00033         {
00034             return radio.State() == Windows::Devices::Radios::RadioState::On;
00035         }
00036
00037         void IsRadioOn(bool value)
00038         {
00039             SetRadioState(value);
00040         }
00041
00042         event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
00043         {
00044             return propertyChanged.add(handler);
00045         }
00046
00047         void PropertyChanged(winrt::event_token const& token)
00048         {
00049             propertyChanged.remove(token);
00050         }
00051
00052     private:
00053         Windows::Devices::Radios::Radio radio;
00054         Windows::UI::Core::CoreDispatcher dispatcher;
00055         event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged;
00056         bool isEnabled;
00057
00058         fire_and_forget Radio_StateChanged(Windows::Devices::Radios::Radio const&, Windows::Foundation::IInspectable const&);
00059         void NotifyPropertyChanged(hstring const& propertyName);
00060         void SetEnabled(bool value);
00061         fire_and_forget SetRadioState(bool value);
00062     };
00063 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventArgs.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceServiceEventArgs.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 // Methods
00026 public ref class SecureInterfaceConcatenateCalledEventArgs sealed
00027 {
00028 public:
00029     SecureInterfaceConcatenateCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2);
00030
00031     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00032     {
00033         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00034     }
00035
00036     property SecureInterfaceConcatenateResult^ Result
00037     {
00038         SecureInterfaceConcatenateResult^ get() { return m_result; }
00039         void set(_In_ SecureInterfaceConcatenateResult^ value) { m_result = value; }
00040     }
00041
00042     property Platform::String^ InStr1
00043     {
00044         Platform::String^ get() { return m_interfaceMemberInStr1; }
00045     }
00046
00047     property Platform::String^ InStr2
00048     {
00049         Platform::String^ get() { return m_interfaceMemberInStr2; }
00050     }
00051
00052     Windows::Foundation::Deferral^ GetDeferral();
00053
00054     static Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^>^ GetResultAsync(SecureInterfaceConcatenateCalledEventArgs^ args)
00055     {
00056         args->InvokeAllFinished();
00057         auto t = concurrency::create_task(args->m_tce);
00058         return concurrency::create_async([t]() -> concurrency::task<SecureInterfaceConcatenateResult^>
00059         {
00060             return t;
00061         });
00062     }
00063
00064 private:
00065     void Complete();
00066     void InvokeAllFinished();
00067     void InvokeCompleteHandler();
00068
00069     bool m_raised;
00070     int m_completionsRequired;
00071     concurrency::task_completion_event<SecureInterfaceConcatenateResult^> m_tce;
00072     std::mutex m_lock;
00073     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00074     SecureInterfaceConcatenateResult^ m_result;
00075     Platform::String^ m_interfaceMemberInStr1;
00076     Platform::String^ m_interfaceMemberInStr2;
00077 };
00078
00079 // Readable Properties
00080 public ref class SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs sealed
00081 {
00082 public:
00083     SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00084
00085     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00086     {
00087         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00088     }
00089
00090     property SecureInterfaceGetIsUpperCaseEnabledResult^ Result
00091     {
00092         SecureInterfaceGetIsUpperCaseEnabledResult^ get() { return m_result; }
00093         void set(_In_ SecureInterfaceGetIsUpperCaseEnabledResult^ value) { m_result = value; }
00094     }
00095
00096     Windows::Foundation::Deferral^ GetDeferral();
00097
00098     static Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ GetResultAsync(SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^ args)
00099     {
00100         args->InvokeAllFinished();
00101         auto t = concurrency::create_task(args->m_tce);
00102         return concurrency::create_async([t]() -> concurrency::task<SecureInterfaceGetIsUpperCaseEnabledResult^>
00103         {
00104             return t;
00105         });
00106     }
00107
00108 private:
00109     void Complete();
00110     void InvokeAllFinished();
00111     void InvokeCompleteHandler();
00112
00113     bool m_raised;
00114     int m_completionsRequired;
00115     concurrency::task_completion_event<SecureInterfaceGetIsUpperCaseEnabledResult^> m_tce;
00116     std::mutex m_lock;
00117     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00118     SecureInterfaceGetIsUpperCaseEnabledResult^ m_result;
00119 };
00120
00121 // Writable Properties
00122 public ref class SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs sealed
00123 {
00124 public:
00125     SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ bool value);
00126
00127     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00128     {
00129         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00130     }
00131
00132     property bool Value
00133     {
00134         bool get() { return m_value; }
00135     }
00136
00137     property SecureInterfaceSetIsUpperCaseEnabledResult^ Result
00138     {
00139         SecureInterfaceSetIsUpperCaseEnabledResult^ get() { return m_result; }
00140         void set(_In_ SecureInterfaceSetIsUpperCaseEnabledResult^ value) { m_result = value; }
00141     }
00142
00143     static Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ GetResultAsync(SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs^ args)
00144     {
00145         args->InvokeAllFinished();
00146         auto t = concurrency::create_task(args->m_tce);
00147         return concurrency::create_async([t]() -> concurrency::task<SecureInterfaceSetIsUpperCaseEnabledResult^>
00148         {
00149             return t;
00150         });
00151     }
00152
00153     Windows::Foundation::Deferral^ GetDeferral();
00154
00155 private:
00156     void Complete();
00157     void InvokeAllFinished();
00158     void InvokeCompleteHandler();
00159
00160     bool m_raised;
00161     int m_completionsRequired;
00162     concurrency::task_completion_event<SecureInterfaceSetIsUpperCaseEnabledResult^> m_tce;
00163     std::mutex m_lock;
00164     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00165     bool m_value;
00166     SecureInterfaceSetIsUpperCaseEnabledResult^ m_result;
00167 };
00168
00169 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario11.xaml.h Source File

  • MapControl
  • cpp

Scenario11.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario11.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario11 sealed
00021     {
00022     public:
00023         Scenario11();
00024     private:
00025         MainPage^ rootPage = MainPage::Current;
00026
00027         Windows::UI::Xaml::Controls::Maps::MapElementsLayer^ myLayer1;
00028         Windows::UI::Xaml::Controls::Maps::MapElementsLayer^ myLayer2;
00029         Platform::Collections::Vector<Windows::UI::Xaml::Controls::Maps::MapLayer^>^ MapLayers =
00030             ref new Platform::Collections::Vector<Windows::UI::Xaml::Controls::Maps::MapLayer^>();
00031
00032         enum MapIconState : int
00033         {
00034             None = 0,
00035             Disabled = 1,
00036             Hover = 2,
00037             Selected = 4,
00038         };
00039
00040         typedef Platform::String^ (*MapIconStateToStyleEntryState)(MapIconState state);
00041
00042         static Platform::String^ ToDefaultStyleEntryState(MapIconState state);
00043         static Platform::String^ ToCustomStyleEntryState(MapIconState state);
00044
00045         void MyMap_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046         void SetStyleSheetStateCombobox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047
00048         void AddLayer1();
00049         void AddLayer2();
00050
00051         static void UpdateMapElementOnPointerEntered(Windows::UI::Xaml::Controls::Maps::MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState);
00052         static void UpdateMapElementOnPointerExited(Windows::UI::Xaml::Controls::Maps::MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState);
00053         static void UpdateMapElementOnClick(Windows::UI::Xaml::Controls::Maps::MapElement^ mapElement, MapIconStateToStyleEntryState toStyleEntryState);
00054     };
00055 }
Generated on Fri Nov 15 2024 22:17:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs Source File

  • BackgroundActivation
  • cs

Scenario6_GroupedTask.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class GroupedBackgroundTask : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public GroupedBackgroundTask()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         BackgroundTaskRegistrationGroup group;
00040
00041         /// <summary>
00042         /// Invoked when this page is about to be displayed in a Frame.
00043         /// </summary>
00044         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00045         /// property is typically used to configure the page.</param>
00046         protected override void OnNavigatedTo(NavigationEventArgs e)
00047         {
00048             group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);
00049
00050             foreach (var task in group.AllTasks)
00051             {
00052                 if (task.Value.Name == BackgroundTaskSample.GroupedBackgroundTaskName)
00053                 {
00054                     AttachProgressAndCompletedHandlers(task.Value);
00055                     BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.GroupedBackgroundTaskName, true);
00056                     break;
00057                 }
00058             }
00059
00060             UpdateUI();
00061         }
00062
00063         /// <summary>
00064         /// Register a Grouped Background Task.
00065         /// </summary>
00066         /// <param name="sender"></param>
00067         /// <param name="e"></param>
00068         private void RegisterGroupedBackgroundTask(object sender, RoutedEventArgs e)
00069         {
00070             var task = BackgroundTaskSample.RegisterBackgroundTask(null,
00071                                                                    BackgroundTaskSample.GroupedBackgroundTaskName,
00072                                                                    new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
00073                                                                    null,
00074                                                                    group);
00075             AttachProgressAndCompletedHandlers(task);
00076             UpdateUI();
00077         }
00078
00079
00080         /// <summary>
00081         /// Unregister a Grouped Background Task.
00082         /// </summary>
00083         /// <param name="sender"></param>
00084         /// <param name="e"></param>
00085         private void UnregisterGroupedTask(object sender, RoutedEventArgs e)
00086         {
00087             BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.GroupedBackgroundTaskName, group);
00088             UpdateUI();
00089         }
00090
00091         /// <summary>
00092         /// Unregisters all Background Tasks that are not in groups.
00093         /// This will not impact tasks registered with groups.
00094         /// </summary>
00095         /// <param name="sender"></param>
00096         /// <param name="e"></param>
00097         private void UnregisterUngroupedTasks(object sender, RoutedEventArgs e)
00098         {
00099             foreach(var cur in BackgroundTaskRegistration.AllTasks)
00100             {
00101                 cur.Value.Unregister(true);
00102                 BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(cur.Value.Name, false);
00103             }
00104         }
00105
00106         /// <summary>
00107         /// Attach progress and completed handers to a background task.
00108         /// </summary>
00109         /// <param name="task">The task to attach progress and completed handlers to.</param>
00110         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00111         {
00112             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00113             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00114         }
00115
00116         /// <summary>
00117         /// Handle background task progress.
00118         /// </summary>
00119         /// <param name="task">The task that is reporting progress.</param>
00120         /// <param name="e">Arguments of the progress report.</param>
00121         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00122         {
00123             var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00124             {
00125                 var progress = "Progress: " + args.Progress + "%";
00126                 BackgroundTaskSample.GroupedBackgroundTaskProgress = progress;
00127                 UpdateUI();
00128             });
00129         }
00130
00131         /// <summary>
00132         /// Handle background task completion.
00133         /// </summary>
00134         /// <param name="task">The task that is reporting completion.</param>
00135         /// <param name="e">Arguments of the completion report.</param>
00136         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00137         {
00138             UpdateUI();
00139         }
00140
00141         /// <summary>
00142         /// Update the scenario UI.
00143         /// </summary>
00144         private async void UpdateUI()
00145         {
00146             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00147             () =>
00148             {
00149                 RegisterButton.IsEnabled = !BackgroundTaskSample.GroupedBackgroundTaskRegistered;
00150                 UnregisterGroupedButton.IsEnabled = BackgroundTaskSample.GroupedBackgroundTaskRegistered;
00151                 Progress.Text = BackgroundTaskSample.GroupedBackgroundTaskProgress;
00152                 Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.GroupedBackgroundTaskName);
00153             });
00154         }
00155     }
00156 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DeviceResources.h Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetWindow(Windows::UI::Core::CoreWindow^ window);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void ValidateDevice();
00033         void HandleDeviceLost();
00034         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00035         void Trim();
00036         void Present();
00037
00038         // The size of the render target, in pixels.
00039         Windows::Foundation::Size   GetOutputSize() const                   { return m_outputSize; }
00040
00041         // The size of the render target, in dips.
00042         Windows::Foundation::Size   GetLogicalSize() const                  { return m_logicalSize; }
00043         float                       GetDpi() const                          { return m_effectiveDpi; }
00044
00045         // D3D Accessors.
00046         ID3D11Device3*              GetD3DDevice() const                    { return m_d3dDevice.Get(); }
00047         ID3D11DeviceContext3*       GetD3DDeviceContext() const             { return m_d3dContext.Get(); }
00048         IDXGISwapChain3*            GetSwapChain() const                    { return m_swapChain.Get(); }
00049         D3D_FEATURE_LEVEL           GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel; }
00050         ID3D11RenderTargetView1*    GetBackBufferRenderTargetView() const   { return m_d3dRenderTargetView.Get(); }
00051         ID3D11DepthStencilView*     GetDepthStencilView() const             { return m_d3dDepthStencilView.Get(); }
00052         D3D11_VIEWPORT              GetScreenViewport() const               { return m_screenViewport; }
00053         DirectX::XMFLOAT4X4         GetOrientationTransform3D() const       { return m_orientationTransform3D; }
00054
00055         // D2D Accessors.
00056         ID2D1Factory3*              GetD2DFactory() const                   { return m_d2dFactory.Get(); }
00057         ID2D1Device2*               GetD2DDevice() const                    { return m_d2dDevice.Get(); }
00058         ID2D1DeviceContext2*        GetD2DDeviceContext() const             { return m_d2dContext.Get(); }
00059         ID2D1Bitmap1*               GetD2DTargetBitmap() const              { return m_d2dTargetBitmap.Get(); }
00060         IDWriteFactory3*            GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00061         IWICImagingFactory2*        GetWicImagingFactory() const            { return m_wicFactory.Get(); }
00062         D2D1::Matrix3x2F            GetOrientationTransform2D() const       { return m_orientationTransform2D; }
00063
00064     private:
00065         void CreateDeviceIndependentResources();
00066         void CreateDeviceResources();
00067         void CreateWindowSizeDependentResources();
00068         void UpdateRenderTargetSize();
00069         DXGI_MODE_ROTATION ComputeDisplayRotation();
00070
00071         // Direct3D objects.
00072         Microsoft::WRL::ComPtr<ID3D11Device3>           m_d3dDevice;
00073         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>    m_d3dContext;
00074         Microsoft::WRL::ComPtr<IDXGISwapChain3>         m_swapChain;
00075
00076         // Direct3D rendering objects. Required for 3D.
00077         Microsoft::WRL::ComPtr<ID3D11RenderTargetView1> m_d3dRenderTargetView;
00078         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00079         D3D11_VIEWPORT                                  m_screenViewport;
00080
00081         // Direct2D drawing components.
00082         Microsoft::WRL::ComPtr<ID2D1Factory3>       m_d2dFactory;
00083         Microsoft::WRL::ComPtr<ID2D1Device2>        m_d2dDevice;
00084         Microsoft::WRL::ComPtr<ID2D1DeviceContext2> m_d2dContext;
00085         Microsoft::WRL::ComPtr<ID2D1Bitmap1>        m_d2dTargetBitmap;
00086
00087         // DirectWrite drawing components.
00088         Microsoft::WRL::ComPtr<IDWriteFactory3>     m_dwriteFactory;
00089         Microsoft::WRL::ComPtr<IWICImagingFactory2> m_wicFactory;
00090
00091         // Cached reference to the Window.
00092         Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
00093
00094         // Cached device properties.
00095         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00096         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00097         Windows::Foundation::Size                       m_outputSize;
00098         Windows::Foundation::Size                       m_logicalSize;
00099         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00100         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00101         float                                           m_dpi;
00102
00103         // This is the DPI that will be reported back to the app. It takes into account whether the app supports high resolution screens or not.
00104         float m_effectiveDpi;
00105
00106         // Transforms used for display orientation.
00107         D2D1::Matrix3x2F    m_orientationTransform2D;
00108         DirectX::XMFLOAT4X4 m_orientationTransform3D;
00109
00110         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00111         IDeviceNotify* m_deviceNotify;
00112     };
00113 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/SampleConfiguration.h Source File

  • FullScreenMode
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Full screen mode";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

DeviceWatcherHelper.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016 #include "DeviceWatcherHelper.h"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Devices::Enumeration;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::UI::Core;
00022
00023 namespace winrt::SDKTemplate
00024 {
00025     void DeviceWatcherHelper::StartWatcher(DeviceWatcher const& deviceWatcherArg)
00026     {
00027         deviceWatcher = deviceWatcherArg;
00028
00029         // Connect events to update our collection as the watcher report results.
00030         deviceWatcher.Added({ get_weak(), &DeviceWatcherHelper::DeviceWatcherHelper::Watcher_DeviceAdded });
00031         deviceWatcher.Updated({ get_weak(), &DeviceWatcherHelper::Watcher_DeviceUpdated });
00032         deviceWatcher.Removed({ get_weak(), &DeviceWatcherHelper::Watcher_DeviceRemoved });
00033         deviceWatcher.EnumerationCompleted({ get_weak(), &DeviceWatcherHelper::Watcher_EnumerationCompleted });
00034         deviceWatcher.Stopped({ get_weak(), &DeviceWatcherHelper::Watcher_Stopped });
00035
00036         deviceWatcher.Start();
00037     }
00038
00039     void DeviceWatcherHelper::StopWatcher()
00040     {
00041         // Since the device watcher runs in the background, it is possible that
00042         // a notification is "in flight" at the time we stop the watcher.
00043         // In other words, it is possible for the watcher to become stopped while a
00044         // handler is running, or for a handler to run after the watcher has stopped.
00045
00046         if (IsWatcherStarted(deviceWatcher))
00047         {
00048             // We do not null out the deviceWatcher yet because we want to receive
00049             // the Stopped event.
00050             deviceWatcher.Stop();
00051         }
00052     }
00053
00054     void DeviceWatcherHelper::Reset()
00055     {
00056         if (deviceWatcher != nullptr)
00057         {
00058             StopWatcher();
00059             deviceWatcher = nullptr;
00060         }
00061     }
00062
00063     bool DeviceWatcherHelper::IsWatcherStarted(DeviceWatcher const& watcher)
00064     {
00065         DeviceWatcherStatus status = watcher.Status();
00066         return (status == DeviceWatcherStatus::Started) ||
00067             (status == DeviceWatcherStatus::EnumerationCompleted);
00068     }
00069
00070     bool DeviceWatcherHelper::IsWatcherRunning()
00071     {
00072         if (deviceWatcher == nullptr)
00073         {
00074             return false;
00075         }
00076
00077         DeviceWatcherStatus status = deviceWatcher.Status();
00078         return (status == DeviceWatcherStatus::Started) ||
00079             (status == DeviceWatcherStatus::EnumerationCompleted) ||
00080             (status == DeviceWatcherStatus::Stopping);
00081     }
00082
00083     fire_and_forget DeviceWatcherHelper::Watcher_DeviceAdded(DeviceWatcher sender, DeviceInformation deviceInfo)
00084     {
00085         auto lifetime = get_strong();
00086
00087         // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00088         co_await resume_foreground(dispatcher);
00089
00090         // Watcher may have stopped while we were waiting for our chance to run.
00091         if (IsWatcherStarted(sender))
00092         {
00093             resultCollection.Append(make<implementation::DeviceInformationDisplay>(deviceInfo));
00094             RaiseDeviceChanged(sender, deviceInfo.Id());
00095         }
00096     }
00097
00098     fire_and_forget DeviceWatcherHelper::Watcher_DeviceUpdated(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00099     {
00100         auto lifetime = get_strong();
00101
00102         // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00103         co_await resume_foreground(dispatcher);
00104
00105         // Watcher may have stopped while we were waiting for our chance to run.
00106         if (IsWatcherStarted(sender))
00107         {
00108             // Find the corresponding updated DeviceInformation in the collection and pass the update object
00109             // to the Update method of the existing DeviceInformation. This automatically updates the object
00110             // for us.
00111             auto foundDeviceInfo = std::find_if(begin(resultCollection), end(resultCollection),
00112                 [&](SDKTemplate::DeviceInformationDisplay const& di)
00113                 {
00114                     return di.Id() == deviceInfoUpdate.Id();
00115                 });
00116
00117             if (foundDeviceInfo != end(resultCollection))
00118             {
00119                 FromInspectable<implementation::DeviceInformationDisplay>(*foundDeviceInfo)->Update(deviceInfoUpdate);
00120                 RaiseDeviceChanged(sender, deviceInfoUpdate.Id());
00121             }
00122         }
00123     }
00124
00125     fire_and_forget DeviceWatcherHelper::Watcher_DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00126     {
00127         auto lifetime = get_strong();
00128
00129         // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00130         co_await resume_foreground(dispatcher);
00131
00132         // Watcher may have stopped while we were waiting for our chance to run.
00133         if (IsWatcherStarted(sender))
00134         {
00135             // Find the corresponding DeviceInformation in the collection and remove it
00136             auto foundDeviceInfo = std::find_if(begin(resultCollection), end(resultCollection),
00137                 [&](SDKTemplate::DeviceInformationDisplay const& di)
00138                 {
00139                     return di.Id() == deviceInfoUpdate.Id();
00140                 });
00141
00142             uint32_t index = 0;
00143             if (foundDeviceInfo != end(resultCollection) &&
00144                 resultCollection.IndexOf(*foundDeviceInfo, index))
00145             {
00146                 resultCollection.RemoveAt(index);
00147             }
00148
00149             RaiseDeviceChanged(sender, deviceInfoUpdate.Id());
00150         }
00151     }
00152     fire_and_forget DeviceWatcherHelper::Watcher_EnumerationCompleted(DeviceWatcher sender, IInspectable const&)
00153     {
00154         auto lifetime = get_strong();
00155
00156         co_await resume_foreground(dispatcher);
00157         RaiseDeviceChanged(sender, {});
00158     }
00159
00160     fire_and_forget DeviceWatcherHelper::Watcher_Stopped(DeviceWatcher sender, IInspectable const&)
00161     {
00162         auto lifetime = get_strong();
00163
00164         co_await resume_foreground(dispatcher);
00165         RaiseDeviceChanged(sender, {});
00166     }
00167
00168     void DeviceWatcherHelper::RaiseDeviceChanged(DeviceWatcher const& sender, hstring const& id)
00169     {
00170         if (updateStatus)
00171         {
00172             // Display a default status message.
00173             hstring message = to_hstring(resultCollection.Size()) + L" devices found.";
00174             switch (sender.Status())
00175             {
00176             case DeviceWatcherStatus::Started:
00177                 break;
00178
00179             case DeviceWatcherStatus::EnumerationCompleted:
00180                 message = message + L" Enumeration completed. Watching for updates...";
00181                 break;
00182
00183             case DeviceWatcherStatus::Stopped:
00184                 message = message + L" Watcher stopped.";
00185                 break;
00186
00187             case DeviceWatcherStatus::Aborted:
00188                 message = message + L" Watcher aborted.";
00189                 break;
00190             }
00191
00192             SDKTemplate::implementation::MainPage::Current().NotifyUser(message, NotifyType::StatusMessage);
00193         }
00194
00195         deviceChanged(sender, id);
00196     }
00197 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingMethodResults.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingMethodResults.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 using namespace concurrency;
00024
00025 namespace org { namespace alljoyn { namespace Onboarding {
00026
00027 ref class OnboardingConsumer;
00028
00029 public ref class OnboardingConfigureWiFiResult sealed
00030 {
00031 public:
00032     property int32 Status
00033     {
00034         int32 get() { return m_status; }
00035     internal:
00036         void set(_In_ int32 value) { m_status = value; }
00037     }
00038
00039     property int16 Status2
00040     {
00041         int16 get() { return m_interfaceMemberStatus2; }
00042     internal:
00043         void set(_In_ int16 value) { m_interfaceMemberStatus2 = value; }
00044     }
00045
00046     static OnboardingConfigureWiFiResult^ CreateSuccessResult(_In_ int16 interfaceMemberStatus2)
00047     {
00048         auto result = ref new OnboardingConfigureWiFiResult();
00049         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00050         result->Status2 = interfaceMemberStatus2;
00051         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00052         return result;
00053     }
00054
00055     static OnboardingConfigureWiFiResult^ CreateFailureResult(_In_ int32 status)
00056     {
00057         auto result = ref new OnboardingConfigureWiFiResult();
00058         result->Status = status;
00059         return result;
00060     }
00061 internal:
00062     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00063
00064 private:
00065     int32 m_status;
00066     int16 m_interfaceMemberStatus2;
00067 };
00068
00069 public ref class OnboardingConnectResult sealed
00070 {
00071 public:
00072     property int32 Status
00073     {
00074         int32 get() { return m_status; }
00075     internal:
00076         void set(_In_ int32 value) { m_status = value; }
00077     }
00078
00079
00080     static OnboardingConnectResult^ CreateSuccessResult()
00081     {
00082         auto result = ref new OnboardingConnectResult();
00083         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00084         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00085         return result;
00086     }
00087
00088     static OnboardingConnectResult^ CreateFailureResult(_In_ int32 status)
00089     {
00090         auto result = ref new OnboardingConnectResult();
00091         result->Status = status;
00092         return result;
00093     }
00094 internal:
00095     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00096
00097 private:
00098     int32 m_status;
00099 };
00100
00101 public ref class OnboardingOffboardResult sealed
00102 {
00103 public:
00104     property int32 Status
00105     {
00106         int32 get() { return m_status; }
00107     internal:
00108         void set(_In_ int32 value) { m_status = value; }
00109     }
00110
00111
00112     static OnboardingOffboardResult^ CreateSuccessResult()
00113     {
00114         auto result = ref new OnboardingOffboardResult();
00115         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00116         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00117         return result;
00118     }
00119
00120     static OnboardingOffboardResult^ CreateFailureResult(_In_ int32 status)
00121     {
00122         auto result = ref new OnboardingOffboardResult();
00123         result->Status = status;
00124         return result;
00125     }
00126 internal:
00127     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00128
00129 private:
00130     int32 m_status;
00131 };
00132
00133 public ref class OnboardingGetScanInfoResult sealed
00134 {
00135 public:
00136     property int32 Status
00137     {
00138         int32 get() { return m_status; }
00139     internal:
00140         void set(_In_ int32 value) { m_status = value; }
00141     }
00142
00143     property uint16 Age
00144     {
00145         uint16 get() { return m_interfaceMemberAge; }
00146     internal:
00147         void set(_In_ uint16 value) { m_interfaceMemberAge = value; }
00148     }
00149     property Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ ScanList
00150     {
00151         Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ get() { return m_interfaceMemberScanList; }
00152     internal:
00153         void set(_In_ Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ value) { m_interfaceMemberScanList = value; }
00154     }
00155
00156     static OnboardingGetScanInfoResult^ CreateSuccessResult(_In_ uint16 interfaceMemberAge, _In_ Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ interfaceMemberScanList)
00157     {
00158         auto result = ref new OnboardingGetScanInfoResult();
00159         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00160         result->Age = interfaceMemberAge;
00161         result->ScanList = interfaceMemberScanList;
00162         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00163         return result;
00164     }
00165
00166     static OnboardingGetScanInfoResult^ CreateFailureResult(_In_ int32 status)
00167     {
00168         auto result = ref new OnboardingGetScanInfoResult();
00169         result->Status = status;
00170         return result;
00171     }
00172 internal:
00173     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00174
00175 private:
00176     int32 m_status;
00177     uint16 m_interfaceMemberAge;
00178     Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ m_interfaceMemberScanList;
00179 };
00180
00181 public ref class OnboardingJoinSessionResult sealed
00182 {
00183 public:
00184     property int32 Status
00185     {
00186         int32 get() { return m_status; }
00187     internal:
00188         void set(_In_ int32 value) { m_status = value; }
00189     }
00190
00191     property OnboardingConsumer^ Consumer
00192     {
00193         OnboardingConsumer^ get() { return m_consumer; }
00194     internal:
00195         void set(_In_ OnboardingConsumer^ value) { m_consumer = value; }
00196     };
00197
00198 private:
00199     int32 m_status;
00200     OnboardingConsumer^ m_consumer;
00201 };
00202
00203 public ref class OnboardingGetVersionResult sealed
00204 {
00205 public:
00206     property int32 Status
00207     {
00208         int32 get() { return m_status; }
00209     internal:
00210         void set(_In_ int32 value) { m_status = value; }
00211     }
00212
00213     // "Interface version number"
00214     property uint16 Version
00215     {
00216         uint16 get() { return m_value; }
00217     internal:
00218         void set(_In_ uint16 value) { m_value = value; }
00219     }
00220
00221     static OnboardingGetVersionResult^ CreateSuccessResult(_In_ uint16 value)
00222     {
00223         auto result = ref new OnboardingGetVersionResult();
00224         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00225         result->Version = value;
00226         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00227         return result;
00228     }
00229
00230     static OnboardingGetVersionResult^ CreateFailureResult(_In_ int32 status)
00231     {
00232         auto result = ref new OnboardingGetVersionResult();
00233         result->Status = status;
00234         return result;
00235     }
00236 internal:
00237     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00238
00239 private:
00240     int32 m_status;
00241     uint16 m_value;
00242 };
00243
00244 public ref class OnboardingGetStateResult sealed
00245 {
00246 public:
00247     property int32 Status
00248     {
00249         int32 get() { return m_status; }
00250     internal:
00251         void set(_In_ int32 value) { m_status = value; }
00252     }
00253
00254     // "The configuration state"
00255     property int16 State
00256     {
00257         int16 get() { return m_value; }
00258     internal:
00259         void set(_In_ int16 value) { m_value = value; }
00260     }
00261
00262     static OnboardingGetStateResult^ CreateSuccessResult(_In_ int16 value)
00263     {
00264         auto result = ref new OnboardingGetStateResult();
00265         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00266         result->State = value;
00267         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00268         return result;
00269     }
00270
00271     static OnboardingGetStateResult^ CreateFailureResult(_In_ int32 status)
00272     {
00273         auto result = ref new OnboardingGetStateResult();
00274         result->Status = status;
00275         return result;
00276     }
00277 internal:
00278     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00279
00280 private:
00281     int32 m_status;
00282     int16 m_value;
00283 };
00284
00285 public ref class OnboardingGetLastErrorResult sealed
00286 {
00287 public:
00288     property int32 Status
00289     {
00290         int32 get() { return m_status; }
00291     internal:
00292         void set(_In_ int32 value) { m_status = value; }
00293     }
00294
00295     // "The last error code and error message"
00296     property OnboardingLastError^ LastError
00297     {
00298         OnboardingLastError^ get() { return m_value; }
00299     internal:
00300         void set(_In_ OnboardingLastError^ value) { m_value = value; }
00301     }
00302
00303     static OnboardingGetLastErrorResult^ CreateSuccessResult(_In_ OnboardingLastError^ value)
00304     {
00305         auto result = ref new OnboardingGetLastErrorResult();
00306         result->Status = Windows::Devices::AllJoyn::AllJoynStatus::Ok;
00307         result->LastError = value;
00308         result->m_creationContext = Concurrency::task_continuation_context::use_current();
00309         return result;
00310     }
00311
00312     static OnboardingGetLastErrorResult^ CreateFailureResult(_In_ int32 status)
00313     {
00314         auto result = ref new OnboardingGetLastErrorResult();
00315         result->Status = status;
00316         return result;
00317     }
00318 internal:
00319     Concurrency::task_continuation_context m_creationContext = Concurrency::task_continuation_context::use_default();
00320
00321 private:
00322     int32 m_status;
00323     OnboardingLastError^ m_value;
00324 };
00325
00326 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario4_Bytes.xaml.cs Source File

  • FileAccess
  • cs

Scenario4_Bytes.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using Windows.Storage;
00015 using Windows.Storage.Streams;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// Writing and reading bytes in a file.
00024     /// </summary>
00025     public sealed partial class Scenario4 : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario4()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             rootPage.ValidateFile();
00037         }
00038
00039         private async void WriteBytesButton_Click(object sender, RoutedEventArgs e)
00040         {
00041             StorageFile file = rootPage.sampleFile;
00042             if (file != null)
00043             {
00044                 try
00045                 {
00046                     string userContent = InputTextBox.Text;
00047                     IBuffer buffer = MainPage.GetBufferFromString(userContent);
00048                     await FileIO.WriteBufferAsync(file, buffer);
00049                     rootPage.NotifyUser(String.Format("The following {0} bytes of text were written to '{1}':{2}{3}", buffer.Length, file.Name, Environment.NewLine, userContent), NotifyType.StatusMessage);
00050                 }
00051                 catch (FileNotFoundException)
00052                 {
00053                     rootPage.NotifyUserFileNotExist();
00054                 }
00055                 catch (Exception ex)
00056                 {
00057                     // I/O errors are reported as exceptions.
00058                     rootPage.NotifyUser(String.Format("Error writing to '{0}': {1}", file.Name, ex.Message), NotifyType.ErrorMessage);
00059                 }
00060             }
00061             else
00062             {
00063                 rootPage.NotifyUserFileNotExist();
00064             }
00065         }
00066
00067         private async void ReadBytesButton_Click(object sender, RoutedEventArgs e)
00068         {
00069             StorageFile file = rootPage.sampleFile;
00070             if (file != null)
00071             {
00072                 try
00073                 {
00074                     IBuffer buffer = await FileIO.ReadBufferAsync(file);
00075                     string fileContent = MainPage.GetStringFromBuffer(buffer);
00076                     rootPage.NotifyUser($"The following {buffer.Length} bytes of text were read from '{file.Name}':\n{fileContent}", NotifyType.StatusMessage);
00077                 }
00078                 catch (FileNotFoundException)
00079                 {
00080                     rootPage.NotifyUserFileNotExist();
00081                 }
00082                 catch (Exception ex) when (ex.HResult == MainPage.E_NO_UNICODE_TRANSLATION)
00083                 {
00084                     rootPage.NotifyUser("File is not UTF-8 encoded.", NotifyType.ErrorMessage);
00085                 }
00086                 catch (Exception ex)
00087                 {
00088                     // I/O errors are reported as exceptions.
00089                     rootPage.NotifyUser($"Error reading from '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
00090                 }
00091             }
00092             else
00093             {
00094                 rootPage.NotifyUserFileNotExist();
00095             }
00096         }
00097     }
00098 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/InkRenderer.h Source File

  • ComplexInk
  • cpp
  • Renderers

InkRenderer.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include <inkrenderer.h>
00006 #include "Common/DirectXHelper.h"
00007 #include "WindowsNumerics.h"
00008
00009 namespace SDKTemplate
00010 {
00011     class InkRenderer
00012     {
00013     public:
00014         InkRenderer();
00015         void DrawSelectionRect(Microsoft::WRL::ComPtr<ID2D1DeviceContext> d2dContext,
00016             Microsoft::WRL::ComPtr<ID2D1Factory> d2dFactory);
00017         void Render(Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>^,
00018                     Microsoft::WRL::ComPtr<ID2D1DeviceContext> d2dContext);
00019         void Select(Windows::Foundation::Collections::IVector<Windows::Foundation::Point>^ selectionPoints);
00020         void UnselectAll();
00021         void Update(Windows::UI::Input::Inking::InkStroke^ strokeContainer);
00022         bool HasStrokesToErase(Windows::Foundation::Point prevPt, Windows::Foundation::Point currPt);
00023         Windows::Foundation::Rect DeleteSelectedStrokes();
00024
00025         // InkRenderer accessors
00026         Windows::Foundation::Rect GetSelectionRectangle() { return _selectionRect; };
00027         void UpdateSelectionRectangle(Windows::Foundation::Rect newSelectionRect);
00028         Windows::UI::Input::Inking::InkStrokeContainer^ GetStrokeContainer() { return _strokeContainer; };
00029         Windows::UI::Input::Inking::InkStrokeContainer^ GetStrokeContainerForTemp() { return _StrokeContainerForTemp; };
00030         Platform::Collections::Vector<Windows::UI::Input::Inking::InkStroke^>^ GetSelectedStrokes();
00031         void Clear();
00032         void ClearStrokeContainerForTemp() {
00033             if (_StrokeContainerForTemp != nullptr)
00034             {
00035                 _StrokeContainerForTemp->Clear();
00036             }
00037         };
00038
00039         bool IsEmptyRect(Windows::Foundation::Rect& updateRect)
00040         {
00041             return updateRect.IsEmpty || (updateRect.X == 0 && updateRect.Y == 0 && updateRect.Width == 0 && updateRect.Height == 0);
00042         }
00043
00044     private:
00045         // Ink members
00046         Windows::UI::Input::Inking::InkStrokeContainer^ _strokeContainer;         // container to hold strokes from user input
00047         Windows::UI::Input::Inking::InkStrokeContainer^ _StrokeContainerForTemp;  // container to hold cloned strokes to mimic the hollow effect in selection
00048         Microsoft::WRL::ComPtr<IInkD2DRenderer> _spInkD2DRenderer;
00049         Windows::Foundation::Rect _selectionRect;
00050         Microsoft::WRL::ComPtr<ID2D1StrokeStyle> _strokeStyle;
00051     };
00052 }
Generated on Fri Nov 15 2024 22:18:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5Photos Member List

This is the complete list of members for Scenario5Photos, including all inherited members.
OnNavigatedFrom(NavigationEventArgs e) | Scenario5Photos | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario5Photos | [inline, protected]
OnPrintButtonClick(object sender, RoutedEventArgs e) | Scenario5Photos | [inline, private]
printHelper | Scenario5Photos | [private]
Scenario5Photos() | Scenario5Photos | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

S4_CheckIndexRevision Member List

This is the complete list of members for S4_CheckIndexRevision, including all inherited members.
CheckIndexRevision_Click(object sender, RoutedEventArgs e) | S4_CheckIndexRevision | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | S4_CheckIndexRevision | [inline, protected]
rootPage | S4_CheckIndexRevision | [private]
S4_CheckIndexRevision() | S4_CheckIndexRevision | [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/Properties/AssemblyInfo.cs Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("OneHandedUse_TailoredMultipleViews")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("OneHandedUse_TailoredMultipleViews")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario3.h Source File

  • MultipleViews
  • cppwinrt

Scenario3.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3 : Scenario3T<Scenario3>
00020     {
00021         Scenario3();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00025
00026         fire_and_forget AnimatedSwitch_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027
00028     private:
00029         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00030         event_token visibilityToken;
00031         event_token fadeOutToken;
00032         Windows::UI::Xaml::Media::Animation::Storyboard fadeOutStoryboard;
00033         clock::time_point lastFadeOutTime = clock::time_point::min();
00034         handle animationCompleteEvent;
00035
00036         void CompleteCurrentAnimation();
00037         void Fade_Completed(Windows::Foundation::IInspectable const&, Windows::Foundation::IInspectable const&);
00038         void StartFadeOutContents();
00039         void Current_VisibilityChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Core::VisibilityChangedEventArgs const& e);
00040     };
00041 }
00042
00043 namespace winrt::SDKTemplate::factory_implementation
00044 {
00045     struct Scenario3 : Scenario3T<Scenario3, implementation::Scenario3>
00046     {
00047     };
00048 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/MediaItem.cs Source File

  • BackgroundMediaPlayback
  • cs
  • DataModels

MediaItem.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.Data.Json;
00018 using Windows.Media;
00019 using Windows.Media.Core;
00020 using Windows.Media.Playback;
00021 using Windows.Storage.Streams;
00022
00023 namespace BackgroundMediaPlayback.DataModels
00024 {
00025     public class MediaItem
00026     {
00027         public const string MediaItemIdKey = "mediaItemId";
00028
00029         Uri previewImageUri;
00030
00031         public string ItemId { get; set; }
00032
00033         public string Title { get; set; }
00034
00035         public Uri MediaUri { get; set; }
00036
00037         public virtual Uri PreviewImageUri
00038         {
00039             get
00040             {
00041                 return previewImageUri;
00042             }
00043             set
00044             {
00045                 previewImageUri = value;
00046             }
00047         }
00048
00049         public MediaItem()
00050         {
00051         }
00052
00053         public MediaItem(JsonObject json) : this()
00054         {
00055             ItemId = json.GetNamedString("id", Guid.NewGuid().ToString());
00056             Title = json.GetNamedString("title", string.Empty);
00057
00058             if (json.Keys.Contains("mediaUri"))
00059                 MediaUri = new Uri(json.GetNamedString("mediaUri"));
00060         }
00061
00062         public virtual MediaPlaybackItem ToPlaybackItem()
00063         {
00064             // Create the media source from the Uri
00065             var source = MediaSource.CreateFromUri(MediaUri);
00066
00067             // Create a configurable playback item backed by the media source
00068             var playbackItem = new MediaPlaybackItem(source);
00069
00070             // Populate display properties for the item that will be used
00071             // to automatically update SystemMediaTransportControls when
00072             // the item is playing.
00073             var displayProperties = playbackItem.GetDisplayProperties();
00074
00075             // Populate thumbnail
00076             if (PreviewImageUri != null)
00077                 displayProperties.Thumbnail = RandomAccessStreamReference.CreateFromUri(PreviewImageUri);
00078
00079             // Apply properties to the playback item
00080             playbackItem.ApplyDisplayProperties(displayProperties);
00081
00082             // It's often useful to save a reference or ID to correlate
00083             // a particular MediaPlaybackItem with the item from the
00084             // backing data model. CustomProperties stores serializable
00085             // types, so here we use the media item's URI as the
00086             // playback item's unique ID. You are also free to use your own
00087             // external dictionary if you want to reference non-serializable
00088             // types.
00089             source.CustomProperties[MediaItem.MediaItemIdKey] = ItemId;
00090
00091             return playbackItem;
00092         }
00093     }
00094 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario6_RecoverableErrors.xaml.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario6_RecoverableErrors.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_RecoverableErrors.xaml.h"
00014 #include <assert.h>
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Networking::BackgroundTransfer;
00023 using namespace Windows::Storage;
00024 using namespace Windows::Storage::Streams;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace Windows::Web;
00030
00031 Scenario6_RecoverableErrors::Scenario6_RecoverableErrors()
00032 {
00033     InitializeComponent();
00034 }
00035
00036 void Scenario6_RecoverableErrors::OnNavigatedTo(NavigationEventArgs^ e)
00037 {
00038     // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
00039     // Typically this can be done in the App class by overriding OnLaunched() and checking for
00040     // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
00041     // We do it here in the sample to keep the sample code consolidated.
00042     // Note that for this specific scenario we are not interested in downloads from previous instances, so
00043     // we just enumerate all downloads from previous instances and cancel them immediately.
00044     CancelActiveDownloadsAsync();
00045 }
00046
00047 void Scenario6_RecoverableErrors::OnNavigatedFrom(NavigationEventArgs^ e)
00048 {
00049     // Cancel any active download.
00050     cancellationTokenSource.cancel();
00051
00052 }
00053
00054 task<void> Scenario6_RecoverableErrors::CancelActiveDownloadsAsync()
00055 {
00056     return create_task(BackgroundDownloader::GetCurrentDownloadsAsync()).then([this](task<IVectorView<DownloadOperation^>^> downloadTask)
00057     {
00058         IVectorView<DownloadOperation^>^ downloads;
00059         try
00060         {
00061             downloads = downloadTask.get();
00062         }
00063         catch (Exception^ ex)
00064         {
00065             if (IsWebException("Discovery error", ex))
00066             {
00067                 // Don't worry if the old downloads encountered web exceptions.
00068                 return task_from_result();
00069             }
00070             throw;
00071         }
00072
00073         // If previous sample instances/scenarios started transfers that haven't completed yet, cancel them now
00074         // so that we can start this scenario cleanly.
00075         if (downloads->Size > 0)
00076         {
00077             cancellation_token_source canceledToken;
00078             canceledToken.cancel();
00079
00080             std::vector<task<void>> taskList;
00081             for (DownloadOperation^ downloadOperation : downloads)
00082             {
00083                 taskList.push_back(create_task(downloadOperation->AttachAsync(), canceledToken.get_token()).then([](task<DownloadOperation^> previousTask)
00084                 {
00085                     try
00086                     {
00087                         previousTask.get();
00088                     }
00089                     catch (task_canceled&)
00090                     {
00091                     }
00092                 }));
00093             }
00094
00095             return when_all(taskList.begin(), taskList.end()).then([this, downloads]()
00096             {
00097                 rootPage->NotifyUser("Canceled " + downloads->Size.ToString() + " downloads.", NotifyType::StatusMessage);
00098             });
00099         }
00100         return task_from_result();
00101     });
00102 }
00103
00104 void Scenario6_RecoverableErrors::OnDownloadProgress(IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ sender, DownloadOperation^ progress)
00105 {
00106     // We capture a snapshot of DownloadOperation.Progress because
00107     // it is is updated in real-time while the operation is ongoing.
00108     BackgroundDownloadProgress currentProgress = progress->Progress;
00109
00110     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, currentProgress]()
00111     {
00112         // Prepare the progress message to display in the UI.
00113         uint64_t percent = 100;
00114         if (currentProgress.TotalBytesToReceive > 0)
00115         {
00116             percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
00117         }
00118         DownloadedStatusText->Text = currentProgress.Status.ToString() + " - " + percent.ToString() + "% downloaded.";
00119
00120         if (currentProgress.HasRestarted)
00121         {
00122             rootPage->NotifyUser("Download has restarted.", NotifyType::StatusMessage);
00123         }
00124
00125         if (currentProgress.Status == BackgroundTransferStatus::PausedRecoverableWebErrorStatus)
00126         {
00127             // The only value we put in RecoverableWebErrorStatuses is WebErrorStatus.Forbidden,
00128             // so that will be the only value observed here.
00129             assert(download->CurrentWebErrorStatus->Value == WebErrorStatus::Forbidden);
00130
00131             rootPage->NotifyUser("URL has expired.", NotifyType::ErrorMessage);
00132
00133             // The URL expired. Ask the user for information so we can get a new URL.
00134             create_task(ReauthorizeDialog->ShowAsync()).then([this](ContentDialogResult result)
00135             {
00136                 if (result == ContentDialogResult::Primary)
00137                 {
00138                     // For the purpose of this sample, we simply remove "?shouldExpire=yes" from the URL
00139                     // to indicate that the sample server should treat it like a new, unexpired URL.
00140                     std::wstring originalUrlString(download->RequestedUri->AbsoluteUri->Data());
00141                     auto truncationPoint = originalUrlString.find(L'?');
00142                     if (truncationPoint == std::wstring::npos)
00143                     {
00144                         truncationPoint = originalUrlString.length();
00145                     }
00146                     auto newUrlString = ref new String(originalUrlString.c_str(), truncationPoint);
00147
00148                     rootPage->NotifyUser("Updating URL and resuming the download.", NotifyType::StatusMessage);
00149                     download->RequestedUri = ref new Uri(newUrlString);
00150                     download->Resume();
00151                 }
00152                 else
00153                 {
00154                     // Cancel the download.
00155                     cancellationTokenSource.cancel();
00156
00157                     // Re-create the cancellation_token_source for future downloads.
00158                     cancellationTokenSource = cancellation_token_source();
00159                 }
00160             });
00161         }
00162     }));
00163 }
00164
00165 void Scenario6_RecoverableErrors::StartDownload_Click(Object^ sender, RoutedEventArgs^ e)
00166 {
00167     // Reset the output whenever a new download attempt begins.
00168     DownloadedInfoText->Text = "";
00169     DownloadedStatusText->Text = "";
00170     rootPage->NotifyUser("", NotifyType::StatusMessage);
00171
00172     Uri^ source;
00173     if (!rootPage->TryGetUri(serverAddressField->Text, &source))
00174     {
00175         return;
00176     }
00177
00178     String^ destination = StringTrimmer::Trim(fileNameField->Text);
00179     if (destination == "")
00180     {
00181         rootPage->NotifyUser("A local file name is required.", NotifyType::ErrorMessage);
00182         return;
00183     }
00184
00185     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
00186         .then([this, destination](StorageFolder^ picturesLibrary) {
00187         return picturesLibrary->CreateFileAsync(destination, CreationCollisionOption::GenerateUniqueName);
00188     }).then([this, source](task<StorageFile^> previousTask)
00189     {
00190         StorageFile^ destinationFile;
00191         try
00192         {
00193             destinationFile = previousTask.get();
00194         }
00195         catch (Exception^ ex)
00196         {
00197             rootPage->NotifyUser("Error while creating file: " + ex->Message, NotifyType::ErrorMessage);
00198             return task_from_result();
00199         }
00200
00201         BackgroundDownloader^ downloader = ref new BackgroundDownloader();
00202         download = downloader->CreateDownload(source, destinationFile);
00203
00204         // Opt into "random access" mode. Transfers configured this way have full support for resumable URL updates.
00205         // If the timestamp or file size of the updated URL is different from that of the previous URL, the download
00206         // will restart from scratch. Otherwise, the transfer will resume from the same position using the new URL.
00207         //
00208         // Due to OS limitations, downloads that don't opt into "random access" mode will always restart from scratch
00209         // whenever their URL is updated.
00210         download->IsRandomAccessRequired = true;
00211
00212         if (configureRecoverableErrorsCheckBox->IsChecked->Value)
00213         {
00214             // Declare HTTP 403 (WebErrorStatus.Forbidden) as a recoverable error.
00215             download->RecoverableWebErrorStatuses->Append(WebErrorStatus::Forbidden);
00216         }
00217
00218         DownloadedInfoText->Text = "Downloading to " + destinationFile->Name + ", " + download->Guid.ToString();
00219
00220         // Start the download and wait for it to complete.
00221         return HandleDownloadAsync();
00222     });
00223 }
00224
00225 task<void> Scenario6_RecoverableErrors::HandleDownloadAsync()
00226 {
00227     startDownloadButton->IsEnabled = false;
00228     IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ downloadOperation = download->StartAsync();
00229     downloadOperation->Progress = ref new AsyncOperationProgressHandler<DownloadOperation^, DownloadOperation^>(this, &Scenario6_RecoverableErrors::OnDownloadProgress);
00230
00231     return create_task(downloadOperation, cancellationTokenSource.get_token()).then([this](DownloadOperation^ download)
00232     {
00233         rootPage->NotifyUser("Download completed successfully.", NotifyType::StatusMessage);
00234     }).then([this](task<void> precedingTask)
00235     {
00236         try
00237         {
00238             precedingTask.get();
00239         }
00240         catch (Exception^ ex)
00241         {
00242             // Abandon the operation if a web exception occurs.
00243             if (IsWebException("Execution error", ex))
00244             {
00245                 return;
00246             }
00247             throw;
00248         }
00249         catch (const task_canceled&)
00250         {
00251             // Download was canceled.
00252         }
00253     }).then([this]()
00254     {
00255         download = nullptr;
00256
00257         startDownloadButton->IsEnabled = true;
00258     });
00259 }
00260
00261 bool Scenario6_RecoverableErrors::IsWebException(String^ title, Exception^ ex)
00262 {
00263     WebErrorStatus error = BackgroundTransferError::GetStatus(ex->HResult);
00264     bool result = (error != WebErrorStatus::Unknown);
00265     String^ message = result ? error.ToString() : ex->Message;
00266     if (download == nullptr)
00267     {
00268         rootPage->NotifyUser(title + ": " + message, NotifyType::ErrorMessage);
00269     }
00270     else
00271     {
00272         rootPage->NotifyUser(download->Guid.ToString() + " - " + title + ": " + message, NotifyType::ErrorMessage);
00273     }
00274
00275     return result;
00276 }
Generated on Fri Nov 15 2024 22:18:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SlowInputStream Member List

This is the complete list of members for SlowInputStream, including all inherited members.
Dispose() | SlowInputStream | [inline]
length | SlowInputStream | [private]
position | SlowInputStream | [private]
ReadAsync(IBuffer buffer, uint count, InputStreamOptions options) | SlowInputStream | [inline]
SlowInputStream(uint length) | SlowInputStream | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/pch.cpp Source File

  • D2DPhotoAdjustment
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PrintHelper.cpp Source File

  • Printing
  • cpp

PrintHelper.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "PrintHelper.h"
00005 #include "ContinuationPage.xaml.h"
00006
00007 using namespace SDKTemplate;
00008
00009 using namespace Windows::Foundation::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Graphics::Display;
00012 using namespace Windows::Graphics::Printing;
00013 using namespace Windows::UI;
00014 using namespace Windows::UI::Text;
00015 using namespace Windows::UI::Xaml::Controls;
00016 using namespace Windows::UI::Xaml::Documents;
00017 using namespace Windows::UI::Xaml::Media;
00018 using namespace Windows::UI::Xaml::Media::Imaging;
00019 using namespace Windows::UI::Xaml::Navigation;
00020 using namespace Platform;
00021
00022 PrintHelper::PrintHelper(Page^ scenarioPage)
00023 {
00024     m_scenarioPage = scenarioPage;
00025 }
00026
00027 /// <summary>
00028 /// This function registers the app for printing with Windows and sets up the necessary event handlers for the print process.
00029 /// </summary>
00030 void PrintHelper::RegisterForPrinting()
00031 {
00032     m_printDocument = ref new PrintDocument();
00033     m_printDocumentSource = m_printDocument->DocumentSource;
00034     m_printDocument->Paginate += ref new Windows::UI::Xaml::Printing::PaginateEventHandler(this, &PrintHelper::CreatePrintPreviewPages);
00035     m_printDocument->GetPreviewPage += ref new Windows::UI::Xaml::Printing::GetPreviewPageEventHandler(this, &PrintHelper::GetPrintPreviewPage);
00036     m_printDocument->AddPages += ref new Windows::UI::Xaml::Printing::AddPagesEventHandler(this, &PrintHelper::AddPrintPages);
00037
00038     PrintManager^ printMan = PrintManager::GetForCurrentView();
00039     m_printTaskRequestedEventToken = printMan->PrintTaskRequested += ref new TypedEventHandler<PrintManager^, PrintTaskRequestedEventArgs^>(this, &PrintHelper::PrintTaskRequested);
00040 }
00041
00042 void PrintHelper::UnregisterForPrinting()
00043 {
00044     m_printDocument = nullptr;
00045
00046     // Remove the handler for printing initialization.
00047     PrintManager^ printMan = PrintManager::GetForCurrentView();
00048     printMan->PrintTaskRequested -= m_printTaskRequestedEventToken;
00049
00050     PrintCanvas->Children->Clear();
00051 }
00052
00053 void PrintHelper::ShowPrintUIAsync()
00054 {
00055     concurrency::create_task(PrintManager::ShowPrintUIAsync()).then([=](bool succeeded)
00056     {
00057         if (!succeeded)
00058         {
00059             MainPage::Current->NotifyUser("Error showing Print Dialog", NotifyType::ErrorMessage);
00060         }
00061     }).then([=](concurrency::task<void> previousTask)
00062     {
00063         // Catch and print out any errors reported
00064         try
00065         {
00066             previousTask.get();
00067         }
00068         catch (Exception^ e)
00069         {
00070             MainPage::Current->NotifyUser("Error showing Print Dialog: " + e->Message + ", hr=" + e->HResult, NotifyType::ErrorMessage);
00071         }
00072     });
00073 }
00074
00075 void PrintHelper::PreparePrintContent(Page^ page)
00076 {
00077     PreparePrintContentImpl(page);
00078 }
00079
00080 void PrintHelper::PreparePrintContentImpl(Page^ page)
00081 {
00082     if (!FirstPage)
00083     {
00084         FirstPage = page;
00085         StackPanel^ header = safe_cast<StackPanel^>(FirstPage->FindName("Header"));
00086         header->Visibility = Windows::UI::Xaml::Visibility::Visible;
00087     }
00088
00089     // Add the (newly created) page to the print canvas which is part of the visual tree and force it to go
00090     // through layout so that the linked containers correctly distribute the content inside them.
00091     PrintCanvas->Children->Append(FirstPage);
00092     PrintCanvas->InvalidateMeasure();
00093     PrintCanvas->UpdateLayout();
00094 }
00095
00096 /// <summary>
00097 /// This is the event handler for PrintManager.PrintTaskRequested.
00098 /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs->Request->Deadline.
00099 /// Therefore, we use this handler to only create the print task.
00100 /// The print settings customization can be done when the print document source is requested.
00101 /// </summary>
00102 /// <param name="sender">PrintManager</param>
00103 /// <param name="e">PrintTaskRequestedEventArgs</param>
00104 void PrintHelper::PrintTaskRequested(PrintManager^ sender, PrintTaskRequestedEventArgs^ e)
00105 {
00106     PrintTask^ printTask = e->Request->CreatePrintTask("C++ Printing SDK Sample", ref new Windows::Graphics::Printing::PrintTaskSourceRequestedHandler([=](PrintTaskSourceRequestedArgs^ args)
00107     {
00108         args->SetSource(m_printDocumentSource);
00109     }));
00110
00111     // Print Task event handler is invoked when the print job is completed.
00112     printTask->Completed += ref new TypedEventHandler<PrintTask^, PrintTaskCompletedEventArgs^>([=](PrintTask^ sender, PrintTaskCompletedEventArgs^ e)
00113     {
00114         // Notify the user when the print operation fails.
00115         if (e->Completion == Windows::Graphics::Printing::PrintTaskCompletion::Failed)
00116         {
00117             auto callback = ref new Windows::UI::Core::DispatchedHandler([=]()
00118             {
00119                 MainPage::Current->NotifyUser(ref new String(L"Failed to print."), NotifyType::ErrorMessage);
00120             });
00121
00122             m_scenarioPage->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, callback);
00123         }
00124     });
00125 }
00126
00127 /// <summary>
00128 /// This is the event handler for PrintDocument.Paginate. It creates print preview pages for the app.
00129 /// </summary>
00130 /// <param name="sender">PrintDocument</param>
00131 /// <param name="e">Paginate Event Arguments</param>
00132 void PrintHelper::CreatePrintPreviewPages(Object^ sender, PaginateEventArgs^ e)
00133 {
00134     // Clear the cache of preview pages
00135     m_printPreviewPages.clear();
00136
00137     // Clear the printing root of preview pages
00138     PrintCanvas->Children->Clear();
00139
00140     // This variable keeps track of the last RichTextBlockOverflow element that was added to a page which will be printed
00141     RichTextBlockOverflow^ lastRTBOOnPage;
00142
00143     // Get the PrintTaskOptions
00144     PrintTaskOptions^ printingOptions = safe_cast<PrintTaskOptions^>(e->PrintTaskOptions);
00145
00146     // Get the page description to deterimine how big the page is
00147     PrintPageDescription pageDescription = printingOptions->GetPageDescription(0);
00148
00149     // We know there is at least one page to be printed. passing null as the first parameter to
00150     // AddOnePrintPreviewPage tells the function to add the first page.
00151     lastRTBOOnPage = AddOnePrintPreviewPage(nullptr, pageDescription);
00152
00153     // We know there are more pages to be added as long as the last RichTextBoxOverflow added to a print preview
00154     // page has extra content
00155     while (lastRTBOOnPage->HasOverflowContent && lastRTBOOnPage->Visibility == Windows::UI::Xaml::Visibility::Visible)
00156     {
00157         lastRTBOOnPage = AddOnePrintPreviewPage(lastRTBOOnPage, pageDescription);
00158     }
00159
00160     PrintDocument^ printDocument = safe_cast<PrintDocument^>(sender);
00161
00162     // Report the number of preview pages created
00163     printDocument->SetPreviewPageCount(static_cast<int>(m_printPreviewPages.size()), PreviewPageCountType::Intermediate);
00164
00165     OnPreviewPagesCreated(printingOptions);
00166 }
00167
00168 void PrintHelper::GetPrintPreviewPage(Object^ sender, GetPreviewPageEventArgs^ e)
00169 {
00170     PrintDocument^ localprintDocument = safe_cast<PrintDocument^>(sender);
00171     localprintDocument->SetPreviewPage(e->PageNumber, m_printPreviewPages[e->PageNumber - 1]);
00172 }
00173
00174 /// <summary>
00175 /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00176 /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00177 /// into a pages that the Windows print system can deal with.
00178 /// </summary>
00179 /// <param name="sender"></param>
00180 /// <param name="e">Add page event arguments containing a print task options reference</param>
00181 void PrintHelper::AddPrintPages(Object^ sender, AddPagesEventArgs^ e)
00182 {
00183     PrintDocument^ printDocument = safe_cast<PrintDocument^>(sender);
00184
00185     // Loop over all of the preview pages and add each one to be printed
00186     for (UIElement^ previewPage : m_printPreviewPages)
00187     {
00188         printDocument->AddPage(previewPage);
00189     }
00190
00191     // Indicate that all of the print pages have been provided
00192     printDocument->AddPagesComplete();
00193 }
00194
00195 /// <summary>
00196 /// This function creates and adds one print preview page to the internal cache of print preview
00197 /// pages stored in m_printPreviewPages. Requires m_printPreviewPagesMutex to be held.
00198 /// </summary>
00199 /// <param name="lastRTBOAdded">Last RichTextBlockOverflow element added in the current content</param>
00200 /// <param name="printPageDescription">Printer's page description</param>
00201 RichTextBlockOverflow^ PrintHelper::AddOnePrintPreviewPage(RichTextBlockOverflow^ lastRTBOAdded, PrintPageDescription printPageDescription)
00202 {
00203     // XAML element that is used to represent to "printing page"
00204     FrameworkElement^ page;
00205
00206     // The link container for text overflowing in this page
00207     RichTextBlockOverflow^ textLink;
00208
00209     // Check if this is the first page ( no previous RichTextBlockOverflow)
00210     if (lastRTBOAdded == nullptr)
00211     {
00212         // If this is the first page add the specific scenario content
00213         page = FirstPage;
00214
00215         // Hide footer since we don't know yet if it will be displayed (this might not be the last page) - wait for layout
00216         StackPanel^ footer = safe_cast<StackPanel^>(page->FindName("Footer"));
00217         footer->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00218     }
00219     else
00220     {
00221         // Flow content (text) from previous pages
00222         page = ref new ContinuationPage(lastRTBOAdded);
00223     }
00224
00225     // Set "paper" width
00226     page->Width = printPageDescription.PageSize.Width;
00227     page->Height = printPageDescription.PageSize.Height;
00228
00229     Grid^ printableArea = safe_cast<Grid^>(page->FindName("PrintableArea"));
00230
00231     // Get the margins size
00232     // If the ImageableRect is smaller than the app provided margins use the ImageableRect
00233     double marginWidth = (std::max)(printPageDescription.PageSize.Width - printPageDescription.ImageableRect.Width, printPageDescription.PageSize.Width * ApplicationContentMarginLeft * 2);
00234     double marginHeight = (std::max)(printPageDescription.PageSize.Height - printPageDescription.ImageableRect.Height, printPageDescription.PageSize.Height * ApplicationContentMarginTop * 2);
00235
00236     // Set-up "printable area" on the "paper"
00237     printableArea->Width = FirstPage->Width - marginWidth;
00238     printableArea->Height = FirstPage->Height - marginHeight;
00239
00240     // Add the (newley created) page to the printing root which is part of the visual tree and force it to go
00241     // through layout so that the linked containers correctly distribute the content inside them.
00242     PrintCanvas->Children->Append(page);
00243     PrintCanvas->InvalidateMeasure();
00244     PrintCanvas->UpdateLayout();
00245
00246     // Find the last text container and see if the content is overflowing
00247     textLink = safe_cast<RichTextBlockOverflow^>(page->FindName("ContinuationPageLinkedContainer"));
00248
00249     // Check if this is the last page
00250     if (!textLink->HasOverflowContent && textLink->Visibility == Windows::UI::Xaml::Visibility::Visible)
00251     {
00252         StackPanel^ footer = safe_cast<StackPanel^>(page->FindName("Footer"));
00253         footer->Visibility = Windows::UI::Xaml::Visibility::Visible;
00254         PrintCanvas->UpdateLayout();
00255     }
00256
00257     // Add the page to the page preview collection
00258     m_printPreviewPages.push_back(page);
00259
00260     return textLink;
00261 }
Generated on Fri Nov 15 2024 22:20:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FeatureReports Member List

This is the complete list of members for FeatureReports, including all inherited members.
FeatureReports() | FeatureReports | [inline]
GetLedBlinkPattern_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | FeatureReports | [inline, private]
GetLedBlinkPatternAsync() | FeatureReports | [inline, private]
OnNavigatedTo(NavigationEventArgs eventArgs) | FeatureReports | [inline, protected]
rootPage | FeatureReports | [private]
SetLedBlinkPattern_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | FeatureReports | [inline, private]
SetLedBlinkPatternAsync(Byte pattern) | FeatureReports | [inline, private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario3.xaml.h Source File

  • FolderEnumeration
  • cpp

Scenario3.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3.xaml.h
00013 // Declaration of the Scenario3 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario3.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     [Windows::Foundation::Metadata::WebHostHidden]
00025     public ref class Scenario3 sealed
00026     {
00027     public:
00028         Scenario3();
00029
00030     protected:
00031         void GetFilesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         Platform::String^ GetPropertyDisplayValue(Platform::Object^ property);
00033         Windows::UI::Xaml::Controls::TextBlock^ CreateHeaderTextBlock(Platform::String^ contents);
00034         Windows::UI::Xaml::Controls::TextBlock^ CreateLineItemTextBlock();
00035
00036     private:
00037         static Platform::String^ CopyrightProperty;
00038         static Platform::String^ ColorSpaceProperty;
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario2_StringTemplate.xaml.cs Source File

  • DateTimeFormatting
  • cs

Scenario2_StringTemplate.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Text;
00014 using Windows.Foundation;
00015 using Windows.Foundation.Collections;
00016 using Windows.Globalization;
00017 using Windows.Globalization.DateTimeFormatting;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2_StringTemplate : Page
00025     {
00026         public Scenario2_StringTemplate()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         /// <summary>
00032         /// This is the click handler for the 'Display' button.
00033         /// </summary>
00034         private void Display()
00035         {
00036             // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00037             // to format a date/time via a string template.  Note that the order specifed in the string pattern does
00038             // not determine the order of the parts of the formatted string.  The user's language and region preferences will
00039             // determine the pattern of the date returned based on the specified parts.
00040
00041             // Create template-based date/time formatters.
00042             DateTimeFormatter[] dateFormatters = new[]
00043             {
00044                 // Formatters for dates.
00045                 new DateTimeFormatter("month day"),
00046                 new DateTimeFormatter("month year"),
00047                 new DateTimeFormatter("month day year"),
00048                 new DateTimeFormatter("month day dayofweek year"),
00049                 new DateTimeFormatter("dayofweek.abbreviated"),
00050                 new DateTimeFormatter("month.abbreviated"),
00051                 new DateTimeFormatter("year.abbreviated")
00052             };
00053
00054             // Create template-based date/time formatters.
00055             DateTimeFormatter[] timeFormatters = new[]
00056             {
00057                 // Formatters for time.
00058                 new DateTimeFormatter("hour minute"),
00059                 new DateTimeFormatter("hour minute second"),
00060                 new DateTimeFormatter("hour")
00061             };
00062
00063             // Create template-based date/time formatters.
00064             DateTimeFormatter[] timeZoneFormatters = new[]
00065             {
00066                 // Formatters for time zone.
00067                 new DateTimeFormatter("timezone"),
00068                 new DateTimeFormatter("timezone.full"),
00069                 new DateTimeFormatter("timezone.abbreviated")
00070             };
00071
00072             // Create template-based date/time formatters.
00073             DateTimeFormatter[] combinationFormatters = new[]
00074             {
00075                 // Formatters for combinations.
00076                 new DateTimeFormatter("hour minute second timezone.full"),
00077                 new DateTimeFormatter("day month year hour minute timezone"),
00078                 new DateTimeFormatter("dayofweek day month year hour minute second"),
00079                 new DateTimeFormatter("dayofweek.abbreviated day month hour minute"),
00080                 new DateTimeFormatter("dayofweek day month year hour minute second timezone.abbreviated"),
00081              };
00082
00083             // Create date/time to format and display.
00084             DateTime dateTime = DateTime.Now;
00085
00086             // We keep results in this variable
00087             StringBuilder results = new StringBuilder();
00088             results.AppendLine("Current application context language: " + ApplicationLanguages.Languages[0]);
00089             results.AppendLine();
00090             results.AppendLine("Dates:");
00091
00092             // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
00093             foreach (DateTimeFormatter formatter in dateFormatters)
00094             {
00095                 // Format and display date/time.
00096                 results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
00097             }
00098
00099             results.AppendLine();
00100             results.AppendLine("Times:");
00101
00102             // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
00103             foreach (DateTimeFormatter formatter in timeFormatters)
00104             {
00105                 // Format and display date/time.
00106                 results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
00107             }
00108
00109             results.AppendLine();
00110             results.AppendLine("Time zones:");
00111
00112             // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
00113             foreach (DateTimeFormatter formatter in timeZoneFormatters)
00114             {
00115                 // Format and display date/time.
00116                 results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
00117             }
00118
00119             results.AppendLine();
00120             results.AppendLine("Date and time combinations:");
00121
00122             // Format and display date/time. Calendar always supports Now. Otherwise you may need to verify dateTime is in supported range.
00123             foreach (DateTimeFormatter formatter in combinationFormatters)
00124             {
00125                 // Format and display date/time.
00126                 results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
00127             }
00128
00129             // Display the results
00130             OutputTextBlock.Text = results.ToString();
00131         }
00132     }
00133 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/Scenario1_EventAndMenuHookup.xaml.h Source File

  • RadialController
  • cpp

Scenario1_EventAndMenuHookup.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_EventAndMenuHookup.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_EventAndMenuHookup sealed
00024     {
00025     public:
00026         Scenario1_EventAndMenuHookup();
00027         void OnItemInvoked(unsigned int selectedItemIndex);
00028
00029         property Windows::UI::Input::RadialController^ Controller
00030         {
00031             Windows::UI::Input::RadialController^ get()
00032             {
00033                 return controller;
00034             }
00035         }
00036
00037     protected:
00038         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00039
00040     private:
00041         Windows::UI::Input::RadialController^ controller;
00042
00043         int activeItemIndex;
00044         std::vector<Windows::UI::Input::RadialControllerMenuItem^> menuItems;
00045         std::vector<Windows::UI::Xaml::Controls::Slider^> sliders;
00046         std::vector<Windows::UI::Xaml::Controls::ToggleSwitch^> toggles;
00047
00048         void InitializeController();
00049         void CreateMenuItems();
00050         void AddKnownIconItems();
00051         void AddCustomIconItems();
00052         void AddFontGlyphItems();
00053         void SetItemInvokedCallback(Windows::UI::Input::RadialControllerMenuItem^ menuItem, unsigned int index);
00054
00055         void AddItem(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00056         void RemoveItem(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00057         void SelectItem(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00058         void SelectPreviouslySelectedItem(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00059
00060         bool IsItemInMenu(Windows::UI::Input::RadialControllerMenuItem^ item);
00061         unsigned int GetItemIndex(Windows::UI::Input::RadialControllerMenuItem^ item);
00062         Windows::UI::Input::RadialControllerMenuItem^ GetRadialControllerMenuItemFromSender(Platform::Object^ sender);
00063
00064         void PrintSelectedItem(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00065         void PrintSelectedItem();
00066
00067         void OnLogSizeChanged(Platform::Object^ sender, Platform::Object^ args);
00068         void OnControlAcquired(Windows::UI::Input::RadialController^ sender, Windows::UI::Input::RadialControllerControlAcquiredEventArgs^ args);
00069         void OnControlLost(Windows::UI::Input::RadialController^ sender, Platform::Object^ args);
00070
00071         void OnScreenContactStarted(Windows::UI::Input::RadialController^ sender, Windows::UI::Input::RadialControllerScreenContactStartedEventArgs^ args);
00072         void OnScreenContactContinued(Windows::UI::Input::RadialController^ sender, Windows::UI::Input::RadialControllerScreenContactContinuedEventArgs^ args);
00073         void OnScreenContactEnded(Windows::UI::Input::RadialController^ sender, Platform::Object^ args);
00074
00075         void ToggleMenuSuppression(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00076
00077         void OnButtonClicked(Windows::UI::Input::RadialController^ sender, Windows::UI::Input::RadialControllerButtonClickedEventArgs^ args);
00078         void OnRotationChanged(Windows::UI::Input::RadialController^ sender, Windows::UI::Input::RadialControllerRotationChangedEventArgs^ args);
00079         void LogContactInfo(Windows::UI::Input::RadialControllerScreenContact^ contact);
00080     };
00081 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/pch.h Source File

  • WebAccountManagement
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cpp/SampleConfiguration.cpp Source File

  • ContactPicker
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::ApplicationModel::Contacts;
00020
00021 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00022 {
00023     { "Pick a contact", "SDKTemplate.Scenario1_Single" },
00024     { "Pick multiple contacts", "SDKTemplate.Scenario2_Multiple" },
00025 };
00026
00027 String^ MainPage::GetContactResult(Contact^ contact)
00028 {
00029     String^ result = "Display name: " + contact->DisplayName + "\n";
00030
00031     for (ContactEmail^ email : contact->Emails)
00032     {
00033         result += "Email address (" + email->Kind.ToString() + "): " + email->Address + "\n";
00034     }
00035
00036     for (ContactPhone^ phone : contact->Phones)
00037     {
00038         result += "Phone (" + phone->Kind.ToString() + "): " + phone->Number + "\n";
00039     }
00040
00041     return result;
00042 }
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/pch.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Configure Member List

This is the complete list of members for Scenario1_Configure, including all inherited members.
OpenAppSettings(object sender, RoutedEventArgs e) | Scenario1_Configure | [inline, private]
OpenLockscreenSettings(object sender, RoutedEventArgs e) | Scenario1_Configure | [inline, private]
Scenario1_Configure() | Scenario1_Configure | [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Lang Member List

This is the complete list of members for Scenario2_Lang, including all inherited members.
ReportLanguageData(Language lang) | Scenario2_Lang | [inline, private]
Scenario2_Lang() | Scenario2_Lang | [inline]
ShowResults_Click(object sender, RoutedEventArgs e) | Scenario2_Lang | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Employee.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

Employee.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Popups;
00003 using Windows.UI.Xaml;
00004
00005 namespace xBindSampleModel
00006 {
00007     internal class Employee : IEmployee
00008     {
00009         private string _FirstName;
00010         private string _LastName;
00011         private Manager _Manager;
00012
00013         internal Employee()
00014         {
00015             Visibility = true;
00016         }
00017
00018         public void Poke(object sender, RoutedEventArgs e)
00019         {
00020             MessageDialog dlg = new MessageDialog(Name + " has been poked.");
00021             var t = dlg.ShowAsync();
00022         }
00023
00024         public bool Visibility { get; set; }
00025
00026         public string NullStringProperty
00027         {
00028             get { return null; }
00029             set { }
00030         }
00031         public Windows.UI.Xaml.Media.ImageSource NullImageSource
00032         {
00033             get { return null; }
00034             set { }
00035         }
00036
00037         public string FirstName
00038         {
00039             get { return _FirstName; }
00040             set
00041             {
00042                 if (value != _FirstName)
00043                 {
00044                     _FirstName = value;
00045                 }
00046             }
00047         }
00048
00049         public string LastName
00050         {
00051             get { return _LastName; }
00052             set
00053             {
00054                 if (value != _LastName)
00055                 {
00056                     _LastName = value;
00057                 }
00058             }
00059         }
00060
00061         public Manager DirectManager
00062         {
00063             get { return _Manager; }
00064             set
00065             {
00066                 if (value != _Manager)
00067                 {
00068                     _Manager = value;
00069                 }
00070             }
00071         }
00072
00073         public bool IsManager { get { return false; } }
00074
00075         public String Title { get { return "Developer"; } }
00076
00077         public string Name { get { return FirstName + " " + LastName; } }
00078
00079         public string FullName() { return FirstName + " " + LastName; }
00080     }
00081 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HolographicSpatialStageMain Member List

This is the complete list of members for HolographicSpatialStageMain, including all inherited members.
HolographicSpatialStageMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | HolographicSpatialStageMain |
m_cameraAddedToken | HolographicSpatialStageMain | [private]
m_cameraRemovedToken | HolographicSpatialStageMain | [private]
m_deviceResources | HolographicSpatialStageMain | [private]
m_gamepadAddedEventToken | HolographicSpatialStageMain | [private]
m_gamepadRemovedEventToken | HolographicSpatialStageMain | [private]
m_holographicSpace | HolographicSpatialStageMain | [private]
m_locatabilityChangedToken | HolographicSpatialStageMain | [private]
m_sceneController | HolographicSpatialStageMain | [private]
m_spatialStageManager | HolographicSpatialStageMain | [private]
m_timer | HolographicSpatialStageMain | [private]
OnCameraAdded(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args) | HolographicSpatialStageMain | [private]
OnCameraRemoved(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args) | HolographicSpatialStageMain | [private]
OnDeviceLost() | HolographicSpatialStageMain | [virtual]
OnDeviceRestored() | HolographicSpatialStageMain | [virtual]
OnLocatabilityChanged(Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args) | HolographicSpatialStageMain | [private]
Render(Windows::Graphics::Holographic::HolographicFrame^holographicFrame) | HolographicSpatialStageMain |
SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^holographicSpace) | HolographicSpatialStageMain |
UnregisterHolographicEventHandlers() | HolographicSpatialStageMain | [private]
Update() | HolographicSpatialStageMain |
~HolographicSpatialStageMain() | HolographicSpatialStageMain |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ReadData Member List

This is the complete list of members for Scenario1_ReadData, including all inherited members.
adxl345Sensor | Scenario1_ReadData | [private]
htu21dSensor | Scenario1_ReadData | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_ReadData | [inline, protected]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_ReadData | [inline, protected]
Scenario1_ReadData() | Scenario1_ReadData | [inline]
Scenario1_ReadData() | Scenario1_ReadData | [inline]
StartScenarioAsync() | Scenario1_ReadData | [inline, private]
StartScenarioAsync() | Scenario1_ReadData | [inline, private]
StartStopScenario_Click(object sender, RoutedEventArgs e) | Scenario1_ReadData | [inline, private]
StartStopScenario_Click(object sender, RoutedEventArgs e) | Scenario1_ReadData | [inline, private]
StopScenario() | Scenario1_ReadData | [inline, private]
StopScenario() | Scenario1_ReadData | [inline, private]
timer | Scenario1_ReadData | [private]
Timer_Tick(object sender, object e) | Scenario1_ReadData | [inline, private]
Timer_Tick(object sender, object e) | Scenario1_ReadData | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/SampleConfiguration.cs Source File

  • BluetoothLE
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Bluetooth Low Energy C# Sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Client: Discover servers", ClassType=typeof(Scenario1_Discovery) },
00027             new Scenario() { Title="Client: Connect to a server", ClassType=typeof(Scenario2_Client) },
00028             new Scenario() { Title="Server: Publish foreground", ClassType=typeof(Scenario3_ServerForeground) },
00029         };
00030
00031         public string SelectedBleDeviceId;
00032         public string SelectedBleDeviceName = "No device selected";
00033     }
00034
00035     public class Scenario
00036     {
00037         public string Title { get; set; }
00038         public Type ClassType { get; set; }
00039     }
00040 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_RegisterForUpdates Member List

This is the complete list of members for Scenario3_RegisterForUpdates, including all inherited members.
Button_Click_Register(object sender, RoutedEventArgs e) | Scenario3_RegisterForUpdates | [inline, private]
Button_Click_Unregister(object sender, RoutedEventArgs e) | Scenario3_RegisterForUpdates | [inline, private]
DisplayNetworkReport(WiFiNetworkReport report, WiFiAdapter adapter) | Scenario3_RegisterForUpdates | [inline, private]
firstAdapter | Scenario3_RegisterForUpdates | [private]
FirstAdapter_AvailableNetworksChanged(WiFiAdapter sender, object args) | Scenario3_RegisterForUpdates | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_RegisterForUpdates | [inline, protected]
ResultCollection | Scenario3_RegisterForUpdates |
rootPage | Scenario3_RegisterForUpdates | [private]
Scenario3_RegisterForUpdates() | Scenario3_RegisterForUpdates | [inline]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/App.cpp Source File

  • DWriteColorGlyph
  • cpp

App.cpp

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "App.h"
00010
00011 using namespace DWriteColorTextRenderer;
00012
00013 using namespace concurrency;
00014 using namespace Windows::ApplicationModel;
00015 using namespace Windows::ApplicationModel::Core;
00016 using namespace Windows::ApplicationModel::Activation;
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::UI::Input;
00019 using namespace Windows::System;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Graphics::Display;
00022
00023 // The main function is only used to initialize our IFrameworkView class.
00024 [Platform::MTAThread]
00025 int main(Platform::Array<Platform::String^>^)
00026 {
00027     auto directXApplicationSource = ref new DirectXApplicationSource();
00028     CoreApplication::Run(directXApplicationSource);
00029     return 0;
00030 }
00031
00032 IFrameworkView^ DirectXApplicationSource::CreateView()
00033 {
00034     return ref new App();
00035 }
00036
00037 App::App() :
00038     m_windowClosed(false),
00039     m_windowVisible(true)
00040 {
00041 }
00042
00043 // The first method called when the IFrameworkView is being created.
00044 void App::Initialize(CoreApplicationView^ applicationView)
00045 {
00046     // Register event handlers for app lifecycle. This example includes Activated, so that we
00047     // can make the CoreWindow active and start rendering on the window.
00048     applicationView->Activated +=
00049         ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
00050
00051     CoreApplication::Suspending +=
00052         ref new EventHandler<SuspendingEventArgs^>(this, &App::OnSuspending);
00053
00054     CoreApplication::Resuming +=
00055         ref new EventHandler<Platform::Object^>(this, &App::OnResuming);
00056
00057     // At this point we have access to the device.
00058     // We can create the device-dependent resources.
00059     m_deviceResources = std::make_shared<DX::DeviceResources>();
00060 }
00061
00062 // Called when the CoreWindow object is created (or re-created).
00063 void App::SetWindow(CoreWindow^ window)
00064 {
00065     window->SizeChanged +=
00066         ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
00067
00068     window->VisibilityChanged +=
00069         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
00070
00071     window->Closed +=
00072         ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
00073
00074     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00075
00076     currentDisplayInformation->DpiChanged +=
00077         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
00078
00079     currentDisplayInformation->OrientationChanged +=
00080         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
00081
00082     DisplayInformation::DisplayContentsInvalidated +=
00083         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDisplayContentsInvalidated);
00084
00085     m_deviceResources->SetWindow(window);
00086 }
00087
00088 // Initializes scene resources, or loads a previously saved app state.
00089 void App::Load(Platform::String^ entryPoint)
00090 {
00091     m_main = std::unique_ptr<DWriteColorTextRendererMain>(new DWriteColorTextRendererMain(m_deviceResources));
00092 }
00093
00094 // This method is called after the window becomes active.
00095 void App::Run()
00096 {
00097     while (!m_windowClosed)
00098     {
00099         if (m_windowVisible)
00100         {
00101             // Block until a UI event occurs.
00102             CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00103
00104             if (m_main->Render())
00105             {
00106                 m_deviceResources->Present();
00107             }
00108         }
00109         else
00110         {
00111             // The window is hidden. Block until a UI event occurs.
00112             CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00113         }
00114     }
00115 }
00116
00117 // Required for IFrameworkView.
00118 // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00119 // class is torn down while the app is in the foreground.
00120 void App::Uninitialize()
00121 {
00122 }
00123
00124 // Application lifecycle event handlers.
00125
00126 void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
00127 {
00128     // Run() won't start until the CoreWindow is activated.
00129     CoreWindow::GetForCurrentThread()->Activate();
00130 }
00131
00132 void App::OnSuspending(Object^ sender, SuspendingEventArgs^ args)
00133 {
00134     m_deviceResources->Trim();
00135 }
00136
00137 void App::OnResuming(Object^ sender, Object^ args)
00138 {
00139     // Restore any data or state that was unloaded on suspend. By default, data
00140     // and state are persisted when resuming from suspend. Note that this event
00141     // does not occur if the app was previously terminated.
00142 }
00143
00144 // Window event handlers.
00145
00146 void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
00147 {
00148     m_deviceResources->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height));
00149     m_main->UpdateForWindowSizeChange();
00150 }
00151
00152 void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
00153 {
00154     m_windowVisible = args->Visible;
00155 }
00156
00157 void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
00158 {
00159     m_windowClosed = true;
00160 }
00161
00162 // DisplayInformation event handlers.
00163
00164 void App::OnDpiChanged(DisplayInformation^ sender, Object^ args)
00165 {
00166     m_deviceResources->SetDpi(sender->LogicalDpi);
00167     m_main->UpdateForWindowSizeChange();
00168 }
00169
00170 void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
00171 {
00172     m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
00173     m_main->UpdateForWindowSizeChange();
00174 }
00175
00176 void App::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args)
00177 {
00178     m_deviceResources->ValidateDevice();
00179 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level6.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level6.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Level6.h"
00014
00015 Level6::Level6()
00016 {
00017     m_timeLimit = 20.0f;
00018     m_objective = L"Hit as many moving targets as possible while avoiding the obstacles before time runs out.";
00019 }
00020
00021 bool Level6::Update(
00022     float time,
00023     float elapsedTime,
00024     float timeRemaining,
00025     std::vector<std::shared_ptr<GameObject>> const& objects
00026     )
00027 {
00028     for (auto&& object : objects)
00029     {
00030         if (object->Active() && object->Target())
00031         {
00032             if (object->Hit() && (object->HitTime() < (time - 2.0f)))
00033             {
00034                 object->Hit(false);
00035             }
00036         }
00037     }
00038     return ((timeRemaining - elapsedTime) <= 0.0f);
00039 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/pch.cpp Source File

  • GlobalizationPreferences
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/Constants.cs Source File

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask

Constants.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using System.Collections.Generic;
00009
00010 namespace BackgroundTask
00011 {
00012     internal class LocalSettingKeys
00013     {
00014         public const String SyncBackgroundTaskStatus = "SyncBackgroundTaskStatus";
00015         public const String SyncBackgroundTaskResult = "SyncBackgroundTaskResult";
00016     }
00017
00018     internal class BackgroundTaskInformation
00019     {
00020         public const String TaskCanceled = "Canceled";
00021         public const String TaskCompleted = "Completed";
00022     }
00023
00024     internal class Sync
00025     {
00026         public const UInt32 BytesToWriteAtATime = 512;
00027         public const UInt32 NumberOfTimesToWrite = 2;
00028     }
00029 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/SampleConfiguration.cs Source File

  • LampArray
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Devices.Lights;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "LampArray C# Sample";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="LampArray Basics", ClassType=typeof(Scenario1_Basics)},
00026             new Scenario() { Title="LampArray Effects", ClassType=typeof(Scenario2_Effects)},
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035
00036     internal class LampArrayInfo
00037     {
00038         public LampArrayInfo(string id, string displayName, LampArray lampArray)
00039         {
00040             this.id = id;
00041             this.displayName = displayName;
00042             this.lampArray = lampArray;
00043         }
00044
00045         public readonly string id;
00046         public readonly string displayName;
00047         public readonly LampArray lampArray;
00048     }
00049 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/PlayerViewModel.cs Source File

  • BackgroundMediaPlayback
  • cs
  • ViewModels

PlayerViewModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Foundation.Collections;
00008 using Windows.Media.Playback;
00009 using Windows.UI.Core;
00010
00011 namespace BackgroundMediaPlayback.ViewModels
00012 {
00013     /// <summary>
00014     /// The view model for the player.
00015     /// </summary>
00016     /// <remarks>
00017     /// The view disables the ability to skip during a transition or when
00018     /// the playback list is empty.
00019     /// </remarks>
00020     public class PlayerViewModel : INotifyPropertyChanged, IDisposable
00021     {
00022         bool disposed;
00023         MediaPlayer player;
00024         CoreDispatcher dispatcher;
00025         MediaPlaybackList subscribedPlaybackList;
00026
00027         MediaListViewModel mediaList;
00028         bool canSkipNext;
00029         bool canSkipPrevious;
00030
00031         public PlaybackSessionViewModel PlaybackSession { get; private set; }
00032
00033         public bool CanSkipNext
00034         {
00035             get { return canSkipNext; }
00036             set
00037             {
00038                 if (canSkipNext != value)
00039                 {
00040                     canSkipNext = value;
00041                     RaisePropertyChanged("CanSkipNext");
00042                 }
00043             }
00044         }
00045
00046         public bool CanSkipPrevious
00047         {
00048             get { return canSkipPrevious; }
00049             set
00050             {
00051                 if (canSkipPrevious != value)
00052                 {
00053                     canSkipPrevious = value;
00054                     RaisePropertyChanged("CanSkipPrevious");
00055                 }
00056             }
00057         }
00058
00059         public IEnumerable<string> AudioCategories
00060         {
00061             get { return Enum.GetNames(typeof(MediaPlayerAudioCategory)); }
00062         }
00063
00064         public string SelectedAudioCategory
00065         {
00066             get { return Enum.GetName(typeof(MediaPlayerAudioCategory), player.AudioCategory); }
00067             set
00068             {
00069                 if (Enum.GetName(typeof(MediaPlayerAudioCategory), player.AudioCategory) != value)
00070                 {
00071                     player.AudioCategory = (MediaPlayerAudioCategory)Enum.Parse(typeof(MediaPlayerAudioCategory), value);
00072                     RaisePropertyChanged("SelectedAudioCategory");
00073                 }
00074             }
00075         }
00076
00077         public MediaListViewModel MediaList
00078         {
00079             get { return mediaList; }
00080             set
00081             {
00082                 if (mediaList != value)
00083                 {
00084                     if (subscribedPlaybackList != null)
00085                     {
00086                         subscribedPlaybackList.CurrentItemChanged -= SubscribedPlaybackList_CurrentItemChanged;
00087                         subscribedPlaybackList.Items.VectorChanged -= Items_VectorChanged;
00088                         subscribedPlaybackList = null;
00089                     }
00090
00091                     mediaList = value;
00092
00093                     if (mediaList != null)
00094                     {
00095                         if (player.Source != mediaList.PlaybackList)
00096                             player.Source = mediaList.PlaybackList;
00097
00098                         subscribedPlaybackList = mediaList.PlaybackList;
00099                         subscribedPlaybackList.CurrentItemChanged += SubscribedPlaybackList_CurrentItemChanged;
00100                         subscribedPlaybackList.Items.VectorChanged += Items_VectorChanged;
00101                         HandlePlaybackListChanges(subscribedPlaybackList.Items);
00102                     }
00103                     else
00104                     {
00105                         CanSkipNext = false;
00106                         CanSkipPrevious = false;
00107                     }
00108
00109                     RaisePropertyChanged("MediaList");
00110                 }
00111             }
00112         }
00113
00114         public event PropertyChangedEventHandler PropertyChanged;
00115
00116         public PlayerViewModel(MediaPlayer player, CoreDispatcher dispatcher)
00117         {
00118             this.player = player;
00119             this.dispatcher = dispatcher;
00120
00121             PlaybackSession = new PlaybackSessionViewModel(player.PlaybackSession, dispatcher);
00122         }
00123
00124         public void TogglePlayPause()
00125         {
00126             switch (player.PlaybackSession.PlaybackState)
00127             {
00128                 case MediaPlaybackState.Playing:
00129                     player.Pause();
00130                     break;
00131                 case MediaPlaybackState.Paused:
00132                     player.Play();
00133                     break;
00134             }
00135         }
00136
00137         public void SkipNext()
00138         {
00139             if (!CanSkipNext)
00140                 return;
00141
00142             var playbackList = player.Source as MediaPlaybackList;
00143             if (playbackList == null)
00144                 return;
00145
00146             playbackList.MoveNext();
00147             CanSkipNext = false;
00148         }
00149
00150         public void SkipPrevious()
00151         {
00152             if (!CanSkipPrevious)
00153                 return;
00154
00155             var playbackList = player.Source as MediaPlaybackList;
00156             if (playbackList == null)
00157                 return;
00158
00159             playbackList.MovePrevious();
00160             CanSkipPrevious = false;
00161         }
00162
00163         private async void Items_VectorChanged(IObservableVector<MediaPlaybackItem> sender, IVectorChangedEventArgs args)
00164         {
00165             if (disposed) return;
00166             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00167             {
00168                 if (disposed) return;
00169                 HandlePlaybackListChanges(sender);
00170             });
00171         }
00172
00173         private async void SubscribedPlaybackList_CurrentItemChanged(MediaPlaybackList sender, CurrentMediaPlaybackItemChangedEventArgs args)
00174         {
00175             if (disposed) return;
00176             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00177             {
00178                 if (disposed) return;
00179                 HandlePlaybackListChanges(sender.Items);
00180             });
00181         }
00182
00183         private void HandlePlaybackListChanges(IObservableVector<MediaPlaybackItem> vector)
00184         {
00185             if (vector.Count > 0)
00186             {
00187                 CanSkipNext = true;
00188                 CanSkipPrevious = true;
00189             }
00190             else
00191             {
00192                 CanSkipNext = false;
00193                 CanSkipPrevious = false;
00194             }
00195         }
00196
00197         private void RaisePropertyChanged(string propertyName)
00198         {
00199             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
00200         }
00201
00202         public void Dispose()
00203         {
00204             if (disposed)
00205                 return;
00206
00207             if (MediaList != null)
00208             {
00209                 MediaList.Dispose();
00210                 MediaList = null; // Setter triggers vector unsubscribe logic
00211             }
00212
00213             PlaybackSession.Dispose();
00214
00215             disposed = true;
00216         }
00217     }
00218 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/CalibrationBar.xaml.h Source File

  • Inclinometer
  • cpp

CalibrationBar.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // CalibrationBar.xaml.h
00014 // Declaration of the CalibrationBar class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "CalibrationBar.g.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class CalibrationBar sealed
00029     {
00030     public:
00031         CalibrationBar();
00032
00033         void Hide();
00034         void RequestCalibration(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00035
00036     private:
00037         // Constants specifying when the calibration bar is shown:
00038         //   * suppress duration determines how long (in ticks) to wait before
00039         //     showing the calibration bar again
00040         //   * auto dismiss time determines when to auto dismiss the bar
00041         //     if it's shown too long
00042         static const ULONGLONG SUPPRESS_DURATION_APPROXIMATE_TICKS = 6000000000; // 10 minutes
00043         static const ULONGLONG SUPPRESS_DURATION_UNRELIABLE_TICKS = 3000000000; // 5 minutes
00044         static const LONGLONG CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS = 300000000; // 30 seconds
00045
00046         ULARGE_INTEGER _lastCalibrationTime;
00047         bool _barDismissed;
00048         Windows::UI::Xaml::DispatcherTimer^ _calibrationTimer;
00049         Windows::Foundation::EventRegistrationToken _windowSizeEventToken;
00050
00051         void InvalidateLayout();
00052         bool CanShowCalibrationBar(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00053         void ShowGuidance();
00054         void HideGuidance();
00055
00056         void ShowGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00057         void HideGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00058         void DismissPopup_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00059         void OnAutoDismissTimerExpired(Platform::Object^ sender, Platform::Object^ e);
00060         void OnWindowSizeChanged(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
00061     };
00062 }
Generated on Fri Nov 15 2024 22:18:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/ViewLifetimeControl.cs Source File

  • MultipleViews
  • cs

ViewLifetimeControl.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 // The objects defined here demonstrate how to make sure each of the views created remains alive as long as
00008 // the app needs them, but only when they're being used by the app or the user. Many of the scenarios contained in this
00009 // sample use these functions to keep track of the views available and ensure that the view is not closed while
00010 // the scenario is attempting to show it.
00011 //
00012 // As you can see in scenario 1, the ApplicationViewSwitcher.TryShowAsStandaloneAsync and
00013 // ProjectionManager.StartProjectingAsync methods let you show one view next to another. The Consolidated event
00014 // is fired when a view stops being visible separately from other views. Common cases where this will occur
00015 // is when the view falls out of the list of recently used apps, or when the user performs the close gesture on the view.
00016 // This is a good time to close the view, provided the app isn't trying to show the view at the same time. This event
00017 // is fired on the thread of the view that becomes consolidated.
00018 //
00019 // Each view lives on its own thread, so concurrency control is necessary. Also, as you'll see in the sample,
00020 // certain objects may be bound to UI on given threads. Properties of those objects should only be updated
00021 // on that UI thread.
00022
00023 using System;
00024 using System.ComponentModel;
00025 using Windows.UI.Core;
00026 using Windows.UI.ViewManagement;
00027
00028 namespace SecondaryViewsHelpers
00029 {
00030     // A custom event that fires whenever the secondary view is ready to be closed. You should
00031     // clean up any state (including deregistering for events) then close the window in this handler
00032     public delegate void ViewReleasedHandler(Object sender, EventArgs e);
00033
00034     // A ViewLifetimeControl is instantiated for every secondary view. ViewLifetimeControl's reference count
00035     // keeps track of when the secondary view thinks it's in usem and when the main view is interacting with the secondary view (about to show
00036     // it to the user, etc.) When the reference count drops to zero, the secondary view is closed.
00037     public sealed class ViewLifetimeControl : INotifyPropertyChanged
00038     {
00039         // Dispatcher for this view. Kept here for sending messages between this view and the main view.
00040         CoreDispatcher dispatcher;
00041
00042         // Window for this particular view. Used to register and unregister for events
00043         CoreWindow window;
00044
00045         // The title for the view shown in the list of recently used apps (by setting the title on
00046         // ApplicationView)
00047         string title;
00048
00049         // This class uses references counts to make sure the secondary views isn't closed prematurely.
00050         // Whenever the main view is about to interact with the secondary view, it should take a reference
00051         // by calling "StartViewInUse" on this object. When finished interacting, it should release the reference
00052         // by calling "StopViewInUse". You can see examples of this throughout the sample, especially in
00053         // scenario 1.
00054         int refCount = 0;
00055
00056         // Each view has a unique Id, found using the ApplicationView.Id property or
00057         // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00058         // and ProjectionManager APIs.
00059         int viewId;
00060
00061         // Tracks if this ViewLifetimeControl object is still valid. If this is true, then the view is in the process
00062         // of closing itself down
00063         bool released = false;
00064
00065         // Keeps track of if the consolidated event has fired yet. A view is consolidated with other views
00066         // when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00067         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point
00068         // the user can interact with it, move it on or off screen, etc.
00069         bool consolidated = true;
00070
00071         // Used to store pubicly registered events under the protection of a lock
00072         event ViewReleasedHandler InternalReleased;
00073
00074         // Instantiate views using "CreateForCurrentView"
00075         private ViewLifetimeControl(CoreWindow newWindow)
00076         {
00077             dispatcher = newWindow.Dispatcher;
00078             window = newWindow;
00079             viewId = ApplicationView.GetApplicationViewIdForWindow(window);
00080
00081             // This class will automatically tell the view when its time to close
00082             // or stay alive in a few cases
00083             RegisterForEvents();
00084         }
00085
00086         // Register for events on the current view
00087         private void RegisterForEvents()
00088         {
00089             // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00090             // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00091             // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00092             ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
00093         }
00094
00095         // Unregister for events. Call this method before closing the view to prevent leaks.
00096         private void UnregisterForEvents()
00097         {
00098             ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
00099         }
00100
00101         // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00102         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00103         // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00104         private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e)
00105         {
00106             StopViewInUse();
00107         }
00108
00109         // Called when a view has been "consolidated" (no longer accessible to the user)
00110         // and no other view is trying to interact with it. This should only be closed after the reference
00111         // count goes to 0 (including being consolidated). At the end of this, the view is closed.
00112         private void FinalizeRelease()
00113         {
00114             bool justReleased = false;
00115             lock (this)
00116             {
00117                 if (refCount == 0)
00118                 {
00119                     justReleased = true;
00120                     released = true;
00121                 }
00122             }
00123
00124             // This assumes that released will never be made false after it
00125             // it has been set to true
00126             if (justReleased)
00127             {
00128                 UnregisterForEvents();
00129                 InternalReleased(this, null);
00130             }
00131         }
00132
00133         // Creates ViewLifetimeControl for the particular view.
00134         // Only do this once per view.
00135         public static ViewLifetimeControl CreateForCurrentView()
00136         {
00137             return new ViewLifetimeControl(CoreWindow.GetForCurrentThread());
00138         }
00139
00140         // For purposes of this sample, the collection of views
00141         // is bound to a UI collection. This property is available for binding
00142         public string Title
00143         {
00144             get
00145             {
00146                 return title;
00147             }
00148             set
00149             {
00150                 if (title != value)
00151                 {
00152                     title = value;
00153                     if (PropertyChanged != null)
00154                     {
00155                         PropertyChanged(this, new PropertyChangedEventArgs("Title"));
00156                     }
00157                 }
00158             }
00159         }
00160
00161         // Necessary to communicate with the window
00162         public CoreDispatcher Dispatcher
00163         {
00164             get
00165             {
00166                 // This property never changes, so there's no need to lock
00167                 return dispatcher;
00168             }
00169         }
00170
00171         // Each view has a unique Id, found using the ApplicationView.Id property or
00172         // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00173         // and ProjectionManager APIs.
00174         public int Id
00175         {
00176             get
00177             {
00178                 // This property never changes, so there's no need to lock
00179                 return viewId;
00180             }
00181         }
00182
00183         // Signals that the view is being interacted with by another view,
00184         // so it shouldn't be closed even if it becomes "consolidated"
00185         public int StartViewInUse()
00186         {
00187             bool releasedCopy = false;
00188             int refCountCopy = 0;
00189
00190             // This method is called from several different threads
00191             // (each view lives on its own thread)
00192             lock (this)
00193             {
00194                 releasedCopy = this.released;
00195                 if (!released)
00196                 {
00197                     refCountCopy = ++refCount;
00198                 }
00199             }
00200
00201             if (releasedCopy)
00202             {
00203                 throw new InvalidOperationException("This view is being disposed");
00204             }
00205
00206             return refCountCopy;
00207         }
00208
00209         // Should come after any call to StartViewInUse
00210         // Signals that the another view has finished interacting with the view tracked
00211         // by this object
00212         public int StopViewInUse()
00213         {
00214             int refCountCopy = 0;
00215             bool releasedCopy = false;
00216
00217             lock (this)
00218             {
00219                 releasedCopy = this.released;
00220                 if (!released)
00221                 {
00222                     refCountCopy = --refCount;
00223                     if (refCountCopy == 0)
00224                     {
00225                         // If no other view is interacting with this view, and
00226                         // the view isn't accessible to the user, it's appropriate
00227                         // to close it
00228                         //
00229                         // Before actually closing the view, make sure there are no
00230                         // other important events waiting in the queue (this low-priority item
00231                         // will run after other events)
00232                         var task = dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease);
00233                     }
00234                 }
00235             }
00236
00237             if (releasedCopy)
00238             {
00239                 throw new InvalidOperationException("This view is being disposed");
00240             }
00241             return refCountCopy;
00242         }
00243
00244         // Signals to consumers that its time to close the view so that
00245         // they can clean up (including calling Window.Close() when finished)
00246         public event PropertyChangedEventHandler PropertyChanged;
00247         public event ViewReleasedHandler Released
00248         {
00249             add
00250             {
00251                 bool releasedCopy = false;
00252                 lock (this)
00253                 {
00254                     releasedCopy = released;
00255                     if (!released)
00256                     {
00257                         InternalReleased += value;
00258                     }
00259                 }
00260
00261                 if (releasedCopy)
00262                 {
00263                     throw new InvalidOperationException("This view is being disposed");
00264                 }
00265             }
00266
00267             remove
00268             {
00269                 lock (this)
00270                 {
00271                     InternalReleased -= value;
00272                 }
00273             }
00274         }
00275     }
00276 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario3.xaml.cpp Source File

  • StreamSocket
  • cpp

Scenario3.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.cpp
00014 // Implementation of the Scenario3 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3.xaml.h"
00019
00020 using namespace SDKTemplate::StreamSocketSample;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Windows::ApplicationModel::Core;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Networking::Sockets;
00027 using namespace Windows::Storage::Streams;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 Scenario3::Scenario3()
00033 {
00034     InitializeComponent();
00035 }
00036
00037 /// <summary>
00038 /// Invoked when this page is about to be displayed in a Frame.
00039 /// </summary>
00040 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00041 /// property is typically used to configure the page.</param>
00042 void Scenario3::OnNavigatedTo(NavigationEventArgs^ e)
00043 {
00044     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00045     // as NotifyUser()
00046     rootPage = MainPage::Current;
00047 }
00048
00049
00050 void Scenario3::SendHello_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00051 {
00052     if (!CoreApplication::Properties->HasKey("connected"))
00053     {
00054         rootPage->NotifyUser("Please run previous steps before doing this one.", NotifyType::ErrorMessage);
00055         return;
00056     }
00057
00058     StreamSocket^ socket = dynamic_cast<StreamSocket^>(CoreApplication::Properties->Lookup("clientSocket"));
00059     DataWriter^ writer;
00060
00061     // If possible, use the DataWriter we created previously. If not, then create new one.
00062     if (!CoreApplication::Properties->HasKey("clientDataWriter"))
00063     {
00064         writer = ref new DataWriter(socket->OutputStream);
00065         CoreApplication::Properties->Insert("clientDataWriter", writer);
00066     }
00067     else
00068     {
00069         writer = dynamic_cast<DataWriter^>(CoreApplication::Properties->Lookup("clientDataWriter"));
00070     }
00071
00072     // Write first the length of the string a UINT32 value followed up by the string. The operation will just store
00073     // the data locally.
00074     String^ stringToSend("Hello");
00075     writer->WriteUInt32(writer->MeasureString(stringToSend));
00076     writer->WriteString(stringToSend);
00077
00078     // Write the locally buffered data to the network.
00079     create_task(writer->StoreAsync()).then([this, socket, stringToSend] (task<unsigned int> writeTask)
00080     {
00081         try
00082         {
00083             // Try getting an exception.
00084             writeTask.get();
00085             SendOutput->Text = "\"" + stringToSend + "\" sent successfully";
00086         }
00087         catch (Exception^ exception)
00088         {
00089             rootPage->NotifyUser("Send failed with error: " + exception->Message, NotifyType::ErrorMessage);
00090         }
00091     });
00092 }
Generated on Fri Nov 15 2024 22:18:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario6.xaml.h Source File

  • MapControl
  • cpp

Scenario6.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario6 sealed
00024     {
00025     public:
00026         Scenario6();
00027     private:
00028         MainPage^ rootPage = MainPage::Current;
00029         void pfnLink_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/pch.cpp Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/SampleConfiguration.h Source File

  • CameraFrames
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Camera Frames C++ Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 } // SDKTemplate
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario2.xaml.cpp Source File

  • FolderEnumeration
  • cpp

Scenario2.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.cpp
00013 // Implementation of the Scenario2 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario2.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Platform;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Storage;
00025 using namespace Windows::Storage::Search;
00026 using namespace Windows::UI;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 Scenario2::Scenario2()
00032 {
00033     InitializeComponent();
00034 }
00035
00036 void Scenario2::GroupByMonthButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00037 {
00038     GroupByHelper(ref new QueryOptions(CommonFolderQuery::GroupByMonth));
00039 }
00040
00041 void Scenario2::GroupByRatingButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00042 {
00043     GroupByHelper(ref new QueryOptions(CommonFolderQuery::GroupByRating));
00044 }
00045
00046 void Scenario2::GroupByTagButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00047 {
00048     GroupByHelper(ref new QueryOptions(CommonFolderQuery::GroupByTag));
00049 }
00050
00051 void Scenario2::GroupByHelper(QueryOptions^ queryOptions)
00052 {
00053     OutputPanel->Children->Clear();
00054
00055     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary)).then([this, queryOptions](StorageFolder^ picturesFolder)
00056     {
00057         StorageFolderQueryResult^ queryResult = picturesFolder->CreateFolderQueryWithOptions(queryOptions);
00058         return queryResult->GetFoldersAsync();
00059     }).then([this](IVectorView<StorageFolder^>^ folders)
00060     {
00061         // Add all file retrieval tasks to an array of tasks
00062         std::vector<task<std::pair<StorageFolder^, IVectorView<StorageFile^>^>>> fileTasks;
00063         std::for_each(begin(folders), end(folders), [&fileTasks](StorageFolder^ folder)
00064         {
00065             auto getFilesTask = create_task(folder->GetFilesAsync());
00066             fileTasks.push_back(getFilesTask.then([folder](IVectorView<StorageFile^>^ files)
00067             {
00068                 // put the results in std::pair to create the association of folder and its files.
00069                 return std::pair<StorageFolder^, IVectorView<StorageFile^>^>(folder, files);
00070             }));
00071         });
00072
00073         // Aggregate the results of multiple asynchronous operations
00074         // so that they are returned after all are completed. This
00075         // ensures that all groups are displayed in order.
00076         when_all(fileTasks.begin(), fileTasks.end()).then([this, folders](std::vector<std::pair<StorageFolder^, IVectorView<StorageFile^>^>> folderContents)
00077         {
00078             std::for_each(begin(folderContents), end(folderContents), [this](std::pair<StorageFolder^, IVectorView<StorageFile^>^> folderContent)
00079             {
00080                 auto folder = folderContent.first;
00081                 auto files = folderContent.second;
00082
00083                 OutputPanel->Children->Append(CreateHeaderTextBlock(folder->DisplayName + " (" + files->Size.ToString() + ")"));
00084                 std::for_each(begin(files), end(files), [this](StorageFile^ file)
00085                 {
00086                     OutputPanel->Children->Append(CreateLineItemTextBlock(file->Name));
00087                 });
00088             });
00089         });
00090     });
00091 }
00092
00093 TextBlock^ Scenario2::CreateHeaderTextBlock(String^ contents)
00094 {
00095     TextBlock^ textBlock = ref new TextBlock();
00096     textBlock->Text = contents;
00097     textBlock->Style = static_cast<Xaml::Style^>(::Application::Current->Resources->Lookup("SampleHeaderTextStyle"));
00098     textBlock->TextWrapping = TextWrapping::Wrap;
00099     return textBlock;
00100 }
00101
00102 TextBlock^ Scenario2::CreateLineItemTextBlock(String^ contents)
00103 {
00104     TextBlock^ textBlock = ref new TextBlock();
00105     textBlock->Text = contents;
00106     textBlock->Style = static_cast<Xaml::Style^>(::Application::Current->Resources->Lookup("BasicTextStyle"));
00107     textBlock->TextWrapping = TextWrapping::Wrap;
00108     Thickness margin = textBlock->Margin;
00109     margin.Left = 20;
00110     textBlock->Margin = margin;
00111     return textBlock;
00112 }
Generated on Fri Nov 15 2024 22:17:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Effects Member List

This is the complete list of members for Scenario2_Effects, including all inherited members.
CleanupPreviousEffect() | Scenario2_Effects | [inline, private]
ColorRampDuration | Scenario2_Effects | [private, static]
CustomEffect_UpdateRequested(CustomEffectState state, LampArrayUpdateRequestedEventArgs args) | Scenario2_Effects | [inline, private, static]
CustomEffectButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
CustomEffectFrameCount | Scenario2_Effects | [private, static]
CycleButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
EffectUpdateInterval | Scenario2_Effects | [private, static]
FadeButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
GeneratedBitmapButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
GeneratedBitmapEffect_UpdateRequested(GeneratedBitmapState state, LampArrayBitmapRequestedEventArgs args) | Scenario2_Effects | [inline, private, static]
GeneratedBitmapEffectFrameCount | Scenario2_Effects | [private, static]
GetLampArrayIndices(LampArray lampArray) | Scenario2_Effects | [inline, private, static]
LampArray_AvailabilityChanged(LampArray sender, object args) | Scenario2_Effects | [inline, private]
m_attachedLampArrays | Scenario2_Effects | [private]
m_deviceWatcher | Scenario2_Effects | [private]
m_emptyList | Scenario2_Effects | [private]
m_random | Scenario2_Effects | [private]
m_readyPlaylists | Scenario2_Effects | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_Effects | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Effects | [inline, protected]
PauseButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
PlayButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
rootPage | Scenario2_Effects | [private]
Scenario2_Effects() | Scenario2_Effects | [inline]
StaticBitmapButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
StaticBitmapEffect_BitmapRequested(SoftwareBitmap bitmap, LampArrayBitmapRequestedEventArgs args) | Scenario2_Effects | [inline, private, static]
StopButton_Click(object sender, RoutedEventArgs e) | Scenario2_Effects | [inline, private]
UpdateLampArrayList() | Scenario2_Effects | [inline, private]
Watcher_Added(DeviceWatcher sender, DeviceInformation args) | Scenario2_Effects | [inline, private]
Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args) | Scenario2_Effects | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Project.idl Source File

  • ResizeAppView
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Basic : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Basic();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_Launch : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_Launch();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/TextRenderer.h Source File

  • HolographicFaceTracking
  • cpp
  • Content

TextRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Common\DeviceResources.h"
00015
00016 namespace HolographicFaceTracker
00017 {
00018     class TextRenderer : public DX::Resource
00019     {
00020     public:
00021         TextRenderer(
00022             std::shared_ptr<DX::DeviceResources> deviceResources,
00023             uint32_t textureWidth,
00024             uint32_t textureHeight);
00025
00026         void RenderTextOffscreen(std::wstring const& str);
00027
00028         concurrency::task<void> CreateDeviceDependentResourcesAsync() override;
00029         void ReleaseDeviceDependentResources() override;
00030
00031         ID3D11ShaderResourceView* GetTexture() const { return m_shaderResourceView.Get();   };
00032         ID3D11SamplerState*       GetSampler() const { return m_pointSampler.Get();         };
00033
00034     private:
00035         // Direct3D resources for rendering text to an off-screen render target.
00036         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_texture;
00037         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_shaderResourceView;
00038         Microsoft::WRL::ComPtr<ID3D11SamplerState>          m_pointSampler;
00039         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>      m_renderTargetView;
00040         Microsoft::WRL::ComPtr<ID2D1RenderTarget>           m_d2dRenderTarget;
00041         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>        m_whiteBrush;
00042         Microsoft::WRL::ComPtr<IDWriteTextFormat>           m_textFormat;
00043
00044         // CPU-based variables for configuring the offscreen render target.
00045         const unsigned int m_textureWidth;
00046         const unsigned int m_textureHeight;
00047     };
00048 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/DistanceFieldRenderer.cpp Source File

  • HolographicTagAlong
  • cpp
  • Content

DistanceFieldRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #include "Common\DirectXHelper.h"
00015 #include "Content\ShaderStructures.h"
00016 #include "DistanceFieldRenderer.h"
00017
00018 using namespace Concurrency;
00019 using namespace DirectX;
00020 using namespace HolographicTagAlongSample;
00021
00022 DistanceFieldRenderer::DistanceFieldRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources, unsigned int const& textureWidth, unsigned int const& textureHeight)
00023   : m_deviceResources(deviceResources),
00024     m_textureWidth(textureWidth),
00025     m_textureHeight(textureHeight)
00026 {
00027     CreateDeviceDependentResources();
00028 }
00029
00030 void DistanceFieldRenderer::RenderDistanceField(ID3D11ShaderResourceView* texture)
00031 {
00032     // Loading is asynchronous. Resources must be created before drawing can occur.
00033     if (!m_loadingComplete)
00034     {
00035         return;
00036     }
00037
00038     const auto context = m_deviceResources->GetD3DDeviceContext();
00039
00040     // Set and clear the off-screen render target.
00041     ID3D11RenderTargetView *const targets[1] = { m_renderTargetView.Get() };
00042     context->OMSetRenderTargets(1, targets, m_d3dDepthStencilView.Get());
00043     context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
00044     context->ClearDepthStencilView(m_d3dDepthStencilView.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0);
00045
00046     // Set the viewport to cover the whole texture.
00047     CD3D11_VIEWPORT viewport = CD3D11_VIEWPORT(
00048         0.f, 0.f,
00049         static_cast<float>(m_textureWidth),
00050         static_cast<float>(m_textureHeight));
00051     context->RSSetViewports(1, &viewport);
00052
00053     // Each vertex is one instance of the XMFLOAT2 struct.
00054     const UINT stride = m_vertexStride;
00055     const UINT offset = 0;
00056     context->IASetVertexBuffers(
00057         0,
00058         1,
00059         m_vertexBuffer.GetAddressOf(),
00060         &stride,
00061         &offset
00062     );
00063     context->IASetIndexBuffer(
00064         m_indexBuffer.Get(),
00065         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00066         0
00067     );
00068     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00069     context->IASetInputLayout(m_inputLayout.Get());
00070
00071     // Attach the vertex shader.
00072     context->VSSetShader(
00073         m_vertexShader.Get(),
00074         nullptr,
00075         0
00076     );
00077
00078     // Attach the pixel shader.
00079     context->PSSetShader(
00080         m_pixelShader.Get(),
00081         nullptr,
00082         0
00083     );
00084     context->PSSetShaderResources(
00085         0,
00086         1,
00087         &texture
00088     );
00089
00090     // Draw the objects.
00091     context->DrawIndexed(
00092         m_indexCount,   // Index count.
00093         0,              // Start index location.
00094         0               // Base vertex location.
00095     );
00096
00097     ++m_renderCount;
00098 }
00099
00100 void DistanceFieldRenderer::ReleaseDeviceDependentResources()
00101 {
00102     m_loadingComplete = false;
00103
00104     m_vertexShader.Reset();
00105     m_inputLayout.Reset();
00106     m_pixelShader.Reset();
00107
00108     m_vertexBuffer.Reset();
00109     m_indexBuffer.Reset();
00110
00111     m_texture.Reset();
00112     m_shaderResourceView.Reset();
00113     m_renderTargetView.Reset();
00114 }
00115
00116 void DistanceFieldRenderer::CreateDeviceDependentResources()
00117 {
00118     // Create the texture that will be used as the offscreen render target.
00119     CD3D11_TEXTURE2D_DESC textureDesc(
00120         DXGI_FORMAT_R8G8_UNORM,
00121         m_textureWidth,
00122         m_textureHeight,
00123         1,
00124         1,
00125         D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
00126     );
00127     m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);
00128
00129     // Create read and write views for the offscreen render target.
00130     m_deviceResources->GetD3DDevice()->CreateShaderResourceView(m_texture.Get(), nullptr, &m_shaderResourceView);
00131     m_deviceResources->GetD3DDevice()->CreateRenderTargetView(m_texture.Get(), nullptr, &m_renderTargetView);
00132
00133
00134     // Create a depth stencil view.
00135     // NOTE: This is used only for drawing. It could be recycled for additional distance rendering
00136     //       passes, and discarded after all distance fields have been created (as could the index
00137     //       and vertex buffers).
00138     CD3D11_TEXTURE2D_DESC depthStencilDesc(
00139         DXGI_FORMAT_D16_UNORM,
00140         m_textureWidth,
00141         m_textureHeight,
00142         1, // One array level.
00143         1, // Use a single mipmap level.
00144         D3D11_BIND_DEPTH_STENCIL
00145     );
00146
00147     Microsoft::WRL::ComPtr<ID3D11Texture2D> depthStencil;
00148     DX::ThrowIfFailed(
00149         m_deviceResources->GetD3DDevice()->CreateTexture2D(
00150             &depthStencilDesc,
00151             nullptr,
00152             &depthStencil
00153         )
00154     );
00155
00156     CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
00157     DX::ThrowIfFailed(
00158         m_deviceResources->GetD3DDevice()->CreateDepthStencilView(
00159             depthStencil.Get(),
00160             &depthStencilViewDesc,
00161             &m_d3dDepthStencilView
00162         )
00163     );
00164
00165
00166     // Load shaders asynchronously.
00167     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(L"ms-appx:///FullscreenQuadVertexShader.cso");
00168     task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///CreateDistanceFieldPixelShader.cso");
00169
00170     // After the vertex shader file is loaded, create the shader and input layout.
00171     task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
00172     {
00173         DX::ThrowIfFailed(
00174             m_deviceResources->GetD3DDevice()->CreateVertexShader(
00175                 fileData.data(),
00176                 fileData.size(),
00177                 nullptr,
00178                 &m_vertexShader
00179             )
00180         );
00181
00182         constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 1> vertexDesc =
00183             {{
00184                 { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 }
00185             }};
00186
00187         DX::ThrowIfFailed(
00188             m_deviceResources->GetD3DDevice()->CreateInputLayout(
00189                 vertexDesc.data(),
00190                 vertexDesc.size(),
00191                 fileData.data(),
00192                 fileData.size(),
00193                 &m_inputLayout
00194             )
00195         );
00196     });
00197
00198     // After the pixel shader file is loaded, create the shader and constant buffer.
00199     task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
00200     {
00201         DX::ThrowIfFailed(
00202             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00203                 fileData.data(),
00204                 fileData.size(),
00205                 nullptr,
00206                 &m_pixelShader
00207             )
00208         );
00209     });
00210
00211     // Once all shaders are loaded, create the mesh.
00212     task<void> createQuadTask = (createPSTask && createVSTask).then([this]()
00213     {
00214         // Load mesh vertices for a full-screen quad.
00215         static const std::array<XMFLOAT2, 4> quadVertices =
00216         {{
00217             { XMFLOAT2(-1.0f,  1.0f) },
00218             { XMFLOAT2( 1.0f,  1.0f) },
00219             { XMFLOAT2( 1.0f, -1.0f) },
00220             { XMFLOAT2(-1.0f, -1.0f) },
00221         }};
00222
00223         m_vertexStride = sizeof(XMFLOAT2);
00224
00225         D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
00226         vertexBufferData.pSysMem = quadVertices.data();
00227         vertexBufferData.SysMemPitch = 0;
00228         vertexBufferData.SysMemSlicePitch = 0;
00229         const CD3D11_BUFFER_DESC vertexBufferDesc(m_vertexStride * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
00230         DX::ThrowIfFailed(
00231             m_deviceResources->GetD3DDevice()->CreateBuffer(
00232                 &vertexBufferDesc,
00233                 &vertexBufferData,
00234                 &m_vertexBuffer
00235             )
00236         );
00237
00238         // Load mesh indices. Each trio of indices represents
00239         // a triangle to be rendered on the screen.
00240         // For example: 2,1,0 means that the vertices with indexes
00241         // 2, 1, and 0 from the vertex buffer compose the
00242         // first triangle of this mesh.
00243         // Note that the winding order is clockwise by default.
00244         constexpr std::array<unsigned short, 6> quadIndices =
00245         {{
00246             // -z
00247             0,2,3,
00248             0,1,2,
00249         }};
00250
00251         m_indexCount = quadIndices.size();
00252
00253         D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
00254         indexBufferData.pSysMem = quadIndices.data();
00255         indexBufferData.SysMemPitch = 0;
00256         indexBufferData.SysMemSlicePitch = 0;
00257         const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
00258         DX::ThrowIfFailed(
00259             m_deviceResources->GetD3DDevice()->CreateBuffer(
00260                 &indexBufferDesc,
00261                 &indexBufferData,
00262                 &m_indexBuffer
00263             )
00264         );
00265     });
00266
00267     auto loadingCompleteTask = createQuadTask.then([this]() {
00268
00269         m_loadingComplete = true;
00270     });
00271 }
00272
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cs/DefaultCloseCommand.xaml.cs Source File

  • MessageDialog
  • cs

DefaultCloseCommand.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.Popups;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using System;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class DefaultCloseCommand : Page
00022     {
00023         MainPage rootPage = MainPage.Current;
00024
00025         public DefaultCloseCommand()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         /// <summary>
00031         /// Click handler for the 'DefaultCloseCommandButton' button.
00032         /// Demonstrates showing a message dialog with a default close command and content.
00033         /// A message will be displayed indicating that the dialog has been closed.
00034         /// In this scenario, the only command is the default 'Close' command that is used if no other commands are specified.
00035         /// </summary>
00036         /// <param name="sender">The Object that caused this event to be fired.</param>
00037         /// <param name="e">State information and event data associated with the routed event.</param>
00038         private async void DefaultCloseCommandButton_Click(object sender, RoutedEventArgs e)
00039         {
00040             // Create the message dialog and set its content; it will get a default "Close" button since there aren't any other buttons being added
00041             var messageDialog = new MessageDialog("You've exceeded your trial period.");
00042
00043             // Show the message dialog and wait
00044             await messageDialog.ShowAsync();
00045             rootPage.NotifyUser("The dialog has now been closed", NotifyType.StatusMessage);
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_FindId Member List

This is the complete list of members for Scenario1_FindId, including all inherited members.
Default_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_FindId
Scenario1_FindId() | Scenario1_FindId
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cpp/Scenario1_ReadData.xaml.h Source File

  • IoT-I2C
  • cpp

Scenario1_ReadData.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_GetAndSetPin.xaml.h
00014 //
00015
00016 #pragma once
00017
00018 #include "Scenario1_ReadData.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_ReadData sealed
00024     {
00025     public:
00026         Scenario1_ReadData();
00027         void StartStopScenario_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028
00029     protected:
00030         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         concurrency::task<void> StartScenarioAsync();
00034         void StopScenario();
00035         void Timer_Tick(Platform::Object^ sender, Platform::Object^ e);
00036
00037     private:
00038         Windows::UI::Xaml::DispatcherTimer^ timer;
00039         Windows::Foundation::EventRegistrationToken timerToken;
00040         Windows::Devices::I2c::I2cDevice^ htu21dSensor;
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EdpBackgroundTask Member List

This is the complete list of members for EdpBackgroundTask, including all inherited members.
DoBufferWork(IBackgroundTaskInstance taskInstance) | EdpBackgroundTask | [inline, private]
DoFileWork(IBackgroundTaskInstance taskInstance) | EdpBackgroundTask | [inline, private]
m_areKeysDropped | EdpBackgroundTask | [private]
m_cancelRequested | EdpBackgroundTask | [private]
m_EnterpriseID | EdpBackgroundTask | [private]
m_fileProtStatus | EdpBackgroundTask | [private]
m_protectedBuffer | EdpBackgroundTask | [private]
m_SecretMessage | EdpBackgroundTask | [private]
m_taskName | EdpBackgroundTask | [private]
OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) | EdpBackgroundTask | [inline, private]
ProtectedAccessResumed(object sender, ProtectedAccessResumedEventArgs args) | EdpBackgroundTask | [inline, private]
ProtectedAccessSuspending(object sender, ProtectedAccessSuspendingEventArgs args) | EdpBackgroundTask | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | EdpBackgroundTask | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeText.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_SynthesizeText.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::ApplicationModel::Resources::Core;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Media::SpeechSynthesis;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Primitives;
00026 using namespace Windows::UI::Xaml::Data;
00027 using namespace Windows::UI::Xaml::Input;
00028 using namespace Windows::UI::Xaml::Media;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 Scenario_SynthesizeText::Scenario_SynthesizeText() : rootPage(MainPage::Current)
00032 {
00033     InitializeComponent();
00034     synthesizer = ref new SpeechSynthesizer();
00035
00036     // initialize localization for text blob
00037     speechContext = ResourceContext::GetForCurrentView();
00038     speechContext->Languages = ref new VectorView<String^>(1, SpeechSynthesizer::DefaultVoice->Language);
00039
00040     speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationTTSResources");
00041
00042     InitializeListboxVoiceChooser();
00043 }
00044
00045 /// <summary>
00046 /// This is invoked when the user clicks on the speak/stop button.
00047 /// </summary>
00048 /// <param name="sender">Button that triggered this event</param>
00049 /// <param name="e">State information about the routed event</param>
00050 void Scenario_SynthesizeText::Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00051 {
00052     // If the media is playing, the user has pressed the button to stop the playback.
00053     if (media->CurrentState == MediaElementState::Playing)
00054     {
00055         media->Stop();
00056         btnSpeak->Content = "Speak";
00057     }
00058     else
00059     {
00060         String^ text = textToSynthesize->Text;
00061         if (!text->IsEmpty())
00062         {
00063             // Change the button label. You could also just disable the button if you don't want any user control.
00064             btnSpeak->Content = "Stop";
00065
00066             // Create a stream from the text. This will be played using a media element.
00067             create_task(synthesizer->SynthesizeTextToStreamAsync(text), task_continuation_context::use_current())
00068                 .then([this](task<SpeechSynthesisStream^> synthesisStreamTask)
00069             {
00070                 try
00071                 {
00072                     SpeechSynthesisStream^ synthesisStream = synthesisStreamTask.get();
00073
00074                     // Set the source and start playing the synthesized audio stream.
00075                     media->AutoPlay = true;
00076                     media->SetSource(synthesisStream, synthesisStream->ContentType);
00077                     media->Play();
00078                 }
00079                 catch (Exception^ ex)
00080                 {
00081           if (ex->HResult == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
00082           {
00083             btnSpeak->Content = L"Speak";
00084             btnSpeak->IsEnabled = false;
00085             listboxVoiceChooser->IsEnabled = false;
00086             Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Media playback components unavailable.");
00087             create_task(dialog->ShowAsync());
00088           }
00089           else
00090           {
00091             // If the text is not able to be synthesized, throw an error message to the user.
00092             btnSpeak->Content = L"Speak";
00093             Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Unable to synthesize text");
00094             create_task(dialog->ShowAsync());
00095           }
00096                 }
00097             });
00098         }
00099     }
00100 }
00101
00102 /// <summary>
00103 /// This is called when the user has selects a voice from the drop down.
00104 /// </summary>
00105 /// <param name="sender">unused object parameter</param>
00106 /// <param name="e">unused event parameter</param>
00107 void Scenario_SynthesizeText::ListboxVoiceChooser_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00108 {
00109     if (e->AddedItems->Size > 0)
00110     {
00111         ComboBoxItem^ first = safe_cast<ComboBoxItem^>(e->AddedItems->GetAt(0));
00112         VoiceInformation^ voice = safe_cast<VoiceInformation^>(first->Tag);
00113         synthesizer->Voice = voice;
00114
00115
00116         // update UI text to be an appropriate default translation.
00117         speechContext->Languages = ref new VectorView<String^>(1, { voice->Language });
00118         textToSynthesize->Text = speechResourceMap->GetValue("SynthesizeTextDefaultText", speechContext)->ValueAsString;
00119
00120     }
00121 }
00122
00123 /// <summary>
00124 /// This is invoked when the stream is finished playing.
00125 /// </summary>
00126 /// <remarks>
00127 /// In this case, we're changing the button label based on the state.
00128 /// </remarks>
00129 /// <param name="sender">unused object parameter</param>
00130 /// <param name="e">unused event parameter</param>
00131 void Scenario_SynthesizeText::media_MediaEnded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00132 {
00133     btnSpeak->Content = "Speak";
00134 }
00135
00136 /// <summary>
00137 /// This creates items out of the system installed voices. The voices are then displayed in a listbox.
00138 /// This allows the user to change the voice of the synthesizer in your app based on their preference.
00139 /// </summary>
00140 void Scenario_SynthesizeText::InitializeListboxVoiceChooser()
00141 {
00142     // Get all of the installed voices.
00143     IVectorView<VoiceInformation^>^ voices = SpeechSynthesizer::AllVoices;
00144
00145     // Get the currently selected voice.
00146     VoiceInformation^ currentVoice = synthesizer->Voice;
00147
00148     // Copy the read-only voice information IVectorView into a mutable std::vector
00149     std::vector<VoiceInformation^> sortedVoices(voices->Size);
00150     std::copy(begin(voices), end(voices), sortedVoices.begin());
00151
00152     // Sort it based on the language tag (en-US, fr-FR, etc), to group them for readability.
00153     std::sort(begin(sortedVoices), end(sortedVoices), [](VoiceInformation^ a, VoiceInformation^ b)
00154     {
00155         return b->Language > a->Language;
00156     });
00157
00158     // Add them to the combo box in order.
00159     std::for_each(begin(sortedVoices), end(sortedVoices), [&](VoiceInformation^ voice)
00160     {
00161         ComboBoxItem^ item = ref new ComboBoxItem();
00162         item->Name = voice->DisplayName;
00163         item->Tag = voice;
00164         item->Content = voice->DisplayName + L" (" + voice->Language + L")";
00165         listboxVoiceChooser->Items->Append(item);
00166
00167         // Check to see if we're looking at the current voice and set it as selected in the listbox.
00168         if (currentVoice->Id == voice->Id)
00169         {
00170             item->IsSelected = true;
00171             listboxVoiceChooser->SelectedItem = item;
00172         }
00173     });
00174 }
Generated on Fri Nov 15 2024 22:21:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/pch.cpp Source File

  • LampArray
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/pch.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

pch.cpp

Go to the documentation of this file.
00001 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/pch.cpp Source File

  • RadialController
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/SampleConfiguration.cpp Source File

  • ContextMenu
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Show a context menu",            "SDKTemplate.Scenario1" },
00012     { "Replace a default context menu", "SDKTemplate.Scenario2" },
00013 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/2-PointerPointProperties.xaml.cpp Source File

  • BasicInput
  • cpp

2-PointerPointProperties.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "2-PointerPointProperties.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Scenario2::Scenario2() : rootPage(SDKTemplate::MainPage::Current)
00030 {
00031     InitializeComponent();
00032
00033     // Add event handlers
00034     mainCanvas->PointerPressed += ref new PointerEventHandler(this, &Scenario2::Pointer_Pressed);
00035     mainCanvas->PointerMoved += ref new PointerEventHandler(this, &Scenario2::Pointer_Moved);
00036     mainCanvas->PointerReleased += ref new PointerEventHandler(this, &Scenario2::Pointer_Released);
00037     mainCanvas->PointerExited += ref new PointerEventHandler(this, &Scenario2::Pointer_Released);
00038     mainCanvas->PointerEntered += ref new PointerEventHandler(this, &Scenario2::Pointer_Entered);
00039     mainCanvas->PointerWheelChanged += ref new PointerEventHandler(this, &Scenario2::Pointer_Wheel_Changed);
00040 }
00041
00042 void Scenario2::Pointer_Pressed(Platform::Object^ sender, PointerRoutedEventArgs^ e)
00043 {
00044     Windows::UI::Input::PointerPoint^ currentPoint = e->GetCurrentPoint(mainCanvas);
00045
00046     // Retrieve the properties for the curret PointerPoint and display
00047     // them alongside the pointer's location on screen
00048     CreateOrUpdatePropertyPopUp(currentPoint);
00049 }
00050
00051 void Scenario2::Pointer_Entered(Platform::Object^ sender, PointerRoutedEventArgs^ e)
00052 {
00053     Windows::UI::Input::PointerPoint^ currentPoint = e->GetCurrentPoint(mainCanvas);
00054
00055     // Determine if the point that entered the canvas is "in contact" with the
00056     // screen (mouse button pressed, finger down, or pen down).
00057     // This will be encountered if the user touches down in the app surface,
00058     // drags their finger off of the app, and drags it back onto the app without
00059     // lifting their finger.
00060     if (currentPoint->IsInContact)
00061     {
00062         CreateOrUpdatePropertyPopUp(currentPoint);
00063     }
00064 }
00065
00066 void Scenario2::Pointer_Moved(Platform::Object^ sender, PointerRoutedEventArgs^ e)
00067 {
00068     // Retrieve the point associated with the current event
00069     Windows::UI::Input::PointerPoint^ currentPoint = e->GetCurrentPoint(mainCanvas);
00070
00071     // Create a popup if the pointer being moved is in contact with the screen
00072     if (currentPoint->IsInContact)
00073     {
00074         CreateOrUpdatePropertyPopUp(currentPoint);
00075     }
00076 }
00077
00078 void Scenario2::Pointer_Released(Platform::Object^ sender, PointerRoutedEventArgs^ e)
00079 {
00080     // Retrieve the point associated with the current event
00081     Windows::UI::Input::PointerPoint^ currentPoint = e->GetCurrentPoint(mainCanvas);
00082
00083     // Remove the popup corresponding to the pointer
00084     HidePropertyPopUp(currentPoint);
00085 }
00086
00087 void Scenario2::Pointer_Wheel_Changed(Platform::Object^ sender, PointerRoutedEventArgs^ e)
00088 {
00089     // Retrieve the point associated with the current event and record the
00090     // mouse wheel delta
00091     Windows::UI::Input::PointerPoint^ currentPoint = e->GetCurrentPoint(mainCanvas);
00092     if (currentPoint->IsInContact)
00093     {
00094         CreateOrUpdatePropertyPopUp(currentPoint);
00095     }
00096 }
00097
00098 void Scenario2::CreateOrUpdatePropertyPopUp(Windows::UI::Input::PointerPoint^ currentPoint)
00099 {
00100     // Retrieve the properties that are common to all pointers
00101     Platform::String^ pointerProperties = GetPointerProperties(currentPoint);
00102
00103     // Retrieve the properties that are specific to the device type associated
00104     // with the current PointerPoint
00105     Platform::String^ deviceSpecificProperties = GetDeviceSpecificProperties(currentPoint);
00106
00107     RenderPropertyPopUp(pointerProperties, deviceSpecificProperties, currentPoint);
00108 }
00109
00110 // Return the properties that are common to all pointers
00111 Platform::String^ Scenario2::GetPointerProperties(Windows::UI::Input::PointerPoint^ currentPoint)
00112 {
00113     Platform::String^ sb = ref new Platform::String();
00114     sb += "ID: " + currentPoint->PointerId;
00115     sb += "\nX: " + currentPoint->Position.X;
00116     sb += "\nY: " + currentPoint->Position.Y;
00117     sb += "\nContact: " + currentPoint->IsInContact + "\n";
00118     return sb;
00119 }
00120
00121 Platform::String^ Scenario2::GetDeviceSpecificProperties(Windows::UI::Input::PointerPoint^ currentPoint)
00122 {
00123     Platform::String^ deviceSpecificProperties = "";
00124
00125     // Detect the type of device being used by examining PointerDeviceType
00126     // to distinguish between mouse, touch, and pen
00127     switch (currentPoint->PointerDevice->PointerDeviceType)
00128     {
00129     case Windows::Devices::Input::PointerDeviceType::Mouse:
00130         deviceSpecificProperties = GetMouseProperties(currentPoint);
00131         break;
00132     case Windows::Devices::Input::PointerDeviceType::Pen:
00133         deviceSpecificProperties = GetPenProperties(currentPoint);
00134         break;
00135     case Windows::Devices::Input::PointerDeviceType::Touch:
00136         deviceSpecificProperties = GetTouchProperties(currentPoint);
00137         break;
00138     }
00139
00140     return deviceSpecificProperties;
00141 }
00142
00143 // Return the properties that are specific to mice
00144 Platform::String^ Scenario2::GetMouseProperties(Windows::UI::Input::PointerPoint^ currentPoint)
00145 {
00146     Windows::UI::Input::PointerPointProperties^ pointerProperties = currentPoint->Properties;
00147     Platform::String^ sb = ref new Platform::String();
00148
00149     sb += "Left button: " + pointerProperties->IsLeftButtonPressed;
00150     sb += "\nRight button: " + pointerProperties->IsRightButtonPressed;
00151     sb += "\nMiddle button: " + pointerProperties->IsMiddleButtonPressed;
00152     sb += "\nX1 button: " + pointerProperties->IsXButton1Pressed;
00153     sb += "\nX2 button: " + pointerProperties->IsXButton2Pressed;
00154     sb += "\nMouse wheel delta: " + pointerProperties->MouseWheelDelta;
00155
00156     return sb;
00157 }
00158
00159 // Return the properties that are specific to touch
00160 Platform::String^ Scenario2::GetTouchProperties(Windows::UI::Input::PointerPoint^ currentPoint)
00161 {
00162     Windows::UI::Input::PointerPointProperties^ pointerProperties = currentPoint->Properties;
00163     Platform::String^ sb = ref new Platform::String();
00164
00165     sb += "Contact Rect X: " + pointerProperties->ContactRect.X;
00166     sb += "\nContact Rect Y: " + pointerProperties->ContactRect.Y;
00167     sb += "\nContact Rect Width: " + pointerProperties->ContactRect.Width;
00168     sb += "\nContact Rect Height: " + pointerProperties->ContactRect.Height;
00169
00170     return sb;
00171 }
00172
00173 // Return the properties that are specific to pen
00174 Platform::String^ Scenario2::GetPenProperties(Windows::UI::Input::PointerPoint^ currentPoint)
00175 {
00176     Windows::UI::Input::PointerPointProperties^ pointerProperties = currentPoint->Properties;
00177     Platform::String^ sb = ref new Platform::String();
00178
00179     sb += "Barrel button: " + pointerProperties->IsBarrelButtonPressed;
00180     sb += "\nEraser: " + pointerProperties->IsEraser;
00181     sb += "\nPressure: " + pointerProperties->Pressure;
00182
00183     return sb;
00184 }
00185
00186 //
00187 // Popup UI code below
00188 //
00189 void Scenario2::RenderPropertyPopUp(Platform::String^ pointerProperties, Platform::String^ deviceSpecificProperties, Windows::UI::Input::PointerPoint^ currentPoint)
00190 {
00191     auto it = popups.find(currentPoint->PointerId);
00192     if (it != popups.end())
00193     {
00194         auto tb = dynamic_cast<StackPanel^>(it->second);
00195         TextBlock^ pointerText = dynamic_cast<TextBlock^>(tb->Children->GetAt(0));
00196         pointerText->Text = pointerProperties;
00197         TextBlock^ deviceSpecificText = dynamic_cast<TextBlock^>(tb->Children->GetAt(1));
00198         deviceSpecificText->Text = deviceSpecificProperties;
00199     }
00200     else
00201     {
00202         StackPanel^ pointerPanel = ref new StackPanel();
00203         TextBlock^ pointerText = ref new TextBlock();
00204         pointerText->Text = pointerProperties;
00205         pointerPanel->Children->Append(pointerText);
00206
00207         TextBlock^ deviceSpecificText = ref new TextBlock();
00208         deviceSpecificText->Text = deviceSpecificProperties;
00209
00210         // Detect the type of device being used by examining PointerDeviceType
00211         // to distinguish between mouse, touch, and pen
00212         switch (currentPoint->PointerDevice->PointerDeviceType)
00213         {
00214         case Windows::Devices::Input::PointerDeviceType::Mouse:
00215             deviceSpecificText->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Red);
00216             break;
00217
00218         case Windows::Devices::Input::PointerDeviceType::Touch:
00219             deviceSpecificText->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Green);
00220             break;
00221
00222         case Windows::Devices::Input::PointerDeviceType::Pen:
00223             deviceSpecificText->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Yellow);
00224             break;
00225         }
00226         pointerPanel->Children->Append(deviceSpecificText);
00227         popups[currentPoint->PointerId] = pointerPanel;
00228         mainCanvas->Children->Append(popups[currentPoint->PointerId]);
00229     }
00230
00231     TranslateTransform^ transform = ref new TranslateTransform();
00232     transform->X = currentPoint->Position.X + 24;
00233     transform->Y = currentPoint->Position.Y + 24;
00234     popups[currentPoint->PointerId]->RenderTransform = transform;
00235 }
00236
00237 void Scenario2::HidePropertyPopUp(Windows::UI::Input::PointerPoint^ currentPoint)
00238 {
00239     auto it = popups.find(currentPoint->PointerId);
00240     if (it != popups.end())
00241     {
00242         auto stackPanel = dynamic_cast<StackPanel^>(it->second);
00243         unsigned int index;
00244         mainCanvas->Children->IndexOf(stackPanel, &index);
00245         mainCanvas->Children->RemoveAt(index);
00246         popups.erase(it);
00247     }
00248 }
Generated on Fri Nov 15 2024 22:18:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/pch.cpp Source File

  • LineDisplay
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario3_CustomException.xaml.cpp Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario3_CustomException.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario3_CustomException.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKSample;
00013 using namespace SDKSample::ProxyStubsForWinRTComponents;
00014
00015 using namespace Microsoft::SDKSamples::Kitchen;
00016
00017 using namespace Windows::UI::Xaml;
00018 using namespace Windows::UI::Xaml::Controls;
00019
00020 CustomException::CustomException()
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void ProxyStubsForWinRTComponents::CustomException::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     // Component Creation
00028     Oven^ myOven = ref new Oven();
00029
00030     try
00031     {
00032         // Intentionally pass an invalid value
00033         myOven->ConfigurePreheatTemperature(static_cast<Microsoft::SDKSamples::Kitchen::OvenTemperature>(5));
00034     }
00035     catch (Platform::InvalidArgumentException^ e)
00036     {
00037         CustomExceptionOutput->Text += L"Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00038     }
00039 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IEmployee Member List

This is the complete list of members for IEmployee, including all inherited members.
DirectManager | IEmployee
FirstName | IEmployee
FullName() | IEmployee
FullName() | IEmployee
IsManager | IEmployee
LastName | IEmployee
Name | IEmployee
NullImageSource | IEmployee
NullStringProperty | IEmployee
Poke(object sender, RoutedEventArgs e) | IEmployee
Poke(object sender, RoutedEventArgs e) | IEmployee
Title | IEmployee
Visibility | IEmployee
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cs/SampleConfiguration.cs Source File

  • UserInteractionMode
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "User interaction mode";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Responding to mode", ClassType=typeof(Scenario1_Basic)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/Properties/AssemblyInfo.cs Source File

  • AppServices
  • cs
  • RandomNumberService
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("RandomNumberService")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("RandomNumberService")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SingleAzureADScenario.xaml.cs Source File

  • WebAccountManagement
  • cs

SingleAzureADScenario.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.ApplicationSettings;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Security.Credentials;
00018 using Windows.Security.Authentication.Web.Core;
00019 using System;
00020 using Windows.Storage;
00021 using System.Threading.Tasks;
00022 using Windows.UI.Popups;
00023
00024 namespace Accounts
00025 {
00026     public sealed partial class SingleAzureADScenario : Page
00027     {
00028         private MainPage rootPage;
00029
00030         // To obtain Microsoft account tokens, you must register your application online
00031         // Then, you must associate the app with the store.
00032         const string MicrosoftAccountProviderId = "https://login.microsoft.com";
00033         const string AzureADAuthority = "organizations";
00034         const string AccountScopeRequested = "";
00035         const string AccountClientId = "";
00036         const string StoredAccountKey = "azureaccountid";
00037
00038         public SingleAzureADScenario()
00039         {
00040             this.InitializeComponent();
00041         }
00042
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045             rootPage = MainPage.Current;
00046
00047             // The AccountCommandsRequested event triggers before the Accounts settings pane is displayed
00048             AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;
00049
00050             IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AccountClientId);
00051         }
00052
00053         protected override void OnNavigatedFrom(NavigationEventArgs e)
00054         {
00055             AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
00056         }
00057
00058
00059         private void Button_ShowAccountSettings(object sender, RoutedEventArgs e)
00060         {
00061             ((Button)sender).IsEnabled = false;
00062
00063             rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);
00064
00065             AccountsSettingsPane.Show();
00066
00067             ((Button)sender).IsEnabled = true;
00068         }
00069
00070         private async void Button_Reset(object sender, RoutedEventArgs e)
00071         {
00072             ((Button)sender).IsEnabled = false;
00073
00074             rootPage.NotifyUser("Resetting...", NotifyType.StatusMessage);
00075
00076             await LogoffAndRemoveAccount();
00077
00078             ((Button)sender).IsEnabled = true;
00079
00080         }
00081
00082
00083         // This event handler is called when the Account settings pane is to be launched.
00084         private async void OnAccountCommandsRequested(
00085             AccountsSettingsPane sender,
00086             AccountsSettingsPaneCommandsRequestedEventArgs e)
00087         {
00088             // In order to make async calls within this callback, the deferral object is needed
00089             AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();
00090
00091             // This scenario only lets the user have one account at a time.
00092             // If there already is an account, we do not include a provider in the list
00093             // This will prevent the add account button from showing up.
00094             bool isPresent = ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey);
00095
00096             if (isPresent)
00097             {
00098                 await AddWebAccount(e);
00099             }
00100             else
00101             {
00102                 await AddWebAccountProvider(e);
00103             }
00104
00105             AddLinksAndDescription(e);
00106
00107             deferral.Complete();
00108         }
00109
00110
00111         private async Task AddWebAccountProvider(AccountsSettingsPaneCommandsRequestedEventArgs e)
00112         {
00113             // FindAccountProviderAsync returns the WebAccountProvider of an installed plugin
00114             // The Provider and Authority specifies the specific plugin
00115             // This scenario only supports Microsoft accounts.
00116
00117             // The Microsoft account provider is always present in Windows 10 devices, as is the Azure AD plugin.
00118             // If a non-installed plugin or incorect identity is specified, FindAccountProviderAsync will return null
00119             WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);
00120
00121             WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
00122             e.WebAccountProviderCommands.Add(providerCommand);
00123         }
00124
00125         private async Task AddWebAccount(AccountsSettingsPaneCommandsRequestedEventArgs e)
00126         {
00127             WebAccountProvider provider = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);
00128
00129             String accountID = (String)ApplicationData.Current.LocalSettings.Values[StoredAccountKey];
00130             WebAccount account = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);
00131
00132             if (account == null)
00133             {
00134                 // The account has most likely been deleted in Windows settings
00135                 // Unless there would be significant data loss, you should just delete the account
00136                 // If there would be significant data loss, prompt the user to either re-add the account, or to remove it
00137                 ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);
00138             }
00139
00140             WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove);
00141             e.WebAccountCommands.Add(command);
00142         }
00143
00144         private void AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs e)
00145         {
00146             e.HeaderText = "Describe what adding an account to your application will do for the user";
00147
00148             // You can add links such as privacy policy, help, general account settings
00149             e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
00150             e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
00151         }
00152
00153         private async void WebAccountProviderCommandInvoked(WebAccountProviderCommand command)
00154         {
00155             await RequestTokenAndSaveAccount(command.WebAccountProvider, AccountScopeRequested, AccountClientId);
00156         }
00157
00158         private async void WebAccountInvoked(WebAccountCommand command, WebAccountInvokedArgs args)
00159         {
00160             if (args.Action == WebAccountAction.Remove)
00161             {
00162                 rootPage.NotifyUser("Removing account", NotifyType.StatusMessage);
00163                 await LogoffAndRemoveAccount();
00164             }
00165         }
00166
00167         private void PrivacyPolicyInvoked(IUICommand command)
00168         {
00169             rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
00170         }
00171
00172         private void OtherLinkInvoked(IUICommand command)
00173         {
00174             rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
00175         }
00176
00177         private async Task RequestTokenAndSaveAccount(WebAccountProvider Provider, String Scope, String ClientID)
00178         {
00179             try
00180             {
00181                 WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);
00182
00183                 webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
00184
00185                 rootPage.NotifyUser("Requesting Web Token", NotifyType.StatusMessage);
00186
00187                 // If the user selected a specific account, RequestTokenAsync will return a token for that account.
00188                 // The user may be prompted for credentials or to authorize using that account with your app
00189                 // If the user selected a provider, the user will be prompted for credentials to login to a new account
00190                 WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);
00191
00192                 // If a token was successfully returned, then store the WebAccount Id into local app data
00193                 // This Id can be used to retrieve the account whenever needed. To later get a token with that account
00194                 // First retrieve the account with FindAccountAsync, and include that webaccount
00195                 // as a parameter to RequestTokenAsync or RequestTokenSilentlyAsync
00196                 if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
00197                 {
00198                     ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);
00199
00200                     ApplicationData.Current.LocalSettings.Values[StoredAccountKey] = webTokenRequestResult.ResponseData[0].WebAccount.Id;
00201                 }
00202
00203                 OutputTokenResult(webTokenRequestResult);
00204             }
00205             catch (Exception ex)
00206             {
00207                 rootPage.NotifyUser("Web Token request failed: " + ex.Message, NotifyType.ErrorMessage);
00208             }
00209         }
00210
00211         private void OutputTokenResult(WebTokenRequestResult result)
00212         {
00213             if (result.ResponseStatus == WebTokenRequestStatus.Success)
00214             {
00215                 rootPage.NotifyUser("Web Token request successful for user: " + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
00216                 SignInButton.Content = "Account";
00217             }
00218             else
00219             {
00220                 rootPage.NotifyUser("Web Token request error: " + result.ResponseError, NotifyType.StatusMessage);
00221             }
00222         }
00223
00224         private async Task LogoffAndRemoveAccount()
00225         {
00226             if (ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountKey))
00227             {
00228                 WebAccountProvider providertoDelete = await WebAuthenticationCoreManager.FindAccountProviderAsync(MicrosoftAccountProviderId, AzureADAuthority);
00229
00230                 WebAccount accountToDelete = await WebAuthenticationCoreManager.FindAccountAsync(providertoDelete, (string)ApplicationData.Current.LocalSettings.Values[StoredAccountKey]);
00231
00232                 if(accountToDelete != null)
00233                 {
00234                     await accountToDelete.SignOutAsync();
00235                 }
00236
00237                 ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountKey);
00238
00239                 SignInButton.Content = "Sign in";
00240             }
00241         }
00242     }
00243 }
Generated on Fri Nov 15 2024 22:21:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PageDescription Member List

This is the complete list of members for PageDescription, including all inherited members.
Equals(PageDescription other) | PageDescription | [inline]
IsContentCropped | PageDescription |
Margin | PageDescription |
PageSize | PageDescription |
PictureViewSize | PageDescription |
ViewablePageSize | PageDescription |
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/SampleConfiguration.h Source File

  • DisplayOrientation
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Display orientation";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cs/Scenario1.xaml.cs Source File

  • Compression
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using Windows.UI.ViewManagement;
00015 using Windows.Storage;
00016 using Windows.Storage.Streams;
00017 using Windows.Storage.Pickers;
00018 using Windows.Storage.Compression;
00019 using Windows.ApplicationModel.Activation;
00020
00021 using System;
00022 using System.Collections.Generic;
00023 using System.Diagnostics;
00024
00025 using SDKTemplate;
00026 using Windows.UI.Xaml.Data;
00027 using System.Linq;
00028
00029 namespace Compression
00030 {
00031     /// <summary>
00032     /// An empty page that can be used on its own or navigated to within a Frame.
00033     /// </summary>
00034
00035 #if WINDOWS_PHONE_APP
00036     public sealed partial class Scenario1 : Page, IFileOpenPickerContinuable
00037 #else
00038     public sealed partial class Scenario1 : Page
00039 #endif
00040     {
00041         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00042         // as NotifyUser()
00043         MainPage rootPage = MainPage.Current;
00044
00045         public Scenario1()
00046         {
00047             this.InitializeComponent();
00048         }
00049
00050         /// <summary>
00051         /// Invoked when this page is about to be displayed in a Frame.
00052         /// </summary>
00053         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00054         /// property is typically used to configure the page.</param>
00055
00056 #if WINDOWS_PHONE_APP
00057
00058         private void ShowFileOpen(CompressAlgorithm? Algorithm)
00059         {
00060             var picker = new FileOpenPicker();
00061
00062             picker.FileTypeFilter.Add("*");
00063
00064             picker.ContinuationData["Operation"] = "CompressFile";
00065             picker.ContinuationData["CompressAlgorithm"] = Algorithm.ToString();
00066
00067             picker.PickSingleFileAndContinue();
00068         }
00069
00070         public void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
00071         {
00072             if ((args.ContinuationData["Operation"] as string) == "CompressFile" &&
00073                 args.Files != null &&
00074                 args.Files.Count > 0)
00075             {
00076                 StorageFile file = args.Files[0];
00077                 string algorithmRaw = args.ContinuationData["CompressAlgorithm"] as string;
00078
00079                 CompressAlgorithm? Algorithm;
00080
00081                 if (algorithmRaw == "")
00082                 {
00083                     Algorithm = null;
00084                 }
00085                 else
00086                 {
00087                     Algorithm = (CompressAlgorithm?)Enum.Parse(typeof(CompressAlgorithm), algorithmRaw);
00088                 }
00089
00090                 CompressFile(Algorithm, file);
00091             }
00092         }
00093 #endif
00094         private async void CompressFile(CompressAlgorithm? Algorithm, StorageFile originalFile)
00095         {
00096             Progress.Text = "";
00097
00098             try
00099             {
00100                 Progress.Text += String.Format("\"{0}\" has been picked\n", originalFile.Name);
00101
00102                 var compressedFilename = originalFile.Name + ".compressed";
00103                 var compressedFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(compressedFilename, CreationCollisionOption.GenerateUniqueName);
00104                 Progress.Text += String.Format("\"{0}\" has been created to store compressed data\n", compressedFile.Path);
00105
00106                 // ** DO COMPRESSION **
00107                 // Following code actually performs compression from original file to the newly created
00108                 // compressed file. In order to do so it:
00109                 // 1. Opens input for the original file.
00110                 // 2. Opens output stream on the file to be compressed and wraps it into Compressor object.
00111                 // 3. Copies original stream into Compressor wrapper.
00112                 // 4. Finalizes compressor - it puts termination mark into stream and flushes all intermediate
00113                 //    buffers.
00114                 using (var originalInput = await originalFile.OpenReadAsync())
00115                 using (var compressedOutput = await compressedFile.OpenAsync(FileAccessMode.ReadWrite))
00116                 using (var compressor = !Algorithm.HasValue ?
00117                     new Compressor(compressedOutput.GetOutputStreamAt(0)) :
00118                     new Compressor(compressedOutput.GetOutputStreamAt(0), Algorithm.Value, 0))
00119                 {
00120                     Progress.Text += "All streams wired for compression\n";
00121                     var bytesCompressed = await RandomAccessStream.CopyAsync(originalInput, compressor);
00122                     var finished = await compressor.FinishAsync();
00123                     Progress.Text += String.Format("Compressed {0} bytes into {1}\n", bytesCompressed, compressedOutput.Size);
00124                 }
00125
00126                 var decompressedFilename = originalFile.Name + ".decompressed";
00127                 var decompressedFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(decompressedFilename, CreationCollisionOption.GenerateUniqueName);
00128                 Progress.Text += String.Format("\"{0}\" has been created to store decompressed data\n", decompressedFile.Path);
00129
00130                 // ** DO DECOMPRESSION **
00131                 // Following code performs decompression from the just compressed file to the
00132                 // decompressed file. In order to do so it:
00133                 // 1. Opens input stream on compressed file and wraps it into Decompressor object.
00134                 // 2. Opens output stream from the file that will store decompressed data.
00135                 // 3. Copies data from Decompressor stream into decompressed file stream.
00136                 using (var compressedInput = await compressedFile.OpenSequentialReadAsync())
00137                 using (var decompressor = new Decompressor(compressedInput))
00138                 using (var decompressedOutput = await decompressedFile.OpenAsync(FileAccessMode.ReadWrite))
00139                 {
00140                     Progress.Text += "All streams wired for decompression\n";
00141                     var bytesDecompressed = await RandomAccessStream.CopyAsync(decompressor, decompressedOutput);
00142                     Progress.Text += String.Format("Decompressed {0} bytes of data\n", bytesDecompressed);
00143                 }
00144
00145                 rootPage.NotifyUser("All done", NotifyType.StatusMessage);
00146             }
00147             catch (Exception ex)
00148             {
00149                 rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00150             }
00151         }
00152
00153         /// <summary>
00154         /// This is the main scenario worker.
00155         /// </summary>
00156         /// <param name="Algorithm">
00157         /// Comression algorithm to use. If no value is provided compressor will be created using
00158         /// Compressor(IInputStream) constructor, otherwise extended version will be used:
00159         /// Compressor(IInputStream, CompressAlgorithm, uint)
00160         /// </param>
00161 #if WINDOWS_PHONE_APP
00162         private void DoScenario(CompressAlgorithm? Algorithm)
00163 #else
00164         private async void DoScenario(CompressAlgorithm? Algorithm)
00165 #endif
00166         {
00167             try
00168             {
00169                 rootPage.NotifyUser("Working...", NotifyType.StatusMessage);
00170
00171 #if WINDOWS_PHONE_APP
00172                 ShowFileOpen(Algorithm);
00173 #else
00174                 StorageFile originalFile;
00175
00176                 var picker = new FileOpenPicker();
00177
00178                 picker.FileTypeFilter.Add("*");
00179
00180                 originalFile = await picker.PickSingleFileAsync();
00181                 if (originalFile == null)
00182                 {
00183                     throw new OperationCanceledException("No file has been selected");
00184                 }
00185
00186                 CompressFile(Algorithm, originalFile);
00187 #endif
00188             }
00189             catch (Exception ex)
00190             {
00191                 rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00192             }
00193         }
00194
00195         private void CompressAlgorithmComboBox_SelectionChanged(object sender, RoutedEventArgs e)
00196         {
00197             var args = e as SelectionChangedEventArgs;
00198
00199             if (args == null)
00200             {
00201                 return;
00202             }
00203             if (CompressAlgorithmComboBox == null)
00204             {
00205                 return;
00206             }
00207
00208             if (args.AddedItems.Count != 0 && args.RemovedItems.Count == 0)
00209             {
00210                 ComboBoxItem addedItem = args.AddedItems[0] as ComboBoxItem;
00211                 if (addedItem.Content.Equals("Default"))
00212                 {
00213                     UpdateDescriptionVisibility(addedItem, Visibility.Visible);
00214                 }
00215
00216                 return;
00217             }
00218             else
00219             {
00220                 Debug.Assert(1 == args.AddedItems.Count && 1 == args.RemovedItems.Count);
00221
00222                 ComboBoxItem addedItem = args.AddedItems[0] as ComboBoxItem;
00223                 ComboBoxItem removedItem = args.RemovedItems[0] as ComboBoxItem;
00224
00225                 Debug.Assert(null != addedItem && null != removedItem);
00226
00227                 UpdateDescriptionVisibility(addedItem, Visibility.Visible);
00228                 UpdateDescriptionVisibility(removedItem, Visibility.Collapsed);
00229             }
00230         }
00231
00232         private CompressAlgorithm? CompressAlgorithmFromComboBoxItem(ComboBoxItem item)
00233         {
00234             CompressAlgorithm? Algorithm = null;
00235
00236             if (item == DefaultComboBoxItem)
00237             {
00238                 Algorithm = null;
00239             }
00240             else if (item == XpressComboBoxItem)
00241             {
00242                 Algorithm = CompressAlgorithm.Xpress;
00243             }
00244             else if (item == XpressHuffComboBoxItem)
00245             {
00246                 Algorithm = CompressAlgorithm.XpressHuff;
00247             }
00248             else if (item == MszipComboBoxItem)
00249             {
00250                 Algorithm = CompressAlgorithm.Mszip;
00251             }
00252             else if (item == LzmsComboBoxItem)
00253             {
00254                 Algorithm = CompressAlgorithm.Lzms;
00255             }
00256             else
00257             {
00258                 Algorithm = CompressAlgorithm.InvalidAlgorithm;
00259             }
00260
00261             return Algorithm;
00262         }
00263
00264         private void UpdateDescriptionVisibility(ComboBoxItem item, Visibility visibility)
00265         {
00266             TextBlock textBlock = null;
00267
00268             CompressAlgorithm? Algorithm = CompressAlgorithmFromComboBoxItem(item);
00269
00270             switch (Algorithm)
00271             {
00272             case null:
00273                 textBlock = DefaultTextBlock;
00274                 break;
00275             case CompressAlgorithm.Xpress:
00276                 textBlock = XpressTextBlock;
00277                 break;
00278             case CompressAlgorithm.XpressHuff:
00279                 textBlock = XpressHuffTextBlock;
00280                 break;
00281             case CompressAlgorithm.Mszip:
00282                 textBlock = MszipTextBlock;
00283                 break;
00284             case CompressAlgorithm.Lzms:
00285                 textBlock = LzmsTextBlock;
00286                 break;
00287             default:
00288                 return;
00289             }
00290
00291             textBlock.Visibility = visibility;
00292         }
00293
00294         private void CompressFileButton_Click(object sender, RoutedEventArgs e)
00295         {
00296             ComboBoxItem item = CompressAlgorithmComboBox.SelectedItem as ComboBoxItem;
00297
00298             if (item == null)
00299             {
00300                 return;
00301             }
00302
00303             CompressAlgorithm? Algorithm = CompressAlgorithmFromComboBoxItem(item);
00304
00305             if (Algorithm == CompressAlgorithm.InvalidAlgorithm)
00306             {
00307                 return;
00308             }
00309
00310             DoScenario(Algorithm);
00311         }
00312     }
00313 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/pch.cpp Source File

  • SimpleCommunication
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/Helpers.cs Source File

  • ContentIndexer
  • cs

Helpers.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006
00007 namespace SDKTemplate
00008 {
00009     class Helpers
00010     {
00011         public static void InitializeRevisionNumber()
00012         {
00013             // This initializes the value used throughout the sample which tracks the expected index revision number. This
00014             // value is used to check if the app's expected revision number matches the actual index revision number and is
00015             // stored in the app's local settings to allow it to persist across termination.
00016             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
00017             if (!localSettings.Values.ContainsKey("expectedIndexRevision"))
00018             {
00019                 localSettings.Values.Add("expectedIndexRevision", (ulong)0);
00020             }
00021         }
00022
00023         public static void OnIndexerOperationBegin()
00024         {
00025             // Update the expected index revision number in expectation of the call that's about to be made
00026             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
00027             var revisionNumber = localSettings.Values["expectedIndexRevision"];
00028             localSettings.Values["expectedIndexRevision"] = (ulong)((ulong)revisionNumber + 1);
00029         }
00030
00031         public static void OnIndexerOperationComplete(Windows.Storage.Search.ContentIndexer indexer)
00032         {
00033             // Set the expectedIndexRevision to be the reported index revision number because the operation
00034             // has succeeded
00035             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
00036             localSettings.Values["expectedIndexRevision"] = indexer.Revision;
00037         }
00038
00039         /// <summary>
00040         /// This function takes a string or vector string property value and returns a flattened string representation of it.
00041         /// </summary>
00042         public static string StringifyProperty(object property)
00043         {
00044             string propertyString = "";
00045             if (property != null)
00046             {
00047                 var vectorProperty = property as IEnumerable<string>;
00048                 if (vectorProperty != null)
00049                 {
00050                     foreach (var prop in vectorProperty)
00051                     {
00052                         propertyString += prop + "; ";
00053                     }
00054                 }
00055                 else
00056                 {
00057                     propertyString = property.ToString();
00058                 }
00059             }
00060             return propertyString;
00061         }
00062
00063         public static string CreateItemString(string itemKey, IEnumerable<string> propertyKeys, IReadOnlyDictionary<string, object> properties)
00064         {
00065             string itemString = "Key: " + itemKey + "\n";
00066             foreach (var propertyKey in propertyKeys)
00067             {
00068                 itemString += propertyKey + ": " + StringifyProperty(properties[propertyKey]) + "\n";
00069             }
00070             return itemString;
00071         }
00072
00073         public static string CreateItemString(string itemKey, IEnumerable<string> propertyKeys, IDictionary<string, object> properties)
00074         {
00075             string itemString = "Key: " + itemKey + "\n";
00076             foreach (var propertyKey in propertyKeys)
00077             {
00078                 itemString += propertyKey + ": " + StringifyProperty(properties[propertyKey]) + "\n";
00079             }
00080             return itemString;
00081         }
00082
00083         /// <summary>
00084         /// This function inserts three items into the index with generic Key, Name, Keywords, and Comment properties.
00085         /// </summary>
00086         public async static Task<string> AddItemsToIndex(Windows.Storage.Search.ContentIndexer indexer)
00087         {
00088             var content = new Windows.Storage.Search.IndexableContent();
00089             const int numberOfItemsToIndex = 3;
00090             for (int i = 0; i < numberOfItemsToIndex; i++)
00091             {
00092                 content.Properties[Windows.Storage.SystemProperties.ItemNameDisplay] = "Sample Item Name " + i;
00093                 content.Properties[Windows.Storage.SystemProperties.Keywords] = "Sample keyword " + i;
00094                 content.Properties[Windows.Storage.SystemProperties.Comment] = "Sample comment " + i;
00095                 content.Id = "SampleKey" + i;
00096                 OnIndexerOperationBegin();
00097                 await indexer.AddAsync(content);
00098                 OnIndexerOperationComplete(indexer);
00099             }
00100             string[] propertiesToQuery =
00101             {
00102                 Windows.Storage.SystemProperties.ItemNameDisplay,
00103                 Windows.Storage.SystemProperties.Keywords,
00104                 Windows.Storage.SystemProperties.Comment
00105             };
00106             var query = indexer.CreateQuery("*", propertiesToQuery);
00107             uint count = await query.GetCountAsync();
00108             return "Number of items currently in the index: " + count;
00109         }
00110
00111         /// <summary>
00112         /// For the purposes of this sample, the appcontent-ms files are stored in an "appcontent-ms" folder in the
00113         /// install directory. These are then copied into the app's "LocalState\Indexed" folder, which exposes them
00114         /// to the indexer.
00115         /// </summary>
00116         public async static Task<string> AddAppContentFilesToIndexedFolder()
00117         {
00118             var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00119             var installDirectory = Windows.ApplicationModel.Package.Current.InstalledLocation;
00120             var outputString = "Items added to the \"Indexed\" folder:";
00121             var appContentFolder = await installDirectory.GetFolderAsync("appcontent-ms");
00122             var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
00123             var files = await appContentFolder.GetFilesAsync();
00124             foreach (var file in files)
00125             {
00126                 outputString += "\n" + file.DisplayName + file.FileType;
00127                 await file.CopyAsync(indexedFolder, file.Name, Windows.Storage.NameCollisionOption.ReplaceExisting);
00128             }
00129             return outputString;
00130         }
00131     }
00132 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_BasicUserActivity Member List

This is the complete list of members for Scenario1_BasicUserActivity, including all inherited members.
_currentSession | Scenario1_BasicUserActivity | [private]
CreateUserActivityAsync() | Scenario1_BasicUserActivity | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_BasicUserActivity | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_BasicUserActivity | [inline, protected]
Scenario1_BasicUserActivity() | Scenario1_BasicUserActivity | [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/Server/SampleConfiguration.cs Source File

  • SocketActivityStreamSocket
  • cs
  • Server

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using StreamSocketListenerServer;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "StreamSocketListenerServer";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Send data to connected client", ClassType=typeof(Scenario1_Send)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Scenario1_Configure.cpp Source File

  • LockScreenApps
  • cppwinrt

Scenario1_Configure.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Configure.h"
00014 #include "Scenario1_Configure.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::System;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario1_Configure::Scenario1_Configure()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     fire_and_forget Scenario1_Configure::OpenAppSettings(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         co_await Launcher::LaunchUriAsync(Uri(L"ms-settings:appsfeatures-app"));
00031     }
00032
00033     fire_and_forget Scenario1_Configure::OpenLockscreenSettings(IInspectable const&, RoutedEventArgs const&)
00034     {
00035         co_await Launcher::LaunchUriAsync(Uri(L"ms-settings:lockscreen"));
00036     }
00037 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario9.xaml.h Source File

  • MapControl
  • cpp

Scenario9.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario9.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario9 sealed
00021     {
00022     public:
00023         Scenario9();
00024     private:
00025         MainPage^ rootPage = MainPage::Current;
00026
00027         void SetMapStyleSheet();
00028
00029         void MyMap_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void SetDefaultStyleCombobox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:20:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WASAPICapture Member List

This is the complete list of members for WASAPICapture, including all inherited members.
ActivateCompleted(IActivateAudioInterfaceAsyncOperation *operation) | WASAPICapture |
CreateWAVFile() | WASAPICapture | [private]
FinishCaptureAsync() | WASAPICapture |
FixWAVHeader() | WASAPICapture | [private]
GetDeviceStateEvent() | WASAPICapture | [inline]
InitializeAudioDeviceAsync() | WASAPICapture |
InitializeScopeData() | WASAPICapture | [private]
m_AudioCaptureClient | WASAPICapture | [private]
m_AudioClient | WASAPICapture | [private]
m_BufferFrames | WASAPICapture | [private]
m_cbDataSize | WASAPICapture | [private]
m_cbFlushCounter | WASAPICapture | [private]
m_cbHeaderSize | WASAPICapture | [private]
m_ContentStream | WASAPICapture | [private]
m_cPlotDataFilled | WASAPICapture | [private]
m_cPlotDataMax | WASAPICapture | [private]
m_CritSec | WASAPICapture | [private]
m_DefaultPeriodInFrames | WASAPICapture | [private]
m_DeviceIdString | WASAPICapture | [private]
m_DeviceProps | WASAPICapture | [private]
m_DeviceStateChanged | WASAPICapture | [private]
m_dwQueueID | WASAPICapture | [private]
m_FundamentalPeriodInFrames | WASAPICapture | [private]
m_fWriting | WASAPICapture | [private]
m_MaxPeriodInFrames | WASAPICapture | [private]
m_MinPeriodInFrames | WASAPICapture | [private]
m_MixFormat | WASAPICapture | [private]
m_OutputStream | WASAPICapture | [private]
m_PlotData | WASAPICapture | [private]
m_SampleReadyAsyncResult | WASAPICapture | [private]
m_SampleReadyEvent | WASAPICapture | [private]
m_SampleReadyKey | WASAPICapture | [private]
m_WAVDataWriter | WASAPICapture | [private]
METHODASYNCCALLBACK(WASAPICapture, StartCapture, OnStartCapture) | WASAPICapture |
METHODASYNCCALLBACK(WASAPICapture, StopCapture, OnStopCapture) | WASAPICapture |
METHODASYNCCALLBACK(WASAPICapture, SampleReady, OnSampleReady) | WASAPICapture |
METHODASYNCCALLBACK(WASAPICapture, FinishCapture, OnFinishCapture) | WASAPICapture |
METHODASYNCCALLBACK(WASAPICapture, SendScopeData, OnSendScopeData) | WASAPICapture |
OnAudioSampleRequested(Platform::Boolean IsSilence=false) | WASAPICapture | [private]
OnFinishCapture(IMFAsyncResult *pResult) | WASAPICapture | [private]
OnSampleReady(IMFAsyncResult *pResult) | WASAPICapture | [private]
OnSendScopeData(IMFAsyncResult *pResult) | WASAPICapture | [private]
OnStartCapture(IMFAsyncResult *pResult) | WASAPICapture | [private]
OnStopCapture(IMFAsyncResult *pResult) | WASAPICapture | [private]
ProcessScopeData(BYTE *pData, DWORD cbBytes) | WASAPICapture | [private]
SetProperties(CAPTUREDEVICEPROPS props) | WASAPICapture |
StartCaptureAsync() | WASAPICapture |
StopCaptureAsync() | WASAPICapture |
WASAPICapture() | WASAPICapture |
~WASAPICapture() | WASAPICapture | [private]
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/SampleConfiguration.cpp Source File

  • CredentialPicker
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Message", "SDKTemplate.Scenario1_Message" },
00012     { "Message+Caption", "SDKTemplate.Scenario2_MessageCaption" },
00013     { "CredentialPickerOptions", "SDKTemplate.Scenario3_CredentialPickerOptions" }
00014 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ServerForeground Member List

This is the complete list of members for Scenario3_ServerForeground, including all inherited members.
Add enum value | Scenario3_ServerForeground | [private]
CalculatorCharacteristics enum name | Scenario3_ServerForeground | [private]
CalculatorOperators enum name | Scenario3_ServerForeground | [private]
CheckPeripheralRoleSupportAsync() | Scenario3_ServerForeground | [private, static]
ComputeResult() | Scenario3_ServerForeground | [private]
Divide enum value | Scenario3_ServerForeground | [private]
IsValidOperator(CalculatorOperators op) | Scenario3_ServerForeground | [inline, private]
Multiply enum value | Scenario3_ServerForeground | [private]
NotifyClientDevices(int computedValue) | Scenario3_ServerForeground | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3_ServerForeground |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3_ServerForeground |
Op1Characteristic_WriteRequestedAsync(Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [private]
op1CharacteristicWriteToken | Scenario3_ServerForeground | [private]
Op2Characteristic_WriteRequestedAsync(Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [private]
op2CharacteristicWriteToken | Scenario3_ServerForeground | [private]
Operand1 enum value | Scenario3_ServerForeground | [private]
operand1Received | Scenario3_ServerForeground | [private]
Operand2 enum value | Scenario3_ServerForeground | [private]
operand2Received | Scenario3_ServerForeground | [private]
Operator enum value | Scenario3_ServerForeground | [private]
OperatorCharacteristic_WriteRequestedAsync(Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequestedEventArgs args) | Scenario3_ServerForeground | [private]
operatorCharacteristicWriteToken | Scenario3_ServerForeground | [private]
operatorReceived | Scenario3_ServerForeground | [private]
peripheralSupported | Scenario3_ServerForeground | [private]
ProcessWriteCharacteristic(Windows::Devices::Bluetooth::GenericAttributeProfile::GattWriteRequest const &request, CalculatorCharacteristics opCode) | Scenario3_ServerForeground | [private]
PublishButton_ClickAsync() | Scenario3_ServerForeground |
ResultCharacteristic_ReadRequestedAsync(Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattReadRequestedEventArgs args) | Scenario3_ServerForeground | [private]
ResultCharacteristic_SubscribedClientsChanged(Windows::Devices::Bluetooth::GenericAttributeProfile::GattLocalCharacteristic const &sender, IInspectable const &args) | Scenario3_ServerForeground | [private]
resultCharacteristicClientsChangedToken | Scenario3_ServerForeground | [private]
resultCharacteristicReadToken | Scenario3_ServerForeground | [private]
resultVal | Scenario3_ServerForeground | [private]
Scenario3_ServerForeground() | Scenario3_ServerForeground |
ServiceProvider_AdvertisementStatusChanged(Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProvider const &sender, Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisementStatusChangedEventArgs const &args) | Scenario3_ServerForeground | [private]
serviceProviderAdvertisementChangedToken | Scenario3_ServerForeground | [private]
ServiceProviderInitAsync() | Scenario3_ServerForeground | [private]
Subtract enum value | Scenario3_ServerForeground | [private]
UpdateUX() | Scenario3_ServerForeground | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/BackButtonPage.cs Source File

  • Notifications
  • cs
  • Notifications
  • Helpers

BackButtonPage.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Core;
00002 using Windows.UI.Xaml.Controls;
00003 using Windows.UI.Xaml.Navigation;
00004
00005 namespace Notifications.Helpers
00006 {
00007     public class BackButtonPage : Page
00008     {
00009         protected override void OnNavigatedTo(NavigationEventArgs e)
00010         {
00011             BackButtonVisibility = base.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
00012
00013             SystemNavigationManager.GetForCurrentView().BackRequested += BackButtonPage_BackRequested;
00014
00015             base.OnNavigatedTo(e);
00016         }
00017
00018         protected override void OnNavigatedFrom(NavigationEventArgs e)
00019         {
00020             base.OnNavigatedFrom(e);
00021
00022             SystemNavigationManager.GetForCurrentView().BackRequested -= BackButtonPage_BackRequested;
00023         }
00024
00025         private void BackButtonPage_BackRequested(object sender, BackRequestedEventArgs e)
00026         {
00027             OnBackRequested(sender, e);
00028         }
00029
00030         protected virtual void OnBackRequested(object sender, BackRequestedEventArgs e)
00031         {
00032             if (base.Frame.CanGoBack)
00033             {
00034                 e.Handled = true;
00035                 base.Frame.GoBack();
00036             }
00037         }
00038
00039         public AppViewBackButtonVisibility BackButtonVisibility
00040         {
00041             get { return SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility; }
00042             set { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = value; }
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/OcrCapturedImage.xaml.cs Source File

  • OCR
  • cs

OcrCapturedImage.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Linq;
00016 using System.Threading.Tasks;
00017 using Windows.ApplicationModel;
00018 using Windows.Devices.Enumeration;
00019 using Windows.Globalization;
00020 using Windows.Graphics.Display;
00021 using Windows.Graphics.Imaging;
00022 using Windows.Media;
00023 using Windows.Media.Capture;
00024 using Windows.Media.MediaProperties;
00025 using Windows.Media.Ocr;
00026 using Windows.System.Display;
00027 using Windows.UI.Core;
00028 using Windows.UI.Xaml;
00029 using Windows.UI.Xaml.Controls;
00030 using Windows.UI.Xaml.Media;
00031 using Windows.UI.Xaml.Media.Imaging;
00032 using Windows.UI.Xaml.Navigation;
00033
00034 namespace SDKTemplate
00035 {
00036     public sealed partial class OcrCapturedImage : Page
00037     {
00038         // A pointer back to the main page.
00039         // This is needed if you want to call methods in MainPage such as NotifyUser()
00040         private MainPage rootPage = MainPage.Current;
00041
00042         // Language for OCR.
00043         private Language ocrLanguage = new Language("en");
00044
00045         // Recognized words overlay boxes.
00046         private List<WordOverlay> wordBoxes = new List<WordOverlay>();
00047
00048         // Receive notifications about rotation of the UI and apply any necessary rotation to the preview stream.
00049         private readonly DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
00050
00051         // Rotation metadata to apply to the preview stream (MF_MT_VIDEO_ROTATION).
00052         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00053         private static readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1");
00054
00055         // Prevent the screen from sleeping while the camera is running.
00056         private readonly DisplayRequest displayRequest = new DisplayRequest();
00057
00058         // MediaCapture and its state variables.
00059         private MediaCapture mediaCapture;
00060         private bool isInitialized = false;
00061         private bool isPreviewing = false;
00062
00063         // Information about the camera device.
00064         private bool mirroringPreview = false;
00065         private bool externalCamera = false;
00066
00067         public OcrCapturedImage()
00068         {
00069             this.InitializeComponent();
00070         }
00071
00072         /// <summary>
00073         /// Invoked when this page is about to be displayed in a Frame.
00074         /// Ckecks if English language is available for OCR on device and starts camera preview..
00075         /// </summary>
00076         /// <param name="e"></param>
00077         protected override async void OnNavigatedTo(NavigationEventArgs e)
00078         {
00079             displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
00080
00081             // Useful to know when to initialize/clean up the camera
00082             Application.Current.Suspending += Application_Suspending;
00083             Application.Current.Resuming += Application_Resuming;
00084
00085             if (!OcrEngine.IsLanguageSupported(ocrLanguage))
00086             {
00087                 rootPage.NotifyUser(ocrLanguage.DisplayName + " is not supported.", NotifyType.ErrorMessage);
00088
00089                 return;
00090             }
00091
00092             await StartCameraAsync();
00093
00094             // Update buttons visibility.
00095             ExtractButton.Visibility = isInitialized ? Visibility.Visible : Visibility.Collapsed;
00096             CameraButton.Visibility = isInitialized ? Visibility.Collapsed : Visibility.Visible;
00097         }
00098
00099         /// <summary>
00100         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00101         /// Stops camera if initialized.
00102         /// </summary>
00103         /// <param name="e"></param>
00104         protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
00105         {
00106             displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
00107             Application.Current.Suspending -= Application_Suspending;
00108             Application.Current.Resuming -= Application_Resuming;
00109
00110             await CleanupCameraAsync();
00111         }
00112
00113         /// <summary>
00114         /// Occurs on app suspending. Stops camera if initialized.
00115         /// </summary>
00116         /// <param name="sender"></param>
00117         /// <param name="e"></param>
00118         private async void Application_Suspending(object sender, SuspendingEventArgs e)
00119         {
00120             var deferral = e.SuspendingOperation.GetDeferral();
00121
00122             await CleanupCameraAsync();
00123
00124             displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
00125
00126             deferral.Complete();
00127         }
00128
00129         /// <summary>
00130         /// Occurs on app resuming. Initializes camera if available.
00131         /// </summary>
00132         /// <param name="sender"></param>
00133         /// <param name="o"></param>
00134         private async void Application_Resuming(object sender, object o)
00135         {
00136             displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
00137
00138             await StartCameraAsync();
00139         }
00140
00141         /// <summary>
00142         /// Occurs when display orientation changes.
00143         /// Sets camera rotation preview.
00144         /// </summary>
00145         /// <param name="sender"></param>
00146         /// <param name="args"></param>
00147         private async void DisplayInformation_OrientationChanged(DisplayInformation sender, object args)
00148         {
00149             if (isPreviewing)
00150             {
00151                 await SetPreviewRotationAsync();
00152             }
00153         }
00154
00155         /// <summary>
00156         /// This is event handler for 'Extract' button.
00157         /// Captures image from camera ,recognizes text and displays it.
00158         /// </summary>
00159         /// <param name="sender"></param>
00160         /// <param name="e"></param>
00161         private async void ExtractButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00162         {
00163             //Get information about the preview.
00164             var previewProperties = mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
00165             int videoFrameWidth = (int)previewProperties.Width;
00166             int videoFrameHeight = (int)previewProperties.Height;
00167
00168             // In portrait modes, the width and height must be swapped for the VideoFrame to have the correct aspect ratio and avoid letterboxing / black bars.
00169             if (!externalCamera && (displayInformation.CurrentOrientation == DisplayOrientations.Portrait || displayInformation.CurrentOrientation == DisplayOrientations.PortraitFlipped))
00170             {
00171                 videoFrameWidth = (int)previewProperties.Height;
00172                 videoFrameHeight = (int)previewProperties.Width;
00173             }
00174
00175             // Create the video frame to request a SoftwareBitmap preview frame.
00176             var videoFrame = new VideoFrame(BitmapPixelFormat.Bgra8, videoFrameWidth, videoFrameHeight);
00177
00178             // Capture the preview frame.
00179             using (var currentFrame = await mediaCapture.GetPreviewFrameAsync(videoFrame))
00180             {
00181                 // Collect the resulting frame.
00182                 SoftwareBitmap bitmap = currentFrame.SoftwareBitmap;
00183
00184                 OcrEngine ocrEngine = OcrEngine.TryCreateFromLanguage(ocrLanguage);
00185
00186                 if (ocrEngine == null)
00187                 {
00188                     rootPage.NotifyUser(ocrLanguage.DisplayName + " is not supported.", NotifyType.ErrorMessage);
00189
00190                     return;
00191                 }
00192
00193                 var imgSource = new WriteableBitmap(bitmap.PixelWidth, bitmap.PixelHeight);
00194                 bitmap.CopyToBuffer(imgSource.PixelBuffer);
00195                 PreviewImage.Source = imgSource;
00196
00197                 var ocrResult = await ocrEngine.RecognizeAsync(bitmap);
00198
00199                 // Used for text overlay.
00200                 // Prepare scale transform for words since image is not displayed in original format.
00201                 var scaleTrasform = new ScaleTransform
00202                 {
00203                     CenterX = 0,
00204                     CenterY = 0,
00205                     ScaleX = PreviewControl.ActualWidth / bitmap.PixelWidth,
00206                     ScaleY = PreviewControl.ActualHeight / bitmap.PixelHeight
00207                 };
00208
00209                 if (ocrResult.TextAngle != null)
00210                 {
00211                     // If text is detected under some angle in this sample scenario we want to
00212                     // overlay word boxes over original image, so we rotate overlay boxes.
00213                     TextOverlay.RenderTransform = new RotateTransform
00214                     {
00215                         Angle = (double)ocrResult.TextAngle,
00216                         CenterX = PreviewImage.ActualWidth / 2,
00217                         CenterY = PreviewImage.ActualHeight / 2
00218                     };
00219                 }
00220
00221                 // Iterate over recognized lines of text.
00222                 foreach (var line in ocrResult.Lines)
00223                 {
00224                     // Iterate over words in line.
00225                     foreach (var word in line.Words)
00226                     {
00227                         WordOverlay wordBoxOverlay = new WordOverlay(word);
00228
00229                         // Keep references to word boxes.
00230                         wordBoxes.Add(wordBoxOverlay);
00231
00232                         // Create a box with the word inside it.
00233                         var textBlock = new TextBlock()
00234                         {
00235                             Text = word.Text,
00236                             Style = ExtractedWordTextStyle
00237                         };
00238                         TextOverlay.Children.Add(wordBoxOverlay.CreateBorder(HighlightedWordBoxHorizontalLineStyle, textBlock));
00239                     }
00240                 }
00241
00242                 rootPage.NotifyUser("Image processed using " + ocrEngine.RecognizerLanguage.DisplayName + " language.", NotifyType.StatusMessage);
00243             }
00244
00245             UpdateWordBoxTransform();
00246
00247             PreviewControl.Visibility = Visibility.Collapsed;
00248             Image.Visibility = Visibility.Visible;
00249             ExtractButton.Visibility = Visibility.Collapsed;
00250             CameraButton.Visibility = Visibility.Visible;
00251         }
00252
00253         /// <summary>
00254         /// This is event handler for 'Camera' button.
00255         /// Clears previous OCR results and starts camera.
00256         /// </summary>
00257         /// <param name="sender"></param>
00258         /// <param name="e"></param>
00259         private async void CameraButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00260         {
00261             await StartCameraAsync();
00262         }
00263
00264         /// <summary>
00265         ///  Update word box transform to match current UI size.
00266         /// </summary>
00267         private void UpdateWordBoxTransform()
00268         {
00269             WriteableBitmap bitmap = PreviewImage.Source as WriteableBitmap;
00270
00271             if (bitmap != null)
00272             {
00273                 // Used for text overlay.
00274                 // Prepare scale transform for words since image is not displayed in original size.
00275                 ScaleTransform scaleTransform = new ScaleTransform
00276                 {
00277                     CenterX = 0,
00278                     CenterY = 0,
00279                     ScaleX = PreviewImage.ActualWidth / bitmap.PixelWidth,
00280                     ScaleY = PreviewImage.ActualHeight / bitmap.PixelHeight
00281                 };
00282
00283                 foreach (var item in wordBoxes)
00284                 {
00285                     item.Transform(scaleTransform);
00286                 }
00287             }
00288         }
00289
00290         /// <summary>
00291         /// Occurs when displayed image size changes.
00292         /// </summary>
00293         /// <param name="sender"></param>
00294         /// <param name="e"></param>
00295         private void PreviewImage_SizeChanged(object sender, SizeChangedEventArgs e)
00296         {
00297             UpdateWordBoxTransform();
00298
00299             // Update image rotation center.
00300             var rotate = TextOverlay.RenderTransform as RotateTransform;
00301             if (rotate != null)
00302             {
00303                 rotate.CenterX = PreviewImage.ActualWidth / 2;
00304                 rotate.CenterY = PreviewImage.ActualHeight / 2;
00305             }
00306         }
00307
00308         #region MediaCapture methods
00309
00310         /// <summary>
00311         /// Starts the camera. Initializes resources and starts preview.
00312         /// </summary>
00313         private async Task StartCameraAsync()
00314         {
00315             if (!isInitialized)
00316             {
00317                 await InitializeCameraAsync();
00318             }
00319
00320             if (isInitialized)
00321             {
00322                 TextOverlay.Children.Clear();
00323                 wordBoxes.Clear();
00324
00325                 PreviewImage.Source = null;
00326
00327                 PreviewControl.Visibility = Visibility.Visible;
00328                 Image.Visibility = Visibility.Collapsed;
00329
00330                 ExtractButton.Visibility = Visibility.Visible;
00331                 CameraButton.Visibility = Visibility.Collapsed;
00332
00333                 rootPage.NotifyUser("Camera started.", NotifyType.StatusMessage);
00334             }
00335         }
00336
00337         /// <summary>
00338         /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.
00339         /// </summary>
00340         private async Task InitializeCameraAsync()
00341         {
00342             if (mediaCapture == null)
00343             {
00344                 // Attempt to get the back camera if one is available, but use any camera device if not.
00345                 var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);
00346
00347                 if (cameraDevice == null)
00348                 {
00349                     rootPage.NotifyUser("No camera device!", NotifyType.ErrorMessage);
00350
00351                     return;
00352                 }
00353
00354                 // Create MediaCapture and its settings.
00355                 mediaCapture = new MediaCapture();
00356
00357                 // Register for a notification when something goes wrong
00358                 mediaCapture.Failed += MediaCapture_Failed;
00359
00360                 var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };
00361
00362                 // Initialize MediaCapture
00363                 try
00364                 {
00365                     await mediaCapture.InitializeAsync(settings);
00366                     isInitialized = true;
00367                 }
00368                 catch (UnauthorizedAccessException)
00369                 {
00370                     rootPage.NotifyUser("Denied access to the camera.", NotifyType.ErrorMessage);
00371                 }
00372                 catch (Exception ex)
00373                 {
00374                     rootPage.NotifyUser("Exception when init MediaCapture. " + ex.Message, NotifyType.ErrorMessage);
00375                 }
00376
00377                 // If initialization succeeded, start the preview.
00378                 if (isInitialized)
00379                 {
00380                     // Figure out where the camera is located
00381                     if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
00382                     {
00383                         // No information on the location of the camera, assume it's an external camera, not integrated on the device.
00384                         externalCamera = true;
00385                     }
00386                     else
00387                     {
00388                         // Camera is fixed on the device.
00389                         externalCamera = false;
00390
00391                         // Only mirror the preview if the camera is on the front panel.
00392                         mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
00393                     }
00394
00395                     await StartPreviewAsync();
00396                 }
00397             }
00398         }
00399
00400         /// <summary>
00401         /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.
00402         /// </summary>
00403         private async Task StartPreviewAsync()
00404         {
00405             // Prevent the device from sleeping while the preview is running.
00406             displayRequest.RequestActive();
00407
00408             // Set the preview source in the UI and mirror it if necessary.
00409             PreviewControl.Source = mediaCapture;
00410             PreviewControl.FlowDirection = mirroringPreview ? Windows.UI.Xaml.FlowDirection.RightToLeft : Windows.UI.Xaml.FlowDirection.LeftToRight;
00411
00412             // Start the preview.
00413             try
00414             {
00415                 await mediaCapture.StartPreviewAsync();
00416                 isPreviewing = true;
00417             }
00418             catch (Exception ex)
00419             {
00420                 rootPage.NotifyUser("Exception starting preview." + ex.Message, NotifyType.ErrorMessage);
00421             }
00422
00423             // Initialize the preview to the current orientation.
00424             if (isPreviewing)
00425             {
00426                 await SetPreviewRotationAsync();
00427             }
00428         }
00429
00430         /// <summary>
00431         /// Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.
00432         /// </summary>
00433         private async Task SetPreviewRotationAsync()
00434         {
00435             // Only need to update the orientation if the camera is mounted on the device.
00436             if (externalCamera) return;
00437
00438             // Calculate which way and how far to rotate the preview.
00439             int rotationDegrees;
00440             VideoRotation sourceRotation;
00441             CalculatePreviewRotation(out sourceRotation, out rotationDegrees);
00442
00443             // Set preview rotation in the preview source.
00444             mediaCapture.SetPreviewRotation(sourceRotation);
00445
00446             // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
00447             var props = mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
00448             props.Properties.Add(RotationKey, rotationDegrees);
00449             await mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
00450         }
00451
00452         /// <summary>
00453         /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI
00454         /// </summary>
00455         /// <returns></returns>
00456         private async Task StopPreviewAsync()
00457         {
00458             try
00459             {
00460                 isPreviewing = false;
00461                 await mediaCapture.StopPreviewAsync();
00462             }
00463             catch (Exception ex)
00464             {
00465                 // Use the dispatcher because this method is sometimes called from non-UI threads.
00466                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00467                 {
00468                     rootPage.NotifyUser("Exception stopping preview. " + ex.Message, NotifyType.ErrorMessage);
00469                 });
00470             }
00471
00472             // Use the dispatcher because this method is sometimes called from non-UI threads.
00473             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00474             {
00475                 PreviewControl.Source = null;
00476
00477                 // Allow the device to sleep now that the preview is stopped.
00478                 displayRequest.RequestRelease();
00479             });
00480         }
00481
00482         /// <summary>
00483         /// Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.
00484         /// </summary>
00485         private async Task CleanupCameraAsync()
00486         {
00487             if (isInitialized)
00488             {
00489                 if (isPreviewing)
00490                 {
00491                     // The call to stop the preview is included here for completeness, but can be
00492                     // safely removed if a call to MediaCapture.Dispose() is being made later,
00493                     // as the preview will be automatically stopped at that point
00494                     await StopPreviewAsync();
00495                 }
00496
00497                 isInitialized = false;
00498             }
00499
00500             if (mediaCapture != null)
00501             {
00502                 mediaCapture.Failed -= MediaCapture_Failed;
00503                 mediaCapture.Dispose();
00504                 mediaCapture = null;
00505             }
00506         }
00507
00508         /// <summary>
00509         /// Queries the available video capture devices to try and find one mounted on the desired panel.
00510         /// </summary>
00511         /// <param name="desiredPanel">The panel on the device that the desired camera is mounted on.</param>
00512         /// <returns>A DeviceInformation instance with a reference to the camera mounted on the desired panel if available,
00513         ///          any other camera if not, or null if no camera is available.</returns>
00514         private static async Task<DeviceInformation> FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel)
00515         {
00516             // Get available devices for capturing pictures.
00517             var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00518
00519             // Get the desired camera by panel.
00520             DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);
00521
00522             // If there is no device mounted on the desired panel, return the first device found.
00523             return desiredDevice ?? allVideoDevices.FirstOrDefault();
00524         }
00525
00526         /// <summary>
00527         /// Reads the current orientation of the app and calculates the VideoRotation necessary to ensure the preview is rendered in the correct orientation.
00528         /// </summary>
00529         /// <param name="sourceRotation">The rotation value to use in MediaCapture.SetPreviewRotation.</param>
00530         /// <param name="rotationDegrees">The accompanying rotation metadata with which to tag the preview stream.</param>
00531         private void CalculatePreviewRotation(out VideoRotation sourceRotation, out int rotationDegrees)
00532         {
00533             // Note that in some cases, the rotation direction needs to be inverted if the preview is being mirrored.
00534
00535             switch (displayInformation.CurrentOrientation)
00536             {
00537                 case DisplayOrientations.Portrait:
00538                     if (mirroringPreview)
00539                     {
00540                         rotationDegrees = 270;
00541                         sourceRotation = VideoRotation.Clockwise270Degrees;
00542                     }
00543                     else
00544                     {
00545                         rotationDegrees = 90;
00546                         sourceRotation = VideoRotation.Clockwise90Degrees;
00547                     }
00548                     break;
00549
00550                 case DisplayOrientations.LandscapeFlipped:
00551                     // No need to invert this rotation, as rotating 180 degrees is the same either way.
00552                     rotationDegrees = 180;
00553                     sourceRotation = VideoRotation.Clockwise180Degrees;
00554                     break;
00555
00556                 case DisplayOrientations.PortraitFlipped:
00557                     if (mirroringPreview)
00558                     {
00559                         rotationDegrees = 90;
00560                         sourceRotation = VideoRotation.Clockwise90Degrees;
00561                     }
00562                     else
00563                     {
00564                         rotationDegrees = 270;
00565                         sourceRotation = VideoRotation.Clockwise270Degrees;
00566                     }
00567                     break;
00568
00569                 case DisplayOrientations.Landscape:
00570                 default:
00571                     rotationDegrees = 0;
00572                     sourceRotation = VideoRotation.None;
00573                     break;
00574             }
00575         }
00576
00577         /// <summary>
00578         /// Handles MediaCapture failures. Cleans up the camera resources.
00579         /// </summary>
00580         /// <param name="sender"></param>
00581         /// <param name="errorEventArgs"></param>
00582         private async void MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
00583         {
00584             await CleanupCameraAsync();
00585
00586             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00587             {
00588                 ExtractButton.Visibility = Visibility.Collapsed;
00589                 CameraButton.Visibility = Visibility.Visible;
00590
00591                 rootPage.NotifyUser("MediaCapture Failed. " + errorEventArgs.Message, NotifyType.ErrorMessage);
00592             });
00593         }
00594
00595         #endregion MediaCapture methods
00596     }
00597 }
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RandomNumberGeneratorTask Member List

This is the complete list of members for RandomNumberGeneratorTask, including all inherited members.
OnRequestReceived(Windows::ApplicationModel::AppService::AppServiceConnection const &, Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs const &args) | RandomNumberGeneratorTask | [private]
OnTaskCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason const &) | RandomNumberGeneratorTask | [private]
randomNumberGenerator | RandomNumberGeneratorTask | [private]
RandomNumberGeneratorTask() | RandomNumberGeneratorTask |
Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance) | RandomNumberGeneratorTask |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario1_Start.xaml.cs Source File

  • StreamSocket
  • cs

Scenario1_Start.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Connectivity;
00018 using Windows.Networking.Sockets;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace StreamSocketSample
00026 {
00027     /// <summary>
00028     /// A page for first scenario.
00029     /// </summary>
00030     public sealed partial class Scenario1 : Page
00031     {
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         MainPage rootPage = MainPage.Current;
00035
00036         // List containing all available local HostName endpoints
00037         private List<LocalHostItem> localHostItems = new List<LocalHostItem>();
00038
00039         public Scenario1()
00040         {
00041             this.InitializeComponent();
00042             PopulateAdapterList();
00043         }
00044
00045         /// <summary>
00046         /// Invoked when this page is about to be displayed in a Frame.
00047         /// </summary>
00048         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00049         /// property is typically used to configure the page.</param>
00050         protected override void OnNavigatedTo(NavigationEventArgs e)
00051         {
00052             BindToAny.IsChecked = true;
00053         }
00054
00055         private void BindToAny_Checked(object sender, RoutedEventArgs e)
00056         {
00057             AdapterList.IsEnabled = false;
00058         }
00059
00060         private void BindToAny_Unchecked(object sender, RoutedEventArgs e)
00061         {
00062             AdapterList.IsEnabled = true;
00063         }
00064
00065         /// <summary>
00066         /// This is the click handler for the 'StartListener' button.
00067         /// </summary>
00068         /// <param name="sender">Object for which the event was generated.</param>
00069         /// <param name="e">Event's parameters.</param>
00070         private async void StartListener_Click(object sender, RoutedEventArgs e)
00071         {
00072             // Overriding the listener here is safe as it will be deleted once all references to it are gone.
00073             // However, in many cases this is a dangerous pattern to override data semi-randomly (each time user
00074             // clicked the button) so we block it here.
00075             if (CoreApplication.Properties.ContainsKey("listener"))
00076             {
00077                 rootPage.NotifyUser(
00078                     "This step has already been executed. Please move to the next one.",
00079                     NotifyType.ErrorMessage);
00080                 return;
00081             }
00082
00083             if (String.IsNullOrEmpty(ServiceNameForListener.Text))
00084             {
00085                 rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
00086                 return;
00087             }
00088
00089             CoreApplication.Properties.Remove("serverAddress");
00090             CoreApplication.Properties.Remove("adapter");
00091
00092             LocalHostItem selectedLocalHost = null;
00093             if ((BindToAddress.IsChecked == true) || (BindToAdapter.IsChecked == true))
00094             {
00095                 selectedLocalHost = (LocalHostItem)AdapterList.SelectedItem;
00096                 if (selectedLocalHost == null)
00097                 {
00098                     rootPage.NotifyUser("Please select an address / adapter.", NotifyType.ErrorMessage);
00099                     return;
00100                 }
00101
00102                 // The user selected an address. For demo purposes, we ensure that connect will be using the same
00103                 // address.
00104                 CoreApplication.Properties.Add("serverAddress", selectedLocalHost.LocalHost.CanonicalName);
00105             }
00106
00107             StreamSocketListener listener = new StreamSocketListener();
00108             listener.ConnectionReceived += OnConnection;
00109
00110             // If necessary, tweak the listener's control options before carrying out the bind operation.
00111             // These options will be automatically applied to the connected StreamSockets resulting from
00112             // incoming connections (i.e., those passed as arguments to the ConnectionReceived event handler).
00113             // Refer to the StreamSocketListenerControl class' MSDN documentation for the full list of control options.
00114             listener.Control.KeepAlive = false;
00115
00116             // Save the socket, so subsequent steps can use it.
00117             CoreApplication.Properties.Add("listener", listener);
00118
00119             // Start listen operation.
00120             try
00121             {
00122                 if (BindToAny.IsChecked == true)
00123                 {
00124                     // Don't limit traffic to an address or an adapter.
00125                     await listener.BindServiceNameAsync(ServiceNameForListener.Text);
00126                     rootPage.NotifyUser("Listening", NotifyType.StatusMessage);
00127                 }
00128                 else if (BindToAddress.IsChecked == true)
00129                 {
00130                     // Try to bind to a specific address.
00131                     await listener.BindEndpointAsync(selectedLocalHost.LocalHost, ServiceNameForListener.Text);
00132                     rootPage.NotifyUser(
00133                         "Listening on address " + selectedLocalHost.LocalHost.CanonicalName,
00134                         NotifyType.StatusMessage);
00135                 }
00136                 else if (BindToAdapter.IsChecked == true)
00137                 {
00138                     // Try to limit traffic to the selected adapter.
00139                     // This option will be overridden by interfaces with weak-host or forwarding modes enabled.
00140                     NetworkAdapter selectedAdapter = selectedLocalHost.LocalHost.IPInformation.NetworkAdapter;
00141
00142                     // For demo purposes, ensure that we use the same adapter in the client connect scenario.
00143                     CoreApplication.Properties.Add("adapter", selectedAdapter);
00144
00145                     await listener.BindServiceNameAsync(
00146                         ServiceNameForListener.Text,
00147                         SocketProtectionLevel.PlainSocket,
00148                         selectedAdapter);
00149
00150                     rootPage.NotifyUser(
00151                         "Listening on adapter " + selectedAdapter.NetworkAdapterId,
00152                         NotifyType.StatusMessage);
00153                 }
00154             }
00155             catch (Exception exception)
00156             {
00157                 CoreApplication.Properties.Remove("listener");
00158
00159                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00160                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00161                 {
00162                     throw;
00163                 }
00164
00165                 rootPage.NotifyUser(
00166                     "Start listening failed with error: " + exception.Message,
00167                     NotifyType.ErrorMessage);
00168             }
00169         }
00170
00171         /// <summary>
00172         /// Invoked once a connection is accepted by StreamSocketListener.
00173         /// </summary>
00174         /// <param name="sender">The listener that accepted the connection.</param>
00175         /// <param name="args">Parameters associated with the accepted connection.</param>
00176         private async void OnConnection(
00177             StreamSocketListener sender,
00178             StreamSocketListenerConnectionReceivedEventArgs args)
00179         {
00180             DataReader reader = new DataReader(args.Socket.InputStream);
00181             try
00182             {
00183                 while (true)
00184                 {
00185                     // Read first 4 bytes (length of the subsequent string).
00186                     uint sizeFieldCount = await reader.LoadAsync(sizeof(uint));
00187                     if (sizeFieldCount != sizeof(uint))
00188                     {
00189                         // The underlying socket was closed before we were able to read the whole data.
00190                         return;
00191                     }
00192
00193                     // Read the string.
00194                     uint stringLength = reader.ReadUInt32();
00195                     uint actualStringLength = await reader.LoadAsync(stringLength);
00196                     if (stringLength != actualStringLength)
00197                     {
00198                         // The underlying socket was closed before we were able to read the whole data.
00199                         return;
00200                     }
00201
00202                     // Display the string on the screen. The event is invoked on a non-UI thread, so we need to marshal
00203                     // the text back to the UI thread.
00204                     NotifyUserFromAsyncThread(
00205                         String.Format("Received data: \"{0}\"", reader.ReadString(actualStringLength)),
00206                         NotifyType.StatusMessage);
00207                 }
00208             }
00209             catch (Exception exception)
00210             {
00211                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00212                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00213                 {
00214                     throw;
00215                 }
00216
00217                 NotifyUserFromAsyncThread(
00218                     "Read stream failed with error: " + exception.Message,
00219                     NotifyType.ErrorMessage);
00220             }
00221         }
00222
00223         private void NotifyUserFromAsyncThread(string strMessage, NotifyType type)
00224         {
00225             var ignore = Dispatcher.RunAsync(
00226                 CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
00227         }
00228
00229         /// <summary>
00230         /// Populates the NetworkAdapter list
00231         /// </summary>
00232         private void PopulateAdapterList()
00233         {
00234             localHostItems.Clear();
00235             AdapterList.ItemsSource = localHostItems;
00236             AdapterList.DisplayMemberPath = "DisplayString";
00237
00238             foreach (HostName localHostInfo in NetworkInformation.GetHostNames())
00239             {
00240                 if (localHostInfo.IPInformation != null)
00241                 {
00242                     LocalHostItem adapterItem = new LocalHostItem(localHostInfo);
00243                     localHostItems.Add(adapterItem);
00244                 }
00245             }
00246         }
00247     }
00248
00249     /// <summary>
00250     /// Helper class describing a NetworkAdapter and its associated IP address
00251     /// </summary>
00252     class LocalHostItem
00253     {
00254         public string DisplayString
00255         {
00256             get;
00257             private set;
00258         }
00259
00260         public HostName LocalHost
00261         {
00262             get;
00263             private set;
00264         }
00265
00266         public LocalHostItem(HostName localHostName)
00267         {
00268             if (localHostName == null)
00269             {
00270                 throw new ArgumentNullException("localHostName");
00271             }
00272
00273             if (localHostName.IPInformation == null)
00274             {
00275                 throw new ArgumentException("Adapter information not found");
00276             }
00277
00278             this.LocalHost = localHostName;
00279             this.DisplayString = "Address: " + localHostName.DisplayName +
00280                 " Adapter: " + localHostName.IPInformation.NetworkAdapter.NetworkAdapterId;
00281         }
00282     }
00283 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario1.xaml.h Source File

  • StreamSocket
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.h
00014 // Declaration of the Scenario1 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace StreamSocketSample
00026     {
00027         [Windows::Foundation::Metadata::WebHostHidden]
00028         // In c++, adding this attribute to ref classes enables data binding.
00029         // For more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
00030         [Windows::UI::Xaml::Data::Bindable]
00031         public ref class LocalHostItem sealed
00032         {
00033         public:
00034             LocalHostItem(Windows::Networking::HostName^ localHostName);
00035             property Platform::String^ DisplayString { Platform::String^ get() { return displayString; } }
00036             property Windows::Networking::HostName^ LocalHost { Windows::Networking::HostName^ get() { return localHost; } }
00037
00038         private:
00039             Platform::String^ displayString;
00040             Windows::Networking::HostName^ localHost;
00041         };
00042
00043         /// <summary>
00044         /// An empty page that can be used on its own or navigated to within a Frame.
00045         /// </summary>
00046         [Windows::Foundation::Metadata::WebHostHidden]
00047         public ref class Scenario1 sealed
00048         {
00049         public:
00050             Scenario1();
00051
00052         protected:
00053             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00054         private:
00055             MainPage^ rootPage;
00056
00057             // Vector containing all available local HostName endpoints.
00058             Platform::Collections::Vector<LocalHostItem^>^ localHostItems;
00059             void StartListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00060             void BindToAny_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00061             void BindToAny_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00062             void PopulateAdapterList();
00063         };
00064
00065         [Windows::Foundation::Metadata::WebHostHidden]
00066         public ref class ListenerContext sealed
00067         {
00068         public:
00069             ListenerContext(MainPage^ rootPage, Windows::Networking::Sockets::StreamSocketListener^ listener);
00070             void OnConnection(
00071                 Windows::Networking::Sockets::StreamSocketListener^ listener,
00072                 Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^ object);
00073
00074         private:
00075             MainPage^ rootPage;
00076             Windows::Networking::Sockets::StreamSocketListener^ listener;
00077
00078             ~ListenerContext();
00079             void ReceiveStringLoop(
00080                 Windows::Storage::Streams::DataReader^ reader,
00081                 Windows::Networking::Sockets::StreamSocket^ socket);
00082             void NotifyUserFromAsyncThread(Platform::String^ message, NotifyType type);
00083         };
00084     }
00085 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColorTex Member List

This is the complete list of members for VertexPositionColorTex, including all inherited members.
color | VertexPositionColorTex
pos | VertexPositionColorTex
texCoord | VertexPositionColorTex
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario3_InkingFeedback.xaml.cs Source File

  • PenHaptics
  • cs

Scenario3_InkingFeedback.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Devices.Haptics;
00013 using Windows.Devices.Input;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Input;
00016
00017 // This sample shows how to play inking feedback tactile signals, how to
00018 // adjust the intensity of the tactile signal, and how to fall back to a default
00019 // waveform if the desired waveform is not supported by the current PenDevice
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario3_InkingFeedback : Page
00023     {
00024         SimpleHapticsController hapticsController;
00025         PenDevice penDevice;
00026         SimpleHapticsControllerFeedback currentFeedback;
00027
00028         public Scenario3_InkingFeedback()
00029         {
00030             InitializeComponent();
00031         }
00032
00033         // The PointerEnter event will get fired as soon as Pointer input is received.
00034         // This event handler implementation will query the device providing input to see if it's a pen and
00035         // then check to see the pen supports tactile feedback and, if so, configure the PenDevice
00036         // to send the appropriate tactile signal based on what is selected in the dropdown.
00037         private void HapticCanvas_Entered(object sender, PointerRoutedEventArgs e)
00038         {
00039             // If the current Pointer device is not a pen, exit
00040             if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
00041             {
00042                 return;
00043             }
00044
00045             // Attempt to retrieve the PenDevice from the current PointerId
00046             penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);
00047
00048             // If a PenDevice cannot be retrieved based on the PointerId, it does not support
00049             // advanced pen features, such as tactile feedback
00050             if (penDevice == null)
00051             {
00052                 statusText.Text = "Advanced pen features not supported";
00053                 return;
00054             }
00055
00056             // Check to see if the current PenDevice supports tactile feedback by seeing if it
00057             // has a SimpleHapticsController
00058             hapticsController = penDevice.SimpleHapticsController;
00059             if (hapticsController == null)
00060             {
00061                 statusText.Text = "This pen does not provide tactile feedback";
00062                 return;
00063             }
00064
00065             // Get feedback based on the user's selected waveform
00066             currentFeedback = GetSelectedFeedbackOrFallback(out string message);
00067
00068             // Send the current feedback to the PenDevice's SimpleHapticsController.
00069             // Once sent, inking tactile feedback will be triggered as soon as the pen tip touches
00070             // the screen and will be stopped once the pen tip is lifted from the screen.
00071             // Also, check to see if the current PenDevice's SimpleHapticsController supports
00072             // setting the intensity value of the tactile feedback.  If so, set it based
00073             // on the slider.  If not, send the waveform without custom intensity.
00074             if (hapticsController.IsIntensitySupported)
00075             {
00076                 hapticsController.SendHapticFeedback(currentFeedback, intensitySlider.Value / 100);
00077                 message += "\nIntensity set to " + intensitySlider.Value + "%";
00078             }
00079             else
00080             {
00081                 hapticsController.SendHapticFeedback(currentFeedback);
00082                 message += "\nSetting intensity is not supported by this pen";
00083             }
00084             statusText.Text = message;
00085         }
00086
00087         // Stop sending the tactile feedback and clear the current penDevice and hapticsController on PointerExit.
00088         // Stopping the feedback is important as it clears the tactile signal from the PenDevice's
00089         // SimpleHapticsController, ensuring that it has a clean state once it next enters range.
00090         private void HapticCanvas_Exited(object sender, PointerRoutedEventArgs e)
00091         {
00092             penDevice = null;
00093             statusText.Text = "";
00094             if (hapticsController != null)
00095             {
00096                 hapticsController.StopFeedback();
00097                 hapticsController = null;
00098                 currentFeedback = null;
00099             }
00100         }
00101
00102         // Get feedback which matches the currently selected waveform in the dropdown.
00103         // To get the feedback, the SimpleHapticsController's SupportedFeedback list must be traversed
00104         // to see if a matching feedback is present.
00105         // This is important because InkContinuous is the only Inking waveform required to be
00106         // supported by every pen with haptics.
00107         // If no matching feedback is found in the SupportedFeedback list, this method returns
00108         // InkContinuous as a guaranteed fallback.
00109         private SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback(out string message)
00110         {
00111             // Look up the waveform the user selected.
00112             string name = (string)waveformComboBox.SelectionBoxItem;
00113             ushort waveform = MainPage.WaveformNamesMap[name];
00114
00115             // See if the haptics controller supports the selected waveform.
00116             SimpleHapticsControllerFeedback feedback = MainPage.FindSupportedFeedback(hapticsController, waveform);
00117             if (feedback != null)
00118             {
00119                 message = "Waveform set to " + name;
00120                 return feedback;
00121             }
00122
00123             // It does not. Use InkContinuous as a fallback.
00124             message = name + " is not supported by this pen, so falling back to InkContinuous";
00125             return MainPage.FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms.InkContinuous);
00126         }
00127     }
00128 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/360VideoPlaybackMain.h Source File

  • 360VideoPlayback
  • cpp

360VideoPlaybackMain.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 //
00004 // Comment out this preprocessor definition to disable all of the
00005 // sample content.
00006 //
00007 // To remove the content after disabling it:
00008 //     * Remove the unused code from your app's Main class.
00009 //     * Delete the Content folder provided with this template.
00010 //
00011 #define DRAW_SAMPLE_CONTENT
00012
00013 #include "Common\DeviceResources.h"
00014 #include "Common\StepTimer.h"
00015
00016 #ifdef DRAW_SAMPLE_CONTENT
00017 #include "Content\VideoRenderer.h"
00018 #include "Content\SpatialInputHandler.h"
00019 #include "Content\MediaTransportControls.h"
00020 #endif
00021
00022 // Updates, renders, and presents holographic content using Direct3D.
00023 namespace _360VideoPlayback
00024 {
00025     class _360VideoPlaybackMain : public DX::IDeviceNotify
00026     {
00027     public:
00028         _360VideoPlaybackMain();
00029         ~_360VideoPlaybackMain();
00030
00031         // Sets the holographic space. This is our closest analogue to setting a new window
00032         // for the app.
00033         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ holographicSpace);
00034
00035         // Starts the holographic frame and updates the content.
00036         Windows::Graphics::Holographic::HolographicFrame^ Update();
00037
00038         // Renders holograms, including world-locked content.
00039         bool Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame);
00040
00041         // Handle saving and loading of app state owned by AppMain.
00042         void SaveAppState();
00043         void LoadAppState();
00044
00045         // IDeviceNotify
00046         virtual void OnDeviceLost();
00047         virtual void OnDeviceRestored();
00048         void CreateVideoShaders();
00049         // Clears event registration state. Used when changing to a new HolographicSpace
00050         // and when tearing down AppMain.
00051         void UnregisterHolographicEventHandlers();
00052         static std::shared_ptr<DX::DeviceResources> GetDeviceResources();
00053
00054     private:
00055         // Asynchronously creates resources for new holographic cameras.
00056         void OnCameraAdded(
00057             Windows::Graphics::Holographic::HolographicSpace^ sender,
00058             Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ args);
00059
00060         // Synchronously releases resources for holographic cameras that are no longer
00061         // attached to the system.
00062         void OnCameraRemoved(
00063             Windows::Graphics::Holographic::HolographicSpace^ sender,
00064             Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ args);
00065
00066         // Used to notify the app when the positional tracking state changes.
00067         void OnLocatabilityChanged(
00068             Windows::Perception::Spatial::SpatialLocator^ sender,
00069             Platform::Object^ args);
00070
00071 #ifdef DRAW_SAMPLE_CONTENT
00072         // Renders a colorful holographic cube that's 20 centimeters wide. This sample content
00073         // is used to demonstrate world-locked rendering.
00074         std::unique_ptr<VideoRenderer> m_videoRenderer;
00075         std::unique_ptr<MediaTransportControls> m_mediaTransportControls;
00076
00077         // Listens for the Pressed spatial input event.
00078         std::shared_ptr<SpatialInputHandler> m_spatialInputHandler;
00079 #endif
00080
00081         // static pointer to device resources.
00082         static std::shared_ptr<DX::DeviceResources> m_deviceResources;
00083
00084         // Render loop timer.
00085         DX::StepTimer m_timer;
00086
00087         // Represents the holographic space around the user.
00088         Windows::Graphics::Holographic::HolographicSpace^ m_holographicSpace;
00089
00090         // SpatialLocator that is attached to the primary camera.
00091         Windows::Perception::Spatial::SpatialLocator^ m_locator;
00092
00093         // A reference frame attached to the holographic camera.
00094         Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference^ m_referenceFrame;
00095
00096         // Event registration tokens.
00097         Windows::Foundation::EventRegistrationToken m_cameraAddedToken;
00098         Windows::Foundation::EventRegistrationToken m_cameraRemovedToken;
00099         Windows::Foundation::EventRegistrationToken m_locatabilityChangedToken;
00100         bool m_isGamepadPressed = false;
00101         bool m_isMouseLeftKeyPressed = false;
00102     };
00103 }
Generated on Fri Nov 15 2024 22:16:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/pch.cpp Source File

  • PersonalDataEncryption
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/ShaderStructures.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

ShaderStructures.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace HolographicMRCSample
00004 {
00005     // Constant buffer used to send hologram position transform to the shader pipeline.
00006     struct ModelConstantBuffer
00007     {
00008         DirectX::XMFLOAT4X4 model;
00009     };
00010
00011     // Assert that the constant buffer remains 16-byte aligned (best practice).
00012     static_assert((sizeof(ModelConstantBuffer) % (sizeof(float) * 4)) == 0, "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00013
00014     // Constant buffer used to send hologram position transform to the shader pipeline.
00015     struct ModelColorConstantBuffer
00016     {
00017         DirectX::XMFLOAT4X4 model;
00018         DirectX::XMFLOAT4   color;
00019     };
00020
00021     // Assert that the constant buffer remains 16-byte aligned (best practice).
00022     static_assert((sizeof(ModelColorConstantBuffer) % (sizeof(float) * 4)) == 0, "Model color constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00023
00024     // Used to send per-vertex data to the vertex shader.
00025     struct VertexPosition
00026     {
00027         DirectX::XMFLOAT3 pos;
00028     };
00029
00030     struct VertexPositionColor
00031     {
00032         DirectX::XMFLOAT3 pos;
00033         DirectX::XMFLOAT4 color;
00034     };
00035
00036     struct VertexPositionTexture
00037     {
00038         DirectX::XMFLOAT3 pos;
00039         DirectX::XMFLOAT2 uv;
00040     };
00041 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/MainPage.xaml.cs Source File

  • XamlStateTriggers
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using StateTriggersSample.ViewModel;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.IO;
00005 using System.Linq;
00006 using System.Runtime.InteropServices.WindowsRuntime;
00007 using Windows.Foundation;
00008 using Windows.Foundation.Collections;
00009 using Windows.UI.Xaml;
00010 using Windows.UI.Xaml.Controls;
00011 using Windows.UI.Xaml.Controls.Primitives;
00012 using Windows.UI.Xaml.Data;
00013 using Windows.UI.Xaml.Input;
00014 using Windows.UI.Xaml.Media;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00018
00019 namespace StateTriggersSample
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class MainPage : Page
00025     {
00026         private MainViewModel _viewModel;
00027         public MainPage()
00028         {
00029             this.InitializeComponent();
00030             this.Loaded += MainPage_Loaded;
00031         }
00032
00033         void MainPage_Loaded(object sender, RoutedEventArgs e)
00034         {
00035             _viewModel = new MainViewModel();
00036             list.ItemsSource = _viewModel.Items;
00037         }
00038     }
00039
00040 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareApplicationLink.xaml.cs Source File

  • ShareSource
  • cs

ShareApplicationLink.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.ObjectModel;
00014 using Windows.ApplicationModel.DataTransfer;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.Storage.Streams;
00017 using Windows.UI;
00018 using Windows.UI.Xaml.Data;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class ShareApplicationLink
00023     {
00024         public ShareApplicationLink()
00025         {
00026             this.InitializeComponent();
00027
00028             // Populate the ApplicationLinkComboBox with the deep links for all of the scenarios
00029             ObservableCollection<object> scenarioList = new ObservableCollection<object>();
00030             foreach (Scenario scenario in rootPage.scenarios)
00031             {
00032                 scenarioList.Add(SharePage.GetApplicationLink(scenario.ClassType.Name));
00033             }
00034             ApplicationLinkComboBox.ItemsSource = scenarioList;
00035             ApplicationLinkComboBox.SelectedItem = ApplicationLink; // Default selection to the deep link for this scenario
00036         }
00037
00038         protected override bool GetShareContent(DataRequest request)
00039         {
00040             bool succeeded = false;
00041
00042             Uri selectedApplicationLink = ApplicationLinkComboBox.SelectedItem as Uri;
00043             if (selectedApplicationLink != null)
00044             {
00045                 DataPackage requestData = request.Data;
00046                 requestData.Properties.Title = TitleInputBox.Text;
00047                 requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
00048                 requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
00049                 requestData.SetApplicationLink(selectedApplicationLink);
00050
00051                 // Place the selected logo and the background color in the data package properties
00052                 if (MicrosoftLogo.IsChecked.Value)
00053                 {
00054                     requestData.Properties.Square30x30Logo = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///assets/microsoftLogo.png"));
00055                     requestData.Properties.LogoBackgroundColor = GetLogoBackgroundColor();
00056                 }
00057                 else if (VisualStudioLogo.IsChecked.Value)
00058                 {
00059                     requestData.Properties.Square30x30Logo = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///assets/visualStudioLogo.png"));
00060                     requestData.Properties.LogoBackgroundColor = GetLogoBackgroundColor();
00061                 }
00062
00063                 succeeded = true;
00064             }
00065             else
00066             {
00067                 request.FailWithDisplayText("Select the application link you would like to share and try again.");
00068             }
00069
00070             return succeeded;
00071         }
00072
00073         /// <summary>
00074         /// Reads out the values of the colors and constructs a color from their values.
00075         /// </summary>
00076         /// <returns></returns>
00077         private Color GetLogoBackgroundColor()
00078         {
00079             // The values are guaranteed to be within the appropriate byte range due to setting a minimum of 0
00080             // and a maximum of 255 on the sliders. However, it is necessary to convert them to bytes because
00081             // the slider exposes its value as a double.
00082             Color backgroundColor = new Color();
00083             backgroundColor.R = Convert.ToByte(RedSlider.Value);
00084             backgroundColor.G = Convert.ToByte(GreenSlider.Value);
00085             backgroundColor.B = Convert.ToByte(BlueSlider.Value);
00086             backgroundColor.A = Convert.ToByte(AlphaSlider.Value);
00087
00088             return backgroundColor;
00089         }
00090     }
00091
00092     /// <summary>
00093     /// A value converter which negates a bool. This converter is used for the color sliders to bind their enabled
00094     /// state to the negation of the selection state of the default logo radio button.
00095     /// </summary>
00096     public sealed class NegatingBoolConverter : IValueConverter
00097     {
00098         public object Convert(object value, Type targetType, object parameter, string language)
00099         {
00100             return !(bool)value;
00101         }
00102
00103         public object ConvertBack(object value, Type targetType, object parameter, string language)
00104         {
00105             return !(bool)value;
00106         }
00107     }
00108 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario1_SecondaryWindow.h Source File

  • AppWindow
  • cppwinrt

Scenario1_SecondaryWindow.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_SecondaryWindow.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_SecondaryWindow : Scenario1_SecondaryWindowT<Scenario1_SecondaryWindow>
00019     {
00020         Scenario1_SecondaryWindow();
00021
00022         fire_and_forget OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023
00024         fire_and_forget Button_Click(IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025
00026     private:
00027         Windows::UI::WindowManagement::AppWindow appWindow{ nullptr };
00028         Windows::UI::Xaml::Controls::Frame appWindowFrame{};
00029
00030         void OnWindowClosed(Windows::UI::WindowManagement::AppWindow const& sender, IInspectable const&);
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario1_SecondaryWindow : Scenario1_SecondaryWindowT<Scenario1_SecondaryWindow, implementation::Scenario1_SecondaryWindow>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:18:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario2_DisplayText.xaml.cs Source File

  • LineDisplay
  • cs

Scenario2_DisplayText.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.PointOfService;
00015 using Windows.Foundation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario2_DisplayText : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025         private ClaimedLineDisplay lineDisplay;
00026
00027         public Scenario2_DisplayText()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         protected async override void OnNavigatedTo(NavigationEventArgs e)
00033         {
00034             await InitializeAsync();
00035         }
00036
00037         protected override void OnNavigatedFrom(NavigationEventArgs e)
00038         {
00039             lineDisplay?.Dispose();
00040             lineDisplay = null;
00041         }
00042
00043         private async Task InitializeAsync()
00044         {
00045             lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();
00046             BlinkCheckBox.IsEnabled = (lineDisplay != null) && (lineDisplay.Capabilities.CanBlink != LineDisplayTextAttributeGranularity.NotSupported);
00047             DisplayTextButton.IsEnabled = (lineDisplay != null);
00048         }
00049
00050         private async void DisplayTextButton_Click(object sender, RoutedEventArgs e)
00051         {
00052             string text = "Hello from UWP";
00053
00054             var position = new Point(0, 0);
00055             if (CenterCheckBox.IsChecked.Value)
00056             {
00057                 var length = text.Length;
00058                 if (length < lineDisplay.DefaultWindow.SizeInCharacters.Width)
00059                 {
00060                     position.X = ((int)lineDisplay.DefaultWindow.SizeInCharacters.Width - length) / 2;
00061                 }
00062             }
00063
00064             LineDisplayTextAttribute attribute = LineDisplayTextAttribute.Normal;
00065
00066             if (BlinkCheckBox.IsChecked.Value)
00067             {
00068                 attribute = LineDisplayTextAttribute.Blink;
00069             }
00070
00071             if (await lineDisplay.DefaultWindow.TryClearTextAsync() &&
00072                 await lineDisplay.DefaultWindow.TryDisplayTextAsync(text, attribute, position))
00073             {
00074                 rootPage.NotifyUser("Text displayed successfully", NotifyType.StatusMessage);
00075             }
00076             else
00077             {
00078                 // We probably lost our claim.
00079                 rootPage.NotifyUser("Unable to display text", NotifyType.ErrorMessage);
00080             }
00081         }
00082     }
00083 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/SampleConfiguration.cpp Source File

  • RadialController
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Event And Menu Hookup", "SDKTemplate.Scenario1_EventAndMenuHookup" },
00021 };
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario2_OvenClientWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010
00011 using namespace Microsoft::WRL;
00012 using namespace Microsoft::WRL::Wrappers;
00013 using namespace Microsoft::SDKSamples::Kitchen;
00014 using namespace SDKTemplate::WRLInProcessWinRTComponent;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::Foundation;
00018
00019 OvenClientWRL::OvenClientWRL()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void OvenClientWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00025 {
00026     try
00027     {
00028         HRESULT hr = S_OK;
00029
00030         if (!_myOven)
00031         {
00032             ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOvenFactory> ovenFactory;
00033             // Component Creation: Get the activation factory
00034             hr = GetActivationFactory(HStringReference(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &ovenFactory);
00035             if (FAILED(hr)) throw ref new Platform::COMException(hr);
00036
00037             ABI::Microsoft::SDKSamples::Kitchen::Dimensions dimensions;
00038             dimensions.Width = 2;
00039             dimensions.Height = 2;
00040             dimensions.Depth = 2;
00041
00042             // Component Creation: Call the factory method to produce an oven object
00043             hr = ovenFactory->CreateOven(dimensions, &_myOven);
00044             if (FAILED(hr)) throw ref new Platform::COMException(hr);
00045         }
00046
00047         ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> myAppliance;
00048         hr = _myOven.As(&myAppliance);
00049         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00050
00051         // Getters and setters are accessed using the get_ or put_ methods
00052         double volume;
00053         hr = myAppliance->get_Volume(&volume);
00054         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00055
00056         OvenClientWRLOutput->Text += "Oven volume is: " + volume.ToString() + "\n";
00057
00058         // Declare handlers for event callbacks
00059         auto handler1 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00060             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* pOven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00061         {
00062             HRESULT hr = S_OK;
00063             try
00064             {
00065                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00066                 OvenClientWRLOutput->Text += "Event Handler 1: Invoked\n";
00067
00068                 ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> appliance;
00069                 hr = pOven->QueryInterface(IID_PPV_ARGS(&appliance));
00070                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00071
00072                 double volume;
00073                 hr = appliance->get_Volume(&volume);
00074                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00075
00076                 OvenClientWRLOutput->Text += "Event Handler 1: Oven volume is: " + volume.ToString() + "\n";
00077
00078                 ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IBread> bread;
00079                 hr = args->get_Bread(&bread);
00080                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00081
00082                 HString flavor;
00083                 hr = bread->get_Flavor(flavor.GetAddressOf());
00084                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00085
00086                 OvenClientWRLOutput->Text += "Event Handler 1: Bread flavor is: " + ref new Platform::String(flavor.Get()) + "\n";
00087             }
00088             catch (Platform::COMException^ e)
00089             {
00090                 hr = e->HResult;
00091             }
00092             return hr;
00093         });
00094
00095         auto handler2 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00096             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* oven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00097         {
00098             HRESULT hr = S_OK;
00099             try
00100             {
00101                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00102                 OvenClientWRLOutput->Text += "Event Handler 2: Invoked\n";
00103             }
00104             catch (Platform::COMException^ e)
00105             {
00106                 hr = e->HResult;
00107             }
00108             return hr;
00109         });
00110
00111         auto handler3 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00112             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* oven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00113         {
00114             // Event handler 3 was removed and will not be invoked
00115             HRESULT hr = S_OK;
00116             try
00117             {
00118                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00119                 OvenClientWRLOutput->Text += "Event Handler 3: Invoked\n";
00120             }
00121             catch (Platform::COMException^ e)
00122             {
00123                 hr = e->HResult;
00124             }
00125             return hr;
00126         });
00127
00128         // Registering event listeners
00129         ::EventRegistrationToken token1;
00130         ::EventRegistrationToken token2;
00131         ::EventRegistrationToken token3;
00132         hr = _myOven->add_BreadBaked(handler1.Get(), &token1);
00133         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00134         hr = _myOven->add_BreadBaked(handler2.Get(), &token2);
00135         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00136         hr = _myOven->add_BreadBaked(handler3.Get(), &token3);
00137         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00138
00139         // Unregister from an event using the registration token
00140         hr = _myOven->remove_BreadBaked(token3);
00141         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00142
00143         // Bake a loaf of bread. This will trigger the BreadBaked event.
00144         hr = _myOven->BakeBread(HStringReference(L"Sourdough").Get());
00145         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00146
00147         // Trigger the event again with a different preheat time
00148         hr = _myOven->ConfigurePreheatTemperature(ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature_High);
00149         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00150
00151         hr = _myOven->BakeBread(HStringReference(L"Wheat").Get());
00152         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00153     }
00154     catch (Platform::COMException^ e)
00155     {
00156         e->HResult;
00157     }
00158 }
00159
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/pch.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/pch.h Source File

  • CameraStarterKit
  • cpp

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario2.xaml.cs Source File

  • AllJoyn
  • ConsumerExperiences
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace AllJoynConsumerExperiences
00016 {
00017     public sealed partial class Scenario2 : Page
00018     {
00019         private Scenario2ViewModel m_scenario2ViewModel = null;
00020
00021         public Scenario2()
00022         {
00023             InitializeComponent();
00024             m_scenario2ViewModel = new Scenario2ViewModel();
00025             DataContext = m_scenario2ViewModel;
00026         }
00027
00028         // Cleanup scenario when it is about to be unloaded.
00029         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00030         {
00031             if (m_scenario2ViewModel != null)
00032             {
00033                 m_scenario2ViewModel.ScenarioCleanup();
00034             }
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_TrackPosition Member List

This is the complete list of members for Scenario1_TrackPosition, including all inherited members.
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_TrackPosition |
OnPositionChanged(Windows::Devices::Geolocation::Geolocator const &, Windows::Devices::Geolocation::PositionChangedEventArgs e) | Scenario1_TrackPosition | [private]
OnStatusChanged(Windows::Devices::Geolocation::Geolocator const &, Windows::Devices::Geolocation::StatusChangedEventArgs e) | Scenario1_TrackPosition | [private]
Scenario1_TrackPosition() | Scenario1_TrackPosition |
StartTracking(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_TrackPosition |
StopTracking(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_TrackPosition |
UpdateLocationData(Windows::Devices::Geolocation::Geoposition const &position) | Scenario1_TrackPosition | [private]
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ISecureInterfaceSignals Member List

This is the complete list of members for ISecureInterfaceSignals, including all inherited members.
TextSentReceived ISecureInterfaceSignals
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/SampleOverlay.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

SampleOverlay.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "DirectXHelper.h"
00015 #include "DeviceResources.h"
00016
00017 // This class is responsible for initializing and rendering the title overlay visible
00018 // at the top of the DirectX SDK samples.
00019 namespace CustomComputeShader
00020 {
00021     class SampleOverlay
00022     {
00023     public:
00024         SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption);
00025         void CreateDeviceDependentResources();
00026         void CreateWindowSizeDependentResources();
00027         void ReleaseDeviceDependentResources();
00028         void Render();
00029         float GetTitleHeightInDips();
00030
00031     private:
00032         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00033
00034         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>    m_whiteBrush;
00035         Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>  m_stateBlock;
00036
00037         Microsoft::WRL::ComPtr<ID2D1Bitmap>             m_logoBitmap;
00038         Microsoft::WRL::ComPtr<IDWriteTextLayout>       m_textLayout;
00039
00040         UINT                                            m_idIncrement;
00041         bool                                            m_drawOverlay;
00042         std::wstring                                    m_caption;
00043         float                                           m_padding;
00044         float                                           m_textVerticalOffset;
00045         D2D1_SIZE_F                                     m_logoSize;
00046         float                                           m_overlayWidth;
00047     };
00048 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CustomDecay.h Source File

  • SpatialSound
  • cpp

CustomDecay.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 //
00015 // Sound that demonstrates custom distance decay behavior where the
00016 // gain applied on the source can be controlled on every frame.
00017 //
00018 class CustomDecaySound
00019 {
00020 public:
00021     virtual ~CustomDecaySound();
00022     HRESULT Initialize(_In_ LPCWSTR filename);
00023
00024     HRESULT Start();
00025     HRESULT Stop();
00026     HRESULT OnUpdate(_In_ float x, _In_ float, _In_ float z);
00027     HRESULT SetEnvironment(_In_ HrtfEnvironment environment);
00028     HrtfEnvironment GetEnvironment() { return _environment; }
00029
00030 private:
00031     AudioFileReader                 _audioFile;
00032     ComPtr<IXAudio2>                _xaudio2;
00033     IXAudio2SourceVoice*            _sourceVoice = nullptr;
00034     ComPtr<IXAPOHrtfParameters>     _hrtfParams;
00035     HrtfEnvironment                 _environment = HrtfEnvironment::Outdoors;
00036 };
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/SampleConfiguration.h Source File

  • OnDemandHotspot
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     namespace Constants
00018     {
00019         // This GUID can be any value. Use it to distinguish among different hotspots
00020         // managed by the same app.
00021         constexpr winrt::guid SampleHotspotGuid{L"4c6e8b20-b2de-472e-808b-bd423e168cd0"};
00022
00023         // Information about our task that updates the hotspot metadata.
00024         // The EntryPoint must match the value declared in the application manifest.
00025         inline constexpr wchar_t MetadataUpdateTaskName[] = L"UpdateMetadataTask";
00026         inline constexpr wchar_t MetadataUpdateEntryPoint[] = L"BackgroundTask.UpdateMetadataTask";
00027
00028         // Information about our task that turns on the hotspot.
00029         // The EntryPoint must match the value declared in the application manifest.
00030         inline constexpr wchar_t ConnectTaskName[] = L"ConnectTask";
00031         inline constexpr wchar_t ConnectEntryPoint[] = L"BackgroundTask.ConnectTask";
00032
00033         // Information about our task that monitors whether the hotspot is nearby.
00034         // (We don't actually have a device watcher task, but if we did, its entry
00035         // point must match the value declared in the application manifest.)
00036         inline constexpr wchar_t DeviceWatcherTaskName[] = L"DeviceWatcherTask";
00037     }
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/03_DIAL_Sender_API.xaml.cs Source File

  • AdvancedCasting
  • cs

03_DIAL_Sender_API.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using ScreenCasting.Controls;
00013 using ScreenCasting.Data.Azure;
00014 using ScreenCasting.Data.Common;
00015 using System;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Foundation;
00018 using Windows.Media.DialProtocol;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace ScreenCasting
00025 {
00026     public sealed partial class Scenario03 : Page
00027     {
00028         private MainPage rootPage;
00029         private DialDevicePicker picker = null;
00030         private VideoMetaData video = null;
00031         private DialDevice activeDialDevice = null;
00032         private DeviceInformation activeDeviceInformation = null;
00033
00034
00035         public Scenario03()
00036         {
00037             this.InitializeComponent();
00038
00039             rootPage = MainPage.Current;
00040
00041             //Subscribe to player events
00042             player.MediaOpened += Player_MediaOpened;
00043             player.MediaFailed += Player_MediaFailed;
00044             player.CurrentStateChanged += Player_CurrentStateChanged;
00045
00046             // Get an Azure hosted video
00047             AzureDataProvider dataProvider = new AzureDataProvider();
00048             video = dataProvider.GetRandomVideo();
00049
00050             //Set the source on the player
00051             rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
00052             this.player.Source = video.VideoLink;
00053
00054             //Subscribe for the clicked event on the custom cast button
00055             ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;
00056
00057             //Configure the DIAL launch arguments for the current video
00058             this.dial_launch_args_textbox.Text = string.Format("v={0}&t=0&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id);
00059
00060             //Subscribe for the clicked event on the custom cast button
00061             ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;
00062
00063             // Instantiate the Device Picker
00064             picker = new DialDevicePicker();
00065
00066             //Add the DIAL Filter, so that the application only shows DIAL devices that have
00067             // the application installed or advertise that they can install them.
00068             picker.Filter.SupportedAppNames.Add(this.dial_appname_textbox.Text);
00069
00070             //Hook up device selected event
00071             picker.DialDeviceSelected += Picker_DeviceSelected;
00072
00073             //Hook up the picker disconnected event
00074             picker.DisconnectButtonClicked += Picker_DisconnectButtonClicked;
00075
00076             //Hook up the picker dismissed event
00077             picker.DialDevicePickerDismissed += Picker_DevicePickerDismissed;
00078         }
00079         private void TransportControls_CastButtonClicked(object sender, EventArgs e)
00080         {
00081             rootPage.NotifyUser("Show Device Picker Button Clicked", NotifyType.StatusMessage);
00082
00083             //Pause Current Playback
00084             player.Pause();
00085
00086             //Get the custom transport controls
00087             MediaTransportControlsWithCustomCastButton mtc = (MediaTransportControlsWithCustomCastButton)this.player.TransportControls;
00088             //Retrieve the location of the casting button
00089             GeneralTransform transform = mtc.CastButton.TransformToVisual(Window.Current.Content as UIElement);
00090             Point pt = transform.TransformPoint(new Point(0, 0));
00091
00092             //Show the picker above our Show Device Picker button
00093             picker.Show(new Rect(pt.X, pt.Y, mtc.CastButton.ActualWidth, mtc.CastButton.ActualHeight), Windows.UI.Popups.Placement.Above);
00094
00095             try
00096             {
00097                 if (activeDialDevice != null)
00098                     picker.SetDisplayStatus(activeDialDevice, DialDeviceDisplayStatus.Connected);
00099             }
00100             catch (Exception ex)
00101             {
00102                 UnhandledExceptionPage.ShowUnhandledException(ex);
00103             }
00104         }
00105
00106         #region Device Picker Methods
00107
00108         private async void Picker_DevicePickerDismissed(DialDevicePicker sender, object args)
00109         {
00110             //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
00111             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00112             {
00113                 try
00114                 {
00115                     rootPage.NotifyUser(string.Format("Picker DevicePickerDismissed event fired for device"), NotifyType.StatusMessage);
00116
00117                     if (activeDialDevice != null)
00118                     {
00119                         // Resume video playback
00120                         this.player.Play();
00121                     }
00122                 }
00123                 catch (Exception ex)
00124                 {
00125                     UnhandledExceptionPage.ShowUnhandledException(ex);
00126                 }
00127             });
00128         }
00129
00130         private async void Picker_DisconnectButtonClicked(DialDevicePicker sender, DialDisconnectButtonClickedEventArgs args)
00131         {
00132             //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
00133             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00134             {
00135                 try
00136                 {
00137                     rootPage.NotifyUser(string.Format("Picker DisconnectButtonClicked event fired for device '{0}'", activeDeviceInformation.Name), NotifyType.StatusMessage);
00138
00139                     // Get the DialDevice instance for the selected device
00140                     DialDevice selectedDialDevice = await DialDevice.FromIdAsync(args.Device.Id);
00141                     // Update the picker status
00142                     picker.SetDisplayStatus(selectedDialDevice, DialDeviceDisplayStatus.Connecting);
00143
00144                     DialApp app = selectedDialDevice.GetDialApp(this.dial_appname_textbox.Text);
00145
00146                     //Get the current application state
00147                     //DialAppStateDetails stateDetails = await app.GetAppStateAsync();
00148
00149                     DialAppStopResult result = await app.StopAsync();
00150
00151                     if (result == DialAppStopResult.Stopped)
00152                     {
00153                         // In case getting the application state failed because of a network failure, you could add retry logic
00154                         rootPage.NotifyUser("Application stopped successfully.", NotifyType.StatusMessage);
00155                         picker.SetDisplayStatus(args.Device, DialDeviceDisplayStatus.Disconnected);
00156                         activeDialDevice = null;
00157                         activeDeviceInformation = null;
00158                         picker.Hide();
00159                     }
00160                     else
00161                     {
00162                         if (result == DialAppStopResult.StopFailed || result == DialAppStopResult.NetworkFailure)
00163                         {
00164                             // In case getting the application state failed because of a network failure, you could add retry logic
00165                             rootPage.NotifyUser(string.Format("Error occured trying to stop application. Status: '{0}'", result.ToString()), NotifyType.StatusMessage);
00166                             picker.SetDisplayStatus(args.Device, DialDeviceDisplayStatus.Error);
00167                         }
00168                         else //in case of DialAppStopResult.OperationNotSupported, there is not much more you can do. You could implement your own
00169                              // mechanism to stop the application on that device.
00170                         {
00171                             // In case getting the application state failed because of a network failure, you could add retry logic
00172                             rootPage.NotifyUser(string.Format("Stop is not supported by device: '{0}'", activeDeviceInformation.Name), NotifyType.ErrorMessage);
00173                             activeDialDevice = null;
00174                             activeDeviceInformation = null;
00175
00176                         }
00177                     }
00178                 }
00179                 catch (Exception ex)
00180                 {
00181                     UnhandledExceptionPage.ShowUnhandledException(ex);
00182                 }
00183
00184             });
00185         }
00186
00187         private async void Picker_DeviceSelected(DialDevicePicker sender, DialDeviceSelectedEventArgs args)
00188         {
00189             //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
00190             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00191             {
00192                 try {
00193                     rootPage.NotifyUser(string.Format("Picker DeviceSelected event fired"), NotifyType.StatusMessage);
00194
00195                     // Set the status to connecting
00196                     picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Connecting);
00197
00198                     rootPage.NotifyUser(string.Format("Resolving DialDevice'"), NotifyType.StatusMessage);
00199
00200                     //Get the DialApp object for the specific application on the selected device
00201                     DialApp app = args.SelectedDialDevice.GetDialApp(this.dial_appname_textbox.Text);
00202
00203                     if (app == null)
00204                     {
00205                         //Try to create a DIAL device. If it doesn't succeed, the selected device does not support DIAL.
00206                         //rootPage.NotifyUser(string.Format("'{0}' cannot find app with ID '{1}'", selectedDeviceInformation.Name, this.dial_appname_textbox.Text), NotifyType.StatusMessage);
00207                         picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Error);
00208                     }
00209                     else
00210                     {
00211                         rootPage.NotifyUser(string.Format("Attempting to launch '{0}'", app.AppName), NotifyType.StatusMessage);
00212                         //Launch the application on the 1st screen device
00213                         DialAppLaunchResult result = await app.RequestLaunchAsync(this.dial_launch_args_textbox.Text);
00214
00215                         //Verify to see whether the application was launched
00216                         if (result == DialAppLaunchResult.Launched)
00217                         {
00218                             rootPage.NotifyUser(string.Format("Launched '{0}'", app.AppName), NotifyType.StatusMessage);
00219                             activeDialDevice = args.SelectedDialDevice;
00220                             DeviceInformation selectedDeviceInformation = await DeviceInformation.CreateFromIdAsync(args.SelectedDialDevice.Id);
00221
00222                             activeDeviceInformation = selectedDeviceInformation;
00223
00224                             //This is where you will need to add you application specific communication between your 1st and 2nd screen applications
00225                             //...
00226                             //...
00227                             //...
00228
00229                             picker.SetDisplayStatus(activeDialDevice, DialDeviceDisplayStatus.Connected);
00230                             picker.Hide();
00231                         }
00232                         else
00233                         {
00234                             rootPage.NotifyUser(string.Format("Attempting to launch '{0}'", app.AppName), NotifyType.StatusMessage);
00235                             picker.SetDisplayStatus(args.SelectedDialDevice, DialDeviceDisplayStatus.Error);
00236                         }
00237                     }
00238                 }
00239                 catch (Exception ex)
00240                 {
00241                     UnhandledExceptionPage.ShowUnhandledException(ex);
00242                 }
00243             });
00244         }
00245
00246         #endregion
00247
00248         #region Media Element Status Methods
00249         private void Player_CurrentStateChanged(object sender, RoutedEventArgs e)
00250         {
00251             // Update status
00252             rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
00253         }
00254         private void Player_MediaFailed(object sender, ExceptionRoutedEventArgs e)
00255         {
00256             // Update status
00257             rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
00258         }
00259         private void Player_MediaOpened(object sender, RoutedEventArgs e)
00260         {
00261             // Update status
00262             rootPage.NotifyUser(string.Format("Openend '{0}'", video.Title), NotifyType.StatusMessage);
00263             // Start playback
00264             player.Play();
00265         }
00266
00267         #endregion
00268
00269         protected override void OnNavigatedTo(NavigationEventArgs e)
00270         {
00271             rootPage = MainPage.Current;
00272         }
00273
00274     }
00275 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/SocialMediaCounter.cs Source File

  • XamlFocusVisuals
  • cs

SocialMediaCounter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Runtime.InteropServices.WindowsRuntime;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007 using Windows.UI.Xaml.Data;
00008 using Windows.UI.Xaml.Documents;
00009 using Windows.UI.Xaml.Input;
00010 using Windows.UI.Xaml.Media;
00011
00012 // The Templated Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234235
00013
00014 namespace FocusVisualsSample
00015 {
00016     public sealed class SocialMediaCounter : HyperlinkButton
00017     {
00018         public static readonly DependencyProperty ShareImageProperty = DependencyProperty.Register("ShareImage", typeof(ImageSource), typeof(SocialMediaCounter), new PropertyMetadata(null));
00019         public ImageSource ShareImage
00020         {
00021             get { return (ImageSource)GetValue(ShareImageProperty); }
00022             set { SetValue(ShareImageProperty, value); }
00023         }
00024
00025         public static readonly DependencyProperty NumOfSharesProperty = DependencyProperty.Register("NumOfShares", typeof(int), typeof(SocialMediaCounter), new PropertyMetadata(0));
00026         public int NumOfShares
00027         {
00028             get { return (int)GetValue(NumOfSharesProperty); }
00029             set { SetValue(NumOfSharesProperty, value); }
00030         }
00031
00032         public SocialMediaCounter()
00033         {
00034             this.DefaultStyleKey = typeof(SocialMediaCounter);
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
BackgroundDeviceWatcher() | sealed | [inline]
Run(IBackgroundTaskInstance^taskInstance) | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingEventArgs.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingEventArgs.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace org { namespace alljoyn { namespace Onboarding {
00024
00025 // Signals
00026 // "This signal is emitted when the connection attempt against the personal AP is completed"
00027 public ref class OnboardingConnectionResultReceivedEventArgs sealed
00028 {
00029 public:
00030     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00031     {
00032         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00033         void set(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ value) { m_messageInfo = value; }
00034     }
00035
00036     property Onboarding^ Arg
00037     {
00038         Onboarding^ get() { return m_interfaceMemberArg; }
00039     internal:
00040         void set(_In_ Onboarding^ value) { m_interfaceMemberArg = value; }
00041     }
00042
00043 private:
00044     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00045
00046     Onboarding^ m_interfaceMemberArg;
00047 };
00048
00049
00050 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
__pad0__ MainPage
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario7_ScrollingContentUsingMarquee.xaml.cs Source File

  • LineDisplay
  • cs

Scenario7_ScrollingContentUsingMarquee.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.ComponentModel;
00016 using System.Threading.Tasks;
00017 using Windows.Devices.PointOfService;
00018 using Windows.Foundation;
00019 using Windows.Security.Cryptography;
00020 using Windows.Storage.Streams;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Data;
00024 using Windows.UI.Xaml.Navigation;
00025
00026 namespace SDKTemplate
00027 {
00028     public sealed partial class Scenario7_ScrollingContentUsingMarquee : Page
00029     {
00030         private MainPage rootPage = MainPage.Current;
00031         private ClaimedLineDisplay lineDisplay;
00032         private LineDisplayWindow horizontalScrollableWindow;
00033         private LineDisplayWindow verticalScrollableWindow;
00034
00035         public Scenario7_ScrollingContentUsingMarquee()
00036         {
00037             this.InitializeComponent();
00038             this.DataContext = this;
00039         }
00040
00041         protected override async void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             await InitializeAsync();
00044         }
00045
00046         protected override void OnNavigatedFrom(NavigationEventArgs e)
00047         {
00048             horizontalScrollableWindow?.Dispose();
00049             horizontalScrollableWindow = null;
00050             verticalScrollableWindow?.Dispose();
00051             verticalScrollableWindow = null;
00052             lineDisplay?.Dispose();
00053             lineDisplay = null;
00054         }
00055
00056         private async Task InitializeAsync()
00057         {
00058             lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();
00059
00060             if (lineDisplay != null)
00061             {
00062                 Size screenSize = lineDisplay.GetAttributes().ScreenSizeInCharacters;
00063                 int windowCount = 1;
00064
00065                 if (lineDisplay.Capabilities.IsHorizontalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows))
00066                 {
00067                     // Create a horizontal scrollable window by creating a window
00068                     // whose width is wider than the viewport.
00069                     horizontalScrollableWindow = await lineDisplay.TryCreateWindowAsync(
00070                         new Rect()
00071                         {
00072                             X = 0,
00073                             Y = 0,
00074                             Width = screenSize.Width,
00075                             Height = screenSize.Height
00076                         },
00077                         new Size()
00078                         {
00079                             Width = screenSize.Width * 2,
00080                             Height = screenSize.Height
00081                         });
00082
00083                     if (horizontalScrollableWindow != null)
00084                     {
00085                         windowCount++;
00086                         ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Left);
00087                         ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Right);
00088                     }
00089                 }
00090
00091                 if (lineDisplay.Capabilities.IsVerticalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows))
00092                 {
00093                     // Create a vertical scrollable window by creating a window
00094                     // whose height is taller than the viewport.
00095                     verticalScrollableWindow = await lineDisplay.TryCreateWindowAsync(
00096                         new Rect()
00097                         {
00098                             X = 0,
00099                             Y = 0,
00100                             Width = screenSize.Width,
00101                             Height = screenSize.Height
00102                         },
00103                         new Size()
00104                         {
00105                             Width = screenSize.Width,
00106                             Height = screenSize.Height * 2
00107                         });
00108
00109                     if (verticalScrollableWindow != null)
00110                     {
00111                         windowCount++;
00112                         ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Up);
00113                         ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Down);
00114                     }
00115                 }
00116             }
00117
00118             if (ScrollDirectionComboBox.Items.Count > 0)
00119             {
00120                 ScrollDirectionComboBox.SelectedIndex = 0;
00121                 StartScrollingButton.IsEnabled = true;
00122                 StopScrollingButton.IsEnabled = true;
00123             }
00124         }
00125
00126         private async void StartScrollingButton_Click(object sender, RoutedEventArgs e)
00127         {
00128             LineDisplayScrollDirection scrollDirection = (LineDisplayScrollDirection)ScrollDirectionComboBox.SelectedItem;
00129             LineDisplayWindow selectedWindow = null;
00130
00131             if (scrollDirection == LineDisplayScrollDirection.Left || scrollDirection == LineDisplayScrollDirection.Right)
00132             {
00133                 selectedWindow = horizontalScrollableWindow;
00134             }
00135             else
00136             {
00137                 selectedWindow = verticalScrollableWindow;
00138             }
00139
00140             // Cannot make changes while scrolling is active.
00141             await StopAllScrollingAsync();
00142
00143             // Bring the window to the front, clear its old contents,
00144             // and display some text that will require scrolling.
00145             await selectedWindow.TryRefreshAsync();
00146             await selectedWindow.TryClearTextAsync();
00147             await selectedWindow.TryDisplayTextAsync(
00148                 "An incredibly lengthy string of arbitrary text that cannot be displayed on most line displays " +
00149                 "without being scrolled into view. It will need to be scrolled into view left, right, up or down.");
00150
00151             // Configure the scrolling behavior and start scrolling.
00152             selectedWindow.Marquee.Format = (LineDisplayMarqueeFormat)MarqueeFormatComboBox.SelectedItem;
00153             selectedWindow.Marquee.RepeatWaitInterval = TimeSpan.FromMilliseconds(RepeatWaitIntervalSlider.Value);
00154             selectedWindow.Marquee.ScrollWaitInterval = TimeSpan.FromMilliseconds(ScrollWaitIntervalSlider.Value);
00155             await selectedWindow.Marquee.TryStartScrollingAsync(scrollDirection);
00156         }
00157
00158         private async Task StopAllScrollingAsync()
00159         {
00160             if (horizontalScrollableWindow != null)
00161             {
00162                 await horizontalScrollableWindow.Marquee.TryStopScrollingAsync();
00163             }
00164
00165             if (verticalScrollableWindow != null)
00166             {
00167                 await verticalScrollableWindow.Marquee.TryStopScrollingAsync();
00168             }
00169         }
00170         private async void StopScrollingButton_Click(object sender, RoutedEventArgs e)
00171         {
00172             await StopAllScrollingAsync();
00173         }
00174     }
00175 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SampleConfiguration.cpp Source File

  • ShareSource
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SharePage.h"
00006 #include "SampleConfiguration.h"
00007
00008 using namespace SDKTemplate;
00009 using namespace Windows::ApplicationModel::Activation;
00010 using namespace Windows::UI::Xaml;
00011 using namespace Windows::UI::Xaml::Controls;
00012 using namespace Windows::UI::Xaml::Interop;
00013
00014 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00015 {
00016     { "Share text",                 "SDKTemplate.ShareText" },
00017     { "Share web link",             "SDKTemplate.ShareWebLink" },
00018     { "Share application link",     "SDKTemplate.ShareApplicationLink" },
00019     { "Share image",                "SDKTemplate.ShareImage" },
00020     { "Share files",                "SDKTemplate.ShareFiles" },
00021     { "Share delay rendered files", "SDKTemplate.ShareDelayRenderedFiles" },
00022     { "Share HTML content",         "SDKTemplate.ShareHtml" },
00023     { "Share custom data",          "SDKTemplate.ShareCustomData" },
00024     { "Share with custom provider", "SDKTemplate.ShareCustomProvider" },
00025     { "Fail with display text",     "SDKTemplate.SetErrorMessage" }
00026 };
00027
00028 void App::OnActivated(IActivatedEventArgs^ args)
00029 {
00030     Frame^ rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00031     if (rootFrame == nullptr)
00032     {
00033         rootFrame = ref new Frame();
00034         rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
00035         rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00036         rootFrame->Navigate(TypeName(MainPage::typeid));
00037         Window::Current->Content = rootFrame;
00038     }
00039
00040     // Protocol activation is the only type of activation that this app handles
00041     if (args->Kind == ActivationKind::Protocol)
00042     {
00043         ProtocolActivatedEventArgs^ protocolArgs = (ProtocolActivatedEventArgs^)args;
00044         ((MainPage^)rootFrame->Content)->LoadScenarioForProtocolActivation(protocolArgs);
00045     }
00046
00047     Window::Current->Activate();
00048 }
00049
00050 void MainPage::LoadScenarioForProtocolActivation(ProtocolActivatedEventArgs^ protocolArgs)
00051 {
00052     for (size_t i = 0; i < scenarios->Length; i++)
00053     {
00054         if (protocolArgs->Uri->Equals(SharePage::GetApplicationLink(scenarios[i].ClassName)))
00055         {
00056             // By setting the selected index, the Scenarios_SelectionChanged(...) method will be called
00057             ScenarioControl->SelectedIndex = i;
00058             break;
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/GameObject.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

GameObject.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameObject.h"
00014 #include "GameConstants.h"
00015
00016 using namespace DirectX;
00017
00018 GameObject::GameObject() :
00019     m_normalMaterial(nullptr),
00020     m_hitMaterial(nullptr)
00021 {
00022     m_active = false;
00023     m_target = false;
00024     m_targetId = 0;
00025     m_hit = false;
00026     m_ground = true;
00027
00028     m_position = XMFLOAT3(0.0f, 0.0f, 0.0f);
00029     m_velocity = XMFLOAT3(0.0f, 0.0f, 0.0f);
00030     m_defaultXAxis = XMFLOAT3(1.0f, 0.0f, 0.0f);
00031     m_defaultYAxis = XMFLOAT3(0.0f, 1.0f, 0.0f);
00032     m_defaultZAxis = XMFLOAT3(0.0f, 0.0f, 1.0f);
00033     XMStoreFloat4x4(&m_modelMatrix, XMMatrixIdentity());
00034
00035     m_hitTime = 0.0f;
00036
00037     m_animatePosition = nullptr;
00038 }
00039
00040 void GameObject::Render(
00041     _In_ ID3D11DeviceContext* context,
00042     _In_ ID3D11Buffer* primitiveConstantBuffer
00043     )
00044 {
00045     if (!m_active || (m_mesh == nullptr) || (m_normalMaterial == nullptr))
00046     {
00047         return;
00048     }
00049
00050     ConstantBufferChangesEveryPrim constantBuffer;
00051
00052     XMStoreFloat4x4(
00053         &constantBuffer.worldMatrix,
00054         XMMatrixTranspose(ModelMatrix())
00055         );
00056
00057     if (m_hit && m_hitMaterial != nullptr)
00058     {
00059         m_hitMaterial->RenderSetup(context, &constantBuffer);
00060     }
00061     else
00062     {
00063         m_normalMaterial->RenderSetup(context, &constantBuffer);
00064     }
00065     context->UpdateSubresource(primitiveConstantBuffer, 0, nullptr, &constantBuffer, 0, 0);
00066
00067     m_mesh->Render(context);
00068 }
00069
00070 void GameObject::PlaySound(float impactSpeed, XMFLOAT3 eyePoint)
00071 {
00072     if (m_hitSound != nullptr)
00073     {
00074         // Determine the sound volume adjustment based on velocity.
00075         float adjustment;
00076         if (impactSpeed < GameConstants::Sound::MinVelocity)
00077         {
00078             adjustment = 0.0f;  // Too soft. Don't play sound.
00079         }
00080         else
00081         {
00082             adjustment = min(1.0f, impactSpeed / GameConstants::Sound::MaxVelocity);
00083             adjustment = GameConstants::Sound::MinAdjustment + adjustment * (1.0f - GameConstants::Sound::MinAdjustment);
00084         }
00085
00086         // Compute Distance to eyePoint to adjust the volume based on that distance.
00087         XMVECTOR cameraToPosition = XMLoadFloat3(&eyePoint) - VectorPosition();
00088         float distToPositionSquared = XMVectorGetX(XMVector3LengthSq(cameraToPosition));
00089
00090         float volume = min(distToPositionSquared, 1.0f);
00091         // Scale
00092         // Sound is proportional to how hard the ball is hitting.
00093         volume = adjustment * volume;
00094
00095         m_hitSound->PlaySound(volume);
00096     }
00097 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/GetMatchingPropertiesWithRanges.xaml.h Source File

  • SemanticTextQuery
  • cpp

GetMatchingPropertiesWithRanges.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // GetMatchingPropertiesWithRanges.xaml.h
00014 // Declaration of the Scenario3 class
00015 //
00016
00017 #pragma once
00018 #include "GetMatchingPropertiesWithRanges.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public ref class Scenario3 sealed
00026     {
00027     public:
00028         Scenario3();
00029
00030     private:
00031         void Find_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032     };
00033 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario5_IsSupported.xaml.h Source File

  • JumpList
  • cpp

Scenario5_IsSupported.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_IsSupported.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario5_IsSupported sealed
00021     {
00022     public:
00023         Scenario5_IsSupported();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027     };
00028 }
Generated on Fri Nov 15 2024 22:20:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Print Member List

This is the complete list of members for Scenario1_Print, including all inherited members.
CreateFromXml_Click(object sender, RoutedEventArgs e) | Scenario1_Print | [inline, private]
CreatePackageAsync() | Scenario1_Print | [inline, private, static]
CreatePackageFromXmlAsync(string rawXml) | Scenario1_Print | [inline, private, static]
CreateProgrammatically_Click(object sender, RoutedEventArgs e) | Scenario1_Print | [inline, private]
currentPackage | Scenario1_Print | [private]
EnablePackageOperationButtons() | Scenario1_Print | [inline, private]
FixTextureContentTypeAsync(Printing3D3MFPackage package) | Scenario1_Print | [inline, private, static]
LoadPackageFromFile_Click(object sender, RoutedEventArgs e) | Scenario1_Print | [inline, private]
OnTaskRequested(Print3DManager sender, Print3DTaskRequestedEventArgs args) | Scenario1_Print | [inline, private]
PrintPackage_Click(object sender, RoutedEventArgs e) | Scenario1_Print | [inline, private]
rootPage | Scenario1_Print | [private]
SavePackage_Click(object sender, RoutedEventArgs e) | Scenario1_Print | [inline, private]
Scenario1_Print() | Scenario1_Print | [inline]
SetMaterialIndicesAsync(Printing3DMesh mesh) | Scenario1_Print | [inline, private, static]
SetTriangleIndicesAsync(Printing3DMesh mesh) | Scenario1_Print | [inline, private, static]
SetVerticesAsync(Printing3DMesh mesh) | Scenario1_Print | [inline, private, static]
StringToStreamAsync(string data) | Scenario1_Print | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.h Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario4_Snapshot.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_Snapshot.g.h"
00015 #include "MainPage.h"
00016 #include "DeviceWatcherHelper.h"
00017
00018 namespace winrt::SDKTemplate::implementation
00019 {
00020     struct Scenario4_Snapshot : Scenario4_SnapshotT<Scenario4_Snapshot>
00021     {
00022         Scenario4_Snapshot();
00023
00024         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         fire_and_forget FindButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027
00028     private:
00029         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00030         Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection = winrt::single_threaded_observable_vector<SDKTemplate::DeviceInformationDisplay>();
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario4_Snapshot : Scenario4_SnapshotT<Scenario4_Snapshot, implementation::Scenario4_Snapshot>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Scenario2_RequestConsent.cpp Source File

  • UserConsentVerifier
  • cppwinrt

Scenario2_RequestConsent.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_RequestConsent.h"
00014 #include "Scenario2_RequestConsent.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Security::Credentials::UI;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario2_RequestConsent::Scenario2_RequestConsent()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     fire_and_forget Scenario2_RequestConsent::RequestConsent_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         auto lifetime = get_strong();
00031
00032         RequestConsentButton().IsEnabled(false);
00033
00034         // Request the user's consent using Windows Hello via biometric verification or a PIN.
00035         hstring message = L"Please confirm your identity to complete this (pretend) in-app purchase.";
00036         UserConsentVerificationResult consentResult = co_await UserConsentVerifier::RequestVerificationAsync(message);
00037         switch (consentResult)
00038         {
00039         case UserConsentVerificationResult::Verified:
00040             rootPage.NotifyUser(L"Pretend in-app purchase was successful.", NotifyType::StatusMessage);
00041             break;
00042
00043         case UserConsentVerificationResult::DeviceNotPresent:
00044             rootPage.NotifyUser(L"No PIN or biometric found, please set one up.", NotifyType::ErrorMessage);
00045             break;
00046
00047         case UserConsentVerificationResult::Canceled:
00048             rootPage.NotifyUser(L"User consent verification canceled.", NotifyType::ErrorMessage);
00049             break;
00050
00051         default:
00052             rootPage.NotifyUser(L"User consent verification is currently unavailable.", NotifyType::ErrorMessage);
00053             break;
00054         }
00055
00056         RequestConsentButton().IsEnabled(true);
00057     }
00058 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Badges/Local/SecondaryTileBadges/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Badges
  • Local
  • SecondaryTileBadges

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Linq;
00003 using System.Threading.Tasks;
00004 using Windows.Data.Xml.Dom;
00005 using Windows.UI;
00006 using Windows.UI.Notifications;
00007 using Windows.UI.Popups;
00008 using Windows.UI.StartScreen;
00009 using Windows.UI.Xaml;
00010 using Windows.UI.Xaml.Controls;
00011
00012 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00013
00014 namespace Notifications.ScenarioPages.Badges.Local.SecondaryTileBadges
00015 {
00016     /// <summary>
00017     /// An empty page that can be used on its own or navigated to within a Frame.
00018     /// </summary>
00019     public sealed partial class ScenarioElement : UserControl
00020     {
00021         private static readonly string SECONDARY_TILE_ID = "badge";
00022
00023         private void ButtonClearBadge_Click(object sender, RoutedEventArgs e)
00024         {
00025             // Clear the badge from the secondary tile
00026             BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID).Clear();
00027         }
00028
00029         private async void ButtonUpdateBadgeNumber_Click(object sender, RoutedEventArgs e)
00030         {
00031             int num;
00032
00033             if (!int.TryParse(TextBoxBadgeNumber.Text, out num))
00034             {
00035                 await new MessageDialog("You must provide a valid integer.", "Error").ShowAsync();
00036                 return;
00037             }
00038
00039             // Get the blank badge XML payload for a badge number
00040             XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
00041
00042             // Set the value of the badge in the XML to our number
00043             XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
00044             badgeElement.SetAttribute("value", num.ToString());
00045
00046             // Create the badge notification
00047             BadgeNotification badge = new BadgeNotification(badgeXml);
00048
00049             // Create the badge updater for our secondary tile, using our tile ID for the secondary tile
00050             BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID);
00051
00052             // And update the badge
00053             badgeUpdater.Update(badge);
00054         }
00055
00056         private void ButtonUpdateBadgeGlyph_Click(object sender, RoutedEventArgs e)
00057         {
00058             string badgeGlyphValue = ComboBoxBadgeGlyph.SelectedItem as string;
00059
00060             // Get the blank badge XML payload for a badge glyph
00061             XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);
00062
00063             // Set the value of the badge in the XML to our glyph value
00064             XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
00065             badgeElement.SetAttribute("value", badgeGlyphValue);
00066
00067             // Create the badge notification
00068             BadgeNotification badge = new BadgeNotification(badgeXml);
00069
00070             // Create the badge updater for our secondary tile, using our tile ID for the secondary tile
00071             BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SECONDARY_TILE_ID);
00072
00073             // And update the badge
00074             badgeUpdater.Update(badge);
00075         }
00076
00077
00078
00079
00080
00081         public ScenarioElement()
00082         {
00083             this.InitializeComponent();
00084
00085             this.InitializeScenario();
00086         }
00087
00088         private async void InitializeScenario()
00089         {
00090             base.IsEnabled = false;
00091
00092             // If secondary tile already exists, we can continue to the next step automatically
00093             if (await DoesSecondaryTileExist())
00094                 MoveToBadgeStep();
00095             else
00096                 MoveToSecondaryTileStep();
00097
00098             base.IsEnabled = true;
00099         }
00100
00101         private async Task<bool> DoesSecondaryTileExist()
00102         {
00103             var secondaryTiles = await SecondaryTile.FindAllAsync();
00104
00105             return secondaryTiles.Any(i => i.TileId.Equals(SECONDARY_TILE_ID));
00106         }
00107
00108         private void MoveToBadgeStep()
00109         {
00110             ScrollViewerSecondaryTile.Visibility = Visibility.Collapsed;
00111             ScrollViewerBadge.Visibility = Visibility.Visible;
00112         }
00113
00114         private void MoveToSecondaryTileStep()
00115         {
00116             ScrollViewerSecondaryTile.Visibility = Visibility.Visible;
00117             ScrollViewerBadge.Visibility = Visibility.Collapsed;
00118         }
00119
00120         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00121         {
00122             // Create and pin new secondary tile for badges
00123             SecondaryTile tile = new SecondaryTile(SECONDARY_TILE_ID, "Badges", "args", new Uri("ms-appx:///Assets/Logo.png"), TileSize.Default);
00124             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00125             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00126             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00127             tile.VisualElements.BackgroundColor = Colors.Blue;
00128             await tile.RequestCreateAsync();
00129
00130             // Move to the next step
00131             MoveToBadgeStep();
00132         }
00133     }
00134 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/SampleConfiguration.cs Source File

  • AllJoyn
  • ConsumerExperiences
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using AllJoynConsumerExperiences;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "AllJoyn Consumer Experiences";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Secure Consumer", ClassType=typeof(Scenario1)},
00026             new Scenario() { Title="Onboarding Consumer", ClassType=typeof(Scenario2)}
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SkeletalFrameRenderer.cpp Source File

  • CameraStreamCorrelation
  • cpp

SkeletalFrameRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SkeletalFrameRenderer.h"
00014 #include <initguid.h>
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI;
00021 using namespace Windows::UI::Xaml::Media;
00022 using namespace Windows::UI::Xaml::Shapes;
00023 using namespace WindowsPreview::Media::Capture::Frames;
00024
00025 // The Templated Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234235
00026
00027 // Skeleton colors.
00028 static std::array<Color, 9> colors = {
00029     ColorHelper::FromArgb(0xFF, 0x7F, 0x00, 0x00),
00030     ColorHelper::FromArgb(0xFF, 0xFF, 0x00, 0x00),
00031     ColorHelper::FromArgb(0xFF, 0xFF, 0x7F, 0x00),
00032     ColorHelper::FromArgb(0xFF, 0xFF, 0xFF, 0x00),
00033     ColorHelper::FromArgb(0xFF, 0x7F, 0xFF, 0x7F),
00034     ColorHelper::FromArgb(0xFF, 0x00, 0xFF, 0xFF),
00035     ColorHelper::FromArgb(0xFF, 0x00, 0x7F, 0xFF),
00036     ColorHelper::FromArgb(0xFF, 0x00, 0x00, 0xFF),
00037     ColorHelper::FromArgb(0xFF, 0x00, 0x00, 0x7F)
00038 };
00039
00040 // Returns line between two body parts transformed using supplied transformation function.
00041 static Line^ LineTo(
00042     Array<TrackedPose>^ poses,
00043     BodyPart fromBodyPart,
00044     BodyPart toBodyPart,
00045     CoordinateTransformationMethod^ positionTransformation)
00046 {
00047     TrackedPose fromTrackedBodyPart = poses[static_cast<UINT32>(fromBodyPart)];
00048     TrackedPose toTrackedBodypart = poses[static_cast<UINT32>(toBodyPart)];
00049
00050     // Only render tracked bones.
00051     if (fromTrackedBodyPart.PositionStatus == TrackingStatus::NotTracked ||
00052         fromTrackedBodyPart.PositionStatus == TrackingStatus::Inferred ||
00053         toTrackedBodypart.PositionStatus == TrackingStatus::NotTracked ||
00054         toTrackedBodypart.PositionStatus == TrackingStatus::Inferred)
00055     {
00056         return nullptr;
00057     }
00058
00059     Point fromPosition = positionTransformation(fromTrackedBodyPart.Position);
00060     Point toPosition = positionTransformation(toTrackedBodypart.Position);
00061
00062     Line^ line = ref new Line();
00063
00064     line->X1 = fromPosition.X;
00065     line->Y1 = fromPosition.Y;
00066     line->X2 = toPosition.X;
00067     line->Y2 = toPosition.Y;
00068
00069     return line;
00070 }
00071
00072 static std::vector<Shape^> RenderSkeletonShapes(
00073     PoseTrackingEntity^ poseEntity,
00074     Brush^ shapeColor,
00075     CoordinateTransformationMethod^ positionTransformation)
00076 {
00077     if (poseEntity == nullptr || !poseEntity->IsTracked)
00078     {
00079         return std::vector<Shape^>();
00080     }
00081
00082     Array<TrackedPose>^ poses = ref new Array<TrackedPose>(poseEntity->PosesCount);
00083     poseEntity->GetPoses(poses);
00084
00085     // Create line shapes for all bones in the skeleton
00086     std::vector<Shape^> shapes{
00087         LineTo(poses, BodyPart::Head,         BodyPart::Neck,            positionTransformation),
00088         LineTo(poses, BodyPart::Neck,         BodyPart::SpineShoulder,   positionTransformation),
00089         LineTo(poses, BodyPart::SpineShoulder,BodyPart::ShoulderLeft,    positionTransformation),
00090         LineTo(poses, BodyPart::SpineShoulder,BodyPart::ShoulderRight,   positionTransformation),
00091         LineTo(poses, BodyPart::ShoulderLeft, BodyPart::ElbowLeft,       positionTransformation),
00092         LineTo(poses, BodyPart::ShoulderRight,BodyPart::ElbowRight,      positionTransformation),
00093         LineTo(poses, BodyPart::ElbowLeft,    BodyPart::WristLeft,       positionTransformation),
00094         LineTo(poses, BodyPart::ElbowRight,   BodyPart::WristRight,      positionTransformation),
00095         LineTo(poses, BodyPart::WristLeft,    BodyPart::HandLeft,        positionTransformation),
00096         LineTo(poses, BodyPart::WristRight,   BodyPart::HandRight,       positionTransformation),
00097         LineTo(poses, BodyPart::HandLeft,     BodyPart::HandTipLeft,     positionTransformation),
00098         LineTo(poses, BodyPart::HandRight,    BodyPart::HandTipRight,    positionTransformation),
00099         LineTo(poses, BodyPart::HandLeft,     BodyPart::ThumbLeft,       positionTransformation),
00100         LineTo(poses, BodyPart::HandRight,    BodyPart::ThumbRight,      positionTransformation),
00101         LineTo(poses, BodyPart::SpineShoulder,BodyPart::SpineMid,        positionTransformation),
00102         LineTo(poses, BodyPart::SpineMid,     BodyPart::SpineBase,       positionTransformation),
00103         LineTo(poses, BodyPart::SpineBase,    BodyPart::HipLeft,         positionTransformation),
00104         LineTo(poses, BodyPart::SpineBase,    BodyPart::HipRight,        positionTransformation),
00105         LineTo(poses, BodyPart::HipLeft,      BodyPart::KneeLeft,        positionTransformation),
00106         LineTo(poses, BodyPart::HipRight,     BodyPart::KneeRight,       positionTransformation),
00107         LineTo(poses, BodyPart::KneeLeft,     BodyPart::AnkleLeft,       positionTransformation),
00108         LineTo(poses, BodyPart::KneeRight,    BodyPart::AnkleRight,      positionTransformation),
00109         LineTo(poses, BodyPart::AnkleLeft,    BodyPart::FootLeft,        positionTransformation),
00110         LineTo(poses, BodyPart::AnkleRight,   BodyPart::FootRight,       positionTransformation)
00111     };
00112
00113     // Apply shape color style.
00114     for (Shape^ const& boneShape : shapes)
00115     {
00116         if (boneShape)
00117         {
00118             boneShape->StrokeThickness = 5;
00119             boneShape->Stroke = shapeColor;
00120         }
00121     }
00122
00123     return shapes;
00124 }
00125
00126 SkeletalFrameRenderer::SkeletalFrameRenderer() :
00127     Canvas()
00128 {
00129     for(auto const& color : colors)
00130     {
00131         m_brushes.push_back(ref new SolidColorBrush(color));
00132     }
00133 }
00134
00135 void SkeletalFrameRenderer::Clear()
00136 {
00137     Children->Clear();
00138 }
00139
00140 void SkeletalFrameRenderer::Render(PoseTrackingFrame^ frame, CoordinateTransformationMethod^ positionTransformation)
00141 {
00142     Clear();
00143
00144     for (UINT32 i = 0; i < frame->Entities->Size; i++)
00145     {
00146         PoseTrackingEntity^ poseEntity = frame->Entities->GetAt(i);
00147
00148         if (poseEntity == nullptr ||
00149             !poseEntity->IsTracked ||
00150             !poseEntity->PoseSetId.Equals(KnownPoseTrackingPointSets::BodyTrackingPointSet))
00151         {
00152             continue;
00153         }
00154
00155         Brush^ lineColor = m_brushes[i % m_brushes.size()];
00156
00157         for (UIElement^ const& bone : RenderSkeletonShapes(poseEntity, lineColor, positionTransformation))
00158         {
00159             if (bone)
00160             {
00161                 Children->Append(bone);
00162             }
00163         }
00164     }
00165 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/SampleConfiguration.cpp Source File

  • XamlCommanding
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "AppBarButtons", "SDKTemplate.Scenario1_AppBarButtons" },
00021     { "Icons", "SDKTemplate.Scenario2_Icons" },
00022     { "Opening/Closing Events", "SDKTemplate.Scenario3_Events" },
00023     { "Control the CommandBar", "SDKTemplate.Scenario4_Control" },
00024     { "Multiple CommandBars", "SDKTemplate.Scenario5_Multiple" },
00025     { "Styling", "SDKTemplate.Scenario6_Styling" },
00026     { "Custom Content", "SDKTemplate.Scenario7_CustomContent" },
00027     { "Command Reflow", "SDKTemplate.Scenario8_Reflow" }
00028 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_GetCurrentTextSegmentFromIndex Member List

This is the complete list of members for Scenario2_GetCurrentTextSegmentFromIndex, including all inherited members.
rootPage | Scenario2_GetCurrentTextSegmentFromIndex | [private]
Scenario2_GetCurrentTextSegmentFromIndex() | Scenario2_GetCurrentTextSegmentFromIndex | [inline]
SelectionSegmentButton_Click(object sender, RoutedEventArgs e) | Scenario2_GetCurrentTextSegmentFromIndex | [inline, private]
WordSegmentButton_Click(object sender, RoutedEventArgs e) | Scenario2_GetCurrentTextSegmentFromIndex | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CachedFileUpdaterPageSizeChangedEventArgs Member List

This is the complete list of members for CachedFileUpdaterPageSizeChangedEventArgs, including all inherited members.
width | CachedFileUpdaterPageSizeChangedEventArgs | [private]
Width | CachedFileUpdaterPageSizeChangedEventArgs |
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/3-DeviceCapabilities.xaml.cpp Source File

  • BasicInput
  • cpp

3-DeviceCapabilities.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "3-DeviceCapabilities.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Devices::Input;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Scenario3::Scenario3()
00030 {
00031     InitializeComponent();
00032
00033     // Retrieve information about whether or not a keyboard is present
00034     KeyboardCapabilities^ kbdCapabilities = ref new KeyboardCapabilities();
00035     keyboardText->Text = "Keyboard present = " + kbdCapabilities->KeyboardPresent.ToString();
00036
00037     // Retrieve information about the capabilities of the device's mouse.  This includes:
00038     // - Whether or not a mouse is present
00039     // - The number of buttons on the mouse
00040     // - Whether or not the mouse has a vertical scroll wheel
00041     // - Whether or not the mouse has a horizontal scroll wheel
00042     // - Whether or not the user has elected to swap the mouse buttons, causing
00043     //   the right mouse button to be the primary button
00044     MouseCapabilities^ mouseCapabilities = ref new MouseCapabilities();
00045     Platform::String^ sb = ref new Platform::String();
00046
00047     sb += "Mouse present = " + mouseCapabilities->MousePresent.ToString() + "\n";
00048     sb += "Number of buttons = " + mouseCapabilities->NumberOfButtons.ToString() + "\n";
00049     sb += "Vertical wheel present = " + mouseCapabilities->VerticalWheelPresent.ToString() + "\n";
00050     sb += "Horizontal wheel present = " + mouseCapabilities->HorizontalWheelPresent.ToString() + "\n";
00051     sb += "Buttons swapped = " + mouseCapabilities->SwapButtons.ToString();
00052     mouseText->Text = sb;
00053
00054     // Retrieve information about the capabilities of the device's mouse.  This includes:
00055     // - Whether or not the device supports touch
00056     // - The supported number of simultaneous touch contacts
00057     TouchCapabilities^ touchCapabilities = ref new TouchCapabilities();
00058     sb = ref new Platform::String();
00059     sb += "Touch present = " + touchCapabilities->TouchPresent.ToString() + "\n";
00060     sb += "Touch contacts supported = " + touchCapabilities->Contacts.ToString();
00061     touchText->Text = sb;
00062 }
Generated on Fri Nov 15 2024 22:18:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/SampleConfiguration.cs Source File

  • DisablingScreenCapture
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Disabling screen capture C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Enabling screen capture", ClassType=typeof(Scenario1_Enable) },
00025             new Scenario() { Title="Disabling screen capture", ClassType=typeof(Scenario2_Disable) },
00026             new Scenario() { Title="Managing AppCapture", ClassType=typeof(Scenario3_AppCapture) },
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario2.xaml.cs Source File

  • SimpleInk
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation;
00014 using Windows.UI.Core;
00015 using Windows.UI.Input.Inking;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Media;
00019 using Windows.UI.Xaml.Navigation;
00020 using Windows.UI.Xaml.Shapes;
00021
00022 namespace SDKTemplate
00023 {
00024     public class CalligraphicPen : InkToolbarCustomPen
00025     {
00026         public CalligraphicPen()
00027         {
00028         }
00029
00030         protected override InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, double strokeWidth)
00031         {
00032
00033             InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes();
00034             inkDrawingAttributes.PenTip = PenTipShape.Circle;
00035             inkDrawingAttributes.IgnorePressure = false;
00036             SolidColorBrush solidColorBrush = (SolidColorBrush)brush;
00037
00038             if (solidColorBrush != null)
00039             {
00040                 inkDrawingAttributes.Color = solidColorBrush.Color;
00041             }
00042
00043             inkDrawingAttributes.Size = new Size(strokeWidth, 2.0f * strokeWidth);
00044             inkDrawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.CreateRotation((float)(Math.PI * 45 / 180));
00045
00046             return inkDrawingAttributes;
00047         }
00048     }
00049
00050     /// <summary>
00051     /// This page shows the code to configure the InkToolbar.
00052     /// </summary>
00053     public sealed partial class Scenario2 : Page
00054     {
00055         private Polyline lasso;
00056         private Rect boundingRect;
00057         private MainPage rootPage = MainPage.Current;
00058         private bool isBoundRect;
00059
00060         Symbol LassoSelect = (Symbol)0xEF20;
00061         Symbol TouchWriting = (Symbol)0xED5F;
00062
00063         public Scenario2()
00064         {
00065             this.InitializeComponent();
00066
00067             // Initialize the InkCanvas
00068             inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
00069         }
00070
00071         protected override void OnNavigatedTo(NavigationEventArgs e)
00072         {
00073             // Registering handlers to clear the selection when inking or erasing is detected
00074             inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;
00075             inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
00076         }
00077
00078         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00079         {
00080             // Unregistering handlers to clear the selection when inking or erasing is detected
00081             inkCanvas.InkPresenter.StrokeInput.StrokeStarted -= StrokeInput_StrokeStarted;
00082             inkCanvas.InkPresenter.StrokesErased -= InkPresenter_StrokesErased;
00083         }
00084
00085         private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
00086         {
00087             ClearSelection();
00088             inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
00089             inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
00090             inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
00091         }
00092
00093         private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args)
00094         {
00095             ClearSelection();
00096             inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
00097             inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
00098             inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
00099         }
00100
00101         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00102         {
00103             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00104         }
00105
00106         // This is the recommended way to implement inking with touch on Windows.
00107         // Since touch is reserved for navigation (pan, zoom, rotate, etc.),
00108         // if you’d like your app to have inking with touch, it is recommended
00109         // that it is enabled via CustomToggle like in this scenario, with the
00110         // same icon and tooltip.
00111         private void Toggle_Custom(object sender, RoutedEventArgs e)
00112         {
00113             if (toggleButton.IsChecked == true)
00114             {
00115                 inkCanvas.InkPresenter.InputDeviceTypes |= CoreInputDeviceTypes.Touch;
00116             }
00117             else
00118             {
00119                 inkCanvas.InkPresenter.InputDeviceTypes &= ~CoreInputDeviceTypes.Touch;
00120             }
00121         }
00122
00123         private void UnprocessedInput_PointerPressed(InkUnprocessedInput sender, PointerEventArgs args)
00124         {
00125             lasso = new Polyline()
00126             {
00127                 Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
00128                 StrokeThickness = 1,
00129                 StrokeDashArray = new DoubleCollection() { 5, 2 },
00130             };
00131
00132             lasso.Points.Add(args.CurrentPoint.RawPosition);
00133             selectionCanvas.Children.Add(lasso);
00134             isBoundRect = true;
00135         }
00136
00137         private void UnprocessedInput_PointerMoved(InkUnprocessedInput sender, PointerEventArgs args)
00138         {
00139             if (isBoundRect)
00140             {
00141                 lasso.Points.Add(args.CurrentPoint.RawPosition);
00142             }
00143         }
00144
00145         private void UnprocessedInput_PointerReleased(InkUnprocessedInput sender, PointerEventArgs args)
00146         {
00147             lasso.Points.Add(args.CurrentPoint.RawPosition);
00148
00149             boundingRect = inkCanvas.InkPresenter.StrokeContainer.SelectWithPolyLine(lasso.Points);
00150             isBoundRect = false;
00151             DrawBoundingRect();
00152         }
00153
00154         private void DrawBoundingRect()
00155         {
00156             selectionCanvas.Children.Clear();
00157
00158             if (boundingRect.Width <= 0 || boundingRect.Height <= 0)
00159             {
00160                 return;
00161             }
00162
00163             var rectangle = new Rectangle()
00164             {
00165                 Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
00166                 StrokeThickness = 1,
00167                 StrokeDashArray = new DoubleCollection() { 5, 2 },
00168                 Width = boundingRect.Width,
00169                 Height = boundingRect.Height
00170             };
00171
00172             Canvas.SetLeft(rectangle, boundingRect.X);
00173             Canvas.SetTop(rectangle, boundingRect.Y);
00174
00175             selectionCanvas.Children.Add(rectangle);
00176         }
00177
00178         private void ToolButton_Lasso(object sender, RoutedEventArgs e)
00179         {
00180             // By default, pen barrel button or right mouse button is processed for inking
00181             // Set the configuration to instead allow processing these input on the UI thread
00182             inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = InkInputRightDragAction.LeaveUnprocessed;
00183
00184             inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed;
00185             inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved;
00186             inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased;
00187         }
00188
00189         private void ClearDrawnBoundingRect()
00190         {
00191             if (selectionCanvas.Children.Count > 0)
00192             {
00193                 selectionCanvas.Children.Clear();
00194                 boundingRect = Rect.Empty;
00195             }
00196         }
00197
00198         private void OnCopy(object sender, RoutedEventArgs e)
00199         {
00200             inkCanvas.InkPresenter.StrokeContainer.CopySelectedToClipboard();
00201         }
00202
00203         private void OnCut(object sender, RoutedEventArgs e)
00204         {
00205             inkCanvas.InkPresenter.StrokeContainer.CopySelectedToClipboard();
00206             inkCanvas.InkPresenter.StrokeContainer.DeleteSelected();
00207             ClearDrawnBoundingRect();
00208         }
00209
00210         private void OnPaste(object sender, RoutedEventArgs e)
00211         {
00212             if (inkCanvas.InkPresenter.StrokeContainer.CanPasteFromClipboard())
00213             {
00214                 inkCanvas.InkPresenter.StrokeContainer.PasteFromClipboard(new Point((scrollViewer.HorizontalOffset + 10) / scrollViewer.ZoomFactor, (scrollViewer.VerticalOffset + 10) / scrollViewer.ZoomFactor));
00215             }
00216             else
00217             {
00218                 rootPage.NotifyUser("Cannot paste from clipboard.", NotifyType.ErrorMessage);
00219             }
00220         }
00221
00222         private void ClearSelection()
00223         {
00224             var strokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
00225             foreach (var stroke in strokes)
00226             {
00227                 stroke.Selected = false;
00228             }
00229             ClearDrawnBoundingRect();
00230         }
00231
00232         private void CurrentToolChanged(InkToolbar sender, object args)
00233         {
00234             bool enabled = sender.ActiveTool.Equals(toolButtonLasso);
00235
00236             ButtonCut.IsEnabled = enabled;
00237             ButtonCopy.IsEnabled = enabled;
00238             ButtonPaste.IsEnabled = enabled;
00239         }
00240     }
00241 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario4_TimeTriggeredTask.xaml.cs Source File

  • BackgroundTask
  • cs
  • BackgroundTask

Scenario4_TimeTriggeredTask.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class TimeTriggeredTask : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public TimeTriggeredTask()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046             foreach (var task in BackgroundTaskRegistration.AllTasks)
00047             {
00048                 if (task.Value.Name == BackgroundTaskSample.TimeTriggeredTaskName)
00049                 {
00050                     AttachProgressAndCompletedHandlers(task.Value);
00051                     BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.TimeTriggeredTaskName, true);
00052                     break;
00053                 }
00054             }
00055
00056             UpdateUI();
00057         }
00058
00059         /// <summary>
00060         /// Register a TimeTriggeredTask.
00061         /// </summary>
00062         /// <param name="sender"></param>
00063         /// <param name="e"></param>
00064         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00065         {
00066             var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
00067                                                                    BackgroundTaskSample.TimeTriggeredTaskName,
00068                                                                    new TimeTrigger(15, false),
00069                                                                    null);
00070             AttachProgressAndCompletedHandlers(task);
00071             UpdateUI();
00072         }
00073
00074         /// <summary>
00075         /// Unregister a TimeTriggeredTask.
00076         /// </summary>
00077         /// <param name="sender"></param>
00078         /// <param name="e"></param>
00079         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00080         {
00081             BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.TimeTriggeredTaskName);
00082             UpdateUI();
00083         }
00084
00085         /// <summary>
00086         /// Attach progress and completed handers to a background task.
00087         /// </summary>
00088         /// <param name="task">The task to attach progress and completed handlers to.</param>
00089         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00090         {
00091             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00092             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00093         }
00094
00095         /// <summary>
00096         /// Handle background task progress.
00097         /// </summary>
00098         /// <param name="task">The task that is reporting progress.</param>
00099         /// <param name="e">Arguments of the progress report.</param>
00100         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00101         {
00102             var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00103             {
00104                 var progress = "Progress: " + args.Progress + "%";
00105                 BackgroundTaskSample.TimeTriggeredTaskProgress = progress;
00106                 UpdateUI();
00107             });
00108         }
00109
00110         /// <summary>
00111         /// Handle background task completion.
00112         /// </summary>
00113         /// <param name="task">The task that is reporting completion.</param>
00114         /// <param name="e">Arguments of the completion report.</param>
00115         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00116         {
00117             UpdateUI();
00118         }
00119
00120         /// <summary>
00121         /// Update the scenario UI.
00122         /// </summary>
00123         private async void UpdateUI()
00124         {
00125             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00126             () =>
00127             {
00128                 RegisterButton.IsEnabled = !BackgroundTaskSample.TimeTriggeredTaskRegistered;
00129                 UnregisterButton.IsEnabled = BackgroundTaskSample.TimeTriggeredTaskRegistered;
00130                 Progress.Text = BackgroundTaskSample.TimeTriggeredTaskProgress;
00131                 Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.TimeTriggeredTaskName);
00132             });
00133         }
00134
00135     }
00136 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/BroadbandDevice.xaml.cs Source File

  • MobileBroadband
  • cs

BroadbandDevice.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using System.Collections.Generic;
00018 using Windows.Networking.NetworkOperators;
00019 using Windows.Devices.Sms;
00020
00021 namespace MobileBroadband
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class BroadbandDevice : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031
00032         private IReadOnlyList<string> deviceAccountId = null;
00033         private int deviceSelected = 0;
00034
00035         public BroadbandDevice()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         /// </summary>
00043         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             PrepScenario1Sample();
00048         }
00049
00050         /// <summary>
00051         /// This is the click handler for the 'Get Device Information' button.
00052         /// </summary>
00053         /// <param name="sender"></param>
00054         /// <param name="e"></param>
00055         private void UpdateData_Click(object sender, RoutedEventArgs e)
00056         {
00057             Button b = sender as Button;
00058             if (b != null)
00059             {
00060                 GetCurrentDeviceInfo(deviceAccountId[deviceSelected]);
00061                  // increment device count until reach number max number of devices and then start over
00062                 deviceSelected = (deviceSelected + 1) % deviceAccountId.Count;
00063
00064                 // update Button with next device
00065                 UpdateData.Content = "Get Information for Device #" + (deviceSelected + 1);
00066             }
00067         }
00068
00069         void PrepScenario1Sample()
00070         {
00071             rootPage.NotifyUser("", NotifyType.StatusMessage);
00072
00073             try
00074             {
00075                 deviceSelected = 0;
00076                 deviceAccountId = MobileBroadbandAccount.AvailableNetworkAccountIds;
00077
00078                 if (deviceAccountId.Count != 0)
00079                 {
00080                     rootPage.NotifyUser("Mobile Broadband Device(s) have been installed that grant access to this application", NotifyType.StatusMessage);
00081
00082                     NumDevices.Text = "There are " + deviceAccountId.Count + " account(s) installed.";
00083                     UpdateData.Content = "Get Information for Device #1";
00084                     UpdateData.IsEnabled = true;
00085                 }
00086                 else
00087                 {
00088                     UpdateData.Content = "No available accounts detected";
00089                     UpdateData.IsEnabled = false;
00090                 }
00091             }
00092             catch (Exception ex)
00093             {
00094                rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00095             }
00096         }
00097
00098         void GetCurrentDeviceInfo(string accountId)
00099         {
00100             try
00101             {
00102                 // Test touching new TH objectq
00103                 var modem = MobileBroadbandModem.GetDefault();
00104                 var deviceId = modem.DeviceInformation.DeviceId;
00105
00106                 var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(accountId);
00107
00108                 ProviderName.Text = mobileBroadbandAccount.ServiceProviderName;
00109                 ProviderGuid.Text = mobileBroadbandAccount.ServiceProviderGuid.ToString();
00110                 NetworkAccountId.Text = mobileBroadbandAccount.NetworkAccountId;
00111
00112                 var currentNetwork = mobileBroadbandAccount.CurrentNetwork;
00113
00114                 if (currentNetwork != null)
00115                 {
00116                     string accessPointName = currentNetwork.AccessPointName;
00117                     if (String.IsNullOrEmpty(accessPointName))
00118                     {
00119                         accessPointName = "(not connected)";
00120                     }
00121
00122                     NetRegister.Text = currentNetwork.NetworkRegistrationState.ToString();
00123                     NetRegError.Text = NetErrorToString(currentNetwork.RegistrationNetworkError);
00124                     PacketAttachError.Text = NetErrorToString(currentNetwork.PacketAttachNetworkError);
00125                     ActivateError.Text = NetErrorToString(currentNetwork.ActivationNetworkError);
00126                     AccessPointName.Text = accessPointName;
00127                     NetworkAdapterId.Text = currentNetwork.NetworkAdapter.NetworkAdapterId.ToString();
00128                     NetworkType.Text = currentNetwork.NetworkAdapter.NetworkItem.GetNetworkTypes().ToString();
00129                     RegisteredProviderId.Text = currentNetwork.RegisteredProviderId;
00130                     RegisteredProviderName.Text = currentNetwork.RegisteredProviderName;
00131                     RegisteredDataClass.Text = currentNetwork.RegisteredDataClass.ToString();
00132
00133                 }
00134                 else
00135                 {
00136                     NetRegister.Text = "";
00137                     NetRegError.Text = "";
00138                     PacketAttachError.Text = "";
00139                     ActivateError.Text = "";
00140                     AccessPointName.Text = "";
00141                     NetworkAdapterId.Text = "";
00142                     NetworkType.Text = "";
00143                     RegisteredProviderId.Text = "";
00144                     RegisteredProviderName.Text = "";
00145                     RegisteredDataClass.Text = "";
00146                 }
00147
00148                 var deviceInformation = mobileBroadbandAccount.CurrentDeviceInformation;
00149
00150                 if (deviceInformation != null)
00151                 {
00152                     string mobileNumber = "";
00153                     if (deviceInformation.TelephoneNumbers.Count > 0)
00154                     {
00155                         mobileNumber = deviceInformation.TelephoneNumbers[0];
00156                     }
00157
00158                     DeviceManufacturer.Text = deviceInformation.Manufacturer;
00159                     DeviceModel.Text = deviceInformation.Model;
00160                     Firmware.Text = deviceInformation.FirmwareInformation;
00161                     CellularClasses.Text = deviceInformation.CellularClass.ToString();
00162                     DataClasses.Text = deviceInformation.DataClasses.ToString();
00163                     if (deviceInformation.DataClasses.HasFlag(Windows.Networking.NetworkOperators.DataClasses.Custom))
00164                     {
00165                         DataClasses.Text += " (custom is " + deviceInformation.CustomDataClass + ")";
00166                     }
00167                     MobileNumber.Text = mobileNumber;
00168                     SimId.Text = deviceInformation.SimIccId;
00169                     DeviceType.Text = deviceInformation.DeviceType.ToString();
00170                     DeviceId.Text = deviceInformation.DeviceId.ToString();
00171                     NetworkDeviceStatus.Text = deviceInformation.NetworkDeviceStatus.ToString();
00172
00173                     if (deviceInformation.CellularClass == CellularClass.Gsm)
00174                     {
00175                         MobEquipIdLabel.Text = "IMEI:";
00176                         MobEquipIdValue.Text = deviceInformation.MobileEquipmentId;
00177
00178                         SubIdLabel.Text = "IMSI:";
00179                         SubIdValue.Text = deviceInformation.SubscriberId;
00180                     }
00181                     else if (deviceInformation.CellularClass == CellularClass.Cdma)
00182                     {
00183                         MobEquipIdLabel.Text = "ESN/MEID:";
00184                         MobEquipIdValue.Text = deviceInformation.MobileEquipmentId;
00185
00186                         SubIdLabel.Text = "MIN/IRM:";
00187                         SubIdValue.Text = deviceInformation.SubscriberId;
00188                     }
00189                     else
00190                     {
00191                         MobEquipIdLabel.Text = "";
00192                         MobEquipIdValue.Text = "";
00193                         SubIdLabel.Text = "";
00194                         SubIdValue.Text = "";
00195                     }
00196                 }
00197                 else
00198                 {
00199                     DeviceManufacturer.Text = "";
00200                     DeviceModel.Text = "";
00201                     Firmware.Text = "";
00202                     CellularClasses.Text = "";
00203                     DataClasses.Text = "";
00204                     MobileNumber.Text = "";
00205                     SimId.Text = "";
00206                     DeviceType.Text = "";
00207                     DeviceId.Text = "";
00208                     NetworkDeviceStatus.Text = "";
00209                     MobEquipIdLabel.Text = "";
00210                     MobEquipIdValue.Text = "";
00211                     SubIdLabel.Text = "";
00212                     SubIdValue.Text = "";
00213                 }
00214             }
00215             catch (Exception ex)
00216             {
00217                 rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00218
00219                 ProviderName.Text = "";
00220                 ProviderGuid.Text = "";
00221                 NetworkAccountId.Text = "";
00222                 NetRegister.Text = "";
00223                 NetRegError.Text = "";
00224                 PacketAttachError.Text = "";
00225                 ActivateError.Text = "";
00226                 AccessPointName.Text = "";
00227                 NetworkAdapterId.Text = "";
00228                 NetworkType.Text = "";
00229                 DeviceManufacturer.Text = "";
00230                 DeviceModel.Text = "";
00231                 Firmware.Text = "";
00232                 CellularClasses.Text = "";
00233                 DataClasses.Text = "";
00234                 MobileNumber.Text = "";
00235                 SimId.Text = "";
00236                 DeviceType.Text = "";
00237                 DeviceId.Text = "";
00238                 NetworkDeviceStatus.Text = "";
00239                 MobEquipIdLabel.Text = "";
00240                 MobEquipIdValue.Text = "";
00241                 SubIdLabel.Text = "";
00242                 SubIdValue.Text = "";
00243                 RegisteredProviderId.Text = "";
00244                 RegisteredProviderName.Text = "";
00245                 RegisteredDataClass.Text = "";
00246             }
00247         }
00248
00249         string NetErrorToString(uint netError)
00250         {
00251             return netError == 0 ? "none" : netError.ToString();
00252         }
00253     }
00254 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
BACKGROUND_ENTRY_POINT | ScenarioElement | [private, static]
Initialize() | ScenarioElement | [inline, private]
RegisterBackgroundTask() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UnregisterBackgroundTask() | ScenarioElement | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SocketReaderWriter.h Source File

  • WiFiDirect
  • cppwinrt

SocketReaderWriter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "MainPage.h"
00014 #include "DiscoveredDevice.g.h"
00015 #include "ConnectedDevice.g.h"
00016 #include "Utils.g.h"
00017
00018 namespace winrt::SDKTemplate
00019 {
00020     struct SocketReaderWriter : implements<SocketReaderWriter, Windows::Foundation::IClosable>
00021     {
00022         SocketReaderWriter(Windows::Networking::Sockets::StreamSocket socket, MainPage mainPage);
00023         void Close();
00024         Windows::Foundation::IAsyncAction WriteMessageAsync(hstring const& message);
00025         Windows::Foundation::IAsyncOperation<Windows::Foundation::IReference<hstring>> ReadMessageAsync();
00026     private:
00027         MainPage rootPage;
00028         Windows::Networking::Sockets::StreamSocket streamSocket;
00029         Windows::Storage::Streams::DataReader dataReader;
00030         Windows::Storage::Streams::DataWriter dataWriter;
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::implementation
00035 {
00036     struct DiscoveredDevice : DiscoveredDeviceT<DiscoveredDevice>
00037     {
00038     public:
00039         DiscoveredDevice(Windows::Devices::Enumeration::DeviceInformation const& deviceInfoIn) : deviceInfo(deviceInfoIn)
00040         {
00041         }
00042
00043         auto DeviceInfo() { return deviceInfo; }
00044
00045         hstring DisplayName()
00046         {
00047             return deviceInfo.Name() + L" - " + (deviceInfo.Pairing().IsPaired() ? L"Paired" : L"Unpaired");
00048         }
00049
00050         void UpdateDeviceInfo(Windows::Devices::Enumeration::DeviceInformationUpdate const& update)
00051         {
00052             deviceInfo.Update(update);
00053             propertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs(L"DisplayName"));
00054         }
00055
00056         event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
00057         {
00058             return propertyChanged.add(handler);
00059         }
00060
00061         void PropertyChanged(event_token token)
00062         {
00063             propertyChanged.remove(token);
00064         }
00065
00066     private:
00067         Windows::Devices::Enumeration::DeviceInformation deviceInfo;
00068         event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged;
00069     };
00070 }
00071
00072 namespace winrt::SDKTemplate::implementation
00073 {
00074     struct ConnectedDevice : ConnectedDeviceT<ConnectedDevice>
00075     {
00076         ConnectedDevice(hstring displayNameIn, Windows::Devices::WiFiDirect::WiFiDirectDevice const& wfdDeviceIn, com_ptr<SocketReaderWriter> const& socketRWIn)
00077             : displayName(std::move(displayNameIn)), wfdDevice(wfdDeviceIn), socketRW(socketRWIn)
00078         {
00079         }
00080
00081         auto WfdDevice() { return wfdDevice; }
00082         auto DisplayName() { return displayName; }
00083         auto SocketRW() { return socketRW; }
00084         void Close()
00085         {
00086             wfdDevice.Close();
00087             socketRW->Close();
00088         }
00089     private:
00090         hstring displayName;
00091         Windows::Devices::WiFiDirect::WiFiDirectDevice wfdDevice;
00092         com_ptr<SocketReaderWriter> socketRW;
00093     };
00094 }
00095
00096 namespace winrt::SDKTemplate::implementation
00097 {
00098     struct Utils
00099     {
00100         Utils() = default;
00101
00102         static bool CanSendMessage(hstring const& message, Windows::Foundation::IInspectable const& connectedDevice)
00103         {
00104             return !message.empty() && connectedDevice;
00105         }
00106
00107         static bool IsNonNull(Windows::Foundation::IInspectable const& value)
00108         {
00109             return value != nullptr;
00110         }
00111
00112         static bool IsNonEmptyString(hstring const& value)
00113         {
00114             return !value.empty();
00115         }
00116     };
00117 }
00118
00119 namespace winrt::SDKTemplate::factory_implementation
00120 {
00121     struct Utils : UtilsT<Utils, implementation::Utils>
00122     {
00123     };
00124 }
00125
Generated on Fri Nov 15 2024 22:22:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ExpiringToast/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ExpiringToast

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Data.Xml.Dom;
00003 using Windows.UI.Notifications;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.ExpiringToast
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00021         {
00022             Initialize();
00023         }
00024
00025         private void Initialize()
00026         {
00027             // Clear all existing notifications
00028             ToastNotificationManager.History.Clear();
00029
00030             var longTime = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("longtime");
00031             DateTimeOffset expiryTime = DateTime.Now.AddSeconds(30);
00032             string expiryTimeString = longTime.Format(expiryTime);
00033
00034             XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
00035             //Find the text component of the content
00036             XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
00037
00038             // Set the text on the toast.
00039             // The first line of text in the ToastText02 template is treated as header text, and will be bold.
00040             toastTextElements[0].AppendChild(toastXml.CreateTextNode("Expiring Toast"));
00041             toastTextElements[1].AppendChild(toastXml.CreateTextNode("It will expire at " +  expiryTimeString));
00042
00043             // Set the duration on the toast
00044             IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
00045             ((XmlElement)toastNode).SetAttribute("duration", "long");
00046
00047             // Create the actual toast object using this toast specification.
00048             ToastNotification toast = new ToastNotification(toastXml);
00049
00050             toast.ExpirationTime = expiryTime;
00051
00052             // Send the toast.
00053             ToastNotificationManager.CreateToastNotifier().Show(toast);
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LiveDashPlayer Member List

This is the complete list of members for LiveDashPlayer, including all inherited members.
ComboBox_SelectionChanged(object sender, RoutedEventArgs e) | LiveDashPlayer | [inline, private]
gotToLiveButton_Click(object sender, RoutedEventArgs e) | LiveDashPlayer | [inline, private]
haveSetLiveOffset | LiveDashPlayer | [private]
haveSetSource | LiveDashPlayer | [private]
LiveDashPlayer() | LiveDashPlayer | [inline]
liveOffset | LiveDashPlayer | [private]
OnNavigatedFrom(NavigationEventArgs e) | LiveDashPlayer | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | LiveDashPlayer | [inline, protected]
playButton_Click(object sender, RoutedEventArgs e) | LiveDashPlayer | [inline, private]
player | LiveDashPlayer | [private]
PopulateComboBox() | LiveDashPlayer | [inline, private]
rootPage | LiveDashPlayer | [private]
setLiveOffsetButton_Click(object sender, RoutedEventArgs e) | LiveDashPlayer | [inline, private]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/SampleConfiguration.cs Source File

  • BackgroundTask
  • cs
  • BackgroundTask

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.ApplicationModel.Background;
00017 using Windows.Storage;
00018
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "Background tasks";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title="Background Task", ClassType=typeof(SampleBackgroundTask)},
00028             new Scenario() { Title="Background Task with Condition", ClassType=typeof(SampleBackgroundTaskWithCondition)},
00029             new Scenario() { Title="Servicing Complete Task", ClassType=typeof(ServicingCompleteTask)},
00030             new Scenario() { Title="Background Task with Time Trigger", ClassType=typeof(TimeTriggeredTask) },
00031             new Scenario() { Title="Background Task with Application Trigger", ClassType=typeof(ApplicationTriggerTask) },
00032             new Scenario() { Title="Grouped Background Task", ClassType=typeof(GroupedBackgroundTask) },
00033         };
00034     }
00035
00036     public class Scenario
00037     {
00038         public string Title { get; set; }
00039         public Type ClassType { get; set; }
00040     }
00041 }
00042
00043 namespace SDKTemplate
00044 {
00045     class BackgroundTaskSample
00046     {
00047         public const string SampleBackgroundTaskEntryPoint = "Tasks.SampleBackgroundTask";
00048         public const string SampleBackgroundTaskName = "SampleBackgroundTask";
00049         public static string SampleBackgroundTaskProgress = "";
00050         public static bool SampleBackgroundTaskRegistered = false;
00051
00052         public const string SampleBackgroundTaskWithConditionName = "SampleBackgroundTaskWithCondition";
00053         public static string SampleBackgroundTaskWithConditionProgress = "";
00054         public static bool SampleBackgroundTaskWithConditionRegistered = false;
00055
00056         public const string ServicingCompleteTaskEntryPoint = "Tasks.ServicingComplete";
00057         public const string ServicingCompleteTaskName = "ServicingCompleteTask";
00058         public static string ServicingCompleteTaskProgress = "";
00059         public static bool ServicingCompleteTaskRegistered = false;
00060
00061         public const string TimeTriggeredTaskName = "TimeTriggeredTask";
00062         public static string TimeTriggeredTaskProgress = "";
00063         public static bool TimeTriggeredTaskRegistered = false;
00064
00065         public const string ApplicationTriggerTaskName = "ApplicationTriggerTask";
00066         public static string ApplicationTriggerTaskProgress = "";
00067         public static string ApplicationTriggerTaskResult = "";
00068         public static bool ApplicationTriggerTaskRegistered = false;
00069
00070         public const string GroupedBackgroundTaskName = "GroupedBackgroundTask";
00071         public const string BackgroundTaskGroupId = "3F2504E0-5F89-41D3-9A0C-0405E82C3333";
00072         public const string BackgroundTaskGroupFriendlyName = "Background Task Group";
00073         public static string GroupedBackgroundTaskProgress = "";
00074         public static bool GroupedBackgroundTaskRegistered = false;
00075
00076         /// <summary>
00077         /// Register a background task with the specified taskEntryPoint, name, trigger,
00078         /// and condition (optional).
00079         /// </summary>
00080         /// <param name="taskEntryPoint">Task entry point for the background task.</param>
00081         /// <param name="name">A name for the background task.</param>
00082         /// <param name="trigger">The trigger for the background task.</param>
00083         /// <param name="condition">An optional conditional event that must be true for the task to fire.</param>
00084         public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group = null)
00085         {
00086             if (TaskRequiresBackgroundAccess(name))
00087             {
00088                 // If the user denies access, the task will not run.
00089                 var requestTask = BackgroundExecutionManager.RequestAccessAsync();
00090             }
00091
00092             var builder = new BackgroundTaskBuilder();
00093
00094             builder.Name = name;
00095             builder.TaskEntryPoint = taskEntryPoint;
00096             builder.SetTrigger(trigger);
00097
00098             if (condition != null)
00099             {
00100                 builder.AddCondition(condition);
00101
00102                 //
00103                 // If the condition changes while the background task is executing then it will
00104                 // be canceled.
00105                 //
00106                 builder.CancelOnConditionLoss = true;
00107             }
00108
00109             if (group != null)
00110             {
00111                 builder.TaskGroup = group;
00112             }
00113
00114             BackgroundTaskRegistration task = builder.Register();
00115
00116             UpdateBackgroundTaskRegistrationStatus(name, true);
00117
00118             //
00119             // Remove previous completion status.
00120             //
00121             var settings = ApplicationData.Current.LocalSettings;
00122             settings.Values.Remove(name);
00123
00124             return task;
00125         }
00126
00127         /// <summary>
00128         /// Unregister background tasks with specified name.
00129         /// </summary>
00130         /// <param name="name">Name of the background task to unregister.</param>
00131         public static void UnregisterBackgroundTasks(String name, BackgroundTaskRegistrationGroup group = null)
00132         {
00133             //
00134             // If the given task group is registered then loop through all background tasks associated with it
00135             // and unregister any with the given name.
00136             //
00137             if (group != null)
00138             {
00139                 foreach (var cur in group.AllTasks)
00140                 {
00141                     if (cur.Value.Name == name)
00142                     {
00143                         cur.Value.Unregister(true);
00144                     }
00145                 }
00146             }
00147             else
00148             {
00149                 //
00150                 // Loop through all ungrouped background tasks and unregister any with the given name.
00151                 //
00152                 foreach (var cur in BackgroundTaskRegistration.AllTasks)
00153                 {
00154                     if (cur.Value.Name == name)
00155                     {
00156                         cur.Value.Unregister(true);
00157                     }
00158                 }
00159             }
00160
00161             UpdateBackgroundTaskRegistrationStatus(name, false);
00162         }
00163
00164         /// <summary>
00165         /// Retrieve a registered background task group. If no group is registered with the given id,
00166         /// then create a new one and return it.
00167         /// </summary>
00168         /// <returns>The task group associated with the given id</returns>
00169         public static BackgroundTaskRegistrationGroup GetTaskGroup(string id, string groupName)
00170         {
00171             var group = BackgroundTaskRegistration.GetTaskGroup(id);
00172
00173             if (group == null)
00174             {
00175                 group = new BackgroundTaskRegistrationGroup(id, groupName);
00176             }
00177
00178             return group;
00179         }
00180
00181         /// <summary>
00182         /// Store the registration status of a background task with a given name.
00183         /// </summary>
00184         /// <param name="name">Name of background task to store registration status for.</param>
00185         /// <param name="registered">TRUE if registered, FALSE if unregistered.</param>
00186         public static void UpdateBackgroundTaskRegistrationStatus(String name, bool registered)
00187         {
00188             switch (name)
00189             {
00190                 case SampleBackgroundTaskName:
00191                     SampleBackgroundTaskRegistered = registered;
00192                     break;
00193                 case SampleBackgroundTaskWithConditionName:
00194                     SampleBackgroundTaskWithConditionRegistered = registered;
00195                     break;
00196                 case ServicingCompleteTaskName:
00197                     ServicingCompleteTaskRegistered = registered;
00198                     break;
00199                 case TimeTriggeredTaskName:
00200                     TimeTriggeredTaskRegistered = registered;
00201                     break;
00202                 case ApplicationTriggerTaskName:
00203                     ApplicationTriggerTaskRegistered = registered;
00204                     break;
00205                 case GroupedBackgroundTaskName:
00206                     GroupedBackgroundTaskRegistered = registered;
00207                     break;
00208             }
00209         }
00210
00211         /// <summary>
00212         /// Get the registration / completion status of the background task with
00213         /// given name.
00214         /// </summary>
00215         /// <param name="name">Name of background task to retreive registration status.</param>
00216         public static String GetBackgroundTaskStatus(String name)
00217         {
00218             var registered = false;
00219             switch (name)
00220             {
00221                 case SampleBackgroundTaskName:
00222                     registered = SampleBackgroundTaskRegistered;
00223                     break;
00224                 case SampleBackgroundTaskWithConditionName:
00225                     registered = SampleBackgroundTaskWithConditionRegistered;
00226                     break;
00227                 case ServicingCompleteTaskName:
00228                     registered = ServicingCompleteTaskRegistered;
00229                     break;
00230                 case TimeTriggeredTaskName:
00231                     registered = TimeTriggeredTaskRegistered;
00232                     break;
00233                 case ApplicationTriggerTaskName:
00234                     registered = ApplicationTriggerTaskRegistered;
00235                     break;
00236                 case GroupedBackgroundTaskName:
00237                     registered = GroupedBackgroundTaskRegistered;
00238                     break;
00239             }
00240
00241             var status = registered ? "Registered" : "Unregistered";
00242
00243             object taskStatus;
00244             var settings = ApplicationData.Current.LocalSettings;
00245             if (settings.Values.TryGetValue(name, out taskStatus))
00246             {
00247                 status += " - " + taskStatus.ToString();
00248             }
00249
00250             return status;
00251         }
00252
00253         /// <summary>
00254         /// Determine if task with given name requires background access.
00255         /// </summary>
00256         /// <param name="name">Name of background task to query background access requirement.</param>
00257         public static bool TaskRequiresBackgroundAccess(String name)
00258         {
00259             if ((name == TimeTriggeredTaskName) ||
00260                 (name == ApplicationTriggerTaskName))
00261             {
00262                 return true;
00263             }
00264             else
00265             {
00266                 return false;
00267             }
00268         }
00269     }
00270 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario2_StringTemplate.xaml.cpp Source File

  • DateTimeFormatting
  • cpp

Scenario2_StringTemplate.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_StringTemplate.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Globalization;
00021 using namespace Windows::Globalization::DateTimeFormatting;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario2_StringTemplate::Scenario2_StringTemplate()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void Scenario2_StringTemplate::Display()
00032 {
00033     // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00034     // to format a date/time via a string template.  Note that the order specifed in the string pattern does
00035     // not determine the order of the parts of the formatted string.  The current application language and region value will
00036     // determine the pattern of the date returned based on the specified parts.
00037
00038     //Get the current application context language
00039     String^ currentLanguage = ApplicationLanguages::Languages->GetAt(0);
00040
00041     // Formatters for dates.
00042     Array<DateTimeFormatter^>^ dateFormatters = {
00043         ref new DateTimeFormatter("month day"),
00044         ref new DateTimeFormatter("month year"),
00045         ref new DateTimeFormatter("month day year"),
00046         ref new DateTimeFormatter("month day dayofweek year"),
00047         ref new DateTimeFormatter("dayofweek.abbreviated"),
00048         ref new DateTimeFormatter("month.abbreviated"),
00049         ref new DateTimeFormatter("year.abbreviated")
00050     };
00051
00052     // Formatters for time.
00053     Array<DateTimeFormatter^>^ timeFormatters = {
00054         ref new DateTimeFormatter("hour minute"),
00055         ref new DateTimeFormatter("hour minute second"),
00056         ref new DateTimeFormatter("hour")
00057     };
00058
00059     // Formatters for timezone.
00060     Array<DateTimeFormatter^>^ timeZoneFormatters = {
00061         ref new DateTimeFormatter("timezone"),
00062         ref new DateTimeFormatter("timezone.full"),
00063         ref new DateTimeFormatter("timezone.abbreviated")
00064     };
00065
00066     // Formatters for combinations.
00067     Array<DateTimeFormatter^>^ combinationFormatters = {
00068         ref new DateTimeFormatter("hour minute second timezone.full"),
00069         ref new DateTimeFormatter("day month year hour minute timezone"),
00070         ref new DateTimeFormatter("dayofweek day month year hour minute second"),
00071         ref new DateTimeFormatter("dayofweek.abbreviated day month hour minute"),
00072         ref new DateTimeFormatter("dayofweek day month year hour minute second timezone.abbreviated")
00073     };
00074
00075     // Obtain the date that will be formatted.
00076     Windows::Globalization::Calendar^ cal = ref new Windows::Globalization::Calendar();
00077     Windows::Foundation::DateTime dateToFormat = cal->GetDateTime();
00078
00079     // Keep the results here
00080     String^ results = "";
00081     results = results + "Current application context language: " + currentLanguage + "\n\n";
00082     results = results + "Dates:\n";
00083
00084     // Generate the results.
00085     for (auto formatter : dateFormatters)
00086     {
00087         // Perform the actual formatting.
00088         results = results + formatter->Template + ": " + formatter->Format(dateToFormat) + "\n";
00089     }
00090
00091     results = results + "\n";
00092     results = results + "Times:\n";
00093
00094     // Generate the results.
00095     for (auto formatter : timeFormatters)
00096     {
00097         // Perform the actual formatting.
00098         results = results + formatter->Template + ": " + formatter->Format(dateToFormat) + "\n";
00099     }
00100
00101     results = results + "\n";
00102     results = results + "Time zones:\n";
00103
00104     // Generate the results.
00105     for (auto formatter : timeZoneFormatters)
00106     {
00107         // Perform the actual formatting.
00108         results = results + formatter->Template + ": " + formatter->Format(dateToFormat) + "\n";
00109     }
00110
00111     results = results + "\n";
00112     results = results + "Date and time combinations:\n";
00113
00114     // Generate the results.
00115     for (auto formatter : combinationFormatters)
00116     {
00117         // Perform the actual formatting.
00118         results = results + formatter->Template + ": " + formatter->Format(dateToFormat) + "\n";
00119     }
00120
00121     // Display the results.
00122     OutputTextBlock->Text = results;
00123 }
Generated on Fri Nov 15 2024 22:19:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ProjectionViewPage.xaml.cpp Source File

  • Projection
  • cpp

ProjectionViewPage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "ProjectionViewPage.xaml.h"
00014 #include "MainPage.xaml.h"
00015 #include "ViewLifetimeControl.h"
00016 #include "SampleConfiguration.h"
00017
00018 using namespace SDKSample;
00019 using namespace SDKSample::SecondaryViewsHelpers;
00020
00021 using namespace Concurrency;
00022 using namespace Platform;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::ViewManagement;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00030
00031 ProjectionViewPage::ProjectionViewPage()
00032 {
00033     InitializeComponent();
00034 }
00035
00036 void ProjectionViewPage::OnNavigatedTo(NavigationEventArgs^ e)
00037 {
00038     auto initData = dynamic_cast<ProjectionViewPageInitializationData^>(e->Parameter);
00039
00040     // The ViewLifetimeControl is a convenient wrapper that ensures the
00041     // view is closed only when the user is done with it
00042     thisViewControl = initData->ProjectionViewPageControl;
00043     mainDispatcher = initData->MainDispatcher;
00044     mainViewId = initData->MainViewId;
00045
00046     // Listen for when it's time to close this view
00047     releasedToken = thisViewControl->Released += ref new ViewReleasedHandler(this, &ProjectionViewPage::thisViewControl_Released);
00048 }
00049
00050 void ProjectionViewPage::thisViewControl_Released(Object^ sender, Object^ e)
00051 {
00052     // There are two major cases where this event will get invoked:
00053     // 1. The view goes unused for some time, and the system cleans it up
00054     // 2. The app calls "StopProjectingAsync"
00055     thisViewControl->Released -= releasedToken;
00056     auto thisDispatcher = Window::Current->Dispatcher;
00057
00058     create_task(mainDispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([thisDispatcher]()
00059     {
00060         MainPage::Current->ProjectionViewPageControl = nullptr;
00061         thisDispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([]() {
00062             Window::Current->Close();
00063         }));
00064     })));
00065
00066 }
00067
00068 void ProjectionViewPage::SwapViews_Click(Object^ sender, RoutedEventArgs^ e)
00069 {
00070     // The view might arrive on the wrong display. The user can
00071     // easily swap the display on which the view appears
00072     thisViewControl->StartViewInUse();
00073     create_task(ProjectionManager::SwapDisplaysForViewsAsync(
00074         ApplicationView::GetForCurrentView()->Id,
00075         mainViewId
00076         )).then([this]()
00077     {
00078         thisViewControl->StopViewInUse();
00079     });
00080 }
00081
00082 void ProjectionViewPage::StopProjecting_Click(Object^ sender, RoutedEventArgs^ e)
00083 {
00084     // There may be cases to end the projection from the projected view
00085     // (e.g. the presentation hosted in that view concludes)
00086     thisViewControl->StartViewInUse();
00087     create_task(ProjectionManager::StopProjectingAsync(
00088         ApplicationView::GetForCurrentView()->Id,
00089         mainViewId
00090         )).then([this]()
00091     {
00092         thisViewControl->StopViewInUse();
00093     });
00094 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario5_DefiningCustomGlyphs.xaml.h Source File

  • LineDisplay
  • cpp

Scenario5_DefiningCustomGlyphs.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_DefiningCustomGlyphs.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     [Windows::UI::Xaml::Data::Bindable]
00021     public ref class Scenario5_DefiningCustomGlyphs sealed
00022     {
00023     public:
00024         Scenario5_DefiningCustomGlyphs();
00025
00026         // Public for binding purposes.
00027         static bool IsNonNull(Platform::Object^ item)
00028         {
00029             return item != nullptr;
00030         }
00031
00032     protected:
00033         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00034         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035
00036     private:
00037         MainPage^ rootPage = MainPage::Current;
00038         Windows::Devices::PointOfService::ClaimedLineDisplay^ lineDisplay;
00039         Windows::Storage::Streams::IBuffer^ glyphBuffer;
00040
00041         Concurrency::task<void> InitializeAsync();
00042
00043         Windows::Storage::Streams::IBuffer^ CreateSolidGlyphBuffer(int widthInPixels, int heightInPixels);
00044
00045         void DefineGlyphButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046         void ResetButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047     };
00048 }
Generated on Fri Nov 15 2024 22:20:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario1.xaml.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace AllJoynProducerExperiences
00016 {
00017     public sealed partial class Scenario1 : Page
00018     {
00019         private Scenario1ViewModel m_scenario1ViewModel = null;
00020
00021         public Scenario1()
00022         {
00023             InitializeComponent();
00024             m_scenario1ViewModel = new Scenario1ViewModel();
00025             DataContext = m_scenario1ViewModel;
00026         }
00027
00028         // Cleanup scenario when it is about to be unloaded.
00029         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00030         {
00031             if (m_scenario1ViewModel != null)
00032             {
00033                 m_scenario1ViewModel.ScenarioCleanup();
00034             }
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario7_FirmwareAccess.xaml.h Source File

  • CustomCapability
  • cpp

Scenario7_FirmwareAccess.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7_FirmwareAccess.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class FirmwareAccess sealed
00020     {
00021     public:
00022         FirmwareAccess();
00023
00024     private:
00025         MainPage^ rootPage = MainPage::Current;
00026
00027         void GetManufacturerName_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028         void SecureBootState_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario2_ChangePIN.h Source File

  • SmartCard
  • cppwinrt

Scenario2_ChangePIN.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <string>
00015 #include "SampleConfiguration.h"
00016 #include "Scenario2_ChangePIN.g.h"
00017
00018 namespace winrt::SDKTemplate::implementation
00019 {
00020     struct Scenario2_ChangePIN : Scenario2_ChangePINT<Scenario2_ChangePIN>
00021     {
00022         SDKTemplate::MainPage m_rootPage{ SDKTemplate::MainPage::Current() };
00023
00024         Scenario2_ChangePIN();
00025
00026         fire_and_forget ChangePin_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&);
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario2_ChangePIN : Scenario2_ChangePINT<Scenario2_ChangePIN, implementation::Scenario2_ChangePIN>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/Project.idl Source File

  • OCR
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass OcrFileImage : Windows.UI.Xaml.Controls.Page
00016     {
00017         OcrFileImage();
00018     }
00019
00020     [default_interface]
00021     runtimeclass OcrCapturedImage : Windows.UI.Xaml.Controls.Page
00022     {
00023         OcrCapturedImage();
00024     }
00025
00026     [Windows.UI.Xaml.Data.Bindable]
00027     runtimeclass WordOverlay : Windows.UI.Xaml.Data.INotifyPropertyChanged
00028     {
00029         Windows.UI.Xaml.Thickness WordPosition { get; };
00030         Double WordWidth{ get; };
00031         Double WordHeight{ get; };
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/Trace.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

Trace.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 enum
00011 {
00012     TRACE_LEVEL_LOW,
00013     TRACE_LEVEL_NORMAL,
00014     TRACE_LEVEL_HIGH,
00015 };
00016
00017 extern DWORD g_dwTraceLevel;
00018 void Trace(DWORD dwLevel, LPCWSTR pszFormat, ...);
00019 void TraceError(LPCSTR pszFile, long nLine, LPCSTR pszFunc, const void *pThis, HRESULT hr);
00020 void TraceError(LPCSTR pszFile, long nLine, LPCSTR pszFunc, Object ^pThis, HRESULT hr);
00021 void PrintSampleInfo(IMFSample *pSample);
00022 void PrintAttributes(IMFAttributes *pAttributes);
00023
00024 #if 0
00025 #define TRACE Trace
00026
00027 #define TRACEHR(hrVal) \
00028 { \
00029     __if_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, this, (hrVal)); } \
00030     __if_not_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, NULL, (hrVal)); } \
00031 }
00032
00033 #define TRACEHR_RET(hrVal) \
00034 { \
00035     __if_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, this, (hrVal)); } \
00036     __if_not_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, NULL, (hrVal)); } \
00037     return hrVal; \
00038 }
00039
00040 #define ThrowIfError(hrVal) \
00041 { \
00042     HRESULT hrInternal = (hrVal); \
00043     if (FAILED(hrInternal)) \
00044     { \
00045         __if_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, this, (hrInternal)); } \
00046         __if_not_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, NULL, (hrInternal)); } \
00047         throw ref new Exception(hrInternal); \
00048     } \
00049 }
00050
00051 #define Throw(hrVal) \
00052 { \
00053     HRESULT hrInternal = (hrVal); \
00054     assert(FAILED(hrInternal)); \
00055     __if_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, this, (hrInternal)); } \
00056     __if_not_exists(this){ TraceError(__FILE__, __LINE__, __FUNCTION__, NULL, (hrInternal)); } \
00057     throw ref new Exception(hrInternal); \
00058 }
00059
00060 #else
00061 #define TRACE
00062 #define TRACEHR(hrVal)
00063 #define TRACEHR_RET(hrVal) {return hrVal;}
00064 inline void ThrowIfError(HRESULT hr)
00065 {
00066     if (FAILED(hr))
00067     {
00068         throw ref new Exception(hr);
00069     }
00070 }
00071
00072 inline void Throw(HRESULT hr)
00073 {
00074     assert(FAILED(hr));
00075     throw ref new Exception(hr);
00076 }
00077 #endif
Generated on Fri Nov 15 2024 22:21:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IdentityChecker Member List

This is the complete list of members for IdentityChecker, including all inherited members.
SampleIdentityConfigurationCorrect(TextBlock outputLocation, String AzureClientId="Not applicable") IdentityChecker [inline, static]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/pch.cpp Source File

  • Geolocation
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/pch.cpp Source File

  • HolographicVoiceInput
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // pch.cpp
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoadKey Member List

This is the complete list of members for LoadKey, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
KeyData | LoadKeys |
KeyNumber | LoadKeys |
KeyType | LoadKeys |
Le | ApduCommand |
LoadKey(byte[] mifareKey, byte keySlotNumber) | LoadKey | [inline]
LoadKeys(LoadKeysKeyType keyType, byte?readerKeyNumber, LoadKeysTransmissionType transmissionType, LoadKeysStorageType storageType, byte keyNumber, byte[] keyData) | LoadKeys | [inline]
LoadKeysKeyType enum name | LoadKeys |
LoadKeysStorageType enum name | LoadKeys |
LoadKeysTransmissionType enum name | LoadKeys |
P1 | ApduCommand |
P2 | ApduCommand |
ReaderKeyNumber | LoadKeys |
StorageType | LoadKeys |
ToString() | ApduCommand | [inline]
TransmissionType | LoadKeys |
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs Source File

  • BackgroundActivation
  • cs

Scenario2_SampleBackgroundTaskWithCondition.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class SampleBackgroundTaskWithCondition : Page
00030     {
00031         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00032         // as NotifyUser()
00033         MainPage rootPage = MainPage.Current;
00034
00035         public SampleBackgroundTaskWithCondition()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         /// </summary>
00043         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             foreach (var task in BackgroundTaskRegistration.AllTasks)
00048             {
00049                 if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskWithConditionName)
00050                 {
00051                     AttachProgressAndCompletedHandlers(task.Value);
00052                     BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName, true);
00053                     break;
00054                 }
00055             }
00056
00057             UpdateUI();
00058         }
00059
00060         /// <summary>
00061         /// Register a SampleBackgroundTaskWithCondition.
00062         /// </summary>
00063         /// <param name="sender"></param>
00064         /// <param name="e"></param>
00065         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00066         {
00067             var task = BackgroundTaskSample.RegisterBackgroundTask(null,
00068                                                                    BackgroundTaskSample.SampleBackgroundTaskWithConditionName,
00069                                                                    new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
00070                                                                    new SystemCondition(SystemConditionType.InternetAvailable));
00071             AttachProgressAndCompletedHandlers(task);
00072             UpdateUI();
00073         }
00074
00075         /// <summary>
00076         /// Unregister a SampleBackgroundTaskWithCondition.
00077         /// </summary>
00078         /// <param name="sender"></param>
00079         /// <param name="e"></param>
00080         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00081         {
00082             BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
00083             UpdateUI();
00084         }
00085
00086         /// <summary>
00087         /// Attach progress and completed handers to a background task.
00088         /// </summary>
00089         /// <param name="task">The task to attach progress and completed handlers to.</param>
00090         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00091         {
00092             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00093             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00094         }
00095
00096         /// <summary>
00097         /// Handle background task progress.
00098         /// </summary>
00099         /// <param name="task">The task that is reporting progress.</param>
00100         /// <param name="e">Arguments of the progress report.</param>
00101         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00102         {
00103             var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00104             {
00105                 var progress = "Progress: " + args.Progress + "%";
00106                 BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress = progress;
00107                 UpdateUI();
00108             });
00109         }
00110
00111         /// <summary>
00112         /// Handle background task completion.
00113         /// </summary>
00114         /// <param name="task">The task that is reporting completion.</param>
00115         /// <param name="e">Arguments of the completion report.</param>
00116         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00117         {
00118             UpdateUI();
00119         }
00120
00121         /// <summary>
00122         /// Update the scenario UI.
00123         /// </summary>
00124         private async void UpdateUI()
00125         {
00126             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00127             () =>
00128             {
00129                 RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
00130                 UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
00131                 Progress.Text = BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress;
00132                 Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
00133             });
00134         }
00135     }
00136 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.h Source File

  • ExtendedExecution
  • cpp

Scenario2_SavingDataReason.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_SavingDataReason.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Page containing the Extended Execution SavingData Reason scenario functions.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class SavingDataReason sealed
00024     {
00025     public:
00026         SavingDataReason();
00027
00028     protected:
00029         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00031
00032     private:
00033         MainPage^ rootPage = MainPage::Current;
00034         Concurrency::cancellation_token_source cancellationTokenSource;
00035         Windows::Foundation::EventRegistrationToken suspendingToken;
00036         Windows::ApplicationModel::SuspendingDeferral^ suspendDeferral = nullptr;
00037
00038         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
00039         void ExtendedExecutionSessionRevoked(Platform::Object^ sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^ args);
00040     };
00041 }
Generated on Fri Nov 15 2024 22:19:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_SaveToCachedFile.xaml.cs Source File

  • FilePickerContracts
  • cs

FileSavePicker_SaveToCachedFile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.Foundation;
00016 using Windows.Storage;
00017 using Windows.Storage.Pickers.Provider;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021 using Windows.Storage.Provider;
00022 using Windows.ApplicationModel.Background;
00023
00024 namespace FilePickerContracts
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class FileSavePicker_SaveToCachedFile : Page
00030     {
00031         FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI;
00032         bool simulateUpdateConflict = false;
00033
00034         public FileSavePicker_SaveToCachedFile()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         private async void OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e)
00040         {
00041             // This scenario demonstrates how to handle the TargetFileRequested event on the background thread on which it was raised
00042
00043             // Requesting a deferral allows the app to call another asynchronous method and complete the request at a later time
00044             var deferral = e.Request.GetDeferral();
00045             StorageFile file;
00046             // If the checkbox is checked then the requested file name will be ConflictingFile.txt instead of what was sent to us in sender.name.
00047             // If background task sees that ConflictingFile is in the name of the file it sets the returned status to FileUpdateStatus.UserInputNeeded.
00048             // This will cause a prompt for the user to open the app to fix the conflict.
00049             if (simulateUpdateConflict)
00050             {
00051                 file = await ApplicationData.Current.LocalFolder.CreateFileAsync("ConflictingFile.txt", CreationCollisionOption.ReplaceExisting);
00052             }
00053             else
00054             {
00055                 file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sender.FileName, CreationCollisionOption.ReplaceExisting);
00056             }
00057             CachedFileUpdater.SetUpdateInformation(file, "CachedFile", ReadActivationMode.NotNeeded, WriteActivationMode.AfterWrite, CachedFileOptions.RequireUpdateOnAccess);
00058             e.Request.TargetFile = file;
00059
00060             // Complete the deferral to let the Picker know the request is finished
00061             deferral.Complete();
00062         }
00063
00064         protected override async void OnNavigatedTo(NavigationEventArgs e)
00065         {
00066             await RegisterBackgroundTaskAsync();
00067             fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00068         }
00069
00070         protected override void OnNavigatedFrom(NavigationEventArgs e)
00071         {
00072             fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00073         }
00074
00075         private async Task RegisterBackgroundTaskAsync()
00076         {
00077             await BackgroundExecutionManager.RequestAccessAsync();
00078
00079             string backgroundTaskName = "FilePickerContractsTasks";
00080             string backgroundTaskEntryPoint = typeof(FilePickerContractsTasks.UpdateFileTask).FullName;
00081
00082             // Do nothing if the task is already registered.
00083             foreach (var task in BackgroundTaskRegistration.AllTasks)
00084             {
00085                 if (task.Value.Name == backgroundTaskName)
00086                 {
00087                     // It is already registered. Don't register it again.
00088                     return;
00089                 }
00090             }
00091
00092             // Register the background task.
00093             var builder = new BackgroundTaskBuilder();
00094             builder.Name = backgroundTaskName;
00095             builder.TaskEntryPoint = backgroundTaskEntryPoint;
00096             builder.SetTrigger(new CachedFileUpdaterTrigger());
00097             try
00098             {
00099                 builder.Register();
00100             }
00101             catch (Exception ex) when ((uint)ex.HResult == 0x80040154)
00102             {
00103                 // REGDB_E_CLASSNOTREG exception is raised if the platform does not
00104                 // support this trigger.
00105             }
00106         }
00107
00108         private void Simulate_Update_Collision_Click(object sender, RoutedEventArgs e)
00109         {
00110             simulateUpdateConflict = SimulateUpdateCollisionCheckBox.IsChecked.HasValue && (bool)SimulateUpdateCollisionCheckBox.IsChecked;
00111         }
00112     }
00113 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DesfireResponse Member List

This is the complete list of members for DesfireResponse, including all inherited members.
ApduResponse() | ApduResponse | [inline]
BoundaryError | DesfireResponse |
DesfireResponse() | DesfireResponse | [inline]
ExtractResponse(IBuffer response) | ApduResponse | [inline, virtual]
ExtractTlvDataObject(byte[] referenceTag) | ApduResponse | [inline]
ResponseData | ApduResponse |
SubsequentFrame | DesfireResponse |
Succeeded | DesfireResponse |
SW | ApduResponse |
SW1 | ApduResponse |
SW2 | ApduResponse |
SWTranslation | DesfireResponse |
TAG_COMPREHENSION_MASK | ApduResponse |
TAG_LENGTH_MULTI_BYTE_MASK | ApduResponse |
TAG_MULTI_BYTE_MASK | ApduResponse |
ToString() | ApduResponse | [inline]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Errors Member List

This is the complete list of members for Errors, including all inherited members.
Cancel | Errors | [static]
Cancel | Errors | [static]
FileGroupEmpty | Errors | [static]
FileGroupEmpty | Errors | [static]
FileGroupLocation | Errors | [static]
FileGroupLocation | Errors | [static]
InvalidSize | Errors | [static]
InvalidSize | Errors | [static]
NoAlbumArt | Errors | [static]
NoAlbumArt | Errors | [static]
NoExifThumbnail | Errors | [static]
NoExifThumbnail | Errors | [static]
NoIcon | Errors | [static]
NoIcon | Errors | [static]
NoImages | Errors | [static]
NoImages | Errors | [static]
NoThumbnail | Errors | [static]
NoThumbnail | Errors | [static]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario3_Region.xaml.h Source File

  • GlobalizationPreferences
  • cpp

Scenario3_Region.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Region.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario3_Region sealed
00020     {
00021     public:
00022         Scenario3_Region();
00023         void ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024
00025     private:
00026         Platform::String^ ReportRegionData(Windows::Globalization::GeographicRegion^ region);
00027     };
00028 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Create Member List

This is the complete list of members for Scenario1_Create, including all inherited members.
PickAudioButton_Click(object sender, RoutedEventArgs e) | Scenario1_Create | [inline, private]
rootPage | Scenario1_Create | [private]
Scenario1_Create() | Scenario1_Create | [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario6DisablePreview.xaml.cs Source File

  • Printing
  • cs

Scenario6DisablePreview.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.Foundation.Metadata;
00016 using Windows.Graphics.Printing;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021 using Windows.UI.Xaml.Printing;
00022
00023
00024 namespace PrintSample
00025 {
00026     /// <summary>
00027     /// This class customizes the standard PrintHelper in order to disable print preview.
00028     /// </summary>
00029     /// <remarks>
00030     /// The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order
00031     /// to disable print preview.
00032     /// Since print preview is disabled, the Paginate event will not be raised.
00033     /// Instead, the pages to be printed are generated in response to the AddPages event.
00034     /// </remarks>
00035     class DisablePreviewPrintHelper : PrintHelper
00036     {
00037         /// <summary>
00038         /// A list of UIElements used to store the print pages.  This gives easy access
00039         /// to any desired print page.
00040         /// </summary>
00041         internal List<UIElement> printPages;
00042
00043         public DisablePreviewPrintHelper(Page scenarioPage) : base(scenarioPage) {
00044             printPages = new List<UIElement>();
00045         }
00046
00047         /// <summary>
00048         /// This is the event handler for PrintManager.PrintTaskRequested.
00049         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline.
00050         /// Therefore, we use this handler to only create the print task.
00051         /// The print settings customization can be done when the print document source is requested.
00052         /// </summary>
00053         /// <param name="sender">PrintManager</param>
00054         /// <param name="e">PrintTaskRequestedEventArgs</param>
00055         protected override void PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e)
00056         {
00057             PrintTask printTask = null;
00058             printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
00059             {
00060                 // Print Task event handler is invoked when the print job is completed.
00061                 printTask.Completed += async (s, args) =>
00062                 {
00063                     // Notify the user when the print operation fails.
00064                     if (args.Completion == PrintTaskCompletion.Failed)
00065                     {
00066                         await scenarioPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00067                         {
00068                             MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
00069                         });
00070                     }
00071                 };
00072
00073                 sourceRequestedArgs.SetSource(printDocumentSource);
00074             });
00075
00076             // Choose not to show the preview by setting the property on PrintTask
00077             printTask.IsPreviewEnabled = false;
00078         }
00079
00080         /// <summary>
00081         /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00082         /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00083         /// into a pages that the Windows print system can deal with.
00084         /// </summary>
00085         /// <param name="sender">PrintDocument</param>
00086         /// <param name="e">Add page event arguments containing a print task options reference</param>
00087         protected override void AddPrintPages(object sender, AddPagesEventArgs e)
00088         {
00089             // Clear the cache of print pages
00090             printPages.Clear();
00091
00092             // Clear the print canvas of print pages
00093             PrintCanvas.Children.Clear();
00094
00095             // This variable keeps track of the last RichTextBlockOverflow element that was added to a page which will be printed
00096             RichTextBlockOverflow lastRTBOOnPage;
00097
00098             // Get the PrintTaskOptions
00099             PrintTaskOptions printingOptions = ((PrintTaskOptions)e.PrintTaskOptions);
00100
00101             // Get the page description to deterimine how big the page is
00102             PrintPageDescription pageDescription = printingOptions.GetPageDescription(0);
00103
00104             // We know there is at least one page to be printed. passing null as the first parameter to
00105             // AddOnePrintPage tells the function to add the first page.
00106             lastRTBOOnPage = AddOnePrintPage(null, pageDescription);
00107
00108             // We know there are more pages to be added as long as the last RichTextBoxOverflow added to a print
00109             // page has extra content
00110             while (lastRTBOOnPage.HasOverflowContent && (lastRTBOOnPage.Visibility == Windows.UI.Xaml.Visibility.Visible))
00111             {
00112                 lastRTBOOnPage = AddOnePrintPage(lastRTBOOnPage, pageDescription);
00113             }
00114
00115             // Loop over all of the pages and add each one to add each page to be printed
00116             for (int i = 0; i < printPages.Count; i++)
00117             {
00118                 // We should have all pages ready at this point...
00119                 printDocument.AddPage(printPages[i]);
00120             }
00121
00122             PrintDocument printDoc = (PrintDocument)sender;
00123
00124             // Indicate that all of the print pages have been provided
00125             printDoc.AddPagesComplete();
00126         }
00127
00128         /// <summary>
00129         /// This function creates and adds one print page to the internal cache of print pages
00130         /// pages stored in printPages.
00131         /// </summary>
00132         /// <param name="lastRTBOAdded">Last RichTextBlockOverflow element added in the current content</param>
00133         /// <param name="printPageDescription">Printer's page description</param>
00134         protected RichTextBlockOverflow AddOnePrintPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription)
00135         {
00136             // XAML element that is used to represent to "printing page"
00137             FrameworkElement page;
00138
00139             // The link container for text overflowing in this page
00140             RichTextBlockOverflow textLink;
00141
00142             // Check if this is the first page ( no previous RichTextBlockOverflow)
00143             if (lastRTBOAdded == null)
00144             {
00145                 // If this is the first page add the specific scenario content
00146                 page = firstPage;
00147
00148                 // Hide footer since we don't know yet if it will be displayed (this might not be the last page) - wait for layout
00149                 StackPanel footer = (StackPanel)page.FindName("Footer");
00150                 footer.Visibility = Visibility.Collapsed;
00151             }
00152             else
00153             {
00154                 // Flow content (text) from previous pages
00155                 page = new ContinuationPage(lastRTBOAdded);
00156             }
00157
00158             // Set "paper" width
00159             page.Width = printPageDescription.PageSize.Width;
00160             page.Height = printPageDescription.PageSize.Height;
00161
00162             Grid printableArea = (Grid)page.FindName("PrintableArea");
00163
00164             // Get the margins size
00165             // If the ImageableRect is smaller than the app provided margins use the ImageableRect
00166             double marginWidth = Math.Max(printPageDescription.PageSize.Width - printPageDescription.ImageableRect.Width, printPageDescription.PageSize.Width * ApplicationContentMarginLeft * 2);
00167             double marginHeight = Math.Max(printPageDescription.PageSize.Height - printPageDescription.ImageableRect.Height, printPageDescription.PageSize.Height * ApplicationContentMarginTop * 2);
00168
00169             // Set-up "printable area" on the "paper"
00170             printableArea.Width = firstPage.Width - marginWidth;
00171             printableArea.Height = firstPage.Height - marginHeight;
00172
00173             // Add the (newly created) page to the print canvas which is part of the visual tree and force it to go
00174             // through layout so that the linked containers correctly distribute the content inside them.
00175             PrintCanvas.Children.Add(page);
00176             PrintCanvas.InvalidateMeasure();
00177             PrintCanvas.UpdateLayout();
00178
00179             // Find the last text container and see if the content is overflowing
00180             textLink = (RichTextBlockOverflow)page.FindName("ContinuationPageLinkedContainer");
00181
00182             // Check if this is the last page
00183             if ((!textLink.HasOverflowContent) && (textLink.Visibility == Windows.UI.Xaml.Visibility.Visible))
00184             {
00185                 StackPanel footer = (StackPanel)page.FindName("Footer");
00186                 footer.Visibility = Visibility.Visible;
00187                 PrintCanvas.UpdateLayout();
00188             }
00189
00190             // Add the page to the print page collection
00191             printPages.Add(page);
00192
00193             return textLink;
00194         }
00195     }
00196
00197     /// <summary>
00198     /// Scenario that demos how to disable the print preview in the Modern Print Dialog window.
00199     /// </summary>
00200     public sealed partial class Scenario6DisablePreview : Page
00201     {
00202         private DisablePreviewPrintHelper printHelper;
00203
00204         public Scenario6DisablePreview()
00205         {
00206             this.InitializeComponent();
00207         }
00208
00209         /// <summary>
00210         /// This is the click handler for the 'Print' button.
00211         /// </summary>
00212         /// <param name="sender"></param>
00213         /// <param name="e"></param>
00214         private async void OnPrintButtonClick(object sender, RoutedEventArgs e)
00215         {
00216             await printHelper.ShowPrintUIAsync();
00217         }
00218
00219         protected override void OnNavigatedTo(NavigationEventArgs e)
00220         {
00221             if (PrintManager.IsSupported())
00222             {
00223                 // Tell the user how to print
00224                 MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
00225             }
00226             else
00227             {
00228                 // Remove the print button
00229                 InvokePrintingButton.Visibility = Visibility.Collapsed;
00230
00231                 // Inform user that Printing is not supported
00232                 MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);
00233
00234                 // Printing-related event handlers will never be called if printing
00235                 // is not supported, but it's okay to register for them anyway.
00236             }
00237
00238             // Initalize common helper class and register for printing
00239             printHelper = new DisablePreviewPrintHelper(this);
00240             printHelper.RegisterForPrinting();
00241
00242             // Initialize print content for this scenario
00243             printHelper.PreparePrintContent(new PageToPrint());
00244         }
00245
00246         protected override void OnNavigatedFrom(NavigationEventArgs e)
00247         {
00248             if (printHelper != null)
00249             {
00250                 printHelper.UnregisterForPrinting();
00251             }
00252         }
00253     }
00254 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level2.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level2.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Level2:
00015 // This class defines the second level of the game. It derives from the
00016 // first level. In this level the targets must be hit in numeric order.
00017
00018 #include "Level1.h"
00019
00020 class Level2 : public Level1
00021 {
00022 public:
00023     Level2();
00024     virtual void Initialize(std::vector<std::shared_ptr<GameObject>> const& objects) override;
00025
00026     virtual bool Update(
00027         float time,
00028         float elapsedTime,
00029         float timeRemaining,
00030         std::vector<std::shared_ptr<GameObject>> const& objects
00031         ) override;
00032
00033     virtual void SaveState(PersistentState& state) override;
00034     virtual void LoadState(PersistentState& state) override;
00035
00036 private:
00037     int m_nextId;
00038 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MainPage.xaml.h Source File

  • XamlBind
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MainPage.g.h"
00015 #include "SampleConfiguration.h"
00016
00017 namespace SDKTemplate
00018 {
00019     public enum class NotifyType
00020     {
00021         StatusMessage,
00022         ErrorMessage
00023     };
00024
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public ref class MainPage sealed
00029     {
00030     public:
00031         MainPage();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035
00036     private:
00037         void ScenarioControl_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00038         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040
00041     internal:
00042         static property MainPage^ Current;
00043         void NotifyUser(Platform::String^ strMessage, NotifyType type);
00044     };
00045 }
00046
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_SaveToAppStorage.xaml.cs Source File

  • FilePickerContracts
  • cs

FileSavePicker_SaveToAppStorage.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using Windows.Foundation;
00015 using Windows.Storage;
00016 using Windows.Storage.Pickers.Provider;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace FilePickerContracts
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class FileSavePicker_SaveToAppStorage : Page
00027     {
00028         FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI;
00029
00030         public FileSavePicker_SaveToAppStorage()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         private async void OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e)
00036         {
00037             // This scenario demonstrates how to handle the TargetFileRequested event on the background thread on which it was raised
00038
00039             // Requesting a deferral allows the app to call another asynchronous method and complete the request at a later time
00040             var deferral = e.Request.GetDeferral();
00041
00042             e.Request.TargetFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(sender.FileName, CreationCollisionOption.GenerateUniqueName);
00043
00044             // Complete the deferral to let the Picker know the request is finished
00045             deferral.Complete();
00046         }
00047
00048         protected override void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00051         }
00052
00053         protected override void OnNavigatedFrom(NavigationEventArgs e)
00054         {
00055             fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00056         }
00057     }
00058 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PredefinedWebSearchGrammar.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_PredefinedWebSearchGrammar.xaml.h"
00014 #include "AudioCapturePermissions.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::ApplicationModel::Resources::Core;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Media::SpeechRecognition;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Controls::Primitives;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Documents;
00030 using namespace Windows::UI::Xaml::Input;
00031 using namespace Windows::UI::Xaml::Media;
00032 using namespace Windows::UI::Xaml::Navigation;
00033
00034 Scenario_PredefinedWebSearchGrammar::Scenario_PredefinedWebSearchGrammar() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 /// <summary>
00040 /// When activating the scenario, ensure we have permission from the user to access their microphone, and
00041 /// provide an appropriate path for the user to enable access to the microphone if they haven't
00042 /// given explicit permission for it.
00043 /// </summary>
00044 /// <param name="e">The navigation event details</param>
00045 void Scenario_PredefinedWebSearchGrammar::OnNavigatedTo(NavigationEventArgs^ e)
00046 {
00047     Page::OnNavigatedTo(e);
00048
00049     // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
00050     dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
00051
00052     create_task(AudioCapturePermissions::RequestMicrophonePermissionAsync(), task_continuation_context::use_current())
00053         .then([this](bool permissionGained)
00054     {
00055         if (permissionGained)
00056         {
00057             // Enable the recognition buttons.
00058             this->btnRecognizeWithUI->IsEnabled = true;
00059             this->btnRecognizeWithoutUI->IsEnabled = true;
00060
00061       Windows::Globalization::Language^ speechLanguage = SpeechRecognizer::SystemSpeechLanguage;
00062       speechContext = ResourceContext::GetForCurrentView();
00063       speechContext->Languages = ref new VectorView<String^>(1, speechLanguage->LanguageTag);
00064
00065       speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationSpeechResources");
00066
00067       PopulateLanguageDropdown();
00068       InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
00069         }
00070         else
00071         {
00072             this->resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00073             this->resultTextBlock->Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
00074       this->cbLanguageSelection->IsEnabled = false;
00075         }
00076   });
00077 }
00078
00079 /// <summary>
00080 /// Creates a SpeechRecognizer instance and initializes the grammar.
00081 /// </summary>
00082 void Scenario_PredefinedWebSearchGrammar::InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage)
00083 {
00084     // If reinitializing the recognizer (ie, changing the speech language), clean up the old recognizer first.
00085     // Avoid doing this while the recognizer is active by disabling the ability to change languages while listening.
00086     if (this->speechRecognizer != nullptr)
00087     {
00088         speechRecognizer->StateChanged -= stateChangedToken;
00089
00090         delete this->speechRecognizer;
00091         this->speechRecognizer = nullptr;
00092     }
00093
00094     // Create an instance of SpeechRecognizer.
00095     this->speechRecognizer = ref new SpeechRecognizer(recognizerLanguage);
00096
00097     // Provide feedback to the user about the state of the recognizer.
00098     stateChangedToken = speechRecognizer->StateChanged +=
00099         ref new Windows::Foundation::TypedEventHandler<
00100         SpeechRecognizer ^,
00101         SpeechRecognizerStateChangedEventArgs ^>(
00102             this,
00103             &Scenario_PredefinedWebSearchGrammar::SpeechRecognizer_StateChanged);
00104
00105     // Add a web search topic constraint to the recognizer.
00106     auto webSearchConstraint = ref new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario::WebSearch, "webSearch");
00107     speechRecognizer->Constraints->Append(webSearchConstraint);
00108
00109     // RecognizeWithUIAsync allows developers to customize the prompts.
00110     speechRecognizer->UIOptions->AudiblePrompt = L"Say what you want to search for...";
00111     speechRecognizer->UIOptions->ExampleText = speechResourceMap->GetValue("WebSearchUIOptionsExampleText", speechContext)->ValueAsString;
00112
00113     // Compile the constraint.
00114     create_task(speechRecognizer->CompileConstraintsAsync(), task_continuation_context::use_current())
00115         .then([this](task<SpeechRecognitionCompilationResult^> previousTask)
00116     {
00117         SpeechRecognitionCompilationResult^ compilationResult = previousTask.get();
00118
00119         // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
00120         if (compilationResult->Status != SpeechRecognitionResultStatus::Success)
00121         {
00122             // Disable the recognition buttons.
00123             btnRecognizeWithUI->IsEnabled = false;
00124             btnRecognizeWithoutUI->IsEnabled = false;
00125
00126             // Let the user know that the grammar didn't compile properly.
00127             resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00128             resultTextBlock->Text = "Unable to compile grammar.";
00129         }
00130     }, task_continuation_context::use_current());
00131 }
00132
00133 /// <summary>
00134 /// Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.
00135 /// </summary>
00136 /// <param name="e">Details about the navigation event</param>
00137 void Scenario_PredefinedWebSearchGrammar::OnNavigatedFrom(NavigationEventArgs^ e)
00138 {
00139     Page::OnNavigatedFrom(e);
00140
00141     if (speechRecognizer != nullptr)
00142     {
00143         speechRecognizer->StateChanged -= stateChangedToken;
00144
00145         delete speechRecognizer;
00146         speechRecognizer = nullptr;
00147     }
00148 }
00149
00150 /// <summary>
00151 /// Uses the recognizer constructed earlier to listen for speech from the user before displaying
00152 /// it back on the screen. Uses the built-in speech recognition UI.
00153 /// </summary>
00154 /// <param name="sender">Button that triggered this event</param>
00155 /// <param name="e">State information about the routed event</param>
00156 void Scenario_PredefinedWebSearchGrammar::RecognizeWithUIWebSearchGrammar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00157 {
00158     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00159     hlOpenPrivacySettings->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00160
00161     try
00162     {
00163         // Start recognition.
00164         create_task(speechRecognizer->RecognizeWithUIAsync(), task_continuation_context::use_current())
00165             .then([this](task<SpeechRecognitionResult^> recognitionTask)
00166         {
00167             try
00168             {
00169                 SpeechRecognitionResult^ speechRecognitionResult = recognitionTask.get();
00170                 // If successful, display the recognition result.
00171                 if (speechRecognitionResult->Status == SpeechRecognitionResultStatus::Success)
00172                 {
00173                     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00174                     resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00175                     resultTextBlock->Text = speechRecognitionResult->Text;
00176                 }
00177                 else
00178                 {
00179                     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00180                     resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00181                     resultTextBlock->Text = L"Speech Recognition Failure, Status: " + speechRecognitionResult->Status.ToString();
00182                 }
00183             }
00184             catch (ObjectDisposedException^ exception)
00185             {
00186                 // ObjectDisposedException will be thrown if you exit the scenario while the recogizer is actively
00187                 // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00188                 // show a message dialog for this exception.
00189                 OutputDebugString(L"ObjectDisposedException caught while recognition in progress (can be ignored):");
00190                 OutputDebugString(exception->ToString()->Data());
00191             }
00192             catch (Exception^ exception)
00193             {
00194                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00195                 create_task(messageDialog->ShowAsync());
00196             }
00197         });
00198     }
00199     catch (COMException^ exception)
00200     {
00201         // Handle the speech privacy policy error.
00202         if ((unsigned int)exception->HResult == Scenario_PredefinedWebSearchGrammar::HResultPrivacyStatementDeclined)
00203         {
00204             hlOpenPrivacySettings->Visibility = Windows::UI::Xaml::Visibility::Visible;
00205         }
00206         else
00207         {
00208             auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00209             create_task(messageDialog->ShowAsync());
00210         }
00211     }
00212 }
00213
00214 /// <summary>
00215 /// Uses the recognizer constructed earlier to listen for speech from the user before displaying
00216 /// it back on the screen. Uses developer-provided UI for user feedback.
00217 /// </summary>
00218 /// <param name="sender">Button that triggered this event</param>
00219 /// <param name="e">State information about the routed event</param>
00220 void Scenario_PredefinedWebSearchGrammar::RecognizeWithoutUIWebSearchGrammar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00221 {
00222     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00223     hlOpenPrivacySettings->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00224
00225     // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
00226     btnRecognizeWithUI->IsEnabled = false;
00227     btnRecognizeWithoutUI->IsEnabled = false;
00228     cbLanguageSelection->IsEnabled = false;
00229     listenWithoutUIButtonText->Text = " listening for speech...";
00230     try
00231     {
00232         // Start recognition.
00233         create_task(speechRecognizer->RecognizeAsync(), task_continuation_context::use_current())
00234             .then([this](task<SpeechRecognitionResult^> recognitionTask)
00235         {
00236             try
00237             {
00238                 SpeechRecognitionResult^ speechRecognitionResult = recognitionTask.get();
00239                 // If successful, display the recognition result.
00240                 if (speechRecognitionResult->Status == SpeechRecognitionResultStatus::Success)
00241                 {
00242                     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00243                     resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00244                     resultTextBlock->Text = speechRecognitionResult->Text;
00245                 }
00246                 else
00247                 {
00248                     heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00249                     resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
00250                     resultTextBlock->Text = L"Speech Recognition Failure, Status: " + speechRecognitionResult->Status.ToString();
00251                 }
00252             }
00253             catch (ObjectDisposedException^ exception)
00254             {
00255                 // ObjectDisposedException will be thrown if you exit the scenario while the recogizer is actively
00256                 // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00257                 // show a message dialog for this exception.
00258                 OutputDebugString(L"ObjectDisposedException caught while recognition in progress (can be ignored):");
00259                 OutputDebugString(exception->ToString()->Data());
00260             }
00261             catch (Exception^ exception)
00262             {
00263                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00264                 create_task(messageDialog->ShowAsync());
00265             }
00266
00267             // Reset UI state.
00268             listenWithoutUIButtonText->Text = " without UI";
00269             btnRecognizeWithUI->IsEnabled = true;
00270             btnRecognizeWithoutUI->IsEnabled = true;
00271             cbLanguageSelection->IsEnabled = true;
00272         });
00273     }
00274     catch (COMException^ exception)
00275     {
00276         if ((unsigned int)exception->HResult == Scenario_PredefinedWebSearchGrammar::HResultPrivacyStatementDeclined)
00277         {
00278             // If the privacy policy hasn't been accepted, attempting to create a task out of RecognizeAsync fails immediately with a
00279             // COMException and this specific HResult.
00280             hlOpenPrivacySettings->Visibility = Windows::UI::Xaml::Visibility::Visible;
00281         }
00282         else
00283         {
00284             auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00285             create_task(messageDialog->ShowAsync());
00286         }
00287
00288         // Reset UI state.
00289         listenWithoutUIButtonText->Text = " without UI";
00290         btnRecognizeWithUI->IsEnabled = true;
00291         btnRecognizeWithoutUI->IsEnabled = true;
00292         cbLanguageSelection->IsEnabled = true;
00293     }
00294 }
00295
00296 /// <summary>
00297 /// Handle SpeechRecognizer state changed events by updating a UI component.
00298 /// </summary>
00299 /// <param name="sender">Speech recognizer that generated this status event</param>
00300 /// <param name="args">The recognizer's status</param>
00301 void Scenario_PredefinedWebSearchGrammar::SpeechRecognizer_StateChanged(SpeechRecognizer ^sender, SpeechRecognizerStateChangedEventArgs ^args)
00302 {
00303     dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00304     {
00305         rootPage->NotifyUser("Speech recognizer state: " + args->State.ToString(), NotifyType::StatusMessage);
00306     }));
00307
00308 }
00309
00310 /// <summary>
00311 /// Populate language dropdown with supported Dictation languages.
00312 /// </summary>
00313 void Scenario_PredefinedWebSearchGrammar::PopulateLanguageDropdown()
00314 {
00315     Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
00316     auto supportedLanguages = SpeechRecognizer::SupportedTopicLanguages;
00317     std::for_each(begin(supportedLanguages), end(supportedLanguages), [&](Windows::Globalization::Language^ lang)
00318     {
00319         ComboBoxItem^ item = ref new ComboBoxItem();
00320         item->Tag = lang;
00321         item->Content = lang->DisplayName;
00322
00323         cbLanguageSelection->Items->Append(item);
00324         if (lang->LanguageTag == defaultLanguage->LanguageTag)
00325         {
00326             item->IsSelected = true;
00327             cbLanguageSelection->SelectedItem = item;
00328         }
00329     });
00330 }
00331
00332 /// <summary>
00333 /// Re-initialize the recognizer based on selections from the language combobox.
00334 /// </summary>
00335 void Scenario_PredefinedWebSearchGrammar::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00336 {
00337     if (this->speechRecognizer != nullptr)
00338     {
00339         ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
00340         Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
00341         if (speechRecognizer->CurrentLanguage != newLanguage)
00342         {
00343             try
00344             {
00345                 speechContext->Languages = ref new VectorView<String^>(1, newLanguage->LanguageTag);
00346
00347                 InitializeRecognizer(newLanguage);
00348             }
00349             catch (Exception^ exception)
00350             {
00351                 auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
00352                 create_task(messageDialog->ShowAsync());
00353             }
00354         }
00355     }
00356 }
00357
00358 /// <summary>
00359 /// Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the
00360 /// Microsoft Privacy Policy, and enable personalization.
00361 /// </summary>
00362 /// <param name="sender">Ignored</param>
00363 /// <param name="args">Ignored</param>
00364 void Scenario_PredefinedWebSearchGrammar::openPrivacySettings_Click(Hyperlink^ sender, HyperlinkClickEventArgs^ args)
00365 {
00366     create_task(Windows::System::Launcher::LaunchUriAsync(ref new Uri(L"ms-settings:privacy-speech")));
00367 }
Generated on Fri Nov 15 2024 22:21:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

App Member List

This is the complete list of members for App, including all inherited members.
App() | App
CreateRootFrame() | App
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &) | App
OnNavigationFailed(IInspectable const &, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const &) | App
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario1_CreateTPMVSC.xaml.cpp Source File

  • SmartCard
  • cpp

Scenario1_CreateTPMVSC.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_CreateTPMVSC.xaml.h"
00005 #include "ChallengeResponseAlgorithm.h"
00006
00007 using namespace SDKTemplate;
00008
00009 using namespace concurrency;
00010 using namespace Platform;
00011 using namespace Windows::Devices::SmartCards;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::Globalization::NumberFormatting;
00015 using namespace Windows::Storage::Streams;
00016 using namespace Windows::Security::Cryptography;
00017 using namespace Windows::Security::Cryptography::Core;
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::UI::Xaml::Controls;
00020 using namespace Windows::UI::Xaml::Controls::Primitives;
00021 using namespace Windows::UI::Xaml::Data;
00022 using namespace Windows::UI::Xaml::Input;
00023 using namespace Windows::UI::Xaml::Media;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario1_CreateTPMVSC::Scenario1_CreateTPMVSC() : reader(nullptr)
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void Scenario1_CreateTPMVSC::Create_Click(Platform::Object^ sender,
00032     Windows::UI::Xaml::RoutedEventArgs^ e)
00033 {
00034     Button^ b = dynamic_cast<Button^>(sender);
00035     b->IsEnabled = false;
00036
00037     SmartCardPinPolicy^ pinPolicy = nullptr;
00038     try
00039     {
00040         pinPolicy = ParsePinPolicy();
00041     }
00042     catch (Exception^ ex)
00043     {
00044         MainPage::Current->NotifyUser("Failed to parse PIN policy due to exception: " + ex->ToString(), NotifyType::ErrorMessage);
00045         b->IsEnabled = true;
00046         return;
00047     }
00048
00049     MainPage::Current->AdminKey = CryptographicBuffer::GenerateRandom(ADMIN_KEY_LENGTH_IN_BYTES);
00050
00051     MainPage::Current->NotifyUser("Creating TPM virtual smart card...", NotifyType::StatusMessage);
00052
00053     create_task(SmartCardProvisioning::RequestVirtualSmartCardCreationAsync(FriendlyName->Text, MainPage::Current->AdminKey, pinPolicy)).then(
00054         [=](task<SmartCardProvisioning^> createCardTask)
00055     {
00056         SmartCardProvisioning^ provisioning = createCardTask.get();
00057
00058         // If the user selects Cancel on the card creation prompt,
00059         // nullptr will be returned.  In this case, we need to cancel
00060         // the following asynchronous calls.
00061         if (nullptr == provisioning)
00062         {
00063             cancel_current_task();
00064         }
00065
00066         // The following block is not directly related to TPM virtual smart
00067         // card creation, but rather demonstrates how to handle CardAdded
00068         // events by registering an event handler with a SmartCardReader
00069         // object.  Since we are using a TPM virtual smart card in this
00070         // case, the card cannot actually be added to or removed from
00071         // the reader, but a CardAdded event will fire as soon as the
00072         // handler is added.
00073         {
00074             // First, get the SmartCardReader for the reader we want to
00075             // receive events for.  It is important to note that the
00076             // event handler will only be fired during the lifetime of
00077             // this particular SmartCardReader instance; i.e., in this
00078             // case, if this->reader is destructed, events will no
00079             // longer be fired.  Thus, we must maintain a handle
00080             // to it as an instance member so that its reference
00081             // count remains non-zero for the lifetime of the page.
00082             this->reader = provisioning->SmartCard->Reader;
00083
00084             // Here we use the += operator to add our event handler to the
00085             // collection of CardAdded handlers for the reader.  Note that
00086             // if you want to do any UI operations in the handler, or in
00087             // general use any non-agile objects, you must specify a
00088             // callback context of CallbackContext::Same in the
00089             // TypedEventHandler's constructor, as below.  Otherwise you
00090             // may receive exceptions due to RPC_E_WRONG_THREAD.
00091             this->reader->CardAdded += ref new
00092                 TypedEventHandler<SmartCardReader ^, CardAddedEventArgs ^>(this, &Scenario1_CreateTPMVSC::HandleCardAdded, Platform::CallbackContext::Same);
00093         }
00094
00095         MainPage::Current->SmartCardReaderDeviceId = provisioning->SmartCard->Reader->DeviceId;
00096
00097         // We now have a TPM virtual smart card which is provisioned and
00098         // ready to use; therefore, the following steps are not strictly
00099         // necessary.  However, should you want to re-provision the card
00100         // in the future, you would first get a challenge context from
00101         // the provisioning object and use that to re-provision the card.
00102         return provisioning->GetChallengeContextAsync();
00103     }).then(
00104         [=](task<SmartCardChallengeContext^> getChallengeTask)
00105     {
00106         SmartCardChallengeContext^ context = getChallengeTask.get();
00107
00108         IBuffer^ response = ChallengeResponseAlgorithm::CalculateResponse(context->Challenge, MainPage::Current->AdminKey);
00109
00110         return context->ProvisionAsync(response, true);
00111     }).then(
00112         [=](task<void> provisionTask)
00113     {
00114         try
00115         {
00116             provisionTask.get();
00117             MainPage::Current->NotifyUser("TPM virtual smart card is provisioned and ready for use.", NotifyType::StatusMessage);
00118         }
00119         catch (COMException ^ex)
00120         {
00121             // Two potentially common error scenarios when creating a TPM
00122             // virtual smart card are that the user's machine may not have
00123             // a TPM, or the TPM may not be ready for use.  It is important
00124             // to explicitly check for these scenarios by checking the
00125             // HResult of any exceptions thrown by
00126             // RequestVirtualSmartCardCreationAsync and gracefully
00127             // providing a suitable message to the user.
00128             if (NTE_DEVICE_NOT_FOUND == ex->HResult)
00129             {
00130                 MainPage::Current->NotifyUser("We were unable to find a Trusted Platform Module on your machine. A TPM is required to use a TPM Virtual Smart Card.", NotifyType::ErrorMessage);
00131             }
00132             else if (NTE_DEVICE_NOT_READY == ex->HResult)
00133             {
00134                 MainPage::Current->NotifyUser("Your Trusted Platform Module is not ready for use. Please contact your administrator for assistance with initializing your TPM.", NotifyType::ErrorMessage);
00135             }
00136             else
00137             {
00138                 MainPage::Current->NotifyUser("TPM virtual smart card creation failed with exception: " + ex->ToString(), NotifyType::ErrorMessage);
00139             }
00140         }
00141         catch (const task_canceled&)
00142         {
00143             // If the user cancelled the card creation prompt and
00144             // cancel_current_task was called above, subsequent blocks in the
00145             // async chain will throw task_canceled, which will be caught here.
00146             MainPage::Current->NotifyUser("TPM virtual smart card creation was canceled by the user.", NotifyType::StatusMessage);
00147         }
00148
00149         b->IsEnabled = true;
00150     });
00151 }
00152
00153 void Scenario1_CreateTPMVSC::HandleCardAdded(SmartCardReader^ evtReader, CardAddedEventArgs^ args)
00154 {
00155     MainPage::Current->NotifyUser("Card added to reader " + evtReader->Name + ".", NotifyType::StatusMessage);
00156 }
00157
00158 SmartCardPinPolicy^ Scenario1_CreateTPMVSC::ParsePinPolicy()
00159 {
00160     SmartCardPinPolicy^ pinPolicy = ref new SmartCardPinPolicy();
00161
00162     DecimalFormatter^ formatter = ref new DecimalFormatter();
00163     Platform::IBox<unsigned long long>^ minLength = formatter->ParseUInt(PinMinLength->Text);
00164     Platform::IBox<unsigned long long>^ maxLength = formatter->ParseUInt(PinMaxLength->Text);
00165
00166     // Verify that the value parsed by the DecimalFormatter is valid.
00167     // If the text box is empty or contains a non-integer, the IBox
00168     // will be nullptr.
00169     if (nullptr == minLength || nullptr == maxLength)
00170     {
00171         throw ref new Exception(NTE_INVALID_PARAMETER);
00172     }
00173
00174     // Note: the following cast is unsafe, but in this situation
00175     // it is not a problem as the maximum allowable MinLength
00176     // and MaxLength values are much smaller than MAXUINT.
00177     pinPolicy->MinLength = (unsigned int)minLength->Value;
00178     pinPolicy->MaxLength = (unsigned int)maxLength->Value;
00179
00180     switch (PinUppercase->SelectedIndex)
00181     {
00182     case pinPolicyDisallowedIndex:
00183         pinPolicy->UppercaseLetters = SmartCardPinCharacterPolicyOption::Disallow;
00184         break;
00185     case pinPolicyAllowedIndex:
00186         pinPolicy->UppercaseLetters = SmartCardPinCharacterPolicyOption::Allow;
00187         break;
00188     case pinPolicyRequireOneIndex:
00189         pinPolicy->UppercaseLetters = SmartCardPinCharacterPolicyOption::RequireAtLeastOne;
00190         break;
00191     default:
00192         throw ref new Exception(NTE_INVALID_PARAMETER);
00193     }
00194
00195     switch (PinLowercase->SelectedIndex)
00196     {
00197     case pinPolicyDisallowedIndex:
00198         pinPolicy->LowercaseLetters = SmartCardPinCharacterPolicyOption::Disallow;
00199         break;
00200     case pinPolicyAllowedIndex:
00201         pinPolicy->LowercaseLetters = SmartCardPinCharacterPolicyOption::Allow;
00202         break;
00203     case pinPolicyRequireOneIndex:
00204         pinPolicy->LowercaseLetters = SmartCardPinCharacterPolicyOption::RequireAtLeastOne;
00205         break;
00206     default:
00207         throw ref new Exception(NTE_INVALID_PARAMETER);
00208     }
00209
00210     switch (PinDigits->SelectedIndex)
00211     {
00212     case pinPolicyDisallowedIndex:
00213         pinPolicy->Digits = SmartCardPinCharacterPolicyOption::Disallow;
00214         break;
00215     case pinPolicyAllowedIndex:
00216         pinPolicy->Digits = SmartCardPinCharacterPolicyOption::Allow;
00217         break;
00218     case pinPolicyRequireOneIndex:
00219         pinPolicy->Digits = SmartCardPinCharacterPolicyOption::RequireAtLeastOne;
00220         break;
00221     default:
00222         throw ref new Exception(NTE_INVALID_PARAMETER);
00223     }
00224
00225     switch (PinSpecial->SelectedIndex)
00226     {
00227     case pinPolicyDisallowedIndex:
00228         pinPolicy->SpecialCharacters = SmartCardPinCharacterPolicyOption::Disallow;
00229         break;
00230     case pinPolicyAllowedIndex:
00231         pinPolicy->SpecialCharacters = SmartCardPinCharacterPolicyOption::Allow;
00232         break;
00233     case pinPolicyRequireOneIndex:
00234         pinPolicy->SpecialCharacters = SmartCardPinCharacterPolicyOption::RequireAtLeastOne;
00235         break;
00236     default:
00237         throw ref new Exception(NTE_INVALID_PARAMETER);
00238     }
00239
00240     return pinPolicy;
00241 }
Generated on Fri Nov 15 2024 22:21:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShowPackageFamilyName Member List

This is the complete list of members for ShowPackageFamilyName, including all inherited members.
ShowPackageFamilyName() ShowPackageFamilyName [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CopyFiles Member List

This is the complete list of members for CopyFiles, including all inherited members.
CopyButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | CopyFiles
CopyFiles() | CopyFiles
PasteButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | CopyFiles
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario3.cpp Source File

  • Logging
  • cppwinrt

Scenario3.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3.h"
00014 #include "Scenario3.g.cpp"
00015 #include "LoggingScenarioHelpers.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::UI::Xaml;
00020 using namespace winrt::Windows::UI::Xaml::Controls;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::SDKTemplate::implementation;
00023
00024 Scenario3::Scenario3()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 fire_and_forget
00030 Scenario3::DoScenario(IInspectable const&, RoutedEventArgs const&)
00031 {
00032     MainPage::Current().NotifyUser(L"Scenario running...", NotifyType::StatusMessage);
00033     DoScenarioButton().IsEnabled(false);
00034
00035     // Run the scenario asynchronously so the UI can update.
00036     co_await resume_background();
00037     co_await _instance.DoScenarioAsync();
00038
00039     // After the scenario completes, re-enable UI controls and display a message.
00040     co_await resume_foreground(Dispatcher());
00041     DoScenarioButton().IsEnabled(true);
00042     MainPage::Current().NotifyUser(L"Scenario finished.", NotifyType::StatusMessage);
00043 }
00044
00045 fire_and_forget
00046 Scenario3::EnableDisableLogging(IInspectable const&, RoutedEventArgs const&)
00047 {
00048     if (_instance.LoggingEnabled())
00049     {
00050         MainPage::Current().NotifyUser(L"Disabling logging...", NotifyType::StatusMessage);
00051     }
00052     else
00053     {
00054         MainPage::Current().NotifyUser(L"Enabling logging...", NotifyType::StatusMessage);
00055     }
00056
00057     co_await _instance.ToggleLoggingEnabledDisabledAsync();
00058
00059     co_await resume_foreground(Dispatcher());
00060
00061     UpdateControls();
00062
00063     if (_instance.LoggingEnabled())
00064     {
00065         MainPage::Current().NotifyUser(L"Logging enabled.", NotifyType::StatusMessage);
00066     }
00067     else
00068     {
00069         MainPage::Current().NotifyUser(L"Logging disabled.", NotifyType::StatusMessage);
00070     }
00071 }
00072
00073 void
00074 Scenario3::OnNavigatedTo(NavigationEventArgs const&)
00075 {
00076     _statusChangedToken = _instance.StatusChanged({ this, &Scenario3::OnStatusChanged });
00077     UpdateControls();
00078 }
00079
00080 void
00081 Scenario3::OnNavigatedFrom(NavigationEventArgs const&)
00082 {
00083     _instance.StatusChanged(_statusChangedToken);
00084     UpdateControls();
00085 }
00086
00087 void
00088 Scenario3::UpdateControls()
00089 {
00090     if (_instance.LoggingEnabled())
00091     {
00092         InputTextBlock1().Text(
00093             L"Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.");
00094         EnableDisableLoggingButton().Content(box_value(L"Disable Logging"));
00095
00096         if (_instance.IsBusy())
00097         {
00098             EnableDisableLoggingButton().IsEnabled(false);
00099             DoScenarioButton().IsEnabled(false);
00100         }
00101         else
00102         {
00103             EnableDisableLoggingButton().IsEnabled(true);
00104             DoScenarioButton().IsEnabled(true);
00105         }
00106     }
00107     else
00108     {
00109         InputTextBlock1().Text(
00110             L"Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.");
00111         EnableDisableLoggingButton().Content(box_value(L"Enable Logging"));
00112         DoScenarioButton().IsEnabled(false);
00113         EnableDisableLoggingButton().IsEnabled(!_instance.IsBusy());
00114     }
00115 }
00116
00117 void
00118 Scenario3::AddMessage(_In_ LPCWSTR message)
00119 {
00120     TextBox statusMessageList = StatusMessageList();
00121     std::wstring statusText(statusMessageList.Text());
00122     statusText += message;
00123     statusText += L"\r\n";
00124     statusMessageList.Text(statusText);
00125     statusMessageList.Select(static_cast<int32_t>(statusText.size()), 0);
00126
00127     ScrollViewer viewer = FindScrollViewer(statusMessageList);
00128     if (viewer != nullptr)
00129     {
00130         viewer.ChangeView(nullptr, statusMessageList.ActualHeight(), nullptr);
00131     }
00132 }
00133
00134 void
00135 Scenario3::AddLogFileMessage(_In_ LPCWSTR message, _In_opt_ LPCWSTR logFileFullPath)
00136 {
00137     std::wstring finalMessage = message;
00138
00139     if (logFileFullPath == nullptr || logFileFullPath[0] == 0)
00140     {
00141         finalMessage += L": none, nothing logged since saving the last file.";
00142     }
00143     else
00144     {
00145         // Add a message to the UI indicating a new log file was created.
00146         std::wstring fullPath(logFileFullPath);
00147         std::wstring directoryName;
00148         std::wstring fileName;
00149         std::size_t lastSlashPos = fullPath.find_last_of(L'\\');
00150         if (lastSlashPos > 0 && lastSlashPos < fullPath.size() - 1)
00151         {
00152             directoryName = fullPath.substr(0, lastSlashPos);
00153             fileName = fullPath.substr(lastSlashPos + 1, fullPath.size() - (lastSlashPos + 1));
00154         }
00155
00156         ViewLogInfo().Text(
00157             L"Log folder: \"" + directoryName + L"\"\r\n"
00158             L"- To view with tracerpt: tracerpt.exe \"" + fullPath + L"\" -of XML -o LogFile.xml\r\n"
00159             L"- To view with Windows Performance Toolkit (WPT):\n"
00160             L"   xperf -merge \"" + fullPath + "\" merged.etl\n"
00161             L"   wpa.exe merged.etl");
00162
00163         finalMessage += L": ";
00164         finalMessage += fileName;
00165     }
00166
00167     AddMessage(finalMessage.c_str());
00168 }
00169
00170 fire_and_forget
00171 Scenario3::OnStatusChanged(SDKTemplate::LoggingScenarioEventArgs args)
00172 {
00173     // Switch to UI thread.
00174     co_await resume_foreground(Dispatcher());
00175
00176     switch (args.Type())
00177     {
00178     case LoggingScenarioEventType::BusyStatusChanged:
00179         UpdateControls();
00180         break;
00181
00182     case LoggingScenarioEventType::LogFileGenerated:
00183         AddLogFileMessage(L"LogFileGenerated", args.LogFileFullPath().c_str());
00184         break;
00185
00186     case LoggingScenarioEventType::LogFileGeneratedAtSuspend:
00187         AddLogFileMessage(L"Log file at suspend", args.LogFileFullPath().c_str());
00188         break;
00189
00190     case LoggingScenarioEventType::LogFileGeneratedAtDisable:
00191         AddLogFileMessage(L"Log file at disable", args.LogFileFullPath().c_str());
00192         break;
00193
00194     case LoggingScenarioEventType::LoggingEnabledDisabled:
00195         AddMessage(args.Enabled()
00196             ? L"Logging has been enabled."
00197             : L"Logging has been disabled.");
00198         break;
00199
00200     default:
00201         AddMessage(L"Unrecognized event.");
00202         break;
00203     }
00204 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Common/StepTimer.h Source File

  • HolographicFaceTracking
  • cpp
  • Common

StepTimer.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Helper class for animation and simulation timing.
00017     class StepTimer
00018     {
00019     public:
00020         StepTimer() :
00021             m_elapsedTicks(0),
00022             m_totalTicks(0),
00023             m_leftOverTicks(0),
00024             m_frameCount(0),
00025             m_framesPerSecond(0),
00026             m_framesThisSecond(0),
00027             m_qpcSecondCounter(0),
00028             m_isFixedTimeStep(false),
00029             m_targetElapsedTicks(TicksPerSecond / 60)
00030         {
00031             m_qpcFrequency = GetPerformanceFrequency();
00032
00033             // Initialize max delta to 1/10 of a second.
00034             m_qpcMaxDelta = m_qpcFrequency / 10;
00035         }
00036
00037         // Get elapsed time since the previous Update call.
00038         uint64 GetElapsedTicks() const                        { return m_elapsedTicks;                  }
00039         double GetElapsedSeconds() const                      { return TicksToSeconds(m_elapsedTicks);  }
00040
00041         // Get total time since the start of the program.
00042         uint64 GetTotalTicks() const                          { return m_totalTicks;                    }
00043         double GetTotalSeconds() const                        { return TicksToSeconds(m_totalTicks);    }
00044
00045         // Get total number of updates since start of the program.
00046         uint32 GetFrameCount() const                          { return m_frameCount;                    }
00047
00048         // Get the current framerate.
00049         uint32 GetFramesPerSecond() const                     { return m_framesPerSecond;               }
00050
00051         // Set whether to use fixed or variable timestep mode.
00052         void SetFixedTimeStep(bool isFixedTimestep)           { m_isFixedTimeStep = isFixedTimestep;    }
00053
00054         // Set how often to call Update when in fixed timestep mode.
00055         void SetTargetElapsedTicks(uint64 targetElapsed)      { m_targetElapsedTicks = targetElapsed;   }
00056         void SetTargetElapsedSeconds(double targetElapsed)    { m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }
00057
00058         // Integer format represents time using 10,000,000 ticks per second.
00059         static const uint64 TicksPerSecond = 10'000'000;
00060
00061         static double TicksToSeconds(uint64 ticks)            { return static_cast<double>(ticks) / TicksPerSecond;     }
00062         static uint64 SecondsToTicks(double seconds)          { return static_cast<uint64>(seconds * TicksPerSecond);   }
00063
00064         // Convenient wrapper for QueryPerformanceFrequency. Throws an exception if
00065         // the call to QueryPerformanceFrequency fails.
00066         static inline uint64 GetPerformanceFrequency()
00067         {
00068             LARGE_INTEGER freq;
00069             if (!QueryPerformanceFrequency(&freq))
00070             {
00071                 throw ref new Platform::FailureException();
00072             }
00073             return freq.QuadPart;
00074         }
00075
00076         // Gets the current number of ticks from QueryPerformanceCounter. Throws an
00077         // exception if the call to QueryPerformanceCounter fails.
00078         static inline int64 GetTicks()
00079         {
00080             LARGE_INTEGER ticks;
00081             if (!QueryPerformanceCounter(&ticks))
00082             {
00083                 throw ref new Platform::FailureException();
00084             }
00085             return ticks.QuadPart;
00086         }
00087
00088         // After an intentional timing discontinuity (for instance a blocking IO operation)
00089         // call this to avoid having the fixed timestep logic attempt a set of catch-up
00090         // Update calls.
00091
00092         void ResetElapsedTime()
00093         {
00094             m_qpcLastTime = GetTicks();
00095
00096             m_leftOverTicks    = 0;
00097             m_framesPerSecond  = 0;
00098             m_framesThisSecond = 0;
00099             m_qpcSecondCounter = 0;
00100         }
00101
00102         // Update timer state, calling the specified Update function the appropriate number of times.
00103         template<typename TUpdate>
00104         void Tick(const TUpdate& update)
00105         {
00106             // Query the current time.
00107             uint64 currentTime = GetTicks();
00108             uint64 timeDelta   = currentTime - m_qpcLastTime;
00109
00110             m_qpcLastTime      = currentTime;
00111             m_qpcSecondCounter += timeDelta;
00112
00113             // Clamp excessively large time deltas (e.g. after paused in the debugger).
00114             if (timeDelta > m_qpcMaxDelta)
00115             {
00116                 timeDelta = m_qpcMaxDelta;
00117             }
00118
00119             // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
00120             timeDelta *= TicksPerSecond;
00121             timeDelta /= m_qpcFrequency;
00122
00123             uint32 lastFrameCount = m_frameCount;
00124
00125             if (m_isFixedTimeStep)
00126             {
00127                 // Fixed timestep update logic
00128
00129                 // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
00130                 // the clock to exactly match the target value. This prevents tiny and irrelevant errors
00131                 // from accumulating over time. Without this clamping, a game that requested a 60 fps
00132                 // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
00133                 // accumulate enough tiny errors that it would drop a frame. It is better to just round
00134                 // small deviations down to zero to leave things running smoothly.
00135
00136                 if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
00137                 {
00138                     timeDelta = m_targetElapsedTicks;
00139                 }
00140
00141                 m_leftOverTicks += timeDelta;
00142
00143                 while (m_leftOverTicks >= m_targetElapsedTicks)
00144                 {
00145                     m_elapsedTicks   = m_targetElapsedTicks;
00146                     m_totalTicks    += m_targetElapsedTicks;
00147                     m_leftOverTicks -= m_targetElapsedTicks;
00148                     m_frameCount++;
00149
00150                     update();
00151                 }
00152             }
00153             else
00154             {
00155                 // Variable timestep update logic.
00156                 m_elapsedTicks  = timeDelta;
00157                 m_totalTicks   += timeDelta;
00158                 m_leftOverTicks = 0;
00159                 m_frameCount++;
00160
00161                 update();
00162             }
00163
00164             // Track the current framerate.
00165             if (m_frameCount != lastFrameCount)
00166             {
00167                 m_framesThisSecond++;
00168             }
00169
00170             if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
00171             {
00172                 m_framesPerSecond   = m_framesThisSecond;
00173                 m_framesThisSecond  = 0;
00174                 m_qpcSecondCounter %= m_qpcFrequency;
00175             }
00176         }
00177
00178     private:
00179
00180         // Source timing data uses QPC units.
00181         uint64 m_qpcFrequency;
00182         uint64 m_qpcLastTime;
00183         uint64 m_qpcMaxDelta;
00184
00185         // Derived timing data uses a canonical tick format.
00186         uint64 m_elapsedTicks;
00187         uint64 m_totalTicks;
00188         uint64 m_leftOverTicks;
00189
00190         // Members for tracking the framerate.
00191         uint32 m_frameCount;
00192         uint32 m_framesPerSecond;
00193         uint32 m_framesThisSecond;
00194         uint64 m_qpcSecondCounter;
00195
00196         // Members for configuring fixed timestep mode.
00197         bool   m_isFixedTimeStep;
00198         uint64 m_targetElapsedTicks;
00199     };
00200 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SecondaryAppWindowPage.cpp Source File

  • AppWindow
  • cppwinrt

SecondaryAppWindowPage.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SecondaryAppWindowPage.h"
00014 #include "SecondaryAppWindowPage.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::Xaml;
00019
00020 namespace winrt::SDKTemplate::implementation
00021 {
00022     SecondaryAppWindowPage::SecondaryAppWindowPage()
00023     {
00024         InitializeComponent();
00025     }
00026 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LinguisticServices Member List

This is the complete list of members for LinguisticServices, including all inherited members.
RecognizeTextLanguages(hstring const &text) | LinguisticServices | [static]
RecognizeTextScripts(hstring const &text) | LinguisticServices | [static]
TransliterateFromCyrillicToLatin(hstring const &text) | LinguisticServices | [static]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceListEntry Member List

This is the complete list of members for DeviceListEntry, including all inherited members.
Device | DeviceListEntry |
DeviceListEntry(Windows.Devices.Enumeration.DeviceInformation DeviceInterface) | DeviceListEntry | [inline]
Id | DeviceListEntry |
InstanceId | DeviceListEntry |
Matched | DeviceListEntry |
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/DesfireAccessHandler.cs Source File

  • Nfc
  • PcscSdk

DesfireAccessHandler.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.SmartCards;
00015
00016 using Pcsc;
00017
00018 namespace Desfire
00019 {
00020     /// <summary>
00021     /// Access handler class for Desfire based ICC. It provides wrappers for different Desfire
00022     /// commands
00023     /// </summary>
00024     public class AccessHandler
00025     {
00026         /// <summary>
00027         /// connection object to smart card
00028         /// </summary>
00029         private SmartCardConnection connectionObject { set; get; }
00030         /// <summary>
00031         /// Desfire command APDU
00032         /// </summary>
00033         private DesfireCommand desfireCommand { set; get; }
00034         /// <summary>
00035         /// Desfire response APDU
00036         /// </summary>
00037         private DesfireResponse desfireResponse { set; get; }
00038         /// <summary>
00039         /// Class constructor
00040         /// </summary>
00041         /// <param name="ScConnection">
00042         /// connection object to a Desfire ICC
00043         /// </param>
00044         public AccessHandler(SmartCardConnection ScConnection)
00045         {
00046             connectionObject = ScConnection;
00047
00048             desfireCommand = new DesfireCommand();
00049         }
00050         /// <summary>
00051         /// Read card details commands
00052         /// </summary>
00053         /// <returns>
00054         /// returns Desfire CardDetails object
00055         /// </returns>
00056         public async Task<CardDetails> ReadCardDetailsAsync()
00057         {
00058             desfireCommand.Command = (byte) DesfireCommand.CommandType.GetVersion;
00059             desfireCommand.Data = null;
00060
00061             DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00062
00063             if (!desfireRes.SubsequentFrame || desfireRes.ResponseData.Length != 7)
00064             {
00065                 return null;
00066             }
00067
00068             CardDetails card = new CardDetails();
00069
00070             card.HardwareVendorID = desfireRes.ResponseData[0];
00071             card.HardwareType = desfireRes.ResponseData[1];
00072             card.HardwareSubType = desfireRes.ResponseData[2];
00073             card.HardwareMajorVersion = desfireRes.ResponseData[3];
00074             card.HardwareMinorVersion = desfireRes.ResponseData[4];
00075             card.HardwareStorageSize = desfireRes.ResponseData[5];
00076             card.HardwareProtocolType = desfireRes.ResponseData[6];
00077
00078             desfireCommand.Command = (byte)DesfireCommand.CommandType.GetAdditionalFrame;
00079             desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00080
00081             if (!desfireRes.SubsequentFrame || desfireRes.ResponseData.Length != 7)
00082             {
00083                 // Not expected
00084                 return null;
00085             }
00086             card.SoftwareVendorID = desfireRes.ResponseData[0];
00087             card.SoftwareType = desfireRes.ResponseData[1];
00088             card.SoftwareSubType = desfireRes.ResponseData[2];
00089             card.SoftwareMajorVersion = desfireRes.ResponseData[3];
00090             card.SoftwareMinorVersion = desfireRes.ResponseData[4];
00091             card.SoftwareStorageSize = desfireRes.ResponseData[5];
00092             card.SoftwareProtocolType = desfireRes.ResponseData[6];
00093
00094             desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00095
00096             if (!desfireRes.Succeeded || desfireRes.ResponseData.Length != 14)
00097             {
00098                 // Not expected
00099                 return null;
00100             }
00101
00102             card.UID = new byte[7];
00103             System.Buffer.BlockCopy(desfireRes.ResponseData, 0, card.UID, 0, 7);
00104
00105             card.ProductionBatchNumber = new byte[5];
00106             System.Buffer.BlockCopy(desfireRes.ResponseData, 7, card.ProductionBatchNumber, 0, 5);
00107
00108             card.WeekOfProduction = desfireRes.ResponseData[12];
00109             card.YearOfProduction = desfireRes.ResponseData[13];
00110
00111             return card;
00112         }
00113         /// <summary>
00114         /// Select ICC application by AID
00115         /// </summary>
00116         /// <param name="aid">
00117         /// application id
00118         /// </param>
00119         public async Task SelectApplicationAsync(byte[] aid)
00120         {
00121             if (aid.Length != 3)
00122             {
00123                 throw new NotSupportedException();
00124             }
00125
00126             desfireCommand.Command = (byte)DesfireCommand.CommandType.SelectApplication;
00127             desfireCommand.Data = aid;
00128
00129             DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00130
00131             if (!desfireResponse.Succeeded)
00132             {
00133                 throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
00134             }
00135         }
00136         /// <summary>
00137         /// Read data command
00138         /// </summary>
00139         /// <param name="fileNumber">
00140         /// </param>
00141         /// <param name="offset">
00142         /// </param>
00143         /// <param name="length">
00144         /// </param>
00145         /// <returns>
00146         /// byte array of read data
00147         /// </returns>
00148         public async Task<byte[]> ReadDataAsync(byte fileNumber, ulong offset, ulong length)
00149         {
00150             var args = new byte[7];
00151             args[0] = fileNumber;
00152             args[1] = (byte)(offset & 0xFF);
00153             args[2] = (byte)((offset >> 8) & 0xFF);
00154             args[3] = (byte)((offset >> 16) & 0xFF);
00155             args[4] = (byte)(length & 0xFF);
00156             args[5] = (byte)((length >> 8) & 0xFF);
00157             args[6] = (byte)((length >> 16) & 0xFF);
00158
00159             desfireCommand.Command = (byte)DesfireCommand.CommandType.ReadData;
00160             desfireCommand.Data = args;
00161
00162             DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00163
00164             if (!desfireRes.Succeeded)
00165             {
00166                 throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
00167             }
00168
00169             return desfireRes.ResponseData;
00170         }
00171         /// <summary>
00172         /// Read record comand
00173         /// </summary>
00174         /// <param name="fileNumber"></param>
00175         /// <param name="offset"></param>
00176         /// <param name="numberOfRecords"></param>
00177         /// <returns>
00178         /// byte array of read data
00179         /// </returns>
00180         public async Task<byte[]> ReadRecordAsync(byte fileNumber, ulong offset, ulong numberOfRecords)
00181         {
00182             var args = new byte[7];
00183             args[0] = fileNumber;
00184             args[1] = (byte)(offset & 0xFF);
00185             args[2] = (byte)((offset >> 8) & 0xFF);
00186             args[3] = (byte)((offset >> 16) & 0xFF);
00187             args[4] = (byte)(numberOfRecords & 0xFF);
00188             args[5] = (byte)((numberOfRecords >> 8) & 0xFF);
00189             args[6] = (byte)((numberOfRecords >> 16) & 0xFF);
00190
00191             desfireCommand.Command = (byte)DesfireCommand.CommandType.ReadRecord;
00192             desfireCommand.Data = args;
00193
00194             DesfireResponse desfireRes = await connectionObject.TransceiveAsync(desfireCommand) as DesfireResponse;
00195
00196             if (desfireRes.BoundaryError)
00197             {
00198                 // Boundary error, the record doesn't exist
00199                 return null;
00200             }
00201             if (!desfireRes.Succeeded)
00202             {
00203                 throw new Exception("Failure selecting application, SW=" + desfireResponse.SW + " (" + desfireResponse.SWTranslation + ")");
00204             }
00205
00206             return desfireRes.ResponseData;
00207         }
00208     }
00209     /// <summary>
00210     /// Class hodls Desfire card details information
00211     /// </summary>
00212     public class CardDetails
00213     {
00214         public byte HardwareVendorID { get; set; }
00215         public byte HardwareType { get; set; }
00216         public byte HardwareSubType { get; set; }
00217         public byte HardwareMajorVersion { get; set; }
00218         public byte HardwareMinorVersion { get; set; }
00219         public byte HardwareStorageSize { get; set; }
00220         public byte HardwareProtocolType { get; set; }
00221         public byte SoftwareVendorID { get; set; }
00222         public byte SoftwareType { get; set; }
00223         public byte SoftwareSubType { get; set; }
00224         public byte SoftwareMajorVersion { get; set; }
00225         public byte SoftwareMinorVersion { get; set; }
00226         public byte SoftwareStorageSize { get; set; }
00227         public byte SoftwareProtocolType { get; set; }
00228         // 7 bytes
00229         public byte[] UID { get; set; }
00230         // 5 bytes
00231         public byte[] ProductionBatchNumber { get; set; }
00232         public byte WeekOfProduction { get; set; }
00233         public byte YearOfProduction { get; set; }
00234         public override string ToString()
00235         {
00236             return
00237                 "HardwareVendorID = " + HardwareVendorID.ToString() + Environment.NewLine +
00238                 "HardwareType = " + HardwareType.ToString() + Environment.NewLine +
00239                 "HardwareSubType = " + HardwareSubType.ToString() + Environment.NewLine +
00240                 "HardwareMajorVersion = " + HardwareMajorVersion.ToString() + Environment.NewLine +
00241                 "HardwareMinorVersion = " + HardwareMinorVersion.ToString() + Environment.NewLine +
00242                 "HardwareStorageSize = " + HardwareStorageSize.ToString() + Environment.NewLine +
00243                 "HardwareProtocolType = " + HardwareProtocolType.ToString() + Environment.NewLine +
00244                 "SoftwareVendorID = " + SoftwareVendorID.ToString() + Environment.NewLine +
00245                 "SoftwareType = " + SoftwareType.ToString() + Environment.NewLine +
00246                 "SoftwareSubType = " + SoftwareSubType.ToString() + Environment.NewLine +
00247                 "SoftwareMajorVersion = " + SoftwareMajorVersion.ToString() + Environment.NewLine +
00248                 "SoftwareMinorVersion = " + SoftwareMinorVersion.ToString() + Environment.NewLine +
00249                 "SoftwareStorageSize = " + SoftwareStorageSize.ToString() + Environment.NewLine +
00250                 "SoftwareProtocolType = " + SoftwareProtocolType.ToString() + Environment.NewLine +
00251                 "UID = " + BitConverter.ToString(UID) + Environment.NewLine +
00252                 "ProductionBatchNumber = " + BitConverter.ToString(ProductionBatchNumber) + Environment.NewLine +
00253                 "WeekOfProduction = " + WeekOfProduction.ToString() + Environment.NewLine +
00254                 "YearOfProduction = " + YearOfProduction.ToString() + Environment.NewLine;
00255         }
00256     }
00257 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DirectXSample.h Source File

  • Simple3DGameDX
  • cppwinrt
  • Common

DirectXSample.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #include <math.h>
00010
00011 namespace DX
00012 {
00013     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00014     inline float ConvertDipsToPixels(float dips, float dpi)
00015     {
00016         static const float dipsPerInch = 96.0f;
00017         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00018     }
00019
00020     // Converts a length in physical pixels to a length in device-independent pixels (DIPs).
00021     inline float ConvertPixelsToDips(float pixels)
00022     {
00023         static const float dipsPerInch = 96.0f;
00024         return pixels * dipsPerInch / winrt::Windows::Graphics::Display::DisplayInformation::GetForCurrentView().LogicalDpi(); // Do not round.
00025     }
00026
00027     // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
00028     // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().
00029     inline float ConvertPixelsToDips(float pixels, float dpi)
00030     {
00031         static const float dipsPerInch = 96.0f;
00032         return pixels * dipsPerInch / dpi; // Do not round.
00033     }
00034
00035 #if defined(_DEBUG)
00036     // Check for SDK Layer support.
00037     inline bool SdkLayersAvailable()
00038     {
00039         HRESULT hr = D3D11CreateDevice(
00040             nullptr,
00041             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00042             0,
00043             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00044             nullptr,                    // Any feature level will do.
00045             0,
00046             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Store apps.
00047             nullptr,                    // No need to keep the D3D device reference.
00048             nullptr,                    // No need to know the feature level.
00049             nullptr                     // No need to keep the D3D device context reference.
00050             );
00051
00052         return SUCCEEDED(hr);
00053     }
00054 #endif
00055 }
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Program.cs Source File

  • BasicHologram
  • cs

Program.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.ApplicationModel.Core;
00003
00004 namespace BasicHologram
00005 {
00006     /// <summary>
00007     /// Windows Holographic application using SharpDX.
00008     /// </summary>
00009     internal class Program
00010     {
00011         /// <summary>
00012         /// Defines the entry point of the application.
00013         /// </summary>
00014         [MTAThread]
00015         private static void Main()
00016         {
00017             var exclusiveViewApplicationSource = new AppViewSource();
00018             CoreApplication.Run(exclusiveViewApplicationSource);
00019         }
00020     }
00021 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Default Member List

This is the complete list of members for Scenario1_Default, including all inherited members.
_cts | Scenario1_Default | [private]
_dispatcher | Scenario1_Default | [private]
_InputFile | Scenario1_Default | [private]
_OutputFile | Scenario1_Default | [private]
_OutputFileExtension | Scenario1_Default | [private]
_OutputFileName | Scenario1_Default | [private]
_OutputType | Scenario1_Default | [private]
_Profile | Scenario1_Default | [private]
_Transcoder | Scenario1_Default | [private]
DisableButtons() | Scenario1_Default | [inline, private]
DisableNonSquarePARProfiles() | Scenario1_Default | [inline, private]
Dispose() | Scenario1_Default | [inline]
EnableButtons() | Scenario1_Default | [inline, private]
EnableNonSquarePARProfiles() | Scenario1_Default | [inline, private]
GetPresetProfile(ComboBox combobox) | Scenario1_Default | [inline, private]
InputPauseButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
InputPlayButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
InputStopButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Default | [inline, protected]
OnTargetFormatChanged(object sender, SelectionChangedEventArgs e) | Scenario1_Default | [inline, private]
OutputPathText(string text) | Scenario1_Default | [inline, private]
OutputPauseButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
OutputPlayButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
OutputStopButton_Click(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
OutputText(string text) | Scenario1_Default | [inline, private]
PickFile(object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
PickOutput(object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
PlayFile(StorageFile MediaFile) | Scenario1_Default | [inline, private]
rootPage | Scenario1_Default | [private]
Scenario1_Default() | Scenario1_Default | [inline]
SetCancelButton(bool isEnabled) | Scenario1_Default | [inline, private]
SetOutputFileButton(bool isEnabled) | Scenario1_Default | [inline, private]
SetPickFileButton(bool isEnabled) | Scenario1_Default | [inline, private]
SetTranscodeButton(bool isEnabled) | Scenario1_Default | [inline, private]
StopPlayers() | Scenario1_Default | [inline, private]
TranscodeCancel(object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
TranscodeComplete() | Scenario1_Default | [inline, private]
TranscodeError(string error) | Scenario1_Default | [inline, private]
TranscodeFailure(TranscodeFailureReason reason) | Scenario1_Default | [inline, private]
TranscodePreset(Object sender, RoutedEventArgs e) | Scenario1_Default | [inline, private]
TranscodeProgress(double percent) | Scenario1_Default | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario7_LiveSeekableRange.xaml.cs Source File

  • AdaptiveStreaming
  • cs

Scenario7_LiveSeekableRange.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Helpers;
00013 using SDKTemplate.Logging;
00014 using SDKTemplate.Logging.Extensions;
00015 using System;
00016 using System.Collections.Generic;
00017 using System.Linq;
00018 using System.Threading.Tasks;
00019 using Windows.Media;
00020 using Windows.Media.Core;
00021 using Windows.Media.Playback;
00022 using Windows.Media.Streaming.Adaptive;
00023 using Windows.UI.Core;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Navigation;
00027 using Windows.Web.Http;
00028
00029 namespace SDKTemplate
00030 {
00031     /// See the README.md for discussion of this scenario.
00032
00033     public sealed partial class Scenario7_LiveSeekableRange : Page
00034     {
00035         public Scenario7_LiveSeekableRange()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         protected override void OnNavigatedFrom(NavigationEventArgs e)
00041         {
00042             // Release handles on various media objects to ensure a quick clean-up
00043             ContentSelectorControl.MediaPlaybackItem = null;
00044             var mediaPlayer = mediaPlayerElement.MediaPlayer;
00045             if (mediaPlayer != null)
00046             {
00047                 mediaPlayerLogger?.Dispose();
00048                 mediaPlayerLogger = null;
00049
00050                 UnregisterForDiscreteControls(mediaPlayer);
00051                 UnregisterForPositionUpdateControl(mediaPlayer);
00052
00053                 UnregisterHandlers(mediaPlayer);
00054
00055                 mediaPlayerElement.SetMediaPlayer(null);
00056                 mediaPlayer.Dispose();
00057             }
00058         }
00059
00060         private void UnregisterHandlers(MediaPlayer mediaPlayer)
00061         {
00062             mediaPlaybackItemLogger?.Dispose();
00063             mediaPlaybackItemLogger = null;
00064
00065             mediaSourceLogger?.Dispose();
00066             mediaSourceLogger = null;
00067
00068             adaptiveMediaSourceLogger?.Dispose();
00069             adaptiveMediaSourceLogger = null;
00070         }
00071
00072         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00073         {
00074             var mediaPlayer = new MediaPlayer();
00075
00076             // We use a helper class that logs all the events for the MediaPlayer:
00077             mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);
00078
00079             // In addition to logging, we use the callbacks to update some UI elements in this scenario:
00080             RegisterForDiscreteControls(mediaPlayer);
00081             RegisterForPositionUpdateControls(mediaPlayer);
00082
00083             // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
00084             var prHelper = new PlayReadyHelper(LoggerControl);
00085             prHelper.SetUpProtectionManager(mediaPlayer);
00086             mediaPlayerElement.SetMediaPlayer(mediaPlayer);
00087
00088             ContentSelectorControl.Initialize(
00089                 mediaPlayer,
00090                 MainPage.ContentManagementSystemStub.Where(m => !m.Aes && m.Live),
00091                 null,
00092                 LoggerControl,
00093                 LoadSourceFromUriAsync);
00094
00095             // Initialize scenario specific layout:
00096             ContentSelectorControl.SetAutoPlay(true);
00097             mediaPlayerElement.AreTransportControlsEnabled = false;
00098             LoggerControl.Height = 200;
00099         }
00100
00101         #region Content Loading
00102
00103         private async Task<MediaPlaybackItem> LoadSourceFromUriAsync(Uri uri, HttpClient httpClient = null)
00104         {
00105             UnregisterHandlers(mediaPlayerElement.MediaPlayer);
00106
00107             AdaptiveMediaSourceCreationResult result = null;
00108             if (httpClient != null)
00109             {
00110                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
00111             }
00112             else
00113             {
00114                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
00115             }
00116
00117             MediaSource source;
00118             if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
00119             {
00120                 var adaptiveMediaSource = result.MediaSource;
00121
00122                 // We use a helper class that logs all the events for the AdaptiveMediaSource:
00123                 adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);
00124
00125                 source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);
00126
00127                 if (adaptiveMediaSource.MaxSeekableWindowSize.HasValue)
00128                 {
00129                     UpdateSeekableWindowControls(adaptiveMediaSource);
00130                 }
00131             }
00132             else
00133             {
00134                 Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
00135                 return null;
00136             }
00137
00138             // We use a helper class that logs all the events for the MediaSource:
00139             mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);
00140
00141             // Save the original Uri.
00142             source.CustomProperties["uri"] = uri.ToString();
00143
00144             // You're likely to put a content tracking id into the CustomProperties.
00145             source.CustomProperties["contentId"] = Guid.NewGuid().ToString();
00146
00147             var mpItem = new MediaPlaybackItem(source);
00148
00149             // We use a helper class that logs all the events for the MediaPlaybackItem:
00150             mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);
00151
00152             HideDescriptionOnSmallScreen();
00153
00154             return mpItem;
00155         }
00156
00157         private async void HideDescriptionOnSmallScreen()
00158         {
00159             // On small screens, hide the description text to make room for the video.
00160             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00161             {
00162                 DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
00163             });
00164         }
00165         #endregion
00166
00167         #region CustomMediaControl
00168
00169         #region SeekableWindowControls
00170
00171         private void DesiredSeekableWindowSizeButton_Click(object sender, RoutedEventArgs e)
00172         {
00173             var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
00174             if (adaptiveMediaSource == null)
00175                 return;
00176             TimeSpan result = adaptiveMediaSource.DesiredSeekableWindowSize.GetValueOrDefault();
00177             if (TimeSpan.TryParse(DesiredSeekableWindowSize.Text, out result))
00178             {
00179                 adaptiveMediaSource.DesiredSeekableWindowSize = result;
00180             }
00181             UpdateSeekableWindowControls();
00182         }
00183
00184         private void DesiredLiveOffsetButton_Click(object sender, RoutedEventArgs e)
00185         {
00186             var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
00187             if (adaptiveMediaSource == null)
00188                 return;
00189             TimeSpan result = adaptiveMediaSource.DesiredLiveOffset;
00190             if (TimeSpan.TryParse(DesiredLiveOffset.Text, out result))
00191             {
00192                 adaptiveMediaSource.DesiredLiveOffset = result;
00193             }
00194             UpdateSeekableWindowControls();
00195         }
00196
00197         private void UpdateSeekableWindowControls()
00198         {
00199             var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
00200             UpdateSeekableWindowControls(adaptiveMediaSource);
00201         }
00202
00203         private void UpdateSeekableWindowControls(AdaptiveMediaSource adaptiveMediaSource)
00204         {
00205             if (adaptiveMediaSource == null)
00206                 return;
00207
00208             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00209             {
00210                 MaxSeekableWindowSize.Text = adaptiveMediaSource.MaxSeekableWindowSize.HasValue ? $"{adaptiveMediaSource.MaxSeekableWindowSize.Value.ToString("c")}" : "";
00211                 DesiredSeekableWindowSize.Text = adaptiveMediaSource.DesiredSeekableWindowSize.HasValue ? $"{adaptiveMediaSource.DesiredSeekableWindowSize.Value.ToString("c")}" : "";
00212                 DesiredLiveOffset.Text = $"{adaptiveMediaSource.DesiredLiveOffset.ToString("c")}";
00213                 MinLiveOffset.Text = adaptiveMediaSource.MinLiveOffset.HasValue ? $"{adaptiveMediaSource.MinLiveOffset.Value.ToString("c")}" : "";
00214             });
00215         }
00216
00217         #endregion
00218
00219         #region PositionUpdateControl
00220
00221         double m_SliderFullScale = 100000.0; // Sets granularity of slider
00222
00223         TimeSpan m_PlaybackPositionMaxTime = TimeSpan.FromHours(1);
00224         TimeSpan m_PlaybackPositionMinTime= TimeSpan.Zero;
00225
00226         private void RegisterForPositionUpdateControls(MediaPlayer mp)
00227         {
00228             // Setup slider
00229             PositionSlider.Minimum = 0.0;
00230             PositionSlider.Maximum = m_SliderFullScale;
00231             PositionSlider.Value = 0.0;
00232
00233             // Register for events
00234             mp.SourceChanged += PositionUpdateControl_SourceChanged;
00235             mp.PlaybackSession.PositionChanged += PositionUpdateControl_PositionChanged;
00236             mp.PlaybackSession.SeekableRangesChanged += PositionUpdateControl_SeekableRangesChanged;
00237         }
00238
00239         private void PositionUpdateControl_SourceChanged(MediaPlayer sender, object args)
00240         {
00241             m_PlaybackPositionMaxTime = TimeSpan.FromHours(1);
00242             m_PlaybackPositionMinTime = TimeSpan.Zero;
00243         }
00244
00245         private void UnregisterForPositionUpdateControl(MediaPlayer mp)
00246         {
00247             mp.SourceChanged -= PositionUpdateControl_SourceChanged;
00248             mp.PlaybackSession.PositionChanged -= PositionUpdateControl_PositionChanged;
00249             mp.PlaybackSession.SeekableRangesChanged -= PositionUpdateControl_SeekableRangesChanged;
00250         }
00251
00252         private void PositionUpdateControl_SeekableRangesChanged(MediaPlaybackSession sender, object args)
00253         {
00254             var seekableRanges = sender.GetSeekableRanges();
00255             UpdateSeekableRangesControl(seekableRanges);
00256         }
00257
00258         private void UpdateSeekableRangesControl(IReadOnlyList<MediaTimeRange> SeekableRanges)
00259         {
00260             if (SeekableRanges.Count > 0)
00261             {
00262                 var SeekableRangeMin = SeekableRanges.First();
00263                 m_PlaybackPositionMinTime = SeekableRangeMin.Start;
00264
00265                 var SeekableRangeMax = SeekableRanges.Last();
00266                 m_PlaybackPositionMaxTime = SeekableRangeMax.End;
00267             }
00268             else
00269             {
00270                 m_PlaybackPositionMaxTime = TimeSpan.FromHours(1);
00271                 m_PlaybackPositionMinTime = TimeSpan.Zero;
00272             }
00273
00274             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00275             {
00276                 StartPosition.Text = m_PlaybackPositionMinTime.ToString("c");
00277                 EndPosition.Text = m_PlaybackPositionMaxTime.ToString("c");
00278             });
00279
00280             string ranges = "";
00281             foreach (var range in SeekableRanges)
00282             {
00283                 ranges += $"[{range.Start},{range.End}],";
00284             }
00285             ranges = ranges.TrimEnd(',');
00286             Log($"MediaPlayer_PlaybackSession_SeekableRangesChanged: {ranges}");
00287         }
00288
00289         private async void PositionUpdateControl_PositionChanged(MediaPlaybackSession sender, object args)
00290         {
00291             var postion = sender.Position;
00292             var newSliderValue = GetSliderPositionAtPlaybackPosition(postion, m_SliderFullScale, m_PlaybackPositionMinTime, m_PlaybackPositionMaxTime);
00293             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00294             {
00295                 CurrentPosition.Text = postion.ToString("c");
00296                 PositionSlider.Value = newSliderValue;
00297             });
00298         }
00299
00300         #region PositionSlider events
00301
00302         private void SeekToRequestedPosition(TimeSpan requestedPosition)
00303         {
00304             Log($"Seeking to:{requestedPosition.ToString("c")}");
00305             mediaPlayerElement.MediaPlayer.PlaybackSession.Position = requestedPosition;
00306         }
00307
00308         #endregion
00309
00310         /// <summary>
00311         /// We will use slider ticks to drive a playback Position.
00312         ///
00313         /// This is a linear interpolation, so:
00314         /// y = m*x + b
00315         /// Where:
00316         /// Position = m*sliderPosition + b
00317         ///
00318         /// Where we have some data points:
00319         ///
00320         /// At MinPosition, we are at slider position=0
00321         /// MinPosition = m * 0 + b
00322         /// Thus:
00323         ///   b = MinPosition
00324         ///
00325         /// We choose a 100000 tick granularity for the slider,
00326         /// at which point it will be at MaxPosition:
00327         /// MaxPosition = m * 100000 + b
00328         /// MaxPosition = m * 100000 + MinPosition
00329         ///
00330         /// Thus:
00331         ///   m = (MaxPosition - MinPosition) / 100000
00332         ///   m = (MaxPosition - MinPosition) / sliderFullScale
00333         ///
00334         /// And more generally, we have:
00335         ///
00336         /// PlaybackPosition =  [(MaxPosition - MinPosition) / sliderFullScale] * SliderPosition + MinPosition
00337         /// or:
00338         /// PlaybackPosition =  ((MaxPosition - MinPosition) * SliderPosition / sliderFullScale)   + MinPosition
00339         ///
00340         /// </summary>
00341         public TimeSpan GetPlaybackPosition(double sliderPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition)
00342         {
00343             if (sliderFullScale == 0)
00344                 return TimeSpan.Zero;
00345             return TimeSpan.FromTicks((long)((MaxPosition - MinPosition).Ticks * sliderPosition / sliderFullScale) + MinPosition.Ticks);
00346         }
00347
00348         /// <summary>
00349         /// Given:
00350         /// y = m * x + b
00351         /// x = (y - b) /m
00352         ///
00353         /// Where from above:
00354         ///  b = MinPosition
00355         ///  m = (MaxPosition - MinPosition) / sliderFullScale
00356         ///
00357         /// We have:
00358         ///  Position = (PlaybackPosition - MinPosition) * sliderFullScale / (MaxPosition - MinPosition)
00359         ///
00360         /// </summary>
00361         public double GetSliderPositionAtPlaybackPosition(TimeSpan playbackPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition)
00362         {
00363             if ((MaxPosition - MinPosition).Ticks == 0)
00364                 return 0;
00365
00366             if (playbackPosition == TimeSpan.Zero)
00367             {
00368                 LoggerControl.Log("Transient playbackPosition == TimeSpan.Zero", LogViewLoggingLevel.Error);
00369             }
00370
00371             var interpolatedPosition = (playbackPosition - MinPosition).Ticks * sliderFullScale / (MaxPosition - MinPosition).Ticks;
00372
00373             if (interpolatedPosition < 0)
00374             {
00375                 interpolatedPosition = 0;
00376                 LoggerControl.Log("Transient calculatedPosition < 0", LogViewLoggingLevel.Error);
00377             }
00378
00379             return interpolatedPosition;
00380         }
00381
00382         #endregion
00383
00384
00385         #region DiscreteControls
00386
00387         private void SeekFixedAmount_Click(object sender, RoutedEventArgs e)
00388         {
00389             TimeSpan amount = TimeSpan.Zero;
00390             string selected = (sender as Button).Tag.ToString();
00391             TimeSpan.TryParse(selected, out amount);
00392             if (amount != TimeSpan.Zero)
00393             {
00394                 var requestedPosition = mediaPlayerElement.MediaPlayer.PlaybackSession.Position + amount;
00395                 SeekToRequestedPosition(requestedPosition);
00396             }
00397         }
00398
00399         private void Play_Click(object sender, RoutedEventArgs e)
00400         {
00401           if(mediaPlayerElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
00402             {
00403                 mediaPlayerElement.MediaPlayer.Play();
00404             }
00405         }
00406
00407         private void Pause_Click(object sender, RoutedEventArgs e)
00408         {
00409             if (mediaPlayerElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00410             {
00411                 mediaPlayerElement.MediaPlayer.Pause();
00412             }
00413         }
00414
00415         private void GoToStart_Click(object sender, RoutedEventArgs e)
00416         {
00417             if (mediaPlayerElement.MediaPlayer != null)
00418             {
00419                 var seekableRanges = mediaPlayerElement.MediaPlayer.PlaybackSession.GetSeekableRanges();
00420                 if (seekableRanges.Count > 0)
00421                 {
00422                     UpdateSeekableRangesControl(seekableRanges);
00423                     var requestedPosition = seekableRanges[0].Start;
00424                     SeekToRequestedPosition(requestedPosition);
00425                 }
00426             }
00427         }
00428
00429         private void GoToLive_Click(object sender, RoutedEventArgs e)
00430         {
00431             if (mediaPlayerElement.MediaPlayer != null)
00432             {
00433                 var seekableRanges = mediaPlayerElement.MediaPlayer.PlaybackSession.GetSeekableRanges();
00434                 if (seekableRanges.Count > 0)
00435                 {
00436                     UpdateSeekableRangesControl(seekableRanges);
00437                     var requestedPosition = seekableRanges[seekableRanges.Count-1].End;
00438                     SeekToRequestedPosition(requestedPosition);
00439                 }
00440             }
00441         }
00442
00443         private void RegisterForDiscreteControls(MediaPlayer mediaPlayer)
00444         {
00445             // PlaybackSession Events
00446             mediaPlayer.PlaybackSession.PlaybackStateChanged += MediaPlayer_PlaybackSession_PlaybackStateChanged;
00447         }
00448
00449         private void UnregisterForDiscreteControls(MediaPlayer mediaPlayer)
00450         {
00451             if (mediaPlayer == null)
00452             {
00453                 return;
00454             }
00455
00456             // PlaybackSession Events
00457             mediaPlayer.PlaybackSession.PlaybackStateChanged -= MediaPlayer_PlaybackSession_PlaybackStateChanged;
00458         }
00459
00460         private async void MediaPlayer_PlaybackSession_PlaybackStateChanged(MediaPlaybackSession sender, object args)
00461         {
00462             Log($"PlaybackSession_PlaybackStateChanged, PlaybackState: {sender.PlaybackState}");
00463
00464             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00465             {
00466                 switch (sender.PlaybackState)
00467                 {
00468                     case MediaPlaybackState.None:
00469                     case MediaPlaybackState.Opening:
00470                     case MediaPlaybackState.Buffering:
00471                         PlayButton.IsEnabled = false;
00472                         PauseButton.IsEnabled = false;
00473                         break;
00474                     case MediaPlaybackState.Playing:
00475                         PlayButton.IsEnabled = false;
00476                         PauseButton.IsEnabled = true;
00477                         break;
00478                     case MediaPlaybackState.Paused:
00479                         PlayButton.IsEnabled = true;
00480                         PauseButton.IsEnabled = false;
00481                         break;
00482                     default:
00483                         break;
00484                 }
00485             });
00486         }
00487
00488         private void LogCurrentTimeCorrelation_Click(object sender, RoutedEventArgs e)
00489         {
00490             var adaptiveMediaSource = (mediaPlayerElement.MediaPlayer.Source as MediaPlaybackItem)?.Source?.AdaptiveMediaSource;
00491             if (adaptiveMediaSource == null)
00492                 return;
00493             var times = adaptiveMediaSource.GetCorrelatedTimes();
00494             Log(times.ToJsonObject().ToString());
00495         }
00496         #endregion
00497
00498         #endregion // CustomMediaControl
00499
00500         #region Utilities
00501         private void Log(string message)
00502         {
00503             LoggerControl.Log(message);
00504         }
00505         MediaPlayerLogger mediaPlayerLogger;
00506         MediaSourceLogger mediaSourceLogger;
00507         MediaPlaybackItemLogger mediaPlaybackItemLogger;
00508         AdaptiveMediaSourceLogger adaptiveMediaSourceLogger;
00509         #endregion
00510
00511     }
00512
00513 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EmployeeCollection Member List

This is the complete list of members for EmployeeCollection, including all inherited members.
Add(IEmployee item) | EmployeeCollection | [inline]
Add(object item) | EmployeeCollection | [inline, private]
Add(IEmployee item) | EmployeeCollection | [inline]
Add(object item) | EmployeeCollection | [inline, private]
Clear() | EmployeeCollection | [inline]
Clear() | EmployeeCollection | [inline, private]
Clear() | EmployeeCollection | [inline]
Clear() | EmployeeCollection | [inline, private]
CollectionChanged | EmployeeCollection |
Contains(IEmployee item) | EmployeeCollection | [inline]
Contains(object item) | EmployeeCollection | [inline, private]
Contains(IEmployee item) | EmployeeCollection | [inline]
Contains(object item) | EmployeeCollection | [inline, private]
CopyTo(IEmployee[] array, int arrayIndex) | EmployeeCollection | [inline]
CopyTo(Array array, int index) | EmployeeCollection | [inline, private]
CopyTo(IEmployee[] array, int arrayIndex) | EmployeeCollection | [inline]
CopyTo(Array array, int index) | EmployeeCollection | [inline, private]
Count | EmployeeCollection |
Count | EmployeeCollection | [private]
data | EmployeeCollection | [private]
Data_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) | EmployeeCollection | [inline, private]
Data_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) | EmployeeCollection | [inline, private]
EmployeeCollection() | EmployeeCollection | [inline]
EmployeeCollection() | EmployeeCollection | [inline]
GetEnumerator() | EmployeeCollection | [inline]
GetEnumerator() | EmployeeCollection | [inline, private]
GetEnumerator() | EmployeeCollection | [inline]
GetEnumerator() | EmployeeCollection | [inline, private]
IndexOf(IEmployee item) | EmployeeCollection | [inline]
IndexOf(object item) | EmployeeCollection | [inline, private]
IndexOf(IEmployee item) | EmployeeCollection | [inline]
IndexOf(object item) | EmployeeCollection | [inline, private]
Insert(int index, IEmployee item) | EmployeeCollection | [inline]
Insert(int index, object item) | EmployeeCollection | [inline, private]
Insert(int index, IEmployee item) | EmployeeCollection | [inline]
Insert(int index, object item) | EmployeeCollection | [inline, private]
IsFixedSize | EmployeeCollection | [private]
IsReadOnly | EmployeeCollection |
IsReadOnly | EmployeeCollection | [private]
IsSynchronized | EmployeeCollection | [private]
Remove(IEmployee item) | EmployeeCollection | [inline]
Remove(object item) | EmployeeCollection | [inline, private]
Remove(IEmployee item) | EmployeeCollection | [inline]
Remove(object item) | EmployeeCollection | [inline, private]
RemoveAt(int index) | EmployeeCollection | [inline]
RemoveAt(int index) | EmployeeCollection | [inline, private]
RemoveAt(int index) | EmployeeCollection | [inline]
RemoveAt(int index) | EmployeeCollection | [inline, private]
SyncRoot | EmployeeCollection | [private]
this | EmployeeCollection |
this | EmployeeCollection | [private]
VectorChanged | EmployeeCollection |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/LowLatencyInputMain.cpp Source File

  • LowLatencyInput
  • cpp

LowLatencyInputMain.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "LowLatencyInputMain.h"
00014 #include "Common\DirectXHelper.h"
00015 #include "Content\RectRenderer.h"
00016
00017 using namespace SDKTemplate;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::System::Threading;
00020 using namespace Concurrency;
00021
00022 // Loads and initializes application assets when the application is loaded.
00023 LowLatencyInputMain::LowLatencyInputMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00024     deviceResources(deviceResources)
00025 {
00026     // Register to be notified if the Device is lost or recreated
00027     deviceResources->RegisterDeviceNotify(this);
00028
00029     sceneRenderer = std::unique_ptr<RectRenderer>(new RectRenderer(deviceResources));
00030 }
00031
00032 LowLatencyInputMain::~LowLatencyInputMain()
00033 {
00034     // Deregister device notification
00035     deviceResources->RegisterDeviceNotify(nullptr);
00036 }
00037
00038 void LowLatencyInputMain::StartRenderLoop()
00039 {
00040     // If the animation render loop is already running then do not start another thread.
00041     if (renderLoopWorker != nullptr && renderLoopWorker->Status == AsyncStatus::Started)
00042     {
00043         return;
00044     }
00045
00046     // Create a task that will be run on a background thread.
00047     auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^ action)
00048     {
00049         // Calculate the updated frame and render once per vertical blanking interval.
00050         while (action->Status == AsyncStatus::Started)
00051         {
00052             critical_section::scoped_lock lock(criticalSection);
00053
00054             // Block this thread until the swap chain is finished presenting. Note that it is
00055             // important to call this before the first Present in order to minimize the latency
00056             // of the swap chain
00057             deviceResources->WaitOnSwapChain();
00058             Render();
00059             deviceResources->Present();
00060         }
00061     });
00062
00063     // Run task on a dedicated high priority background thread.
00064     renderLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
00065 }
00066
00067 void LowLatencyInputMain::StopRenderLoop()
00068 {
00069     renderLoopWorker->Cancel();
00070 }
00071
00072 // Renders the current frame according to the current application state.
00073 void LowLatencyInputMain::Render()
00074 {
00075     auto context = deviceResources->GetD3DDeviceContext();
00076
00077     // Reset the viewport to target the whole screen.
00078     auto viewport = deviceResources->GetScreenViewport();
00079     context->RSSetViewports(1, &viewport);
00080
00081     // Reset render targets to the screen.
00082     ID3D11RenderTargetView *const targets[1] = { deviceResources->GetBackBufferRenderTargetView() };
00083     context->OMSetRenderTargets(1, targets, deviceResources->GetDepthStencilView());
00084
00085     // Clear the back buffer and depth stencil view.
00086     context->ClearRenderTargetView(deviceResources->GetBackBufferRenderTargetView(), DirectX::Colors::Black);
00087     context->ClearDepthStencilView(deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00088
00089     // Render the scene objects.
00090     sceneRenderer->Render();
00091 }
00092
00093 // Notifies renderers that device resources need to be released.
00094 void LowLatencyInputMain::OnDeviceLost()
00095 {
00096     sceneRenderer->ReleaseDeviceDependentResources();
00097 }
00098
00099 // Notifies renderers that device resources may now be recreated.
00100 void LowLatencyInputMain::OnDeviceRestored()
00101 {
00102     sceneRenderer->CreateDeviceDependentResources();
00103 }
00104
00105 //Passes rect data to renderer class to transform rect
00106 void LowLatencyInputMain::UpdateRectTransform(Point newPosition, Windows::UI::Input::ManipulationDelta delta)
00107 {
00108     sceneRenderer->UpdateRectTransform(newPosition, delta);
00109 }
00110
00111 //Returns whether the pointer event was within the bounds of the rect
00112 bool LowLatencyInputMain::HitTest( Windows::Foundation::Point position)
00113 {
00114     return sceneRenderer->HitTest(position);
00115 }
00116
00117 void LowLatencyInputMain::SetRectSize(float newSize)
00118 {
00119     sceneRenderer->SetRectSize(newSize);
00120 }
00121
00122 void LowLatencyInputMain::ResetRect()
00123 {
00124     sceneRenderer->ResetRect();
00125 }
00126
00127 void LowLatencyInputMain::SetBrushColor(D2D1::ColorF color)
00128 {
00129     sceneRenderer->SetBrushColor(color);
00130 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HolographicPaintMain.cpp Source File

  • SpatialInteractionSource
  • cpp

HolographicPaintMain.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "HolographicPaintMain.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 #include <windows.graphics.directx.direct3d11.interop.h>
00006 #include <Collection.h>
00007
00008 using namespace HolographicPaint;
00009
00010 using namespace concurrency;
00011 using namespace Platform;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Numerics;
00014 using namespace Windows::Graphics::Holographic;
00015 using namespace Windows::Perception;
00016 using namespace Windows::Perception::People;
00017 using namespace Windows::Perception::Spatial;
00018 using namespace Windows::UI::Input::Spatial;
00019 using namespace std::placeholders;
00020 using namespace DirectX;
00021
00022 // Loads and initializes application assets when the application is loaded.
00023 HolographicPaintMain::HolographicPaintMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00024     m_deviceResources(deviceResources)
00025 {
00026     // Register to be notified if the device is lost or recreated.
00027     m_deviceResources->RegisterDeviceNotify(this);
00028
00029     // Create a 6m x 2m whiteboard in front of the (initial position of the) user
00030     m_whiteboard = std::make_shared<Whiteboard>(6.0f, 2.0f, float3(0.0f, 0.0f, -3.0f));
00031
00032 }
00033
00034 void HolographicPaintMain::SetHolographicSpace(HolographicSpace^ holographicSpace)
00035 {
00036     UnregisterHolographicEventHandlers();
00037
00038     m_holographicSpace = holographicSpace;
00039
00040     // Initialize the rendering helper
00041     m_renderingHelper = std::make_unique<RenderingHelper>(m_deviceResources);
00042
00043     m_spatialInteractionManager = SpatialInteractionManager::GetForCurrentView();
00044     // Handle source detectionand loss by adding wrappers which will transform low level interactions into application-level commands
00045     m_sourceDetectedToken =
00046         m_spatialInteractionManager->SourceDetected +=
00047             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00048                 std::bind(&HolographicPaintMain::OnSourceDetected, this, _1, _2));
00049     m_sourceLostToken =
00050         m_spatialInteractionManager->SourceLost +=
00051             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00052                 std::bind(&HolographicPaintMain::OnSourceLost, this, _1, _2));
00053
00054     // SourcePressed is raised when a button is pressed (or in case of Air Tap for Hand) and we will transmit this event to the corresponding source wrapper
00055     // to take actions such as opening the tool selection carousel or validating a tool
00056     m_sourcePressedToken =
00057         m_spatialInteractionManager->SourcePressed +=
00058             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00059                 std::bind(&HolographicPaintMain::OnSourcePressed, this, _1, _2));
00060
00061     // Source Updated is raised when the input state or the location of a source changes. The main usage is to display the too associated to a controller
00062     // at the right position
00063     m_sourceUpdatedToken =
00064         m_spatialInteractionManager->SourceUpdated +=
00065             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00066                 std::bind(&HolographicPaintMain::OnSourceUpdated, this, _1, _2));
00067
00068     // Interaction detected is raised when the select button is pressed which will allow to delegate gesture recognition to a SpatialGestureRecognizer
00069     m_interactionDetectedToken =
00070         m_spatialInteractionManager->InteractionDetected +=
00071             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionDetectedEventArgs^>(
00072             std::bind(&HolographicPaintMain::OnInteractionDetected, this, _1, _2));
00073
00074     // Use the default SpatialLocator to track the motion of the device.
00075     m_locator = SpatialLocator::GetDefault();
00076
00077     // Be able to respond to changes in the positional tracking state.
00078     m_locatabilityChangedToken =
00079         m_locator->LocatabilityChanged +=
00080             ref new Windows::Foundation::TypedEventHandler<SpatialLocator^, Object^>(
00081                 std::bind(&HolographicPaintMain::OnLocatabilityChanged, this, _1, _2));
00082
00083     // Respond to camera added events by creating any resources that are specific
00084     // to that camera, such as the back buffer render target view.
00085     // When we add an event handler for CameraAdded, the API layer will avoid putting
00086     // the new camera in new HolographicFrames until we complete the deferral we created
00087     // for that handler, or return from the handler without creating a deferral. This
00088     // allows the app to take more than one frame to finish creating resources and
00089     // loading assets for the new holographic camera.
00090     // This function should be registered before the app creates any HolographicFrames.
00091     m_cameraAddedToken =
00092         m_holographicSpace->CameraAdded +=
00093             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraAddedEventArgs^>(
00094                 std::bind(&HolographicPaintMain::OnCameraAdded, this, _1, _2));
00095
00096     // Respond to camera removed events by releasing resources that were created for that
00097     // camera.
00098     // When the app receives a CameraRemoved event, it releases all references to the back
00099     // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
00100     // The app must also ensure that the back buffer is not attached as a render target, as
00101     // shown in DeviceResources::ReleaseResourcesForBackBuffer.
00102     m_cameraRemovedToken =
00103         m_holographicSpace->CameraRemoved +=
00104             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraRemovedEventArgs^>(
00105                 std::bind(&HolographicPaintMain::OnCameraRemoved, this, _1, _2));
00106
00107     // The simplest way to render world-locked holograms is to create a stationary reference frame
00108     // when the app is launched. This is roughly analogous to creating a "world" coordinate system
00109     // with the origin placed at the device's position as the app is launched.
00110     m_referenceFrame = m_locator->CreateStationaryFrameOfReferenceAtCurrentLocation();
00111
00112     // Notes on spatial tracking APIs:
00113     // * Stationary reference frames are designed to provide a best-fit position relative to the
00114     //   overall space. Individual positions within that reference frame are allowed to drift slightly
00115     //   as the device learns more about the environment.
00116     // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
00117     //   anchor the individual hologram to a position in the real world - for example, a point the user
00118     //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
00119     //   anchor will use the corrected position starting in the next frame after the correction has
00120     //   occurred.
00121
00122     // Add a few brushes variations (color and size) as well as a special tool allowing to clear the drawing
00123     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0x00, 0x00, 0xFF), .03f));
00124     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0x00, 0x00, 0xFF), .01f));
00125     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0x00, 0xFF, 0x00), .03f));
00126     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0x00, 0xFF, 0x00), .01f));
00127     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0xFF, 0x00, 0x00), .03f));
00128     m_tools.push_back(std::make_shared<Tool>(Windows::UI::ColorHelper::FromArgb(0xC0, 0xFF, 0x00, 0x00), .01f));
00129
00130     auto clearTool = std::make_shared<ClearTool>(Windows::UI::Colors::White, .06f);
00131     m_clearToolIndex = m_tools.size();
00132     m_tools.push_back(clearTool);
00133
00134 }
00135
00136 void HolographicPaintMain::UnregisterHolographicEventHandlers()
00137 {
00138     if (m_holographicSpace != nullptr)
00139     {
00140         // Clear previous event registrations.
00141
00142         if (m_cameraAddedToken.Value != 0)
00143         {
00144             m_holographicSpace->CameraAdded -= m_cameraAddedToken;
00145             m_cameraAddedToken.Value = 0;
00146         }
00147
00148         if (m_cameraRemovedToken.Value != 0)
00149         {
00150             m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
00151             m_cameraRemovedToken.Value = 0;
00152         }
00153     }
00154
00155     if (m_locator != nullptr)
00156     {
00157         m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
00158     }
00159
00160     if (m_spatialInteractionManager != nullptr)
00161     {
00162         m_spatialInteractionManager->SourceDetected -= m_sourceDetectedToken;
00163         m_spatialInteractionManager->SourceLost -= m_sourceLostToken;
00164         m_spatialInteractionManager->SourcePressed -= m_sourcePressedToken;
00165         m_spatialInteractionManager->SourceUpdated -= m_sourceUpdatedToken;
00166         m_spatialInteractionManager->InteractionDetected -= m_interactionDetectedToken;
00167     }
00168 }
00169
00170 HolographicPaintMain::~HolographicPaintMain()
00171 {
00172     // Deregister device notification.
00173     m_deviceResources->RegisterDeviceNotify(nullptr);
00174
00175     UnregisterHolographicEventHandlers();
00176 }
00177
00178 // Updates the application state once per frame.
00179 HolographicFrame^ HolographicPaintMain::Update()
00180 {
00181     // Before doing the timer update, there is some work to do per-frame
00182     // to maintain holographic rendering. First, we will get information
00183     // about the current frame.
00184
00185     // The HolographicFrame has information that the app needs in order
00186     // to update and render the current frame. The app begins each new
00187     // frame by calling CreateNextFrame.
00188     HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();
00189
00190     // Get a prediction of where holographic cameras will be when this frame
00191     // is presented.
00192     HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00193
00194     // Back buffers can change from frame to frame. Validate each buffer, and recreate
00195     // resource views and depth buffers as needed.
00196     m_deviceResources->EnsureCameraResources(holographicFrame, prediction);
00197
00198     // Next, we get a coordinate system from the attached frame of reference that is
00199     // associated with the current frame. Later, this coordinate system is used for
00200     // for creating the stereo view matrices when rendering the sample content.
00201     SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->CoordinateSystem;
00202
00203     m_timer.Tick([&]()
00204     {
00205         if (m_renderingHelper->IsLoadingComplete())
00206         {
00207             const auto context = m_deviceResources->GetD3DDeviceContext();
00208             switch (m_currentMode)
00209             {
00210             case ApplicationMode::ChooseTool:
00211                 m_toolsCarousel.Update(m_tools, m_currentToolIndex, m_timer);
00212                 for (auto& tool : m_tools)
00213                 {
00214                     tool->Update(context);
00215                 }
00216                 break;
00217             case ApplicationMode::Drawing:
00218             {
00219
00220                 for (auto& source : m_sources)
00221                 {
00222                     source->Update(context);
00223
00224                 }
00225                 m_whiteboard->Update(context);
00226                 for (auto& stroke : m_strokes)
00227                 {
00228                     stroke->Update(context);
00229                 }
00230             }
00231             break;
00232             }
00233         }
00234     });
00235
00236     // We complete the frame update by using information about our content positioning
00237     // to set the focus point.
00238
00239     for (auto cameraPose : prediction->CameraPoses)
00240     {
00241         // The HolographicCameraRenderingParameters class provides access to set
00242         // the image stabilization parameters.
00243         HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);
00244
00245         // SetFocusPoint informs the system about a specific point in your scene to
00246         // prioritize for image stabilization. The focus point is set independently
00247         // for each holographic camera.
00248         // You should set the focus point near the content that the user is looking at.
00249         // In this example, we put the focus point at the center of the sample hologram,
00250         // since that is the only hologram available for the user to focus on.
00251         // You can also set the relative velocity and facing of that content; the sample
00252         // hologram is at a fixed point so we only need to indicate its position.
00253         renderingParameters->SetFocusPoint(currentCoordinateSystem, m_focusPoint);
00254     }
00255
00256     // The holographic frame will be used to get up-to-date view and projection matrices and
00257     // to present the swap chain.
00258     return holographicFrame;
00259 }
00260
00261 // Renders the current frame to each holographic camera, according to the
00262 // current application and spatial positioning state. Returns true if the
00263 // frame was rendered to at least one camera.
00264 bool HolographicPaintMain::Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame)
00265 {
00266     // Don't try to render anything before the first Update.
00267     if (m_timer.GetFrameCount() == 0)
00268     {
00269         return false;
00270     }
00271
00272     // Lock the set of holographic camera resources, then draw to each camera
00273     // in this frame.
00274     return m_deviceResources->UseHolographicCameraResources<bool>(
00275         [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
00276     {
00277         // Up-to-date frame predictions enhance the effectiveness of image stablization and
00278         // allow more accurate positioning of holograms.
00279         holographicFrame->UpdateCurrentPrediction();
00280         HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00281
00282         bool atLeastOneCameraRendered = false;
00283         for (auto cameraPose : prediction->CameraPoses)
00284         {
00285             // This represents the device-based resources for a HolographicCamera.
00286             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00287
00288             // Get the device context.
00289             const auto context = m_deviceResources->GetD3DDeviceContext();
00290             const auto depthStencilView = pCameraResources->GetDepthStencilView();
00291             const auto blendState = pCameraResources->GetBlendState();
00292
00293             // Set render targets to the current holographic camera.
00294             ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
00295             context->OMSetRenderTargets(1, targets, depthStencilView);
00296
00297             // Set blend state
00298             context->OMSetBlendState(blendState, nullptr, 0xffffffff);
00299
00300             // Clear the back buffer and depth stencil view.
00301             context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
00302             context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00303
00304             // Notes regarding holographic content:
00305             //    * For drawing, remember that you have the potential to fill twice as many pixels
00306             //      in a stereoscopic render target as compared to a non-stereoscopic render target
00307             //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
00308             //      and only draw holograms that the user can see.
00309             //    * To help occlude hologram geometry, you can create a depth map using geometry
00310             //      data obtained via the surface mapping APIs. You can use this depth map to avoid
00311             //      rendering holograms that are intended to be hidden behind tables, walls,
00312             //      monitors, and so on.
00313             //    * Black pixels will appear transparent to the user wearing the device, but you
00314             //      should still use alpha blending to draw semitransparent holograms. You should
00315             //      also clear the screen to Transparent as shown above.
00316             //
00317
00318
00319             // The view and projection matrices for each holographic camera will change
00320             // every frame. This function refreshes the data in the constant buffer for
00321             // the holographic camera indicated by cameraPose.
00322             pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->CoordinateSystem);
00323
00324             // Attach the view/projection constant buffer for this camera to the graphics pipeline.
00325             bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);
00326
00327             // Only render world-locked content when positional tracking is active.
00328             if (cameraActive && m_renderingHelper->PrepareRendering())
00329             {
00330                 switch (m_currentMode)
00331                 {
00332                 case ApplicationMode::Drawing:
00333                     m_whiteboard->Render(context, m_renderingHelper.get());
00334
00335                     for (auto& source : m_sources)
00336                     {
00337                         source->Render(context, m_renderingHelper.get());
00338                     }
00339                     for (auto& stroke : m_strokes)
00340                     {
00341                         stroke->Render(context, m_renderingHelper.get());
00342                     }
00343                     break;
00344                 case ApplicationMode::ChooseTool:
00345                     for (auto& tool : m_tools)
00346                     {
00347                         tool->Render(context, m_renderingHelper.get());
00348                     }
00349                     break;
00350                 }
00351             }
00352             atLeastOneCameraRendered = true;
00353         }
00354
00355         return atLeastOneCameraRendered;
00356     });
00357 }
00358
00359 // Notifies classes that use Direct3D device resources that the device resources
00360 // need to be released before this method returns.
00361 void HolographicPaintMain::OnDeviceLost()
00362 {
00363     m_renderingHelper->ReleaseDeviceDependentResources();
00364 }
00365
00366 // Notifies classes that use Direct3D device resources that the device resources
00367 // may now be recreated.
00368 void HolographicPaintMain::OnDeviceRestored()
00369 {
00370     m_renderingHelper->CreateDeviceDependentResources();
00371 }
00372
00373 void HolographicPaintMain::OnLocatabilityChanged(SpatialLocator^ sender, Object^ args)
00374 {
00375     switch (sender->Locatability)
00376     {
00377     case SpatialLocatability::Unavailable:
00378         // Holograms cannot be rendered.
00379         break;
00380
00381         // In the following three cases, it is still possible to place holograms using a
00382         // SpatialLocatorAttachedFrameOfReference.
00383     case SpatialLocatability::PositionalTrackingActivating:
00384         // The system is preparing to use positional tracking.
00385
00386     case SpatialLocatability::OrientationOnly:
00387         // Positional tracking has not been activated.
00388
00389     case SpatialLocatability::PositionalTrackingInhibited:
00390         // Positional tracking is temporarily inhibited. User action may be required
00391         // in order to restore positional tracking.
00392         break;
00393
00394     case SpatialLocatability::PositionalTrackingActive:
00395         // Positional tracking is active. World-locked content can be rendered.
00396         break;
00397     }
00398 }
00399
00400 void HolographicPaintMain::OnCameraAdded(
00401     HolographicSpace^ sender,
00402     HolographicSpaceCameraAddedEventArgs^ args
00403 )
00404 {
00405     Deferral^ deferral = args->GetDeferral();
00406     HolographicCamera^ holographicCamera = args->Camera;
00407     create_task([this, deferral, holographicCamera]()
00408     {
00409         //
00410         // TODO: Allocate resources for the new camera and load any content specific to
00411         //       that camera. Note that the render target size (in pixels) is a property
00412         //       of the HolographicCamera object, and can be used to create off-screen
00413         //       render targets that match the resolution of the HolographicCamera.
00414         //
00415
00416         // Create device-based resources for the holographic camera and add it to the list of
00417         // cameras used for updates and rendering. Notes:
00418         //   * Since this function may be called at any time, the AddHolographicCamera function
00419         //     waits until it can get a lock on the set of holographic camera resources before
00420         //     adding the new camera. At 60 frames per second this wait should not take long.
00421         //   * A subsequent Update will take the back buffer from the RenderingParameters of this
00422         //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
00423         //     Content can then be rendered for the HolographicCamera.
00424         m_deviceResources->AddHolographicCamera(holographicCamera);
00425
00426         // Holographic frame predictions will not include any information about this camera until
00427         // the deferral is completed.
00428         deferral->Complete();
00429     });
00430 }
00431
00432 void HolographicPaintMain::OnCameraRemoved(
00433     HolographicSpace^ sender,
00434     HolographicSpaceCameraRemovedEventArgs^ args
00435 )
00436 {
00437     create_task([this]()
00438     {
00439         //
00440         // TODO: Asynchronously unload or deactivate content resources (not back buffer
00441         //       resources) that are specific only to the camera that was removed.
00442         //
00443     });
00444
00445     // Before letting this callback return, ensure that all references to the back buffer
00446     // are released.
00447     // Since this function may be called at any time, the RemoveHolographicCamera function
00448     // waits until it can get a lock on the set of holographic camera resources before
00449     // deallocating resources for this camera. At 60 frames per second this wait should
00450     // not take long.
00451     m_deviceResources->RemoveHolographicCamera(args->Camera);
00452 }
00453
00454 void HolographicPaintMain::OnSourceDetected(SpatialInteractionManager ^sender, SpatialInteractionSourceEventArgs ^args)
00455 {
00456     SpatialInteractionSourceState^ state = args->State;
00457     SpatialInteractionSource^ source = state->Source;
00458
00459     // We are only interested in sources which can give position:
00460     //   Hands on HoloLens
00461     //   6DOF Controllers
00462     if ((source->Kind == SpatialInteractionSourceKind::Hand)
00463         || ((source->Kind == SpatialInteractionSourceKind::Controller) && source->IsPointingSupported))
00464     {
00465         std::shared_ptr<SourceHandler> sourceHandler;
00466         auto it = m_sourceMap.find(source->Id);
00467         if (it == m_sourceMap.end())
00468         {
00469             if (SourceHandler::Make(&sourceHandler, source, this, m_whiteboard))
00470             {
00471                 sourceHandler->SetCurrentTool(m_tools[0]);
00472                 sourceHandler->SetApplicationMode(m_currentMode);
00473                 sourceHandler->OnSourceUpdated(state, m_referenceFrame->CoordinateSystem);
00474                 m_sourceMap[source->Id] = sourceHandler;
00475                 m_sources.push_back(sourceHandler);
00476             }
00477         }
00478     }
00479 }
00480
00481 void HolographicPaintMain::OnSourceLost(SpatialInteractionManager ^sender, SpatialInteractionSourceEventArgs ^args)
00482 {
00483     SpatialInteractionSourceState^ state = args->State;
00484     SpatialInteractionSource^ source = state->Source;
00485     const unsigned int sourceId = source->Id;
00486     SourceHandler* sourceHandler = nullptr;
00487
00488     {
00489         auto it = m_sourceMap.find(sourceId);
00490         if (it != m_sourceMap.end())
00491         {
00492             sourceHandler = it->second.get();
00493             m_sourceMap.erase(it);
00494         }
00495     }
00496
00497     if (sourceHandler != nullptr)
00498     {
00499         auto it = std::find_if(m_sources.begin(), m_sources.end(), [sourceHandler]
00500         (const std::shared_ptr<SourceHandler>& controller)
00501         {
00502             return controller.get() == sourceHandler;
00503         });
00504         if (it != m_sources.end())
00505         {
00506             m_sources.erase(it);
00507         }
00508
00509         if ((m_currentMode == ApplicationMode::ChooseTool) && (m_currentSourceId == sourceId))
00510         {
00511             // Hands are lost / retrieved more easily than controllers
00512             // Therefore we stay in "ChooseTool" mode if the source was Hand
00513             if (source->Kind != SpatialInteractionSourceKind::Hand)
00514             {
00515                 OnSelectTool(nullptr);
00516             }
00517         }
00518     }
00519 }
00520
00521
00522 void HolographicPaintMain::OnSourcePressed(SpatialInteractionManager ^sender, SpatialInteractionSourceEventArgs ^args)
00523 {
00524     SpatialInteractionSourceState^ state = args->State;
00525     SpatialInteractionSource^ source = state->Source;
00526     SourceHandler* sourceHandler = GetSourceHandler(source->Id);
00527     if (sourceHandler != nullptr)
00528     {
00529         sourceHandler->OnSourcePressed(args);
00530     }
00531 }
00532
00533 void HolographicPaintMain::OnSourceUpdated(SpatialInteractionManager ^sender, SpatialInteractionSourceEventArgs ^args)
00534 {
00535     SpatialInteractionSourceState^ state = args->State;
00536     SpatialInteractionSource^ source = state->Source;
00537     SourceHandler* sourceHandler = GetSourceHandler(source->Id);
00538     if (sourceHandler != nullptr)
00539     {
00540         sourceHandler->OnSourceUpdated(state, m_referenceFrame->CoordinateSystem);
00541     }
00542 }
00543
00544 void HolographicPaintMain::PositionTools(SpatialPointerPose^ pointerPose, HandAssignment side)
00545 {
00546     // Get the gaze direction relative to the given coordinate system.
00547     const float3 headPosition = pointerPose->Head->Position;
00548     const float3 headDirection(pointerPose->Head->ForwardDirection.x, 0.0, pointerPose->Head->ForwardDirection.z);
00549     const float3 headUp = pointerPose->Head->UpDirection;
00550
00551     const XMVECTOR headRightVector = XMVector3Cross(XMLoadFloat3(&headDirection), XMLoadFloat3(&headUp));
00552     float3 headRight;
00553     XMStoreFloat3(&headRight, headRightVector);
00554
00555     // If we have recognized which hand is/hold the source, we move the carousel 30 cm
00556     // to the corresponding side
00557     float3 sideOffset = float3::zero();
00558     switch (side)
00559     {
00560     case HandAssignment::LeftHand:
00561         sideOffset = -.3f * headRight;
00562         break;
00563     case HandAssignment::RightHand:
00564         sideOffset = .3f * headRight;
00565         break;
00566     }
00567
00568     XMVECTOR rotationAxisVector = XMLoadFloat3(&headUp);
00569     // Tilt carousel rotation axis PI/6 towards the user so that all tools are visible
00570     const XMMATRIX rotationAxisRotation = XMMatrixRotationAxis(headRightVector, static_cast<float>(M_PI / 6.0));
00571     rotationAxisVector = XMVector3Transform(rotationAxisVector, rotationAxisRotation);
00572     float3 rotationAxis;
00573     XMStoreFloat3(&rotationAxis, rotationAxisVector);
00574
00575     // 50 cm radius for carousel
00576     const XMMATRIX scaleMatrix = XMMatrixScaling(.5f, .5f, .5f);
00577     const XMVECTOR headVector = XMVector3Normalize(XMLoadFloat3(&headDirection));
00578     const XMVECTOR scaledHeadVector = XMVector3Transform(headVector, scaleMatrix);
00579     float3 radius;
00580     XMStoreFloat3(&radius, scaledHeadVector);
00581
00582     constexpr float distanceFromUser = 1.0f; // meters
00583     const float3 center = headPosition + sideOffset + (distanceFromUser * headDirection);
00584
00585     m_toolsCarousel.SetPosition(center, radius, rotationAxis);
00586     m_toolsCarousel.ArrangeTools(m_tools, m_currentToolIndex);
00587
00588 }
00589
00590 size_t HolographicPaintMain::FindToolIndex(unsigned int sourceId)
00591 {
00592     // Because hands are detected / lost very easily - and in particular during tool detected - they will
00593     // share the same tool selection
00594     for (auto& it : m_sources)
00595     {
00596         if (it->SourceId() == sourceId)
00597         {
00598             Tool* tool = it->GetCurrentTool();
00599             for (size_t idx = 0; idx < m_tools.size(); ++idx)
00600             {
00601                 if (m_tools[idx].get() == tool)
00602                 {
00603                     return idx;
00604                 }
00605             }
00606         }
00607     }
00608     return static_cast<size_t>(-1);
00609 }
00610
00611 void HolographicPaintMain::SetToolByIndex(unsigned int sourceId, size_t toolIndex)
00612 {
00613     if (toolIndex < m_tools.size())
00614     {
00615         // Because hands are detected / lost very easily - and in particular during tool detected - they will
00616         // share the same tool selection
00617         for (auto& it : m_sources)
00618         {
00619             if (it->SourceId() == sourceId)
00620             {
00621                 it->SetCurrentTool(m_tools[toolIndex]);
00622             }
00623         }
00624     }
00625 }
00626
00627 void HolographicPaintMain::OnInteractionDetected(SpatialInteractionManager ^sender, SpatialInteractionDetectedEventArgs ^args)
00628 {
00629     SpatialInteractionSource^ source = args->InteractionSource;
00630     SourceHandler* sourceHandler = GetSourceHandler(source->Id);
00631     if (sourceHandler != nullptr)
00632     {
00633         sourceHandler->OnInteractionDetected(args->Interaction, m_referenceFrame->CoordinateSystem);
00634     }
00635 }
00636
00637
00638 // All events are executed on the main thread, hence we do not need locks
00639 void HolographicPaintMain::OnDPadAction(SourceHandler* sender, DPadAction action)
00640 {
00641     if (ApplicationMode::ChooseTool == m_currentMode)
00642     {
00643         if (!m_toolsCarousel.IsRotating() && (sender->SourceId() == m_currentSourceId))
00644         {
00645             switch (action)
00646             {
00647             case DPadAction::Right:
00648                 m_toolsCarousel.StartRotation(RotationDirection::RotateRight, m_timer);
00649                 break;
00650             case DPadAction::Left:
00651                 m_toolsCarousel.StartRotation(RotationDirection::RotateLeft, m_timer);
00652                 break;
00653             }
00654         }
00655     }
00656 }
00657
00658 void HolographicPaintMain::OnStrokeAdded(SourceHandler* sender, std::shared_ptr<IBaseRenderedObject> stroke)
00659 {
00660     if (ApplicationMode::Drawing == m_currentMode)
00661     {
00662         m_strokes.push_back(stroke);
00663         // And set the focus point to the current position of the source
00664         m_focusPoint = sender->GetToolPosition();
00665     }
00666 }
00667
00668 void HolographicPaintMain::OnEnterToolChoice(SourceHandler* sender, PerceptionTimestamp^ timestamp)
00669 {
00670     if (ApplicationMode::Drawing == m_currentMode)
00671     {
00672         const unsigned int sourceId = sender->SourceId();
00673         SpatialPointerPose^ pointerPose = SpatialPointerPose::TryGetAtTimestamp(m_referenceFrame->CoordinateSystem, timestamp);
00674         if (pointerPose != nullptr)
00675         {
00676             HandAssignment hand = TryGetHandedness(sender, pointerPose);
00677             m_currentMode = ApplicationMode::ChooseTool;
00678             m_currentSourceId = sourceId;
00679             m_currentToolIndex = FindToolIndex(sourceId);
00680             PositionTools(pointerPose, hand);
00681
00682             for (auto& it : m_sources) it->SetApplicationMode(m_currentMode);
00683         }
00684     }
00685 }
00686
00687 void HolographicPaintMain::OnSelectTool(SourceHandler* sender)
00688 {
00689     if (ApplicationMode::ChooseTool == m_currentMode)
00690     {
00691         if (sender != nullptr)
00692         {
00693             const unsigned int sourceId = sender->SourceId();
00694             if (sourceId != m_currentSourceId) return; // Only accept changes from selected source
00695
00696             if (m_clearToolIndex == m_currentToolIndex)
00697             {
00698                 // This is a special tool which can not be selected
00699                 m_strokes.clear();
00700             }
00701             else
00702             {
00703                 SetToolByIndex(m_currentSourceId, m_currentToolIndex);
00704             }
00705         }
00706
00707         m_currentMode = ApplicationMode::Drawing;
00708         m_currentSourceId = NoSourceId;
00709
00710         for (auto& it : m_sources) it->SetApplicationMode(m_currentMode);
00711     }
00712 }
00713
00714 HandAssignment HolographicPaintMain::TryGetHandedness(SourceHandler* sender, SpatialPointerPose^ pointerPose)
00715 {
00716     constexpr double handednessTestDeadZoneAngularLimit = M_PI / 8.0;
00717     if (sender->IsPositionCurrent())
00718     {
00719         HeadPose^ head = pointerPose->Head;
00720         const float3 headForward(head->ForwardDirection.x, 0, head->ForwardDirection.z);
00721         const float3 sourcePos = sender->GetPosition();
00722         const float3 headToSource(sourcePos.x - head->Position.x, 0, sourcePos.z - head->Position.z);
00723
00724         // Because we just cleared the Y component of each vector, we do not need to load XMVectors to find the cross product.
00725         const float headForwardLength = length(headForward);
00726         if (headForwardLength < std::numeric_limits<float>::epsilon()) return HandAssignment::Unknown;
00727
00728         const float headToSourceLength = length(headToSource);
00729         if (headToSourceLength < std::numeric_limits<float>::epsilon()) return HandAssignment::Unknown;
00730
00731         // Because headForward and HeadToSource have a 0 y, cross product x and z are 0
00732         const float crossProductY = cross(headForward, headToSource).y;
00733
00734         // We could already assign left or right but we'll keep a dead-zone in the center
00735         if (abs(crossProductY) < std::numeric_limits<float>::epsilon()) return HandAssignment::Unknown;
00736         const float crossProductLength = abs(crossProductY);
00737
00738         const double angle = asin(crossProductLength / (headForwardLength * headToSourceLength));
00739
00740         if (angle > handednessTestDeadZoneAngularLimit)
00741         {
00742             return crossProductY < 0.0 ? HandAssignment::RightHand : HandAssignment::LeftHand;
00743         }
00744         else
00745         {
00746             return HandAssignment::Unknown;
00747         }
00748     }
00749     else
00750     {
00751         return HandAssignment::Unknown;
00752     }
00753 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/pch.h Source File

  • WiFiDirectServices
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020 #include <concrt.h>
00021
00022 #include <sstream>
00023
00024 #include "Helpers\BufferConverter.h"
00025 #include "Helpers\ServiceStatusConverter.h"
00026
00027 #include "App.xaml.h"
00028 #include "MainPage.xaml.h"
00029
00030 #include "WiFiDirectServicesManager.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/VideoRenderer.cs Source File

  • 360VideoPlayback
  • cs
  • Content

VideoRenderer.cs

Go to the documentation of this file.
00001 ﻿using _360VideoPlayback.Common;
00002 using System;
00003 using System.Numerics;
00004 using System.Runtime.InteropServices;
00005 using Windows.Graphics.DirectX.Direct3D11;
00006 using Windows.Media.Playback;
00007
00008 namespace _360VideoPlayback.Content
00009 {
00010     /// <summary>
00011     /// This sample renderer instantiates a basic rendering pipeline.
00012     /// </summary>
00013     internal class VideoRenderer : Disposer
00014     {
00015         // Cached reference to device resources.
00016         private DeviceResources deviceResources;
00017
00018         // Direct3D resources for cube geometry.
00019         private SharpDX.Direct3D11.InputLayout inputLayout;
00020         private SharpDX.Direct3D11.Buffer vertexBuffer;
00021         private SharpDX.Direct3D11.Buffer indexBuffer;
00022         private SharpDX.Direct3D11.VertexShader vertexShader;
00023         private SharpDX.Direct3D11.GeometryShader geometryShader;
00024         private SharpDX.Direct3D11.PixelShader pixelShader;
00025         private SharpDX.Direct3D11.Buffer modelConstantBuffer;
00026
00027         private SharpDX.Direct3D11.Texture2D m_texture;
00028         private SharpDX.Direct3D11.ShaderResourceView m_textureView;
00029         private SharpDX.Direct3D11.SamplerState m_quadTextureSamplerState;
00030         private IDirect3DSurface d3dInteropSurface;
00031
00032         // System resources for cube geometry.
00033         private ModelConstantBuffer modelConstantBufferData;
00034         private int indexCount = 0;
00035
00036         // Variables used with the rendering loop.
00037         private bool loadingComplete = false;
00038
00039         // If the current D3D Device supports VPRT, we can avoid using a geometry
00040         // shader just to set the render target array index.
00041         private bool usingVprtShaders = false;
00042
00043         private MediaPlayer m_mediaPlayer;
00044         private Object thisLock = new Object();
00045
00046         /// <summary>
00047         /// Loads vertex and pixel shaders from files and instantiates the cube geometry.
00048         /// </summary>
00049         public VideoRenderer(DeviceResources deviceResources)
00050         {
00051             this.deviceResources = deviceResources;
00052             m_mediaPlayer = AppView.mediaPlayer;
00053
00054         }
00055
00056         /// <summary>
00057         /// Called once per frame, rotates the cube and calculates the model and view matrices.
00058         /// </summary>
00059         public void Update(StepTimer timer)
00060         {
00061             Vector3 scale = new Vector3(10.0f);
00062             Matrix4x4 modelscale = Matrix4x4.CreateScale(scale);
00063
00064             // Here, we provide the model transform for the sample hologram. The model transform
00065             // matrix is transposed to prepare it for the shader.
00066             this.modelConstantBufferData.model = Matrix4x4.Transpose(modelscale);
00067             // Loading is asynchronous. Resources must be created before they can be updated.
00068             if (!loadingComplete)
00069             {
00070                 return;
00071             }
00072
00073             // Use the D3D device context to update Direct3D device-based resources.
00074             var context = this.deviceResources.D3DDeviceContext;
00075
00076             // Update the model transform buffer for the hologram.
00077             context.UpdateSubresource(ref this.modelConstantBufferData, this.modelConstantBuffer);
00078         }
00079
00080         /// <summary>
00081         /// Renders one frame using the vertex and pixel shaders.
00082         /// On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00083         /// VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00084         /// a pass-through geometry shader is also used to set the render
00085         /// target array index.
00086         /// </summary>
00087         public void Render()
00088         {
00089             // Loading is asynchronous. Resources must be created before drawing can occur.
00090             if (!this.loadingComplete)
00091             {
00092                 return;
00093             }
00094
00095             var context = this.deviceResources.D3DDeviceContext;
00096
00097             // Each vertex is one instance of the VertexPositionColor struct.
00098             int stride = SharpDX.Utilities.SizeOf<VertexPositionTexture>();
00099             int offset = 0;
00100             var bufferBinding = new SharpDX.Direct3D11.VertexBufferBinding(this.vertexBuffer, stride, offset);
00101             context.InputAssembler.SetVertexBuffers(0, bufferBinding);
00102             context.InputAssembler.SetIndexBuffer(
00103                 this.indexBuffer,
00104                 SharpDX.DXGI.Format.R32_UInt, // Each index is one 16-bit unsigned integer (short).
00105                 0);
00106             context.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList;
00107             context.InputAssembler.InputLayout = this.inputLayout;
00108
00109             // Attach the vertex shader.
00110             context.VertexShader.SetShader(this.vertexShader, null, 0);
00111             // Apply the model constant buffer to the vertex shader.
00112             context.VertexShader.SetConstantBuffers(0, this.modelConstantBuffer);
00113
00114             if (!this.usingVprtShaders)
00115             {
00116                 // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00117                 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00118                 // a pass-through geometry shader is used to set the render target
00119                 // array index.
00120                 context.GeometryShader.SetShader(this.geometryShader, null, 0);
00121             }
00122             else
00123             {
00124                 // Make sure that there is no geometry shader bound to the graphics
00125                 // pipeline on devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00126                 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature.
00127                 context.GeometryShader.SetShader(null, null, 0);
00128             }
00129
00130             // Attach the pixel shader.
00131             context.PixelShader.SetShader(this.pixelShader, null, 0);
00132
00133             lock (thisLock)
00134             {
00135
00136                 context.PixelShader.SetShaderResources(0, 1, m_textureView);
00137
00138                 context.PixelShader.SetSamplers(0, 1, m_quadTextureSamplerState);
00139
00140                 // Draw the objects.
00141                 context.DrawIndexedInstanced(
00142                     indexCount,     // Index count per instance.
00143                     2,              // Instance count.
00144                     0,              // Start index location.
00145                     0,              // Base vertex location.
00146                     0               // Start instance location.
00147                     );
00148             }
00149         }
00150
00151         /// <summary>
00152         /// Creates device-based resources to store a constant buffer, cube
00153         /// geometry, and vertex and pixel shaders. In some cases this will also
00154         /// store a geometry shader.
00155         /// </summary>
00156         public void CreateDeviceDependentResourcesAsync()
00157         {
00158             ReleaseDeviceDependentResources();
00159
00160             // Create a constant buffer to store the model matrix.
00161             modelConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
00162                 deviceResources.D3DDevice,
00163                 SharpDX.Direct3D11.BindFlags.ConstantBuffer,
00164                 ref modelConstantBufferData));
00165
00166             // Create the Texture, ShaderResource and Sampler state
00167             lock (thisLock)
00168             {
00169                 m_texture = this.ToDispose(new SharpDX.Direct3D11.Texture2D(deviceResources.D3DDevice, new SharpDX.Direct3D11.Texture2DDescription()
00170                 {
00171                     Format = SharpDX.DXGI.Format.R8G8B8A8_UNorm,
00172                     Width = (int)m_mediaPlayer.PlaybackSession.NaturalVideoWidth,//Width
00173                     Height = (int)m_mediaPlayer.PlaybackSession.NaturalVideoHeight,//Height
00174                     MipLevels = 1,
00175                     ArraySize = 1,
00176                     BindFlags = SharpDX.Direct3D11.BindFlags.ShaderResource | SharpDX.Direct3D11.BindFlags.RenderTarget,
00177                     Usage = SharpDX.Direct3D11.ResourceUsage.Default,
00178                     CpuAccessFlags = SharpDX.Direct3D11.CpuAccessFlags.None,
00179                     SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0),
00180                     OptionFlags = SharpDX.Direct3D11.ResourceOptionFlags.None
00181                 }));
00182
00183                 m_textureView = this.ToDispose(new SharpDX.Direct3D11.ShaderResourceView(deviceResources.D3DDevice, m_texture));
00184             }
00185
00186             m_quadTextureSamplerState = this.ToDispose(new SharpDX.Direct3D11.SamplerState(deviceResources.D3DDevice, new SharpDX.Direct3D11.SamplerStateDescription()
00187             {
00188                 Filter = SharpDX.Direct3D11.Filter.Anisotropic,
00189                 AddressU = SharpDX.Direct3D11.TextureAddressMode.Clamp,
00190                 AddressV = SharpDX.Direct3D11.TextureAddressMode.Clamp,
00191                 AddressW = SharpDX.Direct3D11.TextureAddressMode.Clamp,
00192                 MaximumAnisotropy = 3,
00193                 MinimumLod = 0,
00194                 MaximumLod = 3,
00195                 MipLodBias = 0,
00196                 BorderColor = new SharpDX.Mathematics.Interop.RawColor4(0, 0, 0, 0),
00197                 ComparisonFunction = SharpDX.Direct3D11.Comparison.Never
00198             }));
00199
00200             CreateD3D11Surface();
00201             LoadShaders();
00202         }
00203
00204
00205         private async void LoadShaders()
00206         {
00207             usingVprtShaders = deviceResources.D3DDeviceSupportsVprt;
00208             // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00209             // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00210             // we can avoid using a pass-through geometry shader to set the render
00211             // target array index, thus avoiding any overhead that would be
00212             // incurred by setting the geometry shader stage.
00213             var vertexShaderFileName = usingVprtShaders ? "Content\\Shaders\\VPRTVertexShader.cso" : "Content\\Shaders\\VertexShader.cso";
00214             var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
00215             // Load the compiled vertex shader.
00216             var vertexShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync(vertexShaderFileName));
00217
00218             // After the vertex shader file is loaded, create the shader and input layout.
00219             vertexShader = this.ToDispose(new SharpDX.Direct3D11.VertexShader(
00220                 deviceResources.D3DDevice,
00221                 vertexShaderByteCode));
00222
00223             SharpDX.Direct3D11.InputElement[] vertexDesc =
00224             {
00225                 new SharpDX.Direct3D11.InputElement("POSITION", 0, SharpDX.DXGI.Format.R32G32B32_Float,  0, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
00226                 new SharpDX.Direct3D11.InputElement("TEXCOORD", 1, SharpDX.DXGI.Format.R32G32_Float, 12, 0, SharpDX.Direct3D11.InputClassification.PerVertexData, 0),
00227             };
00228
00229
00230             inputLayout = this.ToDispose(new SharpDX.Direct3D11.InputLayout(
00231                 deviceResources.D3DDevice,
00232                 vertexShaderByteCode,
00233                 vertexDesc));
00234
00235
00236             if (!usingVprtShaders)
00237             {
00238                 // Load the compiled pass-through geometry shader.
00239                 var geometryShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\GeometryShader.cso"));
00240
00241                 // After the pass-through geometry shader file is loaded, create the shader.
00242                 geometryShader = this.ToDispose(new SharpDX.Direct3D11.GeometryShader(
00243                     deviceResources.D3DDevice,
00244                     geometryShaderByteCode));
00245             }
00246
00247             // Load the compiled pixel shader.
00248             var pixelShaderByteCode = await DirectXHelper.ReadDataAsync(await folder.GetFileAsync("Content\\Shaders\\PixelShader.cso"));
00249
00250             // After the pixel shader file is loaded, create the shader.
00251             pixelShader = this.ToDispose(new SharpDX.Direct3D11.PixelShader(
00252                 deviceResources.D3DDevice,
00253                 pixelShaderByteCode));
00254
00255             ComputeSphere(16, true);
00256             // Once the cube is loaded, the object is ready to be rendered.
00257             loadingComplete = true;
00258         }
00259
00260         /// <summary>
00261         /// Releases device-based resources.
00262         /// </summary>
00263         public void ReleaseDeviceDependentResources()
00264         {
00265             loadingComplete = false;
00266             usingVprtShaders = false;
00267             this.RemoveAndDispose(ref vertexShader);
00268             this.RemoveAndDispose(ref inputLayout);
00269             this.RemoveAndDispose(ref pixelShader);
00270             this.RemoveAndDispose(ref geometryShader);
00271             this.RemoveAndDispose(ref modelConstantBuffer);
00272             this.RemoveAndDispose(ref vertexBuffer);
00273             this.RemoveAndDispose(ref indexBuffer);
00274             this.RemoveAndDispose(ref m_texture);
00275             this.RemoveAndDispose(ref m_textureView);
00276             this.RemoveAndDispose(ref m_quadTextureSamplerState);
00277         }
00278
00279         private void CreateD3D11Surface()
00280         {
00281             SharpDX.DXGI.Surface2 surface = m_texture.QueryInterface<SharpDX.DXGI.Surface2>();
00282             IntPtr pUnknown;
00283             UInt32 hr = InteropStatics.CreateDirect3D11SurfaceFromDXGISurface(surface.NativePointer, out pUnknown);
00284
00285             if (hr == 0)
00286             {
00287                 d3dInteropSurface = (IDirect3DSurface)Marshal.GetObjectForIUnknown(pUnknown);
00288                 Marshal.Release(pUnknown);
00289             }
00290
00291             m_mediaPlayer.VideoFrameAvailable += M_mediaPlayer_VideoFrameAvailable;
00292             m_mediaPlayer.Play();
00293         }
00294
00295         private void M_mediaPlayer_VideoFrameAvailable(MediaPlayer sender, object args)
00296         {
00297             lock (thisLock)
00298             {
00299                 m_mediaPlayer.CopyFrameToVideoSurface(d3dInteropSurface);
00300             }
00301         }
00302
00303         private void ComputeSphere(int tessellation, bool invertn)
00304         {
00305             if (tessellation < 3)
00306             {
00307                 new Exception("tesselation parameter out of range");
00308             }
00309
00310             int verticalSegments = tessellation;
00311             int horizontalSegments = tessellation * 2;
00312             int vertCount = (verticalSegments + 1) * (horizontalSegments + 1);
00313             int idxCount = (verticalSegments) * (horizontalSegments + 1) * 6;
00314
00315             float radius = 0.5f; // Diameter of the default Sphere will always be 1 to stay aligned
00316
00317
00318             VertexPositionTexture[] sphereVertArray = new VertexPositionTexture[vertCount];
00319             int[] cubeIndices = new int[idxCount];
00320
00321             int writePos = 0;
00322
00323             for (int i = 0; i <= verticalSegments; i++)
00324             {
00325                 float v = 1 - (float)i / verticalSegments;
00326
00327                 float latitude = (float)(i * SharpDX.MathUtil.Pi /
00328                                            verticalSegments) - SharpDX.MathUtil.PiOverTwo;
00329
00330                 var dy = (float)Math.Sin(latitude);
00331                 var dxz = (float)Math.Cos(latitude);
00332
00333                 // Create a single ring of vertices at this latitude.
00334                 for (ushort j = 0; j <= horizontalSegments; j++)
00335                 {
00336                     float u = (float)j / horizontalSegments;
00337
00338                     float longitude = (float)(j * SharpDX.MathUtil.TwoPi / horizontalSegments);
00339                     float dx = (float)Math.Cos(longitude);
00340                     float dz = (float)Math.Sin(longitude);
00341                     dx *= dxz;
00342                     dz *= dxz;
00343
00344                     Vector3 vect3 = new Vector3(dx, dy, dz);
00345                     VertexPositionTexture vert;
00346                     vert.pos = vect3 * radius;
00347                     vert.texture = new Vector2(u, v);
00348
00349                     sphereVertArray[writePos] = vert;
00350                     writePos++;
00351                 }
00352             }
00353
00354             // Fill the index buffer with triangles joining each pair of latitude rings.
00355             int stride = horizontalSegments + 1;
00356             writePos = 0;
00357             for (int i = 0; i < verticalSegments; i++)
00358             {
00359                 for (int j = 0; j <= horizontalSegments; j++)
00360                 {
00361                     int nextI = i + 1;
00362                     int nextJ = (j + 1) % stride;
00363
00364                     cubeIndices[writePos] = i * stride + j;
00365                     cubeIndices[++writePos] = nextI * stride + j;
00366                     cubeIndices[++writePos] = i * stride + nextJ;
00367
00368                     cubeIndices[++writePos] = i * stride + nextJ;
00369                     cubeIndices[++writePos] = nextI * stride + j;
00370                     cubeIndices[++writePos] = nextI * stride + nextJ;
00371                     writePos++;
00372                 }
00373             }
00374
00375             vertexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
00376                deviceResources.D3DDevice,
00377                SharpDX.Direct3D11.BindFlags.VertexBuffer,
00378                sphereVertArray));
00379
00380             indexCount = idxCount;
00381
00382             indexBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
00383                deviceResources.D3DDevice,
00384                SharpDX.Direct3D11.BindFlags.IndexBuffer,
00385                cubeIndices));
00386         }
00387
00388         private void XMScalarSinCos(ref float Sin, ref float Cos, float Value)
00389         {
00390             const float XM1div2PI = 0.159154943f;
00391             // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder.
00392             float quotient = XM1div2PI * Value;
00393             if (Value >= 0.0f)
00394             {
00395                 quotient = (float)((int)(quotient + 0.5f));
00396             }
00397             else
00398             {
00399                 quotient = (float)((int)(quotient - 0.5f));
00400             }
00401             float y = Value - SharpDX.MathUtil.TwoPi * quotient;
00402
00403             // Map y to [-pi/2,pi/2] with sin(y) = sin(Value).
00404             float sign;
00405             if (y > SharpDX.MathUtil.PiOverTwo)
00406             {
00407                 y = SharpDX.MathUtil.Pi - y;
00408                 sign = -1.0f;
00409             }
00410             else if (y < -(SharpDX.MathUtil.PiOverTwo))
00411             {
00412                 y = -(SharpDX.MathUtil.Pi) - y;
00413                 sign = -1.0f;
00414             }
00415             else
00416             {
00417                 sign = +1.0f;
00418             }
00419
00420             float y2 = y * y;
00421
00422             // 11-degree minimax approximation
00423             Sin = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y;
00424
00425             // 10-degree minimax approximation
00426             float p = (float)((float)((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f);
00427
00428             Cos = sign * p;
00429         }
00430
00431     }
00432 }
00433
00434
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpatialControllerHandler Member List

This is the complete list of members for SpatialControllerHandler, including all inherited members.
ComposeStroke() | SourceHandler | [protected, virtual]
GetCurrentTool() const | SourceHandler | [inline]
GetPosition() const | SourceHandler | [inline]
GetSourceKind() const | SourceHandler | [inline]
GetToolPosition() const | SourceHandler | [inline, virtual]
GetToolScale() const override | SpatialControllerHandler | [virtual]
IsPositionCurrent() const | SourceHandler | [inline]
m_currentMode | SourceHandler | [protected]
m_currentStroke | SourceHandler | [protected]
m_currentTool | SourceHandler | [protected]
m_eventsHandler | SourceHandler | [protected]
m_gestureRecognizer | SpatialControllerHandler | [protected]
m_hapticsBuzzFeedback | SpatialControllerHandler | [protected]
m_hapticsController | SpatialControllerHandler | [protected]
m_insideTargetBoard | SpatialControllerHandler | [protected]
m_modelConstantBufferData | SourceHandler | [protected]
m_position | SourceHandler | [protected]
m_refreshModelConstantBufferData | SourceHandler | [protected]
m_sourceId | SourceHandler | [protected]
m_sourceKind | SourceHandler | [protected]
m_spDPadHelper | SpatialControllerHandler | [protected]
m_strokeInsideTargetBoard | SpatialControllerHandler | [protected]
m_tappedToken | SpatialControllerHandler | [protected]
m_targetBoard | SourceHandler | [protected]
m_toolPosition | SourceHandler | [protected]
m_waitForRelease | SpatialControllerHandler | [protected]
Make(std::shared_ptr< SourceHandler > *handler, Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | SourceHandler | [static]
OnInteractionDetected(Windows::UI::Input::Spatial::SpatialInteraction^interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override | SpatialControllerHandler | [virtual]
OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) override | SpatialControllerHandler | [virtual]
OnSourceUpdated(Windows::UI::Input::Spatial::SpatialInteractionSourceState^state, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override | SpatialControllerHandler | [virtual]
OnTapped(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs^args) | SpatialControllerHandler | [protected]
Render(ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override | SourceHandler | [virtual]
SetApplicationMode(ApplicationMode newMode) | SourceHandler | [inline]
SetCurrentTool(std::shared_ptr< Tool > tool) | SourceHandler |
SourceHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | SourceHandler | [protected]
SourceId() const | SourceHandler | [inline]
SpatialControllerHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | SpatialControllerHandler |
TerminateStroke() | SourceHandler | [protected, virtual]
TryGetContinousBuzz(Windows::Devices::Haptics::SimpleHapticsController^controller) | SpatialControllerHandler |
Update(ID3D11DeviceContext *pDeviceContext) override | SourceHandler | [virtual]
~SpatialControllerHandler() | SpatialControllerHandler |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Polling Member List

This is the complete list of members for Scenario2_Polling, including all inherited members.
OnProximitySensorAdded(DeviceWatcher sender, DeviceInformation device) | Scenario2_Polling | [inline, private]
rootPage | Scenario2_Polling | [private]
Scenario2_Polling() | Scenario2_Polling | [inline]
ScenarioGetData(object sender, RoutedEventArgs e) | Scenario2_Polling | [inline, private]
sensor | Scenario2_Polling | [private]
watcher | Scenario2_Polling | [private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/DecodeEngine.h Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

DecodeEngine.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace BarcodeDecoder
00014 {
00015     ref class DecodeResult
00016     {
00017     internal:
00018         property UINT Symbology
00019         {
00020             UINT get() { return m_symboloy; }
00021         internal:
00022             void set(_In_ UINT value) { m_symboloy = value; }
00023         }
00024
00025         property Platform::String^ Text
00026         {
00027             Platform::String^ get() { return m_text; }
00028         internal:
00029             void set(_In_ Platform::String^ value) { m_text = value; }
00030         }
00031
00032         static bool Equals(DecodeResult^ obj1, DecodeResult^ obj2)
00033         {
00034             if (obj1 == nullptr)
00035             {
00036                 return (obj2 == nullptr);
00037             }
00038             else if (obj2 == nullptr)
00039             {
00040                 return false;
00041             }
00042             return (obj1->Symbology == obj2->Symbology) && (obj1->Text == obj2->Text);
00043         }
00044
00045     private:
00046         UINT m_symboloy;
00047         Platform::String^ m_text;
00048     };
00049
00050     ref class DecodeEngine
00051     {
00052     internal:
00053         DecodeEngine();
00054
00055          property Windows::Foundation::Collections::IVector<UINT>^ SupportedSymbologies
00056         {
00057             Windows::Foundation::Collections::IVector<UINT>^ get() { return m_supportedSymbologies; }
00058         internal:
00059             void set(_In_ Windows::Foundation::Collections::IVector<UINT>^ value) { m_supportedSymbologies = value; }
00060         }
00061
00062         property Windows::Foundation::Collections::IVector<UINT>^ ActiveSymbologies
00063         {
00064             Windows::Foundation::Collections::IVector<UINT>^ get() { return m_activeSymbologies; }
00065             void set(_In_ Windows::Foundation::Collections::IVector<UINT>^ value) { m_activeSymbologies = value; }
00066         }
00067
00068         concurrency::task<DecodeResult^> DecodeAsync(Windows::Graphics::Imaging::SoftwareBitmap^ bitmap);
00069
00070     private:
00071         Windows::Media::Ocr::OcrEngine^ m_ocrEngine = nullptr;
00072         Windows::Foundation::Collections::IVector<UINT>^ m_supportedSymbologies;
00073         Windows::Foundation::Collections::IVector<UINT>^ m_activeSymbologies;
00074     };
00075 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario2_ChatServer.xaml.cs Source File

  • BluetoothRfcommChat
  • cs

Scenario2_ChatServer.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Bluetooth;
00014 using Windows.Devices.Bluetooth.Rfcomm;
00015 using Windows.Networking.Sockets;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2_ChatServer : Page
00025     {
00026         private StreamSocket socket;
00027         private DataWriter writer;
00028         private RfcommServiceProvider rfcommProvider;
00029         private StreamSocketListener socketListener;
00030
00031         // A pointer back to the main page is required to display status messages.
00032         MainPage rootPage;
00033
00034         public Scenario2_ChatServer()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             rootPage = MainPage.Current;
00042         }
00043
00044         protected override void OnNavigatedFrom(NavigationEventArgs e)
00045         {
00046             Disconnect();
00047         }
00048
00049         private void ListenButton_Click(object sender, RoutedEventArgs e)
00050         {
00051             InitializeRfcommServer();
00052         }
00053
00054         /// <summary>
00055         /// Initializes the server using RfcommServiceProvider to advertise the Chat Service UUID and start listening
00056         /// for incoming connections.
00057         /// </summary>
00058         private async void InitializeRfcommServer()
00059         {
00060             ListenButton.IsEnabled = false;
00061             DisconnectButton.IsEnabled = true;
00062
00063             try
00064             {
00065                 rfcommProvider = await RfcommServiceProvider.CreateAsync(RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid));
00066             }
00067             // Catch exception HRESULT_FROM_WIN32(ERROR_DEVICE_NOT_AVAILABLE).
00068             catch (Exception ex) when ((uint)ex.HResult == 0x800710DF)
00069             {
00070                 // The Bluetooth radio may be off.
00071                 rootPage.NotifyUser("Make sure your Bluetooth Radio is on: " + ex.Message, NotifyType.ErrorMessage);
00072                 ListenButton.IsEnabled = true;
00073                 DisconnectButton.IsEnabled = false;
00074                 return;
00075             }
00076
00077
00078             // Create a listener for this service and start listening
00079             socketListener = new StreamSocketListener();
00080             socketListener.ConnectionReceived += OnConnectionReceived;
00081             var rfcomm = rfcommProvider.ServiceId.AsString();
00082
00083             await socketListener.BindServiceNameAsync(rfcommProvider.ServiceId.AsString(),
00084                 SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);
00085
00086             // Set the SDP attributes and start Bluetooth advertising
00087             InitializeServiceSdpAttributes(rfcommProvider);
00088
00089             try
00090             {
00091                 rfcommProvider.StartAdvertising(socketListener, true);
00092             }
00093             catch (Exception e)
00094             {
00095                 // If you aren't able to get a reference to an RfcommServiceProvider, tell the user why.  Usually throws an exception if user changed their privacy settings to prevent Sync w/ Devices.
00096                 rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
00097                 ListenButton.IsEnabled = true;
00098                 DisconnectButton.IsEnabled = false;
00099                 return;
00100             }
00101
00102             rootPage.NotifyUser("Listening for incoming connections", NotifyType.StatusMessage);
00103         }
00104
00105         /// <summary>
00106         /// Creates the SDP record that will be revealed to the Client device when pairing occurs.
00107         /// </summary>
00108         /// <param name="rfcommProvider">The RfcommServiceProvider that is being used to initialize the server</param>
00109         private void InitializeServiceSdpAttributes(RfcommServiceProvider rfcommProvider)
00110         {
00111             var sdpWriter = new DataWriter();
00112
00113             // Write the Service Name Attribute.
00114             sdpWriter.WriteByte(Constants.SdpServiceNameAttributeType);
00115
00116             // The length of the UTF-8 encoded Service Name SDP Attribute.
00117             sdpWriter.WriteByte((byte)Constants.SdpServiceName.Length);
00118
00119             // The UTF-8 encoded Service Name value.
00120             sdpWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
00121             sdpWriter.WriteString(Constants.SdpServiceName);
00122
00123             // Set the SDP Attribute on the RFCOMM Service Provider.
00124             rfcommProvider.SdpRawAttributes.Add(Constants.SdpServiceNameAttributeId, sdpWriter.DetachBuffer());
00125         }
00126
00127         private void SendButton_Click(object sender, RoutedEventArgs e)
00128         {
00129             SendMessage();
00130         }
00131
00132         public void KeyboardKey_Pressed(object sender, KeyRoutedEventArgs e)
00133         {
00134             if (e.Key == Windows.System.VirtualKey.Enter)
00135             {
00136                 SendMessage();
00137             }
00138         }
00139
00140         private async void SendMessage()
00141         {
00142             // There's no need to send a zero length message
00143             if (MessageTextBox.Text.Length != 0)
00144             {
00145                 // Make sure that the connection is still up and there is a message to send
00146                 if (socket != null)
00147                 {
00148                     string message = MessageTextBox.Text;
00149                     writer.WriteUInt32((uint)message.Length);
00150                     writer.WriteString(message);
00151
00152                     ConversationListBox.Items.Add("Sent: " + message);
00153                     // Clear the messageTextBox for a new message
00154                     MessageTextBox.Text = "";
00155
00156                     await writer.StoreAsync();
00157
00158                 }
00159                 else
00160                 {
00161                     rootPage.NotifyUser("No clients connected, please wait for a client to connect before attempting to send a message", NotifyType.StatusMessage);
00162                 }
00163             }
00164         }
00165
00166
00167         private void DisconnectButton_Click(object sender, RoutedEventArgs e)
00168         {
00169             Disconnect();
00170             rootPage.NotifyUser("Disconnected.", NotifyType.StatusMessage);
00171         }
00172
00173         private async void Disconnect()
00174         {
00175             if (rfcommProvider != null)
00176             {
00177                 rfcommProvider.StopAdvertising();
00178                 rfcommProvider = null;
00179             }
00180
00181             if (socketListener != null)
00182             {
00183                 socketListener.Dispose();
00184                 socketListener = null;
00185             }
00186
00187             if (writer != null)
00188             {
00189                 writer.DetachStream();
00190                 writer = null;
00191             }
00192
00193             if (socket != null)
00194             {
00195                 socket.Dispose();
00196                 socket = null;
00197             }
00198             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00199             {
00200                 ListenButton.IsEnabled = true;
00201                 DisconnectButton.IsEnabled = false;
00202                 ConversationListBox.Items.Clear();
00203             });
00204         }
00205
00206         /// <summary>
00207         /// Invoked when the socket listener accepts an incoming Bluetooth connection.
00208         /// </summary>
00209         /// <param name="sender">The socket listener that accepted the connection.</param>
00210         /// <param name="args">The connection accept parameters, which contain the connected socket.</param>
00211         private async void OnConnectionReceived(
00212             StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
00213         {
00214             // Don't need the listener anymore
00215             socketListener.Dispose();
00216             socketListener = null;
00217
00218             try
00219             {
00220                 socket = args.Socket;
00221             }
00222             catch (Exception e)
00223             {
00224                 await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00225                 {
00226                     rootPage.NotifyUser(e.Message, NotifyType.ErrorMessage);
00227                 });
00228                 Disconnect();
00229                 return;
00230             }
00231
00232             // Note - this is the supported way to get a Bluetooth device from a given socket
00233             var remoteDevice = await BluetoothDevice.FromHostNameAsync(socket.Information.RemoteHostName);
00234
00235             writer = new DataWriter(socket.OutputStream);
00236             var reader = new DataReader(socket.InputStream);
00237             bool remoteDisconnection = false;
00238
00239             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00240             {
00241                 rootPage.NotifyUser("Connected to Client: " + remoteDevice.Name, NotifyType.StatusMessage);
00242             });
00243
00244             // Infinite read buffer loop
00245             while (true)
00246             {
00247                 try
00248                 {
00249                     // Based on the protocol we've defined, the first uint is the size of the message
00250                     uint readLength = await reader.LoadAsync(sizeof(uint));
00251
00252                     // Check if the size of the data is expected (otherwise the remote has already terminated the connection)
00253                     if (readLength < sizeof(uint))
00254                     {
00255                         remoteDisconnection = true;
00256                         break;
00257                     }
00258                     uint currentLength = reader.ReadUInt32();
00259
00260                     // Load the rest of the message since you already know the length of the data expected.
00261                     readLength = await reader.LoadAsync(currentLength);
00262
00263                     // Check if the size of the data is expected (otherwise the remote has already terminated the connection)
00264                     if (readLength < currentLength)
00265                     {
00266                         remoteDisconnection = true;
00267                         break;
00268                     }
00269                     string message = reader.ReadString(currentLength);
00270
00271                     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00272                     {
00273                         ConversationListBox.Items.Add("Received: " + message);
00274                     });
00275                 }
00276                 // Catch exception HRESULT_FROM_WIN32(ERROR_OPERATION_ABORTED).
00277                 catch (Exception ex) when ((uint)ex.HResult == 0x800703E3)
00278                 {
00279                     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00280                     {
00281                         rootPage.NotifyUser("Client Disconnected Successfully", NotifyType.StatusMessage);
00282                     });
00283                     break;
00284                 }
00285             }
00286
00287             reader.DetachStream();
00288             if (remoteDisconnection)
00289             {
00290                 Disconnect();
00291                 await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00292                 {
00293                     rootPage.NotifyUser("Client disconnected",NotifyType.StatusMessage);
00294                 });
00295             }
00296         }
00297     }
00298 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DASHEntry Member List

This is the complete list of members for DASHEntry, including all inherited members.
DASHEntry(string title, string url) | DASHEntry | [inline]
entryTitle | DASHEntry | [private]
sourceUrl | DASHEntry | [private]
Title | DASHEntry |
Url | DASHEntry |
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/SampleConfiguration.cs Source File

  • JumpList
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Jump List C# Sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Respond to being launched", ClassType=typeof(Scenario1_Launched)},
00027             new Scenario() { Title="Remove the jump list", ClassType=typeof(Scenario2_Remove)},
00028             new Scenario() { Title="Creating custom items", ClassType=typeof(Scenario3_CustomItems)},
00029             new Scenario() { Title="Change the system group", ClassType=typeof(Scenario4_ChangeSystemGroup)},
00030             new Scenario() { Title="Check if the platform is supported", ClassType=typeof(Scenario5_IsSupported)},
00031         };
00032
00033         private string launchParam;
00034         public string LaunchParam
00035         {
00036             get
00037             {
00038                 return launchParam;
00039             }
00040
00041             set
00042             {
00043                 launchParam = value;
00044                 if (!string.IsNullOrEmpty(value))
00045                 {
00046                     if (ScenarioControl.SelectedIndex == 0)
00047                     {
00048                         ScenarioControl.SelectedIndex = -1;
00049                     }
00050
00051                     ScenarioControl.SelectedIndex = 0;
00052                 }
00053             }
00054         }
00055     }
00056
00057     public partial class App : Application
00058     {
00059         protected override void OnFileActivated(FileActivatedEventArgs args)
00060         {
00061             base.OnFileActivated(args);
00062
00063             if (args.Files.Count == 1)
00064             {
00065                 MainPage.Current.LaunchParam = "file: " + args.Files[0].Name;
00066             }
00067         }
00068
00069         partial void LaunchCompleted(LaunchActivatedEventArgs e)
00070         {
00071             if (!string.IsNullOrEmpty(e.Arguments))
00072             {
00073                 MainPage.Current.LaunchParam = "arguments: " + e.Arguments;
00074             }
00075         }
00076     }
00077
00078     public class Scenario
00079     {
00080         public string Title { get; set; }
00081         public Type ClassType { get; set; }
00082     }
00083 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_AdInsertion Member List

This is the complete list of members for Scenario6_AdInsertion, including all inherited members.
adaptiveMediaSourceLogger | Scenario6_AdInsertion | [private]
CreateMediaBreaksForItem(MediaPlaybackItem item) | Scenario6_AdInsertion | [inline, private]
HideDescriptionOnSmallScreen() | Scenario6_AdInsertion | [inline, private]
Item_TimedMetadataTracksChanged(MediaPlaybackItem item, IVectorChangedEventArgs args) | Scenario6_AdInsertion | [inline, private]
LoadSourceFromUriAsync(Uri uri, HttpClient httpClient=null) | Scenario6_AdInsertion | [inline, private]
Log(string message) | Scenario6_AdInsertion | [inline, private]
mediaPlaybackItemLogger | Scenario6_AdInsertion | [private]
mediaPlayerLogger | Scenario6_AdInsertion | [private]
mediaSourceLogger | Scenario6_AdInsertion | [private]
metadata_TrackingEvents_CueEntered(TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args) | Scenario6_AdInsertion | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario6_AdInsertion | [inline, protected]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario6_AdInsertion | [inline, private]
RegisterForMediaPlaybackItemEvents(MediaPlaybackItem item) | Scenario6_AdInsertion | [inline, private]
RegisterForMediaSourceEvents(MediaSource source) | Scenario6_AdInsertion | [inline, private]
RegisterMetadataHandlers(MediaPlaybackItem mediaPlaybackItem, int index) | Scenario6_AdInsertion | [inline, private]
Scenario6_AdInsertion() | Scenario6_AdInsertion | [inline]
Source_OpenOperationCompleted(MediaSource source, MediaSourceOpenOperationCompletedEventArgs args) | Scenario6_AdInsertion | [inline, private]
UnregisterForMediaPlaybackItemEvents(MediaPlaybackItem item) | Scenario6_AdInsertion | [inline, private]
UnregisterForMediaSourceEvents(MediaSource source) | Scenario6_AdInsertion | [inline, private]
UnregisterHandlers(MediaPlayer mediaPlayer) | Scenario6_AdInsertion | [inline, private]
UnregisterMetadataHandlers(TimedMetadataTrack timedTrack) | Scenario6_AdInsertion | [inline, private]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario5Photos.xaml.h Source File

  • Printing
  • cpp

Scenario5Photos.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "Scenario5Photos.g.h"
00005 #include "PrintHelper.h"
00006 #include <concrt.h>
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// Photo size options
00012     /// </summary>
00013     enum PhotoSize : byte
00014     {
00015         SizeFullPage,
00016         Size4x6,
00017         Size5x7,
00018         Size8x10
00019     };
00020
00021     /// <summary>
00022     /// Photo scaling options
00023     /// </summary>
00024     enum Scaling : byte
00025     {
00026         ShrinkToFit,
00027         Crop
00028     };
00029
00030     /// <summary>
00031     /// Printable page description
00032     /// </summary>
00033     public value class PageDescription
00034     {
00035     public:
00036         Windows::Foundation::Size Margin;
00037         Windows::Foundation::Size PageSize;
00038         Windows::Foundation::Size ViewablePageSize;
00039         Windows::Foundation::Size PictureViewSize;
00040         bool IsContentCropped;
00041
00042         friend bool operator==(PageDescription pageDescriptiopn1, PageDescription pageDescription2)
00043         {
00044             // Detect if PageSize changed
00045             bool equal = (std::abs(pageDescriptiopn1.PageSize.Width - pageDescription2.PageSize.Width) < FLT_EPSILON) &&
00046                 (std::abs(pageDescriptiopn1.PageSize.Height - pageDescription2.PageSize.Height) < FLT_EPSILON);
00047
00048             // Detect if ViewablePageSize changed
00049             if (equal)
00050             {
00051                 equal = (std::abs(pageDescriptiopn1.ViewablePageSize.Width - pageDescription2.ViewablePageSize.Width) < FLT_EPSILON) &&
00052                     (std::abs(pageDescriptiopn1.ViewablePageSize.Height - pageDescription2.ViewablePageSize.Height) < FLT_EPSILON);
00053             }
00054
00055             // Detect if PictureViewSize changed
00056             if (equal)
00057             {
00058                 equal = (std::abs(pageDescriptiopn1.PictureViewSize.Width - pageDescription2.PictureViewSize.Width) < FLT_EPSILON) &&
00059                     (std::abs(pageDescriptiopn1.PictureViewSize.Height - pageDescription2.PictureViewSize.Height) < FLT_EPSILON);
00060             }
00061
00062             // Detect if cropping changed
00063             if (equal)
00064             {
00065                 equal = pageDescriptiopn1.IsContentCropped == pageDescription2.IsContentCropped;
00066             }
00067
00068             return equal;
00069         }
00070
00071         friend bool operator!=(PageDescription pageDescriptiopn1, PageDescription pageDescription2)
00072         {
00073             return !(pageDescriptiopn1 == pageDescription2);
00074         }
00075     };
00076
00077     ref class PhotosPrintHelper sealed : public PrintHelper
00078     {
00079     public:
00080         PhotosPrintHelper(Page^ scenarioPage) : PrintHelper(scenarioPage) { }
00081
00082     protected:
00083         /// <summary>
00084         /// Option change event handler
00085         /// </summary>
00086         /// <param name="sender">The print task option details for which an option changed.</param>
00087         /// <param name="args">The event arguments containing the id of the option changed.</param>
00088         void PrintDetailedOptionsOptionChanged(Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails^ sender,
00089             Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs^ args);
00090
00091         /// <summary>
00092         /// This is the event handler for PrintManager.PrintTaskRequested.
00093         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified
00094         /// by PrintTaskRequestedEventArgs->Request->Deadline.
00095         /// Therefore, we use this handler to only create the print task.
00096         /// The print settings customization can be done when the print document source is requested.
00097         /// </summary>
00098         /// <param name="sender">The print manager for which a print task request was made.</param>
00099         /// <param name="e">The print taks request associated arguments.</param>
00100         virtual void PrintTaskRequested(Windows::Graphics::Printing::PrintManager^ sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^ e) override;
00101
00102         /// <summary>
00103         /// Helper function used to triger a preview refresh
00104         /// </summary>
00105         void RefreshPreview();
00106
00107         /// <summary>
00108         /// This is the event handler for Pagination.
00109         /// </summary>
00110         /// <param name="sender">The document for which pagination occurs.</param>
00111         /// <param name="e">The pagination event arguments containing the print options.</param>
00112         virtual void CreatePrintPreviewPages(Object^ sender, PaginateEventArgs^ e) override;
00113
00114         /// <summary>
00115         /// This is the event handler for PrintDocument.GetPrintPreviewPage. It provides a specific print preview page,
00116         /// in the form of an UIElement, to an instance of PrintDocument.
00117         /// PrintDocument subsequently converts the UIElement into a page that the Windows print system can deal with.
00118         /// </summary>
00119         /// <param name="sender">The print document.</param>
00120         /// <param name="e">Arguments containing the preview requested page.</param>
00121         virtual void GetPrintPreviewPage(Object^ sender, GetPreviewPageEventArgs^ e) override;
00122
00123         /// <summary>
00124         /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00125         /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00126         /// into a pages that the Windows print system can deal with.
00127         /// </summary>
00128         /// <param name="sender">The print document.</param>
00129         /// <param name="e">Add page event arguments containing a print task options reference</param>
00130         virtual void AddPrintPages(Object^ sender, AddPagesEventArgs^ e) override;
00131
00132         /// <summary>
00133         /// Helper function that clears the page collection and also the pages attached to the "visual root".
00134         /// </summary>
00135         void ClearPageCollection();
00136
00137     private:
00138         /// <summary>
00139         /// The app's number of photos.
00140         /// </summary>
00141         static const int NumberOfPhotos = 6;
00142
00143         /// <summary>
00144         /// Constant for 96 DPI
00145         /// </summary>
00146         static const int DPI96 = 96;
00147
00148         /// <summary>
00149         /// A map of UIElements used to store the print preview pages.
00150         /// </summary>
00151         std::map<int, UIElement^> m_pageCollection;
00152
00153         /// <summary>
00154         /// Synchronization object used to secure access to the page collection and the visual root(printingRoot).
00155         /// </summary>
00156         concurrency::critical_section m_csPrintSync;
00157
00158         /// <summary>
00159         /// Current size settings for the image.
00160         /// </summary>
00161         PhotoSize m_photoSize;
00162
00163         /// <summary>
00164         /// Current scale settings for the image.
00165         /// </summary>
00166         Scaling m_photoScale;
00167
00168         /// <summary>
00169         /// The current printer's page description used to create the content (size, margins, printable area).
00170         /// </summary>
00171         PageDescription m_currentPageDescription;
00172
00173         /// <summary>
00174         /// A request "number" used to describe a Paginate - GetPreviewPage session.
00175         /// It is used by GetPreviewPage to determine, before calling SetPreviewPage, if the page content is out of date.
00176         /// Flow:
00177         /// Paginate will increment the request count and all subsequent GetPreviewPage calls will store a local copy and verify it before calling SetPreviewPage.
00178         /// If another Paginate event is triggered while some GetPreviewPage workers are still executing asynchronously
00179         /// their results will be discarded(ignored) because their request number is expired (the photo page description changed).
00180         /// </summary>
00181         LONGLONG m_requestCount;
00182
00183         /// <summary>
00184         /// Generic swap of 2 values
00185         /// </summary>
00186         /// <typeparam name="T">typename</typeparam>
00187         /// <param name="v1">Value 1</param>
00188         /// <param name="v2">Value 2</param>
00189         template<class T> static void Swap(T& v1, T& v2);
00190
00191         /// <summary>
00192         /// Generates a page containing a photo.
00193         /// The image will be rotated if detected that there is a gain from that regarding size (try to maximize photo size).
00194         /// </summary>
00195         /// <param name="photoNumber">The photo number.</param>
00196         /// <param name="pageDescription">The description of the printer page.</param>
00197         /// <returns>A task that will produce the page.</returns>
00198         concurrency::task<UIElement^> GeneratePageAsync(int photoNumber, PageDescription pageDescription);
00199
00200         /// <summary>
00201         /// Loads an image from an uri source and performs a rotation based on the print target aspect.
00202         /// </summary>
00203         /// <param name="source">The location of the image.</param>
00204         /// <param name="landscape">A flag that indicates if the target(printer page) is in landscape mode.</param>
00205         concurrency::task<Windows::UI::Xaml::Media::Imaging::WriteableBitmap^> LoadBitmapAsync(Windows::Foundation::Uri^ source, bool landscape);
00206     };
00207
00208     /// <summary>
00209     /// Photo printing scenario
00210     /// </summary>
00211     [Windows::Foundation::Metadata::WebHostHidden]
00212     public ref class Scenario5Photos sealed
00213     {
00214     public:
00215         Scenario5Photos();
00216
00217     protected:
00218         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00219         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00220
00221     private:
00222         PrintHelper^ printHelper;
00223         void OnPrintButtonClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00224     };
00225 }
Generated on Fri Nov 15 2024 22:21:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/Scenario1_UTF8.xaml.cs Source File

  • WebSocket
  • cs

Scenario1_UTF8.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Foundation;
00015 using Windows.Networking.Sockets;
00016 using Windows.Security.Cryptography.Certificates;
00017 using Windows.Storage.Streams;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario1_UTF8 : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         private MessageWebSocket messageWebSocket;
00035         private DataWriter messageWriter;
00036         private bool busy;
00037
00038         public Scenario1_UTF8()
00039         {
00040             this.InitializeComponent();
00041             UpdateVisualState();
00042         }
00043
00044         protected override void OnNavigatedFrom(NavigationEventArgs e)
00045         {
00046             CloseSocket();
00047         }
00048
00049         private void UpdateVisualState()
00050         {
00051             if (busy)
00052             {
00053                 VisualStateManager.GoToState(this, "Busy", false);
00054             }
00055             else
00056             {
00057                 bool connected = (messageWebSocket != null);
00058                 VisualStateManager.GoToState(this, connected ? "Connected" : "Disconnected", false);
00059             }
00060         }
00061
00062         private void SetBusy(bool value)
00063         {
00064             busy = value;
00065             UpdateVisualState();
00066         }
00067
00068         private async void OnConnect(object sender, RoutedEventArgs args)
00069         {
00070             SetBusy(true);
00071             await ConnectAsync();
00072             SetBusy(false);
00073         }
00074
00075         private async Task ConnectAsync()
00076         {
00077             if (String.IsNullOrEmpty(InputField.Text))
00078             {
00079                 rootPage.NotifyUser("Please specify text to send", NotifyType.ErrorMessage);
00080                 return;
00081             }
00082
00083             // Validating the URI is required since it was received from an untrusted source (user input).
00084             // The URI is validated by calling TryGetUri() that will return null for strings that are not
00085             // valid WebSocket URIs.
00086             // Note that when enabling the text box users may provide URIs to machines on the intrAnet
00087             // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
00088             // "Internet (Client)" capability respectively.
00089             Uri server = rootPage.TryGetUri(ServerAddressField.Text);
00090             if (server == null)
00091             {
00092                 return;
00093             }
00094
00095             messageWebSocket = new MessageWebSocket();
00096             messageWebSocket.Control.MessageType = SocketMessageType.Utf8;
00097             messageWebSocket.MessageReceived += MessageReceived;
00098             messageWebSocket.Closed += OnClosed;
00099
00100             // If we are connecting to wss:// endpoint, by default, the OS performs validation of
00101             // the server certificate based on well-known trusted CAs. We can perform additional custom
00102             // validation if needed.
00103             if (SecureWebSocketCheckBox.IsChecked == true)
00104             {
00105                 // WARNING: Only test applications should ignore SSL errors.
00106                 // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
00107                 // attacks. (Although the connection is secure, the server is not authenticated.)
00108                 // Note that not all certificate validation errors can be ignored.
00109                 // In this case, we are ignoring these errors since the certificate assigned to the localhost
00110                 // URI is self-signed and has subject name = fabrikam.com
00111                 messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
00112                 messageWebSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);
00113
00114                 // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
00115                 // custom validation of the server certificate. The event handler must implement the desired
00116                 // custom certificate validation logic.
00117                 messageWebSocket.ServerCustomValidationRequested += OnServerCustomValidationRequested;
00118
00119                 // Certificate validation occurs only for secure connections.
00120                 if (server.Scheme != "wss")
00121                 {
00122                     AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
00123                 }
00124             }
00125
00126             AppendOutputLine($"Connecting to {server}...");
00127             try
00128             {
00129                 await messageWebSocket.ConnectAsync(server);
00130             }
00131             catch (Exception ex) // For debugging
00132             {
00133                 // Error happened during connect operation.
00134                 messageWebSocket.Dispose();
00135                 messageWebSocket = null;
00136
00137                 AppendOutputLine(MainPage.BuildWebSocketError(ex));
00138                 AppendOutputLine(ex.Message);
00139                 return;
00140             }
00141
00142             // The default DataWriter encoding is Utf8.
00143             messageWriter = new DataWriter(messageWebSocket.OutputStream);
00144             rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
00145         }
00146
00147         private async void OnServerCustomValidationRequested(MessageWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args)
00148         {
00149             // In order to call async APIs in this handler, you must first take a deferral and then
00150             // release it once you are done with the operation. The "using" statement
00151             // ensures that the deferral completes when control leaves the block.
00152             bool isValid;
00153             using (Deferral deferral = args.GetDeferral())
00154             {
00155                 // Get the server certificate and certificate chain from the args parameter.
00156                 isValid = await MainPage.AreCertificateAndCertChainValidAsync(args.ServerCertificate, args.ServerIntermediateCertificates);
00157
00158                 if (!isValid)
00159                 {
00160                     args.Reject();
00161                 }
00162             }
00163
00164             // Continue on the UI thread so we can update UI.
00165             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00166             {
00167                 if (isValid)
00168                 {
00169                     AppendOutputLine("Custom validation of server certificate passed.");
00170                 }
00171                 else
00172                 {
00173                     AppendOutputLine("Custom validation of server certificate failed.");
00174                 }
00175             });
00176         }
00177
00178         async void OnSend(object sender, RoutedEventArgs args)
00179         {
00180             SetBusy(true);
00181             await SendAsync();
00182             SetBusy(false);
00183         }
00184
00185         async Task SendAsync()
00186         {
00187             string message = InputField.Text;
00188             if (String.IsNullOrEmpty(message))
00189             {
00190                 rootPage.NotifyUser("Please specify text to send", NotifyType.ErrorMessage);
00191                 return;
00192             }
00193
00194             AppendOutputLine("Sending Message: " + message);
00195
00196             // Buffer any data we want to send.
00197             messageWriter.WriteString(message);
00198
00199             try
00200             {
00201                 // Send the data as one complete message.
00202                 await messageWriter.StoreAsync();
00203             }
00204             catch (Exception ex)
00205             {
00206                 AppendOutputLine(MainPage.BuildWebSocketError(ex));
00207                 AppendOutputLine(ex.Message);
00208                 return;
00209             }
00210
00211             rootPage.NotifyUser("Send Complete", NotifyType.StatusMessage);
00212         }
00213
00214         private void MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
00215         {
00216             // Dispatch the event to the UI thread so we can update UI.
00217             var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00218             {
00219                 AppendOutputLine("Message Received; Type: " + args.MessageType);
00220                 using (DataReader reader = args.GetDataReader())
00221                 {
00222                     reader.UnicodeEncoding = UnicodeEncoding.Utf8;
00223
00224                     try
00225                     {
00226                         string read = reader.ReadString(reader.UnconsumedBufferLength);
00227                         AppendOutputLine(read);
00228                     }
00229                     catch (Exception ex)
00230                     {
00231                         AppendOutputLine(MainPage.BuildWebSocketError(ex));
00232                         AppendOutputLine(ex.Message);
00233                     }
00234                 }
00235             });
00236         }
00237
00238         private void OnDisconnect(object sender, RoutedEventArgs args)
00239         {
00240             SetBusy(true);
00241             rootPage.NotifyUser("Closing", NotifyType.StatusMessage);
00242             CloseSocket();
00243             SetBusy(false);
00244             rootPage.NotifyUser("Closed", NotifyType.StatusMessage);
00245         }
00246
00247         // This may be triggered remotely by the server or locally by Close/Dispose()
00248         private async void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
00249         {
00250             // Dispatch the event to the UI thread so we do not need to synchronize access to messageWebSocket.
00251             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00252             {
00253                 AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);
00254
00255                 if (messageWebSocket == sender)
00256                 {
00257                     CloseSocket();
00258                     UpdateVisualState();
00259                 }
00260             });
00261         }
00262
00263         private void CloseSocket()
00264         {
00265             if (messageWriter != null)
00266             {
00267                 // In order to reuse the socket with another DataWriter, the socket's output stream needs to be detached.
00268                 // Otherwise, the DataWriter's destructor will automatically close the stream and all subsequent I/O operations
00269                 // invoked on the socket's output stream will fail with ObjectDisposedException.
00270                 //
00271                 // This is only added for completeness, as this sample closes the socket in the very next code block.
00272                 messageWriter.DetachStream();
00273                 messageWriter.Dispose();
00274                 messageWriter = null;
00275             }
00276
00277             if (messageWebSocket != null)
00278             {
00279                 try
00280                 {
00281                     messageWebSocket.Close(1000, "Closed due to user request.");
00282                 }
00283                 catch (Exception ex)
00284                 {
00285                     AppendOutputLine(MainPage.BuildWebSocketError(ex));
00286                     AppendOutputLine(ex.Message);
00287                 }
00288                 messageWebSocket = null;
00289             }
00290         }
00291
00292         private void AppendOutputLine(string value)
00293         {
00294             OutputField.Text += value + "\r\n";
00295         }
00296     }
00297 }
Generated on Fri Nov 15 2024 22:22:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TimeTriggeredTask Member List

This is the complete list of members for TimeTriggeredTask, including all inherited members.
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | TimeTriggeredTask | [inline, private]
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | TimeTriggeredTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | TimeTriggeredTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | TimeTriggeredTask | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | TimeTriggeredTask | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | TimeTriggeredTask | [inline, protected]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | TimeTriggeredTask | [inline, private]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | TimeTriggeredTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | TimeTriggeredTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | TimeTriggeredTask | [inline, private]
rootPage | TimeTriggeredTask | [private]
TimeTriggeredTask() | TimeTriggeredTask | [inline]
TimeTriggeredTask() | TimeTriggeredTask | [inline]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | TimeTriggeredTask | [inline, private]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | TimeTriggeredTask | [inline, private]
UpdateUI() | TimeTriggeredTask | [inline, private]
UpdateUI() | TimeTriggeredTask | [inline, private]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
Button_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Button_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
dispatcher | sealed | [private]
displayChangeToken | sealed | [private]
displayList_listview_SelectionChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e) | sealed | [private]
Footer_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Footer_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Id | sealed |
LoadAndDisplayScreens_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
mainDispatcher | sealed | [private]
MainPage() | sealed |
MainPage() | sealed |
mainViewId | sealed | [private]
MainViewId | sealed |
Name | sealed |
NotifyUser(Platform::String^strMessage, NotifyType type) | sealed | [private]
NotifyUser(Platform::String^strMessage, NotifyType type) | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnProjectionDisplayAvailableChanged(Platform::Object^sender, Platform::Object^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
ProjectionViewPage() | sealed |
ProjectionViewPageControl | sealed |
releasedToken | sealed | [private]
RequestAndStartProjecting_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Scenario1() | sealed |
Scenario2() | sealed |
Scenario3() | sealed |
ScenarioControl_SelectionChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e) | sealed | [private]
ScenarioControl_SelectionChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e) | sealed | [private]
StartProjecting(Windows::Devices::Enumeration::DeviceInformation^selectedDisplay) | sealed | [private]
StartProjecting_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
StartProjecting_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
StopProjecting_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
SwapViews_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
thisViewControl | sealed | [private]
thisViewControl_Released(Platform::Object^sender, Platform::Object^e) | sealed | [private]
thisViewId | sealed | [private]
UpdateTextBlock(bool screenAvailable) | sealed | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewProjectionConstantBuffer Member List

This is the complete list of members for ViewProjectionConstantBuffer, including all inherited members.
viewProjectionLeft | ViewProjectionConstantBuffer
viewProjectionRight | ViewProjectionConstantBuffer
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
_ConfigureWiFiCalled | sealed | [private]
_ConnectCalled | sealed | [private]
_ConnectionResultReceived | sealed | [private]
_GetLastErrorRequested | sealed | [private]
_GetScanInfoCalled | sealed | [private]
_GetStateRequested | sealed | [private]
_GetVersionRequested | sealed | [private]
_OffboardCalled | sealed | [private]
_SessionLost | sealed | [private]
_SessionMemberAdded | sealed |
_SessionMemberRemoved | sealed |
_Stopped | sealed | [private]
AddMethodHandler(_In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_methodhandler_ptr handler) | sealed | [private]
AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler) | sealed |
AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler) | sealed | [private]
AllJoynMessageArgStructure() | sealed | [inline]
BusAttachmentStateChanged(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^sender, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^args) | sealed |
CallConfigureWiFiHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message) | sealed | [private, static]
CallConnectHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message) | sealed | [private, static]
CallConnectionResultReceived(_In_ OnboardingLegacySignals^sender, _In_ OnboardingConnectionResultReceivedEventArgs^args) | sealed |
CallConnectionResultReceived(_In_ OnboardingSignals^sender, _In_ OnboardingConnectionResultReceivedEventArgs^args) | sealed |
CallConnectionResultSignalHandler(_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message) | sealed | [static]
CallConnectionResultSignalHandler(_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message) | sealed | [private, static]
CallGetScanInfoHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message) | sealed | [private, static]
CallOffboardHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message) | sealed | [private, static]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
ConfigureWiFiAsync(_In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType) | sealed |
ConnectAsync() | sealed |
ConnectAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
ConnectionResult(_In_ Onboarding^interfaceMemberArg) | sealed |
ConnectionResult(_In_ Onboarding^interfaceMemberArg) | sealed |
First() | sealed | [inline, virtual]
FromIdAsync(_In_ Platform::String^deviceId) | sealed | [static]
FromIdAsync(_In_ Platform::String^deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed | [static]
GetAt(unsigned int index) | sealed | [inline, virtual]
GetLastErrorAsync() | sealed |
GetLastErrorAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
GetResultAsync(OnboardingConfigureWiFiCalledEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingConnectCalledEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingOffboardCalledEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingGetScanInfoCalledEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingGetVersionRequestedEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingGetStateRequestedEventArgs^args) | sealed | [inline, static]
GetResultAsync(OnboardingGetLastErrorRequestedEventArgs^args) | sealed | [inline, static]
GetScanInfoAsync() | sealed |
GetScanInfoAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
GetStateAsync() | sealed |
GetStateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
GetVersionAsync() | sealed |
GetVersionAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
joiner | sealed |
m_busAttachment | sealed |
m_busAttachmentStateChangedToken | sealed | [private]
m_busObject | sealed |
m_busObject | sealed | [private]
m_completionsRequired | sealed | [private]
m_consumer | sealed | [private]
m_emitter | sealed | [private]
m_interfaceMemberAge | sealed | [private]
m_interfaceMemberArg | sealed |
m_interfaceMemberAuthType | sealed | [private]
m_interfaceMemberPassphrase | sealed | [private]
m_interfaceMemberScanList | sealed | [private]
m_interfaceMemberSSID | sealed | [private]
m_interfaceMemberStatus2 | sealed | [private]
m_interfaceName | sealed | [static]
m_lock | sealed | [private]
m_memberConnectionResult | sealed | [private]
m_messageInfo | sealed | [private]
m_nativeBusAttachment | sealed |
m_nativeBusObject | sealed |
m_proxyBusObject | sealed |
m_raised | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_serviceInterface | sealed | [private]
m_ServiceObjectPath | sealed |
m_session | sealed |
m_sessionId | sealed | [private]
m_sessionListener | sealed |
m_sessionPort | sealed | [private]
m_sessionPortListener | sealed | [private]
m_signals | sealed |
m_signals | sealed | [private]
m_status | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_value | sealed | [private]
m_value | sealed | [private]
m_value | sealed | [private]
m_value2 | sealed |
m_value2 | sealed |
m_weak | sealed |
OffboardAsync() | sealed |
OffboardAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
OnboardingConfigureWiFiCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType) | sealed |
OnboardingConnectCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingConsumer(Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed |
OnboardingConsumer::Initialize(_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^serviceInfo) | sealed |
OnboardingGetLastErrorRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingGetScanInfoCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingGetStateRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingGetVersionRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingOffboardCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
OnboardingProducer(Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed |
OnPropertyGet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val) | sealed |
OnPropertySet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val) | sealed |
OnSessionJoined(_In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner) | sealed |
OnSessionLost(_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason) | sealed |
OnSessionMemberAdded(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | sealed |
OnSessionMemberRemoved(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | sealed |
opts | sealed |
RemoveMemberFromSession(_In_ Platform::String^uniqueName) | sealed |
SourceInterfaces | sealed | [static]
SourceObjects | sealed | [private, static]
Stop() | sealed |
UnregisterFromBus() | sealed | [private]
~OnboardingConsumer() | sealed | [virtual]
~OnboardingProducer() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario3_BgChatServer.xaml.cs Source File

  • BluetoothRfcommChat
  • cs

Scenario3_BgChatServer.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Runtime.InteropServices.WindowsRuntime;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Devices.Bluetooth.Rfcomm;
00016 using Windows.Storage;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class Scenario3_BgChatServer : Page
00028     {
00029         // The background task registration for the background advertisement watcher
00030          private IBackgroundTaskRegistration taskRegistration;
00031          // The watcher trigger used to configure the background task registration
00032          private RfcommConnectionTrigger trigger;
00033          // A name is given to the task in order for it to be identifiable across context.
00034          private string taskName = "Scenario3_BackgroundTask";
00035          // Entry point for the background task.
00036         private string taskEntryPoint = "BackgroundTasks.RfcommServerTask";
00037
00038
00039         // Define the raw bytes that are converted into SDP record
00040         private byte[] sdpRecordBlob = new byte[]
00041         {
00042             0x35, 0x4a,  // DES len = 74 bytes
00043
00044             // Vol 3 Part B 5.1.15 ServiceName
00045             // 34 bytes
00046             0x09, 0x01, 0x00, // UINT16 (0x09) value = 0x0100 [ServiceName]
00047             0x25, 0x1d,       // TextString (0x25) len = 29 bytes
00048                 0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x20,     // Bluetooth <sp>
00049                 0x52, 0x66, 0x63, 0x6f, 0x6d, 0x6d, 0x20,                       // Rfcomm <sp>
00050                 0x43, 0x68, 0x61, 0x74, 0x20,                                   // Chat <sp>
00051                 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,                       // Service
00052             // Vol 3 Part B 5.1.15 ServiceDescription
00053             // 40 bytes
00054             0x09, 0x01, 0x01, // UINT16 (0x09) value = 0x0101 [ServiceDescription]
00055             0x25, 0x23,       // TextString (0x25) = 35 bytes,
00056                 0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x20,     // Bluetooth <sp>
00057                 0x52, 0x66, 0x63, 0x6f, 0x6d, 0x6d, 0x20,                       // Rfcomm <sp>
00058                 0x43, 0x68, 0x61, 0x74, 0x20,                                   // Chat <sp>
00059                 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20,                  // Service <sp>
00060                 0x69, 0x6e, 0x20, 0x43, 0x23                                    // in C#
00061
00062         };
00063
00064
00065
00066         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00067         // as NotifyUser()
00068         MainPage rootPage = MainPage.Current;
00069         public Scenario3_BgChatServer()
00070         {
00071             this.InitializeComponent();
00072             trigger = new RfcommConnectionTrigger();
00073
00074             // Local service Id is the only mandatory field that should be used to filter a known service UUID.
00075             trigger.InboundConnection.LocalServiceId = RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid);
00076
00077             // The SDP record is nice in order to populate optional name and description fields
00078             trigger.InboundConnection.SdpRecord = sdpRecordBlob.AsBuffer();
00079         }
00080
00081         protected override void OnNavigatedTo(NavigationEventArgs e)
00082         {
00083             foreach (var task in BackgroundTaskRegistration.AllTasks)
00084             {
00085                 if (task.Value.Name == taskName)
00086                 {
00087                     AttachProgressAndCompletedHandlers(task.Value);
00088                 }
00089             }
00090         }
00091
00092         private async void ListenButton_Click(object sender, RoutedEventArgs e)
00093         {
00094             ListenButton.IsEnabled = false;
00095             DisconnectButton.IsEnabled = true;
00096
00097             // Registering a background trigger if it is not already registered. Rfcomm Chat Service will now be advertised in the SDP record
00098             // First get the existing tasks to see if we already registered for it
00099
00100             foreach (var task in BackgroundTaskRegistration.AllTasks)
00101             {
00102                 if (task.Value.Name == taskName)
00103                 {
00104                     taskRegistration = task.Value;
00105                     break;
00106                 }
00107             }
00108
00109             if (taskRegistration != null)
00110             {
00111                 rootPage.NotifyUser("Background watcher already registered.", NotifyType.StatusMessage);
00112                 return;
00113             }
00114             else
00115             {
00116                 // Applications registering for background trigger must request for permission.
00117                 BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();
00118
00119                 var builder = new BackgroundTaskBuilder();
00120                 builder.TaskEntryPoint = taskEntryPoint;
00121                 builder.SetTrigger(trigger);
00122                 builder.Name = taskName;
00123
00124                 try
00125                 {
00126                     taskRegistration = builder.Register();
00127                     AttachProgressAndCompletedHandlers(taskRegistration);
00128
00129                     // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
00130                     if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
00131                     {
00132                         rootPage.NotifyUser("Background watcher registered.", NotifyType.StatusMessage);
00133                     }
00134                     else
00135                     {
00136                         rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
00137                     }
00138                 }
00139                 catch (Exception)
00140                 {
00141                     rootPage.NotifyUser("Background task not registered",
00142                             NotifyType.ErrorMessage);
00143                 }
00144             }
00145         }
00146
00147         private void SendButton_Click(object sender, RoutedEventArgs e)
00148         {
00149             SendMessage();
00150         }
00151
00152         public void KeyboardKey_Pressed(object sender, KeyRoutedEventArgs e)
00153         {
00154             if (e.Key == Windows.System.VirtualKey.Enter)
00155             {
00156                 SendMessage();
00157             }
00158         }
00159
00160         /// <summary>
00161         /// Sends the current message in MessageTextBox.  Also makes sure the text is not empty and updates the conversation list.
00162         /// </summary>
00163         private void SendMessage()
00164         {
00165             var message = MessageTextBox.Text;
00166             var previousMessage = (string)ApplicationData.Current.LocalSettings.Values["SendMessage"];
00167
00168             // Make sure previous message has been sent
00169             if ( previousMessage == null || previousMessage == "")
00170             {
00171                 // Save the current message to local settings so the background task can pick it up.
00172                 ApplicationData.Current.LocalSettings.Values["SendMessage"] = message;
00173
00174                 // Clear the messageTextBox for a new message
00175                 MessageTextBox.Text = "";
00176                 ConversationListBox.Items.Add("Sent: " + message);
00177             }
00178             else
00179             {
00180                 // Do nothing until previous message has been sent.
00181             }
00182         }
00183
00184         private void DisconnectButton_Click(object sender, RoutedEventArgs e)
00185         {
00186             Disconnect();
00187         }
00188
00189         /// <summary>
00190         /// Called when background task defferal is completed.  This can happen for a number of reasons (both expected and unexpected).
00191         /// IF this is expected, we'll notify the user.  If it's not, we'll show that this is an error.  Finally, clean up the connection by calling Disconnect().
00192         /// </summary>
00193         /// <param name="sender"></param>
00194         /// <param name="args"></param>
00195         private async void OnCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
00196         {
00197             var settings = ApplicationData.Current.LocalSettings;
00198             if (settings.Values.ContainsKey("TaskCancelationReason"))
00199             {
00200                 await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00201                 {
00202                     rootPage.NotifyUser("Task cancelled unexpectedly - reason: " + settings.Values["TaskCancelationReason"].ToString(), NotifyType.ErrorMessage);
00203                 });
00204             }
00205             else
00206             {
00207                 await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00208                 {
00209                     rootPage.NotifyUser("Background task completed", NotifyType.StatusMessage);
00210                 });
00211             }
00212             try
00213             {
00214                 args.CheckResult();
00215             }
00216             catch (Exception ex)
00217             {
00218                 rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00219             }
00220             Disconnect();
00221         }
00222
00223         /// <summary>
00224         /// Handles UX changes and task registration changes when socket is disconnected
00225         /// </summary>
00226         private async void Disconnect()
00227         {
00228             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00229             {
00230                 ListenButton.IsEnabled = true;
00231                 DisconnectButton.IsEnabled = false;
00232                 ConversationListBox.Items.Clear();
00233
00234                 // Unregistering the background task will remove the Rfcomm Chat Service from the SDP record and stop listening for incoming connections
00235                 // First get the existing tasks to see if we already registered for it
00236                 if (taskRegistration != null)
00237                 {
00238                     taskRegistration.Unregister(true);
00239                     taskRegistration = null;
00240                     rootPage.NotifyUser("Background watcher unregistered.", NotifyType.StatusMessage);
00241                 }
00242                 else
00243                 {
00244                     // At this point we assume we haven't found any existing tasks matching the one we want to unregister
00245                     rootPage.NotifyUser("No registered background watcher found.", NotifyType.StatusMessage);
00246                 }
00247             });
00248
00249         }
00250
00251         /// <summary>
00252         /// The background task updates the progress counter.  When that happens, this event handler gets invoked
00253         /// When the handler is invoked, we will display the value stored in local settings to the user.
00254         /// </summary>
00255         /// <param name="task"></param>
00256         /// <param name="args"></param>
00257         private async void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00258         {
00259
00260             if (ApplicationData.Current.LocalSettings.Values.Keys.Contains("ReceivedMessage"))
00261             {
00262                 string backgroundMessage = (string)ApplicationData.Current.LocalSettings.Values["ReceivedMessage"];
00263                 string remoteDeviceName = (string)ApplicationData.Current.LocalSettings.Values["RemoteDeviceName"];
00264
00265                 if(!backgroundMessage.Equals(""))
00266                 {
00267                     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00268                     {
00269                         rootPage.NotifyUser("Client Connected: " + remoteDeviceName, NotifyType.StatusMessage);
00270                         ConversationListBox.Items.Add("Received: " + backgroundMessage);
00271                     });
00272                 }
00273             }
00274         }
00275
00276         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00277         {
00278             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00279             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00280         }
00281     }
00282 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/WASAPICapture.h Source File

  • WindowsAudioSession
  • cpp

WASAPICapture.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // WASAPICapture.h
00013 //
00014
00015 #include <Windows.h>
00016 #include <wrl\implements.h>
00017 #include <mfapi.h>
00018 #include <AudioClient.h>
00019 #include <mmdeviceapi.h>
00020 #include "MainPage.xaml.h"
00021 #include "DeviceState.h"
00022 #include "PlotData.h"
00023
00024 using namespace Microsoft::WRL;
00025 using namespace Windows::Media::Devices;
00026 using namespace Windows::Storage::Streams;
00027
00028 #define AUDIO_FILE_NAME "WASAPIAudioCapture.wav"
00029 #define FLUSH_INTERVAL_SEC 3
00030
00031
00032 #pragma once
00033
00034 namespace SDKSample
00035 {
00036     namespace WASAPIAudio
00037     {
00038         // User Configurable Arguments for Scenario
00039         struct CAPTUREDEVICEPROPS
00040         {
00041             Platform::Boolean       IsLowLatency;
00042         };
00043
00044         // Primary WASAPI Capture Class
00045         class WASAPICapture :
00046             public RuntimeClass< RuntimeClassFlags< ClassicCom >, FtmBase, IActivateAudioInterfaceCompletionHandler >
00047         {
00048         public:
00049             WASAPICapture();
00050
00051             HRESULT SetProperties(CAPTUREDEVICEPROPS props);
00052             HRESULT InitializeAudioDeviceAsync();
00053             HRESULT StartCaptureAsync();
00054             HRESULT StopCaptureAsync();
00055             HRESULT FinishCaptureAsync();
00056
00057             DeviceStateChangedEvent^ GetDeviceStateEvent() { return m_DeviceStateChanged; };
00058
00059             METHODASYNCCALLBACK( WASAPICapture, StartCapture, OnStartCapture );
00060             METHODASYNCCALLBACK( WASAPICapture, StopCapture, OnStopCapture );
00061             METHODASYNCCALLBACK( WASAPICapture, SampleReady, OnSampleReady );
00062             METHODASYNCCALLBACK( WASAPICapture, FinishCapture, OnFinishCapture );
00063             METHODASYNCCALLBACK( WASAPICapture, SendScopeData, OnSendScopeData );
00064
00065             // IActivateAudioInterfaceCompletionHandler
00066             STDMETHOD(ActivateCompleted)( IActivateAudioInterfaceAsyncOperation *operation );
00067
00068         private:
00069             ~WASAPICapture();
00070
00071             HRESULT OnStartCapture( IMFAsyncResult* pResult );
00072             HRESULT OnStopCapture( IMFAsyncResult* pResult );
00073             HRESULT OnFinishCapture( IMFAsyncResult* pResult );
00074             HRESULT OnSampleReady( IMFAsyncResult* pResult );
00075             HRESULT OnSendScopeData( IMFAsyncResult* pResult );
00076
00077             HRESULT CreateWAVFile();
00078             HRESULT FixWAVHeader();
00079             HRESULT OnAudioSampleRequested( Platform::Boolean IsSilence = false );
00080             HRESULT InitializeScopeData();
00081             HRESULT ProcessScopeData( BYTE* pData, DWORD cbBytes );
00082
00083         private:
00084             Platform::String^   m_DeviceIdString;
00085             UINT32              m_BufferFrames;
00086             HANDLE              m_SampleReadyEvent;
00087             MFWORKITEM_KEY      m_SampleReadyKey;
00088             CRITICAL_SECTION    m_CritSec;
00089             DWORD               m_dwQueueID;
00090
00091             DWORD               m_cbHeaderSize;
00092             DWORD               m_cbDataSize;
00093             DWORD               m_cbFlushCounter;
00094             BOOL                m_fWriting;
00095
00096             IRandomAccessStream^     m_ContentStream;
00097             IOutputStream^           m_OutputStream;
00098             DataWriter^              m_WAVDataWriter;
00099             WAVEFORMATEX            *m_MixFormat;
00100             IAudioClient3           *m_AudioClient;
00101             UINT32                  m_DefaultPeriodInFrames;
00102             UINT32                  m_FundamentalPeriodInFrames;
00103             UINT32                  m_MaxPeriodInFrames;
00104             UINT32                  m_MinPeriodInFrames;
00105             IAudioCaptureClient     *m_AudioCaptureClient;
00106             IMFAsyncResult          *m_SampleReadyAsyncResult;
00107
00108             DeviceStateChangedEvent^       m_DeviceStateChanged;
00109
00110             Platform::Array<int, 1>^    m_PlotData;
00111             UINT32                      m_cPlotDataMax;
00112             UINT32                      m_cPlotDataFilled;
00113
00114             CAPTUREDEVICEPROPS          m_DeviceProps;
00115         };
00116     }
00117 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/CardReader.xaml.cs Source File

  • Nfc
  • Nfc

CardReader.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 using System;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using Pcsc;
00017 using static NfcSample.NfcUtils;
00018 using Windows.Devices.SmartCards;
00019 using System.Threading.Tasks;
00020 using Pcsc.Common;
00021 using SDKTemplate;
00022
00023 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00024
00025 namespace NfcSample
00026 {
00027     /// <summary>
00028     /// An empty page that can be used on its own or navigated to within a Frame.
00029     /// </summary>
00030     public sealed partial class CardReader : Page
00031     {
00032         public CardReader()
00033         {
00034             this.InitializeComponent();
00035         }
00036
00037         SmartCardReader m_cardReader;
00038
00039         protected async override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             // Clear the messages
00042             MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
00043
00044
00045             // First try to find a reader that advertises as being NFC
00046             var deviceInfo = await SmartCardReaderUtils.GetFirstSmartCardReaderInfo(SmartCardReaderKind.Nfc);
00047             if (deviceInfo == null)
00048             {
00049                 // If we didn't find an NFC reader, let's see if there's a "generic" reader meaning we're not sure what type it is
00050                 deviceInfo = await SmartCardReaderUtils.GetFirstSmartCardReaderInfo(SmartCardReaderKind.Any);
00051             }
00052
00053             if (deviceInfo == null)
00054             {
00055                 LogMessage("NFC card reader mode not supported on this device", NotifyType.ErrorMessage);
00056                 return;
00057             }
00058
00059             if (!deviceInfo.IsEnabled)
00060             {
00061                 var msgbox = new Windows.UI.Popups.MessageDialog("Your NFC proximity setting is turned off, you will be taken to the NFC proximity control panel to turn it on");
00062                 msgbox.Commands.Add(new Windows.UI.Popups.UICommand("OK"));
00063                 await msgbox.ShowAsync();
00064
00065                 // This URI will navigate the user to the NFC proximity control panel
00066                 NfcUtils.LaunchNfcProximitySettingsPage();
00067                 return;
00068             }
00069
00070             if (m_cardReader == null)
00071             {
00072                 m_cardReader = await SmartCardReader.FromIdAsync(deviceInfo.Id);
00073                 m_cardReader.CardAdded += cardReader_CardAdded;
00074                 m_cardReader.CardRemoved += cardReader_CardRemoved;
00075             }
00076         }
00077
00078         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00079         {
00080             // Clean up
00081             if (m_cardReader != null)
00082             {
00083                 m_cardReader.CardAdded -= cardReader_CardAdded;
00084                 m_cardReader.CardRemoved -= cardReader_CardRemoved;
00085                 m_cardReader = null;
00086             }
00087
00088             base.OnNavigatingFrom(e);
00089         }
00090
00091         private void cardReader_CardRemoved(SmartCardReader sender, CardRemovedEventArgs args)
00092         {
00093             LogMessage("Card removed");
00094         }
00095
00096         private async void cardReader_CardAdded(SmartCardReader sender, CardAddedEventArgs args)
00097         {
00098             await HandleCard(args.SmartCard);
00099         }
00100
00101         /// <summary>
00102         /// Sample code to handle a couple of different cards based on the identification process
00103         /// </summary>
00104         /// <returns>None</returns>
00105         private async Task HandleCard(SmartCard card)
00106         {
00107             try
00108             {
00109                 // Clear the messages
00110                 MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
00111
00112                 // Connect to the card
00113                 using (SmartCardConnection connection = await card.ConnectAsync())
00114                 {
00115                     // Try to identify what type of card it was
00116                     IccDetection cardIdentification = new IccDetection(card, connection);
00117                     await cardIdentification.DetectCardTypeAync();
00118                     LogMessage("Connected to card\r\nPC/SC device class: " + cardIdentification.PcscDeviceClass.ToString());
00119                     LogMessage("Card name: " + cardIdentification.PcscCardName.ToString());
00120                     LogMessage("ATR: " + BitConverter.ToString(cardIdentification.Atr));
00121
00122                     if ((cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass) &&
00123                         (cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralightC
00124                         || cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralight
00125                         || cardIdentification.PcscCardName == Pcsc.CardName.MifareUltralightEV1))
00126                     {
00127                         // Handle MIFARE Ultralight
00128                         MifareUltralight.AccessHandler mifareULAccess = new MifareUltralight.AccessHandler(connection);
00129
00130                         // Each read should get us 16 bytes/4 blocks, so doing
00131                         // 4 reads will get us all 64 bytes/16 blocks on the card
00132                         for (byte i = 0; i < 4; i++)
00133                         {
00134                             byte[] response = await mifareULAccess.ReadAsync((byte)(4 * i));
00135                             LogMessage("Block " + (4 * i).ToString() + " to Block " + (4 * i + 3).ToString() + " " + BitConverter.ToString(response));
00136                         }
00137
00138                         byte[] responseUid = await mifareULAccess.GetUidAsync();
00139                         LogMessage("UID:  " + BitConverter.ToString(responseUid));
00140                     }
00141                     else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.MifareDesfire)
00142                     {
00143                         // Handle MIFARE DESfire
00144                         Desfire.AccessHandler desfireAccess = new Desfire.AccessHandler(connection);
00145                         Desfire.CardDetails desfire = await desfireAccess.ReadCardDetailsAsync();
00146
00147                         LogMessage("DesFire Card Details:  " + Environment.NewLine + desfire.ToString());
00148                     }
00149                     else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
00150                         && cardIdentification.PcscCardName == Pcsc.CardName.FeliCa)
00151                     {
00152                         // Handle Felica
00153                         LogMessage("Felica card detected");
00154                         var felicaAccess = new Felica.AccessHandler(connection);
00155                         var uid = await felicaAccess.GetUidAsync();
00156                         LogMessage("UID:  " + BitConverter.ToString(uid));
00157                     }
00158                     else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
00159                         && (cardIdentification.PcscCardName == Pcsc.CardName.MifareStandard1K || cardIdentification.PcscCardName == Pcsc.CardName.MifareStandard4K))
00160                     {
00161                         // Handle MIFARE Standard/Classic
00162                         LogMessage("MIFARE Standard/Classic card detected");
00163                         var mfStdAccess = new MifareStandard.AccessHandler(connection);
00164                         var uid = await mfStdAccess.GetUidAsync();
00165                         LogMessage("UID:  " + BitConverter.ToString(uid));
00166
00167                         ushort maxAddress = 0;
00168                         switch (cardIdentification.PcscCardName)
00169                         {
00170                             case Pcsc.CardName.MifareStandard1K:
00171                                 maxAddress = 0x3f;
00172                                 break;
00173                             case Pcsc.CardName.MifareStandard4K:
00174                                 maxAddress = 0xff;
00175                                 break;
00176                         }
00177                         await mfStdAccess.LoadKeyAsync(MifareStandard.DefaultKeys.FactoryDefault);
00178
00179                         for (ushort address = 0; address <= maxAddress; address++)
00180                         {
00181                             var response = await mfStdAccess.ReadAsync(address, Pcsc.GeneralAuthenticate.GeneralAuthenticateKeyType.MifareKeyA);
00182                             LogMessage("Block " + address.ToString() + " " + BitConverter.ToString(response));
00183                         }
00184                     }
00185                     else if (cardIdentification.PcscDeviceClass == Pcsc.Common.DeviceClass.StorageClass
00186                         && (cardIdentification.PcscCardName == Pcsc.CardName.ICODE1 ||
00187                             cardIdentification.PcscCardName == Pcsc.CardName.ICODESLI ||
00188                             cardIdentification.PcscCardName == Pcsc.CardName.iCodeSL2))
00189                     {
00190                         // Handle ISO15693
00191                         LogMessage("ISO15693 card detected");
00192                         var iso15693Access = new Iso15693.AccessHandler(connection);
00193                         var uid = await iso15693Access.GetUidAsync();
00194                         LogMessage("UID:  " + BitConverter.ToString(uid));
00195                     }
00196                     else
00197                     {
00198                         // Unknown card type
00199                         // Note that when using the XDE emulator the card's ATR and type is not passed through, so we'll
00200                         // end up here even for known card types if using the XDE emulator
00201
00202                         // Some cards might still let us query their UID with the PC/SC command, so let's try:
00203                         var apduRes = await connection.TransceiveAsync(new Pcsc.GetUid());
00204                         if (!apduRes.Succeeded)
00205                         {
00206                             LogMessage("Failure getting UID of card, " + apduRes.ToString());
00207                         }
00208                         else
00209                         {
00210                             LogMessage("UID:  " + BitConverter.ToString(apduRes.ResponseData));
00211                         }
00212                     }
00213                 }
00214             }
00215             catch(Exception ex)
00216             {
00217                 LogMessage("Exception handling card: " + ex.ToString(), NotifyType.ErrorMessage);
00218             }
00219         }
00220     }
00221 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario6_NavToStream.xaml.cs Source File

  • XamlWebView
  • cs

Scenario6_NavToStream.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Runtime.InteropServices.WindowsRuntime;
00015 using System.Threading.Tasks;
00016 using Windows.Foundation;
00017 using Windows.Security.Cryptography;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class Scenario6_NavToStream : Page
00028     {
00029         private StreamUriWinRTResolver myResolver;
00030
00031         public Scenario6_NavToStream()
00032         {
00033             myResolver = new StreamUriWinRTResolver();
00034             this.InitializeComponent();
00035         }
00036
00037         protected override void OnNavigatedTo(NavigationEventArgs e)
00038         {
00039             // The 'Host' part of the URI for the ms-local-stream protocol is a combination of the package name
00040             // and an application-defined key, which identifies the specfic resolver.
00041             // Here, we use 'MyTag'.
00042
00043             Uri url = WebViewControl.BuildLocalStreamUri("MyTag", "/default.html");
00044
00045             // The resolver object needs to be passed in to the navigate call.
00046             WebViewControl.NavigateToLocalStreamUri(url, myResolver);
00047         }
00048
00049         /// <summary>
00050         /// Sample URI resolver object for use with NavigateToLocalStreamUri.
00051         /// The object must implement the IUriToStreamResolver interface
00052         ///
00053         /// Note: If your content is stored in the package or local state,
00054         /// then you can use the ms-appx-web: or ms-appdata: protocol demonstrated in the
00055         /// "Navigate to package and local state" scenario. Those protocols will
00056         /// will create a resolver for you.
00057         /// </summary>
00058         public sealed class StreamUriWinRTResolver : Windows.Web.IUriToStreamResolver
00059         {
00060             /// <summary>
00061             /// The entry point for resolving a URI to a stream.
00062             /// </summary>
00063             /// <param name="uri"></param>
00064             /// <returns></returns>
00065             public IAsyncOperation<IInputStream> UriToStreamAsync(Uri uri)
00066             {
00067                 // Because of the signature of the this method, it can't use await, so we
00068                 // call into a separate helper method that can use the C# await pattern.
00069                 return GetContentAsync(uri).AsAsyncOperation();
00070             }
00071
00072
00073             /// <summary>
00074             /// Helper that produces the contents corresponding to a Uri.
00075             /// Uses the C# await pattern to coordinate async operations.
00076             /// </summary>
00077             /// <param name="uri"></param>
00078             /// <returns></returns>
00079             private async Task<IInputStream> GetContentAsync(Uri uri)
00080             {
00081                 string path = uri.AbsolutePath;
00082                 string contents;
00083
00084                 switch (path)
00085                 {
00086                     case "/default.html":
00087                         contents = await MainPage.LoadStringFromPackageFileAsync("stream_example.html");
00088                         contents = contents.Replace("%", Windows.ApplicationModel.Package.Current.Id.Name);
00089                         break;
00090
00091                     case "/stream.css":
00092                         contents = "p { color: blue; }";
00093                         break;
00094
00095                     default:
00096                         throw new Exception($"Could not resolve URI \"{uri}\"");
00097                 }
00098
00099                 // Convert the string to a stream.
00100                 IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(contents, BinaryStringEncoding.Utf8);
00101                 var stream = new InMemoryRandomAccessStream();
00102                 await stream.WriteAsync(buffer);
00103                 return stream.GetInputStreamAt(0);
00104             }
00105         }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ProjectionViewPage Member List

This is the complete list of members for ProjectionViewPage, including all inherited members.
mainDispatcher | ProjectionViewPage | [private]
mainViewId | ProjectionViewPage | [private]
OnNavigatedTo(NavigationEventArgs e) | ProjectionViewPage | [inline, protected]
ProjectionViewPage() | ProjectionViewPage | [inline]
StopProjecting_Click(object sender, RoutedEventArgs e) | ProjectionViewPage | [inline, private]
SwapViews_Click(object sender, RoutedEventArgs e) | ProjectionViewPage | [inline, private]
thisViewControl | ProjectionViewPage | [private]
thisViewControl_Released(object sender, EventArgs e) | ProjectionViewPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/pch.h Source File

  • Capabilities
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Devices.Geolocation.h"
00008 #include "winrt/Windows.Security.Authorization.AppCapabilityAccess.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario7.xaml.cs Source File

  • MapControl
  • cs

Scenario7.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.Geolocation;
00017 using Windows.Foundation;
00018 using Windows.Storage;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Controls.Maps;
00023
00024 namespace SDKTemplate
00025 {
00026     // A PlaceLocation represents a location in two forms:
00027     // Geoposition (latitude, longitude, altitude)
00028     // Normalized map coordinates in the unit square from (0,0) to (1,1)
00029     public struct PlaceLocation
00030     {
00031         public PlaceLocation(double latitude, double longitude)
00032         {
00033             Geoposition = new BasicGeoposition() { Latitude = latitude, Longitude = longitude };
00034             MapCoordinates = GetMapCoordinates(Geoposition);
00035         }
00036         public BasicGeoposition Geoposition { get; }
00037         public Point MapCoordinates { get; }
00038
00039         static private Point GetMapCoordinates(BasicGeoposition geoposition)
00040         {
00041             // This formula comes from https://msdn.microsoft.com/en-us/library/bb259689.aspx
00042
00043             // Clamp latitude to the range -85.05112878 to 85.05112878.
00044             // This keeps Y in range and avoids the singularity at the pole.
00045             double latitude = Math.Max(Math.Min(geoposition.Latitude, 85.05112878), -85.05112878);
00046
00047             double sinLatitude = Math.Sin(latitude * Math.PI / 180.0);
00048             return new Point
00049             {
00050                 X = (geoposition.Longitude + 180.0) / 360.0,
00051                 Y = 0.5 - Math.Log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4 * Math.PI)
00052             };
00053         }
00054     }
00055
00056     public sealed class PlaceInfo
00057     {
00058         public string Name { get; set; }
00059         public PlaceLocation Location { get; set; }
00060     }
00061
00062     // A cluster is a group of places that are at almost the same location.
00063     public sealed class Cluster
00064     {
00065         public PlaceLocation Location { get; set; }
00066         public IList<PlaceInfo> Places { get; private set; } = new List<PlaceInfo>();
00067     }
00068
00069     public sealed partial class Scenario7 : Page
00070     {
00071         RandomAccessStreamReference[] numberIconReferences = new RandomAccessStreamReference[8];
00072         List<PlaceInfo> places = new List<PlaceInfo>();
00073         Dictionary<int, List<Cluster>> clustersForZoomLevel = new Dictionary<int, List<Cluster>>();
00074
00075         int previousZoomLevel = 0;
00076
00077         public Scenario7()
00078         {
00079             InitializeComponent();
00080
00081             // Prepare the custom icons we use to represent clusters of various sizes.
00082             for (int i = 2; i <= 9; i++)
00083             {
00084                 numberIconReferences[i - 2] = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Numbers/" + i.ToString() + ".png"));
00085             }
00086         }
00087
00088         private async Task LoadPlaceInfoAsync()
00089         {
00090             Uri dataUri = new Uri("ms-appx:///places.txt");
00091
00092             StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
00093             IList<string> lines = await FileIO.ReadLinesAsync(file);
00094
00095             // In the places.txt file, each place is represented by three lines:
00096             // Place name, latitude, and longitude.
00097             for (int i = 0; i < lines.Count; i += 3)
00098             {
00099                 PlaceInfo place = new PlaceInfo
00100                 {
00101                     Name = lines[i],
00102                     Location = new PlaceLocation(double.Parse(lines[i + 1]), double.Parse(lines[i + 2]))
00103                 };
00104
00105                 places.Add(place);
00106             }
00107         }
00108
00109         private async void myMap_Loaded(object sender, RoutedEventArgs e)
00110         {
00111             await LoadPlaceInfoAsync();
00112
00113             // Zoom in to the level that shows all our points of interest.
00114             GeoboundingBox boundingBox = GeoboundingBox.TryCompute(places.Select(place => place.Location.Geoposition));
00115             await myMap.TrySetViewBoundsAsync(boundingBox, null, MapAnimationKind.None);
00116
00117             refreshMapIcons();
00118         }
00119
00120         private void myMap_ZoomLevelChanged(MapControl sender, object args)
00121         {
00122             int intZoomLevel = (int)myMap.ZoomLevel;
00123             if (previousZoomLevel != intZoomLevel)
00124             {
00125                 previousZoomLevel = intZoomLevel;
00126                 refreshMapIcons();
00127             }
00128         }
00129
00130         private void refreshMapIcons()
00131         {
00132             // Erase the old map icons.
00133             myMap.MapElements.Clear();
00134
00135             // Create an icon for each cluster.
00136             foreach (var cluster in GetClustersForZoomLevel(previousZoomLevel))
00137             {
00138                 MapIcon mapIcon = new MapIcon
00139                 {
00140                     Location = new Geopoint(cluster.Location.Geoposition),
00141                     CollisionBehaviorDesired = MapElementCollisionBehavior.RemainVisible,
00142                 };
00143
00144                 if (cluster.Places.Count > 1)
00145                 {
00146                     // The cluster represents more than one place. Use a custom marker that shows
00147                     // how many places are represented by this cluster, and place the marker
00148                     // centered at the cluster.
00149                     mapIcon.Image = numberIconReferences[Math.Min(cluster.Places.Count, 9) - 2];
00150                     mapIcon.NormalizedAnchorPoint = new Point(0.5, 0.5);
00151                 }
00152                 else
00153                 {
00154                     // The cluster represents a single place. Label the cluster with the place name.
00155                     mapIcon.Title = cluster.Places[0].Name;
00156                 }
00157                 myMap.MapElements.Add(mapIcon);
00158             }
00159         }
00160
00161         private List<Cluster> GetClustersForZoomLevel(int zoomLevel)
00162         {
00163             // See if we have built the clusters for this zoom level already.
00164             List<Cluster> clusters;
00165             if (!clustersForZoomLevel.TryGetValue(zoomLevel, out clusters))
00166             {
00167                 // No. Go build them, and then cache it for next time.
00168                 clusters = BuildClustersForZoomLevel(zoomLevel);
00169                 clustersForZoomLevel[zoomLevel] = clusters;
00170             }
00171             return clusters;
00172         }
00173
00174         // Note that we use a very simple clustering algorithm for the purpose of this sample.
00175         // The algorithm is sensitive to the order of the items in the "places" list.
00176         private List<Cluster> BuildClustersForZoomLevel(int zoomLevel)
00177         {
00178             // For a particular zoom level, the map is 2^(zoomLevel + 8) pixels wide.
00179             // See https://msdn.microsoft.com/en-us/library/bb259689.aspx for more information.
00180             double scale = Math.Pow(2, zoomLevel + 8);
00181
00182             // Say that each cluster covers a 100-pixel radius.
00183             const double clusterRadius = 100.0;
00184
00185             double scaledclusterRadius = clusterRadius / scale;
00186
00187             List<Cluster> clusters = new List<Cluster>();
00188             foreach (PlaceInfo place in places)
00189             {
00190                 // Look for a cluster that is close to this place. If there is more than one,
00191                 // we pick the first one arbitrarily.
00192                 Cluster cluster = clusters.Where(c => ArePointsNear(place.Location.MapCoordinates, c.Location.MapCoordinates, scaledclusterRadius)).FirstOrDefault();
00193
00194                 if (cluster == null)
00195                 {
00196                     // No such cluster exists yet. Make one.
00197                     cluster = new Cluster() { Location = place.Location };
00198                     clusters.Add(cluster);
00199                 }
00200                 // Add the place to that cluster.
00201                 cluster.Places.Add(place);
00202             }
00203
00204             // Update the Location of each cluster to the center of all the places within it.
00205             foreach (var cluster in clusters)
00206             {
00207                 cluster.Location = CalculateCenter(cluster.Places);
00208             }
00209
00210             return clusters;
00211         }
00212
00213         // Note that this algorithm breaks down if the points straddle longitude +180/-180.
00214         private bool ArePointsNear(Point point1, Point point2, double threshold)
00215         {
00216             double dx = point1.X - point2.X;
00217             double dy = point1.Y - point2.Y;
00218             double distanceSquared = dx * dx + dy * dy;
00219             return distanceSquared < threshold * threshold;
00220         }
00221
00222         // Calculate the center of the cluster by taking the average longitude and latitude.
00223         // Note that this algorithm breaks down if the points straddle longitude +180/-180.
00224         private PlaceLocation CalculateCenter(IList<PlaceInfo> places)
00225         {
00226             double totalLatitude = 0.0;
00227             double totalLongitude = 0.0;
00228
00229             foreach (PlaceInfo place in places)
00230             {
00231                 totalLatitude += place.Location.Geoposition.Latitude;
00232                 totalLongitude += place.Location.Geoposition.Longitude;
00233             }
00234
00235             return new PlaceLocation(totalLatitude / places.Count, totalLongitude / places.Count);
00236         }
00237     }
00238 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/SampleConfiguration.h Source File

  • Syndication
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return ref new Platform::String(L"Syndication (CPP)");
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         bool TryGetUri(Platform::String^ uriString, Windows::Foundation::Uri^* uri)
00039         {
00040             // Create a Uri instance and catch exceptions related to invalid input. This method returns 'true'
00041             // if the Uri instance was successfully created and 'false' otherwise.
00042             try
00043             {
00044                 *uri = ref new Windows::Foundation::Uri(StringTrimmer::Trim(uriString));
00045                 return true;
00046             }
00047             catch (Platform::NullReferenceException^ exception)
00048             {
00049                 NotifyUser("Error: URI must not be null or empty.", NotifyType::ErrorMessage);
00050             }
00051             catch (Platform::InvalidArgumentException^ exception)
00052             {
00053                 NotifyUser("Error: Invalid URI", NotifyType::ErrorMessage);
00054             }
00055
00056             return false;
00057         }
00058
00059     private:
00060         static Platform::Array<Scenario>^ scenariosInner;
00061     };
00062
00063     public value struct Scenario
00064     {
00065         Platform::String^ Title;
00066         Platform::String^ ClassName;
00067     };
00068
00069     class StringTrimmer
00070     {
00071     public:
00072         static Platform::String^ Trim(Platform::String^ s)
00073         {
00074             const WCHAR* first = s->Begin();
00075             const WCHAR* last = s->End();
00076
00077             while (first != last && iswspace(*first))
00078             {
00079                 ++first;
00080             }
00081
00082             while (first != last && iswspace(last[-1]))
00083             {
00084                 --last;
00085             }
00086
00087             return ref new Platform::String(first, static_cast<unsigned int>(last - first));
00088         }
00089     };
00090
00091     [Windows::UI::Xaml::Data::Bindable]
00092     public ref class BindableNode sealed
00093     {
00094     public:
00095         BindableNode(Platform::String^ nodeName, Platform::String^ nodeNamespace, Platform::String^ nodeValue)
00096         {
00097             this->NodeName = nodeName;
00098             this->NodeNamespace = nodeNamespace;
00099             this->NodeValue = nodeValue;
00100         }
00101
00102         property Platform::String^ NodeName
00103         {
00104             Platform::String^ get()
00105             {
00106                 return nodeName;
00107             }
00108             void set(Platform::String^ value)
00109             {
00110                 nodeName = value;
00111             }
00112         }
00113
00114         property Platform::String^ NodeNamespace
00115         {
00116             Platform::String^ get()
00117             {
00118                 return nodeNamespace;
00119             }
00120             void set(Platform::String^ value)
00121             {
00122                 nodeNamespace = value;
00123             }
00124         }
00125
00126         property Platform::String^ NodeValue
00127         {
00128             Platform::String^ get()
00129             {
00130                 return nodeValue;
00131             }
00132             void set(Platform::String^ value)
00133             {
00134                 nodeValue = value;
00135             }
00136         }
00137
00138     private:
00139         Platform::String^ nodeName;
00140         Platform::String^ nodeNamespace;
00141         Platform::String^ nodeValue;
00142     };
00143 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario1_CachedNetworks.xaml.cpp Source File

  • WiFiScan
  • cpp

Scenario1_CachedNetworks.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_CachedNetworks.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace SDKTemplate::WiFiScan;
00017
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Globalization::DateTimeFormatting;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace concurrency;
00032 using namespace Windows::Devices::WiFi;
00033
00034 Scenario1_CachedNetworks::Scenario1_CachedNetworks() : _rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario1_CachedNetworks::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00040 {
00041     auto button = (Button^)sender;
00042     auto index = (int)button->Tag;
00043
00044     // Accessing the NetworkReport property from the WiFiAdapter does not trigger any scans.
00045     // The NetworkReport will have the report generated by the last scan on the system; the
00046     // scan need not be generated by the app.
00047     DisplayNetworkReport(_wiFiAdapters->GetAt(index)->NetworkReport, _wiFiAdapters->GetAt(index));
00048 }
00049
00050 void Scenario1_CachedNetworks::OnNavigatedTo(NavigationEventArgs^ e)
00051 {
00052     ResultCollection = ref new Vector<WiFiNetworkDisplay^>();
00053     DataContext = this;
00054
00055     // RequestAccessAsync must have been called at least once by the app before using the API
00056     // Calling it multiple times is fine but not necessary
00057     // RequestAccessAsync must be called from the UI thread
00058     auto requestAccessOperation = WiFiAdapter::RequestAccessAsync();
00059     auto requestAccessTask = create_task(requestAccessOperation);
00060
00061     requestAccessTask.then([this](WiFiAccessStatus result)
00062     {
00063         if (result != WiFiAccessStatus::Allowed)
00064         {
00065             _rootPage->NotifyUser(L"Access denied", SDKTemplate::NotifyType::ErrorMessage);
00066         }
00067         else
00068         {
00069             auto wiFiAdaptersOperation = WiFiAdapter::FindAllAdaptersAsync();
00070             auto wiFiAdaptersTask = create_task(wiFiAdaptersOperation);
00071
00072             wiFiAdaptersTask.then([this](IVectorView<WiFiAdapter^>^ adapters)
00073             {
00074                 _wiFiAdapters = adapters;
00075
00076                 int index = 0;
00077                 for (auto adapter : _wiFiAdapters)
00078                 {
00079                     auto button = ref new Button();
00080                     button->Tag = index;
00081
00082                     button->Content = L"WiFi Adapter " + (++index);
00083                     button->Click += ref new RoutedEventHandler(this, &Scenario1_CachedNetworks::Button_Click);
00084                     Buttons->Children->Append(button);
00085                 }
00086             });
00087         }
00088     });
00089 }
00090
00091 void Scenario1_CachedNetworks::DisplayNetworkReport(WiFiNetworkReport^ report, WiFiAdapter^ adapter)
00092 {
00093     auto timestampString = DateTimeFormatter::LongDate->Format(report->Timestamp);
00094     auto message = L"Network Report Timestamp: " + timestampString;
00095     // there is no guarantee of what thread the AvailableNetworksChanged callback is run on
00096     _rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00097         ref new DispatchedHandler([this, message]
00098     {
00099         _rootPage->NotifyUser(message, SDKTemplate::NotifyType::StatusMessage);
00100     }));
00101
00102     ResultCollection->Clear();
00103     for (auto network : report->AvailableNetworks)
00104     {
00105         ResultCollection->Append(ref new WiFiNetworkDisplay(network, adapter));
00106     }
00107 }
Generated on Fri Nov 15 2024 22:22:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/SampleOverlay.h Source File

  • DWriteColorGlyph
  • cpp

SampleOverlay.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "DirectXHelper.h"
00011 #include "DeviceResources.h"
00012
00013 // This class is responsible for initializing and rendering the title overlay visible
00014 // at the top of the DirectX SDK samples.
00015 namespace DWriteColorTextRenderer
00016 {
00017     class SampleOverlay
00018     {
00019     public:
00020         SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption);
00021         void CreateDeviceDependentResources();
00022         void CreateWindowSizeDependentResources();
00023         void ReleaseDeviceDependentResources();
00024         void Render();
00025         float GetTitleHeightInDips();
00026
00027     private:
00028         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00029
00030         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>    m_whiteBrush;
00031         Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>  m_stateBlock;
00032
00033         Microsoft::WRL::ComPtr<ID2D1Bitmap>             m_logoBitmap;
00034         Microsoft::WRL::ComPtr<IDWriteTextLayout>       m_textLayout;
00035
00036         UINT                                            m_idIncrement;
00037         bool                                            m_drawOverlay;
00038         std::wstring                                    m_caption;
00039         float                                           m_padding;
00040         float                                           m_textVerticalOffset;
00041         D2D1_SIZE_F                                     m_logoSize;
00042         float                                           m_overlayWidth;
00043     };
00044 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/Scenario3_Choosing.cpp Source File

  • PresenceSensor
  • cppwinrt

Scenario3_Choosing.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleConfiguration.h"
00014 #include "Scenario3_Choosing.h"
00015 #include "Scenario3_Choosing.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Devices::Enumeration;
00019 using namespace Windows::Devices::Sensors;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Globalization::DateTimeFormatting;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 namespace winrt::SDKTemplate::implementation
00029 {
00030     Scenario3_Choosing::Scenario3_Choosing()
00031     {
00032         InitializeComponent();
00033     }
00034
00035     void Scenario3_Choosing::OnNavigatedFrom(NavigationEventArgs const&)
00036     {
00037         if (watcher != nullptr)
00038         {
00039             watcher.Stop();
00040         }
00041     }
00042
00043     fire_and_forget Scenario3_Choosing::ScenarioPick_Click(IInspectable const&, RoutedEventArgs const&)
00044     {
00045         DevicePicker picker;
00046         picker.Appearance().Title(L"Select a presence sensor from which to read data");
00047         picker.Filter().SupportedDeviceSelectors().Append(HumanPresenceSensor::GetDeviceSelector());
00048
00049         // Calculate the position of the button next to which we will place the picker.
00050         GeneralTransform transform = ScenarioPickButton().TransformToVisual(nullptr);
00051         Rect rect = transform.TransformBounds({ 0.0, 0.0, static_cast<float>(ScenarioPickButton().ActualWidth()), static_cast<float>(ScenarioPickButton().ActualHeight()) });
00052
00053         DeviceInformation deviceInfo = co_await picker.PickSingleDeviceAsync(rect);
00054         if (deviceInfo != nullptr)
00055         {
00056             co_await ReadOneReadingFromSensorAsync(deviceInfo);
00057         }
00058     }
00059
00060     /// <summary>
00061     /// Invoked when the device watcher finds a presence sensor
00062     /// </summary>
00063     /// <param name="sender">The device watcher</param>
00064     /// <param name="device">Device information for the presence sensor that was found</param>
00065     fire_and_forget Scenario3_Choosing::OnHumanPresenceSensorAdded(DeviceWatcher const&, DeviceInformation deviceInfo)
00066     {
00067         auto lifetime = get_strong();
00068         co_await resume_foreground(Dispatcher());
00069
00070         // The app can optionally ignore sensors which do not satisfy desired criteria.
00071         // This sample does not apply any filter. See the DeviceEnumerationAndPairing sample
00072         // for more advanced ways of presenting a list of devices.
00073
00074         ListBoxItem item;
00075         item.Content(box_value(deviceInfo.Name()));
00076         item.Tag(deviceInfo);
00077         SensorsList().Items().Append(item);
00078     }
00079
00080     /// <summary>
00081     /// Invoked when a presence sensor is removed from the system
00082     /// </summary>
00083     /// <param name="sender">The device watcher</param>
00084     /// <param name="device">Device information for the presence sensor that was removed</param>
00085     fire_and_forget Scenario3_Choosing::OnHumanPresenceSensorRemoved(DeviceWatcher const&, DeviceInformationUpdate update)
00086     {
00087         auto lifetime = get_strong();
00088         co_await resume_foreground(Dispatcher());
00089
00090         // Look for the sensor that was removed from the system and erase it from the ListBox.
00091         hstring removedId = update.Id();
00092
00093         ItemCollection items = SensorsList().Items();
00094         uint32_t itemCount = items.Size();
00095         for (uint32_t index = 0; index < itemCount; index++)
00096         {
00097             ListBoxItem item = items.GetAt(index).as<ListBoxItem>();
00098             DeviceInformation itemDeviceInfo = item.Tag().as<DeviceInformation>();
00099             if (itemDeviceInfo.Id() == removedId)
00100             {
00101                 items.RemoveAt(index);
00102                 break;
00103             }
00104         }
00105     }
00106
00107     /// <summary>
00108     /// Invoked when a presence sensor's properties change
00109     /// </summary>
00110     /// <param name="sender">The device watcher</param>
00111     /// <param name="device">Device information for the presence sensor that changed</param>
00112     fire_and_forget Scenario3_Choosing::OnHumanPresenceSensorUpdated(DeviceWatcher const&, DeviceInformationUpdate update)
00113     {
00114         auto lifetime = get_strong();
00115         co_await resume_foreground(Dispatcher());
00116
00117         // Look for the sensor that was updated.
00118         hstring updatedId = update.Id();
00119         for (IInspectable itemInspectable : SensorsList().Items())
00120         {
00121             ListBoxItem item = itemInspectable.as<ListBoxItem>();
00122             DeviceInformation itemDeviceInfo = item.Tag().as<DeviceInformation>();
00123             if (itemDeviceInfo.Id() == updatedId)
00124             {
00125                 // Update the DeviceInformation for the sensor that updated.
00126                 itemDeviceInfo.Update(update);
00127                 // Refresh the device name, in case it changed.
00128                 item.Content(box_value(itemDeviceInfo.Name()));
00129                 break;
00130             }
00131         }
00132     }
00133
00134     fire_and_forget Scenario3_Choosing::OnHumanPresenceSensorEnumerationCompleted(DeviceWatcher const&, IInspectable const&)
00135     {
00136         auto lifetime = get_strong();
00137         co_await resume_foreground(Dispatcher());
00138
00139         rootPage.NotifyUser(L"All sensors found. Monitoring for changes...", NotifyType::StatusMessage);
00140     }
00141
00142     void Scenario3_Choosing::ScenarioStart_Click(IInspectable const&, RoutedEventArgs const&)
00143     {
00144         SensorsList().Items().Clear();
00145
00146         watcher = DeviceInformation::CreateWatcher(HumanPresenceSensor::GetDeviceSelector());
00147         watcher.Added({ get_weak(), &Scenario3_Choosing::OnHumanPresenceSensorAdded });
00148         watcher.Removed({ get_weak(), &Scenario3_Choosing::OnHumanPresenceSensorRemoved });
00149         watcher.Updated({ get_weak(), &Scenario3_Choosing::OnHumanPresenceSensorUpdated });
00150         watcher.EnumerationCompleted({ get_weak(), &Scenario3_Choosing::OnHumanPresenceSensorEnumerationCompleted });
00151         watcher.Start();
00152
00153         rootPage.NotifyUser(L"Looking for sensors...", NotifyType::StatusMessage);
00154
00155         ScenarioStartButton().IsEnabled(false);
00156         ScenarioStopButton().IsEnabled(true);
00157     }
00158
00159     void Scenario3_Choosing::ScenarioStop_Click(IInspectable const&, RoutedEventArgs const&)
00160     {
00161         watcher.Stop();
00162         watcher = nullptr;
00163
00164         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00165
00166         ScenarioStartButton().IsEnabled(true);
00167         ScenarioStopButton().IsEnabled(false);
00168     }
00169
00170     fire_and_forget Scenario3_Choosing::ScenarioReadSelected_Click(IInspectable const&, RoutedEventArgs const&)
00171     {
00172         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00173
00174         ListBoxItem item = SensorsList().SelectedItem().as<ListBoxItem>();
00175         if (item == nullptr)
00176         {
00177             rootPage.NotifyUser(L"No sensor is selected.", NotifyType::ErrorMessage);
00178             co_return;
00179         }
00180
00181         DeviceInformation selectedInfo = item.Tag().as<DeviceInformation>();
00182         co_await ReadOneReadingFromSensorAsync(selectedInfo);
00183     }
00184
00185     // Obtains a sensor described by the DeviceInformation and reads one reading from it.
00186     IAsyncAction Scenario3_Choosing::ReadOneReadingFromSensorAsync(DeviceInformation deviceInfo)
00187     {
00188         HumanPresenceSensor sensor{ nullptr };
00189         try
00190         {
00191             sensor = co_await HumanPresenceSensor::FromIdAsync(deviceInfo.Id());
00192         }
00193         catch (hresult_access_denied const&)
00194         {
00195             // The user denied this app presence sensor access.
00196             sensor = nullptr;
00197         }
00198
00199         EngagementStateTextBlock().Text(L"No data");
00200         DetectionStateTextBlock().Text(L"No data");
00201         TimestampTextBlock().Text(L"No data");
00202         DetectionDistanceTextBlock().Text(L"No data");
00203
00204
00205         if (sensor != nullptr)
00206         {
00207             HumanPresenceSensorReading reading{ nullptr };
00208             try
00209             {
00210                 reading = sensor.GetCurrentReading();
00211             }
00212             catch (hresult_access_denied const&)
00213             {
00214                 // The user denied this app presence sensor access.
00215                 reading = nullptr;
00216             }
00217
00218             if (reading != nullptr)
00219             {
00220                 if (sensor.IsEngagementSupported())
00221                 {
00222                     EngagementStateTextBlock().Text(to_hstring(reading.Engagement()));
00223                 }
00224                 else
00225                 {
00226                     EngagementStateTextBlock().Text(L"Not Supported");
00227                 }
00228
00229                 if (sensor.IsPresenceSupported())
00230                 {
00231                     DetectionStateTextBlock().Text(to_hstring(reading.Presence()));
00232                 }
00233                 else
00234                 {
00235                     DetectionStateTextBlock().Text(L"Not Supported");
00236                 }
00237
00238                 // Show the detection distance, if available
00239                 IReference<uint32_t> distance = reading.DistanceInMillimeters();
00240                 DetectionDistanceTextBlock().Text(distance == nullptr ? L"Unavailable" : to_hstring(distance.Value()));
00241
00242                 TimestampTextBlock().Text(DateTimeFormatter(L"shortdate longtime").Format(reading.Timestamp()));
00243             }
00244         }
00245         else
00246         {
00247             rootPage.NotifyUser(L"Could not access sensor " +deviceInfo.Name(), NotifyType::ErrorMessage);
00248         }
00249     }
00250 }
Generated on Fri Nov 15 2024 22:20:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/CalibrationBar.xaml.h Source File

  • Compass
  • cpp

CalibrationBar.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // CalibrationBar.xaml.h
00014 // Declaration of the CalibrationBar class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "CalibrationBar.g.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class CalibrationBar sealed
00029     {
00030     public:
00031         CalibrationBar();
00032
00033         void Hide();
00034         void RequestCalibration(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00035
00036     private:
00037         // Constants specifying when the calibration bar is shown:
00038         //   * suppress duration determines how long (in ticks) to wait before
00039         //     showing the calibration bar again
00040         //   * auto dismiss time determines when to auto dismiss the bar
00041         //     if it's shown too long
00042         static const ULONGLONG SUPPRESS_DURATION_APPROXIMATE_TICKS = 6000000000; // 10 minutes
00043         static const ULONGLONG SUPPRESS_DURATION_UNRELIABLE_TICKS = 3000000000; // 5 minutes
00044         static const LONGLONG CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS = 300000000; // 30 seconds
00045
00046         ULARGE_INTEGER _lastCalibrationTime;
00047         bool _barDismissed;
00048         Windows::UI::Xaml::DispatcherTimer^ _calibrationTimer;
00049         Windows::Foundation::EventRegistrationToken _windowSizeEventToken;
00050
00051         void InvalidateLayout();
00052         bool CanShowCalibrationBar(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00053         void ShowGuidance();
00054         void HideGuidance();
00055
00056         void ShowGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00057         void HideGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00058         void DismissPopup_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00059         void OnAutoDismissTimerExpired(Platform::Object^ sender, Platform::Object^ e);
00060         void OnWindowSizeChanged(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
00061     };
00062 }
Generated on Fri Nov 15 2024 22:18:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
_applicationResumingEventToken | sealed | [private]
_applicationSuspendingEventToken | sealed | [private]
_captureFolder | sealed | [private]
_deviceOrientation | sealed | [private]
_displayInformation | sealed | [private]
_displayInformationEventToken | sealed | [private]
_displayOrientation | sealed | [private]
_displayRequest | sealed | [private]
_externalCamera | sealed | [private]
_faceDetectedEventToken | sealed | [private]
_faceDetectionEffect | sealed | [private]
_hardwareCameraButtonEventToken | sealed | [private]
_isInitialized | sealed | [private]
_isRecording | sealed | [private]
_mediaCapture | sealed | [private]
_mediaCaptureFailedEventToken | sealed | [private]
_mediaControlPropChangedEventToken | sealed | [private]
_mirroringPreview | sealed | [private]
_orientationChangedEventToken | sealed | [private]
_orientationSensor | sealed | [private]
_previewProperties | sealed | [private]
_recordLimitationExceededEventToken | sealed | [private]
_systemMediaControls | sealed | [private]
Application_Resuming(Object^sender, Object^args) | sealed | [private]
Application_Suspending(Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
CleanupCameraAsync() | sealed | [private]
CleanUpFaceDetectionEffectAsync() | sealed | [private]
CleanupUiAsync() | sealed | [private]
ConvertDeviceOrientationToDegrees(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
ConvertDisplayOrientationToDegrees(Windows::Graphics::Display::DisplayOrientations orientation) | sealed | [private]
ConvertOrientationToPhotoOrientation(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
ConvertPreviewToUiRectangle(Windows::Graphics::Imaging::BitmapBounds faceBoxInPreviewCoordinates) | sealed | [private]
CreateFaceDetectionEffectAsync() | sealed | [private]
DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation^sender, Object^args) | sealed | [private]
EmptyTask() | sealed | [private]
Encoder | sealed |
FaceDetectionButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
FaceDetectionEffect_FaceDetected(Windows::Media::Core::FaceDetectionEffect^sender, Windows::Media::Core::FaceDetectedEventArgs^args) | sealed | [private]
File | sealed |
FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel) | sealed | [private]
GetCameraOrientation() | sealed | [private]
GetPreviewStreamRectInControl(Windows::Media::MediaProperties::VideoEncodingProperties^previewResolution, Windows::UI::Xaml::Controls::CaptureElement^previewControl) | sealed | [private]
HardwareButtons_CameraPress(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
HardwareButtons_CameraPressed(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
HighlightDetectedFaces(Windows::Foundation::Collections::IVectorView< Windows::Media::FaceAnalysis::DetectedFace^>^faces) | sealed | [private]
InitializeCameraAsync() | sealed | [private]
MainPage() | sealed |
MediaCapture_Failed(Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs) | sealed | [private]
MediaCapture_RecordLimitationExceeded(Windows::Media::Capture::MediaCapture^currentCaptureObject) | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
Orientation | sealed |
OrientationSensor_OrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^) | sealed | [private]
PhotoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ReencodeAndSavePhotoAsync(Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation) | sealed | [private]
RegisterEventHandlers() | sealed | [private]
RotationKey | sealed | [private]
SetFacesCanvasRotation() | sealed | [private]
SetPreviewRotationAsync() | sealed | [private]
SetupUiAsync() | sealed | [private]
StartPreviewAsync() | sealed | [private]
StartRecordingAsync() | sealed | [private]
StopPreviewAsync() | sealed | [private]
StopRecordingAsync() | sealed | [private]
SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args) | sealed | [private]
TakePhotoAsync() | sealed | [private]
UnregisterEventHandlers() | sealed | [private]
UpdateButtonOrientation() | sealed | [private]
UpdateCaptureControls() | sealed | [private]
VideoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
WriteException(Platform::Exception^ex) | sealed | [private]
WriteLine(Platform::String^str) | sealed | [private]
~MainPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Welcome Member List

This is the complete list of members for Scenario1_Welcome, including all inherited members.
rootPage | Scenario1_Welcome | [private]
Scenario1_Welcome() | Scenario1_Welcome | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

User Member List

This is the complete list of members for User, including all inherited members.
Education() | User | [inline]
educationKey | User | [inline, private, static]
Id() | User | [inline]
Id(hstring const &value) | User | [inline]
idKey | User | [inline, private, static]
m_education | User | [private]
m_id | User | [private]
m_name | User | [private]
m_phone | User | [private]
m_timezone | User | [private]
m_verified | User | [private]
Name() | User | [inline]
Name(hstring const &value) | User | [inline]
nameKey | User | [inline, private, static]
Phone() | User | [inline]
Phone(hstring const &value) | User | [inline]
phoneKey | User | [inline, private, static]
Stringify() | User |
Timezone() | User | [inline]
Timezone(double value) | User | [inline]
timezoneKey | User | [inline, private, static]
User() | User |
User(hstring const &jsonString) | User |
Verified() | User | [inline]
Verified(bool value) | User | [inline]
verifiedKey | User | [inline, private, static]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario2_Stats.h Source File

  • Calendar
  • cppwinrt

Scenario2_Stats.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Stats.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario2_Stats : Scenario2_StatsT<Scenario2_Stats>
00019     {
00020         Scenario2_Stats();
00021
00022         void ShowResults_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario2_Stats : Scenario2_StatsT<Scenario2_Stats, implementation::Scenario2_Stats>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario3_Events.xaml.h Source File

  • XamlCommanding
  • cpp

Scenario3_Events.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Events.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario3_Events sealed
00023     {
00024     public:
00025         Scenario3_Events();
00026
00027     private:
00028         void CommandBar_Opening(Platform::Object^ sender, Platform::Object^ e);
00029         void CommandBar_Closing(Platform::Object^ sender, Platform::Object^ e);
00030         void CommandBar_Opened(Platform::Object^ sender, Platform::Object^ e);
00031         void CommandBar_Closed(Platform::Object^ sender, Platform::Object^ e);
00032     };
00033 }
Generated on Fri Nov 15 2024 22:22:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Scenario1.cpp Source File

  • MultipleViews
  • cppwinrt

Scenario1.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1.h"
00014 #include "Scenario1.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include "SizePreferenceString.h"
00017 #include "ViewLifetimeControl.h"
00018
00019 using namespace winrt;
00020 using namespace Windows::ApplicationModel::Core;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI::ViewManagement;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 static hstring DEFAULT_TITLE = L"New window";
00029
00030 namespace winrt::SDKTemplate::implementation
00031 {
00032     Scenario1::Scenario1()
00033     {
00034         InitializeComponent();
00035     }
00036
00037     void Scenario1::OnNavigatedTo(NavigationEventArgs const&)
00038     {
00039         SizePreferenceChooser().ItemsSource(GenerateSizePreferenceBinding());
00040         SizePreferenceChooser().SelectedIndex(0);
00041
00042         // "UseNone" is not a valid choice for the incoming view, so only include
00043         // it in the anchor size preference chooser
00044         auto anchorSizeChoices = GenerateSizePreferenceBinding();
00045         anchorSizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseNone, L"UseNone"));
00046         AnchorSizePreferenceChooser().ItemsSource(anchorSizeChoices);
00047         AnchorSizePreferenceChooser().SelectedIndex(0);
00048
00049         // This collection is being bound to the current thread.
00050         // So, make sure you only update the collection and items
00051         // contained in it from this thread.
00052         ViewChooser().ItemsSource(SampleState::SecondaryViews);
00053     }
00054
00055     IObservableVector<IInspectable> Scenario1::GenerateSizePreferenceBinding()
00056     {
00057         auto sizeChoices = single_threaded_observable_vector<IInspectable>();
00058
00059         sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::Default, L"Default"));
00060         sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseHalf, L"UseHalf"));
00061         sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseLess, L"UseLess"));
00062         sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseMinimum, L"UseMinimum"));
00063         sizeChoices.Append(make<SizePreferenceString>(ViewSizePreference::UseMore, L"UseMore"));
00064
00065         return sizeChoices;
00066     }
00067
00068     fire_and_forget Scenario1::CreateView_Click(IInspectable const&, RoutedEventArgs const&)
00069     {
00070         auto lifetime = get_strong();
00071
00072         // Set up the secondary view, but don't show it yet
00073         co_await resume_foreground(CoreApplication::CreateNewView().Dispatcher());
00074
00075         // We are now in the newly-created window.
00076
00077         // This object is used to keep track of the views and important
00078         // details about the contents of those views across threads
00079         // In your app, you would probably want to track information
00080         // like the open document or page inside that window
00081
00082         auto newViewControl = ViewLifetimeControl::CreateForCurrentView();
00083         newViewControl.Title(DEFAULT_TITLE);
00084         // Increment the ref count because we just created the view and we have a reference to it
00085         newViewControl.StartViewInUse();
00086
00087         Controls::Frame frame;
00088         frame.Navigate(xaml_typename<SecondaryViewPage>(), newViewControl);
00089
00090         Window::Current().Content(frame);
00091         // This is a change from 8.1: In order for the view to be displayed later it needs to be activated.
00092         Window::Current().Activate();
00093
00094         ApplicationView::GetForCurrentView().Title(newViewControl.Title());
00095
00096         // Be careful! This collection is bound to the main thread,
00097         // so make sure to update it only from that thread.
00098         co_await resume_foreground(SampleState::MainDispatcher);
00099
00100         // We are now back in the main window.
00101         SampleState::SecondaryViews.Append(newViewControl);
00102     }
00103
00104     fire_and_forget Scenario1::ShowAsStandalone_Click(IInspectable const&, RoutedEventArgs const&)
00105     {
00106         auto lifetime = get_strong();
00107
00108         auto selectedView = ViewChooser().SelectedItem().as<SDKTemplate::ViewLifetimeControl>();
00109         auto sizePreference = SizePreferenceChooser().SelectedItem().as<SDKTemplate::SizePreferenceString>();
00110         auto anchorSizePreference = AnchorSizePreferenceChooser().SelectedItem().as<SDKTemplate::SizePreferenceString>();
00111         if (selectedView != nullptr && sizePreference != nullptr && anchorSizePreference != nullptr)
00112         {
00113             try
00114             {
00115                 // Prevent the view from closing while
00116                 // switching to it
00117                 selectedView.StartViewInUse();
00118
00119                 // Show the previously created secondary view, using the size
00120                 // preferences the user specified. In your app, you should
00121                 // choose a size that's best for your scenario and code it
00122                 // instead of requiring the user to decide.
00123                 bool viewShown = co_await ApplicationViewSwitcher::TryShowAsStandaloneAsync(
00124                     selectedView.Id(),
00125                     sizePreference.Preference(),
00126                     ApplicationView::GetForCurrentView().Id(),
00127                     anchorSizePreference.Preference());
00128                 if (!viewShown)
00129                 {
00130                     // The window wasn't actually shown, so StopViewInUse the reference to it
00131                     // This may trigger the window to be destroyed
00132                     rootPage.NotifyUser(L"The view was not shown. Make sure it has focus", NotifyType::ErrorMessage);
00133                 }
00134                 // Signal that switching has completed and let the view close
00135                 selectedView.StopViewInUse();
00136             }
00137             catch (hresult_error& ex)
00138             {
00139                 if (ex.to_abi() == RO_E_CLOSED)
00140                 {
00141                     // The view could be in the process of closing, and
00142                     // this thread just hasn't updated. As part of being closed,
00143                     // this thread will be informed to clean up its list of
00144                     // views (see SecondaryViewPage.cpp)
00145                 }
00146                 else
00147                 {
00148                     throw;
00149                 }
00150             }
00151         }
00152         else
00153         {
00154             rootPage.NotifyUser(L"Please choose a view to show, a size preference for each view", NotifyType::ErrorMessage);
00155         }
00156     }
00157 }
Generated on Fri Nov 15 2024 22:19:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MoveLookController Member List

This is the complete list of members for MoveLookController, including all inherited members.
Active() | MoveLookController |
Active(_In_ bool active) | MoveLookController |
AutoFire() | MoveLookController |
AutoFire(_In_ bool AutoFire) | MoveLookController |
HideCursor() | MoveLookController | [private]
InitWindow(_In_ winrt::Windows::UI::Core::CoreWindow const &window) | MoveLookController |
IsFiring() | MoveLookController |
IsPauseRequested() | MoveLookController |
IsPressComplete() | MoveLookController |
LookDirection() | MoveLookController |
m_autoFire | MoveLookController | [private]
m_back | MoveLookController | [private]
m_buttonInUse | MoveLookController | [private]
m_buttonLowerRight | MoveLookController | [private]
m_buttonPointerID | MoveLookController | [private]
m_buttonPressed | MoveLookController | [private]
m_buttonUpperLeft | MoveLookController | [private]
m_down | MoveLookController | [private]
m_fireInUse | MoveLookController | [private]
m_fireLastPoint | MoveLookController | [private]
m_fireLowerRight | MoveLookController | [private]
m_firePointerID | MoveLookController | [private]
m_firePressed | MoveLookController | [private]
m_fireUpperLeft | MoveLookController | [private]
m_forward | MoveLookController | [private]
m_gamepadsChanged | MoveLookController | [private]
m_gamepadStartButtonInUse | MoveLookController | [private]
m_gamepadTriggerInUse | MoveLookController | [private]
m_left | MoveLookController | [private]
m_lookInUse | MoveLookController | [private]
m_lookLastDelta | MoveLookController | [private]
m_lookLastPoint | MoveLookController | [private]
m_lookPointerID | MoveLookController | [private]
m_mouseInUse | MoveLookController | [private]
m_mouseLastPoint | MoveLookController | [private]
m_mouseLeftInUse | MoveLookController | [private]
m_mousePointerID | MoveLookController | [private]
m_mouseRightInUse | MoveLookController | [private]
m_moveCommand | MoveLookController | [private]
m_moveFirstDown | MoveLookController | [private]
m_moveInUse | MoveLookController | [private]
m_moveLowerRight | MoveLookController | [private]
m_movePointerID | MoveLookController | [private]
m_movePointerPosition | MoveLookController | [private]
m_moveUpperLeft | MoveLookController | [private]
m_pause | MoveLookController | [private]
m_pausePressed | MoveLookController | [private]
m_pitch | MoveLookController | [private]
m_right | MoveLookController | [private]
m_state | MoveLookController | [private]
m_up | MoveLookController | [private]
m_velocity | MoveLookController | [private]
m_yaw | MoveLookController | [private]
MoveLookController(_In_ winrt::Windows::UI::Core::CoreWindow const &window, _In_ winrt::Windows::UI::Core::CoreDispatcher const &dispatcher) | MoveLookController |
MoveLookController(_In_ winrt::Windows::UI::Core::CoreWindow const &window) | MoveLookController |
OnBackRequested(_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::UI::Core::BackRequestedEventArgs const &args) | MoveLookController | [private]
OnGamepadAdded(_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::Gaming::Input::Gamepad const &gamepad) | MoveLookController | [private]
OnGamepadRemoved(_In_ winrt::Windows::Foundation::IInspectable const &sender, _In_ winrt::Windows::Gaming::Input::Gamepad const &gamepad) | MoveLookController | [private]
OnKeyDown(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::KeyEventArgs const &args) | MoveLookController | [private]
OnKeyUp(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::KeyEventArgs const &args) | MoveLookController | [private]
OnMouseMoved(_In_ winrt::Windows::Devices::Input::MouseDevice const &mouseDevice, _In_ winrt::Windows::Devices::Input::MouseEventArgs const &args) | MoveLookController | [private]
OnPointerExited(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args) | MoveLookController | [private]
OnPointerMoved(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args) | MoveLookController | [private]
OnPointerPressed(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args) | MoveLookController | [private]
OnPointerReleased(_In_ winrt::Windows::UI::Core::CoreWindow const &sender, _In_ winrt::Windows::UI::Core::PointerEventArgs const &args) | MoveLookController | [private]
Pitch() | MoveLookController |
Pitch(_In_ float pitch) | MoveLookController |
PollingFireInUse() | MoveLookController | [inline, private]
ResetState() | MoveLookController | [private]
SetFireRect(_In_ DirectX::XMFLOAT2 upperLeft, _In_ DirectX::XMFLOAT2 lowerRight) | MoveLookController |
SetMoveRect(_In_ DirectX::XMFLOAT2 upperLeft, _In_ DirectX::XMFLOAT2 lowerRight) | MoveLookController |
ShowCursor() | MoveLookController | [private]
Update() | MoveLookController |
UpdatePollingDevices() | MoveLookController | [private]
Velocity() | MoveLookController |
WaitForPress(_In_ DirectX::XMFLOAT2 UpperLeft, _In_ DirectX::XMFLOAT2 LowerRight) | MoveLookController |
WaitForPress() | MoveLookController |
Yaw() | MoveLookController |
Yaw(_In_ float yaw) | MoveLookController |
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ExtendedSplash Member List

This is the complete list of members for ExtendedSplash, including all inherited members.
dismissed | ExtendedSplash | [private]
DismissedEventHandler(SplashScreen sender, object e) | ExtendedSplash | [inline, private]
ExtendedSplash(SplashScreen splashscreen, bool loadState) | ExtendedSplash | [inline]
ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) | ExtendedSplash | [inline, private]
LearnMoreButton_Click(object sender, RoutedEventArgs e) | ExtendedSplash | [inline, private]
PositionImage() | ExtendedSplash | [inline, private]
RestoreStateAsync(bool loadState) | ExtendedSplash | [inline, private]
rootFrame | ExtendedSplash | [private]
ScaleFactor | ExtendedSplash | [private]
splash | ExtendedSplash | [private]
splashImageRect | ExtendedSplash | [private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ensure_close Member List

This is the complete list of members for ensure_close, including all inherited members.
ensure_close(Windows::Foundation::IClosable closable) | ensure_close | [inline]
ensure_close(const ensure_close &) | ensure_close |
ensure_close(ensure_close &&other) | ensure_close |
m_closable | ensure_close |
operator=(const ensure_close &) | ensure_close |
operator=(ensure_close &&other) | ensure_close |
~ensure_close() | ensure_close | [inline]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/pch.cpp Source File

  • CameraGetPreviewFrame
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/OmnidirectionalSound.cpp Source File

  • SpatialSound
  • cpp

OmnidirectionalSound.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 _Use_decl_annotations_
00015 HRESULT OmnidirectionalSound::Initialize(LPCWSTR filename)
00016 {
00017     auto hr = _audioFile.Initialize(filename);
00018
00019     ComPtr<IXAPO> xapo;
00020     if (SUCCEEDED(hr))
00021     {
00022         // Passing in nullptr as the first arg for HrtfApoInit initializes the APO with defaults of
00023         // omnidirectional sound with natural distance decay behavior.
00024         // CreateHrtfApo will fail with E_NOTIMPL on unsupported platforms.
00025         hr = CreateHrtfApo(nullptr, &xapo);
00026     }
00027
00028     if (SUCCEEDED(hr))
00029     {
00030         hr = xapo.As(&_hrtfParams);
00031     }
00032
00033     // Set the default environment.
00034     if (SUCCEEDED(hr))
00035     {
00036         hr = _hrtfParams->SetEnvironment(_environment);
00037     }
00038
00039     // Initialize an XAudio2 graph that hosts the HRTF xAPO.
00040     // The source voice is used to submit audio data and control playback.
00041     if (SUCCEEDED(hr))
00042     {
00043         hr = SetupXAudio2(_audioFile.GetFormat(), xapo.Get(), &_xaudio2, &_sourceVoice);
00044     }
00045
00046     // Submit audio data to the source voice.
00047     if (SUCCEEDED(hr))
00048     {
00049         XAUDIO2_BUFFER buffer{};
00050         buffer.AudioBytes = static_cast<UINT32>(_audioFile.GetSize());
00051         buffer.pAudioData = _audioFile.GetData();
00052         buffer.LoopCount = XAUDIO2_LOOP_INFINITE;
00053         hr = _sourceVoice->SubmitSourceBuffer(&buffer);
00054     }
00055
00056     return hr;
00057 }
00058
00059 OmnidirectionalSound::~OmnidirectionalSound()
00060 {
00061     if (_sourceVoice)
00062     {
00063         _sourceVoice->DestroyVoice();
00064     }
00065 }
00066
00067 HRESULT OmnidirectionalSound::Start()
00068 {
00069     _lastTick = GetTickCount64();
00070     return _sourceVoice->Start();
00071 }
00072
00073 HRESULT OmnidirectionalSound::Stop()
00074 {
00075     return _sourceVoice->Stop();
00076 }
00077
00078 _Use_decl_annotations_
00079 HRESULT OmnidirectionalSound::SetEnvironment(HrtfEnvironment environment)
00080 {
00081     // Environment can be changed at any time.
00082     return _hrtfParams->SetEnvironment(environment);
00083 }
00084
00085 //
00086 // This method is called on every dispatcher timer tick.
00087 // Caller passes in the information necessary to compute the source position.
00088 //
00089 _Use_decl_annotations_
00090 HRESULT OmnidirectionalSound::OnUpdate(float angularVelocity, float height, float radius)
00091 {
00092     auto tick = GetTickCount64();
00093     auto elapsedTime = tick - _lastTick;
00094     _lastTick = tick;
00095     _angle += elapsedTime * angularVelocity;
00096     _angle = _angle > HRTF_2PI ? (_angle - HRTF_2PI) : _angle;
00097     auto position = ComputePositionInOrbit(height, radius, _angle);
00098     return _hrtfParams->SetSourcePosition(&position);
00099 }
00100
00101 _Use_decl_annotations_
00102 HrtfPosition OmnidirectionalSound::ComputePositionInOrbit(float height, float radius, float angle)
00103 {
00104     // Calculate the position of the source based on height relative to listerner's head, radius of orbit and angle relative to the listener.
00105     // APO uses right-handed coordinate system where -ve z-axis is forward and +ve z-axis is backward.
00106     // All coordinates use real-world units (meters).
00107     float x = radius * sin(angle);
00108     float z = -radius * cos(angle);
00109     return HrtfPosition{x, height ,z};
00110 }
00111
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColor Member List

This is the complete list of members for VertexPositionColor, including all inherited members.
color | VertexPositionColor |
pos | VertexPositionColor |
VertexPositionColor(Vector3 pos, Vector3 color) | VertexPositionColor | [inline]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IBreadBakedEventArgs Member List

This is the complete list of members for IBreadBakedEventArgs, including all inherited members.
Bread([out, retval] Bread **value) | IBreadBakedEventArgs
Bread([out, retval] Bread **value) | IBreadBakedEventArgs
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Stats Member List

This is the complete list of members for Scenario2_Stats, including all inherited members.
Scenario2_Stats() | Scenario2_Stats
ShowResults_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario2_Stats
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4 Member List

This is the complete list of members for Scenario4, including all inherited members.
btnStartCapture_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4 |
btnStopCapture_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4 |
ClearCapture() | Scenario4 | [private]
GetFilesButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4 |
GetThumbnailButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4 |
InitializeCapture() | Scenario4 | [private]
m_capture | Scenario4 | [private]
m_deviceStateChangeToken | Scenario4 | [private]
m_discontinuityCount | Scenario4 | [private]
m_isLowLatency | Scenario4 | [private]
m_plotDataReadyToken | Scenario4 | [private]
MediaFoundationInitializer() | MediaFoundationInitializer | [inline, private]
OnDeviceStateChange(IDeviceStateSource const &sender, SDKTemplate::DeviceStateChangedEventArgs e) | Scenario4 | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario4 |
OnPlotDataReady(IPlotDataSource const &sender, SDKTemplate::PlotDataReadyEventArgs e) | Scenario4 | [private]
ReadBytesButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4 |
Scenario4() | Scenario4 |
Scenario4() | Scenario4 |
Scenario4() | Scenario4 |
Scenario4() | Scenario4 |
StopCapture() | Scenario4 | [private]
UpdateMediaControlUI(DeviceState deviceState) | Scenario4 | [private]
WriteBytesButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4 |
~MediaFoundationInitializer() | MediaFoundationInitializer | [inline, private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/SampleConfiguration.h Source File

  • UserDataAccountManager
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "User Data Account Manager";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         Concurrency::task<void> LoadDataAccountsAsync(Windows::UI::Xaml::Controls::ComboBox^ comboBox);
00039
00040     private:
00041         static Platform::Array<Scenario>^ scenariosInner;
00042     };
00043
00044     // Wrapper class for binding.
00045     [Windows::UI::Xaml::Data::Bindable]
00046     public ref class UserDataAccountViewModel sealed
00047     {
00048     public:
00049         UserDataAccountViewModel(Windows::ApplicationModel::UserDataAccounts::UserDataAccount^ account) :
00050             account(account)
00051         {
00052         }
00053
00054         property Windows::ApplicationModel::UserDataAccounts::UserDataAccount^ Account
00055         {
00056             Windows::ApplicationModel::UserDataAccounts::UserDataAccount^ get()
00057             {
00058                 return account;
00059             }
00060         }
00061
00062         property Platform::String^ UserDisplayName
00063         {
00064             Platform::String^ get()
00065             {
00066                 return account->UserDisplayName;
00067             }
00068         }
00069
00070     private:
00071         Windows::ApplicationModel::UserDataAccounts::UserDataAccount^ account;
00072     };
00073
00074     public value struct Scenario
00075     {
00076         Platform::String^ Title;
00077         Platform::String^ ClassName;
00078     };
00079 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/SampleConfiguration.cs Source File

  • FilePickerContracts
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using FilePickerContracts;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "File picker contracts C# sample";
00022         public const string APP_TITLE = "File Picker Contracts C# Sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title = "File Open Picker contract", ClassType = typeof(FilePickerContracts.MainPage_PickFile) },
00027             new Scenario() { Title = "File Save Picker contract", ClassType = typeof(FilePickerContracts.MainPage_SaveFile) },
00028             new Scenario() { Title = "Cached File Updater contract", ClassType = typeof(FilePickerContracts.MainPage_CachedFile) },
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037
00038     internal class Status
00039     {
00040         internal static readonly string FileAdded = "File added to the basket.";
00041         internal static readonly string FileRemoved = "File removed from the basket.";
00042         internal static readonly string FileAddFailed = "Couldn't add file to the basket.";
00043     }
00044 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemIndexRangeList.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario1

ItemIndexRangeList.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections;
00003 using System.Collections.Generic;
00004 using Windows.UI.Xaml.Data;
00005
00006 namespace DataVirtualizationSample
00007 {
00008
00009     /// <summary>
00010     /// Represents a sorted collection of discontiguous ItemIndexRanges
00011     ///
00012     /// </summary>
00013     class ItemIndexRangeList : IList<ItemIndexRange>
00014     {
00015         private List<ItemIndexRange> _ranges;
00016
00017
00018         public ItemIndexRangeList()
00019         {
00020             this._ranges = new List<ItemIndexRange>();
00021         }
00022
00023         public ItemIndexRangeList(List<ItemIndexRange> ranges)
00024         {
00025             this._ranges = NormalizeRanges(ranges);
00026         }
00027
00028         public ItemIndexRangeList(ItemIndexRange[] ranges)
00029         {
00030             this._ranges = NormalizeRanges(ranges);
00031         }
00032
00033         public List<ItemIndexRange> ToList()
00034         {
00035             return this._ranges;
00036         }
00037
00038         public ItemIndexRange[] ToArray()
00039         {
00040             return this._ranges.ToArray();
00041         }
00042
00043         /// <summary>
00044         /// Merges the range into the rangelist, combining with existing ranges if necessary
00045         /// </summary>
00046         /// <param name="newrange">Range to merge into the collection</param>
00047         public void Add(ItemIndexRange newrange)
00048         {
00049             for (int i = 0; i < this._ranges.Count; i++)
00050             {
00051                 ItemIndexRange existing = this._ranges[i];
00052                 if (newrange.ContiguousOrOverlaps(existing))
00053                 {
00054                     existing = existing.Combine(newrange);
00055                     for (int j = i + 1; j < this._ranges.Count; j++)
00056                     {
00057                         ItemIndexRange next = this._ranges[j];
00058                         if (existing.ContiguousOrOverlaps(next))
00059                         {
00060                             existing = existing.Combine(next);
00061                             this._ranges.RemoveAt(i + 1);
00062                         }
00063                     }
00064                     this._ranges[i] = existing;
00065                     return;
00066                 }
00067                 else if (newrange.LastIndex < existing.FirstIndex)
00068                 {
00069                     this._ranges.Insert(i, newrange);
00070                     return;
00071                 }
00072             }
00073             this._ranges.Add(newrange);
00074         }
00075
00076         /// <summary>
00077         /// Merges the range into the rangelist, combining with existing ranges if necessary
00078         /// </summary>
00079         public void Add(uint FirstIndex, uint Length)
00080         {
00081             this.Add(new ItemIndexRange((int)FirstIndex, Length));
00082         }
00083
00084         /// <summary>
00085         /// Removes a range from the collection, splitting existing ranges if necessary
00086         /// </summary>
00087         public void Subtract(ItemIndexRange range)
00088         {
00089             for (int idx = 0; idx < this._ranges.Count; idx++)
00090             {
00091                 ItemIndexRange existing = this._ranges[idx];
00092                 if (existing.FirstIndex > range.LastIndex) return;
00093
00094                 int i, j;
00095                 i = Math.Max(existing.FirstIndex, range.FirstIndex);
00096                 j = Math.Min(existing.LastIndex, range.LastIndex);
00097
00098                 if (i <= j)
00099                 {
00100                     if (existing.FirstIndex < i && existing.LastIndex > j)
00101                     {
00102                         //range is in the middle of existing range, so split existing into two
00103                         this._ranges[idx] = (new ItemIndexRange(existing.FirstIndex, (uint)(i - existing.FirstIndex)));
00104                         this._ranges.Insert(idx + 1, new ItemIndexRange(j + 1, (uint)(existing.LastIndex - j)));
00105                         return;
00106                     }
00107                     else if (existing.LastIndex > j)
00108                     {
00109                         //range ends before existing so trim existing to be the remainder
00110                         this._ranges[idx] = new ItemIndexRange(j + 1, (uint)(existing.LastIndex - j));
00111                         return;
00112                     }
00113                     else if (existing.FirstIndex < i)
00114                     {
00115                         //range starts after existing so trim existing to the part before range
00116                         this._ranges[idx] = new ItemIndexRange(existing.FirstIndex, (uint)(i - existing.FirstIndex));
00117                     }
00118                     else
00119                     {
00120                         //existing is overlapped by range, so remove it.
00121                         this._ranges.RemoveAt(idx);
00122                     }
00123                     //trim the subtracted range to the remainder, and exit if complete
00124                     if (range.LastIndex > j)
00125                     {
00126                         range = new ItemIndexRange(j + 1, (uint)(range.LastIndex - j));
00127                     }
00128                     else { return; }
00129                 }
00130             }
00131         }
00132
00133         public void Subtract(uint FirstIndex, uint Length)
00134         {
00135             this.Subtract(new ItemIndexRange((int)FirstIndex, Length));
00136         }
00137
00138         public bool Intersects(ItemIndexRange range)
00139         {
00140             foreach (ItemIndexRange r in this._ranges)
00141             {
00142                 if (r.Intersects(range))
00143                 {
00144                     return true;
00145                 }
00146             }
00147             return false;
00148         }
00149
00150         // Merges contiguous or overlapping ranges to ensure the collection is discontiguous
00151         // Also sorts the ranges so they start in index order
00152         private List<ItemIndexRange> NormalizeRanges(IEnumerable<ItemIndexRange> ranges)
00153         {
00154             List<ItemIndexRange> results = new List<ItemIndexRange>();
00155             foreach (ItemIndexRange range in ranges)
00156             {
00157                 bool handled = false;
00158                 for (int i = 0; i < results.Count; i++)
00159                 {
00160                     ItemIndexRange existing = results[i];
00161                     if (range.ContiguousOrOverlaps(existing))
00162                     {
00163                         results[i] = existing.Combine(range);
00164                         handled = true;
00165                         break;
00166                     }
00167                     else if (range.FirstIndex < existing.FirstIndex)
00168                     {
00169                         results.Insert(i, range);
00170                         handled = true;
00171                         break;
00172                     }
00173                 }
00174                 if (!handled) results.Add(range);
00175             }
00176             return results;
00177         }
00178
00179         #region IList implementation
00180         public int Count { get { return ((IList<ItemIndexRange>)_ranges).Count; } }
00181
00182         public bool IsReadOnly { get { return ((IList<ItemIndexRange>)_ranges).IsReadOnly; } }
00183
00184         public ItemIndexRange this[int index]
00185         {
00186             get { return ((IList<ItemIndexRange>)_ranges)[index]; }
00187             set { ((IList<ItemIndexRange>)_ranges)[index] = value; }
00188         }
00189
00190
00191         public IEnumerator<ItemIndexRange> GetEnumerator()
00192         {
00193             return ((IEnumerable<ItemIndexRange>)_ranges).GetEnumerator();
00194         }
00195
00196         IEnumerator IEnumerable.GetEnumerator()
00197         {
00198             return ((IEnumerable<ItemIndexRange>)_ranges).GetEnumerator();
00199         }
00200
00201         public int IndexOf(ItemIndexRange item)
00202         {
00203             return ((IList<ItemIndexRange>)_ranges).IndexOf(item);
00204         }
00205
00206         public void Insert(int index, ItemIndexRange item)
00207         {
00208             ((IList<ItemIndexRange>)_ranges).Insert(index, item);
00209         }
00210
00211         public void RemoveAt(int index)
00212         {
00213             ((IList<ItemIndexRange>)_ranges).RemoveAt(index);
00214         }
00215
00216         public void Clear()
00217         {
00218             ((IList<ItemIndexRange>)_ranges).Clear();
00219         }
00220
00221         public bool Contains(ItemIndexRange item)
00222         {
00223             return ((IList<ItemIndexRange>)_ranges).Contains(item);
00224         }
00225
00226         public void CopyTo(ItemIndexRange[] array, int arrayIndex)
00227         {
00228             ((IList<ItemIndexRange>)_ranges).CopyTo(array, arrayIndex);
00229         }
00230
00231         public bool Remove(ItemIndexRange item)
00232         {
00233             return ((IList<ItemIndexRange>)_ranges).Remove(item);
00234         }
00235
00236         #endregion
00237     }
00238 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_DisplayingBarcodePreview Member List

This is the complete list of members for Scenario5_DisplayingBarcodePreview, including all inherited members.
barcodeScanners | Scenario5_DisplayingBarcodePreview | [private]
claimedScanner | Scenario5_DisplayingBarcodePreview | [private]
ClaimedScanner_Closed(ClaimedBarcodeScanner sender, ClaimedBarcodeScannerClosedEventArgs args) | Scenario5_DisplayingBarcodePreview | [inline, private]
ClaimedScanner_DataReceived(ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args) | Scenario5_DisplayingBarcodePreview | [inline, private]
CloseScannerResourcesAsync() | Scenario5_DisplayingBarcodePreview | [inline, private]
displayRequest | Scenario5_DisplayingBarcodePreview | [private]
FlipPreview_Click(object sender, RoutedEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, private]
HidePreviewButton_Click(object sender, RoutedEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, private]
IsPreviewing | Scenario5_DisplayingBarcodePreview |
IsScannerClaimed | Scenario5_DisplayingBarcodePreview |
isSelectionChanging | Scenario5_DisplayingBarcodePreview | [private]
isStopPending | Scenario5_DisplayingBarcodePreview | [private]
mediaCapture | Scenario5_DisplayingBarcodePreview | [private]
MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs) | Scenario5_DisplayingBarcodePreview | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, protected]
pendingSelectionDeviceId | Scenario5_DisplayingBarcodePreview | [private]
PropertyChanged | Scenario5_DisplayingBarcodePreview |
RaisePropertyChanged(string propertyName=null) | Scenario5_DisplayingBarcodePreview | [inline]
rootPage | Scenario5_DisplayingBarcodePreview | [private]
rotationGuid | Scenario5_DisplayingBarcodePreview | [private, static]
ScannerSelection_Changed(object sender, SelectionChangedEventArgs args) | Scenario5_DisplayingBarcodePreview | [inline, private]
ScannerSupportsPreview | Scenario5_DisplayingBarcodePreview |
Scenario5_DisplayingBarcodePreview() | Scenario5_DisplayingBarcodePreview | [inline]
selectedScanner | Scenario5_DisplayingBarcodePreview | [private]
SelectScannerAsync(string scannerDeviceId) | Scenario5_DisplayingBarcodePreview | [inline, private]
SetPreviewRotationAsync(DisplayOrientations displayOrientation) | Scenario5_DisplayingBarcodePreview | [inline, private]
ShowPreviewButton_Click(object sender, RoutedEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, private]
SoftwareTriggerStarted | Scenario5_DisplayingBarcodePreview |
StartMediaCaptureAsync(string videoDeviceId) | Scenario5_DisplayingBarcodePreview | [inline, private]
StartSoftwareTriggerButton_Click(object sender, RoutedEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, private]
StopSoftwareTriggerButton_Click(object sender, RoutedEventArgs e) | Scenario5_DisplayingBarcodePreview | [inline, private]
watcher | Scenario5_DisplayingBarcodePreview | [private]
Watcher_Added(DeviceWatcher sender, DeviceInformation args) | Scenario5_DisplayingBarcodePreview | [inline, private]
Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args) | Scenario5_DisplayingBarcodePreview | [inline, private]
Watcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args) | Scenario5_DisplayingBarcodePreview | [inline, private]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario3_ServicingCompleteTask.xaml.cpp Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario3_ServicingCompleteTask.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario3_ServicingCompleteTask.xaml.cpp
00013 // Implementation of the ServicingCompleteTask class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario3_ServicingCompleteTask.xaml.h"
00018 #include "SampleConfiguration.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::ApplicationModel::Background;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 ServicingCompleteTask::ServicingCompleteTask()
00029 {
00030     InitializeComponent();
00031 }
00032
00033 /// <summary>
00034 /// Invoked when this page is about to be displayed in a Frame.
00035 /// </summary>
00036 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037 /// property is typically used to configure the page.</param>
00038 void ServicingCompleteTask::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00041     // as NotifyUser()
00042     rootPage = MainPage::Current;
00043
00044     //
00045     // Attach progress and completed handlers to any existing tasks.
00046     //
00047     for (auto pair : BackgroundTaskRegistration::AllTasks)
00048     {
00049         auto task = pair->Value;
00050         if (task->Name == ServicingCompleteTaskName)
00051         {
00052             BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, true);
00053             AttachProgressAndCompletedHandlers(task);
00054             break;
00055         }
00056     }
00057
00058     UpdateUI();
00059 }
00060
00061 /// <summary>
00062 /// Attach progress and completed handers to a background task.
00063 /// </summary>
00064 /// <param name="task">The task to attach progress and completed handlers to.</param>
00065 void ServicingCompleteTask::AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration^ task)
00066 {
00067     task->Progress += ref new BackgroundTaskProgressEventHandler(this, &ServicingCompleteTask::OnProgress);
00068     task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &ServicingCompleteTask::OnCompleted);
00069 }
00070
00071 /// <summary>
00072 /// Register a ServicingCompleteTask.
00073 /// </summary>
00074 /// <param name="sender"></param>
00075 /// <param name="e"></param>
00076 void ServicingCompleteTask::RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00077 {
00078     auto task = BackgroundTaskSample::RegisterBackgroundTask(ServicingCompleteTaskEntryPoint,
00079                                                              ServicingCompleteTaskName,
00080                                                              ref new SystemTrigger(SystemTriggerType::ServicingComplete, false),
00081                                                              nullptr);
00082
00083     AttachProgressAndCompletedHandlers(task);
00084     UpdateUI();
00085 }
00086
00087 /// <summary>
00088 /// Unregister a ServicingCompleteTask.
00089 /// </summary>
00090 /// <param name="sender"></param>
00091 /// <param name="e"></param>
00092 void ServicingCompleteTask::UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00093 {
00094     BackgroundTaskSample::UnregisterBackgroundTasks(ServicingCompleteTaskName);
00095     UpdateUI();
00096 }
00097
00098 /// <summary>
00099 /// Handle background task progress.
00100 /// </summary>
00101 /// <param name="task">The task that is reporting progress.</param>
00102 /// <param name="args">Arguments of the progress report.</param>
00103 void ServicingCompleteTask::OnProgress(BackgroundTaskRegistration^ task, BackgroundTaskProgressEventArgs^ args)
00104 {
00105     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00106     {
00107         auto progress = "Progress: " + args->Progress + "%";
00108         BackgroundTaskSample::ServicingCompleteTaskProgress = progress;
00109         UpdateUI();
00110     }));
00111 }
00112
00113 /// <summary>
00114 /// Handle background task completion.
00115 /// </summary>
00116 /// <param name="task">The task that is reporting completion.</param>
00117 /// <param name="args">Arguments of the completion report.</param>
00118 void ServicingCompleteTask::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00119 {
00120     UpdateUI();
00121 }
00122
00123 /// <summary>
00124 /// Update the scenario UI.
00125 /// </summary>
00126 void ServicingCompleteTask::UpdateUI()
00127 {
00128     auto uiDelegate = [this]()
00129     {
00130         RegisterButton->IsEnabled = !BackgroundTaskSample::ServicingCompleteTaskRegistered;
00131         UnregisterButton->IsEnabled = BackgroundTaskSample::ServicingCompleteTaskRegistered;
00132         Progress->Text = BackgroundTaskSample::ServicingCompleteTaskProgress;
00133         Status->Text = BackgroundTaskSample::GetBackgroundTaskStatus(ServicingCompleteTaskName);
00134     };
00135     auto handler = ref new Windows::UI::Core::DispatchedHandler(uiDelegate, Platform::CallbackContext::Any);
00136
00137     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, handler);
00138 }
Generated on Fri Nov 15 2024 22:18:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.cpp Source File

  • DataReaderWriter
  • cpp

Scenario2_ReadBytes.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ReadBytes.xaml.cpp
00014 // Implementation of the ReadBytes class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_ReadBytes.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Storage;
00026 using namespace Windows::Storage::Streams;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 ReadBytes::ReadBytes()
00032 {
00033     InitializeComponent();
00034 }
00035
00036 /// <summary>
00037 /// Invoked when this page is about to be displayed in a Frame.
00038 /// </summary>
00039 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040 /// property is typically used to configure the page.</param>
00041 void ReadBytes::OnNavigatedTo(NavigationEventArgs^ e)
00042 {
00043     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00044     // as NotifyUser()
00045     rootPage = MainPage::Current;
00046 }
00047
00048 /// <summary>
00049 /// This is the click handler for the 'Hex Dump' button.  Open the image file we want to
00050 /// perform a hex dump on.  Then open a sequential-access stream over the file and use
00051 /// ReadBytes() to extract the binary data.  Finally, convert each byte to hexadecimal, and
00052 /// display the formatted output in the HexDump textblock.
00053 /// </summary>
00054 /// <param name="sender">Contains information about the button that fired the event.</param>
00055 /// <param name="e">Contains state information and event data associated with a routed event.</param>
00056 void ReadBytes::HexDump(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00057 {
00058     // Retrieve the uri of the image and use that to load the file.
00059     Uri^ uri = ref new Uri("ms-appx:///Assets/microsoft-sdk.png");
00060     create_task(StorageFile::GetFileFromApplicationUriAsync(uri)).then([] (StorageFile^ file)
00061     {
00062         // Open a sequential-access stream over the image file.
00063         return file->OpenSequentialReadAsync();
00064     }).then(
00065         // Since this is the last task in the chain, use task<IInputStream ^> instead of IInputStream ^
00066         // as the parameter here in order to handle any exceptions which might have been thrown in
00067         // the previous async calls.
00068         [=] (task<IInputStream ^> inputStream)
00069     {
00070         try
00071         {
00072             currChunk = 0;
00073             ReadBytesOutput->Text = "";
00074
00075             // Use inputStream.get() to pass the input stream returned by OpenSequentialReadAsync() to the
00076             // DataReader, or to catch any exceptions that might have arisen in the chained async calls.
00077             DataReader^ dataReader = ref new DataReader(inputStream.get());
00078
00079             // Read and process the data contained in the input stream.
00080             ReadLoop(dataReader);
00081         }
00082         catch (Exception^ e)
00083         {
00084             ReadBytesOutput->Text = e->Message;
00085         }
00086     });
00087 }
00088
00089 /// <summary>
00090 /// The read loop recursively loads a chunk of bytes from the stream into the DataReader
00091 /// buffer until all elements are read.  After each load, ReadBytes() retrieves and
00092 /// formats one row worth of bytes at a time.
00093 /// </summary>
00094 /// <param name="dataReader">The DataReader which will retrieve the data from the stream.</param>
00095 void ReadBytes::ReadLoop(DataReader^ dataReader)
00096 {
00097     create_task(dataReader->LoadAsync(chunkSize)).then(
00098         // Again, use task<unsigned int> instead of unsigned int as the parameter here in order to
00099         // handle any exceptions which might have been thrown in the LoadAsync() call.
00100         [=] (task<unsigned int> bytesLoaded)
00101     {
00102         try
00103         {
00104             // Use bytesLoaded.get() to determine how many bytes we have left to print, or
00105             // to catch any exceptions that might have arisen in the LoadAsync() call.
00106             int numBytes = bytesLoaded.get();
00107
00108             // Create a byte array which can hold enough bytes to populate a row of the hex dump.
00109             auto bytes = ref new Array<byte>(bytesPerRow);
00110
00111             // Read and print one row at a time.
00112             int numBytesRemaining = numBytes;
00113             while (numBytesRemaining >= bytesPerRow)
00114             {
00115                 // Use the DataReader and ReadBytes() to fill the byte array with one row worth of bytes.
00116                 dataReader->ReadBytes(bytes);
00117
00118                 PrintRow(bytes, (numBytes - numBytesRemaining) + (currChunk * chunkSize));
00119
00120                 numBytesRemaining -= bytesPerRow;
00121             }
00122
00123             // If there are any bytes remaining to be read, allocate a new array that will hold
00124             // the remaining bytes read from the DataReader and print the final row.
00125             // Note: ReadBytes() fills the entire array so if the array being passed in is larger
00126             // than what's remaining in the DataReader buffer, an exception will be thrown.
00127             if (numBytesRemaining > 0)
00128             {
00129                 bytes = ref new Array<byte>(numBytesRemaining);
00130
00131                 // Use the DataReader and ReadBytes() to fill the byte array with the last row worth of bytes.
00132                  dataReader->ReadBytes(bytes);
00133
00134                 PrintRow(bytes, (numBytes - numBytesRemaining) + (currChunk * chunkSize));
00135             }
00136
00137             currChunk++;
00138
00139             // If the number of bytes read is anything but the chunk size, then we've just retrieved the last
00140             // chunk of data from the stream.  Otherwise, keep loading data into the DataReader buffer.
00141             if (numBytes == chunkSize)
00142             {
00143                 ReadLoop(dataReader);
00144             }
00145         }
00146         catch (Exception^ e)
00147         {
00148             ReadBytesOutput->Text = e->Message;
00149         }
00150     });
00151 }
00152
00153 /// <summary>
00154 /// Format and print a row of the hex dump using the data retrieved by ReadBytes().
00155 /// </summary>
00156 /// <param name="bytes">An array that holds the data we want to format and output.</param>
00157 /// <param name="currByte">The first byte of the current row to compute the value of the address.</param>
00158 void ReadBytes::PrintRow(Array<byte>^ bytes, int currByte)
00159 {
00160     String^ rowStr = "";
00161
00162     // Add the address of the current byte to the output string.
00163     rowStr += GetAddress(currByte);
00164
00165     // Format the output:
00166     for (unsigned int i = 0; i < bytes->Length; i++)
00167     {
00168         // If finished with a segment, add a space.
00169         if (i % bytesPerSegment == 0)
00170         {
00171             rowStr += " ";
00172         }
00173
00174         // Convert the current byte value to hex and add it to the output string.
00175         rowStr += ToHex(bytes[i]);
00176     }
00177
00178     // Append the current row to the HexDump textblock.
00179     ReadBytesOutput->Text += rowStr + "\n";
00180 }
00181
00182 /// <summary>
00183 /// Format the address of the current byte by converting currByte to hexadecimal and then
00184 //  left-padding the string with zeroes so that the address always has 8 digits.
00185 /// </summary>
00186 /// <param name="currByte">Value to be formatted into an address.</param>
00187 /// <returns>The formatted address represnted as a Platform::String ^.</returns>
00188 String^ ReadBytes::GetAddress(int currByte)
00189 {
00190     // 8 digits for the address plus '\0'
00191     int const arraySize = 9;
00192
00193     wchar_t address[arraySize] = { 0 };
00194
00195     // Convert to hex.
00196     swprintf_s(address, arraySize, L"%08x", currByte);
00197
00198     return ref new String(address);
00199 }
00200
00201 /// <summary>
00202 /// Convert the byte value to hexadecimal and return the result.
00203 /// </summary>
00204 /// <param name="value">Value to be converted to hexadecimal.</param>
00205 /// <returns>The formatted hex value represnted as a Platform::String ^.</returns>
00206 String^ ReadBytes::ToHex(byte value)
00207 {
00208     // 2 digits for the value plus '\0'
00209     int const arraySize = 3;
00210
00211     wchar_t hexValue[arraySize] = { 0 };
00212
00213     // Convert to hex.
00214     swprintf_s(hexValue, arraySize, L"%02x", (int) value);
00215
00216     return ref new String(hexValue);
00217 }
Generated on Fri Nov 15 2024 22:19:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.h Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

TextLayout.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "FontNameCollector.h"
00015
00016 namespace DWriteTextLayoutCloudFontImplementation
00017 {
00018     // This sample uses a SurfaceImageSource as the means of presenting a DirectWrite
00019     // text layout within the XAML UI. The dimensions of the SurfaceImageSource need
00020     // to be determined when it is constructed. Therefore, a text layout needs to be
00021     // created first, and then the dimensions of the layout can be used to determine
00022     // the dimensions of the SurfaceImageSource.
00023     //
00024     // The width of the TextLayout will be determined by the caller (based on
00025     // the UI state). Then the height will get set based on the layout
00026     // requirements.
00027
00028     public ref class TextLayout sealed
00029     {
00030     public:
00031         TextLayout(Platform::String^ text, Platform::String^ languageTag, Platform::String^ fontFamily, float fontSize, float width);
00032
00033         void InvalidateLayout(); // Will be called after downloadable font is available locally.
00034
00035         property float Width
00036         {
00037             float get() { return m_width; }
00038             void set(float value);
00039         }
00040
00041         property float Height
00042         {
00043             float get() { return m_height; }
00044         }
00045
00046         property Platform::String^ FontsUsed
00047         {
00048             Platform::String^ get();
00049         }
00050
00051     internal:
00052         Microsoft::WRL::ComPtr<IDWriteTextLayout> GetDWriteTextLayout() { return m_textLayout.Get(); }
00053
00054     private:
00055         void UpdateHeight();
00056         void GetFontNames();
00057
00058         std::wstring                                        m_text;
00059         std::wstring                                        m_languageTag;
00060         std::wstring                                        m_fontFamily;
00061         float                                               m_fontSize;
00062         float                                               m_width; // set in constructor or in Width setter, in DIPs
00063         float                                               m_height; // derived from layout, in DIPs
00064         std::wstring                                        m_usedFontNames; // derived from layout
00065
00066         // DirectWrite objects
00067         Microsoft::WRL::ComPtr<IDWriteFactory3>             m_dwriteFactory;
00068         Microsoft::WRL::ComPtr<IDWriteTextLayout3>          m_textLayout;
00069         Microsoft::WRL::ComPtr<FontNameCollector>           m_fontNameCollector; // IDWriteRenderer implementation, used to obtain information about the fonts used in text layout.
00070     };
00071 }
Generated on Fri Nov 15 2024 22:19:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PredefinedDictationGrammar.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_PredefinedDictationGrammar.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario_PredefinedDictationGrammar sealed
00024     {
00025     public:
00026         Scenario_PredefinedDictationGrammar();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         /// <summary>
00034         /// This HResult represents the scenario where a user is prompted to allow in-app speech, but
00035         /// declines. This should only happen on a Phone device, where speech is enabled for the entire device,
00036         /// not per-app.
00037         /// </summary>
00038         static const unsigned int HResultPrivacyStatementDeclined = 0x80045509;
00039
00040         SDKTemplate::MainPage^ rootPage;
00041         Windows::UI::Core::CoreDispatcher^ dispatcher;
00042         Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
00043         Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
00044         Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
00045
00046         void RecognizeWithUIDictationGrammar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         void RecognizeWithoutUIDictationGrammar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048
00049         void InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage);
00050         void PopulateLanguageDropdown();
00051
00052         Windows::Foundation::EventRegistrationToken stateChangedToken;
00053         void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
00054         void cbLanguageSelection_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00055         void openPrivacySettings_Click(Windows::UI::Xaml::Documents::Hyperlink^ sender, Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^ args);
00056     };
00057 }
Generated on Fri Nov 15 2024 22:21:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario7_SetVersion.cpp Source File

  • ApplicationData
  • cppwinrt

Scenario7_SetVersion.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_SetVersion.h"
00014 #include "Scenario7_SetVersion.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Storage;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario7_SetVersion::Scenario7_SetVersion()
00025     {
00026         InitializeComponent();
00027
00028         DisplayOutput();
00029     }
00030
00031     void Scenario7_SetVersion::SetVersionHandler0(SetVersionRequest const& request)
00032     {
00033         auto deferral = request.GetDeferral();
00034
00035         uint32_t version = appData.Version();
00036
00037         switch (version)
00038         {
00039         case 0:
00040             // Version is already 0.  Nothing to do.
00041             break;
00042
00043         case 1:
00044             // Need to convert data from v1 to v0.
00045
00046             // This sample simulates that conversion by writing a version-specific value.
00047             appData.LocalSettings().Values().Insert(settingName, box_value(settingValue0));
00048
00049             break;
00050
00051         default:
00052             throw hresult_invalid_argument(L"Unexpected ApplicationData Version: " + to_hstring(version));
00053         }
00054
00055         deferral.Complete();
00056     }
00057
00058     void Scenario7_SetVersion::SetVersionHandler1(SetVersionRequest const& request)
00059     {
00060         auto deferral = request.GetDeferral();
00061
00062         uint32_t version = appData.Version();
00063
00064         switch (version)
00065         {
00066         case 0:
00067             // Need to convert data from v0 to v1.
00068
00069             // This sample simulates that conversion by writing a version-specific value.
00070             appData.LocalSettings().Values().Insert(settingName, box_value(settingValue1));
00071
00072             break;
00073
00074         case 1:
00075             // Version is already 1.  Nothing to do.
00076             break;
00077
00078         default:
00079             throw hresult_invalid_argument(L"Unexpected ApplicationData Version: " + to_hstring(version));
00080         }
00081
00082         deferral.Complete();
00083     }
00084
00085     fire_and_forget Scenario7_SetVersion::SetVersion0_Click(IInspectable const&, RoutedEventArgs const&)
00086     {
00087         auto strong = get_strong();
00088         co_await appData.SetVersionAsync(0, { get_weak(), &Scenario7_SetVersion::SetVersionHandler0 });
00089         DisplayOutput();
00090     }
00091
00092     fire_and_forget Scenario7_SetVersion::SetVersion1_Click(IInspectable const&, RoutedEventArgs const&)
00093     {
00094         auto strong = get_strong();
00095         co_await appData.SetVersionAsync(1, { get_weak(), &Scenario7_SetVersion::SetVersionHandler1 });
00096         DisplayOutput();
00097     }
00098
00099     void Scenario7_SetVersion::DisplayOutput()
00100     {
00101         OutputTextBlock().Text(L"Version: " + to_hstring(appData.Version()));
00102     }
00103
00104     void Scenario7_SetVersion::OnNavigatedTo(NavigationEventArgs const&)
00105     {
00106         DisplayOutput();
00107     }
00108 }
00109
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario5.cpp Source File

  • FileAccess
  • cppwinrt

Scenario5.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5.h"
00014 #include "Scenario5.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::Streams;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario5::Scenario5()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario5::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         SampleState::ValidateFile();
00034     }
00035
00036     fire_and_forget Scenario5::WriteToStreamButton_Click(IInspectable const&, RoutedEventArgs const&)
00037     {
00038         auto lifetime = get_strong();
00039
00040         StorageFile file = SampleState::SampleFile();
00041         if (file != nullptr)
00042         {
00043             try
00044             {
00045                 hstring userContent = InputTextBox().Text();
00046                 StorageStreamTransaction transaction = co_await file.OpenTransactedWriteAsync();
00047                 IBuffer buffer = SampleState::GetBufferFromString(userContent);
00048                 uint32_t bytesWritten = co_await transaction.Stream().WriteAsync(buffer);
00049                 transaction.Stream().Size(bytesWritten); // truncate any previous data in the file
00050                 co_await transaction.CommitAsync();
00051                 transaction.Close(); // As a best practice, explicitly close the transaction resource as soon as it is no longer needed.
00052                 rootPage.NotifyUser(L"The following text was written to '" + file.Name() + L"' using a stream:\n" + userContent, NotifyType::StatusMessage);
00053             }
00054             catch (const hresult_error& ex)
00055             {
00056                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00057                 {
00058                     SampleState::NotifyUserFileNotExist();
00059                 }
00060                 else
00061                 {
00062                     // I/O errors are reported as exceptions.
00063                     rootPage.NotifyUser(L"Error writing to '" + file.Name() + L"': " + ex.message(), NotifyType::ErrorMessage);
00064                 }
00065             }
00066         }
00067         else
00068         {
00069             SampleState::NotifyUserFileNotExist();
00070         }
00071     }
00072
00073     fire_and_forget Scenario5::ReadFromStreamButton_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         auto lifetime = get_strong();
00076
00077         StorageFile file = SampleState::SampleFile();
00078         if (file != nullptr)
00079         {
00080             try
00081             {
00082                 IRandomAccessStream readStream = co_await file.OpenAsync(FileAccessMode::Read);
00083                 uint64_t size64 = readStream.Size();
00084                 if (size64 <= std::numeric_limits<uint32_t>::max())
00085                 {
00086                     uint32_t size32 = static_cast<uint32_t>(size64);
00087                     IBuffer buffer = Buffer{ size32 };
00088                     buffer = co_await readStream.ReadAsync(buffer, size32, InputStreamOptions::None);
00089                     hstring fileContent = SampleState::GetStringFromBuffer(buffer);
00090                     rootPage.NotifyUser(L"The following text was read from '" + file.Name() + L"' using a stream:\n" + fileContent, NotifyType::StatusMessage);
00091                 }
00092                 else
00093                 {
00094                     rootPage.NotifyUser(L"File '" + file.Name() + L"' is too big to load in a single buffer. Files larger than 4GB need to be broken into multiple buffers to be read by ReadAsync.", NotifyType::ErrorMessage);
00095                 }
00096             }
00097             catch (const hresult_error& ex)
00098             {
00099                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00100                 {
00101                     SampleState::NotifyUserFileNotExist();
00102                 }
00103                 else if (ex.code() == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
00104                 {
00105                     rootPage.NotifyUser(L"File is not UTF-8 encoded.", NotifyType::ErrorMessage);
00106                 }
00107                 else
00108                 {
00109                     // I/O errors are reported as exceptions.
00110                     rootPage.NotifyUser(L"Error reading from '" + file.Name() + L"': " + ex.message(), NotifyType::ErrorMessage);
00111                 }
00112             }
00113         }
00114         else
00115         {
00116             SampleState::NotifyUserFileNotExist();
00117         }
00118     }
00119 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario5_Capabilities.xaml.cs Source File

  • RemoteSystems
  • cs

Scenario5_Capabilities.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.Threading.Tasks;
00016 using Windows.System.RemoteSystems;
00017 using Windows.Foundation;
00018 using Windows.Foundation.Collections;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// An empty page that can be used on its own or navigated to within a Frame.
00029     /// </summary>
00030     public sealed partial class Scenario5_Capabilities : Page
00031     {
00032         private MainPage m_rootPage;
00033         public Scenario5_Capabilities()
00034         {
00035             this.InitializeComponent();
00036             this.DataContext = this;
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             m_rootPage = MainPage.Current;
00042             m_rootPage.ValidateSystemDiscovery();
00043         }
00044
00045         public ObservableCollection<RemoteSystem> SystemList => m_rootPage.systemList;
00046
00047         private async Task ReportCapabilityAsync(RemoteSystem selectedSystem, string capability, TextBlock resultBlock)
00048         {
00049             bool isSupported = await selectedSystem.GetCapabilitySupportedAsync(capability);
00050             resultBlock.Text = isSupported ? "Yes" : "No";
00051         }
00052
00053         private async void Capabilities_Click(object sender, RoutedEventArgs e)
00054         {
00055             UpdateStatus("Checking for capabilities...", NotifyType.StatusMessage);
00056             appServiceSupport.Text = "";
00057             launchUriSupport.Text = "";
00058             spatialEntitySupport.Text = "";
00059
00060             RemoteSystem selectedSystem = SystemListComboBox.SelectedItem as RemoteSystem;
00061             if (selectedSystem != null && selectedSystem.Status == RemoteSystemStatus.Available)
00062             {
00063                 // Check and report each capability.
00064                 await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.AppService, appServiceSupport);
00065                 await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.LaunchUri, launchUriSupport);
00066                 await ReportCapabilityAsync(selectedSystem, KnownRemoteSystemCapabilities.SpatialEntity, spatialEntitySupport);
00067
00068                 UpdateStatus("Successfully checked capabilities.", NotifyType.StatusMessage);
00069             }
00070             else if (selectedSystem != null && selectedSystem.Status != RemoteSystemStatus.Available)
00071             {
00072                 UpdateStatus("The selected system is not available.", NotifyType.ErrorMessage);
00073             }
00074             else
00075             {
00076                 UpdateStatus("Please select a system.", NotifyType.ErrorMessage);
00077             }
00078         }
00079
00080         private void UpdateStatus(string status, NotifyType statusType)
00081         {
00082             m_rootPage.NotifyUser(status, statusType);
00083         }
00084     }
00085 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/Scenario2_Client.h Source File

  • BluetoothLE
  • cppwinrt

Scenario2_Client.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Client.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Client : Scenario2_ClientT<Scenario2_Client>
00020     {
00021         Scenario2_Client();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         fire_and_forget OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00025
00026         fire_and_forget ConnectButton_Click();
00027         fire_and_forget ServiceList_SelectionChanged();
00028         fire_and_forget CharacteristicList_SelectionChanged();
00029         fire_and_forget CharacteristicReadButton_Click();
00030         fire_and_forget CharacteristicWriteButton_Click();
00031         fire_and_forget CharacteristicWriteButtonInt_Click();
00032         fire_and_forget ValueChangedSubscribeToggle_Click();
00033
00034     private:
00035         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00036         Windows::Devices::Bluetooth::BluetoothLEDevice bluetoothLeDevice{ nullptr };
00037         Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic selectedCharacteristic{ nullptr };
00038
00039         // Only one registered characteristic at a time.
00040         Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic registeredCharacteristic{ nullptr };
00041         Windows::Devices::Bluetooth::GenericAttributeProfile::GattPresentationFormat presentationFormat{ nullptr };
00042
00043         event_token notificationsToken;
00044
00045         Windows::Foundation::IAsyncOperation<bool> ClearBluetoothLEDeviceAsync();
00046         void AddValueChangedHandler();
00047         void RemoveValueChangedHandler();
00048         void EnableCharacteristicPanels(Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristicProperties properties);
00049         Windows::Foundation::IAsyncOperation<bool> WriteBufferToSelectedCharacteristicAsync(Windows::Storage::Streams::IBuffer buffer);
00050         hstring FormatValueByPresentation(Windows::Storage::Streams::IBuffer const& buffer, Windows::Devices::Bluetooth::GenericAttributeProfile::GattPresentationFormat const& format);
00051         fire_and_forget Characteristic_ValueChanged(Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic const&, Windows::Devices::Bluetooth::GenericAttributeProfile::GattValueChangedEventArgs args);
00052     };
00053 }
00054
00055 namespace winrt::SDKTemplate::factory_implementation
00056 {
00057     struct Scenario2_Client : Scenario2_ClientT<Scenario2_Client, implementation::Scenario2_Client>
00058     {
00059     };
00060 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RippleEffect Member List

This is the complete list of members for RippleEffect, including all inherited members.
amplitude | RippleEffect |
center | RippleEffect |
Clamp(float v, float low, float high) | RippleEffect | [inline, private, static]
CreateRippleImpl(_Outptr_ IUnknown **ppEffectImpl) | RippleEffect | [static]
dpi | RippleEffect |
frequency | RippleEffect |
GetAmplitude() const | RippleEffect |
GetCenter() const | RippleEffect |
GetFrequency() const | RippleEffect |
GetPhase() const | RippleEffect |
GetSpread() const | RippleEffect |
IFACEMETHODIMP_(UINT32) GetInputCount() const | RippleEffect |
IFACEMETHODIMP_(ULONG) AddRef() | RippleEffect |
IFACEMETHODIMP_(ULONG) Release() | RippleEffect |
Initialize(_In_ ID2D1EffectContext *pContextInternal, _In_ ID2D1TransformGraph *pTransformGraph) | RippleEffect |
m_constants | RippleEffect | [private]
m_dpi | RippleEffect | [private]
m_drawInfo | RippleEffect | [private]
m_effectContext | RippleEffect | [private]
m_inputRect | RippleEffect | [private]
m_refCount | RippleEffect | [private]
MapInputRectsToOutputRect(_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect) | RippleEffect |
MapInvalidRect(UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const | RippleEffect |
MapOutputRectToInputRects(_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const | RippleEffect |
phase | RippleEffect |
PrepareForRender(D2D1_CHANGE_TYPE changeType) | RippleEffect |
QueryInterface(_In_ REFIID riid, _Outptr_ void **ppOutput) | RippleEffect |
Register(_In_ ID2D1Factory1 *pFactory) | RippleEffect | [static]
RippleEffect() | RippleEffect | [private]
Round(float v) | RippleEffect | [inline, private, static]
SafeAdd(long base, long valueToAdd) | RippleEffect | [inline, private, static]
SetAmplitude(float amplitude) | RippleEffect |
SetCenter(D2D1_POINT_2F center) | RippleEffect |
SetDrawInfo(_In_ ID2D1DrawInfo *pRenderInfo) | RippleEffect |
SetFrequency(float frequency) | RippleEffect |
SetGraph(_In_ ID2D1TransformGraph *pGraph) | RippleEffect |
SetPhase(float phase) | RippleEffect |
SetSpread(float spread) | RippleEffect |
spread | RippleEffect |
UpdateConstants() | RippleEffect | [private]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DragUICustomization Member List

This is the complete list of members for Scenario2_DragUICustomization, including all inherited members.
Scenario2_DragUICustomization() | Scenario2_DragUICustomization | [inline]
SourceGrid_DragStarting(Windows.UI.Xaml.UIElement sender, Windows.UI.Xaml.DragStartingEventArgs args) | Scenario2_DragUICustomization | [inline, private]
TargetTextBox_DragEnter(object sender, Windows.UI.Xaml.DragEventArgs e) | Scenario2_DragUICustomization | [inline, private]
TargetTextBox_DragLeave(object sender, Windows.UI.Xaml.DragEventArgs e) | Scenario2_DragUICustomization | [inline, private]
TargetTextBox_Drop(object sender, Windows.UI.Xaml.DragEventArgs e) | Scenario2_DragUICustomization | [inline, private]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DirectXPage.xaml.cpp Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

DirectXPage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DirectXPage.xaml.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace D2DAdvancedColorImages;
00017
00018 using namespace concurrency;
00019 using namespace Microsoft::WRL;
00020 using namespace Platform;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Graphics::Display;
00024 using namespace Windows::Storage;
00025 using namespace Windows::Storage::Pickers;
00026 using namespace Windows::Storage::Streams;
00027 using namespace Windows::System;
00028 using namespace Windows::System::Threading;
00029 using namespace Windows::UI::Core;
00030 using namespace Windows::UI::Input;
00031 using namespace Windows::UI::ViewManagement;
00032 using namespace Windows::UI::Xaml;
00033 using namespace Windows::UI::Xaml::Controls;
00034 using namespace Windows::UI::Xaml::Controls::Primitives;
00035 using namespace Windows::UI::Xaml::Data;
00036 using namespace Windows::UI::Xaml::Input;
00037 using namespace Windows::UI::Xaml::Media;
00038 using namespace Windows::UI::Xaml::Navigation;
00039
00040 DirectXPage::DirectXPage() :
00041     m_isWindowVisible(true),
00042     m_imageInfo{},
00043     m_isImageValid(false),
00044     m_imageMaxCLL(-1.0f)
00045 {
00046     InitializeComponent();
00047
00048     // Register event handlers for page lifecycle.
00049     CoreWindow^ window = Window::Current->CoreWindow;
00050
00051     window->KeyUp += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &DirectXPage::OnKeyUp);
00052
00053     window->VisibilityChanged +=
00054         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &DirectXPage::OnVisibilityChanged);
00055
00056     window->ResizeCompleted +=
00057         ref new TypedEventHandler<CoreWindow ^, Object ^>(this, &DirectXPage::OnResizeCompleted);
00058
00059     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00060
00061     currentDisplayInformation->DpiChanged +=
00062         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDpiChanged);
00063
00064     currentDisplayInformation->OrientationChanged +=
00065         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnOrientationChanged);
00066
00067     DisplayInformation::DisplayContentsInvalidated +=
00068         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDisplayContentsInvalidated);
00069
00070     currentDisplayInformation->AdvancedColorInfoChanged +=
00071         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnAdvancedColorInfoChanged);
00072
00073     swapChainPanel->CompositionScaleChanged +=
00074         ref new TypedEventHandler<SwapChainPanel^, Object^>(this, &DirectXPage::OnCompositionScaleChanged);
00075
00076     swapChainPanel->SizeChanged +=
00077         ref new SizeChangedEventHandler(this, &DirectXPage::OnSwapChainPanelSizeChanged);
00078
00079     // Pointer and manipulation events handle image pan and zoom.
00080     swapChainPanel->PointerPressed += ref new PointerEventHandler(this, &DirectXPage::OnPointerPressed);
00081     swapChainPanel->PointerMoved += ref new PointerEventHandler(this, &DirectXPage::OnPointerMoved);
00082     swapChainPanel->PointerReleased += ref new PointerEventHandler(this, &DirectXPage::OnPointerReleased);
00083     swapChainPanel->PointerCanceled += ref new PointerEventHandler(this, &DirectXPage::OnPointerCanceled);
00084     swapChainPanel->PointerWheelChanged += ref new PointerEventHandler(this, &DirectXPage::OnPointerWheelChanged);
00085
00086     m_gestureRecognizer = ref new GestureRecognizer();
00087     m_gestureRecognizer->GestureSettings =
00088         GestureSettings::ManipulationTranslateX |
00089         GestureSettings::ManipulationTranslateY |
00090         GestureSettings::ManipulationScale;
00091
00092     m_gestureRecognizer->ManipulationStarted +=
00093         ref new TypedEventHandler<GestureRecognizer^, ManipulationStartedEventArgs^>(this, &DirectXPage::OnManipulationStarted);
00094
00095     m_gestureRecognizer->ManipulationUpdated +=
00096         ref new TypedEventHandler<GestureRecognizer^, ManipulationUpdatedEventArgs^>(this, &DirectXPage::OnManipulationUpdated);
00097
00098     m_gestureRecognizer->ManipulationCompleted +=
00099         ref new TypedEventHandler<GestureRecognizer^, ManipulationCompletedEventArgs^>(this, &DirectXPage::OnManipulationCompleted);
00100
00101     m_renderOptionsViewModel = ref new RenderOptionsViewModel();
00102
00103     // At this point we have access to the device and
00104     // can create the device-dependent resources.
00105     m_deviceResources = std::make_shared<DX::DeviceResources>();
00106     m_deviceResources->SetSwapChainPanel(swapChainPanel);
00107
00108     m_renderer = std::unique_ptr<D2DAdvancedColorImagesRenderer>(new D2DAdvancedColorImagesRenderer(m_deviceResources));
00109
00110     UpdateDisplayACState(currentDisplayInformation->GetAdvancedColorInfo());
00111 }
00112
00113 DirectXPage::~DirectXPage()
00114 {
00115 }
00116
00117 void DirectXPage::LoadDefaultImage()
00118 {
00119     Uri^ uri = ref new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/image-scrgb-icc.jxr");
00120     create_task(StorageFile::CreateStreamedFileFromUriAsync(L"image-scRGB-ICC.jxr", uri, nullptr)).then([=](StorageFile^ imageFile)
00121     {
00122         LoadImage(imageFile);
00123     });
00124 }
00125
00126 void DirectXPage::LoadImage(_In_ StorageFile^ imageFile)
00127 {
00128     create_task(imageFile->OpenAsync(FileAccessMode::Read)
00129         ).then([=](IRandomAccessStream^ ras) {
00130             // If file opening fails, fall through to error handler at the end of task chain.
00131
00132             ComPtr<IStream> iStream;
00133             DX::ThrowIfFailed(CreateStreamOverRandomAccessStream(ras, IID_PPV_ARGS(&iStream)));
00134             return m_renderer->LoadImageFromWic(iStream.Get());
00135     }).then([=](ImageInfo info) {
00136         m_imageInfo = info;
00137
00138         m_renderer->CreateImageDependentResources();
00139         m_imageMaxCLL = m_renderer->FitImageToWindow();
00140
00141         ApplicationView::GetForCurrentView()->Title = imageFile->Name;
00142         ImageACKind->Text = L"Kind: " + ConvertACKindToString(m_imageInfo.imageKind);
00143         ImageHasColorProfile->Text = L"Color profile: " + (m_imageInfo.numProfiles > 0 ? L"Yes" : L"No");
00144         ImageBitDepth->Text = L"Bit depth: " + ref new String(std::to_wstring(m_imageInfo.bitsPerChannel).c_str());
00145         ImageIsFloat->Text = L"Floating point: " + (m_imageInfo.isFloat ? L"Yes" : L"No");
00146
00147         std::wstringstream cllStr;
00148         cllStr << L"Estimated MaxCLL: ";
00149         if (m_imageMaxCLL < 0.0f)
00150         {
00151             cllStr << L"N/A";
00152         }
00153         else
00154         {
00155             cllStr << std::to_wstring(static_cast<int>(m_imageMaxCLL)) << L" nits";
00156         }
00157
00158         ImageMaxCLL->Text = ref new String(cllStr.str().c_str());
00159
00160         // Image loading is done at this point.
00161         m_isImageValid = true;
00162         UpdateDefaultRenderOptions();
00163
00164         // Ensure the preceding continuation runs on the UI thread.
00165     }, task_continuation_context::use_current()).then([=](task<void> previousTask) {
00166         try
00167         {
00168             previousTask.get();
00169         }
00170         catch (...)
00171         {
00172             // Errors resulting from failure to load/decode image are ignored.
00173             return;
00174         }
00175     });
00176 }
00177
00178 void DirectXPage::UpdateDisplayACState(_In_ AdvancedColorInfo^ info)
00179 {
00180     // Render options are meaningless when this method is first called, as no image has been loaded yet.
00181     // Therefore it doesn't matter what value we use for oldDispKind in this case.
00182     auto oldDispKind = m_dispInfo ? m_dispInfo->CurrentAdvancedColorKind : AdvancedColorKind::StandardDynamicRange;
00183     auto newDispKind = info->CurrentAdvancedColorKind;
00184     m_dispInfo = info;
00185
00186     DisplayACState->Text = L"Kind: " + ConvertACKindToString(newDispKind);
00187
00188     unsigned int maxcll = static_cast<unsigned int>(info->MaxLuminanceInNits);
00189
00190     if (maxcll == 0)
00191     {
00192         // Luminance value of 0 means that no valid data was provided by the display.
00193         DisplayPeakLuminance->Text = L"Peak luminance: Unknown";
00194     }
00195     else
00196     {
00197         DisplayPeakLuminance->Text = L"Peak luminance: " + ref new String(std::to_wstring(maxcll).c_str()) + L" nits";
00198     }
00199
00200     if (oldDispKind == newDispKind)
00201     {
00202         // Some changes, such as peak luminance or SDR white level, don't need to reset rendering options.
00203         UpdateRenderOptions();
00204     }
00205     else
00206     {
00207         // If display has changed kind between SDR/HDR/WCG, we must reset all rendering options.
00208         UpdateDefaultRenderOptions();
00209     }
00210
00211 }
00212
00213 // UI element event handlers.
00214
00215 void DirectXPage::LoadImageButtonClick(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
00216 {
00217     FileOpenPicker^ picker = ref new FileOpenPicker();
00218     picker->SuggestedStartLocation = PickerLocationId::Desktop;
00219     picker->FileTypeFilter->Append(L".jxr");
00220     picker->FileTypeFilter->Append(L".jpg");
00221     picker->FileTypeFilter->Append(L".png");
00222     picker->FileTypeFilter->Append(L".tif");
00223
00224     create_task(picker->PickSingleFileAsync()).then([=](StorageFile^ pickedFile) {
00225         if (pickedFile != nullptr)
00226         {
00227             LoadImage(pickedFile);
00228         }
00229     });
00230 }
00231
00232 void DirectXPage::ResetButtonClick(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
00233 {
00234     LoadDefaultImage();
00235 }
00236
00237 // Saves the current state of the app for suspend and terminate events.
00238 void DirectXPage::SaveInternalState(_In_ IPropertySet^ state)
00239 {
00240     m_deviceResources->Trim();
00241 }
00242
00243 // Loads the current state of the app for resume events.
00244 void DirectXPage::LoadInternalState(_In_ IPropertySet^ state)
00245 {
00246 }
00247
00248 // Based on image and display parameters, choose the best rendering options.
00249 void DirectXPage::UpdateDefaultRenderOptions()
00250 {
00251     if (!m_isImageValid)
00252     {
00253         // Render options are only meaningful if an image is already loaded.
00254         return;
00255     }
00256
00257     switch (m_imageInfo.imageKind)
00258     {
00259     case AdvancedColorKind::StandardDynamicRange:
00260     case AdvancedColorKind::WideColorGamut:
00261     default:
00262         // SDR and WCG images don't need to be tonemapped.
00263         RenderEffectCombo->SelectedIndex = 2; // See RenderOptions.h for which value this indicates.
00264
00265         // Manual brightness adjustment is only useful for HDR content.
00266         // SDR and WCG content is adjusted by the OS-provided AdvancedColorInfo::SdrWhiteLevel parameter.
00267         BrightnessAdjustSlider->Value = 1.0f;
00268         BrightnessAdjustPanel->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00269         break;
00270
00271     case AdvancedColorKind::HighDynamicRange:
00272
00273         switch (m_dispInfo->CurrentAdvancedColorKind)
00274         {
00275         case AdvancedColorKind::StandardDynamicRange:
00276         case AdvancedColorKind::WideColorGamut:
00277         default:
00278             // HDR content + non-HDR display: HDR tonemapping is needed for correct rendering.
00279             RenderEffectCombo->SelectedIndex = 0; // See RenderOptions.h for which value this indicates.
00280             break;
00281
00282         case AdvancedColorKind::HighDynamicRange:
00283             // HDR content + HDR display: HDR tonemapping is needed for best results, but this sample's
00284             // tonemappers are very simple and not suitable, so just disable it.
00285             RenderEffectCombo->SelectedIndex = 2; // See RenderOptions.h for which value this indicates.
00286             break;
00287         }
00288
00289         // Manual brightness adjustment is useful for any HDR content.
00290         BrightnessAdjustPanel->Visibility = Windows::UI::Xaml::Visibility::Visible;
00291         break;
00292     }
00293
00294     UpdateRenderOptions();
00295 }
00296
00297 // Common method for updating options on the renderer.
00298 void DirectXPage::UpdateRenderOptions()
00299 {
00300     if ((m_renderer != nullptr) && RenderEffectCombo->SelectedItem)
00301     {
00302         auto tm = static_cast<EffectOption^>(RenderEffectCombo->SelectedItem);
00303
00304         m_renderer->SetRenderOptions(
00305             tm->Kind,
00306             static_cast<float>(BrightnessAdjustSlider->Value),
00307             m_dispInfo
00308             );
00309     }
00310 }
00311
00312 // Window event handlers.
00313
00314 void DirectXPage::OnVisibilityChanged(_In_ CoreWindow^ sender, _In_ VisibilityChangedEventArgs^ args)
00315 {
00316     m_isWindowVisible = args->Visible;
00317     if (m_isWindowVisible)
00318     {
00319         m_renderer->Draw();
00320     }
00321 }
00322
00323 // DisplayInformation event handlers.
00324
00325 void DirectXPage::OnDpiChanged(_In_ DisplayInformation^ sender, _In_ Object^ args)
00326 {
00327     m_deviceResources->SetDpi(sender->LogicalDpi);
00328     m_renderer->CreateWindowSizeDependentResources();
00329     m_renderer->Draw();
00330 }
00331
00332 void DirectXPage::OnOrientationChanged(_In_ DisplayInformation^ sender, _In_ Object^ args)
00333 {
00334     m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
00335     m_renderer->CreateWindowSizeDependentResources();
00336     m_renderer->Draw();
00337 }
00338
00339 void DirectXPage::OnDisplayContentsInvalidated(_In_ DisplayInformation^ sender, _In_ Object^ args)
00340 {
00341     m_deviceResources->ValidateDevice();
00342     m_renderer->CreateWindowSizeDependentResources();
00343     m_renderer->Draw();
00344 }
00345
00346 void DirectXPage::OnAdvancedColorInfoChanged(_In_ DisplayInformation ^sender, _In_ Object ^args)
00347 {
00348     UpdateDisplayACState(sender->GetAdvancedColorInfo());
00349 }
00350
00351
00352 // Other event handlers.
00353
00354 void DirectXPage::OnCompositionScaleChanged(_In_ SwapChainPanel^ sender, _In_ Object^ args)
00355 {
00356     m_deviceResources->SetCompositionScale(sender->CompositionScaleX, sender->CompositionScaleY);
00357     m_renderer->CreateWindowSizeDependentResources();
00358     m_renderer->Draw();
00359 }
00360
00361 void DirectXPage::OnSwapChainPanelSizeChanged(_In_ Object^ sender, _In_ SizeChangedEventArgs^ e)
00362 {
00363     m_deviceResources->SetLogicalSize(e->NewSize);
00364     m_renderer->CreateWindowSizeDependentResources();
00365     m_renderer->Draw();
00366 }
00367
00368 String^ DirectXPage::ConvertACKindToString(AdvancedColorKind kind)
00369 {
00370     String^ displayString;
00371     switch (kind)
00372     {
00373     case AdvancedColorKind::WideColorGamut:
00374         displayString = L"Wide Color Gamut";
00375         break;
00376
00377     case AdvancedColorKind::HighDynamicRange:
00378         displayString = L"High Dynamic Range";
00379         break;
00380
00381     case AdvancedColorKind::StandardDynamicRange:
00382     default:
00383         displayString = L"Standard Dynamic Range";
00384         break;
00385     }
00386
00387     return displayString;
00388 }
00389
00390 void DirectXPage::OnKeyUp(_In_ CoreWindow ^sender, _In_ KeyEventArgs ^args)
00391 {
00392     if (VirtualKey::H == args->VirtualKey)
00393     {
00394         if (Windows::UI::Xaml::Visibility::Collapsed == ControlsPanel->Visibility)
00395         {
00396             OverlayPanel->Visibility = Windows::UI::Xaml::Visibility::Visible;
00397             ControlsPanel->Visibility = Windows::UI::Xaml::Visibility::Visible;
00398         }
00399         else
00400         {
00401             OverlayPanel->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00402             ControlsPanel->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00403         }
00404     }
00405     else if (VirtualKey::F == args->VirtualKey)
00406     {
00407         if (ApplicationView::GetForCurrentView()->IsFullScreenMode)
00408         {
00409             ApplicationView::GetForCurrentView()->ExitFullScreenMode();
00410         }
00411         else
00412         {
00413             ApplicationView::GetForCurrentView()->TryEnterFullScreenMode();
00414         }
00415     }
00416 }
00417
00418 void DirectXPage::SliderChanged(_In_ Object^ sender, _In_ RangeBaseValueChangedEventArgs^ e)
00419 {
00420     UpdateRenderOptions();
00421 }
00422
00423
00424 void DirectXPage::CheckBoxChanged(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
00425 {
00426     UpdateRenderOptions();
00427 }
00428
00429 // ResizeCompleted is used to detect when the window has been moved between different displays.
00430 void DirectXPage::OnResizeCompleted(_In_ CoreWindow^ sender, _In_  Object^ args)
00431 {
00432     UpdateRenderOptions();
00433 }
00434
00435 void DirectXPage::ComboChanged(_In_ Object^ sender, _In_ SelectionChangedEventArgs^ e)
00436 {
00437     UpdateRenderOptions();
00438 }
00439
00440 // Send low level pointer events to GestureRecognizer to be interpreted.
00441 void DirectXPage::OnPointerPressed(_In_ Object^ sender, _In_ PointerRoutedEventArgs^ e)
00442 {
00443     swapChainPanel->CapturePointer(e->Pointer);
00444     m_gestureRecognizer->ProcessDownEvent(e->GetCurrentPoint(swapChainPanel));
00445 }
00446
00447 void DirectXPage::OnPointerMoved(_In_ Object^ sender, _In_ PointerRoutedEventArgs^ e)
00448 {
00449     m_gestureRecognizer->ProcessMoveEvents(e->GetIntermediatePoints(swapChainPanel));
00450 }
00451
00452 void DirectXPage::OnPointerReleased(_In_ Object ^sender, _In_ PointerRoutedEventArgs ^e)
00453 {
00454     m_gestureRecognizer->ProcessUpEvent(e->GetCurrentPoint(swapChainPanel));
00455     swapChainPanel->ReleasePointerCapture(e->Pointer);
00456 }
00457
00458 void DirectXPage::OnPointerCanceled(_In_ Object ^sender, _In_ PointerRoutedEventArgs ^e)
00459 {
00460     m_gestureRecognizer->CompleteGesture();
00461     swapChainPanel->ReleasePointerCapture(e->Pointer);
00462 }
00463
00464 void DirectXPage::OnPointerWheelChanged(_In_ Object ^sender, _In_ PointerRoutedEventArgs ^e)
00465 {
00466     // Passing isControlKeyDown = true causes the wheel delta to be treated as scrolling.
00467     m_gestureRecognizer->ProcessMouseWheelEvent(e->GetCurrentPoint(swapChainPanel), false, true);
00468 }
00469
00470 // GestureRecognizer triggers events on user manipulation of the image content.
00471 void DirectXPage::OnManipulationStarted(_In_ GestureRecognizer ^sender, _In_ ManipulationStartedEventArgs ^args)
00472 {
00473 }
00474
00475 void DirectXPage::OnManipulationUpdated(_In_ GestureRecognizer ^sender, _In_ ManipulationUpdatedEventArgs ^args)
00476 {
00477     m_renderer->UpdateManipulationState(args);
00478 }
00479
00480 void DirectXPage::OnManipulationCompleted(_In_ GestureRecognizer ^sender, _In_ ManipulationCompletedEventArgs ^args)
00481 {
00482 }
Generated on Fri Nov 15 2024 22:19:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Bread Member List

This is the complete list of members for Bread, including all inherited members.
_flavor | Bread | [private]
Bread(String flavor) | Bread | [inline, private]
Flavor | Bread |
Microsoft::SDKSamples::Kitchen::IBread::Flavor([out, retval] HSTRING *value) | IBread |
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomData.xaml.cpp Source File

  • ShareSource
  • cpp

ShareCustomData.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareCustomData.xaml.cpp
00014 // Implementation of the ShareCustomData class
00015 //
00016
00017 #include "pch.h"
00018 #include "ShareCustomData.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::ApplicationModel::DataTransfer;
00024
00025 ShareCustomData::ShareCustomData()
00026 {
00027     InitializeComponent();
00028     CustomDataTextBox->Text =
00029         R"json({
00030     "type" : "http://schema.org/Book",
00031     "properties" :
00032     {
00033         "image" : "http://sourceurl.com/catcher-in-the-rye-book-cover.jpg",
00034         "name" : "The Catcher in the Rye",
00035         "bookFormat" : "http://schema.org/Paperback",
00036         "author" : "http://sourceurl.com/author/jd_salinger.html",
00037         "numberOfPages" : 224,
00038         "publisher" : "Little, Brown, and Company",
00039         "datePublished" : "1991-05-01",
00040         "inLanguage" : "English",
00041         "isbn" : "0316769487"
00042     }
00043 })json";
00044 }
00045
00046 bool ShareCustomData::GetShareContent(DataRequest^ request)
00047 {
00048     bool succeeded = false;
00049
00050     auto dataPackageFormat = DataFormatInputBox->Text;
00051     if (dataPackageFormat != nullptr)
00052     {
00053         auto dataPackageText = CustomDataTextBox->Text;
00054         if (dataPackageText != nullptr)
00055         {
00056             auto requestData = request->Data;
00057             requestData->Properties->Title = TitleInputBox->Text;
00058             requestData->Properties->Description = DescriptionInputBox->Text; // The description is optional.
00059             requestData->Properties->ContentSourceApplicationLink = ApplicationLink;
00060             requestData->SetData(dataPackageFormat, dataPackageText);
00061             succeeded = true;
00062         }
00063         else
00064         {
00065             request->FailWithDisplayText("Enter the custom data you would like to share and try again.");
00066         }
00067     }
00068     else
00069     {
00070         request->FailWithDisplayText("Enter a custom data format and try again.");
00071     }
00072     return succeeded;
00073 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cs/SampleConfiguration.cs Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "WRL In-process Runtime Component";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Using Custom Components", ClassType=typeof(WRLInProcessWinRTComponent.OvenClient)},
00025             new Scenario() { Title="Handling Windows Runtime Exceptions", ClassType=typeof(WRLInProcessWinRTComponent.CustomException)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/Scenario2_Listen.xaml.cpp Source File

  • IoT-GPIO
  • cpp

Scenario2_Listen.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Listen.xaml.cpp
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario2_Listen.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Windows::Devices::Gpio;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 Scenario2_Listen::Scenario2_Listen()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void Scenario2_Listen::OnNavigatedFrom(NavigationEventArgs ^e)
00033 {
00034     StopScenario();
00035 }
00036
00037 void Scenario2_Listen::StartScenario()
00038 {
00039     auto gpio = GpioController::GetDefault();
00040
00041     // Set up our GPIO pin for setting values.
00042     // If this next line crashes with a NullReferenceException,
00043     // then the problem is that there is no GPIO controller on the device.
00044     setPin = gpio->OpenPin(SET_PIN);
00045
00046     // Establish initial value and configure pin for output.
00047     setPin->Write(currentValue);
00048     setPin->SetDriveMode(GpioPinDriveMode::Output);
00049
00050     // Set up our GPIO pin for listening for value changes.
00051     listenPin = gpio->OpenPin(LISTEN_PIN);
00052
00053     // Configure pin for input and add ValueChanged listener.
00054     listenPin->SetDriveMode(GpioPinDriveMode::Input);
00055     valueChangedToken = listenPin->ValueChanged += ref new TypedEventHandler<GpioPin^, GpioPinValueChangedEventArgs^>(this, &Scenario2_Listen::Pin_ValueChanged);
00056
00057     // Start toggling the pin value every 500ms.
00058     timer = ref new DispatcherTimer();
00059     TimeSpan interval;
00060     interval.Duration = 500 * 1000 * 10;
00061     timer->Interval = interval;
00062     timerToken = timer->Tick += ref new EventHandler<Object^>(this, &Scenario2_Listen::Timer_Tick);
00063     timer->Start();
00064 }
00065
00066 void Scenario2_Listen::StopScenario()
00067 {
00068     // Stop the timer.
00069     if (timer != nullptr)
00070     {
00071         timer->Tick -= timerToken;
00072         timer->Stop();
00073         timer = nullptr;
00074     }
00075
00076     // Release the GPIO pins
00077     delete setPin;
00078     setPin = nullptr;
00079
00080     if (listenPin != nullptr)
00081     {
00082         listenPin->ValueChanged -= valueChangedToken;
00083         delete listenPin;
00084         listenPin = nullptr;
00085     }
00086 }
00087
00088 void Scenario2_Listen::StartStopScenario_Click(Object^ sender, RoutedEventArgs^ e)
00089 {
00090     if (timer != nullptr)
00091     {
00092         StopScenario();
00093         StartStopButton->Content = "Start";
00094         ScenarioControls->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00095     }
00096     else
00097     {
00098         StartScenario();
00099         StartStopButton->Content = "Stop";
00100         ScenarioControls->Visibility = Windows::UI::Xaml::Visibility::Visible;
00101     }
00102 }
00103
00104 void Scenario2_Listen::Pin_ValueChanged(GpioPin ^sender, GpioPinValueChangedEventArgs ^e)
00105 {
00106     // Report the change in pin value.
00107     Dispatcher->RunAsync(
00108         CoreDispatcherPriority::Normal,
00109         ref new Windows::UI::Core::DispatchedHandler([this]()
00110         {
00111             CurrentPinValue->Text = listenPin->Read().ToString();
00112         }));
00113 }
00114
00115 void Scenario2_Listen::Timer_Tick(Object ^sender, Object ^e)
00116 {
00117     // Toggle the existing pin value.
00118     currentValue = (currentValue == GpioPinValue::High) ? GpioPinValue::Low : GpioPinValue::High;
00119     setPin->Write(currentValue);
00120 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/MrcEffectDefinitions/pch.cpp Source File

  • HolographicMixedRealityCapture
  • cpp
  • MrcEffectDefinitions

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.h Source File

  • OnDemandHotspot
  • cppwinrt

Scenario1_ManageHotspot.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_ManageHotspot.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_ManageHotspot : Scenario1_ManageHotspotT<Scenario1_ManageHotspot>
00020     {
00021         Scenario1_ManageHotspot();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         void RegisterTasks_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void UnregisterTasks_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         void UpdateNowButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void UpdateOnDemandButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00031         winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork m_network{ nullptr };
00032
00033         bool SavePropertiesForBackgroundTask();
00034     };
00035 }
00036
00037 namespace winrt::SDKTemplate::factory_implementation
00038 {
00039     struct Scenario1_ManageHotspot : Scenario1_ManageHotspotT<Scenario1_ManageHotspot, implementation::Scenario1_ManageHotspot>
00040     {
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/CopyFiles.xaml.cs Source File

  • Clipboard
  • cs

CopyFiles.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.DataTransfer;
00015 using Windows.Storage;
00016 using Windows.Storage.Pickers;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class CopyFiles : Page
00023     {
00024         MainPage rootPage = MainPage.Current;
00025
00026         public CopyFiles()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         async void CopyButton_Click(object sender, RoutedEventArgs e)
00032         {
00033             rootPage.NotifyUser("", NotifyType.StatusMessage);
00034
00035             var filePicker = new FileOpenPicker
00036             {
00037                 ViewMode = PickerViewMode.List,
00038                 FileTypeFilter = { "*" }
00039             };
00040
00041             var storageItems = await filePicker.PickMultipleFilesAsync();
00042             if (storageItems.Count > 0)
00043             {
00044                 var dataPackage = new DataPackage();
00045                 dataPackage.SetStorageItems(storageItems);
00046
00047                 // Request a copy operation from targets that support different file operations, like File Explorer
00048                 dataPackage.RequestedOperation = DataPackageOperation.Copy;
00049                 if (Clipboard.SetContentWithOptions(dataPackage, null))
00050                 {
00051                     rootPage.NotifyUser($"Storage Items: {storageItems.Count} file(s) are copied into clipboard.", NotifyType.StatusMessage);
00052                 }
00053                 else
00054                 {
00055                     // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
00056                     rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
00057                 }
00058             }
00059         }
00060
00061         async void PasteButton_Click(object sender, RoutedEventArgs e)
00062         {
00063             rootPage.NotifyUser("", NotifyType.StatusMessage);
00064
00065             // Get data package from clipboard
00066             var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
00067             if (dataPackageView.Contains(StandardDataFormats.StorageItems))
00068             {
00069                 IReadOnlyList<IStorageItem> storageItems = null;
00070                 try
00071                 {
00072                     storageItems = await dataPackageView.GetStorageItemsAsync();
00073                 }
00074                 catch (Exception ex)
00075                 {
00076                     rootPage.NotifyUser("Error retrieving file(s) from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
00077                 }
00078
00079                 if (storageItems != null)
00080                 {
00081                     OutputText.Text = "Pasting following" + storageItems.Count + " file(s) to the folder " + ApplicationData.Current.LocalFolder.Path + Environment.NewLine;
00082                     var operation = dataPackageView.RequestedOperation;
00083                     OutputText.Text += "Requested Operation: ";
00084                     switch (operation)
00085                     {
00086                         case DataPackageOperation.Copy:
00087                             OutputText.Text += "Copy";
00088                             break;
00089                         case DataPackageOperation.Link:
00090                             OutputText.Text += "Link";
00091                             break;
00092                         case DataPackageOperation.Move:
00093                             OutputText.Text += "Move";
00094                             break;
00095                         case DataPackageOperation.None:
00096                             OutputText.Text += "None";
00097                             break;
00098                         default:
00099                             OutputText.Text += "Unknown";
00100                             break;
00101                     }
00102                     OutputText.Text += Environment.NewLine;
00103
00104                     // Iterate through each item in the collection
00105                     foreach (var storageItem in storageItems)
00106                     {
00107                         var file = storageItem as StorageFile;
00108                         if (file != null)
00109                         {
00110                             // Copy the file
00111                             var newFile = await file.CopyAsync(ApplicationData.Current.LocalFolder, file.Name, NameCollisionOption.ReplaceExisting);
00112                             if (newFile != null)
00113                             {
00114                                 OutputText.Text += file.Name + Environment.NewLine;
00115                             }
00116                         }
00117                         else
00118                         {
00119                             var folder = storageItem as StorageFolder;
00120                             if (folder != null)
00121                             {
00122                                 // Skipping folders for brevity sake
00123                                 OutputText.Text += folder.Path + " is a folder, skipping" + Environment.NewLine;
00124                             }
00125                         }
00126                     }
00127                 }
00128             }
00129             else
00130             {
00131                 OutputText.Text = "StorageItems format is not available in clipboard";
00132             }
00133         }
00134     }
00135 }
Generated on Fri Nov 15 2024 22:18:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario4_ForegroundGeofence.cpp Source File

  • Geolocation
  • cppwinrt

Scenario4_ForegroundGeofence.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_ForegroundGeofence.h"
00014 #include "Scenario4_ForegroundGeofence.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Data::Json;
00019 using namespace winrt::Windows::Devices::Geolocation;
00020 using namespace winrt::Windows::Devices::Geolocation::Geofencing;
00021 using namespace winrt::Windows::Globalization;
00022 using namespace winrt::Windows::Foundation;
00023 using namespace winrt::Windows::Foundation::Collections;
00024 using namespace winrt::Windows::Storage;
00025 using namespace winrt::Windows::UI::Core;
00026 using namespace winrt::Windows::UI::Xaml;
00027 using namespace winrt::Windows::UI::Xaml::Controls;
00028 using namespace winrt::Windows::UI::Xaml::Navigation;
00029
00030 namespace
00031 {
00032     template<typename T, typename U>
00033     void RemoveByValue(T&& collection, U&& value)
00034     {
00035         uint32_t index = 0;
00036         if (collection.IndexOf(value, index))
00037         {
00038             collection.RemoveAt(index);
00039         }
00040     }
00041 }
00042
00043 namespace winrt::SDKTemplate::implementation
00044 {
00045     Scenario4_ForegroundGeofence::Scenario4_ForegroundGeofence()
00046     {
00047         InitializeComponent();
00048     }
00049
00050     fire_and_forget Scenario4_ForegroundGeofence::OnNavigatedTo(NavigationEventArgs const&)
00051     {
00052         auto lifetime = get_strong();
00053
00054         m_visibilityChangedToken = Window::Current().VisibilityChanged({ get_weak(), &Scenario4_ForegroundGeofence::OnVisibilityChanged });
00055
00056         SetStartDateTimeToUI(clock::now() + std::chrono::hours(1));
00057
00058         // Get permission to use location
00059         GeolocationAccessStatus accessStatus = co_await Geolocator::RequestAccessAsync();
00060         switch (accessStatus)
00061         {
00062         case GeolocationAccessStatus::Allowed:
00063             // Wrap in try/catch in case user revokes access suddenly.
00064             try
00065             {
00066                 m_geofenceMonitor = GeofenceMonitor::Current();
00067             }
00068             catch (hresult_access_denied const&)
00069             {
00070                 m_rootPage.NotifyUser(L"Access denied.", NotifyType::ErrorMessage);
00071             }
00072             if (m_geofenceMonitor != nullptr)
00073             {
00074                 for (Geofence geofence : m_geofenceMonitor.Geofences())
00075                 {
00076                     AddGeofenceToRegisteredGeofenceListBox(geofence);
00077                 }
00078
00079                 // register for state change events
00080                 m_geofenceStateChangedToken = m_geofenceMonitor.GeofenceStateChanged({ get_weak(), &Scenario4_ForegroundGeofence::OnGeofenceStateChanged });
00081                 m_geofenceStatusChangedToken = m_geofenceMonitor.StatusChanged({ get_weak(), &Scenario4_ForegroundGeofence::OnGeofenceStatusChanged });
00082             }
00083             break;
00084
00085         case GeolocationAccessStatus::Denied:
00086             m_rootPage.NotifyUser(L"Access denied.", NotifyType::ErrorMessage);
00087             break;
00088
00089         case GeolocationAccessStatus::Unspecified:
00090             m_rootPage.NotifyUser(L"Unspecified error.", NotifyType::ErrorMessage);
00091             break;
00092         }
00093     }
00094
00095     void Scenario4_ForegroundGeofence::OnNavigatedFrom(NavigationEventArgs const&)
00096     {
00097         Window::Current().VisibilityChanged(m_visibilityChangedToken);
00098
00099         if (m_pendingOperation != nullptr)
00100         {
00101             m_pendingOperation.Cancel();
00102             m_pendingOperation = nullptr;
00103         }
00104         if (m_geofenceStateChangedToken)
00105         {
00106             m_geofenceMonitor.GeofenceStateChanged(std::exchange(m_geofenceStateChangedToken, {}));
00107             m_geofenceMonitor.StatusChanged(std::exchange(m_geofenceStatusChangedToken, {}));
00108         }
00109     }
00110
00111     TimeSpan LocalTimeOfDay(DateTime dateTime)
00112     {
00113         // Convert from UTC to local, then calculate remainder.
00114         // This takes advantage of the fact that FILETIME begins at midnight.
00115         FILETIME utc = clock::to_FILETIME(dateTime);
00116         FILETIME local;
00117         FileTimeToLocalFileTime(&utc, &local);
00118         return TimeSpan(file_time(local).value % TimeSpan(std::chrono::hours(24)).count());
00119     }
00120
00121     void Scenario4_ForegroundGeofence::SetStartDateTimeToUI(DateTime dateTime)
00122     {
00123         TimeSpan timeOfDay = LocalTimeOfDay(dateTime);
00124         DateTime startOfDay = dateTime - timeOfDay;
00125         StartDate().Date(startOfDay);
00126         StartTime().Time(timeOfDay);
00127     }
00128
00129     void Scenario4_ForegroundGeofence::OnVisibilityChanged(IInspectable const&, VisibilityChangedEventArgs const& e)
00130     {
00131         // NOTE: After the app is no longer visible on the screen and before the app is suspended
00132         // you might want your app to use toast notification for any geofence activity.
00133         // By registering for VisibiltyChanged the app is notified when the app is no longer visible in the foreground.
00134
00135         if (m_geofenceMonitor != nullptr)
00136         {
00137             if (e.Visible())
00138             {
00139                 // register for foreground events
00140                 m_geofenceStateChangedToken = m_geofenceMonitor.GeofenceStateChanged({ get_weak(), &Scenario4_ForegroundGeofence::OnGeofenceStateChanged });
00141                 m_geofenceStatusChangedToken = m_geofenceMonitor.StatusChanged({ get_weak(), &Scenario4_ForegroundGeofence::OnGeofenceStatusChanged });
00142             }
00143             else
00144             {
00145                 // unregister foreground events (see Scenario 5 to capture events in the background)
00146                 m_geofenceMonitor.GeofenceStateChanged(std::exchange(m_geofenceStateChangedToken, {}));
00147                 m_geofenceMonitor.StatusChanged(std::exchange(m_geofenceStatusChangedToken, {}));
00148             }
00149         }
00150     }
00151
00152     fire_and_forget Scenario4_ForegroundGeofence::OnGeofenceStatusChanged(GeofenceMonitor const& sender, IInspectable const&)
00153     {
00154         auto lifetime = get_strong();
00155
00156         GeofenceMonitorStatus status = sender.Status();
00157
00158         hstring eventDescription = L"Geofence Status Changed " + FormatDateTime(clock::now(), L"shorttime") + L" (" + to_hstring(status) + L")";
00159
00160         co_await resume_foreground(Dispatcher());
00161         AddEventDescription(eventDescription);
00162     }
00163
00164     fire_and_forget Scenario4_ForegroundGeofence::OnGeofenceStateChanged(GeofenceMonitor const& sender, IInspectable const&)
00165     {
00166         auto lifetime = get_strong();
00167
00168         auto reports = sender.ReadReports();
00169
00170         co_await resume_foreground(Dispatcher());
00171
00172         for (GeofenceStateChangeReport report : reports)
00173         {
00174             GeofenceState state = report.NewState();
00175             Geofence geofence = report.Geofence();
00176             hstring eventDescription = geofence.Id() + L" " + FormatDateTime(clock::now(), L"shortime") + L" (" + to_hstring(state);
00177
00178             if (state == GeofenceState::Removed)
00179             {
00180                 eventDescription = eventDescription + L"/" + to_hstring(report.RemovalReason()) + L")";
00181                 AddEventDescription(eventDescription);
00182
00183                 // Remove the geofence from the monitor.
00184                 RemoveByValue(m_geofenceMonitor.Geofences(), geofence);
00185
00186                 // Remove the geofence from the list box.
00187                 auto items = RegisteredGeofenceListBox().Items();
00188                 for (IInspectable item : items)
00189                 {
00190                     if (item.as<ListBoxItem>().Tag() == geofence)
00191                     {
00192                         RemoveByValue(items, item);
00193                         break;
00194                     }
00195                 }
00196             }
00197             else if (state == GeofenceState::Entered || state == GeofenceState::Exited)
00198             {
00199                 // NOTE: You might want to write your app to take particular
00200                 // action based on whether the app has internet connectivity.
00201
00202                 eventDescription = eventDescription + L")";
00203                 AddEventDescription(eventDescription);
00204             }
00205         }
00206     }
00207
00208     void Scenario4_ForegroundGeofence::OnRemoveGeofenceItem(IInspectable const&, RoutedEventArgs const&)
00209     {
00210         auto item = RegisteredGeofenceListBox().SelectedItem().try_as<ListBoxItem>();
00211         if (item != nullptr)
00212         {
00213             Geofence geofence = item.Tag().as<Geofence>();
00214
00215             // remove the geofence from the monitor
00216             RemoveByValue(m_geofenceMonitor.Geofences(), geofence);
00217
00218             // and remove from the UI
00219             RemoveByValue(RegisteredGeofenceListBox().Items(), item);
00220         }
00221     }
00222
00223     Geofence Scenario4_ForegroundGeofence::GenerateGeofence()
00224     {
00225         m_rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00226
00227         hstring fenceKey = Id().Text();
00228         if (fenceKey.empty())
00229         {
00230             m_rootPage.NotifyUser(L"Name must be between 1 and 64 characters.", NotifyType::ErrorMessage);
00231             return nullptr;
00232         }
00233
00234         BasicGeoposition position{};
00235         double radius = 0.0;
00236         if (!ParseDoubleFromTextBox(Longitude(), L"Longitude", -180, 180, position.Longitude) ||
00237             !ParseDoubleFromTextBox(Latitude(), L"Latitude", -90, 90, position.Latitude) ||
00238             !ParseDoubleFromTextBox(Radius(), L"Radius", .1, 10018754.3, radius))
00239         {
00240             return nullptr;
00241         }
00242
00243         position.Altitude = 0.0;
00244
00245         // the geofence is a circular region
00246         Geocircle geocircle(position, radius);
00247
00248         bool singleUse = SingleUse().IsChecked().Value();
00249
00250         // want to listen for enter geofence, exit geofence and remove geofence events
00251         // you can select a subset of these event states
00252         MonitoredGeofenceStates mask = MonitoredGeofenceStates::Entered | MonitoredGeofenceStates::Exited | MonitoredGeofenceStates::Removed;
00253
00254         // Dwell time is how long you need to be in geofence to have been considered to have Entered it.
00255         TimeSpan dwellTime;
00256         if (!ParseTimeSpan(DwellTime().Text(), defaultDwellTime, dwellTime))
00257         {
00258             m_rootPage.NotifyUser(L"Invalid Dwell Time.", NotifyType::ErrorMessage);
00259             return nullptr;
00260         }
00261
00262         // The Duration is the length of time the geofence is active.
00263         // Zero means "infinite duration".
00264         TimeSpan duration;
00265         if (!ParseTimeSpan(Duration().Text(), TimeSpan::zero(), duration))
00266         {
00267             m_rootPage.NotifyUser(L"Invalid Duration.", NotifyType::ErrorMessage);
00268             return nullptr;
00269         }
00270
00271         // setting up the start time of the geofence
00272         DateTime startTime;
00273         if (StartImmediately().IsChecked().Value())
00274         {
00275             // The special "start immediately" value can be used if the duration is zero.
00276             // Otherwise, we get the current time as the start time.
00277             startTime = (duration == TimeSpan::zero()) ? startImmediately : clock::now();
00278         }
00279         else
00280         {
00281             startTime = StartDate().Date() + StartTime().Time();
00282         }
00283
00284         // Let the platform detect other invalid parameter combinations.
00285         try
00286         {
00287             return Geofence(fenceKey, geocircle, mask, singleUse, dwellTime, startTime, duration);
00288         }
00289         catch (...)
00290         {
00291             m_rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
00292             return nullptr;
00293         }
00294     }
00295
00296     void Scenario4_ForegroundGeofence::OnRegisteredGeofenceListBoxSelectionChanged(IInspectable const&, SelectionChangedEventArgs const& e)
00297     {
00298         if (0 == e.AddedItems().Size())
00299         {
00300             // disable the remove button
00301             RemoveGeofenceItem().IsEnabled(false);
00302         }
00303         else
00304         {
00305             // enable the remove button
00306             RemoveGeofenceItem().IsEnabled(true);
00307
00308             // update controls with the values from the newly-selected geofence
00309             Geofence geofence = RegisteredGeofenceListBox().SelectedItem().as<ListBoxItem>().Tag().as<Geofence>();
00310             RefreshControlsFromGeofence(geofence);
00311         }
00312     }
00313
00314     void Scenario4_ForegroundGeofence::RefreshControlsFromGeofence(Geofence const& geofence)
00315     {
00316         Id().Text(geofence.Id());
00317
00318         Geocircle circle = geofence.Geoshape().as<Geocircle>();
00319
00320         BasicGeoposition center = circle.Center();
00321         Latitude().Text(to_hstring(center.Latitude));
00322         Longitude().Text(to_hstring(center.Longitude));
00323         Radius().Text(to_hstring(circle.Radius()));
00324         SingleUse().IsChecked(geofence.SingleUse());;
00325
00326         TimeSpan dwellTime = geofence.DwellTime();
00327         if (dwellTime != TimeSpan{ 0 })
00328         {
00329             DwellTime().Text(to_hstring(dwellTime));
00330         }
00331         else
00332         {
00333             DwellTime().Text(L"");
00334         }
00335
00336         TimeSpan duration = geofence.Duration();
00337         if (duration != TimeSpan{ 0 })
00338         {
00339             Duration().Text(to_hstring(duration));
00340         }
00341         else
00342         {
00343             Duration().Text(L"");
00344         }
00345
00346         DateTime startTime = geofence.StartTime();
00347         if (startTime == startImmediately)
00348         {
00349             StartImmediately().IsChecked(true);
00350         }
00351         else
00352         {
00353             StartAtSpecificTime().IsChecked(true);
00354             SetStartDateTimeToUI(startTime);
00355         }
00356     }
00357
00358     bool Scenario4_ForegroundGeofence::ParseDoubleFromTextBox(TextBox const& textBox, hstring const& name, double minValue, double maxValue, double& value)
00359     {
00360         if (!SDKTemplate::TryParseDouble(textBox.Text().c_str(), value) || (value < minValue) || (value > maxValue))
00361         {
00362             m_rootPage.NotifyUser(name + L" must be between " + to_hstring(minValue) + L" and " + to_hstring(maxValue), NotifyType::StatusMessage);
00363             return false;
00364         }
00365         return true;
00366     }
00367
00368     // add geofence to listbox
00369     void Scenario4_ForegroundGeofence::AddGeofenceToRegisteredGeofenceListBox(Geofence const& geofence)
00370     {
00371         Geocircle circle = geofence.Geoshape().as<Geocircle>();
00372
00373         BasicGeoposition center = circle.Center();
00374         std::wostringstream stream;
00375         stream << std::wstring_view{ geofence.Id() } << L" (" << center.Latitude << L", " << center.Longitude << L", " << circle.Radius() << L")";
00376         ListBoxItem item;
00377         item.Content(box_value(stream.str()));
00378         item.Tag(geofence);
00379         RegisteredGeofenceListBox().Items().InsertAt(0, item);
00380     }
00381
00382     fire_and_forget Scenario4_ForegroundGeofence::OnSetPositionToHere(IInspectable const&, RoutedEventArgs const&)
00383     {
00384         SetPositionProgressBar().Visibility(Visibility::Visible);
00385         SetPositionToHereButton().IsEnabled(false);
00386         Latitude().IsEnabled(false);
00387         Longitude().IsEnabled(false);
00388
00389         try
00390         {
00391             // Carry out the operation
00392             // geolocator and location permissions are initialized and checked on page creation.
00393             Geolocator geolocator;
00394
00395             // Request a high accuracy position for better accuracy locating the geofence
00396             geolocator.DesiredAccuracy(PositionAccuracy::High);
00397
00398             m_pendingOperation = geolocator.GetGeopositionAsync();
00399             Geoposition pos = co_await m_pendingOperation;
00400
00401             BasicGeoposition basicPosition = pos.Coordinate().Point().Position();
00402             Latitude().Text(to_hstring(basicPosition.Latitude));
00403             Longitude().Text(to_hstring(basicPosition.Longitude));
00404
00405             // clear status
00406             m_rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00407         }
00408         catch (hresult_canceled const&)
00409         {
00410             m_rootPage.NotifyUser(L"Task canceled", NotifyType::StatusMessage);
00411         }
00412         catch (...)
00413         {
00414             m_rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
00415         }
00416         m_pendingOperation = nullptr;
00417
00418         SetPositionProgressBar().Visibility(Visibility::Collapsed);
00419         SetPositionToHereButton().IsEnabled(true);
00420         Latitude().IsEnabled(true);
00421         Longitude().IsEnabled(true);
00422     }
00423
00424     void Scenario4_ForegroundGeofence::OnCreateGeofence(IInspectable const&, RoutedEventArgs const&)
00425     {
00426         Geofence geofence = GenerateGeofence();
00427         if (geofence != nullptr)
00428         {
00429             try
00430             {
00431                 // add geofence to GeofenceMonitor
00432                 m_geofenceMonitor.Geofences().Append(geofence);
00433             }
00434             catch (...)
00435             {
00436                 // GeofenceMonitor failed to add the geofence. Possible reasons include
00437                 // duplicate or invalid name, invalid position, having a limited-duration
00438                 // geofence that doesn't leave enough time for the DwellTime to trigger the geofence.
00439                 m_rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
00440                 geofence = nullptr;
00441             }
00442         }
00443
00444         if (geofence != nullptr)
00445         {
00446             // Update UI after geofence successfully added to GeofenceMonitor.
00447             AddGeofenceToRegisteredGeofenceListBox(geofence);
00448         }
00449     }
00450
00451     void Scenario4_ForegroundGeofence::AddEventDescription(hstring const& eventDescription)
00452     {
00453         ListBoxItem item;
00454         item.Content(box_value(eventDescription));
00455         GeofenceEventsListBox().Items().InsertAt(0, item);
00456     }
00457
00458     // TimeSpan format is days:hours:minutes:seconds.
00459     // Leading zeroes may be omitted, so you can also write "minutes:seconds", for example.
00460     // As an extreme case, "" is the same as "0:0:0:0".
00461     bool Scenario4_ForegroundGeofence::ParseTimeSpan(hstring const& field, TimeSpan defaultValue, TimeSpan& value)
00462     {
00463         value = TimeSpan(0);
00464         uint32_t fields[4]{};
00465
00466         wchar_t const* str = field.c_str();
00467         uint32_t count;
00468         for (count = 0; *str && count < 4; count++)
00469         {
00470             str = SDKTemplate::TryParseUIntPrefix(str, fields[count]);
00471             if (!str)
00472             {
00473                 // Not parseable.
00474                 return false;
00475             }
00476
00477             // Must be end of string or colon
00478             if (*str == L':')
00479             {
00480                 str++;
00481             }
00482             else if (*str != L'\0')
00483             {
00484                 return false;
00485             }
00486         }
00487         // Should be at end of string now.
00488         if (*str != L'\0')
00489         {
00490             return false;
00491         }
00492
00493         std::reverse(&fields[0], &fields[count]);
00494
00495         value = std::chrono::hours(fields[3] * 24) +
00496             std::chrono::hours(fields[2]) +
00497             std::chrono::minutes(fields[1]) +
00498             std::chrono::seconds(fields[0]);
00499
00500         if (value.count() == 0)
00501         {
00502             value = defaultValue;
00503         }
00504
00505         return true;
00506     }
00507 }
Generated on Fri Nov 15 2024 22:19:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Scenario1_LowLatencyInput.xaml.cpp Source File

  • LowLatencyInput
  • cpp

Scenario1_LowLatencyInput.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_LowLatencyInput.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Graphics::Display;
00021 using namespace Windows::System::Threading;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Input;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace concurrency;
00032
00033 Scenario1_LowLatencyInput::Scenario1_LowLatencyInput() :
00034     rootPage(MainPage::Current),
00035     windowVisible(true),
00036     coreInput(nullptr)
00037 {
00038     InitializeComponent();
00039
00040     // Register event handlers for page lifecycle.
00041     CoreWindow^ window = Window::Current->CoreWindow;
00042
00043     window->VisibilityChanged +=
00044         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &Scenario1_LowLatencyInput::OnVisibilityChanged);
00045
00046     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00047
00048     currentDisplayInformation->DpiChanged +=
00049         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &Scenario1_LowLatencyInput::OnDpiChanged);
00050
00051     currentDisplayInformation->OrientationChanged +=
00052         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &Scenario1_LowLatencyInput::OnOrientationChanged);
00053
00054     DisplayInformation::DisplayContentsInvalidated +=
00055         ref new TypedEventHandler<DisplayInformation^, Object^>(this, &Scenario1_LowLatencyInput::OnDisplayContentsInvalidated);
00056
00057     swapChainPanel->CompositionScaleChanged +=
00058         ref new TypedEventHandler<SwapChainPanel^, Object^>(this, &Scenario1_LowLatencyInput::OnCompositionScaleChanged);
00059
00060     swapChainPanel->SizeChanged +=
00061         ref new SizeChangedEventHandler(this, &Scenario1_LowLatencyInput::OnSwapChainPanelSizeChanged);
00062
00063     Application::Current->Suspending +=
00064         ref new SuspendingEventHandler(this, &Scenario1_LowLatencyInput::OnSuspending);
00065
00066     // Disable all pointer visual feedback for better performance when touching.
00067     auto pointerVisualizationSettings = PointerVisualizationSettings::GetForCurrentView();
00068     pointerVisualizationSettings->IsContactFeedbackEnabled = false;
00069     pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
00070
00071     // At this point we have access to the device and can create the device-dependent resources
00072     // and set the swap chain panel to the XAML SwapChainPanel element
00073     deviceResources = std::make_shared<DX::DeviceResources>();
00074     deviceResources->SetSwapChainPanel(swapChainPanel);
00075
00076     // Register our SwapChainPanel to get input pointer events on a dedicated input thread and off the UI thread
00077     auto inputWorkItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
00078     {
00079         // The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on.
00080         coreInput = swapChainPanel->CreateCoreIndependentInputSource(
00081             CoreInputDeviceTypes::Mouse |
00082             CoreInputDeviceTypes::Touch |
00083             CoreInputDeviceTypes::Pen
00084             );
00085
00086         // Register for pointer events, which will be raised on the dedicated input thread.
00087         coreInput->PointerPressed += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &Scenario1_LowLatencyInput::OnPointerPressed);
00088         coreInput->PointerMoved += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &Scenario1_LowLatencyInput::OnPointerMoved);
00089         coreInput->PointerReleased += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &Scenario1_LowLatencyInput::OnPointerReleased);
00090         coreInput->PointerExited += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &Scenario1_LowLatencyInput::OnPointerExited);
00091
00092         //Create a gesture recognizer to handle manipulation events and configure it for translation and rotation
00093         directXGestureRecognizer = ref new Windows::UI::Input::GestureRecognizer();
00094
00095         directXGestureRecognizer->GestureSettings =
00096             Windows::UI::Input::GestureSettings::ManipulationTranslateX |
00097             Windows::UI::Input::GestureSettings::ManipulationTranslateY |
00098             Windows::UI::Input::GestureSettings::ManipulationRotate |
00099             Windows::UI::Input::GestureSettings::ManipulationTranslateInertia |
00100             Windows::UI::Input::GestureSettings::ManipulationRotateInertia;
00101
00102         directXGestureRecognizer->ManipulationStarted +=
00103             ref new TypedEventHandler<GestureRecognizer^, ManipulationStartedEventArgs^>(this, &Scenario1_LowLatencyInput::OnManipulationStarted);
00104         directXGestureRecognizer->ManipulationUpdated +=
00105             ref new TypedEventHandler<GestureRecognizer^, ManipulationUpdatedEventArgs^>(this, &Scenario1_LowLatencyInput::OnManipulationUpdated);
00106         directXGestureRecognizer->ManipulationInertiaStarting +=
00107             ref new TypedEventHandler<GestureRecognizer^, ManipulationInertiaStartingEventArgs^>(this, &Scenario1_LowLatencyInput::OnManipulationInertiaStarting);
00108         directXGestureRecognizer->ManipulationCompleted +=
00109             ref new TypedEventHandler<GestureRecognizer^, ManipulationCompletedEventArgs^>(this, &Scenario1_LowLatencyInput::OnManipulationCompleted);
00110
00111         // Begin constantly processing input messages as they're delivered.
00112         coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
00113     });
00114
00115     // Run input task on a dedicated high priority background thread.
00116     inputLoopWorker = ThreadPool::RunAsync(inputWorkItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
00117
00118     // Create a GestureRecognizer which will be used to process the manipulations on the XAML Border element
00119     xamlGestureRecognizer = ref new GestureRecognizer();
00120
00121     // Create a ManipulationProcessor which will listen for events on the XAML Border element,
00122     // process them, and update the Border's position, size, and rotation
00123     manipulationProcessor = ref new ManipulationProcessor(xamlGestureRecognizer, manipulateMe, mainCanvas);
00124
00125     //Set up a dispatchTimer to be used to artificially block the UI thread
00126     dispatcherTimer = ref new DispatcherTimer;
00127     dispatcherTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario1_LowLatencyInput::DispatcherTimer_Tick);
00128     TimeSpan time;
00129     time.Duration = 1000;
00130     dispatcherTimer->Interval = time;
00131
00132     window->SizeChanged +=
00133         ref new TypedEventHandler<CoreWindow ^, WindowSizeChangedEventArgs ^>(this, &Scenario1_LowLatencyInput::OnSizeChanged);
00134
00135     //Check initial width of app window, and set the rect to the approriate size
00136     main = std::unique_ptr<LowLatencyInputMain>(new LowLatencyInputMain(deviceResources));
00137
00138     if (window->Bounds.Width < minScreenWidth)
00139     {
00140         main->SetRectSize(smallRectSize);
00141     }
00142     else
00143     {
00144         main->SetRectSize(bigRectSize);
00145     }
00146
00147     main->StartRenderLoop();
00148 }
00149
00150 Scenario1_LowLatencyInput::~Scenario1_LowLatencyInput()
00151 {
00152     // Stop rendering and processing events on destruction.
00153     main->StopRenderLoop();
00154     coreInput->Dispatcher->StopProcessEvents();
00155 }
00156
00157 void Scenario1_LowLatencyInput::DispatcherTimer_Tick(Platform::Object^ sender, Platform::Object^ e)
00158 {
00159     // Artificially block UI thread for 100ms
00160     Sleep(100);
00161 }
00162
00163 void Scenario1_LowLatencyInput::OnSizeChanged(CoreWindow ^sender, WindowSizeChangedEventArgs ^args)
00164 {
00165     //Update rect size based on window width. If it's below 720, reduce size of rect to 125px instead of 200px
00166     //Make consts and move into funtion to call
00167     if (args->Size.Width < minScreenWidth)
00168         main->SetRectSize(smallRectSize);
00169     else
00170         main->SetRectSize(bigRectSize);
00171 }
00172
00173 void Scenario1_LowLatencyInput::OnPointerPressed(Object^ sender, PointerEventArgs^ args)
00174 {
00175     //1. Get the current point
00176     PointerPoint^ currentPoint = args->CurrentPoint;
00177
00178     //2. Hit test the rect
00179     if (main->HitTest(currentPoint->Position))
00180     {
00181         //3. Process the current point in gesture recognizer
00182         directXGestureRecognizer->ProcessDownEvent(currentPoint);
00183     }
00184 }
00185
00186 void Scenario1_LowLatencyInput::OnPointerMoved(Object^ sender, PointerEventArgs^ args)
00187 {
00188     // Get the intermediate points and process them in your gestureRecognizer
00189     IVector<PointerPoint^>^ pointerPoints = PointerPoint::GetIntermediatePoints(args->CurrentPoint->PointerId);
00190
00191     directXGestureRecognizer->ProcessMoveEvents(pointerPoints);
00192 }
00193
00194 void Scenario1_LowLatencyInput::OnPointerReleased(Object^ sender, PointerEventArgs^ args)
00195 {
00196     // Get the current point and process it in your gestureRecognizer
00197     PointerPoint^ pointerPoint = args->CurrentPoint;
00198     directXGestureRecognizer->ProcessUpEvent(pointerPoint);
00199 }
00200
00201 void Scenario1_LowLatencyInput::OnPointerExited(Object^ sender, PointerEventArgs^ args)
00202 {
00203     // Get the current point and process it in your gestureRecognizer
00204     PointerPoint^ pointerPoint = args->CurrentPoint;
00205     directXGestureRecognizer->ProcessUpEvent(pointerPoint);
00206 }
00207
00208 void Scenario1_LowLatencyInput::OnManipulationStarted(GestureRecognizer^ sender, ManipulationStartedEventArgs^ args)
00209 {
00210     //Handle logic you want to occur when the manipulation starts here
00211     main->SetBrushColor(D2D1::ColorF::Orange);
00212 }
00213
00214 void Scenario1_LowLatencyInput::OnManipulationUpdated(GestureRecognizer^ sender,  ManipulationUpdatedEventArgs^ args)
00215 {
00216     Point position = args->Position;
00217     Windows::UI::Input::ManipulationDelta delta = args->Delta;
00218     main->UpdateRectTransform(position, delta);
00219 }
00220
00221 void Scenario1_LowLatencyInput::OnManipulationInertiaStarting(GestureRecognizer^,  ManipulationInertiaStartingEventArgs^)
00222 {
00223     //Handle logic you want to occur when the inertia due to manipulation starts here
00224     main->SetBrushColor(D2D1::ColorF::OrangeRed);
00225 }
00226
00227 void Scenario1_LowLatencyInput::OnManipulationCompleted(GestureRecognizer^,  ManipulationCompletedEventArgs^)
00228 {
00229     //Handle logic you want to occur when the manipulation completes here
00230     main->SetBrushColor(D2D1::ColorF::LightSlateGray);
00231 }
00232
00233 ManipulationProcessor::ManipulationProcessor(Windows::UI::Input::GestureRecognizer^ gestureRecognizer, Windows::UI::Xaml::Controls::Border^ target, Windows::UI::Xaml::UIElement^ referenceFrame)
00234 {
00235     xamlGestureRecognizer = gestureRecognizer;
00236     element = target;
00237     reference = referenceFrame;
00238
00239     // Initialize the transforms that will be used to manipulate the shape
00240     InitializeTransforms();
00241
00242     // The GestureSettings property dictates what manipulation events the
00243     // Gesture Recognizer will listen to.  This will set it to a limited
00244     // subset of these events.
00245     xamlGestureRecognizer->GestureSettings = Windows::UI::Input::GestureSettings::ManipulationTranslateX |
00246         Windows::UI::Input::GestureSettings::ManipulationTranslateY |
00247         Windows::UI::Input::GestureSettings::ManipulationRotate |
00248         Windows::UI::Input::GestureSettings::ManipulationTranslateInertia |
00249         Windows::UI::Input::GestureSettings::ManipulationRotateInertia;
00250
00251     // Set up pointer event handlers.  These receive input events that are used by the gesture recognizer.
00252     element->PointerPressed += ref new PointerEventHandler(this, &ManipulationProcessor::OnPointerPressed);
00253     element->PointerMoved += ref new PointerEventHandler(this, &ManipulationProcessor::OnPointerMoved);
00254     element->PointerReleased += ref new PointerEventHandler(this, &ManipulationProcessor::OnPointerReleased);
00255     element->PointerCanceled += ref new PointerEventHandler(this, &ManipulationProcessor::OnPointerCanceled);
00256
00257     // Set up event handlers to respond to gesture recognizer output
00258     xamlGestureRecognizer->ManipulationStarted +=
00259         ref new TypedEventHandler<GestureRecognizer^, ManipulationStartedEventArgs^>(this, &ManipulationProcessor::OnManipulationStarted);
00260     xamlGestureRecognizer->ManipulationUpdated +=
00261         ref new TypedEventHandler<GestureRecognizer^, ManipulationUpdatedEventArgs^>(this, &ManipulationProcessor::OnManipulationUpdated);
00262     xamlGestureRecognizer->ManipulationInertiaStarting +=
00263         ref new TypedEventHandler<GestureRecognizer^, ManipulationInertiaStartingEventArgs^>(this, &ManipulationProcessor::OnManipulationInertiaStarting);
00264     xamlGestureRecognizer->ManipulationCompleted +=
00265         ref new TypedEventHandler<GestureRecognizer^, ManipulationCompletedEventArgs^>(this, &ManipulationProcessor::OnManipulationCompleted);
00266 }
00267
00268 // Route the pointer pressed event to the gesture recognizer.
00269 // The points are in the reference frame of the canvas that contains the rectangle element.
00270 void ManipulationProcessor::OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
00271 {
00272     // Set the pointer capture to the element being interacted with so that only it
00273     // will fire pointer-related events
00274     element->CapturePointer(args->Pointer);
00275
00276     // Feed the current point into the gesture recognizer as a down event
00277     xamlGestureRecognizer->ProcessDownEvent(args->GetCurrentPoint(reference));
00278 }
00279
00280 // Route the pointer moved event to the gesture recognizer.
00281 // The points are in the reference frame of the canvas that contains the rectangle element.
00282 void ManipulationProcessor::OnPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
00283 {
00284     // Feed the set of points into the gesture recognizer as a move event
00285     xamlGestureRecognizer->ProcessMoveEvents(args->GetIntermediatePoints(reference));
00286 }
00287
00288 // Route the pointer released event to the gesture recognizer.
00289 // The points are in the reference frame of the canvas that contains the rectangle element.
00290 void ManipulationProcessor::OnPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
00291 {
00292     // Feed the current point into the gesture recognizer as an up event
00293     xamlGestureRecognizer->ProcessUpEvent(args->GetCurrentPoint(reference));
00294
00295     // Release the pointer
00296     element->ReleasePointerCapture(args->Pointer);
00297 }
00298
00299 // Route the pointer canceled event to the gesture recognizer.
00300 // The points are in the reference frame of the canvas that contains the rectangle element.
00301 void ManipulationProcessor::OnPointerCanceled(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
00302 {
00303     xamlGestureRecognizer->CompleteGesture();
00304     element->ReleasePointerCapture(args->Pointer);
00305 }
00306
00307 // When a manipuliation begins, change the color of the object to reflect
00308 // that a manipulation is in progress
00309 void ManipulationProcessor::OnManipulationStarted(GestureRecognizer^ sender, Windows::UI::Input::ManipulationStartedEventArgs^ args)
00310 {
00311     element->Background = ref new SolidColorBrush(Windows::UI::Colors::DeepSkyBlue);
00312 }
00313
00314 // Process the change resulting from a manipulation
00315 void ManipulationProcessor::OnManipulationUpdated(GestureRecognizer^ sender, Windows::UI::Input::ManipulationUpdatedEventArgs^ args)
00316 {
00317     previousTransform->Matrix = cumulativeTransform->Value;
00318
00319     // Get the center point of the manipulation for rotation
00320     Point center = Point(args->Position.X, args->Position.Y);
00321     deltaTransform->CenterX = center.X;
00322     deltaTransform->CenterY = center.Y;
00323
00324     // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
00325     // the rotation, X, and Y changes
00326     deltaTransform->Rotation = args->Delta.Rotation;
00327     deltaTransform->TranslateX = args->Delta.Translation.X;
00328     deltaTransform->TranslateY = args->Delta.Translation.Y;
00329 }
00330
00331 // When a manipuliation that's a result of inertia begins, change the color of the
00332 // object to reflect that inertia has taken over
00333 void ManipulationProcessor::OnManipulationInertiaStarting(GestureRecognizer^ sender, Windows::UI::Input::ManipulationInertiaStartingEventArgs^ args)
00334 {
00335     element->Background = ref new SolidColorBrush(Windows::UI::Colors::RoyalBlue);
00336
00337 }
00338
00339 // When a manipulation has finished, rest the color of the object
00340 void ManipulationProcessor::OnManipulationCompleted(GestureRecognizer^ sender, Windows::UI::Input::ManipulationCompletedEventArgs^ args)
00341 {
00342     element->Background = ref new SolidColorBrush(Windows::UI::Colors::LightGray);
00343 }
00344
00345 void ManipulationProcessor::InitializeTransforms()
00346 {
00347     cumulativeTransform = ref new TransformGroup();
00348     deltaTransform = ref new CompositeTransform();
00349     previousTransform = ref new MatrixTransform();
00350     previousTransform->Matrix = Matrix::Identity;
00351
00352     cumulativeTransform->Children->Append(previousTransform);
00353     cumulativeTransform->Children->Append(deltaTransform);
00354
00355     element->RenderTransform = cumulativeTransform;
00356 }
00357
00358 void ManipulationProcessor::ResetRect()
00359 {
00360     xamlGestureRecognizer->CompleteGesture();
00361     InitializeTransforms();
00362 }
00363
00364 void Scenario1_LowLatencyInput::ResetButton_Pressed(Object^ sender, RoutedEventArgs^ e)
00365 {
00366     //set rect back to original coordinates
00367     directXGestureRecognizer->CompleteGesture();
00368     main->ResetRect();
00369     manipulationProcessor->ResetRect();
00370 }
00371
00372 void Scenario1_LowLatencyInput::BlockUIThread_Toggled(Object^ sender, RoutedEventArgs^ e)
00373 {
00374     if (dispatcherTimer->IsEnabled)
00375     {
00376         dispatcherTimer->Stop();
00377     }
00378     else
00379     {
00380         dispatcherTimer->Start();
00381     }
00382 }
00383
00384 void Scenario1_LowLatencyInput::OnCompositionScaleChanged(SwapChainPanel^ sender, Object^ args)
00385 {
00386     critical_section::scoped_lock lock(main->GetCriticalSection());
00387     deviceResources->SetCompositionScale(sender->CompositionScaleX, sender->CompositionScaleY);
00388 }
00389
00390 void Scenario1_LowLatencyInput::OnSwapChainPanelSizeChanged(Object^ sender, SizeChangedEventArgs^ args)
00391 {
00392     critical_section::scoped_lock lock(main->GetCriticalSection());
00393     deviceResources->SetLogicalSize(args->NewSize);
00394 }
00395
00396 void Scenario1_LowLatencyInput::OnSuspending(Object^ /* sender */, Windows::ApplicationModel::SuspendingEventArgs^ /* e */)
00397 {
00398     critical_section::scoped_lock lock(main->GetCriticalSection());
00399     deviceResources->Trim();
00400  }
00401
00402 // Window event handlers.
00403 void Scenario1_LowLatencyInput::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
00404 {
00405     windowVisible = args->Visible;
00406     if (windowVisible)
00407     {
00408         main->StartRenderLoop();
00409     }
00410     else
00411     {
00412         main->StopRenderLoop();
00413     }
00414 }
00415
00416 // DisplayInformation event handlers.
00417 void Scenario1_LowLatencyInput::OnDpiChanged(DisplayInformation^ sender, Object^ args)
00418 {
00419     critical_section::scoped_lock lock(main->GetCriticalSection());
00420     deviceResources->SetDpi(sender->LogicalDpi);
00421 }
00422
00423 void Scenario1_LowLatencyInput::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
00424 {
00425     critical_section::scoped_lock lock(main->GetCriticalSection());
00426     deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
00427 }
00428
00429 void Scenario1_LowLatencyInput::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args)
00430 {
00431     critical_section::scoped_lock lock(main->GetCriticalSection());
00432     deviceResources->ValidateDevice();
00433 }
Generated on Fri Nov 15 2024 22:20:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/PcscDefs.cs Source File

  • Nfc
  • PcscSdk

PcscDefs.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace Pcsc
00013 {
00014     /// <summary>
00015     /// PCSC storage standard enum (ss byte)
00016     /// </summary>
00017     public enum StorageStandard : byte
00018     {
00019         Unknown                         = 0x00,
00020         Iso14443AP1                     = 0x01,
00021         Iso14443AP2                     = 0x02,
00022         Iso14443AP3                     = 0x03,
00023         Iso14443ARfu                    = 0x04,
00024
00025         Iso14443BP1                     = 0x05,
00026         Iso14443BP2                     = 0x06,
00027         Iso14443BP3                     = 0x07,
00028         Iso14443BRfu                    = 0x08,
00029
00030         Iso15693P1                      = 0x09,
00031         Iso15693P2                      = 0x0A,
00032         Iso15693P3                      = 0x0B,
00033         Iso15693P4                      = 0x0C,
00034
00035         Iso7816CI2C                     = 0x0D,
00036         Iso7816CEI2C                    = 0x0E,
00037         Iso7816C2WBP                    = 0x0F,
00038         Iso7816C3WBP                    = 0x10,
00039
00040         FeliCa                          = 0x11,
00041
00042         LowFreqCContactless             = 0x40,
00043     }
00044
00045     /// <summary>
00046     /// PCSC card name enum (nn short)
00047     /// </summary>
00048     public enum CardName : ushort
00049     {
00050         Unknown                         = 0x0000,
00051
00052         MifareStandard1K                = 0x0001,
00053         MifareStandard4K                = 0x0002,
00054         MifareUltralight                = 0x0003,
00055         SLE55R                          = 0x0004,
00056         SR176                           = 0x0006,
00057         SRIX4K                          = 0x0007,
00058         AT88RF020                       = 0x0008,
00059         AT88SC0204CRF                   = 0x0009,
00060         AT88SC0808CRF                   = 0x000A,
00061         AT88SC1616CRF                   = 0x000B,
00062         AT88SC3216CRF                   = 0x000C,
00063         AT88SC6416CRF                   = 0x000D,
00064         SRF55V10P                       = 0x000E,
00065         SRF55V02P                       = 0x000F,
00066         SRF55V10S                       = 0x0010,
00067         SRF55V02S                       = 0x0011,
00068         TAG_IT                          = 0x0012,
00069         LRI512                          = 0x0013,
00070         ICODESLI                        = 0x0014,
00071         TEMPSENS                        = 0x0015,
00072         ICODE1                          = 0x0016,
00073         PicoPass2K                      = 0x0017,
00074         PicoPass2KS                     = 0x0018,
00075         PicoPass16K                     = 0x0019,
00076         PicoPass16Ks                    = 0x001A,
00077         PicoPass16K8x2                  = 0x001B,
00078         PicoPass16KS8x2                 = 0x001C,
00079         PicoPass32KS16p16               = 0x001D,
00080         PicoPass32KS16p8x2              = 0x001E,
00081         PicoPass32KS8x2p16              = 0x001F,
00082         PicoPass32KS8x2p8x2             = 0x0020,
00083         LRI64                           = 0x0021,
00084         ICODEUID                        = 0x0022,
00085         ICODEEPC                        = 0x0023,
00086         LRI12                           = 0x0024,
00087         LRI128                          = 0x0025,
00088         MifareMini                      = 0x0026,
00089         SLE66R01P                       = 0x0027,
00090         SLE66RxxP                       = 0x0028,
00091         SLE66RxxS                       = 0x0029,
00092         SLE55RxxE                       = 0x002A,
00093         SRF55V01P                       = 0x002B,
00094         SRF66V10ST                      = 0x002C,
00095         SRF66V10IT                      = 0x002D,
00096         SRF66V01ST                      = 0x002E,
00097         JewelTag                        = 0x002F,
00098         TopazTag                        = 0x0030,
00099         AT88SC0104CRF                   = 0x0031,
00100         AT88SC0404CRF                   = 0x0032,
00101         AT88RF01C                       = 0x0033,
00102         AT88RF04C                       = 0x0034,
00103         iCodeSL2                        = 0x0035,
00104         MifarePlusSL1_2K                = 0x0036,
00105         MifarePlusSL1_4K                = 0x0037,
00106         MifarePlusSL2_2K                = 0x0038,
00107         MifarePlusSL2_4K                = 0x0039,
00108         MifareUltralightC               = 0x003A,
00109         FeliCa                          = 0x003B,
00110         MelexisSensorTagMLX90129        = 0x003C,
00111         MifareUltralightEV1             = 0x003D,
00112
00113         CardNameMaxValue                = MifareUltralightEV1,
00114     }
00115
00116     /// <summary>
00117     /// Enumeration of possible instructions
00118     /// </summary>
00119     public enum Ins : byte
00120     {
00121         GetData = 0xCA,
00122         LoadKeys = 0x82,
00123         GeneralAuthenticate = 0x86,
00124         Verify = 0x20,
00125         ReadBinary = 0xB0,
00126         UpdateBinary = 0xD6,
00127     }
00128 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.h Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario7_DownloadReordering.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario7_DownloadReordering.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     // Class for each download and its row in the UI.
00021     public ref class DownloadOperationItem sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
00022     {
00023     public:
00024         DownloadOperationItem(Windows::Networking::BackgroundTransfer::DownloadOperation^ download);
00025
00026         virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00027
00028         property Windows::Networking::BackgroundTransfer::DownloadOperation^ download
00029         {
00030             Windows::Networking::BackgroundTransfer::DownloadOperation^ get();
00031         }
00032
00033         property int percentComplete
00034         {
00035             int get();
00036             void set(int value);
00037         }
00038
00039         property Platform::String^ stateText
00040         {
00041             Platform::String^ get();
00042             void set(Platform::String^ value);
00043         }
00044
00045     private:
00046         Windows::Networking::BackgroundTransfer::DownloadOperation^ _download;
00047         int _percentComplete;
00048         Platform::String^ _stateText;
00049     };
00050
00051     [Windows::Foundation::Metadata::WebHostHidden]
00052     public ref class Scenario7_DownloadReordering sealed
00053     {
00054     public:
00055         Scenario7_DownloadReordering();
00056
00057         property Windows::Foundation::Collections::IObservableVector<DownloadOperationItem^>^ downloadCollection
00058         {
00059             Windows::Foundation::Collections::IObservableVector<DownloadOperationItem^>^ get();
00060         }
00061     protected:
00062         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00063
00064     private:
00065         Concurrency::task<std::vector<Windows::Networking::BackgroundTransfer::DownloadOperation^>>
00066             CancelActiveDownloadsAsync();
00067         void StartDownload_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00068         void MakeCurrent_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs e);
00069         Concurrency::task<void> RunDownloadsAsync();
00070         Concurrency::task<Windows::Networking::BackgroundTransfer::DownloadOperation^> CreateDownloadAsync(
00071             Windows::Networking::BackgroundTransfer::BackgroundDownloader^ downloader,
00072             Platform::String^ remoteAddress,
00073             Platform::String^ fileName);
00074         Concurrency::task<void> DownloadAsync(DownloadOperationItem^ item);
00075         void DownloadProgress(DownloadOperationItem^ item);
00076         bool Scenario7_DownloadReordering::IsWebException(
00077             Platform::String^ title,
00078             Platform::Exception^ ex,
00079             Windows::Networking::BackgroundTransfer::DownloadOperation^ download = nullptr);
00080
00081         const int NumDownloads = 5;
00082
00083         MainPage^ rootPage;
00084         Windows::Networking::BackgroundTransfer::BackgroundTransferGroup^ reorderGroup;
00085         Windows::Foundation::Collections::IObservableVector<DownloadOperationItem^>^ _downloadCollection;
00086     };
00087 }
Generated on Fri Nov 15 2024 22:18:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/SampleConfiguration.h Source File

  • MapControl
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "MapControl C++ Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         static Windows::Devices::Geolocation::Geopoint^ SeattleGeopoint;
00039         static Platform::Collections::Vector<Windows::UI::Xaml::Controls::Maps::MapElement^>^ CreateCityBuildingsCollection();
00040         static Platform::Collections::Vector<Windows::UI::Xaml::Controls::Maps::MapElement^>^ CreateCityParksCollection();
00041
00042     private:
00043         static Platform::Array<Scenario>^ scenariosInner;
00044     };
00045
00046     public value struct Scenario
00047     {
00048         Platform::String^ Title;
00049         Platform::String^ ClassName;
00050     };
00051
00052     struct GeoEquals
00053     {
00054         bool operator()(const Windows::Devices::Geolocation::BasicGeoposition& left, const Windows::Devices::Geolocation::BasicGeoposition& right) const
00055         {
00056             return left.Altitude == right.Altitude && left.Latitude == right.Latitude && left.Longitude == right.Longitude;
00057         }
00058     };
00059
00060
00061 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/Scenario3_ForegroundApp.xaml.cs Source File

  • HotspotAuthentication
  • cs

Scenario3_ForegroundApp.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using HotspotAuthenticationTask;
00013 using System;
00014 using Windows.Networking.NetworkOperators;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// The page is used to handle authenticate by foreground app scenario
00023     /// </summary>
00024     public sealed partial class Scenario3_ForegroundApp : Page
00025     {
00026         // A pointer back to the main page.  This is needed to call methods in MainPage such as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         HotspotAuthenticationContext authenticationContext;
00030
00031         public Scenario3_ForegroundApp()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         /// <summary>
00037         /// Invoked when this page is about to be displayed in a Frame.
00038         /// </summary>
00039         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040         /// property is typically used to configure the page.</param>
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             // Configure background task handler to trigger foregound app for authentication
00044             ConfigStore.AuthenticateThroughBackgroundTask = false;
00045
00046             // Setup completion handler
00047             ScenarioCommon.Instance.RegisteredCompletionHandlerForBackgroundTask();
00048
00049             // Register event to update UI state on authentication event
00050             ScenarioCommon.Instance.BackgroundAuthenticationCompleted += OnBackgroundAuthenticationCompleted;
00051
00052             // Check current authentication state
00053             InitializeForegroundAppAuthentication();
00054         }
00055
00056         protected override void OnNavigatedFrom(NavigationEventArgs e)
00057         {
00058             ScenarioCommon.Instance.BackgroundAuthenticationCompleted -= OnBackgroundAuthenticationCompleted;
00059         }
00060
00061         /// <summary>
00062         /// Handle authentication event triggered by background task
00063         /// </summary>
00064         /// <param name="sender"></param>
00065         /// <param name="e"></param>
00066         async void OnBackgroundAuthenticationCompleted(ScenarioCommon sender, BackgroundAuthenticationCompletedEventArgs e)
00067         {
00068             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00069             {
00070                 if (e.Succeeded)
00071                 {
00072                     InitializeForegroundAppAuthentication();
00073                 }
00074                 else
00075                 {
00076                     rootPage.NotifyUser($"Background task encountered exception: {e.ExtendedError}", NotifyType.ErrorMessage);
00077                 }
00078             });
00079         }
00080
00081         private async void AuthenticateButton_Click(object sender, RoutedEventArgs e)
00082         {
00083             AuthenticateButton.IsEnabled = false;
00084
00085             HotspotCredentialsAuthenticationResult result = await authenticationContext.IssueCredentialsAsync(
00086                 ConfigStore.UserName, ConfigStore.Password, ConfigStore.ExtraParameters, ConfigStore.MarkAsManualConnect);
00087             if (result.ResponseCode == HotspotAuthenticationResponseCode.LoginSucceeded)
00088             {
00089                 rootPage.NotifyUser("Issuing credentials succeeded", NotifyType.StatusMessage);
00090                 Uri logoffUrl = result.LogoffUrl;
00091                 if (logoffUrl != null)
00092                 {
00093                     rootPage.NotifyUser("The logoff URL is: " + logoffUrl.OriginalString, NotifyType.StatusMessage);
00094                 }
00095             }
00096             else
00097             {
00098                 rootPage.NotifyUser("Issuing credentials failed", NotifyType.ErrorMessage);
00099             }
00100             AuthenticateButton.IsEnabled = true;
00101         }
00102
00103         private void SkipButton_Click(object sender, RoutedEventArgs e)
00104         {
00105             // Here you can implement custom authentication.
00106             authenticationContext.SkipAuthentication();
00107             rootPage.NotifyUser("Authentication skipped", NotifyType.StatusMessage);
00108             ClearAuthenticationToken();
00109         }
00110
00111         private void AbortButton_Click(object sender, RoutedEventArgs e)
00112         {
00113             authenticationContext.AbortAuthentication(ConfigStore.MarkAsManualConnect);
00114             rootPage.NotifyUser("Authentication aborted", NotifyType.StatusMessage);
00115             ClearAuthenticationToken();
00116         }
00117
00118         /// <summary>
00119         /// Query authentication token from application storage and update the UI.
00120         /// The token gets passed from the background task handler.
00121         /// </summary>
00122         private void InitializeForegroundAppAuthentication()
00123         {
00124             string token = ConfigStore.AuthenticationToken;
00125             if (String.IsNullOrEmpty(token))
00126             {
00127                 return; // no token found
00128             }
00129             if (!HotspotAuthenticationContext.TryGetAuthenticationContext(token, out authenticationContext))
00130             {
00131                 rootPage.NotifyUser("TryGetAuthenticationContext failed", NotifyType.ErrorMessage);
00132                 return;
00133             }
00134
00135             AuthenticateButton.IsEnabled = true;
00136             SkipButton.IsEnabled = true;
00137             AbortButton.IsEnabled = true;
00138         }
00139
00140
00141         /// <summary>
00142         /// Clear the authentication token in the application storage and update the UI.
00143         /// </summary>
00144         private void ClearAuthenticationToken()
00145         {
00146             ConfigStore.AuthenticationToken = "";
00147             AuthenticateButton.IsEnabled = false;
00148             SkipButton.IsEnabled = false;
00149             AbortButton.IsEnabled = false;
00150         }
00151     }
00152 }
00153
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/SampleConfiguration.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "File Download", "SDKTemplate.Scenario1_Download" },
00021     { "File Upload", "SDKTemplate.Scenario2_Upload" },
00022     { "Completion Notifications", "SDKTemplate.Scenario3_Notifications" },
00023     { "Completion Groups", "SDKTemplate.Scenario4_CompletionGroups" },
00024     { "Random Access Downloads", "SDKTemplate.Scenario5_RandomAccess" },
00025     { "Recoverable Errors", "SDKTemplate.Scenario6_RecoverableErrors" },
00026     { "Download Reordering", "SDKTemplate.Scenario7_DownloadReordering" },
00027 };
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/SampleConfiguration.h Source File

  • MessageDialog
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Message dialog C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DiscoveredDeviceWrapper Member List

This is the complete list of members for DiscoveredDeviceWrapper, including all inherited members.
AdvertisementId | DiscoveredDeviceWrapper |
ConfigMethods | DiscoveredDeviceWrapper |
ConnectAsync(string pin="") | DiscoveredDeviceWrapper | [inline]
deviceInfo | DiscoveredDeviceWrapper | [private]
DiscoveredDeviceWrapper(DeviceInformation deviceInfo, WiFiDirectServiceManager manager) | DiscoveredDeviceWrapper | [inline]
Dispose() | DiscoveredDeviceWrapper | [inline]
Dispose(bool disposing) | DiscoveredDeviceWrapper | [inline, protected, virtual]
disposed | DiscoveredDeviceWrapper | [private]
GetProvisioningInfoAsync(WiFiDirectServiceConfigurationMethod configMethod) | DiscoveredDeviceWrapper | [inline]
manager | DiscoveredDeviceWrapper | [private]
OnSessionDeferred(WiFiDirectService sender, WiFiDirectServiceSessionDeferredEventArgs args) | DiscoveredDeviceWrapper | [inline, private]
OpenSessionAsync() | DiscoveredDeviceWrapper | [inline]
ParseProperties() | DiscoveredDeviceWrapper | [inline, private]
service | DiscoveredDeviceWrapper | [private]
ServiceAddress | DiscoveredDeviceWrapper |
ServiceInfo | DiscoveredDeviceWrapper |
ServiceName | DiscoveredDeviceWrapper |
SetServiceOptionsAsync(bool preferGO, string sessionInfo) | DiscoveredDeviceWrapper | [inline]
ThrowIfDisposed() | DiscoveredDeviceWrapper | [inline, private]
~DiscoveredDeviceWrapper() | DiscoveredDeviceWrapper | [inline, private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/CustomTextRenderer.cpp Source File

  • DWriteColorGlyph
  • cpp

CustomTextRenderer.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "CustomTextRenderer.h"
00010 #include "DirectXHelper.h"
00011
00012 using namespace DWriteColorTextRenderer;
00013
00014 using namespace Microsoft::WRL;
00015
00016 // The constructor stores the Direct2D factory and device context
00017 // and creates resources the renderer will use.
00018 CustomTextRenderer::CustomTextRenderer(
00019     ComPtr<ID2D1Factory> d2dFactory,
00020     ComPtr<ID2D1DeviceContext4> d2dDeviceContext
00021     ) :
00022     m_refCount(0),
00023     m_d2dFactory(d2dFactory),
00024     m_d2dDeviceContext(d2dDeviceContext)
00025 {
00026     DX::ThrowIfFailed(
00027         DWriteCreateFactory(
00028             DWRITE_FACTORY_TYPE_SHARED,
00029             __uuidof(IDWriteFactory4),
00030             &m_dwriteFactory
00031             )
00032         );
00033
00034     DX::ThrowIfFailed(
00035         m_d2dDeviceContext->CreateSolidColorBrush(
00036             D2D1::ColorF(D2D1::ColorF::Crimson),
00037             &m_outlineBrush
00038             )
00039         );
00040
00041     DX::ThrowIfFailed(
00042         m_d2dDeviceContext->CreateSolidColorBrush(
00043             D2D1::ColorF(D2D1::ColorF::Black),
00044             &m_tempBrush
00045             )
00046         );
00047 }
00048
00049 // Decomposes the received glyph run into smaller color glyph runs
00050 // using IDWriteFactory4::TranslateColorGlyphRun. Depending on the
00051 // type of each color run, the renderer uses Direct2D to draw the
00052 // outlines, SVG content, or bitmap content.
00053 HRESULT CustomTextRenderer::DrawGlyphRun(
00054     _In_opt_ void* clientDrawingContext,
00055     FLOAT baselineOriginX,
00056     FLOAT baselineOriginY,
00057     DWRITE_MEASURING_MODE measuringMode,
00058     _In_ DWRITE_GLYPH_RUN const* glyphRun,
00059     _In_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
00060     IUnknown* clientDrawingEffect
00061 )
00062 {
00063     HRESULT hr = DWRITE_E_NOCOLOR;
00064
00065     D2D1_POINT_2F baselineOrigin = D2D1::Point2F(baselineOriginX, baselineOriginY);
00066
00067     // The list of glyph image formats this renderer is prepared to support.
00068     DWRITE_GLYPH_IMAGE_FORMATS supportedFormats =
00069         DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE |
00070         DWRITE_GLYPH_IMAGE_FORMATS_CFF |
00071         DWRITE_GLYPH_IMAGE_FORMATS_COLR |
00072         DWRITE_GLYPH_IMAGE_FORMATS_SVG |
00073         DWRITE_GLYPH_IMAGE_FORMATS_PNG |
00074         DWRITE_GLYPH_IMAGE_FORMATS_JPEG |
00075         DWRITE_GLYPH_IMAGE_FORMATS_TIFF |
00076         DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8;
00077
00078     // Determine whether there are any color glyph runs within glyphRun. If
00079     // there are, glyphRunEnumerator can be used to iterate through them.
00080     ComPtr<IDWriteColorGlyphRunEnumerator1> glyphRunEnumerator;
00081     hr = m_dwriteFactory->TranslateColorGlyphRun(
00082         baselineOrigin,
00083         glyphRun,
00084         glyphRunDescription,
00085         supportedFormats,
00086         measuringMode,
00087         nullptr,
00088         0,
00089         &glyphRunEnumerator
00090         );
00091
00092     if (hr == DWRITE_E_NOCOLOR)
00093     {
00094         // Simple case: the run has no color glyphs. Draw the main glyph run
00095         // using the current text color.
00096         m_d2dDeviceContext->DrawGlyphRun(
00097             baselineOrigin,
00098             glyphRun,
00099             glyphRunDescription,
00100             m_outlineBrush.Get(),
00101             measuringMode
00102             );
00103     }
00104     else
00105     {
00106         DX::ThrowIfFailed(hr);
00107
00108         // Complex case: the run has one or more color runs within it. Iterate
00109         // over the sub-runs and draw them, depending on their format.
00110         for (;;)
00111         {
00112             BOOL haveRun;
00113             DX::ThrowIfFailed(glyphRunEnumerator->MoveNext(&haveRun));
00114             if (!haveRun)
00115                 break;
00116
00117             DWRITE_COLOR_GLYPH_RUN1 const* colorRun;
00118             DX::ThrowIfFailed(glyphRunEnumerator->GetCurrentRun(&colorRun));
00119
00120             D2D1_POINT_2F currentBaselineOrigin = D2D1::Point2F(
00121                 colorRun->baselineOriginX,
00122                 colorRun->baselineOriginY
00123                 );
00124
00125             switch (colorRun->glyphImageFormat)
00126             {
00127             case DWRITE_GLYPH_IMAGE_FORMATS_PNG:
00128             case DWRITE_GLYPH_IMAGE_FORMATS_JPEG:
00129             case DWRITE_GLYPH_IMAGE_FORMATS_TIFF:
00130             case DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8:
00131             {
00132                 // This run is bitmap glyphs. Use Direct2D to draw them.
00133                 m_d2dDeviceContext->DrawColorBitmapGlyphRun(
00134                     colorRun->glyphImageFormat,
00135                     currentBaselineOrigin,
00136                     &colorRun->glyphRun,
00137                     measuringMode
00138                     );
00139             }
00140             break;
00141
00142             case DWRITE_GLYPH_IMAGE_FORMATS_SVG:
00143             {
00144                 // This run is SVG glyphs. Use Direct2D to draw them.
00145                 m_d2dDeviceContext->DrawSvgGlyphRun(
00146                     currentBaselineOrigin,
00147                     &colorRun->glyphRun,
00148                     m_outlineBrush.Get(),
00149                     nullptr,                // svgGlyphStyle
00150                     0,                      // colorPaletteIndex
00151                     measuringMode
00152                     );
00153             }
00154             break;
00155
00156             case DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE:
00157             case DWRITE_GLYPH_IMAGE_FORMATS_CFF:
00158             case DWRITE_GLYPH_IMAGE_FORMATS_COLR:
00159             default:
00160             {
00161                 // This run is solid-color outlines, either from non-color
00162                 // glyphs or from COLR glyph layers. Use Direct2D to draw them.
00163
00164                 ComPtr<ID2D1Brush> layerBrush;
00165                 if (colorRun->paletteIndex == 0xFFFF)
00166                 {
00167                     // This run uses the current text color.
00168                     layerBrush = m_outlineBrush;
00169                 }
00170                 else
00171                 {
00172                     // This run specifies its own color.
00173                     m_tempBrush->SetColor(colorRun->runColor);
00174                     layerBrush = m_tempBrush;
00175                 }
00176
00177                 // Draw the run with the selected color.
00178                 m_d2dDeviceContext->DrawGlyphRun(
00179                     currentBaselineOrigin,
00180                     &colorRun->glyphRun,
00181                     colorRun->glyphRunDescription,
00182                     layerBrush.Get(),
00183                     measuringMode
00184                     );
00185             }
00186             break;
00187             }
00188         }
00189     }
00190
00191     return hr;
00192 }
00193
00194 IFACEMETHODIMP CustomTextRenderer::DrawUnderline(
00195     _In_opt_ void* clientDrawingContext,
00196     FLOAT baselineOriginX,
00197     FLOAT baselineOriginY,
00198     _In_ DWRITE_UNDERLINE const* underline,
00199     IUnknown* clientDrawingEffect
00200     )
00201 {
00202     // Not implemented
00203     return E_NOTIMPL;
00204 }
00205
00206 IFACEMETHODIMP CustomTextRenderer::DrawStrikethrough(
00207     _In_opt_ void* clientDrawingContext,
00208     FLOAT baselineOriginX,
00209     FLOAT baselineOriginY,
00210     _In_ DWRITE_STRIKETHROUGH const* strikethrough,
00211     IUnknown* clientDrawingEffect
00212     )
00213 {
00214     // Not implemented
00215     return E_NOTIMPL;
00216 }
00217
00218 IFACEMETHODIMP CustomTextRenderer::DrawInlineObject(
00219     _In_opt_ void* clientDrawingContext,
00220     FLOAT originX,
00221     FLOAT originY,
00222     IDWriteInlineObject* inlineObject,
00223     BOOL isSideways,
00224     BOOL isRightToLeft,
00225     IUnknown* clientDrawingEffect
00226     )
00227 {
00228     // Not implemented
00229     return E_NOTIMPL;
00230 }
00231
00232 IFACEMETHODIMP_(unsigned long) CustomTextRenderer::AddRef()
00233 {
00234     return InterlockedIncrement(&m_refCount);
00235 }
00236
00237 IFACEMETHODIMP_(unsigned long) CustomTextRenderer::Release()
00238 {
00239     unsigned long newCount = InterlockedDecrement(&m_refCount);
00240     if (newCount == 0)
00241     {
00242         delete this;
00243         return 0;
00244     }
00245
00246     return newCount;
00247 }
00248
00249 IFACEMETHODIMP CustomTextRenderer::IsPixelSnappingDisabled(
00250     _In_opt_ void* clientDrawingContext,
00251     _Out_ BOOL* isDisabled
00252     )
00253 {
00254     *isDisabled = FALSE;
00255     return S_OK;
00256 }
00257
00258 IFACEMETHODIMP CustomTextRenderer::GetCurrentTransform(
00259     _In_opt_ void* clientDrawingContext,
00260     _Out_ DWRITE_MATRIX* transform
00261     )
00262 {
00263     // forward the render target's transform
00264     m_d2dDeviceContext->GetTransform(reinterpret_cast<D2D1_MATRIX_3X2_F*>(transform));
00265     return S_OK;
00266 }
00267
00268 IFACEMETHODIMP CustomTextRenderer::GetPixelsPerDip(
00269     _In_opt_ void* clientDrawingContext,
00270     _Out_ FLOAT* pixelsPerDip
00271     )
00272 {
00273     float x, yUnused;
00274
00275     m_d2dDeviceContext.Get()->GetDpi(&x, &yUnused);
00276     *pixelsPerDip = x / 96.0f;
00277
00278     return S_OK;
00279 }
00280
00281 IFACEMETHODIMP CustomTextRenderer::QueryInterface(
00282     IID const& riid,
00283     void** ppvObject
00284     )
00285 {
00286     if (__uuidof(IDWriteTextRenderer) == riid)
00287     {
00288         *ppvObject = this;
00289     }
00290     else if (__uuidof(IDWritePixelSnapping) == riid)
00291     {
00292         *ppvObject = this;
00293     }
00294     else if (__uuidof(IUnknown) == riid)
00295     {
00296         *ppvObject = this;
00297     }
00298     else
00299     {
00300         *ppvObject = nullptr;
00301         return E_FAIL;
00302     }
00303
00304     this->AddRef();
00305
00306     return S_OK;
00307 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuperMutt::LedPattern Member List

This is the complete list of members for SuperMutt::LedPattern, including all inherited members.
ReportId | SuperMutt::LedPattern
UsageId | SuperMutt::LedPattern
UsagePage | SuperMutt::LedPattern
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCardIntegration/cs/SampleConfiguration.cs Source File

  • ContactCardIntegration
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Contact Card integration C# Sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Create contacts with annotations", ClassType=typeof(Scenario1_CreateContacts)},
00027             new Scenario() { Title="Receiving a contact", ClassType=typeof(Scenario2_ReceiveContact) },
00028         };
00029
00030         public void NavigateToPageWithParameter(int pageIndex, object parameter)
00031         {
00032             ScenarioControl.SelectedIndex = pageIndex;
00033             ScenarioFrame.Navigate(scenarios[pageIndex].ClassType, parameter);
00034         }
00035
00036     }
00037
00038     public class Scenario
00039     {
00040         public string Title { get; set; }
00041         public Type ClassType { get; set; }
00042     }
00043
00044     public partial class App : Application
00045     {
00046         /// <summary>
00047         // Handle protocol activations.
00048         /// </summary>
00049         protected override void OnActivated(IActivatedEventArgs e)
00050         {
00051             if (e.Kind == ActivationKind.Protocol)
00052             {
00053                 Frame rootFrame = CreateRootFrame();
00054
00055                 if (rootFrame.Content == null)
00056                 {
00057                     if (!rootFrame.Navigate(typeof(MainPage)))
00058                     {
00059                         throw new Exception("Failed to create initial page");
00060                     }
00061                 }
00062
00063                 var p = rootFrame.Content as MainPage;
00064                 p.NavigateToPageWithParameter(1, e);
00065
00066                 // Ensure the current window is active
00067                 Window.Current.Activate();
00068             }
00069         }
00070     }
00071 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario5.cpp Source File

  • FileThumbnails
  • cppwinrt

Scenario5.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5.h"
00014 #include "Scenario5.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include <sstream>
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Storage;
00022 using namespace Windows::Storage::FileProperties;
00023 using namespace Windows::Storage::Pickers;
00024 using namespace Windows::Storage::Search;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 namespace winrt::SDKTemplate::implementation
00029 {
00030     Scenario5::Scenario5()
00031     {
00032         InitializeComponent();
00033     }
00034
00035     void Scenario5::OnNavigatedTo(NavigationEventArgs const&)
00036     {
00037         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock(), OutputDetails());
00038     }
00039
00040     fire_and_forget Scenario5::GetThumbnailButton_Click(IInspectable const&, RoutedEventArgs const&)
00041     {
00042         auto lifetime = get_strong();
00043
00044         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock(), OutputDetails());
00045
00046         // Pick a folder
00047         FolderPicker folderPicker;
00048         folderPicker.FileTypeFilter().ReplaceAll(FileExtensions::Image());
00049         StorageFolder folder = co_await folderPicker.PickSingleFolderAsync();
00050
00051         if (folder != nullptr)
00052         {
00053             const CommonFolderQuery monthShape = CommonFolderQuery::GroupByMonth;
00054             // Verify queries are supported because they are not supported in all picked locations.
00055             if (folder.IsCommonFolderQuerySupported(monthShape))
00056             {
00057                 // Convert folder to file group and query for items
00058                 IVectorView<StorageFolder> months = co_await folder.CreateFolderQuery(monthShape).GetFoldersAsync();
00059
00060                 if (months.Size() > 0)
00061                 {
00062                     const ThumbnailMode thumbnailMode = ThumbnailMode::PicturesView;
00063                     const uint32_t size = 200;
00064                     StorageFolder firstMonth = months.GetAt(0);
00065                     StorageItemThumbnail thumbnail = co_await firstMonth.GetThumbnailAsync(thumbnailMode, size);
00066                     if (thumbnail != nullptr)
00067                     {
00068                         Helpers::DisplayResult(ThumbnailImage(), OutputTextBlock(), thumbnailMode, size, firstMonth, thumbnail, true);
00069
00070                         // Also display the hierarchy of the file group to better visualize where the thumbnail comes from
00071                         IVectorView<StorageFile> files = co_await firstMonth.GetFilesAsync();
00072
00073                         std::wstringstream output;
00074                         output << std::endl;
00075                         output << L"List of files in this group:" << std::endl << std::endl;
00076                         for (StorageFile const& file : files)
00077                         {
00078                             output << std::wstring_view{ file.Name() } << std::endl;
00079                         }
00080                         OutputDetails().Text(output.str());
00081                         thumbnail.Close();
00082                     }
00083                     else
00084                     {
00085                         rootPage.NotifyUser(Errors::NoImages, NotifyType::StatusMessage);
00086                     }
00087                 }
00088                 else
00089                 {
00090                     rootPage.NotifyUser(Errors::FileGroupEmpty, NotifyType::StatusMessage);
00091                 }
00092             }
00093             else
00094             {
00095                 rootPage.NotifyUser(Errors::FileGroupLocation, NotifyType::StatusMessage);
00096             }
00097         }
00098         else
00099         {
00100             rootPage.NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00101         }
00102     }
00103 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SingleAzureADScenario Member List

This is the complete list of members for SingleAzureADScenario, including all inherited members.
AccountClientId | SingleAzureADScenario | [private]
AccountScopeRequested | SingleAzureADScenario | [private]
AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleAzureADScenario | [inline, private]
AddWebAccount(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleAzureADScenario | [inline, private]
AddWebAccountProvider(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleAzureADScenario | [inline, private]
AzureADAuthority | SingleAzureADScenario | [private]
Button_Reset(object sender, RoutedEventArgs e) | SingleAzureADScenario | [inline, private]
Button_ShowAccountSettings(object sender, RoutedEventArgs e) | SingleAzureADScenario | [inline, private]
LogoffAndRemoveAccount() | SingleAzureADScenario | [inline, private]
MicrosoftAccountProviderId | SingleAzureADScenario | [private]
OnAccountCommandsRequested(AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleAzureADScenario | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | SingleAzureADScenario | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | SingleAzureADScenario | [inline, protected]
OtherLinkInvoked(IUICommand command) | SingleAzureADScenario | [inline, private]
OutputTokenResult(WebTokenRequestResult result) | SingleAzureADScenario | [inline, private]
PrivacyPolicyInvoked(IUICommand command) | SingleAzureADScenario | [inline, private]
RequestTokenAndSaveAccount(WebAccountProvider Provider, String Scope, String ClientID) | SingleAzureADScenario | [inline, private]
rootPage | SingleAzureADScenario | [private]
SingleAzureADScenario() | SingleAzureADScenario | [inline]
StoredAccountKey | SingleAzureADScenario | [private]
WebAccountInvoked(WebAccountCommand command, WebAccountInvokedArgs args) | SingleAzureADScenario | [inline, private]
WebAccountProviderCommandInvoked(WebAccountProviderCommand command) | SingleAzureADScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
btnFilePicker_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnFilePicker_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPause_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPause_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPlay_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPlay_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPlayPause_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnPlayPause_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnStartCapture_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnStop_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnStop_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
btnStopCapture_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DeviceStateChangedEvent() | sealed | [inline]
Enumerate_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
EnumerateAudioDevicesAsync() | sealed | [private]
GetState() | sealed | [inline]
hr | sealed |
InitializeCapture(Object^sender, Object^e) | sealed | [private]
InitializeDevice() | sealed | [private]
InitializeDevice() | sealed | [private]
m_ContentStream | sealed | [private]
m_ContentType | sealed | [private]
m_CoreDispatcher | sealed | [private]
m_DevicesList | sealed | [private]
m_DeviceState | sealed | [private]
m_deviceStateChangeToken | sealed | [private]
m_deviceSupportsRawMode | sealed | [private]
m_DiscontinuityCount | sealed | [private]
m_hr | sealed |
m_hr(hr) | sealed | [inline]
m_IsLowLatency | sealed | [private]
m_IsMFLoaded | sealed | [private]
m_IsMinimumLatency | sealed | [private]
m_Oscilloscope | sealed | [private]
m_plotDataReadyToken | sealed | [private]
m_PointArray | sealed | [private]
m_Size | sealed | [private]
m_Size(size) | sealed | [inline]
m_spCapture | sealed | [private]
m_spRenderer | sealed | [private]
m_StateChangedEvent | sealed | [private]
m_SystemMediaControls | sealed | [private]
m_SystemMediaControlsButtonToken | sealed | [private]
MediaButtonPressed(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^e) | sealed | [private]
MediaButtonPressed(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^e) | sealed | [private]
OnDeviceStateChange(Object^sender, DeviceStateChangedEventArgs^e) | sealed | [private]
OnDeviceStateChange(Object^sender, DeviceStateChangedEventArgs^e) | sealed | [private]
OnDeviceStateChange(Object^sender, DeviceStateChangedEventArgs^e) | sealed | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnPickFileAsync() | sealed | [private]
OnPickFileAsync() | sealed | [private]
OnPlotDataReady(Object^sender, PlotDataReadyEventArgs^e) | sealed | [private]
OnSetVolume(UINT32 volume) | sealed | [private]
OnSetVolume(UINT32 volume) | sealed | [private]
PauseDevice() | sealed | [private]
PauseDevice() | sealed | [private]
PlayPauseToggleDevice() | sealed | [private]
PlayPauseToggleDevice() | sealed | [private]
PlotDataReadyEvent() | sealed | [inline]
points | sealed |
points | sealed |
radioFile_Checked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
radioFile_Checked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
radioTone_Checked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
radioTone_Checked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
rootPage | sealed | [private]
Scenario1() | sealed |
Scenario2() | sealed |
Scenario3() | sealed |
Scenario4() | sealed |
ShowStatusMessage(Platform::String^str, NotifyType messageType) | sealed | [private]
ShowStatusMessage(Platform::String^str, NotifyType messageType) | sealed | [private]
ShowStatusMessage(Platform::String^str, NotifyType messageType) | sealed | [private]
ShowStatusMessage(Platform::String^str, NotifyType messageType) | sealed | [private]
size | sealed |
sliderFrequency_ValueChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed | [private]
sliderFrequency_ValueChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed | [private]
sliderVolume_ValueChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed | [private]
sliderVolume_ValueChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed | [private]
StartDevice() | sealed | [private]
StartDevice() | sealed | [private]
StateChangedEvent | sealed | [static]
StopCapture(Object^sender, Object^e) | sealed | [private]
StopDevice() | sealed | [private]
StopDevice() | sealed | [private]
UpdateContentProps(Platform::String^str) | sealed | [private]
UpdateContentProps(Platform::String^str) | sealed | [private]
UpdateContentUI(Platform::Boolean disableAll) | sealed | [private]
UpdateContentUI(Platform::Boolean disableAll) | sealed | [private]
UpdateMediaControlUI(DeviceState deviceState) | sealed | [private]
UpdateMediaControlUI(DeviceState deviceState) | sealed | [private]
UpdateMediaControlUI(DeviceState deviceState) | sealed | [private]
~Scenario2() | sealed | [private]
~Scenario3() | sealed | [private]
~Scenario4() | sealed | [private]
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/SampleConfiguration.cpp Source File

  • NumberFormatting
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Number formatting C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Percent and Permille Formatting", xaml_typename<SDKTemplate::Scenario1_PercentPermilleFormatting>() },
00029     Scenario{ L"Decimal Formatting", xaml_typename<SDKTemplate::Scenario2_DecimalFormatting>() },
00030     Scenario{ L"Currency Formatting", xaml_typename<SDKTemplate::Scenario3_CurrencyFormatting>() },
00031     Scenario{ L"Number Parsing", xaml_typename<SDKTemplate::Scenario4_NumberParsing>() },
00032     Scenario{ L"Rounding and Padding", xaml_typename<SDKTemplate::Scenario5_RoundingAndPadding>() },
00033     Scenario{ L"Numeral System Translation", xaml_typename<SDKTemplate::Scenario6_NumeralSystemTranslation>() },
00034     Scenario{ L"Formatting/Translation using Unicode Extensions", xaml_typename<SDKTemplate::Scenario7_UsingUnicodeExtensions>() }
00035     });
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario2_FindAvailableSourceGroups.xaml.cpp Source File

  • CameraFrames
  • cpp

Scenario2_FindAvailableSourceGroups.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_FindAvailableSourceGroups.xaml.h"
00014 #include "FrameRenderer.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace concurrency;
00019 using namespace Platform;
00020 using namespace Platform::Collections;
00021 using namespace Windows::Devices::Enumeration;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Graphics::Imaging;
00025 using namespace Windows::Media::Capture;
00026 using namespace Windows::Media::Capture::Frames;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Media::Imaging;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 Scenario2_FindAvailableSourceGroups::Scenario2_FindAvailableSourceGroups()
00034 {
00035     InitializeComponent();
00036     m_logger = ref new SimpleLogger(outputTextBlock);
00037     m_frameRenderer = ref new FrameRenderer(PreviewImage);
00038 }
00039
00040 void Scenario2_FindAvailableSourceGroups::OnNavigatedTo(NavigationEventArgs^ e)
00041 {
00042     /// SourceGroupCollection will setup device watcher to monitor
00043     /// SourceGroup devices enabled or disabled from the system.
00044     m_groupCollection = ref new SourceGroupCollection(Dispatcher);
00045     GroupComboBox->ItemsSource = m_groupCollection->FrameSourceGroups;
00046 }
00047
00048 void Scenario2_FindAvailableSourceGroups::OnNavigatedFrom(NavigationEventArgs^ e)
00049 {
00050     delete m_groupCollection;
00051     m_currentTask = m_currentTask.then([this]()
00052     {
00053         return StopReaderAsync();
00054     }).then([this]()
00055     {
00056         DisposeMediaCapture();
00057     }, task_continuation_context::get_current_winrt_context());
00058 }
00059
00060 task<void> Scenario2_FindAvailableSourceGroups::UpdateButtonStateAsync()
00061 {
00062     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00063     {
00064         StartButton->IsEnabled = m_source != nullptr && !m_streaming;
00065         StopButton->IsEnabled = m_source != nullptr && m_streaming;
00066     })));
00067 }
00068
00069 void Scenario2_FindAvailableSourceGroups::DisposeMediaCapture()
00070 {
00071     FormatComboBox->ItemsSource = nullptr;
00072     SourceComboBox->ItemsSource = nullptr;
00073
00074     m_source = nullptr;
00075
00076     delete m_mediaCapture.Get();
00077     m_mediaCapture = nullptr;
00078 }
00079
00080 void Scenario2_FindAvailableSourceGroups::GroupComboBox_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00081 {
00082     m_currentTask = m_currentTask.then([this]()
00083     {
00084         return StopReaderAsync();
00085     }).then([this]()
00086     {
00087         DisposeMediaCapture();
00088
00089         auto group = dynamic_cast<FrameSourceGroupModel^>(GroupComboBox->SelectedItem);
00090         if (group != nullptr)
00091         {
00092             return TryInitializeCaptureAsync().then([this, group](bool initialized)
00093             {
00094                 if (initialized) {
00095                     SourceComboBox->ItemsSource = group->SourceInfos;
00096                     SourceComboBox->SelectedIndex = 0;
00097                 }
00098             }, task_continuation_context::get_current_winrt_context());
00099         }
00100         return task_from_result();
00101     }, task_continuation_context::get_current_winrt_context());
00102 }
00103
00104 void Scenario2_FindAvailableSourceGroups::SourceComboBox_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00105 {
00106     m_currentTask = m_currentTask.then([this]()
00107     {
00108         return StopReaderAsync();
00109     }).then([this]()
00110     {
00111         if (SourceComboBox->SelectedItem != nullptr)
00112         {
00113             return StartReaderAsync().then([this]()
00114             {
00115                 // Get the formats supported by the selected source into the FormatComboBox.
00116                 auto formats = ref new Vector<FrameFormatModel^>();
00117                 if (m_mediaCapture != nullptr && m_source != nullptr)
00118                 {
00119                     for (MediaFrameFormat^ format : m_source->SupportedFormats)
00120                     {
00121                         // Limit ourselves to formats that we can render.
00122                         if (FrameRenderer::GetSubtypeForFrameReader(m_source->Info->SourceKind, format) != nullptr)
00123                         {
00124                             formats->Append(ref new FrameFormatModel(format));
00125                         }
00126                     }
00127                 }
00128
00129                 FormatComboBox->ItemsSource = formats;
00130             }, task_continuation_context::get_current_winrt_context());
00131         }
00132         return task_from_result();
00133     }, task_continuation_context::get_current_winrt_context());
00134 }
00135
00136 void Scenario2_FindAvailableSourceGroups::FormatComboBox_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00137 {
00138     auto format = dynamic_cast<FrameFormatModel^>(FormatComboBox->SelectedItem);
00139     m_currentTask = m_currentTask.then([this, format]()
00140     {
00141         return ChangeMediaFormatAsync(format);
00142     });
00143 }
00144
00145 task<void> Scenario2_FindAvailableSourceGroups::StartReaderAsync()
00146 {
00147     return CreateReaderAsync().then([this]()
00148     {
00149         if (m_reader != nullptr && !m_streaming)
00150         {
00151             return create_task(m_reader->StartAsync())
00152                 .then([this](MediaFrameReaderStartStatus result)
00153             {
00154                 m_logger->Log("Start reader with result: " + result.ToString());
00155
00156                 if (result == MediaFrameReaderStartStatus::Success)
00157                 {
00158                     m_streaming = true;
00159                     return UpdateButtonStateAsync();
00160                 }
00161                 return task_from_result();
00162             });
00163         }
00164         return task_from_result();
00165     });
00166 }
00167
00168 task<void> Scenario2_FindAvailableSourceGroups::CreateReaderAsync()
00169 {
00170     return TryInitializeCaptureAsync().then([this](bool initialized)
00171     {
00172         if (initialized) {
00173             UpdateFrameSource();
00174             if (m_source != nullptr)
00175             {
00176                 // Ask the MediaFrameReader to use a subtype that we can render.
00177                 String^ requestedSubtype = FrameRenderer::GetSubtypeForFrameReader(m_source->Info->SourceKind, m_source->CurrentFormat);
00178                 if (requestedSubtype != nullptr)
00179                 {
00180                     return create_task(m_mediaCapture->CreateFrameReaderAsync(m_source, requestedSubtype))
00181                         .then([this](MediaFrameReader^ reader)
00182                     {
00183                         m_reader = reader;
00184                         m_frameArrivedToken = reader->FrameArrived +=
00185                             ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(
00186                                 this, &Scenario2_FindAvailableSourceGroups::Reader_FrameArrived);
00187                         m_logger->Log("Reader created on source: " + m_source->Info->Id);
00188                     });
00189                 }
00190             }
00191         }
00192         return task_from_result();
00193     }, task_continuation_context::get_current_winrt_context());
00194 }
00195
00196 void Scenario2_FindAvailableSourceGroups::UpdateFrameSource()
00197 {
00198     auto info = dynamic_cast<FrameSourceInfoModel^>(SourceComboBox->SelectedItem);
00199     if (m_mediaCapture != nullptr && info != nullptr && info->SourceGroup != nullptr)
00200     {
00201         auto groupModel = dynamic_cast<FrameSourceGroupModel^>(GroupComboBox->SelectedItem);
00202         if (groupModel == nullptr || groupModel->Id != info->SourceGroup->Id)
00203         {
00204             SourceComboBox->SelectedItem = nullptr;
00205             return;
00206         }
00207         if (m_source == nullptr || m_source->Info->Id != info->SourceInfo->Id)
00208         {
00209             if (m_mediaCapture->FrameSources->HasKey(info->SourceInfo->Id))
00210             {
00211                 m_source = m_mediaCapture->FrameSources->Lookup(info->SourceInfo->Id);
00212             }
00213             else
00214             {
00215                 m_source = nullptr;
00216             }
00217         }
00218     }
00219     else
00220     {
00221         m_source = nullptr;
00222     }
00223 }
00224
00225 task<bool> Scenario2_FindAvailableSourceGroups::TryInitializeCaptureAsync()
00226 {
00227     if (m_mediaCapture != nullptr)
00228     {
00229         return task_from_result(true);
00230     }
00231
00232     auto groupModel = dynamic_cast<FrameSourceGroupModel^>(GroupComboBox->SelectedItem);
00233     if (groupModel == nullptr)
00234     {
00235         return task_from_result(false);
00236     }
00237
00238     // Create a new media capture object.
00239     m_mediaCapture = ref new MediaCapture();
00240
00241     auto settings = ref new MediaCaptureInitializationSettings();
00242
00243     // Select the source we will be reading from.
00244     settings->SourceGroup = groupModel->SourceGroup;
00245
00246     // This media capture has exclusive control of the source.
00247     settings->SharingMode = MediaCaptureSharingMode::ExclusiveControl;
00248
00249     // Set to CPU to ensure frames always contain CPU SoftwareBitmap images,
00250     // instead of preferring GPU D3DSurface images.
00251     settings->MemoryPreference = MediaCaptureMemoryPreference::Cpu;
00252
00253     // Capture only video. Audio device will not be initialized.
00254     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00255
00256     // Initialize MediaCapture with the specified group.
00257     // This must occur on the UI thread because some device families
00258     // (such as Xbox) will prompt the user to grant consent for the
00259     // app to access cameras.
00260     // This can raise an exception if the source no longer exists,
00261     // or if the source could not be initialized.
00262     return create_task(m_mediaCapture->InitializeAsync(settings))
00263         .then([this, groupModel](task<void> initializeMediaCaptureTask)
00264     {
00265         try
00266         {
00267             // Get the result of the initialization. This call will throw if initialization failed
00268             // This pattern is docuemnted at https://msdn.microsoft.com/en-us/library/dd997692.aspx
00269             initializeMediaCaptureTask.get();
00270             m_logger->Log("Successfully initialized MediaCapture for " + groupModel->DisplayName);
00271             return true;
00272         }
00273         catch (Exception^ exception)
00274         {
00275             m_logger->Log("Failed to initialize media capture: " + exception->Message);
00276             DisposeMediaCapture();
00277             return false;
00278         }
00279     });
00280 }
00281
00282 task<void> Scenario2_FindAvailableSourceGroups::ChangeMediaFormatAsync(FrameFormatModel^ format)
00283 {
00284     if (m_source == nullptr)
00285     {
00286         m_logger->Log("Unable to set format when source is not set.");
00287         return task_from_result();
00288     }
00289
00290     // Do nothing if no format was selected, or if the selected format is the same as the current one.
00291     if (format == nullptr || format->HasSameFormat(m_source->CurrentFormat))
00292     {
00293         return task_from_result();
00294     }
00295
00296     return create_task(m_source->SetFormatAsync(format->Format)).then([this, format]()
00297     {
00298         m_logger->Log("Format set to " + format->DisplayName);
00299     });
00300 }
00301
00302 task<void> Scenario2_FindAvailableSourceGroups::StopReaderAsync()
00303 {
00304     task<void> currentTask = task_from_result();
00305
00306     m_streaming = false;
00307     if (m_reader != nullptr)
00308     {
00309         // Stop streaming from reader.
00310         currentTask = currentTask.then([this]()
00311         {
00312             return m_reader->StopAsync();
00313         }).then([this]()
00314         {
00315             m_reader->FrameArrived -= m_frameArrivedToken;
00316             m_reader = nullptr;
00317             m_logger->Log("Reader stopped");
00318         });
00319     }
00320
00321     return currentTask.then([this]()
00322     {
00323         return UpdateButtonStateAsync();
00324     });
00325 }
00326
00327 void Scenario2_FindAvailableSourceGroups::StartButton_Click(Object^ sender, RoutedEventArgs^ e)
00328 {
00329     m_currentTask = m_currentTask.then([this]()
00330     {
00331         return StartReaderAsync();
00332     }, task_continuation_context::get_current_winrt_context());
00333 }
00334
00335 void Scenario2_FindAvailableSourceGroups::StopButton_Click(Object^ sender, RoutedEventArgs^ e)
00336 {
00337     m_currentTask = m_currentTask.then([this]()
00338     {
00339         return StopReaderAsync();
00340     });
00341 }
00342
00343 void Scenario2_FindAvailableSourceGroups::Reader_FrameArrived(MediaFrameReader^ reader, MediaFrameArrivedEventArgs^ args)
00344 {
00345     // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
00346     // This can return null if there is no such frame, or if the reader is not in the
00347     // "Started" state. The latter can occur if a FrameArrived event was in flight
00348     // when the reader was stopped.
00349     if (MediaFrameReference^ frame = reader->TryAcquireLatestFrame())
00350     {
00351         m_frameRenderer->ProcessFrame(frame);
00352     }
00353 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SphereMesh Member List

This is the complete list of members for SphereMesh, including all inherited members.
m_indexBuffer | MeshObject | [protected]
m_indexCount | MeshObject | [protected]
m_vertexBuffer | MeshObject | [protected]
m_vertexCount | MeshObject | [protected]
MeshObject() | MeshObject |
Render(_In_ ID3D11DeviceContext *context) | MeshObject | [virtual]
SphereMesh(_In_ winrt::com_ptr< ID3D11Device3 > const &device, uint16_t segments) | SphereMesh |
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/pch.h Source File

  • Compass
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/SampleConfiguration.h Source File

  • UserConsentVerifier
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/SampleConfiguration.h Source File

  • XamlBind
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     ref class Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     public:
00013         property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "xBind Sample in C++/CX";
00018             }
00019         }
00020     internal:
00021         static property Windows::Foundation::Collections::IVector<Scenario^>^ scenarios
00022         {
00023             Windows::Foundation::Collections::IVector<Scenario^>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Collections::Vector<Scenario^>^ scenariosInner;
00031     };
00032
00033     public ref class Scenario sealed
00034     {
00035     public:
00036         property  Platform::String^ Title;
00037         property  Platform::String^ Description;
00038         property  Platform::String^ ClassName;
00039
00040         Scenario(Platform::String^ title, Platform::String^ description, Platform::String^ className);
00041     };
00042 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CardioidSound Member List

This is the complete list of members for CardioidSound, including all inherited members.
_audioFile | CardioidSound | [private]
_environment | CardioidSound | [private]
_hrtfParams | CardioidSound | [private]
_sourceVoice | CardioidSound | [private]
_xaudio2 | CardioidSound | [private]
ConfigureApo(_In_ float scaling, _In_ float order) | CardioidSound |
GetEnvironment() | CardioidSound | [inline]
Initialize(_In_ LPCWSTR filename) | CardioidSound |
OnUpdate(_In_ float x, _In_ float, _In_ float z, _In_ float pitch, _In_ float yaw, _In_ float roll) | CardioidSound |
OrientationFromAngles(float pitch, float yaw, float roll) | CardioidSound | [private]
SetEnvironment(_In_ HrtfEnvironment environment) | CardioidSound |
Start() | CardioidSound |
Stop() | CardioidSound |
~CardioidSound() | CardioidSound | [virtual]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3 Member List

This is the complete list of members for Scenario3, including all inherited members.
Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3 | [inline, private]
Scenario3() | Scenario3 | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/pch.h Source File

  • CameraProfile
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/App.xaml.cs Source File

  • XamlStateTriggers
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.ApplicationModel;
00007 using Windows.ApplicationModel.Activation;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00019
00020 namespace StateTriggersSample
00021 {
00022     /// <summary>
00023     /// Provides application-specific behavior to supplement the default Application class.
00024     /// </summary>
00025     sealed partial class App : Application
00026     {
00027         /// <summary>
00028         /// Allows tracking page views, exceptions and other telemetry through the Microsoft Application Insights service.
00029         /// </summary>
00030
00031         /// <summary>
00032         /// Initializes the singleton application object.  This is the first line of authored code
00033         /// executed, and as such is the logical equivalent of main() or WinMain().
00034         /// </summary>
00035         public App()
00036         {
00037
00038             this.InitializeComponent();
00039             this.Suspending += OnSuspending;
00040         }
00041
00042         /// <summary>
00043         /// Invoked when the application is launched normally by the end user.  Other entry points
00044         /// will be used such as when the application is launched to open a specific file.
00045         /// </summary>
00046         /// <param name="e">Details about the launch request and process.</param>
00047         protected override void OnLaunched(LaunchActivatedEventArgs e)
00048         {
00049
00050 #if DEBUG
00051             if (System.Diagnostics.Debugger.IsAttached)
00052             {
00053                 this.DebugSettings.EnableFrameRateCounter = false;
00054             }
00055 #endif
00056
00057             Frame rootFrame = Window.Current.Content as Frame;
00058
00059             // Do not repeat app initialization when the Window already has content,
00060             // just ensure that the window is active
00061             if (rootFrame == null)
00062             {
00063                 // Create a Frame to act as the navigation context and navigate to the first page
00064                 rootFrame = new Frame();
00065
00066                 rootFrame.NavigationFailed += OnNavigationFailed;
00067
00068                 if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
00069                 {
00070                     //TODO: Load state from previously suspended application
00071                 }
00072
00073                 // Place the frame in the current Window
00074                 Window.Current.Content = rootFrame;
00075             }
00076
00077             if (rootFrame.Content == null)
00078             {
00079                 // When the navigation stack isn't restored navigate to the first page,
00080                 // configuring the new page by passing required information as a navigation
00081                 // parameter
00082                 rootFrame.Navigate(typeof(MainPage), e.Arguments);
00083             }
00084             // Ensure the current window is active
00085             Window.Current.Activate();
00086         }
00087
00088         /// <summary>
00089         /// Invoked when Navigation to a certain page fails
00090         /// </summary>
00091         /// <param name="sender">The Frame which failed navigation</param>
00092         /// <param name="e">Details about the navigation failure</param>
00093         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00094         {
00095             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00096         }
00097
00098         /// <summary>
00099         /// Invoked when application execution is being suspended.  Application state is saved
00100         /// without knowing whether the application will be terminated or resumed with the contents
00101         /// of memory still intact.
00102         /// </summary>
00103         /// <param name="sender">The source of the suspend request.</param>
00104         /// <param name="e">Details about the suspend request.</param>
00105         private void OnSuspending(object sender, SuspendingEventArgs e)
00106         {
00107             var deferral = e.SuspendingOperation.GetDeferral();
00108             //TODO: Save application state and stop any background activity
00109             deferral.Complete();
00110         }
00111     }
00112 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/App.xaml.cs Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews

App.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.ApplicationModel;
00007 using Windows.ApplicationModel.Activation;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00019
00020 namespace OneHandedUse_TailoredMultipleViews
00021 {
00022     /// <summary>
00023     /// Provides application-specific behavior to supplement the default Application class.
00024     /// </summary>
00025     sealed partial class App : Application
00026     {
00027         /// <summary>
00028         /// Allows tracking page views, exceptions and other telemetry through the Microsoft Application Insights service.
00029         /// </summary>
00030         private const double ONEHANDEDSIZE = 7;
00031         /// <summary>
00032         /// Initializes the singleton application object.  This is the first line of authored code
00033         /// executed, and as such is the logical equivalent of main() or WinMain().
00034         /// </summary>
00035         public App()
00036         {
00037
00038             this.InitializeComponent();
00039             this.Suspending += OnSuspending;
00040         }
00041
00042         /// <summary>
00043         /// Invoked when the application is launched normally by the end user.  Other entry points
00044         /// will be used such as when the application is launched to open a specific file.
00045         /// </summary>
00046         /// <param name="e">Details about the launch request and process.</param>
00047         protected override void OnLaunched(LaunchActivatedEventArgs e)
00048         {
00049
00050 #if DEBUG
00051             if (System.Diagnostics.Debugger.IsAttached)
00052             {
00053                 this.DebugSettings.EnableFrameRateCounter = false;
00054             }
00055 #endif
00056
00057             Frame rootFrame = Window.Current.Content as Frame;
00058
00059             // Do not repeat app initialization when the Window already has content,
00060             // just ensure that the window is active
00061             if (rootFrame == null)
00062             {
00063                 // Create a Frame to act as the navigation context and navigate to the first page
00064                 rootFrame = new Frame();
00065
00066                 rootFrame.NavigationFailed += OnNavigationFailed;
00067
00068                 if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
00069                 {
00070                     //TODO: Load state from previously suspended application
00071                 }
00072
00073                 // Place the frame in the current Window
00074                 Window.Current.Content = rootFrame;
00075             }
00076
00077             if (rootFrame.Content == null)
00078             {
00079                 //Get the diagonal size of the integrated display
00080                 var dsc = new DisplaySizeHelper.DisplaySizeClass();
00081                 double _actualSizeInInches = dsc.GetDisplaySizeInInches();
00082
00083                 //If the diagonal size is <= 7" use the OneHanded optimized view
00084                 if ( _actualSizeInInches >0 && _actualSizeInInches <= ONEHANDEDSIZE)
00085                 {
00086                     rootFrame.Navigate(typeof(MainPage_OneHanded), e.Arguments);
00087                 }
00088                 else
00089                 {
00090                     rootFrame.Navigate(typeof(MainPage), e.Arguments);
00091                 }
00092             }
00093             // Ensure the current window is active
00094             Window.Current.Activate();
00095         }
00096
00097         /// <summary>
00098         /// Invoked when Navigation to a certain page fails
00099         /// </summary>
00100         /// <param name="sender">The Frame which failed navigation</param>
00101         /// <param name="e">Details about the navigation failure</param>
00102         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00103         {
00104             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00105         }
00106
00107         /// <summary>
00108         /// Invoked when application execution is being suspended.  Application state is saved
00109         /// without knowing whether the application will be terminated or resumed with the contents
00110         /// of memory still intact.
00111         /// </summary>
00112         /// <param name="sender">The source of the suspend request.</param>
00113         /// <param name="e">Details about the suspend request.</param>
00114         private void OnSuspending(object sender, SuspendingEventArgs e)
00115         {
00116             var deferral = e.SuspendingOperation.GetDeferral();
00117             //TODO: Save application state and stop any background activity
00118             deferral.Complete();
00119         }
00120     }
00121 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AccountsHelper Member List

This is the complete list of members for AccountsHelper, including all inherited members.
DeserializeXmlToAccountList(string listAsXml) | AccountsHelper | [inline, static]
LoadAccountList() | AccountsHelper | [inline, static]
SaveAccountList(List< Account > accountList) | AccountsHelper | [inline, static]
SerializeAccountListToXml(List< Account > list) | AccountsHelper | [inline, static]
USER_LIST_FILE_NAME | AccountsHelper | [private]
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlotDataReadyEventArgs Member List

This is the complete list of members for PlotDataReadyEventArgs, including all inherited members.
m_buffer | PlotDataReadyEventArgs | [private]
PlotDataReadyEventArgs(Windows::Storage::Streams::IBuffer const &buffer) | PlotDataReadyEventArgs | [inline]
Points() | PlotDataReadyEventArgs | [inline]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/DirectXHelper.h Source File

  • 360VideoPlayback
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include <ppltasks.h>    // For create_task
00004
00005 namespace DX
00006 {
00007     inline void ThrowIfFailed(HRESULT hr)
00008     {
00009         if (FAILED(hr))
00010         {
00011             // Set a breakpoint on this line to catch Win32 API errors.
00012             throw Platform::Exception::CreateException(hr);
00013         }
00014     }
00015
00016     // Function that reads from a binary file asynchronously.
00017     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00018     {
00019         using namespace Windows::Storage;
00020         using namespace Concurrency;
00021
00022         return create_task(PathIO::ReadBufferAsync(Platform::StringReference(filename.c_str()))).then(
00023             [] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00024             {
00025                 std::vector<byte> returnBuffer;
00026                 returnBuffer.resize(fileBuffer->Length);
00027                 Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), static_cast<unsigned int>(returnBuffer.size())));
00028                 return returnBuffer;
00029             });
00030     }
00031
00032     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00033     inline float ConvertDipsToPixels(float dips, float dpi)
00034     {
00035         constexpr float dipsPerInch = 96.0f;
00036         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00037     }
00038
00039 #if defined(_DEBUG)
00040     // Check for SDK Layer support.
00041     inline bool SdkLayersAvailable()
00042     {
00043         HRESULT hr = D3D11CreateDevice(
00044             nullptr,
00045             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00046             0,
00047             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00048             nullptr,                    // Any feature level will do.
00049             0,
00050             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00051             nullptr,                    // No need to keep the D3D device reference.
00052             nullptr,                    // No need to know the feature level.
00053             nullptr                     // No need to keep the D3D device context reference.
00054             );
00055
00056         return SUCCEEDED(hr);
00057     }
00058 #endif
00059 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario2_ScriptDetection.cpp Source File

  • LinguisticServices
  • cppwinrt

Scenario2_ScriptDetection.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_ScriptDetection.h"
00014 #include "Scenario2_ScriptDetection.g.cpp"
00015 #include "elsutil.h"
00016 #include <sstream>
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario2_ScriptDetection::Scenario2_ScriptDetection()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario2_ScriptDetection::Go_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto input = TextInput().Text();
00032
00033         std::wostringstream output;
00034         ELS::RecognizeTextScripts(input.c_str(), input.size(), [&](auto first, auto last, auto script)
00035             {
00036                 output << L"Range from " << first << L" to " << last << L": " << script << L" script\n";
00037             });
00038
00039         TextOutput().Text(output.str());
00040     }
00041 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/pch.h Source File

  • MessageDialog
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/PlotData.h Source File

  • WindowsAudioSession
  • cpp

PlotData.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // plotdata.h
00013 //
00014
00015 #include "MainPage.xaml.h"
00016
00017 #pragma once
00018
00019 #define MILLISECONDS_TO_VISUALIZE 20
00020
00021 namespace SDKSample
00022 {
00023     namespace WASAPIAudio
00024     {
00025         // Class for PlotDataReady events
00026         public ref class PlotDataReadyEventArgs sealed
00027         {
00028         internal:
00029             PlotDataReadyEventArgs( Platform::Array<int, 1>^ points, UINT32 size ) :
00030                     m_PointArray( points ),
00031                     m_Size( size )
00032             {};
00033
00034             property Platform::Array<int, 1>^ Points
00035             {
00036                 Platform::Array<int, 1>^ get() { return m_PointArray; }
00037             };
00038
00039             property UINT32 Size
00040             {
00041                 UINT32 get() { return m_Size; }
00042             };
00043
00044         private:
00045             Platform::Array<int,1>^     m_PointArray;
00046             UINT32                      m_Size;
00047         };
00048
00049         // PlotDataReady delegate
00050         public delegate void PlotDataReadyHandler( Platform::Object^ sender, PlotDataReadyEventArgs^ e );
00051
00052         // PlotDataReady Event
00053         public ref class PlotDataReadyEvent sealed
00054         {
00055         public:
00056             PlotDataReadyEvent() {};
00057
00058         internal:
00059             static void SendEvent( Object^ obj, Platform::Array<int, 1>^ points, UINT32 size )
00060             {
00061                 PlotDataReadyEventArgs^ e = ref new PlotDataReadyEventArgs( points, size );
00062                 PlotDataReady( obj, e );
00063             }
00064
00065         public:
00066             static event PlotDataReadyHandler^    PlotDataReady;
00067         };
00068     }
00069 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_FindAvailableSourceGroups Member List

This is the complete list of members for Scenario2_FindAvailableSourceGroups, including all inherited members.
_frameRenderer | Scenario2_FindAvailableSourceGroups | [private]
_groupCollection | Scenario2_FindAvailableSourceGroups | [private]
_logger | Scenario2_FindAvailableSourceGroups | [private]
_mediaCapture | Scenario2_FindAvailableSourceGroups | [private]
_reader | Scenario2_FindAvailableSourceGroups | [private]
_source | Scenario2_FindAvailableSourceGroups | [private]
_streaming | Scenario2_FindAvailableSourceGroups | [private]
ChangeMediaFormatAsync(FrameFormatModel format) | Scenario2_FindAvailableSourceGroups | [inline, private]
CreateReaderAsync() | Scenario2_FindAvailableSourceGroups | [inline, private]
DisposeMediaCapture() | Scenario2_FindAvailableSourceGroups | [inline, private]
FormatComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, private]
GroupComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, private]
InitializeCaptureAsync() | Scenario2_FindAvailableSourceGroups | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, protected]
Reader_FrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args) | Scenario2_FindAvailableSourceGroups | [inline, private]
Scenario2_FindAvailableSourceGroups() | Scenario2_FindAvailableSourceGroups | [inline]
SourceComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, private]
StartButton_Click(object sender, RoutedEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, private]
StartReaderAsync() | Scenario2_FindAvailableSourceGroups | [inline, private]
StopButton_Click(object sender, RoutedEventArgs e) | Scenario2_FindAvailableSourceGroups | [inline, private]
StopReaderAsync() | Scenario2_FindAvailableSourceGroups | [inline, private]
UpdateButtonStateAsync() | Scenario2_FindAvailableSourceGroups | [inline, private]
UpdateFrameSource() | Scenario2_FindAvailableSourceGroups | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BluetoothLEDeviceDisplay Member List

This is the complete list of members for BluetoothLEDeviceDisplay, including all inherited members.
BluetoothLEDeviceDisplay(Windows::Devices::Enumeration::DeviceInformation const &deviceInfoIn) | BluetoothLEDeviceDisplay |
DeviceInformation() | BluetoothLEDeviceDisplay | [inline]
GlyphBitmapImage() | BluetoothLEDeviceDisplay | [inline]
Id() | BluetoothLEDeviceDisplay | [inline]
IsConnectable() | BluetoothLEDeviceDisplay | [inline]
IsConnected() | BluetoothLEDeviceDisplay | [inline]
IsPaired() | BluetoothLEDeviceDisplay | [inline]
LookupBooleanProperty(param::hstring const &property) | BluetoothLEDeviceDisplay | [private]
m_propertyChanged | BluetoothLEDeviceDisplay | [private]
Name() | BluetoothLEDeviceDisplay | [inline]
OnPropertyChanged(param::hstring const &property) | BluetoothLEDeviceDisplay | [private]
Properties() | BluetoothLEDeviceDisplay | [inline]
PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler) | BluetoothLEDeviceDisplay |
PropertyChanged(event_token const &token) noexcept | BluetoothLEDeviceDisplay |
Update(Windows::Devices::Enumeration::DeviceInformationUpdate const &deviceInfoUpdate) | BluetoothLEDeviceDisplay |
UpdateGlyphBitmapImage() | BluetoothLEDeviceDisplay | [private]
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/OnboardingEnumTypes.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

OnboardingEnumTypes.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace AllJoynProducerExperiences
00013 {
00014     // All the Enums below as per the Onboarding interface spec
00015     // For more info: https://allseenalliance.org/developers/learn/base-services/onboarding/interface
00016
00017     enum OnboardingAuthenticationType
00018     {
00019         Wpa2Auto = -3,
00020         WpaAuto = -2,
00021         Any = -1,
00022         Open = 0,
00023         Wep = 1,
00024         WpaTkip = 2,
00025         WpaCcmp = 3,
00026         Wpa2Tkip = 4,
00027         Wpa2Ccmp = 5,
00028         Wps = 6,
00029     }
00030
00031     enum ConfigureWiFiResultStatus
00032     {
00033         NonConcurrent = 1,
00034         Concurrent = 2,
00035     }
00036
00037     enum ConnectionResultCode
00038     {
00039         Validated = 0,
00040         Unreachable,
00041         UnsupportedProtocol,
00042         Unauthorized,
00043         ErrorMessage,
00044     }
00045
00046     enum ConfigurationState
00047     {
00048         NotConfigured = 0,
00049         NotValidated,
00050         Validating,
00051         Validated,
00052         Error,
00053         Retry,
00054     }
00055 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.h Source File

  • CustomHidDeviceAccess
  • cpp

Scenario4_InputOutputReports.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 //
00008 // Scenario4_InputOutputReports.xaml.h
00009 // Declaration of the Scenario4_InputOutputReports class
00010 //
00011
00012 #pragma once
00013 #include "Scenario4_InputOutputReports.g.h"
00014
00015 namespace SDKTemplate
00016 {
00017     /// <summary>
00018     /// This scenario demonstrates how to get input reports and how to send output reports
00019     /// </summary>
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class InputOutputReports sealed
00022     {
00023     public:
00024         InputOutputReports();
00025     protected:
00026         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027     private:
00028         void GetNumericInputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00029         void SendNumericOutputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00030         void GetBooleanInputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00031         void SendBooleanOutputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00032
00033         Concurrency::task<void> GetNumericInputReportAsync(void);
00034         Concurrency::task<void> SendNumericOutputReportAsync(uint8 valueToWrite);
00035         Concurrency::task<void> GetBooleanInputReportAsync(uint8 buttonNumber);
00036         Concurrency::task<void> SendBooleanOutputReportAsync(bool bitValue, uint8 buttonNumber);
00037     };
00038 }
Generated on Fri Nov 15 2024 22:19:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario4.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario4.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4.xaml.cpp
00013 // Implementation of the Scenario4 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario4.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024 using namespace Windows::ApplicationModel::Resources;
00025 using namespace Windows::ApplicationModel::Resources::Core;
00026
00027 Scenario4::Scenario4()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 /// <summary>
00033 /// Invoked when this page is about to be displayed in a Frame.
00034 /// </summary>
00035 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00036 /// property is typically used to configure the page.</param>
00037 void Scenario4::OnNavigatedTo(NavigationEventArgs^ e)
00038 {
00039     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00040     // as NotifyUser()
00041     rootPage = MainPage::Current;
00042     Scenario4TextBlock->Text = "";
00043 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/BackgroundActivity.cpp Source File

  • BackgroundActivation
  • cpp

BackgroundActivity.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "MainPage.xaml.h"
00013 #include "BackgroundActivity.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace Windows::ApplicationModel::Activation;
00017 using namespace Windows::ApplicationModel::Background;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::System::Threading;
00021
00022 void BackgroundActivity::Run(IBackgroundTaskInstance^ taskInstance)
00023 {
00024     //
00025     // Query BackgroundWorkCost
00026     // Guidance: If BackgroundWorkCost is high, then perform only the minimum amount
00027     // of work in the background task and return immediately.
00028     //
00029     auto cost = BackgroundWorkCost::CurrentBackgroundWorkCost;
00030
00031     //
00032     // Associate a cancellation handler with the background task.
00033     //
00034     taskInstance->Canceled += ref new BackgroundTaskCanceledEventHandler(this, &BackgroundActivity::OnCanceled);
00035
00036     //
00037     // Get the deferral object from the task instance, and take a reference to the taskInstance.
00038     //
00039     TaskDeferral = taskInstance->GetDeferral();
00040     TaskInstance = taskInstance;
00041
00042     auto timerDelegate = [this](ThreadPoolTimer^ timer)
00043     {
00044         if ((CancelRequested == false) &&
00045             (Progress < 100))
00046         {
00047             Progress += 10;
00048             TaskInstance->Progress = Progress;
00049         }
00050         else
00051         {
00052             PeriodicTimer->Cancel();
00053
00054             //
00055             // Record that this background task ran.
00056             //
00057             String^ taskStatus = (Progress < 100) ? "Canceled with reason: " + CancelReason.ToString() : "Completed";
00058             auto key = TaskInstance->Task->Name;
00059             BackgroundTaskSample::TaskStatuses->Insert(key, taskStatus);
00060
00061             //
00062             // Indicate that the background task has completed.
00063             //
00064             TaskDeferral->Complete();
00065         }
00066     };
00067
00068     TimeSpan period;
00069     period.Duration = 1000 * 10000; // 1 second
00070     PeriodicTimer = ThreadPoolTimer::CreatePeriodicTimer(ref new TimerElapsedHandler(timerDelegate), period);
00071 }
00072
00073 //
00074 // Handles background task cancellation.
00075 //
00076 void BackgroundActivity::OnCanceled(IBackgroundTaskInstance^ taskInstance, BackgroundTaskCancellationReason reason)
00077 {
00078     //
00079     // Indicate that the background task is canceled.
00080     //
00081     CancelRequested = true;
00082     CancelReason = reason;
00083 }
00084
00085 void BackgroundActivity::OnStart(BackgroundTaskRegistrationGroup^ sender, BackgroundActivatedEventArgs^ args)
00086 {
00087     Start(args->TaskInstance);
00088 }
00089
00090 void BackgroundActivity::Start(IBackgroundTaskInstance^ taskInstance)
00091 {
00092     // Use the taskInstance->Name and/or taskInstance->InstanceId to determine
00093     // what background activity to perform. In this sample, all of our
00094     // background activities are the same, so there is nothing to check.
00095     auto activity = ref new BackgroundActivity();
00096     activity->Run(taskInstance);
00097 }
Generated on Fri Nov 15 2024 22:18:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario3_Enum.xaml.h Source File

  • Calendar
  • cpp

Scenario3_Enum.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Enum.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario3_Enum sealed
00020     {
00021     public:
00022         Scenario3_Enum();
00023         void ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024     };
00025 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/Scenario1_PreviewSettings.xaml.cpp Source File

  • CameraResolution
  • cpp

Scenario1_PreviewSettings.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_PreviewSettings.xaml.h"
00014 #include "StreamResolutionHelper.h"
00015 #include <sstream>
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace SDKTemplate;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Devices;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Media::Capture;
00026 using namespace Windows::Media::MediaProperties;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Controls::Primitives;
00031 using namespace Windows::UI::Xaml::Data;
00032 using namespace Windows::UI::Xaml::Input;
00033 using namespace Windows::UI::Xaml::Media;
00034 using namespace Windows::UI::Xaml::Navigation;
00035
00036 /// <summary>
00037 /// Initializes a new instance of the <see cref="Scenario1_PreviewSettings"/> class.
00038 /// </summary>
00039 Scenario1_PreviewSettings::Scenario1_PreviewSettings()
00040     : _rootPage(MainPage::Current)
00041     , _mediaCapture(nullptr)
00042     , _isPreviewing(false)
00043 {
00044     InitializeComponent();
00045 }
00046
00047 Scenario1_PreviewSettings::~Scenario1_PreviewSettings()
00048 {
00049     CleanupCameraAsync();
00050 }
00051
00052 void Scenario1_PreviewSettings::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00053 {
00054     CleanupCameraAsync();
00055 }
00056
00057 /// <summary>
00058 /// Initializes the camera
00059 /// </summary>
00060 task<void> Scenario1_PreviewSettings::InitializeCameraAsync()
00061 {
00062     _mediaCapture = ref new MediaCapture();
00063     _mediaCaptureFailedEventToken =
00064         _mediaCapture->Failed += ref new MediaCaptureFailedEventHandler(this, &Scenario1_PreviewSettings::MediaCapture_Failed);
00065
00066     return create_task(_mediaCapture->InitializeAsync())
00067         .then([this]()
00068     {
00069         PreviewControl->Source = _mediaCapture.Get();
00070         return create_task(_mediaCapture->StartPreviewAsync());
00071     }).then([this](task<void> previousTask)
00072     {
00073         try
00074         {
00075             _isPreviewing = true;
00076             previousTask.get();
00077             return previousTask;
00078         }
00079         catch (AccessDeniedException^)
00080         {
00081             _rootPage->Current->NotifyUser("The app was denied access to the camera", NotifyType::ErrorMessage);
00082             return CleanupCameraAsync();
00083         }
00084     });
00085 }
00086
00087 /// <summary>
00088 /// Cleans up the camera and state variables
00089 /// </summary>
00090 task<void> Scenario1_PreviewSettings::CleanupCameraAsync()
00091 {
00092     task<void> cleanupTask;
00093     if (_isPreviewing)
00094     {
00095         cleanupTask = create_task(_mediaCapture->StopPreviewAsync());
00096         _isPreviewing = false;
00097     }
00098     else
00099     {
00100         cleanupTask = create_task([]() {});
00101     }
00102
00103     return cleanupTask.then([this]()
00104     {
00105         if (_mediaCapture != nullptr)
00106         {
00107             _mediaCapture->Failed -= _mediaCaptureFailedEventToken;
00108             _mediaCapture = nullptr;
00109         }
00110     });
00111 }
00112
00113 /// <summary>
00114 /// Initializes the camera and populates the UI
00115 /// </summary>
00116 /// <param name="sender"></param>
00117 void Scenario1_PreviewSettings::InitializeCameraButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^)
00118 {
00119     Button^ button = static_cast<Button^>(sender);
00120     button->IsEnabled = false;
00121
00122     create_task(InitializeCameraAsync())
00123         .then([this, button]()
00124     {
00125         if (_isPreviewing)
00126         {
00127             button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00128             PreviewControl->Visibility = Windows::UI::Xaml::Visibility::Visible;
00129             PopulateSettingsComboBox();
00130         }
00131     });
00132 }
00133
00134 /// <summary>
00135 ///  Event handler for Preview settings combo box. Updates stream resolution based on the selection.
00136 /// </summary>
00137 /// <param name="sender"></param>
00138 /// <param name="e"></param>
00139 void Scenario1_PreviewSettings::ComboBoxSettings_Changed(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^)
00140 {
00141     if (_isPreviewing)
00142     {
00143         auto selectedItem = static_cast<ComboBoxItem^>(static_cast<ComboBox^>(sender)->SelectedItem);
00144         auto encodingProperties = static_cast<IMediaEncodingProperties^>(selectedItem->Tag);
00145         create_task(_rootPage->SetMediaStreamPropertiesAsync(_mediaCapture.Get(), PreviewControl, MediaStreamType::VideoPreview, encodingProperties));
00146     }
00147 }
00148
00149 /// <summary>
00150 /// Populates the combo box with all possible combinations of settings returned by the camera driver
00151 /// </summary>
00152 void Scenario1_PreviewSettings::PopulateSettingsComboBox()
00153 {
00154     // Query all properties of the device
00155     auto allProperties = _mediaCapture->VideoDeviceController->GetAvailableMediaStreamProperties(MediaStreamType::VideoPreview);
00156
00157     // Populate the combo box with the entries
00158     for (auto encodingProperties : allProperties)
00159     {
00160         ComboBoxItem^ comboBoxItem = ref new ComboBoxItem();
00161         auto streamHelper = ref new StreamResolutionHelper(encodingProperties);
00162         comboBoxItem->Content = streamHelper->GetFriendlyName();
00163         comboBoxItem->Tag = encodingProperties;
00164         CameraSettings->Items->Append(comboBoxItem);
00165     }
00166 }
00167
00168 void Scenario1_PreviewSettings::MediaCapture_Failed(MediaCapture^, MediaCaptureFailedEventArgs^ e)
00169 {
00170     String^ message = e->Message;
00171     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message]()
00172     {
00173         _rootPage->Current->NotifyUser("Preview stopped: " + message, NotifyType::ErrorMessage);
00174         _isPreviewing = false;
00175         CleanupCameraAsync();
00176     }));
00177 }
Generated on Fri Nov 15 2024 22:18:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WICConvert Member List

This is the complete list of members for WICConvert, including all inherited members.
source | WICConvert
target | WICConvert
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/SampleConfiguration.cpp Source File

  • JapanesePhoneticAnalysis
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Japanese phonetic analysis";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Analyze Japanese text", xaml_typename<SDKTemplate::Scenario1_Analyze>() },
00029 });
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ViewModels/HeroArticlesViewModel.cs Source File

  • XamlTransform3DAnimations
  • cs
  • ViewModels

HeroArticlesViewModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.UI.Xaml;
00008
00009 namespace Transform3DAnimations.ViewModels
00010 {
00011     public class HeroArticlesViewModel : INotifyPropertyChanged
00012     {
00013         private ArticleViewModel _article0;
00014         public ArticleViewModel Article0
00015         {
00016             get
00017             {
00018                 return _article0;
00019             }
00020             private set
00021             {
00022                 _article0 = value;
00023                 NotifyPropertyChanged("HeroArticle0");
00024             }
00025         }
00026
00027         private ArticleViewModel _article1;
00028
00029         public ArticleViewModel Article1
00030         {
00031             get
00032             {
00033                 return _article1;
00034             }
00035
00036             private set
00037             {
00038                 _article1 = value;
00039                 NotifyPropertyChanged("HeroArticle1");
00040             }
00041         }
00042
00043         public HeroArticlesViewModel()
00044         {
00045             _article0 = new ArticleViewModel();
00046             _article1 = new ArticleViewModel();
00047         }
00048
00049         private void NotifyPropertyChanged(string propertyName)
00050         {
00051             if (PropertyChanged != null)
00052             {
00053                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
00054             }
00055         }
00056
00057         public event PropertyChangedEventHandler PropertyChanged;
00058     }
00059 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario2.h Source File

  • Logging
  • cppwinrt

Scenario2.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2.g.h"
00015 #include "LoggingSessionScenario.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2 : Scenario2T<Scenario2>
00020     {
00021         Scenario2();
00022
00023         fire_and_forget
00024         DoScenario(
00025             Windows::Foundation::IInspectable const& sender,
00026             Windows::UI::Xaml::RoutedEventArgs const& args);
00027
00028         void
00029         EnableDisableLogging(
00030             Windows::Foundation::IInspectable const& sender,
00031             Windows::UI::Xaml::RoutedEventArgs const& args);
00032
00033         void
00034             OnNavigatedTo(
00035                 Windows::UI::Xaml::Navigation::NavigationEventArgs const& args);
00036
00037         void
00038             OnNavigatedFrom(
00039                 Windows::UI::Xaml::Navigation::NavigationEventArgs const& args);
00040
00041     private:
00042
00043         void
00044         UpdateControls();
00045
00046         void
00047         AddMessage(_In_ LPCWSTR message);
00048
00049         fire_and_forget
00050         OnStatusChanged(SDKTemplate::LoggingScenarioEventArgs args);
00051
00052         LoggingSessionScenario& _instance = LoggingSessionScenario::Instance();
00053         event_token _statusChangedToken;
00054     };
00055 }
00056
00057 namespace winrt::SDKTemplate::factory_implementation
00058 {
00059     struct Scenario2 : Scenario2T<Scenario2, implementation::Scenario2>
00060     {
00061     };
00062 }
Generated on Fri Nov 15 2024 22:19:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BasicShapes Member List

This is the complete list of members for BasicShapes, including all inherited members.
__pad0__ | BasicShapes |
BasicShapes(ID3D11Device *d3dDevice) | BasicShapes | [private]
CreateBox(float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateBox(float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes | [private]
CreateBox(float3 radii, _Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateCube(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateCube(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes | [private]
CreateCube(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateIndexBuffer(_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer) | BasicShapes | [private]
CreateIndexBuffer(_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer) | BasicShapes | [private]
CreateIndexBuffer(_In_ unsigned int numIndices, _In_ unsigned short *indexData, _Out_ ID3D11Buffer **indexBuffer) | BasicShapes | [private]
CreateReferenceAxis(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateReferenceAxis(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes | [private]
CreateReferenceAxis(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes | [private]
CreateSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateTangentSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateTangentSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes | [private]
CreateTangentSphere(_Out_ ID3D11Buffer **vertexBuffer, _Out_ ID3D11Buffer **indexBuffer, _Out_opt_ unsigned int *vertexCount, _Out_opt_ unsigned int *indexCount) | BasicShapes |
CreateTangentVertexBuffer(_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
CreateTangentVertexBuffer(_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
CreateTangentVertexBuffer(_In_ unsigned int numVertices, _In_ TangentVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
CreateVertexBuffer(_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
CreateVertexBuffer(_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
CreateVertexBuffer(_In_ unsigned int numVertices, _In_ BasicVertex *vertexData, _Out_ ID3D11Buffer **vertexBuffer) | BasicShapes | [private]
m_d3dDevice | BasicShapes | [private]
m_d3dDevice | BasicShapes | [private]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SocialMediaCounter Member List

This is the complete list of members for SocialMediaCounter, including all inherited members.
NumOfShares | SocialMediaCounter |
NumOfSharesProperty | SocialMediaCounter | [static]
ShareImage | SocialMediaCounter |
ShareImageProperty | SocialMediaCounter | [static]
SocialMediaCounter() | SocialMediaCounter | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_MultiVideoPlayback Member List

This is the complete list of members for Scenario1_MultiVideoPlayback, including all inherited members.
EnablePlaybackControls(bool enabled) | Scenario1_MultiVideoPlayback | [inline, private]
Load_Click(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
maxNaturalDurationForController | Scenario1_MultiVideoPlayback | [private]
MediaPlayer_MediaOpened(MediaPlayer sender, object args) | Scenario1_MultiVideoPlayback | [inline, private]
mediaPlayerElements | Scenario1_MultiVideoPlayback | [private]
MediaTimelineController_PositionChanged(MediaTimelineController sender, object args) | Scenario1_MultiVideoPlayback | [inline, private]
MediaTimelineController_StateChanged(MediaTimelineController sender, object args) | Scenario1_MultiVideoPlayback | [inline, private]
mediaUris | Scenario1_MultiVideoPlayback | [private]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
Page_OnUnloaded(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
PlayPause_Click(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
rootPage | Scenario1_MultiVideoPlayback | [private]
Scenario1_MultiVideoPlayback() | Scenario1_MultiVideoPlayback | [inline]
Seek10SecondsBack_Click(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
Seek10SecondsForward_Click(object sender, RoutedEventArgs e) | Scenario1_MultiVideoPlayback | [inline, private]
timelineController | Scenario1_MultiVideoPlayback | [private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario4_ScriptNotify.xaml.cs Source File

  • XamlWebView
  • cs

Scenario4_ScriptNotify.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Documents;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario4_ScriptNotify : Page
00020     {
00021         MainPage rootPage = MainPage.Current;
00022
00023         public Scenario4_ScriptNotify()
00024         {
00025             this.InitializeComponent();
00026             WebViewControl.Navigate(new Uri("ms-appx-web:///html/scriptNotify_example.html"));
00027         }
00028
00029         void WebViewControl_ScriptNotify(object sender, NotifyEventArgs e)
00030         {
00031             // Be sure to verify the source of the message when performing actions with the data.
00032             // As webview can be navigated, you need to check that the message is coming from a page/code
00033             // that you trust.
00034             rootPage.NotifyUser($"Event received from {e.CallingUri}: \"{e.Value}\"", NotifyType.StatusMessage);
00035         }
00036
00037         private void MoreLess_Click(Hyperlink sender, HyperlinkClickEventArgs args)
00038         {
00039             var hyperlink = (Hyperlink)sender;
00040             if (MoreInformationText.Visibility == Visibility.Visible)
00041             {
00042                 MoreInformationText.Visibility = Visibility.Collapsed;
00043                 MoreLessText.Text = "Show more information";
00044             }
00045             else
00046             {
00047                 MoreInformationText.Visibility = Visibility.Visible;
00048                 MoreLessText.Text = "Show less information";
00049             }
00050             rootPage.NotifyUser("", NotifyType.StatusMessage);
00051         }
00052     }
00053 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario08_PostCustomContent.xaml.cs Source File

  • HttpClient
  • cs

Scenario08_PostCustomContent.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using Windows.Data.Json;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019 using Windows.Web.Http;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario08_PostCustomContent : Page
00024     {
00025         MainPage rootPage = MainPage.Current;
00026
00027         private HttpClient httpClient;
00028         private CancellationTokenSource cts;
00029
00030         public Scenario08_PostCustomContent()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         protected override void OnNavigatedTo(NavigationEventArgs e)
00036         {
00037             httpClient = new HttpClient();
00038             cts = new CancellationTokenSource();
00039         }
00040
00041         protected override void OnNavigatedFrom(NavigationEventArgs e)
00042         {
00043             cts.Cancel();
00044             cts.Dispose();
00045             httpClient.Dispose();
00046         }
00047
00048         private async void Start_Click(object sender, RoutedEventArgs e)
00049         {
00050             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00051             // valid, absolute URI, we'll notify the user about the incorrect input.
00052             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00053             if (resourceUri == null)
00054             {
00055                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00056                 return;
00057             }
00058
00059             Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
00060             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00061
00062             IHttpContent jsonContent = new HttpJsonContent(JsonValue.Parse("{\"score\": 100, \"enabled\": false}"));
00063
00064             // This sample uses a "try" in order to support TaskCanceledException.
00065             // If you don't need to support cancellation, then the "try" is not needed.
00066             try
00067             {
00068                 HttpRequestResult result = await httpClient.TryPostAsync(resourceUri, jsonContent).AsTask(cts.Token);
00069
00070                 if (result.Succeeded)
00071                 {
00072                     await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
00073
00074                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00075                 }
00076                 else
00077                 {
00078                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00079                 }
00080             }
00081             catch (TaskCanceledException)
00082             {
00083                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00084             }
00085
00086             Helpers.ScenarioCompleted(StartButton, CancelButton);
00087         }
00088
00089         private void Cancel_Click(object sender, RoutedEventArgs e)
00090         {
00091             cts.Cancel();
00092             cts.Dispose();
00093
00094             // Re-create the CancellationTokenSource.
00095             cts = new CancellationTokenSource();
00096         }
00097     }
00098 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromInternet/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromInternet

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.AdaptiveTemplates.Image.Src.FromInternet
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00022         {
00023             Initialize();
00024         }
00025
00026         private void Initialize()
00027         {
00028             // Clear all existing notifications
00029             ToastNotificationManager.History.Clear();
00030
00031             // Pop notifications
00032             popToastControl.Payload =
00033                 $@"
00034                 <toast scenario='reminder'>
00035                     <visual>
00036                         <binding template='ToastGeneric'>
00037                             <text>Image Src - From Internet</text>
00038                             <text>Make sure an image is displayed below this text.</text>
00039                             <image src='http://hiking.andrewbares.net/trips/2/images/large/p193jj6k4e58c1c7k1486u8n6vt6.jpg'/>
00040                         </binding>
00041                     </visual>
00042                 </toast>";
00043         }
00044
00045         private async void Error(string message)
00046         {
00047             await new MessageDialog(message, "ERROR").ShowAsync();
00048         }
00049     }
00050 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
AddEllipseToCanvas(InkAnalysisInkDrawing shape) | Scenario1 | [inline, private]
AddFolderButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
AddPolygonToCanvas(InkAnalysisInkDrawing shape) | Scenario1 | [inline, private]
architectureString(Windows.System.ProcessorArchitecture architecture) | Scenario1 | [inline, private]
AttachmentImage_RightTapped(object sender, RightTappedRoutedEventArgs e) | Scenario1 | [inline, private]
Button_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
CheckBox_Toggle(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
ClearButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
ConvertShapes() | Scenario1 | [inline, private]
CreateFileButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
CreateView_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
currentItemIndex | Scenario1 | [private]
DEFAULT_TITLE | Scenario1 | [private]
DeleteMenuItem_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
dispatcherTimer | Scenario1 | [private]
DispatcherTimer_Tick(object sender, object e) | Scenario1 | [inline, private]
DisplayProperties_DpiChanged(DisplayInformation sender, object args) | Scenario1 | [inline, private]
Distance(Point p0, Point p1) | Scenario1 | [inline, private, static]
DoWin10Mode(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
DoWin81Mode(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
Find_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
GenerateSizePreferenceBinding() | Scenario1 | [inline, private]
GetElementRect(FrameworkElement element) | Scenario1 | [inline, static]
GetFilesAndFoldersButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
GetMediaTypeFromFileContentType(StorageFile file) | Scenario1 | [inline, private]
GetPackage_Click(Object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
GetThumbnailButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
imageBase | Scenario1 | [private]
inkAnalyzer | Scenario1 | [private]
inkPresenter | Scenario1 | [private]
InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) | Scenario1 | [inline, private]
InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) | Scenario1 | [inline, private]
isInitialized | Scenario1 | [private]
isThisPageActive | Scenario1 | [private]
mediaPlaybackItem | Scenario1 | [private]
mediaPlayer | Scenario1 | [private]
mediaPlayer_MediaEnded(MediaPlayer sender, object e) | Scenario1 | [inline, private]
mediaPlayer_MediaFailed(MediaPlayer sender, MediaPlayerFailedEventArgs e) | Scenario1 | [inline, private]
mediaPlayer_MediaOpened(MediaPlayer sender, object e) | Scenario1 | [inline, private]
mediaPlayer_PlaybackStateChanged(MediaPlaybackSession sender, object e) | Scenario1 | [inline, private]
MyMap_Loaded(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
MyMap_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args) | Scenario1 | [inline, private]
nextButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1 | [inline, protected]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario1 | [inline, private]
OpenMenuItem_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
optedIn | Scenario1 | [private, static]
pausedDueToMute | Scenario1 | [private]
pickFileButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
playlist | Scenario1 | [private]
playPauseButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
positionUpdate_TimerTick(object sender, object e) | Scenario1 | [inline, private]
previousButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
PrintMenuItem_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
projectionCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario1 | [inline, private]
repeatPlaylist | Scenario1 | [private]
ResetOutput() | Scenario1 | [inline, private]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
Scenario1() | Scenario1 | [inline]
SearchButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
SelectFilesButton_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
SetMapProjection() | Scenario1 | [inline, private]
SetMapStyle() | Scenario1 | [inline, private]
SetNewMediaItem(int newItemIndex) | Scenario1 | [inline, private]
SetupSystemMediaTransportControls() | Scenario1 | [inline, private]
ShowAsStandalone_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
smtcPositionUpdateTimer | Scenario1 | [private]
StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args) | Scenario1 | [inline, private]
styleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario1 | [inline, private]
supportedAudioFormats | Scenario1 | [private, static]
supportedVideoFormats | Scenario1 | [private, static]
SyncPlaybackStatusToMediaPlayerState() | Scenario1 | [inline, private]
systemMediaControls | Scenario1 | [private]
systemMediaControls_AutoRepeatModeChangeRequested(SystemMediaTransportControls sender, AutoRepeatModeChangeRequestedEventArgs args) | Scenario1 | [inline, private]
systemMediaControls_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs args) | Scenario1 | [inline, private]
systemMediaControls_PlaybackPositionChangeRequested(SystemMediaTransportControls sender, PlaybackPositionChangeRequestedEventArgs args) | Scenario1 | [inline, private]
systemMediaControls_PlaybackRateChangeRequested(SystemMediaTransportControls sender, PlaybackRateChangeRequestedEventArgs args) | Scenario1 | [inline, private]
systemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args) | Scenario1 | [inline, private]
target_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) | Scenario1 | [inline, private]
target_Holding(object sender, HoldingRoutedEventArgs e) | Scenario1 | [inline, private]
target_PointerEntered(object sender, PointerRoutedEventArgs e) | Scenario1 | [inline, private]
target_PointerExited(object sender, PointerRoutedEventArgs e) | Scenario1 | [inline, private]
target_PointerPressed(object sender, PointerRoutedEventArgs e) | Scenario1 | [inline, private]
target_PointerReleased(object sender, PointerRoutedEventArgs e) | Scenario1 | [inline, private]
target_RightTapped(object sender, RightTappedRoutedEventArgs e) | Scenario1 | [inline, private]
target_Tapped(object sender, TappedRoutedEventArgs e) | Scenario1 | [inline, private]
TrafficFlowVisible_Checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
trafficFlowVisibleCheckBox_Unchecked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
UpdateCustomTransportControls() | Scenario1 | [inline, private]
UpdateSmtcPosition() | Scenario1 | [inline, private]
UpdateSystemMediaControlsDisplayAsync(StorageFile mediaFile) | Scenario1 | [inline, private]
versionString(PackageVersion version) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.cpp Source File

  • CustomHidDeviceAccess
  • cpp

Scenario1_DeviceConnect.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 //
00008 // Scenario1_DeviceConnect.xaml.cpp
00009 // Implementation of the DeviceConnect class
00010 //
00011
00012 #include "pch.h"
00013 #include "Scenario1_DeviceConnect.xaml.h"
00014 #include "EventHandlerForDevice.h"
00015 #include "MainPage.xaml.h"
00016
00017 using namespace SDKTemplate;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Concurrency;
00021 using namespace Windows::ApplicationModel;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Devices::HumanInterfaceDevice;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Platform::String^ DeviceConnect::ButtonNameDisconnectFromDevice = "Disconnect from device";
00030 Platform::String^ DeviceConnect::ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed";
00031
00032 DeviceConnect::DeviceConnect(void) :
00033     listOfDevices(ref new Vector<DeviceListEntry^>()),
00034     deviceWatchers(ref new Vector<DeviceWatcher^>()),
00035     watchersStarted(false),
00036     watchersSuspended(false),
00037     isAllDevicesEnumerated(false)
00038 {
00039     InitializeComponent();
00040 }
00041
00042 /// <summary>
00043 /// Invoked when this page is about to be displayed in a Frame.
00044 ///
00045 /// Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.
00046 ///
00047 /// The UI elements are controlled/modified through device watcher events, device opening/closing, and app events
00048 /// </summary>
00049 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00050 /// property is typically used to configure the page.</param>
00051 void DeviceConnect::OnNavigatedTo(NavigationEventArgs^ /* e */)
00052 {
00053     // Default UI state
00054     UpdateConnectDisconnectButtonsAndList(true);
00055
00056     // Register for device events in case we are already watching for a device
00057     EventHandlerForDevice::Current->OnDeviceConnected = ref new TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>(this, &DeviceConnect::OnDeviceConnected);
00058     EventHandlerForDevice::Current->OnDeviceClose = ref new TypedEventHandler<EventHandlerForDevice^, DeviceInformation^>(this, &DeviceConnect::OnDeviceClosing);
00059
00060     // Begin watching out for app events
00061     StartHandlingAppEvents();
00062
00063     // Initalize the desired device watchers so that we can watch for when devices are connected/removed
00064     InitializeDeviceWatchers();
00065     StartDeviceWatchers();
00066
00067     DeviceListSource->Source = listOfDevices;
00068 }
00069
00070 /// <summary>
00071 /// Unregister from App events and DeviceWatcher events because this page will be unloaded.
00072 /// </summary>
00073 /// <param name="e"></param>
00074 void DeviceConnect::OnNavigatedFrom(NavigationEventArgs^ /* e */)
00075 {
00076     StopDeviceWatchers();
00077     StopHandlingAppEvents();
00078
00079     // We no longer care about the device being connected
00080     EventHandlerForDevice::Current->OnDeviceConnected = nullptr;
00081     EventHandlerForDevice::Current->OnDeviceClose = nullptr;
00082 }
00083
00084 void DeviceConnect::ConnectToDevice_Click(Object^ /* sender */, RoutedEventArgs^ /* eventArgs */)
00085 {
00086     auto selection = ConnectDevices->SelectedItems;
00087     DeviceListEntry^ entry = nullptr;
00088
00089     if (selection->Size > 0)
00090     {
00091         auto obj = selection->GetAt(0);
00092         entry = safe_cast<DeviceListEntry^>(obj);
00093
00094         // Create an EventHandlerForDevice to watch for the device we are connecting to
00095         EventHandlerForDevice::CreateNewEventHandlerForDevice();
00096
00097         // Get notified when the device was successfully connected to or about to be closed
00098         EventHandlerForDevice::Current->OnDeviceConnected = ref new TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>(this, &DeviceConnect::OnDeviceConnected);
00099         EventHandlerForDevice::Current->OnDeviceClose = ref new TypedEventHandler<EventHandlerForDevice^, DeviceInformation^>(this, &DeviceConnect::OnDeviceClosing);
00100
00101         // It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed
00102         // on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
00103         create_task(EventHandlerForDevice::Current->OpenDeviceAsync(entry->DeviceInformation, entry->DeviceSelector)).then([this](task<bool> openDeviceTask)
00104         {
00105             auto openSuccess = openDeviceTask.get();
00106
00107             // Disable connect button if we connected to the device
00108             UpdateConnectDisconnectButtonsAndList(!openSuccess);
00109         });
00110     }
00111 }
00112
00113 void DeviceConnect::DisconnectFromDevice_Click(Object^ /* sender */, RoutedEventArgs^ /* eventArgs */)
00114 {
00115     auto selection = ConnectDevices->SelectedItems;
00116     DeviceListEntry^ entry = nullptr;
00117
00118     // Prevent auto reconnect because we are voluntarily closing it
00119     // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed
00120     EventHandlerForDevice::Current->IsEnabledAutoReconnect = false;
00121
00122     if (selection->Size > 0)
00123     {
00124         auto obj = selection->GetAt(0);
00125         entry = safe_cast<DeviceListEntry^>(obj);
00126
00127         if (entry != nullptr)
00128         {
00129             EventHandlerForDevice::Current->CloseDevice();
00130         }
00131     }
00132
00133     ButtonDisconnectFromDevice->Content = ButtonNameDisconnectFromDevice;
00134
00135     UpdateConnectDisconnectButtonsAndList(true);
00136 }
00137
00138 /// <summary>
00139 /// Initialize device watchers to watch for the SuperMUTT.
00140 /// Several other ways of using a device selector to get the desired devices (the devices are really DeviceInformation objects):
00141 /// 1) Using only the Usage Page and the Usage Id of the device (enumerates any device with the same usage page and usage id)
00142 /// 2) Using the Usage Page, Usage Id, Vendor Id, Product Id (Same as above except it also matches the VIDs and PIDs)
00143 ///
00144 /// GetDeviceSelector return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or  DeviceInformation.createFromIdAsync().
00145 ///
00146 /// In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.
00147 /// </summary>
00148 void DeviceConnect::InitializeDeviceWatchers(void)
00149 {
00150     // SuperMUTT
00151     auto superMuttSelector = HidDevice::GetDeviceSelector(SuperMutt::Device::UsagePage, SuperMutt::Device::UsageId, SuperMutt::Device::Vid, SuperMutt::Device::Pid);
00152
00153     // Create a device watcher to look for instances of the OSRFX2 device interface and SuperMUTT device
00154     auto superMuttWatcher = DeviceInformation::CreateWatcher(superMuttSelector);
00155
00156     // Allow the EventHandlerForDevice to handle device watcher events that relate to or affect our device (i.e. device removal, addition, app suspension/resume)
00157     AddDeviceWatcher(superMuttWatcher, superMuttSelector);
00158 }
00159
00160 void DeviceConnect::StartHandlingAppEvents(void)
00161 {
00162     // This event is raised when the app is exited and when the app is suspended
00163     appSuspendEventToken = App::Current->Suspending += ref new SuspendingEventHandler(this, &DeviceConnect::OnAppSuspension);
00164     appResumeEventToken = App::Current->Resuming += ref new EventHandler<Object^>(this, &DeviceConnect::OnAppResume);
00165 }
00166
00167 void DeviceConnect::StopHandlingAppEvents(void)
00168 {
00169     // This event is raised when the app is exited and when the app is suspended
00170     App::Current->Suspending -= appSuspendEventToken;
00171     appSuspendEventToken.Value = 0;
00172
00173     App::Current->Resuming -= appResumeEventToken;
00174     appResumeEventToken.Value = 0;
00175 }
00176
00177 /// <summary>
00178 /// Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.
00179 /// </summary>
00180 /// <param name="deviceWatcher"></param>
00181 /// <param name="deviceSelector">The AQS used to create the device watcher</param>
00182 void DeviceConnect::AddDeviceWatcher(DeviceWatcher^ deviceWatcher, String^ deviceSelector)
00183 {
00184     deviceWatcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>([this, deviceSelector](DeviceWatcher^ deviceWatcher, DeviceInformation^ deviceInformation)
00185     {
00186         // Forward this event to a more generic event handler for added devices, but provide it with a deviceSelector that is
00187         // created that device watcher
00188         OnDeviceAdded(deviceWatcher, deviceInformation, deviceSelector);
00189     });
00190     deviceWatcher->Removed += ref new TypedEventHandler<DeviceWatcher^, DeviceInformationUpdate^>(this, &DeviceConnect::OnDeviceRemoved);
00191     deviceWatcher->EnumerationCompleted += ref new TypedEventHandler<DeviceWatcher^, Object^>(this, &DeviceConnect::OnDeviceEnumerationComplete);
00192
00193     deviceWatchers->Append(deviceWatcher);
00194 }
00195
00196 /// <summary>
00197 /// Starts all device watchers including ones that have been individually stopped.
00198 /// </summary>
00199 void DeviceConnect::StartDeviceWatchers(void)
00200 {
00201     // Start all device watchers
00202     watchersStarted = true;
00203     isAllDevicesEnumerated = false;
00204
00205     for (auto deviceWatcher : deviceWatchers)
00206     {
00207         if ((deviceWatcher->Status != DeviceWatcherStatus::Started)
00208             && (deviceWatcher->Status != DeviceWatcherStatus::EnumerationCompleted))
00209         {
00210             deviceWatcher->Start();
00211         }
00212     }
00213 }
00214
00215 /// <summary>
00216 /// Stops all device watchers.
00217 /// </summary>
00218 void DeviceConnect::StopDeviceWatchers(void)
00219 {
00220     // Stop all device watchers
00221     for (auto deviceWatcher : deviceWatchers)
00222     {
00223         if ((deviceWatcher->Status == DeviceWatcherStatus::Started)
00224             || (deviceWatcher->Status == DeviceWatcherStatus::EnumerationCompleted))
00225         {
00226             deviceWatcher->Stop();
00227         }
00228     }
00229
00230     // Clear the list of devices so we don't have potentially disconnected devices around
00231     ClearDeviceEntries();
00232
00233     watchersStarted = false;
00234 }
00235
00236 /// <summary>
00237 /// Creates a DeviceListEntry for a device and adds it to the list of devices in the UI
00238 /// </summary>
00239 /// <param name="deviceInformation">DeviceInformation on the device to be added to the list</param>
00240 /// <param name="deviceSelector">The AQS used to find this device</param>
00241 void DeviceConnect::AddDeviceToList(DeviceInformation^ deviceInformation, String^ deviceSelector)
00242 {
00243     // search the device list for a device with a matching interface ID
00244     auto match = FindDevice(deviceInformation->Id);
00245
00246     // Add the device if it's new
00247     if (match == nullptr)
00248     {
00249         // Create a new element for this device interface, and queue up the query of its
00250         // device information
00251         match = ref new DeviceListEntry(deviceInformation, deviceSelector);
00252
00253         // Add the new element to the end of the list of devices
00254         listOfDevices->Append(match);
00255     }
00256 }
00257
00258 void DeviceConnect::RemoveDeviceFromList(String^ deviceId)
00259 {
00260     // Search the list of devices for one with a matching ID.  Move the matched
00261     // item to the end of the list.
00262     for (uint32 entryIndex = 0; entryIndex < listOfDevices->Size; entryIndex++)
00263     {
00264         DeviceListEntry^ entry = listOfDevices->GetAt(entryIndex);
00265
00266         if (entry->DeviceInformation->Id == deviceId)
00267         {
00268             listOfDevices->RemoveAt(entryIndex);
00269
00270             break;
00271         }
00272     }
00273 }
00274
00275 void DeviceConnect::ClearDeviceEntries(void)
00276 {
00277     listOfDevices->Clear();
00278 }
00279
00280 /// <summary>
00281 /// Searches through the existing list of devices for the first DeviceListEntry that has
00282 /// the specified Id.
00283 /// </summary>
00284 /// <param name="Id">Id of the device that is being searched for</param>
00285 /// <returns>DeviceListEntry that has the provided Id; else a nullptr</returns>
00286 DeviceListEntry^ DeviceConnect::FindDevice(String^ deviceId)
00287 {
00288     if (deviceId != nullptr)
00289     {
00290         for (DeviceListEntry^ entry : listOfDevices)
00291         {
00292             if (entry->DeviceInformation->Id == deviceId)
00293             {
00294                 return entry;
00295             }
00296         }
00297     }
00298
00299     return nullptr;
00300 }
00301
00302 /// <summary>
00303 /// We must stop the DeviceWatchers because device watchers will continue to raise events even if
00304 /// the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.
00305 /// </summary>
00306 /// <param name="sender"></param>
00307 /// <param name="eventArgs"></param>
00308 void DeviceConnect::OnAppSuspension(Object^ /* sender */, SuspendingEventArgs^ /* args */)
00309 {
00310     if (watchersStarted)
00311     {
00312         watchersSuspended = true;
00313         StopDeviceWatchers();
00314     }
00315     else
00316     {
00317         watchersSuspended = false;
00318     }
00319 }
00320
00321 /// <summary>
00322 /// See OnAppSuspension for why we are starting the device watchers again
00323 /// </summary>
00324 /// <param name="sender"></param>
00325 /// <param name="arg"></param>
00326 void DeviceConnect::OnAppResume(Object^ /* sender */, Object^ /* args */)
00327 {
00328     if (watchersSuspended)
00329     {
00330         watchersSuspended = false;
00331         StartDeviceWatchers();
00332     }
00333 }
00334
00335 /// <summary>
00336 /// We will remove the device from the UI
00337 /// </summary>
00338 /// <param name="sender"></param>
00339 /// <param name="deviceInformationUpdate"></param>
00340 void DeviceConnect::OnDeviceRemoved(DeviceWatcher^ /* sender */, DeviceInformationUpdate^ deviceInformationUpdate)
00341 {
00342     MainPage::Current->Dispatcher->RunAsync(
00343         CoreDispatcherPriority::Normal,
00344         ref new DispatchedHandler([this, deviceInformationUpdate]()
00345     {
00346         MainPage::Current->NotifyUser(deviceInformationUpdate->Id + " was removed.", NotifyType::StatusMessage);
00347
00348         RemoveDeviceFromList(deviceInformationUpdate->Id);
00349     }));
00350
00351 }
00352
00353 /// <summary>
00354 /// This function will add the device to the listOfDevices so that it shows up in the UI
00355 /// </summary>
00356 /// <param name="sender"></param>
00357 /// <param name="deviceInformation"></param>
00358 /// <param name="deviceSelector">AQS used to create the device watcher (the sender)</param>
00359 void DeviceConnect::OnDeviceAdded(DeviceWatcher^ /* sender */, DeviceInformation^ deviceInformation, String^ deviceSelector)
00360 {
00361     MainPage::Current->Dispatcher->RunAsync(
00362         CoreDispatcherPriority::Normal,
00363         ref new DispatchedHandler([this, deviceInformation, deviceSelector]()
00364     {
00365         MainPage::Current->NotifyUser(deviceInformation->Id + " was added.", NotifyType::StatusMessage);
00366
00367         AddDeviceToList(deviceInformation, deviceSelector);
00368     }));
00369 }
00370
00371 /// <summary>
00372 /// Notifies the UI that we are done enumerating devices
00373 /// </summary>
00374 /// <param name="sender"></param>
00375 /// <param name="args"></param>
00376 void DeviceConnect::OnDeviceEnumerationComplete(DeviceWatcher^ /* sender */, Object^ /* args */)
00377 {
00378     MainPage::Current->Dispatcher->RunAsync(
00379         CoreDispatcherPriority::Normal,
00380         ref new DispatchedHandler([this]()
00381     {
00382         isAllDevicesEnumerated = true;
00383
00384         // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
00385         // is responsible for selecting the device in the device list (UI); otherwise, this method does that
00386         if (EventHandlerForDevice::Current->IsDeviceConnected)
00387         {
00388             SelectDeviceInList(EventHandlerForDevice::Current->DeviceInformation->Id);
00389
00390             ButtonDisconnectFromDevice->Content = ButtonNameDisconnectFromDevice;
00391
00392             UpdateConnectDisconnectButtonsAndList(false);
00393
00394             MainPage::Current->NotifyUser("Currently connected to: " + EventHandlerForDevice::Current->DeviceInformation->Id, NotifyType::StatusMessage);
00395         }
00396         else if (EventHandlerForDevice::Current->IsEnabledAutoReconnect && EventHandlerForDevice::Current->DeviceInformation != nullptr)
00397         {
00398             // We will be reconnecting to a device
00399             ButtonDisconnectFromDevice->Content = ButtonNameDisableReconnectToDevice;
00400
00401             UpdateConnectDisconnectButtonsAndList(false);
00402
00403             MainPage::Current->NotifyUser("Waiting to reconnect to device: " + EventHandlerForDevice::Current->DeviceInformation->Id, NotifyType::StatusMessage);
00404         }
00405         else
00406         {
00407             UpdateConnectDisconnectButtonsAndList(true);
00408
00409             MainPage::Current->NotifyUser("No devices currently selected", NotifyType::StatusMessage);
00410         }
00411     }));
00412 }
00413
00414 /// <summary>
00415 /// If all the devices have been enumerated, select the device in the list we connected to. Otherwise let the EnumerationComplete event
00416 /// from the device watcher handle the device selection
00417 /// </summary>
00418 /// <param name="sender"></param>
00419 /// <param name="onDeviceConnectedEventArgs"></param>
00420 void DeviceConnect::OnDeviceConnected(EventHandlerForDevice^ /* sender */, OnDeviceConnectedEventArgs^ onDeviceConnectedEventArgs)
00421 {
00422     // Find and select our connected device
00423     if (isAllDevicesEnumerated)
00424     {
00425         ButtonDisconnectFromDevice->Content = ButtonNameDisconnectFromDevice;
00426
00427         if (onDeviceConnectedEventArgs->IsDeviceSuccessfullyConnected)
00428         {
00429             SelectDeviceInList(EventHandlerForDevice::Current->DeviceInformation->Id);
00430
00431             UpdateConnectDisconnectButtonsAndList(false);
00432
00433             MainPage::Current->NotifyUser("Currently connected to: " + EventHandlerForDevice::Current->DeviceInformation->Id, NotifyType::StatusMessage);
00434         }
00435         else
00436         {
00437             // Error occurred. EventHandlerForDevice will automatically prevent future automatic reconnections
00438
00439             UpdateConnectDisconnectButtonsAndList(true);
00440         }
00441     }
00442 }
00443
00444 /// <summary>
00445 /// The device was closed. If we will autoreconnect to the device, reflect that in the UI
00446 /// </summary>
00447 /// <param name="sender"></param>
00448 /// <param name="deviceInformation"></param>
00449 void DeviceConnect::OnDeviceClosing(EventHandlerForDevice^ /* sender */, DeviceInformation^ /* deviceInformation */)
00450 {
00451     MainPage::Current->Dispatcher->RunAsync(
00452         CoreDispatcherPriority::Normal,
00453         ref new DispatchedHandler([this]()
00454     {
00455         // We were connected to the device that was unplugged, so change the "Disconnect from device" button
00456         // to "Do not reconnect to device"
00457         if (ButtonDisconnectFromDevice->IsEnabled && EventHandlerForDevice::Current->IsEnabledAutoReconnect)
00458         {
00459             ButtonDisconnectFromDevice->Content = ButtonNameDisableReconnectToDevice;
00460
00461             UpdateConnectDisconnectButtonsAndList(false);
00462         }
00463         else
00464         {
00465             // We don't plan on automatically reconnecting to a device, so enable the connect button
00466             UpdateConnectDisconnectButtonsAndList(true);
00467         }
00468     }));
00469 }
00470
00471 /// <summary>
00472 /// Selects the item in the UI's listbox that corresponds to the provided device id. If there are no
00473 /// matches, we will deselect anything that is selected.
00474 /// </summary>
00475 /// <param name="deviceIdToSelect">The device id of the device to select on the list box</param>
00476 void DeviceConnect::SelectDeviceInList(String^ deviceIdToSelect)
00477 {
00478     // Don't select anything by default.
00479     ConnectDevices->SelectedIndex = -1;
00480
00481     for (uint32 deviceListIndex = 0; deviceListIndex < listOfDevices->Size; deviceListIndex++)
00482     {
00483         if (listOfDevices->GetAt(deviceListIndex)->DeviceInformation->Id == deviceIdToSelect)
00484         {
00485             ConnectDevices->SelectedIndex = deviceListIndex;
00486
00487             break;
00488         }
00489     }
00490 }
00491
00492
00493 /// <summary>
00494 /// When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.
00495 /// </summary>
00496 /// <param name="enableConnectButton">The state of ButtonConnectToDevice</param>
00497 void DeviceConnect::UpdateConnectDisconnectButtonsAndList(bool enableConnectButton)
00498 {
00499     ButtonConnectToDevice->IsEnabled = enableConnectButton;
00500     ButtonDisconnectFromDevice->IsEnabled = !ButtonConnectToDevice->IsEnabled;
00501
00502     ConnectDevices->IsEnabled = ButtonConnectToDevice->IsEnabled;
00503 }
00504
Generated on Fri Nov 15 2024 22:19:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/AtrParser.cs Source File

  • Nfc
  • PcscSdk

AtrParser.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Storage.Streams;
00013 using System.Runtime.InteropServices.WindowsRuntime;
00014
00015 namespace Pcsc.Common
00016 {
00017     public class AtrInfo
00018     {
00019         public const int MAXIMUM_ATR_CODES = 4;
00020         /// <summary>
00021         /// Helper class that holds information about the ICC Answer-To-Reset (ATR) information such
00022         /// as interface character and offset and length of the historical bytes. It also hold info
00023         /// about the validity of the TCK byte.
00024         /// </summary>
00025         public AtrInfo()
00026         {
00027             ProtocolInterfaceA = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
00028             ProtocolInterfaceB = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
00029             ProtocolInterfaceC = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
00030             ProtocolInterfaceD = new byte[MAXIMUM_ATR_CODES] { 0, 0, 0, 0 };
00031
00032             HistoricalBytes = null;
00033         }
00034         /// <summary>
00035         /// Protocol interface characters TAi
00036         /// </summary>
00037         public byte[] ProtocolInterfaceA { set; get; }
00038         /// <summary>
00039         /// Protocol interface characters TBi
00040         /// </summary>
00041         public byte[] ProtocolInterfaceB { set; get; }
00042         /// <summary>
00043         /// Protocol interface characters TCi
00044         /// </summary>
00045         public byte[] ProtocolInterfaceC { set; get; }
00046         /// <summary>
00047         /// Protocol interface characters TDi
00048         /// </summary>
00049         public byte[] ProtocolInterfaceD { set; get; }
00050         /// <summary>
00051         /// Historical bytes if present
00052         /// </summary>
00053         public IBuffer HistoricalBytes { set; get; }
00054         /// <summary>
00055         /// Check Byte valid
00056         /// </summary>
00057         public bool? TckValid { set; get; }
00058     }
00059     /// <summary>
00060     /// Helper class that parses the ATR and populate the AtrInfo class
00061     /// </summary>
00062     class AtrParser
00063     {
00064         enum AtrHeader : byte
00065         {
00066             InitialHeader = 0x3B,
00067         }
00068         /// <summary>
00069         /// Main parser method that extract information about the ATR byte array
00070         /// </summary>
00071         /// <returns>
00072         /// returns AtrInfo object if ATR is valid, null otherwise
00073         /// </returns>
00074         public static AtrInfo Parse(byte[] atrBytes)
00075         {
00076             AtrInfo atrInfo = new AtrInfo();
00077             byte initialChar = 0, formatByte = 0;
00078             int supportedProtocols = 0;
00079
00080             using (DataReader reader = DataReader.FromBuffer(atrBytes.AsBuffer()))
00081             {
00082                 initialChar = reader.ReadByte();
00083
00084                 if (initialChar != (byte)AtrHeader.InitialHeader)
00085                 {
00086                     return null;
00087                 }
00088
00089                 formatByte = reader.ReadByte();
00090                 var interfacePresence = (byte)(formatByte.HiNibble() << 4);
00091
00092                 for (int i = 0; i < AtrInfo.MAXIMUM_ATR_CODES; i++)
00093                 {
00094                     if ((interfacePresence & 0x10) != 0)
00095                         atrInfo.ProtocolInterfaceA[i] = reader.ReadByte();
00096
00097                     if ((interfacePresence & 0x20) != 0)
00098                         atrInfo.ProtocolInterfaceB[i] = reader.ReadByte();
00099
00100                     if ((interfacePresence & 0x40) != 0)
00101                         atrInfo.ProtocolInterfaceC[i] = reader.ReadByte();
00102
00103                     if ((interfacePresence & 0x80) != 0)
00104                         atrInfo.ProtocolInterfaceD[i] = reader.ReadByte();
00105                     else
00106                         break;
00107
00108                     interfacePresence = atrInfo.ProtocolInterfaceD[i];
00109                     supportedProtocols |= (1 << interfacePresence.LowNibble());
00110                 }
00111
00112                 atrInfo.HistoricalBytes = reader.ReadBuffer(formatByte.LowNibble());
00113
00114                 if ((supportedProtocols & ~1) != 0)
00115                 {
00116                     atrInfo.TckValid = ValidateTCK(atrBytes);
00117                 }
00118
00119                 return atrInfo;
00120             }
00121         }
00122         /// <summary>
00123         /// Compute the ATR check byte (TCK)
00124         /// </summary>
00125         /// <returns>
00126         /// return the computed TCK
00127         /// </returns>
00128         private static bool ValidateTCK(byte[] atr)
00129         {
00130             byte ctk = 0;
00131
00132             for (byte i = 1; i < atr.Length; i++)
00133             {
00134                 ctk ^= atr[i];
00135             }
00136
00137             return (ctk == 0);
00138         }
00139     }
00140     /// <summary>
00141     /// Extensions to the Byte primitive data type
00142     /// </summary>
00143     public static class ByteExtension
00144     {
00145         public const byte NIBBLE_SIZE = 4;
00146         /// <summary>
00147         /// Extracts the high nibble of a byte
00148         /// </summary>
00149         /// <returns>
00150         /// return byte represeting the high nibble of a byte
00151         /// </returns>
00152         public static byte HiNibble(this byte value)
00153         {
00154             return (byte)(value >> 4);
00155         }
00156         /// <summary>
00157         /// Extracts the low nibble of a byte
00158         /// </summary>
00159         /// <returns>
00160         /// return byte represeting the low nibble of a byte
00161         /// </returns>
00162         public static byte LowNibble(this byte value)
00163         {
00164             return (byte)(value & 0x0F);
00165         }
00166     }
00167 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_Document1 Member List

This is the complete list of members for Scenario_Document1, including all inherited members.
Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario_Document1 | [inline, private]
Scenario_Document1() | Scenario_Document1 | [inline]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/pch.h Source File

  • Nfc
  • NfcHceBackgroundTask

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015 #include <robuffer.h>
00016 #include <winsock2.h>
00017 #include <wrl.h>
00018 #include <wrl\wrappers\corewrappers.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/SampleConfiguration.cpp Source File

  • UserInfo
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "UserViewModel.h"
00016 #include "SampleConfiguration.h"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Foundation::Collections;
00021 using namespace winrt::Windows::System;
00022 using namespace winrt::SDKTemplate;
00023
00024 hstring implementation::MainPage::FEATURE_NAME()
00025 {
00026     return L"User info C++/WinRT Sample";
00027 }
00028
00029 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00030 {
00031     Scenario{ L"Find users", xaml_typename<SDKTemplate::Scenario1_FindUsers>() },
00032     Scenario{ L"Watch users", xaml_typename<SDKTemplate::Scenario2_WatchUsers>() },
00033     Scenario{ L"Check user consent group", xaml_typename<SDKTemplate::Scenario3_CheckUserConsentGroup>() },
00034 });
00035
00036 hstring winrt::to_hstring(UserType value)
00037 {
00038     switch (value)
00039     {
00040     case UserType::LocalUser: return L"LocalUser";
00041     case UserType::RemoteUser: return L"RemoteUser";
00042     case UserType::LocalGuest: return L"LocalGuest";
00043     case UserType::RemoteGuest: return L"RemoteGuest";
00044     }
00045     return to_hstring(static_cast<int32_t>(value));
00046 }
00047
00048 hstring winrt::to_hstring(UserAuthenticationStatus value)
00049 {
00050     switch (value)
00051     {
00052     case UserAuthenticationStatus::Unauthenticated: return L"Unauthenticated";
00053     case UserAuthenticationStatus::LocallyAuthenticated: return L"LocallyAuthenticated";
00054     case UserAuthenticationStatus::RemotelyAuthenticated: return L"RemotelyAuthenticated";
00055     }
00056     return to_hstring(static_cast<int32_t>(value));
00057 }
00058
00059 IAsyncOperation<IObservableVector<IInspectable>> winrt::SDKTemplate::Helpers::GetUserViewModelsAsync()
00060 {
00061     // Populate the list of users.
00062     IVectorView<User> users = co_await User::FindAllAsync();
00063     std::vector<IInspectable> usersVector;
00064     int userNumber = 1;
00065     for (auto&& user : users)
00066     {
00067         hstring displayName = unbox_value<hstring>(co_await user.GetPropertyAsync(KnownUserProperties::DisplayName()));
00068
00069         // Choose a generic name if we do not have access to the actual name.
00070         if (displayName.empty())
00071         {
00072             displayName = L"User #" + to_hstring(userNumber);
00073             userNumber++;
00074         }
00075         usersVector.emplace_back(make<implementation::UserViewModel>(user.NonRoamableId(), displayName));
00076     }
00077
00078     co_return single_threaded_observable_vector(std::move(usersVector));
00079 }
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario8.xaml.h Source File

  • SimpleInk
  • cpp

Scenario8.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario8.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario8 sealed
00024     {
00025     public:
00026         Scenario8();
00027     private:
00028
00029         void InkStackPanel_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs e);
00030         void CoreWetStrokeUpdateSource_WetStrokeStarting(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00031         void CoreWetStrokeUpdateSource_WetStrokeContinuing(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00032         void CoreWetStrokeUpdateSource_WetStrokeStopping(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00033         void CoreWetStrokeUpdateSource_WetStrokeCompleted(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00034         void CoreWetStrokeUpdateSource_WetStrokeCanceled(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ sender, Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00035         bool FollowCircleTest(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00036         void HandleFollowCircleInput(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00037         void HandleRegularInput(Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateEventArgs^ args);
00038         double DistanceFromCenter(Windows::Foundation::Point position);
00039         bool InCircleEdgeZone(double distanceFromCenter);
00040
00041         MainPage^ rootPage = MainPage::Current;
00042
00043         static const float radius;
00044         static const float circleStrokeThickness;
00045         static const float penSize;
00046
00047         Windows::UI::Input::Inking::Core::CoreWetStrokeUpdateSource^ coreWetStrokeUpdateSource;
00048
00049         Windows::Foundation::Point circleCenter;
00050
00051         // Follow Circle is true if Ink input should be redirected to the circle edge
00052         bool followCircle = false;
00053
00054         // discontinueStroke is true is the Ink input that follows for the wet stroke is to be ignored
00055         bool discontinueStroke = false;
00056
00057         // disableFollowCircle is set to true to disable Follow Circle behavior for the current stroke
00058         bool disableFollowCircle = false;
00059     };
00060 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
BACKGROUND_ENTRY_POINT | ScenarioElement | [private, static]
BackgroundTask_Completed(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
OnResultReceived(ApplicationDataCompositeValue result) | ScenarioElement | [inline, private]
RegisterBackgroundTask() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UnregisterBackgroundTask() | ScenarioElement | [inline, private, static]
validateStep1(ApplicationDataCompositeValue result) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MFSampleGenerator Member List

This is the complete list of members for MFSampleGenerator, including all inherited members.
AddSamplesToQueue(IMFSample *MFSample) | MFSampleGenerator | [private]
ConfigureStreams() | MFSampleGenerator | [private]
CreateAudioType(IMFMediaType **MediaType) | MFSampleGenerator | [private]
dwStreamFlags | MFSampleGenerator |
dwStreamIndex | MFSampleGenerator |
FillSampleBuffer(UINT32 BytesToRead, BYTE *Data, UINT32 *cbWritten) | MFSampleGenerator |
Flush() | MFSampleGenerator |
Initialize(IRandomAccessStream^stream, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx) | MFSampleGenerator |
IsEOF() | MFSampleGenerator | [inline]
IsPreRollFilled() | MFSampleGenerator | [private]
llTimestamp | MFSampleGenerator |
m_AudioMT | MFSampleGenerator | [private]
m_BytesPerPeriod | MFSampleGenerator | [private]
m_ContentStream | MFSampleGenerator | [private]
m_IsInitialized | MFSampleGenerator | [private]
m_MFSourceReader | MFSampleGenerator | [private]
m_MixFormat | MFSampleGenerator | [private]
m_ReaderState | MFSampleGenerator | [private]
m_Ref | MFSampleGenerator | [private]
m_SampleQueue | MFSampleGenerator | [private]
m_SampleQueueTail | MFSampleGenerator | [private]
MFSampleGenerator() | MFSampleGenerator |
pSample | MFSampleGenerator |
ReaderState enum name | MFSampleGenerator |
ReaderStateEOS enum value | MFSampleGenerator |
ReaderStatePlaying enum value | MFSampleGenerator |
ReaderStatePreRoll enum value | MFSampleGenerator |
ReaderStateStopped enum value | MFSampleGenerator |
Shutdown() | MFSampleGenerator |
StartSource() | MFSampleGenerator |
STDMETHODIMP_(ULONG) AddRef() | MFSampleGenerator | [inline]
STDMETHODIMP_(ULONG) Release() | MFSampleGenerator | [inline]
STDMETHODIMP_(HRESULT) QueryInterface(const IID &riid | MFSampleGenerator |
STDMETHODIMP_(HRESULT) OnFlush(_In_ DWORD dwStreamIndex) | MFSampleGenerator |
STDMETHODIMP_(HRESULT) OnReadSample(_In_ HRESULT hrStatus | MFSampleGenerator |
StopSource() | MFSampleGenerator |
~MFSampleGenerator() | MFSampleGenerator | [private]
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousDictation.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_ContinuousDictation.g.h"
00015 #include "MainPage.xaml.h"
00016 #include <sstream>
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario_ContinuousDictation sealed
00025     {
00026     public:
00027         Scenario_ContinuousDictation();
00028
00029     protected:
00030         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00032
00033     private:
00034         static const unsigned int HResultPrivacyStatementDeclined = 0x80045509;
00035
00036         SDKTemplate::MainPage^ rootPage;
00037         Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
00038         std::wstringstream dictatedTextBuilder;
00039
00040         void ContinuousRecognize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void btnClearText_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void dictationTextBox_TextChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::TextChangedEventArgs^ e);
00043
00044         void InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage);
00045         void PopulateLanguageDropdown();
00046
00047         Windows::Foundation::EventRegistrationToken stateChangedToken;
00048         Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken;
00049         Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken;
00050         Windows::Foundation::EventRegistrationToken hypothesisGeneratedToken;
00051
00052         void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
00053         void ContinuousRecognitionSession_Completed(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs ^args);
00054         void ContinuousRecognitionSession_ResultGenerated(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs ^args);
00055         void SpeechRecognizer_HypothesisGenerated(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognitionHypothesisGeneratedEventArgs ^args);
00056         void cbLanguageSelection_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00057         void openPrivacySettings_Click(Windows::UI::Xaml::Documents::Hyperlink^ sender, Windows::UI::Xaml::Documents::HyperlinkClickEventArgs^ args);
00058     };
00059 }
Generated on Fri Nov 15 2024 22:21:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Read Member List

This is the complete list of members for Read, including all inherited members.
Address | ReadBinary |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
Read(ushort address) | Read | [inline]
ReadBinary(ushort address, byte?expectedReturnBytes) | ReadBinary | [inline]
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.h Source File

  • BarcodeScanner
  • cppwinrt

Scenario1_BasicFunctionality.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_BasicFunctionality.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_BasicFunctionality : Scenario1_BasicFunctionalityT<Scenario1_BasicFunctionality>
00019     {
00020         Scenario1_BasicFunctionality();
00021
00022         fire_and_forget ScenarioStartScanButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023         void ScenarioEndScanButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         fire_and_forget ScenarioStartTriggerButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         fire_and_forget ScenarioStopTriggerButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026
00027         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00028         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00029         void claimedScanner_ReleaseDeviceRequested(Windows::Foundation::IInspectable const&, Windows::Devices::PointOfService::ClaimedBarcodeScanner const& e);
00030         fire_and_forget claimedScanner_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const& sender, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args);
00031
00032     private:
00033
00034         void ResetTheScenarioState();
00035
00036         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00037         Windows::Devices::PointOfService::BarcodeScanner m_scanner{ nullptr };
00038         Windows::Devices::PointOfService::ClaimedBarcodeScanner m_claimedScanner{ nullptr };
00039         event_token m_claimedScannerDataReceivedToken;
00040         event_token m_claimedScannerReleaseDeviceRequestedToken;
00041     };
00042 }
00043
00044 namespace winrt::SDKTemplate::factory_implementation
00045 {
00046     struct Scenario1_BasicFunctionality : Scenario1_BasicFunctionalityT<Scenario1_BasicFunctionality, implementation::Scenario1_BasicFunctionality>
00047     {
00048     };
00049 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/Scenario3_Legacy.xaml.cs Source File

  • XamlGamepadNavigation
  • cs

Scenario3_Legacy.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Input;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario3_Legacy : Page
00020     {
00021         public Scenario3_Legacy()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         // This method demonstrates how an app can programmatically remove focus engagement.
00027         private void LegacyControl_KeyUp(object sender, KeyRoutedEventArgs e)
00028         {
00029             // If the user presses and releases the "B" button when focus is on the legacy
00030             // control, then remove focus engagement.
00031             if (e.OriginalKey == Windows.System.VirtualKey.GamepadB)
00032             {
00033                 e.Handled = true;
00034                 ((Control)sender).RemoveFocusEngagement();
00035             }
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Util/Utils.cs Source File

  • LiveDash
  • cs
  • LiveDash
  • Util

Utils.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Threading.Tasks;
00003 using Windows.Storage;
00004 using Windows.Storage.Streams;
00005 using Windows.Web.Http;
00006
00007 namespace LiveDash.Util
00008 {
00009
00010     public class Downloader
00011     {
00012         private const int fileNotFound404Hresult = -2145844844;
00013         public static int RETRIES = 3;
00014         public async static System.Threading.Tasks.Task<IBuffer> DownloadBufferAsync(Uri url)
00015         {
00016             //Turn off cache for live playback
00017             var filter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
00018             filter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
00019             using (var httpClient = new HttpClient(filter))
00020             {
00021                 HttpGetBufferResult result = await httpClient.TryGetBufferAsync(url);
00022                 if (result.Succeeded)
00023                 {
00024 #if DEBUG
00025                     Logger.Log("GetBufferAsync suceeded for url: " + url);
00026 #endif
00027                     return result.Value;
00028                 }
00029                 else
00030                 {
00031 #if DEBUG
00032                     Logger.Log("GetBufferAsync exception for url: " + url + " HRESULT 0x" + result.ExtendedError.HResult.ToString("x"));
00033 #endif
00034                     return null;
00035                 }
00036             }
00037         }
00038
00039         public async static Task<HttpResponseMessage> SendHeadRequestAsync(Uri url)
00040         {
00041             var filter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
00042             filter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
00043             using (var httpClient = new HttpClient(filter))
00044             {
00045                 HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Head, url);
00046
00047                 HttpRequestResult result = await httpClient.TrySendRequestAsync(request);
00048                 if (result.Succeeded)
00049                 {
00050 #if DEBUG
00051                     Logger.Log("Sending head request with: " + url);
00052 #endif
00053                     return result.ResponseMessage;
00054                 }
00055                 else
00056                 {
00057 #if DEBUG
00058                     Logger.Log("SendHeadRequestAsync exception for url: " + url + " HRESULT 0x" + result.ExtendedError.HResult.ToString("x"));
00059 #endif
00060                     return null;
00061                 }
00062             }
00063         }
00064
00065
00066     }
00067 #if DEBUG
00068     public class Log
00069     {
00070         string CurrentLog = "";
00071         public StorageFile sampleFile;
00072
00073         public Log()
00074         {
00075             CreateFile();
00076         }
00077
00078         private async void CreateFile()
00079         {
00080             StorageFolder folder = ApplicationData.Current.LocalFolder;
00081             sampleFile = await folder.CreateFileAsync("LiveDashLog.txt", CreationCollisionOption.ReplaceExisting);
00082         }
00083
00084
00085         public async void WriteToFile(string s)
00086         {
00087             try
00088             {
00089                 await FileIO.AppendTextAsync(sampleFile, s);
00090             }
00091             catch (Exception)
00092             {
00093
00094             }
00095         }
00096
00097         public string GetLog()
00098         {
00099             lock (this)
00100             {
00101                 return CurrentLog;
00102             }
00103
00104         }
00105
00106         public void Append(string s)
00107         {
00108             CurrentLog += s;
00109             if (CurrentLog.Length > 10000)
00110             {
00111                 CurrentLog = CurrentLog.Substring(CurrentLog.Length - 10000);
00112             }
00113         }
00114
00115         public void Clear()
00116         {
00117             lock (this)
00118             {
00119                 CurrentLog = "";
00120             }
00121         }
00122
00123     }
00124
00125
00126     public class Logger
00127     {
00128         public static Log logger = new Log();
00129
00130         public static void Log(string s)
00131         {
00132             logger.Append(s + "\r\n");
00133             logger.WriteToFile(s + "\r\n");
00134         }
00135
00136         public static StorageFile GetFileLog()
00137         {
00138             return logger.sampleFile;
00139         }
00140
00141         public static string GetLog()
00142         {
00143             return logger.GetLog();
00144         }
00145
00146         public static string Display(Exception e)
00147         {
00148             return "HRESULT: " + e.HResult.ToString("X8");
00149         }
00150     }
00151 #endif
00152 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/Controls.h Source File

  • 360VideoPlayback
  • cpp
  • Common

Controls.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "BaseElement.h"
00003
00004 namespace DX
00005 {
00006     enum class ButtonShape
00007     {
00008         Rectangle,
00009         Circle,
00010     };
00011
00012     enum class ButtonState
00013     {
00014         None,
00015         Pressing,
00016         Pressed
00017     };
00018
00019     class Button : public FocusableElement
00020     {
00021     public:
00022         Button(
00023             UINT initialSize = BUTTON_SIZE,
00024             ButtonShape shape = ButtonShape::Rectangle);
00025
00026         virtual void ArrangeElements() override;
00027         virtual void Initialize() override;
00028         virtual void Update(const DX::StepTimer& timer, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose) override;
00029         virtual void PerformAction() override;
00030         virtual void FocusUpdate() override;
00031     protected:
00032         bool m_forceIconCentered;
00033         Windows::Foundation::Numerics::float4x4 m_parentControlTransform;
00034         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_brush;
00035         ButtonState m_buttonState = ButtonState::None;
00036         float m_pressingTimeOut;
00037         const ButtonShape m_shape = ButtonShape::Rectangle;
00038         const float m_maxSecondsInPressingState = 0.25f;
00039     private:
00040         std::shared_ptr<DX::Rectangle> m_RectFocusOutline;
00041         std::shared_ptr<DX::FilledRectangle> m_RectPressedBackgroundFill;
00042         std::shared_ptr<DX::Ellipse> m_ElliFocusOutline;
00043         std::shared_ptr<DX::FilledEllipse> m_ElliPressedBackgroundFill;
00044     };
00045
00046     class PlayPauseButton : public Button
00047     {
00048     public:
00049         PlayPauseButton(UINT buttonSize, UINT iconSize);
00050         virtual void Initialize() override;
00051         virtual void Update(const DX::StepTimer& timer, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose) override;
00052         virtual void PerformAction() override;
00053
00054     private:
00055         std::shared_ptr<Text> m_playText;
00056         std::shared_ptr<Text> m_pauseText;
00057     };
00058
00059     class ExitButton : public Button
00060     {
00061     public:
00062         ExitButton();
00063         virtual void Initialize() override;
00064         virtual void PerformAction() override;
00065
00066     private:
00067         std::shared_ptr<Text> m_exitText;
00068     };
00069 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Stroke::Square Member List

This is the complete list of members for Stroke::Square, including all inherited members.
BottomLeft | Stroke::Square
BottomRight | Stroke::Square
TopLeft | Stroke::Square
TopRight | Stroke::Square
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/SampleConfiguration.cs Source File

  • AppWindow
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "AppWindow C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Create and show secondary window", ClassType=typeof(Scenario1_SecondaryWindow)},
00025             new Scenario() { Title="Show window on another display", ClassType=typeof(Scenario2_DisplayRegion)},
00026             new Scenario() { Title="Specific size for secondary window", ClassType=typeof(Scenario3_Size)},
00027             new Scenario() { Title="CompactOverlay secondary window", ClassType=typeof(Scenario4_CompactOverlay)},
00028             new Scenario() { Title="Position secondary window", ClassType=typeof(Scenario5_RelativePositioning)},
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/SampleConfiguration.cs Source File

  • Compass
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Compass";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Data Events", ClassType = typeof(Scenario1_DataEvents) },
00025             new Scenario() { Title = "Polling", ClassType = typeof(Scenario2_Polling) },
00026             new Scenario() { Title = "Calibration", ClassType = typeof(Scenario3_Calibration) }
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/Project.idl Source File

  • BasicFaceTracking
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_TrackInWebcam : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_TrackInWebcam();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario6.xaml.cs Source File

  • MapControl
  • cs

Scenario6.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.System;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario6 : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario6()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         private async void pfnLink_Click(object sender, RoutedEventArgs e)
00029         {
00030             Uri uri = new Uri("bingmaps:?rtp=adr.Mountain%20View,%20CA~adr.San%20Francisco,%20CA&amp;mode=d&amp;trfc=1");
00031             var launcherOptions = new LauncherOptions();
00032             launcherOptions.TargetApplicationPackageFamilyName = "Microsoft.WindowsMaps_8wekyb3d8bbwe";
00033             await Launcher.LaunchUriAsync(uri, launcherOptions);
00034         }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/MainPage_CachedFile.xaml.cs Source File

  • FilePickerContracts
  • cs

MainPage_CachedFile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Text;
00016 using Windows.Storage;
00017 using Windows.Storage.Pickers;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace FilePickerContracts
00023 {
00024     public sealed partial class MainPage_CachedFile : Page
00025     {
00026         public MainPage_CachedFile()
00027         {
00028             this.InitializeComponent();
00029         }
00030     }
00031 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario13.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario13.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario13.xaml.cpp
00013 // Implementation of the Scenario13 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario13.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Platform;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace Windows::ApplicationModel::Resources::Core;
00032 using namespace concurrency;
00033 using namespace Windows::Storage;
00034
00035
00036 Scenario13::Scenario13()
00037 {
00038     InitializeComponent();
00039     DXFLOptionCombo->SelectedIndex = 0;
00040 }
00041
00042 /// <summary>
00043 /// Invoked when this page is about to be displayed in a Frame.
00044 /// </summary>
00045 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00046 /// property is typically used to configure the page.</param>
00047 void Scenario13::OnNavigatedTo(NavigationEventArgs^ e)
00048 {
00049     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00050     // as NotifyUser()
00051     rootPage = MainPage::Current;
00052 }
00053
00054
00055 void Scenario13::DXFLOptionCombo_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00056 {
00057     ComboBox^ combo = safe_cast<ComboBox^>(sender);
00058
00059     // Setting the DXFeatureLevel qualifier value on all default contexts. This is needed
00060     // since the async operation to retrive appdata.dat as a StorageFile object will happen
00061     // on a background thread. This is the only way to set the qualifier on a default context
00062     // used in a background thread.
00063
00064     // In a different scenario, rather than obtaining a StorageFile object, another approach
00065     // that could be used would be to use the ResourceMap.GetValue method to get the resolved
00066     // resource candidate, and from that get the absolute file path. In that approach, the
00067     // GetValue method takes a ResourceContext parameter, and so it would be possible to set
00068     // the DXFeatureLevel qualifier value on a specific context rather than setting it in all
00069     // contexts within the app.
00070
00071     ResourceContext::SetGlobalQualifierValue("dxfeaturelevel", combo->SelectedValue->ToString());
00072
00073
00074     // setting up the resource URI -- an ms-appx URI will be used to access the resource using
00075     // a StorageFile method
00076
00077     // In a different scenario, rather than obtaining a StorageFile object, the
00078     // ResourceMap.GetValue method could be used to get the resolved candidate, from which an
00079     // absolute file path could be obtained. However, resource references used by the APIs in
00080     // Windows.ApplicationModel.Resources and Windows.ApplicationModel.Resources.Core use
00081     // ms-resource URIs, not ms-appx URIs. Within a resource map, files are always organized
00082     // under a "Files" top-level subtree. The ms-resource URI string for the file being accessed
00083     // here would be "ms-resource:///Files/appdata/appdata.dat".
00084
00085     // The URI string "ms-appx:///..." is rooted at the app package root.
00086     Uri^ uri = ref new Uri("ms-appx:///appdata/appdata.dat");
00087
00088     // need a variable to capture in the lambda for the async continuation
00089     TextBlock^ resultTextControl = this->ResultText;
00090
00091     // The resource candidate will be resolved during the call to GetFileFromApplicationUriAsync
00092     // using the default context from a background thread.
00093
00094     // File IO uses asynchronous techniques. For more info, see
00095     // http://msdn.microsoft.com/en-us/library/windows/apps/hh464924.aspx
00096
00097     auto getFileTask = create_task(StorageFile::GetFileFromApplicationUriAsync(uri));
00098     getFileTask.then([resultTextControl](StorageFile^ file) {
00099         return FileIO::ReadTextAsync(file);
00100     }).then([resultTextControl](Platform::String^ content) {
00101         resultTextControl->Text = content;
00102     });
00103
00104 }
00105
00106
Generated on Fri Nov 15 2024 22:17:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario2.cpp Source File

  • FileAccess
  • cppwinrt

Scenario2.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.h"
00014 #include "Scenario2.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario2::Scenario2()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario2::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         SampleState::ValidateFile();
00033     }
00034
00035     fire_and_forget Scenario2::GetParent_Click(IInspectable const&, RoutedEventArgs const&)
00036     {
00037         auto lifetime = get_strong();
00038
00039         StorageFile file = SampleState::SampleFile();
00040         if (file != nullptr)
00041         {
00042             try
00043             {
00044                 StorageFolder parentFolder = await file.GetParentAsync();
00045                 if (parentFolder != nullptr)
00046                 {
00047                     hstring message = L"Item: " + file.Name() + L" (" + file.Path() + L")\n"
00048                         + L"Parent: " + parentFolder.Name() + L" (" + parentFolder.Path() + L")";
00049                     rootPage.NotifyUser(message, NotifyType::StatusMessage);
00050                 }
00051             }
00052             catch (const hresult_error& ex)
00053             {
00054                 if (ex.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00055                 {
00056                     SampleState::NotifyUserFileNotExist();
00057                 }
00058                 else
00059                 {
00060                     throw;
00061                 }
00062             }
00063         }
00064         else
00065         {
00066             SampleState::NotifyUserFileNotExist();
00067         }
00068
00069     }
00070 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario7_ListAllCards.cpp Source File

  • SmartCard
  • cppwinrt

Scenario7_ListAllCards.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_ListAllCards.h"
00014 #include "Scenario7_ListAllCards.g.cpp"
00015 #include "SmartCardListItem.g.cpp"
00016
00017 namespace winrt
00018 {
00019     using namespace Windows::Foundation;
00020     using namespace Windows::Devices::SmartCards;
00021     using namespace Windows::Devices::Enumeration;
00022     using namespace Windows::UI::Xaml;
00023     using namespace Windows::UI::Xaml::Controls;
00024 }
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario7_ListAllCards::Scenario7_ListAllCards()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     /// <summary>
00034     /// Click handler for the 'ListSmartCard' button.
00035     /// </summary>
00036     /// <param name="sender"></param>
00037     /// <param name="e"></param>
00038
00039     fire_and_forget Scenario7_ListAllCards::ListSmartCard_Click(IInspectable const& sender, RoutedEventArgs const&)
00040     {
00041         auto lifetime = get_strong();
00042         auto b = sender.as<Button>();
00043         b.IsEnabled(false);
00044         try
00045         {
00046             m_rootPage.NotifyUser(L"Enumerating smart cards...", NotifyType::StatusMessage);
00047
00048             // This list will be bound to our ItemListView once it has been
00049             // filled with SmartCardListItems.  The SmartCardListItem class
00050             // is defined in our Project.idl, and describes a reader/card pair with a
00051             // reader name and a card name.
00052             auto cardItems = winrt::single_threaded_observable_vector<SDKTemplate::SmartCardListItem>();
00053
00054             // First we get the device selector for smart card readers using
00055             // the static GetDeviceSelector method of the SmartCardReader
00056             // class.  The selector is a string which describes a class of
00057             // devices to query for, and is used as the argument to
00058             // DeviceInformation.FindAllAsync.  GetDeviceSelector is
00059             // overloaded so that you can provide a SmartCardReaderKind
00060             // to specify if you are only interested in a particular type
00061             // of card/reader (e.g. TPM virtual smart card.)  In this case
00062             // we will list all cards and readers.
00063             hstring selector = SmartCardReader::GetDeviceSelector();
00064             DeviceInformationCollection devices = co_await DeviceInformation::FindAllAsync(selector);
00065
00066             // DeviceInformation.FindAllAsync gives us a
00067             // DeviceInformationCollection, which is essentially a list
00068             // of DeviceInformation objects.  We must iterate through that
00069             // list and instantiate SmartCardReader objects from the
00070             // DeviceInformation objects.
00071             for (DeviceInformation const& device : devices)
00072             {
00073                 SmartCardReader reader = co_await SmartCardReader::FromIdAsync(device.Id());
00074
00075                 // For each reader, we want to find all the cards associated
00076                 // with it.  Then we will create a SmartCardListItem for
00077                 // each (reader, card) pair.
00078                 auto cards = co_await reader.FindAllCardsAsync();
00079
00080                 for (SmartCard const& card : cards)
00081                 {
00082                     SmartCardProvisioning provisioning = co_await SmartCardProvisioning::FromSmartCardAsync(card);
00083
00084                     auto provisionedName = co_await provisioning.GetNameAsync();
00085                     auto item = SDKTemplate::SmartCardListItem{ card.Reader().Name(), provisionedName };
00086                     cardItems.Append(item);
00087                 }
00088             }
00089
00090             // Bind the source of ItemListView to our SmartCardListItem list.
00091             ItemListView().ItemsSource(cardItems);
00092
00093             m_rootPage.NotifyUser(L"Enumerating smart cards completed.", NotifyType::StatusMessage);
00094         }
00095         catch (hresult_error const& ex)
00096         {
00097             m_rootPage.NotifyUser(L"Enumerating smart cards failed with exception: " + ex.message(), NotifyType::ErrorMessage);
00098         }
00099
00100         b.IsEnabled(true);
00101     }
00102 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Porting Member List

This is the complete list of members for Scenario3_Porting, including all inherited members.
GetGyrometerSample(object sender, RoutedEventArgs e) | Scenario3_Porting | [inline, private]
gyrometerWindows | Scenario3_Porting | [private]
gyrometerWP | Scenario3_Porting | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_Porting | [inline, protected]
rootPage | Scenario3_Porting | [private]
Scenario3_Porting() | Scenario3_Porting | [inline]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/App.xaml.cpp Source File

  • 360VideoPlayback
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // App.xaml.cpp
00003 // Implementation of the App class.
00004 //
00005
00006 #include "pch.h"
00007 #include "MainPage.xaml.h"
00008
00009 using namespace _360VideoPlayback;
00010
00011 using namespace Platform;
00012 using namespace Windows::ApplicationModel;
00013 using namespace Windows::ApplicationModel::Activation;
00014 using namespace Windows::Foundation;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Interop;
00018 using namespace Windows::UI::Xaml::Navigation;
00019
00020 /// <summary>
00021 /// Initializes the singleton application object.  This is the first line of authored code
00022 /// executed, and as such is the logical equivalent of main() or WinMain().
00023 /// </summary>
00024 App::App()
00025 {
00026     InitializeComponent();
00027     Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
00028 }
00029
00030 /// <summary>
00031 /// Invoked when the application is launched normally by the end user.  Other entry points
00032 /// will be used such as when the application is launched to open a specific file.
00033 /// </summary>
00034 /// <param name="e">Details about the launch request and process.</param>
00035 void App::OnLaunched(LaunchActivatedEventArgs^ e)
00036 {
00037     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00038
00039     // Do not repeat app initialization when the Window already has content,
00040     // just ensure that the window is active
00041     if (rootFrame == nullptr)
00042     {
00043         // Create a Frame to act as the navigation context and associate it with
00044         // a SuspensionManager key
00045         rootFrame = ref new Frame();
00046
00047         rootFrame->NavigationFailed += ref new NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00048
00049         if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00050         {
00051             // TODO: Restore the saved session state only when appropriate, scheduling the
00052             // final launch steps after the restore is complete
00053
00054         }
00055
00056         if (e->PrelaunchActivated == false)
00057         {
00058             if (rootFrame->Content == nullptr)
00059             {
00060                 // When the navigation stack isn't restored navigate to the first page,
00061                 // configuring the new page by passing required information as a navigation
00062                 // parameter
00063                 rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00064             }
00065             // Place the frame in the current Window
00066             Window::Current->Content = rootFrame;
00067             // Ensure the current window is active
00068             Window::Current->Activate();
00069         }
00070     }
00071     else
00072     {
00073         if (e->PrelaunchActivated == false)
00074         {
00075             if (rootFrame->Content == nullptr)
00076             {
00077                 // When the navigation stack isn't restored navigate to the first page,
00078                 // configuring the new page by passing required information as a navigation
00079                 // parameter
00080                 rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00081             }
00082             // Ensure the current window is active
00083             Window::Current->Activate();
00084         }
00085     }
00086 }
00087
00088 /// <summary>
00089 /// Invoked when application execution is being suspended.  Application state is saved
00090 /// without knowing whether the application will be terminated or resumed with the contents
00091 /// of memory still intact.
00092 /// </summary>
00093 /// <param name="sender">The source of the suspend request.</param>
00094 /// <param name="e">Details about the suspend request.</param>
00095 void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
00096 {
00097     (void) sender;  // Unused parameter
00098     (void) e;   // Unused parameter
00099
00100     //TODO: Save application state and stop any background activity
00101 }
00102
00103 /// <summary>
00104 /// Invoked when Navigation to a certain page fails
00105 /// </summary>
00106 /// <param name="sender">The Frame which failed navigation</param>
00107 /// <param name="e">Details about the navigation failure</param>
00108 void App::OnNavigationFailed(Object^ sender, NavigationFailedEventArgs^ e)
00109 {
00110     throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
00111 }
Generated on Fri Nov 15 2024 22:16:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.cpp Source File

  • LineDisplay
  • cpp

Scenario7_ScrollingContentUsingMarquee.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_ScrollingContentUsingMarquee.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Devices::PointOfService;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 Scenario7_ScrollingContentUsingMarquee::Scenario7_ScrollingContentUsingMarquee()
00028 {
00029     InitializeComponent();
00030     DataContext = this;
00031 }
00032
00033 void Scenario7_ScrollingContentUsingMarquee::OnNavigatedTo(NavigationEventArgs^ e)
00034 {
00035     InitializeAsync();
00036 }
00037
00038 void Scenario7_ScrollingContentUsingMarquee::OnNavigatedFrom(NavigationEventArgs^ e)
00039 {
00040     delete horizontalScrollableWindow;
00041     horizontalScrollableWindow = nullptr;
00042     delete verticalScrollableWindow;
00043     verticalScrollableWindow = nullptr;
00044     delete lineDisplay;
00045     lineDisplay = nullptr;
00046 }
00047
00048 Concurrency::task<void> Scenario7_ScrollingContentUsingMarquee::InitializeAsync()
00049 {
00050     lineDisplay = co_await rootPage->ClaimScenarioLineDisplayAsync();
00051
00052     if (lineDisplay != nullptr)
00053     {
00054         Size screenSize = lineDisplay->GetAttributes()->ScreenSizeInCharacters;
00055         unsigned int windowCount = 1;
00056
00057         if (lineDisplay->Capabilities->IsHorizontalMarqueeSupported && (windowCount < lineDisplay->Capabilities->SupportedWindows))
00058         {
00059             // Create a horizontal scrollable window by creating a window
00060             // whose width is wider than the viewport.
00061             horizontalScrollableWindow = co_await lineDisplay->TryCreateWindowAsync(
00062                 Rect
00063                 {
00064                     0,
00065                     0,
00066                     screenSize.Width,
00067                     screenSize.Height
00068                 },
00069                 Size
00070                 {
00071                     screenSize.Width * 2,
00072                     screenSize.Height
00073                 });
00074             if (horizontalScrollableWindow != nullptr)
00075             {
00076                 windowCount++;
00077                 Helpers::AddItem(ScrollDirectionComboBox, LineDisplayScrollDirection::Left);
00078                 Helpers::AddItem(ScrollDirectionComboBox, LineDisplayScrollDirection::Right);
00079             }
00080         }
00081
00082         if (lineDisplay->Capabilities->IsVerticalMarqueeSupported && (windowCount < lineDisplay->Capabilities->SupportedWindows))
00083         {
00084             // Create a vertical scrollable window by creating a window
00085             // whose height is taller than the viewport.
00086             verticalScrollableWindow = co_await lineDisplay->TryCreateWindowAsync(
00087                 Rect
00088                 {
00089                     screenSize.Width,
00090                     screenSize.Height,
00091                     0,
00092                     0
00093                 },
00094                 Size
00095                 {
00096                     screenSize.Width,
00097                     screenSize.Height * 2
00098                 });
00099             if (verticalScrollableWindow != nullptr)
00100             {
00101                 windowCount++;
00102                 Helpers::AddItem(ScrollDirectionComboBox, LineDisplayScrollDirection::Up);
00103                 Helpers::AddItem(ScrollDirectionComboBox, LineDisplayScrollDirection::Down);
00104             }
00105         }
00106     }
00107
00108     if (ScrollDirectionComboBox->Items->Size > 0)
00109     {
00110         ScrollDirectionComboBox->SelectedIndex = 0;
00111         StartScrollingButton->IsEnabled = true;
00112         StopScrollingButton->IsEnabled = true;
00113     }
00114 }
00115
00116 void Scenario7_ScrollingContentUsingMarquee::StartScrollingButton_Click(Object^ sender, RoutedEventArgs^ e)
00117 {
00118     invoke_async_lambda([=]() -> task<void>
00119     {
00120         LineDisplayScrollDirection scrollDirection = Helpers::GetSelectedItemTag<LineDisplayScrollDirection>(ScrollDirectionComboBox);
00121         LineDisplayWindow^ selectedWindow = nullptr;
00122
00123         if (scrollDirection == LineDisplayScrollDirection::Left || scrollDirection == LineDisplayScrollDirection::Right)
00124         {
00125             selectedWindow = horizontalScrollableWindow;
00126         }
00127         else
00128         {
00129             selectedWindow = verticalScrollableWindow;
00130         }
00131
00132         // Cannot make changes while scrolling is active.
00133         co_await StopAllScrollingAsync();
00134
00135         // Bring the window to the front, clear its old contents,
00136         // and display some text that will require scrolling.
00137         co_await selectedWindow->TryRefreshAsync();
00138         co_await selectedWindow->TryClearTextAsync();
00139         co_await selectedWindow->TryDisplayTextAsync(
00140             "An incredibly lengthy string of arbitrary text that cannot be displayed on most line displays " +
00141             "without being scrolled into view. It will need to be scrolled into view left, right, up or down.");
00142
00143         // Configure the scrolling behavior and start scrolling.
00144         selectedWindow->Marquee->Format = Helpers::GetSelectedItemTag<LineDisplayMarqueeFormat>(MarqueeFormatComboBox);
00145         selectedWindow->Marquee->RepeatWaitInterval = Helpers::TimeSpanFromMilliseconds(RepeatWaitIntervalSlider->Value);
00146         selectedWindow->Marquee->ScrollWaitInterval = Helpers::TimeSpanFromMilliseconds(ScrollWaitIntervalSlider->Value);
00147         co_await selectedWindow->Marquee->TryStartScrollingAsync(scrollDirection);
00148     });
00149 }
00150
00151 task<void> Scenario7_ScrollingContentUsingMarquee::StopAllScrollingAsync()
00152 {
00153     if (horizontalScrollableWindow != nullptr)
00154     {
00155         co_await horizontalScrollableWindow->Marquee->TryStopScrollingAsync();
00156     }
00157
00158     if (verticalScrollableWindow != nullptr)
00159     {
00160         co_await verticalScrollableWindow->Marquee->TryStopScrollingAsync();
00161     }
00162 }
00163
00164 void Scenario7_ScrollingContentUsingMarquee::StopScrollingButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00165 {
00166     StopAllScrollingAsync();
00167 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_FixAccount Member List

This is the complete list of members for Scenario3_FixAccount, including all inherited members.
Fix_Click(object sender, RoutedEventArgs e) | Scenario3_FixAccount | [inline, private]
IsFixNeededAsync(UserDataAccount selectedAccount) | Scenario3_FixAccount | [inline, private]
isLaunched | Scenario3_FixAccount | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_FixAccount | [inline, protected]
rootPage | Scenario3_FixAccount | [private]
Scenario3_FixAccount() | Scenario3_FixAccount | [inline]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Contact Member List

This is the complete list of members for Contact, including all inherited members.
biography | Contact | [private]
Biography() | Contact | [inline]
FirstName() | Contact | [inline]
firstName | Contact | [private]
GenerateBiography() | Contact | [private, static]
GenerateFirstName() | Contact | [private, static]
GenerateLastName() | Contact | [private, static]
GeneratePhoneNumber() | Contact | [private, static]
GeneratePosition() | Contact | [private, static]
GetContacts(int count) | Contact | [static]
GetContactsGrouped(int count) | Contact | [static]
GetNewContact() | Contact | [inline, static]
id | Contact | [private]
Id() | Contact | [inline]
InitialOf(hstring const &word) | Contact | [inline, private, static]
Initials() | Contact | [inline]
lastName | Contact | [private]
LastName() | Contact | [inline]
Name() | Contact | [inline]
phoneNumber | Contact | [private]
PhoneNumber() | Contact | [inline]
Position() | Contact | [inline]
position | Contact | [private]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cs/Scenario2_ToggleMobileHotspot.xaml.cs Source File

  • MobileHotspot
  • cs

Scenario2_ToggleMobileHotspot.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Networking.NetworkOperators;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario2_ToggleMobileHotspot : Page
00021     {
00022         NetworkOperatorTetheringManager m_tetheringManager = null;
00023         bool m_toggling = false;
00024
00025         public Scenario2_ToggleMobileHotspot()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             MainPage.Current.NotifyUser("", NotifyType.StatusMessage);
00033
00034             m_tetheringManager = Helpers.TryGetCurrentNetworkOperatorTetheringManager();
00035
00036             if (m_tetheringManager != null)
00037             {
00038                 NetworkOperatorTetheringAccessPointConfiguration configuration = m_tetheringManager.GetCurrentAccessPointConfiguration();
00039                 SsidRun.Text = configuration.Ssid;
00040                 PasswordRun.Text = configuration.Passphrase;
00041                 BandRun.Text = Helpers.GetFriendlyName(configuration.Band);
00042
00043                 m_toggling = true;
00044                 bool isTethered = m_tetheringManager.TetheringOperationalState == TetheringOperationalState.On;
00045                 MobileHotspotToggle.IsOn = isTethered;
00046                 m_toggling = false;
00047
00048                 HotspotPanel.Visibility = Visibility.Visible;
00049             }
00050         }
00051
00052         private async void MobileHotspotToggle_Toggled(object sender, RoutedEventArgs e)
00053         {
00054             if (m_toggling)
00055             {
00056                 return;
00057             }
00058             MainPage.Current.NotifyUser("", NotifyType.StatusMessage);
00059
00060             bool isTethered = m_tetheringManager.TetheringOperationalState == TetheringOperationalState.On;
00061             if (MobileHotspotToggle.IsOn == isTethered)
00062             {
00063                 // Already in desired state.
00064                 return;
00065             }
00066
00067             // Switch to opposite state.
00068             m_toggling = true;
00069
00070             NetworkOperatorTetheringOperationResult result;
00071             if (isTethered)
00072             {
00073                 result = await m_tetheringManager.StopTetheringAsync();
00074             }
00075             else
00076             {
00077                 result = await m_tetheringManager.StartTetheringAsync();
00078             }
00079
00080             if (result.Status == TetheringOperationStatus.Success)
00081             {
00082                 // Change to new state.
00083                 MobileHotspotToggle.IsOn = !isTethered;
00084             }
00085             else
00086             {
00087                 // Return to old state.
00088                 MobileHotspotToggle.IsOn = isTethered;
00089
00090                 switch (result.Status)
00091                 {
00092                     case TetheringOperationStatus.WiFiDeviceOff:
00093                         MainPage.Current.NotifyUser(
00094                             "Wi-Fi adapter is either turned off or missing.",
00095                             NotifyType.ErrorMessage);
00096                         break;
00097
00098                     default:
00099                         MainPage.Current.NotifyUser(
00100                             $"Unhandled result while toggling Mobile Hotspot: {result.Status}",
00101                             NotifyType.ErrorMessage);
00102                         break;
00103                 }
00104             }
00105             m_toggling = false;
00106         }
00107     }
00108 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareWebLink.xaml.h Source File

  • ShareSource
  • cpp

ShareWebLink.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareWebLink.xaml.h
00014 // Declaration of the ShareWebLink class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "SharePage.h"
00021 #include "ShareWebLink.g.h"
00022 #include "MainPage.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     public ref class ShareWebLink sealed
00027     {
00028     public:
00029         ShareWebLink();
00030
00031     protected:
00032         virtual bool GetShareContent(Windows::ApplicationModel::DataTransfer::DataRequest^ request) override;
00033
00034     private:
00035         Windows::Foundation::Uri^ ValidateAndGetUri(Platform::String^ uriString);
00036     };
00037 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario11.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario11.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario11.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Input::Inking;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024
00025 Scenario11::Scenario11()
00026 {
00027     InitializeComponent();
00028
00029     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00030     inkCanvas->InkPresenter->HighContrastAdjustment = InkHighContrastAdjustment::UseOriginalColors;
00031     ContrastingColorButton->IsChecked = true;
00032
00033     accessibility = ref new AccessibilitySettings();
00034     ContrastingColorButton->Visibility =
00035         accessibility->HighContrast ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00036     accessibility->HighContrastChanged +=
00037         ref new TypedEventHandler<AccessibilitySettings^, Object^>(this, &Scenario11::Accessibility_HighContrastChanged);
00038 }
00039
00040 void Scenario11::Accessibility_HighContrastChanged(AccessibilitySettings^ sender, Object^ args)
00041 {
00042     ContrastingColorButton->Visibility =
00043         accessibility->HighContrast ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00044 }
00045
00046 void Scenario11::ContrastingColorButtonCheckedChanged(Object^ sender, RoutedEventArgs^ e)
00047 {
00048     if (ContrastingColorButton->IsChecked->Value)
00049     {
00050         inkCanvas->InkPresenter->HighContrastAdjustment = InkHighContrastAdjustment::UseSystemColorsWhenNecessary;
00051     }
00052     else
00053     {
00054         inkCanvas->InkPresenter->HighContrastAdjustment = InkHighContrastAdjustment::UseOriginalColors;
00055     }
00056 }
00057
00058
00059 void Scenario11::OnSizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00060 {
00061     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00062 }
00063
Generated on Fri Nov 15 2024 22:17:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/OtherBindings.xaml.cs Source File

  • XamlBind
  • cs

OtherBindings.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005 using Windows.UI.Xaml.Media;
00006 using xBindSampleModel;
00007
00008 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00009
00010 namespace xBindSampleCS
00011 {
00012     public sealed partial class OtherBindings : Page
00013     {
00014         public int MyInt { get; set; }
00015         public DataModel Model { get; set; }
00016         public CSharpModel CSharpModel { get; set; }
00017
00018         public String DPOnPage
00019         {
00020             get { return (String)GetValue(DPOnPageProperty); }
00021             set { SetValue(DPOnPageProperty, value); }
00022         }
00023         public static DependencyProperty DPOnPageProperty { get { return _DPOnPage; } }
00024         private const string DPOnPageName = "DPOnPage";
00025         private static readonly DependencyProperty _DPOnPage =
00026         DependencyProperty.Register(DPOnPageName, typeof(int), typeof(DataModel), new PropertyMetadata(0));
00027
00028         public xBindSampleModel.IEmployee NullEmployee;
00029         public String NullStringProperty;
00030
00031         public OtherBindings()
00032         {
00033             this.InitializeComponent();
00034             this.CSharpModel = new CSharpModel();
00035             this.Model = new DataModel();
00036             InitializeValues();
00037         }
00038
00039         void InitializeValues()
00040         {
00041             this.DPOnPage = "DP on page";
00042             this.Background = new SolidColorBrush(Colors.Red);
00043         }
00044
00045         private void UpdateValuesClick(object sender, RoutedEventArgs e)
00046         {
00047             this.Model.UpdateValues();
00048             this.CSharpModel.UpdateValues();
00049             this.DPOnPage += "-";
00050             this.Background = null;
00051         }
00052
00053         private void ResetValuesClick(object sender, RoutedEventArgs e)
00054         {
00055             this.Model.InitializeValues();
00056             this.CSharpModel.InitializeValues();
00057             this.InitializeValues();
00058         }
00059
00060         private void UndeferElementClick(object sender, RoutedEventArgs e)
00061         {
00062             this.FindName("deferedTextBlock");
00063         }
00064     }
00065 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/SpatialInputHandler.h Source File

  • HolographicTagAlong
  • cpp
  • Content

SpatialInputHandler.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace HolographicTagAlongSample
00015 {
00016     // Sample gesture handler.
00017     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00018     class SpatialInputHandler
00019     {
00020     public:
00021         SpatialInputHandler();
00022         ~SpatialInputHandler();
00023
00024         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ CheckForInput();
00025
00026     private:
00027         // Interaction event handler.
00028         void OnSourcePressed(
00029             Windows::UI::Input::Spatial::SpatialInteractionManager^ sender,
00030             Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args);
00031
00032         // API objects used to process gesture input, and generate gesture events.
00033         Windows::UI::Input::Spatial::SpatialInteractionManager^     m_interactionManager;
00034
00035         // Event registration token.
00036         Windows::Foundation::EventRegistrationToken                 m_sourcePressedEventToken;
00037
00038         // Used to indicate that a Pressed input event was received this frame.
00039         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ m_sourceState = nullptr;
00040     };
00041 }
Generated on Fri Nov 15 2024 22:16:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/SampleConfiguration.cpp Source File

  • OCR
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"OCR C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"OCR image file", xaml_typename<SDKTemplate::OcrFileImage>() },
00029     Scenario{ L"OCR captured image", xaml_typename<SDKTemplate::OcrCapturedImage>() }
00030 });
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario8.xaml.cs Source File

  • MapControl
  • cs

Scenario8.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation.Metadata;
00014 using Windows.Services.Maps.OfflineMaps;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario8 : Page
00022     {
00023         public Scenario8()
00024         {
00025             InitializeComponent();
00026         }
00027
00028         private void myMap_Loaded(object sender, RoutedEventArgs e)
00029         {
00030             myMap.Center = MainPage.SeattleGeopoint;
00031             myMap.ZoomLevel = 12;
00032         }
00033
00034         /// <summary>
00035         /// This method finds all available Offline Map packages at the map center geopoint
00036         /// </summary>
00037         private async void findAtCenterButton_Click(object sender, RoutedEventArgs e)
00038         {
00039             resultsGrid.Children.Clear();
00040             resultsGrid.RowDefinitions.Clear();
00041             resultStatusTextBlock.Text = "";
00042
00043             OfflineMapPackageQueryResult result = await OfflineMapPackage.FindPackagesAsync(myMap.Center);
00044
00045             if (result.Status != OfflineMapPackageQueryStatus.Success)
00046             {
00047                 resultStatusTextBlock.Text = "Error: " + result.Status;
00048             }
00049             else if (result.Packages.Count == 0)
00050             {
00051                 resultStatusTextBlock.Text = "No maps found";
00052             }
00053             else
00054             {
00055                 foreach (OfflineMapPackage package in result.Packages)
00056                 {
00057                     addToResultGrid(package);
00058                 }
00059             }
00060         }
00061
00062         private void addToResultGrid(OfflineMapPackage package)
00063         {
00064             // a descriptive name for the package
00065             // ex: "Washington, USA (160 MB)"
00066             string descriptiveName = package.DisplayName + ", " + package.EnclosingRegionName + " (" + nearestMegabyte(package.EstimatedSizeInBytes) + " MB)";
00067
00068             // current download status (Downloaded, NotDownloaded, Downloading, etc)
00069             string downloadStatus = package.Status.ToString();
00070
00071             TextBlock packageNameTextBlock = new TextBlock()
00072             {
00073                 Text = descriptiveName,
00074                 Margin = new Thickness(5),
00075                 VerticalAlignment = VerticalAlignment.Center,
00076             };
00077
00078             TextBlock packageStatusTextBlock = new TextBlock()
00079             {
00080                 Text = downloadStatus,
00081                 Margin = new Thickness(5),
00082                 VerticalAlignment = VerticalAlignment.Center,
00083             };
00084
00085             Button packageDownloadButton = new Button()
00086             {
00087                 Content = "Download",
00088                 IsEnabled = canDownload(package),
00089             };
00090
00091             // event handler for Download button
00092             packageDownloadButton.Click += async (sender, e) =>
00093             {
00094                 // queue up the package for download
00095                 // requires offlineMapsManagement capability (see Package.appxmanifest)
00096                 OfflineMapPackageStartDownloadResult result = await package.RequestStartDownloadAsync();
00097
00098                 // show any error
00099                 if (result.Status != OfflineMapPackageStartDownloadStatus.Success)
00100                 {
00101                     packageStatusTextBlock.Text = result.Status.ToString();
00102                 }
00103             };
00104
00105             // listen for package status changes and update the UI (download status, download button enable/disable)
00106             package.StatusChanged += async (sender, args) =>
00107             {
00108                 // event might not be on the UI thread, so marshal if we need to update UI
00109                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00110                 {
00111                     packageStatusTextBlock.Text = package.Status.ToString();
00112                     packageDownloadButton.IsEnabled = canDownload(package);
00113                 });
00114             };
00115
00116             Grid.SetRow(packageNameTextBlock, resultsGrid.RowDefinitions.Count);
00117             Grid.SetColumn(packageNameTextBlock, 0);
00118
00119             Grid.SetRow(packageStatusTextBlock, resultsGrid.RowDefinitions.Count);
00120             Grid.SetColumn(packageStatusTextBlock, 1);
00121
00122             Grid.SetRow(packageDownloadButton, resultsGrid.RowDefinitions.Count);
00123             Grid.SetColumn(packageDownloadButton, 2);
00124
00125             resultsGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
00126
00127             resultsGrid.Children.Add(packageNameTextBlock);
00128             resultsGrid.Children.Add(packageStatusTextBlock);
00129             resultsGrid.Children.Add(packageDownloadButton);
00130         }
00131
00132         private static long nearestMegabyte(ulong bytes)
00133         {
00134             return (long)Math.Round(bytes / (1024.0 * 1024.0));
00135         }
00136
00137         private static bool canDownload(OfflineMapPackage package)
00138         {
00139             // we can start a download if the package isn't downloaded or it's currently being deleted
00140             return package.Status == OfflineMapPackageStatus.NotDownloaded || package.Status == OfflineMapPackageStatus.Deleting;
00141         }
00142     }
00143 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/Scenario1_TrackInWebcam.cpp Source File

  • BasicFaceTracking
  • cppwinrt

Scenario1_TrackInWebcam.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_TrackInWebcam.h"
00014 #include "Scenario1_TrackInWebcam.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace std::literals::chrono_literals;
00018 using namespace winrt;
00019 using namespace Windows::ApplicationModel;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Graphics::Imaging;
00023 using namespace Windows::Media;
00024 using namespace Windows::Media::Capture;
00025 using namespace Windows::Media::FaceAnalysis;
00026 using namespace Windows::Media::MediaProperties;
00027 using namespace Windows::System::Threading;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Navigation;
00032 using namespace Windows::UI::Xaml::Shapes;
00033
00034 namespace winrt::SDKTemplate::implementation
00035 {
00036     Scenario1_TrackInWebcam::Scenario1_TrackInWebcam()
00037     {
00038         InitializeComponent();
00039     }
00040
00041     void Scenario1_TrackInWebcam::OnNavigatedTo(NavigationEventArgs const&)
00042     {
00043         suspendingEventToken = Application::Current().Suspending({ get_weak(), &Scenario1_TrackInWebcam::OnSuspending });
00044     }
00045
00046     void Scenario1_TrackInWebcam::OnNavigatedFrom(NavigationEventArgs const&)
00047     {
00048         Application::Current().Suspending(suspendingEventToken);
00049     }
00050
00051     // Responds to App Suspend event to stop/release MediaCapture object if it's running and return to Idle state.
00052     fire_and_forget Scenario1_TrackInWebcam::OnSuspending(IInspectable const&, SuspendingEventArgs const& e)
00053     {
00054         auto lifetime = get_strong();
00055
00056         if (currentState == ScenarioState::Streaming)
00057         {
00058             auto deferral = e.SuspendingOperation().GetDeferral();
00059             co_await ChangeScenarioStateAsync(ScenarioState::Idle);
00060             deferral.Complete();
00061         }
00062     }
00063
00064     // Creates the FaceTracker object which we will use for face detection and tracking.
00065     // Initializes a new MediaCapture instance and starts the Preview streaming to the CamPreview UI element.
00066     // Completes with true if initialization and streaming were successful and false if an exception occurred.
00067     IAsyncOperation<bool> Scenario1_TrackInWebcam::StartWebcamStreamingAsync()
00068     {
00069         auto lifetime = get_strong();
00070
00071         bool successful;
00072
00073         faceTracker = co_await FaceTracker::CreateAsync();
00074         try
00075         {
00076             MediaCapture mediaCapture;
00077             agileMediaCapture = mediaCapture;
00078             MediaCaptureInitializationSettings settings;
00079
00080             // For this scenario, we only need Video (not microphone) so specify this in the initializer.
00081             // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
00082             // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
00083             settings.StreamingCaptureMode(StreamingCaptureMode::Video);
00084
00085             co_await mediaCapture.InitializeAsync(settings);
00086             mediaCapture.Failed({ get_weak(), &Scenario1_TrackInWebcam::MediaCapture_CameraStreamFailed });
00087
00088             // Cache the media properties as we'll need them later.
00089             auto deviceController = mediaCapture.VideoDeviceController();
00090             videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType::VideoPreview).as<VideoEncodingProperties>();
00091
00092             // Immediately start streaming to our CaptureElement UI.
00093             // NOTE: CaptureElement's Source must be set before streaming is started.
00094             CamPreview().Source(mediaCapture);
00095             co_await mediaCapture.StartPreviewAsync();
00096
00097             // Run the timer at 15 frames per second.
00098             TimeSpan timerInterval = TimeSpan{ 1s } / 15;
00099             frameProcessingTimer = ThreadPoolTimer::CreatePeriodicTimer({ get_weak(), &Scenario1_TrackInWebcam::ProcessCurrentVideoFrame }, timerInterval);
00100
00101             successful = true;
00102         }
00103         catch (hresult_access_denied const&)
00104         {
00105             // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
00106             rootPage.NotifyUser(L"Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType::ErrorMessage);
00107             successful = false;
00108         }
00109         catch (hresult_error const& ex)
00110         {
00111             rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
00112             successful = false;
00113         }
00114
00115         co_return successful;
00116     }
00117
00118     // Safely stops webcam streaming (if running) and releases MediaCapture object.
00119     IAsyncAction Scenario1_TrackInWebcam::ShutdownWebcamAsync()
00120     {
00121         auto lifetime = get_strong();
00122
00123         if (frameProcessingTimer != nullptr)
00124         {
00125             frameProcessingTimer.Cancel();
00126         }
00127
00128         if (agileMediaCapture)
00129         {
00130             auto mediaCapture = agileMediaCapture.get();
00131             if (mediaCapture.CameraStreamState() == Windows::Media::Devices::CameraStreamState::Streaming)
00132             {
00133                 try
00134                 {
00135                     co_await mediaCapture.StopPreviewAsync();
00136                 }
00137                 catch (hresult_error const&)
00138                 {
00139                     // Since we're going to destroy the MediaCapture object there's nothing to do here
00140                 }
00141             }
00142             mediaCapture.Close();
00143         }
00144
00145         frameProcessingTimer = nullptr;
00146         CamPreview().Source(nullptr);
00147         agileMediaCapture = nullptr;
00148         CameraStreamingButton().IsEnabled(true);
00149     }
00150
00151     // This method is invoked by a ThreadPoolTimer to execute the FaceTracker and Visualization logic at approximately 15 frames per second.
00152     // Keep in mind this method is called from a Timer and not synchronized with the camera stream. Also, the processing time of FaceTracker
00153     // will vary depending on the size of each frame and the number of faces being tracked. That is, a large image with several tracked faces may
00154     // take longer to process.
00155     fire_and_forget Scenario1_TrackInWebcam::ProcessCurrentVideoFrame(ThreadPoolTimer const&)
00156     {
00157         auto lifetime = get_strong();
00158
00159         if (currentState != ScenarioState::Streaming)
00160         {
00161             return;
00162         }
00163
00164         // If already busy, it means we're still waiting for processing work on the previous frame to complete.
00165         // In this situation, exit immediately.
00166         bool expected = false;
00167         if (!busy.compare_exchange_strong(expected, true))
00168         {
00169             return;
00170         }
00171
00172         co_await ProcessCurrentVideoFrameAsync();
00173         busy.store(false);
00174     }
00175
00176     IAsyncAction Scenario1_TrackInWebcam::ProcessCurrentVideoFrameAsync()
00177     {
00178         auto lifetime = get_strong();
00179
00180         // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
00181         // GetPreviewFrame will convert the native webcam frame into this format.
00182         static constexpr BitmapPixelFormat InputPixelFormat = BitmapPixelFormat::Nv12;
00183         VideoFrame previewFrame(InputPixelFormat, (int)videoProperties.Width(), (int)videoProperties.Height());
00184
00185         try
00186         {
00187             co_await agileMediaCapture.get().GetPreviewFrameAsync(previewFrame);
00188         }
00189         catch (hresult_access_denied const&)
00190         {
00191             // Lost access to the camera.
00192             AbandonStreaming();
00193             co_return;
00194         }
00195         catch (hresult_error const&)
00196         {
00197             rootPage.NotifyUser(L"PreviewFrame with format '" + to_hstring(InputPixelFormat) + L"' is not supported by your Webcam", NotifyType::ErrorMessage);
00198             co_return;
00199         }
00200
00201         // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
00202         if (!FaceDetector::IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap().BitmapPixelFormat()))
00203         {
00204             rootPage.NotifyUser(L"PixelFormat '" + to_hstring(previewFrame.SoftwareBitmap().BitmapPixelFormat()) + L"' is not supported by FaceDetector", NotifyType::ErrorMessage);
00205         }
00206
00207         IVector<DetectedFace> faces;
00208         try
00209         {
00210             faces = co_await faceTracker.ProcessNextFrameAsync(previewFrame);
00211         }
00212         catch (hresult_error const& e)
00213         {
00214             rootPage.NotifyUser(e.message(), NotifyType::ErrorMessage);
00215             co_return;
00216         }
00217
00218         // Create our visualization using the frame dimensions and face results but run it on the UI thread.
00219         Size previewFrameSize(
00220             static_cast<float>(previewFrame.SoftwareBitmap().PixelWidth()),
00221             static_cast<float>(previewFrame.SoftwareBitmap().PixelHeight()));
00222         co_await resume_foreground(Dispatcher());
00223         SetupVisualization(previewFrameSize, faces);
00224     }
00225
00226     // Takes the webcam image and FaceTracker results and assembles the visualization onto the Canvas.
00227     void Scenario1_TrackInWebcam::SetupVisualization(Size framePixelSize, IVector<DetectedFace> const& foundFaces)
00228     {
00229         VisualizationCanvas().Children().Clear();
00230
00231         if (currentState == ScenarioState::Streaming &&
00232             framePixelSize.Width != 0.0 && framePixelSize.Height != 0.0)
00233         {
00234             double widthScale = VisualizationCanvas().ActualWidth() / framePixelSize.Width;
00235             double heightScale = VisualizationCanvas().ActualHeight() / framePixelSize.Height;
00236
00237             for (DetectedFace face : foundFaces)
00238             {
00239                 // Create a rectangle element for displaying the face box but since we're using a Canvas
00240                 // we must scale the rectangles according to the frames's actual size.
00241                 BitmapBounds faceBox = face.FaceBox();
00242                 Rectangle box;
00243                 box.Width(faceBox.Width * widthScale);
00244                 box.Height(faceBox.Height * heightScale);
00245                 box.Margin({ faceBox.X * widthScale, faceBox.Y * heightScale, 0, 0 });
00246                 box.Style(HighlightedFaceBoxStyle());
00247                 VisualizationCanvas().Children().Append(box);
00248             }
00249         }
00250     }
00251
00252     IAsyncAction Scenario1_TrackInWebcam::ChangeScenarioStateAsync(ScenarioState newState)
00253     {
00254         auto lifetime = get_strong();
00255
00256         // Disable UI while state change is in progress
00257         CameraStreamingButton().IsEnabled(false);
00258
00259         switch (newState)
00260         {
00261         case ScenarioState::Idle:
00262
00263             currentState = newState;
00264             co_await ShutdownWebcamAsync();
00265
00266             VisualizationCanvas().Children().Clear();
00267             CameraStreamingButton().Content(box_value(L"Start Streaming"));
00268             break;
00269
00270         case ScenarioState::Streaming:
00271
00272             if (!co_await StartWebcamStreamingAsync())
00273             {
00274                 co_await ChangeScenarioStateAsync(ScenarioState::Idle);
00275                 break;
00276             }
00277
00278             VisualizationCanvas().Children().Clear();
00279             CameraStreamingButton().Content(box_value(L"Stop Streaming"));
00280             currentState = newState;
00281             CameraStreamingButton().IsEnabled(true);
00282             break;
00283         }
00284     }
00285
00286     fire_and_forget Scenario1_TrackInWebcam::AbandonStreaming()
00287     {
00288         auto lifetime = get_strong();
00289
00290         // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
00291         // and instead need to schedule the state change on the UI thread.
00292         co_await resume_foreground(Dispatcher());
00293         co_await ChangeScenarioStateAsync(ScenarioState::Idle);
00294     }
00295
00296     void Scenario1_TrackInWebcam::MediaCapture_CameraStreamFailed(MediaCapture const&, IInspectable const&)
00297     {
00298         AbandonStreaming();
00299     }
00300
00301     // Handles "streaming" button clicks to start/stop webcam streaming.
00302     fire_and_forget Scenario1_TrackInWebcam::CameraStreamingButton_Click(IInspectable const&, RoutedEventArgs const&)
00303     {
00304         auto lifetime = get_strong();
00305
00306         rootPage.NotifyUser({}, NotifyType::StatusMessage);
00307         if (currentState == ScenarioState::Streaming)
00308         {
00309             co_await ChangeScenarioStateAsync(ScenarioState::Idle);
00310         }
00311         else
00312         {
00313             co_await ChangeScenarioStateAsync(ScenarioState::Streaming);
00314         }
00315     }
00316 }
Generated on Fri Nov 15 2024 22:18:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.h Source File

  • DateTimeFormatting
  • cpp

Scenario1_LongAndShortFormats.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario1_LongAndShortFormats.g.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_LongAndShortFormats sealed
00021     {
00022     public:
00023         Scenario1_LongAndShortFormats();
00024         void Display();
00025     };
00026 }
Generated on Fri Nov 15 2024 22:19:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6 Member List

This is the complete list of members for Scenario6, including all inherited members.
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario6
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario6
Scenario6() | Scenario6
Scenario6() | Scenario6
SelectImageButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario6
ShowPropertiesButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario6
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario05_PostStream.xaml.cs Source File

  • HttpClient
  • cs

Scenario05_PostStream.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Threading;
00015 using System.Threading.Tasks;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019 using Windows.Web.Http;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario05_PostStream : Page
00024     {
00025         MainPage rootPage = MainPage.Current;
00026
00027         private HttpClient httpClient;
00028         private CancellationTokenSource cts;
00029
00030         public Scenario05_PostStream()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         protected override void OnNavigatedTo(NavigationEventArgs e)
00036         {
00037             httpClient = Helpers.CreateHttpClientWithPlugIn();
00038             cts = new CancellationTokenSource();
00039         }
00040
00041         protected override void OnNavigatedFrom(NavigationEventArgs e)
00042         {
00043             cts.Cancel();
00044             cts.Dispose();
00045             httpClient.Dispose();
00046         }
00047
00048         private async void Start_Click(object sender, RoutedEventArgs e)
00049         {
00050             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00051             // valid, absolute URI, we'll notify the user about the incorrect input.
00052             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00053             if (resourceUri == null)
00054             {
00055                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00056                 return;
00057             }
00058
00059             Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
00060             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00061
00062             const int contentLength = 1000;
00063             Stream stream = GenerateSampleStream(contentLength);
00064             HttpStreamContent streamContent = new HttpStreamContent(stream.AsInputStream());
00065
00066             HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, resourceUri);
00067             request.Content = streamContent;
00068
00069             // This sample uses a "try" in order to support TaskCanceledException.
00070             // If you don't need to support cancellation, then the "try" is not needed.
00071             try
00072             {
00073                 // Do an asynchronous POST.
00074                 HttpRequestResult result = await httpClient.TrySendRequestAsync(request).AsTask(cts.Token);
00075
00076                 if (result.Succeeded)
00077                 {
00078                     await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
00079
00080                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00081                 }
00082                 else
00083                 {
00084                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00085                 }
00086             }
00087             catch (TaskCanceledException)
00088             {
00089                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00090             }
00091
00092             Helpers.ScenarioCompleted(StartButton, CancelButton);
00093         }
00094
00095         private void Cancel_Click(object sender, RoutedEventArgs e)
00096         {
00097             cts.Cancel();
00098             cts.Dispose();
00099
00100             // Re-create the CancellationTokenSource.
00101             cts = new CancellationTokenSource();
00102         }
00103
00104         private static MemoryStream GenerateSampleStream(int size)
00105         {
00106             // Generate sample data.
00107             byte[] subData = new byte[size];
00108             for (int i = 0; i < subData.Length; i++)
00109             {
00110                 subData[i] = 64; // '@'
00111             }
00112
00113             return new MemoryStream(subData);
00114         }
00115     }
00116 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Tasks/pch.cpp Source File

  • ActivitySensor
  • cpp
  • Tasks

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Project.idl Source File

  • UserCertificateStore
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_MoveCertificate : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_MoveCertificate();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario3_CustomDecay.xaml.h Source File

  • SpatialSound
  • cpp

Scenario3_CustomDecay.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #pragma once
00014
00015 #include "Scenario3_CustomDecay.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario3_CustomDecay sealed
00025     {
00026     public:
00027         Scenario3_CustomDecay();
00028         virtual ~Scenario3_CustomDecay();
00029     private:
00030         void SourcePositionX_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00031         void SourcePositionY_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00032         void SourcePositionZ_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00033         void EnvironmentComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00034         void OnTimerTick(Object^ sender, Object^ e);
00035         void PlayButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void StopButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037
00038     private:
00039         MainPage^                   _rootPage;
00040         bool                        _initialized = false;
00041         CustomDecaySound            _customDecaySound;
00042         DispatcherTimer^            _timer;
00043         EventRegistrationToken      _timerEventToken;
00044         float                       _x = 0;            // Source is centered
00045         float                       _y = 0;            // Source is at eye level with the listener
00046         float                       _z = -2;           // Source is 2 meters in front of the listener
00047     };
00048 }
Generated on Fri Nov 15 2024 22:21:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/pch.cpp Source File

  • Nfc
  • NfcHceBackgroundTask

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Clearing/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Clearing

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Notifications;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00006
00007 namespace Notifications.ScenarioPages.LiveTiles.Notifications.PrimaryTile.Clearing
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class ScenarioElement : UserControl
00013     {
00014         public ScenarioElement()
00015         {
00016             this.InitializeComponent();
00017         }
00018
00019         private void ButtonClearNotifications_Click(object sender, RoutedEventArgs e)
00020         {
00021             TileUpdateManager.CreateTileUpdaterForApplication().Clear();
00022         }
00023     }
00024 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario Member List

This is the complete list of members for Scenario, including all inherited members.
ClassType | Scenario
Title | Scenario
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ListView Member List

This is the complete list of members for Scenario1_ListView, including all inherited members.
_deletedItem | Scenario1_ListView | [private]
_reference | Scenario1_ListView | [private]
_selection | Scenario1_ListView | [private]
GetSampleData() | Scenario1_ListView | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_ListView | [inline, protected]
rootPage | Scenario1_ListView | [private]
Scenario1_ListView() | Scenario1_ListView | [inline]
SourceListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) | Scenario1_ListView | [inline, private]
TargetListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args) | Scenario1_ListView | [inline, private]
TargetListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) | Scenario1_ListView | [inline, private]
TargetListView_DragOver(object sender, DragEventArgs e) | Scenario1_ListView | [inline, private]
TargetListView_Drop(object sender, DragEventArgs e) | Scenario1_ListView | [inline, private]
TargetTextBlock_DragEnter(object sender, DragEventArgs e) | Scenario1_ListView | [inline, private]
TargetTextBlock_Drop(object sender, DragEventArgs e) | Scenario1_ListView | [inline, private]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FaceTrackerProcessor Member List

This is the complete list of members for FaceTrackerProcessor, including all inherited members.
CreateAsync(std::shared_ptr< VideoFrameProcessor > processor) | FaceTrackerProcessor | [static]
FaceTrackerProcessor(Windows::Media::FaceAnalysis::FaceTracker^tracker, std::shared_ptr< VideoFrameProcessor > processor) | FaceTrackerProcessor |
GetLatestFaces(void) const | FaceTrackerProcessor |
IsTrackingFaces(void) const | FaceTrackerProcessor |
m_faceTracker | FaceTrackerProcessor | [protected]
m_isRunning | FaceTrackerProcessor | [protected]
m_latestFaces | FaceTrackerProcessor | [protected]
m_numFramesWithoutFaces | FaceTrackerProcessor | [protected]
m_propertiesLock | FaceTrackerProcessor | [mutable, protected]
m_videoProcessor | FaceTrackerProcessor | [protected]
m_workerThread | FaceTrackerProcessor | [protected]
ProcessFrame(void) | FaceTrackerProcessor | [protected]
~FaceTrackerProcessor(void) | FaceTrackerProcessor |
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/SampleConfiguration.h Source File

  • DisplayOrientation
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TouchpadDPadHelper Member List

This is the complete list of members for TouchpadDPadHelper, including all inherited members.
m_threshold | TouchpadDPadHelper | [private]
SourcePressed(Windows::UI::Input::Spatial::SpatialInteractionPressKind pressKind, Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) override | TouchpadDPadHelper | [virtual]
TouchpadDPadHelper(double threshold=.3) | TouchpadDPadHelper |
Update(Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) | IDPadHelper | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • Barometer
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Sensors;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents() : rootPage(MainPage::Current), desiredReportIntervalMs(0)
00031 {
00032     InitializeComponent();
00033
00034     sensor = Barometer::GetDefault();
00035     if (nullptr != sensor)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportIntervalMs = sensor->MinimumReportInterval;
00040         desiredReportIntervalMs = minReportIntervalMs > 1000 ? minReportIntervalMs : 1000;
00041     }
00042     else
00043     {
00044         rootPage->NotifyUser("No barometer found", NotifyType::ErrorMessage);
00045     }
00046 }
00047
00048 /// <summary>
00049 /// Invoked when this page is about to be displayed in a Frame.
00050 /// </summary>
00051 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00052 /// property is typically used to configure the page.</param>
00053 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00054 {
00055     ScenarioEnableButton->IsEnabled = true;
00056     ScenarioDisableButton->IsEnabled = false;
00057 }
00058
00059 /// <summary>
00060 /// Invoked when this page is no longer displayed.
00061 /// </summary>
00062 /// <param name="e"></param>
00063 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00064 {
00065     // If the navigation is external to the app do not clean up.
00066     // This can occur on Phone when suspending the app.
00067     if (NavigationMode::Forward == e->NavigationMode && nullptr == e->Uri)
00068     {
00069         return;
00070     }
00071
00072     if (ScenarioDisableButton->IsEnabled)
00073     {
00074         Window::Current->VisibilityChanged::remove(visibilityToken);
00075         sensor->ReadingChanged::remove(readingToken);
00076
00077         // Restore the default report interval to release resources while the sensor is not in use
00078         sensor->ReportInterval = 0;
00079     }
00080 }
00081
00082 /// <summary>
00083 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00084 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00085 /// </summary>
00086 /// <param name="sender"></param>
00087 /// <param name="e">
00088 /// Event data that can be examined for the current visibility state.
00089 /// </param>
00090 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00091 {
00092     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00093     if (ScenarioDisableButton->IsEnabled)
00094     {
00095         if (e->Visible)
00096         {
00097             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00098             readingToken = sensor->ReadingChanged::add(ref new TypedEventHandler<Barometer^, BarometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00099         }
00100         else
00101         {
00102             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00103             sensor->ReadingChanged::remove(readingToken);
00104         }
00105     }
00106 }
00107
00108 void Scenario1_DataEvents::ReadingChanged(Barometer^ sender, BarometerReadingChangedEventArgs^ e)
00109 {
00110     // We need to dispatch to the UI thread to display the output
00111     Dispatcher->RunAsync(
00112         CoreDispatcherPriority::Normal,
00113         ref new DispatchedHandler(
00114             [this, e]()
00115             {
00116                 BarometerReading^ reading = e->Reading;
00117
00118                 ScenarioOutput_hPa->Text = reading->StationPressureInHectopascals.ToString();
00119             },
00120             CallbackContext::Any
00121             )
00122         );
00123 }
00124
00125 void Scenario1_DataEvents::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00126 {
00127     if (nullptr != sensor)
00128     {
00129         // Establish the report interval
00130         sensor->ReportInterval = desiredReportIntervalMs;
00131
00132         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged));
00133         readingToken = sensor->ReadingChanged::add(ref new TypedEventHandler<Barometer^, BarometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00134
00135         ScenarioEnableButton->IsEnabled = false;
00136         ScenarioDisableButton->IsEnabled = true;
00137     }
00138     else
00139     {
00140         rootPage->NotifyUser("No barometer found", NotifyType::ErrorMessage);
00141     }
00142 }
00143
00144 void Scenario1_DataEvents::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00145 {
00146     Window::Current->VisibilityChanged::remove(visibilityToken);
00147     sensor->ReadingChanged::remove(readingToken);
00148
00149     // Restore the default report interval to release resources while the sensor is not in use
00150     sensor->ReportInterval = 0;
00151
00152     ScenarioEnableButton->IsEnabled = true;
00153     ScenarioDisableButton->IsEnabled = false;
00154 }
Generated on Fri Nov 15 2024 22:17:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario2_Polling.xaml.cpp Source File

  • Compass
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     compass = Compass::GetDefault();
00035     if (compass != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = compass->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041
00042         // Set up a DispatchTimer
00043         TimeSpan span;
00044         span.Duration = static_cast<int32>(desiredReportInterval) * 10000;   // convert to 100ns ticks
00045         dispatcherTimer = ref new DispatcherTimer();
00046         dispatcherTimer->Interval = span;
00047         dispatcherTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2_Polling::DisplayCurrentReading);
00048     }
00049     else
00050     {
00051         rootPage->NotifyUser("No compass found", NotifyType::ErrorMessage);
00052     }
00053 }
00054
00055 /// <summary>
00056 /// Invoked when this page is about to be displayed in a Frame.
00057 /// </summary>
00058 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00059 /// property is typically used to configure the page.</param>
00060 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00061 {
00062     ScenarioEnableButton->IsEnabled = true;
00063     ScenarioDisableButton->IsEnabled = false;
00064 }
00065
00066 /// <summary>
00067 /// Invoked when this page is no longer displayed.
00068 /// </summary>
00069 /// <param name="e"></param>
00070 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00071 {
00072     // If the navigation is external to the app do not clean up.
00073     // This can occur on Phone when suspending the app.
00074     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00075     {
00076         return;
00077     }
00078
00079     if (ScenarioDisableButton->IsEnabled)
00080     {
00081         Window::Current->VisibilityChanged::remove(visibilityToken);
00082         dispatcherTimer->Stop();
00083
00084         // Restore the default report interval to release resources while the sensor is not in use
00085         compass->ReportInterval = 0;
00086     }
00087 }
00088
00089 /// <summary>
00090 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00091 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00092 /// </summary>
00093 /// <param name="sender"></param>
00094 /// <param name="e">
00095 /// Event data that can be examined for the current visibility state.
00096 /// </param>
00097 void Scenario2_Polling::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00098 {
00099     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00100     if (ScenarioDisableButton->IsEnabled)
00101     {
00102         if (e->Visible)
00103         {
00104             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00105             dispatcherTimer->Start();
00106         }
00107         else
00108         {
00109             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00110             dispatcherTimer->Stop();
00111         }
00112     }
00113 }
00114
00115 void Scenario2_Polling::DisplayCurrentReading(Object^ sender, Object^ e)
00116 {
00117     CompassReading^ reading = compass->GetCurrentReading();
00118     if (reading != nullptr)
00119     {
00120         ScenarioOutput_MagneticNorth->Text = reading->HeadingMagneticNorth.ToString();
00121         if (reading->HeadingTrueNorth != nullptr)
00122         {
00123             ScenarioOutput_TrueNorth->Text = reading->HeadingTrueNorth->Value.ToString();
00124         }
00125         else
00126         {
00127             ScenarioOutput_TrueNorth->Text = "No data";
00128         }
00129         switch (reading->HeadingAccuracy)
00130         {
00131             case MagnetometerAccuracy::Unknown:
00132                 ScenarioOutput_HeadingAccuracy->Text = "Unknown";
00133                 break;
00134             case MagnetometerAccuracy::Unreliable:
00135                 ScenarioOutput_HeadingAccuracy->Text = "Unreliable";
00136                 break;
00137             case MagnetometerAccuracy::Approximate:
00138                 ScenarioOutput_HeadingAccuracy->Text = "Approximate";
00139                 break;
00140             case MagnetometerAccuracy::High:
00141                 ScenarioOutput_HeadingAccuracy->Text = "High";
00142                 break;
00143             default:
00144                 ScenarioOutput_HeadingAccuracy->Text = "No data";
00145                 break;
00146         }
00147     }
00148 }
00149
00150 void Scenario2_Polling::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00151 {
00152     if (compass != nullptr)
00153     {
00154         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario2_Polling::VisibilityChanged));
00155
00156         // Set the report interval to enable the sensor for polling
00157         compass->ReportInterval = desiredReportInterval;
00158
00159         dispatcherTimer->Start();
00160
00161         ScenarioEnableButton->IsEnabled = false;
00162         ScenarioDisableButton->IsEnabled = true;
00163     }
00164     else
00165     {
00166         rootPage->NotifyUser("No compass found", NotifyType::ErrorMessage);
00167     }
00168 }
00169
00170 void Scenario2_Polling::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00171 {
00172     Window::Current->VisibilityChanged::remove(visibilityToken);
00173
00174     dispatcherTimer->Stop();
00175
00176     // Restore the default report interval to release resources while the sensor is not in use
00177     compass->ReportInterval = 0;
00178
00179     ScenarioEnableButton->IsEnabled = true;
00180     ScenarioDisableButton->IsEnabled = false;
00181 }
Generated on Fri Nov 15 2024 22:17:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/CompletionGroupTask.cpp Source File

  • BackgroundTransfer
  • cpp
  • Tasks

CompletionGroupTask.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CompletionGroupTask.h"
00014
00015 using namespace Concurrency;
00016 using namespace Tasks;
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::ApplicationModel::Background;
00020 using namespace Windows::Data::Xml::Dom;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Networking::BackgroundTransfer;
00023 using namespace Windows::UI::Notifications;
00024
00025 CompletionGroupTask::CompletionGroupTask()
00026 {
00027 }
00028
00029 // Completion groups allow us to immediately take action after a set of downloads completes.
00030 // In this sample, the server intentionally replies with an error status for some of the downloads.
00031 // Based on the trigger details, we can determine which of the downloads have failed and try them again
00032 // using a new completion group.
00033 //
00034 // Apps generally do not need to implement basic retry logic themselves for normal network errors,
00035 // connectivity loss, etc. because Background Transfer does it internally.
00036 //
00037 // Typically, you would only want to retry transfers from a CompletionGroup task if your app has
00038 // gained new information about how to perform the transfer compared to the first time you started it.
00039 // For example, if the URI you were connecting to expired and you have obtained a new URI from the
00040 // server, or if you would like to try the transfer again with freshly updated credentials.
00041 void CompletionGroupTask::Run(IBackgroundTaskInstance ^ taskInstance)
00042 {
00043     // The background task carries out asynchronous work (in RetryDownloadsAsync). Take a deferral
00044     // to delay the background task from closing prematurely while the asynchronous code is still running.
00045     Platform::Agile<BackgroundTaskDeferral> deferral(taskInstance->GetDeferral());
00046
00047     BackgroundTransferCompletionGroupTriggerDetails^ details =
00048         dynamic_cast<BackgroundTransferCompletionGroupTriggerDetails^>(taskInstance->TriggerDetails);
00049
00050     if (details == nullptr)
00051     {
00052         // We should never arrive here, otherwise, it means this background task was registered
00053         // for a type of trigger different from BackgroundTransferCompletionGroupTrigger.
00054         return;
00055     }
00056
00057     Vector<DownloadOperation^>^ failedDownloads = ref new Vector<DownloadOperation^>();
00058     int succeeded = 0;
00059     int failed = 0;
00060     for (DownloadOperation^ download : details->Downloads)
00061     {
00062         if (IsFailed(download))
00063         {
00064             failedDownloads->Append(download);
00065         }
00066         else
00067         {
00068             succeeded++;
00069         }
00070     }
00071
00072     InvokeSimpleToast(succeeded, failedDownloads->Size);
00073
00074     if (failedDownloads->Size > 0)
00075     {
00076         RetryDownloadsAsync(failedDownloads).then([deferral]()
00077         {
00078             deferral->Complete();
00079         });
00080     }
00081     else
00082     {
00083         deferral->Complete();
00084     }
00085 }
00086
00087
00088 BackgroundTransferGroup^ CompletionGroupTask::CreateTransferGroup()
00089 {
00090     return BackgroundTransferGroup::CreateGroup("Scenario4");
00091 }
00092
00093 BackgroundDownloader^ CompletionGroupTask::CreateBackgroundDownloader()
00094 {
00095     BackgroundTransferCompletionGroup^ completionGroup = ref new BackgroundTransferCompletionGroup();
00096
00097     BackgroundTaskBuilder^ builder = ref new BackgroundTaskBuilder();
00098
00099     // In addition, TaskEntryPoint must be specified in the <Extensions> section of the application's manifest as
00100     // <Extension Category="windows.backgroundTasks" EntryPoint="Tasks.CompletionGroupTask">
00101     // For more information see:
00102     // https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.background.backgroundtaskbuilder.taskentrypoint.aspx
00103     builder->TaskEntryPoint = "Tasks.CompletionGroupTask";
00104
00105     builder->SetTrigger(completionGroup->Trigger);
00106
00107     // The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
00108     // You do not need to unregister it explicitly.
00109     BackgroundTaskRegistration^ taskRegistration = builder->Register();
00110
00111     BackgroundDownloader^ downloader = ref new BackgroundDownloader(completionGroup);
00112
00113     // You may (but are not required to) use transfer groups along with completion groups.
00114     downloader->TransferGroup = CreateTransferGroup();
00115
00116     return downloader;
00117 }
00118
00119
00120 bool CompletionGroupTask::IsFailed(DownloadOperation^ download)
00121 {
00122     BackgroundTransferStatus status = download->Progress.Status;
00123     if (status == BackgroundTransferStatus::Error || status == BackgroundTransferStatus::Canceled)
00124     {
00125         return true;
00126     }
00127
00128     ResponseInformation^ response = download->GetResponseInformation();
00129     if (response == nullptr || response->StatusCode != 200)
00130     {
00131         return true;
00132     }
00133
00134     return false;
00135 }
00136
00137 task<void> CompletionGroupTask::RetryDownloadsAsync(IVector<DownloadOperation^>^ downloadsToRetry)
00138 {
00139     BackgroundDownloader^ downloader = CompletionGroupTask::CreateBackgroundDownloader();
00140     std::vector<task<void>> postRenameTasks;
00141
00142     for (DownloadOperation^ downloadToRetry : downloadsToRetry)
00143     {
00144         // Retry with the same uri, but save to a different file name.
00145         std::wstring originalName(downloadToRetry->ResultFile->Name->Data());
00146         std::wstring newName = originalName.insert(originalName.find_last_of(L'.'), L"_retried");
00147
00148         auto renameTask = create_task(downloadToRetry->ResultFile->RenameAsync(
00149             ref new String(newName.c_str()),
00150             Windows::Storage::NameCollisionOption::ReplaceExisting));
00151
00152         task<void> postRenameTask = renameTask.then([downloadToRetry, downloader]()
00153         {
00154             DownloadOperation^ download = downloader->CreateDownload(downloadToRetry->RequestedUri, downloadToRetry->ResultFile);
00155
00156             // We do not wait on background transfer asynchronous tasks, since wait will only
00157             // finish after the entire transfer is complete, which may take a very long time.
00158             // The completion of these downloads will be handled by a future CompletionGroupTask instance.
00159             auto ignore = download->StartAsync();
00160         });
00161
00162         postRenameTasks.push_back(postRenameTask);
00163     }
00164
00165     return when_all(postRenameTasks.begin(), postRenameTasks.end()).then([downloader]()
00166     {
00167         downloader->CompletionGroup->Enable();
00168     });
00169 }
00170
00171 void CompletionGroupTask::InvokeSimpleToast(int succeeded, int failed)
00172 {
00173     XmlDocument^ toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText04);
00174
00175     XmlNodeList^ stringElements = toastXml->GetElementsByTagName("text");
00176     stringElements->Item(0)->AppendChild(toastXml->CreateTextNode(succeeded.ToString() + " downloads succeeded."));
00177     stringElements->Item(1)->AppendChild(toastXml->CreateTextNode(failed.ToString() + " downloads failed."));
00178
00179     ToastNotification^ toast = ref new ToastNotification(toastXml);
00180     ToastNotificationManager::CreateToastNotifier()->Show(toast);
00181 }
Generated on Fri Nov 15 2024 22:18:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SecondaryPage Member List

This is the complete list of members for SecondaryPage, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | SecondaryPage | [inline, protected]
SecondaryPage() | SecondaryPage | [inline]
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_CustomItems Member List

This is the complete list of members for Scenario3_CustomItems, including all inherited members.
AddToJumpList_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_CustomItems
DescriptionLocalizedResource_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_CustomItems
DisplayNameLocalizedResource_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_CustomItems
GroupNameLocalizedResource_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_CustomItems
Scenario3_CustomItems() | Scenario3_CustomItems
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario1_CurrentActivity.xaml.h Source File

  • ActivitySensor
  • cpp

Scenario1_CurrentActivity.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_CurrentActivity.xaml.h
00014 // Declaration of the Scenario1_CurrentActivity class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_CurrentActivity.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_CurrentActivity sealed
00030     {
00031     public:
00032         Scenario1_CurrentActivity();
00033
00034     private:
00035         SDKTemplate::MainPage^ rootPage;
00036
00037         void ScenarioGetCurrentActivity(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:17:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Controls/ContentSelector.xaml.cs Source File

  • AdaptiveStreaming
  • cs
  • Controls

ContentSelector.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Models;
00013 using SDKTemplate.Logging;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Linq;
00017 using Windows.ApplicationModel.DataTransfer;
00018 using Windows.Media.Playback;
00019 using Windows.UI.Core;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using System.Threading.Tasks;
00023 using Windows.Web.Http;
00024
00025 namespace SDKTemplate.Controls
00026 {
00027     public sealed partial class ContentSelector : UserControl
00028     {
00029         public ContentSelector()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private MediaPlayer mediaPlayer;
00035         private IEnumerable<AdaptiveContentModel> adaptiveContentModels;
00036         public AdaptiveContentModel SelectedModel;
00037         private LogView loggerControl;
00038         Func<Uri, HttpClient, Task<MediaPlaybackItem>> CreateMediaPlaybackItem;
00039         public MediaPlaybackItem MediaPlaybackItem;
00040         public HttpClient optionalHttpClient;
00041
00042         internal void Initialize(MediaPlayer mediaPlayer,
00043             IEnumerable<AdaptiveContentModel> adaptiveContentModels,
00044             HttpClient optionalHttpClient,
00045             LogView loggerControl,
00046             Func<Uri, HttpClient, Task<MediaPlaybackItem>> loadSourceFromUriAsync)
00047         {
00048             if (mediaPlayer == null)
00049                 throw new ArgumentNullException("mediaPlayer");
00050             this.mediaPlayer = mediaPlayer;
00051
00052             if (adaptiveContentModels == null)
00053                 throw new ArgumentNullException("adaptiveContentModels");
00054             this.adaptiveContentModels = adaptiveContentModels;
00055
00056             if (loggerControl == null)
00057                 throw new ArgumentNullException("loggerControl");
00058             this.loggerControl = loggerControl;
00059
00060             if (loadSourceFromUriAsync == null)
00061                 throw new ArgumentNullException("loadSourceFromUriAsync");
00062             this.CreateMediaPlaybackItem = loadSourceFromUriAsync;
00063
00064             this.optionalHttpClient = optionalHttpClient;
00065
00066             // Set data context:
00067             SelectedContent.ItemsSource = this.adaptiveContentModels;
00068             // Set default item:
00069             SetSelectedModel(this.adaptiveContentModels.First());
00070         }
00071
00072         public void SetSelectedModel(AdaptiveContentModel model)
00073         {
00074             SelectedModel = model;
00075             SelectedContent.SelectedItem = SelectedModel;
00076         }
00077
00078         public async void HideLoadUri()
00079         {
00080             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00081             {
00082                 this.LoadUriPanel.Visibility = Visibility.Collapsed;
00083             });
00084         }
00085         public async void SetAutoPlay(bool IsChecked)
00086         {
00087             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00088             {
00089                 AutoPlay.IsChecked = IsChecked;
00090             });
00091         }
00092
00093         private async void LoadId_Click(object sender, RoutedEventArgs e)
00094         {
00095             if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
00096                 return;
00097
00098             this.SelectedModel = (AdaptiveContentModel)SelectedContent.SelectedItem;
00099
00100             UriBox.Text = SelectedModel.ManifestUri.ToString();
00101             await CreateNewMediaPlaybackItem(SelectedModel.ManifestUri);
00102         }
00103
00104         private async void LoadUri_Click(object sender, RoutedEventArgs e)
00105         {
00106             if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
00107                 return;
00108
00109             Uri uri;
00110             if (!Uri.TryCreate(UriBox.Text, UriKind.Absolute, out uri))
00111             {
00112                 loggerControl.Log("Malformed Uri in Load text box.", SDKTemplate.Logging.LogViewLoggingLevel.Critical);
00113                 return;
00114             }
00115             await CreateNewMediaPlaybackItem(uri);
00116         }
00117
00118         private async Task CreateNewMediaPlaybackItem(Uri uri)
00119         {
00120             SetSourceEnabled(false);
00121             this.MediaPlaybackItem = null;
00122             this.MediaPlaybackItem = await CreateMediaPlaybackItem(uri, optionalHttpClient);
00123             if (this.MediaPlaybackItem != null)
00124             {
00125                 loggerControl.Log($"Loaded Uri: {uri}");
00126                 SetSourceEnabled(true);
00127             }
00128         }
00129
00130         private async void SetSourceEnabled(bool SetEnabled)
00131         {
00132             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00133             {
00134                 SetSource.IsEnabled = SetEnabled;
00135             });
00136         }
00137
00138         private void AutoPlay_Checked(object sender, RoutedEventArgs e)
00139         {
00140             if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
00141                 return;
00142
00143             mediaPlayer.AutoPlay = (bool)(sender as CheckBox).IsChecked;
00144         }
00145
00146         private void ForceEquirectangularSphericalVideoFrameFormat()
00147         {
00148             if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.None ||
00149                 mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Opening)
00150                 return;
00151
00152             var mpsvp = mediaPlayer.PlaybackSession.SphericalVideoProjection;
00153             if (mpsvp == null)
00154                 return;
00155
00156             if (mpsvp.FrameFormat != Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular)
00157                 mpsvp.FrameFormat = Windows.Media.MediaProperties.SphericalVideoFrameFormat.Equirectangular;
00158
00159             if (mpsvp.IsEnabled != true)
00160                 mpsvp.IsEnabled = true;
00161
00162             mpsvp.HorizontalFieldOfViewInDegrees = 120;
00163         }
00164
00165         private void SetSource_Click(object sender, RoutedEventArgs e)
00166         {
00167             if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null)
00168                 return;
00169
00170             // It is at this point that the MediaSource (within a MediaPlaybackItem) will be fully resolved.
00171             // For an AdaptiveMediaSource, this is the point at which media is first requested and parsed.
00172             mediaPlayer.Source = this.MediaPlaybackItem;
00173         }
00174     }
00175 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Display Member List

This is the complete list of members for Scenario2_Display, including all inherited members.
PickPlaylistButton_Click(object sender, RoutedEventArgs e) | Scenario2_Display | [inline, private]
rootPage | Scenario2_Display | [private]
Scenario2_Display() | Scenario2_Display | [inline]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_RecoverableErrors Member List

This is the complete list of members for Scenario6_RecoverableErrors, including all inherited members.
CancelActiveDownloadsAsync() | Scenario6_RecoverableErrors | [inline, private]
download | Scenario6_RecoverableErrors | [private]
downloadCancellationTokenSource | Scenario6_RecoverableErrors | [private]
HandleDownloadAsync() | Scenario6_RecoverableErrors | [inline, private]
IsWebException(string title, Exception ex) | Scenario6_RecoverableErrors | [inline, private]
OnDownloadProgress(IAsyncOperationWithProgress< DownloadOperation, DownloadOperation > sender, DownloadOperation progress) | Scenario6_RecoverableErrors | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario6_RecoverableErrors | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario6_RecoverableErrors | [inline, protected]
rootPage | Scenario6_RecoverableErrors | [private]
Scenario6_RecoverableErrors() | Scenario6_RecoverableErrors | [inline]
StartDownload_Click(object sender, RoutedEventArgs e) | Scenario6_RecoverableErrors | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario2_UnpinTile.xaml.cs Source File

  • SecondaryTiles
  • cs

Scenario2_UnpinTile.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using Windows.UI.StartScreen;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class Scenario2_UnpinTile : Page
00019     {
00020         MainPage rootPage = MainPage.Current;
00021
00022         public Scenario2_UnpinTile()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         private async void UnpinSecondaryTile_Click(object sender, RoutedEventArgs e)
00028         {
00029             if (SecondaryTile.Exists(MainPage.logoSecondaryTileId))
00030             {
00031                 // First prepare the tile to be unpinned
00032                 SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId);
00033                 // Now make the delete request.
00034                 bool isUnpinned = await secondaryTile.RequestDeleteForSelectionAsync(MainPage.GetElementRect(sender), Windows.UI.Popups.Placement.Below);
00035                 if (isUnpinned)
00036                 {
00037                     rootPage.NotifyUser("Secondary tile successfully unpinned.", NotifyType.StatusMessage);
00038                 }
00039                 else
00040                 {
00041                     rootPage.NotifyUser("Secondary tile not unpinned.", NotifyType.ErrorMessage);
00042                 }
00043             }
00044             else
00045             {
00046                 rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is not currently pinned.", NotifyType.ErrorMessage);
00047             }
00048         }
00049     }
00050 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/RpcServer.cpp Source File

  • CustomCapability
  • Service
  • Server

RpcServer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "stdafx.h"
00013 #include <stdlib.h>
00014 #include <stdio.h>
00015 #include <iostream>
00016 #include "RpcInterface_h.h"
00017 #include <windows.h>
00018
00019 #include <sddl.h>
00020 #include <securitybaseapi.h>
00021 #include <AclAPI.h>
00022 #include "RpcServer.h"
00023
00024 using namespace RpcServer;
00025
00026 #define DEFAULT_METERING_PERIOD 100
00027
00028 const WCHAR* CustomCapabilityName = L"microsoft.hsaTestCustomCapability_q536wpkpf5cy2";
00029
00030 bool ShutdownRequested;
00031 static RPC_BINDING_VECTOR* BindingVector = nullptr;
00032
00033 void FreeSidArray(__inout_ecount(cSIDs) PSID* pSIDs, ULONG cSIDs)
00034 {
00035     if (pSIDs != nullptr)
00036     {
00037         for (ULONG i = 0; i < cSIDs; i++)
00038         {
00039             LocalFree(pSIDs[i]);
00040
00041             pSIDs[i] = nullptr;
00042         }
00043
00044         LocalFree(pSIDs);
00045
00046         pSIDs = nullptr;
00047         cSIDs = 0;
00048     }
00049 }
00050
00051 //
00052 // Routine to create RPC server and listen to incoming RPC calls
00053 //
00054 DWORD RpcServerStart()
00055 {
00056     DWORD hResult = S_OK;
00057     WCHAR* protocolSequence = L"ncalrpc";
00058     unsigned int minCalls = 1;
00059     unsigned int dontWait = false;
00060     ShutdownRequested = false;
00061
00062     SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
00063     PSID everyoneSid = nullptr;
00064     PSID* capabilitySids = nullptr;
00065     DWORD capabilitySidCount = 0;
00066     PSID* capabilityGroupSids = nullptr;
00067     DWORD capabilityGroupSidCount = 0;
00068     EXPLICIT_ACCESS ea[2] = {};
00069     PACL acl = nullptr;
00070     SECURITY_DESCRIPTOR rpcSecurityDescriptor = {};
00071
00072     // When creating the RPC endpoint we want it to allow connections from any UWA that contains
00073     // the custom capability SID in its process token.  When a UWA declares the custom capability
00074     // in its app manifest, it will later contain the SID form of that custom capability in its
00075     // process token at runtime.  By default, RPC endpoints don't allow UWAs (AppContainer processes)
00076     // to connect to them, so we need to set the security on the endpoint to allow access to UWAs with the
00077     // custom capability.
00078     //
00079     // To do this we'll perform the following steps:
00080     // 1) Convert the custom capability name to a SID
00081     // 2) Create a security descriptor using that SID, as well as other needed SIDs.  This sample shows how to allow
00082     //    all 'non UWAs' access as well as UWAs containing the custom capability SID.
00083     // 3) Create the RPC endpoint using that security descriptor
00084     //
00085     // To create the security descriptor we're roughly following this MSDN sample:
00086     // https://msdn.microsoft.com/en-us/library/windows/desktop/aa446595(v=vs.85).aspx
00087
00088     // Get the SID form of the custom capability.  In this case we only expect one SID and
00089     // we don't care about the capability group.
00090     if (!DeriveCapabilitySidsFromName(
00091         CustomCapabilityName,
00092         &capabilityGroupSids,
00093         &capabilityGroupSidCount,
00094         &capabilitySids,
00095         &capabilitySidCount))
00096     {
00097         hResult = GetLastError();
00098         goto end;
00099     }
00100
00101     if (capabilitySidCount != 1)
00102     {
00103         // Unexpected sid count
00104         hResult = ERROR_INVALID_PARAMETER;
00105         goto end;
00106     }
00107
00108     // Get the SID that represents 'everyone' (this doesn't include AppContainers)
00109     if (!AllocateAndInitializeSid(
00110         &SIDAuthWorld, 1,
00111         SECURITY_WORLD_RID,
00112         0, 0, 0, 0, 0, 0, 0,
00113         &everyoneSid))
00114     {
00115         hResult = GetLastError();
00116         goto end;
00117     }
00118
00119     // Now create the Access Control List (ACL) for the Security descriptor
00120
00121     // Everyone GENERIC_ALL access
00122     ea[0].grfAccessMode = SET_ACCESS;
00123     ea[0].grfAccessPermissions = GENERIC_ALL;
00124     ea[0].grfInheritance = NO_INHERITANCE;
00125     ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
00126     ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
00127     ea[0].Trustee.ptstrName = static_cast<LPWSTR>(everyoneSid);
00128
00129     // Custom capability GENERIC_ALL access
00130     ea[1].grfAccessMode = SET_ACCESS;
00131     ea[1].grfAccessPermissions = GENERIC_ALL;
00132     ea[1].grfInheritance = NO_INHERITANCE;
00133     ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
00134     ea[1].Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
00135     ea[1].Trustee.ptstrName = static_cast<LPWSTR>(capabilitySids[0]); // Earlier we ensured there was exactly 1
00136
00137     hResult = SetEntriesInAcl(ARRAYSIZE(ea), ea, nullptr, &acl);
00138
00139     if (hResult != ERROR_SUCCESS)
00140     {
00141         goto end;
00142     }
00143
00144     // Initialize an empty security descriptor
00145     if (!InitializeSecurityDescriptor(&rpcSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION))
00146     {
00147         hResult = GetLastError();
00148         goto end;
00149     }
00150
00151     // Assign the ACL to the security descriptor
00152     if (!SetSecurityDescriptorDacl(&rpcSecurityDescriptor, TRUE, acl, FALSE))
00153     {
00154         hResult = GetLastError();
00155         goto end;
00156     }
00157
00158     //
00159     // Bind to LRPC using dynamic endpoints
00160     //
00161     hResult = RpcServerUseProtseqEp(
00162         reinterpret_cast<RPC_WSTR>(protocolSequence),
00163         RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
00164         reinterpret_cast<RPC_WSTR>(RPC_STATIC_ENDPOINT),
00165         &rpcSecurityDescriptor);
00166
00167     if (hResult != S_OK)
00168     {
00169         goto end;
00170     }
00171
00172     hResult = RpcServerRegisterIf3(
00173         RpcInterface_v1_0_s_ifspec,
00174         nullptr,
00175         nullptr,
00176         RPC_IF_AUTOLISTEN | RPC_IF_ALLOW_LOCAL_ONLY,
00177         RPC_C_LISTEN_MAX_CALLS_DEFAULT,
00178         0,
00179         nullptr,
00180         &rpcSecurityDescriptor);
00181
00182     if (hResult != S_OK)
00183     {
00184         goto end;
00185     }
00186
00187     hResult = RpcServerInqBindings(&BindingVector);
00188
00189     if (hResult != S_OK)
00190     {
00191         goto end;
00192     }
00193
00194     hResult = RpcEpRegister(
00195         RpcInterface_v1_0_s_ifspec,
00196         BindingVector,
00197         nullptr,
00198         nullptr);
00199
00200     if (hResult != S_OK)
00201     {
00202         goto end;
00203     }
00204
00205     hResult = RpcServerListen(
00206         minCalls,
00207         RPC_C_LISTEN_MAX_CALLS_DEFAULT,
00208         dontWait);
00209
00210     if (hResult == RPC_S_ALREADY_LISTENING)
00211     {
00212         hResult = RPC_S_OK;
00213     }
00214
00215 end:
00216
00217     // Cleanup sids
00218     FreeSidArray(capabilityGroupSids, capabilityGroupSidCount);
00219     FreeSidArray(capabilitySids, capabilitySidCount);
00220
00221     if (everyoneSid != nullptr)
00222     {
00223         FreeSid(everyoneSid);
00224     }
00225
00226     // cleanup acl
00227     if (acl != nullptr)
00228     {
00229         LocalFree(acl);
00230     }
00231
00232     return hResult;
00233 }
00234
00235 //
00236 // Notify rpc server to stop listening to incoming rpc calls
00237 //
00238 void RpcServerDisconnect()
00239 {
00240     DWORD hResult = S_OK;
00241     ShutdownRequested = true;
00242     hResult = RpcServerUnregisterIf(RpcInterface_v1_0_s_ifspec, nullptr, 0);
00243
00244     RpcEpUnregister(RpcInterface_v1_0_s_ifspec, BindingVector, nullptr);
00245
00246     if (BindingVector != nullptr)
00247     {
00248         RpcBindingVectorFree(&BindingVector);
00249         BindingVector = nullptr;
00250     }
00251 }
00252
00253 //
00254 // Rpc method to retrieve client context handle
00255 //
00256 void RemoteOpen(
00257     _In_ handle_t hBinding,
00258     _Out_ PPCONTEXT_HANDLE_TYPE pphContext)
00259 {
00260     std::cout << "opening rpc endpoint" << std::endl;
00261     *pphContext = static_cast<PCONTEXT_HANDLE_TYPE *>(midl_user_allocate(sizeof(METERING_CONTEXT)));
00262     METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(*pphContext);
00263     meteringContext->metering = new Metering(DEFAULT_METERING_PERIOD);
00264 }
00265
00266 //
00267 // Rpc method to close the client context handle
00268 //
00269 void RemoteClose(_Inout_ PPCONTEXT_HANDLE_TYPE pphContext)
00270 {
00271     std::cout << "closing rpc endpoint" << std::endl;
00272     if (*pphContext == nullptr)
00273     {
00274         //Log error, client tried to close a NULL handle.
00275         return;
00276     }
00277
00278     METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(*pphContext);
00279     delete meteringContext->metering;
00280     MIDL_user_free(meteringContext);
00281
00282     // This tells the run-time, when it is marshalling the out
00283     // parameters, that the context handle has been closed normally.
00284     *pphContext = nullptr;
00285 }
00286
00287 //
00288 // Routine to cleanup client context when client has died with active
00289 // connection with server
00290 //
00291 void __RPC_USER PCONTEXT_HANDLE_TYPE_rundown(
00292     _In_ PCONTEXT_HANDLE_TYPE phContext)
00293 {
00294     std::cout << "client died" << std::endl;
00295     StopMetering(phContext);
00296     RemoteClose(&phContext);
00297 }
00298
00299 #pragma region METERING_RPCROUTINES
00300
00301 void StartMetering(
00302     _In_ PCONTEXT_HANDLE_TYPE phContext,
00303     _In_ __int64 period,
00304     _In_ __int64 context)
00305 {
00306     std::cout << "start metering" << std::endl;
00307     METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
00308     meteringContext->metering->StartMetering(period, context);
00309     std::cout << "done metering" << std::endl;
00310 }
00311
00312 void SetSamplePeriod(
00313     _In_ PCONTEXT_HANDLE_TYPE phContext,
00314     _In_ __int64 period)
00315 {
00316     METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
00317     meteringContext->metering->SetSamplePeriod(period);
00318 }
00319
00320
00321 void StopMetering(_In_ PCONTEXT_HANDLE_TYPE phContext)
00322 {
00323     std::cout << "stop metering" << std::endl;
00324     METERING_CONTEXT* meteringContext = static_cast<METERING_CONTEXT *>(phContext);
00325     meteringContext->metering->StopMetering();
00326 }
00327
00328 #pragma endregion METERING_RPCROUTINES
00329
00330 /******************************************************/
00331 /*         MIDL allocate and free                     */
00332 /******************************************************/
00333
00334 void __RPC_FAR * __RPC_USER midl_user_allocate(_In_ size_t len)
00335 {
00336     return(malloc(len));
00337 }
00338
00339 void __RPC_USER midl_user_free(_In_ void __RPC_FAR* ptr)
00340 {
00341     free(ptr);
00342 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/Logos/Source/AppPackage/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • Logos
  • Source
  • AppPackage

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.StartScreen;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.LiveTiles.BasicState.Logos.Source.AppPackage
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         public ScenarioElement()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         private async void ButtonPinTile_Click(object sender, RoutedEventArgs e)
00021         {
00022             base.IsEnabled = false;
00023
00024             string tileId = DateTime.Now.Ticks.ToString();
00025
00026             SecondaryTile tile = new SecondaryTile(tileId, "Logo App Package", "args", new Uri("ms-appx:///Assets/Photos/1.jpg"), TileSize.Default);
00027             await tile.RequestCreateAsync();
00028
00029             base.IsEnabled = true;
00030         }
00031     }
00032 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_LEDTemp Member List

This is the complete list of members for Scenario2_LEDTemp, including all inherited members.
CancelAllIoTasks() | Scenario2_LEDTemp | [inline, private]
CancelReadTask() | Scenario2_LEDTemp | [inline, private]
CancelWriteTask() | Scenario2_LEDTemp | [inline, private]
DataReaderObject | Scenario2_LEDTemp | [private]
DataWriterObject | Scenario2_LEDTemp | [private]
Dispose() | Scenario2_LEDTemp | [inline]
IsNavigatedAway | Scenario2_LEDTemp | [private]
LED3Switch_Toggled(object sender, RoutedEventArgs e) | Scenario2_LEDTemp | [inline, private]
LED4Switch_Toggled(object sender, RoutedEventArgs e) | Scenario2_LEDTemp | [inline, private]
LED5Switch_Toggled(object sender, RoutedEventArgs e) | Scenario2_LEDTemp | [inline, private]
LED6Switch_Toggled(object sender, RoutedEventArgs e) | Scenario2_LEDTemp | [inline, private]
LedState enum name | Scenario2_LEDTemp |
NotifyReadCancelingTask() | Scenario2_LEDTemp | [inline, private]
NotifyReadTaskCanceled() | Scenario2_LEDTemp | [inline, private]
NotifyWriteCancelingTask() | Scenario2_LEDTemp | [inline, private]
NotifyWriteTaskCanceled() | Scenario2_LEDTemp | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | Scenario2_LEDTemp | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario2_LEDTemp | [inline, protected]
ReadAsync(CancellationToken cancellationToken) | Scenario2_LEDTemp | [inline, private]
ReadCancellationTokenSource | Scenario2_LEDTemp | [private]
ReadCancelLock | Scenario2_LEDTemp | [private]
ResetReadCancellationTokenSource() | Scenario2_LEDTemp | [inline, private]
ResetWriteCancellationTokenSource() | Scenario2_LEDTemp | [inline, private]
rootPage | Scenario2_LEDTemp | [private]
Scenario2_LEDTemp() | Scenario2_LEDTemp | [inline]
TemperatureButton_Click(object sender, RoutedEventArgs e) | Scenario2_LEDTemp | [inline, private]
WriteAsync(CancellationToken cancellationToken) | Scenario2_LEDTemp | [inline, private]
WriteCancellationTokenSource | Scenario2_LEDTemp | [private]
WriteCancelLock | Scenario2_LEDTemp | [private]
WriteLedCommand(String ledNumber, LedState ledState) | Scenario2_LEDTemp | [inline, private]
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/SampleConfiguration.h Source File

  • SmartCard
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 #define ADMIN_KEY_LENGTH_IN_BYTES 24
00007
00008 namespace SDKTemplate
00009 {
00010     value struct Scenario;
00011
00012     partial ref class MainPage
00013     {
00014     internal:
00015         static property Platform::String^ FEATURE_NAME
00016         {
00017             Platform::String^ get()
00018             {
00019                 return "Smartcard";
00020             }
00021         }
00022
00023         static property Platform::Array<Scenario>^ scenarios
00024         {
00025             Platform::Array<Scenario>^ get()
00026             {
00027                 return scenariosInner;
00028             }
00029         }
00030
00031         property Windows::Storage::Streams::IBuffer^ AdminKey
00032         {
00033             Windows::Storage::Streams::IBuffer^  get()
00034             {
00035                 return adminkey;
00036             }
00037
00038             void set(Windows::Storage::Streams::IBuffer^  value)
00039             {
00040                 adminkey = value;
00041             }
00042         }
00043
00044         property Platform::String^ SmartCardReaderDeviceId
00045         {
00046             Platform::String^  get()
00047             {
00048                 return deviceId;
00049             }
00050
00051             void set(Platform::String^  value)
00052             {
00053                 deviceId = value;
00054             }
00055         }
00056
00057         Concurrency::task<Windows::Devices::SmartCards::SmartCard^> GetSmartCard();
00058
00059     private:
00060         static Platform::Array<Scenario>^ scenariosInner;
00061         Windows::Storage::Streams::IBuffer^ adminkey;
00062         Platform::String^ deviceId;
00063     };
00064
00065     public value struct Scenario
00066     {
00067         Platform::String^ Title;
00068         Platform::String^ ClassName;
00069     };
00070
00071     namespace SmartCardSample
00072     {
00073         // Sample specific types should be in this namespace
00074     }
00075 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.cpp Source File

  • WiFiDirectServices
  • cpp

Scenario4_SeekerSession.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_SeekerSession.xaml.h"
00014
00015 using namespace SDKTemplate::WiFiDirectServices;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Core;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028 using namespace std;
00029
00030 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00031
00032 Scenario4::Scenario4() : _rootPage(MainPage::Current)
00033 {
00034     InitializeComponent();
00035 }
00036
00037 void Scenario4::AddSession(SessionWrapper^ session)
00038 {
00039     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00040         ref new DispatchedHandler([this, session]()
00041         {
00042             lock_guard<mutex> lock(_mutex);
00043
00044             ConnectedSessions->Items->Append(session);
00045         }));
00046 }
00047
00048 void Scenario4::RemoveSession(unsigned int index)
00049 {
00050     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00051         ref new DispatchedHandler([this, index]()
00052         {
00053             lock_guard<mutex> lock(_mutex);
00054
00055             if (index > ConnectedSessions->Items->Size - 1)
00056             {
00057                 throw ref new OutOfBoundsException("Attempted to remove session no longer in list");
00058             }
00059
00060             ConnectedSessions->Items->RemoveAt(index);
00061         }));
00062 }
00063
00064 void Scenario4::OnNavigatedTo(NavigationEventArgs^ e)
00065 {
00066     lock_guard<mutex> lock(_mutex);
00067
00068     MainUI->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00069     PlaceholderUI->Visibility = Windows::UI::Xaml::Visibility::Visible;
00070
00071     // Cleanup old entries
00072     ConnectedSessions->Items->Clear();
00073     for (auto&& session : WiFiDirectServiceManager::Instance->ConnectedSessionList)
00074     {
00075         ConnectedSessions->Items->Append(session);
00076     }
00077
00078     if (ConnectedSessions->Items->Size > 0)
00079     {
00080         MainUI->Visibility = Windows::UI::Xaml::Visibility::Visible;
00081         PlaceholderUI->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00082     }
00083
00084     WiFiDirectServiceManager::Instance->CurrentScenario4 = this;
00085 }
00086
00087 void Scenario4::OnNavigatingFrom(NavigatingCancelEventArgs ^ e)
00088 {
00089     WiFiDirectServiceManager::Instance->CurrentScenario4 = nullptr;
00090 }
00091
00092 void Scenario4::SelectSession_Click(Object^ sender, RoutedEventArgs^ e)
00093 {
00094     if (ConnectedSessions->Items->Size > 0)
00095     {
00096         int index = ConnectedSessions->SelectedIndex;
00097         if (index >= 0)
00098         {
00099             WiFiDirectServiceManager::Instance->SelectSession(index);
00100
00101             // Force navigation to the next page for smoother experience
00102             // This takes us to the scenario to send and receive data for a selected session
00103             _rootPage->GoToScenario(4);
00104         }
00105     }
00106 }
00107
00108 void Scenario4::CloseSession_Click(Object^ sender, RoutedEventArgs^ e)
00109 {
00110     if (ConnectedSessions->Items->Size > 0)
00111     {
00112         int index = ConnectedSessions->SelectedIndex;
00113         if (index >= 0)
00114         {
00115             WiFiDirectServiceManager::Instance->CloseSession(index);
00116         }
00117     }
00118 }
Generated on Fri Nov 15 2024 22:22:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/pch.h Source File

  • DWriteColorGlyph
  • cpp

pch.h

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #undef NTDDI_VERSION
00011 #define NTDDI_VERSION NTDDI_WIN10_RS1
00012
00013 #include <wrl.h>
00014 #include <wrl/client.h>
00015 #include <d3d11_2.h>
00016 #include <d2d1_3.h>
00017 #include <dwrite_3.h>
00018 #include <wincodec.h>
00019 #include <DirectXMath.h>
00020 #include <memory>
00021 #include <ppltasks.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario5.xaml.cs Source File

  • XamlCommanding
  • cs

Scenario5.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace Commanding
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class Scenario5 : Page
00022     {
00023         public Scenario5()
00024         {
00025             this.InitializeComponent();
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario5_ApplicationTriggerTask.xaml.cpp Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario5_ApplicationTriggerTask.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4_ApplicationTriggerTask.xaml.cpp
00013 // Implementation of the ApplicationTriggerTask class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario5_ApplicationTriggerTask.xaml.h"
00018 #include "SampleConfiguration.h"
00019
00020 using namespace SDKTemplate;
00021 using namespace concurrency;
00022 using namespace Windows::ApplicationModel::Background;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 ApplicationTriggerTask::ApplicationTriggerTask()
00029 {
00030     InitializeComponent();
00031 }
00032
00033 /// <summary>
00034 /// Invoked when this page is about to be displayed in a Frame.
00035 /// </summary>
00036 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037 /// property is typically used to configure the page.</param>
00038 void ApplicationTriggerTask::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00041     // as NotifyUser()
00042     rootPage = MainPage::Current;
00043
00044     //
00045     // Attach progress and completed handlers to any existing tasks.
00046     //
00047     for (auto pair : BackgroundTaskRegistration::AllTasks)
00048     {
00049         auto task = pair->Value;
00050         if (task->Name == ApplicationTriggerTaskName)
00051         {
00052             BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, true);
00053             AttachProgressAndCompletedHandlers(task);
00054             break;
00055         }
00056     }
00057
00058     trigger = ref new ApplicationTrigger();
00059     UpdateUI();
00060 }
00061
00062 /// <summary>
00063 /// Attach progress and completed handers to a background task.
00064 /// </summary>
00065 /// <param name="task">The task to attach progress and completed handlers to.</param>
00066 void ApplicationTriggerTask::AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration^ task)
00067 {
00068     task->Progress += ref new BackgroundTaskProgressEventHandler(this, &ApplicationTriggerTask::OnProgress);
00069     task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &ApplicationTriggerTask::OnCompleted);
00070 }
00071
00072 /// <summary>
00073 /// Register a SampleBackgroundTask.
00074 /// </summary>
00075 /// <param name="sender"></param>
00076 /// <param name="e"></param>
00077 void ApplicationTriggerTask::RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00078 {
00079     auto task = BackgroundTaskSample::RegisterBackgroundTask(SampleBackgroundTaskEntryPoint,
00080                                                              ApplicationTriggerTaskName,
00081                                                              trigger,
00082                                                              nullptr);
00083     AttachProgressAndCompletedHandlers(task);
00084     UpdateUI();
00085 }
00086
00087 /// <summary>
00088 /// Unregister a SampleBackgroundTask.
00089 /// </summary>
00090 /// <param name="sender"></param>
00091 /// <param name="e"></param>
00092 void ApplicationTriggerTask::UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00093 {
00094     BackgroundTaskSample::UnregisterBackgroundTasks(ApplicationTriggerTaskName);
00095     BackgroundTaskSample::ApplicationTriggerTaskResult = "";
00096     UpdateUI();
00097 }
00098
00099 /// <summary>
00100 /// Signal an ApplicationTrigger.
00101 /// </summary>
00102 /// <param name="sender"></param>
00103 /// <param name="e"></param>
00104 void ApplicationTriggerTask::SignalBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00105 {
00106     //
00107     // Reset the completion status
00108     //
00109     auto settings = ApplicationData::Current->LocalSettings->Values;
00110     settings->Remove(ApplicationTriggerTaskName);
00111
00112     //
00113     // Signal the ApplicationTrigger
00114     //
00115     auto request = create_task(trigger->RequestAsync());
00116     request.then([this](ApplicationTriggerResult result) {
00117         BackgroundTaskSample::ApplicationTriggerTaskResult = "Signal Result: " + result.ToString();
00118     });
00119     UpdateUI();
00120 }
00121
00122 /// <summary>
00123 /// Handle background task progress.
00124 /// </summary>
00125 /// <param name="task">The task that is reporting progress.</param>
00126 /// <param name="args">Arguments of the progress report.</param>
00127 void ApplicationTriggerTask::OnProgress(BackgroundTaskRegistration^ task, BackgroundTaskProgressEventArgs^ args)
00128 {
00129     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00130     {
00131         auto progress = "Progress: " + args->Progress + "%";
00132         BackgroundTaskSample::ApplicationTriggerTaskProgress = progress;
00133         UpdateUI();
00134     }));
00135 }
00136
00137 /// <summary>
00138 /// Handle background task completion.
00139 /// </summary>
00140 /// <param name="task">The task that is reporting completion.</param>
00141 /// <param name="args">Arguments of the completion report.</param>
00142 void ApplicationTriggerTask::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00143 {
00144     UpdateUI();
00145 }
00146
00147 /// <summary>
00148 /// Update the scenario UI.
00149 /// </summary>
00150 void ApplicationTriggerTask::UpdateUI()
00151 {
00152     auto uiDelegate = [this]()
00153     {
00154         RegisterButton->IsEnabled = !BackgroundTaskSample::ApplicationTriggerTaskRegistered;
00155         UnregisterButton->IsEnabled = BackgroundTaskSample::ApplicationTriggerTaskRegistered;
00156         SignalButton->IsEnabled = BackgroundTaskSample::ApplicationTriggerTaskRegistered & (trigger != nullptr);
00157         Progress->Text = BackgroundTaskSample::ApplicationTriggerTaskProgress;
00158         Result->Text = BackgroundTaskSample::ApplicationTriggerTaskResult;
00159         Status->Text = BackgroundTaskSample::GetBackgroundTaskStatus(ApplicationTriggerTaskName);
00160     };
00161     auto handler = ref new Windows::UI::Core::DispatchedHandler(uiDelegate, Platform::CallbackContext::Any);
00162
00163     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, handler);
00164 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StopFunc Member List

This is the complete list of members for StopFunc, including all inherited members.
operator()(IMFStreamSink *pStream) const StopFunc [inline]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/School.cpp Source File

  • Json
  • cppwinrt

School.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "School.h"
00014 #include "School.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Data::Json;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     School::School(winrt::Windows::Data::Json::JsonObject const& jsonObject)
00024     {
00025         JsonObject schoolObject = jsonObject.GetNamedObject(schoolKey, nullptr);
00026         if (schoolObject != nullptr)
00027         {
00028             m_id = schoolObject.GetNamedString(idKey, L"");
00029             m_name = schoolObject.GetNamedString(nameKey, L"");
00030         }
00031         m_type = jsonObject.GetNamedString(typeKey);
00032     }
00033
00034     winrt::Windows::Data::Json::JsonObject School::ToJsonObject()
00035     {
00036         JsonObject schoolObject;
00037         schoolObject.SetNamedValue(idKey, JsonValue::CreateStringValue(m_id));
00038         schoolObject.SetNamedValue(nameKey, JsonValue::CreateStringValue(m_name));
00039
00040         JsonObject jsonObject;
00041         // JsonObject can also be treated as an IMap.
00042         jsonObject.Insert(schoolKey, schoolObject);
00043         jsonObject.Insert(typeKey, JsonValue::CreateStringValue(m_type));
00044
00045         return jsonObject;
00046     }
00047 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/HolographicFaceTrackerMain.h Source File

  • HolographicFaceTracking
  • cpp

HolographicFaceTrackerMain.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Common\StepTimer.h"
00015 #include "Common\DeviceResources.h"
00016
00017 // Updates, renders, and presents holographic content using Direct3D.
00018 namespace HolographicFaceTracker
00019 {
00020     class VideoFrameProcessor;
00021     class FaceTrackerProcessor;
00022
00023     class QuadRenderer;
00024     class SpinningCubeRenderer;
00025     class TextRenderer;
00026     class NV12VideoTexture;
00027
00028     class HolographicFaceTrackerMain : public DX::IDeviceNotify
00029     {
00030     public:
00031         HolographicFaceTrackerMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00032         ~HolographicFaceTrackerMain();
00033
00034         // Sets the holographic space. This is our closest analogue to setting a new window
00035         // for the app.
00036         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ holographicSpace);
00037
00038         // Starts the holographic frame and updates the content.
00039         Windows::Graphics::Holographic::HolographicFrame^ Update();
00040
00041         // Renders holograms, including world-locked content.
00042         bool Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame);
00043
00044         bool IsReadyToRender(void) const { return m_isReadyToRender; }
00045
00046         // Handle saving and loading of app state owned by AppMain.
00047         void SaveAppState();
00048         void LoadAppState();
00049
00050         // IDeviceNotify
00051         virtual void OnDeviceLost();
00052         virtual void OnDeviceRestored();
00053
00054     private:
00055         // Asynchronously creates resources for new holographic cameras.
00056         void OnCameraAdded(
00057             Windows::Graphics::Holographic::HolographicSpace^ sender,
00058             Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ args);
00059
00060         // Synchronously releases resources for holographic cameras that are no longer
00061         // attached to the system.
00062         void OnCameraRemoved(
00063             Windows::Graphics::Holographic::HolographicSpace^ sender,
00064             Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ args);
00065
00066         // Used to notify the app when the positional tracking state changes.
00067         void OnLocatabilityChanged(
00068             Windows::Perception::Spatial::SpatialLocator^ sender,
00069             Platform::Object^ args);
00070
00071         // Clears event registration state. Used when changing to a new HolographicSpace
00072         // and when tearing down AppMain.
00073         void UnregisterHolographicEventHandlers();
00074
00075         void ProcessFaces(
00076             std::vector<Windows::Graphics::Imaging::BitmapBounds> const& faces,
00077             Windows::Media::Capture::Frames::MediaFrameReference^ frame,
00078             Windows::Perception::Spatial::SpatialCoordinateSystem^ worldCoordSystem);
00079
00080         // Cached pointer to device resources.
00081         std::shared_ptr<DX::DeviceResources>                            m_deviceResources;
00082
00083         // Render loop timer.
00084         DX::StepTimer                                                   m_timer;
00085
00086         // Represents the holographic space around the user.
00087         Windows::Graphics::Holographic::HolographicSpace^               m_holographicSpace;
00088
00089         // SpatialLocator that is attached to the primary camera.
00090         Windows::Perception::Spatial::SpatialLocator^                   m_locator;
00091
00092         // A reference frame attached to the holographic camera.
00093         Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference^ m_referenceFrame;
00094
00095
00096         // Video and face tracking processors
00097         std::shared_ptr<VideoFrameProcessor>                            m_videoFrameProcessor;
00098         std::shared_ptr<FaceTrackerProcessor>                           m_faceTrackerProcessor;
00099
00100         // Objects related to rendering/3D models
00101         std::shared_ptr<QuadRenderer>                                   m_quadRenderer;
00102         std::shared_ptr<SpinningCubeRenderer>                           m_spinningCubeRenderer;
00103         std::shared_ptr<TextRenderer>                                   m_textRenderer;
00104         std::shared_ptr<NV12VideoTexture>                               m_videoTexture;
00105
00106         // Used to avoid redundant copying of frames to our DirectX texture.
00107         int64_t                                                         m_previousFrameTimestamp = 0;
00108
00109         // Indicates whether any faces being tracked at the moment.
00110         bool                                                            m_trackingFaces = false;
00111
00112         // Indicates whether all resources necessary for rendering are ready.
00113         bool                                                            m_isReadyToRender = false;
00114
00115         // Event registration tokens.
00116         Windows::Foundation::EventRegistrationToken                     m_cameraAddedToken;
00117         Windows::Foundation::EventRegistrationToken                     m_cameraRemovedToken;
00118         Windows::Foundation::EventRegistrationToken                     m_locatabilityChangedToken;
00119     };
00120 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/ImagePage.h Source File

  • XamlListView
  • cppwinrt

ImagePage.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "ImagePage.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct ImagePage : ImagePageT<ImagePage>
00018     {
00019         ImagePage();
00020
00021         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00022         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023
00024     private:
00025         event_token backRequestedToken{};
00026
00027         void OnBackRequested(Windows::Foundation::IInspectable const&, Windows::UI::Core::BackRequestedEventArgs const& e);
00028     };
00029 }
00030
00031 namespace winrt::SDKTemplate::factory_implementation
00032 {
00033     struct ImagePage : ImagePageT<ImagePage, implementation::ImagePage>
00034     {
00035     };
00036 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ISinkCallback Member List

This is the complete list of members for ISinkCallback, including all inherited members.
FireIncomingConnection(IncomingConnectionEventArgs^args) | ISinkCallback
OnShutdown() | ISinkCallback
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ControlSizeTrigger Member List

This is the complete list of members for ControlSizeTrigger, including all inherited members.
_currentHeight | ControlSizeTrigger | [private]
_currentWidth | ControlSizeTrigger | [private]
_minHeight | ControlSizeTrigger | [private]
_minWidth | ControlSizeTrigger | [private]
_targetElement | ControlSizeTrigger | [private]
_targetElement_SizeChanged(object sender, SizeChangedEventArgs e) | ControlSizeTrigger | [inline, private]
MinHeight | ControlSizeTrigger |
MinWidth | ControlSizeTrigger |
TargetElement | ControlSizeTrigger |
UpdateTrigger() | ControlSizeTrigger | [inline, private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario4.xaml.cpp Source File

  • FolderEnumeration
  • cpp

Scenario4.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4.xaml.cpp
00013 // Implementation of the Scenario4 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario4.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Platform;
00023 using namespace Platform::Collections;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::Storage;
00027 using namespace Windows::Storage::Pickers;
00028 using namespace Windows::Storage::Search;
00029 using namespace Windows::UI;
00030 using namespace Windows::UI::Xaml;
00031 using namespace Windows::UI::Xaml::Controls;
00032 using namespace Windows::UI::Xaml::Navigation;
00033
00034 Scenario4::Scenario4()
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario4::GetFilesButton_Click(Object^ sender, RoutedEventArgs^ e)
00040 {
00041     // Reset output.
00042     OutputPanel->Children->Clear();
00043
00044     // Ask the user to pick a folder.
00045     FolderPicker^ picker = ref new FolderPicker();
00046     picker->FileTypeFilter->Append("*");
00047     picker->ViewMode = PickerViewMode::List;
00048     picker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
00049
00050     create_task(picker->PickSingleFolderAsync()).then([=](StorageFolder^ folder)
00051     {
00052         if (folder != nullptr)
00053         {
00054             // Query the folder.
00055             auto query = folder->CreateFileQuery();
00056             create_task(query->GetFilesAsync()).then([=](IVectorView<StorageFile^>^ files)
00057             {
00058                 // Display file list with storage provider and availability.
00059                 std::for_each(begin(files), end(files), [=](StorageFile^ file)
00060                 {
00061                     // Create an entry in the list for the item.
00062                     String^ line = file->Name;
00063
00064                     // Show the item's provider (This PC, OneDrive, Network, or Application Content).
00065                     line += ": On " + file->Provider->DisplayName;
00066
00067                     // Show if the item is available (OneDrive items are usually available when
00068                     // online or when they are marked for "always available offline").
00069                     line += " (";
00070                     if (file->IsAvailable)
00071                     {
00072                         line += "available";
00073                     }
00074                     else
00075                     {
00076                         line += "not available";
00077                     }
00078                     line += ")";
00079
00080                     OutputPanel->Children->Append(CreateLineItemTextBlock(line));
00081                 });
00082             });
00083         }
00084     });
00085 }
00086
00087 TextBlock^ Scenario4::CreateLineItemTextBlock(String^ contents)
00088 {
00089     TextBlock^ textBlock = ref new TextBlock();
00090     textBlock->Text = contents;
00091     textBlock->Style = static_cast<Xaml::Style^>(::Application::Current->Resources->Lookup("BasicTextStyle"));
00092     textBlock->TextWrapping = TextWrapping::Wrap;
00093     Thickness margin = textBlock->Margin;
00094     margin.Left = 20;
00095     textBlock->Margin = margin;
00096     return textBlock;
00097 }
Generated on Fri Nov 15 2024 22:18:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameMain.h Source File

  • Simple3DGameDX
  • cpp

GameMain.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // GameMain:
00013 // This class is the main class required for Windows Runtime apps.
00014 // It it called on Launch activation and maintains the overall state of the game.
00015 // The GameMain class drives and maintains a state machine for the game.  It can be in
00016 // one of seven major states defined by the UpdateEngineState enum class.
00017 // These are:
00018 //     WaitingForResources - the game has requested the game object or the renderer object
00019 //         to load resources asynchronously.
00020 //     ResourcesLoaded - the asynchronous loading of resources has been completed.  This
00021 //         is a transient state.
00022 //     WaitingForPress - the game is waiting for the player to indicate they are ready to proceed.
00023 //         There are three possible actions from this state.  This is controlled by m_pressResult.
00024 //         The possible outcomes are:
00025 //             LoadGame - The player is ready to start a new game and has acknowledged the status
00026 //                 information provided about the previous state.
00027 //             PlayLevel - The player is ready to play the next level.  The level has already been
00028 //                 loaded so active game play will start.
00029 //             ContinueLevel - The player is ready to continue playing the current level.  Part of the
00030 //                 current level has already been played.
00031 //     Dynamics - the game is active play mode.
00032 //     TooSmall - the window is currently too small to play the game.
00033 //     Suspended - the game was suspended by PLM.
00034 //     Deactivated - the game has lost focus.
00035 //
00036 // GameMain creates and maintains references to three major objects used for the game:
00037 //     MoveLookController (m_controller) - this object handles all the game specific user input and
00038 //         aggregates touch, mouse/keyboard and Xbox controller input into a unified input control.
00039 //     Simple3DGame (m_game) - this object handles all the game specific logic and game dynamics.
00040 //     GameRenderer (m_renderer) - This object handles all the graphics rendering for the game.
00041 //
00042
00043 #pragma once
00044
00045 #include "DeviceResources.h"
00046 #include "MoveLookController.h"
00047 #include "GameRenderer.h"
00048 #include "Simple3DGame.h"
00049 #include "GameUIControl.h"
00050
00051
00052 namespace GameControl
00053 {
00054     private enum class UpdateEngineState
00055     {
00056         WaitingForResources,
00057         ResourcesLoaded,
00058         WaitingForPress,
00059         Dynamics,
00060         TooSmall,
00061         Suspended,
00062         Deactivated,
00063     };
00064
00065     private enum class PressResultState
00066     {
00067         LoadGame,
00068         PlayLevel,
00069         ContinueLevel,
00070     };
00071
00072     private enum class GameInfoOverlayState
00073     {
00074         Loading,
00075         GameStats,
00076         GameOverExpired,
00077         GameOverCompleted,
00078         LevelStart,
00079         Pause,
00080     };
00081 };
00082
00083 class GameMain : public DX::IDeviceNotify
00084 {
00085 public:
00086     GameMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00087     ~GameMain();
00088     void CreateWindowSizeDependentResources();
00089     void Run();
00090     void Suspend();
00091     void Resume();
00092     void Visibility(bool visible);
00093     void Close() { m_windowClosed = true; }
00094
00095     // IDeviceNotify
00096     virtual void OnDeviceLost();
00097     virtual void OnDeviceRestored();
00098
00099     void PauseRequested() { if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };
00100     void PressComplete()  { if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };
00101     void ResetGame();
00102
00103     void WindowActivationChanged(Windows::UI::Core::CoreWindowActivationState activationState);
00104
00105 private:
00106     void SetGameInfoOverlay(GameControl::GameInfoOverlayState state);
00107     void InitializeGameState();
00108     void UpdateLayoutState();
00109     void Update();
00110     void WaitingForResourceLoading();
00111
00112 private:
00113     bool                                                m_windowClosed;
00114     bool                                                m_pauseRequested;
00115     bool                                                m_pressComplete;
00116     bool                                                m_renderNeeded;
00117     bool                                                m_haveFocus;
00118     bool                                                m_visible;
00119
00120     std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00121     Simple3DGameDX::IGameUIControl^                     m_uiControl;
00122
00123     MoveLookController^                                 m_controller;
00124     GameRenderer^                                       m_renderer;
00125     Simple3DGame^                                       m_game;
00126
00127     GameControl::UpdateEngineState                      m_updateState;
00128     GameControl::UpdateEngineState                      m_updateStateNext;
00129     GameControl::PressResultState                       m_pressResult;
00130     GameControl::GameInfoOverlayState                   m_gameInfoOverlayState;
00131     Simple3DGameDX::GameInfoOverlayCommand              m_gameInfoOverlayCommand;
00132     uint32                                              m_loadingCount;
00133 };
00134
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario10_SetCookie Member List

This is the complete list of members for Scenario10_SetCookie, including all inherited members.
Scenario10_SetCookie() | Scenario10_SetCookie
SetCookie_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario10_SetCookie
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario5_GetSingleDevice.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario5_GetSingleDevice.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_GetSingleDevice.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016 #include "Scenario5_GetSingleDevice.g.cpp"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Devices::Enumeration;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario5_GetSingleDevice::Scenario5_GetSingleDevice()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario5_GetSingleDevice::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         resultsListView().ItemsSource(resultCollection);
00034     }
00035
00036     fire_and_forget Scenario5_GetSingleDevice::Page_Loaded(IInspectable const&, RoutedEventArgs const&)
00037     {
00038         auto lifetime = get_strong();
00039
00040         // Pre-populate the text box with an interface id.
00041          DeviceInformationCollection deviceInfoCollection = co_await DeviceInformation::FindAllAsync(DeviceClass::AudioRender);
00042         if (deviceInfoCollection.Size() > 0)
00043         {
00044             // When you want to "save" a DeviceInformation to get it back again later,
00045             // use both the DeviceInformation.Kind and the DeviceInformation.Id.
00046             DeviceInformation info = deviceInfoCollection.GetAt(0);
00047             interfaceIdTextBox().Text(info.Id());
00048             deviceInformationKind = info.Kind();
00049             InformationKindTextBox().Text(to_hstring(deviceInformationKind));
00050             getButton().IsEnabled(true);
00051         }
00052     }
00053
00054     fire_and_forget Scenario5_GetSingleDevice::GetButton_Click(IInspectable const&, RoutedEventArgs const&)
00055     {
00056         auto lifetime = get_strong();
00057         resultCollection.Clear();
00058
00059         hstring interfaceId = interfaceIdTextBox().Text();
00060         getButton().IsEnabled(false);
00061
00062         rootPage.NotifyUser(L"CreateFromIdAsync operation started...", NotifyType::StatusMessage);
00063
00064         try
00065         {
00066             // When you want to "save" a DeviceInformation to get it back again later,
00067             // use both the DeviceInformation.Kind and the DeviceInformation.Id.
00068             DeviceInformation deviceInfo = co_await DeviceInformation::CreateFromIdAsync(interfaceId, nullptr, deviceInformationKind);
00069
00070             rootPage.NotifyUser(L"CreateFromIdAsync operation completed.", NotifyType::StatusMessage);
00071
00072             resultCollection.Append(make<DeviceInformationDisplay>(deviceInfo));
00073         }
00074         catch (hresult_error const& e)
00075         {
00076             if (e.code() == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
00077             {
00078                 rootPage.NotifyUser(L"Invalid Interface Id", NotifyType::ErrorMessage);
00079             }
00080             else
00081             {
00082                 throw;
00083             }
00084         }
00085
00086         getButton().IsEnabled(true);
00087         getButton().Focus(FocusState::Keyboard);
00088     }
00089 }
Generated on Fri Nov 15 2024 22:19:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Model/TripStore.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Model

TripStore.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.Globalization;
00016 using System.Linq;
00017 using System.Text;
00018 using System.Threading.Tasks;
00019 using System.Xml;
00020 using System.Xml.Linq;
00021 using Windows.Storage;
00022 using Windows.Storage.Streams;
00023
00024 namespace AdventureWorks.Model
00025 {
00026     /// <summary>
00027     /// Persistance layer for Trips created with Adventure Works. Writes out and retreives trips
00028     /// from a simple xml format like
00029     /// <root>
00030     ///  <Trip>
00031     ///   <Destination></Destination>
00032     ///   <Description></Description>
00033     ///   <StartDate></StartDate>
00034     ///   <EndDate></EndDate>
00035     ///   <Notes></Notes>
00036     ///  </Trip>
00037     ///  <Trip>
00038     ///   ....
00039     ///  </Trip>
00040     /// </root>
00041     /// </summary>
00042     public class TripStore
00043     {
00044         private bool loaded;
00045
00046         /// <summary>
00047         /// Persist the loaded trips in memory for use in other parts of the application.
00048         /// </summary>
00049         private ObservableCollection<Trip> trips;
00050
00051         public TripStore()
00052         {
00053             loaded = false;
00054             Trips = new ObservableCollection<Trip>();
00055         }
00056
00057         /// <summary>
00058         /// Persisted trips, reloaded across executions of the application
00059         /// </summary>
00060         public ObservableCollection<Trip> Trips
00061         {
00062             get
00063             {
00064                 return trips;
00065             }
00066             private set
00067             {
00068                 trips = value;
00069             }
00070         }
00071
00072         /// <summary>
00073         /// Load trips from a file on first-launch of the app. If the file does not yet exist,
00074         /// pre-seed it with several trips, in order to give the app demonstration data.
00075         /// </summary>
00076         public async Task LoadTrips()
00077         {
00078             // Ensure that we don't load trip data more than once.
00079             if (loaded)
00080             {
00081                 return;
00082             }
00083             loaded = true;
00084
00085             StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
00086             this.trips.Clear();
00087
00088             var item = await folder.TryGetItemAsync("trips.xml");
00089             if (item == null)
00090             {
00091                 // Add some 'starter' trips
00092                 trips.Add(
00093                     new Trip()
00094                     {
00095                         Destination = "London",
00096                         Description = "Trip to London!",
00097                         StartDate = new DateTime(2015, 5, 5),
00098                         EndDate = new DateTime(2015, 5, 15)
00099                     });
00100                 trips.Add(
00101                     new Trip()
00102                     {
00103                         Destination = "Melbourne",
00104                         Description = "Trip to Australia",
00105                         StartDate = new DateTime(2016, 2, 2),
00106                         EndDate = new DateTime(2016, 5, 17),
00107                         Notes = "Bring Sunscreen!"
00108                     });
00109                 trips.Add(
00110                     new Trip()
00111                     {
00112                         Destination = "Yosemite National Park",
00113                         Description = "Trip to Yosemite",
00114                         StartDate = new DateTime(2015, 7, 11),
00115                         EndDate = new DateTime(2015, 7, 19),
00116                         Notes = "Buy some new hiking boots"
00117                     });
00118                 await WriteTrips();
00119                 return;
00120             }
00121
00122             // Load trips out of a simple XML format. For the purposes of this example, we're treating
00123             // parse failures as "no trips exist" which will result in the file being erased.
00124             if (item.IsOfType(StorageItemTypes.File))
00125             {
00126                 StorageFile tripsFile = item as StorageFile;
00127
00128                 string tripXmlText = await FileIO.ReadTextAsync(tripsFile);
00129
00130                 try
00131                 {
00132                     XElement xmldoc = XElement.Parse(tripXmlText);
00133
00134                     var tripElements = xmldoc.Descendants("Trip");
00135                     foreach (var tripElement in tripElements)
00136                     {
00137                         Trip trip = new Trip();
00138
00139                         var destElement = tripElement.Descendants("Destination").FirstOrDefault();
00140                         if (destElement != null)
00141                         {
00142                             trip.Destination = destElement.Value;
00143                         }
00144
00145                         var descElement = tripElement.Descendants("Description").FirstOrDefault();
00146                         if (descElement != null)
00147                         {
00148                             trip.Description = descElement.Value;
00149                         }
00150
00151
00152                         var startElement = tripElement.Descendants("StartDate").FirstOrDefault();
00153                         if (startElement != null)
00154                         {
00155                             DateTime startDate;
00156                             if (DateTime.TryParse(startElement.Value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out startDate))
00157                             {
00158                                 trip.StartDate = startDate;
00159                             }
00160                             else
00161                             {
00162                                 trip.StartDate = null;
00163                             }
00164                         }
00165
00166                         var endElement = tripElement.Descendants("EndDate").FirstOrDefault();
00167                         if (endElement != null)
00168                         {
00169                             DateTime endDate;
00170                             if (DateTime.TryParse(endElement.Value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out endDate))
00171                             {
00172                                 trip.EndDate = endDate;
00173                             }
00174                             else
00175                             {
00176                                 trip.EndDate = null;
00177                             }
00178                         }
00179
00180                         var notesElement = tripElement.Descendants("Notes").FirstOrDefault();
00181                         if (notesElement != null)
00182                         {
00183                             trip.Notes = notesElement.Value;
00184                         }
00185
00186                         Trips.Add(trip);
00187                     }
00188                 }
00189                 catch (XmlException ex)
00190                 {
00191                     System.Diagnostics.Debug.WriteLine(ex.ToString());
00192                     return;
00193                 }
00194
00195             }
00196         }
00197
00198         /// <summary>
00199         /// Delete a trip from the persistent trip store, and save the trips file.
00200         /// </summary>
00201         /// <param name="trip">The trip to delete. If the trip is not an existing trip in the store,
00202         /// will not have an effect.</param>
00203         public async Task DeleteTrip(Trip trip)
00204         {
00205             Trips.Remove(trip);
00206             await WriteTrips();
00207         }
00208
00209         /// <summary>
00210         /// Add a trip to the persistent trip store, and saves the trips data file.
00211         /// </summary>
00212         /// <param name="trip">The trip to save or update in the data file.</param>
00213         public async Task SaveTrip(Trip trip)
00214         {
00215             if (!Trips.Contains(trip))
00216             {
00217                 Trips.Add(trip);
00218             }
00219
00220             await WriteTrips();
00221         }
00222
00223         /// <summary>
00224         /// Write out a new XML file, overwriting the existing one if it already exists
00225         /// with the currently persisted trips. See class comment for basic format.
00226         /// </summary>
00227         private async Task WriteTrips()
00228         {
00229             StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
00230
00231             XElement xmldoc = new XElement("Root");
00232
00233             StorageFile tripsFile;
00234
00235             var item = await folder.TryGetItemAsync("trips.xml");
00236             if (item == null)
00237             {
00238                 tripsFile = await folder.CreateFileAsync("trips.xml");
00239             }
00240             else
00241             {
00242                 tripsFile = await folder.GetFileAsync("trips.xml");
00243             }
00244
00245             foreach (var trip in Trips)
00246             {
00247                 string startDateField = null;
00248                 if (trip.StartDate.HasValue)
00249                 {
00250                     startDateField = trip.StartDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
00251                 }
00252
00253                 string endDateField = null;
00254                 if(trip.EndDate.HasValue)
00255                 {
00256                     endDateField = trip.EndDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
00257                 }
00258
00259                 xmldoc.Add(
00260                     new XElement("Trip",
00261                     new XElement("Destination", trip.Destination),
00262                     new XElement("Description", trip.Description),
00263                     new XElement("StartDate", startDateField),
00264                     new XElement("EndDate", endDateField),
00265                     new XElement("Notes", trip.Notes)));
00266             }
00267
00268             await FileIO.WriteTextAsync(tripsFile, xmldoc.ToString());
00269         }
00270     }
00271 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/Scenario3_SingleFolder.xaml.cs Source File

  • FilePicker
  • cs

Scenario3_SingleFolder.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Storage;
00014 using Windows.Storage.AccessCache;
00015 using Windows.Storage.Pickers;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario3_SingleFolder : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario3_SingleFolder()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private async void PickFolderButton_Click(object sender, RoutedEventArgs e)
00035         {
00036             // Clear previous returned folder name, if it exists, between iterations of this scenario
00037             OutputTextBlock.Text = "";
00038
00039             FolderPicker folderPicker = new FolderPicker();
00040             folderPicker.SuggestedStartLocation = PickerLocationId.Desktop;
00041             folderPicker.FileTypeFilter.Add(".docx");
00042             folderPicker.FileTypeFilter.Add(".xlsx");
00043             folderPicker.FileTypeFilter.Add(".pptx");
00044             StorageFolder folder = await folderPicker.PickSingleFolderAsync();
00045             if (folder != null)
00046             {
00047                 // The StorageFolder has read/write access to all contents in the picked folder (including other sub-folder contents).
00048                 // See the FileAccess sample for code that obtains a StorageFile from a StorageFolder to read and write.
00049                 StorageApplicationPermissions.FutureAccessList.AddOrReplace("PickedFolderToken", folder);
00050                 OutputTextBlock.Text = "Picked folder: " + folder.Name;
00051             }
00052             else
00053             {
00054                 OutputTextBlock.Text = "Operation cancelled.";
00055             }
00056         }
00057     }
00058 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario4_CustomExceptionWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace Microsoft::WRL;
00013 using namespace Microsoft::WRL::Wrappers;
00014 using namespace Microsoft::SDKSamples::Kitchen;
00015 using namespace Windows::Foundation;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace SDKTemplate::WRLOutOfProcessWinRTComponent;
00019
00020 CustomExceptionWRL::CustomExceptionWRL()
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void CustomExceptionWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> myOven;
00028     HRESULT hr = Windows::Foundation::ActivateInstance(HStringReference(
00029         RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &myOven);
00030     if (SUCCEEDED(hr))
00031     {
00032         // Intentionally pass an invalid value
00033         hr = myOven->ConfigurePreheatTemperature((ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature)5);
00034         if (hr == E_INVALIDARG)
00035         {
00036             CustomExceptionWRLOutput->Text += L"Error handled. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00037         }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpatialInputHandler Member List

This is the complete list of members for SpatialInputHandler, including all inherited members.
CheckForInput() | SpatialInputHandler |
m_interactionManager | SpatialInputHandler | [private]
m_sourcePressedEventToken | SpatialInputHandler | [private]
m_sourceState | SpatialInputHandler | [private]
OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | SpatialInputHandler | [private]
SpatialInputHandler() | SpatialInputHandler |
~SpatialInputHandler() | SpatialInputHandler |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
blah() | ScenarioElement | [inline, private]
ButtonUpdate_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/4-XAMLManipulations.xaml.cpp Source File

  • BasicInput
  • cpp

4-XAMLManipulations.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "4-XAMLManipulations.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Devices::Input;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Scenario4::Scenario4() : rootPage(SDKTemplate::MainPage::Current)
00030 {
00031     InitializeComponent();
00032
00033     forceManipulationsToEnd = false;
00034
00035     InitOptions();
00036
00037     // Initialize the transforms that will be used to manipulate the shape
00038     InitManipulationTransforms();
00039
00040     // Register for the various manipulation events that will occur on the shape
00041     manipulateMe->ManipulationStarted += ref new ManipulationStartedEventHandler(this, &Scenario4::ManipulateMe_ManipulationStarted);
00042     manipulateMe->ManipulationDelta += ref new ManipulationDeltaEventHandler(this, &Scenario4::ManipulateMe_ManipulationDelta);
00043     manipulateMe->ManipulationCompleted += ref new ManipulationCompletedEventHandler(this, &Scenario4::ManipulateMe_ManipulationCompleted);
00044     manipulateMe->ManipulationInertiaStarting += ref new ManipulationInertiaStartingEventHandler(this, &Scenario4::ManipulateMe_ManipulationInertiaStarting);
00045
00046     // The ManipulationMode property dictates what manipulation events the element
00047     // will listen to.  This will set it to a limited subset of these events.
00048     manipulateMe->ManipulationMode =
00049         ManipulationModes::TranslateX |
00050         ManipulationModes::TranslateY |
00051         ManipulationModes::Rotate |
00052         ManipulationModes::TranslateInertia |
00053         ManipulationModes::RotateInertia;
00054 }
00055
00056 void Scenario4::InitManipulationTransforms()
00057 {
00058     transforms = ref new TransformGroup();
00059     previousTransform = ref new MatrixTransform();
00060     previousTransform->Matrix = Matrix::Identity;
00061
00062     deltaTransform = ref new CompositeTransform();
00063
00064     transforms->Children->Append(previousTransform);
00065     transforms->Children->Append(deltaTransform);
00066
00067     // Set the render transform on the rect
00068     manipulateMe->RenderTransform = transforms;
00069 }
00070
00071 // When a manipulation begins, change the color of the object to reflect
00072 // that a manipulation is in progress
00073 void Scenario4::ManipulateMe_ManipulationStarted(Platform::Object^ sender, ManipulationStartedRoutedEventArgs^ e)
00074 {
00075     forceManipulationsToEnd = false;
00076     manipulateMe->Background = ref new SolidColorBrush(Windows::UI::Colors::DeepSkyBlue);
00077 }
00078
00079 // Process the change resulting from a manipulation
00080 void Scenario4::ManipulateMe_ManipulationDelta(Platform::Object^ sender, ManipulationDeltaRoutedEventArgs^ e)
00081 {
00082     // If the reset button has been pressed, mark the manipulation as completed
00083     if (forceManipulationsToEnd)
00084     {
00085         e->Complete();
00086         return;
00087     }
00088
00089     previousTransform->Matrix = transforms->Value;
00090
00091     // Get center point for rotation
00092     Point center = previousTransform->TransformPoint(Point(e->Position.X, e->Position.Y));
00093     deltaTransform->CenterX = center.X;
00094     deltaTransform->CenterY = center.Y;
00095
00096     // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
00097     // the rotation, scale, X, and Y changes
00098     deltaTransform->Rotation = e->Delta.Rotation;
00099     deltaTransform->TranslateX = e->Delta.Translation.X;
00100     deltaTransform->TranslateY = e->Delta.Translation.Y;
00101 }
00102
00103 // When a manipulation that's a result of inertia begins, change the color of the
00104 // the object to reflect that inertia has taken over
00105 void Scenario4::ManipulateMe_ManipulationInertiaStarting(Platform::Object^ sender, ManipulationInertiaStartingRoutedEventArgs^ e)
00106 {
00107     manipulateMe->Background = ref new SolidColorBrush(Windows::UI::Colors::RoyalBlue);
00108 }
00109
00110 // When a manipulation has finished, reset the color of the object
00111 void Scenario4::ManipulateMe_ManipulationCompleted(Platform::Object^ sender, ManipulationCompletedRoutedEventArgs^ e)
00112 {
00113     manipulateMe->Background = ref new SolidColorBrush(Windows::UI::Colors::LightGray);
00114 }
00115
00116 void Scenario4::movementAxis_Changed(Platform::Object^ sender, SelectionChangedEventArgs^ e)
00117 {
00118     // Set the object to listen to both X and Y translation events
00119     auto mode = manipulateMe->ManipulationMode;
00120     auto update = ManipulationModes::TranslateX | ManipulationModes::TranslateY;
00121     manipulateMe->ManipulationMode = mode | update;
00122
00123     ComboBox^ cb = dynamic_cast<ComboBox^>(sender);
00124     ComboBoxItem^ selectedItem = dynamic_cast<ComboBoxItem^>((cb)->SelectedItem);
00125
00126     auto selection = selectedItem->Content->ToString();
00127
00128     if (selection == L"X only")
00129     {
00130         // Set the object to not listen for translations on the Y axis
00131         auto mode = manipulateMe->ManipulationMode;
00132         manipulateMe->ManipulationMode = mode ^ ManipulationModes::TranslateY;
00133     }
00134     else if (selection == L"Y only")
00135     {
00136         auto mode = manipulateMe->ManipulationMode;
00137         manipulateMe->ManipulationMode = mode ^ ManipulationModes::TranslateX;
00138
00139     }
00140 }
00141
00142 void Scenario4::InertiaSwitch_Toggled(Platform::Object^ sender, RoutedEventArgs^ e)
00143 {
00144     // Flip the current TranslateInertia and RotateInertia values in response to the
00145     // InertiaSwitch being toggled
00146     if (manipulateMe != nullptr)
00147     {
00148         auto mode = manipulateMe->ManipulationMode;
00149         auto update = ManipulationModes::TranslateInertia | ManipulationModes::RotateInertia;
00150         manipulateMe->ManipulationMode = mode ^ update;
00151     }
00152 }
00153
00154 //
00155 // More UI code below
00156 //
00157 void Scenario4::InitOptions()
00158 {
00159     movementAxis->SelectedIndex = 0;
00160     inertiaSwitch->IsOn = true;
00161 }
00162
00163 void Scenario4::resetButton_Pressed(Platform::Object^ sender, RoutedEventArgs^ e)
00164 {
00165     forceManipulationsToEnd = true;
00166     manipulateMe->RenderTransform = nullptr;
00167     movementAxis->SelectedIndex = 0;
00168     InitOptions();
00169     InitManipulationTransforms();
00170 }
Generated on Fri Nov 15 2024 22:18:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/Scenario1_ReadData.xaml.h Source File

  • IoT-SPI
  • cpp

Scenario1_ReadData.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_GetAndSetPin.xaml.h
00014 //
00015
00016 #pragma once
00017
00018 #include "Scenario1_ReadData.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_ReadData sealed
00024     {
00025     public:
00026         Scenario1_ReadData();
00027         void StartStopScenario_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028
00029     protected:
00030         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         concurrency::task<void> StartScenarioAsync();
00034         void StopScenario();
00035         void Timer_Tick(Platform::Object^ sender, Platform::Object^ e);
00036
00037     private:
00038         Windows::UI::Xaml::DispatcherTimer^ timer;
00039         Windows::Foundation::EventRegistrationToken timerToken;
00040         Windows::Devices::Spi::SpiDevice^ adxl345Sensor;
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario8_CaptureBitmap.xaml.cs Source File

  • XamlWebView
  • cs

Scenario8_CaptureBitmap.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.ObjectModel;
00014 using System.ComponentModel;
00015 using System.Runtime.CompilerServices;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Threading.Tasks;
00018 using Windows.Graphics.Imaging;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Media.Imaging;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace SDKTemplate
00026 {
00027     public sealed partial class Scenario8_CaptureBitmap : Page
00028     {
00029         public Scenario8_CaptureBitmap()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             WebViewControl.Navigate(new Uri("http://www.bing.com"));
00037         }
00038
00039         /// <summary>
00040         /// Captures the WebView into a bitmap.
00041         /// </summary>
00042         /// <param name="sender"></param>
00043         /// <param name="e"></param>
00044         private async void CaptureButton_Click()
00045         {
00046             InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();
00047             await WebViewControl.CapturePreviewToStreamAsync(stream);
00048
00049             // Scale the bitmap to the space available for the thumbnail image,
00050             // preserving aspect ratio.
00051             double thumbnailWidth = ThumbnailImage.Width;
00052             double thumbnailHeight = ThumbnailImage.Height;
00053             double webViewControlWidth = WebViewControl.ActualWidth;
00054             double webViewControlHeight = WebViewControl.ActualHeight;
00055             if (thumbnailWidth == 0 || thumbnailHeight == 0 ||
00056                 webViewControlWidth == 0 || webViewControlHeight == 0)
00057             {
00058                 // Avoid 0x0 bitmaps, which cause all sorts of problems.
00059                 return;
00060             }
00061
00062             double horizontalScale = thumbnailWidth / webViewControlWidth;
00063             double verticalScale = thumbnailHeight / webViewControlHeight;
00064             double scale = Math.Min(horizontalScale, verticalScale);
00065             int width = (int)(webViewControlWidth * scale);
00066             int height = (int)(webViewControlHeight * scale);
00067             BitmapSource thumbnailBitmap = await CreateScaledBitmapFromStreamAsync(width, height, stream);
00068
00069             ThumbnailImage.Source = thumbnailBitmap;
00070         }
00071
00072         static async Task<BitmapSource> CreateScaledBitmapFromStreamAsync(int width, int height, IRandomAccessStream source)
00073         {
00074             WriteableBitmap bitmap = new WriteableBitmap(width, height);
00075             BitmapDecoder decoder = await BitmapDecoder.CreateAsync(source);
00076             BitmapTransform transform = new BitmapTransform();
00077             transform.ScaledHeight = (uint)height;
00078             transform.ScaledWidth = (uint)width;
00079             PixelDataProvider pixelData = await decoder.GetPixelDataAsync(
00080                 BitmapPixelFormat.Bgra8,
00081                 BitmapAlphaMode.Straight,
00082                 transform,
00083                 ExifOrientationMode.RespectExifOrientation,
00084                 ColorManagementMode.DoNotColorManage);
00085             pixelData.DetachPixelData().CopyTo(bitmap.PixelBuffer);
00086             return bitmap;
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_SettingContainer Member List

This is the complete list of members for Scenario3_SettingContainer, including all inherited members.
containerName | Scenario3_SettingContainer | [private]
CreateContainer_Click(Object sender, RoutedEventArgs e) | Scenario3_SettingContainer | [inline, private]
DeleteContainer_Click(Object sender, RoutedEventArgs e) | Scenario3_SettingContainer | [inline, private]
DeleteSetting_Click(Object sender, RoutedEventArgs e) | Scenario3_SettingContainer | [inline, private]
DisplayOutput() | Scenario3_SettingContainer | [inline, private]
localSettings | Scenario3_SettingContainer | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_SettingContainer | [inline, protected]
rootPage | Scenario3_SettingContainer | [private]
Scenario3_SettingContainer() | Scenario3_SettingContainer | [inline]
settingName | Scenario3_SettingContainer | [private]
WriteSetting_Click(Object sender, RoutedEventArgs e) | Scenario3_SettingContainer | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/pch.h Source File

  • 3DPrinting
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.Foundation.Numerics.h"
00007 #include "winrt/Windows.ApplicationModel.h"
00008 #include "winrt/Windows.ApplicationModel.Activation.h"
00009 #include "winrt/Windows.Data.Xml.Dom.h"
00010 #include "winrt/Windows.Graphics.Printing3D.h"
00011 #include "winrt/Windows.Security.Cryptography.h"
00012 #include "winrt/Windows.Storage.h"
00013 #include "winrt/Windows.Storage.Pickers.h"
00014 #include "winrt/Windows.Storage.Streams.h"
00015 #include "winrt/Windows.System.h"
00016 #include "winrt/Windows.UI.Core.h"
00017 #include "winrt/Windows.UI.Xaml.h"
00018 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00019 #include "winrt/Windows.UI.Xaml.Controls.h"
00020 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00021 #include "winrt/Windows.UI.Xaml.Documents.h"
00022 #include "winrt/Windows.UI.Xaml.Interop.h"
00023 #include "winrt/Windows.UI.Xaml.Markup.h"
00024 #include "winrt/Windows.UI.Xaml.Media.h"
00025 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/FileItem.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario1

FileItem.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.Specialized;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Storage;
00008 using Windows.UI.Xaml.Data;
00009 using Windows.UI.Xaml.Media.Imaging;
00010 using System.Diagnostics;
00011 using Windows.Storage.Search;
00012 using Windows.Storage.FileProperties;
00013 using Windows.UI.Core;
00014 using System.Threading;
00015
00016 namespace DataVirtualizationSample
00017 {
00018     /// <summary>
00019     /// Represents a file and its properties
00020     /// </summary>
00021     class FileItem
00022     {
00023         public string Filename { get; set; }
00024         public int Size { get; set; }
00025         public BitmapImage ImageData { get; set; }
00026
00027         public string Key { get; private set; }
00028
00029         // Needed to ensure only one request is in progress at once
00030         private static SemaphoreSlim gettingFileProperties = new SemaphoreSlim(1);
00031
00032         // Fetches all the data for the specified file
00033         public async static Task<FileItem> fromStorageFile(StorageFile f, CancellationToken ct)
00034         {
00035             FileItem item = new FileItem();
00036             item.Filename = f.DisplayName;
00037
00038             // Block to make sure we only have one request outstanding
00039             await gettingFileProperties.WaitAsync();
00040
00041             BasicProperties bp = null;
00042             try
00043             {
00044                 bp = await f.GetBasicPropertiesAsync().AsTask(ct);
00045             }
00046             catch (Exception) { }
00047             finally
00048             {
00049                 gettingFileProperties.Release();
00050             }
00051
00052             ct.ThrowIfCancellationRequested();
00053
00054             item.Size = (int)bp.Size;
00055             item.Key = f.FolderRelativeId;
00056
00057             StorageItemThumbnail thumb = await f.GetThumbnailAsync(ThumbnailMode.SingleItem).AsTask(ct);
00058             ct.ThrowIfCancellationRequested();
00059             BitmapImage img = new BitmapImage();
00060             await img.SetSourceAsync(thumb).AsTask(ct);
00061
00062             item.ImageData = img;
00063             return item;
00064         }
00065     }
00066 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SimpleListView Member List

This is the complete list of members for Scenario1_SimpleListView, including all inherited members.
Scenario1_SimpleListView() Scenario1_SimpleListView [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario3_BackgroundWatcher.xaml.cs Source File

  • BluetoothAdvertisement
  • cs

Scenario3_BackgroundWatcher.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Storage;
00015 using Windows.Storage.Streams;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 using Windows.ApplicationModel.Background;
00021 using Windows.Devices.Bluetooth.Advertisement;
00022 using Windows.Devices.Bluetooth.Background;
00023
00024 using SDKTemplate;
00025
00026 namespace BluetoothAdvertisement
00027 {
00028     /// <summary>
00029     /// An empty page that can be used on its own or navigated to within a Frame.
00030     /// </summary>
00031     public sealed partial class Scenario3_BackgroundWatcher : Page
00032     {
00033         // The background task registration for the background advertisement watcher
00034         private IBackgroundTaskRegistration taskRegistration;
00035         // The watcher trigger used to configure the background task registration
00036         private BluetoothLEAdvertisementWatcherTrigger trigger;
00037         // A name is given to the task in order for it to be identifiable across context.
00038         private string taskName = "Scenario3_BackgroundTask";
00039         // Entry point for the background task.
00040         private string taskEntryPoint = "BackgroundTasks.AdvertisementWatcherTask";
00041
00042         // A pointer back to the main page is required to display status messages.
00043         private MainPage rootPage;
00044
00045         /// <summary>
00046         /// Initializes the singleton application object.  This is the first line of authored code
00047         /// executed, and as such is the logical equivalent of main() or WinMain().
00048         /// </summary>
00049         public Scenario3_BackgroundWatcher()
00050         {
00051             this.InitializeComponent();
00052
00053             // Create and initialize a new trigger to configure it.
00054             trigger = new BluetoothLEAdvertisementWatcherTrigger();
00055
00056             // Configure the advertisement filter to look for the data advertised by the publisher in Scenario 2 or 4.
00057             // You need to run Scenario 2 on another Windows platform within proximity of this one for Scenario 3 to
00058             // take effect.
00059
00060             // Unlike the APIs in Scenario 1 which operate in the foreground. This API allows the developer to register a background
00061             // task to process advertisement packets in the background. It has more restrictions on valid filter configuration.
00062             // For example, exactly one single matching filter condition is allowed (no more or less) and the sampling interval
00063
00064             // For determining the filter restrictions programatically across APIs, use the following properties:
00065             //      MinSamplingInterval, MaxSamplingInterval, MinOutOfRangeTimeout, MaxOutOfRangeTimeout
00066
00067             // Part 1A: Configuring the advertisement filter to watch for a particular advertisement payload
00068
00069             // First, let create a manufacturer data section we wanted to match for. These are the same as the one
00070             // created in Scenario 2 and 4. Note that in the background only a single filter pattern is allowed per trigger.
00071             var manufacturerData = new BluetoothLEManufacturerData();
00072
00073             // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
00074             manufacturerData.CompanyId = 0xFFFE;
00075
00076             // Finally set the data payload within the manufacturer-specific section
00077             // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
00078             DataWriter writer = new DataWriter();
00079             writer.WriteUInt16(0x1234);
00080
00081             // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
00082             manufacturerData.Data = writer.DetachBuffer();
00083
00084             // Add the manufacturer data to the advertisement filter on the trigger:
00085             trigger.AdvertisementFilter.Advertisement.ManufacturerData.Add(manufacturerData);
00086
00087             // Part 1B: Configuring the signal strength filter for proximity scenarios
00088
00089             // Configure the signal strength filter to only propagate events when in-range
00090             // Please adjust these values if you cannot receive any advertisement
00091             // Set the in-range threshold to -70dBm. This means advertisements with RSSI >= -70dBm
00092             // will start to be considered "in-range".
00093             trigger.SignalStrengthFilter.InRangeThresholdInDBm = -70;
00094
00095             // Set the out-of-range threshold to -75dBm (give some buffer). Used in conjunction with OutOfRangeTimeout
00096             // to determine when an advertisement is no longer considered "in-range"
00097             trigger.SignalStrengthFilter.OutOfRangeThresholdInDBm = -75;
00098
00099             // Set the out-of-range timeout to be 2 seconds. Used in conjunction with OutOfRangeThresholdInDBm
00100             // to determine when an advertisement is no longer considered "in-range"
00101             trigger.SignalStrengthFilter.OutOfRangeTimeout = TimeSpan.FromMilliseconds(2000);
00102
00103             // By default, the sampling interval is set to be disabled, or the maximum sampling interval supported.
00104             // The sampling interval set to MaxSamplingInterval indicates that the event will only trigger once after it comes into range.
00105             // Here, set the sampling period to 1 second, which is the minimum supported for background.
00106             trigger.SignalStrengthFilter.SamplingInterval = TimeSpan.FromMilliseconds(1000);
00107         }
00108
00109         /// <summary>
00110         /// Invoked when this page is about to be displayed in a Frame.
00111         ///
00112         /// We will enable/disable parts of the UI if the device doesn't support it.
00113         /// </summary>
00114         /// <param name="eventArgs">Event data that describes how this page was reached. The Parameter
00115         /// property is typically used to configure the page.</param>
00116         protected override void OnNavigatedTo(NavigationEventArgs e)
00117         {
00118             rootPage = MainPage.Current;
00119
00120             // Get the existing task if already registered
00121             if (taskRegistration == null)
00122             {
00123                 // Find the task if we previously registered it
00124                 foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
00125                 {
00126                     if (task.Name == taskName)
00127                     {
00128                         taskRegistration = task;
00129                         taskRegistration.Completed += OnBackgroundTaskCompleted;
00130                         break;
00131                     }
00132                 }
00133             }
00134             else
00135             {
00136                 taskRegistration.Completed += OnBackgroundTaskCompleted;
00137             }
00138
00139             // Attach handlers for suspension to stop the watcher when the App is suspended.
00140             App.Current.Suspending += App_Suspending;
00141             App.Current.Resuming += App_Resuming;
00142
00143             rootPage.NotifyUser("Press Run to register watcher.", NotifyType.StatusMessage);
00144         }
00145
00146         /// <summary>
00147         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00148         /// </summary>
00149         /// <param name="e">
00150         /// Event data that can be examined by overriding code. The event data is representative
00151         /// of the navigation that will unload the current Page unless canceled. The
00152         /// navigation can potentially be canceled by setting Cancel.
00153         /// </param>
00154         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00155         {
00156             // Remove local suspension handlers from the App since this page is no longer active.
00157             App.Current.Suspending -= App_Suspending;
00158             App.Current.Resuming -= App_Resuming;
00159
00160             // Since the watcher is registered in the background, the background task will be triggered when the App is closed
00161             // or in the background. To unregister the task, press the Stop button.
00162             if (taskRegistration != null)
00163             {
00164                 // Always unregister the handlers to release the resources to prevent leaks.
00165                 taskRegistration.Completed -= OnBackgroundTaskCompleted;
00166             }
00167             base.OnNavigatingFrom(e);
00168         }
00169
00170         /// <summary>
00171         /// Invoked when application execution is being suspended.  Application state is saved
00172         /// without knowing whether the application will be terminated or resumed with the contents
00173         /// of memory still intact.
00174         /// </summary>
00175         /// <param name="sender">The source of the suspend request.</param>
00176         /// <param name="e">Details about the suspend request.</param>
00177         private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00178         {
00179             if (taskRegistration != null)
00180             {
00181                 // Always unregister the handlers to release the resources to prevent leaks.
00182                 taskRegistration.Completed -= OnBackgroundTaskCompleted;
00183             }
00184             rootPage.NotifyUser("App suspending.", NotifyType.StatusMessage);
00185         }
00186
00187         /// <summary>
00188         /// Invoked when application execution is being resumed.
00189         /// </summary>
00190         /// <param name="sender">The source of the resume request.</param>
00191         /// <param name="e"></param>
00192         private void App_Resuming(object sender, object e)
00193         {
00194             // Get the existing task if already registered
00195             if (taskRegistration == null)
00196             {
00197                 // Find the task if we previously registered it
00198                 foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
00199                 {
00200                     if (task.Name == taskName)
00201                     {
00202                         taskRegistration = task;
00203                         taskRegistration.Completed += OnBackgroundTaskCompleted;
00204                         break;
00205                     }
00206                 }
00207             }
00208             else
00209             {
00210                 taskRegistration.Completed += OnBackgroundTaskCompleted;
00211             }
00212         }
00213
00214         /// <summary>
00215         /// Invoked as an event handler when the Run button is pressed.
00216         /// </summary>
00217         /// <param name="sender">Instance that triggered the event.</param>
00218         /// <param name="e">Event data describing the conditions that led to the event.</param>
00219         private async void RunButton_Click(object sender, RoutedEventArgs e)
00220         {
00221             // Registering a background trigger if it is not already registered. It will start background scanning.
00222             // First get the existing tasks to see if we already registered for it
00223             if (taskRegistration != null)
00224             {
00225                 rootPage.NotifyUser("Background watcher already registered.", NotifyType.StatusMessage);
00226                 return;
00227             }
00228             else
00229             {
00230                 // Applications registering for background trigger must request for permission.
00231                 BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();
00232                 // Here, we do not fail the registration even if the access is not granted. Instead, we allow
00233                 // the trigger to be registered and when the access is granted for the Application at a later time,
00234                 // the trigger will automatically start working again.
00235
00236                 // At this point we assume we haven't found any existing tasks matching the one we want to register
00237                 // First, configure the task entry point, trigger and name
00238                 var builder = new BackgroundTaskBuilder();
00239                 builder.TaskEntryPoint = taskEntryPoint;
00240                 builder.SetTrigger(trigger);
00241                 builder.Name = taskName;
00242
00243                 // Now perform the registration. The registration can throw an exception if the current
00244                 // hardware does not support background advertisement offloading
00245                 try
00246                 {
00247                     taskRegistration = builder.Register();
00248
00249                     // For this scenario, attach an event handler to display the result processed from the background task
00250                     taskRegistration.Completed += OnBackgroundTaskCompleted;
00251
00252                     // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
00253                     if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
00254                     {
00255                         rootPage.NotifyUser("Background watcher registered.", NotifyType.StatusMessage);
00256                     }
00257                     else
00258                     {
00259                         rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
00260                     }
00261                 }
00262                 catch (Exception ex)
00263                 {
00264                     switch ((uint)ex.HResult)
00265                     {
00266                         case (0x80070032): // ERROR_NOT_SUPPORTED
00267                             rootPage.NotifyUser("The hardware does not support background advertisement offload.", NotifyType.ErrorMessage);
00268                             break;
00269                         default:
00270                             throw ex;
00271                     }
00272                 }
00273             }
00274         }
00275
00276         /// <summary>
00277         /// Invoked as an event handler when the Stop button is pressed.
00278         /// </summary>
00279         /// <param name="sender">Instance that triggered the event.</param>
00280         /// <param name="e">Event data describing the conditions that led to the event.</param>
00281         private void StopButton_Click(object sender, RoutedEventArgs e)
00282         {
00283             // Unregistering the background task will stop scanning if this is the only client requesting scan
00284             // First get the existing tasks to see if we already registered for it
00285             if (taskRegistration != null)
00286             {
00287                 taskRegistration.Unregister(true);
00288                 taskRegistration = null;
00289                 rootPage.NotifyUser("Background watcher unregistered.", NotifyType.StatusMessage);
00290             }
00291             else
00292             {
00293                 // At this point we assume we haven't found any existing tasks matching the one we want to unregister
00294                 rootPage.NotifyUser("No registered background watcher found.", NotifyType.StatusMessage);
00295             }
00296         }
00297
00298         /// <summary>
00299         /// Handle background task completion.
00300         /// </summary>
00301         /// <param name="task">The task that is reporting completion.</param>
00302         /// <param name="e">Arguments of the completion report.</param>
00303         private async void OnBackgroundTaskCompleted(BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs eventArgs)
00304         {
00305             // We get the advertisement(s) processed by the background task
00306             if (ApplicationData.Current.LocalSettings.Values.Keys.Contains(taskName))
00307             {
00308                 string backgroundMessage = (string) ApplicationData.Current.LocalSettings.Values[taskName];
00309                 // Serialize UI update to the main UI thread
00310                 await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00311                 {
00312                     // Display these information on the list
00313                     ReceivedAdvertisementListBox.Items.Add(backgroundMessage);
00314                 });
00315             }
00316         }
00317     }
00318 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/SampleConfiguration.cs Source File

  • ActivitySensor
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Activity sensor";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Current activity", ClassType = typeof(Scenario1_CurrentActivity) },
00025             new Scenario() { Title = "Activity history", ClassType = typeof(Scenario2_History) },
00026             new Scenario() { Title = "Events", ClassType = typeof(Scenario3_ChangeEvents) },
00027             new Scenario() { Title = "Background activity", ClassType = typeof(Scenario4_BackgroundActivity) },
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario4.xaml.h Source File

  • FolderEnumeration
  • cpp

Scenario4.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario4.xaml.h
00013 // Declaration of the Scenario4 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario4.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     [Windows::Foundation::Metadata::WebHostHidden]
00025     public ref class Scenario4 sealed
00026     {
00027     public:
00028         Scenario4();
00029
00030     protected:
00031         void GetFilesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         Windows::UI::Xaml::Controls::TextBlock^ CreateLineItemTextBlock(Platform::String^ contents);
00033     };
00034 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SignIn.xaml.cpp Source File

  • KeyCredentialManager
  • cpp

SignIn.xaml.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SignIn.xaml.h"
00003
00004 using namespace concurrency;
00005 using namespace Platform;
00006 using namespace SDKTemplate;
00007 using namespace Windows::Security::Credentials;
00008 using namespace Windows::UI::Xaml::Media;
00009 using namespace Windows::UI::Xaml;
00010 using namespace Windows::UI;
00011 using namespace Windows::Storage::Streams;
00012 using namespace Windows::Security::Cryptography;
00013 using namespace Windows::UI::Xaml::Interop;
00014 using namespace Windows::UI::Xaml::Navigation;
00015
00016 SignIn::SignIn()
00017 {
00018     InitializeComponent();
00019 }
00020
00021 void SignIn::OnNavigatedTo(NavigationEventArgs^ e)
00022 {
00023     rootPage = MainPage::Current;
00024     PassportAvailableCheckAsync().then([this, e]()
00025     {
00026         if (e->Parameter != nullptr)
00027         {
00028             m_account = (Account^)e->Parameter;
00029             textbox_Username->Text = m_account->Email;
00030             textbox_Username->IsEnabled = false;
00031             m_addingAccount = false;
00032
00033             if (m_account->UsesPassport)
00034             {
00035                 SignInPassportAsync(true);
00036             }
00037         }
00038     });
00039 }
00040
00041 void SignIn::Button_SignIn_Click(Object^ sender, RoutedEventArgs^ e)
00042 {
00043     SignInPasswordAsync(false);
00044 }
00045
00046 void SignIn::Button_Passport_Click(Object^ sender, RoutedEventArgs^ e)
00047 {
00048     if (m_addingAccount == false)
00049     {
00050         SignInPassportAsync(m_account->UsesPassport);
00051     }
00052     else
00053     {
00054         SignInPassportAsync(false);
00055     }
00056 }
00057
00058 task<void> SignIn::PassportAvailableCheckAsync()
00059 {
00060     return create_task(KeyCredentialManager::IsSupportedAsync()).then([this](bool keyCredentialAvailable)
00061     {
00062         if (keyCredentialAvailable)
00063         {
00064             button_PassportSignIn->IsEnabled = true;
00065         }
00066         else
00067         {
00068             //
00069             // Key credential is not enabled yet as user
00070             // needs to connect to a MSA account and select a pin in the connecting flow.
00071             //
00072             textblock_PassportStatusText->Text = "Microsoft Passport is not set up.\nPlease go to Windows Settings and connect an MSA account or set up a PIN!";
00073             m_passportAvailable = false;
00074             grid_PassportStatus->Background = ref new SolidColorBrush(ColorHelper::FromArgb(255,50,170,207));
00075         }
00076     });
00077 }
00078
00079 task<void> SignIn::SignInPassportAsync(bool passportIsPrimaryLogin)
00080 {
00081     if (passportIsPrimaryLogin)
00082     {
00083         return AuthenticatePassportAsync().then([this](bool result)
00084         {
00085             if (result)
00086             {
00087                 SuccessfulSignIn(m_account);
00088             }
00089         }, task_continuation_context::use_current());
00090     }
00091     else
00092     {
00093         return SignInPasswordAsync(true).then([this](bool result)
00094         {
00095             if (result)
00096             {
00097                 return CreatePassportKeyAsync(textbox_Username->Text).then([this](bool result)
00098                 {
00099                     if (result)
00100                     {
00101                         return AddPassportToAccountOnServerAsync().then([this](bool serverAddedPassportToAccount)
00102                         {
00103                             if (serverAddedPassportToAccount)
00104                             {
00105                                 rootPage->NotifyUser("Successfully signed in with Microsoft Passport!", NotifyType::StatusMessage);
00106                                 if (m_addingAccount)
00107                                 {
00108                                     Account^ goodAccount = ref new Account();
00109                                     goodAccount->Name = textbox_Username->Text;
00110                                     goodAccount->Email = textbox_Username->Text;
00111                                     goodAccount->UsesPassport = true;
00112                                     SuccessfulSignIn(goodAccount);
00113                                 }
00114                                 else
00115                                 {
00116                                     m_account->UsesPassport = true;
00117                                     SuccessfulSignIn(m_account);
00118                                 }
00119                             }
00120                         });
00121                     }
00122                     else
00123                     {
00124                         return task_from_result();
00125                     }
00126                 });
00127             }
00128             else
00129             {
00130                 textblock_ErrorField->Text = "Sign In with Passport failed. Try later.";
00131                 button_PassportSignIn->IsEnabled = false;
00132                 return task_from_result();
00133             }
00134         }, task_continuation_context::use_current());
00135     }
00136 }
00137
00138 task<bool> SignIn::SignInPasswordAsync(bool calledFromPassport)
00139 {
00140     textblock_ErrorField->Text = "";
00141
00142     if (textbox_Username->Text->IsEmpty() || passwordbox_Password->Password->IsEmpty())
00143     {
00144         textblock_ErrorField->Text = "Username/Password cannot be blank.";
00145         return task_from_result(false);
00146     }
00147
00148     return AuthenticatePasswordCredentialsAsync().then([this, calledFromPassport](bool signedIn)
00149     {
00150         if (!signedIn)
00151         {
00152             textblock_ErrorField->Text = "Unable to sign you in with those credentials.";
00153             return false;
00154         }
00155         else
00156         {
00157             // Developer TODO: Roaming Passport settings. Make it so the server can tell if they prefer to use Passport and upsell immediately.
00158
00159             Account^ goodAccount = ref new Account();
00160             goodAccount->Name = textbox_Username->Text;
00161             goodAccount->Email = textbox_Username->Text;
00162             goodAccount->UsesPassport = true;
00163             if (!calledFromPassport)
00164             {
00165                 rootPage->NotifyUser("Successfully signed in with traditional username/password!", NotifyType::StatusMessage);
00166                 goodAccount->UsesPassport = false;
00167                 SuccessfulSignIn(goodAccount);
00168             }
00169             return true;
00170         }
00171     }, task_continuation_context::use_current()).then([this](task<bool> previousTask)
00172     {
00173         try
00174         {
00175             return previousTask.get();
00176         }
00177         catch (Platform::Exception^ e)
00178         {
00179             rootPage->NotifyUser(e->Message, NotifyType::ErrorMessage);
00180             return false;
00181         }
00182     });
00183 }
00184
00185 task<bool> SignIn::AuthenticatePasswordCredentialsAsync()
00186 {
00187     // Developer TODO: Authenticate with server
00188     return task_from_result(true, task_continuation_context::use_current());
00189 }
00190
00191 task<bool> SignIn::AuthenticatePassportAsync()
00192 {
00193     IBuffer^ message = CryptographicBuffer::ConvertStringToBinary("LoginAuth", BinaryStringEncoding::Utf8);
00194     return GetPassportAuthenticationMessageAsync(message, m_account->Email).then([this](IBuffer^ authMessage)
00195     {
00196         return authMessage != nullptr;
00197     });
00198 }
00199
00200 void SignIn::SuccessfulSignIn(Account^ account)
00201 {
00202     // If this is an already existing account, replace the old
00203     // version of this account in the account list.
00204     if (m_addingAccount == false)
00205     {
00206         for (unsigned int i = 0; i < UserSelect::m_accountList->Size; i++)
00207         {
00208             Account^ a = UserSelect::m_accountList->GetAt(i);
00209             if (a->Email == account->Email)
00210             {
00211                 UserSelect::m_accountList->GetAt(i)->UsesPassport = a->UsesPassport;
00212                 break;
00213             }
00214         }
00215     }
00216     else
00217     {
00218         UserSelect::m_accountList->Append(account);
00219     }
00220
00221     TypeName contentType = { "SDKTemplate.Content", TypeKind::Custom };
00222     this->Frame->Navigate(contentType, account);
00223 }
00224
00225 task<bool> SignIn::AddPassportToAccountOnServerAsync()
00226 {
00227     // Developer TODO: Add Passport signing info to server
00228     return task_from_result(true, task_continuation_context::use_current());
00229 }
00230
00231 task<bool> SignIn::CreatePassportKeyAsync(String^ accountId)
00232 {
00233     return create_task(KeyCredentialManager::RequestCreateAsync(accountId, KeyCredentialCreationOption::ReplaceExisting))
00234         .then([this](KeyCredentialRetrievalResult^ keyCreationResult)
00235     {
00236         if (keyCreationResult->Status == KeyCredentialStatus::Success)
00237         {
00238             rootPage->NotifyUser("Successfully made key", NotifyType::StatusMessage);
00239
00240             KeyCredential^ userKey = keyCreationResult->Credential;
00241             return create_task(userKey->GetAttestationAsync())
00242                 .then([this](KeyCredentialAttestationResult^ keyAttestationResult)
00243             {
00244                 IBuffer^ keyAttestation = nullptr;
00245                 IBuffer^ certificateChain = nullptr;
00246                 bool keyAttestationIncluded = false;
00247                 bool keyAttestationCanBeRetrievedLater = false;
00248                 KeyCredentialAttestationStatus keyAttestationRetryType = KeyCredentialAttestationStatus::Success;
00249
00250                 if (keyAttestationResult->Status == KeyCredentialAttestationStatus::Success)
00251                 {
00252                     keyAttestationIncluded = true;
00253                     keyAttestation = keyAttestationResult->AttestationBuffer;
00254                     certificateChain = keyAttestationResult->CertificateChainBuffer;
00255                     rootPage->NotifyUser("Successfully made key and attestation", NotifyType::StatusMessage);
00256                 }
00257                 else if (keyAttestationResult->Status == KeyCredentialAttestationStatus::TemporaryFailure)
00258                 {
00259                     keyAttestationRetryType = KeyCredentialAttestationStatus::TemporaryFailure;
00260                     keyAttestationCanBeRetrievedLater = true;
00261                     rootPage->NotifyUser("Successfully made key but not attestation", NotifyType::StatusMessage);
00262                 }
00263                 else if (keyAttestationResult->Status == KeyCredentialAttestationStatus::NotSupported)
00264                 {
00265                     keyAttestationRetryType = KeyCredentialAttestationStatus::NotSupported;
00266                     keyAttestationCanBeRetrievedLater = false;
00267                     rootPage->NotifyUser("Key created, but key attestation not supported", NotifyType::StatusMessage);
00268                 }
00269
00270                 // Package public key, keyAttesation if available,
00271                 // certificate chain for attestation endorsement key if available,
00272                 // status code of key attestation result: keyAttestationIncluded or
00273                 // keyAttestationCanBeRetrievedLater and keyAttestationRetryType
00274                 // and send it to application server to register the user.
00275                 return AddPassportToAccountOnServerAsync();
00276             });
00277         }
00278         else if (keyCreationResult->Status == KeyCredentialStatus::UserCanceled)
00279         {
00280             // User cancelled the Passport enrollment process
00281         }
00282         else if (keyCreationResult->Status == KeyCredentialStatus::NotFound)
00283         {
00284             // User needs to create PIN
00285             textblock_PassportStatusText->Text = "Microsoft Passport is almost ready!\nPlease go to Windows Settings and set up/reset your PIN to use it.";
00286
00287             grid_PassportStatus->Background = ref new SolidColorBrush(ColorHelper::FromArgb(255, 50, 170, 207));
00288             button_PassportSignIn->IsEnabled = false;
00289
00290             m_passportAvailable = false;
00291         }
00292         else
00293         {
00294             rootPage->NotifyUser(keyCreationResult->Status.ToString(), NotifyType::ErrorMessage);
00295         }
00296         return task_from_result(false, task_continuation_context::use_current());
00297     });
00298 }
00299
00300 task<IBuffer^> SignIn::GetPassportAuthenticationMessageAsync(IBuffer^ message, String^ accountId)
00301 {
00302     return create_task(KeyCredentialManager::OpenAsync(accountId))
00303         .then([this, message](KeyCredentialRetrievalResult^ openKeyResult)
00304     {
00305         if (openKeyResult->Status == KeyCredentialStatus::Success)
00306         {
00307             KeyCredential^ userKey = openKeyResult->Credential;
00308
00309             return create_task(userKey->RequestSignAsync(message))
00310                 .then([this, message](KeyCredentialOperationResult^ signResult)
00311             {
00312                 if (signResult->Status == KeyCredentialStatus::Success)
00313                 {
00314                     return signResult->Result;
00315                 }
00316                 else if (signResult->Status == KeyCredentialStatus::UserCanceled)
00317                 {
00318                     // User cancelled the Passport PIN entry.
00319                     //
00320                     // We will return null below this and the username/password
00321                     // sign in form will show.
00322                 }
00323                 else if (signResult->Status == KeyCredentialStatus::NotFound)
00324                 {
00325                     // Must recreate Passport key
00326                 }
00327                 else if (signResult->Status == KeyCredentialStatus::SecurityDeviceLocked)
00328                 {
00329                     // Can't use Passport right now, remember that hardware failed and suggest restart
00330                 }
00331                 else if (signResult->Status == KeyCredentialStatus::UnknownError)
00332                 {
00333                     // Can't use Passport right now, try again later
00334                 }
00335                 return static_cast<IBuffer^>(nullptr);
00336             });
00337         }
00338         else if (openKeyResult->Status == KeyCredentialStatus::NotFound)
00339         {
00340             // Passport key lost, need to recreate it
00341             m_passportAvailable = false;
00342         }
00343         else
00344         {
00345             // Can't use Passport right now, try again later
00346         }
00347         return task_from_result<IBuffer^>(nullptr);
00348     });
00349 }
Generated on Fri Nov 15 2024 22:20:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/Scenario2_Launch.xaml.cs Source File

  • ResizeAppView
  • cs

Scenario2_Launch.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.ViewManagement;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario2_Launch : Page
00020     {
00021         public Scenario2_Launch()
00022         {
00023             this.InitializeComponent();
00024             LaunchAtSize.IsChecked = ApplicationView.PreferredLaunchWindowingMode != ApplicationViewWindowingMode.Auto;
00025         }
00026
00027         // If you set the PreferredLaunchViewSize and PreferredLaunchWindowingMode
00028         // before calling Window.Current.Activate(), then it will take effect
00029         // on the current launch. Otherwise, it takes effect at the next launch.
00030         private void LaunchAtSize_Click(object sender, RoutedEventArgs e)
00031         {
00032             if (LaunchAtSize.IsChecked.Value)
00033             {
00034                 // For best results, set the PreferredLaunchViewSize before setting
00035                 // the PreferredLaunchWindowingMode.
00036                 ApplicationView.PreferredLaunchViewSize = new Size { Width = 600, Height = 500 };
00037                 ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
00038             }
00039             else
00040             {
00041                 ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
00042             }
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario3_CurrencyFormatting.cpp Source File

  • NumberFormatting
  • cppwinrt

Scenario3_CurrencyFormatting.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_CurrencyFormatting.h"
00014 #include "Scenario3_CurrencyFormatting.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::NumberFormatting;
00020 using namespace Windows::System::UserProfile;
00021 using namespace Windows::UI::Xaml;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario3_CurrencyFormatting::Scenario3_CurrencyFormatting()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario3_CurrencyFormatting::Display_Click(IInspectable const&, RoutedEventArgs const&)
00031     {
00032         // This scenario uses the Windows.Globalization.NumberFormatting.CurrencyFormatter class
00033         // to format a number as a currency.
00034
00035         // Determine the current user's default currency.
00036         auto userCurrency = GlobalizationPreferences::Currencies().GetAt(0);
00037
00038         // Generate numbers used for formatting.
00039         long long wholeNumber = 12345;
00040         double fractionalNumber = 12345.67;
00041
00042         // Create formatter initialized using the current user's preference settings for number formatting.
00043         CurrencyFormatter userCurrencyFormat(userCurrency);
00044         hstring currencyDefault = userCurrencyFormat.Format(fractionalNumber);
00045
00046         // Create a formatter initialized to a specific currency, in this case it's the US Dollar, but with the default number formatting for the current user.
00047         CurrencyFormatter currencyFormatUSD (CurrencyIdentifiers::USD());  // Specified as an ISO 4217 code.
00048         hstring currencyUSD = currencyFormatUSD.Format(fractionalNumber);
00049
00050         // Create a formatter initialized to a specific currency, in this case it's the Euro with the default number formatting for France.
00051         CurrencyFormatter currencyFormatEuroFR(CurrencyIdentifiers::EUR(), { L"fr-FR" }, L"FR");
00052         hstring currencyEuroFR = currencyFormatEuroFR.Format(fractionalNumber);
00053
00054         // Create a formatter initialized to a specific currency, in this case it's the Euro with the default number formatting for Ireland.
00055         CurrencyFormatter currencyFormatEuroIE(CurrencyIdentifiers::EUR(), { L"gd-IE" }, L"IE");
00056         hstring currencyEuroIE = currencyFormatEuroIE.Format(fractionalNumber);
00057
00058         // Formatted so that fraction digits are always included.
00059         CurrencyFormatter currencyFormatUSD1(CurrencyIdentifiers::USD());
00060         currencyFormatUSD1.FractionDigits(2);
00061         hstring currencyUSD1 = currencyFormatUSD1.Format(wholeNumber);
00062
00063         // Formatted so that integer grouping separators are included.
00064         CurrencyFormatter currencyFormatUSD2(CurrencyIdentifiers::USD());
00065         currencyFormatUSD2.IsGrouped(true);
00066         hstring currencyUSD2 = currencyFormatUSD2.Format(fractionalNumber);
00067
00068         // Formatted using currency code instead of currency symbol
00069         CurrencyFormatter currencyFormatEuroModeSwitch(CurrencyIdentifiers::EUR());
00070         currencyFormatEuroModeSwitch.Mode(CurrencyFormatterMode::UseCurrencyCode);
00071         hstring currencyEuroCode = currencyFormatEuroModeSwitch.Format(fractionalNumber);
00072
00073         // Return back to currency symbol
00074         currencyFormatEuroModeSwitch.Mode(CurrencyFormatterMode::UseSymbol);
00075         hstring currencyEuroSymbol = currencyFormatEuroModeSwitch.Format(fractionalNumber);
00076
00077         // Display the results.
00078         std::wostringstream results;
00079         results <<
00080             L"Fixed number (" << fractionalNumber << L")" << std::endl <<
00081             L"With user's default currency: " << std::wstring_view(currencyDefault) << std::endl <<
00082             L"Formatted US Dollar: " << std::wstring_view(currencyUSD) << std::endl <<
00083             L"Formatted Euro (fr-FR defaults): " << std::wstring_view(currencyEuroFR) << std::endl <<
00084             L"Formatted Euro (gd-IE defaults): " << std::wstring_view(currencyEuroIE) << std::endl <<
00085             L"Formatted US Dollar (with fractional digits): " << std::wstring_view(currencyUSD1) << std::endl <<
00086             L"Formatted US Dollar (with grouping separators): " << std::wstring_view(currencyUSD2) << std::endl <<
00087             L"Formatted Euro (as currency code): " << std::wstring_view(currencyEuroCode) << std::endl <<
00088             L"Formatted Euro (as symbol): " << std::wstring_view(currencyEuroSymbol);
00089
00090         OutputTextBlock().Text(results.str());
00091     }
00092 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/SampleConfiguration.h Source File

  • LanguageFont
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     template<typename T>
00018     void ApplyLanguageFont(T const& element, Windows::Globalization::Fonts::LanguageFont const& languageFont)
00019     {
00020         element.FontFamily({ languageFont.FontFamily() });
00021         element.FontWeight(languageFont.FontWeight());
00022         element.FontStyle(languageFont.FontStyle());
00023         element.FontStretch(languageFont.FontStretch());
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GameHud Member List

This is the complete list of members for GameHud, including all inherited members.
__pad0__ | GameHud |
CreateDeviceDependentResources() | GameHud |
CreateDeviceDependentResources() | GameHud |
CreateDeviceDependentResources() | GameHud |
CreateWindowSizeDependentResources() | GameHud |
CreateWindowSizeDependentResources() | GameHud |
CreateWindowSizeDependentResources() | GameHud |
GameHud(_In_ std::shared_ptr< DX::DeviceResources > const &deviceResources, _In_ winrt::hstring const &titleHeader, _In_ winrt::hstring const &titleBody) | GameHud |
GameHud(GameHud const &) | GameHud |
m_deviceResources | GameHud | [private]
m_licenseInfoChanged | GameHud | [private]
m_logoBitmap | GameHud | [private]
m_logoBitmap | GameHud | [private]
m_logoSize | GameHud | [private]
m_maxTitleSize | GameHud | [private]
m_showTitle | GameHud | [private]
m_textBrush | GameHud | [private]
m_textBrush | GameHud | [private]
m_textBrushGrey | GameHud | [private]
m_textFormatBody | GameHud | [private]
m_textFormatBody | GameHud | [private]
m_textFormatBodySymbol | GameHud | [private]
m_textFormatBodySymbol | GameHud | [private]
m_textFormatTitleBody | GameHud | [private]
m_textFormatTitleBody | GameHud | [private]
m_textFormatTitleHeader | GameHud | [private]
m_textFormatTitleHeader | GameHud | [private]
m_textFormatTitleLicense | GameHud | [private]
m_titleBody | GameHud | [private]
m_titleBody | GameHud | [private]
m_titleBodyLayout | GameHud | [private]
m_titleBodyLayout | GameHud | [private]
m_titleBodyVerticalOffset | GameHud | [private]
m_titleHeader | GameHud | [private]
m_titleHeader | GameHud | [private]
m_titleHeaderLayout | GameHud | [private]
m_titleHeaderLayout | GameHud | [private]
m_titleLicenseInfo | GameHud | [private]
m_titleLicenseInfoLayout | GameHud | [private]
m_titleLicenseVerticalOffset | GameHud | [private]
operator=(GameHud const &) | GameHud |
ReleaseDeviceDependentResources() | GameHud |
ReleaseDeviceDependentResources() | GameHud |
ReleaseDeviceDependentResources() | GameHud |
Render(_In_ Simple3DGame^game) | GameHud |
Render(_In_ std::shared_ptr< Simple3DGame > const &game) | GameHud |
Render(_In_ Simple3DGame^game) | GameHud |
SetLicenseInfo(_In_ Platform::String^licenseInfo) | GameHud |
titleBody | GameHud |
titleHeader | GameHud |
titleLicenseInfo | GameHud |
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.h Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     inline void ThrowIfFailed(HRESULT hr)
00017     {
00018         if (FAILED(hr))
00019         {
00020             // Set a breakpoint on this line to catch Win32 API errors.
00021             throw Platform::Exception::CreateException(hr);
00022         }
00023     }
00024
00025     // Function that reads from a binary file asynchronously.
00026     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00027     {
00028         using namespace Windows::Storage;
00029         using namespace Concurrency;
00030
00031         Windows::Storage::StorageFolder^ folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
00032
00033         return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([] (StorageFile^ file)
00034         {
00035             return FileIO::ReadBufferAsync(file);
00036         }).then([] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00037         {
00038             std::vector<byte> returnBuffer;
00039             returnBuffer.resize(fileBuffer->Length);
00040             Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
00041             return returnBuffer;
00042         });
00043     }
00044
00045     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00046     inline float ConvertDipsToPixels(float dips, float dpi)
00047     {
00048         static const float dipsPerInch = 96.0f;
00049         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00050     }
00051
00052 #if defined(_DEBUG)
00053     // Check for SDK Layer support.
00054     inline bool SdkLayersAvailable()
00055     {
00056         HRESULT hr = D3D11CreateDevice(
00057             nullptr,
00058             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00059             0,
00060             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00061             nullptr,                    // Any feature level will do.
00062             0,
00063             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Store apps.
00064             nullptr,                    // No need to keep the D3D device reference.
00065             nullptr,                    // No need to know the feature level.
00066             nullptr                     // No need to keep the D3D device context reference.
00067             );
00068
00069         return SUCCEEDED(hr);
00070     }
00071 #endif
00072
00073     struct TextureData
00074     {
00075         const void* buffer;
00076         const UINT bytesPerPixel;
00077     };
00078
00079     Microsoft::WRL::ComPtr<ID3D11VertexShader> CreateVertexShader(
00080         ID3D11Device* device,
00081         const void* data,
00082         size_t dataSize);
00083
00084     Microsoft::WRL::ComPtr<ID3D11PixelShader> CreatePixelShader(
00085         ID3D11Device* device,
00086         const void* data,
00087         size_t dataSize);
00088
00089     Microsoft::WRL::ComPtr<ID3D11InputLayout> CreateInputLayout(
00090         ID3D11Device* device,
00091         const D3D11_INPUT_ELEMENT_DESC* vertexDesc,
00092         size_t vertexDescCount,
00093         const void* vertexShaderData,
00094         size_t vertexShaderDataSize);
00095
00096     Microsoft::WRL::ComPtr<ID3D11SamplerState> CreateSamplerState(
00097         ID3D11Device* device,
00098         const D3D11_SAMPLER_DESC& samplerDesc = CD3D11_SAMPLER_DESC{ CD3D11_DEFAULT{} });
00099
00100     Microsoft::WRL::ComPtr<ID3D11Texture2D> CreateTexture(
00101         ID3D11Device* device,
00102         UINT width,
00103         UINT height,
00104         DXGI_FORMAT format,
00105         std::optional<TextureData> textureData = std::nullopt,
00106         std::optional<UINT> bindFlags = std::nullopt,
00107         std::optional<D3D11_USAGE> usage = std::nullopt,
00108         std::optional<UINT> cpuFlags = std::nullopt);
00109
00110     Microsoft::WRL::ComPtr<ID3D11Buffer> CreateBuffer(
00111         ID3D11Device* device,
00112         const size_t size,
00113         const void* buffer = nullptr,
00114         std::optional<UINT> bindFlags = std::nullopt,
00115         std::optional<D3D11_USAGE> usage = std::nullopt,
00116         std::optional<UINT> cpuFlags = std::nullopt);
00117
00118     Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> CreateShaderResourceView(
00119         ID3D11Texture2D* texture,
00120         std::optional<DXGI_FORMAT> format = std::nullopt);
00121
00122     Microsoft::WRL::ComPtr<ID3D11RenderTargetView> CreateRenderTargetView(
00123         ID3D11Texture2D* texture);
00124
00125     Microsoft::WRL::ComPtr<ID3D11DepthStencilView> CreateDepthStencilView(
00126         ID3D11Texture2D* texture,
00127         std::optional<DXGI_FORMAT> format = std::nullopt);
00128
00129     class DeviceResources;
00130
00131     // Used to track time spent executing Gpu work
00132     class GpuPerformanceTimer
00133     {
00134     public:
00135         GpuPerformanceTimer(
00136             const std::shared_ptr<DX::DeviceResources>& deviceResources);
00137
00138         void StartTimerForFrame();
00139         void EndTimerForFrame();
00140
00141         float GetFrameTime() const;
00142         float GetAvgFrameTime() const;
00143         float GetMinFrameTime() const;
00144         float GetMaxFrameTime() const;
00145
00146     private:
00147         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00148
00149         static constexpr uint32_t QueryCount = 5u;
00150
00151         Microsoft::WRL::ComPtr<ID3D11Query> m_startTimestampQuery[QueryCount];
00152         Microsoft::WRL::ComPtr<ID3D11Query> m_endTimestampQuery[QueryCount];
00153         Microsoft::WRL::ComPtr<ID3D11Query> m_disjointQuery[QueryCount];
00154
00155         uint32_t m_currentQuery = 0u;
00156         uint32_t m_currentFrameIndex = 0u;
00157
00158         static constexpr uint32_t TimeHistoryCount = 64u;
00159
00160         uint32_t m_processingTimeHistoryIndex = 0u;
00161         float m_processingTimeHistory[TimeHistoryCount] = {};
00162
00163         float m_processingTimeMs = 0.0f;
00164         float m_processingTimeAvgMs = 0.0f;
00165         float m_processingTimeMinMs = +std::numeric_limits<float>::infinity();
00166         float m_processingTimeMaxMs = -std::numeric_limits<float>::infinity();
00167     };
00168 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario5_UserCollection.xaml.cpp Source File

  • Store
  • cpp

Scenario5_UserCollection.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_UserCollection.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Services::Store;
00022 using namespace Windows::UI::Xaml;
00023
00024 Scenario5_UserCollection::Scenario5_UserCollection()
00025 {
00026     InitializeComponent();
00027
00028     storeContext = StoreContext::GetDefault();
00029 }
00030
00031 void Scenario5_UserCollection::GetUserCollectionButton_Click(Object^ sender, RoutedEventArgs^ e)
00032 {
00033     // Create a filtered list of the product AddOns I care about
00034     auto filterList = ref new Vector<String^>({ "Consumable", "Durable", "UnmanagedConsumable" });
00035
00036     // Get user collection for this product, filtering for the types we know about
00037     create_task(storeContext->GetUserCollectionAsync(filterList)).then([this](StoreProductQueryResult^ collection)
00038     {
00039         ProductsListView->ItemsSource = Utils::CreateProductListFromQueryResult(collection, "collection items");
00040     }, task_continuation_context::get_current_winrt_context());
00041 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SerialArduino/cs/Utilities.cs Source File

  • SerialArduino
  • cs

Utilities.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 using SDKTemplate;
00019
00020 namespace SerialArduino
00021 {
00022     /// <summary>
00023     /// This class is intended to host any functionality that will be shared among different
00024     /// scenario/pages such as common error messages.
00025     /// </summary>
00026     public class Utilities
00027     {
00028         /// <summary>
00029         /// Prints an error message stating that device is not connected
00030         /// </summary>
00031         public static void NotifyDeviceNotConnected()
00032         {
00033             MainPage.Current.NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType.ErrorMessage);
00034         }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_Clear Member List

This is the complete list of members for Scenario5_Clear, including all inherited members.
PickPlaylistButton_Click(object sender, RoutedEventArgs e) | Scenario5_Clear | [inline, private]
rootPage | Scenario5_Clear | [private]
Scenario5_Clear() | Scenario5_Clear | [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cs/SampleConfiguration.cs Source File

  • BasicFaceTracking
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Basic face tracking C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Track Faces in Webcam", ClassType=typeof(Scenario1_TrackInWebcam)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Common/Resources.h Source File

  • ComplexInk
  • cpp
  • Common

Resources.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 enum LogEventTypes
00004 {
00005     EventNone                   = 0x0,
00006     InkingEventType             = 0x1,
00007     IndependentInputEventType   = 0x2,
00008     UnprocessedInputEventType   = 0x4,
00009     StrokeEventType             = 0x8
00010 };
00011
00012 enum LogEventAction
00013 {
00014     StrokeCollected,
00015     StrokeErased,
00016     IndependentInputEntered,
00017     IndependentInputHover,
00018     IndependentInputPressed,
00019     IndependentInputMoved,
00020     IndependentInputReleased,
00021     IndependentInputLost,
00022     IndependentInputExited,
00023     UnprocessedInputEntered,
00024     UnprocessedInputHover,
00025     UnprocessedInputPressed,
00026     UnprocessedInputMoved,
00027     UnprocessedInputReleased,
00028     UnprocessedInputLost,
00029     UnprocessedInputExited,
00030     StrokeStarted,
00031     StrokeContinued,
00032     StrokeEnded,
00033     StrokeCanceled
00034 };
00035
00036
00037 const std::wstring LogEventStrings[]
00038 {
00039     L"Stroke Collected",
00040     L"Stroke Erased",
00041     L"An inking input is entering into the boundary of the inking area, before InkPresenter processes event",
00042     L"Independent input pointer hovering",
00043     L"Independent input pointer pressing",
00044     L"Independent input pointer moved",
00045     L"Independent input pointer released",
00046     L"An inking input has lost contact with the inking area without being lifted, before InkPresenter processes event",
00047     L"An inking input is leaving the boundary of the inking area, before InkPresenter processes event",
00048     L"An input has entered into the boundary of the inking area",
00049     L"An input has moved while hovering within the boundary of the inking area",
00050     L"Unprocessed input pressed",
00051     L"Unprocessed input moved",
00052     L"Unprocessed input released",
00053     L"An input was in contact with the inking area and is now lost without being lifted",
00054     L"An input has left the boundary of the inking area",
00055     L"An inking input has come into contact with the inking area and inking started",
00056     L"An inking input has come into contact with the inking area and continued to ink",
00057     L"An inking input has lifted from the inking area and inking ended",
00058     L"An inking input was in contact with the inking area and is now lost without being lifted, existing stroke cancelled"
00059 };
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AppView Member List

This is the complete list of members for AppView, including all inherited members.
AppView() | AppView | [inline]
deviceResources | AppView | [private]
Dispose() | AppView | [inline]
holographicSpace | AppView | [private]
Initialize(CoreApplicationView applicationView) | AppView | [inline]
Load(string entryPoint) | AppView | [inline]
main | AppView | [private]
OnKeyPressed(CoreWindow sender, KeyEventArgs args) | AppView | [inline, private]
OnLaunched(LaunchActivatedEventArgs args) | AppView | [inline]
OnPointerPressed(CoreWindow sender, PointerEventArgs args) | AppView | [inline, private]
OnResuming(object sender, object args) | AppView | [inline, private]
OnSuspending(object sender, SuspendingEventArgs args) | AppView | [inline, private]
OnViewActivated(CoreApplicationView sender, IActivatedEventArgs args) | AppView | [inline, private]
OnVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) | AppView | [inline, private]
OnWindowClosed(CoreWindow sender, CoreWindowEventArgs arg) | AppView | [inline, private]
Run() | AppView | [inline]
SetWindow(CoreWindow window) | AppView | [inline]
Uninitialize() | AppView | [inline]
windowClosed | AppView | [private]
windowVisible | AppView | [private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
ConcatToOutput(PCWSTR str, UINT strLen) | sealed | [private]
DoSomething_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DoSomething_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ReadAndWrite(IXmlReader *reader, IXmlWriterLite *writer) | sealed | [private]
ReadAttributes(IXmlReader *reader) | sealed | [private]
ReadXml(Windows::Storage::Streams::IRandomAccessStream^readStream) | sealed | [private]
ReadXmlClick(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
rootPage | sealed | [private]
Scenario1() | sealed |
Scenario2() | sealed |
Scenario3() | sealed |
WriteXml(Windows::Storage::Streams::IRandomAccessStream^pStream) | sealed | [private]
WriteXml(Windows::Storage::Streams::IRandomAccessStream^writeStream) | sealed | [private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_UnmanagedConsumable Member List

This is the complete list of members for Scenario3_UnmanagedConsumable, including all inherited members.
FulfillConsumableButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_UnmanagedConsumable | [inline, private]
GetConsumableBalanceButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_UnmanagedConsumable | [inline, private]
GetUnmanagedConsumablesButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_UnmanagedConsumable | [inline, private]
PurchaseAddOnButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_UnmanagedConsumable | [inline, private]
rootPage | Scenario3_UnmanagedConsumable | [private]
Scenario3_UnmanagedConsumable() | Scenario3_UnmanagedConsumable | [inline]
storeContext | Scenario3_UnmanagedConsumable | [private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/MediaTransportControls.cpp Source File

  • 360VideoPlayback
  • cpp
  • Content

MediaTransportControls.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "MediaTransportControls.h"
00003 #include "..\Common\DirectXHelper.h"
00004 #include "..\Common\Controls.h"
00005 #include "VideoRenderer.h"
00006 #include "..\Common\SeekbarElement.h"
00007 #include "..\Common\MeshGeometry.h"
00008
00009 using namespace _360VideoPlayback;
00010 using namespace DX;
00011 using namespace DirectX;
00012 using namespace Microsoft::WRL;
00013 using namespace std;
00014 using namespace Windows::Foundation::Numerics;
00015 using namespace Windows::UI::Input::Spatial;
00016
00017 const float MAX_INACTIVE_TIME_TO_HIDE = 5.0f; //In seconds
00018 const float3 EXITBUTTON_SCALE{ 0.25f, 0.25f, 0.025f };
00019 const float3 EXITBUTTON_POSITION{ 0.0f, -0.2f, 0.0f };
00020 const float3 PLAYPAUSE_SCALE{ 0.25f, 0.25f, 0.025f };
00021 const float3 PLAYPAUSE_POSITION{ 0.0f,  0.1f, 0.0f };
00022 const float3 SEEKBAR_POSITION{ 0.0f,  -0.08f, 0.0f };
00023 const unsigned short PLAYPAUSE_TESSELATION = 24;
00024 const UINT PLAYPAUSE_CONTAINER_SIZE = BUTTON_SIZE * 2;
00025 const UINT PLAYPAUSE_TEXT_SIZE = PLAYPAUSE_CONTAINER_SIZE / 2;
00026
00027 MediaTransportControls::MediaTransportControls()
00028 {
00029     m_isVisible = false;
00030     m_rotation = float4(0, 0, 0, 0);
00031     m_position = float3(0, 0, 0);
00032     m_shadersLoaded = false;
00033     m_transform = float4x4::identity();
00034 }
00035
00036 void MediaTransportControls::Initialize()
00037 {
00038     this->AddPlayPauseButton();
00039     this->AddSeekbar();
00040     this->AddExitButton();
00041 }
00042
00043 void MediaTransportControls::AddPlayPauseButton()
00044 {
00045     auto playPauseButtonElement = std::make_shared<PlayPauseButton>(PLAYPAUSE_CONTAINER_SIZE, PLAYPAUSE_TEXT_SIZE);
00046     playPauseButtonElement->Initialize();
00047
00048     // Play/pause button control
00049     m_playPauseButtonControl = std::make_shared<BaseControl>(MeshGeometry::MakeTexturedCylinder(PLAYPAUSE_TESSELATION));
00050     m_playPauseButtonControl->SetScale(PLAYPAUSE_SCALE);
00051     m_playPauseButtonControl->SetPosition(PLAYPAUSE_POSITION);
00052     m_playPauseButtonControl->SnapInitialSizeToRootElement();
00053     m_playPauseButtonControl->SetRenderElement(playPauseButtonElement);
00054     m_playPauseButtonControl->Initialize();
00055     m_baseControls.push_back(m_playPauseButtonControl);
00056 }
00057
00058 void MediaTransportControls::AddSeekbar()
00059 {
00060     auto seekBarStripSize = float2(300.0f, 50.0f);
00061
00062     auto seekbarElement = std::make_shared<SeekBarElement>(
00063         static_cast<float>(seekBarStripSize.x),
00064         static_cast<float>(seekBarStripSize.y),
00065         static_cast<float>(seekBarStripSize.x) * 0.05f, /*left/right padding*/
00066         static_cast<float>(seekBarStripSize.y) * 0.44f /*bottom/top padding*/);
00067
00068     seekbarElement->Initialize();
00069     seekbarElement->SetTranslation(float2(0.0f, static_cast<FLOAT>(seekBarStripSize.y) - seekbarElement->GetElementSize().y));
00070
00071     m_seekbarControl = std::make_shared<BaseControl>();
00072     m_seekbarControl->SetTextureWidth(static_cast<UINT>(seekBarStripSize.x));
00073     m_seekbarControl->SetTextureHeight(static_cast<UINT>(seekBarStripSize.y));
00074     m_seekbarControl->SetScale(float3(0.25f, 0.25f, 0.25f));
00075     m_seekbarControl->SetPosition(SEEKBAR_POSITION);
00076     m_seekbarControl->SetRenderElement(seekbarElement);
00077     m_seekbarControl->Initialize();
00078
00079     m_baseControls.push_back(m_seekbarControl);
00080 }
00081
00082 void MediaTransportControls::AddExitButton()
00083 {
00084     // Exit button element
00085     auto exitButtonElement = std::make_shared<ExitButton>();
00086     exitButtonElement->ArrangeElements();
00087     exitButtonElement->Initialize();
00088
00089     // Exit button control
00090     m_exitButtonControl = std::make_shared<BaseControl>();
00091     m_exitButtonControl->SetScale(EXITBUTTON_SCALE);
00092     m_exitButtonControl->SetPosition(EXITBUTTON_POSITION);
00093     m_exitButtonControl->SnapInitialSizeToRootElement();
00094     m_exitButtonControl->SetRenderElement(exitButtonElement);
00095     m_exitButtonControl->Initialize();
00096
00097     m_baseControls.push_back(m_exitButtonControl);
00098 }
00099
00100 void MediaTransportControls::Update(const StepTimer& timer, SpatialPointerPose^ cameraPose)
00101 {
00102     const XMMATRIX modelRotation = XMMatrixRotationQuaternion(XMLoadFloat4(&m_rotation));
00103     const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00104     const XMMATRIX localTransform = XMMatrixMultiply(modelRotation, modelTranslation);
00105     XMStoreFloat4x4(&m_transform, localTransform);
00106
00107     if (m_isVisible)
00108     {
00109         if (this->IsFocused())
00110         {
00111             m_inactiveSecondsCounter = 0.0f;
00112         }
00113         else
00114         {
00115             m_inactiveSecondsCounter += static_cast<float>(timer.GetElapsedSeconds());
00116             if (m_inactiveSecondsCounter >= MAX_INACTIVE_TIME_TO_HIDE)
00117             {
00118                 Hide();
00119             }
00120         }
00121     }
00122
00123     // Update the  Controls
00124     for (const auto& control : m_baseControls)
00125     {
00126         control->SetParentTransform(m_transform);
00127         control->Update(timer, cameraPose);
00128     }
00129 }
00130
00131 void MediaTransportControls::Render()
00132 {
00133     if (m_isVisible && m_shadersLoaded)
00134     {
00135         for (const auto& control : m_baseControls)
00136         {
00137             control->Render();
00138         }
00139     }
00140 }
00141
00142 void MediaTransportControls::PerformPressedAction()
00143 {
00144     bool pressedFocusedElement = false;
00145     for (const auto& control : m_baseControls)
00146     {
00147         if (control->IsFocused())
00148         {
00149             control->PerformPressedAction();
00150             pressedFocusedElement = true;
00151             break;
00152         }
00153     }
00154
00155     if (!pressedFocusedElement)
00156     {
00157         Hide();
00158     }
00159 }
00160
00161 void MediaTransportControls::Show(SpatialPointerPose^ cameraPose, float distance)
00162 {
00163     const float3 headPosition = cameraPose->Head->Position;
00164     const float3 headDirection = cameraPose->Head->ForwardDirection;
00165     m_position = headPosition + (distance * headDirection);
00166     m_rotation = ComputeLookAtQuaternion(m_position, cameraPose->Head->Position, float3(0.0f, 1.0f, 0.0f));
00167     m_isVisible = true;
00168     for (const auto& control : m_baseControls)
00169     {
00170         control->SetIsVisible(true);
00171     }
00172     m_inactiveSecondsCounter = 0.0f;
00173 }
00174
00175 void MediaTransportControls::Hide()
00176 {
00177     m_isVisible = false;
00178     for (const auto& control : m_baseControls)
00179     {
00180         control->SetIsVisible(false);
00181     }
00182     m_inactiveSecondsCounter = 0.0f;
00183 }
00184
00185 void MediaTransportControls::ApplyShaders()
00186 {
00187     for (const auto& control : m_baseControls)
00188     {
00189         control->ApplyShaders();
00190     }
00191     m_shadersLoaded = true;
00192 }
00193
00194 bool MediaTransportControls::IsFocused()
00195 {
00196     for (const auto& control : m_baseControls)
00197     {
00198         if (control->IsFocused())
00199         {
00200             return true;
00201         }
00202     }
00203     return false;
00204 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SetErrorMessage Member List

This is the complete list of members for SetErrorMessage, including all inherited members.
GetShareContent(DataRequest request) | SetErrorMessage | [inline, protected]
SetErrorMessage() | SetErrorMessage | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoRenderer Member List

This is the complete list of members for VideoRenderer, including all inherited members.
ComputeSphere(int tessellation, bool invertn) | VideoRenderer | [inline, private]
CreateD3D11Surface() | VideoRenderer | [inline, private]
CreateDeviceDependentResourcesAsync() | VideoRenderer | [inline]
d3dInteropSurface | VideoRenderer | [private]
deviceResources | VideoRenderer | [private]
Dispose() | Disposer | [inline]
Dispose(bool disposeManagedResources) | Disposer | [inline, protected, virtual]
Disposer() | Disposer | [inline, protected]
geometryShader | VideoRenderer | [private]
indexBuffer | VideoRenderer | [private]
indexCount | VideoRenderer | [private]
inputLayout | VideoRenderer | [private]
IsDisposed | Disposer | [protected]
loadingComplete | VideoRenderer | [private]
LoadShaders() | VideoRenderer | [inline, private]
m_mediaPlayer | VideoRenderer | [private]
M_mediaPlayer_VideoFrameAvailable(MediaPlayer sender, object args) | VideoRenderer | [inline, private]
m_quadTextureSamplerState | VideoRenderer | [private]
m_texture | VideoRenderer | [private]
m_textureView | VideoRenderer | [private]
modelConstantBuffer | VideoRenderer | [private]
modelConstantBufferData | VideoRenderer | [private]
pixelShader | VideoRenderer | [private]
ReleaseDeviceDependentResources() | VideoRenderer | [inline]
RemoveAndDispose< T >(ref T objectToDispose) | Disposer | [inline, protected]
RemoveToDispose< T >(T objectToRemove) | Disposer | [inline, protected]
Render() | VideoRenderer | [inline]
thisLock | VideoRenderer | [private]
ToDispose< T >(T objectToDispose) | Disposer | [inline, protected]
Update(StepTimer timer) | VideoRenderer | [inline]
usingVprtShaders | VideoRenderer | [private]
vertexBuffer | VideoRenderer | [private]
vertexShader | VideoRenderer | [private]
VideoRenderer(DeviceResources deviceResources) | VideoRenderer | [inline]
XMScalarSinCos(ref float Sin, ref float Cos, float Value) | VideoRenderer | [inline, private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/pch.h Source File

  • XamlBind
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceInstaller.cpp Source File

  • CustomCapability
  • Service
  • Server

ServiceInstaller.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "stdafx.h"
00013 #pragma region "Includes"
00014
00015 #include <stdio.h>
00016 #include <windows.h>
00017 #include "ServiceInstaller.h"
00018 #pragma endregion
00019
00020
00021 //
00022 //   FUNCTION: InstallService
00023 //
00024 //   PURPOSE: Install the current application as a service to the local
00025 //   service control manager database.
00026 //
00027 //   PARAMETERS:
00028 //   * pszServiceName - the name of the service to be installed
00029 //   * pszDisplayName - the display name of the service
00030 //   * dwStartType - the service start option. This parameter can be one of
00031 //     the following values: SERVICE_AUTO_START, SERVICE_BOOT_START,
00032 //     SERVICE_DEMAND_START, SERVICE_DISABLED, SERVICE_SYSTEM_START.
00033 //   * pszDependencies - a pointer to a double null-terminated array of null-
00034 //     separated names of services or load ordering groups that the system
00035 //     must start before this service.
00036 //   * pszAccount - the name of the account under which the service runs.
00037 //   * pszPassword - the password to the account name.
00038 //
00039 //   NOTE: If the function fails to install the service, it prints the error
00040 //   in the standard output stream for users to diagnose the problem.
00041 //
00042 void InstallService(
00043     _In_ PWSTR pszServiceName,
00044     _In_ PWSTR pszDisplayName,
00045     _In_ DWORD dwStartType,
00046     _In_ PWSTR pszDependencies,
00047     _In_ PWSTR pszAccount,
00048     _In_ PWSTR pszPassword)
00049 {
00050     wchar_t szPath[MAX_PATH];
00051     SC_HANDLE schSCManager = nullptr;
00052     SC_HANDLE schService = nullptr;
00053
00054     if (GetModuleFileName(nullptr, szPath, ARRAYSIZE(szPath)) == 0)
00055     {
00056         wprintf(L"GetModuleFileName failed w/err 0x%08lx\n", GetLastError());
00057         goto Cleanup;
00058     }
00059
00060     // Open the local default service control manager database
00061     schSCManager = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT |
00062                                  SC_MANAGER_CREATE_SERVICE);
00063     if (schSCManager == nullptr)
00064     {
00065         wprintf(L"OpenSCManager failed w/err 0x%08lx\n", GetLastError());
00066         goto Cleanup;
00067     }
00068
00069     // Install the service into SCM by calling CreateService
00070     schService = CreateService(
00071         schSCManager,                   // SCManager database
00072         pszServiceName,                 // Name of service
00073         pszDisplayName,                 // Name to display
00074         SERVICE_QUERY_STATUS | SERVICE_START,  // Desired access
00075         SERVICE_WIN32_OWN_PROCESS,      // Service type
00076         dwStartType,                    // Service start type
00077         SERVICE_ERROR_NORMAL,           // Error control type
00078         szPath,                         // Service's binary
00079         nullptr,                           // No load ordering group
00080         nullptr,                           // No tag identifier
00081         pszDependencies,                // Dependencies
00082         pszAccount,                     // Service running account
00083         pszPassword                     // Password of the account
00084     );
00085
00086     if (schService == nullptr)
00087     {
00088         wprintf(L"CreateService failed w/err 0x%08lx\n", GetLastError());
00089         goto Cleanup;
00090     }
00091
00092     wprintf(L"%s is installed.\n", pszServiceName);
00093
00094     if (StartService(schService, 0, nullptr) == 0)
00095     {
00096         wprintf(L"StartService failed w/err 0x%08lx\n", GetLastError());
00097         goto Cleanup;
00098     }
00099
00100     wprintf(L"%s is started.\n", pszServiceName);
00101
00102 Cleanup:
00103     // Centralized cleanup for all allocated resources.
00104     if (schSCManager)
00105     {
00106         CloseServiceHandle(schSCManager);
00107         schSCManager = nullptr;
00108     }
00109     if (schService)
00110     {
00111         CloseServiceHandle(schService);
00112         schService = nullptr;
00113     }
00114 }
00115
00116 //
00117 //   FUNCTION: UninstallService
00118 //
00119 //   PURPOSE: Stop and remove the service from the local service control
00120 //   manager database.
00121 //
00122 //   PARAMETERS:
00123 //   * pszServiceName - the name of the service to be removed.
00124 //
00125 //   NOTE: If the function fails to uninstall the service, it prints the
00126 //   error in the standard output stream for users to diagnose the problem.
00127 //
00128 void UninstallService(_In_ PWSTR pszServiceName)
00129 {
00130     SC_HANDLE schSCManager = nullptr;
00131     SC_HANDLE schService = nullptr;
00132     SERVICE_STATUS ssSvcStatus = {};
00133
00134     // Open the local default service control manager database
00135     schSCManager = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT);
00136     if (schSCManager == nullptr)
00137     {
00138         wprintf(L"OpenSCManager failed w/err 0x%08lx\n", GetLastError());
00139         goto Cleanup;
00140     }
00141
00142     // Open the service with delete, stop, and query status permissions
00143     schService = OpenService(schSCManager, pszServiceName, SERVICE_STOP |
00144                              SERVICE_QUERY_STATUS | DELETE);
00145     if (schService == nullptr)
00146     {
00147         wprintf(L"OpenService failed w/err 0x%08lx\n", GetLastError());
00148         goto Cleanup;
00149     }
00150
00151     // Try to stop the service
00152     if (ControlService(schService, SERVICE_CONTROL_STOP, &ssSvcStatus))
00153     {
00154         wprintf(L"Stopping %s.", pszServiceName);
00155         Sleep(1000);
00156
00157         while (QueryServiceStatus(schService, &ssSvcStatus))
00158         {
00159             if (ssSvcStatus.dwCurrentState == SERVICE_STOP_PENDING)
00160             {
00161                 wprintf(L".");
00162                 Sleep(1000);
00163             }
00164             else break;
00165         }
00166
00167         if (ssSvcStatus.dwCurrentState == SERVICE_STOPPED)
00168         {
00169             wprintf(L"\n%s is stopped.\n", pszServiceName);
00170         }
00171         else
00172         {
00173             wprintf(L"\n%s failed to stop.\n", pszServiceName);
00174         }
00175     }
00176
00177     // Now remove the service by calling DeleteService.
00178     if (!DeleteService(schService))
00179     {
00180         wprintf(L"DeleteService failed w/err 0x%08lx\n", GetLastError());
00181         goto Cleanup;
00182     }
00183
00184     wprintf(L"%s is removed.\n", pszServiceName);
00185
00186 Cleanup:
00187     // Centralized cleanup for all allocated resources.
00188     if (schSCManager)
00189     {
00190         CloseServiceHandle(schSCManager);
00191         schSCManager = nullptr;
00192     }
00193     if (schService)
00194     {
00195         CloseServiceHandle(schService);
00196         schService = nullptr;
00197     }
00198 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFontImplementation/TextLayout.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFontImplementation

TextLayout.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "TextLayout.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace DWriteTextLayoutCloudFontImplementation;
00017 using namespace Microsoft::WRL;
00018
00019 TextLayout::TextLayout(Platform::String^ text, Platform::String^ languageTag, Platform::String^ fontFamily, float fontSize, float width) :
00020     m_fontSize(fontSize),
00021     m_width(width)
00022 {
00023     m_text.assign(text->Data(), text->Length());
00024     m_languageTag.assign(languageTag->Data(), languageTag->Length());
00025     m_fontFamily.assign(fontFamily->Data(), fontFamily->Length());
00026
00027     // In order to use downloadable fonts, we will need a system font collection
00028     // with access to downloadable fonts enabled.
00029
00030     DX::ThrowIfFailed(
00031         DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory3), &m_dwriteFactory)
00032         );
00033
00034     ComPtr<IDWriteFontCollection> systemFontCollection;
00035     ComPtr<IDWriteFontCollection1> systemFontCollection1;
00036     DX::ThrowIfFailed(
00037         m_dwriteFactory->GetSystemFontCollection(true, &systemFontCollection1, false)
00038         );
00039
00040     DX::ThrowIfFailed(systemFontCollection1.As(&systemFontCollection));
00041
00042     // Create the DWriteTextLayout.
00043
00044     ComPtr<IDWriteTextFormat> textFormat;
00045     DX::ThrowIfFailed(
00046         m_dwriteFactory->CreateTextFormat(
00047             m_fontFamily.c_str(),
00048             systemFontCollection.Get(),
00049             DWRITE_FONT_WEIGHT_NORMAL,
00050             DWRITE_FONT_STYLE_NORMAL,
00051             DWRITE_FONT_STRETCH_NORMAL,
00052             m_fontSize,
00053             m_languageTag.c_str(),
00054             &textFormat
00055             )
00056         );
00057
00058     ComPtr<IDWriteTextLayout> textLayout;
00059     DX::ThrowIfFailed(
00060         m_dwriteFactory->CreateTextLayout(
00061             m_text.c_str(),
00062             static_cast<UINT32>(m_text.length()),
00063             textFormat.Get(),
00064             m_width, // format width
00065             0.0f, // max height
00066             &textLayout
00067             )
00068         );
00069
00070     DX::ThrowIfFailed(textLayout.As(&m_textLayout));
00071
00072     // Get the resulting height of the text layout.
00073     UpdateHeight();
00074
00075     // We'll use FontNameCollector (an IDWriteRenderer implementation) to collect
00076     // details about which fonts were actually used. This is for informational
00077     // purposes, to better understand the behavior of the font download mechanism
00078     // while the sample app is running. It's not in any way required for using
00079     // downloadable fonts.
00080     m_fontNameCollector = new FontNameCollector();
00081     GetFontNames();
00082 }
00083
00084
00085 Platform::String^ TextLayout::FontsUsed::get()
00086 {
00087     Platform::String^ fontNames = ref new Platform::String(m_usedFontNames.c_str());
00088     return fontNames;
00089 }
00090
00091
00092 void TextLayout::InvalidateLayout()
00093 {
00094     // Calling InvalidateLayout will cause the layout to be performed again using
00095     // fonts that are locally available. If requested font data was previously not
00096     // available on the system but has been downloaded, then the locally cached data
00097     // will be used.
00098     m_textLayout->InvalidateLayout();
00099
00100     // Need to get the updated height of the text layout.
00101     UpdateHeight();
00102
00103     // For informational purposes in the sample, get font names used in the updated
00104     // layout.
00105     GetFontNames();
00106 }
00107
00108
00109 void TextLayout::Width::set(float value)
00110 {
00111     m_width = value;
00112     DX::ThrowIfFailed(
00113         m_textLayout->SetMaxWidth(value)
00114         );
00115
00116     // Need to get the updated height of the text layout.
00117     UpdateHeight();
00118 }
00119
00120
00121 void TextLayout::UpdateHeight()
00122 {
00123     // A side effect of accessing the text metrics is that it forces
00124     // DirectWrite to complete the layout of text in the text layout. That
00125     // will include determining whether any downloadable font data may be
00126     // needed to display the text using the specified fonts, and to add
00127     // those requests into a font download queue. The app using DirectWrite
00128     // controls when the download requests will get executed.
00129
00130     DWRITE_TEXT_METRICS textMetrics;
00131     DX::ThrowIfFailed(
00132         m_textLayout->GetMetrics(&textMetrics)
00133         );
00134
00135     m_height = textMetrics.height;
00136 }
00137
00138
00139 void TextLayout::GetFontNames()
00140 {
00141     // Assumed that m_fontNamesCollector is already created.
00142
00143     // Clear any existing names collected for an earlier state of the layout.
00144     m_fontNameCollector->ClearNames();
00145
00146     // If we call IDWriteTextLayout::Draw, IDWriteRenderer will get callbacks
00147     // that will allow it to obtain the font details. That will complete before
00148     // the call to Draw returns.
00149     DX::ThrowIfFailed(
00150         m_textLayout->Draw(NULL, m_fontNameCollector.Get(), 0, 0)
00151         );
00152
00153     m_usedFontNames = m_fontNameCollector->GetFontNames();
00154 }
Generated on Fri Nov 15 2024 22:19:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs Source File

  • PersonalDataEncryption
  • cs

Scenario2_Memory.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation;
00014 using Windows.Security.Cryptography;
00015 using Windows.Security.DataProtection;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.ViewManagement;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Controls.Primitives;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario2_Memory : Page
00026     {
00027         private MainPage rootPage = MainPage.Current;
00028         UserDataProtectionManager userDataProtectionManager = null;
00029         IBuffer protectedBuffer = null;
00030
00031         public Scenario2_Memory()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedTo(NavigationEventArgs e)
00037         {
00038             userDataProtectionManager = UserDataProtectionManager.TryGetDefault();
00039             if (userDataProtectionManager != null)
00040             {
00041                 AvailablePanel.Visibility = Visibility.Visible;
00042                 UnavailablePanel.Visibility = Visibility.Collapsed;
00043             }
00044             else
00045             {
00046                 AvailablePanel.Visibility = Visibility.Collapsed;
00047                 UnavailablePanel.Visibility = Visibility.Visible;
00048             }
00049         }
00050
00051         private async void ProtectL1_Click(object sender, RoutedEventArgs e)
00052         {
00053             string text = DataTextBox.Text;
00054             if (text.Length == 0)
00055             {
00056                 // Cannot protect a zero-length buffer.
00057                 rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
00058                 return;
00059             }
00060
00061             IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);
00062
00063             IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.AfterFirstUnlock);
00064             ReportProtectedBuffer(result);
00065         }
00066
00067         private async void ProtectL2_Click(object sender, RoutedEventArgs e)
00068         {
00069             string text = DataTextBox.Text;
00070             if (text.Length == 0)
00071             {
00072                 // Cannot protect a zero-length buffer.
00073                 rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
00074                 return;
00075             }
00076
00077             IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);
00078
00079             IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.WhileUnlocked);
00080             ReportProtectedBuffer(result);
00081         }
00082
00083         void ReportProtectedBuffer(IBuffer buffer)
00084         {
00085             protectedBuffer = buffer;
00086             ProtectedDataTextBlock.Text = CryptographicBuffer.EncodeToHexString(buffer);
00087             UnprotectPanel.Visibility = Visibility.Visible;
00088             rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00089         }
00090
00091         private async void Unprotect_Click(object sender, RoutedEventArgs e)
00092         {
00093             UnprotectedDataTextBlock.Text = string.Empty;
00094             UserDataBufferUnprotectResult result = await userDataProtectionManager.UnprotectBufferAsync(protectedBuffer);
00095             switch (result.Status)
00096             {
00097                 case UserDataBufferUnprotectStatus.Succeeded:
00098                     rootPage.NotifyUser("Unprotected successfully", NotifyType.StatusMessage);
00099                     UnprotectedDataTextBlock.Text = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, result.UnprotectedBuffer);
00100                     break;
00101
00102                 case UserDataBufferUnprotectStatus.Unavailable:
00103                     rootPage.NotifyUser("Unable to unprotect: Unavailable", NotifyType.ErrorMessage);
00104                     break;
00105
00106                 default:
00107                     rootPage.NotifyUser("Unable to unprotect: Unknown error", NotifyType.ErrorMessage);
00108                     break;
00109             }
00110         }
00111     }
00112 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Settings Member List

This is the complete list of members for Settings, including all inherited members.
Settings() Settings [inline]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario1_DeviceConnect.xaml.cs Source File

  • CustomHidDeviceAccess
  • cs

Scenario1_DeviceConnect.xaml.cs

Go to the documentation of this file.
00001
00002 //*********************************************************
00003 //
00004 // Copyright (c) Microsoft. All rights reserved.
00005 //
00006 //*********************************************************
00007
00008 using System;
00009 using System.Collections.Generic;
00010 using System.IO;
00011 using System.Collections.ObjectModel;
00012 using Windows.ApplicationModel;
00013 using Windows.Devices.Enumeration;
00014 using Windows.Devices.HumanInterfaceDevice;
00015 using Windows.Foundation;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020 using SDKTemplate;
00021 using CustomHidDeviceAccess;
00022
00023 namespace CustomHidDeviceAccess
00024 {
00025     /// <summary>
00026     /// Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events.
00027     ///
00028     /// To use this sample with your device:
00029     /// 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation.
00030     /// 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.
00031     /// </summary>
00032     public sealed partial class DeviceConnect : Page
00033     {
00034         private const String ButtonNameDisconnectFromDevice = "Disconnect from device";
00035         private const String ButtonNameDisableReconnectToDevice = "Do not reconnect to device";
00036
00037         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00038         // as NotifyUser()
00039         private MainPage rootPage = MainPage.Current;
00040
00041         private SuspendingEventHandler appSuspendEventHandler;
00042         private EventHandler<Object> appResumeEventHandler;
00043
00044         private ObservableCollection<DeviceListEntry> listOfDevices;
00045
00046         private Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector;
00047         private Boolean watchersSuspended;
00048         private Boolean watchersStarted;
00049
00050         // Has all the devices enumerated by the device watcher?
00051         private Boolean isAllDevicesEnumerated;
00052
00053         public DeviceConnect()
00054         {
00055             this.InitializeComponent();
00056
00057             listOfDevices = new ObservableCollection<DeviceListEntry>();
00058
00059             mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
00060             watchersStarted = false;
00061             watchersSuspended = false;
00062
00063             isAllDevicesEnumerated = false;
00064         }
00065
00066         /// <summary>
00067         /// Invoked when this page is about to be displayed in a Frame.
00068         ///
00069         /// Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.
00070         ///
00071         /// The UI elements are controlled/modified through device watcher events, device opening/closing, and app events
00072         /// </summary>
00073         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00074         /// property is typically used to configure the page.</param>
00075         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00076         {
00077             // Default UI state
00078             UpdateConnectDisconnectButtonsAndList(true);
00079
00080             // Register for device events in case we are already watching for a device
00081             EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
00082             EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00083
00084             // Begin watching out for events
00085             StartHandlingAppEvents();
00086
00087             // Initialize the desired device watchers so that we can watch for when devices are connected/removed
00088             InitializeDeviceWatchers();
00089             StartDeviceWatchers();
00090
00091             DeviceListSource.Source = listOfDevices;
00092         }
00093
00094         /// <summary>
00095         /// Unregister from App events and DeviceWatcher events because this page will be unloaded.
00096         /// </summary>
00097         /// <param name="eventArgs"></param>
00098         protected override void OnNavigatedFrom(NavigationEventArgs eventArgs)
00099         {
00100             StopDeviceWatchers();
00101             StopHandlingAppEvents();
00102
00103             // We no longer care about the device being connected
00104             EventHandlerForDevice.Current.OnDeviceConnected = null;
00105             EventHandlerForDevice.Current.OnDeviceClose = null;
00106         }
00107
00108         private async void ConnectToDevice_Click(Object sender, RoutedEventArgs eventArgs)
00109         {
00110             var selection = ConnectDevices.SelectedItems;
00111             DeviceListEntry entry = null;
00112
00113             if (selection.Count > 0)
00114             {
00115                 var obj = selection[0];
00116                 entry = (DeviceListEntry)obj;
00117
00118                 if (entry != null)
00119                 {
00120                     // Create an EventHandlerForDevice to watch for the device we are connecting to
00121                     EventHandlerForDevice.CreateNewEventHandlerForDevice();
00122
00123                     // Get notified when the device was successfully connected to or about to be closed
00124                     EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
00125                     EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00126
00127                     // It is important that the FromIdAsync call is made on the UI thread because the consent prompt can only be displayed
00128                     // on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
00129                     Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);
00130
00131                     // Disable connect button if we connected to the device
00132                     UpdateConnectDisconnectButtonsAndList(!openSuccess);
00133                 }
00134             }
00135         }
00136
00137         private void DisconnectFromDevice_Click(Object sender, RoutedEventArgs eventArgs)
00138         {
00139             var selection = ConnectDevices.SelectedItems;
00140             DeviceListEntry entry = null;
00141
00142             // Prevent auto reconnect because we are voluntarily closing it
00143             // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
00144             EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
00145
00146             if (selection.Count > 0)
00147             {
00148                 var obj = selection[0];
00149                 entry = (DeviceListEntry)obj;
00150
00151                 if (entry != null)
00152                 {
00153                     EventHandlerForDevice.Current.CloseDevice();
00154                 }
00155             }
00156
00157             ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
00158
00159             UpdateConnectDisconnectButtonsAndList(true);
00160         }
00161
00162         /// <summary>
00163         /// Initialize device watchers to watch for the SuperMUTT.
00164         /// Several other ways of using a device selector to get the desired devices (the devices are really DeviceInformation objects):
00165         /// 1) Using only the Usage Page and the Usage Id of the device (enumerates any device with the same usage page and usage id)
00166         /// 2) Using the Usage Page, Usage Id, Vendor Id, Product Id (Same as above except it also matches the VIDs and PIDs)
00167         ///
00168         /// GetDeviceSelector return an AQS string that can be passed directly into DeviceWatcher.createWatcher() or  DeviceInformation.createFromIdAsync().
00169         ///
00170         /// In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.
00171         /// </summary>
00172         private void InitializeDeviceWatchers()
00173         {
00174             // SuperMUTT
00175             var superMuttSelector = HidDevice.GetDeviceSelector(SuperMutt.Device.UsagePage, SuperMutt.Device.UsageId, SuperMutt.Device.Vid, SuperMutt.Device.Pid);
00176
00177             // Create a device watcher to look for instances of the SuperMUTT device
00178             var superMuttWatcher = DeviceInformation.CreateWatcher(superMuttSelector);
00179
00180             // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
00181             AddDeviceWatcher(superMuttWatcher, superMuttSelector);
00182         }
00183
00184         private void StartHandlingAppEvents()
00185         {
00186             appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
00187             appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);
00188
00189             // This event is raised when the app is exited and when the app is suspended
00190             App.Current.Suspending += appSuspendEventHandler;
00191
00192             App.Current.Resuming += appResumeEventHandler;
00193         }
00194
00195         private void StopHandlingAppEvents()
00196         {
00197             // This event is raised when the app is exited and when the app is suspended
00198             App.Current.Suspending -= appSuspendEventHandler;
00199
00200             App.Current.Resuming -= appResumeEventHandler;
00201         }
00202
00203         /// <summary>
00204         /// Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.
00205         /// </summary>
00206         /// <param name="deviceWatcher"></param>
00207         /// <param name="deviceSelector">The AQS used to create the device watcher</param>
00208         private void AddDeviceWatcher(DeviceWatcher deviceWatcher, String deviceSelector)
00209         {
00210             deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
00211             deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
00212             deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);
00213
00214             mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
00215         }
00216
00217         /// <summary>
00218         /// Starts all device watchers including ones that have been individually stopped.
00219         /// </summary>
00220         private void StartDeviceWatchers()
00221         {
00222             // Start all device watchers
00223             watchersStarted = true;
00224             isAllDevicesEnumerated = false;
00225
00226             foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
00227             {
00228                 if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
00229                     && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
00230                 {
00231                     deviceWatcher.Start();
00232                 }
00233             }
00234         }
00235
00236         /// <summary>
00237         /// Stops all device watchers.
00238         /// </summary>
00239         private void StopDeviceWatchers()
00240         {
00241             // Stop all device watchers
00242             foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
00243             {
00244                 if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
00245                     || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
00246                 {
00247                     deviceWatcher.Stop();
00248                 }
00249             }
00250
00251             // Clear the list of devices so we don't have potentially disconnected devices around
00252             ClearDeviceEntries();
00253
00254             watchersStarted = false;
00255         }
00256
00257         /// <summary>
00258         /// Creates a DeviceListEntry for a device and adds it to the list of devices in the UI
00259         /// </summary>
00260         /// <param name="deviceInformation">DeviceInformation on the device to be added to the list</param>
00261         /// <param name="deviceSelector">The AQS used to find this device</param>
00262         private void AddDeviceToList(DeviceInformation deviceInformation, String deviceSelector)
00263         {
00264             // search the device list for a device with a matching interface ID
00265             var match = FindDevice(deviceInformation.Id);
00266
00267             // Add the device if it's new
00268             if (match == null)
00269             {
00270                 // Create a new element for this device interface, and queue up the query of its
00271                 // device information
00272                 match = new DeviceListEntry(deviceInformation, deviceSelector);
00273
00274                 // Add the new element to the end of the list of devices
00275                 listOfDevices.Add(match);
00276             }
00277         }
00278
00279         private void RemoveDeviceFromList(String deviceId)
00280         {
00281             // Removes the device entry from the interal list; therefore the UI
00282             var deviceEntry = FindDevice(deviceId);
00283
00284             listOfDevices.Remove(deviceEntry);
00285         }
00286
00287         private void ClearDeviceEntries()
00288         {
00289             listOfDevices.Clear();
00290         }
00291
00292         /// <summary>
00293         /// Searches through the existing list of devices for the first DeviceListEntry that has
00294         /// the specified device Id.
00295         /// </summary>
00296         /// <param name="deviceId">Id of the device that is being searched for</param>
00297         /// <returns>DeviceListEntry that has the provided Id; else a nullptr</returns>
00298         private DeviceListEntry FindDevice(String deviceId)
00299         {
00300             if (deviceId != null)
00301             {
00302                 foreach (DeviceListEntry entry in listOfDevices)
00303                 {
00304                     if (entry.DeviceInformation.Id == deviceId)
00305                     {
00306                         return entry;
00307                     }
00308                 }
00309             }
00310
00311             return null;
00312         }
00313
00314         /// <summary>
00315         /// We must stop the DeviceWatchers because device watchers will continue to raise events even if
00316         /// the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.
00317         /// </summary>
00318         /// <param name="sender"></param>
00319         /// <param name="eventArgs"></param>
00320         private void OnAppSuspension(Object sender, SuspendingEventArgs args)
00321         {
00322             if (watchersStarted)
00323             {
00324                 watchersSuspended = true;
00325                 StopDeviceWatchers();
00326             }
00327             else
00328             {
00329                 watchersSuspended = false;
00330             }
00331         }
00332
00333         /// <summary>
00334         /// See OnAppSuspension for why we are starting the device watchers again
00335         /// </summary>
00336         /// <param name="sender"></param>
00337         /// <param name="args"></param>
00338         private void OnAppResume(Object sender, Object args)
00339         {
00340             if (watchersSuspended)
00341             {
00342                 watchersSuspended = false;
00343                 StartDeviceWatchers();
00344             }
00345         }
00346
00347         /// <summary>
00348         /// We will remove the device from the UI
00349         /// </summary>
00350         /// <param name="sender"></param>
00351         /// <param name="deviceInformationUpdate"></param>
00352         private async void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
00353         {
00354             await rootPage.Dispatcher.RunAsync(
00355                 CoreDispatcherPriority.Normal,
00356                 new DispatchedHandler(() =>
00357                 {
00358                     rootPage.NotifyUser(deviceInformationUpdate.Id + " was removed.", NotifyType.StatusMessage);
00359
00360                     RemoveDeviceFromList(deviceInformationUpdate.Id);
00361                 }));
00362         }
00363
00364         /// <summary>
00365         /// This function will add the device to the listOfDevices so that it shows up in the UI
00366         /// </summary>
00367         /// <param name="sender"></param>
00368         /// <param name="deviceInformation"></param>
00369         private async void OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInformation)
00370         {
00371             await rootPage.Dispatcher.RunAsync(
00372                 CoreDispatcherPriority.Normal,
00373                 new DispatchedHandler(() =>
00374                 {
00375                     rootPage.NotifyUser(deviceInformation.Id + " was added.", NotifyType.StatusMessage);
00376
00377                     AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
00378                 }));
00379         }
00380
00381         /// <summary>
00382         /// Notify the UI whether or not we are connected to a device
00383         /// </summary>
00384         /// <param name="sender"></param>
00385         /// <param name="args"></param>
00386         private async void OnDeviceEnumerationComplete(DeviceWatcher sender, Object args)
00387         {
00388             await rootPage.Dispatcher.RunAsync(
00389                 CoreDispatcherPriority.Normal,
00390                 new DispatchedHandler(() =>
00391                 {
00392                     isAllDevicesEnumerated = true;
00393
00394                     // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
00395                     // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
00396                     if (EventHandlerForDevice.Current.IsDeviceConnected)
00397                     {
00398                         SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);
00399
00400                         ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
00401
00402                         UpdateConnectDisconnectButtonsAndList(false);
00403
00404                         rootPage.NotifyUser("Currently connected to: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00405                     }
00406                     else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
00407                     {
00408                         // We will be reconnecting to a device
00409                         ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
00410
00411                         UpdateConnectDisconnectButtonsAndList(false);
00412
00413                         rootPage.NotifyUser("Waiting to reconnect to device: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00414                     }
00415                     else
00416                     {
00417                         // Error occurred. EventHandlerForDevice will automatically prevent future automatic reconnections
00418
00419                         rootPage.NotifyUser("No devices currently selected", NotifyType.StatusMessage);
00420                     }
00421                 }));
00422         }
00423
00424         /// <summary>
00425         /// If all the devices have been enumerated, select the device in the list we connected to. Otherwise let the EnumerationComplete event
00426         /// from the device watcher handle the device selection
00427         /// </summary>
00428         /// <param name="sender"></param>
00429         /// <param name="onDeviceConnectedEventArgs"></param>
00430         private void OnDeviceConnected(EventHandlerForDevice sender, OnDeviceConnectedEventArgs onDeviceConnectedEventArgs)
00431         {
00432             // Find and select our connected device
00433             if (isAllDevicesEnumerated)
00434             {
00435                 ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
00436
00437                 if (onDeviceConnectedEventArgs.IsDeviceSuccessfullyConnected)
00438                 {
00439                     SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);
00440
00441                     UpdateConnectDisconnectButtonsAndList(false);
00442
00443                     rootPage.NotifyUser("Currently connected to: " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00444                 }
00445                 else
00446                 {
00447                     // Prevent auto reconnect from occuring
00448                     EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
00449
00450                     UpdateConnectDisconnectButtonsAndList(true);
00451                 }
00452             }
00453         }
00454
00455         /// <summary>
00456         /// The device was closed. If we will autoreconnect to the device, reflect that in the UI
00457         /// </summary>
00458         /// <param name="sender"></param>
00459         /// <param name="deviceInformation"></param>
00460         private async void OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation)
00461         {
00462             await rootPage.Dispatcher.RunAsync(
00463                 CoreDispatcherPriority.Normal,
00464                 new DispatchedHandler(() =>
00465                 {
00466                     // We were connected to the device that was unplugged, so change the "Disconnect from device" button
00467                     // to "Do not reconnect to device"
00468                     if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
00469                     {
00470                         ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
00471
00472                         UpdateConnectDisconnectButtonsAndList(false);
00473                     }
00474                     else
00475                     {
00476                         // We don't plan on automatically reconnecting to a device, so enable the connect button
00477                         UpdateConnectDisconnectButtonsAndList(true);
00478                     }
00479                 }));
00480         }
00481
00482         /// <summary>
00483         /// Selects the item in the UI's listbox that corresponds to the provided device id. If there are no
00484         /// matches, we will deselect anything that is selected.
00485         /// </summary>
00486         /// <param name="deviceIdToSelect">The device id of the device to select on the list box</param>
00487         private void SelectDeviceInList(String deviceIdToSelect)
00488         {
00489             // Don't select anything by default.
00490             ConnectDevices.SelectedIndex = -1;
00491
00492             for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
00493             {
00494                 if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
00495                 {
00496                     ConnectDevices.SelectedIndex = deviceListIndex;
00497
00498                     break;
00499                 }
00500             }
00501         }
00502
00503         /// <summary>
00504         /// When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.
00505         /// </summary>
00506         /// <param name="enableConnectButton">The state of ButtonConnectToDevice</param>
00507         private void UpdateConnectDisconnectButtonsAndList(Boolean enableConnectButton)
00508         {
00509             ButtonConnectToDevice.IsEnabled = enableConnectButton;
00510             ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;
00511
00512             ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
00513         }
00514     }
00515 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CachedFileUpdater_Remote Member List

This is the complete list of members for CachedFileUpdater_Remote, including all inherited members.
CachedFileUpdater_Remote() | CachedFileUpdater_Remote | [inline]
OutputFileAsync(StorageFile file) | CachedFileUpdater_Remote | [inline, private]
OverwriteButton_Click(object sender, RoutedEventArgs e) | CachedFileUpdater_Remote | [inline, private]
RenameButton_Click(object sender, RoutedEventArgs e) | CachedFileUpdater_Remote | [inline, private]
UpdateUI() | CachedFileUpdater_Remote | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ProactiveViewModel.cs Source File

  • PlayReady
  • cs
  • ViewModels

ProactiveViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Shared;
00013 using System;
00014 using Windows.Media.Protection;
00015 using Windows.Media.Protection.PlayReady;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate.ViewModels
00019 {
00020     public class ProactiveViewModel : ViewModelBase
00021     {
00022         // A KeyId can be used to directly request a media license prior to accessing the
00023         // associated proteced content
00024         private string keyId = "{6F651AE1-DBE4-4434-BCB4-690D1564C41C}";
00025         // The content assocated with the above KeyId
00026         private string moviePath = MainPage.SampleMovieURL;
00027         // The following test license service will return a persistent license with a MaxResDecode policy set
00028         private string licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&SecurityLevel=2000&MaxResDecode=1920x1080";
00029
00030         public RelayCommand CmdGetLicense { get; private set; }
00031         public RelayCommand CmdPlayMovie { get; private set; }
00032         public RelayCommand CmdStopMovie { get; private set; }
00033
00034         public PlayReadyInfoViewModel PlayReadyInfo { get; private set; }
00035         /// <summary>
00036         /// A view model class for the IndivReactive Scenario.
00037         /// </summary>
00038         public ProactiveViewModel(MediaElement mediaElement)
00039         {
00040             /// The ProtectionManager provides communication between the player and PlayReady DRM.
00041             /// The helper class will configure the protection manager for PlayReady and assign an
00042             /// event handler for Service requests.
00043             this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
00044             mediaElement.ProtectionManager = this.ProtectionManager;
00045             /// The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as
00046             /// SecurityLevel and hardware support within the UI.
00047             PlayReadyInfo = new PlayReadyInfoViewModel();
00048             PlayReadyInfo.RefreshStatics();
00049
00050             mediaElement.CurrentStateChanged += (s, a) => {
00051                 ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
00052             };
00053
00054             mediaElement.MediaFailed += (s, a) => {
00055                 ViewModelBase.Log("Media Failed::" + a.ErrorMessage);
00056             };
00057
00058             /// Proactive license acqusition will ensure a license is available
00059             /// prior to playback
00060             CmdGetLicense = new RelayCommand(() => { GetLicense(new Guid(this.KeyId)); }, () => { return PlayReadyHelpers.IsIndividualized; });
00061
00062             /// Play is enabled once a license is available
00063             CmdPlayMovie = new RelayCommand(() => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); },
00064                                             () => IsLicenseAvailable(new Guid(KeyId)));
00065             CmdStopMovie = new RelayCommand(() => { mediaElement.Stop(); SetPlaybackEnabled(false); },
00066                                             () => IsLicenseAvailable(new Guid(KeyId)));
00067
00068             /// Proactive individualization will ensure PlayReady have been configured
00069             /// to begin making license requests
00070             IndividualizeIfNeeded();
00071         }
00072
00073         /// A check is made to see of the device has been initialize and a indiv
00074         /// service request is sent if not. The callback will notify the app license
00075         /// calls can now be made.
00076         void IndividualizeIfNeeded()
00077         {
00078             if (!PlayReadyHelpers.IsIndividualized)
00079             {
00080                 PlayReadyHelpers.ProactiveIndividualization(() => {
00081                     CmdGetLicense.RaiseCanExecuteChanged();
00082                     PlayReadyInfo.RefreshStatics();
00083                 });
00084             }
00085         }
00086
00087         /// Tests to see if a license is available for playback.
00088         bool IsLicenseAvailable(Guid kid)
00089         {
00090             // return false is app is not initialized
00091             // creating a PlayReadyContentHeader in an un-initialized app
00092             // will cause an exception
00093             if (!PlayReadyHelpers.IsIndividualized)
00094             {
00095                 return false;
00096             }
00097             var contentHeader = new PlayReadyContentHeader(kid, "", PlayReadyEncryptionAlgorithm.Aes128Ctr, new Uri(licenseUrl), new Uri(licenseUrl), "", Guid.Empty);
00098             var licenses = new PlayReadyLicenseIterable(contentHeader, false);
00099             foreach (var license in licenses)
00100             {
00101                 if (license.UsableForPlay)
00102                 {
00103                     return true;
00104                 }
00105             }
00106
00107             return false;
00108         }
00109
00110         /// A content header is required to make a proactive license request.
00111         /// The header needs at minimum a KeyId and a License URL.
00112         /// Additionally you set a custom data property which will be passed in the signed
00113         /// section of the license request for use by the service.
00114         void GetLicense(Guid kid)
00115         {
00116             var laURL = new Uri(licenseUrl);
00117             var customData = "token:12345";
00118             var contentHeader =  new PlayReadyContentHeader(kid, "", PlayReadyEncryptionAlgorithm.Aes128Ctr, laURL, laURL, customData, Guid.Empty);
00119             PlayReadyHelpers.ProactiveLicenseAcquisition(contentHeader, () => {
00120                 CmdPlayMovie.RaiseCanExecuteChanged();
00121                 CmdStopMovie.RaiseCanExecuteChanged();
00122             });
00123         }
00124
00125         // The ServiceRequested and ProcessServiceRequest methods are not use in this
00126         // sample because service calls are made proactively. The app could be re-configured
00127         // to call Individualization proactively and reactively handle license
00128         // requests which would used these methods.
00129         MediaProtectionServiceCompletion serviceCompletionNotifier = null;
00130         void ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)
00131         {
00132             serviceCompletionNotifier = srEvent.Completion;
00133             IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
00134             ViewModelBase.Log(serviceRequest.GetType().Name);
00135             ProcessServiceRequest(serviceRequest);
00136         }
00137
00138         void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
00139         {
00140             //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
00141             if (serviceRequest is PlayReadyIndividualizationServiceRequest)
00142             {
00143                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
00144                PlayReadyInfo.RefreshStatics();
00145             }
00146             else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
00147             {
00148                 PlayReadyHelpers.ReactiveLicenseAcquisition(serviceRequest as PlayReadyLicenseAcquisitionServiceRequest,  serviceCompletionNotifier);
00149             }
00150         }
00151
00152         public string KeyId
00153         {
00154             get
00155             {
00156                 return keyId;
00157             }
00158             set
00159             {
00160                 if (keyId != value)
00161                 {
00162                     keyId = value;
00163                     RaisePropertyChanged();
00164                 }
00165             }
00166         }
00167
00168         public string MoviePath
00169         {
00170             get
00171             {
00172                 return moviePath;
00173             }
00174             set
00175             {
00176                 if (moviePath != value)
00177                 {
00178                     moviePath = value;
00179                     RaisePropertyChanged();
00180                 }
00181             }
00182         }
00183     }
00184 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/pch.cpp Source File

  • UserCertificateStore
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/ViewModel/Model.cs Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • ViewModel

Model.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006
00007 namespace OneHandedUse_TailoredMultipleViews.ViewModel
00008 {
00009     public class Model
00010     {
00011         public Uri ImageUri { get; set; }
00012     }
00013 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/Scenario1_Metrics.xaml.h Source File

  • AnimationMetrics
  • cpp

Scenario1_Metrics.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario1_Metrics.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// Display animation metrics.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario1_Metrics sealed
00015     {
00016     public:
00017         Scenario1_Metrics();
00018     private:
00019         MainPage^ rootPage;
00020         void DisplayMetrics(Windows::UI::Core::AnimationMetrics::AnimationEffect effect, Windows::UI::Core::AnimationMetrics::AnimationEffectTarget target);
00021         void Animations_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00022     };
00023 }
Generated on Fri Nov 15 2024 22:17:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareUltralightCommands.cs Source File

  • Nfc
  • PcscSdk

MifareUltralightCommands.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013
00014 namespace MifareUltralight
00015 {
00016     /// <summary>
00017     /// Mifare UL Read commad when sent to the card the card is expected to return 16 byte of 4 Mifare
00018     /// pages starting at address addr.
00019     /// </summary>
00020     public class Read : Pcsc.ReadBinary
00021     {
00022         public Read(byte pageAddress)
00023             : base(pageAddress, 16)
00024         {
00025         }
00026     }
00027     /// <summary>
00028     /// Mifare UL Write commad when sent to the card, writes 4 bytes (1 Mifare block) at given
00029     /// block address addr.
00030     /// </summary>
00031     public class Write : Pcsc.UpdateBinary
00032     {
00033         public byte[] Data
00034         {
00035             set { base.CommandData = ((value.Length != 4) ? ResizeArray(value, 4) : value); }
00036             get { return base.CommandData; }
00037         }
00038         private static byte[] ResizeArray(byte[] data, int size)
00039         {
00040             Array.Resize<byte>(ref data, size);
00041             return data;
00042         }
00043         public Write(byte address, ref byte[] data)
00044             : base(address, ((data.Length != 4) ? ResizeArray(data, 4) : data))
00045         {
00046         }
00047     }
00048     /// <summary>
00049     /// Mifare UL GetUid command
00050     /// </summary>
00051     public class GetUid : Pcsc.GetUid
00052     {
00053         public GetUid()
00054             : base()
00055         {
00056         }
00057     }
00058     /// <summary>
00059     /// Mifare UL GetHistoricalBytes command
00060     /// </summary>
00061     public class GetHistoricalBytes : Pcsc.GetHistoricalBytes
00062     {
00063         public GetHistoricalBytes()
00064             : base()
00065         {
00066         }
00067     }
00068     /// <summary>
00069     /// Mifare response APDU
00070     /// </summary>
00071     public class ApduResponse : Pcsc.ApduResponse
00072     {
00073         public ApduResponse()
00074             : base()
00075         {
00076         }
00077     }
00078 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GeneralAuthenticate Member List

This is the complete list of members for GeneralAuthenticate, including all inherited members.
Address | GeneralAuthenticate |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GeneralAuthenticate(GeneralAuthenticateVersionNumber version, ushort address, GeneralAuthenticateKeyType keyType, byte keyNo) | GeneralAuthenticate | [inline]
GeneralAuthenticateKeyType enum name | GeneralAuthenticate |
GeneralAuthenticateVersionNumber enum name | GeneralAuthenticate |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
KeyNumber | GeneralAuthenticate |
KeyType | GeneralAuthenticate |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
VersionNumber | GeneralAuthenticate |
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemsDataSource Member List

This is the complete list of members for ItemsDataSource, including all inherited members.
CreateItems() | ItemsDataSource | [inline, private, static]
GetAllItems() | ItemsDataSource | [inline, static]
GetItemById(int id) | ItemsDataSource | [inline, static]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/pch.h Source File

  • BluetoothLE
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #define NOMINMAX
00004 #define __STDC_WANT_SECURE_LIB__ 1
00005 #include <unknwn.h>
00006 #include "winrt/Windows.Foundation.h"
00007 #include "winrt/Windows.Foundation.Collections.h"
00008 #include "winrt/Windows.ApplicationModel.Activation.h"
00009 #include "winrt/Windows.Devices.Bluetooth.h"
00010 #include "winrt/Windows.Devices.Bluetooth.GenericAttributeProfile.h"
00011 #include "winrt/Windows.Devices.Enumeration.h"
00012 #include "winrt/Windows.Security.Cryptography.h"
00013 #include "winrt/Windows.Storage.Streams.h"
00014 #include "winrt/Windows.System.h"
00015 #include "winrt/Windows.UI.Core.h"
00016 #include "winrt/Windows.UI.Xaml.h"
00017 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00018 #include "winrt/Windows.UI.Xaml.Controls.h"
00019 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00020 #include "winrt/Windows.UI.Xaml.Documents.h"
00021 #include "winrt/Windows.UI.Xaml.Interop.h"
00022 #include "winrt/Windows.UI.Xaml.Markup.h"
00023 #include "winrt/Windows.UI.Xaml.Media.h"
00024 #include "winrt/Windows.UI.Xaml.Media.Imaging.h"
00025 #include "winrt/Windows.UI.Xaml.Navigation.h"
00026 #include "winrt/SDKTemplate.h"
00027 #include <ctime>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/SampleConfiguration.cpp Source File

  • CustomCapability
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Connect to an NT Service",                 "SDKTemplate.MeteringData" },
00021     { "Connect to the FX2 Device",                "SDKTemplate.DeviceConnect" },
00022     { "Send IOCTLs to the device",                "SDKTemplate.DeviceIO" },
00023     { "Handle asynchronous device events",        "SDKTemplate.DeviceEvents" },
00024     { "Read and Write operations",                "SDKTemplate.DeviceReadWrite" },
00025     { "Custom system event trigger",              "SDKTemplate.CustomTrigger" },
00026     { "Firmware access",                          "SDKTemplate.FirmwareAccess" },
00027 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripListView.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "TripListView.xaml.h"
00014
00015 using namespace AdventureWorks;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 TripListView::TripListView()
00030 {
00031     InitializeComponent();
00032 }
00033
00034 void TripListView::tripListBox_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ args)
00035 {
00036     this->DefaultViewModel->SelectionChanged();
00037
00038     // Immediately deselect the item so that the list box returns to its initial state.
00039     DefaultViewModel->SelectedTrip = nullptr;
00040
00041 }
00042
00043 void TripListView::Footer_Click(Platform::Object^ sender, RoutedEventArgs^ args)
00044 {
00045     create_task(Windows::System::Launcher::LaunchUriAsync(ref new Uri(((HyperlinkButton^)sender)->Tag->ToString())));
00046 }
00047
00048 TripListViewModel^ TripListView::DefaultViewModel::get()
00049 {
00050     return this->defaultViewModel;
00051 }
00052
00053 /// <summary>
00054 /// Handles initial launch, and errors if a trip detail view can't find the trip requested.
00055 /// </summary>
00056 /// <param name="args">Details about any errors that may have occurred, or null.</param>
00057 void TripListView::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ args)
00058 {
00059     defaultViewModel = (TripListViewModel^)this->DataContext;
00060     if (!tripsLoaded)
00061     {
00062         // On initial launch, load the trips.
00063         defaultViewModel->LoadTrips();
00064         tripsLoaded = true;
00065     }
00066
00067     if (args->Parameter != nullptr)
00068     {
00069         String^ errorMsg = dynamic_cast<String^>(args->Parameter);
00070         if (errorMsg != nullptr)
00071         {
00072             auto messageDialog = ref new Windows::UI::Popups::MessageDialog(errorMsg, "Unable to open Trip");
00073             create_task(messageDialog->ShowAsync());
00074         }
00075     }
00076 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/Scenario3_CustomDecay.xaml.cpp Source File

  • SpatialSound
  • cpp

Scenario3_CustomDecay.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #include "pch.h"
00014 #include "Scenario3_CustomDecay.xaml.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Scenario3_CustomDecay::Scenario3_CustomDecay() : _rootPage(MainPage::Current)
00030 {
00031     InitializeComponent();
00032     auto hr = _customDecaySound.Initialize(L"assets//MonoSound.wav");
00033     if (SUCCEEDED(hr))
00034     {
00035         _timer = ref new DispatcherTimer();
00036         _timerEventToken = _timer->Tick += ref new EventHandler<Platform::Object^>(this, &Scenario3_CustomDecay::OnTimerTick);
00037         TimeSpan timespan;
00038         timespan.Duration = 10000 / 30;
00039         _timer->Interval = timespan;
00040         EnvironmentComboBox->SelectedIndex = static_cast<int>(_customDecaySound.GetEnvironment());
00041         _rootPage->NotifyUser("Stopped", NotifyType::StatusMessage);
00042     }
00043     else
00044     {
00045         if (hr == E_NOTIMPL)
00046         {
00047             _rootPage->NotifyUser("HRTF API is not supported on this platform. Use X3DAudio API instead - https://code.msdn.microsoft.com/XAudio2-Win32-Samples-024b3933", NotifyType::ErrorMessage);
00048         }
00049         else
00050         {
00051             throw ref new COMException(hr);
00052         }
00053     }
00054
00055     _initialized = SUCCEEDED(hr);
00056 }
00057
00058 Scenario3_CustomDecay::~Scenario3_CustomDecay()
00059 {
00060     if (_timerEventToken.Value != 0)
00061     {
00062         _timer->Tick -= _timerEventToken;
00063     }
00064 }
00065
00066 void SDKTemplate::Scenario3_CustomDecay::EnvironmentComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00067 {
00068     if (_initialized)
00069     {
00070         _customDecaySound.SetEnvironment(static_cast<HrtfEnvironment>(EnvironmentComboBox->SelectedIndex));
00071     }
00072 }
00073
00074 void SDKTemplate::Scenario3_CustomDecay::SourcePositionX_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e)
00075 {
00076     _x = static_cast<float>(e->NewValue);
00077 }
00078
00079 void SDKTemplate::Scenario3_CustomDecay::SourcePositionY_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e)
00080 {
00081     _y = static_cast<float>(e->NewValue);
00082 }
00083
00084 void SDKTemplate::Scenario3_CustomDecay::SourcePositionZ_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e)
00085 {
00086     _z = static_cast<float>(e->NewValue);
00087 }
00088
00089 void SDKTemplate::Scenario3_CustomDecay::OnTimerTick(Object^ sender, Object^ e)
00090 {
00091     // Update the source position to update the gain applied.
00092     _customDecaySound.OnUpdate(_x, _y, _z);
00093 }
00094
00095 void SDKTemplate::Scenario3_CustomDecay::PlayButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00096 {
00097     if (_initialized)
00098     {
00099         _customDecaySound.Start();
00100         _timer->Start();
00101         _rootPage->NotifyUser("Playing", NotifyType::StatusMessage);
00102     }
00103 }
00104
00105 void SDKTemplate::Scenario3_CustomDecay::StopButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00106 {
00107     if (_initialized)
00108     {
00109         _customDecaySound.Stop();
00110         _timer->Stop();
00111         _rootPage->NotifyUser("Stopped", NotifyType::StatusMessage);
00112     }
00113 }
Generated on Fri Nov 15 2024 22:21:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_SynthesizeSSML.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_SynthesizeSSML.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario_SynthesizeSSML sealed
00024     {
00025     public:
00026         Scenario_SynthesizeSSML();
00027     private:
00028         SDKTemplate::MainPage^ rootPage;
00029
00030         Windows::Media::SpeechSynthesis::SpeechSynthesizer^ synthesizer;
00031         Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ synthesisStream;
00032         Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
00033         Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
00034
00035         void Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void ListboxVoiceChooser_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00037         void media_MediaEnded(Windows::Media::Playback::MediaPlayer^ timedMetadataTrack, Platform::Object^ e);
00038         Concurrency::task <void> SynthesizeSSMLStream();
00039         void RegisterForMarkEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem);
00040         void RegisterMetadataHandlerForMarks(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
00041         void metadata_MarkCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^ args);
00042         void FillTextBox(Windows::Media::Core::SpeechCue^ cue);
00043
00044         void InitializeListboxVoiceChooser();
00045         void UpdateSSMLText();
00046     };
00047 }
Generated on Fri Nov 15 2024 22:21:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/BufferHelper.h Source File

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

BufferHelper.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace WindowsPreview {
00015     namespace Media {
00016         namespace Capture {
00017             namespace Frames {
00018
00019                 // Target API will return a IBuffer providing this partial view of a larger IBuffer
00020                 // And this class will disappear
00021                 public ref class BufferView sealed
00022                 {
00023                 public:
00024                     property Windows::Storage::Streams::IBuffer^ Buffer
00025                     {
00026                         Windows::Storage::Streams::IBuffer^ get() { return _buffer; }
00027                     }
00028                     property uint32_t Offset
00029                     {
00030                         uint32_t get() { return _offset; }
00031                     }
00032                     property uint32_t Size
00033                     {
00034                         uint32_t get() { return _size; }
00035                     }
00036                 private:
00037                     Windows::Storage::Streams::IBuffer^ _buffer;
00038                     uint32_t _offset;
00039                     uint32_t _size;
00040                 internal:
00041                     BufferView(Windows::Storage::Streams::IBuffer^ buffer, uint32_t offset, uint32_t size)
00042                         : _buffer(buffer), _offset(offset), _size(size)
00043                     {}
00044                 };
00045
00046                 class BufferHelper
00047                 {
00048                 public:
00049                     BufferHelper(Windows::Storage::Streams::IBuffer^ buffer)
00050                         : _buffer(buffer), _size(buffer->Capacity)
00051                     {
00052                         HRESULT hr = (reinterpret_cast<IInspectable*>(_buffer))->QueryInterface(_bufferByteAccess.ReleaseAndGetAddressOf());
00053                         if (FAILED(hr))
00054                         {
00055                             throw ref new Platform::Exception(hr);
00056                         }
00057
00058                         hr = _bufferByteAccess->Buffer(&_bytes);
00059                         if (FAILED(hr))
00060                         {
00061                             throw ref new Platform::Exception(hr);
00062                         }
00063                     }
00064                     BufferHelper(BufferView^ bufferView)
00065                         : _buffer(bufferView->Buffer), _size(bufferView->Size)
00066                     {
00067                         HRESULT hr = (reinterpret_cast<IInspectable*>(_buffer))->QueryInterface(_bufferByteAccess.ReleaseAndGetAddressOf());
00068                         if (FAILED(hr))
00069                         {
00070                             throw ref new Platform::Exception(hr);
00071                         }
00072
00073                         hr = _bufferByteAccess->Buffer(&_bytes);
00074                         if (FAILED(hr))
00075                         {
00076                             throw ref new Platform::Exception(hr);
00077                         }
00078                         _bytes += bufferView->Offset;
00079                     }
00080
00081                     template<typename T>
00082                     const T* GetPtrAt(uint32_t byteOffset) const
00083                     {
00084                         if (byteOffset + sizeof(T) > _size)
00085                         {
00086                             throw ref new OutOfBoundsException();
00087                         }
00088                         return reinterpret_cast<const T*>(_bytes + byteOffset);
00089                     }
00090
00091                     template<typename parentType, typename repeatedType, uint32_t declaredCount = 1>
00092                     void CheckBufferSize(const parentType* ptr, uint32_t effectiveCount)
00093                     {
00094                         auto offset = reinterpret_cast<const BYTE*>(ptr) - _bytes;
00095                         auto effectiveSize = sizeof_composedStructure<parentType, repeatedType, declaredCount>(effectiveCount);
00096                         if (offset + effectiveSize > _size)
00097                         {
00098                             throw ref new OutOfBoundsException();
00099                         }
00100                     }
00101                 private:
00102                     BYTE* _bytes = nullptr;
00103                     uint32_t _offset = 0;
00104                     uint32_t _size = 0;
00105                     Microsoft::WRL::ComPtr<Windows::Storage::Streams::IBufferByteAccess> _bufferByteAccess;
00106                     Windows::Storage::Streams::IBuffer^ _buffer;
00107                 };
00108
00109             }
00110         }
00111     }
00112 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CachedFileUpdater_Local Member List

This is the complete list of members for CachedFileUpdater_Local, including all inherited members.
CachedFileUpdater_Local() | CachedFileUpdater_Local | [inline]
FileIsCurrentButton_Click(object sender, RoutedEventArgs e) | CachedFileUpdater_Local | [inline, private]
OutputFileAsync(StorageFile file) | CachedFileUpdater_Local | [inline, private]
ProvideUpdatedVersionButton_Click(object sender, RoutedEventArgs e) | CachedFileUpdater_Local | [inline, private]
UpdateUI(UIStatus uiStatus) | CachedFileUpdater_Local | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/Scenario2_Manage.xaml.cs Source File

  • PasswordVault
  • cs

Scenario2_Manage.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using Windows.Security.Credentials;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario2_Manage : Page
00022     {
00023         private MainPage rootPage = MainPage.Current;
00024
00025         const int ElementNotFound = unchecked((int)0x80070490);
00026
00027         public Scenario2_Manage()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         private void RetrieveCredentials_Click(Object sender, RoutedEventArgs args)
00033         {
00034             var resource = InputResourceValue.Text;
00035             var userName = InputUserNameValue.Text;
00036
00037             // Clear previous output.
00038             RetrievedCredentials.Items.Clear();
00039             rootPage.NotifyUser("", NotifyType.StatusMessage);
00040
00041             var vault = new PasswordVault();
00042             IReadOnlyList<PasswordCredential> creds = null;
00043
00044             // The credential retrieval functions raise an "Element not found"
00045             // exception if there were no matches.
00046             try
00047             {
00048                 // Perform the desired queryuserName
00049                 if (resource == "" && userName == "")
00050                 {
00051                     // Both resource and user name are empty: Use retrieveAll().
00052                     creds = vault.RetrieveAll();
00053                 }
00054                 else if (userName == "")
00055                 {
00056                     // Resource is provided but no user name: Use findAllByResource().
00057                     creds = vault.FindAllByResource(resource);
00058                 }
00059                 else if (resource == "")
00060                 {
00061                     // User name is provided but no resource: Use findByUserName().
00062                     creds = vault.FindAllByUserName(userName);
00063                 }
00064                 else
00065                 {
00066                     // Both resource and user name are provided: Use retrieve().
00067                     PasswordCredential cred = vault.Retrieve(resource, userName);
00068                     // Add it to our results if the retrieval was successful.
00069                     if (cred != null)
00070                     {
00071                         creds = new List<PasswordCredential>() { cred };
00072                     }
00073                 }
00074             }
00075             catch (Exception e)
00076             {
00077                 if (e.HResult != ElementNotFound)
00078                 {
00079                     throw;
00080                 }
00081             }
00082
00083             // Display the results. Note that the password field is initially blank.
00084             // You must call retrievePassword() to get the password.
00085
00086             if (creds == null || creds.Count == 0)
00087             {
00088                 rootPage.NotifyUser("No matching credentials", NotifyType.ErrorMessage);
00089             }
00090             else
00091             {
00092                 ItemCollection items = RetrievedCredentials.Items;
00093                 foreach (PasswordCredential cred in creds)
00094                 {
00095                     var item = new TextBlock();
00096                     item.DataContext = cred;
00097                     item.Text = cred.Resource + ": " + cred.UserName;
00098                     items.Add(item);
00099                 }
00100                 rootPage.NotifyUser("Credentials found: " + items.Count.ToString(), NotifyType.StatusMessage);
00101             }
00102         }
00103
00104         private void RevealPasswords_Click(Object sender, RoutedEventArgs args)
00105         {
00106             IList<Object> selectedItems = RetrievedCredentials.SelectedItems;
00107             if (selectedItems.Count > 0)
00108             {
00109                 int retrievedCount = 0;
00110                 foreach (object o in selectedItems)
00111                 {
00112                     TextBlock item = (TextBlock)o;
00113                     PasswordCredential cred = (PasswordCredential)item.DataContext;
00114
00115                     // The credential retrieval functions raise an "Element not found"
00116                     // exception if the credential is no longer in the PasswordVault.
00117                     // (For example, if the user manually removed the credential via the
00118                     // Control Panel.)
00119                     try
00120                     {
00121                         cred.RetrievePassword();
00122                         item.Text = cred.Resource + ": " + cred.UserName + " (" + cred.Password + ")";
00123                         retrievedCount++;
00124                     }
00125                     catch (Exception e)
00126                     {
00127                         if (e.HResult != ElementNotFound)
00128                         {
00129                             throw;
00130                         }
00131                         item.Text = cred.Resource + ": " + cred.UserName + " (password unavailable)";
00132                     }
00133
00134                 }
00135                 rootPage.NotifyUser("Passwords retrieved: " + retrievedCount.ToString(), NotifyType.StatusMessage);
00136             }
00137             else
00138             {
00139                 rootPage.NotifyUser("No credentials selected", NotifyType.ErrorMessage);
00140             }
00141         }
00142
00143         private void RemoveCredentials_Click(Object sender, RoutedEventArgs args)
00144         {
00145             IList<object> selectedItems = RetrievedCredentials.SelectedItems;
00146             if (selectedItems.Count > 0)
00147             {
00148                 var vault = new PasswordVault();
00149                 int removedCount = 0;
00150
00151                 // Take a snapshot of the selectedOptions collection because we will be
00152                 // changing the collection during the loop.
00153                 var snapshot = new List<object>(selectedItems);
00154
00155                 foreach (object o in snapshot)
00156                 {
00157                     TextBlock item = (TextBlock)o;
00158                     PasswordCredential cred = (PasswordCredential)item.DataContext;
00159                     RetrievedCredentials.Items.Remove(o);
00160
00161                     try
00162                     {
00163                         vault.Remove(cred);
00164                         removedCount++;
00165                     }
00166                     catch (Exception e)
00167                     {
00168                         // Ignore exception if the credential was already removed.
00169                         if (e.HResult != ElementNotFound)
00170                         {
00171                             throw;
00172                         }
00173                     }
00174                 }
00175                 rootPage.NotifyUser("Credentials removed: " + removedCount.ToString(), NotifyType.StatusMessage);
00176             }
00177             else
00178             {
00179                 rootPage.NotifyUser("No credentials selected", NotifyType.ErrorMessage);
00180             }
00181         }
00182     }
00183 }
Generated on Fri Nov 15 2024 22:20:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario2_VideoChat.xaml.cpp Source File

  • SimpleCommunication
  • cpp

Scenario2_VideoChat.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_VideoChat.xaml.h"
00014 #include <wrl\wrappers\corewrappers.h>
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Microsoft::WRL::Wrappers;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Controls;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 Scenario2_VideoChat::Scenario2_VideoChat()
00024     : _active(false)
00025     , _initialization(false)
00026     , _isTerminator(false)
00027     , _role(Role::uninitialized)
00028     , _dispatcher(nullptr)
00029     , _navigationDisabled(FALSE)
00030 {
00031     InitializeComponent();
00032
00033     _sdkSample.Initialize();
00034     _dispatcher = Window::Current->Dispatcher;
00035
00036     MainPage::EnsureExtensionRegistration();
00037 }
00038
00039 /// <summary>
00040 /// Invoked when this page is about to be displayed in a Frame.
00041 /// </summary>
00042 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043 /// property is typically used to configure the page.</param>
00044 void Scenario2_VideoChat::OnNavigatedTo(NavigationEventArgs^ e)
00045 {
00046     LockScenarioChange(); // Lock
00047
00048     Initialize().then([this](task<void> asyncInfo)
00049     {
00050         Windows::Foundation::HResult hr;
00051         try
00052         {
00053             asyncInfo.get();
00054             hr.Value = S_OK;
00055         }
00056         catch (Platform::Exception^ e)
00057         {
00058             hr.Value = e->HResult;
00059         }
00060
00061         return OnInitializeCompleted(hr).then([this]()
00062         {
00063             UnlockScenarioChange(); // Unlock
00064         });
00065     });
00066 }
00067
00068 void Scenario2_VideoChat::OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e)
00069 {
00070     if (InterlockedOr(&_navigationDisabled, 0))
00071     {
00072         e->Cancel = true;
00073     }
00074     else
00075     {
00076         RemoteVideo->MediaFailed -= _mediaElementFailedEventRegistrationToken;
00077         _mediaElementFailedEventRegistrationToken.Value = 0;
00078         Deactivate();
00079     }
00080 }
00081
00082 void Scenario2_VideoChat::OnNavigatedFrom(NavigationEventArgs^ e)
00083 {
00084     _sdkSample.Deinitialize();
00085 }
00086
00087 void Scenario2_VideoChat::CallButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00088 {
00089     auto address = IpAddressTextbox->Text;
00090     if (address)
00091     {
00092         _role = Role::active;
00093         RemoteVideo->Source = ref new Windows::Foundation::Uri("stsp://" + address);
00094         RemoteVideo->Play();
00095         IpAddressTextbox->IsEnabled = false;
00096         CallButton->IsEnabled = false;
00097         _sdkSample.DisplayStatus("Initiating connection... Please wait!");
00098     }
00099 }
00100
00101 void Scenario2_VideoChat::EndCallButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00102 {
00103     bool callEndCall = false;
00104
00105     if (!_isTerminator && _active)
00106     {
00107         _isTerminator = true;
00108         callEndCall = true;
00109         LockScenarioChange(); // Lock
00110     }
00111
00112     if (callEndCall)
00113     {
00114         EndCall().then([this](task<void>)
00115         {
00116             _isTerminator = false;
00117         });
00118     }
00119 }
00120
00121 task<void> Scenario2_VideoChat::Initialize()
00122 {
00123     if (_initialization || _device)
00124     {
00125         return create_task([]() {});
00126     }
00127     _initialization = true;
00128     _active = true;
00129
00130     return task<DeviceInformationCollection^>(DeviceInformation::FindAllAsync(DeviceClass::VideoCapture)).then([this](DeviceInformationCollection^ devices)
00131     {
00132         auto videoCaptures = devices->Size;
00133         return task<DeviceInformationCollection^>(DeviceInformation::FindAllAsync(DeviceClass::AudioCapture)).then([this, videoCaptures](DeviceInformationCollection^ devices)
00134         {
00135             auto audioCaptures = devices->Size;
00136             return ((videoCaptures > 0) && (audioCaptures) > 0);
00137         });
00138     }).then([this](task<bool> asyncInfo)
00139     {
00140         bool succeed;
00141         try
00142         {
00143             succeed = asyncInfo.get();
00144         }
00145         catch (Platform::Exception^ e)
00146         {
00147             Windows::Foundation::HResult hr;
00148             hr.Value = e->HResult;
00149             _sdkSample.FormatError(hr, "SDKTemplate.NoCamera", "A machine with a camera and a microphone is required to run this sample.");
00150             throw;
00151         }
00152
00153         if (succeed)
00154         {
00155             CaptureDevice ^device = ref new CaptureDevice();
00156
00157             return device->InitializeAsync().then([this, device]()
00158             {
00159                 _device = device;
00160                 _mediaCaptureFailedEventRegistrationToken = _device->Failed += ref new CaptureFailedHandler(this, &Scenario2_VideoChat::OnMediaCaptureFailed);
00161                 _incomingConnectionEventRegistrationToken = _device->IncomingConnectionEvent += ref new IncomingConnectionEventHandler(this, &Scenario2_VideoChat::OnIncomingConnection);
00162                 return StartRecordingToCustomSinkAsync();
00163             });
00164         }
00165         else
00166         {
00167             _sdkSample.DisplayError("A machine with a camera and a microphone is required to run this sample.");
00168             UnlockScenarioChange();
00169             cancel_current_task();
00170         }
00171     });
00172 }
00173
00174 task<void> Scenario2_VideoChat::OnInitializeCompleted(Windows::Foundation::HResult hr)
00175 {
00176     return create_task([this, hr]()
00177     {
00178         if (FAILED(hr.Value))
00179         {
00180             UnlockScenarioChange();
00181             _initialization = false;
00182
00183             Deactivate();
00184
00185             _sdkSample.FormatError(hr, "", ref new Platform::String(L"Initialization") + " error: ");
00186             throw ref new Platform::Exception(hr.Value);
00187         }
00188
00189         return task<void>(_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00190         {
00191             CallButton->IsEnabled = true;
00192             IpAddressTextbox->IsEnabled = true;
00193             EndCallButton->IsEnabled = false;
00194
00195             CallButton->IsEnabled = true;
00196             EndCallButton->IsEnabled = true;
00197             if (_mediaElementFailedEventRegistrationToken.Value == 0)
00198             {
00199                 _mediaElementFailedEventRegistrationToken = RemoteVideo->MediaFailed += ref new Windows::UI::Xaml::ExceptionRoutedEventHandler(this, &Scenario2_VideoChat::VideoPlaybackErrorHandler);
00200             }
00201
00202             // Both side start out as passive
00203             _role = Role::passive;
00204             _isTerminator = false;
00205             _initialization = false;
00206
00207             _sdkSample.DisplayStatus("Tap 'Call' button to start call");
00208         }
00209         )));
00210     });
00211 }
00212
00213 task<void> Scenario2_VideoChat::EndCall()
00214 {
00215     return CleanUp().then([this]()
00216     {
00217
00218         if (_active)
00219         {
00220             return Initialize().then([this](task<void> asyncInfo)
00221             {
00222                 Windows::Foundation::HResult hr;
00223                 try
00224                 {
00225                     asyncInfo.get();
00226                     hr.Value = S_OK;
00227                 }
00228                 catch (Platform::Exception^ e)
00229                 {
00230                     hr.Value = e->HResult;
00231                 }
00232
00233                 return OnInitializeCompleted(hr).then([this](task<void> asyncInfo) {});
00234             });
00235         }
00236         return create_task([]() {});
00237     });
00238 }
00239
00240 task<void> Scenario2_VideoChat::Deactivate()
00241 {
00242     _active = false;
00243
00244     return CleanUp();
00245 }
00246
00247 task<void> Scenario2_VideoChat::CleanUp()
00248 {
00249     if (_device != nullptr)
00250     {
00251         _device->Failed -= _mediaCaptureFailedEventRegistrationToken;
00252         _device->IncomingConnectionEvent -= _incomingConnectionEventRegistrationToken;
00253     }
00254     _mediaCaptureFailedEventRegistrationToken.Value = 0;
00255     _incomingConnectionEventRegistrationToken.Value = 0;
00256
00257     return task<void>(_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00258     {
00259         CallButton->IsEnabled = false;
00260         EndCallButton->IsEnabled = false;
00261     }
00262         ))).then([this]()
00263     {
00264         if (_device != nullptr)
00265         {
00266             auto device = _device;
00267             _device = nullptr;
00268
00269             return device->CleanupAsync();
00270         }
00271
00272         return create_task([]() {});
00273     }).then([this](task<void>)
00274     {
00275         if (!_active)
00276         {
00277             return;
00278         }
00279         _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00280         {
00281             RemoteVideo->Source = nullptr;
00282         }));
00283     });
00284 }
00285
00286 task<void> Scenario2_VideoChat::StartRecordingToCustomSinkAsync()
00287 {
00288     auto mediaEncodingProfile = Windows::Media::MediaProperties::MediaEncodingProfile::CreateMp4(Windows::Media::MediaProperties::VideoEncodingQuality::Qvga);
00289
00290     mediaEncodingProfile->Video->FrameRate->Numerator = 15;
00291     mediaEncodingProfile->Video->FrameRate->Denominator = 1;
00292     mediaEncodingProfile->Container = nullptr;
00293
00294     return _device->StartRecordingAsync(mediaEncodingProfile);
00295 }
00296
00297 void Scenario2_VideoChat::OnIncomingConnection(Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^ sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^ args)
00298 {
00299     args->Accept();
00300
00301     _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this, args]()
00302     {
00303         EndCallButton->IsEnabled = true;
00304         _isTerminator = false;
00305
00306         HString url_, header_;
00307         header_.Set(L"stsp://");
00308         WindowsTrimStringStart(reinterpret_cast<HSTRING>(args->RemoteUrl), header_.Get(), url_.GetAddressOf());
00309         auto url = reinterpret_cast<Platform::String^>(url_.Get());
00310
00311         switch (_role)
00312         {
00313         case Role::active:
00314             _sdkSample.DisplayStatus("Connected. Remote machine address: " + url);
00315             break;
00316         case Role::passive:
00317         {
00318             auto address = args->RemoteUrl;
00319             RemoteVideo->Source = ref new Windows::Foundation::Uri(address);
00320             RemoteVideo->Play();
00321             _sdkSample.DisplayStatus("Connected. Remote machine address: " + url);
00322         }
00323         IpAddressTextbox->IsEnabled = false;
00324         CallButton->IsEnabled = false;
00325         break;
00326         default:
00327             break;
00328         }
00329     }
00330     ));
00331 }
00332
00333 void Scenario2_VideoChat::OnMediaCaptureFailed(CaptureDevice^ sender, CaptureFailedEventArgs^ errorEventArgs)
00334 {
00335     _sdkSample.FormatError(errorEventArgs, "Capture error code: ");
00336
00337     _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00338     {
00339         if (!_isTerminator && _active)
00340         {
00341             _isTerminator = true;
00342
00343             EndCall().then([this](task<void> previousTask)
00344             {
00345                 _isTerminator = false;
00346             });
00347         }
00348     }));
00349 }
00350
00351 void Scenario2_VideoChat::VideoPlaybackErrorHandler(Platform::Object^ sender, Windows::UI::Xaml::ExceptionRoutedEventArgs^ e)
00352 {
00353     // See MF_MEDIA_ENGINE_ERR
00354     if (e->ErrorMessage != "MF_MEDIA_ENGINE_ERR_NOERROR")
00355     {
00356         _sdkSample.DisplayError(e->ErrorMessage);
00357
00358         _dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00359         {
00360             if (!_isTerminator && _active)
00361             {
00362                 _isTerminator = true;
00363
00364                 EndCall().then([this](task<void> previousTask)
00365                 {
00366                     _isTerminator = false;
00367                 });
00368             }
00369         }));
00370     }
00371 }
00372
00373 void Scenario2_VideoChat::LockScenarioChange()
00374 {
00375     InterlockedCompareExchange(&_navigationDisabled, TRUE, FALSE);
00376 }
00377
00378 void Scenario2_VideoChat::UnlockScenarioChange()
00379 {
00380     InterlockedCompareExchange(&_navigationDisabled, FALSE, TRUE);
00381 }
Generated on Fri Nov 15 2024 22:21:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/SampleConfiguration.h Source File

  • WebAccountManagement
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Web Account Manager";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GameInfoOverlay Member List

This is the complete list of members for GameInfoOverlay, including all inherited members.
__pad0__ | GameInfoOverlay |
Bitmap() | GameInfoOverlay |
Bitmap() | GameInfoOverlay |
CreateDeviceDependentResources() | GameInfoOverlay |
CreateDeviceDependentResources() | GameInfoOverlay |
CreateWindowSizeDependentResources(D2D_SIZE_F overlaySize) | GameInfoOverlay |
CreateWindowSizeDependentResources(D2D_SIZE_F overlaySize) | GameInfoOverlay |
GameInfoOverlay(std::shared_ptr< DX::DeviceResources > const &deviceResources) | GameInfoOverlay |
HideGameInfoOverlay() | GameInfoOverlay | [inline, virtual]
HideGameInfoOverlay() | GameInfoOverlay | [inline, virtual]
HideTooSmall() | GameInfoOverlay | [virtual]
HideTooSmall() | GameInfoOverlay | [virtual]
m_actionBrush | GameInfoOverlay | [private]
m_actionBrush | GameInfoOverlay | [private]
m_actionRectangle | GameInfoOverlay | [private]
m_actionString | GameInfoOverlay | [private]
m_actionString | GameInfoOverlay | [private]
m_backgroundBrush | GameInfoOverlay | [private]
m_backgroundBrush | GameInfoOverlay | [private]
m_bodyRectangle | GameInfoOverlay | [private]
m_bodyString | GameInfoOverlay | [private]
m_bodyString | GameInfoOverlay | [private]
m_deviceResources | GameInfoOverlay | [private]
m_levelBitmap | GameInfoOverlay | [private]
m_levelBitmap | GameInfoOverlay | [private]
m_textBrush | GameInfoOverlay | [private]
m_textBrush | GameInfoOverlay | [private]
m_textFormatBody | GameInfoOverlay | [private]
m_textFormatBody | GameInfoOverlay | [private]
m_textFormatTitle | GameInfoOverlay | [private]
m_textFormatTitle | GameInfoOverlay | [private]
m_titleRectangle | GameInfoOverlay | [private]
m_titleString | GameInfoOverlay | [private]
m_titleString | GameInfoOverlay | [private]
m_tooSmallActive | GameInfoOverlay | [private]
m_tooSmallBitmap | GameInfoOverlay | [private]
m_tooSmallBitmap | GameInfoOverlay | [private]
m_visible | GameInfoOverlay | [private]
ReleaseDeviceDependentResources() | GameInfoOverlay |
ReleaseDeviceDependentResources() | GameInfoOverlay |
SetAction(Simple3DGameDX::GameInfoOverlayCommand action) | GameInfoOverlay | [virtual]
SetAction(Simple3DGameDX::GameInfoOverlayCommand action) | GameInfoOverlay | [virtual]
SetGameLoading(uint32 dots) | GameInfoOverlay | [virtual]
SetGameLoading(uint32_t dots) | GameInfoOverlay | [virtual]
SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore) | GameInfoOverlay | [virtual]
SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore) | GameInfoOverlay | [virtual]
SetGameStats(int maxLevel, int hitCount, int shotCount) | GameInfoOverlay | [virtual]
SetGameStats(int maxLevel, int hitCount, int shotCount) | GameInfoOverlay | [virtual]
SetLevelStart(int level, Platform::String^objective, float timeLimit, float bonusTime) | GameInfoOverlay | [virtual]
SetLevelStart(int level, std::wstring const &objective, float timeLimit, float bonusTime) | GameInfoOverlay | [virtual]
SetPause(int level, int hitCount, int shotCount, float timeRemaining) | GameInfoOverlay | [virtual]
SetPause(int level, int hitCount, int shotCount, float timeRemaining) | GameInfoOverlay | [virtual]
ShowGameInfoOverlay() | GameInfoOverlay | [inline, virtual]
ShowGameInfoOverlay() | GameInfoOverlay | [inline, virtual]
ShowTooSmall() | GameInfoOverlay | [virtual]
ShowTooSmall() | GameInfoOverlay | [virtual]
Visible() | GameInfoOverlay | [inline]
Visible() | GameInfoOverlay | [inline]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AttributeValidationDescriptor Member List

This is the complete list of members for AttributeValidationDescriptor, including all inherited members.
guidKey | AttributeValidationDescriptor
IsValid | AttributeValidationDescriptor
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4 Member List

This is the complete list of members for Scenario4, including all inherited members.
CopyProtectionAsync() | Scenario4 | [inline]
CopyProtectionAsync_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
CreateFileAndProtect() | Scenario4 | [inline, private]
FilePickerBt_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
GetFileStatusStringAsync() | Scenario4 | [inline]
m_copyProtectionScenarioDesc | Scenario4 | [private]
m_file | Scenario4 | [private]
m_FileCopyName | Scenario4 | [private]
m_getProtectScenarioDesc | Scenario4 | [private]
m_isRoamableScenarioDesc | Scenario4 | [private]
m_protectScenarioDesc | Scenario4 | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario4 | [inline, protected]
ProtectAsyncFile_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
ProtectAsyncFileStatus_Click(object sender, RoutedEventArgs e) | Scenario4 | [inline, private]
rootPage | Scenario4 | [private]
Scenario4() | Scenario4 | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaSegmentInformation Member List

This is the complete list of members for MediaSegmentInformation, including all inherited members.
bitrate | MediaSegmentInformation | [private]
Bitrate | MediaSegmentInformation | [private]
duration | MediaSegmentInformation | [private]
Duration | MediaSegmentInformation | [private]
mediaUrlTemplate | MediaSegmentInformation | [private]
RepresentationID | MediaSegmentInformation | [private]
representationID | MediaSegmentInformation | [private]
StartNumber | MediaSegmentInformation | [private]
startNumber | MediaSegmentInformation | [private]
startTimestamp | MediaSegmentInformation | [private]
StartTimestamp | MediaSegmentInformation | [private]
timescale | MediaSegmentInformation | [private]
Timescale | MediaSegmentInformation | [private]
UrlTemplate | MediaSegmentInformation | [private]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/RecognizerHelper.cpp Source File

  • SimpleInk
  • cpp

RecognizerHelper.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "RecognizerHelper.h"
00003
00004 namespace SDKTemplate
00005 {
00006     std::map<Platform::String^, Platform::String^> RecognizerHelper::Bcp47ToRecognizerNameDictionary =
00007     {
00008         { L"en-US", L"Microsoft English (US) Handwriting Recognizer" },
00009         { L"en-GB", L"Microsoft English (UK) Handwriting Recognizer" },
00010         { L"en-CA", L"Microsoft English (Canada) Handwriting Recognizer" },
00011         { L"en-AU", L"Microsoft English (Australia) Handwriting Recognizer" },
00012         { L"de-DE", L"Microsoft-Handschrifterkennung - Deutsch" },
00013         { L"de-CH", L"Microsoft-Handschrifterkennung - Deutsch (Schweiz)" },
00014         { L"es-ES", L"Reconocimiento de escritura a mano en español de Microsoft" },
00015         { L"es-MX", L"Reconocedor de escritura en Español (México) de Microsoft" },
00016         { L"es-AR", L"Reconocedor de escritura en Español (Argentina) de Microsoft" },
00017         { L"fr", L"Reconnaissance d'écriture Microsoft - Français" },
00018         { L"fr-FR", L"Reconnaissance d'écriture Microsoft - Français" },
00019         { L"ja", L"Microsoft 日本語手書き認識エンジン" },
00020         { L"ja-JP", L"Microsoft 日本語手書き認識エンジン" },
00021         { L"it", L"Riconoscimento grafia italiana Microsoft" },
00022         { L"nl-NL", L"Microsoft Nederlandstalige handschriftherkenning" },
00023         { L"nl-BE", L"Microsoft Nederlandstalige (België) handschriftherkenning" },
00024         { L"zh", L"Microsoft 中文(简体)手写识别器" },
00025         { L"zh-CN", L"Microsoft 中文(简体)手写识别器" },
00026         { L"zh-Hans-CN", L"Microsoft 中文(简体)手写识别器" },
00027         { L"zh-Hant", L"Microsoft 中文(繁體)手寫辨識器" },
00028         { L"zh-TW", L"Microsoft 中文(繁體)手寫辨識器" },
00029         { L"ru", L"Microsoft система распознавания русского рукописного ввода" },
00030         { L"pt-BR", L"Reconhecedor de Manuscrito da Microsoft para Português (Brasil)" },
00031         { L"pt-PT", L"Reconhecedor de escrita manual da Microsoft para português" },
00032         { L"ko", L"Microsoft 한글 필기 인식기" },
00033         { L"pl", L"System rozpoznawania polskiego pisma odręcznego firmy Microsoft" },
00034         { L"sv", L"Microsoft Handskriftstolk för svenska" },
00035         { L"cs", L"Microsoft rozpoznávač rukopisu pro český jazyk" },
00036         { L"da", L"Microsoft Genkendelse af dansk håndskrift" },
00037         { L"nb", L"Microsoft Håndskriftsgjenkjenner for norsk" },
00038         { L"nn", L"Microsoft Håndskriftsgjenkjenner for nynorsk" },
00039         { L"fi", L"Microsoftin suomenkielinen käsinkirjoituksen tunnistus" },
00040         { L"ro", L"Microsoft recunoaştere grafie - Română" },
00041         { L"hr", L"Microsoftov hrvatski rukopisni prepoznavač" },
00042         { L"sr-Latn", L"Microsoft prepoznavač rukopisa za srpski (latinica)" },
00043         { L"sr", L"Microsoft препознавач рукописа за српски (ћирилица)" },
00044         { L"ca", L"Reconeixedor d'escriptura manual en català de Microsoft" },
00045     };
00046
00047     Platform::String^ RecognizerHelper::LanguageTagToRecognizerName(Platform::String^ bcp47tag)
00048     {
00049         Platform::String^ recognizerName;
00050         recognizerName = "";
00051
00052         auto it = Bcp47ToRecognizerNameDictionary.find(bcp47tag);
00053         if (it != Bcp47ToRecognizerNameDictionary.end())
00054         {
00055             recognizerName = it->second;
00056         }
00057
00058         return recognizerName;
00059     }
00060 }
Generated on Fri Nov 15 2024 22:21:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileOpenPicker_PickCachedFile Member List

This is the complete list of members for FileOpenPicker_PickCachedFile, including all inherited members.
AddFileButton_Click(object sender, RoutedEventArgs e) | FileOpenPicker_PickCachedFile | [inline, private]
dispatcher | FileOpenPicker_PickCachedFile | [private]
FileOpenPicker_PickCachedFile() | FileOpenPicker_PickCachedFile | [inline]
fileOpenPickerUI | FileOpenPicker_PickCachedFile | [private]
id | FileOpenPicker_PickCachedFile | [private]
OnNavigatedTo(NavigationEventArgs e) | FileOpenPicker_PickCachedFile | [inline, protected]
RemoveFileButton_Click(object sender, RoutedEventArgs e) | FileOpenPicker_PickCachedFile | [inline, private]
UpdateButtonState(bool fileInBasket) | FileOpenPicker_PickCachedFile | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/SampleConfiguration.cpp Source File

  • OrientationSensor
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015 #include <sstream>
00016
00017 using namespace SDKTemplate;
00018 using namespace Windows::Devices::Sensors;
00019 using namespace Windows::UI::Xaml::Controls;
00020
00021 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00022 {
00023     { "Choose orientation sensor", "SDKTemplate.Scenario0_Choose" },
00024     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00025     { "Polling", "SDKTemplate.Scenario2_Polling" },
00026     { "Calibration", "SDKTemplate.Scenario3_Calibration" }
00027 };
00028
00029 void MainPage::SetReadingText(TextBlock^ textBlock, OrientationSensorReading^ reading)
00030 {
00031     std::wostringstream ss;
00032     ss.flags(std::ios::right | std::ios::fixed);
00033     ss.width(5);
00034     ss.precision(3);
00035
00036     SensorQuaternion^ quaternion = reading->Quaternion;    // get a reference to the object to avoid re-creating it for each access
00037     ss << "Quaternion:" << std::endl;
00038     ss << "W: " << quaternion->W << ", X: " << quaternion->X << ", Y: " << quaternion->Y << ", Z: " << quaternion->Z << std::endl;
00039
00040     ss << std::endl;
00041
00042     SensorRotationMatrix^ rotationMatrix = reading->RotationMatrix;
00043     ss << "M11: " << rotationMatrix->M11 << ", M12: " << rotationMatrix->M12 << ", M13: " << rotationMatrix->M13 << std::endl;
00044     ss << "M21: " << rotationMatrix->M21 << ", M22: " << rotationMatrix->M22 << ", M23: " << rotationMatrix->M23 << std::endl;
00045     ss << "M31: " << rotationMatrix->M31 << ", M32: " << rotationMatrix->M32 << ", M33: " << rotationMatrix->M33 << std::endl;
00046
00047     ss << std::endl;
00048
00049     ss << "Yaw Accuracy:" << std::endl;
00050     switch (reading->YawAccuracy)
00051     {
00052     case MagnetometerAccuracy::Unknown:
00053         ss << "unknown";
00054         break;
00055     case MagnetometerAccuracy::Unreliable:
00056         ss << "unreliable";
00057         break;
00058     case MagnetometerAccuracy::Approximate:
00059         ss << "approximate";
00060         break;
00061     case MagnetometerAccuracy::High:
00062         ss << "high";
00063         break;
00064     default:
00065         ss << "other";
00066         break;
00067     }
00068
00069     textBlock->Text = ref new Platform::String(ss.str().c_str());
00070 }
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/SampleConfiguration.cpp Source File

  • DisablingScreenCapture
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Disabling screen capture C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Enabling screen capture", xaml_typename<SDKTemplate::Scenario1_Enable>() },
00029     Scenario{ L"Disabling screen capture", xaml_typename<SDKTemplate::Scenario2_Disable>() },
00030     Scenario{ L"Managing AppCapture", xaml_typename<SDKTemplate::Scenario3_AppCapture>() },
00031 });
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario2.xaml.h Source File

  • Logging
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2.g.h"
00015 #include "LoggingSessionScenario.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario2 sealed
00022     {
00023     public:
00024
00025         Scenario2();
00026
00027     protected:
00028
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030
00031     private:
00032
00033         property LoggingSessionScenario^ LoggingScenario
00034         {
00035             LoggingSessionScenario^ get()
00036             {
00037                 return LoggingSessionScenario::Instance::get();
00038             }
00039         }
00040
00041         concurrency::task<void> UpdateLogMessageCountDispatchAsync();
00042         void AddMessage(Platform::String^ message);
00043         concurrency::task<void> AddMessageDispatch(Platform::String^ message);
00044         concurrency::task<void> AddLogFileMessageDispatch(Platform::String^ message, const std::wstring& logFileFullPath);
00045         void UpdateControls();
00046         void DoScenario(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         void EnableDisableLogging(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void OnStatusChanged(Platform::Object^ sender, LoggingScenarioEventArgs^ args);
00049         Windows::UI::Xaml::Controls::ScrollViewer^ FindScrollViewer(DependencyObject^ depObject);
00050     };
00051 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario8_Transmit.xaml.h Source File

  • SmartCard
  • cpp

Scenario8_Transmit.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario8_Transmit.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario8_Transmit sealed
00012     {
00013     public:
00014         Scenario8_Transmit();
00015     private:
00016         void Transmit_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017     };
00018 }
Generated on Fri Nov 15 2024 22:21:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario1.xaml.cpp Source File

  • ContextMenu
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.cpp
00013 // Implementation of the Scenario1 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario1.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace concurrency;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::UI::Popups;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 Scenario1::Scenario1()
00031 {
00032     InitializeComponent();
00033     rootPage = MainPage::Current;
00034 }
00035
00036 Rect Scenario1::GetElementRect(FrameworkElement^ element)
00037 {
00038     GeneralTransform^ buttonTransform = element->TransformToVisual(nullptr);
00039     const Point pointOrig(0, 0);
00040     const Point pointTransformed = buttonTransform->TransformPoint(pointOrig);
00041     const Rect rect(pointTransformed.X, pointTransformed.Y, safe_cast<float>(element->ActualWidth), safe_cast<float>(element->ActualHeight));
00042     return rect;
00043 }
00044
00045 void Scenario1::AttachmentImage_RightTapped(Object^ sender, RightTappedRoutedEventArgs^ e)
00046 {
00047     // Create a menu and add commands specifying a callback delegate for each.
00048     // Since command delegates are unique, no need to specify command Ids.
00049     auto menu = ref new PopupMenu();
00050     menu->Commands->Append(ref new UICommand("Open with", ref new UICommandInvokedHandler([this](IUICommand^ command)
00051     {
00052         OutputTextBlock->Text = "'" + command->Label + "' selected";
00053     })));
00054
00055     menu->Commands->Append(ref new UICommand("Save attachment", ref new UICommandInvokedHandler([this](IUICommand^ command)
00056     {
00057         OutputTextBlock->Text = "'" + command->Label + "' selected";
00058     })));
00059
00060     // We don't want to obscure content, so pass in a rectangle representing the sender of the context menu event.
00061     auto rect = GetElementRect(safe_cast<FrameworkElement^>(sender));
00062     create_task(menu->ShowForSelectionAsync(rect)).then([this](IUICommand^ command)
00063     {
00064         if (command == nullptr)
00065         {
00066             // The command is null if no command was invoked.
00067             OutputTextBlock->Text = L"Context menu dismissed";
00068         }
00069     });
00070     OutputTextBlock->Text = "Context menu shown";
00071 }
Generated on Fri Nov 15 2024 22:17:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario10.xaml.cs Source File

  • AudioCategory
  • cs
  • AudioCategory

Scenario10.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using Windows.UI.Xaml.Media;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00019
00020 namespace PlaybackManager
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario10 : Page
00026     {
00027         public Scenario10()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         private void Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00033         {
00034             Playback.SetAudioCategory(AudioCategory.Other);
00035             Playback.SelectFile();
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/SampleOverlay.h Source File

  • D2DGradientMesh
  • cpp

SampleOverlay.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "DirectXHelper.h"
00011 #include "DeviceResources.h"
00012
00013 // This class is responsible for initializing and rendering the title overlay visible
00014 // at the top of the DirectX SDK samples.
00015 namespace D2DGradientMesh
00016 {
00017     class SampleOverlay
00018     {
00019     public:
00020         SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption);
00021         void CreateDeviceDependentResources();
00022         void CreateWindowSizeDependentResources();
00023         void ReleaseDeviceDependentResources();
00024         void Render();
00025         float GetTitleHeightInDips();
00026
00027     private:
00028         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00029
00030         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush>    m_whiteBrush;
00031         Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>  m_stateBlock;
00032
00033         Microsoft::WRL::ComPtr<ID2D1Bitmap>             m_logoBitmap;
00034         Microsoft::WRL::ComPtr<IDWriteTextLayout>       m_textLayout;
00035
00036         UINT                                            m_idIncrement;
00037         bool                                            m_drawOverlay;
00038         std::wstring                                    m_caption;
00039         float                                           m_padding;
00040         float                                           m_textVerticalOffset;
00041         D2D1_SIZE_F                                     m_logoSize;
00042         float                                           m_overlayWidth;
00043     };
00044 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario4_SeekerSession.xaml.cs Source File

  • WiFiDirectServices
  • cs

Scenario4_SeekerSession.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Core;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00018
00019 namespace SDKTemplate
00020 {
00021     namespace WiFiDirectServices
00022     {
00023         /// <summary>
00024         /// UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with
00025         ///
00026         /// Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs
00027         /// </summary>
00028         public sealed partial class Scenario4 : Page
00029         {
00030             private Object thisLock = new Object();
00031
00032             private MainPage rootPage;
00033
00034             public Scenario4()
00035             {
00036                 this.InitializeComponent();
00037             }
00038
00039             protected override void OnNavigatedTo(NavigationEventArgs e)
00040             {
00041                 lock (thisLock)
00042                 {
00043                     rootPage = MainPage.Current;
00044
00045                     MainUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00046                     PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
00047
00048                     // Cleanup old entries
00049                     ConnectedSessions.Items.Clear();
00050                     foreach (var session in WiFiDirectServiceManager.Instance.ConnectedSessionList)
00051                     {
00052                         ConnectedSessions.Items.Add(session);
00053                     }
00054
00055                     if (ConnectedSessions.Items.Count > 0)
00056                     {
00057                         MainUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
00058                         PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00059                     }
00060                 }
00061                 WiFiDirectServiceManager.Instance.Scenario4 = this;
00062             }
00063
00064             protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00065             {
00066                 WiFiDirectServiceManager.Instance.Scenario4 = null;
00067             }
00068
00069             public async void AddSession(SessionWrapper session)
00070             {
00071                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00072                 {
00073                     lock (thisLock)
00074                     {
00075                         ConnectedSessions.Items.Add(session);
00076                     }
00077                 });
00078             }
00079
00080             public async void RemoveSession(int index)
00081             {
00082                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00083                 {
00084                     lock (thisLock)
00085                     {
00086                         if (index > ConnectedSessions.Items.Count - 1)
00087                         {
00088                             throw new IndexOutOfRangeException("Attempted to remove session no longer in list");
00089                         }
00090
00091                         ConnectedSessions.Items.RemoveAt(index);
00092                     }
00093                 });
00094             }
00095
00096             private void SelectSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00097             {
00098                 if (ConnectedSessions.Items.Count > 0)
00099                 {
00100                     int index = ConnectedSessions.SelectedIndex;
00101                     if (index >= 0)
00102                     {
00103                         WiFiDirectServiceManager.Instance.SelectSession(index);
00104
00105                         // Force navigation to the next page for smoother experience
00106                         // This takes us to the scenario to send and receive data for a selected session
00107                         rootPage.GoToScenario(4);
00108                     }
00109                 }
00110             }
00111
00112             private void CloseSession_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00113             {
00114                 if (ConnectedSessions.Items.Count > 0)
00115                 {
00116                     int index = ConnectedSessions.SelectedIndex;
00117                     if (index >= 0)
00118                     {
00119                         WiFiDirectServiceManager.Instance.CloseSession(index);
00120                     }
00121                 }
00122             }
00123         }
00124     }
00125 }
Generated on Fri Nov 15 2024 22:22:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SampleConfiguration.cpp Source File

  • BarcodeScanner
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Barcode Scanner";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"DataReceived event", xaml_typename<SDKTemplate::Scenario1_BasicFunctionality>() },
00029     Scenario{ L"Release/Retain functionality", xaml_typename<SDKTemplate::Scenario2_MultipleScanners>() },
00030     Scenario{ L"Active Symbologies", xaml_typename<SDKTemplate::Scenario3_ActiveSymbologies>() },
00031     Scenario{ L"Symbology Attributes", xaml_typename<SDKTemplate::Scenario4_SymbologyAttributes>() },
00032     Scenario{ L"Displaying a Barcode Preview", xaml_typename<SDKTemplate::Scenario5_DisplayingBarcodePreview>() },
00033 });
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Downloader Member List

This is the complete list of members for Downloader, including all inherited members.
DownloadBufferAsync(Uri url) | Downloader | [inline, static]
fileNotFound404Hresult | Downloader | [private]
RETRIES | Downloader | [static]
SendHeadRequestAsync(Uri url) | Downloader | [inline, static]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/pch.cpp Source File

  • HttpClient
  • HttpFilters

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.h Source File

  • TouchKeyboard
  • cppwinrt

Scenario3_ShowHideMethods.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_ShowHideMethods.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     /// <summary>
00020     /// Sample page to call TryShow/TryHide methods.
00021     /// </summary>
00022     struct Scenario3_ShowHideMethods : Scenario3_ShowHideMethodsT<Scenario3_ShowHideMethods>
00023     {
00024         Scenario3_ShowHideMethods();
00025
00026         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00027
00028         void WordListBox_OnKeyUp(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
00029         void OnFadeOutCompleted(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00030     };
00031 }
00032
00033 namespace winrt::SDKTemplate::factory_implementation
00034 {
00035     struct Scenario3_ShowHideMethods : Scenario3_ShowHideMethodsT<Scenario3_ShowHideMethods, implementation::Scenario3_ShowHideMethods>
00036     {
00037     };
00038 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario3_MasterDetail.cpp Source File

  • XamlListView
  • cppwinrt

Scenario3_MasterDetail.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Contact.h"
00014 #include "Scenario3_MasterDetail.h"
00015 #include "Scenario3_MasterDetail.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Controls;
00022 using namespace winrt::Windows::UI::Xaml::Media::Animation;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario3_MasterDetail::Scenario3_MasterDetail()
00028     {
00029         InitializeComponent();
00030
00031         // Generate the list of contacts.
00032         // Remember to enable the NavigationCacheMode of this Page to avoid
00033         // loading the data every time user navigates back and forward.
00034         Contacts = Contact::GetContacts(140);
00035         if (Contacts.Size() > 0)
00036         {
00037             MasterListView().ItemsSource(Contacts);
00038         }
00039     }
00040     void Scenario3_MasterDetail::OnNavigatedTo(NavigationEventArgs const& e)
00041     {
00042         // Details view can request an action on return.
00043         // S<id> = select this contact
00044         // D<id> = delete this contact
00045         hstring param = unbox_value_or(e.Parameter(), L"");
00046         if (!param.empty())
00047         {
00048             std::wstring_view id = std::wstring_view(param).substr(1);
00049             auto it = std::find_if(begin(Contacts), end(Contacts), [&](auto&& c) { return c.Id() == id; });
00050             if (it != end(Contacts))
00051             {
00052                 MasterListView().SelectedItem(*it);
00053                 if (param.front() == L'D')
00054                 {
00055                     DeleteItem(nullptr, nullptr);
00056                 }
00057             }
00058         }
00059     }
00060
00061     void Scenario3_MasterDetail::OnLoaded(IInspectable const&, RoutedEventArgs const&)
00062     {
00063         if (MasterListView().SelectedItem()== nullptr && Contacts.Size() > 0)
00064         {
00065             MasterListView().SelectedIndex(0);
00066         }
00067
00068         // If the app starts in narrow mode - showing only the Master listView -
00069         // it is necessary to set the commands and the selection mode.
00070         if (PageSizeStatesGroup().CurrentState() == NarrowState())
00071         {
00072             VisualStateManager().GoToState(*this, MasterState().Name(), true);
00073         }
00074         else if (PageSizeStatesGroup().CurrentState() == WideState())
00075         {
00076             // In this case, the app starts is wide mode, Master/Details view.
00077             // Preseve the selection across the state change.
00078             IInspectable item = MasterListView().SelectedItem();
00079             VisualStateManager().GoToState(*this, MasterDetailsState().Name(), true);
00080             MasterListView().SelectedItem(item);
00081         }
00082         else
00083         {
00084             throw hresult_not_implemented();
00085         }
00086     }
00087
00088     void Scenario3_MasterDetail::OnCurrentStateChanged(IInspectable const&, VisualStateChangedEventArgs const& e)
00089     {
00090         bool isNarrow = e.NewState() == NarrowState();
00091         if (isNarrow)
00092         {
00093             Frame().Navigate(xaml_typename<SDKTemplate::DetailsPage>(), MasterListView().SelectedItem(), SuppressNavigationTransitionInfo());
00094         }
00095         else
00096         {
00097             VisualStateManager().GoToState(*this, MasterDetailsState().Name(), true);
00098             MasterListView().SelectionMode(ListViewSelectionMode::Extended);
00099         }
00100
00101         EntranceNavigationTransitionInfo().SetIsTargetElement(MasterListView(), isNarrow);
00102         if (DetailContentPresenter() != nullptr)
00103         {
00104             EntranceNavigationTransitionInfo().SetIsTargetElement(DetailContentPresenter(), !isNarrow);
00105         }
00106     }
00107
00108     void Scenario3_MasterDetail::OnSelectionChanged(IInspectable const&, SelectionChangedEventArgs const&)
00109     {
00110         if (PageSizeStatesGroup().CurrentState() == WideState())
00111         {
00112             if (MasterListView().SelectedItems().Size() == 1)
00113             {
00114                 EnableContentTransitions();
00115             }
00116             // Entering in Extended selection
00117             else if (MasterListView().SelectedItems().Size() > 1
00118                 && MasterDetailsStatesGroup().CurrentState() == MasterDetailsState())
00119             {
00120                 VisualStateManager().GoToState(*this, ExtendedSelectionState().Name(), true);
00121             }
00122         }
00123         // Exiting Extended selection
00124         if (MasterDetailsStatesGroup().CurrentState() == ExtendedSelectionState() &&
00125             MasterListView().SelectedItems().Size() == 1)
00126         {
00127             VisualStateManager().GoToState(*this, MasterDetailsState().Name(), true);
00128         }
00129     }
00130
00131     // ItemClick event only happens when user is a Master state. In this state,
00132     // selection mode is none and click event navigates to the details view.
00133     void Scenario3_MasterDetail::OnItemClick(IInspectable const&, ItemClickEventArgs const& e)
00134     {
00135         // The clicked item it is the new selected contact
00136         SDKTemplate::Contact selectedContact = e.ClickedItem().as<SDKTemplate::Contact>();
00137         MasterListView().SelectedItem(selectedContact);
00138         if (PageSizeStatesGroup().CurrentState() == NarrowState())
00139         {
00140             // Go to the details page and display the item
00141             Frame().Navigate(xaml_typename<SDKTemplate::DetailsPage>(), selectedContact, DrillInNavigationTransitionInfo());
00142         }
00143     }
00144
00145     void Scenario3_MasterDetail::EnableContentTransitions()
00146     {
00147         DetailContentPresenter().ContentTransitions().ReplaceAll({ EntranceThemeTransition() });
00148     }
00149
00150 #pragma region Commands
00151     void Scenario3_MasterDetail::AddItem(IInspectable const&, RoutedEventArgs const&)
00152     {
00153         SDKTemplate::Contact c = Contact::GetNewContact();
00154         Contacts.Append(c);
00155
00156         // Select this item in case that the list is empty
00157         if (MasterListView().SelectedIndex() == -1)
00158         {
00159             MasterListView().SelectedIndex(0);
00160             // Details view might be collapsed if there were no items.
00161             // Show it now.
00162             DetailContentPresenter().Visibility(Visibility::Visible);
00163         }
00164     }
00165
00166     void Scenario3_MasterDetail::SelectSomethingIfPossible()
00167     {
00168         if (Contacts.Size() > 0)
00169         {
00170             MasterListView().SelectedIndex(0);
00171         }
00172         else
00173         {
00174             // Collapse the Details view if there are no items.
00175             DetailContentPresenter().Visibility(Visibility::Collapsed);
00176         }
00177     }
00178
00179     void Scenario3_MasterDetail::DeleteItem(IInspectable const&, RoutedEventArgs const&)
00180     {
00181         int32_t index = MasterListView().SelectedIndex();
00182
00183         if (index != -1)
00184         {
00185                 Contacts.RemoveAt(index);
00186                 SelectSomethingIfPossible();
00187         }
00188     }
00189
00190     void Scenario3_MasterDetail::DeleteItems(IInspectable const&, RoutedEventArgs const&)
00191     {
00192         if (MasterListView().SelectedIndex() != -1)
00193         {
00194             while (MasterListView().SelectedIndex() != -1)
00195             {
00196                 Contacts.RemoveAt(MasterListView().SelectedIndex());
00197             }
00198             SelectSomethingIfPossible();
00199         }
00200     }
00201
00202     void Scenario3_MasterDetail::SelectItems(IInspectable const&, RoutedEventArgs const&)
00203     {
00204         if (MasterListView().Items().Size() > 0)
00205         {
00206             VisualStateManager().GoToState(*this, MultipleSelectionState().Name(), true);
00207         }
00208     }
00209     void Scenario3_MasterDetail::CancelSelection(IInspectable const&, RoutedEventArgs const&)
00210     {
00211         if (PageSizeStatesGroup().CurrentState() == NarrowState())
00212         {
00213             VisualStateManager().GoToState(*this, MasterState().Name(), true);
00214         }
00215         else
00216         {
00217             VisualStateManager().GoToState(*this, MasterDetailsState().Name(), true);
00218         }
00219     }
00220 #pragma endregion
00221 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario4_Bytes.xaml.cpp Source File

  • FileAccess
  • cpp

Scenario4_Bytes.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_Bytes.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::Streams;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 Scenario4::Scenario4()
00026 {
00027     InitializeComponent();
00028 }
00029
00030 void Scenario4::OnNavigatedTo(NavigationEventArgs^ e)
00031 {
00032     rootPage->ValidateFile();
00033 }
00034
00035 void Scenario4::WriteBytesButton_Click(Object^ sender, RoutedEventArgs^ e)
00036 {
00037     StorageFile^ file = rootPage->SampleFile;
00038     if (file != nullptr)
00039     {
00040         String^ userContent = InputTextBox->Text;
00041         IBuffer^ buffer = MainPage::GetBufferFromString(userContent);
00042         create_task(FileIO::WriteBufferAsync(file, buffer)).then([this, file, buffer, userContent](task<void> task)
00043         {
00044             try
00045             {
00046                 task.get();
00047                 rootPage->NotifyUser("The following " + buffer->Length.ToString() + " bytes of text were written to '" + file->Name + "':\n" + userContent, NotifyType::StatusMessage);
00048             }
00049             catch (COMException^ ex)
00050             {
00051                 // I/O errors are reported as exceptions.
00052                 rootPage->HandleIoException(ex, "Error writing to '" + file->Name + "'");
00053             }
00054         });
00055     }
00056     else
00057     {
00058         rootPage->NotifyUserFileNotExist();
00059     }
00060 }
00061
00062 void Scenario4::ReadBytesButton_Click(Object^ sender, RoutedEventArgs^ e)
00063 {
00064     StorageFile^ file = rootPage->SampleFile;
00065     if (file != nullptr)
00066     {
00067         create_task(FileIO::ReadBufferAsync(file)).then([this, file](task<IBuffer^> task)
00068         {
00069             try
00070             {
00071                 IBuffer^ buffer = task.get();
00072                 String^ fileContent = MainPage::GetStringFromBuffer(buffer);
00073                 rootPage->NotifyUser("The following " + buffer->Length.ToString() + " bytes of text were read from '" + file->Name + "':\n" + fileContent, NotifyType::StatusMessage);
00074             }
00075             catch (COMException^ ex)
00076             {
00077                 if (ex->HResult == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
00078                 {
00079                     rootPage->NotifyUser("File is not UTF-8 encoded.", NotifyType::ErrorMessage);
00080                 }
00081                 else
00082                 {
00083                     // I/O errors are reported as exceptions.
00084                     rootPage->HandleIoException(ex, "Error reading from '" + file->Name + "'");
00085                 }
00086             }
00087         });
00088     }
00089     else
00090     {
00091         rootPage->NotifyUserFileNotExist();
00092     }
00093 }
Generated on Fri Nov 15 2024 22:19:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario3_Full.xaml.cpp Source File

  • ContactCards
  • cpp

Scenario3_Full.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario3_Full.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::ApplicationModel::Contacts;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Scenario3_Full::Scenario3_Full()
00025 {
00026     this->InitializeComponent();
00027 }
00028
00029 void Scenario3_Full::ShowContactCard_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00030 {
00031     Contact^ contact = rootPage->CreateContactFromUserInput(EmailAddress, PhoneNumber);
00032     if (contact != nullptr)
00033     {
00034         // Try to share the screen half/half with the full contact card.
00035         FullContactCardOptions^ options = ref new FullContactCardOptions();
00036         options->DesiredRemainingView = ViewSizePreference::UseHalf;
00037
00038         // Show the full contact card.
00039         ContactManager::ShowFullContactCard(contact, options);
00040     }
00041 }
Generated on Fri Nov 15 2024 22:18:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_WatchUsers Member List

This is the complete list of members for Scenario2_WatchUsers, including all inherited members.
FindModelByUserId(string userId) | Scenario2_WatchUsers | [inline, private]
GetDisplayNameOrGenericNameAsync(User user) | Scenario2_WatchUsers | [inline, private]
OnEnumerationCompleted(UserWatcher sender, Object e) | Scenario2_WatchUsers | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_WatchUsers | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_WatchUsers | [inline, protected]
OnUserAdded(UserWatcher sender, UserChangedEventArgs e) | Scenario2_WatchUsers | [inline, private]
OnUserRemoved(UserWatcher sender, UserChangedEventArgs e) | Scenario2_WatchUsers | [inline, private]
OnUserUpdated(UserWatcher sender, UserChangedEventArgs e) | Scenario2_WatchUsers | [inline, private]
OnWatcherStopped(UserWatcher sender, Object e) | Scenario2_WatchUsers | [inline, private]
rootPage | Scenario2_WatchUsers | [private]
Scenario2_WatchUsers() | Scenario2_WatchUsers | [inline]
StartWatching() | Scenario2_WatchUsers | [inline, private]
StopWatching() | Scenario2_WatchUsers | [inline, private]
userNumber | Scenario2_WatchUsers | [private]
Users | Scenario2_WatchUsers |
userWatcher | Scenario2_WatchUsers | [private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.cpp Source File

  • NumberFormatting
  • cppwinrt

Scenario7_UsingUnicodeExtensions.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_UsingUnicodeExtensions.h"
00014 #include "Scenario7_UsingUnicodeExtensions.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::NumberFormatting;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario7_UsingUnicodeExtensions::Scenario7_UsingUnicodeExtensions()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario7_UsingUnicodeExtensions::Display_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         // This scenario uses language tags with unicode extensions to construct and use the various
00032         // formatters and NumeralSystemTranslator in Windows.Globalization.NumberFormatting to format numbers
00033
00034         // Variable where we keep results to display
00035         std::wostringstream results;
00036
00037         // Create number to format.
00038         float randomNumber = (float)rand() / RAND_MAX * 100000.0f;
00039         DecimalFormatter randomNumberFormatter;
00040         hstring randomNumberFormatted = randomNumberFormatter.Format(randomNumber);
00041
00042         results << L"Random number used by formatters: " << std::wstring_view(randomNumberFormatted) << std::endl;
00043
00044         // Create a string to translate
00045         std::wstring stringToTranslate = L"These are the 10 digits of a numeral system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
00046         results << L"String used by NumeralSystemTranslater: " << stringToTranslate << std::endl;
00047         // Create the rounder and set its increment to 0.01
00048         IncrementNumberRounder rounder;
00049         rounder.Increment(0.001);
00050         results << L"CurrencyFormatter will be using Euro symbol and all formatters rounding to 0.001 increments" << std::endl << std::endl;
00051
00052         // The list of language tags with unicode extensions we want to test
00053         std::vector<hstring> languages{ L"de-DE-u-nu-telu-ca-buddist-co-phonebk-cu-usd", L"ja-jp-u-nu-arab" };
00054
00055         // Create the various formatters, now using the language list with unicode extensions
00056         results << L"Creating formatters using following languages in the language list:" << std::endl;
00057         for (auto&& language : languages)
00058         {
00059             results << "\t" << std::wstring_view(language) << std::endl;
00060         }
00061         results << std::endl;
00062
00063         // Create the various formatters.
00064         DecimalFormatter decimalFormatter(languages, L"ZZ");
00065         decimalFormatter.NumberRounder(rounder); decimalFormatter.FractionDigits(2);
00066         CurrencyFormatter currencyFormatter(CurrencyIdentifiers::EUR(), languages, L"ZZ");
00067         currencyFormatter.NumberRounder(rounder); currencyFormatter.FractionDigits(2);
00068         PercentFormatter percentFormatter(languages, L"ZZ");
00069         percentFormatter.NumberRounder(rounder); percentFormatter.FractionDigits(2);
00070         PermilleFormatter permilleFormatter(languages, L"ZZ");
00071         permilleFormatter.NumberRounder(rounder); permilleFormatter.FractionDigits(2);
00072         NumeralSystemTranslator numeralTranslator(languages);
00073
00074         results << L"Using resolved language  " << std::wstring_view(decimalFormatter.ResolvedLanguage()) <<
00075             L"  : (note that all extension tags other than nu are ignored)" << std::endl;
00076
00077         // Format using formatters and translate using NumeralSystemTranslator.
00078         results << L"Decimal Formatter:   " << std::wstring_view(decimalFormatter.Format(randomNumber)) << std::endl;
00079         results << L"Currency formatted:   " << std::wstring_view(currencyFormatter.Format(randomNumber)) << std::endl;
00080         results << L"Percent formatted:   " << std::wstring_view(percentFormatter.Format(randomNumber)) << std::endl;
00081         results << L"Permille formatted:   " << std::wstring_view(permilleFormatter.Format(randomNumber)) << std::endl;
00082         results << L"NumeralTranslator translated:   " << std::wstring_view(numeralTranslator.TranslateNumerals(stringToTranslate)) << std::endl;
00083
00084         // Display the results.
00085         OutputTextBlock().Text(results.str());
00086     }
00087 }
Generated on Fri Nov 15 2024 22:20:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DAL Member List

This is the complete list of members for DAL, including all inherited members.
DAL() | DAL | [inline, private]
GetPublicKeyForUser(string userId, string publicKeyHash, out byte[] challenge) | DAL | [inline]
Instance | DAL | [static]
RegisterUser(string userId, byte[] publicKey, string publicKeyHash, string deviceName) | DAL | [inline]
RemoveRegisteredKey(string userId, string publicKeyHash) | DAL | [inline]
SetActiveChallenge(string userId, string publicKeyHash, byte[] challenge) | DAL | [inline]
Users | DAL | [private]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/SampleConfiguration.h Source File

  • LightSensor
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "LightSensor";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Helpers::BufferConverter Member List

This is the complete list of members for Helpers::BufferConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | Helpers::BufferConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | Helpers::BufferConverter | [inline]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_GetLastVisit Member List

This is the complete list of members for Scenario6_GetLastVisit, including all inherited members.
GetLastVisitButtonClicked(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario6_GetLastVisit |
Scenario6_GetLastVisit() | Scenario6_GetLastVisit |
UpdateLastVisit(Windows::Devices::Geolocation::Geovisit const &visit) | Scenario6_GetLastVisit | [private]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario5.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario5.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario5.xaml.cpp
00013 // Implementation of the Scenario5 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario5.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024 using namespace Windows::ApplicationModel::Resources;
00025
00026 Scenario5::Scenario5()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 /// <summary>
00032 /// Invoked when this page is about to be displayed in a Frame.
00033 /// </summary>
00034 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00035 /// property is typically used to configure the page.</param>
00036 void Scenario5::OnNavigatedTo(NavigationEventArgs^ e)
00037 {
00038     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00039     // as NotifyUser()
00040     rootPage = MainPage::Current;
00041     this->Scenario5TextBlock->Text = "";
00042 }
00043
00044
00045 void Scenario5::Scenario5Button_Show_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00046 {
00047     Button^ b = safe_cast<Button^>(sender);
00048     if (b != nullptr)
00049     {
00050         auto resourceLoader = ResourceLoader::GetForCurrentView("Errors");
00051         this->Scenario5TextBlock->Text = resourceLoader->GetString("InvalidOperation");
00052     }
00053 }
00054
Generated on Fri Nov 15 2024 22:18:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/4-XAMLManipulations.xaml.cs Source File

  • BasicInput
  • cs

4-XAMLManipulations.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Input;
00016 using Windows.UI.Xaml.Media;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario4 : Page
00021     {
00022         private TransformGroup transforms;
00023         private MatrixTransform previousTransform;
00024         private CompositeTransform deltaTransform;
00025         private bool forceManipulationsToEnd;
00026
00027         public Scenario4()
00028         {
00029             this.InitializeComponent();
00030             forceManipulationsToEnd = false;
00031
00032             InitOptions();
00033
00034             // Initialize the transforms that will be used to manipulate the shape
00035             InitManipulationTransforms();
00036
00037             // Register for the various manipulation events that will occur on the shape
00038             manipulateMe.ManipulationStarted += new ManipulationStartedEventHandler(ManipulateMe_ManipulationStarted);
00039             manipulateMe.ManipulationDelta += new ManipulationDeltaEventHandler(ManipulateMe_ManipulationDelta);
00040             manipulateMe.ManipulationCompleted += new ManipulationCompletedEventHandler(ManipulateMe_ManipulationCompleted);
00041             manipulateMe.ManipulationInertiaStarting += new ManipulationInertiaStartingEventHandler(ManipulateMe_ManipulationInertiaStarting);
00042
00043             // The ManipulationMode property dictates what manipulation events the element
00044             // will listen to.  This will set it to a limited subset of these events.
00045             manipulateMe.ManipulationMode =
00046                 ManipulationModes.TranslateX |
00047                 ManipulationModes.TranslateY |
00048                 ManipulationModes.Rotate |
00049                 ManipulationModes.TranslateInertia |
00050                 ManipulationModes.RotateInertia;
00051         }
00052
00053         private void InitManipulationTransforms()
00054         {
00055             transforms = new TransformGroup();
00056             previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
00057             deltaTransform = new CompositeTransform();
00058
00059             transforms.Children.Add(previousTransform);
00060             transforms.Children.Add(deltaTransform);
00061
00062             // Set the render transform on the rect
00063             manipulateMe.RenderTransform = transforms;
00064         }
00065
00066         // When a manipulation begins, change the color of the object to reflect
00067         // that a manipulation is in progress
00068         void ManipulateMe_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
00069         {
00070             forceManipulationsToEnd = false;
00071             manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
00072         }
00073
00074         // Process the change resulting from a manipulation
00075         void ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
00076         {
00077             // If the reset button has been pressed, mark the manipulation as completed
00078             if (forceManipulationsToEnd)
00079             {
00080                 e.Complete();
00081                 return;
00082             }
00083
00084             previousTransform.Matrix = transforms.Value;
00085
00086             // Get center point for rotation
00087             Point center = previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
00088             deltaTransform.CenterX = center.X;
00089             deltaTransform.CenterY = center.Y;
00090
00091             // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
00092             // the rotation, scale, X, and Y changes
00093             deltaTransform.Rotation = e.Delta.Rotation;
00094             deltaTransform.TranslateX = e.Delta.Translation.X;
00095             deltaTransform.TranslateY = e.Delta.Translation.Y;
00096         }
00097
00098         // When a manipulation that's a result of inertia begins, change the color of the
00099         // the object to reflect that inertia has taken over
00100         void ManipulateMe_ManipulationInertiaStarting(object sender, ManipulationInertiaStartingRoutedEventArgs e)
00101         {
00102             manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
00103         }
00104
00105         // When a manipulation has finished, reset the color of the object
00106         void ManipulateMe_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
00107         {
00108             manipulateMe.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
00109         }
00110
00111         private void movementAxis_Changed(object sender, SelectionChangedEventArgs e)
00112         {
00113             // Set the object to listen to both X and Y translation events
00114             manipulateMe.ManipulationMode |= ManipulationModes.TranslateX | ManipulationModes.TranslateY;
00115
00116             ComboBoxItem selectedItem = (ComboBoxItem)((ComboBox)sender).SelectedItem;
00117             switch (selectedItem.Content.ToString())
00118             {
00119                 case "X only":
00120                     // Set the object to not listen for translations on the Y axis
00121                     manipulateMe.ManipulationMode ^= ManipulationModes.TranslateY;
00122                     break;
00123                 case "Y only":
00124                     // Set the object to not listen for translations on the X axis
00125                     manipulateMe.ManipulationMode ^= ManipulationModes.TranslateX;
00126                     break;
00127             }
00128         }
00129
00130         private void InertiaSwitch_Toggled(object sender, RoutedEventArgs e)
00131         {
00132             // Flip the current TranslateInertia and RotateInertia values in response to the
00133             // InertiaSwitch being toggled
00134             if (manipulateMe != null)
00135             {
00136                 manipulateMe.ManipulationMode ^= ManipulationModes.TranslateInertia | ManipulationModes.RotateInertia;
00137             }
00138         }
00139
00140         //
00141         // More UI code below
00142         //
00143         private void InitOptions()
00144         {
00145             movementAxis.SelectedIndex = 0;
00146             inertiaSwitch.IsOn = true;
00147         }
00148
00149         void resetButton_Pressed(object sender, RoutedEventArgs e)
00150         {
00151             forceManipulationsToEnd = true;
00152             manipulateMe.RenderTransform = null;
00153             movementAxis.SelectedIndex = 0;
00154             InitOptions();
00155             InitManipulationTransforms();
00156         }
00157     }
00158 }
00159
Generated on Fri Nov 15 2024 22:18:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/View/TripListView.xaml.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • View

TripListView.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using AdventureWorks.Common;
00013 using AdventureWorks.ViewModel;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Linq;
00017 using Windows.ApplicationModel;
00018 using Windows.Media.SpeechRecognition;
00019 using Windows.Storage;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace AdventureWorks.View
00025 {
00026     /// <summary>
00027     /// Code Behind for a list of trips, including an Add button. Associated with the
00028     /// TripListViewModel for most behaviors and properties.
00029     /// </summary>
00030     public sealed partial class TripListView : Page
00031     {
00032         private NavigationHelper navigationHelper;
00033
00034         private TripListViewModel defaultViewModel;
00035
00036         public TripListViewModel DefaultViewModel
00037         {
00038             get { return defaultViewModel; }
00039         }
00040
00041         /// <summary>
00042         /// NavigationHelper is used on each page to aid in navigation and
00043         /// process lifetime management
00044         /// </summary>
00045         public NavigationHelper NavigationHelper
00046         {
00047             get { return this.navigationHelper; }
00048         }
00049
00050
00051         public TripListView()
00052         {
00053             this.InitializeComponent();
00054             this.navigationHelper = new NavigationHelper(this);
00055             this.navigationHelper.LoadState += navigationHelper_LoadState;
00056             this.navigationHelper.SaveState += navigationHelper_SaveState;
00057         }
00058
00059         /// <summary>
00060         /// If we've lost focus and returned to this app, reload the store, as the on-disk content might have
00061         /// been changed by the background task.
00062         /// </summary>
00063         /// <param name="sender">Ignored</param>
00064         /// <param name="args">Ignored</param>
00065         private async void CoreWindow_VisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
00066         {
00067             if (args.Visible == true)
00068             {
00069                 await DefaultViewModel.LoadTrips();
00070             }
00071         }
00072
00073
00074         /// <summary>
00075         /// Sets up the view model.
00076         /// </summary>
00077         /// <param name="sender">
00078         /// The source of the event; typically <see cref="Common.NavigationHelper"/>
00079         /// </param>
00080         /// <param name="e">Event data that provides both the navigation parameter passed to
00081         /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
00082         /// a dictionary of state preserved by this page during an earlier
00083         /// session. The state will be null the first time a page is visited.</param>
00084         private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
00085         {
00086             defaultViewModel = (TripListViewModel)this.DataContext;
00087
00088             DefaultViewModel.SelectedTrip = null;
00089
00090             Window.Current.CoreWindow.VisibilityChanged += CoreWindow_VisibilityChanged;
00091         }
00092
00093         /// <summary>
00094         /// Preserves state associated with this page in case the application is suspended or the
00095         /// page is discarded from the navigation cache.  Values must conform to the serialization
00096         /// requirements of <see cref="Common.SuspensionManager.SessionState"/>.
00097         /// </summary>
00098         /// <param name="sender">The source of the event; typically <see cref="Common.NavigationHelper"/></param>
00099         /// <param name="e">Event data that provides an empty dictionary to be populated with
00100         /// serializable state.</param>
00101         private void navigationHelper_SaveState(object sender, SaveStateEventArgs e)
00102         {
00103         }
00104
00105         #region NavigationHelper registration
00106
00107         /// The methods provided in this section are simply used to allow
00108         /// NavigationHelper to respond to the page's navigation methods.
00109         ///
00110         /// Page specific logic should be placed in event handlers for the
00111         /// <see cref="Common.NavigationHelper.LoadState"/>
00112         /// and <see cref="Common.NavigationHelper.SaveState"/>.
00113         /// The navigation parameter is available in the LoadState method
00114         /// in addition to page state preserved during an earlier session.
00115
00116         protected override void OnNavigatedTo(NavigationEventArgs e)
00117         {
00118             navigationHelper.OnNavigatedTo(e);
00119         }
00120
00121         protected override void OnNavigatedFrom(NavigationEventArgs e)
00122         {
00123             navigationHelper.OnNavigatedFrom(e);
00124         }
00125
00126         #endregion
00127
00128         /// <summary>
00129         /// Since there's an imperfect click implementation on listboxes, this provides a quick
00130         /// way to handle the SelectionChanged event, in order to open the selected trip's
00131         /// details.
00132         /// </summary>
00133         /// <param name="sender">Ignored</param>
00134         /// <param name="e">Ignored</param>
00135         private void tripListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00136         {
00137             this.DefaultViewModel.SelectionChanged();
00138         }
00139
00140         /// <summary>
00141         /// Handle footer link clicks.
00142         /// </summary>
00143         /// <param name="sender">The target uri</param>
00144         /// <param name="e">Ignored</param>
00145         async void Footer_Click(object sender, RoutedEventArgs e)
00146         {
00147             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00148         }
00149     }
00150 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/ToolCarousel.cpp Source File

  • SpatialInteractionSource
  • cpp
  • Content

ToolCarousel.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "ToolCarousel.h"
00003
00004 using namespace HolographicPaint;
00005 using namespace DirectX;
00006 using namespace Windows::Foundation::Numerics;
00007
00008 static const double RotationTimeInSeconds = .5;
00009
00010 void ToolCarousel::SetPosition(
00011     float3 center,
00012     float3 radius,
00013     float3 rotationAxis)
00014 {
00015     m_center = center;
00016     m_radius = radius;
00017     m_rotationAxis = rotationAxis;
00018 }
00019
00020 void ToolCarousel::ArrangeTools(std::vector<std::shared_ptr<Tool>>& tools, size_t selectedIndex, double baseAngle)
00021 {
00022     const XMVECTOR radiusVector = XMLoadFloat3(&m_radius);
00023     const XMVECTOR rotationAxisVector = XMLoadFloat3(&m_rotationAxis);
00024
00025     const size_t toolsCount = tools.size();
00026     for (size_t idx = 0; idx < toolsCount; ++idx)
00027     {
00028         // First controller is oriented towards the user
00029         const size_t angleIndex = idx + toolsCount - selectedIndex;
00030         const double angle = baseAngle + M_PI + (2.0 * M_PI * static_cast<double>(angleIndex) / static_cast<double>(toolsCount));
00031
00032         const XMMATRIX rotationMatrix = XMMatrixRotationAxis(rotationAxisVector, static_cast<float>(angle));
00033
00034         float3 toolOffset;
00035         XMStoreFloat3(&toolOffset, XMVector3Transform(radiusVector, rotationMatrix));
00036         tools[idx]->SetPosition(m_center + toolOffset);
00037     }
00038 }
00039
00040 void ToolCarousel::StartRotation(RotationDirection rotationDirection, const DX::StepTimer& timer)
00041 {
00042     m_isRotating = true;
00043     m_rotationStart = timer.GetTotalSeconds();
00044     m_rotationDirection = rotationDirection;
00045 }
00046
00047 void ToolCarousel::Update(std::vector<std::shared_ptr<Tool>>& tools, size_t& selectedIndex, const DX::StepTimer& timer)
00048 {
00049     if (m_isRotating)
00050     {
00051         double elapsed = timer.GetTotalSeconds() - m_rotationStart;
00052         if (elapsed > RotationTimeInSeconds)
00053         {
00054             m_isRotating = false;
00055             selectedIndex = (selectedIndex + tools.size() + static_cast<int>(m_rotationDirection)) % tools.size();
00056         }
00057         else
00058         {
00059             double baseAngle = -static_cast<double>(m_rotationDirection) * (elapsed / RotationTimeInSeconds) * (M_PI * 2.0 / static_cast<double>(tools.size()));
00060             ArrangeTools(tools, selectedIndex, baseAngle);
00061         }
00062     }
00063 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/BackgroundTask/Properties/AssemblyInfo.cs Source File

  • CustomUsbDeviceAccess
  • cs
  • BackgroundTask
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BackgroundTask")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BackgroundTask")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DWriteColorTextRendererRenderer Member List

This is the complete list of members for DWriteColorTextRendererRenderer, including all inherited members.
CreateDeviceDependentResources() | DWriteColorTextRendererRenderer |
CreateWindowSizeDependentResources() | DWriteColorTextRendererRenderer |
DWriteColorTextRendererRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | DWriteColorTextRendererRenderer |
m_deviceResources | DWriteColorTextRendererRenderer | [private]
m_dwriteTextFormat | DWriteColorTextRendererRenderer | [private]
m_dwriteTextLayout | DWriteColorTextRendererRenderer | [private]
m_textRenderer | DWriteColorTextRendererRenderer | [private]
ReleaseDeviceDependentResources() | DWriteColorTextRendererRenderer |
Render() | DWriteColorTextRendererRenderer |
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/ShaderStructures.h Source File

  • 360VideoPlayback
  • cpp
  • Content

ShaderStructures.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace _360VideoPlayback
00004 {
00005     // Constant buffer used to send hologram position transform to the shader pipeline.
00006     struct ModelConstantBuffer
00007     {
00008         DirectX::XMFLOAT4X4 model;
00009     };
00010
00011     // Assert that the constant buffer remains 16-byte aligned (best practice).
00012     static_assert((sizeof(ModelConstantBuffer) % (sizeof(float) * 4)) == 0, "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00013
00014
00015     // Used to send per-vertex data to the vertex shader.
00016     struct VertexPositionTexture
00017     {
00018         DirectX::XMFLOAT3 position;
00019         DirectX::XMFLOAT2 textureCoordinate;
00020     };
00021
00022     struct FocusPointConstantBuffer
00023     {
00024         DirectX::XMFLOAT4 focusPointOrigin;
00025         DirectX::XMFLOAT4 focusPointDirection;
00026         DirectX::XMFLOAT4 focusPointColor;
00027         DirectX::XMFLOAT4 focusPointRadius; // Using XMFLOAT4 for byte alignment
00028         DirectX::XMFLOAT4 focusPointIntensity; // Using XMFLOAT4 for byte alignment
00029     };
00030     static_assert((sizeof(FocusPointConstantBuffer) % (sizeof(float) * 4)) == 0, "FocusPointConstantBuffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00031 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/Scenario2_PrintReceipt.xaml.cs Source File

  • PosPrinter
  • cs

Scenario2_PrintReceipt.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.PointOfService;
00015 using Windows.Graphics.Imaging;
00016 using Windows.Storage;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario2_PrintReceipt : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025
00026         public Scenario2_PrintReceipt()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         bool IsPrinterClaimed()
00032         {
00033             if (rootPage.ClaimedPrinter != null)
00034             {
00035                 rootPage.NotifyUser("", NotifyType.StatusMessage);
00036                 return true;
00037             }
00038             else
00039             {
00040                 rootPage.NotifyUser("Use scenario 1 to find, claim, and enable a receipt printer.", NotifyType.ErrorMessage);
00041                 return false;
00042             }
00043         }
00044
00045
00046         async Task<bool> ExecuteJobAndReportResultAsync(ReceiptPrintJob job)
00047         {
00048             bool success = await job.ExecuteAsync();
00049             if (success)
00050             {
00051                 rootPage.NotifyUser("Printing complete.", NotifyType.StatusMessage);
00052             }
00053             else
00054             {
00055
00056                 ClaimedReceiptPrinter receiptPrinter = rootPage.ClaimedPrinter.Receipt;
00057                 string reason;
00058                 if (receiptPrinter.IsCartridgeEmpty)
00059                 {
00060                     reason = "Printer is out of ink. Please replace cartridge.";
00061                 }
00062                 else if (receiptPrinter.IsCartridgeRemoved)
00063                 {
00064                     reason = "Printer cartridge is missing. Please replace cartridge.";
00065                 }
00066                 else if (receiptPrinter.IsCoverOpen)
00067                 {
00068                     reason = "Printer cover is open. Please close it.";
00069                 }
00070                 else if (receiptPrinter.IsHeadCleaning)
00071                 {
00072                     reason = "Printer is currently cleaning the cartridge. Please wait until cleaning has completed.";
00073                 }
00074                 else if (receiptPrinter.IsPaperEmpty)
00075                 {
00076                     reason = "Printer is out of paper. Please insert a new roll.";
00077                 }
00078                 else
00079                 {
00080                     reason = "Unable to print.";
00081                 }
00082                 rootPage.NotifyUser(reason, NotifyType.ErrorMessage);
00083             }
00084             return success;
00085         }
00086
00087         #region Print a single line of text
00088         /// <summary>
00089         /// Prints the line that is in the textbox.
00090         /// </summary>
00091         async void PrintLine_Click()
00092         {
00093             if (!IsPrinterClaimed())
00094             {
00095                 return;
00096             }
00097
00098             ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
00099             job.PrintLine(PrintLineTextBox.Text);
00100             await ExecuteJobAndReportResultAsync(job);
00101         }
00102         #endregion
00103
00104         #region Print a sample receipt
00105         async void PrintReceipt_Click()
00106         {
00107             if (!IsPrinterClaimed())
00108             {
00109                 return;
00110             }
00111
00112             string receiptString = "======================\n" +
00113                                    "|   Sample Header    |\n" +
00114                                    "======================\n" +
00115                                    "Item             Price\n" +
00116                                    "----------------------\n" +
00117                                    "Books            10.40\n" +
00118                                    "Games             9.60\n" +
00119                                    "----------------------\n" +
00120                                    "Total            20.00\n";
00121
00122             rootPage.NotifyUser("Printing receipt...", NotifyType.StatusMessage);
00123
00124             // The job consists of two receipts, one for the merchant and one
00125             // for the customer.
00126             ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
00127             PrintLineFeedAndCutPaper(job, receiptString + GetMerchantFooter());
00128             PrintLineFeedAndCutPaper(job, receiptString + GetCustomerFooter());
00129
00130             await ExecuteJobAndReportResultAsync(job);
00131         }
00132
00133         string GetMerchantFooter()
00134         {
00135             return "\n" +
00136                    "______________________\n" +
00137                    "Signature\n" +
00138                    "\n" +
00139                    "Merchant Copy\n";
00140         }
00141
00142         string GetCustomerFooter()
00143         {
00144             return "\n" +
00145                    "Customer Copy\n";
00146         }
00147
00148         // Cut the paper after printing enough blank lines to clear the paper cutter.
00149         private void PrintLineFeedAndCutPaper(ReceiptPrintJob job, string receipt)
00150         {
00151             // Passing a multi-line string to the Print method results in
00152             // smoother paper feeding than sending multiple single-line strings
00153             // to PrintLine.
00154             string feedString = "";
00155             for (uint n = 0; n < rootPage.ClaimedPrinter.Receipt.LinesToPaperCut; n++)
00156             {
00157                 feedString += "\n";
00158             }
00159             job.Print(receipt + feedString);
00160             if (rootPage.Printer.Capabilities.Receipt.CanCutPaper)
00161             {
00162                 job.CutPaper();
00163             }
00164         }
00165         #endregion
00166
00167         #region Print a bitmap
00168         private async void PrintBitmap_Click()
00169         {
00170             if (!IsPrinterClaimed())
00171             {
00172                 return;
00173             }
00174             rootPage.ClaimedPrinter.Receipt.IsLetterQuality = true;
00175             ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
00176             BitmapFrame logoFrame = await LoadLogoBitmapAsync();
00177             job.PrintBitmap(logoFrame, PosPrinterAlignment.Center);
00178             await ExecuteJobAndReportResultAsync(job);
00179         }
00180
00181         public static async Task<BitmapFrame> LoadLogoBitmapAsync()
00182         {
00183             var uri = new Uri("ms-appx:///Assets/coffee-logo.png");
00184             StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
00185             using (var readStream = await file.OpenReadAsync())
00186             {
00187                 BitmapDecoder decoder = await BitmapDecoder.CreateAsync(readStream);
00188                 return await decoder.GetFrameAsync(0);
00189             }
00190         }
00191         #endregion
00192
00193         #region Print a barcode
00194         private async void PrintBarcode_Click()
00195         {
00196             if (!IsPrinterClaimed())
00197             {
00198                 return;
00199             }
00200
00201             rootPage.ClaimedPrinter.Receipt.IsLetterQuality = true;
00202             ReceiptPrintJob job = rootPage.ClaimedPrinter.Receipt.CreateJob();
00203             job.PrintBarcode(BarcodeText.Text, BarcodeSymbologies.Upca, 60, 3, PosPrinterBarcodeTextPosition.Below, PosPrinterAlignment.Center);
00204             await ExecuteJobAndReportResultAsync(job);
00205         }
00206         #endregion
00207     }
00208 }
Generated on Fri Nov 15 2024 22:20:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaModel Member List

This is the complete list of members for MediaModel, including all inherited members.
ArtUri | MediaModel |
MediaModel(Uri mediaUri) | MediaModel | [inline]
MediaPlaybackItem | MediaModel |
Title | MediaModel |
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario11_DeleteCookie.xaml.cs Source File

  • HttpClient
  • cs

Scenario11_DeleteCookie.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using Windows.Web.Http;
00017 using Windows.Web.Http.Filters;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class Scenario11_DeleteCookie : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         public Scenario11_DeleteCookie()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         private void DeleteCookie_Click(object sender, RoutedEventArgs e)
00036         {
00037             if (String.IsNullOrEmpty(NameField.Text) || String.IsNullOrEmpty(DomainField.Text) || String.IsNullOrEmpty(PathField.Text))
00038             {
00039                 rootPage.NotifyUser("Invalid name, domain, or path value.", NotifyType.ErrorMessage);
00040                 return;
00041             }
00042
00043             try
00044             {
00045                 HttpCookie cookie = new HttpCookie(NameField.Text, DomainField.Text, PathField.Text);
00046
00047                 HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();
00048                 filter.CookieManager.DeleteCookie(cookie);
00049
00050                 rootPage.NotifyUser("Cookie deleted.", NotifyType.StatusMessage);
00051             }
00052             catch (ArgumentException ex)
00053             {
00054                 rootPage.NotifyUser(ex.Message, NotifyType.StatusMessage);
00055             }
00056             catch (Exception ex)
00057             {
00058                 rootPage.NotifyUser("Error: " + ex.Message, NotifyType.ErrorMessage);
00059             }
00060         }
00061     }
00062 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_UsbDescriptors Member List

This is the complete list of members for Scenario5_UsbDescriptors, including all inherited members.
Descriptor_SelectChanged(Object sender, RoutedEventArgs eventArgs) | Scenario5_UsbDescriptors | [inline, private]
GetConfigurationDescriptorAsString() | Scenario5_UsbDescriptors | [inline, private]
GetCustomDescriptorsAsString() | Scenario5_UsbDescriptors | [inline, private]
GetDeviceDescriptorAsString() | Scenario5_UsbDescriptors | [inline, private]
GetEndpointDescriptorsAsString() | Scenario5_UsbDescriptors | [inline, private]
GetInterfaceDescriptorsAsString() | Scenario5_UsbDescriptors | [inline, private]
GetProductName() | Scenario5_UsbDescriptors | [inline, private]
listOfDescriptorTypes | Scenario5_UsbDescriptors | [private]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario5_UsbDescriptors | [inline, protected]
PrintDescriptor(Descriptor descriptorType) | Scenario5_UsbDescriptors | [inline, private]
rootPage | Scenario5_UsbDescriptors | [private]
Scenario5_UsbDescriptors() | Scenario5_UsbDescriptors | [inline]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStreamSink::CAsyncOperation Member List

This is the complete list of members for CStreamSink::CAsyncOperation, including all inherited members.
_cRef | CStreamSink::CAsyncOperation | [private]
CAsyncOperation(StreamOperation op) | CStreamSink::CAsyncOperation |
m_op | CStreamSink::CAsyncOperation |
QueryInterface(REFIID iid, void **ppv) | CStreamSink::CAsyncOperation |
STDMETHODIMP_(ULONG) AddRef() | CStreamSink::CAsyncOperation |
STDMETHODIMP_(ULONG) Release() | CStreamSink::CAsyncOperation |
~CAsyncOperation() | CStreamSink::CAsyncOperation | [private, virtual]
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/Scenario1.xaml.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario1

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Storage;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace DataVirtualizationSample
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario1 : Page
00027     {
00028
00029         public Scenario1()
00030         {
00031             this.InitializeComponent();
00032             Grid1.ContainerContentChanging += Grid1_ContainerContentChanging;
00033             initdata();
00034         }
00035
00036         private void Grid1_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
00037         {
00038             if (!args.InRecycleQueue)
00039             {
00040                 // Sets a textblock in each item indicating its index
00041                 FrameworkElement ctr = (FrameworkElement)args.ItemContainer.ContentTemplateRoot;
00042                 if (ctr != null)
00043                 {
00044                     TextBlock t = (TextBlock)ctr.FindName("idx");
00045                     t.Text = args.ItemIndex.ToString();
00046                 }
00047             }
00048         }
00049
00050         async void initdata()
00051         {
00052             StorageLibrary pictures = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
00053             string path = pictures.SaveFolder.Path;
00054
00055             FileDataSource ds = await FileDataSource.GetDataSoure(path);
00056             if (ds.Count > 0)
00057             {
00058                 Grid1.ItemsSource = ds;
00059             }
00060             else
00061             {
00062                 MainPage.Current.NotifyUser("Error: The pictures folder doesn't contain any files", NotifyType.ErrorMessage);
00063             }
00064         }
00065     }
00066 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario12_DisableCookies.h Source File

  • HttpClient
  • cppwinrt

Scenario12_DisableCookies.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario12_DisableCookies.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario12_DisableCookies : Scenario12_DisableCookiesT<Scenario12_DisableCookies>
00020     {
00021         Scenario12_DisableCookies();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         fire_and_forget SendInitialGetButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         fire_and_forget SendNextRequestButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void Cancel_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032         Windows::Web::Http::Filters::HttpBaseProtocolFilter filter{ nullptr };
00033         Windows::Web::Http::HttpClient httpClient{ nullptr };
00034         Windows::Foundation::IAsyncAction pendingAction{ nullptr };
00035
00036         Windows::Foundation::IAsyncAction CancelableInitialRequestAsync(Windows::Foundation::Uri resourceUri);
00037         Windows::Foundation::IAsyncAction CancelableNextRequestAsync(Windows::Foundation::Uri resourceUri);
00038     };
00039 }
00040
00041 namespace winrt::SDKTemplate::factory_implementation
00042 {
00043     struct Scenario12_DisableCookies : Scenario12_DisableCookiesT<Scenario12_DisableCookies, implementation::Scenario12_DisableCookies>
00044     {
00045     };
00046 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/PcscUtils.cs Source File

  • Nfc
  • PcscSdk

PcscUtils.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.SmartCards;
00015 using Windows.Storage.Streams;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using Windows.Devices.Enumeration;
00018 using System.Linq;
00019
00020 namespace Pcsc
00021 {
00022     public static class SmartCardConnectionExtension
00023     {
00024         /// <summary>
00025         /// Extension method to SmartCardConnection class similar to Transmit asyc method, however it accepts PCSC SDK commands.
00026         /// </summary>
00027         /// <param name="apduCommand">
00028         /// APDU command object to send to the ICC
00029         /// </param>
00030         /// <param name="connection">
00031         /// SmartCardConnection object
00032         /// </param>
00033         /// <returns>APDU response object of type defined by the APDU command object</returns>
00034         public static async Task<Iso7816.ApduResponse> TransceiveAsync(this SmartCardConnection connection, Iso7816.ApduCommand apduCommand)
00035         {
00036             Iso7816.ApduResponse apduRes = Activator.CreateInstance(apduCommand.ApduResponseType) as Iso7816.ApduResponse;
00037
00038             IBuffer responseBuf = await connection.TransmitAsync(apduCommand.GetBuffer());
00039
00040             apduRes.ExtractResponse(responseBuf);
00041
00042             return apduRes;
00043         }
00044
00045         /// <summary>
00046         /// Extension method to SmartCardConnection class to perform a transparent exchange to the ICC
00047         /// </summary>
00048         /// <param name="connection">
00049         /// SmartCardConnection object
00050         /// </param>
00051         /// <param name="commandData">
00052         /// Command object to send to the ICC
00053         /// </param>
00054         /// <returns>Response received from the ICC</returns>
00055         public static async Task<byte[]> TransparentExchangeAsync(this SmartCardConnection connection, byte[] commandData)
00056         {
00057             byte[] responseData = null;
00058             ManageSessionResponse apduRes = await TransceiveAsync(connection, new ManageSession(new byte[2] { (byte)ManageSession.DataObjectType.StartTransparentSession, 0x00 })) as ManageSessionResponse;
00059
00060             if (!apduRes.Succeeded)
00061             {
00062                 throw new Exception("Failure to start transparent session, " + apduRes.ToString());
00063             }
00064
00065             using (DataWriter dataWriter = new DataWriter())
00066             {
00067                 dataWriter.WriteByte((byte)TransparentExchange.DataObjectType.Transceive);
00068                 dataWriter.WriteByte((byte)commandData.Length);
00069                 dataWriter.WriteBytes(commandData);
00070
00071                 TransparentExchangeResponse apduRes1 = await TransceiveAsync(connection, new TransparentExchange(dataWriter.DetachBuffer().ToArray())) as TransparentExchangeResponse;
00072
00073                 if (!apduRes1.Succeeded)
00074                 {
00075                     throw new Exception("Failure transceive with card, " + apduRes1.ToString());
00076                 }
00077
00078                 responseData = apduRes1.IccResponse;
00079             }
00080
00081             ManageSessionResponse apduRes2 = await TransceiveAsync(connection, new ManageSession(new byte[2] { (byte)ManageSession.DataObjectType.EndTransparentSession, 0x00 })) as ManageSessionResponse;
00082
00083             if (!apduRes2.Succeeded)
00084             {
00085                 throw new Exception("Failure to end transparent session, " + apduRes2.ToString());
00086             }
00087
00088             return responseData;
00089         }
00090     }
00091
00092     public class SmartCardReaderUtils
00093     {
00094         /// <summary>
00095         /// Checks whether the device supports smart card reader mode
00096         /// </summary>
00097         /// <returns>None</returns>
00098         public static async Task<DeviceInformation> GetFirstSmartCardReaderInfo(SmartCardReaderKind readerKind = SmartCardReaderKind.Any)
00099         {
00100             // Check if the SmartCardConnection API exists on this currently running SKU of Windows
00101             if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Devices.SmartCards.SmartCardConnection"))
00102             {
00103                 // This SKU of Windows does not support NFC card reading, only desktop and phones/mobile devices support NFC card reading
00104                 return null;
00105             }
00106
00107             // Device selector string is from SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Nfc) except that we remove the conditional
00108             // about the interface being enabled, since we want to get the device object regardless of whether the user turned it off in the CPL
00109             string query = "System.Devices.InterfaceClassGuid:=\"{DEEBE6AD-9E01-47E2-A3B2-A66AA2C036C9}\"";
00110             if (readerKind != SmartCardReaderKind.Any)
00111             {
00112                 query += " AND System.Devices.SmartCards.ReaderKind:=" + (int)readerKind;
00113             }
00114
00115             DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(query);
00116
00117             // There is a bug on some devices that were updated to WP8.1 where an NFC SmartCardReader is
00118             // enumerated despite that the device does not support it. As a workaround, we can do an additonal check
00119             // to ensure the device truly does support it.
00120             var workaroundDetect = await DeviceInformation.FindAllAsync("System.Devices.InterfaceClassGuid:=\"{50DD5230-BA8A-11D1-BF5D-0000F805F530}\"");
00121
00122             if (workaroundDetect.Count == 0 || devices.Count == 0)
00123             {
00124                 // Not supported
00125                 return null;
00126             }
00127
00128             // Smart card reader supported, but may be disabled
00129             return (from d in devices
00130                           where d.IsEnabled
00131                           orderby d.IsDefault descending
00132                           select d).FirstOrDefault();
00133         }
00134     }
00135 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario3_InterruptPipes.xaml.cs Source File

  • CustomUsbDeviceAccess
  • cs

Scenario3_InterruptPipes.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Globalization;
00015 using System.Runtime.InteropServices.WindowsRuntime;
00016 using Windows.Devices.Usb;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Foundation;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Documents;
00024 using Windows.UI.Xaml.Navigation;
00025 using SDKTemplate;
00026
00027 namespace CustomUsbDeviceAccess
00028 {
00029     /// <summary>
00030     /// This page demonstrates how to use interrupts pipes on a UsbDevice
00031     /// </summary>
00032     public sealed partial class Scenario3_InterruptPipes : Page
00033     {
00034         private TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs> interruptEventHandler;
00035         private UInt32 registeredInterruptPipeIndex; // Pipe index of the pipe we that we registered for. Only valid if registeredInterrupt is true
00036         private Boolean registeredInterrupt;
00037
00038         private UInt32 numInterruptsReceived;
00039         private UInt32 totalNumberBytesReceived;
00040         private UInt32 totalNumberBytesWritten;
00041
00042         // Indicate if we navigate away from this page or not.
00043         private Boolean navigatedAway;
00044
00045         // Only valid for the OSRFX2 device
00046         private List<Boolean> previousSwitchStates;
00047
00048         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00049         // as NotifyUser()
00050         private MainPage rootPage = MainPage.Current;
00051
00052         public Scenario3_InterruptPipes()
00053         {
00054             registeredInterruptPipeIndex = 0;
00055             totalNumberBytesWritten = 0;
00056             registeredInterrupt = false;
00057             numInterruptsReceived = 0;
00058             totalNumberBytesReceived = 0;
00059             previousSwitchStates = null;
00060
00061             this.InitializeComponent();
00062         }
00063
00064         /// <summary>
00065         /// Invoked when this page is about to be displayed in a Frame.
00066         ///
00067         /// We will enable/disable parts of the UI if the device doesn't support it.
00068         /// </summary>
00069         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00070         /// property is typically used to configure the page.</param>
00071         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00072         {
00073             navigatedAway = false;
00074             totalNumberBytesWritten = 0;
00075
00076             // We will disable the scenario that is not supported by the device.
00077             // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00078             Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
00079             deviceScenarios.Add(DeviceType.OsrFx2, OsrFx2Scenario);
00080             deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);
00081
00082             Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00083
00084             // Get notified when the device is about to be closed so we can unregister events
00085             EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00086
00087             ClearSwitchStateTable();
00088             UpdateRegisterEventButton();
00089         }
00090
00091         protected override void OnNavigatedFrom(NavigationEventArgs eventArgs)
00092         {
00093             navigatedAway = true;
00094
00095             if (EventHandlerForDevice.Current.IsDeviceConnected)
00096             {
00097                 UnregisterFromInterruptEvent();
00098             }
00099
00100             // We are leaving and no longer care about the device closing
00101             EventHandlerForDevice.Current.OnDeviceClose = null;
00102         }
00103
00104         private async void OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation)
00105         {
00106             UnregisterFromInterruptEvent();
00107
00108             await rootPage.Dispatcher.RunAsync(
00109                 CoreDispatcherPriority.Normal,
00110                 new DispatchedHandler(() =>
00111                 {
00112                     UpdateRegisterEventButton();
00113                     ClearSwitchStateTable();
00114                 }));
00115         }
00116
00117         /// <summary>
00118         /// This method will register for events on the correct interrupt in pipe index on the OsrFx2 device.
00119         /// </summary>
00120         /// <param name="sender"></param>
00121         /// <param name="eventArgs"></param>
00122         private void RegisterOsrFx2InterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00123         {
00124             if (EventHandlerForDevice.Current.IsDeviceConnected)
00125             {
00126                 UInt32 interruptPipeIndex = OsrFx2.Pipe.InterruptInPipeIndex;
00127                 var interruptEventHandler = new TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs>(this.OnOsrFx2SwitchStateChangeEvent);
00128
00129                 RegisterForInterruptEvent(interruptPipeIndex, interruptEventHandler);
00130
00131                 UpdateRegisterEventButton();
00132                 ClearSwitchStateTable();
00133             }
00134             else
00135             {
00136                 Utilities.NotifyDeviceNotConnected();
00137             }
00138
00139         }
00140
00141         /// <summary>
00142         /// This method will register for events on the correct interrupt in pipe index on the SuperMutt device.
00143         /// </summary>
00144         /// <param name="sender"></param>
00145         /// <param name="eventArgs"></param>
00146         private void RegisterSuperMuttInterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00147         {
00148             if (EventHandlerForDevice.Current.IsDeviceConnected)
00149             {
00150                 UInt32 interruptPipeIndex = SuperMutt.Pipe.InterruptInPipeIndex;
00151
00152                 var interruptEventHandler = new TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs>(this.OnGeneralInterruptEvent);
00153
00154                 RegisterForInterruptEvent(interruptPipeIndex, interruptEventHandler);
00155
00156                 UpdateRegisterEventButton();
00157                 ClearSwitchStateTable();
00158             }
00159             else
00160             {
00161                 Utilities.NotifyDeviceNotConnected();
00162             }
00163
00164         }
00165
00166         private void UnregisterInterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00167         {
00168             if (EventHandlerForDevice.Current.IsDeviceConnected)
00169             {
00170                 UnregisterFromInterruptEvent();
00171
00172                 UpdateRegisterEventButton();
00173                 ClearSwitchStateTable();
00174             }
00175             else
00176             {
00177                 Utilities.NotifyDeviceNotConnected();
00178             }
00179         }
00180
00181         /// <summary>
00182         /// This scenario is only available on the SuperMutt device because the OSRFX2 doesn't have Out Interrupt Endpoints.
00183         ///
00184         /// This method will determine the right InterruptOutPipe to use and will call another method to do the actual writing.
00185         /// <summary>
00186         /// <param name="sender"></param>
00187         /// <param name="eventArgs"></param>
00188         private void WriteSuperMuttInterruptOut_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00189         {
00190             if (EventHandlerForDevice.Current.IsDeviceConnected)
00191             {
00192                 var interruptOutPipeIndex = SuperMutt.Pipe.InterruptOutPipeIndex;
00193                 var interruptOutPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptOutPipes;
00194
00195                 if (interruptOutPipeIndex < interruptOutPipes.Count)
00196                 {
00197                     // We will write the maximum number of bytes we can per interrupt
00198                     var bytesToWrite = interruptOutPipes[(int)interruptOutPipeIndex].EndpointDescriptor.MaxPacketSize;
00199
00200                     WriteToInterruptOut(interruptOutPipeIndex, bytesToWrite);
00201                 }
00202                 else
00203                 {
00204                     MainPage.Current.NotifyUser("Pipe index provided (" + interruptOutPipeIndex.ToString(NumberFormatInfo.InvariantInfo) + ") is out of range", NotifyType.ErrorMessage);
00205                 }
00206             }
00207             else
00208             {
00209                 Utilities.NotifyDeviceNotConnected();
00210             }
00211         }
00212
00213         /// <summary>
00214         /// Register for the interrupt that is triggered when the device sends an interrupt to us (e.g. OSRFX2's device's switch state changes
00215         /// or SuperMUTT's software generated interrupts).
00216         /// The DefaultInterface on the the device is the first interface on the device. We navigate to
00217         /// the InterruptInPipes because that collection contains all the interrupt in pipes for the
00218         /// selected interface setting.
00219         ///
00220         /// Each pipe has a property that links to an EndpointDescriptor. This descriptor can be used to find information about
00221         /// the pipe (e.g. type, id, etc...). The EndpointDescriptor trys to mirror the EndpointDescriptor that is defined in the Usb Spec.
00222         ///
00223         /// The function also saves the event token so that we can unregister from the even later on.
00224         /// </summary>
00225         /// <param name="pipeIndex">The index of the pipe found in UsbInterface.InterruptInPipes. It is not the endpoint number</param>
00226         /// <param name="eventHandler">Event handler that will be called when the event is raised</param>
00227         private void RegisterForInterruptEvent(UInt32 pipeIndex, TypedEventHandler<UsbInterruptInPipe, UsbInterruptInEventArgs> eventHandler)
00228         {
00229             var interruptInPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptInPipes;
00230
00231             if (!registeredInterrupt && (pipeIndex < interruptInPipes.Count))
00232             {
00233                 var interruptInPipe = interruptInPipes[(int)pipeIndex];
00234
00235                 registeredInterrupt = true;
00236                 registeredInterruptPipeIndex = pipeIndex;
00237
00238                 // Save the interrupt handler so we can use it to unregister
00239                 interruptEventHandler = eventHandler;
00240
00241                 interruptInPipe.DataReceived += interruptEventHandler;
00242
00243                 numInterruptsReceived = 0;
00244                 totalNumberBytesReceived = 0;
00245             }
00246         }
00247
00248         /// <summary>
00249         /// Unregisters from the interrupt event that was registered for in the RegisterForInterruptEvent();
00250         /// </summary>
00251         private void UnregisterFromInterruptEvent()
00252         {
00253             if (registeredInterrupt)
00254             {
00255                 // Search for the correct pipe that we know we used to register events
00256                 var interruptInPipe = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptInPipes[(int)registeredInterruptPipeIndex];
00257                 interruptInPipe.DataReceived -= interruptEventHandler;
00258
00259                 registeredInterrupt = false;
00260             }
00261         }
00262
00263         /// <summary>
00264         /// This method is called whenever the device sends an interrupt on the pipe we registered this callback on.
00265         ///
00266         /// We will read a byte from the buffer that the device sent to us and then look at each bit to determine state of
00267         /// each switch. AFter determining the state of each switch, we will print out a table with each row representing a
00268         /// switch and its state.
00269         /// </summary>
00270         /// <param name="sender">The interrupt pipe that raised the event (the one that received the interrupt)</param>
00271         /// <param name="eventArgs">Contains the data, in an IBuffer, that was received through the interrupts</param>
00272         private async void OnOsrFx2SwitchStateChangeEvent(UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs)
00273         {
00274             // If we navigated away from this page, we don't need to process this event
00275             // This also prevents output from spilling into another page
00276             if (!navigatedAway)
00277             {
00278                 numInterruptsReceived++;
00279
00280                 // The OSRFX2 gives us 1 byte, each bit representing the state of a switch
00281                 const Byte numberOfSwitches = 8;
00282
00283                 var switchStateList = new List<Boolean>(numberOfSwitches);
00284
00285                 IBuffer buffer = eventArgs.InterruptData;
00286
00287                 if (buffer.Length > 0)
00288                 {
00289                     totalNumberBytesReceived += buffer.Length;
00290
00291                     DataReader reader = DataReader.FromBuffer(buffer);
00292
00293                     byte switchStates = reader.ReadByte();
00294
00295                     // Loop through each bit of what the device sent us and determine the state of each switch
00296                     for (int switchIndex = 0; switchIndex < numberOfSwitches; switchIndex++)
00297                     {
00298                         int result = (1 << switchIndex) & switchStates;
00299
00300                         if (result != 0)
00301                         {
00302                             switchStateList.Add(true);
00303                         }
00304                         else
00305                         {
00306                             switchStateList.Add(false);
00307                         }
00308                     }
00309
00310                     // Create a DispatchedHandler for the because we are printing the table to the UI directly and the
00311                     // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
00312                     // the UI, an exception is thrown
00313                     await rootPage.Dispatcher.RunAsync(
00314                         CoreDispatcherPriority.Normal,
00315                         new DispatchedHandler(() =>
00316                         {
00317                             // If we navigated away from this page, do not print anything. The dispatch may be handled after
00318                             // we move to a different page.
00319                             if (!navigatedAway)
00320                             {
00321                                 rootPage.NotifyUser(
00322                                     "Total number of interrupt events received: " + numInterruptsReceived.ToString()
00323                                     + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
00324                                     NotifyType.StatusMessage);
00325
00326                                 // Print the switch state table
00327                                 UpdateSwitchStateTable(switchStateList);
00328                             }
00329                         }));
00330                 }
00331                 else
00332                 {
00333                     await rootPage.Dispatcher.RunAsync(
00334                         CoreDispatcherPriority.Normal,
00335                         new DispatchedHandler(() =>
00336                         {
00337                             // If we navigated away from this page, do not print anything. The dispatch may be handled after
00338                             // we move to a different page.
00339                             if (!navigatedAway)
00340                             {
00341                                 rootPage.NotifyUser("Received 0 bytes from interrupt", NotifyType.ErrorMessage);
00342                             }
00343                         }));
00344                 }
00345             }
00346         }
00347
00348         /// <summary>
00349         /// This callback only increments the total number of interrupts received and prints it
00350         ///
00351         /// This method is called whenever the device sends an interrupt on the pipe we registered this callback on.
00352         /// </summary>
00353         /// <param name="sender">The interrupt pipe that raised the event (the one that received the interrupt)</param>
00354         /// <param name="eventArgs">Contains the data, in an IBuffer, that was received through the interrupts</param>
00355         private async void OnGeneralInterruptEvent(UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs)
00356         {
00357             // If we navigated away from this page, we don't need to process this event
00358             // This also prevents output from spilling into another page
00359             if (!navigatedAway)
00360             {
00361                 numInterruptsReceived++;
00362
00363                 // The data from the interrupt
00364                 IBuffer buffer = eventArgs.InterruptData;
00365
00366                 totalNumberBytesReceived += buffer.Length;
00367
00368                 // Create a DispatchedHandler for the because we are interracting with the UI directly and the
00369                 // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
00370                 // the UI, an exception is thrown
00371                 await rootPage.Dispatcher.RunAsync(
00372                     CoreDispatcherPriority.Normal,
00373                     new DispatchedHandler(() =>
00374                     {
00375                         // If we navigated away from this page, do not print anything. The dispatch may be handled after
00376                         // we move to a different page.
00377                         if (!navigatedAway)
00378                         {
00379                             MainPage.Current.NotifyUser(
00380                                 "Total number of interrupt events received: " + numInterruptsReceived.ToString()
00381                                 + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
00382                                 NotifyType.StatusMessage);
00383                         }
00384                     }));
00385             }
00386         }
00387
00388         /// <summary>
00389         /// Will write garbage data to the specified output pipe
00390         /// </summary>
00391         /// <param name="pipeIndex">Index of pipe in the list of Device.DefaultInterface.InterruptOutPipes</param>
00392         /// <param name="bytesToWrite">Bytes of garbage data to write</param>
00393         private async void WriteToInterruptOut(UInt32 pipeIndex, UInt32 bytesToWrite)
00394         {
00395             var interruptOutPipes = EventHandlerForDevice.Current.Device.DefaultInterface.InterruptOutPipes;
00396
00397             if (pipeIndex < interruptOutPipes.Count)
00398             {
00399                 // Create an array, all default initialized to 0, and write it to the buffer
00400                 // The data inside the buffer will be garbage
00401                 var arrayBuffer = new Byte[bytesToWrite];
00402
00403                 var pipe = interruptOutPipes[(int)pipeIndex];
00404
00405                 var pipeWriter = new DataWriter(pipe.OutputStream);
00406                 pipeWriter.WriteBytes(arrayBuffer);
00407
00408                 // This is where the data is flushed out to the device.
00409                 UInt32 bytesWritten = await pipeWriter.StoreAsync();
00410
00411                 totalNumberBytesWritten += bytesWritten;
00412
00413                 MainPage.Current.NotifyUser("Total Bytes Written: " + totalNumberBytesWritten.ToString(), NotifyType.StatusMessage);
00414             }
00415             else
00416             {
00417                 MainPage.Current.NotifyUser("Pipe index provided (" + pipeIndex.ToString() + ") is out of range", NotifyType.ErrorMessage);
00418             }
00419         }
00420
00421         private void ClearSwitchStateTable()
00422         {
00423             SwitchStates.Inlines.Clear();
00424             previousSwitchStates = null;
00425         }
00426
00427         /// <summary>
00428         /// Prints a table in the UI representing the current state of each of the switches on the OSRFX2 board.
00429         /// The bolded states/switches are the switches that have their states changed.
00430         ///
00431         /// Note that the OSRFX2 board has the switch states reversed (1 is off and 0 is on)
00432         /// </summary>
00433         /// <param name="states">Switch states where 0 is off and 1 is on</param>
00434         private void UpdateSwitchStateTable(List<Boolean> states)
00435         {
00436             CreateBooleanChartInTable(
00437                 SwitchStates.Inlines,  // The table will be written directly to the UI's textbox
00438                 states,
00439                 previousSwitchStates,
00440                 "off",
00441                 "on");
00442
00443             previousSwitchStates = states;
00444         }
00445
00446         private void UpdateRegisterEventButton()
00447         {
00448             ButtonRegisterSuperMuttInterruptEvent.IsEnabled = !registeredInterrupt;
00449             ButtonRegisterOsrFx2InterruptEvent.IsEnabled = !registeredInterrupt;
00450             ButtonUnregisterInterruptEvent.IsEnabled = registeredInterrupt;
00451         }
00452
00453         /// <summary>
00454         /// Clears and populates the provided table with rows that have the following syntax:
00455         /// [row #]    [state of new value]
00456         ///
00457         /// If the state of a value has changed, the value will be bolded.
00458         /// </summary>
00459         /// <param name="table">Table will be cleared and new rows will populate this table.</param>
00460         /// <param name="newValues">The new boolean values</param>
00461         /// <param name="oldValues">The boolean values that the new ones are being compared to</param>
00462         /// <param name="trueValue">Text if the new value is TRUE</param>
00463         /// <param name="falseValue">Text if the new vlaue is FALSE</param>
00464         public static Boolean CreateBooleanChartInTable(
00465             InlineCollection table,
00466             List<Boolean> newValues,
00467             List<Boolean> oldValues,
00468             String trueValue,
00469             String falseValue)
00470         {
00471             Boolean isBooleanChartCreated = false;
00472
00473             // Make sure there are at least newValues to check or that there are the same number of old values as new values
00474             if ((newValues != null) && ((oldValues == null) || (newValues.Count == oldValues.Count)))
00475             {
00476                 table.Clear();
00477
00478                 // Each new value has it's own row
00479                 for (int i = 0; i < (int)newValues.Count; i += 1)
00480                 {
00481                     var line = new Span();
00482
00483                     // Row #
00484                     var block = new Run();
00485                     block.Text = (i + 1).ToString("D", NumberFormatInfo.InvariantInfo);
00486                     line.Inlines.Add(block);
00487
00488                     // Space between row # and the value (simulates a column)
00489                     block = new Run();
00490                     block.Text = "    ";
00491                     line.Inlines.Add(block);
00492
00493                     // Print the textual form of TRUE/FALSE values
00494                     block = new Run();
00495                     block.Text = newValues[i] ? trueValue : falseValue;
00496
00497                     // Bold values that have changed
00498                     if ((oldValues != null) && (oldValues[i] != newValues[i]))
00499                     {
00500                         var bold = new Bold();
00501                         bold.Inlines.Add(block);
00502                         line.Inlines.Add(bold);
00503                     }
00504                     else
00505                     {
00506                         line.Inlines.Add(block);
00507                     }
00508
00509                     line.Inlines.Add(new LineBreak());
00510
00511                     table.Add(line);
00512                 }
00513
00514                 isBooleanChartCreated = true;
00515             }
00516
00517             return isBooleanChartCreated;
00518         }
00519     }
00520 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/HttpJsonContent.cs Source File

  • HttpClient
  • cs

HttpJsonContent.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Runtime.InteropServices.WindowsRuntime;
00016 using System.Text;
00017 using System.Threading.Tasks;
00018 using Windows.Data.Json;
00019 using Windows.Foundation;
00020 using Windows.Storage.Streams;
00021 using Windows.Web.Http;
00022 using Windows.Web.Http.Headers;
00023
00024 namespace SDKTemplate
00025 {
00026     class HttpJsonContent : IHttpContent
00027     {
00028         IJsonValue jsonValue;
00029         HttpContentHeaderCollection headers;
00030
00031         public HttpContentHeaderCollection Headers
00032         {
00033             get
00034             {
00035                 return headers;
00036             }
00037         }
00038
00039         public HttpJsonContent(IJsonValue jsonValue)
00040         {
00041             if (jsonValue == null)
00042             {
00043                 throw new ArgumentException("jsonValue cannot be null.");
00044             }
00045             this.jsonValue = jsonValue;
00046             headers = new HttpContentHeaderCollection();
00047             headers.ContentType = new HttpMediaTypeHeaderValue("application/json");
00048             headers.ContentType.CharSet = "UTF-8";
00049         }
00050
00051         public IAsyncOperationWithProgress<ulong, ulong> BufferAllAsync()
00052         {
00053             return AsyncInfo.Run<ulong, ulong>((cancellationToken, progress) =>
00054             {
00055                 return Task<ulong>.Run(() =>
00056                 {
00057                     ulong length = GetLength();
00058
00059                     // Report progress.
00060                     progress.Report(length);
00061
00062                     // Just return the size in bytes.
00063                     return length;
00064                 });
00065             });
00066         }
00067
00068         public IAsyncOperationWithProgress<IBuffer, ulong> ReadAsBufferAsync()
00069         {
00070             return AsyncInfo.Run<IBuffer, ulong>((cancellationToken, progress) =>
00071             {
00072                 return Task<IBuffer>.Run(() =>
00073                 {
00074                     DataWriter writer = new DataWriter();
00075                     writer.WriteString(jsonValue.Stringify());
00076
00077                     // Make sure that the DataWriter destructor does not free the buffer.
00078                     IBuffer buffer = writer.DetachBuffer();
00079
00080                     // Report progress.
00081                     progress.Report(buffer.Length);
00082
00083                     return buffer;
00084                 });
00085             });
00086         }
00087
00088         public IAsyncOperationWithProgress<IInputStream, ulong> ReadAsInputStreamAsync()
00089         {
00090             return AsyncInfo.Run<IInputStream, ulong>(async (cancellationToken, progress) =>
00091             {
00092                 InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
00093                 DataWriter writer = new DataWriter(randomAccessStream);
00094                 writer.WriteString(jsonValue.Stringify());
00095
00096                 uint bytesStored = await writer.StoreAsync().AsTask(cancellationToken);
00097
00098                 // Make sure that the DataWriter destructor does not close the stream.
00099                 writer.DetachStream();
00100
00101                 // Report progress.
00102                 progress.Report(randomAccessStream.Size);
00103
00104                 return randomAccessStream.GetInputStreamAt(0);
00105             });
00106         }
00107
00108         public IAsyncOperationWithProgress<string, ulong> ReadAsStringAsync()
00109         {
00110             return AsyncInfo.Run<string, ulong>((cancellationToken, progress) =>
00111             {
00112                 return Task<string>.Run(() =>
00113                 {
00114                     string jsonString = jsonValue.Stringify();
00115
00116                     // Report progress (length of string).
00117                     progress.Report((ulong)jsonString.Length);
00118
00119                     return jsonString;
00120                 });
00121             });
00122         }
00123
00124         public bool TryComputeLength(out ulong length)
00125         {
00126             length = GetLength();
00127             return true;
00128         }
00129
00130         public IAsyncOperationWithProgress<ulong, ulong> WriteToStreamAsync(IOutputStream outputStream)
00131         {
00132             return AsyncInfo.Run<ulong, ulong>(async (cancellationToken, progress) =>
00133             {
00134                 DataWriter writer = new DataWriter(outputStream);
00135                 writer.WriteString(jsonValue.Stringify());
00136                 uint bytesWritten = await writer.StoreAsync().AsTask(cancellationToken);
00137
00138                 // Make sure that DataWriter destructor does not close the stream.
00139                 writer.DetachStream();
00140
00141                 // Report progress.
00142                 progress.Report(bytesWritten);
00143
00144                 return bytesWritten;
00145             });
00146         }
00147
00148         public void Dispose()
00149         {
00150         }
00151
00152         private ulong GetLength()
00153         {
00154             DataWriter writer = new DataWriter();
00155             writer.WriteString(jsonValue.Stringify());
00156
00157             IBuffer buffer = writer.DetachBuffer();
00158             return buffer.Length;
00159         }
00160     }
00161 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/PhasingTests.xaml.cs Source File

  • XamlBind
  • cs

PhasingTests.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.ObjectModel;
00004 using System.ComponentModel;
00005 using System.IO;
00006 using System.Linq;
00007 using System.Runtime.InteropServices.WindowsRuntime;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017 using System.Threading;
00018 using Windows.UI;
00019 using Windows.Storage.Pickers;
00020 using Windows.Storage;
00021
00022 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00023
00024 namespace xBindSampleCS
00025 {
00026     public sealed partial class PhasingTests : Page
00027     {
00028
00029         private xBindSampleModel.FileDataSource _dataSource;
00030         private xBindSampleModel.FileDataSource dataSource
00031         {
00032             get
00033             {
00034                 if (_dataSource == null)
00035                 {
00036                     _dataSource = new xBindSampleModel.FileDataSource();
00037                     _dataSource.CollectionChanged += DataSource_CollectionChanged;
00038                 }
00039                 return _dataSource;
00040             }
00041             set
00042             {
00043                 if (value != _dataSource)
00044                 {
00045                     _dataSource.CollectionChanged -= DataSource_CollectionChanged;
00046                     _dataSource = value;
00047                     _dataSource.CollectionChanged += DataSource_CollectionChanged;
00048                 }
00049             }
00050         }
00051
00052
00053         private bool Initialized = false;
00054
00055         public PhasingTests()
00056         {
00057             this.InitializeComponent();
00058             CreateTestData();
00059             Initialized = true;
00060         }
00061
00062         async void CreateTestData()
00063         {
00064             await dataSource.SetupDataSourceUsingPicturesFolder();
00065             LoadingPanel.Visibility = Visibility.Collapsed;
00066             myGridView.ItemsSource = dataSource;
00067         }
00068
00069         private void DataSource_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
00070         {
00071             NoItemsPanel.Visibility = (dataSource.Count == 0) ? Visibility.Visible : Visibility.Collapsed;
00072         }
00073
00074         private void Reset_Click(object sender, RoutedEventArgs e)
00075         {
00076             dataSource.ResetCollection();
00077         }
00078
00079         private async void ChangeFolderClick(object sender, RoutedEventArgs e)
00080         {
00081             Windows.Storage.Pickers.FolderPicker picker = new Windows.Storage.Pickers.FolderPicker();
00082             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
00083             picker.FileTypeFilter.Add(".jpg");
00084             picker.FileTypeFilter.Add(".png");
00085             StorageFolder f = await picker.PickSingleFolderAsync();
00086             dataSource = new xBindSampleModel.FileDataSource();
00087             myGridView.ItemsSource = dataSource;
00088             LoadingPanel.Visibility = Visibility.Visible;
00089             await dataSource.SetupDataSource(f);
00090             LoadingPanel.Visibility = Visibility.Collapsed;
00091         }
00092
00093         private void myGridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
00094         {
00095             Sleep(1);
00096             if (args.Phase < 10) args.RegisterUpdateCallback(myGridView_ContainerContentChanging);
00097         }
00098
00099         private void Sleep(int msTime)
00100         {
00101             AutoResetEvent h = new AutoResetEvent(false);
00102             h.WaitOne(msTime);
00103         }
00104
00105         private void SlowPhasing_UnChecked(object sender, RoutedEventArgs e)
00106         {
00107             SlowPhasing_Checked(sender, e);
00108         }
00109
00110         private void SlowPhasing_Checked(object sender, RoutedEventArgs e)
00111         {
00112             if (Initialized)
00113             {
00114                 if (SlowPhasing.IsChecked.Value)
00115                 {
00116                     myGridView.ContainerContentChanging += myGridView_ContainerContentChanging;
00117                 }
00118                 else
00119                 {
00120                     myGridView.ContainerContentChanging -= myGridView_ContainerContentChanging;
00121                 }
00122             }
00123         }
00124
00125
00126         private void PhasedTemplate_Checked(object sender, RoutedEventArgs e)
00127         {
00128             if (Initialized)
00129             {
00130                 if (RadioPhasedTempl.IsChecked == true)
00131                 {
00132                     myGridView.ItemTemplate = (DataTemplate)Resources["PhasedFileTemplate"];
00133                 }
00134                 else if (RadioxBindTempl.IsChecked.Value)
00135                 {
00136                     myGridView.ItemTemplate = (DataTemplate)Resources["NonPhasedFileTemplate"];
00137                 }
00138                 else if (RadioClassicTempl.IsChecked.Value)
00139                 {
00140                     myGridView.ItemTemplate = (DataTemplate)Resources["ClassicBindingFileTemplate"];
00141                 }
00142             }
00143         }
00144
00145     }
00146 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cs/OcrFileImage.xaml.cs Source File

  • OCR
  • cs

OcrFileImage.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.Foundation;
00017 using Windows.Globalization;
00018 using Windows.Graphics.Imaging;
00019 using Windows.Media.Ocr;
00020 using Windows.Storage;
00021 using Windows.Storage.Pickers;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024 using Windows.UI.Xaml.Media;
00025 using Windows.UI.Xaml.Media.Imaging;
00026 using Windows.UI.Xaml.Navigation;
00027
00028 namespace SDKTemplate
00029 {
00030     public sealed partial class OcrFileImage : Page
00031     {
00032         // A pointer back to the main page.
00033         // This is needed if you want to call methods in MainPage such as NotifyUser()
00034         private MainPage rootPage = MainPage.Current;
00035
00036         // Bitmap holder of currently loaded image.
00037         private SoftwareBitmap bitmap;
00038
00039         // Recognized words overlay boxes.
00040         private List<WordOverlay> wordBoxes = new List<WordOverlay>();
00041
00042         public OcrFileImage()
00043         {
00044             this.InitializeComponent();
00045         }
00046
00047         /// <summary>
00048         /// Invoked when this page is about to be displayed in a Frame.
00049         /// Updates OCR available languages and loads sample image.
00050         /// </summary>
00051         /// <param name="e"></param>
00052         protected override async void OnNavigatedTo(NavigationEventArgs e)
00053         {
00054             UpdateAvailableLanguages();
00055
00056             await LoadSampleImageAsync();
00057         }
00058
00059         /// <summary>
00060         /// Updates list of ocr languages available on device.
00061         /// </summary>
00062         private void UpdateAvailableLanguages()
00063         {
00064             if (!UserLanguageToggle.IsOn)
00065             {
00066                 // Check if any OCR language is available on device.
00067                 if (OcrEngine.AvailableRecognizerLanguages.Count > 0)
00068                 {
00069                     LanguageList.DisplayMemberPath = "DisplayName";
00070                     LanguageList.ItemsSource = OcrEngine.AvailableRecognizerLanguages;
00071                     LanguageList.SelectedIndex = 0;
00072                     LanguageList.IsEnabled = true;
00073                 }
00074                 else
00075                 {
00076                     // Prevent OCR if no OCR languages are available on device.
00077                     UserLanguageToggle.IsEnabled = false;
00078                     LanguageList.IsEnabled = false;
00079                     ExtractButton.IsEnabled = false;
00080
00081                     rootPage.NotifyUser("No available OCR languages.", NotifyType.ErrorMessage);
00082                 }
00083             }
00084             else
00085             {
00086                 LanguageList.ItemsSource = null;
00087                 LanguageList.IsEnabled = false;
00088
00089                 rootPage.NotifyUser(
00090                     "Run OCR in first OCR available language from UserProfile.GlobalizationPreferences.Languages list.",
00091                     NotifyType.StatusMessage);
00092             }
00093         }
00094
00095         /// <summary>
00096         /// Loads image from file to bitmap and displays it in UI.
00097         /// </summary>
00098         /// <param name="file"></param>
00099         /// <returns></returns>
00100         private async Task LoadImageAsync(StorageFile file)
00101         {
00102             using (var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
00103             {
00104                 var decoder = await BitmapDecoder.CreateAsync(stream);
00105
00106                 bitmap = await decoder.GetSoftwareBitmapAsync(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
00107
00108                 var imgSource = new WriteableBitmap(bitmap.PixelWidth, bitmap.PixelHeight);
00109                 bitmap.CopyToBuffer(imgSource.PixelBuffer);
00110                 PreviewImage.Source = imgSource;
00111             }
00112         }
00113
00114         private async Task LoadSampleImageAsync()
00115         {
00116             var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Assets\\splash-sdk.png");
00117             await LoadImageAsync(file);
00118         }
00119
00120         /// <summary>
00121         /// Clears extracted text and text overlay from previous OCR.
00122         /// </summary>
00123         private void ClearResults()
00124         {
00125             TextOverlay.RenderTransform = null;
00126             ExtractedTextBox.Text = String.Empty;
00127             TextOverlay.Children.Clear();
00128             wordBoxes.Clear();
00129         }
00130
00131         /// <summary>
00132         ///  Update word box transform to match current UI size.
00133         /// </summary>
00134         private void UpdateWordBoxTransform()
00135         {
00136             // Used for text overlay.
00137             // Prepare scale transform for words since image is not displayed in original size.
00138             ScaleTransform scaleTrasform = new ScaleTransform
00139             {
00140                 CenterX = 0,
00141                 CenterY = 0,
00142                 ScaleX = PreviewImage.ActualWidth / bitmap.PixelWidth,
00143                 ScaleY = PreviewImage.ActualHeight / bitmap.PixelHeight
00144             };
00145
00146             foreach (var item in wordBoxes)
00147             {
00148                 item.Transform(scaleTrasform);
00149             }
00150         }
00151
00152         /// <summary>
00153         /// This is event handler for 'Extract' button.
00154         /// Recognizes text from image and displays it.
00155         /// </summary>
00156         /// <param name="sender"></param>
00157         /// <param name="e"></param>
00158         private async void ExtractButton_Click(object sender, RoutedEventArgs e)
00159         {
00160             ClearResults();
00161
00162             // Check if OcrEngine supports image resolution.
00163             if (bitmap.PixelWidth > OcrEngine.MaxImageDimension || bitmap.PixelHeight > OcrEngine.MaxImageDimension)
00164             {
00165                 rootPage.NotifyUser(
00166                     String.Format("Bitmap dimensions ({0}x{1}) are too big for OCR.", bitmap.PixelWidth, bitmap.PixelHeight) +
00167                     "Max image dimension is " + OcrEngine.MaxImageDimension + ".",
00168                     NotifyType.ErrorMessage);
00169
00170                 return;
00171             }
00172
00173             OcrEngine ocrEngine = null;
00174
00175             if (UserLanguageToggle.IsOn)
00176             {
00177                 // Try to create OcrEngine for first supported language from UserProfile.GlobalizationPreferences.Languages list.
00178                 // If none of the languages are available on device, method returns null.
00179                 ocrEngine = OcrEngine.TryCreateFromUserProfileLanguages();
00180             }
00181             else
00182             {
00183                 // Try to create OcrEngine for specified language.
00184                 // If language is not supported on device, method returns null.
00185                 ocrEngine = OcrEngine.TryCreateFromLanguage(LanguageList.SelectedValue as Language);
00186             }
00187
00188             if (ocrEngine != null)
00189             {
00190                 // Recognize text from image.
00191                 var ocrResult = await ocrEngine.RecognizeAsync(bitmap);
00192
00193                 // Display recognized text.
00194                 ExtractedTextBox.Text = ocrResult.Text;
00195
00196                 if (ocrResult.TextAngle != null)
00197                 {
00198                     // If text is detected under some angle in this sample scenario we want to
00199                     // overlay word boxes over original image, so we rotate overlay boxes.
00200                     TextOverlay.RenderTransform = new RotateTransform
00201                     {
00202                         Angle = (double)ocrResult.TextAngle,
00203                         CenterX = PreviewImage.ActualWidth / 2,
00204                         CenterY = PreviewImage.ActualHeight / 2
00205                     };
00206                 }
00207
00208                 // Create overlay boxes over recognized words.
00209                 foreach (var line in ocrResult.Lines)
00210                 {
00211                     // Determine if line is horizontal or vertical.
00212                     // Vertical lines are supported only in Chinese Traditional and Japanese languages.
00213                     Rect lineRect = Rect.Empty;
00214                     foreach (var word in line.Words)
00215                     {
00216                         lineRect.Union(word.BoundingRect);
00217                     }
00218                     bool isVerticalLine = lineRect.Height > lineRect.Width;
00219                     var style = isVerticalLine ? HighlightedWordBoxVerticalLineStyle : HighlightedWordBoxHorizontalLineStyle;
00220
00221                     foreach (var word in line.Words)
00222                     {
00223                         WordOverlay wordBoxOverlay = new WordOverlay(word);
00224
00225                         // Keep references to word boxes.
00226                         wordBoxes.Add(wordBoxOverlay);
00227
00228                         // Create a box to highlight the word.
00229                         TextOverlay.Children.Add(wordBoxOverlay.CreateBorder(style));
00230                     }
00231                 }
00232
00233                 // Rescale word boxes to match current UI size.
00234                 UpdateWordBoxTransform();
00235
00236                 rootPage.NotifyUser(
00237                     "Image is OCRed for " + ocrEngine.RecognizerLanguage.DisplayName + " language.",
00238                     NotifyType.StatusMessage);
00239             }
00240             else
00241             {
00242                 rootPage.NotifyUser("Selected language is not available.", NotifyType.ErrorMessage);
00243             }
00244         }
00245
00246         /// <summary>
00247         /// Occurs when user language toggle state is changed.
00248         /// </summary>
00249         /// <param name="sender"></param>
00250         /// <param name="e"></param>
00251         private void UserLanguageToggle_Toggled(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00252         {
00253             UpdateAvailableLanguages();
00254         }
00255
00256         /// <summary>
00257         /// This is event handler for 'Sample' button.
00258         /// It loads sample image and displays it in UI.
00259         /// </summary>
00260         /// <param name="sender"></param>
00261         /// <param name="e"></param>
00262         private async void SampleButton_Click(object sender, RoutedEventArgs e)
00263         {
00264             ClearResults();
00265
00266             await LoadSampleImageAsync();
00267
00268             rootPage.NotifyUser("Loaded sample image.", NotifyType.StatusMessage);
00269         }
00270
00271         /// <summary>
00272         /// This is event handler for 'Load' button.
00273         /// It opens file picked and load selected image in UI..
00274         /// </summary>
00275         /// <param name="sender"></param>
00276         /// <param name="e"></param>
00277         private async void LoadButton_Click(object sender, RoutedEventArgs e)
00278         {
00279             var picker = new FileOpenPicker()
00280             {
00281                 SuggestedStartLocation = PickerLocationId.PicturesLibrary,
00282                 FileTypeFilter = { ".jpg", ".jpeg", ".png" },
00283             };
00284
00285             var file = await picker.PickSingleFileAsync();
00286             if (file != null)
00287             {
00288                 ClearResults();
00289
00290                 await LoadImageAsync(file);
00291
00292                 rootPage.NotifyUser(
00293                     String.Format("Loaded image from file: {0} ({1}x{2}).", file.Name, bitmap.PixelWidth, bitmap.PixelHeight),
00294                     NotifyType.StatusMessage);
00295             }
00296         }
00297
00298         /// <summary>
00299         /// Occurs when selected language is changed in available languages combo box.
00300         /// </summary>
00301         /// <param name="sender"></param>
00302         /// <param name="e"></param>
00303         private void LanguageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00304         {
00305             ClearResults();
00306         }
00307
00308         /// <summary>
00309         /// Occurs when displayed image size changes.
00310         /// </summary>
00311         /// <param name="sender"></param>
00312         /// <param name="e"></param>
00313         private void PreviewImage_SizeChanged(object sender, SizeChangedEventArgs e)
00314         {
00315             // Update word overlay boxes.
00316             UpdateWordBoxTransform();
00317
00318             // Update image rotation center.
00319             var rotate = TextOverlay.RenderTransform as RotateTransform;
00320             if (rotate != null)
00321             {
00322                 rotate.CenterX = PreviewImage.ActualWidth / 2;
00323                 rotate.CenterY = PreviewImage.ActualHeight / 2;
00324             }
00325         }
00326     }
00327 }
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HolographicTagAlongSampleMain Member List

This is the complete list of members for HolographicTagAlongSampleMain, including all inherited members.
HolographicTagAlongSampleMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | HolographicTagAlongSampleMain |
LoadAppState() | HolographicTagAlongSampleMain |
m_attachedReferenceFrame | HolographicTagAlongSampleMain | [private]
m_cameraAddedToken | HolographicTagAlongSampleMain | [private]
m_cameraRemovedToken | HolographicTagAlongSampleMain | [private]
m_deviceResources | HolographicTagAlongSampleMain | [private]
m_dropHologram | HolographicTagAlongSampleMain | [private]
m_holographicSpace | HolographicTagAlongSampleMain | [private]
m_locatabilityChangedToken | HolographicTagAlongSampleMain | [private]
m_locator | HolographicTagAlongSampleMain | [private]
m_stationaryReferenceFrame | HolographicTagAlongSampleMain | [private]
m_timer | HolographicTagAlongSampleMain | [private]
OnCameraAdded(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args) | HolographicTagAlongSampleMain | [private]
OnCameraRemoved(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args) | HolographicTagAlongSampleMain | [private]
OnDeviceLost() | HolographicTagAlongSampleMain | [virtual]
OnDeviceRestored() | HolographicTagAlongSampleMain | [virtual]
OnLocatabilityChanged(Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args) | HolographicTagAlongSampleMain | [private]
Render(Windows::Graphics::Holographic::HolographicFrame^holographicFrame) | HolographicTagAlongSampleMain |
RenderOffscreenTexture() | HolographicTagAlongSampleMain | [private]
SaveAppState() | HolographicTagAlongSampleMain |
SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^holographicSpace) | HolographicTagAlongSampleMain |
UnregisterHolographicEventHandlers() | HolographicTagAlongSampleMain | [private]
Update() | HolographicTagAlongSampleMain |
~HolographicTagAlongSampleMain() | HolographicTagAlongSampleMain |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/SpatialInputHandler.h Source File

  • 360VideoPlayback
  • cpp
  • Content

SpatialInputHandler.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace _360VideoPlayback
00004 {
00005     // Sample gesture handler.
00006     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00007     class SpatialInputHandler
00008     {
00009     public:
00010         SpatialInputHandler();
00011         ~SpatialInputHandler();
00012
00013         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ CheckForInput();
00014
00015     private:
00016         // Interaction event handler.
00017         void OnSourcePressed(
00018             Windows::UI::Input::Spatial::SpatialInteractionManager^ sender,
00019             Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args);
00020
00021         // API objects used to process gesture input, and generate gesture events.
00022         Windows::UI::Input::Spatial::SpatialInteractionManager^     m_interactionManager;
00023
00024         // Event registration token.
00025         Windows::Foundation::EventRegistrationToken                 m_sourcePressedEventToken;
00026
00027         // Used to indicate that a Pressed input event was received this frame.
00028         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ m_sourceState = nullptr;
00029     };
00030 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/pch.cpp Source File

  • ProximitySensor
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario1_PercentPermilleFormatting.xaml.h Source File

  • NumberFormatting
  • cpp

Scenario1_PercentPermilleFormatting.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "pch.h"
00006 #include "Scenario1_PercentPermilleFormatting.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario1_PercentPermilleFormatting sealed
00012     {
00013     public:
00014         Scenario1_PercentPermilleFormatting();
00015
00016     private:
00017         void Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00018     };
00019 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameHud.cpp Source File

  • Simple3DGameDX
  • cppwinrt

GameHud.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameHud.h"
00014 #include "GameConstants.h"
00015 #include "GameUIConstants.h"
00016
00017 using namespace D2D1;
00018 using namespace winrt::Windows::ApplicationModel;
00019
00020 GameHud::GameHud(
00021     _In_ std::shared_ptr<DX::DeviceResources> const& deviceResources,
00022     _In_ winrt::hstring const& titleHeader,
00023     _In_ winrt::hstring const& titleBody
00024     ) :
00025     m_deviceResources(deviceResources),
00026     m_titleHeader(titleHeader),
00027     m_titleBody(titleBody)
00028 {
00029     m_showTitle = true;
00030     m_titleBodyVerticalOffset = GameUIConstants::Margin;
00031     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00032
00033     auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00034
00035     winrt::check_hresult(
00036         dwriteFactory->CreateTextFormat(
00037             L"Segoe UI",
00038             nullptr,
00039             DWRITE_FONT_WEIGHT_LIGHT,
00040             DWRITE_FONT_STYLE_NORMAL,
00041             DWRITE_FONT_STRETCH_NORMAL,
00042             GameUIConstants::HudBodyPointSize,
00043             L"en-us",
00044             m_textFormatBody.put()
00045             )
00046         );
00047     winrt::check_hresult(
00048         dwriteFactory->CreateTextFormat(
00049             L"Segoe UI Symbol",
00050             nullptr,
00051             DWRITE_FONT_WEIGHT_LIGHT,
00052             DWRITE_FONT_STYLE_NORMAL,
00053             DWRITE_FONT_STRETCH_NORMAL,
00054             GameUIConstants::HudBodyPointSize,
00055             L"en-us",
00056             m_textFormatBodySymbol.put()
00057             )
00058         );
00059     winrt::check_hresult(
00060         dwriteFactory->CreateTextFormat(
00061             L"Segoe UI Light",
00062             nullptr,
00063             DWRITE_FONT_WEIGHT_LIGHT,
00064             DWRITE_FONT_STYLE_NORMAL,
00065             DWRITE_FONT_STRETCH_NORMAL,
00066             GameUIConstants::HudTitleHeaderPointSize,
00067             L"en-us",
00068             m_textFormatTitleHeader.put()
00069             )
00070         );
00071     winrt::check_hresult(
00072         dwriteFactory->CreateTextFormat(
00073             L"Segoe UI Light",
00074             nullptr,
00075             DWRITE_FONT_WEIGHT_LIGHT,
00076             DWRITE_FONT_STYLE_NORMAL,
00077             DWRITE_FONT_STRETCH_NORMAL,
00078             GameUIConstants::HudTitleBodyPointSize,
00079             L"en-us",
00080             m_textFormatTitleBody.put()
00081             )
00082         );
00083
00084     winrt::check_hresult(m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00085     winrt::check_hresult(m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00086     winrt::check_hresult(m_textFormatBodySymbol->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00087     winrt::check_hresult(m_textFormatBodySymbol->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00088     winrt::check_hresult(m_textFormatTitleHeader->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00089     winrt::check_hresult(m_textFormatTitleHeader->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00090     winrt::check_hresult(m_textFormatTitleBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00091     winrt::check_hresult(m_textFormatTitleBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00092 }
00093
00094 void GameHud::CreateDeviceDependentResources()
00095 {
00096     auto location = Package::Current().InstalledLocation();
00097     winrt::hstring path{ location.Path() + L"\\Assets\\windows-sdk.png" };
00098
00099     auto wicFactory = m_deviceResources->GetWicImagingFactory();
00100
00101     winrt::com_ptr<IWICBitmapDecoder> wicBitmapDecoder;
00102     winrt::check_hresult(
00103         wicFactory->CreateDecoderFromFilename(
00104             path.c_str(),
00105             nullptr,
00106             GENERIC_READ,
00107             WICDecodeMetadataCacheOnDemand,
00108             wicBitmapDecoder.put()
00109             )
00110         );
00111
00112     winrt::com_ptr<IWICBitmapFrameDecode> wicBitmapFrame;
00113     winrt::check_hresult(
00114         wicBitmapDecoder->GetFrame(0, wicBitmapFrame.put())
00115         );
00116
00117     winrt::com_ptr<IWICFormatConverter> wicFormatConverter;
00118     winrt::check_hresult(
00119         wicFactory->CreateFormatConverter(wicFormatConverter.put())
00120         );
00121
00122     winrt::check_hresult(
00123         wicFormatConverter->Initialize(
00124             wicBitmapFrame.get(),
00125             GUID_WICPixelFormat32bppPBGRA,
00126             WICBitmapDitherTypeNone,
00127             nullptr,
00128             0.0,
00129             WICBitmapPaletteTypeCustom  // The BGRA format has no palette so this value is ignored.
00130             )
00131         );
00132
00133     double dpiX = 96.0f;
00134     double dpiY = 96.0f;
00135     winrt::check_hresult(
00136         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00137         );
00138
00139     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00140
00141     // Create D2D Resources
00142     winrt::check_hresult(
00143         d2dContext->CreateBitmapFromWicBitmap(
00144             wicFormatConverter.get(),
00145             BitmapProperties(
00146                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00147                 static_cast<float>(dpiX),
00148                 static_cast<float>(dpiY)
00149                 ),
00150             m_logoBitmap.put()
00151             )
00152         );
00153
00154     m_logoSize = m_logoBitmap->GetSize();
00155
00156     winrt::check_hresult(
00157         d2dContext->CreateSolidColorBrush(
00158             D2D1::ColorF(D2D1::ColorF::White),
00159             m_textBrush.put()
00160             )
00161         );
00162 }
00163
00164 void GameHud::CreateWindowSizeDependentResources()
00165 {
00166     auto windowBounds = m_deviceResources->GetLogicalSize();
00167
00168     m_maxTitleSize.width = windowBounds.Width - GameUIConstants::HudSafeWidth;
00169     m_maxTitleSize.height = windowBounds.Height;
00170
00171     float headerWidth = m_maxTitleSize.width - (m_logoSize.width + 2 * GameUIConstants::Margin);
00172
00173     if (headerWidth > 0)
00174     {
00175         auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00176
00177         // Only resize the text layout for the Title area when there is enough space.
00178         m_showTitle = true;
00179
00180         m_titleHeaderLayout = nullptr;
00181         winrt::check_hresult(
00182             dwriteFactory->CreateTextLayout(
00183                 m_titleHeader.c_str(),
00184                 m_titleHeader.size(),
00185                 m_textFormatTitleHeader.get(),
00186                 headerWidth,
00187                 m_maxTitleSize.height,
00188                 m_titleHeaderLayout.put()
00189                 )
00190             );
00191
00192         DWRITE_TEXT_METRICS metrics = { 0 };
00193         winrt::check_hresult(
00194             m_titleHeaderLayout->GetMetrics(&metrics)
00195             );
00196
00197         // Compute the vertical size of the laid out Header and logo. This could change
00198         // based on the window size and the layout of the text. In some cases the text
00199         // may wrap.
00200         m_titleBodyVerticalOffset = max(m_logoSize.height + GameUIConstants::Margin * 2, metrics.height + 2 * GameUIConstants::Margin);
00201
00202         m_titleBodyLayout = nullptr;
00203         winrt::check_hresult(
00204             dwriteFactory->CreateTextLayout(
00205                 m_titleBody.c_str(),
00206                 m_titleBody.size(),
00207                 m_textFormatTitleBody.get(),
00208                 m_maxTitleSize.width,
00209                 m_maxTitleSize.height - m_titleBodyVerticalOffset,
00210                 m_titleBodyLayout.put()
00211                 )
00212             );
00213     }
00214     else
00215     {
00216         // Not enough horizontal space for the titles so just turn it off.
00217         m_showTitle = false;
00218     }
00219 }
00220
00221 void GameHud::Render(_In_ std::shared_ptr<Simple3DGame> const& game)
00222 {
00223     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00224     auto windowBounds = m_deviceResources->GetLogicalSize();
00225
00226     if (m_showTitle)
00227     {
00228         d2dContext->DrawBitmap(
00229             m_logoBitmap.get(),
00230             D2D1::RectF(
00231                 GameUIConstants::Margin,
00232                 GameUIConstants::Margin,
00233                 m_logoSize.width + GameUIConstants::Margin,
00234                 m_logoSize.height + GameUIConstants::Margin
00235                 )
00236             );
00237         d2dContext->DrawTextLayout(
00238             Point2F(m_logoSize.width + 2.0f * GameUIConstants::Margin, GameUIConstants::Margin),
00239             m_titleHeaderLayout.get(),
00240             m_textBrush.get()
00241             );
00242         d2dContext->DrawTextLayout(
00243             Point2F(GameUIConstants::Margin, m_titleBodyVerticalOffset),
00244             m_titleBodyLayout.get(),
00245             m_textBrush.get()
00246             );
00247     }
00248
00249     if (game != nullptr)
00250     {
00251         // This section is only used after the game state has been initialized.
00252         static const int bufferLength = 256;
00253         static wchar_t wsbuffer[bufferLength];
00254         int length = swprintf_s(
00255             wsbuffer,
00256             bufferLength,
00257             L"Hits:\t%10d\nShots:\t%10d\nTime:\t%8.1f",
00258             game->TotalHits(),
00259             game->TotalShots(),
00260             game->TimeRemaining()
00261             );
00262
00263         d2dContext->DrawText(
00264             wsbuffer,
00265             length,
00266             m_textFormatBody.get(),
00267             D2D1::RectF(
00268                 windowBounds.Width - GameUIConstants::HudRightOffset,
00269                 GameUIConstants::HudTopOffset,
00270                 windowBounds.Width,
00271                 GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 3
00272                 ),
00273             m_textBrush.get()
00274             );
00275
00276         // Using the unicode characters starting at 0x2780 ( ➀ ) for the consecutive levels of the game.
00277         // For completed levels start with 0x278A ( ➊ ) (This is 0x2780 + 10).
00278         uint32_t levelCharacter[6];
00279         for (uint32_t i = 0; i < 6; i++)
00280         {
00281             levelCharacter[i] = 0x2780 + i + ((static_cast<uint32_t>(game->LevelCompleted()) == i) ? 10 : 0);
00282         }
00283         length = swprintf_s(
00284             wsbuffer,
00285             bufferLength,
00286             L"%lc %lc %lc %lc %lc %lc",
00287             levelCharacter[0],
00288             levelCharacter[1],
00289             levelCharacter[2],
00290             levelCharacter[3],
00291             levelCharacter[4],
00292             levelCharacter[5]
00293             );
00294         d2dContext->DrawText(
00295             wsbuffer,
00296             length,
00297             m_textFormatBodySymbol.get(),
00298             D2D1::RectF(
00299                 windowBounds.Width - GameUIConstants::HudRightOffset,
00300                 GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 3 + GameUIConstants::Margin,
00301                 windowBounds.Width,
00302                 GameUIConstants::HudTopOffset + (GameUIConstants::HudBodyPointSize + GameUIConstants::Margin) * 4
00303                 ),
00304             m_textBrush.get()
00305             );
00306
00307         if (game->IsActivePlay())
00308         {
00309             // Draw a rectangle for the touch input for the move control.
00310             d2dContext->DrawRectangle(
00311                 D2D1::RectF(
00312                     0.0f,
00313                     windowBounds.Height - GameUIConstants::TouchRectangleSize,
00314                     GameUIConstants::TouchRectangleSize,
00315                     windowBounds.Height
00316                     ),
00317                 m_textBrush.get()
00318                 );
00319             // Draw a rectangle for the touch input for the fire control.
00320             d2dContext->DrawRectangle(
00321                 D2D1::RectF(
00322                     windowBounds.Width - GameUIConstants::TouchRectangleSize,
00323                     windowBounds.Height - GameUIConstants::TouchRectangleSize,
00324                     windowBounds.Width,
00325                     windowBounds.Height
00326                     ),
00327                 m_textBrush.get()
00328                 );
00329
00330             // Draw the cross hairs
00331             d2dContext->DrawLine(
00332                 D2D1::Point2F(windowBounds.Width / 2.0f - GameUIConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00333                 D2D1::Point2F(windowBounds.Width / 2.0f + GameUIConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00334                 m_textBrush.get(),
00335                 3.0f
00336                 );
00337             d2dContext->DrawLine(
00338                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f - GameUIConstants::CrossHairHalfSize),
00339                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f + GameUIConstants::CrossHairHalfSize),
00340                 m_textBrush.get(),
00341                 3.0f
00342                 );
00343         }
00344     }
00345 }
00346
00347 void GameHud::ReleaseDeviceDependentResources()
00348 {
00349     m_textBrush = nullptr;
00350     m_logoBitmap = nullptr;
00351 }
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario2_Launch.cpp Source File

  • 3DPrinting
  • cppwinrt

Scenario2_Launch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Launch.h"
00014 #include "Scenario2_Launch.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::ApplicationModel;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Storage;
00021 using namespace winrt::Windows::Storage::Pickers;
00022 using namespace winrt::Windows::System;
00023 using namespace winrt::Windows::UI::Xaml;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario2_Launch::Scenario2_Launch()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     fire_and_forget Scenario2_Launch::CheckIf3DBuilderIsInstalled_Click(IInspectable const&, RoutedEventArgs const&)
00033     {
00034         auto lifetime = get_strong();
00035
00036         IVectorView<AppInfo> handlers = co_await Launcher::FindFileHandlersAsync(L".3mf");
00037         auto found = std::find_if(begin(handlers), end(handlers),
00038             [](auto&& info) { return info.PackageFamilyName() == PackageFamilyName3DBuilder; });
00039         if (found != end(handlers))
00040         {
00041             rootPage.NotifyUser(L"3D Builder is installed", NotifyType::StatusMessage);
00042         }
00043         else
00044         {
00045             rootPage.NotifyUser(L"3D Builder is not installed", NotifyType::ErrorMessage);
00046         }
00047     }
00048
00049     fire_and_forget Scenario2_Launch::LaunchFileIn3DBuilder_Click(IInspectable const&, RoutedEventArgs const&)
00050     {
00051         auto lifetime = get_strong();
00052
00053         FileOpenPicker openPicker;
00054         openPicker.ViewMode (PickerViewMode::Thumbnail);
00055         openPicker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
00056         openPicker.FileTypeFilter().ReplaceAll({ L".3mf", L".stl" });
00057
00058         StorageFile file = co_await openPicker.PickSingleFileAsync();
00059         if (file == nullptr)
00060         {
00061             co_return;
00062         }
00063
00064         LauncherOptions options;
00065
00066         // The target application is 3D Builder.
00067         options.TargetApplicationPackageFamilyName(PackageFamilyName3DBuilder);
00068
00069         // If 3D Builder is not installed, redirect the user to the Store to install it.
00070         options.FallbackUri(Uri(hstring(L"ms-windows-store:PDP?PFN=") + PackageFamilyName3DBuilder));
00071
00072         co_await Launcher::LaunchFileAsync(file, options);
00073     }
00074 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/Models/Messages.cs Source File

  • MicrosoftPassport
  • Server
  • Models

Messages.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 // Please refer to the Microsoft Passport and Windows Hello
00012 // whitepaper on the Windows Dev Center for a complete
00013 // explanation of Microsoft Passport and Windows Hello
00014 // implementation:
00015 // http://go.microsoft.com/fwlink/p/?LinkId=522066
00016 //*********************************************************
00017 namespace MicrosoftPassport.Models
00018 {
00019     public class RegisterMessage
00020     {
00021         public string UserId;
00022         public string PublicKey;
00023         public string DeviceName;
00024     }
00025
00026     public class UserAndKeyHintMessage
00027     {
00028         public string UserId;
00029         public string PublicKeyHint;
00030     }
00031
00032     public class SignatureMessage
00033     {
00034         public string UserId;
00035         public string Signature;
00036         public string PublicKeyHint;
00037     }
00038 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeDecoder/BarcodeDecoder.h Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeDecoder

BarcodeDecoder.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace BarcodeDecoder
00014 {
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class BarcodeDecodeTask sealed : Windows::ApplicationModel::Background::IBackgroundTask
00017     {
00018     public:
00019         virtual void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
00020     };
00021 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario2_Connector.cpp Source File

  • WiFiDirect
  • cppwinrt

Scenario2_Connector.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Connector.h"
00014 #include "SampleConfiguration.h"
00015 #include "SocketReaderWriter.h"
00016 #include "Scenario2_Connector.g.cpp"
00017 #include <chrono>
00018 #include <sstream>
00019
00020 using namespace std::chrono_literals;
00021 using namespace winrt;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Devices::WiFiDirect;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::Networking;
00027 using namespace Windows::Networking::Sockets;
00028 using namespace Windows::Security::Cryptography;
00029 using namespace Windows::Storage::Streams;
00030 using namespace Windows::UI::Xaml;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 namespace winrt::SDKTemplate::implementation
00034 {
00035     Scenario2_Connector::Scenario2_Connector()
00036     {
00037         InitializeComponent();
00038     }
00039
00040     void Scenario2_Connector::OnNavigatedFrom(NavigationEventArgs const&)
00041     {
00042         if (deviceWatcher)
00043         {
00044             StopWatcher();
00045         }
00046     }
00047
00048     void Scenario2_Connector::StopWatcher()
00049     {
00050         deviceWatcher.Added(watcherAddedToken);
00051         deviceWatcher.Removed(watcherRemovedToken);
00052         deviceWatcher.Updated(watcherUpdatedToken);
00053         deviceWatcher.EnumerationCompleted(watcherEnumerationCompletedToken);
00054         deviceWatcher.Stopped(watcherStoppedToken);
00055
00056         deviceWatcher.Stop();
00057         deviceWatcher = nullptr;
00058     }
00059
00060     void Scenario2_Connector::btnWatcher_Click(IInspectable const&, RoutedEventArgs const&)
00061     {
00062         if (!deviceWatcher)
00063         {
00064             publisher.Start();
00065
00066             if (publisher.Status() != WiFiDirectAdvertisementPublisherStatus::Started)
00067             {
00068                 rootPage.NotifyUser(L"Failed to start advertisement.", NotifyType::ErrorMessage);
00069                 return;
00070             }
00071
00072             discoveredDevices.Clear();
00073             rootPage.NotifyUser(L"Finding Devices...", NotifyType::StatusMessage);
00074
00075             hstring deviceSelector = WiFiDirectDevice::GetDeviceSelector(
00076                 GetSelectedItemTag<WiFiDirectDeviceSelectorType>(cmbDeviceSelector()));
00077
00078             deviceWatcher = DeviceInformation::CreateWatcher(deviceSelector, { L"System.Devices.WiFiDirect.InformationElements" });
00079
00080             watcherAddedToken = deviceWatcher.Added({ get_weak(), &Scenario2_Connector::OnDeviceAdded });
00081             watcherRemovedToken = deviceWatcher.Removed({ get_weak(), &Scenario2_Connector::OnDeviceRemoved });
00082             watcherUpdatedToken = deviceWatcher.Updated({ get_weak(), &Scenario2_Connector::OnDeviceUpdated });
00083             watcherEnumerationCompletedToken = deviceWatcher.EnumerationCompleted({ get_weak(), &Scenario2_Connector::OnEnumerationCompleted });
00084             watcherStoppedToken = deviceWatcher.Stopped({ get_weak(), &Scenario2_Connector::OnStopped });
00085
00086             deviceWatcher.Start();
00087
00088             btnWatcher().Content(box_value(L"Stop Watcher"));
00089         }
00090         else
00091         {
00092             publisher.Stop();
00093
00094             btnWatcher().Content(box_value(L"Start Watcher"));
00095
00096             StopWatcher();
00097
00098             rootPage.NotifyUser(L"Device watcher stopped.", NotifyType::StatusMessage);
00099         }
00100     }
00101
00102     #pragma region DeviceWatcherEvents
00103     fire_and_forget Scenario2_Connector::OnDeviceAdded(DeviceWatcher const&, DeviceInformation deviceInfo)
00104     {
00105         auto lifetime = get_strong();
00106         co_await resume_foreground(Dispatcher());
00107         discoveredDevices.Append(make<DiscoveredDevice>(deviceInfo));
00108     }
00109
00110     fire_and_forget Scenario2_Connector::OnDeviceRemoved(DeviceWatcher const&, DeviceInformationUpdate deviceInfoUpdate)
00111     {
00112         auto lifetime = get_strong();
00113         co_await resume_foreground(Dispatcher());
00114         unsigned int size = discoveredDevices.Size();
00115         for (unsigned int index = 0; index < size; index++)
00116         {
00117             SDKTemplate::DiscoveredDevice discoveredDevice = discoveredDevices.GetAt(index);
00118             DiscoveredDevice* discoveredDeviceImpl = get_self<DiscoveredDevice>(discoveredDevice);
00119             if (discoveredDeviceImpl->DeviceInfo().Id() == deviceInfoUpdate.Id())
00120             {
00121                 discoveredDevices.RemoveAt(index);
00122                 break;
00123             }
00124         }
00125     }
00126
00127     fire_and_forget Scenario2_Connector::OnDeviceUpdated(DeviceWatcher const&, DeviceInformationUpdate deviceInfoUpdate)
00128     {
00129         auto lifetime = get_strong();
00130         co_await resume_foreground(Dispatcher());
00131         for (SDKTemplate::DiscoveredDevice const& discoveredDevice : discoveredDevices)
00132         {
00133             DiscoveredDevice* discoveredDeviceImpl = get_self<DiscoveredDevice>(discoveredDevice);
00134             if (discoveredDeviceImpl->DeviceInfo().Id() == deviceInfoUpdate.Id())
00135             {
00136                 discoveredDeviceImpl->UpdateDeviceInfo(deviceInfoUpdate);
00137                 break;
00138             }
00139         }
00140     }
00141
00142     void Scenario2_Connector::OnEnumerationCompleted(DeviceWatcher const&, IInspectable const&)
00143     {
00144         rootPage.NotifyUser(L"DeviceWatcher enumeration completed", NotifyType::StatusMessage);
00145     }
00146
00147     void Scenario2_Connector::OnStopped(DeviceWatcher const&, IInspectable const&)
00148     {
00149         rootPage.NotifyUser(L"DeviceWatcher stopped", NotifyType::StatusMessage);
00150     }
00151     #pragma endregion
00152
00153     void Scenario2_Connector::btnIe_Click(IInspectable const&, RoutedEventArgs const&)
00154     {
00155         auto discoveredDevice = lvDiscoveredDevices().SelectedItem().as<SDKTemplate::DiscoveredDevice>();
00156
00157         IVector<WiFiDirectInformationElement> informationElements = nullptr;
00158         try
00159         {
00160             DiscoveredDevice* discoveredDeviceImpl = get_self<DiscoveredDevice>(discoveredDevice);
00161             informationElements = WiFiDirectInformationElement::CreateFromDeviceInformation(discoveredDeviceImpl->DeviceInfo());
00162         }
00163         catch (hresult_error const& ex)
00164         {
00165             rootPage.NotifyUser(L"No Information element found: " + ex.message(), NotifyType::ErrorMessage);
00166             return;
00167         }
00168
00169         std::wostringstream message;
00170
00171         for (WiFiDirectInformationElement const& informationElement : informationElements)
00172         {
00173             hstring ouiName = CryptographicBuffer::EncodeToHexString(informationElement.Oui());
00174             hstring value;
00175
00176             com_array<uint8_t> ouiArray;
00177             CryptographicBuffer::CopyToByteArray(informationElement.Oui(), ouiArray);
00178             array_view<uint8_t const> ouiConstArray{ ouiArray.begin(), ouiArray.end() };
00179
00180             if (ouiConstArray == array_view<uint8_t const>(MsftOui))
00181             {
00182                 // The format of Microsoft information elements is documented here:
00183                 // https://msdn.microsoft.com/en-us/library/dn392651.aspx
00184                 // with errata here:
00185                 // https://msdn.microsoft.com/en-us/library/mt242386.aspx
00186                 ouiName = ouiName + L" (Microsoft)";
00187             }
00188             else if (ouiConstArray == array_view<uint8_t const>(WfaOui))
00189             {
00190                 ouiName = ouiName + L" (WFA)";
00191             }
00192             else if (ouiConstArray == array_view<uint8_t const>(CustomOui))
00193             {
00194                 ouiName = ouiName + L" (Custom)";
00195
00196                 if (informationElement.OuiType() == CustomOuiType)
00197                 {
00198                     DataReader dataReader = DataReader::FromBuffer(informationElement.Value());
00199                     dataReader.UnicodeEncoding(UnicodeEncoding::Utf8);
00200                     dataReader.ByteOrder(ByteOrder::LittleEndian);
00201
00202                     // Read the string.
00203                     try
00204                     {
00205                         hstring data = dataReader.ReadString(dataReader.ReadUInt32());
00206                         value = L"Data: " + data;
00207                     }
00208                     catch (hresult_error const&)
00209                     {
00210                         value = L"(Unable to parse)";
00211                     }
00212                 }
00213             }
00214
00215             message << L"OUI " << std::wstring_view(ouiName)
00216                 << L", Type " << static_cast<uint32_t>(informationElement.OuiType())
00217                 << L" " << std::wstring_view(value) << std::endl;
00218         }
00219
00220         message << L"Information elements found: " << informationElements.Size();
00221
00222         rootPage.NotifyUser(message.str(), NotifyType::StatusMessage);
00223     }
00224
00225     fire_and_forget Scenario2_Connector::btnFromId_Click(IInspectable const&, RoutedEventArgs const&)
00226     {
00227         auto lifetime = get_strong();
00228
00229         auto discoveredDevice = lvDiscoveredDevices().SelectedItem().as<SDKTemplate::DiscoveredDevice>();
00230         DeviceInformation deviceInfo = get_self<DiscoveredDevice>(discoveredDevice)->DeviceInfo();
00231         rootPage.NotifyUser(L"Connecting to " + deviceInfo.Name() + L"...", NotifyType::StatusMessage);
00232
00233         if (!deviceInfo.Pairing().IsPaired())
00234         {
00235             if (!co_await connectionSettingsPanel().RequestPairDeviceAsync(deviceInfo.Pairing()))
00236             {
00237                 co_return;
00238             }
00239         }
00240
00241         WiFiDirectDevice wfdDevice = nullptr;
00242         try
00243         {
00244             // IMPORTANT: FromIdAsync needs to be called from the UI thread
00245             wfdDevice = co_await WiFiDirectDevice::FromIdAsync(deviceInfo.Id());
00246         }
00247         catch (hresult_canceled const&)
00248         {
00249             rootPage.NotifyUser(L"FromIdAsync was canceled by user", NotifyType::ErrorMessage);
00250             co_return;
00251         }
00252
00253         // Register for the ConnectionStatusChanged event handler
00254         wfdDevice.ConnectionStatusChanged({ get_weak(), &Scenario2_Connector::OnConnectionStatusChanged });
00255
00256         IVectorView<EndpointPair> endpointPairs = wfdDevice.GetConnectionEndpointPairs();
00257         HostName remoteHostName = endpointPairs.GetAt(0).RemoteHostName();
00258
00259         rootPage.NotifyUser(L"Devices connected on L2 layer, connecting to IP Address: " + remoteHostName.DisplayName() +
00260             L" Port: " + ServerPortString, NotifyType::StatusMessage);
00261
00262         // Wait for server to start listening on a socket
00263         co_await resume_after(2s);
00264
00265         // resume_after does not preserve thread context. Get back to the UI thread.
00266         co_await resume_foreground(Dispatcher());
00267
00268         // Connect to Advertiser on L4 layer
00269         StreamSocket clientSocket;
00270         try
00271         {
00272             co_await clientSocket.ConnectAsync(remoteHostName, ServerPortString);
00273             rootPage.NotifyUser(L"Connected with remote side on L4 layer", NotifyType::StatusMessage);
00274         }
00275         catch (hresult_error const& ex)
00276         {
00277             rootPage.NotifyUser(L"Connect operation threw an exception: " + ex.message(), NotifyType::ErrorMessage);
00278             co_return;
00279         }
00280
00281         auto socketRW = make_self<SocketReaderWriter>(clientSocket, rootPage);
00282
00283         hstring sessionId = to_hstring(CryptographicBuffer::GenerateRandomNumber());
00284         connectedDevices.Append(make<ConnectedDevice>(sessionId, wfdDevice, socketRW));
00285
00286         // The first message sent over the socket is the name of the connection.
00287         co_await socketRW->WriteMessageAsync(sessionId);
00288
00289         while (co_await socketRW->ReadMessageAsync() != nullptr)
00290         {
00291             // Keep reading messages
00292         }
00293     }
00294
00295     void Scenario2_Connector::OnConnectionStatusChanged(WiFiDirectDevice const& sender, IInspectable const&)
00296     {
00297         rootPage.NotifyUser(L"Connection status changed: " + to_hstring(sender.ConnectionStatus()), NotifyType::StatusMessage);
00298     }
00299
00300     fire_and_forget Scenario2_Connector::btnSendMessage_Click(IInspectable const&, RoutedEventArgs const&)
00301     {
00302         auto lifetime = get_strong();
00303         auto connectedDevice = lvConnectedDevices().SelectedItem().as<SDKTemplate::ConnectedDevice>();
00304         co_await get_self<ConnectedDevice>(connectedDevice)->SocketRW()->WriteMessageAsync(txtSendMessage().Text());
00305     }
00306
00307     void Scenario2_Connector::btnClose_Click(IInspectable const&, RoutedEventArgs const&)
00308     {
00309         auto connectedDevice = lvConnectedDevices().SelectedItem().as<SDKTemplate::ConnectedDevice>();
00310         RemoveByValue(connectedDevices, connectedDevice);
00311
00312         // Close socket and WiFiDirect object
00313         connectedDevice.Close();
00314     }
00315
00316     fire_and_forget Scenario2_Connector::btnUnpair_Click(IInspectable const&, RoutedEventArgs const&)
00317     {
00318         auto lifetime = get_strong();
00319
00320         auto discoveredDevice = lvDiscoveredDevices().SelectedItem().as<SDKTemplate::DiscoveredDevice>();
00321         DeviceInformation deviceInfo = get_self<DiscoveredDevice>(discoveredDevice)->DeviceInfo();
00322
00323         DeviceUnpairingResult result = co_await deviceInfo.Pairing().UnpairAsync();
00324         rootPage.NotifyUser(L"Unpair result: " + to_hstring(result.Status()), NotifyType::StatusMessage);
00325     }
00326 }
Generated on Fri Nov 15 2024 22:22:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_LanguageDetection Member List

This is the complete list of members for Scenario1_LanguageDetection, including all inherited members.
Go_Click(object sender, RoutedEventArgs e) | Scenario1_LanguageDetection | [inline]
Scenario1_LanguageDetection() | Scenario1_LanguageDetection | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_GeofenceBackgroundTask Member List

This is the complete list of members for Scenario5_GeofenceBackgroundTask, including all inherited members.
_geofenceTask | Scenario5_GeofenceBackgroundTask | [private]
_rootPage | Scenario5_GeofenceBackgroundTask | [private]
BackgroundTaskEntryPoint | Scenario5_GeofenceBackgroundTask | [private]
BackgroundTaskName | Scenario5_GeofenceBackgroundTask | [private]
FillEventListBoxWithExistingEvents() | Scenario5_GeofenceBackgroundTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e) | Scenario5_GeofenceBackgroundTask | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario5_GeofenceBackgroundTask | [inline, protected]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | Scenario5_GeofenceBackgroundTask | [inline, private]
Scenario5_GeofenceBackgroundTask() | Scenario5_GeofenceBackgroundTask | [inline]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | Scenario5_GeofenceBackgroundTask | [inline, private]
UpdateButtonStates() | Scenario5_GeofenceBackgroundTask | [inline, private]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario2_InAppPurchase.xaml.cpp Source File

  • Store
  • cpp

Scenario2_InAppPurchase.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_InAppPurchase.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Services::Store;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario2_InAppPurchase::Scenario2_InAppPurchase()
00027 {
00028     InitializeComponent();
00029
00030     storeContext = StoreContext::GetDefault();
00031 }
00032
00033 void Scenario2_InAppPurchase::GetAssociatedProductsButton_Click(Object^ sender, RoutedEventArgs^ e)
00034 {
00035     // Create a filtered list of the product AddOns I care about
00036     auto filterList = ref new Vector<String^>({ "Consumable" ,"Durable", "UnmanagedConsumable" });
00037
00038     // Get list of Add Ons this app can sell, filtering for the types we know about
00039     create_task(storeContext->GetAssociatedStoreProductsAsync(filterList)).then([this](StoreProductQueryResult^ addOns)
00040     {
00041         ProductsListView->ItemsSource = Utils::CreateProductListFromQueryResult(addOns, "Add-Ons");
00042     }, task_continuation_context::get_current_winrt_context());
00043 }
00044
00045 void Scenario2_InAppPurchase::PurchaseAddOnButton_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     ItemDetails^ item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00048     create_task(storeContext->RequestPurchaseAsync(item->StoreId)).then([this, item](StorePurchaseResult^ result)
00049     {
00050         if (result->ExtendedError.Value != S_OK)
00051         {
00052             Utils::ReportExtendedError(result->ExtendedError);
00053             return;
00054         }
00055
00056         switch (result->Status)
00057         {
00058         case StorePurchaseStatus::AlreadyPurchased:
00059             rootPage->NotifyUser("You already bought this AddOn.", NotifyType::ErrorMessage);
00060             break;
00061
00062         case StorePurchaseStatus::Succeeded:
00063             rootPage->NotifyUser("You bought " + item->Title + ".", NotifyType::StatusMessage);
00064             break;
00065
00066         case StorePurchaseStatus::NotPurchased:
00067             rootPage->NotifyUser("Product was not purchased, it may have been canceled.", NotifyType::ErrorMessage);
00068             break;
00069
00070         case StorePurchaseStatus::NetworkError:
00071             rootPage->NotifyUser("Product was not purchased due to a network error.", NotifyType::ErrorMessage);
00072             break;
00073
00074         case StorePurchaseStatus::ServerError:
00075             rootPage->NotifyUser("Product was not purchased due to a server error.", NotifyType::ErrorMessage);
00076             break;
00077
00078         default:
00079             rootPage->NotifyUser("Product was not purchased due to an unknown error.", NotifyType::ErrorMessage);
00080             break;
00081         }
00082     }, task_continuation_context::get_current_winrt_context());
00083 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario4_ConsumableProduct.xaml.cpp Source File

  • Store
  • cpp

Scenario4_ConsumableProduct.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_ConsumableProduct.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Services::Store;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 Scenario4_ConsumableProduct::Scenario4_ConsumableProduct()
00026 {
00027     InitializeComponent();
00028
00029     storeContext = StoreContext::GetDefault();
00030 }
00031
00032
00033 void Scenario4_ConsumableProduct::GetManagedConsumablesButton_Click(Object^ sender, RoutedEventArgs^ e)
00034 {
00035     auto filterList = ref new Vector<String^>({ "Consumable" });
00036
00037     // Get list of Add Ons this app can sell, filtering for the types we know about.
00038     create_task(storeContext->GetAssociatedStoreProductsAsync(filterList)).then([this](StoreProductQueryResult^ addOns)
00039     {
00040         ProductsListView->ItemsSource = Utils::CreateProductListFromQueryResult(addOns, "Consumable Add-Ons");
00041     }, task_continuation_context::get_current_winrt_context());
00042 }
00043
00044 void Scenario4_ConsumableProduct::PurchaseAddOnButton_Click(Object^ sender, RoutedEventArgs^ e)
00045 {
00046     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00047
00048     create_task(storeContext->RequestPurchaseAsync(item->StoreId)).then([this, item](StorePurchaseResult^ result)
00049     {
00050         if (result->ExtendedError.Value != S_OK)
00051         {
00052             Utils::ReportExtendedError(result->ExtendedError);
00053             return;
00054         }
00055
00056         switch (result->Status)
00057         {
00058         case StorePurchaseStatus::AlreadyPurchased: // should never get this for a managed consumable since they are stackable
00059             rootPage->NotifyUser("You already bought this consumable.", NotifyType::ErrorMessage);
00060             break;
00061
00062         case StorePurchaseStatus::Succeeded:
00063             rootPage->NotifyUser("You bought " + item->Title + ".", NotifyType::StatusMessage);
00064             break;
00065
00066         case StorePurchaseStatus::NotPurchased:
00067             rootPage->NotifyUser("Product was not purchased, it may have been canceled.", NotifyType::ErrorMessage);
00068             break;
00069
00070         case StorePurchaseStatus::NetworkError:
00071             rootPage->NotifyUser("Product was not purchased due to a network error.", NotifyType::ErrorMessage);
00072             break;
00073
00074         case StorePurchaseStatus::ServerError:
00075             rootPage->NotifyUser("Product was not purchased due to a server error.", NotifyType::ErrorMessage);
00076             break;
00077
00078         default:
00079             rootPage->NotifyUser("Product was not purchased due to an unknown error.", NotifyType::ErrorMessage);
00080             break;
00081         }
00082     }, task_continuation_context::get_current_winrt_context());
00083 }
00084
00085 void Scenario4_ConsumableProduct::GetConsumableBalanceButton_Click(Object^ sender, RoutedEventArgs^ e)
00086 {
00087     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00088
00089     create_task(storeContext->GetConsumableBalanceRemainingAsync(item->StoreId)).then([this](StoreConsumableResult^ result)
00090     {
00091         if (result->ExtendedError.Value != S_OK)
00092         {
00093             Utils::ReportExtendedError(result->ExtendedError);
00094             return;
00095         }
00096
00097         switch (result->Status)
00098         {
00099         case StoreConsumableStatus::InsufficentQuantity: // should never get this...
00100             rootPage->NotifyUser("Insufficient Quantity! Balance Remaining: " + result->BalanceRemaining, NotifyType::ErrorMessage);
00101             break;
00102
00103         case StoreConsumableStatus::Succeeded:
00104             rootPage->NotifyUser("Balance Remaining: " + result->BalanceRemaining, NotifyType::StatusMessage);
00105             break;
00106
00107         case StoreConsumableStatus::NetworkError:
00108             rootPage->NotifyUser("Network error retrieving consumable balance.", NotifyType::ErrorMessage);
00109             break;
00110
00111         case StoreConsumableStatus::ServerError:
00112             rootPage->NotifyUser("Server error retrieving consumable balance.", NotifyType::ErrorMessage);
00113             break;
00114
00115         default:
00116             rootPage->NotifyUser("Unknown error retrieving consumable balance.", NotifyType::ErrorMessage);
00117             break;
00118         }
00119     }, task_continuation_context::get_current_winrt_context());
00120 }
00121
00122 void Scenario4_ConsumableProduct::FulfillConsumableButton_Click(Object^ sender, RoutedEventArgs^ e)
00123 {
00124     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00125
00126     unsigned int quantity = _wtoi(safe_cast<String^>(QuantityComboBox->SelectedValue)->Data());
00127
00128     // This can be used to ensure this request is never double fulfilled. The server will
00129     // only accept one report for this specific GUID.
00130     GUID guid;
00131     if (FAILED(CoCreateGuid(&guid)))
00132     {
00133         rootPage->NotifyUser("Failed to create a tracking GUID.", NotifyType::ErrorMessage);
00134         return;
00135     }
00136
00137     Guid trackingId(guid);
00138
00139     create_task(storeContext->ReportConsumableFulfillmentAsync(item->StoreId, quantity, trackingId)).then([this](StoreConsumableResult^ result)
00140     {
00141         if (result->ExtendedError.Value != S_OK)
00142         {
00143             Utils::ReportExtendedError(result->ExtendedError);
00144             return;
00145         }
00146
00147         switch (result->Status)
00148         {
00149         case StoreConsumableStatus::InsufficentQuantity:
00150             rootPage->NotifyUser("Insufficient Quantity! Balance Remaining: " + result->BalanceRemaining, NotifyType::ErrorMessage);
00151             break;
00152
00153         case StoreConsumableStatus::Succeeded:
00154             rootPage->NotifyUser("Successful fulfillment! Balance Remaining: " + result->BalanceRemaining, NotifyType::StatusMessage);
00155             break;
00156
00157         case StoreConsumableStatus::NetworkError:
00158             rootPage->NotifyUser("Network error fulfilling consumable.", NotifyType::ErrorMessage);
00159             break;
00160
00161         case StoreConsumableStatus::ServerError:
00162             rootPage->NotifyUser("Server error fulfilling consumable.", NotifyType::ErrorMessage);
00163             break;
00164
00165         default:
00166             rootPage->NotifyUser("Unknown error fulfilling consumable.", NotifyType::ErrorMessage);
00167             break;
00168         }
00169     }, task_continuation_context::get_current_winrt_context());
00170 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/BaseControl.h Source File

  • 360VideoPlayback
  • cpp
  • Common

BaseControl.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "CameraResources.h"
00003 #include "DeviceResources.h"
00004 #include "BaseElement.h"
00005 #include "MeshGeometry.h"
00006 #include "StepTimer.h"
00007 #include "BaseElement.h"
00008
00009 #define DEFAULT_TEXTURE_SIZE 128
00010
00011 namespace DX
00012 {
00013     class BaseControl
00014     {
00015     public:
00016         BaseControl(
00017             const std::shared_ptr<DX::MeshGeometry> geometry = MeshGeometry::MakeTexturedCube());
00018         // Whether to use the child element to determine the initial texture dimensions and geometry scale.
00019         void SnapInitialSizeToRootElement();
00020         void Initialize();
00021         void Update(const DX::StepTimer& timer, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose);
00022         void Render();
00023         void SetScale(Windows::Foundation::Numerics::float3 value);
00024         void SetPosition(Windows::Foundation::Numerics::float3 value);
00025         void SetParentTransform(Windows::Foundation::Numerics::float4x4 transform);
00026         void ApplyShaders();
00027         // Render stage overrides
00028         bool IsFocused() { return m_isFocused; };
00029         void SetIsVisible(bool value);
00030         void PerformPressedAction();
00031         void SetRenderElement(std::shared_ptr<DX::FocusableElement> renderItem);
00032         void SetTextureWidth(UINT width) { m_textureWidth = width; m_calculateTextureDimensionsFromScale = false; }
00033         void SetTextureHeight(UINT height) { m_textureHeight = height; m_calculateTextureDimensionsFromScale = false; }
00034
00035     private:
00036         // Calculate the initial texture dimensions and geometry scale.
00037         virtual void CalculateInitialSize();
00038         void AllocateTexture();
00039         void UploadGeometryAndShaders();
00040         void InitializeFocusPoint();
00041         void ApplyPixelShader();
00042
00043         bool m_isInitialized;
00044         bool m_isFocused;
00045         bool m_isVisible;
00046         bool m_isUITextureRenderNeeded = true;
00047         Microsoft::WRL::ComPtr<ID3D11Buffer> m_focusPointConstantBuffer;
00048         _360VideoPlayback::FocusPointConstantBuffer m_focusPointConstantBufferData;
00049         float m_calculateTextureDimensionsFromScale = true;
00050         UINT m_textureWidth;
00051         UINT m_textureHeight;
00052         // Resources
00053         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00054         std::shared_ptr<FocusableElement> m_renderItem;
00055         bool m_snapSizeToRootElement = false;
00056         std::shared_ptr<MeshGeometry> m_geometry;
00057         _360VideoPlayback::ModelConstantBuffer m_modelConstantBufferData;
00058         Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer;
00059         Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;
00060         Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
00061         Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader;
00062         Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader;
00063         Windows::Foundation::Numerics::float3 m_scale;
00064         Windows::Foundation::Numerics::float4 m_rotation;
00065         Windows::Foundation::Numerics::float3 m_position;
00066         Windows::Foundation::Numerics::float4x4 m_transform;
00067         // Parent Transform for objects within a parent
00068         Windows::Foundation::Numerics::float4x4 m_parentTransform;
00069         // Status
00070         Windows::Foundation::Numerics::float2 m_relativeIntersectionPoint;
00071         bool IsFocusOnControl(const DirectX::XMMATRIX& transform, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose);
00072         Microsoft::WRL::ComPtr<ID2D1Image> m_d2dContextTargetToRestore;
00073         Microsoft::WRL::ComPtr<ID3D11SamplerState> m_sampler;
00074         Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock1> m_stateBlock;
00075         Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture;
00076         Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_textureTarget;
00077         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureShaderResourceView;
00078     };
00079 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/OtherScenarios.xaml.cs Source File

  • Clipboard
  • cs

OtherScenarios.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.DataTransfer;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class OtherScenarios : Page
00021     {
00022         MainPage rootPage = MainPage.Current;
00023
00024         public OtherScenarios()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         protected override void OnNavigatedTo(NavigationEventArgs e)
00030         {
00031             RegisterClipboardContentChanged.IsChecked = rootPage.IsClipboardContentChangedEnabled;
00032         }
00033
00034         void ShowFormatButton_Click(object sender, RoutedEventArgs e)
00035         {
00036             this.DisplayFormats();
00037         }
00038
00039         void EmptyClipboardButton_Click(object sender, RoutedEventArgs e)
00040         {
00041             try
00042             {
00043                 Clipboard.Clear();
00044                 OutputText.Text = "Clipboard has been emptied.";
00045             }
00046             catch (Exception ex)
00047             {
00048                 rootPage.NotifyUser("Error emptying Clipboard: " + ex.Message + ". Try again", NotifyType.ErrorMessage);
00049             }
00050         }
00051
00052         void RegisterClipboardContentChanged_Click(object sender, RoutedEventArgs e)
00053         {
00054             // In this sample, we register for Clipboard update notifications on the MainPage so that we can
00055             // navigate between scenarios and still receive updates. The sample also registers for window activated
00056             // notifications since the app needs to be in the foreground to access the clipboard. Once we receive
00057             // a clipboard update notification, we display the new content (if the app is in the foreground). If the
00058             // sample is not in the foreground, we defer displaying it until it is.
00059             bool enable = RegisterClipboardContentChanged.IsChecked.Value;
00060             if (rootPage.EnableClipboardContentChangedNotifications(enable))
00061             {
00062                 this.ClearOutput();
00063
00064                 if (enable)
00065                 {
00066                     OutputText.Text = "Successfully registered for clipboard update notification.";
00067                 }
00068                 else
00069                 {
00070                     OutputText.Text = "Successfully un-registered for clipboard update notification.";
00071                 }
00072             }
00073         }
00074
00075         void ClearOutputButton_Click(object sender, RoutedEventArgs e)
00076         {
00077             this.ClearOutput();
00078         }
00079
00080         private void ClearOutput()
00081         {
00082             rootPage.NotifyUser("", NotifyType.StatusMessage);
00083             OutputText.Text = "";
00084         }
00085
00086         private void DisplayFormats()
00087         {
00088             rootPage.NotifyUser("", NotifyType.StatusMessage);
00089             OutputText.Text = rootPage.BuildClipboardFormatsOutputString();
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:18:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BasicReaderWriter Member List

This is the complete list of members for BasicReaderWriter, including all inherited members.
__pad0__ | BasicReaderWriter | [private]
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
BasicReaderWriter() | BasicReaderWriter |
BasicReaderWriter(_In_ winrt::Windows::Storage::StorageFolder folder) | BasicReaderWriter |
BasicReaderWriter(_In_ Windows::Storage::StorageFolder^folder) | BasicReaderWriter | [private]
m_location | BasicReaderWriter | [private]
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadData(_In_ winrt::hstring const &filename) | BasicReaderWriter |
ReadData(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
ReadDataAsync(_In_ winrt::hstring const &filename) | BasicReaderWriter |
ReadDataAsync(_In_ Platform::String^filename) | BasicReaderWriter | [private]
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteData(_In_ winrt::hstring const &filename, _In_ std::vector< byte > const &fileData) | BasicReaderWriter |
WriteData(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
WriteDataAsync(_In_ winrt::hstring const &filename, _In_ std::vector< byte > const &fileData) | BasicReaderWriter |
WriteDataAsync(_In_ Platform::String^filename, _In_ const Platform::Array< byte >^fileData) | BasicReaderWriter | [private]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TrackingEventCue Member List

This is the complete list of members for TrackingEventCue, including all inherited members.
AdjustDurationIfLive(long sourceDurationTicks) | TrackingEventCue | [inline, static]
CreateTrackingEventsTrack(MediaSource source, string contentId, string reportingUriFormat) | TrackingEventCue | [inline, static]
Duration | TrackingEventCue |
Id | TrackingEventCue |
StartTime | TrackingEventCue |
TrackingEventUri | TrackingEventCue |
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/Controls.cpp Source File

  • 360VideoPlayback
  • cpp
  • Common

Controls.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Controls.h"
00003 #include "DeviceResources.h"
00004 #include "DirectXHelper.h"
00005 #include "..\AppView.h"
00006 #include "..\VideoGallery.xaml.h"
00007
00008 using namespace _360VideoPlayback;
00009 using namespace D2D1;
00010 using namespace DirectX;
00011 using namespace DX;
00012 using namespace Microsoft::WRL;
00013 using namespace std;
00014 using namespace Windows::Foundation::Numerics;
00015 using namespace Windows::Media::Core;
00016 using namespace Windows::Media::Playback;
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::UI::Input::Spatial;
00019 using namespace Windows::UI::ViewManagement;
00020
00021 const ColorF focusOutlineColor(0xFFFFFF);
00022 const ColorF pressedBackgroundFillColor(0x00AFFF);
00023 const ColorF enabledForegroundColor(0xFFFFFF);
00024 const float c_maxSecondsInPerformPressedFeedbackState = 0.25f;
00025 UINT DEFAULT_SIZE = 18;
00026 ElementMargin TEXT_MARGIN{ 15.0f, 12.0f, 15.0f, 12.0f };
00027
00028 Button::Button(UINT initialSize, ButtonShape shape) :
00029     FocusableElement(),
00030     m_pressingTimeOut(0.0f),
00031     m_shape(shape)
00032 {
00033     m_elementSize = float2(static_cast<float>(initialSize));
00034
00035     // Add the button pressed UI element first so it appears under the focus rect.
00036     if (m_shape == ButtonShape::Rectangle)
00037     {
00038         m_RectPressedBackgroundFill = make_shared<FilledRectangle>(m_elementSize.x, m_elementSize.y, pressedBackgroundFillColor);
00039         m_RectFocusOutline = make_shared<Rectangle>(m_elementSize.x, m_elementSize.y, 1.5f, focusOutlineColor);
00040         m_RectPressedBackgroundFill->SetIgnoreLayout(false);
00041         m_RectFocusOutline->SetIgnoreLayout(false);
00042         m_RectPressedBackgroundFill->SetIsVisible(false);
00043         m_RectFocusOutline->SetIsVisible(false);
00044         this->AddChildElement(m_RectPressedBackgroundFill);
00045         this->AddChildElement(m_RectFocusOutline);
00046
00047     }
00048     else if (m_shape == ButtonShape::Circle)
00049     {
00050         m_ElliPressedBackgroundFill = make_shared<FilledEllipse>(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f, pressedBackgroundFillColor);
00051         m_ElliFocusOutline = make_shared<Ellipse>(m_elementSize.x * 0.5f, m_elementSize.y* 0.5f, 5.0f, focusOutlineColor);
00052         m_ElliPressedBackgroundFill->SetIgnoreLayout(false);
00053         m_ElliFocusOutline->SetIgnoreLayout(false);
00054         m_ElliPressedBackgroundFill->SetIsVisible(false);
00055         m_ElliFocusOutline->SetIsVisible(false);
00056         this->AddChildElement(m_ElliPressedBackgroundFill);
00057         this->AddChildElement(m_ElliFocusOutline);
00058     }
00059 }
00060
00061 void Button::ArrangeElements()
00062 {
00063     __super::ArrangeElements();
00064
00065     if (m_shape == ButtonShape::Rectangle)
00066     {
00067         // Update the focus rect to be the same size as the button.
00068         FLOAT selectionBorderStrokeThickness = m_RectFocusOutline->GetStrokeThickness();
00069         m_RectFocusOutline->SetRect({
00070     selectionBorderStrokeThickness,
00071     selectionBorderStrokeThickness,
00072     m_elementSize.x - selectionBorderStrokeThickness,
00073     m_elementSize.y - selectionBorderStrokeThickness });
00074
00075         m_RectPressedBackgroundFill->SetRect({ 0.0f, 0.0f, m_elementSize.x, m_elementSize.y });
00076     }
00077     else if (m_shape == ButtonShape::Circle)
00078     {
00079         m_ElliFocusOutline->SetRadius(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f);
00080         m_ElliPressedBackgroundFill->SetRadius(m_elementSize.x * 0.5f, m_elementSize.y * 0.5f);
00081     }
00082 }
00083
00084 void Button::Initialize()
00085 {
00086     auto d2dcontext = m_deviceResources->GetD2DDeviceContext();
00087
00088     __super::Initialize();
00089
00090     // Recreate the brush for the glyphs, font, etc. This is the final brush we want to hold on to in the button
00091     DX::ThrowIfFailed(
00092         d2dcontext->CreateSolidColorBrush(
00093             enabledForegroundColor,
00094             &m_brush));
00095 }
00096
00097 void Button::Update(const DX::StepTimer& timer, SpatialPointerPose^ cameraPose)
00098 {
00099     __super::Update(timer, cameraPose);
00100     if (m_buttonState == ButtonState::Pressing)
00101     {
00102         if (m_pressingTimeOut > m_maxSecondsInPressingState)
00103         {
00104             m_buttonState = ButtonState::Pressed;
00105             if (m_shape == ButtonShape::Rectangle)
00106             {
00107                 m_RectPressedBackgroundFill->SetIsVisible(false);
00108             }
00109             else
00110             {
00111                 m_ElliPressedBackgroundFill->SetIsVisible(false);
00112             }
00113             Button::PerformAction();
00114             m_pressingTimeOut = 0.0f;
00115         }
00116         else
00117         {
00118             m_pressingTimeOut += static_cast<float>(timer.GetElapsedSeconds());
00119             if (m_shape == ButtonShape::Rectangle)
00120             {
00121                 if (!m_RectPressedBackgroundFill->GetIsVisible())
00122                 {
00123                     m_RectPressedBackgroundFill->SetIsVisible(true);
00124                 }
00125             }
00126             else
00127             {
00128                 if (!m_ElliPressedBackgroundFill->GetIsVisible())
00129                 {
00130                     m_ElliPressedBackgroundFill->SetIsVisible(true);
00131                 }
00132             }
00133         }
00134     }
00135 }
00136
00137 void Button::FocusUpdate()
00138 {
00139     bool update = false;
00140     if (this->IsFocused())
00141     {
00142         update = true;
00143     }
00144     (m_shape == ButtonShape::Rectangle) ? m_RectFocusOutline->SetIsVisible(update) : m_ElliFocusOutline->SetIsVisible(update);
00145 }
00146
00147 void Button::PerformAction()
00148 {
00149     // If the user invokes a button we need to trigger the invoked state
00150     // and give visual feedback to the user that the button has been pressed.
00151     if (m_buttonState == ButtonState::None)
00152     {
00153         m_buttonState = ButtonState::Pressing;
00154         m_pressingTimeOut = 0.0f;
00155     }
00156     else if (m_buttonState == ButtonState::Pressed)
00157     {
00158         __super::PerformAction();
00159         m_buttonState = ButtonState::None;
00160     }
00161 }
00162
00163 PlayPauseButton::PlayPauseButton(UINT buttonSize, UINT iconSize) :
00164     Button(iconSize, ButtonShape::Circle)
00165 {
00166     this->SetElementSize({ static_cast<float>(buttonSize), static_cast<float>(buttonSize) });
00167     m_playText = std::make_shared<Text>(L"Play", FONT_SIZE * 4, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
00168     m_playText->SetElementMargin(TEXT_MARGIN);
00169     this->AddChildElement(m_playText);
00170
00171     m_pauseText = std::make_shared<Text>(L"Pause", FONT_SIZE * 4, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
00172     m_pauseText->SetElementMargin(TEXT_MARGIN);
00173     this->AddChildElement(m_pauseText);
00174
00175     this->ArrangeElements();
00176 }
00177
00178 void PlayPauseButton::Initialize()
00179 {
00180     __super::Initialize();
00181     m_playText->SetBrush(m_brush.Get());
00182     m_playText->Initialize();
00183     m_pauseText->SetBrush(m_brush.Get());
00184     m_pauseText->Initialize();
00185 }
00186
00187 void PlayPauseButton::Update(const StepTimer& timer, SpatialPointerPose^ cameraPose)
00188 {
00189     __super::Update(timer, cameraPose);
00190
00191     // Update the playback state.
00192     bool isPlaying = (AppView::GetMediaPlayer()->PlaybackSession->PlaybackState == MediaPlaybackState::Playing);
00193
00194     // When the video is playing, you show the Pause Text since hitting the button in this state will pause the video
00195     if (isPlaying)
00196     {
00197         m_playText->SetIsVisible(false);
00198         m_pauseText->SetIsVisible(true);
00199     }
00200     // When the video is Paused, you show the P:ay Text since hitting the button in this state will play the video
00201     else
00202     {
00203         m_playText->SetIsVisible(true);
00204         m_pauseText->SetIsVisible(false);
00205     }
00206 }
00207
00208 void PlayPauseButton::PerformAction()
00209 {
00210     __super::PerformAction();
00211     if (AppView::GetMediaPlayer()->PlaybackSession->PlaybackState != MediaPlaybackState::None)
00212     {
00213         if (AppView::GetMediaPlayer()->PlaybackSession->PlaybackState == MediaPlaybackState::Playing)
00214         {
00215             AppView::GetMediaPlayer()->Pause();
00216         }
00217         else
00218         {
00219             AppView::GetMediaPlayer()->Play();
00220         }
00221     }
00222 }
00223
00224 ExitButton::ExitButton() :
00225     Button(DEFAULT_SIZE)
00226 {
00227     m_exitText = std::make_shared<Text>(L"Exit Playback", FONT_SIZE * 2, DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL);
00228     m_exitText->SetElementMargin(TEXT_MARGIN);
00229     this->AddChildElement(m_exitText);
00230
00231     this->SetLayoutHorizontal(true);
00232 }
00233
00234 void ExitButton::Initialize()
00235 {
00236     __super::Initialize();
00237
00238     m_exitText->SetBrush(m_brush.Get());
00239
00240     m_exitText->Initialize();
00241 }
00242
00243 void ExitButton::PerformAction()
00244 {
00245     __super::PerformAction();
00246     ApplicationViewSwitcher::SwitchAsync(VideoGallery::GetMainViewId(), ApplicationView::GetForCurrentView()->Id, ApplicationViewSwitchingOptions::ConsolidateViews);
00247 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario2_Polling.xaml.cs Source File

  • PresenceSensor
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Enumeration;
00014 using Windows.Devices.Sensors;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario2_Polling : Page
00022     {
00023         MainPage rootPage = MainPage.Current;
00024
00025         private HumanPresenceSensor sensor;
00026
00027         public Scenario2_Polling()
00028         {
00029             InitializeComponent();
00030         }
00031
00032         private async void ScenarioGetSensor_Click(object sender, RoutedEventArgs e)
00033         {
00034             // This scenario uses DeviceInformation.FindAllAsync to find all
00035             // HumanPresenceSensor devices. This allows the app to choose a sensor
00036             // which best fits its requirements.
00037             //
00038             // Scenario 1 shows how to get the default HumanPresenceSensor device.
00039
00040             // Disable the button so the user can't click it again while we are already working.
00041             GetSensorButton.IsEnabled = false;
00042
00043             // Clear any previous message.
00044             rootPage.NotifyUser("", NotifyType.StatusMessage);
00045
00046             string selector = HumanPresenceSensor.GetDeviceSelector();
00047             DeviceInformationCollection deviceInfos = await DeviceInformation.FindAllAsync(selector);
00048             foreach (DeviceInformation deviceInfo in deviceInfos)
00049             {
00050                 HumanPresenceSensor foundSensor = null;
00051                 try
00052                 {
00053                     foundSensor = await HumanPresenceSensor.FromIdAsync(deviceInfo.Id);
00054                 }
00055                 catch (UnauthorizedAccessException)
00056                 {
00057                     // The user denied this app presence sensor access.
00058                     foundSensor = null;
00059                 }
00060
00061                 if (foundSensor != null)
00062                 {
00063                     if (null != foundSensor.MaxDetectableDistanceInMillimeters)
00064                     {
00065                         // Check if this is the sensor that matches our ranges.
00066                         // TODO: Customize these values to your application's needs.
00067                         const uint distanceInMillimetersLValue = 200; // 0.2m
00068                         const uint distanceInMillimetersRValue = 1200; // 1.2m
00069                         if (foundSensor.MinDetectableDistanceInMillimeters <= distanceInMillimetersLValue &&
00070                             foundSensor.MaxDetectableDistanceInMillimeters >= distanceInMillimetersRValue)
00071                         {
00072                             rootPage.NotifyUser("Found a presence sensor that meets the detection range", NotifyType.StatusMessage);
00073                             sensor = foundSensor;
00074                         }
00075                         else
00076                         {
00077                             rootPage.NotifyUser("Presence sensor does not meet the detection range, using it anyway", NotifyType.StatusMessage);
00078                             // We'll use the sensor anyway, to demonstrate how events work.
00079                             // Your app may decide not to use this sensor and keep looking for another.
00080                             sensor = foundSensor;
00081                         }
00082                     }
00083                     else
00084                     {
00085                         rootPage.NotifyUser("Presence sensor does not report detection ranges, using it anyway", NotifyType.StatusMessage);
00086                         sensor = foundSensor;
00087                     }
00088                 }
00089
00090                 if (sensor != null)
00091                 {
00092                     // We found a sensor we like. We can stop looking now.
00093                     break;
00094                 }
00095             }
00096
00097             GetSensorButton.IsEnabled = true;
00098
00099             if (sensor != null)
00100             {
00101                 VisualStateManager.GoToState(this, "Ready", true);
00102             }
00103             else
00104             {
00105                 rootPage.NotifyUser("No presence sensor found", NotifyType.ErrorMessage);
00106             }
00107         }
00108
00109         private void ScenarioGetData_Click(object sender, RoutedEventArgs e)
00110         {
00111             HumanPresenceSensorReading reading;
00112             try
00113             {
00114                 reading = sensor.GetCurrentReading();
00115             }
00116             catch (UnauthorizedAccessException)
00117             {
00118                 // The user denied this app presence sensor access.
00119                 reading = null;
00120             }
00121
00122             if (reading != null)
00123             {
00124                 if (sensor.IsEngagementSupported)
00125                 {
00126                     EngagementStateTextBlock.Text = reading.Engagement.ToString();
00127                 }
00128                 else
00129                 {
00130                     EngagementStateTextBlock.Text = "Not Supported";
00131                 }
00132
00133                 if (sensor.IsPresenceSupported)
00134                 {
00135                     DetectionStateTextBlock.Text = reading.Presence.ToString();
00136                 }
00137                 else
00138                 {
00139                     DetectionStateTextBlock.Text = "Not Supported";
00140                 }
00141
00142                 // Show the detection distance, if available
00143                 DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();
00144
00145                 TimestampTextBlock.Text = reading.Timestamp.ToString("u");
00146             }
00147         }
00148     }
00149 }
00150
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrCapturedImage.cpp Source File

  • OCR
  • cppwinrt

OcrCapturedImage.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "OcrCapturedImage.h"
00003 #include "OcrCapturedImage.g.cpp"
00004
00005 using namespace winrt;
00006 using namespace Windows::Devices::Enumeration;
00007 using namespace Windows::Foundation;
00008 using namespace Windows::Foundation::Collections;
00009 using namespace Windows::Graphics;
00010 using namespace Windows::Graphics::Display;
00011 using namespace Windows::Graphics::Imaging;
00012 using namespace Windows::Media;
00013 using namespace Windows::Media::Capture;
00014 using namespace Windows::Media::MediaProperties;
00015 using namespace Windows::Media::Ocr;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Interop;
00019 using namespace Windows::UI::Xaml::Media::Imaging;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022 using namespace Windows::Storage;
00023 using namespace Windows::Storage::Pickers;
00024 using namespace SDKTemplate;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     OcrCapturedImage::OcrCapturedImage()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     /// <summary>
00034     /// Invoked when this page is about to be displayed in a Frame.
00035     /// Ckecks if English language is avaiable for OCR on device and starts camera preview..
00036     /// </summary>
00037     /// <param name="e"></param>
00038     fire_and_forget OcrCapturedImage::OnNavigatedTo(NavigationEventArgs const& e)
00039     {
00040         auto lifetime = get_strong();
00041
00042         orientationChangedEventToken = displayInformation.OrientationChanged({ get_weak(), &OcrCapturedImage::DisplayInformation_OrientationChanged });
00043
00044         // Useful to know when to initialize/clean up the camera
00045         applicationSuspendingToken = Application::Current().Suspending({ get_weak(), &OcrCapturedImage::Application_Suspending });
00046         applicationResumingToken = Application::Current().Resuming({ get_weak(), &OcrCapturedImage::Application_Resuming });
00047
00048         if (!OcrEngine::IsLanguageSupported(ocrLanguage))
00049         {
00050             rootPage.NotifyUser(ocrLanguage.DisplayName() + L" is not supported.", NotifyType::ErrorMessage);
00051
00052             return;
00053         }
00054
00055         co_await StartCameraAsync();
00056
00057         // Update buttons visibility.
00058         ExtractButton().Visibility(isInitialized ? Visibility::Visible : Visibility::Collapsed);
00059         CameraButton().Visibility(isInitialized ? Visibility::Collapsed : Visibility::Visible);
00060     }
00061
00062     /// <summary>
00063     /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00064     /// Stops camera if initialized.
00065     /// </summary>
00066     /// <param name="e"></param>
00067     fire_and_forget OcrCapturedImage::OnNavigatingFrom(NavigatingCancelEventArgs const&)
00068     {
00069         auto lifetime = get_strong();
00070
00071         displayInformation.OrientationChanged(orientationChangedEventToken);
00072         Application::Current().Suspending(applicationSuspendingToken);
00073         Application::Current().Resuming(applicationResumingToken);
00074
00075         co_await CleanupCameraAsync();
00076     }
00077
00078     /// <summary>
00079     /// Occures on app suspending. Stops camera if initialized.
00080     /// </summary>
00081     /// <param name="sender"></param>
00082     /// <param name="e"></param>
00083     fire_and_forget OcrCapturedImage::Application_Suspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const& e)
00084     {
00085         auto lifetime = get_strong();
00086
00087         auto deferral = e.SuspendingOperation().GetDeferral();
00088
00089         co_await CleanupCameraAsync();
00090
00091         displayInformation.OrientationChanged(orientationChangedEventToken);
00092
00093         deferral.Complete();
00094     }
00095
00096     /// <summary>
00097     /// Occurs on app resuming. Initializes camera if available.
00098     /// </summary>
00099     /// <param name="sender"></param>
00100     /// <param name="o"></param>
00101     fire_and_forget OcrCapturedImage::Application_Resuming(IInspectable const&, IInspectable const&)
00102     {
00103         auto lifetime = get_strong();
00104
00105         orientationChangedEventToken = displayInformation.OrientationChanged({ get_weak(), &OcrCapturedImage::DisplayInformation_OrientationChanged });
00106
00107         co_await StartCameraAsync();
00108     }
00109
00110     /// <summary>
00111     /// Occurs when display orientation changes.
00112     /// Sets camera rotation preview.
00113     /// </summary>
00114     /// <param name="sender"></param>
00115     /// <param name="args"></param>
00116     void OcrCapturedImage::DisplayInformation_OrientationChanged(IInspectable const&, IInspectable const&)
00117     {
00118         if (isPreviewing)
00119         {
00120             SetPreviewRotationAsync();
00121         }
00122     }
00123
00124     /// <summary>
00125     /// This is event handler for 'Extract' button.
00126     /// Captures image from camera ,recognizes text and displays it.
00127     /// </summary>
00128     /// <param name="sender"></param>
00129     /// <param name="e"></param>
00130     fire_and_forget OcrCapturedImage::ExtractButton_Click(IInspectable const& sender, RoutedEventArgs const& e)
00131     {
00132         auto lifetime = get_strong();
00133
00134         //Get information about the preview.
00135         auto previewProperties = mediaCapture.VideoDeviceController().GetMediaStreamProperties(MediaStreamType::VideoPreview).as<VideoEncodingProperties>();
00136         int videoFrameWidth = static_cast<int>(previewProperties.Width());
00137         int videoFrameHeight = static_cast<int>(previewProperties.Height());
00138
00139         // In portrait modes, the width and height must be swapped for the VideoFrame to have the correct aspect ratio and avoid letterboxing / black bars.
00140         if (!externalCamera && (displayInformation.CurrentOrientation() == DisplayOrientations::Portrait || displayInformation.CurrentOrientation() == DisplayOrientations::PortraitFlipped))
00141         {
00142             videoFrameWidth = static_cast<int>(previewProperties.Height());
00143             videoFrameHeight = static_cast<int>(previewProperties.Width());
00144         }
00145
00146         // Create the video frame to request a SoftwareBitmap preview frame.
00147         VideoFrame videoFrame(BitmapPixelFormat::Bgra8, videoFrameWidth, videoFrameHeight);
00148
00149         // Capture the preview frame.
00150
00151         auto currentFrame{ co_await mediaCapture.GetPreviewFrameAsync(videoFrame) };
00152
00153         // Collect the resulting frame.
00154         SoftwareBitmap bitmap = currentFrame.SoftwareBitmap();
00155
00156         OcrEngine ocrEngine = OcrEngine::TryCreateFromLanguage(ocrLanguage);
00157
00158         if (ocrEngine == nullptr)
00159         {
00160             rootPage.NotifyUser(ocrLanguage.DisplayName() + L" is not supported.", NotifyType::ErrorMessage);
00161
00162             co_return;
00163         }
00164
00165         WriteableBitmap imgSource(bitmap.PixelWidth(), bitmap.PixelHeight());
00166         bitmap.CopyToBuffer(imgSource.PixelBuffer());
00167         PreviewImage().Source(imgSource);
00168
00169         auto ocrResult = co_await ocrEngine.RecognizeAsync(bitmap);
00170
00171         // Used for text overlay.
00172         // Prepare scale transform for words since image is not displayed in original format.
00173         ScaleTransform scaleTransform;
00174
00175         scaleTransform.CenterX(0);
00176         scaleTransform.CenterY(0);
00177         scaleTransform.ScaleX(PreviewControl().ActualWidth() / bitmap.PixelWidth());
00178         scaleTransform.ScaleY(PreviewControl().ActualHeight() / bitmap.PixelHeight());
00179
00180         auto angle = unbox_value_or<double>(ocrResult.TextAngle(), 0.0);
00181         if (angle != 0.0)
00182         {
00183             // If text is detected under some angle in this sample scenario we want to
00184             // overlay word boxes over original image, so we rotate overlay boxes.
00185             RotateTransform rtTemp;
00186             rtTemp.Angle(angle);
00187             rtTemp.CenterX(PreviewImage().ActualWidth() / 2);
00188             rtTemp.CenterY(PreviewImage().ActualHeight() / 2);
00189
00190             TextOverlay().RenderTransform() = rtTemp;
00191         }
00192
00193         // Iterate over recognized lines of text.
00194         for (auto&& line : ocrResult.Lines())
00195         {
00196             // Iterate over words in line.
00197             for (auto&& word : line.Words())
00198             {
00199                 com_ptr<WordOverlay> wordBoxOverlay = make_self<WordOverlay>(word);
00200
00201                 // Keep references to word boxes.
00202                 wordBoxes.push_back(wordBoxOverlay);
00203
00204                 // Create a box with the word inside it.
00205                 TextBlock wordTextBlock;
00206                 wordTextBlock.Text(word.Text());
00207                 wordTextBlock.Style(ExtractedWordTextStyle());
00208                 TextOverlay().Children().Append(wordBoxOverlay->CreateBorder(HighlightedWordBoxHorizontalLineStyle(), wordTextBlock));
00209             }
00210         }
00211
00212         rootPage.NotifyUser(L"Image processed using " + ocrEngine.RecognizerLanguage().DisplayName() + L" language.", NotifyType::StatusMessage);
00213
00214         currentFrame.Close();
00215
00216         UpdateWordBoxTransform();
00217
00218         PreviewControl().Visibility(Visibility::Collapsed);
00219         Image().Visibility(Visibility::Visible);
00220         ExtractButton().Visibility(Visibility::Collapsed);
00221         CameraButton().Visibility(Visibility::Visible);
00222     }
00223
00224     /// <summary>
00225     /// This is event handler for 'Camera' button.
00226     /// Clears previous OCR results and starts camera.
00227     /// </summary>
00228     /// <param name="sender"></param>
00229     /// <param name="e"></param>
00230     fire_and_forget OcrCapturedImage::CameraButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e)
00231     {
00232         auto lifetime = get_strong();
00233
00234         co_await StartCameraAsync();
00235     }
00236
00237     /// <summary>
00238     ///  Update word box transform to match current UI size.
00239     /// </summary>
00240     void OcrCapturedImage::UpdateWordBoxTransform()
00241     {
00242         WriteableBitmap bitmap = PreviewImage().Source().as<WriteableBitmap>();
00243
00244         if (bitmap != nullptr)
00245         {
00246             // Used for text overlay.
00247             // Prepare scale transform for words since image is not displayed in original size.
00248             ScaleTransform scaleTransform;
00249             scaleTransform.CenterX(0);
00250             scaleTransform.CenterY(0);
00251             scaleTransform.ScaleX(PreviewImage().ActualWidth() / bitmap.PixelWidth());
00252             scaleTransform.ScaleY(PreviewImage().ActualHeight() / bitmap.PixelHeight());
00253
00254             for (auto&& item : wordBoxes)
00255             {
00256                 item->Transform(scaleTransform);
00257             }
00258         }
00259     }
00260
00261     /// <summary>
00262     /// Occurs when displayed image size changes.
00263     /// </summary>
00264     /// <param name="sender"></param>
00265     /// <param name="e"></param>
00266     void OcrCapturedImage::PreviewImage_SizeChanged(IInspectable const&, SizeChangedEventArgs const&)
00267     {
00268         UpdateWordBoxTransform();
00269
00270         // Update image rotation center.
00271         auto rotate = TextOverlay().RenderTransform().try_as<RotateTransform>();
00272
00273         if (rotate != nullptr)
00274         {
00275             rotate.CenterX(PreviewImage().ActualWidth() / 2);
00276             rotate.CenterY(PreviewImage().ActualHeight() / 2);
00277         }
00278     }
00279
00280
00281 #pragma region MediaCapture methods
00282
00283     /// <summary>
00284     /// Starts the camera. Initializes resources and starts preview.
00285     /// </summary>
00286     Windows::Foundation::IAsyncAction OcrCapturedImage::StartCameraAsync()
00287     {
00288         auto lifetime = get_strong();
00289
00290         if (!isInitialized)
00291         {
00292             co_await InitializeCameraAsync();
00293         }
00294
00295         if (isInitialized)
00296         {
00297             TextOverlay().Children().Clear();
00298             wordBoxes.clear();
00299
00300             PreviewImage().Source(nullptr);
00301
00302             PreviewControl().Visibility(Visibility::Visible);
00303             Image().Visibility(Visibility::Collapsed);
00304
00305             ExtractButton().Visibility(Visibility::Visible);
00306             CameraButton().Visibility(Visibility::Collapsed);
00307
00308             rootPage.NotifyUser(L"Camera started.", NotifyType::StatusMessage);
00309         }
00310     }
00311
00312     /// <summary>
00313     /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview.
00314     /// </summary>
00315     IAsyncAction OcrCapturedImage::InitializeCameraAsync()
00316     {
00317         auto lifetime = get_strong();
00318
00319         if (mediaCapture == nullptr)
00320         {
00321             // Attempt to get the back camera if one is available, but use any camera device if not.
00322             auto cameraDevice = co_await FindCameraDeviceByPanelAsync(winrt::Windows::Devices::Enumeration::Panel::Back);
00323
00324             if (cameraDevice == nullptr)
00325             {
00326                 rootPage.NotifyUser(L"No camera device!", NotifyType::ErrorMessage);
00327
00328                 co_return;
00329             }
00330
00331             // Create MediaCapture and its settings.
00332             mediaCapture = MediaCapture();
00333
00334             // Register for a notification when something goes wrong
00335             mediaCaptureFailedToken = mediaCapture.Failed({ get_weak(), &OcrCapturedImage::MediaCapture_Failed });
00336
00337             MediaCaptureInitializationSettings settings;
00338             settings.VideoDeviceId(cameraDevice.Id());
00339
00340             // Initialize MediaCapture
00341             try
00342             {
00343                 co_await mediaCapture.InitializeAsync(settings);
00344                 isInitialized = true;
00345             }
00346             catch (winrt::hresult_access_denied const&)
00347             {
00348                 rootPage.NotifyUser(L"Denied access to the camera.", NotifyType::ErrorMessage);
00349             }
00350             catch (winrt::hresult_error const& e)
00351             {
00352                 rootPage.NotifyUser(L"Exception when init MediaCapture. " + e.message(), NotifyType::ErrorMessage);
00353             }
00354
00355             // If initialization succeeded, start the preview.
00356             if (isInitialized)
00357             {
00358                 // Figure out where the camera is located
00359                 if (cameraDevice.EnclosureLocation() == nullptr || cameraDevice.EnclosureLocation().Panel() == winrt::Windows::Devices::Enumeration::Panel::Unknown)
00360                 {
00361                     // No information on the location of the camera, assume it's an external camera, not integrated on the device.
00362                     externalCamera = true;
00363                 }
00364                 else
00365                 {
00366                     // Camera is fixed on the device.
00367                     externalCamera = false;
00368
00369                     // Only mirror the preview if the camera is on the front panel.
00370                     mirroringPreview = (cameraDevice.EnclosureLocation().Panel() == winrt::Windows::Devices::Enumeration::Panel::Front);
00371                 }
00372
00373                 co_await StartPreviewAsync();
00374             }
00375         }
00376     }
00377
00378     /// <summary>
00379     /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI.
00380     /// </summary>
00381     IAsyncAction OcrCapturedImage::StartPreviewAsync()
00382     {
00383         auto lifetime = get_strong();
00384
00385         // Prevent the device from sleeping while the preview is running.
00386         displayRequest.RequestActive();
00387
00388         // Set the preview source in the UI and mirror it if necessary.
00389         PreviewControl().Source(mediaCapture);
00390         PreviewControl().FlowDirection(mirroringPreview ? Windows::UI::Xaml::FlowDirection::RightToLeft : Windows::UI::Xaml::FlowDirection::LeftToRight);
00391
00392         // Start the preview.
00393         try
00394         {
00395             co_await mediaCapture.StartPreviewAsync();
00396             isPreviewing = true;
00397         }
00398         catch (winrt::hresult_error const& ex)
00399         {
00400             rootPage.NotifyUser(L"Exception starting preview." + ex.message(), NotifyType::ErrorMessage);
00401         }
00402
00403         // Initialize the preview to the current orientation.
00404         if (isPreviewing)
00405         {
00406             co_await SetPreviewRotationAsync();
00407         }
00408     }
00409
00410     /// <summary>
00411     /// Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview.
00412     /// </summary>
00413     IAsyncAction OcrCapturedImage::SetPreviewRotationAsync()
00414     {
00415         auto lifetime = get_strong();
00416
00417         // Only need to update the orientation if the camera is mounted on the device.
00418         if (externalCamera) co_return;
00419
00420         // Calculate which way and how far to rotate the preview.
00421         auto [sourceRotation, rotationDegrees] = CalculatePreviewRotation();
00422
00423         // Set preview rotation in the preview source.
00424         mediaCapture.SetPreviewRotation(sourceRotation);
00425
00426         // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
00427         auto props = mediaCapture.VideoDeviceController().GetMediaStreamProperties(MediaStreamType::VideoPreview);
00428         props.Properties().Insert(RotationKey, box_value(rotationDegrees));
00429         co_await mediaCapture.SetEncodingPropertiesAsync(MediaStreamType::VideoPreview, props, nullptr);
00430     }
00431
00432     /// <summary>
00433     /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI
00434     /// </summary>
00435     /// <returns></returns>
00436     IAsyncAction OcrCapturedImage::StopPreviewAsync()
00437     {
00438         auto lifetime = get_strong();
00439
00440         try
00441         {
00442             isPreviewing = false;
00443             co_await mediaCapture.StopPreviewAsync();
00444         }
00445         catch (winrt::hresult_error const& ex)
00446         {
00447             rootPage.NotifyUser(L"Exception stopping preview. " + ex.message(), NotifyType::ErrorMessage);
00448         }
00449
00450         // Use the dispatcher because this method is sometimes called from non-UI threads.
00451         co_await resume_foreground(Dispatcher());
00452
00453         PreviewControl().Source(nullptr);
00454
00455         // Allow the device to sleep now that the preview is stopped.
00456         displayRequest.RequestRelease();
00457     }
00458
00459     /// <summary>
00460     /// Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events.
00461     /// </summary>
00462     IAsyncAction OcrCapturedImage::CleanupCameraAsync()
00463     {
00464         auto lifetime = get_strong();
00465
00466         if (isInitialized)
00467         {
00468             if (isPreviewing)
00469             {
00470                 // The call to stop the preview is included here for completeness, but can be
00471                 // safely removed if a call to MediaCapture.Dispose() is being made later,
00472                 // as the preview will be automatically stopped at that point
00473                 co_await StopPreviewAsync();
00474             }
00475
00476             isInitialized = false;
00477         }
00478
00479         if (mediaCapture != nullptr)
00480         {
00481             mediaCapture.Failed(mediaCaptureFailedToken);
00482             mediaCapture.Close();
00483             mediaCapture = nullptr;
00484         }
00485     }
00486
00487     /// <summary>
00488     /// Queries the available video capture devices to try and find one mounted on the desired panel.
00489     /// </summary>
00490     /// <param name="desiredPanel">The panel on the device that the desired camera is mounted on.</param>
00491     /// <returns>A DeviceInformation instance with a reference to the camera mounted on the desired panel if available,
00492     ///          any other camera if not, or null if no camera is available.</returns>
00493     IAsyncOperation<DeviceInformation> OcrCapturedImage::FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel desiredPanel)
00494     {
00495         auto lifetime = get_strong();
00496
00497         // Get available devices for capturing pictures.
00498         auto allVideoDevices = co_await DeviceInformation::FindAllAsync(DeviceClass::VideoCapture);
00499
00500         // Get the desired camera by panel
00501         for (auto&& device : allVideoDevices)
00502         {
00503             if (device.EnclosureLocation() != nullptr && device.EnclosureLocation().Panel() == desiredPanel)
00504             {
00505                 co_return device;
00506             }
00507         }
00508
00509         // If there is no device mounted on the desired panel, return the first device found, if any.
00510         co_return allVideoDevices.Size() == 0 ? nullptr : allVideoDevices.GetAt(0);
00511     }
00512
00513     /// <summary>
00514     /// Reads the current orientation of the app and calculates the VideoRotation necessary to ensure the preview is rendered in the correct orientation.
00515     /// </summary>
00516     /// <returns>The rotation value to use in MediaCapture.SetPreviewRotation, and the accompanying rotation metadata with which to tag the preview stream.</returns>
00517     std::pair<VideoRotation, int> OcrCapturedImage::CalculatePreviewRotation()
00518     {
00519         VideoRotation sourceRotation;
00520         int rotationDegrees;
00521
00522         // Note that in some cases, the rotation direction needs to be inverted if the preview is being mirrored.
00523         switch (displayInformation.CurrentOrientation())
00524         {
00525         case DisplayOrientations::Portrait:
00526             if (mirroringPreview)
00527             {
00528                 rotationDegrees = 270;
00529                 sourceRotation = VideoRotation::Clockwise270Degrees;
00530             }
00531             else
00532             {
00533                 rotationDegrees = 90;
00534                 sourceRotation = VideoRotation::Clockwise90Degrees;
00535             }
00536             break;
00537
00538         case DisplayOrientations::LandscapeFlipped:
00539             // No need to invert this rotation, as rotating 180 degrees is the same either way.
00540             rotationDegrees = 180;
00541             sourceRotation = VideoRotation::Clockwise180Degrees;
00542             break;
00543
00544         case DisplayOrientations::PortraitFlipped:
00545             if (mirroringPreview)
00546             {
00547                 rotationDegrees = 90;
00548                 sourceRotation = VideoRotation::Clockwise90Degrees;
00549             }
00550             else
00551             {
00552                 rotationDegrees = 270;
00553                 sourceRotation = VideoRotation::Clockwise270Degrees;
00554             }
00555             break;
00556
00557         case DisplayOrientations::Landscape:
00558         default:
00559             rotationDegrees = 0;
00560             sourceRotation = VideoRotation::None;
00561             break;
00562         }
00563
00564         return { sourceRotation, rotationDegrees };
00565     }
00566
00567     /// <summary>
00568     /// Handles MediaCapture failures. Cleans up the camera resources.
00569     /// </summary>
00570     /// <param name="sender"></param>
00571     /// <param name="errorEventArgs"></param>
00572     fire_and_forget OcrCapturedImage::MediaCapture_Failed(MediaCapture const&, MediaCaptureFailedEventArgs const& errorEventArgs)
00573     {
00574         auto lifetime = get_strong();
00575
00576         co_await CleanupCameraAsync();
00577
00578         co_await resume_foreground(Dispatcher());
00579
00580         ExtractButton().Visibility(Visibility::Collapsed);
00581         CameraButton().Visibility(Visibility::Visible);
00582
00583         rootPage.NotifyUser(L"MediaCapture Failed. " + errorEventArgs.Message(), NotifyType::ErrorMessage);
00584     }
00585
00586 #pragma endregion MediaCapture
00587 }
Generated on Fri Nov 15 2024 22:20:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cs/Scenario3_Flickr.xaml.cs Source File

  • WebAuthenticationBroker
  • cs

Scenario3_Flickr.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.Security.Authentication.Web;
00016 using Windows.Security.Cryptography;
00017 using Windows.Security.Cryptography.Core;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.Web.Http;
00022
00023 namespace WebAuthentication
00024 {
00025     public sealed partial class Scenario3_Flickr : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario3_Flickr()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private async Task<string> SendDataAsync(String Url)
00035         {
00036             HttpClient httpClient = new HttpClient();
00037             HttpGetStringResult result = await httpClient.TryGetStringAsync(new Uri(Url));
00038             if (result.Succeeded)
00039             {
00040                 return result.Value;
00041             }
00042             else
00043             {
00044                 rootPage.NotifyUser("Error getting data from server." + result.ExtendedError.Message, NotifyType.StatusMessage);
00045                 return null;
00046             }
00047         }
00048
00049         private void OutputToken(String TokenUri)
00050         {
00051             FlickrReturnedToken.Text = TokenUri;
00052         }
00053
00054         private async void Launch_Click(object sender, RoutedEventArgs e)
00055         {
00056             if (FlickrClientID.Text == "")
00057             {
00058                 rootPage.NotifyUser("Please enter an Client ID.", NotifyType.StatusMessage);
00059             }
00060             else if (FlickrCallbackUrl.Text == "")
00061             {
00062                 rootPage.NotifyUser("Please enter an Callback URL.", NotifyType.StatusMessage);
00063             }
00064             else if (FlickrClientSecret.Text == "")
00065             {
00066                 rootPage.NotifyUser("Please enter an Client Secret.", NotifyType.StatusMessage);
00067             }
00068
00069             try
00070             {
00071                 // Acquiring a request token
00072                 TimeSpan SinceEpoch = DateTime.UtcNow - new DateTime(1970, 1, 1);
00073                 Random Rand = new Random();
00074                 String FlickrUrl = "https://secure.flickr.com/services/oauth/request_token";
00075                 Int32 Nonce = Rand.Next(1000000000);
00076
00077                 // Compute base signature string and sign it.
00078                 // This is a common operation that is required for all requests even after the token is obtained.
00079                 // Parameters need to be sorted in alphabetical order
00080                 // Keys and values should be URL Encoded.
00081                 String SigBaseStringParams = "oauth_callback=" + Uri.EscapeDataString(FlickrCallbackUrl.Text);
00082                 SigBaseStringParams += "&" + "oauth_consumer_key=" + FlickrClientID.Text;
00083                 SigBaseStringParams += "&" + "oauth_nonce=" + Nonce.ToString();
00084                 SigBaseStringParams += "&" + "oauth_signature_method=HMAC-SHA1";
00085                 SigBaseStringParams += "&" + "oauth_timestamp=" + Math.Round(SinceEpoch.TotalSeconds);
00086                 SigBaseStringParams += "&" + "oauth_version=1.0";
00087                 String SigBaseString = "GET&";
00088                 SigBaseString += Uri.EscapeDataString(FlickrUrl) + "&" + Uri.EscapeDataString(SigBaseStringParams);
00089
00090                 IBuffer KeyMaterial = CryptographicBuffer.ConvertStringToBinary(FlickrClientSecret.Text + "&", BinaryStringEncoding.Utf8);
00091                 MacAlgorithmProvider HmacSha1Provider = MacAlgorithmProvider.OpenAlgorithm("HMAC_SHA1");
00092                 CryptographicKey MacKey = HmacSha1Provider.CreateKey(KeyMaterial);
00093                 IBuffer DataToBeSigned = CryptographicBuffer.ConvertStringToBinary(SigBaseString, BinaryStringEncoding.Utf8);
00094                 IBuffer SignatureBuffer = CryptographicEngine.Sign(MacKey, DataToBeSigned);
00095                 String Signature = CryptographicBuffer.EncodeToBase64String(SignatureBuffer);
00096
00097                 FlickrUrl += "?" + SigBaseStringParams + "&oauth_signature=" + Uri.EscapeDataString(Signature);
00098                 string GetResponse = await SendDataAsync(FlickrUrl);
00099                 rootPage.NotifyUser("Received Data: " + GetResponse, NotifyType.StatusMessage);
00100
00101
00102                 if (GetResponse != null)
00103                 {
00104                     String oauth_token = null;
00105                     String oauth_token_secret = null;
00106                     String[] keyValPairs = GetResponse.Split('&');
00107
00108                     for (int i = 0; i < keyValPairs.Length; i++)
00109                     {
00110                         String[] splits = keyValPairs[i].Split('=');
00111                         switch (splits[0])
00112                         {
00113                             case "oauth_token":
00114                                 oauth_token = splits[1];
00115                                 break;
00116                             case "oauth_token_secret":
00117                                 oauth_token_secret = splits[1];
00118                                 break;
00119                         }
00120                     }
00121
00122                     if (oauth_token != null)
00123                     {
00124
00125                         FlickrUrl = "https://secure.flickr.com/services/oauth/authorize?oauth_token=" + oauth_token + "&perms=read";
00126                         System.Uri StartUri = new Uri(FlickrUrl);
00127                         System.Uri EndUri = new Uri(FlickrCallbackUrl.Text);
00128
00129                         rootPage.NotifyUser("Navigating to: " + FlickrUrl, NotifyType.StatusMessage);
00130                         WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
00131                                                                 WebAuthenticationOptions.None,
00132                                                                 StartUri,
00133                                                                 EndUri);
00134                         if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
00135                         {
00136                             OutputToken(WebAuthenticationResult.ResponseData.ToString());
00137                         }
00138                         else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
00139                         {
00140                             OutputToken("HTTP Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseErrorDetail.ToString());
00141                         }
00142                         else
00143                         {
00144                             OutputToken("Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseStatus.ToString());
00145                         }
00146                     }
00147                 }
00148             }
00149             catch (Exception Error)
00150             {
00151                 rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
00152             }
00153         }
00154     }
00155 }
Generated on Fri Nov 15 2024 22:21:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/SampleConfiguration.cs Source File

  • XmlDocument
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Media;
00017 using Xml;
00018
00019 namespace SDKTemplate
00020 {
00021     public partial class MainPage : Page
00022     {
00023         public const string FEATURE_NAME = "XML document sample";
00024
00025         List<Scenario> scenarios = new List<Scenario>
00026         {
00027             new Scenario() { Title = "Build New RSS", ClassType = typeof(Xml.BuildNewRss) },
00028             new Scenario() { Title = "DOM Load/Save", ClassType = typeof(Xml.MarkHotProducts) },
00029             new Scenario() { Title = "Set Load Settings", ClassType = typeof(Xml.XmlLoading) },
00030             new Scenario() { Title = "XPath Query", ClassType = typeof(Xml.GiftDispatch) },
00031             new Scenario() { Title = "XSLT Transformation", ClassType = typeof(Xml.XSLTTransform) }
00032         };
00033     }
00034
00035     public class Scenario
00036     {
00037         public string Title { get; set; }
00038         public Type ClassType { get; set; }
00039
00040
00041         public override string ToString()
00042         {
00043             return Title;
00044         }
00045
00046         public static async Task<Windows.Data.Xml.Dom.XmlDocument> LoadXmlFile(String folder, String file)
00047         {
00048             Windows.Storage.StorageFolder storageFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(folder);
00049             Windows.Storage.StorageFile storageFile = await storageFolder.GetFileAsync(file);
00050             Windows.Data.Xml.Dom.XmlLoadSettings loadSettings = new Windows.Data.Xml.Dom.XmlLoadSettings();
00051             loadSettings.ProhibitDtd = false;
00052             loadSettings.ResolveExternals = false;
00053             return await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(storageFile, loadSettings);
00054         }
00055
00056         public static void RichEditBoxSetText(RichEditBox richEditBox, String msg, Windows.UI.Color color, bool fReadOnly)
00057         {
00058             richEditBox.IsReadOnly = false;
00059             richEditBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, msg);
00060             richEditBox.Foreground = new SolidColorBrush(color);
00061             richEditBox.IsReadOnly = fReadOnly;
00062         }
00063
00064         public static void RichEditBoxSetError(RichEditBox richEditBox, String errorMsg)
00065         {
00066             RichEditBoxSetText(richEditBox, errorMsg, Windows.UI.Colors.Red, true);
00067         }
00068
00069         public static void RichEditBoxSetMsg(RichEditBox richEditBox, String msg, bool fReadOnly)
00070         {
00071             RichEditBoxSetText(richEditBox, msg, Windows.UI.Colors.White, fReadOnly);
00072         }
00073     }
00074 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceWatcherHelper Member List

This is the complete list of members for DeviceWatcherHelper, including all inherited members.
DeviceChanged | DeviceWatcherHelper |
DeviceChangedHandler(DeviceWatcher deviceWatcher, string id) | DeviceWatcherHelper |
DeviceWatcher | DeviceWatcherHelper |
deviceWatcher | DeviceWatcherHelper | [private]
DeviceWatcherHelper(ObservableCollection< DeviceInformationDisplay > resultCollection, CoreDispatcher dispatcher) | DeviceWatcherHelper | [inline]
dispatcher | DeviceWatcherHelper | [private]
IsWatcherRunning() | DeviceWatcherHelper | [inline]
IsWatcherStarted(DeviceWatcher watcher) | DeviceWatcherHelper | [inline, private, static]
RaiseDeviceChanged(DeviceWatcher sender, string id) | DeviceWatcherHelper | [inline, private]
Reset() | DeviceWatcherHelper | [inline]
resultCollection | DeviceWatcherHelper | [private]
StartWatcher(DeviceWatcher deviceWatcher) | DeviceWatcherHelper | [inline]
StopWatcher() | DeviceWatcherHelper | [inline]
UpdateStatus | DeviceWatcherHelper |
Watcher_DeviceAdded(DeviceWatcher sender, DeviceInformation deviceInfo) | DeviceWatcherHelper | [inline, private]
Watcher_DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate) | DeviceWatcherHelper | [inline, private]
Watcher_DeviceUpdated(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate) | DeviceWatcherHelper | [inline, private]
Watcher_EnumerationCompleted(DeviceWatcher sender, object obj) | DeviceWatcherHelper | [inline, private]
Watcher_Stopped(DeviceWatcher sender, object obj) | DeviceWatcherHelper | [inline, private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/MainPage.xaml.h Source File

  • BackButton
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MainPage.g.h"
00015 #include "SampleConfiguration.h"
00016
00017 namespace SDKTemplate
00018 {
00019     public enum class NotifyType
00020     {
00021         StatusMessage,
00022         ErrorMessage
00023     };
00024
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public ref class MainPage sealed
00029     {
00030     public:
00031         MainPage();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035
00036     private:
00037         void ScenarioControl_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00038         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040
00041     internal:
00042         static MainPage^ Current;
00043         void NotifyUser(Platform::String^ strMessage, NotifyType type);
00044     };
00045 }
Generated on Fri Nov 15 2024 22:17:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cs/CaptureDevice.cs Source File

  • SimpleCommunication
  • cs

CaptureDevice.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Microsoft.Samples.SimpleCommunication;
00012 using System;
00013 using System.Linq;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.Enumeration;
00016 using Windows.Media.Capture;
00017 using Windows.Media.MediaProperties;
00018
00019 namespace SimpleCommunication
00020 {
00021     internal class CaptureDevice
00022     {
00023         // Media capture object
00024         private MediaCapture mediaCapture;
00025         // Custom media sink
00026         private StspMediaSinkProxy mediaSink;
00027         // Flag indicating if recording to custom sink has started
00028         private bool recordingStarted = false;
00029         private bool forwardEvents = false;
00030
00031         // Wraps the capture failed and media sink incoming connection events
00032         public event EventHandler<IncomingConnectionEventArgs> IncomingConnectionArrived;
00033         public event EventHandler<MediaCaptureFailedEventArgs> CaptureFailed;
00034
00035         public CaptureDevice() { }
00036
00037         /// <summary>
00038         ///  Handler for the wrapped MediaCapture object's Failed event. It just wraps and forward's MediaCapture's
00039         ///  Failed event as own CaptureFailed event
00040         /// </summary>
00041         private void mediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
00042         {
00043             if (CaptureFailed != null && forwardEvents) CaptureFailed(this, errorEventArgs);
00044         }
00045
00046         /// <summary>
00047         /// Handler for the wrapped media sink object's IncomingConnectionEvent. Expose the wrapped event to
00048         /// listeners as own IncomingConnectionArrived event.
00049         /// </summary>
00050         private void mediaSink_IncomingConnectionEvent(object sender, object args)
00051         {
00052             if (IncomingConnectionArrived != null && forwardEvents) IncomingConnectionArrived((StspMediaSinkProxy)sender, (IncomingConnectionEventArgs)args);
00053         }
00054
00055         /// <summary>
00056         /// Cleans up the resources.
00057         /// </summary>
00058         private void CleanupSink()
00059         {
00060             if (mediaSink != null)
00061             {
00062                 mediaSink.IncomingConnectionEvent -= mediaSink_IncomingConnectionEvent;
00063                 mediaSink.Dispose();
00064                 mediaSink = null;
00065                 recordingStarted = false;
00066             }
00067         }
00068
00069         private void DoCleanup()
00070         {
00071             if (mediaCapture != null)
00072             {
00073                 mediaCapture.Failed -= mediaCapture_Failed;
00074                 mediaCapture = null;
00075             }
00076
00077             CleanupSink();
00078         }
00079
00080         public async Task InitializeAsync()
00081         {
00082             try
00083             {
00084                 forwardEvents = true;
00085
00086                 if (mediaCapture != null)
00087                 {
00088                     throw new InvalidOperationException("Camera is already initialized");
00089                 }
00090
00091                 mediaCapture = new MediaCapture();
00092                 mediaCapture.Failed += mediaCapture_Failed;
00093
00094                 await mediaCapture.InitializeAsync();
00095             }
00096             catch (Exception e)
00097             {
00098                 DoCleanup();
00099                 throw e;
00100             }
00101         }
00102
00103         /// <summary>
00104         /// Asynchronous method cleaning up resources and stopping recording if necessary.
00105         /// </summary>
00106         public async Task CleanUpAsync()
00107         {
00108             try
00109             {
00110                 forwardEvents = true;
00111
00112                 if (mediaCapture == null && mediaSink == null) return;
00113
00114                 if (recordingStarted)
00115                 {
00116                     await mediaCapture.StopRecordAsync();
00117                 }
00118
00119                 DoCleanup();
00120             }
00121             catch (Exception)
00122             {
00123                 DoCleanup();
00124             }
00125         }
00126
00127         /// <summary>
00128         /// Creates url object from MediaCapture
00129         /// </summary>
00130         public MediaCapture CaptureSource
00131         {
00132             get { return mediaCapture; }
00133         }
00134
00135         /// <summary>
00136         /// Allow selection of camera settings.
00137         /// </summary>
00138         /// <param name="mediaStreamType" type="Windows.Media.Capture.MediaStreamType">
00139         /// Type of a the media stream.
00140         /// </param>
00141         /// <param name="filterSettings" type="Func<Windows.Media.MediaProperties.IMediaEncodingProperties, bool>">
00142         /// A predicate function, which will be called to filter the correct settings.
00143         /// </param>
00144         public async Task<IMediaEncodingProperties> SelectPreferredCameraStreamSettingAsync(MediaStreamType mediaStreamType, Func<IMediaEncodingProperties, bool> filterSettings)
00145         {
00146             IMediaEncodingProperties previewEncodingProperties = null;
00147
00148             if (mediaStreamType == MediaStreamType.Audio || mediaStreamType == MediaStreamType.Photo)
00149             {
00150                 throw new ArgumentException("mediaStreamType value of MediaStreamType.Audio or MediaStreamType.Photo is not supported", "mediaStreamType");
00151             }
00152             if (filterSettings == null)
00153             {
00154                 throw new ArgumentNullException("filterSettings");
00155             }
00156
00157             var properties = mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(mediaStreamType);
00158             var filterredProperties = properties.Where(filterSettings);
00159             var preferredSettings = filterredProperties.ToArray();
00160
00161             Array.Sort<IMediaEncodingProperties>(preferredSettings, (x, y) =>
00162             {
00163                 return (int)(((x as VideoEncodingProperties).Width) -
00164                     (y as VideoEncodingProperties).Width);
00165             });
00166
00167             if (preferredSettings.Length > 0)
00168             {
00169                 previewEncodingProperties = preferredSettings[0];
00170                 await mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(mediaStreamType, preferredSettings[0]);
00171             }
00172
00173             return previewEncodingProperties;
00174         }
00175
00176         /// <summary>
00177         /// Starts media recording asynchronously
00178         /// </summary>
00179         /// <param name="encodingProfile">
00180         /// Encoding profile used for the recording session
00181         /// </param>
00182         public async Task StartRecordingAsync(MediaEncodingProfile encodingProfile)
00183         {
00184             try
00185             {
00186                 // We cannot start recording twice.
00187                 if (mediaSink != null && recordingStarted)
00188                 {
00189                     throw new InvalidOperationException("Recording already started.");
00190                 }
00191
00192                 // Release sink if there is one already.
00193                 CleanupSink();
00194
00195                 // Create new sink
00196                 mediaSink = new StspMediaSinkProxy();
00197                 mediaSink.IncomingConnectionEvent += mediaSink_IncomingConnectionEvent;
00198
00199                 var mfExtension = await mediaSink.InitializeAsync(encodingProfile.Audio, encodingProfile.Video);
00200                 await mediaCapture.StartRecordToCustomSinkAsync(encodingProfile, mfExtension);
00201
00202                 recordingStarted = true;
00203             }
00204             catch (Exception e)
00205             {
00206                 CleanupSink();
00207                 throw e;
00208             }
00209         }
00210
00211         /// <summary>
00212         /// Stops recording asynchronously
00213         /// </summary>
00214         public async Task StopRecordingAsync()
00215         {
00216             if (recordingStarted)
00217             {
00218                 try
00219                 {
00220                     await mediaCapture.StopRecordAsync();
00221                     CleanupSink();
00222                 }
00223                 catch (Exception)
00224                 {
00225                     CleanupSink();
00226                 }
00227             }
00228         }
00229
00230         public static async Task<bool> CheckForRecordingDeviceAsync()
00231         {
00232             var cameraFound = false;
00233
00234             var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00235             if (devices.Count > 0)
00236             {
00237                 cameraFound = true;
00238             }
00239
00240             return cameraFound;
00241         }
00242     }
00243 }
Generated on Fri Nov 15 2024 22:21:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PropertySetContext Member List

This is the complete list of members for PropertySetContext, including all inherited members.
GetStatus() | PropertySetContext | [inline]
GetStatus() | PropertySetContext | [inline]
m_event | PropertySetContext | [private]
m_status | PropertySetContext | [private]
SetEvent() | PropertySetContext | [inline]
SetEvent() | PropertySetContext | [inline]
SetStatus(QStatus value) | PropertySetContext | [inline]
SetStatus(QStatus value) | PropertySetContext | [inline]
Wait() | PropertySetContext | [inline]
Wait() | PropertySetContext | [inline]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/CalibrationBar.xaml.h Source File

  • OrientationSensor
  • cpp

CalibrationBar.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // CalibrationBar.xaml.h
00014 // Declaration of the CalibrationBar class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "CalibrationBar.g.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class CalibrationBar sealed
00029     {
00030     public:
00031         CalibrationBar();
00032
00033         void Hide();
00034         void RequestCalibration(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00035
00036     private:
00037         // Constants specifying when the calibration bar is shown:
00038         //   * suppress duration determines how long (in ticks) to wait before
00039         //     showing the calibration bar again
00040         //   * auto dismiss time determines when to auto dismiss the bar
00041         //     if it's shown too long
00042         static const ULONGLONG SUPPRESS_DURATION_APPROXIMATE_TICKS = 6000000000; // 10 minutes
00043         static const ULONGLONG SUPPRESS_DURATION_UNRELIABLE_TICKS = 3000000000; // 5 minutes
00044         static const LONGLONG CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS = 300000000; // 30 seconds
00045
00046         ULARGE_INTEGER _lastCalibrationTime;
00047         bool _barDismissed;
00048         Windows::UI::Xaml::DispatcherTimer^ _calibrationTimer;
00049         Windows::Foundation::EventRegistrationToken _windowSizeEventToken;
00050
00051         void InvalidateLayout();
00052         bool CanShowCalibrationBar(Windows::Devices::Sensors::MagnetometerAccuracy accuracy);
00053         void ShowGuidance();
00054         void HideGuidance();
00055
00056         void ShowGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00057         void HideGuidanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00058         void DismissPopup_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00059         void OnAutoDismissTimerExpired(Platform::Object^ sender, Platform::Object^ e);
00060         void OnWindowSizeChanged(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
00061     };
00062 }
Generated on Fri Nov 15 2024 22:18:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario12.xaml.cs Source File

  • SimpleInk
  • cs

Scenario12.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     ///
00020     /// </summary>
00021     public sealed partial class Scenario12 : Page
00022     {
00023         public Scenario12()
00024         {
00025             this.InitializeComponent();
00026
00027             // Initialize the InkCanvas
00028             inkCanvas.InkPresenter.InputDeviceTypes =
00029                 Windows.UI.Core.CoreInputDeviceTypes.Mouse |
00030                 Windows.UI.Core.CoreInputDeviceTypes.Pen;
00031         }
00032
00033         private void OnDrawingAttributesChanged(InkToolbar sender, object args)
00034         {
00035             // Enable tilt support.
00036             sender.InkDrawingAttributes.IgnoreTilt = false;
00037             inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(sender.InkDrawingAttributes);
00038         }
00039
00040         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00041         {
00042             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00043         }
00044
00045
00046     }
00047 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario1_Basic.cpp Source File

  • ResizeAppView
  • cppwinrt

Scenario1_Basic.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Basic.h"
00014 #include "Scenario1_Basic.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::ViewManagement;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_Basic::Scenario1_Basic()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario1_Basic::OnNavigatedTo(NavigationEventArgs const&)
00030     {
00031         windowSizeChangedToken = Window::Current().SizeChanged([this](auto&&, auto&&)
00032         {
00033             UpdateContent();
00034         });
00035         UpdateContent();
00036     }
00037
00038     void Scenario1_Basic::OnNavigatedFrom(NavigationEventArgs const&)
00039     {
00040         Window::Current().SizeChanged(windowSizeChangedToken);
00041     }
00042
00043     void Scenario1_Basic::ResizeView_Click(IInspectable const&, RoutedEventArgs const&)
00044     {
00045         auto view = ApplicationView::GetForCurrentView();
00046         if (view.TryResizeView({ 600, 500 }))
00047         {
00048             rootPage.NotifyUser(L"Resizing to 600 \u00D7 500", NotifyType::StatusMessage);
00049             // The SizeChanged event will be raised when the resize is complete.
00050         }
00051         else
00052         {
00053             // The system does not support resizing, or the provided size is out of range.
00054             rootPage.NotifyUser(L"Failed to resize view", NotifyType::ErrorMessage);
00055         }
00056     }
00057
00058     void Scenario1_Basic::SetMinimumSize_Click(IInspectable const&, RoutedEventArgs const&)
00059     {
00060         auto view = ApplicationView::GetForCurrentView();
00061         if (SetMinimumSize().IsChecked().Value())
00062         {
00063             // If this size is not permitted by the system, the nearest permitted value is used.
00064             view.SetPreferredMinSize({ 300, 200 });
00065         }
00066         else
00067         {
00068             // Passing width = height = 0 returns to the default system behavior.
00069             view.SetPreferredMinSize({ 0, 0 });
00070         }
00071     }
00072
00073     void Scenario1_Basic::UpdateContent()
00074     {
00075         Rect bounds = Window::Current().Bounds();
00076         ReportViewWidth().Text(to_hstring(bounds.Width));
00077         ReportViewHeight().Text(to_hstring(bounds.Height));
00078     }
00079 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CubeModelConstantBuffer Member List

This is the complete list of members for CubeModelConstantBuffer, including all inherited members.
model CubeModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_TrialMode Member List

This is the complete list of members for Scenario1_TrialMode, including all inherited members.
GetLicenseState() | Scenario1_TrialMode | [inline, private]
OfflineLicensesChanged(StoreContext sender, object args) | Scenario1_TrialMode | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_TrialMode | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_TrialMode | [inline, protected]
PurchaseFullLicense() | Scenario1_TrialMode | [inline, private]
rootPage | Scenario1_TrialMode | [private]
Scenario1_TrialMode() | Scenario1_TrialMode | [inline]
ShowTrialPeriodInformation() | Scenario1_TrialMode | [inline, private]
storeContext | Scenario1_TrialMode | [private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cpp/Scenario1_Orientation.xaml.h Source File

  • DisplayOrientation
  • cpp

Scenario1_Orientation.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Orientation.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_Orientation sealed
00021     {
00022     public:
00023         Scenario1_Orientation();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028
00029     private:
00030         Windows::Graphics::Display::DisplayInformation^ displayInfo;
00031
00032         void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ e);
00033         static Platform::String^ OrientationsToString(Windows::Graphics::Display::DisplayOrientations orientations);
00034         void UpdateContent();
00035         void ApplyRotationLock_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036
00037         Windows::Foundation::EventRegistrationToken orientationChangedToken;
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Pinning/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Pinning

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Popups;
00003 using Windows.UI.StartScreen;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.LiveTiles.Pinning
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private async void ButtonPin_Click(object sender, RoutedEventArgs e)
00022         {
00023             ButtonPin.IsEnabled = false;
00024
00025             try
00026             {
00027                 SecondaryTile tile = new SecondaryTile(DateTime.Now.Ticks.ToString());
00028                 tile.Arguments = "args";
00029
00030                 tile.DisplayName = TextBoxDisplayName.Text;
00031
00032                 if (CheckBoxSquare150x150Logo.IsChecked.Value)
00033                     tile.VisualElements.Square150x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png");
00034
00035                 if (CheckBoxSquare71x71Logo.IsChecked.Value)
00036                     tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00037
00038                 if (CheckBoxWide310x150Logo.IsChecked.Value)
00039                     tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00040
00041                 if (CheckBoxSquare310x310Logo.IsChecked.Value)
00042                     tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00043
00044                 tile.VisualElements.ShowNameOnSquare150x150Logo = CheckBoxShowNameOnSquare150x150Logo.IsChecked.Value;
00045                 tile.VisualElements.ShowNameOnSquare310x310Logo = CheckBoxShowNameOnSquare310x310Logo.IsChecked.Value;
00046                 tile.VisualElements.ShowNameOnWide310x150Logo = CheckBoxShowNameOnWide310x150Logo.IsChecked.Value;
00047
00048                 await tile.RequestCreateAsync();
00049             }
00050
00051             catch (Exception ex)
00052             {
00053                 await new MessageDialog(ex.ToString(), "Error").ShowAsync();
00054             }
00055
00056             ButtonPin.IsEnabled = true;
00057         }
00058     }
00059 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/pch.cpp Source File

  • FolderEnumeration
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/WordOverlay.cpp Source File

  • OCR
  • cpp

WordOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "WordOverlay.h"
00014
00015 using namespace SDKTemplate;
00016
00017 WordOverlay::WordOverlay(OcrWord^ ocrWord) :
00018     word(ocrWord),
00019     isPropertyChangedObserved(false)
00020 {
00021     UpdateProps(word->BoundingRect);
00022 }
00023
00024 void WordOverlay::Transform(ScaleTransform^ transform)
00025 {
00026     // Scale word box bounding rect and update properties.
00027     UpdateProps(transform->TransformBounds(word->BoundingRect));
00028 }
00029
00030 void WordOverlay::UpdateProps(Rect boundingBox)
00031 {
00032     wordPosition = *(ref new Thickness(boundingBox.Left, boundingBox.Top, 0, 0));
00033     wordWidth = boundingBox.Width;
00034     wordHeight = boundingBox.Height;
00035
00036     OnPropertyChanged("WordPosition");
00037     OnPropertyChanged("WordWidth");
00038     OnPropertyChanged("WordHeight");
00039 }
00040
00041 /// <summary>
00042 /// Notifies listeners that a property value has changed.
00043 /// </summary>
00044 /// <param name="propertyName">Name of the property used to notify listeners.</param>
00045 void WordOverlay::OnPropertyChanged(Platform::String^ propertyName)
00046 {
00047     if (isPropertyChangedObserved)
00048     {
00049         PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
00050     }
00051 }
00052
00053 Binding^ WordOverlay::CreateWordPositionBinding()
00054 {
00055     Binding^ positionBinding = ref new Binding();
00056     positionBinding->Path = ref new PropertyPath("WordPosition");
00057     positionBinding->Source = this;
00058
00059     return positionBinding;
00060 }
00061
00062 Binding^ WordOverlay::CreateWordWidthBinding()
00063 {
00064     Binding^ widthBinding = ref new Binding();
00065     widthBinding->Path = ref new PropertyPath("WordWidth");
00066     widthBinding->Source = this;
00067
00068     return widthBinding;
00069 }
00070
00071 Binding^ WordOverlay::CreateWordHeightBinding()
00072 {
00073     Binding^ heightBinding = ref new Binding();
00074     heightBinding->Path = ref new PropertyPath("WordHeight");
00075     heightBinding->Source = this;
00076
00077     return heightBinding;
00078 }
Generated on Fri Nov 15 2024 22:20:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/FxCompile.cs Source File

  • 360VideoPlayback
  • cs

FxCompile.cs

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------
00002 // <copyright file="FxCompile.cs" company="Microsoft">
00003 // Copyright (C) Microsoft Corporation. All rights reserved.
00004 // </copyright>
00005 //-----------------------------------------------------------------------
00006
00007 using Microsoft.Build.Framework;
00008 using System;
00009 using System.Collections;
00010 using System.Collections.Generic;
00011 using System.Linq;
00012 using System.Text;
00013 using System.Threading.Tasks;
00014 using Microsoft.Build.Utilities;
00015
00016 namespace Microsoft.Build.Tasks
00017 {
00018     /// <summary>
00019     /// Task to support Fxc.exe
00020     /// </summary>
00021     public class FxCompile : ToolTask
00022     {
00023         /// <summary>
00024         /// Constructor
00025         /// </summary>
00026         public FxCompile()
00027         {
00028             // Because FxCop wants it this way.
00029         }
00030
00031         #region Inputs
00032
00033         /// <summary>
00034         /// Sources to be compiled.
00035         /// </summary>
00036         /// <remarks>Required for task to run.</remarks>
00037         [Required]
00038         public virtual ITaskItem[] Source
00039         {
00040             get { return (ITaskItem[])Bag["Sources"]; }
00041             set { Bag["Sources"] = value; }
00042         }
00043
00044         /// <summary>
00045         /// Gets the collection of parameters used by the derived task class.
00046         /// </summary>
00047         /// <value>Parameter bag.</value>
00048         protected internal Hashtable Bag
00049         {
00050             get
00051             {
00052                 return bag;
00053             }
00054         }
00055
00056         private Hashtable bag = new Hashtable();
00057
00058         /// <summary>
00059         /// ShaderType, requires ShaderModel
00060         /// Specifies the type of shader.  (/T [type]_[model])
00061         /// </summary>
00062         /// <remarks>Consider using one of these: "NotSet", "Effect", "Vertex", "Pixel", "Geometry", "Hull", "Domain", "Compute", or "Texture".</remarks>
00063         public virtual string ShaderType
00064         {
00065             get
00066             {
00067                 return (string)Bag["ShaderType"];
00068             }
00069
00070             set
00071             {
00072                 string result = String.Empty;
00073                 switch (value.ToLowerInvariant())
00074                 {
00075                     case "notset":
00076                         result = "";
00077                         break;
00078                     case "effect":
00079                         result = "/T fx";
00080                         break;
00081                     case "vertex":
00082                         result = "/T vs";
00083                         break;
00084                     case "pixel":
00085                         result = "/T ps";
00086                         break;
00087                     case "geometry":
00088                         result = "/T gs";
00089                         break;
00090                     case "hull":
00091                         result = "/T hs";
00092                         break;
00093                     case "domain":
00094                         result = "/T ds";
00095                         break;
00096                     case "compute":
00097                         result = "/T cs";
00098                         break;
00099                     case "texture":
00100                         result = "/T tx";
00101                         break;
00102                     default:
00103                         throw new ArgumentException("ShaderType of " + value + @" is an invalid.  Consider using one of these: ""NotSet"", ""Effect"", ""Vertex"", ""Pixel"", ""Geometry"", ""Hull"", ""Domain"", ""Compute"", or ""Texture"".");
00104                 }
00105
00106                 Bag["ShaderType"] = result;
00107             }
00108         }
00109
00110         /// <summary>
00111         /// ShaderModel, requires ShaderType
00112         /// Specifies the shader model. Some shader types can only be used with recent shader models (/T [type]_[model])
00113         /// </summary>
00114         public virtual string ShaderModel
00115         {
00116             get { return (string)Bag["ShaderModel"]; }
00117             set { Bag["ShaderModel"] = value; }
00118         }
00119
00120         /// <summary>
00121         /// AssemblerOutput, requires AssemblerOutputFile
00122         /// Specifies the contents of assembly language output file. (/Fc, /Fx)
00123         /// </summary>
00124         /// <remarks>Consider using one of these: "Assembly Code" or "Assembly Code and Hex".</remarks>
00125         public virtual string AssemblerOutput
00126         {
00127             get
00128             {
00129                 return (string)Bag["AssemblerOutput"];
00130             }
00131
00132             set
00133             {
00134                 string result = String.Empty;
00135                 switch (value.ToLowerInvariant())
00136                 {
00137                     case "Assembly Code":
00138                         result = "/Fc";
00139                         break;
00140                     case "Assembly Code and Hex":
00141                         result = "/Fx";
00142                         break;
00143                     default:
00144                         throw new ArgumentException("AssemblerOutput of " + value + @" is an invalid.  Consider using one of these: ""Assembly Code"" or ""Assembly Code and Hex"".");
00145                 }
00146
00147                 Bag["AssemblerOutput"] = value;
00148             }
00149         }
00150
00151         /// <summary>
00152         /// AssemblerOutputFile, requires AssemblerOutput
00153         /// Specifies file name for assembly code listing file
00154         /// </summary>
00155         public virtual string AssemblerOutputFile
00156         {
00157             get { return (string)Bag["AssemblerOutputFile"]; }
00158             set { Bag["AssemblerOutputFile"] = value; }
00159         }
00160
00161         /// <summary>
00162         /// Specifies a name for the variable name in the header file (/Vn [name])
00163         /// </summary>
00164         public virtual string VariableName
00165         {
00166             get { return (string)Bag["VariableName"]; }
00167             set { Bag["VariableName"] = value; }
00168         }
00169
00170         /// <summary>
00171         /// Specifies a name for header file containing object code. (/Fh [name])
00172         /// </summary>
00173         public virtual string HeaderFileOutput
00174         {
00175             get { return (string)Bag["HeaderFileOutput"]; }
00176             set { Bag["HeaderFileOutput"] = value; }
00177         }
00178
00179         /// <summary>
00180         /// Specifies a name for object file. (/Fo [name])
00181         /// </summary>
00182         public virtual string ObjectFileOutput
00183         {
00184             get { return (string)Bag["ObjectFileOutput"]; }
00185             set { Bag["ObjectFileOutput"] = value; }
00186         }
00187
00188         /// <summary>
00189         /// Defines preprocessing symbols for your source file.
00190         /// </summary>
00191         public virtual string[] PreprocessorDefinitions
00192         {
00193             get { return (string[])Bag["PreprocessorDefinitions"]; }
00194             set { Bag["PreprocessorDefinitions"] = value; }
00195         }
00196
00197         /// <summary>
00198         /// Specifies one or more directories to add to the include path; separate with semi-colons if more than one. (/I[path])
00199         /// </summary>
00200         public virtual string[] AdditionalIncludeDirectories
00201         {
00202             get { return (string[])Bag["AdditionalIncludeDirectories"]; }
00203             set { Bag["AdditionalIncludeDirectories"] = value; }
00204         }
00205
00206         /// <summary>
00207         /// Suppresses the display of the startup banner and information message. (/nologo)
00208         /// </summary>
00209         public virtual bool SuppressStartupBanner
00210         {
00211             get { return GetBoolParameterWithDefault("SuppressStartupBanner", false); }
00212             set { Bag["SuppressStartupBanner"] = value; }
00213         }
00214
00215         /// <summary>
00216         /// Specifies the name of the entry point for the shader (/E[name])
00217         /// </summary>
00218         public virtual string EntryPointName
00219         {
00220             get { return (string)Bag["EntryPointName"]; }
00221             set { Bag["EntryPointName"] = value; }
00222         }
00223
00224         /// <summary>
00225         /// Treats all compiler warnings as errors. For a new project, it may be best to use /WX in all compilations; resolving all warnings will ensure the fewest possible hard-to-find code defects.
00226         /// </summary>
00227         public virtual bool TreatWarningAsError
00228         {
00229             get { return GetBoolParameterWithDefault("TreatWarningAsError", false); }
00230             set { Bag["TreatWarningAsError"] = value; }
00231         }
00232
00233         /// <summary>
00234         /// Disable optimizations. /Od implies /Gfp though output may not be identical to /Od /Gfp.
00235         /// </summary>
00236         public virtual bool DisableOptimizations
00237         {
00238             get { return GetBoolParameterWithDefault("DisableOptimizations", false); }
00239             set { Bag["DisableOptimizations"] = value; }
00240         }
00241
00242         /// <summary>
00243         /// Enable debugging information.
00244         /// </summary>
00245         public virtual bool EnableDebuggingInformation
00246         {
00247             get { return GetBoolParameterWithDefault("EnableDebuggingInformation", false); }
00248             set { Bag["EnableDebuggingInformation"] = value; }
00249         }
00250
00251         /// <summary>
00252         /// Path to Windows SDK
00253         /// </summary>
00254         public string SdkToolsPath
00255         {
00256             get { return (string)Bag["SdkToolsPath"]; }
00257             set { Bag["SdkToolsPath"] = value; }
00258         }
00259
00260         /// <summary>
00261         /// Name to Fxc.exe
00262         /// </summary>
00263         protected override string ToolName
00264         {
00265             get { return "Fxc.exe"; }
00266         }
00267
00268         #endregion
00269
00270         /// <summary>
00271         /// Returns a string with those switches and other information that can't go into a response file and
00272         /// must go directly onto the command line.
00273         /// Called after ValidateParameters and SkipTaskExecution
00274         /// </summary>
00275         /// <returns></returns>
00276         override protected string GenerateCommandLineCommands()
00277         {
00278             CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
00279             AddCommandLineCommands(commandLineBuilder);
00280             return commandLineBuilder.ToString();
00281         }
00282
00283         /// <summary>
00284         /// Returns the command line switch used by the tool executable to specify the response file
00285         /// Will only be called if the task returned a non empty string from GetResponseFileCommands
00286         /// Called after ValidateParameters, SkipTaskExecution and GetResponseFileCommands
00287         /// </summary>
00288         /// <param name="responseFilePath">full path to the temporarily created response file</param>
00289         /// <returns></returns>
00290         override protected string GenerateResponseFileCommands()
00291         {
00292             CommandLineBuilderExtension commandLineBuilder = new CommandLineBuilderExtension();
00293             AddResponseFileCommands(commandLineBuilder);
00294             return commandLineBuilder.ToString();
00295         }
00296
00297         /// <summary>
00298         /// Fills the provided CommandLineBuilderExtension with those switches and other information that can go into a response file.
00299         /// </summary>
00300         /// <param name="commandLine"></param>
00301         protected internal virtual void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
00302         {
00303         }
00304
00305         /// <summary>
00306         /// Add Command Line Commands
00307         /// </summary>
00308         /// <param name="commandLine">CommandLineBuilderExtension</param>
00309         protected internal void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
00310         {
00311             //// Order of these affect the order of the command line
00312
00313             commandLine.AppendSwitchIfNotNull("/I ", AdditionalIncludeDirectories, "");
00314             commandLine.AppendSwitch(SuppressStartupBanner ? "/nologo" : String.Empty);
00315             commandLine.AppendSwitchIfNotNull("/E", EntryPointName);
00316             commandLine.AppendSwitch(TreatWarningAsError ? "/WX" : String.Empty);
00317
00318             // Switch cannot be null
00319             if (ShaderType != null && ShaderModel != null)
00320             {
00321                 // shader Model and Type are one switch
00322                 commandLine.AppendSwitch(ShaderType + "_" + ShaderModel);
00323             }
00324
00325             commandLine.AppendSwitchIfNotNull("/D ", PreprocessorDefinitions, "");
00326             commandLine.AppendSwitchIfNotNull("/Fh ", HeaderFileOutput);
00327             commandLine.AppendSwitchIfNotNull("/Fo ", ObjectFileOutput);
00328
00329             // Switch cannot be null
00330             if (AssemblerOutput != null)
00331             {
00332                 commandLine.AppendSwitchIfNotNull(AssemblerOutput, AssemblerOutputFile);
00333             }
00334
00335             commandLine.AppendSwitchIfNotNull("/Vn ", VariableName);
00336             commandLine.AppendSwitch(DisableOptimizations ? "/Od" : String.Empty);
00337             commandLine.AppendSwitch(EnableDebuggingInformation ? "/Zi" : String.Empty);
00338
00339             commandLine.AppendSwitchIfNotNull("", Source, " ");
00340         }
00341
00342         /// <summary>
00343         /// Fullpath to the fxc.exe
00344         /// </summary>
00345         /// <returns>Fullpath to fxc.exe, if found.  Otherwise empty or null.</returns>
00346         protected override string GenerateFullPathToTool()
00347         {
00348             return System.IO.Path.Combine(SdkToolsPath, ToolName);
00349         }
00350
00351         /// <summary>
00352         /// Get a bool parameter and return a default if its not present
00353         /// in the hash table.
00354         /// </summary>
00355         /// <param name="parameters"></param>
00356         /// <param name="parameterName"></param>
00357         /// <param name="defaultValue"></param>
00358         /// <returns></returns>
00359         /// <owner>JomoF</owner>
00360         protected internal bool GetBoolParameterWithDefault(string parameterName, bool defaultValue)
00361         {
00362             object obj = bag[parameterName];
00363             return (obj == null) ? defaultValue : (bool) obj;
00364         }
00365     }
00366 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/RippleEffect.h Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

RippleEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 DEFINE_GUID(GUID_RipplePixelShader, 0x6716FB29, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6);
00013 DEFINE_GUID(CLSID_CustomRippleEffect, 0xB7B36C92, 0x3498, 0x4A94, 0x9E, 0x95, 0x9F, 0x24, 0x6F, 0x92, 0x45, 0xBF);
00014
00015 enum RIPPLE_PROP
00016 {
00017     RIPPLE_PROP_FREQUENCY = 0,
00018     RIPPLE_PROP_PHASE     = 1,
00019     RIPPLE_PROP_AMPLITUDE = 2,
00020     RIPPLE_PROP_SPREAD    = 3,
00021     RIPPLE_PROP_CENTER    = 4
00022 };
00023
00024 // Our effect contains one transform, which is simply a wrapper around a pixel shader. As such,
00025 // we can simply make the effect itself act as the transform.
00026 class RippleEffect : public ID2D1EffectImpl, public ID2D1DrawTransform
00027 {
00028 public:
00029     // Declare effect registration methods.
00030     static HRESULT Register(_In_ ID2D1Factory1* pFactory);
00031
00032     static HRESULT __stdcall CreateRippleImpl(_Outptr_ IUnknown** ppEffectImpl);
00033
00034     // Declare property getter/setter methods.
00035     HRESULT SetCenter(D2D1_POINT_2F center);
00036     D2D1_POINT_2F GetCenter() const;
00037
00038     HRESULT SetFrequency(float frequency);
00039     float GetFrequency() const;
00040
00041     HRESULT SetPhase(float phase);
00042     float GetPhase() const;
00043
00044     HRESULT SetAmplitude(float amplitude);
00045     float GetAmplitude() const;
00046
00047     HRESULT SetSpread(float spread);
00048     float GetSpread() const;
00049
00050     // Declare ID2D1EffectImpl implementation methods.
00051     IFACEMETHODIMP Initialize(
00052         _In_ ID2D1EffectContext* pContextInternal,
00053         _In_ ID2D1TransformGraph* pTransformGraph
00054         );
00055
00056     IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE changeType);
00057
00058     IFACEMETHODIMP SetGraph(_In_ ID2D1TransformGraph* pGraph);
00059
00060     // Declare ID2D1DrawTransform implementation methods.
00061     IFACEMETHODIMP SetDrawInfo(_In_ ID2D1DrawInfo* pRenderInfo);
00062
00063     // Declare ID2D1Transform implementation methods.
00064     IFACEMETHODIMP MapOutputRectToInputRects(
00065         _In_ const D2D1_RECT_L* pOutputRect,
00066         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00067         UINT32 inputRectCount
00068         ) const;
00069
00070     IFACEMETHODIMP MapInputRectsToOutputRect(
00071         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00072         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00073         UINT32 inputRectCount,
00074         _Out_ D2D1_RECT_L* pOutputRect,
00075         _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00076         );
00077
00078     IFACEMETHODIMP MapInvalidRect(
00079         UINT32 inputIndex,
00080         D2D1_RECT_L invalidInputRect,
00081         _Out_ D2D1_RECT_L* pInvalidOutputRect
00082         ) const;
00083
00084     // Declare ID2D1TransformNode implementation methods.
00085     IFACEMETHODIMP_(UINT32) GetInputCount() const;
00086
00087     // Declare IUnknown implementation methods.
00088     IFACEMETHODIMP_(ULONG) AddRef();
00089     IFACEMETHODIMP_(ULONG) Release();
00090     IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppOutput);
00091
00092 private:
00093     RippleEffect();
00094     HRESULT UpdateConstants();
00095
00096     inline static float Clamp(float v, float low, float high)
00097     {
00098         return (v < low) ? low : (v > high) ? high : v;
00099     }
00100
00101     inline static float Round(float v)
00102     {
00103         return floor(v + 0.5f);
00104     }
00105
00106     // Prevents over/underflows when adding longs.
00107     inline static long SafeAdd(long base, long valueToAdd)
00108     {
00109         if (valueToAdd >= 0)
00110         {
00111             return ((base + valueToAdd) >= base) ? (base + valueToAdd) : LONG_MAX;
00112         }
00113         else
00114         {
00115             return ((base + valueToAdd) <= base) ? (base + valueToAdd) : LONG_MIN;
00116         }
00117     }
00118
00119     // This struct defines the constant buffer of our pixel shader.
00120     struct
00121     {
00122         float frequency;
00123         float phase;
00124         float amplitude;
00125         float spread;
00126         D2D1_POINT_2F center;
00127         float dpi;
00128     } m_constants;
00129
00130     Microsoft::WRL::ComPtr<ID2D1DrawInfo>      m_drawInfo;
00131     Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext;
00132     LONG                                       m_refCount;
00133     D2D1_RECT_L                                m_inputRect;
00134     float                                      m_dpi;
00135 };
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario2_MSA.xaml.cpp Source File

  • WebAccountManagement
  • cpp

Scenario2_MSA.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario2_Msa.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Windows::Foundation;
00010 using namespace Windows::Foundation::Collections;
00011 using namespace Windows::Security::Authentication::Web::Core;
00012 using namespace Windows::Security::Credentials;
00013 using namespace Windows::Storage;
00014 using namespace Windows::UI::Popups;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022 using namespace Windows::UI::ApplicationSettings;
00023 using namespace Windows::ApplicationModel::Background;
00024 using namespace Windows::UI::Xaml::Media::Imaging;
00025
00026 Scenario2_Msa::Scenario2_Msa() : rootPage(MainPage::Current)
00027 {
00028     InitializeComponent();
00029     InitalizeAccountsControlDialog();
00030 }
00031
00032 void Scenario2_Msa::OnNavigatedFrom(NavigationEventArgs^ e)
00033 {
00034     LogoffAndRemoveAccount();
00035     CleanupAccountsControlDialog();
00036 }
00037
00038 void SDKTemplate::Scenario2_Msa::Button_SignIn_Click(Object^ sender, RoutedEventArgs^ e)
00039 {
00040     // Inside OnAccountCommandsRequested we will determine that we need to show accounts
00041     // and providers eligible for sign in because there is no signed in account
00042     AccountsSettingsPane::Show();
00043 }
00044
00045 void SDKTemplate::Scenario2_Msa::Button_GetTokenSilently_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     AuthenticateWithRequestTokenSilent(m_provider, MSA_SCOPE_REQUESTED, MSA_CLIENT_ID, m_account);
00048 }
00049
00050 void SDKTemplate::Scenario2_Msa::Button_ManageAccounts_Click(Object^ sender, RoutedEventArgs^ e)
00051 {
00052     // Inside OnAccountCommandsRequested we will determine that we need to show the
00053     // active account since are signed into an account right now
00054     AccountsSettingsPane::Show();
00055 }
00056
00057 void SDKTemplate::Scenario2_Msa::Button_Reset_Click(Object^ sender, RoutedEventArgs^ e)
00058 {
00059     rootPage->NotifyUser("Resetting", NotifyType::StatusMessage);
00060
00061     LogoffAndRemoveAccount();
00062
00063     rootPage->NotifyUser("Done Resetting", NotifyType::StatusMessage);
00064 }
00065
00066 void SDKTemplate::Scenario2_Msa::InitalizeAccountsControlDialog()
00067 {
00068     // Add to the event AccountCommandsRequested to load our list of providers into the AccountSettingsPane
00069     m_accountCommandsRequestedRegistrationToken = AccountsSettingsPane::GetForCurrentView()->AccountCommandsRequested::add(
00070         ref new TypedEventHandler<AccountsSettingsPane^, AccountsSettingsPaneCommandsRequestedEventArgs^>(
00071             this,
00072             &SDKTemplate::Scenario2_Msa::OnAccountCommandsRequested)
00073     );
00074
00075     // Populate our list of providers with the MSA provider, and attempt to find any accounts saved.
00076     GetProvidersAndAccounts();
00077 }
00078
00079 void SDKTemplate::Scenario2_Msa::CleanupAccountsControlDialog()
00080 {
00081     // Remove the event handler from the AccountCommandsRequested
00082     AccountsSettingsPane::GetForCurrentView()->AccountCommandsRequested::remove(m_accountCommandsRequestedRegistrationToken);
00083 }
00084
00085 void SDKTemplate::Scenario2_Msa::OnAccountCommandsRequested(
00086     AccountsSettingsPane^ sender,
00087     AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00088 {
00089     // This scenario only supports a single account at one time.
00090     // If there already is an account, we do not include a provider in the list
00091     if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00092     {
00093         AddWebAccount(e);
00094     }
00095     else
00096     {
00097         AddWebAccountProvider(e);
00098     }
00099
00100     AddLinks(e);
00101 }
00102
00103 void SDKTemplate::Scenario2_Msa::GetProvidersAndAccounts()
00104 {
00105     // Make a task to get the MSAProvider by it's ID
00106
00107     // When that task completes, save the MSA provider found
00108     concurrency::create_task(WebAuthenticationCoreManager::FindAccountProviderAsync(MICROSOFT_PROVIDER_ID, CONSUMER_AUTHORITY))
00109         .then([this](WebAccountProvider^ foundMsaProvider)
00110     {
00111         if (foundMsaProvider)
00112         {
00113             m_provider = foundMsaProvider;
00114         }
00115         else
00116         {
00117             rootPage->NotifyUser("Provider not found for id: " +  MICROSOFT_PROVIDER_ID + " and authority: " +  CONSUMER_AUTHORITY, NotifyType::StatusMessage);
00118         }
00119     })
00120     // Then check to see if there is a stored account id in local settings,
00121     // if so then get that account and save that as well
00122     .then([this]()
00123     {
00124         if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00125         {
00126             auto accountID = reinterpret_cast<String^>(ApplicationData::Current->LocalSettings->Values->Lookup(STORED_ACCOUNT_ID_KEY));
00127
00128             concurrency::create_task(WebAuthenticationCoreManager::FindAccountAsync(m_provider, accountID))
00129                 .then([this](WebAccount^ foundMsaAccount)
00130             {
00131                 if (foundMsaAccount)
00132                 {
00133                     SaveAccount(foundMsaAccount);
00134                 }
00135             });
00136         }
00137     });
00138 }
00139
00140 //Creates a provider command object for our provider and adds it to the AccountsControl list of provider commands
00141 void SDKTemplate::Scenario2_Msa::AddWebAccountProvider(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00142 {
00143     e->HeaderText = "Describe what adding an account to your application will do for the user.";
00144
00145     // Create a new WebAccountProviderCommandInvokedHandler for the event fired when a user clicks on a provider in the AccountSettingsPane
00146     WebAccountProviderCommandInvokedHandler^ handler = ref new WebAccountProviderCommandInvokedHandler(this, &SDKTemplate::Scenario2_Msa::WebAccountProviderCommandInvoked);
00147
00148     // Make a new command based on the MSA provider and the click handler we just created
00149     WebAccountProviderCommand^ msaProviderCommand = ref new WebAccountProviderCommand(SDKTemplate::Scenario2_Msa::m_provider, handler);
00150
00151     // Append that command to the WebAccountProviderCommands list for the AccountSettingsPane
00152     e->WebAccountProviderCommands->Append(msaProviderCommand);
00153 }
00154
00155 //Creates a web account command object for our account, if we have one saved, and adds it to the AccountsControl list of web account commands
00156 void SDKTemplate::Scenario2_Msa::AddWebAccount(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00157 {
00158     e->HeaderText = "Describe what removing an account to your application will do.";
00159
00160     // Create a new WebAccountCommandInvokedHandler for the event fired when a user clicks on an account in the AccountSettingsPane
00161     WebAccountCommandInvokedHandler^ handler = ref new WebAccountCommandInvokedHandler(this, &SDKTemplate::Scenario2_Msa::WebAccountCommandInvoked);
00162
00163     // Make a new command based on the MSA account and the click handler we just created
00164     WebAccountCommand^ msaAccountCommand = ref new WebAccountCommand(m_account, handler, SupportedWebAccountActions::Remove);
00165
00166     // Append that command to the WebAccountProviderCommands list for the AccountSettingsPane
00167     e->WebAccountCommands->Append(msaAccountCommand);
00168 }
00169
00170 // Add optional descriptive text and buttons/commands to the AccountControl
00171 void SDKTemplate::Scenario2_Msa::AddLinks(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00172 {
00173     // You can add links such as privacy policy, help, general account settings
00174     e->Commands->Append(ref new SettingsCommand("privacypolicy", "Privacy Policy", ref new UICommandInvokedHandler(this, &SDKTemplate::Scenario2_Msa::PrivacyPolicyInvoked)));
00175     e->Commands->Append(ref new SettingsCommand("otherlink", "Other Link", ref new UICommandInvokedHandler(this, &SDKTemplate::Scenario2_Msa::OtherLinkInvoked)));
00176 }
00177
00178 // The function that will be called from AccountSettingsPane with the WebAccountProvider
00179 // that was clicked by the user
00180 void SDKTemplate::Scenario2_Msa::WebAccountProviderCommandInvoked(WebAccountProviderCommand^ command)
00181 {
00182     AuthenticateWithRequestToken(command->WebAccountProvider,  MSA_SCOPE_REQUESTED,  MSA_CLIENT_ID);
00183 }
00184
00185 // The function that will be called from AccountSettingsPane with the WebAccount
00186 // that was selected by the user.
00187 void SDKTemplate::Scenario2_Msa::WebAccountCommandInvoked(WebAccountCommand^ command, WebAccountInvokedArgs^ args)
00188 {
00189     if (args->Action == WebAccountAction::Remove)
00190     {
00191         LogoffAndRemoveAccount();
00192     }
00193 }
00194
00195 // Displays privacy policy message on clicking it in the AccountsControl
00196 void SDKTemplate::Scenario2_Msa::PrivacyPolicyInvoked(IUICommand^ command)
00197 {
00198     rootPage->NotifyUser("Privacy policy clicked by user", NotifyType::StatusMessage);
00199 }
00200
00201 // Displays other link message on clicking it in the AccountsControl
00202 void SDKTemplate::Scenario2_Msa::OtherLinkInvoked(IUICommand^ command)
00203 {
00204     rootPage->NotifyUser("Other link pressed by user", NotifyType::StatusMessage);
00205 }
00206
00207 // Create a new WebAccountManager WebTokenRequest based on the Provider, Scope, ClientID and then create a task to send
00208 // that request asynchronously to WebAccountManager's RequestTokenAsync API
00209 //
00210 // WebAccountManager will then try three steps, in order:
00211 //        (1): Check it's local cache to see if it has a valid token
00212 //        (2): Try to silently request a new token from the MSA service
00213 //        (3): Show the MSA UI for user interaction required (user credentials) before it may return a token.
00214 //
00215 // Because of WebAccountManager's ability to cache tokens, you should only need to call WebAccountManager when making token
00216 // based requests and not require the ability to store a cached token within your app.
00217 void SDKTemplate::Scenario2_Msa::AuthenticateWithRequestToken(WebAccountProvider^ passedProvider, String^ scope, String^ clientID)
00218 {
00219     rootPage->NotifyUser("Requested " + passedProvider->DisplayName + " from AccountsManager dialog.", NotifyType::StatusMessage);
00220
00221     auto wtr = ref new WebTokenRequest(passedProvider, scope, clientID);
00222
00223     // When our task finishes it will return result of the operation, and if successful it will contain a token
00224     // and WebAccount. We save the WebAccount as the "active" account.
00225     concurrency::create_task(WebAuthenticationCoreManager::RequestTokenAsync(wtr)).then([this](WebTokenRequestResult^ webTokenRequestResult)
00226     {
00227         if (webTokenRequestResult->ResponseStatus == WebTokenRequestStatus::Success)
00228         {
00229             if (webTokenRequestResult->ResponseData->GetAt(0)->WebAccount)
00230             {
00231                 if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00232                 {
00233                     ApplicationData::Current->LocalSettings->Values->Remove(STORED_ACCOUNT_ID_KEY);
00234                 }
00235
00236                 WebAccount^ account = webTokenRequestResult->ResponseData->GetAt(0)->WebAccount;
00237                 SaveAccount(account);
00238             }
00239         }
00240
00241         OutputTokenResult(webTokenRequestResult);
00242     });
00243 }
00244
00245 // Create a new WebAccountManager WebTokenRequest based on the Provider, Scope, ClientID and then create a task to send
00246 // that request and the account to get the token for asynchronously to WebAccountManager's GetTokenSilentlyAsync API
00247 //
00248 // WebAccountManager's GetTokenSilentlyAsync will then try :
00249 //        (1): Check it's local cache to see if it has a valid token
00250 //        (2): Try to silently request a new token from the MSA service
00251 //        (3): Return a status of UserInteractionRequired if we need the user credentials
00252 //
00253 // Because of WebAccountManager's ability to cache tokens, you should only need to call WebAccountManager when making token
00254 // based requests and not require the ability to store a cached token within your app.
00255 void SDKTemplate::Scenario2_Msa::AuthenticateWithRequestTokenSilent(WebAccountProvider^ provider, String^ scope, String^ clientID, WebAccount^ account)
00256 {
00257     rootPage->NotifyUser("Requested " + provider->DisplayName + " from AccountsManager dialog.", NotifyType::StatusMessage);
00258
00259     auto wtr = ref new WebTokenRequest(provider, scope, clientID);
00260
00261     // When our task finishes it will return result of the operation, and if successful it will contain a token
00262     // and WebAccount. We save the WebAccount as the "active" account.
00263     concurrency::create_task(WebAuthenticationCoreManager::GetTokenSilentlyAsync(wtr, account)).then([this](WebTokenRequestResult^ webTokenRequestResult)
00264     {
00265         if (webTokenRequestResult->ResponseStatus == WebTokenRequestStatus::Success)
00266         {
00267             // Perform an operation with the token you just got
00268         }
00269
00270         OutputTokenResult(webTokenRequestResult);
00271     });
00272 }
00273
00274 // Displays the result of requesting a token asynchronously to the main page
00275 void SDKTemplate::Scenario2_Msa::OutputTokenResult(WebTokenRequestResult^ result)
00276 {
00277     if (result->ResponseStatus == WebTokenRequestStatus::Success)
00278     {
00279         rootPage->NotifyUser(result->ResponseStatus.ToString() + "!\nUser: " + result->ResponseData->GetAt(0)->WebAccount->Id + "\n    Token returned was: " + result->ResponseData->GetAt(0)->Token, NotifyType::StatusMessage);
00280     }
00281     else if (result->ResponseStatus == WebTokenRequestStatus::ProviderError)
00282     {
00283         // The account provider has passed us an error and we should handle it.
00284         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00285     }
00286     else if (result->ResponseStatus == WebTokenRequestStatus::AccountProviderNotAvailable)
00287     {
00288         // The account provider is unavailable, this is a temporary error.
00289         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::ErrorMessage);
00290     }
00291     else if (result->ResponseStatus == WebTokenRequestStatus::UserInteractionRequired)
00292     {
00293         // The account provider needs to display a UI, since we called request token silently we should call it
00294         // with RequestTokenAsync.
00295         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00296     }
00297     else if (result->ResponseStatus == WebTokenRequestStatus::UserCancel)
00298     {
00299         // The user cancelled the sign in process for the account provider, handle
00300         // that how you need to.
00301         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00302     }
00303     else
00304     {
00305         // An unexpected error was encountered
00306         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00307     }
00308 }
00309
00310 // Saves the AccountId in LocalSettings and keeps an instance
00311 // of the WebAccount saved
00312 void SDKTemplate::Scenario2_Msa::SaveAccount(WebAccount^ account)
00313 {
00314     ApplicationData::Current->LocalSettings->Values->Insert(STORED_ACCOUNT_ID_KEY, account->Id);
00315     m_account = account;
00316
00317     // Update the UI
00318     button_SignIn->IsEnabled = false;
00319     button_GetTokenSilently->IsEnabled = true;
00320     button_ManageAccounts->IsEnabled = true;
00321     textblock_SignedInStatus->Text = "Signed in with:";
00322     textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Green);
00323     listview_SignedInAccounts->Items->Append(account->Id);
00324 }
00325
00326 // Signs out the account using the SignOutAsync Token Broker API
00327 // and removes our saved AccountId as it won't be valid when SignOutAsync finishes.
00328 void SDKTemplate::Scenario2_Msa::LogoffAndRemoveAccount()
00329 {
00330     if (m_account)
00331     {
00332         //concurrency::create_task(m_account->SignOutAsync(MSA_SCOPE_REQUESTED));
00333         m_account = nullptr;
00334     }
00335
00336     if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00337     {
00338         rootPage->NotifyUser("Signed out account id: " + ApplicationData::Current->LocalSettings->Values->Lookup(STORED_ACCOUNT_ID_KEY), NotifyType::StatusMessage);
00339         ApplicationData::Current->LocalSettings->Values->Remove(STORED_ACCOUNT_ID_KEY);
00340
00341         // Update UI
00342         button_SignIn->IsEnabled = true;
00343         button_GetTokenSilently->IsEnabled = false;
00344         button_ManageAccounts->IsEnabled = false;
00345         textblock_SignedInStatus->Text = "Not signed in.";
00346         textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Red);
00347         listview_SignedInAccounts->Items->Clear();
00348     }
00349 }
Generated on Fri Nov 15 2024 22:21:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ParseAndStringify Member List

This is the complete list of members for Scenario1_ParseAndStringify, including all inherited members.
Add_Click(object sender, RoutedEventArgs e) | Scenario1_ParseAndStringify | [inline, private]
CurrentUser | Scenario1_ParseAndStringify | [private]
DeleteSchool_Click(object sender, RoutedEventArgs e) | Scenario1_ParseAndStringify | [inline, private]
IsExceptionHandled(Exception ex) | Scenario1_ParseAndStringify | [inline, private]
Parse_Click(object sender, RoutedEventArgs e) | Scenario1_ParseAndStringify | [inline, private]
rootPage | Scenario1_ParseAndStringify | [private]
Scenario1_ParseAndStringify() | Scenario1_ParseAndStringify | [inline]
Stringify_Click(object sender, RoutedEventArgs e) | Scenario1_ParseAndStringify | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/SampleConfiguration.h Source File

  • Compression
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return ref new Platform::String(L"Data Compression/Decompression C++ Sample");
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cs/SampleConfiguration.cs Source File

  • UserCertificateStore
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "UserCertificateStore C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Move certificate", ClassType=typeof(Scenario1_MoveCertificate)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.cpp Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

ReinhardEffect.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <initguid.h>
00014 #include "ReinhardEffect.h"
00015 #include "BasicReaderWriter.h"
00016
00017 #define XML(X) TEXT(#X)
00018
00019 ReinhardEffect::ReinhardEffect() :
00020     m_refCount(1)
00021 {
00022 }
00023
00024 HRESULT __stdcall ReinhardEffect::CreateReinhardImpl(_Outptr_ IUnknown** ppEffectImpl)
00025 {
00026     // Since the object's refcount is initialized to 1, we don't need to AddRef here.
00027     *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) ReinhardEffect());
00028
00029     if (*ppEffectImpl == nullptr)
00030     {
00031         return E_OUTOFMEMORY;
00032     }
00033     else
00034     {
00035         return S_OK;
00036     }
00037 }
00038
00039 HRESULT ReinhardEffect::Register(_In_ ID2D1Factory1* pFactory)
00040 {
00041     // The inspectable metadata of an effect is defined in XML. This can be passed in from an external source
00042     // as well, however for simplicity we just inline the XML.
00043     PCWSTR pszXml =
00044         XML(
00045             <?xml version='1.0'?>
00046             <Effect>
00047                 <!-- System Properties -->
00048                 <Property name='DisplayName' type='string' value='Reinhard Tonemapper' />
00049                 <Property name='Author' type='string' value='Microsoft Corporation' />
00050                 <Property name='Category' type='string' value='Stylize' />
00051                 <Property name='Description' type='string' value='Simplified (RGB) version of the Reinhard HDR tonemapper' />
00052                 <Inputs>
00053                     <Input name='Source' />
00054                 </Inputs>
00055                 <!-- Custom Properties go here -->
00056             </Effect>
00057             );
00058
00059     // This registers the effect with the factory, which will make the effect
00060     // instantiatable.
00061     return pFactory->RegisterEffectFromString(
00062         CLSID_CustomReinhardEffect,
00063         pszXml,
00064         nullptr,
00065         0,
00066         CreateReinhardImpl
00067         );
00068 }
00069
00070 IFACEMETHODIMP ReinhardEffect::Initialize(
00071     _In_ ID2D1EffectContext* pEffectContext,
00072     _In_ ID2D1TransformGraph* pTransformGraph
00073     )
00074 {
00075     // To maintain consistency across different DPIs, this effect needs to cover more pixels at
00076     // higher than normal DPIs. The context is saved here so the effect can later retrieve the DPI.
00077     m_effectContext = pEffectContext;
00078     BasicReaderWriter^ reader = ref new BasicReaderWriter();
00079     Platform::Array<unsigned char, 1U>^ data;
00080
00081     try
00082     {
00083         data = reader->ReadData("ReinhardEffect.cso");
00084     }
00085     catch (Platform::Exception^ e)
00086     {
00087         // Return error if file can not be read.
00088         return e->HResult;
00089     }
00090
00091     HRESULT hr = pEffectContext->LoadPixelShader(GUID_ReinhardEffectPixelShader, data->Data, data->Length);
00092
00093     // This loads the shader into the Direct2D image effects system and associates it with the GUID passed in.
00094     // If this method is called more than once (say by other instances of the effect) with the same GUID,
00095     // the system will simply do nothing, ensuring that only one instance of a shader is stored regardless of how
00096     // many time it is used.
00097     if (SUCCEEDED(hr))
00098     {
00099         // The graph consists of a single transform. In fact, this class is the transform,
00100         // reducing the complexity of implementing an effect when all we need to
00101         // do is use a single pixel shader.
00102         hr = pTransformGraph->SetSingleTransformNode(this);
00103     }
00104
00105     return hr;
00106 }
00107
00108 HRESULT ReinhardEffect::UpdateConstants()
00109 {
00110     // Update the DPI if it has changed. This allows the effect to scale across different DPIs automatically.
00111     m_effectContext->GetDpi(&m_dpi, &m_dpi);
00112     m_constants.dpi = m_dpi;
00113
00114     return m_drawInfo->SetPixelShaderConstantBuffer(reinterpret_cast<BYTE*>(&m_constants), sizeof(m_constants));
00115 }
00116
00117 IFACEMETHODIMP ReinhardEffect::PrepareForRender(D2D1_CHANGE_TYPE changeType)
00118 {
00119     return UpdateConstants();
00120 }
00121
00122 // SetGraph is only called when the number of inputs changes. This never happens as we publish this effect
00123 // as a single input effect.
00124 IFACEMETHODIMP ReinhardEffect::SetGraph(_In_ ID2D1TransformGraph* pGraph)
00125 {
00126     return E_NOTIMPL;
00127 }
00128
00129 // Called to assign a new render info class, which is used to inform D2D on
00130 // how to set the state of the GPU.
00131 IFACEMETHODIMP ReinhardEffect::SetDrawInfo(_In_ ID2D1DrawInfo* pDrawInfo)
00132 {
00133     m_drawInfo = pDrawInfo;
00134
00135     return m_drawInfo->SetPixelShader(GUID_ReinhardEffectPixelShader);
00136 }
00137
00138 // Calculates the mapping between the output and input rects.
00139 IFACEMETHODIMP ReinhardEffect::MapOutputRectToInputRects(
00140     _In_ const D2D1_RECT_L* pOutputRect,
00141     _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00142     UINT32 inputRectCount
00143     ) const
00144 {
00145     // This effect has exactly one input, so if there is more than one input rect,
00146     // something is wrong.
00147     if (inputRectCount != 1)
00148     {
00149         return E_INVALIDARG;
00150     }
00151
00152     pInputRects[0].left    = pOutputRect->left;
00153     pInputRects[0].top     = pOutputRect->top;
00154     pInputRects[0].right   = pOutputRect->right;
00155     pInputRects[0].bottom  = pOutputRect->bottom;
00156
00157     return S_OK;
00158 }
00159
00160 IFACEMETHODIMP ReinhardEffect::MapInputRectsToOutputRect(
00161     _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00162     _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00163     UINT32 inputRectCount,
00164     _Out_ D2D1_RECT_L* pOutputRect,
00165     _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00166     )
00167 {
00168     // This effect has exactly one input, so if there is more than one input rect,
00169     // something is wrong.
00170     if (inputRectCount != 1)
00171     {
00172         return E_INVALIDARG;
00173     }
00174
00175     *pOutputRect = pInputRects[0];
00176     m_inputRect = pInputRects[0];
00177
00178     // Indicate that entire output might contain transparency.
00179     ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));
00180
00181     return S_OK;
00182 }
00183
00184 IFACEMETHODIMP ReinhardEffect::MapInvalidRect(
00185     UINT32 inputIndex,
00186     D2D1_RECT_L invalidInputRect,
00187     _Out_ D2D1_RECT_L* pInvalidOutputRect
00188     ) const
00189 {
00190     HRESULT hr = S_OK;
00191
00192     // Indicate that the entire output may be invalid.
00193     *pInvalidOutputRect = m_inputRect;
00194
00195     return hr;
00196 }
00197
00198 IFACEMETHODIMP_(UINT32) ReinhardEffect::GetInputCount() const
00199 {
00200     return 1;
00201 }
00202
00203 // D2D ensures that that effects are only referenced from one thread at a time.
00204 // To improve performance, we simply increment/decrement our reference count
00205 // rather than use atomic InterlockedIncrement()/InterlockedDecrement() functions.
00206 IFACEMETHODIMP_(ULONG) ReinhardEffect::AddRef()
00207 {
00208     m_refCount++;
00209     return m_refCount;
00210 }
00211
00212 IFACEMETHODIMP_(ULONG) ReinhardEffect::Release()
00213 {
00214     m_refCount--;
00215
00216     if (m_refCount == 0)
00217     {
00218         delete this;
00219         return 0;
00220     }
00221     else
00222     {
00223         return m_refCount;
00224     }
00225 }
00226
00227 // This enables the stack of parent interfaces to be queried.
00228 IFACEMETHODIMP ReinhardEffect::QueryInterface(
00229     _In_ REFIID riid,
00230     _Outptr_ void** ppOutput
00231     )
00232 {
00233     *ppOutput = nullptr;
00234     HRESULT hr = S_OK;
00235
00236     if (riid == __uuidof(ID2D1EffectImpl))
00237     {
00238         *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
00239     }
00240     else if (riid == __uuidof(ID2D1DrawTransform))
00241     {
00242         *ppOutput = static_cast<ID2D1DrawTransform*>(this);
00243     }
00244     else if (riid == __uuidof(ID2D1Transform))
00245     {
00246         *ppOutput = static_cast<ID2D1Transform*>(this);
00247     }
00248     else if (riid == __uuidof(ID2D1TransformNode))
00249     {
00250         *ppOutput = static_cast<ID2D1TransformNode*>(this);
00251     }
00252     else if (riid == __uuidof(IUnknown))
00253     {
00254         *ppOutput = this;
00255     }
00256     else
00257     {
00258         hr = E_NOINTERFACE;
00259     }
00260
00261     if (*ppOutput != nullptr)
00262     {
00263         AddRef();
00264     }
00265
00266     return hr;
00267 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario3_AvailabilityChanged.xaml.h Source File

  • LampDevice
  • cpp

Scenario3_AvailabilityChanged.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_AvailabilityChanged.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario3_AvailabilityChanged sealed
00021     {
00022     public:
00023         Scenario3_AvailabilityChanged();
00024
00025     protected:
00026         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027         virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00028
00029     private:
00030         MainPage^ _rootPage;
00031         Windows::Devices::Lights::Lamp^ _lamp;
00032         Windows::Foundation::EventRegistrationToken _lampAvailabilutyChangedEventToken;
00033
00034         Concurrency::task<void> InitializeLampAsync();
00035         void DisposeLamp();
00036
00037         void Lamp_AvailabilityChanged(Windows::Devices::Lights::Lamp^ sender, Windows::Devices::Lights::LampAvailabilityChangedEventArgs^ args);
00038         void RegisterBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         void UnRegisterBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void lampToggle_Toggled(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041
00042         Concurrency::task<void> LogStatusToOutputBoxAsync(Platform::String^ message);
00043         Concurrency::task<void> LogStatusAsync(Platform::String^ message, NotifyType type);
00044     };
00045 }
Generated on Fri Nov 15 2024 22:20:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario4_BackgroundProximitySensor.xaml.cs Source File

  • ProximitySensor
  • cs

Scenario4_BackgroundProximitySensor.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013
00014 using System;
00015 using Windows.ApplicationModel.Background;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Devices.Sensors;
00018 using Windows.Globalization.DateTimeFormatting;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021 using Windows.UI.Core;
00022 using Windows.Storage;
00023
00024 namespace ProximityCS
00025 {
00026     public sealed partial class Scenario4_BackgroundProximitySensor : Page
00027     {
00028         public const string SampleBackgroundTaskName = "ProximitySensorBackgroundTask";
00029         public const string SampleBackgroundTaskEntryPoint = "Tasks.ProximitySensorBackgroundTask";
00030
00031         // Have a pointer to the main page to call methods in MainPage such as NotifyUser()
00032         private MainPage rootPage = MainPage.Current;
00033         private bool registered = false;
00034         private ProximitySensor sensor = null;
00035         private DeviceWatcher watcher = null;
00036
00037         public Scenario4_BackgroundProximitySensor()
00038         {
00039             this.InitializeComponent();
00040
00041             watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
00042             watcher.Added += OnProximitySensorAdded;
00043             watcher.Start();
00044         }
00045
00046         /// <summary>
00047         /// Invoked when the device watcher finds a proximity sensor
00048         /// </summary>
00049         /// <param name="sender">The device watcher</param>
00050         /// <param name="device">Device information for the proximity sensor that was found</param>
00051         private async void OnProximitySensorAdded(DeviceWatcher sender, DeviceInformation device)
00052         {
00053             if (null == sensor)
00054             {
00055                 sensor = ProximitySensor.FromId(device.Id);
00056                 if (null == sensor)
00057                 {
00058                     // failed to find the sensor corresponding to the id
00059                     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00060                     {
00061                         rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
00062                     });
00063                 }
00064             }
00065         }
00066
00067         /// <summary>
00068         /// Invoked when this page is about to be displayed in a Frame.
00069         /// </summary>
00070         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00071         /// property is typically used to configure the page.</param>
00072         protected override void OnNavigatedTo(NavigationEventArgs e)
00073         {
00074             foreach (var task in BackgroundTaskRegistration.AllTasks)
00075             {
00076                 if (task.Value.Name == Scenario4_BackgroundProximitySensor.SampleBackgroundTaskName)
00077                 {
00078                     registered = true;
00079                     break;
00080                 }
00081             }
00082             UpdateUIAsync(registered ? "Registered" : "Unregistered");
00083         }
00084
00085         /// <summary>
00086         /// Invoked when 'Register Task' button is clicked.
00087         /// Adds a
00088         /// </summary>
00089         private async void ScenarioRegisterTask_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00090         {
00091             if (sensor != null)
00092             {
00093                 var status = await BackgroundExecutionManager.RequestAccessAsync();
00094
00095                 if ((BackgroundAccessStatus.AlwaysAllowed == status) ||
00096                     (BackgroundAccessStatus.AllowedSubjectToSystemPolicy == status))
00097                 {
00098                     RegisterBackgroundTask();
00099                 }
00100                 else
00101                 {
00102                     rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
00103                 }
00104             }
00105             else
00106             {
00107                 rootPage.NotifyUser("No Proximity sensors found", NotifyType.ErrorMessage);
00108             }
00109         }
00110
00111
00112         /// <summary>
00113         /// Invoked when 'Unregister Task' button is clicked.
00114         /// </summary>
00115         private void ScenarioUnregisterTask_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00116         {
00117             // Loop through all background tasks and unregister any with SampleBackgroundTaskName
00118             foreach (var cur in BackgroundTaskRegistration.AllTasks)
00119             {
00120                 if (SampleBackgroundTaskName == cur.Value.Name)
00121                 {
00122                     cur.Value.Unregister(true /*cancelTask*/);
00123                     registered = false;
00124                 }
00125             }
00126
00127             if (!registered)
00128             {
00129                 UpdateUIAsync("Unregistered");
00130             }
00131         }
00132
00133
00134         /// <summary>
00135         /// Registers the background task.
00136         /// </summary>
00137         private void RegisterBackgroundTask()
00138         {
00139             var builder = new BackgroundTaskBuilder()
00140             {
00141                 Name = SampleBackgroundTaskName,
00142                 TaskEntryPoint = SampleBackgroundTaskEntryPoint
00143             };
00144
00145             // create a Proximity data threshold
00146             var threshold = new ProximitySensorDataThreshold(sensor);
00147             // create a trigger using the threshold
00148             var trigger = new SensorDataThresholdTrigger(threshold);
00149
00150             builder.SetTrigger(trigger);
00151
00152             BackgroundTaskRegistration task = builder.Register();
00153             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00154
00155             registered = true;
00156             UpdateUIAsync("Registered");
00157         }
00158
00159         /// <summary>
00160         /// This is the event handler for background task completion.
00161         /// </summary>
00162         /// <param name="task">The task that is reporting completion.</param>
00163         /// <param name="args">The completion report arguments.</param>
00164         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00165         {
00166             string status = "Completed";
00167             try
00168             {
00169                 args.CheckResult();
00170             }
00171             catch (Exception e)
00172             {
00173                 status = e.Message;
00174             }
00175             UpdateUIAsync(status);
00176         }
00177
00178
00179         /// <summary>
00180         /// Updates the scenario UI.
00181         /// </summary>
00182         /// <param name="status">The status string to display.</param>
00183         async private void UpdateUIAsync(string status)
00184         {
00185             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00186             {
00187                 ScenarioRegisterTaskButton.IsEnabled = !registered;
00188                 ScenarioUnregisterTaskButton.IsEnabled = registered;
00189                 ScenarioOutput_TaskRegistration.Text = status;
00190
00191                 var settings = ApplicationData.Current.LocalSettings;
00192
00193                 Object value;
00194
00195                 if (settings.Values.TryGetValue("ReportCount", out value))
00196                 {
00197                     ScenarioOutput_ReportCount.Text = value.ToString(); // stored as a string
00198                 }
00199                 if (settings.Values.TryGetValue("TaskStatus", out value))
00200                 {
00201                     ScenarioOutput_TaskStatus.Text = value.ToString();
00202                 }
00203                 if (settings.Values.TryGetValue("LastTimestamp", out value))
00204                 {
00205                     ScenarioOutput_LastTimestamp.Text = value.ToString();
00206                 }
00207                 if (settings.Values.TryGetValue("Detected", out value))
00208                 {
00209                     ScenarioOutput_Detected.Text = value.ToString();
00210                 }
00211             });
00212         }
00213     }
00214 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario1_FindClaimEnable.xaml.h Source File

  • PosPrinter
  • cpp

Scenario1_FindClaimEnable.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_FindClaimEnable.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_FindClaimEnable sealed
00021     {
00022     public:
00023         Scenario1_FindClaimEnable();
00024
00025     protected:
00026         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028
00029         void FindPrinter_Click();
00030         void ClaimAndEnable_Click();
00031         void IsImportantTransaction_Click();
00032         void ReleaseClaim_Click();
00033         void ReleaseAll_Click();
00034     private:
00035         MainPage^ rootPage = MainPage::Current;
00036         bool isBusy = false;
00037
00038         void UpdateButtons();
00039     };
00040 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuperMutt::Device Member List

This is the complete list of members for SuperMutt::Device, including all inherited members.
Pid | SuperMutt::Device
UsageId | SuperMutt::Device
UsagePage | SuperMutt::Device
Vid | SuperMutt::Device
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_CompactOverlay Member List

This is the complete list of members for Scenario4_CompactOverlay, including all inherited members.
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_CompactOverlay |
OnWindowClosed(Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &) | Scenario4_CompactOverlay | [private]
Scenario4_CompactOverlay() | Scenario4_CompactOverlay |
ShowWindowBtn_Click(IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_CompactOverlay |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_BackgroundPedometer Member List

This is the complete list of members for Scenario4_BackgroundPedometer, including all inherited members.
backgroundTaskRegistered | Scenario4_BackgroundPedometer | [private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | Scenario4_BackgroundPedometer | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario4_BackgroundPedometer | [inline, protected]
RegisterBackgroundTask() | Scenario4_BackgroundPedometer | [inline, private]
rootPage | Scenario4_BackgroundPedometer | [private]
SampleBackgroundTaskEntryPoint | Scenario4_BackgroundPedometer |
SampleBackgroundTaskName | Scenario4_BackgroundPedometer |
Scenario4_BackgroundPedometer() | Scenario4_BackgroundPedometer | [inline]
ScenarioRegisterTask_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BackgroundPedometer | [inline, private]
ScenarioUnregisterTask_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BackgroundPedometer | [inline, private]
sensor | Scenario4_BackgroundPedometer | [private]
stepCount | Scenario4_BackgroundPedometer | [private]
stepGoal | Scenario4_BackgroundPedometer | [private]
stepGoalOffset | Scenario4_BackgroundPedometer | [private]
UpdateUIAsync(string status) | Scenario4_BackgroundPedometer | [inline, private]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/pch.h Source File

  • CameraResolution
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Common/ItemsDataProvider.cs Source File

  • AdvancedCasting
  • cs
  • Data
  • Common

ItemsDataProvider.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 namespace ScreenCasting.Data.Common
00019 {
00020     public abstract class ItemsDataProvider
00021     {
00022         public abstract List<VideoMetaData> GetAll(int max_results);
00023
00024         public abstract VideoMetaData GetRandomVideo();
00025         public abstract VideoMetaData GetFromID(string ID);
00026
00027     }
00028 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario5_MulticastAndBroadcast.xaml.cs Source File

  • DatagramSocket
  • cs

Scenario5_MulticastAndBroadcast.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Connectivity;
00018 using Windows.Networking.Sockets;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace DatagramSocketSample
00026 {
00027     /// <summary>
00028     /// A page for fifth scenario.
00029     /// </summary>
00030     public sealed partial class Scenario5 : Page
00031     {
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         private MainPage rootPage = MainPage.Current;
00035
00036         private DatagramSocket listenerSocket = null;
00037
00038         public Scenario5()
00039         {
00040             this.InitializeComponent();
00041         }
00042
00043         private void CloseListenerSocket()
00044         {
00045             if (listenerSocket != null)
00046             {
00047                 // DatagramSocket.Close() is exposed through the Dispose() method in C#.
00048                 // The call below explicitly closes the socket, freeing the UDP port that it is currently bound to.
00049                 listenerSocket.Dispose();
00050                 listenerSocket = null;
00051             }
00052         }
00053
00054         /// <summary>
00055         /// Invoked when this page is about to be displayed in a Frame.
00056         /// </summary>
00057         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00058         /// property is typically used to configure the page.</param>
00059         protected override void OnNavigatedTo(NavigationEventArgs e)
00060         {
00061             MulticastRadioButton.IsChecked = true;
00062         }
00063
00064         /// <summary>
00065         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00066         /// </summary>
00067         /// <param name="e">Event data representative of the navigation that will unload the current Page.</param>
00068         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00069         {
00070             CloseListenerSocket();
00071         }
00072
00073         // Sets up the UI to display the multicast scenario options.
00074         private void SetupMulticastScenarioUI()
00075         {
00076             RemoteAddressLabel.Text = "Multicast Group:";
00077             StartListener.Content = "Start listener and join multicast group";
00078             RemoteAddress.Text = "224.3.0.5";
00079             RemoteAddress.IsEnabled = false;
00080             SendMessageButton.IsEnabled = false;
00081             CloseListenerButton.IsEnabled = false;
00082             SendOutput.Text = "";
00083         }
00084
00085         // Sets up the UI to display the broadcast scenario options.
00086         private void SetupBroadcastScenarioUI()
00087         {
00088             RemoteAddressLabel.Text = "Broadcast Address:";
00089             StartListener.Content = "Start listener";
00090             RemoteAddress.Text = "255.255.255.255";
00091             RemoteAddress.IsEnabled = false;
00092             SendMessageButton.IsEnabled = false;
00093             CloseListenerButton.IsEnabled = false;
00094             SendOutput.Text = "";
00095         }
00096
00097         private void MulticastRadioButton_Checked(object sender, RoutedEventArgs e)
00098         {
00099             CloseListenerSocket();
00100             SetupMulticastScenarioUI();
00101         }
00102
00103         private void MulticastRadioButton_Unchecked(object sender, RoutedEventArgs e)
00104         {
00105             CloseListenerSocket();
00106             SetupBroadcastScenarioUI();
00107         }
00108
00109         /// <summary>
00110         /// This is the click handler for the 'StartListener' button.
00111         /// </summary>
00112         /// <param name="sender">Object for which the event was generated.</param>
00113         /// <param name="e">Event's parameters.</param>
00114         private async void StartListener_Click(object sender, RoutedEventArgs e)
00115         {
00116             if (String.IsNullOrEmpty(ServiceName.Text))
00117             {
00118                 rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
00119                 return;
00120             }
00121
00122             if (listenerSocket != null)
00123             {
00124                 rootPage.NotifyUser("A listener socket is already set up.", NotifyType.ErrorMessage);
00125                 return;
00126             }
00127
00128             bool isMulticastSocket = (MulticastRadioButton.IsChecked == true);
00129             listenerSocket = new DatagramSocket();
00130             listenerSocket.MessageReceived += MessageReceived;
00131
00132             if (isMulticastSocket)
00133             {
00134                 // DatagramSockets conduct exclusive (SO_EXCLUSIVEADDRUSE) binds by default, effectively blocking
00135                 // any other UDP socket on the system from binding to the same local port. This is done to prevent
00136                 // other applications from eavesdropping or hijacking a DatagramSocket's unicast traffic.
00137                 //
00138                 // Setting the MulticastOnly control option to 'true' enables a DatagramSocket instance to share its
00139                 // local port with any Win32 sockets that are bound using SO_REUSEADDR/SO_REUSE_MULTICASTPORT and
00140                 // with any other DatagramSocket instances that have MulticastOnly set to true. However, note that any
00141                 // attempt to use a multicast-only DatagramSocket instance to send or receive unicast data will result
00142                 // in an exception being thrown.
00143                 //
00144                 // This control option is particularly useful when implementing a well-known multicast-based protocol,
00145                 // such as mDNS and UPnP, since it enables a DatagramSocket instance to coexist with other applications
00146                 // running on the system that also implement that protocol.
00147                 listenerSocket.Control.MulticastOnly = true;
00148             }
00149
00150             // Start listen operation.
00151             try
00152             {
00153                 await listenerSocket.BindServiceNameAsync(ServiceName.Text);
00154
00155                 if (isMulticastSocket)
00156                 {
00157                     // Join the multicast group to start receiving datagrams being sent to that group.
00158                     listenerSocket.JoinMulticastGroup(new HostName(RemoteAddress.Text));
00159
00160                     rootPage.NotifyUser(
00161                         "Listening on port " + listenerSocket.Information.LocalPort + " and joined to multicast group",
00162                         NotifyType.StatusMessage);
00163                 }
00164                 else
00165                 {
00166                     rootPage.NotifyUser(
00167                         "Listening on port " + listenerSocket.Information.LocalPort,
00168                         NotifyType.StatusMessage);
00169                 }
00170
00171                 // Enable scenario steps that require us to have an active listening socket.
00172                 SendMessageButton.IsEnabled = true;
00173                 CloseListenerButton.IsEnabled = true;
00174             }
00175             catch (Exception exception)
00176             {
00177                 listenerSocket.Dispose();
00178                 listenerSocket = null;
00179
00180                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00181                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00182                 {
00183                     throw;
00184                 }
00185
00186                 rootPage.NotifyUser(
00187                     "Start listening failed with error: " + exception.Message,
00188                     NotifyType.ErrorMessage);
00189             }
00190         }
00191
00192         /// <summary>
00193         /// This is the click handler for the 'SendMessage' button.
00194         /// </summary>
00195         /// <param name="sender">Object for which the event was generated.</param>
00196         /// <param name="e">Event's parameters.</param>
00197         private async void SendMessage_Click(object sender, RoutedEventArgs e)
00198         {
00199             SendOutput.Text = "";
00200
00201             try
00202             {
00203                 IOutputStream outputStream;
00204                 HostName remoteHostname = new HostName(RemoteAddress.Text);
00205
00206                 // GetOutputStreamAsync can be called multiple times on a single DatagramSocket instance to obtain
00207                 // IOutputStreams pointing to various different remote endpoints. The remote hostname given to
00208                 // GetOutputStreamAsync can be a unicast, multicast or broadcast address.
00209                 outputStream = await listenerSocket.GetOutputStreamAsync(remoteHostname, ServiceName.Text);
00210
00211                 // Send out some multicast or broadcast data. Datagrams generated by the IOutputStream will use
00212                 // <source host, source port> information obtained from the parent socket (i.e., 'listenSocket' in
00213                 // this case).
00214                 const string stringToSend = "Hello";
00215                 DataWriter writer = new DataWriter(outputStream);
00216                 writer.WriteString(stringToSend);
00217                 await writer.StoreAsync();
00218
00219                 SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
00220             }
00221             catch (Exception exception)
00222             {
00223                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00224                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00225                 {
00226                     throw;
00227                 }
00228
00229                 rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
00230             }
00231         }
00232
00233         /// <summary>
00234         /// This is the click handler for the 'CloseListener' button.
00235         /// </summary>
00236         /// <param name="sender">Object for which the event was generated.</param>
00237         /// <param name="e">Event's parameters.</param>
00238         private void CloseListener_Click(object sender, RoutedEventArgs e)
00239         {
00240             CloseListenerSocket();
00241
00242             // Disable scenario steps that require us to have an active listening socket.
00243             SendMessageButton.IsEnabled = false;
00244             CloseListenerButton.IsEnabled = false;
00245             SendOutput.Text = "";
00246
00247             rootPage.NotifyUser("Listener closed", NotifyType.StatusMessage);
00248         }
00249
00250         /// <summary>
00251         /// Message received handler
00252         /// </summary>
00253         /// <param name="socket">The socket object</param>
00254         /// <param name="eventArguments">The datagram event information</param>
00255         void MessageReceived(DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments)
00256         {
00257             try
00258             {
00259                 // Interpret the incoming datagram's entire contents as a string.
00260                 uint stringLength = eventArguments.GetDataReader().UnconsumedBufferLength;
00261                 string receivedMessage = eventArguments.GetDataReader().ReadString(stringLength);
00262
00263                 NotifyUserFromAsyncThread(
00264                     "Received data from remote peer (Remote Address: " +
00265                     eventArguments.RemoteAddress.CanonicalName +
00266                     ", Remote Port: " +
00267                     eventArguments.RemotePort + "): \"" +
00268                      receivedMessage + "\"",
00269                     NotifyType.StatusMessage);
00270             }
00271             catch (Exception exception)
00272             {
00273                 SocketErrorStatus socketError = SocketError.GetStatus(exception.HResult);
00274
00275                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00276                 {
00277                     throw;
00278                 }
00279
00280                 rootPage.NotifyUser(
00281                     "Error happened when receiving a datagram:" + exception.Message,
00282                     NotifyType.ErrorMessage);
00283             }
00284         }
00285
00286         /// <summary>
00287         /// Notifies the user from a non-UI thread
00288         /// </summary>
00289         /// <param name="strMessage">The message</param>
00290         /// <param name="type">The type of notification</param>
00291         private void NotifyUserFromAsyncThread(string strMessage, NotifyType type)
00292         {
00293             var ignore = Dispatcher.RunAsync(
00294                 CoreDispatcherPriority.Normal, () => rootPage.NotifyUser(strMessage, type));
00295         }
00296     }
00297 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario3_EnumerateTiles.xaml.cs Source File

  • SecondaryTiles
  • cs

Scenario3_EnumerateTiles.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Text;
00014 using Windows.UI.StartScreen;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario3_EnumerateTiles : Page
00021     {
00022         MainPage rootPage = MainPage.Current;
00023
00024         public Scenario3_EnumerateTiles()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         private async void EnumerateSecondaryTiles_Click(object sender, RoutedEventArgs e)
00030         {
00031             // Get secondary tile ids for this package
00032             IReadOnlyList<SecondaryTile> tilelist = await SecondaryTile.FindAllAsync();
00033             if (tilelist.Count > 0)
00034             {
00035                 StringBuilder outputText = new StringBuilder();
00036                 foreach (var tile in tilelist)
00037                 {
00038                     outputText.AppendLine($"Tile \"{tile.TileId}\", Display name = \"{tile.DisplayName}\"");
00039                 }
00040                 rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
00041             }
00042             else
00043             {
00044                 rootPage.NotifyUser("No secondary tiles are available for this appId.", NotifyType.ErrorMessage);
00045             }
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

TripStore.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "TripStore.h"
00013
00014 using namespace AdventureWorks_Shared;
00015
00016 using namespace Microsoft::WRL;
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace Platform::Collections;
00021 using namespace Windows::ApplicationModel::Core;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Globalization;
00025 using namespace Windows::Globalization::DateTimeFormatting;
00026 using namespace Windows::Storage;
00027 using namespace Windows::Storage::Streams;
00028 using namespace Windows::UI::Core;
00029
00030 TripStore::TripStore()
00031 {
00032     loaded = false;
00033     this->trips = ref new Vector<Trip^>();
00034 }
00035
00036 /// <summary> Asynchronously load trips </summary>
00037 void TripStore::LoadTrips()
00038 {
00039     // load asynchronously, without waiting.
00040     LoadTripsTask();
00041 }
00042
00043 /// <summary> Load trips synchronously. Used by the background task service. </summary>
00044 void TripStore::LoadTripsSync()
00045 {
00046     LoadTripsTask().wait();
00047 }
00048
00049 /// <summary> Read the xml data from the provided stream and extract trip data </summary>
00050 /// <param name="randomAccessReadStream">The stream pointing to trips.xml</param>
00051 HRESULT TripStore::ReadXml(IRandomAccessStream^ randomAccessReadStream)
00052 {
00053     HRESULT hr;
00054     ComPtr<IStream> readStream;
00055     ComPtr<IXmlReader> reader;
00056     XmlNodeType nodeType;
00057
00058     Trip^ trip = nullptr;
00059     String^ currField = nullptr;
00060
00061     ChkHr(::CreateStreamOverRandomAccessStream(randomAccessReadStream, IID_PPV_ARGS(&readStream)));
00062     ChkHr(::CreateXmlReader(IID_PPV_ARGS(&reader), nullptr));
00063     ChkHr(reader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit));
00064     ChkHr(reader->SetInput(readStream.Get()));
00065
00066     // process into Trip objects.
00067     while (S_OK == (hr = reader->Read(&nodeType)))
00068     {
00069         PCWSTR localName = nullptr;
00070
00071         unsigned int localNameSize = 0;
00072
00073         switch (nodeType)
00074         {
00075         case XmlNodeType_Element:
00076             ChkHr(reader->GetLocalName(&localName, &localNameSize));
00077             if (localNameSize > 0 && localName != nullptr)
00078             {
00079                 if (wcsncmp(L"Trip", localName, localNameSize) == 0)
00080                 {
00081                     // before creating a new trip, append the current one to the trip set.
00082                     if (trip != nullptr)
00083                     {
00084                         this->Trips->Append(trip);
00085                     }
00086
00087                     trip = ref new Trip();
00088                     currField = nullptr;
00089                 }
00090                 else if (trip != nullptr)
00091                 {
00092                     if (wcsncmp(L"Destination", localName, localNameSize) == 0)
00093                     {
00094                         currField = ref new String(localName);
00095                     }
00096                     else if (wcsncmp(L"Description", localName, localNameSize) == 0)
00097                     {
00098                         currField = ref new String(localName);
00099                     }
00100                     else if (wcsncmp(L"StartDate", localName, localNameSize) == 0)
00101                     {
00102                         currField = ref new String(localName);
00103                     }
00104                     else if (wcsncmp(L"EndDate", localName, localNameSize) == 0)
00105                     {
00106                         currField = ref new String(localName);
00107                     }
00108                     else if (wcsncmp(L"Notes", localName, localNameSize) == 0)
00109                     {
00110                         currField = ref new String(localName);
00111                     }
00112                     else
00113                     {
00114                         if (trip != nullptr)
00115                         {
00116                             this->Trips->Append(trip);
00117                         }
00118
00119                         trip = nullptr;
00120                         currField = nullptr;
00121                     }
00122                 }
00123             }
00124             break;
00125         case XmlNodeType_Text:
00126             if (trip == nullptr)
00127             {
00128                 break;
00129             }
00130
00131             PCWSTR textFieldValue;
00132             unsigned int textFieldSize;
00133             ChkHr(reader->GetValue(&textFieldValue, &textFieldSize));
00134             if (currField == L"Destination")
00135             {
00136                 trip->Destination = ref new String(textFieldValue);
00137             }
00138             else if (currField == L"Description")
00139             {
00140                 trip->Description = ref new String(textFieldValue);
00141             }
00142             else if (currField == L"StartDate")
00143             {
00144                 trip->StartDate = ref new Calendar();
00145                 std::tm datetime;
00146                 std::wistringstream ss(textFieldValue);
00147
00148                 //
00149                 ss >> std::get_time(&datetime, L"%Y-%m-%d");
00150                 if (ss.fail())
00151                 {
00152                     OutputDebugStringW(L"Failed to parse start date?");
00153                     ChkHr(E_INVALIDARG);
00154                 }
00155                 else
00156                 {
00157                     trip->StartDate->Day = datetime.tm_mday;
00158                     trip->StartDate->Year = datetime.tm_year + 1900;
00159                     trip->StartDate->Month = datetime.tm_mon + 1;
00160                 }
00161             }
00162             else if (currField == L"EndDate")
00163             {
00164                 trip->EndDate = ref new Calendar();
00165                 std::tm datetime;
00166                 std::wistringstream ss(textFieldValue);
00167
00168                 //
00169                 ss >> std::get_time(&datetime, L"%Y-%m-%d");
00170                 if (ss.fail())
00171                 {
00172                     OutputDebugStringW(L"Failed to parse end date?");
00173                     ChkHr(E_INVALIDARG);
00174                 }
00175                 else
00176                 {
00177                     trip->EndDate->Day = datetime.tm_mday;
00178                     trip->EndDate->Year = datetime.tm_year + 1900;
00179                     trip->EndDate->Month = datetime.tm_mon + 1;
00180                 }
00181             }
00182             else if (currField == L"Notes")
00183             {
00184                 trip->Notes = ref new String(textFieldValue);
00185             }
00186
00187             break;
00188         default:
00189             break;
00190         }
00191     }
00192
00193     // handle the final trip added.
00194     if (trip != nullptr)
00195     {
00196         this->Trips->Append(trip);
00197     }
00198
00199     return hr;
00200 }
00201
00202 /// <summary>Initiate a task to begin loading trip data, or initialize starting
00203 /// data if the trip data file does not exist yet.</summary>
00204 /// <returns>Returns a task that will complete when the trips are loaded.</returns>
00205 Concurrency::task<void> AdventureWorks_Shared::TripStore::LoadTripsTask()
00206 {
00207     if (loaded)
00208     {
00209         return create_task([]() {});
00210     }
00211
00212     StorageFolder^ folder = ApplicationData::Current->LocalFolder;
00213     this->Trips->Clear();
00214
00215     return create_task(folder->TryGetItemAsync(L"trips.xml"), task_continuation_context::use_current())
00216         .then([this](task<IStorageItem^> storageItemTask)
00217     {
00218         IStorageItem^ item = storageItemTask.get();
00219         if (item == nullptr)
00220         {
00221             Trip^ trip = ref new Trip();
00222             trip->Destination = L"London";
00223             trip->Description = L"Trip to London!";
00224             trip->StartDate = ref new Calendar();
00225             trip->StartDate->Month = 5;
00226             trip->StartDate->Day = 5;
00227             trip->StartDate->Year = 2015;
00228
00229             trip->EndDate = ref new Calendar();
00230             trip->EndDate->Month = 5;
00231             trip->EndDate->Day = 15;
00232             trip->EndDate->Year = 2015;
00233
00234             this->Trips->Append(trip);
00235
00236             trip = ref new Trip();
00237             trip->Destination = L"Melbourne";
00238             trip->Description = L"Trip to Australia";
00239             trip->StartDate = ref new Calendar();
00240             trip->StartDate->Month = 2;
00241             trip->StartDate->Day = 2;
00242             trip->StartDate->Year = 2016;
00243
00244             trip->EndDate = ref new Calendar();
00245
00246             trip->EndDate->Month = 5;
00247             trip->EndDate->Day = 17;
00248             trip->EndDate->Year = 2016;
00249             trip->Notes = L"Bring Sunscreen!";
00250
00251             this->Trips->Append(trip);
00252
00253             trip = ref new Trip();
00254             trip->Destination = L"Yosemite National Park";
00255             trip->Description = L"Trip to Yosemite!";
00256             trip->StartDate = ref new Calendar();
00257             trip->StartDate->Month = 11;
00258             trip->StartDate->Day = 7;
00259             trip->StartDate->Year = 2015;
00260
00261             trip->EndDate = ref new Calendar();
00262             trip->EndDate->Month = 7;
00263             trip->EndDate->Day = 19;
00264             trip->EndDate->Year = 2015;
00265             trip->Notes = L"Buy some new hiking boots";
00266
00267             this->Trips->Append(trip);
00268
00269             return create_task([this]()
00270             {
00271                 this->WriteTrips();
00272             });
00273         }
00274         else if (item->IsOfType(StorageItemTypes::File))
00275         {
00276             StorageFile^ tripsFile = dynamic_cast<StorageFile^>(item);
00277             if (tripsFile != nullptr)
00278             {
00279                 return create_task(tripsFile->OpenAsync(FileAccessMode::Read), task_continuation_context::use_current()).then([this](IRandomAccessStream^ readStream)
00280                 {
00281                     HRESULT hr = ReadXml(readStream);
00282                     if (FAILED(hr))
00283                     {
00284                         OutputDebugStringW(L"Failed reading trips.xml");
00285                     }
00286                     this->loaded = true;
00287                 });
00288             }
00289         }
00290         return create_task([]() {});
00291     });
00292
00293 }
00294
00295 IObservableVector<Trip^>^ TripStore::Trips::get()
00296 {
00297     return this->trips;
00298 }
00299
00300 /// <summary> Delete the specified trip, if it exists in the store, and save
00301 /// the trip store </summary>
00302 /// <param name="trip">the trip to delete</param>
00303 IAsyncAction ^ TripStore::DeleteTripAsync(Trip ^ trip)
00304 {
00305     OutputDebugStringW(L"TODO Delete trip from store");
00306     for (unsigned int i = 0; i < this->Trips->Size; i++)
00307     {
00308         if (this->Trips->GetAt(i) == trip)
00309         {
00310             this->Trips->RemoveAt(i);
00311             break;
00312         }
00313     }
00314
00315     return create_async([this, trip]()
00316     {
00317         this->WriteTrips();
00318     });
00319 }
00320
00321 /// <summary>Add the specified trip to the store, if it doesn't exist, and save
00322 /// the trip store </summary>
00323 /// <param name="trip">the trip to add</param>
00324 IAsyncAction ^ TripStore::SaveTripAsync(Trip ^ trip)
00325 {
00326     return create_async([this, trip]()
00327     {
00328         unsigned int index = 0;
00329         if (!this->Trips->IndexOf(trip, &index))
00330         {
00331             /// note, currently this can't be called from the background thread.
00332             CoreApplicationView^ view = CoreApplication::MainView;
00333             view->CoreWindow->Dispatcher->RunAsync(
00334                 CoreDispatcherPriority::Normal,
00335                 ref new DispatchedHandler([this, trip]()
00336             {
00337                 this->Trips->Append(trip);
00338             }));
00339         }
00340
00341         this->WriteTrips();
00342     });
00343
00344 }
00345
00346 /// <summary> Return a task that loads the trip store, which can be waited on</summary>
00347 /// <returns> IAsyncAction task that completes once the data is loaded</returns>
00348 Windows::Foundation::IAsyncAction ^ AdventureWorks_Shared::TripStore::LoadTripsAsync()
00349 {
00350     return create_async(
00351         [this]() {
00352         return LoadTripsTask();
00353     });
00354 }
00355
00356 /// <summary> Trigger asynchronous writing of trip data to disk</summary>
00357 void TripStore::WriteTrips()
00358 {
00359     StorageFolder^ folder = Windows::Storage::ApplicationData::Current->LocalFolder;
00360
00361     create_task(folder->CreateFileAsync(L"trips.xml", CreationCollisionOption::ReplaceExisting)).then([this](StorageFile^ file)
00362     {
00363         create_task(file->OpenAsync(FileAccessMode::ReadWrite)).then([file, this](IRandomAccessStream^ writeStream)
00364         {
00365             HRESULT hr = S_OK;
00366
00367             ComPtr<IStream> tripsOutputStream;
00368             ComPtr<IXmlWriter> tripsXmlWriter;
00369             auto formatter = ref new DateTimeFormatter("{year.full}-{month.integer(2)}-{day.integer(2)}");
00370
00371             ChkHr(::CreateStreamOverRandomAccessStream(writeStream, IID_PPV_ARGS(&tripsOutputStream)));
00372             ChkHr(::CreateXmlWriter(IID_PPV_ARGS(&tripsXmlWriter), nullptr));
00373             ChkHr(tripsXmlWriter->SetOutput(tripsOutputStream.Get()));
00374             ChkHr(tripsXmlWriter->SetProperty(XmlWriterProperty_Indent, TRUE));
00375
00376             ChkHr(tripsXmlWriter->WriteStartDocument(XmlStandalone_Omit));
00377             ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"Root", nullptr));
00378
00379             for (unsigned int i = 0; i < this->Trips->Size; i++)
00380             {
00381                 Trip^ trip = this->Trips->GetAt(i);
00382
00383                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"Trip", nullptr));
00384
00385
00386                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"Destination", nullptr));
00387                 ChkHr(tripsXmlWriter->WriteString(trip->Destination->Data()));
00388                 ChkHr(tripsXmlWriter->WriteEndElement());
00389
00390                 // Description, may be null/empty
00391                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"Description", nullptr));
00392                 if ((trip->Description != nullptr) && !trip->Description->IsEmpty())
00393                 {
00394                     ChkHr(tripsXmlWriter->WriteString(trip->Description->Data()));
00395                 }
00396                 ChkHr(tripsXmlWriter->WriteEndElement());
00397
00398                 // StartDate field, may be null, format using expected xml date format. (yyyy-mm-dd)
00399                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"StartDate", nullptr));
00400                 if (trip->StartDate != nullptr)
00401                 {
00402                     String^ str = formatter->Format(trip->StartDate->GetDateTime());
00403                     ChkHr(tripsXmlWriter->WriteString(str->Data()));
00404                 }
00405                 ChkHr(tripsXmlWriter->WriteEndElement());
00406
00407                 // EndDate field, may be null, format using expected xml date format. (yyyy-mm-dd)
00408                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"EndDate", nullptr));
00409                 if (trip->EndDate != nullptr)
00410                 {
00411                     String^ str = formatter->Format(trip->EndDate->GetDateTime());
00412                     ChkHr(tripsXmlWriter->WriteString(str->Data()));
00413                 }
00414                 ChkHr(tripsXmlWriter->WriteEndElement());
00415
00416                 // Notes, may be null
00417                 ChkHr(tripsXmlWriter->WriteStartElement(nullptr, L"Notes", nullptr));
00418                 if ((trip->Notes != nullptr) && !trip->Notes->IsEmpty())
00419                 {
00420                     ChkHr(tripsXmlWriter->WriteString(trip->Notes->Data()));
00421                 }
00422                 ChkHr(tripsXmlWriter->WriteEndElement());
00423
00424                 // end Trip tag.
00425                 ChkHr(tripsXmlWriter->WriteEndElement());
00426             };
00427
00428             return hr;
00429         });
00430     });
00431 }
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario4_Snapshot.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario4_Snapshot.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Platform::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::UI::Core;
00013 using namespace Windows::UI::Xaml;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Controls::Primitives;
00016 using namespace Windows::UI::Xaml::Data;
00017 using namespace Windows::UI::Xaml::Input;
00018 using namespace Windows::UI::Xaml::Media;
00019 using namespace Windows::UI::Xaml::Navigation;
00020 using namespace Windows::Devices::Enumeration;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 Scenario4_Snapshot::Scenario4_Snapshot()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario4_Snapshot::OnNavigatedTo(NavigationEventArgs^ e)
00030 {
00031     resultsListView->ItemsSource = resultCollection;
00032
00033     selectorComboBox->ItemsSource = DeviceSelectorChoices::FindAllAsyncSelectors;
00034     selectorComboBox->SelectedIndex = 0;
00035 }
00036
00037 void Scenario4_Snapshot::FindButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00038 {
00039     DeviceSelectorInfo^ deviceSelectorInfo;
00040     IAsyncOperation<DeviceInformationCollection^>^ asyncOp;
00041
00042     findButton->IsEnabled = false;
00043     resultCollection->Clear();
00044
00045     // First get the device selector chosen by the UI.
00046     deviceSelectorInfo = safe_cast<DeviceSelectorInfo^>(selectorComboBox->SelectedItem);
00047
00048     rootPage->NotifyUser("FindAllAsync operation started...", NotifyType::StatusMessage);
00049
00050     if (nullptr == deviceSelectorInfo->Selector)
00051     {
00052         // If the a pre-canned device class selector was chosen, call the DeviceClass overload
00053         asyncOp = DeviceInformation::FindAllAsync(deviceSelectorInfo->DeviceClassSelector);
00054     }
00055     else
00056     {
00057         // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
00058         asyncOp = DeviceInformation::FindAllAsync(
00059             deviceSelectorInfo->Selector,
00060             nullptr // don't request additional properties for this sample
00061             );
00062     }
00063
00064     // Notice below we'll use the default context insted of the current (UI thread) to reduce load
00065     // on the UI thread. Updates to UI bound elements will be done with a low priority dispatch.
00066     concurrency::create_task(asyncOp).then(
00067         [this](DeviceInformationCollection^ deviceInfoCollection)
00068     {
00069         rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Low, ref new DispatchedHandler(
00070             [this, deviceInfoCollection]()
00071         {
00072             rootPage->NotifyUser(
00073                 "FindAllAsync operation completed. " + deviceInfoCollection->Size.ToString() + " devices found.",
00074                 NotifyType::StatusMessage);
00075         }));
00076
00077         std::for_each(begin(deviceInfoCollection), end(deviceInfoCollection), [&](DeviceInformation^ deviceInfo)
00078         {
00079             rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Low, ref new DispatchedHandler(
00080                 [this, deviceInfo]()
00081             {
00082                 resultCollection->Append(ref new DeviceInformationDisplay(deviceInfo));
00083             }));
00084         });
00085
00086         rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Low, ref new DispatchedHandler(
00087             [this]()
00088         {
00089             findButton->IsEnabled = true;
00090         }));
00091     }, concurrency::task_continuation_context::use_default());
00092 }
00093
Generated on Fri Nov 15 2024 22:19:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/pch.h Source File

  • DeviceEnumerationAndPairing
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cs/Find.xaml.cs Source File

  • SemanticTextQuery
  • cs

Find.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using Windows.Foundation;
00014 using Windows.Storage.Search;
00015 using Windows.UI.Text;
00016 using Windows.UI.Xaml.Documents;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020 using System;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class Scenario1
00028     {
00029         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00030         // as NotifyUser()
00031         MainPage rootPage = MainPage.Current;
00032
00033         public Scenario1()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         /// <summary>
00039         /// Invoked when this page is about to be displayed in a Frame.
00040         /// </summary>
00041         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00042         /// property is typically used to configure the page.</param>
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045             FindQueryText.Text = "continent OR can OR rain";
00046             ContentText.Text = "Mount Rainier is on the North American Continent.";
00047         }
00048
00049         private void Find_Click(object sender, RoutedEventArgs e)
00050         {
00051             ContentTextOutput.Text = "";
00052             var mySemanticTextQuery = new Windows.Data.Text.SemanticTextQuery(FindQueryText.Text);
00053             IReadOnlyList<Windows.Data.Text.TextSegment> ranges = mySemanticTextQuery.Find(ContentText.Text);
00054             rootPage.HighlightRanges(ContentTextOutput, ContentText.Text, ranges);
00055         }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/pch.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/Scenario2_AamvaCards.xaml.cs Source File

  • MagneticStripeReader
  • cs

Scenario2_AamvaCards.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.PointOfService;
00018 using System.Threading.Tasks;
00019 using Windows.UI.Core;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace MagneticStripeReaderSample
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario2_AamvaCards : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         MagneticStripeReader _reader = null;
00035         ClaimedMagneticStripeReader _claimedReader = null;
00036
00037         public Scenario2_AamvaCards()
00038         {
00039             this.InitializeComponent();
00040         }
00041
00042         /// <summary>
00043         /// Creates the default magnetic stripe reader.
00044         /// </summary>
00045         /// <returns>true if magnetic stripe reader is created. Otherwise returns false</returns>
00046         private async Task<bool> CreateDefaultMagneticStripeReaderObject()
00047         {
00048             if (_reader == null)
00049             {
00050                 _reader = await DeviceHelpers.GetFirstMagneticStripeReaderAsync();
00051
00052                 if (_reader == null)
00053                 {
00054                     rootPage.NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType.ErrorMessage);
00055                     return false;
00056                 }
00057             }
00058             return true;
00059         }
00060
00061         /// <summary>
00062         /// Claim the magnetic stripe reader
00063         /// </summary>
00064         /// <returns>true if claim is successful. Otherwise returns false</returns>
00065         private async Task<bool> ClaimReader()
00066         {
00067             if (_claimedReader == null)
00068             {
00069                 // claim the magnetic stripe reader
00070                 _claimedReader = await _reader.ClaimReaderAsync();
00071
00072                 if (_claimedReader == null)
00073                 {
00074                     rootPage.NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType.ErrorMessage);
00075                     return false;
00076                 }
00077             }
00078             return true;
00079         }
00080
00081         private async void ScenarioStartReadButton_Click(object sender, RoutedEventArgs e)
00082         {
00083             if (await CreateDefaultMagneticStripeReaderObject())
00084             {
00085                 if (_reader != null)
00086                 {
00087                     // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
00088                     if (await ClaimReader())
00089                     {
00090                         if (_claimedReader != null)
00091                         {
00092                             // It is always a good idea to have a release device requested event handler. If this event is not handled, there is a chance that another app can
00093                             // claim ownsership of the magnetic stripe reader.
00094                             _claimedReader.ReleaseDeviceRequested += OnReleaseDeviceRequested;
00095
00096                             // after successfully claiming and enabling, attach the AamvaCardDataReceived event handler.
00097                             // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be of any use because the API will not fire the event
00098                             // if the claimedScanner has not beed Enabled
00099                             _claimedReader.AamvaCardDataReceived += OnAamvaCardDataReceived;
00100
00101                             // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
00102                             _claimedReader.IsDecodeDataEnabled = true;
00103
00104                             await _claimedReader.EnableAsync();
00105
00106                             rootPage.NotifyUser("Ready to swipe. Device ID: " + _claimedReader.DeviceId, NotifyType.StatusMessage);
00107
00108                             // reset the button state
00109                             ScenarioEndReadButton.IsEnabled = true;
00110                             ScenarioStartReadButton.IsEnabled = false;
00111                         }
00112                     }
00113                 }
00114             }
00115         }
00116
00117         /// <summary>
00118         /// Event handler for End button
00119         /// </summary>
00120         /// <param name="sender"></param>
00121         /// <param name="e"></param>
00122         void ScenarioEndReadButton_Click(object sender, RoutedEventArgs e)
00123         {
00124             ResetTheScenarioState();
00125         }
00126
00127         /// <summary>
00128         /// Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application
00129         /// </summary>
00130         /// <param name="sender"></param>
00131         /// <param name="args"> Contains the ClaimedMagneticStripeReader that is sending this request</param>
00132         void OnReleaseDeviceRequested(object sender, ClaimedMagneticStripeReader args)
00133         {
00134             // let us retain the device always. If it is not retained, this exclusive claim will be lost.
00135             args.RetainDevice();
00136         }
00137
00138         /// <summary>
00139         /// Event handler for the DataReceived event fired when a AAMVA card is read by the magnetic stripe reader
00140         /// </summary>
00141         /// <param name="sender"></param>
00142         /// <param name="args"> Contains the MagneticStripeReaderAamvaCardDataReceivedEventArgs which contains the data obtained in the scan</param>
00143         async void OnAamvaCardDataReceived(object sender, MagneticStripeReaderAamvaCardDataReceivedEventArgs args)
00144         {
00145             // read the data and display
00146             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00147             {
00148                 rootPage.NotifyUser("Got data.", NotifyType.StatusMessage);
00149
00150                 ScenarioOutputAddress.Text = args.Address;
00151                 ScenarioOutputBirthDate.Text = args.BirthDate;
00152                 ScenarioOutputCity.Text = args.City;
00153                 ScenarioOutputClass.Text = args.Class;
00154                 ScenarioOutputEndorsements.Text = args.Endorsements;
00155                 ScenarioOutputExpirationDate.Text = args.ExpirationDate;
00156                 ScenarioOutputEyeColor.Text = args.EyeColor;
00157                 ScenarioOutputFirstName.Text = args.FirstName;
00158                 ScenarioOutputGender.Text = args.Gender;
00159                 ScenarioOutputHairColor.Text = args.HairColor;
00160                 ScenarioOutputHeight.Text = args.Height;
00161                 ScenarioOutputLicenseNumber.Text = args.LicenseNumber;
00162                 ScenarioOutputPostalCode.Text = args.PostalCode;
00163                 ScenarioOutputRestrictions.Text = args.Restrictions;
00164                 ScenarioOutputState.Text = args.State;
00165                 ScenarioOutputSuffix.Text = args.Suffix;
00166                 ScenarioOutputSurname.Text = args.Surname;
00167                 ScenarioOutputWeight.Text = args.Weight;
00168             });
00169
00170         }
00171
00172         /// <summary>
00173         /// Invoked when this page is about to be displayed in a Frame.
00174         /// </summary>
00175         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00176         /// property is typically used to configure the page.</param>
00177         protected override void OnNavigatedTo(NavigationEventArgs e)
00178         {
00179             ResetTheScenarioState();
00180             base.OnNavigatedTo(e);
00181         }
00182
00183         /// <summary>
00184         /// Invoked when this page is no longer displayed.
00185         /// </summary>
00186         /// <param name="e"></param>
00187         protected override void OnNavigatedFrom(NavigationEventArgs e)
00188         {
00189             ResetTheScenarioState();
00190             base.OnNavigatedFrom(e);
00191         }
00192
00193         /// <summary>
00194         /// Reset the Scenario state
00195         /// </summary>
00196         void ResetTheScenarioState()
00197         {
00198             if (_claimedReader != null)
00199             {
00200                 // Detach the datareceived event handler and releasedevicerequested event handler
00201                 _claimedReader.AamvaCardDataReceived -= OnAamvaCardDataReceived;
00202                 _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;
00203
00204                 // release the Claimed Magnetic Stripe Reader and set to null
00205                 _claimedReader.Dispose();
00206                 _claimedReader = null;
00207             }
00208
00209             if (_reader != null)
00210             {
00211                 // release the Magnetic Stripe Reader and set to null
00212                 _reader.Dispose();
00213                 _reader = null;
00214             }
00215
00216             // Reset the strings in the UI
00217             rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);
00218
00219             ScenarioOutputAddress.Text = "No data";
00220             ScenarioOutputBirthDate.Text = "No data";
00221             ScenarioOutputCity.Text = "No data";
00222             ScenarioOutputClass.Text = "No data";
00223             ScenarioOutputEndorsements.Text = "No data";
00224             ScenarioOutputExpirationDate.Text = "No data";
00225             ScenarioOutputEyeColor.Text = "No data";
00226             ScenarioOutputFirstName.Text = "No data";
00227             ScenarioOutputGender.Text = "No data";
00228             ScenarioOutputHairColor.Text = "No data";
00229             ScenarioOutputHeight.Text = "No data";
00230             ScenarioOutputLicenseNumber.Text = "No data";
00231             ScenarioOutputPostalCode.Text = "No data";
00232             ScenarioOutputRestrictions.Text = "No data";
00233             ScenarioOutputState.Text = "No data";
00234             ScenarioOutputSuffix.Text = "No data";
00235             ScenarioOutputSurname.Text = "No data";
00236             ScenarioOutputWeight.Text = "No data";
00237
00238             // reset the button state
00239             ScenarioEndReadButton.IsEnabled = false;
00240             ScenarioStartReadButton.IsEnabled = true;
00241         }
00242     }
00243 }
Generated on Fri Nov 15 2024 22:20:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/360VideoPlaybackMain.cpp Source File

  • 360VideoPlayback
  • cpp

360VideoPlaybackMain.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "360VideoPlaybackMain.h"
00003 #include "Common\DirectXHelper.h"
00004 #include <windows.graphics.directx.direct3d11.interop.h>
00005 #include <Collection.h>
00006
00007 using namespace _360VideoPlayback;
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace std;
00011 using namespace std::placeholders;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Numerics;
00014 using namespace Windows::Gaming::Input;
00015 using namespace Windows::Graphics::Holographic;
00016 using namespace Windows::Perception::Spatial;
00017 using namespace Windows::System;
00018 using namespace Windows::UI::Core;
00019 using namespace Windows::UI::Input::Spatial;
00020
00021 const float MTC_SPAWN_DISTANCE = 1.35f;
00022
00023 std::shared_ptr<DX::DeviceResources> _360VideoPlaybackMain::m_deviceResources = nullptr;
00024
00025 shared_ptr<DX::DeviceResources> _360VideoPlaybackMain::GetDeviceResources()
00026 {
00027     if (_360VideoPlaybackMain::m_deviceResources == nullptr)
00028     {
00029         _360VideoPlaybackMain::m_deviceResources = make_shared<DX::DeviceResources>();
00030     }
00031     return _360VideoPlaybackMain::m_deviceResources;
00032 }
00033
00034 // Loads and initializes application assets when the application is loaded.
00035 _360VideoPlaybackMain::_360VideoPlaybackMain()
00036 {
00037     // Register to be notified if the device is lost or recreated.
00038     m_deviceResources->RegisterDeviceNotify(this);
00039 }
00040
00041 void _360VideoPlaybackMain::SetHolographicSpace(HolographicSpace^ holographicSpace)
00042 {
00043     UnregisterHolographicEventHandlers();
00044
00045     m_holographicSpace = holographicSpace;
00046
00047     //
00048     // TODO: Add code here to initialize your holographic content.
00049     //
00050
00051 #ifdef DRAW_SAMPLE_CONTENT
00052     // Initialize the sample hologram.
00053     m_videoRenderer = std::make_unique<VideoRenderer>();
00054     m_mediaTransportControls = std::make_unique<MediaTransportControls>();
00055
00056     m_spatialInputHandler = std::make_unique<SpatialInputHandler>();
00057 #endif
00058
00059     // Use the default SpatialLocator to track the motion of the device.
00060     m_locator = SpatialLocator::GetDefault();
00061
00062     // Be able to respond to changes in the positional tracking state.
00063     m_locatabilityChangedToken =
00064         m_locator->LocatabilityChanged +=
00065         ref new TypedEventHandler<SpatialLocator^, Object^>(
00066             std::bind(&_360VideoPlaybackMain::OnLocatabilityChanged, this, _1, _2)
00067             );
00068
00069     // Respond to camera added events by creating any resources that are specific
00070     // to that camera, such as the back buffer render target view.
00071     // When we add an event handler for CameraAdded, the API layer will avoid putting
00072     // the new camera in new HolographicFrames until we complete the deferral we created
00073     // for that handler, or return from the handler without creating a deferral. This
00074     // allows the app to take more than one frame to finish creating resources and
00075     // loading assets for the new holographic camera.
00076     // This function should be registered before the app creates any HolographicFrames.
00077     m_cameraAddedToken =
00078         m_holographicSpace->CameraAdded +=
00079         ref new TypedEventHandler<HolographicSpace^, HolographicSpaceCameraAddedEventArgs^>(
00080             std::bind(&_360VideoPlaybackMain::OnCameraAdded, this, _1, _2)
00081             );
00082
00083     // Respond to camera removed events by releasing resources that were created for that
00084     // camera.
00085     // When the app receives a CameraRemoved event, it releases all references to the back
00086     // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
00087     // The app must also ensure that the back buffer is not attached as a render target, as
00088     // shown in DeviceResources::ReleaseResourcesForBackBuffer.
00089     m_cameraRemovedToken =
00090         m_holographicSpace->CameraRemoved +=
00091         ref new TypedEventHandler<HolographicSpace^, HolographicSpaceCameraRemovedEventArgs^>(
00092             std::bind(&_360VideoPlaybackMain::OnCameraRemoved, this, _1, _2)
00093             );
00094
00095     // The simplest way to render video frame is to create a stationary reference frame
00096     // when the app is launched. This is roughly analogous to creating a "world" coordinate system
00097     // with the origin placed at the device's position as the app is launched.
00098     m_referenceFrame = m_locator->CreateAttachedFrameOfReferenceAtCurrentHeading();
00099
00100     // Notes on spatial tracking APIs:
00101     // * Stationary reference frames are designed to provide a best-fit position relative to the
00102     //   overall space. Individual positions within that reference frame are allowed to drift slightly
00103     //   as the device learns more about the environment.
00104     // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
00105     //   anchor the individual hologram to a position in the real world - for example, a point the user
00106     //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
00107     //   anchor will use the corrected position starting in the next frame after the correction has
00108     //   occurred.
00109 }
00110
00111 void _360VideoPlaybackMain::UnregisterHolographicEventHandlers()
00112 {
00113     if (m_holographicSpace != nullptr)
00114     {
00115         // Clear previous event registrations.
00116
00117         if (m_cameraAddedToken.Value != 0)
00118         {
00119             m_holographicSpace->CameraAdded -= m_cameraAddedToken;
00120             m_cameraAddedToken.Value = 0;
00121         }
00122
00123         if (m_cameraRemovedToken.Value != 0)
00124         {
00125             m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
00126             m_cameraRemovedToken.Value = 0;
00127         }
00128     }
00129
00130     if (m_locator != nullptr)
00131     {
00132         m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
00133     }
00134
00135     if (m_videoRenderer != nullptr)
00136     {
00137         m_videoRenderer->ReleaseDeviceDependentResources();
00138     }
00139 }
00140
00141 _360VideoPlaybackMain::~_360VideoPlaybackMain()
00142 {
00143     // Deregister device notification.
00144     m_deviceResources->RegisterDeviceNotify(nullptr);
00145
00146     UnregisterHolographicEventHandlers();
00147 }
00148
00149 // Updates the application state once per frame.
00150 HolographicFrame^ _360VideoPlaybackMain::Update()
00151 {
00152     // Before doing the timer update, there is some work to do per-frame
00153     // to maintain holographic rendering. First, we will get information
00154     // about the current frame.
00155
00156     // The HolographicFrame has information that the app needs in order
00157     // to update and render the current frame. The app begins each new
00158     // frame by calling CreateNextFrame.
00159     HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();
00160
00161     // Get a prediction of where holographic cameras will be when this frame
00162     // is presented.
00163     HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00164
00165     // Back buffers can change from frame to frame. Validate each buffer, and recreate
00166     // resource views and depth buffers as needed.
00167     m_deviceResources->EnsureCameraResources(holographicFrame, prediction);
00168
00169     // Next, we get a coordinate system from the attached frame of reference that is
00170     // associated with the current frame. Later, this coordinate system is used for
00171     // for creating the stereo view matrices when rendering the sample content.
00172     SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);
00173     SpatialPointerPose^ position = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);
00174
00175     bool inputReceived = false;
00176
00177
00178     // Check for new input state since the last frame.
00179     SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
00180     if (pointerState != nullptr)
00181     {
00182         inputReceived = true;
00183     }
00184
00185     // Check for Gamepad input
00186     auto gamepads = Gamepad::Gamepads;
00187     if (gamepads->Size > 0)
00188     {
00189         auto currentButtonState = gamepads->GetAt(0)->GetCurrentReading().Buttons; // We are only going to support 1 controller at the moment
00190         if (static_cast<bool>(currentButtonState & GamepadButtons::A)) // Marking 'A' Button as our click button
00191         {
00192             if (!m_isGamepadPressed) // Control the frequency of calls in Update
00193             {
00194                 inputReceived = true;
00195                 m_isGamepadPressed = true;
00196             }
00197         }
00198         else
00199         {
00200             m_isGamepadPressed = false;
00201         }
00202     }
00203
00204     // Check Mouse Input
00205     if (static_cast<bool>(CoreWindow::GetForCurrentThread()->GetKeyState(VirtualKey::LeftButton) & CoreVirtualKeyStates::Down))
00206     {
00207         if (!m_isMouseLeftKeyPressed) // Control the frequency of calls in Update
00208         {
00209             inputReceived = true;
00210             m_isMouseLeftKeyPressed = true;
00211         }
00212     }
00213     else
00214     {
00215         m_isMouseLeftKeyPressed = false;
00216     }
00217
00218     // Handle input
00219     if (inputReceived)
00220     {
00221         if (m_mediaTransportControls->IsVisible())
00222         {
00223             m_mediaTransportControls->PerformPressedAction();
00224         }
00225         else if (position != nullptr)
00226         {
00227             m_mediaTransportControls->Show(position, MTC_SPAWN_DISTANCE);
00228         }
00229     }
00230
00231     m_timer.Tick([this, position]()
00232     {
00233         //
00234         // TODO: Update scene objects.
00235         //
00236         // Put time-based updates here. By default this code will run once per frame,
00237         // but if you change the StepTimer to use a fixed time step this code will
00238         // run as many times as needed to get to the current step.
00239         //
00240
00241 #ifdef DRAW_SAMPLE_CONTENT
00242         m_videoRenderer->Update(m_timer);
00243         m_mediaTransportControls->Update(m_timer, position);
00244 #endif
00245     });
00246
00247     // We complete the frame update by using information about our content positioning
00248     // to set the focus point.
00249
00250     for (auto cameraPose : prediction->CameraPoses)
00251     {
00252 #ifdef DRAW_SAMPLE_CONTENT
00253         // The HolographicCameraRenderingParameters class provides access to set
00254         // the image stabilization parameters.
00255         HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);
00256
00257         // SetFocusPoint informs the system about a specific point in your scene to
00258         // prioritize for image stabilization. The focus point is set independently
00259         // for each holographic camera.
00260         // You should set the focus point near the content that the user is looking at.
00261         // In this example, we put the focus point at the center of the sample hologram,
00262         // since that is the only hologram available for the user to focus on.
00263         // You can also set the relative velocity and facing of that content; the sample
00264         // hologram is at a fixed point so we only need to indicate its position.
00265         float3 position = { 0.f, 0.f, 0.f };
00266         renderingParameters->SetFocusPoint(
00267             currentCoordinateSystem,
00268             position);
00269 #endif
00270     }
00271
00272     // The holographic frame will be used to get up-to-date view and projection matrices and
00273     // to present the swap chain.
00274     return holographicFrame;
00275 }
00276
00277 // Renders the current frame to each holographic camera, according to the
00278 // current application and spatial positioning state. Returns true if the
00279 // frame was rendered to at least one camera.
00280 bool _360VideoPlaybackMain::Render(HolographicFrame^ holographicFrame)
00281 {
00282     // Don't try to render anything before the first Update.
00283     if (m_timer.GetFrameCount() == 0)
00284     {
00285         return false;
00286     }
00287
00288     //
00289     // TODO: Add code for pre-pass rendering here.
00290     //
00291     // Take care of any tasks that are not specific to an individual holographic
00292     // camera. This includes anything that doesn't need the final view or projection
00293     // matrix, such as lighting maps.
00294     //
00295
00296     // Lock the set of holographic camera resources, then draw to each camera
00297     // in this frame.
00298     return m_deviceResources->UseHolographicCameraResources<bool>(
00299         [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
00300     {
00301         // Up-to-date frame predictions enhance the effectiveness of image stablization and
00302         // allow more accurate positioning of holograms.
00303         holographicFrame->UpdateCurrentPrediction();
00304         HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00305
00306         bool atLeastOneCameraRendered = false;
00307         for (auto cameraPose : prediction->CameraPoses)
00308         {
00309             // This represents the device-based resources for a HolographicCamera.
00310             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00311
00312             // Get the device context.
00313             const auto context = m_deviceResources->GetD3DDeviceContext();
00314             const auto depthStencilView = pCameraResources->GetDepthStencilView();
00315
00316             // Set render targets to the current holographic camera.
00317             ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
00318             context->OMSetRenderTargets(1, targets, depthStencilView);
00319
00320             // Clear the back buffer and depth stencil view.
00321             context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
00322             context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00323
00324             //
00325             // TODO: Replace the sample content with your own content.
00326             //
00327             // Notes regarding holographic content:
00328             //    * For drawing, remember that you have the potential to fill twice as many pixels
00329             //      in a stereoscopic render target as compared to a non-stereoscopic render target
00330             //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
00331             //      and only draw holograms that the user can see.
00332             //    * To help occlude hologram geometry, you can create a depth map using geometry
00333             //      data obtained via the surface mapping APIs. You can use this depth map to avoid
00334             //      rendering holograms that are intended to be hidden behind tables, walls,
00335             //      monitors, and so on.
00336             //    * Black pixels will appear transparent to the user wearing the device, but you
00337             //      should still use alpha blending to draw semitransparent holograms. You should
00338             //      also clear the screen to Transparent as shown above.
00339             //
00340
00341
00342             // The view and projection matrices for each holographic camera will change
00343             // every frame. This function refreshes the data in the constant buffer for
00344             // the holographic camera indicated by cameraPose.
00345             pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp));
00346
00347             // Attach the view/projection constant buffer for this camera to the graphics pipeline.
00348             bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);
00349
00350 #ifdef DRAW_SAMPLE_CONTENT
00351             // Only render world-locked content when positional tracking is active.
00352             if (cameraActive)
00353             {
00354                 // Draw the sample hologram.
00355                 m_videoRenderer->Render();
00356                 m_mediaTransportControls->Render();
00357             }
00358 #endif
00359             atLeastOneCameraRendered = true;
00360         }
00361
00362         return atLeastOneCameraRendered;
00363     });
00364 }
00365
00366 void _360VideoPlaybackMain::SaveAppState()
00367 {
00368     //
00369     // TODO: Insert code here to save your app state.
00370     //       This method is called when the app is about to suspend.
00371     //
00372     //       For example, store information in the SpatialAnchorStore.
00373     //
00374 }
00375
00376 void _360VideoPlaybackMain::LoadAppState()
00377 {
00378     //
00379     // TODO: Insert code here to load your app state.
00380     //       This method is called when the app resumes.
00381     //
00382     //       For example, load information from the SpatialAnchorStore.
00383     //
00384 }
00385
00386 // Notifies classes that use Direct3D device resources that the device resources
00387 // need to be released before this method returns.
00388 void _360VideoPlaybackMain::OnDeviceLost()
00389 {
00390 #ifdef DRAW_SAMPLE_CONTENT
00391     m_videoRenderer->ReleaseDeviceDependentResources();
00392 #endif
00393 }
00394
00395 // Notifies classes that use Direct3D device resources that the device resources
00396 // may now be recreated.
00397 void _360VideoPlaybackMain::OnDeviceRestored()
00398 {
00399 #ifdef DRAW_SAMPLE_CONTENT
00400     m_videoRenderer->CreateDeviceDependentResources();
00401 #endif
00402 }
00403
00404 void _360VideoPlaybackMain::OnLocatabilityChanged(SpatialLocator^ sender, Object^ args)
00405 {
00406     switch (sender->Locatability)
00407     {
00408     case SpatialLocatability::Unavailable:
00409         // Holograms cannot be rendered.
00410     {
00411         String^ message = L"Warning! Positional tracking is " +
00412             sender->Locatability.ToString() + L".\n";
00413         OutputDebugStringW(message->Data());
00414     }
00415     break;
00416
00417     // In the following three cases, it is still possible to place holograms using a
00418     // SpatialLocatorAttachedFrameOfReference.
00419     case SpatialLocatability::PositionalTrackingActivating:
00420         // The system is preparing to use positional tracking.
00421
00422     case SpatialLocatability::OrientationOnly:
00423         // Positional tracking has not been activated.
00424
00425     case SpatialLocatability::PositionalTrackingInhibited:
00426         // Positional tracking is temporarily inhibited. User action may be required
00427         // in order to restore positional tracking.
00428         break;
00429
00430     case SpatialLocatability::PositionalTrackingActive:
00431         // Positional tracking is active. World-locked content can be rendered.
00432         break;
00433     }
00434 }
00435
00436 void _360VideoPlaybackMain::OnCameraAdded(
00437     HolographicSpace^ sender,
00438     HolographicSpaceCameraAddedEventArgs^ args
00439 )
00440 {
00441     Deferral^ deferral = args->GetDeferral();
00442     HolographicCamera^ holographicCamera = args->Camera;
00443     create_task([this, deferral, holographicCamera]()
00444     {
00445         //
00446         // TODO: Allocate resources for the new camera and load any content specific to
00447         //       that camera. Note that the render target size (in pixels) is a property
00448         //       of the HolographicCamera object, and can be used to create off-screen
00449         //       render targets that match the resolution of the HolographicCamera.
00450         //
00451
00452         // Create device-based resources for the holographic camera and add it to the list of
00453         // cameras used for updates and rendering. Notes:
00454         //   * Since this function may be called at any time, the AddHolographicCamera function
00455         //     waits until it can get a lock on the set of holographic camera resources before
00456         //     adding the new camera. At 60 frames per second this wait should not take long.
00457         //   * A subsequent Update will take the back buffer from the RenderingParameters of this
00458         //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
00459         //     Content can then be rendered for the HolographicCamera.
00460         m_deviceResources->AddHolographicCamera(holographicCamera);
00461
00462         // Holographic frame predictions will not include any information about this camera until
00463         // the deferral is completed.
00464         deferral->Complete();
00465     });
00466 }
00467
00468 void _360VideoPlaybackMain::OnCameraRemoved(
00469     HolographicSpace^ sender,
00470     HolographicSpaceCameraRemovedEventArgs^ args
00471 )
00472 {
00473     create_task([this]()
00474     {
00475         //
00476         // TODO: Asynchronously unload or deactivate content resources (not back buffer
00477         //       resources) that are specific only to the camera that was removed.
00478         //
00479     });
00480
00481     // Before letting this callback return, ensure that all references to the back buffer
00482     // are released.
00483     // Since this function may be called at any time, the RemoveHolographicCamera function
00484     // waits until it can get a lock on the set of holographic camera resources before
00485     // deallocating resources for this camera. At 60 frames per second this wait should
00486     // not take long.
00487     m_deviceResources->RemoveHolographicCamera(args->Camera);
00488 }
00489
00490 void _360VideoPlaybackMain::CreateVideoShaders()
00491 {
00492     m_videoRenderer->CreateDeviceDependentResources();
00493     m_mediaTransportControls->Initialize();
00494     m_mediaTransportControls->ApplyShaders();
00495 }
Generated on Fri Nov 15 2024 22:16:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/ChallengeResponseAlgorithm.cpp Source File

  • SmartCard
  • cpp

ChallengeResponseAlgorithm.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "ChallengeResponseAlgorithm.h"
00003
00004 using namespace SDKTemplate;
00005 using namespace Windows::Storage::Streams;
00006
00007 using namespace Windows::Security::Cryptography;
00008 using namespace Windows::Security::Cryptography::Core;
00009
00010 // Calculates the response by encrypting the challenge by using Triple DES (3DES).
00011 // If the resulting values are the same, the authentication is successful.
00012 IBuffer^ ChallengeResponseAlgorithm::CalculateResponse(IBuffer^ challenge, IBuffer^ adminkey)
00013 {
00014     SymmetricKeyAlgorithmProvider^ objAlg = SymmetricKeyAlgorithmProvider::OpenAlgorithm(SymmetricAlgorithmNames::TripleDesCbc);
00015     auto symetricKey = objAlg->CreateSymmetricKey(adminkey);
00016     auto buffEncrypted = CryptographicEngine::Encrypt(symetricKey, challenge, nullptr);
00017     return buffEncrypted;
00018 }
Generated on Fri Nov 15 2024 22:21:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/ILivePlayer.cs Source File

  • LiveDash
  • cs
  • LiveDash

ILivePlayer.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Threading.Tasks;
00003 using Windows.UI.Xaml.Controls;
00004
00005 namespace LiveDash
00006 {
00007     interface ILivePlayer
00008     {
00009         Task Initialize(Uri manifest, MediaElement mediaElement);
00010
00011         void GoToLive();
00012
00013         void DesiredLiveOffset(TimeSpan offset);
00014     }
00015 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/Scenario2_RequestConsent.xaml.cpp Source File

  • UserConsentVerifier
  • cpp

Scenario2_RequestConsent.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario2_RequestConsent.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Security::Credentials::UI;
00011 using namespace Windows::UI::Xaml;
00012
00013 Scenario2_RequestConsent::Scenario2_RequestConsent()
00014 {
00015     InitializeComponent();
00016 }
00017
00018 // Requests consent from the current user.
00019 void Scenario2_RequestConsent::RequestConsent_Click(Object^ sender, RoutedEventArgs^ e)
00020 {
00021     RequestConsentButton->IsEnabled = false;
00022
00023     // Request the user's consent using Windows Hello via biometric verification or a PIN.
00024     String^ message = L"Please confirm your identity to complete this (pretend) in-app purchase.";
00025     create_task(Windows::Security::Credentials::UI::UserConsentVerifier::RequestVerificationAsync(message))
00026         .then([this](UserConsentVerificationResult consentResult)
00027     {
00028         switch (consentResult)
00029         {
00030         case UserConsentVerificationResult::Verified:
00031             MainPage::Current->NotifyUser("Pretend in-app purchase was successful.", NotifyType::StatusMessage);
00032             break;
00033
00034         case UserConsentVerificationResult::DeviceNotPresent:
00035             MainPage::Current->NotifyUser("No PIN or biometric device found, please set one up.", NotifyType::ErrorMessage);
00036             break;
00037
00038         case UserConsentVerificationResult::Canceled:
00039             MainPage::Current->NotifyUser("User consent verification canceled.", NotifyType::ErrorMessage);
00040             break;
00041
00042         default:
00043             MainPage::Current->NotifyUser("User consent verification is currently unavailable.", NotifyType::ErrorMessage);
00044             break;
00045         }
00046         RequestConsentButton->IsEnabled = true;
00047     });
00048 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
_tileId | ScenarioElement | [private]
ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ButtonUpdateTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
stepsControl_StepChanged(object sender, int e) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario7_ProtectStream.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario7_ProtectStream.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Storage;
00014 using Windows.Storage.Streams;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.Security.EnterpriseData;
00019 using Windows.Security.Cryptography;
00020 using SDKTemplate;
00021
00022
00023 namespace EdpSample
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario7 : Page
00029     {
00030         private MainPage rootPage;
00031         InMemoryRandomAccessStream m_protectedStream = null;
00032         InMemoryRandomAccessStream m_unprotectedStream = null;
00033         private string m_protectStreamScenario = "An app has access to a stream of data that sources to an enterprise resource. " +
00034                                                  "In order to ensure that this stream is protected when transferring it within and outside the device, " +
00035                                                  "it protects the data to the enterprise identity it belongs to.This allows wiping the data when required by the enterprise.";
00036
00037         private string m_getstreamStreamScenario = "\n\nAn app has previously protected a stream that it must prevent unauthorized access to.In order " +
00038                                                    "to retrieve its contents back when needed, it can check the status of the stream.Alternatively, " +
00039                                                    "if the app is denied access to the stream when unprotecting it, it can check its status.";
00040
00041         public Scenario7()
00042         {
00043             this.InitializeComponent();
00044         }
00045
00046         protected override void OnNavigatedTo(NavigationEventArgs e)
00047         {
00048             ScenarioText.Text = m_protectStreamScenario + m_getstreamStreamScenario;
00049             rootPage = MainPage.Current;
00050         }
00051
00052         private async void UnprotectAsyncBuffer_Click(object sender, RoutedEventArgs e)
00053         {
00054             string outputStr = "";
00055
00056             if (m_protectedStream != null)
00057             {
00058                 IInputStream source = m_protectedStream.GetInputStreamAt(0);
00059                 m_unprotectedStream = new InMemoryRandomAccessStream();
00060                 await DataProtectionManager.UnprotectStreamAsync(source,
00061                                                                      m_unprotectedStream
00062                                                                      );
00063                 var unprotectedReader = new DataReader(m_unprotectedStream.GetInputStreamAt(0));
00064                 await unprotectedReader.LoadAsync((uint)m_unprotectedStream.Size);
00065                 IBuffer unprotectedStreamBuffer = unprotectedReader.ReadBuffer((uint)m_unprotectedStream.Size);
00066                 outputStr += "\n UnProtected Stream buffer:" +
00067                                CryptographicBuffer.EncodeToHexString(unprotectedStreamBuffer);
00068
00069                 rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00070             }
00071             else
00072             {
00073                 rootPage.NotifyUser("Please protect a stream to unprotect", NotifyType.ErrorMessage);
00074             }
00075         }
00076
00077         private async void GetStreamStatus_Click(object sender, RoutedEventArgs e)
00078         {
00079             if (m_protectedStream != null)
00080             {
00081                 DataProtectionInfo procStatus = await DataProtectionManager.GetStreamProtectionInfoAsync(m_protectedStream.GetInputStreamAt(0));
00082                 string outputStr = "\n m_protectedStream protection status: " + procStatus.Status;
00083                 rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00084             }
00085             else
00086             {
00087                 string outputStr = "\nStream is null because ProtectStream API did not run successfully";
00088                 rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
00089             }
00090         }
00091
00092         private async void ProtectStreamAsync_Click(object sender, RoutedEventArgs e)
00093         {
00094             string outputStr = "";
00095             Byte[] byteStream = { 1, 2, 3, 4, 5 };
00096
00097             InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
00098             IOutputStream outputStream = randomAccessStream.GetOutputStreamAt(0);
00099             var writer = new DataWriter(outputStream);
00100             writer.WriteBytes(byteStream);
00101             await writer.StoreAsync();
00102
00103             IInputStream source = randomAccessStream.GetInputStreamAt(0);
00104             m_protectedStream = new InMemoryRandomAccessStream();
00105             IOutputStream destination = m_protectedStream.GetOutputStreamAt(0);
00106
00107             await DataProtectionManager.ProtectStreamAsync(source, Scenario1.m_enterpriseId, destination);
00108
00109             var reader = new DataReader(m_protectedStream.GetInputStreamAt(0));
00110             await reader.LoadAsync((uint)m_protectedStream.Size);
00111             IBuffer protectedStreamBuffer = reader.ReadBuffer((uint)m_protectedStream.Size);
00112             outputStr += "\n Protected Stream buffer:" + CryptographicBuffer.EncodeToHexString(protectedStreamBuffer);
00113
00114             rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00115         }
00116     }
00117 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario4_PartialReadWrite.xaml.h Source File

  • WebSocket
  • cpp

Scenario4_PartialReadWrite.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4.xaml.h
00014 // Declaration of the Scenario4 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario4_PartialReadWrite.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario4 sealed
00030     {
00031     public:
00032         Scenario4();
00033
00034     protected:
00035         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         void OnConnect();
00038         void OnSend();
00039         void OnDisconnect();
00040
00041     private:
00042         MainPage^ rootPage = MainPage::Current;
00043         Windows::Networking::Sockets::MessageWebSocket^ messageWebSocket;
00044         bool busy = false;
00045
00046         void UpdateVisualState();
00047         void SetBusy(bool value);
00048         Concurrency::task<void> ConnectAsync();
00049         Concurrency::task<void> SendAsync();
00050         void OnServerCustomValidationRequested(
00051             Windows::Networking::Sockets::MessageWebSocket^ sender,
00052             Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^ args);
00053         void MessageReceived(Windows::Networking::Sockets::MessageWebSocket^ sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^ args);
00054         void OnClosed(Windows::Networking::Sockets::IWebSocket^ sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^ args);
00055         void CloseSocket();
00056         void AppendOutputLine(Platform::String^ value);
00057     };
00058 }
Generated on Fri Nov 15 2024 22:22:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cs/Scenario1.xaml.cs Source File

  • DpiScaling
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using Windows.Graphics.Display;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using Windows.UI.Xaml.Media.Imaging;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario1 : Page
00022     {
00023         private const String imageBase = "http://www.contoso.com/imageScale{0}.png";
00024
00025         public Scenario1()
00026         {
00027             this.InitializeComponent();
00028             DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
00029             displayInformation.DpiChanged += DisplayProperties_DpiChanged;
00030         }
00031
00032         private void ResetOutput()
00033         {
00034             DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
00035             String scaleValue = (displayInformation.RawPixelsPerViewPixel * 100.0).ToString("F0");
00036             ScalingText.Text = scaleValue + "%";
00037             ManualLoadURL.Text = String.Format(imageBase, scaleValue);
00038             LogicalDPIText.Text = displayInformation.LogicalDpi.ToString() + " DPI";
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             ResetOutput();
00044         }
00045
00046         void DisplayProperties_DpiChanged(DisplayInformation sender, object args)
00047         {
00048             ResetOutput();
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Material.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Material.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Material:
00015 // This class maintains the properties that represent how an object will
00016 // look when it is rendered. This includes the color of the object, the
00017 // texture used to render the object, and the vertex and pixel shader that
00018 // should be used for rendering.
00019 // The RenderSetup method sets the appropriate values into the constantBuffer
00020 // and calls the appropriate D3D11 context methods to set up the rendering pipeline
00021 // in the graphics hardware.
00022
00023 #include "ConstantBuffers.h"
00024
00025 class Material
00026 {
00027 public:
00028     Material(
00029         DirectX::XMFLOAT4 meshColor,
00030         DirectX::XMFLOAT4 diffuseColor,
00031         DirectX::XMFLOAT4 specularColor,
00032         float specularExponent,
00033         _In_ ID3D11ShaderResourceView* textureResourceView,
00034         _In_ ID3D11VertexShader* vertexShader,
00035         _In_ ID3D11PixelShader* pixelShader
00036         );
00037
00038     void RenderSetup(
00039         _In_ ID3D11DeviceContext* context,
00040         _Inout_ ConstantBufferChangesEveryPrim* constantBuffer
00041         );
00042
00043     void SetTexture(_In_ ID3D11ShaderResourceView* textureResourceView)
00044     {
00045         m_textureRV.copy_from(textureResourceView);
00046     }
00047
00048 private:
00049     DirectX::XMFLOAT4   m_meshColor;
00050     DirectX::XMFLOAT4   m_diffuseColor;
00051     DirectX::XMFLOAT4   m_hitColor;
00052     DirectX::XMFLOAT4   m_specularColor;
00053     float               m_specularExponent;
00054
00055     winrt::com_ptr<ID3D11VertexShader>       m_vertexShader;
00056     winrt::com_ptr<ID3D11PixelShader>        m_pixelShader;
00057     winrt::com_ptr<ID3D11ShaderResourceView> m_textureRV;
00058 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/Scenario2.xaml.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace AllJoynProducerExperiences
00016 {
00017     public sealed partial class Scenario2 : Page
00018     {
00019         private Scenario2ViewModel m_scenario2ViewModel = null;
00020
00021         public Scenario2()
00022         {
00023             InitializeComponent();
00024             m_scenario2ViewModel = new Scenario2ViewModel();
00025             DataContext = m_scenario2ViewModel;
00026         }
00027
00028         // Cleanup scenario when it is about to be unloaded.
00029         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00030         {
00031             if (m_scenario2ViewModel != null)
00032             {
00033                 m_scenario2ViewModel.ScenarioCleanup();
00034             }
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/StepsControl.cs Source File

  • Notifications
  • cs
  • Notifications
  • Controls

StepsControl.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004 using Windows.UI.Xaml.Data;
00005
00006 namespace Notifications.Controls
00007 {
00008     public class StepsControl : ItemsControl
00009     {
00010         public event EventHandler<int> StepChanged = delegate { };
00011
00012         public StepsControl()
00013         {
00014             this.DefaultStyleKey = typeof(StepsControl);
00015             base.Loaded += StepsControl_Loaded;
00016         }
00017
00018         private void StepsControl_Loaded(object sender, RoutedEventArgs e)
00019         {
00020             StepsHelperControl stepsHelperControl = base.ItemsPanelRoot as StepsHelperControl;
00021             if (stepsHelperControl == null)
00022                 throw new NullReferenceException("Expected stepsHelperControl as ItemsPanelRoot");
00023
00024             stepsHelperControl.SetBinding(StepsHelperControl.StepProperty, new Binding() { Path = new PropertyPath("Step"), Source = this });
00025         }
00026
00027         protected override void OnApplyTemplate()
00028         {
00029             Button buttonNext = GetTemplateChild("ButtonNext") as Button;
00030             if (buttonNext == null)
00031                 throw new NullReferenceException("Expected ButtonNext child");
00032
00033             buttonNext.Click += ButtonNext_Click;
00034
00035             FrameworkElement completed = GetTemplateChild("Completed") as FrameworkElement;
00036             if (completed == null)
00037                 throw new NullReferenceException("Expected Completed child");
00038
00039             completed.Tapped += Completed_Tapped;
00040         }
00041
00042         private void Completed_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
00043         {
00044             Frame frame = Window.Current.Content as Frame;
00045             if (frame != null)
00046             {
00047                 if (frame.CanGoBack)
00048                 {
00049                     e.Handled = true;
00050                     frame.GoBack();
00051                     return;
00052                 }
00053             }
00054         }
00055
00056         private void ButtonNext_Click(object sender, RoutedEventArgs e)
00057         {
00058             Step++;
00059         }
00060
00061         private StepsHelperControl GetStepsHelperControl()
00062         {
00063             return base.ItemsPanelRoot as StepsHelperControl;
00064         }
00065
00066         public static readonly DependencyProperty StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsControl), new PropertyMetadata(1, OnStepPropertyChanged));
00067
00068         private static void OnStepPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
00069         {
00070             (sender as StepsControl).OnStepPropertyChanged(e);
00071         }
00072
00073         private void OnStepPropertyChanged(DependencyPropertyChangedEventArgs e)
00074         {
00075             if (Step > base.Items.Count)
00076                 SetCompleted(true);
00077             else
00078                 SetCompleted(false);
00079
00080             StepChanged(this, Step);
00081         }
00082
00083         public int Step
00084         {
00085             get { return (int)GetValue(StepProperty); }
00086             set { SetValue(StepProperty, value); }
00087
00088             //get
00089             //{
00090             //    var helper = GetStepsHelperControl();
00091             //    if (helper != null)
00092             //        return helper.Step;
00093
00094             //    return 1;
00095             //}
00096
00097             //set
00098             //{
00099             //    int oldValue = Step;
00100
00101             //    var helper = GetStepsHelperControl();
00102             //    if (helper != null)
00103             //        helper.Step = value;
00104
00105             //    if (value > base.Items.Count)
00106             //        SetCompleted(true);
00107             //    else
00108             //        SetCompleted(false);
00109
00110             //    if (oldValue != value)
00111             //        StepChanged(this, value);
00112             //}
00113         }
00114
00115         private void SetCompleted(bool isCompleted)
00116         {
00117             FrameworkElement normal = GetTemplateChild("Normal") as FrameworkElement;
00118             if (normal == null)
00119                 return;
00120
00121             FrameworkElement completed = GetTemplateChild("Completed") as FrameworkElement;
00122             if (completed == null)
00123                 return;
00124
00125             if (isCompleted)
00126             {
00127                 completed.Visibility = Visibility.Visible;
00128                 normal.Visibility = Visibility.Collapsed;
00129             }
00130
00131             else
00132             {
00133                 completed.Visibility = Visibility.Collapsed;
00134                 normal.Visibility = Visibility.Visible;
00135             }
00136         }
00137
00138         public static readonly DependencyProperty IsNextEnabledProperty = DependencyProperty.Register("IsNextEnabled", typeof(bool), typeof(StepsControl), new PropertyMetadata(true));
00139
00140         public bool IsNextEnabled
00141         {
00142             get { return (bool)GetValue(IsNextEnabledProperty); }
00143             set { SetValue(IsNextEnabledProperty, value); }
00144         }
00145
00146         public static readonly DependencyProperty NextButtonVisibilityProperty = DependencyProperty.Register("NextButtonVisibility", typeof(Visibility), typeof(StepsControl), new PropertyMetadata(Visibility.Visible));
00147
00148         public Visibility NextButtonVisibility
00149         {
00150             get { return (Visibility)GetValue(NextButtonVisibilityProperty); }
00151             set { SetValue(NextButtonVisibilityProperty, value); }
00152         }
00153     }
00154 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario9_ContainsFullScreenElement.xaml.cs Source File

  • XamlWebView
  • cs

Scenario9_ContainsFullScreenElement.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.ViewManagement;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class Scenario9_ContainsFullScreenElement : Page
00023     {
00024         public Scenario9_ContainsFullScreenElement()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         protected override void OnNavigatedTo(NavigationEventArgs e)
00030         {
00031             WebViewControl.Navigate(new Uri("https://www.youtube.com/watch?v=XVfOe5mFbAE"));
00032         }
00033
00034         private void WebViewControl_ContainsFullScreenElementChanged(WebView sender, object args)
00035         {
00036             var applicationView = ApplicationView.GetForCurrentView();
00037
00038             if (sender.ContainsFullScreenElement)
00039             {
00040                 applicationView.TryEnterFullScreenMode();
00041             }
00042             else
00043             {
00044                 // It is harmless to exit full screen mode when not full screen.
00045                 applicationView.ExitFullScreenMode();
00046             }
00047
00048         }
00049
00050     }
00051 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OnDeviceConnectedEventArgs Member List

This is the complete list of members for OnDeviceConnectedEventArgs, including all inherited members.
deviceInformation | OnDeviceConnectedEventArgs | [private]
DeviceInformation | OnDeviceConnectedEventArgs |
isDeviceSuccessfullyConnected | OnDeviceConnectedEventArgs | [private]
IsDeviceSuccessfullyConnected | OnDeviceConnectedEventArgs |
OnDeviceConnectedEventArgs(Boolean isDeviceSuccessfullyConnected, Windows.Devices.Enumeration.DeviceInformation deviceInformation) | OnDeviceConnectedEventArgs | [inline]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/SpinningCubeRenderer.h Source File

  • HolographicFaceTracking
  • cpp
  • Content

SpinningCubeRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Common\DeviceResources.h"
00015 #include "Common\StepTimer.h"
00016 #include "ShaderStructures.h"
00017
00018 namespace HolographicFaceTracker
00019 {
00020     // This sample renderer instantiates a basic rendering pipeline.
00021     class SpinningCubeRenderer : public DX::Resource
00022     {
00023     public:
00024         SpinningCubeRenderer(std::shared_ptr<DX::DeviceResources> deviceResources);
00025
00026         // DirectXResource Interface
00027         concurrency::task<void> CreateDeviceDependentResourcesAsync() override;
00028         void ReleaseDeviceDependentResources() override;
00029
00030         void Update(const DX::StepTimer& timer);
00031         void Render();
00032
00033         void SetTargetPosition(Windows::Foundation::Numerics::float3 pos) { m_targetPosition = pos; }
00034
00035         Windows::Foundation::Numerics::float3 const& GetPosition() const { return m_position; }
00036         Windows::Foundation::Numerics::float3 const& GetVelocity() const { return m_velocity; }
00037
00038     private:
00039         // Direct3D resources for cube geometry.
00040         Microsoft::WRL::ComPtr<ID3D11InputLayout>       m_inputLayout;
00041         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_vertexBuffer;
00042         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_indexBuffer;
00043         Microsoft::WRL::ComPtr<ID3D11VertexShader>      m_vertexShader;
00044         Microsoft::WRL::ComPtr<ID3D11GeometryShader>    m_geometryShader;
00045         Microsoft::WRL::ComPtr<ID3D11PixelShader>       m_pixelShader;
00046         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_modelConstantBuffer;
00047
00048         // System resources for cube geometry.
00049         CubeModelConstantBuffer                         m_modelConstantBufferData;
00050         uint32                                          m_indexCount = 0;
00051
00052         // Variables used with the rendering loop.
00053         float                                           m_degreesPerSecond = 45.f;
00054         Windows::Foundation::Numerics::float3           m_targetPosition = { 0.f, 0.f, -2.f };
00055         Windows::Foundation::Numerics::float3           m_position = { 0.f, 0.f, -2.f };
00056         Windows::Foundation::Numerics::float3           m_velocity = { 0.f, 0.f, 0.f };
00057
00058         // If the current D3D Device supports VPRT, we can avoid using a geometry
00059         // shader just to set the render target array index.
00060         bool                                            m_usingVprtShaders = false;
00061
00062         // This is the rate at which the hologram position is interpolated (LERPed) to the current location.
00063         const float                                     c_lerpRate = 4.0f;
00064     };
00065 }
Generated on Fri Nov 15 2024 22:18:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomException Member List

This is the complete list of members for CustomException, including all inherited members.
CustomException() | CustomException | [inline]
CustomException() | CustomException | [inline]
OnNavigatedTo(NavigationEventArgs e) | CustomException | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | CustomException | [inline, protected]
rootPage | CustomException | [private]
Start_Click(object sender, RoutedEventArgs e) | CustomException | [inline, private]
Start_Click(object sender, RoutedEventArgs e) | CustomException | [inline, private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include <collection.h>
00014 #include <ppltasks.h>
00015
00016
00017 #include <xmllite.h>
00018 #include <shcore.h>
00019 #include <wrl.h>
00020
00021
00022 #include <iostream>
00023 #include <sstream>
00024 #include <locale>
00025 #include <iomanip>
00026
00027 #define ChkHr(stmt) do { hr = stmt; if (FAILED(hr)) return hr; } while(0)
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario6_GetLastVisit.cpp Source File

  • Geolocation
  • cppwinrt

Scenario6_GetLastVisit.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_GetLastVisit.h"
00014 #include "Scenario6_GetLastVisit.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Devices::Geolocation;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario6_GetLastVisit::Scenario6_GetLastVisit()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     fire_and_forget Scenario6_GetLastVisit::GetLastVisitButtonClicked(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto lifetime = get_strong();
00032
00033         GetLastVisitButton().IsEnabled(false);
00034         LocationDisabledMessage().Visibility(Visibility::Collapsed);
00035
00036         // Request permission to access location
00037         auto accessStatus = co_await Geolocator::RequestAccessAsync();
00038
00039         Geovisit visit = nullptr;
00040         switch (accessStatus)
00041         {
00042         case GeolocationAccessStatus::Allowed:
00043             m_rootPage.NotifyUser(L"Waiting for update...", NotifyType::StatusMessage);
00044
00045             // Get the last visit report, if any. This should be a quick operation.
00046             visit = co_await GeovisitMonitor::GetLastReportAsync();
00047             m_rootPage.NotifyUser(L"Visit info updated.", NotifyType::StatusMessage);
00048             break;
00049
00050         case GeolocationAccessStatus::Denied:
00051             m_rootPage.NotifyUser(L"Access to location is denied.", NotifyType::ErrorMessage);
00052             LocationDisabledMessage().Visibility(Visibility::Visible);
00053             break;
00054
00055         default:
00056         case GeolocationAccessStatus::Unspecified:
00057             m_rootPage.NotifyUser(L"Unspecified error.", NotifyType::ErrorMessage);
00058             break;
00059         }
00060
00061         UpdateLastVisit(visit);
00062
00063         GetLastVisitButton().IsEnabled(true);
00064     }
00065
00066     // Updates the user interface with the Geovisit data provided
00067     void Scenario6_GetLastVisit::UpdateLastVisit(Geovisit const& visit)
00068     {
00069         if (visit == nullptr)
00070         {
00071             ScenarioOutput_Latitude().Text(L"No data");
00072             ScenarioOutput_Longitude().Text(L"No data");
00073             ScenarioOutput_Accuracy().Text(L"No data");
00074             ScenarioOutput_Timestamp().Text(L"No data");
00075             ScenarioOutput_VisitStateChange().Text(L"No data");
00076             ScenarioOutput_IsRemoteSource().Text(L"No data");
00077         }
00078         else
00079         {
00080             // A valid visit is available, extract the state change and Timestamp.
00081             ScenarioOutput_VisitStateChange().Text(to_hstring(visit.StateChange()));
00082             ScenarioOutput_Timestamp().Text(FormatDateTime(visit.Timestamp(), L"shortdate shorttime"));
00083
00084             // If a valid position is available, extract the position information that caused the state change to happen.
00085             if (visit.Position() == nullptr)
00086             {
00087                 ScenarioOutput_Latitude().Text(L"No data");
00088                 ScenarioOutput_Longitude().Text(L"No data");
00089                 ScenarioOutput_Accuracy().Text(L"No data");
00090                 ScenarioOutput_IsRemoteSource().Text(L"No data");
00091             }
00092             else
00093             {
00094                 ScenarioOutput_Latitude().Text(to_hstring(visit.Position().Coordinate().Point().Position().Latitude));
00095                 ScenarioOutput_Longitude().Text(to_hstring(visit.Position().Coordinate().Point().Position().Longitude));
00096                 ScenarioOutput_Accuracy().Text(to_hstring(visit.Position().Coordinate().Accuracy()));
00097                 ScenarioOutput_IsRemoteSource().Text(to_hstring(visit.Position().Coordinate().IsRemoteSource()));
00098             }
00099         }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:19:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RemoteSystems/cs/Scenario4_Settings.xaml.cs Source File

  • RemoteSystems
  • cs

Scenario4_Settings.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.Threading.Tasks;
00016 using Windows.Networking;
00017 using Windows.System.RemoteSystems;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario4_Settings : Page
00026     {
00027         public Scenario4_Settings()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         private void CheckNow_Clicked(object sender, RoutedEventArgs e)
00033         {
00034             AnoymousAuthorizationEnabled.Text = RemoteSystem.IsAuthorizationKindEnabled(RemoteSystemAuthorizationKind.Anonymous).ToString();
00035             SameUserAuthorizationEnabled.Text = RemoteSystem.IsAuthorizationKindEnabled(RemoteSystemAuthorizationKind.SameUser).ToString();
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/SampleConfiguration.h Source File

  • OrientationSensor
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Orientation Sensor";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         static void SetReadingText(Windows::UI::Xaml::Controls::TextBlock^ textBlock, Windows::Devices::Sensors::OrientationSensorReading^ reading);
00039
00040         property Windows::Devices::Sensors::SensorReadingType SensorReadingType
00041         {
00042             Windows::Devices::Sensors::SensorReadingType get()
00043             {
00044                 return sensorReadingType;
00045             }
00046             void set(Windows::Devices::Sensors::SensorReadingType value)
00047             {
00048                 sensorReadingType = value;
00049             }
00050         }
00051
00052         property Windows::Devices::Sensors::SensorOptimizationGoal SensorOptimizationGoal
00053         {
00054             Windows::Devices::Sensors::SensorOptimizationGoal get()
00055             {
00056                 return sensorOptimizationGoal;
00057             }
00058             void set(Windows::Devices::Sensors::SensorOptimizationGoal value)
00059             {
00060                 sensorOptimizationGoal = value;
00061             }
00062         }
00063
00064         property Platform::String^ SensorDescription
00065         {
00066             Platform::String^ get()
00067             {
00068                 return SensorReadingType.ToString() + " orientation sensor with " + SensorOptimizationGoal.ToString() + " optimization goal";
00069             }
00070         }
00071
00072     private:
00073         static Platform::Array<Scenario>^ scenariosInner;
00074         Windows::Devices::Sensors::SensorReadingType sensorReadingType;
00075         Windows::Devices::Sensors::SensorOptimizationGoal sensorOptimizationGoal;
00076     };
00077
00078     public value struct Scenario
00079     {
00080         Platform::String^ Title;
00081         Platform::String^ ClassName;
00082     };
00083 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/MainPage.xaml.h Source File

  • Projection
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "MainPage.g.h"
00016 #include "SampleConfiguration.h"
00017
00018 namespace SDKSample
00019 {
00020     public enum class NotifyType
00021     {
00022         StatusMessage,
00023         ErrorMessage
00024     };
00025
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public ref class MainPage sealed
00030     {
00031     public:
00032         MainPage();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037     private:
00038         void ScenarioControl_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00039         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041
00042     internal:
00043         static MainPage^ Current;
00044         void NotifyUser(Platform::String^ strMessage, NotifyType type);
00045     };
00046 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Multiple Member List

This is the complete list of members for Scenario2_Multiple, including all inherited members.
ClearOutputs() | Scenario2_Multiple | [inline, private]
PickContactsEmail() | Scenario2_Multiple | [inline, private]
PickContactsPhone() | Scenario2_Multiple | [inline, private]
ReportContactResults(IList< Contact > contacts) | Scenario2_Multiple | [inline, private]
rootPage | Scenario2_Multiple | [private]
Scenario2_Multiple() | Scenario2_Multiple | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspMediaSinkProxy.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspMediaSinkProxy.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #include "StspNetwork.h"
00010 #include "StspDefs.h"
00011 #include <queue>
00012
00013 namespace Microsoft { namespace Samples { namespace SimpleCommunication {
00014     ref class StspMediaSinkProxy;
00015
00016     public ref class IncomingConnectionEventArgs sealed
00017     {
00018     public:
00019         property String ^RemoteUrl
00020         {
00021             String ^get() { return _remoteUrl; }
00022         }
00023
00024         void Accept();
00025         void Refuse();
00026
00027     internal:
00028         IncomingConnectionEventArgs(IStspSinkInternal *pSink, DWORD connectionId, String ^remoteUrl);
00029
00030     private:
00031         String ^_remoteUrl;
00032         DWORD _connectionId;
00033         ComPtr<IStspSinkInternal> _spSink;
00034     };
00035
00036     interface class ISinkCallback
00037     {
00038         void FireIncomingConnection(IncomingConnectionEventArgs ^args);
00039         void OnShutdown();
00040     };
00041
00042     public ref class StspMediaSinkProxy sealed
00043     {
00044     public:
00045         StspMediaSinkProxy();
00046         virtual ~StspMediaSinkProxy();
00047
00048         Windows::Media::IMediaExtension ^GetMFExtensions();
00049
00050         Windows::Foundation::IAsyncOperation<Windows::Media::IMediaExtension^>^ InitializeAsync(
00051             Windows::Media::MediaProperties::IMediaEncodingProperties ^audioEncodingProperties,
00052             Windows::Media::MediaProperties::IMediaEncodingProperties ^videoEncodingProperties
00053             );
00054
00055         event Windows::Foundation::EventHandler<Object^>^ IncomingConnectionEvent;
00056
00057     internal:
00058
00059         void SetMediaStreamProperties(
00060             Windows::Media::Capture::MediaStreamType MediaStreamType,
00061             _In_opt_ Windows::Media::MediaProperties::IMediaEncodingProperties ^mediaEncodingProperties
00062             );
00063
00064     private:
00065         void FireIncomingConnection(IncomingConnectionEventArgs ^args);
00066         void OnShutdown();
00067
00068         ref class StspSinkCallback sealed: ISinkCallback
00069         {
00070         public:
00071             virtual void FireIncomingConnection(IncomingConnectionEventArgs ^args)
00072             {
00073                 _parent->FireIncomingConnection(args);
00074             }
00075
00076             virtual void OnShutdown()
00077             {
00078                 _parent->OnShutdown();
00079             }
00080
00081         internal:
00082             StspSinkCallback(StspMediaSinkProxy ^parent)
00083                 : _parent(parent)
00084             {
00085             }
00086
00087         private:
00088             StspMediaSinkProxy ^_parent;
00089         };
00090
00091         void CheckShutdown()
00092         {
00093             if (_fShutdown)
00094             {
00095                 Throw(MF_E_SHUTDOWN);
00096             }
00097         }
00098
00099     private:
00100         CritSec _critSec;
00101         ComPtr<IMFMediaSink> _spMediaSink;
00102         bool _fShutdown;
00103     };
00104 } } }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Utilities Member List

This is the complete list of members for Utilities, including all inherited members.
NotifyDeviceNotConnected() Utilities [inline, static]
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Converters/XmlDocumentToStringConverter.cs Source File

  • Notifications
  • cs
  • Notifications
  • Converters

XmlDocumentToStringConverter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Data.Xml.Dom;
00003 using Windows.UI.Xaml.Data;
00004
00005 namespace Notifications.Converters
00006 {
00007     public class XmlDocumentToStringConverter : IValueConverter
00008     {
00009         public object Convert(object value, Type targetType, object parameter, string language)
00010         {
00011             XmlDocument doc = value as XmlDocument;
00012             if (doc == null)
00013                 return value;
00014
00015             return doc.GetXml();
00016         }
00017
00018         public object ConvertBack(object value, Type targetType, object parameter, string language)
00019         {
00020             throw new NotImplementedException();
00021         }
00022     }
00023 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ReactiveRequest Member List

This is the complete list of members for Scenario1_ReactiveRequest, including all inherited members.
Scenario1_ReactiveRequest() Scenario1_ReactiveRequest [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_InkingFeedback Member List

This is the complete list of members for Scenario3_InkingFeedback, including all inherited members.
GetSelectedFeedbackOrFallback(std::wstring &message) | Scenario3_InkingFeedback | [private]
HapticCanvas_Entered(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e) | Scenario3_InkingFeedback |
HapticCanvas_Exited(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e) | Scenario3_InkingFeedback |
Scenario3_InkingFeedback() | Scenario3_InkingFeedback |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/DeviceResources.h Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetWindow(Windows::UI::Core::CoreWindow^ window);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void ValidateDevice();
00033         void HandleDeviceLost();
00034         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00035         void Trim();
00036         void Present();
00037
00038         // Device Accessors.
00039         Windows::Foundation::Size GetOutputSize() const                 { return m_outputSize; }
00040         Windows::Foundation::Size GetLogicalSize() const                { return m_logicalSize; }
00041
00042         // D3D Accessors.
00043         ID3D11Device2*          GetD3DDevice() const                    { return m_d3dDevice.Get(); }
00044         ID3D11DeviceContext3*   GetD3DDeviceContext() const             { return m_d3dContext.Get(); }
00045         IDXGISwapChain1*        GetSwapChain() const                    { return m_swapChain.Get(); }
00046         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel; }
00047         ID3D11RenderTargetView* GetBackBufferRenderTargetView() const   { return m_d3dRenderTargetView.Get(); }
00048         ID3D11DepthStencilView* GetDepthStencilView() const             { return m_d3dDepthStencilView.Get(); }
00049         D3D11_VIEWPORT          GetScreenViewport() const               { return m_screenViewport; }
00050         DirectX::XMFLOAT4X4     GetOrientationTransform3D() const       { return m_orientationTransform3D; }
00051
00052         // D2D Accessors.
00053         ID2D1Factory3*          GetD2DFactory() const                   { return m_d2dFactory.Get(); }
00054         ID2D1Device2*           GetD2DDevice() const                    { return m_d2dDevice.Get(); }
00055         ID2D1DeviceContext2*    GetD2DDeviceContext() const             { return m_d2dContext.Get(); }
00056         ID2D1Bitmap1*           GetD2DTargetBitmap() const              { return m_d2dTargetBitmap.Get(); }
00057         IDWriteFactory2*        GetDWriteFactory() const                { return m_dwriteFactory.Get();  }
00058         IWICImagingFactory2*    GetWicImagingFactory() const            { return m_wicFactory.Get(); }
00059         D2D1::Matrix3x2F        GetOrientationTransform2D() const       { return m_orientationTransform2D; }
00060
00061     private:
00062         void CreateDeviceIndependentResources();
00063         void CreateDeviceResources();
00064         void CreateWindowSizeDependentResources();
00065         DXGI_MODE_ROTATION ComputeDisplayRotation();
00066
00067         // Direct3D objects.
00068         Microsoft::WRL::ComPtr<ID3D11Device2>           m_d3dDevice;
00069         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>    m_d3dContext;
00070         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00071
00072         // Direct3D rendering objects. Required for 3D.
00073         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00074         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00075         D3D11_VIEWPORT                                  m_screenViewport;
00076
00077         // Direct2D drawing components.
00078         Microsoft::WRL::ComPtr<ID2D1Factory3>       m_d2dFactory;
00079         Microsoft::WRL::ComPtr<ID2D1Device2>        m_d2dDevice;
00080         Microsoft::WRL::ComPtr<ID2D1DeviceContext2> m_d2dContext;
00081         Microsoft::WRL::ComPtr<ID2D1Bitmap1>        m_d2dTargetBitmap;
00082
00083         // DirectWrite drawing components.
00084         Microsoft::WRL::ComPtr<IDWriteFactory2>     m_dwriteFactory;
00085         Microsoft::WRL::ComPtr<IWICImagingFactory2> m_wicFactory;
00086
00087         // Cached reference to the Window.
00088         Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
00089
00090         // Cached device properties.
00091         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00092         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00093         Windows::Foundation::Size                       m_outputSize;
00094         Windows::Foundation::Size                       m_logicalSize;
00095         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00096         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00097         float                                           m_dpi;
00098
00099         // Transforms used for display orientation.
00100         D2D1::Matrix3x2F    m_orientationTransform2D;
00101         DirectX::XMFLOAT4X4 m_orientationTransform3D;
00102
00103         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00104         IDeviceNotify* m_deviceNotify;
00105     };
00106 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario2_DeviceWatcher.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario2_DeviceWatcher.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_DeviceWatcher.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016 #include "DeviceWatcherHelper.h"
00017 #include "Scenario2_DeviceWatcher.g.cpp"
00018
00019 using namespace winrt;
00020 using namespace winrt::Windows::Devices::Enumeration;
00021 using namespace winrt::Windows::Foundation;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario2_DeviceWatcher::Scenario2_DeviceWatcher()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario2_DeviceWatcher::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         resultsListView().ItemsSource(resultCollection);
00035
00036         selectorComboBox().ItemsSource(DeviceSelectorChoices::DeviceWatcherSelectors());
00037         selectorComboBox().SelectedIndex(0);
00038     }
00039
00040     void Scenario2_DeviceWatcher::OnNavigatedFrom(NavigationEventArgs const&)
00041     {
00042         deviceWatcherHelper->Reset();
00043     }
00044
00045     void Scenario2_DeviceWatcher::StartWatcherButton_Click(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         StartWatcher();
00048     }
00049
00050     void Scenario2_DeviceWatcher::StopWatcherButton_Click(IInspectable const&, RoutedEventArgs const&)
00051     {
00052         StopWatcher();
00053     }
00054
00055     void Scenario2_DeviceWatcher::StartWatcher()
00056     {
00057         startWatcherButton().IsEnabled(false);
00058         resultCollection.Clear();
00059
00060         // First get the device selector chosen by the UI.
00061         IInspectable item = selectorComboBox().SelectedItem();
00062         DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(item);
00063
00064         DeviceWatcher deviceWatcher{ nullptr };
00065         if (deviceSelectorInfo->Selector().empty())
00066         {
00067             // If the a pre-canned device class selector was chosen, call the DeviceClass overload
00068             deviceWatcher = DeviceInformation::CreateWatcher(deviceSelectorInfo->DeviceClassSelector());
00069         }
00070         else if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
00071         {
00072             // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
00073             // Kind will be determined by the selector
00074             deviceWatcher = DeviceInformation::CreateWatcher(
00075                 deviceSelectorInfo->Selector(),
00076                 nullptr // don't request additional properties for this sample
00077             );
00078         }
00079         else
00080         {
00081             // Kind is specified in the selector info
00082             deviceWatcher = DeviceInformation::CreateWatcher(
00083                 deviceSelectorInfo->Selector(),
00084                 nullptr, // don't request additional properties for this sample
00085                 deviceSelectorInfo->Kind());
00086         }
00087
00088         rootPage.NotifyUser(L"Starting Watcher...", NotifyType::StatusMessage);
00089         deviceWatcherHelper->StartWatcher(deviceWatcher);
00090         stopWatcherButton().IsEnabled(true);
00091     }
00092
00093     void Scenario2_DeviceWatcher::StopWatcher()
00094     {
00095         stopWatcherButton().IsEnabled(false);
00096         deviceWatcherHelper->StopWatcher();
00097         startWatcherButton().IsEnabled(true);
00098     }
00099 }
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario14_QueryCpPaste Member List

This is the complete list of members for Scenario14_QueryCpPaste, including all inherited members.
IsClipboardPeekAllowedAsync() | Scenario14_QueryCpPaste | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario14_QueryCpPaste | [inline, protected]
QueryCp_Click(object sender, RoutedEventArgs e) | Scenario14_QueryCpPaste | [inline, private]
rootPage | Scenario14_QueryCpPaste | [private]
Scenario14_QueryCpPaste() | Scenario14_QueryCpPaste | [inline]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/MainPage.xaml.cs Source File

  • BasicSuspension
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using SDKTemplate.Common;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.Collections.ObjectModel;
00005 using Windows.UI.Core;
00006 using Windows.UI.Xaml;
00007 using Windows.UI.Xaml.Controls;
00008 using Windows.UI.Xaml.Navigation;
00009
00010 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00011
00012 namespace SDKTemplate
00013 {
00014     /// <summary>
00015     /// An empty page that can be used on its own or navigated to within a Frame.
00016     /// </summary>
00017     public sealed partial class MainPage : Page
00018     {
00019         private readonly NavigationHelper navigationHelper;
00020         private ItemList defaultViewModel;
00021         public string index = "index";
00022
00023         public MainPage()
00024         {
00025             this.InitializeComponent();
00026
00027             this.NavigationCacheMode = NavigationCacheMode.Required;
00028
00029             this.navigationHelper = new NavigationHelper(this);
00030             this.defaultViewModel = new ItemList();
00031
00032             this.navigationHelper.LoadState += this.NavigationHelper_Load;
00033             this.navigationHelper.SaveState += this.NavigationHelper_Save;
00034         }
00035
00036         /// <summary>
00037         /// Gets the <see cref="NavigationHelper"/> associated with this <see cref="Page"/>.
00038         /// </summary>
00039         public NavigationHelper NavigationHelper
00040         {
00041             get { return this.navigationHelper; }
00042         }
00043
00044         /// <summary>
00045         /// Gets the view model for this <see cref="Page"/>.
00046         /// This can be changed to a strongly typed view model.
00047         /// </summary>
00048         public ItemList DefaultViewModel
00049         {
00050             get { return this.defaultViewModel; }
00051         }
00052
00053         ///<summary>
00054         ///Invoked when an item within a section is clicked
00055         ///Only the following types can be serialized by Frame.GetNavigationState: numbers, characters, strings, guids and boolean.
00056         ///A frame that needs to be serialized cannot pass other types as the navigation param in Frame.Navigate.
00057         ///</summary>
00058         private void ListView_ItemClick(object sender, ItemClickEventArgs e)
00059         {
00060             this.Frame.Navigate(typeof(SubPage), e.ClickedItem.ToString());
00061         }
00062
00063         ///<summary>
00064         ///Adds an item to the list when the app bar button is clicked
00065         ///</summary>
00066         private void AddItem()
00067         {
00068             this.defaultViewModel.Add(new Item() { Name = "Item " + (this.defaultViewModel.Count + 1).ToString() });
00069         }
00070
00071         ///<summary>
00072         /// Resets the item list to the default.
00073         ///</summary>
00074         private void ResetItems()
00075         {
00076             this.defaultViewModel = ItemList.CreateDefaultItemList();
00077             list.ItemsSource = this.defaultViewModel;
00078         }
00079
00080         /// <summary>
00081         /// Populates the page with content passed during navigation. Any saved state is also
00082         /// provided when recreating a page from a prior session.
00083         /// </summary>
00084         /// <param name="sender">
00085         /// The source of the event; typically <see cref="NavigationHelper"/>.
00086         /// </param>
00087         /// <param name="e">Event data that provides both the navigation parameter passed to
00088         /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
00089         /// a dictionary of state preserved by this page during an earlier
00090         /// session. The state will be null the first time a page is visited.</param>
00091         private void NavigationHelper_Load(object sender, LoadStateEventArgs e)
00092         {
00093             this.defaultViewModel = null;
00094             if (SuspensionManager.SessionState.ContainsKey(index))
00095             {
00096                 this.defaultViewModel = SuspensionManager.SessionState[index] as ItemList;
00097             }
00098
00099             if (this.defaultViewModel == null)
00100             {
00101                 this.defaultViewModel = ItemList.CreateDefaultItemList();
00102             }
00103
00104             list.ItemsSource = this.defaultViewModel;
00105         }
00106
00107         /// <summary>
00108         /// Preserves state associated with this page in case the application is suspended or the
00109         /// page is discarded from the navigation cache. Values must conform to the serialization
00110         /// requirements of <see cref="SuspensionManager.SessionState"/>.
00111         /// </summary>
00112         /// <param name="sender">The source of the event; typically <see cref="NavigationHelper"/>.</param>
00113         /// <param name="e">Event data that provides an empty dictionary to be populated with
00114         /// serializable state.</param>
00115         private void NavigationHelper_Save(object sender, SaveStateEventArgs e)
00116         {
00117             SuspensionManager.SessionState[index] = defaultViewModel;
00118         }
00119
00120         #region NavigationHelper registration
00121
00122         /// <summary>
00123         /// The methods provided in this section are simply used to allow
00124         /// NavigationHelper to respond to the page's navigation methods.
00125         /// <para>
00126         /// Page specific logic should be placed in event handlers for the
00127         /// <see cref="NavigationHelper.LoadState"/>
00128         /// and <see cref="NavigationHelper.SaveState"/>.
00129         /// The navigation parameter is available in the LoadState method
00130         /// in addition to page state preserved during an earlier session.
00131         /// </para>
00132         /// </summary>
00133         /// <param name="e">Provides data for navigation methods and event
00134         /// handlers that cannot cancel the navigation request.</param>
00135         protected override void OnNavigatedTo(NavigationEventArgs e)
00136         {
00137             this.navigationHelper.OnNavigatedTo(e);
00138
00139             SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
00140                 this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
00141         }
00142         protected override void OnNavigatedFrom(NavigationEventArgs e)
00143         {
00144             this.navigationHelper.OnNavigatedFrom(e);
00145         }
00146         #endregion
00147     }
00148
00149     /// <summary>
00150     /// observable collection that will contain the list of items. List items are added when page is loaded.
00151     /// </summary>
00152     public class ItemList : ObservableCollection<Item>
00153     {
00154         public ItemList()
00155         {
00156         }
00157
00158         static public ItemList CreateDefaultItemList()
00159         {
00160             return new ItemList()
00161             {
00162                 new Item { Name = "Item 1" },
00163                 new Item { Name = "Item 2" },
00164                 new Item { Name = "Item 3" },
00165                 new Item { Name = "Item 4" },
00166             };
00167         }
00168     }
00169
00170     /// <summary>
00171     /// items that are in the observable collection (ItemList)
00172     /// </summary>
00173     public class Item
00174     {
00175         public string Name { get; set; }
00176         public override string ToString()
00177         {
00178             return this.Name;
00179         }
00180     }
00181 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/ViewLifetimeControl.cs Source File

  • Projection
  • cs

ViewLifetimeControl.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 // The objects defined here demonstrate how to make sure each of the views created remains alive as long as
00008 // the app needs them, but only when they're being used by the app or the user. Many of the scenarios contained in this
00009 // sample use these functions to keep track of the views available and ensure that the view is not closed while
00010 // the scenario is attempting to show it.
00011 //
00012 // As you can see in scenario 1, the ApplicationViewSwitcher.TryShowAsStandaloneAsync and
00013 // ProjectionManager.StartProjectingAsync methods let you show one view next to another. The Consolidated event
00014 // is fired when a view stops being visible separately from other views. Common cases where this will occur
00015 // is when the view falls out of the list of recently used apps, or when the user performs the close gesture on the view.
00016 // This is a good time to close the view, provided the app isn't trying to show the view at the same time. This event
00017 // is fired on the thread of the view that becomes consolidated.
00018 //
00019 // Each view lives on its own thread, so concurrency control is necessary. Also, as you'll see in the sample,
00020 // certain objects may be bound to UI on given threads. Properties of those objects should only be updated
00021 // on that UI thread.
00022
00023 using System;
00024 using System.ComponentModel;
00025 using Windows.UI.Core;
00026 using Windows.UI.ViewManagement;
00027
00028 namespace SecondaryViewsHelpers
00029 {
00030     // A custom event that fires whenever the secondary view is ready to be closed. You should
00031     // clean up any state (including deregistering for events) then close the window in this handler
00032     public delegate void ViewReleasedHandler(Object sender, EventArgs e);
00033
00034     // A ViewLifetimeControl is instantiated for every secondary view. ViewLifetimeControl's reference count
00035     // keeps track of when the secondary view thinks it's in usem and when the main view is interacting with the secondary view (about to show
00036     // it to the user, etc.) When the reference count drops to zero, the secondary view is closed.
00037     public sealed class ViewLifetimeControl : INotifyPropertyChanged
00038     {
00039         // Dispatcher for this view. Kept here for sending messages between this view and the main view.
00040         CoreDispatcher dispatcher;
00041
00042         // Window for this particular view. Used to register and unregister for events
00043         CoreWindow window;
00044
00045         // The title for the view shown in the list of recently used apps (by setting the title on
00046         // ApplicationView)
00047         string title;
00048
00049         // This class uses references counts to make sure the secondary views isn't closed prematurely.
00050         // Whenever the main view is about to interact with the secondary view, it should take a reference
00051         // by calling "StartViewInUse" on this object. When finished interacting, it should release the reference
00052         // by calling "StopViewInUse". You can see examples of this throughout the sample, especially in
00053         // scenario 1.
00054         int refCount = 0;
00055
00056         // Each view has a unique Id, found using the ApplicationView.Id property or
00057         // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00058         // and ProjectionManager APIs.
00059         int viewId;
00060
00061         // Tracks if this ViewLifetimeControl object is still valid. If this is true, then the view is in the process
00062         // of closing itself down
00063         bool released = false;
00064
00065         // Keeps track of if the consolidated event has fired yet. A view is consolidated with other views
00066         // when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00067         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point
00068         // the user can interact with it, move it on or off screen, etc.
00069         bool consolidated = true;
00070
00071         // Tracks whether the projected view has been made visible for the first time yet. If it has not yet been shown for the
00072         // first time yet, we should not signal for it to be released yet. This protects against the fact that visibilityChanged
00073         // is not guaranteed to fire until after the StartProjectingAsync task has completed, so refCount of the ViewLifeTimeControl
00074         // may temporarily drop to 0 until the visibilityChanged event fires for the projected view first becoming visible.
00075         bool madeVisible = false;
00076
00077         // Used to store pubicly registered events under the protection of a lock
00078         event ViewReleasedHandler InternalReleased;
00079
00080         // Instantiate views using "CreateForCurrentView"
00081         private ViewLifetimeControl(CoreWindow newWindow)
00082         {
00083             dispatcher = newWindow.Dispatcher;
00084             window = newWindow;
00085             viewId = ApplicationView.GetApplicationViewIdForWindow(window);
00086
00087             // This class will automatically tell the view when its time to close
00088             // or stay alive in a few cases
00089             RegisterForEvents();
00090         }
00091
00092         // Register for events on the current view
00093         private void RegisterForEvents()
00094         {
00095             // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00096             // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00097             // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00098             ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
00099             window.VisibilityChanged += VisibilityChanged;
00100         }
00101
00102         // Unregister for events. Call this method before closing the view to prevent leaks.
00103         private void UnregisterForEvents()
00104         {
00105             ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
00106             window.VisibilityChanged -= VisibilityChanged;
00107         }
00108
00109         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00110         {
00111
00112             if (e.Visible)
00113             {
00114                 // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00115                 // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00116                 // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00117                 Consolidated = false;
00118             }
00119         }
00120
00121         // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00122         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00123         // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00124         private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e)
00125         {
00126             Consolidated = true;
00127         }
00128
00129         // Called when a view has been "consolidated" (no longer accessible to the user)
00130         // and no other view is trying to interact with it. This should only be closed after the reference
00131         // count goes to 0 (including being consolidated). At the end of this, the view is closed.
00132         private void FinalizeRelease()
00133         {
00134             bool justReleased = false;
00135             lock (this)
00136             {
00137                 if (refCount == 0)
00138                 {
00139                     justReleased = true;
00140                     released = true;
00141                 }
00142             }
00143
00144             // This assumes that released will never be made false after it
00145             // it has been set to true
00146             if (justReleased)
00147             {
00148                 UnregisterForEvents();
00149                 InternalReleased(this, null);
00150             }
00151         }
00152
00153         // Creates ViewLifetimeControl for the particular view.
00154         // Only do this once per view.
00155         public static ViewLifetimeControl CreateForCurrentView()
00156         {
00157             return new ViewLifetimeControl(CoreWindow.GetForCurrentThread());
00158         }
00159
00160         // For purposes of this sample, the collection of views
00161         // is bound to a UI collection. This property is available for binding
00162         public string Title
00163         {
00164             get
00165             {
00166                 return title;
00167             }
00168             set
00169             {
00170                 if (title != value)
00171                 {
00172                     title = value;
00173                     if (PropertyChanged != null)
00174                     {
00175                         PropertyChanged(this, new PropertyChangedEventArgs("Title"));
00176                     }
00177                 }
00178             }
00179         }
00180
00181         // Necessary to communicate with the window
00182         public CoreDispatcher Dispatcher
00183         {
00184             get
00185             {
00186                 // This property never changes, so there's no need to lock
00187                 return dispatcher;
00188             }
00189         }
00190
00191         // Each view has a unique Id, found using the ApplicationView.Id property or
00192         // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00193         // and ProjectionManager APIs.
00194         public int Id
00195         {
00196             get
00197             {
00198                 // This property never changes, so there's no need to lock
00199                 return viewId;
00200             }
00201         }
00202
00203         // Keeps track of if the consolidated event has fired yet. A view is consolidated with other views
00204         // when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00205         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point
00206         // the user can interact with it, move it on or off screen, etc.
00207         public bool Consolidated
00208         {
00209             get
00210             {
00211                 // This property should only be accessed by the thread on which the view lives, so there's no need to lock
00212                 return consolidated;
00213             }
00214             set
00215             {
00216                 if (consolidated != value)
00217                 {
00218                     consolidated = value;
00219                     if (consolidated)
00220                     {
00221                         // The view isn't accessible to the user, so it's OK to close it.
00222                         StopViewInUse();
00223                     }
00224                     else
00225                     {
00226                         // The view has become visible, so do not close it until it's consolidated
00227                         StartViewInUse();
00228                         madeVisible = true;
00229                     }
00230                 }
00231             }
00232         }
00233
00234         // Signals that the view is being interacted with by another view,
00235         // so it shouldn't be closed even if it becomes "consolidated"
00236         public int StartViewInUse()
00237         {
00238             bool releasedCopy = false;
00239             int refCountCopy = 0;
00240
00241             // This method is called from several different threads
00242             // (each view lives on its own thread)
00243             lock (this)
00244             {
00245                 releasedCopy = this.released;
00246                 if (!released)
00247                 {
00248                     refCountCopy = ++refCount;
00249                 }
00250             }
00251
00252             if (releasedCopy)
00253             {
00254                 throw new InvalidOperationException("This view is being disposed");
00255             }
00256
00257             return refCountCopy;
00258         }
00259
00260         // Should come after any call to StartViewInUse
00261         // Signals that the another view has finished interacting with the view tracked
00262         // by this object
00263         public int StopViewInUse()
00264         {
00265             int refCountCopy = 0;
00266             bool releasedCopy = false;
00267
00268             lock (this)
00269             {
00270                 releasedCopy = this.released;
00271                 if (!released)
00272                 {
00273                     refCountCopy = --refCount;
00274                     if ((refCountCopy == 0) && madeVisible)
00275                     {
00276                         dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease);
00277                     }
00278                 }
00279             }
00280
00281             if (releasedCopy)
00282             {
00283                 throw new InvalidOperationException("This view is being disposed");
00284             }
00285             return refCountCopy;
00286         }
00287
00288         // Signals to consumers that its time to close the view so that
00289         // they can clean up (including calling Window.Close() when finished)
00290         public event PropertyChangedEventHandler PropertyChanged;
00291         public event ViewReleasedHandler Released
00292         {
00293             add
00294             {
00295                 bool releasedCopy = false;
00296                 lock (this)
00297                 {
00298                     releasedCopy = released;
00299                     if (!released)
00300                     {
00301                         InternalReleased += value;
00302                     }
00303                 }
00304
00305                 if (releasedCopy)
00306                 {
00307                     throw new InvalidOperationException("This view is being disposed");
00308                 }
00309             }
00310
00311             remove
00312             {
00313                 lock (this)
00314                 {
00315                     InternalReleased -= value;
00316                 }
00317             }
00318         }
00319     }
00320 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RfcommChatDeviceDisplay Member List

This is the complete list of members for RfcommChatDeviceDisplay, including all inherited members.
deviceInfo | RfcommChatDeviceDisplay | [private]
DeviceInformation | RfcommChatDeviceDisplay |
GlyphBitmapImage | RfcommChatDeviceDisplay |
Id | RfcommChatDeviceDisplay |
Name | RfcommChatDeviceDisplay |
OnPropertyChanged(string name) | RfcommChatDeviceDisplay | [inline, protected]
PropertyChanged | RfcommChatDeviceDisplay |
RfcommChatDeviceDisplay(DeviceInformation deviceInfoIn) | RfcommChatDeviceDisplay | [inline]
Update(DeviceInformationUpdate deviceInfoUpdate) | RfcommChatDeviceDisplay | [inline]
UpdateGlyphBitmapImage() | RfcommChatDeviceDisplay | [inline, private]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceProperties Member List

This is the complete list of members for DeviceProperties, including all inherited members.
DeviceInstanceId DeviceProperties
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario1.cpp Source File

  • FileThumbnails
  • cppwinrt

Scenario1.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1.h"
00014 #include "Scenario1.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::FileProperties;
00021 using namespace Windows::Storage::Pickers;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario1::Scenario1()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     void Scenario1::OnNavigatedTo(NavigationEventArgs const&)
00034     {
00035         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00036     }
00037
00038     fire_and_forget Scenario1::GetThumbnailButton_Click(IInspectable const&, RoutedEventArgs const&)
00039     {
00040         auto lifetime = get_strong();
00041
00042         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00043
00044         // Pick a photo
00045         FileOpenPicker openPicker;
00046         openPicker.FileTypeFilter().ReplaceAll(FileExtensions::Image());
00047         StorageFile file = co_await openPicker.PickSingleFileAsync();
00048         if (file != nullptr)
00049         {
00050             hstring thumbnailModeName = ModeComboBox().SelectedItem().as<ComboBoxItem>().Name();
00051             ThumbnailMode thumbnailMode = ThumbnailMode::ListView;
00052             if (thumbnailModeName == L"ListView")
00053             {
00054                 thumbnailMode = ThumbnailMode::ListView;
00055             }
00056             if (thumbnailModeName == L"PicturesView")
00057             {
00058                 thumbnailMode = ThumbnailMode::PicturesView;
00059             }
00060             else if (thumbnailModeName == L"SingleItem")
00061             {
00062                 thumbnailMode = ThumbnailMode::SingleItem;
00063             }
00064
00065             bool fastThumbnail = FastThumbnailCheckBox().IsChecked().Value();
00066             ThumbnailOptions thumbnailOptions = ThumbnailOptions::UseCurrentScale;
00067             if (fastThumbnail)
00068             {
00069                 thumbnailOptions |= ThumbnailOptions::ReturnOnlyIfCached;
00070             }
00071
00072             const uint32_t size = 200;
00073             StorageItemThumbnail thumbnail = co_await file.GetThumbnailAsync(thumbnailMode, size, thumbnailOptions);
00074             if (thumbnail != nullptr)
00075             {
00076                 Helpers::DisplayResult(ThumbnailImage(), OutputTextBlock(), thumbnailMode, size, file, thumbnail, false);
00077                 thumbnail.Close();
00078             }
00079             else if (fastThumbnail)
00080             {
00081                 rootPage.NotifyUser(Errors::NoExifThumbnail, NotifyType::StatusMessage);
00082             }
00083             else
00084             {
00085                 rootPage.NotifyUser(Errors::NoThumbnail, NotifyType::StatusMessage);
00086             }
00087         }
00088         else
00089         {
00090             rootPage.NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00091         }
00092     }
00093
00094 }
Generated on Fri Nov 15 2024 22:19:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Tasks/pch.cpp Source File

  • Pedometer
  • cpp
  • Tasks

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario3.cpp Source File

  • FolderEnumeration
  • cppwinrt

Scenario3.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3.h"
00014 #include "Scenario3.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::FileProperties;
00022 using namespace Windows::Storage::Search;
00023 using namespace Windows::UI::Xaml;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario3::Scenario3()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     hstring Scenario3::GetPropertyDisplayValue(IInspectable const& rawValue)
00033     {
00034         if (!rawValue)
00035         {
00036             return L"none";
00037         }
00038         else
00039         {
00040             return unbox_value<hstring>(rawValue);
00041         }
00042     }
00043
00044     fire_and_forget Scenario3::GetFilesButton_Click(IInspectable const&, RoutedEventArgs const&)
00045     {
00046         auto lifetime = get_strong();
00047
00048         // Define some properties we will be using.
00049         hstring CopyrightProperty = L"System.Copyright";
00050         hstring ColorSpaceProperty = L"System.Image.ColorSpace";
00051
00052         // Reset output.
00053         OutputPanel().Children().Clear();
00054
00055         // Set up file type filter.
00056         std::vector<hstring> fileTypeFilter{ L".jpg", L".png", L".bmp", L".gif" };
00057
00058         // Create query options.
00059         QueryOptions queryOptions{ CommonFileQuery::OrderByName, fileTypeFilter };
00060
00061         // Set up property prefetch - use the PropertyPrefetchOptions for top-level properties
00062         // and a list for additional properties.
00063         std::vector<hstring> propertyNames{ CopyrightProperty, ColorSpaceProperty };
00064         queryOptions.SetPropertyPrefetch(PropertyPrefetchOptions::ImageProperties, propertyNames);
00065
00066         // Set up thumbnail prefetch if needed, e.g. when creating a picture gallery view.
00067         /*
00068         const uint32_t requestedSize = 190;
00069         const ThumbnailMode thumbnailMode = ThumbnailMode::PicturesView;
00070         const ThumbnailOptions thumbnailOptions = ThumbnailOptions::UseCurrentScale;
00071         queryOptions.SetThumbnailPrefetch(thumbnailMode, requestedSize, thumbnailOptions);
00072         */
00073
00074         // Set up the query and retrieve files.
00075         StorageFolder picturesFolder = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary);
00076         auto query = picturesFolder.CreateFileQueryWithOptions(queryOptions);
00077         IVectorView<StorageFile> fileList = co_await query.GetFilesAsync();
00078         for (StorageFile const& file : fileList)
00079         {
00080             OutputPanel().Children().Append(Helpers::CreateHeaderTextBlock(file.Name()));
00081
00082             // GetImagePropertiesAsync will return synchronously when prefetching has been able to
00083             // retrieve the properties in advance.
00084             ImageProperties properties = co_await file.Properties().GetImagePropertiesAsync();
00085             OutputPanel().Children().Append(Helpers::CreateLineItemTextBlock(L"Dimensions: " + to_hstring(properties.Width()) + L"x" + to_hstring(properties.Height())));
00086
00087             // Similarly, extra properties are retrieved asynchronously but may
00088             // return immediately when prefetching has fulfilled its task.
00089             IMap<hstring, IInspectable> extraProperties = co_await file.Properties().RetrievePropertiesAsync(std::move(propertyNames));
00090             auto propValue = GetPropertyDisplayValue(extraProperties.Lookup(CopyrightProperty));
00091             OutputPanel().Children().Append(Helpers::CreateLineItemTextBlock(L"Copyright: " + propValue));
00092             propValue = GetPropertyDisplayValue(extraProperties.Lookup(ColorSpaceProperty));
00093             OutputPanel().Children().Append(Helpers::CreateLineItemTextBlock(L"Color space: " + propValue));
00094
00095             // Thumbnails can also be retrieved and used.
00096             // auto thumbnail = co_await file.GetThumbnailAsync(thumbnailMode, requestedSize, thumbnailOptions);
00097         }
00098     }
00099 }
Generated on Fri Nov 15 2024 22:19:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoGallery::VideoItemInfo Member List

This is the complete list of members for VideoGallery::VideoItemInfo, including all inherited members.
Source | VideoGallery::VideoItemInfo
Title | VideoGallery::VideoItemInfo
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Save Member List

This is the complete list of members for Scenario1_Save, including all inherited members.
SaveCredential_Click(Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &) | Scenario1_Save
Scenario1_Save() | Scenario1_Save
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/SampleConfiguration.cpp Source File

  • Package
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Identity",           "SDKTemplate.Scenario1" },
00021     { "Installed Location", "SDKTemplate.Scenario2" },
00022     { "Dependencies",       "SDKTemplate.Scenario3" },
00023 };
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cs/Scenario1_TrackInWebcam.xaml.cs Source File

  • BasicFaceTracking
  • cs

Scenario1_TrackInWebcam.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading;
00015 using System.Threading.Tasks;
00016
00017 using Windows.Graphics.Imaging;
00018 using Windows.Media;
00019 using Windows.Media.Capture;
00020 using Windows.Media.FaceAnalysis;
00021 using Windows.Media.MediaProperties;
00022 using Windows.System.Threading;
00023 using Windows.UI.Xaml;
00024 using Windows.UI.Xaml.Controls;
00025 using Windows.UI.Xaml.Media;
00026 using Windows.UI.Xaml.Media.Imaging;
00027 using Windows.UI.Xaml.Navigation;
00028 using Windows.UI.Xaml.Shapes;
00029
00030 namespace SDKTemplate
00031 {
00032     /// <summary>
00033     /// Page for demonstrating FaceTracking.
00034     /// </summary>
00035     public sealed partial class Scenario1_TrackInWebcam : Page
00036     {
00037         /// <summary>
00038         /// Reference back to the "root" page of the app.
00039         /// </summary>
00040         private MainPage rootPage = MainPage.Current;
00041
00042         /// <summary>
00043         /// Holds the current scenario state value.
00044         /// </summary>
00045         private ScenarioState currentState = ScenarioState.Idle;
00046
00047         /// <summary>
00048         /// References a MediaCapture instance; is null when not in Streaming state.
00049         /// </summary>
00050         private MediaCapture mediaCapture;
00051
00052         /// <summary>
00053         /// Cache of properties from the current MediaCapture device which is used for capturing the preview frame.
00054         /// </summary>
00055         private VideoEncodingProperties videoProperties;
00056
00057         /// <summary>
00058         /// References a FaceTracker instance.
00059         /// </summary>
00060         private FaceTracker faceTracker;
00061
00062         /// <summary>
00063         /// A periodic timer to execute FaceTracker on preview frames
00064         /// </summary>
00065         private ThreadPoolTimer frameProcessingTimer;
00066
00067         /// <summary>
00068         /// Flag to ensure FaceTracking logic only executes one at a time
00069         /// </summary>
00070         private int busy = 0;
00071
00072         /// <summary>
00073         /// Initializes a new instance of the <see cref="Scenario1_TrackInWebcam"/> class.
00074         /// </summary>
00075         public Scenario1_TrackInWebcam()
00076         {
00077             this.InitializeComponent();
00078         }
00079
00080         /// <summary>
00081         /// Values for identifying and controlling scenario states.
00082         /// </summary>
00083         private enum ScenarioState
00084         {
00085             /// <summary>
00086             /// Display is blank - default state.
00087             /// </summary>
00088             Idle,
00089
00090             /// <summary>
00091             /// Webcam is actively engaged and a live video stream is displayed.
00092             /// </summary>
00093             Streaming
00094         }
00095
00096         /// <summary>
00097         /// Responds when we navigate to this page.
00098         /// </summary>
00099         /// <param name="e">Event data</param>
00100         protected override void OnNavigatedTo(NavigationEventArgs e)
00101         {
00102             App.Current.Suspending += this.OnSuspending;
00103         }
00104
00105         /// <summary>
00106         /// Responds when we navigate away from this page.
00107         /// </summary>
00108         /// <param name="e">Event data</param>
00109         protected override void OnNavigatedFrom(NavigationEventArgs e)
00110         {
00111             App.Current.Suspending -= this.OnSuspending;
00112         }
00113
00114         /// <summary>
00115         /// Responds to App Suspend event to stop/release MediaCapture object if it's running and return to Idle state.
00116         /// </summary>
00117         /// <param name="sender">The source of the Suspending event</param>
00118         /// <param name="e">Event data</param>
00119         private async void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00120         {
00121             if (this.currentState == ScenarioState.Streaming)
00122             {
00123                 var deferral = e.SuspendingOperation.GetDeferral();
00124                 try
00125                 {
00126                     await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00127                 }
00128                 finally
00129                 {
00130                     deferral.Complete();
00131                 }
00132             }
00133         }
00134
00135         /// <summary>
00136         /// Creates the FaceTracker object which we will use for face detection and tracking.
00137         /// Initializes a new MediaCapture instance and starts the Preview streaming to the CamPreview UI element.
00138         /// </summary>
00139         /// <returns>Async Task object returning true if initialization and streaming were successful and false if an exception occurred.</returns>
00140         private async Task<bool> StartWebcamStreamingAsync()
00141         {
00142             bool successful = false;
00143
00144             faceTracker = await FaceTracker.CreateAsync();
00145
00146             try
00147             {
00148                 this.mediaCapture = new MediaCapture();
00149
00150                 // For this scenario, we only need Video (not microphone) so specify this in the initializer.
00151                 // NOTE: the appxmanifest only declares "webcam" under capabilities and if this is changed to include
00152                 // microphone (default constructor) you must add "microphone" to the manifest or initialization will fail.
00153                 MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
00154                 settings.StreamingCaptureMode = StreamingCaptureMode.Video;
00155                 await this.mediaCapture.InitializeAsync(settings);
00156                 this.mediaCapture.Failed += this.MediaCapture_CameraStreamFailed;
00157
00158                 // Cache the media properties as we'll need them later.
00159                 var deviceController = this.mediaCapture.VideoDeviceController;
00160                 this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
00161
00162                 // Immediately start streaming to our CaptureElement UI.
00163                 // NOTE: CaptureElement's Source must be set before streaming is started.
00164                 this.CamPreview.Source = this.mediaCapture;
00165                 await this.mediaCapture.StartPreviewAsync();
00166
00167                 // Run the timer at 66ms, which is approximately 15 frames per second.
00168                 TimeSpan timerInterval = TimeSpan.FromMilliseconds(66);
00169                 this.frameProcessingTimer = ThreadPoolTimer.CreatePeriodicTimer(ProcessCurrentVideoFrame, timerInterval);
00170                 successful = true;
00171             }
00172             catch (System.UnauthorizedAccessException)
00173             {
00174                 // If the user has disabled their webcam this exception is thrown; provide a descriptive message to inform the user of this fact.
00175                 this.rootPage.NotifyUser("Webcam is disabled or access to the webcam is disabled for this app.\nEnsure Privacy Settings allow webcam usage.", NotifyType.ErrorMessage);
00176             }
00177             catch (Exception ex)
00178             {
00179                 this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00180             }
00181
00182             return successful;
00183         }
00184
00185         /// <summary>
00186         /// Safely stops webcam streaming (if running) and releases MediaCapture object.
00187         /// </summary>
00188         private async Task ShutdownWebcamAsync()
00189         {
00190             if(this.frameProcessingTimer != null)
00191             {
00192                 this.frameProcessingTimer.Cancel();
00193             }
00194
00195             if (this.mediaCapture != null)
00196             {
00197                 if (this.mediaCapture.CameraStreamState == Windows.Media.Devices.CameraStreamState.Streaming)
00198                 {
00199                     try
00200                     {
00201                         await this.mediaCapture.StopPreviewAsync();
00202                     }
00203                     catch(Exception)
00204                     {
00205                         ;   // Since we're going to destroy the MediaCapture object there's nothing to do here
00206                     }
00207                 }
00208                 this.mediaCapture.Dispose();
00209             }
00210
00211             this.frameProcessingTimer = null;
00212             this.CamPreview.Source = null;
00213             this.mediaCapture = null;
00214             this.CameraStreamingButton.IsEnabled = true;
00215         }
00216
00217         /// <summary>
00218         /// This method is invoked by a ThreadPoolTimer to execute the FaceTracker and Visualization logic.
00219         /// </summary>
00220         /// <param name="timer">Timer object invoking this call</param>
00221         private async void ProcessCurrentVideoFrame(ThreadPoolTimer timer)
00222         {
00223             if (this.currentState != ScenarioState.Streaming)
00224             {
00225                 return;
00226             }
00227
00228             // If busy is already 1, then the previous frame is still being processed,
00229             // in which case we skip the current frame.
00230             if (Interlocked.CompareExchange(ref busy, 1, 0) != 0)
00231             {
00232                 return;
00233             }
00234
00235             await ProcessCurrentVideoFrameAsync();
00236             Interlocked.Exchange(ref busy, 0);
00237         }
00238
00239         /// <summary>
00240         /// This method is called to execute the FaceTracker and Visualization logic at each timer tick.
00241         /// </summary>
00242         /// <remarks>
00243         /// Keep in mind this method is called from a Timer and not synchronized with the camera stream. Also, the processing time of FaceTracker
00244         /// will vary depending on the size of each frame and the number of faces being tracked. That is, a large image with several tracked faces may
00245         /// take longer to process.
00246         /// </remarks>
00247         private async Task ProcessCurrentVideoFrameAsync()
00248         {
00249             // Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
00250             // GetPreviewFrame will convert the native webcam frame into this format.
00251             const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
00252             using (VideoFrame previewFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width, (int)this.videoProperties.Height))
00253             {
00254                 try
00255                 {
00256                     await this.mediaCapture.GetPreviewFrameAsync(previewFrame);
00257                 }
00258                 catch (UnauthorizedAccessException)
00259                 {
00260                     // Lost access to the camera.
00261                     AbandonStreaming();
00262                     return;
00263                 }
00264                 catch (Exception)
00265                 {
00266                     this.rootPage.NotifyUser($"PreviewFrame with format '{InputPixelFormat}' is not supported by your Webcam", NotifyType.ErrorMessage);
00267                     return;
00268                 }
00269
00270                 // The returned VideoFrame should be in the supported NV12 format but we need to verify this.
00271                 if (!FaceDetector.IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap.BitmapPixelFormat))
00272                 {
00273                     this.rootPage.NotifyUser($"PixelFormat '{previewFrame.SoftwareBitmap.BitmapPixelFormat}' is not supported by FaceDetector", NotifyType.ErrorMessage);
00274                     return;
00275                 }
00276
00277                 IList<DetectedFace> faces;
00278                 try
00279                 {
00280                     faces = await this.faceTracker.ProcessNextFrameAsync(previewFrame);
00281                 }
00282                 catch (Exception ex)
00283                 {
00284                     this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00285                     return;
00286                 }
00287
00288                 // Create our visualization using the frame dimensions and face results but run it on the UI thread.
00289                 var previewFrameSize = new Windows.Foundation.Size(previewFrame.SoftwareBitmap.PixelWidth, previewFrame.SoftwareBitmap.PixelHeight);
00290                 var ignored = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00291                 {
00292                     this.SetupVisualization(previewFrameSize, faces);
00293                 });
00294             }
00295         }
00296
00297         /// <summary>
00298         /// Takes the webcam image and FaceTracker results and assembles the visualization onto the Canvas.
00299         /// </summary>
00300         /// <param name="framePizelSize">Width and height (in pixels) of the video capture frame</param>
00301         /// <param name="foundFaces">List of detected faces; output from FaceTracker</param>
00302         private void SetupVisualization(Windows.Foundation.Size framePixelSize, IList<DetectedFace> foundFaces)
00303         {
00304             this.VisualizationCanvas.Children.Clear();
00305
00306             if (this.currentState == ScenarioState.Streaming && framePixelSize.Width != 0.0 && framePixelSize.Height != 0.0)
00307             {
00308                 double widthScale = this.VisualizationCanvas.ActualWidth / framePixelSize.Width;
00309                 double heightScale = this.VisualizationCanvas.ActualHeight / framePixelSize.Height;
00310
00311                 foreach (DetectedFace face in foundFaces)
00312                 {
00313                     // Create a rectangle element for displaying the face box but since we're using a Canvas
00314                     // we must scale the rectangles according to the frames's actual size.
00315                     Rectangle box = new Rectangle()
00316                     {
00317                         Width = face.FaceBox.Width * widthScale,
00318                         Height = face.FaceBox.Height * heightScale,
00319                         Margin = new Thickness(face.FaceBox.X * widthScale, face.FaceBox.Y * heightScale, 0, 0),
00320                         Style = HighlightedFaceBoxStyle
00321                     };
00322                     this.VisualizationCanvas.Children.Add(box);
00323                 }
00324             }
00325         }
00326
00327         /// <summary>
00328         /// Manages the scenario's internal state. Invokes the internal methods and updates the UI according to the
00329         /// passed in state value. Handles failures and resets the state if necessary.
00330         /// </summary>
00331         /// <param name="newState">State to switch to</param>
00332         private async Task ChangeScenarioStateAsync(ScenarioState newState)
00333         {
00334             // Disable UI while state change is in progress
00335             this.CameraStreamingButton.IsEnabled = false;
00336
00337             switch (newState)
00338             {
00339                 case ScenarioState.Idle:
00340
00341                     this.currentState = newState;
00342                     await this.ShutdownWebcamAsync();
00343
00344                     this.VisualizationCanvas.Children.Clear();
00345                     this.CameraStreamingButton.Content = "Start Streaming";
00346                     break;
00347
00348                 case ScenarioState.Streaming:
00349
00350                     if (!await this.StartWebcamStreamingAsync())
00351                     {
00352                         await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00353                         break;
00354                     }
00355
00356                     this.VisualizationCanvas.Children.Clear();
00357                     this.CameraStreamingButton.Content = "Stop Streaming";
00358                     this.currentState = newState;
00359                     this.CameraStreamingButton.IsEnabled = true;
00360                     break;
00361             }
00362         }
00363
00364         private void AbandonStreaming()
00365         {
00366             // MediaCapture is not Agile and so we cannot invoke its methods on this caller's thread
00367             // and instead need to schedule the state change on the UI thread.
00368             var ignored = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00369             {
00370                 await ChangeScenarioStateAsync(ScenarioState.Idle);
00371             });
00372         }
00373
00374         /// <summary>
00375         /// Handles MediaCapture stream failures by shutting down streaming and returning to Idle state.
00376         /// </summary>
00377         /// <param name="sender">The source of the event, i.e. our MediaCapture object</param>
00378         /// <param name="args">Event data</param>
00379         private void MediaCapture_CameraStreamFailed(MediaCapture sender, object args)
00380         {
00381             AbandonStreaming();
00382         }
00383
00384         /// <summary>
00385         /// Handles "streaming" button clicks to start/stop webcam streaming.
00386         /// </summary>
00387         /// <param name="sender">Button user clicked</param>
00388         /// <param name="e">Event data</param>
00389         private async void CameraStreamingButton_Click(object sender, RoutedEventArgs e)
00390         {
00391             if (this.currentState == ScenarioState.Streaming)
00392             {
00393                 this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00394                 await this.ChangeScenarioStateAsync(ScenarioState.Idle);
00395             }
00396             else
00397             {
00398                 this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00399                 await this.ChangeScenarioStateAsync(ScenarioState.Streaming);
00400             }
00401         }
00402     }
00403 }
Generated on Fri Nov 15 2024 22:18:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario2.cpp Source File

  • FileThumbnails
  • cppwinrt

Scenario2.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.h"
00014 #include "Scenario2.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::FileProperties;
00021 using namespace Windows::Storage::Pickers;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario2::Scenario2()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario2::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00035     }
00036
00037     fire_and_forget Scenario2::GetThumbnailButton_Click(IInspectable const&, RoutedEventArgs const&)
00038     {
00039         auto lifetime = get_strong();
00040
00041         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00042
00043         // Pick a music file
00044         FileOpenPicker openPicker;
00045         openPicker.FileTypeFilter().ReplaceAll(FileExtensions::Music());
00046         StorageFile file = co_await openPicker.PickSingleFileAsync();
00047
00048         if (file != nullptr)
00049         {
00050             const ThumbnailMode thumbnailMode = ThumbnailMode::MusicView;
00051             const uint32_t size = 100;
00052             StorageItemThumbnail thumbnail = co_await file.GetThumbnailAsync(thumbnailMode, size);
00053
00054             // Also verify the type is ThumbnailType::Image (album art) instead of ThumbnailType::Icon
00055             // (which may be returned as a fallback if the file does not provide album art)
00056             if (thumbnail != nullptr && thumbnail.Type() == ThumbnailType::Image)
00057             {
00058                 // Display the thumbnail
00059                 Helpers::DisplayResult(ThumbnailImage(), OutputTextBlock(), thumbnailMode, size, file, thumbnail, false);
00060             }
00061             else
00062             {
00063                 rootPage.NotifyUser(Errors::NoAlbumArt, NotifyType::StatusMessage);
00064             }
00065             if (thumbnail != nullptr)
00066             {
00067                 thumbnail.Close();
00068             }
00069         }
00070         else
00071         {
00072             rootPage.NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/shared/elsutil.h Source File

  • LinguisticServices
  • shared

elsutil.h

Go to the documentation of this file.
00001 #pragma once
00002 #include <windows.h>
00003 #include <elscore.h>
00004 #include <elssrvc.h>
00005
00006 namespace ELS::Private
00007 {
00008     struct unique_services
00009     {
00010         operator MAPPING_SERVICE_INFO* () { return services; }
00011         MAPPING_SERVICE_INFO** operator&() { return &services; }
00012         MAPPING_SERVICE_INFO* services = nullptr;
00013         unique_services() = default;
00014         unique_services(unique_services const&) = delete;
00015         ~unique_services() { if (services) MappingFreeServices(services); }
00016     };
00017
00018     struct unique_bag : MAPPING_PROPERTY_BAG
00019     {
00020         unique_bag() : MAPPING_PROPERTY_BAG{} {}
00021         unique_bag(unique_bag const&) = delete;
00022         ~unique_bag() { MappingFreePropertyBag(this); }
00023     };
00024
00025     inline void MappingRecognizeTextFromService(REFGUID service, wchar_t const* text, DWORD length, unique_bag& bag)
00026     {
00027         MAPPING_ENUM_OPTIONS EnumOptions = {};
00028         EnumOptions.Size = sizeof(EnumOptions);
00029         EnumOptions.pGuid = const_cast<GUID*>(&service);
00030
00031         DWORD dwServicesCount = 0;
00032         unique_services services;
00033         winrt::check_hresult(MappingGetServices(&EnumOptions, &services, &dwServicesCount));
00034
00035         bag.Size = sizeof(bag);
00036         winrt::check_hresult(MappingRecognizeText(services, text, length, 0, nullptr, &bag));
00037     }
00038 }
00039
00040 namespace ELS
00041 {
00042     template<typename Lambda>
00043     void RecognizeTextLanguages(wchar_t const* text, DWORD length, Lambda&& callback)
00044     {
00045         if (length == 0) return;
00046
00047         Private::unique_bag bag;
00048         Private::MappingRecognizeTextFromService(ELS_GUID_LANGUAGE_DETECTION, text, length, bag);
00049
00050         for (auto pos = reinterpret_cast<wchar_t const*>(bag.prgResultRanges[0].pData); *pos; pos += (wcslen(pos) + 1))
00051         {
00052             callback(pos);
00053         }
00054     }
00055
00056     template<typename Lambda>
00057     void RecognizeTextScripts(wchar_t const* text, DWORD length, Lambda&& callback)
00058     {
00059         if (length == 0) return;
00060
00061         Private::unique_bag bag;
00062         Private::MappingRecognizeTextFromService(ELS_GUID_SCRIPT_DETECTION, text, length, bag);
00063
00064         for (DWORD rangeIndex = 0; rangeIndex < bag.dwRangesCount; ++rangeIndex)
00065         {
00066             callback(bag.prgResultRanges[rangeIndex].dwStartIndex, bag.prgResultRanges[rangeIndex].dwEndIndex,
00067                 reinterpret_cast<wchar_t const*>(bag.prgResultRanges[rangeIndex].pData));
00068         }
00069     }
00070
00071     template<typename Lambda>
00072     void TransliterateFromCyrillicToLatin(wchar_t const* text, DWORD length, Lambda&& callback)
00073     {
00074         Private::unique_bag bag;
00075         Private::MappingRecognizeTextFromService(ELS_GUID_TRANSLITERATION_CYRILLIC_TO_LATIN, text, length, bag);
00076         callback(reinterpret_cast<wchar_t const*>(bag.prgResultRanges[0].pData), bag.prgResultRanges[0].dwDataSize / sizeof(wchar_t));
00077     }
00078 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cs/5-GestureRecognizer.xaml.cs Source File

  • BasicInput
  • cs

5-GestureRecognizer.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Input;
00017 using Windows.UI.Input;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario5 : Page
00022     {
00023         GestureRecognizer recognizer;
00024         ManipulationInputProcessor manipulationProcessor;
00025
00026         public Scenario5()
00027         {
00028             this.InitializeComponent();
00029
00030             InitOptions();
00031
00032             // Create a GestureRecognizer which will be used to process the manipulations
00033             // done on the rectangle
00034             recognizer = new GestureRecognizer();
00035
00036             // Create a ManipulationInputProcessor which will listen for events on the
00037             // rectangle, process them, and update the rectangle's position, size, and rotation
00038             manipulationProcessor = new ManipulationInputProcessor(recognizer, manipulateMe, mainCanvas);
00039         }
00040
00041         private void InitOptions()
00042         {
00043             movementAxis.SelectedIndex = 0;
00044             InertiaSwitch.IsOn = true;
00045         }
00046
00047         private void movementAxis_Changed(object sender, SelectionChangedEventArgs e)
00048         {
00049             if (manipulationProcessor == null)
00050             {
00051                 return;
00052             }
00053
00054             ComboBoxItem selectedItem = (ComboBoxItem)((ComboBox)sender).SelectedItem;
00055             switch (selectedItem.Content.ToString())
00056             {
00057                 case "X only":
00058                     manipulationProcessor.LockToXAxis();
00059                     break;
00060                 case "Y only":
00061                     manipulationProcessor.LockToYAxis();
00062                     break;
00063                 default:
00064                     manipulationProcessor.MoveOnXAndYAxes();
00065                     break;
00066             }
00067         }
00068
00069         private void InertiaSwitch_Toggled(object sender, RoutedEventArgs e)
00070         {
00071             if (manipulationProcessor == null)
00072             {
00073                 return;
00074             }
00075
00076             manipulationProcessor.UseInertia(InertiaSwitch.IsOn);
00077         }
00078
00079         void resetButton_Pressed(object sender, RoutedEventArgs e)
00080         {
00081             InitOptions();
00082             manipulationProcessor.Reset();
00083         }
00084     }
00085
00086     class ManipulationInputProcessor
00087     {
00088         GestureRecognizer recognizer;
00089         UIElement element;
00090         UIElement reference;
00091         TransformGroup cumulativeTransform;
00092         MatrixTransform previousTransform;
00093         CompositeTransform deltaTransform;
00094
00095         public ManipulationInputProcessor(GestureRecognizer gestureRecognizer, UIElement target, UIElement referenceFrame)
00096         {
00097             recognizer = gestureRecognizer;
00098             element = target;
00099             reference = referenceFrame;
00100
00101             // Initialize the transforms that will be used to manipulate the shape
00102             InitializeTransforms();
00103
00104             // The GestureSettings property dictates what manipulation events the
00105             // Gesture Recognizer will listen to.  This will set it to a limited
00106             // subset of these events.
00107             recognizer.GestureSettings = GenerateDefaultSettings();
00108
00109             // Set up pointer event handlers. These receive input events that are used by the gesture recognizer.
00110             element.PointerPressed += OnPointerPressed;
00111             element.PointerMoved += OnPointerMoved;
00112             element.PointerReleased += OnPointerReleased;
00113             element.PointerCanceled += OnPointerCanceled;
00114
00115             // Set up event handlers to respond to gesture recognizer output
00116             recognizer.ManipulationStarted += OnManipulationStarted;
00117             recognizer.ManipulationUpdated += OnManipulationUpdated;
00118             recognizer.ManipulationCompleted += OnManipulationCompleted;
00119             recognizer.ManipulationInertiaStarting += OnManipulationInertiaStarting;
00120         }
00121
00122         public void InitializeTransforms()
00123         {
00124             cumulativeTransform = new TransformGroup();
00125             deltaTransform = new CompositeTransform();
00126             previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
00127
00128             cumulativeTransform.Children.Add(previousTransform);
00129             cumulativeTransform.Children.Add(deltaTransform);
00130
00131             element.RenderTransform = cumulativeTransform;
00132         }
00133
00134         // Return the default GestureSettings for this sample
00135         GestureSettings GenerateDefaultSettings()
00136         {
00137             return GestureSettings.ManipulationTranslateX |
00138                 GestureSettings.ManipulationTranslateY |
00139                 GestureSettings.ManipulationRotate |
00140                 GestureSettings.ManipulationTranslateInertia |
00141                 GestureSettings.ManipulationRotateInertia;
00142         }
00143
00144         // Route the pointer pressed event to the gesture recognizer.
00145         // The points are in the reference frame of the canvas that contains the rectangle element.
00146         void OnPointerPressed(object sender, PointerRoutedEventArgs args)
00147         {
00148             // Set the pointer capture to the element being interacted with so that only it
00149             // will fire pointer-related events
00150             element.CapturePointer(args.Pointer);
00151
00152             // Feed the current point into the gesture recognizer as a down event
00153             recognizer.ProcessDownEvent(args.GetCurrentPoint(reference));
00154         }
00155
00156         // Route the pointer moved event to the gesture recognizer.
00157         // The points are in the reference frame of the canvas that contains the rectangle element.
00158         void OnPointerMoved(object sender, PointerRoutedEventArgs args)
00159         {
00160             // Feed the set of points into the gesture recognizer as a move event
00161             recognizer.ProcessMoveEvents(args.GetIntermediatePoints(reference));
00162         }
00163
00164         // Route the pointer released event to the gesture recognizer.
00165         // The points are in the reference frame of the canvas that contains the rectangle element.
00166         void OnPointerReleased(object sender, PointerRoutedEventArgs args)
00167         {
00168             // Feed the current point into the gesture recognizer as an up event
00169             recognizer.ProcessUpEvent(args.GetCurrentPoint(reference));
00170
00171             // Release the pointer
00172             element.ReleasePointerCapture(args.Pointer);
00173         }
00174
00175         // Route the pointer canceled event to the gesture recognizer.
00176         // The points are in the reference frame of the canvas that contains the rectangle element.
00177         void OnPointerCanceled(object sender, PointerRoutedEventArgs args)
00178         {
00179             recognizer.CompleteGesture();
00180             element.ReleasePointerCapture(args.Pointer);
00181         }
00182
00183         // When a manipulation begins, change the color of the object to reflect
00184         // that a manipulation is in progress
00185         void OnManipulationStarted(object sender, ManipulationStartedEventArgs e)
00186         {
00187             Border b = element as Border;
00188             b.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
00189         }
00190
00191         // Process the change resulting from a manipulation
00192         void OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e)
00193         {
00194             previousTransform.Matrix = cumulativeTransform.Value;
00195
00196             // Get the center point of the manipulation for rotation
00197             Point center = new Point(e.Position.X, e.Position.Y);
00198             deltaTransform.CenterX = center.X;
00199             deltaTransform.CenterY = center.Y;
00200
00201             // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
00202             // the rotation, X, and Y changes
00203             deltaTransform.Rotation = e.Delta.Rotation;
00204             deltaTransform.TranslateX = e.Delta.Translation.X;
00205             deltaTransform.TranslateY = e.Delta.Translation.Y;
00206         }
00207
00208         // When a manipulation that's a result of inertia begins, change the color of the
00209         // the object to reflect that inertia has taken over
00210         void OnManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
00211         {
00212             Border b = element as Border;
00213             b.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
00214         }
00215
00216         // When a manipulation has finished, reset the color of the object
00217         void OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
00218         {
00219             Border b = element as Border;
00220             b.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
00221         }
00222
00223         // Modify the GestureSettings property to only allow movement on the X axis
00224         public void LockToXAxis()
00225         {
00226             recognizer.CompleteGesture();
00227             recognizer.GestureSettings |= GestureSettings.ManipulationTranslateY | GestureSettings.ManipulationTranslateX;
00228             recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateY;
00229         }
00230
00231         // Modify the GestureSettings property to only allow movement on the Y axis
00232         public void LockToYAxis()
00233         {
00234             recognizer.CompleteGesture();
00235             recognizer.GestureSettings |= GestureSettings.ManipulationTranslateY | GestureSettings.ManipulationTranslateX;
00236             recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateX;
00237         }
00238
00239         // Modify the GestureSettings property to allow movement on both the the X and Y axes
00240         public void MoveOnXAndYAxes()
00241         {
00242             recognizer.CompleteGesture();
00243             recognizer.GestureSettings |= GestureSettings.ManipulationTranslateX | GestureSettings.ManipulationTranslateY;
00244         }
00245
00246         // Modify the GestureSettings property to enable or disable inertia based on the passed-in value
00247         public void UseInertia(bool inertia)
00248         {
00249             if (!inertia)
00250             {
00251                 recognizer.CompleteGesture();
00252                 recognizer.GestureSettings ^= GestureSettings.ManipulationTranslateInertia | GestureSettings.ManipulationRotateInertia;
00253             }
00254             else
00255             {
00256                 recognizer.GestureSettings |= GestureSettings.ManipulationTranslateInertia | GestureSettings.ManipulationRotateInertia;
00257             }
00258         }
00259
00260         public void Reset()
00261         {
00262             element.RenderTransform = null;
00263             recognizer.CompleteGesture();
00264             InitializeTransforms();
00265             recognizer.GestureSettings = GenerateDefaultSettings();
00266         }
00267     }
00268 }
Generated on Fri Nov 15 2024 22:18:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario3_Events.xaml.cpp Source File

  • XamlCommanding
  • cpp

Scenario3_Events.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_Events.xaml.h"
00014 #include "MainPage.xaml.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00030
00031 Scenario3_Events::Scenario3_Events()
00032 {
00033     InitializeComponent();
00034
00035     MainPage::Current->NotifyUser("CommandBar: Background Opacity at 50%", NotifyType::StatusMessage);
00036 }
00037
00038
00039 void Scenario3_Events::CommandBar_Opening(Platform::Object^ sender, Platform::Object^ e)
00040 {
00041     translucentBackgroundBrush->Opacity = 1.0;
00042     MainPage::Current->NotifyUser("CommandBar: OPENING.  Setting Background Opacity to 100%", NotifyType::ErrorMessage);
00043 }
00044
00045
00046 void Scenario3_Events::CommandBar_Closing(Platform::Object^ sender, Platform::Object^ e)
00047 {
00048     MainPage::Current->NotifyUser("CommandBar: CLOSING", NotifyType::ErrorMessage);
00049 }
00050
00051
00052 void Scenario3_Events::CommandBar_Opened(Platform::Object^ sender, Platform::Object^ e)
00053 {
00054     MainPage::Current->NotifyUser("CommandBar: OPENED", NotifyType::StatusMessage);
00055 }
00056
00057
00058 void Scenario3_Events::CommandBar_Closed(Platform::Object^ sender, Platform::Object^ e)
00059 {
00060     translucentBackgroundBrush->Opacity = 0.5;
00061     MainPage::Current->NotifyUser("CommandBar: CLOSED.  Setting Background Opacity to 50%", NotifyType::StatusMessage);
00062 }
Generated on Fri Nov 15 2024 22:22:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_GetSingleDevice Member List

This is the complete list of members for Scenario5_GetSingleDevice, including all inherited members.
deviceInformationKind | Scenario5_GetSingleDevice | [private]
GetButton_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario5_GetSingleDevice |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario5_GetSingleDevice |
Page_Loaded(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario5_GetSingleDevice |
resultCollection | Scenario5_GetSingleDevice | [private]
Scenario5_GetSingleDevice() | Scenario5_GetSingleDevice |
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/RpcServer.h Source File

  • CustomCapability
  • Service
  • Server

RpcServer.h

Go to the documentation of this file.
00001 #include "metering.h"
00002
00003 #define RPC_STATIC_ENDPOINT L"HsaSampleRpcEndpoint"
00004
00005 // Client context used for making rpc calls using context handle
00006 // https://msdn.microsoft.com/en-us/library/windows/desktop/aa378674(v=vs.85).aspx
00007 typedef struct
00008 {
00009     RpcServer::Metering* metering;
00010 } METERING_CONTEXT;
00011
00012 // Create a rpc server endpoint and listen to incoming rpc calls
00013 DWORD RpcServerStart();
00014
00015 // Signal the rpc server to stop listening to incoming rpc calls
00016 void RpcServerDisconnect();
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document2.xaml.h Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_Document2.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include "Scenario_Document2.g.h"
00014
00015 namespace SDKTemplate
00016 {
00017     [Windows::Foundation::Metadata::WebHostHidden]
00018     public ref class Scenario_Document2 sealed
00019     {
00020     public:
00021         Scenario_Document2();
00022     private:
00023         void Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024     };
00025 }
Generated on Fri Nov 15 2024 22:19:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Properties/AssemblyInfo.cs Source File

  • XamlBind
  • cs
  • xBindSampleModel
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BindTestbedModel")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BindTestbedModel")]
00013 [assembly: AssemblyCopyright("Copyright ©  2014")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceServiceEventAdapter.cpp Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceServiceEventAdapter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace Microsoft::WRL;
00024 using namespace Platform;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Foundation::Collections;
00027 using namespace Windows::Devices::AllJoyn;
00028 using namespace com::microsoft::Samples::SecureInterface;
00029
00030 // Note: Unlike an Interface implementation, which provides a single handler for each member, the event
00031 // model allows for 0 or more listeners to be registered. The EventAdapter implementation deals with this
00032 // difference by implementing a last-writer-wins policy. The lack of any return value (i.e., 0 listeners)
00033 // is handled by returning a null result.
00034
00035 // Methods
00036 IAsyncOperation<SecureInterfaceConcatenateResult^>^ SecureInterfaceServiceEventAdapter::ConcatenateAsync(_In_ AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2)
00037 {
00038     auto args = ref new SecureInterfaceConcatenateCalledEventArgs(info, interfaceMemberInStr1, interfaceMemberInStr2);
00039     ConcatenateCalled(this, args);
00040     return SecureInterfaceConcatenateCalledEventArgs::GetResultAsync(args);
00041 }
00042
00043 // Property Reads
00044 IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ SecureInterfaceServiceEventAdapter::GetIsUpperCaseEnabledAsync(_In_ AllJoynMessageInfo^ info)
00045 {
00046     auto args = ref new SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs(info);
00047     GetIsUpperCaseEnabledRequested(this, args);
00048     return SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs::GetResultAsync(args);
00049 }
00050
00051 // Property Writes
00052 IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ SecureInterfaceServiceEventAdapter::SetIsUpperCaseEnabledAsync(_In_ AllJoynMessageInfo^ info, _In_ bool value)
00053 {
00054     auto args = ref new SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs(info, value);
00055     SetIsUpperCaseEnabledRequested(this, args);
00056     return SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs::GetResultAsync(args);
00057 }
00058
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario2.xaml.cpp Source File

  • Projection
  • cpp

Scenario2.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.xaml.h"
00014 #include "MainPage.xaml.h"
00015 #include "ProjectionViewPage.xaml.h"
00016 #include "ViewLifetimeControl.h"
00017
00018 using namespace SDKSample;
00019
00020 using namespace Concurrency;
00021 using namespace Platform;
00022 using namespace SDKSample::SecondaryViewsHelpers;
00023 using namespace Windows::ApplicationModel::Core;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::ViewManagement;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Interop;
00029
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 Scenario2::Scenario2()
00034 {
00035     InitializeComponent();
00036     thisViewId = ApplicationView::GetForCurrentView()->Id;
00037 }
00038
00039 void Scenario2::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00040 {
00041     // An app can query if a second display is available...
00042     UpdateTextBlock(ProjectionManager::ProjectionDisplayAvailable);
00043     // ...or listen for when a display is attached or detached
00044     displayChangeToken = ProjectionManager::ProjectionDisplayAvailableChanged += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2::OnProjectionDisplayAvailableChanged);
00045     dispatcher = Window::Current->Dispatcher;
00046 }
00047
00048 void Scenario2::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00049 {
00050     ProjectionManager::ProjectionDisplayAvailableChanged -= displayChangeToken;
00051 }
00052
00053 void Scenario2::OnProjectionDisplayAvailableChanged(Object^ sender, Object^ e)
00054 {
00055     dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]() {
00056         UpdateTextBlock(ProjectionManager::ProjectionDisplayAvailable);
00057     }));
00058 }
00059
00060 void Scenario2::UpdateTextBlock(bool screenAvailable)
00061 {
00062     if (screenAvailable)
00063     {
00064         displayAvailableStatus->Text = "Display is available";
00065         startprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Visible;
00066         requestandstartprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00067     }
00068     else
00069     {
00070         displayAvailableStatus->Text = "Display is not available, select one:";
00071         startprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00072         requestandstartprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Visible;
00073     }
00074 }
00075
00076 void Scenario2::StartProjecting_Click(Object^ sender, RoutedEventArgs^ e)
00077 {
00078     auto prerequisite = task<void>([]() {});
00079     // If projection is already in progress, then it could be shown on the monitor again
00080     // Otherwise, we need to create a new view to show the presentation
00081     if (MainPage::Current->ProjectionViewPageControl == nullptr)
00082     {
00083         // First, create a new, blank view
00084         auto mainDispatcher = Window::Current->Dispatcher;
00085         int mainViewId = thisViewId;
00086         prerequisite = create_task(CoreApplication::CreateNewView()->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([mainViewId, mainDispatcher]()
00087         {
00088             // ViewLifetimeControl is a wrapper to make sure the view is closed only
00089             // when the app is done with it
00090             MainPage::Current->ProjectionViewPageControl = ViewLifetimeControl::CreateForCurrentView();
00091
00092             // Assemble some data necessary for the new page
00093             auto initData = ref new ProjectionViewPageInitializationData();
00094             initData->MainDispatcher = mainDispatcher;
00095             initData->ProjectionViewPageControl = MainPage::Current->ProjectionViewPageControl;
00096             initData->MainViewId = mainViewId;
00097
00098             // Display the page in the view. Note that the view will not become visible
00099             // until "StartProjectingAsync" is called
00100             auto rootFrame = ref new Windows::UI::Xaml::Controls::Frame();
00101             rootFrame->Navigate(TypeName(ProjectionViewPage::typeid), initData);
00102             Window::Current->Content = rootFrame;
00103
00104             // The call to Window.Current.Activate is required starting in Windos 10.
00105             // Without it, the view will never appear.
00106             Window::Current->Activate();
00107         })));
00108     }
00109
00110     prerequisite.then([this]()
00111     {
00112         try
00113         {
00114             // Start/StopViewInUse are used to signal that the app is interacting with the
00115             // view, so it shouldn't be closed yet, even if the user loses access to it
00116             MainPage::Current->ProjectionViewPageControl->StartViewInUse();
00117             // Show the view on a second display (if available) or on the primary display
00118             create_task(ProjectionManager::StartProjectingAsync(
00119                 MainPage::Current->ProjectionViewPageControl->Id,
00120                 thisViewId
00121                 )).then([]() {
00122                 MainPage::Current->ProjectionViewPageControl->StopViewInUse();
00123             });
00124         }
00125         catch (ObjectDisposedException^)
00126         {
00127             // The projection view is being disposed
00128             MainPage::Current->NotifyUser("The projection view is being disposed", NotifyType::ErrorMessage);
00129         }
00130     }, task_continuation_context::use_arbitrary());
00131 }
00132
00133 void Scenario2::RequestAndStartProjecting_Click(Object^ sender, RoutedEventArgs^ e)
00134 {
00135     auto prerequisite = task<void>([]() {});
00136     // If projection is already in progress, then it could be shown on the monitor again
00137     // Otherwise, we need to create a new view to show the presentation
00138     if (MainPage::Current->ProjectionViewPageControl == nullptr)
00139     {
00140         // First, create a new, blank view
00141         auto mainDispatcher = Window::Current->Dispatcher;
00142         int mainViewId = thisViewId;
00143         prerequisite = create_task(CoreApplication::CreateNewView()->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([mainViewId, mainDispatcher]()
00144         {
00145             // ViewLifetimeControl is a wrapper to make sure the view is closed only
00146             // when the app is done with it
00147             MainPage::Current->ProjectionViewPageControl = ViewLifetimeControl::CreateForCurrentView();
00148
00149             // Assemble some data necessary for the new page
00150             auto initData = ref new ProjectionViewPageInitializationData();
00151             initData->MainDispatcher = mainDispatcher;
00152             initData->ProjectionViewPageControl = MainPage::Current->ProjectionViewPageControl;
00153             initData->MainViewId = mainViewId;
00154
00155             // Display the page in the view. Note that the view will not become visible
00156             // until "StartProjectingAsync" is called
00157             auto rootFrame = ref new Windows::UI::Xaml::Controls::Frame();
00158             rootFrame->Navigate(TypeName(ProjectionViewPage::typeid), initData);
00159             Window::Current->Content = rootFrame;
00160             Window::Current->Activate();
00161         })));
00162     }
00163
00164     prerequisite.then([this]()
00165     {
00166         try
00167         {
00168             // Start/StopViewInUse are used to signal that the app is interacting with the
00169             // view, so it shouldn't be closed yet, even if the user loses access to it
00170             MainPage::Current->ProjectionViewPageControl->StartViewInUse();
00171
00172             // Show the view on a second display (if available) or on the primary display
00173             Windows::Foundation::Rect pickerLocation = { 470.0, 0.0, 200.0, 300.0 };
00174
00175             // Show the view on a second display (if available) or on the primary display
00176             create_task(ProjectionManager::RequestStartProjectingAsync(
00177                 MainPage::Current->ProjectionViewPageControl->Id,
00178                 thisViewId, pickerLocation,Windows::UI::Popups::Placement::Above
00179                 )).then([](bool result) {
00180                 MainPage::Current->ProjectionViewPageControl->StopViewInUse();
00181             });
00182         }
00183         catch (ObjectDisposedException^)
00184         {
00185             // The projection view is being disposed
00186             MainPage::Current->NotifyUser("The projection view is being disposed", NotifyType::ErrorMessage);
00187         }
00188     }, task_continuation_context::use_arbitrary());
00189 }
00190
Generated on Fri Nov 15 2024 22:17:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario4.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario4.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario4.xaml.h"
00013 #include "RecognizerHelper.h"
00014
00015 #include <ppltasks.h>
00016
00017 using namespace SDKTemplate;
00018
00019 using namespace concurrency;
00020 using namespace Platform;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Globalization;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Input::Inking;
00026 using namespace Windows::UI::Text::Core;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Controls::Primitives;
00030 using namespace Windows::UI::Xaml::Data;
00031 using namespace Windows::UI::Xaml::Input;
00032 using namespace Windows::UI::Xaml::Media;
00033 using namespace Windows::UI::Xaml::Navigation;
00034
00035 Scenario4::Scenario4()
00036 {
00037     InitializeComponent();
00038
00039     // Initialize drawing attributes. These are used in inking mode.
00040     InkDrawingAttributes^ drawingAttributes = ref new InkDrawingAttributes();
00041     drawingAttributes->Color = Windows::UI::Colors::Red;
00042     float penSize = 4.0f;
00043     drawingAttributes->Size = Size(penSize, penSize);
00044     drawingAttributes->IgnorePressure = false;
00045     drawingAttributes->FitToCurve = true;
00046
00047     // Show the available recognizers
00048     inkRecognizerContainer = ref new InkRecognizerContainer();
00049     recoView = inkRecognizerContainer->GetRecognizers();
00050     if (recoView->Size > 0)
00051     {
00052         for (InkRecognizer^ recognizer : recoView)
00053         {
00054             RecoName->Items->Append(recognizer->Name);
00055         }
00056     }
00057     else
00058     {
00059         RecoName->IsEnabled = false;
00060         RecoName->Items->Append("No Recognizer Available");
00061     }
00062     RecoName->SelectedIndex = 0;
00063
00064     // Set the text services so we can query when language changes
00065     textServiceManager = CoreTextServicesManager::GetForCurrentView();
00066     languageChangedToken = textServiceManager->InputLanguageChanged += ref new TypedEventHandler<CoreTextServicesManager^, Object^>(this, &Scenario4::TextServiceManager_InputLanguageChanged);
00067
00068     SetDefaultRecognizerByCurrentInputMethodLanguageTag();
00069
00070     // Initialize the InkCanvas
00071     inkCanvas->InkPresenter->UpdateDefaultDrawingAttributes(drawingAttributes);
00072     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00073 }
00074
00075 void Scenario4::OnNavigatedFrom(NavigationEventArgs^ e)
00076 {
00077     InstallReco->IsOpen = false;
00078     textServiceManager->InputLanguageChanged -= languageChangedToken;
00079 }
00080
00081 void Scenario4::OnSizeChanged(Object^ sender, SizeChangedEventArgs e)
00082 {
00083     HelperFunctions::UpdateCanvasSize(RootGrid, Output, inkCanvas);
00084 }
00085
00086 void Scenario4::OnRecognizeAsync(Object^ sender, RoutedEventArgs^ e)
00087 {
00088     auto currentStrokes = inkCanvas->InkPresenter->StrokeContainer->GetStrokes();
00089     if (currentStrokes->Size > 0)
00090     {
00091         RecognizeBtn->IsEnabled = false;
00092         ClearBtn->IsEnabled = false;
00093         RecoName->IsEnabled = false;
00094
00095         create_task(inkRecognizerContainer->RecognizeAsync(inkCanvas->InkPresenter->StrokeContainer, InkRecognitionTarget::All))
00096             .then([this](IVectorView<InkRecognitionResult^>^ recognitionResults)
00097         {
00098             if (recognitionResults->Size > 0)
00099             {
00100                 // Display recognition result
00101                 String^ str = "Recognition result:";
00102                 for (InkRecognitionResult^ r : recognitionResults)
00103                 {
00104                     str += " " + r->GetTextCandidates()->GetAt(0);
00105                 }
00106                 rootPage->NotifyUser(str, NotifyType::StatusMessage);
00107             }
00108             else
00109             {
00110                 rootPage->NotifyUser("No text recognized.", NotifyType::StatusMessage);
00111             }
00112
00113             RecognizeBtn->IsEnabled = true;
00114             ClearBtn->IsEnabled = true;
00115             RecoName->IsEnabled = true;
00116         });
00117     }
00118     else
00119     {
00120         rootPage->NotifyUser("Must first write something.", NotifyType::ErrorMessage);
00121     }
00122 }
00123
00124 void Scenario4::OnRecognizerChanged(Object^ sender, RoutedEventArgs^ e)
00125 {
00126     String^ selectedValue = (String^)RecoName->SelectedValue;
00127     SetRecognizerByName(selectedValue);
00128 }
00129
00130 void Scenario4::OnClear(Object^ sender, RoutedEventArgs^ e)
00131 {
00132     inkCanvas->InkPresenter->StrokeContainer->Clear();
00133     rootPage->NotifyUser("Cleared Canvas.", NotifyType::StatusMessage);
00134 }
00135
00136 bool Scenario4::SetRecognizerByName(String^ recognizerName)
00137 {
00138     bool recognizerFound = false;
00139
00140     for (InkRecognizer^ reco : recoView)
00141     {
00142         if (recognizerName == reco->Name)
00143         {
00144             inkRecognizerContainer->SetDefaultRecognizer(reco);
00145             recognizerFound = true;
00146             break;
00147         }
00148     }
00149
00150     if (!recognizerFound && rootPage != nullptr)
00151     {
00152         rootPage->NotifyUser("Could not find target recognizer.", NotifyType::ErrorMessage);
00153     }
00154
00155     return recognizerFound;
00156 }
00157
00158 void Scenario4::TextServiceManager_InputLanguageChanged(CoreTextServicesManager^ sender, Object^ args)
00159 {
00160     SetDefaultRecognizerByCurrentInputMethodLanguageTag();
00161 }
00162
00163
00164 void Scenario4::SetDefaultRecognizerByCurrentInputMethodLanguageTag()
00165 {
00166     // Query recognizer name based on current input method language tag (bcp47 tag)
00167     auto currentInputLanguage = textServiceManager->InputLanguage;
00168
00169     if (currentInputLanguage != previousInputLanguage)
00170     {
00171         // try query with the full BCP47 name
00172         String^ recognizerName = RecognizerHelper::LanguageTagToRecognizerName(currentInputLanguage->LanguageTag);
00173
00174         if (!recognizerName->IsEmpty())
00175         {
00176             for (unsigned int index = 0; index < recoView->Size; index++)
00177             {
00178                 InkRecognizer^ recognizer = recoView->GetAt(index);
00179                 if (recognizer->Name == recognizerName)
00180                 {
00181                     inkRecognizerContainer->SetDefaultRecognizer(recognizer);
00182                     RecoName->SelectedIndex = index;
00183                     previousInputLanguage = currentInputLanguage;
00184                     break;
00185                 }
00186             }
00187         }
00188     }
00189 }
00190
00191 void Scenario4::RecoButton_Click(Object^ sender, RoutedEventArgs^ e)
00192 {
00193     InstallReco->IsOpen = !InstallReco->IsOpen;
00194 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ApiInformation Member List

This is the complete list of members for ApiInformation, including all inherited members.
IsTypePresent(string typeName) ApiInformation [inline, static]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_MasterDetail Member List

This is the complete list of members for Scenario3_MasterDetail, including all inherited members.
AddItem(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
CancelSelection(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
Contacts | Scenario3_MasterDetail | [private]
DeleteItem(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
DeleteItems(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
EnableContentTransitions() | Scenario3_MasterDetail | [private]
OnCurrentStateChanged(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::VisualStateChangedEventArgs const &) | Scenario3_MasterDetail |
OnItemClick(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::ItemClickEventArgs const &e) | Scenario3_MasterDetail |
OnLoaded(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3_MasterDetail |
OnSelectionChanged(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &) | Scenario3_MasterDetail |
Scenario3_MasterDetail() | Scenario3_MasterDetail |
SelectItems(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_MasterDetail |
SelectSomethingIfPossible() | Scenario3_MasterDetail | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/SampleConfiguration.cs Source File

  • ProximitySensor
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using ProximityCS;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Proximity sensor";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title = "Data Events", ClassType = typeof(ProximityCS.Scenario1_DataEvents) },
00026             new Scenario() { Title = "Polling", ClassType = typeof(ProximityCS.Scenario2_Polling) },
00027             new Scenario() { Title = "Display On/Off", ClassType = typeof(ProximityCS.Scenario3_DisplayOnOff) },
00028             new Scenario() { Title = "Background Proximity Sensor", ClassType = typeof(ProximityCS.Scenario4_BackgroundProximitySensor) }
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cs/Scenario2_Display.xaml.cs Source File

  • Playlists
  • cs

Scenario2_Display.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Media.Playlists;
00015 using Windows.Storage;
00016 using Windows.Storage.FileProperties;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario2_Display : Page
00024     {
00025         private MainPage rootPage = MainPage.Current;
00026
00027         public Scenario2_Display()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         /// <summary>
00033         /// Displays the playlist picked by the user in the FilePicker
00034         /// </summary>
00035         /// <param name="sender"></param>
00036         /// <param name="e"></param>
00037         async private void PickPlaylistButton_Click(object sender, RoutedEventArgs e)
00038         {
00039             this.rootPage.NotifyUser("", NotifyType.StatusMessage);
00040             Playlist playlist = await this.rootPage.PickPlaylistAsync();
00041
00042             if (playlist != null)
00043             {
00044                 string result = "Songs in playlist: " + playlist.Files.Count.ToString() + "\n";
00045
00046                 foreach (StorageFile file in playlist.Files)
00047                 {
00048                     MusicProperties properties = await file.Properties.GetMusicPropertiesAsync();
00049                     result += "\n";
00050                     result += "File: " + file.Path + "\n";
00051                     result += "Title: " + properties.Title + "\n";
00052                     result += "Album: " + properties.Album + "\n";
00053                     result += "Artist: " + properties.Artist + "\n";
00054                 }
00055
00056                 this.OutputStatus.Text = result;
00057             }
00058         }
00059     }
00060 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario3_Choosing.xaml.cs Source File

  • PresenceSensor
  • cs

Scenario3_Choosing.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.Enumeration;
00015 using Windows.Devices.Sensors;
00016 using Windows.Foundation;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Input;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace SDKTemplate
00025 {
00026     public sealed partial class Scenario3_Choosing : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031
00032         private DeviceWatcher watcher = null;
00033
00034         public Scenario3_Choosing()
00035         {
00036             InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             if (watcher != null)
00042             {
00043                 watcher.Stop();
00044             }
00045         }
00046
00047         private async void ScenarioPick_Click(object sender, RoutedEventArgs e)
00048         {
00049             DevicePicker picker = new DevicePicker();
00050             picker.Appearance.Title = "Select a presence sensor from which to read data";
00051             picker.Filter.SupportedDeviceSelectors.Add(HumanPresenceSensor.GetDeviceSelector());
00052
00053             // Calculate the position of the button next to which we will place the picker.
00054             GeneralTransform transform = ScenarioPickButton.TransformToVisual(null);
00055             Rect rect = transform.TransformBounds(new Rect(0.0, 0.0, ScenarioPickButton.ActualWidth, ScenarioPickButton.ActualHeight));
00056
00057             DeviceInformation deviceInfo = await picker.PickSingleDeviceAsync(rect);
00058             if (deviceInfo != null)
00059             {
00060                 await ReadOneReadingFromSensorAsync(deviceInfo);
00061             }
00062         }
00063
00064         /// <summary>
00065         /// Invoked when the device watcher finds a presence sensor
00066         /// </summary>
00067         /// <param name="sender">The device watcher</param>
00068         /// <param name="device">Device information for the presence sensor that was found</param>
00069         private async void OnHumanPresenceSensorAdded(DeviceWatcher sender, DeviceInformation deviceInfo)
00070         {
00071             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00072             {
00073                 // The app can optionally ignore sensors which do not satisfy desired criteria.
00074                 // This sample does not apply any filter. See the DeviceEnumerationAndPairing sample
00075                 // for more advanced ways of presenting a list of devices.
00076
00077                 ListBoxItem item = new ListBoxItem() { Content = deviceInfo.Name, Tag = deviceInfo };
00078                 SensorsList.Items.Add(item);
00079             });
00080         }
00081
00082         /// <summary>
00083         /// Invoked when a presence sensor is removed from the system
00084         /// </summary>
00085         /// <param name="sender">The device watcher</param>
00086         /// <param name="device">Device information for the presence sensor that was removed</param>
00087         private async void OnHumanPresenceSensorRemoved(DeviceWatcher sender, DeviceInformationUpdate update)
00088         {
00089             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00090             {
00091                 // Look for the sensor that was removed from the system and erase it from the ListBox.
00092                 string removedId = update.Id;
00093
00094                 foreach (ListBoxItem item in SensorsList.Items)
00095                 {
00096                     DeviceInformation itemDeviceInfo = (DeviceInformation)item.Tag;
00097                     if (itemDeviceInfo.Id == removedId)
00098                     {
00099                         SensorsList.Items.Remove(item);
00100                         break;
00101                     }
00102                 }
00103             });
00104         }
00105
00106         /// <summary>
00107         /// Invoked when a presence sensor's properties change
00108         /// </summary>
00109         /// <param name="sender">The device watcher</param>
00110         /// <param name="device">Device information for the presence sensor that changed</param>
00111         private async void OnHumanPresenceSensorUpdated(DeviceWatcher sender, DeviceInformationUpdate update)
00112         {
00113             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00114             {
00115                 // Look for the sensor that was updated.
00116                 string updatedId = update.Id;
00117
00118                 foreach (ListBoxItem item in SensorsList.Items)
00119                 {
00120                     DeviceInformation itemDeviceInfo = (DeviceInformation)item.Tag;
00121                     if (itemDeviceInfo.Id == updatedId)
00122                     {
00123                         // Update the DeviceInformation for the sensor that updated.
00124                         itemDeviceInfo.Update(update);
00125                         // Refresh the device name, in case it changed.
00126                         item.Content = itemDeviceInfo.Name;
00127                         break;
00128                     }
00129                 }
00130             });
00131         }
00132
00133         private async void OnHumanPresenceSensorEnumerationCompleted(DeviceWatcher sender, object e)
00134         {
00135             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00136             {
00137                 rootPage.NotifyUser("All sensors found. Monitoring for changes...", NotifyType.StatusMessage);
00138             });
00139         }
00140
00141         private void ScenarioStart_Click(object sender, RoutedEventArgs e)
00142         {
00143             SensorsList.Items.Clear();
00144
00145             watcher = DeviceInformation.CreateWatcher(HumanPresenceSensor.GetDeviceSelector());
00146             watcher.Added += OnHumanPresenceSensorAdded;
00147             watcher.Removed += OnHumanPresenceSensorRemoved;
00148             watcher.Updated += OnHumanPresenceSensorUpdated;
00149             watcher.EnumerationCompleted += OnHumanPresenceSensorEnumerationCompleted;
00150             watcher.Start();
00151
00152             rootPage.NotifyUser("Looking for sensors...", NotifyType.StatusMessage);
00153
00154             ScenarioStartButton.IsEnabled = false;
00155             ScenarioStopButton.IsEnabled = true;
00156         }
00157
00158         private void ScenarioStop_Click(object sender, RoutedEventArgs e)
00159         {
00160             watcher.Stop();
00161             watcher = null;
00162
00163             rootPage.NotifyUser("", NotifyType.StatusMessage);
00164
00165             ScenarioStartButton.IsEnabled = true;
00166             ScenarioStopButton.IsEnabled = false;
00167         }
00168
00169         private async void ScenarioReadSelected_Click(object sender, RoutedEventArgs e)
00170         {
00171             rootPage.NotifyUser("", NotifyType.StatusMessage);
00172
00173             ListBoxItem item = (ListBoxItem)SensorsList.SelectedItem;
00174             if (item == null)
00175             {
00176                 rootPage.NotifyUser("No sensor is selected.", NotifyType.ErrorMessage);
00177                 return;
00178             }
00179
00180             DeviceInformation selectedInfo = (DeviceInformation)item.Tag;
00181             await ReadOneReadingFromSensorAsync(selectedInfo);
00182         }
00183
00184         // Obtains a sensor described by the DeviceInformation and reads one reading from it.
00185         private async Task ReadOneReadingFromSensorAsync(DeviceInformation deviceInfo)
00186         {
00187             HumanPresenceSensor sensor;
00188             try
00189             {
00190                 sensor = await HumanPresenceSensor.FromIdAsync(deviceInfo.Id);
00191             }
00192             catch (UnauthorizedAccessException)
00193             {
00194                 // The user denied this app presence sensor access.
00195                 sensor = null;
00196             }
00197
00198             EngagementStateTextBlock.Text = "No data";
00199             DetectionStateTextBlock.Text = "No data";
00200             TimestampTextBlock.Text = "No data";
00201             DetectionDistanceTextBlock.Text = "No data";
00202
00203             if (sensor != null)
00204             {
00205                 HumanPresenceSensorReading reading;
00206                 try
00207                 {
00208                     reading = sensor.GetCurrentReading();
00209                 }
00210                 catch (UnauthorizedAccessException)
00211                 {
00212                     // The user denied this app presence sensor access.
00213                     reading = null;
00214                 }
00215
00216                 if (reading != null)
00217                 {
00218                     if (sensor.IsEngagementSupported)
00219                     {
00220                         EngagementStateTextBlock.Text = reading.Engagement.ToString();
00221                     }
00222                     else
00223                     {
00224                         EngagementStateTextBlock.Text = "Not Supported";
00225                     }
00226
00227                     if (sensor.IsPresenceSupported)
00228                     {
00229                         DetectionStateTextBlock.Text = reading.Presence.ToString();
00230                     }
00231                     else
00232                     {
00233                         DetectionStateTextBlock.Text = "Not Supported";
00234                     }
00235
00236                     // Show the detection distance, if available
00237                     DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();
00238
00239                     TimestampTextBlock.Text = reading.Timestamp.ToString("u");
00240                 }
00241             }
00242             else
00243             {
00244                 rootPage.NotifyUser($"Could not access sensor {deviceInfo.Name}", NotifyType.ErrorMessage);
00245             }
00246         }
00247     }
00248 }
Generated on Fri Nov 15 2024 22:20:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InputOutputReports Member List

This is the complete list of members for InputOutputReports, including all inherited members.
GetBooleanInputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | InputOutputReports | [inline, private]
GetBooleanInputReportAsync(Byte buttonNumber) | InputOutputReports | [inline, private]
GetNumericInputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | InputOutputReports | [inline, private]
GetNumericInputReportAsync() | InputOutputReports | [inline, private]
InputOutputReports() | InputOutputReports | [inline]
OnNavigatedTo(NavigationEventArgs eventArgs) | InputOutputReports | [inline, protected]
rootPage | InputOutputReports | [private]
SendBooleanOutputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | InputOutputReports | [inline, private]
SendBooleanOutputReportAsync(Boolean bitValue, Byte buttonNumber) | InputOutputReports | [inline, private]
SendNumericOutputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | InputOutputReports | [inline, private]
SendNumericOutputReportAsync(Byte valueToWrite) | InputOutputReports | [inline, private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HolographicApp1Main Member List

This is the complete list of members for HolographicApp1Main, including all inherited members.
attachreferenceFrame | HolographicApp1Main | [private]
CreateVideoShaders() | HolographicApp1Main | [inline]
deviceResources | HolographicApp1Main | [private]
Dispose() | HolographicApp1Main | [inline]
HolographicApp1Main(DeviceResources deviceResources) | HolographicApp1Main | [inline]
holographicSpace | HolographicApp1Main | [private]
LoadAppState() | HolographicApp1Main | [inline]
locator | HolographicApp1Main | [private]
OnCameraAdded(HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args) | HolographicApp1Main | [inline]
OnCameraRemoved(HolographicSpace sender, HolographicSpaceCameraRemovedEventArgs args) | HolographicApp1Main | [inline]
OnDeviceLost(Object sender, EventArgs e) | HolographicApp1Main | [inline]
OnDeviceRestored(Object sender, EventArgs e) | HolographicApp1Main | [inline]
OnLocatabilityChanged(SpatialLocator sender, Object args) | HolographicApp1Main | [inline, private]
referenceFrame | HolographicApp1Main | [private]
Render(ref HolographicFrame holographicFrame) | HolographicApp1Main | [inline]
SaveAppState() | HolographicApp1Main | [inline]
SetHolographicSpace(HolographicSpace holographicSpace) | HolographicApp1Main | [inline]
timer | HolographicApp1Main | [private]
Update() | HolographicApp1Main | [inline]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/WebApiConfig.cs Source File

  • MicrosoftPassport
  • Server
  • App_Start

WebApiConfig.cs

Go to the documentation of this file.
00001 ﻿using System.Web.Http;
00002
00003 namespace MicrosoftPassport.Server
00004 {
00005     public static class WebApiConfig
00006     {
00007         public static void Register(HttpConfiguration config)
00008         {
00009             // Web API configuration and services
00010
00011             // Web API routes
00012             config.MapHttpAttributeRoutes();
00013
00014             config.Routes.MapHttpRoute(
00015                 name: "DefaultApi",
00016                 routeTemplate: "api/{controller}/{action}"
00017             );
00018         }
00019     }
00020 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_UnpinTile Member List

This is the complete list of members for Scenario2_UnpinTile, including all inherited members.
Scenario2_UnpinTile() | Scenario2_UnpinTile
UnpinSecondaryTile_Click(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_UnpinTile
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario1_DataEvents.xaml.cs Source File

  • Gyrometer
  • cs

Scenario1_DataEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.Sensors;
00018 using Windows.Foundation;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Core;
00021
00022 namespace GyrometerCS
00023 {
00024     public sealed partial class Scenario1_DataEvents : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private Gyrometer _gyrometer;
00031         private uint _desiredReportInterval;
00032
00033         public Scenario1_DataEvents()
00034         {
00035             this.InitializeComponent();
00036
00037             _gyrometer = Gyrometer.GetDefault();
00038             if (_gyrometer != null)
00039             {
00040                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00041                 // This value will be used later to activate the sensor.
00042                 uint minReportInterval = _gyrometer.MinimumReportInterval;
00043                 _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00044             }
00045             else
00046             {
00047                 rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
00048             }
00049         }
00050
00051         /// <summary>
00052         /// Invoked when this page is about to be displayed in a Frame.
00053         /// </summary>
00054         /// <param name="e">Event data that describes how this page was reached. The Parameter
00055         /// property is typically used to configure the page.</param>
00056         protected override void OnNavigatedTo(NavigationEventArgs e)
00057         {
00058             ScenarioEnableButton.IsEnabled = true;
00059             ScenarioDisableButton.IsEnabled = false;
00060         }
00061
00062         /// <summary>
00063         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00064         /// </summary>
00065         /// <param name="e">
00066         /// Event data that can be examined by overriding code. The event data is representative
00067         /// of the navigation that will unload the current Page unless canceled. The
00068         /// navigation can potentially be canceled by setting Cancel.
00069         /// </param>
00070         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00071         {
00072             if (ScenarioDisableButton.IsEnabled)
00073             {
00074                 Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00075                 _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
00076
00077                 // Restore the default report interval to release resources while the sensor is not in use
00078                 _gyrometer.ReportInterval = 0;
00079             }
00080
00081             base.OnNavigatingFrom(e);
00082         }
00083
00084         /// <summary>
00085         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00086         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00087         /// </summary>
00088         /// <param name="sender"></param>
00089         /// <param name="e">
00090         /// Event data that can be examined for the current visibility state.
00091         /// </param>
00092         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00093         {
00094             if (ScenarioDisableButton.IsEnabled)
00095             {
00096                 if (e.Visible)
00097                 {
00098                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00099                     _gyrometer.ReadingChanged += new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
00100                 }
00101                 else
00102                 {
00103                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00104                     _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
00105                 }
00106             }
00107         }
00108
00109         /// <summary>
00110         /// This is the event handler for ReadingChanged events.
00111         /// </summary>
00112         /// <param name="sender"></param>
00113         /// <param name="e"></param>
00114         async private void ReadingChanged(object sender, GyrometerReadingChangedEventArgs e)
00115         {
00116             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00117             {
00118                 GyrometerReading reading = e.Reading;
00119                 ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
00120                 ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
00121                 ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
00122             });
00123         }
00124
00125         /// <summary>
00126         /// This is the click handler for the 'Enable' button.
00127         /// </summary>
00128         /// <param name="sender"></param>
00129         /// <param name="e"></param>
00130         private void ScenarioEnable(object sender, RoutedEventArgs e)
00131         {
00132             if (_gyrometer != null)
00133             {
00134                 // Establish the report interval
00135                 _gyrometer.ReportInterval = _desiredReportInterval;
00136
00137                 Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
00138                 _gyrometer.ReadingChanged += new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
00139
00140                 ScenarioEnableButton.IsEnabled = false;
00141                 ScenarioDisableButton.IsEnabled = true;
00142             }
00143             else
00144             {
00145                 rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
00146             }
00147         }
00148
00149         /// <summary>
00150         /// This is the click handler for the 'Disable' button.
00151         /// </summary>
00152         /// <param name="sender"></param>
00153         /// <param name="e"></param>
00154         private void ScenarioDisable(object sender, RoutedEventArgs e)
00155         {
00156             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00157             _gyrometer.ReadingChanged -= new TypedEventHandler<Gyrometer, GyrometerReadingChangedEventArgs>(ReadingChanged);
00158
00159             // Restore the default report interval to release resources while the sensor is not in use
00160             _gyrometer.ReportInterval = 0;
00161
00162             ScenarioEnableButton.IsEnabled = true;
00163             ScenarioDisableButton.IsEnabled = false;
00164         }
00165     }
00166 }
Generated on Fri Nov 15 2024 22:17:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TangentVertex Member List

This is the complete list of members for TangentVertex, including all inherited members.
pos | TangentVertex
tex | TangentVertex
uTan | TangentVertex
vTan | TangentVertex
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsSendAndReceive/SampleConfiguration.cs Source File

  • SmsSendAndReceive
  • cs
  • SmsSendAndReceive

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using SmsSendAndReceive;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "SmsSendAndReceive";
00022
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Send a text message", ClassType=typeof(SendTextMessage)},
00027             new Scenario() { Title="Register with background task", ClassType=typeof(RegisterWithBackgroundTask)}
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InteropStatics::IDirect3DDxgiInterfaceAccess Member List

This is the complete list of members for InteropStatics::IDirect3DDxgiInterfaceAccess, including all inherited members.
GetInterface([In] ref Guid iid) InteropStatics::IDirect3DDxgiInterfaceAccess
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/pch.cpp Source File

  • Barometer
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/School.cs Source File

  • Json
  • cs

School.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Data.Json;
00013
00014 namespace SDKTemplate
00015 {
00016     class School
00017     {
00018         private const string idKey = "id";
00019         private const string schoolKey = "school";
00020         private const string nameKey = "name";
00021         private const string typeKey = "type";
00022
00023         public School()
00024         {
00025         }
00026
00027         public School(JsonObject jsonObject)
00028         {
00029             JsonObject schoolObject = jsonObject.GetNamedObject(schoolKey, null);
00030             if (schoolObject != null)
00031             {
00032                 Id = schoolObject.GetNamedString(idKey, "");
00033                 Name = schoolObject.GetNamedString(nameKey, "");
00034             }
00035             Type = jsonObject.GetNamedString(typeKey);
00036         }
00037
00038         public JsonObject ToJsonObject()
00039         {
00040             // C# provides multiple ways to initialize a JsonObject.
00041             // Here, we use indexed collection initializer syntax.
00042             JsonObject schoolObject = new JsonObject()
00043             {
00044                 [idKey] = JsonValue.CreateStringValue(Id),
00045                 [nameKey] = JsonValue.CreateStringValue(Name),
00046             };
00047
00048             JsonObject jsonObject = new JsonObject();
00049             // Here we use indexer syntax.
00050             jsonObject[schoolKey] = schoolObject;
00051
00052             // Here we use an explicit call to SetNamedValue.
00053             jsonObject.SetNamedValue(typeKey, JsonValue.CreateStringValue(Type));
00054
00055             return jsonObject;
00056         }
00057
00058         public string Id { get; set; } = "";
00059
00060         public string Name { get; set; } = "";
00061
00062         public string Type { get; set; } = "";
00063     }
00064 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_SimpleGridView Member List

This is the complete list of members for Scenario2_SimpleGridView, including all inherited members.
Scenario2_SimpleGridView() Scenario2_SimpleGridView [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/Scenario3.xaml.cs Source File

  • MultipleViews
  • cs

Scenario3.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SecondaryViewsHelpers;
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Core;
00016 using Windows.UI.ViewManagement;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Media.Animation;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario3
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029         Storyboard fadeOutStoryboard = new Storyboard();
00030         DateTime lastFadeOutTime = DateTime.Now;
00031         TaskCompletionSource<bool> animationTask;
00032         const int TIMEOUT_LENGTH = 500;
00033
00034         public Scenario3()
00035         {
00036             this.InitializeComponent();
00037             ViewChooser.ItemsSource = ((App)App.Current).SecondaryViews;
00038
00039             var fadeOut = new FadeOutThemeAnimation();
00040             fadeOutStoryboard.Children.Add(fadeOut);
00041
00042             // Normally you can point directly to an object named in your XAML. Since
00043             // the sample hosts multiple pages, it's convenient for this scenario to
00044             // get the root element
00045             Storyboard.SetTarget(fadeOut, (DependencyObject) ((FrameworkElement)rootPage.Content).FindName("Splitter"));
00046         }
00047
00048         void Fade_Completed(object sender, object e)
00049         {
00050             // This event always fires on the UI thread, along with Current_VisibilityChanged,
00051             // so there is no race condition with the two methods both changing this
00052             // value
00053             if (animationTask != null)
00054             {
00055                 animationTask.TrySetResult(true);
00056             }
00057             animationTask = null;
00058         }
00059
00060         Task<bool> FadeOutContents()
00061         {
00062             if (animationTask != null)
00063             {
00064                 animationTask.TrySetCanceled();
00065             }
00066             animationTask = new TaskCompletionSource<bool>();
00067             fadeOutStoryboard.Begin();
00068             return animationTask.Task;
00069         }
00070
00071         protected override void OnNavigatedTo(NavigationEventArgs e)
00072         {
00073             Window.Current.VisibilityChanged += Current_VisibilityChanged;
00074             fadeOutStoryboard.Completed += Fade_Completed;
00075         }
00076
00077         protected override void OnNavigatedFrom(NavigationEventArgs e)
00078         {
00079             Window.Current.VisibilityChanged -= Current_VisibilityChanged;
00080             fadeOutStoryboard.Completed -= Fade_Completed;
00081         }
00082
00083         void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00084         {
00085             // Timeout the animation if the secondary window fails to respond in 500
00086             // ms. Since this animation clears out the main view of the app, it's not desirable
00087             // to leave it unusable
00088             if (e.Visible || (DateTime.Now - lastFadeOutTime).TotalMilliseconds > TIMEOUT_LENGTH)
00089             {
00090
00091                 // This event always fires on the UI thread, along with Fade_Completed,
00092                 // so there is no race condition with the two methods both changing this
00093                 // value
00094                 if (animationTask != null)
00095                 {
00096                     animationTask.TrySetCanceled();
00097                     animationTask = null;
00098                 }
00099                 fadeOutStoryboard.Stop();
00100             }
00101         }
00102
00103         private async void AnimatedSwitch_Click(object sender, RoutedEventArgs e)
00104         {
00105             // The sample demonstrates a general strategy for doing custom animations when switching view
00106             // It's technically only possible to animate the contents of a particular view. But, it is possible
00107             // to animate the outgoing view to some common visual (like a blank background), have the incoming
00108             // view draw that same visual, switch in the incoming window (which will be imperceptible to the
00109             // user since both windows will be showing the same thing), then animate the contents of the incoming
00110             // view in from the common visual.
00111             var selectedItem = ViewChooser.SelectedItem as ViewLifetimeControl;
00112             if (selectedItem != null)
00113             {
00114                 try
00115                 {
00116                     // Prevent the view from being closed while switching to it
00117                     selectedItem.StartViewInUse();
00118
00119                     // Signal that the window is about to be switched to
00120                     // If the view is already shown to the user, then the app
00121                     // shouldn't run any extra animations
00122                     var currentId = ApplicationView.GetForCurrentView().Id;
00123
00124                     bool isViewVisible;
00125                     try
00126                     {
00127                         isViewVisible = await ApplicationViewSwitcher.PrepareForCustomAnimatedSwitchAsync(
00128                             selectedItem.Id,
00129                             currentId,
00130                             ApplicationViewSwitchingOptions.SkipAnimation);
00131                     }
00132                     catch (NotImplementedException)
00133                     {
00134                         // The device family does not support PrepareForCustomAnimatedSwitchAsync.
00135                         // Fall back to switching with standard animation.
00136                         isViewVisible = true;
00137                         await ApplicationViewSwitcher.SwitchAsync(selectedItem.Id, currentId);
00138                     }
00139
00140                     // The view may already be on screen, in which case there's no need to animate its
00141                     // contents (or animate out the contents of the current window)
00142                     if (!isViewVisible)
00143                     {
00144                         // The view isn't visible, so animate it on screen
00145                         lastFadeOutTime = DateTime.Now;
00146
00147                         // Make the current view totally blank. The incoming view is also
00148                         // going to be totally blank when the two windows switch
00149                         await FadeOutContents();
00150                         // Once the current view is blank, switch in the other window
00151                         await selectedItem.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00152                         {
00153                             var currentPage = (SecondaryViewPage)((Frame)Window.Current.Content).Content;
00154                             // More details are in SecondaryViewPage.xaml.cs
00155                             // This function makes the view totally blank, swaps the two view (which
00156                             // is not apparent to the user since both windows are blank), then animates
00157                             // in the content of newly visible view
00158                             currentPage.SwitchAndAnimate(currentId);
00159                         });
00160                     }
00161                     selectedItem.StopViewInUse();
00162                 }
00163                 catch (InvalidOperationException)
00164                 {
00165                     // The view could be in the process of closing, and
00166                     // this thread just hasn't updated. As part of being closed,
00167                     // this thread will be informed to clean up its list of
00168                     // views (see SecondaryViewPage.xaml.cs)
00169                 }
00170                 catch (TaskCanceledException)
00171                 {
00172                     rootPage.NotifyUser("The animation was canceled. It may have timed out", NotifyType.ErrorMessage);
00173                 }
00174             }
00175             else
00176             {
00177                 rootPage.NotifyUser("Select a window to see a switch animation. You can create a window in scenario 1", NotifyType.ErrorMessage);
00178             }
00179         }
00180     }
00181 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/pch.h Source File

  • NumberFormatting
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Globalization.h"
00008 #include "winrt/Windows.Globalization.NumberFormatting.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.System.UserProfile.h"
00011 #include "winrt/Windows.UI.Core.h"
00012 #include "winrt/Windows.UI.Xaml.h"
00013 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.h"
00015 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00016 #include "winrt/Windows.UI.Xaml.Documents.h"
00017 #include "winrt/Windows.UI.Xaml.Interop.h"
00018 #include "winrt/Windows.UI.Xaml.Markup.h"
00019 #include "winrt/Windows.UI.Xaml.Media.h"
00020 #include "winrt/Windows.UI.Xaml.Navigation.h"
00021 #include <sstream>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/SampleConfiguration.h Source File

  • FileThumbnails
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 #include <collection.h>
00007
00008 namespace SDKTemplate
00009 {
00010     value struct Scenario;
00011
00012     class Errors
00013     {
00014     public:
00015         static Platform::String^ NoExifThumbnail;
00016         static Platform::String^ NoThumbnail;
00017         static Platform::String^ NoAlbumArt;
00018         static Platform::String^ NoIcon;
00019         static Platform::String^ NoImages;
00020         static Platform::String^ FileGroupEmpty;
00021         static Platform::String^ FileGroupLocation;
00022         static Platform::String^ Cancel;
00023         static Platform::String^ InvalidSize;
00024     };
00025
00026     class FileExtensions
00027     {
00028     public:
00029         static Platform::Array<Platform::String^>^ Document;
00030         static Platform::Array<Platform::String^>^ Image;
00031         static Platform::Array<Platform::String^>^ Music;
00032     };
00033
00034     partial ref class MainPage
00035     {
00036     internal:
00037         static property Platform::String^ FEATURE_NAME
00038         {
00039             Platform::String^ get()
00040             {
00041                 return "File thumbnails C++ sample";
00042             }
00043         }
00044
00045         static property Platform::Array<Scenario>^ scenarios
00046         {
00047             Platform::Array<Scenario>^ get()
00048             {
00049                 return scenariosInner;
00050             }
00051         }
00052
00053     internal:
00054         void ResetOutput(Windows::UI::Xaml::Controls::Image^ image, Windows::UI::Xaml::Controls::TextBlock^ output, Windows::UI::Xaml::Controls::TextBlock^ outputDetails);
00055         static void DisplayResult(Windows::UI::Xaml::Controls::Image^ image, Windows::UI::Xaml::Controls::TextBlock^ textBlock,
00056                                   Platform::String^ thumbnailModeName, size_t size,
00057                                   Windows::Storage::IStorageItem^ item, Windows::Storage::FileProperties::StorageItemThumbnail^ thumbnail,
00058                                   bool isGroup);
00059
00060     private:
00061         static Platform::Array<Scenario>^ scenariosInner;
00062
00063         Windows::UI::Xaml::Media::Imaging::BitmapImage^ _placeholder;
00064         Windows::UI::Xaml::Media::Imaging::BitmapImage^ GetPlaceHolderImage();
00065     };
00066
00067     public value struct Scenario
00068     {
00069         Platform::String^ Title;
00070         Platform::String^ ClassName;
00071     };
00072 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/SampleConfiguration.h Source File

  • TextSegmentation
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Text segmentation C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cs/Scenario2_DelayMini.xaml.cs Source File

  • ContactCards
  • cs

Scenario2_DelayMini.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Threading.Tasks;
00013 using Windows.ApplicationModel.Contacts;
00014 using Windows.Foundation;
00015 using Windows.UI.Popups;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario2_DelayMini : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025
00026         public Scenario2_DelayMini()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             if (!ContactManager.IsShowDelayLoadedContactCardSupported())
00034             {
00035                 NotSupportedWarning.Visibility = Visibility.Visible;
00036             }
00037         }
00038
00039         private static Contact CreatePlaceholderContact()
00040         {
00041             // Create contact object with small set of initial data to display.
00042             Contact contact = new Contact();
00043             contact.FirstName = "Kim";
00044             contact.LastName = "Abercrombie";
00045
00046             ContactEmail email = new ContactEmail();
00047             email.Address = "kim@contoso.com";
00048             contact.Emails.Add(email);
00049
00050             return contact;
00051         }
00052
00053         private async Task<Contact> DownloadContactDataAsync(Contact contact)
00054         {
00055             // Simulate the download latency by delaying the execution by 2 seconds.
00056             await Task.Delay(2000);
00057
00058             if (!DownloadSucceeded.IsChecked.Value)
00059             {
00060                 return null;
00061             }
00062
00063             // Add more data to the contact object.
00064             ContactEmail workEmail = new ContactEmail();
00065             workEmail.Address = "kim@example.com";
00066             workEmail.Kind = ContactEmailKind.Work;
00067             contact.Emails.Add(workEmail);
00068
00069             ContactPhone homePhone = new ContactPhone();
00070             homePhone.Number = "(444) 555-0101";
00071             homePhone.Kind = ContactPhoneKind.Home;
00072             contact.Phones.Add(homePhone);
00073
00074             ContactPhone workPhone = new ContactPhone();
00075             workPhone.Number = "(245) 555-0123";
00076             workPhone.Kind = ContactPhoneKind.Work;
00077             contact.Phones.Add(workPhone);
00078
00079             ContactPhone mobilePhone = new ContactPhone();
00080             mobilePhone.Number = "(921) 555-0187";
00081             mobilePhone.Kind = ContactPhoneKind.Mobile;
00082             contact.Phones.Add(mobilePhone);
00083
00084             ContactAddress address = new ContactAddress();
00085             address.StreetAddress = "123 Main St";
00086             address.Locality = "Redmond";
00087             address.Region = "WA";
00088             address.Country = "USA";
00089             address.PostalCode = "00000";
00090             address.Kind = ContactAddressKind.Home;
00091             contact.Addresses.Add(address);
00092
00093             return contact;
00094         }
00095
00096         private async void ShowContactCard_Click(object sender, RoutedEventArgs e)
00097         {
00098             Contact contact = CreatePlaceholderContact();
00099
00100             // Show the contact card next to the button.
00101             Rect rect = MainPage.GetElementRect(sender as FrameworkElement);
00102
00103             // The contact card placement can change when it is updated with more data. For improved user experience, specify placement
00104             // of the card so that it has space to grow and will not need to be repositioned. In this case, default placement first places
00105             // the card above the button because the card is small, but after the card is updated with more data, the operating system moves
00106             // the card below the button to fit the card's expanded size. Specifying that the contact card is placed below at the beginning
00107             // avoids this repositioning.
00108             Placement placement = Placement.Below;
00109
00110             // For demonstration purposes, we ask for the Enterprise contact card.
00111             ContactCardOptions options = new ContactCardOptions() { HeaderKind = ContactCardHeaderKind.Enterprise };
00112
00113             using (ContactCardDelayedDataLoader dataLoader = ContactManager.ShowDelayLoadedContactCard(contact, rect, placement, options))
00114             {
00115                 if (dataLoader != null)
00116                 {
00117                     // Simulate downloading more data from the network for the contact.
00118                     this.rootPage.NotifyUser("Simulating download...", NotifyType.StatusMessage);
00119
00120                     Contact fullContact = await DownloadContactDataAsync(contact);
00121                     if (fullContact != null)
00122                     {
00123                         // Update the contact card with the full set of contact data.
00124                         dataLoader.SetData(fullContact);
00125                         this.rootPage.NotifyUser("Contact has been updated with downloaded data.", NotifyType.StatusMessage);
00126                     }
00127                     else
00128                     {
00129                         this.rootPage.NotifyUser("No further information available.", NotifyType.StatusMessage);
00130                     }
00131                 }
00132                 else
00133                 {
00134                     this.rootPage.NotifyUser("ShowDelayLoadedContactCard is not supported by this device.", NotifyType.ErrorMessage);
00135                 }
00136                 // The "using" statement will dispose the dataLoader for us.
00137             }
00138         }
00139     }
00140 }
Generated on Fri Nov 15 2024 22:18:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/cpp/Scenario4_CustomExceptionWRL.xaml.cpp Source File

  • ProxyStubsForWinRTComponents
  • cs
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario4_CustomExceptionWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKSample;
00013 using namespace SDKSample::ProxyStubsForWinRTComponents;
00014
00015 using namespace Microsoft::SDKSamples::Kitchen;
00016
00017 using namespace Windows::UI::Xaml;
00018 using namespace Windows::UI::Xaml::Controls;
00019
00020 CustomExceptionWRL::CustomExceptionWRL()
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void SDKSample::ProxyStubsForWinRTComponents::CustomExceptionWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> spMyOven;
00028     HRESULT hr = Windows::Foundation::ActivateInstance(Microsoft::WRL::Wrappers::HStringReference(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &spMyOven);
00029     if (SUCCEEDED(hr))
00030     {
00031         // Intentionally pass an invalid value
00032         hr = spMyOven->ConfigurePreheatTemperature((ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature)5);
00033         if (hr == E_INVALIDARG)
00034         {
00035             CustomExceptionWRLOutput->Text += L"Error handled. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuperMutt::ReadWriteBufferControlInformation Member List

This is the complete list of members for SuperMutt::ReadWriteBufferControlInformation, including all inherited members.
ButtonDataMask | SuperMutt::ReadWriteBufferControlInformation | [static]
ButtonUsageId | SuperMutt::ReadWriteBufferControlInformation | [static]
ButtonUsagePage | SuperMutt::ReadWriteBufferControlInformation |
ReportId | SuperMutt::ReadWriteBufferControlInformation |
VolumeDataStartBit | SuperMutt::ReadWriteBufferControlInformation |
VolumeUsageId | SuperMutt::ReadWriteBufferControlInformation |
VolumeUsagePage | SuperMutt::ReadWriteBufferControlInformation |
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/pch.h Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

pch.h

Go to the documentation of this file.
00001 #include <roapi.h>
00002 #include <wrl.h>
00003 #include <winerror.h>
00004 #include <Windows.Foundation.h>
00005 #include <Windows.ApplicationModel.Core.h>
00006 #include <windows.System.Threading.h>
00007
00008 #include "Microsoft.SDKSamples.Kitchen.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Camera Member List

This is the complete list of members for Camera, including all inherited members.
Camera() | Camera |
Camera(Camera const &) | Camera |
Eye(_In_ DirectX::XMFLOAT3 position) | Camera |
Eye() | Camera |
FarClipPlane() | Camera |
LeftEyeProjection() | Camera |
LookAt() | Camera |
LookDirection(_In_ DirectX::XMFLOAT3 lookDirection) | Camera |
m_aspectRatio | Camera | [private]
m_cameraPitchAngle | Camera | [private]
m_cameraYawAngle | Camera | [private]
m_eye | Camera | [private]
m_farPlane | Camera | [private]
m_fieldOfView | Camera | [private]
m_inverseView | Camera | [private]
m_lookAt | Camera | [private]
m_nearPlane | Camera | [private]
m_projectionMatrix | Camera | [private]
m_projectionMatrixLeft | Camera | [private]
m_projectionMatrixRight | Camera | [private]
m_up | Camera | [private]
m_viewMatrix | Camera | [private]
NearClipPlane() | Camera |
operator=(Camera const &) | Camera |
Pitch() | Camera |
Projection() | Camera |
RightEyeProjection() | Camera |
SetProjParams(_In_ float fieldOfView, _In_ float aspectRatio, _In_ float nearPlane, _In_ float farPlane) | Camera |
SetViewParams(_In_ DirectX::XMFLOAT3 eye, _In_ DirectX::XMFLOAT3 lookAt, _In_ DirectX::XMFLOAT3 up) | Camera |
Up() | Camera |
View() | Camera |
World() | Camera |
Yaw() | Camera |
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/SeekBarElement.h Source File

  • 360VideoPlayback
  • cpp
  • Common

SeekBarElement.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "BaseElement.h"
00003
00004 namespace DX
00005 {
00006     class SeekBarElement : public FocusableElement
00007     {
00008     public:
00009         SeekBarElement(
00010             float elementWidth,
00011             float elementHeight = FONT_SIZE * 5.0f,
00012             float leftRightPadding = FONT_SIZE * 2.0f,
00013             float topBottomPadding = FONT_SIZE * 2.0f);
00014
00015         virtual void Initialize() override;
00016         virtual void Update(const DX::StepTimer& timer, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose) override;
00017
00018         virtual void PerformAction() override;
00019
00020
00021     private:
00022         void UpdateLayoutFromCurrentTime();
00023         void UpdateSliderPosition(float position);
00024         Platform::String^ FormatTimeString(int64 intervalValue);
00025
00026         float m_sliderPosition;
00027         float m_sliderWidth;
00028         float m_sliderHeight;
00029         float m_leftRightPadding;
00030         float m_topBottomPadding;
00031         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_frontSegmentBrush;
00032         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_endSegmentBrush;
00033         D2D1_POINT_2F m_sliderFrontSegmentStart;
00034         D2D1_POINT_2F m_sliderFrontSegmentEnd;
00035         D2D1_POINT_2F m_sliderRemainingSegmentStart;
00036         D2D1_POINT_2F m_sliderRemainingSegmentEnd;
00037         std::shared_ptr<Line> m_sliderFrontSegment;
00038         std::shared_ptr<Line> m_sliderRemainingSegment;
00039         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_brush;
00040         int64 m_currentVideoDuration;
00041         int64 m_currentPlayPosition;
00042         std::wstring m_elapsedTimeString;
00043         std::wstring m_remainingTimeString;
00044         std::shared_ptr<Text> m_elapsedTimeText;
00045         std::shared_ptr<Text> m_remainingTimeText;
00046         float m_textSize;
00047         double m_secondsElapsedSinceTimeUpdate;
00048
00049     };
00050
00051 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonPinTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DelayMini Member List

This is the complete list of members for Scenario2_DelayMini, including all inherited members.
CreatePlaceholderContact() | Scenario2_DelayMini | [inline, private, static]
DownloadContactDataAsync(Contact contact) | Scenario2_DelayMini | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_DelayMini | [inline, protected]
rootPage | Scenario2_DelayMini | [private]
Scenario2_DelayMini() | Scenario2_DelayMini | [inline]
ShowContactCard_Click(object sender, RoutedEventArgs e) | Scenario2_DelayMini | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/pch.h Source File

  • Compression
  • cpp

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // pch.h
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020 #include <compressapi.h>
00021 #include <sstream>
00022 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario3_CustomException.xaml.cpp Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario3_CustomException.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario3_CustomException.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKTemplate::WRLInProcessWinRTComponent;
00013
00014 using namespace Microsoft::SDKSamples::Kitchen;
00015
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018
00019 CustomException::CustomException()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void CustomException::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00025 {
00026     // Component Creation
00027     auto myOven = ref new Oven();
00028
00029     try
00030     {
00031         // Intentionally pass an invalid value
00032         myOven->ConfigurePreheatTemperature(static_cast<Microsoft::SDKSamples::Kitchen::OvenTemperature>(5));
00033     }
00034     catch (Platform::InvalidArgumentException^ e)
00035     {
00036         CustomExceptionOutput->Text += L"Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00037     }
00038 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Level3 Member List

This is the complete list of members for Level3, including all inherited members.
Initialize(std::vector< std::shared_ptr< GameObject >> const &objects) override | Level3 | [virtual]
Level3() | Level3 |
LoadState(PersistentState &state) | Level | [virtual]
m_objective | Level | [protected]
m_timeLimit | Level | [protected]
Objective() | Level |
SaveState(PersistentState &state) | Level | [virtual]
TimeLimit() | Level |
Update(float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) | Level | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_EnableSettings Member List

This is the complete list of members for Scenario2_EnableSettings, including all inherited members.
BrightnessBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2_EnableSettings | [inline, private]
ColorLampBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2_EnableSettings | [inline, private]
LogStatusAsync(string message, NotifyType type) | Scenario2_EnableSettings | [inline, private]
LogStatusToOutputBoxAsync(string message) | Scenario2_EnableSettings | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_EnableSettings | [inline, protected]
rootPage | Scenario2_EnableSettings | [private]
Scenario2_EnableSettings() | Scenario2_EnableSettings | [inline]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
Error(string message) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UserControl_Loaded(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SingleFile Member List

This is the complete list of members for Scenario1_SingleFile, including all inherited members.
PickAFileButton_Click(object sender, RoutedEventArgs e) | Scenario1_SingleFile | [inline, private]
rootPage | Scenario1_SingleFile | [private]
Scenario1_SingleFile() | Scenario1_SingleFile | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Helpers.cs Source File

  • 360VideoPlayback
  • cs

Helpers.cs

Go to the documentation of this file.
00001 ﻿using System.Numerics;
00002
00003 namespace _360VideoPlayback
00004 {
00005     class Helpers
00006     {
00007         static public Quaternion CreateFromHeadingPitchRoll(double heading, double pitch, double roll)
00008         {
00009             Quaternion result;
00010             double headingPart = DegreetoRadians(heading) * 0.5;
00011             double sin1 = System.Math.Sin(headingPart);
00012             double cos1 = System.Math.Cos(headingPart);
00013
00014             double pitchPart = DegreetoRadians(-pitch) * 0.5;
00015             double sin2 = System.Math.Sin(pitchPart);
00016             double cos2 = System.Math.Cos(pitchPart);
00017
00018             double rollPart = DegreetoRadians(roll) * 0.5;
00019             double sin3 = System.Math.Sin(rollPart);
00020             double cos3 = System.Math.Cos(rollPart);
00021
00022             result.W = (float)(cos1 * cos2 * cos3 - sin1 * sin2 * sin3);
00023             result.X = (float)(cos1 * cos2 * sin3 + sin1 * sin2 * cos3);
00024             result.Y = (float)(sin1 * cos2 * cos3 + cos1 * sin2 * sin3);
00025             result.Z = (float)(cos1 * sin2 * cos3 - sin1 * cos2 * sin3);
00026
00027             return result;
00028         }
00029
00030         static private double DegreetoRadians(double degree)
00031         {
00032             return degree * System.Math.PI / 180.0;
00033         }
00034
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/SampleConfiguration.h Source File

  • SecondaryTiles
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     void App_LaunchCompleted(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const&);
00018
00019     struct SampleHelpers
00020     {
00021         static constexpr wchar_t LogoSecondaryTileId[] = L"SecondaryTile.Logo";
00022         static constexpr wchar_t DynamicTileId[] = L"SecondaryTile.LiveTile";
00023         static constexpr wchar_t AppBarTileId[] = L"SecondaryTile.AppBar";
00024
00025         static hstring CurrentTimeAsString();
00026         static Windows::Foundation::Rect GetElementRect(Windows::Foundation::IInspectable const& e);
00027     };
00028 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePicker_FailToSave.xaml.cs Source File

  • FilePickerContracts
  • cs

FileSavePicker_FailToSave.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using Windows.ApplicationModel;
00015 using Windows.Foundation;
00016 using Windows.Storage;
00017 using Windows.Storage.Pickers.Provider;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace FilePickerContracts
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class FileSavePicker_FailToSave : Page
00029     {
00030         FileSavePickerUI fileSavePickerUI = FileSavePickerPage.Current.fileSavePickerUI;
00031         CoreDispatcher dispatcher = Window.Current.Dispatcher;
00032
00033         public FileSavePicker_FailToSave()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         private async void OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e)
00039         {
00040             // This scenario demonstrates how the app can go about handling the TargetFileRequested event on the UI thread, from
00041             // which the app can manipulate the UI, show error dialogs, etc.
00042
00043             // Requesting a deferral allows the app to return from this event handler and complete the request at a later time.
00044             // In this case, the deferral is required as the app intends on handling the TargetFileRequested event on the UI thread.
00045             // Note that the deferral can be requested more than once but calling Complete on the deferral a single time will complete
00046             // original TargetFileRequested event.
00047             var deferral = e.Request.GetDeferral();
00048
00049             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00050             {
00051                 // This method will be called on the app's UI thread, which allows for actions like manipulating
00052                 // the UI or showing error dialogs
00053
00054                 // Display a dialog indicating to the user that a corrective action needs to occur
00055                 var errorDialog = new Windows.UI.Popups.MessageDialog("If the app needs the user to correct a problem before the app can save the file, the app can use a message like this to tell the user about the problem and how to correct it.");
00056                 await errorDialog.ShowAsync();
00057
00058                 // Set the targetFile property to null and complete the deferral to indicate failure once the user has closed the
00059                 // dialog.  This will allow the user to take any neccessary corrective action and click the Save button once again.
00060                 e.Request.TargetFile = null;
00061                 deferral.Complete();
00062             });
00063         }
00064
00065         protected override void OnNavigatedTo(NavigationEventArgs e)
00066         {
00067             fileSavePickerUI.TargetFileRequested += new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00068         }
00069
00070         protected override void OnNavigatedFrom(NavigationEventArgs e)
00071         {
00072             fileSavePickerUI.TargetFileRequested -= new TypedEventHandler<FileSavePickerUI, TargetFileRequestedEventArgs>(OnTargetFileRequested);
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/App.xaml.h Source File

  • Simple3DGameXaml
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #if defined(_DEBUG)
00015 #define DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION 1
00016 #endif
00017
00018 #include "DirectXPage.xaml.h"
00019 #include "App.g.h"
00020
00021 namespace Simple3DGameXaml
00022 {
00023
00024     [Windows::Foundation::Metadata::WebHostHidden]
00025     public ref class App sealed
00026     {
00027     public:
00028         App();
00029
00030         virtual void OnLaunched(
00031             _In_ Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args
00032             ) override;
00033
00034     private:
00035         void OnSuspending(
00036             _In_ Platform::Object^ sender,
00037             _In_ Windows::ApplicationModel::SuspendingEventArgs^ args
00038             );
00039
00040         void OnResuming(
00041             _In_ Platform::Object^ sender,
00042             _In_ Platform::Object^ args
00043             );
00044
00045         void OnWindowActivationChanged(
00046             _In_ Platform::Object^ sender,
00047             _In_ Windows::UI::Core::WindowActivatedEventArgs^ args
00048             );
00049
00050         DirectXPage^ m_mainPage;
00051     };
00052 }
00053
00054
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameUIControl.h Source File

  • Simple3DGameDX
  • cpp

GameUIControl.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 // The IGameUIControl interface provides an abstraction to the GameMain class
00014 // for controlling UI elements on the screen in response to game state.  It helps to
00015 // provide separation between the game control and how the UI is displayed to the user.
00016 //    SetGameLoading - is called to have the UI indicate the game is currently loading
00017 //        resources for the game or a particular level.  GameMain will call this
00018 //        method repeatedly to provide update progress.  'dots' is the number of
00019 //        dots to display to indicate progress.
00020 //    SetGameStats - is called to have the UI indicate the status of the last completed game.
00021 //    SetGameOver - is called to have the UI indicate this iteration of the game as finished.
00022 //    SetLevelStart - is called to have the UI indicate the level is ready to begin.  This includes
00023 //        providing the objectives for the level and other current data.
00024 //    SetPause - is called to have the UI indicate the game is currently in the Paused state.
00025 //    ShowTooSmall - this method indicates the UI should display to the user that the current
00026 //        display configuration is too small for the game to be played.
00027 //    HideTooSmall - this method inticates the UI should stop displaying to the user that the
00028 //        current display configuration is too small for game play.
00029 //    SetAction - is called to have the UI indicate the next action the user should take.
00030 //    ShowGameInfoOverlay - is called to have the UI display to the user the current state
00031 //        as defined by the other interface calls above.
00032 //    HideGameInfoOverlay - is called to have the UI remove the display of the current state
00033 //        when the game transitions into active game play.
00034
00035 namespace Simple3DGameDX
00036 {
00037     public enum class GameInfoOverlayCommand
00038     {
00039         None,
00040         TapToContinue,
00041         PleaseWait,
00042         PlayAgain,
00043     };
00044
00045     public interface class IGameUIControl
00046     {
00047         void SetGameLoading(uint32 dots);
00048         void SetGameStats(int maxLevel, int hitCount, int shotCount);
00049         void SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore);
00050         void SetLevelStart(int level, Platform::String^ objective, float timeLimit, float bonusTime);
00051         void SetPause(int level, int hitCount, int shotCount, float timeRemaining);
00052         void ShowTooSmall();
00053         void HideTooSmall();
00054         void SetAction(GameInfoOverlayCommand action);
00055         void HideGameInfoOverlay();
00056         void ShowGameInfoOverlay();
00057     };
00058 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/pch.cpp Source File

  • BluetoothLE
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cs/Scenario1_DataEvents.xaml.cs Source File

  • PresenceSensor
  • cs

Scenario1_DataEvents.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Sensors;
00014 using Windows.UI.Core;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Input;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario1_DataEvents : Page
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         private HumanPresenceSensor sensor;
00029
00030         public Scenario1_DataEvents()
00031         {
00032             InitializeComponent();
00033         }
00034
00035         protected override void OnNavigatedFrom(NavigationEventArgs e)
00036         {
00037             if (sensor != null)
00038             {
00039                 sensor.ReadingChanged -= ReadingChanged;
00040                 sensor = null;
00041             }
00042         }
00043
00044         private async void ScenarioGetSensor_Click(object sender, RoutedEventArgs e)
00045         {
00046             // Disable the button so the user can't click it again while we are already working.
00047             GetSensorButton.IsEnabled = false;
00048
00049             // Clear any previous message.
00050             rootPage.NotifyUser("", NotifyType.StatusMessage);
00051
00052             // Try to get the default presence sensor.
00053             try
00054             {
00055                 sensor = await HumanPresenceSensor.GetDefaultAsync();
00056             }
00057             catch (UnauthorizedAccessException)
00058             {
00059                 // The user denied this app presence sensor access.
00060                 sensor = null;
00061             }
00062             GetSensorButton.IsEnabled = true;
00063
00064
00065             if (sensor != null)
00066             {
00067                 VisualStateManager.GoToState(this, "Ready", true);
00068
00069                 // Begin listening for data reports.
00070                 sensor.ReadingChanged += ReadingChanged;
00071             }
00072             else
00073             {
00074                 rootPage.NotifyUser("No presence sensor found", NotifyType.ErrorMessage);
00075             }
00076         }
00077
00078         async private void ReadingChanged(HumanPresenceSensor sender, HumanPresenceSensorReadingChangedEventArgs e)
00079         {
00080             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00081             {
00082                 HumanPresenceSensorReading reading = e.Reading;
00083                 if (null != reading)
00084                 {
00085                     if (sensor.IsEngagementSupported)
00086                     {
00087                         EngagementStateTextBlock.Text = reading.Engagement.ToString();
00088                     }
00089                     else
00090                     {
00091                         EngagementStateTextBlock.Text = "Not Supported";
00092                     }
00093
00094                     if (sensor.IsPresenceSupported)
00095                     {
00096                         DetectionStateTextBlock.Text = reading.Presence.ToString();
00097                     }
00098                     else
00099                     {
00100                         DetectionStateTextBlock.Text = "Not Supported";
00101                     }
00102
00103                     // Show the detection distance, if available
00104                     DetectionDistanceTextBlock.Text = reading.DistanceInMillimeters == null ? "Unavailable" : reading.DistanceInMillimeters.ToString();
00105
00106                     TimestampTextBlock.Text = reading.Timestamp.ToString("u");
00107                 }
00108             });
00109         }
00110     }
00111 }
Generated on Fri Nov 15 2024 22:17:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario5_InboxEffects.xaml.cs Source File

  • AudioCreation
  • cs
  • AudioCreation

Scenario5_InboxEffects.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.Media.Audio;
00016 using Windows.Media.Render;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.UI;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Controls.Primitives;
00023 using Windows.UI.Xaml.Media;
00024 using Windows.UI.Xaml.Navigation;
00025
00026 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00027
00028 namespace AudioCreation
00029 {
00030     /// <summary>
00031     /// This scenario is to demonstrate the use of Built-In Effects.
00032     /// </summary>
00033     public sealed partial class Scenario5_InboxEffects : Page
00034     {
00035         private MainPage rootPage;
00036         private AudioGraph graph;
00037         private AudioFileInputNode fileInputNode;
00038         private AudioDeviceOutputNode deviceOutputNode;
00039         private EchoEffectDefinition echoEffectDefinition;
00040         private ReverbEffectDefinition reverbEffectDefinition;
00041         private EqualizerEffectDefinition eqEffectDefinition;
00042         private LimiterEffectDefinition limiterEffectDefinition;
00043
00044         public Scenario5_InboxEffects()
00045         {
00046             this.InitializeComponent();
00047         }
00048
00049         protected override async void OnNavigatedTo(NavigationEventArgs e)
00050         {
00051             rootPage = MainPage.Current;
00052             await CreateAudioGraph();
00053         }
00054
00055         protected override void OnNavigatedFrom(NavigationEventArgs e)
00056         {
00057             if (graph != null)
00058             {
00059                 graph.Dispose();
00060             }
00061         }
00062
00063         private async void File_Click(object sender, RoutedEventArgs e)
00064         {
00065             // If another file is already loaded into the FileInput node
00066             if (fileInputNode != null)
00067             {
00068                 // Release the file and dispose the contents of the node
00069                 fileInputNode.Dispose();
00070                 // Stop playback since a new file is being loaded. Also reset the button UI
00071                 if (graphButton.Content.Equals("Stop Graph"))
00072                 {
00073                     TogglePlay();
00074                 }
00075             }
00076
00077             FileOpenPicker filePicker = new FileOpenPicker();
00078             filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
00079             filePicker.FileTypeFilter.Add(".mp3");
00080             filePicker.FileTypeFilter.Add(".wma");
00081             filePicker.FileTypeFilter.Add(".wav");
00082             filePicker.ViewMode = PickerViewMode.Thumbnail;
00083             StorageFile file = await filePicker.PickSingleFileAsync();
00084
00085             // File can be null if cancel is hit in the file picker
00086             if (file == null)
00087             {
00088                 return;
00089             }
00090
00091             CreateAudioFileInputNodeResult fileInputResult = await graph.CreateFileInputNodeAsync(file);
00092             if (fileInputResult.Status != AudioFileNodeCreationStatus.Success)
00093             {
00094                 // Error reading the input file
00095                 rootPage.NotifyUser(String.Format("Can't read input file because {0}", fileInputResult.Status.ToString()), NotifyType.ErrorMessage);
00096                 return;
00097             }
00098
00099             // File loaded successfully. Enable these buttons in the UI
00100             graphButton.IsEnabled           = true;
00101             echoEffectToggle.IsEnabled      = true;
00102             reverbEffectToggle.IsEnabled    = true;
00103             limiterEffectToggle.IsEnabled   = true;
00104             eqToggle.IsEnabled              = true;
00105
00106             fileInputNode = fileInputResult.FileInputNode;
00107             fileInputNode.AddOutgoingConnection(deviceOutputNode);
00108
00109             rootPage.NotifyUser("Successfully loaded input file", NotifyType.StatusMessage);
00110             fileButton.Background = new SolidColorBrush(Colors.Green);
00111
00112             // Create the four inbox effects
00113             CreateEchoEffect();
00114             CreateReverbEffect();
00115             CreateLimiterEffect();
00116             CreateEqEffect();
00117         }
00118
00119         private void Graph_Click(object sender, RoutedEventArgs e)
00120         {
00121             TogglePlay();
00122         }
00123
00124         private void TogglePlay()
00125         {
00126             if (graphButton.Content.Equals("Start Graph"))
00127             {
00128                 graph.Start();
00129                 graphButton.Content = "Stop Graph";
00130                 audioPipe.Fill = new SolidColorBrush(Colors.Blue);
00131             }
00132             else
00133             {
00134                 graph.Stop();
00135                 graphButton.Content = "Start Graph";
00136                 audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00137             }
00138         }
00139
00140         private void EchoEffectToggle_Toggled(object sender, RoutedEventArgs e)
00141         {
00142             // Enable/Disable the effect in the graph
00143             // Also enable/disable the associated UI for effect parameters
00144             if (echoEffectToggle.IsOn)
00145             {
00146                 echoSlider.IsEnabled = true;
00147                 echoLabel.Foreground = new SolidColorBrush(Colors.White);
00148                 fileInputNode.EnableEffectsByDefinition(echoEffectDefinition);
00149             }
00150             else
00151             {
00152                 echoSlider.IsEnabled = false;
00153                 echoLabel.Foreground = new SolidColorBrush(Color.FromArgb(255,74,74,74));
00154                 fileInputNode.DisableEffectsByDefinition(echoEffectDefinition);
00155             }
00156         }
00157
00158         private void EchoSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00159         {
00160             if(echoEffectDefinition != null)
00161             {
00162                 int currentValue = (int)echoSlider.Value;
00163                 echoLabel.Text = "Delay: " + currentValue.ToString() + "ms";
00164                 echoEffectDefinition.Delay = currentValue;
00165             }
00166         }
00167
00168         private void ReverbEffectToggle_Toggled(object sender, RoutedEventArgs e)
00169         {
00170             // Enable/Disable the effect in the graph
00171             // Also enable/disable the associated UI for effect parameters
00172             if (reverbEffectToggle.IsOn)
00173             {
00174                 decaySlider.IsEnabled = true;
00175                 decayLabel.Foreground = new SolidColorBrush(Colors.White);
00176                 fileInputNode.EnableEffectsByDefinition(reverbEffectDefinition);
00177             }
00178             else
00179             {
00180                 decaySlider.IsEnabled = false;
00181                 decayLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00182                 fileInputNode.DisableEffectsByDefinition(reverbEffectDefinition);
00183             }
00184         }
00185
00186         private void DecaySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00187         {
00188             if(reverbEffectDefinition != null)
00189             {
00190                 double currentValue = decaySlider.Value;
00191                 decayLabel.Text = "Decay: " + currentValue.ToString() + "  s";
00192                 reverbEffectDefinition.DecayTime = currentValue;
00193             }
00194         }
00195
00196         private void LimiterEffectToggle_Toggled(object sender, RoutedEventArgs e)
00197         {
00198             // Enable/Disable the effect in the graph
00199             // Also enable/disable the associated UI for effect parameters
00200             if (limiterEffectToggle.IsOn)
00201             {
00202                 loudnessSlider.IsEnabled = true;
00203                 loudnessLabel.Foreground = new SolidColorBrush(Colors.White);
00204                 fileInputNode.EnableEffectsByDefinition(limiterEffectDefinition);
00205             }
00206             else
00207             {
00208                 loudnessSlider.IsEnabled = false;
00209                 loudnessLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00210                 fileInputNode.DisableEffectsByDefinition(limiterEffectDefinition);
00211             }
00212         }
00213
00214         private void LoudnessSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00215         {
00216             if (limiterEffectDefinition!= null)
00217             {
00218                 uint currentValue = (uint)loudnessSlider.Value;
00219                 limiterEffectDefinition.Loudness = currentValue;
00220                 loudnessLabel.Text = "Loudness: " + currentValue.ToString();
00221             }
00222         }
00223
00224         private void EqToggle_Toggled(object sender, RoutedEventArgs e)
00225         {
00226             // Enable/Disable the effect in the graph
00227             // Also enable/disable the associated UI for effect parameters
00228             if (eqToggle.IsOn)
00229             {
00230                 eq1Slider.IsEnabled = true;
00231                 eq2Slider.IsEnabled = true;
00232                 eq3Slider.IsEnabled = true;
00233                 eq4Slider.IsEnabled = true;
00234                 eq1SliderLabel.Foreground = new SolidColorBrush(Colors.White);
00235                 eq2SliderLabel.Foreground = new SolidColorBrush(Colors.White);
00236                 eq3SliderLabel.Foreground = new SolidColorBrush(Colors.White);
00237                 eq4SliderLabel.Foreground = new SolidColorBrush(Colors.White);
00238                 fileInputNode.EnableEffectsByDefinition(eqEffectDefinition);
00239             }
00240             else
00241             {
00242                 eq1Slider.IsEnabled = false;
00243                 eq2Slider.IsEnabled = false;
00244                 eq3Slider.IsEnabled = false;
00245                 eq4Slider.IsEnabled = false;
00246                 eq1SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00247                 eq2SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00248                 eq3SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00249                 eq4SliderLabel.Foreground = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
00250                 fileInputNode.DisableEffectsByDefinition(eqEffectDefinition);
00251             }
00252         }
00253
00254         // Mapping the 0-100 scale of the slider to a value between the min and max gain
00255         private double ConvertRange(double value)
00256         {
00257             // These are the same values as the ones in xapofx.h
00258             const double fxeq_min_gain = 0.126;
00259             const double fxeq_max_gain = 7.94;
00260
00261             double scale = (fxeq_max_gain - fxeq_min_gain)/100;
00262             return (fxeq_min_gain + ((value) * scale));
00263         }
00264
00265         // Change effect paramters to reflect UI control
00266         private void Eq1Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00267         {
00268             if(eqEffectDefinition != null)
00269             {
00270                 double currentValue = ConvertRange(eq1Slider.Value);
00271                 eqEffectDefinition.Bands[0].Gain = currentValue;
00272             }
00273         }
00274
00275         private void Eq2Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00276         {
00277             if (eqEffectDefinition != null)
00278             {
00279                 double currentValue = ConvertRange(eq2Slider.Value);
00280                 eqEffectDefinition.Bands[1].Gain = currentValue;
00281             }
00282         }
00283
00284         private void Eq3Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00285         {
00286             if (eqEffectDefinition != null)
00287             {
00288                 double currentValue = ConvertRange(eq3Slider.Value);
00289                 eqEffectDefinition.Bands[2].Gain = currentValue;
00290             }
00291         }
00292
00293         private void Eq4Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
00294         {
00295             if (eqEffectDefinition != null)
00296             {
00297                 double currentValue = ConvertRange(eq4Slider.Value);
00298                 eqEffectDefinition.Bands[3].Gain = currentValue;
00299             }
00300         }
00301
00302         private void CreateEchoEffect()
00303         {
00304             // create echo effect
00305             echoEffectDefinition = new EchoEffectDefinition(graph);
00306
00307             // See the MSDN page for parameter explanations
00308             // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xapofx.fxecho_parameters(v=vs.85).aspx
00309             echoEffectDefinition.WetDryMix    = 0.7f;
00310             echoEffectDefinition.Feedback     = 0.5f;
00311             echoEffectDefinition.Delay        = 500.0f;
00312
00313             fileInputNode.EffectDefinitions.Add(echoEffectDefinition);
00314             fileInputNode.DisableEffectsByDefinition(echoEffectDefinition);
00315         }
00316
00317         private void CreateReverbEffect()
00318         {
00319             // Create reverb effect
00320             reverbEffectDefinition = new ReverbEffectDefinition(graph);
00321
00322             // See the MSDN page for parameter explanations
00323             // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xaudio2.xaudio2fx_reverb_parameters(v=vs.85).aspx
00324             reverbEffectDefinition.WetDryMix          = 50;
00325             reverbEffectDefinition.ReflectionsDelay   = 120;
00326             reverbEffectDefinition.ReverbDelay        = 30;
00327             reverbEffectDefinition.RearDelay          = 3;
00328             reverbEffectDefinition.DecayTime          = 2;
00329
00330             fileInputNode.EffectDefinitions.Add(reverbEffectDefinition);
00331             fileInputNode.DisableEffectsByDefinition(reverbEffectDefinition);
00332         }
00333
00334         private void CreateLimiterEffect()
00335         {
00336             // Create limiter effect
00337             limiterEffectDefinition = new LimiterEffectDefinition(graph);
00338
00339             limiterEffectDefinition.Loudness = 1000;
00340             limiterEffectDefinition.Release = 10;
00341
00342             fileInputNode.EffectDefinitions.Add(limiterEffectDefinition);
00343             fileInputNode.DisableEffectsByDefinition(limiterEffectDefinition);
00344         }
00345
00346         private void CreateEqEffect()
00347         {
00348             // See the MSDN page for parameter explanations
00349             // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xapofx.fxeq_parameters(v=vs.85).aspx
00350             eqEffectDefinition = new EqualizerEffectDefinition(graph);
00351             eqEffectDefinition.Bands[0].FrequencyCenter   = 100.0f;
00352             eqEffectDefinition.Bands[0].Gain              = 4.033f;
00353             eqEffectDefinition.Bands[0].Bandwidth         = 1.5f;
00354
00355             eqEffectDefinition.Bands[1].FrequencyCenter   = 900.0f;
00356             eqEffectDefinition.Bands[1].Gain              = 1.6888f;
00357             eqEffectDefinition.Bands[1].Bandwidth         = 1.5f;
00358
00359             eqEffectDefinition.Bands[2].FrequencyCenter   = 5000.0f;
00360             eqEffectDefinition.Bands[2].Gain              = 2.4702f;
00361             eqEffectDefinition.Bands[2].Bandwidth         = 1.5f;
00362
00363             eqEffectDefinition.Bands[3].FrequencyCenter   = 12000.0f;
00364             eqEffectDefinition.Bands[3].Gain              = 5.5958f;
00365             eqEffectDefinition.Bands[3].Bandwidth         = 2.0f;
00366
00367             fileInputNode.EffectDefinitions.Add(eqEffectDefinition);
00368             fileInputNode.DisableEffectsByDefinition(eqEffectDefinition);
00369         }
00370
00371         private async Task CreateAudioGraph()
00372         {
00373             // Create an AudioGraph with default settings
00374             AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
00375             CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);
00376
00377             if (result.Status != AudioGraphCreationStatus.Success)
00378             {
00379                 // Cannot create graph
00380                 rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
00381                 return;
00382             }
00383
00384             graph = result.Graph;
00385
00386             // Create a device output node
00387             CreateAudioDeviceOutputNodeResult outputDeviceNodeResult = await graph.CreateDeviceOutputNodeAsync();
00388
00389             if (outputDeviceNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
00390             {
00391                 // Cannot create device output node
00392                 rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", outputDeviceNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00393                 speakerContainer.Background = new SolidColorBrush(Colors.Red);
00394                 return;
00395             }
00396
00397             deviceOutputNode = outputDeviceNodeResult.DeviceOutputNode;
00398             rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
00399             speakerContainer.Background = new SolidColorBrush(Colors.Green);
00400         }
00401     }
00402 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpinningCubeRenderer Member List

This is the complete list of members for SpinningCubeRenderer, including all inherited members.
CreateDeviceDependentResources() | SpinningCubeRenderer |
GetPosition() | SpinningCubeRenderer | [inline]
m_degreesPerSecond | SpinningCubeRenderer | [private]
m_deviceResources | SpinningCubeRenderer | [private]
m_geometryShader | SpinningCubeRenderer | [private]
m_indexBuffer | SpinningCubeRenderer | [private]
m_indexCount | SpinningCubeRenderer | [private]
m_inputLayout | SpinningCubeRenderer | [private]
m_loadingComplete | SpinningCubeRenderer | [private]
m_modelConstantBuffer | SpinningCubeRenderer | [private]
m_modelConstantBufferData | SpinningCubeRenderer | [private]
m_pixelShader | SpinningCubeRenderer | [private]
m_position | SpinningCubeRenderer | [private]
m_usingVprtShaders | SpinningCubeRenderer | [private]
m_vertexBuffer | SpinningCubeRenderer | [private]
m_vertexShader | SpinningCubeRenderer | [private]
PositionHologram(Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose) | SpinningCubeRenderer |
ReleaseDeviceDependentResources() | SpinningCubeRenderer |
Render() | SpinningCubeRenderer |
SetColor(Windows::Foundation::Numerics::float4 const &color) | SpinningCubeRenderer | [inline]
SetPosition(Windows::Foundation::Numerics::float3 pos) | SpinningCubeRenderer | [inline]
SpinningCubeRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | SpinningCubeRenderer |
Update(const DX::StepTimer &timer) | SpinningCubeRenderer |
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_Document3 Member List

This is the complete list of members for Scenario_Document3, including all inherited members.
Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario_Document3 | [inline, private]
Scenario_Document3() | Scenario_Document3 | [inline]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document3.xaml.cpp Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_Document3.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_Document3.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028
00029 Scenario_Document3::Scenario_Document3()
00030 {
00031     InitializeComponent();
00032 }
00033
00034
00035 void Scenario_Document3::Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00036 {
00037     // Font formatting is being applied on page load rather than in XAML markup
00038     // so that the on-demand cloud font behavior can be experienced when the
00039     // app runs rather than when the XAML file is viewed in Visual Studio.
00040
00041     // Formatting will be applied to all content elements in the page that don't
00042     // already have FontFamily set.
00043     this->FontFamily = ref new Windows::UI::Xaml::Media::FontFamily("Kokila");
00044 }
Generated on Fri Nov 15 2024 22:19:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/SampleConfiguration.cs Source File

  • CameraProfile
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using CameraProfile;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "CameraProfile";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Locate Record Specific Profile", ClassType=typeof(Scenario1_SetRecordProfile)},
00026             new Scenario() { Title="Query Profile for Concurrency", ClassType=typeof(Scenario2_ConcurrentProfile)},
00027             new Scenario() { Title="Query Profile for HDR Support", ClassType=typeof(Scenario3_EnableHdrProfile)}
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SubjectPublicKeyInfo Member List

This is the complete list of members for SubjectPublicKeyInfo, including all inherited members.
_rawCngPublicKeyBlob | SubjectPublicKeyInfo | [private]
GetPublicKey() | SubjectPublicKeyInfo | [inline]
STATUS_SUCCESS | SubjectPublicKeyInfo | [private]
SubjectPublicKeyInfo(byte[] subjectPublicKeyInfo) | SubjectPublicKeyInfo | [inline]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/SampleConfiguration.cs Source File

  • GlobalizationPreferences
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Globalization preferences C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="User preferences", ClassType=typeof(Scenario1_Prefs) },
00025             new Scenario() { Title="Language characteristics", ClassType=typeof(Scenario2_Lang) },
00026             new Scenario() { Title="Region characteristics", ClassType=typeof(Scenario3_Region) },
00027             new Scenario() { Title="Current input language", ClassType=typeof(Scenario4_Input) },
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario2.xaml.h Source File

  • Compression
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     namespace Compression
00025     {
00026         /// <summary>
00027         /// An empty page that can be used on its own or navigated to within a Frame.
00028         /// </summary>
00029         [Windows::Foundation::Metadata::WebHostHidden]
00030         public ref class Scenario2 sealed
00031         {
00032         public:
00033             Scenario2();
00034
00035         protected:
00036             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037         private:
00038             MainPage^ rootPage;
00039
00040             void DoScenario(Windows::Storage::Compression::CompressAlgorithm Algorithm);
00041
00042             void CompressAlgorithmComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043             void CompressFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044             void UpdateDescriptionVisibility(Windows::UI::Xaml::Controls::ComboBoxItem^ item, Windows::UI::Xaml::Visibility visibility);
00045             int CompressAlgorithmFromComboBoxItem(Windows::UI::Xaml::Controls::ComboBoxItem^ item);
00046         };
00047     }
00048 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/SampleConfiguration.h Source File

  • UserInteractionMode
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "User interaction mode";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario4PageRange.xaml.cs Source File

  • Printing
  • cs

Scenario4PageRange.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.Immutable;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.UI.Xaml.Printing;
00019 using Windows.Graphics.Printing;
00020 using Windows.Graphics.Printing.OptionDetails;
00021 using SDKTemplate;
00022
00023 namespace PrintSample
00024 {
00025     class InvalidPageException : Exception
00026     {
00027         public InvalidPageException(string message)
00028             : base(message)
00029         {
00030         }
00031     }
00032
00033     class PageRangePrintHelper : PrintHelper
00034     {
00035         public PageRangePrintHelper(Page scenarioPage) : base(scenarioPage)
00036         {
00037             // Use moderate margins to allow the content to span multiple pages
00038             ApplicationContentMarginTop = 0.1;
00039             ApplicationContentMarginLeft = 0.1;
00040         }
00041
00042         /// <summary>
00043         /// This is the event handler for PrintManager.PrintTaskRequested.
00044         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline.
00045         /// Therefore, we use this handler to only create the print task.
00046         /// The print settings customization can be done when the print document source is requested.
00047         /// </summary>
00048         /// <param name="sender">PrintManager</param>
00049         /// <param name="e">PrintTaskRequestedEventArgs</param>
00050         protected override void PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e)
00051         {
00052             PrintTask printTask = null;
00053             printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
00054             {
00055                 PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options);
00056                 IList<string> displayedOptions = printDetailedOptions.DisplayedOptions;
00057
00058                 // Choose the printer options to be shown.
00059                 // The order in which the options are appended determines the order in which they appear in the UI
00060                 displayedOptions.Clear();
00061
00062                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
00063                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.CustomPageRanges);
00064                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
00065                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
00066                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.ColorMode);
00067
00068                 printTask.Options.PageRangeOptions.AllowCurrentPage = true;
00069                 printTask.Options.PageRangeOptions.AllowAllPages = true;
00070                 printTask.Options.PageRangeOptions.AllowCustomSetOfPages = true;
00071
00072                 // Register the handler for the option change event
00073                 printDetailedOptions.OptionChanged += printDetailedOptions_OptionChanged;
00074
00075                 // Register the handler for the PrintTask.Completed event.
00076                 // Print Task event handler is invoked when the print job is completed.
00077                 printTask.Completed += async (s, args) =>
00078                 {
00079                     // Notify the user when the print operation fails.
00080                     if (args.Completion == PrintTaskCompletion.Failed)
00081                     {
00082                         await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00083                         {
00084                             MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
00085                         });
00086                     }
00087                 };
00088
00089                 sourceRequestedArgs.SetSource(printDocumentSource);
00090             });
00091         }
00092
00093         /// <summary>
00094         /// This is the event handler for PrintDocument.Paginate. It creates print preview pages for the app.
00095         /// </summary>
00096         /// <param name="sender">PrintDocument</param>
00097         /// <param name="e">Paginate Event Arguments</param>
00098         protected override void CreatePrintPreviewPages(object sender, PaginateEventArgs e)
00099         {
00100             base.CreatePrintPreviewPages(sender, e);
00101
00102             PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(e.PrintTaskOptions);
00103             PrintPageRangeOptionDetails pageRangeOption = (PrintPageRangeOptionDetails)printDetailedOptions.Options[StandardPrintTaskOptions.CustomPageRanges];
00104
00105             // The number of pages may have been changed, so validate the Page Ranges again
00106             ValidatePageRangeOption(pageRangeOption);
00107         }
00108
00109         /// <summary>
00110         /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
00111         /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
00112         /// into a pages that the Windows print system can deal with.
00113         /// </summary>
00114         /// <param name="sender">PrintDocument</param>
00115         /// <param name="e">Add page event arguments containing a print task options reference</param>
00116         protected override void AddPrintPages(object sender, AddPagesEventArgs e)
00117         {
00118             IList<PrintPageRange> customPageRanges = e.PrintTaskOptions.CustomPageRanges;
00119
00120             // An empty CustomPageRanges means "All Pages"
00121             if (customPageRanges.Count == 0)
00122             {
00123                 // Loop over all of the preview pages and add each one to be printed
00124                 foreach (UIElement previewPage in printPreviewPages)
00125                 {
00126                     printDocument.AddPage(previewPage);
00127                 }
00128             }
00129             else
00130             {
00131                 // Print only the pages chosen by the user.
00132                 //
00133                 // The "Current page" option is a special case of "Custom set of pages".
00134                 // In case the user selects the "Current page" option, the PrintDialog
00135                 // will turn that into a CustomPageRanges containing the page that the user was looking at.
00136                 // If the user typed in an indefinite range such as "6-", the LastPageNumber value
00137                 // will be whatever this sample app last passed into the PrintDocument.SetPreviewPageCount API.
00138                 foreach (PrintPageRange pageRange in customPageRanges)
00139                 {
00140                     // The user may type in a page number that is not present in the document.
00141                     // In this case, we just ignore those pages, hence the checks
00142                     // (pageRange.FirstPageNumber <= printPreviewPages.Count) and (i <= printPreviewPages.Count).
00143                     //
00144                     // If the user types the same page multiple times, it will be printed multiple times
00145                     // (e.g 3-4;1;1 will print pages 3 and 4 followed by two copies of page 1)
00146                     if (pageRange.FirstPageNumber <= printPreviewPages.Count)
00147                     {
00148                         for (int i = pageRange.FirstPageNumber; (i <= pageRange.LastPageNumber) && (i <= printPreviewPages.Count); i++)
00149                         {
00150                             // Subtract 1 because page numbers are 1-based, but our list is 0-based.
00151                             printDocument.AddPage(printPreviewPages[i - 1]);
00152                         }
00153                     }
00154                 }
00155             }
00156
00157             PrintDocument printDoc = (PrintDocument)sender;
00158
00159             // Indicate that all of the print pages have been provided
00160             printDoc.AddPagesComplete();
00161         }
00162
00163         /// <summary>
00164         /// Option change event handler
00165         /// </summary>
00166         /// <param name="sender">PrintTaskOptionsDetails object</param>
00167         /// <param name="args">the event arguments containing the changed option id</param>
00168         void printDetailedOptions_OptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)
00169         {
00170             string optionId = args.OptionId as string;
00171             if (string.IsNullOrEmpty(optionId))
00172             {
00173                 return;
00174             }
00175
00176             // Handle change in Page Range Option
00177             if (optionId == StandardPrintTaskOptions.CustomPageRanges)
00178             {
00179                 PrintPageRangeOptionDetails pageRangeOption = (PrintPageRangeOptionDetails)sender.Options[optionId];
00180                 ValidatePageRangeOption(pageRangeOption);
00181             }
00182         }
00183
00184         /// <summary>
00185         /// Deals with validating that the Page Ranges only contain pages that are present in the document.
00186         ///
00187         /// This is not necessary and some apps don't do this validation. Instead, they just ignore the pages
00188         /// that are not present in the document and simply don't print them.
00189         /// </summary>
00190         /// <param name="pageRangeOption">The PrintPageRangeOptionDetails option</param>
00191         void ValidatePageRangeOption(PrintPageRangeOptionDetails pageRangeOption)
00192         {
00193             IList<PrintPageRange> pageRanges = ((IList<PrintPageRange>)pageRangeOption.Value).ToImmutableList();
00194
00195             pageRangeOption.WarningText = "";
00196             pageRangeOption.ErrorText = "";
00197
00198             // An empty list means AllPages, in which case we don't need to check the ranges
00199             if (pageRanges.Count > 0)
00200             {
00201                 lock (printPreviewPages)
00202                 {
00203                     // Verify that the page ranges contain at least one printable page
00204                     bool containsAtLeastOnePrintablePage = false;
00205                     foreach (PrintPageRange pageRange in pageRanges)
00206                     {
00207                         if ((pageRange.FirstPageNumber <= printPreviewPages.Count) || (pageRange.LastPageNumber <= printPreviewPages.Count))
00208                         {
00209                             containsAtLeastOnePrintablePage = true;
00210                             break;
00211                         }
00212                     }
00213
00214                     if (containsAtLeastOnePrintablePage)
00215                     {
00216                         // Warn the user in case one of the page ranges contains pages that will not printed. That way, s/he
00217                         // can fix the page numbers in case they were mistyped.
00218                         foreach (PrintPageRange pageRange in pageRanges)
00219                         {
00220                             if ((pageRange.FirstPageNumber > printPreviewPages.Count) || (pageRange.LastPageNumber > printPreviewPages.Count))
00221                             {
00222                                 pageRangeOption.WarningText = "One of the ranges contains pages that are not present in the document";
00223                                 break;
00224                             }
00225                         }
00226                     }
00227                     else
00228                     {
00229                         pageRangeOption.ErrorText = "Those pages are not present in the document";
00230                     }
00231                 }
00232             }
00233         }
00234     }
00235
00236     /// <summary>
00237     /// Scenario that demonstrates a page range implementation
00238     /// </summary>
00239     public sealed partial class Scenario4PageRange : Page
00240     {
00241         private PageRangePrintHelper printHelper;
00242
00243         public Scenario4PageRange()
00244         {
00245             this.InitializeComponent();
00246         }
00247
00248         /// <summary>
00249         /// This is the click handler for the 'Print' button.
00250         /// </summary>
00251         /// <param name="sender"></param>
00252         /// <param name="e"></param>
00253         private async void OnPrintButtonClick(object sender, RoutedEventArgs e)
00254         {
00255             await printHelper.ShowPrintUIAsync();
00256         }
00257
00258         protected override void OnNavigatedTo(NavigationEventArgs e)
00259         {
00260             if (PrintManager.IsSupported())
00261             {
00262                 // Tell the user how to print
00263                 MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
00264             }
00265             else
00266             {
00267                 // Remove the print button
00268                 InvokePrintingButton.Visibility = Visibility.Collapsed;
00269
00270                 // Inform user that Printing is not supported
00271                 MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);
00272
00273                 // Printing-related event handlers will never be called if printing
00274                 // is not supported, but it's okay to register for them anyway.
00275             }
00276
00277             // Initalize common helper class and register for printing
00278             printHelper = new PageRangePrintHelper(this);
00279             printHelper.RegisterForPrinting();
00280
00281             // Initialize print content for this scenario
00282             printHelper.PreparePrintContent(new PageToPrint());
00283         }
00284
00285         protected override void OnNavigatedFrom(NavigationEventArgs e)
00286         {
00287             if (printHelper != null)
00288             {
00289                 printHelper.UnregisterForPrinting();
00290             }
00291         }
00292     }
00293 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario1_AppBarButtons.xaml.cpp Source File

  • XamlCommanding
  • cpp

Scenario1_AppBarButtons.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_AppBarButtons.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00029
00030 Scenario1_AppBarButtons::Scenario1_AppBarButtons()
00031 {
00032     InitializeComponent();
00033 }
Generated on Fri Nov 15 2024 22:22:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/SourceBufferManager.cs Source File

  • LiveDash
  • cs
  • LiveDash

SourceBufferManager.cs

Go to the documentation of this file.
00001 ﻿using LiveDash.Models;
00002 using LiveDash.Util;
00003 using System;
00004 using System.Collections.Generic;
00005 using System.Linq;
00006 using System.Text;
00007 using System.Threading.Tasks;
00008 using Windows.Foundation;
00009 using Windows.Media.Core;
00010 using Windows.Storage.Streams;
00011 using Windows.Web.Http;
00012
00013 namespace LiveDash
00014 {
00015     /// <summary>
00016     /// Handles the source buffer for each stream of data
00017     /// </summary>
00018     public class SourceBufferManager
00019     {
00020         protected string mimeType;
00021         protected MediaStream stream;
00022         protected MseStreamSource mse;
00023         protected MseSourceBuffer sb;
00024         protected Task<IBuffer> activeDownload = null;
00025         protected bool isEndOfStream = false;
00026         protected bool isInitialized = false;
00027         protected bool internalAppending = false;
00028         protected int segmentCursor = 0;
00029         protected bool isFirstSegment;
00030
00031         protected TimeSpan MaxGap = TimeSpan.FromSeconds(0.1); // seconds
00032         protected TimeSpan MaxBuffering = TimeSpan.FromSeconds(5.0); // seconds
00033
00034         internal SourceBufferManager(string mimeType, MediaStream stream)
00035         {
00036             this.mimeType = mimeType;
00037             this.stream = stream;
00038
00039         }
00040
00041         #region properties
00042         public bool IsEndOfStream
00043         {
00044             get { return isEndOfStream; }
00045
00046             set { isEndOfStream = value; }
00047         }
00048
00049         public bool Appending
00050         {
00051             get { return sb != null ? (sb.IsUpdating || internalAppending) : false; }
00052         }
00053
00054
00055         public bool IsVideo
00056         {
00057             get { return mimeType == Manifest.VideoMimeType; }
00058         }
00059
00060         public bool IsAudio
00061         {
00062             get { return mimeType == Manifest.AudioMimeType; }
00063         }
00064
00065         public MseSourceBuffer MseSourceBuffer
00066         {
00067             get { return sb; }
00068         }
00069
00070         #endregion
00071
00072         internal void Initialize(MseStreamSource mse)
00073         {
00074             this.mse = mse;
00075             sb = this.mse.AddSourceBuffer(mimeType);
00076         }
00077
00078         internal virtual void UpdateData(TimeSpan now)
00079         {
00080             if (sb != null)
00081             {
00082                 SendInitSegment(now);
00083                 CleanBuffer(now);
00084                 SendMediaSegment(now);
00085             }
00086         }
00087
00088         internal void SendInitSegment(TimeSpan now)
00089         {
00090             if (isInitialized || Appending)
00091             {
00092                 return;
00093             }
00094
00095             if (stream.InitSegmentData == null)
00096             {
00097                 if (!stream.isInitSegmentDownloading)
00098                 {
00099                     stream.isInitSegmentDownloading = true;
00100 #if DEBUG
00101                     Logger.Log("Requesting init url " + stream.InitSegmentUrl);
00102 #endif
00103                     ((Task<IBuffer>)Downloader.DownloadBufferAsync(new Uri(stream.InitSegmentUrl))).ContinueWith(
00104                         task =>
00105                         {
00106                             stream.InitSegmentData = task.Result;
00107                             stream.isInitSegmentDownloading = false;
00108                             if (task.Result != null)
00109                             {
00110 #if DEBUG
00111                                 Logger.Log("Init URL downloaded");
00112 #endif
00113                                 UpdateData(now);
00114                             }
00115                         });
00116                 }
00117                 return;
00118             }
00119             isEndOfStream = false;
00120 #if DEBUG
00121             Logger.Log("Appending init segment");
00122 #endif
00123             try
00124             {
00125                 sb.AppendBuffer(stream.InitSegmentData);
00126             }
00127             catch (Exception e)
00128             {
00129 #if DEBUG
00130                 Logger.Log("Append init segment exception HRESULT 0x" + e.HResult.ToString("x"));
00131 #endif
00132             }
00133
00134             isInitialized = true;
00135         }
00136
00137         internal void CleanBuffer(TimeSpan now)
00138         {
00139             try
00140             {
00141                 if (isEndOfStream || Appending)
00142                 {
00143                     return;
00144                 }
00145                 var buffering = sb.Buffered;
00146
00147                 if (buffering.Count > 0)
00148                 {
00149                     // Keep 5 seconds
00150                     if (now - TimeSpan.FromSeconds(10) > buffering[0].Start)
00151                     {
00152                         sb.Remove(buffering[0].Start, now - TimeSpan.FromSeconds(10));
00153                     }
00154                 }
00155             }
00156             catch (Exception e)
00157             {
00158 #if DEBUG
00159                 Logger.Log("Exception occured when cleaning buffer: " + e.Message + Logger.Display(e));
00160 #endif
00161             }
00162         }
00163
00164         protected virtual void SendMediaSegment(TimeSpan now)
00165         {
00166             var end = now;
00167             if (!isInitialized || Appending || isEndOfStream)
00168             {
00169                 return;
00170             }
00171
00172             if (segmentCursor >= this.stream.Segments.Count)
00173             {
00174                 isEndOfStream = true;
00175                 return;
00176             }
00177
00178             foreach (var range in sb.Buffered)
00179             {
00180                 if (range.Start <= end + MaxGap && range.End > end)
00181                 {
00182                     end = range.End;
00183                 }
00184                 else if (range.Start > end)
00185                 {
00186                     break;
00187                 }
00188             }
00189
00190             var stream = this.stream;
00191             var segment = stream.Segments.ElementAt(segmentCursor);
00192             ulong endAdjustedToTimescale = (ulong)end.TotalMilliseconds * stream.SegmentInformation.Timescale / 1000;
00193             if (segment.Timestamp + segment.Duration <= endAdjustedToTimescale)
00194             {
00195                 segmentCursor++;
00196                 SendMediaSegment(now);
00197             }
00198             if (now + MaxBuffering <= end)
00199             {
00200                 return;
00201             }
00202
00203             internalAppending = true;
00204             string url = stream.Segments.ElementAt(segmentCursor).SegmentUrl;
00205 #if DEBUG
00206             Logger.Log("Loading segment url " + url);
00207 #endif
00208
00209             var activeDownload = Downloader.DownloadBufferAsync(new Uri(url));
00210             if (activeDownload == null)
00211             {
00212                 sb.Abort();
00213                 isEndOfStream = true;
00214                 return;
00215             }
00216             this.activeDownload = activeDownload;
00217             activeDownload.ContinueWith(
00218                  task =>
00219                  {
00220                      internalAppending = false;
00221                      if (task.Result != null)
00222                      {
00223                          isEndOfStream = false;
00224                          try
00225                          {
00226                              sb.AppendBuffer(task.Result);
00227                          }
00228                          catch (Exception e)
00229                          {
00230 #if DEBUG
00231                              Logger.Log("Append segment exception HRESULT 0x" + e.HResult.ToString("x"));
00232 #endif
00233                          }
00234                          segmentCursor++;
00235                      }
00236                      else
00237                      {
00238                          if (task.Status != TaskStatus.Canceled)
00239                          {
00240                              // Failed - should send EndOfStream
00241                              sb.Abort();
00242                              isEndOfStream = true;
00243                          }
00244                      }
00245                      this.activeDownload = null;
00246                  });
00247         }
00248
00249         internal void Close()
00250         {
00251             AbortDownload();
00252             isEndOfStream = true;
00253             sb = null;
00254         }
00255
00256         private void AbortDownload()
00257         {
00258             if (activeDownload != null)
00259             {
00260                 if (activeDownload.Status == TaskStatus.RanToCompletion)
00261                 {
00262                     activeDownload.AsAsyncAction().Cancel();
00263                 }
00264             }
00265         }
00266     }
00267 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/BluetoothLEDeviceDisplay.cpp Source File

  • BluetoothLE
  • cppwinrt

BluetoothLEDeviceDisplay.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "BluetoothLEDeviceDisplay.h"
00003 #include "BluetoothLEDeviceDisplay.g.cpp"
00004
00005 using namespace winrt;
00006 using namespace Windows::Foundation;
00007 using namespace Windows::Devices::Enumeration;
00008 using namespace Windows::UI::Xaml::Data;
00009 using namespace Windows::UI::Xaml::Media::Imaging;
00010
00011 namespace winrt::SDKTemplate::implementation
00012 {
00013     BluetoothLEDeviceDisplay::BluetoothLEDeviceDisplay(Windows::Devices::Enumeration::DeviceInformation const& deviceInfoIn)
00014         : m_deviceInformation(deviceInfoIn)
00015     {
00016         UpdateGlyphBitmapImage();
00017     }
00018
00019     bool BluetoothLEDeviceDisplay::LookupBooleanProperty(param::hstring const& property)
00020     {
00021         auto value = m_deviceInformation.Properties().TryLookup(property);
00022         return value && unbox_value<bool>(value);
00023     }
00024
00025     void BluetoothLEDeviceDisplay::Update(DeviceInformationUpdate const& deviceInfoUpdate)
00026     {
00027         m_deviceInformation.Update(deviceInfoUpdate);
00028
00029         OnPropertyChanged(L"Id");
00030         OnPropertyChanged(L"Name");
00031         OnPropertyChanged(L"DeviceInformation");
00032         OnPropertyChanged(L"IsPaired");
00033         OnPropertyChanged(L"IsConnected");
00034         OnPropertyChanged(L"Properties");
00035         OnPropertyChanged(L"IsConnectable");
00036
00037         UpdateGlyphBitmapImage();
00038     }
00039
00040     event_token BluetoothLEDeviceDisplay::PropertyChanged(PropertyChangedEventHandler const& handler)
00041     {
00042         return m_propertyChanged.add(handler);
00043     }
00044
00045     void BluetoothLEDeviceDisplay::PropertyChanged(event_token const& token) noexcept
00046     {
00047         m_propertyChanged.remove(token);
00048     }
00049
00050     void BluetoothLEDeviceDisplay::OnPropertyChanged(param::hstring const& property)
00051     {
00052         m_propertyChanged(*this, PropertyChangedEventArgs(property));
00053     }
00054
00055     fire_and_forget BluetoothLEDeviceDisplay::UpdateGlyphBitmapImage()
00056     {
00057         auto lifetime = get_strong();
00058         BitmapImage glyphBitmapImage;
00059         try
00060         {
00061             DeviceThumbnail deviceThumbnail = co_await m_deviceInformation.GetGlyphThumbnailAsync();
00062             co_await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
00063         }
00064         catch (...)
00065         {
00066             // Something went wrong getting or decoding the device glyph.
00067         }
00068         m_glyphBitmapImage = glyphBitmapImage;
00069         OnPropertyChanged(L"GlyphBitmapImage");
00070     }
00071 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BasicTimer Member List

This is the complete list of members for BasicTimer, including all inherited members.
__pad0__ | BasicTimer | [private]
m_currentTime | BasicTimer | [private]
m_delta | BasicTimer | [private]
m_frequency | BasicTimer | [private]
m_lastTime | BasicTimer | [private]
m_startTime | BasicTimer | [private]
m_total | BasicTimer | [private]
Reset() | BasicTimer | [private]
Reset() | BasicTimer | [private]
Update() | BasicTimer | [private]
Update() | BasicTimer | [private]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario2_Manage.xaml.h Source File

  • PasswordVault
  • cpp

Scenario2_Manage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Manage.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario2_Manage sealed
00021     {
00022     public:
00023         Scenario2_Manage();
00024
00025     internal:
00026         void RetrieveCredentials_Click(Platform::Object^, Platform::Object^);
00027         void RevealPasswords_Click(Platform::Object^, Platform::Object^);
00028         void RemoveCredentials_Click(Platform::Object^, Platform::Object^);
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032
00033         static const int ElementNotFound = (int)0x80070490;
00034     };
00035 }
Generated on Fri Nov 15 2024 22:20:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Ellipse Member List

This is the complete list of members for Ellipse, including all inherited members.
AddChildElement(const std::shared_ptr< BaseElement > &childElement) | BaseElement |
ArrangeElements() | BaseElement | [virtual]
BaseElement() | BaseElement |
Ellipse(FLOAT radiusX, FLOAT radiusY, FLOAT strokeThickness, D2D1::ColorF brushColor) | Ellipse |
GetElementMargin() | BaseElement | [inline]
GetElementSize() | BaseElement | [inline]
GetIgnoreLayout() | BaseElement | [inline]
GetIsRenderPassNeeded() | BaseElement | [inline]
GetIsVisible() | BaseElement | [inline]
Initialize() override | Ellipse | [virtual]
m_brushColor | Ellipse | [private]
m_deviceResources | BaseElement | [protected]
m_elementMargin | BaseElement | [protected]
m_elementSize | BaseElement | [protected]
m_ellipse | Ellipse | [private]
m_ignoreLayout | BaseElement | [protected]
m_isInitialized | BaseElement | [protected]
m_isLayoutHorizontal | BaseElement | [protected]
m_isRenderPassNeeded | BaseElement | [protected]
m_isVisible | BaseElement | [protected]
m_parentTranslation | BaseElement | [protected]
m_radiusX | Ellipse | [private]
m_radiusY | Ellipse | [private]
m_strokeThickness | Ellipse | [private]
m_transformedTranslation | BaseElement | [protected]
m_transformMatrix | BaseElement | [protected]
m_transformRecalculationNeeded | BaseElement | [protected]
m_translation | BaseElement | [protected]
Render() override | Ellipse | [protected, virtual]
SetBrush(ID2D1SolidColorBrush *brush) | BaseElement |
SetElementMargin(ElementMargin margin) | BaseElement | [inline]
SetElementSize(Windows::Foundation::Numerics::float2 size) | BaseElement | [inline]
SetIgnoreLayout(bool ignoreLayout) | BaseElement | [inline]
SetIsVisible(bool visible) | BaseElement |
SetLayoutHorizontal(bool isLayoutHorizontal) | BaseElement | [inline]
SetParentTransform(Windows::Foundation::Numerics::float2 translation) | BaseElement |
SetRadius(FLOAT x, FLOAT y) | Ellipse |
SetTranslation(Windows::Foundation::Numerics::float2 translation) | BaseElement | [virtual]
TryRender() | BaseElement |
Update(const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) | BaseElement | [virtual]
~BaseElement() | BaseElement | [virtual]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_ContinuousDictation Member List

This is the complete list of members for Scenario_ContinuousDictation, including all inherited members.
btnClearText_Click(object sender, RoutedEventArgs e) | Scenario_ContinuousDictation | [inline, private]
cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario_ContinuousDictation | [inline, private]
ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args) | Scenario_ContinuousDictation | [inline, private]
ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args) | Scenario_ContinuousDictation | [inline, private]
ContinuousRecognize_Click(object sender, RoutedEventArgs e) | Scenario_ContinuousDictation | [inline]
dictatedTextBuilder | Scenario_ContinuousDictation | [private]
dictationTextBox_TextChanged(object sender, TextChangedEventArgs e) | Scenario_ContinuousDictation | [inline, private]
HResultPrivacyStatementDeclined | Scenario_ContinuousDictation | [private, static]
InitializeRecognizer(Language recognizerLanguage) | Scenario_ContinuousDictation | [inline, private]
isListening | Scenario_ContinuousDictation | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario_ContinuousDictation | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario_ContinuousDictation | [inline, protected]
openPrivacySettings_Click(Hyperlink sender, HyperlinkClickEventArgs args) | Scenario_ContinuousDictation | [inline, private]
PopulateLanguageDropdown() | Scenario_ContinuousDictation | [inline, private]
rootPage | Scenario_ContinuousDictation | [private]
Scenario_ContinuousDictation() | Scenario_ContinuousDictation | [inline]
speechRecognizer | Scenario_ContinuousDictation | [private]
SpeechRecognizer_HypothesisGenerated(SpeechRecognizer sender, SpeechRecognitionHypothesisGeneratedEventArgs args) | Scenario_ContinuousDictation | [inline, private]
SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) | Scenario_ContinuousDictation | [inline, private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_TimeZone Member List

This is the complete list of members for Scenario5_TimeZone, including all inherited members.
Scenario5_TimeZone() | Scenario5_TimeZone
ShowResults_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_TimeZone
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/pch.cpp Source File

  • DisablingScreenCapture
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceSignals.cpp Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceSignals.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace Microsoft::WRL;
00024 using namespace Platform;
00025 using namespace Windows::Devices::AllJoyn;
00026 using namespace Windows::Foundation;
00027 using namespace com::microsoft::Samples::SecureInterface;
00028
00029 void SecureInterfaceSignals::Initialize(_In_ ISignalEmitter^ emitter)
00030 {
00031     m_emitter = emitter;
00032     alljoyn_busattachment nativeBusAttachment = AllJoynHelpers::GetInternalBusAttachment(m_emitter->BusObject->BusAttachment);
00033     auto interfaceDefinition = alljoyn_busattachment_getinterface(nativeBusAttachment, "com.microsoft.Samples.SecureInterface");
00034     alljoyn_interfacedescription_getmember(interfaceDefinition, "TextSent", &m_memberTextSent);
00035 }
00036
00037 void SecureInterfaceSignals::TextSent(_In_ Platform::String^ interfaceMemberMessage)
00038 {
00039     if (nullptr == AllJoynHelpers::GetInternalBusObject(m_emitter->BusObject))
00040     {
00041         return;
00042     }
00043
00044     size_t argCount = 1;
00045     alljoyn_msgarg arguments = alljoyn_msgarg_array_create(argCount);
00046     (void)TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(arguments, 0), "s", interfaceMemberMessage);
00047
00048     alljoyn_busobject_signal(
00049         AllJoynHelpers::GetInternalBusObject(m_emitter->BusObject),
00050         NULL,  // Generated code only supports broadcast signals.
00051         m_emitter->Session->Id,
00052         m_memberTextSent,
00053         arguments,
00054         argCount,
00055         0, // A signal with a TTL of 0 will be sent to every member of the session, regardless of how long it takes to deliver the message
00056         ALLJOYN_MESSAGE_FLAG_GLOBAL_BROADCAST, // Broadcast to everyone in the session.
00057         NULL); // The generated code does not need the generated signal message
00058
00059     alljoyn_msgarg_destroy(arguments);
00060 }
00061
00062 void SecureInterfaceSignals::CallTextSentReceived(_In_ SecureInterfaceSignals^ sender, _In_ SecureInterfaceTextSentReceivedEventArgs^ args)
00063 {
00064     TextSentReceived(sender, args);
00065 }
00066
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HolographicPaintMain Member List

This is the complete list of members for HolographicPaintMain, including all inherited members.
FindToolIndex(unsigned int sourceId) | HolographicPaintMain | [private]
GetSourceHandler(unsigned int sourceId) | HolographicPaintMain | [inline, private]
HolographicPaintMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | HolographicPaintMain |
m_cameraAddedToken | HolographicPaintMain | [private]
m_cameraRemovedToken | HolographicPaintMain | [private]
m_clearToolIndex | HolographicPaintMain | [private]
m_currentMode | HolographicPaintMain | [private]
m_currentSourceId | HolographicPaintMain | [private]
m_currentToolIndex | HolographicPaintMain | [private]
m_deviceResources | HolographicPaintMain | [private]
m_focusPoint | HolographicPaintMain | [private]
m_holographicSpace | HolographicPaintMain | [private]
m_interactionDetectedToken | HolographicPaintMain | [private]
m_locatabilityChangedToken | HolographicPaintMain | [private]
m_locator | HolographicPaintMain | [private]
m_referenceFrame | HolographicPaintMain | [private]
m_renderingHelper | HolographicPaintMain | [private]
m_sourceDetectedToken | HolographicPaintMain | [private]
m_sourceLostToken | HolographicPaintMain | [private]
m_sourceMap | HolographicPaintMain | [private]
m_sourcePressedToken | HolographicPaintMain | [private]
m_sources | HolographicPaintMain | [private]
m_sourceUpdatedToken | HolographicPaintMain | [private]
m_spatialInteractionManager | HolographicPaintMain | [private]
m_strokes | HolographicPaintMain | [private]
m_timer | HolographicPaintMain | [private]
m_tools | HolographicPaintMain | [private]
m_toolsCarousel | HolographicPaintMain | [private]
m_whiteboard | HolographicPaintMain | [private]
OnCameraAdded(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^args) | HolographicPaintMain | [private]
OnCameraRemoved(Windows::Graphics::Holographic::HolographicSpace^sender, Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^args) | HolographicPaintMain | [private]
OnDeviceLost() | HolographicPaintMain | [virtual]
OnDeviceRestored() | HolographicPaintMain | [virtual]
OnDPadAction(SourceHandler *sender, DPadAction action) override | HolographicPaintMain | [virtual]
OnEnterToolChoice(SourceHandler *sender, Windows::Perception::PerceptionTimestamp^timestamp) override | HolographicPaintMain | [virtual]
OnInteractionDetected(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionDetectedEventArgs^args) | HolographicPaintMain | [private]
OnLocatabilityChanged(Windows::Perception::Spatial::SpatialLocator^sender, Platform::Object^args) | HolographicPaintMain | [private]
OnSelectTool(SourceHandler *sender) override | HolographicPaintMain | [virtual]
OnSourceDetected(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | HolographicPaintMain | [private]
OnSourceLost(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | HolographicPaintMain | [private]
OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | HolographicPaintMain | [private]
OnSourceUpdated(Windows::UI::Input::Spatial::SpatialInteractionManager^sender, Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | HolographicPaintMain | [private]
OnStrokeAdded(SourceHandler *sender, std::shared_ptr< IBaseRenderedObject > stroke) override | HolographicPaintMain | [virtual]
PositionTools(Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, HandAssignment side) | HolographicPaintMain | [private]
Render(Windows::Graphics::Holographic::HolographicFrame^holographicFrame) | HolographicPaintMain |
SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^holographicSpace) | HolographicPaintMain |
SetToolByIndex(unsigned int sourceId, size_t toolIndex) | HolographicPaintMain | [private]
TryGetHandedness(SourceHandler *sender, Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose) | HolographicPaintMain | [private]
UnregisterHolographicEventHandlers() | HolographicPaintMain | [private]
Update() | HolographicPaintMain |
~HolographicPaintMain() | HolographicPaintMain |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DeviceResources.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿
00002 #pragma once
00003
00004 #include "CameraResources.h"
00005 #include <ppltasks.h>
00006
00007 namespace DX
00008 {
00009     typedef enum
00010     {
00011         VertexShader_Simple = 0,
00012         VertexShader_Texture,
00013         VertexShader_Max
00014     } VertexShaderIndex;
00015
00016     typedef enum
00017     {
00018         PixelShader_Simple = 0,
00019         PixelShader_Cursor,
00020         PixelShader_Texture,
00021         PixelShader_Max
00022     } PixelShaderIndex;
00023
00024     typedef enum
00025     {
00026         GeometryShader_Simple = 0,
00027         GeometryShader_Texture,
00028         GeometryShader_Max
00029     } GeometryShaderIndex;
00030
00031     typedef enum
00032     {
00033         Texture_Cursor = 0,
00034         Texture_Init,
00035         Texture_Hologram,
00036         Texture_SysAudio,
00037         Texture_Photo,
00038         Texture_Video,
00039         Texture_Max
00040     } TextureIndex;
00041
00042     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00043     interface IDeviceNotify
00044     {
00045         virtual void OnDeviceLost()     = 0;
00046         virtual void OnDeviceRestored() = 0;
00047     };
00048
00049     // Creates and manages a Direct3D device and immediate context, Direct2D device and context (for debug), and the holographic swap chain.
00050     class DeviceResources
00051     {
00052     public:
00053         DeviceResources();
00054
00055         // Public methods related to Direct3D devices.
00056         void HandleDeviceLost();
00057         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00058         void Trim();
00059         void Present(Windows::Graphics::Holographic::HolographicFrame^ frame);
00060
00061         // Public methods related to holographic devices.
00062         Concurrency::task<void> SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ space);
00063         void EnsureCameraResources(
00064             Windows::Graphics::Holographic::HolographicFrame^ frame,
00065             Windows::Graphics::Holographic::HolographicFramePrediction^ prediction);
00066
00067         void AddHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00068         void RemoveHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00069
00070         // Holographic accessors.
00071         template<typename RetType, typename LCallback>
00072         RetType                 UseHolographicCameraResources(const LCallback& callback);
00073
00074         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^
00075                                 GetD3DInteropDevice() const             { return m_d3dInteropDevice;    }
00076
00077         // D3D accessors.
00078         ID3D11Device4*          GetD3DDevice() const                    { return m_d3dDevice.Get();     }
00079         ID3D11DeviceContext3*   GetD3DDeviceContext() const             { return m_d3dContext.Get();    }
00080         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel;     }
00081         bool                    GetDeviceSupportsVprt() const           { return m_supportsVprt;        }
00082
00083         // DXGI acessors.
00084         IDXGIAdapter3*          GetDXGIAdapter() const                  { return m_dxgiAdapter.Get();   }
00085
00086         // D2D accessors.
00087         ID2D1Factory2*          GetD2DFactory() const                   { return m_d2dFactory.Get();    }
00088         IDWriteFactory2*        GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00089         IWICImagingFactory2*    GetWicImagingFactory() const            { return m_wicFactory.Get();    }
00090
00091         // Shader accessors.
00092         ID3D11VertexShader*     GetVertexShader(const VertexShaderIndex index)      { return m_vertexShaders[index].Get(); }
00093         ID3D11InputLayout*      GetInputLayout(const VertexShaderIndex index)       { return m_inputLayouts[index].Get(); }
00094         ID3D11PixelShader*      GetPixelShader(const PixelShaderIndex index)        { return m_pixelShaders[index].Get(); }
00095         ID3D11GeometryShader*   GetGeometryShader(const GeometryShaderIndex index)  { return m_geometryShaders[index].Get(); }
00096         ID3D11Resource*         GetTexture(const TextureIndex index)                { return m_textures[index].Get(); }
00097
00098     private:
00099         // Private methods related to the Direct3D device, and resources based on that device.
00100         void CreateDeviceIndependentResources();
00101         void InitializeUsingHolographicSpace();
00102         void CreateDeviceResources();
00103         Concurrency::task<void> LoadShaders();
00104
00105         // Direct3D objects.
00106         Microsoft::WRL::ComPtr<ID3D11Device4>                   m_d3dDevice;
00107         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>            m_d3dContext;
00108         Microsoft::WRL::ComPtr<IDXGIAdapter3>                   m_dxgiAdapter;
00109
00110         // Direct3D interop objects.
00111         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^ m_d3dInteropDevice;
00112
00113         // Direct2D factories.
00114         Microsoft::WRL::ComPtr<ID2D1Factory2>                   m_d2dFactory;
00115         Microsoft::WRL::ComPtr<IDWriteFactory2>                 m_dwriteFactory;
00116         Microsoft::WRL::ComPtr<IWICImagingFactory2>             m_wicFactory;
00117
00118         // The holographic space provides a preferred DXGI adapter ID.
00119         Windows::Graphics::Holographic::HolographicSpace^       m_holographicSpace = nullptr;
00120
00121         // Properties of the Direct3D device currently in use.
00122         D3D_FEATURE_LEVEL                                       m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0;
00123
00124         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00125         IDeviceNotify*                                          m_deviceNotify = nullptr;
00126
00127         // Whether or not the current Direct3D device supports the optional feature
00128         // for setting the render target array index from the vertex shader stage.
00129         bool                                                    m_supportsVprt = false;
00130
00131         // Back buffer resources, etc. for attached holographic cameras.
00132         std::map<UINT32, std::unique_ptr<CameraResources>>      m_cameraResources;
00133
00134         // Shader resources
00135         Microsoft::WRL::ComPtr<ID3D11InputLayout>               m_inputLayouts[VertexShader_Max];
00136         Microsoft::WRL::ComPtr<ID3D11VertexShader>              m_vertexShaders[VertexShader_Max];
00137         Microsoft::WRL::ComPtr<ID3D11PixelShader>               m_pixelShaders[PixelShader_Max];
00138         Microsoft::WRL::ComPtr<ID3D11GeometryShader>            m_geometryShaders[GeometryShader_Max];
00139         Microsoft::WRL::ComPtr<ID3D11Resource>                  m_textures[Texture_Max];
00140
00141         std::mutex                                              m_cameraResourcesLock;
00142     };
00143 }
00144
00145 // Device-based resources for holographic cameras are stored in a std::map. Access this list by providing a
00146 // callback to this function, and the std::map will be guarded from add and remove
00147 // events until the callback returns. The callback is processed immediately and must
00148 // not contain any nested calls to UseHolographicCameraResources.
00149 // The callback takes a parameter of type std::map<UINT32, std::unique_ptr<DX::CameraResources>>&
00150 // through which the list of cameras will be accessed.
00151 template<typename RetType, typename LCallback>
00152 RetType DX::DeviceResources::UseHolographicCameraResources(const LCallback& callback)
00153 {
00154     std::lock_guard<std::mutex> guard(m_cameraResourcesLock);
00155     return callback(m_cameraResources);
00156 }
00157
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/SampleConfiguration.cs Source File

  • XamlBottomUpList
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "XAML bottom-up list C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Create a bottom-up list", ClassType=typeof(Scenario1_Basic)},
00025             new Scenario() { Title="Incremental loading", ClassType=typeof(Scenario2_Load)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario1_Message.xaml.cpp Source File

  • CredentialPicker
  • cpp

Scenario1_Message.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_Message.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::Security::Credentials::UI;
00013 using namespace Windows::UI::Xaml;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Controls::Primitives;
00016 using namespace Windows::UI::Xaml::Data;
00017 using namespace Windows::UI::Xaml::Input;
00018 using namespace Windows::UI::Xaml::Media;
00019 using namespace Windows::UI::Xaml::Navigation;
00020
00021 Scenario1_Message::Scenario1_Message()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 void Scenario1_Message::SetResult(CredentialPickerResults^ result)
00027 {
00028     auto domainName = result->CredentialDomainName;
00029     auto userName = result->CredentialUserName;
00030     auto password = result->CredentialPassword;
00031     auto savedByApi = result->CredentialSaved;
00032     auto saveOption = result->CredentialSaveOption;
00033
00034     Status->Text = "OK";
00035     Domain->Text = domainName;
00036     Username->Text = userName;
00037     Password->Text = password;
00038     CredentialSaved->Text = (savedByApi ? "true" : "false");
00039
00040     switch (result->CredentialSaveOption)
00041     {
00042     case Windows::Security::Credentials::UI::CredentialSaveOption::Hidden:
00043         CheckboxState->Text = "Hidden";
00044         break;
00045     case Windows::Security::Credentials::UI::CredentialSaveOption::Selected:
00046         CheckboxState->Text = "Selected";
00047         break;
00048     case Windows::Security::Credentials::UI::CredentialSaveOption::Unselected:
00049         CheckboxState->Text = "Unselected";
00050         break;
00051     }
00052 }
00053
00054 void Scenario1_Message::Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00055 {
00056     if ((Message->Text != nullptr) && (Target->Text != nullptr))
00057     {
00058         create_task(Windows::Security::Credentials::UI::CredentialPicker::PickAsync(Target->Text, Message->Text))
00059             .then([this](CredentialPickerResults^ credPickerResult)
00060         {
00061             auto domainName = credPickerResult->CredentialDomainName;
00062             auto userName = credPickerResult->CredentialUserName;
00063             auto password = credPickerResult->CredentialPassword;
00064             auto savedByApi = credPickerResult->CredentialSaved;
00065             auto saveOption = credPickerResult->CredentialSaveOption;
00066             SetResult(credPickerResult);
00067         });
00068     }
00069 }
00070
Generated on Fri Nov 15 2024 22:19:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario2_Lang.xaml.h Source File

  • GlobalizationPreferences
  • cpp

Scenario2_Lang.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Lang.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario2_Lang sealed
00020     {
00021     public:
00022         Scenario2_Lang();
00023         void ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024
00025     private:
00026         Platform::String^ ReportLanguageData(Windows::Globalization::Language^ lang);
00027     };
00028 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
BeginDownload() | sealed | [static]
BeginDraw() | sealed | [private]
Clear() | sealed | [private]
CreateDeviceResources() | sealed | [private]
DownloadCompleted | sealed | [static]
Draw() | sealed | [private]
DrawText() | sealed | [private]
EndDraw() | sealed | [private]
FontDownloadListener() | sealed |
GetFontNames() | sealed |
Initialize() | sealed | [static]
InvalidateLayout() | sealed |
m_backgroundColor | sealed | [private]
m_d2dContext | sealed | [private]
m_d2dDevice | sealed | [private]
m_d3dDevice | sealed | [private]
m_downloadQueue | sealed | [private]
m_dpi | sealed | [private]
m_dwriteFactory | sealed |
m_fontFamily | sealed |
m_fontNameCollector | sealed |
m_fontSize | sealed |
m_height | sealed |
m_languageTag | sealed |
m_pixelHeight | sealed | [private]
m_pixelWidth | sealed | [private]
m_registeredListener | sealed | [private]
m_suspendEventHandlerRegistrationToken | sealed | [private]
m_text | sealed |
m_textBackgroundBrush | sealed | [private]
m_textBrush | sealed | [private]
m_textLayout | sealed |
m_textLayout | sealed | [private]
m_token | sealed | [private]
m_usedFontNames | sealed |
m_width | sealed |
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
SetTextBackgroundColor(Windows::UI::Color color) | sealed | [private]
SetTextColor(Windows::UI::Color color) | sealed | [private]
TextLayout(Platform::String^text, Platform::String^languageTag, Platform::String^fontFamily, float fontSize, float width) | sealed |
TextLayoutImageSource(TextLayout^textLayout, float dpi) | sealed |
TextLayoutImageSource(TextLayout^textLayout, float dpi, Windows::UI::Color textColor, Windows::UI::Color backgroundColor) | sealed |
~FontDownloadListener() | sealed | [virtual]
~TextLayoutImageSource() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SpellingTextSuggestions Member List

This is the complete list of members for Scenario1_SpellingTextSuggestions, including all inherited members.
Scenario1_SpellingTextSuggestions() Scenario1_SpellingTextSuggestions [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/Tasks/ServicingComplete.cs Source File

  • BackgroundTask
  • cs
  • Tasks

ServicingComplete.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System.Diagnostics;
00012 using System.Threading;
00013 using Windows.ApplicationModel.Background;
00014 using Windows.Storage;
00015
00016 //
00017 // The namespace for the background tasks.
00018 //
00019 namespace Tasks
00020 {
00021     //
00022     // A background task always implements the IBackgroundTask interface.
00023     //
00024     public sealed class ServicingComplete : IBackgroundTask
00025     {
00026         volatile bool _cancelRequested = false;
00027
00028         //
00029         // The Run method is the entry point of a background task.
00030         //
00031         public void Run(IBackgroundTaskInstance taskInstance)
00032         {
00033             Debug.WriteLine("ServicingComplete " + taskInstance.Task.Name + " starting...");
00034
00035             //
00036             // Associate a cancellation handler with the background task.
00037             //
00038             taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
00039
00040             //
00041             // Do background task activity for servicing complete.
00042             //
00043             uint Progress;
00044             for (Progress = 0; Progress <= 100; Progress += 10)
00045             {
00046                 //
00047                 // If the cancellation handler indicated that the task was canceled, stop doing the task.
00048                 //
00049                 if (_cancelRequested)
00050                 {
00051                     break;
00052                 }
00053
00054                 //
00055                 // Indicate progress to foreground application.
00056                 //
00057                 taskInstance.Progress = Progress;
00058             }
00059
00060             var settings = ApplicationData.Current.LocalSettings;
00061             var key = taskInstance.Task.Name;
00062
00063             //
00064             // Write to LocalSettings to indicate that this background task ran.
00065             //
00066             settings.Values[key] = (Progress < 100) ? "Canceled" : "Completed";
00067             Debug.WriteLine("ServicingComplete " + taskInstance.Task.Name + ((Progress < 100) ? " Canceled" : " Completed"));
00068         }
00069
00070         //
00071         // Handles background task cancellation.
00072         //
00073         private void OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
00074         {
00075             //
00076             // Indicate that the background task is canceled.
00077             //
00078             _cancelRequested = true;
00079
00080             Debug.WriteLine("ServicingComplete " + sender.Task.Name + " Cancel Requested...");
00081         }
00082     }
00083 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario2.xaml.cpp Source File

  • XamlContextMenu
  • cpp

Scenario2.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022
00023 Scenario2::Scenario2()
00024 {
00025     InitializeComponent();
00026     AllItems = SampleDataModel::GetSampleData();
00027 }
00028
00029 SampleDataModel^ Scenario2::GetDataModelForCurrentListViewFlyout()
00030 {
00031     // Obtain the ListViewItem for which the user requested a context menu.
00032     auto listViewItem = SharedFlyout->Target;
00033
00034     // Get the data model for the ListViewItem.
00035     return safe_cast<SampleDataModel^>(ItemListView->ItemFromContainer(listViewItem));
00036 }
00037
00038 void Scenario2::OpenMenuItem_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00039 {
00040     SampleDataModel^ model = GetDataModelForCurrentListViewFlyout();
00041     rootPage->NotifyUser("Item: " + model->Title + ", Action: Open", NotifyType::StatusMessage);
00042 }
00043
00044 void Scenario2::PrintMenuItem_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00045 {
00046     SampleDataModel^ model = GetDataModelForCurrentListViewFlyout();
00047     rootPage->NotifyUser("Item: " + model->Title + ", Action: Print", NotifyType::StatusMessage);
00048 }
00049
00050 void Scenario2::DeleteMenuItem_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00051 {
00052     SampleDataModel^ model = GetDataModelForCurrentListViewFlyout();
00053     rootPage->NotifyUser("Item: " + model->Title + ", Action: Delete", NotifyType::StatusMessage);
00054 }
00055
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cpp/Scenario3_CredentialPickerOptions.xaml.h Source File

  • CredentialPicker
  • cpp

Scenario3_CredentialPickerOptions.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario3_CredentialPickerOptions.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario3_CredentialPickerOptions sealed
00012     {
00013     public:
00014         Scenario3_CredentialPickerOptions();
00015     private:
00016         void Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017         void SetResult(Windows::Security::Credentials::UI::CredentialPickerResults^ res);
00018         void SetPasswordExplainVisibility(bool isShown);
00019         void Protocol_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00020     };
00021 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario1_OvenClient.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace Microsoft::SDKSamples::Kitchen;
00013 using namespace SDKTemplate::WRLOutOfProcessWinRTComponent;
00014 using namespace Windows::Foundation;
00015 using namespace Windows::UI::Core;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018
00019 OvenClient::OvenClient()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void OvenClient::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00025 {
00026     Dimensions dimensions;
00027     dimensions.Width = 2;
00028     dimensions.Height = 2;
00029     dimensions.Depth = 2;
00030
00031     // Component Creation
00032     if (!_myOven)
00033     {
00034         _myOven = ref new Oven(dimensions);
00035     }
00036
00037     // Getters and setters are accessed using property syntax
00038     OvenClientOutput->Text += "Oven volume is: " + _myOven->Volume.ToString() + "\n";
00039
00040     // Registering event listeners
00041     _myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler1);
00042     _myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler2);
00043
00044     // C++ projections expose the tokens used to register and remove event handlers
00045     auto eventRegistrationToken = (_myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler3));
00046     _myOven->BreadBaked -= eventRegistrationToken;
00047
00048     // Bake a loaf of bread. This will trigger the BreadBaked event.
00049     _myOven->BakeBread("Sourdough");
00050
00051     // Trigger the event again with a different preheat time
00052     _myOven->ConfigurePreheatTemperature(OvenTemperature::High);
00053     _myOven->BakeBread("Wheat");
00054 }
00055
00056 void OvenClient::BreadCompletedHandler1(Oven^ oven, BreadBakedEventArgs^ args)
00057 {
00058     // Event comes in on a background thread, need to use dispatcher to get to the UI thread.
00059     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00060         ref new DispatchedHandler([this, oven, args]() -> void
00061     {
00062         OvenClientOutput->Text += "Event Handler 1: Invoked\n";
00063         OvenClientOutput->Text += "Event Handler 1: Oven volume is: " + oven->Volume.ToString() + "\n";
00064         OvenClientOutput->Text += "Event Handler 1: Bread flavor is: " + args->Bread->Flavor + "\n";
00065     }));
00066 }
00067
00068 void OvenClient::BreadCompletedHandler2(Oven^ oven, BreadBakedEventArgs^ args)
00069 {
00070     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00071         ref new DispatchedHandler([this, oven, args]() -> void
00072     {
00073         OvenClientOutput->Text += "Event Handler 2: Invoked\n";
00074     }));
00075 }
00076
00077 void OvenClient::BreadCompletedHandler3(Oven^ oven, BreadBakedEventArgs^ args)
00078 {
00079     // Event handler 3 was removed and will not be invoked
00080     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00081         ref new DispatchedHandler([this, oven, args]() -> void
00082     {
00083         OvenClientOutput->Text += "Event Handler 3: Invoked\n";
00084     }));
00085 }
00086
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Content.xaml.h Source File

  • KeyCredentialManager
  • cpp

Content.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002 #pragma once
00003 #include "Content.g.h"
00004 #include "MainPage.xaml.h"
00005 #include "Account.h"
00006
00007 namespace SDKTemplate
00008 {
00009     /// <summary>
00010     /// The main content page for the App that is reached after successful logon.
00011     /// Has the sign-out (Back to user list) and forget me (Remove Account) buttons.
00012     ///
00013     /// Choosing the remove account option calls into the proper APIs to remove the Passport
00014     /// account key if that exists on the machine and unregister it with the server side.
00015     /// </summary>
00016     [Windows::Foundation::Metadata::WebHostHidden]
00017     public ref class Content sealed
00018     {
00019     public:
00020         Content();
00021
00022     protected:
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00024
00025     private:
00026         MainPage^ rootPage;
00027         Account^ m_activeAccount;
00028
00029         void Button_Restart_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void Button_Forget_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void PassportDelete();
00032         bool DeletePassportServerSide();
00033     };
00034 }
Generated on Fri Nov 15 2024 22:20:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario1_BankCards.xaml.cpp Source File

  • MagneticStripeReader
  • cpp

Scenario1_BankCards.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_BankCards.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Devices::PointOfService;
00022 using namespace Windows::Storage::Streams;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032
00033 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00034
00035
00036 Scenario1_BankCards::Scenario1_BankCards()
00037 {
00038     InitializeComponent();
00039     rootPage = MainPage::Current;
00040 }
00041
00042 /// <summary>
00043 /// Creates the default magnetic stripe reader.
00044 /// </summary>
00045 task<void> Scenario1_BankCards::CreateDefaultReaderObject()
00046 {
00047     return create_task(DeviceHelpers::GetFirstMagneticStripeReaderAsync()).then([this](MagneticStripeReader^ reader)
00048     {
00049         delete _reader;
00050         _reader = reader;
00051         if (_reader == nullptr)
00052         {
00053             rootPage->NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType::ErrorMessage);
00054         }
00055     });
00056 }
00057
00058 /// <summary>
00059 /// This method claims the magnetic stripe reader.
00060 /// </summary>
00061 task<void> Scenario1_BankCards::ClaimReader()
00062 {
00063     // claim the magnetic stripe reader
00064     return create_task(_reader->ClaimReaderAsync()).then([this](ClaimedMagneticStripeReader^ claimedReader)
00065     {
00066         delete _claimedReader;
00067         _claimedReader = claimedReader;
00068         if (_claimedReader == nullptr)
00069         {
00070             rootPage->NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType::ErrorMessage);
00071         }
00072     });
00073 }
00074
00075 void Scenario1_BankCards::ScenarioStartReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00076 {
00077     create_task(CreateDefaultReaderObject()).then([this](void)
00078     {
00079         if (_reader != nullptr)
00080         {
00081             // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
00082             create_task(ClaimReader()).then([this](void)
00083             {
00084                 if (_claimedReader)
00085                 {
00086                     // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
00087                     // claim ownsership of the magnetic stripe reader.
00088                     _releaseDeviceRequestedToken = _claimedReader->ReleaseDeviceRequested::add(ref new EventHandler<ClaimedMagneticStripeReader^>(this, &Scenario1_BankCards::OnReleaseDeviceRequested));
00089
00090                     // after successfully claiming and enabling, attach the BankCardDataReceived event handler.
00091                     // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be any useful because the API will not fire the event
00092                     // if the claimedScanner has not beed Enabled
00093                     _bankCardDataReceivedToken = _claimedReader->BankCardDataReceived::add(ref new TypedEventHandler<ClaimedMagneticStripeReader^, MagneticStripeReaderBankCardDataReceivedEventArgs^>(this, &Scenario1_BankCards::OnBankCardDataReceived));
00094
00095                     // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
00096                     _claimedReader->IsDecodeDataEnabled = true;
00097
00098                     create_task(_claimedReader->EnableAsync()).then([this](void)
00099                     {
00100                         rootPage->NotifyUser("Ready to swipe. Device ID: " + _claimedReader->DeviceId, NotifyType::StatusMessage);
00101
00102                         // reset the button state
00103                         ScenarioEndReadButton->IsEnabled = true;
00104                         ScenarioStartReadButton->IsEnabled = false;
00105                     });
00106                 }
00107             });
00108         }
00109     });
00110 }
00111
00112 /// <summary>
00113 /// Event handler for End button
00114 /// </summary>
00115 /// <param name="sender"></param>
00116 /// <param name="e"></param>
00117 void Scenario1_BankCards::ScenarioEndReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00118 {
00119     ResetTheScenarioState();
00120 }
00121
00122 /// <summary>
00123 /// Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application
00124 /// </summary>
00125 /// <param name="sender"></param>
00126 /// <param name="args"> Contains the ClaimedMagneticStripeReader that is sending this request</param>
00127 void Scenario1_BankCards::OnReleaseDeviceRequested(Platform::Object ^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader ^args)
00128 {
00129     // let us retain the device always. If it is not retained, this exclusive claim will be lost.
00130     args->RetainDevice();
00131 }
00132
00133 /// <summary>
00134 /// Event handler for the BankCardDataReceived event fired when a bank card is read by the magnetic stripe reader
00135 /// </summary>
00136 /// <param name="sender"></param>
00137 /// <param name="args"> Contains the MagneticStripeReaderBankCardDataReceivedEventArgs which contains the data obtained in the swipe</param>
00138 void Scenario1_BankCards::OnBankCardDataReceived(Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderBankCardDataReceivedEventArgs^args)
00139 {
00140     // read the data and display
00141     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00142         [this, args]()
00143     {
00144         rootPage->NotifyUser("Got data.", NotifyType::StatusMessage);
00145
00146         ScenarioOutputAccountNumber->Text = args->AccountNumber;
00147         ScenarioOutputExpirationDate->Text = args->ExpirationDate;
00148         ScenarioOutputFirstName->Text = args->FirstName;
00149         ScenarioOutputMiddleInitial->Text = args->MiddleInitial;
00150         ScenarioOutputServiceCode->Text = args->ServiceCode;
00151         ScenarioOutputSuffix->Text = args->Suffix;
00152         ScenarioOutputSurname->Text = args->Surname;
00153         ScenarioOutputTitle->Text = args->Title;
00154     }));
00155
00156 }
00157
00158 /// <summary>
00159 /// Invoked when this page is about to be displayed in a Frame.
00160 /// </summary>
00161 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00162 /// property is typically used to configure the page.</param>
00163 void Scenario1_BankCards::OnNavigatedTo(NavigationEventArgs^ e)
00164 {
00165     ResetTheScenarioState();
00166     Page::OnNavigatedTo(e);
00167 }
00168
00169 /// <summary>
00170 /// Invoked when this page is no longer displayed.
00171 /// </summary>
00172 /// <param name="e"></param>
00173 void Scenario1_BankCards::OnNavigatedFrom(NavigationEventArgs^ e)
00174 {
00175     ResetTheScenarioState();
00176     Page::OnNavigatedFrom(e);
00177 }
00178
00179 /// <summary>
00180 /// Reset the Scenario state
00181 /// </summary>
00182 void Scenario1_BankCards::ResetTheScenarioState()
00183 {
00184     if (_claimedReader != nullptr)
00185     {
00186         // Detach the datareceived event handler and releasedevicerequested event handler
00187         _claimedReader->BankCardDataReceived::remove(_bankCardDataReceivedToken);
00188         _claimedReader->ReleaseDeviceRequested::remove(_releaseDeviceRequestedToken);
00189
00190         // release the Claimed Magnetic Stripe Reader and set to null
00191         delete _claimedReader;
00192         _claimedReader = nullptr;
00193     }
00194
00195     if (_reader != nullptr)
00196     {
00197         // release the Magnetic Stripe Reader and set to null
00198         delete _reader;
00199         _reader = nullptr;
00200     }
00201
00202     // Reset the strings in the UI
00203     rootPage->NotifyUser("Click the Start Receiving Data Button.", NotifyType::StatusMessage);
00204
00205     ScenarioOutputAccountNumber->Text = "No data";
00206     ScenarioOutputExpirationDate->Text = "No data";
00207     ScenarioOutputFirstName->Text = "No data";
00208     ScenarioOutputMiddleInitial->Text = "No data";
00209     ScenarioOutputServiceCode->Text = "No data";
00210     ScenarioOutputSuffix->Text = "No data";
00211     ScenarioOutputSurname->Text = "No data";
00212     ScenarioOutputTitle->Text = "No data";
00213
00214     // reset the button state
00215     ScenarioEndReadButton->IsEnabled = false;
00216     ScenarioStartReadButton->IsEnabled = true;
00217 }
Generated on Fri Nov 15 2024 22:20:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario1_GetAndSetPin.cpp Source File

  • IoT-GPIO
  • cppwinrt

Scenario1_GetAndSetPin.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_GetAndSetPin.h"
00014 #include "Scenario1_GetAndSetPin.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Devices::Gpio;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_GetAndSetPin::Scenario1_GetAndSetPin()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario1_GetAndSetPin::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&)
00030     {
00031         StopScenario();
00032     }
00033
00034     void Scenario1_GetAndSetPin::StartScenario()
00035     {
00036         GpioController gpio = GpioController::GetDefault();
00037
00038         // Set up our GPIO pin for setting values.
00039         // If this next line crashes with a NullReferenceException,
00040         // then the problem is that there is no GPIO controller on the device.
00041         pin = gpio.OpenPin(LED_PIN);
00042
00043         // Configure pin for output.
00044         pin.SetDriveMode(GpioPinDriveMode::Output);
00045     }
00046
00047     void Scenario1_GetAndSetPin::StopScenario()
00048     {
00049         // Release the GPIO pin.
00050         if (pin != nullptr)
00051         {
00052             pin.Close();
00053             pin = nullptr;
00054         }
00055     }
00056
00057     void Scenario1_GetAndSetPin::StartStopScenario_Click(IInspectable const&, RoutedEventArgs const&)
00058     {
00059         if (pin != nullptr)
00060         {
00061             StopScenario();
00062             StartStopButton().Content(box_value(L"Start"));
00063             ScenarioControls().Visibility(Visibility::Collapsed);
00064         }
00065         else
00066         {
00067             StartScenario();
00068             StartStopButton().Content(box_value(L"Stop"));
00069             ScenarioControls().Visibility(Visibility::Visible);
00070         }
00071     }
00072
00073     void Scenario1_GetAndSetPin::SetPinHigh_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         // Set the pin value to High.
00076         pin.Write(GpioPinValue::High);
00077     }
00078
00079     void Scenario1_GetAndSetPin::SetPinLow_Click(IInspectable const&, RoutedEventArgs const&)
00080     {
00081         // Set the pin value to Low.
00082         pin.Write(GpioPinValue::Low);
00083     }
00084
00085     void Scenario1_GetAndSetPin::GetPinValue_Click(IInspectable const&, RoutedEventArgs const&)
00086     {
00087         // Change the GUI to reflect the current pin value.
00088         CurrentPinValue().Text(PinValueToString(pin.Read()));
00089     }
00090
00091 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/CustomDecay.cpp Source File

  • SpatialSound
  • cpp

CustomDecay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014
00015 _Use_decl_annotations_
00016 HRESULT CustomDecaySound::Initialize(LPCWSTR filename)
00017 {
00018     auto hr = _audioFile.Initialize(filename);
00019
00020     ComPtr<IXAPO> xapo;
00021     if (SUCCEEDED(hr))
00022     {
00023         HrtfDistanceDecay customDecay;
00024         customDecay.type                = HrtfDistanceDecayType::CustomDecay;       // Custom decay behavior, we'll pass in the gain value on every frame.
00025         customDecay.maxGain             = 0;                                        // 0dB max gain
00026         customDecay.minGain             = -96.0f;                                   // -96dB min gain
00027         customDecay.unityGainDistance   = HRTF_DEFAULT_UNITY_GAIN_DISTANCE;         // Default unity gain distance
00028         customDecay.cutoffDistance      = HRTF_DEFAULT_CUTOFF_DISTANCE;             // Default cutoff distance
00029
00030         // Setting the directivity to nullptr specifies omnidirectional sound.
00031         HrtfApoInit init;
00032         init.directivity = nullptr;
00033         init.distanceDecay = &customDecay;
00034
00035         // CreateHrtfApo will fail with E_NOTIMPL on unsupported platforms.
00036         hr = CreateHrtfApo(&init, &xapo);
00037     }
00038
00039     if (SUCCEEDED(hr))
00040     {
00041         hr = xapo.As(&_hrtfParams);
00042     }
00043
00044     // Set the default environment.
00045     if (SUCCEEDED(hr))
00046     {
00047         hr = _hrtfParams->SetEnvironment(_environment);
00048     }
00049
00050     // Initialize an XAudio2 graph that hosts the HRTF xAPO.
00051     // The source voice is used to submit audio data and control playback.
00052     if (SUCCEEDED(hr))
00053     {
00054         hr = SetupXAudio2(_audioFile.GetFormat(), xapo.Get(), &_xaudio2, &_sourceVoice);
00055     }
00056
00057     // Submit audio data to the source voice
00058     if (SUCCEEDED(hr))
00059     {
00060         XAUDIO2_BUFFER buffer{};
00061         buffer.AudioBytes = static_cast<UINT32>(_audioFile.GetSize());
00062         buffer.pAudioData = _audioFile.GetData();
00063         buffer.LoopCount = XAUDIO2_LOOP_INFINITE;
00064         hr = _sourceVoice->SubmitSourceBuffer(&buffer);
00065     }
00066     return hr;
00067 }
00068
00069 CustomDecaySound::~CustomDecaySound()
00070 {
00071     if (_sourceVoice)
00072     {
00073         _sourceVoice->DestroyVoice();
00074     }
00075 }
00076
00077 HRESULT CustomDecaySound::Start()
00078 {
00079     return _sourceVoice->Start();
00080 }
00081
00082 HRESULT CustomDecaySound::Stop()
00083 {
00084     return _sourceVoice->Stop();
00085 }
00086
00087 _Use_decl_annotations_
00088 HRESULT CustomDecaySound::SetEnvironment(HrtfEnvironment environment)
00089 {
00090     return _hrtfParams->SetEnvironment(environment);
00091 }
00092
00093 // Called on every world update tick
00094 _Use_decl_annotations_
00095 HRESULT CustomDecaySound::OnUpdate(float x, float y, float z)
00096 {
00097     auto hr = S_OK;
00098     if (_hrtfParams)
00099     {
00100         auto position = HrtfPosition{ x, y, z };
00101         hr = _hrtfParams->SetSourcePosition(&position);
00102         if (SUCCEEDED(hr))
00103         {
00104             // Calculate the total distance between the listener and the source
00105             auto distance = sqrt(x*x + y*y + z*z);
00106             // If the source is closer than 6m apply gain based on the distance,
00107             // If the source is beyond 6m, attenuate by -12dB,
00108             // If the source is beyond 9m, attenuate by -96dB (silent).
00109             auto gain = distance <= 6.0f ? (0 - (2 * distance)) : (distance > 6.0f && distance <= 9.0f) ? -12.0f : -96.0f;
00110             hr = _hrtfParams->SetSourceGain(gain);
00111         }
00112     }
00113     return hr;
00114 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeScannerProvider/SampleConfiguration.cs Source File

  • BarcodeScannerProvider
  • cs
  • BarcodeScannerProvider

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Barcode Scanner Provider";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Decoder configuration", ClassType = typeof(Scenario1_Configuration) }
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/StreamResolutionHelper.h Source File

  • CameraResolution
  • cpp

StreamResolutionHelper.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     ref class StreamResolutionHelper sealed
00017     {
00018     public:
00019         StreamResolutionHelper(Windows::Media::MediaProperties::IMediaEncodingProperties^ encodingProperties);
00020
00021         Platform::String^ GetFriendlyName(bool showFrameRate = true);
00022
00023         unsigned int Width();
00024         unsigned int Height();
00025         unsigned int FrameRate();
00026         double AspectRatio();
00027
00028     private:
00029         Windows::Media::MediaProperties::IMediaEncodingProperties^ _encodingProperties;
00030         Platform::String^ _type;
00031
00032         Platform::String^ IMAGE_ENCODING_STRING;
00033         Platform::String^ VIDEO_ENCODING_STRING;
00034     };
00035 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ConnectDisconnect Member List

This is the complete list of members for Scenario1_ConnectDisconnect, including all inherited members.
AddDeviceToList(DeviceInformation deviceInformation, String deviceSelector) | Scenario1_ConnectDisconnect | [inline, private]
AddDeviceWatcher(DeviceWatcher deviceWatcher, String deviceSelector) | Scenario1_ConnectDisconnect | [inline, private]
appResumeEventHandler | Scenario1_ConnectDisconnect | [private]
appSuspendEventHandler | Scenario1_ConnectDisconnect | [private]
ButtonNameDisableReconnectToDevice | Scenario1_ConnectDisconnect | [private]
ButtonNameDisconnectFromDevice | Scenario1_ConnectDisconnect | [private]
ClearDeviceEntries() | Scenario1_ConnectDisconnect | [inline, private]
ConnectToDevice_Click(Object sender, RoutedEventArgs eventArgs) | Scenario1_ConnectDisconnect | [inline, private]
DisconnectFromDevice_Click(Object sender, RoutedEventArgs eventArgs) | Scenario1_ConnectDisconnect | [inline, private]
FindDevice(String deviceId) | Scenario1_ConnectDisconnect | [inline, private]
InitializeDeviceWatchers() | Scenario1_ConnectDisconnect | [inline, private]
InitializeOsrFx2DeviceWatcher() | Scenario1_ConnectDisconnect | [inline, private]
InitializeSuperMuttDeviceWatcher() | Scenario1_ConnectDisconnect | [inline, private]
isAllDevicesEnumerated | Scenario1_ConnectDisconnect | [private]
listOfDevices | Scenario1_ConnectDisconnect | [private]
mapDeviceWatchersToDeviceSelector | Scenario1_ConnectDisconnect | [private]
OnAppResume(Object sender, Object args) | Scenario1_ConnectDisconnect | [inline, private]
OnAppSuspension(Object sender, SuspendingEventArgs args) | Scenario1_ConnectDisconnect | [inline, private]
OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInformation) | Scenario1_ConnectDisconnect | [inline, private]
OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation) | Scenario1_ConnectDisconnect | [inline, private]
OnDeviceConnected(EventHandlerForDevice sender, DeviceInformation deviceInformation) | Scenario1_ConnectDisconnect | [inline, private]
OnDeviceEnumerationComplete(DeviceWatcher sender, Object args) | Scenario1_ConnectDisconnect | [inline, private]
OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate) | Scenario1_ConnectDisconnect | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | Scenario1_ConnectDisconnect | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario1_ConnectDisconnect | [inline, protected]
RemoveDeviceFromList(String deviceId) | Scenario1_ConnectDisconnect | [inline, private]
rootPage | Scenario1_ConnectDisconnect | [private]
Scenario1_ConnectDisconnect() | Scenario1_ConnectDisconnect | [inline]
SelectDeviceInList(String deviceIdToSelect) | Scenario1_ConnectDisconnect | [inline, private]
StartDeviceWatchers() | Scenario1_ConnectDisconnect | [inline, private]
StartHandlingAppEvents() | Scenario1_ConnectDisconnect | [inline, private]
StopDeviceWatchers() | Scenario1_ConnectDisconnect | [inline, private]
StopHandlingAppEvents() | Scenario1_ConnectDisconnect | [inline, private]
UpdateConnectDisconnectButtonsAndList(Boolean enableConnectButton) | Scenario1_ConnectDisconnect | [inline, private]
watchersStarted | Scenario1_ConnectDisconnect | [private]
watchersSuspended | Scenario1_ConnectDisconnect | [private]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario11_CPDNoUI Member List

This is the complete list of members for Scenario11_CPDNoUI, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario11_CPDNoUI | [inline, protected]
rootPage | Scenario11_CPDNoUI | [private]
Scenario11_CPDNoUI() | Scenario11_CPDNoUI | [inline]
Set_ClipboardNoUI(object sender, TextControlPasteEventArgs e) | Scenario11_CPDNoUI | [inline, private]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_MessageCaption Member List

This is the complete list of members for Scenario2_MessageCaption, including all inherited members.
Launch_Click(object sender, RoutedEventArgs e) | Scenario2_MessageCaption | [inline, private]
rootPage | Scenario2_MessageCaption | [private]
Scenario2_MessageCaption() | Scenario2_MessageCaption | [inline]
SetError(string err) | Scenario2_MessageCaption | [inline, private]
SetResult(CredentialPickerResults res) | Scenario2_MessageCaption | [inline, private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario5_XSLTTransform.xaml.cs Source File

  • XmlDocument
  • cs

Scenario5_XSLTTransform.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using Windows.UI.Xaml.Media;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace Xml
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class XSLTTransform : Page
00027     {
00028         private MainPage rootPage;
00029
00030         public XSLTTransform()
00031         {
00032             this.InitializeComponent();
00033
00034             Scenario5Init();
00035         }
00036
00037         /// <summary>
00038         /// Invoked when this page is about to be displayed in a Frame.
00039         /// </summary>
00040         /// <param name="e">Event data that describes how this page was reached. The Parameter
00041         /// property is typically used to configure the page.</param>
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             rootPage = MainPage.Current;
00045         }
00046
00047         async void XsltInit()
00048         {
00049             try
00050             {
00051                 Windows.Storage.StorageFolder storageFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("xsltTransform");
00052                 Windows.Storage.StorageFile xmlFile = await storageFolder.GetFileAsync("xmlContent.xml");
00053                 Windows.Storage.StorageFile xsltFile = await storageFolder.GetFileAsync("xslContent.xml");
00054
00055                 // load xml file
00056                 Windows.Data.Xml.Dom.XmlDocument doc = await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(xmlFile);
00057                 Scenario.RichEditBoxSetMsg(scenario5Xml, doc.GetXml(), false);
00058
00059                 // load xslt file
00060                 doc = await Windows.Data.Xml.Dom.XmlDocument.LoadFromFileAsync(xsltFile);
00061
00062                 // Display xml and xslt file content in the input fields
00063                 Scenario.RichEditBoxSetMsg(scenario5Xslt, doc.GetXml(), false);
00064                 Scenario.RichEditBoxSetMsg(scenario5Result, "", true);
00065             }
00066             catch (Exception exp)
00067             {
00068                 Scenario.RichEditBoxSetMsg(scenario5Xml, "", false);
00069                 Scenario.RichEditBoxSetMsg(scenario5Xslt, "", false);
00070                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00071                 rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
00072             }
00073         }
00074
00075         void Scenario5Init()
00076         {
00077             XsltInit();
00078         }
00079
00080         /// <summary>
00081         /// This is the click handler for the 'Scenario5BtnTransformToString' button.
00082         /// </summary>
00083         /// <param name="sender"></param>
00084         /// <param name="e"></param>
00085         private void Scenario5BtnTransformToString_Click(object sender, RoutedEventArgs e)
00086         {
00087             scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
00088             scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
00089             Scenario.RichEditBoxSetMsg(scenario5Result, "", true);
00090
00091             Windows.Data.Xml.Dom.XmlDocument doc;
00092             Windows.Data.Xml.Dom.XmlDocument xsltDoc;
00093             String xml;
00094             String xslt;
00095
00096             // Get xml content from xml input field
00097             scenario5Xml.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
00098
00099             // Get xslt content from xslt input field
00100             scenario5Xslt.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xslt);
00101
00102             if (null == xml || "" == xml.Trim())
00103             {
00104                 Scenario.RichEditBoxSetError(scenario5Result, "Source XML can't be empty");
00105                 return;
00106             }
00107
00108             if (null == xslt || "" == xslt.Trim())
00109             {
00110                 Scenario.RichEditBoxSetError(scenario5Result, "XSL content can't be empty");
00111                 return;
00112             }
00113
00114             try
00115             {
00116                 // Load xml content
00117                 doc = new Windows.Data.Xml.Dom.XmlDocument();
00118                 doc.LoadXml(xml);
00119             }
00120             catch (Exception exp)
00121             {
00122                 scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
00123                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00124                 return;
00125             }
00126
00127             try
00128             {
00129                 // Load xslt content
00130                 xsltDoc = new Windows.Data.Xml.Dom.XmlDocument();
00131                 xsltDoc.LoadXml(xslt);
00132             }
00133             catch (Exception exp)
00134             {
00135                 scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
00136                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00137                 return;
00138             }
00139
00140             try
00141             {
00142                 // Transform xml according to the style sheet declaration specified in xslt file
00143                 var xsltProcessor = new Windows.Data.Xml.Xsl.XsltProcessor(xsltDoc);
00144                 String transformedStr = xsltProcessor.TransformToString(doc);
00145                 Scenario.RichEditBoxSetMsg(scenario5Result, transformedStr, true);
00146             }
00147             catch (Exception exp)
00148             {
00149                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00150                 return;
00151             }
00152         }
00153
00154
00155         /// <summary>
00156         /// This is the click handler for the 'Scenario5BtnTransformToDocument' button.
00157         /// </summary>
00158         /// <param name="sender"></param>
00159         /// <param name="e"></param>
00160         private async void Scenario5BtnTransformToDocument_Click(object sender, RoutedEventArgs e)
00161         {
00162             scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
00163             scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
00164             Scenario.RichEditBoxSetMsg(scenario5Result, "", true);
00165
00166             Windows.Data.Xml.Dom.XmlDocument doc;
00167             Windows.Data.Xml.Dom.XmlDocument xsltDoc;
00168             String xml;
00169             String xslt;
00170
00171             // Get xml content from xml input field
00172             scenario5Xml.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
00173
00174             // Get xslt content from xslt input field
00175             scenario5Xslt.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xslt);
00176
00177             if (null == xml || "" == xml.Trim())
00178             {
00179                 Scenario.RichEditBoxSetError(scenario5Result, "Source XML can't be empty");
00180                 return;
00181             }
00182
00183             if (null == xslt || "" == xslt.Trim())
00184             {
00185                 Scenario.RichEditBoxSetError(scenario5Result, "XSL content can't be empty");
00186                 return;
00187             }
00188
00189             try
00190             {
00191                 // Load xml content
00192                 doc = new Windows.Data.Xml.Dom.XmlDocument();
00193                 doc.LoadXml(xml);
00194             }
00195             catch (Exception exp)
00196             {
00197                 scenario5Xml.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
00198                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00199                 return;
00200             }
00201
00202             try
00203             {
00204                 // Load xslt content
00205                 xsltDoc = new Windows.Data.Xml.Dom.XmlDocument();
00206                 xsltDoc.LoadXml(xslt);
00207             }
00208             catch (Exception exp)
00209             {
00210                 scenario5Xslt.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
00211                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00212                 return;
00213             }
00214
00215             try
00216             {
00217                 // Transform xml according to the style sheet declaration specified in xslt file
00218                 var xsltProcessor = new Windows.Data.Xml.Xsl.XsltProcessor(xsltDoc);
00219                 Windows.Data.Xml.Dom.XmlDocument transformedDocument = xsltProcessor.TransformToDocument(doc);
00220
00221                 Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00222                 Windows.Storage.StorageFile xmlFile = await storageFolder.CreateFileAsync("transformed.xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);
00223                 await transformedDocument.SaveToFileAsync(xmlFile);
00224                 Scenario.RichEditBoxSetMsg(scenario5Result, string.Format("The result has been saved to: \n" + xmlFile.Path), true);
00225             }
00226             catch (Exception exp)
00227             {
00228                 Scenario.RichEditBoxSetError(scenario5Result, exp.Message);
00229                 return;
00230             }
00231         }
00232     }
00233 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/App.h Source File

  • Simple3DGameDX
  • cpp

App.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "DeviceResources.h"
00015 #include "GameMain.h"
00016
00017 namespace Simple3DGameDX
00018 {
00019     ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
00020     {
00021     public:
00022         App();
00023
00024         // IFrameworkView Methods
00025         virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
00026         virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
00027         virtual void Load(Platform::String^ entryPoint);
00028         virtual void Run();
00029         virtual void Uninitialize();
00030
00031     protected:
00032         // Application lifecycle event handlers.
00033         void OnActivated(
00034             Windows::ApplicationModel::Core::CoreApplicationView^ applicationView,
00035             Windows::ApplicationModel::Activation::IActivatedEventArgs^ args
00036             );
00037         void OnSuspending(
00038             Platform::Object^ sender,
00039             Windows::ApplicationModel::SuspendingEventArgs^ args
00040             );
00041         void OnResuming(
00042             Platform::Object^ sender,
00043             Platform::Object^ args
00044             );
00045
00046         // Window event handlers.
00047         void OnWindowSizeChanged(
00048             Windows::UI::Core::CoreWindow^ sender,
00049             Windows::UI::Core::WindowSizeChangedEventArgs^ args
00050             );
00051         void OnVisibilityChanged(
00052             Windows::UI::Core::CoreWindow^ sender,
00053             Windows::UI::Core::VisibilityChangedEventArgs^ args
00054             );
00055         void OnWindowClosed(
00056             Windows::UI::Core::CoreWindow^ sender,
00057             Windows::UI::Core::CoreWindowEventArgs^ args
00058             );
00059         void OnWindowActivationChanged(
00060             Windows::UI::Core::CoreWindow^ sender,
00061             Windows::UI::Core::WindowActivatedEventArgs^ args
00062             );
00063
00064         // DisplayInformation event handlers.
00065         void OnDpiChanged(
00066             Windows::Graphics::Display::DisplayInformation^ sender,
00067             Platform::Object^ args
00068             );
00069         void OnOrientationChanged(
00070             Windows::Graphics::Display::DisplayInformation^ sender,
00071             Platform::Object^ args
00072             );
00073         void OnDisplayContentsInvalidated( Windows::Graphics::Display::DisplayInformation^ sender,
00074             Platform::Object^ args
00075             );
00076         void OnStereoEnabledChanged(
00077             Windows::Graphics::Display::DisplayInformation^ sender,
00078             Platform::Object^ args
00079             );
00080
00081     private:
00082         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00083         std::unique_ptr<GameMain> m_main;
00084     };
00085 };
00086
00087 ref class DirectXApplicationSource : Windows::ApplicationModel::Core::IFrameworkViewSource
00088 {
00089 public:
00090     virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
00091 };
00092
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_RequestConsent Member List

This is the complete list of members for Scenario2_RequestConsent, including all inherited members.
RequestConsent_Click(object sender, RoutedEventArgs e) | Scenario2_RequestConsent | [inline, private]
rootPage | Scenario2_RequestConsent | [private]
Scenario2_RequestConsent() | Scenario2_RequestConsent | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/Common/CalendarConverter.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • Common

CalendarConverter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "CalendarConverter.h"
00013
00014 using namespace AdventureWorks;
00015
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::DateTimeFormatting;
00020 using namespace Windows::UI::Xaml::Data;
00021 using namespace Windows::UI::Xaml::Interop;
00022
00023 CalendarConverter::CalendarConverter()
00024 {
00025 }
00026
00027 Object ^ CalendarConverter::Convert(Object ^value, TypeName targetType, Object ^parameter, String ^language)
00028 {
00029     Calendar^ cal = dynamic_cast<Calendar^>(value);
00030     if (cal != nullptr)
00031     {
00032         return cal->GetDateTime();
00033     }
00034
00035     return nullptr;
00036 }
00037
00038 Object ^ CalendarConverter::ConvertBack(Object ^value, TypeName targetType, Object ^parameter, String ^language)
00039 {
00040     DateTime dt = (DateTime)value;
00041
00042     Calendar^ cal = ref new Calendar();
00043     cal->SetDateTime(dt);
00044
00045     return cal;
00046 }
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.h Source File

  • MagneticStripeReader
  • cpp

Scenario2_AamvaCards.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_AamvaCards.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Demonstrate how to use read AAMVA cards with MagneticStripeReader
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2_AamvaCards sealed
00024     {
00025     public:
00026         Scenario2_AamvaCards();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         MainPage^ rootPage;
00034         Windows::Devices::PointOfService::MagneticStripeReader^ _reader;
00035         Windows::Devices::PointOfService::ClaimedMagneticStripeReader^ _claimedReader;
00036         Windows::Foundation::EventRegistrationToken _aamvaCardDataReceivedToken;
00037         Windows::Foundation::EventRegistrationToken _releaseDeviceRequestedToken;
00038
00039         void ScenarioStartReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void ScenarioEndReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041
00042         Concurrency::task<void> CreateDefaultReaderObject();
00043         Concurrency::task<void> ClaimReader();
00044         void ResetTheScenarioState();
00045
00046         void OnReleaseDeviceRequested(Platform::Object ^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader ^args);
00047
00048         void OnAamvaCardDataReceived(Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderAamvaCardDataReceivedEventArgs^args);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:20:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Converters/TypeToUIElementConverter.cs Source File

  • Notifications
  • cs
  • Notifications
  • Converters

TypeToUIElementConverter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Xaml.Data;
00003
00004 namespace Notifications.Converters
00005 {
00006     public class TypeToUIElementConverter : IValueConverter
00007     {
00008         public object Convert(object value, Type targetType, object parameter, string language)
00009         {
00010             if (value is Type)
00011             {
00012                 return Activator.CreateInstance(value as Type);
00013             }
00014
00015             return value;
00016         }
00017
00018         public object ConvertBack(object value, Type targetType, object parameter, string language)
00019         {
00020             throw new NotImplementedException();
00021         }
00022     }
00023 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/RippleEffect.cpp Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

RippleEffect.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <initguid.h>
00014 #include "RippleEffect.h"
00015 #include "BasicReaderWriter.h"
00016
00017 #define XML(X) TEXT(#X)
00018
00019 RippleEffect::RippleEffect() :
00020     m_refCount(1)
00021 {
00022     m_constants.amplitude = 0;
00023     m_constants.center = D2D1::Point2F(0, 0);
00024     m_constants.frequency = 0;
00025     m_constants.phase = 0;
00026     m_constants.spread = 0;
00027 }
00028
00029 HRESULT __stdcall RippleEffect::CreateRippleImpl(_Outptr_ IUnknown** ppEffectImpl)
00030 {
00031     // Since the object's refcount is initialized to 1, we don't need to AddRef here.
00032     *ppEffectImpl = static_cast<ID2D1EffectImpl*>(new (std::nothrow) RippleEffect());
00033
00034     if (*ppEffectImpl == nullptr)
00035     {
00036         return E_OUTOFMEMORY;
00037     }
00038     else
00039     {
00040         return S_OK;
00041     }
00042 }
00043
00044 HRESULT RippleEffect::Register(_In_ ID2D1Factory1* pFactory)
00045 {
00046     // The inspectable metadata of an effect is defined in XML. This can be passed in from an external source
00047     // as well, however for simplicity we just inline the XML.
00048     PCWSTR pszXml =
00049         XML(
00050             <?xml version='1.0'?>
00051             <Effect>
00052                 <!-- System Properties -->
00053                 <Property name='DisplayName' type='string' value='Ripple'/>
00054                 <Property name='Author' type='string' value='Microsoft Corporation'/>
00055                 <Property name='Category' type='string' value='Stylize'/>
00056                 <Property name='Description' type='string' value='Adds a ripple effect that can be animated'/>
00057                 <Inputs>
00058                     <Input name='Source'/>
00059                 </Inputs>
00060                 <!-- Custom Properties go here -->
00061                 <Property name='Frequency' type='float'>
00062                     <Property name='DisplayName' type='string' value='Frequency'/>
00063                     <Property name='Min' type='float' value='0.0' />
00064                     <Property name='Max' type='float' value='1000.0' />
00065                     <Property name='Default' type='float' value='0.0' />
00066                 </Property>
00067                 <Property name='Phase' type='float'>
00068                     <Property name='DisplayName' type='string' value='Phase'/>
00069                     <Property name='Min' type='float' value='-100.0' />
00070                     <Property name='Max' type='float' value='100.0' />
00071                     <Property name='Default' type='float' value='0.0' />
00072                 </Property>
00073                 <Property name='Amplitude' type='float'>
00074                     <Property name='DisplayName' type='string' value='Amplitude'/>
00075                     <Property name='Min' type='float' value='0.0001' />
00076                     <Property name='Max' type='float' value='1000.0' />
00077                     <Property name='Default' type='float' value='0.0' />
00078                 </Property>
00079                 <Property name='Spread' type='float'>
00080                     <Property name='DisplayName' type='string' value='Spread'/>
00081                     <Property name='Min' type='float' value='0.0001' />
00082                     <Property name='Max' type='float' value='1000.0' />
00083                     <Property name='Default' type='float' value='0.0' />
00084                 </Property>
00085                 <Property name='Center' type='vector2'>
00086                     <Property name='DisplayName' type='string' value='Center'/>
00087                     <Property name='Default' type='vector2' value='(0.0, 0.0)' />
00088                 </Property>
00089             </Effect>
00090             );
00091
00092     // This defines the bindings from specific properties to the callback functions
00093     // on the class that ID2D1Effect::SetValue() & GetValue() will call.
00094     const D2D1_PROPERTY_BINDING bindings[] =
00095     {
00096         D2D1_VALUE_TYPE_BINDING(L"Frequency", &SetFrequency, &GetFrequency),
00097         D2D1_VALUE_TYPE_BINDING(L"Phase", &SetPhase, &GetPhase),
00098         D2D1_VALUE_TYPE_BINDING(L"Amplitude", &SetAmplitude, &GetAmplitude),
00099         D2D1_VALUE_TYPE_BINDING(L"Spread", &SetSpread, &GetSpread),
00100         D2D1_VALUE_TYPE_BINDING(L"Center", &SetCenter, &GetCenter),
00101     };
00102
00103     // This registers the effect with the factory, which will make the effect
00104     // instantiatable.
00105     return pFactory->RegisterEffectFromString(
00106         CLSID_CustomRippleEffect,
00107         pszXml,
00108         bindings,
00109         ARRAYSIZE(bindings),
00110         CreateRippleImpl
00111         );
00112 }
00113
00114 IFACEMETHODIMP RippleEffect::Initialize(
00115     _In_ ID2D1EffectContext* pEffectContext,
00116     _In_ ID2D1TransformGraph* pTransformGraph
00117     )
00118 {
00119     // To maintain consistency across different DPIs, this effect needs to cover more pixels at
00120     // higher than normal DPIs. The context is saved here so the effect can later retrieve the DPI.
00121     m_effectContext = pEffectContext;
00122
00123     BasicReaderWriter^ reader = ref new BasicReaderWriter();
00124     Platform::Array<unsigned char, 1U>^ data;
00125
00126     try
00127     {
00128         data = reader->ReadData("RippleEffect.cso");
00129     }
00130     catch (Platform::Exception^ e)
00131     {
00132         // Return error if file can not be read.
00133         return e->HResult;
00134     }
00135
00136     HRESULT hr = pEffectContext->LoadPixelShader(GUID_RipplePixelShader, data->Data, data->Length);
00137
00138     // This loads the shader into the Direct2D image effects system and associates it with the GUID passed in.
00139     // If this method is called more than once (say by other instances of the effect) with the same GUID,
00140     // the system will simply do nothing, ensuring that only one instance of a shader is stored regardless of how
00141     // many time it is used.
00142     if (SUCCEEDED(hr))
00143     {
00144         // The graph consists of a single transform. In fact, this class is the transform,
00145         // reducing the complexity of implementing an effect when all we need to
00146         // do is use a single pixel shader.
00147         hr = pTransformGraph->SetSingleTransformNode(this);
00148     }
00149
00150     return hr;
00151 }
00152
00153 HRESULT RippleEffect::SetFrequency(float frequency)
00154 {
00155     // Limit to the published possible values in the XML.
00156     m_constants.frequency = Clamp(frequency, 0.0f, 1000.0f);
00157     return S_OK;
00158 }
00159
00160 float RippleEffect::GetFrequency() const
00161 {
00162     return m_constants.frequency;
00163 }
00164
00165 HRESULT RippleEffect::SetPhase(float phase)
00166 {
00167     // Limit to the published possible values in the XML.
00168     m_constants.phase = Clamp(phase, -100.0f, 100.0f);
00169     return S_OK;
00170 }
00171
00172 float RippleEffect::GetPhase() const
00173 {
00174     return m_constants.phase;
00175 }
00176
00177 HRESULT RippleEffect::SetAmplitude(float amplitude)
00178 {
00179     // Limit to the published possible values in the XML.
00180     m_constants.amplitude = Clamp(amplitude, 0.0001f, 1000.0f);
00181     return S_OK;
00182 }
00183
00184 float RippleEffect::GetSpread() const
00185 {
00186     return m_constants.spread;
00187 }
00188
00189 HRESULT RippleEffect::SetSpread(float spread)
00190 {
00191     // Limit to the published possible values in the XML.
00192     m_constants.spread = Clamp(spread, 0.0001f, 1000.0f);
00193     return S_OK;
00194 }
00195
00196 float RippleEffect::GetAmplitude() const
00197 {
00198     return m_constants.amplitude;
00199 }
00200
00201 HRESULT RippleEffect::SetCenter(D2D1_POINT_2F center)
00202 {
00203     // The valid range is all possible point positions, so no clamping is needed.
00204     m_constants.center = center;
00205     return S_OK;
00206 }
00207
00208 D2D1_POINT_2F RippleEffect::GetCenter() const
00209 {
00210     return m_constants.center;
00211 }
00212
00213 HRESULT RippleEffect::UpdateConstants()
00214 {
00215     // Update the DPI if it has changed. This allows the effect to scale across different DPIs automatically.
00216     m_effectContext->GetDpi(&m_dpi, &m_dpi);
00217     m_constants.dpi = m_dpi;
00218
00219     return m_drawInfo->SetPixelShaderConstantBuffer(reinterpret_cast<BYTE*>(&m_constants), sizeof(m_constants));
00220 }
00221
00222 IFACEMETHODIMP RippleEffect::PrepareForRender(D2D1_CHANGE_TYPE changeType)
00223 {
00224     return UpdateConstants();
00225 }
00226
00227 // SetGraph is only called when the number of inputs changes. This never happens as we publish this effect
00228 // as a single input effect.
00229 IFACEMETHODIMP RippleEffect::SetGraph(_In_ ID2D1TransformGraph* pGraph)
00230 {
00231     return E_NOTIMPL;
00232 }
00233
00234 // Called to assign a new render info class, which is used to inform D2D on
00235 // how to set the state of the GPU.
00236 IFACEMETHODIMP RippleEffect::SetDrawInfo(_In_ ID2D1DrawInfo* pDrawInfo)
00237 {
00238     m_drawInfo = pDrawInfo;
00239
00240     return m_drawInfo->SetPixelShader(GUID_RipplePixelShader);
00241 }
00242
00243 // Calculates the mapping between the output and input rects. In this case,
00244 // we want to request an expanded region to account for pixels that the ripple
00245 // may need outside of the bounds of the destination.
00246 IFACEMETHODIMP RippleEffect::MapOutputRectToInputRects(
00247     _In_ const D2D1_RECT_L* pOutputRect,
00248     _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00249     UINT32 inputRectCount
00250     ) const
00251 {
00252     // This effect has exactly one input, so if there is more than one input rect,
00253     // something is wrong.
00254     if (inputRectCount != 1)
00255     {
00256         return E_INVALIDARG;
00257     }
00258
00259     long expansion = static_cast<long>(Round(m_constants.amplitude));
00260
00261     // Expand the rect out by the amplitude of the ripple animation. SafeAdd
00262     // is a helper function that prevents long over/underflows.
00263     pInputRects[0].left    = SafeAdd(pOutputRect->left, -expansion);
00264     pInputRects[0].top     = SafeAdd(pOutputRect->top, -expansion);
00265     pInputRects[0].right   = SafeAdd(pOutputRect->right, expansion);
00266     pInputRects[0].bottom  = SafeAdd(pOutputRect->bottom, expansion);
00267
00268     return S_OK;
00269 }
00270
00271 IFACEMETHODIMP RippleEffect::MapInputRectsToOutputRect(
00272     _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00273     _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00274     UINT32 inputRectCount,
00275     _Out_ D2D1_RECT_L* pOutputRect,
00276     _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00277     )
00278 {
00279     // This effect has exactly one input, so if there is more than one input rect,
00280     // something is wrong.
00281     if (inputRectCount != 1)
00282     {
00283         return E_INVALIDARG;
00284     }
00285
00286     *pOutputRect = pInputRects[0];
00287     m_inputRect = pInputRects[0];
00288
00289     // Indicate that entire output might contain transparency.
00290     ZeroMemory(pOutputOpaqueSubRect, sizeof(*pOutputOpaqueSubRect));
00291
00292     return S_OK;
00293 }
00294
00295 IFACEMETHODIMP RippleEffect::MapInvalidRect(
00296     UINT32 inputIndex,
00297     D2D1_RECT_L invalidInputRect,
00298     _Out_ D2D1_RECT_L* pInvalidOutputRect
00299     ) const
00300 {
00301     HRESULT hr = S_OK;
00302
00303     // Indicate that the entire output may be invalid.
00304     *pInvalidOutputRect = m_inputRect;
00305
00306     return hr;
00307 }
00308
00309 IFACEMETHODIMP_(UINT32) RippleEffect::GetInputCount() const
00310 {
00311     return 1;
00312 }
00313
00314 // D2D ensures that that effects are only referenced from one thread at a time.
00315 // To improve performance, we simply increment/decrement our reference count
00316 // rather than use atomic InterlockedIncrement()/InterlockedDecrement() functions.
00317 IFACEMETHODIMP_(ULONG) RippleEffect::AddRef()
00318 {
00319     m_refCount++;
00320     return m_refCount;
00321 }
00322
00323 IFACEMETHODIMP_(ULONG) RippleEffect::Release()
00324 {
00325     m_refCount--;
00326
00327     if (m_refCount == 0)
00328     {
00329         delete this;
00330         return 0;
00331     }
00332     else
00333     {
00334         return m_refCount;
00335     }
00336 }
00337
00338 // This enables the stack of parent interfaces to be queried. In the instance
00339 // of the Ripple interface, this method simply enables the developer
00340 // to cast a Ripple instance to an ID2D1EffectImpl or IUnknown instance.
00341 IFACEMETHODIMP RippleEffect::QueryInterface(
00342     _In_ REFIID riid,
00343     _Outptr_ void** ppOutput
00344     )
00345 {
00346     *ppOutput = nullptr;
00347     HRESULT hr = S_OK;
00348
00349     if (riid == __uuidof(ID2D1EffectImpl))
00350     {
00351         *ppOutput = reinterpret_cast<ID2D1EffectImpl*>(this);
00352     }
00353     else if (riid == __uuidof(ID2D1DrawTransform))
00354     {
00355         *ppOutput = static_cast<ID2D1DrawTransform*>(this);
00356     }
00357     else if (riid == __uuidof(ID2D1Transform))
00358     {
00359         *ppOutput = static_cast<ID2D1Transform*>(this);
00360     }
00361     else if (riid == __uuidof(ID2D1TransformNode))
00362     {
00363         *ppOutput = static_cast<ID2D1TransformNode*>(this);
00364     }
00365     else if (riid == __uuidof(IUnknown))
00366     {
00367         *ppOutput = this;
00368     }
00369     else
00370     {
00371         hr = E_NOINTERFACE;
00372     }
00373
00374     if (*ppOutput != nullptr)
00375     {
00376         AddRef();
00377     }
00378
00379     return hr;
00380 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/pch.h Source File

  • PasswordVault
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.System.h"
00008 #include "winrt/Windows.UI.Core.h"
00009 #include "winrt/Windows.UI.Xaml.h"
00010 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00011 #include "winrt/Windows.UI.Xaml.Controls.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00013 #include "winrt/Windows.UI.Xaml.Documents.h"
00014 #include "winrt/Windows.UI.Xaml.Interop.h"
00015 #include "winrt/Windows.UI.Xaml.Markup.h"
00016 #include "winrt/Windows.UI.Xaml.Media.h"
00017 #include "winrt/Windows.UI.Xaml.Navigation.h"
00018 #include "winrt/Windows.Security.Credentials.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario1_BasicFunctionality.cpp Source File

  • BarcodeScanner
  • cppwinrt

Scenario1_BasicFunctionality.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <thread>
00014 #include <mutex>
00015 #include "Scenario1_BasicFunctionality.h"
00016 #include "Scenario1_BasicFunctionality.g.cpp"
00017
00018 namespace winrt
00019 {
00020     using namespace Windows::Foundation;
00021     using namespace Windows::Devices;
00022     using namespace Windows::Devices::Enumeration;
00023     using namespace Windows::Devices::PointOfService;
00024     using namespace Windows::UI::Xaml;
00025     using namespace Windows::UI::Xaml::Navigation;
00026 }
00027
00028 namespace winrt::SDKTemplate::implementation
00029 {
00030     Scenario1_BasicFunctionality::Scenario1_BasicFunctionality()
00031     {
00032         InitializeComponent();
00033     }
00034
00035     void Scenario1_BasicFunctionality::OnNavigatedTo(NavigationEventArgs const&)
00036     {
00037         ResetTheScenarioState();
00038     }
00039
00040     void Scenario1_BasicFunctionality::OnNavigatedFrom(NavigationEventArgs const&)
00041     {
00042         ResetTheScenarioState();
00043     }
00044
00045     void Scenario1_BasicFunctionality::ResetTheScenarioState()
00046     {
00047         if (m_claimedScanner)
00048         {
00049             // Detach the event handlers
00050             m_claimedScanner.DataReceived(m_claimedScannerDataReceivedToken);
00051             m_claimedScanner.ReleaseDeviceRequested(m_claimedScannerReleaseDeviceRequestedToken);
00052             // Release the Barcode Scanner and set to null
00053             m_claimedScanner = nullptr;
00054         }
00055
00056         m_scanner = nullptr;
00057
00058         // Reset the UI if we are still the current page.
00059         if (Frame().Content() == *this)
00060         {
00061             m_rootPage.NotifyUser(L"Click the start scanning button to begin.", NotifyType::StatusMessage);
00062             ScenarioOutputScanData().Text(L"No data");
00063             ScenarioOutputScanDataLabel().Text(L"No data");
00064             ScenarioOutputScanDataType().Text(L"No data");
00065
00066             // reset the button state
00067             ScenarioEndScanButton().IsEnabled(false);
00068             ScenarioStartScanButton().IsEnabled(true);
00069             ScenarioSoftwareTriggerPanel().Visibility(Visibility::Collapsed);
00070         }
00071     }
00072
00073     fire_and_forget Scenario1_BasicFunctionality::ScenarioStartScanButton_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         auto lifetime = get_strong();
00076         ScenarioStartScanButton().IsEnabled(false);
00077
00078         m_rootPage.NotifyUser(L"Acquiring barcode scanner object.", NotifyType::StatusMessage);
00079
00080         // Obtain the default barcode scanner.
00081         m_scanner = co_await winrt::BarcodeScanner::GetDefaultAsync();
00082         if (m_scanner)
00083         {
00084             // after successful creation, claim the scanner for exclusive use and enable it so that data reveived events are received.
00085             m_claimedScanner = co_await m_scanner.ClaimScannerAsync();
00086
00087             if (m_claimedScanner)
00088             {
00089                 // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
00090                 // claim ownership of the barcode scanner.
00091                 m_claimedScannerReleaseDeviceRequestedToken = m_claimedScanner.ReleaseDeviceRequested({ get_weak(), &Scenario1_BasicFunctionality::claimedScanner_ReleaseDeviceRequested });
00092
00093                 // after successfully claiming, attach the datareceived event handler.
00094                 m_claimedScannerDataReceivedToken = m_claimedScanner.DataReceived({ get_weak(), &Scenario1_BasicFunctionality::claimedScanner_DataReceived });
00095
00096                 // Ask the API to decode the data by default. By setting this, API will decode the raw data from the barcode scanner and
00097                 // send the ScanDataLabel and ScanDataType in the DataReceived event
00098                 m_claimedScanner.IsDecodeDataEnabled(true);
00099
00100                 // enable the scanner.
00101                 // The scanner must be enabled in order to receive the DataReceived event.
00102                 co_await m_claimedScanner.EnableAsync();
00103
00104                 m_rootPage.NotifyUser(L"Ready to scan. Device ID: " + m_scanner.DeviceId(), NotifyType::StatusMessage);
00105                 ScenarioEndScanButton().IsEnabled(true);
00106
00107                 // If the scanner is a software scanner, show the software trigger buttons.
00108                 if (!m_scanner.VideoDeviceId().empty())
00109                 {
00110                     ScenarioSoftwareTriggerPanel().Visibility(Visibility::Visible);
00111                     ScenarioStartTriggerButton().IsEnabled(true);
00112                     ScenarioStopTriggerButton().IsEnabled(false);
00113                 }
00114             }
00115             else
00116             {
00117                 m_rootPage.NotifyUser(L"Claim barcode scanner failed.", NotifyType::ErrorMessage);
00118                 ScenarioStartScanButton().IsEnabled(true);
00119             }
00120         }
00121         else
00122         {
00123             m_rootPage.NotifyUser(L"Barcode scanner not found. Please connect a barcode scanner.", NotifyType::ErrorMessage);
00124             ScenarioStartScanButton().IsEnabled(true);
00125         }
00126     }
00127
00128     /// <summary>
00129     /// Event handler for the Release Device Requested event fired when barcode scanner receives Claim request from another application
00130     /// </summary>
00131     /// <param name="sender"></param>
00132     /// <param name="args"> Contains the ClamiedBarcodeScanner that is sending this request</param>
00133     void Scenario1_BasicFunctionality::claimedScanner_ReleaseDeviceRequested(IInspectable const&, ClaimedBarcodeScanner const& e)
00134     {
00135         // always retain the device
00136         e.RetainDevice();
00137
00138         m_rootPage.NotifyUser(L"Event ReleaseDeviceRequested received. Retaining the barcode scanner.", NotifyType::StatusMessage);
00139     }
00140
00141     /// <summary>
00142     /// Event handler for the DataReceived event fired when a barcode is scanned by the barcode scanner
00143     /// </summary>
00144     /// <param name="sender"></param>
00145     /// <param name="args"> Contains the BarcodeScannerReport which contains the data obtained in the scan</param>
00146     fire_and_forget Scenario1_BasicFunctionality::claimedScanner_DataReceived(ClaimedBarcodeScanner const&, BarcodeScannerDataReceivedEventArgs args)
00147     {
00148         auto lifetime = get_strong();
00149         co_await resume_foreground(Dispatcher());
00150
00151         // read the data from the buffer and convert to string.
00152         ScenarioOutputScanDataLabel().Text(GetDataLabelString(args.Report().ScanDataLabel(), args.Report().ScanDataType()));
00153         ScenarioOutputScanData().Text(GetDataString(args.Report().ScanData()));
00154         ScenarioOutputScanDataType().Text(BarcodeSymbologies::GetName(args.Report().ScanDataType()));
00155     }
00156
00157     void Scenario1_BasicFunctionality::ScenarioEndScanButton_Click(IInspectable const&, RoutedEventArgs const&)
00158     {
00159         ResetTheScenarioState();
00160     }
00161
00162     fire_and_forget Scenario1_BasicFunctionality::ScenarioStartTriggerButton_Click(IInspectable const&, RoutedEventArgs const&)
00163     {
00164         ScenarioStartTriggerButton().IsEnabled(false);
00165         co_await m_claimedScanner.StartSoftwareTriggerAsync();
00166         ScenarioStopTriggerButton().IsEnabled(true);
00167     }
00168
00169     fire_and_forget Scenario1_BasicFunctionality::ScenarioStopTriggerButton_Click(IInspectable const&, RoutedEventArgs const&)
00170     {
00171         ScenarioStopTriggerButton().IsEnabled(false);
00172         co_await m_claimedScanner.StopSoftwareTriggerAsync();
00173         ScenarioStartTriggerButton().IsEnabled(true);
00174     }
00175 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cs/SampleConfiguration.cs Source File

  • RelativeInclinometer
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using RelativeInclinometerCS;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Relative Inclinometer";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title = "Data events", ClassType = typeof(RelativeInclinometerCS.Scenario1_DataEvents) },
00026             new Scenario() { Title = "Polling", ClassType = typeof(RelativeInclinometerCS.Scenario2_Polling) },
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario3_CustomItems.xaml.cpp Source File

  • JumpList
  • cpp

Scenario3_CustomItems.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario3_CustomItems.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace concurrency;
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::StartScreen;
00023
00024 Scenario3_CustomItems::Scenario3_CustomItems()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario3_CustomItems::DisplayNameLocalizedResource_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00030 {
00031     DisplayName->IsEnabled = !DisplayNameLocalizedResource->IsChecked;
00032     DisplayName->Text = "ms-resource:///Resources/CustomJumpListItemDisplayName";
00033 }
00034
00035 void Scenario3_CustomItems::DescriptionLocalizedResource_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00036 {
00037     Description->IsEnabled = !DescriptionLocalizedResource->IsChecked;
00038     Description->Text = "ms-resource:///Resources/CustomJumpListItemDescription";
00039 }
00040
00041 void Scenario3_CustomItems::GroupNameLocalizedResource_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00042 {
00043     GroupName->IsEnabled = !GroupNameLocalizedResource->IsChecked;
00044     GroupName->Text = "ms-resource:///Resources/CustomJumpListGroupName";
00045 }
00046
00047 void Scenario3_CustomItems::AddToJumpList_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00048 {
00049   create_task(JumpList::LoadCurrentAsync()).then([this](JumpList^ jumpList) -> IAsyncAction^
00050   {
00051     jumpList->SystemGroupKind = JumpListSystemGroupKind::Recent;
00052
00053     auto item = JumpListItem::CreateWithArguments(Arguments->Text, DisplayName->Text);
00054     item->Description = Description->Text;
00055     item->GroupName = GroupName->Text;
00056     item->Logo = ref new Uri("ms-appx:///Assets/smalltile-sdk.png");
00057
00058     jumpList->Items->Append(item);
00059
00060     return jumpList->SaveAsync();
00061   }, task_continuation_context::use_current());
00062 }
Generated on Fri Nov 15 2024 22:20:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/DetailPage.h Source File

  • XamlMasterDetail
  • cppwinrt

DetailPage.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "DetailPage.g.h"
00014
00015 namespace winrt::MasterDetailApp::implementation
00016 {
00017     struct DetailPage : DetailPageT<DetailPage>
00018     {
00019         DetailPage();
00020
00021         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00022         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023
00024         static void RegisterDependencyProperties();
00025
00026         ViewModels::ItemViewModel Item() { return GetValue(s_itemProperty).as<ViewModels::ItemViewModel>(); }
00027         void Item(ViewModels::ItemViewModel value) { SetValue(s_itemProperty, value); }
00028
00029         static Windows::UI::Xaml::DependencyProperty ItemProperty() { return s_itemProperty; }
00030
00031         void PageRoot_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00032         void PageRoot_Unloaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00033         void Window_SizeChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Core::WindowSizeChangedEventArgs const& e);
00034         void DetailPage_BackRequested(Windows::Foundation::IInspectable const& sender, Windows::UI::Core::BackRequestedEventArgs const& args);
00035
00036     private:
00037         event_token m_sizeChangedEventRegistrationToken{};
00038         event_token m_backRequestedEventRegistrationToken{};
00039
00040         static Windows::UI::Xaml::DependencyProperty s_itemProperty;
00041
00042         void ReplaceLastBackStackEntryParameter(Windows::Foundation::IInspectable const& parameter);
00043         void OnBackRequested();
00044         void NavigateBackForWideState(bool useTransition);
00045         bool ShouldGoToWideState();
00046     };
00047 }
00048
00049 namespace winrt::MasterDetailApp::factory_implementation
00050 {
00051     struct DetailPage : DetailPageT<DetailPage, implementation::DetailPage>
00052     {
00053     };
00054 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/pch.cpp Source File

  • SpatialInteractionSource
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PrintHelper Member List

This is the complete list of members for PrintHelper, including all inherited members.
__pad0__ | PrintHelper |
AddOnePrintPreviewPage(RichTextBlockOverflow^lastRTBOAdded, Windows::Graphics::Printing::PrintPageDescription printPageDescription) | PrintHelper | [protected, virtual]
AddPrintPages(Object^sender, AddPagesEventArgs^e) | PrintHelper | [protected, virtual]
CreatePrintPreviewPages(Object^sender, PaginateEventArgs^e) | PrintHelper | [protected, virtual]
FirstPage | PrintHelper | [protected]
GetPrintPreviewPage(Object^sender, GetPreviewPageEventArgs^e) | PrintHelper | [protected, virtual]
m_applicationContentMarginLeft | PrintHelper | [private]
m_applicationContentMarginTop | PrintHelper | [private]
m_printDocument | PrintHelper | [private]
m_printDocumentSource | PrintHelper | [private]
m_printPreviewPages | PrintHelper | [private]
m_printTaskRequestedEventToken | PrintHelper | [private]
m_scenarioPage | PrintHelper | [private]
OnPreviewPagesCreated(Windows::Graphics::Printing::PrintTaskOptions^printTaskOptions) | PrintHelper | [inline, protected, virtual]
PreparePrintContent(Page^page) | PrintHelper |
PrintTaskRequested(Windows::Graphics::Printing::PrintManager^sender, Windows::Graphics::Printing::PrintTaskRequestedEventArgs^e) | PrintHelper | [protected, virtual]
ShowPrintUIAsync() | PrintHelper |
UnregisterForPrinting() | PrintHelper |
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/DirectXHelper.h Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 namespace DX
00017 {
00018     inline void ThrowIfFailed(HRESULT hr)
00019     {
00020         if (FAILED(hr))
00021         {
00022             // Set a breakpoint on this line to catch Win32 API errors.
00023             throw Platform::Exception::CreateException(hr);
00024         }
00025     }
00026
00027     // Function that reads from a binary file asynchronously.
00028     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00029     {
00030         using namespace Windows::Storage;
00031         using namespace Concurrency;
00032
00033         auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
00034
00035         return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([] (StorageFile^ file)
00036         {
00037             return FileIO::ReadBufferAsync(file);
00038         }).then([] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00039         {
00040             std::vector<byte> returnBuffer;
00041             returnBuffer.resize(fileBuffer->Length);
00042             Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
00043             return returnBuffer;
00044         });
00045     }
00046
00047     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00048     inline float ConvertDipsToPixels(float dips, float dpi)
00049     {
00050         static const float dipsPerInch = 96.0f;
00051         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00052     }
00053
00054     // Converts a length in physical pixels to a length in device-independent pixels (DIPs).
00055     inline float ConvertPixelsToDips(float pixels)
00056     {
00057         static const float dipsPerInch = 96.0f;
00058         return pixels * dipsPerInch / Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi; // Do not round.
00059     }
00060
00061     // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
00062     // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().
00063     inline float ConvertPixelsToDips(float pixels, float dpi)
00064     {
00065         static const float dipsPerInch = 96.0f;
00066         return pixels * dipsPerInch / dpi; // Do not round.
00067     }
00068
00069 #if defined(_DEBUG)
00070     // Check for SDK Layer support.
00071     inline bool SdkLayersAvailable()
00072     {
00073         HRESULT hr = D3D11CreateDevice(
00074             nullptr,
00075             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00076             0,
00077             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00078             nullptr,                    // Any feature level will do.
00079             0,
00080             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00081             nullptr,                    // No need to keep the D3D device reference.
00082             nullptr,                    // No need to know the feature level.
00083             nullptr                     // No need to keep the D3D device context reference.
00084             );
00085
00086         return SUCCEEDED(hr);
00087     }
00088 #endif
00089 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario5.h Source File

  • FileAccess
  • cppwinrt

Scenario5.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     /// <summary>
00020     /// Writing and reading using a stream.
00021     /// </summary>
00022     struct Scenario5 : Scenario5T<Scenario5>
00023     {
00024         Scenario5();
00025
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00027         fire_and_forget WriteToStreamButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028         fire_and_forget ReadFromStreamButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032     };
00033 }
00034
00035 namespace winrt::SDKTemplate::factory_implementation
00036 {
00037     struct Scenario5 : Scenario5T<Scenario5, implementation::Scenario5>
00038     {
00039     };
00040 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Magnetometer/cs/Scenario2_Polling.xaml.cs Source File

  • Magnetometer
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Sensors;
00014 using Windows.UI.Core;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario2_Polling : Page
00022     {
00023         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00024         // as NotifyUser()
00025         MainPage rootPage = MainPage.Current;
00026
00027         private Magnetometer _magnetometer;
00028         private uint _desiredReportInterval;
00029         private DispatcherTimer _dispatcherTimer;
00030
00031         public Scenario2_Polling()
00032         {
00033             this.InitializeComponent();
00034
00035             _magnetometer = Magnetometer.GetDefault();
00036             if (_magnetometer != null)
00037             {
00038                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00039                 // This value will be used later to activate the sensor.
00040                 uint minReportInterval = _magnetometer.MinimumReportInterval;
00041                 _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00042
00043                 // Set up a DispatchTimer
00044                 _dispatcherTimer = new DispatcherTimer();
00045                 _dispatcherTimer.Tick += DisplayCurrentReading;
00046                 _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
00047             }
00048             else
00049             {
00050                 rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
00051             }
00052         }
00053
00054         /// <summary>
00055         /// Invoked when this page is about to be displayed in a Frame.
00056         /// </summary>
00057         /// <param name="e">Event data that describes how this page was reached. The Parameter
00058         /// property is typically used to configure the page.</param>
00059         protected override void OnNavigatedTo(NavigationEventArgs e)
00060         {
00061             ScenarioEnableButton.IsEnabled = true;
00062             ScenarioDisableButton.IsEnabled = false;
00063         }
00064
00065         /// <summary>
00066         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00067         /// </summary>
00068         /// <param name="e">
00069         /// Event data that can be examined by overriding code. The event data is representative
00070         /// of the navigation that will unload the current Page unless canceled. The
00071         /// navigation can potentially be canceled by setting Cancel.
00072         /// </param>
00073         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00074         {
00075             if (ScenarioDisableButton.IsEnabled)
00076             {
00077                 Window.Current.VisibilityChanged -= VisibilityChanged;
00078
00079                 // Stop the dispatcher
00080                 _dispatcherTimer.Stop();
00081
00082                 // Restore the default report interval to release resources while the sensor is not in use
00083                 _magnetometer.ReportInterval = 0;
00084             }
00085
00086             base.OnNavigatingFrom(e);
00087         }
00088
00089         /// <summary>
00090         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00091         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00092         /// </summary>
00093         /// <param name="sender"></param>
00094         /// <param name="e">
00095         /// Event data that can be examined for the current visibility state.
00096         /// </param>
00097         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00098         {
00099             if (ScenarioDisableButton.IsEnabled)
00100             {
00101                 if (e.Visible)
00102                 {
00103                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00104                     _dispatcherTimer.Start();
00105                 }
00106                 else
00107                 {
00108                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00109                     _dispatcherTimer.Stop();
00110                 }
00111             }
00112         }
00113
00114         /// <summary>
00115         /// This is the dispatcher callback.
00116         /// </summary>
00117         /// <param name="sender"></param>
00118         /// <param name="args"></param>
00119         private void DisplayCurrentReading(object sender, object args)
00120         {
00121             MagnetometerReading reading = _magnetometer.GetCurrentReading();
00122             if (reading != null)
00123             {
00124                 ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.MagneticFieldX);
00125                 ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.MagneticFieldY);
00126                 ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.MagneticFieldZ);
00127             }
00128         }
00129
00130         /// <summary>
00131         /// This is the click handler for the 'Enable' button.
00132         /// </summary>
00133         /// <param name="sender"></param>
00134         /// <param name="e"></param>
00135         private void ScenarioEnable(object sender, RoutedEventArgs e)
00136         {
00137             if (_magnetometer != null)
00138             {
00139                 // Set the report interval to enable the sensor for polling
00140                 _magnetometer.ReportInterval = _desiredReportInterval;
00141
00142                 Window.Current.VisibilityChanged += VisibilityChanged;
00143                 _dispatcherTimer.Start();
00144
00145                 ScenarioEnableButton.IsEnabled = false;
00146                 ScenarioDisableButton.IsEnabled = true;
00147             }
00148             else
00149             {
00150                 rootPage.NotifyUser("No magnetometer found", NotifyType.ErrorMessage);
00151             }
00152         }
00153
00154         /// <summary>
00155         /// This is the click handler for the 'Disable' button.
00156         /// </summary>
00157         /// <param name="sender"></param>
00158         /// <param name="e"></param>
00159         private void ScenarioDisable(object sender, RoutedEventArgs e)
00160         {
00161             Window.Current.VisibilityChanged -= VisibilityChanged;
00162
00163             // Stop the dispatcher
00164             _dispatcherTimer.Stop();
00165
00166             // Restore the default report interval to release resources while the sensor is not in use
00167             _magnetometer.ReportInterval = 0;
00168
00169             ScenarioEnableButton.IsEnabled = true;
00170             ScenarioDisableButton.IsEnabled = false;
00171         }
00172     }
00173 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/CalibrationBar.xaml.cs Source File

  • Compass
  • cs

CalibrationBar.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using System.Linq;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using Windows.Foundation;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Controls.Primitives;
00021 using Windows.UI.Xaml.Data;
00022 using Windows.UI.Xaml.Input;
00023 using Windows.UI.Xaml.Media;
00024 using Windows.UI.Xaml.Media.Imaging;
00025 using Windows.UI.Xaml.Navigation;
00026 using Windows.Devices.Sensors;
00027
00028 namespace SDKTemplate
00029 {
00030     public sealed partial class CalibrationBar : Page
00031     {
00032         // Constants specifying when the calibration bar is shown:
00033         //   * suppress duration determines how long (in minutes) to wait before
00034         //     showing the calibration bar again
00035         //   * auto dismiss time determines when to auto dismiss the bar
00036         //     if it's shown too long
00037         private const double SUPPRESS_DURATION_APPROXIMATE_MIN = 10.0;
00038         private const double SUPPRESS_DURATION_UNRELIABLE_MIN = 5.0;
00039         private TimeSpan CALIBRATION_POPUP_AUTO_DIMSMISS_TIME = new TimeSpan(0, 0, 30); // 30 seconds
00040
00041         private const double LAYOUT_WIDTH_768 = 768.0;
00042
00043         private DateTime _lastCalibrationTime = new DateTime(0);
00044         private bool _barDismissed = false;
00045         private DispatcherTimer _calibrationTimer;
00046
00047         public CalibrationBar()
00048         {
00049             this.InitializeComponent();
00050             _calibrationTimer = new DispatcherTimer();
00051             _calibrationTimer.Tick += OnAutoDismissTimerExpired;
00052             _calibrationTimer.Interval = CALIBRATION_POPUP_AUTO_DIMSMISS_TIME;
00053         }
00054
00055         /// <summary>
00056         /// Called when the application would like to show the calibration bar to the user
00057         /// to improve sensor accuracy.
00058         /// </summary>
00059         /// <param name="accuracy">Current accuracy of the sensor.</param>
00060         public void RequestCalibration(MagnetometerAccuracy accuracy)
00061         {
00062             // Only show the calibration bar if it is hidden and sufficient
00063             // time has passed since it was last hidden.
00064             if (!CalibrationPopup.IsOpen && CanShowCalibrationBar(accuracy))
00065             {
00066                 InvalidateLayout();
00067                 Window.Current.SizeChanged += OnWindowSizeChanged;
00068                 HideGuidance(); // Calibration image hidden by default
00069                 CalibrationPopup.IsOpen = true;
00070                 _calibrationTimer.Start();
00071             }
00072         }
00073
00074         /// <summary>
00075         /// Called when sensor accuracy is sufficient and the application would like to
00076         /// hide the calibration bar.
00077         /// </summary>
00078         public void Hide()
00079         {
00080             if (CalibrationPopup.IsOpen)
00081             {
00082                 // Hide the calibration bar and save the current time.
00083                 _lastCalibrationTime = DateTime.Now;
00084                 HideGuidance();
00085                 CalibrationPopup.IsOpen = false;
00086                 Window.Current.SizeChanged -= OnWindowSizeChanged;
00087                 _calibrationTimer.Stop();
00088             }
00089         }
00090
00091         /// <summary>
00092         /// Invoked when the window size is updated.
00093         /// </summary>
00094         /// <param name="sender">Instance that triggered the event.</param>
00095         /// <param name="e">Event data describing the conditions that led to the event.</param>
00096         void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
00097         {
00098             InvalidateLayout();
00099         }
00100
00101         /// <summary>
00102         /// Updates the calibration bar layout based on the current window width.
00103         /// </summary>
00104         private void InvalidateLayout()
00105         {
00106             CalibrationGrid.Width = Window.Current.Bounds.Width;
00107
00108             if (CalibrationGrid.Width < LAYOUT_WIDTH_768)
00109             {
00110                 Grid.SetRow(DismissPopup, 1);
00111                 Grid.SetColumn(DismissPopup, 1);
00112
00113                 CalibrationGridTop.Margin = new Thickness(0, 24, 20, 15);
00114                 DismissPopup.Margin = new Thickness(66, 15, 0, 0);
00115             }
00116             else
00117             {
00118                 Grid.SetRow(DismissPopup, 0);
00119                 Grid.SetColumn(DismissPopup, 2);
00120
00121                 CalibrationGridTop.Margin = new Thickness(0, 19, 66, 19);
00122                 DismissPopup.Margin = new Thickness(66, 0, 0, 0);
00123             }
00124         }
00125
00126         /// <summary>
00127         /// Called to determine if sufficient time has passed since the calibration bar
00128         /// was hidden to show the calibration bar again. This suppression time is
00129         /// dependent on the current sensor accuracy.
00130         /// </summary>
00131         /// <param name="accuracy">Current accuracy of the sensor.</param>
00132         private bool CanShowCalibrationBar(MagnetometerAccuracy accuracy)
00133         {
00134             bool showBar = false;
00135             if (!_barDismissed)
00136             {
00137                 if ((accuracy == MagnetometerAccuracy.Approximate) &&
00138                     (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_APPROXIMATE_MIN)) >= 0))
00139                 {
00140                     showBar = true;
00141                 }
00142                 else if ((accuracy == MagnetometerAccuracy.Unreliable) &&
00143                     (DateTime.Now.CompareTo(_lastCalibrationTime.AddMinutes(SUPPRESS_DURATION_UNRELIABLE_MIN)) >= 0))
00144                 {
00145                     showBar = true;
00146                 }
00147             }
00148             return showBar;
00149         }
00150
00151         /// <summary>
00152         /// This is the click handler for the show guidance button.
00153         /// </summary>
00154         /// <param name="sender"></param>
00155         /// <param name="e"></param>
00156         private void ShowGuidanceButton_Click(object sender, RoutedEventArgs e)
00157         {
00158             if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Collapsed)
00159             {
00160                 ShowGuidance();
00161             }
00162         }
00163
00164         /// <summary>
00165         /// This is the click handler for the hide guidance button.
00166         /// </summary>
00167         /// <param name="sender"></param>
00168         /// <param name="e"></param>
00169         private void HideGuidanceButton_Click(object sender, RoutedEventArgs e)
00170         {
00171             if (Guidance.Visibility == Windows.UI.Xaml.Visibility.Visible)
00172             {
00173                 HideGuidance();
00174             }
00175         }
00176
00177         /// <summary>
00178         /// This is the click handler for the dismiss popup button. It hides the
00179         /// calibration bar and prevents it from being shown again for the lifetime
00180         /// of the app.
00181         /// </summary>
00182         /// <param name="sender"></param>
00183         /// <param name="e"></param>
00184         private void DismissPopup_Click(object sender, RoutedEventArgs e)
00185         {
00186             // Don't show the calibration bar again.
00187             _barDismissed = true;
00188             Hide();
00189         }
00190
00191         /// <summary>
00192         /// Expands the calibration bar to show the calibration image to the user.
00193         /// </summary>
00194         /// <param name="sender"></param>
00195         /// <param name="e"></param>
00196         private void ShowGuidance()
00197         {
00198             ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00199             HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
00200             Guidance.Visibility = Windows.UI.Xaml.Visibility.Visible;
00201         }
00202
00203         /// <summary>
00204         /// Collapses the calibration bar to hide the calibration image from the user.
00205         /// </summary>
00206         /// <param name="sender"></param>
00207         /// <param name="e"></param>
00208         private void HideGuidance()
00209         {
00210             HideGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00211             ShowGuidanceButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
00212             Guidance.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00213         }
00214
00215         /// <summary>
00216         /// This is the handler for the auto dismiss timer. After the calibraiton bar
00217         /// has been shown for the maximum time, it is automatically hidden.
00218         /// </summary>
00219         /// <param name="sender"></param>
00220         /// <param name="e"></param>
00221         private void OnAutoDismissTimerExpired(object sender, object e)
00222         {
00223             Hide();
00224         }
00225     }
00226 }
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.cpp Source File

  • PenHaptics
  • cppwinrt

Scenario5_InkingAndInteractionFeedback.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleConfiguration.h"
00014 #include "Scenario5_InkingAndInteractionFeedback.h"
00015 #include "Scenario5_InkingAndInteractionFeedback.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Devices::Haptics;
00020 using namespace Windows::Devices::Input;
00021 using namespace Windows::UI;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Shapes;
00027
00028
00029 // This sample shows how to use Inking and Interaction tactile signals in
00030 // conjunction with each other.
00031 // Namely, this sample plays the InkContinuous waveform when dragging a movable
00032 // rectangle and then plays the Click waveform when the rectangle is in range
00033 // of a snap gridline and, finally, if the movable rectangle snaps to a gridline
00034 // upon release, it plays the Click waveform one more time.
00035 namespace winrt::SDKTemplate::implementation
00036 {
00037     // Set the initial configuration of the canvas and the rectangles
00038     Scenario5_InkingAndInteractionFeedback::Scenario5_InkingAndInteractionFeedback()
00039     {
00040         InitializeComponent();
00041         InitializeGridLines();
00042         InitializeManipulationTransforms();
00043     }
00044
00045     // Draw gridlines based on the gridSize
00046     void Scenario5_InkingAndInteractionFeedback::InitializeGridLines()
00047     {
00048         SolidColorBrush darkGray(Colors::DarkGray());
00049         double width = hapticCanvas().Width();
00050         double height = hapticCanvas().Height();
00051         for (int i = 0; i <= width; i += gridSize)
00052         {
00053             Line currLine;
00054             currLine.Stroke(darkGray);
00055             currLine.X1(i);
00056             currLine.X2(i);
00057             currLine.Y1(0);
00058             currLine.Y2(height);
00059             hapticCanvas().Children().Append(currLine);
00060         }
00061         for (int i = 0; i <= height; i += gridSize)
00062         {
00063             Line currLine;
00064             currLine.Stroke(darkGray);
00065             currLine.X1(0);
00066             currLine.X2(width);
00067             currLine.Y1(i);
00068             currLine.Y2(i);
00069             hapticCanvas().Children().Append(currLine);
00070         }
00071     }
00072
00073     // Configure the Manipulation transforms that are used to drag the rectangle around
00074     void Scenario5_InkingAndInteractionFeedback::InitializeManipulationTransforms()
00075     {
00076         previousTransform = MatrixTransform();
00077         previousTransform.Matrix(MatrixHelper::Identity());
00078         deltaTransform = CompositeTransform();
00079         topLeft = Point(75, 75);
00080         deltaTransform.TranslateX(topLeft.X);
00081         deltaTransform.TranslateY(topLeft.Y);
00082
00083         transforms = TransformGroup();
00084         transforms.Children().ReplaceAll({ previousTransform, deltaTransform });
00085
00086         // Set the render transform on the rect
00087         movableRect().RenderTransform(transforms);
00088     }
00089
00090
00091     // The PointerEnter event will get fired as soon as Pointer input is received in the movableRect.
00092     // This event handler implementation will query the device providing input to see if it's a pen and
00093     // then check to see the pen supports tactile feedback and, if so, configure the PenDevice
00094     // to send the InkContinuous tactile signal.
00095     void Scenario5_InkingAndInteractionFeedback::MovableRect_Entered(IInspectable const&, PointerRoutedEventArgs const& e)
00096     {
00097         // If the current Pointer device is not a pen, exit
00098         if (e.Pointer().PointerDeviceType() != PointerDeviceType::Pen)
00099         {
00100             return;
00101         }
00102
00103         // Attempt to retrieve the PenDevice from the current PointerId
00104         penDevice = PenDevice::GetFromPointerId(e.Pointer().PointerId());
00105
00106         // If a PenDevice cannot be retrieved based on the PointerId, it does not support
00107         // advanced pen features, such as tactile feedback
00108         if (penDevice == nullptr)
00109         {
00110             statusText().Text(L"Advanced pen features not supported");
00111             return;
00112         }
00113
00114         // Check to see if the current PenDevice supports tactile feedback by seeing if it
00115         // has a SimpleHapticsController
00116         hapticsController = penDevice.SimpleHapticsController();
00117         if (hapticsController == nullptr)
00118         {
00119             statusText().Text(L"This pen does not provide tactile feedback");
00120             return;
00121         }
00122
00123         // Send the InkContinuous waveform to the PenDevice's SimpleHapticsController.
00124         // Once sent, inking continuous tactile feedback will be triggered as soon as the pen tip touches
00125         // the screen and will be stopped once the pen tip is lifted from the screen.
00126         // Also, check to see if the current PenDevice's SimpleHapticsController supports
00127         // setting the intensity value of the tactile feedback.  If so, set it to 0.75.
00128         // If not, send the waveform with the default intensity.
00129         SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::InkContinuous());
00130         if (feedback != nullptr)
00131         {
00132             if (hapticsController.IsIntensitySupported())
00133             {
00134                 hapticsController.SendHapticFeedback(feedback, 0.75);
00135             }
00136             else
00137             {
00138                 hapticsController.SendHapticFeedback(feedback);
00139             }
00140         }
00141     }
00142
00143     // Stop sending the tactile feedback and clear the current penDevice and hapticsController on PointerExit.
00144     // Stopping the feedback is important as it clears the tactile signal from the PenDevice's
00145     // SimpleHapticsController, ensuring that it has a clean state once it next enters range.
00146     void Scenario5_InkingAndInteractionFeedback::MovableRect_Exited(IInspectable const&, PointerRoutedEventArgs const&)
00147     {
00148         penDevice = nullptr;
00149         statusText().Text(L"");
00150         if (hapticsController != nullptr)
00151         {
00152             hapticsController.StopFeedback();
00153             hapticsController = nullptr;
00154         }
00155     }
00156
00157     // Change the color of the movableRect once a manipulation is started. This coincides with the pen
00158     // touching down inside the rectangle, so this color change will happen at the same time that the
00159     // InkContinuous waveform begins playing.
00160     void Scenario5_InkingAndInteractionFeedback::MovableRect_ManipulationStarted(IInspectable const&, ManipulationStartedRoutedEventArgs const&)
00161     {
00162         movableRect().Style(MovableRectangleDragged());
00163     }
00164
00165     // Update the position of the movableRect and update the previewRect as needed
00166     void Scenario5_InkingAndInteractionFeedback::MovableRect_ManipulationDelta(IInspectable const&, ManipulationDeltaRoutedEventArgs const& e)
00167     {
00168         previousTransform.Matrix(transforms.Value());
00169
00170         // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve the X and Y changes
00171         Point translation = e.Delta().Translation;
00172         deltaTransform.TranslateX(translation.X);
00173         deltaTransform.TranslateY(translation.Y);
00174         topLeft.X += translation.X;
00175         topLeft.Y += translation.Y;
00176         UpdatePreviewRect();
00177     }
00178
00179     // Update the visibilty or position of the previewRect based on the location
00180     // of the movableRect.
00181     // If the previewRect is snapped to a given gridline for the first time,
00182     // play the Click tactile signal.
00183     void Scenario5_InkingAndInteractionFeedback::UpdatePreviewRect()
00184     {
00185         if (IsInSnapRange())
00186         {
00187             previewRect().Visibility(Visibility::Visible);
00188             Point newPreviewTopLeft = GetSnappedPoint();
00189
00190             // Check to see if this is the first time that the previewRect is in range of a given gridline
00191             // and send the Click tactile signal if so
00192             bool sendHaptics = true;
00193             if ((previewTopLeft.X == newPreviewTopLeft.X && previewTopLeft.Y == newPreviewTopLeft.Y) ||
00194                 (previewTopLeft.X == newPreviewTopLeft.X && newPreviewTopLeft.Y == topLeft.Y) ||
00195                 (previewTopLeft.Y == newPreviewTopLeft.Y && newPreviewTopLeft.X == topLeft.X))
00196             {
00197                 sendHaptics = false;
00198             }
00199             if (previewTopLeft.X != newPreviewTopLeft.X || previewTopLeft.Y != newPreviewTopLeft.Y)
00200             {
00201                 previewTopLeft = newPreviewTopLeft;
00202                 previewRect().Translation({ previewTopLeft.X, previewTopLeft.Y, 0 });
00203                 if (hapticsController != nullptr && sendHaptics)
00204                 {
00205                     SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::Click());
00206                     if (feedback != nullptr)
00207                     {
00208                         hapticsController.SendHapticFeedback(feedback);
00209                     }
00210                 }
00211             }
00212         }
00213         else
00214         {
00215             previewRect().Visibility(Visibility::Collapsed);
00216             previewTopLeft = Point(-1, -1);
00217         }
00218     }
00219
00220     // When the manipulation is over, reset the color of the movableRect and
00221     // snap it to a gridline if appropriate
00222     void Scenario5_InkingAndInteractionFeedback::MovableRect_ManipulationCompleted(IInspectable const&, ManipulationCompletedRoutedEventArgs const&)
00223     {
00224         movableRect().Style(MovableRectangle());
00225         if (IsInSnapRange())
00226         {
00227             SnapMovableRectToGridLines();
00228         }
00229     }
00230
00231     // Updates the position of the movableRect to snap to the appropriate gridline(s).
00232     // In addition, play the Click tactile signal to provide additional feedback to the user that it has snapped.
00233     void Scenario5_InkingAndInteractionFeedback::SnapMovableRectToGridLines()
00234     {
00235         topLeft = GetSnappedPoint();
00236         previousTransform = MatrixTransform();
00237         previousTransform.Matrix(MatrixHelper::Identity());
00238         deltaTransform.TranslateX(topLeft.X);
00239         deltaTransform.TranslateY(topLeft.Y);
00240
00241         transforms = TransformGroup();
00242         transforms.Children().ReplaceAll({ previousTransform, deltaTransform });
00243
00244         movableRect().RenderTransform(transforms);
00245
00246         if (hapticsController != nullptr)
00247         {
00248             SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::Click());
00249             if (feedback != nullptr)
00250             {
00251                 hapticsController.SendHapticFeedback(feedback);
00252             }
00253         }
00254     }
00255
00256     // Retrieve the point corresponding to the top-left corner of where the movableRect would snap to
00257     // if released.
00258     Point Scenario5_InkingAndInteractionFeedback::GetSnappedPoint()
00259     {
00260         Point snappedPoint;
00261         float remainderX = (float)fmod(topLeft.X, gridSize);
00262         if (remainderX <= snapDistance)
00263         {
00264             snappedPoint.X = topLeft.X - remainderX;
00265         }
00266         else if (remainderX >= gridSize - snapDistance)
00267         {
00268             snappedPoint.X = topLeft.X + gridSize - remainderX;
00269         }
00270         else
00271         {
00272             snappedPoint.X = topLeft.X;
00273         }
00274         float remainderY = (float)fmod(topLeft.Y, gridSize);
00275         if (remainderY <= snapDistance)
00276         {
00277             snappedPoint.Y = topLeft.Y - remainderY;
00278         }
00279         else if (remainderY >= gridSize - snapDistance)
00280         {
00281             snappedPoint.Y = topLeft.Y + gridSize - remainderY;
00282         }
00283         else
00284         {
00285             snappedPoint.Y = topLeft.Y;
00286         }
00287         return snappedPoint;
00288     }
00289
00290     // Check to see if the movableRect is currently within snapping range of a gridline
00291     bool Scenario5_InkingAndInteractionFeedback::IsInSnapRange()
00292     {
00293         float remainderX = (float)fmod(topLeft.X, gridSize);
00294         float remainderY = (float)fmod(topLeft.Y, gridSize);
00295         return remainderX <= snapDistance ||
00296             remainderX >= gridSize - snapDistance ||
00297             remainderY <= snapDistance ||
00298             remainderY >= gridSize - snapDistance;
00299     }
00300 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario6_DeleteTPMVSC.xaml.h Source File

  • SmartCard
  • cpp

Scenario6_DeleteTPMVSC.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario6_DeleteTPMVSC.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario6_DeleteTPMVSC sealed
00012     {
00013     public:
00014         Scenario6_DeleteTPMVSC();
00015     private:
00016         void Delete_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017         void HandleCardRemoved(Windows::Devices::SmartCards::SmartCardReader^ evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs^ args);
00018         Windows::Devices::SmartCards::SmartCardReader ^reader;
00019     };
00020 }
Generated on Fri Nov 15 2024 22:21:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceProperties Member List

This is the complete list of members for DeviceProperties, including all inherited members.
DeviceInstanceId DeviceProperties
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_GetLastVisit Member List

This is the complete list of members for Scenario6_GetLastVisit, including all inherited members.
_rootPage | Scenario6_GetLastVisit | [private]
GetLastVisitButtonClicked(object sender, RoutedEventArgs e) | Scenario6_GetLastVisit | [inline, private]
Scenario6_GetLastVisit() | Scenario6_GetLastVisit | [inline]
UpdateLastVisit(Geovisit visit) | Scenario6_GetLastVisit | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Appointments/cs/Scenario5_Show.xaml.cs Source File

  • Appointments
  • cs

Scenario5_Show.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario5_Show : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario5_Show()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         /// <summary>
00029         /// Show the default appointment provider at a point in time 24 hours from now.
00030         /// </summary>
00031         /// <param name="sender"></param>
00032         /// <param name="e"></param>
00033         private async void Show_Click(object sender, RoutedEventArgs e)
00034         {
00035             var dateToShow = DateTime.Now.AddDays(1);
00036             var duration = TimeSpan.FromHours(1);
00037             await Windows.ApplicationModel.Appointments.AppointmentManager.ShowTimeFrameAsync(dateToShow, duration);
00038             rootPage.NotifyUser("The default appointments provider should have appeared on screen.", NotifyType.StatusMessage);
00039         }
00040     }
00041 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/ViewModel/TripViewModel.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • ViewModel

TripViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using AdventureWorks.Common;
00013 using AdventureWorks.Model;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Linq;
00017 using System.Text;
00018 using System.Threading.Tasks;
00019 using System.Windows.Input;
00020 using Windows.Media.SpeechRecognition;
00021 using Windows.ApplicationModel.VoiceCommands;
00022 using System.Globalization;
00023 using Windows.UI.Xaml;
00024
00025 namespace AdventureWorks.ViewModel
00026 {
00027     /// <summary>
00028     /// View Model associated with TripDetails.xaml. Provides access to an individual Trip,
00029     /// and Commands for saving new, updating existing, and deleting trips.
00030     /// Is able to both create brand new trips, and edit existing trips, hiding buttons that
00031     /// should not be accessible in some cases.
00032     /// </summary>
00033     public class TripViewModel : ViewModelBase
00034     {
00035         private ICommand saveTripCommand;
00036         private ICommand deleteTripCommand;
00037         private Trip trip;
00038         private TripStore store;
00039
00040         private bool showDestinationValidation = false;
00041         private string destinationValidationError;
00042
00043         private bool showDelete = false;
00044
00045         /// <summary>
00046         /// The Trip this view model represents.
00047         /// </summary>
00048         public Trip Trip
00049         {
00050             get
00051             {
00052                 return trip;
00053             }
00054             set
00055             {
00056                 trip = value;
00057                 NotifyPropertyChanged("Trip");
00058             }
00059         }
00060
00061         /// <summary>
00062         /// We require that a destination be set to a non-empty string. If the user
00063         /// attempts to save without one, this will be set to an explanatory validation
00064         /// prompt to be rendered in the UI.
00065         /// </summary>
00066         public String DestinationValidationError
00067         {
00068             get
00069             {
00070                 return destinationValidationError;
00071             }
00072
00073             private set
00074             {
00075                 destinationValidationError = value;
00076                 NotifyPropertyChanged("DestinationValidationError");
00077             }
00078         }
00079
00080         /// <summary>
00081         /// Controls whether the TextBlock that contains the destination validation string
00082         /// is visible. Combined with the VisibilityConverter, can show or collapse elements.
00083         /// </summary>
00084         public bool ShowDestinationValidation
00085         {
00086             get
00087             {
00088                 return showDestinationValidation;
00089             }
00090             private set
00091             {
00092                 showDestinationValidation = value;
00093                 NotifyPropertyChanged("ShowDestinationValidation");
00094             }
00095         }
00096
00097         /// <summary>
00098         /// Controls whether the Button that deletes trips is shown. If creating a new trip,
00099         /// this is false. Otherwise, true.
00100         /// </summary>
00101         public bool ShowDelete
00102         {
00103             get
00104             {
00105                 return showDelete;
00106             }
00107             private set
00108             {
00109                 showDelete = value;
00110                 NotifyPropertyChanged("ShowDelete");
00111             }
00112         }
00113
00114         /// <summary>
00115         /// Bound to the save button, provides a command to invoke when pressed.
00116         /// </summary>
00117         public ICommand SaveTripCommand
00118         {
00119             get
00120             {
00121                 return saveTripCommand;
00122             }
00123         }
00124
00125         /// <summary>
00126         /// Load a trip fomr the store, and set up the view per a normal ShowTrip command.
00127         /// </summary>
00128         /// <param name="destination"></param>
00129         internal async void LoadTripFromStore(string destination)
00130         {
00131             Trip t = store.Trips.Where(p => p.Destination == destination).FirstOrDefault();
00132             if (t != null)
00133             {
00134                 this.ShowTrip(t);
00135             }
00136             else
00137             {
00138                 // Redirect back to the main page, and pass along an error message to show
00139                 await Window.Current.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00140                 {
00141                     App.NavigationService.Navigate<View.TripListView>(
00142                     string.Format(
00143                         "Sorry, couldn't find a trip with Destination {0}",
00144                         destination));
00145                 });
00146             }
00147         }
00148
00149
00150         /// <summary>
00151         /// Bound to the Delete button, provides a command to invoke when pressed.
00152         /// </summary>
00153         public ICommand DeleteTripCommand
00154         {
00155             get
00156             {
00157                 return deleteTripCommand;
00158             }
00159         }
00160
00161         /// <summary>
00162         /// Construct Trip ViewModel, providing the store to persist trips.
00163         /// Creates the RelayCommands to be bound to various buttons in the UI.
00164         /// </summary>
00165         /// <param name="store">The persistent store</param>
00166         public TripViewModel(TripStore store)
00167         {
00168             trip = new Trip();
00169             saveTripCommand = new RelayCommand(new Action(SaveTrip));
00170             deleteTripCommand = new RelayCommand(new Action(DeleteTrip));
00171             this.store = store;
00172         }
00173
00174         /// <summary>
00175         /// removes a trip from the store, and returns to the trip list.
00176         /// </summary>
00177         private async void DeleteTrip()
00178         {
00179             await store.DeleteTrip(Trip);
00180             await UpdateDestinationPhraseList();
00181             App.NavigationService.GoBack();
00182         }
00183
00184         /// <summary>
00185         /// Whenever a trip is modified, we trigger an update of the voice command Phrase list. This allows
00186         /// voice commands such as "Adventure Works Show trip to {destination} to be up to date with saved
00187         /// Trips.
00188         /// </summary>
00189         public async Task UpdateDestinationPhraseList()
00190         {
00191             try
00192             {
00193                 // Update the destination phrase list, so that Cortana voice commands can use destinations added by users.
00194                 // When saving a trip, the UI navigates automatically back to this page, so the phrase list will be
00195                 // updated automatically.
00196                 VoiceCommandDefinition commandDefinitions;
00197
00198                 string countryCode = CultureInfo.CurrentCulture.Name.ToLower();
00199                 if(countryCode.Length == 0)
00200                 {
00201                     countryCode = "en-us";
00202                 }
00203
00204                 if (VoiceCommandDefinitionManager.InstalledCommandDefinitions.TryGetValue("AdventureWorksCommandSet_" + countryCode, out commandDefinitions))
00205                 {
00206                     List<string> destinations = new List<string>();
00207                     foreach (Model.Trip t in store.Trips)
00208                     {
00209                         destinations.Add(t.Destination);
00210                     }
00211
00212                     await commandDefinitions.SetPhraseListAsync("destination", destinations);
00213                 }
00214             }
00215             catch (Exception ex)
00216             {
00217                 System.Diagnostics.Debug.WriteLine("Updating Phrase list for VCDs: " + ex.ToString());
00218             }
00219         }
00220
00221
00222         /// <summary>
00223         /// Performs validation on the destination to ensure it's not empty, then
00224         /// saves a trip to the store. If the destination isn't valid, shows a validation
00225         /// error.
00226         /// </summary>
00227         private async void SaveTrip()
00228         {
00229             ShowDestinationValidation = false;
00230             bool valid = true;
00231
00232             if (String.IsNullOrEmpty(Trip.Destination))
00233             {
00234                 valid = false;
00235                 ShowDestinationValidation = true;
00236                 DestinationValidationError = "Destination cannot be blank";
00237             }
00238             else
00239             {
00240                 Trip.Destination = Trip.Destination.Trim();
00241             }
00242
00243             if (valid)
00244             {
00245                 await store.SaveTrip(this.Trip);
00246                 await UpdateDestinationPhraseList();
00247                 App.NavigationService.GoBack();
00248             }
00249         }
00250
00251         /// <summary>
00252         /// Sets up the view model to show an existing trip.
00253         /// </summary>
00254         /// <param name="trip"></param>
00255         internal void ShowTrip(Trip trip)
00256         {
00257             showDelete = true;
00258             Trip = trip;
00259         }
00260
00261         /// <summary>
00262         /// Sets up the view model to create a new trip.
00263         /// </summary>
00264         internal void NewTrip()
00265         {
00266             showDelete = false;
00267             Trip = new Trip();
00268         }
00269     }
00270 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario4_StateTrigger.xaml.cs Source File

  • VersionAdaptiveCode
  • cs

Scenario4_StateTrigger.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 namespace SDKTemplate
00015 {
00016     /// <summary>
00017     /// this page shows how to use a state trigger to manipulate setter properties if the property is available.
00018     /// In this particular case, we conditionally set the AllowFocusOnInteraction property.
00019     /// </summary>
00020     public sealed partial class Scenario4_StateTrigger : Page
00021     {
00022         public Scenario4_StateTrigger()
00023         {
00024             this.InitializeComponent();
00025         }
00026     }
00027 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/pch.h Source File

  • TouchKeyboardTextInput
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.cpp Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceConsumer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace concurrency;
00024 using namespace Microsoft::WRL;
00025 using namespace Platform;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Devices::AllJoyn;
00028 using namespace com::microsoft::Samples::SecureInterface;
00029
00030 std::map<alljoyn_interfacedescription, WeakReference*> SecureInterfaceConsumer::SourceInterfaces;
00031 PCSTR SecureInterfaceConsumer::m_interfaceName = "com.microsoft.Samples.SecureInterface";
00032
00033 SecureInterfaceConsumer::SecureInterfaceConsumer(AllJoynBusAttachment^ busAttachment)
00034     : m_busAttachment(busAttachment),
00035     m_proxyBusObject(nullptr),
00036     m_busObject(nullptr)
00037 {
00038     m_weak = new WeakReference(this);
00039     m_signals = ref new SecureInterfaceSignals();
00040     m_nativeBusAttachment = AllJoynHelpers::GetInternalBusAttachment(m_busAttachment);
00041
00042     GUID result;
00043     HRESULT hr = CoCreateGuid(&result);
00044
00045     if (FAILED(hr))
00046     {
00047         throw ref new Exception(hr);
00048     }
00049
00050     // The consumer needs a bus object to share signals, and its object path must be unique in
00051     // case multiple consumers are created using the same bus attachment.
00052     Guid gd(result);
00053     ServiceObjectPath = gd.ToString();
00054 }
00055
00056 SecureInterfaceConsumer::~SecureInterfaceConsumer()
00057 {
00058     if (nullptr != ProxyBusObject)
00059     {
00060         alljoyn_proxybusobject_destroy(ProxyBusObject);
00061     }
00062     delete m_weak;
00063 }
00064
00065 QStatus SecureInterfaceConsumer::AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
00066 {
00067     alljoyn_interfacedescription_member member;
00068     if (!alljoyn_interfacedescription_getmember(interfaceDescription, methodName, &member))
00069     {
00070         return ER_BUS_INTERFACE_NO_SUCH_MEMBER;
00071     }
00072
00073     return alljoyn_busattachment_registersignalhandler(busAttachment, handler, member, NULL);
00074 }
00075
00076 IAsyncOperation<SecureInterfaceConsumer^>^ SecureInterfaceConsumer::FromIdAsync(_In_ Platform::String^ deviceId)
00077 {
00078     return SecureInterfaceConsumer::FromIdAsync(deviceId, AllJoynBusAttachment::GetDefault());
00079 }
00080
00081 IAsyncOperation<SecureInterfaceConsumer^>^ SecureInterfaceConsumer::FromIdAsync(_In_ Platform::String^ deviceId, _In_ AllJoynBusAttachment^ busAttachment)
00082 {
00083     return create_async([deviceId, busAttachment]() -> SecureInterfaceConsumer^
00084     {
00085         SecureInterfaceConsumer^ result;
00086         create_task(AllJoynServiceInfo::FromIdAsync(deviceId)).then([busAttachment, &result](AllJoynServiceInfo^ serviceInfo)
00087         {
00088             if (serviceInfo != nullptr)
00089             {
00090                 int32 status = AllJoynStatus::Ok;
00091                 if (busAttachment->State == AllJoynBusAttachmentState::Disconnected)
00092                 {
00093                     event connectedEvent;
00094                     auto token = busAttachment->StateChanged += ref new TypedEventHandler<AllJoynBusAttachment^, AllJoynBusAttachmentStateChangedEventArgs^>([&connectedEvent](AllJoynBusAttachment^, AllJoynBusAttachmentStateChangedEventArgs^ arg)
00095                     {
00096                         if (arg->State == AllJoynBusAttachmentState::Connected)
00097                         {
00098                             connectedEvent.set();
00099                         }
00100                     });
00101
00102                     status = AllJoynHelpers::CreateInterfaces(busAttachment, c_SecureInterfaceIntrospectionXml);
00103                     if (status == AllJoynStatus::Ok)
00104                     {
00105                         busAttachment->Connect();
00106                         connectedEvent.wait();
00107                     }
00108                     busAttachment->StateChanged -= token;
00109                 }
00110
00111                 if (status == AllJoynStatus::Ok)
00112                 {
00113                     auto consumer = ref new SecureInterfaceConsumer(busAttachment);
00114                     status = consumer->Initialize(serviceInfo);
00115                     if (status == AllJoynStatus::Ok)
00116                     {
00117                         result = consumer;
00118                     }
00119                 }
00120             }
00121         }).wait();
00122
00123         return result;
00124     });
00125 }
00126
00127 IAsyncOperation<SecureInterfaceConcatenateResult^>^ SecureInterfaceConsumer::ConcatenateAsync(_In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2)
00128 {
00129     return create_async([this, interfaceMemberInStr1, interfaceMemberInStr2]() -> SecureInterfaceConcatenateResult^
00130     {
00131         auto result = ref new SecureInterfaceConcatenateResult();
00132
00133         alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
00134         size_t argCount = 2;
00135         alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
00136
00137         QStatus status = ER_OK;
00138         status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 0), "s", interfaceMemberInStr1));
00139         if (ER_OK == status)
00140         {
00141             status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 1), "s", interfaceMemberInStr2));
00142         }
00143         if (ER_OK == status)
00144         {
00145             status = alljoyn_proxybusobject_methodcall(
00146                 ProxyBusObject,
00147                 m_interfaceName,
00148                 "Concatenate",
00149                 inputs,
00150                 argCount,
00151                 message,
00152                 c_MessageTimeoutInMilliseconds,
00153                 0);
00154         }
00155         result->Status = static_cast<int>(status);
00156         if (ER_OK == status)
00157         {
00158             result->Status = AllJoynStatus::Ok;
00159             Platform::String^ argument0;
00160             status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "s", &argument0));
00161             result->OutStr = argument0;
00162
00163             if (ER_OK != status)
00164             {
00165                 result->Status = static_cast<int>(status);
00166             }
00167         }
00168         else if (ER_BUS_REPLY_IS_ERROR_MESSAGE == status)
00169         {
00170             alljoyn_msgarg errorArg = alljoyn_message_getarg(message, 1);
00171             if (nullptr != errorArg)
00172             {
00173                 uint16 errorStatus;
00174                 status = alljoyn_msgarg_get_uint16(errorArg, &errorStatus);
00175                 if (ER_OK == status)
00176                 {
00177                     status = static_cast<QStatus>(errorStatus);
00178                 }
00179             }
00180             result->Status = static_cast<int>(status);
00181         }
00182
00183         alljoyn_message_destroy(message);
00184         alljoyn_msgarg_destroy(inputs);
00185
00186         return result;
00187     });
00188 }
00189
00190 IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ SecureInterfaceConsumer::SetIsUpperCaseEnabledAsync(_In_ bool value)
00191 {
00192     return create_async([this, value]() -> SecureInterfaceSetIsUpperCaseEnabledResult^
00193     {
00194         PropertySetContext setContext;
00195
00196         alljoyn_msgarg inputArgument = alljoyn_msgarg_create();
00197         QStatus status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(inputArgument, "b", value));
00198         if (ER_OK == status)
00199         {
00200             status = alljoyn_proxybusobject_setpropertyasync(
00201                 ProxyBusObject,
00202                 m_interfaceName,
00203                 "IsUpperCaseEnabled",
00204                 inputArgument,
00205                 [](QStatus status, alljoyn_proxybusobject obj, void* context)
00206                 {
00207                     UNREFERENCED_PARAMETER(obj);
00208                     auto propertyContext = static_cast<PropertySetContext*>(context);
00209                     propertyContext->SetStatus(status);
00210                     propertyContext->SetEvent();
00211                 },
00212                 c_MessageTimeoutInMilliseconds,
00213                 &setContext);
00214
00215             alljoyn_msgarg_destroy(inputArgument);
00216
00217             setContext.Wait();
00218         }
00219         if (ER_OK == status)
00220         {
00221             return SecureInterfaceSetIsUpperCaseEnabledResult::CreateSuccessResult();
00222         }
00223         return SecureInterfaceSetIsUpperCaseEnabledResult::CreateFailureResult(static_cast<int>(status));
00224     });
00225 }
00226
00227 IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ SecureInterfaceConsumer::GetIsUpperCaseEnabledAsync()
00228 {
00229     return create_async([this]() -> SecureInterfaceGetIsUpperCaseEnabledResult^
00230     {
00231         PropertyGetContext<bool> getContext;
00232
00233         alljoyn_proxybusobject_getpropertyasync(
00234             ProxyBusObject,
00235             m_interfaceName,
00236             "IsUpperCaseEnabled",
00237             [](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
00238             {
00239                 UNREFERENCED_PARAMETER(obj);
00240                 auto propertyContext = static_cast<PropertyGetContext<bool>*>(context);
00241
00242                 if (ER_OK == status)
00243                 {
00244                     bool argument;
00245                     status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(value, "b", &argument));
00246
00247                     propertyContext->SetValue(argument);
00248                 }
00249                 propertyContext->SetStatus(status);
00250                 propertyContext->SetEvent();
00251             },
00252             c_MessageTimeoutInMilliseconds,
00253             &getContext);
00254
00255         getContext.Wait();
00256
00257         auto result = ref new SecureInterfaceGetIsUpperCaseEnabledResult();
00258         result->Status = getContext.GetStatus();
00259         result->IsUpperCaseEnabled = getContext.GetValue();
00260         return result;
00261     });
00262 }
00263
00264 void SecureInterfaceConsumer::OnPropertyChanged(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated)
00265 {
00266     UNREFERENCED_PARAMETER(obj);
00267     UNREFERENCED_PARAMETER(interfaceName);
00268     UNREFERENCED_PARAMETER(invalidated);
00269
00270     alljoyn_msgarg changedProperties;
00271     size_t changedPropertyCount;
00272     if (ER_OK != alljoyn_msgarg_get(changed, "a{sv}", &changedPropertyCount, &changedProperties))
00273     {
00274         return;
00275     }
00276
00277     for (size_t i = 0; i < changedPropertyCount; i++)
00278     {
00279         char* propertyName;
00280         alljoyn_msgarg propertyValue;
00281         if (ER_OK != alljoyn_msgarg_get(alljoyn_msgarg_array_element(changedProperties, i), "{sv}", &propertyName, &propertyValue))
00282         {
00283             return;
00284         }
00285
00286
00287         if (strcmp("IsUpperCaseEnabled", propertyName) == 0)
00288         {
00289             bool argument;
00290             (void)TypeConversionHelpers::GetAllJoynMessageArg(propertyValue, "b", &argument);
00291             IsUpperCaseEnabledChanged(this, (Platform::Object^)argument);
00292         }
00293     }
00294 }
00295
00296 void SecureInterfaceConsumer::CallTextSentSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message)
00297 {
00298     auto source = SourceInterfaces.find(member->iface);
00299     if (source == SourceInterfaces.end())
00300     {
00301         return;
00302     }
00303
00304     auto consumer = source->second->Resolve<SecureInterfaceConsumer>();
00305     if (consumer->Signals != nullptr)
00306     {
00307         auto callInfo = ref new AllJoynMessageInfo(AllJoynHelpers::MultibyteToPlatformString(alljoyn_message_getsender(message)));
00308         auto eventArgs = ref new SecureInterfaceTextSentReceivedEventArgs();
00309         eventArgs->MessageInfo = callInfo;
00310
00311         Platform::String^ argument0;
00312         (void)TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "s", &argument0);
00313
00314         eventArgs->Message = argument0;
00315
00316         consumer->Signals->CallTextSentReceived(consumer->Signals, eventArgs);
00317     }
00318 }
00319
00320 int32 SecureInterfaceConsumer::Initialize(_In_ AllJoynServiceInfo^ serviceInfo)
00321 {
00322     std::vector<char> sessionNameUtf8 = AllJoynHelpers::PlatformToMultibyteString(serviceInfo->UniqueName);
00323
00324     ServiceObjectPath = serviceInfo->ObjectPath;
00325     std::vector<char> objectPath = AllJoynHelpers::PlatformToMultibyteString(ServiceObjectPath);
00326
00327     RETURN_IF_QSTATUS_ERROR(AllJoynHelpers::CreateInterfaces(m_busAttachment, c_SecureInterfaceIntrospectionXml));
00328
00329     m_session = create_task(AllJoynSession::GetFromServiceInfoAsync(serviceInfo, m_busAttachment)).get();
00330     if (nullptr == m_session)
00331     {
00332         return AllJoynStatus::Fail;
00333     }
00334     else if (m_session->Status != AllJoynStatus::Ok)
00335     {
00336         return m_session->Status;
00337     }
00338
00339     if (objectPath.empty())
00340     {
00341         return AllJoynStatus::Fail;
00342     }
00343
00344     ProxyBusObject = alljoyn_proxybusobject_create(m_nativeBusAttachment, &sessionNameUtf8[0], &objectPath[0], m_session->Id);
00345     if (nullptr == ProxyBusObject)
00346     {
00347         return AllJoynStatus::Fail;
00348     }
00349
00350     PCSTR propertyNames[] = { "IsUpperCaseEnabled" };
00351
00352     RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_registerpropertieschangedlistener(
00353         ProxyBusObject,
00354         m_interfaceName,
00355         propertyNames,
00356         _countof(propertyNames),
00357         AllJoynHelpers::PropertyChangedHandler<SecureInterfaceConsumer>,
00358         m_weak));
00359
00360
00361     alljoyn_interfacedescription description = alljoyn_busattachment_getinterface(m_nativeBusAttachment, m_interfaceName);
00362     if (nullptr == description)
00363     {
00364         return AllJoynStatus::Fail;
00365     }
00366
00367     m_busObject = ref new Windows::Devices::AllJoyn::AllJoynBusObject(ServiceObjectPath, m_busAttachment);
00368     m_nativeBusObject = AllJoynHelpers::GetInternalBusObject(m_busObject);
00369
00370     QStatus status = alljoyn_busobject_addinterface(m_nativeBusObject, description);
00371     if ((status != ER_OK) && (status != ER_BUS_IFACE_ALREADY_EXISTS))
00372     {
00373         return status;
00374     }
00375
00376
00377     QStatus result = AddSignalHandler(
00378         m_nativeBusAttachment,
00379         description,
00380         "TextSent",
00381         [](const alljoyn_interfacedescription_member* member, PCSTR srcPath, alljoyn_message message) { UNREFERENCED_PARAMETER(srcPath); CallTextSentSignalHandler(member, message); });
00382
00383     if (ER_OK != result)
00384     {
00385         return static_cast<int32>(result);
00386     }
00387
00388     SourceInterfaces[description] = m_weak;
00389
00390     unsigned int noneMechanismIndex = 0;
00391     bool authenticationMechanismsContainsNone = m_busAttachment->AuthenticationMechanisms->IndexOf(AllJoynAuthenticationMechanism::None, &noneMechanismIndex);
00392     QCC_BOOL interfaceIsSecure = alljoyn_interfacedescription_issecure(description);
00393
00394     // If the current set of AuthenticationMechanisms supports authentication,
00395     // determine whether to secure the connection.
00396     if (AllJoynHelpers::CanSecure(m_busAttachment->AuthenticationMechanisms))
00397     {
00398         // Secure the connection if the org.alljoyn.Bus.Secure XML annotation
00399         // is specified, or if None is not present in AuthenticationMechanisms.
00400         if (!authenticationMechanismsContainsNone || interfaceIsSecure)
00401         {
00402             RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_secureconnection(ProxyBusObject, QCC_FALSE));
00403             m_busObject->Start();
00404         }
00405         else
00406         {
00407             m_busObject->Start();
00408         }
00409     }
00410     else
00411     {
00412         // If the current set of AuthenticationMechanisms does not support authentication
00413         // but the interface requires security, report an error.
00414         if (interfaceIsSecure)
00415         {
00416             return static_cast<int32>(ER_BUS_NO_AUTHENTICATION_MECHANISM);
00417         }
00418         else
00419         {
00420             m_busObject->Start();
00421         }
00422     }
00423
00424     RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_addinterface(ProxyBusObject, description));
00425
00426     m_signals->Initialize(this);
00427
00428     return AllJoynStatus::Ok;
00429 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario1_AdvertiserCreate.xaml.cpp Source File

  • WiFiDirectServices
  • cpp

Scenario1_AdvertiserCreate.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_AdvertiserCreate.xaml.h"
00014
00015 using namespace SDKTemplate::WiFiDirectServices;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Devices::WiFiDirect::Services;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace std;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 Scenario1::Scenario1() : _rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036 }
00037
00038
00039 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00040 {
00041     ResetFields();
00042     WiFiDirectServiceManager::Instance->CurrentScenario1 = this;
00043 }
00044
00045 void Scenario1::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00046 {
00047     WiFiDirectServiceManager::Instance->CurrentScenario1 = nullptr;
00048 }
00049
00050 void Scenario1::ResetFields()
00051 {
00052     ServiceName->Text = "";
00053     AutoAccept->IsChecked = true;
00054     PreferGO->IsChecked = true;
00055     Status->SelectedIndex = 0;
00056     CustomStatus->Text = "";
00057     ConfigMethodDefault->IsChecked = true;
00058     ConfigMethodDispaly->IsChecked = true;
00059     ConfigMethodDisplayPin->Text = "";
00060     ConfigMethodKeypad->IsChecked = false;
00061     DeferredSessionInfo->Text = "";
00062     ServiceInformation->Text = "";
00063     ServicePrefixList->Items->Clear();
00064 }
00065
00066 void Scenario1::CreateAdvertiser_Click(Object^ sender, RoutedEventArgs^ e)
00067 {
00068     _rootPage->NotifyUser("Creating Advertisement", NotifyType::StatusMessage);
00069
00070     try
00071     {
00072         auto configMethods = ref new Vector<WiFiDirectServiceConfigurationMethod>();
00073
00074         if (ConfigMethodDispaly->IsChecked != nullptr && ConfigMethodDispaly->IsChecked->Value)
00075         {
00076             configMethods->Append(WiFiDirectServiceConfigurationMethod::PinDisplay);
00077         }
00078         if (ConfigMethodKeypad->IsChecked != nullptr && ConfigMethodKeypad->IsChecked->Value)
00079         {
00080             configMethods->Append(WiFiDirectServiceConfigurationMethod::PinEntry);
00081         }
00082         if (ConfigMethodDefault->IsChecked != nullptr && ConfigMethodDefault->IsChecked->Value)
00083         {
00084             configMethods->Append(WiFiDirectServiceConfigurationMethod::Default);
00085         }
00086
00087         WiFiDirectServiceStatus status = WiFiDirectServiceStatus::Available;
00088         if (Status->SelectedItem->ToString() == "Busy")
00089         {
00090             status = WiFiDirectServiceStatus::Busy;
00091         }
00092         else if (Status->SelectedItem->ToString() == "Custom")
00093         {
00094             status = WiFiDirectServiceStatus::Custom;
00095         }
00096
00097         unsigned int customStatus = 0;
00098         if (CustomStatus->Text->Length() > 0)
00099         {
00100             wistringstream ss(CustomStatus->Text->Data());
00101             ss >> customStatus;
00102         }
00103
00104         // NOTE: Each prefix published will be handled by the driver so there are limitations
00105         // to how many prefixes can be supported. In general, apps should only publish prefixes
00106         // of the service name that are required for discovery
00107         // Typically, this would be something like "com.example.games" for a service called "com.example.games.foobar"
00108         auto prefixList = ref new Vector<String^>();
00109         for (auto&& prefix : ServicePrefixList->Items)
00110         {
00111             // NOTE: these must be actual prefixes of the service name
00112             // Publication will fail if they are not
00113             prefixList->Append(dynamic_cast<String^>(static_cast<Object^>(prefix)));
00114         }
00115
00116         WiFiDirectServiceManager::Instance->StartAdvertisement(
00117             ServiceName->Text,
00118             (AutoAccept->IsChecked != nullptr) ? AutoAccept->IsChecked->Value : false,
00119             (PreferGO->IsChecked != nullptr) ? PreferGO->IsChecked->Value : false,
00120             ConfigMethodDisplayPin->Text,
00121             configMethods,
00122             status,
00123             customStatus,
00124             ServiceInformation->Text,
00125             DeferredSessionInfo->Text,
00126             prefixList
00127             );
00128
00129         ResetFields();
00130
00131         // Force navigation to the next page for smoother experience
00132         _rootPage->GoToScenario(1);
00133     }
00134     catch (Exception^ ex)
00135     {
00136         _rootPage->NotifyUser("Failed to start service: " + ex->Message, NotifyType::ErrorMessage);
00137     }
00138 }
00139
00140 void Scenario1::RemovePrefix_Click(Object^ sender, RoutedEventArgs^ e)
00141 {
00142     for (auto&& prefix : ServicePrefixList->SelectedItems)
00143     {
00144         for (unsigned int i = 0; i < ServicePrefixList->Items->Size; ++i)
00145         {
00146             String^ current = dynamic_cast<String^>(ServicePrefixList->Items->GetAt(i));
00147             if (current != nullptr && current == dynamic_cast<String^>(static_cast<Object^>(prefix)))
00148             {
00149                 ServicePrefixList->Items->RemoveAt(i);
00150                 // Quick fix to handle duplicates by walking the list again
00151                 i = 0;
00152             }
00153         }
00154     }
00155 }
00156
00157 void Scenario1::AddPrefix_Click(Object^ sender, RoutedEventArgs^ e)
00158 {
00159     if (NewPrefix->Text != "")
00160     {
00161         ServicePrefixList->Items->Append(NewPrefix->Text);
00162         NewPrefix->Text = "";
00163     }
00164 }
Generated on Fri Nov 15 2024 22:22:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/SampleConfiguration.cs Source File

  • MediaTranscoding
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Media Transcoding";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Transcode using default presets", ClassType=typeof(Scenario1_Default)},
00025             new Scenario() { Title="Transcode with custom settings", ClassType=typeof(Scenario2_Custom)},
00026             new Scenario() { Title="Trim and transcode", ClassType=typeof(Scenario3_Trim)}
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario3_InkingFeedback.cpp Source File

  • PenHaptics
  • cppwinrt

Scenario3_InkingFeedback.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleConfiguration.h"
00014 #include "Scenario3_InkingFeedback.h"
00015 #include "Scenario3_InkingFeedback.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Devices::Haptics;
00020 using namespace Windows::Devices::Input;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Input;
00024
00025
00026 // This sample shows how to play inking feedback tactile signals, how to
00027 // adjust the intensity of the tactile signal, and how to fall back to a default
00028 // waveform if the desired waveform is not supported by the current PenDevice
00029 namespace winrt::SDKTemplate::implementation
00030 {
00031     Scenario3_InkingFeedback::Scenario3_InkingFeedback()
00032     {
00033         InitializeComponent();
00034     }
00035
00036     // The PointerEnter event will get fired as soon as Pointer input is received.
00037     // This event handler implementation will query the device providing input to see if it's a pen and
00038     // then check to see the pen supports tactile feedback and, if so, configure the PenDevice
00039     // to send the appropriate tactile signal based on what is selected in the dropdown.
00040     void Scenario3_InkingFeedback::HapticCanvas_Entered(IInspectable const&, PointerRoutedEventArgs const& e)
00041     {
00042         // If the current Pointer device is not a pen, exit
00043         if (e.Pointer().PointerDeviceType() != PointerDeviceType::Pen)
00044         {
00045             return;
00046         }
00047
00048         // Attempt to retrieve the PenDevice from the current PointerId
00049         penDevice = PenDevice::GetFromPointerId(e.Pointer().PointerId());
00050
00051         // If a PenDevice cannot be retrieved based on the PointerId, it does not support
00052         // advanced pen features, such as tactile feedback
00053         if (penDevice == nullptr)
00054         {
00055             statusText().Text(L"Advanced pen features not supported");
00056             return;
00057         }
00058
00059         // Check to see if the current PenDevice supports tactile feedback by seeing if it
00060         // has a SimpleHapticsController
00061         hapticsController = penDevice.SimpleHapticsController();
00062         if (hapticsController == nullptr)
00063         {
00064             statusText().Text(L"This pen does not provide tactile feedback");
00065             return;
00066         }
00067
00068         // Get feedback based on the user's selected waveform and what the haptic controller supports
00069         std::wstring message;
00070         currentFeedback = GetSelectedFeedbackOrFallback(message);
00071
00072         // Send the current feedback to the PenDevice's SimpleHapticsController.
00073         // Once sent, inking tactile feedback will be triggered as soon as the pen tip touches
00074         // the screen and will be stopped once the pen tip is lifted from the screen.
00075         // Also, check to see if the current PenDevice's SimpleHapticsController supports
00076         // setting the intensity value of the tactile feedback.  If so, set it based
00077         // on the slider.  If not, send the waveform without custom intensity.
00078         if (hapticsController.IsIntensitySupported())
00079         {
00080             hapticsController.SendHapticFeedback(currentFeedback, intensitySlider().Value() / 100.0);
00081             message.append(L"\nIntensity set to " + to_hstring(intensitySlider().Value()) + L"%");
00082         }
00083         else
00084         {
00085             hapticsController.SendHapticFeedback(currentFeedback);
00086             message.append(L"\nSetting intensity is not supported by this pen");
00087         }
00088         statusText().Text(message);
00089     }
00090
00091     // Stop sending the tactile feedback and clear the current penDevice and hapticsController on PointerExit.
00092     // Stopping the feedback is important as it clears the tactile signal from the PenDevice's
00093     // SimpleHapticsController, ensuring that it has a clean state once it next enters range.
00094     void Scenario3_InkingFeedback::HapticCanvas_Exited(IInspectable const&, PointerRoutedEventArgs const&)
00095     {
00096         penDevice = nullptr;
00097         statusText().Text(L"");
00098         if (hapticsController != nullptr)
00099         {
00100             hapticsController.StopFeedback();
00101             hapticsController = nullptr;
00102             currentFeedback = nullptr;
00103         }
00104     }
00105
00106     // Get feedback which matches the currently selected waveform in the dropdown.
00107     // To get the feedback, the SimpleHapticsController's SupportedFeedback list must be traversed
00108     // to see if a matching feedback is present.
00109     // This is important because InkContinuous is the only Inking waveform required to be
00110     // supported by every pen with haptics.
00111     // If no matching feedback is found in the SupportedFeedback list, this method returns
00112     // InkContinuous as a guaranteed fallback.
00113     SimpleHapticsControllerFeedback Scenario3_InkingFeedback::GetSelectedFeedbackOrFallback(std::wstring& message)
00114     {
00115         // Look up the waveform the user selected.
00116         hstring name = waveformComboBox().SelectionBoxItem().as<hstring>();
00117         uint16_t waveform = WaveformNamesMap().at(name);
00118
00119         // See if the haptics controller supports the selected waveform.
00120         SimpleHapticsControllerFeedback feedback = FindSupportedFeedback(hapticsController, waveform);
00121         if (feedback != nullptr)
00122         {
00123             message = L"Waveform set to " + name;
00124             return feedback;
00125         }
00126
00127         // It does not. Use InkContinuous as a fallback.
00128         message = name + L" is not supported by this pen, so falling back to InkContinuous";
00129         return FindSupportedFeedback(hapticsController, KnownSimpleHapticsControllerWaveforms::InkContinuous());
00130     }
00131 }
Generated on Fri Nov 15 2024 22:20:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlayReadyInfo Member List

This is the complete list of members for PlayReadyInfo, including all inherited members.
PlayReadyInfo() PlayReadyInfo [inline]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/CustomTitleBar.xaml.cs Source File

  • TitleBar
  • cs

CustomTitleBar.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.ComponentModel;
00003 using Windows.ApplicationModel.Core;
00004 using Windows.UI.Core;
00005 using Windows.UI.ViewManagement;
00006 using Windows.UI.Xaml;
00007 using Windows.UI.Xaml.Controls;
00008
00009 namespace SDKTemplate
00010 {
00011     public sealed partial class CustomTitleBar : UserControl, INotifyPropertyChanged
00012     {
00013         private CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
00014
00015         public CustomTitleBar()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         void CustomTitleBar_Loaded(object sender, RoutedEventArgs e)
00021         {
00022             coreTitleBar.LayoutMetricsChanged += OnLayoutMetricsChanged;
00023             coreTitleBar.IsVisibleChanged += OnIsVisibleChanged;
00024
00025             // The SizeChanged event is raised when the view enters or exits full screen mode.
00026             Window.Current.SizeChanged += OnWindowSizeChanged;
00027
00028             UpdateLayoutMetrics();
00029             UpdatePositionAndVisibility();
00030         }
00031
00032         void CustomTitleBar_Unloaded(object sender, RoutedEventArgs e)
00033         {
00034             coreTitleBar.LayoutMetricsChanged -= OnLayoutMetricsChanged;
00035             coreTitleBar.IsVisibleChanged -= OnIsVisibleChanged;
00036             Window.Current.SizeChanged -= OnWindowSizeChanged;
00037         }
00038
00039         void OnLayoutMetricsChanged(CoreApplicationViewTitleBar sender, object e)
00040         {
00041             UpdateLayoutMetrics();
00042         }
00043
00044         void UpdateLayoutMetrics()
00045         {
00046             if (PropertyChanged != null)
00047             {
00048                 PropertyChanged(this, new PropertyChangedEventArgs("CoreTitleBarHeight"));
00049                 PropertyChanged(this, new PropertyChangedEventArgs("CoreTitleBarPadding"));
00050             }
00051         }
00052
00053         void OnIsVisibleChanged(CoreApplicationViewTitleBar sender, object e)
00054         {
00055             UpdatePositionAndVisibility();
00056         }
00057
00058         void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
00059         {
00060             UpdatePositionAndVisibility();
00061         }
00062
00063         // We wrap the normal contents of the MainPage inside a grid
00064         // so that we can place a title bar on top of it.
00065         //
00066         // When not in full screen mode, the grid looks like this:
00067         //
00068         //      Row 0: Custom-rendered title bar
00069         //      Row 1: Rest of content
00070         //
00071         // In full screen mode, the the grid looks like this:
00072         //
00073         //      Row 0: (empty)
00074         //      Row 1: Custom-rendered title bar
00075         //      Row 1: Rest of content
00076         //
00077         // The title bar is either Visible or Collapsed, depending on the value of
00078         // the IsVisible property.
00079         void UpdatePositionAndVisibility()
00080         {
00081             if (ApplicationView.GetForCurrentView().IsFullScreenMode)
00082             {
00083                 // In full screen mode, the title bar overlays the content.
00084                 // and might or might not be visible.
00085                 TitleBar.Visibility = coreTitleBar.IsVisible ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
00086                 Grid.SetRow(TitleBar, 1);
00087             }
00088             else
00089             {
00090                 // When not in full screen mode, the title bar is visible and does not overlay content.
00091                 TitleBar.Visibility = Windows.UI.Xaml.Visibility.Visible;
00092                 Grid.SetRow(TitleBar, 0);
00093             }
00094         }
00095
00096         UIElement pageContent = null;
00097
00098         public UIElement SetPageContent(UIElement newContent)
00099         {
00100             UIElement oldContent = pageContent;
00101             if (oldContent != null)
00102             {
00103                 pageContent = null;
00104                 RootGrid.Children.Remove(oldContent);
00105             }
00106             pageContent = newContent;
00107             if (newContent != null)
00108             {
00109                 RootGrid.Children.Add(newContent);
00110                 // The page content is row 1 in our grid. (See diagram above.)
00111                 Grid.SetRow((FrameworkElement)pageContent, 1);
00112             }
00113             return oldContent;
00114         }
00115
00116         #region Data binding
00117         public event PropertyChangedEventHandler PropertyChanged;
00118
00119         public Thickness CoreTitleBarPadding
00120         {
00121             get
00122             {
00123                 // The SystemOverlayLeftInset and SystemOverlayRightInset values are
00124                 // in terms of physical left and right. Therefore, we need to flip
00125                 // then when our flow direction is RTL.
00126                 if (FlowDirection == FlowDirection.LeftToRight)
00127                 {
00128                     return new Thickness() { Left = coreTitleBar.SystemOverlayLeftInset, Right = coreTitleBar.SystemOverlayRightInset };
00129                 }
00130                 else
00131                 {
00132                     return new Thickness() { Left = coreTitleBar.SystemOverlayRightInset, Right = coreTitleBar.SystemOverlayLeftInset };
00133                 }
00134             }
00135         }
00136
00137         public double CoreTitleBarHeight
00138         {
00139             get
00140             {
00141                 return coreTitleBar.Height;
00142             }
00143         }
00144         #endregion
00145
00146         public void EnableControlsInTitleBar(bool enable)
00147         {
00148             if (enable)
00149             {
00150                 TitleBarControl.Visibility = Visibility.Visible;
00151                 // Clicks on the BackgroundElement will be treated as clicks on the title bar.
00152                 Window.Current.SetTitleBar(BackgroundElement);
00153             }
00154             else
00155             {
00156                 TitleBarControl.Visibility = Visibility.Collapsed;
00157                 Window.Current.SetTitleBar(null);
00158             }
00159         }
00160     }
00161 }
Generated on Fri Nov 15 2024 22:21:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/Project.idl Source File

  • Unicode
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_FindId : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_FindId();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_ListConstraint Member List

This is the complete list of members for Scenario_ListConstraint, including all inherited members.
cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario_ListConstraint | [inline, private]
HResultPrivacyStatementDeclined | Scenario_ListConstraint | [private, static]
HResultRecognizerNotFound | Scenario_ListConstraint | [private, static]
InitializeRecognizer(Language recognizerLanguage) | Scenario_ListConstraint | [inline, private]
isPopulatingLanguages | Scenario_ListConstraint | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario_ListConstraint | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario_ListConstraint | [inline, protected]
PopulateLanguageDropdown() | Scenario_ListConstraint | [inline, private]
recognitionOperation | Scenario_ListConstraint | [private]
RecognizeWithoutUIListConstraint_Click(object sender, RoutedEventArgs e) | Scenario_ListConstraint | [inline, private]
RecognizeWithUIListConstraint_Click(object sender, RoutedEventArgs e) | Scenario_ListConstraint | [inline, private]
Scenario_ListConstraint() | Scenario_ListConstraint | [inline]
speechContext | Scenario_ListConstraint | [private]
speechRecognizer | Scenario_ListConstraint | [private]
SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) | Scenario_ListConstraint | [inline, private]
speechResourceMap | Scenario_ListConstraint | [private]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/SuspensionManager.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common

SuspensionManager.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using System.Linq;
00016 using System.Runtime.Serialization;
00017 using System.Text;
00018 using System.Threading.Tasks;
00019 using Windows.ApplicationModel;
00020 using Windows.Storage;
00021 using Windows.Storage.Streams;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024
00025 namespace AdventureWorks.Common
00026 {
00027     /// <summary>
00028     /// SuspensionManager captures global session state to simplify process lifetime management
00029     /// for an application.  Note that session state will be automatically cleared under a variety
00030     /// of conditions and should only be used to store information that would be convenient to
00031     /// carry across sessions, but that should be discarded when an application crashes or is
00032     /// upgraded.
00033     /// </summary>
00034     internal sealed class SuspensionManager
00035     {
00036         private static Dictionary<string, object> _sessionState = new Dictionary<string, object>();
00037         private static List<Type> _knownTypes = new List<Type>();
00038         private const string sessionStateFilename = "_sessionState.xml";
00039
00040         /// <summary>
00041         /// Provides access to global session state for the current session.  This state is
00042         /// serialized by <see cref="SaveAsync"/> and restored by
00043         /// <see cref="RestoreAsync"/>, so values must be serializable by
00044         /// <see cref="DataContractSerializer"/> and should be as compact as possible.  Strings
00045         /// and other self-contained data types are strongly recommended.
00046         /// </summary>
00047         public static Dictionary<string, object> SessionState
00048         {
00049             get { return _sessionState; }
00050         }
00051
00052         /// <summary>
00053         /// List of custom types provided to the <see cref="DataContractSerializer"/> when
00054         /// reading and writing session state.  Initially empty, additional types may be
00055         /// added to customize the serialization process.
00056         /// </summary>
00057         public static List<Type> KnownTypes
00058         {
00059             get { return _knownTypes; }
00060         }
00061
00062         /// <summary>
00063         /// Save the current <see cref="SessionState"/>.  Any <see cref="Frame"/> instances
00064         /// registered with <see cref="RegisterFrame"/> will also preserve their current
00065         /// navigation stack, which in turn gives their active <see cref="Page"/> an opportunity
00066         /// to save its state.
00067         /// </summary>
00068         /// <returns>An asynchronous task that reflects when session state has been saved.</returns>
00069         public static async Task SaveAsync()
00070         {
00071             try
00072             {
00073                 // Save the navigation state for all registered frames
00074                 foreach (var weakFrameReference in _registeredFrames)
00075                 {
00076                     Frame frame;
00077                     if (weakFrameReference.TryGetTarget(out frame))
00078                     {
00079                         SaveFrameNavigationState(frame);
00080                     }
00081                 }
00082
00083                 // Serialize the session state synchronously to avoid asynchronous access to shared
00084                 // state
00085                 MemoryStream sessionData = new MemoryStream();
00086                 DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
00087                 serializer.WriteObject(sessionData, _sessionState);
00088
00089                 // Get an output stream for the SessionState file and write the state asynchronously
00090                 StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sessionStateFilename, CreationCollisionOption.ReplaceExisting);
00091                 using (Stream fileStream = await file.OpenStreamForWriteAsync())
00092                 {
00093                     sessionData.Seek(0, SeekOrigin.Begin);
00094                     await sessionData.CopyToAsync(fileStream);
00095                 }
00096             }
00097             catch (Exception e)
00098             {
00099                 throw new SuspensionManagerException(e);
00100             }
00101         }
00102
00103         /// <summary>
00104         /// Restores previously saved <see cref="SessionState"/>.  Any <see cref="Frame"/> instances
00105         /// registered with <see cref="RegisterFrame"/> will also restore their prior navigation
00106         /// state, which in turn gives their active <see cref="Page"/> an opportunity restore its
00107         /// state.
00108         /// </summary>
00109         /// <param name="sessionBaseKey">An optional key that identifies the type of session.
00110         /// This can be used to distinguish between multiple application launch scenarios.</param>
00111         /// <returns>An asynchronous task that reflects when session state has been read.  The
00112         /// content of <see cref="SessionState"/> should not be relied upon until this task
00113         /// completes.</returns>
00114         public static async Task RestoreAsync(String sessionBaseKey = null)
00115         {
00116             _sessionState = new Dictionary<String, Object>();
00117
00118             try
00119             {
00120                 // Get the input stream for the SessionState file
00121                 StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
00122                 using (IInputStream inStream = await file.OpenSequentialReadAsync())
00123                 {
00124                     // Deserialize the Session State
00125                     DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
00126                     _sessionState = (Dictionary<string, object>)serializer.ReadObject(inStream.AsStreamForRead());
00127                 }
00128
00129                 // Restore any registered frames to their saved state
00130                 foreach (var weakFrameReference in _registeredFrames)
00131                 {
00132                     Frame frame;
00133                     if (weakFrameReference.TryGetTarget(out frame) && (string)frame.GetValue(FrameSessionBaseKeyProperty) == sessionBaseKey)
00134                     {
00135                         frame.ClearValue(FrameSessionStateProperty);
00136                         RestoreFrameNavigationState(frame);
00137                     }
00138                 }
00139             }
00140             catch (Exception e)
00141             {
00142                 throw new SuspensionManagerException(e);
00143             }
00144         }
00145
00146         private static DependencyProperty FrameSessionStateKeyProperty =
00147             DependencyProperty.RegisterAttached("_FrameSessionStateKey", typeof(String), typeof(SuspensionManager), null);
00148         private static DependencyProperty FrameSessionBaseKeyProperty =
00149             DependencyProperty.RegisterAttached("_FrameSessionBaseKeyParams", typeof(String), typeof(SuspensionManager), null);
00150         private static DependencyProperty FrameSessionStateProperty =
00151             DependencyProperty.RegisterAttached("_FrameSessionState", typeof(Dictionary<String, Object>), typeof(SuspensionManager), null);
00152         private static List<WeakReference<Frame>> _registeredFrames = new List<WeakReference<Frame>>();
00153
00154         /// <summary>
00155         /// Registers a <see cref="Frame"/> instance to allow its navigation history to be saved to
00156         /// and restored from <see cref="SessionState"/>.  Frames should be registered once
00157         /// immediately after creation if they will participate in session state management.  Upon
00158         /// registration if state has already been restored for the specified key
00159         /// the navigation history will immediately be restored.  Subsequent invocations of
00160         /// <see cref="RestoreAsync"/> will also restore navigation history.
00161         /// </summary>
00162         /// <param name="frame">An instance whose navigation history should be managed by
00163         /// <see cref="SuspensionManager"/></param>
00164         /// <param name="sessionStateKey">A unique key into <see cref="SessionState"/> used to
00165         /// store navigation-related information.</param>
00166         /// <param name="sessionBaseKey">An optional key that identifies the type of session.
00167         /// This can be used to distinguish between multiple application launch scenarios.</param>
00168         public static void RegisterFrame(Frame frame, String sessionStateKey, String sessionBaseKey = null)
00169         {
00170             if (frame.GetValue(FrameSessionStateKeyProperty) != null)
00171             {
00172                 throw new InvalidOperationException("Frames can only be registered to one session state key");
00173             }
00174
00175             if (frame.GetValue(FrameSessionStateProperty) != null)
00176             {
00177                 throw new InvalidOperationException("Frames must be either be registered before accessing frame session state, or not registered at all");
00178             }
00179
00180             if (!string.IsNullOrEmpty(sessionBaseKey))
00181             {
00182                 frame.SetValue(FrameSessionBaseKeyProperty, sessionBaseKey);
00183                 sessionStateKey = sessionBaseKey + "_" + sessionStateKey;
00184             }
00185
00186             // Use a dependency property to associate the session key with a frame, and keep a list of frames whose
00187             // navigation state should be managed
00188             frame.SetValue(FrameSessionStateKeyProperty, sessionStateKey);
00189             _registeredFrames.Add(new WeakReference<Frame>(frame));
00190
00191             // Check to see if navigation state can be restored
00192             RestoreFrameNavigationState(frame);
00193         }
00194
00195         /// <summary>
00196         /// Disassociates a <see cref="Frame"/> previously registered by <see cref="RegisterFrame"/>
00197         /// from <see cref="SessionState"/>.  Any navigation state previously captured will be
00198         /// removed.
00199         /// </summary>
00200         /// <param name="frame">An instance whose navigation history should no longer be
00201         /// managed.</param>
00202         public static void UnregisterFrame(Frame frame)
00203         {
00204             // Remove session state and remove the frame from the list of frames whose navigation
00205             // state will be saved (along with any weak references that are no longer reachable)
00206             SessionState.Remove((String)frame.GetValue(FrameSessionStateKeyProperty));
00207             _registeredFrames.RemoveAll((weakFrameReference) =>
00208             {
00209                 Frame testFrame;
00210                 return !weakFrameReference.TryGetTarget(out testFrame) || testFrame == frame;
00211             });
00212         }
00213
00214         /// <summary>
00215         /// Provides storage for session state associated with the specified <see cref="Frame"/>.
00216         /// Frames that have been previously registered with <see cref="RegisterFrame"/> have
00217         /// their session state saved and restored automatically as a part of the global
00218         /// <see cref="SessionState"/>.  Frames that are not registered have transient state
00219         /// that can still be useful when restoring pages that have been discarded from the
00220         /// navigation cache.
00221         /// </summary>
00222         /// <remarks>Apps may choose to rely on <see cref="NavigationHelper"/> to manage
00223         /// page-specific state instead of working with frame session state directly.</remarks>
00224         /// <param name="frame">The instance for which session state is desired.</param>
00225         /// <returns>A collection of state subject to the same serialization mechanism as
00226         /// <see cref="SessionState"/>.</returns>
00227         public static Dictionary<String, Object> SessionStateForFrame(Frame frame)
00228         {
00229             var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);
00230
00231             if (frameState == null)
00232             {
00233                 var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
00234                 if (frameSessionKey != null)
00235                 {
00236                     // Registered frames reflect the corresponding session state
00237                     if (!_sessionState.ContainsKey(frameSessionKey))
00238                     {
00239                         _sessionState[frameSessionKey] = new Dictionary<String, Object>();
00240                     }
00241                     frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
00242                 }
00243                 else
00244                 {
00245                     // Frames that aren't registered have transient state
00246                     frameState = new Dictionary<String, Object>();
00247                 }
00248                 frame.SetValue(FrameSessionStateProperty, frameState);
00249             }
00250             return frameState;
00251         }
00252
00253         private static void RestoreFrameNavigationState(Frame frame)
00254         {
00255             var frameState = SessionStateForFrame(frame);
00256             if (frameState.ContainsKey("Navigation"))
00257             {
00258                 frame.SetNavigationState((String)frameState["Navigation"]);
00259             }
00260         }
00261
00262         private static void SaveFrameNavigationState(Frame frame)
00263         {
00264             var frameState = SessionStateForFrame(frame);
00265             frameState["Navigation"] = frame.GetNavigationState();
00266         }
00267     }
00268     public class SuspensionManagerException : Exception
00269     {
00270         public SuspensionManagerException()
00271         {
00272         }
00273
00274         public SuspensionManagerException(Exception e)
00275             : base("SuspensionManager failed", e)
00276         {
00277
00278         }
00279     }
00280 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AdvertisementWrapper Member List

This is the complete list of members for AdvertisementWrapper, including all inherited members.
AcceptSessionRequest(string id, string pin="") | AdvertisementWrapper | [inline]
AdvertisementWrapper(WiFiDirectServiceAdvertiser advertiser, WiFiDirectServiceManager manager, string pin="") | AdvertisementWrapper | [inline]
Advertiser | AdvertisementWrapper |
advertiser | AdvertisementWrapper | [private]
DeclineSessionRequest(string id) | AdvertisementWrapper | [inline]
Dispose() | AdvertisementWrapper | [inline]
Dispose(bool disposing) | AdvertisementWrapper | [inline, protected, virtual]
disposed | AdvertisementWrapper | [private]
InternalId | AdvertisementWrapper |
manager | AdvertisementWrapper | [private]
Name | AdvertisementWrapper |
nextId | AdvertisementWrapper | [private, static]
OnAdvertisementStatusChanged(WiFiDirectServiceAdvertiser sender, object args) | AdvertisementWrapper | [inline, private]
OnAutoAcceptSessionConnected(WiFiDirectServiceAdvertiser sender, WiFiDirectServiceAutoAcceptSessionConnectedEventArgs args) | AdvertisementWrapper | [inline, private]
OnSessionRequested(WiFiDirectServiceAdvertiser sender, WiFiDirectServiceSessionRequestedEventArgs args) | AdvertisementWrapper | [inline, private]
pin | AdvertisementWrapper | [private]
Pin | AdvertisementWrapper |
requestList | AdvertisementWrapper | [private]
SessionRequestList | AdvertisementWrapper |
Status | AdvertisementWrapper |
thisLock | AdvertisementWrapper | [private]
ThrowIfDisposed() | AdvertisementWrapper | [inline, private]
uniqueInternalId | AdvertisementWrapper | [private]
~AdvertisementWrapper() | AdvertisementWrapper | [inline, private]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/App.xaml.h Source File

  • Projection
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015
00016 namespace SDKSample
00017 {
00018     /// <summary>
00019     /// Provides application-specific behavior to supplement the default Application class.
00020     /// </summary>
00021     ref class App sealed
00022     {
00023     protected:
00024         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00025
00026     internal:
00027         App();
00028
00029     private:
00030         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00031         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00032     };
00033 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/Project.idl Source File

  • AppServices
  • cppwinrt
  • AppServicesProvider

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass ShowPackageFamilyName : Windows.UI.Xaml.Controls.Page
00016     {
00017         ShowPackageFamilyName();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaItem Member List

This is the complete list of members for MediaItem, including all inherited members.
ItemId | MediaItem |
MediaItem() | MediaItem | [inline]
MediaItem(JsonObject json) | MediaItem | [inline]
MediaItemIdKey | MediaItem |
MediaUri | MediaItem |
previewImageUri | MediaItem | [private]
PreviewImageUri | MediaItem |
Title | MediaItem |
ToPlaybackItem() | MediaItem | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario2.xaml.h Source File

  • DatagramSocket
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2.xaml.h
00014 // Declaration of the Scenario2 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace DatagramSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario2 sealed
00032         {
00033         public:
00034             Scenario2();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             MainPage^ rootPage;
00040             void ConnectSocket_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         };
00042
00043         [Windows::Foundation::Metadata::WebHostHidden]
00044         public ref class SocketContext sealed
00045         {
00046         public:
00047             SocketContext(MainPage^ rootPage, Windows::Networking::Sockets::DatagramSocket^ socket);
00048             void OnMessage(
00049                 Windows::Networking::Sockets::DatagramSocket^ socket,
00050                 Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^ eventArguments);
00051             Windows::Storage::Streams::DataWriter^ GetWriter();
00052             boolean IsConnected();
00053             void SetConnected();
00054
00055         private:
00056             ~SocketContext();
00057             MainPage^ rootPage;
00058             Windows::Networking::Sockets::DatagramSocket^ socket;
00059             Windows::Storage::Streams::DataWriter^ writer;
00060             boolean connected;
00061
00062             void NotifyUserFromAsyncThread(Platform::String^ message, NotifyType type);
00063         };
00064     }
00065 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario3_Notifications.xaml.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario3_Notifications.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Notifications.xaml.cpp
00014 // Implementation of the Scenario3_Notifications class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_Notifications.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Platform::Collections;
00025 using namespace SDKTemplate;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Notifications;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace Windows::Networking::BackgroundTransfer;
00032 using namespace Windows::Web;
00033 using namespace Windows::Foundation;
00034 using namespace Windows::Foundation::Collections;
00035 using namespace Windows::Storage;
00036 using namespace Windows::Data::Xml::Dom;
00037
00038 UINT32 Scenario3_Notifications::runId = 0;
00039
00040 Scenario3_Notifications::Scenario3_Notifications()
00041 {
00042     // Use a unique group name so that no other component in the app uses the same group. The recommended way
00043     // is to generate a GUID and use it as group name as shown below.
00044     notificationsGroup = BackgroundTransferGroup::CreateGroup("{C3E919D3-1AE1-4EB8-9E2C-6E92CEF93E6B}");
00045
00046     // When creating a group, we can optionally define the transfer behavior of transfers associated with the
00047     // group. A "parallel" transfer behavior allows multiple transfers in the same group to run concurrently
00048     // (default). A "serialized" transfer behavior allows at most one default priority transfer at a time for
00049     // the group.
00050     notificationsGroup->TransferBehavior = BackgroundTransferBehavior::Parallel;
00051
00052     InitializeComponent();
00053 }
00054
00055 Scenario3_Notifications::~Scenario3_Notifications()
00056 {
00057 }
00058
00059 /// <summary>
00060 /// Invoked when this page is about to be displayed in a Frame.
00061 /// </summary>
00062 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00063 /// property is typically used to configure the page.</param>
00064 void Scenario3_Notifications::OnNavigatedTo(NavigationEventArgs^ e)
00065 {
00066     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00067     // as NotifyUser()
00068     rootPage = MainPage::Current;
00069
00070     // An application must enumerate downloads when it gets started to prevent stale downloads/uploads.
00071     // Typically this can be done in the App class by overriding OnLaunched() and checking for
00072     // "args->Kind == ActivationKind::Launch" to detect an actual app launch.
00073     // We do it here in the sample to keep the sample code consolidated.
00074     // Note that for this specific scenario we're not interested in downloads from previous instances:
00075     // We'll just enumerate downloads from previous instances and cancel them immediately.
00076     CancelActiveDownloads();
00077 }
00078
00079 void Scenario3_Notifications::CancelActiveDownloads()
00080 {
00081     // Note that we only enumerate transfers that belong to the transfer group used by this sample scenario.
00082     // We'll not enumerate transfers started by other sample scenarios in this app.
00083     create_task(BackgroundDownloader::GetCurrentDownloadsForTransferGroupAsync(notificationsGroup))
00084         .then([this] (IVectorView<DownloadOperation^>^ downloads)
00085     {
00086         if (downloads->Size > 0)
00087         {
00088             cancellation_token_source cancellationToken;
00089
00090             for (unsigned int i = 0; i < downloads->Size; i++)
00091             {
00092                 create_task(downloads->GetAt(i)->AttachAsync(), cancellationToken.get_token())
00093                     .then([this] (task<DownloadOperation^> previousTask)
00094                 {
00095                     try
00096                     {
00097                         previousTask.get();
00098                     }
00099                     catch (Exception^ ex)
00100                     {
00101                         // Ignore errors: We're just interested in canceling all downloads from previous instances.
00102                     }
00103                 });
00104             }
00105
00106             // Now cancel all downloads that were started by a previous instance of this sample scenario.
00107             cancellationToken.cancel();
00108
00109             Log("Canceled " + downloads->Size + " downloads from previous instances of this scenario.");
00110         }
00111
00112         // After cleaning up downloads from previous scenarios, enable buttons to allow the user to run the sample.
00113         ToastNotificationButton->IsEnabled = true;
00114         TileNotificationButton->IsEnabled = true;
00115
00116     }).then([this] (task<void> previousTask)
00117     {
00118         try
00119         {
00120             previousTask.get();
00121         }
00122         catch (Exception^ ex)
00123         {
00124             LogException("Discovery error", ex);
00125         }
00126     });
00127 }
00128
00129 void Scenario3_Notifications::ToastNotificationButton_Click(Object^ sender, RoutedEventArgs^ e)
00130 {
00131     // Create a downloader and associate all its downloads with the transfer group used for this scenario.
00132     BackgroundDownloader^ downloader = ref new BackgroundDownloader();
00133     downloader->TransferGroup = notificationsGroup;
00134
00135     // Create a ToastNotification that should be shown when all transfers succeed.
00136     XmlDocument^ successToastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText01);
00137     successToastXml->GetElementsByTagName("text")->Item(0)->InnerText =
00138         "All three downloads completed successfully.";
00139     ToastNotification^ successToast = ref new ToastNotification(successToastXml);
00140     downloader->SuccessToastNotification = successToast;
00141
00142     // Create a ToastNotification that should be shown if at least one transfer fails.
00143     XmlDocument^ failureToastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText01);
00144     failureToastXml->GetElementsByTagName("text")->Item(0)->InnerText =
00145         "At least one download completed with failure.";
00146     ToastNotification^ failureToast = ref new ToastNotification(failureToastXml);
00147     downloader->FailureToastNotification = failureToast;
00148
00149     // Now create and start downloads for the configured BackgroundDownloader object.
00150     RunDownloads(downloader, ScenarioType::Toast);
00151 }
00152
00153 void Scenario3_Notifications::TileNotificationButton_Click(Object^ sender, RoutedEventArgs^ e)
00154 {
00155     // Create a downloader and associate all its downloads with the transfer group used for this scenario.
00156     BackgroundDownloader^ downloader = ref new BackgroundDownloader();
00157     downloader->TransferGroup = notificationsGroup;
00158
00159     FILETIME nowFileTime;
00160     GetSystemTimeAsFileTime(&nowFileTime);
00161     ULARGE_INTEGER now;
00162     now.LowPart = nowFileTime.dwLowDateTime;
00163     now.HighPart = nowFileTime.dwHighDateTime;
00164     DateTime nowPlusTenMinutes;
00165     nowPlusTenMinutes.UniversalTime = now.QuadPart + tenMinutesIn100NanoSecondUnits;
00166
00167     // Create a TileNotification that should be shown when all transfers succeed.
00168     XmlDocument^ successTileXml = TileUpdateManager::GetTemplateContent(TileTemplateType::TileSquare150x150Text03);
00169     XmlNodeList^ successTextNodes = successTileXml->GetElementsByTagName("text");
00170     successTextNodes->Item(0)->InnerText = "All three";
00171     successTextNodes->Item(1)->InnerText = "downloads";
00172     successTextNodes->Item(2)->InnerText = "completed";
00173     successTextNodes->Item(3)->InnerText = "successfully.";
00174     TileNotification^ successTile = ref new TileNotification(successTileXml);
00175     successTile->ExpirationTime = nowPlusTenMinutes;
00176     downloader->SuccessTileNotification = successTile;
00177
00178     // Create a TileNotification that should be shown if at least one transfer fails.
00179     XmlDocument^ failureTileXml = TileUpdateManager::GetTemplateContent(TileTemplateType::TileSquare150x150Text03);
00180     XmlNodeList^ failureTextNodes = failureTileXml->GetElementsByTagName("text");
00181     failureTextNodes->Item(0)->InnerText = "At least";
00182     failureTextNodes->Item(1)->InnerText = "one download";
00183     failureTextNodes->Item(2)->InnerText = "completed";
00184     failureTextNodes->Item(3)->InnerText = "with failure.";
00185     TileNotification^ failureTile = ref new TileNotification(failureTileXml);
00186     failureTile->ExpirationTime = nowPlusTenMinutes;
00187     downloader->FailureTileNotification = failureTile;
00188
00189     // Now create and start downloads for the configured BackgroundDownloader object.
00190     RunDownloads(downloader, ScenarioType::Tile);
00191 }
00192
00193 void Scenario3_Notifications::RunDownloads(BackgroundDownloader^ downloader, ScenarioType type)
00194 {
00195     // Use a unique ID for every button click, to help the user associate downloads of the same run in the logs.
00196     runId++;
00197
00198     std::vector<task<void>> createDownloadTasks;
00199     Vector<DownloadOperation^>^ downloadOperations = ref new Vector<DownloadOperation^>();
00200
00201     // First we create three download operations: Note that we don't start downloads immediately. It is
00202     // important to first create all operations that should participate in the toast/tile update. Once all
00203     // operations have been created, we can start them.
00204     // If we start a download and create a second one afterwards, there is a race where the first download
00205     // may complete before we were able to create the second one. This would result in the toast/tile being
00206     // shown before we even create the second download.
00207     task<void> current;
00208     if (!TryCreateDownloadAsync(downloader, 1, L"FastDownload", type, downloadOperations, current))
00209     {
00210         return;
00211     }
00212     createDownloadTasks.push_back(current);
00213
00214     if (!TryCreateDownloadAsync(downloader, 5, L"MediumDownload", type, downloadOperations, current))
00215     {
00216         return;
00217     }
00218     createDownloadTasks.push_back(current);
00219
00220     if (!TryCreateDownloadAsync(downloader, 10, L"SlowDownload", type, downloadOperations, current))
00221     {
00222         return;
00223     }
00224     createDownloadTasks.push_back(current);
00225
00226     when_all(createDownloadTasks.begin(), createDownloadTasks.end()).then([this, downloadOperations]
00227     {
00228         if (downloadOperations->Size != 3)
00229         {
00230             // At least one of the three downloads couldn't be created. Just return and don't start remaining downloads.
00231             return;
00232         }
00233
00234         // Once all downloads participating in the toast/tile update have been created, start them.
00235         for (unsigned int i = 0; i < downloadOperations->Size; i++)
00236         {
00237             RunDownload(downloadOperations->GetAt(i));
00238         }
00239     }).then([this] (task<void> previousTask)
00240     {
00241         try
00242         {
00243             previousTask.get();
00244         }
00245         catch (Exception^ ex)
00246         {
00247             LogException("Starting downloads", ex);
00248         }
00249     });
00250 }
00251
00252 bool Scenario3_Notifications::TryCreateDownloadAsync(
00253     BackgroundDownloader^ downloader,
00254     UINT8 delaySeconds,
00255     String^ fileNameSuffix,
00256     ScenarioType type,
00257     Vector<DownloadOperation^>^ downloadOperations,
00258     task<void>& resultTask)
00259 {
00260     String^ sourceString = serverAddressField->Text + "?delay=" + delaySeconds;
00261
00262     Uri^ source;
00263     if (!rootPage->TryGetUri(sourceString, &source))
00264     {
00265         rootPage->NotifyUser("Unable to create the source URI.", NotifyType::ErrorMessage);
00266         return false;
00267     }
00268
00269     String^ fileName = ((type == ScenarioType::Tile) ? L"Tile" : L"Toast") + "." + runId + "." + fileNameSuffix + ".txt";
00270     resultTask = create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
00271         .then([fileName](StorageFolder^ picturesLibrary)
00272     {
00273         return picturesLibrary->CreateFileAsync(fileName, CreationCollisionOption::GenerateUniqueName);
00274     }).then([this, source, downloader, downloadOperations] (StorageFile^ destinationFile)
00275     {
00276         downloadOperations->Append(downloader->CreateDownload(source, destinationFile));
00277
00278     }).then([this] (task<void> previousTask)
00279     {
00280         try
00281         {
00282             previousTask.get();
00283         }
00284         catch (Exception^ ex)
00285         {
00286             LogException("Create file error", ex);
00287         }
00288     });
00289
00290     return true;
00291 }
00292
00293 void Scenario3_Notifications::RunDownload(DownloadOperation^ download)
00294 {
00295     Log("Downloading " + download->ResultFile->Name);
00296
00297     create_task(download->StartAsync()).then([this] (DownloadOperation^ download)
00298     {
00299         LogStatus("Downloading " + download->ResultFile->Name + " completed.", NotifyType::StatusMessage);
00300
00301     }).then([this, download] (task<void> previousTask)
00302     {
00303         try
00304         {
00305             previousTask.get();
00306         }
00307         catch (Exception^ ex)
00308         {
00309             LogException("Execution error", ex, download);
00310         }
00311     });
00312 }
00313
00314 void Scenario3_Notifications::LogException(String^ title, Exception^ ex, DownloadOperation^ download)
00315 {
00316     String^ fullTitle;
00317     if (download != nullptr)
00318     {
00319         fullTitle = title + " - " + download->ResultFile->Name;
00320     }
00321     else
00322     {
00323         fullTitle = title;
00324     }
00325
00326     WebErrorStatus error = BackgroundTransferError::GetStatus(ex->HResult);
00327     if (error == WebErrorStatus::Unknown)
00328     {
00329         LogStatus(fullTitle + ": " + ex, NotifyType::ErrorMessage);
00330     }
00331     else
00332     {
00333         LogStatus(fullTitle + ": " + error.ToString(), NotifyType::ErrorMessage);
00334     }
00335 }
00336
00337 void Scenario3_Notifications::Log(String^ message)
00338 {
00339     outputField->Text += message + "\r\n";
00340 }
00341
00342 void Scenario3_Notifications::LogStatus(String^ message, NotifyType type)
00343 {
00344     rootPage->NotifyUser(message, type);
00345     outputField->Text += message + "\r\n";
00346 }
Generated on Fri Nov 15 2024 22:18:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario9.h Source File

  • FileAccess
  • cppwinrt

Scenario9.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario9.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario9 : Scenario9T<Scenario9>
00020     {
00021         Scenario9();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         fire_and_forget CompareFilesButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario9 : Scenario9T<Scenario9, implementation::Scenario9>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario1_DefaultAccount.xaml.cpp Source File

  • WebAccountManagement
  • cpp

Scenario1_DefaultAccount.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_DefaultAccount.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Windows::Foundation;
00010 using namespace Windows::Foundation::Collections;
00011 using namespace Windows::Security::Authentication::Web::Core;
00012 using namespace Windows::Security::Credentials;
00013 using namespace Windows::Storage;
00014 using namespace Windows::UI::Popups;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022 using namespace Windows::UI::ApplicationSettings;
00023
00024 // Important Note for running this sample:
00025 // The sample as-is will not be able to get tokens without having it's app manifest being
00026 // modified to use the App Identity of a registered Microsoft Store/registered AAD app.
00027 //
00028 // See 'Related Topics' in the README.md for instructions on how to register an app.
00029
00030 // The first scenario covers getting the default account.
00031 //
00032 // First you must get the default account provider by passing the id "https://login.windows.local"
00033 // into WebAuthenticationCoreManager::FindAccountProviderAsync.
00034 //
00035 // It's important to note whether this account is MSA or AAD depending on the authority that the
00036 // provider has.
00037 //    MSA: authority == "consumers"
00038 //    AAD: authority == "organizations"
00039 // These will determine what strings you pass into the token request.
00040 //
00041 // Then you can call WebAuthenticationCoreManager::RequestTokenSilentlyAsync or
00042 // WebAuthenticationCoreManager::RequestTokenAsync to get a token for the user.
00043 //
00044 // The main difference between these APIs is that if the user needs to enter login
00045 // credentials before a token can be returned, RequestTokenAsync will result in
00046 // a UI popping up while RequestTokenSilentlyAsync will just return a result of
00047 // UserInteractionRequired.
00048 //
00049 // If you hit UserInteractionRequired, then you will need to call the regular
00050 // RequestTokenAsync.
00051
00052 Scenario1_DefaultAccount::Scenario1_DefaultAccount() : rootPage(MainPage::Current)
00053 {
00054     InitializeComponent();
00055     GetDefaultProvidersAndAccounts();
00056 }
00057
00058 void Scenario1_DefaultAccount::OnNavigatedFrom(NavigationEventArgs^ e)
00059 {
00060     // Clean up any account that may still be logged in
00061     LogoffAndRemoveAccount();
00062 }
00063
00064 void SDKTemplate::Scenario1_DefaultAccount::Button_DefaultSignIn_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
00065 {
00066     if (m_provider == nullptr)
00067     {
00068         rootPage->NotifyUser("There are no connected accounts to be used for default sign in.", NotifyType::ErrorMessage);
00069         return;
00070     }
00071
00072     // Since we only asked for the default provider, we need to make sure we pass the right
00073     // scope and client ids based on whether this is AAD or MSA
00074     if (m_provider->Authority == CONSUMER_AUTHORITY)
00075     {
00076         AuthenticateWithRequestToken(m_provider, MSA_SCOPE_REQUESTED, MSA_CLIENT_ID);
00077     }
00078     else
00079     {
00080         AuthenticateWithRequestToken(m_provider, AAD_SCOPE_REQUESTED, AAD_CLIENT_ID);
00081     }
00082 }
00083
00084 void SDKTemplate::Scenario1_DefaultAccount::Button_GetTokenSilently_Click(Object^ sender, RoutedEventArgs^ e)
00085 {
00086     // Since we only asked for the default provider, we need to make sure we pass the right
00087     // scope and client ids based on whether this is AAD or MSA
00088     if (m_provider->Authority == CONSUMER_AUTHORITY)
00089     {
00090         AuthenticateWithRequestTokenSilent(m_account->WebAccountProvider, MSA_SCOPE_REQUESTED, MSA_CLIENT_ID, m_account);
00091     }
00092     else
00093     {
00094         AuthenticateWithRequestTokenSilent(m_account->WebAccountProvider, AAD_SCOPE_REQUESTED, AAD_CLIENT_ID, m_account);
00095     }
00096 }
00097
00098 void SDKTemplate::Scenario1_DefaultAccount::Button_Reset_Click(Object^ sender, RoutedEventArgs^ e)
00099 {
00100     rootPage->NotifyUser("Resetting", NotifyType::StatusMessage);
00101
00102     LogoffAndRemoveAccount();
00103
00104     rootPage->NotifyUser("Done Resetting", NotifyType::StatusMessage);
00105 }
00106
00107 void SDKTemplate::Scenario1_DefaultAccount::GetDefaultProvidersAndAccounts()
00108 {
00109     // Make a task to get the Default Provider by it's ID
00110     // When that task completes, save the default provider found along with it's authority to know if it's MSA or AAD
00111     concurrency::create_task(WebAuthenticationCoreManager::FindAccountProviderAsync(DEFAULT_ACCOUNT_PROVIDER_ID)).then(
00112         [this](WebAccountProvider^ foundDefaultProvider)
00113     {
00114         if (foundDefaultProvider)
00115         {
00116             m_provider = foundDefaultProvider;
00117             ApplicationData::Current->LocalSettings->Values->Insert(STORED_ACCOUNT_AUTHORITY, m_provider->Authority);
00118         }
00119         else
00120         {
00121             rootPage->NotifyUser("Warning: Default provider not found for id: " + DEFAULT_ACCOUNT_PROVIDER_ID, NotifyType::StatusMessage);
00122         }
00123     }).then([this]()
00124     {
00125         // Then check to see if there is a stored account id in local settings,
00126         // if so then get that account and save that as well
00127         if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00128         {
00129             auto accountID = safe_cast<String^>(ApplicationData::Current->LocalSettings->Values->Lookup(STORED_ACCOUNT_ID_KEY));
00130
00131             concurrency::create_task(WebAuthenticationCoreManager::FindAccountAsync(m_provider, accountID)).then([this](WebAccount^ foundDefaultAccount)
00132             {
00133                 if (foundDefaultAccount)
00134                 {
00135                     SaveAccount(foundDefaultAccount);
00136                 }
00137             });
00138         }
00139     });
00140 }
00141
00142 // Create a new WebAccountManager WebTokenRequest based on the Provider, Scope, ClientID and then create a task to send
00143 // that request asynchronously to WebAccountManager's RequestTokenAsync API.
00144 //
00145 // We've gotten the default provider which will
00146 //
00147 void SDKTemplate::Scenario1_DefaultAccount::AuthenticateWithRequestToken(WebAccountProvider^ passedProvider, String^ scope, String^ clientID)
00148 {
00149     rootPage->NotifyUser("Requested " + passedProvider->DisplayName + " from AccountsManager dialog.", NotifyType::StatusMessage);
00150
00151     auto wtr = ref new WebTokenRequest(passedProvider, scope, clientID);
00152
00153     // When our task finishes it will return result of the operation, and if successful it will contain a token
00154     // and WebAccount. We save the WebAccount as the "active" account.
00155     concurrency::create_task(WebAuthenticationCoreManager::RequestTokenAsync(wtr)).then([this](WebTokenRequestResult^ webTokenRequestResult)
00156     {
00157         if ((webTokenRequestResult->ResponseStatus == WebTokenRequestStatus::Success) &&
00158             (webTokenRequestResult->ResponseData->GetAt(0)->WebAccount))
00159         {
00160             if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00161             {
00162                 ApplicationData::Current->LocalSettings->Values->Remove(STORED_ACCOUNT_ID_KEY);
00163             }
00164
00165             WebAccount^ account = webTokenRequestResult->ResponseData->GetAt(0)->WebAccount;
00166             SaveAccount(account);
00167         }
00168         OutputTokenResult(webTokenRequestResult);
00169     });
00170 }
00171
00172 // Create a new WebAccountManager WebTokenRequest based on the Provider, Scope, ClientID and then create a task to send
00173 // that request and the account to get the token for asynchronously to WebAccountManager's GetTokenSilentlyAsync API
00174 //
00175 // WebAccountManager's GetTokenSilentlyAsync will then try :
00176 //        (1): Check it's local cache to see if it has a valid token
00177 //        (2): Try to silently request a new token from the MSA service
00178 //        (3): Return a status of UserInteractionRequired if we need the user credentials
00179 //
00180 // Because of WebAccountManager's ability to cache tokens, you should only need to call WebAccountManager when making token
00181 // based requests and not require the ability to store a cached token within your app.
00182 void SDKTemplate::Scenario1_DefaultAccount::AuthenticateWithRequestTokenSilent(WebAccountProvider^ provider, String^ scope, String^ clientID, WebAccount^ account)
00183 {
00184     rootPage->NotifyUser("Requested " + provider->DisplayName + " from AccountsManager dialog.", NotifyType::StatusMessage);
00185
00186     auto wtr = ref new WebTokenRequest(provider, scope, clientID);
00187
00188     // When our task finishes it will return result of the operation, and if successful it will contain a token
00189     // and WebAccount. We save the WebAccount as the "active" account.
00190     concurrency::create_task(WebAuthenticationCoreManager::GetTokenSilentlyAsync(wtr, account)).then(
00191         [this](WebTokenRequestResult^ webTokenRequestResult)
00192     {
00193         if (webTokenRequestResult->ResponseStatus == WebTokenRequestStatus::Success)
00194         {
00195             // Perform an operation with the token you just got
00196         }
00197
00198         OutputTokenResult(webTokenRequestResult);
00199     });
00200 }
00201
00202 // Displays the result of requesting a token asynchronously to the main page
00203 void SDKTemplate::Scenario1_DefaultAccount::OutputTokenResult(WebTokenRequestResult^ result)
00204 {
00205     if (result->ResponseStatus == WebTokenRequestStatus::Success)
00206     {
00207         rootPage->NotifyUser(result->ResponseStatus.ToString() + "!\nUser: " + result->ResponseData->GetAt(0)->WebAccount->Id + "\n    Token returned was: " + result->ResponseData->GetAt(0)->Token, NotifyType::StatusMessage);
00208     }
00209     else if (result->ResponseStatus == WebTokenRequestStatus::ProviderError)
00210     {
00211         // The account provider has passed us an error and we should handle it.
00212         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00213     }
00214     else if (result->ResponseStatus == WebTokenRequestStatus::AccountProviderNotAvailable)
00215     {
00216         // The account provider is unavailable, this is a temporary error.
00217         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::ErrorMessage);
00218     }
00219     else if (result->ResponseStatus == WebTokenRequestStatus::UserInteractionRequired)
00220     {
00221         // The account provider needs to display a UI, since we called request token silently we should call it
00222         // with RequestTokenAsync.
00223         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00224
00225         if (m_provider->Authority == CONSUMER_AUTHORITY)
00226         {
00227             AuthenticateWithRequestToken(m_account->WebAccountProvider, MSA_SCOPE_REQUESTED, MSA_CLIENT_ID);
00228         }
00229         else
00230         {
00231             AuthenticateWithRequestToken(m_account->WebAccountProvider, AAD_SCOPE_REQUESTED, AAD_CLIENT_ID);
00232         }
00233     }
00234     else if (result->ResponseStatus == WebTokenRequestStatus::UserCancel)
00235     {
00236         // The user cancelled the sign in process for the account provider, handle
00237         // that how you need to.
00238         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00239     }
00240     else
00241     {
00242         // An unexpected error was encountered
00243         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00244     }
00245 }
00246
00247 // Saves the AccountId in LocalSettings and keeps an instance
00248 // of the WebAccount saved
00249 void SDKTemplate::Scenario1_DefaultAccount::SaveAccount(WebAccount^ account)
00250 {
00251     ApplicationData::Current->LocalSettings->Values->Insert(STORED_ACCOUNT_ID_KEY, account->Id);
00252
00253     m_account = account;
00254
00255     // Update the UI
00256     button_SignIn->IsEnabled = false;
00257     button_GetTokenSilently->IsEnabled = true;
00258     textblock_SignedInStatus->Text = "Signed in with:";
00259     textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Green);
00260     listview_SignedInAccounts->Items->Append(account->Id);
00261 }
00262
00263 // Signs out the account using the SignOutAsync Token Broker API
00264 // and removes our saved AccountId as it won't be valid when SignOutAsync finishes.
00265 void SDKTemplate::Scenario1_DefaultAccount::LogoffAndRemoveAccount()
00266 {
00267     if (m_account)
00268     {
00269         //concurrency::create_task(account->SignOutAsync(MSA_SCOPE_REQUESTED));
00270     }
00271
00272     if (ApplicationData::Current->LocalSettings->Values->HasKey(STORED_ACCOUNT_ID_KEY))
00273     {
00274         ApplicationData::Current->LocalSettings->Values->Remove(STORED_ACCOUNT_ID_KEY);
00275     }
00276
00277     // Update the UI
00278     button_SignIn->IsEnabled = true;
00279     button_GetTokenSilently->IsEnabled = false;
00280     textblock_SignedInStatus->Text = "Not signed in.";
00281     textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Red);
00282     listview_SignedInAccounts->Items->Clear();
00283 }
Generated on Fri Nov 15 2024 22:21:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/App.xaml.h Source File

  • D2DSvgImage
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015 #include "DirectXPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Provides application-specific behavior to supplement the default Application class.
00021     /// </summary>
00022     ref class App sealed
00023     {
00024     public:
00025         App();
00026         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00027
00028     private:
00029         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00030         void OnResuming(Platform::Object ^sender, Platform::Object ^args);
00031         DirectXPage^ m_directXPage;
00032     };
00033 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileOpenPickerPage Member List

This is the complete list of members for FileOpenPickerPage, including all inherited members.
Activate(FileOpenPickerActivatedEventArgs args) | FileOpenPickerPage | [inline]
Current | FileOpenPickerPage | [static]
FEATURE_NAME | FileOpenPickerPage |
FileOpenPickerPage() | FileOpenPickerPage | [inline]
FileOpenPickerPage_SizeChanged(object sender, SizeChangedEventArgs e) | FileOpenPickerPage | [inline, private]
fileOpenPickerUI | FileOpenPickerPage | [private]
Footer_Click(object sender, RoutedEventArgs e) | FileOpenPickerPage | [inline, private]
HiddenFrame | FileOpenPickerPage | [private]
InvalidateLayout() | FileOpenPickerPage | [inline, private]
InvalidateSize() | FileOpenPickerPage | [inline, private]
LaunchArgs | FileOpenPickerPage |
LoadScenario(Type scenarioClass) | FileOpenPickerPage | [inline]
NotifyUser(string strMessage, NotifyType type) | FileOpenPickerPage | [inline]
OnNavigatedTo(NavigationEventArgs e) | FileOpenPickerPage | [inline, protected]
OnScenarioSelectionChanged() | FileOpenPickerPage | [inline, private]
PopulateScenarios() | FileOpenPickerPage | [inline, private]
scenarios | FileOpenPickerPage | [private]
SetFeatureName(string str) | FileOpenPickerPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario4_SaveFile.xaml.h Source File

  • FilePicker
  • cpp

Scenario4_SaveFile.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario4_SaveFile.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     public ref class Scenario4_SaveFile sealed
00021     {
00022     public:
00023         Scenario4_SaveFile();
00024
00025     private:
00026         MainPage^ rootPage;
00027
00028         void SaveFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:19:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario8_PairDevice.xaml.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario8_PairDevice.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario8_PairDevice.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Platform::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::UI::Core;
00013 using namespace Windows::UI::Xaml;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Controls::Primitives;
00016 using namespace Windows::UI::Xaml::Data;
00017 using namespace Windows::UI::Xaml::Input;
00018 using namespace Windows::UI::Xaml::Media;
00019 using namespace Windows::UI::Xaml::Navigation;
00020 using namespace Windows::Devices::Enumeration;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 Scenario8_PairDevice::Scenario8_PairDevice()
00025 {
00026     InitializeComponent();
00027     deviceWatcherHelper = ref new DeviceWatcherHelper(resultCollection, Dispatcher);
00028     deviceWatcherHelper->DeviceChanged += ref new TypedEventHandler<DeviceWatcher^, String^>(this, &Scenario8_PairDevice::OnDeviceListChanged);
00029 }
00030
00031 void Scenario8_PairDevice::OnNavigatedTo(NavigationEventArgs^ e)
00032 {
00033     resultsListView->ItemsSource = resultCollection;
00034
00035     selectorComboBox->ItemsSource = DeviceSelectorChoices::PairingSelectors;
00036     selectorComboBox->SelectedIndex = 0;
00037 }
00038
00039 void Scenario8_PairDevice::OnNavigatedFrom(NavigationEventArgs^ e)
00040 {
00041     deviceWatcherHelper->Reset();
00042 }
00043
00044 void Scenario8_PairDevice::StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00045 {
00046     StartWatcher();
00047 }
00048
00049 void Scenario8_PairDevice::StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00050 {
00051     StopWatcher();
00052 }
00053
00054 void Scenario8_PairDevice::StartWatcher()
00055 {
00056     startWatcherButton->IsEnabled = false;
00057     resultCollection->Clear();
00058
00059     // Get the device selector chosen by the UI then add additional constraints for devices that
00060     // can be paired or are already paired.
00061     DeviceSelectorInfo^ deviceSelectorInfo = safe_cast<DeviceSelectorInfo^>(selectorComboBox->SelectedItem);
00062     String^ selector = "(" + deviceSelectorInfo->Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";
00063
00064     DeviceWatcher^ deviceWatcher;
00065     if (deviceSelectorInfo->Kind == DeviceInformationKind::Unknown)
00066     {
00067         // Kind will be determined by the selector
00068         deviceWatcher = DeviceInformation::CreateWatcher(
00069             selector,
00070             nullptr // don't request additional properties for this sample
00071             );
00072     }
00073     else
00074     {
00075         // Kind is specified in the selector info
00076         deviceWatcher = DeviceInformation::CreateWatcher(
00077             selector,
00078             nullptr, // don't request additional properties for this sample
00079             deviceSelectorInfo->Kind);
00080     }
00081
00082     rootPage->NotifyUser("Starting Watcher...", NotifyType::StatusMessage);
00083     deviceWatcherHelper->StartWatcher(deviceWatcher);
00084     stopWatcherButton->IsEnabled = true;
00085 }
00086
00087 void Scenario8_PairDevice::OnDeviceListChanged(DeviceWatcher^ sender, String^ id)
00088 {
00089     // If the item being updated is currently "selected", then update the pairing buttons
00090     DeviceInformationDisplay^ selectedDeviceInfoDisp = safe_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00091     if ((selectedDeviceInfoDisp != nullptr) && (selectedDeviceInfoDisp->Id == id))
00092     {
00093         UpdatePairingButtons();
00094     }
00095 }
00096
00097
00098 void Scenario8_PairDevice::StopWatcher()
00099 {
00100     stopWatcherButton->IsEnabled = false;
00101
00102     deviceWatcherHelper->StopWatcher();
00103
00104     startWatcherButton->IsEnabled = true;
00105 }
00106
00107 void Scenario8_PairDevice::PairButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00108 {
00109     // Gray out the pair button and results view while pairing is in progress.
00110     resultsListView->IsEnabled = false;
00111     pairButton->IsEnabled = false;
00112     rootPage->NotifyUser("Pairing started. Please wait...", NotifyType::StatusMessage);
00113
00114     DeviceInformationDisplay^ deviceInfoDisp = safe_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00115
00116     concurrency::create_task(deviceInfoDisp->DeviceInfo->Pairing->PairAsync()).then(
00117         [this](DevicePairingResult^ pairingResult)
00118     {
00119         rootPage->NotifyUser(
00120             "Pairing result = " + (pairingResult->Status == DevicePairingResultStatus::Paired ? "Paired" : "NotPaired"),
00121             pairingResult->Status == DevicePairingResultStatus::Paired ? NotifyType::StatusMessage : NotifyType::ErrorMessage);
00122
00123         UpdatePairingButtons();
00124         resultsListView->IsEnabled = true;
00125     }, concurrency::task_continuation_context::use_current());
00126 }
00127
00128 void Scenario8_PairDevice::UnpairButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00129 {
00130     // Gray out the unpair button and results view while unpairing is in progress.
00131     resultsListView->IsEnabled = false;
00132     unpairButton->IsEnabled = false;
00133     rootPage->NotifyUser("Unpairing started. Please wait...", NotifyType::StatusMessage);
00134
00135     DeviceInformationDisplay^ deviceInfoDisp = safe_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00136
00137     concurrency::create_task(deviceInfoDisp->DeviceInfo->Pairing->UnpairAsync()).then(
00138         [this](DeviceUnpairingResult^ unpairingResult)
00139     {
00140         rootPage->NotifyUser(
00141             "Unpairing result = " + (unpairingResult->Status == DeviceUnpairingResultStatus::Unpaired ? "Unpaired" : "Failed"),
00142             unpairingResult->Status == DeviceUnpairingResultStatus::Unpaired ? NotifyType::StatusMessage : NotifyType::ErrorMessage);
00143
00144         UpdatePairingButtons();
00145         resultsListView->IsEnabled = true;
00146     }, concurrency::task_continuation_context::use_current());
00147 }
00148
00149 void Scenario8_PairDevice::ResultsListView_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00150 {
00151     UpdatePairingButtons();
00152 }
00153
00154 void Scenario8_PairDevice::UpdatePairingButtons()
00155 {
00156     DeviceInformationDisplay^ deviceInfoDisp = safe_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00157
00158     if (nullptr != deviceInfoDisp &&
00159         deviceInfoDisp->DeviceInfo->Pairing->CanPair &&
00160         !deviceInfoDisp->DeviceInfo->Pairing->IsPaired)
00161     {
00162         pairButton->IsEnabled = true;
00163     }
00164     else
00165     {
00166         pairButton->IsEnabled = false;
00167     }
00168
00169     if (nullptr != deviceInfoDisp &&
00170         deviceInfoDisp->DeviceInfo->Pairing->IsPaired)
00171     {
00172         unpairButton->IsEnabled = true;
00173     }
00174     else
00175     {
00176         unpairButton->IsEnabled = false;
00177     }
00178 }
00179
00180
Generated on Fri Nov 15 2024 22:19:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario2_Polling.xaml.cpp Source File

  • Gyrometer
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     gyrometer = Gyrometer::GetDefault();
00035     if (gyrometer != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = gyrometer->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041
00042         // Set up a DispatchTimer
00043         TimeSpan span;
00044         span.Duration = static_cast<int32>(desiredReportInterval) * 10000;   // convert to 100ns ticks
00045         dispatcherTimer = ref new DispatcherTimer();
00046         dispatcherTimer->Interval = span;
00047         dispatcherTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2_Polling::DisplayCurrentReading);
00048     }
00049     else
00050     {
00051         rootPage->NotifyUser("No gyrometer found", NotifyType::ErrorMessage);
00052     }
00053 }
00054
00055 /// <summary>
00056 /// Invoked when this page is about to be displayed in a Frame.
00057 /// </summary>
00058 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00059 /// property is typically used to configure the page.</param>
00060 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00061 {
00062     ScenarioEnableButton->IsEnabled = true;
00063     ScenarioDisableButton->IsEnabled = false;
00064 }
00065
00066 /// <summary>
00067 /// Invoked when this page is no longer displayed.
00068 /// </summary>
00069 /// <param name="e"></param>
00070 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00071 {
00072     // If the navigation is external to the app do not clean up.
00073     // This can occur on Phone when suspending the app.
00074     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00075     {
00076         return;
00077     }
00078
00079     if (ScenarioDisableButton->IsEnabled)
00080     {
00081         Window::Current->VisibilityChanged::remove(visibilityToken);
00082         dispatcherTimer->Stop();
00083
00084         // Restore the default report interval to release resources while the sensor is not in use
00085         gyrometer->ReportInterval = 0;
00086     }
00087 }
00088
00089 /// <summary>
00090 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00091 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00092 /// </summary>
00093 /// <param name="sender"></param>
00094 /// <param name="e">
00095 /// Event data that can be examined for the current visibility state.
00096 /// </param>
00097 void Scenario2_Polling::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00098 {
00099     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00100     if (ScenarioDisableButton->IsEnabled)
00101     {
00102         if (e->Visible)
00103         {
00104             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00105             dispatcherTimer->Start();
00106         }
00107         else
00108         {
00109             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00110             dispatcherTimer->Stop();
00111         }
00112     }
00113 }
00114
00115 void Scenario2_Polling::DisplayCurrentReading(Object^ sender, Object^ e)
00116 {
00117     GyrometerReading^ reading = gyrometer->GetCurrentReading();
00118     if (reading != nullptr)
00119     {
00120         ScenarioOutput_X->Text = reading->AngularVelocityX.ToString();
00121         ScenarioOutput_Y->Text = reading->AngularVelocityY.ToString();
00122         ScenarioOutput_Z->Text = reading->AngularVelocityZ.ToString();
00123     }
00124 }
00125
00126 void Scenario2_Polling::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00127 {
00128     if (gyrometer != nullptr)
00129     {
00130         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario2_Polling::VisibilityChanged));
00131
00132         // Set the report interval to enable the sensor for polling
00133         gyrometer->ReportInterval = desiredReportInterval;
00134
00135         dispatcherTimer->Start();
00136
00137         ScenarioEnableButton->IsEnabled = false;
00138         ScenarioDisableButton->IsEnabled = true;
00139     }
00140     else
00141     {
00142         rootPage->NotifyUser("No gyrometer found", NotifyType::ErrorMessage);
00143     }
00144 }
00145
00146 void Scenario2_Polling::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00147 {
00148     Window::Current->VisibilityChanged::remove(visibilityToken);
00149
00150     dispatcherTimer->Stop();
00151
00152     // Restore the default report interval to release resources while the sensor is not in use
00153     gyrometer->ReportInterval = 0;
00154
00155     ScenarioEnableButton->IsEnabled = true;
00156     ScenarioDisableButton->IsEnabled = false;
00157 }
Generated on Fri Nov 15 2024 22:17:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Models/AdaptiveContentModel.cs Source File

  • AdaptiveStreaming
  • cs
  • Models

AdaptiveContentModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013
00014 using System;
00015 using System.Collections.Generic;
00016
00017 namespace SDKTemplate.Models
00018 {
00019     /// <summary>
00020     /// A list of manifest URLs, both HLS and DASH; clear, encrypted and PlayReady; VOD and Live.
00021     /// These are hosted by Azure Media Services, and could expire without notice.
00022     ///
00023     /// It is left to the users of this sample to replace or update this list as needed.
00024     /// </summary>
00025     public class AdaptiveContentModel
00026     {
00027         public int Id;
00028         public string DisplayName;
00029         public Uri ManifestUri;
00030
00031         public bool Live = false;
00032         public string Subtitles;  // Out of band subtitles: "Name,LanguageCode,Uri"
00033         public string Captions;   // Out of band captions: "Name,LanguageCode,Uri"
00034         public bool Aes = false;
00035         public string AesToken = "";  // A URL-Encoded Bearer Token
00036         public bool PlayReady = false;
00037
00038         private AdaptiveContentModel(int id, string displayName, string manifestUri)
00039         {
00040             Id = id;
00041             DisplayName = displayName;
00042             ManifestUri = new Uri(manifestUri);
00043         }
00044
00045         public override string ToString()
00046         {
00047             return $"{Id}: {DisplayName}";
00048         }
00049
00050         public static List<AdaptiveContentModel> knownAzureMediaServiceModels = new List<AdaptiveContentModel>
00051         {
00052             // Various sample content, most of which is under Creative Commons (CC) license from blender.org
00053             new AdaptiveContentModel(1, "Azure Media Services Overview (HLS)", "http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=m3u8-aapl)"),
00054             new AdaptiveContentModel(101, "Azure Media Services Overview (DASH)", "http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf)"),
00055
00056             new AdaptiveContentModel(2, "Azure Promo (HLS)", "http://amssamples.streaming.mediaservices.windows.net/69fbaeba-8e92-4740-aedc-ce09ae945073/AzurePromo.ism/manifest(format=m3u8-aapl)"),
00057             new AdaptiveContentModel(102, "Azure Promo (DASH)", "http://amssamples.streaming.mediaservices.windows.net/69fbaeba-8e92-4740-aedc-ce09ae945073/AzurePromo.ism/manifest(format=mpd-time-csf)"),
00058
00059             new AdaptiveContentModel(3, "Tears of Steel (HLS) - (CC) mango.blender.org", "http://amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TearsOfSteel.ism/manifest(format=m3u8-aapl)")
00060             { Subtitles = String.Join(";",
00061                     "English,en,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-en.vtt",
00062                     "Spanish,es,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-es.vtt",
00063                     "French,fr,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-fr.vtt",
00064                     "Italian,it,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-it.vtt")
00065             },
00066             new AdaptiveContentModel(103, "Tears of Steel (DASH) - (CC) mango.blender.org", "http://amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TearsOfSteel.ism/manifest(format=mpd-time-csf)")
00067             { Subtitles = String.Join(";",
00068                 "English,en,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-en.vtt",
00069                 "Spanish,es,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-es.vtt",
00070                 "French,fr,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-fr.vtt",
00071                 "Italian,it,//amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TOS-it.vtt")
00072             },
00073
00074             new AdaptiveContentModel(4, "Elephant's Dream (HLS) - (CC) orange.blender.org", "http://amssamples.streaming.mediaservices.windows.net/b6822ec8-5c2b-4ae0-a851-fd46a78294e9/ElephantsDream.ism/manifest(format=m3u8-aapl,filtername=FirstFilter)"),
00075             new AdaptiveContentModel(104, "Elephant's Dream (DASH) - (CC) orange.blender.org", "http://amssamples.streaming.mediaservices.windows.net/b6822ec8-5c2b-4ae0-a851-fd46a78294e9/ElephantsDream.ism/manifest(format=mpd-time-csf,filtername=FirstFilter)"),
00076
00077             new AdaptiveContentModel(5, "Elephant's Dream (HLS) Multi-Audio - (CC) orange.blender.org", "http://amssamples.streaming.mediaservices.windows.net/55034fb3-11af-43e4-a4de-d1b3ca56c5aa/ElephantsDream_MultiAudio.ism/manifest(format=m3u8-aapl)"),
00078             new AdaptiveContentModel(105, "Elephant's Dream (DASH) Multi-Audio - (CC) orange.blender.org", "http://amssamples.streaming.mediaservices.windows.net/55034fb3-11af-43e4-a4de-d1b3ca56c5aa/ElephantsDream_MultiAudio.ism/manifest(format=mpd-time-csf)"),
00079
00080             new AdaptiveContentModel(6, "Sintel (HLS) with voiceless dubbing track - (CC) durian.blender.org", "http://amssamples.streaming.mediaservices.windows.net/f1ee994f-fcb8-455f-a15d-07f6f2081a60/Sintel_MultiAudio.ism/manifest(format=m3u8-aapl)"),
00081             new AdaptiveContentModel(106, "Sintel (DASH) with voiceless dubbing track - (CC) durian.blender.org", "http://amssamples.streaming.mediaservices.windows.net/f1ee994f-fcb8-455f-a15d-07f6f2081a60/Sintel_MultiAudio.ism/manifest(format=mpd-time-csf)"),
00082
00083             new AdaptiveContentModel(7, "Silent (HLS) - Copyright 2016, Dolby Laboratories, Inc.", "http://amssamples.streaming.mediaservices.windows.net/d499bfae-117a-40ab-9bd4-036cc575fac3/DolbyDigitalPlus.ism/manifest(format=m3u8-aapl)"),
00084             new AdaptiveContentModel(107, "Silent (DASH) - Copyright 2016, Dolby Laboratories, Inc.", "http://amssamples.streaming.mediaservices.windows.net/d499bfae-117a-40ab-9bd4-036cc575fac3/DolbyDigitalPlus.ism/manifest(format=mpd-time-csf)"),
00085
00086             new AdaptiveContentModel(8, "Llama Drama 4K (HLS) - (CC) caminandes.com", "http://amssamples.streaming.mediaservices.windows.net/634cd01c-6822-4630-8444-8dd6279f94c6/CaminandesLlamaDrama4K.ism/manifest(format=m3u8-aapl)"),
00087             new AdaptiveContentModel(108, "Llama Drama 4K (DASH) - (CC) caminandes.com", "http://amssamples.streaming.mediaservices.windows.net/634cd01c-6822-4630-8444-8dd6279f94c6/CaminandesLlamaDrama4K.ism/manifest(format=mpd-time-csf)"),
00088
00089             new AdaptiveContentModel(9, "Microsoft HoloLens Demo (HLS)", "http://nimbuspm.origin.mediaservices.windows.net/aed33834-ec2d-4788-88b5-a4505b3d032c/Microsoft's HoloLens Live Demonstration.ism/manifest(format=m3u8-aapl)")
00090             { Captions = "Indexer,en,http://nimbuspm.origin.mediaservices.windows.net/aed33834-ec2d-4788-88b5-a4505b3d032c/pp4_blog_demo.vtt" },
00091
00092             new AdaptiveContentModel(109, "Microsoft HoloLens Demo (DASH)", "http://nimbuspm.origin.mediaservices.windows.net/aed33834-ec2d-4788-88b5-a4505b3d032c/Microsoft's HoloLens Live Demonstration.ism/manifest(format=mpd-time-csf)")
00093             { Captions = "Indexer,en,http://nimbuspm.origin.mediaservices.windows.net/aed33834-ec2d-4788-88b5-a4505b3d032c/pp4_blog_demo.vtt" },
00094
00095             // Live HLS content:
00096             new AdaptiveContentModel(10, "60min Azure Media Services 24x7 (HLS, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=m3u8-aapl)")
00097             { Live = true },
00098             new AdaptiveContentModel(15, "30min Azure Media Services 24x7 (HLS, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=m3u8-aapl,filter=30mindvr)")
00099             { Live = true },
00100             new AdaptiveContentModel(16, "5min Azure Media Services 24x7 (HLS, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=m3u8-aapl,filter=5mindvr)")
00101             { Live = true },
00102             new AdaptiveContentModel(17, "2min Azure Media Services 24x7 (HLS, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=m3u8-aapl,filter=2mindvr)")
00103             { Live = true },
00104
00105             // Live DASH content (manifest type = dynamic) is not available using the AdaptiveMediaSource:
00106             new AdaptiveContentModel(110, "60min Azure Media Services 24x7 (DASH, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=mpd-time-csf)")
00107             { Live = true },
00108             new AdaptiveContentModel(111, "30min Azure Media Services 24x7 (DASH, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=mpd-time-csf,filter=30mindvr)")
00109             { Live = true },
00110             new AdaptiveContentModel(112, "5min Azure Media Services 24x7 (DASH, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=mpd-time-csf,filter=5mindvr)")
00111             { Live = true },
00112             new AdaptiveContentModel(113, "2min Azure Media Services 24x7 (DASH, Live) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/a38e6323-95e9-4f1f-9b38-75eba91704e4/5f2ce531-d508-49fb-8152-647eba422aec.ism/manifest(format=mpd-time-csf,filter=2mindvr)")
00113             { Live = true },
00114
00115             // PlayReady DASH streams need a properly setup MediaProtectionManager:
00116             new AdaptiveContentModel(115, "Big Buck Bunny (DASH) with DRM (PlayReady/Widevine CENC) - (CC) peach.blender.org", "http://amssamples.streaming.mediaservices.windows.net/622b189f-ec39-43f2-93a2-201ac4e31ce1/BigBuckBunny.ism/manifest(format=mpd-time-csf)")
00117             { PlayReady = true },
00118             new AdaptiveContentModel(116, "Tears of Steel Trailer (DASH, PlayReady) - (CC) mango.blender.org", "http://amssamples.streaming.mediaservices.windows.net/de1470b3-7b3c-4902-ab53-d19b37ef3bd7/TearsOfSteelTeaser.ism/manifest(format=mpd-time-csf)")
00119             { PlayReady = true },
00120             new AdaptiveContentModel(117, "Sintel Trailer (DASH, PlayReady) - (CC) durian.blender.org", "http://amssamples.streaming.mediaservices.windows.net/bf657309-71d9-4436-b94b-8ac0d2ca222b/SintelTrailer.ism/manifest(format=mpd-time-csf)")
00121             { PlayReady = true },
00122
00123             // Live DASH PlayReady content is not available using the AdaptiveMediaSource:
00124             new AdaptiveContentModel(118, "60min Azure Media Services 24x7 Live PlayReady/Widevine CENC - (CC) blender.org (DASH, Live)", "http://b028.wpc.azureedge.net/80B028/SampleStream/3f6088ec-9e1f-4db7-b7d9-3ec07183ce7d/e405bd0a-a34f-40e2-b70b-4322c46f5cb7.ism/manifest(format=mpd-time-csf)")
00125             { PlayReady = true, Live = true },
00126             new AdaptiveContentModel(119, "30min Azure Media Services 24x7 Live PlayReady/Widevine CENC - (CC) blender.org (DASH, Live)", "http://b028.wpc.azureedge.net/80B028/SampleStream/3f6088ec-9e1f-4db7-b7d9-3ec07183ce7d/e405bd0a-a34f-40e2-b70b-4322c46f5cb7.ism/manifest(format=mpd-time-csf,filter=30mindvr)")
00127             { PlayReady = true, Live = true },
00128             new AdaptiveContentModel(120, "5min Azure Media Services 24x7 Live PlayReady/Widevine CENC - (CC) blender.org (DASH, Live)", "http://b028.wpc.azureedge.net/80B028/SampleStream/3f6088ec-9e1f-4db7-b7d9-3ec07183ce7d/e405bd0a-a34f-40e2-b70b-4322c46f5cb7.ism/manifest(format=mpd-time-csf,filter=5mindvr)")
00129             { PlayReady = true, Live = true },
00130             new AdaptiveContentModel(121, "2min Azure Media Services 24x7 Live PlayReady/Widevine CENC - (CC) blender.org (DASH, Live)", "http://b028.wpc.azureedge.net/80B028/SampleStream/3f6088ec-9e1f-4db7-b7d9-3ec07183ce7d/e405bd0a-a34f-40e2-b70b-4322c46f5cb7.ism/manifest(format=mpd-time-csf,filter=2mindvr)")
00131             { PlayReady = true, Live = true },
00132
00133             new AdaptiveContentModel(122, "60min Azure Media Services 24x7 Live PlayReady - (CC) blender.org (DASH, Live, 60min)", "http://b028.wpc.azureedge.net/80B028/Samples/859b335f-eebc-4ff1-ac03-98e9b614e2c1/0cc164eb-193e-48cb-bc6b-041cc28307e4.ism/manifest(format=mpd-time-csf)")
00134             { PlayReady = true, Live = true, },
00135             new AdaptiveContentModel(123, "30min Azure Media Services 24x7 Live PlayReady - (CC) blender.org (DASH, Live, 30min)", "http://b028.wpc.azureedge.net/80B028/Samples/859b335f-eebc-4ff1-ac03-98e9b614e2c1/0cc164eb-193e-48cb-bc6b-041cc28307e4.ism/manifest(format=mpd-time-csf,filter=30mindvr)")
00136             { PlayReady = true, Live = true, },
00137             new AdaptiveContentModel(124, "5min Azure Media Services 24x7 Live PlayReady - (CC) blender.org (DASH, Live, 5min)", "http://b028.wpc.azureedge.net/80B028/Samples/859b335f-eebc-4ff1-ac03-98e9b614e2c1/0cc164eb-193e-48cb-bc6b-041cc28307e4.ism/manifest(format=mpd-time-csf,filter=5mindvr)")
00138             { PlayReady = true, Live = true, },
00139             new AdaptiveContentModel(125, "2min Azure Media Services 24x7 Live PlayReady - (CC) blender.org (DASH, Live, 2min)", "http://b028.wpc.azureedge.net/80B028/Samples/859b335f-eebc-4ff1-ac03-98e9b614e2c1/0cc164eb-193e-48cb-bc6b-041cc28307e4.ism/manifest(format=mpd-time-csf,filter=2mindvr)")
00140             { PlayReady = true, Live = true, },
00141
00142             // HLS streams with AES-128 CBC encryption:
00143             new AdaptiveContentModel(11, "Sintel (HLS, AES-128 encryption) - (CC) durian.blender.org", "http://amssamples.streaming.mediaservices.windows.net/49b57c87-f5f3-48b3-ba22-c55cfdffa9cb/Sintel.ism/manifest(format=m3u8-aapl)")
00144             { Aes = true },
00145             new AdaptiveContentModel(12, "Azure Media Services 24x7 (HLS, Live, AES-128) - (CC) blender.org", "http://b028.wpc.azureedge.net/80B028/Samples/0e8848ca-1db7-41a3-8867-fe911144c045/d34d8807-5597-47a1-8408-52ec5fc99027.ism/manifest(format=m3u8-aapl)")
00146             { Aes = true, Live = true },
00147
00148             // HLS streams with AES-128 CBC encryption which also require token-auth:
00149             new AdaptiveContentModel(13, "Big Buck Bunny Trailer (HLS, AES-128 with SWT token authorization) - (CC) peach.blender.org", "http://amssamples.streaming.mediaservices.windows.net/9ead18f1-29f8-453c-8721-4becc00ff611/BigBuckBunnyTrailer.ism/manifest(format=m3u8-aapl)")
00150             {
00151                 Aes = true,
00152                 AesToken = "urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=5f5076de-4322-42f7-a533-6265f686d5b9&Audience=urn%3atest&ExpiresOn=4581880130&Issuer=http%3a%2f%2ftestacs.com%2f&HMACSHA256=%2bx77Qo0CeBzP4aCntfe2sVkbKeKguOUNAebHQb53sLc%3d"
00153             },
00154
00155             new AdaptiveContentModel(14, "Tears of Steel Trailer (HLS, AES-128 with JWT token authorization) - (CC) mango.blender.org", "http://amssamples.streaming.mediaservices.windows.net/830584f8-f0c8-4e41-968b-6538b9380aa5/TearsOfSteelTeaser.ism/manifest(format=m3u8-aapl)")
00156             {
00157                 Aes = true,
00158                 AesToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiI5ZGRhMGJjYy01NmZiLTQxNDMtOWQzMi0zYWI5Y2M2ZWE4MGIiLCJpc3MiOiJodHRwOi8vdGVzdGFjcy5jb20vIiwiYXVkIjoidXJuOnRlc3QiLCJleHAiOjE3MTA4MDczODl9.lJXm5hmkp5ArRIAHqVJGefW2bcTzd91iZphoKDwa6w8"
00159             },
00160
00161             // From: http://se-mashup.fokus.fraunhofer.de:8080/adinsertion-sample/scte.html
00162              new AdaptiveContentModel(200, "Fraunhofer Fokus test stream (DASH, Live, SCTE35 emsg) - (Copyright) Fraunhofer Fokus", "http://vm2.dashif.org/livesim/scte35_1/testpic_2s/Manifest.mpd")
00163             { Live = true },
00164         };
00165
00166         public static IReadOnlyList<AdaptiveContentModel> GetKnownAzureMediaServicesModels()
00167         {
00168             return knownAzureMediaServiceModels.AsReadOnly();
00169         }
00170     }
00171
00172 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario3.h Source File

  • FileAccess
  • cppwinrt

Scenario3.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3 : Scenario3T<Scenario3>
00020     {
00021         Scenario3();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         fire_and_forget WriteTextButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         fire_and_forget ReadTextButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027
00028     private:
00029         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00030     };
00031 }
00032
00033 namespace winrt::SDKTemplate::factory_implementation
00034 {
00035     struct Scenario3 : Scenario3T<Scenario3, implementation::Scenario3>
00036     {
00037     };
00038 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • RelativeInclinometer
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     inclinometer = Inclinometer::GetDefaultForRelativeReadings();
00035     if (inclinometer != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = inclinometer->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041     }
00042     else
00043     {
00044         rootPage->NotifyUser("No relative inclinometer found", NotifyType::ErrorMessage);
00045     }
00046 }
00047
00048 /// <summary>
00049 /// Invoked when this page is about to be displayed in a Frame.
00050 /// </summary>
00051 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00052 /// property is typically used to configure the page.</param>
00053 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00054 {
00055     ScenarioEnableButton->IsEnabled = true;
00056     ScenarioDisableButton->IsEnabled = false;
00057 }
00058
00059 /// <summary>
00060 /// Invoked when this page is no longer displayed.
00061 /// </summary>
00062 /// <param name="e"></param>
00063 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00064 {
00065     // If the navigation is external to the app do not clean up.
00066     // This can occur on Phone when suspending the app.
00067     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00068     {
00069         return;
00070     }
00071
00072     if (ScenarioDisableButton->IsEnabled)
00073     {
00074         Window::Current->VisibilityChanged::remove(visibilityToken);
00075         inclinometer->ReadingChanged::remove(readingToken);
00076
00077         // Restore the default report interval to release resources while the sensor is not in use
00078         inclinometer->ReportInterval = 0;
00079     }
00080 }
00081
00082 /// <summary>
00083 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00084 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00085 /// </summary>
00086 /// <param name="sender"></param>
00087 /// <param name="e">
00088 /// Event data that can be examined for the current visibility state.
00089 /// </param>
00090 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00091 {
00092     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00093     if (ScenarioDisableButton->IsEnabled)
00094     {
00095         if (e->Visible)
00096         {
00097             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00098             readingToken = inclinometer->ReadingChanged::add(ref new TypedEventHandler<Inclinometer^, InclinometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00099         }
00100         else
00101         {
00102             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00103             inclinometer->ReadingChanged::remove(readingToken);
00104         }
00105     }
00106 }
00107
00108 void Scenario1_DataEvents::ReadingChanged(Inclinometer^ sender, InclinometerReadingChangedEventArgs^ e)
00109 {
00110     // We need to dispatch to the UI thread to display the output
00111     Dispatcher->RunAsync(
00112         CoreDispatcherPriority::Normal,
00113         ref new DispatchedHandler(
00114             [this, e]()
00115             {
00116                 InclinometerReading^ reading = e->Reading;
00117
00118                 ScenarioOutput_X->Text = reading->PitchDegrees.ToString();
00119                 ScenarioOutput_Y->Text = reading->RollDegrees.ToString();
00120                 ScenarioOutput_Z->Text = reading->YawDegrees.ToString();
00121             },
00122             CallbackContext::Any
00123             )
00124         );
00125 }
00126
00127 void Scenario1_DataEvents::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00128 {
00129     if (inclinometer != nullptr)
00130     {
00131         // Establish the report interval
00132         inclinometer->ReportInterval = desiredReportInterval;
00133
00134         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged));
00135         readingToken = inclinometer->ReadingChanged::add(ref new TypedEventHandler<Inclinometer^, InclinometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00136
00137         ScenarioEnableButton->IsEnabled = false;
00138         ScenarioDisableButton->IsEnabled = true;
00139     }
00140     else
00141     {
00142         rootPage->NotifyUser("No relative inclinometer found", NotifyType::ErrorMessage);
00143     }
00144 }
00145
00146 void Scenario1_DataEvents::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00147 {
00148     Window::Current->VisibilityChanged::remove(visibilityToken);
00149     inclinometer->ReadingChanged::remove(readingToken);
00150
00151     // Restore the default report interval to release resources while the sensor is not in use
00152     inclinometer->ReportInterval = 0;
00153
00154     ScenarioEnableButton->IsEnabled = true;
00155     ScenarioDisableButton->IsEnabled = false;
00156 }
Generated on Fri Nov 15 2024 22:17:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpMeteredConnectionFilter.h Source File

  • HttpClient
  • HttpFilters

HttpMeteredConnectionFilter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "HttpMeteredConnectionFilter.g.h"
00014
00015 using namespace winrt;
00016
00017 namespace winrt::HttpFilters::implementation
00018 {
00019     struct HttpMeteredConnectionFilter : HttpMeteredConnectionFilterT<HttpMeteredConnectionFilter>
00020     {
00021         HttpMeteredConnectionFilter(Windows::Web::Http::Filters::IHttpFilter const& innerFilter);
00022         bool OptIn() { return m_optIn; }
00023         void OptIn(bool value) { m_optIn = value; }
00024         void Close() { }
00025         Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpResponseMessage, Windows::Web::Http::HttpProgress> SendRequestAsync(Windows::Web::Http::HttpRequestMessage request);
00026
00027         static hstring MeteredConnectionPriorityPropertyName() { return MeteredConnectionPriorityPropertyNameLiteral; }
00028
00029     private:
00030         enum class MeteredConnectionBehavior
00031         {
00032             None = 0, // Used when there is no Internet profile available.
00033             Normal,
00034             Conservative,
00035             OptIn
00036         };
00037
00038         static constexpr wchar_t MeteredConnectionPriorityPropertyNameLiteral[] = L"HttpFilters.HttpMeteredConnectionFilter.MeteredConnectionPriority";
00039
00040         Windows::Web::Http::Filters::IHttpFilter m_innerFilter;
00041         bool m_optIn;
00042
00043         static MeteredConnectionBehavior GetBehavior();
00044         void CheckPriority(MeteredConnectionPriority priority);
00045     };
00046 }
00047 namespace winrt::HttpFilters::factory_implementation
00048 {
00049     struct HttpMeteredConnectionFilter : HttpMeteredConnectionFilterT<HttpMeteredConnectionFilter, implementation::HttpMeteredConnectionFilter>
00050     {
00051     };
00052 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario4_ConsumableProduct.xaml.h Source File

  • Store
  • cpp

Scenario4_ConsumableProduct.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario4_ConsumableProduct.g.h"
00016 #include "MainPage.xaml.h"
00017 #include "ItemsListViewModel.h"
00018
00019 namespace SDKTemplate
00020 {
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario4_ConsumableProduct sealed
00023     {
00024     public:
00025         Scenario4_ConsumableProduct();
00026
00027     private:
00028         MainPage^ rootPage = MainPage::Current;
00029         Windows::Services::Store::StoreContext^ storeContext;
00030
00031         void GetManagedConsumablesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void PurchaseAddOnButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void GetConsumableBalanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void FulfillConsumableButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035     };
00036 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario11_DeleteCookie Member List

This is the complete list of members for Scenario11_DeleteCookie, including all inherited members.
DeleteCookie_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario11_DeleteCookie
Scenario11_DeleteCookie() | Scenario11_DeleteCookie
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Project.idl Source File

  • ApplicationData
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 namespace SDKTemplate
00002 {
00003
00004     [default_interface]
00005     runtimeclass Scenario1_Files : Windows.UI.Xaml.Controls.Page
00006     {
00007         Scenario1_Files();
00008     }
00009
00010     [default_interface]
00011     runtimeclass Scenario2_Settings : Windows.UI.Xaml.Controls.Page
00012     {
00013         Scenario2_Settings();
00014     }
00015
00016     [default_interface]
00017     runtimeclass Scenario3_SettingContainer : Windows.UI.Xaml.Controls.Page
00018     {
00019         Scenario3_SettingContainer();
00020     }
00021
00022     [default_interface]
00023     runtimeclass Scenario4_CompositeSettings : Windows.UI.Xaml.Controls.Page
00024     {
00025         Scenario4_CompositeSettings();
00026     }
00027
00028     [default_interface]
00029     runtimeclass Scenario5_Msappdata : Windows.UI.Xaml.Controls.Page
00030     {
00031         Scenario5_Msappdata();
00032     }
00033
00034     [default_interface]
00035     runtimeclass Scenario6_ClearScenario : Windows.UI.Xaml.Controls.Page
00036     {
00037         Scenario6_ClearScenario();
00038     }
00039
00040     [default_interface]
00041     runtimeclass Scenario7_SetVersion : Windows.UI.Xaml.Controls.Page
00042     {
00043         Scenario7_SetVersion();
00044     }
00045 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario4_AddOverlays.xaml.cpp Source File

  • MediaEditing
  • cpp

Scenario4_AddOverlays.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario4_AddOverlays.xaml.h"
00013
00014 using namespace SDKTemplate;
00015 using namespace concurrency;
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Controls;
00021 using namespace Windows::UI::Xaml::Controls::Primitives;
00022 using namespace Windows::UI::Xaml::Data;
00023 using namespace Windows::UI::Xaml::Input;
00024 using namespace Windows::UI::Xaml::Media;
00025 using namespace Windows::UI::Xaml::Navigation;
00026 using namespace Windows::Media::Core;
00027 using namespace Windows::Media::Editing;
00028 using namespace Windows::Storage;
00029 using namespace Windows::Storage::Pickers;
00030 using namespace Windows::Storage::Streams;
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 Scenario4_AddOverlays::Scenario4_AddOverlays() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario4_AddOverlays::OnNavigatedFrom(NavigationEventArgs^ e)
00040 {
00041     mediaElement->Source = nullptr;
00042     mediaStreamSource = nullptr;
00043 }
00044
00045 void Scenario4_AddOverlays::ChooseBaseVideo_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     auto picker = ref new FileOpenPicker();
00048     picker->SuggestedStartLocation = PickerLocationId::VideosLibrary;
00049     picker->FileTypeFilter->Append(".mp4");
00050
00051     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ videoFile)
00052     {
00053         if (videoFile == nullptr)
00054         {
00055             rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00056             return;
00057         }
00058
00059         this->baseVideoFile = videoFile;
00060         create_task(this->baseVideoFile->OpenReadAsync()).then([this](IRandomAccessStreamWithContentType^ videoSource)
00061         {
00062             mediaElement->SetSource(videoSource, baseVideoFile->ContentType);
00063             chooseOverlayVideo->IsEnabled = true;
00064
00065             rootPage->NotifyUser("Video file added", NotifyType::StatusMessage);
00066         });
00067     });
00068 }
00069
00070 void Scenario4_AddOverlays::ChooseOverlayVideo_Click(Object^ sender, RoutedEventArgs^ e)
00071 {
00072     auto picker = ref new FileOpenPicker();
00073     picker->SuggestedStartLocation = PickerLocationId::VideosLibrary;
00074     picker->FileTypeFilter->Append(".mp4");
00075
00076     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ videoFile)
00077     {
00078         if (videoFile == nullptr)
00079         {
00080             rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00081             return;
00082         }
00083
00084         this->overlayVideoFile = videoFile;
00085
00086         CreateOverlays();
00087         rootPage->NotifyUser("Overlay video chosen", NotifyType::StatusMessage);
00088     });
00089 }
00090
00091 void Scenario4_AddOverlays::CreateOverlays()
00092 {
00093     create_task(MediaClip::CreateFromFileAsync(baseVideoFile)).then([this](MediaClip^ baseClip)
00094     {
00095         composition = ref new MediaComposition();
00096         composition->Clips->Append(baseClip);
00097
00098         create_task(MediaClip::CreateFromFileAsync(overlayVideoFile)).then([this](MediaClip^ overlayClip)
00099         {
00100             // Overlay video in upper left corner, retain its native aspect ratio
00101             Rect videoOverlayPosition;
00102             auto encodingProperties = overlayClip->GetVideoEncodingProperties();
00103             videoOverlayPosition.Height = (float)(mediaElement->ActualHeight / 3);
00104             videoOverlayPosition.Width = (float)encodingProperties->Width / (float)encodingProperties->Height * videoOverlayPosition.Height;
00105             videoOverlayPosition.X = 0;
00106             videoOverlayPosition.Y = 0;
00107
00108             auto videoOverlay = ref new MediaOverlay(overlayClip);
00109             videoOverlay->Position = videoOverlayPosition;
00110             videoOverlay->Opacity = 0.75;
00111
00112             auto overlayLayer = ref new MediaOverlayLayer();
00113             overlayLayer->Overlays->Append(videoOverlay);
00114             composition->OverlayLayers->Append(overlayLayer);
00115
00116             // Render to MediaElement
00117             mediaStreamSource = composition->GeneratePreviewMediaStreamSource((int)mediaElement->ActualWidth, (int)mediaElement->ActualHeight);
00118             mediaElement->SetMediaStreamSource(mediaStreamSource);
00119             rootPage->NotifyUser("Overlays created", NotifyType::StatusMessage);
00120         });
00121     });
00122 }
Generated on Fri Nov 15 2024 22:20:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
AppendSessionDateToDestinationFolder | Scenario1 |
arguments | Scenario1 | [private]
CheckBox_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
contentTypeFilder | Scenario1 | [private]
cts | Scenario1 | [private]
deleteResult | Scenario1 | [private]
DisplayDeletedResults() | Scenario1 | [inline, private]
DisplayFindItemsResult() | Scenario1 | [inline, private]
DisplayImportedSummary() | Scenario1 | [inline, private]
DisplaySourceProperties() | Scenario1 | [inline, private]
ExifDateSubfolder_checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
FileDateSubfolder_checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
findItems(PhotoImportContentTypeFilter contentType, PhotoImportItemSelectionMode selectionMode) | Scenario1 | [inline, private]
ImagesAndVideo_Checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
importedResult | Scenario1 | [private]
importSource | Scenario1 | [private]
itemsResult | Scenario1 | [private]
itemsToImport | Scenario1 | [private]
KeepOriginalFolder_checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
NoSubFolder_checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnCancelButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnDeleteButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnFindAllItemsClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnFindNewItemsClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnFindSourcesClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnImportButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnlyImages_Checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnlyVideo_Checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
OnSelectAllButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnSelectNewButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
OnSelectNoneButtonClicked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
PropertyChanged | Scenario1 |
RaisePropertyChanged(string propName) | Scenario1 | [inline, private]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
session | Scenario1 | [private]
setButtonState(bool isEnabled) | Scenario1 | [inline, private]
setIncrementalFileList(PhotoImportFindItemsResult list) | Scenario1 | [inline, private]
SourceList_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario6.xaml.cs Source File

  • FileThumbnails
  • cs

Scenario6.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Storage;
00014 using Windows.Storage.FileProperties;
00015 using Windows.Storage.Pickers;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario6 : Page
00023     {
00024         MainPage rootPage = MainPage.Current;
00025
00026         public Scenario6()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
00034         }
00035
00036         private async void SelectImageButton_Click(object sender, RoutedEventArgs e)
00037         {
00038             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
00039
00040             uint size;
00041             if (uint.TryParse(RequestSize.Text, out size))
00042             {
00043                 // Pick a photo
00044                 FileOpenPicker openPicker = new FileOpenPicker();
00045                 foreach (string extension in FileExtensions.Image)
00046                 {
00047                     openPicker.FileTypeFilter.Add(extension);
00048                 }
00049
00050                 StorageFile file = await openPicker.PickSingleFileAsync();
00051                 if (file != null)
00052                 {
00053                     const ThumbnailMode thumbnailMode = ThumbnailMode.SingleItem;
00054
00055                     bool fastThumbnail = FastThumbnailCheckBox.IsChecked.Value;
00056                     ThumbnailOptions thumbnailOptions = ThumbnailOptions.UseCurrentScale;
00057                     if (fastThumbnail)
00058                     {
00059                         thumbnailOptions |= ThumbnailOptions.ReturnOnlyIfCached;
00060                     }
00061
00062                     using (StorageItemThumbnail thumbnail = await file.GetScaledImageAsThumbnailAsync(thumbnailMode, size, thumbnailOptions))
00063                     {
00064                         if (thumbnail != null)
00065                         {
00066                             MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, file, thumbnail, false);
00067                         }
00068                         else if (fastThumbnail)
00069                         {
00070                             rootPage.NotifyUser(Errors.NoExifThumbnail, NotifyType.StatusMessage);
00071                         }
00072                         else
00073                         {
00074                             rootPage.NotifyUser(Errors.NoThumbnail, NotifyType.StatusMessage);
00075                         }
00076                     }
00077                 }
00078                 else
00079                 {
00080                     rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
00081                 }
00082             }
00083             else
00084             {
00085                 rootPage.NotifyUser(Errors.InvalidSize, NotifyType.ErrorMessage);
00086             }
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/App.cpp Source File

  • Simple3DGameDX
  • cppwinrt

App.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameMain.h"
00014
00015 using namespace winrt::Windows::ApplicationModel;
00016 using namespace winrt::Windows::ApplicationModel::Activation;
00017 using namespace winrt::Windows::ApplicationModel::Core;
00018 using namespace winrt::Windows::Graphics::Display;
00019 using namespace winrt::Windows::UI::Core;
00020 using namespace winrt::Windows::UI::Input;
00021
00022 struct App : winrt::implements<App, IFrameworkViewSource, IFrameworkView>
00023 {
00024     IFrameworkView CreateView()
00025     {
00026         return *this;
00027     }
00028
00029     void Initialize(CoreApplicationView const& applicationView)
00030     {
00031         applicationView.Activated({ this, &App::OnActivated });
00032
00033         CoreApplication::Suspending({ this, &App::OnSuspending });
00034
00035         CoreApplication::Resuming({ this, &App::OnResuming });
00036
00037         // At this point we have access to the device.
00038         // We can create the device-dependent resources.
00039         m_deviceResources = std::make_shared<DX::DeviceResources>();
00040     }
00041
00042     void Load(winrt::hstring const& /* entryPoint */)
00043     {
00044         if (!m_main)
00045         {
00046             m_main = winrt::make_self<GameMain>(m_deviceResources);
00047         }
00048     }
00049
00050     void Uninitialize()
00051     {
00052     }
00053
00054     void Run()
00055     {
00056         m_main->Run();
00057     }
00058
00059     void SetWindow(CoreWindow const& window)
00060     {
00061         window.PointerCursor(CoreCursor(CoreCursorType::Arrow, 0));
00062
00063         PointerVisualizationSettings visualizationSettings{ PointerVisualizationSettings::GetForCurrentView() };
00064         visualizationSettings.IsContactFeedbackEnabled(false);
00065         visualizationSettings.IsBarrelButtonFeedbackEnabled(false);
00066
00067         m_deviceResources->SetWindow(window);
00068
00069         window.Activated({ this, &App::OnWindowActivationChanged });
00070
00071         window.SizeChanged({ this, &App::OnWindowSizeChanged });
00072
00073         window.Closed({ this, &App::OnWindowClosed });
00074
00075         window.VisibilityChanged({ this, &App::OnVisibilityChanged });
00076
00077         DisplayInformation currentDisplayInformation{ DisplayInformation::GetForCurrentView() };
00078
00079         currentDisplayInformation.DpiChanged({ this, &App::OnDpiChanged });
00080
00081         currentDisplayInformation.OrientationChanged({ this, &App::OnOrientationChanged });
00082
00083         currentDisplayInformation.StereoEnabledChanged({ this, &App::OnStereoEnabledChanged });
00084
00085         DisplayInformation::DisplayContentsInvalidated({ this, &App::OnDisplayContentsInvalidated });
00086     }
00087
00088     void OnActivated(CoreApplicationView const& /* applicationView */, IActivatedEventArgs const& /* args */)
00089     {
00090         CoreWindow window = CoreWindow::GetForCurrentThread();
00091         window.Activate();
00092     }
00093
00094     void OnVisibilityChanged(CoreWindow const& /* sender */, VisibilityChangedEventArgs const& args)
00095     {
00096         m_main->Visibility(args.Visible());
00097     }
00098
00099     void App::OnWindowActivationChanged(CoreWindow const& /* sender */, WindowActivatedEventArgs const& args)
00100     {
00101         m_main->WindowActivationChanged(args.WindowActivationState());
00102     }
00103
00104     winrt::fire_and_forget OnSuspending(IInspectable const& /* sender */, SuspendingEventArgs const& args)
00105     {
00106         auto lifetime = get_strong();
00107
00108         // Save app state asynchronously after requesting a deferral. Holding a deferral
00109         // indicates that the application is busy performing suspending operations. Be
00110         // aware that a deferral may not be held indefinitely. After about five seconds,
00111         // the app will be forced to exit.
00112         SuspendingDeferral deferral = args.SuspendingOperation().GetDeferral();
00113
00114         co_await winrt::resume_background();
00115
00116         m_deviceResources->Trim();
00117
00118         m_main->Suspend();
00119
00120         deferral.Complete();
00121     }
00122
00123     void OnResuming(IInspectable const& /* sender */, IInspectable const& /* args */)
00124     {
00125         // Restore any data or state that was unloaded on suspend. By default, data
00126         // and state are persisted when resuming from suspend. Note that this event
00127         // does not occur if the app was previously terminated.
00128         m_main->Resume();
00129     }
00130
00131     void OnStereoEnabledChanged(DisplayInformation const& /* sender */, IInspectable const& /* args */)
00132     {
00133         m_deviceResources->UpdateStereoState();
00134         m_main->CreateWindowSizeDependentResources();
00135     }
00136
00137     void OnWindowSizeChanged(CoreWindow const& /* window */, WindowSizeChangedEventArgs const& args)
00138     {
00139         m_deviceResources->SetLogicalSize(args.Size());
00140         m_main->CreateWindowSizeDependentResources();
00141     }
00142
00143     void OnWindowClosed(CoreWindow const& /* sender */, CoreWindowEventArgs const& /* args */)
00144     {
00145         m_main->Close();
00146     }
00147
00148     void OnDpiChanged(DisplayInformation const& sender, IInspectable const& /* args */)
00149     {
00150         m_deviceResources->SetDpi(sender.LogicalDpi());
00151         m_main->CreateWindowSizeDependentResources();
00152     }
00153
00154     void OnOrientationChanged(DisplayInformation const& sender, IInspectable const& /* args */)
00155     {
00156         m_deviceResources->SetCurrentOrientation(sender.CurrentOrientation());
00157         m_main->CreateWindowSizeDependentResources();
00158     }
00159
00160     void OnDisplayContentsInvalidated(DisplayInformation const& /* sender */, IInspectable const& /* args */)
00161     {
00162         m_deviceResources->ValidateDevice();
00163     }
00164
00165 private:
00166     std::shared_ptr<DX::DeviceResources> m_deviceResources;
00167     winrt::com_ptr<GameMain> m_main;
00168 };
00169
00170 int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
00171 {
00172     CoreApplication::Run(winrt::make<App>());
00173 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/Util.cs Source File

  • MicrosoftPassport
  • cs

Util.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Threading.Tasks;
00004 using Windows.Data.Json;
00005 using Windows.Security.Credentials;
00006 using Windows.Security.Cryptography;
00007 using Windows.Storage.Streams;
00008 using Windows.Web.Http;
00009
00010 namespace SDKTemplate
00011 {
00012     // Fluent class for posting JSON requests to the server and receiving the result.
00013     //
00014     // result - await JsonRequest.Create().AddString("key", "value").AddString("key", "value").PostAsync(relativeUri);
00015     //
00016     // For simplicity, we do not report the error to the caller.
00017     // A full program would record the error in order to provide more meaningful feedback to the user.
00018     class JsonRequest
00019     {
00020         private static Uri serverBaseUri = new Uri("http://localhost:59992/");
00021
00022         private const int E_WINHTTP_TIMEOUT = unchecked((int)0x80072ee2);
00023         private const int E_WINHTTP_NAME_NOT_RESOLVED = unchecked((int)0x80072ee7);
00024         private const int E_WINHTTP_CANNOT_CONNECT = unchecked((int)0x80072efd);
00025         private const int E_WINHTTP_CONNECTION_ERROR = unchecked((int)0x80072efe);
00026
00027         private JsonObject message = new JsonObject();
00028
00029         public static JsonRequest Create()
00030         {
00031             return new JsonRequest();
00032         }
00033
00034         public JsonRequest AddString(string key, string value)
00035         {
00036             message.Add(key, JsonValue.CreateStringValue(value));
00037             return this;
00038         }
00039
00040         public async Task<JsonValue> PostAsync(string relativeUri)
00041         {
00042             HttpStringContent content = new HttpStringContent(message.Stringify(), UnicodeEncoding.Utf8, "application/json");
00043
00044             HttpClient httpClient = new HttpClient();
00045             HttpRequestResult result = await httpClient.TryPostAsync(new Uri(serverBaseUri, relativeUri), content);
00046             if (result.Succeeded)
00047             {
00048                 // We assume that if the server responds at all, it responds with valid JSON.
00049                 return JsonValue.Parse(await result.ResponseMessage.Content.ReadAsStringAsync());
00050             }
00051             else
00052             {
00053                 switch (result.ExtendedError.HResult)
00054                 {
00055                     case E_WINHTTP_TIMEOUT:
00056                     // The connection to the server timed out.
00057                     case E_WINHTTP_NAME_NOT_RESOLVED:
00058                     case E_WINHTTP_CANNOT_CONNECT:
00059                     case E_WINHTTP_CONNECTION_ERROR:
00060                     // Unable to connect to the server. Check that you have Internet access.
00061                     default:
00062                         // "Unexpected error connecting to server: ex.Message
00063                         return null;
00064                 }
00065             }
00066         }
00067     }
00068
00069     class Util
00070     {
00071         const int NTE_NO_KEY = unchecked((int)0x8009000D);
00072         const int NTE_PERM = unchecked((int)0x80090010);
00073
00074         public static async Task<bool> TryDeleteCredentialAccountAsync(string userId)
00075         {
00076             bool deleted = false;
00077
00078             try
00079             {
00080                 await KeyCredentialManager.DeleteAsync(userId);
00081                 deleted = true;
00082             }
00083             catch (Exception ex)
00084             {
00085                 switch (ex.HResult)
00086                 {
00087                     case NTE_NO_KEY:
00088                         // Key is already deleted. Ignore this error.
00089                         break;
00090                     case NTE_PERM:
00091                         // Access is denied. Ignore this error. We tried our best.
00092                         break;
00093                     default:
00094                         throw;
00095                 }
00096             }
00097             return deleted;
00098         }
00099     }
00100 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UpdateFourTilesControl Member List

This is the complete list of members for UpdateFourTilesControl, including all inherited members.
ButtonPin_Click(object sender, RoutedEventArgs e) | UpdateFourTilesControl | [inline, private]
ButtonToggleShowPayload_Click(object sender, RoutedEventArgs e) | UpdateFourTilesControl | [inline, private]
SetTilePayload(string xml) | UpdateFourTilesControl | [inline]
UpdateFourTilesControl() | UpdateFourTilesControl | [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/AddImageFeedScenario.xaml.h Source File

  • Personalization
  • cpp

AddImageFeedScenario.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // AddImageFeedScenario.xaml.h
00014 // Declaration of the AddImageFeedScenario class
00015 //
00016
00017 #pragma once
00018 #include "AddImageFeedScenario.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class AddImageFeedScenario sealed
00023     {
00024     public:
00025         AddImageFeedScenario();
00026
00027     private:
00028         void SetDefaultButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void RemoveFeedButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpatialInputHandler.h Source File

  • BasicHologram
  • cppwinrt
  • Content

SpatialInputHandler.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace BasicHologram
00004 {
00005     // Sample gesture handler.
00006     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00007     class SpatialInputHandler
00008     {
00009     public:
00010         SpatialInputHandler();
00011         ~SpatialInputHandler();
00012
00013         winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState CheckForInput();
00014
00015     private:
00016         // Interaction event handler.
00017         void OnSourcePressed(
00018             winrt::Windows::UI::Input::Spatial::SpatialInteractionManager const& sender,
00019             winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs const& args);
00020
00021         // API objects used to process gesture input, and generate gesture events.
00022         winrt::Windows::UI::Input::Spatial::SpatialInteractionManager       m_interactionManager = nullptr;
00023
00024         // Event registration token.
00025         winrt::event_token                                                  m_sourcePressedEventToken;
00026
00027         // Used to indicate that a Pressed input event was received this frame.
00028         winrt::Windows::UI::Input::Spatial::SpatialInteractionSourceState   m_sourceState = nullptr;
00029     };
00030 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario5_Certificates.xaml.cs Source File

  • StreamSocket
  • cs

Scenario5_Certificates.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.ApplicationModel.Core;
00018 using Windows.Networking;
00019 using Windows.Networking.Connectivity;
00020 using Windows.Networking.Sockets;
00021 using Windows.Security.Cryptography.Certificates;
00022 using Windows.Storage.Streams;
00023 using Windows.UI.Popups;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Navigation;
00027
00028 namespace StreamSocketSample
00029 {
00030     /// <summary>
00031     /// A page for fifth scenario.
00032     /// </summary>
00033     public sealed partial class Scenario5 : Page
00034     {
00035         private const int continueButtonId = 1;
00036         private const int abortButtonId = 0;
00037
00038         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00039         // as NotifyUser().
00040         MainPage rootPage = MainPage.Current;
00041
00042         public Scenario5()
00043         {
00044             this.InitializeComponent();
00045         }
00046
00047         /// <summary>
00048         /// Invoked when this page is about to be displayed in a Frame.
00049         /// </summary>
00050         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00051         /// property is typically used to configure the page.</param>
00052         protected override void OnNavigatedTo(NavigationEventArgs e)
00053         {
00054         }
00055
00056         /// <summary>
00057         /// This is the click handler for the 'ConnectSocket' button.
00058         /// </summary>
00059         /// <param name="sender">Object for which the event was generated.</param>
00060         /// <param name="e">Event's parameters.</param>
00061         private async void ConnectSocket_Click(object sender, RoutedEventArgs e)
00062         {
00063             // Validating the host name is required since it was received
00064             // from an untrusted source (user input). The host name is validated by catching ArgumentExceptions thrown
00065             // by the HostName constructor for invalid input.
00066             if (String.IsNullOrEmpty(ServiceNameForConnect.Text))
00067             {
00068                 rootPage.NotifyUser("Please provide a service name.", NotifyType.ErrorMessage);
00069                 return;
00070             }
00071
00072             HostName hostName;
00073             try
00074             {
00075                 hostName = new HostName(HostNameForConnect.Text);
00076             }
00077             catch (ArgumentException)
00078             {
00079                 rootPage.NotifyUser("Error: Invalid host name.", NotifyType.ErrorMessage);
00080                 return;
00081             }
00082
00083             rootPage.NotifyUser("Connecting to: " + HostNameForConnect.Text, NotifyType.StatusMessage);
00084
00085             using (StreamSocket socket = new StreamSocket())
00086             {
00087                 // If necessary, tweak the socket's control options before carrying out the connect operation.
00088                 // Refer to the StreamSocketControl class' MSDN documentation for the full list of control options.
00089                 socket.Control.ClientCertificate = null;
00090
00091                 bool shouldRetry = await TryConnectSocketWithRetryAsync(socket, hostName);
00092                 if (shouldRetry)
00093                 {
00094                     // Retry if the first attempt failed because of SSL errors.
00095                     await TryConnectSocketWithRetryAsync(socket, hostName);
00096                 }
00097             }
00098         }
00099
00100         private async Task<bool> TryConnectSocketWithRetryAsync(StreamSocket socket, HostName hostName)
00101         {
00102             try
00103             {
00104                 // Establish a secure connection to the server (by default, the local IIS server).
00105                 await socket.ConnectAsync(hostName, ServiceNameForConnect.Text, SocketProtectionLevel.Tls12);
00106
00107                 string certInformation = GetCertificateInformation(
00108                     socket.Information.ServerCertificate,
00109                     socket.Information.ServerIntermediateCertificates);
00110
00111                 rootPage.NotifyUser(
00112                     "Connected to server. Certificate information: " + Environment.NewLine + certInformation,
00113                     NotifyType.StatusMessage);
00114                 return false;
00115             }
00116             catch (Exception exception)
00117             {
00118                 // If this is an unknown status it means that the error is fatal and retry will likely fail.
00119                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00120                 {
00121                     throw;
00122                 }
00123
00124                 // If the exception was caused by an SSL error that is ignorable we are going to prompt the user
00125                 // with an enumeration of the errors and ask for permission to ignore.
00126                 if (socket.Information.ServerCertificateErrorSeverity != SocketSslErrorSeverity.Ignorable)
00127                 {
00128                     rootPage.NotifyUser("Connect failed with error: " + exception.Message, NotifyType.ErrorMessage);
00129                     return false;
00130                 }
00131             }
00132
00133             // Present the certificate issues and ask the user if we should continue.
00134             if (await ShouldIgnoreCertificateErrorsAsync(socket.Information.ServerCertificateErrors))
00135             {
00136                 // -----------------------------------------------------------------------------------------------
00137                 // WARNING: Only test applications should ignore SSL errors.
00138                 // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle attacks.
00139                 // -----------------------------------------------------------------------------------------------
00140                 socket.Control.IgnorableServerCertificateErrors.Clear();
00141                 foreach (var ignorableError in socket.Information.ServerCertificateErrors)
00142                 {
00143                     socket.Control.IgnorableServerCertificateErrors.Add(ignorableError);
00144                 }
00145                 rootPage.NotifyUser("Retrying connection", NotifyType.StatusMessage);
00146                 return true;
00147             }
00148             else
00149             {
00150                 rootPage.NotifyUser("Connection aborted by user (certificate not trusted)", NotifyType.ErrorMessage);
00151                 return false;
00152             }
00153         }
00154
00155         /// <summary>
00156         /// Allows the user to abort the connection in case of SSL/TLS errors
00157         /// </summary>
00158         /// <param name="serverCertificateErrors">The server certificate errors</param>
00159         /// <returns>False if the connection should be aborted</returns>
00160         private async Task<bool> ShouldIgnoreCertificateErrorsAsync(
00161             IReadOnlyList<ChainValidationResult> serverCertificateErrors)
00162         {
00163             string connectionErrors = String.Join(", ", serverCertificateErrors);
00164
00165             string dialogMessage =
00166                 "The remote server certificate validation failed with the following errors: " +
00167                 connectionErrors + Environment.NewLine + "Security certificate problems may" +
00168                 " indicate an attempt to fool you or intercept any data you send to the server.";
00169
00170             MessageDialog dialog = new MessageDialog(dialogMessage, "Server Certificate Validation Errors");
00171
00172             dialog.Commands.Add(new UICommand("Continue (not recommended)", null, continueButtonId));
00173             dialog.Commands.Add(new UICommand("Cancel", null, abortButtonId));
00174             dialog.DefaultCommandIndex = 1;
00175             dialog.CancelCommandIndex = 1;
00176
00177             IUICommand selected = await dialog.ShowAsync();
00178             return (selected.Id is int) && ((int)selected.Id == continueButtonId);
00179         }
00180
00181         /// <summary>
00182         /// Gets detailed certificate information
00183         /// </summary>
00184         /// <param name="serverCert">The server certificate</param>
00185         /// <param name="intermediateCertificates">The server certificate chain</param>
00186         /// <returns>A string containing certificate details</returns>
00187         private string GetCertificateInformation(
00188             Certificate serverCert,
00189             IReadOnlyList<Certificate> intermediateCertificates)
00190         {
00191             StringBuilder stringBuilder = new StringBuilder();
00192
00193             stringBuilder.AppendLine("\tFriendly Name: " + serverCert.FriendlyName);
00194             stringBuilder.AppendLine("\tSubject: " + serverCert.Subject);
00195             stringBuilder.AppendLine("\tIssuer: " + serverCert.Issuer);
00196             stringBuilder.AppendLine("\tValidity: " + serverCert.ValidFrom + " - " + serverCert.ValidTo);
00197
00198             // Enumerate the entire certificate chain.
00199             if (intermediateCertificates.Count > 0)
00200             {
00201                 stringBuilder.AppendLine("\tCertificate chain: ");
00202                 foreach (var cert in intermediateCertificates)
00203                 {
00204                     stringBuilder.AppendLine("\t\tIntermediate Certificate Subject: " + cert.Subject);
00205                 }
00206             }
00207             else
00208             {
00209                 stringBuilder.AppendLine("\tNo certificates within the intermediate chain.");
00210             }
00211
00212             return stringBuilder.ToString();
00213         }
00214     }
00215 }
Generated on Fri Nov 15 2024 22:21:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_EventHandlers Member List

This is the complete list of members for Scenario2_EventHandlers, including all inherited members.
adaptiveMediaSourceLogger | Scenario2_EventHandlers | [private]
bitrateHelper | Scenario2_EventHandlers | [private]
DownloadBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadBitrateChangedEventArgs args) | Scenario2_EventHandlers | [inline, private]
HideDescriptionOnSmallScreen() | Scenario2_EventHandlers | [inline, private]
LoadSourceFromUriAsync(Uri uri, HttpClient httpClient=null) | Scenario2_EventHandlers | [inline, private]
Log(string message) | Scenario2_EventHandlers | [inline, private]
mediaPlaybackItemLogger | Scenario2_EventHandlers | [private]
mediaPlayerLogger | Scenario2_EventHandlers | [private]
mediaSourceLogger | Scenario2_EventHandlers | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_EventHandlers | [inline, protected]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario2_EventHandlers | [inline, private]
PlaybackBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourcePlaybackBitrateChangedEventArgs args) | Scenario2_EventHandlers | [inline, private]
RegisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource) | Scenario2_EventHandlers | [inline, private]
Scenario2_EventHandlers() | Scenario2_EventHandlers | [inline]
UnregisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource) | Scenario2_EventHandlers | [inline, private]
UnregisterHandlers(MediaPlayer mediaPlayer) | Scenario2_EventHandlers | [inline, private]
UpdateDownloadBitrateAsync(uint downloadBitrate) | Scenario2_EventHandlers | [inline, private]
UpdatePlaybackBitrateAsync(uint playbackBitrate) | Scenario2_EventHandlers | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario1_Save.xaml.cpp Source File

  • PasswordVault
  • cpp

Scenario1_Save.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Save.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Security::Credentials;
00020
00021 Scenario1_Save::Scenario1_Save()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 void Scenario1_Save::SaveCredential_Click(Object^, Object^)
00027 {
00028     auto resource = InputResourceValue->Text;
00029     auto username = InputUserNameValue->Text;
00030     auto password = InputPasswordValue->Password;
00031
00032     if (!resource || !username || !password)
00033     {
00034         MainPage::Current->NotifyUser("All fields are required when saving a credential.", NotifyType::ErrorMessage);
00035     }
00036     else
00037     {
00038         // Add a credential to PasswordVault with provided resource, user name, and password.
00039         // Replaces any existing credential with the same resource and user name.
00040         auto vault = ref new PasswordVault();
00041         auto cred = ref new PasswordCredential(resource, username, password);
00042         vault->Add(cred);
00043
00044         rootPage->NotifyUser("Credential saved successfully. Resource: " + cred->Resource + " Username: " + cred->UserName + " Password: " + cred->Password, NotifyType::StatusMessage);
00045     }
00046 }
Generated on Fri Nov 15 2024 22:20:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WindowInfo Member List

This is the complete list of members for WindowInfo, including all inherited members.
Id | WindowInfo |
Name | WindowInfo |
Window | WindowInfo |
WindowInfo(LineDisplayWindow window, int id) | WindowInfo | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/SampleConfiguration.h Source File

  • IoT-SPI
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace SDKTemplate
00014 {
00015     value struct Scenario;
00016
00017     partial ref class MainPage
00018     {
00019     internal:
00020         static property Platform::String^ FEATURE_NAME
00021         {
00022             Platform::String^ get()
00023             {
00024                 return "SPI C++ Sample";
00025             }
00026         }
00027
00028         static property Platform::Array<Scenario>^ scenarios
00029         {
00030             Platform::Array<Scenario>^ get()
00031             {
00032                 return scenariosInner;
00033             }
00034         }
00035
00036     private:
00037         static Platform::Array<Scenario>^ scenariosInner;
00038     };
00039
00040     public value struct Scenario
00041     {
00042         Platform::String^ Title;
00043         Platform::String^ ClassName;
00044     };
00045 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario7_UsingUnicodeExtensions.h Source File

  • NumberFormatting
  • cppwinrt

Scenario7_UsingUnicodeExtensions.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7_UsingUnicodeExtensions.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario7_UsingUnicodeExtensions : Scenario7_UsingUnicodeExtensionsT<Scenario7_UsingUnicodeExtensions>
00019     {
00020         Scenario7_UsingUnicodeExtensions();
00021
00022         void Display_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario7_UsingUnicodeExtensions : Scenario7_UsingUnicodeExtensionsT<Scenario7_UsingUnicodeExtensions, implementation::Scenario7_UsingUnicodeExtensions>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario2_ChangePin.xaml.cpp Source File

  • SmartCard
  • cpp

Scenario2_ChangePin.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario2_ChangePin.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Devices::SmartCards;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Foundation::Collections;
00013 using namespace Windows::Storage::Streams;
00014 using namespace Windows::Security::Cryptography;
00015 using namespace Windows::Security::Cryptography::Core;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Controls::Primitives;
00019 using namespace Windows::UI::Xaml::Data;
00020 using namespace Windows::UI::Xaml::Input;
00021 using namespace Windows::UI::Xaml::Media;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 Scenario2_ChangePin::Scenario2_ChangePin()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario2_ChangePin::ChangePin_Click(Platform::Object^ sender,
00030     Windows::UI::Xaml::RoutedEventArgs^ e)
00031 {
00032     if (MainPage::Current->SmartCardReaderDeviceId == nullptr)
00033     {
00034         MainPage::Current->NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType::ErrorMessage);
00035         return;
00036     }
00037
00038     Button^ b = dynamic_cast<Button^>(sender);
00039     b->IsEnabled = false;
00040     MainPage::Current->NotifyUser("Changing smart card PIN...", NotifyType::StatusMessage);
00041
00042     create_task(MainPage::Current->GetSmartCard()).then(
00043         [=](task<Windows::Devices::SmartCards::SmartCard^> getCardTask)
00044     {
00045         Windows::Devices::SmartCards::SmartCard^ card = getCardTask.get();
00046         return SmartCardProvisioning::FromSmartCardAsync(card);
00047     }).then(
00048         [=](task<SmartCardProvisioning^> getProvisioningTask)
00049     {
00050         SmartCardProvisioning^ provisioning = getProvisioningTask.get();
00051         return provisioning->RequestPinChangeAsync();
00052     }).then(
00053         [=](task<bool> changePinTask)
00054     {
00055         try
00056         {
00057             bool result = changePinTask.get();
00058             if (result)
00059             {
00060                 MainPage::Current->NotifyUser("Smart card change PIN operation completed.", NotifyType::StatusMessage);
00061             }
00062             else
00063             {
00064                 MainPage::Current->NotifyUser("Smart card change PIN operation was canceled by the user.", NotifyType::StatusMessage);
00065             }
00066         }
00067         catch (COMException ^ex)
00068         {
00069             MainPage::Current->NotifyUser("Changing smart card PIN failed with exception: " + ex->ToString(), NotifyType::ErrorMessage);
00070         }
00071
00072         b->IsEnabled = true;
00073     });
00074 }
Generated on Fri Nov 15 2024 22:21:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SavingDataReason Member List

This is the complete list of members for SavingDataReason, including all inherited members.
cancellationTokenSource | SavingDataReason | [private]
ExtendedExecutionSessionRevoked(object sender, ExtendedExecutionRevokedEventArgs args) | SavingDataReason | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | SavingDataReason | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | SavingDataReason | [inline, protected]
OnSuspending(object sender, SuspendingEventArgs args) | SavingDataReason | [inline, private]
rootPage | SavingDataReason | [private]
SavingDataReason() | SavingDataReason | [inline]
suspendDeferral | SavingDataReason | [private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/SampleConfiguration.cs Source File

  • XamlCloudFontIntegration
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "XAML Integration of DirectWrite Downloadable Fonts";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Using this sample app", ClassType=typeof(Scenario_SampleOverview)},
00025             new Scenario() { Title="Downloadable fonts overview", ClassType=typeof(Scenario_CloudFontOverview)},
00026             new Scenario() { Title="Document 1", ClassType=typeof(Scenario_Document1)},
00027             new Scenario() { Title="Document 2", ClassType=typeof(Scenario_Document2)},
00028             new Scenario() { Title="Document 3", ClassType=typeof(Scenario_Document3)}
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Dismiss/Dismissing/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Dismiss
  • Dismissing

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.ActivationTypes.System.Dismiss.Dismissing
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00022         {
00023             Initialize();
00024         }
00025
00026
00027         private void Initialize()
00028         {
00029             // Clear all existing notifications
00030             ToastNotificationManager.History.Clear();
00031
00032             // Pop reminder
00033             popToastControl.Payload =
00034                 $@"
00035                 <toast scenario='reminder' launch='args'>
00036                     <visual>
00037                         <binding template='ToastGeneric'>
00038                             <text>System Dismiss (Dismissing)</text>
00039                             <text>Minimize the app/return to Start, click ""dismiss"", and then manually return to the app to continue to the next step.</text>
00040                         </binding>
00041                     </visual>
00042
00043                     <actions>
00044
00045                         <action activationType='system' arguments='dismiss' content='dismiss' />
00046
00047                     </actions>
00048                 </toast>";
00049         }
00050
00051         private async void Error(string message)
00052         {
00053             await new MessageDialog(message, "ERROR").ShowAsync();
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/PersistentState.h Source File

  • Simple3DGameDX
  • cppwinrt
  • Common

PersistentState.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 // A simple helper class that provides support for saving and loading various
00011 // data types to an IPropertySet. Used by DirectX SDK samples to implement
00012 // process lifetime management (PLM).
00013
00014 class PersistentState
00015 {
00016 public:
00017     void Initialize(
00018         _In_ winrt::Windows::Foundation::Collections::IPropertySet settingsValues,
00019         _In_ winrt::hstring const& key
00020         );
00021
00022     void SaveBool(winrt::hstring const& key, bool value);
00023     void SaveInt32(winrt::hstring const& key, int value);
00024     void SaveSingle(winrt::hstring const& key, float value);
00025     void SaveXMFLOAT3(winrt::hstring const& key, DirectX::XMFLOAT3 value);
00026     void SaveString(winrt::hstring const& key, winrt::hstring const& string);
00027
00028     bool LoadBool(winrt::hstring const& key, bool defaultValue);
00029     int  LoadInt32(winrt::hstring const& key, int defaultValue);
00030     float LoadSingle(winrt::hstring const& key, float defaultValue);
00031     DirectX::XMFLOAT3 LoadXMFLOAT3(winrt::hstring const& key, DirectX::XMFLOAT3 defaultValue);
00032     winrt::hstring LoadString(winrt::hstring const& key, winrt::hstring const& defaultValue);
00033
00034 private:
00035     winrt::hstring m_keyName;
00036     winrt::Windows::Foundation::Collections::IPropertySet m_settingsValues;
00037 };
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario1_Colors.xaml.cpp Source File

  • TitleBar
  • cpp

Scenario1_Colors.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Colors.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Data;
00024
00025 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00026
00027 Scenario1_Colors::Scenario1_Colors() : rootPage(MainPage::Current)
00028 {
00029     InitializeComponent();
00030
00031     titleBar = ApplicationView::GetForCurrentView()->TitleBar;
00032
00033     // Infer the radio button selection from the title bar colors.
00034     if (titleBar->ButtonBackgroundColor == nullptr)
00035     {
00036         UseStandardColors->IsChecked = true;
00037     }
00038     else if (titleBar->ButtonBackgroundColor->Value.A > 0)
00039     {
00040         UseCustomColors->IsChecked = true;
00041     }
00042     else
00043     {
00044         TransparentWhenExtended->IsChecked = true;
00045     }
00046     ReportColors();
00047 }
00048
00049
00050 static Platform::String^ ConvertToString(Platform::IBox<Windows::UI::Color>^ value)
00051 {
00052     if (value == nullptr)
00053     {
00054         return "null";
00055     }
00056
00057     Windows::UI::Color color = value->Value;
00058
00059     return "A: " + color.A.ToString() + ",  R: " + color.R.ToString() + ", G: " + color.G.ToString() + ", B: " + color.B.ToString();
00060 }
00061
00062 void Scenario1_Colors::UpdateColors()
00063 {
00064     if (UseStandardColors->IsChecked->Value)
00065     {
00066         // Setting colors to nullptr returns them to system defaults.
00067         titleBar->BackgroundColor = nullptr;
00068         titleBar->ForegroundColor = nullptr;
00069         titleBar->InactiveBackgroundColor = nullptr;
00070         titleBar->InactiveForegroundColor = nullptr;
00071
00072         titleBar->ButtonBackgroundColor = nullptr;
00073         titleBar->ButtonHoverBackgroundColor = nullptr;
00074         titleBar->ButtonPressedBackgroundColor = nullptr;
00075         titleBar->ButtonInactiveBackgroundColor = nullptr;
00076
00077         titleBar->ButtonForegroundColor = nullptr;
00078         titleBar->ButtonHoverForegroundColor = nullptr;
00079         titleBar->ButtonPressedForegroundColor = nullptr;
00080         titleBar->ButtonInactiveForegroundColor = nullptr;
00081     }
00082     else
00083     {
00084         // Title bar colors. Alpha must be 255.
00085         titleBar->BackgroundColor = ColorHelper::FromArgb(255, 54, 60, 116);
00086         titleBar->ForegroundColor = ColorHelper::FromArgb(255, 232, 211, 162);
00087         titleBar->InactiveBackgroundColor = ColorHelper::FromArgb(255, 135, 141, 199);
00088         titleBar->InactiveForegroundColor = ColorHelper::FromArgb(255, 232, 211, 162);
00089
00090         // Title bar button background colors. Alpha is respected when the view is extended
00091         // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
00092         byte buttonAlpha = (byte)(TransparentWhenExtended->IsChecked->Value ? 0 : 255);
00093         titleBar->ButtonBackgroundColor = ColorHelper::FromArgb(buttonAlpha, 54, 60, 116);
00094         titleBar->ButtonHoverBackgroundColor = ColorHelper::FromArgb(buttonAlpha, 19, 21, 40);
00095         titleBar->ButtonPressedBackgroundColor = ColorHelper::FromArgb(buttonAlpha, 232, 211, 162);
00096         titleBar->ButtonInactiveBackgroundColor = ColorHelper::FromArgb(buttonAlpha, 135, 141, 199);
00097
00098         // Title bar button foreground colors. Alpha must be 255.
00099         titleBar->ButtonForegroundColor = ColorHelper::FromArgb(255, 232, 211, 162);
00100         titleBar->ButtonHoverForegroundColor = ColorHelper::FromArgb(255, 255, 255, 255);
00101         titleBar->ButtonPressedForegroundColor = ColorHelper::FromArgb(255, 54, 60, 116);
00102         titleBar->ButtonInactiveForegroundColor = ColorHelper::FromArgb(255, 232, 211, 162);
00103     }
00104
00105     ReportColors();
00106 }
00107
00108 void Scenario1_Colors::ReportColors()
00109 {
00110     BackgroundColorText->Text = ConvertToString(titleBar->BackgroundColor);
00111     ForegroundColorText->Text = ConvertToString(titleBar->ForegroundColor);
00112     InactiveBackgroundColorText->Text = ConvertToString(titleBar->InactiveBackgroundColor);
00113     InactiveForegroundColorText->Text = ConvertToString(titleBar->InactiveForegroundColor);
00114
00115     ButtonBackgroundColorText->Text = ConvertToString(titleBar->ButtonBackgroundColor);
00116     ButtonHoverBackgroundColorText->Text = ConvertToString(titleBar->ButtonHoverBackgroundColor);
00117     ButtonPressedBackgroundColorText->Text = ConvertToString(titleBar->ButtonPressedBackgroundColor);
00118     ButtonInactiveBackgroundColorText->Text = ConvertToString(titleBar->ButtonInactiveBackgroundColor);
00119
00120     ButtonForegroundColorText->Text = ConvertToString(titleBar->ButtonForegroundColor);
00121     ButtonHoverForegroundColorText->Text = ConvertToString(titleBar->ButtonHoverForegroundColor);
00122     ButtonPressedForegroundColorText->Text = ConvertToString(titleBar->ButtonPressedForegroundColor);
00123     ButtonInactiveForegroundColorText->Text = ConvertToString(titleBar->ButtonInactiveForegroundColor);
00124 }
Generated on Fri Nov 15 2024 22:21:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_InboxEffects Member List

This is the complete list of members for Scenario5_InboxEffects, including all inherited members.
ConvertRange(double value) | Scenario5_InboxEffects | [inline, private]
CreateAudioGraph() | Scenario5_InboxEffects | [inline, private]
CreateEchoEffect() | Scenario5_InboxEffects | [inline, private]
CreateEqEffect() | Scenario5_InboxEffects | [inline, private]
CreateLimiterEffect() | Scenario5_InboxEffects | [inline, private]
CreateReverbEffect() | Scenario5_InboxEffects | [inline, private]
DecaySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
deviceOutputNode | Scenario5_InboxEffects | [private]
echoEffectDefinition | Scenario5_InboxEffects | [private]
EchoEffectToggle_Toggled(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
EchoSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
Eq1Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
Eq2Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
Eq3Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
Eq4Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
eqEffectDefinition | Scenario5_InboxEffects | [private]
EqToggle_Toggled(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
File_Click(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
fileInputNode | Scenario5_InboxEffects | [private]
graph | Scenario5_InboxEffects | [private]
Graph_Click(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
limiterEffectDefinition | Scenario5_InboxEffects | [private]
LimiterEffectToggle_Toggled(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
LoudnessSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario5_InboxEffects | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario5_InboxEffects | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario5_InboxEffects | [inline, protected]
reverbEffectDefinition | Scenario5_InboxEffects | [private]
ReverbEffectToggle_Toggled(object sender, RoutedEventArgs e) | Scenario5_InboxEffects | [inline, private]
rootPage | Scenario5_InboxEffects | [private]
Scenario5_InboxEffects() | Scenario5_InboxEffects | [inline]
TogglePlay() | Scenario5_InboxEffects | [inline, private]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cs/Scenario2_SupportedTactileFeedback.xaml.cs Source File

  • PenHaptics
  • cs

Scenario2_SupportedTactileFeedback.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using Windows.Devices.Haptics;
00014 using Windows.Devices.Input;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Input;
00017
00018 // This sample shows how to query the pen currently providing input to the system to see
00019 // if it supports tactile feedback and, if so, what features it supports
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario2_SupportedTactileFeedback : Page
00023     {
00024         SimpleHapticsController hapticsController;
00025         PenDevice penDevice;
00026
00027         public Scenario2_SupportedTactileFeedback()
00028         {
00029             InitializeComponent();
00030         }
00031
00032         // The PointerEnter event will get fired as soon as Pointer input is received.
00033         // This event handler implementation will query the device providing input to see if it's a pen and
00034         // then check to see the pen supports tactile feedback and, if so, what features it supports
00035         private void Pointer_Entered(object sender, PointerRoutedEventArgs e)
00036         {
00037             // If the current Pointer device is not a pen, exit
00038             if (e.Pointer.PointerDeviceType != PointerDeviceType.Pen)
00039             {
00040                 supportedFeatures.Text = "";
00041                 supportedFeedback.Text = "";
00042                 return;
00043             }
00044
00045             // Attempt to retrieve the PenDevice from the current PointerId
00046             penDevice = PenDevice.GetFromPointerId(e.Pointer.PointerId);
00047
00048             // If a PenDevice cannot be retrieved based on the PointerId, it does not support
00049             // advanced pen features, such as tactile feedback
00050             if (penDevice == null)
00051             {
00052                 statusText.Text = "Advanced pen features not supported";
00053                 supportedFeatures.Text = "";
00054                 supportedFeedback.Text = "";
00055                 return;
00056             }
00057
00058             // Check to see if the current PenDevice supports tactile feedback by seeing if it
00059             // has a SimpleHapticsController
00060             hapticsController = penDevice.SimpleHapticsController;
00061             if (hapticsController == null)
00062             {
00063                 statusText.Text = "This pen does not provide tactile feedback";
00064                 return;
00065             }
00066
00067             // Check which tactile feedback features are supported
00068             supportedFeatures.Text = "Supported Haptics Features:\n";
00069             if (hapticsController.IsIntensitySupported)
00070             {
00071                 supportedFeatures.Text += "Intensity\n";
00072             }
00073             if (hapticsController.IsPlayCountSupported)
00074             {
00075                 supportedFeatures.Text += "PlayCount\n";
00076             }
00077             if (hapticsController.IsPlayDurationSupported)
00078             {
00079                 supportedFeatures.Text += "PlayDuration\n";
00080             }
00081             if (hapticsController.IsReplayPauseIntervalSupported)
00082             {
00083                 supportedFeatures.Text += "ReplayPauseInterval\n";
00084             }
00085
00086             // Check which feedback waveforms are supported
00087             supportedFeedback.Text = "Supported Feedback:\n";
00088             foreach (SimpleHapticsControllerFeedback feedback in hapticsController.SupportedFeedback)
00089             {
00090                 ushort waveform = feedback.Waveform;
00091                 foreach (KeyValuePair<string, ushort> entry in MainPage.WaveformNamesMap)
00092                 {
00093                     if (entry.Value == waveform)
00094                     {
00095                         supportedFeedback.Text += entry.Key + "\n";
00096                         break;
00097                     }
00098                 }
00099             }
00100             statusText.Text = "";
00101         }
00102
00103         // Clear the current penDevice and hapticsController on PointerExit
00104         private void Pointer_Exited(object sender, PointerRoutedEventArgs e)
00105         {
00106             penDevice = null;
00107             hapticsController = null;
00108         }
00109     }
00110 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Vector4< T > Member List

This is the complete list of members for Vector4< T >, including all inherited members.
a | Vector4< T > |
b | Vector4< T > |
color | Vector4< T > |
coord | Vector4< T > |
g | Vector4< T > |
operator[](unsigned int index) | Vector4< T > | [inline]
operator[](unsigned int index) | Vector4< T > | [inline]
operator[](unsigned int index) | Vector4< T > | [inline]
r | Vector4< T > |
Vector4(T _x=0, T _y=0, T _z=0, T _w=0) | Vector4< T > | [inline]
Vector4(T _x=0, T _y=0, T _z=0, T _w=0) | Vector4< T > | [inline]
Vector4(T _x=0, T _y=0, T _z=0, T _w=0) | Vector4< T > | [inline]
w | Vector4< T > |
x | Vector4< T > |
y | Vector4< T > |
z | Vector4< T > |
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/pch.h Source File

  • UserCertificateStore
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Security.Cryptography.Certificates.h"
00008 #include "winrt/Windows.Security.Cryptography.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cs/SampleConfiguration.cs Source File

  • ClientDeviceInformation
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "EAS protocol";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Get Device Information", ClassType=typeof(Scenario1_GetDeviceInformation)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Listen Member List

This is the complete list of members for Scenario2_Listen, including all inherited members.
currentValue | Scenario2_Listen | [private]
LISTEN_PIN | Scenario2_Listen | [private]
listenPin | Scenario2_Listen | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_Listen | [inline, protected]
Pin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs e) | Scenario2_Listen | [inline, private]
Scenario2_Listen() | Scenario2_Listen | [inline]
SET_PIN | Scenario2_Listen | [private]
setPin | Scenario2_Listen | [private]
StartScenario() | Scenario2_Listen | [inline, private]
StartStopScenario_Click(object sender, RoutedEventArgs e) | Scenario2_Listen | [inline, private]
StopScenario() | Scenario2_Listen | [inline, private]
timer | Scenario2_Listen | [private]
Timer_Tick(object sender, object e) | Scenario2_Listen | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMediaSink Member List

This is the complete list of members for CMediaSink, including all inherited members.
_callback | CMediaSink | [private]
_cRef | CMediaSink | [private]
_critSec | CMediaSink | [private]
_cStreamsEnded | CMediaSink | [private]
_IsConnected | CMediaSink | [private]
_IsShutdown | CMediaSink | [private]
_llStartTime | CMediaSink | [private]
_networkSender | CMediaSink | [private]
_remoteUrl | CMediaSink | [private]
_spAttributes | CBaseAttributes<> | [protected]
_spClock | CMediaSink | [private]
_spReceiveBuffer | CMediaSink | [private]
_streams | CMediaSink | [private]
_waitingConnectionId | CMediaSink | [private]
AddStreamSink(DWORD dwStreamSinkIdentifier, IMFMediaType *pMediaType, IMFStreamSink **ppStreamSink) | CMediaSink | [private]
CBaseAttributes() | CBaseAttributes<> | [inline, protected]
CBaseAttributes(HRESULT &hr, UINT32 cInitialSize=0) | CBaseAttributes<> | [inline, protected]
CBaseAttributes(HRESULT &hr, IUnknown *pUnk) | CBaseAttributes<> | [inline, protected]
CheckShutdown() const | CMediaSink | [inline, private]
Compare(IMFAttributes *pTheirs, MF_ATTRIBUTES_MATCH_TYPE MatchType, BOOL *pbResult) | CBaseAttributes<> | [inline]
CompareItem(REFGUID guidKey, REFPROPVARIANT Value, BOOL *pbResult) | CBaseAttributes<> | [inline]
CopyAllItems(IMFAttributes *pDest) | CBaseAttributes<> | [inline]
DeleteAllItems() | CBaseAttributes<> | [inline]
DeleteItem(REFGUID guidKey) | CBaseAttributes<> | [inline]
DeserializeFromBlob(const UINT8 *pBuffer, UINT cbSize) | CBaseAttributes<> | [inline]
DeserializeFromStream(DWORD dwOptions, IStream *pStm) | CBaseAttributes<> | [inline]
FillStreamDescription(CStreamSink *pStream, StspStreamDescription *pStreamDescription) | CMediaSink | [private]
GetAllocatedBlob(REFGUID guidKey, UINT8 **ppBuf, UINT32 *pcbSize) | CBaseAttributes<> | [inline]
GetAllocatedString(REFGUID guidKey, LPWSTR *ppwszValue, UINT32 *pcchLength) | CBaseAttributes<> | [inline]
GetBlob(REFGUID guidKey, UINT8 *pBuf, UINT32 cbBufSize, UINT32 *pcbBlobSize) | CBaseAttributes<> | [inline]
GetBlobSize(REFGUID guidKey, UINT32 *pcbBlobSize) | CBaseAttributes<> | [inline]
GetCharacteristics(DWORD *pdwCharacteristics) | CMediaSink | [private]
GetCount(UINT32 *pcItems) | CBaseAttributes<> | [inline]
GetDouble(REFGUID guidKey, double *pfValue) | CBaseAttributes<> | [inline]
GetGUID(REFGUID guidKey, GUID *pguidValue) | CBaseAttributes<> | [inline]
GetItem(REFGUID guidKey, PROPVARIANT *pValue) | CBaseAttributes<> | [inline]
GetItemByIndex(UINT32 unIndex, GUID *pguidKey, PROPVARIANT *pValue) | CBaseAttributes<> | [inline]
GetItemType(REFGUID guidKey, MF_ATTRIBUTE_TYPE *pType) | CBaseAttributes<> | [inline]
GetPresentationClock(IMFPresentationClock **ppPresentationClock) | CMediaSink | [private]
GetRatio(REFGUID guidKey, UINT32 *pnNumerator, UINT32 *punDenominator) | CBaseAttributes<> | [inline]
GetSize(REFGUID guidKey, UINT32 *punWidth, UINT32 *punHeight) | CBaseAttributes<> | [inline]
GetStartTime() const | CMediaSink | [inline, private]
GetStreamSinkById(DWORD dwIdentifier, IMFStreamSink **ppStreamSink) | CMediaSink | [private]
GetStreamSinkByIndex(DWORD dwIndex, _Outptr_ IMFStreamSink **ppStreamSink) | CMediaSink | [private]
GetStreamSinkCount(_Out_ DWORD *pcStreamSinkCount) | CMediaSink | [private]
GetString(REFGUID guidKey, LPWSTR pwszValue, UINT32 cchBufSize, UINT32 *pcchLength) | CBaseAttributes<> | [inline]
GetStringLength(REFGUID guidKey, UINT32 *pcchLength) | CBaseAttributes<> | [inline]
GetUINT32(REFGUID guidKey, UINT32 *punValue) | CBaseAttributes<> | [inline]
GetUINT64(REFGUID guidKey, UINT64 *punValue) | CBaseAttributes<> | [inline]
GetUnknown(REFGUID guidKey, REFIID riid, LPVOID *ppv) | CBaseAttributes<> | [inline]
HandleError(HRESULT hr) | CMediaSink | [private]
Initialize(UINT32 cInitialSize=0) | CBaseAttributes<> | [inline, protected]
Initialize(IUnknown *pUnk) | CBaseAttributes<> | [inline, protected]
LockStore() | CBaseAttributes<> | [inline]
OnClockPause(MFTIME hnsSystemTime) | CMediaSink | [private]
OnClockRestart(MFTIME hnsSystemTime) | CMediaSink | [private]
OnClockSetRate(MFTIME hnsSystemTime, float flRate) | CMediaSink | [private]
OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset) | CMediaSink | [private]
OnClockStop(MFTIME hnsSystemTime) | CMediaSink | [private]
PrepareRemoteUrl(StreamSocketInformation^info) | CMediaSink | [private]
RemoveStreamSink(DWORD dwStreamSinkIdentifier) | CMediaSink | [private]
ReportEndOfStream() | CMediaSink | [private]
ReportFormatChange(DWORD streamId) | CMediaSink | [private]
RuntimeClassInitialize(ISinkCallback^callback, Windows::Media::MediaProperties::IMediaEncodingProperties^audioEncodingProperties, Windows::Media::MediaProperties::IMediaEncodingProperties^videoEncodingProperties) | CMediaSink | [private]
SendDescription() | CMediaSink | [private]
SendPacket(Network::IBufferPacket *pPacket) | CMediaSink | [private]
SerializeToBlob(UINT8 **ppBuffer, UINT *pcbSize) | CBaseAttributes<> | [inline]
SerializeToStream(DWORD dwOptions, IStream *pStm) | CBaseAttributes<> | [inline]
SetBlob(REFGUID guidKey, const UINT8 *pBuf, UINT32 cbBufSize) | CBaseAttributes<> | [inline]
SetDouble(REFGUID guidKey, double fValue) | CBaseAttributes<> | [inline]
SetGUID(REFGUID guidKey, REFGUID guidValue) | CBaseAttributes<> | [inline]
SetItem(REFGUID guidKey, REFPROPVARIANT Value) | CBaseAttributes<> | [inline]
SetMediaStreamProperties(Windows::Media::Capture::MediaStreamType MediaStreamType, _In_opt_ Windows::Media::MediaProperties::IMediaEncodingProperties^mediaEncodingProperties) | CMediaSink | [private]
SetPresentationClock(IMFPresentationClock *pPresentationClock) | CMediaSink | [private]
SetProperties(ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration) | CMediaSink | [inline, private]
SetRatio(REFGUID guidKey, UINT32 unNumerator, UINT32 unDenominator) | CBaseAttributes<> | [inline]
SetSize(REFGUID guidKey, UINT32 unWidth, UINT32 unHeight) | CBaseAttributes<> | [inline]
SetString(REFGUID guidKey, LPCWSTR wszValue) | CBaseAttributes<> | [inline]
SetUINT32(REFGUID guidKey, UINT32 unValue) | CBaseAttributes<> | [inline]
SetUINT64(REFGUID guidKey, UINT64 unValue) | CBaseAttributes<> | [inline]
SetUnknown(REFGUID guidKey, IUnknown *pUnknown) | CBaseAttributes<> | [inline]
Shutdown() | CMediaSink | [private]
StartListening() | CMediaSink | [private]
StartReceiving(Network::IMediaBufferWrapper *pReceiveBuffer) | CMediaSink | [private]
StreamContainer typedef | CMediaSink | [private]
TriggerAcceptConnection(DWORD connectionId) | CMediaSink | [private]
TriggerRefuseConnection(DWORD connectionId) | CMediaSink | [private]
UnlockStore() | CBaseAttributes<> | [inline]
~CBaseAttributes() | CBaseAttributes<> | [inline, protected, virtual]
~CMediaSink() | CMediaSink | [private]
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
_tileId | ScenarioElement | [private]
ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Project.idl Source File

  • TitleBar
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Colors : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged
00016     {
00017         Scenario1_Colors();
00018
00019         Windows.UI.ViewManagement.ApplicationViewTitleBar TitleBar{ get; };
00020     }
00021
00022     [default_interface]
00023     runtimeclass Scenario2_Extend : Windows.UI.Xaml.Controls.Page
00024     {
00025         Scenario2_Extend();
00026     }
00027
00028     [default_interface]
00029     runtimeclass CustomTitleBar : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged
00030     {
00031         CustomTitleBar();
00032
00033         Windows.UI.Xaml.UIElement SetPageContent(Windows.UI.Xaml.UIElement newContent);
00034         void EnableControlsInTitleBar(Boolean enable);
00035
00036         Windows.UI.Xaml.Thickness CoreTitleBarPadding{ get; };
00037         Double CoreTitleBarHeight{ get; };
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/pch.h Source File

  • SimpleCommunication
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.h Source File

  • HolographicVoiceInput
  • cpp
  • Audio

OmnidirectionalSound.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "AudioFileReader.h"
00015 #include "AudioStreamReader.h"
00016
00017 //
00018 // Sound with omnidirectional radiation pattern i.e. emits sound equally in all directions.
00019 //
00020 class OmnidirectionalSound
00021 {
00022 public:
00023     virtual ~OmnidirectionalSound();
00024     HRESULT Initialize(_In_ LPCWSTR filename, UINT32 const& loopCount);
00025     HRESULT Initialize(Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ stream, UINT32 const& loopCount);
00026
00027     HRESULT Start();
00028     HRESULT Stop();
00029     HRESULT GetInitializationStatus() { return _initStatus; }
00030     HRESULT OnUpdate(_In_ float angularVelocity, _In_ float height, _In_ float radius);
00031     HRESULT OnUpdate(_In_ Windows::Foundation::Numerics::float3 transform);
00032     HRESULT SetEnvironment(_In_ HrtfEnvironment environment);
00033     HrtfEnvironment GetEnvironment() { return _environment; }
00034     float GetDuration() { return _duration; };
00035
00036 private:
00037     HrtfPosition ComputePositionInOrbit(_In_ float height, _In_ float radius, _In_ float angle);
00038
00039 private:
00040
00041     enum SoundSourceType {
00042         File,
00043         Stream,
00044     };
00045
00046     HRESULT                                     _initStatus;
00047     SoundSourceType                             _sourceType;
00048     AudioFileReader                             _audioFile;
00049     AudioStreamReader                           _audioStream;
00050     Microsoft::WRL::ComPtr<IXAudio2>            _xaudio2;
00051     IXAudio2SourceVoice*                        _sourceVoice = nullptr;
00052     Microsoft::WRL::ComPtr<IXAPOHrtfParameters> _hrtfParams;
00053     HrtfEnvironment                             _environment = HrtfEnvironment::Outdoors;
00054     ULONGLONG                                   _lastTick = 0;
00055     float                                       _angle = 0;
00056     float                                       _duration = 0.f;
00057 };
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Manager Member List

This is the complete list of members for Manager, including all inherited members.
_employee | Manager | [private]
_reports | Manager | [private]
_reportsDictionary | Manager | [private]
DirectManager | Manager |
FirstName | Manager |
FullName() | Manager | [inline]
FullName() | Manager | [inline]
IsManager | Manager |
LastName | Manager |
Manager() | Manager | [inline]
Manager() | Manager | [inline]
Name | Manager |
NotifyPropertyChanged([CallerMemberName] string propertyName="") | Manager | [inline, private]
NotifyPropertyChanged([CallerMemberName] string propertyName="") | Manager | [inline, private]
NullImageSource | Manager |
NullStringProperty | Manager |
Poke(object sender, RoutedEventArgs e) | Manager | [inline]
Poke(object sender, RoutedEventArgs e) | Manager | [inline]
PropertyChanged | Manager |
ReportsDict | Manager |
ReportsEnum | Manager |
ReportsList | Manager |
ReportsOC | Manager |
Title | Manager |
Visibility | Manager |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario3_Calibration.xaml.h Source File

  • Inclinometer
  • cpp

Scenario3_Calibration.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Calibration.xaml.h
00014 // Declaration of the Scenario3_Calibration class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario3_Calibration.g.h"
00021 #include "MainPage.xaml.h"
00022 #include "CalibrationBar.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     [Windows::Foundation::Metadata::WebHostHidden]
00030     public ref class Scenario3_Calibration sealed
00031     {
00032     public:
00033         Scenario3_Calibration();
00034
00035     protected:
00036         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038
00039     private:
00040         SDKTemplate::MainPage^ rootPage;
00041         SDKTemplate::CalibrationBar^ calibrationBar;
00042
00043         void OnHighAccuracy(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044         void OnApproximateAccuracy(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045         void OnUnreliableAccuracy(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046     };
00047 }
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/PageToPrint.xaml.cs Source File

  • Printing
  • cs

PageToPrint.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml;
00002 using Windows.UI.Xaml.Controls;
00003
00004 namespace PrintSample
00005 {
00006     /// <summary>
00007     /// Page content to send to the printer
00008     /// </summary>
00009     public sealed partial class PageToPrint : Page
00010     {
00011         public RichTextBlock TextContentBlock { get; set; }
00012
00013         public PageToPrint()
00014         {
00015             this.InitializeComponent();
00016             TextContentBlock = TextContent;
00017         }
00018     }
00019 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Common.h Source File

  • WindowsAudioSession
  • cpp

Common.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // pch.h
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017 #include <Windows.h>
00018 #include <wrl\implements.h>
00019 #include <mmreg.h>
00020 #include <mfapi.h>
00021
00022 using namespace Microsoft::WRL;
00023
00024 // release and zero out a possible NULL pointer. note this will
00025 // do the release on a temp copy to avoid reentrancy issues that can result from
00026 // callbacks durring the release
00027 template <class T> void SafeRelease( __deref_inout_opt T **ppT )
00028 {
00029     T *pTTemp = *ppT; // temp copy
00030     *ppT = nullptr;   // zero the input
00031     if (pTTemp)
00032     {
00033         pTTemp->Release();
00034     }
00035 }
00036
00037 // Exception Helper Method
00038 inline void ThrowIfFailed( HRESULT hr )
00039 {
00040     if (FAILED( hr ))
00041     {
00042         // Set a breakpoint on this line to catch API errors.
00043         throw Platform::Exception::CreateException( hr );
00044     }
00045 }
00046
00047 #ifndef SAFE_RELEASE
00048 #define SAFE_RELEASE(x) { SafeRelease(&x); }
00049 #endif
00050
00051 #ifndef SAFE_DELETE
00052 #define SAFE_DELETE(x) { delete x; x = nullptr; }
00053 #endif
00054
00055 #ifndef SAFE_ARRAYDELETE
00056 #define SAFE_ARRAYDELETE(x) { delete[] x; x = nullptr; }
00057 #endif
00058
00059 #ifndef METHODASYNCCALLBACK
00060 #define METHODASYNCCALLBACK(Parent, AsyncCallback, pfnCallback) \
00061 class Callback##AsyncCallback :\
00062     public IMFAsyncCallback \
00063 { \
00064 public: \
00065     Callback##AsyncCallback() : \
00066         _parent(((Parent*)((BYTE*)this - offsetof(Parent, m_x##AsyncCallback)))), \
00067         _dwQueueID( MFASYNC_CALLBACK_QUEUE_MULTITHREADED ) \
00068     { \
00069     } \
00070 \
00071     STDMETHOD_( ULONG, AddRef )() \
00072     { \
00073         return _parent->AddRef(); \
00074     } \
00075     STDMETHOD_( ULONG, Release )() \
00076     { \
00077         return _parent->Release(); \
00078     } \
00079     STDMETHOD( QueryInterface )( REFIID riid, void **ppvObject ) \
00080     { \
00081         if (riid == IID_IMFAsyncCallback || riid == IID_IUnknown) \
00082         { \
00083             (*ppvObject) = this; \
00084             AddRef(); \
00085             return S_OK; \
00086         } \
00087         *ppvObject = NULL; \
00088         return E_NOINTERFACE; \
00089     } \
00090     STDMETHOD( GetParameters )( \
00091         /* [out] */ __RPC__out DWORD *pdwFlags, \
00092         /* [out] */ __RPC__out DWORD *pdwQueue) \
00093     { \
00094         *pdwFlags = 0; \
00095         *pdwQueue = _dwQueueID; \
00096         return S_OK; \
00097     } \
00098     STDMETHOD( Invoke )( /* [out] */ __RPC__out IMFAsyncResult * pResult ) \
00099     { \
00100         _parent->pfnCallback( pResult ); \
00101         return S_OK; \
00102     } \
00103     void SetQueueID( DWORD dwQueueID ) { _dwQueueID = dwQueueID; } \
00104 \
00105 protected: \
00106     Parent* _parent; \
00107     DWORD   _dwQueueID; \
00108            \
00109 } m_x##AsyncCallback;
00110 #endif
00111
00112 //
00113 // CAsyncState
00114 //
00115 // Used to maintain state during MF Work Item callbacks
00116 class CAsyncState :
00117     public RuntimeClass<RuntimeClassFlags<ClassicCom>, IUnknown>
00118 {
00119 public:
00120     CAsyncState( Platform::Array<int,1>^ data, UINT32 size ) :
00121         m_Data(data),
00122         m_Size(size)
00123     {
00124     };
00125
00126 public:
00127     Platform::Array<int,1>^  m_Data;
00128     UINT32                   m_Size;
00129
00130 private:
00131     virtual ~CAsyncState() {};
00132 };
00133
00134 struct RenderBuffer
00135 {
00136     UINT32          BufferSize;
00137     UINT32          BytesFilled;
00138     BYTE           *Buffer;
00139     RenderBuffer   *Next;
00140
00141     RenderBuffer() :
00142         BufferSize(0),
00143         BytesFilled(0),
00144         Buffer( nullptr ),
00145         Next( nullptr )
00146     {
00147     }
00148
00149     ~RenderBuffer()
00150     {
00151         SAFE_ARRAYDELETE( Buffer );
00152     }
00153 };
00154
00155 enum RenderSampleType
00156 {
00157     SampleTypeUnknown,
00158     SampleTypeFloat,
00159     SampleType16BitPCM,
00160     SampleType24in32BitPCM,
00161 };
00162
00163 //
00164 //  GetRenderSampleType()
00165 //
00166 //  Determine the sample format based on media type
00167 //
00168 inline RenderSampleType GetRenderSampleType( WAVEFORMATEX *wfx )
00169 {
00170     WAVEFORMATEXTENSIBLE* wfext = reinterpret_cast<WAVEFORMATEXTENSIBLE*>(wfx);
00171
00172     if ( (wfx->wFormatTag == WAVE_FORMAT_PCM) ||
00173          (  (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
00174             (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) ) )
00175     {
00176         if (wfx->wBitsPerSample == 16)
00177         {
00178             return RenderSampleType::SampleType16BitPCM;
00179         }
00180         else if (wfx->wBitsPerSample == 32)
00181         {
00182             if ((wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
00183                 (wfext->Samples.wValidBitsPerSample == 24))
00184             {
00185                 return RenderSampleType::SampleType24in32BitPCM;
00186             }
00187         }
00188     }
00189     else if ( (wfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) ||
00190               ( (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
00191                 (wfext->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) ) )
00192     {
00193         return RenderSampleType::SampleTypeFloat;
00194     }
00195
00196     return RenderSampleType::SampleTypeUnknown;
00197 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AtrParser Member List

This is the complete list of members for AtrParser, including all inherited members.
AtrHeader enum name | AtrParser | [private]
Parse(byte[] atrBytes) | AtrParser | [inline, static]
ValidateTCK(byte[] atr) | AtrParser | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModelConstantBuffer Member List

This is the complete list of members for ModelConstantBuffer, including all inherited members.
model ModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.h Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario2_SampleBackgroundTaskWithCondition.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2_SampleBackgroundTaskWithCondition.xaml.h
00013 // Declaration of the SampleBackgroundTaskWithCondition class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2_SampleBackgroundTaskWithCondition.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class SampleBackgroundTaskWithCondition sealed
00029     {
00030     public:
00031         SampleBackgroundTaskWithCondition();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035     private:
00036         SDKTemplate::MainPage^ rootPage;
00037
00038         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00039         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00042         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00043         void UpdateUI();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:18:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.h Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario1_SampleBackgroundTask.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1_SampleBackgroundTask.xaml.h
00013 // Declaration of the SampleBackgroundTask class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario1_SampleBackgroundTask.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class SampleBackgroundTask sealed
00029     {
00030     public:
00031         SampleBackgroundTask();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035     private:
00036         SDKTemplate::MainPage^ rootPage;
00037
00038         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00039         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00042         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00043         void UpdateUI();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:18:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/Whiteboard.h Source File

  • SpatialInteractionSource
  • cpp
  • Content

Whiteboard.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "RenderingInterfaces.h"
00003
00004 namespace HolographicPaint
00005 {
00006
00007     class Whiteboard sealed : public IBaseRenderedObject
00008     {
00009     public:
00010         Whiteboard(float width, float height, Windows::Foundation::Numerics::float3 position);
00011
00012         virtual void Update(ID3D11DeviceContext* pDeviceContext) override;
00013         virtual void Render(ID3D11DeviceContext* pDeviceContext, IRenderer* pRenderingHelper) override;
00014
00015         // return a negative value if there is no intersection between ray and board
00016         bool Intersects(const Windows::Foundation::Numerics::float3& origin, const Windows::Foundation::Numerics::float3& direction, float* distance);
00017
00018         bool IsValidPosition(const Windows::Foundation::Numerics::float3& position);
00019
00020     private:
00021         float m_width;
00022         float m_height;
00023         Windows::Foundation::Numerics::float3 m_position;
00024         ModelConstantBuffer m_modelConstantBufferData;
00025
00026         DirectX::BoundingBox m_boundingBox;
00027
00028     };
00029
00030 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/CameraRotationHelper.cs Source File

  • CameraStarterKit
  • cs

CameraRotationHelper.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Devices.Enumeration;
00003 using Windows.Devices.Sensors;
00004 using Windows.Graphics.Display;
00005 using Windows.Media.Capture;
00006 using Windows.Storage.FileProperties;
00007
00008 namespace CameraStarterKit
00009 {
00010     class CameraRotationHelper
00011     {
00012         private EnclosureLocation _cameraEnclosureLocation;
00013         private DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView();
00014         private SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault();
00015
00016         /// <summary>
00017         /// Occurs each time the simple orientation sensor reports a new sensor reading or when the display's current or native orientation changes
00018         /// </summary>
00019         public event EventHandler<bool> OrientationChanged;
00020
00021         public CameraRotationHelper(EnclosureLocation cameraEnclosureLocation)
00022         {
00023             _cameraEnclosureLocation = cameraEnclosureLocation;
00024             if (!IsEnclosureLocationExternal(_cameraEnclosureLocation) && _orientationSensor != null)
00025             {
00026                 _orientationSensor.OrientationChanged += SimpleOrientationSensor_OrientationChanged;
00027             }
00028             _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
00029         }
00030
00031         /// <summary>
00032         /// Detects whether or not the camera is external to the device
00033         /// </summary>
00034         public static bool IsEnclosureLocationExternal(EnclosureLocation enclosureLocation)
00035         {
00036             return (enclosureLocation == null || enclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown);
00037         }
00038
00039         /// <summary>
00040         /// Gets the rotation to rotate ui elements
00041         /// </summary>
00042         public SimpleOrientation GetUIOrientation()
00043         {
00044             if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00045             {
00046                 // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00047                 return SimpleOrientation.NotRotated;
00048             }
00049
00050             // Return the difference between the orientation of the device and the orientation of the app display
00051             var deviceOrientation = _orientationSensor?.GetCurrentOrientation() ?? SimpleOrientation.NotRotated;
00052             var displayOrientation = ConvertDisplayOrientationToSimpleOrientation(_displayInformation.CurrentOrientation);
00053             return SubtractOrientations(displayOrientation, deviceOrientation);
00054         }
00055
00056         /// <summary>
00057         /// Gets the rotation of the camera to rotate pictures/videos when saving to file
00058         /// </summary>
00059         public SimpleOrientation GetCameraCaptureOrientation()
00060         {
00061             if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00062             {
00063                 // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00064                 return SimpleOrientation.NotRotated;
00065             }
00066
00067             // Get the device orientation offset by the camera hardware offset
00068             var deviceOrientation = _orientationSensor?.GetCurrentOrientation() ?? SimpleOrientation.NotRotated;
00069             var result = SubtractOrientations(deviceOrientation, GetCameraOrientationRelativeToNativeOrientation());
00070
00071             // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
00072             if (ShouldMirrorPreview())
00073             {
00074                 result = MirrorOrientation(result);
00075             }
00076             return result;
00077         }
00078
00079         /// <summary>
00080         /// Gets the rotation of the camera to display the camera preview
00081         /// </summary>
00082         public SimpleOrientation GetCameraPreviewOrientation()
00083         {
00084             if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00085             {
00086                 // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00087                 return SimpleOrientation.NotRotated;
00088             }
00089
00090             // Get the app display rotation offset by the camera hardware offset
00091             var result = ConvertDisplayOrientationToSimpleOrientation(_displayInformation.CurrentOrientation);
00092             result = SubtractOrientations(result, GetCameraOrientationRelativeToNativeOrientation());
00093
00094             // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
00095             if (ShouldMirrorPreview())
00096             {
00097                 result = MirrorOrientation(result);
00098             }
00099             return result;
00100         }
00101
00102         public static PhotoOrientation ConvertSimpleOrientationToPhotoOrientation(SimpleOrientation orientation)
00103         {
00104             switch (orientation)
00105             {
00106                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00107                     return PhotoOrientation.Rotate90;
00108                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00109                     return PhotoOrientation.Rotate180;
00110                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00111                     return PhotoOrientation.Rotate270;
00112                 case SimpleOrientation.NotRotated:
00113                 default:
00114                     return PhotoOrientation.Normal;
00115             }
00116         }
00117
00118         public static int ConvertSimpleOrientationToClockwiseDegrees(SimpleOrientation orientation)
00119         {
00120             switch (orientation)
00121             {
00122                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00123                     return 270;
00124                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00125                     return 180;
00126                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00127                     return 90;
00128                 case SimpleOrientation.NotRotated:
00129                 default:
00130                     return 0;
00131             }
00132         }
00133
00134         private SimpleOrientation ConvertDisplayOrientationToSimpleOrientation(DisplayOrientations orientation)
00135         {
00136             SimpleOrientation result;
00137             switch (orientation)
00138             {
00139                 case DisplayOrientations.Landscape:
00140                     result = SimpleOrientation.NotRotated;
00141                     break;
00142                 case DisplayOrientations.PortraitFlipped:
00143                     result = SimpleOrientation.Rotated90DegreesCounterclockwise;
00144                     break;
00145                 case DisplayOrientations.LandscapeFlipped:
00146                     result = SimpleOrientation.Rotated180DegreesCounterclockwise;
00147                     break;
00148                 case DisplayOrientations.Portrait:
00149                 default:
00150                     result = SimpleOrientation.Rotated270DegreesCounterclockwise;
00151                     break;
00152             }
00153
00154             // Above assumes landscape; offset is needed if native orientation is portrait
00155             if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
00156             {
00157                 result = AddOrientations(result, SimpleOrientation.Rotated90DegreesCounterclockwise);
00158             }
00159
00160             return result;
00161         }
00162
00163         private static SimpleOrientation MirrorOrientation(SimpleOrientation orientation)
00164         {
00165             // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
00166             switch (orientation)
00167             {
00168                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00169                     return SimpleOrientation.Rotated270DegreesCounterclockwise;
00170                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00171                     return SimpleOrientation.Rotated90DegreesCounterclockwise;
00172             }
00173             return orientation;
00174         }
00175
00176         private static SimpleOrientation AddOrientations(SimpleOrientation a, SimpleOrientation b)
00177         {
00178             var aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
00179             var bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
00180             var result = (aRot + bRot) % 360;
00181             return ConvertClockwiseDegreesToSimpleOrientation(result);
00182         }
00183
00184         private static SimpleOrientation SubtractOrientations(SimpleOrientation a, SimpleOrientation b)
00185         {
00186             var aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
00187             var bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
00188             // Add 360 to ensure the modulus operator does not operate on a negative
00189             var result = (360 + (aRot - bRot)) % 360;
00190             return ConvertClockwiseDegreesToSimpleOrientation(result);
00191         }
00192
00193         private static VideoRotation ConvertSimpleOrientationToVideoRotation(SimpleOrientation orientation)
00194         {
00195             switch (orientation)
00196             {
00197                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00198                     return VideoRotation.Clockwise270Degrees;
00199                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00200                     return VideoRotation.Clockwise180Degrees;
00201                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00202                     return VideoRotation.Clockwise90Degrees;
00203                 case SimpleOrientation.NotRotated:
00204                 default:
00205                     return VideoRotation.None;
00206             }
00207         }
00208
00209         private static SimpleOrientation ConvertClockwiseDegreesToSimpleOrientation(int orientation)
00210         {
00211             switch (orientation)
00212             {
00213                 case 270:
00214                     return SimpleOrientation.Rotated90DegreesCounterclockwise;
00215                 case 180:
00216                     return SimpleOrientation.Rotated180DegreesCounterclockwise;
00217                 case 90:
00218                     return SimpleOrientation.Rotated270DegreesCounterclockwise;
00219                 case 0:
00220                 default:
00221                     return SimpleOrientation.NotRotated;
00222             }
00223         }
00224
00225         private void SimpleOrientationSensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
00226         {
00227             if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
00228             {
00229                 // Only raise the OrientationChanged event if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
00230                 // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
00231                 // either up or down, at the desired subject.
00232                 //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
00233                 //      on other panels, this logic should be adjusted.
00234                 OrientationChanged?.Invoke(this, false);
00235             }
00236         }
00237
00238         private void DisplayInformation_OrientationChanged(DisplayInformation sender, object args)
00239         {
00240             OrientationChanged?.Invoke(this, true);
00241         }
00242
00243         private bool ShouldMirrorPreview()
00244         {
00245             // It is recommended that applications mirror the preview for front-facing cameras, as it gives users a more natural experience, since it behaves more like a mirror
00246             return (_cameraEnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
00247         }
00248
00249         private SimpleOrientation GetCameraOrientationRelativeToNativeOrientation()
00250         {
00251             // Get the rotation angle of the camera enclosure as it is mounted in the device hardware
00252             var enclosureAngle = ConvertClockwiseDegreesToSimpleOrientation((int)_cameraEnclosureLocation.RotationAngleInDegreesClockwise);
00253
00254             // Account for the fact that, on portrait-first devices, the built in camera sensor is read at a 90 degree offset to the native orientation
00255             if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait && !IsEnclosureLocationExternal(_cameraEnclosureLocation))
00256             {
00257                 enclosureAngle = AddOrientations(SimpleOrientation.Rotated90DegreesCounterclockwise, enclosureAngle);
00258             }
00259
00260             return enclosureAngle;
00261         }
00262     }
00263 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/Scenario1_ListView.xaml.cs Source File

  • XamlDragAndDrop
  • cs

Scenario1_ListView.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using System.Collections.ObjectModel;
00018 using System.Text;
00019 using Windows.ApplicationModel.DataTransfer;
00020 using System.Diagnostics;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 namespace DragAndDropSampleManaged
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class Scenario1_ListView : Page
00030     {
00031         private MainPage rootPage;
00032
00033         ObservableCollection<string> _reference;
00034         ObservableCollection<string> _selection;
00035         string _deletedItem;
00036
00037         public Scenario1_ListView()
00038         {
00039             this.InitializeComponent();
00040
00041             _reference = GetSampleData();
00042             _selection = new ObservableCollection<string>();
00043             SourceListView.ItemsSource = _reference;
00044             TargetListView.ItemsSource = _selection;
00045
00046         }
00047         private ObservableCollection<string> GetSampleData()
00048         {
00049             return new ObservableCollection<string>
00050             {
00051                 "My Research Paper",
00052                 "Electricity Bill",
00053                 "My To-do list",
00054                 "TV sales receipt",
00055                 "Water Bill",
00056                 "Grocery List",
00057                 "Superbowl schedule",
00058                 "World Cup E-ticket"
00059             };
00060         }
00061
00062         protected override void OnNavigatedTo(NavigationEventArgs e)
00063         {
00064             rootPage = MainPage.Current;
00065         }
00066
00067         /// <summary>
00068         /// DragItemsStarting is called when the Drag and Drop operation starts
00069         /// We take advantage of it to set the content of the DataPackage
00070         /// as well as indicate which operations are supported
00071         /// </summary>
00072         /// <param name="sender"></param>
00073         /// <param name="e"></param>
00074         private void SourceListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
00075         {
00076             // Prepare a string with one dragged item per line
00077             var items = new StringBuilder();
00078             foreach (var item in e.Items)
00079             {
00080                 if (items.Length > 0) items.AppendLine();
00081                 items.Append(item as string);
00082             }
00083             // Set the content of the DataPackage
00084             e.Data.SetText(items.ToString());
00085             // As we want our Reference list to say intact, we only allow Copy
00086             e.Data.RequestedOperation = DataPackageOperation.Copy;
00087         }
00088
00089         /// <summary>
00090         /// DragOver is called when the dragged pointer moves over a UIElement with AllowDrop=True
00091         /// We need to return an AcceptedOperation != None in either DragOver or DragEnter
00092         /// </summary>
00093         /// <param name="sender"></param>
00094         /// <param name="e"></param>
00095         private void TargetListView_DragOver(object sender, DragEventArgs e)
00096         {
00097             // Our list only accepts text
00098             e.AcceptedOperation = (e.DataView.Contains(StandardDataFormats.Text)) ? DataPackageOperation.Copy : DataPackageOperation.None;
00099         }
00100
00101         /// <summary>
00102         /// We need to return the effective operation from Drop
00103         /// This is not important for our source ListView, but it might be if the user
00104         /// drags text from another source
00105         /// </summary>
00106         /// <param name="sender"></param>
00107         /// <param name="e"></param>
00108         private async void TargetListView_Drop(object sender, DragEventArgs e)
00109         {
00110             // This test is in theory not needed as we returned DataPackageOperation.None if
00111             // the DataPackage did not contained text. However, it is always better if each
00112             // method is robust by itself
00113             if (e.DataView.Contains(StandardDataFormats.Text))
00114             {
00115                 // We need to take a Deferral as we won't be able to confirm the end
00116                 // of the operation synchronously
00117                 var def = e.GetDeferral();
00118                 var s = await e.DataView.GetTextAsync();
00119                 var items = s.Split('\n');
00120                 foreach (var item in items)
00121                 {
00122                     _selection.Add(item);
00123                 }
00124                 e.AcceptedOperation = DataPackageOperation.Copy;
00125                 def.Complete();
00126             }
00127         }
00128
00129         /// <summary>
00130         /// DragtemsStarting is called for D&D and reorder as the framework does not
00131         /// know wherer the user will drop the items. Reorder means that the target
00132         /// and the source ListView are the same.
00133         /// </summary>
00134         /// <param name="sender"></param>
00135         /// <param name="e"></param>
00136         private void TargetListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
00137         {
00138             // The ListView is declared with selection mode set to Single.
00139             // But we want the code to be robust
00140             if (e.Items.Count == 1)
00141             {
00142                 e.Data.SetText(e.Items[0] as string);
00143                 // Reorder or move to trash are always a move
00144                 e.Data.RequestedOperation = DataPackageOperation.Move;
00145                 _deletedItem = null;
00146             }
00147         }
00148
00149         /// <summary>
00150         /// Called at the end of the operation, whether it was a reorder or move to trash
00151         /// </summary>
00152         /// <param name="sender"></param>
00153         /// <param name="args"></param>
00154         private void TargetListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
00155         {
00156             // args.DropResult is always Move and therefore we have to rely on _deletedItem to distinguish
00157             // between reorder and move to trash
00158             // Another solution would be to listen for events in the ObservableCollection
00159             if (_deletedItem != null)
00160             {
00161                 _selection.Remove(_deletedItem);
00162                 _deletedItem = null;
00163             }
00164         }
00165
00166         /// <summary>
00167         /// Entering the Trash icon
00168         /// </summary>
00169         /// <param name="sender"></param>
00170         /// <param name="e"></param>
00171         private void TargetTextBlock_DragEnter(object sender, DragEventArgs e)
00172         {
00173             // Trash only accepts text
00174             e.AcceptedOperation = (e.DataView.Contains(StandardDataFormats.Text) ? DataPackageOperation.Move : DataPackageOperation.None);
00175             // We don't want to show the Move icon
00176             e.DragUIOverride.IsGlyphVisible = false;
00177             e.DragUIOverride.Caption = "Drop item here to remove it from selection";
00178         }
00179
00180
00181         /// <summary>
00182         /// Drop on the Trash
00183         /// </summary>
00184         /// <param name="sender"></param>
00185         /// <param name="e"></param>
00186         private async void TargetTextBlock_Drop(object sender, DragEventArgs e)
00187         {
00188             if (e.DataView.Contains(StandardDataFormats.Text))
00189             {
00190                 // We need to take the deferral as the source will read _deletedItem which
00191                 // we cannot set synchronously
00192                 var def = e.GetDeferral();
00193                 _deletedItem = await e.DataView.GetTextAsync();
00194                 e.AcceptedOperation = DataPackageOperation.Move;
00195                 def.Complete();
00196             }
00197         }
00198     }
00199 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario2.xaml.h Source File

  • WindowsAudioSession
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021 #include "WASAPIRenderer.h"
00022
00023 namespace SDKSample
00024 {
00025  namespace WASAPIAudio
00026  {
00027   [Windows::Foundation::Metadata::WebHostHidden]
00028   public ref class Scenario2 sealed
00029   {
00030
00031   public:
00032    Scenario2();
00033
00034   protected:
00035    // Template Support
00036    virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037    virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038
00039   private:
00040    ~Scenario2();
00041
00042    // UI Events
00043    void btnPlay_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044    void btnPause_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045    void btnPlayPause_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046    void btnStop_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047    void btnFilePicker_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048    void radioTone_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049    void radioFile_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00050    void sliderFrequency_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00051    void sliderVolume_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
00052
00053    // UI Helpers
00054    void ShowStatusMessage(Platform::String^ str, NotifyType messageType);
00055    void UpdateContentProps(Platform::String^ str);
00056    void UpdateContentUI(Platform::Boolean disableAll);
00057    void UpdateMediaControlUI(DeviceState deviceState);
00058
00059    // Handlers
00060    void OnDeviceStateChange(Object^ sender, DeviceStateChangedEventArgs^ e);
00061    void OnPickFileAsync();
00062    void OnSetVolume(UINT32 volume);
00063
00064    void InitializeDevice();
00065    void StartDevice();
00066    void StopDevice();
00067    void PauseDevice();
00068    void PlayPauseToggleDevice();
00069
00070    void MediaButtonPressed(Windows::Media::SystemMediaTransportControls^ sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs^ e);
00071
00072   private:
00073    MainPage^            rootPage;
00074    Windows::UI::Core::CoreDispatcher^     m_CoreDispatcher;
00075    Windows::Media::SystemMediaTransportControls^   m_SystemMediaControls;
00076    Windows::Foundation::EventRegistrationToken  m_deviceStateChangeToken;
00077    Windows::Foundation::EventRegistrationToken  m_SystemMediaControlsButtonToken;
00078
00079    Platform::Boolean    m_IsMFLoaded;
00080    IRandomAccessStream^    m_ContentStream;
00081    ContentType    m_ContentType;
00082    DeviceStateChangedEvent^   m_StateChangedEvent;
00083    ComPtr<WASAPIRenderer>  m_spRenderer;
00084    Platform::Boolean    m_deviceSupportsRawMode;
00085   };
00086  }
00087 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NavigationHelper Member List

This is the complete list of members for NavigationHelper, including all inherited members.
_pageKey | NavigationHelper | [private]
Frame | NavigationHelper | [private]
LoadState | NavigationHelper |
NavigationHelper(Page page) | NavigationHelper | [inline]
OnNavigatedFrom(NavigationEventArgs e) | NavigationHelper | [inline]
OnNavigatedTo(NavigationEventArgs e) | NavigationHelper | [inline]
Page | NavigationHelper | [private]
SaveState | NavigationHelper |
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/ToneSampleGenerator.h Source File

  • WindowsAudioSession
  • cpp

ToneSampleGenerator.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // ToneSampleGenerator.h
00013 //
00014
00015 #pragma once
00016
00017 #define _USE_MATH_DEFINES
00018 #include <math.h>
00019 #include <limits.h>
00020 #include "MainPage.xaml.h"
00021
00022 template<typename T> T Convert(double Value);
00023
00024 namespace SDKSample
00025 {
00026  namespace WASAPIAudio
00027  {
00028   class ToneSampleGenerator
00029   {
00030    public:
00031    ToneSampleGenerator();
00032    ~ToneSampleGenerator();
00033
00034    Platform::Boolean IsEOF(){ return (m_SampleQueue == nullptr);  };
00035    UINT32 GetBufferLength(){ return (m_SampleQueue !=  nullptr ? m_SampleQueue->BufferSize : 0 ); };
00036    void Flush();
00037
00038    HRESULT GenerateSampleBuffer(DWORD Frequency, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx);
00039    HRESULT FillSampleBuffer(UINT32 BytesToRead, BYTE *Data);
00040
00041    private:
00042    template <typename T>
00043    void GenerateSineSamples(BYTE *Buffer, size_t BufferLength, DWORD Frequency, WORD ChannelCount, DWORD SamplesPerSecond, double Amplitude, double *InitialTheta);
00044
00045    private:
00046    RenderBuffer *m_SampleQueue;
00047    RenderBuffer **m_SampleQueueTail;
00048   };
00049  }
00050 }
00051
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ProjectedMediaTransportControls Member List

This is the complete list of members for ProjectedMediaTransportControls, including all inherited members.
OnApplyTemplate() | ProjectedMediaTransportControls | [inline, protected]
ProjectedMediaTransportControls() | ProjectedMediaTransportControls | [inline]
StopProjectingButton_Click(object sender, RoutedEventArgs e) | ProjectedMediaTransportControls | [inline, private]
StopProjectingButtonClick | ProjectedMediaTransportControls |
SwapViewsButton_Click(object sender, RoutedEventArgs e) | ProjectedMediaTransportControls | [inline, private]
SwapViewsButtonClick | ProjectedMediaTransportControls |
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SingleAccountScenario.xaml.cs Source File

  • WebAccountManagement
  • cs

SingleAccountScenario.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.ApplicationSettings;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Security.Credentials;
00018 using Windows.Security.Authentication.Web.Core;
00019 using System;
00020 using Windows.Storage;
00021 using System.Threading.Tasks;
00022 using System.Collections.Generic;
00023 using Windows.UI.Popups;
00024
00025
00026 namespace Accounts
00027 {
00028
00029     public sealed partial class SingleAccountScenario : Page
00030     {
00031         private MainPage rootPage;
00032
00033         const string AppSpecificProviderId = "myproviderid";
00034         const string AppSpecificProviderName = "App specific provider";
00035
00036         const string MicrosoftProviderId = "https://login.microsoft.com";
00037         const string MicrosoftAccountAuthority = "consumers";
00038         const string AzureActiveDirectoryAuthority = "organizations";
00039
00040         const string StoredAccountIdKey = "accountid";
00041         const string StoredProviderIdKey = "providerid";
00042         const string StoredAuthorityKey = "authority";
00043
00044         const string MicrosoftAccountClientId = "none";
00045         const string MicrosoftAccountScopeRequested = "wl.basic";
00046
00047         // To obtain azureAD tokens, you must register this app on the AzureAD portal, and obtain the client ID
00048         const string AzureActiveDirectoryClientId = "";
00049         const string AzureActiveDirectoryScopeRequested = "";
00050
00051         public SingleAccountScenario()
00052         {
00053             this.InitializeComponent();
00054         }
00055
00056         protected override void OnNavigatedTo(NavigationEventArgs e)
00057         {
00058             rootPage = MainPage.Current;
00059             AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;
00060
00061             IdentityChecker.SampleIdentityConfigurationCorrect(NotRegisteredWarning, AzureActiveDirectoryClientId);
00062         }
00063
00064         protected override void OnNavigatedFrom(NavigationEventArgs e)
00065         {
00066             AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested -= OnAccountCommandsRequested;
00067         }
00068
00069         private void Button_ShowAccountSettings(object sender, RoutedEventArgs e)
00070         {
00071             ((Button)sender).IsEnabled = false;
00072
00073             rootPage.NotifyUser("Launching AccountSettingsPane", NotifyType.StatusMessage);
00074
00075             AccountsSettingsPane.Show();
00076
00077             ((Button)sender).IsEnabled = true;
00078         }
00079
00080         private async void Button_Reset(object sender, RoutedEventArgs e)
00081         {
00082             ((Button)sender).IsEnabled = false;
00083
00084             rootPage.NotifyUser("Resetting...", NotifyType.StatusMessage);
00085
00086             await LogoffAndRemoveAccount();
00087
00088             ((Button)sender).IsEnabled = true;
00089         }
00090
00091         private async void OnAccountCommandsRequested(
00092             AccountsSettingsPane sender,
00093             AccountsSettingsPaneCommandsRequestedEventArgs e)
00094         {
00095             // In order to make async calls within this callback, the deferral object is needed
00096             AccountsSettingsPaneEventDeferral deferral = e.GetDeferral();
00097
00098             // This scenario only lets the user have one account at a time.
00099             // If there already is an account, we do not include a provider in the list
00100             // This will prevent the add account button from showing up.
00101             if (HasAccountStored())
00102             {
00103                 await AddWebAccountToPane(e);
00104             }
00105             else
00106             {
00107                 await AddWebAccountProvidersToPane(e);
00108             }
00109
00110             AddLinksAndDescription(e);
00111
00112             deferral.Complete();
00113         }
00114
00115         private void AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs e)
00116         {
00117             e.HeaderText = "Describe what adding an account to your application will do for the user";
00118
00119             // You can add links such as privacy policy, help, general account settings
00120             e.Commands.Add(new SettingsCommand("privacypolicy", "Privacy policy", PrivacyPolicyInvoked));
00121             e.Commands.Add(new SettingsCommand("otherlink", "Other link", OtherLinkInvoked));
00122         }
00123
00124         private async Task AddWebAccountProvidersToPane(AccountsSettingsPaneCommandsRequestedEventArgs e)
00125         {
00126             List<WebAccountProvider> providers = new List<WebAccountProvider>();
00127
00128             // Microsoft account and Azure AD providers will always return. Non-installed plugins or incorrect identities will return null
00129             providers.Add(await GetProvider(MicrosoftProviderId, MicrosoftAccountAuthority));
00130             providers.Add(await GetProvider(MicrosoftProviderId, AzureActiveDirectoryAuthority));
00131             providers.Add(await GetProvider(AppSpecificProviderId));
00132
00133             foreach (WebAccountProvider provider in providers)
00134             {
00135                 WebAccountProviderCommand providerCommand = new WebAccountProviderCommand(provider, WebAccountProviderCommandInvoked);
00136                 e.WebAccountProviderCommands.Add(providerCommand);
00137             }
00138         }
00139
00140         private async Task<WebAccount> GetWebAccount()
00141         {
00142             String accountID = ApplicationData.Current.LocalSettings.Values[StoredAccountIdKey] as String;
00143             String providerID = ApplicationData.Current.LocalSettings.Values[StoredProviderIdKey] as String;
00144             String authority = ApplicationData.Current.LocalSettings.Values[StoredAuthorityKey] as String;
00145
00146             WebAccount account;
00147
00148             WebAccountProvider provider = await GetProvider(providerID);
00149
00150             if (providerID == AppSpecificProviderId)
00151             {
00152                 account = new WebAccount(provider, accountID, WebAccountState.None);
00153             }
00154             else
00155             {
00156                 account = await WebAuthenticationCoreManager.FindAccountAsync(provider, accountID);
00157
00158                 // The account has been deleted if FindAccountAsync returns null
00159                 if (account == null)
00160                 {
00161                     RemoveAccountData();
00162                 }
00163             }
00164
00165             return account;
00166         }
00167
00168         private async Task AddWebAccountToPane(AccountsSettingsPaneCommandsRequestedEventArgs e)
00169         {
00170             WebAccount account = await GetWebAccount();
00171
00172             WebAccountCommand command = new WebAccountCommand(account, WebAccountInvoked, SupportedWebAccountActions.Remove | SupportedWebAccountActions.Manage);
00173             e.WebAccountCommands.Add(command);
00174         }
00175
00176         private async Task<WebAccountProvider> GetProvider(string ProviderID, string AuthorityId = "")
00177         {
00178             if (ProviderID == AppSpecificProviderId)
00179             {
00180                 return new WebAccountProvider(AppSpecificProviderId, AppSpecificProviderName, new Uri(this.BaseUri, "Assets/smallTile-sdk.png"));
00181             }
00182             else
00183             {
00184                 return await WebAuthenticationCoreManager.FindAccountProviderAsync(ProviderID, AuthorityId);
00185             }
00186         }
00187
00188         private void OtherLinkInvoked(IUICommand command)
00189         {
00190             rootPage.NotifyUser("Other link pressed by user", NotifyType.StatusMessage);
00191         }
00192
00193         private void PrivacyPolicyInvoked(IUICommand command)
00194         {
00195             rootPage.NotifyUser("Privacy policy clicked by user", NotifyType.StatusMessage);
00196         }
00197
00198         private void WebAccountProviderCommandInvoked(WebAccountProviderCommand command)
00199         {
00200             if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == MicrosoftAccountAuthority))
00201             {
00202                 // ClientID is ignored by MSA
00203                 AuthenticateWithRequestToken(command.WebAccountProvider, MicrosoftAccountScopeRequested, MicrosoftAccountClientId);
00204             }
00205             else if ((command.WebAccountProvider.Id == MicrosoftProviderId) && (command.WebAccountProvider.Authority == AzureActiveDirectoryAuthority))
00206             {
00207                 AuthenticateWithRequestToken(command.WebAccountProvider, AzureActiveDirectoryAuthority, AzureActiveDirectoryClientId);
00208             }
00209             else if (command.WebAccountProvider.Id == AppSpecificProviderId)
00210             {
00211                 // Show user registration/login for your app specific account type.
00212                 // Store the user if registration/login successful
00213                 StoreNewAccountDataLocally(new WebAccount(command.WebAccountProvider, "App Specific User", WebAccountState.None));
00214             }
00215         }
00216
00217         public async void AuthenticateWithRequestToken(WebAccountProvider Provider, String Scope, String ClientID)
00218         {
00219             try
00220             {
00221                 WebTokenRequest webTokenRequest = new WebTokenRequest(Provider, Scope, ClientID);
00222
00223                 // Azure Active Directory requires a resource to return a token
00224                 if(Provider.Id == "https://login.microsoft.com" && Provider.Authority == "organizations")
00225                 {
00226                     webTokenRequest.Properties.Add("resource", "https://graph.windows.net");
00227                 }
00228
00229                 // If the user selected a specific account, RequestTokenAsync will return a token for that account.
00230                 // The user may be prompted for credentials or to authorize using that account with your app
00231                 // If the user selected a provider, the user will be prompted for credentials to login to a new account
00232                     WebTokenRequestResult webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);
00233
00234                 if (webTokenRequestResult.ResponseStatus == WebTokenRequestStatus.Success)
00235                 {
00236                     StoreNewAccountDataLocally(webTokenRequestResult.ResponseData[0].WebAccount);
00237                 }
00238
00239                 OutputTokenResult(webTokenRequestResult);
00240             }
00241             catch (Exception ex)
00242             {
00243                 rootPage.NotifyUser("Web Token request failed: " + ex, NotifyType.ErrorMessage);
00244             }
00245         }
00246
00247         public void StoreNewAccountDataLocally(WebAccount account)
00248         {
00249             if (account.Id != "")
00250             {
00251                 ApplicationData.Current.LocalSettings.Values["AccountID"] = account.Id;
00252             }
00253             else
00254             {
00255                 // It's a custom account
00256                 ApplicationData.Current.LocalSettings.Values["AccountID"] = account.UserName;
00257             }
00258
00259
00260             ApplicationData.Current.LocalSettings.Values["ProviderID"] = account.WebAccountProvider.Id;
00261             if (account.WebAccountProvider.Authority != null)
00262             {
00263                 ApplicationData.Current.LocalSettings.Values["Authority"] = account.WebAccountProvider.Authority;
00264             }
00265             else
00266             {
00267                 ApplicationData.Current.LocalSettings.Values["Authority"] = "";
00268             }
00269         }
00270
00271         public void OutputTokenResult(WebTokenRequestResult result)
00272         {
00273             if (result.ResponseStatus == WebTokenRequestStatus.Success)
00274             {
00275                 rootPage.NotifyUser("Web Token request successful for user:" + result.ResponseData[0].WebAccount.UserName, NotifyType.StatusMessage);
00276             }
00277             else
00278             {
00279                 rootPage.NotifyUser("Web Token request error: " + result.ResponseStatus + " Code: " + result.ResponseError.ErrorMessage, NotifyType.StatusMessage);
00280             }
00281         }
00282
00283         private async void WebAccountInvoked(WebAccountCommand command, WebAccountInvokedArgs args)
00284         {
00285             if (args.Action == WebAccountAction.Remove)
00286             {
00287                 rootPage.NotifyUser("Removing account", NotifyType.StatusMessage);
00288                 await LogoffAndRemoveAccount();
00289             }
00290             else if (args.Action == WebAccountAction.Manage)
00291             {
00292                 // Display user management UI for this account
00293                 rootPage.NotifyUser("Managing account", NotifyType.StatusMessage);
00294             }
00295         }
00296
00297         private bool HasAccountStored()
00298         {
00299             return (ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAccountIdKey) &&
00300                 ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredProviderIdKey) &&
00301                 ApplicationData.Current.LocalSettings.Values.ContainsKey(StoredAuthorityKey));
00302         }
00303
00304         private async Task LogoffAndRemoveAccount()
00305         {
00306             if (HasAccountStored())
00307             {
00308                 WebAccount account = await GetWebAccount();
00309
00310                 // Check if the account has been deleted already by Token Broker
00311                 if (account != null)
00312                 {
00313                     if (account.WebAccountProvider.Id == AppSpecificProviderId)
00314                     {
00315                         // perform actions to sign out of the app specific provider
00316                     }
00317                     else
00318                     {
00319                         await account.SignOutAsync();
00320                     }
00321                 }
00322                 account = null;
00323                 RemoveAccountData();
00324             }
00325         }
00326
00327         private void RemoveAccountData()
00328         {
00329             ApplicationData.Current.LocalSettings.Values.Remove(StoredAccountIdKey);
00330             ApplicationData.Current.LocalSettings.Values.Remove(StoredProviderIdKey);
00331             ApplicationData.Current.LocalSettings.Values.Remove(StoredAuthorityKey);
00332         }
00333
00334     }
00335 }
Generated on Fri Nov 15 2024 22:21:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_NetworkConnectivity Member List

This is the complete list of members for Scenario1_NetworkConnectivity, including all inherited members.
QueryCurrentNetworkConnectivityButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_NetworkConnectivity
Scenario1_NetworkConnectivity() | Scenario1_NetworkConnectivity
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/ViewModelBase.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

ViewModelBase.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace AdventureWorks
00014 {
00015     public ref class ViewModelBase : public Windows::UI::Xaml::DependencyObject, Windows::UI::Xaml::Data::INotifyPropertyChanged
00016     {
00017     internal:
00018         ViewModelBase();
00019
00020     public:
00021         // Inherited via INotifyPropertyChanged
00022         virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler ^ PropertyChanged;
00023
00024     protected:
00025         void NotifyPropertyChanged(Platform::String^ propertyName);
00026     };
00027 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cpp/Scenario1_Basic.xaml.h Source File

  • ResizeAppView
  • cpp

Scenario1_Basic.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Basic.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_Basic sealed
00021     {
00022     public:
00023         Scenario1_Basic();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028
00029     private:
00030         MainPage^ rootPage;
00031
00032         void ResizeView_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void SetMinimumSize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void OnWindowSizeChanged(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
00035         void UpdateContent();
00036
00037         Windows::Foundation::EventRegistrationToken windowSizeChangedToken;
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/SampleConfiguration.cpp Source File

  • FullScreenMode
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"FullScreenMode C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Entering and exiting full screen mode", xaml_typename<SDKTemplate::Scenario1_Basic>() },
00029     Scenario{ L"Launching into full screen mode", xaml_typename<SDKTemplate::Scenario2_Launch>() },
00030 });
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/SampleConfiguration.cs Source File

  • XamlDeferLoadStrategy
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using xDeferLoadStrategy;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "x:DeferLoadStrategy";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Basic Deferral", ClassType=typeof(BasicDeferral)},
00026             new Scenario() { Title="Adaptive Deferral", ClassType=typeof(AdaptivePage)},
00027             new Scenario() { Title="Control Template Deferral", ClassType=typeof(DeferredControlTemplatePart)}
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario4_ForegroundGeofence.xaml.cs Source File

  • Geolocation
  • cs

Scenario4_ForegroundGeofence.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using System.Collections.Generic;
00016 using Windows.Data.Json;
00017 using Windows.Devices.Geolocation;
00018 using Windows.Devices.Geolocation.Geofencing;
00019 using Windows.Storage;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024
00025 namespace SDKTemplate
00026 {
00027     public sealed partial class Scenario4_ForegroundGeofence : Page
00028     {
00029         private TimeSpan defaultDwellTime = TimeSpan.FromSeconds(10);
00030
00031         // This special DateTime value is used by the Geofence to mean "start immediately".
00032         private DateTimeOffset startImmediately = DateTimeOffset.FromFileTime(0);
00033
00034         private CancellationTokenSource _cts = null;
00035         private GeofenceMonitor geofenceMonitor = null;
00036
00037         // A pointer to the main page.
00038         private MainPage _rootPage = MainPage.Current;
00039
00040         // This is the TimeSpan custom format we use for the form.
00041         static readonly string timeSpanFormat = @"d\:h\:m\:s";
00042
00043         public Scenario4_ForegroundGeofence()
00044         {
00045             this.InitializeComponent();
00046         }
00047
00048         protected override async void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             Window.Current.VisibilityChanged += OnVisibilityChanged;
00051
00052             DateTime oneHourLater = DateTime.Now.AddHours(1);
00053             //rjc/$$
00054             StartDate.Date = oneHourLater.Date;
00055             StartTime.Time = oneHourLater.TimeOfDay;
00056
00057             // Get permission to use location
00058             GeolocationAccessStatus accessStatus = await Geolocator.RequestAccessAsync();
00059             switch (accessStatus)
00060             {
00061                 case GeolocationAccessStatus.Allowed:
00062                     // Wrap in try/catch in case user revokes access suddenly.
00063                     try
00064                     {
00065                         geofenceMonitor = GeofenceMonitor.Current;
00066                     }
00067                     catch (UnauthorizedAccessException)
00068                     {
00069                         _rootPage.NotifyUser("Access denied.", NotifyType.ErrorMessage);
00070                     }
00071                     if (geofenceMonitor != null)
00072                     {
00073                         foreach (Geofence geofence in geofenceMonitor.Geofences)
00074                         {
00075                             AddGeofenceToRegisteredGeofenceListBox(geofence);
00076                         }
00077
00078                         // register for state change events
00079                         geofenceMonitor.GeofenceStateChanged += OnGeofenceStateChanged;
00080                         geofenceMonitor.StatusChanged += OnGeofenceStatusChanged;
00081                     }
00082                     break;
00083
00084                 case GeolocationAccessStatus.Denied:
00085                     _rootPage.NotifyUser("Access denied.", NotifyType.ErrorMessage);
00086                     break;
00087
00088                 case GeolocationAccessStatus.Unspecified:
00089                     _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
00090                     break;
00091             }
00092         }
00093
00094         protected override void OnNavigatedFrom(NavigationEventArgs e)
00095         {
00096             Window.Current.VisibilityChanged -= OnVisibilityChanged;
00097
00098             if (_cts != null)
00099             {
00100                 _cts.Cancel();
00101                 _cts = null;
00102             }
00103             if (geofenceMonitor != null)
00104             {
00105                 geofenceMonitor.GeofenceStateChanged -= OnGeofenceStateChanged;
00106                 geofenceMonitor.StatusChanged -= OnGeofenceStatusChanged;
00107             }
00108         }
00109
00110         private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs args)
00111         {
00112             // NOTE: After the app is no longer visible on the screen and before the app is suspended
00113             // you might want your app to use toast notification for any geofence activity.
00114             // By registering for VisibiltyChanged the app is notified when the app is no longer visible in the foreground.
00115
00116             if (geofenceMonitor != null)
00117             {
00118                 if (args.Visible)
00119                 {
00120                     // register for foreground events
00121                     geofenceMonitor.GeofenceStateChanged += OnGeofenceStateChanged;
00122                     geofenceMonitor.StatusChanged += OnGeofenceStatusChanged;
00123                 }
00124                 else
00125                 {
00126                     // unregister foreground events (let background capture events)
00127                     geofenceMonitor.GeofenceStateChanged -= OnGeofenceStateChanged;
00128                     geofenceMonitor.StatusChanged -= OnGeofenceStatusChanged;
00129                 }
00130             }
00131         }
00132
00133         public async void OnGeofenceStatusChanged(GeofenceMonitor sender, object e)
00134         {
00135             GeofenceMonitorStatus status = sender.Status;
00136
00137             string eventDescription = "Geofence Status Changed " + DateTime.Now.ToString("T") + " (" + status.ToString() + ")";
00138
00139             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00140             {
00141                 AddEventDescription(eventDescription);
00142             });
00143         }
00144
00145         public async void OnGeofenceStateChanged(GeofenceMonitor sender, object e)
00146         {
00147             var reports = sender.ReadReports();
00148
00149             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00150             {
00151                 foreach (GeofenceStateChangeReport report in reports)
00152                 {
00153                     GeofenceState state = report.NewState;
00154                     Geofence geofence = report.Geofence;
00155                     string eventDescription = geofence.Id + " " + DateTime.Now.ToString("T") + " (" + state.ToString();
00156
00157                     if (state == GeofenceState.Removed)
00158                     {
00159                         eventDescription += "/" + report.RemovalReason.ToString() + ")";
00160                         AddEventDescription(eventDescription);
00161
00162                         // remove the geofence from the monitor
00163                         geofenceMonitor.Geofences.Remove(geofence);
00164
00165                         // Remove the geofence from the list box.
00166                         foreach (ListBoxItem item in RegisteredGeofenceListBox.Items)
00167                         {
00168                             if (item.Tag == geofence)
00169                             {
00170                                 RegisteredGeofenceListBox.Items.Remove(item);
00171                                 break;
00172                             }
00173                         }
00174                     }
00175                     else if (state == GeofenceState.Entered || state == GeofenceState.Exited)
00176                     {
00177                         // NOTE: You might want to write your app to take particular
00178                         // action based on whether the app has internet connectivity.
00179
00180                         eventDescription += ")";
00181                         AddEventDescription(eventDescription);
00182                     }
00183                 }
00184             });
00185         }
00186
00187         /// <summary>
00188         /// This is the click handler for the 'Remove Geofence Item' button.
00189         /// </summary>
00190         /// <param name="sender"></param>
00191         /// <param name="e"></param>
00192         private void OnRemoveGeofenceItem(object sender, RoutedEventArgs e)
00193         {
00194             var item = RegisteredGeofenceListBox.SelectedItem as ListBoxItem;
00195             if (item != null)
00196             {
00197                 Geofence geofence = (Geofence)item.Tag;
00198
00199                 // remove the geofence from the monitor
00200                 geofenceMonitor.Geofences.Remove(geofence);
00201
00202                 // and remove from the UI
00203                 RegisteredGeofenceListBox.Items.Remove(item);
00204             }
00205         }
00206
00207         private Geofence GenerateGeofence()
00208         {
00209             _rootPage.NotifyUser("", NotifyType.StatusMessage);
00210
00211             string fenceKey = Id.Text;
00212             if (fenceKey.Length == 0)
00213             {
00214                 _rootPage.NotifyUser("Name must be between 1 and 64 characters.", NotifyType.ErrorMessage);
00215                 return null;
00216             }
00217
00218             BasicGeoposition position;
00219             double radius;
00220             if (!ParseDoubleFromTextBox(Longitude, "Longitude", -180, 180, out position.Longitude) ||
00221                 !ParseDoubleFromTextBox(Latitude, "Latitude", -90, 90, out position.Latitude) ||
00222                 !ParseDoubleFromTextBox(Radius, "Radius", .1, 10018754.3, out radius))
00223             {
00224                 return null;
00225             }
00226
00227             position.Altitude = 0.0;
00228
00229             // the geofence is a circular region
00230             Geocircle geocircle = new Geocircle(position, radius);
00231
00232             bool singleUse = SingleUse.IsChecked.Value;
00233
00234             // want to listen for enter geofence, exit geofence and remove geofence events
00235             // you can select a subset of these event states
00236             MonitoredGeofenceStates mask = MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited | MonitoredGeofenceStates.Removed;
00237
00238             // Dwell time is how long you need to be in geofence to have been considered to have Entered it.
00239             TimeSpan dwellTime;
00240             if (!ParseTimeSpan(DwellTime.Text, defaultDwellTime, out dwellTime))
00241             {
00242                 _rootPage.NotifyUser("Invalid Dwell Time.", NotifyType.ErrorMessage);
00243                 return null;
00244             }
00245
00246             // The Duration is the length of time the geofence is active.
00247             // Zero means "infinite duration".
00248             TimeSpan duration;
00249             if (!ParseTimeSpan(Duration.Text, TimeSpan.Zero, out duration))
00250             {
00251                 _rootPage.NotifyUser("Invalid Duration.", NotifyType.ErrorMessage);
00252                 return null;
00253             }
00254
00255             // setting up the start time of the geofence
00256             DateTimeOffset startTime;
00257             if (StartImmediately.IsChecked.Value)
00258             {
00259                 // The special "start immediately" value can be used if the duration is zero.
00260                 // Otherwise, we get the current time as the start time.
00261                 startTime = (duration == TimeSpan.Zero) ? startImmediately : DateTimeOffset.Now;
00262             }
00263             else
00264             {
00265                 startTime = StartDate.Date + StartTime.Time;
00266             }
00267
00268             // Let the platform detect other invalid parameter combinations.
00269             try
00270             {
00271                 return new Geofence(fenceKey, geocircle, mask, singleUse, dwellTime, startTime, duration);
00272             }
00273             catch (Exception ex)
00274             {
00275                 _rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00276                 return null;
00277             }
00278         }
00279
00280         void OnRegisteredGeofenceListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
00281         {
00282             if (0 == e.AddedItems.Count)
00283             {
00284                 // disable the remove button
00285                 RemoveGeofenceItem.IsEnabled = false;
00286             }
00287             else
00288             {
00289                 // enable the remove button
00290                 RemoveGeofenceItem.IsEnabled = true;
00291
00292                 // update controls with the values from the newly-selected geofence
00293                 Geofence geofence = (Geofence)(RegisteredGeofenceListBox.SelectedItem as ListBoxItem).Tag;
00294                 RefreshControlsFromGeofence(geofence);
00295             }
00296         }
00297
00298         private void RefreshControlsFromGeofence(Geofence geofence)
00299         {
00300             Id.Text = geofence.Id;
00301
00302             Geocircle circle = (Geocircle)geofence.Geoshape;
00303
00304             Latitude.Text = circle.Center.Latitude.ToString();
00305             Longitude.Text = circle.Center.Longitude.ToString();
00306             Radius.Text = circle.Radius.ToString();
00307             SingleUse.IsChecked = geofence.SingleUse;
00308
00309             if (geofence.DwellTime != TimeSpan.Zero)
00310             {
00311                 DwellTime.Text = geofence.DwellTime.ToString(timeSpanFormat);
00312             }
00313             else
00314             {
00315                 DwellTime.Text = "";
00316             }
00317
00318             if (geofence.Duration != TimeSpan.Zero)
00319             {
00320                 Duration.Text = geofence.Duration.ToString(timeSpanFormat);
00321             }
00322             else
00323             {
00324                 Duration.Text = "";
00325             }
00326
00327             if (geofence.StartTime == startImmediately)
00328             {
00329                 StartImmediately.IsChecked = true;
00330             }
00331             else
00332             {
00333                 StartAtSpecificTime.IsChecked = true;
00334                 StartDate.Date = geofence.StartTime.Date;
00335                 StartTime.Time = geofence.StartTime.TimeOfDay;
00336             }
00337         }
00338
00339         private bool ParseDoubleFromTextBox(TextBox e, string name, double minValue, double maxValue, out double value)
00340         {
00341             if (!Double.TryParse(e.Text, out value) || (value < minValue) || (value > maxValue))
00342             {
00343                 _rootPage.NotifyUser($"{name} must be between {minValue} and {maxValue}", NotifyType.StatusMessage);
00344                 return false;
00345             }
00346             return true;
00347         }
00348
00349         // add geofence to listbox
00350         private void AddGeofenceToRegisteredGeofenceListBox(Geofence geofence)
00351         {
00352             Geocircle circle = (Geocircle)geofence.Geoshape;
00353
00354             string text = $"{geofence.Id} ({circle.Center.Latitude:0.###}, {circle.Center.Longitude:0.###}, {circle.Radius:0.#})";
00355             RegisteredGeofenceListBox.Items.Insert(0, new ListBoxItem { Content = text, Tag = geofence });
00356         }
00357
00358         /// <summary>
00359         /// This is the click handler for the 'Set Lat/Long to current position' button.
00360         /// </summary>
00361         /// <param name="sender"></param>
00362         /// <param name="e"></param>
00363         async private void OnSetPositionToHere(object sender, RoutedEventArgs e)
00364         {
00365             SetPositionProgressBar.Visibility = Visibility.Visible;
00366             SetPositionToHereButton.IsEnabled = false;
00367             Latitude.IsEnabled = false;
00368             Longitude.IsEnabled = false;
00369
00370             try
00371             {
00372                 // Get cancellation token
00373                 _cts = new CancellationTokenSource();
00374                 CancellationToken token = _cts.Token;
00375
00376                 // Carry out the operation
00377                 // geolocator and location permissions are initialized and checked on page creation.
00378                 var geolocator = new Geolocator();
00379
00380                 // Request a high accuracy position for better accuracy locating the geofence
00381                 geolocator.DesiredAccuracy = PositionAccuracy.High;
00382
00383                 Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);
00384
00385                 Latitude.Text = pos.Coordinate.Point.Position.Latitude.ToString();
00386                 Longitude.Text = pos.Coordinate.Point.Position.Longitude.ToString();
00387
00388                 // clear status
00389                 _rootPage.NotifyUser("", NotifyType.StatusMessage);
00390             }
00391             catch (TaskCanceledException)
00392             {
00393                 _rootPage.NotifyUser("Task canceled", NotifyType.StatusMessage);
00394             }
00395             catch (Exception ex)
00396             {
00397                 _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00398             }
00399             finally
00400             {
00401                 _cts = null;
00402             }
00403
00404             SetPositionProgressBar.Visibility = Visibility.Collapsed;
00405             SetPositionToHereButton.IsEnabled = true;
00406             Latitude.IsEnabled = true;
00407             Longitude.IsEnabled = true;
00408         }
00409
00410         /// <summary>
00411         /// This is the click handler for the 'Create Geofence' button.
00412         /// </summary>
00413         /// <param name="sender"></param>
00414         /// <param name="e"></param>
00415         private void OnCreateGeofence(object sender, RoutedEventArgs e)
00416         {
00417             Geofence geofence = GenerateGeofence();
00418             if (geofence != null)
00419             {
00420                 try
00421                 {
00422                     // add geofence to GeofenceMonitor
00423                     geofenceMonitor.Geofences.Add(geofence);
00424                 }
00425                 catch (Exception ex)
00426                 {
00427                     // GeofenceMonitor failed to add the geofence. Possible reasons include
00428                     // duplicate or invalid name, invalid position, having a limited-duration
00429                     // geofence that doesn't leave enough time for the DwellTime to trigger the geofence.
00430                     _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00431                     geofence = null;
00432                 }
00433             }
00434
00435             if (geofence != null)
00436             {
00437                 // Update UI after geofence successfully added to GeofenceMonitor.
00438                 AddGeofenceToRegisteredGeofenceListBox(geofence);
00439             }
00440         }
00441
00442         private void AddEventDescription(string eventDescription)
00443         {
00444             GeofenceEventsListBox.Items.Insert(0, new ListBoxItem { Content = eventDescription });
00445         }
00446
00447         private bool ParseTimeSpan(string field, TimeSpan defaultValue, out TimeSpan value)
00448         {
00449             value = TimeSpan.Zero;
00450             if (!string.IsNullOrEmpty(field))
00451             {
00452                 uint[] fields = new uint[4];
00453                 string[] rawFields = field.Split(new[] { ':' });
00454                 int count;
00455
00456                 for (count = 0; count < rawFields.Length; count++)
00457                 {
00458                     if (!uint.TryParse(rawFields[count], out fields[count]))
00459                     {
00460                         // Not parseable.
00461                         return false;
00462                     }
00463                 }
00464
00465                 Array.Reverse(fields, 0, count);
00466
00467                 value = TimeSpan.FromDays(fields[3]) +
00468                     TimeSpan.FromHours(fields[2]) +
00469                     TimeSpan.FromMinutes(fields[1]) +
00470                     TimeSpan.FromSeconds(fields[0]);
00471             }
00472
00473             if (value == TimeSpan.Zero)
00474             {
00475                 value = defaultValue;
00476             }
00477
00478             return true;
00479         }
00480     }
00481 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RadioModel Member List

This is the complete list of members for RadioModel, including all inherited members.
dispatcher | RadioModel | [private]
isEnabled | RadioModel | [private]
IsEnabled() | RadioModel | [inline]
IsRadioOn() | RadioModel | [inline]
IsRadioOn(bool value) | RadioModel | [inline]
Name() | RadioModel | [inline]
NotifyPropertyChanged(hstring const &propertyName) | RadioModel | [private]
PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler) | RadioModel | [inline]
PropertyChanged(winrt::event_token const &token) | RadioModel | [inline]
propertyChanged | RadioModel | [private]
radio | RadioModel | [private]
Radio_StateChanged(Windows::Devices::Radios::Radio const &, Windows::Foundation::IInspectable const &) | RadioModel | [private]
RadioModel(Windows::Devices::Radios::Radio const &radio, Windows::UI::Core::CoreDispatcher const &dispatcher) | RadioModel |
SetEnabled(bool value) | RadioModel | [private]
SetRadioState(bool value) | RadioModel | [private]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceConsumer.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceConsumer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 public interface class ISecureInterfaceConsumer
00026 {
00027     event Windows::Foundation::TypedEventHandler<SecureInterfaceConsumer^, Platform::Object^>^ IsUpperCaseEnabledChanged;
00028 };
00029
00030 public ref class SecureInterfaceConsumer sealed  : [Windows::Foundation::Metadata::Default] ISecureInterfaceConsumer, ISignalEmitter
00031 {
00032 public:
00033     SecureInterfaceConsumer(Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00034     virtual ~SecureInterfaceConsumer();
00035
00036     // Create a consumer from a device Id asynchronously.
00037     //
00038     // This is usually called to create a consumer after the unique name of a producer has been reported
00039     // in the Added callback on the DeviceWatcher.
00040     static Windows::Foundation::IAsyncOperation<SecureInterfaceConsumer^>^ FromIdAsync(_In_ Platform::String^ deviceId);
00041
00042     // Create a consumer from a device Id asynchronously with the provided bus attachment.
00043     //
00044     // This is usually called to create a consumer after the unique name of a producer has been reported
00045     // in the Added callback on the DeviceWatcher.
00046     static Windows::Foundation::IAsyncOperation<SecureInterfaceConsumer^>^ FromIdAsync(_In_ Platform::String^ deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00047
00048     int32 SecureInterfaceConsumer::Initialize(_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^ serviceInfo);
00049
00050     // "Concatenate two input strings and returns the concatenated string as output"
00051     // Call the Concatenate method
00052     Windows::Foundation::IAsyncOperation<SecureInterfaceConcatenateResult^>^ ConcatenateAsync(_In_ Platform::String^ interfaceMemberInStr1, _In_ Platform::String^ interfaceMemberInStr2);
00053
00054     // This event fires whenever the value of IsUpperCaseEnabled changes.
00055     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceConsumer^, Platform::Object^>^ IsUpperCaseEnabledChanged
00056     {
00057         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceConsumer^, Platform::Object^>^ handler)
00058         {
00059             return _IsUpperCaseEnabledChanged += ref new Windows::Foundation::EventHandler<Platform::Object^>
00060             ([handler](Platform::Object^ sender, Platform::Object^ args)
00061             {
00062                 handler->Invoke(safe_cast<SecureInterfaceConsumer^>(sender), safe_cast<Platform::Object^>(args));
00063             }, Platform::CallbackContext::Same);
00064         }
00065         void remove(Windows::Foundation::EventRegistrationToken token)
00066         {
00067             _IsUpperCaseEnabledChanged -= token;
00068         }
00069     internal:
00070         void raise(SecureInterfaceConsumer^ sender, Platform::Object^ args)
00071         {
00072             _IsUpperCaseEnabledChanged(sender, args);
00073         }
00074     }
00075
00076     // "Determine if the output of the Concatenate method is returned as upper case string or not"
00077     // Get the value of the IsUpperCaseEnabled property.
00078     Windows::Foundation::IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult^>^ GetIsUpperCaseEnabledAsync();
00079
00080     // "Determine if the output of the Concatenate method is returned as upper case string or not"
00081     // Set the value of the IsUpperCaseEnabled property.
00082     Windows::Foundation::IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult^>^ SetIsUpperCaseEnabledAsync(_In_ bool value);
00083
00084     // Used to send signals or register functions to handle received signals.
00085     property SecureInterfaceSignals^ Signals
00086     {
00087         SecureInterfaceSignals^ get() { return m_signals; }
00088     }
00089
00090     // Used to get the name of the interface this consumer implements.
00091     static property Platform::String^ InterfaceName
00092     {
00093         Platform::String^ get() { return AllJoynHelpers::MultibyteToPlatformString(m_interfaceName); }
00094     }
00095
00096     virtual property Windows::Devices::AllJoyn::AllJoynBusObject^ BusObject
00097     {
00098         Windows::Devices::AllJoyn::AllJoynBusObject^ get() { return m_busObject; }
00099     }
00100
00101     virtual property Windows::Devices::AllJoyn::AllJoynSession^ Session
00102     {
00103         Windows::Devices::AllJoyn::AllJoynSession^ get() { return m_session; }
00104     }
00105
00106 internal:
00107     // Consumers do not support property get.
00108     QStatus OnPropertyGet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val)
00109     {
00110         UNREFERENCED_PARAMETER(interfaceName); UNREFERENCED_PARAMETER(propertyName); UNREFERENCED_PARAMETER(val);
00111         return ER_NOT_IMPLEMENTED;
00112     }
00113
00114     // Consumers do not support property set.
00115     QStatus OnPropertySet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val)
00116     {
00117         UNREFERENCED_PARAMETER(interfaceName); UNREFERENCED_PARAMETER(propertyName); UNREFERENCED_PARAMETER(val);
00118         return ER_NOT_IMPLEMENTED;
00119     }
00120
00121     void OnPropertyChanged(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated);
00122
00123     property Platform::String^ ServiceObjectPath
00124     {
00125         Platform::String^ get() { return m_ServiceObjectPath; }
00126         void set(Platform::String^ value) { m_ServiceObjectPath = value; }
00127     }
00128
00129     property alljoyn_proxybusobject ProxyBusObject
00130     {
00131         alljoyn_proxybusobject get() { return m_proxyBusObject; }
00132         void set(alljoyn_proxybusobject value) { m_proxyBusObject = value; }
00133     }
00134
00135 private:
00136     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionLost;
00137     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberAdded;
00138     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberRemoved;
00139     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _IsUpperCaseEnabledChanged;
00140
00141     // Register a callback function to handle incoming signals.
00142     QStatus AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler);
00143
00144     // "This signal is emitted when producer sends a text message to consumer"
00145     static void CallTextSentSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message);
00146
00147     Windows::Devices::AllJoyn::AllJoynBusAttachment^ m_busAttachment;
00148     Windows::Devices::AllJoyn::AllJoynBusObject^ m_busObject;
00149     Windows::Devices::AllJoyn::AllJoynSession^ m_session;
00150     SecureInterfaceSignals^ m_signals;
00151     Platform::String^ m_ServiceObjectPath;
00152
00153     alljoyn_proxybusobject m_proxyBusObject;
00154     alljoyn_sessionlistener m_sessionListener;
00155     alljoyn_busobject m_nativeBusObject;
00156     alljoyn_busattachment m_nativeBusAttachment;
00157
00158     // Used to pass a pointer to this class to callbacks
00159     Platform::WeakReference* m_weak;
00160
00161     // This map is required because we need a way to pass the consumer to the signal
00162     // handlers, but the current AllJoyn C API does not allow passing a context to these
00163     // callbacks.
00164     static std::map<alljoyn_interfacedescription, Platform::WeakReference*> SourceInterfaces;
00165
00166     // The name of the interface this consumer implements.
00167     static PCSTR m_interfaceName;
00168 };
00169
00170 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/CachedFileUpdaterPage.xaml.cs Source File

  • FilePickerContracts
  • cs

CachedFileUpdaterPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using Windows.ApplicationModel.Activation;
00014 using Windows.ApplicationModel.Core;
00015 using Windows.Storage.Provider;
00016 using Windows.UI.Core;
00017 using Windows.UI.ViewManagement;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Markup;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class CachedFileUpdaterPage : Page
00029     {
00030         public const string FEATURE_NAME = "Cached File Updater Page";
00031         public event System.EventHandler ScenarioLoaded;
00032         public event EventHandler<CachedFileUpdaterPageSizeChangedEventArgs> CachedFileUpdaterPageResized;
00033
00034         public Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs;
00035
00036         public static CachedFileUpdaterPage Current;
00037
00038         internal CachedFileUpdaterUI cachedFileUpdaterUI = null;
00039         internal FileUpdateRequest fileUpdateRequest = null;
00040         internal FileUpdateRequestDeferral fileUpdateRequestDeferral = null;
00041
00042         private CoreDispatcher dispatcher = Window.Current.Dispatcher;
00043
00044         private Frame HiddenFrame = null;
00045
00046         List<Scenario> scenarios = null;
00047
00048         public void Activate(CachedFileUpdaterActivatedEventArgs args)
00049         {
00050             // cache CachedFileUpdaterUI
00051             cachedFileUpdaterUI = args.CachedFileUpdaterUI;
00052
00053             // Currently, the Desktop device family activates the app in the background. Other device families
00054             // use a background task activation. We need to handle both cases.
00055             //
00056             // We can check to see if there is UI on activation to determine which case we are in, because
00057             // we receive the FileUpdateRequest differently.
00058             //
00059             // If activated in the foreground (visible), then the FileUpdateRequest is passed explicitly as
00060             // part of the activation.
00061             //
00062             // If activated in the background (not visible), then we subscribe to the FileUpdateRequested
00063             // and UIRequest events. The FileUpdateRequest is received as part of the FileUpdatedRequested event,
00064             // and UIRequested is raised when user input is needed to resolve a conflict.
00065
00066             bool isForegroundActivated = (cachedFileUpdaterUI.UIStatus == UIStatus.Visible);
00067             if (isForegroundActivated)
00068             {
00069                 fileUpdateRequest = cachedFileUpdaterUI.UpdateRequest;
00070                 fileUpdateRequestDeferral = cachedFileUpdaterUI.GetDeferral();
00071             }
00072             else
00073             {
00074                 cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
00075                 cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;
00076             }
00077
00078             switch (cachedFileUpdaterUI.UpdateTarget)
00079             {
00080                 case CachedFileTarget.Local:
00081                     scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
00082                     break;
00083                 case CachedFileTarget.Remote:
00084                     scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
00085                     break;
00086             }
00087
00088             if (isForegroundActivated)
00089             {
00090                 Window.Current.Content = this;
00091                 this.OnNavigatedTo(null);
00092                 Window.Current.Activate();
00093             }
00094         }
00095
00096         async void CachedFileUpdaterUI_UIRequested(CachedFileUpdaterUI sender, object args)
00097         {
00098             // The event handler may be invoked on a background thread, so use the Dispatcher to run the UI-related code on the UI thread.
00099             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00100             {
00101                 Window.Current.Content = this;
00102                 this.OnNavigatedTo(null);
00103             });
00104         }
00105
00106         void CachedFileUpdaterUI_FileUpdateRequested(CachedFileUpdaterUI sender, FileUpdateRequestedEventArgs args)
00107         {
00108             fileUpdateRequest = args.Request;
00109             fileUpdateRequestDeferral = fileUpdateRequest.GetDeferral();
00110             switch (cachedFileUpdaterUI.UIStatus)
00111             {
00112                 case UIStatus.Hidden:
00113                     if (fileUpdateRequest.File.Name.Contains("ConflictingFile"))
00114                     {
00115                         fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
00116                     }
00117                     else
00118                     {
00119                         fileUpdateRequest.Status = FileUpdateStatus.Complete;
00120                     }
00121                     fileUpdateRequestDeferral.Complete();
00122                     break;
00123                 case UIStatus.Visible:
00124                     break;
00125                 case UIStatus.Unavailable:
00126                     fileUpdateRequest.Status = FileUpdateStatus.Failed;
00127                     fileUpdateRequestDeferral.Complete();
00128                     break;
00129             }
00130         }
00131
00132         public CachedFileUpdaterPage()
00133         {
00134             this.InitializeComponent();
00135
00136             // This is a static public property that will allow downstream pages to get
00137             // a handle to the CachedFileUpdaterPage instance in order to call methods that are in this class.
00138             Current = this;
00139
00140             // This frame is hidden, meaning it is never shown.  It is simply used to load
00141             // each scenario page and then pluck out the input and output sections and
00142             // place them into the UserControls on the main page.
00143             HiddenFrame = new Windows.UI.Xaml.Controls.Frame();
00144             HiddenFrame.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00145             LayoutRoot.Children.Add(HiddenFrame);
00146
00147             // Populate the sample title from the constant in the GlobalVariables.cs file.
00148             SetFeatureName(FEATURE_NAME);
00149
00150             Scenarios.SelectionChanged += Scenarios_SelectionChanged;
00151             SizeChanged += CachedFileUpdaterPage_SizeChanged;
00152         }
00153
00154         void CachedFileUpdaterPage_SizeChanged(object sender, SizeChangedEventArgs e)
00155         {
00156             InvalidateSize();
00157             if (CachedFileUpdaterPageResized != null)
00158             {
00159                 CachedFileUpdaterPageSizeChangedEventArgs args = new CachedFileUpdaterPageSizeChangedEventArgs();
00160                 args.Width = this.ActualWidth;
00161                 CachedFileUpdaterPageResized(this, args);
00162             }
00163         }
00164
00165         /// <summary>
00166         /// Invoked when this page is about to be displayed in a Frame.
00167         /// </summary>
00168         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00169         /// property is typically used to configure the page.</param>
00170         protected override void OnNavigatedTo(NavigationEventArgs e)
00171         {
00172             PopulateScenarios();
00173             InvalidateLayout();
00174         }
00175
00176         private void InvalidateSize()
00177         {
00178             // Get the window width
00179             double windowWidth = this.ActualWidth;
00180
00181             if (windowWidth != 0.0)
00182             {
00183                 // Get the width of the ListBox.
00184                 double listBoxWidth = Scenarios.ActualWidth;
00185
00186                 // Is the ListBox using any margins that we need to consider?
00187                 double listBoxMarginLeft = Scenarios.Margin.Left;
00188                 double listBoxMarginRight = Scenarios.Margin.Right;
00189
00190                 // Figure out how much room is left after considering the list box width
00191                 double availableWidth = windowWidth - listBoxWidth;
00192
00193                 // Is the top most child using margins?
00194                 double layoutRootMarginLeft = ContentRoot.Margin.Left;
00195                 double layoutRootMarginRight = ContentRoot.Margin.Right;
00196
00197                 // We have different widths to use depending on the view state
00198                 if (this.ActualWidth >= 768)
00199                 {
00200                     // Make us as big as the the left over space, factoring in the ListBox width, the ListBox margins.
00201                     // and the LayoutRoot's margins
00202                     InputSection.Width = ((availableWidth) - (layoutRootMarginLeft + layoutRootMarginRight + listBoxMarginLeft + listBoxMarginRight));
00203                 }
00204                 else
00205                 {
00206                     // Make us as big as the left over space, factoring in just the LayoutRoot's margins.
00207                         InputSection.Width = (windowWidth - (layoutRootMarginLeft + layoutRootMarginRight));
00208
00209                 }
00210             }
00211             InvalidateLayout();
00212         }
00213
00214         private void InvalidateLayout()
00215         {
00216
00217             if (this.ActualWidth < 768)
00218             {
00219                 Grid.SetRow(DescriptionText, 3);
00220                 Grid.SetColumn(DescriptionText, 0);
00221
00222                 Grid.SetRow(InputSection, 4);
00223                 Grid.SetColumn(InputSection, 0);
00224
00225                 Grid.SetRow(FooterPanel, 2);
00226                 Grid.SetColumn(FooterPanel, 0);
00227             }
00228             else
00229             {
00230                 Grid.SetRow(DescriptionText, 1);
00231                 Grid.SetColumn(DescriptionText, 1);
00232
00233                 Grid.SetRow(InputSection, 2);
00234                 Grid.SetColumn(InputSection, 1);
00235
00236                 Grid.SetRow(FooterPanel, 1);
00237                 Grid.SetColumn(FooterPanel, 1);
00238             }
00239         }
00240
00241         private void PopulateScenarios()
00242         {
00243             System.Collections.ObjectModel.ObservableCollection<object> ScenarioList = new System.Collections.ObjectModel.ObservableCollection<object>();
00244             int i = 0;
00245
00246             // Populate the ListBox with the list of scenarios as defined in Constants.cs.
00247             foreach (Scenario s in scenarios)
00248             {
00249                 ListBoxItem item = new ListBoxItem();
00250                 s.Title = (++i).ToString() + ") " + s.Title;
00251                 item.Content = s;
00252                 item.Name = s.ClassType.FullName;
00253                 ScenarioList.Add(item);
00254             }
00255
00256             // Bind the ListBox to the scenario list.
00257             Scenarios.ItemsSource = ScenarioList;
00258             Scenarios.SelectedIndex = 0;
00259         }
00260
00261         /// <summary>
00262         /// This method is responsible for loading the individual input and output sections for each scenario.  This
00263         /// is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input
00264         /// and output sections into the respective UserControl on the main page.
00265         /// </summary>
00266         /// <param name="scenarioName"></param>
00267         public void LoadScenario(Type scenarioClass)
00268         {
00269
00270             // Load the ScenarioX.xaml file into the Frame.
00271             HiddenFrame.Navigate(scenarioClass, this);
00272
00273             // Get the top element, the Page, so we can look up the elements
00274             // that represent the input and output sections of the ScenarioX file.
00275             Page hiddenPage = HiddenFrame.Content as Page;
00276
00277             // Get each element.
00278             UIElement input = hiddenPage.FindName("Input") as UIElement;
00279             UIElement output = hiddenPage.FindName("Output") as UIElement;
00280
00281             if (input == null)
00282             {
00283                 // Malformed input section.
00284                 NotifyUser(String.Format(
00285                     "Cannot load scenario input section for {0}.  Make sure root of input section markup has x:Name of 'Input'",
00286                     scenarioClass.Name), NotifyType.ErrorMessage);
00287                 return;
00288             }
00289
00290             if (output == null)
00291             {
00292                 // Malformed output section.
00293                 NotifyUser(String.Format(
00294                     "Cannot load scenario output section for {0}.  Make sure root of output section markup has x:Name of 'Output'",
00295                     scenarioClass.Name), NotifyType.ErrorMessage);
00296                 return;
00297             }
00298
00299             // Find the LayoutRoot which parents the input and output sections in the main page.
00300             Panel panel = hiddenPage.FindName("LayoutRoot") as Panel;
00301
00302             if (panel != null)
00303             {
00304                 // Get rid of the content that is currently in the intput and output sections.
00305                 panel.Children.Remove(input);
00306                 panel.Children.Remove(output);
00307
00308                 // Populate the input and output sections with the newly loaded content.
00309                 InputSection.Content = input;
00310                 OutputSection.Content = output;
00311
00312                 if (ScenarioLoaded != null)
00313                 {
00314                     ScenarioLoaded(this, new EventArgs());
00315                 }
00316             }
00317             else
00318             {
00319                 // Malformed Scenario file.
00320                 NotifyUser(String.Format(
00321                     "Cannot load scenario: '{0}'.  Make sure root tag in the '{0}' file has an x:Name of 'LayoutRoot'",
00322                     scenarioClass.Name), NotifyType.ErrorMessage);
00323             }
00324
00325         }
00326
00327         void Scenarios_SelectionChanged(object sender, SelectionChangedEventArgs e)
00328         {
00329             if (Scenarios.SelectedItem != null)
00330             {
00331                 NotifyUser("", NotifyType.StatusMessage);
00332
00333                 ListBoxItem selectedListBoxItem = Scenarios.SelectedItem as ListBoxItem;
00334                 Scenario scenario = selectedListBoxItem.Content as Scenario;
00335                 LoadScenario(scenario.ClassType);
00336                 InvalidateSize();
00337             }
00338         }
00339
00340         public void NotifyUser(string strMessage, NotifyType type)
00341         {
00342             switch (type)
00343             {
00344                 // Use the status message style.
00345                 case NotifyType.StatusMessage:
00346                     StatusBlock.Style = Resources["StatusStyle"] as Style;
00347                     break;
00348                 // Use the error message style.
00349                 case NotifyType.ErrorMessage:
00350                     StatusBlock.Style = Resources["ErrorStyle"] as Style;
00351                     break;
00352             }
00353             StatusBlock.Text = strMessage;
00354
00355             // Collapse the StatusBlock if it has no text to conserve real estate.
00356             if (StatusBlock.Text != String.Empty)
00357             {
00358                 StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
00359             }
00360             else
00361             {
00362                 StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00363             }
00364         }
00365
00366         async void Footer_Click(object sender, RoutedEventArgs e)
00367         {
00368             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00369         }
00370
00371         private void SetFeatureName(string str)
00372         {
00373             FeatureName.Text = str;
00374         }
00375     }
00376
00377     public class CachedFileUpdaterPageSizeChangedEventArgs : EventArgs
00378     {
00379         private double width;
00380
00381         public double Width
00382         {
00383             get { return width; }
00384             set { width = value; }
00385         }
00386     }
00387 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario1_LanguageDetection.cpp Source File

  • LinguisticServices
  • cppwinrt

Scenario1_LanguageDetection.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_LanguageDetection.h"
00014 #include "Scenario1_LanguageDetection.g.cpp"
00015 #include "elsutil.h"
00016 #include <sstream>
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_LanguageDetection::Scenario1_LanguageDetection()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario1_LanguageDetection::Go_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto input = TextInput().Text();
00032
00033         std::wostringstream output;
00034         ELS::RecognizeTextLanguages(input.c_str(), input.size(), [&](auto lang)
00035             {
00036                 output << lang << L"\n";
00037             });
00038
00039         TextOutput().Text(output.str());
00040     }
00041 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cs/Scenario1_BankCards.xaml.cs Source File

  • MagneticStripeReader
  • cs

Scenario1_BankCards.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using System.Threading.Tasks;
00018 using Windows.Devices.PointOfService;
00019
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace MagneticStripeReaderSample
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario1_BankCards : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         MagneticStripeReader _reader = null;
00035         ClaimedMagneticStripeReader _claimedReader = null;
00036
00037         public Scenario1_BankCards()
00038         {
00039             this.InitializeComponent();
00040         }
00041
00042         /// <summary>
00043         /// Creates the default magnetic stripe reader.
00044         /// </summary>
00045         /// <returns>true if magnetic stripe reader is created. Otherwise returns false</returns>
00046         private async Task<bool> CreateDefaultMagneticStripeReaderObject()
00047         {
00048             if (_reader == null)
00049             {
00050                 _reader = await DeviceHelpers.GetFirstMagneticStripeReaderAsync();
00051
00052                 if (_reader == null)
00053                 {
00054                     rootPage.NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType.ErrorMessage);
00055                     return false;
00056                 }
00057             }
00058             return true;
00059         }
00060
00061         /// <summary>
00062         /// Claim the magnetic stripe reader
00063         /// </summary>
00064         /// <returns>true if claim is successful. Otherwise returns false</returns>
00065         private async Task<bool> ClaimReader()
00066         {
00067             if (_claimedReader == null)
00068             {
00069                 // claim the magnetic stripe reader
00070                 _claimedReader = await _reader.ClaimReaderAsync();
00071
00072                 if (_claimedReader == null)
00073                 {
00074                     rootPage.NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType.ErrorMessage);
00075                     return false;
00076                 }
00077             }
00078             return true;
00079         }
00080
00081         private async void ScenarioStartReadButton_Click(object sender, RoutedEventArgs e)
00082         {
00083             if (await CreateDefaultMagneticStripeReaderObject())
00084             {
00085                 if (_reader != null)
00086                 {
00087                     // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
00088                     if (await ClaimReader())
00089                     {
00090                         if (_claimedReader != null)
00091                         {
00092                             // It is always a good idea to have a release device requested event handler. If this event is not handled, there is a chance that another app can
00093                             // claim ownsership of the magnetic stripe reader.
00094                             _claimedReader.ReleaseDeviceRequested += OnReleaseDeviceRequested;
00095
00096                             // after successfully claiming and enabling, attach the BankCardDataReceived event handler.
00097                             // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be of any use because the API will not fire the event
00098                             // if the claimedScanner has not beed Enabled
00099                             _claimedReader.BankCardDataReceived += OnBankCardDataReceived;
00100
00101                             // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
00102                             _claimedReader.IsDecodeDataEnabled = true;
00103
00104                             await _claimedReader.EnableAsync();
00105
00106                             rootPage.NotifyUser("Ready to swipe. Device ID: " + _claimedReader.DeviceId, NotifyType.StatusMessage);
00107
00108                             // reset the button state
00109                             ScenarioEndReadButton.IsEnabled = true;
00110                             ScenarioStartReadButton.IsEnabled = false;
00111                         }
00112                     }
00113                 }
00114             }
00115         }
00116
00117         /// <summary>
00118         /// Event handler for End button
00119         /// </summary>
00120         /// <param name="sender"></param>
00121         /// <param name="e"></param>
00122         void ScenarioEndReadButton_Click(object sender, RoutedEventArgs e)
00123         {
00124             ResetTheScenarioState();
00125         }
00126
00127         /// <summary>
00128         /// Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application
00129         /// </summary>
00130         /// <param name="sender"></param>
00131         /// <param name="args"> Contains the ClaimedMagneticStripeReader that is sending this request</param>
00132         void OnReleaseDeviceRequested(object sender, ClaimedMagneticStripeReader args)
00133         {
00134             // let us retain the device always. If it is not retained, this exclusive claim will be lost.
00135             args.RetainDevice();
00136         }
00137
00138         /// <summary>
00139         /// Event handler for the DataReceived event fired when a bank card is read by the magnetic stripe reader
00140         /// </summary>
00141         /// <param name="sender"></param>
00142         /// <param name="args"> Contains the MagneticStripeReaderBankCardDataReceivedEventArgs which contains the data obtained in the scan</param>
00143         async void OnBankCardDataReceived(object sender, MagneticStripeReaderBankCardDataReceivedEventArgs args)
00144         {
00145             // read the data and display
00146             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00147             {
00148                 rootPage.NotifyUser("Got data.", NotifyType.StatusMessage);
00149
00150                 ScenarioOutputAccountNumber.Text = args.AccountNumber;
00151                 ScenarioOutputExpirationDate.Text = args.ExpirationDate;
00152                 ScenarioOutputFirstName.Text = args.FirstName;
00153                 ScenarioOutputMiddleInitial.Text = args.MiddleInitial;
00154                 ScenarioOutputServiceCode.Text = args.ServiceCode;
00155                 ScenarioOutputSuffix.Text = args.Suffix;
00156                 ScenarioOutputSurname.Text = args.Surname;
00157                 ScenarioOutputTitle.Text = args.Title;
00158             });
00159
00160         }
00161
00162         /// <summary>
00163         /// Invoked when this page is about to be displayed in a Frame.
00164         /// </summary>
00165         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00166         /// property is typically used to configure the page.</param>
00167         protected override void OnNavigatedTo(NavigationEventArgs e)
00168         {
00169             ResetTheScenarioState();
00170             base.OnNavigatedTo(e);
00171         }
00172
00173         /// <summary>
00174         /// Invoked when this page is no longer displayed.
00175         /// </summary>
00176         /// <param name="e"></param>
00177         protected override void OnNavigatedFrom(NavigationEventArgs e)
00178         {
00179             ResetTheScenarioState();
00180             base.OnNavigatedFrom(e);
00181         }
00182
00183         /// <summary>
00184         /// Reset the Scenario state
00185         /// </summary>
00186         void ResetTheScenarioState()
00187         {
00188             if (_claimedReader != null)
00189             {
00190                 // Detach the datareceived event handler and releasedevicerequested event handler
00191                 _claimedReader.BankCardDataReceived -= OnBankCardDataReceived;
00192                 _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;
00193
00194                 // release the Claimed Magnetic Stripe Reader and set to null
00195                 _claimedReader.Dispose();
00196                 _claimedReader = null;
00197             }
00198
00199             if (_reader != null)
00200             {
00201                 // release the Magnetic Stripe Reader and set to null
00202                 _reader.Dispose();
00203                 _reader = null;
00204             }
00205
00206             // Reset the strings in the UI
00207             rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);
00208
00209             ScenarioOutputAccountNumber.Text = "No data";
00210             ScenarioOutputExpirationDate.Text = "No data";
00211             ScenarioOutputFirstName.Text = "No data";
00212             ScenarioOutputMiddleInitial.Text = "No data";
00213             ScenarioOutputServiceCode.Text = "No data";
00214             ScenarioOutputSuffix.Text = "No data";
00215             ScenarioOutputSurname.Text = "No data";
00216             ScenarioOutputTitle.Text = "No data";
00217
00218             // reset the button state
00219             ScenarioEndReadButton.IsEnabled = false;
00220             ScenarioStartReadButton.IsEnabled = true;
00221         }
00222     }
00223 }
Generated on Fri Nov 15 2024 22:20:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MeshObject.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

MeshObject.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // MeshObject:
00015 // This class is the generic (abstract) representation of D3D11 Indexed triangle
00016 // list. Each of the derived classes is just the constructor for the specific
00017 // geometry primitive. This abstract class does not place any requirements on
00018 // the format of the geometry directly.
00019 // The primary method of the MeshObject is Render. The default implementation
00020 // just sets the IndexBuffer, VertexBuffer and topology to a TriangleList and
00021 // makes a  DrawIndexed call on the context. It assumes all other state has
00022 // already been set on the context.
00023
00024 class MeshObject
00025 {
00026 public:
00027     MeshObject();
00028
00029     virtual void Render(_In_ ID3D11DeviceContext* context);
00030
00031 protected:
00032     int                           m_vertexCount;
00033     int                           m_indexCount;
00034     winrt::com_ptr<ID3D11Buffer>  m_vertexBuffer;
00035     winrt::com_ptr<ID3D11Buffer>  m_indexBuffer;
00036 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cs/Scenario1_GetFeed.xaml.cs Source File

  • Syndication
  • cs

Scenario1_GetFeed.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Web.Syndication;
00018 using Windows.Web;
00019 using System.Globalization;
00020
00021 namespace Syndication
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class S1_GetAFeed : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031         SyndicationFeed currentFeed = null;
00032         int currentItemIndex;
00033
00034         public S1_GetAFeed()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046         }
00047
00048         private async void GetFeed_Click(object sender, RoutedEventArgs e)
00049         {
00050             OutputField.Text = "";
00051
00052             // By default 'FeedUri' is disabled and URI validation is not required. When enabling the text box
00053             // validating the URI is required since it was received from an untrusted source (user input).
00054             // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
00055             // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
00056             // the "Home or Work Networking" capability.
00057             Uri uri;
00058             if (!Uri.TryCreate(FeedUri.Text.Trim(), UriKind.Absolute, out uri))
00059             {
00060                 rootPage.NotifyUser("Error: Invalid URI.", NotifyType.ErrorMessage);
00061                 return;
00062             }
00063
00064             SyndicationClient client = new SyndicationClient();
00065             client.BypassCacheOnRetrieve = true;
00066
00067             // Although most HTTP servers do not require User-Agent header, others will reject the request or return
00068             // a different response if this header is missing. Use SetRequestHeader() to add custom headers.
00069             client.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)");
00070
00071             rootPage.NotifyUser("Downloading feed...", NotifyType.StatusMessage);
00072             OutputField.Text = "Downloading feed: " + uri.ToString() + "\r\n";
00073
00074             try
00075             {
00076                 currentFeed = await client.RetrieveFeedAsync(uri);
00077                 rootPage.NotifyUser("Feed download complete.", NotifyType.StatusMessage);
00078
00079                 DisplayFeed();
00080             }
00081             catch (Exception ex)
00082             {
00083                 SyndicationErrorStatus status = SyndicationError.GetStatus(ex.HResult);
00084                 if (status == SyndicationErrorStatus.InvalidXml)
00085                 {
00086                     OutputField.Text += "An invalid XML exception was thrown. " +
00087                         "Please make sure to use a URI that points to a RSS or Atom feed.";
00088                 }
00089
00090                 if (status == SyndicationErrorStatus.Unknown)
00091                 {
00092                     WebErrorStatus webError = WebError.GetStatus(ex.HResult);
00093
00094                     if (webError == WebErrorStatus.Unknown)
00095                     {
00096                         // Neither a syndication nor a web error. Rethrow.
00097                         throw;
00098                     }
00099                 }
00100
00101                 rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00102             }
00103         }
00104
00105         private void DisplayFeed()
00106         {
00107             ISyndicationText title = currentFeed.Title;
00108             FeedTitleField.Text = title != null ? title.Text : "(no title)";
00109
00110             currentItemIndex = 0;
00111             if (currentFeed.Items.Count > 0)
00112             {
00113                 DisplayCurrentItem();
00114             }
00115
00116             // List the items.
00117             OutputField.Text += "Items: " + currentFeed.Items.Count + "\r\n";
00118         }
00119
00120         private void PreviousItem_Click(object sender, RoutedEventArgs e)
00121         {
00122             if (currentFeed != null && currentItemIndex > 0)
00123             {
00124                 currentItemIndex--;
00125                 DisplayCurrentItem();
00126             }
00127         }
00128
00129         private void NextItem_Click(object sender, RoutedEventArgs e)
00130         {
00131             if (currentFeed != null && currentItemIndex < (currentFeed.Items.Count - 1))
00132             {
00133                 currentItemIndex++;
00134                 DisplayCurrentItem();
00135             }
00136         }
00137
00138         private void DisplayCurrentItem()
00139         {
00140             SyndicationItem item = currentFeed.Items[currentItemIndex];
00141
00142             // Display item number.
00143             IndexField.Text = String.Format(
00144                 CultureInfo.InvariantCulture,
00145                 "{0} of {1}",
00146                 currentItemIndex + 1,
00147                 currentFeed.Items.Count);
00148
00149             // Display title.
00150             ItemTitleField.Text = item.Title != null ? item.Title.Text : "(no title)";
00151
00152             // Display the main link.
00153             string link = string.Empty;
00154             if (item.Links.Count > 0)
00155             {
00156                 link = item.Links[0].Uri.AbsoluteUri;
00157             }
00158             LinkField.Content = link;
00159
00160             // Display item extensions.
00161             ExtensionsField.ItemsSource = item.ElementExtensions;
00162
00163             // Display the body as HTML.
00164             string content = "(no content)";
00165             if (item.Content != null)
00166             {
00167                 content = item.Content.Text;
00168             }
00169             else if (item.Summary != null)
00170             {
00171                 content = item.Summary.Text;
00172             }
00173             ContentWebView.NavigateToString(content);
00174         }
00175
00176         private async void LinkField_Click(object sender, RoutedEventArgs e)
00177         {
00178             await Windows.System.Launcher.LaunchUriAsync(new Uri((sender as HyperlinkButton).Content.ToString()));
00179         }
00180     }
00181 }
Generated on Fri Nov 15 2024 22:21:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/SampleConfiguration.cs Source File

  • ApplicationData
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "ApplicationData";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Files", ClassType = typeof(Scenario1_Files) },
00025             new Scenario() { Title = "Settings", ClassType = typeof(Scenario2_Settings) },
00026             new Scenario() { Title = "Setting Containers", ClassType = typeof(Scenario3_SettingContainer) },
00027             new Scenario() { Title = "Composite Settings", ClassType = typeof(Scenario4_CompositeSettings) },
00028             new Scenario() { Title = "ms-appdata:// Protocol", ClassType = typeof(Scenario5_Msappdata) },
00029             new Scenario() { Title = "Clear", ClassType = typeof(Scenario6_ClearScenario) },
00030             new Scenario() { Title = "SetVersion", ClassType = typeof(Scenario7_SetVersion) },
00031         };
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038
00039         public override string ToString()
00040         {
00041             return Title;
00042         }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.h Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

Scenario1_Configuration.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include "Scenario1_Configuration.g.h"
00014 #include "MainPage.xaml.h"
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario1_Configuration sealed
00023     {
00024     public:
00025         Scenario1_Configuration();
00026
00027     private:
00028         void LanguageList_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00029
00030     private:
00031         MainPage^ m_rootPage = MainPage::Current;
00032         Platform::Collections::Vector<Platform::String^>^ m_languages = ref new Platform::Collections::Vector<Platform::String^>();
00033     };
00034 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EdgeTappedListView Member List

This is the complete list of members for EdgeTappedListView, including all inherited members.
ClearVisual() | EdgeTappedListView | [private]
EdgeTappedListView() | EdgeTappedListView |
Element_PointerCaptureLost(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &) | EdgeTappedListView | [private]
Element_PointerExited(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &) | EdgeTappedListView | [private]
Element_PointerPressed(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &e) | EdgeTappedListView | [private]
Element_PointerReleased(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::PointerRoutedEventArgs const &) | EdgeTappedListView | [private]
HIT_TARGET | EdgeTappedListView | [private, static]
IsItemLeftEdgeTapEnabled() | EdgeTappedListView | [inline]
IsItemLeftEdgeTapEnabled(bool value) | EdgeTappedListView | [inline]
isItemLeftEdgeTapEnabled | EdgeTappedListView | [private]
ItemLeftEdgeTapped(ListViewEdgeTappedEventHandler const &handler) | EdgeTappedListView | [inline]
ItemLeftEdgeTapped(event_token const &token) noexcept | EdgeTappedListView | [inline]
itemLeftEdgeTappedEvent | EdgeTappedListView | [private]
LeftEdgeBrush() | EdgeTappedListView | [inline]
LeftEdgeBrush(Windows::UI::Xaml::Media::Brush const &value) | EdgeTappedListView | [inline]
OnContainerContentChanging(Windows::UI::Xaml::Controls::ListViewBase const &, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const &args) | EdgeTappedListView | [private]
RegisterDependencyPropertiesOnce() | EdgeTappedListView | [private, static]
s_containerEventTokensProperty | EdgeTappedListView | [private, static]
ShowVisual() | EdgeTappedListView | [private]
VISUAL_INDICATOR_NAME | EdgeTappedListView | [private, static]
VISUAL_INDICATOR_WIDTH | EdgeTappedListView | [private, static]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.idl Source File

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

BackgroundDeviceWatcher.idl

Go to the documentation of this file.
00001 namespace BackgroundDeviceWatcherTask
00002 {
00003     [default_interface]
00004     runtimeclass BackgroundDeviceWatcher : Windows.ApplicationModel.Background.IBackgroundTask
00005     {
00006         BackgroundDeviceWatcher();
00007     }
00008 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/StepTimer.h Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

StepTimer.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Helper class for animation and simulation timing.
00017     class StepTimer
00018     {
00019     public:
00020         StepTimer() :
00021             m_elapsedTicks(0),
00022             m_totalTicks(0),
00023             m_leftOverTicks(0),
00024             m_frameCount(0),
00025             m_framesPerSecond(0),
00026             m_framesThisSecond(0),
00027             m_qpcSecondCounter(0),
00028             m_isFixedTimeStep(false),
00029             m_targetElapsedTicks(TicksPerSecond / 60)
00030         {
00031             if (!QueryPerformanceFrequency(&m_qpcFrequency))
00032             {
00033                 throw ref new Platform::FailureException();
00034             }
00035
00036             if (!QueryPerformanceCounter(&m_qpcLastTime))
00037             {
00038                 throw ref new Platform::FailureException();
00039             }
00040
00041             // Initialize max delta to 1/10 of a second.
00042             m_qpcMaxDelta = m_qpcFrequency.QuadPart / 10;
00043         }
00044
00045         // Get elapsed time since the previous Update call.
00046         uint64 GetElapsedTicks() const            { return m_elapsedTicks; }
00047         double GetElapsedSeconds() const          { return TicksToSeconds(m_elapsedTicks); }
00048
00049         // Get total time since the start of the program.
00050         uint64 GetTotalTicks() const            { return m_totalTicks; }
00051         double GetTotalSeconds() const            { return TicksToSeconds(m_totalTicks); }
00052
00053         // Get total number of updates since start of the program.
00054         uint32 GetFrameCount() const            { return m_frameCount; }
00055
00056         // Get the current framerate.
00057         uint32 GetFramesPerSecond() const         { return m_framesPerSecond; }
00058
00059         // Set whether to use fixed or variable timestep mode.
00060         void SetFixedTimeStep(bool isFixedTimestep)     { m_isFixedTimeStep = isFixedTimestep; }
00061
00062         // Set how often to call Update when in fixed timestep mode.
00063         void SetTargetElapsedTicks(uint64 targetElapsed)  { m_targetElapsedTicks = targetElapsed; }
00064         void SetTargetElapsedSeconds(double targetElapsed)  { m_targetElapsedTicks = SecondsToTicks(targetElapsed); }
00065
00066         // Integer format represents time using 10,000,000 ticks per second.
00067         static const uint64 TicksPerSecond = 10000000;
00068
00069         static double TicksToSeconds(uint64 ticks)      { return static_cast<double>(ticks) / TicksPerSecond; }
00070         static uint64 SecondsToTicks(double seconds)    { return static_cast<uint64>(seconds * TicksPerSecond); }
00071
00072         // After an intentional timing discontinuity (for instance a blocking IO operation)
00073         // call this to avoid having the fixed timestep logic attempt a set of catch-up
00074         // Update calls.
00075
00076         void ResetElapsedTime()
00077         {
00078             if (!QueryPerformanceCounter(&m_qpcLastTime))
00079             {
00080                 throw ref new Platform::FailureException();
00081             }
00082
00083             m_leftOverTicks = 0;
00084             m_framesPerSecond = 0;
00085             m_framesThisSecond = 0;
00086             m_qpcSecondCounter = 0;
00087         }
00088
00089         // Update timer state, calling the specified Update function the appropriate number of times.
00090         template<typename TUpdate>
00091         void Tick(const TUpdate& update)
00092         {
00093             // Query the current time.
00094             LARGE_INTEGER currentTime;
00095
00096             if (!QueryPerformanceCounter(&currentTime))
00097             {
00098                 throw ref new Platform::FailureException();
00099             }
00100
00101             uint64 timeDelta = currentTime.QuadPart - m_qpcLastTime.QuadPart;
00102
00103             m_qpcLastTime = currentTime;
00104             m_qpcSecondCounter += timeDelta;
00105
00106             // Clamp excessively large time deltas (e.g. after paused in the debugger).
00107             if (timeDelta > m_qpcMaxDelta)
00108             {
00109                 timeDelta = m_qpcMaxDelta;
00110             }
00111
00112             // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
00113             timeDelta *= TicksPerSecond;
00114             timeDelta /= m_qpcFrequency.QuadPart;
00115
00116             uint32 lastFrameCount = m_frameCount;
00117
00118             if (m_isFixedTimeStep)
00119             {
00120                 // Fixed timestep update logic
00121
00122                 // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
00123                 // the clock to exactly match the target value. This prevents tiny and irrelevant errors
00124                 // from accumulating over time. Without this clamping, a game that requested a 60 fps
00125                 // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
00126                 // accumulate enough tiny errors that it would drop a frame. It is better to just round
00127                 // small deviations down to zero to leave things running smoothly.
00128
00129                 if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
00130                 {
00131                     timeDelta = m_targetElapsedTicks;
00132                 }
00133
00134                 m_leftOverTicks += timeDelta;
00135
00136                 while (m_leftOverTicks >= m_targetElapsedTicks)
00137                 {
00138                     m_elapsedTicks = m_targetElapsedTicks;
00139                     m_totalTicks += m_targetElapsedTicks;
00140                     m_leftOverTicks -= m_targetElapsedTicks;
00141                     m_frameCount++;
00142
00143                     update();
00144                 }
00145             }
00146             else
00147             {
00148                 // Variable timestep update logic.
00149                 m_elapsedTicks = timeDelta;
00150                 m_totalTicks += timeDelta;
00151                 m_leftOverTicks = 0;
00152                 m_frameCount++;
00153
00154                 update();
00155             }
00156
00157             // Track the current framerate.
00158             if (m_frameCount != lastFrameCount)
00159             {
00160                 m_framesThisSecond++;
00161             }
00162
00163             if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency.QuadPart))
00164             {
00165                 m_framesPerSecond = m_framesThisSecond;
00166                 m_framesThisSecond = 0;
00167                 m_qpcSecondCounter %= m_qpcFrequency.QuadPart;
00168             }
00169         }
00170
00171     private:
00172         // Source timing data uses QPC units.
00173         LARGE_INTEGER m_qpcFrequency;
00174         LARGE_INTEGER m_qpcLastTime;
00175         uint64 m_qpcMaxDelta;
00176
00177         // Derived timing data uses a canonical tick format.
00178         uint64 m_elapsedTicks;
00179         uint64 m_totalTicks;
00180         uint64 m_leftOverTicks;
00181
00182         // Members for tracking the framerate.
00183         uint32 m_frameCount;
00184         uint32 m_framesPerSecond;
00185         uint32 m_framesThisSecond;
00186         uint64 m_qpcSecondCounter;
00187
00188         // Members for configuring fixed timestep mode.
00189         bool m_isFixedTimeStep;
00190         uint64 m_targetElapsedTicks;
00191     };
00192 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Cursor.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

Cursor.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Panel.h"
00004
00005 namespace HolographicMRCSample
00006 {
00007     class Cursor
00008     {
00009     public:
00010         Cursor(const float width, const float height);
00011         void Initialize(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00012
00013         void CreateDeviceDependentResources();
00014         void ReleaseDeviceDependentResources();
00015
00016         void SetDistance(const float distance) { m_distance = distance; }
00017
00018         void Update(
00019             const DX::StepTimer& timer,
00020             HolographicFrame^ holographicFrame,
00021             SpatialCoordinateSystem^ currentCoordinateSystem,
00022             SpatialInteractionSourceState^ interactionSource);
00023         void Render();
00024
00025     private:
00026         // Repositions the sample hologram.
00027         void PositionCursor(Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose,
00028                             DirectX::XMMATRIX &modelTransform);
00029
00030         // Cached pointer to device resources.
00031         std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00032
00033         Microsoft::WRL::ComPtr<ID3D11InputLayout>           m_inputLayout;
00034         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_vertexBuffer;
00035         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_indexBuffer;
00036         Microsoft::WRL::ComPtr<ID3D11VertexShader>          m_vertexShader;
00037         Microsoft::WRL::ComPtr<ID3D11GeometryShader>        m_geometryShader;
00038         Microsoft::WRL::ComPtr<ID3D11PixelShader>           m_pixelShader;
00039         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_modelConstantBuffer;
00040         Microsoft::WRL::ComPtr<ID3D11SamplerState>          m_samplerState;
00041         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_cursorTextureView;
00042
00043         ModelColorConstantBuffer                            m_modelConstantBufferData;
00044         uint32                                              m_indexCount = 0;
00045
00046         Windows::Foundation::Numerics::float2               m_size;
00047         DX::TextureIndex                                    m_textureIndex;
00048         float                                               m_distance = 2.0f;
00049
00050         // Variables used with the rendering loop.
00051         bool                                                m_loadingComplete = false;
00052
00053         // If the current D3D Device supports VPRT, we can avoid using a geometry
00054         // shader just to set the render target array index.
00055         bool                                                m_usingVprtShaders = false;
00056     };
00057 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.h Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario2_OvenClientWRL.g.h"
00009 #include "Microsoft.SDKSamples.Kitchen.h"
00010
00011 namespace SDKTemplate
00012 {
00013     namespace WRLOutOfProcessWinRTComponent
00014     {
00015         public ref class OvenClientWRL sealed
00016         {
00017         public:
00018             OvenClientWRL();
00019
00020         private:
00021             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00022
00023             // This scenario uses the Oven as an event source so its lifetime must be maintained
00024             Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> _myOven;
00025         };
00026     }
00027 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

S7_RetrieveWithAppContent Member List

This is the complete list of members for S7_RetrieveWithAppContent, including all inherited members.
AddToIndex_Click(object sender, RoutedEventArgs e) | S7_RetrieveWithAppContent | [inline, private]
GetQueryDelegate(Windows.Storage.StorageFolder folder) | S7_RetrieveWithAppContent | [private]
OnNavigatedTo(NavigationEventArgs e) | S7_RetrieveWithAppContent | [inline, protected]
RetrieveAllItems_Click(object sender, RoutedEventArgs e) | S7_RetrieveWithAppContent | [inline, private]
RetrieveAppContentHelper(GetQueryDelegate getQuery) | S7_RetrieveWithAppContent | [inline, private]
RetrieveMatchedItems_Click(object sender, RoutedEventArgs e) | S7_RetrieveWithAppContent | [inline, private]
rootPage | S7_RetrieveWithAppContent | [private]
S7_RetrieveWithAppContent() | S7_RetrieveWithAppContent | [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cpp/Scenario2_XmlWriter.xaml.cpp Source File

  • XmlLite
  • cpp

Scenario2_XmlWriter.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_XmlWriter.xaml.h"
00014
00015 using namespace SDKTemplate::XmlLite;
00016
00017 using namespace concurrency;
00018 using namespace Microsoft::WRL;
00019 using namespace Platform;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Storage;
00023 using namespace Windows::Storage::Streams;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 Scenario2::Scenario2() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario2::DoSomething_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00040 {
00041     Button^ b = safe_cast<Button^>(sender);
00042     StorageFolder^ folder = Windows::Storage::ApplicationData::Current->LocalFolder;
00043
00044     create_task(folder->CreateFileAsync(L"XmlWriterOutput.xml", CreationCollisionOption::OpenIfExists)).then([this](StorageFile^ file)
00045     {
00046         create_task(file->OpenAsync(FileAccessMode::ReadWrite)).then([file, this](IRandomAccessStream^ writeStream)
00047         {
00048             HRESULT hr = WriteXml(writeStream);
00049             if (FAILED(hr))
00050             {
00051                 OutputTextBlock1->Text = L"Exception occured while writing the xml file, and the error code is " + hr.ToString();
00052                 rootPage->NotifyUser("Exception occured!", NotifyType::ErrorMessage);
00053             }
00054             else
00055             {
00056                 OutputTextBlock1->Text = L"File is written to " + file->Path + L" successfully";
00057             }
00058         });
00059     });
00060 }
00061
00062 HRESULT Scenario2::WriteXml(IRandomAccessStream^ randomAccessWriteStream)
00063 {
00064     HRESULT hr = S_OK;
00065     ComPtr<IStream> writeStream;
00066     ComPtr<IXmlWriter> writer;
00067
00068     ChkHr(::CreateStreamOverRandomAccessStream(randomAccessWriteStream, IID_PPV_ARGS(&writeStream)));
00069     ChkHr(::CreateXmlWriter(IID_PPV_ARGS(&writer), nullptr));
00070     ChkHr(writer->SetOutput(writeStream.Get()));
00071     ChkHr(writer->SetProperty(XmlWriterProperty_Indent, TRUE));
00072
00073     ChkHr(writer->WriteStartDocument(XmlStandalone_Omit));
00074     ChkHr(writer->WriteDocType(L"root", nullptr, nullptr, nullptr));
00075     ChkHr(writer->WriteProcessingInstruction(L"xml-stylesheet",
00076         L"href=\"mystyle.css\" title=\"Compact\" type=\"text/css\""));
00077     ChkHr(writer->WriteStartElement(nullptr, L"root", nullptr));
00078     ChkHr(writer->WriteStartElement(nullptr, L"sub", nullptr));
00079     ChkHr(writer->WriteAttributeString(nullptr, L"myAttr", nullptr, L"1234"));
00080     ChkHr(writer->WriteString(L"Markup is <escaped> for this string"));
00081     ChkHr(writer->WriteFullEndElement());
00082     ChkHr(writer->WriteStartElement(nullptr, L"anotherChild", nullptr));
00083     ChkHr(writer->WriteString(L"some text"));
00084     ChkHr(writer->WriteFullEndElement());
00085     ChkHr(writer->WriteWhitespace(L"\n"));
00086     ChkHr(writer->WriteCData(L"This is CDATA text."));
00087     ChkHr(writer->WriteWhitespace(L"\n"));
00088     ChkHr(writer->WriteStartElement(nullptr, L"containsCharacterEntity", nullptr));
00089     ChkHr(writer->WriteCharEntity(L'a'));
00090     ChkHr(writer->WriteFullEndElement());
00091     ChkHr(writer->WriteWhitespace(L"\n"));
00092     ChkHr(writer->WriteStartElement(nullptr, L"containsChars", nullptr));
00093     ChkHr(writer->WriteChars(L"abcdefghijklm", 5));
00094     ChkHr(writer->WriteFullEndElement());
00095     ChkHr(writer->WriteWhitespace(L"\n"));
00096     ChkHr(writer->WriteStartElement(nullptr, L"containsName", nullptr));
00097     ChkHr(writer->WriteName(L"myName"));
00098     ChkHr(writer->WriteEndElement());
00099     ChkHr(writer->WriteWhitespace(L"\n"));
00100     ChkHr(writer->WriteStartElement(nullptr, L"containsNmToken", nullptr));
00101     ChkHr(writer->WriteNmToken(L"myNmToken"));
00102     ChkHr(writer->WriteEndElement());
00103     ChkHr(writer->WriteWhitespace(L"\n"));
00104     ChkHr(writer->WriteComment(L"This is a comment"));
00105     ChkHr(writer->WriteWhitespace(L"\n"));
00106     ChkHr(writer->WriteRaw(L"<elementWrittenRaw/>"));
00107     ChkHr(writer->WriteWhitespace(L"\n"));
00108     ChkHr(writer->WriteRawChars(L"<rawCharacters/>", 16));
00109     ChkHr(writer->WriteWhitespace(L"\n"));
00110     ChkHr(writer->WriteElementString(nullptr, L"myElement", nullptr, L"myValue"));
00111     ChkHr(writer->WriteFullEndElement());
00112     ChkHr(writer->WriteWhitespace(L"\n"));
00113     ChkHr(writer->WriteEndDocument());
00114
00115     return hr;
00116 }
Generated on Fri Nov 15 2024 22:22:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_SimpleGridView Member List

This is the complete list of members for Scenario2_SimpleGridView, including all inherited members.
Scenario2_SimpleGridView() Scenario2_SimpleGridView
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/QuickReply/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • QuickReply

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.Actions.Action.QuickReply
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00022         {
00023             Initialize();
00024         }
00025
00026         private void Initialize()
00027         {
00028             // Clear all existing notifications
00029             ToastNotificationManager.History.Clear();
00030
00031             // Set notification payload
00032             popToastControl.Payload =
00033                 $@"
00034                 <toast activationType='foreground' launch='args'>
00035                     <visual>
00036                         <binding template='ToastGeneric'>
00037                             <text>Action - quick reply</text>
00038                             <text>Make sure the toast has a ""check"" icon button to the right of the input box.</text>
00039                         </binding>
00040                     </visual>
00041                     <actions>
00042
00043                         <input
00044                             id = 'message'
00045                             type = 'text'
00046                             placeHolderContent = 'ignore me' />
00047
00048                         <action
00049                             content='check'
00050                             imageUri='Assets/check.png'
00051                             activationType='foreground'
00052                             arguments='check'
00053                             hint-inputId='message'/>
00054
00055                     </actions>
00056                 </toast>";
00057         }
00058
00059         private async void Error(string message)
00060         {
00061             await new MessageDialog(message, "ERROR").ShowAsync();
00062         }
00063     }
00064 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/SampleConfiguration.cpp Source File

  • WebAuthenticationBroker
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Connect to Facebook Services", "SDKTemplate.Scenario2_oAuthFacebook" }
00012 };
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/CameraResources.cpp Source File

  • HolographicSpatialMapping
  • cpp
  • Common

CameraResources.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #include "CameraResources.h"
00015 #include "Common\DirectXHelper.h"
00016 #include "DeviceResources.h"
00017 #include <windows.graphics.directx.direct3d11.interop.h>
00018
00019 using namespace WindowsHolographicCodeSamples;
00020
00021 using namespace DirectX;
00022 using namespace Microsoft::WRL;
00023 using namespace Windows::Foundation::Numerics;
00024 using namespace Windows::Graphics::DirectX::Direct3D11;
00025 using namespace Windows::Graphics::Holographic;
00026 using namespace Windows::Perception::Spatial;
00027
00028 DX::CameraResources::CameraResources(HolographicCamera^ camera) :
00029     m_holographicCamera(camera),
00030     m_isStereo(camera->IsStereo),
00031     m_d3dRenderTargetSize(camera->RenderTargetSize)
00032 {
00033     m_d3dViewport = CD3D11_VIEWPORT(
00034         0.f, 0.f,
00035         m_d3dRenderTargetSize.Width,
00036         m_d3dRenderTargetSize.Height
00037         );
00038 };
00039
00040 // Updates resources associated with a holographic camera's swap chain.
00041 // The app does not access the swap chain directly, but it does create
00042 // resource views for the back buffer.
00043 void DX::CameraResources::CreateResourcesForBackBuffer(
00044     DX::DeviceResources* pDeviceResources,
00045     HolographicCameraRenderingParameters^ cameraParameters
00046     )
00047 {
00048     const auto device = pDeviceResources->GetD3DDevice();
00049
00050     // Get the WinRT object representing the holographic camera's back buffer.
00051     IDirect3DSurface^ surface = cameraParameters->Direct3D11BackBuffer;
00052
00053     // Get a DXGI interface for the holographic camera's back buffer.
00054     // Holographic cameras do not provide the DXGI swap chain, which is owned
00055     // by the system. The Direct3D back buffer resource is provided using WinRT
00056     // interop APIs.
00057     ComPtr<ID3D11Resource> resource;
00058     ThrowIfFailed(
00059         GetDXGIInterfaceFromObject(surface, IID_PPV_ARGS(&resource))
00060         );
00061
00062     // Get a Direct3D interface for the holographic camera's back buffer.
00063     ComPtr<ID3D11Texture2D> cameraBackBuffer;
00064     ThrowIfFailed(
00065         resource.As(&cameraBackBuffer)
00066         );
00067
00068     // Determine if the back buffer has changed. If so, ensure that the render target view
00069     // is for the current back buffer.
00070     if (m_d3dBackBuffer.Get() != cameraBackBuffer.Get())
00071     {
00072         // This can change every frame as the system moves to the next buffer in the
00073         // swap chain. This mode of operation will occur when certain rendering modes
00074         // are activated.
00075         m_d3dBackBuffer = cameraBackBuffer;
00076
00077         // Create a render target view of the back buffer.
00078         // Creating this resource is inexpensive, and is better than keeping track of
00079         // the back buffers in order to pre-allocate render target views for each one.
00080         DX::ThrowIfFailed(
00081             device->CreateRenderTargetView(
00082                 m_d3dBackBuffer.Get(),
00083                 nullptr,
00084                 &m_d3dRenderTargetView
00085                 )
00086             );
00087
00088         // Get the DXGI format for the back buffer.
00089         // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
00090         D3D11_TEXTURE2D_DESC backBufferDesc;
00091         m_d3dBackBuffer->GetDesc(&backBufferDesc);
00092         m_dxgiFormat = backBufferDesc.Format;
00093
00094         // Check for render target size changes.
00095         Windows::Foundation::Size currentSize = m_holographicCamera->RenderTargetSize;
00096         if (m_d3dRenderTargetSize != currentSize)
00097         {
00098             // Set render target size.
00099             m_d3dRenderTargetSize = currentSize;
00100
00101             // A new depth stencil view is also needed.
00102             m_d3dDepthStencilView.Reset();
00103         }
00104     }
00105
00106     // Refresh depth stencil resources, if needed.
00107     if (m_d3dDepthStencilView == nullptr)
00108     {
00109         // Create a depth stencil view for use with 3D rendering if needed.
00110         CD3D11_TEXTURE2D_DESC depthStencilDesc(
00111             DXGI_FORMAT_R16_TYPELESS,
00112             static_cast<UINT>(m_d3dRenderTargetSize.Width),
00113             static_cast<UINT>(m_d3dRenderTargetSize.Height),
00114             m_isStereo ? 2 : 1, // Create two textures when rendering in stereo.
00115             1, // Use a single mipmap level.
00116             D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE
00117             );
00118
00119         DX::ThrowIfFailed(
00120             device->CreateTexture2D(
00121                 &depthStencilDesc,
00122                 nullptr,
00123                 &m_d3dDepthStencil
00124                 )
00125             );
00126
00127         CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(
00128             m_isStereo ? D3D11_DSV_DIMENSION_TEXTURE2DARRAY : D3D11_DSV_DIMENSION_TEXTURE2D,
00129             DXGI_FORMAT_D16_UNORM
00130             );
00131         DX::ThrowIfFailed(
00132             device->CreateDepthStencilView(
00133                 m_d3dDepthStencil.Get(),
00134                 &depthStencilViewDesc,
00135                 &m_d3dDepthStencilView
00136                 )
00137             );
00138     }
00139
00140     // Create the constant buffer, if needed.
00141     if (m_viewProjectionConstantBuffer == nullptr)
00142     {
00143         // Create a constant buffer to store view and projection matrices for the camera.
00144         CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00145         DX::ThrowIfFailed(
00146             device->CreateBuffer(
00147                 &constantBufferDesc,
00148                 nullptr,
00149                 &m_viewProjectionConstantBuffer
00150                 )
00151             );
00152     }
00153 }
00154
00155 // Releases resources associated with a back buffer.
00156 void DX::CameraResources::ReleaseResourcesForBackBuffer(DX::DeviceResources* pDeviceResources)
00157 {
00158     const auto context = pDeviceResources->GetD3DDeviceContext();
00159
00160     // Release camera-specific resources.
00161     m_d3dBackBuffer.Reset();
00162     m_d3dDepthStencil.Reset();
00163     m_d3dRenderTargetView.Reset();
00164     m_d3dDepthStencilView.Reset();
00165     m_viewProjectionConstantBuffer.Reset();
00166
00167     // Ensure system references to the back buffer are released by clearing the render
00168     // target from the graphics pipeline state, and then flushing the Direct3D context.
00169     ID3D11RenderTargetView* nullViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { nullptr };
00170     context->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00171     context->Flush();
00172 }
00173
00174 // Updates the view/projection constant buffer for a holographic camera.
00175 void DX::CameraResources::UpdateViewProjectionBuffer(
00176     std::shared_ptr<DX::DeviceResources> deviceResources,
00177     HolographicCameraPose^ cameraPose,
00178     SpatialCoordinateSystem^ coordinateSystem
00179     )
00180 {
00181     // The system changes the viewport on a per-frame basis for system optimizations.
00182     m_d3dViewport = CD3D11_VIEWPORT(
00183         cameraPose->Viewport.Left,
00184         cameraPose->Viewport.Top,
00185         cameraPose->Viewport.Width,
00186         cameraPose->Viewport.Height
00187         );
00188
00189     // The projection transform for each frame is provided by the HolographicCameraPose.
00190     HolographicStereoTransform cameraProjectionTransform = cameraPose->ProjectionTransform;
00191
00192     // Get a container object with the view and projection matrices for the given
00193     // pose in the given coordinate system.
00194     Platform::IBox<HolographicStereoTransform>^ viewTransformContainer = cameraPose->TryGetViewTransform(coordinateSystem);
00195
00196     // If TryGetViewTransform returns a null pointer, that means the pose and coordinate
00197     // system cannot be understood relative to one another; content cannot be rendered
00198     // in this coordinate system for the duration of the current frame.
00199     // This usually means that positional tracking is not active for the current frame, in
00200     // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
00201     // content that is not world-locked instead.
00202     ViewProjectionConstantBuffer viewProjectionConstantBufferData;
00203     bool viewTransformAcquired = viewTransformContainer != nullptr;
00204     if (viewTransformAcquired)
00205     {
00206         // Otherwise, the set of view transforms can be retrieved.
00207         HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer->Value;
00208
00209         // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
00210         // constantly moving relative to the world. The view matrices need to be updated
00211         // every frame.
00212         XMStoreFloat4x4(
00213             &viewProjectionConstantBufferData.viewProjection[0],
00214             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Left) * XMLoadFloat4x4(&cameraProjectionTransform.Left))
00215             );
00216         XMStoreFloat4x4(
00217             &viewProjectionConstantBufferData.viewProjection[1],
00218             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Right) * XMLoadFloat4x4(&cameraProjectionTransform.Right))
00219             );
00220
00221         float4x4 viewInverse;
00222         bool invertible = Windows::Foundation::Numerics::invert(viewCoordinateSystemTransform.Left, &viewInverse);
00223         if (invertible)
00224         {
00225             // For the purposes of this sample, use the camera position as a light source.
00226             float4 cameraPosition = float4(viewInverse.m41, viewInverse.m42, viewInverse.m43, 0.f);
00227             float4 lightPosition = cameraPosition + float4(0.f, 0.25f, 0.f, 0.f);
00228
00229             XMStoreFloat4(&viewProjectionConstantBufferData.cameraPosition, DirectX::XMLoadFloat4(&cameraPosition));
00230             XMStoreFloat4(&viewProjectionConstantBufferData.lightPosition, DirectX::XMLoadFloat4(&lightPosition));
00231         }
00232     }
00233
00234     // Use the D3D device context to update Direct3D device-based resources.
00235     const auto context = deviceResources->GetD3DDeviceContext();
00236
00237     // Loading is asynchronous. Resources must be created before they can be updated.
00238     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || !viewTransformAcquired)
00239     {
00240         m_framePending = false;
00241     }
00242     else
00243     {
00244         // Update the view and projection matrices.
00245         context->UpdateSubresource(
00246             m_viewProjectionConstantBuffer.Get(),
00247             0,
00248             nullptr,
00249             &viewProjectionConstantBufferData,
00250             0,
00251             0
00252             );
00253
00254         m_framePending = true;
00255     }
00256 }
00257
00258 // Gets the view-projection constant buffer for the HolographicCamera and attaches it
00259 // to the shader pipeline.
00260 bool DX::CameraResources::AttachViewProjectionBuffer(
00261     std::shared_ptr<DX::DeviceResources> deviceResources
00262     )
00263 {
00264     // This method uses Direct3D device-based resources.
00265     const auto context = deviceResources->GetD3DDeviceContext();
00266
00267     // Loading is asynchronous. Resources must be created before they can be updated.
00268     // Cameras can also be added asynchronously, in which case they must be initialized
00269     // before they can be used.
00270     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
00271     {
00272         return false;
00273     }
00274
00275     // Set the viewport for this camera.
00276     context->RSSetViewports(1, &m_d3dViewport);
00277
00278     // Send the constant buffer to the vertex shader.
00279     context->VSSetConstantBuffers(
00280         1,
00281         1,
00282         m_viewProjectionConstantBuffer.GetAddressOf()
00283         );
00284
00285     // Send the constant buffer to the pixel shader.
00286     context->PSSetConstantBuffers(
00287         1,
00288         1,
00289         m_viewProjectionConstantBuffer.GetAddressOf()
00290         );
00291
00292     m_framePending = false;
00293
00294     return true;
00295 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SizePreferenceString Member List

This is the complete list of members for SizePreferenceString, including all inherited members.
m_preference | SizePreferenceString | [private]
m_title | SizePreferenceString | [private]
Preference() | SizePreferenceString | [inline]
SizePreferenceString(Windows::UI::ViewManagement::ViewSizePreference preference, hstring title) | SizePreferenceString | [inline]
Title() | SizePreferenceString | [inline]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario3_CheckUserConsentGroup.cpp Source File

  • UserInfo
  • cppwinrt

Scenario3_CheckUserConsentGroup.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_CheckUserConsentGroup.h"
00014 #include "SampleConfiguration.h"
00015 #include "Scenario3_CheckUserConsentGroup.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Storage::Streams;
00021 using namespace winrt::Windows::System;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Media::Imaging;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario3_CheckUserConsentGroup::Scenario3_CheckUserConsentGroup()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     fire_and_forget Scenario3_CheckUserConsentGroup::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&)
00033     {
00034         auto lifetime = get_strong();
00035
00036         auto users = co_await Helpers::GetUserViewModelsAsync();
00037         UserList().DataContext(users);
00038         if (users.Size() > 0)
00039         {
00040             UserList().SelectedIndex(0);
00041         }
00042     }
00043
00044     hstring Scenario3_CheckUserConsentGroup::EvaluateConsentResult(UserAgeConsentResult consentResult)
00045     {
00046         switch (consentResult)
00047         {
00048         case UserAgeConsentResult::Included:
00049         case UserAgeConsentResult::NotEnforced:
00050             return L"Allowed.";
00051         case UserAgeConsentResult::NotIncluded:
00052             return L"Not allowed.";
00053         case UserAgeConsentResult::Unknown:
00054             return L"Cannot determine. Default to app specific age unknown behavior.";
00055         default:
00056         case UserAgeConsentResult::Ambiguous:
00057             return L"Age regulations have changed, the app needs to be updated to reflect new catagories.";
00058         }
00059     }
00060
00061     fire_and_forget Scenario3_CheckUserConsentGroup::ShowConsentGroups(IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&)
00062     {
00063         auto lifetime = get_strong();
00064
00065         auto selectedUser = UserList().SelectedValue().as<SDKTemplate::UserViewModel>();
00066         if (selectedUser != nullptr)
00067         {
00068             ResultsText().Text(L"");
00069             rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00070             try
00071             {
00072                 User user = User::GetFromId(selectedUser.UserId());
00073
00074                 UserAgeConsentResult canShowChildContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Child);
00075                 hstring result = L"Child content: " + EvaluateConsentResult(canShowChildContent) + L"\n";
00076
00077                 UserAgeConsentResult canShowMinorContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Minor);
00078                 result = result + L"Minor content: " + EvaluateConsentResult(canShowMinorContent) + L"\n";
00079
00080                 UserAgeConsentResult canShowAdultContent = co_await user.CheckUserAgeConsentGroupAsync(UserAgeConsentGroup::Adult);
00081                 result = result + L"Adult content: " + EvaluateConsentResult(canShowAdultContent) + L"\n";
00082
00083                 ResultsText().Text(result);
00084             }
00085             catch (hresult_error const& ex)
00086             {
00087                 // Operations on the "User" object fail if the user signs out.
00088                 rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
00089             }
00090         }
00091     }
00092 }
00093
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OtherScenarios Member List

This is the complete list of members for OtherScenarios, including all inherited members.
ClearOutput() | OtherScenarios | [inline, private]
ClearOutputButton_Click(object sender, RoutedEventArgs e) | OtherScenarios | [inline, private]
DisplayFormats() | OtherScenarios | [inline, private]
EmptyClipboardButton_Click(object sender, RoutedEventArgs e) | OtherScenarios | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | OtherScenarios | [inline, protected]
OtherScenarios() | OtherScenarios | [inline]
RegisterClipboardContentChanged_Click(object sender, RoutedEventArgs e) | OtherScenarios | [inline, private]
rootPage | OtherScenarios | [private]
ShowFormatButton_Click(object sender, RoutedEventArgs e) | OtherScenarios | [inline, private]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/DisplaySizeHelper/pch.cpp Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews
  • DisplaySizeHelper

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario1_DataEvents.xaml.h Source File

  • Compass
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Sensors::Compass^ compass;
00041         Windows::Foundation::EventRegistrationToken visibilityToken;
00042         Windows::Foundation::EventRegistrationToken readingToken;
00043         uint32 desiredReportInterval;
00044
00045         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00046         void ReadingChanged(Windows::Devices::Sensors::Compass^ sender, Windows::Devices::Sensors::CompassReadingChangedEventArgs^ e);
00047         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/SampleConfiguration.cpp Source File

  • WebSocket
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Networking::Sockets;
00021 using namespace winrt::Windows::Security::Cryptography::Certificates;
00022 using namespace winrt::Windows::Web;
00023 using namespace winrt::SDKTemplate;
00024 using namespace std::literals::chrono_literals;
00025
00026 hstring implementation::MainPage::FEATURE_NAME()
00027 {
00028     return L"WebSocket C++/WinRT Sample";
00029 }
00030
00031 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00032 {
00033     Scenario{ L"UTF-8 text messages", xaml_typename<SDKTemplate::Scenario1_UTF8>() },
00034     Scenario{ L"Binary data stream", xaml_typename<SDKTemplate::Scenario2_Binary>() },
00035     Scenario{ L"Client authentication", xaml_typename<SDKTemplate::Scenario3_ClientAuthentication>() },
00036     Scenario{ L"Partial and Complete Messages", xaml_typename<SDKTemplate::Scenario4_PartialReadWrite>() },
00037 });
00038
00039 hstring winrt::to_hstring(SocketMessageType value)
00040 {
00041     switch (value)
00042     {
00043     case SocketMessageType::Binary: return L"Binary";
00044     case SocketMessageType::Utf8: return L"Utf8";
00045     }
00046     return to_hstring(static_cast<int32_t>(value));
00047 }
00048
00049 hstring winrt::to_hstring(WebErrorStatus value)
00050 {
00051     switch (value)
00052     {
00053     case WebErrorStatus::Unknown: return L"Unknown";
00054     case WebErrorStatus::CertificateCommonNameIsIncorrect: return L"CertificateCommonNameIsIncorrect";
00055     case WebErrorStatus::CertificateExpired: return L"CertificateExpired";
00056     case WebErrorStatus::CertificateContainsErrors: return L"CertificateContainsErrors";
00057     case WebErrorStatus::CertificateRevoked: return L"CertificateRevoked";
00058     case WebErrorStatus::CertificateIsInvalid: return L"CertificateIsInvalid";
00059     case WebErrorStatus::ServerUnreachable: return L"ServerUnreachable";
00060     case WebErrorStatus::Timeout: return L"Timeout";
00061     case WebErrorStatus::ErrorHttpInvalidServerResponse: return L"ErrorHttpInvalidServerResponse";
00062     case WebErrorStatus::ConnectionAborted: return L"ConnectionAborted";
00063     case WebErrorStatus::ConnectionReset: return L"ConnectionReset";
00064     case WebErrorStatus::Disconnected: return L"Disconnected";
00065     case WebErrorStatus::HttpToHttpsOnRedirection: return L"HttpToHttpsOnRedirection";
00066     case WebErrorStatus::HttpsToHttpOnRedirection: return L"HttpsToHttpOnRedirection";
00067     case WebErrorStatus::CannotConnect: return L"CannotConnect";
00068     case WebErrorStatus::HostNameNotResolved: return L"HostNameNotResolved";
00069     case WebErrorStatus::OperationCanceled: return L"OperationCanceled";
00070     case WebErrorStatus::RedirectFailed: return L"RedirectFailed";
00071     case WebErrorStatus::UnexpectedStatusCode: return L"UnexpectedStatusCode";
00072     case WebErrorStatus::UnexpectedRedirection: return L"UnexpectedRedirection";
00073     case WebErrorStatus::UnexpectedClientError: return L"UnexpectedClientError";
00074     case WebErrorStatus::UnexpectedServerError: return L"UnexpectedServerError";
00075     case WebErrorStatus::InsufficientRangeSupport: return L"InsufficientRangeSupport";
00076     case WebErrorStatus::MissingContentLengthSupport: return L"MissingContentLengthSupport";
00077     }
00078     return to_hstring(static_cast<int32_t>(value));
00079 }
00080
00081 Uri winrt::SDKTemplate::TryGetUri(MainPage const& rootPage, hstring const& uriString)
00082 {
00083     Uri webSocketUri{ nullptr };
00084
00085     try
00086     {
00087         webSocketUri = Uri(uriString);
00088     }
00089     catch (hresult_error const&)
00090     {
00091         rootPage.NotifyUser(L"Error: Invalid URI", NotifyType::ErrorMessage);
00092         return nullptr;
00093     }
00094
00095     // Fragments are not allowed in WebSocket URIs.
00096     if (!webSocketUri.Fragment().empty())
00097     {
00098         rootPage.NotifyUser(L"Error: URI fragments not supported in WebSocket URIs.", NotifyType::ErrorMessage);
00099         return nullptr;
00100     }
00101
00102     // Uri.SchemeName returns the canonicalized scheme name so we can use case-sensitive, ordinal string
00103     // comparison.
00104     if ((webSocketUri.SchemeName() != L"ws") && (webSocketUri.SchemeName() != L"wss"))
00105     {
00106         rootPage.NotifyUser(L"Error: WebSockets only support ws:// and wss:// schemes.", NotifyType::ErrorMessage);
00107         return nullptr;
00108     }
00109
00110     return webSocketUri;
00111 }
00112
00113 hstring winrt::SDKTemplate::BuildWebSocketError(hresult_error const& ex)
00114 {
00115     if (ex.code() == INET_E_SECURITY_PROBLEM) // 0x800C000EU
00116     {
00117         // INET_E_SECURITY_PROBLEM - our custom certificate validator rejected the request.
00118         return L"Error: Rejected by custom certificate validation.";
00119     }
00120
00121     WebErrorStatus status = WebSocketError::GetStatus(ex.code());
00122
00123     // Normally we'd use the HResult and status to test for specific conditions we want to handle.
00124     // In this sample, we'll just output them for demonstration purposes.
00125     switch (status)
00126     {
00127     case WebErrorStatus::CannotConnect:
00128     case WebErrorStatus::NotFound:
00129     case WebErrorStatus::RequestTimeout:
00130         return L"Cannot connect to the server. Please make sure to run the server setup script before running the sample.";
00131
00132     case WebErrorStatus::Unknown:
00133         return L"COM error: " + to_hstring(ex.code());
00134
00135     default:
00136         return L"Error: " + to_hstring(status);
00137     }
00138 }
00139
00140 IAsyncOperation<bool> IsCertificateValidAsync(Certificate serverCert)
00141 {
00142     // This is a placeholder call to simulate long-running async calls. Note that this code runs synchronously as part
00143     // of the SSL/TLS handshake. Avoid performing lengthy operations here - else, the remote server may terminate the
00144     // connection abruptly.
00145     co_await winrt::resume_after(100ms);
00146
00147     // In this sample, we check the issuer of the certificate - this is purely for illustration
00148     // purposes and should not be considered as a recommendation for certificate validation.
00149     co_return serverCert.Issuer() == L"www.fabrikam.com";
00150 }
00151
00152 IAsyncOperation<bool> winrt::SDKTemplate::AreCertificateAndCertChainValidAsync(Certificate serverCert, IVectorView<Certificate> certChain)
00153 {
00154     for (auto&& cert : certChain)
00155     {
00156         if (!(co_await IsCertificateValidAsync(cert)))
00157         {
00158             co_return false;
00159         }
00160     }
00161     co_return co_await IsCertificateValidAsync(serverCert);
00162 }
00163
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario4_NumberParsing.xaml.h Source File

  • NumberFormatting
  • cpp

Scenario4_NumberParsing.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "pch.h"
00006 #include "Scenario4_NumberParsing.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario4_NumberParsing sealed
00012     {
00013     public:
00014         Scenario4_NumberParsing();
00015
00016     private:
00017         void Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00018     };
00019 }
Generated on Fri Nov 15 2024 22:20:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_GetPosition Member List

This is the complete list of members for Scenario2_GetPosition, including all inherited members.
_cts | Scenario2_GetPosition | [private]
_rootPage | Scenario2_GetPosition | [private]
CancelGetGeolocationButtonClicked(object sender, RoutedEventArgs e) | Scenario2_GetPosition | [inline, private]
GetGeolocationButtonClicked(object sender, RoutedEventArgs e) | Scenario2_GetPosition | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_GetPosition | [inline, protected]
Scenario2_GetPosition() | Scenario2_GetPosition | [inline]
ShowSatelliteData(bool isVisible) | Scenario2_GetPosition | [inline, private]
UpdateLocationData(Geoposition position) | Scenario2_GetPosition | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/pch.h Source File

  • ContentIndexer
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.h Source File

  • CameraFrames
  • cpp

Scenario1_DisplayDepthColorIR.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_DisplayDepthColorIR.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "SimpleLogger.h"
00017 #include "FrameRenderer.h"
00018
00019 namespace SDKTemplate
00020 {
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario1_DisplayDepthColorIR sealed
00023     {
00024     public:
00025         Scenario1_DisplayDepthColorIR();
00026
00027     protected: // Protected UI overrides.
00028         /// <summary>
00029         /// Called when user navigates to this Scenario.
00030         /// Immediately start streaming from first available source group.
00031         /// </summary>
00032         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033
00034         /// <summary>
00035         /// Called when user navigates away from this Scenario.
00036         /// Stops streaming and disposes of all objects.
00037         /// </summary>
00038         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00039
00040     private:
00041         // Private UI methods.
00042         /// <summary>
00043         /// Select next available source group and start streaming from it.
00044         /// </summary>
00045         void NextButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046
00047     private:
00048         // Private methods.
00049         /// <summary>
00050         /// Disable the Next button while we switch to the next eligible media source.
00051         /// </summary>
00052         concurrency::task<void> PickNextMediaSourceAsync();
00053
00054         /// <summary>
00055         /// Switch to the next eligible media source.
00056         /// </summary>
00057         concurrency::task<void> PickNextMediaSourceWorkerAsync();
00058
00059         /// <summary>
00060         /// Stop streaming from all readers and dispose all readers and media capture object.
00061         /// </summary>
00062         concurrency::task<void> CleanupMediaCaptureAsync();
00063
00064         /// <summary>
00065         /// Initialize the media capture object.
00066         /// Must be called from the UI thread.
00067         /// </summary>
00068         concurrency::task<bool> TryInitializeMediaCaptureAsync(
00069             Windows::Media::Capture::Frames::MediaFrameSourceGroup^ group);
00070
00071         /// <summary>
00072         /// Handler for frames which arrive from the MediaFrameReader.
00073         /// </summary>
00074         void FrameReader_FrameArrived(
00075             Windows::Media::Capture::Frames::MediaFrameReader^ sender,
00076             Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^ args);
00077
00078     private:
00079         // Private data.
00080         MainPage^ rootPage = MainPage::Current;
00081
00082         // The currently selected source group.
00083         int m_selectedSourceGroupIndex = 0;
00084
00085         Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCapture;
00086
00087         std::vector<std::pair<Windows::Media::Capture::Frames::MediaFrameReader^, Windows::Foundation::EventRegistrationToken>> m_readers;
00088
00089         std::map<Windows::Media::Capture::Frames::MediaFrameSourceKind, FrameRenderer^> m_frameRenderers;
00090
00091         SimpleLogger^ m_logger;
00092     };
00093 } // SDKTemplate
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InteropStatics::IDirect3DDxgiInterfaceAccess Member List

This is the complete list of members for InteropStatics::IDirect3DDxgiInterfaceAccess, including all inherited members.
GetInterface([In] ref Guid iid) InteropStatics::IDirect3DDxgiInterfaceAccess
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Oven Member List

This is the complete list of members for Oven, including all inherited members.
_dimensions | Oven | [private]
_temperature | Oven | [private]
BakeBread(String flavor) | Oven | [inline]
Microsoft::SDKSamples::Kitchen::IOven::BakeBread(Platform::String^flavor) | IOven |
Microsoft::SDKSamples::Kitchen::IOven::BakeBread([in] HSTRING flavor) | IOven |
BreadBaked | Oven |
Microsoft::SDKSamples::Kitchen::IOven::BreadBaked([in] Windows.Foundation.TypedEventHandler< Oven *, BreadBakedEventArgs * > *handler,[out, retval] EventRegistrationToken *token) | IOven |
Microsoft::SDKSamples::Kitchen::IOven::BreadBaked([in] EventRegistrationToken token) | IOven |
ConfigurePreheatTemperature(OvenTemperature level) | Oven | [inline]
Oven(Dimensions dimensions) | Oven | [inline]
Oven() | Oven | [inline]
Volume | Oven |
Microsoft::SDKSamples::Kitchen::IOven::Volume([out, retval] double *value) | IAppliance |
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileSavePickerPageSizeChangedEventArgs Member List

This is the complete list of members for FileSavePickerPageSizeChangedEventArgs, including all inherited members.
width | FileSavePickerPageSizeChangedEventArgs | [private]
Width | FileSavePickerPageSizeChangedEventArgs |
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_ScrollingContentUsingMarquee Member List

This is the complete list of members for Scenario7_ScrollingContentUsingMarquee, including all inherited members.
horizontalScrollableWindow | Scenario7_ScrollingContentUsingMarquee | [private]
InitializeAsync() | Scenario7_ScrollingContentUsingMarquee | [inline, private]
lineDisplay | Scenario7_ScrollingContentUsingMarquee | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario7_ScrollingContentUsingMarquee | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario7_ScrollingContentUsingMarquee | [inline, protected]
rootPage | Scenario7_ScrollingContentUsingMarquee | [private]
Scenario7_ScrollingContentUsingMarquee() | Scenario7_ScrollingContentUsingMarquee | [inline]
StartScrollingButton_Click(object sender, RoutedEventArgs e) | Scenario7_ScrollingContentUsingMarquee | [inline, private]
StopAllScrollingAsync() | Scenario7_ScrollingContentUsingMarquee | [inline, private]
StopScrollingButton_Click(object sender, RoutedEventArgs e) | Scenario7_ScrollingContentUsingMarquee | [inline, private]
verticalScrollableWindow | Scenario7_ScrollingContentUsingMarquee | [private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ActivitySensorBackgroundTask Member List

This is the complete list of members for ActivitySensorBackgroundTask, including all inherited members.
OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) | ActivitySensorBackgroundTask | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | ActivitySensorBackgroundTask | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario3_Enum.cpp Source File

  • Calendar
  • cppwinrt

Scenario3_Enum.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_Enum.h"
00014 #include "Scenario3_Enum.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::DateTimeFormatting;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario3_Enum::Scenario3_Enum()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario3_Enum::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         // This scenario uses the Windows.Globalization.Calendar class to enumerate through a calendar and
00032         // perform calendar math
00033         std::wostringstream results;
00034
00035         results <<
00036             L"The number of years in each era of the Japanese era calendar is not regular. " <<
00037             L"It is determined by the length of the given imperial era:\n";
00038
00039         // Create Japanese calendar.
00040         Calendar calendar({ L"en-US" }, CalendarIdentifiers::Japanese(), ClockIdentifiers::TwentyFourHour());
00041
00042         // Enumerate all supported years in all supported Japanese eras.
00043         for (calendar.Era(calendar.FirstEra()); true; calendar.AddYears(1))
00044         {
00045             // Process current era.
00046             results << L"Era " << std::wstring_view(calendar.EraAsString()) <<
00047                 L" contains " << calendar.NumberOfYearsInThisEra() <<
00048                 L" year(s)\n";
00049
00050             // Enumerate all years in this era.
00051             for (calendar.Year(calendar.FirstYearInThisEra()); true; calendar.AddYears(1))
00052             {
00053                 // Begin sample processing of current year.
00054
00055                 // Move to first day of year. Change of month can affect day so order of assignments is important.
00056                 calendar.Month(calendar.FirstMonthInThisYear());
00057                 calendar.Day(calendar.FirstDayInThisMonth());
00058
00059                 // Set time to midnight (local).
00060                 calendar.Period(calendar.FirstPeriodInThisDay());    // All days have 1 or 2 periods depending on clock type
00061                 calendar.Hour(calendar.FirstHourInThisPeriod());     // Hours start from 12 or 0 depending on clock type
00062                 calendar.Minute(0);
00063                 calendar.Second(0);
00064                 calendar.Nanosecond(0);
00065
00066                 if (calendar.Year() % 1000 == 0)
00067                 {
00068                     results << L"\n";
00069                 }
00070                 else if (calendar.Year() % 10 == 0)
00071                 {
00072                     results << L".";
00073                 }
00074
00075                 // End sample processing of current year.
00076
00077                 // Break after processing last year.
00078                 if (calendar.Year() == calendar.LastYearInThisEra())
00079                 {
00080                     break;
00081                 }
00082             }
00083             results << L"\n";
00084
00085             // Break after processing last era.
00086             if (calendar.Era() == calendar.LastEra())
00087             {
00088                 break;
00089             }
00090         }
00091         results << L"\n";
00092
00093         // This section shows enumeration through the hours in a day to demonstrate that the number of time units in a given period (hours in a day, minutes in an hour, etc.)
00094         // should not be regarded as fixed. With Daylight Saving Time and other local calendar adjustments, a given day may have not have 24 hours, and
00095         // a given hour may not have 60 minutes, etc.
00096         results <<
00097             L"The number of hours in a day is not constant. " <<
00098             L"The US calendar transitions from daylight saving time to standard time on 4 November 2012:\n\n";
00099
00100         // Create a DateTimeFormatter to display dates
00101         DateTimeFormatter displayDate(L"longdate");
00102
00103         // Create a Gregorian calendar for the US with 12-hour clock format
00104         Calendar currentCal({ L"en-US" }, CalendarIdentifiers::Gregorian(), ClockIdentifiers::TwentyFourHour(), L"America/Los_Angeles");
00105
00106         // Set the calendar to a the date of the Daylight Saving Time-to-Standard Time transition for the US in 2012.
00107         // An easier way to set the calendar date and time is to set the currentCal.Year, Month, etc. properties.
00108         // However, we calculate it the complicated way to demonstrate interoperability between Calendar and Windows::Foundation::DateTime.
00109         // DST ends in the America/Los_Angeles time zone at 4 November 2012 02:00 PDT = 4 November 2012 09:00 UTC.
00110         SYSTEMTIME dstSystemTime;
00111         dstSystemTime.wYear = 2012;
00112         dstSystemTime.wMonth = 11;
00113         dstSystemTime.wDay = 4;
00114         dstSystemTime.wHour = 9;
00115         dstSystemTime.wMinute = 0;
00116         dstSystemTime.wSecond = 0;
00117         dstSystemTime.wMilliseconds = 0;
00118         FILETIME dstFileTime;
00119         SystemTimeToFileTime(&dstSystemTime, &dstFileTime);
00120         DateTime dstDateTime = clock::from_file_time(dstFileTime);
00121         currentCal.SetDateTime(dstDateTime);
00122
00123         // Set the current calendar to one day before DST change. Create a second calendar for comparision and set it to one day after DST change.
00124         Calendar endDate = currentCal.Clone();
00125         currentCal.AddDays(-1);
00126         endDate.AddDays(1);
00127
00128         // Enumerate the day before, the day of, and the day after the 2012 DST-to-Standard time transition
00129         while (currentCal.Day() <= endDate.Day())
00130         {
00131             // Process current day.
00132             DateTime date = currentCal.GetDateTime();
00133             results << std::wstring_view(displayDate.Format(date)) << L" contains " << currentCal.NumberOfHoursInThisPeriod() << L" hour(s)\n";
00134
00135             // Enumerate all hours in this day.
00136             // Create a calendar to represent the following day.
00137             Calendar nextDay = currentCal.Clone();
00138             nextDay.AddDays(1);
00139             for (currentCal.Hour(currentCal.FirstHourInThisPeriod()); true; currentCal.AddHours(1))
00140             {
00141                 // Display the hour for each hour in the day.
00142                 results << std::wstring_view(currentCal.HourAsPaddedString(2)) << L" ";
00143
00144                 // Break upon reaching the next period (i.e. the first period in the following day).
00145                 if (currentCal.Day() == nextDay.Day() && currentCal.Period() == nextDay.Period())
00146                 {
00147                     break;
00148                 }
00149             }
00150             results << L"\n";
00151         }
00152
00153         // Display results
00154         OutputTextBlock().Text(results.str());
00155     }
00156 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_PinFromAppbar Member List

This is the complete list of members for Scenario7_PinFromAppbar, including all inherited members.
BottomAppBar_Opened(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e) | Scenario7_PinFromAppbar | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario7_PinFromAppbar |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario7_PinFromAppbar |
PinToAppBar_Click(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario7_PinFromAppbar |
Scenario7_PinFromAppbar() | Scenario7_PinFromAppbar |
UpdateAppBarButton() | Scenario7_PinFromAppbar | [private]
Window_Activated(Windows::Foundation::IInspectable const &sender, Windows::UI::Core::WindowActivatedEventArgs const &e) | Scenario7_PinFromAppbar | [private]
windowActivatedEventToken | Scenario7_PinFromAppbar | [private]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario1_Basic.h Source File

  • FullScreenMode
  • cppwinrt

Scenario1_Basic.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Basic.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Basic : Scenario1_BasicT<Scenario1_Basic>
00020     {
00021         Scenario1_Basic();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         void ToggleFullScreenModeButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void ShowStandardSystemOverlaysButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void UseMinimalOverlaysCheckBox_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032
00033         // What is the program's last known full-screen state?
00034         // We use this to detect when the system forced us out of full-screen mode.
00035         bool isLastKnownFullScreen = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView().IsFullScreenMode();
00036
00037         event_token windowResizeToken;
00038         event_token keyDownToken;
00039
00040         void UpdateContent();
00041         void RootPage_OnKeyDown(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
00042     };
00043 }
00044
00045 namespace winrt::SDKTemplate::factory_implementation
00046 {
00047     struct Scenario1_Basic : Scenario1_BasicT<Scenario1_Basic, implementation::Scenario1_Basic>
00048     {
00049     };
00050 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario6_GetLastVisit.xaml.cs Source File

  • Geolocation
  • cs

Scenario6_GetLastVisit.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.Geolocation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario6_GetLastVisit : Page
00023     {
00024         // A pointer to the main page
00025         private MainPage _rootPage = MainPage.Current;
00026
00027         public Scenario6_GetLastVisit()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         /// <summary>
00033         /// This is the click handler for the 'getLastVisit' button.
00034         /// </summary>
00035         /// <param name="sender"></param>
00036         /// <param name="e"></param>
00037         private async void GetLastVisitButtonClicked(object sender, RoutedEventArgs e)
00038         {
00039             GetLastVisitButton.IsEnabled = false;
00040             LocationDisabledMessage.Visibility = Visibility.Collapsed;
00041
00042             // Request permission to access location
00043             var accessStatus = await Geolocator.RequestAccessAsync();
00044
00045             Geovisit visit = null;
00046             switch (accessStatus)
00047             {
00048                 case GeolocationAccessStatus.Allowed:
00049                     _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);
00050
00051                     // Get the last visit report, if any. This should be a quick operation.
00052                     visit = await GeovisitMonitor.GetLastReportAsync();
00053                     _rootPage.NotifyUser("Visit info updated.", NotifyType.StatusMessage);
00054                     break;
00055
00056                 case GeolocationAccessStatus.Denied:
00057                     _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
00058                     LocationDisabledMessage.Visibility = Visibility.Visible;
00059                     break;
00060
00061                 default:
00062                 case GeolocationAccessStatus.Unspecified:
00063                     _rootPage.NotifyUser("Unspecified error.", NotifyType.ErrorMessage);
00064                     break;
00065             }
00066
00067             UpdateLastVisit(visit);
00068
00069             GetLastVisitButton.IsEnabled = true;
00070         }
00071
00072         /// <summary>
00073         /// Updates the user interface with the Geovisit data provided
00074         /// </summary>
00075         /// <param name="visit">Geovisit to display its details</param>
00076         private void UpdateLastVisit(Geovisit visit)
00077         {
00078             if (visit == null)
00079             {
00080                 ScenarioOutput_Latitude.Text = "No data";
00081                 ScenarioOutput_Longitude.Text = "No data";
00082                 ScenarioOutput_Accuracy.Text = "No data";
00083                 ScenarioOutput_Timestamp.Text = "No data";
00084                 ScenarioOutput_VisitStateChange.Text = "No data";
00085             }
00086             else
00087             {
00088                 // A valid visit is available, extract the state change and Timestamp.
00089                 ScenarioOutput_VisitStateChange.Text = visit.StateChange.ToString();
00090                 ScenarioOutput_Timestamp.Text = visit.Timestamp.ToString();
00091
00092                 // If a valid position is available, extract the position information that caused the state change to happen.
00093                 if(visit.Position == null)
00094                 {
00095                     ScenarioOutput_Latitude.Text = "No data";
00096                     ScenarioOutput_Longitude.Text = "No data";
00097                     ScenarioOutput_Accuracy.Text = "No data";
00098                     ScenarioOutput_IsRemoteSource.Text = "No data";
00099                 }
00100                 else
00101                 {
00102                     ScenarioOutput_Latitude.Text = visit.Position.Coordinate.Point.Position.Latitude.ToString();
00103                     ScenarioOutput_Longitude.Text = visit.Position.Coordinate.Point.Position.Longitude.ToString();
00104                     ScenarioOutput_Accuracy.Text = visit.Position.Coordinate.Accuracy.ToString();
00105                     ScenarioOutput_IsRemoteSource.Text = visit.Position.Coordinate.IsRemoteSource.ToString();
00106                 }
00107             }
00108         }
00109     }
00110 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/HolographicVoiceInputMain.h Source File

  • HolographicVoiceInput
  • cpp

HolographicVoiceInputMain.h

Go to the documentation of this file.
00001 #pragma once
00002 //*********************************************************
00003 //
00004 // Copyright (c) Microsoft. All rights reserved.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013
00014 //
00015 // Comment out this preprocessor definition to disable all of the
00016 // sample content.
00017 //
00018 // To remove the content after disabling it:
00019 //     * Remove the unused code from your app's Main class.
00020 //     * Delete the Content folder provided with this template.
00021 //
00022
00023 #include "Common\DeviceResources.h"
00024 #include "Common\StepTimer.h"
00025
00026 #include "Content\SpinningCubeRenderer.h"
00027 #include "Content\SpatialInputHandler.h"
00028
00029 #include "Audio/OmnidirectionalSound.h"
00030
00031 // Updates, renders, and presents holographic content using Direct3D.
00032 namespace HolographicVoiceInput
00033 {
00034     class HolographicVoiceInputMain : public DX::IDeviceNotify
00035     {
00036     public:
00037         HolographicVoiceInputMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00038         ~HolographicVoiceInputMain();
00039
00040         // Sets the holographic space. This is our closest analogue to setting a new window
00041         // for the app.
00042         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ holographicSpace);
00043
00044         // Starts the holographic frame and updates the content.
00045         Windows::Graphics::Holographic::HolographicFrame^ Update();
00046
00047         // Renders holograms, including world-locked content.
00048         bool Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame);
00049
00050         // Handle saving and loading of app state owned by AppMain.
00051         void SaveAppState();
00052         void LoadAppState();
00053
00054         // IDeviceNotify
00055         virtual void OnDeviceLost();
00056         virtual void OnDeviceRestored();
00057
00058     private:
00059         // Process continuous speech recognition results.
00060         void OnResultGenerated(
00061             Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender,
00062             Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs ^args
00063         );
00064
00065         // Recognize when conditions might impact speech recognition quality.
00066         void OnSpeechQualityDegraded(
00067             Windows::Media::SpeechRecognition::SpeechRecognizer^ recognizer,
00068             Windows::Media::SpeechRecognition::SpeechRecognitionQualityDegradingEventArgs^ args
00069         );
00070
00071         // Initializes the speech command list.
00072         void InitializeSpeechCommandList();
00073
00074         // Initializes a speech recognizer.
00075         bool InitializeSpeechRecognizer();
00076
00077         // Provides a voice prompt, before starting the scenario.
00078         void BeginVoiceUIPrompt();
00079         void PlayRecognitionBeginSound();
00080         void PlayRecognitionSound();
00081
00082         // Creates a speech command recognizer, and starts listening.
00083         Concurrency::task<bool> StartRecognizeSpeechCommands();
00084
00085         // Resets the speech recognizer, if one exists.
00086         Concurrency::task<void> StopCurrentRecognizerIfExists();
00087
00088         // Asynchronously creates resources for new holographic cameras.
00089         void OnCameraAdded(
00090             Windows::Graphics::Holographic::HolographicSpace^ sender,
00091             Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ args);
00092
00093         // Synchronously releases resources for holographic cameras that are no longer
00094         // attached to the system.
00095         void OnCameraRemoved(
00096             Windows::Graphics::Holographic::HolographicSpace^ sender,
00097             Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ args);
00098
00099         // Used to notify the app when the positional tracking state changes.
00100         void OnLocatabilityChanged(
00101             Windows::Perception::Spatial::SpatialLocator^ sender,
00102             Platform::Object^ args);
00103
00104         // Clears event registration state. Used when changing to a new HolographicSpace
00105         // and when tearing down AppMain.
00106         void UnregisterHolographicEventHandlers();
00107
00108         // Renders a colorful holographic cube that's 20 centimeters wide. This sample content
00109         // is used to demonstrate world-locked rendering.
00110         std::unique_ptr<SpinningCubeRenderer>                           m_spinningCubeRenderer;
00111
00112         // Listens for the Pressed spatial input event.
00113         std::shared_ptr<SpatialInputHandler>                            m_spatialInputHandler;
00114
00115         // Cached pointer to device resources.
00116         std::shared_ptr<DX::DeviceResources>                            m_deviceResources;
00117
00118         // Render loop timer.
00119         DX::StepTimer                                                   m_timer;
00120
00121         // Represents the holographic space around the user.
00122         Windows::Graphics::Holographic::HolographicSpace^               m_holographicSpace;
00123
00124         // SpatialLocator that is attached to the primary camera.
00125         Windows::Perception::Spatial::SpatialLocator^                   m_locator;
00126
00127         // A reference frame attached to the holographic camera.
00128         Windows::Perception::Spatial::SpatialStationaryFrameOfReference^ m_referenceFrame;
00129
00130         // Event registration tokens.
00131         Windows::Foundation::EventRegistrationToken                     m_cameraAddedToken;
00132         Windows::Foundation::EventRegistrationToken                     m_cameraRemovedToken;
00133         Windows::Foundation::EventRegistrationToken                     m_locatabilityChangedToken;
00134
00135         Windows::Foundation::EventRegistrationToken                     m_speechRecognizerResultEventToken;
00136         Windows::Foundation::EventRegistrationToken                     m_speechRecognitionQualityDegradedToken;
00137
00138         bool                                                            m_listening;
00139
00140         // Speech recognizer.
00141         Windows::Media::SpeechRecognition::SpeechRecognizer^            m_speechRecognizer;
00142
00143         // Maps commands to color data.
00144         // We will create a Vector of the key values in this map for use as speech commands.
00145         Platform::Collections::Map<Platform::String^, Windows::Foundation::Numerics::float4>^ m_speechCommandData;
00146
00147         // The most recent speech command received.
00148         Platform::String^                                               m_lastCommand;
00149
00150         // Handles playback of speech synthesis audio.
00151         OmnidirectionalSound                                            m_speechSynthesisSound;
00152         OmnidirectionalSound                                            m_recognitionSound;
00153         OmnidirectionalSound                                            m_startRecognitionSound;
00154
00155         bool                                                            m_waitingForSpeechPrompt = false;
00156         bool                                                            m_waitingForSpeechCue = false;
00157         float                                                           m_secondsUntilSoundIsComplete = 0.f;
00158     };
00159 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Basic Member List

This is the complete list of members for Scenario1_Basic, including all inherited members.
AddItemToEnd() | Scenario1_Basic | [inline, private]
AttachRef() | Scenario1_Basic | [inline, private]
checkBoxStyle | Scenario1_Basic | [private]
CheckBoxStyle | Scenario1_Basic |
ClickToPlaySource_ImageOpened(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
DeleteSelectedItem() | Scenario1_Basic | [inline, private]
done | Scenario1_Basic | [private]
interactionMode | Scenario1_Basic | [private]
InteractionMode | Scenario1_Basic |
isLastKnownFullScreen | Scenario1_Basic | [private]
mbrr | Scenario1_Basic | [private]
messageNumber | Scenario1_Basic | [private]
OnKeyDown(object sender, KeyRoutedEventArgs e) | Scenario1_Basic | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Basic | [inline, protected]
OnWindowResize(object sender, WindowSizeChangedEventArgs e) | Scenario1_Basic | [inline, private]
OnWindowResize(object sender, WindowSizeChangedEventArgs e) | Scenario1_Basic | [inline, private]
OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e) | Scenario1_Basic | [inline, private]
PropertyChanged | Scenario1_Basic |
ResizeView_Click(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
RestoreScrollPosition() | Scenario1_Basic | [inline, private]
rootPage | Scenario1_Basic | [private]
savedScrollPosition | Scenario1_Basic | [private]
SaveScrollPosition() | Scenario1_Basic | [inline, private]
Scenario1_Basic() | Scenario1_Basic | [inline]
Scenario1_Basic() | Scenario1_Basic | [inline]
Scenario1_Basic() | Scenario1_Basic | [inline]
Scenario1_Basic() | Scenario1_Basic | [inline]
Scenario1_Basic() | Scenario1_Basic | [inline]
SetMinimumSize_Click(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
ShowStandardSystemOverlaysButton_Click(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
ToggleFullScreenModeButton_Click(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
UpdateContent() | Scenario1_Basic | [inline, private]
UpdateContent() | Scenario1_Basic | [inline, private]
UpdateContent() | Scenario1_Basic | [inline, private]
UseMinimalOverlaysCheckBox_Click(object sender, RoutedEventArgs e) | Scenario1_Basic | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Scenario3_MasterDetail.xaml.cs Source File

  • XamlListView
  • cs

Scenario3_MasterDetail.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.ComponentModel;
00016 using System.Linq;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Media.Animation;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario3_MasterDetail : Page
00025     {
00026         private ObservableCollection<Contact> Contacts;
00027
00028         public Scenario3_MasterDetail()
00029         {
00030             InitializeComponent();
00031
00032             // Generate the list of contacts.
00033             // Remember to enable the NavigationCacheMode of this Page to avoid
00034             // loading the data every time user navigates back and forward.
00035             Contacts = Contact.GetContacts(140);
00036             if (Contacts.Count > 0)
00037             {
00038                 MasterListView.ItemsSource = Contacts;
00039             }
00040         }
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             // Details view can request an action on return.
00044             // S<id> = select this contact
00045             // D<id> = delete this contact
00046             var param = e.Parameter as string;
00047             if (param != null)
00048             {
00049                 string id = param.Substring(1);
00050                 Contact contact = Contacts.FirstOrDefault(c => c.Id == id);
00051                 if (contact != null)
00052                 {
00053                     MasterListView.SelectedItem = contact;
00054                     if (param[0] == 'D')
00055                     {
00056                         DeleteItem(null, null);
00057                     }
00058                 }
00059             }
00060         }
00061         private void OnLoaded(object sender, RoutedEventArgs e)
00062         {
00063             if (MasterListView.SelectedItem == null && Contacts.Count > 0)
00064             {
00065                 MasterListView.SelectedIndex = 0;
00066             }
00067             // If the app starts in narrow mode - showing only the Master listView -
00068             // it is necessary to set the commands and the selection mode.
00069             if (PageSizeStatesGroup.CurrentState == NarrowState)
00070             {
00071                 VisualStateManager.GoToState(this, MasterState.Name, true);
00072             }
00073             else if (PageSizeStatesGroup.CurrentState == WideState)
00074             {
00075                 // In this case, the app starts is wide mode, Master/Details view.
00076                 // Preserve selection across the state change.
00077                 var item = MasterListView.SelectedItem;
00078                 VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
00079                 MasterListView.SelectedItem = item;
00080             }
00081             else
00082             {
00083                 throw new InvalidOperationException();
00084             }
00085         }
00086         private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
00087         {
00088             bool isNarrow = e.NewState == NarrowState;
00089             if (isNarrow)
00090             {
00091                 Frame.Navigate(typeof(DetailsPage), MasterListView.SelectedItem, new SuppressNavigationTransitionInfo());
00092             }
00093             else
00094             {
00095                 VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
00096                 MasterListView.SelectionMode = ListViewSelectionMode.Extended;
00097             }
00098
00099             EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow);
00100             if (DetailContentPresenter != null)
00101             {
00102                 EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow);
00103             }
00104         }
00105         private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
00106         {
00107             if (PageSizeStatesGroup.CurrentState == WideState)
00108             {
00109                 if (MasterListView.SelectedItems.Count == 1)
00110                 {
00111                     EnableContentTransitions();
00112                 }
00113                 // Entering in Extended selection
00114                 else if (MasterListView.SelectedItems.Count > 1
00115                      && MasterDetailsStatesGroup.CurrentState == MasterDetailsState)
00116                 {
00117                     VisualStateManager.GoToState(this, ExtendedSelectionState.Name, true);
00118                 }
00119             }
00120             // Exiting Extended selection
00121             if (MasterDetailsStatesGroup.CurrentState == ExtendedSelectionState &&
00122                 MasterListView.SelectedItems.Count == 1)
00123             {
00124                 VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
00125             }
00126         }
00127         // ItemClick event only happens when user is a Master state. In this state,
00128         // selection mode is none and click event navigates to the details view.
00129         private void OnItemClick(object sender, ItemClickEventArgs e)
00130         {
00131             // The clicked item it is the new selected contact
00132             var selectedContact = (Contact)e.ClickedItem;
00133             MasterListView.SelectedItem = selectedContact;
00134             if (PageSizeStatesGroup.CurrentState == NarrowState)
00135             {
00136                 // Go to the details page and display the item
00137                 Frame.Navigate(typeof(DetailsPage), selectedContact, new DrillInNavigationTransitionInfo());
00138             }
00139         }
00140         private void EnableContentTransitions()
00141         {
00142             DetailContentPresenter.ContentTransitions.Clear();
00143             DetailContentPresenter.ContentTransitions.Add(new EntranceThemeTransition());
00144         }
00145         #region Commands
00146         private void AddItem(object sender, RoutedEventArgs e)
00147         {
00148             Contacts.Add(Contact.GetNewContact());
00149
00150             // Select this item if the list had been empty.
00151             if (MasterListView.SelectedIndex == -1)
00152             {
00153                 MasterListView.SelectedIndex = 0;
00154                 // Details view might be collapsed if there were no items.
00155                 // Show it now.
00156                 DetailContentPresenter.Visibility = Visibility.Visible;
00157             }
00158         }
00159         private void SelectSomethingIfPossible()
00160         {
00161             if (Contacts.Count > 0)
00162             {
00163                 MasterListView.SelectedIndex = 0;
00164             }
00165             else
00166             {
00167                 // Collapse the Details view if there are no items.
00168                 DetailContentPresenter.Visibility = Visibility.Collapsed;
00169             }
00170         }
00171         private void DeleteItem(object sender, RoutedEventArgs e)
00172         {
00173             int index = MasterListView.SelectedIndex;
00174             if (index != -1)
00175             {
00176                 Contacts.RemoveAt(index);
00177             }
00178             MasterListView.SelectedIndex = Math.Min(index, Contacts.Count - 1);
00179         }
00180
00181         private void DeleteItems(object sender, RoutedEventArgs e)
00182         {
00183             int index;
00184             while ((index = MasterListView.SelectedIndex) != -1)
00185             {
00186                 Contacts.RemoveAt(index);
00187             }
00188         }
00189
00190         private void SelectItems(object sender, RoutedEventArgs e)
00191         {
00192             if (MasterListView.Items.Count > 0)
00193             {
00194                 VisualStateManager.GoToState(this, MultipleSelectionState.Name, true);
00195             }
00196         }
00197         private void CancelSelection(object sender, RoutedEventArgs e)
00198         {
00199             if (PageSizeStatesGroup.CurrentState == NarrowState)
00200             {
00201                 VisualStateManager.GoToState(this, MasterState.Name, true);
00202             }
00203             else
00204             {
00205                 VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
00206             }
00207         }
00208         #endregion
00209     }
00210 }
Generated on Fri Nov 15 2024 22:22:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleSmsBackgroundTask Member List

This is the complete list of members for SampleSmsBackgroundTask, including all inherited members.
DisplayToast(IBackgroundTaskInstance taskInstance) | SampleSmsBackgroundTask | [inline, private]
OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) | SampleSmsBackgroundTask | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | SampleSmsBackgroundTask | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp Source File

  • SpeechRecognitionAndSynthesis
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace  SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Synthesize Text", "SDKTemplate.Scenario_SynthesizeText" },
00021     { "Synthesize Text with Boundaries", "SDKTemplate.Scenario_SynthesizeTextBoundaries" },
00022     { "Synthesize SSML", "SDKTemplate.Scenario_SynthesizeSSML" },
00023     { "Predefined Dictation Grammar", "SDKTemplate.Scenario_PredefinedDictationGrammar" },
00024     { "Predefined WebSearch Grammar", "SDKTemplate.Scenario_PredefinedWebSearchGrammar" },
00025     { "Custom List Constraint", "SDKTemplate.Scenario_ListConstraint" },
00026     { "Custom SRGS Constraint", "SDKTemplate.Scenario_SRGSConstraint" },
00027     { "Continuous Dictation", "SDKTemplate.Scenario_ContinuousDictation" },
00028     { "Continuous List Constraint", "SDKTemplate.Scenario_ContinuousRecognitionListGrammar" },
00029     { "Continuous SRGS Constraint", "SDKTemplate.Scenario_ContinuousRecognitionSRGSGrammar" },
00030     { "PauseAsync to Change Grammars", "SDKTemplate.Scenario_PauseAsync" }
00031 };
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario1_Basics.xaml.cs Source File

  • VersionAdaptiveCode
  • cs

Scenario1_Basics.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.Background;
00014 using Windows.Devices.Sensors;
00015 using Windows.Foundation.Metadata;
00016 using Windows.Phone.UI.Input;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// This page uses methods of the ApiInformation class to detect the presence of
00024     /// types, methods, events, and enumerated values.
00025     /// </summary>
00026     public sealed partial class Scenario1_Basics : Page
00027     {
00028         private MainPage rootPage = MainPage.Current;
00029         private int CameraButtonPressCount = 0;
00030
00031         // Determining presence requires scanning the system metadata.
00032         // Instead of repeating the query, calculate the result once and cache it.
00033         //
00034         // Does the HardwareButtons class have a CameraPressed event?
00035         private bool hasCameraButton =
00036             ApiInformation.IsEventPresent("Windows.Phone.UI.Input.HardwareButtons", "CameraPressed");
00037
00038         // Does the OrientationSensor class have a GetDefault method that takes two parameters?
00039         private bool hasOrientationWithOptimizationGoal =
00040             ApiInformation.IsMethodPresent("Windows.Devices.Sensors.OrientationSensor", "GetDefault", 2);
00041
00042         // Does the BackgroundAccessStatus enum have an AlwaysAllowed value?
00043         private bool hasAlwaysAllowedAccess =
00044             ApiInformation.IsEnumNamedValuePresent("Windows.ApplicationModel.Background.BackgroundAccessStatus", "AlwaysAllowed");
00045
00046         public Scenario1_Basics()
00047         {
00048             this.InitializeComponent();
00049         }
00050
00051         protected override void OnNavigatedTo(NavigationEventArgs e)
00052         {
00053             // If the HardwareButtons.CameraPressed event exists, then register a handler for it.
00054             if (hasCameraButton)
00055             {
00056                 HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
00057             }
00058         }
00059
00060         protected override void OnNavigatedFrom(NavigationEventArgs e)
00061         {
00062             // If the HardwareButtons.CameraPressed event exists, then unregister our handler.
00063             if (hasCameraButton)
00064             {
00065                 HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
00066             }
00067         }
00068
00069         void HardwareButtons_CameraPressed(object sender, CameraEventArgs e)
00070         {
00071             CameraButtonPressCount++;
00072             rootPage.NotifyUser($"Camera button press #{CameraButtonPressCount}", NotifyType.StatusMessage);
00073         }
00074
00075         // For more information on using orientation sensors, see the OrientationSensor sample.
00076         void GetOrientationReport()
00077         {
00078             OrientationSensor sensor;
00079             // If there is a version of GetDefault that lets us specify the optimization goal,
00080             // then use it. Otherwise, use the regular version.
00081             if (hasOrientationWithOptimizationGoal)
00082             {
00083                 sensor = OrientationSensor.GetDefault(SensorReadingType.Absolute, SensorOptimizationGoal.PowerEfficiency);
00084             }
00085             else
00086             {
00087                 sensor = OrientationSensor.GetDefault();
00088             }
00089
00090             if (sensor != null)
00091             {
00092                 OrientationSensorReading reading = sensor.GetCurrentReading();
00093                 SensorQuaternion quaternion = reading.Quaternion;
00094                 rootPage.NotifyUser($"X: {quaternion.X}, Y: {quaternion.Y}, Z: {quaternion.Z}, W: {quaternion.W}", NotifyType.StatusMessage);
00095
00096                 // Restore the default report interval to release resources while the sensor is not in use.
00097                 sensor.ReportInterval = 0;
00098             }
00099             else
00100             {
00101                 rootPage.NotifyUser("Sorry, no sensor found", NotifyType.ErrorMessage);
00102             }
00103         }
00104
00105         // For more information on background activity, see the BackgroundActivity sample.
00106         async void CheckBackgroundAccessStatus()
00107         {
00108             BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
00109
00110             // The Windows 10 Anniversary Update introduced a new background access model.
00111             if (hasAlwaysAllowedAccess)
00112             {
00113                 switch (status)
00114                 {
00115                     case BackgroundAccessStatus.AlwaysAllowed:
00116                     case BackgroundAccessStatus.AllowedSubjectToSystemPolicy:
00117                         rootPage.NotifyUser("Background activity is allowed.", NotifyType.StatusMessage);
00118                         break;
00119
00120                     case BackgroundAccessStatus.Unspecified:
00121                     case BackgroundAccessStatus.DeniedByUser:
00122                     case BackgroundAccessStatus.DeniedBySystemPolicy:
00123                         rootPage.NotifyUser("Background activity is not allowed.", NotifyType.ErrorMessage);
00124                         break;
00125                 }
00126             }
00127             else
00128             {
00129                 // Use the background access model from Windows 10 November 2015 Update and earlier.
00130                 switch (status)
00131                 {
00132                     case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
00133                     case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
00134                         rootPage.NotifyUser("Background activity is allowed.", NotifyType.StatusMessage);
00135                         break;
00136
00137                     case BackgroundAccessStatus.Unspecified:
00138                     case BackgroundAccessStatus.Denied:
00139                         rootPage.NotifyUser("Background activity is not allowed.", NotifyType.ErrorMessage);
00140                         break;
00141                 }
00142             }
00143         }
00144     }
00145 }
Generated on Fri Nov 15 2024 22:20:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario3_ResetPin.xaml.h Source File

  • SmartCard
  • cpp

Scenario3_ResetPin.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario3_ResetPin.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario3_ResetPin sealed
00012     {
00013     public:
00014         Scenario3_ResetPin();
00015     private:
00016         void ResetPin_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017     };
00018 }
Generated on Fri Nov 15 2024 22:21:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario1.h Source File

  • FileThumbnails
  • cppwinrt

Scenario1.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1 : Scenario1T<Scenario1>
00020     {
00021         Scenario1();
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         fire_and_forget GetThumbnailButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario1 : Scenario1T<Scenario1, implementation::Scenario1>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Disable Member List

This is the complete list of members for Scenario2_Disable, including all inherited members.
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_Disable
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_Disable
Scenario2_Disable() | Scenario2_Disable
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario9.xaml.cs Source File

  • SimpleInk
  • cs

Scenario9.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using Windows.UI.Core;
00016 using Windows.UI.Input.Inking;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// This page demonstrates the usage of the InkPresenter APIs. It shows the following functionality:
00025     /// - Stroke Id and StrokeStartedTime/StrokeDuration properties for each stroke collected.
00026     /// - Loading and saving ink files with stroke timestamps.
00027     /// - Using stroke timestamps to replay ink.
00028     /// </summary>
00029     public sealed partial class Scenario9 : Page
00030     {
00031         private MainPage rootPage = MainPage.Current;
00032
00033         const int FPS = 60;
00034
00035         DateTimeOffset beginTimeOfRecordedSession;
00036         DateTimeOffset endTimeOfRecordedSession;
00037         TimeSpan durationOfRecordedSession;
00038         DateTime beginTimeOfReplay;
00039
00040         DispatcherTimer inkReplayTimer;
00041
00042         InkStrokeBuilder strokeBuilder;
00043         IReadOnlyList<InkStroke> strokesToReplay;
00044
00045         public Scenario9()
00046         {
00047             this.InitializeComponent();
00048
00049             inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
00050         }
00051
00052         protected override void OnNavigatedTo(NavigationEventArgs e)
00053         {
00054             // Registering handlers for StrokesCollected event
00055             inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
00056         }
00057
00058         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00059         {
00060             StopReplay();
00061             inkCanvas.InkPresenter.StrokesCollected -= InkPresenter_StrokesCollected;
00062         }
00063
00064         private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs e)
00065         {
00066             IReadOnlyList<InkStroke> strokes = e.Strokes;
00067             string log = $"Strokes collected: {strokes.Count}";
00068             foreach (InkStroke stroke in strokes)
00069             {
00070                 log += $"\nId: {stroke.Id}, StartedTime: {stroke.StrokeStartedTime}, Duration: {stroke.StrokeDuration}";
00071             }
00072             rootPage.NotifyUser(log, NotifyType.StatusMessage);
00073         }
00074
00075         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00076         {
00077             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00078         }
00079
00080         private void OnReset(object sender, RoutedEventArgs e)
00081         {
00082             StopReplay();
00083             inkCanvas.InkPresenter.StrokeContainer.Clear();
00084             ClearCanvasStrokeCache();
00085             rootPage.NotifyUser("Cleared Canvas", NotifyType.StatusMessage);
00086         }
00087
00088         void ClearCanvasStrokeCache()
00089         {
00090             // Workaround for builds prior to 17650.
00091             // Throw away the old inkCanvas and create a new one to avoid accumulation of old strokes.
00092             outputGrid.Children.Remove(inkCanvas);
00093             inkCanvas = new InkCanvas();
00094             outputGrid.Children.Add(inkCanvas);
00095             inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
00096             inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
00097             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00098         }
00099
00100         private void OnReplay(object sender, RoutedEventArgs e)
00101         {
00102             if (strokeBuilder == null)
00103             {
00104                 strokeBuilder = new InkStrokeBuilder();
00105                 inkReplayTimer = new DispatcherTimer();
00106                 inkReplayTimer.Interval = new TimeSpan(TimeSpan.TicksPerSecond / FPS);
00107                 inkReplayTimer.Tick += InkReplayTimer_Tick;
00108             }
00109
00110             strokesToReplay = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
00111
00112             ReplayButton.IsEnabled = false;
00113             inkCanvas.InkPresenter.IsInputEnabled = false;
00114             ClearCanvasStrokeCache();
00115
00116             // Calculate the beginning of the earliest stroke and the end of the latest stroke.
00117             // This establishes the time period during which the strokes were collected.
00118             beginTimeOfRecordedSession = DateTimeOffset.MaxValue;
00119             endTimeOfRecordedSession = DateTimeOffset.MinValue;
00120             foreach (InkStroke stroke in strokesToReplay)
00121             {
00122                 DateTimeOffset? startTime = stroke.StrokeStartedTime;
00123                 TimeSpan? duration = stroke.StrokeDuration;
00124                 if (startTime.HasValue && duration.HasValue)
00125                 {
00126                     if (beginTimeOfRecordedSession > startTime.Value)
00127                     {
00128                         beginTimeOfRecordedSession = startTime.Value;
00129                     }
00130                     if (endTimeOfRecordedSession < startTime.Value + duration.Value)
00131                     {
00132                         endTimeOfRecordedSession = startTime.Value + duration.Value;
00133                     }
00134                 }
00135             }
00136
00137             // If we found at least one stroke with a timestamp, then we can replay.
00138             if (beginTimeOfRecordedSession != DateTimeOffset.MaxValue)
00139             {
00140                 durationOfRecordedSession = endTimeOfRecordedSession - beginTimeOfRecordedSession;
00141
00142                 ReplayProgress.Maximum = durationOfRecordedSession.TotalMilliseconds;
00143                 ReplayProgress.Value = 0.0;
00144                 ReplayProgress.Visibility = Visibility.Visible;
00145
00146                 beginTimeOfReplay = DateTime.Now;
00147                 inkReplayTimer.Start();
00148
00149                 rootPage.NotifyUser("Replay started.", NotifyType.StatusMessage);
00150             }
00151             else
00152             {
00153                 // There was nothing to replay. Either there were no strokes at all,
00154                 // or none of the strokes had timestamps.
00155                 StopReplay();
00156             }
00157         }
00158
00159
00160         private void StopReplay()
00161         {
00162             inkReplayTimer?.Stop();
00163
00164             ReplayButton.IsEnabled = true;
00165             inkCanvas.InkPresenter.IsInputEnabled = true;
00166             ReplayProgress.Visibility = Visibility.Collapsed;
00167
00168         }
00169
00170         private void InkReplayTimer_Tick(object sender, object e)
00171         {
00172             var currentTimeOfReplay = DateTimeOffset.Now;
00173             TimeSpan timeElapsedInReplay = currentTimeOfReplay - beginTimeOfReplay;
00174
00175             ReplayProgress.Value = timeElapsedInReplay.TotalMilliseconds;
00176
00177             DateTimeOffset timeEquivalentInRecordedSession = beginTimeOfRecordedSession + timeElapsedInReplay;
00178             inkCanvas.InkPresenter.StrokeContainer = GetCurrentStrokesView(timeEquivalentInRecordedSession);
00179
00180             if (timeElapsedInReplay > durationOfRecordedSession)
00181             {
00182                 StopReplay();
00183                 rootPage.NotifyUser("Replay finished.", NotifyType.StatusMessage);
00184             }
00185         }
00186
00187         private InkStrokeContainer GetCurrentStrokesView(DateTimeOffset time)
00188         {
00189             var inkStrokeContainer = new InkStrokeContainer();
00190
00191             // The purpose of this sample is to demonstrate the timestamp usage,
00192             // not the algorithm. (The time complexity of the code is O(N^2).)
00193             foreach (InkStroke stroke in strokesToReplay)
00194             {
00195                 InkStroke s = GetPartialStroke(stroke, time);
00196                 if (s != null)
00197                 {
00198                     inkStrokeContainer.AddStroke(s);
00199                 }
00200             }
00201
00202             return inkStrokeContainer;
00203         }
00204
00205         private InkStroke GetPartialStroke(InkStroke stroke, DateTimeOffset time)
00206         {
00207             DateTimeOffset? startTime = stroke.StrokeStartedTime;
00208             TimeSpan? duration = stroke.StrokeDuration;
00209             if (!startTime.HasValue || !duration.HasValue)
00210             {
00211                 // If a stroke does not have valid timestamp, then treat it as
00212                 // having been drawn before the playback started.
00213                 // We must return a clone of the stroke, because a single stroke cannot
00214                 // exist in more than one container.
00215                 return stroke.Clone();
00216             }
00217
00218             if (time < startTime.Value)
00219             {
00220                 // Stroke has not started
00221                 return null;
00222             }
00223
00224             if (time >= startTime.Value + duration.Value)
00225             {
00226                 // Stroke has already ended.
00227                 // We must return a clone of the stroke, because a single stroke cannot exist in more than one container.
00228                 return stroke.Clone();
00229             }
00230
00231             // Stroke has started but not yet ended.
00232             // Create a partial stroke on the assumption that the ink points are evenly distributed in time.
00233             IReadOnlyList<InkPoint> points = stroke.GetInkPoints();
00234             var portion = (time - startTime.Value).TotalMilliseconds / duration.Value.TotalMilliseconds;
00235             var count = (int)((points.Count - 1) * portion) + 1;
00236             return strokeBuilder.CreateStrokeFromInkPoints(points.Take(count), System.Numerics.Matrix3x2.Identity, startTime, time - startTime);
00237         }
00238     }
00239 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/Scenario1_SpellingTextSuggestions.xaml.cpp Source File

  • TouchKeyboardTextInput
  • cpp

Scenario1_SpellingTextSuggestions.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_SpellingTextSuggestions.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Controls;
00021 using namespace Windows::UI::Xaml::Controls::Primitives;
00022 using namespace Windows::UI::Xaml::Data;
00023 using namespace Windows::UI::Xaml::Input;
00024 using namespace Windows::UI::Xaml::Media;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00028
00029 Scenario1_SpellingTextSuggestions::Scenario1_SpellingTextSuggestions()
00030 {
00031     InitializeComponent();
00032 }
Generated on Fri Nov 15 2024 22:21:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.idl Source File

  • LinguisticServices
  • RuntimeComponent

LinguisticServices.idl

Go to the documentation of this file.
00001 namespace Sample
00002 {
00003     struct RecognizedTextRun
00004     {
00005         UInt32 First;
00006         UInt32 Last;
00007         String Script;
00008     };
00009
00010     static runtimeclass LinguisticServices
00011     {
00012         static Windows.Foundation.Collections.IVectorView<String> RecognizeTextLanguages(String text);
00013         static Windows.Foundation.Collections.IVectorView<RecognizedTextRun> RecognizeTextScripts(String text);
00014         static String TransliterateFromCyrillicToLatin(String text);
00015     }
00016 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/Scenario1_Directions.xaml.cs Source File

  • XamlGamepadNavigation
  • cs

Scenario1_Directions.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI.Core;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Input;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario1_Directions : Page
00023     {
00024         public Scenario1_Directions()
00025         {
00026             this.InitializeComponent();
00027         }
00028     }
00029 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Period Member List

This is the complete list of members for Period, including all inherited members.
AddStream(MediaStream stream) | Period | [inline, private]
duration | Period | [private]
Duration | Period | [private]
GetAudioStream() | Period | [inline, private]
GetVideoStream() | Period | [inline, private]
id | Period | [private]
Id | Period | [private]
isSelected | Period | [private]
IsSelected | Period | [private]
m_streams | Period | [private]
Period() | Period | [inline, private]
start | Period | [private]
Start | Period | [private]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario1_SetRecordProfile.xaml.h Source File

  • CameraProfile
  • cpp

Scenario1_SetRecordProfile.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_SetRecordProfile.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_SetRecordProfile sealed
00021     {
00022     public:
00023         Scenario1_SetRecordProfile();
00024
00025     protected:
00026         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027
00028     private:
00029         MainPage^ _rootPage;
00030         void InitRecordProfileBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void InitCustomProfileBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032
00033         Concurrency::task<Platform::String^> GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel panel);
00034
00035         Concurrency::task<void> LogStatusToOutputBoxAsync(Platform::String^ message);
00036         Concurrency::task<void> LogStatusAsync(Platform::String^ message, NotifyType type);
00037         Concurrency::task<void> PrintProfileInformation(Windows::Media::Capture::MediaCaptureVideoProfile^ profile,
00038             Windows::Media::Capture::MediaCaptureVideoProfileMediaDescription^ description);
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/Scenario1_Basic.h Source File

  • ResizeAppView
  • cppwinrt

Scenario1_Basic.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Basic.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Basic : Scenario1_BasicT<Scenario1_Basic>
00020     {
00021         Scenario1_Basic();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         // These methods are public so they can be called by binding.
00027         void ResizeView_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void SetMinimumSize_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032         event_token windowSizeChangedToken;
00033
00034         void UpdateContent();
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario1_Basic : Scenario1_BasicT<Scenario1_Basic, implementation::Scenario1_Basic>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/DeviceResources.h Source File

  • D2DPhotoAdjustment
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetSwapChainPanel(Windows::UI::Xaml::Controls::SwapChainPanel^ panel);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void SetCompositionScale(float compositionScaleX, float compositionScaleY);
00033         void ValidateDevice();
00034         void HandleDeviceLost();
00035         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00036         void Trim();
00037         void Present();
00038
00039         // Device Accessors.
00040         Windows::Foundation::Size   GetOutputSize() const                   { return m_outputSize; }
00041         Windows::Foundation::Size   GetLogicalSize() const                  { return m_logicalSize; }
00042
00043         // D3D Accessors.
00044         ID3D11Device2*              GetD3DDevice() const                    { return m_d3dDevice.Get(); }
00045         ID3D11DeviceContext3*       GetD3DDeviceContext() const             { return m_d3dContext.Get(); }
00046         IDXGISwapChain1*            GetSwapChain() const                    { return m_swapChain.Get(); }
00047         D3D_FEATURE_LEVEL           GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel; }
00048         ID3D11RenderTargetView*     GetBackBufferRenderTargetView() const   { return m_d3dRenderTargetView.Get(); }
00049         ID3D11DepthStencilView*     GetDepthStencilView() const             { return m_d3dDepthStencilView.Get(); }
00050         D3D11_VIEWPORT              GetScreenViewport() const               { return m_screenViewport; }
00051         DirectX::XMFLOAT4X4         GetOrientationTransform3D() const       { return m_orientationTransform3D; }
00052
00053         // D2D Accessors.
00054         ID2D1Factory3*              GetD2DFactory() const                   { return m_d2dFactory.Get(); }
00055         ID2D1Device2*               GetD2DDevice() const                    { return m_d2dDevice.Get(); }
00056         ID2D1DeviceContext2*        GetD2DDeviceContext() const             { return m_d2dContext.Get(); }
00057         ID2D1Bitmap1*               GetD2DTargetBitmap() const              { return m_d2dTargetBitmap.Get(); }
00058         IDWriteFactory2*            GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00059         IWICImagingFactory2*        GetWicImagingFactory() const            { return m_wicFactory.Get(); }
00060         D2D1::Matrix3x2F            GetOrientationTransform2D() const       { return m_orientationTransform2D; }
00061
00062     private:
00063         void CreateDeviceIndependentResources();
00064         void CreateDeviceResources();
00065         void CreateWindowSizeDependentResources();
00066         DXGI_MODE_ROTATION ComputeDisplayRotation();
00067
00068         // Direct3D objects.
00069         Microsoft::WRL::ComPtr<ID3D11Device2>           m_d3dDevice;
00070         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>    m_d3dContext;
00071         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00072
00073         // Direct3D rendering objects. Required for 3D.
00074         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00075         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00076         D3D11_VIEWPORT                                  m_screenViewport;
00077
00078         // Direct2D drawing components.
00079         Microsoft::WRL::ComPtr<ID2D1Factory3>           m_d2dFactory;
00080         Microsoft::WRL::ComPtr<ID2D1Device2>            m_d2dDevice;
00081         Microsoft::WRL::ComPtr<ID2D1DeviceContext2>     m_d2dContext;
00082         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmap;
00083
00084         // DirectWrite drawing components.
00085         Microsoft::WRL::ComPtr<IDWriteFactory2>         m_dwriteFactory;
00086         Microsoft::WRL::ComPtr<IWICImagingFactory2>     m_wicFactory;
00087
00088         // Cached reference to the XAML panel.
00089         Windows::UI::Xaml::Controls::SwapChainPanel^    m_swapChainPanel;
00090
00091         // Cached device properties.
00092         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00093         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00094         Windows::Foundation::Size                       m_outputSize;
00095         Windows::Foundation::Size                       m_logicalSize;
00096         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00097         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00098         float                                           m_dpi;
00099         float                                           m_compositionScaleX;
00100         float                                           m_compositionScaleY;
00101
00102
00103         // Transforms used for display orientation.
00104         D2D1::Matrix3x2F                                m_orientationTransform2D;
00105         DirectX::XMFLOAT4X4                             m_orientationTransform3D;
00106
00107         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00108         IDeviceNotify*                                  m_deviceNotify;
00109     };
00110 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario1_NetworkConnectivity.cpp Source File

  • NetworkConnectivity
  • cppwinrt

Scenario1_NetworkConnectivity.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_NetworkConnectivity.h"
00014 #include "Scenario1_NetworkConnectivity.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Networking::Connectivity;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Controls;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario1_NetworkConnectivity::Scenario1_NetworkConnectivity()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     fire_and_forget Scenario1_NetworkConnectivity::QueryCurrentNetworkConnectivityButton_Click(IInspectable const&, RoutedEventArgs const&)
00033     {
00034         auto lifetime = get_strong();
00035
00036         ResultsText().Text(L"");
00037
00038         ConnectionProfile profile = NetworkInformation::GetInternetConnectionProfile();
00039         NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel::None;
00040         if (profile != nullptr)
00041         {
00042             // It can take the system a few moments to detect a change in network connectivity,
00043             // so it's possible that the value returned is slightly out of date.
00044             // Scenario3_NetworkConnectivityChanges shows how to be notified when the connectivity
00045             // changes.
00046             connectivityLevel = profile.GetNetworkConnectivityLevel();
00047         }
00048
00049         AppendLine(ResultsText(), L"Current connectivity is " + to_hstring(connectivityLevel) + L".");
00050         if (ShouldAttemptToConnectToInternet(connectivityLevel))
00051         {
00052             co_await EvaluateCostAndConnectAsync(profile.GetConnectionCost(), OptedInToNetworkUsageToggle().IsOn(), ResultsText());
00053         }
00054         else
00055         {
00056             AppendLine(ResultsText(), L"Not attempting to connect to the Internet.");
00057         }
00058     }
00059 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/IccDetection.cs Source File

  • Nfc
  • PcscSdk

IccDetection.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.SmartCards;
00014
00015 using Windows.Storage.Streams;
00016 using System.Diagnostics;
00017 using System.Linq;
00018 using System.Runtime.InteropServices.WindowsRuntime;
00019
00020 namespace Pcsc.Common
00021 {
00022     /// <summary>
00023     /// Class used to detect the type of the ICC card detected. It accept a connection object
00024     /// and gets the ATR from the ICC. After the ATR is parsed, the ICC Detection class inspects
00025     /// the historical bytes in order to detect the ICC type as specified by PCSC specification.
00026     /// </summary>
00027     public class IccDetection
00028     {
00029         /// <summary>
00030         /// PCSC device type
00031         /// </summary>
00032         public DeviceClass PcscDeviceClass { set; get; }
00033         /// <summary>
00034         /// PCSC card name provided in the nn short int
00035         /// </summary>
00036         public Pcsc.CardName PcscCardName { set; get; }
00037         /// <summary>
00038         /// ATR byte array
00039         /// </summary>
00040         public byte[] Atr { set; get; }
00041         /// <summary>
00042         /// ATR info holds information about the interface character along other info
00043         /// </summary>
00044         public AtrInfo AtrInformation { set; get; }
00045         /// <summary>
00046         /// smard card object passed in the constructor
00047         /// </summary>
00048         private SmartCard smartCard { set; get; }
00049         /// <summary>
00050         /// Smard card connection passed in the constructor
00051         /// </summary>
00052         private SmartCardConnection connectionObject  { set; get; }
00053         /// <summary>
00054         /// class constructor.
00055         /// </summary>
00056         /// <param name="card">
00057         /// smart card object
00058         /// </param>
00059         /// <param name="connection">
00060         /// connection object to the smard card
00061         /// </param>
00062         public IccDetection(SmartCard card, SmartCardConnection connection)
00063         {
00064             smartCard = card;
00065             connectionObject = connection;
00066             PcscDeviceClass = DeviceClass.Unknown;
00067             PcscCardName = Pcsc.CardName.Unknown;
00068         }
00069         /// <summary>
00070         /// Detects the ICC type by parsing, and analyzing the ATR
00071         /// </summary>
00072         /// <returns>
00073         /// none
00074         /// </returns>
00075         public async System.Threading.Tasks.Task DetectCardTypeAync()
00076         {
00077             try
00078             {
00079                 var atrBuffer = await smartCard.GetAnswerToResetAsync();
00080                 Atr = atrBuffer.ToArray();
00081
00082                 Debug.WriteLine("Status: " + (await smartCard.GetStatusAsync()) + "ATR [" + atrBuffer.Length.ToString() + "] = " + BitConverter.ToString(Atr));
00083
00084                 AtrInformation = AtrParser.Parse(Atr);
00085
00086                 if (AtrInformation != null && AtrInformation.HistoricalBytes.Length > 0)
00087                 {
00088                     DetectCard();
00089                 }
00090             }
00091             catch (Exception e)
00092             {
00093                 Debug.WriteLine(e.Message + e.StackTrace);
00094             }
00095         }
00096         /// <summary>
00097         /// Internal method that analyzes the ATR Historical Bytes,
00098         /// it populate the object with info about the ICC
00099         /// </summary>
00100         private void DetectCard()
00101         {
00102             if (AtrInformation.HistoricalBytes.Length > 1)
00103             {
00104                 byte categoryIndicator;
00105
00106                 using (DataReader reader = DataReader.FromBuffer(AtrInformation.HistoricalBytes))
00107                 {
00108                     categoryIndicator = reader.ReadByte();
00109
00110                     if (categoryIndicator == (byte)CategoryIndicator.StatusInfoPresentInTlv)
00111                     {
00112                         while (reader.UnconsumedBufferLength > 0)
00113                         {
00114                             const byte appIdPresenceIndTag = 0x4F;
00115                             const byte appIdPresenceIndTagLen = 0x0C;
00116
00117                             var tagValue = reader.ReadByte();
00118                             var tagLength = reader.ReadByte();
00119
00120                             if (tagValue == appIdPresenceIndTag && tagLength == appIdPresenceIndTagLen)
00121                             {
00122                                 byte[] pcscRid = { 0xA0, 0x00, 0x00, 0x03, 0x06 };
00123                                 byte[] pcscRidRead = new byte[pcscRid.Length];
00124
00125                                 reader.ReadBytes(pcscRidRead);
00126
00127                                 if (pcscRid.SequenceEqual(pcscRidRead))
00128                                 {
00129                                     byte storageStandard = reader.ReadByte();
00130                                     ushort cardName = reader.ReadUInt16();
00131
00132                                     PcscCardName = (Pcsc.CardName)cardName;
00133                                     PcscDeviceClass = DeviceClass.StorageClass;
00134                                 }
00135
00136                                 reader.ReadBuffer(4); // RFU bytes
00137                             }
00138                             else
00139                             {
00140                                 reader.ReadBuffer(tagLength);
00141                             }
00142                         }
00143                     }
00144                 }
00145             }
00146             else
00147             {
00148                 // Compare with Mifare DesFire card ATR
00149                 byte[] desfireAtr = { 0x3B, 0x81, 0x80, 0x01, 0x80, 0x80 };
00150
00151                 if (Atr.SequenceEqual(desfireAtr))
00152                 {
00153                     PcscDeviceClass = DeviceClass.MifareDesfire;
00154                 }
00155             }
00156         }
00157         /// <summary>
00158         /// Helper enum to hold various constants
00159         /// </summary>
00160         enum CategoryIndicator : byte
00161         {
00162             StatusInfoPresentAtEnd = 0x00,
00163             StatusInfoPresentInTlv = 0x80
00164         }
00165     }
00166 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/DataBinding/IncrementalLoadingBase.cs Source File

  • MediaImport
  • cs
  • DataBinding

IncrementalLoadingBase.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections;
00013 using System.Collections.Generic;
00014 using System.Collections.Specialized;
00015 using System.Linq;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Text;
00018 using System.Threading;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Xaml.Data;
00021
00022 namespace DataBinding
00023 {
00024     // This class can used as a jumpstart for implementing ISupportIncrementalLoading.
00025     // Implementing the ISupportIncrementalLoading interfaces allows you to create a list that loads
00026     //  more data automatically when the user scrolls to the end of of a GridView or ListView.
00027     public abstract class IncrementalLoadingBase : IList, ISupportIncrementalLoading, INotifyCollectionChanged
00028     {
00029         #region IList
00030
00031         public int Add(object value)
00032         {
00033             throw new NotImplementedException();
00034         }
00035
00036         public void Clear()
00037         {
00038             throw new NotImplementedException();
00039         }
00040
00041         public bool Contains(object value)
00042         {
00043             return _storage.Contains(value);
00044         }
00045
00046         public int IndexOf(object value)
00047         {
00048             return _storage.IndexOf(value);
00049         }
00050
00051         public void Insert(int index, object value)
00052         {
00053             throw new NotImplementedException();
00054         }
00055
00056         public bool IsFixedSize
00057         {
00058             get { return false; }
00059         }
00060
00061         public bool IsReadOnly
00062         {
00063             get { return true; }
00064         }
00065
00066         public void Remove(object value)
00067         {
00068             throw new NotImplementedException();
00069         }
00070
00071         public void RemoveAt(int index)
00072         {
00073             throw new NotImplementedException();
00074         }
00075
00076         public object this[int index]
00077         {
00078             get
00079             {
00080                 return _storage[index];
00081             }
00082             set
00083             {
00084                 throw new NotImplementedException();
00085             }
00086         }
00087
00088         public void CopyTo(Array array, int index)
00089         {
00090             ((IList)_storage).CopyTo(array, index);
00091         }
00092
00093         public int Count
00094         {
00095             get { return _storage.Count; }
00096         }
00097
00098         public bool IsSynchronized
00099         {
00100             get { return false; }
00101         }
00102
00103         public object SyncRoot
00104         {
00105             get { throw new NotSupportedException(); }
00106         }
00107
00108         public IEnumerator GetEnumerator()
00109         {
00110             return _storage.GetEnumerator();
00111         }
00112
00113         #endregion
00114
00115         #region ISupportIncrementalLoading
00116
00117         public bool HasMoreItems
00118         {
00119             get { return HasMoreItemsOverride(); }
00120         }
00121
00122         public Windows.Foundation.IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync(uint count)
00123         {
00124             if (_busy)
00125             {
00126                 throw new InvalidOperationException("Only one operation in flight at a time");
00127             }
00128
00129             _busy = true;
00130
00131             return AsyncInfo.Run((c) => LoadMoreItemsAsync(c, count));
00132         }
00133
00134         #endregion
00135
00136         #region INotifyCollectionChanged
00137
00138         public event NotifyCollectionChangedEventHandler CollectionChanged;
00139
00140         #endregion
00141
00142         #region Private methods
00143
00144         async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c, uint count)
00145         {
00146             try
00147             {
00148                 var items = await LoadMoreItemsOverrideAsync(c, count);
00149                 var baseIndex = _storage.Count;
00150
00151                 _storage.AddRange(items);
00152
00153                 // Now notify of the new items
00154                 NotifyOfInsertedItems(baseIndex, items.Count);
00155
00156                 return new LoadMoreItemsResult { Count = (uint)items.Count };
00157             }
00158             finally
00159             {
00160                 _busy = false;
00161             }
00162         }
00163
00164         void NotifyOfInsertedItems(int baseIndex, int count)
00165         {
00166             if (CollectionChanged == null)
00167             {
00168                 return;
00169             }
00170
00171             for (int i = 0; i < count; i++)
00172             {
00173                 var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, _storage[i + baseIndex], i + baseIndex);
00174                 CollectionChanged(this, args);
00175             }
00176         }
00177
00178         #endregion
00179
00180         #region Overridable methods
00181
00182         protected abstract Task<IList<object>> LoadMoreItemsOverrideAsync(CancellationToken c, uint count);
00183         protected abstract bool HasMoreItemsOverride();
00184
00185         #endregion
00186
00187         #region State
00188
00189         List<object> _storage = new List<object>();
00190         bool _busy = false;
00191
00192         #endregion
00193     }
00194 }
Generated on Fri Nov 15 2024 22:20:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario8_UpdateAsync.h Source File

  • SecondaryTiles
  • cppwinrt

Scenario8_UpdateAsync.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario8_UpdateAsync.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario8_UpdateAsync : Scenario8_UpdateAsyncT<Scenario8_UpdateAsync>
00020     {
00021         Scenario8_UpdateAsync();
00022
00023         fire_and_forget UpdateDefaultLogo_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario8_UpdateAsync : Scenario8_UpdateAsyncT<Scenario8_UpdateAsync, implementation::Scenario8_UpdateAsync>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.idl Source File

  • AppServices
  • cppwinrt
  • RandomNumberService

RandomNumberGeneratorTask.idl

Go to the documentation of this file.
00001 namespace RandomNumberService
00002 {
00003     [default_interface]
00004     runtimeclass RandomNumberGeneratorTask : Windows.ApplicationModel.Background.IBackgroundTask
00005     {
00006         RandomNumberGeneratorTask();
00007     } }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/BasicState/CheckAllPropertiesCorrect/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • BasicState
  • CheckAllPropertiesCorrect

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using OneNotifications_UWP.Helpers;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.IO;
00005 using System.Linq;
00006 using System.Runtime.InteropServices.WindowsRuntime;
00007 using Windows.Foundation;
00008 using Windows.Foundation.Collections;
00009 using Windows.UI;
00010 using Windows.UI.Popups;
00011 using Windows.UI.StartScreen;
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Controls.Primitives;
00015 using Windows.UI.Xaml.Data;
00016 using Windows.UI.Xaml.Input;
00017 using Windows.UI.Xaml.Media;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00021
00022 namespace OneNotifications_UWP.ScenarioPages.LiveTiles.BasicState.CheckAllPropertiesCorrect
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class ScenarioElement : UserControl
00028     {
00029         public ScenarioElement()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private string _tileId;
00035
00036         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00037         {
00038             base.IsEnabled = false;
00039
00040             _tileId = DateTime.Now.Ticks.ToString();
00041
00042             SecondaryTile tile = new SecondaryTile(_tileId, "Transparent", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
00043             tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00044             tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00045             tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00046             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00047             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00048             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00049             tile.VisualElements.BackgroundColor = Colors.Transparent;
00050             await tile.RequestCreateAsync();
00051
00052             base.IsEnabled = true;
00053         }
00054     }
00055 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/Project.idl Source File

  • FileSearch
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1 : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Utilities Member List

This is the complete list of members for Utilities, including all inherited members.
GetDeviceType(HidDevice device) | Utilities | [inline, static]
IsSuperMuttDevice(HidDevice device) | Utilities | [inline, static]
NotifyDeviceNotConnected() | Utilities | [inline, static]
SetUpDeviceScenarios(Dictionary< DeviceType, UIElement > scenarios, UIElement scenarioContainer) | Utilities | [inline, static]
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/pch.cpp Source File

  • Inclinometer
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks/Common/NavigationService.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks
  • Common

NavigationService.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace AdventureWorks.Common
00020 {
00021     /// <summary>
00022     /// Navigation system that decouples the View Model from knowledge of the View for navigation
00023     /// purposes. This class can be replaced with a simple mock implementation for test purposes.
00024     /// </summary>
00025     public class NavigationService : INavigationService
00026     {
00027         /// <summary>
00028         /// Keep track of the main Frame object, so we can issue Navigation calls to it, without
00029         /// the view models needing to maintain a reference to the views.
00030         /// </summary>
00031         private readonly Frame frame;
00032
00033         public NavigationService(Frame frame)
00034         {
00035             this.frame = frame;
00036         }
00037
00038         /// <summary>
00039         /// Navigate to the target page of type T
00040         /// </summary>
00041         /// <typeparam name="T">Type of the view to navigate to.</typeparam>
00042         /// <param name="parameter">Any parameters to pass to the newly loaded view</param>
00043         /// <returns></returns>
00044         public bool Navigate<T>(object parameter = null)
00045         {
00046             var type = typeof(T);
00047
00048             return Navigate(type, parameter);
00049         }
00050
00051         /// <summary>
00052         /// Navigate to the target page of the specified type.
00053         /// </summary>
00054         /// <param name="t">Type of the view to navigate to.</typeparam>
00055         /// <param name="parameter">Any parameters to pass to the newly loaded view</param>
00056         /// <returns></returns>
00057         public bool Navigate(Type t, object parameter = null)
00058         {
00059             return frame.Navigate(t, parameter);
00060         }
00061
00062         /// <summary>
00063         ///  Goes back a page in the back stack.
00064         /// </summary>
00065         public void GoBack()
00066         {
00067             frame.GoBack();
00068         }
00069     }
00070 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OmnidirectionalSound Member List

This is the complete list of members for OmnidirectionalSound, including all inherited members.
_angle | OmnidirectionalSound | [private]
_audioFile | OmnidirectionalSound | [private]
_audioStream | OmnidirectionalSound | [private]
_duration | OmnidirectionalSound | [private]
_environment | OmnidirectionalSound | [private]
_hrtfParams | OmnidirectionalSound | [private]
_hrtfParams | OmnidirectionalSound | [private]
_initStatus | OmnidirectionalSound | [private]
_lastTick | OmnidirectionalSound | [private]
_sourceType | OmnidirectionalSound | [private]
_sourceVoice | OmnidirectionalSound | [private]
_xaudio2 | OmnidirectionalSound | [private]
_xaudio2 | OmnidirectionalSound | [private]
ComputePositionInOrbit(_In_ float height, _In_ float radius, _In_ float angle) | OmnidirectionalSound | [private]
ComputePositionInOrbit(_In_ float height, _In_ float radius, _In_ float angle) | OmnidirectionalSound | [private]
File enum value | OmnidirectionalSound | [private]
GetDuration() | OmnidirectionalSound | [inline]
GetEnvironment() | OmnidirectionalSound | [inline]
GetEnvironment() | OmnidirectionalSound | [inline]
GetInitializationStatus() | OmnidirectionalSound | [inline]
Initialize(_In_ LPCWSTR filename, UINT32 const &loopCount) | OmnidirectionalSound |
Initialize(Windows::Media::SpeechSynthesis::SpeechSynthesisStream^stream, UINT32 const &loopCount) | OmnidirectionalSound |
Initialize(_In_ LPCWSTR filename) | OmnidirectionalSound |
OnUpdate(_In_ float angularVelocity, _In_ float height, _In_ float radius) | OmnidirectionalSound |
OnUpdate(_In_ Windows::Foundation::Numerics::float3 transform) | OmnidirectionalSound |
OnUpdate(_In_ float angularVelocity, _In_ float height, _In_ float radius) | OmnidirectionalSound |
SetEnvironment(_In_ HrtfEnvironment environment) | OmnidirectionalSound |
SetEnvironment(_In_ HrtfEnvironment environment) | OmnidirectionalSound |
SoundSourceType enum name | OmnidirectionalSound | [private]
Start() | OmnidirectionalSound |
Start() | OmnidirectionalSound |
Stop() | OmnidirectionalSound |
Stop() | OmnidirectionalSound |
Stream enum value | OmnidirectionalSound | [private]
~OmnidirectionalSound() | OmnidirectionalSound | [virtual]
~OmnidirectionalSound() | OmnidirectionalSound | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario7_SyncDevice.xaml.cs Source File

  • CustomUsbDeviceAccess
  • cs

Scenario7_SyncDevice.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Background;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Storage;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022 using SDKTemplate;
00023
00024 namespace CustomUsbDeviceAccess
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class Scenario7_SyncDevice : Page
00030     {
00031         static private DeviceUseTrigger syncBackgroundTaskTrigger = null;
00032
00033         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00034         // as NotifyUser()
00035         private MainPage rootPage = MainPage.Current;
00036
00037         private BackgroundTaskRegistration backgroundSyncTaskRegistration;
00038         private Boolean isSyncing;
00039
00040         private DeviceInformation syncDeviceInformation;
00041         private String syncDeviceSelector;
00042
00043         // Indicate if we navigate away from this page or not.
00044         private Boolean navigatedAway;
00045
00046         /// <summary>
00047         /// Determine if task with given name requires background access. Windows Phone apps always require
00048         /// special permission to run background tasks.
00049         /// </summary>
00050         public static bool TaskRequiresBackgroundAccess()
00051         {
00052 #if WINDOWS_PHONE_APP
00053             return true;
00054 #else
00055             return false;
00056 #endif
00057         }
00058
00059         public Scenario7_SyncDevice()
00060         {
00061             navigatedAway = false;
00062             isSyncing = false;
00063
00064             // Save trigger so that we may start the background task later
00065             // Only one instance of the trigger can exist at a time. Since the trigger does not implement
00066             // IDisposable, it may still be in memory when a new trigger is created.
00067             if (syncBackgroundTaskTrigger == null)
00068             {
00069                 syncBackgroundTaskTrigger = new DeviceUseTrigger();
00070             }
00071
00072             this.InitializeComponent();
00073         }
00074
00075         /// <summary>
00076         /// Invoked when this page is about to be displayed in a Frame.
00077         ///
00078         /// We will enable/disable parts of the UI if the device doesn't support it.
00079         /// </summary>
00080         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00081         /// property is typically used to configure the page.</param>
00082         protected override void OnNavigatedTo(NavigationEventArgs e)
00083         {
00084             navigatedAway = false;
00085
00086             // Both the OSRFX2 and the SuperMutt use the same scenario
00087             // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00088             Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
00089             deviceScenarios.Add(DeviceType.OsrFx2, GeneralScenario);
00090             deviceScenarios.Add(DeviceType.SuperMutt, GeneralScenario);
00091
00092             Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00093
00094             // Unregister any existing tasks that persisted; there should be none unless the app closed/crashed
00095             var existingSyncTask = FindSyncTask();
00096             if (existingSyncTask != null)
00097             {
00098                 existingSyncTask.Unregister(true);
00099             }
00100
00101             isSyncing = false;
00102
00103             UpdateButtonStates();
00104         }
00105
00106         /// <summary>
00107         /// Cancel the background task so the device can be reopened
00108         /// </summary>
00109         /// <param name="eventArgs"></param>
00110         protected override void OnNavigatedFrom(NavigationEventArgs eventArgs)
00111         {
00112             navigatedAway = true;
00113
00114             CancelSyncWithDevice();
00115         }
00116
00117         /// <summary>
00118         /// Search all the existing background tasks for the sync task
00119         /// </summary>
00120         /// <returns>If found, the background task registration for the sync task; else, null.</returns>
00121         BackgroundTaskRegistration FindSyncTask()
00122         {
00123             foreach (var backgroundTask in BackgroundTaskRegistration.AllTasks.Values)
00124             {
00125                 if (backgroundTask.Name == SyncBackgroundTaskInformation.Name)
00126                 {
00127                     return (BackgroundTaskRegistration)backgroundTask;
00128                 }
00129             }
00130
00131             return null;
00132         }
00133
00134         private void CancelSyncWithDevice()
00135         {
00136             if (isSyncing)
00137             {
00138                 backgroundSyncTaskRegistration.Unregister(true);
00139
00140                 backgroundSyncTaskRegistration = null;
00141
00142                 // We are canceling the task, so we are no longer syncing. If the task is registered but never run,
00143                 // the cancel completion is never called
00144                 isSyncing = false;
00145             }
00146         }
00147
00148         /// <summary>
00149         /// Registers for background task that will write to the device.
00150         /// </summary>
00151         private async Task SetupBackgroundTask()
00152         {
00153             if (TaskRequiresBackgroundAccess())
00154             {
00155                 await BackgroundExecutionManager.RequestAccessAsync();
00156             }
00157
00158             // Create background task to write
00159             var backgroundTaskBuilder = new BackgroundTaskBuilder();
00160
00161             backgroundTaskBuilder.Name = SyncBackgroundTaskInformation.Name;
00162             backgroundTaskBuilder.TaskEntryPoint = SyncBackgroundTaskInformation.TaskEntryPoint;
00163             backgroundTaskBuilder.SetTrigger(syncBackgroundTaskTrigger);
00164             backgroundSyncTaskRegistration = backgroundTaskBuilder.Register();
00165
00166             // Make sure we're notified when the task completes or if there is an update
00167             backgroundSyncTaskRegistration.Completed += new BackgroundTaskCompletedEventHandler(OnSyncWithDeviceCompleted);
00168             backgroundSyncTaskRegistration.Progress += new BackgroundTaskProgressEventHandler(OnSyncWithDeviceProgress);
00169         }
00170
00171         /// <summary>
00172         /// Starts the background task that syncs with the device
00173         ///
00174         /// The trigger.RequestAsync() must be started on the UI thread because of the prompt that appears. The caller of StartSyncBackgroundTaskAsync()
00175         /// is responsible for running this method in the UI thread.
00176         /// </summary>
00177         /// <returns></returns>
00178         private Task<DeviceTriggerResult> StartSyncBackgroundTaskAsync()
00179         {
00180             // Save the current device information so that we can reopen it after syncing
00181             syncDeviceInformation = EventHandlerForDevice.Current.DeviceInformation;
00182             syncDeviceSelector = EventHandlerForDevice.Current.DeviceSelector;
00183
00184             // Allow the background task to open the device and sync with it.
00185             // We must close the device because Background tasks need to create new handle to the device and cannot reuse the one from this app.
00186             // Since the device is opened exclusively, the app must close the device before the background task can use the device.
00187             EventHandlerForDevice.Current.CloseDevice();
00188
00189             return syncBackgroundTaskTrigger.RequestAsync(syncDeviceInformation.Id).AsTask();
00190         }
00191
00192
00193         /// <summary>
00194         /// Starts the background task that will sync with the device.
00195         /// </summary>
00196         /// <returns></returns>
00197         private async Task SyncWithDeviceAsync()
00198         {
00199             await SetupBackgroundTask();
00200
00201             var deviceTriggerResult = await StartSyncBackgroundTaskAsync();
00202
00203             // Determine if we are allowed to sync
00204             String errorMessage = null;
00205
00206             switch (deviceTriggerResult)
00207             {
00208                 case DeviceTriggerResult.Allowed:
00209                     isSyncing = true;
00210                     break;
00211
00212                 case DeviceTriggerResult.LowBattery:
00213                     isSyncing = false;
00214                     errorMessage = "Insufficient battery to start sync";
00215                     break;
00216
00217                 case DeviceTriggerResult.DeniedByUser:
00218                     isSyncing = false;
00219                     errorMessage = "User declined the operation";
00220                     break;
00221
00222                 case DeviceTriggerResult.DeniedBySystem:
00223                     isSyncing = false;
00224                     errorMessage = "Sync operation was denied by the system";
00225                     break;
00226
00227                 default:
00228                     isSyncing = false;
00229                     errorMessage = "Failed to initiate sync";
00230                     break;
00231             }
00232
00233             // Reopen device and print error message
00234             if (!isSyncing && errorMessage != null)
00235             {
00236                 // Reopen the device once the background task is completed
00237                 // Don't attempt to reconnect if the device failed to connect
00238                 var isDeviceSuccessfullyConnected = await EventHandlerForDevice.Current.OpenDeviceAsync(syncDeviceInformation, syncDeviceSelector);
00239
00240                 if (!isDeviceSuccessfullyConnected)
00241                 {
00242                     EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
00243                 }
00244
00245                 syncDeviceInformation = null;
00246                 syncDeviceSelector = null;
00247
00248                 rootPage.NotifyUser("Unable to sync: " + errorMessage, NotifyType.ErrorMessage);
00249             }
00250         }
00251
00252         /// <summary>
00253         /// Reopen the device after the background task is done syncing. Notify the UI of how many bytes we wrote to the device.
00254         /// </summary>
00255         /// <param name="sender"></param>
00256         /// <param name="args"></param>
00257         private async void OnSyncWithDeviceCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
00258         {
00259             isSyncing = false;
00260
00261             // Exception may be thrown if an error occurs during running the background task
00262             args.CheckResult();
00263
00264             await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00265                 new DispatchedHandler(async () =>
00266                 {
00267                     // Reopen the device once the background task is completed
00268                     // Don't attempt to reconnect if the device failed to connect
00269                     var isDeviceSuccessfullyConnected = await EventHandlerForDevice.Current.OpenDeviceAsync(syncDeviceInformation, syncDeviceSelector);
00270
00271                     if (!isDeviceSuccessfullyConnected)
00272                     {
00273                         EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
00274                     }
00275
00276                     syncDeviceInformation = null;
00277                     syncDeviceSelector = null;
00278
00279                     // Since we are navigating away, don't touch the UI; we don't care what the output/result of the background task is
00280                     if (!navigatedAway)
00281                     {
00282                         var taskCompleteStatus = (String)ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskStatus];
00283
00284                         if (taskCompleteStatus == SyncBackgroundTaskInformation.TaskCompleted)
00285                         {
00286                             UInt32 totalBytesWritten = (UInt32)ApplicationData.Current.LocalSettings.Values[LocalSettingKeys.SyncBackgroundTaskResult];
00287
00288                             // Set the progress bar to be completely filled in case the progress was not updated (this can happen if the app is suspended)
00289                             SyncProgressBar.Value = 100;
00290
00291                             rootPage.NotifyUser("Sync: Wrote " + totalBytesWritten.ToString() + " bytes to the device", NotifyType.StatusMessage);
00292                         }
00293                         else if (taskCompleteStatus == SyncBackgroundTaskInformation.TaskCanceled)
00294                         {
00295                             // Reset the progress bar in case the progress was not updated (this can happen if the app is suspended)
00296                             SyncProgressBar.Value = 0;
00297
00298                             rootPage.NotifyUser("Syncing was canceled", NotifyType.StatusMessage);
00299                         }
00300
00301                         UpdateButtonStates();
00302                     }
00303
00304                     // Remove all local setting values
00305                     ApplicationData.Current.LocalSettings.Values.Clear();
00306                 }));
00307
00308             // Unregister the background task and let the remaining task finish until completion
00309             if (backgroundSyncTaskRegistration != null)
00310             {
00311                 backgroundSyncTaskRegistration.Unregister(false);
00312             }
00313         }
00314
00315         /// <summary>
00316         /// Updates the UI with the progress of the sync
00317         /// </summary>
00318         /// <param name="sender"></param>
00319         /// <param name="args"></param>
00320         private async void OnSyncWithDeviceProgress(BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args)
00321         {
00322             await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00323                 new DispatchedHandler(() =>
00324                 {
00325                     SyncProgressBar.Value = args.Progress;
00326                 }));
00327         }
00328
00329         private async void Sync_Click(object sender, RoutedEventArgs e)
00330         {
00331             if (EventHandlerForDevice.Current.IsDeviceConnected)
00332             {
00333                 rootPage.NotifyUser("Syncing in the background...", NotifyType.StatusMessage);
00334
00335                 // Reset progress bar
00336                 SyncProgressBar.Value = 0;
00337
00338                 await SyncWithDeviceAsync();
00339
00340                 UpdateButtonStates();
00341             }
00342             else
00343             {
00344                 Utilities.NotifyDeviceNotConnected();
00345             }
00346         }
00347
00348         private void CancelSync_Click(object sender, RoutedEventArgs e)
00349         {
00350             if (isSyncing)
00351             {
00352                 CancelSyncWithDevice();
00353
00354                 UpdateButtonStates();
00355             }
00356             else
00357             {
00358                 Utilities.NotifyDeviceNotConnected();
00359             }
00360         }
00361
00362         private void UpdateButtonStates()
00363         {
00364             ButtonSync.IsEnabled = !isSyncing;
00365             ButtonCancelSync.IsEnabled = isSyncing;
00366         }
00367     }
00368 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario2_Stats.xaml.cpp Source File

  • Calendar
  • cpp

Scenario2_Stats.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario2_Stats.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Globalization;
00021
00022 Scenario2_Stats::Scenario2_Stats()
00023 {
00024     InitializeComponent();
00025 }
00026
00027 String^ Scenario2_Stats::ReportCalendarData(Calendar^ calendar, String^ calendarLabel)
00028 {
00029     String^ results = calendarLabel + ": " + calendar->GetCalendarSystem() + "\n";
00030     results += "Months in this Year: " + calendar->NumberOfMonthsInThisYear + "\n";
00031     results += "Days in this Month: " + calendar->NumberOfDaysInThisMonth + "\n";
00032     results += "Hours in this Period: " + calendar->NumberOfHoursInThisPeriod + "\n";
00033     results += "Era: " + calendar->EraAsString() + "\n";
00034     results += "\n";
00035     return results;
00036 }
00037
00038
00039 void Scenario2_Stats::ShowResults_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00040 {
00041     // This scenario uses the Windows.Globalization.Calendar class to display the parts of a date.
00042
00043     // Create Calendar objects using different constructors.
00044     Calendar^ calendar = ref new Calendar();
00045     Calendar^ japaneseCalendar = ref new Calendar(ref new Vector<String^>({ "ja-JP" }), CalendarIdentifiers::Japanese, ClockIdentifiers::TwelveHour);
00046     Calendar^ hebrewCalendar = ref new Calendar(ref new Vector<String^>({ "he-IL" }), CalendarIdentifiers::Hebrew, ClockIdentifiers::TwentyFourHour);
00047
00048     // Display the results
00049     OutputTextBlock->Text =
00050         ReportCalendarData(calendar, "User's default calendar system") +
00051         ReportCalendarData(japaneseCalendar, "Calendar system") +
00052         ReportCalendarData(hebrewCalendar, "Calendar system");
00053 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cs/Scenario06_PostMultipart.xaml.cs Source File

  • HttpClient
  • cs

Scenario06_PostMultipart.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.Web.Http;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario06_PostMultipart : Page
00023     {
00024         MainPage rootPage = MainPage.Current;
00025
00026         private HttpClient httpClient;
00027         private CancellationTokenSource cts;
00028         public Scenario06_PostMultipart()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             httpClient = Helpers.CreateHttpClientWithPlugIn();
00036             cts = new CancellationTokenSource();
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             cts.Cancel();
00042             cts.Dispose();
00043             httpClient.Dispose();
00044         }
00045
00046         private async void Start_Click(object sender, RoutedEventArgs e)
00047         {
00048             // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00049             // valid, absolute URI, we'll notify the user about the incorrect input.
00050             Uri resourceUri = Helpers.TryParseHttpUri(AddressField.Text);
00051             if (resourceUri == null)
00052             {
00053                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00054                 return;
00055             }
00056
00057             Helpers.ScenarioStarted(StartButton, CancelButton, OutputField);
00058             rootPage.NotifyUser("In progress", NotifyType.StatusMessage);
00059
00060             HttpMultipartFormDataContent form = new HttpMultipartFormDataContent();
00061             form.Add(new HttpStringContent(RequestBodyField.Text), "data");
00062
00063             // This sample uses a "try" in order to support TaskCanceledException.
00064             // If you don't need to support cancellation, then the "try" is not needed.
00065             try
00066             {
00067                 HttpRequestResult result = await httpClient.TryPostAsync(resourceUri, form).AsTask(cts.Token);
00068
00069                 if (result.Succeeded)
00070                 {
00071                     await Helpers.DisplayTextResultAsync(result.ResponseMessage, OutputField, cts.Token);
00072
00073                     rootPage.NotifyUser("Completed", NotifyType.StatusMessage);
00074                 }
00075                 else
00076                 {
00077                     Helpers.DisplayWebError(rootPage, result.ExtendedError);
00078                 }
00079             }
00080             catch (TaskCanceledException)
00081             {
00082                 rootPage.NotifyUser("Request canceled.", NotifyType.ErrorMessage);
00083             }
00084
00085             Helpers.ScenarioCompleted(StartButton, CancelButton);
00086         }
00087
00088         private void Cancel_Click(object sender, RoutedEventArgs e)
00089         {
00090             cts.Cancel();
00091             cts.Dispose();
00092
00093             // Re-create the CancellationTokenSource.
00094             cts = new CancellationTokenSource();
00095         }
00096     }
00097 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S2_UpdateAndDeleteWithAPI.xaml.h Source File

  • ContentIndexer
  • cpp

S2_UpdateAndDeleteWithAPI.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S2_UpdateAndDeleteWithAPI.xaml.h
00014 // Declaration of the S2_UpdateAndDeleteWithAPI class
00015 //
00016
00017 #pragma once
00018 #include "S2_UpdateAndDeleteWithAPI.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S2_UpdateAndDeleteWithAPI sealed
00023     {
00024     public:
00025         S2_UpdateAndDeleteWithAPI();
00026
00027     private:
00028         void AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void UpdatePropertyHelper(Platform::String^ itemKey, Platform::String^ propertyKey, Platform::String^ propertyName, Platform::Object^ newValue);
00030         void UpdateName_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void DeleteKeywords_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void DeleteItemsHelper(std::function<Windows::Foundation::IAsyncAction^(Windows::Storage::Search::ContentIndexer^)> deleteFunction);
00033         void DeleteSingleItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void DeleteMultipleItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035         void DeleteAllItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036     };
00037 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.h Source File

  • WebAccountManagement
  • cpp

Scenario5_ManyProvidersManyAccounts.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario5_ManyProvidersManyAccounts.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// The fifth scenario. Covers keeping and managing multiple active accounts and multiple account provider types.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario5_ManyProvidersManyAccounts sealed
00015     {
00016     public:
00017         Scenario5_ManyProvidersManyAccounts();
00018     protected:
00019         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override;
00020     private:
00021         MainPage^ rootPage;
00022         void Button_AddNewAccount_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00023         void Button_ManageSignedInAccounts_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00024         void Button_Reset_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00025         void CreateLocalDataContainers();
00026         void InitalizeAccountsControlDialog();
00027         void CleanupAccountsControlDialog();
00028         void OnAccountCommandsRequested(Windows::UI::ApplicationSettings::AccountsSettingsPane^ sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^ e);
00029         void GetProviders();
00030         void GetAccounts();
00031         void LoadAccounts();
00032         void AddWebAccountProviders(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00033         void AddWebAccounts(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00034         void AddLinksAndDescription(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00035         void WebAccountProviderCommandInvoked(Windows::UI::ApplicationSettings::WebAccountProviderCommand^ command);
00036         void WebAccountCommandInvoked(Windows::UI::ApplicationSettings::WebAccountCommand ^ command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^ args);
00037         void PrivacyPolicyInvoked(Windows::UI::Popups::IUICommand^ command);
00038         void OtherLinkInvoked(Windows::UI::Popups::IUICommand ^ command);
00039         void AuthenticateWithRequestToken(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID);
00040         void OutputTokenResult(Windows::Security::Authentication::Web::Core::WebTokenRequestResult ^ result);
00041         void SaveAccount(Windows::Security::Credentials::WebAccount^ account);
00042         Windows::Foundation::IAsyncAction^ LogoffAndRemoveAccount(Windows::Security::Credentials::WebAccount ^ account);
00043         void LogoffAndRemoveAllAccounts();
00044
00045         Platform::String^ MICROSOFT_PROVIDER_ID = "https://login.microsoft.com";
00046         Platform::String^ CONSUMER_AUTHORITY = "consumers";
00047         Platform::String^ ORGANIZATION_AUTHORITY = "organizations";
00048         Platform::String^ MSA_SCOPE_REQUESTED = "wl.basic";
00049         Platform::String^ MSA_CLIENT_ID = "none";
00050         Platform::String^ AAD_SCOPE_REQUESTED = "";
00051         Platform::String^ AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb";
00052         Platform::String^ ACCOUNTS_CONTAINER = "accountssettingscontainer";
00053         Platform::String^ PROVIDER_ID_SUBCONTAINER = "providers";
00054         Platform::String^ AUTHORITY_SUBCONTAINER = "authorities";
00055         Platform::String^ APP_SPECIFIC_PROVIDER_ID = "myproviderid";
00056         Platform::String^ APP_SPECIFIC_PROVIDER_NAME = "App specific provider";
00057         Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccountProvider^>^ m_providers;
00058         Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccount^>^ m_accounts;
00059         Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken;
00060         enum AccountAction { AddAccount, ManageAccount };
00061         AccountAction m_selectedAccountAction;
00062     };
00063 }
Generated on Fri Nov 15 2024 22:21:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cppwinrt/Scenario2_Listen.cpp Source File

  • IoT-GPIO
  • cppwinrt

Scenario2_Listen.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Listen.h"
00014 #include "Scenario2_Listen.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace std::literals::chrono_literals;
00018 using namespace winrt;
00019 using namespace winrt::Windows::Devices::Enumeration;
00020 using namespace winrt::Windows::Devices::Gpio;
00021 using namespace winrt::Windows::Foundation;
00022 using namespace winrt::Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario2_Listen::Scenario2_Listen()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario2_Listen::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&)
00032     {
00033         StopScenario();
00034     }
00035
00036     void Scenario2_Listen::StartScenario()
00037     {
00038         // Initialize the GPIO objects.
00039         GpioController gpio = GpioController::GetDefault();
00040
00041         // Set up our GPIO pin for setting values.
00042         // If this next line crashes with a NullReferenceException,
00043         // then the problem is that there is no GPIO controller on the device.
00044         setPin = gpio.OpenPin(SET_PIN);
00045
00046         // Establish initial value and configure pin for output.
00047         setPin.Write(currentValue);
00048         setPin.SetDriveMode(GpioPinDriveMode::Output);
00049
00050         // Set up our GPIO pin for listening for value changes.
00051         listenPin = gpio.OpenPin(LISTEN_PIN);
00052
00053         // Configure pin for input and add ValueChanged listener.
00054         listenPin.SetDriveMode(GpioPinDriveMode::Input);
00055         valueChangedEventToken = listenPin.ValueChanged({ get_weak(), &Scenario2_Listen::Pin_ValueChanged });
00056
00057         // Start toggling the pin value every 500ms.
00058         timer = DispatcherTimer();
00059         timer.Interval(500ms);
00060         timerEventToken = timer.Tick({ get_weak(), &Scenario2_Listen::Timer_Tick });
00061         timer.Start();
00062     }
00063
00064     void Scenario2_Listen::StopScenario()
00065     {
00066         // Stop the timer.
00067         if (timer != nullptr)
00068         {
00069             timer.Tick(timerEventToken);
00070             timer.Stop();
00071             timer = nullptr;
00072         }
00073
00074         // Release the GPIO pins.
00075         if (setPin != nullptr)
00076         {
00077             setPin.Close();
00078             setPin = nullptr;
00079         }
00080         if (listenPin != nullptr)
00081         {
00082             listenPin.ValueChanged(valueChangedEventToken);
00083             listenPin.Close();
00084             listenPin = nullptr;
00085         }
00086     }
00087
00088     void Scenario2_Listen::StartStopScenario_Click(IInspectable const&, RoutedEventArgs const&)
00089     {
00090         if (timer != nullptr)
00091         {
00092             StopScenario();
00093             StartStopButton().Content(box_value(L"Start"));
00094             ScenarioControls().Visibility(Visibility::Collapsed);
00095         }
00096         else
00097         {
00098             StartScenario();
00099             StartStopButton().Content(box_value(L"Stop"));
00100             ScenarioControls().Visibility(Visibility::Visible);
00101         }
00102     }
00103
00104     fire_and_forget Scenario2_Listen::Pin_ValueChanged(GpioPin const& sender, GpioPinValueChangedEventArgs const& e)
00105     {
00106         auto lifetime = get_strong();
00107
00108         // Report the change in pin value.
00109         co_await resume_foreground(Dispatcher());
00110         CurrentPinValue().Text(PinValueToString(listenPin.Read()));;
00111     }
00112
00113     void Scenario2_Listen::Timer_Tick(IInspectable const&, IInspectable const&)
00114     {
00115         // Toggle the existing pin value.
00116         currentValue = (currentValue == GpioPinValue::High) ? GpioPinValue::Low : GpioPinValue::High;
00117         setPin.Write(currentValue);
00118     }
00119 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/App.xaml.cs Source File

  • CameraStarterKit
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.Activation;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 namespace CameraStarterKit
00019 {
00020     /// <summary>
00021     /// Provides application-specific behavior to supplement the default Application class.
00022     /// </summary>
00023     sealed partial class App : Application
00024     {
00025         /// <summary>
00026         /// Initializes the singleton application object.  This is the first line of authored code
00027         /// executed, and as such is the logical equivalent of main() or WinMain().
00028         /// </summary>
00029         public App()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when the application is launched normally by the end user.  Other entry points
00036         /// will be used such as when the application is launched to open a specific file.
00037         /// </summary>
00038         /// <param name="e">Details about the launch request and process.</param>
00039         protected override void OnLaunched(LaunchActivatedEventArgs e)
00040         {
00041
00042 #if DEBUG
00043             if (System.Diagnostics.Debugger.IsAttached)
00044             {
00045                 this.DebugSettings.EnableFrameRateCounter = true;
00046             }
00047 #endif
00048
00049             Frame rootFrame = Window.Current.Content as Frame;
00050
00051             // Do not repeat app initialization when the Window already has content,
00052             // just ensure that the window is active
00053             if (rootFrame == null)
00054             {
00055                 // Create a Frame to act as the navigation context and navigate to the first page
00056                 rootFrame = new Frame();
00057                 // Set the default language
00058                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00059
00060                 rootFrame.NavigationFailed += OnNavigationFailed;
00061
00062                 // Place the frame in the current Window
00063                 Window.Current.Content = rootFrame;
00064             }
00065
00066             if (rootFrame.Content == null)
00067             {
00068                 // When the navigation stack isn't restored navigate to the first page,
00069                 // configuring the new page by passing required information as a navigation
00070                 // parameter
00071                 rootFrame.Navigate(typeof(MainPage), e.Arguments);
00072             }
00073             // Ensure the current window is active
00074             Window.Current.Activate();
00075         }
00076
00077         /// <summary>
00078         /// Invoked when Navigation to a certain page fails
00079         /// </summary>
00080         /// <param name="sender">The Frame which failed navigation</param>
00081         /// <param name="e">Details about the navigation failure</param>
00082         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00083         {
00084             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00085         }
00086     }
00087 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario5_VerifyResponse.cpp Source File

  • SmartCard
  • cppwinrt

Scenario5_VerifyResponse.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_VerifyResponse.h"
00014 #include "Scenario5_VerifyResponse.g.cpp"
00015
00016 namespace winrt
00017 {
00018     using namespace Windows::Foundation;
00019     using namespace Windows::Storage::Streams;
00020     using namespace Windows::Devices::SmartCards;
00021     using namespace Windows::Security::Cryptography;
00022     using namespace Windows::UI::Xaml;
00023     using namespace Windows::UI::Xaml::Controls;
00024 }
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario5_VerifyResponse::Scenario5_VerifyResponse()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     /// <summary>
00034     /// Click handler for the 'VerifyResponse' button.
00035     /// </summary>
00036     /// <param name="sender"></param>
00037     /// <param name="e"></param>
00038
00039     fire_and_forget Scenario5_VerifyResponse::VerifyResponse_Click(IInspectable const& sender, RoutedEventArgs const& e)
00040     {
00041         auto lifetime = get_strong();
00042
00043         if (!ValidateTPMSmartCard())
00044         {
00045             m_rootPage.NotifyUser(L"Use Scenario One to create a TPM virtual smart card.", NotifyType::ErrorMessage);
00046             return;
00047         }
00048
00049         auto b = sender.as<Button>();
00050
00051         try
00052         {
00053             SmartCard card = co_await GetSmartCardAsync();
00054             SmartCardProvisioning provisioning = co_await SmartCardProvisioning::FromSmartCardAsync(card);
00055
00056             m_rootPage.NotifyUser(L"Verifying smart card response...", NotifyType::StatusMessage);
00057
00058             // We rely on this object's destructor to clean up the context.
00059             SmartCardChallengeContext context = co_await provisioning.GetChallengeContextAsync();
00060
00061             IBuffer response = CalculateChallengeResponse(context.Challenge(), GetAdminKey());
00062             bool verifyResult = co_await context.VerifyResponseAsync(response);
00063
00064             m_rootPage.NotifyUser(L"Smart card response verification completed. Result: " + std::to_wstring(verifyResult), NotifyType::StatusMessage);
00065             // context destructed here
00066         }
00067         catch (hresult_error const& ex)
00068         {
00069             m_rootPage.NotifyUser(L"Verifying smart card response operation failed with exception: " + ex.message(), NotifyType::ErrorMessage);
00070         }
00071
00072         b.IsEnabled(true);
00073     }
00074 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario11 Member List

This is the complete list of members for Scenario11, including all inherited members.
GetFileButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario11
Scenario11() | Scenario11
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/cs/SampleConfiguration.cs Source File

  • UssdProtcol
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using UssdApi;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "USSD Protocol";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Request/response", ClassType=typeof(RequestResponse)}
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario3.cpp Source File

  • FileThumbnails
  • cppwinrt

Scenario3.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3.h"
00014 #include "Scenario3.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::FileProperties;
00021 using namespace Windows::Storage::Pickers;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario3::Scenario3()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario3::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00035     }
00036
00037     fire_and_forget Scenario3::GetThumbnailButton_Click(IInspectable const&, RoutedEventArgs const&)
00038     {
00039         auto lifetime = get_strong();
00040
00041         Helpers::ResetOutput(rootPage, ThumbnailImage(), OutputTextBlock());
00042
00043         // Pick a document
00044         FileOpenPicker openPicker;
00045         openPicker.FileTypeFilter().ReplaceAll(FileExtensions::Document());
00046         StorageFile file = co_await openPicker.PickSingleFileAsync();
00047
00048         if (file != nullptr)
00049         {
00050             const ThumbnailMode thumbnailMode = ThumbnailMode::DocumentsView;
00051             const uint32_t size = 100;
00052             StorageItemThumbnail thumbnail = co_await file.GetThumbnailAsync(thumbnailMode, size);
00053             if (thumbnail != nullptr)
00054             {
00055                 Helpers::DisplayResult(ThumbnailImage(), OutputTextBlock(), thumbnailMode, size, file, thumbnail, false);
00056                 thumbnail.Close();
00057             }
00058             else
00059             {
00060                 rootPage.NotifyUser(Errors::NoIcon, NotifyType::StatusMessage);
00061             }
00062         }
00063         else
00064         {
00065             rootPage.NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00066         }
00067     }
00068 }
Generated on Fri Nov 15 2024 22:19:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario1_DataEvents.xaml.h Source File

  • ProximitySensor
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Enumeration::DeviceWatcher^ watcher;
00041         Windows::Devices::Sensors::ProximitySensor^ sensor;
00042         Windows::Foundation::EventRegistrationToken readingToken;
00043
00044         void OnProximitySensorAdded(Windows::Devices::Enumeration::DeviceWatcher^ sender, Windows::Devices::Enumeration::DeviceInformation^ device);
00045         void ReadingChanged(Windows::Devices::Sensors::ProximitySensor^ sender, Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs^ e);
00046         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048     };
00049 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario4_DeviceEvents.xaml.cpp Source File

  • CustomCapability
  • cpp

Scenario4_DeviceEvents.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_DeviceEvents.xaml.h"
00014 #include "MainPage.xaml.h"
00015 #include "DeviceList.h"
00016 #include "Fx2Driver.h"
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace SDKTemplate;
00021 using namespace Windows::Devices::Custom;
00022 using namespace Windows::Storage::Streams;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 DeviceEvents::DeviceEvents()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void DeviceEvents::OnNavigatedTo(NavigationEventArgs^ e)
00033 {
00034     ClearSwitchStateTable();
00035     UpdateRegisterButton();
00036 }
00037
00038 void DeviceEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00039 {
00040     if (running)
00041     {
00042         cancelSource.cancel();
00043         running = false;
00044     }
00045 }
00046
00047 void DeviceEvents::deviceEventsGet_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00048 {
00049     CustomDevice^ fx2Device = DeviceList::Current->GetSelectedDevice();
00050
00051     if (fx2Device == nullptr)
00052     {
00053         rootPage->NotifyUser("Fx2 device not connected or accessible", NotifyType::ErrorMessage);
00054         return;
00055     }
00056
00057     auto button = safe_cast<Button^>(sender);
00058     button->IsEnabled = false;
00059
00060     auto outputBuffer = ref new Buffer(1);
00061
00062     create_task(
00063         fx2Device->SendIOControlAsync(
00064             Fx2Driver::ReadSwitches,
00065             nullptr,
00066             outputBuffer
00067     )).then([this, outputBuffer, button](task<unsigned int> result)
00068     {
00069         try
00070         {
00071             unsigned int bytesRead = result.get();
00072
00073             if (bytesRead == 0)
00074             {
00075                 rootPage->NotifyUser("Fx2 device returned 0 byte interrupt message.  Stopping",
00076                                      NotifyType::ErrorMessage);
00077             }
00078             else
00079             {
00080                 byte* data = GetArrayFromBuffer(outputBuffer);
00081                 Array<bool>^ switchStateArray = CreateSwitchStateArray(data);
00082                 UpdateSwitchStateTable(switchStateArray);
00083             }
00084         }
00085         catch (Exception^ exception)
00086         {
00087             rootPage->NotifyUser(exception->ToString(), NotifyType::ErrorMessage);
00088         }
00089
00090         button->IsEnabled = true;
00091     });
00092 }
00093
00094 void DeviceEvents::deviceEventsBegin_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00095 {
00096     CustomDevice^ fx2Device = DeviceList::Current->GetSelectedDevice();
00097
00098     if (fx2Device == nullptr)
00099     {
00100         rootPage->NotifyUser("Fx2 device not connected or accessible", NotifyType::ErrorMessage);
00101         return;
00102     }
00103
00104     if (!running)
00105     {
00106         StartInterruptMessageWorker(fx2Device);
00107     }
00108
00109     UpdateRegisterButton();
00110 }
00111
00112 void DeviceEvents::deviceEventsCancel_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00113 {
00114     CustomDevice^ fx2Device = DeviceList::Current->GetSelectedDevice();
00115
00116     if (fx2Device == nullptr)
00117     {
00118         rootPage->NotifyUser("Fx2 device not connected or accessible", NotifyType::ErrorMessage);
00119         return;
00120     }
00121
00122     if (running)
00123     {
00124         cancelSource.cancel();
00125     }
00126
00127     UpdateRegisterButton();
00128 }
00129
00130 void DeviceEvents::StartInterruptMessageWorker(CustomDevice^ fx2Device)
00131 {
00132     auto switchMessageBuffer = ref new Buffer(1);
00133
00134     cancelSource = cancellation_token_source();
00135     running = true;
00136
00137     InterruptMessageWorker(fx2Device, switchMessageBuffer);
00138 }
00139
00140 void DeviceEvents::InterruptMessageWorker(CustomDevice^ fx2Device, IBuffer^ switchMessageBuffer)
00141 {
00142     create_task(
00143         fx2Device->SendIOControlAsync(
00144             Fx2Driver::GetInterruptMessage,
00145             nullptr,
00146             switchMessageBuffer
00147         ),
00148         cancelSource.get_token()
00149     ).then([this, fx2Device, switchMessageBuffer](task<unsigned int> result)
00150     {
00151         bool failure;
00152
00153         try
00154         {
00155             unsigned int bytesRead = result.get();
00156
00157             if (bytesRead == 0)
00158             {
00159                 rootPage->NotifyUser("Fx2 device returned 0 byte interrupt message.  Stopping",
00160                                      NotifyType::ErrorMessage);
00161                 failure = true;
00162             }
00163             else
00164             {
00165                 UpdateSwitchStateTable(CreateSwitchStateArray(GetArrayFromBuffer(switchMessageBuffer)));
00166                 failure = false;
00167             }
00168
00169         }
00170         catch (task_canceled)
00171         {
00172             rootPage->NotifyUser("Pending GetInterruptMessage IO Control cancelled", NotifyType::StatusMessage);
00173             failure = false;
00174         }
00175         catch (Exception^ exception)
00176         {
00177             rootPage->NotifyUser("Error accessing Fx2 device:\n" + exception->Message, NotifyType::ErrorMessage);
00178             failure = true;
00179         }
00180
00181         if (failure)
00182         {
00183             ClearSwitchStateTable();
00184             running = false;
00185             UpdateRegisterButton();
00186         }
00187         else
00188         {
00189             InterruptMessageWorker(fx2Device, switchMessageBuffer);
00190         }
00191     }
00192     );
00193 }
00194
00195 void DeviceEvents::UpdateRegisterButton()
00196 {
00197     deviceEventsBegin->IsEnabled = !running;
00198     deviceEventsCancel->IsEnabled = running;
00199 }
00200
00201
00202 void DeviceEvents::ClearSwitchStateTable()
00203 {
00204     deviceEventsSwitches->Inlines->Clear();
00205     previousSwitchValues = nullptr;
00206 }
00207
00208 void DeviceEvents::UpdateSwitchStateTable(Array<bool>^ switchStateArray)
00209 {
00210     DeviceList::CreateBooleanTable(
00211         deviceEventsSwitches->Inlines,
00212         switchStateArray,
00213         previousSwitchValues,
00214         "Switch Number",
00215         "Switch State",
00216         "off",
00217         "on"
00218     );
00219     previousSwitchValues = switchStateArray;
00220 }
Generated on Fri Nov 15 2024 22:19:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/Scenario1_Toggle.xaml.cs Source File

  • RadioManager
  • cs

Scenario1_Toggle.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using Windows.Devices.Radios;
00016 using System;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario1_Toggle : Page
00021     {
00022         private MainPage rootPage = MainPage.Current;
00023
00024         public Scenario1_Toggle()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         protected override async void OnNavigatedTo(NavigationEventArgs e)
00030         {
00031             // RequestAccessAsync must be called at least once from the UI thread
00032             var accessLevel = await Radio.RequestAccessAsync();
00033             if (accessLevel != RadioAccessStatus.Allowed)
00034             {
00035                 rootPage.NotifyUser("App is not allowed to control radios.", NotifyType.ErrorMessage);
00036             }
00037             else
00038             {
00039                 // An alternative to Radio.GetRadiosAsync is to use the Windows.Devices.Enumeration pattern,
00040                 // passing Radio.GetDeviceSelector as the AQS string
00041                 foreach (var radio in await Radio.GetRadiosAsync())
00042                 {
00043                     RadioSwitchList.Items.Add(new RadioModel(radio, this.Dispatcher));
00044                 }
00045             }
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario2.cpp Source File

  • FolderEnumeration
  • cppwinrt

Scenario2.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.h"
00014 #include "Scenario2.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::Search;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario2::Scenario2()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     /// <summary>
00033     /// list all the files and folders in Pictures library by month
00034     /// </summary>
00035     fire_and_forget Scenario2::GroupByMonthButton_Click(IInspectable const&, RoutedEventArgs const&)
00036     {
00037         co_await GroupByHelperAsync(QueryOptions(CommonFolderQuery::GroupByMonth));
00038     }
00039
00040     /// <summary>
00041     /// list all the files and folders in Pictures library by rating
00042     /// </summary>
00043     fire_and_forget Scenario2::GroupByRatingButton_Click(IInspectable const&, RoutedEventArgs const&)
00044     {
00045         co_await GroupByHelperAsync(QueryOptions(CommonFolderQuery::GroupByRating));
00046     }
00047
00048     /// <summary>
00049     /// list all the files and folders in Pictures library by tag
00050     /// </summary>
00051     fire_and_forget Scenario2::GroupByTagButton_Click(IInspectable const&, RoutedEventArgs const&)
00052     {
00053         co_await GroupByHelperAsync(QueryOptions(CommonFolderQuery::GroupByTag));
00054     }
00055
00056     /// <summary>
00057     /// helper for all list by functions
00058     /// </summary>
00059     IAsyncAction Scenario2::GroupByHelperAsync(QueryOptions queryOptions)
00060     {
00061         auto lifetime = get_strong();
00062
00063         OutputPanel().Children().Clear();
00064
00065         StorageFolder picturesFolder = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary);
00066         StorageFolderQueryResult queryResult = picturesFolder.CreateFolderQueryWithOptions(queryOptions);
00067
00068         IVectorView<StorageFolder> folderList = co_await queryResult.GetFoldersAsync();
00069         for (StorageFolder const& folder : folderList)
00070         {
00071             IVectorView<StorageFile> fileList = co_await folder.GetFilesAsync();
00072             OutputPanel().Children().Append(Helpers::CreateHeaderTextBlock(folder.Name() + L" (" + to_hstring(fileList.Size()) + L")"));
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/Scenario2_Extend.h Source File

  • TitleBar
  • cppwinrt

Scenario2_Extend.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Extend.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Extend : Scenario2_ExtendT<Scenario2_Extend>
00020     {
00021         Scenario2_Extend();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         void ExtendView_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void ToggleFullScreenModeButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void EnableControls_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032         event_token windowSizeChangedToken;
00033
00034         void UpdateFullScreenModeStatus();
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario2_Extend : Scenario2_ExtendT<Scenario2_Extend, implementation::Scenario2_Extend>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:21:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ListsAndTemplates Member List

This is the complete list of members for ListsAndTemplates, including all inherited members.
Employees | ListsAndTemplates |
InitializeValues() | ListsAndTemplates | [inline, private]
ListsAndTemplates() | ListsAndTemplates | [inline]
Model | ListsAndTemplates |
ResetValuesClick(object sender, RoutedEventArgs e) | ListsAndTemplates | [inline, private]
UpdateValuesClick(object sender, RoutedEventArgs e) | ListsAndTemplates | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/pch.cpp Source File

  • LockScreenApps
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/pch.h Source File

  • WiFiDirect
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Devices.Enumeration.h"
00008 #include "winrt/Windows.Devices.WiFiDirect.h"
00009 #include "winrt/Windows.Networking.Sockets.h"
00010 #include "winrt/Windows.Security.Credentials.h"
00011 #include "winrt/Windows.Security.Cryptography.h"
00012 #include "winrt/Windows.Storage.Streams.h"
00013 #include "winrt/Windows.System.h"
00014 #include "winrt/Windows.UI.Core.h"
00015 #include "winrt/Windows.UI.Popups.h"
00016 #include "winrt/Windows.UI.Xaml.h"
00017 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00018 #include "winrt/Windows.UI.Xaml.Controls.h"
00019 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00020 #include "winrt/Windows.UI.Xaml.Documents.h"
00021 #include "winrt/Windows.UI.Xaml.Interop.h"
00022 #include "winrt/Windows.UI.Xaml.Markup.h"
00023 #include "winrt/Windows.UI.Xaml.Media.h"
00024 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/Scenario1_DetectInPhoto.cpp Source File

  • BasicFaceDetection
  • cppwinrt

Scenario1_DetectInPhoto.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_DetectInPhoto.h"
00014 #include "Scenario1_DetectInPhoto.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Graphics::Imaging;
00021 using namespace winrt::Windows::Media::FaceAnalysis;
00022 using namespace winrt::Windows::Storage;
00023 using namespace winrt::Windows::Storage::Pickers;
00024 using namespace winrt::Windows::Storage::Streams;
00025 using namespace winrt::Windows::UI::Xaml;
00026 using namespace winrt::Windows::UI::Xaml::Media;
00027 using namespace winrt::Windows::UI::Xaml::Media::Imaging;
00028
00029 namespace winrt::SDKTemplate::implementation
00030 {
00031     Scenario1_DetectInPhoto::Scenario1_DetectInPhoto()
00032     {
00033         InitializeComponent();
00034     }
00035
00036     // Takes the photo image and FaceDetector results and assembles the visualization onto the Canvas.
00037     //
00038     // displaySource is a bitmap object holding the image we're going to display.
00039     // foundFaces is a list of detected faces; output from FaceDetector.
00040     void Scenario1_DetectInPhoto::SetupVisualization(WriteableBitmap const& displaySource, IVector<DetectedFace> const& foundFaces)
00041     {
00042         ImageBrush brush;
00043         brush.ImageSource(displaySource);
00044         brush.Stretch(Stretch::Fill);
00045         PhotoCanvas().Background(brush);
00046
00047         SampleHelpers::HighlightFaces(displaySource, foundFaces, PhotoCanvas(), HighlightedFaceBox());
00048     }
00049
00050     // Clears the display of image and face boxes.
00051     void Scenario1_DetectInPhoto::ClearVisualization()
00052     {
00053         PhotoCanvas().Background(nullptr);
00054         PhotoCanvas().Children().Clear();
00055         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00056     }
00057
00058     // Computes a BitmapTransform to downscale the source image if it's too large.
00059     //
00060     // Performance of the FaceDetector degrades significantly with large images, and in most cases it's best to downscale
00061     // the source bitmaps if they're too large before passing them into FaceDetector. Remember through, your application's performance needs will vary.
00062     BitmapTransform Scenario1_DetectInPhoto::ComputeScalingTransformForSourceImage(BitmapDecoder const& sourceDecoder)
00063     {
00064         BitmapTransform transform;
00065
00066         uint32_t sourceHeight = sourceDecoder.PixelHeight();
00067         if (sourceHeight > sourceImageHeightLimit)
00068         {
00069             double scalingFactor = (double)sourceImageHeightLimit / sourceHeight;
00070
00071             transform.ScaledWidth((uint32_t)(sourceDecoder.PixelWidth() * scalingFactor));
00072             transform.ScaledHeight((uint32_t)(sourceHeight * scalingFactor));
00073         }
00074
00075         return transform;
00076     }
00077
00078     // Loads an image file (selected by the user) and runs the FaceDetector on the loaded bitmap. If successful calls SetupVisualization to display the results.
00079     fire_and_forget Scenario1_DetectInPhoto::OpenFile_Click(IInspectable const&, RoutedEventArgs const&)
00080     {
00081         auto lifetime = get_strong();
00082
00083         FileOpenPicker photoPicker;
00084         photoPicker.ViewMode(PickerViewMode::Thumbnail);
00085         photoPicker.SuggestedStartLocation(PickerLocationId::PicturesLibrary);
00086         photoPicker.FileTypeFilter().ReplaceAll({ L".jpg", L".jpeg", L".png", L".bmp" });
00087
00088         StorageFile photoFile = co_await photoPicker.PickSingleFileAsync();
00089         if (photoFile == nullptr)
00090         {
00091             co_return;
00092         }
00093
00094         ClearVisualization();
00095         rootPage.NotifyUser(L"Opening...", NotifyType::StatusMessage);
00096
00097         try
00098         {
00099             // Open the image file and decode the bitmap into memory.
00100             // We'll need to make 2 bitmap copies: one for the FaceDetector and another to display.
00101             IRandomAccessStream fileStream = co_await photoFile.OpenAsync(FileAccessMode::Read);
00102             {
00103                 BitmapDecoder decoder = co_await BitmapDecoder::CreateAsync(fileStream);
00104                 BitmapTransform transform = ComputeScalingTransformForSourceImage(decoder);
00105
00106                 SoftwareBitmap originalBitmap = co_await decoder.GetSoftwareBitmapAsync(decoder.BitmapPixelFormat(), BitmapAlphaMode::Ignore, transform, ExifOrientationMode::IgnoreExifOrientation, ColorManagementMode::DoNotColorManage);
00107
00108                 // We need to convert the image into a format that's compatible with FaceDetector.
00109                 // Gray8 should be a good type but verify it against FaceDetector’s supported formats.
00110                 static constexpr BitmapPixelFormat InputPixelFormat = BitmapPixelFormat::Gray8;
00111                 if (FaceDetector::IsBitmapPixelFormatSupported(InputPixelFormat))
00112                 {
00113                     SoftwareBitmap detectorInput = SoftwareBitmap::Convert(originalBitmap, InputPixelFormat);
00114
00115                     // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to wb's buffer.
00116                     WriteableBitmap displaySource(originalBitmap.PixelWidth(), originalBitmap.PixelHeight());
00117                     originalBitmap.CopyToBuffer(displaySource.PixelBuffer());
00118
00119                     rootPage.NotifyUser(L"Detecting...", NotifyType::StatusMessage);
00120
00121                     // Initialize our FaceDetector and execute it against our input image.
00122                     // NOTE: FaceDetector initialization can take a long time, and in most cases
00123                     // you should create a member variable and reuse the object.
00124                     // However, for simplicity in this scenario we instantiate a new instance each time.
00125                     FaceDetector detector = co_await FaceDetector::CreateAsync();
00126                     IVector<DetectedFace> faces = co_await detector.DetectFacesAsync(detectorInput);
00127
00128                     // Create our display using the available image and face results.
00129                     SetupVisualization(displaySource, faces);
00130                 }
00131                 else
00132                 {
00133                     rootPage.NotifyUser(L"PixelFormat 'Gray8' is not supported by FaceDetector", NotifyType::ErrorMessage);
00134                 }
00135             }
00136         }
00137         catch (hresult_error const& ex)
00138         {
00139             ClearVisualization();
00140             rootPage.NotifyUser(ex.message(), NotifyType::ErrorMessage);
00141         }
00142     }
00143
00144    // Updates any existing face bounding boxes in response to changes in the size of the Canvas.
00145     void Scenario1_DetectInPhoto::PhotoCanvas_SizeChanged(IInspectable const&, SizeChangedEventArgs const&)
00146     {
00147         // If the Canvas is resized we must recompute a new scaling factor and
00148         // apply it to each face box.
00149         ImageBrush brush = PhotoCanvas().Background().try_as<ImageBrush>();
00150         if (brush != nullptr)
00151         {
00152             WriteableBitmap displaySource = brush.ImageSource().as<WriteableBitmap>();
00153             SampleHelpers::RepositionFaces(displaySource, PhotoCanvas());
00154         }
00155     }
00156 }
Generated on Fri Nov 15 2024 22:18:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario6.h Source File

  • FileThumbnails
  • cppwinrt

Scenario6.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario6 : Scenario6T<Scenario6>
00020     {
00021         Scenario6();
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         fire_and_forget SelectImageButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario6 : Scenario6T<Scenario6, implementation::Scenario6>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Controls/StepsHelperControl.cs Source File

  • Notifications
  • cs
  • Notifications
  • Controls

StepsHelperControl.cs

Go to the documentation of this file.
00001 ﻿using Windows.Foundation;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 namespace Notifications.Controls
00006 {
00007     public class StepsHelperControl : Panel
00008     {
00009         protected override Size MeasureOverride(Size availableSize)
00010         {
00011             Size resultSize = new Size(availableSize.Width, 0);
00012
00013             foreach (UIElement child in Children)
00014             {
00015                 child.Measure(availableSize);
00016
00017                 if (child.DesiredSize.Height > resultSize.Height)
00018                     resultSize.Height = child.DesiredSize.Height;
00019             }
00020
00021             //return availableSize;
00022             return resultSize;
00023         }
00024
00025         protected override Size ArrangeOverride(Size finalSize)
00026         {
00027             //Clip = new Windows.UI.Xaml.Media.RectangleGeometry() { Rect = new Rect(new Point(), finalSize) };
00028
00029             for (int i = 0; i < Children.Count; i++)
00030             {
00031                 Children[i].Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height));
00032             }
00033
00034             UpdateVisibilities();
00035
00036             return finalSize;
00037         }
00038
00039         public static readonly DependencyProperty StepProperty = DependencyProperty.Register("Step", typeof(int), typeof(StepsHelperControl), new PropertyMetadata(1, OnStepChanged));
00040
00041         private static void OnStepChanged(object sender, DependencyPropertyChangedEventArgs args)
00042         {
00043             (sender as StepsHelperControl).OnStepChanged(args);
00044         }
00045
00046         private void OnStepChanged(DependencyPropertyChangedEventArgs args)
00047         {
00048             UpdateVisibilities();
00049         }
00050
00051         private void UpdateVisibilities()
00052         {
00053             int adaptedStep = Step - 1;
00054
00055             for (int i = 0; i < Children.Count; i++)
00056             {
00057                 Children[i].Visibility = (i == adaptedStep) ? Visibility.Visible : Visibility.Collapsed;
00058             }
00059         }
00060
00061         public int Step
00062         {
00063             get { return (int)GetValue(StepProperty); }
00064             set { SetValue(StepProperty, value); }
00065         }
00066     }
00067 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Simple3DGame.cpp Source File

  • Simple3DGameXaml
  • cpp

Simple3DGame.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameRenderer.h"
00014
00015 #include "Level1.h"
00016 #include "Level2.h"
00017 #include "Level3.h"
00018 #include "Level4.h"
00019 #include "Level5.h"
00020 #include "Level6.h"
00021 #include "Animate.h"
00022 #include "Sphere.h"
00023 #include "Cylinder.h"
00024 #include "Face.h"
00025 #include "MediaReader.h"
00026
00027 using namespace concurrency;
00028 using namespace DirectX;
00029 using namespace Microsoft::WRL;
00030 using namespace Windows::ApplicationModel::Store;
00031 using namespace Windows::Storage;
00032 using namespace Windows::UI::Core;
00033
00034 //----------------------------------------------------------------------
00035
00036 Simple3DGame::Simple3DGame():
00037     m_ammoCount(0),
00038     m_ammoNext(0),
00039     m_gameActive(false),
00040     m_levelActive(false),
00041     m_totalHits(0),
00042     m_totalShots(0),
00043     m_levelBonusTime(0.0),
00044     m_levelTimeRemaining(0.0),
00045     m_levelCount(0),
00046     m_currentLevel(0),
00047     m_activeBackground(0)
00048 {
00049     m_topScore.totalHits = 0;
00050     m_topScore.totalShots = 0;
00051     m_topScore.levelCompleted = 0;
00052 }
00053
00054 //----------------------------------------------------------------------
00055
00056 void Simple3DGame::Initialize(
00057     _In_ MoveLookController^ controller,
00058     _In_ GameRenderer^ renderer
00059     )
00060 {
00061     // This method is expected to be called as an asynchronous task.
00062     // Care should be taken to not call rendering methods on the
00063     // m_renderer as this would result in the D3D Context being
00064     // used in multiple threads, which is not allowed.
00065
00066     m_controller = controller;
00067     m_renderer = renderer;
00068
00069     m_audioController = ref new Audio;
00070     m_audioController->CreateDeviceIndependentResources();
00071
00072     InitializeGameConfig();
00073
00074     m_ammo = std::vector<Sphere^>(GameConstants::MaxAmmo);
00075     m_objects = std::vector<GameObject^>();
00076     m_renderObjects = std::vector<GameObject^>();
00077     m_level = std::vector<Level^>();
00078
00079     m_savedState = ref new PersistentState();
00080     m_savedState->Initialize(ApplicationData::Current->LocalSettings->Values, "Game");
00081
00082     m_timer = ref new GameTimer();
00083
00084     // Create a sphere primitive to represent the player.
00085     // The sphere will be used to handle collisions and constrain the player in the world.
00086     // It is not rendered so it is not added to the list of render objects.
00087     // It is added to the object list so it will be included in intersection calculations.
00088     m_player = ref new Sphere(XMFLOAT3(0.0f, -1.3f, 4.0f), 0.2f);
00089     m_objects.push_back(m_player);
00090     m_player->Active(true);
00091
00092     m_camera = ref new Camera;
00093     m_camera->SetProjParams(XM_PI / 2, 1.0f, 0.01f, 100.0f);
00094     m_camera->SetViewParams(
00095         m_player->Position(),            // Eye point in world coordinates.
00096         XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
00097         XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
00098         );
00099
00100     m_controller->Pitch(m_camera->Pitch());
00101     m_controller->Yaw(m_camera->Yaw());
00102
00103     // Instantiate a set of primitives to represent the containing world. These objects
00104     // maintain the geometry and material properties of the walls, floor and ceiling.
00105     // The TargetId is used to identify the world objects so that the right geometry
00106     // and textures can be associated with them later after those resources have
00107     // been created.
00108     GameObject^ world = ref new GameObject();
00109     world->TargetId(GameConstants::WorldFloorId);
00110     world->Active(true);
00111     m_renderObjects.push_back(world);
00112
00113     world = ref new GameObject();
00114     world->TargetId(GameConstants::WorldCeilingId);
00115     world->Active(true);
00116     m_renderObjects.push_back(world);
00117
00118     world = ref new GameObject();
00119     world->TargetId(GameConstants::WorldWallsId);
00120     world->Active(true);
00121     m_renderObjects.push_back(world);
00122
00123     // Min and max Bound are defining the world space of the game.
00124     // All camera motion and dynamics are confined to this space.
00125     m_minBound = XMFLOAT3(-4.0f, -3.0f, -6.0f);
00126     m_maxBound = XMFLOAT3(4.0f, 3.0f, 6.0f);
00127
00128     // Instantiate the Cylinders for use in the various game levels.
00129     // Each cylinder has a different initial position, radius and direction vector,
00130     // but share a common set of material properties.
00131     for (int a = 0; a < GameConstants::MaxCylinders; a++)
00132     {
00133         Cylinder^ cylinder;
00134         switch (a)
00135         {
00136         case 0:
00137             cylinder = ref new Cylinder(XMFLOAT3(-2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00138             break;
00139         case 1:
00140             cylinder = ref new Cylinder(XMFLOAT3(2.0f, -3.0f, 0.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00141             break;
00142         case 2:
00143             cylinder = ref new Cylinder(XMFLOAT3(0.0f, -3.0f, -2.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00144             break;
00145         case 3:
00146             cylinder = ref new Cylinder(XMFLOAT3(-1.5f, -3.0f, -4.0f), 0.25f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00147             break;
00148         case 4:
00149             cylinder = ref new Cylinder(XMFLOAT3(1.5f, -3.0f, -4.0f), 0.50f, XMFLOAT3(0.0f, 6.0f, 0.0f));
00150             break;
00151         }
00152         cylinder->Active(true);
00153         m_objects.push_back(cylinder);
00154         m_renderObjects.push_back(cylinder);
00155     }
00156
00157     MediaReader^ mediaReader = ref new MediaReader;
00158     auto targetHitSound = mediaReader->LoadMedia("Assets\\hit.wav");
00159
00160     // Instantiate the targets for use in the game.
00161     // Each target has a different initial position, size and orientation,
00162     // but share a common set of material properties.
00163     // The target is defined by a position and two vectors that define both
00164     // the plane of the target in world space and the size of the parallelogram
00165     // based on the lengths of the vectors.
00166     // Each target is assigned a number for identification purposes.
00167     // The Target ID number is 1 based.
00168     // All targets have the same material properties.
00169     for (int a = 1; a < GameConstants::MaxTargets; a++)
00170     {
00171         Face^ target;
00172         switch (a)
00173         {
00174         case 1:
00175             target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -1.5f), XMFLOAT3(-1.5f, -1.0f, -2.0f), XMFLOAT3(-2.5f, 1.0f, -1.5f));
00176             break;
00177         case 2:
00178             target = ref new Face(XMFLOAT3(-1.0f, 1.0f, -3.0f), XMFLOAT3(0.0f, 1.0f, -3.0f), XMFLOAT3(-1.0f, 2.0f, -3.0f));
00179             break;
00180         case 3:
00181             target = ref new Face(XMFLOAT3(1.5f, 0.0f, -3.0f), XMFLOAT3(2.5f, 0.0f, -2.0f), XMFLOAT3(1.5f, 2.0f, -3.0f));
00182             break;
00183         case 4:
00184             target = ref new Face(XMFLOAT3(-2.5f, -1.0f, -5.5f), XMFLOAT3(-0.5f, -1.0f, -5.5f), XMFLOAT3(-2.5f, 1.0f, -5.5f));
00185             break;
00186         case 5:
00187             target = ref new Face(XMFLOAT3(0.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, -2.0f, -5.0f), XMFLOAT3(0.5f, 0.0f, -5.0f));
00188             break;
00189         case 6:
00190             target = ref new Face(XMFLOAT3(1.5f, -2.0f, -5.5f), XMFLOAT3(2.5f, -2.0f, -5.0f), XMFLOAT3(1.5f, 0.0f, -5.5f));
00191             break;
00192         case 7:
00193             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00194             break;
00195         case 8:
00196             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00197             break;
00198         case 9:
00199             target = ref new Face(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(0.5f, 0.0f, 0.0f), XMFLOAT3(0.0f, 0.5f, 0.0f));
00200             break;
00201         }
00202
00203         target->Target(true);
00204         target->TargetId(a);
00205         target->Active(true);
00206         target->HitSound(ref new SoundEffect());
00207         target->HitSound()->Initialize(
00208             m_audioController->SoundEffectEngine(),
00209             mediaReader->GetOutputWaveFormatEx(),
00210             targetHitSound
00211             );
00212
00213         m_objects.push_back(target);
00214         m_renderObjects.push_back(target);
00215     }
00216
00217     // Instantiate a set of spheres to be used as ammunition for the game
00218     // and set the material properties of the spheres.
00219     auto ammoHitSound = mediaReader->LoadMedia("Assets\\bounce.wav");
00220
00221     for (int a = 0; a < GameConstants::MaxAmmo; a++)
00222     {
00223         m_ammo[a] = ref new Sphere;
00224         m_ammo[a]->Radius(GameConstants::AmmoRadius);
00225         m_ammo[a]->HitSound(ref new SoundEffect());
00226         m_ammo[a]->HitSound()->Initialize(
00227             m_audioController->SoundEffectEngine(),
00228             mediaReader->GetOutputWaveFormatEx(),
00229             ammoHitSound
00230             );
00231         m_ammo[a]->Active(false);
00232         m_renderObjects.push_back(m_ammo[a]);
00233     }
00234
00235     // Instantiate each of the game levels. The Level class contains methods
00236     // that initialize the objects in the world for the given level and also
00237     // define any motion paths for the objects in that level.
00238
00239     m_level.push_back(ref new Level1);
00240     m_level.push_back(ref new Level2);
00241     if (!m_gameConfig.isTrial)
00242     {
00243         m_level.push_back(ref new Level3);
00244         m_level.push_back(ref new Level4);
00245         m_level.push_back(ref new Level5);
00246         m_level.push_back(ref new Level6);
00247     }
00248     m_levelCount = static_cast<uint32>(m_level.size());
00249
00250     // Load the top score from disk if it exists.
00251     LoadHighScore();
00252
00253     // Load the currentScore for saved state if it exists.
00254     LoadState();
00255
00256     m_controller->Active(false);
00257 }
00258
00259 //----------------------------------------------------------------------
00260
00261 void Simple3DGame::LoadGame()
00262 {
00263     m_player->Position(XMFLOAT3 (0.0f, -1.3f, 4.0f));
00264
00265     m_camera->SetViewParams(
00266         m_player->Position(),            // Eye point in world coordinates.
00267         XMFLOAT3 (0.0f, 0.7f, 0.0f),     // Look at point in world coordinates.
00268         XMFLOAT3 (0.0f, 1.0f, 0.0f)      // The Up vector for the camera.
00269         );
00270
00271     m_controller->Pitch(m_camera->Pitch());
00272     m_controller->Yaw(m_camera->Yaw());
00273     m_currentLevel = 0;
00274     m_levelTimeRemaining = 0.0f;
00275     m_levelBonusTime = m_levelTimeRemaining;
00276     m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;
00277     InitializeAmmo();
00278     m_totalHits = 0;
00279     m_totalShots = 0;
00280     m_gameActive = false;
00281     m_levelActive = false;
00282     m_timer->Reset();
00283 }
00284
00285 //----------------------------------------------------------------------
00286
00287 task<void> Simple3DGame::LoadLevelAsync()
00288 {
00289     // Initialize the level and spin up the async loading of the rendering
00290     // resources for the level.
00291     // This will run in a separate thread, so for Direct3D 11, only Device
00292     // methods are allowed.  Any DeviceContext method calls need to be
00293     // done in FinalizeLoadLevel.
00294
00295     m_level[m_currentLevel]->Initialize(m_objects);
00296     m_levelDuration = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime;
00297
00298     return m_renderer->LoadLevelResourcesAsync();
00299 }
00300
00301 //----------------------------------------------------------------------
00302
00303 void Simple3DGame::FinalizeLoadLevel()
00304 {
00305     // This method is called on the main thread, so Direct3D 11 DeviceContext
00306     // method calls are allowable here.
00307
00308     // Finalize the Level loading.
00309     m_renderer->FinalizeLoadLevelResources();
00310 }
00311
00312 //----------------------------------------------------------------------
00313
00314 void Simple3DGame::StartLevel()
00315 {
00316     m_timer->Reset();
00317     m_timer->Start();
00318     if (m_currentLevel == 0)
00319     {
00320         m_gameActive = true;
00321     }
00322     m_levelActive = true;
00323     m_controller->Active(true);
00324 }
00325
00326 //----------------------------------------------------------------------
00327
00328 void Simple3DGame::PauseGame()
00329 {
00330     m_timer->Stop();
00331     SaveState();
00332 }
00333
00334 //----------------------------------------------------------------------
00335
00336 void Simple3DGame::ContinueGame()
00337 {
00338     m_timer->Start();
00339     m_controller->Active(true);
00340 }
00341
00342 //----------------------------------------------------------------------
00343
00344 GameState Simple3DGame::RunGame()
00345 {
00346     // This method is called to execute a single time interval for active game play.
00347     // It returns the resulting state of game play after the interval has been executed.
00348
00349     m_timer->Update();
00350
00351     m_levelTimeRemaining = m_levelDuration - m_timer->PlayingTime();
00352
00353     if (m_levelTimeRemaining <= 0.0f)
00354     {
00355         // Time expired, so the game is over.
00356         m_levelTimeRemaining = 0.0f;
00357         InitializeAmmo();
00358         m_timer->Reset();
00359         m_gameActive = false;
00360         m_levelActive = false;
00361         SaveState();
00362
00363         if (m_totalHits > m_topScore.totalHits)
00364         {
00365             // There is a new high score so save it.
00366             m_topScore.totalHits = m_totalHits;
00367             m_topScore.totalShots = m_totalShots;
00368             m_topScore.levelCompleted = m_currentLevel;
00369
00370             SaveHighScore();
00371         }
00372         return GameState::TimeExpired;
00373     }
00374     else
00375     {
00376         // Time has not expired, so run one frame of game play.
00377         m_player->Velocity(m_controller->Velocity());
00378         m_camera->LookDirection(m_controller->LookDirection());
00379
00380         UpdateDynamics();
00381
00382         // Update the Camera with the player position updates from the dynamics calculations.
00383         m_camera->Eye(m_player->Position());
00384         m_camera->LookDirection(m_controller->LookDirection());
00385
00386         if (m_level[m_currentLevel]->Update(m_timer->PlayingTime(), m_timer->DeltaTime(), m_levelTimeRemaining, m_objects))
00387         {
00388             // The level has been completed.
00389             m_levelActive = false;
00390             InitializeAmmo();
00391
00392             if (m_currentLevel < m_levelCount-1)
00393             {
00394                 // More levels to go so increment the level number.
00395                 // Actual level loading will occur in the LoadLevelAsync / FinalizeLoadLevel
00396                 // methods.
00397                 m_timer->Reset();
00398                 m_currentLevel++;
00399                 m_levelBonusTime = m_levelTimeRemaining;
00400                 SaveState();
00401                 return GameState::LevelComplete;
00402             }
00403             else
00404             {
00405                 // All levels have been completed.
00406                 m_timer->Reset();
00407                 m_gameActive = false;
00408                 m_levelActive = false;
00409                 SaveState();
00410
00411                 if (m_totalHits > m_topScore.totalHits)
00412                 {
00413                     // There is a new high score so save it.
00414                     m_topScore.totalHits = m_totalHits;
00415                     m_topScore.totalShots = m_totalShots;
00416                     m_topScore.levelCompleted = m_currentLevel;
00417
00418                     SaveHighScore();
00419                 }
00420                 return GameState::GameComplete;
00421             }
00422         }
00423     }
00424     return GameState::Active;
00425 }
00426
00427 //----------------------------------------------------------------------
00428
00429 void Simple3DGame::OnSuspending()
00430 {
00431     m_audioController->SuspendAudio();
00432 }
00433
00434 //----------------------------------------------------------------------
00435
00436 void Simple3DGame::OnResuming()
00437 {
00438     m_audioController->ResumeAudio();
00439 }
00440
00441 //----------------------------------------------------------------------
00442
00443 void Simple3DGame::UpdateDynamics()
00444 {
00445     float timeTotal = m_timer->PlayingTime();
00446     float timeFrame = m_timer->DeltaTime();
00447     bool fire = m_controller->IsFiring();
00448
00449 #pragma region Shoot Ammo
00450     // Shoot ammo.
00451     if (fire)
00452     {
00453         static float lastFired;  // Timestamp of last ammo fired.
00454
00455         if (timeTotal < lastFired)
00456         {
00457             // timeTotal is not guarenteed to be monotomically increasing because it is
00458             // reset at each level.
00459             lastFired = timeTotal - GameConstants::Physics::AutoFireDelay;
00460         }
00461
00462         if (timeTotal - lastFired >= GameConstants::Physics::AutoFireDelay)
00463         {
00464             // Get inverse view matrix.
00465             XMMATRIX invView;
00466             XMVECTOR det;
00467             invView = XMMatrixInverse(&det, m_camera->View());
00468
00469             // Compute initial velocity in world space from camera space.
00470             XMFLOAT4 initialVelocity(0.0f, 0.0f, 15.0f, 0.0f);
00471             m_ammo[m_ammoNext]->Velocity(XMVector4Transform(XMLoadFloat4(&initialVelocity), invView));
00472
00473             // Set the initial position of the ammo to be fired. The position is offset from the player
00474             // to avoid an initial collision with the player object.
00475             XMFLOAT4 initialPosition(0.0f, -0.15f, m_player->Radius() + GameConstants::AmmoSize, 1.0f);
00476             m_ammo[m_ammoNext]->Position(XMVector4Transform(XMLoadFloat4(&initialPosition), invView));
00477
00478             // Initially not laying on ground.
00479             m_ammo[m_ammoNext]->OnGround(false);
00480             m_ammo[m_ammoNext]->Active(true);
00481
00482             // Set position in array of next Ammo to use.
00483             // We will re-use ammo taking the least recently used once we have hit the
00484             // MaxAmmo in use.
00485             m_ammoNext = (m_ammoNext + 1) % GameConstants::MaxAmmo;
00486             m_ammoCount = min(m_ammoCount + 1, GameConstants::MaxAmmo);
00487
00488             lastFired = timeTotal;
00489             m_totalShots++;
00490         }
00491     }
00492 #pragma endregion
00493
00494 #pragma region Animate Objects
00495     // Walk the list of objects looking for any objects that have an animation associated with it.
00496     // Update the position of the object based on evaluating the animation object with the current time.
00497     // Once the current time (timeTotal) is past the end of the animation time remove
00498     // the animation object since it is no longer needed.
00499     for (uint32 i = 0; i < m_objects.size(); i++)
00500     {
00501         if (m_objects[i]->AnimatePosition())
00502         {
00503             m_objects[i]->Position(m_objects[i]->AnimatePosition()->Evaluate(timeTotal));
00504             if (m_objects[i]->AnimatePosition()->IsFinished(timeTotal))
00505             {
00506                 m_objects[i]->AnimatePosition(nullptr);
00507             }
00508         }
00509     }
00510 #pragma endregion
00511
00512     // If the elapsed time is too long, we slice up the time and handle physics over several
00513     // smaller time steps to avoid missing collisions.
00514     float timeLeft = timeFrame;
00515     float elapsedFrameTime;
00516     while (timeLeft > 0.0f)
00517     {
00518         elapsedFrameTime = min(timeLeft, GameConstants::Physics::FrameLength);
00519         timeLeft -= elapsedFrameTime;
00520
00521         // Update the player position.
00522         m_player->Position(m_player->VectorPosition() + m_player->VectorVelocity() * elapsedFrameTime);
00523
00524         // Do m_player / object intersections.
00525         for (uint32 a = 0; a < m_objects.size(); a++)
00526         {
00527             if (m_objects[a]->Active() && m_objects[a] != m_player)
00528             {
00529                 XMFLOAT3 contact;
00530                 XMFLOAT3 normal;
00531
00532                 if (m_objects[a]->IsTouching(m_player->Position(), m_player->Radius(), &contact, &normal))
00533                 {
00534                     // Player is in contact with m_objects[a].
00535                     XMVECTOR oneToTwo;
00536                     oneToTwo = -XMLoadFloat3(&normal);
00537
00538                     float impact = XMVectorGetX(
00539                         XMVector3Dot (oneToTwo, m_player->VectorVelocity())
00540                         );
00541                     // Make sure that the player is actually headed towards the object. At grazing angles there
00542                     // could appear to be an impact when the player is actually already hit and moving away.
00543                     if (impact > 0.0f)
00544                     {
00545                         // Compute the normal and tangential components of the player's velocity.
00546                         XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, m_player->VectorVelocity()) * oneToTwo;
00547                         XMVECTOR velocityOneTangent = m_player->VectorVelocity() - velocityOneNormal;
00548
00549                         // Compute post-collision velocity.
00550                         m_player->Velocity(velocityOneTangent - velocityOneNormal);
00551
00552                         // Fix the positions so that the player is just touching the object.
00553                         float distanceToMove = m_player->Radius();
00554                         m_player->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));
00555                     }
00556                 }
00557             }
00558         }
00559         {
00560             // Do collision detection of the player with the bounding world.
00561             XMFLOAT3 position = m_player->Position();
00562             XMFLOAT3 velocity = m_player->Velocity();
00563             float radius = m_player->Radius();
00564
00565             // Check for player collisions with the walls floor or ceiling and adjust the position.
00566             float limit = m_minBound.x + radius;
00567             if (position.x < limit)
00568             {
00569                 position.x = limit;
00570                 velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00571             }
00572             limit = m_maxBound.x - radius;
00573             if (position.x > limit)
00574             {
00575                 position.x = limit;
00576                 velocity.x = -velocity.x + GameConstants::Physics::GroundRestitution;
00577             }
00578             limit = m_minBound.y + radius;
00579             if (position.y < limit)
00580             {
00581                 position.y = limit;
00582                 velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00583             }
00584             limit = m_maxBound.y - radius;
00585             if (position.y > limit)
00586             {
00587                 position.y = limit;
00588                 velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00589             }
00590             limit = m_minBound.z + radius;
00591             if (position.z < limit)
00592             {
00593                 position.z = limit;
00594                 velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00595             }
00596             limit = m_maxBound.z - radius;
00597             if (position.z > limit)
00598             {
00599                 position.z = limit;
00600                 velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00601             }
00602             m_player->Position(position);
00603             m_player->Velocity(velocity);
00604         }
00605
00606         // Animate the ammo.
00607         if (m_ammoCount > 0)
00608         {
00609             // Check for collisions between ammo.
00610 #pragma region inter-ammo collision detection
00611             if (m_ammoCount > 1)
00612             {
00613                 for (uint32 one = 0; one < m_ammoCount; one++)
00614                 {
00615                     for (uint32 two = (one + 1); two < m_ammoCount; two++)
00616                     {
00617                         // Check collision between instances One and Two.
00618                         // OneToTwo is the vector between the centers of the two ammo that are being checked.
00619                         XMVECTOR oneToTwo;
00620                         oneToTwo = m_ammo[two]->VectorPosition() - m_ammo[one]->VectorPosition();
00621                         float distanceSquared;
00622                         distanceSquared = XMVectorGetX(
00623                             XMVector3LengthSq(oneToTwo)
00624                             );
00625                         if (distanceSquared < (GameConstants::AmmoSize * GameConstants::AmmoSize))
00626                         {
00627                             // The two ammo are intersecting.
00628                             oneToTwo = XMVector3Normalize(oneToTwo);
00629
00630                             // Check if the two instances are already moving away from each other.
00631                             // If so, skip collision.  This can happen when a lot of instances are
00632                             // bunched up next to each other.
00633                             float impact;
00634                             impact = XMVectorGetX(
00635                                 XMVector3Dot(oneToTwo, m_ammo[one]->VectorVelocity()) -
00636                                 XMVector3Dot(oneToTwo, m_ammo[two]->VectorVelocity())
00637                                 );
00638                             if (impact > 0.0f)
00639                             {
00640                                 // Compute the normal and tangential components of one's velocity.
00641                                 XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
00642                                 XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
00643                                 XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;
00644                                 // Compute the normal and tangential components of two's velocity.
00645                                 XMVECTOR velocityTwo = (1 - GameConstants::Physics::BounceLost) * m_ammo[two]->VectorVelocity();
00646                                 XMVECTOR velocityTwoNormal = XMVector3Dot(oneToTwo, velocityTwo) * oneToTwo;
00647                                 XMVECTOR velocityTwoTangent = velocityTwo - velocityTwoNormal;
00648
00649                                 // Compute the post-collision velocities.
00650                                 m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer) +
00651                                     velocityTwoNormal * GameConstants::Physics::BounceTransfer
00652                                     );
00653                                 m_ammo[two]->Velocity(velocityTwoTangent - velocityTwoNormal * (1 - GameConstants::Physics::BounceTransfer) +
00654                                     velocityOneNormal * GameConstants::Physics::BounceTransfer
00655                                     );
00656
00657                                 // Fix the positions so that the two balls are exactly GameConstants::AmmoSize apart.
00658                                 float distanceToMove = (GameConstants::AmmoSize - sqrtf(distanceSquared)) * 0.5f;
00659                                 m_ammo[one]->Position(m_ammo[one]->VectorPosition() - (oneToTwo * distanceToMove));
00660                                 m_ammo[two]->Position(m_ammo[two]->VectorPosition() + (oneToTwo * distanceToMove));
00661
00662                                 // Flag the two instances so that they are not laying on ground.
00663                                 m_ammo[one]->OnGround(false);
00664                                 m_ammo[two]->OnGround(false);
00665
00666                                 // Start playing the sounds for the impact between the two balls.
00667                                 m_ammo[one]->PlaySound(impact, m_player->Position());
00668                                 m_ammo[two]->PlaySound(impact, m_player->Position());
00669                             }
00670                         }
00671                     }
00672                 }
00673             }
00674 #pragma endregion
00675
00676 #pragma region Ammo-Object intersections
00677             // Check for intersections between the ammo and the other objects in the scene.
00678             for (uint32 one = 0; one < m_ammoCount; one++)
00679             {
00680                 if (m_objects.size() > 0)
00681                 {
00682                     if (!m_ammo[one]->OnGround())
00683                     {
00684                         for (uint32 i = 0; i < m_objects.size(); i++)
00685                         {
00686                             if (m_objects[i]->Active())
00687                             {
00688                                 // The object is currently active in the scene. There may be objects in the list
00689                                 // that are currently inactive, so those are skipped.
00690                                 XMFLOAT3 contact;
00691                                 XMFLOAT3 normal;
00692
00693                                 if (m_objects[i]->IsTouching(m_ammo[one]->Position(), GameConstants::AmmoRadius, &contact, &normal))
00694                                 {
00695                                     // Ball is in contact with Object.
00696                                     XMVECTOR oneToTwo;
00697                                     oneToTwo = -XMLoadFloat3(&normal);
00698
00699                                     float impact;
00700                                     impact = XMVectorGetX(
00701                                         XMVector3Dot (oneToTwo, m_ammo[one]->VectorVelocity())
00702                                         );
00703                                     // Make sure that the ball is actually headed towards the object. At grazing angles there
00704                                     // could appear to be an impact when the ball is actually already hit and moving away.
00705                                     if (impact > 0.0f)
00706                                     {
00707                                         // Compute the normal and tangential components of the ammo's velocity.
00708                                         XMVECTOR velocityOne = (1 - GameConstants::Physics::BounceLost) * m_ammo[one]->VectorVelocity();
00709                                         XMVECTOR velocityOneNormal = XMVector3Dot(oneToTwo, velocityOne) * oneToTwo;
00710                                         XMVECTOR velocityOneTangent = velocityOne - velocityOneNormal;
00711
00712                                         // Compute post-collision velocity of the ammo.
00713                                         m_ammo[one]->Velocity(velocityOneTangent - velocityOneNormal * (1 - GameConstants::Physics::BounceTransfer));
00714
00715                                         // Fix the position so that the ball is exactly GameConstants::AmmoRadius from target.
00716                                         float distanceToMove = GameConstants::AmmoSize;
00717                                         m_ammo[one]->Position(XMLoadFloat3(&contact) - (oneToTwo * distanceToMove));
00718
00719                                         // Flag the Ammo as not laying on ground.
00720                                         m_ammo[one]->OnGround(false);
00721
00722                                         // Play the sound associated with the Ammo hitting something.
00723                                         m_ammo[one]->PlaySound(impact, m_player->Position());
00724
00725                                         if (m_objects[i]->Target() && !m_objects[i]->Hit())
00726                                         {
00727                                             // The object is a target and isn't currently hit, so mark it as hit and
00728                                             // play the sound associated with the impact.
00729                                             m_objects[i]->Hit(true);
00730                                             m_objects[i]->HitTime(timeTotal);
00731                                             m_totalHits++;
00732
00733                                             m_objects[i]->PlaySound(impact, m_player->Position());
00734                                         }
00735                                     }
00736                                 }
00737                             }
00738                         }
00739                     }
00740                 }
00741             }
00742 #pragma endregion
00743
00744 #pragma region Apply Gravity and world intersection
00745             // Apply gravity and check for collision against enclosing volume.
00746             for (uint32 i = 0; i < m_ammoCount; i++)
00747             {
00748                 // Update the position and velocity of the ammo instance.
00749                 m_ammo[i]->Position(m_ammo[i]->VectorPosition() + m_ammo[i]->VectorVelocity() * elapsedFrameTime);
00750
00751                 XMFLOAT3 velocity = m_ammo[i]->Velocity();
00752                 XMFLOAT3 position = m_ammo[i]->Position();
00753
00754                 velocity.x -= velocity.x * 0.1f * elapsedFrameTime;
00755                 velocity.z -= velocity.z * 0.1f * elapsedFrameTime;
00756                 if (!m_ammo[i]->OnGround())
00757                 {
00758                     // Apply gravity if the ammo instance is not already resting on the ground.
00759                     velocity.y -= GameConstants::Physics::Gravity * elapsedFrameTime;
00760                 }
00761
00762                 if (!m_ammo[i]->OnGround())
00763                 {
00764                     float limit = m_minBound.y + GameConstants::AmmoRadius;
00765                     if (position.y < limit)
00766                     {
00767                         // The ammo instance hit the ground.
00768                         // Align the ammo instance to the ground, invert the Y component of the velocity and
00769                         // play the impact sound. The X and Z velocity components will be reduced
00770                         // because of friction.
00771                         position.y = limit;
00772                         m_ammo[i]->PlaySound(-velocity.y, m_player->Position());
00773
00774                         velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00775                         velocity.x *= GameConstants::Physics::Friction;
00776                         velocity.z *= GameConstants::Physics::Friction;
00777                     }
00778                 }
00779                 else
00780                 {
00781                     // The ammo instance is resting or rolling on ground.
00782                     // X and Z velocity components are reduced because of friction.
00783                     velocity.x *= GameConstants::Physics::Friction;
00784                     velocity.z *= GameConstants::Physics::Friction;
00785                 }
00786
00787                 float limit = m_maxBound.y - GameConstants::AmmoRadius;
00788                 if (position.y > limit)
00789                 {
00790                     // The ammo instance hit the ceiling.
00791                     // Align the ammo instance to the ceiling, invert the Y component of the velocity and
00792                     // play the impact sound. The X and Z velocity components will be reduced
00793                     // because of friction.
00794                     position.y = limit;
00795                     m_ammo[i]->PlaySound(-velocity.y, m_player->Position());
00796
00797                     velocity.y = -velocity.y * GameConstants::Physics::GroundRestitution;
00798                     velocity.x *= GameConstants::Physics::Friction;
00799                     velocity.z *= GameConstants::Physics::Friction;
00800                 }
00801
00802                 limit = m_minBound.y + GameConstants::AmmoRadius;
00803                 if ((GameConstants::Physics::Gravity * (position.y - limit) + 0.5f * velocity.y * velocity.y) < GameConstants::Physics::RestThreshold)
00804                 {
00805                     // The Y velocity component is below the resting threshold so flag the instance as
00806                     // laying on the ground and set the Y velocity component to zero.
00807                     position.y = limit;
00808                     velocity.y = 0.0f;
00809                     m_ammo[i]->OnGround(true);
00810                 }
00811
00812                 limit = m_minBound.z + GameConstants::AmmoRadius;
00813                 if (position.z < limit)
00814                 {
00815                     // The ammo instance hit the a wall in the min Z direction.
00816                     // Align the ammo instance to the wall, invert the Z component of the velocity and
00817                     // play the impact sound.
00818                     position.z = limit;
00819                     m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
00820                     velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00821                 }
00822
00823                 limit = m_maxBound.z - GameConstants::AmmoRadius;
00824                 if (position.z > limit)
00825                 {
00826                     // The ammo instance hit the a wall in the max Z direction.
00827                     // Align the ammo instance to the wall, invert the Z component of the velocity and
00828                     // play the impact sound.
00829                     position.z = limit;
00830                     m_ammo[i]->PlaySound(-velocity.z, m_player->Position());
00831                     velocity.z = -velocity.z * GameConstants::Physics::GroundRestitution;
00832                 }
00833
00834                 limit = m_minBound.x + GameConstants::AmmoRadius;
00835                 if (position.x < limit)
00836                 {
00837                     // The ammo instance hit the a wall in the min X direction.
00838                     // Align the ammo instance to the wall, invert the X component of the velocity and
00839                     // play the impact sound.
00840                     position.x = limit;
00841                     m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
00842                     velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00843                 }
00844
00845                 limit = m_maxBound.x - GameConstants::AmmoRadius;
00846                 if (position.x > limit)
00847                 {
00848                     // The ammo instance hit the a wall in the max X direction.
00849                     // Align the ammo instance to the wall, invert the X component of the velocity and
00850                     // play the impact sound.
00851                     position.x = limit;
00852                     m_ammo[i]->PlaySound(-velocity.x, m_player->Position());
00853                     velocity.x = -velocity.x * GameConstants::Physics::GroundRestitution;
00854                 }
00855
00856                 // Save the updated velocity and position for the ammo instance.
00857                 m_ammo[i]->Velocity(velocity);
00858                 m_ammo[i]->Position(position);
00859             }
00860         }
00861     }
00862 #pragma endregion
00863 }
00864
00865 //----------------------------------------------------------------------
00866
00867 void Simple3DGame::SaveState()
00868 {
00869     // Save basic state of the game.
00870     m_savedState->SaveBool(":GameActive", m_gameActive);
00871     m_savedState->SaveBool(":LevelActive", m_levelActive);
00872     m_savedState->SaveInt32(":LevelCompleted", m_currentLevel);
00873     m_savedState->SaveInt32(":TotalShots", m_totalShots);
00874     m_savedState->SaveInt32(":TotalHits", m_totalHits);
00875     m_savedState->SaveSingle(":BonusRoundTime", m_levelBonusTime);
00876     m_savedState->SaveXMFLOAT3(":PlayerPosition", m_player->Position());
00877     m_savedState->SaveXMFLOAT3(":PlayerLookDirection", m_controller->LookDirection());
00878
00879     if (m_levelActive)
00880     {
00881         // The game is currently in the middle of a level, so save the extended state of
00882         // the game.
00883         m_savedState->SaveSingle(":LevelDuration", m_levelDuration);
00884         m_savedState->SaveSingle(":LevelPlayingTime", m_timer->PlayingTime());
00885
00886         m_savedState->SaveInt32(":AmmoCount", m_ammoCount);
00887         m_savedState->SaveInt32(":AmmoNext", m_ammoNext);
00888
00889         const int bufferLength = 16;
00890         char16 str[bufferLength];
00891
00892         for (uint32 i = 0; i < m_ammoCount; i++)
00893         {
00894             int len = swprintf_s(str, bufferLength, L"%d", i);
00895             Platform::String^ string = ref new Platform::String(str, len);
00896
00897             m_savedState->SaveBool(Platform::String::Concat(":AmmoActive", string), m_ammo[i]->Active());
00898             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoPosition", string), m_ammo[i]->Position());
00899             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":AmmoVelocity", string), m_ammo[i]->Velocity());
00900         }
00901
00902         m_savedState->SaveInt32(":ObjectCount", static_cast<int>(m_objects.size()));
00903
00904         for (uint32 i = 0; i < m_objects.size(); i++)
00905         {
00906             int len = swprintf_s(str, bufferLength, L"%d", i);
00907             Platform::String^ string = ref new Platform::String(str, len);
00908
00909             m_savedState->SaveBool(Platform::String::Concat(":ObjectActive", string), m_objects[i]->Active());
00910             m_savedState->SaveBool(Platform::String::Concat(":ObjectTarget", string), m_objects[i]->Target());
00911             m_savedState->SaveXMFLOAT3(Platform::String::Concat(":ObjectPosition", string), m_objects[i]->Position());
00912         }
00913
00914         m_level[m_currentLevel]->SaveState(m_savedState);
00915     }
00916 }
00917
00918 //----------------------------------------------------------------------
00919
00920 void Simple3DGame::LoadState()
00921 {
00922     m_gameActive = m_savedState->LoadBool(":GameActive", m_gameActive);
00923     m_levelActive = m_savedState->LoadBool(":LevelActive", m_levelActive);
00924
00925     if (m_gameActive)
00926     {
00927         // Loading from the last known state means the game wasn't finished when it was last played,
00928         // so set the current level.
00929
00930         m_totalShots = m_savedState->LoadInt32(":TotalShots", 0);
00931         m_totalHits = m_savedState->LoadInt32(":TotalHits", 0);
00932         m_currentLevel = m_savedState->LoadInt32(":LevelCompleted", 0);
00933         m_levelBonusTime = m_savedState->LoadSingle(":BonusRoundTime", 0.0f);
00934
00935         m_levelTimeRemaining = m_levelBonusTime;
00936
00937         // Reload the current player position and set both the camera and the controller
00938         // with the current Look Direction.
00939         m_player->Position(
00940             m_savedState->LoadXMFLOAT3(":PlayerPosition", XMFLOAT3(0.0f, 0.0f, 0.0f))
00941             );
00942         m_camera->Eye(m_player->Position());
00943         m_camera->LookDirection(
00944             m_savedState->LoadXMFLOAT3(":PlayerLookDirection", XMFLOAT3(0.0f, 0.0f, 1.0f))
00945             );
00946         m_controller->Pitch(m_camera->Pitch());
00947         m_controller->Yaw(m_camera->Yaw());
00948     }
00949     else
00950     {
00951         // The game was not being played when it was last saved, so initialize to the beginning.
00952         m_currentLevel = 0;
00953         m_levelBonusTime = 0;
00954     }
00955
00956     if (m_currentLevel >= m_levelCount)
00957     {
00958         // The current level is not valid so, reset to a known state and abandon the current game.
00959         m_currentLevel = 0;
00960         m_levelBonusTime = 0;
00961         m_gameActive = false;
00962         m_levelActive = false;
00963     }
00964 }
00965
00966 //----------------------------------------------------------------------
00967
00968 void Simple3DGame::SetCurrentLevelToSavedState()
00969 {
00970     if (m_gameActive)
00971     {
00972         if (m_levelActive)
00973         {
00974             // Middle of a level so restart where left off.
00975             m_levelDuration = m_savedState->LoadSingle(":LevelDuration", 0.0f);
00976
00977             m_timer->Reset();
00978             m_timer->PlayingTime(m_savedState->LoadSingle(":LevelPlayingTime", 0.0f));
00979
00980             m_ammoCount = m_savedState->LoadInt32(":AmmoCount", 0);
00981
00982             m_ammoNext = m_savedState->LoadInt32(":AmmoNext", 0);
00983
00984             const int bufferLength = 16;
00985             char16 str[bufferLength];
00986
00987             for (uint32 i = 0; i < m_ammoCount; i++)
00988             {
00989                 int len = swprintf_s(str, bufferLength, L"%d", i);
00990                 Platform::String^ string = ref new Platform::String(str, len);
00991
00992                 m_ammo[i]->Active(
00993                     m_savedState->LoadBool(
00994                         Platform::String::Concat(":AmmoActive", string),
00995                         m_ammo[i]->Active()
00996                         )
00997                     );
00998                 if (m_ammo[i]->Active())
00999                 {
01000                     m_ammo[i]->OnGround(false);
01001                 }
01002
01003                 m_ammo[i]->Position(
01004                     m_savedState->LoadXMFLOAT3(
01005                         Platform::String::Concat(":AmmoPosition", string),
01006                         m_ammo[i]->Position()
01007                         )
01008                     );
01009
01010                 m_ammo[i]->Velocity(
01011                     m_savedState->LoadXMFLOAT3(
01012                         Platform::String::Concat(":AmmoVelocity", string),
01013                         m_ammo[i]->Velocity()
01014                         )
01015                     );
01016             }
01017
01018             int storedObjectCount = 0;
01019             storedObjectCount = m_savedState->LoadInt32(":ObjectCount", 0);
01020
01021             storedObjectCount = min(storedObjectCount, static_cast<int>(m_objects.size()));
01022
01023             for (int i = 0; i < storedObjectCount; i++)
01024             {
01025                 int len = swprintf_s(str, bufferLength, L"%d", i);
01026                 Platform::String^ string = ref new Platform::String(str, len);
01027
01028                 m_objects[i]->Active(
01029                     m_savedState->LoadBool(
01030                         Platform::String::Concat(":ObjectActive", string),
01031                         m_objects[i]->Active()
01032                         )
01033                     );
01034
01035                 m_objects[i]->Target(
01036                     m_savedState->LoadBool(
01037                         Platform::String::Concat(":ObjectTarget", string),
01038                         m_objects[i]->Target()
01039                         )
01040                     );
01041
01042                 m_objects[i]->Position(
01043                     m_savedState->LoadXMFLOAT3(
01044                         Platform::String::Concat(":ObjectPosition", string),
01045                         m_objects[i]->Position()
01046                         )
01047                     );
01048             }
01049
01050             m_level[m_currentLevel]->LoadState(m_savedState);
01051             m_levelTimeRemaining = m_level[m_currentLevel]->TimeLimit() + m_levelBonusTime - m_timer->PlayingTime();
01052         }
01053     }
01054 }
01055
01056 //----------------------------------------------------------------------
01057
01058 void Simple3DGame::SaveHighScore()
01059 {
01060     m_savedState->SaveInt32(":HighScore:LevelCompleted", m_topScore.levelCompleted);
01061     m_savedState->SaveInt32(":HighScore:TotalShots", m_topScore.totalShots);
01062     m_savedState->SaveInt32(":HighScore:TotalHits", m_topScore.totalHits);
01063 }
01064
01065 //----------------------------------------------------------------------
01066
01067 void Simple3DGame::LoadHighScore()
01068 {
01069     m_topScore.levelCompleted = m_savedState->LoadInt32(":HighScore:LevelCompleted", 0);
01070     m_topScore.totalShots = m_savedState->LoadInt32(":HighScore:TotalShots", 0);
01071     m_topScore.totalHits = m_savedState->LoadInt32(":HighScore:TotalHits", 0);
01072 }
01073
01074 //----------------------------------------------------------------------
01075
01076 void Simple3DGame::InitializeAmmo()
01077 {
01078     m_ammoCount = 0;
01079     m_ammoNext = 0;
01080     for (uint32 i = 0; i < GameConstants::MaxAmmo; i++)
01081     {
01082         m_ammo[i]->Active(false);
01083     }
01084 }
01085
01086 //----------------------------------------------------------------------
01087
01088 void Simple3DGame::InitializeGameConfig()
01089 {
01090     m_gameConfig.isTrial = true;
01091     m_gameConfig.autoFire = false;
01092     m_controller->AutoFire(false);
01093     m_activeBackground = 0;
01094     m_gameConfig.backgroundAvailable[0] = true;
01095     for (int i = 1; i < GameConstants::MaxBackgroundTextures; i++)
01096     {
01097         m_gameConfig.backgroundAvailable[i] = false;
01098     }
01099 }
01100
01101 //--------------------------------------------------------------------------------------
01102
01103 void Simple3DGame::UpdateGameConfig(LicenseInformation^ licenseInformation)
01104 {
01105     if (licenseInformation->IsActive)
01106     {
01107         m_gameConfig.isTrial = licenseInformation->IsTrial;
01108         if (!m_gameConfig.isTrial && licenseInformation->ProductLicenses->Lookup("AutoFire")->IsActive)
01109         {
01110             m_gameConfig.autoFire = true;
01111             m_controller->AutoFire(true);
01112         }
01113         else
01114         {
01115             m_gameConfig.autoFire = false;
01116             m_controller->AutoFire(false);
01117         }
01118         if (!m_gameConfig.isTrial && licenseInformation->ProductLicenses->Lookup("NightBackground")->IsActive)
01119         {
01120             m_gameConfig.backgroundAvailable[1] = true;
01121         }
01122         else
01123         {
01124             m_gameConfig.backgroundAvailable[1] = false;
01125         }
01126         if (!m_gameConfig.isTrial && licenseInformation->ProductLicenses->Lookup("DayBackground")->IsActive)
01127         {
01128             m_gameConfig.backgroundAvailable[2] = true;
01129         }
01130         else
01131         {
01132             m_gameConfig.backgroundAvailable[2] = false;
01133         }
01134     }
01135     else
01136     {
01137         // If no active license then default back to trial version.
01138         InitializeGameConfig();
01139     }
01140
01141     if (m_gameConfig.isTrial)
01142     {
01143         if (m_level.size() > 2)
01144         {
01145             m_level.erase(m_level.begin() + 2, m_level.end());
01146         }
01147     }
01148     else
01149     {
01150         if (m_level.size() == 2)
01151         {
01152             m_level.push_back(ref new Level3);
01153             m_level.push_back(ref new Level4);
01154             m_level.push_back(ref new Level5);
01155             m_level.push_back(ref new Level6);
01156         }
01157     }
01158     m_levelCount = static_cast<uint32>(m_level.size());
01159 }
01160
01161 //--------------------------------------------------------------------------------------
01162
01163 void Simple3DGame::SetBackground(uint32 background)
01164 {
01165     if (background < GameConstants::MaxBackgroundTextures)
01166     {
01167         if (m_gameConfig.backgroundAvailable[background])
01168         {
01169             m_activeBackground = background;
01170             m_renderer->SetBackground(background);
01171         }
01172     }
01173 }
01174
01175 //--------------------------------------------------------------------------------------
01176
01177 void Simple3DGame::CycleBackground()
01178 {
01179     // There may be gaps in the background textures list that are available for use because the
01180     // user has not purchased all them in order or at all.
01181     // Cycle through the list looking for the next one that is valid.  This may require wrapping
01182     // back to the beginning.
01183
01184     unsigned int newBackground = m_activeBackground;
01185
01186     while (newBackground < GameConstants::MaxBackgroundTextures)
01187     {
01188         newBackground++;
01189         if (newBackground >= GameConstants::MaxBackgroundTextures)
01190         {
01191             newBackground = 0;
01192             break;
01193         }
01194         else if (m_gameConfig.backgroundAvailable[newBackground])
01195         {
01196             break;
01197         }
01198     }
01199
01200     if (newBackground != m_activeBackground)
01201     {
01202         m_activeBackground = newBackground;
01203         m_renderer->SetBackground(newBackground);
01204     }
01205 }
01206 //--------------------------------------------------------------------------------------
01207
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/Properties/AssemblyInfo.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BindTestbedModel")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BindTestbedModel")]
00013 [assembly: AssemblyCopyright("Copyright ©  2014")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/SampleConfiguration.h Source File

  • WebAuthenticationBroker
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Web authentication broker sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MEUserControl Member List

This is the complete list of members for MEUserControl, including all inherited members.
MEUserControl() MEUserControl [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Scenario2_VideoChat.xaml.h Source File

  • SimpleCommunication
  • cpp

Scenario2_VideoChat.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Utils.h"
00015 #include "Scenario2_VideoChat.g.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2_VideoChat sealed
00024     {
00025     public:
00026         Scenario2_VideoChat();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00031         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00032
00033     private:
00034         void CallButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035         void EndCallButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036
00037         task<void> Initialize();
00038         task<void> OnInitializeCompleted(Windows::Foundation::HResult hr);
00039         void OnInitializeCompletedDispatchedHandler();
00040         task<void> Deactivate();
00041         task<void> CleanUp();
00042         task<void> StartRecordingToCustomSinkAsync();
00043         task<void> EndCall();
00044
00045         Windows::Foundation::EventRegistrationToken _incomingConnectionEventRegistrationToken;
00046         Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventRegistrationToken;
00047         Windows::Foundation::EventRegistrationToken _mediaElementFailedEventRegistrationToken;
00048         void OnIncomingConnection(Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^ sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^ args);
00049         void OnMediaCaptureFailed(CaptureDevice^ sender, CaptureFailedEventArgs^ errorEventArgs);
00050         void VideoPlaybackErrorHandler(Platform::Object^ sender, Windows::UI::Xaml::ExceptionRoutedEventArgs^ e);
00051
00052         void LockScenarioChange();
00053         void UnlockScenarioChange();
00054
00055         bool _isTerminator;
00056         bool _initialization;
00057         CaptureDevice^ _device;
00058         bool _active;
00059
00060         enum class Role
00061         {
00062             uninitialized,
00063             active,
00064             passive,
00065         };
00066         Role _role;
00067
00068         SdkSample _sdkSample;
00069         Windows::UI::Core::CoreDispatcher^ _dispatcher;
00070         long volatile _navigationDisabled;
00071     };
00072 }
Generated on Fri Nov 15 2024 22:21:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cpp/pch.cpp Source File

  • TextSegmentation
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/Project.idl Source File

  • LockScreenApps
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Configure : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Configure();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_Notifications : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_Notifications();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_SecondaryTiles : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_SecondaryTiles();
00030     }
00031 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/cs/SampleConfiguration.cs Source File

  • CameraOpenCV
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "CameraOpenCV C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Example Operations", ClassType=typeof(Scenario1_ExampleOperations)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cpp/SampleConfiguration.h Source File

  • RadialController
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Radial Controller C++ Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Helpers/StringHelper.cs Source File

  • Notifications
  • cs
  • Notifications
  • Helpers

StringHelper.cs

Go to the documentation of this file.
00001 ﻿using System.Collections.Generic;
00002 using System.Text;
00003
00004 namespace BackgroundTasks.Helpers
00005 {
00006     public static class StringHelper
00007     {
00008         public static string ToString<K, V>(this IEnumerable<KeyValuePair<K, V>> valueSet)
00009         {
00010             if (valueSet == null)
00011                 return null;
00012
00013             StringBuilder builder = new StringBuilder();
00014
00015             foreach (var value in valueSet)
00016             {
00017                 builder.Append(value.Key);
00018                 builder.Append(": ");
00019                 builder.Append(value.Value);
00020
00021                 builder.Append('\n');
00022             }
00023
00024             if (builder.Length > 0)
00025                 builder.Length--;
00026
00027             return builder.ToString();
00028         }
00029     }
00030 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario6_CustomProvider.xaml.h Source File

  • WebAccountManagement
  • cpp

Scenario6_CustomProvider.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario6_CustomProvider.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// The sixth scenario. This scenario illustrates adding a custom provider to use with Token Broker APIs.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario6_CustomProvider sealed
00015     {
00016     public:
00017         Scenario6_CustomProvider();
00018     protected:
00019         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override;
00020     private:
00021         MainPage^ rootPage;
00022         void Button_SignIn_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00023         void Button_GetTokenSilently_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00024         void Button_ManageAccount_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00025         void Button_Reset_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00026         void Button_AddProvider_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
00027         void InitalizeAccountsControlDialog();
00028         void CleanupAccountsControlDialog();
00029         void OnAccountCommandsRequested(Windows::UI::ApplicationSettings::AccountsSettingsPane^ sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^ e);
00030         void GetProvidersAndAccounts();
00031         void LoadAccount();
00032         void AddCustomProvider(Platform::String ^ providerId, Platform::String ^ authority);
00033         void AddWebAccountProviders(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00034         void AddWebAccount(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00035         void AddLinksAndDescription(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e);
00036         void WebAccountProviderCommandInvoked(Windows::UI::ApplicationSettings::WebAccountProviderCommand^ command);
00037         void WebAccountCommandInvoked(Windows::UI::ApplicationSettings::WebAccountCommand ^ command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^ args);
00038         void PrivacyPolicyInvoked(Windows::UI::Popups::IUICommand^ command);
00039         void OtherLinkInvoked(Windows::UI::Popups::IUICommand ^ command);
00040         void AuthenticateWithRequestToken(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID);
00041         void AuthenticateWithRequestTokenSilent(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID, Windows::Security::Credentials::WebAccount^ account);
00042         void OutputTokenResult(Windows::Security::Authentication::Web::Core::WebTokenRequestResult ^ result);
00043         void SaveAccount(Windows::Security::Credentials::WebAccount ^ account);
00044         void LogoffAndRemoveAccount();
00045         void RemoveCustomProviders();
00046
00047         Platform::String^ MICROSOFT_PROVIDER_ID = "https://login.microsoft.com";
00048         Platform::String^ CONSUMER_AUTHORITY = "consumers";
00049         Platform::String^ ORGANIZATION_AUTHORITY = "organizations";
00050         Platform::String^ MSA_SCOPE_REQUESTED = "wl.basic";
00051         Platform::String^ MSA_CLIENT_ID = "none";
00052         Platform::String^ AAD_SCOPE_REQUESTED = "";
00053         Platform::String^ AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb";
00054         Platform::String^ STORED_ACCOUNT_ID_KEY = "accountid";
00055         Platform::String^ STORED_PROVIDER_ID_KEY = "providerid";
00056         Platform::String^ STORED_AUTHORITY_ID_KEY = "authority";
00057         Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccountProvider^>^ m_providers;
00058         Windows::Security::Credentials::WebAccount^ m_account;
00059         Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken;
00060     };
00061 }
Generated on Fri Nov 15 2024 22:21:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_DetectInPhoto Member List

This is the complete list of members for Scenario1_DetectInPhoto, including all inherited members.
ClearVisualization() | Scenario1_DetectInPhoto | [private]
ComputeScalingTransformForSourceImage(Windows::Graphics::Imaging::BitmapDecoder const &sourceDecoder) | Scenario1_DetectInPhoto | [private]
OpenFile_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_DetectInPhoto |
PhotoCanvas_SizeChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e) | Scenario1_DetectInPhoto |
Scenario1_DetectInPhoto() | Scenario1_DetectInPhoto |
SetupVisualization(Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces) | Scenario1_DetectInPhoto | [private]
sourceImageHeightLimit | Scenario1_DetectInPhoto | [private, static]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario4.xaml.cs Source File

  • XamlCommanding
  • cs

Scenario4.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace Commanding
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class Scenario4 : Page
00022     {
00023         public Scenario4()
00024         {
00025             this.InitializeComponent();
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/DeviceListEntry.cs Source File

  • CustomUsbDeviceAccess
  • cs

DeviceListEntry.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 using Windows.Devices.Enumeration;
00019
00020 namespace CustomUsbDeviceAccess
00021 {
00022     /// <summary>
00023     /// The class will only expose properties from DeviceInformation that are going to be used
00024     /// in this sample. Each instance of this class provides information about a single device.
00025     ///
00026     /// This class is used by the UI to display device specific information so that
00027     /// the user can identify which device to use.
00028     /// </summary>
00029     public class DeviceListEntry
00030     {
00031         private DeviceInformation device;
00032         private String deviceSelector;
00033
00034         public String InstanceId
00035         {
00036             get
00037             {
00038                 return (String)device.Properties[DeviceProperties.DeviceInstanceId];
00039             }
00040         }
00041
00042         public DeviceInformation DeviceInformation
00043         {
00044             get
00045             {
00046                 return device;
00047             }
00048         }
00049
00050         public String DeviceSelector
00051         {
00052             get
00053             {
00054                 return deviceSelector;
00055             }
00056         }
00057
00058         /// <summary>
00059         /// The class is mainly used as a DeviceInformation wrapper so that the UI can bind to a list of these.
00060         /// </summary>
00061         /// <param name="deviceInformation"></param>
00062         /// <param name="deviceSelector">The AQS used to find this device</param>
00063         public DeviceListEntry(Windows.Devices.Enumeration.DeviceInformation deviceInformation, String deviceSelector)
00064         {
00065             device = deviceInformation;
00066             this.deviceSelector = deviceSelector;
00067         }
00068
00069     }
00070 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ResetPIN Member List

This is the complete list of members for Scenario3_ResetPIN, including all inherited members.
ResetPin_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_ResetPIN
Scenario3_ResetPIN() | Scenario3_ResetPIN
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/Disposer.cs Source File

  • BasicHologram
  • cs
  • Common

Disposer.cs

Go to the documentation of this file.
00001 using System;
00002
00003 namespace BasicHologram.Common
00004 {
00005     // A base class that tracks resources allocated by native code. This class is
00006     // used to release COM references to DirectX resources.
00007     public abstract class Disposer : IDisposable
00008     {
00009         #region Public methods
00010
00011         // Releases resources allocated by native code (unmanaged resources).
00012         // All disposable objects that were added to the collection will be disposed of
00013         // when this method is called.
00014         public void Dispose()
00015         {
00016             if (!IsDisposed)
00017             {
00018                 Dispose(true);
00019                 IsDisposed = true;
00020             }
00021         }
00022
00023         #endregion
00024
00025
00026         #region Protected methods and properties
00027
00028         protected internal Disposer()
00029         {
00030         }
00031
00032         // Indicates whether this instance is already disposed.
00033         protected internal bool IsDisposed { get; private set; }
00034
00035         // Disposes all IDisposable object resources in the collection of disposable
00036         // objects.
00037         //
00038         // NOTE: Since this class exists to dispose of unmanaged resources, the
00039         //       disposeManagedResources parameter is ignored.
00040         protected virtual void Dispose(bool disposeManagedResources)
00041         {
00042             // If the DisposeCollector exists, have it dispose of all COM objects.
00043             if (!IsDisposed && DisposeCollector != null)
00044             {
00045                 DisposeCollector.Dispose();
00046             }
00047
00048             // The DisposeCollector is done, and can be discarded.
00049             DisposeCollector = null;
00050         }
00051
00052         // Adds an IDisposable object to the collection of disposable objects.
00053         protected internal T ToDispose<T>(T objectToDispose)
00054         {
00055             // If objectToDispose is not null, add it to the collection.
00056             if (!ReferenceEquals(objectToDispose, null))
00057             {
00058                 // Create DisposeCollector if it doesn't already exist.
00059                 if (DisposeCollector == null)
00060                 {
00061                     DisposeCollector = new SharpDX.DisposeCollector();
00062                     IsDisposed = false;
00063                 }
00064
00065                 return DisposeCollector.Collect(objectToDispose);
00066             }
00067
00068             // Otherwise, return a default instance of type T.
00069             return default(T);
00070         }
00071
00072         // Disposes of an IDisposable object immediately and also removes the object from the
00073         // collection of disposable objects.
00074         protected internal void RemoveAndDispose<T>(ref T objectToDispose)
00075         {
00076             // If objectToDispose is not null, and if the DisposeCollector is available, have
00077             // the DisposeCollector get rid of objectToDispose.
00078             if (!ReferenceEquals(objectToDispose, null) && (DisposeCollector != null))
00079             {
00080                 DisposeCollector.RemoveAndDispose(ref objectToDispose);
00081             }
00082         }
00083
00084         // Removes an IDisposable object from the collection of disposable objects. Does not
00085         // dispose of the object before removing it.
00086         protected internal void RemoveToDispose<T>(T objectToRemove)
00087         {
00088             // If objectToRemove is not null, have the DisposeCollector forget about it.
00089             if (!ReferenceEquals(objectToRemove, null) && (DisposeCollector != null))
00090             {
00091                 DisposeCollector.Remove(objectToRemove);
00092             }
00093         }
00094
00095         #endregion
00096
00097
00098         #region Private properties
00099
00100         // The collection of disposable objects.
00101         private SharpDX.DisposeCollector DisposeCollector { get; set; }
00102
00103         #endregion
00104     }
00105 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario3_Calibration.xaml.h Source File

  • OrientationSensor
  • cpp

Scenario3_Calibration.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Calibration.xaml.h
00014 // Declaration of the Scenario3_Calibration class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario3_Calibration.g.h"
00021 #include "MainPage.xaml.h"
00022 #include "CalibrationBar.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     [Windows::Foundation::Metadata::WebHostHidden]
00030     public ref class Scenario3_Calibration sealed
00031     {
00032     public:
00033         Scenario3_Calibration();
00034
00035     protected:
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038         void OnHighAccuracy();
00039         void OnApproximateAccuracy();
00040         void OnUnreliableAccuracy();
00041
00042     private:
00043         SDKTemplate::MainPage^ rootPage;
00044         SDKTemplate::CalibrationBar^ calibrationBar;
00045     };
00046 }
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cppwinrt/Scenario2_Effects.h Source File

  • LampArray
  • cppwinrt

Scenario2_Effects.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Effects.g.h"
00015
00016 #include <numeric>
00017
00018 namespace winrt::SDKTemplate::implementation
00019 {
00020     // State for the custom wave effect.
00021     struct CustomEffectState
00022     {
00023         CustomEffectState(winrt::Windows::Devices::Lights::LampArray const& lampArray) :
00024             lampArray(lampArray),
00025             lampNormalizedX(lampArray.LampCount()),
00026             lampColors(lampNormalizedX.size(), winrt::Windows::UI::Colors::Black())
00027         { }
00028
00029         winrt::Windows::Devices::Lights::LampArray lampArray{ nullptr };
00030         uint32_t frameNumber{ 0 };
00031
00032         // A vector of each lamp's X position within the bounding box, in the range [0, 1],
00033         // where 0 is the leftmost edge and 1 is the rightmost edge.
00034         std::vector<float> lampNormalizedX;
00035
00036         // A vector of colors to be applied to each Lamp in the effect callback function.
00037         // The vector is ordered by Lamp index. The ordering does not reflect positions of any Lamp.
00038         std::vector<winrt::Windows::UI::Color> lampColors;
00039
00040         winrt::Windows::UI::Color color{ winrt::Windows::UI::Colors::HotPink() };
00041         bool isColorOn{ true };
00042     };
00043
00044     // State for the generated bitmap effect.
00045     struct GeneratedBitmapState
00046     {
00047         uint32_t bitmapWidth;
00048         uint32_t bitmapHeight;
00049         float squareLength;
00050         float squareY;
00051         uint32_t frameNumber{ 0 };
00052
00053         winrt::Microsoft::Graphics::Canvas::CanvasDevice canvasDevice{ nullptr };
00054         winrt::Microsoft::Graphics::Canvas::CanvasRenderTarget offscreenCanvas{ nullptr };
00055         winrt::Microsoft::Graphics::Canvas::CanvasDrawingSession offscreenDrawingSession{ nullptr };
00056
00057         winrt::Windows::Graphics::Imaging::SoftwareBitmap squareBitmap{ nullptr };
00058         winrt::Windows::Storage::Streams::Buffer squareBuffer{ nullptr };
00059     };
00060
00061     struct Scenario2_Effects : Scenario2_EffectsT<Scenario2_Effects>
00062     {
00063     public:
00064         Scenario2_Effects();
00065
00066         void OnNavigatedTo(winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00067         void OnNavigatedFrom(winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00068
00069         winrt::fire_and_forget StaticBitmapButton_Click(
00070             winrt::Windows::Foundation::IInspectable const& sender,
00071             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00072
00073         void FadeButton_Click(
00074             winrt::Windows::Foundation::IInspectable const& sender,
00075             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00076
00077         void CustomEffectButton_Click(
00078             winrt::Windows::Foundation::IInspectable const& sender,
00079             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00080
00081         void GeneratedBitmapButton_Click(
00082             winrt::Windows::Foundation::IInspectable const& sender,
00083             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00084
00085         void CycleButton_Click(
00086             winrt::Windows::Foundation::IInspectable const& sender,
00087             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00088
00089         void PauseButton_Click(
00090             winrt::Windows::Foundation::IInspectable const& sender,
00091             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00092
00093         void PlayButton_Click(
00094             winrt::Windows::Foundation::IInspectable const& sender,
00095             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00096
00097         void StopButton_Click(
00098             winrt::Windows::Foundation::IInspectable const& sender,
00099             winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
00100
00101     private:
00102         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00103
00104         winrt::Windows::Devices::Enumeration::DeviceWatcher m_deviceWatcher{ nullptr };
00105
00106         // Currently attached LampArrays
00107         std::vector<std::unique_ptr<LampArrayInfo>> m_attachedLampArrays;
00108
00109         winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist> m_emptyList =
00110             winrt::single_threaded_vector< winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist>().GetView();
00111
00112         // Playlists that can be paused, stopped, and started.
00113         winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist> m_readyPlaylists = m_emptyList;
00114
00115         std::default_random_engine m_random{ std::random_device()() };
00116
00117         winrt::Windows::Devices::Enumeration::DeviceWatcher::Added_revoker m_deviceAddedRevoker{};
00118         winrt::Windows::Devices::Enumeration::DeviceWatcher::Removed_revoker m_deviceRemovedRevoker{};
00119
00120         winrt::fire_and_forget Watcher_Added(
00121             winrt::Windows::Devices::Enumeration::DeviceWatcher const&,
00122             winrt::Windows::Devices::Enumeration::DeviceInformation const& deviceInformation);
00123
00124         winrt::fire_and_forget Watcher_Removed(
00125             winrt::Windows::Devices::Enumeration::DeviceWatcher const&,
00126             winrt::Windows::Devices::Enumeration::DeviceInformationUpdate deviceInformationUpdate);
00127
00128         winrt::fire_and_forget LampArray_AvailabilityChanged(
00129             winrt::Windows::Devices::Lights::LampArray const& sender,
00130             winrt::Windows::Foundation::IInspectable const&);
00131
00132         void UpdateLampArrayList();
00133         void CleanupPreviousEffect();
00134
00135         static void StaticBitmapEffect_BitmapRequested(
00136             winrt::Windows::Graphics::Imaging::SoftwareBitmap const& bitmap,
00137             winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const& args);
00138
00139         static void CustomEffect_UpdateRequested(
00140             CustomEffectState* state,
00141             winrt::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs const& args);
00142
00143         static void GeneratedBitmapEffect_UpdateRequested(
00144             GeneratedBitmapState* state,
00145             winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const& args);
00146
00147         void StartStopAllEffects(bool shouldStart);
00148
00149         static std::vector<int> GetLampArrayIndices(winrt::Windows::Devices::Lights::LampArray const& lampArray);
00150     };
00151 }
00152
00153 namespace winrt::SDKTemplate::factory_implementation
00154 {
00155     struct Scenario2_Effects : Scenario2_EffectsT<Scenario2_Effects, implementation::Scenario2_Effects>
00156     {
00157     };
00158 }
Generated on Fri Nov 15 2024 22:20:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Launch Member List

This is the complete list of members for Scenario2_Launch, including all inherited members.
CheckIf3DBuilderIsInstalled_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Launch |
LaunchAtSize_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Launch |
LaunchFileIn3DBuilder_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Launch |
LaunchInFullScreenModeCheckBox_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Launch |
PackageFamilyName3DBuilder | Scenario2_Launch | [private, static]
Scenario2_Launch() | Scenario2_Launch |
Scenario2_Launch() | Scenario2_Launch |
Scenario2_Launch() | Scenario2_Launch |
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario2_StringTemplate.cpp Source File

  • DateTimeFormatting
  • cppwinrt

Scenario2_StringTemplate.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_StringTemplate.h"
00014 #include "Scenario2_StringTemplate.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::DateTimeFormatting;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace
00023 {
00024     void GenerateResult(std::wostream& results, DateTimeFormatter const& formatter, DateTime dateToFormat)
00025     {
00026         // Perform the actual formatting.
00027         results << std::wstring_view(formatter.Template()) << L": " << std::wstring_view(formatter.Format(dateToFormat)) << std::endl;
00028     }
00029 }
00030
00031 namespace winrt::SDKTemplate::implementation
00032 {
00033     Scenario2_StringTemplate::Scenario2_StringTemplate()
00034     {
00035         InitializeComponent();
00036     }
00037
00038     void Scenario2_StringTemplate::Display_Click(IInspectable const&, RoutedEventArgs const&)
00039     {
00040         // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00041         // to format a date/time via a string template.  Note that the order specifed in the string pattern does
00042         // not determine the order of the parts of the formatted string.  The current application language and region value will
00043         // determine the pattern of the date returned based on the specified parts.
00044
00045         //Get the current application context language
00046         hstring currentLanguage = ApplicationLanguages::Languages().GetAt(0);
00047
00048         // Formatters for dates.
00049         std::array dateFormatters{
00050             DateTimeFormatter(L"month day"),
00051             DateTimeFormatter(L"month year"),
00052             DateTimeFormatter(L"month day year"),
00053             DateTimeFormatter(L"month day dayofweek year"),
00054             DateTimeFormatter(L"dayofweek.abbreviated"),
00055             DateTimeFormatter(L"month.abbreviated"),
00056             DateTimeFormatter(L"year.abbreviated"),
00057         };
00058
00059         // Formatters for time.
00060         std::array timeFormatters{
00061             DateTimeFormatter(L"hour minute"),
00062             DateTimeFormatter(L"hour minute second"),
00063             DateTimeFormatter(L"hour"),
00064         };
00065
00066         // Formatters for timezone.
00067         std::array timeZoneFormatters{
00068             DateTimeFormatter(L"timezone"),
00069             DateTimeFormatter(L"timezone.full"),
00070             DateTimeFormatter(L"timezone.abbreviated"),
00071         };
00072
00073         // Formatters for combinations.
00074         std::array combinationFormatters{
00075             DateTimeFormatter(L"hour minute second timezone.full"),
00076             DateTimeFormatter(L"day month year hour minute timezone"),
00077             DateTimeFormatter(L"dayofweek day month year hour minute second"),
00078             DateTimeFormatter(L"dayofweek.abbreviated day month hour minute"),
00079             DateTimeFormatter(L"dayofweek day month year hour minute second timezone.abbreviated"),
00080         };
00081
00082         // Obtain the date that will be formatted.
00083         DateTime dateToFormat = clock::now();
00084
00085         // Keep the results here
00086         std::wostringstream results;
00087         results << L"Current application context language: " << std::wstring_view(currentLanguage) << std::endl << std::endl;
00088         results << L"Dates:" << std::endl;
00089
00090         // Generate the results.
00091         for (auto&& formatter : dateFormatters)
00092         {
00093             GenerateResult(results, formatter, dateToFormat);
00094         }
00095
00096         results << std::endl;
00097         results << L"Times:" << std::endl;
00098
00099         // Generate the results.
00100         for (auto&& formatter : timeFormatters)
00101         {
00102             GenerateResult(results, formatter, dateToFormat);
00103         }
00104
00105         results << std::endl;
00106         results << L"Time zones:" << std::endl;
00107
00108         // Generate the results.
00109         for (auto&& formatter : timeZoneFormatters)
00110         {
00111             GenerateResult(results, formatter, dateToFormat);
00112         }
00113
00114         results << std::endl;
00115         results << L"Date and time combinations:" << std::endl;
00116
00117         // Generate the results.
00118         for (auto&& formatter : combinationFormatters)
00119         {
00120             GenerateResult(results, formatter, dateToFormat);
00121         }
00122
00123         // Display the results.
00124         OutputTextBlock().Text(results.str());
00125     }
00126 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PropertyGetContext< T > Member List

This is the complete list of members for PropertyGetContext< T >, including all inherited members.
GetStatus() | PropertyGetContext< T > | [inline]
GetStatus() | PropertyGetContext< T > | [inline]
GetValue() | PropertyGetContext< T > | [inline]
GetValue() | PropertyGetContext< T > | [inline]
m_event | PropertyGetContext< T > | [private]
m_status | PropertyGetContext< T > | [private]
m_value | PropertyGetContext< T > | [private]
SetEvent() | PropertyGetContext< T > | [inline]
SetEvent() | PropertyGetContext< T > | [inline]
SetStatus(QStatus value) | PropertyGetContext< T > | [inline]
SetStatus(QStatus value) | PropertyGetContext< T > | [inline]
SetValue(T value) | PropertyGetContext< T > | [inline]
SetValue(T value) | PropertyGetContext< T > | [inline]
Wait() | PropertyGetContext< T > | [inline]
Wait() | PropertyGetContext< T > | [inline]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PageToPrint Member List

This is the complete list of members for PageToPrint, including all inherited members.
PageToPrint() | PageToPrint | [inline]
TextContentBlock | PageToPrint |
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/Scenario1.xaml.cs Source File

  • MultipleViews
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SecondaryViewsHelpers;
00013 using System;
00014 using System.Collections.Generic;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.UI.Core;
00017 using Windows.UI.ViewManagement;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed class SizePreferenceString
00024     {
00025         public string Title { get; set;}
00026         public ViewSizePreference Preference { get; set; }
00027     }
00028
00029     public sealed partial class Scenario1
00030     {
00031         const string DEFAULT_TITLE = "New window";
00032         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00033         // as NotifyUser()
00034         MainPage rootPage = MainPage.Current;
00035
00036         public Scenario1()
00037         {
00038             this.InitializeComponent();
00039
00040             // "UseNone" is not a valid choice for the incoming view, so only include
00041             // it in the anchor size preference chooser
00042             var anchorSizeChoices = GenerateSizePreferenceBinding();
00043             anchorSizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseNone, Title = "UseNone" });
00044             AnchorSizePreferenceChooser.ItemsSource = anchorSizeChoices;
00045             AnchorSizePreferenceChooser.SelectedIndex = 0;
00046
00047             SizePreferenceChooser.ItemsSource = GenerateSizePreferenceBinding();
00048             SizePreferenceChooser.SelectedIndex = 0;
00049
00050             // This collection is being bound to the current thread.
00051             // So, make sure you only update the collection and items
00052             // contained in it from this thread.
00053             ViewChooser.ItemsSource = ((App)App.Current).SecondaryViews;
00054         }
00055
00056         private List<SizePreferenceString> GenerateSizePreferenceBinding()
00057         {
00058             var sizeChoices = new List<SizePreferenceString>();
00059             sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.Default,    Title = "Default" });
00060             sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseHalf,    Title = "UseHalf" });
00061             sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseLess,    Title = "UseLess" });
00062             sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseMinimum, Title = "UseMinimum" });
00063             sizeChoices.Add(new SizePreferenceString() { Preference = ViewSizePreference.UseMore,    Title = "UseMore" });
00064
00065             return sizeChoices;
00066         }
00067
00068         private async void CreateView_Click(object sender, RoutedEventArgs e)
00069         {
00070             // Set up the secondary view, but don't show it yet
00071             ViewLifetimeControl viewControl = null;
00072             await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00073             {
00074                 // This object is used to keep track of the views and important
00075                 // details about the contents of those views across threads
00076                 // In your app, you would probably want to track information
00077                 // like the open document or page inside that window
00078                 viewControl = ViewLifetimeControl.CreateForCurrentView();
00079                 viewControl.Title = DEFAULT_TITLE;
00080                 // Increment the ref count because we just created the view and we have a reference to it
00081                 viewControl.StartViewInUse();
00082
00083                 var frame = new Frame();
00084                 frame.Navigate(typeof(SecondaryViewPage), viewControl);
00085                 Window.Current.Content = frame;
00086                 // This is a change from 8.1: In order for the view to be displayed later it needs to be activated.
00087                 Window.Current.Activate();
00088                 ApplicationView.GetForCurrentView().Title = viewControl.Title;
00089             });
00090
00091             // Be careful! This collection is bound to the current thread,
00092             // so make sure to update it only from this thread
00093             ((App)App.Current).SecondaryViews.Add(viewControl);
00094         }
00095
00096         private async void ShowAsStandalone_Click(object sender, RoutedEventArgs e)
00097         {
00098             var selectedView = ViewChooser.SelectedItem as ViewLifetimeControl;
00099             var sizePreference = SizePreferenceChooser.SelectedItem as SizePreferenceString;
00100             var anchorSizePreference = AnchorSizePreferenceChooser.SelectedItem as SizePreferenceString;
00101
00102             if (selectedView != null && sizePreference != null && anchorSizePreference != null)
00103             {
00104                 try
00105                 {
00106                     // Prevent the view from closing while
00107                     // switching to it
00108                     selectedView.StartViewInUse();
00109
00110                     // Show the previously created secondary view, using the size
00111                     // preferences the user specified. In your app, you should
00112                     // choose a size that's best for your scenario and code it,
00113                     // instead of requiring the user to decide.
00114                     var viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(
00115                         selectedView.Id,
00116                         sizePreference.Preference,
00117                         ApplicationView.GetForCurrentView().Id,
00118                         anchorSizePreference.Preference);
00119
00120                     if (!viewShown)
00121                     {
00122                         // The window wasn't actually shown, so release the reference to it
00123                         // This may trigger the window to be destroyed
00124                         rootPage.NotifyUser("The view was not shown. Make sure it has focus", NotifyType.ErrorMessage);
00125                     }
00126
00127                     // Signal that switching has completed and let the view close
00128                     selectedView.StopViewInUse();
00129                 }
00130                 catch (InvalidOperationException)
00131                 {
00132                     // The view could be in the process of closing, and
00133                     // this thread just hasn't updated. As part of being closed,
00134                     // this thread will be informed to clean up its list of
00135                     // views (see SecondaryViewPage.xaml.cs)
00136                 }
00137             }
00138             else
00139             {
00140                 rootPage.NotifyUser("Please choose a view to show, a size preference for each view", NotifyType.ErrorMessage);
00141             }
00142         }
00143     }
00144 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ProactiveRequest Member List

This is the complete list of members for Scenario2_ProactiveRequest, including all inherited members.
Scenario2_ProactiveRequest() Scenario2_ProactiveRequest [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DoubleToIntConverter Member List

This is the complete list of members for DoubleToIntConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | DoubleToIntConverter | [inline, private]
Convert(object value, Type targetType, object parameter, string language) | DoubleToIntConverter | [inline, private]
ConvertBack(object value, Type targetType, object parameter, string language) | DoubleToIntConverter | [inline, private]
ConvertBack(object value, Type targetType, object parameter, string language) | DoubleToIntConverter | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario7_DownloadReordering.xaml.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario7_DownloadReordering.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario7_DownloadReordering.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Windows::Networking;
00019 using namespace Windows::Networking::BackgroundTransfer;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Web;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::Storage;
00029 using namespace Platform::Collections;
00030 using namespace Platform;
00031
00032 DownloadOperationItem::DownloadOperationItem(DownloadOperation^ download)
00033 {
00034     _download = download;
00035     _percentComplete = 0;
00036     _stateText = "Idle";
00037 }
00038
00039 DownloadOperation^ DownloadOperationItem::download::get()
00040 {
00041     return _download;
00042 }
00043
00044 int DownloadOperationItem::percentComplete::get()
00045 {
00046     return _percentComplete;
00047 }
00048
00049 void DownloadOperationItem::percentComplete::set(int value)
00050 {
00051     if (_percentComplete != value)
00052     {
00053         _percentComplete = value;
00054         PropertyChanged(this, ref new PropertyChangedEventArgs("percentComplete"));
00055     }
00056 }
00057
00058 String^ DownloadOperationItem::stateText::get()
00059 {
00060     return _stateText;
00061 }
00062
00063 void DownloadOperationItem::stateText::set(String^ value)
00064 {
00065     if (_stateText != value)
00066     {
00067         _stateText = value;
00068         PropertyChanged(this, ref new PropertyChangedEventArgs("stateText"));
00069     }
00070 }
00071
00072 Scenario7_DownloadReordering::Scenario7_DownloadReordering()
00073 {
00074     reorderGroup = BackgroundTransferGroup::CreateGroup("{7421B969-18D4-4532-B6BD-22BDABF71C08}");
00075     reorderGroup->TransferBehavior = BackgroundTransferBehavior::Serialized;
00076     _downloadCollection = ref new Vector<DownloadOperationItem^>();
00077
00078     DataContext = this;
00079     InitializeComponent();
00080 }
00081
00082 IObservableVector<DownloadOperationItem^>^ Scenario7_DownloadReordering::downloadCollection::get()
00083 {
00084     return _downloadCollection;
00085 }
00086
00087 void Scenario7_DownloadReordering::OnNavigatedTo(NavigationEventArgs^ e)
00088 {
00089     rootPage = MainPage::Current;
00090     CancelActiveDownloadsAsync().then([this](task<std::vector<DownloadOperation^>> previousTask)
00091     {
00092         try
00093         {
00094             previousTask.get();
00095         }
00096         catch (Exception^ ex)
00097         {
00098             if (!IsWebException("Discovery error", ex))
00099             {
00100                 throw;
00101             }
00102         }
00103     });
00104 }
00105
00106 task<std::vector<DownloadOperation^>> Scenario7_DownloadReordering::CancelActiveDownloadsAsync()
00107 {
00108     // Only the downloads that belong to the transfer group used by this sample scenario will be
00109     // canceled.
00110     return create_task(BackgroundDownloader::GetCurrentDownloadsForTransferGroupAsync(reorderGroup))
00111         .then([this](IVectorView<DownloadOperation^>^ downloads)
00112     {
00113         std::vector<task<DownloadOperation^>> tasks;
00114
00115         // If previous instances of this scenario started transfers that haven't completed yet,
00116         // cancel them now so that we can start this scenario cleanly.
00117         if (downloads->Size > 0)
00118         {
00119             cancellation_token_source cancellationToken;
00120
00121             for (DownloadOperation^ download : downloads) {
00122                 tasks.push_back(create_task(download->AttachAsync(), cancellationToken.get_token()));
00123             }
00124
00125             cancellationToken.cancel();
00126         }
00127
00128         return when_all(tasks.begin(), tasks.end());
00129     });
00130 }
00131
00132 void Scenario7_DownloadReordering::StartDownload_Click(Object^ sender, RoutedEventArgs^ e)
00133 {
00134     Button^ startButton = safe_cast<Button^>(sender);
00135     startButton->IsEnabled = false;
00136
00137     // Create and start downloads.
00138     RunDownloadsAsync().then([this, startButton]()
00139     {
00140         // After all downloads are complete, let the user start new ones again.
00141         startButton->IsEnabled = true;
00142     }, task_continuation_context::use_current());
00143 }
00144
00145 void Scenario7_DownloadReordering::MakeCurrent_Click(Object^ sender, RoutedEventArgs e)
00146 {
00147     Button^ button = safe_cast<Button^>(sender);
00148     DownloadOperationItem^ item = safe_cast<DownloadOperationItem^>(button->DataContext);
00149
00150     // Make the selected operation current.
00151     item->download->MakeCurrentInTransferGroup();
00152 }
00153
00154 task<void> Scenario7_DownloadReordering::RunDownloadsAsync()
00155 {
00156     // Create a downloader and associate all its downloads with the transfer group used for this
00157     // scenario.
00158     BackgroundDownloader^ downloader = ref new BackgroundDownloader();
00159     downloader->TransferGroup = reorderGroup;
00160
00161     // Validating the URI is required since it was received from an untrusted source (user input).
00162     // The URI is validated by calling rootPage->TryGetUri() that will return 'false' for strings
00163     // that are not valid URIs.
00164     // Note that when enabling the text box users may provide URIs to machines on the intranet that
00165     // require the "Private Networks (Client and Server)" capability.
00166     String^ remoteAddress = StringTrimmer::Trim(remoteAddressField->Text);
00167     Uri^ tmpUri;
00168     if (!rootPage->TryGetUri(remoteAddress, &tmpUri))
00169     {
00170         return task_from_result();
00171     }
00172
00173     String^ fileName = StringTrimmer::Trim(fileNameField->Text);
00174     if (fileName->IsEmpty())
00175     {
00176         rootPage->NotifyUser("A local file name is required.", NotifyType::ErrorMessage);
00177         return task_from_result();
00178     }
00179
00180     // Try to create some downloads.
00181     std::vector<task<DownloadOperation^>> createDownloadTasks;
00182     for (int i = 0; i < NumDownloads; i++)
00183     {
00184         String^ currRemoteAddress = remoteAddress + "?id=" + i.ToString();
00185         String^ currFileName = i.ToString() + "." + fileName;
00186         createDownloadTasks.push_back(CreateDownloadAsync(downloader, currRemoteAddress, currFileName));
00187     }
00188
00189     return when_all(createDownloadTasks.begin(), createDownloadTasks.end())
00190         .then([this](std::vector<DownloadOperation^> downloads)
00191     {
00192         // Once all downloads have been created, start them.
00193         _downloadCollection->Clear();
00194         std::vector<task<void>> downloadTasks;
00195         for (DownloadOperation^ download : downloads)
00196         {
00197             DownloadOperationItem^ item = ref new DownloadOperationItem(download);
00198             downloadTasks.push_back(DownloadAsync(item));
00199             _downloadCollection->Append(item);
00200         }
00201         return when_all(downloadTasks.begin(), downloadTasks.end());
00202     });
00203 }
00204
00205 task<DownloadOperation^> Scenario7_DownloadReordering::CreateDownloadAsync(
00206     BackgroundDownloader^ downloader,
00207     String^ remoteAddress,
00208     String^ fileName)
00209 {
00210     return create_task(KnownFolders::PicturesLibrary->CreateFileAsync(
00211             fileName,
00212             CreationCollisionOption::GenerateUniqueName))
00213         .then([this, downloader, remoteAddress](StorageFile^ destinationFile)
00214     {
00215         Uri^ source = ref new Uri(remoteAddress);
00216         return downloader->CreateDownload(source, destinationFile);
00217     });
00218 }
00219
00220
00221 task<void> Scenario7_DownloadReordering::DownloadAsync(DownloadOperationItem^ item)
00222 {
00223     IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ async = item->download->StartAsync();
00224     async->Progress = ref new AsyncOperationProgressHandler<DownloadOperation^, DownloadOperation^>(
00225         [this, item](
00226             IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ operation,
00227             DownloadOperation^ download)
00228     {
00229         DownloadProgress(item);
00230     });
00231     return create_task(async).then([this, item](DownloadOperation^ download)
00232     {
00233         item->stateText = item->download->Progress.Status.ToString();
00234         rootPage->NotifyUser(
00235             "Downloading " + item->download->ResultFile->Name + " completed.",
00236             NotifyType::StatusMessage);
00237     }).then([this, item](task<void> previousTask)
00238     {
00239         try
00240         {
00241             previousTask.get();
00242         }
00243         catch (Exception^ ex)
00244         {
00245             // Ignore canceled downloads since they are not displayed.
00246             if (item->download->Progress.Status != BackgroundTransferStatus::Canceled)
00247             {
00248                 // Ensure that we reach 100% even for errors.
00249                 item->percentComplete = 100;
00250                 item->stateText = item->download->Progress.Status.ToString();
00251                 if (!IsWebException("Execution error", ex, item->download))
00252                 {
00253                     throw;
00254                 }
00255             }
00256         }
00257     });
00258 }
00259
00260 void Scenario7_DownloadReordering::DownloadProgress(DownloadOperationItem^ item)
00261 {
00262     BackgroundDownloadProgress currentProgress = item->download->Progress;
00263     BackgroundTransferStatus status = currentProgress.Status;
00264     int percentComplete = 0;
00265
00266     if (currentProgress.TotalBytesToReceive > 0)
00267     {
00268         percentComplete = (int)((currentProgress.BytesReceived * 100) / currentProgress.TotalBytesToReceive);
00269     }
00270
00271     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00272         [this, item, status, percentComplete]()
00273     {
00274         item->stateText = status.ToString();
00275         item->percentComplete = percentComplete;
00276     }));
00277 }
00278
00279 bool Scenario7_DownloadReordering::IsWebException(String^ title, Exception^ ex, DownloadOperation^ download)
00280 {
00281     WebErrorStatus error = BackgroundTransferError::GetStatus(ex->HResult);
00282     bool result = (error != WebErrorStatus::Unknown);
00283     String^ message = result ? error.ToString() : ex->Message;
00284
00285     if (download == nullptr)
00286     {
00287         rootPage->NotifyUser(title + ": " + message, NotifyType::ErrorMessage);
00288     }
00289     else
00290     {
00291         rootPage->NotifyUser(download->ResultFile->Name + " - " + title + ": " + message, NotifyType::ErrorMessage);
00292     }
00293
00294     return result;
00295 }
Generated on Fri Nov 15 2024 22:18:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario5_SelectingAudioTracks.xaml.cs Source File

  • VideoPlayback
  • cs

Scenario5_SelectingAudioTracks.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Logging;
00013 using System;
00014 using Windows.Media.Core;
00015 using Windows.Media.Playback;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// Demonstrates multi-track audio playback and language selection.
00024     /// </summary>
00025     public sealed partial class Scenario5 : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028         private MediaPlaybackItemLogger mpiLogger;
00029         MediaPlaybackItem item;
00030
00031         public Scenario5()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedTo(NavigationEventArgs e)
00037         {
00038             this.item = new MediaPlaybackItem(MediaSource.CreateFromUri(rootPage.CaptionedMediaUri));
00039             mpiLogger = new MediaPlaybackItemLogger(LoggerControl, item);
00040
00041             item.AudioTracks.SelectedIndexChanged += AudioTracks_SelectedIndexChanged;
00042
00043             this.mediaPlayerElement.Source = item;
00044             LoggerControl.Log($"Loaded: {rootPage.CaptionedMediaUri}");
00045         }
00046
00047         protected override void OnNavigatedFrom(NavigationEventArgs e)
00048         {
00049             mpiLogger?.Dispose();
00050             mpiLogger = null;
00051             MediaPlayerHelper.CleanUpMediaPlayerSource(mediaPlayerElement.MediaPlayer);
00052         }
00053
00054         private void TrackButton_Click(object sender, RoutedEventArgs e)
00055         {
00056             // Get the audio track index based on value of the 'tag' field
00057             var button = sender as Button;
00058             var audioTrackIndex = int.Parse(button.Tag as string);
00059
00060             // Select the clicked audio track
00061             if (this.item != null && this.item.AudioTracks != null && this.item.AudioTracks.Count - 1 >= audioTrackIndex)
00062             {
00063                 this.item.AudioTracks.SelectedIndex = audioTrackIndex;
00064             }
00065         }
00066
00067         private void AudioTracks_SelectedIndexChanged(ISingleSelectMediaTrackList sender, object args)
00068         {
00069             var audioTrackIndex = sender.SelectedIndex;
00070
00071             LoggerControl.Log("Switched to audio track #" + (audioTrackIndex + 1)
00072                     + " | Id: " + this.item.AudioTracks[audioTrackIndex].Id
00073                     + " | Label: " + this.item.AudioTracks[audioTrackIndex].Label
00074                     + " | Language: " + this.item.AudioTracks[audioTrackIndex].Language);
00075
00076         }
00077     }
00078 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/Server/module.cpp Source File

  • WRLInProcessWinRTComponent
  • cpp
  • Server

module.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include <wrl\module.h>
00008
00009 STDAPI DllGetActivationFactory(_In_ HSTRING activatibleClassId, _COM_Outptr_ IActivationFactory** factory)
00010 {
00011     auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
00012     return module.GetActivationFactory(activatibleClassId, factory);
00013 }
00014
00015 STDAPI DllCanUnloadNow()
00016 {
00017     auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
00018     return module.Terminate() ? S_OK : S_FALSE;
00019 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileSavePicker_SaveToAppStorage Member List

This is the complete list of members for FileSavePicker_SaveToAppStorage, including all inherited members.
FileSavePicker_SaveToAppStorage() | FileSavePicker_SaveToAppStorage | [inline]
fileSavePickerUI | FileSavePicker_SaveToAppStorage | [private]
OnNavigatedFrom(NavigationEventArgs e) | FileSavePicker_SaveToAppStorage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | FileSavePicker_SaveToAppStorage | [inline, protected]
OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e) | FileSavePicker_SaveToAppStorage | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8 Member List

This is the complete list of members for Scenario8, including all inherited members.
CopyFileButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario8
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario8
Scenario8() | Scenario8
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/pch.cpp Source File

  • HolographicMixedRealityCapture
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario2_SampleBackgroundTaskWithCondition.xaml.h Source File

  • BackgroundActivation
  • cpp

Scenario2_SampleBackgroundTaskWithCondition.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2_SampleBackgroundTaskWithCondition.xaml.h
00013 // Declaration of the SampleBackgroundTaskWithCondition class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2_SampleBackgroundTaskWithCondition.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class SampleBackgroundTaskWithCondition sealed
00029     {
00030     public:
00031         SampleBackgroundTaskWithCondition();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035     private:
00036         SDKTemplate::MainPage^ rootPage;
00037
00038         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00039         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00042         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00043         void UpdateUI();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:18:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/BackgroundTaskStatus.cs Source File

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers

BackgroundTaskStatus.cs

Go to the documentation of this file.
00001 ﻿namespace BackgroundTasks.Helpers
00002 {
00003     public enum BackgroundTaskStatus
00004     {
00005         Error,
00006         Success
00007     }
00008 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OnboardingService Member List

This is the complete list of members for OnboardingService, including all inherited members.
ConfigureWiFiAsync(AllJoynMessageInfo info, string interfaceMemberSsid, string interfaceMemberPassphrase, short interfaceMemberAuthType) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::ConfigureWiFiAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberSSID, _In_ Platform::String^interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType) | IOnboardingService |
ConnectAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::ConnectAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
ConnectRequestRecieved | OnboardingService | [static]
GetLastErrorAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::GetLastErrorAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
GetScanInfoAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::GetScanInfoAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
GetStateAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::GetStateAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
GetVersionAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::GetVersionAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
OffboardAsync(AllJoynMessageInfo info) | OnboardingService | [inline, private]
org::alljoyn::Onboarding::IOnboardingService::OffboardAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | IOnboardingService |
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ViewModelBase.cs Source File

  • PlayReady
  • cs
  • ViewModels

ViewModelBase.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013
00014 using System.Collections.ObjectModel;
00015 using System.ComponentModel;
00016 using System.Runtime.CompilerServices;
00017 using Windows.ApplicationModel.Core;
00018 using Windows.Media.Protection;
00019 using Windows.UI.Core;
00020
00021 namespace SDKTemplate.ViewModels
00022 {
00023     public class ViewModelBase : INotifyPropertyChanged
00024     {
00025
00026         public event PropertyChangedEventHandler PropertyChanged;
00027         /// <summary>
00028         /// Fires an event when called. Used to update the UI in the MVVM world.
00029         /// [CallerMemberName] Ensures only the peoperty that calls it gets the event
00030         /// and not every property
00031         /// </summary>
00032         protected void RaisePropertyChanged([CallerMemberName] string propertyName = "")
00033         {
00034             if (this.PropertyChanged != null)
00035             {
00036                 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
00037             }
00038         }
00039
00040         public async static void Log(string message)
00041         {
00042             var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
00043             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00044             {
00045                 outputLog.Insert(0, message);
00046             });
00047         }
00048
00049         public async void SetPlaybackEnabled(bool enabled)
00050         {
00051             var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
00052             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00053             {
00054                 PlaybackEnabled = enabled;
00055             });
00056         }
00057
00058         /// <summary>
00059         /// Provides media and drm bindable logging for ViewModels.
00060         /// </summary>
00061         private static ObservableCollection<string> outputLog = new ObservableCollection<string>();
00062         public ObservableCollection<string> OutputLog
00063         {
00064             get { return outputLog; }
00065             private set { outputLog = value; }
00066         }
00067
00068         /// <summary>
00069         /// A ProtectionManager is assigned to a MediaElement(or MediaPlayer) instance to
00070         /// provide two way communication between the player and PlayReady DRM.
00071         /// </summary>
00072         private MediaProtectionManager protectionManager;
00073         public MediaProtectionManager ProtectionManager
00074         {
00075             get
00076             {
00077                 return protectionManager;
00078             }
00079             protected set
00080             {
00081                 if (protectionManager != value)
00082                 {
00083                     protectionManager = value;
00084                     RaisePropertyChanged();
00085                 }
00086             }
00087         }
00088
00089         /// <summary>
00090         ///
00091         /// </summary>
00092         private bool playbackEnabled = false;
00093         public bool PlaybackEnabled
00094         {
00095             get
00096             {
00097                 return playbackEnabled;
00098             }
00099             protected set
00100             {
00101                 if (playbackEnabled != value)
00102                 {
00103                     playbackEnabled = value;
00104                     RaisePropertyChanged();
00105                 }
00106             }
00107         }
00108
00109     }
00110 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario6_TimeZone.xaml.cpp Source File

  • DateTimeFormatting
  • cpp

Scenario6_TimeZone.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_TimeZone.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Globalization;
00022 using namespace Windows::Globalization::DateTimeFormatting;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 Scenario6_TimeZone::Scenario6_TimeZone()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void Scenario6_TimeZone::Display()
00033 {
00034     // This scenario illustrates time zone support in DateTimeFormatter class
00035
00036     // Displayed time zones (other than local time zone)
00037     auto timeZones = ref new Vector<String^>({ "UTC", "America/New_York", "Asia/Kolkata" });
00038
00039     // Keep the results here
00040     String^ results = "";
00041
00042     // Create formatter object using longdate and longtime template
00043     DateTimeFormatter^ dateFormatter = ref new DateTimeFormatter("longdate longtime");
00044
00045     // Create date/time to format and display.
00046     Windows::Globalization::Calendar^ calendar = ref new Windows::Globalization::Calendar();
00047     Windows::Foundation::DateTime dateToFormat = calendar->GetDateTime();
00048
00049     // Show current time.
00050     results += "Current date and time\n" +
00051         "In Local time zone: " + dateFormatter->Format(dateToFormat) + "\n";
00052     for (auto timeZone : timeZones)
00053     {
00054         results += "In " + timeZone + " time zone: " + dateFormatter->Format(dateToFormat, timeZone) + "\n";
00055     }
00056     results += "\n";
00057
00058     // Show a time on 14th day of second month of next year.
00059     // Note the effect of daylight saving on the results.
00060     calendar->AddYears(1); calendar->Month = 2; calendar->Day = 14;
00061     dateToFormat = calendar->GetDateTime();
00062     results += "Same time on 14th day of second month of next year\n" +
00063         "In Local time zone: " + dateFormatter->Format(dateToFormat) + "\n";
00064     for (auto timeZone : timeZones)
00065     {
00066         results += "In " + timeZone + " time zone: " + dateFormatter->Format(dateToFormat, timeZone) + "\n";
00067     }
00068     results += "\n";
00069
00070     // Show a time on 14th day of tenth month of next year.
00071     // Note the effect of daylight saving on the results.
00072     calendar->AddMonths(8);
00073     dateToFormat = calendar->GetDateTime();
00074     results += "Same time on 14th day of tenth month of next year\n" +
00075         "In Local time zone: " + dateFormatter->Format(dateToFormat) + "\n";
00076     for (auto timeZone : timeZones)
00077     {
00078         results += "In " + timeZone + " time zone: " + dateFormatter->Format(dateToFormat, timeZone) + "\n";
00079     }
00080     results += "\n";
00081
00082     // Display the results.
00083     OutputTextBlock->Text = results;
00084 }
Generated on Fri Nov 15 2024 22:19:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleOverlay Member List

This is the complete list of members for SampleOverlay, including all inherited members.
CreateDeviceDependentResources() | SampleOverlay |
CreateWindowSizeDependentResources() | SampleOverlay |
GetTitleHeightInDips() | SampleOverlay |
m_caption | SampleOverlay | [private]
m_deviceResources | SampleOverlay | [private]
m_drawOverlay | SampleOverlay | [private]
m_idIncrement | SampleOverlay | [private]
m_logoBitmap | SampleOverlay | [private]
m_logoSize | SampleOverlay | [private]
m_overlayWidth | SampleOverlay | [private]
m_padding | SampleOverlay | [private]
m_stateBlock | SampleOverlay | [private]
m_textLayout | SampleOverlay | [private]
m_textVerticalOffset | SampleOverlay | [private]
m_whiteBrush | SampleOverlay | [private]
ReleaseDeviceDependentResources() | SampleOverlay |
Render() | SampleOverlay |
SampleOverlay(const std::shared_ptr< DX::DeviceResources > &deviceResources, const std::wstring &caption) | SampleOverlay |
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/Scenario1Basic.xaml.h Source File

  • Printing
  • cpp

Scenario1Basic.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario1Basic.g.h"
00006 #include "PrintHelper.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// Scenario that demonstrates how to invoke the Print UI
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario1Basic sealed
00015     {
00016     public:
00017         Scenario1Basic();
00018     protected:
00019         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00020         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00021     private:
00022         PrintHelper^ printHelper;
00023         void OnPrintButtonClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024     };
00025 }
Generated on Fri Nov 15 2024 22:21:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceFamilyTrigger Member List

This is the complete list of members for DeviceFamilyTrigger, including all inherited members.
_currentDeviceFamily | DeviceFamilyTrigger | [private]
_queriedDeviceFamily | DeviceFamilyTrigger | [private]
DeviceFamily | DeviceFamilyTrigger |
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/SampleConfiguration.cpp Source File

  • DateTimeFormatting
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Format date and time using long and short", "SDKTemplate.Scenario1_LongAndShortFormats" },
00021     { "Format using a string template", "SDKTemplate.Scenario2_StringTemplate" },
00022     { "Format using a parameterized template", "SDKTemplate.Scenario3_ParameterizedTemplate" },
00023     { "Override the current user's settings", "SDKTemplate.Scenario4_Override" },
00024     { "Format using Unicode extensions", "SDKTemplate.Scenario5_UnicodeExtensions" },
00025     { "Format using different time zones", "SDKTemplate.Scenario6_TimeZone" }
00026 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/Scenario1_ParseAndStringify.h Source File

  • Json
  • cppwinrt

Scenario1_ParseAndStringify.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <winrt/SDKTemplate.h>
00015 #include "Scenario1_ParseAndStringify.g.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_ParseAndStringify : Scenario1_ParseAndStringifyT<Scenario1_ParseAndStringify>
00020     {
00021         Scenario1_ParseAndStringify();
00022
00023         void Parse_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         void Stringify_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void Add_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         void DeleteSchool_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031
00032         SDKTemplate::User CurrentUser() { return DataContext().as<SDKTemplate::User>(); }
00033         void CurrentUser(SDKTemplate::User const& user) { DataContext(user); }
00034
00035         bool IsExceptionHandled(hresult_error const& ex);
00036     };
00037 }
00038
00039 namespace winrt::SDKTemplate::factory_implementation
00040 {
00041     struct Scenario1_ParseAndStringify : Scenario1_ParseAndStringifyT<Scenario1_ParseAndStringify, implementation::Scenario1_ParseAndStringify>
00042     {
00043     };
00044 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
Microsoft::Samples::SimpleCommunication::Network::CNetworkChannel::__pad0__ | CNetworkChannel |
_acceptOperation | sealed | [private]
_completionEvent | sealed | [private]
_connectionReceivedToken | sealed | [private]
_critSec | sealed | [private]
Microsoft::Samples::SimpleCommunication::Network::CNetworkChannel::_critSec | CNetworkChannel | [protected]
_fAsyncOperationInProgress | sealed | [private]
_listener | sealed | [private]
_listeningPort | sealed | [private]
_parent | sealed | [private]
AcceptAsync() | sealed | [virtual]
AcceptAsync(unsigned short port) | sealed |
Microsoft::Samples::SimpleCommunication::Network::INetworkServer::AcceptAsync() | INetworkServer |
CheckClosed() | CNetworkChannel | [inline, protected]
Close() override | CNetworkChannel | [virtual]
ConnectAsync(String^url, WORD wPort) | sealed | [virtual]
critSec | sealed |
Detach() | sealed | [private]
Disconnect() override | CNetworkChannel | [virtual]
GetSocket() | CNetworkChannel | [inline, protected]
OnClose() override | sealed | [protected, virtual]
Microsoft::Samples::SimpleCommunication::Network::CNetworkChannel::OnClose() | CNetworkChannel | [inline, protected, virtual]
OnConnectionReceived(Windows::Networking::Sockets::StreamSocketListener^sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^args) | sealed | [private]
ReceiveAsync(_In_ IMediaBufferWrapper *pBuffer) override | CNetworkChannel | [virtual]
SendAsync(_In_ IBufferPacket *pPacket) override | CNetworkChannel | [virtual]
SetSocket(IStreamSocket^socket) | CNetworkChannel | [inline, protected]
~CAcceptOperation() | sealed | [virtual]
~CNetworkChannel() | CNetworkChannel | [virtual]
~CNetworkClient() | sealed | [virtual]
~CNetworkServer() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/StepTimer.h Source File

  • SpatialInteractionSource
  • cpp
  • Common

StepTimer.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 namespace DX
00004 {
00005     // Helper class for animation and simulation timing.
00006     class StepTimer
00007     {
00008     public:
00009         StepTimer() :
00010             m_elapsedTicks(0),
00011             m_totalTicks(0),
00012             m_leftOverTicks(0),
00013             m_frameCount(0),
00014             m_framesPerSecond(0),
00015             m_framesThisSecond(0),
00016             m_qpcSecondCounter(0),
00017             m_isFixedTimeStep(false),
00018             m_targetElapsedTicks(TicksPerSecond / 60)
00019         {
00020             m_qpcFrequency = GetPerformanceFrequency();
00021
00022             // Initialize max delta to 1/10 of a second.
00023             m_qpcMaxDelta = m_qpcFrequency / 10;
00024         }
00025
00026         // Get elapsed time since the previous Update call.
00027         uint64 GetElapsedTicks() const                        { return m_elapsedTicks;                  }
00028         double GetElapsedSeconds() const                      { return TicksToSeconds(m_elapsedTicks);  }
00029
00030         // Get total time since the start of the program.
00031         uint64 GetTotalTicks() const                          { return m_totalTicks;                    }
00032         double GetTotalSeconds() const                        { return TicksToSeconds(m_totalTicks);    }
00033
00034         // Get total number of updates since start of the program.
00035         uint32 GetFrameCount() const                          { return m_frameCount;                    }
00036
00037         // Get the current framerate.
00038         uint32 GetFramesPerSecond() const                     { return m_framesPerSecond;               }
00039
00040         // Set whether to use fixed or variable timestep mode.
00041         void SetFixedTimeStep(bool isFixedTimestep)           { m_isFixedTimeStep = isFixedTimestep;    }
00042
00043         // Set how often to call Update when in fixed timestep mode.
00044         void SetTargetElapsedTicks(uint64 targetElapsed)      { m_targetElapsedTicks = targetElapsed;   }
00045         void SetTargetElapsedSeconds(double targetElapsed)    { m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }
00046
00047         // Integer format represents time using 10,000,000 ticks per second.
00048         static const uint64 TicksPerSecond = 10'000'000;
00049
00050         static double TicksToSeconds(uint64 ticks)            { return static_cast<double>(ticks) / TicksPerSecond;     }
00051         static uint64 SecondsToTicks(double seconds)          { return static_cast<uint64>(seconds * TicksPerSecond);   }
00052
00053         // Convenient wrapper for QueryPerformanceFrequency. Throws an exception if
00054         // the call to QueryPerformanceFrequency fails.
00055         static inline uint64 GetPerformanceFrequency()
00056         {
00057             LARGE_INTEGER freq;
00058             if (!QueryPerformanceFrequency(&freq))
00059             {
00060                 throw ref new Platform::FailureException();
00061             }
00062             return freq.QuadPart;
00063         }
00064
00065         // Gets the current number of ticks from QueryPerformanceCounter. Throws an
00066         // exception if the call to QueryPerformanceCounter fails.
00067         static inline int64 GetTicks()
00068         {
00069             LARGE_INTEGER ticks;
00070             if (!QueryPerformanceCounter(&ticks))
00071             {
00072                 throw ref new Platform::FailureException();
00073             }
00074             return ticks.QuadPart;
00075         }
00076
00077         // After an intentional timing discontinuity (for instance a blocking IO operation)
00078         // call this to avoid having the fixed timestep logic attempt a set of catch-up
00079         // Update calls.
00080
00081         void ResetElapsedTime()
00082         {
00083             m_qpcLastTime = GetTicks();
00084
00085             m_leftOverTicks    = 0;
00086             m_framesPerSecond  = 0;
00087             m_framesThisSecond = 0;
00088             m_qpcSecondCounter = 0;
00089         }
00090
00091         // Update timer state, calling the specified Update function the appropriate number of times.
00092         template<typename TUpdate>
00093         void Tick(const TUpdate& update)
00094         {
00095             // Query the current time.
00096             uint64 currentTime = GetTicks();
00097             uint64 timeDelta   = currentTime - m_qpcLastTime;
00098
00099             m_qpcLastTime      = currentTime;
00100             m_qpcSecondCounter += timeDelta;
00101
00102             // Clamp excessively large time deltas (e.g. after paused in the debugger).
00103             if (timeDelta > m_qpcMaxDelta)
00104             {
00105                 timeDelta = m_qpcMaxDelta;
00106             }
00107
00108             // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
00109             timeDelta *= TicksPerSecond;
00110             timeDelta /= m_qpcFrequency;
00111
00112             uint32 lastFrameCount = m_frameCount;
00113
00114             if (m_isFixedTimeStep)
00115             {
00116                 // Fixed timestep update logic
00117
00118                 // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
00119                 // the clock to exactly match the target value. This prevents tiny and irrelevant errors
00120                 // from accumulating over time. Without this clamping, a game that requested a 60 fps
00121                 // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
00122                 // accumulate enough tiny errors that it would drop a frame. It is better to just round
00123                 // small deviations down to zero to leave things running smoothly.
00124
00125                 if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
00126                 {
00127                     timeDelta = m_targetElapsedTicks;
00128                 }
00129
00130                 m_leftOverTicks += timeDelta;
00131
00132                 while (m_leftOverTicks >= m_targetElapsedTicks)
00133                 {
00134                     m_elapsedTicks   = m_targetElapsedTicks;
00135                     m_totalTicks    += m_targetElapsedTicks;
00136                     m_leftOverTicks -= m_targetElapsedTicks;
00137                     m_frameCount++;
00138
00139                     update();
00140                 }
00141             }
00142             else
00143             {
00144                 // Variable timestep update logic.
00145                 m_elapsedTicks  = timeDelta;
00146                 m_totalTicks   += timeDelta;
00147                 m_leftOverTicks = 0;
00148                 m_frameCount++;
00149
00150                 update();
00151             }
00152
00153             // Track the current framerate.
00154             if (m_frameCount != lastFrameCount)
00155             {
00156                 m_framesThisSecond++;
00157             }
00158
00159             if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
00160             {
00161                 m_framesPerSecond   = m_framesThisSecond;
00162                 m_framesThisSecond  = 0;
00163                 m_qpcSecondCounter %= m_qpcFrequency;
00164             }
00165         }
00166
00167     private:
00168
00169         // Source timing data uses QPC units.
00170         uint64 m_qpcFrequency;
00171         uint64 m_qpcLastTime;
00172         uint64 m_qpcMaxDelta;
00173
00174         // Derived timing data uses a canonical tick format.
00175         uint64 m_elapsedTicks;
00176         uint64 m_totalTicks;
00177         uint64 m_leftOverTicks;
00178
00179         // Members for tracking the framerate.
00180         uint32 m_frameCount;
00181         uint32 m_framesPerSecond;
00182         uint32 m_framesThisSecond;
00183         uint64 m_qpcSecondCounter;
00184
00185         // Members for configuring fixed timestep mode.
00186         bool   m_isFixedTimeStep;
00187         uint64 m_targetElapsedTicks;
00188     };
00189 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cs/Scenario2_Polling.xaml.cs Source File

  • SimpleOrientationSensor
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.Sensors;
00018 using Windows.Foundation;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Core;
00021
00022 namespace SimpleOrientationCS
00023 {
00024     public sealed partial class Scenario2_Polling : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private SimpleOrientationSensor _sensor;
00031
00032         public Scenario2_Polling()
00033         {
00034             this.InitializeComponent();
00035
00036             _sensor = SimpleOrientationSensor.GetDefault();
00037             if (_sensor == null)
00038             {
00039                 rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
00040             }
00041         }
00042
00043         /// <summary>
00044         /// Helper method to display the device orientation in the specified text box.
00045         /// </summary>
00046         /// <param name="tb">
00047         /// The text box receiving the orientation value.
00048         /// </param>
00049         /// <param name="orientation">
00050         /// The orientation value.
00051         /// </param>
00052         private void DisplayOrientation(TextBlock tb, SimpleOrientation orientation)
00053         {
00054             switch (orientation)
00055             {
00056                 case SimpleOrientation.NotRotated:
00057                     tb.Text = "Not Rotated";
00058                     break;
00059                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00060                     tb.Text = "Rotated 90 Degrees Counterclockwise";
00061                     break;
00062                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00063                     tb.Text = "Rotated 180 Degrees Counterclockwise";
00064                     break;
00065                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00066                     tb.Text = "Rotated 270 Degrees Counterclockwise";
00067                     break;
00068                 case SimpleOrientation.Faceup:
00069                     tb.Text = "Faceup";
00070                     break;
00071                 case SimpleOrientation.Facedown:
00072                     tb.Text = "Facedown";
00073                     break;
00074                 default:
00075                     tb.Text = "Unknown orientation";
00076                     break;
00077             }
00078         }
00079
00080         /// <summary>
00081         /// This is the click handler for the 'Enable' button.
00082         /// </summary>
00083         /// <param name="sender"></param>
00084         /// <param name="e"></param>
00085         private void ScenarioGet(object sender, RoutedEventArgs e)
00086         {
00087             if (_sensor != null)
00088             {
00089                 DisplayOrientation(ScenarioOutput_Orientation, _sensor.GetCurrentOrientation());
00090             }
00091             else
00092             {
00093                 rootPage.NotifyUser("No simple orientation sensor found", NotifyType.ErrorMessage);
00094             }
00095         }
00096     }
00097 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicMath.h Source File

  • Simple3DGameDX
  • cpp
  • Common

BasicMath.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #define _USE_MATH_DEFINES
00011 #include <math.h>
00012
00013 // This header defines math and matrix helper functions and structures used
00014 // by DirectX SDK samples.
00015
00016 // Common Constants
00017
00018 #define PI_F 3.1415927f
00019
00020 // Template Vector & Matrix Classes
00021
00022 template <class T> struct Vector2
00023 {
00024     union
00025     {
00026         struct
00027         {
00028             T x;
00029             T y;
00030         };
00031         struct
00032         {
00033             T r;
00034             T g;
00035         };
00036         struct
00037         {
00038             T u;
00039             T v;
00040         };
00041     };
00042
00043     T& operator[](unsigned int index)
00044     {
00045         return static_cast<T*>(this)[index];
00046     }
00047
00048     Vector2(T _x = 0, T _y = 0) : x(_x), y(_y) { }
00049 };
00050
00051 template <class T> struct Vector3
00052 {
00053     union
00054     {
00055         struct
00056         {
00057             T x;
00058             T y;
00059             T z;
00060         };
00061         struct
00062         {
00063             T r;
00064             T g;
00065             T b;
00066         };
00067         struct
00068         {
00069             T u;
00070             T v;
00071             T w;
00072         };
00073     };
00074
00075     T& operator[](unsigned int index)
00076     {
00077         return static_cast<T*>(this)[index];
00078     }
00079
00080     Vector3(T _x = 0, T _y = 0, T _z = 0) : x(_x), y(_y), z(_z) { }
00081 };
00082
00083 template <class T> struct Vector4
00084 {
00085     union
00086     {
00087         struct
00088         {
00089             T x;
00090             T y;
00091             T z;
00092             T w;
00093         };
00094         struct
00095         {
00096             T r;
00097             T g;
00098             T b;
00099             T a;
00100         };
00101     };
00102
00103     T& operator[](unsigned int index)
00104     {
00105         return static_cast<T*>(this)[index];
00106     }
00107
00108     Vector4(T _x = 0, T _y = 0, T _z = 0, T _w = 0) : x(_x), y(_y), z(_z), w(_w) { }
00109 };
00110
00111 template <class T> struct Matrix4x4
00112 {
00113     union
00114     {
00115         struct
00116         {
00117             T _11; T _12; T _13; T _14;
00118             T _21; T _22; T _23; T _24;
00119             T _31; T _32; T _33; T _34;
00120             T _41; T _42; T _43; T _44;
00121         };
00122         struct
00123         {
00124             T _m00; T _m01; T _m02; T _m03;
00125             T _m10; T _m11; T _m12; T _m13;
00126             T _m20; T _m21; T _m22; T _m23;
00127             T _m30; T _m31; T _m32; T _m33;
00128         };
00129     };
00130
00131     Matrix4x4(T value = 0)
00132     {
00133         _11 = _12 = _13 = _14 = value;
00134         _21 = _22 = _23 = _24 = value;
00135         _31 = _32 = _33 = _34 = value;
00136         _41 = _42 = _43 = _44 = value;
00137     }
00138
00139     Matrix4x4(
00140         T i11, T i12, T i13, T i14,
00141         T i21, T i22, T i23, T i24,
00142         T i31, T i32, T i33, T i34,
00143         T i41, T i42, T i43, T i44
00144         )
00145     {
00146         _11 = i11; _12 = i12; _13 = i13; _14 = i14;
00147         _21 = i21; _22 = i22; _23 = i23; _24 = i24;
00148         _31 = i31; _32 = i32; _33 = i33; _34 = i34;
00149         _41 = i41; _42 = i42; _43 = i43; _44 = i44;
00150     }
00151
00152     T* operator[](unsigned int index)
00153     {
00154         return &(reinterpret_cast<T*>(this)[index*4]);
00155     }
00156 };
00157
00158 // Template Vector Operations
00159
00160 template <class T>
00161 T dot(Vector2<T> a, Vector2<T> b)
00162 {
00163     return a.x * b.x + a.y * b.y;
00164 }
00165
00166 template <class T>
00167 T dot(Vector3<T> a, Vector3<T> b)
00168 {
00169     return a.x * b.x + a.y * b.y + a.z * b.z;
00170 }
00171
00172 template <class T>
00173 T dot(Vector4<T> a, Vector4<T> b)
00174 {
00175     return a.x * b.x + a.y * b.y + a.z * b.z + a.w + b.w;
00176 }
00177
00178 template <class T>
00179 T length(Vector2<T> a)
00180 {
00181     return sqrt(a.x * a.x + a.y * a.y);
00182 }
00183
00184 template <class T>
00185 T length(Vector3<T> a)
00186 {
00187     return sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
00188 }
00189
00190 template <class T>
00191 T length(Vector4<T> a)
00192 {
00193     return sqrt(a.x * a.x + a.y * a.y + a.z * a.z + a.w * a.w);
00194 }
00195
00196 template <class T>
00197 Vector3<T> cross(Vector3<T> a, Vector3<T> b)
00198 {
00199     return Vector3<T>((a.y*b.z)-(a.z*b.y), (a.z*b.x)-(a.x*b.z), (a.x*b.y)-(a.y*b.x));
00200 }
00201
00202 template <class T>
00203 Vector2<T> normalize(Vector2<T> a)
00204 {
00205     T len = length(a);
00206     return Vector2<T>(a.x / len, a.y / len);
00207 }
00208
00209 template <class T>
00210 Vector3<T> normalize(Vector3<T> a)
00211 {
00212     T len = length(a);
00213     return Vector3<T>(a.x / len, a.y / len, a.z / len);
00214 }
00215
00216 template <class T>
00217 Vector4<T> normalize(Vector4<T> a)
00218 {
00219     T len = length(a);
00220     return Vector4<T>(a.x / len, a.y / len, a.z / len, a.w / len);
00221 }
00222
00223 // Template Vector Operators
00224
00225 template <class T>
00226 Vector2<T> operator-(Vector2<T> a, Vector2<T> b)
00227 {
00228     return Vector2<T>(a.x - b.x, a.y - b.y);
00229 }
00230
00231 template <class T>
00232 Vector2<T> operator-(Vector2<T> a)
00233 {
00234     return Vector2<T>(-a.x, -a.y);
00235 }
00236
00237 template <class T>
00238 Vector3<T> operator-(Vector3<T> a, Vector3<T> b)
00239 {
00240     return Vector3<T>(a.x - b.x, a.y - b.y, a.z - b.z);
00241 }
00242
00243 template <class T>
00244 Vector3<T> operator-(Vector3<T> a)
00245 {
00246     return Vector3<T>(-a.x, -a.y, -a.z);
00247 }
00248
00249 template <class T>
00250 Vector4<T> operator-(Vector4<T> a, Vector4<T> b)
00251 {
00252     return Vector4<T>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
00253 }
00254
00255 template <class T>
00256 Vector4<T> operator-(Vector4<T> a)
00257 {
00258     return Vector4<T>(-a.x, -a.y, -a.z, -a.w);
00259 }
00260
00261 template <class T>
00262 Vector2<T> operator+(Vector2<T> a, Vector2<T> b)
00263 {
00264     return Vector2<T>(a.x + b.x, a.y + b.y);
00265 }
00266
00267 template <class T>
00268 Vector3<T> operator+(Vector3<T> a, Vector3<T> b)
00269 {
00270     return Vector3<T>(a.x + b.x, a.y + b.y, a.z + b.z);
00271 }
00272
00273 template <class T>
00274 Vector4<T> operator+(Vector4<T> a, Vector4<T> b)
00275 {
00276     return Vector4<T>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
00277 }
00278
00279 template <class T>
00280 Vector2<T> operator*(Vector2<T> a, T s)
00281 {
00282     return Vector2<T>(a.x * s, a.y * s);
00283 }
00284
00285 template <class T>
00286 Vector2<T> operator*(T s, Vector2<T> a)
00287 {
00288     return a * s;
00289 }
00290
00291 template <class T>
00292 Vector2<T> operator*(Vector2<T> a, Vector2<T> b)
00293 {
00294     return Vector2<T>(a.x * b.x, a.y * b.y);
00295 }
00296
00297 template <class T>
00298 Vector2<T> operator/(Vector2<T> a, T s)
00299 {
00300     return Vector2<T>(a.x / s, a.y / s);
00301 }
00302
00303 template <class T>
00304 Vector3<T> operator*(Vector3<T> a, T s)
00305 {
00306     return Vector3<T>(a.x * s, a.y * s, a.z * s);
00307 }
00308
00309 template <class T>
00310 Vector3<T> operator*(T s, Vector3<T> a)
00311 {
00312     return a * s;
00313 }
00314
00315 template <class T>
00316 Vector3<T> operator*(Vector3<T> a, Vector3<T> b)
00317 {
00318     return Vector3<T>(a.x * b.x, a.y * b.y, a.z * b.z);
00319 }
00320
00321 template <class T>
00322 Vector3<T> operator/(Vector3<T> a, T s)
00323 {
00324     return Vector3<T>(a.x / s, a.y / s, a.z / s);
00325 }
00326
00327 template <class T>
00328 Vector4<T> operator*(Vector4<T> a, T s)
00329 {
00330     return Vector4<T>(a.x * s, a.y * s, a.z * s, a.w * s);
00331 }
00332
00333 template <class T>
00334 Vector4<T> operator*(T s, Vector4<T> a)
00335 {
00336     return a * s;
00337 }
00338
00339 template <class T>
00340 Vector4<T> operator*(Vector4<T> a, Vector4<T> b)
00341 {
00342     return Vector4<T>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
00343 }
00344
00345 template <class T>
00346 Vector4<T> operator/(Vector4<T> a, T s)
00347 {
00348     return Vector4<T>(a.x / s, a.y / s, a.z / s, a.w / s);
00349 }
00350
00351
00352
00353 // Template Matrix Operations
00354
00355 template <class T>
00356 Matrix4x4<T> transpose(Matrix4x4<T> m)
00357 {
00358     return Matrix4x4<T>(
00359         m._11, m._21, m._31, m._41,
00360         m_.12, m._22, m._32, m._42,
00361         m._13, m._23, m._33, m._43,
00362         m._14, m._24, m._34, m._44
00363         );
00364 }
00365
00366 template <class T>
00367 Matrix4x4<T> mul(Matrix4x4<T> m1, Matrix4x4<T> m2)
00368 {
00369     Matrix4x4<T> mOut;
00370
00371     for (int i = 0; i < 4; i++)
00372     {
00373         for (int j = 0; j < 4; j++)
00374         {
00375             for (int k = 0; k < 4; k++)
00376             {
00377                 mOut[i][j] += m1[i][k] * m2[k][j];
00378             }
00379         }
00380     }
00381
00382     return mOut;
00383 }
00384
00385 // Common HLSL-compatible vector typedefs
00386
00387 typedef unsigned int uint;
00388
00389 typedef Vector2<float> float2;
00390 typedef Vector3<float> float3;
00391 typedef Vector4<float> float4;
00392
00393 typedef Matrix4x4<float> float4x4;
00394
00395 // Standard Matrix Intializers
00396
00397 inline float4x4 identity()
00398 {
00399     float4x4 mOut;
00400
00401     mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
00402     mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = 0.0f;
00403     mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = 0.0f;
00404     mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;
00405
00406     return mOut;
00407 }
00408
00409 inline float4x4 translation(float x, float y, float z)
00410 {
00411     float4x4 mOut;
00412
00413     mOut._11 = 1.0f; mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = x;
00414     mOut._21 = 0.0f; mOut._22 = 1.0f; mOut._23 = 0.0f; mOut._24 = y;
00415     mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = 1.0f; mOut._34 = z;
00416     mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;
00417
00418     return mOut;
00419 }
00420
00421 inline float4x4 scale(float x, float y, float z)
00422 {
00423     float4x4 mOut;
00424
00425     mOut._11 = x;    mOut._12 = 0.0f; mOut._13 = 0.0f; mOut._14 = 0.0f;
00426     mOut._21 = 0.0f; mOut._22 = y;    mOut._23 = 0.0f; mOut._24 = 0.0f;
00427     mOut._31 = 0.0f; mOut._32 = 0.0f; mOut._33 = z;    mOut._34 = 0.0f;
00428     mOut._41 = 0.0f; mOut._42 = 0.0f; mOut._43 = 0.0f; mOut._44 = 1.0f;
00429
00430     return mOut;
00431 }
00432
00433 inline float4x4 rotationX(float degreeX)
00434 {
00435     float angleInRadians = degreeX * (PI_F / 180.0f);
00436
00437     float sinAngle = sinf(angleInRadians);
00438     float cosAngle = cosf(angleInRadians);
00439
00440     float4x4 mOut;
00441
00442     mOut._11 = 1.0f; mOut._12 = 0.0f;     mOut._13 = 0.0f;      mOut._14 = 0.0f;
00443     mOut._21 = 0.0f; mOut._22 = cosAngle; mOut._23 = -sinAngle; mOut._24 = 0.0f;
00444     mOut._31 = 0.0f; mOut._32 = sinAngle; mOut._33 = cosAngle;  mOut._34 = 0.0f;
00445     mOut._41 = 0.0f; mOut._42 = 0.0f;     mOut._43 = 0.0f;      mOut._44 = 1.0f;
00446
00447     return mOut;
00448 }
00449
00450 inline float4x4 rotationY(float degreeY)
00451 {
00452     float angleInRadians = degreeY * (PI_F / 180.0f);
00453
00454     float sinAngle = sinf(angleInRadians);
00455     float cosAngle = cosf(angleInRadians);
00456
00457     float4x4 mOut;
00458
00459     mOut._11 = cosAngle;  mOut._12 = 0.0f; mOut._13 = sinAngle; mOut._14 = 0.0f;
00460     mOut._21 = 0.0f;      mOut._22 = 1.0f; mOut._23 = 0.0f;     mOut._24 = 0.0f;
00461     mOut._31 = -sinAngle; mOut._32 = 0.0f; mOut._33 = cosAngle; mOut._34 = 0.0f;
00462     mOut._41 = 0.0f;      mOut._42 = 0.0f; mOut._43 = 0.0f;     mOut._44 = 1.0f;
00463
00464     return mOut;
00465 }
00466
00467 inline float4x4 rotationZ(float degreeZ)
00468 {
00469     float angleInRadians = degreeZ * (PI_F / 180.0f);
00470
00471     float sinAngle = sinf(angleInRadians);
00472     float cosAngle = cosf(angleInRadians);
00473
00474     float4x4 mOut;
00475
00476     mOut._11 = cosAngle; mOut._12 = -sinAngle; mOut._13 = 0.0f; mOut._14 = 0.0f;
00477     mOut._21 = sinAngle; mOut._22 = cosAngle;  mOut._23 = 0.0f; mOut._24 = 0.0f;
00478     mOut._31 = 0.0f;     mOut._32 = 0.0f;      mOut._33 = 1.0f; mOut._34 = 0.0f;
00479     mOut._41 = 0.0f;     mOut._42 = 0.0f;      mOut._43 = 0.0f; mOut._44 = 1.0f;
00480
00481     return mOut;
00482 }
00483
00484 // 3D Rotation matrix for an arbitrary axis specified by x, y and z
00485 inline float4x4 rotationArbitrary(float3 axis, float degree)
00486 {
00487     axis = normalize(axis);
00488
00489     float angleInRadians = degree * (PI_F / 180.0f);
00490
00491     float sinAngle = sinf(angleInRadians);
00492     float cosAngle = cosf(angleInRadians);
00493     float oneMinusCosAngle = 1 - cosAngle;
00494
00495     float4x4 mOut;
00496
00497     mOut._11 = 1.0f + oneMinusCosAngle * (axis.x * axis.x - 1.0f);
00498     mOut._12 = axis.z * sinAngle + oneMinusCosAngle * axis.x * axis.y;
00499     mOut._13 = -axis.y * sinAngle + oneMinusCosAngle * axis.x * axis.z;
00500     mOut._41 = 0.0f;
00501
00502     mOut._21 = -axis.z * sinAngle + oneMinusCosAngle * axis.y * axis.x;
00503     mOut._22 = 1.0f + oneMinusCosAngle * (axis.y * axis.y - 1.0f);
00504     mOut._23 = axis.x * sinAngle + oneMinusCosAngle * axis.y * axis.z;
00505     mOut._24 = 0.0f;
00506
00507     mOut._31 = axis.y * sinAngle + oneMinusCosAngle * axis.z * axis.x;
00508     mOut._32 = -axis.x * sinAngle + oneMinusCosAngle * axis.z * axis.y;
00509     mOut._33 = 1.0f + oneMinusCosAngle * (axis.z * axis.z - 1.0f);
00510     mOut._34 = 0.0f;
00511
00512     mOut._41 = 0.0f;
00513     mOut._42 = 0.0f;
00514     mOut._43 = 0.0f;
00515     mOut._44 = 1.0f;
00516
00517     return mOut;
00518 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Audio.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Audio.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Audio.h"
00014
00015 Audio::Audio() :
00016     m_audioAvailable(false)
00017 {
00018 }
00019
00020 void Audio::Initialize()
00021 {
00022 }
00023
00024 void Audio::CreateDeviceIndependentResources()
00025 {
00026     UINT32 flags = 0;
00027
00028     winrt::check_hresult(
00029         XAudio2Create(m_musicEngine.put(), flags)
00030         );
00031
00032 #if defined(_DEBUG)
00033     XAUDIO2_DEBUG_CONFIGURATION debugConfiguration = { 0 };
00034     debugConfiguration.BreakMask = XAUDIO2_LOG_ERRORS;
00035     debugConfiguration.TraceMask = XAUDIO2_LOG_ERRORS;
00036     m_musicEngine->SetDebugConfiguration(&debugConfiguration);
00037 #endif
00038
00039     HRESULT hr = m_musicEngine->CreateMasteringVoice(&m_musicMasteringVoice);
00040     if (FAILED(hr))
00041     {
00042         // Unable to create an audio device
00043         m_audioAvailable = false;
00044         return;
00045     }
00046
00047     winrt::check_hresult(
00048         XAudio2Create(m_soundEffectEngine.put(), flags)
00049         );
00050
00051 #if defined(_DEBUG)
00052     m_soundEffectEngine->SetDebugConfiguration(&debugConfiguration);
00053 #endif
00054
00055     winrt::check_hresult(
00056         m_soundEffectEngine->CreateMasteringVoice(&m_soundEffectMasteringVoice)
00057         );
00058
00059     m_audioAvailable = true;
00060 }
00061
00062 IXAudio2* Audio::MusicEngine()
00063 {
00064     return m_musicEngine.get();
00065 }
00066
00067 IXAudio2* Audio::SoundEffectEngine()
00068 {
00069     return m_soundEffectEngine.get();
00070 }
00071
00072 void Audio::SuspendAudio()
00073 {
00074     if (m_audioAvailable)
00075     {
00076         m_musicEngine->StopEngine();
00077         m_soundEffectEngine->StopEngine();
00078     }
00079 }
00080
00081 void Audio::ResumeAudio()
00082 {
00083     if (m_audioAvailable)
00084     {
00085         winrt::check_hresult(m_musicEngine->StartEngine());
00086         winrt::check_hresult(m_soundEffectEngine->StartEngine());
00087     }
00088 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario4_EdgeTappedListView.h Source File

  • XamlListView
  • cppwinrt

Scenario4_EdgeTappedListView.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "EdgeTappedListView.h"
00014 #include "Scenario4_EdgeTappedListView.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario4_EdgeTappedListView : Scenario4_EdgeTappedListViewT<Scenario4_EdgeTappedListView>
00019     {
00020         Scenario4_EdgeTappedListView();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024
00025         void SelectItems(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026         void AddItem(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027         void RemoveItem(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028         void CancelSelection(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00029         void OnSelectionChanged(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const&);
00030         void OnEdgeTapped(SDKTemplate::EdgeTappedListView const&, SDKTemplate::ListViewEdgeTappedEventArgs const&);
00031
00032     private:
00033         Windows::Foundation::Collections::IObservableVector<SDKTemplate::Contact> Contacts;
00034         event_token backRequestedToken{};
00035
00036         void UpdateSelectionUI();
00037         void OnBackRequested(Windows::Foundation::IInspectable const&, Windows::UI::Core::BackRequestedEventArgs const& e);
00038         void SetCommandsVisibility(Windows::UI::Xaml::Controls::ListView const& listView);
00039     };
00040 }
00041
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct Scenario4_EdgeTappedListView : Scenario4_EdgeTappedListViewT<Scenario4_EdgeTappedListView, implementation::Scenario4_EdgeTappedListView>
00045     {
00046     };
00047 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_BulkPipes Member List

This is the complete list of members for Scenario4_BulkPipes, including all inherited members.
BulkRead_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BulkPipes | [inline, private]
BulkReadAsync(UInt32 bulkPipeIndex, UInt32 bytesToRead, CancellationToken cancellationToken) | Scenario4_BulkPipes | [inline, private]
BulkReadWrite_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BulkPipes | [inline, private]
BulkReadWriteAsync(UInt32 bulkInPipeIndex, UInt32 bulkOutPipeIndex, UInt32 bytesToReadWrite) | Scenario4_BulkPipes | [inline, private]
BulkWrite_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BulkPipes | [inline, private]
BulkWriteAsync(UInt32 bulkPipeIndex, UInt32 bytesToWrite, CancellationToken cancellationToken) | Scenario4_BulkPipes | [inline, private]
CancelAllIoTasks() | Scenario4_BulkPipes | [inline, private]
CancelAllIoTasks_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_BulkPipes | [inline, private]
cancelIoLock | Scenario4_BulkPipes | [private]
cancellationTokenSource | Scenario4_BulkPipes | [private]
Dispose() | Scenario4_BulkPipes | [inline]
IsPerformingIo() | Scenario4_BulkPipes | [inline, private]
navigatedAway | Scenario4_BulkPipes | [private]
NotifyCancelingTask() | Scenario4_BulkPipes | [inline, private]
NotifyTaskCanceled() | Scenario4_BulkPipes | [inline, private]
OnAppSuspension(Object sender, SuspendingEventArgs args) | Scenario4_BulkPipes | [inline, private]
OnDeviceConnected(EventHandlerForDevice sender, DeviceInformation onDeviceConnectedEventArgs) | Scenario4_BulkPipes | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | Scenario4_BulkPipes | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario4_BulkPipes | [inline, protected]
PrintTotalReadWriteBytes() | Scenario4_BulkPipes | [inline, private]
ResetCancellationTokenSource() | Scenario4_BulkPipes | [inline, private]
rootPage | Scenario4_BulkPipes | [private]
runningReadTask | Scenario4_BulkPipes | [private]
runningReadWriteTask | Scenario4_BulkPipes | [private]
runningWriteTask | Scenario4_BulkPipes | [private]
Scenario4_BulkPipes() | Scenario4_BulkPipes | [inline]
totalBytesRead | Scenario4_BulkPipes | [private]
totalBytesWritten | Scenario4_BulkPipes | [private]
UpdateButtonStates() | Scenario4_BulkPipes | [inline, private]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_SaveFile Member List

This is the complete list of members for Scenario4_SaveFile, including all inherited members.
rootPage | Scenario4_SaveFile | [private]
SaveFileButton_Click(object sender, RoutedEventArgs e) | Scenario4_SaveFile | [inline, private]
Scenario4_SaveFile() | Scenario4_SaveFile | [inline]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/VideoFrameProcessor.cpp Source File

  • HolographicFaceTracking
  • cpp
  • Content

VideoFrameProcessor.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "VideoFrameProcessor.h"
00014
00015 using namespace HolographicFaceTracker;
00016
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::Foundation::Numerics;
00020
00021 using namespace Windows::Media::Capture;
00022 using namespace Windows::Media::Capture::Frames;
00023
00024 using namespace concurrency;
00025 using namespace Platform;
00026
00027 using namespace std::placeholders;
00028
00029 VideoFrameProcessor::VideoFrameProcessor(Platform::Agile<MediaCapture> mediaCapture, MediaFrameReader^ reader, MediaFrameSource^ source)
00030     : m_mediaCapture(std::move(mediaCapture))
00031     , m_mediaFrameReader(std::move(reader))
00032     , m_mediaFrameSource(std::move(source))
00033 {
00034     // Listen for new frames, so we know when to update our m_latestFrame
00035     m_mediaFrameReader->FrameArrived +=
00036         ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(
00037             std::bind(&VideoFrameProcessor::OnFrameArrived, this, _1, _2));
00038 }
00039
00040 task<std::shared_ptr<VideoFrameProcessor>> VideoFrameProcessor::CreateAsync(void)
00041 {
00042     return create_task(MediaFrameSourceGroup::FindAllAsync())
00043         .then([](IVectorView<MediaFrameSourceGroup^>^ groups)
00044     {
00045         MediaFrameSourceGroup^ selectedGroup = nullptr;
00046         MediaFrameSourceInfo^ selectedSourceInfo = nullptr;
00047
00048         // Pick first color source.
00049         for (MediaFrameSourceGroup^ sourceGroup : groups)
00050         {
00051             for (MediaFrameSourceInfo^ sourceInfo : sourceGroup->SourceInfos)
00052             {
00053                 if (sourceInfo->SourceKind == MediaFrameSourceKind::Color)
00054                 {
00055                     selectedSourceInfo = sourceInfo;
00056                     break;
00057                 }
00058             }
00059
00060             if (selectedSourceInfo != nullptr)
00061             {
00062                 selectedGroup = sourceGroup;
00063                 break;
00064             }
00065         }
00066
00067         // No valid camera was found. This will happen on the emulator.
00068         if (selectedGroup == nullptr || selectedSourceInfo == nullptr)
00069         {
00070             return task_from_result(std::shared_ptr<VideoFrameProcessor>(nullptr));
00071         }
00072
00073         MediaCaptureInitializationSettings^ settings = ref new MediaCaptureInitializationSettings();
00074         settings->MemoryPreference = MediaCaptureMemoryPreference::Cpu; // Need SoftwareBitmaps for FaceAnalysis
00075         settings->StreamingCaptureMode = StreamingCaptureMode::Video;   // Only need to stream video
00076         settings->SourceGroup = selectedGroup;
00077
00078         Platform::Agile<MediaCapture> mediaCapture(ref new MediaCapture());
00079
00080         return create_task(mediaCapture->InitializeAsync(settings))
00081             .then([=]
00082         {
00083             MediaFrameSource^ selectedSource = mediaCapture->FrameSources->Lookup(selectedSourceInfo->Id);
00084
00085             return create_task(mediaCapture->CreateFrameReaderAsync(selectedSource))
00086                 .then([=](MediaFrameReader^ reader)
00087             {
00088                 return create_task(reader->StartAsync())
00089                     .then([=](MediaFrameReaderStartStatus status)
00090                 {
00091                     // Only create a VideoFrameProcessor if the reader successfully started
00092                     if (status == MediaFrameReaderStartStatus::Success)
00093                     {
00094                         return std::make_shared<VideoFrameProcessor>(mediaCapture, reader, selectedSource);
00095                     }
00096                     else
00097                     {
00098                         return std::shared_ptr<VideoFrameProcessor>(nullptr);
00099                     }
00100                 });
00101             });
00102         });
00103     });
00104 }
00105
00106 Windows::Media::Capture::Frames::MediaFrameReference^ VideoFrameProcessor::GetLatestFrame(void) const
00107 {
00108     auto lock = std::shared_lock<std::shared_mutex>(m_propertiesLock);
00109     return m_latestFrame;
00110 }
00111
00112 Windows::Media::Capture::Frames::VideoMediaFrameFormat^ VideoFrameProcessor::GetCurrentFormat(void) const
00113 {
00114     return m_mediaFrameSource->CurrentFormat->VideoFormat;
00115 }
00116
00117 void VideoFrameProcessor::OnFrameArrived(MediaFrameReader^ sender, MediaFrameArrivedEventArgs^ args)
00118 {
00119     if (MediaFrameReference^ frame = sender->TryAcquireLatestFrame())
00120     {
00121         std::lock_guard<std::shared_mutex> lock(m_propertiesLock);
00122         m_latestFrame = frame;
00123     }
00124 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7 Member List

This is the complete list of members for Scenario7, including all inherited members.
AddToListButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario7
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario7
OpenFromListButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario7
Scenario7() | Scenario7
ShowListButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario7
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cpp/SampleConfiguration.cpp Source File

  • Syndication
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Get a Feed", "SDKTemplate.Syndication.Scenario1" },
00021 };
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/SampleConfiguration.h Source File

  • GlobalizationPreferences
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Globalization preferences C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047
00048     Platform::String^ StringJoin(Platform::String^ delimeter, Windows::Foundation::Collections::IVectorView<Platform::String^>^ vector);
00049 }
00050
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/SampleConfiguration.h Source File

  • LampDevice
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Lamp device C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/SampleConfiguration.h Source File

  • IoT-I2C
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/SampleBackgroundTask.h Source File

  • BackgroundTask
  • cpp
  • Tasks

SampleBackgroundTask.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 namespace Tasks
00014 {
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class SampleBackgroundTask sealed : public Windows::ApplicationModel::Background::IBackgroundTask
00017     {
00018
00019     public:
00020         virtual void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
00021         void OnCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason);
00022
00023     private:
00024         Windows::ApplicationModel::Background::BackgroundTaskCancellationReason CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort;
00025         volatile bool CancelRequested = false;
00026         Platform::Agile<Windows::ApplicationModel::Background::BackgroundTaskDeferral> TaskDeferral = nullptr;
00027         Windows::System::Threading::ThreadPoolTimer^ PeriodicTimer = nullptr;
00028         unsigned int Progress = 0;
00029         Windows::ApplicationModel::Background::IBackgroundTaskInstance^ TaskInstance = nullptr;
00030     };
00031 }
Generated on Fri Nov 15 2024 22:18:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/BarcodeDecoder.cs Source File

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder

BarcodeDecoder.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.ApplicationModel.Background;
00013
00014 namespace BarcodeDecoder
00015 {
00016     public sealed class BarcodeDecodeTask : IBackgroundTask
00017     {
00018         Provider provider = null;
00019
00020         public void Run(IBackgroundTaskInstance taskInstance)
00021         {
00022             provider = new Provider(taskInstance);
00023         }
00024     }
00025 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_NavToUrl Member List

This is the complete list of members for Scenario1_NavToUrl, including all inherited members.
_pageIsLoading | Scenario1_NavToUrl | [private]
Address_KeyUp(object sender, KeyRoutedEventArgs e) | Scenario1_NavToUrl | [inline, private]
AppendLog(string logEntry) | Scenario1_NavToUrl | [inline, private]
GoButton_Click() | Scenario1_NavToUrl | [inline, private]
NavigateBackward_Click() | Scenario1_NavToUrl | [inline, private]
NavigateForward_Click() | Scenario1_NavToUrl | [inline, private]
NavigateWebview(string url) | Scenario1_NavToUrl | [inline, private]
pageIsLoading | Scenario1_NavToUrl | [private]
Scenario1_NavToUrl() | Scenario1_NavToUrl | [inline]
UriToString(Uri uri) | Scenario1_NavToUrl | [inline, private, static]
WebViewControl_ContentLoading(WebView sender, WebViewContentLoadingEventArgs args) | Scenario1_NavToUrl | [inline, private]
WebViewControl_DOMContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args) | Scenario1_NavToUrl | [inline, private]
WebViewControl_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args) | Scenario1_NavToUrl | [inline, private]
WebViewControl_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args) | Scenario1_NavToUrl | [inline, private]
WebViewControl_UnviewableContentIdentified(WebView sender, WebViewUnviewableContentIdentifiedEventArgs args) | Scenario1_NavToUrl | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/BasicReaderWriter.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

BasicReaderWriter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 // A simple reader/writer class that provides support for reading and writing
00017 // files on disk. Provides synchronous and asynchronous methods.
00018 ref class BasicReaderWriter
00019 {
00020 private:
00021     Windows::Storage::StorageFolder^ m_location;
00022
00023 internal:
00024     BasicReaderWriter();
00025     BasicReaderWriter(
00026         _In_ Windows::Storage::StorageFolder^ folder
00027         );
00028
00029     Platform::Array<byte>^ ReadData(
00030         _In_ Platform::String^ filename
00031         );
00032
00033     concurrency::task<Platform::Array<byte>^> ReadDataAsync(
00034         _In_ Platform::String^ filename
00035         );
00036
00037     uint32 WriteData(
00038         _In_ Platform::String^ filename,
00039         _In_ const Platform::Array<byte>^ fileData
00040         );
00041
00042     concurrency::task<void> WriteDataAsync(
00043         _In_ Platform::String^ filename,
00044         _In_ const Platform::Array<byte>^ fileData
00045         );
00046 };
Generated on Fri Nov 15 2024 22:19:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WaveEffect Member List

This is the complete list of members for WaveEffect, including all inherited members.
Clamp(float v, float low, float high) | WaveEffect | [inline, private, static]
CreateWaveImpl(_Outptr_ IUnknown **ppEffectImpl) | WaveEffect | [static]
GenerateMesh(_Outptr_ Vertex **ppMesh) | WaveEffect | [private]
GetSkewX() const | WaveEffect |
GetSkewY() const | WaveEffect |
GetWaveOffset() const | WaveEffect |
IFACEMETHODIMP_(UINT32) GetInputCount() const | WaveEffect | [inline]
IFACEMETHODIMP_(ULONG) AddRef() | WaveEffect |
IFACEMETHODIMP_(ULONG) Release() | WaveEffect |
Initialize(_In_ ID2D1EffectContext *pEffectContext, _In_ ID2D1TransformGraph *pTransformGraph) | WaveEffect |
m_constants | WaveEffect | [private]
m_drawInfo | WaveEffect | [private]
m_inputRect | WaveEffect | [private]
m_numVertices | WaveEffect | [private]
m_refCount | WaveEffect | [private]
m_sizeX | WaveEffect | [private]
m_sizeY | WaveEffect | [private]
m_skewX | WaveEffect | [private]
m_skewY | WaveEffect | [private]
m_vertexBuffer | WaveEffect | [private]
m_waveOffset | WaveEffect | [private]
MapInputRectsToOutputRect(_In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects, _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects, UINT32 inputRectCount, _Out_ D2D1_RECT_L *pOutputRect, _Out_ D2D1_RECT_L *pOutputOpaqueSubRect) | WaveEffect |
MapInvalidRect(UINT32 inputIndex, D2D1_RECT_L invalidInputRect, _Out_ D2D1_RECT_L *pInvalidOutputRect) const | WaveEffect |
MapOutputRectToInputRects(_In_ const D2D1_RECT_L *pOutputRect, _Out_writes_(inputRectCount) D2D1_RECT_L *pInputRects, UINT32 inputRectCount) const | WaveEffect |
matrix | WaveEffect |
PrepareForRender(D2D1_CHANGE_TYPE changeType) | WaveEffect |
QueryInterface(_In_ REFIID riid, _Outptr_ void **ppOutput) | WaveEffect |
Register(_In_ ID2D1Factory1 *pFactory) | WaveEffect | [static]
SetDrawInfo(_In_ ID2D1DrawInfo *pDrawInfo) | WaveEffect |
SetGraph(_In_ ID2D1TransformGraph *pTransformGraph) | WaveEffect | [inline]
SetSkewX(float skew) | WaveEffect |
SetSkewY(float skew) | WaveEffect |
SetWaveOffset(float waveOffset) | WaveEffect |
sizeX | WaveEffect |
sizeY | WaveEffect |
skewX | WaveEffect |
skewY | WaveEffect |
UpdateConstants() | WaveEffect | [private]
WaveEffect() | WaveEffect | [private]
waveOffset | WaveEffect |
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_RoundingAndPadding Member List

This is the complete list of members for Scenario5_RoundingAndPadding, including all inherited members.
Display_Click(object sender, RoutedEventArgs e) | Scenario5_RoundingAndPadding | [inline, private]
DisplayRoundingAlgorithmAsString(Windows.Globalization.NumberFormatting.RoundingAlgorithm roundingAlgorithm) | Scenario5_RoundingAndPadding | [inline, private]
DoCurrencyRoundingScenarios(string currencyCode, RoundingAlgorithm roundingAlgorithm) | Scenario5_RoundingAndPadding | [inline, private]
DoIncrementRoundingScenarios(RoundingAlgorithm roundingAlgorithm) | Scenario5_RoundingAndPadding | [inline, private]
DoPaddingAndRoundingScenarios(RoundingAlgorithm roundingAlgorithm, int significantDigits, int integerDigits, int fractionalDigits) | Scenario5_RoundingAndPadding | [inline, private]
DoPaddingScenarios(INumberFormatter formatter) | Scenario5_RoundingAndPadding | [inline, private]
DoSignificantDigitRoundingScenarios(RoundingAlgorithm roundingAlgorithm) | Scenario5_RoundingAndPadding | [inline, private]
Scenario5_RoundingAndPadding() | Scenario5_RoundingAndPadding | [inline]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/PresentationFormats.cs Source File

  • BluetoothLE
  • cs

PresentationFormats.cs

Go to the documentation of this file.
00001 ﻿// <copyright file="PresentationFormats.cs" company="Microsoft Corporation">
00002 // Copyright (c) Microsoft Corporation.  All rights reserved.
00003 // </copyright>
00004 //----------------------------------------------------------------------------------------------
00005
00006 namespace SDKTemplate
00007 {
00008     /// <summary>
00009     /// Class containing the details of Gatt characteristics presentation formats
00010     /// </summary>
00011     public class PresentationFormats
00012     {
00013         /// <summary>
00014         /// Units are established international standards for the measurement of physical quantities.
00015         /// </summary>
00016         /// <remarks>Please refer https://www.bluetooth.com/specifications/assigned-numbers/units </remarks>
00017         public enum Units
00018         {
00019             Unitless = 0x2700,
00020             LengthMetre = 0x2701,
00021             MassKilogram = 0x2702,
00022             TimeSecond = 0x2703,
00023             ElectricCurrentAmpere = 0x2704,
00024             ThermodynamicTemperatureKelvin = 0x2705,
00025             AmountOfSubstanceMole = 0x2706,
00026             LuminousIntensityCandela = 0x2707,
00027             AreaSquareMetres = 0x2710,
00028             VolumeCubicMetres = 0x2711,
00029             VelocityMetresPerSecond = 0x2712,
00030             AccelerationMetresPerSecondSquared = 0x2713,
00031             WaveNumberReciprocalMetre = 0x2714,
00032             DensityKilogramperCubicMetre = 0x2715,
00033             SurfaceDensityKilogramPerSquareMetre = 0x2716,
00034             SpecificVolumeCubicMetrePerKilogram = 0x2717,
00035             CurrentDensityAmperePerSquareMetre = 0x2718,
00036             MagneticFieldStrengthAmperePerMetre = 0x2719,
00037             AmountConcentrationMolePerCubicMetre = 0x271A,
00038             MassConcentrationKilogramPerCubicMetre = 0x271B,
00039             LuminanceCandelaPerSquareMetre = 0x271C,
00040             RefractiveIndex = 0x271D,
00041             RelativePermeability = 0x271E,
00042             PlaneAngleRadian = 0x2720,
00043             SolidAngleSteradian = 0x2721,
00044             FrequencyHertz = 0x2722,
00045             ForceNewton = 0x2723,
00046             PressurePascal = 0x2724,
00047             EnergyJoule = 0x2725,
00048             PowerWatt = 0x2726,
00049             ElectricChargeCoulomb = 0x2727,
00050             ElectricPotentialDifferenceVolt = 0x2728,
00051             CapacitanceFarad = 0x2729,
00052             ElectricResistanceOhm = 0x272A,
00053             ElectricConductanceSiemens = 0x272B,
00054             MagneticFluxWeber = 0x272C,
00055             MagneticFluxDensityTesla = 0x272D,
00056             InductanceHenry = 0x272E,
00057             CelsiusTemperatureDegreeCelsius = 0x272F,
00058             LuminousFluxLumen = 0x2730,
00059             IlluminanceLux = 0x2731,
00060             ActivityReferredToARadioNuclideBecquerel = 0x2732,
00061             AbsorbedDoseGray = 0x2733,
00062             DoseEquivalentSievert = 0x2734,
00063             CatalyticActivityKatal = 0x2735,
00064             DynamicViscosityPascalSecond = 0x2740,
00065             MomentOfForceNewtonMetre = 0x2741,
00066             SurfaceTensionNewtonPerMetre = 0x2742,
00067             AngularVelocityRadianPerSecond = 0x2743,
00068             AngularAccelerationRadianPerSecondSquared = 0x2744,
00069             HeatFluxDensityWattPerSquareMetre = 0x2745,
00070             HeatCapacityJoulePerKelvin = 0x2746,
00071             SpecificHeatCapacityJoulePerKilogramKelvin = 0x2747,
00072             SpecificEnergyJoulePerKilogram = 0x2748,
00073             ThermalConductivityWattPerMetreKelvin = 0x2749,
00074             EnergyDensityJoulePerCubicMetre = 0x274A,
00075             ElectricfieldstrengthVoltPerMetre = 0x274B,
00076             ElectricchargeDensityCoulombPerCubicMetre = 0x274C,
00077             SurfacechargeDensityCoulombPerSquareMetre = 0x274D,
00078             ElectricFluxDensityCoulombPerSquareMetre = 0x274E,
00079             PermittivityFaradPerMetre = 0x274F,
00080             PermeabilityHenryPerMetre = 0x2750,
00081             MolarEnergyJoulePermole = 0x2751,
00082             MolarentropyJoulePermoleKelvin = 0x2752,
00083             ExposureCoulombPerKilogram = 0x2753,
00084             AbsorbeddoserateGrayPerSecond = 0x2754,
00085             RadiantintensityWattPerSteradian = 0x2755,
00086             RadianceWattPerSquareMetreSteradian = 0x2756,
00087             CatalyticActivityConcentrationKatalPerCubicMetre = 0x2757,
00088             TimeMinute = 0x2760,
00089             TimeHour = 0x2761,
00090             TimeDay = 0x2762,
00091             PlaneAngleDegree = 0x2763,
00092             PlaneAngleMinute = 0x2764,
00093             PlaneAngleSecond = 0x2765,
00094             AreaHectare = 0x2766,
00095             VolumeLitre = 0x2767,
00096             MassTonne = 0x2768,
00097             PressureBar = 0x2780,
00098             PressureMilliMetreofmercury = 0x2781,
00099             LengthAngstrom = 0x2782,
00100             LengthNauticalMile = 0x2783,
00101             AreaBarn = 0x2784,
00102             VelocityKnot = 0x2785,
00103             LogarithmicRadioQuantityNeper = 0x2786,
00104             LogarithmicRadioQuantityBel = 0x2787,
00105             LengthYard = 0x27A0,
00106             LengthParsec = 0x27A1,
00107             LengthInch = 0x27A2,
00108             LengthFoot = 0x27A3,
00109             LengthMile = 0x27A4,
00110             PressurePoundForcePerSquareinch = 0x27A5,
00111             VelocityKiloMetrePerHour = 0x27A6,
00112             VelocityMilePerHour = 0x27A7,
00113             AngularVelocityRevolutionPerminute = 0x27A8,
00114             EnergyGramcalorie = 0x27A9,
00115             EnergyKilogramcalorie = 0x27AA,
00116             EnergyKiloWattHour = 0x27AB,
00117             ThermodynamicTemperatureDegreeFahrenheit = 0x27AC,
00118             Percentage = 0x27AD,
00119             PerMille = 0x27AE,
00120             PeriodBeatsPerMinute = 0x27AF,
00121             ElectricchargeAmpereHours = 0x27B0,
00122             MassDensityMilligramPerdeciLitre = 0x27B1,
00123             MassDensityMillimolePerLitre = 0x27B2,
00124             TimeYear = 0x27B3,
00125             TimeMonth = 0x27B4,
00126             ConcentrationCountPerCubicMetre = 0x27B5,
00127             IrradianceWattPerSquareMetre = 0x27B6,
00128             MilliliterPerKilogramPerminute = 0x27B7,
00129             MassPound = 0x27B8
00130         }
00131
00132         /// <summary>
00133         /// The Name Space field is used to identify the organization that is responsible for defining the enumerations for the description field.
00134         /// </summary>
00135         /// <remarks>
00136         /// Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
00137         /// </remarks>
00138         public enum NamespaceId
00139         {
00140             BluetoothSigAssignedNumber = 1,
00141             ReservedForFutureUse
00142         }
00143
00144         /// <summary>
00145         /// The Description is an enumerated value from the organization identified by the Name Space field.
00146         /// </summary>
00147         /// <remarks>
00148         /// Please refer https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
00149         /// </remarks>
00150         public const ushort Description = 0x0000;
00151
00152         /// <summary>
00153         /// Exponent value for the characteristics
00154         /// </summary>
00155         public const int Exponent = 0;
00156     }
00157 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/Scenario4_AddOverlays.xaml.cpp Source File

  • MediaTranscoding
  • cpp

Scenario4_AddOverlays.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario4_AddOverlays.xaml.h"
00013
00014 using namespace SDKTemplate;
00015 using namespace concurrency;
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Controls;
00021 using namespace Windows::UI::Xaml::Controls::Primitives;
00022 using namespace Windows::UI::Xaml::Data;
00023 using namespace Windows::UI::Xaml::Input;
00024 using namespace Windows::UI::Xaml::Media;
00025 using namespace Windows::UI::Xaml::Navigation;
00026 using namespace Windows::Media::Core;
00027 using namespace Windows::Media::Editing;
00028 using namespace Windows::Storage;
00029 using namespace Windows::Storage::Pickers;
00030 using namespace Windows::Storage::Streams;
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 Scenario4_AddOverlays::Scenario4_AddOverlays() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario4_AddOverlays::OnNavigatedFrom(NavigationEventArgs^ e)
00040 {
00041     mediaElement->Source = nullptr;
00042     mediaStreamSource = nullptr;
00043 }
00044
00045 void Scenario4_AddOverlays::ChooseBaseVideo_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     auto picker = ref new FileOpenPicker();
00048     picker->SuggestedStartLocation = PickerLocationId::VideosLibrary;
00049     picker->FileTypeFilter->Append(".mp4");
00050
00051     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ videoFile)
00052     {
00053         if (videoFile == nullptr)
00054         {
00055             rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00056             return;
00057         }
00058
00059         this->baseVideoFile = videoFile;
00060         create_task(this->baseVideoFile->OpenReadAsync()).then([this](IRandomAccessStreamWithContentType^ videoSource)
00061         {
00062             mediaElement->SetSource(videoSource, baseVideoFile->ContentType);
00063             chooseOverlayVideo->IsEnabled = true;
00064
00065             rootPage->NotifyUser("Video file added", NotifyType::StatusMessage);
00066         });
00067     });
00068 }
00069
00070 void Scenario4_AddOverlays::ChooseOverlayVideo_Click(Object^ sender, RoutedEventArgs^ e)
00071 {
00072     auto picker = ref new FileOpenPicker();
00073     picker->SuggestedStartLocation = PickerLocationId::VideosLibrary;
00074     picker->FileTypeFilter->Append(".mp4");
00075
00076     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ videoFile)
00077     {
00078         if (videoFile == nullptr)
00079         {
00080             rootPage->NotifyUser("File picking cancelled", NotifyType::ErrorMessage);
00081             return;
00082         }
00083
00084         this->overlayVideoFile = videoFile;
00085
00086         CreateOverlays();
00087         rootPage->NotifyUser("Overlay video chosen", NotifyType::StatusMessage);
00088     });
00089 }
00090
00091 void Scenario4_AddOverlays::CreateOverlays()
00092 {
00093     create_task(MediaClip::CreateFromFileAsync(baseVideoFile)).then([this](MediaClip^ baseClip)
00094     {
00095         composition = ref new MediaComposition();
00096         composition->Clips->Append(baseClip);
00097
00098         create_task(MediaClip::CreateFromFileAsync(overlayVideoFile)).then([this](MediaClip^ overlayClip)
00099         {
00100             // Overlay video in upper left corner, retain its native aspect ratio
00101             Rect videoOverlayPosition;
00102             auto encodingProperties = overlayClip->GetVideoEncodingProperties();
00103             videoOverlayPosition.Height = (float)(mediaElement->ActualHeight / 3);
00104             videoOverlayPosition.Width = (float)encodingProperties->Width / (float)encodingProperties->Height * videoOverlayPosition.Height;
00105             videoOverlayPosition.X = 0;
00106             videoOverlayPosition.Y = 0;
00107
00108             auto videoOverlay = ref new MediaOverlay(overlayClip);
00109             videoOverlay->Position = videoOverlayPosition;
00110             videoOverlay->Opacity = 0.75;
00111
00112             auto overlayLayer = ref new MediaOverlayLayer();
00113             overlayLayer->Overlays->Append(videoOverlay);
00114             composition->OverlayLayers->Append(overlayLayer);
00115
00116             // Render to MediaElement
00117             mediaStreamSource = composition->GeneratePreviewMediaStreamSource((int)mediaElement->ActualWidth, (int)mediaElement->ActualHeight);
00118             mediaElement->SetMediaStreamSource(mediaStreamSource);
00119             rootPage->NotifyUser("Overlays created", NotifyType::StatusMessage);
00120         });
00121     });
00122 }
Generated on Fri Nov 15 2024 22:20:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ViewLifetimeControl.cpp Source File

  • Projection
  • cpp

ViewLifetimeControl.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 // The objects defined here demonstrate how to make sure each of the views created remains alive as long as
00008 // the app needs them, but only when they're being used by the app or the user. Many of the scenarios contained in this
00009 // sample use these functions to keep track of the views available and ensure that the view is not closed while
00010 // the scenario is attempting to show it.
00011 //
00012 // As you can see in scenario 1, the ApplicationViewSwitcher.TryShowAsStandaloneAsync and
00013 // ProjectionManager.StartProjectingAsync methods let you show one view next to another. The Consolidated event
00014 // is fired when a view stops being visible separately from other views. Common cases where this will occur
00015 // is when the view falls out of the list of recently used apps, or when the user performs the close gesture on the view.
00016 // This is a good time to close the view, provided the app isn't trying to show the view at the same time. This event
00017 // is fired on the thread of the view that becomes consolidated.
00018 //
00019 // Each view lives on its own thread, so concurrency control is necessary. Also, as you'll see in the sample,
00020 // certain objects may be bound to UI on given threads. Properties of those objects should only be updated
00021 // on that UI thread.
00022
00023 #include "pch.h"
00024 #include "ViewLifetimeControl.h"
00025
00026 using namespace Platform;
00027 using namespace SDKSample::SecondaryViewsHelpers;
00028 using namespace std;
00029 using namespace Windows::Foundation;
00030 using namespace Windows::UI::Core;
00031 using namespace Windows::UI::ViewManagement;
00032 using namespace Windows::UI::Xaml::Data;
00033
00034 // A ViewLifetimeControl is instantiated for every secondary view. ViewLifetimeControl's reference count
00035 // keeps track of when the secondary view thinks it's in use and when the main view is interacting with the secondary view (about to show
00036 // it to the user, etc.) When the reference count drops to zero, the secondary view is closed.
00037 // Instantiate views using "CreateForCurrentView".
00038 ViewLifetimeControl::ViewLifetimeControl(CoreWindow^ newWindow) :
00039     consolidated(true),
00040     madeVisible(false)
00041 {
00042     dispatcher = newWindow->Dispatcher;
00043     window = newWindow;
00044     viewId = ApplicationView::GetApplicationViewIdForWindow(window.Get());
00045
00046     // This class will automatically tell the view when its time to close
00047     // or stay alive in a few cases
00048     RegisterForEvents();
00049 }
00050
00051 // Register for events on the current view
00052 void ViewLifetimeControl::RegisterForEvents()
00053 {
00054     // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00055     // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00056     // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00057     consolidatedToken = ApplicationView::GetForCurrentView()->Consolidated += ref new TypedEventHandler<ApplicationView ^, ApplicationViewConsolidatedEventArgs ^>(this, &ViewLifetimeControl::ViewConsolidated);
00058     visibilityToken = window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &ViewLifetimeControl::VisibilityChanged);
00059 }
00060
00061 // Unregister for events. Call this method before closing the view to prevent leaks.
00062 void ViewLifetimeControl::UnregisterForEvents()
00063 {
00064     ApplicationView::GetForCurrentView()->Consolidated -= consolidatedToken;
00065     window->VisibilityChanged -= visibilityToken;
00066 }
00067
00068 void ViewLifetimeControl::VisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ e)
00069 {
00070     if (e->Visible)
00071     {
00072         // A view is consolidated with other views when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00073         // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00074         // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00075         Consolidated = false;
00076     }
00077 }
00078
00079 void ViewLifetimeControl::ViewConsolidated(ApplicationView^ sender, ApplicationViewConsolidatedEventArgs^ e)
00080 {
00081     // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00082     // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc.
00083     // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
00084     Consolidated = true;
00085 }
00086
00087 // Called when a view has been "consolidated" (no longer accessible to the user)
00088 // and no other view is trying to interact with it. This should only be closed after the reference
00089 // count goes to 0 (including being consolidated). At the end of this, the view is closed.
00090 void ViewLifetimeControl::FinalizeRelease()
00091 {
00092     bool justReleased = false;
00093     globalMutex.lock();
00094     if (!released && refCount == 0)
00095     {
00096         released = true;
00097         justReleased = true;
00098     }
00099     globalMutex.unlock();
00100
00101     // This assumes that released will never be made false after it
00102     // it has been set to true
00103     if (justReleased)
00104     {
00105         UnregisterForEvents();
00106         InternalReleased(this, nullptr);
00107     }
00108 }
00109
00110 // Creates ViewLifetimeControl for the particular view.
00111 // Only do this once per view.
00112 ViewLifetimeControl^ ViewLifetimeControl::CreateForCurrentView()
00113 {
00114     return ref new ViewLifetimeControl(CoreWindow::GetForCurrentThread());
00115 }
00116
00117 // For purposes of this sample, the collection of views
00118 // is bound to a UI collection. This property is available for binding
00119 String^ ViewLifetimeControl::Title::get()
00120 {
00121     // This is expected to only be updated on the thread that this object is bound to
00122     // Hence, it's not necessary to lock
00123     return title;
00124 }
00125
00126 void ViewLifetimeControl::Title::set(String^ value)
00127 {
00128     // This is expected to only be updated on the thread that this object is bound to
00129     // Hence, it's not necessary to lock
00130     if (title != value)
00131     {
00132         title = value;
00133         PropertyChanged(this, ref new PropertyChangedEventArgs("Title"));
00134     }
00135 }
00136
00137 // Dispatcher for this view. Kept here for sending messages between this view and the main view.
00138 CoreDispatcher^ ViewLifetimeControl::Dispatcher::get()
00139 {
00140     // This property never changes, so there's no need to lock
00141     return dispatcher;
00142 }
00143
00144 // Each view has a unique Id, found using the ApplicationView.Id property or
00145 // ApplicationView.GetApplicationViewIdForCoreWindow method. This id is used in all of the ApplicationViewSwitcher
00146 // and ProjectionManager APIs.
00147 int ViewLifetimeControl::Id::get()
00148 {
00149     // This property never changes, so there's no need to lock
00150     return viewId;
00151 }
00152
00153 // Keeps track of if the consolidated event has fired yet. A view is consolidated with other views
00154 // when there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
00155 // launched from Start, etc.) A view stops being consolidated when it's visible--at that point
00156 // the user can interact with it, move it on or off screen, etc.
00157 bool ViewLifetimeControl::Consolidated::get()
00158 {
00159     return consolidated;
00160 }
00161
00162 void ViewLifetimeControl::Consolidated::set(bool value)
00163 {
00164     // This property should only be accessed by the thread on which the view lives, so there's no need to lock
00165     if (consolidated != value)
00166     {
00167         consolidated = value;
00168         if (consolidated)
00169         {
00170             // The view isn't accessible to the user, so it's OK to close it.
00171             StopViewInUse();
00172         }
00173         else
00174         {
00175             // The view has become visible, so do not close it until it's consolidated
00176             StartViewInUse();
00177             madeVisible = true;
00178         }
00179     }
00180 }
00181
00182 // Signals that the view is being interacted with by another view,
00183 // so it shouldn't be closed even if it becomes "consolidated"
00184 int ViewLifetimeControl::StartViewInUse()
00185 {
00186     bool releasedCopy = false;
00187     int refCountCopy = 0;
00188
00189     globalMutex.lock();
00190     releasedCopy = released;
00191     if (!released)
00192     {
00193         refCountCopy = ++refCount;
00194     }
00195     globalMutex.unlock();
00196
00197     if (releasedCopy)
00198     {
00199         throw ref new ObjectDisposedException("The view is being disposed");
00200     }
00201
00202     return refCountCopy;
00203 }
00204
00205 // Should come after any call to StartViewInUse
00206 // Signals that the another view has finished interacting with the view tracked
00207 // by this object
00208 int ViewLifetimeControl::StopViewInUse()
00209 {
00210     bool releasedCopy = false;
00211     int refCountCopy = -1;
00212
00213     globalMutex.lock();
00214     releasedCopy = released;
00215     if (!released && refCount > 0)
00216     {
00217         refCountCopy = --refCount;
00218         if ((refCountCopy == 0) && madeVisible)
00219         {
00220             // If no other view is interacting with this view, and
00221             // the view isn't accessible to the user, it's appropriate
00222             // to close it
00223             //
00224             // Before actually closing the view, make sure there are no
00225             // other important events waiting in the queue (this low-priority item
00226             // will run after other events)
00227             dispatcher->RunAsync(CoreDispatcherPriority::Low,
00228                 ref new DispatchedHandler(this, &ViewLifetimeControl::FinalizeRelease));
00229         }
00230     }
00231     globalMutex.unlock();
00232
00233     if (releasedCopy)
00234     {
00235         throw ref new ObjectDisposedException("The view is being disposed");
00236     }
00237
00238     if (refCountCopy < 0)
00239     {
00240         throw ref new Exception(HRESULT_FROM_WIN32(ERROR_INVALID_STATE), "Object was released too many times");
00241     }
00242
00243     return refCountCopy;
00244 }
00245
00246 // Signals to consumers that its time to close the view so that
00247 // they can clean up (including calling Window.Close() when finished)
00248 EventRegistrationToken ViewLifetimeControl::Released::add(ViewReleasedHandler^ handler)
00249 {
00250     bool releasedCopy = false;
00251     EventRegistrationToken eventToken;
00252     globalMutex.lock();
00253     releasedCopy = released;
00254     if (!released)
00255     {
00256         eventToken = InternalReleased += handler;
00257     }
00258     globalMutex.unlock();
00259
00260     if (releasedCopy)
00261     {
00262         throw ref new ObjectDisposedException("The view is being disposed");
00263     }
00264
00265     return eventToken;
00266 }
00267
00268 void ViewLifetimeControl::Released::remove(EventRegistrationToken token)
00269 {
00270     lock_guard<mutex> lock(globalMutex);
00271     return InternalReleased -= token;
00272 }
Generated on Fri Nov 15 2024 22:20:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/MainPage.xaml.cpp Source File

  • CameraGetPreviewFrame
  • cpp

MainPage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include <MemoryBuffer.h>   // IMemoryBufferByteAccess
00015 #include <sstream>
00016
00017 using namespace Concurrency;
00018 using namespace CameraGetPreviewFrame;
00019 using namespace Platform;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Devices::Sensors;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Graphics::Display;
00025 using namespace Windows::Graphics::Imaging;
00026 using namespace Windows::Media;
00027 using namespace Windows::Storage;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Controls::Primitives;
00031 using namespace Windows::UI::Xaml::Data;
00032 using namespace Windows::UI::Xaml::Input;
00033 using namespace Windows::UI::Xaml::Media;
00034 using namespace Windows::UI::Xaml::Navigation;
00035
00036 MainPage::MainPage()
00037     : _mediaCapture(nullptr)
00038     , _isInitialized(false)
00039     , _isPreviewing(false)
00040     , _externalCamera(false)
00041     , _mirroringPreview(false)
00042     , _displayOrientation(DisplayOrientations::Portrait)
00043     , _displayRequest(ref new Windows::System::Display::DisplayRequest())
00044     , RotationKey({ 0xC380465D, 0x2271, 0x428C,{ 0x9B, 0x83, 0xEC, 0xEA, 0x3B, 0x4A, 0x85, 0xC1 } })
00045     , _captureFolder(nullptr)
00046 {
00047     InitializeComponent();
00048
00049     _displayInformation = DisplayInformation::GetForCurrentView();
00050     _systemMediaControls = SystemMediaTransportControls::GetForCurrentView();
00051
00052     // Cache the UI to have the checkboxes retain their state, as the enabled/disabled state of the
00053     // GetPreviewFrameButton is reset in code when suspending/navigating (see Start/StopPreviewAsync)
00054     Page::NavigationCacheMode = Navigation::NavigationCacheMode::Required;
00055
00056     // Useful to know when to initialize/clean up the camera
00057     _applicationSuspendingEventToken =
00058         Application::Current->Suspending += ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
00059     _applicationResumingEventToken =
00060         Application::Current->Resuming += ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);
00061 }
00062
00063 MainPage::~MainPage()
00064 {
00065     Application::Current->Suspending -= _applicationSuspendingEventToken;
00066     Application::Current->Resuming -= _applicationResumingEventToken;
00067     _systemMediaControls->PropertyChanged -= _mediaControlPropChangedEventToken;
00068 }
00069
00070 /// <summary>
00071 /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview
00072 /// </summary>
00073 /// <returns></returns>
00074 task<void> MainPage::InitializeCameraAsync()
00075 {
00076     WriteLine("InitializeCameraAsync");
00077
00078     // Attempt to get the back camera if one is available, but use any camera device if not
00079     return FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel::Back)
00080         .then([this](DeviceInformation^ camera)
00081     {
00082         if (camera == nullptr)
00083         {
00084             WriteLine("No camera device found!");
00085             return;
00086         }
00087         // Figure out where the camera is located
00088         if (camera->EnclosureLocation == nullptr || camera->EnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Unknown)
00089         {
00090             // No information on the location of the camera, assume it's an external camera, not integrated on the device
00091             _externalCamera = true;
00092         }
00093         else
00094         {
00095             // Camera is fixed on the device
00096             _externalCamera = false;
00097
00098             // Only mirror the preview if the camera is on the front panel
00099             _mirroringPreview = (camera->EnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Front);
00100         }
00101
00102         _mediaCapture = ref new Capture::MediaCapture();
00103
00104         // Register for a notification when something goes wrong
00105         _mediaCaptureFailedEventToken =
00106             _mediaCapture->Failed += ref new Capture::MediaCaptureFailedEventHandler(this, &MainPage::MediaCapture_Failed);
00107
00108         auto settings = ref new Capture::MediaCaptureInitializationSettings();
00109         settings->VideoDeviceId = camera->Id;
00110
00111         // Initialize media capture and start the preview
00112         create_task(_mediaCapture->InitializeAsync(settings))
00113             .then([this]()
00114         {
00115             _isInitialized = true;
00116
00117             return StartPreviewAsync();
00118         // Different return types, must do the error checking here since we cannot return and send
00119         // execeptions back up the chain.
00120         }).then([this](task<void> previousTask)
00121         {
00122             try
00123             {
00124                 previousTask.get();
00125             }
00126             catch (AccessDeniedException^)
00127             {
00128                 WriteLine("The app was denied access to the camera");
00129             }
00130         });
00131     }).then([this]()
00132     {
00133         create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Pictures))
00134             .then([this](StorageLibrary^ picturesLibrary)
00135         {
00136             _captureFolder = picturesLibrary->SaveFolder;
00137             if (_captureFolder == nullptr)
00138             {
00139                 // In this case fall back to the local app storage since the Pictures Library is not available
00140                 _captureFolder = ApplicationData::Current->LocalFolder;
00141             }
00142         });
00143     });
00144 }
00145
00146 /// <summary>
00147 /// Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events
00148 /// </summary>
00149 /// <returns></returns>
00150 task<void> MainPage::CleanupCameraAsync()
00151 {
00152     WriteLine("CleanupCameraAsync");
00153
00154     std::vector<task<void>> taskList;
00155
00156     if (_isInitialized)
00157     {
00158         if (_isPreviewing)
00159         {
00160             auto stopPreviewTask = create_task(StopPreviewAsync());
00161             taskList.push_back(stopPreviewTask);
00162         }
00163
00164         _isInitialized = false;
00165     }
00166
00167     // When all our tasks complete, clean up MediaCapture
00168     return when_all(taskList.begin(), taskList.end())
00169         .then([this]()
00170     {
00171         if (_mediaCapture.Get() != nullptr)
00172         {
00173             _mediaCapture->Failed -= _mediaCaptureFailedEventToken;
00174             _mediaCapture = nullptr;
00175         }
00176     });
00177 }
00178
00179 /// <summary>
00180 /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI
00181 /// </summary>
00182 /// <returns></returns>
00183 task<void> MainPage::StartPreviewAsync()
00184 {
00185     WriteLine("StartPreviewAsync");
00186
00187     // Prevent the device from sleeping while the preview is running
00188     _displayRequest->RequestActive();
00189
00190     // Register to listen for media property changes
00191     _mediaControlPropChangedEventToken =
00192         _systemMediaControls->PropertyChanged += ref new TypedEventHandler<SystemMediaTransportControls^, SystemMediaTransportControlsPropertyChangedEventArgs^>(this, &MainPage::SystemMediaControls_PropertyChanged);
00193
00194     // Set the preview source in the UI and mirror it if necessary
00195     PreviewControl->Source = _mediaCapture.Get();
00196     PreviewControl->FlowDirection = _mirroringPreview ? Windows::UI::Xaml::FlowDirection::RightToLeft : Windows::UI::Xaml::FlowDirection::LeftToRight;
00197
00198     // Start the preview
00199     return create_task(_mediaCapture->StartPreviewAsync())
00200         .then([this](task<void> previousTask)
00201     {
00202         _isPreviewing = true;
00203         GetPreviewFrameButton->IsEnabled = _isPreviewing;
00204
00205         // Only need to update the orientation if the camera is mounted on the device
00206         if (!_externalCamera)
00207         {
00208             return SetPreviewRotationAsync();
00209         }
00210
00211         // Not external, just return the previous task
00212         return previousTask;
00213     });
00214 }
00215
00216 /// <summary>
00217 /// Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview
00218 /// </summary>
00219 task<void> MainPage::SetPreviewRotationAsync()
00220 {
00221     // Calculate which way and how far to rotate the preview
00222     int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);
00223
00224     // The rotation direction needs to be inverted if the preview is being mirrored
00225     if (_mirroringPreview)
00226     {
00227         rotationDegrees = (360 - rotationDegrees) % 360;
00228     }
00229
00230     // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
00231     auto props = _mediaCapture->VideoDeviceController->GetMediaStreamProperties(Capture::MediaStreamType::VideoPreview);
00232     props->Properties->Insert(RotationKey, rotationDegrees);
00233     return create_task(_mediaCapture->SetEncodingPropertiesAsync(Capture::MediaStreamType::VideoPreview, props, nullptr));
00234 }
00235
00236 /// <summary>
00237 /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes
00238 /// </summary>
00239 /// <returns></returns>
00240 task<void> MainPage::StopPreviewAsync()
00241 {
00242     _isPreviewing = false;
00243
00244     return create_task(_mediaCapture->StopPreviewAsync())
00245         .then([this]()
00246     {
00247         // Use the dispatcher because this method is sometimes called from non-UI threads
00248         return Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00249         {
00250             PreviewControl->Source = nullptr;
00251             // Allow the device screen to sleep now that the preview is stopped
00252             _displayRequest->RequestRelease();
00253
00254             GetPreviewFrameButton->IsEnabled = _isPreviewing;
00255         }));
00256     });
00257 }
00258
00259 /// <summary>
00260 /// Gets the current preview frame as a SoftwareBitmap, displays its properties in a TextBlock, and can optionally display the image
00261 /// in the UI and/or save it to disk as a jpg
00262 /// </summary>
00263 /// <returns></returns>
00264 task<void> MainPage::GetPreviewFrameAsSoftwareBitmapAsync()
00265 {
00266     // Get information about the preview
00267     auto previewProperties = static_cast<MediaProperties::VideoEncodingProperties^>(_mediaCapture->VideoDeviceController->GetMediaStreamProperties(Capture::MediaStreamType::VideoPreview));
00268     unsigned int videoFrameWidth = previewProperties->Width;
00269     unsigned int videoFrameHeight = previewProperties->Height;
00270
00271     // Create the video frame to request a SoftwareBitmap preview frame
00272     auto videoFrame = ref new VideoFrame(BitmapPixelFormat::Bgra8, videoFrameWidth, videoFrameHeight);
00273
00274     // Capture the preview frame
00275     return create_task(_mediaCapture->GetPreviewFrameAsync(videoFrame))
00276         .then([this](VideoFrame^ currentFrame)
00277     {
00278         // Collect the resulting frame
00279         auto previewFrame = currentFrame->SoftwareBitmap;
00280
00281         // Show the frame information
00282         std::wstringstream ss;
00283         ss << previewFrame->PixelWidth << "x" << previewFrame->PixelHeight << " " << previewFrame->BitmapPixelFormat.ToString()->Data();
00284         FrameInfoTextBlock->Text = ref new String(ss.str().c_str());
00285
00286         // Add a simple green filter effect to the SoftwareBitmap
00287         if (GreenEffectCheckBox->IsChecked->Value)
00288         {
00289             ApplyGreenFilter(previewFrame);
00290         }
00291
00292         std::vector<task<void>> taskList;
00293
00294         // Show the frame (as is, no rotation is being applied)
00295         if (ShowFrameCheckBox->IsChecked->Value == true)
00296         {
00297             // Copy it to a WriteableBitmap to display it to the user
00298             auto sbSource = ref new Media::Imaging::SoftwareBitmapSource();
00299             taskList.push_back(create_task(sbSource->SetBitmapAsync(previewFrame))
00300                 .then([this, sbSource]()
00301             {
00302                 // Display it in the Image control
00303                 PreviewFrameImage->Source = sbSource;
00304             }));
00305         }
00306
00307         // Save the frame (as is, no rotation is being applied)
00308         if (SaveFrameCheckBox->IsChecked->Value == true)
00309         {
00310             taskList.push_back(SaveSoftwareBitmapAsync(previewFrame));
00311         }
00312
00313         return when_all(taskList.begin(), taskList.end()).then([currentFrame]() {
00314             // IClosable.Close projects into CX as operator delete.
00315             delete currentFrame;
00316         });
00317     });
00318 }
00319
00320 /// <summary>
00321 /// Gets the current preview frame as a Direct3DSurface and displays its properties in a TextBlock
00322 /// </summary>
00323 /// <returns></returns>
00324 task<void> MainPage::GetPreviewFrameAsD3DSurfaceAsync()
00325 {
00326     // Capture the preview frame as a D3D surface
00327     return create_task(_mediaCapture->GetPreviewFrameAsync())
00328         .then([this](VideoFrame^ currentFrame)
00329     {
00330         std::wstringstream ss;
00331
00332         // Check that the Direct3DSurface isn't null. It's possible that the device does not support getting the frame
00333         // as a D3D surface
00334         if (currentFrame->Direct3DSurface != nullptr)
00335         {
00336             // Collect the resulting frame
00337             auto surface = currentFrame->Direct3DSurface;
00338
00339             // Show the frame information
00340             ss << surface->Description.Width << "x" << surface->Description.Height << " " << surface->Description.Format.ToString()->Data();
00341             FrameInfoTextBlock->Text = ref new String(ss.str().c_str());
00342         }
00343         else // Fall back to software bitmap
00344         {
00345             // Collect the resulting frame
00346             auto previewFrame = currentFrame->SoftwareBitmap;
00347
00348             // Show the frame information
00349             ss << previewFrame->PixelWidth << "x" << previewFrame->PixelHeight << " " << previewFrame->BitmapPixelFormat.ToString()->Data();
00350             FrameInfoTextBlock->Text = ref new String(ss.str().c_str());
00351         }
00352
00353         // Clear the image
00354         PreviewFrameImage->Source = nullptr;
00355
00356         // IClosable.Close projects into CX as operator delete.
00357         delete currentFrame;
00358     });
00359 }
00360
00361 /// <summary>
00362 /// Saves a SoftwareBitmap to the _captureFolder
00363 /// </summary>
00364 /// <param name="bitmap"></param>
00365 /// <returns></returns>
00366 task<void> MainPage::SaveSoftwareBitmapAsync(SoftwareBitmap^ bitmap)
00367 {
00368     return create_task(_captureFolder->CreateFileAsync("PreviewFrame.jpg", CreationCollisionOption::GenerateUniqueName))
00369         .then([bitmap](StorageFile^ file)
00370     {
00371         return create_task(file->OpenAsync(FileAccessMode::ReadWrite));
00372     }).then([this, bitmap](Streams::IRandomAccessStream^ outputStream)
00373     {
00374         return create_task(BitmapEncoder::CreateAsync(BitmapEncoder::JpegEncoderId, outputStream))
00375             .then([bitmap](BitmapEncoder^ encoder)
00376         {
00377             // Grab the data from the SoftwareBitmap
00378             encoder->SetSoftwareBitmap(bitmap);
00379             return create_task(encoder->FlushAsync());
00380         }).then([this, outputStream](task<void> previousTask)
00381         {
00382             // IClosable.Close projects into CX as operator delete.
00383             delete outputStream;
00384             try
00385             {
00386                 previousTask.get();
00387             }
00388             catch (Exception^ ex)
00389             {
00390                 // File I/O errors are reported as exceptions
00391                 WriteException(ex);
00392             }
00393         });
00394     });
00395 }
00396
00397
00398 /// <summary>
00399 /// Applies a basic effect to a Bgra8 SoftwareBitmap in-place
00400 /// </summary>
00401 /// <param name="bitmap">SoftwareBitmap that will receive the effect</param>
00402 void MainPage::ApplyGreenFilter(SoftwareBitmap^ bitmap)
00403 {
00404     // Effect is hard-coded to operate on BGRA8 format only
00405     if (bitmap->BitmapPixelFormat == BitmapPixelFormat::Bgra8)
00406     {
00407         // In BGRA8 format, each pixel is defined by 4 bytes
00408         const int BYTES_PER_PIXEL = 4;
00409
00410         BitmapBuffer^ buffer = bitmap->LockBuffer(BitmapBufferAccessMode::ReadWrite);
00411         IMemoryBufferReference^ reference = buffer->CreateReference();
00412
00413         Microsoft::WRL::ComPtr<IMemoryBufferByteAccess> byteAccess;
00414         if (SUCCEEDED(reinterpret_cast<IUnknown*>(reference)->QueryInterface(IID_PPV_ARGS(&byteAccess))))
00415         {
00416             // Get a pointer to the pixel buffer
00417             byte* data;
00418             unsigned capacity;
00419             byteAccess->GetBuffer(&data, &capacity);
00420
00421             // Get information about the BitmapBuffer
00422             auto desc = buffer->GetPlaneDescription(0);
00423
00424             // Iterate over all pixels
00425             for (int row = 0; row < desc.Height; row++)
00426             {
00427                 for (int col = 0; col < desc.Width; col++)
00428                 {
00429                     // Index of the current pixel in the buffer (defined by the next 4 bytes, BGRA8)
00430                     auto currPixel = desc.StartIndex + desc.Stride * row + BYTES_PER_PIXEL * col;
00431
00432                     // Read the current pixel information into b,g,r channels (leave out alpha channel)
00433                     auto b = data[currPixel + 0]; // Blue
00434                     auto g = data[currPixel + 1]; // Green
00435                     auto r = data[currPixel + 2]; // Red
00436
00437                     // Boost the green channel, leave the other two untouched
00438                     data[currPixel + 0] = b;
00439                     data[currPixel + 1] = min(g + 80, 255);
00440                     data[currPixel + 2] = r;
00441                 }
00442             }
00443         }
00444         delete reference;
00445         delete buffer;
00446     }
00447 }
00448
00449 /// <summary>
00450 /// Queries the available video capture devices to try and find one mounted on the desired panel
00451 /// </summary>
00452 /// <param name="desiredPanel">The panel on the device that the desired camera is mounted on</param>
00453 /// <returns>A DeviceInformation instance with a reference to the camera mounted on the desired panel if available,
00454 ///          any other camera if not, or null if no camera is available.</returns>
00455 task<DeviceInformation^> MainPage::FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel)
00456 {
00457     // Get available devices for capturing pictures
00458     auto allVideoDevices = DeviceInformation::FindAllAsync(DeviceClass::VideoCapture);
00459
00460     auto deviceEnumTask = create_task(allVideoDevices);
00461     return deviceEnumTask.then([panel](DeviceInformationCollection^ devices)
00462     {
00463         for (auto cameraDeviceInfo : devices)
00464         {
00465             if (cameraDeviceInfo->EnclosureLocation != nullptr && cameraDeviceInfo->EnclosureLocation->Panel == panel)
00466             {
00467                 return cameraDeviceInfo;
00468             }
00469         }
00470
00471         // Nothing matched, just return the first
00472         if (devices->Size > 0)
00473         {
00474             return devices->GetAt(0);
00475         }
00476
00477         // We didn't find any devices, so return a null instance
00478         DeviceInformation^ camera = nullptr;
00479         return camera;
00480     });
00481 }
00482
00483 /// <summary>
00484 /// Writes a given string to the output window
00485 /// </summary>
00486 /// <param name="str">String to be written</param>
00487 void MainPage::WriteLine(String^ str)
00488 {
00489     std::wstringstream wStringstream;
00490     wStringstream << str->Data() << "\n";
00491     OutputDebugString(wStringstream.str().c_str());
00492 }
00493
00494 /// <summary>
00495 /// Writes a given exception message and hresult to the output window
00496 /// </summary>
00497 /// <param name="ex">Exception to be written</param>
00498 void MainPage::WriteException(Exception^ ex)
00499 {
00500     std::wstringstream wStringstream;
00501     wStringstream << "0x" << ex->HResult << ": " << ex->Message->Data();
00502     OutputDebugString(wStringstream.str().c_str());
00503 }
00504
00505 /// <summary>
00506 /// Converts the given orientation of the app on the screen to the corresponding rotation in degrees
00507 /// </summary>
00508 /// <param name="orientation">The orientation of the app on the screen</param>
00509 /// <returns>An orientation in degrees</returns>
00510 int MainPage::ConvertDisplayOrientationToDegrees(DisplayOrientations orientation)
00511 {
00512     switch (orientation)
00513     {
00514     case DisplayOrientations::Portrait:
00515         return 90;
00516     case DisplayOrientations::LandscapeFlipped:
00517         return 180;
00518     case DisplayOrientations::PortraitFlipped:
00519         return 270;
00520     case DisplayOrientations::Landscape:
00521     default:
00522         return 0;
00523     }
00524 }
00525
00526 void MainPage::Application_Suspending(Object^, Windows::ApplicationModel::SuspendingEventArgs^ e)
00527 {
00528     // Handle global application events only if this page is active
00529     if (Frame->CurrentSourcePageType.Name == Interop::TypeName(MainPage::typeid).Name)
00530     {
00531         _displayInformation->OrientationChanged -= _displayInformationEventToken;
00532         auto deferral = e->SuspendingOperation->GetDeferral();
00533         CleanupCameraAsync()
00534         .then([this, deferral]()
00535         {
00536             deferral->Complete();
00537         });
00538     }
00539 }
00540
00541 void MainPage::Application_Resuming(Object^, Object^)
00542 {
00543     // Handle global application events only if this page is active
00544     if (Frame->CurrentSourcePageType.Name == Interop::TypeName(MainPage::typeid).Name)
00545     {
00546         // Populate orientation variables with the current state and register for future changes
00547         _displayOrientation = _displayInformation->CurrentOrientation;
00548         _displayInformationEventToken =
00549             _displayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &MainPage::DisplayInformation_OrientationChanged);
00550
00551         InitializeCameraAsync();
00552     }
00553 }
00554
00555 /// <summary>
00556 /// In the event of the app being minimized this method handles media property change events. If the app receives a mute
00557 /// notification, it is no longer in the foregroud.
00558 /// </summary>
00559 /// <param name="sender"></param>
00560 /// <param name="args"></param>
00561 void MainPage::SystemMediaControls_PropertyChanged(SystemMediaTransportControls^ sender, SystemMediaTransportControlsPropertyChangedEventArgs^ args)
00562 {
00563     Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this, sender, args]()
00564     {
00565         // Only handle this event if this page is currently being displayed
00566         if (args->Property == SystemMediaTransportControlsProperty::SoundLevel && Frame->CurrentSourcePageType.Name == Interop::TypeName(MainPage::typeid).Name)
00567         {
00568             // Check to see if the app is being muted. If so, it is being minimized.
00569             // Otherwise if it is not initialized, it is being brought into focus.
00570             if (sender->SoundLevel == SoundLevel::Muted)
00571             {
00572                 CleanupCameraAsync();
00573             }
00574             else if (!_isInitialized)
00575             {
00576                 InitializeCameraAsync();
00577             }
00578         }
00579     }));
00580 }
00581
00582 /// <summary>
00583 /// This event will fire when the page is rotated
00584 /// </summary>
00585 /// <param name="sender">The event source.</param>
00586 /// <param name="args">The event data.</param>
00587 void MainPage::DisplayInformation_OrientationChanged(DisplayInformation^ sender, Object^)
00588 {
00589     _displayOrientation = sender->CurrentOrientation;
00590
00591     if (_isPreviewing)
00592     {
00593         SetPreviewRotationAsync();
00594     }
00595 }
00596
00597 void MainPage::GetPreviewFrameButton_Click(Object^, RoutedEventArgs^)
00598 {
00599     // If preview is not running, no preview frames can be acquired
00600     if (!_isPreviewing) return;
00601
00602     if ((ShowFrameCheckBox->IsChecked->Value == true) || (SaveFrameCheckBox->IsChecked->Value == true))
00603     {
00604         GetPreviewFrameAsSoftwareBitmapAsync();
00605     }
00606     else
00607     {
00608         GetPreviewFrameAsD3DSurfaceAsync();
00609     }
00610 }
00611
00612 void MainPage::MediaCapture_Failed(Capture::MediaCapture^, Capture::MediaCaptureFailedEventArgs^ errorEventArgs)
00613 {
00614     std::wstringstream ss;
00615     ss << "MediaCapture_Failed: 0x" << errorEventArgs->Code << ": " << errorEventArgs->Message->Data();
00616     WriteLine(ref new String(ss.str().c_str()));
00617
00618     CleanupCameraAsync()
00619         .then([this]()
00620     {
00621         Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00622         {
00623             GetPreviewFrameButton->IsEnabled = _isPreviewing;
00624         }));
00625     });
00626 }
00627
00628 void MainPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^)
00629 {
00630     // Populate orientation variables with the current state and register for future changes
00631     _displayOrientation = _displayInformation->CurrentOrientation;
00632     _displayInformationEventToken =
00633         _displayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &MainPage::DisplayInformation_OrientationChanged);
00634
00635     InitializeCameraAsync();
00636 }
00637
00638 void MainPage::OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^)
00639 {
00640     // Handling of this event is included for completeness, as it will only fire when navigating between pages and this sample only includes one page
00641     CleanupCameraAsync();
00642
00643     _displayInformation->OrientationChanged -= _displayInformationEventToken;
00644 }
Generated on Fri Nov 15 2024 22:17:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario3_Porting.xaml.h Source File

  • Gyrometer
  • cpp

Scenario3_Porting.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // Scenario3_Porting.xaml.h
00003 // Declaration of the Scenario3_Porting class
00004 //
00005
00006 #pragma once
00007
00008 #include "pch.h"
00009 #include "Scenario3_Porting.g.h"
00010 #include "MainPage.xaml.h"
00011
00012 namespace SDKTemplate
00013 {
00014     [Windows::Foundation::Metadata::WebHostHidden]
00015     public ref class Scenario3_Porting sealed
00016     {
00017     public:
00018         Scenario3_Porting();
00019
00020     protected:
00021         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00022         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00023
00024     private:
00025         SDKTemplate::MainPage^ rootPage;
00026         Windows::Devices::Sensors::Gyrometer^ gyrometerWP;
00027         Windows::Devices::Sensors::Gyrometer^ gyrometerWindows;
00028
00029         void GetGyrometerSample(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_CloudFontOverview.xaml.cs Source File

  • XamlCloudFontIntegration
  • cs

Scenario_CloudFontOverview.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario_CloudFontOverview : Page
00020     {
00021         public Scenario_CloudFontOverview()
00022         {
00023             this.InitializeComponent();
00024         }
00025     }
00026 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario1_ListView.xaml.h Source File

  • XamlDragAndDrop
  • cpp

Scenario1_ListView.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_ListView.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_ListView sealed
00024     {
00025     public:
00026         Scenario1_ListView();
00027     private:
00028         MainPage^ rootPage;
00029
00030         Platform::Collections::Vector<Platform::String^>^ GetSampleData();
00031         Platform::Collections::Vector<Platform::String^>^ _reference;
00032         Platform::Collections::Vector<Platform::String^>^ _selection;
00033         Platform::String^ _deletedItem;
00034
00035         void SourceListView_DragItemsStarting(Platform::Object^ sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^ e);
00036         void TargetListView_DragOver(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00037         void TargetListView_Drop(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00038         void TargetListView_DragItemsStarting(Platform::Object^ sender, Windows::UI::Xaml::Controls::DragItemsStartingEventArgs^ e);
00039         void TargetListView_DragItemsCompleted(Windows::UI::Xaml::Controls::ListViewBase^ sender, Windows::UI::Xaml::Controls::DragItemsCompletedEventArgs^ args);
00040         void TargetTextBlock_DragEnter(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00041         void TargetTextBlock_Drop(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00042     };
00043 }
Generated on Fri Nov 15 2024 22:22:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomTitleBar Member List

This is the complete list of members for CustomTitleBar, including all inherited members.
coreTitleBar | CustomTitleBar | [private]
CoreTitleBarHeight() | CustomTitleBar | [inline]
CoreTitleBarPadding() | CustomTitleBar |
CustomTitleBar() | CustomTitleBar |
CustomTitleBar_Loaded(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | CustomTitleBar |
CustomTitleBar_Unloaded(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | CustomTitleBar |
EnableControlsInTitleBar(bool enable) | CustomTitleBar |
isVisibleChangedToken | CustomTitleBar | [private]
layoutMetricsChangedToken | CustomTitleBar | [private]
PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler) | CustomTitleBar | [inline]
PropertyChanged(event_token const &token) noexcept | CustomTitleBar | [inline]
propertyChanged | CustomTitleBar | [private]
SetPageContent(Windows::UI::Xaml::UIElement const &newContent) | CustomTitleBar |
UpdateLayoutMetrics() | CustomTitleBar | [private]
UpdatePositionAndVisibility() | CustomTitleBar | [private]
windowSizeChangedToken | CustomTitleBar | [private]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/CopyFiles.h Source File

  • Clipboard
  • cppwinrt

CopyFiles.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "CopyFiles.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct CopyFiles : CopyFilesT<CopyFiles>
00020     {
00021         CopyFiles();
00022
00023         fire_and_forget CopyButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         fire_and_forget PasteButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025
00026     private:
00027         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00028     };
00029 }
00030
00031 namespace winrt::SDKTemplate::factory_implementation
00032 {
00033     struct CopyFiles : CopyFilesT<CopyFiles, implementation::CopyFiles>
00034     {
00035     };
00036 }
Generated on Fri Nov 15 2024 22:18:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario8.h Source File

  • FileAccess
  • cppwinrt

Scenario8.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario8.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     /// <summary>
00020     /// Copying a file.
00021     /// </summary>
00022     struct Scenario8 : Scenario8T<Scenario8>
00023     {
00024         Scenario8();
00025
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00027         fire_and_forget CopyFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario8 : Scenario8T<Scenario8, implementation::Scenario8>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs Source File

  • TextSegmentation
  • cs

Scenario2_GetCurrentTextSegmentFromIndex.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using System;
00015 using System.Text;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class Scenario2_GetCurrentTextSegmentFromIndex
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public Scenario2_GetCurrentTextSegmentFromIndex()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// This is the click handler for the 'Word Segments' button.
00035         ///
00036         /// When this button is activated, the Text Segmentation API will calculate
00037         /// the word segment from the given input string and character index for that string,
00038         /// and return the WordSegment object that contains the index within its text bounds.
00039         /// Segment breaking behavior is based off of the language-tag input, which defines
00040         /// which language rules to use.
00041         ///
00042         /// </summary>
00043         /// <param name="sender">The object that raised the event.</param>
00044         /// <param name="e">Event data that describes the click action on the button.</param>
00045         private void WordSegmentButton_Click(object sender, RoutedEventArgs e)
00046         {
00047             // Initialize and obtain input values
00048             StringBuilder notifyText = new StringBuilder();
00049
00050             // Obtain the input string value, check for non-emptiness
00051             String inputStringText = inputStringBox.Text;
00052             if (String.IsNullOrEmpty(inputStringText))
00053             {
00054                 notifyText = new StringBuilder("Cannot compute word segments: input string is empty.");
00055                 rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00056                 return;
00057             }
00058
00059             // Obtain the language tag value, check for non-emptiness
00060             // Ex. Valid Values:
00061             //     "en-US" (English (United States))
00062             //     "fr-FR" (French (France))
00063             //     "de-DE" (German (Germany))
00064             //     "ja-JP" (Japanese (Japan))
00065             //     "ar-SA" (Arabic (Saudi Arabia))
00066             //     "zh-CN" (China (PRC))
00067             String languageTagText = languageTagBox.Text;
00068             if (String.IsNullOrEmpty(languageTagText))
00069             {
00070                 notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
00071                 languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
00072             }
00073             else
00074             {
00075                 if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
00076                 {
00077                     notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
00078                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00079                     return;
00080                 }
00081             }
00082
00083             // Obtain the input Index
00084             String inputIndexString = indexBox.Text;
00085             uint inputIndex = 0;
00086             if (String.IsNullOrEmpty(inputIndexString))
00087             {
00088                 notifyText.AppendLine("No input index provided ... using first segment reference (index = 0) as default.");
00089             }
00090             else
00091             {
00092                 try
00093                 {
00094                     inputIndex = Convert.ToUInt32(indexBox.Text);
00095                 }
00096                 catch (FormatException)
00097                 {
00098                     notifyText = new StringBuilder("Invalid index supplied.\n\nPlease check that this value is valid, and non-negative.");
00099                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00100                     return;
00101                 }
00102                 catch (OverflowException)
00103                 {
00104                     notifyText = new StringBuilder("Invalid index supplied: Negative-valued index.\n\nPlease check that this value is valid, and non-negative.");
00105                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00106                     return;
00107                 }
00108
00109                 if ((inputIndex < 0) || (inputIndex >= inputStringText.Length))
00110                 {
00111                     notifyText = new StringBuilder("Invalid index supplied ... cannot use a negative index, or an index that is out of bounds of the input string.\n\nPlease re-check the index value, and try again.");
00112                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00113                     return;
00114                 }
00115             }
00116
00117             // Notify that we are going to calculate word segment
00118             notifyText.AppendLine("\nFinding the word segment for the given index ...\n");
00119             notifyText.AppendLine("Input: \"" + inputStringText + "\"");
00120             notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
00121             notifyText.AppendLine("Index: " + inputIndex + "\n");
00122
00123             // Construct the WordsSegmenter instance
00124             var segmenter = new Windows.Data.Text.WordsSegmenter(languageTagText);
00125
00126             // Obtain the token segment
00127             var tokenSegment = segmenter.GetTokenAt(inputStringText, inputIndex);
00128             notifyText.AppendLine("Indexed segment: \"" + tokenSegment.Text + "\"");
00129
00130             // Set output box text to the contents of the StringBuilder instance
00131             rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
00132         }
00133
00134         /// <summary>
00135         /// This is the click handler for the 'Selection Segment' button.
00136         ///
00137         /// When this button is activated, the Text Segmentation API will calculate
00138         /// the selection segment from the given input string and character index for that string,
00139         /// and return the SelectableWordSegment object that contains the index within its text bounds.
00140         /// Segment breaking behavior is based off of the language-tag input, which defines
00141         /// which language rules to use.
00142         ///
00143         /// Selection segments differ from word segments in that they describe the bounds
00144         /// between active-selection snapping behavior.
00145         ///
00146         /// </summary>
00147         /// <param name="sender">The object that raised the event.</param>
00148         /// <param name="e">Event data that describes the click action on the button.</param>
00149         private void SelectionSegmentButton_Click(object sender, RoutedEventArgs e)
00150         {
00151             // Initialize and obtain input values
00152             StringBuilder notifyText = new StringBuilder();
00153
00154             // Obtain the input string value, check for non-emptiness
00155             String inputStringText = inputStringBox.Text;
00156             if (String.IsNullOrEmpty(inputStringText))
00157             {
00158                 notifyText = new StringBuilder("Cannot compute selection segments: input string is empty.");
00159                 rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00160                 return;
00161             }
00162
00163             // Obtain the language tag value, check for non-emptiness
00164             // Ex. Valid Values:
00165             //     "en-US" (English (United States))
00166             //     "fr-FR" (French (France))
00167             //     "de-DE" (German (Germany))
00168             //     "ja-JP" (Japanese (Japan))
00169             //     "ar-SA" (Arabic (Saudi Arabia))
00170             //     "zh-CN" (China (PRC))
00171             String languageTagText = languageTagBox.Text;
00172             if (String.IsNullOrEmpty(languageTagText))
00173             {
00174                 notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
00175                 languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
00176             }
00177             else
00178             {
00179                 if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
00180                 {
00181                     notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
00182                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00183                     return;
00184                 }
00185             }
00186
00187             // Obtain the input Index
00188             String inputIndexString = indexBox.Text;
00189             uint inputIndex = 0;
00190             if (String.IsNullOrEmpty(inputIndexString))
00191             {
00192                 notifyText.AppendLine("No input index provided ... using first segment reference (index = 0) as default.");
00193             }
00194             else
00195             {
00196                 try
00197                 {
00198                     inputIndex = Convert.ToUInt32(indexBox.Text);
00199                 }
00200                 catch (FormatException)
00201                 {
00202                     notifyText = new StringBuilder("Invalid index supplied.\n\nPlease check that this value is valid, and non-negative.");
00203                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00204                     return;
00205                 }
00206                 catch (OverflowException)
00207                 {
00208                     notifyText = new StringBuilder("Invalid index supplied: Negative-valued index.\n\nPlease check that this value is valid, and non-negative.");
00209                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00210                     return;
00211                 }
00212
00213                 if ((inputIndex < 0) || (inputIndex >= inputStringText.Length))
00214                 {
00215                     notifyText = new StringBuilder("Invalid index supplied ... cannot use a negative index, or an index that is out of bounds of the input string.\n\nPlease re-check the index value, and try again.");
00216                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00217                     return;
00218                 }
00219             }
00220
00221             // Notify that we are going to calculate selection segment
00222             notifyText.AppendLine("\nFinding the selection segment for the given index ...\n");
00223             notifyText.AppendLine("Input: \"" + inputStringText + "\"");
00224             notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
00225             notifyText.AppendLine("Index: " + inputIndex + "\n");
00226
00227             // Construct the SelectableWordsSegmenter instance
00228             var segmenter = new Windows.Data.Text.SelectableWordsSegmenter(languageTagText);
00229
00230             // Obtain the token segment
00231             var tokenSegment = segmenter.GetTokenAt(inputStringText, inputIndex);
00232             notifyText.AppendLine("Indexed segment: \"" + tokenSegment.Text + "\"");
00233
00234             // Set output box text to the contents of the StringBuilder instance
00235             rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
00236         }
00237     }
00238 }
Generated on Fri Nov 15 2024 22:21:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/Scenario2_Connector.xaml.cs Source File

  • WiFiDirect
  • cs

Scenario2_Connector.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.IO;
00016 using System.Linq;
00017 using System.Runtime.InteropServices.WindowsRuntime;
00018 using System.Threading.Tasks;
00019 using Windows.Devices.Enumeration;
00020 using Windows.Devices.WiFiDirect;
00021 using Windows.Networking;
00022 using Windows.Networking.Sockets;
00023 using Windows.Security.Cryptography;
00024 using Windows.Storage.Streams;
00025 using Windows.UI.Core;
00026 using Windows.UI.Xaml;
00027 using Windows.UI.Xaml.Controls;
00028 using Windows.UI.Xaml.Navigation;
00029
00030 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00031
00032 namespace SDKTemplate
00033 {
00034     /// <summary>
00035     /// An empty page that can be used on its own or navigated to within a Frame.
00036     /// </summary>
00037     public sealed partial class Scenario2_Connector : Page
00038     {
00039         private MainPage rootPage = MainPage.Current;
00040         DeviceWatcher _deviceWatcher = null;
00041         bool _fWatcherStarted = false;
00042         WiFiDirectAdvertisementPublisher _publisher = new WiFiDirectAdvertisementPublisher();
00043
00044         public ObservableCollection<DiscoveredDevice> DiscoveredDevices { get; } = new ObservableCollection<DiscoveredDevice>();
00045         public ObservableCollection<ConnectedDevice> ConnectedDevices { get; } = new ObservableCollection<ConnectedDevice>();
00046
00047         public Scenario2_Connector()
00048         {
00049             this.InitializeComponent();
00050         }
00051
00052         protected override void OnNavigatedFrom(NavigationEventArgs e)
00053         {
00054             if (_deviceWatcher != null)
00055             {
00056                 StopWatcher();
00057             }
00058         }
00059
00060         private void StopWatcher()
00061         {
00062             _deviceWatcher.Added -= OnDeviceAdded;
00063             _deviceWatcher.Removed -= OnDeviceRemoved;
00064             _deviceWatcher.Updated -= OnDeviceUpdated;
00065             _deviceWatcher.EnumerationCompleted -= OnEnumerationCompleted;
00066             _deviceWatcher.Stopped -= OnStopped;
00067
00068             _deviceWatcher.Stop();
00069
00070             _deviceWatcher = null;
00071         }
00072
00073         private void btnWatcher_Click(object sender, RoutedEventArgs e)
00074         {
00075             if (_deviceWatcher == null)
00076             {
00077                 _publisher.Start();
00078
00079                 if (_publisher.Status != WiFiDirectAdvertisementPublisherStatus.Started)
00080                 {
00081                     rootPage.NotifyUser("Failed to start advertisement.", NotifyType.ErrorMessage);
00082                     return;
00083                 }
00084
00085                 DiscoveredDevices.Clear();
00086                 rootPage.NotifyUser("Finding Devices...", NotifyType.StatusMessage);
00087
00088                 String deviceSelector = WiFiDirectDevice.GetDeviceSelector(
00089                     Utils.GetSelectedItemTag<WiFiDirectDeviceSelectorType>(cmbDeviceSelector));
00090
00091                 _deviceWatcher = DeviceInformation.CreateWatcher(deviceSelector, new string[] { "System.Devices.WiFiDirect.InformationElements" });
00092
00093                 _deviceWatcher.Added += OnDeviceAdded;
00094                 _deviceWatcher.Removed += OnDeviceRemoved;
00095                 _deviceWatcher.Updated += OnDeviceUpdated;
00096                 _deviceWatcher.EnumerationCompleted += OnEnumerationCompleted;
00097                 _deviceWatcher.Stopped += OnStopped;
00098
00099                 _deviceWatcher.Start();
00100
00101                 btnWatcher.Content = "Stop Watcher";
00102                 _fWatcherStarted = true;
00103             }
00104             else
00105             {
00106                 _publisher.Stop();
00107
00108                 btnWatcher.Content = "Start Watcher";
00109
00110                 StopWatcher();
00111
00112                 rootPage.NotifyUser("Device watcher stopped.", NotifyType.StatusMessage);
00113             }
00114         }
00115
00116         #region DeviceWatcherEvents
00117         private async void OnDeviceAdded(DeviceWatcher deviceWatcher, DeviceInformation deviceInfo)
00118         {
00119             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00120             {
00121                 DiscoveredDevices.Add(new DiscoveredDevice(deviceInfo));
00122             });
00123         }
00124
00125         private async void OnDeviceRemoved(DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
00126         {
00127             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00128             {
00129                 foreach (DiscoveredDevice discoveredDevice in DiscoveredDevices)
00130                 {
00131                     if (discoveredDevice.DeviceInfo.Id == deviceInfoUpdate.Id)
00132                     {
00133                         DiscoveredDevices.Remove(discoveredDevice);
00134                         break;
00135                     }
00136                 }
00137             });
00138         }
00139
00140         private async void OnDeviceUpdated(DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
00141         {
00142             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00143             {
00144                 foreach (DiscoveredDevice discoveredDevice in DiscoveredDevices)
00145                 {
00146                     if (discoveredDevice.DeviceInfo.Id == deviceInfoUpdate.Id)
00147                     {
00148                         discoveredDevice.UpdateDeviceInfo(deviceInfoUpdate);
00149                         break;
00150                     }
00151                 }
00152             });
00153         }
00154
00155         private void OnEnumerationCompleted(DeviceWatcher deviceWatcher, object o)
00156         {
00157             rootPage.NotifyUserFromBackground("DeviceWatcher enumeration completed", NotifyType.StatusMessage);
00158         }
00159
00160         private void OnStopped(DeviceWatcher deviceWatcher, object o)
00161         {
00162             rootPage.NotifyUserFromBackground("DeviceWatcher stopped", NotifyType.StatusMessage);
00163         }
00164         #endregion
00165
00166         private void btnIe_Click(object sender, RoutedEventArgs e)
00167         {
00168             var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;
00169
00170             IList<WiFiDirectInformationElement> informationElements = null;
00171             try
00172             {
00173                 informationElements = WiFiDirectInformationElement.CreateFromDeviceInformation(discoveredDevice.DeviceInfo);
00174             }
00175             catch (Exception ex)
00176             {
00177                 rootPage.NotifyUser("No Information element found: " + ex.Message, NotifyType.ErrorMessage);
00178             }
00179
00180             if (informationElements != null)
00181             {
00182                 StringWriter message = new StringWriter();
00183
00184                 foreach (WiFiDirectInformationElement informationElement in informationElements)
00185                 {
00186                     string ouiName = CryptographicBuffer.EncodeToHexString(informationElement.Oui);
00187                     string value = string.Empty;
00188                     Byte[] bOui = informationElement.Oui.ToArray();
00189
00190                     if (bOui.SequenceEqual(Globals.MsftOui))
00191                     {
00192                         // The format of Microsoft information elements is documented here:
00193                         // https://msdn.microsoft.com/en-us/library/dn392651.aspx
00194                         // with errata here:
00195                         // https://msdn.microsoft.com/en-us/library/mt242386.aspx
00196                         ouiName += " (Microsoft)";
00197                     }
00198                     else if (bOui.SequenceEqual(Globals.WfaOui))
00199                     {
00200                         ouiName += " (WFA)";
00201                     }
00202                     else if (bOui.SequenceEqual(Globals.CustomOui))
00203                     {
00204                         ouiName += " (Custom)";
00205
00206                         if (informationElement.OuiType == Globals.CustomOuiType)
00207                         {
00208                             DataReader dataReader = DataReader.FromBuffer(informationElement.Value);
00209                             dataReader.UnicodeEncoding = UnicodeEncoding.Utf8;
00210                             dataReader.ByteOrder = ByteOrder.LittleEndian;
00211
00212                             // Read the string.
00213                             try
00214                             {
00215                                 string data = dataReader.ReadString(dataReader.ReadUInt32());
00216                                 value = $"Data: {data}";
00217                             }
00218                             catch (Exception)
00219                             {
00220                                 value = "(Unable to parse)";
00221                             }
00222                         }
00223                     }
00224
00225                     message.WriteLine($"OUI {ouiName}, Type {informationElement.OuiType} {value}");
00226                 }
00227
00228                 message.Write($"Information elements found: {informationElements.Count}");
00229
00230                 rootPage.NotifyUser(message.ToString(), NotifyType.StatusMessage);
00231             }
00232         }
00233
00234         private async void btnFromId_Click(object sender, RoutedEventArgs e)
00235         {
00236             var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;
00237
00238             if (discoveredDevice == null)
00239             {
00240                 rootPage.NotifyUser("No device selected, please select one.", NotifyType.ErrorMessage);
00241                 return;
00242             }
00243
00244             rootPage.NotifyUser($"Connecting to {discoveredDevice.DeviceInfo.Name}...", NotifyType.StatusMessage);
00245
00246             if (!discoveredDevice.DeviceInfo.Pairing.IsPaired)
00247             {
00248                 if (!await connectionSettingsPanel.RequestPairDeviceAsync(discoveredDevice.DeviceInfo.Pairing))
00249                 {
00250                     return;
00251                 }
00252             }
00253
00254             WiFiDirectDevice wfdDevice = null;
00255             try
00256             {
00257                 // IMPORTANT: FromIdAsync needs to be called from the UI thread
00258                 wfdDevice = await WiFiDirectDevice.FromIdAsync(discoveredDevice.DeviceInfo.Id);
00259             }
00260             catch (TaskCanceledException)
00261             {
00262                 rootPage.NotifyUser("FromIdAsync was canceled by user", NotifyType.ErrorMessage);
00263                 return;
00264             }
00265
00266             // Register for the ConnectionStatusChanged event handler
00267             wfdDevice.ConnectionStatusChanged += OnConnectionStatusChanged;
00268
00269             IReadOnlyList<EndpointPair> endpointPairs = wfdDevice.GetConnectionEndpointPairs();
00270             HostName remoteHostName = endpointPairs[0].RemoteHostName;
00271
00272             rootPage.NotifyUser($"Devices connected on L2 layer, connecting to IP Address: {remoteHostName} Port: {Globals.strServerPort}",
00273                 NotifyType.StatusMessage);
00274
00275             // Wait for server to start listening on a socket
00276             await Task.Delay(2000);
00277
00278             // Connect to Advertiser on L4 layer
00279             StreamSocket clientSocket = new StreamSocket();
00280             try
00281 {
00282                 await clientSocket.ConnectAsync(remoteHostName, Globals.strServerPort);
00283                 rootPage.NotifyUser("Connected with remote side on L4 layer", NotifyType.StatusMessage);
00284             }
00285             catch (Exception ex)
00286             {
00287                 rootPage.NotifyUser($"Connect operation threw an exception: {ex.Message}", NotifyType.ErrorMessage);
00288                 return;
00289             }
00290
00291             SocketReaderWriter socketRW = new SocketReaderWriter(clientSocket, rootPage);
00292
00293             string sessionId = Path.GetRandomFileName();
00294             ConnectedDevice connectedDevice = new ConnectedDevice(sessionId, wfdDevice, socketRW);
00295             ConnectedDevices.Add(connectedDevice);
00296
00297             // The first message sent over the socket is the name of the connection.
00298             await socketRW.WriteMessageAsync(sessionId);
00299
00300             while (await socketRW.ReadMessageAsync() != null)
00301             {
00302                 // Keep reading messages
00303             }
00304         }
00305
00306         private void OnConnectionStatusChanged(WiFiDirectDevice sender, object arg)
00307         {
00308             rootPage.NotifyUserFromBackground($"Connection status changed: {sender.ConnectionStatus}", NotifyType.StatusMessage);
00309         }
00310
00311         private async void btnSendMessage_Click(object sender, RoutedEventArgs e)
00312         {
00313             var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
00314             await connectedDevice.SocketRW.WriteMessageAsync(txtSendMessage.Text);
00315         }
00316
00317         private void btnClose_Click(object sender, RoutedEventArgs e)
00318         {
00319             var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
00320             ConnectedDevices.Remove(connectedDevice);
00321
00322             // Close socket and WiFiDirect object
00323             connectedDevice.Dispose();
00324         }
00325
00326         private async void btnUnpair_Click(object sender, RoutedEventArgs e)
00327         {
00328             var discoveredDevice = (DiscoveredDevice)lvDiscoveredDevices.SelectedItem;
00329
00330             DeviceUnpairingResult result = await discoveredDevice.DeviceInfo.Pairing.UnpairAsync();
00331             rootPage.NotifyUser($"Unpair result: {result.Status}", NotifyType.StatusMessage);
00332         }
00333     }
00334 }
Generated on Fri Nov 15 2024 22:22:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemCacheManager.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario1

ItemCacheManager.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Diagnostics;
00004 using System.Threading;
00005 using System.Threading.Tasks;
00006 using Windows.Foundation;
00007 using Windows.UI.Xaml.Data;
00008
00009 namespace DataVirtualizationSample
00010 {
00011     // EventArgs class for the CacheChanged event
00012     public class CacheChangedEventArgs<T> : EventArgs
00013     {
00014         public T oldItem { get; set; }
00015         public T newItem { get; set; }
00016         public int itemIndex { get; set; }
00017     }
00018
00019     // Implements a relatively simple cache for items based on a set of ranges
00020     class ItemCacheManager<T>
00021     {
00022         // data structure to hold all the items that are in the ranges the cache manager is looking after
00023         private List<CacheEntryBlock<T>> cacheBlocks;
00024
00025         // List of ranges for items that are not present in the cache
00026         internal ItemIndexRangeList requests;
00027
00028         // list of ranges for items that are present in the cache
00029         private ItemIndexRangeList cachedResults;
00030         // Range of items that is currently being requested
00031         private ItemIndexRange requestInProgress;
00032         // Used to be able to cancel outstanding requests
00033         private CancellationTokenSource cancelTokenSource;
00034         // Callback that will be used to request data
00035         private fetchDataCallbackHandler fetchDataCallback;
00036         // Maximum number of items that can be fetched in one batch
00037         private int maxBatchFetchSize;
00038         // Timer to optimize the the fetching of data so we throttle requests if the list is still changing
00039         private Windows.UI.Xaml.DispatcherTimer timer;
00040
00041 #if DEBUG
00042         // Name for trace messages, and when debugging so you know which instance of the cache manager you are dealing with
00043         string debugName = string.Empty;
00044 #endif
00045         public ItemCacheManager(fetchDataCallbackHandler callback, int batchsize = 50, string debugName = "ItemCacheManager")
00046         {
00047             cacheBlocks = new List<CacheEntryBlock<T>>();
00048             requests = new ItemIndexRangeList();
00049             cachedResults = new ItemIndexRangeList();
00050             fetchDataCallback = callback;
00051             maxBatchFetchSize = batchsize;
00052             //set up a timer that is used to delay fetching data so that we can catch up if the list is scrolling fast
00053             timer = new Windows.UI.Xaml.DispatcherTimer();
00054             timer.Tick += (sender, args) =>
00055             {
00056                 fetchData();
00057             };
00058             timer.Interval = new TimeSpan(20 * 10000);
00059
00060 #if DEBUG
00061             this.debugName = debugName;
00062 #endif
00063 #if TRACE_DATASOURCE
00064             Debug.WriteLine(debugName + "* Cache initialized/reset");
00065 #endif
00066         }
00067
00068         public event TypedEventHandler<object, CacheChangedEventArgs<T>> CacheChanged;
00069
00070         /// <summary>
00071         /// Indexer for access to the item cache
00072         /// </summary>
00073         /// <param name="index">Item Index</param>
00074         /// <returns></returns>
00075         public T this[int index]
00076         {
00077             get
00078             {
00079                 // iterates through the cache blocks to find the item
00080                 foreach (CacheEntryBlock<T> block in cacheBlocks)
00081                 {
00082                     if (index >= block.FirstIndex && index <= block.lastIndex)
00083                     {
00084                         return block.Items[index - block.FirstIndex];
00085                     }
00086                 }
00087                 return default(T);
00088             }
00089             set
00090             {
00091                 // iterates through the cache blocks to find the right block
00092                 for (int i = 0; i < cacheBlocks.Count; i++)
00093                 {
00094                     CacheEntryBlock<T> block = cacheBlocks[i];
00095                     if (index >= block.FirstIndex && index <= block.lastIndex)
00096                     {
00097                         block.Items[index - block.FirstIndex] = value;
00098                         //register that we have the result in the cache
00099                         if (value != null) { cachedResults.Add((uint)index, 1); }
00100                         return;
00101                     }
00102                     // We have moved past the block where the item is supposed to live
00103                     if (block.FirstIndex > index)
00104                     {
00105                         AddOrExtendBlock(index, value, i);
00106                         return;
00107                     }
00108                 }
00109                 // No blocks exist, so creating a new block
00110                 AddOrExtendBlock(index, value, cacheBlocks.Count);
00111
00112             }
00113         }
00114
00115         // Extends an existing block if the item fits at the end, or creates a new block
00116         private void AddOrExtendBlock(int index, T value, int insertBeforeBlock)
00117         {
00118             if (insertBeforeBlock > 0)
00119             {
00120                 CacheEntryBlock<T> block = cacheBlocks[insertBeforeBlock - 1];
00121                 if (block.lastIndex == index - 1)
00122                 {
00123                     T[] newItems = new T[block.Length + 1];
00124                     Array.Copy(block.Items, newItems, (int)block.Length);
00125                     newItems[block.Length] = value;
00126                     block.Length++;
00127                     block.Items = newItems;
00128                     return;
00129                 }
00130             }
00131             CacheEntryBlock<T> newBlock = new CacheEntryBlock<T>() { FirstIndex = index, Length = 1, Items = new T[] { value } };
00132             cacheBlocks.Insert(insertBeforeBlock, newBlock);
00133         }
00134
00135
00136         /// <summary>
00137         /// Updates the desired item range of the cache, discarding items that are not needed, and figuring out which items need to be requested. It will then kick off a fetch if required.
00138         /// </summary>
00139         /// <param name="ranges">New set of ranges the cache should hold</param>
00140         public void UpdateRanges(ItemIndexRange[] ranges)
00141         {
00142             //Normalize ranges to get a unique set of discontinuous ranges
00143             ranges = NormalizeRanges(ranges);
00144
00145             // Fail fast if the ranges haven't changed
00146             if (!HasRangesChanged(ranges)) { return; }
00147
00148             //To make the cache update easier, we'll create a new set of CacheEntryBlocks
00149             List<CacheEntryBlock<T>> newCacheBlocks = new List<CacheEntryBlock<T>>();
00150             foreach (ItemIndexRange range in ranges)
00151             {
00152                 CacheEntryBlock<T> newBlock = new CacheEntryBlock<T>() { FirstIndex = range.FirstIndex, Length = range.Length, Items = new T[range.Length] };
00153                 newCacheBlocks.Add(newBlock);
00154             }
00155
00156 #if TRACE_DATASOURCE
00157             string s = "┌ " + debugName + ".UpdateRanges: ";
00158             foreach (ItemIndexRange range in ranges)
00159             {
00160                 s += range.FirstIndex + "->" + range.LastIndex + " ";
00161             }
00162             Debug.WriteLine(s);
00163 #endif
00164             //Copy over data to the new cache blocks from the old ones where there is overlap
00165             int lastTransferred = 0;
00166             for (int i = 0; i < ranges.Length; i++)
00167             {
00168                 CacheEntryBlock<T> newBlock = newCacheBlocks[i];
00169                 ItemIndexRange range = ranges[i];
00170                 int j = lastTransferred;
00171                 while (j < this.cacheBlocks.Count && this.cacheBlocks[j].FirstIndex <= ranges[i].LastIndex)
00172                 {
00173                     ItemIndexRange overlap, oldEntryRange;
00174                     ItemIndexRange[] added, removed;
00175                     CacheEntryBlock<T> oldBlock = this.cacheBlocks[j];
00176                     oldEntryRange = new ItemIndexRange(oldBlock.FirstIndex, oldBlock.Length);
00177                     bool hasOverlap = oldEntryRange.DiffRanges(range, out overlap, out removed, out added);
00178                     if (hasOverlap)
00179                     {
00180                         Array.Copy(oldBlock.Items, overlap.FirstIndex - oldBlock.FirstIndex, newBlock.Items, overlap.FirstIndex - range.FirstIndex, (int)overlap.Length);
00181 #if TRACE_DATASOURCE
00182                         Debug.WriteLine("│ Transfering cache items " + overlap.FirstIndex + "->" + overlap.LastIndex);
00183 #endif
00184                     }
00185                     j++;
00186                     if (ranges.Length > i + 1 && oldBlock.lastIndex < ranges[i + 1].FirstIndex) { lastTransferred = j; }
00187                 }
00188             }
00189             //swap over to the new cache
00190             this.cacheBlocks = newCacheBlocks;
00191
00192             //figure out what items need to be fetched because we don't have them in the cache
00193             this.requests = new ItemIndexRangeList(ranges);
00194             ItemIndexRangeList newCachedResults = new ItemIndexRangeList();
00195
00196             // Use the previous knowlege of what we have cached to form the new list
00197             foreach (ItemIndexRange range in ranges)
00198             {
00199                 foreach (ItemIndexRange cached in this.cachedResults)
00200                 {
00201                     ItemIndexRange overlap;
00202                     ItemIndexRange[] added, removed;
00203                     bool hasOverlap = cached.DiffRanges(range, out overlap, out removed, out added);
00204                     if (hasOverlap) { newCachedResults.Add(overlap); }
00205                 }
00206             }
00207             // remove the data we know we have cached from the results
00208             foreach (ItemIndexRange range in newCachedResults)
00209             {
00210                 this.requests.Subtract(range);
00211             }
00212             this.cachedResults = newCachedResults;
00213
00214             startFetchData();
00215
00216 #if TRACE_DATASOURCE
00217             s = "└ Pending requests: ";
00218             foreach (ItemIndexRange range in this.requests)
00219             {
00220                 s += range.FirstIndex + "->" + range.LastIndex + " ";
00221             }
00222             Debug.WriteLine(s);
00223 #endif
00224         }
00225
00226         // Compares the new ranges against the previous ones to see if they have changed
00227         private bool HasRangesChanged(ItemIndexRange[] ranges)
00228         {
00229             if (ranges.Length != cacheBlocks.Count)
00230             {
00231                 return true;
00232             }
00233             for (int i = 0; i < ranges.Length; i++)
00234             {
00235                 ItemIndexRange r = ranges[i];
00236                 CacheEntryBlock<T> block = this.cacheBlocks[i];
00237                 if (r.FirstIndex != block.FirstIndex || r.LastIndex != block.lastIndex)
00238                 {
00239                     return true;
00240                 }
00241             }
00242             return false;
00243         }
00244
00245         // Gets the first block of items that we don't have values for
00246         public ItemIndexRange GetFirstRequestBlock(int maxsize = 50)
00247         {
00248             if (this.requests.Count > 0)
00249             {
00250                 ItemIndexRange range = this.requests[0];
00251                 if (range.Length > 50) range = new ItemIndexRange(range.FirstIndex, 50);
00252                 return range;
00253             }
00254             return null;
00255         }
00256
00257
00258         // Throttling function for fetching data. Forces a wait of 20ms before making the request.
00259         // If another fetch is requested in that time, it will reset the timer, so we don't fetch data if the view is actively scrolling
00260         public void startFetchData()
00261         {
00262             // Verify if an active request is still needed
00263             if (this.requestInProgress != null)
00264             {
00265                 if (this.requests.Intersects(requestInProgress))
00266                 {
00267                     return;
00268                 }
00269                 else
00270                 {
00271                     //cancel the existing request
00272 #if TRACE_DATASOURCE
00273                     Debug.WriteLine("> " + debugName + " Cancelling request: " + requestInProgress.FirstIndex + "->" + requestInProgress.LastIndex);
00274 #endif
00275                     cancelTokenSource.Cancel();
00276                 }
00277             }
00278
00279             //Using a timer to delay fetching data by 20ms, if another range comes in that time, then the timer is reset.
00280             timer.Stop();
00281             timer.Start();
00282         }
00283
00284         public delegate Task<T[]> fetchDataCallbackHandler(ItemIndexRange range, CancellationToken ct);
00285
00286         // Called by the timer to make a request for data
00287         public async void fetchData()
00288         {
00289             //Stop the timer so we don't get fired again unless data is requested
00290             timer.Stop();
00291             if (this.requestInProgress != null)
00292             {
00293                 // Verify if an active request is still needed
00294                 if (this.requests.Intersects(requestInProgress))
00295                 {
00296                     return;
00297                 }
00298                 else
00299                 {
00300                     // Cancel the existing request
00301 #if TRACE_DATASOURCE
00302                     Debug.WriteLine(">" + debugName + " Cancelling request: " + requestInProgress.FirstIndex + "->" + requestInProgress.LastIndex);
00303 #endif
00304                     cancelTokenSource.Cancel();
00305                 }
00306             }
00307
00308             ItemIndexRange nextRequest = GetFirstRequestBlock(maxBatchFetchSize);
00309             if (nextRequest != null)
00310             {
00311                 cancelTokenSource = new CancellationTokenSource();
00312                 CancellationToken ct = cancelTokenSource.Token;
00313                 requestInProgress = nextRequest;
00314                 T[] data = null;
00315                 try
00316                 {
00317 #if TRACE_DATASOURCE
00318                     Debug.WriteLine(">" + debugName + " Fetching items " + nextRequest.FirstIndex + "->" + nextRequest.LastIndex);
00319 #endif
00320                     // Use the callback to get the data, passing in a cancellation token
00321                     data = await fetchDataCallback(nextRequest, ct);
00322
00323                     if (!ct.IsCancellationRequested)
00324                     {
00325 #if TRACE_DATASOURCE
00326                         Debug.WriteLine(">" + debugName + " Inserting items into cache at: " + nextRequest.FirstIndex + "->" + (nextRequest.FirstIndex + data.Length - 1));
00327 #endif
00328                         for (int i = 0; i < data.Length; i++)
00329                         {
00330                             int cacheIndex = (int)(nextRequest.FirstIndex + i);
00331
00332                             T oldItem = this[cacheIndex];
00333                             T newItem = data[i];
00334
00335                             if (!newItem.Equals(oldItem))
00336                             {
00337                                 this[cacheIndex] = newItem;
00338
00339                                 // Fire CacheChanged so that the datasource can fire its INCC event, and do other work based on the item having data
00340                                 if (CacheChanged != null)
00341                                 {
00342                                     CacheChanged(this, new CacheChangedEventArgs<T>() { oldItem = oldItem, newItem = newItem, itemIndex = cacheIndex });
00343                                 }
00344                             }
00345                         }
00346                         requests.Subtract(new ItemIndexRange(nextRequest.FirstIndex, (uint)data.Length));
00347                     }
00348                 }
00349                 // Try/Catch is needed as cancellation is via an exception
00350                 catch (OperationCanceledException) { }
00351                 finally
00352                 {
00353                     requestInProgress = null;
00354                     // Start another request if required
00355                     fetchData();
00356                 }
00357             }
00358         }
00359
00360
00361         /// <summary>
00362         /// Merges a set of ranges to form a new set of non-contiguous ranges
00363         /// </summary>
00364         /// <param name="ranges">The list of ranges to merge</param>
00365         /// <returns>A smaller set of merged ranges</returns>
00366         private ItemIndexRange[] NormalizeRanges(ItemIndexRange[] ranges)
00367         {
00368             List<ItemIndexRange> results = new List<ItemIndexRange>();
00369             foreach (ItemIndexRange range in ranges)
00370             {
00371                 bool handled = false;
00372                 for (int i = 0; i < results.Count; i++)
00373                 {
00374                     ItemIndexRange existing = results[i];
00375                     if (range.ContiguousOrOverlaps(existing))
00376                     {
00377                         results[i] = existing.Combine(range);
00378                         handled = true;
00379                         break;
00380                     }
00381                     else if (range.FirstIndex < existing.FirstIndex)
00382                     {
00383                         results.Insert(i, range);
00384                         handled = true;
00385                         break;
00386                     }
00387                 }
00388                 if (!handled) { results.Add(range); }
00389             }
00390             return results.ToArray();
00391         }
00392
00393
00394         // Sees if the value is in our cache if so it returns the index
00395         public int IndexOf(T value)
00396         {
00397             foreach (CacheEntryBlock<T> entry in cacheBlocks)
00398             {
00399                 int index = Array.IndexOf<T>(entry.Items, value);
00400                 if (index != -1) return index + entry.FirstIndex;
00401             }
00402             return -1;
00403         }
00404
00405         // Type for the cache blocks
00406         class CacheEntryBlock<ITEMTYPE>
00407         {
00408             public int FirstIndex;
00409             public uint Length;
00410             public ITEMTYPE[] Items;
00411
00412             public int lastIndex { get { return FirstIndex + (int)Length - 1; } }
00413         }
00414     }
00415 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario5.xaml.cpp Source File

  • StreamSocket
  • cpp

Scenario5.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario5.xaml.cpp
00014 // Implementation of the Scenario5 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario5.xaml.h"
00019
00020 using namespace SDKTemplate;
00021 using namespace SDKTemplate::StreamSocketSample;
00022
00023 using namespace Concurrency;
00024 using namespace Platform;
00025 using namespace Windows::ApplicationModel::Core;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Foundation::Collections;
00028 using namespace Windows::Globalization::DateTimeFormatting;
00029 using namespace Windows::Networking;
00030 using namespace Windows::Networking::Sockets;
00031 using namespace Windows::Networking::Connectivity;
00032 using namespace Windows::Security::Cryptography::Certificates;
00033 using namespace Windows::UI::Popups;
00034 using namespace Windows::UI::Xaml;
00035 using namespace Windows::UI::Xaml::Controls;
00036 using namespace Windows::UI::Xaml::Navigation;
00037
00038 Scenario5::Scenario5()
00039 {
00040     InitializeComponent();
00041 }
00042
00043 /// <summary>
00044 /// Invoked when this page is about to be displayed in a Frame.
00045 /// </summary>
00046 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00047 /// property is typically used to configure the page.</param>
00048 void Scenario5::OnNavigatedTo(NavigationEventArgs^ e)
00049 {
00050     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00051     // as NotifyUser()
00052     rootPage = MainPage::Current;
00053 }
00054
00055
00056 void Scenario5::ConnectSocket_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00057 {
00058     // By default 'HostNameForConnect' is disabled and host name validation is not required. When enabling the
00059     // text box validating the host name is required since it was received from an untrusted source (user input).
00060     // The host name is validated by catching InvalidArgumentExceptions thrown by the HostName constructor for
00061     // invalid input.
00062     if (ServiceNameForConnect->Text == nullptr)
00063     {
00064         rootPage->NotifyUser("Please provide a service name.", NotifyType::ErrorMessage);
00065         return;
00066     }
00067
00068     HostName^ hostName;
00069     try
00070     {
00071         hostName = ref new HostName(HostNameForConnect->Text);
00072     }
00073     catch (InvalidArgumentException^ e)
00074     {
00075         rootPage->NotifyUser("Error: Invalid host name.", NotifyType::ErrorMessage);
00076         return;
00077     }
00078
00079     ConnectSocketWithRetry(hostName, ServiceNameForConnect->Text);
00080 }
00081
00082 void Scenario5::ConnectSocketWithRetry(HostName^ hostName, String^ serviceName)
00083 {
00084     StreamSocket^ socket = ref new StreamSocket();
00085     rootPage->NotifyUser("Connecting to: " + HostNameForConnect->Text, NotifyType::StatusMessage);
00086
00087     // If necessary, tweak the socket's control options before carrying out the connect operation.
00088     // Refer to the StreamSocketControl class' MSDN documentation for the full list of control options.
00089     socket->Control->ClientCertificate = nullptr;
00090
00091     // Establish a secure connection to the server (by default, the local IIS server).
00092     create_task(socket->ConnectAsync(hostName, serviceName, SocketProtectionLevel::Tls12)).then(
00093         [this, socket, hostName, serviceName] (task<void> previousTask) -> task<void>
00094     {
00095         try
00096         {
00097             // Try getting all exceptions from the continuation chain above this point.
00098             previousTask.get();
00099             return create_task([]{});
00100         }
00101         catch (Exception^ exception)
00102         {
00103             // If the exception was caused by an SSL error that is ignorable we are going to prompt the user
00104             // with an enumeration of the errors and ask for permission to ignore.
00105             if (socket->Information->ServerCertificateErrorSeverity == SocketSslErrorSeverity::Ignorable &&
00106                 socket->Information->ServerCertificateErrors->Size > 0)
00107             {
00108                 return create_task(
00109                     ShouldIgnoreCertificateErrorsAsync(socket->Information->ServerCertificateErrors)).then(
00110                         [this, socket, hostName, serviceName] (bool userAcceptedRetry)
00111                 {
00112                     if (userAcceptedRetry)
00113                     {
00114                         // Retry the connection, ignoring SSL certificate errors
00115                         return ConnectSocketWithRetryHandleSslErrorAsync(socket, hostName, serviceName);
00116                     }
00117
00118                     cancel_current_task();
00119                 });
00120             }
00121
00122             // Handle all other exceptions in the last continuation
00123             throw;
00124         }
00125     }).then([this, socket](task<void> previousTask)
00126     {
00127         try
00128         {
00129             // Try getting all exceptions from the continuation chain above this point.
00130             previousTask.get();
00131
00132             String^ certInformation = GetCertificateInformation(
00133                 socket->Information->ServerCertificate,
00134                 socket->Information->ServerIntermediateCertificates);
00135
00136             rootPage->NotifyUser(
00137                 "Connected to server. Certificate information: \r\n" + certInformation,
00138                 NotifyType::StatusMessage);
00139         }
00140         catch (const task_canceled&)
00141         {
00142             rootPage->NotifyUser("Connection aborted by user.", NotifyType::ErrorMessage);
00143         }
00144         catch (Exception^ exception)
00145         {
00146             if (SocketError::GetStatus(exception->HResult) == SocketErrorStatus::Unknown)
00147             {
00148                 throw;
00149             }
00150
00151             rootPage->NotifyUser("Connect failed with error: " + exception->Message, NotifyType::ErrorMessage);
00152         }
00153
00154         delete socket;
00155     });
00156 }
00157
00158 task<void> Scenario5::ConnectSocketWithRetryHandleSslErrorAsync(
00159     StreamSocket^ socket,
00160     HostName^ hostName,
00161     String^ serviceName)
00162 {
00163     // -----------------------------------------------------------------------------------------------
00164     // WARNING: Only test applications should ignore SSL errors.
00165     // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle attacks.
00166     // -----------------------------------------------------------------------------------------------
00167     socket->Control->IgnorableServerCertificateErrors->Clear();
00168     std::for_each(
00169         begin(socket->Information->ServerCertificateErrors),
00170         end(socket->Information->ServerCertificateErrors),
00171         [socket] (ChainValidationResult ignorableError)
00172         {
00173             socket->Control->IgnorableServerCertificateErrors->Append(ignorableError);
00174         });
00175
00176     rootPage->NotifyUser("Retrying connection", NotifyType::StatusMessage);
00177     return create_task(socket->ConnectAsync(hostName, serviceName, SocketProtectionLevel::Tls12));
00178 }
00179
00180 task<bool> Scenario5::ShouldIgnoreCertificateErrorsAsync(IVectorView<ChainValidationResult>^ serverCertificateErrors)
00181 {
00182     String^ connectionErrors = serverCertificateErrors->GetAt(0).ToString();
00183
00184     std::for_each(
00185         begin(serverCertificateErrors) + 1,
00186         end(serverCertificateErrors),
00187         [&connectionErrors] (ChainValidationResult ignorableError)
00188     {
00189         connectionErrors += ", " + ignorableError.ToString();
00190     });
00191
00192     String^ dialogMessage =
00193         "The remote server certificate validation failed with the following errors: " +
00194         connectionErrors + "\r\nSecurity certificate problems may" +
00195         " indicate an attempt to fool you or intercept any data you send to the server.";
00196
00197     MessageDialog^ dialog = ref new MessageDialog(dialogMessage, "Server Certificate Validation Errors");
00198
00199     dialog->Commands->Append(
00200         ref new UICommand("Continue (not recommended)", nullptr, PropertyValue::CreateInt32(continueButtonId)));
00201     dialog->Commands->Append(ref new UICommand("Cancel", nullptr, PropertyValue::CreateInt32(abortButtonId)));
00202     dialog->DefaultCommandIndex = 1;
00203     dialog->CancelCommandIndex = 1;
00204
00205     return create_task(dialog->ShowAsync()).then([] (IUICommand^ selected) -> bool
00206     {
00207         auto selectedId = dynamic_cast<IPropertyValue^>(selected->Id);
00208         return selectedId && (selectedId->GetInt32() == continueButtonId);
00209     });
00210 }
00211
00212 String^ Scenario5::GetCertificateInformation(
00213     Certificate^ serverCert,
00214     IVectorView<Certificate^>^ intermediateCertificates)
00215 {
00216     String^ stringBuilder = "";
00217     stringBuilder += "\tFriendly Name: " + serverCert->FriendlyName + "\r\n";
00218     stringBuilder += "\tSubject: " + serverCert->Subject + "\r\n";
00219     stringBuilder += "\tIssuer: " + serverCert->Issuer + "\r\n";
00220
00221     auto dateFormatter = ref new DateTimeFormatter("longdate");
00222
00223     stringBuilder += "\tValidity: " + dateFormatter->Format(serverCert->ValidFrom) + " - " +
00224         dateFormatter->Format(serverCert->ValidTo) + "\r\n";
00225
00226     // Enumerate the entire certificate chain.
00227     if (intermediateCertificates->Size > 0)
00228     {
00229         stringBuilder += "\tCertificate chain: \r\n";
00230
00231         std::for_each(begin(intermediateCertificates), end(intermediateCertificates), [&stringBuilder](Certificate^ cert)
00232         {
00233             stringBuilder += "\t\tIntermediate Certificate Subject: " + cert->Subject + "\r\n";
00234         });
00235     }
00236     else
00237     {
00238         stringBuilder += "\tNo certificates within the intermediate chain.";
00239     }
00240
00241     return stringBuilder;
00242 }
Generated on Fri Nov 15 2024 22:18:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4PageRange Member List

This is the complete list of members for Scenario4PageRange, including all inherited members.
OnNavigatedFrom(NavigationEventArgs e) | Scenario4PageRange | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4PageRange | [inline, protected]
OnPrintButtonClick(object sender, RoutedEventArgs e) | Scenario4PageRange | [inline, private]
printHelper | Scenario4PageRange | [private]
Scenario4PageRange() | Scenario4PageRange | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
abortButtonId | sealed | [private, static]
adapter | sealed | [private]
BindToAny_Checked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
BindToAny_Unchecked(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
CloseSockets_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ConnectSocket_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ConnectSocket_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ConnectSocketWithRetry(Windows::Networking::HostName^hostName, Platform::String^serviceName) | sealed | [private]
ConnectSocketWithRetryHandleSslErrorAsync(Windows::Networking::Sockets::StreamSocket^socket, Windows::Networking::HostName^hostName, Platform::String^serviceName) | sealed | [private]
continueButtonId | sealed | [private, static]
GetCertificateInformation(Windows::Security::Cryptography::Certificates::Certificate^serverCert, Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::Certificate^>^intermediateCertificates) | sealed | [private]
listener | sealed | [private]
ListenerContext(MainPage^rootPage, Windows::Networking::Sockets::StreamSocketListener^listener) | sealed |
localHost | sealed |
LocalHostItem(Windows::Networking::HostName^localHostName) | sealed |
localHostItems | sealed | [private]
NotifyUserFromAsyncThread(Platform::String^message, NotifyType type) | sealed | [private]
OnConnection(Windows::Networking::Sockets::StreamSocketListener^listener, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^object) | sealed |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
PopulateAdapterList() | sealed | [private]
ReceiveStringLoop(Windows::Storage::Streams::DataReader^reader, Windows::Networking::Sockets::StreamSocket^socket) | sealed | [private]
rootPage | sealed | [private]
Scenario1() | sealed |
Scenario2() | sealed |
Scenario3() | sealed |
Scenario4() | sealed |
Scenario5() | sealed |
SendHello_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ShouldIgnoreCertificateErrorsAsync(Windows::Foundation::Collections::IVectorView< Windows::Security::Cryptography::Certificates::ChainValidationResult >^serverCertificateErrors) | sealed | [private]
StartListener_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
~ListenerContext() | sealed | [private]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario09_GetCookie.h Source File

  • HttpClient
  • cppwinrt

Scenario09_GetCookie.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario09_GetCookie.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario09_GetCookie : Scenario09_GetCookieT<Scenario09_GetCookie>
00020     {
00021         Scenario09_GetCookie();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         void GetCookies_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         fire_and_forget SendHttpGetButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void Cancel_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032         Windows::Web::Http::HttpClient httpClient{ nullptr };
00033         Windows::Foundation::IAsyncAction pendingAction{ nullptr };
00034
00035         Windows::Foundation::IAsyncAction CancelableRequestAsync(Windows::Foundation::Uri resourceUri);
00036     };
00037 }
00038
00039 namespace winrt::SDKTemplate::factory_implementation
00040 {
00041     struct Scenario09_GetCookie : Scenario09_GetCookieT<Scenario09_GetCookie, implementation::Scenario09_GetCookie>
00042     {
00043     };
00044 }
Generated on Fri Nov 15 2024 22:19:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/Scenario1_Save.xaml.h Source File

  • PasswordVault
  • cpp

Scenario1_Save.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Save.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_Save sealed
00021     {
00022     public:
00023         Scenario1_Save();
00024
00025     internal:
00026         void SaveCredential_Click(Platform::Object^, Platform::Object^);
00027
00028     private:
00029         MainPage^ rootPage = MainPage::Current;
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Events Member List

This is the complete list of members for Scenario4_Events, including all inherited members.
ErrorReceivedEvent(SerialDevice sender, ErrorReceivedEventArgs eventArgs) | Scenario4_Events | [inline, private]
ErrorReceivedEventHandler | Scenario4_Events | [private]
ErrorReceivedToggleSwitch_Toggled(object sender, RoutedEventArgs e) | Scenario4_Events | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | Scenario4_Events | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario4_Events | [inline, protected]
PinChangedEvent(SerialDevice sender, PinChangedEventArgs eventArgs) | Scenario4_Events | [inline, private]
PinChangedEventHandler | Scenario4_Events | [private]
PinChangedToggleSwitch_Toggled(object sender, RoutedEventArgs e) | Scenario4_Events | [inline, private]
rootPage | Scenario4_Events | [private]
Scenario4_Events() | Scenario4_Events | [inline]
Generated on Fri Nov 15 2024 22:23:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/pch.h Source File

  • BackgroundSensors
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/Tasks/CompletionGroupTask.h Source File

  • BackgroundTransfer
  • cpp
  • Tasks

CompletionGroupTask.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace Tasks
00015 {
00016     [Windows::Foundation::Metadata::WebHostHidden]
00017     public ref class CompletionGroupTask sealed : public Windows::ApplicationModel::Background::IBackgroundTask
00018     {
00019     public:
00020         CompletionGroupTask();
00021         virtual void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
00022
00023         static Windows::Networking::BackgroundTransfer::BackgroundTransferGroup^ CreateTransferGroup();
00024         static Windows::Networking::BackgroundTransfer::BackgroundDownloader^ CreateBackgroundDownloader();
00025
00026     private:
00027         bool IsFailed(Windows::Networking::BackgroundTransfer::DownloadOperation^ download);
00028         Concurrency::task<void> RetryDownloadsAsync(
00029             Windows::Foundation::Collections::IVector<Windows::Networking::BackgroundTransfer::DownloadOperation^>^ downloads);
00030         void InvokeSimpleToast(int succeeded, int failed);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ToolCarousel Member List

This is the complete list of members for ToolCarousel, including all inherited members.
ArrangeTools(std::vector< std::shared_ptr< Tool >> &tools, size_t selectedIndex, double baseAngle=0.0) | ToolCarousel |
IsRotating() const | ToolCarousel | [inline]
m_center | ToolCarousel | [private]
m_isRotating | ToolCarousel | [private]
m_radius | ToolCarousel | [private]
m_rotationAxis | ToolCarousel | [private]
m_rotationDirection | ToolCarousel | [private]
m_rotationStart | ToolCarousel | [private]
SetPosition(Windows::Foundation::Numerics::float3 center, Windows::Foundation::Numerics::float3 radius, Windows::Foundation::Numerics::float3 rotationAxis) | ToolCarousel |
StartRotation(RotationDirection rotationDirection, const DX::StepTimer &timer) | ToolCarousel |
Update(std::vector< std::shared_ptr< Tool >> &tools, size_t &selectedIndex, const DX::StepTimer &timer) | ToolCarousel |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlayReadyInfoViewModel Member List

This is the complete list of members for PlayReadyInfoViewModel, including all inherited members.
hasHardwareDRM | PlayReadyInfoViewModel | [private]
HasHardwareDRM | PlayReadyInfoViewModel |
hasHEVCSupport | PlayReadyInfoViewModel | [private]
HasHEVCSupport | PlayReadyInfoViewModel |
Log(string message) | ViewModelBase | [inline, static]
OutputLog | ViewModelBase |
PlaybackEnabled | ViewModelBase |
playReadySecurityVersion | PlayReadyInfoViewModel | [private]
PlayReadySecurityVersion | PlayReadyInfoViewModel |
PropertyChanged | ViewModelBase |
ProtectionManager | ViewModelBase |
RaisePropertyChanged([CallerMemberName] string propertyName="") | ViewModelBase | [inline, protected]
RefreshStatics() | PlayReadyInfoViewModel | [inline]
SecurityLevel | PlayReadyInfoViewModel |
securityLevel | PlayReadyInfoViewModel | [private]
SetPlaybackEnabled(bool enabled) | ViewModelBase | [inline]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CameraStreamCoordinateMapperMain Member List

This is the complete list of members for CameraStreamCoordinateMapperMain, including all inherited members.
CameraStreamCoordinateMapperMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | CameraStreamCoordinateMapperMain |
CreateResourcesAsync() | CameraStreamCoordinateMapperMain |
CreateWindowSizeDependentResources() | CameraStreamCoordinateMapperMain |
m_camera | CameraStreamCoordinateMapperMain | [private]
m_cameraCoordinateMapper | CameraStreamCoordinateMapperMain | [private]
m_deviceResources | CameraStreamCoordinateMapperMain | [private]
m_freeRoamCameraEnabled | CameraStreamCoordinateMapperMain | [private]
m_gpuPerformanceTimer | CameraStreamCoordinateMapperMain | [private]
m_helpTextRenderer | CameraStreamCoordinateMapperMain | [private]
m_quadRenderer | CameraStreamCoordinateMapperMain | [private]
m_readyToRender | CameraStreamCoordinateMapperMain | [private]
m_showHelpText | CameraStreamCoordinateMapperMain | [private]
m_statisticsTextRenderer | CameraStreamCoordinateMapperMain | [private]
m_streamingEnabled | CameraStreamCoordinateMapperMain | [private]
m_timer | CameraStreamCoordinateMapperMain | [private]
OnDeviceLost() | CameraStreamCoordinateMapperMain | [virtual]
OnDeviceRestored() | CameraStreamCoordinateMapperMain | [virtual]
OnResuming() | CameraStreamCoordinateMapperMain |
OnSuspendingAsync() | CameraStreamCoordinateMapperMain |
Render() | CameraStreamCoordinateMapperMain |
Update() | CameraStreamCoordinateMapperMain |
~CameraStreamCoordinateMapperMain() | CameraStreamCoordinateMapperMain |
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/Project.idl Source File

  • MultipleViews
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [Windows.UI.Xaml.Data.Bindable]
00015     runtimeclass SizePreferenceString
00016     {
00017             String Title{ get; };
00018             Windows.UI.ViewManagement.ViewSizePreference Preference{ get; };
00019     }
00020
00021     [default_interface]
00022     runtimeclass Scenario1 : Windows.UI.Xaml.Controls.Page
00023     {
00024         Scenario1();
00025     }
00026
00027     [default_interface]
00028     runtimeclass Scenario3 : Windows.UI.Xaml.Controls.Page
00029     {
00030         Scenario3();
00031     }
00032
00033     [default_interface]
00034     runtimeclass SecondaryViewPage : Windows.UI.Xaml.Controls.Page
00035     {
00036         SecondaryViewPage();
00037
00038         void SwitchAndAnimate(Int32 fromViewId);
00039         void HandleProtocolLaunch(Windows.Foundation.Uri uri);
00040     }
00041
00042     [Windows.UI.Xaml.Data.Bindable]
00043     runtimeclass ViewLifetimeControl : Windows.UI.Xaml.Data.INotifyPropertyChanged
00044     {
00045         static ViewLifetimeControl CreateForCurrentView();
00046         Windows.UI.Core.CoreDispatcher Dispatcher{ get; };
00047         Int32 Id{ get; };
00048         String Title;
00049         Int32 StartViewInUse();
00050         Int32 StopViewInUse();
00051
00052         // A custom event that fires whenever the secondary view is ready to be closed. You should
00053         // clean up any state (including deregistering for events) then close the window in this handler
00054         event Windows.Foundation.TypedEventHandler<ViewLifetimeControl, Object> Released;
00055     }
00056 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/ActivitySensorBackgroundTask.cs Source File

  • ActivitySensor
  • cs
  • Tasks

ActivitySensorBackgroundTask.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Devices.Sensors;
00016 using Windows.Storage;
00017
00018 namespace Tasks
00019 {
00020     public sealed class ActivitySensorBackgroundTask : IBackgroundTask
00021     {
00022         /// <summary>
00023         /// The entry point of a background task.
00024         /// </summary>
00025         /// <param name="taskInstance">The current background task instance.</param>
00026         public void Run(IBackgroundTaskInstance taskInstance)
00027         {
00028             Debug.WriteLine("Background " + taskInstance.Task.Name + " Starting...");
00029
00030             // Associate a cancellation handler with the background task.
00031             // Even though this task isn't performing much work, it can still be cancelled.
00032             taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
00033
00034             // Read the activity reports
00035             ActivitySensorTriggerDetails triggerDetails = taskInstance.TriggerDetails as ActivitySensorTriggerDetails;
00036             var reports = triggerDetails.ReadReports();
00037
00038             var settings = ApplicationData.Current.LocalSettings;
00039             settings.Values["ReportCount"] = reports.Count;
00040             if (reports.Count > 0)
00041             {
00042                 var lastReading = reports[reports.Count - 1].Reading;
00043                 settings.Values["LastActivity"] = lastReading.Activity.ToString();
00044                 settings.Values["LastConfidence"] = lastReading.Confidence.ToString();
00045                 settings.Values["LastTimestamp"] = lastReading.Timestamp.ToString("u");
00046             }
00047             else
00048             {
00049                 settings.Values["LastActivity"] = "No data";
00050                 settings.Values["LastConfidence"] = "No data";
00051                 settings.Values["LastTimestamp"] = "No data";
00052             }
00053
00054             settings.Values["TaskStatus"] = "Completed at " + DateTime.Now.ToString("u");
00055
00056             // No deferral is held on taskInstance because we are returning immediately.
00057         }
00058
00059         /// <summary>
00060         /// Handles background task cancellation.
00061         /// </summary>
00062         /// <param name="sender">The background task instance being cancelled.</param>
00063         /// <param name="reason">The cancellation reason.</param>
00064         private void OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
00065         {
00066             var settings = ApplicationData.Current.LocalSettings;
00067             Debug.WriteLine("Background " + sender.Task.Name + " Cancel Requested...");
00068             settings.Values["TaskStatus"] = reason.ToString() + " at " + DateTime.Now.ToString("u");
00069         }
00070     }
00071 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceList Member List

This is the complete list of members for DeviceList, including all inherited members.
_Current | DeviceList | [private, static]
ClearSelectedDevice() | DeviceList | [inline]
ClearSelectedDevice() | DeviceList | [inline]
CreateBooleanTable(Windows::UI::Xaml::Documents::InlineCollection^Table, const Platform::Array< bool >^NewValues, const Platform::Array< bool >^OldValues, Platform::String^IndexTitle, Platform::String^ValueTitle, Platform::String^TrueValue, Platform::String^FalseValue) | DeviceList | [static]
CreateBooleanTable(InlineCollection Table, bool[] NewValues, bool[] OldValues, string IndexTitle, string ValueTitle, string TrueValue, string FalseValue) | DeviceList | [inline, static]
Current | DeviceList | [static]
DeviceClosing | DeviceList |
DeviceClosing | DeviceList |
DeviceList() | DeviceList | [private]
DeviceList() | DeviceList | [inline, private, static]
FindDevice(Platform::String^Id) | DeviceList | [private]
FindInList(string id) | DeviceList | [inline, private]
Fx2Devices | DeviceList |
GetSelectedDevice() | DeviceList | [inline]
GetSelectedDevice() | DeviceList | [inline]
GetSelectedDeviceId() | DeviceList | [inline]
GetSelectedDeviceId() | DeviceList | [inline]
InitDeviceWatcher() | DeviceList | [private]
InitDeviceWatcher() | DeviceList | [inline, private]
m_Fx2Device | DeviceList | [private]
m_Fx2Device | DeviceList | [private]
m_Fx2DeviceId | DeviceList | [private]
m_Fx2DeviceId | DeviceList | [private]
m_Fx2Devices | DeviceList | [private]
m_Fx2Watcher | DeviceList | [private]
m_Fx2Watcher | DeviceList | [private]
m_List | DeviceList | [private]
m_WatcherStarted | DeviceList | [private]
m_WatcherSuspended | DeviceList | [private]
OnFx2Added(Windows::Devices::Enumeration::DeviceWatcher^Sender, Windows::Devices::Enumeration::DeviceInformation^DevInformation) | DeviceList | [private]
OnFx2Added(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformation devInterface) | DeviceList | [inline, private]
OnFx2EnumerationComplete(Windows::Devices::Enumeration::DeviceWatcher^Sender, Object^Args) | DeviceList | [private]
OnFx2EnumerationComplete(Windows.Devices.Enumeration.DeviceWatcher sender, object args) | DeviceList | [inline, private]
OnFx2Removed(Windows::Devices::Enumeration::DeviceWatcher^Sender, Windows::Devices::Enumeration::DeviceInformationUpdate^DevInformation) | DeviceList | [private]
OnFx2Removed(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformationUpdate devInformation) | DeviceList | [inline, private]
ResumeDeviceWatcher(Object^Sender, Object^Args) | DeviceList | [private]
ResumeDeviceWatcher(object sender, object e) | DeviceList | [inline, private]
SetSelectedDevice(Platform::String^id, Windows::Devices::Custom::CustomDevice^device) | DeviceList | [inline]
SetSelectedDevice(string Id, CustomDevice Device) | DeviceList | [inline]
StartFx2Watcher() | DeviceList |
StartFx2Watcher() | DeviceList | [inline]
StopFx2Watcher() | DeviceList |
StopFx2Watcher() | DeviceList | [inline]
SuspendDeviceWatcher(Object^Sender, Windows::ApplicationModel::SuspendingEventArgs^Args) | DeviceList | [private]
SuspendDeviceWatcher(object sender, SuspendingEventArgs e) | DeviceList | [inline, private]
WatcherStarted | DeviceList |
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8 Member List

This is the complete list of members for Scenario8, including all inherited members.
AddItemForLanguageTag(string languageTag) | Scenario8 | [inline, private]
addToResultGrid(OfflineMapPackage package) | Scenario8 | [inline, private]
canDownload(OfflineMapPackage package) | Scenario8 | [inline, private, static]
circleCenter | Scenario8 | [private]
circleStrokeThickness | Scenario8 | [private]
CopyFileButton_Click(object sender, RoutedEventArgs e) | Scenario8 | [inline, private]
coreWetStrokeUpdateSource | Scenario8 | [private]
CoreWetStrokeUpdateSource_WetStrokeCanceled(CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
CoreWetStrokeUpdateSource_WetStrokeCompleted(CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
CoreWetStrokeUpdateSource_WetStrokeContinuing(CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
CoreWetStrokeUpdateSource_WetStrokeStarting(CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
CoreWetStrokeUpdateSource_WetStrokeStopping(CoreWetStrokeUpdateSource sender, CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
disableFollowCircle | Scenario8 | [private]
discontinueStroke | Scenario8 | [private]
DistanceFromCenter(Point position) | Scenario8 | [inline, private]
findAtCenterButton_Click(object sender, RoutedEventArgs e) | Scenario8 | [inline, private]
followCircle | Scenario8 | [private]
FollowCircleTest(CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
GetAppLanguagesAsFormattedString() | Scenario8 | [inline, private]
HandleFollowCircleInput(CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
HandleRegularInput(CoreWetStrokeUpdateEventArgs args) | Scenario8 | [inline, private]
InCircleEdgeZone(double distanceFromCenter) | Scenario8 | [inline, private]
InkStackPanel_Loaded(object sender, RoutedEventArgs e) | Scenario8 | [inline, private]
LanguageOverrideCombo_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario8 | [inline, private]
lastSelectedIndex | Scenario8 | [private]
myMap_Loaded(object sender, RoutedEventArgs e) | Scenario8 | [inline, private]
nearestMegabyte(ulong bytes) | Scenario8 | [inline, private, static]
OnNavigatedTo(NavigationEventArgs e) | Scenario8 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario8 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario8 | [inline, protected]
penSize | Scenario8 | [private]
PopulateComboBox() | Scenario8 | [inline, private]
radius | Scenario8 | [private]
rootPage | Scenario8 | [private]
Scenario8() | Scenario8 | [inline]
Scenario8() | Scenario8 | [inline]
Scenario8() | Scenario8 | [inline]
Scenario8() | Scenario8 | [inline]
ShowText() | Scenario8 | [inline, private]
UpdateCurrentAppLanguageMessage() | Scenario8 | [inline, private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_XmlWriterLite Member List

This is the complete list of members for Scenario3_XmlWriterLite, including all inherited members.
DoSomething_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_XmlWriterLite |
ReadAndWrite(com_ptr< IStream > const &readStream, com_ptr< IStream > const &writeStream) | Scenario3_XmlWriterLite | [private]
Scenario3_XmlWriterLite() | Scenario3_XmlWriterLite |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.cpp Source File

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/AllJoynHelpers.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

AllJoynHelpers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 // The amount of time to wait (ms) for a response after sending a message before timing out.
00024 const int c_MessageTimeoutInMilliseconds = 10000;
00025
00026 // The maximum length of an AllJoyn type signature allowed by the AllJoyn Core library.
00027 const int c_MaximumSignatureLength = 255;
00028
00029 #define RETURN_IF_QSTATUS_ERROR(status) \
00030 {   \
00031 int32 alljoynStatus = static_cast<int32>(status);    \
00032 if (Windows::Devices::AllJoyn::AllJoynStatus::Ok != alljoynStatus)  \
00033 {   \
00034     return status;   \
00035 }   \
00036 }
00037
00038 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00039
00040 public interface class ISignalEmitter
00041 {
00042     property Windows::Devices::AllJoyn::AllJoynBusObject^ BusObject
00043     {
00044         Windows::Devices::AllJoyn::AllJoynBusObject^ get();
00045     }
00046
00047     property Windows::Devices::AllJoyn::AllJoynSession^ Session
00048     {
00049         Windows::Devices::AllJoyn::AllJoynSession^ get();
00050     }
00051 };
00052
00053 } } } }
00054
00055 class AllJoynHelpers
00056 {
00057 public:
00058     // The Windows::Devices::AllJoyn::AllJoynBusAttachment class wraps the alljoyn_busattachment type.  This
00059     // function gets the underlying alljoyn_busattachment.
00060     static alljoyn_busattachment GetInternalBusAttachment(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00061
00062     // The Windows::Devices::AllJoyn::AllJoynBusObject class wraps the alljoyn_busobject type.  This
00063     // function gets the underlying alljoyn_busobject.
00064     static alljoyn_busobject AllJoynHelpers::GetInternalBusObject(_In_ Windows::Devices::AllJoyn::AllJoynBusObject^ busObject);
00065
00066     // Create the alljoyn_interfacedescriptions described in introspectionXml and add them to the busAttachment.
00067     static QStatus CreateInterfaces(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment, _In_ PCSTR introspectionXml);
00068
00069     // Convert a UTF8 string to a wide character Platform::String.
00070     static Platform::String^ MultibyteToPlatformString(_In_ PCSTR);
00071
00072     // Convert a wide character Platform::String to a UTF8 string.
00073     static std::vector<char> PlatformToMultibyteString(_In_ Platform::String^ str);
00074
00075     // Get the service object path from an objectDescriptionArg.  The objectDescriptionArg should
00076     // come from an Announce signal.
00077     static Platform::String^ GetObjectPath(_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName);
00078
00079     // Determine whether the supplied set of AuthenticationMechanisms is sufficient for securing an AllJoyn connection.
00080     static bool CanSecure(_In_ Windows::Foundation::Collections::IVector<Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism>^ authenticationMechanisms);
00081
00082     // Callback for alljoyn_proxybusobject_listener_propertieschanged_ptr.
00083     // This callback expects the context to be of type T, which must implement the OnPropertyChanged function.
00084     template<class T>
00085     static void AJ_CALL PropertyChangedHandler(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated, _In_ void* context)
00086     {
00087         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00088         caller->OnPropertyChanged(obj, interfaceName, changed, invalidated);
00089     }
00090
00091     // Callback for alljoyn_busobject_prop_get_ptr.
00092     template<class T>
00093     static QStatus AJ_CALL PropertyGetHandler(_In_ const void* context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
00094     {
00095         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00096         return caller->OnPropertyGet(interfaceName, propertyName, value);
00097     }
00098
00099     // Callback for alljoyn_busobject_prop_set_ptr.
00100     template<class T>
00101     static QStatus AJ_CALL PropertySetHandler(_In_ const void* context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value)
00102     {
00103         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00104         return caller->OnPropertySet(interfaceName, propertyName, value);
00105     }
00106
00107     // Callback for alljoyn_sessionlistener_sessionlost_ptr.
00108     template<class T>
00109     static void AJ_CALL SessionLostHandler(_In_ const void* context, _In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
00110     {
00111         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00112         caller->OnSessionLost(sessionId, reason);
00113     }
00114
00115     // Callback for alljoyn_sessionlistener_sessionmemberadded_ptr.
00116     template<class T>
00117     static void AJ_CALL SessionMemberAddedHandler(_In_ const void* context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
00118     {
00119         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00120         caller->OnSessionMemberAdded(sessionId, uniqueName);
00121     }
00122
00123     // Callback for alljoyn_sessionlistener_sessionmemberremoved_ptr.
00124     template<class T>
00125     static void AJ_CALL SessionMemberRemovedHandler(_In_ const void* context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
00126     {
00127         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00128         caller->OnSessionMemberRemoved(sessionId, uniqueName);
00129     }
00130
00131     // Create an AllJoyn bus object.
00132     template<class T>
00133     static QStatus CreateBusObject(_Inout_ Platform::WeakReference* target)
00134     {
00135         alljoyn_busobject_callbacks callbacks =
00136         {
00137             PropertyGetHandler<T>,
00138             PropertySetHandler<T>,
00139             nullptr,
00140             nullptr,
00141         };
00142
00143         T^ caller = target->Resolve<T>();
00144
00145         auto serviceObjectPath = PlatformToMultibyteString(caller->ServiceObjectPath);
00146         alljoyn_busobject busObject = alljoyn_busobject_create(serviceObjectPath.data(), false, &callbacks, target);
00147         if (busObject == nullptr)
00148         {
00149             return ER_FAIL;
00150         }
00151
00152         caller->BusObject = busObject;
00153
00154         return ER_OK;
00155     }
00156
00157     // Callback for alljoyn_sessionportlistener_acceptsessionjoiner_ptr.
00158     // This callback expects the context to be of type T, which must implement the OnAcceptSessionJoiner function.
00159     template<class T>
00160     static QCC_BOOL AJ_CALL AcceptSessionJoinerHandler(
00161         _In_ const void* context,
00162         _In_ alljoyn_sessionport sessionPort,
00163         _In_ PCSTR joiner,
00164         _In_ const alljoyn_sessionopts opts)
00165     {
00166         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00167         return caller->OnAcceptSessionJoiner(sessionPort, joiner, opts);
00168     }
00169
00170     // Callback for alljoyn_sessionportlistener_sessionjoined_ptr.
00171     // This callback expects the context to be of type T, which must implement the OnSessionJoined function.
00172     template<class T>
00173     static void AJ_CALL SessionJoinedHandler(
00174         _In_ const void* context,
00175         _In_ alljoyn_sessionport sessionPort,
00176         _In_ alljoyn_sessionid id,
00177         _In_ PCSTR joiner)
00178     {
00179         T^ caller = static_cast<const Platform::WeakReference*>(context)->Resolve<T>();
00180         caller->OnSessionJoined(sessionPort, id, joiner);
00181     }
00182
00183     // Create the session for an AllJoyn producer.
00184     template<class T>
00185     static QStatus CreateProducerSession(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment, _Inout_ Platform::WeakReference* target)
00186     {
00187         alljoyn_sessionopts opts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, true, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY);
00188
00189         alljoyn_sessionportlistener_callbacks callbacks =
00190         {
00191             AcceptSessionJoinerHandler<T>,
00192             SessionJoinedHandler<T>
00193         };
00194
00195         T^ producer = target->Resolve<T>();
00196         producer->SessionPortListener = alljoyn_sessionportlistener_create(&callbacks, target);
00197
00198         alljoyn_sessionport sessionPort = 42;
00199         alljoyn_busattachment_unbindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), sessionPort);
00200         RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_bindsessionport(AllJoynHelpers::GetInternalBusAttachment(busAttachment), &sessionPort, opts, producer->SessionPortListener));
00201         producer->SessionPort = sessionPort;
00202
00203         alljoyn_sessionopts_destroy(opts);
00204
00205         return ER_OK;
00206     }
00207 };
00208
00209 // Passed to property get callbacks to allow them to report when the async operation is completed.
00210 template<class T>
00211 class PropertyGetContext
00212 {
00213 public:
00214     void SetEvent()
00215     {
00216         m_event.set();
00217     }
00218
00219     void Wait()
00220     {
00221         m_event.wait();
00222     }
00223
00224     QStatus GetStatus()
00225     {
00226         return m_status;
00227     }
00228
00229     void SetStatus(QStatus value)
00230     {
00231         m_status = value;
00232     }
00233
00234     T GetValue()
00235     {
00236         return m_value;
00237     }
00238
00239     void SetValue(T value)
00240     {
00241         m_value = value;
00242     }
00243
00244 private:
00245     Concurrency::event m_event;
00246     QStatus m_status;
00247     T m_value;
00248 };
00249
00250 // Passed to property set callbacks to allow them to report when the async operation is completed.
00251 class PropertySetContext
00252 {
00253 public:
00254     void SetEvent()
00255     {
00256         m_event.set();
00257     }
00258
00259     void Wait()
00260     {
00261         m_event.wait();
00262     }
00263
00264     QStatus GetStatus()
00265     {
00266         return m_status;
00267     }
00268
00269     void SetStatus(QStatus value)
00270     {
00271         m_status = value;
00272     }
00273
00274 private:
00275     Concurrency::event m_event;
00276     QStatus m_status;
00277 };
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OtherBindings Member List

This is the complete list of members for OtherBindings, including all inherited members.
_DPOnPage | OtherBindings | [private, static]
CSharpModel | OtherBindings |
DPOnPage | OtherBindings |
DPOnPageName | OtherBindings | [private]
DPOnPageProperty | OtherBindings | [static]
InitializeValues() | OtherBindings | [inline, private]
Model | OtherBindings |
MyInt | OtherBindings |
NullEmployee | OtherBindings |
NullStringProperty | OtherBindings |
OtherBindings() | OtherBindings | [inline]
ResetValuesClick(object sender, RoutedEventArgs e) | OtherBindings | [inline, private]
UndeferElementClick(object sender, RoutedEventArgs e) | OtherBindings | [inline, private]
UpdateValuesClick(object sender, RoutedEventArgs e) | OtherBindings | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/Scenario3.xaml.cpp Source File

  • Projection
  • cpp

Scenario3.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3.xaml.h"
00014 #include "MainPage.xaml.h"
00015 #include "ProjectionViewPage.xaml.h"
00016 #include "ViewLifetimeControl.h"
00017
00018 using namespace SDKSample;
00019
00020 using namespace Concurrency;
00021 using namespace Platform;
00022 using namespace SDKSample::SecondaryViewsHelpers;
00023 using namespace Windows::ApplicationModel::Core;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::ViewManagement;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Interop;
00029 using namespace Windows::Devices::Enumeration;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033
00034 Scenario3::Scenario3()
00035 {
00036     InitializeComponent();
00037     thisViewId = ApplicationView::GetForCurrentView()->Id;
00038 }
00039
00040 void Scenario3::StartProjecting(DeviceInformation^ selectedDevice)
00041 {
00042     auto prerequisite = task<void>([]() {});
00043     // If projection is already in progress, then it could be shown on the monitor again
00044     // Otherwise, we need to create a new view to show the presentation
00045     if (MainPage::Current->ProjectionViewPageControl == nullptr)
00046     {
00047         // First, create a new, blank view
00048         auto mainDispatcher = Window::Current->Dispatcher;
00049         int mainViewId = thisViewId;
00050         prerequisite = create_task(CoreApplication::CreateNewView()->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([mainViewId, mainDispatcher]()
00051         {
00052             // ViewLifetimeControl is a wrapper to make sure the view is closed only
00053             // when the app is done with it
00054             MainPage::Current->ProjectionViewPageControl = ViewLifetimeControl::CreateForCurrentView();
00055
00056             // Assemble some data necessary for the new page
00057             auto initData = ref new ProjectionViewPageInitializationData();
00058             initData->MainDispatcher = mainDispatcher;
00059             initData->ProjectionViewPageControl = MainPage::Current->ProjectionViewPageControl;
00060             initData->MainViewId = mainViewId;
00061
00062             // Display the page in the view. Note that the view will not become visible
00063             // until "StartProjectingAsync" is called
00064             auto rootFrame = ref new Windows::UI::Xaml::Controls::Frame();
00065             rootFrame->Navigate(TypeName(ProjectionViewPage::typeid), initData);
00066             Window::Current->Content = rootFrame;
00067
00068             // The call to Window.Current.Activate is required starting in Windos 10.
00069             // Without it, the view will never appear.
00070             Window::Current->Activate();
00071         })));
00072     }
00073
00074     prerequisite.then([this, selectedDevice]()
00075     {
00076         try
00077         {
00078             // Start/StopViewInUse are used to signal that the app is interacting with the
00079             // view, so it shouldn't be closed yet, even if the user loses access to it
00080             MainPage::Current->ProjectionViewPageControl->StartViewInUse();
00081             // Show the view on a second display (if available) or on the primary display
00082             create_task(ProjectionManager::StartProjectingAsync(
00083                 MainPage::Current->ProjectionViewPageControl->Id,
00084                 thisViewId,
00085                 selectedDevice
00086                 )).then([]() {
00087                 MainPage::Current->ProjectionViewPageControl->StopViewInUse();
00088             });
00089         }
00090         catch (ObjectDisposedException^)
00091         {
00092             // The projection view is being disposed
00093             MainPage::Current->NotifyUser("The projection view is being disposed", NotifyType::ErrorMessage);
00094         }
00095     });
00096 }
00097
00098
00099
00100 void Scenario3::LoadAndDisplayScreens_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00101 {
00102     try
00103     {
00104         // Use the device selector query of the ProjectionManager to list wired/wireless displays
00105         String^ projectorSelectorQuery = ProjectionManager::GetDeviceSelector();
00106
00107         findAndProject_button->IsEnabled = false;
00108
00109         // Clear the list box
00110         displayList_listview->Items->Clear();
00111         displayList_listview->Visibility = Windows::UI::Xaml::Visibility::Visible;
00112
00113         MainPage::Current->NotifyUser("Searching for devices...", NotifyType::StatusMessage);
00114
00115         // Calling the device API to find devices based on the device query
00116         create_task(DeviceInformation::FindAllAsync(
00117             projectorSelectorQuery
00118             )).then([=](DeviceInformationCollection^ outputDevices) {
00119
00120             for (unsigned int i = 0; i < outputDevices->Size; i++)
00121             {
00122                 DeviceInformation^ device = outputDevices->GetAt(i);
00123                 DeviceInformationViewTemplate^ deviceInfoTemplate = ref new DeviceInformationViewTemplate();
00124                 deviceInfoTemplate->Name = device->Name;
00125                 deviceInfoTemplate->Id = device->Id;
00126                 displayList_listview->Items->InsertAt(i, deviceInfoTemplate);
00127             }
00128
00129             findAndProject_button->IsEnabled = true;
00130             MainPage::Current->NotifyUser("Found devices are now listed.", SDKSample::NotifyType::StatusMessage);
00131         });
00132     }
00133     catch (Exception^)
00134     {
00135         MainPage::Current->NotifyUser("An error occured when querying and listing devices.", SDKSample::NotifyType::ErrorMessage);
00136     }
00137 }
00138
00139
00140 void Scenario3::displayList_listview_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00141 {
00142     try
00143     {
00144         // Get the DeviceInformation object of selected ListView item
00145         ListView^ devicesList = safe_cast<ListView^>(sender);
00146         DeviceInformationViewTemplate^ selectedDeviceInfoViewTemplate = safe_cast<DeviceInformationViewTemplate^>(devicesList->SelectedItem);
00147
00148         if (selectedDeviceInfoViewTemplate != nullptr)
00149         {
00150             create_task(DeviceInformation::CreateFromIdAsync(selectedDeviceInfoViewTemplate->Id)).then([=](DeviceInformation^ selectedDevice) {
00151                 // Start projecting to the selected display
00152                 StartProjecting(selectedDevice);
00153
00154             displayList_listview->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00155             });
00156         }
00157
00158     }
00159     catch (Exception^)
00160     {
00161         MainPage::Current->NotifyUser("An error occured when starting projecting.", SDKSample::NotifyType::ErrorMessage);
00162     }
00163 }
Generated on Fri Nov 15 2024 22:18:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario5_SendData.xaml.h Source File

  • WiFiDirectServices
  • cpp

Scenario5_SendData.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_SendData.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     namespace WiFiDirectServices
00019     {
00020         /// <summary>
00021         /// UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services
00022         /// This sample just demonstrates setting up the connection and sending strings
00023         /// A real application would likely open pre-determined ports for application communication
00024         ///
00025         /// Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.h/cpp and WiFiDirectServicesWrappers.h/cpp
00026         /// </summary>
00027         [Windows::Foundation::Metadata::WebHostHidden]
00028         public ref class Scenario5 sealed
00029         {
00030         public:
00031             Scenario5();
00032
00033             void AddSocket(SocketWrapper^ socket);
00034
00035             void RemoveSocket(unsigned int index);
00036
00037         protected:
00038             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00039
00040             virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00041
00042         private:
00043             SDKTemplate::MainPage^ _rootPage;
00044             std::mutex _mutex;
00045             SessionWrapper^ _session = nullptr;
00046
00047             void AddPort_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048
00049             void DoSend_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00050         };
00051     }
00052 }
Generated on Fri Nov 15 2024 22:22:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/Content/SpatialInputHandler.h Source File

  • BasicHologram
  • cpp
  • Content

SpatialInputHandler.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace BasicHologram
00004 {
00005     // Sample gesture handler.
00006     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00007     class SpatialInputHandler
00008     {
00009     public:
00010         SpatialInputHandler();
00011         ~SpatialInputHandler();
00012
00013         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ CheckForInput();
00014
00015     private:
00016         // Interaction event handler.
00017         void OnSourcePressed(
00018             Windows::UI::Input::Spatial::SpatialInteractionManager^ sender,
00019             Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args);
00020
00021         // API objects used to process gesture input, and generate gesture events.
00022         Windows::UI::Input::Spatial::SpatialInteractionManager^     m_interactionManager;
00023
00024         // Event registration token.
00025         Windows::Foundation::EventRegistrationToken                 m_sourcePressedEventToken;
00026
00027         // Used to indicate that a Pressed input event was received this frame.
00028         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ m_sourceState = nullptr;
00029     };
00030 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario1_UTF8.xaml.h Source File

  • WebSocket
  • cpp

Scenario1_UTF8.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.h
00014 // Declaration of the Scenario1 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_UTF8.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1 sealed
00030     {
00031     public:
00032         Scenario1();
00033
00034     protected:
00035         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         void OnConnect();
00038         void OnSend();
00039         void OnDisconnect();
00040
00041     private:
00042         MainPage^ rootPage = MainPage::Current;
00043         Windows::Networking::Sockets::MessageWebSocket^ messageWebSocket;
00044         Windows::Storage::Streams::DataWriter^ messageWriter;
00045         bool busy = false;
00046
00047         void UpdateVisualState();
00048         void SetBusy(bool value);
00049         Concurrency::task<void> ConnectAsync();
00050         Concurrency::task<void> SendAsync();
00051         void OnServerCustomValidationRequested(
00052             Windows::Networking::Sockets::MessageWebSocket^ sender,
00053             Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^ args);
00054         void MessageReceived(Windows::Networking::Sockets::MessageWebSocket^ sender, Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs^ args);
00055         void OnClosed(Windows::Networking::Sockets::IWebSocket^ sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^ args);
00056         void CloseSocket();
00057         void AppendOutputLine(Platform::String^ value);
00058     };
00059 }
Generated on Fri Nov 15 2024 22:22:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Project.idl Source File

  • Capabilities
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Check : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Check();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_RequestMany : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_RequestMany();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/SampleConfiguration.cs Source File

  • FileAccess
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using Windows.Security.Cryptography;
00016 using Windows.Storage;
00017 using Windows.Storage.Streams;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public partial class MainPage : Page
00023     {
00024         public const string FEATURE_NAME = "File access C# sample";
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title = "Creating a file",                                      ClassType = typeof(SDKTemplate.Scenario1)  },
00029             new Scenario() { Title = "Getting a file's parent folder",                       ClassType = typeof(SDKTemplate.Scenario2)  },
00030             new Scenario() { Title = "Writing and reading text in a file",                   ClassType = typeof(SDKTemplate.Scenario3)  },
00031             new Scenario() { Title = "Writing and reading bytes in a file",                  ClassType = typeof(SDKTemplate.Scenario4)  },
00032             new Scenario() { Title = "Writing and reading using a stream",                   ClassType = typeof(SDKTemplate.Scenario5)  },
00033             new Scenario() { Title = "Displaying file properties",                           ClassType = typeof(SDKTemplate.Scenario6)  },
00034             new Scenario() { Title = "Persisting access to a storage item for future use",   ClassType = typeof(SDKTemplate.Scenario7)  },
00035             new Scenario() { Title = "Copying a file",                                       ClassType = typeof(SDKTemplate.Scenario8)  },
00036             new Scenario() { Title = "Comparing two files to see if they are the same file", ClassType = typeof(SDKTemplate.Scenario9)  },
00037             new Scenario() { Title = "Deleting a file",                                      ClassType = typeof(SDKTemplate.Scenario10) },
00038             new Scenario() { Title = "Attempting to get a file with no error on failure",    ClassType = typeof(SDKTemplate.Scenario11) },
00039         };
00040
00041         public const string filename = "sample.dat";
00042         public StorageFile sampleFile = null;
00043         public string mruToken = null;
00044         public string falToken = null;
00045         public const int E_NO_UNICODE_TRANSLATION = unchecked((int)0x80070459);
00046
00047         /// <summary>
00048         /// Checks if sample file already exists, if it does assign it to sampleFile
00049         /// </summary>
00050         internal async void ValidateFile()
00051         {
00052             StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
00053             sampleFile = (await picturesLibrary.TryGetItemAsync(filename)) as StorageFile;
00054             if (sampleFile == null)
00055             {
00056                 // If file doesn't exist, indicate users to use scenario 1
00057                 NotifyUserFileNotExist();
00058             }
00059         }
00060
00061         internal void NotifyUserFileNotExist()
00062         {
00063             NotifyUser(String.Format("The file '{0}' does not exist. Use scenario one to create this file.", filename), NotifyType.ErrorMessage);
00064         }
00065
00066         static internal IBuffer GetBufferFromString(string str)
00067         {
00068             if (String.IsNullOrEmpty(str))
00069             {
00070                 return new Windows.Storage.Streams.Buffer(0);
00071             }
00072             else
00073             {
00074                 return CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8);
00075             }
00076         }
00077
00078         static internal string GetStringFromBuffer(IBuffer buffer)
00079         {
00080             // Throws E_NO_UNICODE_TRANSLATION if the buffer is not properly encoded.
00081             return CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, buffer);
00082         }
00083     }
00084
00085     public class Scenario
00086     {
00087         public string Title { get; set; }
00088         public Type ClassType { get; set; }
00089     }
00090 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario1_CachedNetworks.xaml.h Source File

  • WiFiScan
  • cpp

Scenario1_CachedNetworks.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_CachedNetworks.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "DisplayHelpers.h"
00017
00018 namespace SDKTemplate
00019 {
00020     namespace WiFiScan
00021     {
00022         /// <summary>
00023         /// An empty page that can be used on its own or navigated to within a Frame.
00024         /// </summary>
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         [Windows::UI::Xaml::Data::Bindable]
00027         public ref class Scenario1_CachedNetworks sealed
00028         {
00029         public:
00030             Scenario1_CachedNetworks();
00031
00032             property Windows::Foundation::Collections::IObservableVector<WiFiNetworkDisplay^>^ ResultCollection;
00033
00034         protected:
00035             void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         private:
00038             void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039             void DisplayNetworkReport(Windows::Devices::WiFi::WiFiNetworkReport^ report, Windows::Devices::WiFi::WiFiAdapter^ adapter);
00040
00041             MainPage^ _rootPage;
00042             Windows::Foundation::Collections::IVectorView<Windows::Devices::WiFi::WiFiAdapter^>^ _wiFiAdapters;
00043         };
00044     }
00045 }
Generated on Fri Nov 15 2024 22:22:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
_canExecuteCallback | sealed | [private]
_executeCallback | sealed | [private]
AddTrip() | sealed | [private]
addTripCommand | sealed | [private]
BoolToVisibilityConverter() | sealed |
CalendarConverter() | sealed |
CanExecute(Platform::Object^parameter) | sealed | [virtual]
CanExecuteChanged | sealed |
commandMode | sealed |
Convert(Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language) | sealed | [virtual]
Convert(Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language) | sealed | [virtual]
ConvertBack(Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language) | sealed | [virtual]
ConvertBack(Platform::Object^value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^parameter, Platform::String^language) | sealed | [virtual]
defaultViewModel | sealed | [private]
defaultViewModel | sealed | [private]
DeleteTrip() | sealed | [private]
deleteTripCommand | sealed | [private]
destination | sealed |
destinationValidationError | sealed | [private]
Execute(Platform::Object^parameter) | sealed | [virtual]
executeCallback | sealed |
modelSet | sealed |
NewTrip() | sealed |
NotifyPropertyChanged(Platform::String^propertyName) | ViewModelBase | [protected]
OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs^e) override | sealed | [protected, virtual]
OnBackRequested(Platform::Object^sender, Windows::UI::Core::BackRequestedEventArgs^e) | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigated(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationEventArgs^e) | sealed | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed |
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
PropertyChanged | ViewModelBase |
RaiseCanExecuteChanged() | sealed |
SaveTrip() | sealed | [private]
saveTripCommand | sealed | [private]
selectedTrip | sealed | [private]
SelectionChanged() | sealed |
SemanticInterpretation(Platform::String^tag, Windows::Media::SpeechRecognition::SpeechRecognitionResult^result) | sealed | [private]
setDestinationValidation(Platform::String^value) | sealed | [private]
setShowDelete(bool value) | sealed | [private]
setShowDestinationValidation(bool value) | sealed | [private]
showDelete | sealed | [private]
showDestinationValidation | sealed | [private]
ShowTrip(AdventureWorks_Shared::Trip^trip) | sealed |
store | sealed | [private]
textSpoken | sealed |
trip | sealed | [private]
TripDetails() | sealed |
tripListBox_SelectionChanged(Platform::Object^sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^args) | sealed |
TripListView() | sealed |
TripListViewModel(AdventureWorks_Shared::TripStore^store) | sealed |
trips | sealed | [private]
tripsLoaded | sealed | [private]
TripViewModel(AdventureWorks_Shared::TripStore^store) | sealed |
TripVoiceCommand(Platform::String^voiceCommandName, Platform::String^commandMode, Platform::String^textSpoken, Platform::String^destination) | sealed |
UpdateDestinationPhraseList() | sealed |
ViewModelLocator() | sealed |
~RelayCommand() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaEditing/cpp/Scenario1_TrimAndSaveClip.xaml.h Source File

  • MediaEditing
  • cpp

Scenario1_TrimAndSaveClip.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_TrimAndSaveClip.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_TrimAndSaveClip sealed
00024     {
00025     public:
00026         Scenario1_TrimAndSaveClip();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031
00032     private:
00033         SDKTemplate::MainPage^ rootPage;
00034         Windows::Media::Core::MediaStreamSource^ mediaStreamSource;
00035         Windows::Storage::AccessCache::StorageItemAccessList^ storageItemAccessList;
00036         Windows::Media::Editing::MediaComposition^ composition;
00037         Windows::Storage::StorageFile^ pickedFile;
00038
00039         void ChooseFile_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void TrimClip_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void Save_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void EnableButtons(bool isEnabled);
00043     };
00044 }
Generated on Fri Nov 15 2024 22:20:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_EnableHdrProfile Member List

This is the complete list of members for Scenario3_EnableHdrProfile, including all inherited members.
CheckHdrSupportBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_EnableHdrProfile | [inline, private]
GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel panel) | Scenario3_EnableHdrProfile | [inline]
LogStatus(string message, NotifyType type) | Scenario3_EnableHdrProfile | [inline, private]
LogStatusToOutputBox(string message) | Scenario3_EnableHdrProfile | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_EnableHdrProfile | [inline, protected]
rootPage | Scenario3_EnableHdrProfile | [private]
Scenario3_EnableHdrProfile() | Scenario3_EnableHdrProfile | [inline]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.h Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_SampleOverview.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_SampleOverview.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario_SampleOverview sealed
00020     {
00021     public:
00022         Scenario_SampleOverview();
00023     };
00024 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario2_ShakeEvents.xaml.cpp Source File

  • Accelerometer
  • cpp

Scenario2_ShakeEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_ShakeEvents.xaml.cpp
00014 // Implementation of the Scenario2_ShakeEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_ShakeEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Sensors;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 Scenario2_ShakeEvents::Scenario2_ShakeEvents()
00031 {
00032     InitializeComponent();
00033 }
00034
00035 void Scenario2_ShakeEvents::OnNavigatedTo(NavigationEventArgs^ e)
00036 {
00037     accelerometer = Accelerometer::GetDefault(rootPage->AccelerometerReadingType);
00038     if (accelerometer != nullptr)
00039     {
00040         rootPage->NotifyUser(rootPage->AccelerometerReadingType.ToString() + " accelerometer ready", NotifyType::StatusMessage);
00041         ScenarioEnableButton->IsEnabled = true;
00042     }
00043     else
00044     {
00045         rootPage->NotifyUser(rootPage->AccelerometerReadingType.ToString() + " accelerometer not found", NotifyType::ErrorMessage);
00046     }
00047 }
00048
00049 void Scenario2_ShakeEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00050 {
00051     if (ScenarioDisableButton->IsEnabled)
00052     {
00053         ScenarioDisable();
00054     }
00055 }
00056
00057 /// <summary>
00058 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00059 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00060 /// </summary>
00061 /// <param name="sender"></param>
00062 /// <param name="e">
00063 /// Event data that can be examined for the current visibility state.
00064 /// </param>
00065 void Scenario2_ShakeEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00066 {
00067     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00068     if (ScenarioDisableButton->IsEnabled)
00069     {
00070         if (e->Visible)
00071         {
00072             // Re-enable sensor input
00073             shakenToken = accelerometer->Shaken += ref new TypedEventHandler<Accelerometer^, AccelerometerShakenEventArgs^>(this, &Scenario2_ShakeEvents::Shaken);
00074         }
00075         else
00076         {
00077             // Disable sensor input
00078             accelerometer->Shaken -= shakenToken;
00079         }
00080     }
00081 }
00082
00083 void Scenario2_ShakeEvents::Shaken(Accelerometer^ sender, AccelerometerShakenEventArgs^ e)
00084 {
00085     shakeCounter++;
00086
00087     // We need to dispatch to the UI thread to display the output
00088     Dispatcher->RunAsync(
00089         CoreDispatcherPriority::Normal,
00090         ref new DispatchedHandler(
00091             [this]()
00092             {
00093                 ScenarioOutputText->Text = shakeCounter.ToString();
00094             },
00095             CallbackContext::Any
00096             )
00097         );
00098 }
00099
00100 void Scenario2_ShakeEvents::ScenarioEnable()
00101 {
00102     visibilityToken = Window::Current->VisibilityChanged += ref new WindowVisibilityChangedEventHandler(this, &Scenario2_ShakeEvents::VisibilityChanged);
00103     shakenToken = accelerometer->Shaken += ref new TypedEventHandler<Accelerometer^, AccelerometerShakenEventArgs^>(this, &Scenario2_ShakeEvents::Shaken);
00104
00105     ScenarioEnableButton->IsEnabled = false;
00106     ScenarioDisableButton->IsEnabled = true;
00107 }
00108
00109 void Scenario2_ShakeEvents::ScenarioDisable()
00110 {
00111     Window::Current->VisibilityChanged -= visibilityToken;
00112     accelerometer->Shaken -= shakenToken;
00113
00114     ScenarioEnableButton->IsEnabled = true;
00115     ScenarioDisableButton->IsEnabled = false;
00116 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.cpp Source File

  • UserCertificateStore
  • cppwinrt

Scenario1_MoveCertificate.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_MoveCertificate.h"
00014 #include "Scenario1_MoveCertificate.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::Windows::Security::Cryptography;
00020 using namespace winrt::Windows::Security::Cryptography::Certificates;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Controls;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario1_MoveCertificate::Scenario1_MoveCertificate() :
00028         appStore{ CertificateStores::GetStoreByName(StandardCertificateStoreNames::Personal()) },
00029         userStore{ CertificateStores::GetUserStoreByName(StandardCertificateStoreNames::Personal()) }
00030     {
00031         InitializeComponent();
00032     }
00033
00034     fire_and_forget Scenario1_MoveCertificate::OnNavigatedTo(NavigationEventArgs const&)
00035     {
00036         auto lifetime = get_strong();
00037
00038         IVectorView<Certificate> certificates = co_await CertificateStores::FindAllAsync();
00039
00040         for (Certificate certificate : certificates)
00041         {
00042             ListViewItem item;
00043             hstring serialNumberAsString = CryptographicBuffer::EncodeToHexString(CryptographicBuffer::CreateFromByteArray(certificate.SerialNumber()));
00044             item.Content(box_value(L"Subject: " + certificate.Subject() + L", Serial number:" + serialNumberAsString));
00045             item.Tag(certificate);
00046
00047             if (certificate.IsPerUser())
00048             {
00049                 UserCertificateListView().Items().Append(item);
00050             }
00051             else
00052             {
00053                 AppCertificateListView().Items().Append(item);
00054             }
00055         }
00056     }
00057
00058     static void MoveItemBetweenListViews(ListViewItem const& item, ListView const& source, ListView const& destination)
00059     {
00060         uint32_t index;
00061         if (source.Items().IndexOf(item, index))
00062         {
00063             source.Items().RemoveAt(index);
00064         }
00065
00066         destination.Items().Append(item);
00067         destination.SelectedItem(item);
00068         destination.ScrollIntoView(item);
00069     }
00070
00071     fire_and_forget Scenario1_MoveCertificate::MoveUserCertificateToAppCertificateStore(IInspectable const&, RoutedEventArgs const&)
00072     {
00073         auto lifetime = get_strong();
00074
00075         auto item = UserCertificateListView().SelectedItem().as<ListViewItem>();
00076         if (item)
00077         {
00078             auto certificate = item.Tag().as<Certificate>();
00079             appStore.Add(certificate);
00080
00081             if (co_await userStore.RequestDeleteAsync(certificate))
00082             {
00083                 MoveItemBetweenListViews(item, UserCertificateListView(), AppCertificateListView());
00084             }
00085             else
00086             {
00087                 appStore.Delete(certificate);
00088             }
00089         }
00090     }
00091
00092     fire_and_forget Scenario1_MoveCertificate::MoveAppCertificateToUserCertificateStore(IInspectable const&, RoutedEventArgs const&)
00093     {
00094         auto lifetime = get_strong();
00095
00096         auto item = AppCertificateListView().SelectedItem().as<ListViewItem>();
00097         if (item)
00098         {
00099             auto certificate = item.Tag().as<Certificate>();
00100             if (co_await userStore.RequestAddAsync(certificate))
00101             {
00102                 appStore.Delete(certificate);
00103                 MoveItemBetweenListViews(item, AppCertificateListView(), UserCertificateListView());
00104             }
00105         }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario2_ChangePin.xaml.h Source File

  • SmartCard
  • cpp

Scenario2_ChangePin.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario2_ChangePin.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario2_ChangePin sealed
00012     {
00013     public:
00014         Scenario2_ChangePin();
00015     private:
00016         void ChangePin_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017     };
00018 }
Generated on Fri Nov 15 2024 22:21:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario4_Connect.xaml.h Source File

  • WiFiScan
  • cpp

Scenario4_Connect.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_Connect.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "DisplayHelpers.h"
00017
00018 namespace SDKTemplate
00019 {
00020     namespace WiFiScan
00021     {
00022         /// <summary>
00023         /// An empty page that can be used on its own or navigated to within a Frame.
00024         /// </summary>
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         [Windows::UI::Xaml::Data::Bindable]
00027         public ref class Scenario4_Connect sealed
00028         {
00029         public:
00030             Scenario4_Connect();
00031
00032             property Windows::Foundation::Collections::IObservableVector<WiFiNetworkDisplay^>^ ResultCollection;
00033
00034         protected:
00035             void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         private:
00038             void DisplayNetworkReport(Windows::Devices::WiFi::WiFiNetworkReport^ report);
00039             void ResultsListView_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00040             void ConnectButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041             void ScanButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042             void DisconnectButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043             void OnNetworkStatusChanged(Platform::Object^ sender);
00044             void UpdateConnectivityStatus();
00045
00046             MainPage^ _rootPage;
00047             Platform::String^ _savedProfileName;
00048             Windows::Devices::WiFi::WiFiAdapter^ _firstAdapter;
00049             Windows::Foundation::EventRegistrationToken _registrationToken;
00050         };
00051     }
00052 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FrameRenderer Member List

This is the complete list of members for FrameRenderer, including all inherited members.
BufferBitmapForRendering(Windows::Graphics::Imaging::SoftwareBitmap^softwareBitmap) | FrameRenderer | [private]
FrameRenderer(Windows::UI::Xaml::Controls::Image^image) | FrameRenderer |
FrameRenderer::DrainBackBufferAsync() | FrameRenderer | [private]
m_backBuffer | FrameRenderer | [private]
m_colorSpacePoints | FrameRenderer | [private]
m_depthSpacePoints | FrameRenderer | [private]
m_imageElement | FrameRenderer | [private]
m_pointBufferMutex | FrameRenderer | [private]
m_previousBufferHeight | FrameRenderer | [private]
m_previousBufferWidth | FrameRenderer | [private]
m_taskRunning | FrameRenderer | [private]
MapDepthToColor(Windows::Media::Capture::Frames::VideoMediaFrame^colorFrame, Windows::Media::Capture::Frames::VideoMediaFrame^depthFrame, Windows::Media::Devices::Core::CameraIntrinsics^colorCameraIntrinsics, Windows::Perception::Spatial::SpatialCoordinateSystem^colorCoordinateSystem, Windows::Media::Devices::Core::DepthCorrelatedCoordinateMapper^coordinateMapper) | FrameRenderer | [private]
ProcessColorFrame(Windows::Media::Capture::Frames::MediaFrameReference^colorFrame) | FrameRenderer |
ProcessDepthAndColorFrames(Windows::Media::Capture::Frames::MediaFrameReference^colorFrame, Windows::Media::Capture::Frames::MediaFrameReference^depthFrame) | FrameRenderer |
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Project.idl Source File

  • HttpClient
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario01_GetText : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario01_GetText();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario02_GetStream : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario02_GetStream();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario03_GetList : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario03_GetList();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario04_PostText : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario04_PostText();
00036     }
00037
00038     [default_interface]
00039     runtimeclass Scenario05_PostStream : Windows.UI.Xaml.Controls.Page
00040     {
00041         Scenario05_PostStream();
00042     }
00043
00044     [default_interface]
00045     runtimeclass Scenario06_PostMultipart : Windows.UI.Xaml.Controls.Page
00046     {
00047         Scenario06_PostMultipart();
00048     }
00049
00050     [default_interface]
00051     runtimeclass Scenario07_PostStreamWithProgress : Windows.UI.Xaml.Controls.Page
00052     {
00053         Scenario07_PostStreamWithProgress();
00054     }
00055
00056     [default_interface]
00057     runtimeclass Scenario08_PostCustomContent : Windows.UI.Xaml.Controls.Page
00058     {
00059         Scenario08_PostCustomContent();
00060     }
00061
00062     [default_interface]
00063     runtimeclass Scenario09_GetCookie : Windows.UI.Xaml.Controls.Page
00064     {
00065         Scenario09_GetCookie();
00066     }
00067
00068     [default_interface]
00069     runtimeclass Scenario10_SetCookie : Windows.UI.Xaml.Controls.Page
00070     {
00071         Scenario10_SetCookie();
00072     }
00073
00074     [default_interface]
00075     runtimeclass Scenario11_DeleteCookie : Windows.UI.Xaml.Controls.Page
00076     {
00077         Scenario11_DeleteCookie();
00078     }
00079
00080     [default_interface]
00081     runtimeclass Scenario12_DisableCookies : Windows.UI.Xaml.Controls.Page
00082     {
00083         Scenario12_DisableCookies();
00084     }
00085
00086     [default_interface]
00087     runtimeclass Scenario13_RetryFilter : Windows.UI.Xaml.Controls.Page
00088     {
00089         Scenario13_RetryFilter();
00090     }
00091
00092     [default_interface]
00093     runtimeclass Scenario14_MeteredConnectionFilter : Windows.UI.Xaml.Controls.Page
00094     {
00095         Scenario14_MeteredConnectionFilter();
00096     }
00097
00098     [default_interface]
00099     runtimeclass Scenario15_ServerCertificateValidation : Windows.UI.Xaml.Controls.Page
00100     {
00101         Scenario15_ServerCertificateValidation();
00102     }
00103
00104     runtimeclass PlugInFilter : [default] Windows.Web.Http.Filters.IHttpFilter
00105     {
00106         PlugInFilter(Windows.Web.Http.Filters.IHttpFilter innerFilter);
00107     }
00108
00109     runtimeclass SlowInputStream : [default] Windows.Storage.Streams.IInputStream
00110     {
00111         SlowInputStream(UInt32 length);
00112     }
00113
00114     runtimeclass HttpJsonContent : [default] Windows.Web.Http.IHttpContent
00115     {
00116         HttpJsonContent(Windows.Data.Json.IJsonValue jsonValue);
00117     }
00118 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario3.xaml.cs Source File

  • SimpleInk
  • cs

Scenario3.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation;
00014 using Windows.Storage;
00015 using Windows.Storage.Pickers;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.Core;
00018 using Windows.UI.Input.Inking;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// This page demonstrates the usage of the InkPresenter APIs. It shows the following functionality:
00027     /// - Load/Save ink files
00028     /// - Usage of drawing attributes
00029     /// - Input type switching to enable/disable touch
00030     /// - Pen tip transform, highlighter, pencil, and different pen colors and sizes
00031     /// </summary>
00032     public sealed partial class Scenario3 : Page
00033     {
00034         private MainPage rootPage = MainPage.Current;
00035
00036         const int minPenSize = 2;
00037         const int penSizeIncrement = 2;
00038         int penSize;
00039
00040         public Scenario3()
00041         {
00042             this.InitializeComponent();
00043
00044             penSize = minPenSize + penSizeIncrement * PenThickness.SelectedIndex;
00045
00046             InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
00047             drawingAttributes.Color = Windows.UI.Colors.Red;
00048             drawingAttributes.Size = new Size(penSize, penSize);
00049             drawingAttributes.IgnorePressure = false;
00050             drawingAttributes.FitToCurve = true;
00051
00052             inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
00053             inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
00054         }
00055
00056         protected override void OnNavigatedTo(NavigationEventArgs e)
00057         {
00058             // Registering handlers for when inking or erasing is detected
00059             inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
00060             inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
00061         }
00062
00063         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00064         {
00065             // Unregistering handlers for when inking or erasing is detected
00066             inkCanvas.InkPresenter.StrokesCollected -= InkPresenter_StrokesCollected;
00067             inkCanvas.InkPresenter.StrokesErased -= InkPresenter_StrokesErased;
00068         }
00069
00070         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00071         {
00072             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00073         }
00074
00075
00076         private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args)
00077         {
00078             rootPage.NotifyUser(args.Strokes.Count + " stroke(s) erased!", NotifyType.StatusMessage);
00079         }
00080
00081         private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)
00082         {
00083             rootPage.NotifyUser(args.Strokes.Count + " stroke(s) collected!", NotifyType.StatusMessage);
00084         }
00085
00086         void OnPenColorChanged(object sender, RoutedEventArgs e)
00087         {
00088             if (inkCanvas != null)
00089             {
00090                 InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
00091
00092                 // Use button's background to set new pen's color
00093                 var btnSender = sender as Button;
00094                 var brush = btnSender.Background as Windows.UI.Xaml.Media.SolidColorBrush;
00095
00096                 drawingAttributes.Color = brush.Color;
00097                 inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
00098             }
00099         }
00100
00101         void OnPenThicknessChanged(object sender, RoutedEventArgs e)
00102         {
00103             if (inkCanvas != null)
00104             {
00105                 InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
00106                 penSize = minPenSize + penSizeIncrement * PenThickness.SelectedIndex;
00107                 string value = ((ComboBoxItem)PenType.SelectedItem).Content.ToString();
00108                 if (value == "Highlighter" || value == "Calligraphy")
00109                 {
00110                     // Make the pen tip rectangular for highlighter and calligraphy pen
00111                     drawingAttributes.Size = new Size(penSize, penSize * 2);
00112                 }
00113                 else
00114                 {
00115                     // Otherwise, use a square pen tip.
00116                     drawingAttributes.Size = new Size(penSize, penSize);
00117                 }
00118                 inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
00119             }
00120         }
00121
00122         void OnPenTypeChanged(object sender, RoutedEventArgs e)
00123         {
00124             if (inkCanvas != null)
00125             {
00126                 InkDrawingAttributes drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
00127                 string value = ((ComboBoxItem)PenType.SelectedItem).Content.ToString();
00128
00129                 if (value == "Ballpoint")
00130                 {
00131                     if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
00132                     {
00133                         var newDrawingAttributes = new InkDrawingAttributes();
00134                         newDrawingAttributes.Color = drawingAttributes.Color;
00135                         drawingAttributes = newDrawingAttributes;
00136                     }
00137                     drawingAttributes.Size = new Size(penSize, penSize);
00138                     drawingAttributes.PenTip = PenTipShape.Circle;
00139                     drawingAttributes.DrawAsHighlighter = false;
00140                     drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity;
00141                 }
00142                 else if (value == "Highlighter")
00143                 {
00144                     if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
00145                     {
00146                         var newDrawingAttributes = new InkDrawingAttributes();
00147                         newDrawingAttributes.Color = drawingAttributes.Color;
00148                         drawingAttributes = newDrawingAttributes;
00149                     }
00150                     // Make the pen rectangular for highlighter
00151                     drawingAttributes.Size = new Size(penSize, penSize * 2);
00152                     drawingAttributes.PenTip = PenTipShape.Rectangle;
00153                     drawingAttributes.DrawAsHighlighter = true;
00154                     drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity;
00155                 }
00156                 else if (value == "Calligraphy")
00157                 {
00158                     if (drawingAttributes.Kind != InkDrawingAttributesKind.Default)
00159                     {
00160                         var newDrawingAttributes = new InkDrawingAttributes();
00161                         newDrawingAttributes.Color = drawingAttributes.Color;
00162                         drawingAttributes = newDrawingAttributes;
00163                     }
00164                     drawingAttributes.Size = new Size(penSize, penSize * 2);
00165                     drawingAttributes.PenTip = PenTipShape.Rectangle;
00166                     drawingAttributes.DrawAsHighlighter = false;
00167
00168                     // Set a 45 degree rotation on the pen tip
00169                     double radians = 45.0 * Math.PI / 180;
00170                     drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.CreateRotation((float)radians);
00171                 }
00172                 else if (value == "Pencil")
00173                 {
00174                     if (drawingAttributes.Kind != InkDrawingAttributesKind.Pencil)
00175                     {
00176                         var newDrawingAttributes = InkDrawingAttributes.CreateForPencil();
00177                         newDrawingAttributes.Color = drawingAttributes.Color;
00178                         newDrawingAttributes.Size = drawingAttributes.Size;
00179                         drawingAttributes = newDrawingAttributes;
00180                     }
00181                 }
00182                 inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
00183             }
00184         }
00185
00186         void OnClear(object sender, RoutedEventArgs e)
00187         {
00188             inkCanvas.InkPresenter.StrokeContainer.Clear();
00189             rootPage.NotifyUser("Cleared Canvas", NotifyType.StatusMessage);
00190         }
00191
00192         async void OnSaveAsync(object sender, RoutedEventArgs e)
00193         {
00194             // We don't want to save an empty file
00195             if (inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count > 0)
00196             {
00197                 var savePicker = new FileSavePicker();
00198                 savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00199                 savePicker.FileTypeChoices.Add("Gif with embedded ISF", new[] { ".gif" });
00200
00201                 StorageFile file = await savePicker.PickSaveFileAsync();
00202                 if (null != file)
00203                 {
00204                     try
00205                     {
00206                         using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.ReadWrite))
00207                         {
00208                             // Truncate any existing stream in case the new file
00209                             // is smaller than the old file.
00210                             stream.Size = 0;
00211
00212                             await inkCanvas.InkPresenter.StrokeContainer.SaveAsync(stream);
00213                         }
00214                         rootPage.NotifyUser(inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count + " stroke(s) saved!", NotifyType.StatusMessage);
00215                     }
00216                     catch (Exception ex)
00217                     {
00218                         // Report I/O errors during save.
00219                         rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00220                     }
00221                 }
00222             }
00223             else
00224             {
00225                 rootPage.NotifyUser("There is no ink to save.", NotifyType.ErrorMessage);
00226             }
00227         }
00228
00229         async void OnLoadAsync(object sender, RoutedEventArgs e)
00230         {
00231             var openPicker = new FileOpenPicker();
00232             openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00233             openPicker.FileTypeFilter.Add(".gif");
00234             openPicker.FileTypeFilter.Add(".isf");
00235             StorageFile file = await openPicker.PickSingleFileAsync();
00236             if (null != file)
00237             {
00238                 try
00239                 {
00240                     using (var stream = await file.OpenSequentialReadAsync())
00241                     {
00242                         await inkCanvas.InkPresenter.StrokeContainer.LoadAsync(stream);
00243                     }
00244
00245                     rootPage.NotifyUser(inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count + " stroke(s) loaded!", NotifyType.StatusMessage);
00246                 }
00247                 catch (Exception ex)
00248                 {
00249                     // Report I/O errors during load.
00250                     rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00251                 }
00252             }
00253         }
00254
00255         private void TouchInkingCheckBox_Checked(object sender, RoutedEventArgs e)
00256         {
00257             inkCanvas.InkPresenter.InputDeviceTypes |= CoreInputDeviceTypes.Touch;
00258             rootPage.NotifyUser("Enable Touch Inking", NotifyType.StatusMessage);
00259         }
00260
00261         private void TouchInkingCheckBox_Unchecked(object sender, RoutedEventArgs e)
00262         {
00263             inkCanvas.InkPresenter.InputDeviceTypes &= ~CoreInputDeviceTypes.Touch;
00264             rootPage.NotifyUser("Disable Touch Inking", NotifyType.StatusMessage);
00265         }
00266
00267         private void ErasingModeCheckBox_Checked(object sender, RoutedEventArgs e)
00268         {
00269             inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Erasing;
00270             rootPage.NotifyUser("Enable Erasing Mode", NotifyType.StatusMessage);
00271         }
00272
00273         private void ErasingModeCheckBox_Unchecked(object sender, RoutedEventArgs e)
00274         {
00275             inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Inking;
00276             rootPage.NotifyUser("Disable Erasing Mode", NotifyType.StatusMessage);
00277         }
00278     }
00279 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/Scenario3_FrameInputNode.xaml.cs Source File

  • AudioCreation
  • cs
  • AudioCreation

Scenario3_FrameInputNode.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Runtime.InteropServices;
00015 using System.Threading.Tasks;
00016 using Windows.Foundation;
00017 using Windows.Media;
00018 using Windows.Media.Audio;
00019 using Windows.Media.MediaProperties;
00020 using Windows.Media.Render;
00021 using Windows.UI;
00022 using Windows.UI.Core;
00023 using Windows.UI.Xaml;
00024 using Windows.UI.Xaml.Controls;
00025 using Windows.UI.Xaml.Media;
00026 using Windows.UI.Xaml.Navigation;
00027
00028 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00029
00030 namespace AudioCreation
00031 {
00032     // We are initializing a COM interface for use within the namespace
00033     // This interface allows access to memory at the byte level which we need to populate audio data that is generated
00034     [ComImport]
00035     [Guid("5B0D3235-4DBA-4D44-865E-8F1D0E4FD04D")]
00036     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
00037
00038     unsafe interface IMemoryBufferByteAccess
00039     {
00040         void GetBuffer(out byte* buffer, out uint capacity);
00041     }
00042
00043     /// <summary>
00044     /// Scenario 3: Using a frame input node to play audio. Audio data is dynamically generated to populate the audio frame
00045     /// </summary>
00046     public sealed partial class Scenario3_FrameInput : Page
00047     {
00048         private MainPage rootPage;
00049         private AudioGraph graph;
00050         private AudioDeviceOutputNode deviceOutputNode;
00051         private AudioFrameInputNode frameInputNode;
00052         public double theta = 0;
00053
00054         public Scenario3_FrameInput()
00055         {
00056             this.InitializeComponent();
00057         }
00058
00059         protected override async void OnNavigatedTo(NavigationEventArgs e)
00060         {
00061             rootPage = MainPage.Current;
00062             await CreateAudioGraph();
00063         }
00064
00065         protected override void OnNavigatedFrom(NavigationEventArgs e)
00066         {
00067             if (graph != null)
00068             {
00069                 graph.Dispose();
00070             }
00071         }
00072
00073         private void Button_Click(object sender, RoutedEventArgs e)
00074         {
00075             if (generateButton.Content.Equals("Generate Audio"))
00076             {
00077                 frameInputNode.Start();
00078                 generateButton.Content = "Stop";
00079                 audioPipe.Fill = new SolidColorBrush(Colors.Blue);
00080             }
00081             else if (generateButton.Content.Equals("Stop"))
00082             {
00083                 frameInputNode.Stop();
00084                 generateButton.Content = "Generate Audio";
00085                 audioPipe.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
00086             }
00087         }
00088
00089         unsafe private AudioFrame GenerateAudioData(uint samples)
00090         {
00091             // Buffer size is (number of samples) * (size of each sample)
00092             // We choose to generate single channel (mono) audio. For multi-channel, multiply by number of channels
00093             uint bufferSize = samples * sizeof(float);
00094             AudioFrame frame = new Windows.Media.AudioFrame(bufferSize);
00095
00096             using (AudioBuffer buffer = frame.LockBuffer(AudioBufferAccessMode.Write))
00097             using (IMemoryBufferReference reference = buffer.CreateReference())
00098             {
00099                 byte* dataInBytes;
00100                 uint capacityInBytes;
00101                 float* dataInFloat;
00102
00103                 // Get the buffer from the AudioFrame
00104                 ((IMemoryBufferByteAccess)reference).GetBuffer(out dataInBytes, out capacityInBytes);
00105
00106                 // Cast to float since the data we are generating is float
00107                 dataInFloat = (float*)dataInBytes;
00108
00109                 float freq = 1000; // choosing to generate frequency of 1kHz
00110                 float amplitude = 0.3f;
00111                 int sampleRate = (int)graph.EncodingProperties.SampleRate;
00112                 double sampleIncrement = (freq * (Math.PI * 2)) / sampleRate;
00113
00114                 // Generate a 1kHz sine wave and populate the values in the memory buffer
00115                 for (int i = 0; i < samples; i++)
00116                 {
00117                     double sinValue = amplitude * Math.Sin(theta);
00118                     dataInFloat[i] = (float)sinValue;
00119                     theta += sampleIncrement;
00120                 }
00121             }
00122
00123             return frame;
00124         }
00125
00126         private async Task CreateAudioGraph()
00127         {
00128             // Create an AudioGraph with default settings
00129             AudioGraphSettings settings = new AudioGraphSettings(AudioRenderCategory.Media);
00130             CreateAudioGraphResult result = await AudioGraph.CreateAsync(settings);
00131
00132             if (result.Status != AudioGraphCreationStatus.Success)
00133             {
00134                 // Cannot create graph
00135                 rootPage.NotifyUser(String.Format("AudioGraph Creation Error because {0}", result.Status.ToString()), NotifyType.ErrorMessage);
00136                 return;
00137             }
00138
00139             graph = result.Graph;
00140
00141             // Create a device output node
00142             CreateAudioDeviceOutputNodeResult deviceOutputNodeResult = await graph.CreateDeviceOutputNodeAsync();
00143             if (deviceOutputNodeResult.Status != AudioDeviceNodeCreationStatus.Success)
00144             {
00145                 // Cannot create device output node
00146                 rootPage.NotifyUser(String.Format("Audio Device Output unavailable because {0}", deviceOutputNodeResult.Status.ToString()), NotifyType.ErrorMessage);
00147                 speakerContainer.Background = new SolidColorBrush(Colors.Red);
00148             }
00149
00150             deviceOutputNode = deviceOutputNodeResult.DeviceOutputNode;
00151             rootPage.NotifyUser("Device Output Node successfully created", NotifyType.StatusMessage);
00152             speakerContainer.Background = new SolidColorBrush(Colors.Green);
00153
00154             // Create the FrameInputNode at the same format as the graph, except explicitly set mono.
00155             AudioEncodingProperties nodeEncodingProperties = graph.EncodingProperties;
00156             nodeEncodingProperties.ChannelCount = 1;
00157             frameInputNode = graph.CreateFrameInputNode(nodeEncodingProperties);
00158             frameInputNode.AddOutgoingConnection(deviceOutputNode);
00159             frameContainer.Background = new SolidColorBrush(Colors.Green);
00160
00161             // Initialize the Frame Input Node in the stopped state
00162             frameInputNode.Stop();
00163
00164             // Hook up an event handler so we can start generating samples when needed
00165             // This event is triggered when the node is required to provide data
00166             frameInputNode.QuantumStarted += node_QuantumStarted;
00167
00168             // Start the graph since we will only start/stop the frame input node
00169             graph.Start();
00170         }
00171
00172         private void node_QuantumStarted(AudioFrameInputNode sender, FrameInputNodeQuantumStartedEventArgs args)
00173         {
00174             // GenerateAudioData can provide PCM audio data by directly synthesizing it or reading from a file.
00175             // Need to know how many samples are required. In this case, the node is running at the same rate as the rest of the graph
00176             // For minimum latency, only provide the required amount of samples. Extra samples will introduce additional latency.
00177             uint numSamplesNeeded = (uint) args.RequiredSamples;
00178
00179             if(numSamplesNeeded != 0)
00180             {
00181                 AudioFrame audioData = GenerateAudioData(numSamplesNeeded);
00182                 frameInputNode.AddFrame(audioData);
00183             }
00184         }
00185     }
00186 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameUIConstants.h Source File

  • Simple3DGameXaml
  • cpp

GameUIConstants.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace GameInfoOverlayConstant
00015 {
00016     static const float Width = 750.0f;
00017     static const float Height = 380.0f;
00018     static const float TitlePointSize = 32.0f;
00019     static const float TitleHeight = 50.0f;
00020     static const float Separator = 8.0f;
00021     static const float BodyPointSize = 24.0f;
00022     static const float ActionHeight = 40.0f;
00023     static const float TopMargin = 20.0f;
00024     static const float SideMargin = 20.0f;
00025     static const float BottomMargin = 5.0f;
00026 };
00027
00028 namespace GameConstants
00029 {
00030     static const float CrossHairHalfSize = 20.0f;
00031     static const float HudSafeWidth = 200.0f;
00032     static const float HudRightOffset = 175.0f;
00033     static const float HudTopOffset = 15.0f;
00034     static const float Margin = 5.0f;
00035     static const float HudBodyPointSize = 20.0f;
00036     static const float HudTitleHeaderPointSize = 16.0f;
00037     static const float HudTitleBodyPointSize = 20.0f;
00038     static const float HudLicensePointSize = 14.0f;
00039
00040     static const float TouchRectangleSize = 150.0f;
00041     static const float MinPlayableWidth = 320.0f;
00042 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario Member List

This is the complete list of members for Scenario, including all inherited members.
ClassName | Scenario
Title | Scenario
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CancelCommand Member List

This is the complete list of members for CancelCommand, including all inherited members.
CancelCommand() | CancelCommand | [inline]
CancelCommandButton_Click(object sender, RoutedEventArgs e) | CancelCommand | [inline, private]
CommandInvokedHandler(IUICommand command) | CancelCommand | [inline, private]
rootPage | CancelCommand | [private]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

scope_exit< Lambda > Member List

This is the complete list of members for scope_exit< Lambda >, including all inherited members.
m_lambda | scope_exit< Lambda > |
operator=(const scope_exit &) | scope_exit< Lambda > |
scope_exit(Lambda &&lambda) | scope_exit< Lambda > | [inline]
scope_exit(const scope_exit &) | scope_exit< Lambda > |
~scope_exit() | scope_exit< Lambda > | [inline]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario4_BackgroundTask.xaml.h Source File

  • Pedometer
  • cpp

Scenario4_BackgroundTask.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4_BackgroundTask.xaml.h
00014 // Declaration of the Scenario4_BackgroundTask class
00015 //
00016
00017 #pragma once
00018 #include "Scenario4_BackgroundTask.g.h"
00019 #include "MainPage.xaml.h"
00020
00021 namespace SDKTemplate
00022 {
00023     static Platform::String^ SampleBackgroundTaskName = "PedometerBackgroundTask";
00024     static Platform::String^ SampleBackgroundTaskEntryPoint = "Tasks.PedometerBackgroundTask";
00025     [Windows::Foundation::Metadata::WebHostHidden]
00026     public ref class Scenario4_BackgroundTask sealed
00027     {
00028     public:
00029         Scenario4_BackgroundTask();
00030
00031     protected:
00032         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033
00034     private:
00035         void ScenarioRegisterTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036         void ScenarioUnregisterTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00038         void RegisterBackgroundTask();
00039         void UpdateUIAsync(Platform::String^ status);
00040
00041     private:
00042         SDKTemplate::MainPage^ rootPage;
00043         bool backgroundTaskRegistered;
00044         static int stepCountGoalOffset;
00045         int stepCount;
00046         int stepGoal;
00047     };
00048 }
Generated on Fri Nov 15 2024 22:20:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/pch.cpp Source File

  • CameraFrames
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.cpp Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

SpatialInputHandler.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SpatialInputHandler.h"
00003 #include <functional>
00004
00005 using namespace HolographicMRCSample;
00006
00007 using namespace Windows::Foundation;
00008 using namespace Windows::UI::Input::Spatial;
00009 using namespace std::placeholders;
00010
00011 // Creates and initializes a GestureRecognizer that listens to a Person.
00012 SpatialInputHandler::SpatialInputHandler()
00013 {
00014     // The interaction manager provides an event that informs the app when
00015     // spatial interactions are detected.
00016     m_interactionManager = SpatialInteractionManager::GetForCurrentView();
00017
00018     // Bind a handler to the SourcePressed event.
00019     m_sourcePressedEventToken =
00020         m_interactionManager->SourcePressed +=
00021             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00022                 bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
00023                 );
00024 }
00025
00026 SpatialInputHandler::~SpatialInputHandler()
00027 {
00028     // Unregister our handler for the OnSourcePressed event.
00029     m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
00030 }
00031
00032 // Checks if the user performed an input gesture since the last call to this method.
00033 // Allows the main update loop to check for asynchronous changes to the user
00034 // input state.
00035 SpatialInteractionSourceState^ SpatialInputHandler::CheckForInput()
00036 {
00037     SpatialInteractionSourceState^ sourceState = m_sourceState;
00038     m_sourceState = nullptr;
00039     return sourceState;
00040 }
00041
00042 void SpatialInputHandler::OnSourcePressed(SpatialInteractionManager^ sender, SpatialInteractionSourceEventArgs^ args)
00043 {
00044     m_sourceState = args->State;
00045 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/ConnectionSettingsPanel.cpp Source File

  • WiFiDirect
  • cppwinrt

ConnectionSettingsPanel.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "ConnectionSettingsPanel.h"
00013 #include "SampleConfiguration.h"
00014 #include "ConnectionSettingsPanel.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Devices::Enumeration;
00019 using namespace Windows::Devices::WiFiDirect;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     ConnectionSettingsPanel::ConnectionSettingsPanel()
00026     {
00027         InitializeComponent();
00028
00029         auto CreateComboBoxItem = [](hstring const& name, IInspectable const& tag = nullptr)
00030         {
00031             ComboBoxItem item;
00032             item.Content(box_value(name));
00033             item.Tag(tag);
00034             return item;
00035         };
00036
00037         // Initialize the GroupOwnerIntent combo box.
00038         // The options are "Default", then values 0 through 15.
00039         cmbGOIntent().Items().Append(CreateComboBoxItem(L"Default"));
00040         for (int i = 0; i <= 15; i++)
00041         {
00042             cmbGOIntent().Items().Append(CreateComboBoxItem(to_hstring(i), box_value(static_cast<int16_t>(i))));
00043         }
00044         cmbGOIntent().SelectedIndex(0);
00045
00046     }
00047
00048     void ConnectionSettingsPanel::Reset()
00049     {
00050         supportedConfigMethods.clear();
00051     }
00052
00053     void ConnectionSettingsPanel::btnAddConfigMethods_Click(IInspectable const&, RoutedEventArgs const&)
00054     {
00055         // The configuration methods are added in the order of preference, most preferred first.
00056         // Save the values here so we can apply them in RequestPairDeviceAsync.
00057         // In practice, most apps will have a hard-coded preference list.
00058         WiFiDirectConfigurationMethod method = GetSelectedItemTag<WiFiDirectConfigurationMethod>(cmbSupportedConfigMethods());
00059         supportedConfigMethods.push_back(method);
00060         rootPage.NotifyUser(L"Added configuration method " + to_hstring(method), NotifyType::StatusMessage);
00061     }
00062
00063     IAsyncOperation<bool> ConnectionSettingsPanel::RequestPairDeviceAsync(DeviceInformationPairing pairing)
00064     {
00065         auto lifetime = get_strong();
00066
00067         WiFiDirectConnectionParameters connectionParams;
00068
00069         // Optional custom GroupOwnerIntent.
00070         IReference<int16_t> groupOwnerIntent = GetSelectedItemTag<IReference<int16_t>>(cmbGOIntent());
00071         if (groupOwnerIntent)
00072         {
00073             connectionParams.GroupOwnerIntent(groupOwnerIntent.Value());
00074         }
00075
00076         DevicePairingKinds devicePairingKinds = DevicePairingKinds::None;
00077
00078         // If specific configuration methods were added, then use them.
00079         if (!supportedConfigMethods.empty())
00080         {
00081             for (WiFiDirectConfigurationMethod configMethod : supportedConfigMethods)
00082             {
00083                 connectionParams.PreferenceOrderedConfigurationMethods().Append(configMethod);
00084                 devicePairingKinds |= WiFiDirectConnectionParameters::GetDevicePairingKinds(configMethod);
00085             }
00086         }
00087         else
00088         {
00089             // If specific configuration methods were not added, then we'll use these pairing kinds.
00090             devicePairingKinds = DevicePairingKinds::ConfirmOnly | DevicePairingKinds::DisplayPin | DevicePairingKinds::ProvidePin;
00091         }
00092
00093         connectionParams.PreferredPairingProcedure(GetSelectedItemTag<WiFiDirectPairingProcedure>(cmbPreferredPairingProcedure()));
00094         DeviceInformationCustomPairing customPairing = pairing.Custom();
00095         customPairing.PairingRequested({ get_weak(), &ConnectionSettingsPanel::OnPairingRequested });
00096
00097         DevicePairingResult result = co_await customPairing.PairAsync(devicePairingKinds, DevicePairingProtectionLevel::Default, connectionParams);
00098         if (result.Status() != DevicePairingResultStatus::Paired)
00099         {
00100             rootPage.NotifyUser(L"PairAsync failed, Status: " + to_hstring(result.Status()), NotifyType::ErrorMessage);
00101             co_return false;
00102         }
00103         co_return true;
00104     }
00105
00106     void ConnectionSettingsPanel::OnPairingRequested(DeviceInformationCustomPairing const&, DevicePairingRequestedEventArgs const& e)
00107     {
00108         HandlePairing(Dispatcher(), e);
00109     }
00110 }
Generated on Fri Nov 15 2024 22:22:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SemanticTextQuery/cpp/SampleConfiguration.cpp Source File

  • SemanticTextQuery
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Data::Text;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Foundation::Collections;
00013 using namespace Windows::UI::Text;
00014 using namespace Windows::UI::Xaml::Controls;
00015 using namespace Windows::UI::Xaml::Documents;
00016
00017 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00018 {
00019     { "Find Scenario",                            "SDKTemplate.Scenario1" },
00020     { "FindInProperty Scenario",                  "SDKTemplate.Scenario2" },
00021     { "GetMatchingPropertiesWithRanges Scenario", "SDKTemplate.Scenario3" }
00022 };
00023
00024 void ::SDKTemplate::HighlightRanges(TextBlock^ tb,  String^ TextContent, IVectorView<TextSegment>^ ranges)
00025 {
00026     int currentPosition = 0;
00027     const wchar_t* StringData = TextContent->Data();
00028     for (const auto& range : ranges)
00029     {
00030         // Add the next chunk of non-range text
00031         if ((int)range.StartPosition > currentPosition)
00032         {
00033             int length = (int)range.StartPosition - currentPosition;
00034             String^ normalString = "";
00035             for (int i = currentPosition; i < (currentPosition + length); i++)
00036             {
00037                 normalString += StringData[i];
00038             }
00039             Run^ normaltext = ref new Run();
00040             normaltext->Text = normalString;
00041             tb->Inlines->Append(normaltext);
00042             currentPosition += length;
00043         }
00044         // Add the next range
00045         String^ boldString = "";
00046         for (int i = (int)range.StartPosition; i < ((int)range.StartPosition + (int)range.Length); i++)
00047         {
00048             boldString += StringData[i];
00049         }
00050         Run^ boldtext = ref new Run();
00051         boldtext->Text = boldString;
00052         boldtext->FontWeight = FontWeights::Bold;
00053         tb->Inlines->Append(boldtext);
00054         currentPosition += (int)range.Length;
00055     }
00056     // Add the text after the last matching segment
00057     if (currentPosition < (int)TextContent->Length())
00058     {
00059         String^ finalString = "";
00060         for (int i = currentPosition; i < (int)TextContent->Length(); i++)
00061         {
00062             finalString += StringData[i];
00063         }
00064         StringData[currentPosition];
00065         Run^ normaltext = ref new Run();
00066         normaltext->Text = finalString;
00067         tb->Inlines->Append(normaltext);
00068     }
00069     Run^ eol = ref new Run();
00070     eol->Text = "\r\n";
00071     tb->Inlines->Append(eol);
00072 }
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario2_EventHandlers.xaml.cs Source File

  • AdaptiveStreaming
  • cs

Scenario2_EventHandlers.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Helpers;
00013 using SDKTemplate.Logging;
00014 using System;
00015 using System.Linq;
00016 using System.Threading.Tasks;
00017 using Windows.Media.Core;
00018 using Windows.Media.Playback;
00019 using Windows.Media.Streaming.Adaptive;
00020 using Windows.UI.Core;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024 using Windows.Web.Http;
00025 using Windows.Web.Http.Filters;
00026
00027 namespace SDKTemplate
00028 {
00029     /// See the README.md for discussion of this scenario.
00030     public sealed partial class Scenario2_EventHandlers : Page
00031     {
00032         private BitrateHelper bitrateHelper;
00033
00034         public Scenario2_EventHandlers()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             // Release handles on various media objects to ensure a quick clean-up
00042             ContentSelectorControl.MediaPlaybackItem = null;
00043             var mediaPlayer = mediaPlayerElement.MediaPlayer;
00044             if (mediaPlayer != null)
00045             {
00046                 mediaPlayerLogger?.Dispose();
00047                 mediaPlayerLogger = null;
00048
00049                 UnregisterHandlers(mediaPlayer);
00050
00051                 mediaPlayerElement.SetMediaPlayer(null);
00052                 mediaPlayer.Dispose();
00053             }
00054         }
00055
00056         private void UnregisterHandlers(MediaPlayer mediaPlayer)
00057         {
00058             AdaptiveMediaSource adaptiveMediaSource = null;
00059             MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
00060             if (mpItem != null)
00061             {
00062                 adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
00063             }
00064             MediaSource source = mediaPlayer.Source as MediaSource;
00065             if (source != null)
00066             {
00067                 adaptiveMediaSource = source.AdaptiveMediaSource;
00068             }
00069
00070             mediaPlaybackItemLogger?.Dispose();
00071             mediaPlaybackItemLogger = null;
00072
00073             mediaSourceLogger?.Dispose();
00074             mediaSourceLogger = null;
00075
00076             adaptiveMediaSourceLogger?.Dispose();
00077             adaptiveMediaSourceLogger = null;
00078
00079             UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00080         }
00081
00082         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00083         {
00084             // Explicitly create the instance of MediaPlayer if you need to register for its events
00085             // (like MediaOpened / MediaFailed) prior to setting an IMediaPlaybackSource.
00086             var mediaPlayer = new MediaPlayer();
00087
00088             // We use a helper class that logs all the events for the MediaPlayer:
00089             mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);
00090
00091             // Ensure we have PlayReady support, in case the user enters a DASH/PR Uri in the text box.
00092             var prHelper = new PlayReadyHelper(LoggerControl);
00093             prHelper.SetUpProtectionManager(mediaPlayer);
00094             mediaPlayerElement.SetMediaPlayer(mediaPlayer);
00095
00096             // This Scenario focuses on event handling, mostly via the "Logger" helper classes
00097             // in the Shared folder.
00098             //
00099             // In addition, the App can also insert an IHttpFilter into the Windows.Web.Http stack
00100             // which is used by the AdaptiveMediaSource.  To do so, it must derive a class from
00101             // IHttpFilter, provide the HttpBaseProtocolFilter to that class to execute requests,
00102             // then use the derived filter as the constructor for the HttpClient.
00103             //
00104             // The HttpClient is then used in the constructor of the AdaptiveMediaSource.
00105             // The App should explicitly set:
00106             //   CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache
00107             // When passing an HttpClient into the constructor of AdpativeMediaSource,
00108             // set this on the HttpBaseProtocolFilter.
00109             //
00110             // More than one IHttpFilter can be nested, for example, an App might
00111             // use a filter to modify web requests: see Scenario3 for details.
00112             //
00113             // In this scenario, we add an AdaptiveMediaSourceHttpFilterLogger to provide additional
00114             // verbose logging details for each request.
00115             var baseProtocolFilter = new HttpBaseProtocolFilter();
00116             baseProtocolFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;  // Always set WriteBehavior = NoCache
00117             var fistLevelFilter = new AdaptiveMediaSourceHttpFilterLogger(LoggerControl, baseProtocolFilter);
00118             var httpClient = new HttpClient(fistLevelFilter);
00119
00120
00121             ContentSelectorControl.Initialize(
00122                 mediaPlayer,
00123                 MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
00124                 httpClient,
00125                 LoggerControl,
00126                 LoadSourceFromUriAsync);
00127         }
00128
00129
00130         #region Content Loading
00131
00132         private async Task<MediaPlaybackItem> LoadSourceFromUriAsync(Uri uri, HttpClient httpClient = null)
00133         {
00134             UnregisterHandlers(mediaPlayerElement.MediaPlayer);
00135
00136             AdaptiveMediaSourceCreationResult result = null;
00137             if (httpClient != null)
00138             {
00139                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
00140             }
00141             else
00142             {
00143                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
00144             }
00145
00146             MediaSource source;
00147             if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
00148             {
00149                 var adaptiveMediaSource = result.MediaSource;
00150
00151                 // We use a helper class that logs all the events for the AdaptiveMediaSource:
00152                 adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);
00153
00154                 // In addition to logging, we use the callbacks to update some UI elements in this scenario:
00155                 RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00156
00157                 // At this point, we have read the manifest of the media source, and all bitrates are known.
00158                 bitrateHelper = new BitrateHelper(adaptiveMediaSource.AvailableBitrates);
00159
00160                 // The AdaptiveMediaSource chooses initial playback and download bitrates.
00161                 // See the Tuning scenario for examples of customizing these bitrates.
00162                 await UpdatePlaybackBitrateAsync(adaptiveMediaSource.CurrentPlaybackBitrate);
00163                 await UpdateDownloadBitrateAsync(adaptiveMediaSource.CurrentDownloadBitrate);
00164
00165                 source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);
00166
00167             }
00168             else
00169             {
00170                 Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
00171
00172                 // In this scenario, we make a second attempt to load any URI that is
00173                 // not adaptive streaming as a progressive download URI:
00174                 Log($"Attempting to create a MediaSource from uri: {uri}");
00175                 source = MediaSource.CreateFromUri(uri);
00176             }
00177
00178             // We use a helper class that logs all the events for the MediaSource:
00179             mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);
00180
00181             // You can save additional information in the CustomPropertySet for future retrieval.
00182             // Note: MediaSource.CustomProperties is a ValueSet and therefore can store
00183             // only serializable types.
00184
00185             // Save the original Uri.
00186             source.CustomProperties["uri"] = uri.ToString();
00187
00188             // You're likely to put a content tracking id into the CustomProperties.
00189             source.CustomProperties["contentId"] = Guid.NewGuid().ToString();
00190
00191             var mpItem = new MediaPlaybackItem(source);
00192
00193             // We use a helper class that logs all the events for the MediaPlaybackItem:
00194             mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);
00195
00196             HideDescriptionOnSmallScreen();
00197
00198             return mpItem;
00199         }
00200
00201         private async void HideDescriptionOnSmallScreen()
00202         {
00203             // On small screens, hide the description text to make room for the video.
00204             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00205             {
00206                 DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
00207             });
00208         }
00209         #endregion
00210
00211
00212         #region AdaptiveMediaSource Event Handlers
00213
00214         private void RegisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00215         {
00216             adaptiveMediaSource.DownloadBitrateChanged += DownloadBitrateChanged;
00217             adaptiveMediaSource.PlaybackBitrateChanged += PlaybackBitrateChanged;
00218         }
00219
00220         private void UnregisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00221         {
00222             if (adaptiveMediaSource != null)
00223             {
00224                 adaptiveMediaSource.DownloadBitrateChanged -= DownloadBitrateChanged;
00225                 adaptiveMediaSource.PlaybackBitrateChanged -= PlaybackBitrateChanged;
00226             }
00227         }
00228         private async void DownloadBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadBitrateChangedEventArgs args)
00229         {
00230             uint downloadBitrate = args.NewValue;
00231             await UpdateDownloadBitrateAsync(downloadBitrate);
00232         }
00233
00234         private async Task UpdateDownloadBitrateAsync(uint downloadBitrate)
00235         {
00236             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00237             {
00238                 iconDownloadBitrate.Symbol = bitrateHelper.GetBitrateSymbol(downloadBitrate);
00239                 txtDownloadBitrate.Text = downloadBitrate.ToString();
00240             }));
00241         }
00242
00243         private async void PlaybackBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourcePlaybackBitrateChangedEventArgs args)
00244         {
00245             uint playbackBitrate = args.NewValue;
00246             await UpdatePlaybackBitrateAsync(playbackBitrate);
00247         }
00248
00249         private async Task UpdatePlaybackBitrateAsync(uint playbackBitrate)
00250         {
00251             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00252             {
00253                 iconPlaybackBitrate.Symbol = bitrateHelper.GetBitrateSymbol(playbackBitrate);
00254                 txtPlaybackBitrate.Text = playbackBitrate.ToString();
00255             }));
00256         }
00257         #endregion
00258
00259
00260         #region Utilities
00261         private void Log(string message)
00262         {
00263             LoggerControl.Log(message);
00264         }
00265         MediaPlayerLogger mediaPlayerLogger;
00266         MediaSourceLogger mediaSourceLogger;
00267         MediaPlaybackItemLogger mediaPlaybackItemLogger;
00268         AdaptiveMediaSourceLogger adaptiveMediaSourceLogger;
00269         #endregion
00270     }
00271 }
00272
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_CompositeSettings Member List

This is the complete list of members for Scenario4_CompositeSettings, including all inherited members.
DeleteCompositeSetting_Click(Object sender, RoutedEventArgs e) | Scenario4_CompositeSettings | [inline, private]
DisplayOutput() | Scenario4_CompositeSettings | [inline, private]
localSettings | Scenario4_CompositeSettings | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario4_CompositeSettings | [inline, protected]
Scenario4_CompositeSettings() | Scenario4_CompositeSettings | [inline]
settingName | Scenario4_CompositeSettings | [private]
settingName1 | Scenario4_CompositeSettings | [private]
settingName2 | Scenario4_CompositeSettings | [private]
WriteCompositeSetting_Click(Object sender, RoutedEventArgs e) | Scenario4_CompositeSettings | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/SampleConfiguration.cpp Source File

  • FileAccess
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::Security::Cryptography;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::Streams;
00022 using namespace SDKTemplate;
00023
00024 hstring implementation::MainPage::FEATURE_NAME()
00025 {
00026     return L"FileAccess C++/WinRT Sample";
00027 }
00028
00029 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00030     {
00031         Scenario{ L"Creating a file", xaml_typename<SDKTemplate::Scenario1>() },
00032         Scenario{ L"Getting a file's parent folder", xaml_typename<SDKTemplate::Scenario2>() },
00033         Scenario{ L"Writing and reading text in a file", xaml_typename<SDKTemplate::Scenario3>() },
00034         Scenario{ L"Writing and reading bytes in a file", xaml_typename<SDKTemplate::Scenario4>() },
00035         Scenario{ L"Writing and reading using a stream", xaml_typename<SDKTemplate::Scenario5>() },
00036         Scenario{ L"Displaying file properties", xaml_typename<SDKTemplate::Scenario6>() },
00037         Scenario{ L"Persisting access to a storage item for future use", xaml_typename<SDKTemplate::Scenario7>() },
00038         Scenario{ L"Copying a file", xaml_typename<SDKTemplate::Scenario8>() },
00039         Scenario{L"Comparing two files to see if they are the same file", xaml_typename<SDKTemplate::Scenario9>() },
00040         Scenario{L"Deleting a file", xaml_typename<SDKTemplate::Scenario10>() },
00041         Scenario{L"Attempting to get a file with no error on failure", xaml_typename<SDKTemplate::Scenario11>() },
00042     });
00043
00044 hstring SampleState::fileName{ L"sample.dat" };
00045 Windows::Storage::StorageFile SampleState::sampleFile{ nullptr };
00046 hstring SampleState::mruToken;
00047 hstring SampleState::falToken;
00048
00049 fire_and_forget SampleState::ValidateFile()
00050 {
00051     StorageFolder picturesLibrary = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary);
00052     sampleFile = (co_await picturesLibrary.TryGetItemAsync(fileName)).try_as<StorageFile>();
00053     if (sampleFile == nullptr)
00054     {
00055         // If file doesn't exist, indicate users to use scenario 1
00056         NotifyUserFileNotExist();
00057     }
00058 }
00059
00060 void SampleState::NotifyUserFileNotExist()
00061 {
00062     MainPage::Current().NotifyUser(
00063         L"The file '" + fileName +  L"' does not exist. Use scenario one to create this file.",
00064         NotifyType::ErrorMessage);
00065
00066 }
00067
00068 IBuffer SampleState::GetBufferFromString(hstring const& string)
00069 {
00070     if (string.empty())
00071     {
00072         return Buffer(0U);
00073     }
00074     else
00075     {
00076         return CryptographicBuffer::ConvertStringToBinary(string, BinaryStringEncoding::Utf8);
00077     }
00078 }
00079
00080 hstring SampleState::GetStringFromBuffer(IBuffer const& buffer)
00081 {
00082     // Throws HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)
00083     // if the buffer is not properly encoded.
00084     return CryptographicBuffer::ConvertBinaryToString(BinaryStringEncoding::Utf8, buffer);
00085 }
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/Scenario1_DetectInPhoto.xaml.cs Source File

  • BasicFaceDetection
  • cs

Scenario1_DetectInPhoto.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014
00015 using Windows.Graphics.Imaging;
00016 using Windows.Media.FaceAnalysis;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.Storage.Streams;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Media;
00023 using Windows.UI.Xaml.Media.Imaging;
00024 using Windows.UI.Xaml.Navigation;
00025
00026 namespace SDKTemplate
00027 {
00028     /// <summary>
00029     /// Page for demonstrating FaceDetection on an image file.
00030     /// </summary>
00031     public sealed partial class Scenario1_DetectInPhoto : Page
00032     {
00033         /// <summary>
00034         /// Brush for drawing the bounding box around each detected face.
00035         /// </summary>
00036         private readonly SolidColorBrush lineBrush = new SolidColorBrush(Windows.UI.Colors.Yellow);
00037
00038         /// <summary>
00039         /// Thickness of the face bounding box lines.
00040         /// </summary>
00041         private readonly double lineThickness = 2.0;
00042
00043         /// <summary>
00044         /// Transparent fill for the bounding box.
00045         /// </summary>
00046         private readonly SolidColorBrush fillBrush = new SolidColorBrush(Windows.UI.Colors.Transparent);
00047
00048         /// <summary>
00049         /// Limit on the height of the source image (in pixels) passed into FaceDetector for performance considerations.
00050         /// Images larger that this size will be downscaled proportionally.
00051         /// </summary>
00052         /// <remarks>
00053         /// This is an arbitrary value that was chosen for this scenario, in which FaceDetector performance isn't too important but face
00054         /// detection accuracy is; a generous size is used.
00055         /// Your application may have different performance and accuracy needs and you'll need to decide how best to control input.
00056         /// </remarks>
00057         private readonly uint sourceImageHeightLimit = 1280;
00058
00059         /// <summary>
00060         /// Reference back to the "root" page of the app.
00061         /// </summary>
00062         private MainPage rootPage;
00063
00064         /// <summary>
00065         /// Initializes a new instance of the <see cref="Scenario1_DetectInPhoto" /> class.
00066         /// </summary>
00067         public Scenario1_DetectInPhoto()
00068         {
00069             this.InitializeComponent();
00070         }
00071
00072         /// <summary>
00073         /// Responds when we navigate to this page.
00074         /// </summary>
00075         /// <param name="e">Event data</param>
00076         protected override void OnNavigatedTo(NavigationEventArgs e)
00077         {
00078             this.rootPage = MainPage.Current;
00079         }
00080
00081         /// <summary>
00082         /// Takes the photo image and FaceDetector results and assembles the visualization onto the Canvas.
00083         /// </summary>
00084         /// <param name="displaySource">Bitmap object holding the image we're going to display</param>
00085         /// <param name="foundFaces">List of detected faces; output from FaceDetector</param>
00086         private void SetupVisualization(WriteableBitmap displaySource, IList<DetectedFace> foundFaces)
00087         {
00088             this.PhotoCanvas.Background = new ImageBrush() { ImageSource = displaySource, Stretch = Stretch.Fill };
00089             MainPage.HighlightFaces(displaySource, foundFaces, this.PhotoCanvas, this.HighlightedFaceBox);
00090         }
00091
00092         /// <summary>
00093         /// Clears the display of image and face boxes.
00094         /// </summary>
00095         private void ClearVisualization()
00096         {
00097             this.PhotoCanvas.Background = null;
00098             this.PhotoCanvas.Children.Clear();
00099             this.rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00100         }
00101
00102         /// <summary>
00103         /// Computes a BitmapTransform to downscale the source image if it's too large.
00104         /// </summary>
00105         /// <remarks>
00106         /// Performance of the FaceDetector degrades significantly with large images, and in most cases it's best to downscale
00107         /// the source bitmaps if they're too large before passing them into FaceDetector. Remember through, your application's performance needs will vary.
00108         /// </remarks>
00109         /// <param name="sourceDecoder">Source image decoder</param>
00110         /// <returns>A BitmapTransform object holding scaling values if source image is too large</returns>
00111         private BitmapTransform ComputeScalingTransformForSourceImage(BitmapDecoder sourceDecoder)
00112         {
00113             BitmapTransform transform = new BitmapTransform();
00114
00115             if (sourceDecoder.PixelHeight > this.sourceImageHeightLimit)
00116             {
00117                 float scalingFactor = (float)this.sourceImageHeightLimit / (float)sourceDecoder.PixelHeight;
00118
00119                 transform.ScaledWidth = (uint)Math.Floor(sourceDecoder.PixelWidth * scalingFactor);
00120                 transform.ScaledHeight = (uint)Math.Floor(sourceDecoder.PixelHeight * scalingFactor);
00121             }
00122
00123             return transform;
00124         }
00125
00126         /// <summary>
00127         /// Loads an image file (selected by the user) and runs the FaceDetector on the loaded bitmap. If successful calls SetupVisualization to display the results.
00128         /// </summary>
00129         /// <param name="sender">Button user clicked</param>
00130         /// <param name="e">Event data</param>
00131         private async void OpenFile_Click(object sender, RoutedEventArgs e)
00132         {
00133             FileOpenPicker photoPicker = new FileOpenPicker();
00134             photoPicker.ViewMode = PickerViewMode.Thumbnail;
00135             photoPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00136             photoPicker.FileTypeFilter.Add(".jpg");
00137             photoPicker.FileTypeFilter.Add(".jpeg");
00138             photoPicker.FileTypeFilter.Add(".png");
00139             photoPicker.FileTypeFilter.Add(".bmp");
00140
00141             StorageFile photoFile = await photoPicker.PickSingleFileAsync();
00142             if (photoFile == null)
00143             {
00144                 return;
00145             }
00146
00147             this.ClearVisualization();
00148             this.rootPage.NotifyUser("Opening...", NotifyType.StatusMessage);
00149
00150             try
00151             {
00152                 // Open the image file and decode the bitmap into memory.
00153                 // We'll need to make 2 bitmap copies: one for the FaceDetector and another to display.
00154                 using (IRandomAccessStream fileStream = await photoFile.OpenAsync(Windows.Storage.FileAccessMode.Read))
00155                 {
00156                     BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);
00157                     BitmapTransform transform = this.ComputeScalingTransformForSourceImage(decoder);
00158                     using (SoftwareBitmap originalBitmap = await decoder.GetSoftwareBitmapAsync(decoder.BitmapPixelFormat, BitmapAlphaMode.Ignore, transform, ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage))
00159                     {
00160                         // We need to convert the image into a format that's compatible with FaceDetector.
00161                         // Gray8 should be a good type but verify it against FaceDetector’s supported formats.
00162                         const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Gray8;
00163                         if (FaceDetector.IsBitmapPixelFormatSupported(InputPixelFormat))
00164                         {
00165                             using (SoftwareBitmap detectorInput = SoftwareBitmap.Convert(originalBitmap, InputPixelFormat))
00166                             {
00167                                 // Create a WritableBitmap for our visualization display; copy the original bitmap pixels to WriteableBitmap's buffer.
00168                                 WriteableBitmap displaySource = new WriteableBitmap(originalBitmap.PixelWidth, originalBitmap.PixelHeight);
00169                                 originalBitmap.CopyToBuffer(displaySource.PixelBuffer);
00170
00171                                 this.rootPage.NotifyUser("Detecting...", NotifyType.StatusMessage);
00172
00173                                 // Initialize our FaceDetector and execute it against our input image.
00174                                 // NOTE: FaceDetector initialization can take a long time, and in most cases
00175                                 // you should create a member variable and reuse the object.
00176                                 // However, for simplicity in this scenario we instantiate a new instance each time.
00177                                 FaceDetector detector = await FaceDetector.CreateAsync();
00178                                 IList<DetectedFace> faces = await detector.DetectFacesAsync(detectorInput);
00179
00180                                 // Create our display using the available image and face results.
00181                                 this.SetupVisualization(displaySource, faces);
00182                             }
00183                         }
00184                         else
00185                         {
00186                             this.rootPage.NotifyUser("PixelFormat '" + InputPixelFormat.ToString() + "' is not supported by FaceDetector", NotifyType.ErrorMessage);
00187                         }
00188                     }
00189                 }
00190             }
00191             catch (Exception ex)
00192             {
00193                 this.ClearVisualization();
00194                 this.rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00195             }
00196         }
00197
00198         /// <summary>
00199         /// Updates any existing face bounding boxes in response to changes in the size of the Canvas.
00200         /// </summary>
00201         /// <param name="sender">Canvas object whose size has changed</param>
00202         /// <param name="e">Event data</param>
00203         private void PhotoCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
00204         {
00205             // If the Canvas is resized we must recompute a new scaling factor and
00206             // apply it to each face box.
00207             ImageBrush brush = (ImageBrush)this.PhotoCanvas.Background;
00208             if (brush != null)
00209             {
00210                 MainPage.RepositionFaces((WriteableBitmap)brush.ImageSource, this.PhotoCanvas);
00211             }
00212         }
00213     }
00214 }
Generated on Fri Nov 15 2024 22:18:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/Content/QuadRenderer.cpp Source File

  • HolographicFaceTracking
  • cpp
  • Content

QuadRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "QuadRenderer.h"
00014 #include "Common\DirectXHelper.h"
00015
00016 using namespace HolographicFaceTracker;
00017 using namespace Concurrency;
00018 using namespace DirectX;
00019 using namespace Windows::Foundation::Numerics;
00020 using namespace Windows::UI::Input::Spatial;
00021
00022 // Loads vertex and pixel shaders from files and instantiates the quad geometry.
00023 QuadRenderer::QuadRenderer(std::shared_ptr<DX::DeviceResources> deviceResources) :
00024     DX::Resource(std::move(deviceResources))
00025 {
00026 }
00027
00028 // This function uses a SpatialPointerPose to position the world-locked hologram
00029 // two meters in front of the user's heading.
00030 void QuadRenderer::Update(SpatialPointerPose^ pointerPose, float3 const& offset, DX::StepTimer const& timer)
00031 {
00032     float const deltaTime = static_cast<float>(timer.GetElapsedSeconds());
00033     float const lerpDeltaTime = deltaTime * c_lerpRate;
00034
00035     if (pointerPose != nullptr)
00036     {
00037         // Get the gaze direction relative to the given coordinate system.
00038         float3 const headPosition = pointerPose->Head->Position;
00039         float3 const headForward = pointerPose->Head->ForwardDirection;
00040         float3 const headBack = -headForward;
00041         float3 const headUp = pointerPose->Head->UpDirection;
00042         float3 const headRight = cross(headForward, headUp);
00043
00044         m_targetPosition = headPosition + (headRight * offset.x) + (headUp * offset.y) + (headBack * offset.z);
00045
00046         float3 const prevPosition = m_position;
00047         m_position = lerp(m_position, m_targetPosition, lerpDeltaTime);
00048
00049         m_velocity = (m_position - prevPosition) / deltaTime;
00050
00051         m_normal = normalize(-m_position);
00052
00053         m_texCoordScale = lerp(m_texCoordScale, m_targetTexCoordScale, lerpDeltaTime);
00054         m_texCoordOffset = lerp(m_texCoordOffset, m_targetTexCoordOffset, lerpDeltaTime);
00055
00056         // Calculate our model to world matrix relative to the user's head.
00057         float4x4 const modelRotationTranslation = make_float4x4_world(m_position, -m_normal, headUp);
00058
00059         // Scale our 1m quad down to 20cm wide.
00060         float4x4 const modelScale = make_float4x4_scale({ 0.2f });
00061
00062         m_modelConstantBufferData.model = modelScale * modelRotationTranslation;
00063         m_modelConstantBufferData.texCoordScale = m_texCoordScale;
00064         m_modelConstantBufferData.texCoordOffset = m_texCoordOffset;
00065
00066         // Use the D3D device context to update Direct3D device-based resources.
00067         const auto context = m_deviceResources->GetD3DDeviceContext();
00068
00069         // Update the model transform buffer for the hologram.
00070         context->UpdateSubresource(
00071             m_modelConstantBuffer.Get(),
00072             0,
00073             nullptr,
00074             &m_modelConstantBufferData,
00075             0,
00076             0
00077         );
00078     }
00079 }
00080
00081 void QuadRenderer::SetTexCoordScaleAndOffset(float2 const& texCoordScale, float2 const& texCoordOffset)
00082 {
00083     m_targetTexCoordScale = texCoordScale;
00084     m_targetTexCoordOffset = texCoordOffset;
00085 }
00086
00087 void QuadRenderer::ResetTexCoordScaleAndOffset(float2 const& texCoordScale, float2 const& texCoordOffset)
00088 {
00089    m_texCoordScale = m_targetTexCoordScale = texCoordScale;
00090    m_texCoordOffset = m_targetTexCoordOffset = texCoordOffset;
00091 }
00092
00093 void QuadRenderer::RenderInternal(void)
00094 {
00095     const auto context = m_deviceResources->GetD3DDeviceContext();
00096
00097     // Each vertex is one instance of the VertexPositionTex struct.
00098     const UINT stride = sizeof(VertexPositionTex);
00099     const UINT offset = 0;
00100     context->IASetVertexBuffers(
00101         0,
00102         1,
00103         m_vertexBuffer.GetAddressOf(),
00104         &stride,
00105         &offset
00106     );
00107     context->IASetIndexBuffer(
00108         m_indexBuffer.Get(),
00109         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00110         0
00111     );
00112     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00113     context->IASetInputLayout(m_inputLayout.Get());
00114
00115     // Attach the vertex shader.
00116     context->VSSetShader(
00117         m_vertexShader.Get(),
00118         nullptr,
00119         0
00120     );
00121     // Apply the model constant buffer to the vertex shader.
00122     context->VSSetConstantBuffers(
00123         0,
00124         1,
00125         m_modelConstantBuffer.GetAddressOf()
00126     );
00127
00128     if (!m_usingVprtShaders)
00129     {
00130         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00131         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00132         // a pass-through geometry shader sets the render target ID.
00133         context->GSSetShader(
00134             m_geometryShader.Get(),
00135             nullptr,
00136             0
00137         );
00138     }
00139
00140     context->PSSetSamplers(
00141         0,
00142         1,
00143         m_samplerState.GetAddressOf()
00144     );
00145
00146     // Draw the objects.
00147     context->DrawIndexedInstanced(
00148         m_indexCount,   // Index count per instance.
00149         2,              // Instance count.
00150         0,              // Start index location.
00151         0,              // Base vertex location.
00152         0               // Start instance location.
00153     );
00154 }
00155
00156 void QuadRenderer::RenderRGB(ID3D11ShaderResourceView* rgbTexture)
00157 {
00158     const auto context = m_deviceResources->GetD3DDeviceContext();
00159
00160     // Set the RGB shader
00161     context->PSSetShader(
00162         m_pixelShaderRGB.Get(),
00163         nullptr,
00164         0
00165     );
00166
00167     // Bind the RGB texture to the shader.
00168     context->PSSetShaderResources(
00169         0,
00170         1,
00171         &rgbTexture
00172     );
00173
00174     // Handle the rest of the rendering which is shared by RGB and NV12 rendering.
00175     RenderInternal();
00176 }
00177
00178 void QuadRenderer::RenderNV12(ID3D11ShaderResourceView* luminanceTexture, ID3D11ShaderResourceView* chrominanceTexture)
00179 {
00180     const auto context = m_deviceResources->GetD3DDeviceContext();
00181
00182     // Set the NV12 shader.
00183     context->PSSetShader(
00184         m_pixelShaderNV12.Get(),
00185         nullptr,
00186         0
00187     );
00188
00189     // Rendering NV12 requires two resource views, which represent the luminance and chrominance channels of the YUV formatted texture.
00190     std::array<ID3D11ShaderResourceView*, 2> const textureViews = {
00191         luminanceTexture,
00192         chrominanceTexture
00193     };
00194
00195     // Bind the NV12 channels to the shader.
00196     context->PSSetShaderResources(
00197         0,
00198         textureViews.size(),
00199         textureViews.data()
00200     );
00201
00202     // Handle the rest of the rendering which is shared by RGB and NV12 rendering.
00203     RenderInternal();
00204 }
00205
00206 task<void> QuadRenderer::CreateDeviceDependentResourcesAsync()
00207 {
00208     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00209
00210     // If the optional VPRT feature is supported by the graphics device, we
00211     // can avoid using geometry shaders to set the render target array index.
00212     std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///QuadVPRTVertexShader.cso" : L"ms-appx:///QuadVertexShader.cso";
00213
00214     // Load shaders asynchronously.
00215     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
00216     task<std::vector<byte>> loadPSTaskNV12 = DX::ReadDataAsync(L"ms-appx:///QuadPixelShaderNV12.cso");
00217     task<std::vector<byte>> loadPSTaskRGB = DX::ReadDataAsync(L"ms-appx:///QuadPixelShaderRGB.cso");
00218     task<std::vector<byte>> loadGSTask;
00219
00220     if (!m_usingVprtShaders)
00221     {
00222         loadGSTask = DX::ReadDataAsync(L"ms-appx:///QuadGeometryShader.cso");
00223     }
00224
00225     // After the vertex shader file is loaded, create the shader and input layout.
00226     task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
00227     {
00228         DX::ThrowIfFailed(
00229             m_deviceResources->GetD3DDevice()->CreateVertexShader(
00230                 fileData.data(),
00231                 fileData.size(),
00232                 nullptr,
00233                 &m_vertexShader
00234                 )
00235             );
00236
00237         constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
00238         {{
00239             { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexPositionTex, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
00240             { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, offsetof(VertexPositionTex, tex), D3D11_INPUT_PER_VERTEX_DATA, 0 },
00241         }};
00242
00243         DX::ThrowIfFailed(
00244             m_deviceResources->GetD3DDevice()->CreateInputLayout(
00245                 vertexDesc.data(),
00246                 vertexDesc.size(),
00247                 fileData.data(),
00248                 fileData.size(),
00249                 &m_inputLayout
00250                 )
00251             );
00252     });
00253
00254     // After the pixel shader file is loaded, create the shader and constant buffer.
00255     task<void> createPSTaskNV12 = loadPSTaskNV12.then([this] (const std::vector<byte>& fileData)
00256     {
00257         DX::ThrowIfFailed(
00258             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00259                 fileData.data(),
00260                 fileData.size(),
00261                 nullptr,
00262                 &m_pixelShaderNV12
00263                 )
00264             );
00265     });
00266
00267     task<void> createPSTaskRGB = loadPSTaskRGB.then([this] (const std::vector<byte>& fileData)
00268     {
00269         DX::ThrowIfFailed(
00270             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00271                 fileData.data(),
00272                 fileData.size(),
00273                 nullptr,
00274                 &m_pixelShaderRGB
00275             )
00276         );
00277     });
00278
00279
00280     task<void> createGSTask;
00281     if (!m_usingVprtShaders)
00282     {
00283         // After the geometry shader file is loaded, create the shader.
00284         createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
00285         {
00286             DX::ThrowIfFailed(
00287                 m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00288                     fileData.data(),
00289                     fileData.size(),
00290                     nullptr,
00291                     &m_geometryShader
00292                     )
00293                 );
00294         });
00295     }
00296
00297     // Once all shaders are loaded, create the mesh.
00298     task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTaskNV12 && createPSTaskRGB && createVSTask) : (createPSTaskNV12 && createPSTaskRGB && createVSTask && createGSTask);
00299     task<void> finalLoadingTask = shaderTaskGroup.then([this] ()
00300     {
00301         // Load mesh vertices. Each vertex has a position and a color.
00302         // Note that the quad size has changed from the default DirectX app
00303         // template. Windows Holographic is scaled in meters, so to draw the
00304         // quad at a comfortable size we made the quad width 0.2 m (20 cm).
00305         static const std::array<VertexPositionTex, 4> quadVertices =
00306         {{
00307             { float3(-0.5f,  0.5f, 0.f), float2(0.f, 0.f) },
00308             { float3( 0.5f,  0.5f, 0.f), float2(1.f, 0.f) },
00309             { float3( 0.5f, -0.5f, 0.f), float2(1.f, 1.f) },
00310             { float3(-0.5f, -0.5f, 0.f), float2(0.f, 1.f) },
00311         }};
00312
00313         D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
00314         vertexBufferData.pSysMem                = quadVertices.data();
00315         vertexBufferData.SysMemPitch            = 0;
00316         vertexBufferData.SysMemSlicePitch       = 0;
00317         const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionTex) * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
00318         DX::ThrowIfFailed(
00319             m_deviceResources->GetD3DDevice()->CreateBuffer(
00320                 &vertexBufferDesc,
00321                 &vertexBufferData,
00322                 &m_vertexBuffer
00323                 )
00324             );
00325
00326         // Load mesh indices. Each trio of indices represents
00327         // a triangle to be rendered on the screen.
00328         // For example: 2,1,0 means that the vertices with indexes
00329         // 2, 1, and 0 from the vertex buffer compose the
00330         // first triangle of this mesh.
00331         // Note that the winding order is clockwise by default.
00332         constexpr std::array<uint16_t, 12> quadIndices =
00333         {{
00334             // -z
00335             0,2,3,
00336             0,1,2,
00337
00338             // +z
00339             2,0,3,
00340             1,0,2,
00341         }};
00342
00343         m_indexCount = quadIndices.size();
00344
00345         D3D11_SUBRESOURCE_DATA indexBufferData = {0};
00346         indexBufferData.pSysMem          = quadIndices.data();
00347         indexBufferData.SysMemPitch      = 0;
00348         indexBufferData.SysMemSlicePitch = 0;
00349         const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
00350         DX::ThrowIfFailed(
00351             m_deviceResources->GetD3DDevice()->CreateBuffer(
00352                 &indexBufferDesc,
00353                 &indexBufferData,
00354                 &m_indexBuffer
00355                 )
00356             );
00357
00358         D3D11_SAMPLER_DESC desc = CD3D11_SAMPLER_DESC(CD3D11_DEFAULT());
00359
00360         DX::ThrowIfFailed(
00361             m_deviceResources->GetD3DDevice()->CreateSamplerState(
00362                 &desc,
00363                 &m_samplerState
00364                 )
00365             );
00366
00367         const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(QuadModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00368         DX::ThrowIfFailed(
00369             m_deviceResources->GetD3DDevice()->CreateBuffer(
00370                 &constantBufferDesc,
00371                 nullptr,
00372                 &m_modelConstantBuffer
00373             )
00374         );
00375     });
00376
00377     return finalLoadingTask;
00378 }
00379
00380 void QuadRenderer::ReleaseDeviceDependentResources()
00381 {
00382     m_usingVprtShaders = false;
00383
00384     m_vertexShader.Reset();
00385     m_inputLayout.Reset();
00386     m_pixelShaderRGB.Reset();
00387     m_pixelShaderNV12.Reset();
00388     m_geometryShader.Reset();
00389
00390     m_modelConstantBuffer.Reset();
00391
00392     m_vertexBuffer.Reset();
00393     m_indexBuffer.Reset();
00394
00395     m_samplerState.Reset();
00396 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/SampleConfiguration.h Source File

  • Json
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/Scenario1_BuiltInCasting.xaml.cs Source File

  • BasicMediaCasting
  • cs

Scenario1_BuiltInCasting.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.Storage.Streams;
00020
00021 namespace BasicMediaCasting
00022 {
00023     public sealed partial class Scenario1 : Page
00024     {
00025         private MainPage rootPage;
00026
00027         public Scenario1()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         protected override void OnNavigatedTo(NavigationEventArgs e)
00033         {
00034             rootPage = MainPage.Current;
00035         }
00036
00037         private async void loadButton_Click(object sender, RoutedEventArgs e)
00038         {
00039             //Create a new picker
00040             FileOpenPicker filePicker = new FileOpenPicker();
00041
00042             //Add filetype filters.  In this case wmv and mp4.
00043             filePicker.FileTypeFilter.Add(".wmv");
00044             filePicker.FileTypeFilter.Add(".mp4");
00045
00046             //Set picker start location to the video library
00047             filePicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
00048
00049             //Retrieve file from picker
00050             StorageFile file = await filePicker.PickSingleFileAsync();
00051
00052             //If we got a file, load it into the media lement
00053             if (file != null)
00054             {
00055                 IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
00056                 video.SetSource(stream, file.ContentType);
00057                 rootPage.NotifyUser("Content Selected", NotifyType.StatusMessage);
00058             }
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:18:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BackgroundAuthenticationCompletedEventArgs Member List

This is the complete list of members for BackgroundAuthenticationCompletedEventArgs, including all inherited members.
BackgroundAuthenticationCompletedEventArgs(Exception exception) | BackgroundAuthenticationCompletedEventArgs | [inline]
ExtendedError | BackgroundAuthenticationCompletedEventArgs |
Succeeded | BackgroundAuthenticationCompletedEventArgs |
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/SampleConfiguration.cpp Source File

  • DatagramSocket
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     // The format here is the following:
00021     //     { "Description for the sample", "Fully qualified name for the class that implements the scenario" }
00022     { "Start Datagram Listener", "SDKTemplate.DatagramSocketSample.Scenario1" },
00023     { "Connect to Listener", "SDKTemplate.DatagramSocketSample.Scenario2" },
00024     { "Send Data", "SDKTemplate.DatagramSocketSample.Scenario3" },
00025     { "Close Socket", "SDKTemplate.DatagramSocketSample.Scenario4" },
00026     { "Multicast/Broadcast", "SDKTemplate.DatagramSocketSample.Scenario5" }
00027 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario5_RelativePositioning.xaml.cs Source File

  • AppWindow
  • cs

Scenario5_RelativePositioning.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.WindowManagement;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Hosting;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario5_RelativePositioning : Page
00024     {
00025         private AppWindow appWindow;
00026         private Frame appWindowFrame = new Frame();
00027
00028         public Scenario5_RelativePositioning()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         protected override async void OnNavigatedFrom(NavigationEventArgs e)
00034         {
00035             if (appWindow != null)
00036             {
00037                 await appWindow.CloseAsync();
00038             }
00039         }
00040
00041         private async void ShowWindowBtn_Click(object sender, RoutedEventArgs e)
00042         {
00043             // Clear any previous message.
00044             MainPage.Current.NotifyUser(string.Empty, NotifyType.StatusMessage);
00045
00046             if (!Double.TryParse(windowOffsetXTxt.Text, out var horizontalOffset) ||
00047                 !Double.TryParse(windowOffsetYTxt.Text, out var verticalOffset))
00048             {
00049                 MainPage.Current.NotifyUser($"Please specify valid numeric offsets.", NotifyType.ErrorMessage);
00050                 return;
00051             }
00052
00053             showWindowBtn.IsEnabled = false;
00054
00055             // Only ever create and show one window.
00056             if (appWindow == null)
00057             {
00058                 // Create a new window
00059                 appWindow = await AppWindow.TryCreateAsync();
00060                 // Make sure we release the reference to this window, and release XAML resources, when it's closed
00061                 appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
00062                 // Request the size of our window
00063                 appWindow.RequestSize(new Size(500, 320));
00064                 // Navigate the frame to the page we want to show in the new window
00065                 appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
00066                 // Attach the XAML content to our window
00067                 ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
00068             }
00069
00070             // Make a point for our offset.
00071             Point offset = new Point(horizontalOffset, verticalOffset);
00072
00073             // Check if we should be setting our position relative to ApplicationView or DisplayRegion
00074             if (positionOffsetDisplayRegionRB.IsChecked.Value)
00075             {
00076                 // Request an offset relative to the DisplayRegion we're on
00077                 appWindow.RequestMoveRelativeToDisplayRegion(ApplicationView.GetForCurrentView().GetDisplayRegions()[0], offset);
00078             }
00079             else
00080             {
00081                 // Relative to our ApplicationView
00082                 appWindow.RequestMoveRelativeToCurrentViewContent(offset);
00083             }
00084
00085             // If the window is not visible, show it and/or bring it to foreground
00086             if (!appWindow.IsVisible)
00087             {
00088                 await appWindow.TryShowAsync();
00089             }
00090
00091             showWindowBtn.IsEnabled = true;
00092         }
00093     }
00094 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cs/Scenario1_Orientation.xaml.cs Source File

  • DisplayOrientation
  • cs

Scenario1_Orientation.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.Graphics.Display;
00014 using Windows.UI.Core;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Input;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario1_Orientation : Page
00023     {
00024         DisplayInformation displayInfo;
00025
00026         public Scenario1_Orientation()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             displayInfo = DisplayInformation.GetForCurrentView();
00034             displayInfo.OrientationChanged += OnOrientationChanged;
00035             UpdateContent();
00036         }
00037
00038         protected override void OnNavigatedFrom(NavigationEventArgs e)
00039         {
00040             displayInfo.OrientationChanged -= OnOrientationChanged;
00041         }
00042
00043         private void OnOrientationChanged(DisplayInformation sender, object e)
00044         {
00045             UpdateContent();
00046         }
00047
00048         private void UpdateContent()
00049         {
00050             NativeOrientationTextBlock.Text = displayInfo.NativeOrientation.ToString();
00051             CurrentOrientationTextBlock.Text = displayInfo.CurrentOrientation.ToString();
00052             AutoRotationPreferencesTextBlock.Text = DisplayInformation.AutoRotationPreferences.ToString();
00053         }
00054
00055         private void ApplyRotationLock_Click(object sender, RoutedEventArgs e)
00056         {
00057             DisplayOrientations orientations = DisplayOrientations.None;
00058             if (PreferLandscape.IsChecked.Value)
00059             {
00060                 orientations |= DisplayOrientations.Landscape;
00061             }
00062             if (PreferPortrait.IsChecked.Value)
00063             {
00064                 orientations |= DisplayOrientations.Portrait;
00065             }
00066             if (PreferLandscapeFlipped.IsChecked.Value)
00067             {
00068                 orientations |= DisplayOrientations.LandscapeFlipped;
00069             }
00070             if (PreferPortraitFlipped.IsChecked.Value)
00071             {
00072                 orientations |= DisplayOrientations.PortraitFlipped;
00073             }
00074             DisplayInformation.AutoRotationPreferences = orientations;
00075             UpdateContent();
00076         }
00077     }
00078 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
_captureFolder | MainPage | [private]
_deviceOrientation | MainPage | [private]
_displayInformation | MainPage | [private]
_displayOrientation | MainPage | [private]
_displayRequest | MainPage | [private]
_encodingProfile | MainPage | [private]
_externalCamera | MainPage | [private]
_inputPropertiesBackup | MainPage | [private]
_isInitialized | MainPage | [private]
_isPreviewing | MainPage | [private]
_isRecording | MainPage | [private]
_mediaCapture | MainPage | [private]
_mirroringPreview | MainPage | [private]
_orientationSensor | MainPage | [private]
_outputPropertiesBackup | MainPage | [private]
_systemMediaControls | MainPage | [private]
_videoStabilizationEffect | MainPage | [private]
Application_Resuming(object sender, object o) | MainPage | [inline, private]
Application_Suspending(object sender, SuspendingEventArgs e) | MainPage | [inline, private]
CleanupCameraAsync() | MainPage | [inline, private]
CleanupUiAsync() | MainPage | [inline, private]
CleanUpVideoStabilizationEffectAsync() | MainPage | [inline, private]
ConvertDeviceOrientationToDegrees(SimpleOrientation orientation) | MainPage | [inline, private, static]
ConvertDisplayOrientationToDegrees(DisplayOrientations orientation) | MainPage | [inline, private, static]
ConvertOrientationToPhotoOrientation(SimpleOrientation orientation) | MainPage | [inline, private, static]
CreateVideoStabilizationEffectAsync() | MainPage | [inline, private]
DisplayInformation_OrientationChanged(DisplayInformation sender, object args) | MainPage | [inline, private]
FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel) | MainPage | [inline, private, static]
GetCameraOrientation() | MainPage | [inline, private]
InitializeCameraAsync() | MainPage | [inline, private]
MainPage() | MainPage | [inline]
MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs) | MainPage | [inline, private]
MediaCapture_RecordLimitationExceeded(MediaCapture sender) | MainPage | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | MainPage | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | MainPage | [inline, protected]
OrientationSensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args) | MainPage | [inline, private]
RegisterEventHandlers() | MainPage | [inline, private]
RotationKey | MainPage | [private, static]
SetPreviewRotationAsync() | MainPage | [inline, private]
SetupUiAsync() | MainPage | [inline, private]
SetUpVideoStabilizationRecommendationAsync() | MainPage | [inline, private]
StartPreviewAsync() | MainPage | [inline, private]
StartRecordingAsync() | MainPage | [inline, private]
StopPreviewAsync() | MainPage | [inline, private]
StopRecordingAsync() | MainPage | [inline, private]
SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args) | MainPage | [inline, private]
UnregisterEventHandlers() | MainPage | [inline, private]
UpdateButtonOrientation() | MainPage | [inline, private]
UpdateCaptureControls() | MainPage | [inline, private]
VideoButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
VideoStabilizationEffect_EnabledChanged(VideoStabilizationEffect sender, VideoStabilizationEffectEnabledChangedEventArgs args) | MainPage | [inline, private]
VsToggleButton_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

App Member List

This is the complete list of members for App, including all inherited members.
App() | App | [inline]
OnLaunched(LaunchActivatedEventArgs e) | App | [inline, protected]
OnNavigationFailed(object sender, NavigationFailedEventArgs e) | App | [inline, private]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DeviceResources.cpp Source File

  • Simple3DGameXaml
  • cpp
  • Common

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DeviceResources.h"
00014 #include "DirectXSample.h"
00015 #include <windows.ui.xaml.media.dxinterop.h>
00016
00017 using namespace D2D1;
00018 using namespace DirectX;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Graphics::Display;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Platform;
00025
00026 // Constants used to calculate screen rotations.
00027 namespace ScreenRotation
00028 {
00029     // 0-degree Z-rotation
00030     static const XMFLOAT4X4 Rotation0(
00031         1.0f, 0.0f, 0.0f, 0.0f,
00032         0.0f, 1.0f, 0.0f, 0.0f,
00033         0.0f, 0.0f, 1.0f, 0.0f,
00034         0.0f, 0.0f, 0.0f, 1.0f
00035         );
00036
00037     // 90-degree Z-rotation
00038     static const XMFLOAT4X4 Rotation90(
00039         0.0f, 1.0f, 0.0f, 0.0f,
00040         -1.0f, 0.0f, 0.0f, 0.0f,
00041         0.0f, 0.0f, 1.0f, 0.0f,
00042         0.0f, 0.0f, 0.0f, 1.0f
00043         );
00044
00045     // 180-degree Z-rotation
00046     static const XMFLOAT4X4 Rotation180(
00047         -1.0f, 0.0f, 0.0f, 0.0f,
00048         0.0f, -1.0f, 0.0f, 0.0f,
00049         0.0f, 0.0f, 1.0f, 0.0f,
00050         0.0f, 0.0f, 0.0f, 1.0f
00051         );
00052
00053     // 270-degree Z-rotation
00054     static const XMFLOAT4X4 Rotation270(
00055         0.0f, -1.0f, 0.0f, 0.0f,
00056         1.0f, 0.0f, 0.0f, 0.0f,
00057         0.0f, 0.0f, 1.0f, 0.0f,
00058         0.0f, 0.0f, 0.0f, 1.0f
00059         );
00060 };
00061
00062 // Constructor for DeviceResources.
00063 DX::DeviceResources::DeviceResources() :
00064     m_screenViewport(),
00065     m_d3dFeatureLevel(D3D_FEATURE_LEVEL_9_1),
00066     m_d3dRenderTargetSize(),
00067     m_outputSize(),
00068     m_logicalSize(),
00069     m_nativeOrientation(DisplayOrientations::None),
00070     m_currentOrientation(DisplayOrientations::None),
00071     m_dpi(-1.0f),
00072     m_compositionScaleX(1.0f),
00073     m_compositionScaleY(1.0f),
00074     m_deviceNotify(nullptr)
00075 {
00076     CreateDeviceIndependentResources();
00077     CreateDeviceResources();
00078 }
00079
00080 // Configures resources that don't depend on the Direct3D device.
00081 void DX::DeviceResources::CreateDeviceIndependentResources()
00082 {
00083     // Initialize Direct2D resources.
00084     D2D1_FACTORY_OPTIONS options;
00085     ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
00086
00087 #if defined(_DEBUG)
00088     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00089     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00090 #endif
00091
00092     // Initialize the Direct2D Factory.
00093     DX::ThrowIfFailed(
00094         D2D1CreateFactory(
00095             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00096             __uuidof(ID2D1Factory2),
00097             &options,
00098             &m_d2dFactory
00099             )
00100         );
00101
00102     // Initialize the DirectWrite Factory.
00103     DX::ThrowIfFailed(
00104         DWriteCreateFactory(
00105             DWRITE_FACTORY_TYPE_SHARED,
00106             __uuidof(IDWriteFactory2),
00107             &m_dwriteFactory
00108             )
00109         );
00110
00111     // Initialize the Windows Imaging Component (WIC) Factory.
00112     DX::ThrowIfFailed(
00113         CoCreateInstance(
00114             CLSID_WICImagingFactory2,
00115             nullptr,
00116             CLSCTX_INPROC_SERVER,
00117             IID_PPV_ARGS(&m_wicFactory)
00118             )
00119         );
00120 }
00121
00122 // Configures the Direct3D device, and stores handles to it and the device context.
00123 void DX::DeviceResources::CreateDeviceResources()
00124 {
00125     // This flag adds support for surfaces with a different color channel ordering
00126     // than the API default. It is required for compatibility with Direct2D.
00127     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00128
00129 #if defined(_DEBUG)
00130     if (DX::SdkLayersAvailable())
00131     {
00132         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00133         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00134     }
00135 #endif
00136
00137     // This array defines the set of DirectX hardware feature levels this app will support.
00138     // Note the ordering should be preserved.
00139     // Don't forget to declare your application's minimum required feature level in its
00140     // description.  All applications are assumed to support 9.1 unless otherwise stated.
00141     D3D_FEATURE_LEVEL featureLevels [] =
00142     {
00143         D3D_FEATURE_LEVEL_11_1,
00144         D3D_FEATURE_LEVEL_11_0,
00145         D3D_FEATURE_LEVEL_10_1,
00146         D3D_FEATURE_LEVEL_10_0,
00147         D3D_FEATURE_LEVEL_9_3,
00148         D3D_FEATURE_LEVEL_9_2,
00149         D3D_FEATURE_LEVEL_9_1
00150     };
00151
00152     // Create the Direct3D 11 API device object and a corresponding context.
00153     ComPtr<ID3D11Device> device;
00154     ComPtr<ID3D11DeviceContext> context;
00155
00156     HRESULT hr = D3D11CreateDevice(
00157         nullptr,                    // Specify nullptr to use the default adapter.
00158         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00159         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00160         creationFlags,              // Set debug and Direct2D compatibility flags.
00161         featureLevels,              // List of feature levels this app can support.
00162         ARRAYSIZE(featureLevels),   // Size of the list above.
00163         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00164         &device,                    // Returns the Direct3D device created.
00165         &m_d3dFeatureLevel,         // Returns feature level of device created.
00166         &context                    // Returns the device immediate context.
00167         );
00168
00169     if (FAILED(hr))
00170     {
00171         // If the initialization fails, fall back to the WARP device.
00172         // For more information on WARP, see:
00173         // http://go.microsoft.com/fwlink/?LinkId=286690
00174         DX::ThrowIfFailed(
00175             D3D11CreateDevice(
00176                 nullptr,
00177                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00178                 0,
00179                 creationFlags,
00180                 featureLevels,
00181                 ARRAYSIZE(featureLevels),
00182                 D3D11_SDK_VERSION,
00183                 &device,
00184                 &m_d3dFeatureLevel,
00185                 &context
00186                 )
00187             );
00188     }
00189
00190     // Store pointers to the Direct3D 11.1 API device and immediate context.
00191     DX::ThrowIfFailed(
00192         device.As(&m_d3dDevice)
00193         );
00194
00195     DX::ThrowIfFailed(
00196         context.As(&m_d3dContext)
00197         );
00198
00199     // Create the Direct2D device object and a corresponding context.
00200     ComPtr<IDXGIDevice3> dxgiDevice;
00201     DX::ThrowIfFailed(
00202         m_d3dDevice.As(&dxgiDevice)
00203         );
00204
00205     DX::ThrowIfFailed(
00206         m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
00207         );
00208
00209     DX::ThrowIfFailed(
00210         m_d2dDevice->CreateDeviceContext(
00211             D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
00212             &m_d2dContext
00213             )
00214         );
00215 }
00216
00217 // These resources need to be recreated every time the window size is changed.
00218 void DX::DeviceResources::CreateWindowSizeDependentResources()
00219 {
00220     // Clear the previous window size specific context.
00221     ID3D11RenderTargetView* nullViews [] = { nullptr };
00222     m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00223     m_d3dRenderTargetView = nullptr;
00224     m_d3dRenderTargetViewRight = nullptr;
00225     m_d2dContext->SetTarget(nullptr);
00226     m_d2dTargetBitmap = nullptr;
00227     m_d2dTargetBitmapRight = nullptr;
00228     m_d3dDepthStencilView = nullptr;
00229     m_d3dContext->Flush();
00230
00231     // Calculate the necessary swap chain and render target size in pixels.
00232     m_outputSize.Width = m_logicalSize.Width * m_compositionScaleX;
00233     m_outputSize.Height = m_logicalSize.Height * m_compositionScaleY;
00234
00235     // Prevent zero size DirectX content from being created.
00236     m_outputSize.Width = max(m_outputSize.Width, 1);
00237     m_outputSize.Height = max(m_outputSize.Height, 1);
00238
00239     // The width and height of the swap chain must be based on the window's
00240     // natively-oriented width and height. If the window is not in the native
00241     // orientation, the dimensions must be reversed.
00242     // We do this to take advantage on an optimization that allows for the
00243     // application to draw the content in the proper orientation and then
00244     // indicate to DXGI that the content has been pre-rotated.
00245     DXGI_MODE_ROTATION displayRotation = ComputeDisplayRotation();
00246
00247     bool swapDimensions = displayRotation == DXGI_MODE_ROTATION_ROTATE90 || displayRotation == DXGI_MODE_ROTATION_ROTATE270;
00248     m_d3dRenderTargetSize.Width = swapDimensions ? m_outputSize.Height : m_outputSize.Width;
00249     m_d3dRenderTargetSize.Height = swapDimensions ? m_outputSize.Width : m_outputSize.Height;
00250
00251     if (m_swapChain != nullptr)
00252     {
00253         // If the swap chain already exists, resize it.
00254         HRESULT hr = m_swapChain->ResizeBuffers(
00255             2, // Double-buffered swap chain.
00256             static_cast<UINT>(m_d3dRenderTargetSize.Width),
00257             static_cast<UINT>(m_d3dRenderTargetSize.Height),
00258             DXGI_FORMAT_B8G8R8A8_UNORM,
00259             0
00260             );
00261
00262         if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00263         {
00264             // If the device was removed for any reason, a new device and swap chain will need to be created.
00265             HandleDeviceLost();
00266
00267             // Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method
00268             // and correctly set up the new device.
00269             return;
00270         }
00271         else
00272         {
00273             DX::ThrowIfFailed(hr);
00274         }
00275     }
00276     else
00277     {
00278         CheckStereoEnabledStatus();
00279
00280         // Otherwise, create a new one using the same adapter as the existing Direct3D device.
00281         DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };
00282
00283         swapChainDesc.Width = static_cast<UINT>(m_d3dRenderTargetSize.Width); // Match the size of the window.
00284         swapChainDesc.Height = static_cast<UINT>(m_d3dRenderTargetSize.Height);
00285         swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
00286         swapChainDesc.Stereo = m_stereoEnabled;
00287         swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
00288         swapChainDesc.SampleDesc.Quality = 0;
00289         swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
00290         swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
00291         swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Store apps must use this SwapEffect.
00292         swapChainDesc.Flags = 0;
00293         swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
00294         swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
00295
00296         // This sequence obtains the DXGI factory that was used to create the Direct3D device above.
00297         ComPtr<IDXGIDevice3> dxgiDevice;
00298         DX::ThrowIfFailed(
00299             m_d3dDevice.As(&dxgiDevice)
00300             );
00301
00302         ComPtr<IDXGIAdapter> dxgiAdapter;
00303         DX::ThrowIfFailed(
00304             dxgiDevice->GetAdapter(&dxgiAdapter)
00305             );
00306
00307         ComPtr<IDXGIFactory2> dxgiFactory;
00308         DX::ThrowIfFailed(
00309             dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
00310             );
00311
00312         // When using XAML interop, the swap chain must be created for composition.
00313         DX::ThrowIfFailed(
00314             dxgiFactory->CreateSwapChainForComposition(
00315                 m_d3dDevice.Get(),
00316                 &swapChainDesc,
00317                 nullptr,
00318                 &m_swapChain
00319                 )
00320             );
00321
00322         // Associate swap chain with SwapChainPanel
00323         // UI changes will need to be dispatched back to the UI thread
00324         m_swapChainPanel->Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([=]()
00325         {
00326             // Get backing native interface for SwapChainPanel
00327             ComPtr<ISwapChainPanelNative> panelNative;
00328             DX::ThrowIfFailed(
00329                 reinterpret_cast<IUnknown*>(m_swapChainPanel)->QueryInterface(IID_PPV_ARGS(&panelNative))
00330                 );
00331
00332             DX::ThrowIfFailed(
00333                 panelNative->SetSwapChain(m_swapChain.Get())
00334                 );
00335         }, CallbackContext::Any));
00336
00337         // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
00338         // ensures that the application will only render after each VSync, minimizing power consumption.
00339         DX::ThrowIfFailed(
00340             dxgiDevice->SetMaximumFrameLatency(1)
00341             );
00342     }
00343
00344     // Set the proper orientation for the swap chain, and generate 2D and
00345     // 3D matrix transformations for rendering to the rotated swap chain.
00346     // Note the rotation angle for the 2D and 3D transforms are different.
00347     // This is due to the difference in coordinate spaces.  Additionally,
00348     // the 3D matrix is specified explicitly to avoid rounding errors.
00349
00350     switch (displayRotation)
00351     {
00352     case DXGI_MODE_ROTATION_IDENTITY:
00353         m_orientationTransform2D = Matrix3x2F::Identity();
00354         m_orientationTransform3D = ScreenRotation::Rotation0;
00355         break;
00356
00357     case DXGI_MODE_ROTATION_ROTATE90:
00358         m_orientationTransform2D =
00359             Matrix3x2F::Rotation(90.0f) *
00360             Matrix3x2F::Translation(m_logicalSize.Height, 0.0f);
00361         m_orientationTransform3D = ScreenRotation::Rotation270;
00362         break;
00363
00364     case DXGI_MODE_ROTATION_ROTATE180:
00365         m_orientationTransform2D =
00366             Matrix3x2F::Rotation(180.0f) *
00367             Matrix3x2F::Translation(m_logicalSize.Width, m_logicalSize.Height);
00368         m_orientationTransform3D = ScreenRotation::Rotation180;
00369         break;
00370
00371     case DXGI_MODE_ROTATION_ROTATE270:
00372         m_orientationTransform2D =
00373             Matrix3x2F::Rotation(270.0f) *
00374             Matrix3x2F::Translation(0.0f, m_logicalSize.Width);
00375         m_orientationTransform3D = ScreenRotation::Rotation90;
00376         break;
00377
00378     default:
00379         throw ref new FailureException();
00380     }
00381
00382     DX::ThrowIfFailed(
00383         m_swapChain->SetRotation(displayRotation)
00384         );
00385
00386     // Setup inverse scale on the swap chain
00387     DXGI_MATRIX_3X2_F inverseScale = { 0 };
00388     inverseScale._11 = 1.0f / m_compositionScaleX;
00389     inverseScale._22 = 1.0f / m_compositionScaleY;
00390     ComPtr<IDXGISwapChain2> spSwapChain2;
00391     DX::ThrowIfFailed(
00392         m_swapChain.As<IDXGISwapChain2>(&spSwapChain2)
00393         );
00394
00395     DX::ThrowIfFailed(
00396         spSwapChain2->SetMatrixTransform(&inverseScale)
00397         );
00398
00399     // Create a render target view of the swap chain back buffer.
00400     ComPtr<ID3D11Texture2D> backBuffer;
00401     DX::ThrowIfFailed(
00402         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
00403         );
00404
00405     DX::ThrowIfFailed(
00406         m_d3dDevice->CreateRenderTargetView(
00407             backBuffer.Get(),
00408             nullptr,
00409             &m_d3dRenderTargetView
00410             )
00411         );
00412
00413     // Stereo swapchains have an arrayed resource, so create a second Render Target
00414     // for the right eye buffer.
00415     if (m_stereoEnabled)
00416     {
00417         CD3D11_RENDER_TARGET_VIEW_DESC renderTargetViewRightDesc(
00418             D3D11_RTV_DIMENSION_TEXTURE2DARRAY,
00419             DXGI_FORMAT_B8G8R8A8_UNORM,
00420             0,
00421             1,
00422             1
00423             );
00424
00425         DX::ThrowIfFailed(
00426             m_d3dDevice->CreateRenderTargetView(
00427                 backBuffer.Get(),
00428                 &renderTargetViewRightDesc,
00429                 &m_d3dRenderTargetViewRight
00430                 )
00431             );
00432     }
00433
00434     // Create a depth stencil view for use with 3D rendering if needed.
00435     CD3D11_TEXTURE2D_DESC depthStencilDesc(
00436         DXGI_FORMAT_D24_UNORM_S8_UINT,
00437         static_cast<UINT>(m_d3dRenderTargetSize.Width),
00438         static_cast<UINT>(m_d3dRenderTargetSize.Height),
00439         1, // This depth stencil view has only one texture.
00440         1, // Use a single mipmap level.
00441         D3D11_BIND_DEPTH_STENCIL
00442         );
00443
00444     ComPtr<ID3D11Texture2D> depthStencil;
00445     DX::ThrowIfFailed(
00446         m_d3dDevice->CreateTexture2D(
00447             &depthStencilDesc,
00448             nullptr,
00449             &depthStencil
00450             )
00451         );
00452
00453     CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
00454     DX::ThrowIfFailed(
00455         m_d3dDevice->CreateDepthStencilView(
00456             depthStencil.Get(),
00457             &depthStencilViewDesc,
00458             &m_d3dDepthStencilView
00459             )
00460         );
00461
00462     // Set the 3D rendering viewport to target the entire window.
00463     m_screenViewport = CD3D11_VIEWPORT(
00464         0.0f,
00465         0.0f,
00466         m_d3dRenderTargetSize.Width,
00467         m_d3dRenderTargetSize.Height
00468         );
00469
00470     m_d3dContext->RSSetViewports(1, &m_screenViewport);
00471
00472     // Create a Direct2D target bitmap associated with the
00473     // swap chain back buffer and set it as the current target.
00474     D2D1_BITMAP_PROPERTIES1 bitmapProperties =
00475         D2D1::BitmapProperties1(
00476             D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
00477             D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED
00478             ),
00479         m_dpi,
00480         m_dpi
00481         );
00482
00483     ComPtr<IDXGIResource1> dxgiBackBuffer;
00484     DX::ThrowIfFailed(
00485         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
00486         );
00487
00488     ComPtr<IDXGISurface2> dxgiSurface;
00489     DX::ThrowIfFailed(
00490         dxgiBackBuffer->CreateSubresourceSurface(0, &dxgiSurface)
00491         );
00492
00493     DX::ThrowIfFailed(
00494         m_d2dContext->CreateBitmapFromDxgiSurface(
00495             dxgiSurface.Get(),
00496             &bitmapProperties,
00497             &m_d2dTargetBitmap
00498             )
00499         );
00500
00501     // Stereo swapchains have an arrayed resource, so create a second Target Bitmap
00502     // for the right eye buffer.
00503     if (m_stereoEnabled)
00504     {
00505         DX::ThrowIfFailed(
00506             dxgiBackBuffer->CreateSubresourceSurface(1, &dxgiSurface)
00507             );
00508         DX::ThrowIfFailed(
00509             m_d2dContext->CreateBitmapFromDxgiSurface(
00510                 dxgiSurface.Get(),
00511                 &bitmapProperties,
00512                 &m_d2dTargetBitmapRight
00513                 )
00514             );
00515     }
00516
00517     m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
00518
00519     // Grayscale text anti-aliasing is recommended for all Windows Store apps.
00520     m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
00521 }
00522
00523 // This method is called when the XAML control is created (or re-created).
00524 void DX::DeviceResources::SetSwapChainPanel(SwapChainPanel^ panel)
00525 {
00526     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00527
00528     m_swapChainPanel = panel;
00529     m_logicalSize = Windows::Foundation::Size(static_cast<float>(panel->ActualWidth), static_cast<float>(panel->ActualHeight));
00530     m_nativeOrientation = currentDisplayInformation->NativeOrientation;
00531     m_currentOrientation = currentDisplayInformation->CurrentOrientation;
00532     m_compositionScaleX = panel->CompositionScaleX;
00533     m_compositionScaleY = panel->CompositionScaleY;
00534     m_dpi = currentDisplayInformation->LogicalDpi;
00535     m_d2dContext->SetDpi(m_dpi, m_dpi);
00536
00537     CreateWindowSizeDependentResources();
00538 }
00539
00540 // This method is called in the event handler for the SizeChanged event.
00541 void DX::DeviceResources::SetLogicalSize(Windows::Foundation::Size logicalSize)
00542 {
00543     if (m_logicalSize != logicalSize)
00544     {
00545         m_logicalSize = logicalSize;
00546         CreateWindowSizeDependentResources();
00547     }
00548 }
00549
00550 // This method is called in the event handler for the DpiChanged event.
00551 void DX::DeviceResources::SetDpi(float dpi)
00552 {
00553     if (dpi != m_dpi)
00554     {
00555         m_dpi = dpi;
00556         m_d2dContext->SetDpi(m_dpi, m_dpi);
00557         CreateWindowSizeDependentResources();
00558     }
00559 }
00560
00561 // This method is called in the event handler for the OrientationChanged event.
00562 void DX::DeviceResources::SetCurrentOrientation(DisplayOrientations currentOrientation)
00563 {
00564     if (m_currentOrientation != currentOrientation)
00565     {
00566         m_currentOrientation = currentOrientation;
00567         CreateWindowSizeDependentResources();
00568     }
00569 }
00570
00571 // This method is called in the event handler for the CompositionScaleChanged event.
00572 void DX::DeviceResources::SetCompositionScale(float compositionScaleX, float compositionScaleY)
00573 {
00574     if (m_compositionScaleX != compositionScaleX ||
00575         m_compositionScaleY != compositionScaleY)
00576     {
00577         m_compositionScaleX = compositionScaleX;
00578         m_compositionScaleY = compositionScaleY;
00579         CreateWindowSizeDependentResources();
00580     }
00581 }
00582
00583 // This method is called in the event handler for the DisplayContentsInvalidated event.
00584 void DX::DeviceResources::ValidateDevice()
00585 {
00586     // The D3D Device is no longer valid if the default adapter changed since the device
00587     // was created or if the device has been removed.
00588
00589     // First, get the information for the default adapter from when the device was created.
00590
00591     ComPtr<IDXGIDevice3> dxgiDevice;
00592     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00593
00594     ComPtr<IDXGIAdapter> deviceAdapter;
00595     DX::ThrowIfFailed(dxgiDevice->GetAdapter(&deviceAdapter));
00596
00597     ComPtr<IDXGIFactory2> deviceFactory;
00598     DX::ThrowIfFailed(deviceAdapter->GetParent(IID_PPV_ARGS(&deviceFactory)));
00599
00600     ComPtr<IDXGIAdapter1> previousDefaultAdapter;
00601     DX::ThrowIfFailed(deviceFactory->EnumAdapters1(0, &previousDefaultAdapter));
00602
00603     DXGI_ADAPTER_DESC previousDesc;
00604     DX::ThrowIfFailed(previousDefaultAdapter->GetDesc(&previousDesc));
00605
00606     // Next, get the information for the current default adapter.
00607
00608     ComPtr<IDXGIFactory2> currentFactory;
00609     DX::ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&currentFactory)));
00610
00611     ComPtr<IDXGIAdapter1> currentDefaultAdapter;
00612     DX::ThrowIfFailed(currentFactory->EnumAdapters1(0, &currentDefaultAdapter));
00613
00614     DXGI_ADAPTER_DESC currentDesc;
00615     DX::ThrowIfFailed(currentDefaultAdapter->GetDesc(&currentDesc));
00616
00617     // If the adapter LUIDs don't match, or if the device reports that it has been removed,
00618     // a new D3D device must be created.
00619
00620     if (previousDesc.AdapterLuid.LowPart != currentDesc.AdapterLuid.LowPart ||
00621         previousDesc.AdapterLuid.HighPart != currentDesc.AdapterLuid.HighPart ||
00622         FAILED(m_d3dDevice->GetDeviceRemovedReason()))
00623     {
00624         // Release references to resources related to the old device.
00625         dxgiDevice = nullptr;
00626         deviceAdapter = nullptr;
00627         deviceFactory = nullptr;
00628         previousDefaultAdapter = nullptr;
00629
00630         // Create a new device and swap chain.
00631         HandleDeviceLost();
00632     }
00633 }
00634
00635 // Recreate all device resources and set them back to the current state.
00636 void DX::DeviceResources::HandleDeviceLost()
00637 {
00638     m_swapChain = nullptr;
00639
00640     if (m_deviceNotify != nullptr)
00641     {
00642         m_deviceNotify->OnDeviceLost();
00643     }
00644
00645     // Make sure the rendering state has been released.
00646     m_d3dContext->OMSetRenderTargets(0, nullptr, nullptr);
00647     m_d3dDepthStencilView = nullptr;
00648     m_d3dRenderTargetView = nullptr;
00649     m_d3dRenderTargetViewRight = nullptr;
00650
00651     m_d2dContext->SetTarget(nullptr);
00652     m_d2dTargetBitmap = nullptr;
00653     m_d2dTargetBitmapRight = nullptr;
00654     m_d2dContext = nullptr;
00655     m_d2dDevice = nullptr;
00656
00657     m_d3dContext->Flush();
00658
00659     CreateDeviceResources();
00660     m_d2dContext->SetDpi(m_dpi, m_dpi);
00661     CreateWindowSizeDependentResources();
00662
00663     if (m_deviceNotify != nullptr)
00664     {
00665         m_deviceNotify->OnDeviceRestored();
00666     }
00667 }
00668
00669 // Register our DeviceNotify to be informed on device lost and creation.
00670 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00671 {
00672     m_deviceNotify = deviceNotify;
00673 }
00674
00675 // Call this method when the app suspends. It provides a hint to the driver that the app
00676 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00677 void DX::DeviceResources::Trim()
00678 {
00679     ComPtr<IDXGIDevice3> dxgiDevice;
00680     m_d3dDevice.As(&dxgiDevice);
00681
00682     dxgiDevice->Trim();
00683 }
00684
00685 // Present the contents of the swap chain to the screen.
00686 void DX::DeviceResources::Present()
00687 {
00688     // The first argument instructs DXGI to block until VSync, putting the application
00689     // to sleep until the next VSync. This ensures we don't waste any cycles rendering
00690     // frames that will never be displayed to the screen.
00691     HRESULT hr = m_swapChain->Present(1, 0);
00692
00693     // Discard the contents of the render target.
00694     // This is a valid operation only when the existing contents will be entirely
00695     // overwritten. If dirty or scroll rects are used, this call should be removed.
00696     m_d3dContext->DiscardView(m_d3dRenderTargetView.Get());
00697
00698     // Discard the contents of the depth stencil.
00699     m_d3dContext->DiscardView(m_d3dDepthStencilView.Get());
00700
00701     // If the device was removed either by a disconnection or a driver upgrade, we
00702     // must recreate all device resources.
00703     if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00704     {
00705         HandleDeviceLost();
00706     }
00707     else
00708     {
00709         DX::ThrowIfFailed(hr);
00710     }
00711 }
00712
00713 // This method determines the rotation between the display device's native Orientation and the
00714 // current display orientation.
00715 DXGI_MODE_ROTATION DX::DeviceResources::ComputeDisplayRotation()
00716 {
00717     DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
00718
00719     // Note: NativeOrientation can only be Landscape or Portrait even though
00720     // the DisplayOrientations enum has other values.
00721     switch (m_nativeOrientation)
00722     {
00723     case DisplayOrientations::Landscape:
00724         switch (m_currentOrientation)
00725         {
00726         case DisplayOrientations::Landscape:
00727             rotation = DXGI_MODE_ROTATION_IDENTITY;
00728             break;
00729
00730         case DisplayOrientations::Portrait:
00731             rotation = DXGI_MODE_ROTATION_ROTATE270;
00732             break;
00733
00734         case DisplayOrientations::LandscapeFlipped:
00735             rotation = DXGI_MODE_ROTATION_ROTATE180;
00736             break;
00737
00738         case DisplayOrientations::PortraitFlipped:
00739             rotation = DXGI_MODE_ROTATION_ROTATE90;
00740             break;
00741         }
00742         break;
00743
00744     case DisplayOrientations::Portrait:
00745         switch (m_currentOrientation)
00746         {
00747         case DisplayOrientations::Landscape:
00748             rotation = DXGI_MODE_ROTATION_ROTATE90;
00749             break;
00750
00751         case DisplayOrientations::Portrait:
00752             rotation = DXGI_MODE_ROTATION_IDENTITY;
00753             break;
00754
00755         case DisplayOrientations::LandscapeFlipped:
00756             rotation = DXGI_MODE_ROTATION_ROTATE270;
00757             break;
00758
00759         case DisplayOrientations::PortraitFlipped:
00760             rotation = DXGI_MODE_ROTATION_ROTATE180;
00761             break;
00762         }
00763         break;
00764     }
00765     return rotation;
00766 }
00767
00768 void DX::DeviceResources::UpdateStereoState()
00769 {
00770     bool previousStereoState = m_stereoEnabled;
00771     CheckStereoEnabledStatus();
00772     if (previousStereoState != m_stereoEnabled)
00773     {
00774         // Swap chain needs to be recreated so release the existing one.
00775         // The rest of the dependent resources with be released in CreateWindowSizeDependentResources.
00776         m_swapChain = nullptr;
00777         CreateWindowSizeDependentResources();
00778     }
00779
00780 }
00781
00782 void DX::DeviceResources::CheckStereoEnabledStatus()
00783 {
00784     // first, retrieve the underlying DXGI Device from the D3D Device
00785     ComPtr<IDXGIDevice1> dxgiDevice;
00786     DX::ThrowIfFailed(
00787         m_d3dDevice.As(&dxgiDevice)
00788         );
00789
00790     // next, get the associated adapter from the DXGI Device
00791     ComPtr<IDXGIAdapter> dxgiAdapter;
00792     DX::ThrowIfFailed(
00793         dxgiDevice->GetAdapter(&dxgiAdapter)
00794         );
00795
00796     // next, get the parent factory from the DXGI adapter
00797     ComPtr<IDXGIFactory2> dxgiFactory;
00798     DX::ThrowIfFailed(
00799         dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
00800         );
00801
00802     m_stereoEnabled = dxgiFactory->IsWindowedStereoEnabled() ? true : false;
00803 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/Project.idl Source File

  • AppServices
  • cppwinrt
  • AppServicesClient

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass OpenCloseConnectionScenario : Windows.UI.Xaml.Controls.Page
00016     {
00017         OpenCloseConnectionScenario();
00018     }
00019
00020     [default_interface]
00021     runtimeclass KeepConnectionOpenScenario : Windows.UI.Xaml.Controls.Page
00022     {
00023         KeepConnectionOpenScenario();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/AutoContent/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • AutoContent

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.ActivationTypes.System.Snooze.AutoContent
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00022         {
00023             Initialize();
00024         }
00025
00026
00027         private void Initialize()
00028         {
00029             // Clear all existing notifications
00030             ToastNotificationManager.History.Clear();
00031
00032             // Pop reminder
00033             popToastControl.Payload =
00034                 $@"
00035                 <toast scenario='reminder' launch='args'>
00036                     <visual>
00037                         <binding template='ToastGeneric'>
00038                             <text>System Snoozing (Auto Content)</text>
00039                             <text>The button for snoozing should be localized in your language, generated by the system when displaying the toast.</text>
00040                         </binding>
00041                     </visual>
00042
00043                     <actions>
00044
00045                         <input id='snoozeTime' type='selection' defaultInput='1'>
00046                             <selection id='1' content = '1 minute'/>
00047                             <selection id='2' content = '2 minutes'/>
00048                             <selection id='5' content = '5 minutes'/>
00049                         </input>
00050
00051                         <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content=''/>
00052
00053                         <action activationType='system' arguments='dismiss' content='dismiss (ignore my text)' />
00054
00055                     </actions>
00056                 </toast>";
00057         }
00058
00059         private async void Error(string message)
00060         {
00061             await new MessageDialog(message, "ERROR").ShowAsync();
00062         }
00063     }
00064 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BluetoothLEDeviceDisplay Member List

This is the complete list of members for BluetoothLEDeviceDisplay, including all inherited members.
BluetoothLEDeviceDisplay(DeviceInformation deviceInfoIn) | BluetoothLEDeviceDisplay | [inline]
DeviceInformation | BluetoothLEDeviceDisplay |
GlyphBitmapImage | BluetoothLEDeviceDisplay |
Id | BluetoothLEDeviceDisplay |
IsConnectable | BluetoothLEDeviceDisplay |
IsConnected | BluetoothLEDeviceDisplay |
IsPaired | BluetoothLEDeviceDisplay |
Name | BluetoothLEDeviceDisplay |
OnPropertyChanged(string name) | BluetoothLEDeviceDisplay | [inline, protected]
Properties | BluetoothLEDeviceDisplay |
PropertyChanged | BluetoothLEDeviceDisplay |
Update(DeviceInformationUpdate deviceInfoUpdate) | BluetoothLEDeviceDisplay | [inline]
UpdateGlyphBitmapImage() | BluetoothLEDeviceDisplay | [inline, private]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/Common/DeviceResources.h Source File

  • D2DSvgImage
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetSwapChainPanel(Windows::UI::Xaml::Controls::SwapChainPanel^ panel);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void SetCompositionScale(float compositionScaleX, float compositionScaleY);
00033         void ValidateDevice();
00034         void HandleDeviceLost();
00035         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00036         void Trim();
00037         void Present();
00038
00039         // Device Accessors.
00040         Windows::Foundation::Size   GetOutputSize() const                   { return m_outputSize; }
00041         Windows::Foundation::Size   GetLogicalSize() const                  { return m_logicalSize; }
00042
00043         // D3D Accessors.
00044         ID3D11Device2*              GetD3DDevice() const                    { return m_d3dDevice.Get(); }
00045         ID3D11DeviceContext3*       GetD3DDeviceContext() const             { return m_d3dContext.Get(); }
00046         IDXGISwapChain1*            GetSwapChain() const                    { return m_swapChain.Get(); }
00047         D3D_FEATURE_LEVEL           GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel; }
00048         ID3D11RenderTargetView*     GetBackBufferRenderTargetView() const   { return m_d3dRenderTargetView.Get(); }
00049         ID3D11DepthStencilView*     GetDepthStencilView() const             { return m_d3dDepthStencilView.Get(); }
00050         D3D11_VIEWPORT              GetScreenViewport() const               { return m_screenViewport; }
00051         DirectX::XMFLOAT4X4         GetOrientationTransform3D() const       { return m_orientationTransform3D; }
00052
00053         // D2D Accessors.
00054         ID2D1Factory6*              GetD2DFactory() const                   { return m_d2dFactory.Get(); }
00055         ID2D1Device5*               GetD2DDevice() const                    { return m_d2dDevice.Get(); }
00056         ID2D1DeviceContext5*        GetD2DDeviceContext() const             { return m_d2dContext.Get(); }
00057         ID2D1Bitmap1*               GetD2DTargetBitmap() const              { return m_d2dTargetBitmap.Get(); }
00058         IDWriteFactory2*            GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00059         IWICImagingFactory2*        GetWicImagingFactory() const            { return m_wicFactory.Get(); }
00060         D2D1::Matrix3x2F            GetOrientationTransform2D() const       { return m_orientationTransform2D; }
00061
00062     private:
00063         void CreateDeviceIndependentResources();
00064         void CreateDeviceResources();
00065         void CreateWindowSizeDependentResources();
00066         DXGI_MODE_ROTATION ComputeDisplayRotation();
00067
00068         // Direct3D objects.
00069         Microsoft::WRL::ComPtr<ID3D11Device2>           m_d3dDevice;
00070         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>    m_d3dContext;
00071         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00072
00073         // Direct3D rendering objects. Required for 3D.
00074         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00075         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00076         D3D11_VIEWPORT                                  m_screenViewport;
00077
00078         // Direct2D drawing components.
00079         Microsoft::WRL::ComPtr<ID2D1Factory6>           m_d2dFactory;
00080         Microsoft::WRL::ComPtr<ID2D1Device5>            m_d2dDevice;
00081         Microsoft::WRL::ComPtr<ID2D1DeviceContext5>     m_d2dContext;
00082         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmap;
00083
00084         // DirectWrite drawing components.
00085         Microsoft::WRL::ComPtr<IDWriteFactory2>         m_dwriteFactory;
00086         Microsoft::WRL::ComPtr<IWICImagingFactory2>     m_wicFactory;
00087
00088         // Cached reference to the XAML panel.
00089         Windows::UI::Xaml::Controls::SwapChainPanel^    m_swapChainPanel;
00090
00091         // Cached device properties.
00092         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00093         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00094         Windows::Foundation::Size                       m_outputSize;
00095         Windows::Foundation::Size                       m_logicalSize;
00096         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00097         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00098         float                                           m_dpi;
00099         float                                           m_compositionScaleX;
00100         float                                           m_compositionScaleY;
00101
00102
00103         // Transforms used for display orientation.
00104         D2D1::Matrix3x2F                                m_orientationTransform2D;
00105         DirectX::XMFLOAT4X4                             m_orientationTransform3D;
00106
00107         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00108         IDeviceNotify*                                  m_deviceNotify;
00109     };
00110 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HotspotAuthentication/cs/SampleConfiguration.cs Source File

  • HotspotAuthentication
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Hotspot Authentication";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Initialization", ClassType=typeof(Scenario1_Initialization)},
00025             new Scenario() { Title="Authentication by background task", ClassType=typeof(Scenario2_BackgroundTask)},
00026             new Scenario() { Title="Authentication by foreground app", ClassType=typeof(Scenario3_ForegroundApp)},
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario4_CompletionGroups.xaml.cs Source File

  • BackgroundTransfer
  • cs
  • BackgroundTransfer

Scenario4_CompletionGroups.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Globalization;
00014 using System.Threading.Tasks;
00015 using Tasks;
00016 using Windows.Networking.BackgroundTransfer;
00017 using Windows.Storage;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario4_CompletionGroups : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         private MainPage rootPage = MainPage.Current;
00029         private int downloadsCompleted;
00030
00031         public Scenario4_CompletionGroups()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         private async void StartDownloadsButton_Click(object sender, RoutedEventArgs e)
00037         {
00038             Uri baseUri;
00039             if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out baseUri))
00040             {
00041                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00042                 return;
00043             }
00044
00045             BackgroundDownloader downloader = CompletionGroupTask.CreateBackgroundDownloader();
00046
00047             downloadsCompleted = 0;
00048
00049             for (int i = 0; i < 10;  i++)
00050             {
00051                 Uri uri = new Uri(baseUri, String.Format(CultureInfo.InvariantCulture, "?id={0}", i));
00052                 DownloadOperation download = downloader.CreateDownload(uri, await CreateResultFileAsync(i));
00053                 Task<DownloadOperation> startTask = download.StartAsync().AsTask();
00054                 Task continueTask = startTask.ContinueWith(OnDownloadCompleted);
00055             }
00056
00057             downloader.CompletionGroup.Enable();
00058
00059             SetSubstatus("Completion group enabled.");
00060         }
00061
00062         private async Task<IStorageFile> CreateResultFileAsync(int id)
00063         {
00064             StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
00065             IStorageFile resultFile = await picturesLibrary.CreateFileAsync(
00066                 String.Format(CultureInfo.InvariantCulture, "picture{0}.png", id),
00067                 CreationCollisionOption.GenerateUniqueName);
00068             return resultFile;
00069         }
00070
00071         private void SetSubstatus(string text)
00072         {
00073             var ignore = SubstatusBlock.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00074             {
00075                 SubstatusBlock.Text = text;
00076             });
00077         }
00078
00079         private void OnDownloadCompleted(Task<DownloadOperation> task)
00080         {
00081             var ignore = rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00082             {
00083                 rootPage.NotifyUser(
00084                     String.Format(CultureInfo.InvariantCulture, "{0} downloads completed.", ++downloadsCompleted),
00085                     NotifyType.StatusMessage);
00086             });
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AsyncCallback< T > Member List

This is the complete list of members for AsyncCallback< T >, including all inherited members.
AsyncCallback(T *pParent, InvokeFn fn) | AsyncCallback< T > | [inline]
GetParameters(DWORD *, DWORD *) | AsyncCallback< T > | [inline]
Invoke(IMFAsyncResult *pAsyncResult) | AsyncCallback< T > | [inline]
InvokeFn typedef | AsyncCallback< T > |
m_pInvokeFn | AsyncCallback< T > |
m_pParent | AsyncCallback< T > |
QueryInterface(REFIID iid, void **ppv) | AsyncCallback< T > | [inline]
STDMETHODIMP_(ULONG) AddRef() | AsyncCallback< T > | [inline]
STDMETHODIMP_(ULONG) Release() | AsyncCallback< T > | [inline]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_UpdatingLineDisplayAttributes Member List

This is the complete list of members for Scenario4_UpdatingLineDisplayAttributes, including all inherited members.
InitializeAsync() | Scenario4_UpdatingLineDisplayAttributes | [inline, private]
lineDisplay | Scenario4_UpdatingLineDisplayAttributes | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario4_UpdatingLineDisplayAttributes | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario4_UpdatingLineDisplayAttributes | [inline, protected]
rootPage | Scenario4_UpdatingLineDisplayAttributes | [private]
Scenario4_UpdatingLineDisplayAttributes() | Scenario4_UpdatingLineDisplayAttributes | [inline]
SetValuesFromLineDisplay() | Scenario4_UpdatingLineDisplayAttributes | [inline, private]
UpdateButton_Click(object sender, RoutedEventArgs e) | Scenario4_UpdatingLineDisplayAttributes | [inline, private]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Common/CameraResources.h Source File

  • BasicHologram
  • cppwinrt
  • Common

CameraResources.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace DX
00004 {
00005     class DeviceResources;
00006
00007     // Constant buffer used to send the view-projection matrices to the shader pipeline.
00008     struct ViewProjectionConstantBuffer
00009     {
00010         DirectX::XMFLOAT4X4 viewProjection[2];
00011     };
00012
00013     // Assert that the constant buffer remains 16-byte aligned (best practice).
00014     static_assert((sizeof(ViewProjectionConstantBuffer) % (sizeof(float) * 4)) == 0, "ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00015
00016     // Manages DirectX device resources that are specific to a holographic camera, such as the
00017     // back buffer, ViewProjection constant buffer, and viewport.
00018     class CameraResources
00019     {
00020     public:
00021         CameraResources(winrt::Windows::Graphics::Holographic::HolographicCamera const& holographicCamera);
00022
00023         void CreateResourcesForBackBuffer(
00024             DX::DeviceResources* pDeviceResources,
00025             winrt::Windows::Graphics::Holographic::HolographicCameraRenderingParameters const& cameraParameters
00026         );
00027         void ReleaseResourcesForBackBuffer(
00028             DX::DeviceResources* pDeviceResources
00029         );
00030
00031         void UpdateViewProjectionBuffer(
00032             std::shared_ptr<DX::DeviceResources> deviceResources,
00033             winrt::Windows::Graphics::Holographic::HolographicCameraPose const& cameraPose,
00034             winrt::Windows::Perception::Spatial::SpatialCoordinateSystem const& coordinateSystem);
00035
00036         bool AttachViewProjectionBuffer(
00037             std::shared_ptr<DX::DeviceResources>& deviceResources);
00038
00039         // Direct3D device resources.
00040         ID3D11RenderTargetView* GetBackBufferRenderTargetView()     const { return m_d3dRenderTargetView.Get(); }
00041         ID3D11DepthStencilView* GetDepthStencilView()               const { return m_d3dDepthStencilView.Get(); }
00042         ID3D11Texture2D*        GetBackBufferTexture2D()            const { return m_d3dBackBuffer.Get();       }
00043         ID3D11Texture2D*        GetDepthStencilTexture2D()          const { return m_d3dDepthStencil.Get();     }
00044         D3D11_VIEWPORT          GetViewport()                       const { return m_d3dViewport;               }
00045         DXGI_FORMAT             GetBackBufferDXGIFormat()           const { return m_dxgiFormat;                }
00046
00047         // Render target properties.
00048         winrt::Windows::Foundation::Size GetRenderTargetSize()      const& { return m_d3dRenderTargetSize;      }
00049         bool                    IsRenderingStereoscopic()           const { return m_isStereo;                  }
00050
00051         // The holographic camera these resources are for.
00052         winrt::Windows::Graphics::Holographic::HolographicCamera const& GetHolographicCamera() const { return m_holographicCamera; }
00053
00054     private:
00055         // Direct3D rendering objects. Required for 3D.
00056         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>              m_d3dRenderTargetView;
00057         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>              m_d3dDepthStencilView;
00058         Microsoft::WRL::ComPtr<ID3D11Texture2D>                     m_d3dBackBuffer;
00059         Microsoft::WRL::ComPtr<ID3D11Texture2D>                     m_d3dDepthStencil;
00060
00061         // Device resource to store view and projection matrices.
00062         Microsoft::WRL::ComPtr<ID3D11Buffer>                        m_viewProjectionConstantBuffer;
00063
00064         // Direct3D rendering properties.
00065         DXGI_FORMAT                                                 m_dxgiFormat;
00066         winrt::Windows::Foundation::Size                            m_d3dRenderTargetSize;
00067         D3D11_VIEWPORT                                              m_d3dViewport;
00068
00069         // Indicates whether the camera supports stereoscopic rendering.
00070         bool                                                        m_isStereo = false;
00071
00072         // Indicates whether this camera has a pending frame.
00073         bool                                                        m_framePending = false;
00074
00075         // Pointer to the holographic camera these resources are for.
00076         winrt::Windows::Graphics::Holographic::HolographicCamera    m_holographicCamera = nullptr;
00077     };
00078 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/Scenario3.xaml.cs Source File

  • Projection
  • cs

Scenario3.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using SecondaryViewsHelpers;
00014 using System;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Devices.Enumeration;
00017 using Windows.UI.Core;
00018 using Windows.UI.ViewManagement;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 namespace SDKSample
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class Scenario3 : Page
00030     {
00031         MainPage rootPage = MainPage.Current;
00032         int thisViewId;
00033
00034         public Scenario3()
00035         {
00036             this.InitializeComponent();
00037             thisViewId = ApplicationView.GetForCurrentView().Id;
00038         }
00039
00040         private async void LoadAndDisplayScreens_Click(object sender, RoutedEventArgs e)
00041         {
00042             try
00043             {
00044                 // Use the device selector query of the ProjectionManager to list wired/wireless displays
00045                 String projectorSelectorQuery = ProjectionManager.GetDeviceSelector();
00046
00047                 this.findAndProject_button.IsEnabled = false;
00048
00049                 // Clear the list box
00050                 this.displayList_listview.Items.Clear();
00051                 this.displayList_listview.Visibility = Visibility.Visible;
00052
00053                 rootPage.NotifyUser("Searching for devices...", NotifyType.StatusMessage);
00054
00055                 // Calling the device API to find devices based on the device query
00056                 var outputDevices = await DeviceInformation.FindAllAsync(projectorSelectorQuery);
00057
00058                 // List found devices in the UI
00059                 for (int i = 0; i < outputDevices.Count; i++)
00060                 {
00061                     var device = outputDevices[i];
00062                     this.displayList_listview.Items.Add(device);
00063                 }
00064
00065                 this.findAndProject_button.IsEnabled = true;
00066                 rootPage.NotifyUser("Found devices are now listed.", NotifyType.StatusMessage);
00067             }
00068             catch (InvalidOperationException)
00069             {
00070                 rootPage.NotifyUser("An error occured when querying and listing devices.", NotifyType.ErrorMessage);
00071             }
00072         }
00073
00074         private async void StartProjecting(DeviceInformation selectedDisplay)
00075         {
00076             // If projection is already in progress, then it could be shown on the monitor again
00077             // Otherwise, we need to create a new view to show the presentation
00078             if (rootPage.ProjectionViewPageControl == null)
00079             {
00080                 // First, create a new, blank view
00081                 var thisDispatcher = Window.Current.Dispatcher;
00082                 await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00083                 {
00084                     // ViewLifetimeControl is a wrapper to make sure the view is closed only
00085                     // when the app is done with it
00086                     rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();
00087
00088                     // Assemble some data necessary for the new page
00089                     var initData = new ProjectionViewPageInitializationData();
00090                     initData.MainDispatcher = thisDispatcher;
00091                     initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
00092                     initData.MainViewId = thisViewId;
00093
00094                     // Display the page in the view. Note that the view will not become visible
00095                     // until "StartProjectingAsync" is called
00096                     var rootFrame = new Frame();
00097                     rootFrame.Navigate(typeof(ProjectionViewPage), initData);
00098                     Window.Current.Content = rootFrame;
00099
00100                     // The call to Window.Current.Activate is required starting in Windos 10.
00101                     // Without it, the view will never appear.
00102                     Window.Current.Activate();
00103                 });
00104             }
00105
00106             try
00107             {
00108                 // Start/StopViewInUse are used to signal that the app is interacting with the
00109                 // view, so it shouldn't be closed yet, even if the user loses access to it
00110                 rootPage.ProjectionViewPageControl.StartViewInUse();
00111
00112                 // Show the view on a second display that was selected by the user
00113                 rootPage.NotifyUser("Starting projection on " + selectedDisplay.Name, NotifyType.StatusMessage);
00114                 await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId, selectedDisplay);
00115
00116                 rootPage.NotifyUser("Projection started with success on " + selectedDisplay.Name, NotifyType.StatusMessage);
00117                 rootPage.ProjectionViewPageControl.StopViewInUse();
00118             }
00119             catch (InvalidOperationException)
00120             {
00121                 rootPage.NotifyUser("Start projection failed", NotifyType.ErrorMessage);
00122             }
00123         }
00124
00125         private void displayList_listview_SelectionChanged(object sender, SelectionChangedEventArgs e)
00126         {
00127             // Get the DeviceInformation object of selected ListView item
00128             ListView devicesList = (ListView)sender;
00129             if (devicesList.SelectedItem != null)
00130             {
00131                 DeviceInformation selectedDevice = (DeviceInformation)devicesList.SelectedItem;
00132
00133                 // Start projecting to the selected display
00134                 StartProjecting(selectedDevice);
00135             }
00136             this.displayList_listview.Visibility = Visibility.Collapsed;
00137         }
00138
00139     }
00140 }
00141
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario4_Input.xaml.h Source File

  • GlobalizationPreferences
  • cpp

Scenario4_Input.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_Input.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario4_Input sealed
00020     {
00021     public:
00022         Scenario4_Input();
00023         void ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024     };
00025 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/SampleData.cs Source File

  • XamlPivot
  • cs

SampleData.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.ObjectModel;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007
00008 namespace PivotCS
00009 {
00010     public class SampleDataModel
00011     {
00012         public string Title { get; private set; }
00013         public string ImagePath { get; private set; }
00014         public bool IsNew { get; private set; }
00015         public bool IsFlagged { get; private set; }
00016
00017         public SampleDataModel(string title, string imagePath, bool isNew = false, bool isFlagged = false)
00018         {
00019             this.Title = title;
00020             this.ImagePath = imagePath;
00021             this.IsNew = isNew;
00022             this.IsFlagged = isFlagged;
00023         }
00024
00025         public override string ToString()
00026         {
00027             return this.Title;
00028         }
00029
00030         static public ObservableCollection<SampleDataModel> GetSampleData()
00031         {
00032             var MyCollection = new ObservableCollection<SampleDataModel>();
00033             MyCollection.Add(new SampleDataModel("Cliff", "ms-appx:///Assets/cliff.jpg"));
00034             MyCollection.Add(new SampleDataModel("Grapes", "ms-appx:///Assets/grapes.jpg"));
00035             MyCollection.Add(new SampleDataModel("Rainier", "ms-appx:///Assets/Rainier.jpg", true));
00036             MyCollection.Add(new SampleDataModel("Sunset", "ms-appx:///Assets/Sunset.jpg", true, true));
00037             MyCollection.Add(new SampleDataModel("Treetops", "ms-appx:///Assets/Treetops.jpg", true));
00038             MyCollection.Add(new SampleDataModel("Valley", "ms-appx:///Assets/Valley.jpg", false, true));
00039             return MyCollection;
00040         }
00041     }
00042 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioPage Member List

This is the complete list of members for ScenarioPage, including all inherited members.
BackButtonVisibility | BackButtonPage |
OnBackRequested(object sender, BackRequestedEventArgs e) | BackButtonPage | [inline, protected, virtual]
OnNavigatedFrom(NavigationEventArgs e) | ScenarioPage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | ScenarioPage | [inline, protected]
Scenario | ScenarioPage |
ScenarioPage() | ScenarioPage | [inline]
ScenarioProperty | ScenarioPage | [static]
ScenarioTestPage_VisibleBoundsChanged(ApplicationView sender, object args) | ScenarioPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/Tasks.idl Source File

  • Geolocation
  • cppwinrt
  • Tasks

Tasks.idl

Go to the documentation of this file.
00001 namespace BackgroundTask
00002 {
00003     [default_interface]
00004     runtimeclass GeofenceBackgroundTask : Windows.ApplicationModel.Background.IBackgroundTask
00005     {
00006         GeofenceBackgroundTask();
00007     }
00008
00009     [default_interface]
00010     runtimeclass LocationBackgroundTask : Windows.ApplicationModel.Background.IBackgroundTask
00011     {
00012         LocationBackgroundTask();
00013     }
00014
00015     [default_interface]
00016     runtimeclass VisitBackgroundTask : Windows.ApplicationModel.Background.IBackgroundTask
00017     {
00018         VisitBackgroundTask();
00019     }
00020 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/CameraResources.cs Source File

  • BasicHologram
  • cs
  • Common

CameraResources.cs

Go to the documentation of this file.
00001 using Windows.Graphics.Holographic;
00002 using Windows.Foundation;
00003 using Windows.Perception.Spatial;
00004 using SharpDX.Mathematics.Interop;
00005 using SharpDX.Direct3D11;
00006 using System.Numerics;
00007 using Windows.Graphics.DirectX.Direct3D11;
00008 using System.Runtime.InteropServices;
00009 using System;
00010
00011 namespace BasicHologram.Common
00012 {
00013     /// <summary>
00014     /// Constant buffer used to send hologram position transform to the shader pipeline.
00015     /// </summary>
00016     internal struct ViewProjectionConstantBuffer
00017     {
00018         public Matrix4x4 viewProjectionLeft;
00019         public Matrix4x4 viewProjectionRight;
00020     }
00021
00022     // Manages DirectX device resources that are specific to a holographic camera, such as the
00023     // back buffer, ViewProjection constant buffer, and viewport.
00024     class CameraResources : Disposer
00025     {
00026         // Direct3D rendering objects. Required for 3D.
00027         RenderTargetView                d3dRenderTargetView;
00028         DepthStencilView                d3dDepthStencilView;
00029         Texture2D                       d3dDepthBuffer;
00030         Texture2D                       d3dBackBuffer;
00031
00032         // Device resource to store view and projection matrices.
00033         SharpDX.Direct3D11.Buffer       viewProjectionConstantBuffer;
00034
00035         // Direct3D rendering properties.
00036         SharpDX.DXGI.Format             dxgiFormat;
00037         RawViewportF                    d3dViewport;
00038         Size                            d3dRenderTargetSize;
00039
00040         // Indicates whether the camera supports stereoscopic rendering.
00041         bool                            isStereo = false;
00042
00043         // Indicates whether this camera has a pending frame.
00044         bool                            framePending = false;
00045
00046         // Pointer to the holographic camera these resources are for.
00047         HolographicCamera               holographicCamera = null;
00048
00049         public CameraResources(HolographicCamera holographicCamera)
00050         {
00051             this.holographicCamera      = holographicCamera;
00052             isStereo                    = holographicCamera.IsStereo;
00053             d3dRenderTargetSize         = holographicCamera.RenderTargetSize;
00054
00055             d3dViewport.Height          = (float)d3dRenderTargetSize.Height;
00056             d3dViewport.Width           = (float)d3dRenderTargetSize.Width;
00057             d3dViewport.X               = 0;
00058             d3dViewport.Y               = 0;
00059             d3dViewport.MinDepth        = 0;
00060             d3dViewport.MaxDepth        = 1;
00061         }
00062
00063         /// <summary>
00064         /// Updates resources associated with a holographic camera's swap chain.
00065         /// The app does not access the swap chain directly, but it does create
00066         /// resource views for the back buffer.
00067         /// </summary>
00068         public void CreateResourcesForBackBuffer(
00069             DeviceResources deviceResources,
00070             ref HolographicCameraRenderingParameters cameraParameters
00071             )
00072         {
00073             var device = deviceResources.D3DDevice;
00074
00075             // Get the WinRT object representing the holographic camera's back buffer.
00076             IDirect3DSurface surface = cameraParameters.Direct3D11BackBuffer;
00077
00078             // Get a DXGI interface for the holographic camera's back buffer.
00079             // Holographic cameras do not provide the DXGI swap chain, which is owned
00080             // by the system. The Direct3D back buffer resource is provided using WinRT
00081             // interop APIs.
00082             InteropStatics.IDirect3DDxgiInterfaceAccess surfaceDxgiInterfaceAccess = surface as InteropStatics.IDirect3DDxgiInterfaceAccess;
00083             IntPtr pResource = surfaceDxgiInterfaceAccess.GetInterface(InteropStatics.ID3D11Resource);
00084
00085             // Determine if the back buffer has changed. If so, ensure that the render target view
00086             // is for the current back buffer.
00087             if ((null == d3dBackBuffer) || (d3dBackBuffer.NativePointer != pResource))
00088             {
00089                 // Clean up references to previous resources.
00090                 this.RemoveAndDispose(ref d3dBackBuffer);
00091                 this.RemoveAndDispose(ref d3dRenderTargetView);
00092
00093                 // This can change every frame as the system moves to the next buffer in the
00094                 // swap chain. This mode of operation will occur when certain rendering modes
00095                 // are activated.
00096                 d3dBackBuffer = this.ToDispose(new SharpDX.Direct3D11.Texture2D(pResource));
00097
00098                 // Create a render target view of the back buffer.
00099                 // Creating this resource is inexpensive, and is better than keeping track of
00100                 // the back buffers in order to pre-allocate render target views for each one.
00101                 d3dRenderTargetView = this.ToDispose(new RenderTargetView(device, d3dBackBuffer));
00102
00103                 // Get the DXGI format for the back buffer.
00104                 // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
00105                 Texture2DDescription backBufferDesc = BackBufferTexture2D.Description;
00106                 dxgiFormat = backBufferDesc.Format;
00107
00108                 // Check for render target size changes.
00109                 Size currentSize = holographicCamera.RenderTargetSize;
00110                 if (d3dRenderTargetSize != currentSize)
00111                 {
00112                     // Set render target size.
00113                     d3dRenderTargetSize = HolographicCamera.RenderTargetSize;
00114
00115                     // A new depth stencil view is also needed.
00116                     this.RemoveAndDispose(ref d3dDepthStencilView);
00117                 }
00118             }
00119
00120             // Refresh depth stencil resources, if needed.
00121             if (null == DepthStencilView)
00122             {
00123                 // Create a depth stencil view for use with 3D rendering if needed.
00124                 var depthStencilDesc = new Texture2DDescription
00125                 {
00126                     Format    = SharpDX.DXGI.Format.R16_Typeless,
00127                     Width     = (int)RenderTargetSize.Width,
00128                     Height    = (int)RenderTargetSize.Height,
00129                     ArraySize = IsRenderingStereoscopic ? 2 : 1, // Create two textures when rendering in stereo.
00130                     MipLevels = 1, // Use a single mipmap level.
00131                     BindFlags = BindFlags.DepthStencil | BindFlags.ShaderResource,
00132                     SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0)
00133                 };
00134
00135                 d3dDepthBuffer = new Texture2D(device, depthStencilDesc);
00136                 if (d3dDepthBuffer != null)
00137                 {
00138                     var depthStencilViewDesc = new DepthStencilViewDescription();
00139                     depthStencilViewDesc.Dimension = IsRenderingStereoscopic ? DepthStencilViewDimension.Texture2DArray : DepthStencilViewDimension.Texture2D;
00140                     depthStencilViewDesc.Texture2DArray.ArraySize = IsRenderingStereoscopic ? 2 : 0;
00141                     depthStencilViewDesc.Format = SharpDX.DXGI.Format.D16_UNorm;
00142                     d3dDepthStencilView = this.ToDispose(new DepthStencilView(device, d3dDepthBuffer, depthStencilViewDesc));
00143                 }
00144             }
00145
00146             // Create the constant buffer, if needed.
00147             if (null == viewProjectionConstantBuffer)
00148             {
00149                 // Create a constant buffer to store view and projection matrices for the camera.
00150                 ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
00151                 viewProjectionConstantBuffer = this.ToDispose(SharpDX.Direct3D11.Buffer.Create(
00152                     device,
00153                     BindFlags.ConstantBuffer,
00154                     ref viewProjectionConstantBufferData));
00155             }
00156         }
00157
00158         /// <summary>
00159         /// Releases resources associated with a holographic display back buffer.
00160         /// </summary>
00161         public void ReleaseResourcesForBackBuffer(DeviceResources deviceResources)
00162         {
00163             var context = deviceResources.D3DDeviceContext;
00164
00165             this.RemoveAndDispose(ref d3dBackBuffer);
00166             this.RemoveAndDispose(ref d3dDepthBuffer);
00167             this.RemoveAndDispose(ref d3dRenderTargetView);
00168             this.RemoveAndDispose(ref d3dDepthStencilView);
00169
00170             // Ensure system references to the back buffer are released by clearing the render
00171             // target from the graphics pipeline state, and then flushing the Direct3D context.
00172             context.OutputMerger.ResetTargets();
00173             context.Flush();
00174         }
00175
00176         public void ReleaseAllDeviceResources(DeviceResources deviceResources)
00177         {
00178             ReleaseResourcesForBackBuffer(deviceResources);
00179             this.RemoveAndDispose(ref viewProjectionConstantBuffer);
00180         }
00181
00182         /// <summary>
00183         /// Updates the constant buffer for the display with view and projection
00184         /// matrices for the current frame.
00185         /// </summary>
00186         public void UpdateViewProjectionBuffer(
00187             DeviceResources         deviceResources,
00188             HolographicCameraPose   cameraPose,
00189             SpatialCoordinateSystem coordinateSystem
00190             )
00191         {
00192             // The system changes the viewport on a per-frame basis for system optimizations.
00193             d3dViewport.X           = (float)cameraPose.Viewport.Left;
00194             d3dViewport.Y           = (float)cameraPose.Viewport.Top;
00195             d3dViewport.Width       = (float)cameraPose.Viewport.Width;
00196             d3dViewport.Height      = (float)cameraPose.Viewport.Height;
00197             d3dViewport.MinDepth    = 0;
00198             d3dViewport.MaxDepth    = 1;
00199
00200             // The projection transform for each frame is provided by the HolographicCameraPose.
00201             HolographicStereoTransform cameraProjectionTransform = cameraPose.ProjectionTransform;
00202
00203             // Get a container object with the view and projection matrices for the given
00204             // pose in the given coordinate system.
00205             HolographicStereoTransform? viewTransformContainer = cameraPose.TryGetViewTransform(coordinateSystem);
00206
00207             // If TryGetViewTransform returns null, that means the pose and coordinate system
00208             // cannot be understood relative to one another; content cannot be rendered in this
00209             // coordinate system for the duration of the current frame.
00210             // This usually means that positional tracking is not active for the current frame, in
00211             // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
00212             // content that is not world-locked instead.
00213             ViewProjectionConstantBuffer viewProjectionConstantBufferData = new ViewProjectionConstantBuffer();
00214             bool viewTransformAcquired = viewTransformContainer.HasValue;
00215             if (viewTransformAcquired)
00216             {
00217                 // Otherwise, the set of view transforms can be retrieved.
00218                 HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer.Value;
00219
00220                 // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
00221                 // constantly moving relative to the world. The view matrices need to be updated
00222                 // every frame.
00223                 viewProjectionConstantBufferData.viewProjectionLeft  = Matrix4x4.Transpose(
00224                     viewCoordinateSystemTransform.Left * cameraProjectionTransform.Left
00225                     );
00226                 viewProjectionConstantBufferData.viewProjectionRight = Matrix4x4.Transpose(
00227                     viewCoordinateSystemTransform.Right * cameraProjectionTransform.Right
00228                     );
00229             }
00230
00231             // Use the D3D device context to update Direct3D device-based resources.
00232             var context = deviceResources.D3DDeviceContext;
00233
00234             // Loading is asynchronous. Resources must be created before they can be updated.
00235             if (context == null || viewProjectionConstantBuffer == null || !viewTransformAcquired)
00236             {
00237                 framePending = false;
00238             }
00239             else
00240             {
00241                 // Update the view and projection matrices.
00242                 context.UpdateSubresource(ref viewProjectionConstantBufferData, viewProjectionConstantBuffer);
00243
00244                 framePending = true;
00245             }
00246         }
00247
00248         /// <summary>
00249         /// Gets the view-projection constant buffer for the display, and attaches it
00250         /// to the shader pipeline.
00251         /// </summary>
00252         public bool AttachViewProjectionBuffer(DeviceResources deviceResources)
00253         {
00254             // This method uses Direct3D device-based resources.
00255             var context = deviceResources.D3DDeviceContext;
00256
00257             // Loading is asynchronous. Resources must be created before they can be updated.
00258             // Cameras can also be added asynchronously, in which case they must be initialized
00259             // before they can be used.
00260             if (context == null || viewProjectionConstantBuffer == null || !framePending)
00261             {
00262                 return false;
00263             }
00264
00265             // Set the viewport for this camera.
00266             context.Rasterizer.SetViewport(Viewport);
00267
00268             // Send the constant buffer to the vertex shader.
00269             context.VertexShader.SetConstantBuffers(1, viewProjectionConstantBuffer);
00270
00271             // The template includes a pass-through geometry shader that is used by
00272             // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
00273             // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
00274             // will be enabled at run-time on systems that require it.
00275             // If your app will also use the geometry shader for other tasks and those
00276             // tasks require the view/projection matrix, uncomment the following line
00277             // of code to send the constant buffer to the geometry shader as well.
00278             //context.GeometryShader.SetConstantBuffers(1, viewProjectionConstantBuffer);
00279
00280             framePending = false;
00281
00282             return true;
00283         }
00284
00285         // Direct3D device resources.
00286         public RenderTargetView BackBufferRenderTargetView
00287         {
00288             get { return d3dRenderTargetView;  }
00289         }
00290         public DepthStencilView DepthStencilView
00291         {
00292             get { return d3dDepthStencilView;  }
00293         }
00294         public Texture2D BackBufferTexture2D
00295         {
00296             get { return d3dBackBuffer;        }
00297         }
00298         public Texture2D DepthBufferTexture2D
00299         {
00300             get { return d3dDepthBuffer;       }
00301         }
00302
00303         // Render target properties.
00304         public RawViewportF Viewport
00305         {
00306             get { return d3dViewport;          }
00307         }
00308         public SharpDX.DXGI.Format BackBufferDxgiFormat
00309         {
00310             get { return dxgiFormat; }
00311         }
00312         public Size RenderTargetSize
00313         {
00314             get { return d3dRenderTargetSize;  }
00315         }
00316         public bool IsRenderingStereoscopic
00317         {
00318             get { return isStereo;             }
00319         }
00320
00321         // Associated objects.
00322         public HolographicCamera HolographicCamera
00323         {
00324             get { return holographicCamera;    }
00325         }
00326     }
00327 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cs/SampleConfiguration.cs Source File

  • Barometer
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Barometer C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Data Events", ClassType = typeof(Scenario1_DataEvents) },
00025             new Scenario() { Title = "Polling", ClassType = typeof(Scenario2_Polling) }
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
AddLogFileMessageDispatch(string message, string path) | Scenario2 | [inline]
AddMessage(string message) | Scenario2 | [inline]
AddMessageDispatch(string message) | Scenario2 | [inline]
AllItems | Scenario2 |
boundingRect | Scenario2 | [private]
ClearButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
ClearDrawnBoundingRect() | Scenario2 | [inline, private]
ClearSelection() | Scenario2 | [inline, private]
CreateHeaderTextBlock(string contents) | Scenario2 | [inline, private]
CreateLineItemTextBlock(string contents) | Scenario2 | [inline, private]
CreateOrUpdatePropertyPopUp(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
CurrentToolChanged(InkToolbar sender, object args) | Scenario2 | [inline, private]
DeleteMenuItem_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
dispatcherTimer | Scenario2 | [private]
DispatcherTimer_Tick(object sender, object e) | Scenario2 | [inline, private]
DisplayProperties_DpiChanged(DisplayInformation sender, object args) | Scenario2 | [inline, private]
DoScenario(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
DrawBoundingRect() | Scenario2 | [inline, private]
EnableDisableLogging(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
ExtractTextFromParagraph(InkAnalysisParagraph paragraph) | Scenario2 | [inline, private]
Find_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
FindHitParagraph(Point pt) | Scenario2 | [inline, private]
FindScrollViewer(DependencyObject depObject) | Scenario2 | [inline, private]
GetDataModelForCurrentListViewFlyout() | Scenario2 | [inline, private]
GetDeviceSpecificProperties(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
GetInstalledLocation_Click(Object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
GetMouseProperties(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
GetParent_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
GetPenProperties(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
GetPointerProperties(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
GetTextboxSelectionRect(TextBox textbox) | Scenario2 | [inline, private]
GetThumbnailButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
GetTouchProperties(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
GroupByHelperAsync(QueryOptions queryOptions) | Scenario2 | [inline, private]
GroupByMonthButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
GroupByRatingButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
GroupByTagButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
HidePropertyPopUp(Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
inkAnalyzer | Scenario2 | [private]
InkCanvas_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) | Scenario2 | [inline, private]
InkCanvas_Tapped(object sender, TappedRoutedEventArgs e) | Scenario2 | [inline, private]
inkPresenter | Scenario2 | [private]
InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) | Scenario2 | [inline, private]
InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) | Scenario2 | [inline, private]
InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) | Scenario2 | [inline, private]
isBoundRect | Scenario2 | [private]
lasso | Scenario2 | [private]
LassoSelect | Scenario2 | [private]
ListFoldersButton_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
LoggingSessionScenario | Scenario2 | [private]
LoggingSessionScenario_StatusChanged(object sender, LoggingScenarioEventArgs e) | Scenario2 | [inline, private]
mapBillboardAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mapBillboardStreamReference | Scenario2 | [private]
mapClearButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mapElement3DAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mapIconAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mapIconStreamReference | Scenario2 | [private]
mapModelStreamReference | Scenario2 | [private]
mapPolygonAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mapPolylineAddButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario2 | [inline, private]
mpiLogger | Scenario2 | [private]
msLogger | Scenario2 | [private]
MyMap_Loaded(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OnCopy(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OnCut(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2 | [inline, protected]
OnPaste(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario2 | [inline, private]
OpenMenuItem_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
OutputSettings(double rawPixelsPerViewPixel, FrameworkElement rectangle, TextBlock viewPxText, TextBlock rawPxText, TextBlock fontTextBlock) | Scenario2 | [inline, private]
paragraphSelected | Scenario2 | [private]
picturesLibrary | Scenario2 | [private]
Pointer_Entered(object sender, PointerRoutedEventArgs e) | Scenario2 | [inline, private]
Pointer_Moved(object sender, PointerRoutedEventArgs e) | Scenario2 | [inline, private]
Pointer_Pressed(object sender, PointerRoutedEventArgs e) | Scenario2 | [inline, private]
Pointer_Released(object sender, PointerRoutedEventArgs e) | Scenario2 | [inline, private]
Pointer_Wheel_Changed(object sender, PointerRoutedEventArgs e) | Scenario2 | [inline, private]
popups | Scenario2 | [private]
PrintMenuItem_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
PtFromPx(double pixel) | Scenario2 | [inline, private]
PxFromPt(double pt) | Scenario2 | [inline, private]
ReadOnlyTextBox_ContextMenuOpening(object sender, ContextMenuEventArgs e) | Scenario2 | [inline, private]
RenderPropertyPopUp(String pointerProperties, String deviceSpecificProperties, Windows.UI.Input.PointerPoint currentPoint) | Scenario2 | [inline, private]
ResetOutput() | Scenario2 | [inline, private]
rootPage | Scenario2 | [private]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
Scenario2() | Scenario2 | [inline]
StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args) | Scenario2 | [inline, private]
StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args) | Scenario2 | [inline, private]
Toggle_Custom(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
ToolButton_Lasso(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
TouchWriting | Scenario2 | [private]
UnprocessedInput_PointerMoved(InkUnprocessedInput sender, PointerEventArgs args) | Scenario2 | [inline, private]
UnprocessedInput_PointerPressed(InkUnprocessedInput sender, PointerEventArgs args) | Scenario2 | [inline, private]
UnprocessedInput_PointerReleased(InkUnprocessedInput sender, PointerEventArgs args) | Scenario2 | [inline, private]
UpdateControls() | Scenario2 | [inline, private]
UpdateHeaderText() | Scenario2 | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/Common/DeviceResources.cpp Source File

  • D2DPhotoAdjustment
  • cpp
  • Common

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DeviceResources.h"
00014 #include "DirectXHelper.h"
00015 #include <windows.ui.xaml.media.dxinterop.h>
00016
00017 using namespace D2D1;
00018 using namespace DirectX;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Graphics::Display;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Platform;
00025
00026 // Constants used to calculate screen rotations
00027 namespace ScreenRotation
00028 {
00029     // 0-degree Z-rotation
00030     static const XMFLOAT4X4 Rotation0(
00031         1.0f, 0.0f, 0.0f, 0.0f,
00032         0.0f, 1.0f, 0.0f, 0.0f,
00033         0.0f, 0.0f, 1.0f, 0.0f,
00034         0.0f, 0.0f, 0.0f, 1.0f
00035         );
00036
00037     // 90-degree Z-rotation
00038     static const XMFLOAT4X4 Rotation90(
00039         0.0f, 1.0f, 0.0f, 0.0f,
00040         -1.0f, 0.0f, 0.0f, 0.0f,
00041         0.0f, 0.0f, 1.0f, 0.0f,
00042         0.0f, 0.0f, 0.0f, 1.0f
00043         );
00044
00045     // 180-degree Z-rotation
00046     static const XMFLOAT4X4 Rotation180(
00047         -1.0f, 0.0f, 0.0f, 0.0f,
00048         0.0f, -1.0f, 0.0f, 0.0f,
00049         0.0f, 0.0f, 1.0f, 0.0f,
00050         0.0f, 0.0f, 0.0f, 1.0f
00051         );
00052
00053     // 270-degree Z-rotation
00054     static const XMFLOAT4X4 Rotation270(
00055         0.0f, -1.0f, 0.0f, 0.0f,
00056         1.0f, 0.0f, 0.0f, 0.0f,
00057         0.0f, 0.0f, 1.0f, 0.0f,
00058         0.0f, 0.0f, 0.0f, 1.0f
00059         );
00060 };
00061
00062 // Constructor for DeviceResources.
00063 DX::DeviceResources::DeviceResources() :
00064     m_screenViewport(),
00065     m_d3dFeatureLevel(D3D_FEATURE_LEVEL_9_1),
00066     m_d3dRenderTargetSize(),
00067     m_outputSize(),
00068     m_logicalSize(),
00069     m_nativeOrientation(DisplayOrientations::None),
00070     m_currentOrientation(DisplayOrientations::None),
00071     m_dpi(-1.0f),
00072     m_compositionScaleX(1.0f),
00073     m_compositionScaleY(1.0f),
00074     m_deviceNotify(nullptr)
00075 {
00076     CreateDeviceIndependentResources();
00077     CreateDeviceResources();
00078 }
00079
00080 // Configures resources that don't depend on the Direct3D device.
00081 void DX::DeviceResources::CreateDeviceIndependentResources()
00082 {
00083     // Initialize Direct2D resources.
00084     D2D1_FACTORY_OPTIONS options;
00085     ZeroMemory(&options, sizeof(options));
00086
00087 #if defined(_DEBUG)
00088     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00089     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00090 #endif
00091
00092     // Initialize the Direct2D Factory.
00093     DX::ThrowIfFailed(
00094         D2D1CreateFactory(
00095             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00096             __uuidof(ID2D1Factory2),
00097             &options,
00098             &m_d2dFactory
00099             )
00100         );
00101
00102     // Initialize the DirectWrite Factory.
00103     DX::ThrowIfFailed(
00104         DWriteCreateFactory(
00105             DWRITE_FACTORY_TYPE_SHARED,
00106             __uuidof(IDWriteFactory2),
00107             &m_dwriteFactory
00108             )
00109         );
00110
00111     // Initialize the Windows Imaging Component (WIC) Factory.
00112     DX::ThrowIfFailed(
00113         CoCreateInstance(
00114             CLSID_WICImagingFactory2,
00115             nullptr,
00116             CLSCTX_INPROC_SERVER,
00117             IID_PPV_ARGS(&m_wicFactory)
00118             )
00119         );
00120 }
00121
00122 // Configures the Direct3D device, and stores handles to it and the device context.
00123 void DX::DeviceResources::CreateDeviceResources()
00124 {
00125     // This flag adds support for surfaces with a different color channel ordering
00126     // than the API default. It is required for compatibility with Direct2D.
00127     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00128
00129 #if defined(_DEBUG)
00130     if (DX::SdkLayersAvailable())
00131     {
00132         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00133         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00134     }
00135 #endif
00136
00137     // This array defines the set of DirectX hardware feature levels this app will support.
00138     // Note the ordering should be preserved.
00139     // Don't forget to declare your application's minimum required feature level in its
00140     // description.  All applications are assumed to support 9.1 unless otherwise stated.
00141     D3D_FEATURE_LEVEL featureLevels[] =
00142     {
00143         D3D_FEATURE_LEVEL_11_1,
00144         D3D_FEATURE_LEVEL_11_0,
00145         D3D_FEATURE_LEVEL_10_1,
00146         D3D_FEATURE_LEVEL_10_0,
00147         D3D_FEATURE_LEVEL_9_3,
00148         D3D_FEATURE_LEVEL_9_2,
00149         D3D_FEATURE_LEVEL_9_1
00150     };
00151
00152     // Create the Direct3D 11 API device object and a corresponding context.
00153     ComPtr<ID3D11Device> device;
00154     ComPtr<ID3D11DeviceContext> context;
00155
00156     HRESULT hr = D3D11CreateDevice(
00157         nullptr,                    // Specify nullptr to use the default adapter.
00158         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00159         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00160         creationFlags,              // Set debug and Direct2D compatibility flags.
00161         featureLevels,              // List of feature levels this app can support.
00162         ARRAYSIZE(featureLevels),   // Size of the list above.
00163         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00164         &device,                    // Returns the Direct3D device created.
00165         &m_d3dFeatureLevel,         // Returns feature level of device created.
00166         &context                    // Returns the device immediate context.
00167         );
00168
00169     if (FAILED(hr))
00170     {
00171         // If the initialization fails, fall back to the WARP device.
00172         // For more information on WARP, see:
00173         // http://go.microsoft.com/fwlink/?LinkId=286690
00174         DX::ThrowIfFailed(
00175             D3D11CreateDevice(
00176                 nullptr,
00177                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00178                 0,
00179                 creationFlags,
00180                 featureLevels,
00181                 ARRAYSIZE(featureLevels),
00182                 D3D11_SDK_VERSION,
00183                 &device,
00184                 &m_d3dFeatureLevel,
00185                 &context
00186                 )
00187             );
00188     }
00189
00190     // Store pointers to the Direct3D 11.1 API device and immediate context.
00191     DX::ThrowIfFailed(
00192         device.As(&m_d3dDevice)
00193         );
00194
00195     DX::ThrowIfFailed(
00196         context.As(&m_d3dContext)
00197         );
00198
00199     // Create the Direct2D device object and a corresponding context.
00200     ComPtr<IDXGIDevice3> dxgiDevice;
00201     DX::ThrowIfFailed(
00202         m_d3dDevice.As(&dxgiDevice)
00203         );
00204
00205     DX::ThrowIfFailed(
00206         m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
00207         );
00208
00209     DX::ThrowIfFailed(
00210         m_d2dDevice->CreateDeviceContext(
00211             D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
00212             &m_d2dContext
00213             )
00214         );
00215 }
00216
00217 // These resources need to be recreated every time the window size is changed.
00218 void DX::DeviceResources::CreateWindowSizeDependentResources()
00219 {
00220     // Clear the previous window size specific context.
00221     ID3D11RenderTargetView* nullViews[] = {nullptr};
00222     m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00223     m_d3dRenderTargetView = nullptr;
00224     m_d2dContext->SetTarget(nullptr);
00225     m_d2dTargetBitmap = nullptr;
00226     m_d3dDepthStencilView = nullptr;
00227     m_d3dContext->Flush();
00228
00229     // Calculate the necessary swap chain and render target size in pixels.
00230     m_outputSize.Width = m_logicalSize.Width * m_compositionScaleX;
00231     m_outputSize.Height = m_logicalSize.Height * m_compositionScaleY;
00232
00233     // Prevent zero size DirectX content from being created.
00234     m_outputSize.Width = max(m_outputSize.Width, 1);
00235     m_outputSize.Height = max(m_outputSize.Height, 1);
00236
00237     // The width and height of the swap chain must be based on the window's
00238     // natively-oriented width and height. If the window is not in the native
00239     // orientation, the dimensions must be reversed.
00240     DXGI_MODE_ROTATION displayRotation = ComputeDisplayRotation();
00241
00242     bool swapDimensions = displayRotation == DXGI_MODE_ROTATION_ROTATE90 || displayRotation == DXGI_MODE_ROTATION_ROTATE270;
00243     m_d3dRenderTargetSize.Width = swapDimensions ? m_outputSize.Height : m_outputSize.Width;
00244     m_d3dRenderTargetSize.Height = swapDimensions ? m_outputSize.Width : m_outputSize.Height;
00245
00246     if (m_swapChain != nullptr)
00247     {
00248         // If the swap chain already exists, resize it.
00249         HRESULT hr = m_swapChain->ResizeBuffers(
00250             2, // Double-buffered swap chain.
00251             lround(m_d3dRenderTargetSize.Width),
00252             lround(m_d3dRenderTargetSize.Height),
00253             DXGI_FORMAT_B8G8R8A8_UNORM,
00254             0
00255             );
00256
00257         if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00258         {
00259             // If the device was removed for any reason, a new device and swap chain will need to be created.
00260             HandleDeviceLost();
00261
00262             // Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method
00263             // and correctly set up the new device.
00264             return;
00265         }
00266         else
00267         {
00268             DX::ThrowIfFailed(hr);
00269         }
00270     }
00271     else
00272     {
00273         // Otherwise, create a new one using the same adapter as the existing Direct3D device.
00274         DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
00275
00276         swapChainDesc.Width = lround(m_d3dRenderTargetSize.Width); // Match the size of the window.
00277         swapChainDesc.Height = lround(m_d3dRenderTargetSize.Height);
00278         swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
00279         swapChainDesc.Stereo = false;
00280         swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
00281         swapChainDesc.SampleDesc.Quality = 0;
00282         swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
00283         swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
00284         swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Runtime apps must use this SwapEffect.
00285         swapChainDesc.Flags = 0;
00286         swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
00287         swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
00288
00289         // This sequence obtains the DXGI factory that was used to create the Direct3D device above.
00290         ComPtr<IDXGIDevice3> dxgiDevice;
00291         DX::ThrowIfFailed(
00292             m_d3dDevice.As(&dxgiDevice)
00293             );
00294
00295         ComPtr<IDXGIAdapter> dxgiAdapter;
00296         DX::ThrowIfFailed(
00297             dxgiDevice->GetAdapter(&dxgiAdapter)
00298             );
00299
00300         ComPtr<IDXGIFactory2> dxgiFactory;
00301         DX::ThrowIfFailed(
00302             dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
00303             );
00304
00305         // When using XAML interop, the swap chain must be created for composition.
00306         DX::ThrowIfFailed(
00307             dxgiFactory->CreateSwapChainForComposition(
00308                 m_d3dDevice.Get(),
00309                 &swapChainDesc,
00310                 nullptr,
00311                 &m_swapChain
00312                 )
00313             );
00314
00315         // Associate the swap chain with SwapChainPanel.
00316         // UI changes will need to be dispatched back to the UI thread.
00317         m_swapChainPanel->Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([=]()
00318         {
00319             // Get backing native interface for SwapChainPanel.
00320             ComPtr<ISwapChainPanelNative> panelNative;
00321             DX::ThrowIfFailed(
00322                 reinterpret_cast<IUnknown*>(m_swapChainPanel)->QueryInterface(IID_PPV_ARGS(&panelNative))
00323                 );
00324
00325             DX::ThrowIfFailed(
00326                 panelNative->SetSwapChain(m_swapChain.Get())
00327                 );
00328         }, CallbackContext::Any));
00329
00330         // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
00331         // ensures that the application will only render after each VSync, minimizing power consumption.
00332         DX::ThrowIfFailed(
00333             dxgiDevice->SetMaximumFrameLatency(1)
00334             );
00335     }
00336
00337     // Set the proper orientation for the swap chain, and generate 2D and
00338     // 3D matrix transformations for rendering to the rotated swap chain.
00339     // Note the rotation angle for the 2D and 3D transforms are different.
00340     // This is due to the difference in coordinate spaces.  Additionally,
00341     // the 3D matrix is specified explicitly to avoid rounding errors.
00342
00343     switch (displayRotation)
00344     {
00345     case DXGI_MODE_ROTATION_IDENTITY:
00346         m_orientationTransform2D = Matrix3x2F::Identity();
00347         m_orientationTransform3D = ScreenRotation::Rotation0;
00348         break;
00349
00350     case DXGI_MODE_ROTATION_ROTATE90:
00351         m_orientationTransform2D =
00352             Matrix3x2F::Rotation(90.0f) *
00353             Matrix3x2F::Translation(m_logicalSize.Height, 0.0f);
00354         m_orientationTransform3D = ScreenRotation::Rotation270;
00355         break;
00356
00357     case DXGI_MODE_ROTATION_ROTATE180:
00358         m_orientationTransform2D =
00359             Matrix3x2F::Rotation(180.0f) *
00360             Matrix3x2F::Translation(m_logicalSize.Width, m_logicalSize.Height);
00361         m_orientationTransform3D = ScreenRotation::Rotation180;
00362         break;
00363
00364     case DXGI_MODE_ROTATION_ROTATE270:
00365         m_orientationTransform2D =
00366             Matrix3x2F::Rotation(270.0f) *
00367             Matrix3x2F::Translation(0.0f, m_logicalSize.Width);
00368         m_orientationTransform3D = ScreenRotation::Rotation90;
00369         break;
00370
00371     default:
00372         throw ref new FailureException();
00373     }
00374
00375     DX::ThrowIfFailed(
00376         m_swapChain->SetRotation(displayRotation)
00377         );
00378
00379     // Set an inverse scale on the swap chain.
00380     DXGI_MATRIX_3X2_F inverseScale = { 0 };
00381     inverseScale._11 = 1.0f / m_compositionScaleX;
00382     inverseScale._22 = 1.0f / m_compositionScaleY;
00383     ComPtr<IDXGISwapChain2> spSwapChain2;
00384     DX::ThrowIfFailed(
00385         m_swapChain.As<IDXGISwapChain2>(&spSwapChain2)
00386         );
00387
00388     DX::ThrowIfFailed(
00389         spSwapChain2->SetMatrixTransform(&inverseScale)
00390         );
00391
00392
00393     // Create a render target view of the swap chain back buffer.
00394     ComPtr<ID3D11Texture2D> backBuffer;
00395     DX::ThrowIfFailed(
00396         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
00397         );
00398
00399     DX::ThrowIfFailed(
00400         m_d3dDevice->CreateRenderTargetView(
00401             backBuffer.Get(),
00402             nullptr,
00403             &m_d3dRenderTargetView
00404             )
00405         );
00406
00407     // Create a depth stencil view for use with 3D rendering if needed.
00408     CD3D11_TEXTURE2D_DESC depthStencilDesc(
00409         DXGI_FORMAT_D24_UNORM_S8_UINT,
00410         lround(m_d3dRenderTargetSize.Width),
00411         lround(m_d3dRenderTargetSize.Height),
00412         1, // This depth stencil view has only one texture.
00413         1, // Use a single mipmap level.
00414         D3D11_BIND_DEPTH_STENCIL
00415         );
00416
00417     ComPtr<ID3D11Texture2D> depthStencil;
00418     DX::ThrowIfFailed(
00419         m_d3dDevice->CreateTexture2D(
00420             &depthStencilDesc,
00421             nullptr,
00422             &depthStencil
00423             )
00424         );
00425
00426     CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
00427     DX::ThrowIfFailed(
00428         m_d3dDevice->CreateDepthStencilView(
00429             depthStencil.Get(),
00430             &depthStencilViewDesc,
00431             &m_d3dDepthStencilView
00432             )
00433         );
00434
00435     // Set the 3D rendering viewport to target the entire window.
00436     m_screenViewport = CD3D11_VIEWPORT(
00437         0.0f,
00438         0.0f,
00439         m_d3dRenderTargetSize.Width,
00440         m_d3dRenderTargetSize.Height
00441         );
00442
00443     m_d3dContext->RSSetViewports(1, &m_screenViewport);
00444
00445     // Create a Direct2D target bitmap associated with the
00446     // swap chain back buffer and set it as the current target.
00447     D2D1_BITMAP_PROPERTIES1 bitmapProperties =
00448         D2D1::BitmapProperties1(
00449             D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
00450             D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00451             m_dpi,
00452             m_dpi
00453             );
00454
00455     ComPtr<IDXGISurface2> dxgiBackBuffer;
00456     DX::ThrowIfFailed(
00457         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
00458         );
00459
00460     DX::ThrowIfFailed(
00461         m_d2dContext->CreateBitmapFromDxgiSurface(
00462             dxgiBackBuffer.Get(),
00463             &bitmapProperties,
00464             &m_d2dTargetBitmap
00465             )
00466         );
00467
00468     m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
00469
00470     // Grayscale text anti-aliasing is recommended for all Windows Runtime apps.
00471     m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
00472 }
00473
00474 // This method is called when the XAML control is created (or re-created).
00475 void DX::DeviceResources::SetSwapChainPanel(SwapChainPanel^ panel)
00476 {
00477     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00478
00479     m_swapChainPanel = panel;
00480     m_logicalSize = Windows::Foundation::Size(static_cast<float>(panel->ActualWidth), static_cast<float>(panel->ActualHeight));
00481     m_nativeOrientation = currentDisplayInformation->NativeOrientation;
00482     m_currentOrientation = currentDisplayInformation->CurrentOrientation;
00483     m_compositionScaleX = panel->CompositionScaleX;
00484     m_compositionScaleY = panel->CompositionScaleY;
00485     m_dpi = currentDisplayInformation->LogicalDpi;
00486     m_d2dContext->SetDpi(m_dpi, m_dpi);
00487
00488     CreateWindowSizeDependentResources();
00489 }
00490
00491 // This method is called in the event handler for the SizeChanged event.
00492 void DX::DeviceResources::SetLogicalSize(Windows::Foundation::Size logicalSize)
00493 {
00494     if (m_logicalSize != logicalSize)
00495     {
00496         m_logicalSize = logicalSize;
00497         CreateWindowSizeDependentResources();
00498     }
00499 }
00500
00501 // This method is called in the event handler for the DpiChanged event.
00502 void DX::DeviceResources::SetDpi(float dpi)
00503 {
00504     if (dpi != m_dpi)
00505     {
00506         m_dpi = dpi;
00507
00508         m_d2dContext->SetDpi(m_dpi, m_dpi);
00509         CreateWindowSizeDependentResources();
00510     }
00511 }
00512
00513 // This method is called in the event handler for the OrientationChanged event.
00514 void DX::DeviceResources::SetCurrentOrientation(DisplayOrientations currentOrientation)
00515 {
00516     if (m_currentOrientation != currentOrientation)
00517     {
00518         m_currentOrientation = currentOrientation;
00519         CreateWindowSizeDependentResources();
00520     }
00521 }
00522
00523 // This method is called in the event handler for the CompositionScaleChanged event.
00524 void DX::DeviceResources::SetCompositionScale(float compositionScaleX, float compositionScaleY)
00525 {
00526     if (m_compositionScaleX != compositionScaleX ||
00527         m_compositionScaleY != compositionScaleY)
00528     {
00529         m_compositionScaleX = compositionScaleX;
00530         m_compositionScaleY = compositionScaleY;
00531         CreateWindowSizeDependentResources();
00532     }
00533 }
00534
00535 // This method is called in the event handler for the DisplayContentsInvalidated event.
00536 void DX::DeviceResources::ValidateDevice()
00537 {
00538     // The D3D Device is no longer valid if the default adapter changed since the device
00539     // was created or if the device has been removed.
00540
00541     // First, get the information for the default adapter from when the device was created.
00542
00543     ComPtr<IDXGIDevice3> dxgiDevice;
00544     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00545
00546     ComPtr<IDXGIAdapter> deviceAdapter;
00547     DX::ThrowIfFailed(dxgiDevice->GetAdapter(&deviceAdapter));
00548
00549     ComPtr<IDXGIFactory2> deviceFactory;
00550     DX::ThrowIfFailed(deviceAdapter->GetParent(IID_PPV_ARGS(&deviceFactory)));
00551
00552     ComPtr<IDXGIAdapter1> previousDefaultAdapter;
00553     DX::ThrowIfFailed(deviceFactory->EnumAdapters1(0, &previousDefaultAdapter));
00554
00555     DXGI_ADAPTER_DESC previousDesc;
00556     DX::ThrowIfFailed(previousDefaultAdapter->GetDesc(&previousDesc));
00557
00558     // Next, get the information for the current default adapter.
00559
00560     ComPtr<IDXGIFactory2> currentFactory;
00561     DX::ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&currentFactory)));
00562
00563     ComPtr<IDXGIAdapter1> currentDefaultAdapter;
00564     DX::ThrowIfFailed(currentFactory->EnumAdapters1(0, &currentDefaultAdapter));
00565
00566     DXGI_ADAPTER_DESC currentDesc;
00567     DX::ThrowIfFailed(currentDefaultAdapter->GetDesc(&currentDesc));
00568
00569     // If the adapter LUIDs don't match, or if the device reports that it has been removed,
00570     // a new D3D device must be created.
00571
00572     if (previousDesc.AdapterLuid.LowPart != currentDesc.AdapterLuid.LowPart ||
00573         previousDesc.AdapterLuid.HighPart != currentDesc.AdapterLuid.HighPart ||
00574         FAILED(m_d3dDevice->GetDeviceRemovedReason()))
00575     {
00576         // Release references to resources related to the old device.
00577         dxgiDevice = nullptr;
00578         deviceAdapter = nullptr;
00579         deviceFactory = nullptr;
00580         previousDefaultAdapter = nullptr;
00581
00582         // Create a new device and swap chain.
00583         HandleDeviceLost();
00584     }
00585 }
00586
00587 // Recreate all device resources and set them back to the current state.
00588 void DX::DeviceResources::HandleDeviceLost()
00589 {
00590     m_swapChain = nullptr;
00591
00592     if (m_deviceNotify != nullptr)
00593     {
00594         m_deviceNotify->OnDeviceLost();
00595     }
00596
00597     CreateDeviceResources();
00598     m_d2dContext->SetDpi(m_dpi, m_dpi);
00599     CreateWindowSizeDependentResources();
00600
00601     if (m_deviceNotify != nullptr)
00602     {
00603         m_deviceNotify->OnDeviceRestored();
00604     }
00605 }
00606
00607 // Register our DeviceNotify to be informed on device lost and creation.
00608 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00609 {
00610     m_deviceNotify = deviceNotify;
00611 }
00612
00613 // Call this method when the app suspends. It provides a hint to the driver that the app
00614 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00615 void DX::DeviceResources::Trim()
00616 {
00617     ComPtr<IDXGIDevice3> dxgiDevice;
00618     m_d3dDevice.As(&dxgiDevice);
00619
00620     dxgiDevice->Trim();
00621 }
00622
00623 // Present the contents of the swap chain to the screen.
00624 void DX::DeviceResources::Present()
00625 {
00626     // The first argument instructs DXGI to block until VSync, putting the application
00627     // to sleep until the next VSync. This ensures we don't waste any cycles rendering
00628     // frames that will never be displayed to the screen.
00629     HRESULT hr = m_swapChain->Present(1, 0);
00630
00631     // Discard the contents of the render target.
00632     // This is a valid operation only when the existing contents will be entirely
00633     // overwritten. If dirty or scroll rects are used, this call should be removed.
00634     m_d3dContext->DiscardView(m_d3dRenderTargetView.Get());
00635
00636     // Discard the contents of the depth stencil.
00637     m_d3dContext->DiscardView(m_d3dDepthStencilView.Get());
00638
00639     // If the device was removed either by a disconnection or a driver upgrade, we
00640     // must recreate all device resources.
00641     if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00642     {
00643         HandleDeviceLost();
00644     }
00645     else
00646     {
00647         DX::ThrowIfFailed(hr);
00648     }
00649 }
00650
00651 // This method determines the rotation between the display device's native Orientation and the
00652 // current display orientation.
00653 DXGI_MODE_ROTATION DX::DeviceResources::ComputeDisplayRotation()
00654 {
00655     DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
00656
00657     // Note: NativeOrientation can only be Landscape or Portrait even though
00658     // the DisplayOrientations enum has other values.
00659     switch (m_nativeOrientation)
00660     {
00661     case DisplayOrientations::Landscape:
00662         switch (m_currentOrientation)
00663         {
00664         case DisplayOrientations::Landscape:
00665             rotation = DXGI_MODE_ROTATION_IDENTITY;
00666             break;
00667
00668         case DisplayOrientations::Portrait:
00669             rotation = DXGI_MODE_ROTATION_ROTATE270;
00670             break;
00671
00672         case DisplayOrientations::LandscapeFlipped:
00673             rotation = DXGI_MODE_ROTATION_ROTATE180;
00674             break;
00675
00676         case DisplayOrientations::PortraitFlipped:
00677             rotation = DXGI_MODE_ROTATION_ROTATE90;
00678             break;
00679         }
00680         break;
00681
00682     case DisplayOrientations::Portrait:
00683         switch (m_currentOrientation)
00684         {
00685         case DisplayOrientations::Landscape:
00686             rotation = DXGI_MODE_ROTATION_ROTATE90;
00687             break;
00688
00689         case DisplayOrientations::Portrait:
00690             rotation = DXGI_MODE_ROTATION_IDENTITY;
00691             break;
00692
00693         case DisplayOrientations::LandscapeFlipped:
00694             rotation = DXGI_MODE_ROTATION_ROTATE270;
00695             break;
00696
00697         case DisplayOrientations::PortraitFlipped:
00698             rotation = DXGI_MODE_ROTATION_ROTATE180;
00699             break;
00700         }
00701         break;
00702     }
00703     return rotation;
00704 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/SampleConfiguration.cs Source File

  • MultipleViews
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SecondaryViewsHelpers;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Collections.ObjectModel;
00016 using Windows.ApplicationModel.Activation;
00017 using Windows.UI.Core;
00018 using Windows.UI.ViewManagement;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021
00022 namespace SDKTemplate
00023 {
00024     public partial class MainPage
00025     {
00026         public const string FEATURE_NAME = "Multiple Views";
00027
00028         List<Scenario> scenarios = new List<Scenario>
00029         {
00030             new Scenario() { Title = "Creating and showing multiple views", ClassType = typeof(Scenario1) },
00031             new Scenario() { Title = "Using animations when switching",     ClassType = typeof(Scenario3) }
00032         };
00033     }
00034
00035     public class Scenario
00036     {
00037         public string Title { get; set; }
00038
00039         public Type ClassType { get; set; }
00040
00041         public override string ToString()
00042         {
00043             return Title;
00044         }
00045     }
00046
00047     public partial class App
00048     {
00049         partial void OverrideOnLaunched(LaunchActivatedEventArgs args, ref bool handled)
00050         {
00051             // Check if a secondary view is supposed to be shown
00052             ViewLifetimeControl ViewLifetimeControl;
00053             handled = TryFindViewLifetimeControlForViewId(args.CurrentlyShownApplicationViewId, out ViewLifetimeControl);
00054             if (handled)
00055             {
00056                 var task = ViewLifetimeControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00057                 {
00058                     Window.Current.Activate();
00059                 });
00060             }
00061         }
00062
00063         partial void InitializeRootFrame(Frame frame)
00064         {
00065             mainDispatcher = Window.Current.Dispatcher;
00066             mainViewId = ApplicationView.GetForCurrentView().Id;
00067         }
00068
00069         protected async override void OnActivated(IActivatedEventArgs args)
00070         {
00071             if (args.Kind == ActivationKind.Protocol)
00072             {
00073                 var protocolArgs = (ProtocolActivatedEventArgs)args;
00074                 // Find out which window the system chose to display
00075                 // Unless you've set DisableShowingMainViewOnActivation,
00076                 // it will always be your most recent view.
00077                 ViewLifetimeControl ViewLifetimeControl;
00078                 if (TryFindViewLifetimeControlForViewId(protocolArgs.CurrentlyShownApplicationViewId, out ViewLifetimeControl))
00079                 {
00080                     await ViewLifetimeControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00081                     {
00082                         var currentPage = (SecondaryViewPage)((Frame)Window.Current.Content).Content;
00083                         currentPage.HandleProtocolLaunch(protocolArgs.Uri);
00084                         Window.Current.Activate();
00085                     });
00086                 }
00087                 else
00088                 {
00089                     // We don't have the specified view in the collection, likely because it's the main view
00090                     // that got shown. Set up the main view to display.
00091                     InitializeMainPage(args.PreviousExecutionState, "");
00092                     var rootPage = (MainPage)((Frame)Window.Current.Content).Content;
00093                     ((ListBox)rootPage.FindName("Scenarios")).SelectedIndex = 1;
00094                     rootPage.NotifyUser("Main window was launched with protocol: " + protocolArgs.Uri.AbsoluteUri,
00095                                         NotifyType.StatusMessage);
00096                     Window.Current.Activate();
00097                 }
00098             }
00099         }
00100
00101         public ObservableCollection<ViewLifetimeControl> SecondaryViews = new ObservableCollection<ViewLifetimeControl>();
00102
00103         // This method is designed to always be run on the thread that's
00104         // binding to the list above
00105         public void UpdateTitle(String newTitle, int viewId)
00106         {
00107             ViewLifetimeControl foundData;
00108             if (TryFindViewLifetimeControlForViewId(viewId, out foundData))
00109             {
00110                 foundData.Title = newTitle;
00111             }
00112             else
00113             {
00114                 throw new KeyNotFoundException("Couldn't find the view ID in the collection");
00115             }
00116         }
00117
00118         // Loop through the collection to find the view ID
00119         // This should only be run on the main thread.
00120         bool TryFindViewLifetimeControlForViewId(int viewId, out ViewLifetimeControl foundData)
00121         {
00122             foreach (var ViewLifetimeControl in SecondaryViews)
00123             {
00124                 if (ViewLifetimeControl.Id == viewId)
00125                 {
00126                     foundData = ViewLifetimeControl;
00127                     return true;
00128                 }
00129             }
00130             foundData = null;
00131             return false;
00132         }
00133
00134         private CoreDispatcher mainDispatcher;
00135         public CoreDispatcher MainDispatcher
00136         {
00137             get
00138             {
00139                 return mainDispatcher;
00140             }
00141         }
00142
00143         private int mainViewId;
00144         public int MainViewId
00145         {
00146             get
00147             {
00148                 return mainViewId;
00149             }
00150         }
00151
00152     }
00153 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

D2DGradientMeshRenderer Member List

This is the complete list of members for D2DGradientMeshRenderer, including all inherited members.
CreateDeviceDependentResources() | D2DGradientMeshRenderer |
CreateWindowSizeDependentResources() | D2DGradientMeshRenderer |
D2DGradientMeshRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | D2DGradientMeshRenderer |
m_deviceResources | D2DGradientMeshRenderer | [private]
m_gradientMesh | D2DGradientMeshRenderer | [private]
ReleaseDeviceDependentResources() | D2DGradientMeshRenderer |
Render() | D2DGradientMeshRenderer |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_XmlWriter Member List

This is the complete list of members for Scenario2_XmlWriter, including all inherited members.
DoSomething_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario2_XmlWriter |
Scenario2_XmlWriter() | Scenario2_XmlWriter |
WriteXml(com_ptr< IStream > const &writeStream) | Scenario2_XmlWriter | [private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/App.xaml.cpp Source File

  • BackButton
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::ApplicationModel;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Primitives;
00026 using namespace Windows::UI::Xaml::Data;
00027 using namespace Windows::UI::Xaml::Input;
00028 using namespace Windows::UI::Xaml::Interop;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00033
00034 /// <summary>
00035 /// Initializes the singleton application object.  This is the first line of authored code
00036 /// executed, and as such is the logical equivalent of main() or WinMain().
00037 /// </summary>
00038 App::App()
00039 {
00040     InitializeComponent();
00041     Suspending += ref new Windows::UI::Xaml::SuspendingEventHandler(this, &SDKTemplate::App::OnSuspending);
00042 }
00043
00044 /// <summary>
00045 /// Invoked when the application is launched normally by the end user.  Other entry points
00046 /// will be used such as when the application is launched to open a specific file.
00047 /// </summary>
00048 /// <param name="e">Details about the launch request and process.</param>
00049 void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
00050 {
00051 #if _DEBUG
00052     // Show graphics profiling information while debugging.
00053     if (IsDebuggerPresent())
00054     {
00055         // Display the current frame rate counters
00056         DebugSettings->EnableFrameRateCounter = false;
00057     }
00058 #endif
00059
00060     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00061
00062     // Do not repeat app initialization when the Window already has content,
00063     // just ensure that the window is active
00064     if (rootFrame == nullptr)
00065     {
00066         // Create a Frame to act as the navigation context and associate it with
00067         // a SuspensionManager key
00068         rootFrame = ref new Frame();
00069
00070         // Set the default language
00071         rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
00072
00073         rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00074
00075         if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00076         {
00077             // TODO: Restore the saved session state only when appropriate, scheduling the
00078             // final launch steps after the restore is complete
00079         }
00080
00081         if (rootFrame->Content == nullptr)
00082         {
00083             // When the navigation stack isn't restored navigate to the first page,
00084             // configuring the new page by passing required information as a navigation
00085             // parameter
00086             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00087         }
00088         // Place the frame in the current Window
00089         Window::Current->Content = rootFrame;
00090
00091         // Register a global back event handler. This can be registered on a per-page-bases if you only have a subset of your pages
00092         // that needs to handle back or if you want to do page-specific logic before deciding to navigate back on those pages.
00093         SystemNavigationManager::GetForCurrentView()->BackRequested += ref new EventHandler<BackRequestedEventArgs^>(this, &App::App_BackRequested);
00094
00095         // Ensure the current window is active
00096         Window::Current->Activate();
00097     }
00098     else
00099     {
00100         if (rootFrame->Content == nullptr)
00101         {
00102             // When the navigation stack isn't restored navigate to the first page,
00103             // configuring the new page by passing required information as a navigation
00104             // parameter
00105             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00106         }
00107         // Ensure the current window is active
00108         Window::Current->Activate();
00109   }
00110 }
00111
00112 /// <summary>
00113 /// Invoked when application execution is being suspended.  Application state is saved
00114 /// without knowing whether the application will be terminated or resumed with the contents
00115 /// of memory still intact.
00116 /// </summary>
00117 /// <param name="sender">The source of the suspend request.</param>
00118 /// <param name="e">Details about the suspend request.</param>
00119 void App::OnSuspending(Object^ /* sender */, SuspendingEventArgs^ /* e */)
00120 {
00121     //TODO: Save application state and stop any background activity
00122 }
00123
00124 /// <summary>
00125 /// Invoked when a user issues a global back on the device.
00126 /// If the app has no in-app back stack left for the current view/frame the user may be navigated away
00127 /// back to the previous app in the system's app back stack or to the start screen.
00128 /// In windowed mode on desktop there is no system app back stack and the user will stay in the app even when the in-app back stack is depleted.
00129 /// </summary>
00130 /// <param name="sender"></param>
00131 /// <param name="e"></param>
00132 void App::App_BackRequested(Platform::Object^ /* sender */, BackRequestedEventArgs^ e)
00133 {
00134     auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content);
00135     if (rootFrame == nullptr)
00136     {
00137         return;
00138     }
00139
00140     // If we can go back and the event has not already been handled, do so.
00141     if (rootFrame->CanGoBack && e->Handled == false)
00142     {
00143         e->Handled = true;
00144         rootFrame->GoBack();
00145     }
00146 }
00147
00148 /// <summary>
00149 /// Invoked when Navigation to a certain page fails
00150 /// </summary>
00151 /// <param name="sender">The Frame which failed navigation</param>
00152 /// <param name="e">Details about the navigation failure</param>
00153 void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
00154 {
00155     throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
00156 }
Generated on Fri Nov 15 2024 22:16:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_CustomFilterAddedProps Member List

This is the complete list of members for Scenario6_CustomFilterAddedProps, including all inherited members.
deviceWatcherHelper | Scenario6_CustomFilterAddedProps | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario6_CustomFilterAddedProps | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario6_CustomFilterAddedProps | [inline, protected]
resultCollection | Scenario6_CustomFilterAddedProps | [private]
rootPage | Scenario6_CustomFilterAddedProps | [private]
Scenario6_CustomFilterAddedProps() | Scenario6_CustomFilterAddedProps | [inline]
StartWatcher() | Scenario6_CustomFilterAddedProps | [inline, private]
StartWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario6_CustomFilterAddedProps | [inline, private]
StopWatcher() | Scenario6_CustomFilterAddedProps | [inline, private]
StopWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario6_CustomFilterAddedProps | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Syndication/cs/SampleConfiguration.cs Source File

  • Syndication
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using Syndication;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Syndication";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title = "Get Feed", ClassType = typeof(S1_GetAFeed) }
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032
00033         public Type ClassType { get; set; }
00034
00035         public override string ToString()
00036         {
00037             return Title;
00038         }
00039     }
00040 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmsSendAndReceive/cs/SmsBackgroundTask/Properties/AssemblyInfo.cs Source File

  • SmsSendAndReceive
  • cs
  • SmsBackgroundTask
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 using System.Reflection;
00014 using System.Runtime.CompilerServices;
00015 using System.Runtime.InteropServices;
00016
00017 // General Information about an assembly is controlled through the following
00018 // set of attributes. Change these attribute values to modify the information
00019 // associated with an assembly.
00020 [assembly: AssemblyTitle("SmsBackgroundTask")]
00021 [assembly: AssemblyDescription("")]
00022 [assembly: AssemblyConfiguration("")]
00023 [assembly: AssemblyCompany("")]
00024 [assembly: AssemblyProduct("SmsBackgroundTask")]
00025 [assembly: AssemblyCopyright("Copyright ©  2015")]
00026 [assembly: AssemblyTrademark("")]
00027 [assembly: AssemblyCulture("")]
00028
00029 // Version information for an assembly consists of the following four values:
00030 //
00031 //      Major Version
00032 //      Minor Version
00033 //      Build Number
00034 //      Revision
00035 //
00036 // You can specify all the values or you can default the Build and Revision Numbers
00037 // by using the '*' as shown below:
00038 // [assembly: AssemblyVersion("1.0.*")]
00039 [assembly: AssemblyVersion("1.0.0.0")]
00040 [assembly: AssemblyFileVersion("1.0.0.0")]
00041 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/OnboardingService.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

OnboardingService.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using org.alljoyn.Onboarding;
00013 using SDKTemplate;
00014 using System;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.AllJoyn;
00017 using Windows.Foundation;
00018
00019 namespace AllJoynProducerExperiences
00020 {
00021     class OnboardingService : IOnboardingService
00022     {
00023         public static event EventHandler ConnectRequestRecieved;
00024
00025         // Method to handle calls to the ConfigureWifi method.
00026         IAsyncOperation<OnboardingConfigureWiFiResult> IOnboardingService.ConfigureWiFiAsync(AllJoynMessageInfo info, string interfaceMemberSsid, string interfaceMemberPassphrase, short interfaceMemberAuthType)
00027         {
00028             IAsyncAction asyncAction = MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00029             {
00030                 MainPage.Current.NotifyUser("Configure WiFi request received", NotifyType.StatusMessage);
00031             });
00032
00033             Task<OnboardingConfigureWiFiResult> task = new Task<OnboardingConfigureWiFiResult>(() =>
00034             {
00035                 AppData.OnboardingConfigureSsid = interfaceMemberSsid;
00036                 AppData.OnboardingConfigurePassphrase = interfaceMemberPassphrase;
00037                 AppData.OnboardingConfigureAuthType = interfaceMemberAuthType;
00038                 AppData.OnboardingConfigurationState = (short)ConfigurationState.NotValidated;
00039                 return OnboardingConfigureWiFiResult.CreateSuccessResult((short)ConfigureWiFiResultStatus.Concurrent);
00040             });
00041
00042             task.Start();
00043             return task.AsAsyncOperation();
00044         }
00045
00046         // Method to handle calls to the Connect method.
00047         IAsyncOperation<OnboardingConnectResult> IOnboardingService.ConnectAsync(AllJoynMessageInfo info)
00048         {
00049             Task<OnboardingConnectResult> task = new Task<OnboardingConnectResult>(() =>
00050             {
00051                 EventHandler handler = ConnectRequestRecieved;
00052                 if (handler != null)
00053                 {
00054                     handler(new object(), new EventArgs());
00055                 }
00056
00057                 return OnboardingConnectResult.CreateSuccessResult();
00058             });
00059
00060             task.Start();
00061             return task.AsAsyncOperation();
00062         }
00063
00064         // Method to handle calls to the Offboard method.
00065         IAsyncOperation<OnboardingOffboardResult> IOnboardingService.OffboardAsync(AllJoynMessageInfo info)
00066         {
00067             Task<OnboardingOffboardResult> task = new Task<OnboardingOffboardResult>(() =>
00068             {
00069                 AppData.OnboardingConfigureSsid = null;
00070                 AppData.OnboardingConfigurePassphrase = null;
00071                 AppData.OnboardingConfigureAuthType = (short)OnboardingAuthenticationType.Any;
00072                 AppData.OnboardingConfigurationState = (short)ConfigurationState.NotConfigured;
00073                 return OnboardingOffboardResult.CreateSuccessResult();
00074             });
00075
00076             task.Start();
00077             return task.AsAsyncOperation();
00078         }
00079
00080         // Method to handle calls to the GetScanInfo method.
00081         IAsyncOperation<OnboardingGetScanInfoResult> IOnboardingService.GetScanInfoAsync(AllJoynMessageInfo info)
00082         {
00083             Task<OnboardingGetScanInfoResult> task = new Task<OnboardingGetScanInfoResult>(() =>
00084             {
00085                 return OnboardingGetScanInfoResult.CreateSuccessResult(1, AppData.SampleNetworkScanList);
00086             });
00087
00088             task.Start();
00089             return task.AsAsyncOperation();
00090         }
00091
00092         // Method to handle requests for the value of the Version property.
00093         IAsyncOperation<OnboardingGetVersionResult> IOnboardingService.GetVersionAsync(AllJoynMessageInfo info)
00094         {
00095             Task<OnboardingGetVersionResult> task = new Task<OnboardingGetVersionResult>(() =>
00096             {
00097                 return OnboardingGetVersionResult.CreateSuccessResult(1);
00098             });
00099
00100             task.Start();
00101             return task.AsAsyncOperation();
00102         }
00103
00104         // Method to handle requests for the value of the State property.
00105         IAsyncOperation<OnboardingGetStateResult> IOnboardingService.GetStateAsync(AllJoynMessageInfo info)
00106         {
00107             Task<OnboardingGetStateResult> task = new Task<OnboardingGetStateResult>(() =>
00108             {
00109                 return OnboardingGetStateResult.CreateSuccessResult(AppData.OnboardingConfigurationState);
00110             });
00111
00112             task.Start();
00113             return task.AsAsyncOperation();
00114         }
00115
00116         // Method to handle requests for the value of the LastError property.
00117         IAsyncOperation<OnboardingGetLastErrorResult> IOnboardingService.GetLastErrorAsync(AllJoynMessageInfo info)
00118         {
00119             Task<OnboardingGetLastErrorResult> task = new Task<OnboardingGetLastErrorResult>(() =>
00120             {
00121                 OnboardingLastError lastError = new OnboardingLastError();
00122                 lastError.Value1 = AppData.LastErrorCode;
00123                 lastError.Value2 = AppData.LastErrorMessage;
00124                 return OnboardingGetLastErrorResult.CreateSuccessResult(lastError);
00125             });
00126
00127             task.Start();
00128             return task.AsAsyncOperation();
00129         }
00130     }
00131 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cs/Scenario1.xaml.cs Source File

  • FileSearch
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Text;
00015 using Windows.Storage;
00016 using Windows.Storage.Search;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario1 : Page
00027     {
00028         public Scenario1()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         private async void SearchButton_Click(object sender, RoutedEventArgs e)
00034         {
00035             StorageFolder musicFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.MusicLibrary);
00036
00037             List<string> fileTypeFilter = new List<string>();
00038             fileTypeFilter.Add("*");
00039
00040             QueryOptions queryOptions = new QueryOptions(CommonFileQuery.OrderBySearchRank, fileTypeFilter);
00041             //use the user's input to make a query
00042             queryOptions.UserSearchFilter = InputTextBox.Text;
00043             StorageFileQueryResult queryResult = musicFolder.CreateFileQueryWithOptions(queryOptions);
00044
00045             StringBuilder outputText = new StringBuilder();
00046
00047             //find all files that match the query
00048             IReadOnlyList<StorageFile> files = await queryResult.GetFilesAsync();
00049             //output how many files that match the query were found
00050             if (files.Count == 0)
00051             {
00052                 outputText.Append("No files found for '" + queryOptions.UserSearchFilter + "'");
00053             }
00054             else if (files.Count == 1)
00055             {
00056                 outputText.Append(files.Count + " file found:\n\n");
00057             }
00058             else
00059             {
00060                 outputText.Append(files.Count + " files found:\n\n");
00061             }
00062
00063             //output the name of each file that matches the query
00064             foreach (StorageFile file in files)
00065             {
00066                 outputText.Append(file.Name + "\n");
00067             }
00068
00069             OutputTextBlock.Text = outputText.ToString();
00070         }
00071     }
00072 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/WASAPIRenderer.h Source File

  • WindowsAudioSession
  • cppwinrt

WASAPIRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012 #include "DeviceState.h"
00013 #include "ToneSampleGenerator.h"
00014 #include "MFSampleGenerator.h"
00015
00016 namespace winrt::SDKTemplate
00017 {
00018     enum class ContentType
00019     {
00020         Tone,
00021         File
00022     };
00023
00024     struct WASAPIRenderer;
00025
00026     using DeviceStateChangedEventHandler = delegate<com_ptr<WASAPIRenderer>, com_ptr<DeviceStateChangedEventArgs>>;
00027
00028     // Primary WASAPI Renderering Class
00029     struct WASAPIRenderer : winrt::implements<WASAPIRenderer, IActivateAudioInterfaceCompletionHandler, IDeviceStateSource>, implementation::DeviceStateSourceT<WASAPIRenderer>
00030     {
00031         void SetContentType(ContentType value) { m_contentType = value; }
00032         void SetFrequency(double value) { m_Frequency = value; }
00033         void SetContentStream(Windows::Storage::Streams::IRandomAccessStream const& value) { m_ContentStream = value; }
00034         void SetHWOffload(bool value) { m_IsHWOffload = value; }
00035         void SetBackgroundAudio(bool value) { m_IsBackground = value; }
00036         void SetRawAudio(bool value) { m_IsRawAudio = value; }
00037         void SetLowLatency(bool value) { m_IsLowLatency = value; }
00038         void SetBufferDuration(REFERENCE_TIME value) { m_hnsBufferDuration = value; }
00039
00040         void AsyncInitializeAudioDevice() noexcept;
00041         void StartPlayback() noexcept;
00042         HRESULT StopPlaybackAsync() noexcept;
00043         HRESULT PausePlaybackAsync();
00044
00045         HRESULT SetVolumeOnSession(double volume) noexcept;
00046
00047         // IActivateAudioInterfaceCompletionHandler
00048         STDMETHOD(ActivateCompleted)(IActivateAudioInterfaceAsyncOperation* operation) noexcept;
00049
00050     private:
00051         HRESULT OnStartPlayback(IMFAsyncResult* pResult) noexcept;
00052         HRESULT OnStopPlayback(IMFAsyncResult* pResult);
00053         HRESULT OnPausePlayback(IMFAsyncResult* pResult);
00054         HRESULT OnSampleReady(IMFAsyncResult* pResult);
00055
00056         EmbeddedMFAsyncCallback<&WASAPIRenderer::OnStartPlayback> m_StartPlaybackCallback{ this };
00057         EmbeddedMFAsyncCallback<&WASAPIRenderer::OnStopPlayback> m_StopPlaybackCallback{ this };
00058         EmbeddedMFAsyncCallback<&WASAPIRenderer::OnPausePlayback> m_PausePlaybackCallback{ this };
00059         EmbeddedMFAsyncCallback<&WASAPIRenderer::OnSampleReady> m_SampleReadyCallback{ this };
00060
00061         HRESULT ConfigureDeviceInternal() noexcept;
00062         void ValidateBufferValue();
00063         void OnAudioSampleRequested(bool IsSilence = false);
00064         void ConfigureSource();
00065         UINT32 GetBufferFramesPerPeriod() noexcept;
00066         void SetAudioClientChannelVolume();
00067
00068         void GetToneSample(uint32_t framesAvailable);
00069         void GetMFSample(uint32_t framesAvailable);
00070
00071     private:
00072         hstring m_DeviceIdString;
00073         uint32_t m_BufferFrames = 0;
00074
00075         // Event for sample ready or user stop
00076         handle m_SampleReadyEvent{ check_pointer(CreateEventEx(nullptr, nullptr, 0, EVENT_ALL_ACCESS)) };
00077
00078         MFWORKITEM_KEY m_SampleReadyKey;
00079         slim_mutex m_lock;
00080
00081         unique_cotaskmem_ptr<WAVEFORMATEX> m_MixFormat;
00082         uint32_t m_DefaultPeriodInFrames;
00083         uint32_t m_FundamentalPeriodInFrames;
00084         uint32_t m_MaxPeriodInFrames;
00085         uint32_t m_MinPeriodInFrames;
00086         float m_channelVolume = 1.0f;
00087
00088         com_ptr<IAudioClient3> m_AudioClient;
00089         com_ptr<IAudioRenderClient> m_AudioRenderClient;
00090         com_ptr<IMFAsyncResult> m_SampleReadyAsyncResult;
00091
00092         ContentType m_contentType = ContentType::Tone;
00093         bool m_IsHWOffload = false;
00094         bool m_IsBackground = false;
00095         bool m_IsRawAudio = false;
00096         bool m_IsLowLatency = false;
00097         REFERENCE_TIME m_hnsBufferDuration = 0;
00098         double m_Frequency = 0.0;
00099         winrt::Windows::Storage::Streams::IRandomAccessStream m_ContentStream = nullptr;
00100
00101         std::unique_ptr<ToneSampleGenerator> m_ToneSource;
00102         com_ptr<MFSampleGenerator> m_MFSource;
00103     };
00104 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonClearBadge_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ButtonUpdateBadgeGlyph_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ButtonUpdateBadgeNumber_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
DoesSecondaryTileExist() | ScenarioElement | [inline, private]
InitializeScenario() | ScenarioElement | [inline, private]
MoveToBadgeStep() | ScenarioElement | [inline, private]
MoveToSecondaryTileStep() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
SECONDARY_TILE_ID | ScenarioElement | [private, static]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/SampleConfiguration.cs Source File

  • DateTimeFormatting
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Date and time formatting";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Format date and time using long and short", ClassType = typeof(Scenario1_LongAndShortFormats) },
00025             new Scenario() { Title = "Format using a string template", ClassType = typeof(Scenario2_StringTemplate) },
00026             new Scenario() { Title = "Format using a parameterized template", ClassType = typeof(Scenario3_ParameterizedTemplate) },
00027             new Scenario() { Title = "Override the current user's settings", ClassType = typeof(Scenario4_Override) },
00028             new Scenario() { Title = "Format using Unicode extensions", ClassType = typeof(Scenario5_UnicodeExtensions) },
00029             new Scenario() { Title = "Format using different time zones", ClassType = typeof(Scenario6_TimeZone) }
00030         };
00031     }
00032
00033     public class Scenario
00034     {
00035         public string Title { get; set; }
00036         public Type ClassType { get; set; }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/SampleConfiguration.cs Source File

  • Gyrometer
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using GyrometerCS;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Gyrometer";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title = "Data Events", ClassType = typeof(GyrometerCS.Scenario1_DataEvents) },
00026             new Scenario() { Title = "Polling", ClassType = typeof(GyrometerCS.Scenario2_Polling) },
00027             new Scenario() { Title = "Cross-Platform Porting", ClassType = typeof(GyrometerCS.Scenario3_Porting) },
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/pch.cpp Source File

  • WindowsAudioSession
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cpp/Scenario3_EnableHdrProfile.xaml.cpp Source File

  • CameraProfile
  • cpp

Scenario3_EnableHdrProfile.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_EnableHdrProfile.xaml.h"
00014 #include <sstream>
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace SDKTemplate;
00019 using namespace Windows::Devices::Enumeration;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Media::Capture;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Primitives;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 /// <summary>
00033 /// Initializes a new instance of the <see cref="Scenario3_EnableHdrProfile"/> class.
00034 /// </summary>
00035 Scenario3_EnableHdrProfile::Scenario3_EnableHdrProfile()
00036 {
00037     InitializeComponent();
00038 }
00039
00040 /// <summary>
00041 /// Override default OnNavigateTo to initialize
00042 /// the rootPage object for Status message updates
00043 /// </summary>
00044 /// <param name="e">Contains state information and event data associated with the event</param>
00045 void Scenario3_EnableHdrProfile::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00046 {
00047     _rootPage = MainPage::Current;
00048 }
00049
00050 /// <summary>
00051 /// Finds the video profiles for the back camera. Then queries for a profile that supports
00052 /// HDR video recording. If a HDR supported video profile is located, then we configure media settings to the
00053 /// matching profile. Finally we initialize media capture HDR recording mode to auto.
00054 /// </summary>
00055 /// <param name="sender">Contains information regarding button that fired event</param>
00056 /// <param name="e">Contains state information and event data associated with the event</param>
00057 void Scenario3_EnableHdrProfile::CheckHdrSupportBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00058 {
00059     // Select the first video capture device found on the back of the device
00060     LogStatusToOutputBoxAsync("Querying for video capture device on back of the device that supports Video Profile");
00061     GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel::Back)
00062         .then([this](String^ videoDeviceId)
00063     {
00064         if (videoDeviceId == nullptr)
00065         {
00066             LogStatusAsync("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType::ErrorMessage);
00067             return;
00068         }
00069
00070         MediaCapture^ mediaCapture = ref new MediaCapture();
00071         MediaCaptureInitializationSettings^ mediaCaptureInitSetttings = ref new MediaCaptureInitializationSettings();
00072
00073         std::wstringstream ss;
00074         ss << "Found device that supports Video Profile, Device Id:\r\n " << videoDeviceId->Data();
00075         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00076         auto profiles = MediaCapture::FindKnownVideoProfiles(videoDeviceId, KnownVideoProfile::VideoRecording);
00077
00078         // Walk through available profiles, look for first profile with HDR supported Video Profile
00079         bool HdrVideoSupported = false;
00080         for (auto profile : profiles)
00081         {
00082             auto recordMediaDescription = profile->SupportedRecordMediaDescription;
00083             for (auto videoProfileMediaDescription : recordMediaDescription)
00084             {
00085                 if (videoProfileMediaDescription->IsHdrVideoSupported)
00086                 {
00087                     // We've located the profile and description for HDR Video, set profile and flag
00088                     mediaCaptureInitSetttings->VideoProfile = profile;
00089                     mediaCaptureInitSetttings->RecordMediaDescription = videoProfileMediaDescription;
00090                     HdrVideoSupported = true;
00091                     LogStatusAsync("HDR supported video profile found, set video profile to current HDR supported profile", NotifyType::StatusMessage);
00092                     break;
00093                 }
00094             }
00095
00096             if (HdrVideoSupported)
00097             {
00098                 break;
00099             }
00100         }
00101
00102         LogStatusToOutputBoxAsync("Initializing Media settings to HDR Supported video profile");
00103         create_task(mediaCapture->InitializeAsync(mediaCaptureInitSetttings))
00104             .then([this, mediaCapture, HdrVideoSupported]()
00105         {
00106             if (HdrVideoSupported)
00107             {
00108                 LogStatusToOutputBoxAsync("Initializing HDR Video Mode to Auto");
00109                 mediaCapture->VideoDeviceController->HdrVideoControl->Mode = Windows::Media::Devices::HdrVideoMode::Auto;
00110             }
00111         });
00112     });
00113 }
00114 /// <summary>
00115 /// Helper method to obtain a device Id that supports a Video Profile.
00116 /// If no Video Profile is found we return empty string indicating that there isn't a device on
00117 /// the desired panel with a supported Video Profile.
00118 /// </summary>
00119 /// <param name="panel">Contains Device Enumeration information regarding camera panel we are looking for</param>
00120 /// <returns>Device Information Id string</returns>
00121 task<String^> Scenario3_EnableHdrProfile::GetVideoProfileSupportedDeviceIdAsync(Windows::Devices::Enumeration::Panel panel)
00122 {
00123     // Find all video capture devices
00124     LogStatusToOutputBoxAsync("Looking for all video capture devices");
00125
00126     return create_task(DeviceInformation::FindAllAsync(DeviceClass::VideoCapture))
00127         .then([this, panel](DeviceInformationCollection^ devices)
00128     {
00129         String^ deviceId = nullptr;
00130         std::wstringstream ss;
00131         ss << "Number of video capture devices found: " << devices->Size;
00132         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00133
00134         // Loop through devices looking for device that supports Video Profile
00135         for (auto cameraDeviceInfo : devices)
00136         {
00137             if (MediaCapture::IsVideoProfileSupported(cameraDeviceInfo->Id) && cameraDeviceInfo->EnclosureLocation->Panel == panel)
00138             {
00139                 deviceId = cameraDeviceInfo->Id;
00140                 break;
00141             }
00142         }
00143
00144         return deviceId;
00145     });
00146 }
00147
00148 /// <summary>
00149 /// Marshall log message to the UI thread and update outputBox, this method is for more general messages
00150 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00151 /// which they were called without task chaining
00152 /// </summary>
00153 /// <param name="message">Message to log to the outputBox</param>
00154 /// <returns></returns>
00155 task<void> Scenario3_EnableHdrProfile::LogStatusToOutputBoxAsync(String^ message)
00156 {
00157     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message]()
00158     {
00159         outputBox->Text += message + "\r\n";
00160         outputScrollViewer->ChangeView(0.0, outputBox->ActualHeight, 1.0f);
00161     })));
00162 }
00163
00164 /// <summary>
00165 /// Method to log Status to Main Status block, this method is for important status messages to be
00166 /// displayed at bottom of scenario page
00167 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00168 /// which they were called without task chaining
00169 /// </summary>
00170 /// <param name="message">Message to log to the output box</param>
00171 /// <param name="type">Notification Type for status message</param>
00172 /// <returns></returns>
00173 task<void> Scenario3_EnableHdrProfile::LogStatusAsync(String^ message, NotifyType type)
00174 {
00175     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type]()
00176     {
00177         _rootPage->NotifyUser(message, type);
00178     }))).then([this, message]()
00179     {
00180         return LogStatusToOutputBoxAsync(message);
00181     });
00182 }
Generated on Fri Nov 15 2024 22:18:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S6_DeleteWithAppContent.xaml.h Source File

  • ContentIndexer
  • cpp

S6_DeleteWithAppContent.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S6_DeleteWithAppContent.xaml.h
00014 // Declaration of the S6_DeleteWithAppContent class
00015 //
00016
00017 #pragma once
00018 #include "S6_DeleteWithAppContent.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S6_DeleteWithAppContent sealed
00023     {
00024     public:
00025         S6_DeleteWithAppContent();
00026
00027     private:
00028         void AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void DeleteSingleItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void DeleteAllItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario3_BackgroundTask.xaml.cs Source File

  • Geolocation
  • cs

Scenario3_BackgroundTask.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Geolocation;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020 using Windows.Foundation.Collections;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario3_BackgroundTask : Page
00025     {
00026         // For background task registration
00027         private const string BackgroundTaskName = "SampleLocationBackgroundTask";
00028         private const string BackgroundTaskEntryPoint = "BackgroundTask.LocationBackgroundTask";
00029
00030         private IBackgroundTaskRegistration _geolocTask = null;
00031
00032         // A pointer to the main page
00033         private MainPage _rootPage = MainPage.Current;
00034
00035         public Scenario3_BackgroundTask()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         /// </summary>
00043         /// <param name="e">Event data that describes how this page was reached. The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             // See if our background task is already registered.
00048             _geolocTask = MainPage.LookupBackgroundTask(BackgroundTaskName);
00049
00050             if (_geolocTask != null)
00051             {
00052                 // Associate an event handler with the existing background task
00053                 _geolocTask.Completed += OnCompleted;
00054             }
00055             UpdateButtonStates();
00056         }
00057
00058         protected override void OnNavigatedFrom(NavigationEventArgs e)
00059         {
00060             if (_geolocTask != null)
00061             {
00062                 // Remove the event handler
00063                 _geolocTask.Completed -= OnCompleted;
00064             }
00065         }
00066
00067         /// <summary>
00068         /// This is the click handler for the 'Register' button.
00069         /// </summary>
00070         /// <param name="sender"></param>
00071         /// <param name="e"></param>
00072         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00073         {
00074             // Register the background task without checking whether the user has enabled background execution.
00075             // If it's disabled, and then the user later enables background execution, the background task will be ready to run.
00076             // Create a new background task builder
00077             BackgroundTaskBuilder geolocTaskBuilder = new BackgroundTaskBuilder();
00078
00079             geolocTaskBuilder.Name = BackgroundTaskName;
00080             geolocTaskBuilder.TaskEntryPoint = BackgroundTaskEntryPoint;
00081
00082             // Create a new timer triggering at a 15 minute interval
00083             var trigger = new TimeTrigger(15, false);
00084
00085             // Associate the timer trigger with the background task builder
00086             geolocTaskBuilder.SetTrigger(trigger);
00087
00088             // Register the background task
00089             _geolocTask = geolocTaskBuilder.Register();
00090
00091             // Associate an event handler with the new background task
00092             _geolocTask.Completed += OnCompleted;
00093
00094             UpdateButtonStates();
00095             MainPage.CheckBackgroundAndRequestLocationAccess();
00096         }
00097
00098         /// <summary>
00099         /// This is the click handler for the 'Unregister' button.
00100         /// </summary>
00101         /// <param name="sender"></param>
00102         /// <param name="e"></param>
00103         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00104         {
00105             // Unregister the background task
00106             if (null != _geolocTask)
00107             {
00108                 _geolocTask.Unregister(true);
00109                 _geolocTask = null;
00110             }
00111
00112             ScenarioOutput_Latitude.Text = "No data";
00113             ScenarioOutput_Longitude.Text = "No data";
00114             ScenarioOutput_Accuracy.Text = "No data";
00115             UpdateButtonStates();
00116             _rootPage.NotifyUser("Background task unregistered", NotifyType.StatusMessage);
00117         }
00118
00119         /// <summary>
00120         /// Event handler called when the background task is completed
00121         /// </summary>
00122         /// <param name="sender"></param>
00123         /// <param name="e"></param>
00124         private async void OnCompleted(IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
00125         {
00126             // Update the UI with progress reported by the background task
00127             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00128             {
00129                 try
00130                 {
00131                     // Rethrow any exception that occurred in the background task.
00132                     e.CheckResult();
00133
00134                     // Update the UI with the completion status of the background task
00135                     // The Run method of the background task sets this status.
00136                     MainPage.ReportSavedStatus();
00137
00138                     // Extract and display location data set by the background task if not null
00139                     ScenarioOutput_Latitude.Text = MainPage.LookupSavedString("Latitude", "No data");
00140                     ScenarioOutput_Longitude.Text = MainPage.LookupSavedString("Longitude", "No data");
00141                     ScenarioOutput_Accuracy.Text = MainPage.LookupSavedString("Accuracy", "No data");
00142                 }
00143                 catch (Exception ex)
00144                 {
00145                     // The background task had an error
00146                     _rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
00147                 }
00148             });
00149         }
00150
00151         /// <summary>
00152         /// Update the enable state of the register/unregister buttons.
00153         /// </summary>
00154         private void UpdateButtonStates()
00155         {
00156             bool registered = (_geolocTask != null);
00157             RegisterBackgroundTaskButton.IsEnabled = !registered;
00158             UnregisterBackgroundTaskButton.IsEnabled = registered;
00159         }
00160     }
00161 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Helpers/ServiceStatusConverter.cs Source File

  • WiFiDirectServices
  • cs
  • Helpers

ServiceStatusConverter.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Globalization;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Data;
00016 using Windows.Devices.WiFiDirect.Services;
00017
00018 namespace SDKTemplate.Helpers
00019 {
00020     public class ServiceStatusConverter : IValueConverter
00021     {
00022         /// <summary>
00023         /// Compares the bound value with an enum param. Returns true when they match.
00024         /// </summary>
00025         public object Convert(object value, Type targetType, object parameter, string language)
00026         {
00027             return ((WiFiDirectServiceStatus)value).ToString();
00028         }
00029
00030         /// <summary>
00031         /// Converts the boolean back into an enum.
00032         /// </summary>
00033         public object ConvertBack(object value, Type targetType, object parameter, string language)
00034         {
00035             return Enum.Parse(typeof(WiFiDirectServiceStatus), (string)value);
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:22:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShowPackageFamilyName Member List

This is the complete list of members for ShowPackageFamilyName, including all inherited members.
ShowPackageFamilyName() ShowPackageFamilyName
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspStreamSink.cpp Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspStreamSink.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "StspStreamSink.h"
00010 #include "StspMediaSink.h"
00011
00012 using namespace Microsoft::Samples::SimpleCommunication;
00013 using namespace Microsoft::Samples::SimpleCommunication::Network;
00014
00015 #define SET_SAMPLE_FLAG(dest, destMask, pSample, flagName) \
00016     { \
00017         UINT32 unValue; \
00018         if (SUCCEEDED(pSample->GetUINT32(MFSampleExtension_##flagName, &unValue))) \
00019         { \
00020             dest |= (unValue != FALSE) ? StspSampleFlag_##flagName : 0; \
00021             destMask |= StspSampleFlag_##flagName; \
00022         } \
00023     }
00024
00025 CStreamSink::CStreamSink(DWORD dwIdentifier)
00026     : _cRef(1)
00027     , _dwIdentifier(dwIdentifier)
00028     , _state(State_TypeNotSet)
00029     , _IsShutdown(false)
00030     , _Connected(false)
00031     , _fIsVideo(false)
00032     , _fGetStartTimeFromSample(false)
00033     , _fWaitingForFirstSample(false)
00034     , _fFirstSampleAfterConnect(false)
00035     , _StartTime(0)
00036     , _WorkQueueId(0)
00037     , _pParent(nullptr)
00038 #pragma warning(push)
00039 #pragma warning(disable:4355)
00040     , _WorkQueueCB(this, &CStreamSink::OnDispatchWorkItem)
00041 #pragma warning(pop)
00042 {
00043     ZeroMemory(&_guiCurrentSubtype, sizeof(_guiCurrentSubtype));
00044 }
00045
00046 CStreamSink::~CStreamSink()
00047 {
00048     assert(_IsShutdown);
00049 }
00050
00051
00052 // IUnknown methods
00053
00054 IFACEMETHODIMP CStreamSink::QueryInterface(REFIID riid, void **ppv)
00055 {
00056     if (ppv == nullptr)
00057     {
00058         return E_POINTER;
00059     }
00060     (*ppv) = nullptr;
00061
00062     HRESULT hr = S_OK;
00063     if (riid == IID_IUnknown ||
00064         riid == IID_IMFStreamSink ||
00065         riid == IID_IMFMediaEventGenerator)
00066     {
00067         (*ppv) = static_cast<IMFStreamSink*>(this);
00068         AddRef();
00069     }
00070     else if (riid == IID_IMFMediaTypeHandler)
00071     {
00072         (*ppv) = static_cast<IMFMediaTypeHandler*>(this);
00073         AddRef();
00074     }
00075     else
00076     {
00077         hr = E_NOINTERFACE;
00078     }
00079
00080     if (FAILED(hr) && riid == IID_IMarshal)
00081     {
00082         if (_spFTM == nullptr)
00083         {
00084             AutoLock lock(_critSec);
00085             if (_spFTM == nullptr)
00086             {
00087                 hr = CoCreateFreeThreadedMarshaler(static_cast<IMFStreamSink*>(this), &_spFTM);
00088             }
00089         }
00090
00091         if (SUCCEEDED(hr))
00092         {
00093             if (_spFTM == nullptr)
00094             {
00095                 hr = E_UNEXPECTED;
00096             }
00097             else
00098             {
00099                 hr = _spFTM.Get()->QueryInterface(riid, ppv);
00100             }
00101         }
00102     }
00103
00104     return hr;
00105 }
00106
00107 IFACEMETHODIMP_(ULONG) CStreamSink::AddRef()
00108 {
00109     return InterlockedIncrement(&_cRef);
00110 }
00111
00112 IFACEMETHODIMP_(ULONG) CStreamSink::Release()
00113 {
00114     long cRef = InterlockedDecrement(&_cRef);
00115     if (cRef == 0)
00116     {
00117         delete this;
00118     }
00119     return cRef;
00120 }
00121
00122 // IMFMediaEventGenerator methods.
00123 // Note: These methods call through to the event queue helper object.
00124
00125 IFACEMETHODIMP CStreamSink::BeginGetEvent(IMFAsyncCallback *pCallback, IUnknown *punkState)
00126 {
00127     HRESULT hr = S_OK;
00128
00129     AutoLock lock(_critSec);
00130
00131     hr = CheckShutdown();
00132
00133     if (SUCCEEDED(hr))
00134     {
00135         hr = _spEventQueue->BeginGetEvent(pCallback, punkState);
00136     }
00137
00138     TRACEHR_RET(hr);
00139 }
00140
00141 IFACEMETHODIMP CStreamSink::EndGetEvent(IMFAsyncResult *pResult, IMFMediaEvent **ppEvent)
00142 {
00143     HRESULT hr = S_OK;
00144
00145     AutoLock lock(_critSec);
00146
00147     hr = CheckShutdown();
00148
00149     if (SUCCEEDED(hr))
00150     {
00151         hr = _spEventQueue->EndGetEvent(pResult, ppEvent);
00152     }
00153
00154     TRACEHR_RET(hr);
00155 }
00156
00157 IFACEMETHODIMP CStreamSink::GetEvent(DWORD dwFlags, IMFMediaEvent **ppEvent)
00158 {
00159     // NOTE:
00160     // GetEvent can block indefinitely, so we don't hold the lock.
00161     // This requires some juggling with the event queue pointer.
00162
00163     HRESULT hr = S_OK;
00164
00165     ComPtr<IMFMediaEventQueue> spQueue;
00166
00167     {
00168         AutoLock lock(_critSec);
00169
00170         // Check shutdown
00171         hr = CheckShutdown();
00172
00173         // Get the pointer to the event queue.
00174         if (SUCCEEDED(hr))
00175         {
00176             spQueue = _spEventQueue;
00177         }
00178     }
00179
00180     // Now get the event.
00181     if (SUCCEEDED(hr))
00182     {
00183         hr = spQueue->GetEvent(dwFlags, ppEvent);
00184     }
00185
00186     TRACEHR_RET(hr);
00187 }
00188
00189 IFACEMETHODIMP CStreamSink::QueueEvent(MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, PROPVARIANT const *pvValue)
00190 {
00191     HRESULT hr = S_OK;
00192
00193     AutoLock lock(_critSec);
00194
00195     hr = CheckShutdown();
00196
00197     if (SUCCEEDED(hr))
00198     {
00199         hr = _spEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
00200     }
00201
00202     TRACEHR_RET(hr);
00203 }
00204
00205 /// IMFStreamSink methods
00206
00207 IFACEMETHODIMP CStreamSink::GetMediaSink(IMFMediaSink **ppMediaSink)
00208 {
00209     if (ppMediaSink == nullptr)
00210     {
00211         return E_INVALIDARG;
00212     }
00213
00214     AutoLock lock(_critSec);
00215
00216     HRESULT hr = CheckShutdown();
00217
00218     if (SUCCEEDED(hr))
00219     {
00220         _spSink.Get()->QueryInterface(IID_IMFMediaSink, (void**)ppMediaSink);
00221     }
00222
00223     TRACEHR_RET(hr);
00224 }
00225
00226 IFACEMETHODIMP CStreamSink::GetIdentifier(DWORD *pdwIdentifier)
00227 {
00228     if (pdwIdentifier == nullptr)
00229     {
00230         return E_INVALIDARG;
00231     }
00232
00233     AutoLock lock(_critSec);
00234
00235     HRESULT hr = CheckShutdown();
00236
00237     if (SUCCEEDED(hr))
00238     {
00239         *pdwIdentifier = _dwIdentifier;
00240     }
00241
00242     TRACEHR_RET(hr);
00243 }
00244
00245 IFACEMETHODIMP CStreamSink::GetMediaTypeHandler(IMFMediaTypeHandler **ppHandler)
00246 {
00247     if (ppHandler == nullptr)
00248     {
00249         return E_INVALIDARG;
00250     }
00251
00252     AutoLock lock(_critSec);
00253
00254     HRESULT hr = CheckShutdown();
00255
00256     // This stream object acts as its own type handler, so we QI ourselves.
00257     if (SUCCEEDED(hr))
00258     {
00259         hr = QueryInterface(IID_IMFMediaTypeHandler, (void**)ppHandler);
00260     }
00261
00262     TRACEHR_RET(hr);
00263 }
00264
00265 // We received a sample from an upstream component
00266 IFACEMETHODIMP CStreamSink::ProcessSample(IMFSample *pSample)
00267 {
00268     if (pSample == nullptr)
00269     {
00270         return E_INVALIDARG;
00271     }
00272
00273     HRESULT hr = S_OK;
00274
00275     AutoLock lock(_critSec);
00276
00277     hr = CheckShutdown();
00278
00279     // Validate the operation.
00280     if (SUCCEEDED(hr))
00281     {
00282         hr = ValidateOperation(OpProcessSample);
00283     }
00284
00285     if (SUCCEEDED(hr) && _fWaitingForFirstSample && !_Connected)
00286     {
00287         _spFirstVideoSample = pSample;
00288         _fWaitingForFirstSample = false;
00289
00290         hr = QueueEvent(MEStreamSinkRequestSample, GUID_NULL, hr, nullptr);
00291     }
00292     else if (SUCCEEDED(hr))
00293     {
00294         // Add the sample to the sample queue.
00295         if (SUCCEEDED(hr))
00296         {
00297             hr = _SampleQueue.InsertBack(pSample);
00298         }
00299
00300         // Unless we are paused, start an async operation to dispatch the next sample.
00301         if (SUCCEEDED(hr))
00302         {
00303             if (_state != State_Paused)
00304             {
00305                 // Queue the operation.
00306                 hr = QueueAsyncOperation(OpProcessSample);
00307             }
00308         }
00309     }
00310
00311     TRACEHR_RET(hr);
00312 }
00313
00314 // The client can call PlaceMarker at any time. In response,
00315 // we need to queue an MEStreamSinkMarker event, but not until
00316 // *after *we have processed all samples that we have received
00317 // up to this point.
00318 //
00319 // Also, in general you might need to handle specific marker
00320 // types, although this sink does not.
00321
00322 IFACEMETHODIMP CStreamSink::PlaceMarker(
00323     MFSTREAMSINK_MARKER_TYPE eMarkerType,
00324     const PROPVARIANT *pvarMarkerValue,
00325     const PROPVARIANT *pvarContextValue)
00326 {
00327     AutoLock lock(_critSec);
00328
00329     HRESULT hr = S_OK;
00330     ComPtr<IMarker> spMarker;
00331
00332     hr = CheckShutdown();
00333
00334     if (SUCCEEDED(hr))
00335     {
00336         hr = ValidateOperation(OpPlaceMarker);
00337     }
00338
00339     if (SUCCEEDED(hr))
00340     {
00341         hr = CreateMarker(eMarkerType, pvarMarkerValue, pvarContextValue, &spMarker);
00342     }
00343
00344     if (SUCCEEDED(hr))
00345     {
00346         hr = _SampleQueue.InsertBack(spMarker.Get());
00347     }
00348
00349     // Unless we are paused, start an async operation to dispatch the next sample/marker.
00350     if (SUCCEEDED(hr))
00351     {
00352         if (_state != State_Paused)
00353         {
00354             // Queue the operation.
00355             hr = QueueAsyncOperation(OpPlaceMarker); // Increments ref count on pOp.
00356         }
00357     }
00358
00359     TRACEHR_RET(hr);
00360 }
00361
00362 // Discards all samples that were not processed yet.
00363 IFACEMETHODIMP CStreamSink::Flush()
00364 {
00365     AutoLock lock(_critSec);
00366     HRESULT hr = S_OK;
00367     try
00368     {
00369         ThrowIfError(CheckShutdown());
00370
00371         // Note: Even though we are flushing data, we still need to send
00372         // any marker events that were queued.
00373         DropSamplesFromQueue();
00374     }
00375     catch(Exception ^exc)
00376     {
00377         hr = exc->HResult;
00378     }
00379
00380     TRACEHR_RET(hr);
00381 }
00382
00383
00384 /// IMFMediaTypeHandler methods
00385
00386 // Check if a media type is supported.
00387 IFACEMETHODIMP CStreamSink::IsMediaTypeSupported(
00388     /* [in] */ IMFMediaType *pMediaType,
00389     /* [out] */ IMFMediaType **ppMediaType)
00390 {
00391     if (pMediaType == nullptr)
00392     {
00393         return E_INVALIDARG;
00394     }
00395
00396     AutoLock lock(_critSec);
00397
00398     GUID majorType = GUID_NULL;
00399     UINT cbSize = 0;
00400
00401     HRESULT hr = CheckShutdown();
00402
00403     if (SUCCEEDED(hr))
00404     {
00405         hr = pMediaType->GetGUID(MF_MT_MAJOR_TYPE, &majorType);
00406     }
00407
00408     // First make sure it's video or audio type.
00409     if (SUCCEEDED(hr))
00410     {
00411         if (majorType != MFMediaType_Video && majorType != MFMediaType_Audio)
00412         {
00413             hr = MF_E_INVALIDTYPE;
00414         }
00415     }
00416
00417     if (SUCCEEDED(hr) && _spCurrentType != nullptr)
00418     {
00419         GUID guiNewSubtype;
00420         if (FAILED(pMediaType->GetGUID(MF_MT_SUBTYPE, &guiNewSubtype)) ||
00421             guiNewSubtype != _guiCurrentSubtype)
00422         {
00423             hr = MF_E_INVALIDTYPE;
00424         }
00425     }
00426
00427     // We don't return any "close match" types.
00428     if (ppMediaType)
00429     {
00430         *ppMediaType = nullptr;
00431     }
00432
00433     TRACEHR_RET(hr);
00434 }
00435
00436
00437 // Return the number of preferred media types.
00438 IFACEMETHODIMP CStreamSink::GetMediaTypeCount(DWORD *pdwTypeCount)
00439 {
00440     if (pdwTypeCount == nullptr)
00441     {
00442         return E_INVALIDARG;
00443     }
00444
00445     AutoLock lock(_critSec);
00446
00447     HRESULT hr = CheckShutdown();
00448
00449     if (SUCCEEDED(hr))
00450     {
00451         // We've got only one media type
00452         *pdwTypeCount = 1;
00453     }
00454
00455     TRACEHR_RET(hr);
00456 }
00457
00458
00459 // Return a preferred media type by index.
00460 IFACEMETHODIMP CStreamSink::GetMediaTypeByIndex(
00461     /* [in] */ DWORD dwIndex,
00462     /* [out] */ IMFMediaType **ppType)
00463 {
00464     if (ppType == nullptr)
00465     {
00466         return E_INVALIDARG;
00467     }
00468
00469     AutoLock lock(_critSec);
00470
00471     HRESULT hr = CheckShutdown();
00472
00473     if ( dwIndex > 0 )
00474     {
00475         hr = MF_E_NO_MORE_TYPES;
00476     }
00477     else
00478     {
00479         *ppType = _spCurrentType.Get();
00480         if (*ppType != nullptr)
00481         {
00482             (*ppType)->AddRef();
00483         }
00484     }
00485
00486     TRACEHR_RET(hr);
00487 }
00488
00489
00490 // Set the current media type.
00491 IFACEMETHODIMP CStreamSink::SetCurrentMediaType(IMFMediaType *pMediaType)
00492 {
00493     HRESULT hr = S_OK;
00494     try
00495     {
00496         if (pMediaType == nullptr)
00497         {
00498             Throw(E_INVALIDARG);
00499         }
00500         AutoLock lock(_critSec);
00501
00502         ThrowIfError(CheckShutdown());
00503
00504         // We don't allow format changes after streaming starts.
00505         ThrowIfError(ValidateOperation(OpSetMediaType));
00506
00507         // We set media type already
00508         if (_state >= State_Ready)
00509         {
00510             ThrowIfError(IsMediaTypeSupported(pMediaType, nullptr));
00511         }
00512
00513         GUID guiMajorType;
00514         pMediaType->GetMajorType(&guiMajorType);
00515         _fIsVideo = (guiMajorType == MFMediaType_Video);
00516
00517         ThrowIfError(MFCreateMediaType(_spCurrentType.ReleaseAndGetAddressOf()));
00518         ThrowIfError(pMediaType->CopyAllItems(_spCurrentType.Get()));
00519         ThrowIfError(_spCurrentType->GetGUID(MF_MT_SUBTYPE, &_guiCurrentSubtype));
00520         if (_state < State_Ready)
00521         {
00522             _state = State_Ready;
00523         }
00524         else if (_state > State_Ready)
00525         {
00526             ComPtr<IMFMediaType> spType;
00527             ThrowIfError(MFCreateMediaType(&spType));
00528             ThrowIfError(pMediaType->CopyAllItems(spType.Get()));
00529             ProcessFormatChange(spType.Get());
00530         }
00531     }
00532     catch(Exception ^exc)
00533     {
00534         hr = exc->HResult;
00535     }
00536     TRACEHR_RET(hr);
00537 }
00538
00539 // Return the current media type, if any.
00540 IFACEMETHODIMP CStreamSink::GetCurrentMediaType(IMFMediaType **ppMediaType)
00541 {
00542     if (ppMediaType == nullptr)
00543     {
00544         return E_INVALIDARG;
00545     }
00546
00547     AutoLock lock(_critSec);
00548
00549     HRESULT hr = CheckShutdown();
00550
00551     if (SUCCEEDED(hr))
00552     {
00553         if (_spCurrentType == nullptr)
00554         {
00555             hr = MF_E_NOT_INITIALIZED;
00556         }
00557     }
00558
00559     if (SUCCEEDED(hr))
00560     {
00561         *ppMediaType = _spCurrentType.Get();
00562         (*ppMediaType)->AddRef();
00563     }
00564
00565     TRACEHR_RET(hr);
00566 }
00567
00568
00569 // Return the major type GUID.
00570 IFACEMETHODIMP CStreamSink::GetMajorType(GUID *pguidMajorType)
00571 {
00572     if (pguidMajorType == nullptr)
00573     {
00574         return E_INVALIDARG;
00575     }
00576
00577     if (!_spCurrentType)
00578     {
00579         return MF_E_NOT_INITIALIZED;
00580     }
00581
00582     *pguidMajorType = (_fIsVideo) ? MFMediaType_Video : MFMediaType_Audio;
00583
00584     return S_OK;
00585 }
00586
00587
00588 // private methods
00589 HRESULT CStreamSink::Initialize(CMediaSink *pParent, INetworkChannel ^networkSender)
00590 {
00591     assert(pParent != nullptr);
00592
00593     HRESULT hr = S_OK;
00594
00595     // Create the event queue helper.
00596     hr = MFCreateEventQueue(&_spEventQueue);
00597
00598     // Allocate a new work queue for async operations.
00599     if (SUCCEEDED(hr))
00600     {
00601         hr = MFAllocateSerialWorkQueue(MFASYNC_CALLBACK_QUEUE_STANDARD, &_WorkQueueId);
00602     }
00603
00604     if (SUCCEEDED(hr))
00605     {
00606         _spSink = pParent;
00607         _pParent = pParent;
00608         _networkSender = networkSender;
00609     }
00610
00611     TRACEHR_RET(hr);
00612 }
00613
00614
00615 // Called when the presentation clock starts.
00616 HRESULT CStreamSink::Start(MFTIME start)
00617 {
00618     AutoLock lock(_critSec);
00619
00620     HRESULT hr = S_OK;
00621
00622     hr = ValidateOperation(OpStart);
00623
00624     if (SUCCEEDED(hr))
00625     {
00626         if (start != PRESENTATION_CURRENT_POSITION)
00627         {
00628             _StartTime = start;        // Cache the start time.
00629             _fGetStartTimeFromSample = false;
00630         }
00631         else
00632         {
00633             _fGetStartTimeFromSample = true;
00634         }
00635         _state = State_Started;
00636         _fWaitingForFirstSample = _fIsVideo;
00637         hr = QueueAsyncOperation(OpStart);
00638     }
00639
00640     TRACEHR_RET(hr);
00641 }
00642
00643 // Called when the presentation clock stops.
00644 HRESULT CStreamSink::Stop()
00645 {
00646     AutoLock lock(_critSec);
00647
00648     HRESULT hr = S_OK;
00649
00650     hr = ValidateOperation(OpStop);
00651
00652     if (SUCCEEDED(hr))
00653     {
00654         _state = State_Stopped;
00655         hr = QueueAsyncOperation(OpStop);
00656     }
00657
00658     TRACEHR_RET(hr);
00659 }
00660
00661 // Called when the presentation clock pauses.
00662 HRESULT CStreamSink::Pause()
00663 {
00664     AutoLock lock(_critSec);
00665
00666     HRESULT hr = S_OK;
00667
00668     hr = ValidateOperation(OpPause);
00669
00670     if (SUCCEEDED(hr))
00671     {
00672         _state = State_Paused;
00673         hr = QueueAsyncOperation(OpPause);
00674     }
00675
00676     TRACEHR_RET(hr);
00677 }
00678
00679 // Called when the presentation clock restarts.
00680 HRESULT CStreamSink::Restart()
00681 {
00682     AutoLock lock(_critSec);
00683
00684     HRESULT hr = S_OK;
00685
00686     hr = ValidateOperation(OpRestart);
00687
00688     if (SUCCEEDED(hr))
00689     {
00690         _state = State_Started;
00691         hr = QueueAsyncOperation(OpRestart);
00692     }
00693
00694     TRACEHR_RET(hr);
00695 }
00696
00697 // Class-static matrix of operations vs states.
00698 // If an entry is TRUE, the operation is valid from that state.
00699 BOOL CStreamSink::ValidStateMatrix[CStreamSink::State_Count][CStreamSink::Op_Count] =
00700 {
00701 // States:    Operations:
00702 //            SetType   Start     Restart   Pause     Stop      Sample    Marker
00703 /* NotSet */  TRUE,     FALSE,    FALSE,    FALSE,    FALSE,    FALSE,    FALSE,
00704
00705 /* Ready */   TRUE,     TRUE,     FALSE,    TRUE,     TRUE,     FALSE,    TRUE,
00706
00707 /* Start */   TRUE,     TRUE,     FALSE,    TRUE,     TRUE,     TRUE,     TRUE,
00708
00709 /* Pause */   TRUE,     TRUE,     TRUE,     TRUE,     TRUE,     TRUE,     TRUE,
00710
00711 /* Stop */    TRUE,     TRUE,     FALSE,    FALSE,    TRUE,     FALSE,    TRUE,
00712
00713 };
00714
00715 // Checks if an operation is valid in the current state.
00716 HRESULT CStreamSink::ValidateOperation(StreamOperation op)
00717 {
00718     assert(!_IsShutdown);
00719
00720     HRESULT hr = S_OK;
00721
00722     if (ValidStateMatrix[_state][op])
00723     {
00724         return S_OK;
00725     }
00726     else if (_state == State_TypeNotSet)
00727     {
00728         return MF_E_NOT_INITIALIZED;
00729     }
00730     else
00731     {
00732         return MF_E_INVALIDREQUEST;
00733     }
00734 }
00735
00736 // Shuts down the stream sink.
00737 HRESULT CStreamSink::Shutdown()
00738 {
00739     AutoLock lock(_critSec);
00740
00741     if (!_IsShutdown)
00742     {
00743         if (_spEventQueue)
00744         {
00745             _spEventQueue->Shutdown();
00746         }
00747
00748         MFUnlockWorkQueue(_WorkQueueId);
00749
00750         _SampleQueue.Clear();
00751
00752         _spSink.Reset();
00753         _spEventQueue.Reset();
00754         _spByteStream.Reset();
00755         _spCurrentType.Reset();
00756         _networkSender = nullptr;
00757
00758         _IsShutdown = true;
00759     }
00760
00761     return S_OK;
00762 }
00763
00764
00765 // Puts an async operation on the work queue.
00766 HRESULT CStreamSink::QueueAsyncOperation(StreamOperation op)
00767 {
00768     HRESULT hr = S_OK;
00769     ComPtr<CAsyncOperation> spOp;
00770     spOp.Attach(new CAsyncOperation(op)); // Created with ref count = 1
00771     if (!spOp)
00772     {
00773         hr = E_OUTOFMEMORY;
00774     }
00775
00776     if (SUCCEEDED(hr))
00777     {
00778         hr = MFPutWorkItem2(_WorkQueueId, 0, &_WorkQueueCB, spOp.Get());
00779     }
00780
00781     TRACEHR_RET(hr);
00782 }
00783
00784 HRESULT CStreamSink::OnDispatchWorkItem(IMFAsyncResult *pAsyncResult)
00785 {
00786     // Called by work queue thread. Need to hold the critical section.
00787     AutoLock lock(_critSec);
00788
00789     try
00790     {
00791         ComPtr<IUnknown> spState;
00792
00793         ThrowIfError(pAsyncResult->GetState(&spState));
00794
00795         // The state object is a CAsncOperation object.
00796         CAsyncOperation *pOp = static_cast<CAsyncOperation *>(spState.Get());
00797         StreamOperation op = pOp->m_op;
00798
00799         switch (op)
00800         {
00801         case OpStart:
00802         case OpRestart:
00803             // Send MEStreamSinkStarted.
00804             ThrowIfError(QueueEvent(MEStreamSinkStarted, GUID_NULL, S_OK, nullptr));
00805
00806             // There might be samples queue from earlier (ie, while paused).
00807             bool fRequestMoreSamples;
00808             if (!_Connected)
00809             {
00810                 // Just drop samples if we are not connected
00811                 fRequestMoreSamples = DropSamplesFromQueue();
00812             }
00813             else
00814             {
00815                 fRequestMoreSamples = SendSampleFromQueue();
00816             }
00817             if (fRequestMoreSamples)
00818             {
00819                 // If false there is no samples in the queue now so request one
00820                 ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
00821             }
00822             break;
00823
00824         case OpStop:
00825             // Drop samples from queue.
00826             DropSamplesFromQueue();
00827
00828             // Send the event even if the previous call failed.
00829             ThrowIfError(QueueEvent(MEStreamSinkStopped, GUID_NULL, S_OK, nullptr));
00830             break;
00831
00832         case OpPause:
00833             ThrowIfError(QueueEvent(MEStreamSinkPaused, GUID_NULL, S_OK, nullptr));
00834             break;
00835
00836         case OpProcessSample:
00837         case OpPlaceMarker:
00838         case OpSetMediaType:
00839             DispatchProcessSample(pOp);
00840             break;
00841         }
00842     }
00843     catch(Exception ^exc)
00844     {
00845         HandleError(exc->HResult);
00846     }
00847     return S_OK;
00848 }
00849
00850 // Complete a ProcessSample or PlaceMarker request.
00851 void CStreamSink::DispatchProcessSample(CAsyncOperation *pOp)
00852 {
00853     assert(pOp != nullptr);
00854     bool fRequestMoreSamples = false;
00855     if (!_Connected)
00856     {
00857         fRequestMoreSamples = DropSamplesFromQueue();
00858     }
00859     else
00860     {
00861         fRequestMoreSamples = SendSampleFromQueue();
00862     }
00863
00864     // Ask for another sample
00865     if (fRequestMoreSamples)
00866     {
00867         if (pOp->m_op == OpProcessSample)
00868         {
00869             ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
00870         }
00871     }
00872 }
00873
00874 // Drop samples in the queue
00875 bool CStreamSink::DropSamplesFromQueue()
00876 {
00877     ProcessSamplesFromQueue(true);
00878
00879     return true;
00880 }
00881
00882 // Send sample from the queue
00883 bool CStreamSink::SendSampleFromQueue()
00884 {
00885     return ProcessSamplesFromQueue(false);
00886 }
00887
00888 bool CStreamSink::ProcessSamplesFromQueue(bool fFlush)
00889 {
00890     bool fNeedMoreSamples = false;
00891
00892     ComPtr<IUnknown> spunkSample;
00893
00894     bool fSendSamples = true;
00895     bool fSendEOS = false;
00896
00897     if (FAILED(_SampleQueue.RemoveFront(&spunkSample)))
00898     {
00899         fNeedMoreSamples = true;
00900         fSendSamples = false;
00901     }
00902
00903     while (fSendSamples)
00904     {
00905         ComPtr<IMFSample> spSample;
00906         ComPtr<IBufferPacket> spPacket;
00907         bool fProcessingSample = false;
00908         assert(spunkSample);
00909
00910         // Figure out if this is a marker or a sample.
00911         // If this is a sample, write it to the file.
00912         // Now handle the sample/marker appropriately.
00913         if (SUCCEEDED(spunkSample.As(&spSample)))
00914         {
00915             assert(spSample);    // Not a marker, must be a sample
00916
00917             if (!fFlush)
00918             {
00919                 // Prepare sample for sending
00920                 spPacket = PrepareSample(spSample.Get(), false);
00921                 fProcessingSample = true;
00922             }
00923         }
00924         else
00925         {
00926             ComPtr<IMarker> spMarker;
00927             // Check if it is a marker
00928             if (SUCCEEDED(spunkSample.As(&spMarker)))
00929             {
00930                 MFSTREAMSINK_MARKER_TYPE markerType;
00931                 PROPVARIANT var;
00932                 PropVariantInit(&var);
00933                 ThrowIfError(spMarker->GetMarkerType(&markerType));
00934                 // Get the context data.
00935                 ThrowIfError(spMarker->GetContext(&var));
00936
00937                 HRESULT hr = QueueEvent(MEStreamSinkMarker, GUID_NULL, S_OK, &var);
00938
00939                 PropVariantClear(&var);
00940
00941                 ThrowIfError(hr);
00942
00943                 if (markerType == MFSTREAMSINK_MARKER_ENDOFSEGMENT)
00944                 {
00945                     fSendEOS = true;
00946                 }
00947             }
00948             else
00949             {
00950                 ComPtr<IMFMediaType> spType;
00951                 ThrowIfError(spunkSample.As(&spType));
00952                 if (!fFlush)
00953                 {
00954                     spPacket = PrepareFormatChange(spType.Get());
00955                 }
00956             }
00957         }
00958
00959         if (spPacket)
00960         {
00961             ComPtr<CStreamSink> spThis = this;
00962             // Send the sample
00963             concurrency::create_task(_networkSender->SendAsync(spPacket.Get())).then([this, spThis, fProcessingSample](concurrency::task<void>& sendTask)
00964             {
00965                 AutoLock lock(_critSec);
00966                 try
00967                 {
00968                     sendTask.get();
00969                     ThrowIfError(CheckShutdown());
00970                     if (_state == State_Started && fProcessingSample)
00971                     {
00972                         // If we are still in started state request another sample
00973                         ThrowIfError(QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr));
00974                     }
00975                 }
00976                 catch(Exception ^exc)
00977                 {
00978                     HandleError(exc->HResult);
00979                 }
00980             });
00981             // We stop if we processed a sample otherwise keep looking
00982             fSendSamples = !fProcessingSample;
00983         }
00984
00985         if (fSendSamples)
00986         {
00987             if (FAILED(_SampleQueue.RemoveFront(spunkSample.ReleaseAndGetAddressOf())))
00988             {
00989                 fNeedMoreSamples = true;
00990                 fSendSamples = false;
00991             }
00992         }
00993
00994     }
00995
00996     if (fSendEOS)
00997     {
00998         ComPtr<CMediaSink> spParent = _pParent;
00999         concurrency::create_task([spParent](){
01000             spParent->ReportEndOfStream();
01001         });
01002     }
01003
01004     return fNeedMoreSamples;
01005 }
01006
01007 // Processing format change
01008 void CStreamSink::ProcessFormatChange(IMFMediaType *pMediaType)
01009 {
01010     assert(pMediaType != nullptr);
01011
01012     // Add the media type to the sample queue.
01013     ThrowIfError(_SampleQueue.InsertBack(pMediaType));
01014
01015     // Unless we are paused, start an async operation to dispatch the next sample.
01016     // Queue the operation.
01017     ThrowIfError(QueueAsyncOperation(OpSetMediaType));
01018 }
01019
01020 // Set the information if we are connected to a client or not
01021 HRESULT CStreamSink::SetConnected(bool fConnected, LONGLONG llCurrentTime)
01022 {
01023     AutoLock lock(_critSec);
01024     HRESULT hr = S_OK;
01025     try
01026     {
01027         if (_spCurrentType == nullptr)
01028         {
01029             Throw(MF_E_NOT_INITIALIZED);
01030         }
01031
01032         _StartTime = llCurrentTime;
01033         _Connected = fConnected;
01034         if (fConnected)
01035         {
01036             if (_spFirstVideoSample)
01037             {
01038                 ComPtr<IBufferPacket> spPacket = PrepareSample(_spFirstVideoSample.Get(), true);
01039                 _spFirstVideoSample.Reset();
01040
01041                 if (spPacket != nullptr)
01042                 {
01043                     ComPtr<CStreamSink> spThis = this;
01044                     // Send the sample
01045                     concurrency::create_task(_networkSender->SendAsync(spPacket.Get())).then([this, spThis](concurrency::task<void>& sendTask)
01046                     {
01047                         AutoLock lock(_critSec);
01048                         try
01049                         {
01050                             sendTask.get();
01051                             ThrowIfError(CheckShutdown());
01052                         }
01053                         catch(Exception ^exc)
01054                         {
01055                             HandleError(exc->HResult);
01056                         }
01057                     });
01058                 }
01059             }
01060
01061
01062             TRACE(TRACE_LEVEL_LOW, L"SetConnected start=%I64d\n", _StartTime);
01063
01064             _fFirstSampleAfterConnect = true;
01065         }
01066     }
01067     catch(Exception ^exc)
01068     {
01069         hr = exc->HResult;
01070     }
01071
01072     TRACEHR_RET(hr);
01073 }
01074
01075 // Prepare sample for sending over the network by serializing it to a network packet
01076 ComPtr<Network::IBufferPacket> CStreamSink::PrepareSample(IMFSample *pSample, bool fForce)
01077 {
01078     assert(pSample);
01079
01080     ComPtr<IMediaBufferWrapper> spBuffer;
01081     ComPtr<IBufferPacket> spPacket;
01082     const size_t c_cbHeaderSize = sizeof(StspOperationHeader) + sizeof(StspSampleHeader);
01083     DWORD cbTotalSampleLength = 0;
01084     LONGLONG llSampleTime;
01085
01086     ThrowIfError(pSample->GetSampleTime(&llSampleTime));
01087     llSampleTime -= _StartTime;
01088
01089     if (llSampleTime < 0 && !fForce)
01090     {
01091         // Return nullptr;
01092         return spPacket;
01093     }
01094
01095     if (llSampleTime < 0)
01096     {
01097         llSampleTime = 0;
01098     }
01099
01100     // Create packet and initialize it with current sample
01101     ThrowIfError(CreateBufferPacketFromMFSample(pSample, &spPacket));
01102     ThrowIfError(pSample->GetTotalLength(&cbTotalSampleLength));
01103     ThrowIfError(CreateMediaBufferWrapper(c_cbHeaderSize, &spBuffer));
01104
01105     // Prepare the headers
01106     BYTE *pBuf = spBuffer->GetBuffer();
01107     // Operation header
01108     StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(pBuf);
01109     pOpHeader->eOperation = StspOperation_ServerSample;
01110     pOpHeader->cbDataSize = sizeof(StspSampleHeader) + cbTotalSampleLength;
01111
01112     // Sample header
01113     StspSampleHeader *pSampleHeader = reinterpret_cast<StspSampleHeader *>(pBuf + sizeof(StspOperationHeader));
01114     ZeroMemory(pSampleHeader, sizeof(*pSampleHeader));
01115     GetIdentifier(&pSampleHeader->dwStreamId);
01116     if (_fGetStartTimeFromSample)
01117     {
01118         pSample->GetSampleTime(&_StartTime);
01119         _fGetStartTimeFromSample = false;
01120         llSampleTime = 0;
01121     }
01122     pSampleHeader->ullTimestamp = llSampleTime;
01123     if (FAILED(pSample->GetSampleDuration(&pSampleHeader->ullDuration)))
01124     {
01125         pSampleHeader->ullDuration = 0;
01126     }
01127
01128     // Set up video samples
01129     if (IsVideo())
01130     {
01131         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, BottomFieldFirst);
01132         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, CleanPoint);
01133         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, DerivedFromTopField);
01134         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Discontinuity);
01135         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, Interlaced);
01136         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, RepeatFirstField);
01137         SET_SAMPLE_FLAG(pSampleHeader->dwFlags, pSampleHeader->dwFlagMasks, pSample, SingleField);
01138     }
01139
01140     ThrowIfError(spBuffer->SetCurrentLength(c_cbHeaderSize));
01141
01142     // Put headers before sample
01143     ThrowIfError(spPacket->InsertBuffer(0, spBuffer.Get()));
01144
01145     _fFirstSampleAfterConnect = false;
01146
01147     return spPacket;
01148 }
01149
01150 // Fill stream description and prepare attributes blob.
01151 ComPtr<Network::IMediaBufferWrapper> CStreamSink::FillStreamDescription(IMFMediaType *pMediaType, StspStreamDescription *pStreamDescription)
01152 {
01153     assert(pStreamDescription != nullptr);
01154
01155     ComPtr<IMFMediaType> spMediaTypeToSend;
01156
01157     // Clear the stream descriptor
01158     ZeroMemory(pStreamDescription, sizeof(*pStreamDescription));
01159
01160     // Get major type (Audio, Video and so on)
01161     ThrowIfError(GetMajorType(&pStreamDescription->guiMajorType));
01162
01163     // Get subtype (format of the stream)
01164     ThrowIfError(pMediaType->GetGUID(MF_MT_SUBTYPE, &pStreamDescription->guiSubType));
01165
01166     ThrowIfError(MFCreateMediaType(&spMediaTypeToSend));
01167
01168     FilterOutputMediaType(pMediaType, spMediaTypeToSend.Get());
01169
01170     pStreamDescription->dwStreamId = _dwIdentifier;
01171
01172     ComPtr<IMediaBufferWrapper> spAttributes;
01173     // Get size of attributes blob
01174     ThrowIfError(MFGetAttributesAsBlobSize(spMediaTypeToSend.Get(), &pStreamDescription->cbAttributesSize));
01175
01176     // Prepare a buffer for attribute blob
01177     ThrowIfError(CreateMediaBufferWrapper(pStreamDescription->cbAttributesSize, &spAttributes));
01178
01179     // Set length of the buffer
01180     ThrowIfError(spAttributes->SetCurrentLength(pStreamDescription->cbAttributesSize));
01181
01182     // Copy attributes to the buffer
01183     ThrowIfError(MFGetAttributesAsBlob(spMediaTypeToSend.Get(), spAttributes->GetBuffer(), pStreamDescription->cbAttributesSize));
01184
01185     return spAttributes;
01186 }
01187
01188
01189 // Prepare packet with format change information to be sent over the wire
01190 ComPtr<Network::IBufferPacket> CStreamSink::PrepareFormatChange(IMFMediaType *pMediaType)
01191 {
01192     const DWORD c_cbPacketSize = sizeof(StspOperationHeader) + sizeof(StspStreamDescription);
01193
01194     ComPtr<IMediaBufferWrapper> spBuffer;
01195     ThrowIfError(CreateMediaBufferWrapper(c_cbPacketSize, &spBuffer));
01196
01197     // Prepare operation header
01198     BYTE *pBuf = spBuffer->GetBuffer();
01199     StspOperationHeader *pOpHeader = reinterpret_cast<StspOperationHeader *>(pBuf);
01200     pOpHeader->cbDataSize = sizeof(StspStreamDescription);
01201     pOpHeader->eOperation = StspOperation_ServerFormatChange;
01202
01203     // Prepare description
01204     StspStreamDescription *pStreamDescription = reinterpret_cast<StspStreamDescription *>(pBuf + sizeof(StspOperationHeader));
01205     ComPtr<IMediaBufferWrapper> spAttr = FillStreamDescription(pMediaType, pStreamDescription);
01206
01207     // Add size of variable size attribute blob to size of the package.
01208     pOpHeader->cbDataSize += pStreamDescription->cbAttributesSize;
01209
01210     // Set length of the packet
01211     ThrowIfError(spBuffer->SetCurrentLength(c_cbPacketSize));
01212
01213     // Prepare packet to send
01214     ComPtr<IBufferPacket> spPacket;
01215
01216     ThrowIfError(CreateBufferPacket(&spPacket));
01217     // Add fixed size header and description to the packet
01218     ThrowIfError(spPacket->AddBuffer(spBuffer.Get()));
01219     // Add attributes
01220     ThrowIfError(spPacket->AddBuffer(spAttr.Get()));
01221
01222     return spPacket;
01223 }
01224
01225 CStreamSink::CAsyncOperation::CAsyncOperation(StreamOperation op)
01226     : _cRef(1)
01227     , m_op(op)
01228 {
01229 }
01230
01231 CStreamSink::CAsyncOperation::~CAsyncOperation()
01232 {
01233     assert(_cRef == 0);
01234 }
01235
01236 ULONG CStreamSink::CAsyncOperation::AddRef()
01237 {
01238     return InterlockedIncrement(&_cRef);
01239 }
01240
01241 ULONG CStreamSink::CAsyncOperation::Release()
01242 {
01243     ULONG cRef = InterlockedDecrement(&_cRef);
01244     if (cRef == 0)
01245     {
01246         delete this;
01247     }
01248
01249     return cRef;
01250 }
01251
01252 HRESULT CStreamSink::CAsyncOperation::QueryInterface(REFIID iid, void **ppv)
01253 {
01254     if (!ppv)
01255     {
01256         return E_POINTER;
01257     }
01258     if (iid == IID_IUnknown)
01259     {
01260         *ppv = static_cast<IUnknown*>(this);
01261     }
01262     else
01263     {
01264         *ppv = nullptr;
01265         return E_NOINTERFACE;
01266     }
01267     AddRef();
01268     return S_OK;
01269 }
01270
01271 HRESULT CStreamSink::AppendParameterSets(IMFSample *pCopyFrom, IBufferPacket *pPacket)
01272 {
01273     static const BYTE rgbStartCode[] = {0x00, 0x00, 0x00, 0x01};
01274     static const size_t cbStartCode = _countof(rgbStartCode);
01275
01276     ComPtr<IMediaBufferWrapper> spStartCodeBuffer;
01277     ComPtr<IMFMediaBuffer> spMediaBuffer;
01278     ComPtr<IMediaBufferWrapper> spParameterSetsBuffer;
01279     DWORD dwMediaBufferLen = 0;
01280
01281     HRESULT hr = CreateMediaBufferWrapper(cbStartCode, &spStartCodeBuffer);
01282
01283     if (SUCCEEDED(hr))
01284     {
01285         CopyMemory(spStartCodeBuffer->GetBuffer(), rgbStartCode, cbStartCode);
01286         hr = pPacket->InsertBuffer(0, spStartCodeBuffer.Get());
01287     }
01288
01289     if (SUCCEEDED(hr))
01290     {
01291         hr = pCopyFrom->ConvertToContiguousBuffer(&spMediaBuffer);
01292         if (SUCCEEDED(hr))
01293         {
01294             spMediaBuffer->GetCurrentLength(&dwMediaBufferLen);
01295             if (dwMediaBufferLen < sizeof(DWORD))
01296             {
01297                 hr = E_UNEXPECTED;
01298             }
01299         }
01300
01301     }
01302
01303     if (SUCCEEDED(hr))
01304     {
01305         hr = CreateMediaBufferWrapper(spMediaBuffer.Get(), &spParameterSetsBuffer);
01306     }
01307
01308     if (SUCCEEDED(hr))
01309     {
01310         DWORD dwParameterSetLen;
01311         CopyMemory(&dwParameterSetLen, spParameterSetsBuffer->GetBuffer(), sizeof(DWORD));
01312
01313         if (dwMediaBufferLen < dwParameterSetLen)
01314         {
01315             hr = E_UNEXPECTED;
01316         }
01317
01318         if (SUCCEEDED(hr))
01319         {
01320             hr = spParameterSetsBuffer->SetCurrentLength(dwParameterSetLen);
01321         }
01322     }
01323
01324     if (SUCCEEDED(hr))
01325     {
01326         hr = pPacket->InsertBuffer(0, spParameterSetsBuffer.Get());
01327     }
01328
01329     return hr;
01330 }
01331
01332 void CStreamSink::HandleError(HRESULT hr)
01333 {
01334     if (!_IsShutdown)
01335     {
01336         QueueEvent(MEError, GUID_NULL, hr, nullptr);
01337     }
01338 }
Generated on Fri Nov 15 2024 22:21:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/App.xaml.h Source File

  • CameraVideoStabilization
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015
00016 namespace CameraVideoStabilization
00017 {
00018     /// <summary>
00019     /// Provides application-specific behavior to supplement the default Application class.
00020     /// </summary>
00021     ref class App sealed
00022     {
00023     protected:
00024         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00025
00026     internal:
00027         App();
00028
00029     private:
00030         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00031         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00032     };
00033 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cs/SampleConfiguration.cs Source File

  • FullScreenMode
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Full screen mode";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Entering and exiting full screen mode", ClassType=typeof(Scenario1_Basic)},
00025             new Scenario() { Title="Launching into full screen mode", ClassType=typeof(Scenario2_Launch)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cs/Scenario3_Trim.xaml.cs Source File

  • MediaTranscoding
  • cs

Scenario3_Trim.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using System.Threading.Tasks;
00015 using Windows.Media.MediaProperties;
00016 using Windows.Media.Transcoding;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace SDKTemplate
00025 {
00026     public sealed partial class Scenario3_Trim : Page
00027     {
00028         MainPage rootPage = MainPage.Current;
00029
00030         Windows.UI.Core.CoreDispatcher _dispatcher = Window.Current.Dispatcher;
00031         CancellationTokenSource _cts;
00032         string _OutputFileName = "TranscodeSampleOutput";
00033         Windows.Media.MediaProperties.MediaEncodingProfile _Profile;
00034         Windows.Storage.StorageFile _InputFile = null;
00035         Windows.Storage.StorageFile _OutputFile = null;
00036         Windows.Media.Transcoding.MediaTranscoder _Transcoder = new Windows.Media.Transcoding.MediaTranscoder();
00037         string _OutputType = "MP4";
00038         string _OutputFileExtension = ".mp4";
00039
00040         TimeSpan _Start = new TimeSpan(0);
00041         TimeSpan _Stop = new TimeSpan(0);
00042         TimeSpan _c_sec0 = new TimeSpan(0, 0, 0); // 0s
00043         TimeSpan _c_sec1 = new TimeSpan(0, 0, 1); // 1s
00044
00045         public Scenario3_Trim()
00046         {
00047             this.InitializeComponent();
00048             _cts = new CancellationTokenSource();
00049
00050             // Hook up UI
00051             PickFileButton.Click += new RoutedEventHandler(PickFile);
00052             SetOutputButton.Click += new RoutedEventHandler(PickOutput);
00053             TargetFormat.SelectionChanged += new SelectionChangedEventHandler(OnTargetFormatChanged);
00054             Transcode.Click += new RoutedEventHandler(TranscodeTrim);
00055             Cancel.Click += new RoutedEventHandler(TranscodeCancel);
00056             MarkInButton.Click += new RoutedEventHandler(MarkIn);
00057             MarkOutButton.Click += new RoutedEventHandler(MarkOut);
00058
00059             // Disable manual manipulation of trim points
00060             StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
00061             EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
00062             StartTimeText.IsEnabled = false;
00063             EndTimeText.IsEnabled = false;
00064
00065
00066             // Media Controls
00067             InputPlayButton.Click += new RoutedEventHandler(InputPlayButton_Click);
00068             InputPauseButton.Click += new RoutedEventHandler(InputPauseButton_Click);
00069             InputStopButton.Click += new RoutedEventHandler(InputStopButton_Click);
00070             OutputPlayButton.Click += new RoutedEventHandler(OutputPlayButton_Click);
00071             OutputPauseButton.Click += new RoutedEventHandler(OutputPauseButton_Click);
00072             OutputStopButton.Click += new RoutedEventHandler(OutputStopButton_Click);
00073
00074             // File is not selected, disable all buttons but PickFileButton
00075             DisableButtons();
00076             SetPickFileButton(true);
00077             SetOutputFileButton(true);
00078             SetCancelButton(false);
00079         }
00080
00081         public void Dispose()
00082         {
00083             _cts.Dispose();
00084         }
00085
00086         /// <summary>
00087         /// Invoked when this page is about to be displayed in a Frame.
00088         /// </summary>
00089         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00090         /// property is typically used to configure the page.</param>
00091         protected override void OnNavigatedTo(NavigationEventArgs e)
00092         {
00093         }
00094
00095         async void TranscodeTrim(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00096         {
00097             StopPlayers();
00098             DisableButtons();
00099             GetPresetProfile(ProfileSelect);
00100
00101             // Clear messages
00102             StatusMessage.Text = "";
00103
00104             _Transcoder.TrimStartTime = _Start;
00105             _Transcoder.TrimStopTime = _Stop;
00106
00107             try
00108             {
00109                 if (_InputFile != null && _OutputFile != null)
00110                 {
00111                     var preparedTranscodeResult = await _Transcoder.PrepareFileTranscodeAsync(_InputFile, _OutputFile, _Profile);
00112
00113                     if (EnableMrfCrf444.IsChecked.HasValue && (bool)EnableMrfCrf444.IsChecked)
00114                     {
00115                         _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.MrfCrf444;
00116                     }
00117                     else
00118                     {
00119                         _Transcoder.VideoProcessingAlgorithm = MediaVideoProcessingAlgorithm.Default;
00120                     }
00121
00122                     if (preparedTranscodeResult.CanTranscode)
00123                     {
00124                         SetCancelButton(true);
00125                         var progress = new Progress<double>(TranscodeProgress);
00126                         await preparedTranscodeResult.TranscodeAsync().AsTask(_cts.Token, progress);
00127                         TranscodeComplete();
00128                     }
00129                     else
00130                     {
00131                         TranscodeFailure(preparedTranscodeResult.FailureReason);
00132                     }
00133                 }
00134             }
00135             catch (TaskCanceledException)
00136             {
00137                 OutputText("");
00138                 TranscodeError("Transcode Canceled");
00139             }
00140             catch (Exception exception)
00141             {
00142                 TranscodeError(exception.Message);
00143             }
00144         }
00145
00146         void GetPresetProfile(ComboBox combobox)
00147         {
00148             _Profile = null;
00149             VideoEncodingQuality videoEncodingProfile = VideoEncodingQuality.Wvga;
00150             switch (combobox.SelectedIndex)
00151             {
00152                 case 0:
00153                     videoEncodingProfile = VideoEncodingQuality.HD1080p;
00154                     break;
00155                 case 1:
00156                     videoEncodingProfile = VideoEncodingQuality.HD720p;
00157                     break;
00158                 case 2:
00159                     videoEncodingProfile = VideoEncodingQuality.Wvga;
00160                     break;
00161                 case 3:
00162                     videoEncodingProfile = VideoEncodingQuality.Ntsc;
00163                     break;
00164                 case 4:
00165                     videoEncodingProfile = VideoEncodingQuality.Pal;
00166                     break;
00167                 case 5:
00168                     videoEncodingProfile = VideoEncodingQuality.Vga;
00169                     break;
00170                 case 6:
00171                     videoEncodingProfile = VideoEncodingQuality.Qvga;
00172                     break;
00173             }
00174
00175             switch (_OutputType)
00176             {
00177                 case "AVI":
00178                     _Profile = MediaEncodingProfile.CreateAvi(videoEncodingProfile);
00179                     break;
00180                 case "WMV":
00181                     _Profile = MediaEncodingProfile.CreateWmv(videoEncodingProfile);
00182                     break;
00183                 default:
00184                     _Profile = Windows.Media.MediaProperties.MediaEncodingProfile.CreateMp4(videoEncodingProfile);
00185                     break;
00186             }
00187
00188             /*
00189             For transcoding to audio profiles, create the encoding profile using one of these APIs:
00190                 MediaEncodingProfile.CreateMp3(audioEncodingProfile)
00191                 MediaEncodingProfile.CreateM4a(audioEncodingProfile)
00192                 MediaEncodingProfile.CreateWma(audioEncodingProfile)
00193                 MediaEncodingProfile.CreateWav(audioEncodingProfile)
00194
00195             where audioEncodingProfile is one of these presets:
00196                 AudioEncodingQuality.High
00197                 AudioEncodingQuality.Medium
00198                 AudioEncodingQuality.Low
00199             */
00200         }
00201
00202         void MarkIn(Object sender, RoutedEventArgs e)
00203         {
00204             _Start = InputVideo.Position;
00205             StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
00206             // Make sure end time is after start time.
00207             if ((_Start.CompareTo(_Stop) > 0) || (_Start.CompareTo(_Stop) == 0 && _Start != _c_sec0))
00208             {
00209                 _Stop = _Start.Add(_c_sec1);
00210                 EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
00211             }
00212         }
00213
00214         void MarkOut(Object sender, RoutedEventArgs e)
00215         {
00216             _Stop = InputVideo.Position;
00217             EndTimeText.Text = ((float)(_Stop.TotalMilliseconds) / 1000).ToString();
00218             // Make sure end time is after start time.
00219             if ((_Start.CompareTo(_Stop) > 0) || (_Start.CompareTo(_Stop) == 0 && _Start != _c_sec0))
00220             {
00221                 if (_Stop.CompareTo(_c_sec1) > 0)
00222                 {
00223                     _Start = _Stop.Subtract(_c_sec1);
00224                 }
00225                 else
00226                 {
00227                     _Start = _c_sec0;
00228                 }
00229                 StartTimeText.Text = ((float)(_Start.TotalMilliseconds) / 1000).ToString();
00230             }
00231         }
00232
00233         void TranscodeProgress(double percent)
00234         {
00235             OutputText("Progress:  " + percent.ToString().Split('.')[0] + "%");
00236         }
00237
00238         async void TranscodeComplete()
00239         {
00240             OutputText("Transcode completed.");
00241             OutputPathText("Output (" + _OutputFile.Path + ")");
00242             Windows.Storage.Streams.IRandomAccessStream stream = await _OutputFile.OpenAsync(Windows.Storage.FileAccessMode.Read);
00243             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00244             {
00245                 OutputVideo.SetSource(stream, _OutputFile.ContentType);
00246             });
00247
00248             EnableButtons();
00249             SetCancelButton(false);
00250         }
00251
00252         async void TranscodeCancel(object sender, RoutedEventArgs e)
00253         {
00254             try
00255             {
00256                 _cts.Cancel();
00257                 _cts.Dispose();
00258                 _cts = new CancellationTokenSource();
00259
00260                 if (_OutputFile != null)
00261                 {
00262                     await _OutputFile.DeleteAsync();
00263                 }
00264             }
00265             catch (Exception exception)
00266             {
00267                 TranscodeError(exception.Message);
00268             }
00269         }
00270
00271         async void TranscodeFailure(TranscodeFailureReason reason)
00272         {
00273             try
00274             {
00275                 if (_OutputFile != null)
00276                 {
00277                     await _OutputFile.DeleteAsync();
00278                 }
00279             }
00280             catch (Exception exception)
00281             {
00282                 TranscodeError(exception.Message);
00283             }
00284
00285             switch (reason)
00286             {
00287                 case TranscodeFailureReason.CodecNotFound:
00288                     TranscodeError("Codec not found.");
00289                     break;
00290                 case TranscodeFailureReason.InvalidProfile:
00291                     TranscodeError("Invalid profile.");
00292                     break;
00293                 default:
00294                     TranscodeError("Unknown failure.");
00295                     break;
00296             }
00297         }
00298
00299         async void PickFile(object sender, RoutedEventArgs e)
00300         {
00301             Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
00302             picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
00303             picker.FileTypeFilter.Add(".wmv");
00304             picker.FileTypeFilter.Add(".mp4");
00305
00306             Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
00307             if (file != null)
00308             {
00309                 Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
00310
00311                 _InputFile = file;
00312                 InputVideo.SetSource(stream, file.ContentType);
00313                 InputVideo.Play();
00314
00315                 // Enable buttons
00316                 EnableButtons();
00317             }
00318         }
00319
00320         async void PickOutput(object sender, RoutedEventArgs e)
00321         {
00322             FileSavePicker picker = new FileSavePicker();
00323             picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
00324             picker.SuggestedFileName = _OutputFileName;
00325             picker.FileTypeChoices.Add(_OutputType, new System.Collections.Generic.List<string>() { _OutputFileExtension });
00326
00327             _OutputFile = await picker.PickSaveFileAsync();
00328
00329             if (_OutputFile != null)
00330             {
00331                 SetTranscodeButton(true);
00332             }
00333         }
00334
00335         void OnTargetFormatChanged(object sender, SelectionChangedEventArgs e)
00336         {
00337             switch (TargetFormat.SelectedIndex)
00338             {
00339                 case 1:
00340                     _OutputFileExtension = ".wmv";
00341                     _OutputType = "WMV";
00342                     EnableNonSquarePARProfiles();
00343                     break;
00344                 case 2:
00345                     _OutputFileExtension = ".avi";
00346                     _OutputType = "AVI";
00347
00348                     // Disable NTSC and PAL profiles as non-square pixel aspect ratios are not supported by AVI
00349                     DisableNonSquarePARProfiles();
00350                     break;
00351                 default:
00352                     _OutputFileExtension = ".mp4";
00353                     _OutputType = "MP4";
00354                     EnableNonSquarePARProfiles();
00355                     break;
00356             }
00357         }
00358
00359         void InputPlayButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00360         {
00361             if (InputVideo.DefaultPlaybackRate == 0)
00362             {
00363                 InputVideo.DefaultPlaybackRate = 1.0;
00364                 InputVideo.PlaybackRate = 1.0;
00365             }
00366
00367             InputVideo.Play();
00368         }
00369
00370         void InputStopButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00371         {
00372             InputVideo.Stop();
00373         }
00374
00375         void InputPauseButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00376         {
00377             InputVideo.Pause();
00378         }
00379
00380         void OutputPlayButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00381         {
00382             if (OutputVideo.DefaultPlaybackRate == 0)
00383             {
00384                 OutputVideo.DefaultPlaybackRate = 1.0;
00385                 OutputVideo.PlaybackRate = 1.0;
00386             }
00387
00388             OutputVideo.Play();
00389         }
00390
00391         void OutputStopButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00392         {
00393             OutputVideo.Stop();
00394         }
00395
00396         void OutputPauseButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
00397         {
00398             OutputVideo.Pause();
00399         }
00400
00401         async void SetPickFileButton(bool isEnabled)
00402         {
00403             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00404             {
00405                 PickFileButton.IsEnabled = isEnabled;
00406             });
00407         }
00408
00409         async void SetOutputFileButton(bool isEnabled)
00410         {
00411             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00412             {
00413                 SetOutputButton.IsEnabled = isEnabled;
00414             });
00415         }
00416
00417         async void SetTranscodeButton(bool isEnabled)
00418         {
00419             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00420             {
00421                 Transcode.IsEnabled = isEnabled;
00422             });
00423         }
00424
00425         async void SetCancelButton(bool isEnabled)
00426         {
00427             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00428             {
00429                 Cancel.IsEnabled = isEnabled;
00430             });
00431         }
00432
00433         async void EnableButtons()
00434         {
00435             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00436             {
00437                 PickFileButton.IsEnabled = true;
00438                 SetOutputButton.IsEnabled = true;
00439                 TargetFormat.IsEnabled = true;
00440                 ProfileSelect.IsEnabled = true;
00441                 MarkInButton.IsEnabled = true;
00442                 MarkOutButton.IsEnabled = true;
00443                 EnableMrfCrf444.IsEnabled = true;
00444
00445                 // The transcode button's initial state should be disabled until an output
00446                 // file has been set.
00447                 Transcode.IsEnabled = false;
00448             });
00449         }
00450
00451         async void DisableButtons()
00452         {
00453             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00454             {
00455                 ProfileSelect.IsEnabled = false;
00456                 Transcode.IsEnabled = false;
00457                 PickFileButton.IsEnabled = false;
00458                 SetOutputButton.IsEnabled = false;
00459                 TargetFormat.IsEnabled = false;
00460                 MarkInButton.IsEnabled = false;
00461                 MarkOutButton.IsEnabled = false;
00462                 EnableMrfCrf444.IsEnabled = false;
00463             });
00464         }
00465
00466         void EnableNonSquarePARProfiles()
00467         {
00468             ComboBoxItem_NTSC.IsEnabled = true;
00469             ComboBoxItem_PAL.IsEnabled = true;
00470         }
00471
00472         void DisableNonSquarePARProfiles()
00473         {
00474             ComboBoxItem_NTSC.IsEnabled = false;
00475             ComboBoxItem_PAL.IsEnabled = false;
00476
00477             // Ensure a valid profile is set
00478             if ((ProfileSelect.SelectedIndex == 3) || (ProfileSelect.SelectedIndex == 4))
00479             {
00480                 ProfileSelect.SelectedIndex = 2;
00481             }
00482         }
00483
00484         async void StopPlayers()
00485         {
00486             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00487             {
00488                 if (InputVideo.CurrentState != MediaElementState.Paused)
00489                 {
00490                     InputVideo.Pause();
00491                 }
00492                 if (OutputVideo.CurrentState != MediaElementState.Paused)
00493                 {
00494                     OutputVideo.Pause();
00495                 }
00496             });
00497         }
00498
00499         async void PlayFile(Windows.Storage.StorageFile MediaFile)
00500         {
00501             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00502             {
00503                 try
00504                 {
00505                     Windows.Storage.Streams.IRandomAccessStream stream = await MediaFile.OpenAsync(FileAccessMode.Read);
00506                     OutputVideo.SetSource(stream, MediaFile.ContentType);
00507                     OutputVideo.Play();
00508                 }
00509                 catch (Exception exception)
00510                 {
00511                     TranscodeError(exception.Message);
00512                 }
00513             });
00514         }
00515
00516         async void TranscodeError(string error)
00517         {
00518             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00519             {
00520                 StatusMessage.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Red);
00521                 StatusMessage.Text = error;
00522             });
00523
00524             EnableButtons();
00525             SetCancelButton(false);
00526         }
00527
00528         async void OutputText(string text)
00529         {
00530             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00531             {
00532                 OutputMsg.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green);
00533                 OutputMsg.Text = text;
00534             });
00535         }
00536
00537         async void OutputPathText(string text)
00538         {
00539             await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00540             {
00541                 OutputPath.Text = text;
00542             });
00543         }
00544     }
00545 }
Generated on Fri Nov 15 2024 22:20:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/HandHandler.h Source File

  • SpatialInteractionSource
  • cpp

HandHandler.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "SourceHandler.h"
00003
00004 namespace HolographicPaint
00005 {
00006
00007     // Implements handling of interactions for hands
00008     class HandHandler : public SourceHandler
00009     {
00010
00011     public:
00012         HandHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^ source, ISourceCommandHandler* eventsHandler, std::shared_ptr<Whiteboard>& target);
00013         ~HandHandler();
00014
00015         virtual void OnSourceUpdated(Windows::UI::Input::Spatial::SpatialInteractionSourceState^ state, Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00016         virtual void OnInteractionDetected(Windows::UI::Input::Spatial::SpatialInteraction^ interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem) override;
00017
00018     private:
00019         // For Hands, we map commands based on Gestures detection
00020         Windows::UI::Input::Spatial::SpatialGestureRecognizer^ m_gestureRecognizer;
00021         Windows::Perception::Spatial::SpatialCoordinateSystem^ m_coordinateSystem;
00022         Windows::Foundation::Numerics::float3 m_initialPosition;
00023
00024         Windows::Foundation::EventRegistrationToken m_tappedToken;
00025         Windows::Foundation::EventRegistrationToken m_navigationStartedToken;
00026         Windows::Foundation::EventRegistrationToken m_navigationCompletedToken;
00027         Windows::Foundation::EventRegistrationToken m_manipulationStartedToken;
00028         Windows::Foundation::EventRegistrationToken m_manipulationCompletedToken;
00029         Windows::Foundation::EventRegistrationToken m_manipulationCanceledToken;
00030         Windows::Foundation::EventRegistrationToken m_manipulationUpdatedToken;
00031
00032         void OnTapped(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs ^args);
00033         void OnNavigationStarted(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialNavigationStartedEventArgs ^args);
00034         void OnNavigationCompleted(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialNavigationCompletedEventArgs ^args);
00035         void OnManipulationStarted(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialManipulationStartedEventArgs ^args);
00036         void OnManipulationCanceled(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialManipulationCanceledEventArgs ^args);
00037         void OnManipulationCompleted(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialManipulationCompletedEventArgs ^args);
00038         void OnManipulationUpdated(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialManipulationUpdatedEventArgs ^args);
00039
00040         void HitTestTargetWithGaze(Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose);
00041     };
00042
00043 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/App.xaml.cs Source File

  • Notifications
  • cs
  • Notifications

App.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Notifications.Model;
00003 using System;
00004 using Windows.ApplicationModel;
00005 using Windows.ApplicationModel.Activation;
00006 using Windows.UI.Popups;
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009 using Windows.UI.Xaml.Navigation;
00010
00011 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00012
00013 namespace Notifications
00014 {
00015     /// <summary>
00016     /// Provides application-specific behavior to supplement the default Application class.
00017     /// </summary>
00018     sealed partial class App : Application
00019     {
00020         public EventHandler<IActivatedEventArgs> Activated;
00021
00022         public static IActivatedEventArgs ActivatedEventArgs;
00023         public static LaunchActivatedEventArgs LaunchedEventArgs;
00024
00025         /// <summary>
00026         /// Initializes the singleton application object.  This is the first line of authored code
00027         /// executed, and as such is the logical equivalent of main() or WinMain().
00028         /// </summary>
00029         public App()
00030         {
00031             this.InitializeComponent();
00032             this.Suspending += OnSuspending;
00033             this.UnhandledException += Application_UnhandledException;
00034         }
00035
00036         /// <summary>
00037         /// Invoked when the application is launched normally by the end user.  Other entry points
00038         /// will be used such as when the application is launched to open a specific file.
00039         /// </summary>
00040         /// <param name="e">Details about the launch request and process.</param>
00041         protected override void OnLaunched(LaunchActivatedEventArgs e)
00042         {
00043             LaunchedEventArgs = e;
00044
00045             Initialize(e);
00046         }
00047
00048         private void Initialize(IActivatedEventArgs e)
00049         {
00050 #if DEBUG
00051             if (System.Diagnostics.Debugger.IsAttached)
00052             {
00053                 this.DebugSettings.EnableFrameRateCounter = true;
00054             }
00055 #endif
00056
00057             Frame rootFrame = Window.Current.Content as Frame;
00058
00059             // Do not repeat app initialization when the Window already has content,
00060             // just ensure that the window is active
00061             if (rootFrame == null)
00062             {
00063                 // Create a Frame to act as the navigation context and navigate to the first page
00064                 rootFrame = new Frame();
00065
00066                 rootFrame.NavigationFailed += OnNavigationFailed;
00067
00068                 if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
00069                 {
00070                     //TODO: Load state from previously suspended application
00071                 }
00072
00073                 // Place the frame in the current Window
00074                 Window.Current.Content = rootFrame;
00075             }
00076
00077             if (rootFrame.Content == null)
00078             {
00079                 if (Settings.ScenarioToOpenWhenLaunchedOrActivated != null)
00080                 {
00081                     rootFrame.Navigate(typeof(ScenarioPage), Scenarios.MainGroup.FindScenario(Settings.ScenarioToOpenWhenLaunchedOrActivated));
00082                 }
00083
00084                 else
00085                 {
00086
00087                     // When the navigation stack isn't restored navigate to the first page,
00088                     // configuring the new page by passing required information as a navigation
00089                     // parameter
00090                     rootFrame.Navigate(typeof(MainPage));
00091                 }
00092             }
00093             // Ensure the current window is active
00094             Window.Current.Activate();
00095         }
00096
00097         /// <summary>
00098         /// If the app is closed and something triggers foreground activation, OnLaunched isn't even executed, only OnActivated is executed.
00099         /// </summary>
00100         /// <param name="args"></param>
00101         protected override void OnActivated(IActivatedEventArgs args)
00102         {
00103             ActivatedEventArgs = args;
00104
00105             if (Activated != null)
00106             {
00107                 Activated(this, args);
00108             }
00109
00110             Initialize(args);
00111         }
00112
00113         /// <summary>
00114         /// Invoked when Navigation to a certain page fails
00115         /// </summary>
00116         /// <param name="sender">The Frame which failed navigation</param>
00117         /// <param name="e">Details about the navigation failure</param>
00118         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00119         {
00120             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00121         }
00122
00123         /// <summary>
00124         /// Invoked when application execution is being suspended.  Application state is saved
00125         /// without knowing whether the application will be terminated or resumed with the contents
00126         /// of memory still intact.
00127         /// </summary>
00128         /// <param name="sender">The source of the suspend request.</param>
00129         /// <param name="e">Details about the suspend request.</param>
00130         private void OnSuspending(object sender, SuspendingEventArgs e)
00131         {
00132             var deferral = e.SuspendingOperation.GetDeferral();
00133             //TODO: Save application state and stop any background activity
00134             deferral.Complete();
00135         }
00136
00137         private async void Application_UnhandledException(object sender, UnhandledExceptionEventArgs e)
00138         {
00139             e.Handled = true;
00140
00141             await new MessageDialog(e.Exception.ToString(), "Unknown Error").ShowAsync();
00142         }
00143     }
00144 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/Project.idl Source File

  • RadioManager
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Toggle : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Toggle();
00018     }
00019
00020     [Windows.UI.Xaml.Data.Bindable]
00021     runtimeclass RadioModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
00022     {
00023         String Name { get; };
00024         Boolean IsEnabled{ get; };
00025         Boolean IsRadioOn;
00026     }
00027 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cpp/Scenario1_Basic.xaml.h Source File

  • UserInteractionMode
  • cpp

Scenario1_Basic.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Basic.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1_Basic sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
00021     {
00022     public:
00023         Scenario1_Basic();
00024
00025         virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00026
00027         property Windows::UI::ViewManagement::UserInteractionMode InteractionMode
00028         {
00029             Windows::UI::ViewManagement::UserInteractionMode get()
00030             {
00031                 return interactionMode;
00032             }
00033             void set(Windows::UI::ViewManagement::UserInteractionMode value)
00034             {
00035                 if (interactionMode != value)
00036                 {
00037                     interactionMode = value;
00038                     PropertyChanged(this, ref new Windows::UI::Xaml::Data::PropertyChangedEventArgs("InteractionMode"));
00039                 }
00040             }
00041         }
00042
00043         property Windows::UI::Xaml::Style^ CheckBoxStyle
00044         {
00045             Windows::UI::Xaml::Style^ get()
00046             {
00047                 return checkBoxStyle;
00048             }
00049             void set(Windows::UI::Xaml::Style^ value)
00050             {
00051                 if (checkBoxStyle != value)
00052                 {
00053                     checkBoxStyle = value;
00054                     PropertyChanged(this, ref new Windows::UI::Xaml::Data::PropertyChangedEventArgs("CheckBoxStyle"));
00055                 }
00056             }
00057         }
00058
00059     protected:
00060         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00061         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00062
00063     private:
00064         MainPage^ rootPage;
00065         Windows::UI::ViewManagement::UserInteractionMode interactionMode;
00066         Windows::UI::Xaml::Style^ checkBoxStyle;
00067
00068         void OnWindowResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
00069         void UpdateContent();
00070
00071         Windows::Foundation::EventRegistrationToken windowResizeToken;
00072     };
00073 }
Generated on Fri Nov 15 2024 22:19:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceResources Member List

This is the complete list of members for DeviceResources, including all inherited members.
AddHolographicCamera(HolographicCamera camera) | DeviceResources | [inline]
cameraResourcesDictionary | DeviceResources | [private]
cameraResourcesLock | DeviceResources | [private]
CreateDeviceIndependentResources() | DeviceResources | [inline, private]
CreateDeviceResources() | DeviceResources | [inline, private]
D2DFactory | DeviceResources |
d2dFactory | DeviceResources | [private]
d3dContext | DeviceResources | [private]
d3dDevice | DeviceResources | [private]
D3DDevice | DeviceResources |
D3DDeviceContext | DeviceResources |
D3DDeviceFeatureLevel | DeviceResources |
D3DDeviceSupportsVprt | DeviceResources |
d3dDeviceSupportsVprt | DeviceResources | [private]
d3dFeatureLevel | DeviceResources | [private]
D3DInteropDevice | DeviceResources |
d3dInteropDevice | DeviceResources | [private]
DeviceLost | DeviceResources |
DeviceResources() | DeviceResources | [inline]
DeviceRestored | DeviceResources |
Dispose() | Disposer | [inline]
Dispose(bool disposeManagedResources) | Disposer | [inline, protected, virtual]
DisposeDeviceAndContext() | DeviceResources | [inline, private]
Disposer() | Disposer | [inline, protected]
dwriteFactory | DeviceResources | [private]
DWriteFactory | DeviceResources |
DxgiAdapter | DeviceResources |
dxgiAdapter | DeviceResources | [private]
EnsureCameraResources(HolographicFrame frame, HolographicFramePrediction prediction) | DeviceResources | [inline]
HandleDeviceLost() | DeviceResources | [inline]
holographicSpace | DeviceResources | [private]
InitializeUsingHolographicSpace() | DeviceResources | [inline]
IsDisposed | Disposer | [protected]
Present(ref HolographicFrame frame) | DeviceResources | [inline]
RemoveAndDispose< T >(ref T objectToDispose) | Disposer | [inline, protected]
RemoveHolographicCamera(HolographicCamera camera) | DeviceResources | [inline]
RemoveToDispose< T >(T objectToRemove) | Disposer | [inline, protected]
SetHolographicSpace(HolographicSpace holographicSpace) | DeviceResources | [inline]
SwapChainAction(Dictionary< uint, CameraResources > cameraResourcesDictionary) | DeviceResources |
SwapChainActionWithResult(Dictionary< uint, CameraResources > cameraResourcesDictionary) | DeviceResources |
ToDispose< T >(T objectToDispose) | Disposer | [inline, protected]
Trim() | DeviceResources | [inline]
UseHolographicCameraResources(SwapChainActionWithResult callback) | DeviceResources | [inline]
UseHolographicCameraResources(SwapChainAction callback) | DeviceResources | [inline]
wicFactory | DeviceResources | [private]
WicImagingFactory | DeviceResources |
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S4_CheckIndexRevision.xaml.h Source File

  • ContentIndexer
  • cpp

S4_CheckIndexRevision.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S4_CheckIndexRevision.xaml.h
00014 // Declaration of the S4_CheckIndexRevision class
00015 //
00016
00017 #pragma once
00018 #include "S4_CheckIndexRevision.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class S4_CheckIndexRevision sealed
00023     {
00024     public:
00025         S4_CheckIndexRevision();
00026
00027     private:
00028         void CheckIndexRevision_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/Scenario1.cpp Source File

  • FileSearch
  • cppwinrt

Scenario1.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1.h"
00014 #include "Scenario1.g.cpp"
00015 #include <sstream>
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::Search;
00022 using namespace Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario1::Scenario1()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     fire_and_forget Scenario1::SearchButton_Click(IInspectable const&, RoutedEventArgs const&)
00032     {
00033         auto lifetime = get_strong();
00034
00035         StorageFolder musicFolder = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::MusicLibrary);
00036
00037         QueryOptions queryOptions(CommonFileQuery::OrderBySearchRank, { L"*" });
00038         //use the user's input to make a query
00039         queryOptions.UserSearchFilter(InputTextBox().Text());
00040         StorageFileQueryResult queryResult = musicFolder.CreateFileQueryWithOptions(queryOptions);
00041
00042         std::wstringstream output;
00043
00044         //find all files that match the query
00045         IVectorView<StorageFile> files = co_await queryResult.GetFilesAsync();
00046         //output how many files that match the query were found
00047         if (files.Size() == 0)
00048         {
00049             output << L"No files found for '" << std::wstring_view{ queryOptions.UserSearchFilter() } << L"'";
00050         }
00051         else if (files.Size() == 1)
00052         {
00053             output << files.Size() << L" file found:" << std::endl << std::endl;
00054         }
00055         else
00056         {
00057             output << files.Size() << L" files found:" << std::endl << std::endl;
00058         }
00059
00060         //output the name of each file that matches the query
00061         for (StorageFile const& file : files)
00062         {
00063             output << std::wstring_view{ file.Name() } << std::endl;
00064         }
00065
00066         OutputTextBlock().Text(output.str());
00067     }
00068 }
Generated on Fri Nov 15 2024 22:19:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_BackgroundTask Member List

This is the complete list of members for Scenario2_BackgroundTask, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario2_BackgroundTask | [inline, protected]
rootPage | Scenario2_BackgroundTask | [private]
Scenario2_BackgroundTask() | Scenario2_BackgroundTask | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UserViewModel Member List

This is the complete list of members for UserViewModel, including all inherited members.
DisplayName | UserViewModel |
displayName | UserViewModel | [private]
PropertyChanged | UserViewModel |
UserId | UserViewModel |
UserViewModel(String userId, String displayName) | UserViewModel | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario2_SimpleGridView.h Source File

  • XamlListView
  • cppwinrt

Scenario2_SimpleGridView.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario2_SimpleGridView.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct Scenario2_SimpleGridView : Scenario2_SimpleGridViewT<Scenario2_SimpleGridView>
00018     {
00019         Scenario2_SimpleGridView();
00020     };
00021 }
00022
00023 namespace winrt::SDKTemplate::factory_implementation
00024 {
00025     struct Scenario2_SimpleGridView : Scenario2_SimpleGridViewT<Scenario2_SimpleGridView, implementation::Scenario2_SimpleGridView>
00026     {
00027     };
00028 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario3_CredentialPickerOptions.xaml.cs Source File

  • CredentialPicker
  • cs

Scenario3_CredentialPickerOptions.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009 using SDKTemplate;
00010 using System;
00011 using Windows.Security.Credentials.UI;
00012
00013 namespace CredentialPicker
00014 {
00015     public sealed partial class Scenario3_CredentialPickerOptions : Page
00016     {
00017         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00018         // as NotifyUser()
00019         MainPage rootPage = MainPage.Current;
00020
00021         public Scenario3_CredentialPickerOptions()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         void SetError(string err)
00027         {
00028             rootPage.NotifyUser(err, NotifyType.ErrorMessage);
00029         }
00030
00031         void SetPasswordExplainVisibility(bool isShown)
00032         {
00033             if (isShown)
00034             {
00035                 PasswordExplain1.Visibility = Windows.UI.Xaml.Visibility.Visible;
00036                 PasswordExplain2.Visibility = Windows.UI.Xaml.Visibility.Visible;
00037             }
00038             else
00039             {
00040                 PasswordExplain1.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00041                 PasswordExplain2.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00042             }
00043         }
00044
00045         void SetResult(CredentialPickerResults res)
00046         {
00047             if (res.ErrorCode == 0)
00048             {
00049                 Status.Text = String.Format("OK");
00050             }
00051             else
00052             {
00053                 Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
00054             }
00055
00056             Domain.Text = res.CredentialDomainName;
00057             Username.Text = res.CredentialUserName;
00058             Password.Text = res.CredentialPassword;
00059             CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
00060             switch (res.CredentialSaveOption)
00061             {
00062                 case CredentialSaveOption.Hidden:
00063                     CheckboxState.Text = "Hidden";
00064                     break;
00065                 case CredentialSaveOption.Selected:
00066                     CheckboxState.Text = "Selected";
00067                     break;
00068                 case CredentialSaveOption.Unselected:
00069                     CheckboxState.Text = "Unselected";
00070                     break;
00071             }
00072         }
00073
00074
00075         private async void Launch_Click(object sender, RoutedEventArgs e)
00076         {
00077             if ((Target.Text == "") || (Message.Text == "") || (Caption.Text == ""))
00078             {
00079                 return;
00080             }
00081
00082             CredentialPickerOptions credPickerOptions = new CredentialPickerOptions();
00083             credPickerOptions.Message = Message.Text;
00084             credPickerOptions.Caption = Caption.Text;
00085             credPickerOptions.TargetName = Target.Text;
00086             credPickerOptions.AlwaysDisplayDialog = (AlwaysShowDialog.IsChecked == true);
00087             if (ProtocolSelection.SelectedItem == null)
00088             {
00089                 //default protocol, if no selection
00090                 credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Negotiate;
00091             }
00092             else
00093             {
00094                 string selectedProtocol = ((ComboBoxItem)ProtocolSelection.SelectedItem).Content.ToString();
00095                 if (selectedProtocol.Equals("Kerberos", StringComparison.CurrentCultureIgnoreCase))
00096                 {
00097                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Kerberos;
00098                 }
00099                 else if (selectedProtocol.Equals("Negotiate", StringComparison.CurrentCultureIgnoreCase))
00100                 {
00101                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Negotiate;
00102                 }
00103                 else if (selectedProtocol.Equals("NTLM", StringComparison.CurrentCultureIgnoreCase))
00104                 {
00105                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Ntlm;
00106                 }
00107                 else if (selectedProtocol.Equals("CredSsp", StringComparison.CurrentCultureIgnoreCase))
00108                 {
00109                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.CredSsp;
00110                 }
00111                 else if (selectedProtocol.Equals("Basic", StringComparison.CurrentCultureIgnoreCase))
00112                 {
00113                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Basic;
00114                 }
00115                 else if (selectedProtocol.Equals("Digest", StringComparison.CurrentCultureIgnoreCase))
00116                 {
00117                     credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Digest;
00118                 }
00119                 else if (selectedProtocol.Equals("Custom", StringComparison.CurrentCultureIgnoreCase))
00120                 {
00121                     if (CustomProtocol.Text != null && CustomProtocol.Text != String.Empty)
00122                     {
00123                         credPickerOptions.AuthenticationProtocol = AuthenticationProtocol.Custom;
00124                         credPickerOptions.CustomAuthenticationProtocol = CustomProtocol.Text;
00125                     }
00126                     else
00127                     {
00128                         rootPage.NotifyUser("Please enter a custom protocol", NotifyType.ErrorMessage);
00129                     }
00130                 }
00131             }
00132
00133             if (SaveCheckboxSelection.SelectedItem != null)
00134             {
00135                 string checkboxState = ((ComboBoxItem)SaveCheckboxSelection.SelectedItem).Content.ToString();
00136                 if (checkboxState.Equals("Hidden",StringComparison.CurrentCultureIgnoreCase))
00137                 {
00138                     credPickerOptions.CredentialSaveOption = CredentialSaveOption.Hidden;
00139                 }
00140                 else if (checkboxState.Equals("Selected", StringComparison.CurrentCultureIgnoreCase))
00141                 {
00142                     credPickerOptions.CredentialSaveOption = CredentialSaveOption.Selected;
00143                 }
00144                 else if (checkboxState.Equals("Unselected", StringComparison.CurrentCultureIgnoreCase))
00145                 {
00146                     credPickerOptions.CredentialSaveOption = CredentialSaveOption.Unselected;
00147                 }
00148             }
00149
00150             var credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(credPickerOptions);
00151             SetResult(credPickerResults);
00152         }
00153
00154         private void Protocol_SelectionChanged(object sender, SelectionChangedEventArgs e)
00155         {
00156             ComboBox box = sender as ComboBox;
00157             if (CustomProtocol == null || ProtocolSelection == null || ProtocolSelection.SelectedItem == null)
00158             {
00159                 //return if this was triggered before all components are initialized
00160                 return;
00161             }
00162
00163             string selectedProtocol = ((ComboBoxItem)ProtocolSelection.SelectedItem).Content.ToString();
00164
00165             if (selectedProtocol.Equals("Custom", StringComparison.CurrentCultureIgnoreCase))
00166             {
00167                 CustomProtocol.IsEnabled = true;
00168             }
00169             else
00170             {
00171                 CustomProtocol.IsEnabled = false;
00172                 //Basic and Digest return plaintext passwords
00173                 if (selectedProtocol.Equals("Basic",StringComparison.CurrentCultureIgnoreCase))
00174                 {
00175                     SetPasswordExplainVisibility(false);
00176                 }
00177                 else if (selectedProtocol.Equals("Digest",StringComparison.CurrentCultureIgnoreCase))
00178                 {
00179                     SetPasswordExplainVisibility(false);
00180                 }
00181                 else
00182                 {
00183                     SetPasswordExplainVisibility(true);
00184                 }
00185             }
00186         }
00187
00188
00189     }
00190 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Single Member List

This is the complete list of members for Scenario1_Single, including all inherited members.
ClearOutputs() | Scenario1_Single | [inline, private]
PickContactEmail() | Scenario1_Single | [inline, private]
PickContactPhone() | Scenario1_Single | [inline, private]
ReportContactResult(Contact contact) | Scenario1_Single | [inline, private]
rootPage | Scenario1_Single | [private]
Scenario1_Single() | Scenario1_Single | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_MultipleClaims Member List

This is the complete list of members for Scenario3_MultipleClaims, including all inherited members.
ClaimSamePrinter_Click() | Scenario3_MultipleClaims | [inline, private]
rootPage | Scenario3_MultipleClaims | [private]
Scenario3_MultipleClaims() | Scenario3_MultipleClaims | [inline]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/SampleConfiguration.cpp Source File

  • LightSensor
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" }
00022 };
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/Scenario1.xaml.cs Source File

  • MediaImport
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using DataBinding;
00013 using SDKTemplate;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Linq;
00017 using System.Text;
00018 using System.Threading;
00019 using Windows.ApplicationModel.Activation;
00020 using Windows.Media.Import;
00021 using Windows.UI.Core;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024 using Windows.UI.Xaml.Navigation;
00025 using System.ComponentModel;
00026
00027 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00028
00029 namespace ImportSample
00030 {
00031     /// <summary>
00032     /// An empty page that can be used on its own or navigated to within a Frame.
00033     /// </summary>
00034     public sealed partial class Scenario1 : Page , INotifyPropertyChanged
00035     {
00036         private MainPage rootPage;
00037         private PhotoImportSession session;
00038         private PhotoImportSource importSource;
00039         private PhotoImportFindItemsResult itemsResult;
00040         private PhotoImportImportItemsResult importedResult;
00041         private PhotoImportDeleteImportedItemsFromSourceResult deleteResult;
00042         private CancellationTokenSource cts;
00043         private DeviceActivatedEventArgs arguments;
00044         private PhotoImportContentTypeFilter contentTypeFilder;
00045
00046         // GeneratorIncrementalLoadingClass taken from MSDN example https://code.msdn.microsoft.com/windowsapps/Data-Binding-7b1d67b5
00047         // Used to incrementally load items in the Listview view including thumbnails
00048         GeneratorIncrementalLoadingClass<ImportableItemWrapper> itemsToImport = null;
00049
00050         public Scenario1()
00051         {
00052             this.InitializeComponent();
00053             this.DataContext = this;
00054         }
00055
00056
00057         public bool AppendSessionDateToDestinationFolder
00058         {
00059             get
00060             {
00061                 if (session != null)
00062                 {
00063                     return session.AppendSessionDateToDestinationFolder;
00064                 }
00065                 else
00066                 {
00067                     return false;
00068                 }
00069             }
00070             set
00071             {
00072                 if (session != null)
00073                 {
00074                     session.AppendSessionDateToDestinationFolder = value;
00075                     RaisePropertyChanged("AppendSessionDateToDestinationFolder");
00076                 }
00077             }
00078         }
00079
00080         /// <summary>
00081         /// Enumerate all PTP / MTP sources when FindAllSources button is clicked.
00082         /// </summary>
00083         /// <param name="sender">The source of the click event</param>
00084         /// <param name="e">Details about the click event </param>
00085         private async void OnFindSourcesClicked(object sender, RoutedEventArgs e)
00086         {
00087             try
00088             {
00089                 rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
00090
00091                 // clear our list of items to import
00092                 this.itemsToImport = null;
00093                 this.fileListView.ItemsSource = this.itemsToImport;
00094
00095                 // reset UI elements
00096                 this.progressBar.Value = 0.0;
00097                 this.propertiesTxtBox.Text = "";
00098
00099                 // disable all buttons until source selection is made
00100                 setButtonState(false);
00101
00102                 // reenable source selection
00103                 this.sourceListBox.IsEnabled = true;
00104
00105                 // clear find criteria
00106                 this.OnlyImages.IsChecked = false;
00107                 this.OnlyVideo.IsChecked = false;
00108                 this.ImagesAndVideo.IsChecked = false;
00109
00110
00111
00112                 // Dispose any created import session
00113                 if (this.session != null)
00114                 {
00115                     this.session.Dispose();
00116                     this.session = null;
00117                 }
00118
00119                 // Check to ensure API is supported
00120                 bool importSupported = await PhotoImportManager.IsSupportedAsync();
00121
00122                 if (importSupported)
00123                 {
00124                     // enumerate all available sources to where we can import from
00125                     sourceListBox.ItemsSource = await PhotoImportManager.FindAllSourcesAsync();
00126                 }
00127                 else
00128                 {
00129                     rootPage.NotifyUser("Import is not supported.", NotifyType.ErrorMessage);
00130                 }
00131             }
00132             catch (Exception ex)
00133             {
00134                 rootPage.NotifyUser("FindAllSourcesAsync Failed. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
00135             }
00136         }
00137
00138         /// <summary>
00139         /// Display the source properties when a new source is selected.
00140         /// </summary>
00141         /// <param name="sender">The source of the selection changed event</param>
00142         /// <param name="e">Details about the selection chagned event</param>
00143         private void  SourceList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00144         {
00145             // reset any previous items
00146             this.itemsToImport = null;
00147             this.fileListView.ItemsSource = null;
00148
00149             // clear any values in the source properties
00150             this.propertiesTxtBox.Text = "";
00151
00152             if (e.AddedItems.Count != 0)
00153             {
00154                 // enable find options
00155                 this.OnlyImages.IsEnabled = true;
00156                 this.OnlyVideo.IsEnabled = true;
00157                 this.ImagesAndVideo.IsEnabled = true;
00158
00159                 // set the default to find Images and Video
00160                 this.ImagesAndVideo.IsChecked = true;
00161
00162                 this.importSource = e.AddedItems.First() as PhotoImportSource;
00163                 DisplaySourceProperties();
00164
00165                 // enable Find New and Find All buttons, disable the rest
00166                 this.findNewItemsButton.IsEnabled = true;
00167                 this.findAllItemsButton.IsEnabled = true;
00168                 this.selectNewButton.IsEnabled = false;
00169                 this.selectNoneButton.IsEnabled = false;
00170                 this.selectAllButton.IsEnabled = false;
00171                 this.deleteButton.IsEnabled = false;
00172                 this.importButton.IsEnabled = false;
00173             }
00174         }
00175
00176         /// <summary>
00177         /// Enumerate new importable items from the source when FindAllItems button is clicked
00178         /// </summary>
00179         /// <param name="sender">The source of the click event</param>
00180         /// <param name="e">Details about the click event</param>
00181         private void OnFindNewItemsClicked(object sender, RoutedEventArgs e)
00182         {
00183             findItems(this.contentTypeFilder, PhotoImportItemSelectionMode.SelectNew);
00184         }
00185
00186         /// <summary>
00187         /// Enumerate all importable items from the source when FindAllItems button is clicked
00188         /// </summary>
00189         /// <param name="sender">The source of the click event</param>
00190         /// <param name="e">Details about the click event</param>
00191         private void OnFindAllItemsClicked(object sender, RoutedEventArgs e)
00192         {
00193             findItems(this.contentTypeFilder, PhotoImportItemSelectionMode.SelectAll);
00194         }
00195
00196         /// <summary>
00197         /// Helper method to Enumerate all importable items
00198         /// </summary>
00199         /// <param name="contentType">the content type</param>
00200         /// <param name="selectionMode">the selection mode</param>
00201         private async void findItems(PhotoImportContentTypeFilter contentType, PhotoImportItemSelectionMode selectionMode)
00202         {
00203             rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
00204
00205             // Disable buttons and lists to prevent unexpected reentrance.
00206             setButtonState(false);
00207             this.sourceListBox.IsEnabled = false;
00208
00209             this.cts = new CancellationTokenSource();
00210
00211             try
00212             {
00213                 this.progressRing.IsActive = true;
00214                 this.itemsToImport = null;
00215                 this.fileListView.ItemsSource = null;
00216
00217                 // Dispose any created import session
00218                 if (this.session != null)
00219                 {
00220                     this.session.Dispose();
00221                     this.session = null;
00222                 }
00223
00224                 // Create the import session from the source selected
00225                 this.session = importSource.CreateImportSession();
00226
00227                 RaisePropertyChanged("AppendSessionDateToDestinationFolder");
00228
00229                 // Progress handler for FindItemsAsync
00230                 var progress = new Progress<uint>((result) =>
00231                 {
00232                     rootPage.NotifyUser(String.Format("Found {0} Files", result.ToString()), NotifyType.StatusMessage);
00233                 });
00234
00235                 // Find all items available importable item from our source
00236                 this.itemsResult = await session.FindItemsAsync(contentType, selectionMode).AsTask(cts.Token, progress);
00237
00238                 setIncrementalFileList(this.itemsResult);
00239                 DisplayFindItemsResult();
00240
00241                 if (this.itemsResult.HasSucceeded)
00242                 {
00243                     // disable Find New , Find All and Delete button.
00244                     this.findNewItemsButton.IsEnabled = false;
00245                     this.findAllItemsButton.IsEnabled = false;
00246                     this.deleteButton.IsEnabled = false;
00247
00248                     // enable list selection , folder options and import buttons
00249                     this.selectNewButton.IsEnabled = true;
00250                     this.selectNoneButton.IsEnabled = true;
00251                     this.selectAllButton.IsEnabled = true;
00252                     this.importButton.IsEnabled = true;
00253                     this.fileListView.IsEnabled = true;
00254                     this.AddSessionDateFolder.IsEnabled = true;
00255                     this.NoSubFolder.IsEnabled = true;
00256                     this.FileDateSubfolder.IsEnabled = true;
00257                     this.ExifDateSubfolder.IsEnabled = true;
00258                     this.KeepOriginalFolder.IsEnabled = true;
00259
00260                 }
00261                 else
00262                 {
00263                     rootPage.NotifyUser("FindItemsAsync did not succeed or was not completed.", NotifyType.StatusMessage);
00264
00265                     // re-enable Find New and Find All buttons
00266                     this.findNewItemsButton.IsEnabled = true;
00267                     this.findAllItemsButton.IsEnabled = true;
00268
00269                     this.progressRing.IsActive = false;
00270                 }
00271
00272                 this.progressRing.IsActive = false;
00273
00274                 // Set the CancellationTokenSource to null when the work is complete.
00275                 cts = null;
00276             }
00277             catch (Exception ex)
00278             {
00279                 rootPage.NotifyUser("Error: Operation incomplete. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
00280             }
00281         }
00282
00283
00284         /// <summary>
00285         /// Initiate the import operation when the Import button is clicked.
00286         /// </summary>
00287         /// <param name="sender">Source of the click event</param>
00288         /// <param name="e">Details about the click event</param>
00289         private async void OnImportButtonClicked(object sender, RoutedEventArgs e)
00290         {
00291             rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
00292
00293             // disable UI while async operations are running.
00294             setButtonState(false);
00295             this.sourceListBox.IsEnabled = false;
00296             this.progressBar.Value = 0.0;
00297
00298             cts = new CancellationTokenSource();
00299
00300             try
00301             {
00302                 if (itemsResult.SelectedTotalCount <= 0)
00303                 {
00304                     rootPage.NotifyUser("Nothing Selected for Import.", NotifyType.StatusMessage);
00305                 }
00306                 else
00307                 {
00308                     var progress = new Progress<PhotoImportProgress>((result) =>
00309                     {
00310                         progressBar.Value =  result.ImportProgress;
00311                     });
00312
00313                     this.itemsResult.ItemImported += async (s, a) =>
00314                     {
00315                         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00316                         {
00317                             rootPage.NotifyUser(String.Format("Imported: {0}", a.ImportedItem.Name), NotifyType.StatusMessage);
00318                         });
00319                     };
00320
00321                     // import items from the our list of selected items
00322                     this.importedResult = await this.itemsResult.ImportItemsAsync().AsTask(cts.Token, progress);
00323
00324                     DisplayImportedSummary();
00325
00326                     if (!this.importedResult.HasSucceeded)
00327                     {
00328                         rootPage.NotifyUser("ImportItemsAsync did not succeed or was not completed", NotifyType.StatusMessage);
00329                     }
00330                 }
00331             }
00332             catch (Exception ex)
00333             {
00334                 rootPage.NotifyUser("Files could not be imported. " + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
00335             }
00336
00337             cts = null;
00338
00339             // allow the user to find sources and delete the files from the media
00340             this.findSourceButton.IsEnabled = true;
00341             this.deleteButton.IsEnabled = true;
00342
00343             this.importButton.IsEnabled = false;
00344             this.findNewItemsButton.IsEnabled = false;
00345             this.findAllItemsButton.IsEnabled = false;
00346             this.selectNewButton.IsEnabled = false;
00347             this.selectAllButton.IsEnabled = false;
00348             this.selectNoneButton.IsEnabled = false;
00349
00350             this.NoSubFolder.IsChecked = false;
00351             this.FileDateSubfolder.IsChecked = false;
00352             this.ExifDateSubfolder.IsChecked = false;
00353             this.KeepOriginalFolder.IsChecked = false;
00354         }
00355
00356         /// <summary>
00357         /// Select all items.
00358         /// </summary>
00359         /// <param name="sender">Source of the click event</param>
00360         /// <param name="e">Details about the click event</param>
00361         private void OnSelectAllButtonClicked(object sender, RoutedEventArgs e)
00362         {
00363             // select all items for import
00364             this.itemsResult.SelectAll();
00365             setIncrementalFileList(this.itemsResult);
00366             DisplayFindItemsResult();
00367         }
00368
00369         /// <summary>
00370         /// Select only new items. Items that have already been imported is not selected.
00371         /// </summary>
00372         /// <param name="sender">Source of the click event</param>
00373         /// <param name="e">Details about the click event</param>
00374         private async void OnSelectNewButtonClicked(object sender, RoutedEventArgs e)
00375         {
00376             // select only items that new
00377             await this.itemsResult.SelectNewAsync();
00378             setIncrementalFileList(this.itemsResult);
00379             DisplayFindItemsResult();
00380         }
00381
00382         /// <summary>
00383         /// Deselect all items.
00384         /// </summary>
00385         /// <param name="sender">Source of the click event</param>
00386         /// <param name="e">Details about the click event</param>
00387         private void OnSelectNoneButtonClicked(object sender, RoutedEventArgs e)
00388         {
00389             // deselects all items
00390             this.itemsResult.SelectNone();
00391             setIncrementalFileList(this.itemsResult);
00392             DisplayFindItemsResult();
00393         }
00394
00395         /// <summary>
00396         /// Creates a GeneratorIncrementalLoadingClass and sets the FindItemsResult to the filelist for display
00397         /// </summary>
00398         /// <param name="list">PhotoImportFindItemResult list</param>
00399         private void setIncrementalFileList (PhotoImportFindItemsResult list)
00400         {
00401             // GeneratorIncrementalLoadingClass is used to incrementally load items in the Listview view including thumbnails
00402             this.itemsToImport = new GeneratorIncrementalLoadingClass<ImportableItemWrapper>(list.TotalCount,
00403             (int index) =>
00404             {
00405                 return new ImportableItemWrapper(list.FoundItems[index]);
00406             });
00407             this.fileListView.ItemsSource = this.itemsToImport;
00408         }
00409
00410
00411         /// <summary>
00412         /// When a user clicks the delete button, deletes the content that were imported.
00413         /// Calling DeleteImportedItemsFromSourceAsync does not delete content that were not imported.
00414         /// </summary>
00415         /// <param name="sender">Source of the click event</param>
00416         /// <param name="e">Detials about the click event</param>
00417         private async void OnDeleteButtonClicked(object sender, RoutedEventArgs e)
00418         {
00419             rootPage.NotifyUser("Deleting items...", NotifyType.StatusMessage);
00420
00421             // Prevent unexpected reentrance.
00422             this.deleteButton.IsEnabled = false;
00423
00424             cts = new CancellationTokenSource();
00425
00426             try
00427             {
00428                 if (importedResult == null)
00429                 {
00430                     rootPage.NotifyUser("Nothing was imported for deletion.", NotifyType.StatusMessage);
00431                 }
00432                 else
00433                 {
00434                     var progress = new Progress<double>((result) =>
00435                     {
00436                         this.progressBar.Value = result;
00437                     });
00438
00439                     this.deleteResult = await this.importedResult.DeleteImportedItemsFromSourceAsync().AsTask(cts.Token, progress);
00440
00441                     DisplayDeletedResults();
00442
00443                     if (!this.deleteResult.HasSucceeded)
00444                     {
00445                         rootPage.NotifyUser("Delete operation did not succeed or was not completed", NotifyType.StatusMessage);
00446                     }
00447                 }
00448
00449             }
00450             catch (Exception ex)
00451             {
00452                 rootPage.NotifyUser("Files could not be Deleted." + "Exception: " + ex.ToString(), NotifyType.ErrorMessage);
00453             }
00454
00455             // set the CancellationTokenSource to null when the work is complete.
00456             cts = null;
00457
00458
00459             // content is removed, disable the appropriate buttons
00460
00461             this.findSourceButton.IsEnabled = true;
00462             this.importButton.IsEnabled = false;
00463             this.findNewItemsButton.IsEnabled = false;
00464             this.findAllItemsButton.IsEnabled = false;
00465             this.selectNewButton.IsEnabled = false;
00466             this.selectAllButton.IsEnabled = false;
00467             this.selectNoneButton.IsEnabled = false;
00468             this.deleteButton.IsEnabled = false;
00469             this.fileListView.IsEnabled = false;
00470         }
00471
00472         /// <summary>
00473         /// Cancels an async operation
00474         /// </summary>
00475         /// <param name="sender">Source of the cancel event</param>
00476         /// <param name="e">Details about the cancel event</param>
00477         private void OnCancelButtonClicked(object sender, RoutedEventArgs e)
00478         {
00479             if (cts != null)
00480             {
00481                 cts.Cancel();
00482                 rootPage.NotifyUser("Operation canceled by the Cancel button.", NotifyType.StatusMessage);
00483             }
00484         }
00485
00486         /// <summary>
00487         /// Helper method to display the files enumerated from the source.
00488         /// </summary>
00489         void DisplayFindItemsResult()
00490         {
00491             if (itemsResult != null)
00492             {
00493                 StringBuilder findResultProperties = new StringBuilder();
00494                 findResultProperties.AppendLine(String.Format("Photos\t\t\t :  {0} \t\t Selected Photos\t\t:  {1}", itemsResult.PhotosCount, itemsResult.SelectedPhotosCount));
00495                 findResultProperties.AppendLine(String.Format("Videos\t\t\t :  {0} \t\t Selected Videos\t\t:  {1}", itemsResult.VideosCount, itemsResult.SelectedVideosCount));
00496                 findResultProperties.AppendLine(String.Format("SideCars\t\t :  {0} \t\t Selected Sidecars\t:  {1}", itemsResult.SidecarsCount, itemsResult.SelectedSidecarsCount));
00497                 findResultProperties.AppendLine(String.Format("Siblings\t\t\t :  {0} \t\t Selected Sibilings\t:  {1} ", itemsResult.SiblingsCount, itemsResult.SelectedSiblingsCount));
00498                 findResultProperties.AppendLine(String.Format("Total Items Items\t :  {0} \t\t Selected TotalCount \t:  {1}", itemsResult.TotalCount, itemsResult.SelectedTotalCount));
00499
00500                 rootPage.NotifyUser(findResultProperties.ToString(), NotifyType.StatusMessage);
00501             }
00502         }
00503
00504         /// <summary>
00505         ///  Helper method to display the files that were imported.
00506         /// </summary>
00507         void DisplayImportedSummary()
00508         {
00509             if (importedResult != null)
00510             {
00511                 StringBuilder importedSummary = new StringBuilder();
00512                 importedSummary.AppendLine(String.Format("Photos Imported   \t:  {0} ", importedResult.PhotosCount));
00513                 importedSummary.AppendLine(String.Format("Videos Imported    \t:  {0} ", importedResult.VideosCount));
00514                 importedSummary.AppendLine(String.Format("SideCars Imported   \t:  {0} ", importedResult.SidecarsCount));
00515                 importedSummary.AppendLine(String.Format("Siblings Imported   \t:  {0} ", importedResult.SiblingsCount));
00516                 importedSummary.AppendLine(String.Format("Total Items Imported \t:  {0} ", importedResult.TotalCount));
00517                 importedSummary.AppendLine(String.Format("Total Bytes Imported \t:  {0} ", importedResult.TotalSizeInBytes));
00518
00519                 rootPage.NotifyUser(importedSummary.ToString(), NotifyType.StatusMessage);
00520             }
00521         }
00522
00523         /// <summary>
00524         /// Helper method to display the source properties information.
00525         /// </summary>
00526         void DisplaySourceProperties()
00527         {
00528             if (importSource != null)
00529             {
00530                 StringBuilder sourceProperties = new StringBuilder();
00531                 sourceProperties.AppendLine(String.Format("Description:         {0} ", importSource.Description));
00532                 sourceProperties.AppendLine(String.Format("IsMassStorage:         {0} ", importSource.IsMassStorage));
00533                 sourceProperties.AppendLine(String.Format("Manufacturer:          {0} ", importSource.Manufacturer));
00534
00535                 IReadOnlyList<PhotoImportStorageMedium> sm = importSource.StorageMedia;
00536                 sourceProperties.AppendLine(String.Format("AvailableSpaceInBytes:         {0} ", sm[0].AvailableSpaceInBytes));
00537                 sourceProperties.AppendLine(String.Format("CapacityInBytes:         {0} ", sm[0].CapacityInBytes));
00538                 sourceProperties.AppendLine(String.Format("Name:         {0} ", sm[0].Name));
00539                 sourceProperties.AppendLine(String.Format("SerialNumber:         {0} ", sm[0].SerialNumber));
00540                 sourceProperties.AppendLine(String.Format("StorageMediaType:         {0} ", sm[0].StorageMediumType));
00541                 sourceProperties.AppendLine(String.Format("Id:         {0} ", importSource.Id));
00542
00543                 propertiesTxtBox.Text = sourceProperties.ToString();
00544             }
00545         }
00546
00547         /// <summary>
00548         /// Helper method to display the imported files that were deleted
00549         /// </summary>
00550         void DisplayDeletedResults()
00551         {
00552             if (deleteResult != null)
00553             {
00554                 StringBuilder deletedResults = new StringBuilder();
00555                 deletedResults.AppendLine(String.Format("Total Photos Deleted:\t{0} ", deleteResult.PhotosCount));
00556                 deletedResults.AppendLine(String.Format("Total Videos Deleted:\t{0} ", deleteResult.VideosCount));
00557                 deletedResults.AppendLine(String.Format("Total Sidecars Deleted:\t{0} ", deleteResult.SidecarsCount));
00558                 deletedResults.AppendLine(String.Format("Total Sibilings Deleted:\t{0} ", deleteResult.SiblingsCount));
00559                 deletedResults.AppendLine(String.Format("Total Files Deleted:\t{0} ", deleteResult.TotalCount));
00560                 deletedResults.AppendLine(String.Format("Total Bytes Deleted:\t{0} ", deleteResult.TotalSizeInBytes));
00561                 rootPage.NotifyUser(deletedResults.ToString(), NotifyType.StatusMessage);
00562             }
00563         }
00564
00565         /// <summary>
00566         /// Helper method to set the state of the button
00567         /// </summary>
00568         /// <param name="isEnabled">state of the button</param>
00569         void setButtonState(bool isEnabled)
00570         {
00571             this.importButton.IsEnabled = isEnabled;
00572             this.deleteButton.IsEnabled = isEnabled;
00573             this.findNewItemsButton.IsEnabled = isEnabled;
00574             this.findAllItemsButton.IsEnabled = isEnabled;
00575             this.selectNewButton.IsEnabled = isEnabled;
00576             this.selectAllButton.IsEnabled = isEnabled;
00577             this.selectNoneButton.IsEnabled = isEnabled;
00578             this.fileListView.IsEnabled = isEnabled;
00579
00580             this.OnlyImages.IsEnabled = isEnabled;
00581             this.OnlyVideo.IsEnabled = isEnabled;
00582             this.ImagesAndVideo.IsEnabled = isEnabled;
00583             this.AddSessionDateFolder.IsEnabled = isEnabled;
00584             this.NoSubFolder.IsEnabled = isEnabled;
00585             this.FileDateSubfolder.IsEnabled = isEnabled;
00586             this.ExifDateSubfolder.IsEnabled = isEnabled;
00587             this.KeepOriginalFolder.IsEnabled = isEnabled;
00588         }
00589
00590         /// <summary>
00591         /// When a checkbox is clicked, update the UI to the latest selection
00592         /// </summary>
00593         /// <param name="sender">Sender</param>
00594         /// <param name="e">RoutedEventArgs</param>
00595         private void CheckBox_Click(object sender, RoutedEventArgs e)
00596         {
00597             // update the result count
00598             DisplayFindItemsResult();
00599         }
00600
00601         /// <summary
00602         /// This app is registered as a hanlder for WPD\IMageSourceAutoPlay event.
00603         /// When a user connects a WPD device (ie: Camera), OnNavigatedTo is called with DeviceInformationId
00604         /// that we can call FromIdAsync() and preselect the device.
00605         ///
00606         /// We also need to handle the situation where the client was terminated while an import operation was in flight.
00607         /// Import will continue and we attempt to reconnect back to the session.
00608         /// </summary>
00609         /// <param name="e">Details about the NavigationEventArgs</param>
00610         protected override async void OnNavigatedTo(NavigationEventArgs e)
00611         {
00612             base.OnNavigatedTo(e);
00613             rootPage = MainPage.Current;
00614             try
00615             {
00616                 //An photo import session was in progress
00617                 if (e.Parameter is PhotoImportOperation)
00618                 {
00619                     PhotoImportOperation op = e.Parameter as PhotoImportOperation;
00620                     switch (op.Stage)
00621                     {
00622                         // file enumeration was running
00623                         case PhotoImportStage.FindingItems:
00624
00625                             cts = new CancellationTokenSource();
00626                             rootPage.NotifyUser("Reconnected back to the file enumeration stage", NotifyType.StatusMessage);
00627
00628                             // Set up progress handler for existing file enumeration
00629                             var findAllItemsProgress = new Progress<uint>((result) =>
00630                             {
00631                                 rootPage.NotifyUser(String.Format("Found {0} Files", result.ToString()), NotifyType.StatusMessage);
00632                             });
00633
00634                             // retrieve previous session
00635                             this.session = op.Session;
00636                             // get to the operation for the existing FindItemsAsync session
00637                             this.itemsResult = await op.ContinueFindingItemsAsync.AsTask(cts.Token, findAllItemsProgress);
00638
00639                             // display the items we found in the previous session
00640                             setIncrementalFileList(this.itemsResult);
00641                             this.selectAllButton.IsEnabled = true;
00642                             this.selectNoneButton.IsEnabled = true;
00643                             this.selectNewButton.IsEnabled = true;
00644                             this.importButton.IsEnabled = true;
00645
00646                             DisplayFindItemsResult();
00647
00648                             cts = null;
00649                             break;
00650
00651                         // Import was running
00652                         case PhotoImportStage.ImportingItems:
00653
00654                             rootPage.NotifyUser("Reconnected back to the importing stage.", NotifyType.StatusMessage);
00655
00656                             setButtonState(false);
00657                             cts = new CancellationTokenSource();
00658
00659                             // Set up progress handler for the existing import session
00660
00661                             var importSelectedItemsProgress = new Progress<PhotoImportProgress>((result) =>
00662                             {
00663                                 progressBar.Value = result.ImportProgress;
00664                             });
00665
00666                             // retrieve the previous operation
00667                             this.session = op.Session;
00668
00669                             // get the itemsResult that were found in the previous session
00670                             this.itemsResult = await op.ContinueFindingItemsAsync.AsTask();
00671
00672                             // hook up the ItemImported Handler to show progress
00673                             this.itemsResult.ItemImported += async (s, a) =>
00674                             {
00675                                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00676                                 {
00677                                     rootPage.NotifyUser(String.Format("Imported: {0}", a.ImportedItem.Name), NotifyType.StatusMessage);
00678                                 });
00679                             };
00680
00681                             // Get the operation for the import operation that was in flight
00682                             this.importedResult = await op.ContinueImportingItemsAsync.AsTask(cts.Token, importSelectedItemsProgress);
00683
00684                             DisplayImportedSummary();
00685
00686                             this.findSourceButton.IsEnabled = true;
00687                             this.deleteButton.IsEnabled = true;
00688
00689                             cts = null;
00690                             break;
00691
00692                         // Delete operation is in progress
00693                         case PhotoImportStage.DeletingImportedItemsFromSource:
00694
00695                             rootPage.NotifyUser("Reconnected to the deletion stage.",NotifyType.StatusMessage);
00696
00697                             this.findSourceButton.IsEnabled = false;
00698                             this.deleteButton.IsEnabled = false;
00699                             cts = new CancellationTokenSource();
00700
00701                             var progress = new Progress<double>((result) =>
00702                             {
00703                                 this.progressBar.Value = result;
00704                             });
00705
00706                             // get the operation for the existing delete session
00707                             this.deleteResult = await op.ContinueDeletingImportedItemsFromSourceAsync.AsTask(cts.Token, progress);
00708
00709                             DisplayDeletedResults();
00710
00711                             if (!deleteResult.HasSucceeded)
00712                             {
00713                                 rootPage.NotifyUser("Deletion did not succeeded or was cancelled.", NotifyType.StatusMessage);
00714                             }
00715
00716                             this.findSourceButton.IsEnabled = true;
00717
00718                             // Set the CancellationTokenSource to null when the work is complete.
00719                             cts = null;
00720                             break;
00721
00722                         // Idle State.
00723                         case PhotoImportStage.NotStarted:
00724
00725                             rootPage.NotifyUser("No import tasks was started.", NotifyType.StatusMessage);
00726                             this.session = op.Session;
00727                             break;
00728
00729                         default:
00730                             break;
00731                     }
00732                 }
00733
00734                 // Activated by AutoPlay
00735                 if (e.Parameter is DeviceActivatedEventArgs)
00736                 {
00737                     this.arguments = e.Parameter as DeviceActivatedEventArgs;
00738                     bool importSupported = await PhotoImportManager.IsSupportedAsync();
00739                     this.sourceListBox.Items.Clear();
00740
00741                     List<PhotoImportSource> source = new List<PhotoImportSource>();
00742
00743                     // Create the source from a device Id
00744                     source.Add(await PhotoImportSource.FromIdAsync(this.arguments.DeviceInformationId));
00745
00746                     // bind and preselects source
00747                     this.sourceListBox.ItemsSource = source;
00748                     this.sourceListBox.SelectedIndex = 0;
00749
00750                     rootPage.NotifyUser("Device selected from AutoPlay", NotifyType.StatusMessage);
00751                 }
00752             }
00753             catch (Exception ex)
00754             {
00755                 rootPage.NotifyUser("Exception: " + ex.ToString(), NotifyType.ErrorMessage);
00756             }
00757         }
00758
00759         private void OnlyImages_Checked(object sender, RoutedEventArgs e)
00760         {
00761             this.contentTypeFilder = PhotoImportContentTypeFilter.OnlyImages;
00762
00763             // enable find since the filter has changed
00764             this.findAllItemsButton.IsEnabled = true;
00765             this.findNewItemsButton.IsEnabled = true;
00766         }
00767
00768         private void OnlyVideo_Checked(object sender, RoutedEventArgs e)
00769         {
00770             this.contentTypeFilder = PhotoImportContentTypeFilter.OnlyVideos;
00771
00772             // enable find since the filter has changed
00773             this.findAllItemsButton.IsEnabled = true;
00774             this.findNewItemsButton.IsEnabled = true;
00775         }
00776
00777         private void ImagesAndVideo_Checked(object sender, RoutedEventArgs e)
00778         {
00779             this.contentTypeFilder = PhotoImportContentTypeFilter.ImagesAndVideos;
00780
00781             // enable find since the filter has changed
00782             this.findAllItemsButton.IsEnabled = true;
00783             this.findNewItemsButton.IsEnabled = true;
00784         }
00785
00786         private void NoSubFolder_checked(object sender, RoutedEventArgs e)
00787         {
00788             this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.DoNotCreateSubfolders;
00789         }
00790
00791         private void FileDateSubfolder_checked(object sender, RoutedEventArgs e)
00792         {
00793             this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.CreateSubfoldersFromFileDate;
00794         }
00795
00796         private void ExifDateSubfolder_checked(object sender, RoutedEventArgs e)
00797         {
00798             this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.CreateSubfoldersFromExifDate;
00799         }
00800
00801         private void KeepOriginalFolder_checked(object sender, RoutedEventArgs e)
00802         {
00803             this.session.SubfolderCreationMode = PhotoImportSubfolderCreationMode.KeepOriginalFolderStructure;
00804         }
00805
00806         public event PropertyChangedEventHandler PropertyChanged;
00807
00808         private void RaisePropertyChanged(string propName)
00809         {
00810             PropertyChanged(this, new PropertyChangedEventArgs(propName));
00811         }
00812     }
00813 }
00814
00815
00816
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/RandomNumberService/RandomNumberGeneratorTask.h Source File

  • AppServices
  • cppwinrt
  • RandomNumberService

RandomNumberGeneratorTask.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include "RandomNumberGeneratorTask.g.h"
00004 #include <random>
00005
00006 namespace winrt::RandomNumberService::implementation
00007 {
00008     struct RandomNumberGeneratorTask : RandomNumberGeneratorTaskT<RandomNumberGeneratorTask>
00009     {
00010         RandomNumberGeneratorTask() = default;
00011
00012         void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const& taskInstance);
00013
00014     private:
00015         Windows::ApplicationModel::Background::BackgroundTaskDeferral serviceDeferral{ nullptr };
00016         Windows::ApplicationModel::AppService::AppServiceConnection connection{ nullptr };
00017         std::mt19937 randomNumberGenerator;
00018
00019         void OnTaskCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance const&, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason const&);
00020         fire_and_forget OnRequestReceived(Windows::ApplicationModel::AppService::AppServiceConnection const&, Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs const& args);
00021     };
00022 }
00023
00024 namespace winrt::RandomNumberService::factory_implementation
00025 {
00026     struct RandomNumberGeneratorTask : RandomNumberGeneratorTaskT<RandomNumberGeneratorTask, implementation::RandomNumberGeneratorTask>
00027     {
00028     };
00029 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/SampleConfiguration.h Source File

  • XamlDragAndDrop
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "XAML Drag and Drop";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/pch.cpp Source File

  • UserInteractionMode
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/SampleService.h Source File

  • CustomCapability
  • Service
  • Server

SampleService.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // Provides a sample service class that derives from the service base class -
00013 // CServiceBase. The sample service logs the service start and stop
00014 // information to the Application event log, and shows how to run the main
00015 // function of the service in a thread pool worker thread.
00016
00017 #pragma once
00018
00019 #include "ServiceBase.h"
00020
00021 class CSampleService : public CServiceBase
00022 {
00023 public:
00024
00025     CSampleService(PWSTR pszServiceName,
00026         BOOL fCanStop = TRUE,
00027         BOOL fCanShutdown = TRUE,
00028         BOOL fCanPauseContinue = FALSE);
00029     void ConsoleRun();
00030     bool IsConsoleRun()
00031     {
00032         return m_runningInConsole;
00033     }
00034     void WriteEventLogEntry(PWSTR pszMessage, BYTE bLevel) override;
00035     virtual ~CSampleService(void);
00036
00037 protected:
00038
00039     virtual void OnStart(DWORD dwArgc, PWSTR *pszArgv) override;
00040     virtual void OnStop() override;
00041
00042
00043 private:
00044     PTP_WORK m_work = nullptr;
00045     bool m_runningInConsole = false;
00046 };
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/BgTask.cpp Source File

  • Nfc
  • NfcHceBackgroundTask

BgTask.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "BgTask.h"
00014 #include "Utilities.h"
00015
00016 using namespace NfcHceBackgroundTask;
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace Windows::ApplicationModel::Background;
00021 using namespace Windows::Devices::SmartCards;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Storage;
00024 using namespace Windows::Storage::Streams;
00025 using namespace Windows::UI::Notifications;
00026
00027 #define CLAINS_SELECT 0x00A4
00028 #define CLAINS_GET_PROCESSING_OPTIONS 0x80A8
00029 #define CLAINS_READ_RECORD 0x00B2
00030 #define CLAINS_COMPUTE_CRYPTO_CSUM 0x802A
00031
00032 BYTE AID_PPSE[] = { '2', 'P', 'A', 'Y', '.', 'S', 'Y', 'S', '.', 'D', 'D', 'F', '0', '1' };
00033 BYTE AID_V[] = { 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10 };
00034 BYTE AID_MC[] = { 0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10 };
00035 BYTE AID_NONPAYMENT[] = { 0x12, 0x34, 0x56, 0x78, 0x90 };
00036
00037 static Array<byte>^ R_APDU_PPSE_SELECT = nullptr;
00038
00039 static Array<byte>^ R_APDU_PPSE_SELECT_V =
00040 {
00041     0x6F, 0x23, // File control information (FCI) issuer discretionary data, length
00042     0x84, 0x0E, // Dedicated file (DF) name, length
00043     '2', 'P', 'A', 'Y', '.', 'S', 'Y', 'S', '.', 'D', 'D', 'F', '0', '1', // file name "2PAY.SYS.DDF01"
00044     0xA5, 0x11, // File control information (FCI) proprietary data, length
00045     0xBF, 0x0C, 0x0E, // File control information issuer discretionary data, length
00046     0x61, 0x0C, // Directory entry, length
00047     0x4F, 0x07, // Application definition file (ADF) name, length
00048     0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10, // V credit/debit applet "A0000000031010"
00049     0x87, 0x01, // Application priority indicator, length
00050     0x01,
00051     0x90, // Status byte one (SW1)
00052     0x00  // Status byte two (SW2)
00053 };
00054
00055 static Array<byte>^ R_APDU_PPSE_SELECT_MC =
00056 {
00057     0x6F, 0x23, // File control information (FCI) issuer discretionary data, length
00058         0x84, 0x0E, // Dedicated file (DF) name, length
00059             '2', 'P', 'A', 'Y', '.', 'S', 'Y', 'S', '.', 'D', 'D', 'F', '0', '1', // file name "2PAY.SYS.DDF01"
00060         0xA5, 0x11, // File control information (FCI) proprietary data, length
00061             0xBF, 0x0C, 0x0E, // File control information issuer discretionary data, length
00062                 0x61, 0x0C, // Directory entry, length
00063                     0x4F, 0x07, // Application definition file (ADF) name, length
00064                         0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10, // MC credit/debit applet "A0000000041010"
00065                     0x87, 0x01, // Application priority indicator, length
00066                         0x01,
00067     0x90, // Status byte one (SW1)
00068     0x00  // Status byte two (SW2)
00069 };
00070
00071 // EMV_v4.3_Book1_ICC_to_Terminal_Interface, Table 43, 44, 45
00072 static Array<byte>^ R_APDU_CARD_SELECT_V =
00073 {
00074     0x6F, 0x1E, // File control information (FCI) issuer discretionary data, length
00075         0x84, 0x07, // Dedicated file (DF) name, length
00076             // File name "A0000000031010"
00077             0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10,
00078         0xA5, 0x13, // File control information (FCI) proprietary data, length
00079             0x50, 0x0B, // Application label, length
00080                 // Credit/debit application label "CREDIT CARD"
00081                 'C', 'R', 'E', 'D', 'I', 'T', ' ',
00082                 'C', 'A', 'R', 'D',
00083             0x9F, 0x38, 0x03, // Processing options data object list (PDOL), length
00084                 0x9F, 0x66, 0x02,
00085     0x90, // Status byte one (SW1)
00086     0x00  // Status byte two (SW2)
00087 };
00088
00089 // EMV_v4.3_Book1_ICC_to_Terminal_Interface, Table 43, 44, 45
00090 static Array<byte>^ R_APDU_CARD_SELECT_MC =
00091 {
00092     0x6F, 0x18, // File control information (FCI) issuer discretionary data, length
00093         0x84, 0x07, // Dedicated file (DF) name, length
00094             // File name "A0000000041010"
00095             0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10,
00096         0xA5, 0x0D, // File control information (FCI) proprietary data, length
00097             0x50, 0x0B, // Application label, length
00098                 // Credit/debit application label "CREDIT CARD"
00099                 'C', 'R', 'E', 'D', 'I', 'T', ' ',
00100                 'C', 'A', 'R', 'D',
00101     0x90, // Status byte one (SW1)
00102     0x00  // Status byte two (SW2)
00103 };
00104
00105 // EMV_v4.3_Book3_Application_Specification, Section 6.5.8 and Figure 4
00106 static Array<byte>^ R_APDU_GPO_V =
00107 {
00108     0x80,
00109     0x06, // Length of Processing options data object list (PDOL)
00110                 // Application interchange profile (AIP), application file locator (AFL)
00111                 0x00, 0x80, 0x08, 0x01, 0x01, 0x00,
00112                 0x90, // Status byte one (SW1)
00113                 0x00  // Status byte two (SW2)
00114 };
00115
00116 static Array<byte>^ R_APDU_GPO_MC =
00117 {
00118     0x77, 0x0F, // Response Message Template Format 2
00119         0x82, 0x02, // Application Interchange Profile
00120             0x00, 0x00, // Only magstripe supported
00121         0x94, 0x04, // Application File Locator
00122             0x08, 0x01, 0x01, 0x00,
00123         0xD7, 0x03,     // PayPass application control
00124             0x00, 0x00, 0x80,   // Static CVC3
00125     0x90, // Status byte one (SW1)
00126     0x00  // Status byte two (SW2)
00127 };
00128
00129 static Array<byte>^ R_APDU_READ_RECORD_DEFAULT_V =
00130 {
00131     0x70, 59,
00132         0x57, 0x12, // Track 2 equivalent data
00133             0x42, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x2D, 0x22, 0x01, 0x12, 0x10, 0x00, 0x00, 0x99, 0x99, 0x23, 0x4F,
00134         0x5F, 0x20, 0x0F, // Cardholder name
00135             0x43, 0x41, 0x52, 0x44, 0x48, 0x4F, 0x4C, 0x44, 0x45, 0x52, 0x2F, 0x4E, 0x41, 0x4D, 0x45,
00136         0x9F, 0x1F, 18, // Track 1 discretionary data
00137             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
00138     0x90, 00
00139 };
00140
00141 static Array<byte>^ R_APDU_READ_RECORD_DEFAULT_MC =
00142 {
00143     0x70, 0x81, 0x94, // Application Elementary File(AEF) Template
00144     0x9F, 0x6C, 0x02, // Mag Stripe Application Version Number(Card)
00145             0x00, 0x01,
00146
00147         0x56, 0x42, // Track 1 Data
00148             0x42, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x34, 0x34, 0x34, 0x34, //  "B5555555555554444"
00149             0x5E, 0x43, 0x41, 0x52, 0x44, 0x48, 0x4F, 0x4C, 0x44, 0x45, 0x52, 0x2F, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // "^CARDHOLDER/     "
00150             0x5E, 0x31, 0x37, 0x30, 0x34, 0x35, 0x30, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, // "^1704502000000000000000"
00151             0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
00152
00153         0x9F, 0x62, 0x06, // Track 1 Bit Map for CVC3(PCVC3 Track 1)
00154             0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
00155
00156         0x9F, 0x63, 0x06, // Track 1 Bit Map for UN and ATC(PUNATC Track 1)
00157             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // E0 E0
00158
00159         0x9F, 0x64, 0x01, // Track 1 Number of ATC Digits(NATC Track 1)
00160             0x00, //3
00161
00162         0x9F, 0x6B, 0x13, // Track 2 Data
00163             0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x44, 0x44, 0xD1, 0x70, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F,
00164
00165         0x9F, 0x65, 0x02, // Track 2 Bit Map for CVC3(PCVC3 Track 2)
00166             0x00, 0x0E,
00167
00168         0x9F, 0x66, 0x02, // Track 2 Bit Map for UN and ATC(PUNATC Track 2)
00169             0x00, 0x00, // 0E 70
00170
00171         0x9F, 0x67, 0x01, // Track 2 Number of ATC Digits(NATC Track 2)
00172             0x00, //3
00173
00174         0x9F, 0x68, 0x0E, // Mag Stripe CVM List
00175             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x03, 0x42, 0x03, 0x1F, 0x03,
00176
00177     0x90, 00,
00178 };
00179
00180 static Array<byte>^ R_APDU_COMPUTE_CRYPTO_CSUM_MC =
00181 {
00182     0x77, 0x0F, // Response Message Template Format 2
00183         0x9F, 0x61, 0x02, // CVC3 Track 2
00184             0x00, 0x98,
00185
00186         0x9F, 0x60, 0x02, // CVC3 Track 1
00187             0x03, 0x0C,
00188
00189         0x9F, 0x36, 0x02, // Application Transaction Counter(ATC)
00190             0x00, 0x01,
00191
00192     0x90, 0x00,
00193 };
00194
00195 static Array<byte>^ R_APDU_FAIL =
00196 {
00197     0x6F, // Status byte one (SW1)
00198     0x00  // Status byte two (SW2)
00199 };
00200
00201 static Array<byte>^ R_APDU_INVALID_PARAMETER_FILE_NOT_FOUND =
00202 {
00203     0x6A, // Status byte one (SW1)
00204     0x82  // Status byte two (SW2)
00205 };
00206
00207 static Array<byte>^ R_APDU_SUCCESS =
00208 {
00209     0x90, // Status byte one (SW1)
00210     0x00  // Status byte two (SW2)
00211 };
00212
00213 BgTask::BgTask() :
00214     m_taskInstance(nullptr),
00215     m_deferral(nullptr),
00216     m_emulator(nullptr)
00217 {
00218 }
00219
00220 void BgTask::Run(
00221     IBackgroundTaskInstance^ taskInstance)
00222 {
00223     m_taskInstance = taskInstance;
00224
00225     m_triggerDetails = static_cast<SmartCardTriggerDetails^>(taskInstance->TriggerDetails);
00226     m_emulator = m_triggerDetails->Emulator;
00227
00228     switch (m_triggerDetails->TriggerType)
00229     {
00230     case SmartCardTriggerType::EmulatorHostApplicationActivated:
00231         HandleHceActivation();
00232         break;
00233
00234     default:
00235         DebugLogString(m_triggerDetails->TriggerType.ToString());
00236         FlushDebugLog();
00237
00238         // Show toast displaying the type of the background task trigger
00239         auto toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastImageAndText01);
00240         toastXml->GetElementsByTagName("text")->Item(0)->InnerText = m_triggerDetails->TriggerType.ToString();
00241         auto toast = ref new ToastNotification(toastXml);
00242         ToastNotificationManager::CreateToastNotifier()->Show(toast);
00243
00244         break;
00245     }
00246 }
00247
00248 void BgTask::HandleHceActivation()
00249 {
00250     try
00251     {
00252         auto lock = m_csLock.Lock();
00253
00254         // Take a deferral to keep this background task alive even after this "Run" method returns.
00255         // You must complete this deferal immediately after you have done processing the current
00256         // transaction
00257         m_deferral = m_taskInstance->GetDeferral();
00258
00259         DebugLog(L"*** HCE Activation Background Task Started ***");
00260
00261         // Find the currently enabled payment applet ID group
00262         auto regs = create_task(SmartCardEmulator::GetAppletIdGroupRegistrationsAsync()).get();
00263         for (auto iter = regs->First(); iter->HasCurrent; iter->MoveNext())
00264         {
00265             if (iter->Current->ActivationPolicy != SmartCardAppletIdGroupActivationPolicy::Disabled
00266                 && iter->Current->AppletIdGroup->SmartCardEmulationCategory == SmartCardEmulationCategory::Payment)
00267             {
00268                 m_paymentAidRegistration = iter->Current;
00269
00270                 // If the activation policy is Enabled, continue searching because there might be
00271                 // an applet ID group with an activation policy of ForegroundOverride
00272                 if (iter->Current->ActivationPolicy == SmartCardAppletIdGroupActivationPolicy::ForegroundOverride)
00273                 {
00274                     break;
00275                 }
00276             }
00277         }
00278
00279         if (m_paymentAidRegistration != nullptr)
00280         {
00281             DebugLogString(L"Found enabled payment applet ID group: " + m_paymentAidRegistration->AppletIdGroup->DisplayName);
00282
00283             // Check what type of payment card we're handling and set up for it
00284             auto appletIds = m_paymentAidRegistration->AppletIdGroup->AppletIds;
00285             for (auto iter = appletIds->First(); iter->HasCurrent; iter->MoveNext())
00286             {
00287                 DWORD cbLen = 0;
00288                 auto pbAid = PointerFromIBuffer(iter->Current, &cbLen);
00289                 if (cbLen == sizeof(AID_MC) && memcmp(pbAid, AID_MC, cbLen) == 0)
00290                 {
00291                     // There's a MC AID in the group, so use the MC PPSE
00292                     R_APDU_PPSE_SELECT = R_APDU_PPSE_SELECT_MC;
00293                     break;
00294                 }
00295                 else if (cbLen == sizeof(AID_V) && memcmp(pbAid, AID_V, cbLen) == 0)
00296                 {
00297                     // There's a V AID in the group, so use the V PPSE
00298                     R_APDU_PPSE_SELECT = R_APDU_PPSE_SELECT_V;
00299                     break;
00300                 }
00301             }
00302         }
00303
00304         m_fDenyTransactions = false;
00305
00306         if (Windows::Phone::System::SystemProtection::ScreenLocked)
00307         {
00308             auto denyIfLocked = ApplicationData::Current->RoamingSettings->Values->Lookup("DenyIfPhoneLocked");
00309             if (denyIfLocked != nullptr && (bool)denyIfLocked == true)
00310             {
00311                 // The phone is locked, and our current user setting is to deny transactions while
00312                 // locked, so deny transactions and let the user know. We still need to respond to
00313                 // APDUs in a timely manner, even though we will just respond with failure APDUs
00314                 m_fDenyTransactions = true;
00315                 LaunchForegroundApp(Denied, L"Phone was locked at the time of tap");
00316             }
00317         }
00318
00319         m_emulator->ApduReceived += ref new TypedEventHandler<SmartCardEmulator^, SmartCardEmulatorApduReceivedEventArgs^>(
00320             this, &BgTask::ApduReceived);
00321
00322         // Set up a handler for if the background task is canceled, we must immediately complete
00323         // our deferral
00324         m_taskInstance->Canceled += ref new BackgroundTaskCanceledEventHandler(
00325             [this](
00326                 IBackgroundTaskInstance^ sender,
00327                 BackgroundTaskCancellationReason reason)
00328             {
00329                 auto lock = m_csLock.Lock();
00330
00331                 DebugLogString(L"Bg task canceled. Reason: " + reason.ToString());
00332                 EndTask();
00333             });
00334
00335         m_emulator->ConnectionDeactivated += ref new TypedEventHandler<SmartCardEmulator^, SmartCardEmulatorConnectionDeactivatedEventArgs^>(
00336             [this](
00337                 SmartCardEmulator^ emulator,
00338                 SmartCardEmulatorConnectionDeactivatedEventArgs^ eventArgs)
00339             {
00340                 auto lock = m_csLock.Lock();
00341
00342                 DebugLogString(L"Connection deactivated. Reason: " + eventArgs->Reason.ToString());
00343                 EndTask();
00344             });
00345
00346         // SmartCardEmulator::Start() can trigger the ConnectionDeactivated and ApduReceived
00347         // callbacks on this thread. If you are using a lock here and in one of those callbacks,
00348         // then make sure the lock is reentrant/recursive
00349         DebugLog(L"Emulator is starting...");
00350         m_emulator->Start();
00351
00352         if (m_fTaskEnded)
00353         {
00354             DebugLog(L"Connection was deactivated before emulator could start");
00355             FlushDebugLog();
00356         }
00357         else
00358         {
00359             DebugLog(L"Emulator started");
00360         }
00361     }
00362     catch (Exception^ e)
00363     {
00364         DebugLogString(L"Exception in Run: " + e->ToString());
00365         EndTask();
00366     }
00367 }
00368
00369 void BgTask::LaunchForegroundApp(LaunchType type, LPWSTR wszMessage)
00370 {
00371     SmartCardLaunchBehavior launchBehavior = SmartCardLaunchBehavior::Default;
00372     auto launchAboveLock = ApplicationData::Current->RoamingSettings->Values->Lookup("LaunchAboveLock");
00373     if (launchAboveLock != nullptr && (bool)launchAboveLock == true)
00374     {
00375         launchBehavior = SmartCardLaunchBehavior::AboveLock;
00376     }
00377
00378     auto args = ref new String(L"Receipt^");
00379     switch (type)
00380     {
00381     case Complete:
00382         args += ref new String(L"Complete^");
00383         break;
00384     case Failed:
00385         args += ref new String(L"Failed^");
00386         break;
00387     case Denied:
00388         args += ref new String(L"Denied^");
00389         break;
00390     }
00391
00392     args += ref new String(wszMessage);
00393
00394     bool succeeded = create_task(
00395         m_triggerDetails->TryLaunchCurrentAppAsync(args, launchBehavior)).get();
00396     if (!succeeded)
00397     {
00398         DebugLog(L"Foreground app failed to launch");
00399     }
00400 }
00401
00402 void BgTask::EndTask()
00403 {
00404     if (m_fTaskEnded)
00405     {
00406         DebugLog(L"Background task has already ended. Leaving EndTask");
00407         return;
00408     }
00409
00410     if (!m_fDenyTransactions)
00411     {
00412         if (!m_fTransactionCompleted)
00413         {
00414             DebugLog(L"Transaction failed to complete");
00415             LaunchForegroundApp(Failed, L"Try tapping again, and hold your phone on the reader longer");
00416         }
00417         else
00418         {
00419             DebugLog(L"Transaction complete");
00420         }
00421     }
00422
00423     FlushDebugLog();
00424
00425     m_fTaskEnded = true;
00426
00427     if (m_deferral.Get() != nullptr)
00428     {
00429         m_deferral->Complete();
00430     }
00431 }
00432
00433 void BgTask::ApduReceived(SmartCardEmulator^ emulator, SmartCardEmulatorApduReceivedEventArgs^ eventArgs)
00434 {
00435     try
00436     {
00437         auto lock = m_csLock.Lock();
00438
00439         if (m_fTaskEnded)
00440         {
00441             DebugLog(L"Background task has been canceled. Leaving ApduReceived");
00442             return;
00443         }
00444
00445         auto apduBuffer = eventArgs->CommandApdu;
00446         auto apduBytes = ref new Array<byte>(apduBuffer->Length);
00447         auto dataReader = DataReader::FromBuffer(apduBuffer);
00448         dataReader->ReadBytes(apduBytes);
00449
00450         auto strApdu = L"Apdu received: " + ByteArrayToString(apduBytes);
00451         DebugLog(strApdu.c_str());
00452
00453         auto connectionId = eventArgs->ConnectionProperties->Id;
00454         if (connectionId != m_currentConnectionId)
00455         {
00456             // This is a new connection, so clear out any state from the previous one
00457             m_currentConnectionId = connectionId;
00458             m_pbCurrentAppletId = nullptr;
00459             m_fTransactionCompleted = false;
00460             DebugLog(L"New connection");
00461         }
00462
00463         bool fTransactionComplete = false;
00464         IBuffer^ response;
00465
00466         if (m_fDenyTransactions)
00467         {
00468             response = IBufferFromArray(R_APDU_FAIL);
00469         }
00470         else
00471         {
00472             response = ProcessCommandApdu(apduBuffer, &fTransactionComplete);
00473         }
00474
00475         if (eventArgs->AutomaticResponseStatus != SmartCardAutomaticResponseStatus::Success)
00476         {
00477             create_task(eventArgs->TryRespondAsync(response)).then(
00478                 [this, fTransactionComplete](bool result)
00479             {
00480                 auto lock = m_csLock.Lock();
00481
00482                 DebugLog(result ? L"+Responded successfully" : L"!TryRespondAsync returned false");
00483                 if (result && fTransactionComplete)
00484                 {
00485                     m_fTransactionCompleted = true;
00486                     LaunchForegroundApp(Complete, L"");
00487                 }
00488             });
00489         }
00490         else
00491         {
00492             DebugLog(L"+System auto-responded already");
00493             if (fTransactionComplete)
00494             {
00495                 m_fTransactionCompleted = true;
00496                 LaunchForegroundApp(Complete, L"");
00497             }
00498         }
00499     }
00500     catch (Exception^ e)
00501     {
00502         DebugLogString(L"Exception in ApduReceived: " + e->ToString());
00503         LaunchForegroundApp(Failed, L"Exception occurred");
00504         EndTask();
00505     }
00506 }
00507
00508 _Use_decl_annotations_
00509 IBuffer^ BgTask::ProcessCommandApdu(IBuffer^ commandApdu, bool* pfComplete)
00510 {
00511     DWORD cbCommandApdu = 0;
00512     LPBYTE pbCommandApdu = PointerFromIBuffer(commandApdu, &cbCommandApdu);
00513     USHORT usClaIns = 0;
00514     BYTE bP1 = pbCommandApdu[2];
00515     BYTE bP2 = pbCommandApdu[3];
00516     LPBYTE pbPayload = nullptr;
00517     DWORD cbPayload = 0;
00518     DWORD cbLE = 0;
00519
00520     *pfComplete = false;
00521
00522     if (FAILED(ParseApdu(pbCommandApdu, cbCommandApdu, &usClaIns, &bP1, &bP2, &pbPayload, &cbPayload, &cbLE)))
00523     {
00524         DebugLog(L"Failed to parse APDU");
00525         return IBufferFromArray(R_APDU_FAIL);
00526     }
00527
00528     switch (usClaIns)
00529     {
00530     case CLAINS_SELECT:
00531         DebugLog(L"-SELECT APDU received");
00532         if (bP1 != 0x04 || bP2 != 0x00)
00533         {
00534             // Unsupported options
00535             DebugLog(L"SELECT failed with unsupported options");
00536             return IBufferFromArray(R_APDU_FAIL);
00537         }
00538
00539         if (R_APDU_PPSE_SELECT != nullptr && cbPayload == sizeof(AID_PPSE) && memcmp(AID_PPSE, pbPayload, cbPayload) == 0)
00540         {
00541             // PPSE selected
00542             if (cbLE < R_APDU_PPSE_SELECT->Length)
00543             {
00544                 BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_PPSE_SELECT->Length };
00545                 return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00546             }
00547             else
00548             {
00549                 m_pbCurrentAppletId = AID_PPSE;
00550                 return IBufferFromArray(R_APDU_PPSE_SELECT);
00551             }
00552         }
00553         else if (cbPayload == sizeof(AID_V) && memcmp(AID_V, pbPayload, cbPayload) == 0)
00554         {
00555             // Card selected
00556             if (cbLE < R_APDU_CARD_SELECT_V->Length)
00557             {
00558                 BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_CARD_SELECT_V->Length };
00559                 return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00560             }
00561             else
00562             {
00563                 m_pbCurrentAppletId = AID_V;
00564                 return IBufferFromArray(R_APDU_CARD_SELECT_V);
00565             }
00566         }
00567         else if (cbPayload == sizeof(AID_MC) && memcmp(AID_MC, pbPayload, cbPayload) == 0)
00568         {
00569             // Card selected
00570             if (cbLE < R_APDU_CARD_SELECT_MC->Length)
00571             {
00572                 BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_CARD_SELECT_MC->Length };
00573                 return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00574             }
00575             else
00576             {
00577                 m_pbCurrentAppletId = AID_MC;
00578                 return IBufferFromArray(R_APDU_CARD_SELECT_MC);
00579             }
00580         }
00581         else if (cbPayload == sizeof(AID_NONPAYMENT) && memcmp(AID_NONPAYMENT, pbPayload, cbPayload) == 0)
00582         {
00583             return IBufferFromArray(R_APDU_SUCCESS);
00584         }
00585         else
00586         {
00587             DebugLog(L"Unknown AID selected");
00588             // Invalid applet ID (6A82)
00589             return IBufferFromArray(R_APDU_INVALID_PARAMETER_FILE_NOT_FOUND);
00590         }
00591         break;
00592
00593     case CLAINS_GET_PROCESSING_OPTIONS:
00594         DebugLog(L"-GPO APDU received");
00595         if (bP1 != 0 || bP2 != 0)
00596         {
00597             DebugLog(L"GPO failed with unsupported options");
00598             return IBufferFromArray(R_APDU_FAIL);
00599         }
00600         if (m_pbCurrentAppletId == AID_V)
00601         {
00602             if (cbLE < R_APDU_GPO_V->Length)
00603             {
00604                 BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_GPO_V->Length };
00605                 return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00606             }
00607             else
00608             {
00609                 return IBufferFromArray(R_APDU_GPO_V);
00610             }
00611         }
00612         else if (m_pbCurrentAppletId == AID_MC)
00613         {
00614             if (cbLE < R_APDU_GPO_MC->Length)
00615             {
00616                 BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_GPO_MC->Length };
00617                 return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00618             }
00619             else
00620             {
00621                 return IBufferFromArray(R_APDU_GPO_MC);
00622             }
00623         }
00624         else
00625         {
00626             return IBufferFromArray(R_APDU_FAIL);
00627         }
00628         break;
00629
00630     case CLAINS_READ_RECORD:
00631         DebugLog(L"-READ RECORD APDU received");
00632         if (bP1 != 0x01 || bP2 != 0x0c)
00633         {
00634             DebugLog(L"READ RECORD failed with unsupported options");
00635             return IBufferFromArray(R_APDU_FAIL);
00636         }
00637
00638         {
00639             auto filename = L"ReadRecordResponse-" + m_paymentAidRegistration->Id.ToString() + L".dat";
00640             DebugLogString(filename);
00641
00642             auto readFile = ReadAndUnprotectFileAsync(filename);
00643             readFile.wait();
00644             auto fileData = readFile.get();
00645
00646             if (m_pbCurrentAppletId == AID_V)
00647             {
00648                 // If there's no file, use some default data
00649                 if (fileData == nullptr)
00650                 {
00651                     DebugLog(L"No READ RECORD file found, using default data");
00652                     fileData = R_APDU_READ_RECORD_DEFAULT_V;
00653                 }
00654                 else
00655                 {
00656                     DebugLog(L"File found for READ RECORD APDU response");
00657                 }
00658
00659                 *pfComplete = true;
00660                 return IBufferFromArray(fileData);
00661             }
00662             else if (m_pbCurrentAppletId == AID_MC)
00663             {
00664                 // If there's no file, use some default data
00665                 if (fileData == nullptr)
00666                 {
00667                     DebugLog(L"No READ RECORD file found, using default data");
00668                     fileData = R_APDU_READ_RECORD_DEFAULT_MC;
00669                 }
00670                 else
00671                 {
00672                     DebugLog(L"File found for READ RECORD APDU response");
00673                 }
00674
00675                 return IBufferFromArray(fileData);
00676             }
00677             else
00678             {
00679                 DebugLog(L"READ RECORD failed with wrong AID");
00680                 return IBufferFromArray(R_APDU_FAIL);
00681             }
00682         }
00683         break;
00684
00685     case CLAINS_COMPUTE_CRYPTO_CSUM:
00686         DebugLog(L"-CCC APDU received");
00687
00688         if (m_pbCurrentAppletId != AID_MC)
00689         {
00690             DebugLog(L"CCC failed with unsupported options or mismatched AID");
00691             return IBufferFromArray(R_APDU_FAIL);
00692         }
00693         if (cbLE < R_APDU_COMPUTE_CRYPTO_CSUM_MC->Length)
00694         {
00695             BYTE rgbResp[] = { 0x6C, (BYTE)R_APDU_COMPUTE_CRYPTO_CSUM_MC->Length };
00696             return IBufferFromPointer(rgbResp, sizeof(rgbResp));
00697         }
00698         else
00699         {
00700             *pfComplete = true;
00701             return IBufferFromArray(R_APDU_COMPUTE_CRYPTO_CSUM_MC);
00702         }
00703         break;
00704
00705     default:
00706         DebugLog(L"-Unknown APDU received");
00707         return IBufferFromArray(R_APDU_FAIL);
00708     }
00709
00710     DebugLog(L"Fallthrough failure in ProcessCommandApdu");
00711     return IBufferFromArray(R_APDU_FAIL);
00712 }
00713
00714 void BgTask::DebugLogString(String^ message)
00715 {
00716     DebugLog(message->Data());
00717 }
00718
00719 void BgTask::DebugLog(const wchar_t* pwstrMessage)
00720 {
00721     auto strTime = GetCurrentTimeString();
00722
00723     // To view output from OutputDebugString in the Output window of the debugger, go to the
00724     // Properties page of the Nfc project, then go to the Debug tab and select "Native Only" for
00725     // "Application process" in the "Debugger type" section
00726     OutputDebugStringW(pwstrMessage);
00727     OutputDebugStringW(L"\r\n");
00728
00729     // Lock m_csDebugLog so that we can call this method outside the class lock m_csLock
00730     auto lock = m_csDebugLog.Lock();
00731     m_wsDebugLog += strTime->Data();
00732     m_wsDebugLog += L": ";
00733     m_wsDebugLog += pwstrMessage;
00734     m_wsDebugLog += L"\r\n";
00735 }
00736
00737 void BgTask::FlushDebugLog()
00738 {
00739     // Lock m_csDebugLog so that we can call this method outside the class lock m_csLock
00740     auto lock = m_csDebugLog.Lock();
00741     AppendFile(L"DebugLog.txt", ref new String(m_wsDebugLog.data()));
00742 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cpp/pch.h Source File

  • Personalization
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario7_SetVersion.xaml.cs Source File

  • ApplicationData
  • cs

Scenario7_SetVersion.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016 using Windows.Storage;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario7_SetVersion : Page
00021     {
00022         ApplicationData appData = ApplicationData.Current;
00023
00024         const string settingName = "SetVersionSetting";
00025         const string settingValue0 = "Data.v0";
00026         const string settingValue1 = "Data.v1";
00027
00028         public Scenario7_SetVersion()
00029         {
00030             InitializeComponent();
00031         }
00032
00033         void SetVersionHandler0(SetVersionRequest request)
00034         {
00035             SetVersionDeferral deferral = request.GetDeferral();
00036
00037             uint version = appData.Version;
00038
00039             switch (version)
00040             {
00041                 case 0:
00042                     // Version is already 0.  Nothing to do.
00043                     break;
00044
00045                 case 1:
00046                     // Need to convert data from v1 to v0.
00047
00048                     // This sample simulates that conversion by writing a version-specific value.
00049                     appData.LocalSettings.Values[settingName] = settingValue0;
00050
00051                     break;
00052
00053                 default:
00054                     throw new Exception("Unexpected ApplicationData Version: " + version);
00055             }
00056
00057             deferral.Complete();
00058         }
00059
00060         void SetVersionHandler1(SetVersionRequest request)
00061         {
00062             SetVersionDeferral deferral = request.GetDeferral();
00063
00064             uint version = appData.Version;
00065
00066             switch (version)
00067             {
00068                 case 0:
00069                     // Need to convert data from v0 to v1.
00070
00071                     // This sample simulates that conversion by writing a version-specific value.
00072                     appData.LocalSettings.Values[settingName] = settingValue1;
00073
00074                     break;
00075
00076                 case 1:
00077                     // Version is already 1.  Nothing to do.
00078                     break;
00079
00080                 default:
00081                     throw new Exception("Unexpected ApplicationData Version: " + version);
00082             }
00083
00084             deferral.Complete();
00085         }
00086
00087         async void SetVersion0_Click(Object sender, RoutedEventArgs e)
00088         {
00089             await appData.SetVersionAsync(0, SetVersionHandler0);
00090             DisplayOutput();
00091         }
00092
00093         async void SetVersion1_Click(Object sender, RoutedEventArgs e)
00094         {
00095             await appData.SetVersionAsync(1, SetVersionHandler1);
00096             DisplayOutput();
00097         }
00098
00099         void DisplayOutput()
00100         {
00101             OutputTextBlock.Text = "Version: " + appData.Version;
00102         }
00103
00104         protected override void OnNavigatedTo(NavigationEventArgs e)
00105         {
00106             DisplayOutput();
00107         }
00108     }
00109 }
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario1_LongAndShortFormats.cpp Source File

  • DateTimeFormatting
  • cppwinrt

Scenario1_LongAndShortFormats.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_LongAndShortFormats.h"
00014 #include "Scenario1_LongAndShortFormats.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::DateTimeFormatting;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_LongAndShortFormats::Scenario1_LongAndShortFormats()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario1_LongAndShortFormats::Display_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00032         // in order to display dates and times using basic formatters.
00033
00034         //Get the current application context language
00035         hstring currentLanguage = ApplicationLanguages::Languages().GetAt(0);
00036
00037         // Formatters for dates and times
00038         std::array dateFormatters{
00039             DateTimeFormatter(L"shortdate"),
00040             DateTimeFormatter(L"longdate"),
00041             DateTimeFormatter(L"shorttime"),
00042             DateTimeFormatter(L"longtime"),
00043         };
00044
00045         // Obtain the date that will be formatted.
00046         DateTime dateToFormat = clock::now();
00047
00048         // Keep the results here
00049         std::wostringstream results;
00050         results << L"Current application context language: " << std::wstring_view(currentLanguage) << std::endl << std::endl;
00051
00052         // Generate the results.
00053         for (auto&& formatter : dateFormatters)
00054         {
00055             // Perform the actual formatting.
00056             results << std::wstring_view(formatter.Template()) << L": " << std::wstring_view(formatter.Format(dateToFormat)) << std::endl;
00057         }
00058
00059         // Display the results.
00060         OutputTextBlock().Text(results.str());
00061     }
00062 }
Generated on Fri Nov 15 2024 22:19:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/cpp/Utils.h Source File

  • SimpleCommunication
  • cpp

Utils.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include "MainPage.xaml.h"
00014
00015 using namespace Windows::Devices::Enumeration;
00016 using namespace Windows::Foundation;
00017
00018 using namespace Concurrency;
00019
00020 namespace SDKTemplate
00021 {
00022     ref class CaptureFailedEventArgs
00023     {
00024     internal:
00025         CaptureFailedEventArgs(HRESULT code, Platform::String^ message)
00026             : _code(code)
00027             , _message(message)
00028         {
00029         }
00030
00031         property HRESULT Code
00032         {
00033             HRESULT get() { return _code; }
00034         }
00035
00036         property Platform::String^ Message
00037         {
00038             Platform::String^ get() { return _message; }
00039         }
00040
00041     private:
00042         HRESULT _code;
00043         Platform::String^ _message;
00044     };
00045
00046     ref class SdkSample
00047     {
00048     internal:
00049         void Initialize();
00050         void Deinitialize();
00051
00052         void DisplayStatus(Platform::String^ msg);
00053         void DisplayError(Platform::String^ msg);
00054         void FormatError(HResult err, Platform::String^ msg, Platform::String^ prefix);
00055         void FormatError(CaptureFailedEventArgs^ e, Platform::String^ prefix);
00056         void ClearLastStatus();
00057
00058     private:
00059         void Log(Platform::String^ message);
00060         void Log(Platform::String^ message, Platform::String^ tag, Platform::String^ type);
00061
00062         SDKTemplate::MainPage^ _rootPage;
00063         Windows::UI::Core::CoreDispatcher^ _dispatcher;
00064     };
00065
00066     ref class CaptureDevice;
00067
00068     delegate void CaptureFailedHandler(CaptureDevice^ sender, CaptureFailedEventArgs^ errorEventArgs);
00069     delegate void IncomingConnectionEventHandler(Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^ sender, Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^ args);
00070     delegate bool VideoSettingsFilter (Windows::Media::MediaProperties::IMediaEncodingProperties^, unsigned int);
00071
00072     // Capture device represents a device used in one capture session between
00073     // calling CaptureManager.lockAsync and CaptureManager.unlockAsync.
00074     ref class CaptureDevice sealed
00075     {
00076     private:
00077         // Media capture object
00078         Platform::Agile<Windows::Media::Capture::MediaCapture> _mediaCapture;
00079         // Custom media sink
00080         Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^ _mediaSink;
00081         // EventRegistrationToken for StspMediaSink::IncomingConnection
00082         Windows::Foundation::EventRegistrationToken _mediaSinkIncomingConnectionEventRegistrationToken;
00083         // EventRegistrationToken for MediaCapture::Failed
00084         Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventRegistrationToken;
00085
00086         // Flag indicating if recording to custom sink has started
00087         bool _recordingStarted;
00088
00089     internal:
00090         event CaptureFailedHandler^ Failed;
00091         event IncomingConnectionEventHandler^ IncomingConnectionEvent;
00092
00093         CaptureDevice();
00094
00095         /// <summary>
00096         /// Initialization of the device.
00097         /// </summary>
00098         task<void> InitializeAsync();
00099
00100         /// <summary>
00101         /// Cleaning up the sink.
00102         /// </summary>
00103         void CleanupSink();
00104
00105         /// <summary>
00106         /// Cleans up the resources.
00107         /// </summary>
00108         void DoCleanup();
00109
00110         /// <summary>
00111         /// Asynchronous method cleaning up resources and stopping recording if necessary.
00112         /// </summary>
00113         task<void> CleanupAsync();
00114
00115         /// <summary>
00116         /// Function allows to select camera settings.
00117         /// </summary>
00118         /// <param name="mediaStreamType" type="Windows.Media.Capture.MediaStreamType">
00119         /// Type of a the media stream.
00120         /// </param>
00121         /// <param name="mediaStreamType">
00122         /// Function which will be called to filter the correct settings.
00123         /// </param>
00124         task<void> SelectPreferredCameraStreamSettingAsync(Windows::Media::Capture::MediaStreamType mediaStreamType, VideoSettingsFilter^ settingsFilterFunc);
00125
00126         /// <summary>
00127         /// Begins recording
00128         /// </summary>
00129         /// <param name="mediaEncodingProfile">
00130         /// Encoding profile which should be used for the recording session.
00131         /// </param>
00132         task<void> StartRecordingAsync(Windows::Media::MediaProperties::MediaEncodingProfile^ mediaEncodingProfile);
00133
00134         /// <summary>
00135         /// Stops recording.
00136         /// </summary>
00137         task<void> StopRecordingAsync();
00138
00139         /// <summary>
00140         /// Capture has failed.
00141         /// </summary>
00142         void OnCaptureFailed(Windows::Media::Capture::MediaCapture^ sender, Windows::Media::Capture::MediaCaptureFailedEventArgs^ errorEventArgs)
00143         {
00144             // Forward the error to listeners.
00145             Failed(this, ref new CaptureFailedEventArgs(errorEventArgs->Code, errorEventArgs->Message));
00146         }
00147
00148         /// <summary>
00149         /// There is an incoming connection.
00150         /// </summary>
00151         void OnIncomingConnection(Object^ sender, Object^ args)
00152         {
00153             // Forward the event to listeners.
00154             IncomingConnectionEvent(safe_cast<Microsoft::Samples::SimpleCommunication::StspMediaSinkProxy^>(sender), safe_cast<Microsoft::Samples::SimpleCommunication::IncomingConnectionEventArgs^>(args));
00155         }
00156
00157         property Platform::Agile<Windows::Media::Capture::MediaCapture> MediaCapture
00158         {
00159             Platform::Agile<Windows::Media::Capture::MediaCapture> get();
00160         }
00161     };
00162 }
Generated on Fri Nov 15 2024 22:21:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EventTests Member List

This is the complete list of members for EventTests, including all inherited members.
Click_BaseArgs(object sender, object e) | EventTests | [inline, private]
Click_NoArgs() | EventTests | [inline, private]
Click_RegularArgs(object sender, RoutedEventArgs e) | EventTests | [inline, private]
clickDelegate | EventTests |
EventTests() | EventTests | [inline]
Model | EventTests |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/pch.cpp Source File

  • FolderEnumeration
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingSessionScenario.cpp Source File

  • Logging
  • cpp

LoggingSessionScenario.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "LoggingSessionScenario.h"
00009 #include "LoggingScenarioHelpers.h"
00010
00011 #define SCENARIO_PREFIX                     L"LoggingSessionScenario_"
00012 #define DEFAULT_SESSION_NAME                SCENARIO_PREFIX L"Session"
00013 #define DEFAULT_CHANNEL_NAME                SCENARIO_PREFIX L"Channel"
00014 #define OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME SCENARIO_PREFIX L"LogFiles"
00015 #define LOGGING_ENABLED_SETTING_KEY_NAME    SCENARIO_PREFIX L"LoggingEnabled"
00016
00017 using namespace concurrency;
00018 using namespace Windows::Foundation::Diagnostics;
00019 using namespace Windows::Storage;
00020 using namespace SDKTemplate;
00021
00022 LoggingSessionScenario^ LoggingSessionScenario::_instance;
00023
00024 LoggingSessionScenario::LoggingSessionScenario()
00025 {
00026     _logFileGeneratedCount = 0;
00027     _isBusy = false;
00028
00029     // Create the logging channel.
00030     // When an app logs messages to a channel, the messges will go
00031     // to any sessions which are consuming messages from the channel.
00032 #pragma warning(push)
00033 #pragma warning(disable : 4973)
00034     _channel = ref new Windows::Foundation::Diagnostics::LoggingChannel(DEFAULT_CHANNEL_NAME);
00035 #pragma warning(pop)
00036
00037     // This sample listens to the channel's events so it can track
00038     // information about the channel's enablement status.
00039     _channel->LoggingEnabled += ref new Windows::Foundation::TypedEventHandler<Windows::Foundation::Diagnostics::ILoggingChannel ^, Platform::Object ^>(this, &LoggingSessionScenario::OnChannelLoggingEnabled);
00040     App::Current->Suspending += ref new Windows::UI::Xaml::SuspendingEventHandler(this, &LoggingSessionScenario::OnAppSuspending);
00041     App::Current->Resuming += ref new Windows::Foundation::EventHandler<Platform::Object ^>(this, &LoggingSessionScenario::OnAppResuming);
00042
00043     // If the app is being launched (not resumed), the
00044     // following call will activate logging if it had been
00045     // active at the time of the last suspend.
00046     ResumeLoggingIfApplicable();
00047 }
00048
00049 LoggingSessionScenario::~LoggingSessionScenario()
00050 {
00051
00052 }
00053
00054 void LoggingSessionScenario::OnAppSuspending(Platform::Object ^sender, Windows::ApplicationModel::SuspendingEventArgs ^e)
00055 {
00056     (void) sender;    // Unused parameter
00057     auto deferral = e->SuspendingOperation->GetDeferral();
00058     PrepareToSuspend();
00059     deferral->Complete();
00060 }
00061
00062 void LoggingSessionScenario::OnAppResuming(Platform::Object ^sender, Platform::Object ^args)
00063 {
00064     // If logging was active at the last suspend,
00065     // ResumeLoggingIfApplicable will re-activate
00066     // logging.
00067     ResumeLoggingIfApplicable();
00068 }
00069
00070 void LoggingSessionScenario::OnChannelLoggingEnabled(ILoggingChannel^ sender, Platform::Object^ args)
00071 {
00072     // This method is called when the channel is informing us of channel-related state changes.
00073     // Save new channel state. These values can be used for advanced logging scenarios where,
00074     // for example, it's desired to skip blocks of logging code if the channel is not being
00075     // consumed by any sessions.
00076     _isChannelEnabled = sender->Enabled;
00077     _channelLoggingLevel = sender->Level;
00078 }
00079
00080 task<StorageFile^> LoggingSessionScenario::SaveLogInMemoryToFileAsync()
00081 {
00082     // Create the app-defined folder under the app's local folder.
00083     // An app defines where/how it wants to store log files.
00084     // This sample uses OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME under
00085     // the app's local folder.
00086     return create_task(ApplicationData::Current->LocalFolder->CreateFolderAsync(OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME, CreationCollisionOption::OpenIfExists))
00087         .then([this](StorageFolder^ ourSampleAppLogFolder)
00088         {
00089             // Create a new log file name.
00090             Platform::String^ newLogFileName = "Log-" + ref new Platform::String(GetTimeStamp().c_str()) + ".etl";
00091             // Asynchronously save the in-memory log file to a log file in our app's log folder.
00092             return create_task(this->_session->SaveToFileAsync(ourSampleAppLogFolder, newLogFileName));
00093         })
00094         .then([this](Windows::Storage::StorageFile^ savedLogFile)
00095         {
00096             // Return the log file as a StorageFile.
00097             return savedLogFile;
00098         });
00099 }
00100
00101 bool LoggingSessionScenario::ToggleLoggingEnabledDisabled()
00102 {
00103     IsBusy = true;
00104     try
00105     {
00106         if (_session != nullptr)
00107         {
00108             delete _session;
00109             _session = nullptr;
00110             SetAppLocalSettingsValue(LOGGING_ENABLED_SETTING_KEY_NAME, false);
00111             StatusChanged(this, ref new LoggingScenarioEventArgs(false));
00112             IsBusy = false;
00113             return false;
00114         }
00115         else
00116         {
00117             StartLogging();
00118             SetAppLocalSettingsValue(LOGGING_ENABLED_SETTING_KEY_NAME, true);
00119             StatusChanged(this, ref new LoggingScenarioEventArgs(true));
00120             IsBusy = false;
00121             return true;
00122         }
00123     }
00124     catch (...)
00125     {
00126         IsBusy = false;
00127         throw;
00128     }
00129 }
00130
00131 void LoggingSessionScenario::StartLogging()
00132 {
00133     // If no session exists, create one.
00134     // NOTE: There are use cases where an application
00135     // may want to create only a channel for sessions outside
00136     // of the application itself. See MSDN for details. This
00137     // sample is the common scenario of an app logging events
00138     // which it wants to place in its own log file, so it creates
00139     // a session and channel as a pair. The channel is created
00140     // during construction of this LoggingSessionScenario class so
00141     // it already exsits by the time this function is called.
00142     if (_session == nullptr)
00143     {
00144         _session = ref new Windows::Foundation::Diagnostics::LoggingSession(DEFAULT_SESSION_NAME);
00145     }
00146
00147     // This sample adds the channel at level "warning" to
00148     // demonstrated how messages logged at more verbose levels
00149     // are ignored by the session.
00150     _session->AddLoggingChannel(_channel, LoggingLevel::Warning);
00151 }
00152
00153 void LoggingSessionScenario::PrepareToSuspend()
00154 {
00155     SetAppLocalSettingsValue(LOGGING_ENABLED_SETTING_KEY_NAME, _session != nullptr);
00156 }
00157
00158 void LoggingSessionScenario::ResumeLoggingIfApplicable()
00159 {
00160     bool loggingEnabled;
00161     if (IsAppLocalSettingsValue(LOGGING_ENABLED_SETTING_KEY_NAME))
00162     {
00163         loggingEnabled = GetAppLocalSettingsValueAsBool(LOGGING_ENABLED_SETTING_KEY_NAME);
00164     }
00165     else
00166     {
00167         SetAppLocalSettingsValue(LOGGING_ENABLED_SETTING_KEY_NAME, true);
00168         loggingEnabled = true;
00169     }
00170
00171     if (loggingEnabled)
00172     {
00173         StartLogging();
00174     }
00175 }
00176
00177 task<void> LoggingSessionScenario::DoScenarioAsync()
00178 {
00179     IsBusy = true;
00180     try
00181     {
00182         // ContinuationData allows information to be
00183         // shared across the below async operations.
00184         struct ContinuationData
00185         {
00186             int messageIndex;
00187             int lastDelay;
00188             int lastAppError;
00189             int startFileCount;
00190             std::function<concurrency::task<void>(const std::shared_ptr<ContinuationData>&)> func;
00191         };
00192
00193         // Create an instance of ContinuationData to share
00194         // across the below async tasks.
00195         auto data = std::make_shared<ContinuationData>();
00196
00197         // A message index counter which increments for each
00198         // logging call.
00199         data->messageIndex = 0;
00200
00201         // The messageIndex value at the last delay.
00202         data->lastDelay = 0;
00203
00204         // The messageIndex value at the last simulated error.
00205         data->lastAppError = 0;
00206
00207         // Get the count of log files created so far.
00208         // The code below will execute until 3 more
00209         // log files are created.
00210         data->startFileCount = LogFileGeneratedCount;
00211
00212         // This is the main worker function. It is
00213         // called asynchronously until 3 new log files
00214         // have been created.
00215         data->func = [this](const std::shared_ptr<ContinuationData>& data)
00216         {
00217             const int NUMBER_OF_LOG_FILES_TO_GENERATE = 3;
00218
00219             while (LogFileGeneratedCount - data->startFileCount < NUMBER_OF_LOG_FILES_TO_GENERATE)
00220             {
00221                 try
00222                 {
00223                     // Since the channel is added to the session at level Warning,
00224                     // the following is logged because it is logged at level LoggingLevel.Critical.
00225                     Platform::String^ messageToLog =
00226                         "Message=" +
00227                         (++data->messageIndex).ToString() +
00228                         ": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum " +
00229                         "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
00230                     _channel->LogMessage(messageToLog, LoggingLevel::Critical);
00231
00232                     // Since the channel is added to the session at level Warning,
00233                     // the following is *not* logged because it is logged at LoggingLevel.Information.
00234                     messageToLog =
00235                         "Message=" +
00236                         (++data->messageIndex).ToString() +
00237                         ": Lorem ipsum dolor sit amet, consectetur adipiscing elit.In ligula nisi, vehicula nec eleifend vel, rutrum non dolor.Vestibulum ante ipsum " +
00238                         "primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst.";
00239                     _channel->LogMessage(messageToLog, LoggingLevel::Information);
00240
00241                     int value = 1000000; // one million, 7 digits, 4-bytes as an int, 14 bytes as a wide character string.
00242                     data->messageIndex++;
00243                     _channel->LogMessage("Value #" + data->messageIndex.ToString() + ":" + value.ToString(), LoggingLevel::Critical); // 'value' is logged as 14 byte wide character string.
00244                     data->messageIndex++;
00245                     _channel->LogValuePair("Value", value, LoggingLevel::Critical); // 'value' is logged as a 4-byte integer.
00246
00247                     //
00248                     // Every once in a while, simulate an application error
00249                     // which causes the app to save the current snapshot
00250                     // of logging events in memory to a disk ETL file.
00251                     //
00252
00253                     if (data->messageIndex - data->lastAppError >= 25000)
00254                     {
00255                         data->lastAppError = data->messageIndex;
00256
00257                         // Before simulating an application error, demonstrate LoggingActivity.
00258                         // A LoggingActivity outputs a pair of begin and end messages to the channel.
00259                         // The first message is logged when the LoggingActivity is created. When
00260                         // exiting the scope of the LoggingActivity, the second message will be logged.
00261                         {
00262                             LoggingActivity activity("Add two numbers.", _channel, LoggingLevel::Critical);
00263                             int oneNumber = 100;
00264                             int anotherNumber = 200;
00265                             int total = oneNumber + anotherNumber;
00266                             _channel->LogMessage("Message=" + (++data->messageIndex).ToString() + ": The result of adding two numbers: " + total.ToString(), LoggingLevel::Critical);
00267                         } // The LoggingActivity instance will log the second message at this scope exit.
00268
00269                         // Simulate an application error.
00270                         throw std::exception("Some bad app error occurred.");
00271                     }
00272
00273                     //
00274                     // Pause every once in a while to simulate application activity outside of logging.
00275                     //
00276
00277                     if (data->messageIndex - data->lastDelay >= 100)
00278                     {
00279                         data->lastDelay = data->messageIndex;
00280
00281                         // Create a task which calls this function again in 5 msecs.
00282                         // When this function is called again, it will continue its work.
00283                         return create_delayed_task(std::chrono::milliseconds(5), [=]{ return data->func(data); });
00284                     }
00285                 }
00286                 catch (std::exception e)
00287                 {
00288                     // Save in-memory logging buffer to a log file on error.
00289
00290                     ::std::wstring wideWhat;
00291                     if (e.what() != nullptr)
00292                     {
00293                         int convertResult = MultiByteToWideChar(CP_UTF8, 0, e.what(), (int)strlen(e.what()), NULL, 0);
00294                         if (convertResult <= 0)
00295                         {
00296                             wideWhat = L"Exception occurred: Failure to convert its message text using MultiByteToWideChar: convertResult=";
00297                             wideWhat += convertResult.ToString()->Data();
00298                             wideWhat += L"  GetLastError()=";
00299                             wideWhat += GetLastError().ToString()->Data();
00300                         }
00301                         else
00302                         {
00303                             wideWhat.resize(convertResult + 10);
00304                             convertResult = MultiByteToWideChar(CP_UTF8, 0, e.what(), (int)strlen(e.what()), &wideWhat[0], (int)wideWhat.size());
00305                             if (convertResult <= 0)
00306                             {
00307                                 wideWhat = L"Exception occurred: Failure to convert its message text using MultiByteToWideChar: convertResult=";
00308                                 wideWhat += convertResult.ToString()->Data();
00309                                 wideWhat += L"  GetLastError()=";
00310                                 wideWhat += GetLastError().ToString()->Data();
00311                             }
00312                             else
00313                             {
00314                                 wideWhat.insert(0, L"Exception occurrred: ");
00315                             }
00316                         }
00317                     }
00318                     else
00319                     {
00320                         wideWhat = L"Exception occurred: Unknown.";
00321                     }
00322
00323                     Platform::String^ errorMessage = ref new Platform::String(wideWhat.c_str());
00324                     // The session added the channel at level Warning. Log the message at
00325                     // level Error which is above (more critical than) Warning, which
00326                     // means it will actually get logged.
00327                     _channel->LogMessage(errorMessage, LoggingLevel::Error);
00328                     SaveLogInMemoryToFileAsync().then([=](StorageFile^ logFile) {
00329                         _logFileGeneratedCount++;
00330                         StatusChanged(this, ref new LoggingScenarioEventArgs(LoggingScenarioEventType::LogFileGenerated, logFile->Path->Data()));
00331                     }).wait();
00332                 }
00333             }
00334
00335             // 3 log files created, nothing more to do, stop.
00336             return task<void>([]() -> void {});
00337         };
00338
00339         // Create the first task of several which will create 3 log files,
00340         // and then execute the following continuation code when finished...
00341         return data->func(data).then([=](task<void> previousTask)
00342         {
00343             // This executes after 3 new log files have been created or
00344             // in the event of an unhandled exception in the above code.
00345             try
00346             {
00347                 // Tell the sample UI that the scenario is not busy any longer.
00348                 IsBusy = false;
00349
00350                 // The following 'get' will re-throw any exceptions which
00351                 // occurred during the above code (data->func above).
00352                 previousTask.get();
00353             }
00354             catch (...)
00355             {
00356                 OutputDebugString(L"Exception during DoScenario.");
00357                 throw;
00358             }
00359         });
00360     }
00361     catch (...)
00362     {
00363         IsBusy = false;
00364         throw;
00365     }
00366 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cs/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cs Source File

  • BackgroundTask
  • cs
  • BackgroundTask

Scenario2_SampleBackgroundTaskWithCondition.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class SampleBackgroundTaskWithCondition : Page
00030     {
00031         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00032         // as NotifyUser()
00033         MainPage rootPage = MainPage.Current;
00034
00035         public SampleBackgroundTaskWithCondition()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         /// </summary>
00043         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             foreach (var task in BackgroundTaskRegistration.AllTasks)
00048             {
00049                 if (task.Value.Name == BackgroundTaskSample.SampleBackgroundTaskWithConditionName)
00050                 {
00051                     AttachProgressAndCompletedHandlers(task.Value);
00052                     BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName, true);
00053                     break;
00054                 }
00055             }
00056
00057             UpdateUI();
00058         }
00059
00060         /// <summary>
00061         /// Register a SampleBackgroundTaskWithCondition.
00062         /// </summary>
00063         /// <param name="sender"></param>
00064         /// <param name="e"></param>
00065         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00066         {
00067             var task = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,
00068                                                                    BackgroundTaskSample.SampleBackgroundTaskWithConditionName,
00069                                                                    new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
00070                                                                    new SystemCondition(SystemConditionType.InternetAvailable));
00071             AttachProgressAndCompletedHandlers(task);
00072             UpdateUI();
00073         }
00074
00075         /// <summary>
00076         /// Unregister a SampleBackgroundTaskWithCondition.
00077         /// </summary>
00078         /// <param name="sender"></param>
00079         /// <param name="e"></param>
00080         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00081         {
00082             BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
00083             UpdateUI();
00084         }
00085
00086         /// <summary>
00087         /// Attach progress and completed handers to a background task.
00088         /// </summary>
00089         /// <param name="task">The task to attach progress and completed handlers to.</param>
00090         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00091         {
00092             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00093             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00094         }
00095
00096         /// <summary>
00097         /// Handle background task progress.
00098         /// </summary>
00099         /// <param name="task">The task that is reporting progress.</param>
00100         /// <param name="e">Arguments of the progress report.</param>
00101         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00102         {
00103             var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00104             {
00105                 var progress = "Progress: " + args.Progress + "%";
00106                 BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress = progress;
00107                 UpdateUI();
00108             });
00109         }
00110
00111         /// <summary>
00112         /// Handle background task completion.
00113         /// </summary>
00114         /// <param name="task">The task that is reporting completion.</param>
00115         /// <param name="e">Arguments of the completion report.</param>
00116         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00117         {
00118             UpdateUI();
00119         }
00120
00121         /// <summary>
00122         /// Update the scenario UI.
00123         /// </summary>
00124         private async void UpdateUI()
00125         {
00126             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00127             () =>
00128             {
00129                 RegisterButton.IsEnabled = !BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
00130                 UnregisterButton.IsEnabled = BackgroundTaskSample.SampleBackgroundTaskWithConditionRegistered;
00131                 Progress.Text = BackgroundTaskSample.SampleBackgroundTaskWithConditionProgress;
00132                 Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.SampleBackgroundTaskWithConditionName);
00133             });
00134         }
00135     }
00136 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShareApplicationLink Member List

This is the complete list of members for ShareApplicationLink, including all inherited members.
GetLogoBackgroundColor() | ShareApplicationLink | [inline, private]
GetShareContent(DataRequest request) | ShareApplicationLink | [inline, protected]
ShareApplicationLink() | ShareApplicationLink | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • EnterpriseDataProtection
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("EdpDPLTasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("EdpDPLTasks")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GeoEquals Member List

This is the complete list of members for GeoEquals, including all inherited members.
operator()(const Windows::Devices::Geolocation::BasicGeoposition &left, const Windows::Devices::Geolocation::BasicGeoposition &right) const GeoEquals [inline]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario1_Create.xaml.h Source File

  • FileAccess
  • cpp

Scenario1_Create.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario1_Create.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Creating a file.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario1 sealed
00025     {
00026     public:
00027         Scenario1();
00028
00029     private:
00030         MainPage^ rootPage = MainPage::Current;
00031
00032         void CreateFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level5.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level5.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Level5:
00015 // This class defines the fifth level of the game. It derives from the
00016 // third level. This level introduces obstacles that move into place
00017 // during game play. The targets may be hit in any order.
00018
00019 #include "Level3.h"
00020
00021 class Level5 : public Level3
00022 {
00023 public:
00024     Level5();
00025     virtual void Initialize(std::vector<std::shared_ptr<GameObject>> const& objects) override;
00026 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_DetectInPhoto Member List

This is the complete list of members for Scenario1_DetectInPhoto, including all inherited members.
ClearVisualization() | Scenario1_DetectInPhoto | [inline, private]
ComputeScalingTransformForSourceImage(BitmapDecoder sourceDecoder) | Scenario1_DetectInPhoto | [inline, private]
fillBrush | Scenario1_DetectInPhoto | [private]
lineBrush | Scenario1_DetectInPhoto | [private]
lineThickness | Scenario1_DetectInPhoto | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DetectInPhoto | [inline, protected]
OpenFile_Click(object sender, RoutedEventArgs e) | Scenario1_DetectInPhoto | [inline, private]
PhotoCanvas_SizeChanged(object sender, SizeChangedEventArgs e) | Scenario1_DetectInPhoto | [inline, private]
rootPage | Scenario1_DetectInPhoto | [private]
Scenario1_DetectInPhoto() | Scenario1_DetectInPhoto | [inline]
SetupVisualization(WriteableBitmap displaySource, IList< DetectedFace > foundFaces) | Scenario1_DetectInPhoto | [inline, private]
sourceImageHeightLimit | Scenario1_DetectInPhoto | [private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario1_DeviceConnect.xaml.h Source File

  • CustomHidDeviceAccess
  • cpp

Scenario1_DeviceConnect.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 //
00008 // Scenario1_DeviceConnect.xaml.h
00009 // Declaration of the DeviceConnect class
00010 //
00011
00012 #pragma once
00013 #include "DeviceListEntry.h"
00014 #include "EventHandlerForDevice.h"
00015 #include "Scenario1_DeviceConnect.g.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// Demonstrates how to connect to a Hid device and respond to device disconnects, app suspending and resuming events.
00021     ///
00022     /// To use this sample with your device:
00023     /// 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation.
00024     /// 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.
00025     /// </summary>
00026     [Windows::Foundation::Metadata::WebHostHidden]
00027     public ref class DeviceConnect sealed
00028     {
00029     public:
00030         DeviceConnect(void);
00031
00032     protected:
00033         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00034         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035
00036     private:
00037         static Platform::String^ ButtonNameDisconnectFromDevice;
00038         static Platform::String^ ButtonNameDisableReconnectToDevice;
00039
00040         Windows::Foundation::EventRegistrationToken appSuspendEventToken;
00041         Windows::Foundation::EventRegistrationToken appResumeEventToken;
00042
00043         Platform::Collections::Vector<DeviceListEntry^>^ listOfDevices;
00044
00045         Platform::Collections::Vector<Windows::Devices::Enumeration::DeviceWatcher^>^ deviceWatchers;
00046         bool watchersSuspended;
00047         bool watchersStarted;
00048
00049         // Has all the devices enumerated by the device watcher?
00050         bool isAllDevicesEnumerated;
00051
00052         void ConnectToDevice_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00053         void DisconnectFromDevice_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs);
00054
00055         void InitializeDeviceWatchers(void);
00056         void InitializeOsrFx2DeviceWatcher(void);
00057         void InitializeSuperMuttDeviceWatcher(void);
00058
00059         void StartHandlingAppEvents(void);
00060         void StopHandlingAppEvents(void);
00061
00062         void AddDeviceWatcher(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Platform::String^ deviceSelector);
00063
00064         void StartDeviceWatchers(void);
00065         void StopDeviceWatchers(void);
00066
00067         void AddDeviceToList(Windows::Devices::Enumeration::DeviceInformation^ deviceInformation, Platform::String^ deviceSelector);
00068         void RemoveDeviceFromList(Platform::String^ deviceId);
00069
00070         void ClearDeviceEntries(void);
00071
00072         DeviceListEntry^ FindDevice(Platform::String^ deviceId);
00073
00074         void OnAppSuspension(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
00075         void OnAppResume(Platform::Object^ sender, Platform::Object^ args);
00076
00077         void OnDeviceRemoved(
00078             Windows::Devices::Enumeration::DeviceWatcher^ sender,
00079             Windows::Devices::Enumeration::DeviceInformationUpdate^ deviceInformationUpdate);
00080
00081         void OnDeviceAdded(
00082             Windows::Devices::Enumeration::DeviceWatcher^ sender,
00083             Windows::Devices::Enumeration::DeviceInformation^ deviceInformation,
00084             Platform::String^ deviceSelector);
00085
00086         void OnDeviceEnumerationComplete(Windows::Devices::Enumeration::DeviceWatcher^ sender, Platform::Object^ args);
00087
00088         void OnDeviceConnected(EventHandlerForDevice^ sender, OnDeviceConnectedEventArgs^ onDeviceConnectedEventArgs);
00089         void OnDeviceClosing(EventHandlerForDevice^ sender, Windows::Devices::Enumeration::DeviceInformation^ deviceInformation);
00090
00091         void SelectDeviceInList(Platform::String^ deviceIdToSelect);
00092
00093         void UpdateConnectDisconnectButtonsAndList(bool enableConnectButton);
00094     };
00095 }
Generated on Fri Nov 15 2024 22:19:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cppwinrt/Scenario4_PartialReadWrite.cpp Source File

  • WebSocket
  • cppwinrt

Scenario4_PartialReadWrite.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_PartialReadWrite.h"
00014 #include "Scenario4_PartialReadWrite.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Networking::Sockets;
00020 using namespace winrt::Windows::Security::Cryptography::Certificates;
00021 using namespace winrt::Windows::Storage::Streams;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario4_PartialReadWrite::Scenario4_PartialReadWrite()
00028     {
00029         InitializeComponent();
00030         UpdateVisualState();
00031     }
00032
00033     void Scenario4_PartialReadWrite::OnNavigatedFrom(NavigationEventArgs const&)
00034     {
00035         CloseSocket();
00036     }
00037
00038     void Scenario4_PartialReadWrite::UpdateVisualState()
00039     {
00040         if (m_busy)
00041         {
00042             VisualStateManager::GoToState(*this, L"Busy", false);
00043         }
00044         else if (m_messageWebSocket != nullptr)
00045         {
00046             VisualStateManager::GoToState(*this, L"Connected", false);
00047         }
00048         else
00049         {
00050             VisualStateManager::GoToState(*this, L"Disconnected", false);
00051         }
00052     }
00053
00054     void Scenario4_PartialReadWrite::SetBusy(bool value)
00055     {
00056         m_busy = value;
00057         UpdateVisualState();
00058     }
00059
00060     IAsyncAction Scenario4_PartialReadWrite::OnConnect(IInspectable sender, RoutedEventArgs e)
00061     {
00062         auto lifetime = get_strong();
00063
00064         SetBusy(true);
00065         co_await ConnectAsync();
00066         SetBusy(false);
00067     }
00068
00069     IAsyncAction Scenario4_PartialReadWrite::ConnectAsync()
00070     {
00071         auto lifetime = get_strong();
00072
00073         if (ServerAddressField().Text().empty())
00074         {
00075             m_rootPage.NotifyUser(L"Please specify a URI to connect to", NotifyType::ErrorMessage);
00076             co_return;
00077         }
00078
00079         // Validating the URI is required since it was received from an untrusted source (user input).
00080         // The URI is validated by calling TryGetUri() that will return null for strings that are not
00081         // valid WebSocket URIs.
00082         // Note that when enabling the text box users may provide URIs to machines on the intrAnet
00083         // or intErnet. In these cases the app requires the "Private Networks (Client and Server)" or
00084         // "Internet (Client)" capability respectively.
00085         Uri server = TryGetUri(m_rootPage, ServerAddressField().Text());
00086         if (server == nullptr)
00087         {
00088             co_return;
00089         }
00090
00091         m_messageWebSocket = MessageWebSocket();
00092         m_messageWebSocket.Control().MessageType(SocketMessageType::Utf8);
00093
00094         // To support receiving event notifications for partial messages, you must set this receive mode.
00095         // If you do not set this mode, you will only receive notifications for complete messages; which is
00096         // the default behavior. Setting to Partial allows us to process partial data as soon as it arrives,
00097         // as opposed to waiting until the EndOfMessage to process the entire data.
00098         m_messageWebSocket.Control().ReceiveMode(MessageWebSocketReceiveMode::PartialMessage);
00099
00100         m_messageWebSocket.MessageReceived({ get_weak(), &Scenario4_PartialReadWrite::MessageReceived });
00101         m_messageWebSocket.Closed({ get_weak(), &Scenario4_PartialReadWrite::OnClosed });
00102
00103         if (server.SchemeName() == L"wss")
00104         {
00105             // WARNING: Only test applications should ignore SSL errors.
00106             // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
00107             // attacks. (Although the connection is secure, the server is not authenticated.)
00108             // Note that not all certificate validation errors can be ignored.
00109             // In this case, we are ignoring these errors since the certificate assigned to the localhost
00110             // URI is self-signed and has subject name = fabrikam.com
00111             m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::Untrusted);
00112             m_messageWebSocket.Control().IgnorableServerCertificateErrors().Append(ChainValidationResult::InvalidName);
00113         }
00114
00115         AppendOutputLine(L"Connecting to " + server.AbsoluteCanonicalUri() + L"...");
00116         try
00117         {
00118             co_await m_messageWebSocket.ConnectAsync(server);
00119         }
00120         catch (winrt::hresult_error const& ex) // For debugging
00121         {
00122             // Error happened during connect operation.
00123             m_messageWebSocket.Close();
00124             m_messageWebSocket = nullptr;
00125
00126             AppendOutputLine(BuildWebSocketError(ex));
00127             AppendOutputLine(ex.message());
00128             co_return;
00129         }
00130
00131         m_rootPage.NotifyUser(L"Connected", NotifyType::StatusMessage);
00132     }
00133
00134     IAsyncAction Scenario4_PartialReadWrite::OnSend(IInspectable sender, RoutedEventArgs e)
00135     {
00136         auto lifetime = get_strong();
00137
00138         SetBusy(true);
00139         co_await SendAsync();
00140         SetBusy(false);
00141     }
00142
00143     IAsyncAction Scenario4_PartialReadWrite::SendAsync()
00144     {
00145         auto lifetime = get_strong();
00146
00147         hstring message = InputField().Text();
00148         if (message.empty())
00149         {
00150             m_rootPage.NotifyUser(L"Please specify text to send", NotifyType::ErrorMessage);
00151             co_return;
00152         }
00153
00154         try
00155         {
00156             DataWriter messageWriter;
00157             messageWriter.WriteString(message);
00158             IBuffer buffer = messageWriter.DetachBuffer();
00159
00160             if (EndOfMessageCheckBox().IsChecked().Value())
00161             {
00162                 AppendOutputLine(L"Sending end of message: " + message);
00163                 co_await m_messageWebSocket.SendFinalFrameAsync(buffer);
00164             }
00165             else
00166             {
00167                 AppendOutputLine(L"Sending partial message: " + message);
00168                 co_await m_messageWebSocket.SendNonfinalFrameAsync(buffer);
00169             }
00170         }
00171         catch (winrt::hresult_error const& ex)
00172         {
00173             AppendOutputLine(BuildWebSocketError(ex));
00174             AppendOutputLine(ex.message());
00175             co_return;
00176         }
00177
00178         m_rootPage.NotifyUser(L"Send Complete", NotifyType::StatusMessage);
00179     }
00180
00181     IAsyncAction Scenario4_PartialReadWrite::MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs e)
00182     {
00183         auto lifetime = get_strong();
00184
00185         co_await m_rootPage.Dispatcher();
00186
00187         hstring partialOrCompleted = L"Partial";
00188
00189         if (e.IsMessageComplete())
00190         {
00191             partialOrCompleted = L"Complete";
00192         }
00193
00194         AppendOutputLine(partialOrCompleted + L" message Received; Type: " + to_hstring(e.MessageType()));
00195         DataReader reader = e.GetDataReader();
00196
00197         reader.UnicodeEncoding(UnicodeEncoding::Utf8);
00198
00199         try
00200         {
00201             // Note that it may be possible for partial UTF8 messages to be split between a character if it
00202             // extends multiple bytes. We avoid this by using only ASCII characters in this example.
00203             // Should your application use multi-byte characters, you will need to do checks for broken characters.
00204             hstring read = reader.ReadString(reader.UnconsumedBufferLength());
00205             AppendOutputLine(read);
00206         }
00207         catch (winrt::hresult_error const& ex)
00208         {
00209             AppendOutputLine(BuildWebSocketError(ex));
00210             AppendOutputLine(ex.message());
00211         }
00212     }
00213
00214     void Scenario4_PartialReadWrite::OnDisconnect(IInspectable const&, RoutedEventArgs const&)
00215     {
00216         SetBusy(true);
00217         m_rootPage.NotifyUser(L"Closing", NotifyType::StatusMessage);
00218         CloseSocket();
00219         SetBusy(false);
00220         m_rootPage.NotifyUser(L"Closed", NotifyType::StatusMessage);
00221     }
00222
00223     // This may be triggered remotely by the server or locally by Close/Dispose()
00224     IAsyncAction Scenario4_PartialReadWrite::OnClosed(IWebSocket sender, WebSocketClosedEventArgs e)
00225     {
00226         auto lifetime = get_strong();
00227
00228         // Continue on the UI thread so we do not need to synchronize access to messageWebSocket.
00229         co_await resume_foreground(Dispatcher());
00230
00231         AppendOutputLine(L"Closed; Code: " + to_hstring(e.Code()) + L", Reason: " + e.Reason());
00232
00233         if (m_messageWebSocket == sender)
00234         {
00235             CloseSocket();
00236             UpdateVisualState();
00237         }
00238     }
00239
00240     void Scenario4_PartialReadWrite::CloseSocket()
00241     {
00242         if (m_messageWebSocket)
00243         {
00244             try
00245             {
00246                 m_messageWebSocket.Close(1000, L"Closed due to user request.");
00247             }
00248             catch (winrt::hresult_error const& ex)
00249             {
00250                 AppendOutputLine(BuildWebSocketError(ex));
00251                 AppendOutputLine(ex.message());
00252             }
00253             m_messageWebSocket = nullptr;
00254         }
00255     }
00256
00257     void Scenario4_PartialReadWrite::AppendOutputLine(hstring const& value)
00258     {
00259         OutputField().Text(OutputField().Text() + value + L"\r\n");
00260     }
00261 }
Generated on Fri Nov 15 2024 22:22:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Content/RenderingInterfaces.h Source File

  • SpatialInteractionSource
  • cpp
  • Content

RenderingInterfaces.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "ShaderStructures.h"
00005
00006 namespace HolographicPaint
00007 {
00008     interface IRenderer
00009     {
00010         virtual void SetConstantBuffer(ModelConstantBuffer* pModelConstantBuffer) = 0;
00011         virtual void DrawCube() = 0;
00012     };
00013
00014     interface IBaseRenderedObject
00015     {
00016         virtual void Update(ID3D11DeviceContext* pDeviceContext) = 0;
00017         virtual void Render(ID3D11DeviceContext* pDeviceContext, IRenderer* pRenderingHelper) = 0;
00018     };
00019
00020 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/pch.h Source File

  • BarcodeScanner
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Storage.h"
00008 #include "winrt/Windows.Storage.Streams.h"
00009 #include "winrt/Windows.System.h"
00010 #include "winrt/Windows.System.Display.h"
00011 #include "winrt/Windows.UI.Core.h"
00012 #include "winrt/Windows.UI.Xaml.h"
00013 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.h"
00015 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00016 #include "winrt/Windows.UI.Xaml.Data.h"
00017 #include "winrt/Windows.UI.Xaml.Documents.h"
00018 #include "winrt/Windows.UI.Xaml.Interop.h"
00019 #include "winrt/Windows.UI.Xaml.Markup.h"
00020 #include "winrt/Windows.UI.Xaml.Media.h"
00021 #include "winrt/Windows.UI.Xaml.Navigation.h"
00022 #include "winrt/Windows.Devices.PointOfService.h"
00023 #include "winrt/Windows.Devices.Enumeration.h"
00024 #include "winrt/Windows.Devices.h"
00025 #include "winrt/Windows.Graphics.Display.h"
00026 #include "winrt/Windows.Media.h"
00027 #include "winrt/Windows.Media.Capture.h"
00028 #include "winrt/Windows.Media.Devices.h"
00029 #include "winrt/Windows.Media.MediaProperties.h"
00030 #include "DataHelpers.h"
00031 #include "BarcodeScannerInfo.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario4_Tuning.xaml.cs Source File

  • AdaptiveStreaming
  • cs

Scenario4_Tuning.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Helpers;
00013 using SDKTemplate.Logging;
00014 using System;
00015 using System.Linq;
00016 using System.Threading;
00017 using System.Threading.Tasks;
00018 using Windows.Media.Core;
00019 using Windows.Media.Playback;
00020 using Windows.Media.Streaming.Adaptive;
00021 using Windows.UI.Core;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024 using Windows.UI.Xaml.Navigation;
00025 using Windows.Web.Http;
00026
00027 namespace SDKTemplate
00028 {
00029     /// See the README.md for discussion of this scenario.
00030
00031     public sealed partial class Scenario4_Tuning : Page
00032     {
00033         CancellationTokenSource ctsForInboundBitsPerSecondUiRefresh = new CancellationTokenSource();
00034         private AdaptiveMediaSource adaptiveMediaSource;
00035         private BitrateHelper bitrateHelper;
00036
00037         public Scenario4_Tuning()
00038         {
00039             this.InitializeComponent();
00040             iconInboundBitsPerSecond.Symbol = (Symbol)0xE88A;
00041         }
00042
00043         protected override void OnNavigatedFrom(NavigationEventArgs e)
00044         {
00045             ctsForInboundBitsPerSecondUiRefresh.Cancel(); // Cancel timer
00046             adaptiveMediaSource = null; // release app instance of AdaptiveMediaSource
00047
00048             // Release handles on various media objects to ensure a quick clean-up
00049             ContentSelectorControl.MediaPlaybackItem = null;
00050             var mediaPlayer = mediaPlayerElement.MediaPlayer;
00051             if (mediaPlayer != null)
00052             {
00053                 mediaPlayerLogger?.Dispose();
00054                 mediaPlayerLogger = null;
00055
00056                 UnregisterHandlers(mediaPlayer);
00057
00058                 mediaPlayerElement.SetMediaPlayer(null);
00059                 mediaPlayer.Dispose();
00060             }
00061         }
00062
00063         private void UnregisterHandlers(MediaPlayer mediaPlayer)
00064         {
00065             AdaptiveMediaSource adaptiveMediaSource = null;
00066             MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
00067             if (mpItem != null)
00068             {
00069                 adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
00070             }
00071             MediaSource source = mediaPlayer.Source as MediaSource;
00072             if (source != null)
00073             {
00074                 adaptiveMediaSource = source.AdaptiveMediaSource;
00075             }
00076
00077             mediaPlaybackItemLogger?.Dispose();
00078             mediaPlaybackItemLogger = null;
00079
00080             mediaSourceLogger?.Dispose();
00081             mediaSourceLogger = null;
00082
00083             adaptiveMediaSourceLogger?.Dispose();
00084             adaptiveMediaSourceLogger = null;
00085
00086             UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00087         }
00088
00089         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00090         {
00091             var mediaPlayer = new MediaPlayer();
00092
00093             // We use a helper class that logs all the events for the MediaPlayer:
00094             mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);
00095
00096             // Ensure we have PlayReady support, if the user enters a DASH/PR Uri in the text box:
00097             var prHelper = new PlayReadyHelper(LoggerControl);
00098             prHelper.SetUpProtectionManager(mediaPlayer);
00099             mediaPlayerElement.SetMediaPlayer(mediaPlayer);
00100
00101             ContentSelectorControl.Initialize(
00102                 mediaPlayer,
00103                 MainPage.ContentManagementSystemStub.Where(m => !m.Aes),
00104                 null,
00105                 LoggerControl,
00106                 LoadSourceFromUriAsync);
00107
00108             // There is no InboundBitsPerSecondChanged event, so we start a polling thread to update UI.
00109             PollForInboundBitsPerSecond(ctsForInboundBitsPerSecondUiRefresh);
00110         }
00111
00112         private async void PollForInboundBitsPerSecond(CancellationTokenSource cts)
00113         {
00114             ulong InboundBitsPerSecondLast = 0;
00115             var refreshRate = TimeSpan.FromSeconds(2);
00116             while (!cts.IsCancellationRequested)
00117             {
00118                 if (adaptiveMediaSource != null)
00119                 {
00120                     if (InboundBitsPerSecondLast != adaptiveMediaSource.InboundBitsPerSecond)
00121                     {
00122                         InboundBitsPerSecondLast = adaptiveMediaSource.InboundBitsPerSecond;
00123                         InboundBitsPerSecondText.Text = InboundBitsPerSecondLast.ToString();
00124                     }
00125                 }
00126                 await Task.Delay(refreshRate);
00127             }
00128         }
00129
00130
00131         #region Content Loading
00132
00133         private async Task<MediaPlaybackItem> LoadSourceFromUriAsync(Uri uri, HttpClient httpClient = null)
00134         {
00135             UnregisterHandlers(mediaPlayerElement.MediaPlayer);
00136
00137             AdaptiveMediaSourceCreationResult result = null;
00138             if (httpClient != null)
00139             {
00140                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
00141             }
00142             else
00143             {
00144                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
00145             }
00146
00147             MediaSource source;
00148             if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
00149             {
00150                 adaptiveMediaSource = result.MediaSource;
00151
00152                 // We use a helper class that logs all the events for the AdaptiveMediaSource:
00153                 adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);
00154
00155                 // In addition to logging, we use the callbacks to update some UI elements in this scenario:
00156                 RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00157
00158                 // At this point, we have read the manifest of the media source, and all bitrates are known.
00159                 bitrateHelper = new BitrateHelper(adaptiveMediaSource.AvailableBitrates);
00160                 InitializeBitrateLists(adaptiveMediaSource);
00161                 await UpdatePlaybackBitrateAsync(adaptiveMediaSource.CurrentPlaybackBitrate);
00162                 await UpdateDownloadBitrateAsync(adaptiveMediaSource.CurrentDownloadBitrate);
00163
00164                 source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);
00165             }
00166             else
00167             {
00168                 Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
00169                 return null;
00170             }
00171
00172             // We use a helper class that logs all the events for the MediaSource:
00173             mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);
00174
00175             // Save the original Uri.
00176             source.CustomProperties["uri"] = uri.ToString();
00177
00178             // You're likely to put a content tracking id into the CustomProperties.
00179             source.CustomProperties["contentId"] = Guid.NewGuid().ToString();
00180
00181             var mpItem = new MediaPlaybackItem(source);
00182
00183             // We use a helper class that logs all the events for the MediaPlaybackItem:
00184             mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);
00185
00186             HideDescriptionOnSmallScreen();
00187
00188             return mpItem;
00189         }
00190
00191         private async void HideDescriptionOnSmallScreen()
00192         {
00193             // On small screens, hide the description text to make room for the video.
00194             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00195             {
00196                 DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
00197             });
00198         }
00199         #endregion
00200
00201
00202         #region Adaptive Bitrate control
00203
00204         private void InitializeBitrateLists(AdaptiveMediaSource aMS)
00205         {
00206             var sortedBitrates = aMS.AvailableBitrates.OrderByDescending(br => br).Select(br => new BitrateItem(br)).ToArray();
00207             InitialBitrateList.ItemsSource = sortedBitrates;
00208             var selected = sortedBitrates.First(item => item.Bitrate == aMS.InitialBitrate);
00209             InitialBitrateList.SelectedItem = sortedBitrates.FirstOrDefault(item => item.Bitrate == aMS.InitialBitrate);
00210
00211             var nullableSortedBitrates = (new BitrateItem[] { new BitrateItem(null) }).Concat(sortedBitrates).ToArray();
00212             DesiredMaxBitrateList.ItemsSource = DesiredMinBitrateList.ItemsSource = nullableSortedBitrates;
00213
00214             DesiredMaxBitrateList.SelectedItem = nullableSortedBitrates.First(item => item.Bitrate == aMS.DesiredMaxBitrate);
00215             DesiredMinBitrateList.SelectedItem = nullableSortedBitrates.First(item => item.Bitrate == aMS.DesiredMinBitrate);
00216         }
00217
00218         // An argument exception will be thrown if the following constraint is not met:
00219         //   DesiredMinBitrate <= InitialBitrate <= DesiredMaxBitrate
00220         private bool IsValidBitrateCombination(uint? desiredMinBitrate, uint? desiredMaxBitrate, uint initialBitrate)
00221         {
00222             // The ">" operator returns false if either operand is null. We take advantage of this
00223             // by testing in this manner. Do NOT "optimize" this by reversing the sense of the test
00224             // to "return desiredMinBitrate <= initialBitrate && initialBitrate <= desiredMaxBitrate;"
00225             if (desiredMinBitrate > initialBitrate || initialBitrate > desiredMaxBitrate)
00226             {
00227                 return false;
00228             }
00229             return true;
00230         }
00231
00232         private void InitialBitrateList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00233         {
00234             var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
00235             if (selection != null && adaptiveMediaSource.InitialBitrate != selection.Bitrate)
00236             {
00237                 if (IsValidBitrateCombination(adaptiveMediaSource.DesiredMinBitrate, adaptiveMediaSource.DesiredMaxBitrate, selection.Bitrate.Value))
00238                 {
00239                     adaptiveMediaSource.InitialBitrate = selection.Bitrate.Value;
00240                 }
00241                 else
00242                 {
00243                     InitialBitrateList.SelectedItem = e.RemovedItems[0];
00244                 }
00245             }
00246         }
00247
00248         private void DesiredMinBitrateList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00249         {
00250             var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
00251             if (selection != null && adaptiveMediaSource.DesiredMinBitrate != selection.Bitrate)
00252             {
00253                 if (IsValidBitrateCombination(selection.Bitrate, adaptiveMediaSource.DesiredMaxBitrate, adaptiveMediaSource.InitialBitrate))
00254                 {
00255                     adaptiveMediaSource.DesiredMinBitrate = selection.Bitrate;
00256                 }
00257                 else
00258                 {
00259                     DesiredMinBitrateList.SelectedItem = e.RemovedItems[0];
00260                 }
00261             }
00262         }
00263
00264         private void DesiredMaxBitrateList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00265         {
00266             var selection = (e.AddedItems.Count > 0) ? (BitrateItem)e.AddedItems[0] : null;
00267             if (selection != null && adaptiveMediaSource.DesiredMaxBitrate != selection.Bitrate)
00268             {
00269                 if (IsValidBitrateCombination(adaptiveMediaSource.DesiredMinBitrate, selection.Bitrate, adaptiveMediaSource.InitialBitrate))
00270                 {
00271                     adaptiveMediaSource.DesiredMaxBitrate = selection.Bitrate;
00272                 }
00273                 else
00274                 {
00275                     DesiredMaxBitrateList.SelectedItem = e.RemovedItems[0];
00276                 }
00277             }
00278         }
00279
00280         private void SetBitrateDowngradeTriggerRatio_Click()
00281         {
00282             double ratio;
00283             if (double.TryParse(BitrateDowngradeTriggerRatioText.Text, out ratio))
00284             {
00285                 adaptiveMediaSource.AdvancedSettings.BitrateDowngradeTriggerRatio = ratio;
00286             }
00287         }
00288
00289         private void SetDesiredBitrateHeadroomRatio_Click()
00290         {
00291             double ratio;
00292             if (double.TryParse(BitrateDowngradeTriggerRatioText.Text, out ratio))
00293             {
00294                 adaptiveMediaSource.AdvancedSettings.DesiredBitrateHeadroomRatio = ratio;
00295             }
00296         }
00297         #endregion
00298
00299
00300         #region AdaptiveMediaSource Event Handlers
00301
00302         private void RegisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00303         {
00304             adaptiveMediaSource.DownloadBitrateChanged += DownloadBitrateChanged;
00305             adaptiveMediaSource.PlaybackBitrateChanged += PlaybackBitrateChanged;
00306         }
00307
00308         private void UnregisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00309         {
00310             if (adaptiveMediaSource != null)
00311             {
00312                 adaptiveMediaSource.DownloadBitrateChanged -= DownloadBitrateChanged;
00313                 adaptiveMediaSource.PlaybackBitrateChanged -= PlaybackBitrateChanged;
00314             }
00315         }
00316         private async void DownloadBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadBitrateChangedEventArgs args)
00317         {
00318             uint downloadBitrate = args.NewValue;
00319             await UpdateDownloadBitrateAsync(downloadBitrate);
00320         }
00321
00322         private async Task UpdateDownloadBitrateAsync(uint downloadBitrate)
00323         {
00324             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00325             {
00326                 iconDownloadBitrate.Symbol = bitrateHelper.GetBitrateSymbol(downloadBitrate);
00327                 txtDownloadBitrate.Text = downloadBitrate.ToString();
00328             }));
00329         }
00330
00331         private async void PlaybackBitrateChanged(AdaptiveMediaSource sender, AdaptiveMediaSourcePlaybackBitrateChangedEventArgs args)
00332         {
00333             uint playbackBitrate = args.NewValue;
00334             await UpdatePlaybackBitrateAsync(playbackBitrate);
00335         }
00336
00337         private async Task UpdatePlaybackBitrateAsync(uint playbackBitrate)
00338         {
00339             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00340             {
00341                 iconPlaybackBitrate.Symbol = bitrateHelper.GetBitrateSymbol(playbackBitrate);
00342                 txtPlaybackBitrate.Text = playbackBitrate.ToString();
00343             }));
00344         }
00345         #endregion
00346
00347
00348         #region Utilities
00349         private void Log(string message)
00350         {
00351             LoggerControl.Log(message);
00352         }
00353         MediaPlayerLogger mediaPlayerLogger;
00354         MediaSourceLogger mediaSourceLogger;
00355         MediaPlaybackItemLogger mediaPlaybackItemLogger;
00356         AdaptiveMediaSourceLogger adaptiveMediaSourceLogger;
00357         #endregion
00358     }
00359
00360
00361     /// <summary>
00362     /// Item which provides a nicer display name for "null" bitrate.
00363     /// </summary>
00364     class BitrateItem
00365     {
00366         public uint? Bitrate { get; private set; }
00367         public BitrateItem(uint? bitrate)
00368         {
00369             Bitrate = bitrate;
00370         }
00371
00372         public override string ToString()
00373         {
00374             return (Bitrate == null) ? "Not set" : Bitrate.ToString();
00375         }
00376     }
00377 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Snapshot Member List

This is the complete list of members for Scenario4_Snapshot, including all inherited members.
FindButton_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_Snapshot |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario4_Snapshot |
resultCollection | Scenario4_Snapshot | [private]
Scenario4_Snapshot() | Scenario4_Snapshot |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SecondaryAppWindowPage.h Source File

  • AppWindow
  • cppwinrt

SecondaryAppWindowPage.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "SecondaryAppWindowPage.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct SecondaryAppWindowPage : SecondaryAppWindowPageT<SecondaryAppWindowPage>
00019     {
00020         SecondaryAppWindowPage();
00021     };
00022 }
00023
00024 namespace winrt::SDKTemplate::factory_implementation
00025 {
00026     struct SecondaryAppWindowPage : SecondaryAppWindowPageT<SecondaryAppWindowPage, implementation::SecondaryAppWindowPage>
00027     {
00028     };
00029 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/pch.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

pch.cpp

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft Corporation. All rights reserved.
00002
00003 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario4_BackgroundTask.xaml.cpp Source File

  • Pedometer
  • cpp

Scenario4_BackgroundTask.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4_BackgroundTask.xaml.cpp
00014 // Implementation of the Scenario4_BackgroundTask class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario4_BackgroundTask.xaml.h"
00019 #include "MainPage.xaml.h"
00020
00021 using namespace SDKTemplate;
00022
00023 using namespace Platform;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Controls::Primitives;
00029 using namespace Windows::UI::Xaml::Data;
00030 using namespace Windows::UI::Xaml::Input;
00031 using namespace Windows::UI::Xaml::Media;
00032 using namespace Windows::UI::Xaml::Navigation;
00033 using namespace Concurrency;
00034 using namespace Windows::ApplicationModel::Background;;
00035 using namespace Windows::Devices::Sensors;
00036 using namespace Windows::UI::Core;
00037 using namespace Windows::Storage;
00038
00039 int Scenario4_BackgroundTask::stepCountGoalOffset = 50;
00040
00041 Scenario4_BackgroundTask::Scenario4_BackgroundTask()
00042 {
00043     InitializeComponent();
00044     stepCount = 0;
00045     stepGoal = 0;
00046     backgroundTaskRegistered = false;
00047 }
00048
00049 /// <summary>
00050 /// Invoked when this page is about to be displayed in a Frame.
00051 /// </summary>
00052 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00053 /// property is typically used to configure the page.</param>
00054 void Scenario4_BackgroundTask::OnNavigatedTo(NavigationEventArgs^ e)
00055 {
00056     // find out if our background task is registered by finding for a name
00057     // match amongst the active tasks
00058     for each (auto cur in BackgroundTaskRegistration::AllTasks)
00059     {
00060         auto registration = dynamic_cast<BackgroundTaskRegistration^>(cur->Value);
00061         if (SampleBackgroundTaskName == registration->Name)
00062         {
00063             // Found our task! update the internal state to use it for updating UI
00064             backgroundTaskRegistered = true;
00065             break;
00066         }
00067     }
00068     UpdateUIAsync(backgroundTaskRegistered ? "Registered" : "Unregistered");
00069 }
00070
00071 /// <summary>
00072 /// This is the click handler for the 'Register Task' button.
00073 /// </summary>
00074 /// <param name="sender"></param>
00075 /// <param name="e"></param>
00076 void Scenario4_BackgroundTask::ScenarioRegisterTask(Object^ sender, RoutedEventArgs^ e)
00077 {
00078     create_task(BackgroundExecutionManager::RequestAccessAsync()).then([this](BackgroundAccessStatus status) {
00079
00080         if ((BackgroundAccessStatus::AlwaysAllowed == status) ||
00081             (BackgroundAccessStatus::AllowedSubjectToSystemPolicy == status))
00082         {
00083             RegisterBackgroundTask();
00084         }
00085         else
00086         {
00087             // In this case, we are not proceeding with task registration although
00088             // we could still go ahead and register (in which case registration becomes active only after the app is allowed access to run in the background)
00089             rootPage->NotifyUser("Background tasks may be disabled for this app", NotifyType::ErrorMessage);
00090         }
00091     });
00092 }
00093
00094 /// <summary>
00095 /// This is the click handler for the 'Unregister Task' button.
00096 /// </summary>
00097 /// <param name="sender"></param>
00098 /// <param name="e"></param>
00099 void Scenario4_BackgroundTask::ScenarioUnregisterTask(Object^ sender, RoutedEventArgs^ e)
00100 {
00101     // Loop through all background tasks and unregister any with SampleBackgroundTaskName
00102     for each (auto cur in BackgroundTaskRegistration::AllTasks)
00103     {
00104         auto registration = dynamic_cast<BackgroundTaskRegistration^>(cur->Value);
00105         if (SampleBackgroundTaskName == registration->Name)
00106         {
00107             registration->Unregister(true /*cancelTask*/);
00108             backgroundTaskRegistered = false;
00109         }
00110     }
00111
00112     if (!backgroundTaskRegistered)
00113     {
00114         UpdateUIAsync("Unregistered");
00115     }
00116 }
00117
00118 /// <summary>
00119 /// This is the event handler for background task completion.
00120 /// </summary>
00121 /// <param name="task">The task that is reporting completion.</param>
00122 /// <param name="args">The completion report arguments.</param>
00123 void Scenario4_BackgroundTask::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00124 {
00125     String^ status = "Completed and Unregistered";
00126     try
00127     {
00128         // check the result to find any errors reported by the background task
00129         args->CheckResult();
00130     }
00131     catch (Exception^ e)
00132     {
00133         status = e->Message;
00134     }
00135     // Pedometer background triggers are unique in a way as the background
00136     // events are one-shot - Once the step-goal associated with the original
00137     // task registration has been reached, that step count is a thing-of-past
00138     // and shall not fire as the stepcount on that pedometer changes.
00139     // Unregister the background task or update the step goals here.
00140     task->Unregister(false);
00141     backgroundTaskRegistered = false;
00142     UpdateUIAsync(status);
00143 }
00144
00145 /// <summary>
00146 /// Registers a background task to watch the default pedometer for a specific step goal.
00147 /// </summary>
00148 void Scenario4_BackgroundTask::RegisterBackgroundTask()
00149 {
00150     // get the default pedometer to register a background task for
00151     task<Pedometer^> getDefaultTask(Pedometer::GetDefaultAsync());
00152     getDefaultTask.then([this](task<Pedometer^> task)
00153     {
00154         try
00155         {
00156             auto sensorToListen = task.get();
00157             if (nullptr != sensorToListen)
00158             {
00159                 // Build a background task builder with appropriate entry point
00160                 auto builder = ref new BackgroundTaskBuilder();
00161                 builder->Name = SampleBackgroundTaskName;
00162                 builder->TaskEntryPoint = SampleBackgroundTaskEntryPoint;
00163                 auto currentReadings = sensorToListen->GetCurrentReadings();
00164
00165                 // To define the step goal, figure out the current step count
00166                 stepCount = 0;
00167                 for (auto kind = PedometerStepKind::Unknown; kind <= PedometerStepKind::Running; kind++)
00168                 {
00169                     if (currentReadings->HasKey(kind))
00170                     {
00171                         auto reading = currentReadings->Lookup(kind);
00172                         stepCount += reading->CumulativeSteps;
00173                     }
00174                 }
00175
00176                 // calculate the new step goal by adding the goal offset
00177                 stepGoal = (stepCount + Scenario4_BackgroundTask::stepCountGoalOffset);
00178                 // create a Pedometer data threshold for that step goal
00179                 auto threshold = ref new PedometerDataThreshold(sensorToListen, stepGoal);
00180                 // create a sensor background trigger using that threshold
00181                 auto trigger = ref new SensorDataThresholdTrigger(threshold);
00182
00183                 // set the trigger and register
00184                 builder->SetTrigger(trigger);
00185                 auto task = builder->Register();
00186                 task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &Scenario4_BackgroundTask::OnCompleted);
00187
00188                 backgroundTaskRegistered = true;
00189                 UpdateUIAsync("Registered");
00190             }
00191             else
00192             {
00193                 UpdateUIAsync("No Pedometers available");
00194             }
00195         }
00196         catch (AccessDeniedException^)
00197         {
00198             UpdateUIAsync("Access denied to the pedometer");
00199         }
00200     });
00201 }
00202
00203 /// <summary>
00204 /// Updates the scenario UI.
00205 /// </summary>
00206 /// <param name="status">The status string to display.</param>
00207 void Scenario4_BackgroundTask::UpdateUIAsync(String^ status)
00208 {
00209     // Update the buttons in the UI thread
00210     Dispatcher->RunAsync(
00211         CoreDispatcherPriority::Normal,
00212         ref new DispatchedHandler(
00213             [this, status]()
00214     {
00215         ScenarioRegisterTaskButton->IsEnabled = !backgroundTaskRegistered;
00216         ScenarioUnregisterTaskButton->IsEnabled = backgroundTaskRegistered;
00217         ScenarioOutput_TaskRegistration->Text = status;
00218
00219         auto settings = ApplicationData::Current->LocalSettings;
00220         ScenarioOutput_CurrentCount->Text = stepCount.ToString();
00221         ScenarioOutput_StepGoal->Text = stepGoal.ToString();
00222
00223         ScenarioOutput_UnknownCount->Text = "0";
00224         ScenarioOutput_WalkingCount->Text = "0";
00225         ScenarioOutput_RunningCount->Text = "0";
00226
00227         if (settings->Values->HasKey("ReportCount"))
00228         {
00229             ScenarioOutput_ReportCount->Text = safe_cast<String^>(settings->Values->Lookup("ReportCount")); // stored as a string
00230         }
00231         if (settings->Values->HasKey("TaskStatus"))
00232         {
00233             ScenarioOutput_TaskStatus->Text = safe_cast<String^>(settings->Values->Lookup("TaskStatus")); // stored as a string
00234         }
00235         if (settings->Values->HasKey("LastTimestamp"))
00236         {
00237             ScenarioOutput_LastTimestamp->Text = safe_cast<String^>(settings->Values->Lookup("LastTimestamp")); // stored as a string
00238             for (auto stepKind = PedometerStepKind::Unknown; stepKind <= PedometerStepKind::Running; stepKind++)
00239             {
00240                 if (settings->Values->HasKey(stepKind.ToString()))
00241                 {
00242                     String^ stepCount = safe_cast<String^>(settings->Values->Lookup(stepKind.ToString()));
00243                     switch (stepKind)
00244                     {
00245                     case Windows::Devices::Sensors::PedometerStepKind::Unknown:
00246                         ScenarioOutput_UnknownCount->Text = stepCount;
00247                         break;
00248                     case Windows::Devices::Sensors::PedometerStepKind::Walking:
00249                         ScenarioOutput_WalkingCount->Text = stepCount;
00250                         break;
00251                     case Windows::Devices::Sensors::PedometerStepKind::Running:
00252                         ScenarioOutput_RunningCount->Text = stepCount;
00253                         break;
00254                     default:
00255                         break;
00256                     }
00257                 }
00258             }
00259         }
00260     },
00261             CallbackContext::Any
00262         )
00263         );
00264 }
Generated on Fri Nov 15 2024 22:20:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/Server/OvenServer.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • Server

OvenServer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008
00009 using namespace Microsoft::WRL;
00010 using namespace Microsoft::WRL::Wrappers;
00011 using namespace ABI::Microsoft::SDKSamples::Kitchen;
00012 using namespace ABI::Windows::Foundation;
00013 using namespace ABI::Windows::System::Threading;
00014
00015 namespace ABI { namespace Microsoft { namespace SDKSamples { namespace Kitchen {
00016
00017                 class Bread WrlFinal : public RuntimeClass<IBread>
00018                 {
00019                     InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Bread, TrustLevel::BaseTrust);
00020                 public:
00021                     HRESULT RuntimeClassInitialize(HSTRING flavor)
00022                     {
00023                         return m_flavor.Set(flavor);
00024                     }
00025
00026                     // IBread
00027                     STDMETHODIMP get_Flavor(_COM_Outptr_ HSTRING* value) override
00028                     {
00029                         return m_flavor.CopyTo(value);
00030                     }
00031                     HString m_flavor;
00032                 };
00033
00034                 class Oven WrlFinal : public RuntimeClass<IOven, IAppliance>
00035                 {
00036                     InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven, TrustLevel::BaseTrust);
00037
00038                 public:
00039                     HRESULT RuntimeClassInitialize()
00040                     {
00041                         return S_OK;
00042                     }
00043
00044                     HRESULT RuntimeClassInitialize(_In_ Dimensions dimensions)
00045                     {
00046                         _dims = dimensions;
00047                         return S_OK;
00048                     }
00049
00050                     // IAppliance
00051                     STDMETHODIMP get_Volume(_Out_ double* value) override;
00052
00053                     // IOven
00054                     STDMETHODIMP ConfigurePreheatTemperature(_In_ OvenTemperature temperature) override;
00055                     STDMETHODIMP BakeBread(_In_ HSTRING flavor) override;
00056                     STDMETHODIMP add_BreadBaked(_In_ ITypedEventHandler<Oven*, BreadBakedEventArgs*>* handler, _Out_ EventRegistrationToken *token) override;
00057                     STDMETHODIMP remove_BreadBaked(_In_ EventRegistrationToken token) override;
00058
00059                 private:
00060                     AgileEventSource<ITypedEventHandler<Oven*, BreadBakedEventArgs*>> _breadBaked;
00061                     Dimensions _dims = { 1.0, 1.0, 1.0 };
00062                     OvenTemperature _temperature = OvenTemperature::Medium;
00063                 };
00064
00065                 class BreadBakedEventArgs WrlFinal : public RuntimeClass<IBreadBakedEventArgs>
00066                 {
00067                     InspectableClass(RuntimeClass_Microsoft_SDKSamples_Kitchen_BreadBakedEventArgs, TrustLevel::BaseTrust)
00068
00069                 public:
00070                     HRESULT RuntimeClassInitialize(_In_ Bread* bread)
00071                     {
00072                         m_bread = bread;
00073                         return S_OK;
00074                     }
00075
00076                     // IBreadBakedEventArgs
00077                     STDMETHODIMP get_Bread(_COM_Outptr_ IBread** value) override
00078                     {
00079                         return m_bread.CopyTo(value);
00080                     }
00081
00082                 private:
00083                     ComPtr<Bread> m_bread;
00084                 };
00085
00086                 class OvenFactory WrlFinal : public ActivationFactory<IOvenFactory>
00087                 {
00088                 public:
00089                     // IActivationFactory
00090                     STDMETHODIMP ActivateInstance(_COM_Outptr_ IInspectable** oven) override
00091                     {
00092                         return MakeAndInitialize<Oven>(oven);
00093                     }
00094
00095                     // IOvenFactory
00096                     STDMETHODIMP CreateOven(_In_ Dimensions dimensions, _COM_Outptr_ IOven** oven) override
00097                     {
00098                         return MakeAndInitialize<Oven>(oven, dimensions);
00099                     }
00100                 };
00101
00102                 STDMETHODIMP Oven::get_Volume(_Out_ double* value)
00103                 {
00104                     *value = _dims.Height * _dims.Width * _dims.Depth;
00105                     return S_OK;
00106                 }
00107
00108                 STDMETHODIMP Oven::ConfigurePreheatTemperature(_In_ OvenTemperature temperature)
00109                 {
00110                     HRESULT hr = S_OK;
00111                     if (temperature >= OvenTemperature::Low && temperature <= OvenTemperature::High)
00112                     {
00113                         _temperature = temperature;
00114                     }
00115                     else
00116                     {
00117                         hr = E_INVALIDARG;
00118                         ::RoOriginateErrorW(hr, 0, L"Temperature is out of range. The temperature should be low, medium, or high.");
00119                     }
00120                     return hr;
00121                 }
00122
00123                 STDMETHODIMP Oven::BakeBread(_In_ HSTRING flavor)
00124                 {
00125                     HRESULT hr = S_OK;
00126                     Windows::Foundation::TimeSpan preheatTime;
00127
00128                     // Determine how long we need to wait for the oven to get to temperature
00129                     switch (_temperature)
00130                     {
00131                     case OvenTemperature::Low:
00132                         preheatTime.Duration = 1000000;    // preheat time to 100ms
00133                         break;
00134
00135                     case OvenTemperature::Medium:
00136                         preheatTime.Duration = 2000000;    // preheat time to 200ms
00137                         break;
00138
00139                     case OvenTemperature::High:
00140                         preheatTime.Duration = 3000000;    // preheat time to 300ms
00141                         break;
00142
00143                     default:
00144                         hr = E_INVALIDARG;
00145                         ::RoOriginateErrorW(hr, 0, L"Temperature is out of range. The temperature should be low, medium, or high.");
00146                     }
00147
00148                     if (SUCCEEDED(hr))
00149                     {
00150                         ComPtr<IThreadPoolTimerStatics> threadPoolTimer;
00151                         hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &threadPoolTimer);
00152                         if (SUCCEEDED(hr))
00153                         {
00154                             // Oven makes bread
00155                             ComPtr<Bread> bread;
00156                             hr = MakeAndInitialize<Bread>(&bread, flavor);
00157                             if (SUCCEEDED(hr))
00158                             {
00159                                 ComPtr<BreadBakedEventArgs> eventArg;
00160                                 hr = MakeAndInitialize<BreadBakedEventArgs>(&eventArg, bread.Get());
00161                                 if (SUCCEEDED(hr))
00162                                 {
00163                                     ComPtr<Oven> thisRef(this);
00164                                     auto spTimerCallback = Callback<ITimerElapsedHandler>([thisRef, eventArg](IThreadPoolTimer*) -> HRESULT
00165                                     {
00166                                         return thisRef->_breadBaked.InvokeAll(thisRef.Get(), eventArg.Get());
00167                                     });
00168
00169                                     hr = spTimerCallback ? S_OK : E_OUTOFMEMORY;
00170                                     if (SUCCEEDED(hr))
00171                                     {
00172                                         ComPtr<IThreadPoolTimer> timer; // unused but required out param
00173                                         hr = threadPoolTimer->CreateTimer(spTimerCallback.Get(), preheatTime, &timer);
00174                                     }
00175                                 }
00176                             }
00177                         }
00178                     }
00179                     return hr;
00180                 }
00181
00182                 STDMETHODIMP Oven::add_BreadBaked(_In_ ITypedEventHandler<Oven*, BreadBakedEventArgs*>* handler, _Out_ EventRegistrationToken* token)
00183                 {
00184                     return _breadBaked.Add(handler, token);
00185                 }
00186
00187                 STDMETHODIMP Oven::remove_BreadBaked(_In_ EventRegistrationToken token)
00188                 {
00189                     return _breadBaked.Remove(token);
00190                 }
00191
00192                 ActivatableClassWithFactory(Oven, OvenFactory)
00193
00194 } /* Kitchen */ } /* SDKSamples */ } /* Microsoft */ } /* ABI */
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPanel/cs/Scenario1_CreateContact.xaml.cs Source File

  • ContactPanel
  • cs

Scenario1_CreateContact.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Contacts;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario1_CreateContact : Page
00026     {
00027         private MainPage rootPage = MainPage.Current;
00028
00029         public Scenario1_CreateContact()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private async void Pin_Click(object sender, RoutedEventArgs e)
00035         {
00036             Contact contact = await CreateContactAsync();
00037
00038             await AnnotateContactAsync(contact);
00039
00040             await PinContactAsync(contact);
00041         }
00042
00043         private async void Cleanup_Click(object sender, RoutedEventArgs e)
00044         {
00045             ContactList list = await GetContactListAsync();
00046
00047             Contact contact = await list.GetContactFromRemoteIdAsync(Constants.ContactRemoteId);
00048
00049             if (contact != null)
00050             {
00051                 // Request unpin
00052                 if (!await PinnedContactManager.GetDefault().RequestUnpinContactAsync(contact, PinnedContactSurface.Taskbar))
00053                 {
00054                     // User decided to keep the contact on the taskbar.
00055                     // Don't delete the contact after all.
00056                     return;
00057                 }
00058             }
00059
00060             // The contact is unpinned (or doesn't exist). Clean up the contact list.
00061             await list.DeleteAsync();
00062         }
00063
00064         private async Task<Contact> CreateContactAsync()
00065         {
00066             // Get the contact list for this app.
00067             ContactList list = await GetContactListAsync();
00068
00069             // Check if the sample contact already exists.
00070             Contact contact = await list.GetContactFromRemoteIdAsync(Constants.ContactRemoteId);
00071
00072             if (contact == null)
00073             {
00074                 // Create the sample contact.
00075                 contact = new Contact();
00076                 contact.FirstName = Constants.ContactFirstName;
00077                 contact.LastName = Constants.ContactLastName;
00078                 contact.RemoteId = Constants.ContactRemoteId;
00079                 contact.Emails.Add(new ContactEmail { Address = Constants.ContactEmail });
00080                 contact.Phones.Add(new ContactPhone { Number = Constants.ContactPhone });
00081                 contact.SourceDisplayPicture = RandomAccessStreamReference.CreateFromUri(new Uri(Constants.ContactImageSource));
00082
00083                 await list.SaveContactAsync(contact);
00084             }
00085
00086             return contact;
00087         }
00088
00089         private async Task AnnotateContactAsync(Contact contact)
00090         {
00091             // Annotate this contact with a remote ID, which you can then retrieve when the Contact Panel is activated.
00092             ContactAnnotation contactAnnotation = new ContactAnnotation
00093             {
00094                 ContactId = contact.Id,
00095                 RemoteId = Constants.ContactRemoteId,
00096                 SupportedOperations = ContactAnnotationOperations.ContactProfile | ContactAnnotationOperations.Message
00097             };
00098
00099             // Annotate that this contact can load this app's Contact Panel.
00100             var infos = await Windows.System.AppDiagnosticInfo.RequestInfoForAppAsync();
00101             contactAnnotation.ProviderProperties.Add("ContactPanelAppID", infos[0].AppInfo.AppUserModelId);
00102
00103             var contactAnnotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);
00104             var contactAnnotationLists = await contactAnnotationStore.FindAnnotationListsAsync();
00105
00106             ContactAnnotationList contactAnnotationList = contactAnnotationLists.Count > 0 ? contactAnnotationLists[0] : null;
00107
00108             if (contactAnnotationList == null)
00109             {
00110                 contactAnnotationList = await contactAnnotationStore.CreateAnnotationListAsync();
00111             }
00112
00113
00114             await contactAnnotationList.TrySaveAnnotationAsync(contactAnnotation);
00115         }
00116
00117         private async Task PinContactAsync(Contact contact)
00118         {
00119             // Get the PinnedContactManager for the current user.
00120             PinnedContactManager pinnedContactManager = PinnedContactManager.GetDefault();
00121
00122             // Check whether pinning to the taskbar is supported.
00123             if (!pinnedContactManager.IsPinSurfaceSupported(PinnedContactSurface.Taskbar))
00124             {
00125                 // If not, then there is nothing for this program to do.
00126                 rootPage.NotifyUser("The system does not support pinning contacts to the taskbar.", NotifyType.ErrorMessage);
00127                 return;
00128             }
00129
00130             // Pin the contact to the taskbar.
00131             if (!await pinnedContactManager.RequestPinContactAsync(contact, PinnedContactSurface.Taskbar))
00132             {
00133                 // Contact was not pinned.
00134                 return;
00135             }
00136         }
00137
00138         private async Task<ContactList> GetContactListAsync()
00139         {
00140             ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
00141
00142             // Find the contact list by name. (GetContactListAsync looks up a contact list by its ID.)
00143             IReadOnlyList<ContactList> lists = await store.FindContactListsAsync();
00144             ContactList sampleList = null;
00145             foreach (ContactList list in lists)
00146             {
00147                 if (list.DisplayName == Constants.ContactListName)
00148                 {
00149                     sampleList = list;
00150                     break;
00151                 }
00152             }
00153
00154             if (sampleList == null)
00155             {
00156                 sampleList = await store.CreateContactListAsync(Constants.ContactListName);
00157             }
00158
00159             return sampleList;
00160         }
00161     }
00162 }
Generated on Fri Nov 15 2024 22:18:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
BackButtonVisibility | BackButtonPage |
Footer_Click(object sender, RoutedEventArgs e) | MainPage | [inline, private]
ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) | MainPage | [inline, private]
MainPage() | MainPage | [inline]
OnBackRequested(object sender, BackRequestedEventArgs e) | BackButtonPage | [inline, protected, virtual]
OnNavigatedFrom(NavigationEventArgs e) | BackButtonPage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | MainPage | [inline, protected]
OpenScenario(IScenario scenario) | MainPage | [inline, private]
ScenarioGroup | MainPage |
ScenarioGroupProperty | MainPage | [static]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/BasicLoader.h Source File

  • Simple3DGameDX
  • cppwinrt
  • Common

BasicLoader.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "BasicReaderWriter.h"
00011
00012 // A simple loader class that provides support for loading shaders, textures,
00013 // and meshes from files on disk. Provides synchronous and asynchronous methods.
00014 class BasicLoader
00015 {
00016 public:
00017     BasicLoader(
00018         _In_ winrt::com_ptr<ID3D11Device3> d3dDevice,
00019         _In_opt_ IWICImagingFactory2* wicFactory = nullptr
00020         );
00021
00022     void LoadTexture(
00023         _In_ winrt::hstring const& filename,
00024         _Out_opt_ ID3D11Texture2D** texture,
00025         _Out_opt_ ID3D11ShaderResourceView** textureView
00026         );
00027
00028     winrt::Windows::Foundation::IAsyncAction LoadTextureAsync(
00029         _In_ winrt::hstring filename,
00030         _Out_opt_ ID3D11Texture2D** texture,
00031         _Out_opt_ ID3D11ShaderResourceView** textureView
00032         );
00033
00034     void LoadShader(
00035         _In_ winrt::hstring const& filename,
00036         _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const layoutDesc[],
00037         _In_ uint32_t layoutDescNumElements,
00038         _Out_ ID3D11VertexShader** shader,
00039         _Out_opt_ ID3D11InputLayout** layout
00040         );
00041
00042     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00043         _In_ winrt::hstring filename,
00044         _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC const layoutDesc[],
00045         _In_ uint32_t layoutDescNumElements,
00046         _Out_ ID3D11VertexShader** shader,
00047         _Out_opt_ ID3D11InputLayout** layout
00048         );
00049
00050     void LoadShader(
00051         _In_ winrt::hstring const& filename,
00052         _Out_ ID3D11PixelShader** shader
00053         );
00054
00055     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00056         _In_ winrt::hstring filename,
00057         _Out_ ID3D11PixelShader** shader
00058         );
00059
00060     void LoadShader(
00061         _In_ winrt::hstring const& filename,
00062         _Out_ ID3D11ComputeShader** shader
00063         );
00064
00065     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00066         _In_ winrt::hstring const filename,
00067         _Out_ ID3D11ComputeShader** shader
00068         );
00069
00070     void LoadShader(
00071         _In_ winrt::hstring const& filename,
00072         _Out_ ID3D11GeometryShader** shader
00073         );
00074
00075     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00076         _In_ winrt::hstring filename,
00077         _Out_ ID3D11GeometryShader** shader
00078         );
00079
00080     void LoadShader(
00081         _In_ winrt::hstring const& filename,
00082         _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY* streamOutDeclaration,
00083         _In_ uint32_t numEntries,
00084         _In_reads_opt_(numStrides) const uint32_t* bufferStrides,
00085         _In_ uint32_t numStrides,
00086         _In_ uint32_t rasterizedStream,
00087         _Out_ ID3D11GeometryShader** shader
00088         );
00089
00090     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00091         _In_ winrt::hstring filename,
00092         _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY* streamOutDeclaration,
00093         _In_ uint32_t numEntries,
00094         _In_reads_opt_(numStrides) const uint32_t* bufferStrides,
00095         _In_ uint32_t numStrides,
00096         _In_ uint32_t rasterizedStream,
00097         _Out_ ID3D11GeometryShader** shader
00098         );
00099
00100     void LoadShader(
00101         _In_ winrt::hstring const& filename,
00102         _Out_ ID3D11HullShader** shader
00103         );
00104
00105     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00106         _In_ winrt::hstring filename,
00107         _Out_ ID3D11HullShader** shader
00108         );
00109
00110     void LoadShader(
00111         _In_ winrt::hstring const& filename,
00112         _Out_ ID3D11DomainShader** shader
00113         );
00114
00115     winrt::Windows::Foundation::IAsyncAction LoadShaderAsync(
00116         _In_ winrt::hstring filename,
00117         _Out_ ID3D11DomainShader** shader
00118         );
00119
00120     void LoadMesh(
00121         _In_ winrt::hstring const& filename,
00122         _Out_ ID3D11Buffer** vertexBuffer,
00123         _Out_ ID3D11Buffer** indexBuffer,
00124         _Out_opt_ uint32_t* vertexCount,
00125         _Out_opt_ uint32_t* indexCount
00126         );
00127
00128     winrt::Windows::Foundation::IAsyncAction LoadMeshAsync(
00129         _In_ winrt::hstring filename,
00130         _Out_ ID3D11Buffer** vertexBuffer,
00131         _Out_ ID3D11Buffer** indexBuffer,
00132         _Out_opt_ uint32_t* vertexCount,
00133         _Out_opt_ uint32_t* indexCount
00134         );
00135
00136 private:
00137     winrt::com_ptr<ID3D11Device> m_d3dDevice;
00138     winrt::com_ptr<IWICImagingFactory2> m_wicFactory;
00139     BasicReaderWriter m_basicReaderWriter;
00140
00141     template <class DeviceChildType>
00142     inline void SetDebugName(
00143         _In_ DeviceChildType* object,
00144         _In_ winrt::hstring const& name
00145         );
00146
00147     std::wstring GetExtension(
00148         _In_ winrt::hstring const& filename
00149         );
00150
00151     void CreateTexture(
00152         _In_ bool decodeAsDDS,
00153         _In_reads_bytes_(dataSize) const byte* data,
00154         _In_ uint32_t dataSize,
00155         _Out_opt_ ID3D11Texture2D** texture,
00156         _Out_opt_ ID3D11ShaderResourceView** textureView,
00157         _In_opt_ winrt::hstring const& debugName
00158         );
00159
00160     void CreateInputLayout(
00161         _In_reads_bytes_(bytecodeSize) const byte* bytecode,
00162         _In_ uint32_t bytecodeSize,
00163         _In_reads_opt_(layoutDescNumElements) const D3D11_INPUT_ELEMENT_DESC* layoutDesc,
00164         _In_ uint32_t layoutDescNumElements,
00165         _Out_ ID3D11InputLayout** layout
00166         );
00167
00168     void CreateMesh(
00169         _In_ byte* meshData,
00170         _Out_ ID3D11Buffer** vertexBuffer,
00171         _Out_ ID3D11Buffer** indexBuffer,
00172         _Out_opt_ uint32_t* vertexCount,
00173         _Out_opt_ uint32_t* indexCount,
00174         _In_opt_ winrt::hstring const& debugName
00175         );
00176 };
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DirectXSample.h Source File

  • Simple3DGameXaml
  • cpp
  • Common

DirectXSample.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #include <math.h>
00010
00011 namespace DX
00012 {
00013     // Convert DirectX error codes to exceptions.
00014     inline void ThrowIfFailed(HRESULT hr)
00015     {
00016         if (FAILED(hr))
00017         {
00018             // Set a breakpoint on this line to catch DX API errors.
00019             throw Platform::Exception::CreateException(hr);
00020         }
00021     }
00022
00023     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00024     inline float ConvertDipsToPixels(float dips, float dpi)
00025     {
00026         static const float dipsPerInch = 96.0f;
00027         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00028     }
00029
00030     // Converts a length in physical pixels to a length in device-independent pixels (DIPs).
00031     inline float ConvertPixelsToDips(float pixels)
00032     {
00033         static const float dipsPerInch = 96.0f;
00034         return pixels * dipsPerInch / Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi; // Do not round.
00035     }
00036
00037     // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
00038     // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().
00039     inline float ConvertPixelsToDips(float pixels, float dpi)
00040     {
00041         static const float dipsPerInch = 96.0f;
00042         return pixels * dipsPerInch / dpi; // Do not round.
00043     }
00044
00045 #if defined(_DEBUG)
00046     // Check for SDK Layer support.
00047     inline bool SdkLayersAvailable()
00048     {
00049         HRESULT hr = D3D11CreateDevice(
00050             nullptr,
00051             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00052             0,
00053             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00054             nullptr,                    // Any feature level will do.
00055             0,
00056             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Store apps.
00057             nullptr,                    // No need to keep the D3D device reference.
00058             nullptr,                    // No need to know the feature level.
00059             nullptr                     // No need to keep the D3D device context reference.
00060             );
00061
00062         return SUCCEEDED(hr);
00063     }
00064 #endif
00065 }
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario4_BackgroundPublisher.xaml.cs Source File

  • BluetoothAdvertisement
  • cs

Scenario4_BackgroundPublisher.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Storage;
00015 using Windows.Storage.Streams;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 using Windows.ApplicationModel.Background;
00021 using Windows.Devices.Bluetooth;
00022 using Windows.Devices.Bluetooth.Advertisement;
00023 using Windows.Devices.Bluetooth.Background;
00024
00025 using SDKTemplate;
00026
00027 namespace BluetoothAdvertisement
00028 {
00029     /// <summary>
00030     /// An empty page that can be used on its own or navigated to within a Frame.
00031     /// </summary>
00032     public sealed partial class Scenario4_BackgroundPublisher : Page
00033     {
00034         // The background task registration for the background advertisement publisher
00035         private IBackgroundTaskRegistration taskRegistration;
00036         // The publisher trigger used to configure the background task registration
00037         private BluetoothLEAdvertisementPublisherTrigger trigger;
00038         // A name is given to the task in order for it to be identifiable across context.
00039         private string taskName = "Scenario4_BackgroundTask";
00040         // Entry point for the background task.
00041         private string taskEntryPoint = "BackgroundTasks.AdvertisementPublisherTask";
00042
00043         // A pointer back to the main page is required to display status messages.
00044         private MainPage rootPage;
00045
00046         /// <summary>
00047         /// Initializes the singleton application object.  This is the first line of authored code
00048         /// executed, and as such is the logical equivalent of main() or WinMain().
00049         /// </summary>
00050         public Scenario4_BackgroundPublisher()
00051         {
00052             this.InitializeComponent();
00053
00054             // Create and initialize a new trigger to configure it.
00055             trigger = new BluetoothLEAdvertisementPublisherTrigger();
00056
00057             // We need to add some payload to the advertisement. A publisher without any payload
00058             // or with invalid ones cannot be started. We only need to configure the payload once
00059             // for any publisher.
00060
00061             // Add a manufacturer-specific section:
00062             // First, create a manufacturer data section
00063             var manufacturerData = new BluetoothLEManufacturerData();
00064
00065             // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
00066             manufacturerData.CompanyId = 0xFFFE;
00067
00068             // Finally set the data payload within the manufacturer-specific section
00069             // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
00070             var writer = new DataWriter();
00071             UInt16 uuidData = 0x1234;
00072             writer.WriteUInt16(uuidData);
00073
00074             // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
00075             manufacturerData.Data = writer.DetachBuffer();
00076
00077             // Add the manufacturer data to the advertisement publisher:
00078             trigger.Advertisement.ManufacturerData.Add(manufacturerData);
00079
00080             // Display the information about the published payload
00081             PublisherPayloadBlock.Text = string.Format("Published payload information: CompanyId=0x{0}, ManufacturerData=0x{1}",
00082                 manufacturerData.CompanyId.ToString("X"),
00083                 uuidData.ToString("X"));
00084
00085             // Reset the displayed status of the publisher
00086             PublisherStatusBlock.Text = "";
00087         }
00088
00089         /// <summary>
00090         /// Invoked when this page is about to be displayed in a Frame.
00091         ///
00092         /// We will enable/disable parts of the UI if the device doesn't support it.
00093         /// </summary>
00094         /// <param name="eventArgs">Event data that describes how this page was reached. The Parameter
00095         /// property is typically used to configure the page.</param>
00096         protected override void OnNavigatedTo(NavigationEventArgs e)
00097         {
00098             rootPage = MainPage.Current;
00099
00100             // Get the existing task if already registered
00101             if (taskRegistration == null)
00102             {
00103                 // Find the task if we previously registered it
00104                 foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
00105                 {
00106                     if (task.Name == taskName)
00107                     {
00108                         taskRegistration = task;
00109                         taskRegistration.Completed += OnBackgroundTaskCompleted;
00110                         break;
00111                     }
00112                 }
00113             }
00114             else
00115             {
00116                 taskRegistration.Completed += OnBackgroundTaskCompleted;
00117             }
00118
00119             // Attach handlers for suspension to stop the publisher when the App is suspended.
00120             App.Current.Suspending += App_Suspending;
00121             App.Current.Resuming += App_Resuming;
00122
00123             rootPage.NotifyUser("Press Run to register publisher", NotifyType.StatusMessage);
00124         }
00125
00126         /// <summary>
00127         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00128         /// </summary>
00129         /// <param name="e">
00130         /// Event data that can be examined by overriding code. The event data is representative
00131         /// of the navigation that will unload the current Page unless canceled. The
00132         /// navigation can potentially be canceled by setting Cancel.
00133         /// </param>
00134         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00135         {
00136             // Remove local suspension handlers from the App since this page is no longer active.
00137             App.Current.Suspending -= App_Suspending;
00138             App.Current.Resuming -= App_Resuming;
00139
00140             // Since the publisher is registered in the background, the background task will be triggered when the App is closed
00141             // or in the background. To unregister the task, press the Stop button.
00142             if (taskRegistration != null)
00143             {
00144                 // Always unregister the handlers to release the resources to prevent leaks.
00145                 taskRegistration.Completed -= OnBackgroundTaskCompleted;
00146             }
00147             base.OnNavigatingFrom(e);
00148         }
00149
00150         /// <summary>
00151         /// Invoked when application execution is being suspended.  Application state is saved
00152         /// without knowing whether the application will be terminated or resumed with the contents
00153         /// of memory still intact.
00154         /// </summary>
00155         /// <param name="sender">The source of the suspend request.</param>
00156         /// <param name="e">Details about the suspend request.</param>
00157         private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00158         {
00159             if (taskRegistration != null)
00160             {
00161                 // Always unregister the handlers to release the resources to prevent leaks.
00162                 taskRegistration.Completed -= OnBackgroundTaskCompleted;
00163             }
00164             rootPage.NotifyUser("App suspending.", NotifyType.StatusMessage);
00165         }
00166
00167         /// <summary>
00168         /// Invoked when application execution is being resumed.
00169         /// </summary>
00170         /// <param name="sender">The source of the resume request.</param>
00171         /// <param name="e"></param>
00172         private void App_Resuming(object sender, object e)
00173         {
00174             // Get the existing task if already registered
00175             if (taskRegistration == null)
00176             {
00177                 // Find the task if we previously registered it
00178                 foreach (var task in BackgroundTaskRegistration.AllTasks.Values)
00179                 {
00180                     if (task.Name == taskName)
00181                     {
00182                         taskRegistration = task;
00183                         taskRegistration.Completed += OnBackgroundTaskCompleted;
00184                         break;
00185                     }
00186                 }
00187             }
00188             else
00189             {
00190                 taskRegistration.Completed += OnBackgroundTaskCompleted;
00191             }
00192         }
00193
00194         /// <summary>
00195         /// Invoked as an event handler when the Run button is pressed.
00196         /// </summary>
00197         /// <param name="sender">Instance that triggered the event.</param>
00198         /// <param name="e">Event data describing the conditions that led to the event.</param>
00199         private async void RunButton_Click(object sender, RoutedEventArgs e)
00200         {
00201             // Registering a background trigger if it is not already registered. It will start background advertising.
00202             // First get the existing tasks to see if we already registered for it
00203             if (taskRegistration != null)
00204             {
00205                 rootPage.NotifyUser("Background publisher already registered.", NotifyType.StatusMessage);
00206                 return;
00207             }
00208             else
00209             {
00210                 // Applications registering for background trigger must request for permission.
00211                 BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();
00212                 // Here, we do not fail the registration even if the access is not granted. Instead, we allow
00213                 // the trigger to be registered and when the access is granted for the Application at a later time,
00214                 // the trigger will automatically start working again.
00215
00216                 // At this point we assume we haven't found any existing tasks matching the one we want to register
00217                 // First, configure the task entry point, trigger and name
00218                 var builder = new BackgroundTaskBuilder();
00219                 builder.TaskEntryPoint = taskEntryPoint;
00220                 builder.SetTrigger(trigger);
00221                 builder.Name = taskName;
00222
00223                 // Now perform the registration.
00224                 taskRegistration = builder.Register();
00225
00226                 // For this scenario, attach an event handler to display the result processed from the background task
00227                 taskRegistration.Completed += OnBackgroundTaskCompleted;
00228
00229                 // Even though the trigger is registered successfully, it might be blocked. Notify the user if that is the case.
00230                 if ((backgroundAccessStatus == BackgroundAccessStatus.AlwaysAllowed) || (backgroundAccessStatus == BackgroundAccessStatus.AllowedSubjectToSystemPolicy))
00231                 {
00232                     rootPage.NotifyUser("Background publisher registered.", NotifyType.StatusMessage);
00233                 }
00234                 else
00235                 {
00236                     rootPage.NotifyUser("Background tasks may be disabled for this app", NotifyType.ErrorMessage);
00237                 }
00238             }
00239         }
00240
00241         /// <summary>
00242         /// Invoked as an event handler when the Stop button is pressed.
00243         /// </summary>
00244         /// <param name="sender">Instance that triggered the event.</param>
00245         /// <param name="e">Event data describing the conditions that led to the event.</param>
00246         private void StopButton_Click(object sender, RoutedEventArgs e)
00247         {
00248             // Unregistering the background task will stop advertising if this is the only client requesting
00249             // First get the existing tasks to see if we already registered for it
00250             if (taskRegistration != null)
00251             {
00252                 taskRegistration.Unregister(true);
00253                 taskRegistration = null;
00254                 rootPage.NotifyUser("Background publisher unregistered.", NotifyType.StatusMessage);
00255             }
00256             else
00257             {
00258                 // At this point we assume we haven't found any existing tasks matching the one we want to unregister
00259                 rootPage.NotifyUser("No registered background publisher found.", NotifyType.StatusMessage);
00260             }
00261         }
00262
00263         /// <summary>
00264         /// Handle background task completion.
00265         /// </summary>
00266         /// <param name="task">The task that is reporting completion.</param>
00267         /// <param name="e">Arguments of the completion report.</param>
00268         private async void OnBackgroundTaskCompleted(BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs eventArgs)
00269         {
00270             // We get the status changed processed by the background task
00271             if (ApplicationData.Current.LocalSettings.Values.Keys.Contains(taskName))
00272             {
00273                 string backgroundMessage = (string) ApplicationData.Current.LocalSettings.Values[taskName];
00274                 // Serialize UI update to the main UI thread
00275                 await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00276                 {
00277                     // Display the status change
00278                     PublisherStatusBlock.Text = backgroundMessage;
00279                 });
00280             }
00281         }
00282     }
00283 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/CachedFileUpdater_Local.xaml.cs Source File

  • FilePickerContracts
  • cs

CachedFileUpdater_Local.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using Windows.Storage;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.Storage.Provider;
00018
00019 namespace FilePickerContracts
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class CachedFileUpdater_Local : Page
00025     {
00026         public CachedFileUpdater_Local()
00027         {
00028             this.InitializeComponent();
00029             FileIsCurrentButton.Click += new RoutedEventHandler(FileIsCurrentButton_Click);
00030             ProvideUpdatedVersionButton.Click += new RoutedEventHandler(ProvideUpdatedVersionButton_Click);
00031         }
00032
00033         private async void OutputFileAsync(StorageFile file)
00034         {
00035             string fileContent = await FileIO.ReadTextAsync(file);
00036             OutputFileName.Text = String.Format(@"Received file: {0}", file.Name);
00037             OutputFileContent.Text = String.Format(@"File content:{0}{1}", System.Environment.NewLine, fileContent);
00038         }
00039
00040         private void UpdateUI(UIStatus uiStatus)
00041         {
00042             if (uiStatus == UIStatus.Complete)
00043             {
00044                 FileIsCurrentButton.IsEnabled = false;
00045                 ProvideUpdatedVersionButton.IsEnabled = false;
00046             }
00047         }
00048
00049         private void FileIsCurrentButton_Click(object sender, RoutedEventArgs e)
00050         {
00051             FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
00052             FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;
00053
00054             OutputFileAsync(fileUpdateRequest.File);
00055
00056             fileUpdateRequest.Status = FileUpdateStatus.Complete;
00057             fileUpdateRequestDeferral.Complete();
00058
00059             UpdateUI(CachedFileUpdaterPage.Current.cachedFileUpdaterUI.UIStatus);
00060         }
00061
00062         private async void ProvideUpdatedVersionButton_Click(object sender, RoutedEventArgs e)
00063         {
00064             FileUpdateRequest fileUpdateRequest = CachedFileUpdaterPage.Current.fileUpdateRequest;
00065             FileUpdateRequestDeferral fileUpdateRequestDeferral = CachedFileUpdaterPage.Current.fileUpdateRequestDeferral;
00066
00067             await FileIO.AppendTextAsync(fileUpdateRequest.File, String.Format(@"{0}New content added @ {1}", System.Environment.NewLine, DateTime.Now.ToString()));
00068             OutputFileAsync(fileUpdateRequest.File);
00069
00070             fileUpdateRequest.Status = FileUpdateStatus.Complete;
00071             fileUpdateRequestDeferral.Complete();
00072
00073             UpdateUI(CachedFileUpdaterPage.Current.cachedFileUpdaterUI.UIStatus);
00074         }
00075     }
00076 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/TabHeader.xaml.cs Source File

  • XamlPivot
  • cs

TabHeader.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.Foundation;
00007 using Windows.Foundation.Collections;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Controls.Primitives;
00011 using Windows.UI.Xaml.Data;
00012 using Windows.UI.Xaml.Input;
00013 using Windows.UI.Xaml.Media;
00014 using Windows.UI.Xaml.Navigation;
00015
00016 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00017
00018 namespace PivotCS
00019 {
00020     public sealed partial class TabHeader : UserControl
00021     {
00022         public static readonly DependencyProperty GlyphProperty = DependencyProperty.Register("Glyph", typeof(string), typeof(TabHeader), null);
00023
00024         public string Glyph
00025         {
00026             get { return GetValue(GlyphProperty) as string; }
00027             set { SetValue(GlyphProperty, value); }
00028         }
00029
00030         public static readonly DependencyProperty LabelProperty = DependencyProperty.Register("Label", typeof(string), typeof(TabHeader), null);
00031
00032         public string Label
00033         {
00034             get { return GetValue(LabelProperty) as string; }
00035             set { SetValue(LabelProperty, value); }
00036         }
00037
00038
00039         public TabHeader()
00040         {
00041             this.InitializeComponent();
00042             this.DataContext = this;
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cs/Scenario3_AspectRatio.xaml.cs Source File

  • CameraResolution
  • cs

Scenario3_AspectRatio.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Linq;
00014 using System.Threading.Tasks;
00015 using Windows.Media.Capture;
00016 using Windows.Media.MediaProperties;
00017 using Windows.Storage;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024
00025     /// <summary>
00026     /// Scenario 3 keep aspect ratios the same
00027     /// </summary>
00028     public sealed partial class Scenario3_AspectRatio : Page
00029     {
00030         // Private MainPage object for status updates
00031         private MainPage rootPage = MainPage.Current;
00032
00033         // Object to manage access to camera devices
00034         private MediaCapturePreviewer _previewer = null;
00035
00036         // Folder in which the captures will be stored (initialized in InitializeCameraButton_Click)
00037         private StorageFolder _captureFolder = null;
00038
00039         /// <summary>
00040         /// Initializes a new instance of the <see cref="Scenario1_PreviewSettings"/> class.
00041         /// </summary>
00042         public Scenario3_AspectRatio()
00043         {
00044             this.InitializeComponent();
00045             _previewer = new MediaCapturePreviewer(PreviewControl, Dispatcher);
00046         }
00047
00048         protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
00049         {
00050             await _previewer.CleanupCameraAsync();
00051         }
00052
00053         /// <summary>
00054         /// On some devices there may not be seperate streams for preview/photo/video. In this case, changing any of them
00055         /// will change all of them since they are the same stream
00056         /// </summary>
00057         private void CheckIfStreamsAreIdentical()
00058         {
00059             if (_previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.AllStreamsIdentical ||
00060                 _previewer.MediaCapture.MediaCaptureSettings.VideoDeviceCharacteristic == VideoDeviceCharacteristic.PreviewRecordStreamsIdentical)
00061             {
00062                 rootPage.NotifyUser("Warning: Preview and video streams for this device are identical, changing one will affect the other", NotifyType.ErrorMessage);
00063             }
00064         }
00065
00066         /// <summary>
00067         /// Initializes the camera and populates the UI
00068         /// </summary>
00069         /// <param name="sender"></param>
00070         /// <param name="e"></param>
00071         private async void InitializeCameraButton_Click(object sender, RoutedEventArgs e)
00072         {
00073             var button = sender as Button;
00074
00075             // Clear any previous message.
00076             rootPage.NotifyUser("", NotifyType.StatusMessage);
00077
00078             button.IsEnabled = false;
00079             await _previewer.InitializeCameraAsync();
00080             button.IsEnabled = true;
00081
00082             if (_previewer.IsPreviewing)
00083             {
00084                 if (string.IsNullOrEmpty(_previewer.MediaCapture.MediaCaptureSettings.AudioDeviceId))
00085                 {
00086                     rootPage.NotifyUser("No audio device available. Cannot capture.", NotifyType.ErrorMessage);
00087                 }
00088                 else
00089                 {
00090                     button.Visibility = Visibility.Collapsed;
00091                     PreviewControl.Visibility = Visibility.Visible;
00092                     CheckIfStreamsAreIdentical();
00093                     PopulateComboBoxes();
00094                     VideoButton.IsEnabled = true;
00095                 }
00096             }
00097
00098             var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
00099             // Fall back to the local app storage if the Pictures Library is not available
00100             _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
00101         }
00102
00103         /// <summary>
00104         ///  Event handler for Preview settings combo box. Updates stream resolution based on the selection.
00105         /// </summary>
00106         /// <param name="sender"></param>
00107         /// <param name="e"></param>
00108         private async void PreviewSettings_Changed(object sender, RoutedEventArgs e)
00109         {
00110             if (_previewer.IsPreviewing)
00111             {
00112                 var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
00113                 var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
00114                 await _previewer.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, encodingProperties);
00115
00116                 // The preview just changed, update the video combo box
00117                 MatchPreviewAspectRatio();
00118             }
00119         }
00120
00121         /// <summary>
00122         /// Event handler for Video settings combo box. Updates stream resolution based on the selection.
00123         /// </summary>
00124         /// <param name="sender"></param>
00125         /// <param name="e"></param>
00126         private async void VideoSettings_Changed(object sender, RoutedEventArgs e)
00127         {
00128             if (_previewer.IsPreviewing)
00129             {
00130                 if (VideoSettings.SelectedIndex > -1)
00131                 {
00132                     var selectedItem = (sender as ComboBox).SelectedItem as ComboBoxItem;
00133                     var encodingProperties = (selectedItem.Tag as StreamResolution).EncodingProperties;
00134                     await _previewer.MediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, encodingProperties);
00135                 }
00136             }
00137         }
00138
00139         /// <summary>
00140         /// Records an MP4 video to a StorageFile
00141         /// </summary>
00142         private async void VideoButton_Click(object sender, RoutedEventArgs e)
00143         {
00144             if (_previewer.IsPreviewing)
00145             {
00146                 if (!_previewer.IsRecording)
00147                 {
00148                     try
00149                     {
00150                         // Create storage file in Video Library
00151                         var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);
00152                         var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);
00153
00154                         await _previewer.MediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);
00155
00156                         // Reflect changes in the UI
00157                         VideoButton.Content = "Stop Video";
00158                         _previewer.IsRecording = true;
00159
00160                         rootPage.NotifyUser("Recording file, saving to: " + videoFile.Path, NotifyType.StatusMessage);
00161                     }
00162                     catch (Exception ex)
00163                     {
00164                         // File I/O errors are reported as exceptions.
00165                         rootPage.NotifyUser("Exception when starting video recording: " + ex.Message, NotifyType.ErrorMessage);
00166                     }
00167                 }
00168                 else
00169                 {
00170                     // Reflect the changes in UI and stop recording
00171                     VideoButton.Content = "Record Video";
00172                     _previewer.IsRecording = false;
00173
00174                     await _previewer.MediaCapture.StopRecordAsync();
00175
00176                     rootPage.NotifyUser("Stopped recording!", NotifyType.StatusMessage);
00177                 }
00178             }
00179         }
00180
00181         /// <summary>
00182         /// Populates the combo boxes with preview settings and matching ratio settings for the video stream
00183         /// </summary>
00184         private void PopulateComboBoxes()
00185         {
00186             // Query all properties of the device
00187             IEnumerable<StreamResolution> allPreviewProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoPreview).Select(x => new StreamResolution(x));
00188             // Order them by resolution then frame rate
00189             allPreviewProperties = allPreviewProperties.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);
00190
00191             // Populate the preview combo box with the entries
00192             foreach (var property in allPreviewProperties)
00193             {
00194                 ComboBoxItem comboBoxItem = new ComboBoxItem();
00195                 comboBoxItem.Content = property.GetFriendlyName() +
00196                     String.Format(" A. Ratio: {0}", property.AspectRatio.ToString("#.##"));
00197                 comboBoxItem.Tag = property;
00198                 PreviewSettings.Items.Add(comboBoxItem);
00199             }
00200
00201             // Keep the same aspect ratio with the video stream
00202             MatchPreviewAspectRatio();
00203         }
00204
00205         /// <summary>
00206         /// Finds all the available video resolutions that match the aspect ratio of the preview stream
00207         /// Note: This should also be done with photos as well. This same method can be modified for photos
00208         /// by changing the MediaStreamType from VideoPreview to Photo.
00209         /// </summary>
00210         private void MatchPreviewAspectRatio()
00211         {
00212             // Query all properties of the device
00213             IEnumerable<StreamResolution> allVideoProperties = _previewer.MediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoRecord).Select(x => new StreamResolution(x));
00214
00215             // Query the current preview settings
00216             StreamResolution previewProperties = new StreamResolution(_previewer.MediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview));
00217
00218             // Get all formats that have the same-ish aspect ratio as the preview
00219             // Allow for some tolerance in the aspect ratio comparison
00220             const double ASPECT_RATIO_TOLERANCE = 0.015;
00221             var matchingFormats = allVideoProperties.Where(x => Math.Abs(x.AspectRatio - previewProperties.AspectRatio) < ASPECT_RATIO_TOLERANCE);
00222
00223             // Order them by resolution then frame rate
00224             allVideoProperties = matchingFormats.OrderByDescending(x => x.Height * x.Width).ThenByDescending(x => x.FrameRate);
00225
00226             // Clear out old entries and populate the video combo box with new matching entries
00227             VideoSettings.Items.Clear();
00228             foreach (var property in allVideoProperties)
00229             {
00230                 ComboBoxItem comboBoxItem = new ComboBoxItem();
00231                 comboBoxItem.Content = property.GetFriendlyName();
00232                 comboBoxItem.Tag = property;
00233                 VideoSettings.Items.Add(comboBoxItem);
00234             }
00235             VideoSettings.SelectedIndex = -1;
00236         }
00237     }
00238 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomException Member List

This is the complete list of members for CustomException, including all inherited members.
CustomException() | CustomException | [inline]
OnNavigatedTo(NavigationEventArgs e) | CustomException | [inline, protected]
rootPage | CustomException | [private]
Start_Click(object sender, RoutedEventArgs e) | CustomException | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/pch.cpp Source File

  • FileAccess
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cs/SampleConfiguration.cs Source File

  • ContextMenu
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Context menu C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Show a context menu",            ClassType = typeof(Scenario1) },
00025             new Scenario() { Title = "Replace a default context menu", ClassType = typeof(Scenario2) },
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario2.xaml.h Source File

  • SimpleInk
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2 sealed
00024     {
00025     public:
00026         Scenario2();
00027
00028         property Windows::UI::Xaml::Controls::Symbol LassoSelect;
00029         property Windows::UI::Xaml::Controls::Symbol TouchWriting;
00030
00031     private:
00032         void StrokeInput_StrokeStarted(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00033         void InkPresenter_StrokesErased(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00034
00035         void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
00036         void Toggle_Custom(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037         void ToolButton_Lasso(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038
00039         void UnprocessedInput_PointerPressed(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^  args);
00040         void UnprocessedInput_PointerMoved(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^  args);
00041         void UnprocessedInput_PointerReleased(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00042
00043         void DrawBoundingRect();
00044         void ClearDrawnBoundingRect();
00045         void OnCopy(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046         void OnCut(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         void OnPaste(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void ClearSelection();
00049         void CurrentToolChanged(Windows::UI::Xaml::Controls::InkToolbar^ sender, Platform::Object^ args);
00050
00051         MainPage^ rootPage = MainPage::Current;
00052         Windows::UI::Xaml::Shapes::Polyline^ lasso;
00053         Windows::Foundation::Rect boundingRect;
00054         bool isBoundRect;
00055         Windows::Foundation::EventRegistrationToken pointerPressedToken;
00056         Windows::Foundation::EventRegistrationToken pointerMovedToken;
00057         Windows::Foundation::EventRegistrationToken pointerReleasedToken;
00058     };
00059
00060     [Windows::Foundation::Metadata::WebHostHidden]
00061     public ref class CalligraphicPen sealed : Windows::UI::Xaml::Controls::InkToolbarCustomPen
00062     {
00063     public:
00064
00065     protected:
00066         Windows::UI::Input::Inking::InkDrawingAttributes^ CreateInkDrawingAttributesCore(Windows::UI::Xaml::Media::Brush^ brush, double strokeWidth) override;
00067     };
00068 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/DeviceList.cpp Source File

  • CustomCapability
  • cpp

DeviceList.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "DeviceList.h"
00003 #include "Fx2Driver.h"
00004 #include "MainPage.xaml.h"
00005 #include "App.xaml.h"
00006
00007 using namespace SDKTemplate;
00008
00009 using namespace Platform;
00010 using namespace Platform::Collections;
00011 using namespace Windows::ApplicationModel;
00012 using namespace Windows::Devices::Enumeration;
00013 using namespace Windows::Devices::Custom;
00014 using namespace Windows::Foundation;
00015 using namespace Windows::UI::Core;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Documents;
00018
00019 DeviceList^ DeviceList::_Current = nullptr;
00020
00021 DeviceList^ DeviceList::Current::get()
00022 {
00023     if (DeviceList::_Current == nullptr)
00024     {
00025         DeviceList::_Current = ref new DeviceList();
00026     }
00027     return DeviceList::_Current;
00028 }
00029
00030 DeviceList::DeviceList() : m_WatcherStarted(false), m_WatcherSuspended(false)
00031 {
00032     m_Fx2Watcher = nullptr;
00033     m_List = ref new Vector<DeviceListEntry^>();
00034     InitDeviceWatcher();
00035
00036     // Register for app suspend/resume handlers
00037     App::Current->Suspending += ref new SuspendingEventHandler(this, &DeviceList::SuspendDeviceWatcher);
00038     App::Current->Resuming += ref new EventHandler<Object^>(this, &DeviceList::ResumeDeviceWatcher);
00039 }
00040
00041 void DeviceList::InitDeviceWatcher()
00042 {
00043     // Define the selector to enumerate all of the fx2 device interface class instances.
00044     // Use the DeviceInterfaceGuid provided by the driver (Fx2Driver, in this case).
00045     auto selector = CustomDevice::GetDeviceSelector(Fx2Driver::DeviceInterfaceGuid);
00046
00047     // Set of properties to retrieve
00048     auto properties = ref new Vector<String^>({ "System.Devices.DeviceInstanceId" });
00049
00050     // Create a device watcher to look for instances of the fx2 device interface.
00051     m_Fx2Watcher = DeviceInformation::CreateWatcher(selector, properties);
00052
00053     m_Fx2Watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(this, &DeviceList::OnFx2Added);
00054     m_Fx2Watcher->Removed += ref new TypedEventHandler<DeviceWatcher^, DeviceInformationUpdate^>(this, &DeviceList::OnFx2Removed);
00055     m_Fx2Watcher->EnumerationCompleted += ref new TypedEventHandler<DeviceWatcher^, Object^>(this, &DeviceList::OnFx2EnumerationComplete);
00056 }
00057
00058 void DeviceList::StartFx2Watcher()
00059 {
00060     MainPage::Current->NotifyUser("starting device watcher", NotifyType::StatusMessage);
00061
00062     std::for_each(
00063         begin(m_List),
00064         end(m_List),
00065         [](DeviceListEntry^ Entry) {
00066         Entry->Matched = false;
00067     });
00068
00069     WatcherStarted = true;
00070     m_Fx2Watcher->Start();
00071 }
00072
00073 void DeviceList::StopFx2Watcher()
00074 {
00075     MainPage::Current->NotifyUser("stopping fx2 watcher", NotifyType::StatusMessage);
00076     m_Fx2Watcher->Stop();
00077     WatcherStarted = false;
00078 }
00079
00080 void DeviceList::CreateBooleanTable(
00081     InlineCollection^ Table,
00082     const Platform::Array<bool>^ NewValues,
00083     const Platform::Array<bool>^ OldValues,
00084     String^ /* IndexTitle */,
00085     String^ /* ValueTitle */,
00086     String^ TrueValue,
00087     String^ FalseValue)
00088 {
00089     Table->Clear();
00090
00091     for (int i = 0; i < (int)NewValues->Length; i += 1)
00092     {
00093         auto line = ref new Span();
00094         auto block = ref new Run();
00095         block->Text = (i + 1).ToString();
00096         line->Inlines->Append(block);
00097
00098         block = ref new Run();
00099         block->Text = "    ";
00100         line->Inlines->Append(block);
00101
00102         block = ref new Run();
00103         block->Text = NewValues[i] ? TrueValue : FalseValue;
00104
00105         if ((OldValues != nullptr) && (OldValues[i] != NewValues[i]))
00106         {
00107             auto bold = ref new Bold();
00108             bold->Inlines->Append(block);
00109             line->Inlines->Append(bold);
00110         }
00111         else
00112         {
00113             line->Inlines->Append(block);
00114         }
00115
00116         line->Inlines->Append(ref new LineBreak());
00117
00118         Table->Append(line);
00119     }
00120 }
00121
00122 DeviceListEntry^ DeviceList::FindDevice(String^ Id)
00123 {
00124     auto i = std::find_if(
00125         begin(m_List),
00126         end(m_List),
00127         [Id](DeviceListEntry^ e) {return e->Id == Id; });
00128
00129     if (i == end(m_List))
00130     {
00131         return nullptr;
00132     }
00133     else
00134     {
00135         return *i;
00136     }
00137 }
00138
00139 void DeviceList::OnFx2Added(DeviceWatcher ^ /* Sender */, DeviceInformation^ DevInterface)
00140 {
00141     MainPage::Current->Dispatcher->RunAsync(
00142         CoreDispatcherPriority::Normal,
00143         ref new DispatchedHandler(
00144             [this, DevInterface]()->void
00145     {
00146         MainPage::Current->NotifyUser("OnFx2Added: " + DevInterface->Id, NotifyType::StatusMessage);
00147
00148         // search the device list for a device with a matching interface ID
00149         auto match = FindDevice(DevInterface->Id);
00150
00151         // If we found a match then mark it as verified and return
00152         if (match != nullptr)
00153         {
00154             match->Matched = true;
00155             return;
00156         }
00157
00158         // Create a new elemetn for this device interface, and queue up the query of its
00159         // device information
00160         match = ref new DeviceListEntry(DevInterface);
00161
00162         // Add the new element to the end of the list of devices
00163         m_List->Append(match);
00164     }));
00165 }
00166
00167 void DeviceList::OnFx2Removed(DeviceWatcher ^ /* Sender */, DeviceInformationUpdate^ DevInterface)
00168 {
00169     auto deviceId = DevInterface->Id;
00170
00171     MainPage::Current->Dispatcher->RunAsync(
00172         CoreDispatcherPriority::Normal,
00173         ref new DispatchedHandler(
00174             [this, deviceId]()
00175     {
00176         MainPage::Current->NotifyUser("OnFx2Removed: " + deviceId, NotifyType::StatusMessage);
00177
00178         // Search the list of devices for one with a matching ID.  Move the matched
00179         // item to the end of the list.
00180         auto i = std::remove_if(
00181             begin(m_List),
00182             end(m_List),
00183             [deviceId](DeviceListEntry^ e) {return e->Id == deviceId; });
00184
00185         // if there's no match return.
00186         if (i == end(m_List))
00187         {
00188             return;
00189         }
00190
00191         // Remove the last item from the list.
00192         MainPage::Current->NotifyUser("OnFx2Removed: " + deviceId + " removed", NotifyType::StatusMessage);
00193         m_List->RemoveAtEnd();
00194     }));
00195 }
00196
00197 void DeviceList::OnFx2EnumerationComplete(DeviceWatcher ^ /* Sender */, Object ^ /* o */)
00198 {
00199     MainPage::Current->Dispatcher->RunAsync(
00200         CoreDispatcherPriority::Normal,
00201         ref new DispatchedHandler(
00202             [this]()
00203     {
00204         MainPage::Current->NotifyUser("OnFx2EnumerationComplete", NotifyType::StatusMessage);
00205
00206         DeviceList^ me = this;
00207
00208         // Move all the unmatched elements to the end of the list
00209         auto i = std::remove_if(
00210             begin(m_List),
00211             end(m_List),
00212             [](DeviceListEntry^ e) { return e->Matched == false; });
00213
00214         // Determine the number of unmatched entries
00215         auto unmatchedCount = end(m_List) - i;
00216
00217         while (unmatchedCount > 0)
00218         {
00219             m_List->RemoveAtEnd();
00220             unmatchedCount -= 1;
00221         }
00222     }));
00223 }
00224
00225 void DeviceList::SuspendDeviceWatcher(Object^, SuspendingEventArgs^)
00226 {
00227     if (WatcherStarted)
00228     {
00229         m_WatcherSuspended = true;
00230         StopFx2Watcher();
00231     }
00232     else
00233     {
00234         m_WatcherSuspended = false;
00235     }
00236 }
00237
00238 void DeviceList::ResumeDeviceWatcher(Object^, Object^)
00239 {
00240     if (m_WatcherSuspended)
00241     {
00242         m_WatcherSuspended = false;
00243         StartFx2Watcher();
00244     }
00245 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VisualPropertiesFactory Member List

This is the complete list of members for VisualPropertiesFactory, including all inherited members.
CreateView() VisualPropertiesFactory [inline, virtual]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario2_Stats.cpp Source File

  • Calendar
  • cppwinrt

Scenario2_Stats.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Stats.h"
00014 #include "Scenario2_Stats.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace
00022 {
00023     void ReportCalendarData(std::wostream& results, Calendar const& calendar, PCWSTR calendarLabel)
00024     {
00025         results << calendarLabel << L": " << std::wstring_view(calendar.GetCalendarSystem()) << L"\n" <<
00026             L"Months in this Year: " << calendar.NumberOfMonthsInThisYear() << L"\n" <<
00027             L"Days in this Month: " << calendar.NumberOfDaysInThisMonth() << L"\n" <<
00028             L"Hours in this Period: " << calendar.NumberOfHoursInThisPeriod() << L"\n" <<
00029             L"Era: " << std::wstring_view(calendar.EraAsString()) << L"\n\n";
00030     }
00031 }
00032
00033 namespace winrt::SDKTemplate::implementation
00034 {
00035     Scenario2_Stats::Scenario2_Stats()
00036     {
00037         InitializeComponent();
00038     }
00039
00040     void Scenario2_Stats::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00041     {
00042         // This scenario uses the Windows.Globalization.Calendar class to display the parts of a date.
00043
00044         // Create Calendar objects using different constructors.
00045         Calendar calendar;
00046         Calendar japaneseCalendar({ L"ja-JP" }, CalendarIdentifiers::Japanese(), ClockIdentifiers::TwelveHour());
00047         Calendar hebrewCalendar({ L"he-IL" }, CalendarIdentifiers::Hebrew(), ClockIdentifiers::TwentyFourHour());
00048
00049         // Generate the results
00050         std::wostringstream results;
00051         ReportCalendarData(results, calendar, L"User's default calendar system");
00052         ReportCalendarData(results, japaneseCalendar, L"Calendar system");
00053         ReportCalendarData(results, hebrewCalendar, L"Calendar system");
00054         OutputTextBlock().Text(results.str());
00055     }
00056 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs Source File

  • DeviceEnumerationAndPairing
  • cs

Scenario9_CustomPairDevice.xaml.cs

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.ObjectModel;
00005 using System.Threading.Tasks;
00006 using Windows.Devices.Enumeration;
00007 using Windows.Foundation;
00008 using Windows.Security.Credentials;
00009 using Windows.UI.Core;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Navigation;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class Scenario9_CustomPairDevice : Page
00022     {
00023         private MainPage rootPage = MainPage.Current;
00024
00025         private DeviceWatcherHelper deviceWatcherHelper;
00026
00027         TaskCompletionSource<string> providePinTaskSrc;
00028         TaskCompletionSource<bool> confirmPinTaskSrc;
00029         TaskCompletionSource<PasswordCredential> providePasswordCredential;
00030
00031         private ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>();
00032
00033         public Scenario9_CustomPairDevice()
00034         {
00035             this.InitializeComponent();
00036
00037             deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
00038             deviceWatcherHelper.DeviceChanged += OnDeviceListChanged;
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             resultsListView.ItemsSource = resultCollection;
00044
00045             selectorComboBox.ItemsSource = DeviceSelectorChoices.PairingSelectors;
00046             selectorComboBox.SelectedIndex = 0;
00047
00048             protectionLevelComboBox.ItemsSource = ProtectionSelectorChoices.Selectors;
00049             protectionLevelComboBox.SelectedIndex = 0;
00050         }
00051
00052         protected override void OnNavigatedFrom(NavigationEventArgs e)
00053         {
00054             deviceWatcherHelper.Reset();
00055             CompleteProvidePinTask(); // Abandon any previous pin request.
00056             CompletePasswordCredential(); // Abandon any previous pin request.
00057             CompleteConfirmPinTask(false); // Abandon any previous request.
00058         }
00059
00060         private void StartWatcherButton_Click(object sender, RoutedEventArgs e)
00061         {
00062             StartWatcher();
00063         }
00064
00065         private void StopWatcherButton_Click(object sender, RoutedEventArgs e)
00066         {
00067             StopWatcher();
00068         }
00069
00070         private void StartWatcher()
00071         {
00072             startWatcherButton.IsEnabled = false;
00073             resultCollection.Clear();
00074             DeviceWatcher deviceWatcher;
00075
00076             // Get the device selector chosen by the UI then add additional constraints for devices that
00077             // can be paired or are already paired.
00078             DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;
00079             string selector = "(" + deviceSelectorInfo.Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";
00080
00081             if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
00082             {
00083                 // Kind will be determined by the selector
00084                 deviceWatcher = DeviceInformation.CreateWatcher(
00085                     selector,
00086                     null // don't request additional properties for this sample
00087                     );
00088             }
00089             else
00090             {
00091                 // Kind is specified in the selector info
00092                 deviceWatcher = DeviceInformation.CreateWatcher(
00093                     selector,
00094                     null, // don't request additional properties for this sample
00095                     deviceSelectorInfo.Kind);
00096             }
00097
00098             rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
00099             deviceWatcherHelper.StartWatcher(deviceWatcher);
00100             stopWatcherButton.IsEnabled = true;
00101         }
00102
00103         private void StopWatcher()
00104         {
00105             stopWatcherButton.IsEnabled = false;
00106             deviceWatcherHelper.StopWatcher();
00107             startWatcherButton.IsEnabled = true;
00108         }
00109
00110         private void OnDeviceListChanged(DeviceWatcher sender, string id)
00111         {
00112             // If the item being updated is currently "selected", then update the pairing buttons
00113             DeviceInformationDisplay selectedDeviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
00114             if ((selectedDeviceInfoDisp != null) && (selectedDeviceInfoDisp.Id == id))
00115             {
00116                 UpdatePairingButtons();
00117             }
00118         }
00119
00120         private async void PairButton_Click(object sender, RoutedEventArgs e)
00121         {
00122             // Gray out the pair button and results view while pairing is in progress.
00123             resultsListView.IsEnabled = false;
00124             pairButton.IsEnabled = false;
00125             rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);
00126
00127             // Get the device selected for pairing
00128             DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;
00129
00130             // Get ceremony type and protection level selections
00131             DevicePairingKinds ceremoniesSelected = GetSelectedCeremonies();
00132             ProtectionLevelSelectorInfo protectionLevelInfo = (ProtectionLevelSelectorInfo)protectionLevelComboBox.SelectedItem;
00133             DevicePairingProtectionLevel protectionLevel = protectionLevelInfo.ProtectionLevel;
00134
00135             DeviceInformationCustomPairing customPairing = deviceInfoDisp.DeviceInformation.Pairing.Custom;
00136
00137             customPairing.PairingRequested += PairingRequestedHandler;
00138             DevicePairingResult result = await customPairing.PairAsync(ceremoniesSelected, protectionLevel);
00139             customPairing.PairingRequested -= PairingRequestedHandler;
00140
00141             rootPage.NotifyUser(
00142                 "Pairing result = " + result.Status.ToString(),
00143                 result.Status == DevicePairingResultStatus.Paired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);
00144
00145             HidePairingPanel();
00146             UpdatePairingButtons();
00147             resultsListView.IsEnabled = true;
00148         }
00149
00150         private async void UnpairButton_Click(object sender, RoutedEventArgs e)
00151         {
00152             // Gray out the unpair button and results view while unpairing is in progress.
00153             resultsListView.IsEnabled = false;
00154             unpairButton.IsEnabled = false;
00155             rootPage.NotifyUser("Unpairing started. Please wait...", NotifyType.StatusMessage);
00156
00157             DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;
00158
00159             DeviceUnpairingResult dupr = await deviceInfoDisp.DeviceInformation.Pairing.UnpairAsync();
00160
00161             rootPage.NotifyUser(
00162                 "Unpairing result = " + dupr.Status.ToString(),
00163                 dupr.Status == DeviceUnpairingResultStatus.Unpaired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);
00164
00165             UpdatePairingButtons();
00166             resultsListView.IsEnabled = true;
00167         }
00168
00169         private async void PairingRequestedHandler(
00170             DeviceInformationCustomPairing sender,
00171             DevicePairingRequestedEventArgs args)
00172         {
00173             switch (args.PairingKind)
00174             {
00175                 case DevicePairingKinds.ConfirmOnly:
00176                     // Windows itself will pop the confirmation dialog as part of "consent" if this is running on Desktop or Mobile
00177                     // If this is an App for 'Windows IoT Core' where there is no Windows Consent UX, you may want to provide your own confirmation.
00178                     args.Accept();
00179                     break;
00180
00181                 case DevicePairingKinds.DisplayPin:
00182                     // We just show the PIN on this side. The ceremony is actually completed when the user enters the PIN
00183                     // on the target device. We automatically accept here since we can't really "cancel" the operation
00184                     // from this side.
00185                     args.Accept();
00186
00187                     // No need for a deferral since we don't need any decision from the user
00188                     await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00189                     {
00190                         ShowPairingPanel(
00191                             "Please enter this PIN on the device you are pairing with: " + args.Pin,
00192                             args.PairingKind);
00193
00194                     });
00195                     break;
00196
00197                 case DevicePairingKinds.ProvidePin:
00198                     // A PIN may be shown on the target device and the user needs to enter the matching PIN on
00199                     // this Windows device. Get a deferral so we can perform the async request to the user.
00200                     var collectPinDeferral = args.GetDeferral();
00201
00202                     await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00203                     {
00204                         string pin = await GetPinFromUserAsync();
00205                         if (!string.IsNullOrEmpty(pin))
00206                         {
00207                             args.Accept(pin);
00208                         }
00209
00210                         collectPinDeferral.Complete();
00211                     });
00212                     break;
00213
00214                 case DevicePairingKinds.ProvidePasswordCredential:
00215                     var collectCredentialDeferral = args.GetDeferral();
00216                     await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00217                     {
00218                         var credential = await GetPasswordCredentialFromUserAsync();
00219                         if (credential != null)
00220                         {
00221                             args.AcceptWithPasswordCredential(credential);
00222                         }
00223                         collectCredentialDeferral.Complete();
00224                     });
00225                     break;
00226
00227                 case DevicePairingKinds.ConfirmPinMatch:
00228                     // We show the PIN here and the user responds with whether the PIN matches what they see
00229                     // on the target device. Response comes back and we set it on the PinComparePairingRequestedData
00230                     // then complete the deferral.
00231                     var displayMessageDeferral = args.GetDeferral();
00232
00233                     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00234                     {
00235                         bool accept = await GetUserConfirmationAsync(args.Pin);
00236                         if (accept)
00237                         {
00238                             args.Accept();
00239                         }
00240
00241                         displayMessageDeferral.Complete();
00242                     });
00243                     break;
00244             }
00245         }
00246
00247         private void ShowPairingPanel(string text, DevicePairingKinds pairingKind)
00248         {
00249             pairingPanel.Visibility = Visibility.Collapsed;
00250             pinEntryTextBox.Visibility = Visibility.Collapsed;
00251             okButton.Visibility = Visibility.Collapsed;
00252             usernameEntryTextBox.Visibility = Visibility.Collapsed;
00253             passwordEntryTextBox.Visibility = Visibility.Collapsed;
00254             verifyButton.Visibility = Visibility.Collapsed;
00255             yesButton.Visibility = Visibility.Collapsed;
00256             noButton.Visibility = Visibility.Collapsed;
00257             pairingTextBlock.Text = text;
00258
00259             switch (pairingKind)
00260             {
00261                 case DevicePairingKinds.ConfirmOnly:
00262                 case DevicePairingKinds.DisplayPin:
00263                     // Don't need any buttons
00264                     break;
00265                 case DevicePairingKinds.ProvidePin:
00266                     pinEntryTextBox.Text = "";
00267                     pinEntryTextBox.Visibility = Visibility.Visible;
00268                     okButton.Visibility = Visibility.Visible;
00269                     break;
00270                 case DevicePairingKinds.ConfirmPinMatch:
00271                     yesButton.Visibility = Visibility.Visible;
00272                     noButton.Visibility = Visibility.Visible;
00273                     break;
00274                 case DevicePairingKinds.ProvidePasswordCredential:
00275                     usernameEntryTextBox.Text = "";
00276                     passwordEntryTextBox.Text = "";
00277                     passwordEntryTextBox.Visibility = Visibility.Visible;
00278                     usernameEntryTextBox.Visibility = Visibility.Visible;
00279                     verifyButton.Visibility = Visibility.Visible;
00280                     break;
00281             }
00282
00283             pairingPanel.Visibility = Visibility.Visible;
00284         }
00285
00286         private void HidePairingPanel()
00287         {
00288             pairingPanel.Visibility = Visibility.Collapsed;
00289             pairingTextBlock.Text = "";
00290         }
00291
00292         private async Task<string> GetPinFromUserAsync()
00293         {
00294             HidePairingPanel();
00295             CompleteProvidePinTask(); // Abandon any previous pin request.
00296
00297             ShowPairingPanel(
00298                 "Please enter the PIN shown on the device you're pairing with",
00299                 DevicePairingKinds.ProvidePin);
00300
00301             providePinTaskSrc = new TaskCompletionSource<string>();
00302
00303             return await providePinTaskSrc.Task;
00304         }
00305
00306         // If pin is not provided, then any pending pairing request is abandoned.
00307         private void CompleteProvidePinTask(string pin = null)
00308         {
00309             if (providePinTaskSrc != null)
00310             {
00311                 providePinTaskSrc.SetResult(pin);
00312                 providePinTaskSrc = null;
00313             }
00314         }
00315
00316         private async Task<PasswordCredential> GetPasswordCredentialFromUserAsync()
00317         {
00318             HidePairingPanel();
00319             CompletePasswordCredential(); // Abandon any previous pin request.
00320
00321             ShowPairingPanel(
00322                 "Please enter the username and password",
00323                 DevicePairingKinds.ProvidePasswordCredential);
00324
00325             providePasswordCredential = new TaskCompletionSource<PasswordCredential>();
00326
00327             return await providePasswordCredential.Task;
00328         }
00329
00330         private void CompletePasswordCredential(string username = null, string password = null)
00331         {
00332             if (providePasswordCredential != null)
00333             {
00334                 if (String.IsNullOrEmpty(username))
00335                 {
00336                     providePasswordCredential.SetResult(null);
00337                 }
00338                 else
00339                 {
00340                     providePasswordCredential.SetResult(new PasswordCredential() { UserName = username, Password = password });
00341                 }
00342                 providePasswordCredential = null;
00343             }
00344         }
00345
00346         private async Task<bool> GetUserConfirmationAsync(string pin)
00347         {
00348             HidePairingPanel();
00349             CompleteConfirmPinTask(false); // Abandon any previous request.
00350
00351             ShowPairingPanel(
00352                 "Does the following PIN match the one shown on the device you are pairing?: " + pin,
00353                 DevicePairingKinds.ConfirmPinMatch);
00354
00355             confirmPinTaskSrc = new TaskCompletionSource<bool>();
00356
00357             return await confirmPinTaskSrc.Task;
00358         }
00359
00360         // If pin is not provided, then any pending pairing request is abandoned.
00361         private void CompleteConfirmPinTask(bool accept)
00362         {
00363             if (confirmPinTaskSrc != null)
00364             {
00365                 confirmPinTaskSrc.SetResult(accept);
00366                 confirmPinTaskSrc = null;
00367             }
00368         }
00369
00370         private void okButton_Click(object sender, RoutedEventArgs e)
00371         {
00372             // OK button is only used for the ProvidePin scenario
00373             CompleteProvidePinTask(pinEntryTextBox.Text);
00374             HidePairingPanel();
00375         }
00376
00377         private void verifyButton_Click(object sender, RoutedEventArgs e)
00378         {
00379             // verify button is only used for the ProvidePin scenario
00380             CompletePasswordCredential(usernameEntryTextBox.Text, passwordEntryTextBox.Text);
00381             HidePairingPanel();
00382         }
00383
00384         private void yesButton_Click(object sender, RoutedEventArgs e)
00385         {
00386             CompleteConfirmPinTask(true);
00387             HidePairingPanel();
00388         }
00389
00390         private void noButton_Click(object sender, RoutedEventArgs e)
00391         {
00392             CompleteConfirmPinTask(false);
00393             HidePairingPanel();
00394         }
00395
00396         private DevicePairingKinds GetSelectedCeremonies()
00397         {
00398             DevicePairingKinds ceremonySelection = DevicePairingKinds.None;
00399             if (confirmOnlyOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ConfirmOnly;
00400             if (displayPinOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.DisplayPin;
00401             if (providePinOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ProvidePin;
00402             if (confirmPinMatchOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ConfirmPinMatch;
00403             if (passwordCredentialOption.IsChecked.Value) ceremonySelection |= DevicePairingKinds.ProvidePasswordCredential;
00404             return ceremonySelection;
00405         }
00406
00407         private void ResultsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
00408         {
00409             UpdatePairingButtons();
00410         }
00411
00412         private void UpdatePairingButtons()
00413         {
00414             DeviceInformationDisplay deviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
00415
00416             if (null != deviceInfoDisp &&
00417                 deviceInfoDisp.DeviceInformation.Pairing.CanPair &&
00418                 !deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
00419             {
00420                 pairButton.IsEnabled = true;
00421             }
00422             else
00423             {
00424                 pairButton.IsEnabled = false;
00425             }
00426
00427             if (null != deviceInfoDisp &&
00428                 deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
00429             {
00430                 unpairButton.IsEnabled = true;
00431             }
00432             else
00433             {
00434                 unpairButton.IsEnabled = false;
00435             }
00436         }
00437     }
00438 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SecureInterfaceService Member List

This is the complete list of members for SecureInterfaceService, including all inherited members.
ConcatenateAsync(AllJoynMessageInfo info, string inStr1, string inStr2) | SecureInterfaceService | [inline]
com::microsoft::Samples::SecureInterface::ISecureInterfaceService::ConcatenateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2) | ISecureInterfaceService |
GetIsUpperCaseEnabledAsync(AllJoynMessageInfo info) | SecureInterfaceService | [inline]
com::microsoft::Samples::SecureInterface::ISecureInterfaceService::GetIsUpperCaseEnabledAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | ISecureInterfaceService |
SetIsUpperCaseEnabledAsync(AllJoynMessageInfo info, bool value) | SecureInterfaceService | [inline]
com::microsoft::Samples::SecureInterface::ISecureInterfaceService::SetIsUpperCaseEnabledAsync(Windows::Devices::AllJoyn::AllJoynMessageInfo^info, bool value) | ISecureInterfaceService |
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Choosing Member List

This is the complete list of members for Scenario3_Choosing, including all inherited members.
OnHumanPresenceSensorAdded(DeviceWatcher sender, DeviceInformation deviceInfo) | Scenario3_Choosing | [inline, private]
OnHumanPresenceSensorEnumerationCompleted(DeviceWatcher sender, object e) | Scenario3_Choosing | [inline, private]
OnHumanPresenceSensorRemoved(DeviceWatcher sender, DeviceInformationUpdate update) | Scenario3_Choosing | [inline, private]
OnHumanPresenceSensorUpdated(DeviceWatcher sender, DeviceInformationUpdate update) | Scenario3_Choosing | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_Choosing | [inline, protected]
ReadOneReadingFromSensorAsync(DeviceInformation deviceInfo) | Scenario3_Choosing | [inline, private]
rootPage | Scenario3_Choosing | [private]
Scenario3_Choosing() | Scenario3_Choosing | [inline]
ScenarioPick_Click(object sender, RoutedEventArgs e) | Scenario3_Choosing | [inline, private]
ScenarioReadSelected_Click(object sender, RoutedEventArgs e) | Scenario3_Choosing | [inline, private]
ScenarioStart_Click(object sender, RoutedEventArgs e) | Scenario3_Choosing | [inline, private]
ScenarioStop_Click(object sender, RoutedEventArgs e) | Scenario3_Choosing | [inline, private]
watcher | Scenario3_Choosing | [private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs Source File

  • SpeechRecognitionAndSynthesis
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using SDKTemplate;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Speech Recognition\nand TTS";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Synthesize Text", ClassType=typeof(Scenario_SynthesizeText)},
00026             new Scenario() { Title="Synthesize Text with Boundaries", ClassType=typeof(Scenario_SynthesizeTextBoundaries)},
00027             new Scenario() { Title="Synthesize SSML", ClassType=typeof(Scenario_SynthesizeSSML)},
00028             new Scenario() { Title="Predefined Dictation Grammar", ClassType=typeof(Scenario_PredefinedDictationGrammar)},
00029             new Scenario() { Title="Predefined WebSearch Grammar", ClassType=typeof(Scenario_PredefinedWebSearchGrammar)},
00030             new Scenario() { Title="Custom List Constraint", ClassType=typeof(Scenario_ListConstraint)},
00031             new Scenario() { Title="Custom SRGS Constraint", ClassType=typeof(Scenario_SRGSConstraint)},
00032             new Scenario() { Title="Continuous Dictation", ClassType=typeof(Scenario_ContinuousDictation)},
00033             new Scenario() { Title="Continuous List Commands", ClassType=typeof(Scenario_ContinuousRecognitionListGrammar)},
00034             new Scenario() { Title="Continuous SRGS Commands", ClassType=typeof(Scenario_ContinuousRecognitionSRGSGrammar)},
00035             new Scenario() { Title="PauseAsync to Change Grammar", ClassType=typeof(Scenario_PauseAsync)}
00036         };
00037     }
00038
00039     public class Scenario
00040     {
00041         public string Title { get; set; }
00042         public Type ClassType { get; set; }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S3_RemoveFolder.xaml.h Source File

  • LibraryManagement
  • cpp

S3_RemoveFolder.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.h
00014 // Declaration of the Scenario3 class
00015 //
00016
00017 #pragma once
00018 #include "S3_RemoveFolder.g.h"
00019
00020 namespace SDKTemplate
00021 {
00022     public ref class Scenario3 sealed
00023     {
00024     public:
00025         Scenario3();
00026
00027     private:
00028         void RemoveFolderButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029
00030         void GetPicturesLibrary();
00031         void FillComboBox();
00032         void UpdateControls();
00033
00034         // The dispatcher for this page.  Because it is obtained from Window.Current, which is thread affine,
00035         // the dispatcher must be obtained from the UI thread this page will run.  It can then be referenced
00036         // from a background thread to run code that will update the UI.
00037         Windows::UI::Core::CoreDispatcher^ dispatcher;
00038         Windows::Storage::StorageLibrary^ picturesLibrary;
00039     };
00040 }
Generated on Fri Nov 15 2024 22:20:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_BackgroundPublisher Member List

This is the complete list of members for Scenario4_BackgroundPublisher, including all inherited members.
App_Resuming(object sender, object e) | Scenario4_BackgroundPublisher | [inline, private]
App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) | Scenario4_BackgroundPublisher | [inline, private]
OnBackgroundTaskCompleted(BackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs eventArgs) | Scenario4_BackgroundPublisher | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario4_BackgroundPublisher | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario4_BackgroundPublisher | [inline, protected]
rootPage | Scenario4_BackgroundPublisher | [private]
RunButton_Click(object sender, RoutedEventArgs e) | Scenario4_BackgroundPublisher | [inline, private]
Scenario4_BackgroundPublisher() | Scenario4_BackgroundPublisher | [inline]
StopButton_Click(object sender, RoutedEventArgs e) | Scenario4_BackgroundPublisher | [inline, private]
taskEntryPoint | Scenario4_BackgroundPublisher | [private]
taskName | Scenario4_BackgroundPublisher | [private]
taskRegistration | Scenario4_BackgroundPublisher | [private]
trigger | Scenario4_BackgroundPublisher | [private]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/DirectXHelper.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Common

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include <ppltasks.h>    // For create_task
00004
00005 namespace DX
00006 {
00007     inline void ThrowIfFailed(HRESULT hr)
00008     {
00009         if (FAILED(hr))
00010         {
00011             // Set a breakpoint on this line to catch Win32 API errors.
00012             throw Platform::Exception::CreateException(hr);
00013         }
00014     }
00015
00016     // Function that reads from a binary file asynchronously.
00017     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00018     {
00019         using namespace Windows::Storage;
00020         using namespace Concurrency;
00021
00022         return create_task(PathIO::ReadBufferAsync(Platform::StringReference(filename.c_str()))).then(
00023             [] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00024             {
00025                 std::vector<byte> returnBuffer;
00026                 returnBuffer.resize(fileBuffer->Length);
00027                 Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), returnBuffer.size()));
00028                 return returnBuffer;
00029             });
00030     }
00031
00032     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00033     inline float ConvertDipsToPixels(float dips, float dpi)
00034     {
00035         static const float dipsPerInch = 96.0f;
00036         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00037     }
00038
00039     HRESULT CreateWICTextureFromMemoryEx(ID3D11Device* d3dDevice,
00040                                          const uint8_t* wicData,
00041                                          size_t wicDataSize,
00042                                          size_t maxsize,
00043                                          D3D11_USAGE usage,
00044                                          unsigned int bindFlags,
00045                                          unsigned int cpuAccessFlags,
00046                                          unsigned int miscFlags,
00047                                          bool forceSRGB,
00048                                          ID3D11Resource** texture,
00049                                          ID3D11ShaderResourceView** textureView);
00050
00051     HRESULT CreateWICTextureFromMemory(ID3D11Device* d3dDevice,
00052                                        const uint8_t* wicData,
00053                                        size_t wicDataSize,
00054                                        ID3D11Resource** texture,
00055                                        ID3D11ShaderResourceView** textureView,
00056                                        size_t maxsize = 0);
00057
00058 #if defined(_DEBUG)
00059     // Check for SDK Layer support.
00060     inline bool SdkLayersAvailable()
00061     {
00062         HRESULT hr = D3D11CreateDevice(
00063             nullptr,
00064             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00065             0,
00066             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00067             nullptr,                    // Any feature level will do.
00068             0,
00069             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00070             nullptr,                    // No need to keep the D3D device reference.
00071             nullptr,                    // No need to know the feature level.
00072             nullptr                     // No need to keep the D3D device context reference.
00073             );
00074
00075         return SUCCEEDED(hr);
00076     }
00077 #endif
00078 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/MainPage.xaml.h Source File

  • CameraVideoStabilization
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MainPage.g.h"
00015
00016 namespace CameraVideoStabilization
00017 {
00018     public ref class MainPage sealed
00019     {
00020     private:
00021         // Receive notifications about rotation of the device and UI and apply any necessary rotation to the preview stream and UI controls
00022         Windows::Devices::Sensors::SimpleOrientationSensor^ _orientationSensor;
00023         Windows::Graphics::Display::DisplayInformation^ _displayInformation;
00024         Windows::Devices::Sensors::SimpleOrientation _deviceOrientation;
00025         Windows::Graphics::Display::DisplayOrientations _displayOrientation;
00026
00027         // Prevent the screen from sleeping while the camera is running
00028         Windows::System::Display::DisplayRequest^ _displayRequest;
00029
00030         // For listening to media property changes
00031         Windows::Media::SystemMediaTransportControls^ _systemMediaControls;
00032
00033         // MediaCapture and its state variables
00034         Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture;
00035         bool _isInitialized;
00036         bool _isPreviewing;
00037         bool _isRecording;
00038         Windows::Media::MediaProperties::MediaEncodingProfile^ _encodingProfile;
00039
00040         // Information about the camera device
00041         bool _externalCamera;
00042         bool _mirroringPreview;
00043
00044         // Rotation metadata to apply to the preview stream and recorded videos (MF_MT_VIDEO_ROTATION)
00045         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00046         const GUID RotationKey;
00047
00048         // Folder in which the captures will be stored (availability check performed in SetupUiAsync)
00049         Windows::Storage::StorageFolder^ _captureFolder;
00050
00051         Windows::Media::Core::VideoStabilizationEffect^ _videoStabilizationEffect;
00052         Windows::Media::MediaProperties::VideoEncodingProperties^ _inputPropertiesBackup;
00053         Windows::Media::MediaProperties::VideoEncodingProperties^ _outputPropertiesBackup;
00054
00055         // Event tokens
00056         Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken;
00057         Windows::Foundation::EventRegistrationToken _applicationResumingEventToken;
00058         Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken;
00059         Windows::Foundation::EventRegistrationToken _displayInformationEventToken;
00060         Windows::Foundation::EventRegistrationToken _recordLimitationExceededEventToken;
00061         Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken;
00062         Windows::Foundation::EventRegistrationToken _orientationChangedEventToken;
00063         Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken;
00064         Windows::Foundation::EventRegistrationToken _videoStabilizationEnabledToken;
00065
00066         // MediaCapture methods
00067         Concurrency::task<void> InitializeCameraAsync();
00068         Concurrency::task<void> CleanupCameraAsync();
00069         Concurrency::task<void> StartPreviewAsync();
00070         Concurrency::task<void> SetPreviewRotationAsync();
00071         Concurrency::task<void> StopPreviewAsync();
00072         Concurrency::task<void> CreateVideoStabilizationEffectAsync();
00073         Concurrency::task<void> SetUpVideoStabilizationRecommendationAsync();
00074         Concurrency::task<void> CleanUpVideoStabilizationEffectAsync();
00075         Concurrency::task<void> StartRecordingAsync();
00076         Concurrency::task<void> StopRecordingAsync();
00077
00078         // Helpers
00079         Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel);
00080         void UpdateCaptureControls();
00081         Concurrency::task<void> SetupUiAsync();
00082         Concurrency::task<void> CleanupUiAsync();
00083         void RegisterEventHandlers();
00084         void UnregisterEventHandlers();
00085         void WriteLine(Platform::String^ str);
00086         void WriteException(Platform::Exception^ ex);
00087         Concurrency::task<void> EmptyTask();
00088
00089         // Rotation helpers
00090         Windows::Devices::Sensors::SimpleOrientation GetCameraOrientation();
00091         Windows::Storage::FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation(Windows::Devices::Sensors::SimpleOrientation orientation);
00092         int ConvertDeviceOrientationToDegrees(Windows::Devices::Sensors::SimpleOrientation orientation);
00093         int ConvertDisplayOrientationToDegrees(Windows::Graphics::Display::DisplayOrientations orientation);
00094         void UpdateButtonOrientation();
00095
00096         // UI event handlers
00097         void Application_Suspending(Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00098         void Application_Resuming(Object^ sender, Object^ args);
00099         void DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Object^ args);
00100         void VsToggleButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00101         void VideoButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00102         void SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^ sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ args);
00103         void VideoStabilizationEffect_EnabledChanged(Windows::Media::Core::VideoStabilizationEffect^ sender, Windows::Media::Core::VideoStabilizationEffectEnabledChangedEventArgs^ args);
00104         void OrientationSensor_OrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^);
00105         void HardwareButtons_CameraPressed(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^);
00106
00107         // Camera event handlers
00108         void MediaCapture_RecordLimitationExceeded(Windows::Media::Capture::MediaCapture ^currentCaptureObject);
00109         void MediaCapture_Failed(Windows::Media::Capture::MediaCapture ^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^ errorEventArgs);
00110
00111     protected:
00112         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00113         virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00114
00115     public:
00116         MainPage();
00117         virtual ~MainPage();
00118     };
00119 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TripStore Member List

This is the complete list of members for TripStore, including all inherited members.
DeleteTrip(Trip trip) | TripStore | [inline]
loaded | TripStore | [private]
LoadTrips() | TripStore | [inline]
SaveTrip(Trip trip) | TripStore | [inline]
trips | TripStore | [private]
Trips | TripStore |
TripStore() | TripStore | [inline]
WriteTrips() | TripStore | [inline, private]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_NumeralSystemTranslation Member List

This is the complete list of members for Scenario6_NumeralSystemTranslation, including all inherited members.
Display_Click(object sender, RoutedEventArgs e) | Scenario6_NumeralSystemTranslation | [inline, private]
rootPage | Scenario6_NumeralSystemTranslation | [private]
Scenario6_NumeralSystemTranslation() | Scenario6_NumeralSystemTranslation | [inline]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/SampleConfiguration.cpp Source File

  • DisablingScreenCapture
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Enabling screen capture", "SDKTemplate.Scenario1_Enable" },
00021     { "Disabling screen capture", "SDKTemplate.Scenario2_Disable" },
00022 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInteractionMode/cppwinrt/SampleConfiguration.h Source File

  • UserInteractionMode
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt
00016 {
00017     hstring to_hstring(Windows::UI::ViewManagement::UserInteractionMode value);
00018 }
00019
00020 namespace winrt::SDKTemplate
00021 {
00022 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/HolographicFaceTrackerMain.cpp Source File

  • HolographicFaceTracking
  • cpp

HolographicFaceTrackerMain.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "HolographicFaceTrackerMain.h"
00014 #include "Common\DirectXHelper.h"
00015
00016 #include "Content\VideoFrameProcessor.h"
00017 #include "Content\FaceTrackerProcessor.h"
00018
00019 #include "Content\SpinningCubeRenderer.h"
00020 #include "Content\QuadRenderer.h"
00021 #include "Content\TextRenderer.h"
00022 #include "Content\NV12VideoTexture.h"
00023
00024 using namespace HolographicFaceTracker;
00025
00026 using namespace Concurrency;
00027 using namespace Platform;
00028 using namespace Windows::Foundation;
00029 using namespace Windows::Foundation::Numerics;
00030 using namespace Windows::Graphics::Holographic;
00031 using namespace Windows::Graphics::Imaging;
00032 using namespace Windows::Media::Capture;
00033 using namespace Windows::Media::Capture::Frames;
00034 using namespace Windows::Media::Devices::Core;
00035 using namespace Windows::Perception::Spatial;
00036 using namespace Windows::UI::Input::Spatial;
00037
00038 using namespace std::placeholders;
00039
00040 using namespace Microsoft::WRL::Wrappers;
00041 using namespace Microsoft::WRL;
00042
00043 using namespace DirectX;
00044
00045 // Loads and initializes application assets when the application is loaded.
00046 HolographicFaceTrackerMain::HolographicFaceTrackerMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00047     m_deviceResources(deviceResources)
00048 {
00049     // Register to be notified if the device is lost or recreated.
00050     m_deviceResources->RegisterDeviceNotify(this);
00051 }
00052
00053 void HolographicFaceTrackerMain::SetHolographicSpace(HolographicSpace^ holographicSpace)
00054 {
00055     UnregisterHolographicEventHandlers();
00056
00057     m_holographicSpace = holographicSpace;
00058
00059     // Use the default SpatialLocator to track the motion of the device.
00060     m_locator = SpatialLocator::GetDefault();
00061
00062     // Be able to respond to changes in the positional tracking state.
00063     m_locatabilityChangedToken =
00064         m_locator->LocatabilityChanged +=
00065             ref new Windows::Foundation::TypedEventHandler<SpatialLocator^, Object^>(
00066                 std::bind(&HolographicFaceTrackerMain::OnLocatabilityChanged, this, _1, _2)
00067                 );
00068
00069     // Respond to camera added events by creating any resources that are specific
00070     // to that camera, such as the back buffer render target view.
00071     // When we add an event handler for CameraAdded, the API layer will avoid putting
00072     // the new camera in new HolographicFrames until we complete the deferral we created
00073     // for that handler, or return from the handler without creating a deferral. This
00074     // allows the app to take more than one frame to finish creating resources and
00075     // loading assets for the new holographic camera.
00076     // This function should be registered before the app creates any HolographicFrames.
00077     m_cameraAddedToken =
00078         m_holographicSpace->CameraAdded +=
00079             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraAddedEventArgs^>(
00080                 std::bind(&HolographicFaceTrackerMain::OnCameraAdded, this, _1, _2)
00081                 );
00082
00083     // Respond to camera removed events by releasing resources that were created for that
00084     // camera.
00085     // When the app receives a CameraRemoved event, it releases all references to the back
00086     // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
00087     // The app must also ensure that the back buffer is not attached as a render target, as
00088     // shown in DeviceResources::ReleaseResourcesForBackBuffer.
00089     m_cameraRemovedToken =
00090         m_holographicSpace->CameraRemoved +=
00091             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraRemovedEventArgs^>(
00092                 std::bind(&HolographicFaceTrackerMain::OnCameraRemoved, this, _1, _2)
00093                 );
00094
00095     // The simplest way to render world-locked holograms is to create a stationary reference frame
00096     // when the app is launched. This is roughly analogous to creating a "world" coordinate system
00097     // with the origin placed at the device's position as the app is launched.
00098     m_referenceFrame = m_locator->CreateAttachedFrameOfReferenceAtCurrentHeading();
00099
00100     // First we initialize our MediaCapture and FaceTracking objects
00101     task<void> videoInitTask = VideoFrameProcessor::CreateAsync()
00102         .then([this](std::shared_ptr<VideoFrameProcessor> videoProcessor)
00103     {
00104         m_videoFrameProcessor = std::move(videoProcessor);
00105
00106         return FaceTrackerProcessor::CreateAsync(m_videoFrameProcessor)
00107             .then([this](std::shared_ptr<FaceTrackerProcessor> faceProcessor)
00108         {
00109             m_faceTrackerProcessor = std::move(faceProcessor);
00110         });
00111     });
00112
00113     // Then we can initialize our device dependent resources, which depend on the VideoFrameProcessor.
00114     videoInitTask.then([this]
00115     {
00116         std::vector<task<void>> deviceInitTasks = {
00117             DX::CreateAndInitializeAsync(m_quadRenderer, m_deviceResources),
00118             DX::CreateAndInitializeAsync(m_spinningCubeRenderer, m_deviceResources),
00119             DX::CreateAndInitializeAsync(m_textRenderer, m_deviceResources, 512u, 512u),
00120         };
00121
00122         if (m_videoFrameProcessor)
00123         {
00124             VideoMediaFrameFormat^ videoFormat = m_videoFrameProcessor->GetCurrentFormat();
00125             deviceInitTasks.push_back(DX::CreateAndInitializeAsync(m_videoTexture, m_deviceResources, videoFormat->Width, videoFormat->Height));
00126         }
00127
00128         when_all(deviceInitTasks.begin(), deviceInitTasks.end()).then([this]
00129         {
00130             // If we weren't able to create the VideoFrameProcessor, then we don't have any cameras we can use.
00131             // Set our status message to inform the user. Typically this should only happen on the emulator.
00132             if (m_videoFrameProcessor == nullptr)
00133             {
00134                 m_textRenderer->RenderTextOffscreen(L"No camera available");
00135             }
00136             // Everything is good to go, so we can set our status message to inform the user when we don't detect
00137             // any faces.
00138             else
00139             {
00140                 m_textRenderer->RenderTextOffscreen(L"No faces detected");
00141             }
00142
00143             m_isReadyToRender = true;
00144         });
00145     });
00146 }
00147
00148 void HolographicFaceTrackerMain::UnregisterHolographicEventHandlers()
00149 {
00150     if (m_holographicSpace != nullptr)
00151     {
00152         // Clear previous event registrations.
00153
00154         if (m_cameraAddedToken.Value != 0)
00155         {
00156             m_holographicSpace->CameraAdded -= m_cameraAddedToken;
00157             m_cameraAddedToken.Value = 0;
00158         }
00159
00160         if (m_cameraRemovedToken.Value != 0)
00161         {
00162             m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
00163             m_cameraRemovedToken.Value = 0;
00164         }
00165     }
00166
00167     if (m_locator != nullptr)
00168     {
00169         m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
00170     }
00171 }
00172
00173 HolographicFaceTrackerMain::~HolographicFaceTrackerMain()
00174 {
00175     // Deregister device notification.
00176     m_deviceResources->RegisterDeviceNotify(nullptr);
00177
00178     UnregisterHolographicEventHandlers();
00179 }
00180
00181 void HolographicFaceTrackerMain::ProcessFaces(std::vector<BitmapBounds> const& faces, Windows::Media::Capture::Frames::MediaFrameReference^ frame, SpatialCoordinateSystem^ worldCoordSystem)
00182 {
00183     VideoMediaFrameFormat^ videoFormat = frame->VideoMediaFrame->VideoFormat;
00184     SpatialCoordinateSystem^ cameraCoordinateSystem = frame->CoordinateSystem;
00185     CameraIntrinsics^ cameraIntrinsics = frame->VideoMediaFrame->CameraIntrinsics;
00186
00187     IBox<float4x4>^ cameraToWorld = cameraCoordinateSystem->TryGetTransformTo(worldCoordSystem);
00188
00189     // If we can't locate the world, this transform will be null.
00190     if (cameraToWorld == nullptr)
00191     {
00192         return;
00193     }
00194
00195     float const textureWidthInv = 1.0f / static_cast<float>(videoFormat->Width);
00196     float const textureHeightInv = 1.0f / static_cast<float>(videoFormat->Height);
00197
00198     // The face analysis returns very "tight fitting" rectangles.
00199     // We add some padding to make the visuals more appealing.
00200     constexpr uint32_t paddingForFaceRect = 24u;
00201     constexpr float averageFaceWidthInMeters = 0.15f;
00202
00203     float const pixelsPerMeterAlongX = cameraIntrinsics->FocalLength.x;
00204     float const averagePixelsForFaceAt1Meter = pixelsPerMeterAlongX * averageFaceWidthInMeters;
00205
00206     // Place the cube 25cm above the center of the face.
00207     float3 const cubeOffsetInWorldSpace = float3{ 0.0f, 0.25f, 0.0f };
00208
00209     BitmapBounds bestRect = {};
00210     float3 bestRectPositionInCameraSpace = float3::zero();
00211     float bestDotProduct = -1.0f;
00212
00213     for (BitmapBounds const& faceRect : faces)
00214     {
00215         Point const faceRectCenterPoint = {
00216             static_cast<float>(faceRect.X + faceRect.Width / 2u),
00217             static_cast<float>(faceRect.Y + faceRect.Height / 2u),
00218         };
00219
00220         // Calculate the vector towards the face at 1 meter.
00221         float2 const centerOfFace = cameraIntrinsics->UnprojectAtUnitDepth(faceRectCenterPoint);
00222
00223         // Add the Z component and normalize.
00224         float3 const vectorTowardsFace = normalize(float3{ centerOfFace.x, centerOfFace.y, -1.0f });
00225
00226         // Estimate depth using the ratio of the current faceRect width with the average faceRect width at 1 meter.
00227         float const estimatedFaceDepth = averagePixelsForFaceAt1Meter / static_cast<float>(faceRect.Width);
00228
00229         // Get the dot product between the vector towards the face and the gaze vector.
00230         // The closer the dot product is to 1.0, the closer the face is to the middle of the video image.
00231         float const dotFaceWithGaze = dot(vectorTowardsFace, -float3::unit_z());
00232
00233         // Scale the vector towards the face by the depth, and add an offset for the cube.
00234         float3 const targetPositionInCameraSpace = vectorTowardsFace * estimatedFaceDepth;
00235
00236         // Pick the faceRect that best matches the users gaze.
00237         if (dotFaceWithGaze > bestDotProduct)
00238         {
00239             bestDotProduct = dotFaceWithGaze;
00240             bestRect = faceRect;
00241             bestRectPositionInCameraSpace = targetPositionInCameraSpace;
00242         }
00243     }
00244
00245     // Transform the cube from Camera space to World space.
00246     float3 const bestRectPositionInWorldspace = transform(bestRectPositionInCameraSpace, cameraToWorld->Value);
00247
00248     m_spinningCubeRenderer->SetTargetPosition(bestRectPositionInWorldspace + cubeOffsetInWorldSpace);
00249
00250     // Texture Coordinates are [0,1], but our FaceRect is [0,Width] and [0,Height], so we need to normalize these coordinates
00251     // We also add padding for the faceRects to make it more visually appealing.
00252     float const normalizedWidth  = static_cast<float>(bestRect.Width  + paddingForFaceRect * 2u) * textureWidthInv;
00253     float const normalizedHeight = static_cast<float>(bestRect.Height + paddingForFaceRect * 2u) * textureHeightInv;
00254     float const normalizedX      = static_cast<float>(bestRect.X      - paddingForFaceRect     ) * textureWidthInv;
00255     float const normalizedY      = static_cast<float>(bestRect.Y      - paddingForFaceRect     ) * textureHeightInv;
00256
00257     m_quadRenderer->SetTexCoordScaleAndOffset({ normalizedWidth, normalizedHeight }, { normalizedX, normalizedY });
00258 }
00259
00260 // Updates the application state once per frame.
00261 HolographicFrame^ HolographicFaceTrackerMain::Update()
00262 {
00263     if (!m_isReadyToRender)
00264     {
00265         return nullptr;
00266     }
00267
00268     // The HolographicFrame has information that the app needs in order
00269     // to update and render the current frame. The app begins each new
00270     // frame by calling CreateNextFrame.
00271     HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();
00272
00273     // Get a prediction of where holographic cameras will be when this frame
00274     // is presented.
00275     HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00276
00277     // Back buffers can change from frame to frame. Validate each buffer, and recreate
00278     // resource views and depth buffers as needed.
00279     m_deviceResources->EnsureCameraResources(holographicFrame, prediction);
00280
00281     SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);
00282
00283     if (m_videoFrameProcessor && m_faceTrackerProcessor)
00284     {
00285         m_trackingFaces = m_faceTrackerProcessor->IsTrackingFaces();
00286
00287         if (m_trackingFaces)
00288         {
00289             if (MediaFrameReference^ frame = m_videoFrameProcessor->GetLatestFrame())
00290             {
00291                 ProcessFaces(m_faceTrackerProcessor->GetLatestFaces(), frame, currentCoordinateSystem);
00292
00293                 int64_t const currentTimeStamp = frame->SystemRelativeTime->Value.Duration;
00294
00295                 // Copy only new frames to our DirectX texture.
00296                 if (currentTimeStamp > m_previousFrameTimestamp)
00297                 {
00298                     m_videoTexture->CopyFromVideoMediaFrame(frame->VideoMediaFrame);
00299                     m_previousFrameTimestamp = currentTimeStamp;
00300                 }
00301             }
00302         }
00303     }
00304
00305     SpatialPointerPose^ pointerPose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, prediction->Timestamp);
00306
00307     m_timer.Tick([&] {
00308         m_spinningCubeRenderer->Update(m_timer);
00309
00310         // If we're tracking faces, then put the quad to the left side of the viewport, 2 meters out.
00311         if (m_trackingFaces)
00312         {
00313             m_quadRenderer->Update(pointerPose, float3{ -0.45f, 0.0f, -2.0f }, m_timer);
00314         }
00315         // Otherwise, put the quad centered in the viewport, 2 meters out.
00316         else
00317         {
00318             m_quadRenderer->ResetTexCoordScaleAndOffset();
00319             m_quadRenderer->Update(pointerPose, float3{ 0.0f, -0.15f, -2.0f }, m_timer);
00320         }
00321     });
00322
00323     // We complete the frame update by using information about our content positioning
00324     // to set the focus point.
00325     // Next, we get a coordinate system from the attached frame of reference that is
00326     // associated with the current frame. Later, this coordinate system is used for
00327     // for creating the stereo view matrices when rendering the sample content.
00328
00329     for (auto cameraPose : prediction->CameraPoses)
00330     {
00331         // The HolographicCameraRenderingParameters class provides access to set
00332         // the image stabilization parameters.
00333         HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);
00334
00335         // If we're tracking faces, then put the focus point on the cube
00336         if (m_trackingFaces)
00337         {
00338             renderingParameters->SetFocusPoint(
00339                 currentCoordinateSystem,
00340                 m_spinningCubeRenderer->GetPosition()
00341             );
00342         }
00343         // Otherwise put the focus point on status message quad.
00344         else
00345         {
00346             renderingParameters->SetFocusPoint(
00347                 currentCoordinateSystem,
00348                 m_quadRenderer->GetPosition(),
00349                 m_quadRenderer->GetNormal(),
00350                 m_quadRenderer->GetVelocity()
00351             );
00352         }
00353     }
00354
00355     // The holographic frame will be used to get up-to-date view and projection matrices and
00356     // to present the swap chain.
00357     return holographicFrame;
00358 }
00359
00360 // Renders the current frame to each holographic camera, according to the
00361 // current application and spatial positioning state. Returns true if the
00362 // frame was rendered to at least one camera.
00363 bool HolographicFaceTrackerMain::Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame)
00364 {
00365     if (!m_isReadyToRender)
00366     {
00367         return false;
00368     }
00369
00370     SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->GetStationaryCoordinateSystemAtTimestamp(holographicFrame->CurrentPrediction->Timestamp);
00371
00372     // Lock the set of holographic camera resources, then draw to each camera
00373     // in this frame.
00374     return m_deviceResources->UseHolographicCameraResources<bool>(
00375         [this, holographicFrame, currentCoordinateSystem](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
00376     {
00377         // Up-to-date frame predictions enhance the effectiveness of image stablization and
00378         // allow more accurate positioning of holograms.
00379         holographicFrame->UpdateCurrentPrediction();
00380         HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00381
00382         bool atLeastOneCameraRendered = false;
00383         for (auto cameraPose : prediction->CameraPoses)
00384         {
00385             // This represents the device-based resources for a HolographicCamera.
00386             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00387
00388             // Get the device context.
00389             const auto context = m_deviceResources->GetD3DDeviceContext();
00390             const auto depthStencilView = pCameraResources->GetDepthStencilView();
00391
00392             // Set render targets to the current holographic camera.
00393             ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
00394             context->OMSetRenderTargets(1, targets, depthStencilView);
00395
00396             // Clear the back buffer and depth stencil view.
00397             context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
00398             context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00399
00400             // The view and projection matrices for each holographic camera will change
00401             // every frame. This function refreshes the data in the constant buffer for
00402             // the holographic camera indicated by cameraPose.
00403             pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, currentCoordinateSystem);
00404
00405             // Attach the view/projection constant buffer for this camera to the graphics pipeline.
00406             bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);
00407
00408             // Render world-locked content only when positional tracking is active.
00409             if (cameraActive)
00410             {
00411                 // If we are tracking any faces, then we render the cube over their head, and the video image on the quad.
00412                 if (m_trackingFaces)
00413                 {
00414                     m_spinningCubeRenderer->Render();
00415                     m_quadRenderer->RenderNV12(m_videoTexture->GetLuminanceTexture(), m_videoTexture->GetChrominanceTexture());
00416                 }
00417                 // Otherwise we render the status message on the quad.
00418                 else
00419                 {
00420                     m_quadRenderer->RenderRGB(m_textRenderer->GetTexture());
00421                 }
00422             }
00423
00424             atLeastOneCameraRendered = true;
00425         }
00426
00427         return atLeastOneCameraRendered;
00428     });
00429 }
00430
00431 void HolographicFaceTrackerMain::SaveAppState()
00432 {
00433     // This sample does not save any state on suspend.
00434 }
00435
00436 void HolographicFaceTrackerMain::LoadAppState()
00437 {
00438     // This sample has no state to restore on suspend.
00439 }
00440
00441 // Notifies classes that use Direct3D device resources that the device resources
00442 // need to be released before this method returns.
00443 void HolographicFaceTrackerMain::OnDeviceLost()
00444 {
00445     m_isReadyToRender = false;
00446
00447     m_quadRenderer->ReleaseDeviceDependentResources();
00448     m_spinningCubeRenderer->ReleaseDeviceDependentResources();
00449     m_textRenderer->ReleaseDeviceDependentResources();
00450     m_videoTexture->ReleaseDeviceDependentResources();
00451 }
00452
00453 // Notifies classes that use Direct3D device resources that the device resources
00454 // may now be recreated.
00455 void HolographicFaceTrackerMain::OnDeviceRestored()
00456 {
00457     auto initTasks = {
00458         m_quadRenderer->CreateDeviceDependentResourcesAsync(),
00459         m_spinningCubeRenderer->CreateDeviceDependentResourcesAsync(),
00460         m_textRenderer->CreateDeviceDependentResourcesAsync(),
00461         m_videoTexture->CreateDeviceDependentResourcesAsync(),
00462     };
00463
00464     when_all(initTasks.begin(), initTasks.end()).then([this] {
00465         m_isReadyToRender = true;
00466     });
00467 }
00468
00469 void HolographicFaceTrackerMain::OnLocatabilityChanged(SpatialLocator^ sender, Object^ args)
00470 {
00471     switch (sender->Locatability)
00472     {
00473     case SpatialLocatability::Unavailable:
00474         // Holograms cannot be rendered.
00475         {
00476             String^ message = L"Warning! Positional tracking is " +
00477                                         sender->Locatability.ToString() + L".\n";
00478             OutputDebugStringW(message->Data());
00479         }
00480         break;
00481
00482     // In the following three cases, it is still possible to place holograms using a
00483     // SpatialLocatorAttachedFrameOfReference.
00484     case SpatialLocatability::PositionalTrackingActivating:
00485         // The system is preparing to use positional tracking.
00486
00487     case SpatialLocatability::OrientationOnly:
00488         // Positional tracking has not been activated.
00489         break;
00490
00491     case SpatialLocatability::PositionalTrackingInhibited:
00492         // Positional tracking is temporarily inhibited. User action may be required
00493         // in order to restore positional tracking.
00494         break;
00495
00496     case SpatialLocatability::PositionalTrackingActive:
00497         // Positional tracking is active. World-locked content can be rendered.
00498         break;
00499     }
00500 }
00501
00502 void HolographicFaceTrackerMain::OnCameraAdded(
00503     HolographicSpace^ sender,
00504     HolographicSpaceCameraAddedEventArgs^ args
00505     )
00506 {
00507     Deferral^ deferral = args->GetDeferral();
00508     HolographicCamera^ holographicCamera = args->Camera;
00509     create_task([this, deferral, holographicCamera] ()
00510     {
00511         // Create device-based resources for the holographic camera and add it to the list of
00512         // cameras used for updates and rendering. Notes:
00513         //   * Since this function may be called at any time, the AddHolographicCamera function
00514         //     waits until it can get a lock on the set of holographic camera resources before
00515         //     adding the new camera. At 60 frames per second this wait should not take long.
00516         //   * A subsequent Update will take the back buffer from the RenderingParameters of this
00517         //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
00518         //     Content can then be rendered for the HolographicCamera.
00519         m_deviceResources->AddHolographicCamera(holographicCamera);
00520
00521         // Holographic frame predictions will not include any information about this camera until
00522         // the deferral is completed.
00523         deferral->Complete();
00524     });
00525 }
00526
00527 void HolographicFaceTrackerMain::OnCameraRemoved(
00528     HolographicSpace^ sender,
00529     HolographicSpaceCameraRemovedEventArgs^ args
00530     )
00531 {
00532     // Before letting this callback return, ensure that all references to the back buffer
00533     // are released.
00534     // Since this function may be called at any time, the RemoveHolographicCamera function
00535     // waits until it can get a lock on the set of holographic camera resources before
00536     // deallocating resources for this camera. At 60 frames per second this wait should
00537     // not take long.
00538     m_deviceResources->RemoveHolographicCamera(args->Camera);
00539 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_CompactOverlay Member List

This is the complete list of members for Scenario4_CompactOverlay, including all inherited members.
appWindow | Scenario4_CompactOverlay | [private]
appWindowFrame | Scenario4_CompactOverlay | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario4_CompactOverlay | [inline, protected]
Scenario4_CompactOverlay() | Scenario4_CompactOverlay | [inline]
ShowWindowBtn_Click(object sender, RoutedEventArgs e) | Scenario4_CompactOverlay | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/OvenServer.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

OvenServer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008
00009 namespace Microsoft { namespace SDKSamples { namespace Kitchen {
00010
00011     double Oven::Volume::get()
00012     {
00013         return _dims.Width * _dims.Height * _dims.Depth;
00014     }
00015
00016     void Oven::ConfigurePreheatTemperature(OvenTemperature temperature)
00017     {
00018         if (temperature >= OvenTemperature::Low && temperature <= OvenTemperature::High)
00019         {
00020             _temperature = temperature;
00021         }
00022         else
00023         {
00024             throw ref new Platform::InvalidArgumentException(L"Temperature is out of range. The temperature should be low, medium, or high.");
00025         }
00026     }
00027
00028     void Oven::BakeBread(Platform::String^ flavor)
00029     {
00030         Windows::Foundation::TimeSpan preheatTime;
00031
00032         // Determine how long to wait for the oven to get to temperature
00033         switch (_temperature)
00034         {
00035         case OvenTemperature::Low:
00036             // Set the preheat time to 100ms
00037             preheatTime.Duration = 1000;
00038             break;
00039
00040         case OvenTemperature::Medium:
00041             // Set the preheat time to 200ms
00042             preheatTime.Duration = 2000;
00043             break;
00044
00045         case OvenTemperature::High:
00046             // Set the preheat time to 300ms
00047             preheatTime.Duration = 3000;
00048             break;
00049
00050         default:
00051             throw ref new Platform::InvalidArgumentException(L"Temperature is out of range. The temperature should be low, medium, or high.");
00052         }
00053
00054         // Set up a threadpool work item to bake the bread and notify listeners after the oven has preheated
00055         Windows::System::Threading::ThreadPoolTimer::CreateTimer(ref new Windows::System::Threading::TimerElapsedHandler(
00056             [this, flavor](Windows::System::Threading::ThreadPoolTimer^ timer) -> void
00057             {
00058                 Bread^ bread = ref new Bread(flavor);
00059                 BreadBaked(this, bread);
00060             }),
00061             preheatTime);
00062     }
00063 } /* Kitchen */ } /* SDKSamples */ } /* Microsoft */
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario7_ListAllCards.xaml.cs Source File

  • SmartCard
  • cs

Scenario7_ListAllCards.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using Windows.Devices.Enumeration;
00004 using Windows.Devices.SmartCards;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007
00008 namespace SDKTemplate
00009 {
00010     public class SmartCardListItem
00011     {
00012         public string ReaderName
00013         {
00014             get;
00015             set;
00016         }
00017
00018         public string CardName
00019         {
00020             get;
00021             set;
00022         }
00023
00024     }
00025     public sealed partial class Scenario7_ListAllCards : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario7_ListAllCards()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// Click handler for the 'ListSmartCard' button.
00036         /// </summary>
00037         /// <param name="sender"></param>
00038         /// <param name="e"></param>
00039         private async void ListSmartCard_Click(object sender, RoutedEventArgs e)
00040         {
00041             Button b = sender as Button;
00042             b.IsEnabled = false;
00043             try
00044             {
00045                 rootPage.NotifyUser("Enumerating smart cards...", NotifyType.StatusMessage);
00046
00047                 // This list will be bound to our ItemListView once it has been
00048                 // filled with SmartCardListItems.  The SmartCardListItem class
00049                 // is defined above, and describes a reader/card pair with a
00050                 // reader name and a card name.
00051                 List<SmartCardListItem> cardItems = new List<SmartCardListItem>();
00052
00053                 // First we get the device selector for smart card readers using
00054                 // the static GetDeviceSelector method of the SmartCardReader
00055                 // class.  The selector is a string which describes a class of
00056                 // devices to query for, and is used as the argument to
00057                 // DeviceInformation.FindAllAsync.  GetDeviceSelector is
00058                 // overloaded so that you can provide a SmartCardReaderKind
00059                 // to specify if you are only interested in a particular type
00060                 // of card/reader (e.g. TPM virtual smart card.)  In this case
00061                 // we will list all cards and readers.
00062                 string selector = SmartCardReader.GetDeviceSelector();
00063                 DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector);
00064
00065                 // DeviceInformation.FindAllAsync gives us a
00066                 // DeviceInformationCollection, which is essentially a list
00067                 // of DeviceInformation objects.  We must iterate through that
00068                 // list and instantiate SmartCardReader objects from the
00069                 // DeviceInformation objects.
00070                 foreach (DeviceInformation device in devices)
00071                 {
00072                     SmartCardReader reader = await SmartCardReader.FromIdAsync(device.Id);
00073
00074                     // For each reader, we want to find all the cards associated
00075                     // with it.  Then we will create a SmartCardListItem for
00076                     // each (reader, card) pair.
00077                     IReadOnlyList<SmartCard> cards = await reader.FindAllCardsAsync();
00078
00079                     foreach (SmartCard card in cards)
00080                     {
00081                         SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);
00082
00083                         SmartCardListItem item = new SmartCardListItem()
00084                         {
00085                             ReaderName = card.Reader.Name,
00086                             CardName = await provisioning.GetNameAsync()
00087                         };
00088
00089                         cardItems.Add(item);
00090                     }
00091                 }
00092
00093                 // Bind the source of ItemListView to our SmartCardListItem list.
00094                 ItemListView.ItemsSource = cardItems;
00095
00096                 rootPage.NotifyUser("Enumerating smart cards completed.", NotifyType.StatusMessage);
00097             }
00098             catch (Exception ex)
00099             {
00100                 rootPage.NotifyUser("Enumerating smart cards failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
00101             }
00102             finally
00103             {
00104                 b.IsEnabled = true;
00105             }
00106         }
00107     }
00108 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: InkAnalysis/cs/Scenario1.xaml.cs Source File

  • InkAnalysis
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using SDKTemplate;
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Foundation;
00015 using Windows.UI;
00016 using Windows.UI.Core;
00017 using Windows.UI.Input.Inking;
00018 using Windows.UI.Input.Inking.Analysis;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.UI.Xaml.Navigation;
00023 using Windows.UI.Xaml.Shapes;
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// This scenerio demostrates how to do shape recognition with InkAanlyzer.
00029     /// </summary>
00030     public sealed partial class Scenario1 : Page
00031     {
00032         private MainPage rootPage = MainPage.Current;
00033         InkPresenter inkPresenter;
00034         InkAnalyzer inkAnalyzer;
00035         DispatcherTimer dispatcherTimer;
00036
00037         public Scenario1()
00038         {
00039             this.InitializeComponent();
00040
00041             inkPresenter = inkCanvas.InkPresenter;
00042             inkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
00043             inkPresenter.StrokesErased += InkPresenter_StrokesErased;
00044             inkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;
00045             inkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;
00046
00047             inkAnalyzer = new InkAnalyzer();
00048
00049             dispatcherTimer = new DispatcherTimer();
00050             dispatcherTimer.Tick += DispatcherTimer_Tick;
00051
00052             // We perform analysis when there has been a change to the
00053             // ink presenter and the user has been idle for 200ms.
00054             dispatcherTimer.Interval = TimeSpan.FromMilliseconds(200);
00055         }
00056
00057         protected override void OnNavigatedTo(NavigationEventArgs e)
00058         {
00059             rootPage = MainPage.Current;
00060         }
00061
00062         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00063         {
00064             dispatcherTimer.Stop();
00065         }
00066
00067         private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
00068         {
00069             // Don't perform analysis while a stroke is in progress.
00070             dispatcherTimer.Stop();
00071         }
00072
00073         private void ClearButton_Click(object sender, RoutedEventArgs e)
00074         {
00075             // Don't run analysis when there is nothing to analyze.
00076             dispatcherTimer.Stop();
00077
00078             inkPresenter.StrokeContainer.Clear();
00079             inkAnalyzer.ClearDataForAllStrokes();
00080             canvas.Children.Clear();
00081         }
00082
00083         private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)
00084         {
00085             dispatcherTimer.Stop();
00086             inkAnalyzer.AddDataForStrokes(args.Strokes);
00087             dispatcherTimer.Start();
00088         }
00089
00090         private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args)
00091         {
00092             dispatcherTimer.Stop();
00093             foreach (var stroke in args.Strokes)
00094             {
00095                 inkAnalyzer.RemoveDataForStroke(stroke.Id);
00096             }
00097             dispatcherTimer.Start();
00098         }
00099
00100         private async void DispatcherTimer_Tick(object sender, object e)
00101         {
00102             dispatcherTimer.Stop();
00103             if (!inkAnalyzer.IsAnalyzing)
00104             {
00105                 InkAnalysisResult results = await inkAnalyzer.AnalyzeAsync();
00106                 if (results.Status == InkAnalysisStatus.Updated)
00107                 {
00108                     ConvertShapes();
00109                 }
00110             }
00111             else
00112             {
00113                 // Ink analyzer is busy. Wait a while and try again.
00114                 dispatcherTimer.Start();
00115             }
00116         }
00117
00118         private void ConvertShapes()
00119         {
00120             IReadOnlyList<IInkAnalysisNode> drawings = inkAnalyzer.AnalysisRoot.FindNodes(InkAnalysisNodeKind.InkDrawing);
00121             foreach (IInkAnalysisNode drawing in drawings)
00122             {
00123                 var shape = (InkAnalysisInkDrawing)drawing;
00124                 if (shape.DrawingKind == InkAnalysisDrawingKind.Drawing)
00125                 {
00126                     // Omit unsupported shape
00127                     continue;
00128                 }
00129
00130                 if (shape.DrawingKind == InkAnalysisDrawingKind.Circle || shape.DrawingKind == InkAnalysisDrawingKind.Ellipse)
00131                 {
00132                     // Create a Circle or Ellipse on the canvas.
00133                     AddEllipseToCanvas(shape);
00134                 }
00135                 else
00136                 {
00137                     // Create a Polygon on the canvas.
00138                     AddPolygonToCanvas(shape);
00139                 }
00140
00141                 // Select the strokes that were recognized, so we can delete them.
00142                 // The effect is that the shape added to the canvas replaces the strokes.
00143                 foreach (var strokeId in shape.GetStrokeIds())
00144                 {
00145                     InkStroke stroke = inkPresenter.StrokeContainer.GetStrokeById(strokeId);
00146                     stroke.Selected = true;
00147                 }
00148
00149                 // Remove the recognized strokes from the analyzer
00150                 // so it won't re-analyze them.
00151                 inkAnalyzer.RemoveDataForStrokes(shape.GetStrokeIds());
00152             }
00153             inkPresenter.StrokeContainer.DeleteSelected();
00154         }
00155
00156         private void AddPolygonToCanvas(InkAnalysisInkDrawing shape)
00157         {
00158             Polygon polygon = new Polygon();
00159
00160             // The points of the polygon are reported clockwise.
00161             foreach (var point in shape.Points)
00162             {
00163                 polygon.Points.Add(point);
00164             }
00165
00166             canvas.Children.Add(polygon);
00167         }
00168
00169         static double Distance(Point p0, Point p1)
00170         {
00171             double dX = p1.X - p0.X;
00172             double dY = p1.Y - p0.Y;
00173             return Math.Sqrt(dX * dX + dY * dY);
00174         }
00175
00176         private void AddEllipseToCanvas(InkAnalysisInkDrawing shape)
00177         {
00178             Ellipse ellipse = new Ellipse();
00179
00180             // Ellipses and circles are reported as four points
00181             // in clockwise orientation.
00182             // Points 0 and 2 are the extrema of one axis,
00183             // and points 1 and 3 are the extrema of the other axis.
00184             // See Ellipse.svg for a diagram.
00185             IReadOnlyList<Point> points = shape.Points;
00186
00187             // Calculate the geometric center of the ellipse.
00188             var center = new Point((points[0].X + points[2].X) / 2.0, (points[0].Y + points[2].Y) / 2.0);
00189
00190             // Calculate the length of one axis.
00191             ellipse.Width = Distance(points[0], points[2]);
00192
00193             var compositeTransform = new CompositeTransform();
00194             if(shape.DrawingKind == InkAnalysisDrawingKind.Circle)
00195             {
00196                 ellipse.Height = ellipse.Width;
00197             }
00198             else
00199             {
00200                 // Calculate the length of the other axis.
00201                 ellipse.Height = Distance(points[1], points[3]);
00202
00203                 // Calculate the amount by which the ellipse has been rotated
00204                 // by looking at the angle our "width" axis has been rotated.
00205                 // Since the Y coordinate is inverted, this calculates the amount
00206                 // by which the ellipse has been rotated clockwise.
00207                 double rotationAngle = Math.Atan2(points[2].Y - points[0].Y, points[2].X - points[0].X);
00208
00209                 RotateTransform rotateTransform = new RotateTransform();
00210                 // Convert radians to degrees.
00211                 compositeTransform.Rotation = rotationAngle * 180.0 / Math.PI;
00212                 compositeTransform.CenterX = ellipse.Width / 2.0;
00213                 compositeTransform.CenterY = ellipse.Height / 2.0;
00214             }
00215
00216             compositeTransform.TranslateX = center.X - ellipse.Width / 2.0;
00217             compositeTransform.TranslateY = center.Y - ellipse.Height / 2.0;
00218
00219             ellipse.RenderTransform = compositeTransform;
00220
00221             canvas.Children.Add(ellipse);
00222         }
00223     }
00224 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/HttpFilters/HttpRetryFilter.cpp Source File

  • HttpClient
  • HttpFilters

HttpRetryFilter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "HttpRetryFilter.h"
00014 #include "HttpRetryFilter.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::Windows::Web::Http;
00020 using namespace winrt::Windows::Web::Http::Filters;
00021 using namespace winrt::Windows::Web::Http::Headers;
00022
00023 namespace winrt::HttpFilters::implementation
00024 {
00025     HttpRetryFilter::HttpRetryFilter(IHttpFilter const& innerFilter) : m_innerFilter(innerFilter)
00026     {
00027         if (!m_innerFilter)
00028         {
00029             throw hresult_invalid_argument(L"innerFilter cannot be null.");
00030         }
00031     }
00032
00033     uint32_t HttpRetryFilter::GetRetriesValue(HttpRequestMessage const& request)
00034     {
00035         // Retries property keeps the number of times the request has been resent.
00036         return unbox_value_or(request.Properties().TryLookup(RetriesPropertyName), 0U);
00037     }
00038
00039     HttpRequestMessage HttpRetryFilter::CopyRequestMessage(HttpRequestMessage const& request)
00040     {
00041         HttpRequestMessage copy(request.Method(), request.RequestUri());
00042
00043         // Copy the headers.
00044         HttpRequestHeaderCollection headers = copy.Headers();
00045         for (auto [key, value] : request.Headers())
00046         {
00047             if (!headers.TryAppendWithoutValidation(key, value))
00048             {
00049                 throw hresult_error(E_FAIL, L"Unable to copy headers.");
00050             }
00051         }
00052
00053         // Copy the properties.
00054         IMap<hstring, IInspectable> properties = copy.Properties();
00055         for (auto [key, value] : request.Properties())
00056         {
00057             properties.Insert(key, value);
00058         }
00059
00060         // Increment the retry count.
00061         properties.Insert(RetriesPropertyName, box_value(GetRetriesValue(request) + 1));
00062
00063         return copy;
00064     }
00065
00066     IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> HttpRetryFilter::SendRequestAsync(HttpRequestMessage request)
00067     {
00068         auto lifetime = get_strong();
00069         auto progress = co_await get_progress_token();
00070
00071         while (true)
00072         {
00073             // Propagate progress. Increment HttpProgress.Retries by the number of times we have resent the request.
00074             IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> operation = m_innerFilter.SendRequestAsync(request);
00075             operation.Progress([progress, retries = GetRetriesValue(request)](auto&&, HttpProgress data) mutable
00076                 {
00077                     data.Retries += retries;
00078                     progress(data);
00079                 });
00080
00081             HttpResponseMessage response = co_await operation;
00082
00083             // Retry requires 503 status code.
00084             if (response.StatusCode() != HttpStatusCode::ServiceUnavailable)
00085             {
00086                 co_return response;
00087             }
00088
00089             // Retry requires Retry-After header.
00090             HttpDateOrDeltaHeaderValue retryAfter = response.Headers().RetryAfter();
00091             if (!retryAfter)
00092             {
00093                 co_return response;
00094             }
00095
00096             TimeSpan delay;
00097             if (auto delta = retryAfter.Delta())
00098             {
00099                 delay = delta.Value();
00100             }
00101             else if (auto date = retryAfter.Date())
00102             {
00103                 delay = date.Value() - clock::now();
00104             }
00105             else
00106             {
00107                 co_return response;
00108             }
00109
00110             co_await resume_after(delay);
00111
00112             // Try again with a new request.
00113             request = CopyRequestMessage(request);
00114         }
00115     }
00116 }
Generated on Fri Nov 15 2024 22:20:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

D2DSvgImageRenderer Member List

This is the complete list of members for D2DSvgImageRenderer, including all inherited members.
CreateDeviceDependentResources() | D2DSvgImageRenderer |
CreateDeviceIndependentResources() | D2DSvgImageRenderer |
CreateWindowSizeDependentResources() | D2DSvgImageRenderer |
D2DSvgImageRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | D2DSvgImageRenderer |
Draw() | D2DSvgImageRenderer |
m_deviceResources | D2DSvgImageRenderer | [private]
m_isWindowClosed | D2DSvgImageRenderer | [private]
m_scaleValue | D2DSvgImageRenderer | [private]
m_svgDocument | D2DSvgImageRenderer | [private]
OnDeviceLost() | D2DSvgImageRenderer | [virtual]
OnDeviceRestored() | D2DSvgImageRenderer | [virtual]
RecolorSubtree(ID2D1SvgElement *element, D2D1_COLOR_F newColor) | D2DSvgImageRenderer | [private]
RecolorSvg(D2D1_COLOR_F newColor) | D2DSvgImageRenderer |
ReleaseDeviceDependentResources() | D2DSvgImageRenderer |
SetScaleValue(float val) | D2DSvgImageRenderer |
ToggleTongue() | D2DSvgImageRenderer |
~D2DSvgImageRenderer() | D2DSvgImageRenderer |
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/pch.h Source File

  • UserConsentVerifier
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario4_ChangeSystemGroup.cpp Source File

  • JumpList
  • cppwinrt

Scenario4_ChangeSystemGroup.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_ChangeSystemGroup.h"
00014 #include "Scenario4_ChangeSystemGroup.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Storage;
00019 using namespace Windows::Storage::AccessCache;
00020 using namespace Windows::UI::StartScreen;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario4_ChangeSystemGroup::Scenario4_ChangeSystemGroup()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     fire_and_forget Scenario4_ChangeSystemGroup::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         auto lifetime = get_strong();
00034
00035         JumpList jumpList = co_await JumpList::LoadCurrentAsync();
00036         switch (jumpList.SystemGroupKind())
00037         {
00038         case JumpListSystemGroupKind::Recent:
00039             SystemGroup_Recent().IsChecked(true);
00040             break;
00041         case JumpListSystemGroupKind::Frequent:
00042             SystemGroup_Frequent().IsChecked(true);
00043             break;
00044         case JumpListSystemGroupKind::None:
00045             SystemGroup_None().IsChecked(true);
00046             break;
00047         }
00048     }
00049
00050     fire_and_forget Scenario4_ChangeSystemGroup::SystemGroup_Recent_Click(IInspectable const&, RoutedEventArgs const&)
00051     {
00052         auto lifetime = get_strong();
00053         JumpList jumpList = co_await JumpList::LoadCurrentAsync();
00054         jumpList.SystemGroupKind(JumpListSystemGroupKind::Recent);
00055         co_await jumpList.SaveAsync();
00056     }
00057
00058     fire_and_forget Scenario4_ChangeSystemGroup::SystemGroup_Frequent_Click(IInspectable const&, RoutedEventArgs const&)
00059     {
00060         auto lifetime = get_strong();
00061         JumpList jumpList = co_await JumpList::LoadCurrentAsync();
00062         jumpList.SystemGroupKind(JumpListSystemGroupKind::Frequent);
00063         co_await jumpList.SaveAsync();
00064     }
00065
00066     fire_and_forget Scenario4_ChangeSystemGroup::SystemGroup_None_Click(IInspectable const&, RoutedEventArgs const&)
00067     {
00068         JumpList jumpList = co_await JumpList::LoadCurrentAsync();
00069         jumpList.SystemGroupKind(JumpListSystemGroupKind::None);
00070         co_await jumpList.SaveAsync();
00071     }
00072
00073     fire_and_forget Scenario4_ChangeSystemGroup::PrepareSampleFiles_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         auto lifetime = get_strong();
00076
00077         // NOTE: This is for the sake of the sample only. Real apps should allow
00078         // the system list to be populated by user activity.
00079
00080         StorageFolder localFolder = ApplicationData::Current().LocalFolder();
00081
00082         for (int i = 0; i < 5; ++i)
00083         {
00084             hstring fileName{ L"Temp" + std::to_wstring(i) + L".ms-jumplist-sample" };
00085             StorageFile file = co_await localFolder.CreateFileAsync(fileName, CreationCollisionOption::OpenIfExists);
00086             StorageApplicationPermissions::MostRecentlyUsedList().Add(file, L"", RecentStorageItemVisibility::AppAndSystem);
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:20:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Reminder/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Reminder

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Notifications;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00006
00007 namespace Notifications.ScenarioPages.Toasts.Scenarios.Reminder
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class ScenarioElement : UserControl
00013     {
00014         public ScenarioElement()
00015         {
00016             this.InitializeComponent();
00017         }
00018
00019         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00020         {
00021             Initialize();
00022         }
00023
00024         private void Initialize()
00025         {
00026             // Clear all existing notifications
00027             ToastNotificationManager.History.Clear();
00028
00029             // Pop incoming call notification
00030             popToastControl.Payload =
00031                 $@"
00032                 <toast launch='args' scenario='reminder'>
00033                     <visual>
00034                         <binding template='ToastGeneric'>
00035                             <text>Reminder</text>
00036                             <text>Second Line of Text</text>
00037                         </binding>
00038                     </visual>
00039                     <actions>
00040
00041                         <action arguments = 'snooze'
00042                                 content = 'snooze' />
00043
00044                         <action arguments = 'dismiss'
00045                                 content = 'dismiss' />
00046
00047                     </actions>
00048                 </toast>";
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LocalHostItem Member List

This is the complete list of members for LocalHostItem, including all inherited members.
DisplayString | LocalHostItem |
LocalHost | LocalHostItem |
LocalHostItem(HostName localHostName) | LocalHostItem | [inline]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario7.xaml.h Source File

  • SimpleInk
  • cpp

Scenario7.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario7 sealed
00024     {
00025     public:
00026         Scenario7();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030
00031     private:
00032         void InkToolbar_IsStencilButtonCheckedChanged(Windows::UI::Xaml::Controls::InkToolbar^ sender, Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs^ args);
00033         void OnBringIntoView(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034
00035         MainPage^ rootPage = MainPage::Current;
00036     };
00037 }
Generated on Fri Nov 15 2024 22:18:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario1_LongAndShortFormats.xaml.cpp Source File

  • DateTimeFormatting
  • cpp

Scenario1_LongAndShortFormats.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_LongAndShortFormats.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Globalization;
00021 using namespace Windows::Globalization::DateTimeFormatting;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario1_LongAndShortFormats::Scenario1_LongAndShortFormats()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void Scenario1_LongAndShortFormats::Display()
00032 {
00033     // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00034     // in order to display dates and times using basic formatters.
00035
00036     //Get the current application context language
00037     String^ currentLanguage = ApplicationLanguages::Languages->GetAt(0);
00038
00039     // Formatters for dates and times
00040     Array<DateTimeFormatter^> ^dateFormatters = {
00041         ref new DateTimeFormatter("shortdate"),
00042         ref new DateTimeFormatter("longdate"),
00043         ref new DateTimeFormatter("shorttime"),
00044         ref new DateTimeFormatter("longtime")
00045     };
00046
00047     // Obtain the date that will be formatted.
00048     Windows::Globalization::Calendar^ cal = ref new Windows::Globalization::Calendar();
00049     Windows::Foundation::DateTime dateToFormat = cal->GetDateTime();
00050
00051     // Keep the results here
00052     String^ results = "";
00053     results = results + "Current application context language: " + currentLanguage + "\n\n";
00054
00055     // Generate the results.
00056     for (auto formatter : dateFormatters)
00057     {
00058         // Perform the actual formatting.
00059         results = results + formatter->Template + ": " + formatter->Format(dateToFormat) + "\n";
00060     }
00061
00062     // Display the results.
00063     OutputTextBlock->Text = results;
00064 }
Generated on Fri Nov 15 2024 22:19:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DSvgImage/cpp/App.xaml.cpp Source File

  • D2DSvgImage
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "App.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::ApplicationModel;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Storage;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Primitives;
00026 using namespace Windows::UI::Xaml::Data;
00027 using namespace Windows::UI::Xaml::Input;
00028 using namespace Windows::UI::Xaml::Interop;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 /// <summary>
00033 /// Initializes the singleton application object.  This is the first line of authored code
00034 /// executed, and as such is the logical equivalent of main() or WinMain().
00035 /// </summary>
00036 App::App()
00037 {
00038     InitializeComponent();
00039     Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
00040     Resuming += ref new EventHandler<Object^>(this, &App::OnResuming);
00041 }
00042
00043 /// <summary>
00044 /// Invoked when the application is launched normally by the end user.  Other entry points
00045 /// will be used when the application is launched to open a specific file, to display
00046 /// search results, and so forth.
00047 /// </summary>
00048 /// <param name="e">Details about the launch request and process.</param>
00049 void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
00050 {
00051     if (m_directXPage == nullptr)
00052     {
00053         m_directXPage = ref new DirectXPage();
00054     }
00055
00056     if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00057     {
00058         m_directXPage->LoadInternalState(ApplicationData::Current->LocalSettings->Values);
00059     }
00060
00061     // Place the page in the current window and ensure that it is active.
00062     Window::Current->Content = m_directXPage;
00063     Window::Current->Activate();
00064 }
00065
00066 /// <summary>
00067 /// Invoked when application execution is being suspended.  Application state is saved
00068 /// without knowing whether the application will be terminated or resumed with the contents
00069 /// of memory still intact.
00070 /// </summary>
00071 /// <param name="sender">The source of the suspend request.</param>
00072 /// <param name="e">Details about the suspend request.</param>
00073 void App::OnSuspending(Object^, SuspendingEventArgs^)
00074 {
00075     m_directXPage->SaveInternalState(ApplicationData::Current->LocalSettings->Values);
00076 }
00077
00078 /// <summary>
00079 /// Invoked when application execution is being resumed.
00080 /// </summary>
00081 /// <param name="sender">The source of the resume request.</param>
00082 /// <param name="args">Details about the resume request.</param>
00083 void App::OnResuming(Object^, Object^)
00084 {
00085     m_directXPage->LoadInternalState(ApplicationData::Current->LocalSettings->Values);
00086 }
Generated on Fri Nov 15 2024 22:16:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/SampleConfiguration.h Source File

  • ContextMenu
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Context menu C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BarcodeDecodeTask Member List

This is the complete list of members for BarcodeDecodeTask, including all inherited members.
provider | BarcodeDecodeTask | [private]
Run(IBackgroundTaskInstance taskInstance) | BarcodeDecodeTask | [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/pch.h Source File

  • DateTimeFormatting
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/pch.h Source File

  • FileThumbnails
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario5_GeofenceBackgroundTask.h Source File

  • Geolocation
  • cppwinrt

Scenario5_GeofenceBackgroundTask.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_GeofenceBackgroundTask.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario5_GeofenceBackgroundTask : Scenario5_GeofenceBackgroundTaskT<Scenario5_GeofenceBackgroundTask>
00019     {
00020         Scenario5_GeofenceBackgroundTask();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023
00024         void RegisterBackgroundTask(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         void UnregisterBackgroundTask(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027     private:
00028         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00029
00030         static constexpr wchar_t BackgroundTaskName[] = L"SampleGeofenceBackgroundTask";
00031         static constexpr std::wstring_view BackgroundTaskEntryPoint = name_of<BackgroundTask::GeofenceBackgroundTask>();
00032
00033         Windows::ApplicationModel::Background::IBackgroundTaskRegistration m_geofenceTask{ nullptr };
00034         event_token m_taskCompletedToken{};
00035
00036         fire_and_forget OnCompleted(Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e);
00037         void UpdateButtonStates();
00038         void FillEventListBoxWithExistingEvents();
00039
00040
00041     };
00042 }
00043
00044 namespace winrt::SDKTemplate::factory_implementation
00045 {
00046     struct Scenario5_GeofenceBackgroundTask : Scenario5_GeofenceBackgroundTaskT<Scenario5_GeofenceBackgroundTask, implementation::Scenario5_GeofenceBackgroundTask>
00047     {
00048     };
00049 }
Generated on Fri Nov 15 2024 22:19:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/pch.cpp Source File

  • WiFiScan
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaStream Member List

This is the complete list of members for MediaStream, including all inherited members.
CanGenerateSegmentsDynamically | MediaStream | [private]
GetStartingSegmentIndexForLive(ulong hnsDesiredLiveOffset) | MediaStream | [inline, private]
InitSegmentData | MediaStream | [private]
initSegmentUrl | MediaStream | [private]
InitSegmentUrl | MediaStream | [private]
isInitSegmentDownloading | MediaStream | [private]
language | MediaStream | [private]
Language | MediaStream | [private]
m_canGenerateSegmentsDynamically | MediaStream | [private]
m_initSegmentData | MediaStream | [private]
m_isInitSegmentDownloading | MediaStream | [private]
m_segmentInformation | MediaStream | [private]
m_segmentInfoType | MediaStream | [private]
m_segments | MediaStream | [private]
m_segmentTemplateIdentifier | MediaStream | [private]
MediaStream() | MediaStream | [inline, private]
MimeType | MediaStream | [private]
mimeType | MediaStream | [private]
PushBackSegment(MediaSegment segment) | MediaStream | [inline, private]
PushFrontSegment(MediaSegment segment) | MediaStream | [inline, private]
SegmentInformation | MediaStream | [private]
SegmentInformationType enum name | MediaStream | [private]
SegmentInfoType | MediaStream | [private]
Segments | MediaStream | [private]
SegmentTemplateBase | MediaStream | [private]
SegmentTemplateIdentifier enum name | MediaStream | [private]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cpp/CameraRotationHelper.cpp Source File

  • CameraStarterKit
  • cpp

CameraRotationHelper.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "CameraRotationHelper.h"
00003
00004 CameraStarterKit::CameraRotationHelper::CameraRotationHelper(EnclosureLocation^ cameraEnclosureLocation)
00005 {
00006     _displayInformation = DisplayInformation::GetForCurrentView();
00007     _orientationSensor = SimpleOrientationSensor::GetDefault();
00008     _cameraEnclosureLocation = cameraEnclosureLocation;
00009     if (!IsEnclosureLocationExternal(_cameraEnclosureLocation) && _orientationSensor != nullptr)
00010     {
00011         _orientationSensor->OrientationChanged += ref new TypedEventHandler<SimpleOrientationSensor^, SimpleOrientationSensorOrientationChangedEventArgs^>(this, &CameraRotationHelper::SimpleOrientationSensor_OrientationChanged);
00012     }
00013     _displayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &CameraRotationHelper::DisplayInformation_OrientationChanged);
00014 }
00015
00016 /// <summary>
00017 /// Detects whether or not the camera is external to the device
00018 /// </summary>
00019 bool CameraStarterKit::CameraRotationHelper::IsEnclosureLocationExternal(EnclosureLocation^ enclosureLocation)
00020 {
00021     return (enclosureLocation == nullptr || enclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Unknown);
00022 }
00023 /// <summary>
00024 /// Gets the rotation to rotate UI elements
00025 /// </summary>
00026 SimpleOrientation CameraStarterKit::CameraRotationHelper::GetUIOrientation()
00027 {
00028     if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00029     {
00030         // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00031         return SimpleOrientation::NotRotated;
00032     }
00033
00034     // Return the difference between the orientation of the device and the orientation of the app display
00035     SimpleOrientation deviceOrientation = _orientationSensor != nullptr ? _orientationSensor->GetCurrentOrientation() : SimpleOrientation::NotRotated;
00036     SimpleOrientation displayOrientation = ConvertDisplayOrientationToSimpleOrientation(_displayInformation->CurrentOrientation);
00037     return SubtractOrientations(displayOrientation, deviceOrientation);
00038 }
00039
00040 /// <summary>
00041 /// Gets the rotation of the camera to rotate pictures/videos when saving to file
00042 /// </summary>
00043 SimpleOrientation CameraStarterKit::CameraRotationHelper::GetCameraCaptureOrientation()
00044 {
00045     if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00046     {
00047         // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00048         return SimpleOrientation::NotRotated;
00049     }
00050
00051     // Get the device orientation offset by the camera hardware offset
00052     SimpleOrientation deviceOrientation = _orientationSensor != nullptr ? _orientationSensor->GetCurrentOrientation() : SimpleOrientation::NotRotated;
00053     SimpleOrientation result = SubtractOrientations(deviceOrientation, GetCameraOrientationRelativeToNativeOrientation());
00054
00055     // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
00056     if (ShouldMirrorPreview())
00057     {
00058         result = MirrorOrientation(result);
00059     }
00060     return result;
00061 }
00062
00063 /// <summary>
00064 /// Gets the rotation of the camera to display the camera preview
00065 /// </summary>
00066 SimpleOrientation CameraStarterKit::CameraRotationHelper::GetCameraPreviewOrientation()
00067 {
00068     if (IsEnclosureLocationExternal(_cameraEnclosureLocation))
00069     {
00070         // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00071         return SimpleOrientation::NotRotated;
00072     }
00073
00074     // Get the app display rotation offset by the camera hardware offset
00075     SimpleOrientation result = ConvertDisplayOrientationToSimpleOrientation(_displayInformation->CurrentOrientation);
00076     result = SubtractOrientations(result, GetCameraOrientationRelativeToNativeOrientation());
00077
00078     // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
00079     if (ShouldMirrorPreview())
00080     {
00081         result = MirrorOrientation(result);
00082     }
00083     return result;
00084 }
00085
00086 PhotoOrientation CameraStarterKit::CameraRotationHelper::ConvertSimpleOrientationToPhotoOrientation(SimpleOrientation orientation)
00087 {
00088     switch (orientation)
00089     {
00090     case SimpleOrientation::Rotated90DegreesCounterclockwise:
00091         return PhotoOrientation::Rotate90;
00092     case SimpleOrientation::Rotated180DegreesCounterclockwise:
00093         return PhotoOrientation::Rotate180;
00094     case SimpleOrientation::Rotated270DegreesCounterclockwise:
00095         return PhotoOrientation::Rotate270;
00096     case SimpleOrientation::NotRotated:
00097     default:
00098         return PhotoOrientation::Normal;
00099     }
00100 }
00101
00102 int CameraStarterKit::CameraRotationHelper::ConvertSimpleOrientationToClockwiseDegrees(SimpleOrientation orientation)
00103 {
00104     switch (orientation)
00105     {
00106     case SimpleOrientation::Rotated90DegreesCounterclockwise:
00107         return 270;
00108     case SimpleOrientation::Rotated180DegreesCounterclockwise:
00109         return 180;
00110     case SimpleOrientation::Rotated270DegreesCounterclockwise:
00111         return 90;
00112     case SimpleOrientation::NotRotated:
00113     default:
00114         return 0;
00115     }
00116 }
00117
00118 SimpleOrientation CameraStarterKit::CameraRotationHelper::ConvertDisplayOrientationToSimpleOrientation(DisplayOrientations orientation)
00119 {
00120     SimpleOrientation result;
00121     switch (orientation)
00122     {
00123     case DisplayOrientations::Landscape:
00124         result = SimpleOrientation::NotRotated;
00125         break;
00126     case DisplayOrientations::PortraitFlipped:
00127         result = SimpleOrientation::Rotated90DegreesCounterclockwise;
00128         break;
00129     case DisplayOrientations::LandscapeFlipped:
00130         result = SimpleOrientation::Rotated180DegreesCounterclockwise;
00131         break;
00132     case DisplayOrientations::Portrait:
00133     default:
00134         result = SimpleOrientation::Rotated270DegreesCounterclockwise;
00135         break;
00136     }
00137
00138     // Above assumes landscape; offset is needed if native orientation is portrait
00139     if (_displayInformation->NativeOrientation == DisplayOrientations::Portrait)
00140     {
00141         result = AddOrientations(result, SimpleOrientation::Rotated90DegreesCounterclockwise);
00142     }
00143
00144     return result;
00145 }
00146
00147 SimpleOrientation CameraStarterKit::CameraRotationHelper::MirrorOrientation(SimpleOrientation orientation)
00148 {
00149     // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
00150     switch (orientation)
00151     {
00152     case SimpleOrientation::Rotated90DegreesCounterclockwise:
00153         return SimpleOrientation::Rotated270DegreesCounterclockwise;
00154     case SimpleOrientation::Rotated270DegreesCounterclockwise:
00155         return SimpleOrientation::Rotated90DegreesCounterclockwise;
00156     }
00157     return orientation;
00158 }
00159
00160 SimpleOrientation CameraStarterKit::CameraRotationHelper::AddOrientations(SimpleOrientation a, SimpleOrientation b)
00161 {
00162     int aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
00163     int bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
00164     int result = (aRot + bRot) % 360;
00165     return ConvertClockwiseDegreesToSimpleOrientation(result);
00166 }
00167
00168 SimpleOrientation CameraStarterKit::CameraRotationHelper::SubtractOrientations(SimpleOrientation a, SimpleOrientation b)
00169 {
00170     int aRot = ConvertSimpleOrientationToClockwiseDegrees(a);
00171     int bRot = ConvertSimpleOrientationToClockwiseDegrees(b);
00172     // Add 360 to ensure the modulus operator does not operate on a negative
00173     int result = (360 + (aRot - bRot)) % 360;
00174     return ConvertClockwiseDegreesToSimpleOrientation(result);
00175 }
00176
00177 VideoRotation CameraStarterKit::CameraRotationHelper::ConvertSimpleOrientationToVideoRotation(SimpleOrientation orientation)
00178 {
00179     switch (orientation)
00180     {
00181     case SimpleOrientation::Rotated90DegreesCounterclockwise:
00182         return VideoRotation::Clockwise270Degrees;
00183     case SimpleOrientation::Rotated180DegreesCounterclockwise:
00184         return VideoRotation::Clockwise180Degrees;
00185     case SimpleOrientation::Rotated270DegreesCounterclockwise:
00186         return VideoRotation::Clockwise90Degrees;
00187     case SimpleOrientation::NotRotated:
00188     default:
00189         return VideoRotation::None;
00190     }
00191 }
00192
00193 SimpleOrientation CameraStarterKit::CameraRotationHelper::ConvertClockwiseDegreesToSimpleOrientation(int orientation)
00194 {
00195     switch (orientation)
00196     {
00197     case 270:
00198         return SimpleOrientation::Rotated90DegreesCounterclockwise;
00199     case 180:
00200         return SimpleOrientation::Rotated180DegreesCounterclockwise;
00201     case 90:
00202         return SimpleOrientation::Rotated270DegreesCounterclockwise;
00203     case 0:
00204     default:
00205         return SimpleOrientation::NotRotated;
00206     }
00207 }
00208
00209 void CameraStarterKit::CameraRotationHelper::SimpleOrientationSensor_OrientationChanged(SimpleOrientationSensor^ sender, SimpleOrientationSensorOrientationChangedEventArgs^ args)
00210 {
00211     if (args->Orientation != SimpleOrientation::Faceup && args->Orientation != SimpleOrientation::Facedown)
00212     {
00213         // Only raise the OrientationChanged event if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
00214         // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
00215         // either up or down, at the desired subject.
00216         //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
00217         //      on other panels, this logic should be adjusted.
00218         OrientationChanged(this, false);
00219     }
00220 }
00221
00222 void CameraStarterKit::CameraRotationHelper::DisplayInformation_OrientationChanged(DisplayInformation^ sender, Object^ ref)
00223 {
00224     OrientationChanged(this, true);
00225 }
00226
00227 bool CameraStarterKit::CameraRotationHelper::ShouldMirrorPreview()
00228 {
00229     // It is recommended that applications mirror the preview for front-facing cameras, as it gives users a more natural experience, since it behaves more like a mirror
00230     return (_cameraEnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Front);
00231 }
00232
00233 SimpleOrientation CameraStarterKit::CameraRotationHelper::GetCameraOrientationRelativeToNativeOrientation()
00234 {
00235     // Get the rotation angle of the camera enclosure as it is mounted in the device hardware
00236     SimpleOrientation enclosureAngle = ConvertClockwiseDegreesToSimpleOrientation((int)_cameraEnclosureLocation->RotationAngleInDegreesClockwise);
00237
00238     // Account for the fact that, on portrait-first devices, the built in camera sensor is read at a 90 degree offset to the native orientation
00239     if (_displayInformation->NativeOrientation == DisplayOrientations::Portrait && !IsEnclosureLocationExternal(_cameraEnclosureLocation))
00240     {
00241         enclosureAngle = AddOrientations(SimpleOrientation::Rotated90DegreesCounterclockwise, enclosureAngle);
00242     }
00243
00244     return enclosureAngle;
00245 }
Generated on Fri Nov 15 2024 22:18:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlaybackSessionViewModel Member List

This is the complete list of members for PlaybackSessionViewModel, including all inherited members.
dispatcher | PlaybackSessionViewModel | [private]
Dispose() | PlaybackSessionViewModel | [inline]
disposed | PlaybackSessionViewModel | [private]
playbackSession | PlaybackSessionViewModel | [private]
PlaybackSession_PlaybackStateChanged(MediaPlaybackSession sender, object args) | PlaybackSessionViewModel | [inline, private]
PlaybackSessionViewModel(MediaPlaybackSession playbackSession, CoreDispatcher dispatcher) | PlaybackSessionViewModel | [inline]
PlaybackState | PlaybackSessionViewModel |
player | PlaybackSessionViewModel | [private]
PropertyChanged | PlaybackSessionViewModel |
RaisePropertyChanged(string propertyName) | PlaybackSessionViewModel | [inline, private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/OpenCloseConnectionScenario.cpp Source File

  • AppServices
  • cppwinrt
  • AppServicesClient

OpenCloseConnectionScenario.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "OpenCloseConnectionScenario.h"
00014 #include "OpenCloseConnectionScenario.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel::AppService;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Foundation::Collections;
00021 using namespace winrt::Windows::UI::Xaml;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     OpenCloseConnectionScenario::OpenCloseConnectionScenario()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     fire_and_forget OpenCloseConnectionScenario::GenerateRandomNumber_Click(IInspectable const&, RoutedEventArgs const&)
00031     {
00032         auto lifetime = get_strong();
00033
00034         // Parse user input.
00035         int minValueInput = 0;
00036         bool valueParsed = TryParseInt32(MinValue().Text().c_str(), minValueInput);
00037         if (!valueParsed)
00038         {
00039             rootPage.NotifyUser(L"The Minimum Value should be a valid integer", NotifyType::ErrorMessage);
00040             co_return;
00041         }
00042
00043         int maxValueInput = 0;
00044         valueParsed = TryParseInt32(MaxValue().Text().c_str(), maxValueInput);
00045         if (!valueParsed)
00046         {
00047             rootPage.NotifyUser(L"The Maximum Value should be a valid integer", NotifyType::ErrorMessage);
00048             co_return;
00049         }
00050
00051         if (maxValueInput <= minValueInput)
00052         {
00053             rootPage.NotifyUser(L"Maximum Value must be larger than Minimum Value", NotifyType::ErrorMessage);
00054             co_return;
00055         }
00056
00057         AppServiceConnection connection;
00058         ensure_close close_connection(connection);
00059
00060         //Set up a new app service connection
00061         connection.AppServiceName(L"com.microsoft.randomnumbergenerator");
00062         connection.PackageFamilyName(L"Microsoft.SDKSamples.AppServicesProvider.CPPWINRT_8wekyb3d8bbwe");
00063         AppServiceConnectionStatus status = co_await connection.OpenAsync();
00064
00065         switch (status)
00066         {
00067         case AppServiceConnectionStatus::Success:
00068             // The new connection opened successfully
00069             rootPage.NotifyUser(L"Connection established", NotifyType::StatusMessage);
00070             break;
00071
00072         case AppServiceConnectionStatus::AppNotInstalled:
00073             rootPage.NotifyUser(L"The app AppServicesProvider is not installed. Deploy AppServicesProvider to this device and try again.", NotifyType::ErrorMessage);
00074             co_return;
00075
00076         case AppServiceConnectionStatus::AppUnavailable:
00077             rootPage.NotifyUser(L"The app AppServicesProvider is not available. This could be because it is currently being updated or was installed to a removable device that is no longer available.", NotifyType::ErrorMessage);
00078             co_return;
00079
00080         case AppServiceConnectionStatus::AppServiceUnavailable:
00081             rootPage.NotifyUser(L"The app AppServicesProvider is installed but it does not provide the app service " + connection.AppServiceName(), NotifyType::ErrorMessage);
00082             co_return;
00083
00084         default:
00085         case AppServiceConnectionStatus::Unknown:
00086             rootPage.NotifyUser(L"An unknown error occurred while we were trying to open an AppServiceConnection.", NotifyType::ErrorMessage);
00087             co_return;
00088         }
00089
00090         //Set up the inputs and send a message to the service
00091         ValueSet inputs;
00092         inputs.Insert(L"minvalue", box_value(minValueInput));
00093         inputs.Insert(L"maxvalue", box_value(maxValueInput));
00094         AppServiceResponse response = co_await connection.SendMessageAsync(inputs);
00095
00096         //If the service responded with success display the result and walk away
00097         if (response.Status() == AppServiceResponseStatus::Success)
00098         {
00099             std::optional<int> result = response.Message().TryLookup(L"result").try_as<int>();
00100             if (result.has_value())
00101             {
00102                 Result().Text(to_hstring(result.value()));
00103                 rootPage.NotifyUser(L"App service responded with a result", NotifyType::StatusMessage);
00104             }
00105             else
00106             {
00107                 rootPage.NotifyUser(L"App service did not respond with a result", NotifyType::ErrorMessage);
00108             }
00109
00110             co_return;
00111         }
00112
00113         //Something went wrong while sending a message. Let display
00114         //a meaningful error message
00115         switch (response.Status())
00116         {
00117         case AppServiceResponseStatus::Failure:
00118             rootPage.NotifyUser(L"The service failed to acknowledge the message we sent it. It may have been terminated or its RequestReceived handler might not be handling incoming messages correctly.", NotifyType::ErrorMessage);
00119             co_return;
00120
00121         case AppServiceResponseStatus::ResourceLimitsExceeded:
00122             rootPage.NotifyUser(L"The service exceeded the resources allocated to it and had to be terminated.", NotifyType::ErrorMessage);
00123             co_return;
00124
00125         default:
00126         case AppServiceResponseStatus::Unknown:
00127             rootPage.NotifyUser(L"An unknown error occurred while we were trying to send a message to the service.", NotifyType::ErrorMessage);
00128             co_return;
00129         }
00130     }
00131 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/Scenario1.xaml.h Source File

  • FolderEnumeration
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.h
00013 // Declaration of the Scenario1 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario1.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     public ref class Scenario1 sealed
00025     {
00026     public:
00027         Scenario1();
00028
00029     private:
00030         void GetFilesAndFoldersButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Item Member List

This is the complete list of members for Item, including all inherited members.
Item(int id, DateTime dateCreated, hstring title, hstring text) | Item | [inline]
m_dateCreated | Item |
m_text | Item |
m_title | Item |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cppwinrt/pch.h Source File

  • LockScreenApps
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/NotificationsExtensions.h"
00005 #include "winrt/NotificationsExtensions.Badges.h"
00006 #include "winrt/NotificationsExtensions.Tiles.h"
00007 #include "winrt/NotificationsExtensions.Toasts.h"
00008 #include "winrt/Windows.Foundation.h"
00009 #include "winrt/Windows.Foundation.Collections.h"
00010 #include "winrt/Windows.ApplicationModel.Activation.h"
00011 #include "winrt/Windows.System.h"
00012 #include "winrt/Windows.Data.Xml.Dom.h"
00013 #include "winrt/Windows.UI.Core.h"
00014 #include "winrt/Windows.UI.Notifications.h"
00015 #include "winrt/Windows.UI.Popups.h"
00016 #include "winrt/Windows.UI.StartScreen.h"
00017 #include "winrt/Windows.UI.Xaml.h"
00018 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00019 #include "winrt/Windows.UI.Xaml.Controls.h"
00020 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00021 #include "winrt/Windows.UI.Xaml.Documents.h"
00022 #include "winrt/Windows.UI.Xaml.Interop.h"
00023 #include "winrt/Windows.UI.Xaml.Markup.h"
00024 #include "winrt/Windows.UI.Xaml.Media.h"
00025 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/ToastNotificationQuickReplyTask.cs Source File

  • Notifications
  • cs
  • BackgroundTasks

ToastNotificationQuickReplyTask.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Windows.ApplicationModel.Background;
00003 using Windows.UI.Notifications;
00004
00005 namespace BackgroundTasks
00006 {
00007     public sealed class ToastNotificationQuickReplyTask : IBackgroundTask
00008     {
00009         public void Run(IBackgroundTaskInstance taskInstance)
00010         {
00011             var details = taskInstance.TriggerDetails as ToastNotificationActionTriggerDetail;
00012             if (details == null)
00013             {
00014                 BackgroundTaskStorage.PutError("TriggerDetails was not ToastNotificationActionTriggerDetail.");
00015                 return;
00016             }
00017
00018             string arguments = details.Argument;
00019
00020             if (arguments == null || !arguments.Equals("quickReply"))
00021             {
00022                 BackgroundTaskStorage.PutError($"Expected arguments to be 'quickReply' but was '{arguments}'.");
00023                 return;
00024             }
00025
00026             BackgroundTaskStorage.PutAnswer(BackgroundTaskStorage.ConvertValueSetToApplicationDataCompositeValue(details.UserInput));
00027
00028             //object obj;
00029
00030             //details.UserInput.TryGetValue("message", out obj);
00031
00032             //string message = obj as string;
00033
00034             //if (message == null)
00035             //{
00036             //    BackgroundTaskStorage.PutError("Expected there to be a UserInput value at 'message', but there was none.");
00037             //    return;
00038             //}
00039
00040             //BackgroundTaskStorage.PutAnswer(message);
00041         }
00042     }
00043 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_ClearScenario Member List

This is the complete list of members for Scenario6_ClearScenario, including all inherited members.
Clear_Click(Object sender, RoutedEventArgs e) | Scenario6_ClearScenario | [inline, private]
Scenario6_ClearScenario() | Scenario6_ClearScenario | [inline]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
ForceReset_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
Grid1_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args) | Scenario2 | [inline, private]
initdata() | Scenario2 | [inline, private]
Scenario2() | Scenario2 | [inline]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Panel Member List

This is the complete list of members for Panel, including all inherited members.
AddChild(const std::shared_ptr< IControl > &object) | ControlBase | [inline, virtual]
ControlBase() | ControlBase |
CreateDeviceDependentResources() | ControlBase | [virtual]
DoCreateDeviceDependentResources() | Panel | [protected, virtual]
DoReleaseDeviceDependentResources() | Panel | [protected, virtual]
DoRender() | Panel | [protected, virtual]
DoUpdate(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform) | Panel | [protected, virtual]
GetBoundingBox(DirectX::BoundingOrientedBox &boundingBox) | ControlBase | [inline, virtual]
GetPosition() | ControlBase | [inline, virtual]
GetRotation() | ControlBase | [inline, virtual]
GetScale() | ControlBase | [inline, virtual]
Initialize(const std::shared_ptr< DX::DeviceResources > &deviceResources) | ControlBase | [virtual]
IsEnabled() | ControlBase | [inline, virtual]
IsFocused() | ControlBase | [inline, virtual]
m_boundingBox | ControlBase | [protected]
m_children | ControlBase | [protected]
m_color | Panel | [private]
m_deviceResources | ControlBase | [protected]
m_enabled | ControlBase | [protected]
m_focused | ControlBase | [protected]
m_geometryShader | Panel | [private]
m_indexBuffer | Panel | [private]
m_indexCount | Panel | [private]
m_inputLayout | Panel | [private]
m_loadingComplete | Panel | [private]
m_modelConstantBuffer | Panel | [private]
m_modelConstantBufferData | Panel | [private]
m_onAirTapCallback | ControlBase | [protected]
m_pixelShader | Panel | [private]
m_position | ControlBase | [protected]
m_rotation | ControlBase | [protected]
m_scale | ControlBase | [protected]
m_size | Panel | [private]
m_transform | ControlBase | [protected]
m_type | ControlBase | [protected]
m_usingVprtShaders | Panel | [private]
m_vertexBuffer | Panel | [private]
m_vertexShader | Panel | [private]
Panel(const float width, const float height, const float depth, const float red, const float green, const float blue, const float alpha) | Panel |
ReleaseDeviceDependentResources() | ControlBase | [virtual]
Render() | ControlBase | [virtual]
SetEnabled(const bool enabled) | ControlBase | [inline, virtual]
SetOnAirTapCallback(std::function< void()> callback) | ControlBase | [inline, virtual]
SetPosition(Windows::Foundation::Numerics::float3 pos) | ControlBase | [inline, virtual]
SetRotation(Windows::Foundation::Numerics::float3 rot) | ControlBase | [inline, virtual]
SetScale(Windows::Foundation::Numerics::float3 scale) | ControlBase | [inline, virtual]
Type() | ControlBase | [inline, virtual]
Update(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource) | ControlBase | [virtual]
Update(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform) | ControlBase | [virtual]
HolographicMRCSample::IControl::Update(const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource)=0 | IControl | [pure virtual]
HolographicMRCSample::IControl::Update(const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)=0 | IControl | [pure virtual]
~ControlBase() | ControlBase | [virtual]
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EdgeTappedListView Member List

This is the complete list of members for EdgeTappedListView, including all inherited members.
ClearVisual() | EdgeTappedListView | [inline, private]
EdgeTappedListView() | EdgeTappedListView | [inline]
HIT_TARGET | EdgeTappedListView | [private]
IsItemLeftEdgeTapEnabled | EdgeTappedListView |
ItemLeftEdgeTapped | EdgeTappedListView |
LeftEdgeBrush | EdgeTappedListView |
ListViewEdgeTappedEventHandler(ListView sender, ListViewEdgeTappedEventArgs e) | EdgeTappedListView |
listViewItemHighlighted | EdgeTappedListView | [private]
OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args) | EdgeTappedListView | [inline, private]
OnPointerCaptureLost(object sender, PointerRoutedEventArgs e) | EdgeTappedListView | [inline, private]
OnPointerExited(object sender, PointerRoutedEventArgs e) | EdgeTappedListView | [inline, private]
OnPointerPressed(object sender, PointerRoutedEventArgs e) | EdgeTappedListView | [inline, private]
OnPointerReleased(object sender, PointerRoutedEventArgs e) | EdgeTappedListView | [inline, private]
ShowVisual() | EdgeTappedListView | [inline, private]
VISUAL_INDICATOR_NAME | EdgeTappedListView | [private]
VISUAL_INDICATOR_WIDTH | EdgeTappedListView | [private]
visualIndicator | EdgeTappedListView | [private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/pch.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cs/Scenario2_ScriptDetection.xaml.cs Source File

  • LinguisticServices
  • cs

Scenario2_ScriptDetection.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Sample;
00015 using System.Text;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario2_ScriptDetection : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario2_ScriptDetection()
00024         {
00025             InitializeComponent();
00026         }
00027
00028         public void Go_Click(object sender, RoutedEventArgs e)
00029         {
00030             StringBuilder output = new StringBuilder();
00031             foreach (RecognizedTextRun run in LinguisticServices.RecognizeTextScripts(TextInput.Text))
00032             {
00033                 output.AppendLine($"Range from {run.First} to {run.Last}: {run.Script} script");
00034             }
00035             TextOutput.Text = output.ToString();
00036
00037         }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.h Source File

  • UserDataAccountManager
  • cpp

Scenario2_ManageAccount.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_ManageAccount.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2_ManageAccount sealed
00024     {
00025     public:
00026         Scenario2_ManageAccount();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030
00031     private:
00032         MainPage^ rootPage = MainPage::Current;
00033         bool isLaunched = false;
00034
00035         void Manage_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036     };
00037 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_DisplayingBarcodePreview Member List

This is the complete list of members for Scenario5_DisplayingBarcodePreview, including all inherited members.
ClaimedScanner_Closed(Windows::Devices::PointOfService::ClaimedBarcodeScanner const &sender, Windows::Devices::PointOfService::ClaimedBarcodeScannerClosedEventArgs const &args) | Scenario5_DisplayingBarcodePreview | [private]
ClaimedScanner_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args) | Scenario5_DisplayingBarcodePreview | [private]
CloseScannerResourcesAsync() | Scenario5_DisplayingBarcodePreview | [private]
FlipPreview_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_DisplayingBarcodePreview |
HidePreviewButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_DisplayingBarcodePreview |
IsPreviewing() | Scenario5_DisplayingBarcodePreview | [inline]
IsPreviewing(bool isPreviewing) | Scenario5_DisplayingBarcodePreview | [inline]
IsScannerClaimed() | Scenario5_DisplayingBarcodePreview | [inline]
IsScannerClaimed(bool claimed) | Scenario5_DisplayingBarcodePreview | [inline]
isStopPending | Scenario5_DisplayingBarcodePreview | [private]
m_displayRequest | Scenario5_DisplayingBarcodePreview | [private]
m_isPreviewing | Scenario5_DisplayingBarcodePreview | [private]
m_isScannerClaimed | Scenario5_DisplayingBarcodePreview | [private]
m_isSelectionChanging | Scenario5_DisplayingBarcodePreview | [private]
m_pendingSelectionDeviceId | Scenario5_DisplayingBarcodePreview | [private]
m_propertyChanged | Scenario5_DisplayingBarcodePreview | [private]
m_scannerSupportsPreview | Scenario5_DisplayingBarcodePreview | [private]
m_softwareTriggerStarted | Scenario5_DisplayingBarcodePreview | [private]
MediaCapture_Failed(Windows::Media::Capture::MediaCapture const &sender, Windows::Media::Capture::MediaCaptureFailedEventArgs const &errorEventArgs) | Scenario5_DisplayingBarcodePreview | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &args) | Scenario5_DisplayingBarcodePreview |
PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler) | Scenario5_DisplayingBarcodePreview | [inline]
PropertyChanged(event_token const &token) noexcept | Scenario5_DisplayingBarcodePreview | [inline]
RaisePropertyChanged(hstring propertyName) | Scenario5_DisplayingBarcodePreview | [private]
ScannerSelection_Changed(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &args) | Scenario5_DisplayingBarcodePreview |
ScannerSupportsPreview() | Scenario5_DisplayingBarcodePreview | [inline]
ScannerSupportsPreview(bool supportsPreview) | Scenario5_DisplayingBarcodePreview | [inline]
Scenario5_DisplayingBarcodePreview() | Scenario5_DisplayingBarcodePreview |
SelectScannerAsync(hstring scannerDeviceId) | Scenario5_DisplayingBarcodePreview | [private]
SetPreviewRotationAsync(Windows::Graphics::Display::DisplayOrientations displayOrientation) | Scenario5_DisplayingBarcodePreview | [private]
ShowPreviewButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_DisplayingBarcodePreview |
SoftwareTriggerStarted() | Scenario5_DisplayingBarcodePreview | [inline]
SoftwareTriggerStarted(bool started) | Scenario5_DisplayingBarcodePreview | [inline]
StartMediaCaptureAsync(hstring videoDeviceId) | Scenario5_DisplayingBarcodePreview | [private]
StartSoftwareTriggerButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_DisplayingBarcodePreview |
StopSoftwareTriggerButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_DisplayingBarcodePreview |
Watcher_Added(Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformation args) | Scenario5_DisplayingBarcodePreview |
Watcher_Removed(Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate const &args) | Scenario5_DisplayingBarcodePreview |
Watcher_Updated(Windows::Devices::Enumeration::DeviceWatcher const &sender, Windows::Devices::Enumeration::DeviceInformationUpdate const &args) | Scenario5_DisplayingBarcodePreview |
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario6_InterfaceSettings.xaml.cs Source File

  • CustomUsbDeviceAccess
  • cs

Scenario6_InterfaceSettings.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Globalization;
00015 using Windows.Devices.Usb;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019 using SDKTemplate;
00020
00021 namespace CustomUsbDeviceAccess
00022 {
00023     /// <summary>
00024     /// Scenario will demonstrate how to change interface settings (also known as alternate interface setting).
00025     ///
00026     /// This scenario can work for any device as long as it is "added" into the sample. For more information on how to add a
00027     /// device to make it compatible with this scenario, please see Scenario1_DeviceConnect.
00028     /// </summary>
00029     public sealed partial class Scenario6_InterfaceSettings : Page
00030     {
00031         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00032         // as NotifyUser()
00033         private MainPage rootPage = MainPage.Current;
00034
00035         public Scenario6_InterfaceSettings()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         ///
00043         /// We will enable/disable parts of the UI if the device doesn't support it.
00044         ///
00045         /// The list of interfaces settings will be hardcoded to be 0 or 1 because those settings on the
00046         /// defaultInterface of the SuperMutt are identical. Changing the setting will not effect the funcitonality
00047         /// of other scenarios.
00048         /// </summary>
00049         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00050         /// property is typically used to configure the page.</param>
00051         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00052         {
00053             // We will disable the scenario that is not supported by the device.
00054             // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00055             Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
00056             deviceScenarios.Add(DeviceType.All, GenericScenario);
00057
00058             Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00059
00060             // Enumerate all the interface settings of the default interface and add them to list for user to choose
00061             if (EventHandlerForDevice.Current.IsDeviceConnected)
00062             {
00063                 var defaultInterface = EventHandlerForDevice.Current.Device.DefaultInterface;
00064                 for (int settingNumber = 0; settingNumber < defaultInterface.InterfaceSettings.Count; settingNumber++)
00065                 {
00066                     InterfaceSettingsToChoose.Items.Add(settingNumber.ToString(NumberFormatInfo.InvariantInfo));
00067                 }
00068
00069                 // Default select the first interface setting because it's always going to be available
00070                 InterfaceSettingsToChoose.SelectedIndex = 0;
00071
00072                 // Only allow setting of the interface settings for the SuperMutt device because it will not break the rest of the scenarios
00073                 if (!Utilities.IsSuperMuttDevice(EventHandlerForDevice.Current.Device))
00074                 {
00075                     ButtonSetSetting.IsEnabled = false;
00076                 }
00077             }
00078         }
00079
00080         /// <summary>
00081         /// Determines which item is clicked and what the interfaceSettingNumber that item corresponds to.
00082         /// Will not allow changing of the interface setting if not a SuperMutt. If it is a SuperMutt,
00083         /// only the first two interface settings can be used because the first two interface settings
00084         /// are identical with respect to the API.
00085         /// </summary>
00086         private void SetSuperMuttInterfaceSetting_Click(Object sender, RoutedEventArgs e)
00087         {
00088             if (EventHandlerForDevice.Current.IsDeviceConnected)
00089             {
00090                 // Since we added the the settings in order, the index of the item clicked will give us the index of the
00091                 // setting in UsbInterface.InterfaceSettings.
00092                 // The number of interface settings is limited by the max value of byte because interface setting number size
00093                 // is a byte (Usb Spec).
00094                 SetInterfaceSetting((byte)InterfaceSettingsToChoose.SelectedIndex);
00095             }
00096             else
00097             {
00098                 Utilities.NotifyDeviceNotConnected();
00099             }
00100         }
00101
00102         private void GetInterfaceSetting_Click(Object sender, RoutedEventArgs e)
00103         {
00104             if (EventHandlerForDevice.Current.IsDeviceConnected)
00105             {
00106                 GetInterfaceSetting();
00107             }
00108             else
00109             {
00110                 Utilities.NotifyDeviceNotConnected();
00111             }
00112         }
00113
00114         /// <summary>
00115         /// Selects the interface setting on the default interface.
00116         ///
00117         /// The interfaceSetting is 0 based, where setting 0 is the default interfaceSetting.
00118         /// </summary>
00119         /// <param name="settingNumber"></param>
00120         private async void SetInterfaceSetting(Byte settingNumber)
00121         {
00122             if (EventHandlerForDevice.Current.IsDeviceConnected)
00123             {
00124                 var interfaceSetting = EventHandlerForDevice.Current.Device.DefaultInterface.InterfaceSettings[settingNumber];
00125
00126                 await interfaceSetting.SelectSettingAsync();
00127
00128                 MainPage.Current.NotifyUser("Interface Setting is set to " + settingNumber, NotifyType.StatusMessage);
00129             }
00130         }
00131
00132         /// <summary>
00133         /// Figures out which interface setting is currently selected by checking each interface setting even if the
00134         /// setting cannot be selected by this sample app.
00135         /// It will print out the selected interface setting number.
00136         /// <summary>
00137         private void GetInterfaceSetting()
00138         {
00139             if (EventHandlerForDevice.Current.IsDeviceConnected)
00140             {
00141                 var interfaceSettings = EventHandlerForDevice.Current.Device.DefaultInterface.InterfaceSettings;
00142
00143                 foreach (UsbInterfaceSetting interfaceSetting in interfaceSettings)
00144                 {
00145                     if (interfaceSetting.Selected)
00146                     {
00147                         Byte interfaceSettingNumber = interfaceSetting.InterfaceDescriptor.AlternateSettingNumber;
00148
00149                         MainPage.Current.NotifyUser("Current interface setting : " + interfaceSettingNumber.ToString("D", NumberFormatInfo.InvariantInfo), NotifyType.StatusMessage);
00150
00151                         break;
00152                     }
00153                 }
00154             }
00155         }
00156     }
00157 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/Scenario2_Scan.xaml.cpp Source File

  • WiFiScan
  • cpp

Scenario2_Scan.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Scan.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace SDKTemplate::WiFiScan;
00017
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Devices::WiFi;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Globalization::DateTimeFormatting;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Controls::Primitives;
00029 using namespace Windows::UI::Xaml::Data;
00030 using namespace Windows::UI::Xaml::Input;
00031 using namespace Windows::UI::Xaml::Media;
00032 using namespace Windows::UI::Xaml::Navigation;
00033 using namespace concurrency;
00034
00035 Scenario2_Scan::Scenario2_Scan() : _rootPage(MainPage::Current)
00036 {
00037     InitializeComponent();
00038 }
00039
00040 void Scenario2_Scan::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00041 {
00042     auto scanOperation = _firstAdapter->ScanAsync();
00043     auto scanTask = create_task(scanOperation);
00044
00045     scanTask.then([this]()
00046     {
00047         DisplayNetworkReport(_firstAdapter->NetworkReport);
00048     });
00049 }
00050
00051 void Scenario2_Scan::OnNavigatedTo(NavigationEventArgs^ e)
00052 {
00053     ResultCollection = ref new Vector<WiFiNetworkDisplay^>();
00054     DataContext = this;
00055
00056     // RequestAccessAsync must have been called at least once by the app before using the API
00057     // Calling it multiple times is fine but not necessary
00058     // RequestAccessAsync must be called from the UI thread
00059     auto requestAccessOperation = WiFiAdapter::RequestAccessAsync();
00060     auto requestAccessTask = create_task(requestAccessOperation);
00061
00062     requestAccessTask.then([this](WiFiAccessStatus access)
00063     {
00064         if (access != WiFiAccessStatus::Allowed)
00065         {
00066             _rootPage->NotifyUser(L"Access denied", SDKTemplate::NotifyType::ErrorMessage);
00067         }
00068         else
00069         {
00070             auto enumerationOperation = DeviceInformation::FindAllAsync(WiFiAdapter::GetDeviceSelector());
00071             auto enumerationTask = create_task(enumerationOperation);
00072
00073             enumerationTask.then([this](DeviceInformationCollection^ result)
00074             {
00075                 if (result->Size >= 1)
00076                 {
00077                     auto firstAdapterOperation = WiFiAdapter::FromIdAsync(result->GetAt(0)->Id);
00078                     auto firstAdapterTask = create_task(firstAdapterOperation);
00079
00080                     firstAdapterTask.then([this](WiFiAdapter^ adapter)
00081                     {
00082                         _firstAdapter = adapter;
00083
00084                         ScanButton->IsEnabled = true;
00085                     });
00086                 }
00087                 else
00088                 {
00089                     _rootPage->NotifyUser(L"No WiFi Adapters detected on this machine", SDKTemplate::NotifyType::ErrorMessage);
00090                 }
00091             });
00092         }
00093     });
00094 }
00095
00096 void Scenario2_Scan::DisplayNetworkReport(WiFiNetworkReport^ report)
00097 {
00098     auto timestampString = DateTimeFormatter::LongDate->Format(report->Timestamp);
00099     auto message = L"Network Report Timestamp: " + timestampString;
00100     // there is no guarantee of what thread the AvailableNetworksChanged callback is run on
00101     _rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00102         ref new DispatchedHandler([this, message]
00103     {
00104         _rootPage->NotifyUser(message, SDKTemplate::NotifyType::StatusMessage);
00105     }));
00106
00107     ResultCollection->Clear();
00108     for (auto network : report->AvailableNetworks)
00109     {
00110         ResultCollection->Append(ref new WiFiNetworkDisplay(network, _firstAdapter));
00111     }
00112 }
Generated on Fri Nov 15 2024 22:22:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampArray/cs/Scenario2_Effects.xaml.cs Source File

  • LampArray
  • cs

Scenario2_Effects.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using Microsoft.Graphics.Canvas;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Devices.Lights;
00018 using Windows.Devices.Lights.Effects;
00019 using Windows.Graphics.Imaging;
00020 using Windows.Storage;
00021 using Windows.Storage.Streams;
00022 using Windows.UI;
00023 using Windows.UI.Core;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Media.Imaging;
00027 using Windows.UI.Xaml.Navigation;
00028
00029 namespace SDKTemplate
00030 {
00031     // State for the custom wave effect.
00032     internal class CustomEffectState
00033     {
00034         public LampArray lampArray;
00035         public int frameNumber = 0;
00036         public float[] lampNormalizedX;
00037         public Color[] lampColors;
00038
00039         public Color color = Colors.HotPink;
00040         public bool isColorOn = true;
00041     }
00042
00043     // State for the generated bitmap effect.
00044     internal class GeneratedBitmapState
00045     {
00046         // Helper variables for the generated bitmap effect.
00047         public int bitmapWidth;
00048         public int bitmapHeight;
00049         public float squareLength;
00050         public float squareY;
00051         public int frameNumber = 0;
00052
00053         public CanvasDevice canvasDevice = null;
00054         public CanvasRenderTarget offscreenCanvas = null;
00055         public CanvasDrawingSession offscreenDrawingSession = null;
00056
00057         public SoftwareBitmap squareBitmap = null;
00058         public Windows.Storage.Streams.Buffer squareBuffer = null;
00059     }
00060
00061     public sealed partial class Scenario2_Effects : Page
00062     {
00063         private static readonly TimeSpan EffectUpdateInterval = TimeSpan.FromMilliseconds(33);
00064         private static readonly TimeSpan ColorRampDuration = TimeSpan.FromMilliseconds(500);
00065         private static readonly int CustomEffectFrameCount = 30;
00066         private static readonly int GeneratedBitmapEffectFrameCount = 60;
00067
00068         private DeviceWatcher m_deviceWatcher;
00069
00070         // Currently attached LampArrays
00071         private readonly List<LampArrayInfo> m_attachedLampArrays = new List<LampArrayInfo>();
00072
00073         private readonly IReadOnlyList<LampArrayEffectPlaylist> m_emptyList = new List<LampArrayEffectPlaylist>();
00074         // Playlists that can be paused, stopped, and started.
00075         private IReadOnlyList<LampArrayEffectPlaylist> m_readyPlaylists;
00076
00077         private Random m_random = new Random();
00078
00079         private MainPage rootPage = MainPage.Current;
00080
00081         public Scenario2_Effects()
00082         {
00083             InitializeComponent();
00084             m_readyPlaylists = m_emptyList;
00085         }
00086
00087         protected override void OnNavigatedTo(NavigationEventArgs e)
00088         {
00089             UpdateLampArrayList();
00090
00091             // Start watching for newly attached LampArrays.
00092             m_deviceWatcher = DeviceInformation.CreateWatcher(LampArray.GetDeviceSelector());
00093
00094             m_deviceWatcher.Added += Watcher_Added;
00095             m_deviceWatcher.Removed += Watcher_Removed;
00096
00097             m_deviceWatcher.Start();
00098         }
00099
00100         protected override void OnNavigatedFrom(NavigationEventArgs e)
00101         {
00102             m_deviceWatcher.Stop();
00103
00104             // When changing scenarios, stop our effects to prevent them from interfering with the new scenario.
00105             CleanupPreviousEffect();
00106         }
00107
00108         private async void Watcher_Added(DeviceWatcher sender, DeviceInformation args)
00109         {
00110             var info = new LampArrayInfo(args.Id, args.Name, await LampArray.FromIdAsync(args.Id));
00111
00112             // DeviceWatcher events are invoked on a background thread.
00113             // We need to switch to the foreground thread to update our app UI
00114             // and access member variables without race conditions.
00115             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00116             {
00117                 if (info.lampArray == null)
00118                 {
00119                     // A LampArray was found, but Windows couldn't initialize it.
00120                     // This suggests a device error.
00121                     rootPage.NotifyUser($"Problem with LampArray {info.displayName}.", NotifyType.ErrorMessage);
00122                     return;
00123                 }
00124
00125                 // Initial condition for the new LampArray is all lights off.
00126                 info.lampArray.SetColor(Colors.Black);
00127
00128                 // Set up the AvailabilityChanged event callback for being notified whether this process can control
00129                 // RGB lighting for the newly attached LampArray.
00130                 info.lampArray.AvailabilityChanged += LampArray_AvailabilityChanged;
00131
00132                 m_attachedLampArrays.Add(info);
00133
00134                 UpdateLampArrayList();
00135             });
00136         }
00137
00138         private async void Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
00139         {
00140             // DeviceWatcher events are invoked on a background thread.
00141             // We need to switch to the foreground thread to update our app UI
00142             // and access member variables without race conditions.
00143             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00144             {
00145                 m_attachedLampArrays.RemoveAll(info => info.id == args.Id);
00146                 UpdateLampArrayList();
00147             });
00148         }
00149
00150         // The AvailabilityChanged event will fire when this calling process gains or loses control of RGB lighting
00151         // for the specified LampArray.
00152         private async void LampArray_AvailabilityChanged(LampArray sender, object args)
00153         {
00154             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00155             {
00156                 UpdateLampArrayList();
00157             });
00158         }
00159
00160         private void UpdateLampArrayList()
00161         {
00162             string message = $"Attached LampArrays: {m_attachedLampArrays.Count}\n";
00163             foreach (LampArrayInfo info in m_attachedLampArrays)
00164             {
00165                 message += $"\t{info.displayName} ({info.lampArray.LampArrayKind.ToString()}, {info.lampArray.LampCount} lamps, " +
00166                            $"{(info.lampArray.IsAvailable ? "Available" : "Unavailable")})\n";
00167             }
00168             LampArraysSummary.Text = message;
00169         }
00170
00171         // This method will be called when a new effect is selected. It will stop any running
00172         // LampArrayEffectPlaylists in progress and reset LampArray state in preparation for the new effect.
00173         private void CleanupPreviousEffect()
00174         {
00175             // Clear the bitmap image in the app UI, as it is no longer current.
00176             ImageBitmap.Source = null;
00177
00178             // Passing all the playlists to a single call to StopAll will stop them
00179             // simultaneously across all attached LampArrays.
00180             LampArrayEffectPlaylist.StopAll(m_readyPlaylists);
00181             m_readyPlaylists = m_emptyList;
00182         }
00183
00184         #region Static bitmap effect
00185         private async void StaticBitmapButton_Click(object sender, RoutedEventArgs e)
00186         {
00187             CleanupPreviousEffect();
00188
00189             // This effect will display a specified bitmap image on all connected LampArrays.
00190             // The image will be stretched and scaled to fit the Lamp dimensions of each LampArray.
00191
00192             // First, open the desired bitmap file and convert it to a SoftwareBitmap
00193             Uri bitmapUri = new Uri("ms-appx:///Assets/grapes.jpg");
00194             StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(bitmapUri);
00195             SoftwareBitmap bitmap;
00196             using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
00197             {
00198                 BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
00199                 bitmap = await decoder.GetSoftwareBitmapAsync();
00200             }
00201
00202             // Show our bitmap image in the app UI
00203             ImageBitmap.Source = new BitmapImage(bitmapUri);
00204
00205             // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
00206             var playlists = new List<LampArrayEffectPlaylist>();
00207
00208             // Create the effect playlist for each LampArray and add it to the collection.
00209             foreach (LampArrayInfo info in m_attachedLampArrays)
00210             {
00211                 var bitmapEffect = new LampArrayBitmapEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00212                 {
00213                     // We want to run this effect until is stopped. For the purposes of this sample,
00214                     // set the effect Duration to run as long as possible.
00215                     Duration = TimeSpan.MaxValue,
00216
00217                     // The UpdateInterval specifies how frequently we want to receive our callback function.
00218                     // Since this effect will display a static image, we only need to update once per effect iteration.
00219                     // Set this interval to be the same as the effect duration.
00220                     UpdateInterval = TimeSpan.MaxValue
00221                 };
00222
00223                 // Set the event handler for our effect. Use a helper function to
00224                 // to specify a bitmap to display on the device.
00225                 bitmapEffect.BitmapRequested += (_, args) => StaticBitmapEffect_BitmapRequested(bitmap, args);
00226
00227                 // Create a playlist consisting of our static bitmap effect.
00228                 var playlist = new LampArrayEffectPlaylist();
00229                 playlist.Append(bitmapEffect);
00230
00231                 // Add it to the list of playlists to start simultaneously.
00232                 playlists.Add(playlist);
00233             }
00234
00235             // Start the newly created effect playlists simultaneously.
00236             LampArrayEffectPlaylist.StartAll(playlists);
00237
00238             // Remember the playlists so we can stop them later.
00239             m_readyPlaylists = playlists;
00240         }
00241
00242         // Helper function for BitmapRequested event handler that
00243         // specifies the bitmap to display on the device.
00244         // The frequency of the event is customizable.
00245         // As configured above when setting up the static bitmap effect, this event will
00246         // be raised only once per effect iteration, since we set the update interval
00247         // equal to the effect duration.
00248         private static void StaticBitmapEffect_BitmapRequested(SoftwareBitmap bitmap, LampArrayBitmapRequestedEventArgs args)
00249         {
00250             // In a BitmapRequested handler, we can change the bitmap here to produce animations.
00251             // For the static bitmap effect, show the same image each time.
00252             args.UpdateBitmap(bitmap);
00253         }
00254         #endregion
00255
00256         #region Fade effect
00257         private void FadeButton_Click(object sender, RoutedEventArgs e)
00258         {
00259             CleanupPreviousEffect();
00260
00261             // This effect will set each Lamp to a random color and blink all Lamps simultaneously.
00262             // LampArrayBlinkEffect only supports a single color at a time. To create the desired effect with
00263             // different colors for each Lamp, we will create a separate LampArrayBlinkEffect for each Lamp,
00264             // specifying that we only want the effect to apply to a single Lamp index.
00265             // We will then add each Lamp effect to the playlist for its corresponding LampArray and configure the
00266             // playlist to run its effects simultaneously instead of sequentially.
00267
00268             // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
00269             var playlists = new List<LampArrayEffectPlaylist>();
00270
00271             // Create the effect playlist for each LampArray and add it to the collection.
00272             foreach (LampArrayInfo context in m_attachedLampArrays)
00273             {
00274                 var playlist = new LampArrayEffectPlaylist();
00275
00276                 // Configure the playlist to run the effects simultaneously.
00277                 // This will result in all Lamps for this LampArray blinking in unison,
00278                 // even though their colors will be different.
00279                 playlist.EffectStartMode = LampArrayEffectStartMode.Simultaneous;
00280
00281                 for (int i = 0; i < context.lampArray.LampCount; i++)
00282                 {
00283                     // Generate a color for each Lamp by choosing a random Red/Green/Blue combination.
00284                     var color = new Color
00285                     {
00286                         A = byte.MaxValue, // Maximum alpha makes it opaque
00287                         R = (byte)(m_random.Next(byte.MaxValue + 1)),
00288                         G = (byte)(m_random.Next(byte.MaxValue + 1)),
00289                         B = (byte)(m_random.Next(byte.MaxValue + 1)),
00290                     };
00291
00292                     // Create the effect and apply it to a single Lamp.
00293                     playlist.Append(new LampArrayBlinkEffect(context.lampArray, new[] { i })
00294                     {
00295                         Color = color,
00296
00297                         // We can adjust the timing of the LampArrayBlinkEffect using these properties.
00298                         // Specify how long it should take for the full color to fade in from off/Black to peak intensity.
00299                         AttackDuration = TimeSpan.FromMilliseconds(300),
00300
00301                         // Specify how long to display the color at peak intensity.
00302                         SustainDuration = TimeSpan.FromMilliseconds(500),
00303
00304                         // Specify how long it should take for the full color to fade out from peak intensity to off/Black.
00305                         DecayDuration = TimeSpan.FromMilliseconds(800),
00306
00307                         // Specify how long the Lamps should stay dark between blink repetitions.
00308                         RepetitionDelay = TimeSpan.FromMilliseconds(100),
00309
00310                         // Repeat the blink sequence indefinitely until the effect playlist is stopped.
00311                         RepetitionMode = LampArrayRepetitionMode.Forever
00312                     });
00313                 }
00314
00315                 // Add it to the list of playlists to start simultaneously.
00316                 playlists.Add(playlist);
00317             }
00318
00319             // Start the newly created effect playlists simultaneously.
00320             LampArrayEffectPlaylist.StartAll(playlists);
00321
00322             // Remember the playlists so we can stop them later.
00323             m_readyPlaylists = playlists;
00324         }
00325         #endregion
00326
00327         #region Custom effect
00328         // Windows.Devices.Lights.Effects contains several built-in effect types. The LampArrayCustomEffect is provided for
00329         // greater customization of lighting beyond these simple effects. It enables the SetColor controls of LampArray to
00330         // be integrated and scheduled with other effects and effect playlists.
00331         // This sample will demonstrate using LampArrayCustomEffect to display a simple lighting animation.
00332         private void CustomEffectButton_Click(object sender, RoutedEventArgs e)
00333         {
00334             CleanupPreviousEffect();
00335
00336             // This effect will use LampArrayCustomEffect to create a wave-like animation.
00337             // Lamps will turn on from left to right across the LampArray, then turn off in a similar manner.
00338
00339             // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
00340             var playlists = new List<LampArrayEffectPlaylist>();
00341
00342             // Create the effect playlist for each LampArray and add it to the collection.
00343             foreach (LampArrayInfo info in m_attachedLampArrays)
00344             {
00345                 LampArray lampArray = info.lampArray;
00346                 int[] indices = GetLampArrayIndices(lampArray);
00347                 float boundingBoxWidth = lampArray.BoundingBox.X;
00348                 // Avoid division by zero when calculating normalized positions.
00349                 if (boundingBoxWidth == 0.0f)
00350                 {
00351                     boundingBoxWidth = 1.0f;
00352                 }
00353                 CustomEffectState state = new CustomEffectState()
00354                 {
00355                     lampArray = lampArray,
00356                     lampNormalizedX = new float[lampArray.LampCount],
00357                     lampColors = new Color[lampArray.LampCount]
00358                 };
00359
00360                 // Calculate each lamp's normalized X position relative to the width of the bounding box.
00361                 // (zero will be the leftmost edge of the bounding box, and 1 will be the rightmost edge).
00362                 for (int i = 0; i < state.lampNormalizedX.Length; i++)
00363                 {
00364                     LampInfo lampInfo = lampArray.GetLampInfo(i);
00365                     state.lampNormalizedX[i] = lampInfo.Position.X / boundingBoxWidth;
00366                 }
00367
00368                 var customEffect = new LampArrayCustomEffect(lampArray, indices)
00369                 {
00370                     // We want to run this effect until is stopped. For the purposes of this sample,
00371                     // set the effect Duration to run as long as possible.
00372                     Duration = TimeSpan.MaxValue,
00373
00374                     // The UpdateInterval specifies how frequently we want to receive our callback function.
00375                     // For our animation, set this interval to 33 milliseconds, which equates to approximately 30 frames per second.
00376                     UpdateInterval = EffectUpdateInterval
00377                 };
00378
00379                 // This list will track the colors to be applied to each Lamp in the effect callback function.
00380                 // The list is ordered by Lamp index. The ordering does not reflect positions of any Lamp.
00381                 state.lampColors = Enumerable.Repeat(Colors.Black, state.lampArray.LampCount).ToArray();
00382
00383                 // This event handler will be called on every frame to update the animation.
00384                 customEffect.UpdateRequested += (_, args) => CustomEffect_UpdateRequested(state, args);
00385
00386                 // Create a playlist consisting of our wave effect.
00387                 var playlist = new LampArrayEffectPlaylist();
00388                 playlist.Append(customEffect);
00389
00390                 // Add it to the list of playlists to start simultaneously.
00391                 playlists.Add(playlist);
00392             }
00393
00394             // Start the newly created effect playlists.
00395             LampArrayEffectPlaylist.StartAll(playlists);
00396
00397             // Remember the playlists so we can stop them later.
00398             m_readyPlaylists = playlists;
00399         }
00400
00401         // Helper for the LampArrayCustomEffect.UpdateRequested event, called periodically at the requested UpdateInterval.
00402         // This enables more complex lighting patterns, such as animations. It also supports integration and scheduling with
00403         // other effects and effect playlists.
00404         // As configured above, this callback will be invoked every 33 milliseconds, or about 30 frames per second.
00405         private static void CustomEffect_UpdateRequested(CustomEffectState state, LampArrayUpdateRequestedEventArgs args)
00406         {
00407             // Update the Lamp colors for the current frame. Start by calculating how far into the current iteration we are.
00408             // We will use this to mark how far across the LampArray bounding box the effect has reached.
00409             double effectProgress = (state.frameNumber + 1) / (double)CustomEffectFrameCount;
00410
00411             // If Lamps were being turned off in the previous iteration, turn them on now, and vice versa.
00412             Color color = state.isColorOn ? state.color : Colors.Black;
00413
00414             for (int i = 0; i < state.lampNormalizedX.Length; i++)
00415             {
00416                 // All Lamps that are to the left of our marker (normalized to the LampArray bounding box width)
00417                 // should have their states updated.
00418                 if (state.lampNormalizedX[i] <= effectProgress)
00419                 {
00420                     state.lampColors[i] = color;
00421                 }
00422             }
00423
00424             // Apply the Lamp states to the LampArray.
00425             args.SetColorsForIndices(state.lampColors, GetLampArrayIndices(state.lampArray));
00426
00427             // Increment our frame counter, with wraparound if we've reached the frame limit.
00428             // Also update whether the lamps should be turned on or off for the next iteration.
00429             if (++state.frameNumber == CustomEffectFrameCount)
00430             {
00431                 state.frameNumber = 0;
00432                 state.isColorOn = !state.isColorOn;
00433             }
00434         }
00435         #endregion
00436
00437         #region Generated bitmap effect
00438         // This effect uses Win2D to create a simple animation. On each frame, we
00439         // generate a bitmap image and apply it to the entire LampArray.
00440         // The effect illustrates dynamically creating a bitmap image and using it in a lighting effect.
00441         // LampArrayBitmapEffect could be used for in-game lighting and/or integration with 2D graphics libraries.
00442         private void GeneratedBitmapButton_Click(object sender, RoutedEventArgs e)
00443         {
00444             CleanupPreviousEffect();
00445
00446             // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
00447             var playlists = new List<LampArrayEffectPlaylist>();
00448
00449             // Create the effect playlist for each LampArray and add it to the collection.
00450             foreach (LampArrayInfo info in m_attachedLampArrays)
00451             {
00452                 GeneratedBitmapState state = new GeneratedBitmapState();
00453
00454                 var generatedBitmapEffect = new LampArrayBitmapEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00455                 {
00456                     // We want to run this effect until is stopped. For the purposes of this sample,
00457                     // set the effect Duration to run as long as possible.
00458                     Duration = TimeSpan.MaxValue,
00459
00460                     // The UpdateInterval specifies how frequently we want to receive our callback function.
00461                     // For our animation, set this interval to 33 milliseconds, which equates to approximately 30 frames per second.
00462                     UpdateInterval = EffectUpdateInterval
00463                 };
00464
00465                 state.bitmapWidth = (int)generatedBitmapEffect.SuggestedBitmapSize.Width;
00466                 state.bitmapHeight = (int)generatedBitmapEffect.SuggestedBitmapSize.Height;
00467
00468                 // The size of the square is half the height or half the width, whichever is smaller.
00469                 state.squareLength = Math.Min(state.bitmapHeight, state.bitmapWidth) / 2.0f;
00470
00471                 // Vertically center the square.
00472                 state.squareY = (state.bitmapHeight - state.squareLength) / 2.0f;
00473
00474                 // Setup our Win2D helper objects.
00475                 state.canvasDevice = CanvasDevice.GetSharedDevice();
00476
00477                 state.offscreenCanvas = new CanvasRenderTarget(state.canvasDevice, state.bitmapWidth, state.bitmapHeight, 96);
00478
00479                 state.offscreenDrawingSession = state.offscreenCanvas.CreateDrawingSession();
00480
00481                 // The generated bitmap encompasses the entire LampArray
00482                 state.squareBitmap = new SoftwareBitmap(BitmapPixelFormat.Bgra8, state.bitmapWidth, state.bitmapHeight, BitmapAlphaMode.Premultiplied);
00483
00484                 state.squareBuffer = new Windows.Storage.Streams.Buffer((uint)(state.bitmapWidth * state.bitmapHeight * 4));
00485
00486                 // This event handler will be called on every frame to update the bitmap to display on the device.
00487                 generatedBitmapEffect.BitmapRequested += (_, args) => GeneratedBitmapEffect_UpdateRequested(state, args);
00488
00489                 // Create a playlist consisting of our bitmap effect.
00490                 var playlist = new LampArrayEffectPlaylist();
00491                 playlist.Append(generatedBitmapEffect);
00492
00493                 // Add it to the list of playlists to start simultaneously.
00494                 playlists.Add(playlist);
00495             }
00496
00497             // Start the newly created effect playlists.
00498             LampArrayEffectPlaylist.StartAll(playlists);
00499
00500             // Remember the playlists so we can stop them later.
00501             m_readyPlaylists = playlists;
00502         }
00503
00504         // Callback function that allows us to specify a bitmap to display on the device.
00505         // The frequency of the effect callback is customizable.
00506         // As configured above when setting up the generated bitmap effect, this will be invoked
00507         // every 33 milliseconds, or approximately 30 frames per second.
00508         // To demonstrate using a LampArrayBitmapEffect to perform lighting animations,
00509         // this callback will create an animation of a red rectangle moving left to right
00510         // across a blue background.
00511         private static void GeneratedBitmapEffect_UpdateRequested(GeneratedBitmapState state, LampArrayBitmapRequestedEventArgs args)
00512         {
00513             // Draw a red rectangle on a blue background.
00514             state.offscreenDrawingSession.Clear(Colors.Blue);
00515
00516             // The rectangle starts out just beyond the left edge of the keyboard,
00517             // then moves to the right until it just leaves the keyboard,
00518             // and then repeats.
00519             float squareX = (state.frameNumber * (state.bitmapWidth + state.squareLength) / GeneratedBitmapEffectFrameCount) - state.squareLength;
00520             state.offscreenDrawingSession.FillRectangle(squareX, state.squareY, state.squareLength, state.squareLength, Colors.Red);
00521
00522             state.offscreenDrawingSession.Flush();
00523
00524             // Apply the generated bitmap to the LampArray.
00525             state.offscreenCanvas.GetPixelBytes(state.squareBuffer);
00526             state.squareBitmap.CopyFromBuffer(state.squareBuffer);
00527
00528             args.UpdateBitmap(state.squareBitmap);
00529
00530             // Advance to the next frame for the next iteration.
00531             if (++state.frameNumber == GeneratedBitmapEffectFrameCount)
00532             {
00533                 state.frameNumber = 0;
00534             }
00535         }
00536         #endregion
00537
00538         #region Color cycle effect
00539         private void CycleButton_Click(object sender, RoutedEventArgs e)
00540         {
00541             CleanupPreviousEffect();
00542
00543             // This effect uses LampArrayColorRampEffect to perform a rainbow cycle pattern on all Lamps.
00544             // We do this for each LampArray by creating a LampArrayEffectPlaylist containing four LampArrayColorRampEffects.
00545             // Each effect will blend from the previously set color to a new color over a 500ms interval.
00546
00547             // Gather the new LampArrayEffectPlaylists in this collection so we can start them simultaneously.
00548             var playlists = new List<LampArrayEffectPlaylist>();
00549
00550             // Create the effect playlist for each LampArray and add it to the collection.
00551             foreach (LampArrayInfo info in m_attachedLampArrays)
00552             {
00553                 var playlist = new LampArrayEffectPlaylist()
00554                 {
00555                     EffectStartMode = LampArrayEffectStartMode.Sequential,
00556                     RepetitionMode = LampArrayRepetitionMode.Forever,
00557                 };
00558
00559                 playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00560                 {
00561                     Color = Colors.Red,
00562                     RampDuration = ColorRampDuration,
00563                     CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
00564                 });
00565
00566                 playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00567                 {
00568                     Color = Colors.Yellow,
00569                     RampDuration = ColorRampDuration,
00570                     CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
00571                 });
00572
00573                 playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00574                 {
00575                     Color = Colors.Green,
00576                     RampDuration = ColorRampDuration,
00577                     CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
00578                 });
00579
00580                 playlist.Append(new LampArrayColorRampEffect(info.lampArray, GetLampArrayIndices(info.lampArray))
00581                 {
00582                     Color = Colors.Blue,
00583                     RampDuration = ColorRampDuration,
00584                     CompletionBehavior = LampArrayEffectCompletionBehavior.KeepState
00585                 });
00586
00587                 // Add it to the list of playlists to start simultaneously.
00588                 playlists.Add(playlist);
00589             }
00590
00591             // Start the newly created effect playlists.
00592             LampArrayEffectPlaylist.StartAll(playlists);
00593
00594             // Remember the playlists so we can stop them later.
00595             m_readyPlaylists = playlists;
00596         }
00597         #endregion
00598
00599         private void PauseButton_Click(object sender, RoutedEventArgs e)
00600         {
00601             LampArrayEffectPlaylist.PauseAll(m_readyPlaylists);
00602         }
00603
00604         private void PlayButton_Click(object sender, RoutedEventArgs e)
00605         {
00606             LampArrayEffectPlaylist.StartAll(m_readyPlaylists);
00607         }
00608
00609         private void StopButton_Click(object sender, RoutedEventArgs e)
00610         {
00611                 LampArrayEffectPlaylist.StopAll(m_readyPlaylists);
00612         }
00613
00614         // Helper function that returns all indices of a LampArray in order.
00615         // Used when we want to apply an effect to all Lamps on a LampArray.
00616         private static int[] GetLampArrayIndices(LampArray lampArray)
00617         {
00618             return Enumerable.Range(0, lampArray.LampCount).ToArray();
00619         }
00620     }
00621 }
Generated on Fri Nov 15 2024 22:20:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameRenderer.cpp Source File

  • Simple3DGameXaml
  • cpp

GameRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameRenderer.h"
00014 #include "ConstantBuffers.h"
00015 #include "TargetTexture.h"
00016 #include "BasicLoader.h"
00017 #include "CylinderMesh.h"
00018 #include "FaceMesh.h"
00019 #include "SphereMesh.h"
00020 #include "WorldMesh.h"
00021 #include "Face.h"
00022 #include "Sphere.h"
00023 #include "Cylinder.h"
00024 #include "windows.ui.xaml.media.dxinterop.h"
00025
00026 using namespace concurrency;
00027 using namespace DirectX;
00028 using namespace Microsoft::WRL;
00029 using namespace Windows::UI::Core;
00030 using namespace Windows::UI::Xaml::Controls;
00031
00032 //----------------------------------------------------------------------
00033
00034 GameRenderer::GameRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00035     m_deviceResources(deviceResources),
00036     m_initialized(false),
00037     m_gameResourcesLoaded(false),
00038     m_levelResourcesLoaded(false)
00039 {
00040     m_gameHud = ref new GameHud(
00041         deviceResources,
00042         "Windows platform samples",
00043         "DirectX/XAML first-person game sample",
00044         "License state unknown"
00045         );
00046
00047     CreateDeviceDependentResources();
00048     CreateWindowSizeDependentResources();
00049 }
00050
00051 //----------------------------------------------------------------------
00052
00053 void GameRenderer::ReleaseDeviceDependentResources()
00054 {
00055     // On device lost all the device resources are invalid.
00056     // Set the state of the renderer to not have a pointer to the
00057     // Simple3DGame object.  It will be reset as a part of the
00058     // game devices resources being recreated.
00059     m_game = nullptr;
00060     m_gameHud->ReleaseDeviceDependentResources();
00061 }
00062
00063 //----------------------------------------------------------------------
00064
00065 void GameRenderer::CreateDeviceDependentResources()
00066 {
00067     m_gameResourcesLoaded = false;
00068     m_levelResourcesLoaded = false;
00069
00070     m_gameHud->CreateDeviceDependentResources();
00071 }
00072
00073 //----------------------------------------------------------------------
00074
00075 void GameRenderer::CreateWindowSizeDependentResources()
00076 {
00077     m_gameHud->CreateWindowSizeDependentResources();
00078
00079     auto d3dContext = m_deviceResources->GetD3DDeviceContext();
00080     auto renderTargetSize = m_deviceResources->GetRenderTargetSize();
00081
00082     if (m_game != nullptr)
00083     {
00084         // Update the Projection Matrix and the associated Constant Buffer.
00085         m_game->GameCamera()->SetProjParams(
00086             XM_PI / 2, renderTargetSize.Width / renderTargetSize.Height,
00087             0.01f,
00088             100.0f
00089             );
00090
00091         XMFLOAT4X4 orientation = m_deviceResources->GetOrientationTransform3D();
00092
00093         ConstantBufferChangeOnResize changesOnResize;
00094         XMStoreFloat4x4(
00095             &changesOnResize.projection,
00096             XMMatrixMultiply(
00097                 XMMatrixTranspose(m_game->GameCamera()->Projection()),
00098                 XMMatrixTranspose(XMLoadFloat4x4(&orientation))
00099                 )
00100             );
00101
00102         d3dContext->UpdateSubresource(
00103             m_constantBufferChangeOnResize.Get(),
00104             0,
00105             nullptr,
00106             &changesOnResize,
00107             0,
00108             0
00109             );
00110     }
00111 }
00112
00113 //----------------------------------------------------------------------
00114
00115 task<void> GameRenderer::CreateGameDeviceResourcesAsync(_In_ Simple3DGame^ game)
00116 {
00117     // Create the device dependent game resources.
00118     // Only the d3dDevice is used in this method.  It is expected
00119     // to not run on the same thread as the GameRenderer was created.
00120     // Create methods on the d3dDevice are free-threaded and are safe while any methods
00121     // in the d3dContext should only be used on a single thread and handled
00122     // in the FinalizeCreateGameDeviceResources method.
00123     m_game = game;
00124
00125     auto d3dDevice = m_deviceResources->GetD3DDevice();
00126
00127     D3D11_BUFFER_DESC bd;
00128     ZeroMemory(&bd, sizeof(bd));
00129
00130     // Create the constant buffers.
00131     bd.Usage = D3D11_USAGE_DEFAULT;
00132     bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
00133     bd.CPUAccessFlags = 0;
00134     bd.ByteWidth = (sizeof(ConstantBufferNeverChanges) + 15) / 16 * 16;
00135     DX::ThrowIfFailed(
00136         d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferNeverChanges)
00137         );
00138
00139     bd.ByteWidth = (sizeof(ConstantBufferChangeOnResize) + 15) / 16 * 16;
00140     DX::ThrowIfFailed(
00141         d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangeOnResize)
00142         );
00143
00144     bd.ByteWidth = (sizeof(ConstantBufferChangesEveryFrame) + 15) / 16 * 16;
00145     DX::ThrowIfFailed(
00146         d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangesEveryFrame)
00147         );
00148
00149     bd.ByteWidth = (sizeof(ConstantBufferChangesEveryPrim) + 15) / 16 * 16;
00150     DX::ThrowIfFailed(
00151         d3dDevice->CreateBuffer(&bd, nullptr, &m_constantBufferChangesEveryPrim)
00152         );
00153
00154     D3D11_SAMPLER_DESC sampDesc;
00155     ZeroMemory(&sampDesc, sizeof(sampDesc));
00156
00157     sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
00158     sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
00159     sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
00160     sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
00161     sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
00162     sampDesc.MinLOD = 0;
00163     sampDesc.MaxLOD = FLT_MAX;
00164     DX::ThrowIfFailed(
00165         d3dDevice->CreateSamplerState(&sampDesc, &m_samplerLinear)
00166         );
00167
00168     // Start the async tasks to load the shaders and textures.
00169     BasicLoader^ loader = ref new BasicLoader(d3dDevice);
00170
00171     std::vector<task<void>> tasks;
00172
00173     uint32 numElements = ARRAYSIZE(PNTVertexLayout);
00174     tasks.push_back(loader->LoadShaderAsync("VertexShader.cso", PNTVertexLayout, numElements, &m_vertexShader, &m_vertexLayout));
00175     tasks.push_back(loader->LoadShaderAsync("VertexShaderFlat.cso", nullptr, numElements, &m_vertexShaderFlat, nullptr));
00176     tasks.push_back(loader->LoadShaderAsync("PixelShader.cso", &m_pixelShader));
00177     tasks.push_back(loader->LoadShaderAsync("PixelShaderFlat.cso", &m_pixelShaderFlat));
00178
00179     // Make sure the previous versions if any of the textures are released.
00180     m_sphereTexture = nullptr;
00181     m_cylinderTexture = nullptr;
00182     for (uint32 i = 0; i < GameConstants::MaxBackgroundTextures; i++)
00183     {
00184         m_ceilingTexture[i] = nullptr;
00185         m_floorTexture[i] = nullptr;
00186         m_wallsTexture[i] = nullptr;
00187     }
00188
00189     // Load Game specific textures.
00190     tasks.push_back(loader->LoadTextureAsync("Assets\\seafloor.dds", nullptr, &m_sphereTexture));
00191     tasks.push_back(loader->LoadTextureAsync("Assets\\metal_texture.dds", nullptr, &m_cylinderTexture));
00192     tasks.push_back(loader->LoadTextureAsync("Assets\\cellceiling.dds", nullptr, &m_ceilingTexture[0]));
00193     tasks.push_back(loader->LoadTextureAsync("Assets\\cellfloor.dds", nullptr, &m_floorTexture[0]));
00194     tasks.push_back(loader->LoadTextureAsync("Assets\\cellwall.dds", nullptr, &m_wallsTexture[0]));
00195     tasks.push_back(loader->LoadTextureAsync("Assets\\nightwall.dds", nullptr, &m_ceilingTexture[1]));
00196     tasks.push_back(loader->LoadTextureAsync("Assets\\nightfloor.dds", nullptr, &m_floorTexture[1]));
00197     tasks.push_back(loader->LoadTextureAsync("Assets\\nightwall.dds", nullptr, &m_wallsTexture[1]));
00198     tasks.push_back(loader->LoadTextureAsync("Assets\\daywall.dds", nullptr, &m_ceilingTexture[2]));
00199     tasks.push_back(loader->LoadTextureAsync("Assets\\dayfloor.dds", nullptr, &m_floorTexture[2]));
00200     tasks.push_back(loader->LoadTextureAsync("Assets\\daywall.dds", nullptr, &m_wallsTexture[2]));
00201     tasks.push_back(create_task([]()
00202     {
00203         // Simulate loading additional resources by introducing a delay.
00204         wait(GameConstants::InitialLoadingDelay);
00205     }));
00206
00207     // Return the task group of all the async tasks for loading the shader and texture assets.
00208     return when_all(tasks.begin(), tasks.end());
00209 }
00210
00211 //----------------------------------------------------------------------
00212
00213 void GameRenderer::FinalizeCreateGameDeviceResources()
00214 {
00215     // All asynchronously loaded resources have completed loading.
00216     // Now associate all the resources with the appropriate game objects.
00217     // This method is expected to run in the same thread as the GameRenderer
00218     // was created. All work will happen behind the "Loading ..." screen after the
00219     // main loop has been entered.
00220
00221     // Initialize the Constant buffer with the light positions
00222     // These are handled here to ensure that the d3dContext is only
00223     // used in one thread.
00224
00225     auto d3dDevice = m_deviceResources->GetD3DDevice();
00226
00227     ConstantBufferNeverChanges constantBufferNeverChanges;
00228     constantBufferNeverChanges.lightPosition[0] = XMFLOAT4( 3.5f, 2.5f,  5.5f, 1.0f);
00229     constantBufferNeverChanges.lightPosition[1] = XMFLOAT4( 3.5f, 2.5f, -5.5f, 1.0f);
00230     constantBufferNeverChanges.lightPosition[2] = XMFLOAT4(-3.5f, 2.5f, -5.5f, 1.0f);
00231     constantBufferNeverChanges.lightPosition[3] = XMFLOAT4( 3.5f, 2.5f,  5.5f, 1.0f);
00232     constantBufferNeverChanges.lightColor = XMFLOAT4(0.25f, 0.25f, 0.25f, 1.0f);
00233     m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
00234         m_constantBufferNeverChanges.Get(),
00235         0,
00236         nullptr,
00237         &constantBufferNeverChanges,
00238         0,
00239         0
00240         );
00241
00242     // For the targets, there are two unique generated textures.
00243     // Each texture image includes the number of the texture.
00244     // Make sure the 2D rendering is occurring on the same thread
00245     // as the main rendering.
00246
00247     TargetTexture^ textureGenerator = ref new TargetTexture(
00248         d3dDevice,
00249         m_deviceResources->GetD2DFactory(),
00250         m_deviceResources->GetDWriteFactory(),
00251         m_deviceResources->GetD2DDeviceContext()
00252         );
00253
00254     MeshObject^ cylinderMesh = ref new CylinderMesh(d3dDevice, 26);
00255     MeshObject^ targetMesh = ref new FaceMesh(d3dDevice);
00256     MeshObject^ sphereMesh = ref new SphereMesh(d3dDevice, 26);
00257
00258     Material^ cylinderMaterial = ref new Material(
00259         XMFLOAT4(0.8f, 0.8f, 0.8f, .5f),
00260         XMFLOAT4(0.8f, 0.8f, 0.8f, .5f),
00261         XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f),
00262         15.0f,
00263         m_cylinderTexture.Get(),
00264         m_vertexShader.Get(),
00265         m_pixelShader.Get()
00266         );
00267
00268     Material^ sphereMaterial = ref new Material(
00269         XMFLOAT4(0.8f, 0.4f, 0.0f, 1.0f),
00270         XMFLOAT4(0.8f, 0.4f, 0.0f, 1.0f),
00271         XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f),
00272         50.0f,
00273         m_sphereTexture.Get(),
00274         m_vertexShader.Get(),
00275         m_pixelShader.Get()
00276         );
00277
00278     auto objects = m_game->RenderObjects();
00279
00280     // Attach the textures to the appropriate game objects.
00281     for (auto object = objects.begin(); object != objects.end(); object++)
00282     {
00283         if ((*object)->TargetId() == GameConstants::WorldFloorId)
00284         {
00285             (*object)->NormalMaterial(
00286                 ref new Material(
00287                     XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
00288                     XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
00289                     XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
00290                     150.0f,
00291                     m_floorTexture[0].Get(),
00292                     m_vertexShaderFlat.Get(),
00293                     m_pixelShaderFlat.Get()
00294                     )
00295                 );
00296             (*object)->Mesh(ref new WorldFloorMesh(d3dDevice));
00297         }
00298         else if ((*object)->TargetId() == GameConstants::WorldCeilingId)
00299         {
00300             (*object)->NormalMaterial(
00301                 ref new Material(
00302                     XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
00303                     XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
00304                     XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
00305                     150.0f,
00306                     m_ceilingTexture[0].Get(),
00307                     m_vertexShaderFlat.Get(),
00308                     m_pixelShaderFlat.Get()
00309                     )
00310                 );
00311             (*object)->Mesh(ref new WorldCeilingMesh(d3dDevice));
00312         }
00313         else if ((*object)->TargetId() == GameConstants::WorldWallsId)
00314         {
00315             (*object)->NormalMaterial(
00316                 ref new Material(
00317                     XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f),
00318                     XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f),
00319                     XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
00320                     150.0f,
00321                     m_wallsTexture[0].Get(),
00322                     m_vertexShaderFlat.Get(),
00323                     m_pixelShaderFlat.Get()
00324                     )
00325                 );
00326             (*object)->Mesh(ref new WorldWallsMesh(d3dDevice));
00327         }
00328         else if (Cylinder^ cylinder = dynamic_cast<Cylinder^>(*object))
00329         {
00330             cylinder->Mesh(cylinderMesh);
00331             cylinder->NormalMaterial(cylinderMaterial);
00332         }
00333         else if (Face^ target = dynamic_cast<Face^>(*object))
00334         {
00335             const int bufferLength = 16;
00336             char16 str[bufferLength];
00337             int len = swprintf_s(str, bufferLength, L"%d", target->TargetId());
00338             Platform::String^ string = ref new Platform::String(str, len);
00339
00340             ComPtr<ID3D11ShaderResourceView> texture;
00341             textureGenerator->CreateTextureResourceView(string, &texture);
00342             target->NormalMaterial(
00343                 ref new Material(
00344                     XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
00345                     XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
00346                     XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
00347                     5.0f,
00348                     texture.Get(),
00349                     m_vertexShader.Get(),
00350                     m_pixelShader.Get()
00351                     )
00352                 );
00353
00354             textureGenerator->CreateHitTextureResourceView(string, &texture);
00355             target->HitMaterial(
00356                 ref new Material(
00357                     XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
00358                     XMFLOAT4(0.8f, 0.8f, 0.8f, 0.5f),
00359                     XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f),
00360                     5.0f,
00361                     texture.Get(),
00362                     m_vertexShader.Get(),
00363                     m_pixelShader.Get()
00364                     )
00365                 );
00366
00367             target->Mesh(targetMesh);
00368         }
00369         else if (Sphere^ sphere = dynamic_cast<Sphere^>(*object))
00370         {
00371             sphere->Mesh(sphereMesh);
00372             sphere->NormalMaterial(sphereMaterial);
00373         }
00374     }
00375
00376     // Ensure that the camera has been initialized with the right Projection
00377     // matrix.  The camera is not created at the time the first window resize event
00378     // occurs.
00379     auto renderTargetSize = m_deviceResources->GetRenderTargetSize();
00380     m_game->GameCamera()->SetProjParams(
00381         XM_PI / 2,
00382         renderTargetSize.Width / renderTargetSize.Height,
00383         0.01f,
00384         100.0f
00385         );
00386
00387     // Make sure that Projection matrix has been set in the constant buffer
00388     // now that all the resources are loaded.
00389     // We are handling screen rotations directly to eliminate an unaligned
00390     // fullscreen copy.  As a result, it is necessary to post multiply the rotationTransform3D
00391     // matrix to the camera projection matrix.
00392     // The matrices are transposed due to the shader code expecting the matrices in the opposite
00393     // row/column order from the DirectX math library.
00394
00395     auto orientation = m_deviceResources->GetOrientationTransform3D();
00396
00397     ConstantBufferChangeOnResize changesOnResize;
00398     XMStoreFloat4x4(
00399         &changesOnResize.projection,
00400         XMMatrixMultiply(
00401             XMMatrixTranspose(m_game->GameCamera()->Projection()),
00402             XMMatrixTranspose(XMLoadFloat4x4(&orientation))
00403             )
00404         );
00405
00406     m_deviceResources->GetD3DDeviceContext()->UpdateSubresource(
00407         m_constantBufferChangeOnResize.Get(),
00408         0,
00409         nullptr,
00410         &changesOnResize,
00411         0,
00412         0
00413         );
00414
00415     m_gameResourcesLoaded = true;
00416 }
00417
00418 //----------------------------------------------------------------------
00419
00420 task<void> GameRenderer::LoadLevelResourcesAsync()
00421 {
00422     m_levelResourcesLoaded = false;
00423
00424     return create_task([this]()
00425     {
00426         // This is where additional async loading of level specific resources
00427         // would be done.  Since there aren't any to load, just simulate
00428         // by delaying for some time.
00429         wait(GameConstants::LevelLoadingDelay);
00430     });
00431 }
00432
00433 //----------------------------------------------------------------------
00434
00435 void GameRenderer::FinalizeLoadLevelResources()
00436 {
00437     // Once the level specific resources had been loaded, this method is
00438     // where D3D context specific actions would be handled.  This method
00439     // runs in the same thread context as the GameRenderer was created.
00440
00441     m_levelResourcesLoaded = true;
00442 }
00443
00444 //----------------------------------------------------------------------
00445
00446 void GameRenderer::Render()
00447 {
00448     bool stereoEnabled = m_deviceResources->GetStereoState();
00449
00450     auto d3dContext = m_deviceResources->GetD3DDeviceContext();
00451     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00452
00453     int renderingPasses = 1;
00454     if (stereoEnabled)
00455     {
00456         renderingPasses = 2;
00457     }
00458
00459     for (int i = 0; i < renderingPasses; i++)
00460     {
00461         // Iterate through the number of rendering passes to be completed.
00462         if (i > 0)
00463         {
00464             // Doing the Right Eye View.
00465             ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetViewRight() };
00466
00467             d3dContext->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());
00468             d3dContext->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH, 1.0f, 0);
00469             d2dContext->SetTarget(m_deviceResources->GetD2DTargetBitmapRight());
00470         }
00471         else
00472         {
00473             // Doing the Mono or Left Eye View.
00474             ID3D11RenderTargetView *const targets[1] = { m_deviceResources->GetBackBufferRenderTargetView() };
00475
00476             d3dContext->OMSetRenderTargets(1, targets, m_deviceResources->GetDepthStencilView());
00477             d3dContext->ClearDepthStencilView(m_deviceResources->GetDepthStencilView(), D3D11_CLEAR_DEPTH, 1.0f, 0);
00478             d2dContext->SetTarget(m_deviceResources->GetD2DTargetBitmap());
00479         }
00480
00481         if (m_game != nullptr && m_gameResourcesLoaded && m_levelResourcesLoaded)
00482         {
00483             // This section is only used after the game state has been initialized and all device
00484             // resources needed for the game have been created and associated with the game objects.
00485             if (stereoEnabled)
00486             {
00487                 // When doing stereo, it is necessary to update the projection matrix once per rendering pass.
00488
00489                 auto orientation = m_deviceResources->GetOrientationTransform3D();
00490
00491                 ConstantBufferChangeOnResize changesOnResize;
00492                 XMStoreFloat4x4(
00493                     &changesOnResize.projection,
00494                     XMMatrixMultiply(
00495                         XMMatrixTranspose(
00496                             i == 0 ?
00497                             m_game->GameCamera()->LeftEyeProjection() :
00498                             m_game->GameCamera()->RightEyeProjection()
00499                             ),
00500                         XMMatrixTranspose(XMLoadFloat4x4(&orientation))
00501                         )
00502                     );
00503
00504                 d3dContext->UpdateSubresource(
00505                     m_constantBufferChangeOnResize.Get(),
00506                     0,
00507                     nullptr,
00508                     &changesOnResize,
00509                     0,
00510                     0
00511                     );
00512             }
00513             // Update variables that change once per frame.
00514
00515             ConstantBufferChangesEveryFrame constantBufferChangesEveryFrame;
00516             XMStoreFloat4x4(
00517                 &constantBufferChangesEveryFrame.view,
00518                 XMMatrixTranspose(m_game->GameCamera()->View())
00519                 );
00520             d3dContext->UpdateSubresource(
00521                 m_constantBufferChangesEveryFrame.Get(),
00522                 0,
00523                 nullptr,
00524                 &constantBufferChangesEveryFrame,
00525                 0,
00526                 0
00527                 );
00528
00529             // Setup the graphics pipeline. This sample uses the same InputLayout and set of
00530             // constant buffers for all shaders, so they only need to be set once per frame.
00531
00532             d3dContext->IASetInputLayout(m_vertexLayout.Get());
00533             d3dContext->VSSetConstantBuffers(0, 1, m_constantBufferNeverChanges.GetAddressOf());
00534             d3dContext->VSSetConstantBuffers(1, 1, m_constantBufferChangeOnResize.GetAddressOf());
00535             d3dContext->VSSetConstantBuffers(2, 1, m_constantBufferChangesEveryFrame.GetAddressOf());
00536             d3dContext->VSSetConstantBuffers(3, 1, m_constantBufferChangesEveryPrim.GetAddressOf());
00537
00538             d3dContext->PSSetConstantBuffers(2, 1, m_constantBufferChangesEveryFrame.GetAddressOf());
00539             d3dContext->PSSetConstantBuffers(3, 1, m_constantBufferChangesEveryPrim.GetAddressOf());
00540             d3dContext->PSSetSamplers(0, 1, m_samplerLinear.GetAddressOf());
00541
00542             auto objects = m_game->RenderObjects();
00543             for (auto object = objects.begin(); object != objects.end(); object++)
00544             {
00545                 (*object)->Render(d3dContext, m_constantBufferChangesEveryPrim.Get());
00546             }
00547         }
00548         else
00549         {
00550             const float ClearColor[4] = { 0.5f, 0.5f, 0.8f, 1.0f };
00551
00552             // Only need to clear the background when not rendering the full 3D scene since
00553             // the 3D world is a fully enclosed box and the dynamics prevents the camera from
00554             // moving outside this space.
00555             if (i > 0)
00556             {
00557                 // Doing the Right Eye View.
00558                 d3dContext->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetViewRight(), ClearColor);
00559             }
00560             else
00561             {
00562                 // Doing the Mono or Left Eye View.
00563                 d3dContext->ClearRenderTargetView(m_deviceResources->GetBackBufferRenderTargetView(), ClearColor);
00564             }
00565         }
00566
00567         d2dContext->BeginDraw();
00568
00569         // To handle the swapchain being pre-rotated, set the D2D transformation to include it.
00570         d2dContext->SetTransform(m_deviceResources->GetOrientationTransform2D());
00571
00572         if (m_game != nullptr && m_gameResourcesLoaded)
00573         {
00574             // This is only used after the game state has been initialized.
00575             m_gameHud->Render(m_game);
00576         }
00577
00578         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00579         // is lost. It will be handled during the next call to Present.
00580         HRESULT hr = d2dContext->EndDraw();
00581         if (hr != D2DERR_RECREATE_TARGET)
00582         {
00583             DX::ThrowIfFailed(hr);
00584         }
00585     }
00586 }
00587
00588 //----------------------------------------------------------------------
00589
00590 #if defined(_DEBUG)
00591 void GameRenderer::ReportLiveDeviceObjects()
00592 {
00593     // If the debug layer isn't present on the system then this QI will fail.  In that case
00594     // the routine just exits.   This is a debugging aid to see the active D3D objects and
00595     // is not critical to functional operation of the sample.
00596
00597     ComPtr<ID3D11Debug> debugLayer;
00598     ComPtr<ID3D11Device2>d3dDevice = m_deviceResources->GetD3DDevice();
00599     HRESULT hr = d3dDevice.As(&debugLayer);
00600     if (FAILED(hr))
00601     {
00602         return;
00603     }
00604     DX::ThrowIfFailed(
00605         debugLayer->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL)
00606         );
00607 }
00608
00609 //----------------------------------------------------------------------
00610
00611 #endif
00612
00613 void GameRenderer::SetBackground(uint32 background)
00614 {
00615     if (background < GameConstants::MaxBackgroundTextures)
00616     {
00617         if (m_ceilingTexture[background] != nullptr &&
00618             m_floorTexture[background] != nullptr &&
00619             m_wallsTexture[background] != nullptr)
00620         {
00621             auto objects = m_game->RenderObjects();
00622
00623             // Attach the textures to the appropriate game objects.
00624             for (auto object = objects.begin(); object != objects.end(); object++)
00625             {
00626                 if ((*object)->TargetId() == GameConstants::WorldFloorId)
00627                 {
00628                     (*object)->NormalMaterial()->SetTexture(m_floorTexture[background].Get());
00629                 }
00630                 else if ((*object)->TargetId() == GameConstants::WorldCeilingId)
00631                 {
00632                     (*object)->NormalMaterial()->SetTexture(m_ceilingTexture[background].Get());
00633                 }
00634                 else if ((*object)->TargetId() == GameConstants::WorldWallsId)
00635                 {
00636                     (*object)->NormalMaterial()->SetTexture(m_wallsTexture[background].Get());
00637                 }
00638             }
00639         }
00640     }
00641 }
00642
00643 //--------------------------------------------------------------------------------------
00644
00645
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/pch.cpp Source File

  • CameraStreamCorrelation
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LightSensor/cpp/pch.cpp Source File

  • LightSensor
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/DeviceList.cs Source File

  • CustomCapability
  • cs

DeviceList.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.ObjectModel;
00014 using System.Linq;
00015 using Windows.ApplicationModel;
00016 using Windows.Devices.Custom;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Documents;
00019
00020 namespace SDKTemplate
00021 {
00022     public class DeviceListEntry
00023     {
00024         /// <summary>
00025         /// The DeviceInformation object (device interface) for this Fx2 device
00026         /// </summary>
00027         public Windows.Devices.Enumeration.DeviceInformation Device;
00028
00029         /// <summary>
00030         /// The device interface path
00031         /// </summary>
00032         public string Id => Device.Id;
00033
00034         /// <summary>
00035         /// The device's instance ID
00036         /// </summary>
00037         public string InstanceId => (string)Device.Properties["System.Devices.DeviceInstanceId"];
00038
00039         /// <summary>
00040         /// Has the device been found during the current enumeration
00041         /// </summary>
00042         public bool Matched = true;
00043
00044         /// <summary>
00045         /// Constructor
00046         /// </summary>
00047         /// <param name="DeviceInterface">The device interface for this entry</param>
00048         public DeviceListEntry(Windows.Devices.Enumeration.DeviceInformation DeviceInterface)
00049         {
00050             this.Device = DeviceInterface;
00051         }
00052     }
00053
00054     class DeviceList
00055     {
00056         public static DeviceList Current {get; private set;}
00057
00058         static DeviceList()
00059         {
00060             DeviceList.Current = new DeviceList();
00061             DeviceList.Current.InitDeviceWatcher();
00062
00063             // Register for app suspend/resume handlers
00064             App.Current.Suspending += new SuspendingEventHandler(DeviceList.Current.SuspendDeviceWatcher);
00065             App.Current.Resuming += DeviceList.Current.ResumeDeviceWatcher;
00066         }
00067
00068         /// <summary>
00069         /// List of Fx2 devices currently attached to the system.  This
00070         /// list can be updated by the PNP watcher.
00071         /// </summary>
00072         public ObservableCollection<DeviceListEntry> Fx2Devices => m_Fx2Devices;
00073
00074         /// <summary>
00075         /// The currently opened Fx2 device
00076         /// </summary>
00077         private CustomDevice m_Fx2Device;
00078         private string m_Fx2DeviceId;
00079
00080         public CustomDevice GetSelectedDevice()
00081         {
00082             return m_Fx2Device;
00083         }
00084
00085         public string GetSelectedDeviceId()
00086         {
00087             return m_Fx2DeviceId;
00088         }
00089
00090         public void SetSelectedDevice(string Id, CustomDevice Device)
00091         {
00092             if ((m_Fx2Device != null) && (this.DeviceClosing != null))
00093             {
00094                 this.DeviceClosing(this, new EventArgs());
00095             }
00096             m_Fx2Device = Device;
00097             m_Fx2DeviceId = Id;
00098         }
00099
00100         public void ClearSelectedDevice()
00101         {
00102             SetSelectedDevice(null, null);
00103         }
00104
00105         /// <summary>
00106         /// Flag to keep track of whether the device watcher has been started.
00107         /// </summary>
00108         public bool WatcherStarted = false;
00109
00110         public void StartFx2Watcher()
00111         {
00112             MainPage.Current.NotifyUser("starting device watcher", NotifyType.StatusMessage);
00113             foreach (var entry in m_Fx2Devices)
00114             {
00115                 entry.Matched = false;
00116             }
00117
00118             WatcherStarted = true;
00119             m_Fx2Watcher.Start();
00120
00121             return;
00122         }
00123
00124         public void StopFx2Watcher()
00125         {
00126             MainPage.Current.NotifyUser("stopping fx2 watcher", NotifyType.StatusMessage);
00127             m_Fx2Watcher.Stop();
00128             WatcherStarted = false;
00129         }
00130
00131         public static void CreateBooleanTable(
00132             InlineCollection Table,
00133             bool[] NewValues,
00134             bool[] OldValues,
00135             string IndexTitle,
00136             string ValueTitle,
00137             string TrueValue,
00138             string FalseValue
00139             )
00140         {
00141             Table.Clear();
00142
00143             for (var i = 0; i < NewValues.Length; i += 1)
00144             {
00145                 var line = new Span();
00146                 var block = new Run();
00147                 block.Text = (i + 1).ToString("###");
00148                 line.Inlines.Add(block);
00149
00150                 block = new Run();
00151                 block.Text = "    ";
00152                 line.Inlines.Add(block);
00153
00154                 block = new Run();
00155                 block.Text = NewValues[i] ? TrueValue : FalseValue;
00156
00157                 if ((OldValues != null) && (OldValues[i] != NewValues[i]))
00158                 {
00159                     var bold = new Bold();
00160                     bold.Inlines.Add(block);
00161                     line.Inlines.Add(bold);
00162                 }
00163                 else
00164                 {
00165                     line.Inlines.Add(block);
00166                 }
00167
00168                 line.Inlines.Add(new LineBreak());
00169
00170                 Table.Add(line);
00171             }
00172         }
00173
00174         public event EventHandler DeviceClosing;
00175
00176         //
00177         // private internal state
00178         //
00179
00180         /// <summary>
00181         /// The device watcher that we setup to look for Fx2 devices
00182         /// </summary>
00183         Windows.Devices.Enumeration.DeviceWatcher m_Fx2Watcher = null;
00184
00185         /// <summary>
00186         /// Internal list of devices.
00187         /// </summary>
00188         ObservableCollection<DeviceListEntry> m_Fx2Devices = new ObservableCollection<DeviceListEntry>();
00189
00190         void InitDeviceWatcher()
00191         {
00192             // Define the selector to enumerate all of the fx2 device interface class instances
00193             var selector = CustomDevice.GetDeviceSelector(Fx2Driver.DeviceInterfaceGuid);
00194
00195             // Create a device watcher to look for instances of the fx2 device interface
00196             m_Fx2Watcher = Windows.Devices.Enumeration.DeviceInformation.CreateWatcher(
00197                             selector,
00198                             new string[] { "System.Devices.DeviceInstanceId" }
00199                             );
00200
00201             m_Fx2Watcher.Added += OnFx2Added;
00202             m_Fx2Watcher.Removed += OnFx2Removed;
00203             m_Fx2Watcher.EnumerationCompleted += OnFx2EnumerationComplete;
00204         }
00205
00206         /// <summary>
00207         /// Event handler for arrival of Fx2 devices
00208         /// </summary>
00209         /// <param name="sender"></param>
00210         /// <param name="devInterface">The device interface which was added</param>
00211         private async void OnFx2Added(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformation devInterface)
00212         {
00213             await
00214             MainPage.Current.Dispatcher.RunAsync(
00215                 Windows.UI.Core.CoreDispatcherPriority.Normal,
00216                 () =>
00217                 {
00218                     MainPage.Current.NotifyUser(String.Format("OnFx2Added: {0}", devInterface.Id), NotifyType.StatusMessage);
00219
00220                     // search the device list for a device with a matching interface ID
00221                     DeviceListEntry match = FindInList(devInterface.Id);
00222
00223                     // If we found a match then mark it as verified and return
00224                     if (match != null)
00225                     {
00226                         match.Matched = true;
00227                         return;
00228                     }
00229
00230
00231                     // Create a new element for this device interface, and queue up the query of its
00232                     // device information
00233                     match = new DeviceListEntry(devInterface);
00234
00235                     // Add the new element to the end of the list of devices
00236                     m_Fx2Devices.Add(match);
00237                 }
00238             );
00239         }
00240
00241         /// <summary>
00242         /// Event handler for the removal of an Fx2 device
00243         /// </summary>
00244         /// <param name="sender"></param>
00245         /// <param name="devInformation">The device interface that was removed</param>
00246         private async void OnFx2Removed(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformationUpdate devInformation)
00247         {
00248             await
00249             MainPage.Current.Dispatcher.RunAsync(
00250                 Windows.UI.Core.CoreDispatcherPriority.Normal,
00251                 () =>
00252                 {
00253                     var deviceId = devInformation.Id;
00254                     MainPage.Current.NotifyUser(String.Format("OnFx2Removed: {0}", deviceId), NotifyType.StatusMessage);
00255
00256                     // Search the list of devices for one with a matching ID
00257                     var match = FindInList(deviceId);
00258                     if (match != null)
00259                     {
00260                         // Remove the matched item
00261                         MainPage.Current.NotifyUser(String.Format("OnFx2Removed: {0} removed", deviceId), NotifyType.StatusMessage);
00262                         m_Fx2Devices.Remove(match);
00263                     }
00264                 }
00265             );
00266         }
00267
00268         /// <summary>
00269         /// Event handler for the end of an enumeration/reenumeration started
00270         /// by calling Start on the device watcher.  This culls out any entries
00271         /// in the list which are no longer matched.
00272         /// </summary>
00273         /// <param name="sender"></param>
00274         /// <param name="args"></param>
00275         private async void OnFx2EnumerationComplete(Windows.Devices.Enumeration.DeviceWatcher sender, object args)
00276         {
00277             await
00278             MainPage.Current.Dispatcher.RunAsync(
00279                 Windows.UI.Core.CoreDispatcherPriority.Normal,
00280                 () =>
00281                 {
00282                     MainPage.Current.NotifyUser(String.Format("OnFx2EnumerationComplete"), NotifyType.StatusMessage);
00283
00284                     DeviceListEntry removedDevice;
00285
00286                     while ((removedDevice = m_Fx2Devices.FirstOrDefault(e => !e.Matched)) != null)
00287                     {
00288                         MainPage.Current.NotifyUser("OnFx2EnumerationComplete: Removing missing device " + removedDevice.Id, NotifyType.StatusMessage);
00289                         m_Fx2Devices.Remove(removedDevice);
00290                     }
00291                 }
00292             );
00293         }
00294
00295         private bool m_WatcherSuspended = false;
00296
00297         private DeviceListEntry FindInList(string id)
00298         {
00299             return m_Fx2Devices.FirstOrDefault(entry => entry.Id == id);
00300         }
00301
00302         private void SuspendDeviceWatcher(object sender, SuspendingEventArgs e)
00303         {
00304             if (WatcherStarted)
00305             {
00306                 m_WatcherSuspended = WatcherStarted;
00307                 StopFx2Watcher();
00308             }
00309         }
00310
00311         private void ResumeDeviceWatcher(object sender, object e)
00312         {
00313             if (m_WatcherSuspended)
00314             {
00315                 StartFx2Watcher();
00316                 m_WatcherSuspended = false;
00317             }
00318         }
00319     }
00320 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StartFunc Member List

This is the complete list of members for StartFunc, including all inherited members.
_llStartTime | StartFunc |
operator()(IMFStreamSink *pStream) const | StartFunc | [inline]
StartFunc(LONGLONG llStartTime) | StartFunc | [inline]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario15_ServerCertificateValidation Member List

This is the complete list of members for Scenario15_ServerCertificateValidation, including all inherited members.
Cancel_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario15_ServerCertificateValidation |
CancelableRequestAsync(Windows::Web::Http::HttpRequestMessage request) | Scenario15_ServerCertificateValidation | [private]
DefaultAndCustomValidation_Checked(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario15_ServerCertificateValidation |
DefaultOSValidation_Checked(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario15_ServerCertificateValidation |
IgnoreErrorsAndCustomValidation_Checked(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario15_ServerCertificateValidation |
IsCertificateValidAsync(Windows::Security::Cryptography::Certificates::Certificate serverCert) | Scenario15_ServerCertificateValidation | [private]
MyCustomServerCertificateValidator(Windows::Web::Http::Filters::HttpBaseProtocolFilter const &sender, Windows::Web::Http::Filters::HttpServerCustomValidationRequestedEventArgs args) | Scenario15_ServerCertificateValidation | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario15_ServerCertificateValidation |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario15_ServerCertificateValidation |
Scenario15_ServerCertificateValidation() | Scenario15_ServerCertificateValidation |
Start_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario15_ServerCertificateValidation |
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ProducerExperiences/cs/SecureInterfaceService.cs Source File

  • AllJoyn
  • ProducerExperiences
  • cs

SecureInterfaceService.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using com.microsoft.Samples.SecureInterface;
00013 using SDKTemplate;
00014 using System;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.AllJoyn;
00017 using Windows.Foundation;
00018
00019 namespace AllJoynProducerExperiences
00020 {
00021     /// <summary>
00022     /// The implementation of ISecureInterfaceService that will handle the concatenation method calls.
00023     /// </summary>
00024     class SecureInterfaceService : ISecureInterfaceService
00025     {
00026         // Method to handle calls to the Concatenate method.
00027         public IAsyncOperation<SecureInterfaceConcatenateResult> ConcatenateAsync(AllJoynMessageInfo info, string inStr1, string inStr2)
00028         {
00029             IAsyncAction asyncAction = MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00030             {
00031                 MainPage.Current.NotifyUser(string.Format("Concatenation request recieved for \"{0}\" and \"{1}\".", inStr1, inStr2), NotifyType.StatusMessage);
00032             });
00033
00034             Task<SecureInterfaceConcatenateResult> task = new Task<SecureInterfaceConcatenateResult>(() =>
00035             {
00036                 if (AppData.IsUpperCaseEnabled)
00037                 {
00038                     inStr1 = inStr1.ToUpper();
00039                     inStr2 = inStr2.ToUpper();
00040                 }
00041                 return SecureInterfaceConcatenateResult.CreateSuccessResult(inStr1 + inStr2);
00042             });
00043
00044             task.Start();
00045             return task.AsAsyncOperation();
00046         }
00047
00048         // Method to handle requests for the value of the IsUpperCaseEnabled property.
00049         public IAsyncOperation<SecureInterfaceGetIsUpperCaseEnabledResult> GetIsUpperCaseEnabledAsync(AllJoynMessageInfo info)
00050         {
00051             Task<SecureInterfaceGetIsUpperCaseEnabledResult> task = new Task<SecureInterfaceGetIsUpperCaseEnabledResult>(() =>
00052             {
00053                 return SecureInterfaceGetIsUpperCaseEnabledResult.CreateSuccessResult(AppData.IsUpperCaseEnabled);
00054             });
00055
00056             task.Start();
00057             return task.AsAsyncOperation();
00058         }
00059
00060         // Method to handle requests to set the IsUpperCaseEnabled property.
00061         public IAsyncOperation<SecureInterfaceSetIsUpperCaseEnabledResult> SetIsUpperCaseEnabledAsync(AllJoynMessageInfo info, bool value)
00062         {
00063             Task<SecureInterfaceSetIsUpperCaseEnabledResult> task = new Task<SecureInterfaceSetIsUpperCaseEnabledResult>(() =>
00064             {
00065                 AppData.IsUpperCaseEnabled = value;
00066                 return SecureInterfaceSetIsUpperCaseEnabledResult.CreateSuccessResult();
00067             });
00068
00069             task.Start();
00070             return task.AsAsyncOperation();
00071         }
00072     }
00073 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario4_CompactOverlay.xaml.cs Source File

  • AppWindow
  • cs

Scenario4_CompactOverlay.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.ViewManagement;
00014 using Windows.UI.WindowManagement;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Hosting;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario4_CompactOverlay : Page
00023     {
00024         private AppWindow appWindow;
00025         private Frame appWindowFrame = new Frame();
00026
00027         public Scenario4_CompactOverlay()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         protected override async void OnNavigatedFrom(NavigationEventArgs e)
00033         {
00034             if (appWindow != null)
00035             {
00036                 await appWindow.CloseAsync();
00037             }
00038         }
00039
00040         private async void ShowWindowBtn_Click(object sender, RoutedEventArgs e)
00041         {
00042             // Is CompactOverlay supported for our main window?
00043             // If so, it will be supported for a new window as well.
00044             // If it isn't, it will not be supported for new windows either so we cannot proceed.
00045             if (!ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
00046             {
00047                 return;
00048             }
00049
00050             showWindowBtn.IsEnabled = false;
00051
00052             if (appWindow == null)
00053             {
00054
00055                 // Create a new AppWindow
00056                 appWindow = await AppWindow.TryCreateAsync();
00057                 // Make sure we release the reference to this window, and release XAML resources, when it's closed
00058                 appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
00059                 // Is CompactOverlay supported for this AppWindow? If not, then stop.
00060                 if (appWindow.Presenter.IsPresentationSupported(AppWindowPresentationKind.CompactOverlay))
00061                 {
00062                     // Create a new frame for the window
00063                     // Navigate the frame to the CompactOverlay page inside it.
00064                     appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
00065                     // Attach the frame to the window
00066                     ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
00067                     // Let's set the title so that we can tell the windows apart
00068                     appWindow.Title = "CompactOverlay Window";
00069                     // Request the Presentation of the window to CompactOverlay
00070                     bool switched = appWindow.Presenter.RequestPresentation(AppWindowPresentationKind.CompactOverlay);
00071                     if (switched)
00072                     {
00073                         // If the request was satisfied, show the window
00074                         await appWindow.TryShowAsync();
00075                     }
00076                 }
00077             }
00078             else
00079             {
00080                 await appWindow.TryShowAsync();
00081             }
00082
00083             showWindowBtn.IsEnabled = true;
00084         }
00085     }
00086 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/pch.cpp Source File

  • ProximitySensor
  • cpp
  • Tasks

pch.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario3.xaml.cs Source File

  • ApplicationResources
  • cs

scenario3.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016 using Windows.ApplicationModel.Resources;
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     public sealed partial class Scenario3 : Page
00024     {
00025         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00026         // as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         public Scenario3()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when this page is about to be displayed in a Frame.
00036         /// </summary>
00037         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00038         /// property is typically used to configure the page.</param>
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             this.Scenario3TextBlock.Text = "";
00042         }
00043
00044         /// <summary>
00045         /// This is the click handler for the 'Scenario3Button_Show' button.  You would replace this with your own handler
00046         /// if you have a button or buttons on this page.
00047         /// </summary>
00048         /// <param name="sender"></param>
00049         /// <param name="e"></param>
00050         private void Scenario3Button_Show_Click(object sender, RoutedEventArgs e)
00051         {
00052             Button b = sender as Button;
00053             if (b != null)
00054             {
00055                 var resourceLoader = ResourceLoader.GetForCurrentView();
00056                 this.Scenario3TextBlock.Text = resourceLoader.GetString("string1");
00057             }
00058         }
00059     }
00060 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_IsSupported Member List

This is the complete list of members for Scenario5_IsSupported, including all inherited members.
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario5_IsSupported
Scenario5_IsSupported() | Scenario5_IsSupported
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • Geolocation
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BackgroundTask")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BackgroundTask")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.h Source File

  • HttpClient
  • cppwinrt

Scenario07_PostStreamWithProgress.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario07_PostStreamWithProgress.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario07_PostStreamWithProgress : Scenario07_PostStreamWithProgressT<Scenario07_PostStreamWithProgress>
00020     {
00021         Scenario07_PostStreamWithProgress();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         void ChunkedResponseToggle_Toggled(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         fire_and_forget Start_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void Cancel_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029
00030     private:
00031         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00032         Windows::Web::Http::HttpClient httpClient{ nullptr };
00033         Windows::Foundation::IAsyncAction pendingAction{ nullptr };
00034
00035         void UpdateAddressField();
00036         void ResetFields();
00037
00038         Windows::Foundation::IAsyncAction CancelableRequestAsync(
00039             Windows::Foundation::Uri resourceUri,
00040             Windows::Web::Http::IHttpContent content);
00041         fire_and_forget ProgressHandler(
00042             Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpRequestResult, Windows::Web::Http::HttpProgress> const& sender,
00043             Windows::Web::Http::HttpProgress progress);
00044     };
00045 }
00046
00047 namespace winrt::SDKTemplate::factory_implementation
00048 {
00049     struct Scenario07_PostStreamWithProgress : Scenario07_PostStreamWithProgressT<Scenario07_PostStreamWithProgress, implementation::Scenario07_PostStreamWithProgress>
00050     {
00051     };
00052 }
Generated on Fri Nov 15 2024 22:19:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/Scenario3_StartDragAsync.xaml.h Source File

  • XamlDragAndDrop
  • cpp

Scenario3_StartDragAsync.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_StartDragAsync.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario3_StartDragAsync sealed
00024     {
00025     public:
00026         Scenario3_StartDragAsync();
00027
00028     private:
00029         MainPage^ rootPage;
00030
00031         std::mt19937 _rnd;
00032         // Collection of symbols to display and drag
00033         Platform::Collections::Vector<Platform::String^>^ _symbols;
00034         // Is a round running
00035         bool _isActive;
00036         // Keeping the Drag operation will allow to cancel it after it has started
00037         Windows::Foundation::IAsyncOperation<Windows::ApplicationModel::DataTransfer::DataPackageOperation>^ _dragOperation;
00038         // Symbol to drag
00039         Platform::String^ _symbol;
00040         // Timer limiting the time allowed to drag the symbol to the right target
00041         Windows::UI::Xaml::DispatcherTimer^ _timer;
00042
00043         void DragCompleted(Windows::Foundation::IAsyncOperation<Windows::ApplicationModel::DataTransfer::DataPackageOperation>^ asyncInfo,
00044                            Windows::Foundation::AsyncStatus asyncStatus);
00045         void SourceTextBlock_PointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00046         void SourceTextBlock_DragStarting(Windows::UI::Xaml::UIElement^ sender, Windows::UI::Xaml::DragStartingEventArgs^ args);
00047
00048         void DropBorder_DragEnter(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00049         void DropBorder_Drop(Platform::Object^ sender, Windows::UI::Xaml::DragEventArgs^ e);
00050
00051         bool IsTargetBorder(Platform::Object^ sender);
00052         void StartButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00053         void OnTick(Platform::Object ^sender, Platform::Object ^args);
00054
00055         void EndRound(bool hasWon);
00056     };
00057 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SettingsService Member List

This is the complete list of members for SettingsService, including all inherited members.
instance | SettingsService | [private, static]
Instance | SettingsService | [static]
settings | SettingsService | [private]
ToastOnAppEvents | SettingsService |
ToastOnAppEventsKey | SettingsService | [private]
UseCustomControls | SettingsService |
UseCustomControlsChanged | SettingsService |
UseCustomControlsKey | SettingsService | [private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IoSyncBackgroundTask Member List

This is the complete list of members for IoSyncBackgroundTask, including all inherited members.
backgroundTaskInstance | IoSyncBackgroundTask | [private]
cancellationTokenSource | IoSyncBackgroundTask | [private]
deferral | IoSyncBackgroundTask | [private]
device | IoSyncBackgroundTask | [private]
deviceSyncDetails | IoSyncBackgroundTask | [private]
Dispose() | IoSyncBackgroundTask | [inline]
OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) | IoSyncBackgroundTask | [inline, private]
OpenDevice() | IoSyncBackgroundTask | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | IoSyncBackgroundTask | [inline]
WriteToDeviceAsync() | IoSyncBackgroundTask | [inline, private]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/pch.cpp Source File

  • NumberFormatting
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/SampleConfiguration.cs Source File

  • RadialController
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "RadialController C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Event And Menu Hookup", ClassType=typeof(Scenario1_EventAndMenuHookup)},
00025             new Scenario() { Title="Modifying System Default Menu", ClassType=typeof(Scenario2_SystemDefaultMenu)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
StartProjecting_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
thisViewId | Scenario1 | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.cpp Source File

  • SecondaryTiles
  • cppwinrt

Scenario6_SecondaryTileNotification.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_SecondaryTileNotification.h"
00014 #include "Scenario6_SecondaryTileNotification.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace NotificationsExtensions;
00019 using namespace NotificationsExtensions::Badges;
00020 using namespace NotificationsExtensions::Tiles;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::UI::Notifications;
00023 using namespace Windows::UI::StartScreen;
00024 using namespace Windows::UI::Xaml;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario6_SecondaryTileNotification::Scenario6_SecondaryTileNotification()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     bool Scenario6_SecondaryTileNotification::VerifyTileIsPinned()
00034     {
00035         if (SecondaryTile::Exists(SampleHelpers::DynamicTileId))
00036         {
00037             return true;
00038         }
00039         rootPage.NotifyUser(hstring(SampleHelpers::DynamicTileId) + L" is not pinned.", NotifyType::ErrorMessage);
00040         return false;
00041     }
00042
00043     fire_and_forget Scenario6_SecondaryTileNotification::PinLiveTile_Click(IInspectable sender, RoutedEventArgs const&)
00044     {
00045         auto lifetime = get_strong();
00046
00047         // Prepare the images for our tile to be pinned.
00048         Uri square150x150Logo(L"ms-appx:///Assets/square150x150Tile-sdk.png");
00049         Uri wide310x150Logo(L"ms-appx:///Assets/wide310x150Tile-sdk.png");
00050
00051         // During creation of the secondary tile, an application may set additional arguments on the tile that will be passed in during activation.
00052         // These arguments should be meaningful to the application. In this sample, we'll pass in the date and time the secondary tile was pinned.
00053         hstring tileActivationArguments = hstring(SampleHelpers::DynamicTileId) + L" WasPinnedAt=" + SampleHelpers::CurrentTimeAsString();
00054
00055         // Create a Secondary tile with all the required properties and sets perfered size to Wide310x150.
00056         SecondaryTile secondaryTile(SampleHelpers::DynamicTileId,
00057             L"A Live Secondary Tile",
00058             tileActivationArguments,
00059             square150x150Logo,
00060             TileSize::Wide310x150);
00061
00062         // Adding the wide tile logo.
00063         secondaryTile.VisualElements().Wide310x150Logo(wide310x150Logo);
00064
00065         // The display of the app name can be controlled for each tile size.
00066         secondaryTile.VisualElements().ShowNameOnSquare150x150Logo(true);
00067         secondaryTile.VisualElements().ShowNameOnWide310x150Logo(true);
00068
00069         // Specify a foreground text value.
00070         // The tile background color is inherited from the parent unless a separate value is specified.
00071         secondaryTile.VisualElements().ForegroundText(ForegroundText::Dark);
00072
00073         // OK, the tile is created and we can now attempt to pin the tile.
00074         // Note that the status message is updated when the async operation to pin the tile completes.
00075         bool isPinned = co_await secondaryTile.RequestCreateForSelectionAsync(SampleHelpers::GetElementRect(sender), Windows::UI::Popups::Placement::Below);
00076         if (isPinned)
00077         {
00078             rootPage.NotifyUser(L"Secondary tile successfully pinned.", NotifyType::StatusMessage);
00079         }
00080         else
00081         {
00082             rootPage.NotifyUser(L"Secondary tile not pinned.", NotifyType::ErrorMessage);
00083         }
00084     }
00085
00086     void Scenario6_SecondaryTileNotification::SendTileNotification_Click(IInspectable const&, RoutedEventArgs const&)
00087     {
00088         if (VerifyTileIsPinned())
00089         {
00090             AdaptiveText adaptiveText;
00091             adaptiveText.Text(L"Sent to a secondary tile from NotificationsExtensions!");
00092             adaptiveText.HintWrap(true);
00093             TileBindingContentAdaptive contentAdaptive;
00094             contentAdaptive.Children().Append(adaptiveText);
00095             TileBinding tileBinding;
00096             tileBinding.Content(contentAdaptive);
00097             TileVisual tileVisual;
00098             tileVisual.TileWide(tileBinding);
00099             TileContent tileContent;
00100             tileContent.Visual(tileVisual);
00101             // Send the notification to the secondary tile by creating a secondary tile updater
00102             TileUpdateManager::CreateTileUpdaterForSecondaryTile(SampleHelpers::DynamicTileId).Update(TileNotification(tileContent.GetXml()));
00103
00104             rootPage.NotifyUser(L"Tile notification sent to " + hstring(SampleHelpers::DynamicTileId), NotifyType::StatusMessage);
00105         }
00106     }
00107
00108     void Scenario6_SecondaryTileNotification::SendBadgeNotification_Click(IInspectable const&, RoutedEventArgs const&)
00109     {
00110         if (VerifyTileIsPinned())
00111         {
00112             BadgeNumericNotificationContent badgeContent(6);
00113
00114             // Send the notification to the secondary tile
00115             BadgeUpdateManager::CreateBadgeUpdaterForSecondaryTile(SampleHelpers::DynamicTileId).Update(BadgeNotification(badgeContent.GetXml()));
00116
00117             rootPage.NotifyUser(L"Badge notification sent to " + hstring(SampleHelpers::DynamicTileId), NotifyType::StatusMessage);
00118         }
00119     }
00120
00121     void Scenario6_SecondaryTileNotification::SendTileNotificationWithStringManipulation_Click(IInspectable const&, RoutedEventArgs const&)
00122     {
00123         if (VerifyTileIsPinned())
00124         {
00125             static constexpr wchar_t tileXmlString[] = L"<tile>"
00126                 L"<visual version='2'>"
00127                 L"<binding template='TileWide310x150Text04' fallback='TileWideText04'>"
00128                 L"<text id='1'>Send to a secondary tile from strings</text>"
00129                 L"</binding>"
00130                 L"<binding template='TileSquare150x150Text04' fallback='TileSquareText04'>"
00131                 L"<text id='1'>Send to a secondary tile from strings</text>"
00132                 L"</binding>"
00133                 L"</visual>"
00134                 L"</tile>";
00135
00136             Windows::Data::Xml::Dom::XmlDocument tileDOM;
00137             tileDOM.LoadXml(tileXmlString);
00138             TileNotification tile(tileDOM);
00139
00140             // Send the notification to the secondary tile by creating a secondary tile updater
00141             TileUpdateManager::CreateTileUpdaterForSecondaryTile(SampleHelpers::DynamicTileId).Update(tile);
00142
00143             rootPage.NotifyUser(L"Tile notification sent to " + hstring(SampleHelpers::DynamicTileId), NotifyType::StatusMessage);
00144         }
00145     }
00146
00147     void Scenario6_SecondaryTileNotification::SendBadgeNotificationWithStringManipulation_Click(IInspectable const&, RoutedEventArgs const&)
00148     {
00149         if (VerifyTileIsPinned())
00150         {
00151             static constexpr wchar_t badgeXmlString[] = L"<badge value='9'/>";
00152             Windows::Data::Xml::Dom::XmlDocument badgeDOM;
00153             badgeDOM.LoadXml(badgeXmlString);
00154             BadgeNotification badge(badgeDOM);
00155
00156             // Send the notification to the secondary tile
00157             BadgeUpdateManager::CreateBadgeUpdaterForSecondaryTile(SampleHelpers::DynamicTileId).Update(badge);
00158
00159             rootPage.NotifyUser(L"Badge notification sent to " + hstring(SampleHelpers::DynamicTileId), NotifyType::StatusMessage);
00160         }
00161     }
00162 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
Close_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
DisplayImageFileAsync(StorageFile file) | Scenario2 | [inline, private]
GetImageInformationAsync(StorageFile file) | Scenario2 | [inline, private]
LoadFileAsync(StorageFile file) | Scenario2 | [inline, private]
LoadSaveFileAsync(StorageFile outputFile) | Scenario2 | [inline, private]
m_disableExifOrientation | Scenario2 | [private]
m_displayHeightNonScaled | Scenario2 | [private]
m_displayWidthNonScaled | Scenario2 | [private]
m_exifOrientation | Scenario2 | [private]
m_fileToken | Scenario2 | [private]
m_futureAccess | Scenario2 | [private]
m_localSettings | Scenario2 | [private]
m_scaleFactor | Scenario2 | [private]
m_transform | Scenario2 | [private]
m_userRotation | Scenario2 | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
Open_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
ResetPersistedState() | Scenario2 | [inline, private]
ResetSessionState() | Scenario2 | [inline, private]
RestoreDataFromPersistedState() | Scenario2 | [inline, private]
rootPage | Scenario2 | [private]
RotateLeft_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
RotateRight_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
Save_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
SaveAs_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
SaveDataToPersistedState(object sender, SuspendingEventArgs args) | Scenario2 | [inline, private]
ScaleSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e) | Scenario2 | [inline, private]
Scenario2() | Scenario2 | [inline]
UpdateImageDimensionsUI() | Scenario2 | [inline, private]
UpdateImageRotation(PhotoOrientation rotation) | Scenario2 | [inline, private]
WINCODEC_ERR_COMPONENTNOTFOUND | Scenario2 | [private]
WINCODEC_ERR_PROPERTYNOTSUPPORTED | Scenario2 | [private]
WINCODEC_ERR_UNSUPPORTEDOPERATION | Scenario2 | [private]
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Transliteration Member List

This is the complete list of members for Scenario3_Transliteration, including all inherited members.
Go_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_Transliteration
Scenario3_Transliteration() | Scenario3_Transliteration
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cs/Scenario4.xaml.cs Source File

  • FileThumbnails
  • cs

Scenario4.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Storage;
00014 using Windows.Storage.FileProperties;
00015 using Windows.Storage.Pickers;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario4 : Page
00023     {
00024         MainPage rootPage = MainPage.Current;
00025
00026         public Scenario4()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
00034         }
00035
00036         private async void GetThumbnailButton_Click(object sender, RoutedEventArgs e)
00037         {
00038             rootPage.ResetOutput(ThumbnailImage, OutputTextBlock);
00039
00040             // Pick a folder
00041             FolderPicker folderPicker = new FolderPicker();
00042             foreach (string extension in FileExtensions.Image)
00043             {
00044                 folderPicker.FileTypeFilter.Add(extension);
00045             }
00046
00047             StorageFolder folder = await folderPicker.PickSingleFolderAsync();
00048             if (folder != null)
00049             {
00050                 const ThumbnailMode thumbnailMode = ThumbnailMode.PicturesView;
00051                 const uint size = 200;
00052                 using (StorageItemThumbnail thumbnail = await folder.GetThumbnailAsync(thumbnailMode, size))
00053                 {
00054                     if (thumbnail != null)
00055                     {
00056                         MainPage.DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailMode.ToString(), size, folder, thumbnail, false);
00057                     }
00058                     else
00059                     {
00060                         rootPage.NotifyUser(Errors.NoImages, NotifyType.StatusMessage);
00061                     }
00062                 }
00063             }
00064             else
00065             {
00066                 rootPage.NotifyUser(Errors.Cancel, NotifyType.StatusMessage);
00067             }
00068         }
00069     }
00070 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/VeryObservableCollection.cs Source File

  • XamlBind
  • cs
  • xBindSampleModel

VeryObservableCollection.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections;
00003 using System.Collections.Generic;
00004 using System.Collections.ObjectModel;
00005 using System.Collections.Specialized;
00006 using System.Linq;
00007 using System.Text;
00008 using System.Threading.Tasks;
00009 using Windows.Foundation.Collections;
00010
00011 namespace BindTestbedModel
00012 {
00013     internal class VeryObservableCollection<T> : INotifyCollectionChanged, IList<T>, Windows.Foundation.Collections.IObservableVector<T>, IList
00014     {
00015         private ObservableCollection<T> data;
00016
00017         public VeryObservableCollection()
00018         {
00019             data = new ObservableCollection<T>();
00020             data.CollectionChanged += Data_CollectionChanged;
00021         }
00022
00023         #region NotifyCollectionChanged
00024
00025         public event VectorChangedEventHandler<T> VectorChanged;
00026
00027         public event NotifyCollectionChangedEventHandler CollectionChanged;
00028
00029         private void Data_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
00030         {
00031             if (VectorChanged != null)
00032             {
00033                 VectorChangedEventAgrs args = new VectorChangedEventAgrs();
00034                 args.CollectionChange = CollectionChange.Reset;
00035                 VectorChanged(this, args);
00036             }
00037
00038             if (CollectionChanged != null)
00039             {
00040                 CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
00041                 CollectionChanged(this, e);
00042             }
00043         }
00044
00045         #endregion
00046         #region IList<T>
00047
00048         public T this[int index]
00049         {
00050             get { return data[index]; }
00051             set { data[index] = value; }
00052         }
00053
00054         public int Count { get { return data.Count; } }
00055
00056         public bool IsReadOnly
00057         {
00058             get
00059             {
00060                 throw new NotImplementedException();
00061             }
00062         }
00063
00064         public void Add(T item)
00065         {
00066             data.Add(item);
00067         }
00068
00069         public void Clear()
00070         {
00071             data.Clear();
00072         }
00073
00074         public bool Contains(T item)
00075         {
00076             return data.Contains(item);
00077         }
00078
00079         public void CopyTo(T[] array, int arrayIndex)
00080         {
00081             data.CopyTo(array, arrayIndex);
00082         }
00083
00084         public IEnumerator<T> GetEnumerator()
00085         {
00086             return data.GetEnumerator();
00087         }
00088
00089         public int IndexOf(T item)
00090         {
00091             return data.IndexOf(item);
00092         }
00093
00094         public void Insert(int index, T item)
00095         {
00096             data.Insert(index, item);
00097         }
00098
00099         public bool Remove(T item)
00100         {
00101             return data.Remove(item);
00102         }
00103
00104         public void RemoveAt(int index)
00105         {
00106             data.RemoveAt(index);
00107         }
00108
00109         IEnumerator IEnumerable.GetEnumerator()
00110         {
00111             return data.GetEnumerator();
00112         }
00113         #endregion
00114         #region IList
00115
00116         bool IList.IsFixedSize { get { return false; } }
00117
00118         bool IList.IsReadOnly { get { return false; } }
00119
00120         int ICollection.Count { get { return data.Count; } }
00121         bool ICollection.IsSynchronized { get { return false; } }
00122
00123         object ICollection.SyncRoot { get { throw new NotImplementedException(); } }
00124
00125         object IList.this[int index]
00126         {
00127             get { return data[index]; }
00128             set { data[index] = (T)value; }
00129         }
00130         int IList.Add(object item)
00131         {
00132             data.Add((T)item);
00133             return data.Count;
00134         }
00135
00136         bool IList.Contains(object item) { return data.Contains((T)item); }
00137
00138         int IList.IndexOf(object item) { return data.IndexOf((T)item); }
00139
00140
00141         void IList.Insert(int index, object item)
00142         {
00143             data.Insert(index, (T)item);
00144         }
00145
00146         void IList.Remove(object item)
00147         {
00148             data.Remove((T)item);
00149         }
00150         void IList.Clear()
00151         {
00152             data.Clear();
00153         }
00154
00155         void IList.RemoveAt(int index)
00156         {
00157             data.RemoveAt(index);
00158         }
00159
00160         void ICollection.CopyTo(Array dest, int index)
00161         {
00162             data.CopyTo((T[])dest, index);
00163         }
00164         #endregion
00165            }
00166 }
00167
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario1_Files.cpp Source File

  • ApplicationData
  • cppwinrt

Scenario1_Files.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Files.h"
00014 #include "Scenario1_Files.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Storage;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_Files::Scenario1_Files()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     // Guidance for Local, LocalCache, and Temporary files.
00030     //
00031     // Files are ideal for storing large data-sets, databases, or data that is
00032     // in a common file-format.
00033     //
00034     // Files can exist in either the Local, LocalCache, or Temporary folders.
00035     // (They can also be put in Roaming folders, but the data no longer roams.)
00036     //
00037     // Local files are not synchronized, but they are backed up, and can then be restored to a
00038     // machine different than where they were originally written. These should be for
00039     // important files that allow the feel that the user did not lose anything
00040     // when they restored to a new device.
00041     //
00042     // Temporary files are subject to deletion when not in use.  The system
00043     // considers factors such as available disk capacity and the age of a file when
00044     // determining when or whether to delete a temporary file.
00045     //
00046     // LocalCache files are for larger files that can be recreated by the app, and for
00047     // machine specific or private files that should not be restored to a new device.
00048
00049     fire_and_forget Scenario1_Files::Increment_Local_Click(IInspectable const&, RoutedEventArgs const&)
00050     {
00051         auto strong = get_strong();
00052
00053         localCounter++;
00054
00055         StorageFile file = co_await localFolder.CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting);
00056         co_await FileIO::WriteTextAsync(file, std::to_wstring(localCounter));
00057
00058         Read_Local_Counter();
00059     }
00060
00061     fire_and_forget Scenario1_Files::Read_Local_Counter()
00062     {
00063         auto strong = get_strong();
00064
00065         StorageFile file = (co_await localFolder.TryGetItemAsync(filename)).as<StorageFile>();
00066         if (file != nullptr)
00067         {
00068             hstring text = co_await FileIO::ReadTextAsync(file);
00069
00070             LocalOutputTextBlock().Text(L"Local Counter: " + text);
00071
00072             localCounter = wcstol(text.c_str(), nullptr, 10);
00073         }
00074         else
00075         {
00076             LocalOutputTextBlock().Text(L"Local Counter: <not found>");
00077         }
00078     }
00079
00080     fire_and_forget Scenario1_Files::Increment_LocalCache_Click(IInspectable const&, RoutedEventArgs const&)
00081     {
00082         auto strong = get_strong();
00083         localCacheCounter++;
00084
00085         StorageFile file = co_await localCacheFolder.CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting);
00086         co_await FileIO::WriteTextAsync(file, std::to_wstring(localCacheCounter));
00087
00088         Read_LocalCache_Counter();
00089     }
00090
00091     fire_and_forget Scenario1_Files::Read_LocalCache_Counter()
00092     {
00093         auto strong = get_strong();
00094
00095         StorageFile file = (co_await localCacheFolder.TryGetItemAsync(filename)).as<StorageFile>();
00096         if (file != nullptr)
00097         {
00098             hstring text = co_await FileIO::ReadTextAsync(file);
00099
00100             LocalCacheOutputTextBlock().Text(L"LocalCache Counter: " + text);
00101
00102             localCacheCounter = wcstol(text.c_str(), nullptr, 10);
00103         }
00104         else
00105         {
00106             LocalCacheOutputTextBlock().Text(L"LocalCache Counter: <not found>");
00107         }
00108     }
00109
00110     fire_and_forget Scenario1_Files::Increment_Temporary_Click(IInspectable const&, RoutedEventArgs const&)
00111     {
00112         auto strong = get_strong();
00113         temporaryCounter++;
00114
00115         StorageFile file = co_await temporaryFolder.CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting);
00116         co_await FileIO::WriteTextAsync(file, std::to_wstring(temporaryCounter));
00117
00118         Read_Temporary_Counter();
00119     }
00120
00121     fire_and_forget Scenario1_Files::Read_Temporary_Counter()
00122     {
00123         StorageFile file = (co_await temporaryFolder.TryGetItemAsync(filename)).as<StorageFile>();
00124         if (file != nullptr)
00125         {
00126             hstring text = co_await FileIO::ReadTextAsync(file);
00127
00128             TemporaryOutputTextBlock().Text(L"Temporary Counter: " + text);
00129
00130             temporaryCounter = wcstol(text.c_str(), nullptr, 10);
00131         }
00132         else
00133         {
00134             TemporaryOutputTextBlock().Text(L"Temporary Counter: <not found>");
00135         }
00136     }
00137
00138     void Scenario1_Files::DisplayOutput()
00139     {
00140         Read_Local_Counter();
00141         Read_LocalCache_Counter();
00142         Read_Temporary_Counter();
00143     }
00144
00145     void Scenario1_Files::OnNavigatedTo(NavigationEventArgs const&)
00146     {
00147         DisplayOutput();
00148     }
00149 }
00150
Generated on Fri Nov 15 2024 22:17:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/S3_RemoveFolder.xaml.cpp Source File

  • LibraryManagement
  • cpp

S3_RemoveFolder.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.cpp
00014 // Implementation of the Scenario3 class
00015 //
00016
00017 #include "pch.h"
00018 #include "S3_RemoveFolder.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace concurrency;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Storage;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029
00030 Scenario3::Scenario3()
00031 {
00032     InitializeComponent();
00033     GetPicturesLibrary();
00034 }
00035
00036 /// <summary>
00037 /// Requests the user's permission to remove the selected location from the Pictures library.
00038 /// </summary>
00039 /// <param name="sender"></param>
00040 /// <param name="e"></param>
00041 void Scenario3::RemoveFolderButton_Click(Platform::Object^ /*sender*/, Windows::UI::Xaml::RoutedEventArgs^ /*e*/)
00042 {
00043     auto folderToRemove = safe_cast<StorageFolder^>(FoldersComboBox->SelectedItem);
00044     create_task(picturesLibrary->RequestRemoveFolderAsync(folderToRemove)).then([this, folderToRemove](bool folderRemoved)
00045     {
00046         if (folderRemoved)
00047         {
00048             OutputTextBlock->Text = folderToRemove->DisplayName + " was removed from the Pictures library.";
00049         }
00050         else
00051         {
00052             OutputTextBlock->Text = "Operation canceled.";
00053         }
00054     });
00055 }
00056
00057 /// <summary>
00058 /// Gets the Pictures library and sets up the FoldersComboBox to list its folders.
00059 /// </summary>
00060 void Scenario3::GetPicturesLibrary()
00061 {
00062     create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Pictures)).then([this](StorageLibrary^ library)
00063     {
00064         picturesLibrary = library;
00065
00066         // Bind the ComboBox to the list of folders currently in the library
00067         FoldersComboBox->ItemsSource = picturesLibrary->Folders;
00068
00069         // Update the states of our controls when the list of folders changes
00070         picturesLibrary->DefinitionChanged += ref new TypedEventHandler<StorageLibrary^, Platform::Object^>(
00071             [this](StorageLibrary^ /*sender*/, Platform::Object^ /*e*/)
00072         {
00073             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00074             {
00075                 UpdateControls();
00076             }));
00077         });
00078
00079         UpdateControls();
00080     });
00081 }
00082
00083 /// <summary>
00084 // Fills the ComboBox control with the folders that make up the Pictures library.
00085 /// </summary>
00086 void Scenario3::FillComboBox()
00087 {
00088     FoldersComboBox->ItemsSource = nullptr;
00089     FoldersComboBox->ItemsSource = picturesLibrary->Folders;
00090 }
00091
00092 /// <summary>
00093 /// Updates the Visibility and IsEnabled properties of UI controls that depend upon the Pictures library
00094 /// having at least one folder in its Folders list.
00095 /// </summary>
00096 void Scenario3::UpdateControls()
00097 {
00098     FillComboBox();
00099     bool libraryHasFolders = (picturesLibrary->Folders->Size > 0);
00100     FoldersComboBox->SelectedIndex = libraryHasFolders ? 0 : -1;
00101     FoldersComboBox->Visibility = libraryHasFolders ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00102     LibraryEmptyTextBlock->Visibility = libraryHasFolders ? Windows::UI::Xaml::Visibility::Collapsed : Windows::UI::Xaml::Visibility::Visible;
00103     RemoveFolderButton->IsEnabled = libraryHasFolders;
00104 }
Generated on Fri Nov 15 2024 22:20:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/MainPage.xaml.cs Source File

  • LiveDash
  • cs
  • LiveDashApp

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Data;
00017 using Windows.UI.Xaml.Media;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class MainPage : Page
00028     {
00029         public static MainPage Current;
00030
00031         public MainPage()
00032         {
00033             this.InitializeComponent();
00034
00035             // This is a static public property that allows downstream pages to get a handle to the MainPage instance
00036             // in order to call methods that are in this class.
00037             Current = this;
00038             SampleTitle.Text = FEATURE_NAME;
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             // Populate the scenario list from the SampleConfiguration.cs file
00044             ScenarioControl.ItemsSource = scenarios;
00045             if (Window.Current.Bounds.Width < 640)
00046             {
00047                 ScenarioControl.SelectedIndex = -1;
00048             }
00049             else
00050             {
00051                 ScenarioControl.SelectedIndex = 0;
00052             }
00053         }
00054
00055         /// <summary>
00056         /// Called whenever the user changes selection in the scenarios list.  This method will navigate to the respective
00057         /// sample scenario page.
00058         /// </summary>
00059         /// <param name="sender"></param>
00060         /// <param name="e"></param>
00061         private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
00062         {
00063             // Clear the status block when navigating scenarios.
00064             NotifyUser(String.Empty, NotifyType.StatusMessage);
00065
00066             ListBox scenarioListBox = sender as ListBox;
00067             Scenario s = scenarioListBox.SelectedItem as Scenario;
00068             if (s != null)
00069             {
00070                 ScenarioFrame.Navigate(s.ClassType);
00071                 if (Window.Current.Bounds.Width < 640)
00072                 {
00073                     Splitter.IsPaneOpen = false;
00074                     StatusBorder.Visibility = Visibility.Collapsed;
00075                 }
00076             }
00077         }
00078
00079         public List<Scenario> Scenarios
00080         {
00081             get { return this.scenarios; }
00082         }
00083
00084         /// <summary>
00085         /// Used to display messages to the user
00086         /// </summary>
00087         /// <param name="strMessage"></param>
00088         /// <param name="type"></param>
00089         public void NotifyUser(string strMessage, NotifyType type)
00090         {
00091             switch (type)
00092             {
00093                 case NotifyType.StatusMessage:
00094                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
00095                     break;
00096                 case NotifyType.ErrorMessage:
00097                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
00098                     break;
00099             }
00100             StatusBlock.Text = strMessage;
00101
00102             // Collapse the StatusBlock if it has no text to conserve real estate.
00103             StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
00104         }
00105
00106         async void Footer_Click(object sender, RoutedEventArgs e)
00107         {
00108             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00109         }
00110
00111         private void Button_Click(object sender, RoutedEventArgs e)
00112         {
00113             Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
00114             StatusBorder.Visibility = Visibility.Collapsed;
00115         }
00116     }
00117     public enum NotifyType
00118     {
00119         StatusMessage,
00120         ErrorMessage
00121     };
00122
00123     public class ScenarioBindingConverter : IValueConverter
00124     {
00125         public object Convert(object value, Type targetType, object parameter, string language)
00126         {
00127             Scenario s = value as Scenario;
00128             return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
00129         }
00130
00131         public object ConvertBack(object value, Type targetType, object parameter, string language)
00132         {
00133             return true;
00134         }
00135     }
00136 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario2_DeviceWatcher.xaml.h Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario2_DeviceWatcher.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario2_DeviceWatcher.g.h"
00006 #include "MainPage.xaml.h"
00007 #include "DisplayHelpers.h"
00008 #include "DeviceWatcherHelper.h"
00009
00010 namespace SDKTemplate
00011 {
00012     [Windows::Foundation::Metadata::WebHostHidden]
00013     public ref class Scenario2_DeviceWatcher sealed
00014     {
00015     public:
00016         Scenario2_DeviceWatcher();
00017
00018     protected:
00019         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00020         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00021
00022     private:
00023         void StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024         void StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00025
00026         void StartWatcher();
00027         void StopWatcher();
00028
00029         MainPage^ rootPage = MainPage::Current;
00030         Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>();
00031         DeviceWatcherHelper^ deviceWatcherHelper;
00032     };
00033 }
Generated on Fri Nov 15 2024 22:19:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Project.idl Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [Windows.UI.Xaml.Data.Bindable]
00015     runtimeclass DeviceSelectorInfo
00016     {
00017         String DisplayName{ get; };
00018     };
00019
00020     [Windows.UI.Xaml.Data.Bindable]
00021     runtimeclass DeviceInformationKindChoice
00022     {
00023         String DisplayName{ get; };
00024     };
00025
00026     [Windows.UI.Xaml.Data.Bindable]
00027     runtimeclass ProtectionLevelSelectorInfo
00028     {
00029         String DisplayName{ get; };
00030     };
00031
00032     [Windows.UI.Xaml.Data.Bindable]
00033     runtimeclass DeviceInformationDisplay : Windows.UI.Xaml.Data.INotifyPropertyChanged
00034     {
00035         String Id{ get; };
00036         Windows.Devices.Enumeration.DeviceInformationKind Kind{ get; };
00037         String Name{ get; };
00038         Windows.UI.Xaml.Media.Imaging.BitmapImage GlyphBitmapImage{ get; };
00039         Boolean CanPair{ get; };
00040         Boolean IsPaired{ get; };
00041         IMapView<String, Object> Properties{ get; };
00042         String GetPropertyForDisplay(String key);
00043     };
00044
00045     [default_interface]
00046     runtimeclass Scenario1_DevicePicker : Windows.UI.Xaml.Controls.Page
00047     {
00048         Scenario1_DevicePicker();
00049     }
00050
00051     [default_interface]
00052     runtimeclass Scenario2_DeviceWatcher : Windows.UI.Xaml.Controls.Page
00053     {
00054         Scenario2_DeviceWatcher();
00055     }
00056
00057     [default_interface]
00058     runtimeclass Scenario3_BackgroundDeviceWatcher : Windows.UI.Xaml.Controls.Page
00059     {
00060         Scenario3_BackgroundDeviceWatcher();
00061     }
00062
00063     [default_interface]
00064     runtimeclass Scenario4_Snapshot : Windows.UI.Xaml.Controls.Page
00065     {
00066         Scenario4_Snapshot();
00067     }
00068
00069     [default_interface]
00070     runtimeclass Scenario5_GetSingleDevice : Windows.UI.Xaml.Controls.Page
00071     {
00072         Scenario5_GetSingleDevice();
00073     }
00074
00075     [default_interface]
00076     runtimeclass Scenario6_CustomFilterAddedProps : Windows.UI.Xaml.Controls.Page
00077     {
00078         Scenario6_CustomFilterAddedProps();
00079     }
00080
00081     [default_interface]
00082     runtimeclass Scenario7_DeviceInformationKind : Windows.UI.Xaml.Controls.Page
00083     {
00084         Scenario7_DeviceInformationKind();
00085     }
00086
00087     [default_interface]
00088     runtimeclass Scenario8_PairDevice : Windows.UI.Xaml.Controls.Page
00089     {
00090         Scenario8_PairDevice();
00091     }
00092
00093     [default_interface]
00094     runtimeclass Scenario9_CustomPairDevice : Windows.UI.Xaml.Controls.Page
00095     {
00096         Scenario9_CustomPairDevice();
00097     }
00098 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/SampleConfiguration.cpp Source File

  • TitleBar
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016 #include "CustomTitleBar.h"
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace SDKTemplate;
00022
00023 hstring implementation::MainPage::FEATURE_NAME()
00024 {
00025     return L"TitleBar C++/WinRT Sample";
00026 }
00027
00028 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00029 {
00030     Scenario{ L"Custom colors", xaml_typename<SDKTemplate::Scenario1_Colors>() },
00031     Scenario{ L"Custom drawing", xaml_typename<SDKTemplate::Scenario2_Extend>() },
00032 });
00033
00034 bool SampleState::areControlsInTitleBar = false;
00035 CustomTitleBar SampleState::customTitleBar{ nullptr };
00036
00037 void SampleState::AreControlsInTitleBar(bool value)
00038 {
00039     areControlsInTitleBar = value;
00040     if (customTitleBar != nullptr)
00041     {
00042         customTitleBar.EnableControlsInTitleBar(value);
00043     }
00044 }
00045
00046 void SampleState::AddCustomTitleBar()
00047 {
00048     if (customTitleBar == nullptr)
00049     {
00050         customTitleBar = make<implementation::CustomTitleBar>();
00051         customTitleBar.EnableControlsInTitleBar(areControlsInTitleBar);
00052
00053         // Make the main page's content a child of the title bar,
00054         // and make the title bar the new page content.
00055         MainPage rootPage = MainPage::Current();
00056         UIElement mainContent = rootPage.Content();
00057         rootPage.Content(nullptr);
00058         customTitleBar.SetPageContent(mainContent);
00059         rootPage.Content(customTitleBar);;
00060     }
00061 }
00062
00063 void SampleState::RemoveCustomTitleBar()
00064 {
00065     if (customTitleBar != nullptr)
00066     {
00067         // Take the title bar's page content and make it
00068         // the window content.
00069         MainPage rootPage = MainPage::Current();
00070         rootPage.Content(customTitleBar.SetPageContent(nullptr));
00071         customTitleBar = nullptr;
00072     }
00073 }
00074
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario3_UIPolicy.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario3_UIPolicy.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Security.EnterpriseData;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace EdpSample
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario3 : Page
00027     {
00028         private MainPage rootPage;
00029         string m_copyPasteScenarioText = "An enlightened application is currently showing an enterprise content amongst " +
00030                                        "a set of contents that include both enterprise and personal data belonging to " +
00031                                        "the user. To ensure that there are no data leaks from the enterprise data " +
00032                                        "the app calls TryApplyProcessUIPolicy to make sure the OS knows about the current context of the app. " +
00033                                        "The API returns false if the identity is not being managed by an enterprise policy. " +
00034                                        "Copying and then pasting of the below data to a non-enterprise app should be blocked after Pressing the TryApplyProcessUIPolicy button ";
00035         string m_clearPolicyText = " After pressing the ClearProcessUIPolicy button, copy+paste of the above data to a non-enterprise app should succeed";
00036         string m_testDataToCopy = "copy paste this to non-enterprise app";
00037
00038         public Scenario3()
00039         {
00040             this.InitializeComponent();
00041         }
00042
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045             rootPage = MainPage.Current;
00046             CopyPasteScenarioText.Text = m_copyPasteScenarioText;
00047             CopyTestData.Text = m_testDataToCopy;
00048             ClearUIPolicyLabel.Text = m_clearPolicyText;
00049         }
00050
00051         private void TryApplyProcessUIPolicy_Click(object sender, RoutedEventArgs e)
00052         {
00053             bool result = ProtectionPolicyManager.TryApplyProcessUIPolicy(Scenario1.m_enterpriseId);
00054             rootPage.NotifyUser("TryApplyProcessUIPolicy returned " + result, NotifyType.StatusMessage);
00055         }
00056
00057         private void ClearProcessUIPolicy_Click(object sender, RoutedEventArgs e)
00058         {
00059             ProtectionPolicyManager.ClearProcessUIPolicy();
00060             rootPage.NotifyUser("Copy+Paste from this app should now succeed", NotifyType.ErrorMessage);
00061         }
00062     }
00063 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1Basic Member List

This is the complete list of members for Scenario1Basic, including all inherited members.
OnNavigatedFrom(NavigationEventArgs e) | Scenario1Basic | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1Basic | [inline, protected]
OnPrintButtonClick(object sender, RoutedEventArgs e) | Scenario1Basic | [inline, private]
printHelper | Scenario1Basic | [private]
Scenario1Basic() | Scenario1Basic | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/SampleConfiguration.cs Source File

  • WiFiDirect
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Core;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Wi-Fi Direct";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Advertiser", ClassType=typeof(Scenario1_Advertiser)},
00026             new Scenario() { Title="Connector", ClassType=typeof(Scenario2_Connector)}
00027         };
00028
00029         public async void NotifyUserFromBackground(string strMessage, NotifyType type)
00030         {
00031             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00032             {
00033                 NotifyUser(strMessage, type);
00034             });
00035         }
00036     }
00037
00038     public class Scenario
00039     {
00040         public string Title { get; set; }
00041         public Type ClassType { get; set; }
00042     }
00043 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Upload Member List

This is the complete list of members for Scenario2_Upload, including all inherited members.
CancelAll_Click(object sender, RoutedEventArgs e) | Scenario2_Upload | [inline, private]
cts | Scenario2_Upload | [private]
DiscoverActiveUploadsAsync() | Scenario2_Upload | [inline, private]
Dispose() | Scenario2_Upload | [inline]
HandleUploadAsync(UploadOperation upload, bool start) | Scenario2_Upload | [inline, private]
IsExceptionHandled(string title, Exception ex, UploadOperation upload=null) | Scenario2_Upload | [inline, private]
Log(string message) | Scenario2_Upload | [inline, private]
LogStatus(string message, NotifyType type) | Scenario2_Upload | [inline, private]
MarshalLog(string value) | Scenario2_Upload | [inline, private]
maxUploadFileSize | Scenario2_Upload | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Upload | [inline, protected]
rootPage | Scenario2_Upload | [private]
Scenario2_Upload() | Scenario2_Upload | [inline]
StartMultipartUpload_Click(object sender, RoutedEventArgs e) | Scenario2_Upload | [inline, private]
StartMultipleFilesUpload(FileOpenPicker picker, Uri uri) | Scenario2_Upload | [inline, private]
StartSingleFileUpload(FileOpenPicker picker, Uri uri) | Scenario2_Upload | [inline, private]
StartUpload_Click(object sender, RoutedEventArgs e) | Scenario2_Upload | [inline, private]
UploadMultipleFiles(Uri uri, IReadOnlyList< StorageFile > files) | Scenario2_Upload | [inline, private]
UploadProgress(UploadOperation upload) | Scenario2_Upload | [inline, private]
UploadSingleFile(Uri uri, StorageFile file) | Scenario2_Upload | [inline, private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/SimpleLogger.h Source File

  • CameraStreamCorrelation
  • cpp

SimpleLogger.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     private ref class SimpleLogger sealed
00017     {
00018     public:
00019         SimpleLogger(Windows::UI::Xaml::Controls::TextBlock^ textBlock)
00020         {
00021             m_textBlock = textBlock;
00022             m_dispatcher = textBlock->Dispatcher;
00023         }
00024
00025         void Log(Platform::String^ message)
00026         {
00027             auto calendar = ref new Windows::Globalization::Calendar();
00028             auto formatter = ref new Windows::Globalization::DateTimeFormatting::DateTimeFormatter("hour minute second");
00029
00030             LONG messageNumber = InterlockedIncrement(&m_messageCount);
00031             Platform::String^ newMessage = "[" + messageNumber.ToString() + "] " +
00032                 formatter->Format(calendar->GetDateTime()) + " : " + message;
00033
00034             m_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Low,
00035                 ref new Windows::UI::Core::DispatchedHandler(
00036                     [this, newMessage]()
00037             {
00038                 m_textBlock->Text = newMessage + "\r\n" + m_textBlock->Text;
00039             }));
00040         }
00041
00042     private:
00043         LONG m_messageCount = 0;
00044         Windows::UI::Xaml::Controls::TextBlock^ m_textBlock;
00045         Windows::UI::Core::CoreDispatcher^ m_dispatcher;
00046     };
00047
00048 } // SDKTemplate
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Initialization Member List

This is the complete list of members for Scenario1_Initialization, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Initialization | [inline, protected]
ProvisionButton_Click(object sender, RoutedEventArgs e) | Scenario1_Initialization | [inline, private]
RegisterButton_Click(object sender, RoutedEventArgs e) | Scenario1_Initialization | [inline, private]
rootPage | Scenario1_Initialization | [private]
Scenario1_Initialization() | Scenario1_Initialization | [inline]
UnregisterBackgroundTask() | Scenario1_Initialization | [inline, private]
UnregisterButton_Click(object sender, RoutedEventArgs e) | Scenario1_Initialization | [inline, private]
UpdateButtonState(bool registered) | Scenario1_Initialization | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_NumberParsing Member List

This is the complete list of members for Scenario4_NumberParsing, including all inherited members.
Display_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_NumberParsing
Scenario4_NumberParsing() | Scenario4_NumberParsing
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/Common/CameraResources.h Source File

  • SpatialInteractionSource
  • cpp
  • Common

CameraResources.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace DX
00004 {
00005     class DeviceResources;
00006
00007     // Constant buffer used to send the view-projection matrices to the shader pipeline.
00008     struct ViewProjectionConstantBuffer
00009     {
00010         DirectX::XMFLOAT4X4 viewProjection[2];
00011     };
00012
00013     // Assert that the constant buffer remains 16-byte aligned (best practice).
00014     static_assert((sizeof(ViewProjectionConstantBuffer) % (sizeof(float) * 4)) == 0, "ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00015
00016     // Manages DirectX device resources that are specific to a holographic camera, such as the
00017     // back buffer, ViewProjection constant buffer, and viewport.
00018     class CameraResources
00019     {
00020     public:
00021         CameraResources(Windows::Graphics::Holographic::HolographicCamera^ holographicCamera);
00022
00023         void CreateResourcesForBackBuffer(
00024             DX::DeviceResources* pDeviceResources,
00025             Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ cameraParameters
00026             );
00027         void ReleaseResourcesForBackBuffer(
00028             DX::DeviceResources* pDeviceResources
00029             );
00030
00031         void UpdateViewProjectionBuffer(
00032             std::shared_ptr<DX::DeviceResources> deviceResources,
00033             Windows::Graphics::Holographic::HolographicCameraPose^ cameraPose,
00034             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00035
00036         bool AttachViewProjectionBuffer(
00037             std::shared_ptr<DX::DeviceResources> deviceResources);
00038
00039         // Direct3D device resources.
00040         ID3D11RenderTargetView* GetBackBufferRenderTargetView()     const { return m_d3dRenderTargetView.Get();     }
00041         ID3D11DepthStencilView* GetDepthStencilView()               const { return m_d3dDepthStencilView.Get();     }
00042         ID3D11Texture2D*        GetBackBufferTexture2D()            const { return m_d3dBackBuffer.Get();           }
00043         D3D11_VIEWPORT          GetViewport()                       const { return m_d3dViewport;                   }
00044         DXGI_FORMAT             GetBackBufferDXGIFormat()           const { return m_dxgiFormat;                    }
00045         ID3D11BlendState*       GetBlendState()                     const { return m_blendState.Get();              }
00046
00047         // Render target properties.
00048         Windows::Foundation::Size GetRenderTargetSize()             const { return m_d3dRenderTargetSize;           }
00049         bool                    IsRenderingStereoscopic()           const { return m_isStereo;                      }
00050
00051         // The holographic camera these resources are for.
00052         Windows::Graphics::Holographic::HolographicCamera^ GetHolographicCamera() const { return m_holographicCamera; }
00053
00054     private:
00055         // Direct3D rendering objects. Required for 3D.
00056         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>      m_d3dRenderTargetView;
00057         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>      m_d3dDepthStencilView;
00058         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_d3dBackBuffer;
00059         Microsoft::WRL::ComPtr<ID3D11BlendState>            m_blendState;
00060
00061         // Device resource to store view and projection matrices.
00062         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_viewProjectionConstantBuffer;
00063
00064         // Direct3D rendering properties.
00065         DXGI_FORMAT                                         m_dxgiFormat;
00066         Windows::Foundation::Size                           m_d3dRenderTargetSize;
00067         D3D11_VIEWPORT                                      m_d3dViewport;
00068
00069         // Indicates whether the camera supports stereoscopic rendering.
00070         bool                                                m_isStereo = false;
00071
00072         // Indicates whether this camera has a pending frame.
00073         bool                                                m_framePending = false;
00074
00075         // Pointer to the holographic camera these resources are for.
00076         Windows::Graphics::Holographic::HolographicCamera^  m_holographicCamera = nullptr;
00077     };
00078 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario2_Binary.xaml.h Source File

  • WebSocket
  • cpp

Scenario2_Binary.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2.xaml.h
00014 // Declaration of the Scenario2 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2_Binary.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario2 sealed
00030     {
00031     public:
00032         Scenario2();
00033
00034     protected:
00035         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         void OnStart();
00038         void OnStop();
00039
00040     private:
00041         MainPage^ rootPage = MainPage::Current;
00042         Windows::Networking::Sockets::StreamWebSocket^ streamWebSocket;
00043         bool busy = false;
00044
00045         void UpdateVisualState();
00046         void SetBusy(bool value);
00047         Concurrency::task<void> StartAsync();
00048         void OnServerCustomValidationRequested(
00049             Windows::Networking::Sockets::StreamWebSocket^ sender,
00050             Windows::Networking::Sockets::WebSocketServerCustomValidationRequestedEventArgs^ args);
00051         void StartReceiveData(Windows::Networking::Sockets::StreamWebSocket^ activeSocket);
00052         void ReceiveDataLoop(
00053             Windows::Networking::Sockets::StreamWebSocket^ activeSocket,
00054             Windows::Storage::Streams::IBuffer^ readBuffer,
00055             UINT32 bytesReceivedSoFar);
00056         void StartSendData(Windows::Networking::Sockets::StreamWebSocket^ activeSocket);
00057         void SendDataLoop(
00058             Windows::Networking::Sockets::StreamWebSocket^ activeSocket,
00059             Windows::Storage::Streams::IBuffer^ sendBuffer,
00060             UINT32 bytesSentSoFar);
00061
00062         Concurrency::task<void> StopAsync();
00063         void OnClosed(Windows::Networking::Sockets::IWebSocket^ sender, Windows::Networking::Sockets::WebSocketClosedEventArgs^ args);
00064         void CloseSocket();
00065         void AppendOutputLine(Platform::String^ value);
00066     };
00067 }
Generated on Fri Nov 15 2024 22:22:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/FaceMesh.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

FaceMesh.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // FaceMesh:
00015 // This class derives from MeshObject and creates a ID3D11Buffer of
00016 // vertices and indices to represent a canonical face defined as a
00017 // rectangle at the origin extending 1 unit in the +X and
00018 // 1 unit in the +Y direction.
00019 // The face is defined to be two sided, so it is visible from either
00020 // side.
00021
00022 #include "MeshObject.h"
00023
00024 class FaceMesh : public MeshObject
00025 {
00026 public:
00027     FaceMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device);
00028 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario3_CurrencyFormatting.xaml.h Source File

  • NumberFormatting
  • cpp

Scenario3_CurrencyFormatting.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "pch.h"
00006 #include "Scenario3_CurrencyFormatting.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario3_CurrencyFormatting sealed
00012     {
00013     public:
00014         Scenario3_CurrencyFormatting();
00015
00016     private:
00017         void Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00018     };
00019 }
Generated on Fri Nov 15 2024 22:20:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/NfcHceBackgroundTask/Utilities.cpp Source File

  • Nfc
  • NfcHceBackgroundTask

Utilities.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include <pch.h>
00013 #include "Utilities.h"
00014
00015 using namespace Concurrency;
00016 using namespace Microsoft::WRL;
00017 using namespace Platform;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Security::Cryptography::DataProtection;
00020 using namespace Windows::Storage;
00021 using namespace Windows::Storage::Streams;
00022
00023 String^ GetCurrentTimeString()
00024 {
00025     auto calendar = ref new Calendar();
00026     calendar->SetToNow();
00027
00028     int milliseconds = calendar->Nanosecond / 1000000;
00029     String^ strMilliseconds = milliseconds.ToString();
00030
00031     // Pad zeros
00032     if (strMilliseconds->Length() == 1)
00033     {
00034         strMilliseconds = "00" + strMilliseconds;
00035     }
00036     else if (strMilliseconds->Length() == 2)
00037     {
00038         strMilliseconds = "0" + strMilliseconds;
00039     }
00040
00041     return
00042         calendar->HourAsPaddedString(2) + ":" +
00043         calendar->MinuteAsPaddedString(2) + ":" +
00044         calendar->SecondAsPaddedString(2) + "." +
00045         strMilliseconds;
00046 }
00047
00048 // Retrieves the raw buffer data from the provided IBuffer object.
00049 // Warning: The lifetime of the returned buffer is controlled by
00050 // the lifetime of the buffer object that's passed to this method.
00051 // When the buffer has been released, the pointer becomes invalid
00052 // and must not be used.
00053 _Use_decl_annotations_
00054 LPBYTE PointerFromIBuffer(IBuffer^ buffer, DWORD* pcbLength)
00055 {
00056     if (pcbLength != nullptr)
00057     {
00058         *pcbLength = buffer->Length;
00059     }
00060
00061     // Query the IBufferByteAccess interface.
00062     ComPtr<IBufferByteAccess> bufferByteAccess;
00063     ChkHR(reinterpret_cast<IInspectable*>(buffer)->QueryInterface(IID_PPV_ARGS(&bufferByteAccess)));
00064
00065     // Retrieve the buffer data.
00066     LPBYTE pbData = nullptr;
00067     ChkHR(bufferByteAccess->Buffer(&pbData));
00068     return pbData;
00069 }
00070
00071 _Use_decl_annotations_
00072 IBuffer^ IBufferFromPointer(LPBYTE pbData, DWORD cbData)
00073 {
00074     auto byteArray = new ArrayReference<unsigned char>(pbData, cbData);
00075     return IBufferFromArray(reinterpret_cast<Array<unsigned char>^>(byteArray));
00076 }
00077
00078 _Use_decl_annotations_
00079 IBuffer^ IBufferFromArray(Array<unsigned char>^ data)
00080 {
00081     DataWriter^ dataWriter = ref new DataWriter();
00082     dataWriter->WriteBytes(data);
00083     return dataWriter->DetachBuffer();
00084 }
00085
00086 _Use_decl_annotations_
00087 std::wstring ByteArrayToString(Array<byte>^ byteArray)
00088 {
00089     std::wstring str = L"";
00090     for (auto b : byteArray)
00091     {
00092         wchar_t strByte[3];
00093         swprintf_s(strByte, L"%02X", b);
00094         str += strByte;
00095     }
00096
00097     return str;
00098 }
00099
00100 void ChkHR(HRESULT hr)
00101 {
00102     if (FAILED(hr))
00103     {
00104         throw ref new COMException(hr);
00105     }
00106 }
00107
00108 task<Array<byte>^> ReadAndUnprotectFileAsync(String^ filename)
00109 {
00110     return create_task(ApplicationData::Current->LocalFolder->TryGetItemAsync(filename)).then(
00111         [](IStorageItem^ item)
00112         {
00113             if (item != nullptr
00114                 && item->IsOfType(StorageItemTypes::File))
00115             {
00116                 // File exists, read it
00117                 return create_task(dynamic_cast<StorageFile^>(item)->OpenReadAsync()).then([](IRandomAccessStreamWithContentType^ stream)
00118                 {
00119                     if (stream->Size > MAXDWORD32)
00120                     {
00121                         throw ref new Exception(E_FAIL);
00122                     }
00123
00124                     auto size = static_cast<unsigned int>(stream->Size);
00125                     auto buffer = ref new Buffer(size);
00126                     return stream->ReadAsync(buffer, size, InputStreamOptions::None);
00127                 }).then([](IBuffer^ buffer)
00128                 {
00129                     // Now unprotect/decrypt it
00130                     auto provider = ref new DataProtectionProvider();
00131                     return provider->UnprotectAsync(buffer);
00132                 }).then([](IBuffer^ buffer) -> Array<byte>^
00133                 {
00134                     auto data = ref new Array<byte>(buffer->Length);
00135                     DataReader::FromBuffer(buffer)->ReadBytes(data);
00136                     return data;
00137                 });
00138             }
00139             else
00140             {
00141                 // File doesn't exist, return nullptr
00142                 return task_from_result<Array<byte>^>(nullptr);
00143             }
00144     });
00145 }
00146
00147 task<IBuffer^> ReadFileToBufferAsync(String^ filename)
00148 {
00149     return create_task(ApplicationData::Current->LocalFolder->TryGetItemAsync(filename)).then(
00150         [](IStorageItem^ item)
00151     {
00152         if (item != nullptr
00153             && item->IsOfType(StorageItemTypes::File))
00154         {
00155             // File exists, read it
00156             return create_task(dynamic_cast<StorageFile^>(item)->OpenReadAsync()).then([](IRandomAccessStreamWithContentType^ stream)
00157             {
00158                 if (stream->Size > MAXDWORD32)
00159                 {
00160                     throw ref new Exception(E_FAIL);
00161                 }
00162
00163                 auto size = static_cast<unsigned int>(stream->Size);
00164                 auto buffer = ref new Buffer(size);
00165                 return stream->ReadAsync(buffer, size, InputStreamOptions::None);
00166             });
00167         }
00168         else
00169         {
00170             // File doesn't exist, return nullptr
00171             return task_from_result<IBuffer^>(nullptr);
00172         }
00173     });
00174 }
00175
00176 void AppendFile(String^ filename, String^ data)
00177 {
00178     auto file = create_task(ApplicationData::Current->LocalFolder->CreateFileAsync(
00179         filename,
00180         CreationCollisionOption::OpenIfExists)).get();
00181
00182     create_task(FileIO::AppendTextAsync(file, data)).wait();
00183 }
00184
00185 _Use_decl_annotations_
00186 HRESULT ParseApdu(
00187     BYTE* pbCommandApdu,
00188     DWORD cbCommandApdu,
00189     USHORT* pusClaIns,
00190     BYTE* pbP1,
00191     BYTE* pbP2,
00192     BYTE** ppbPayload,
00193     DWORD* pcbPayload,
00194     DWORD* pcbLE)
00195 {
00196     if (cbCommandApdu < 4)
00197     {
00198         // Invalid data, APDU should be minimum 4 bytes
00199         return E_FAIL;
00200     }
00201
00202     // APDU Format is:
00203     // 0   1   2  3  4
00204     // CLA INS P1 P2 <NC> <cmd> <LE>
00205
00206     // Grab the CLA, INS, P1 and P2
00207     memcpy(pusClaIns, pbCommandApdu, sizeof(USHORT));
00208     *pusClaIns = ntohs(*pusClaIns);
00209     *pbP1 = pbCommandApdu[2];
00210     *pbP2 = pbCommandApdu[3];
00211     *ppbPayload = nullptr;
00212     *pcbPayload = 0;
00213     *pcbLE = 0;
00214     if (cbCommandApdu == 5)
00215     {
00216         // Non-extended APDU with an LE byte
00217         *pcbLE = pbCommandApdu[4];
00218         if (*pcbLE == 0)
00219         {
00220             *pcbLE = 256;
00221         }
00222     }
00223     else if (cbCommandApdu > 5)
00224     {
00225         if (pbCommandApdu[4] != 0)
00226         {
00227             // Non-extended APDU with command data
00228             *pcbPayload = pbCommandApdu[4];
00229
00230             if ((*pcbPayload + 5) == cbCommandApdu)
00231             {
00232                 // No LE
00233             }
00234             else if ((*pcbPayload + 6) == cbCommandApdu)
00235             {
00236                 // LE byte at the end
00237                 *pcbLE = pbCommandApdu[*pcbPayload + 5];
00238                 if (*pcbLE == 0)
00239                 {
00240                     *pcbLE = 256;
00241                 }
00242             }
00243             else
00244             {
00245                 // Invalid length
00246                 return E_FAIL;
00247             }
00248             *ppbPayload = pbCommandApdu + 5;
00249         }
00250         else
00251         {
00252             // Extended APDU
00253
00254             if (cbCommandApdu == 7)
00255             {
00256                 // Extended APDU with no command payload and only LE
00257                 memcpy(pcbLE, pbCommandApdu + 5, sizeof(USHORT));
00258                 *pcbLE = ntohs((u_short)*pcbLE);
00259                 if (*pcbLE == 0)
00260                 {
00261                     *pcbLE = 65536;
00262                 }
00263             }
00264             else if (cbCommandApdu >= 8)
00265             {
00266                 // We have an extended command payload
00267                 memcpy(pcbPayload, pbCommandApdu + 5, sizeof(USHORT));
00268                 *pcbPayload = ntohs((u_short)*pcbPayload);
00269
00270                 if (*pcbPayload + 9 == cbCommandApdu)
00271                 {
00272                     // There is an extended LE at the end
00273                     memcpy(pcbLE, pbCommandApdu + 7 + *pcbPayload, sizeof(USHORT));
00274                     *pcbLE = ntohs((u_short)*pcbLE);
00275                     if (*pcbLE == 0)
00276                     {
00277                         *pcbLE = 65536;
00278                     }
00279                 }
00280                 else if (*pcbPayload + 7 == cbCommandApdu)
00281                 {
00282                     // No LE
00283                 }
00284                 else
00285                 {
00286                     return E_FAIL;
00287                 }
00288
00289                 *ppbPayload = pbCommandApdu + 7;
00290             }
00291             else
00292             {
00293                 return E_FAIL;
00294             }
00295         }
00296     }
00297
00298     return S_OK;
00299 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WorldWallsMesh Member List

This is the complete list of members for WorldWallsMesh, including all inherited members.
m_indexBuffer | MeshObject | [protected]
m_indexCount | MeshObject | [protected]
m_vertexBuffer | MeshObject | [protected]
m_vertexCount | MeshObject | [protected]
MeshObject() | MeshObject |
Render(_In_ ID3D11DeviceContext *context) | MeshObject | [virtual]
WorldWallsMesh(_In_ winrt::com_ptr< ID3D11Device3 > const &device) | WorldWallsMesh |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario2_History.xaml.cpp Source File

  • ActivitySensor
  • cpp

Scenario2_History.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_History.xaml.cpp
00014 // Implementation of the Scenario2_History class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_History.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Devices::Enumeration;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Foundation::Collections;
00028 using namespace Windows::Globalization;
00029 using namespace Windows::Globalization::DateTimeFormatting;
00030 using namespace Windows::UI::Core;
00031 using namespace Windows::UI::Xaml;
00032 using namespace Windows::UI::Xaml::Controls;
00033
00034 Scenario2_History::Scenario2_History() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037
00038     ScenarioGetActivityHistoryButton->IsEnabled = false;
00039
00040     // Determine if we can access activity sensors
00041     auto deviceAccessInfo = DeviceAccessInformation::CreateFromDeviceClassId(GUID_ActivitySensor_ClassId);
00042     if (deviceAccessInfo->CurrentStatus == DeviceAccessStatus::Allowed)
00043     {
00044         // Determine if an activity sensor is present
00045         // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
00046         create_task(ActivitySensor::GetDefaultAsync).then([this](task<ActivitySensor^> task)
00047         {
00048             auto activitySensor = task.get();
00049             if (nullptr == activitySensor)
00050             {
00051                 rootPage->NotifyUser("No activity sensors found", NotifyType::ErrorMessage);
00052             }
00053             else
00054             {
00055                 ScenarioGetActivityHistoryButton->IsEnabled = true;
00056             }
00057         });
00058     }
00059     else
00060     {
00061         rootPage->NotifyUser("Access to activity sensors is denied", NotifyType::ErrorMessage);
00062     }
00063 }
00064
00065 void Scenario2_History::ScenarioGetActivityHistory(Object^ sender, RoutedEventArgs^ e)
00066 {
00067     // Reset fields and status
00068     ScenarioOutput_Count->Text = "No data";
00069     ScenarioOutput_Activity1->Text = "No data";
00070     ScenarioOutput_Confidence1->Text = "No data";
00071     ScenarioOutput_Timestamp1->Text = "No data";
00072     ScenarioOutput_ActivityN->Text = "No data";
00073     ScenarioOutput_ConfidenceN->Text = "No data";
00074     ScenarioOutput_TimestampN->Text = "No data";
00075     rootPage->NotifyUser("", NotifyType::StatusMessage);
00076
00077     auto calendar = ref new Calendar();
00078     calendar->SetToNow();
00079     calendar->AddDays(-1);
00080     auto yesterday = calendar->GetDateTime();
00081
00082     // Get history from yesterday onwards
00083     create_task(ActivitySensor::GetSystemHistoryAsync(yesterday)).then([this](IVectorView<ActivitySensorReading^>^ history)
00084     {
00085         ScenarioOutput_Count->Text = history->Size.ToString();
00086         if (history->Size > 0)
00087         {
00088             auto reading1 = history->GetAt(0);
00089             ScenarioOutput_Activity1->Text = reading1->Activity.ToString();
00090             ScenarioOutput_Confidence1->Text = reading1->Confidence.ToString();
00091
00092             auto timestampFormatter = ref new DateTimeFormatter("day month year hour minute second");
00093             ScenarioOutput_Timestamp1->Text = timestampFormatter->Format(reading1->Timestamp);
00094
00095             auto readingN = history->GetAt(history->Size - 1);
00096             ScenarioOutput_ActivityN->Text = readingN->Activity.ToString();
00097             ScenarioOutput_ConfidenceN->Text = readingN->Confidence.ToString();
00098             ScenarioOutput_TimestampN->Text = timestampFormatter->Format(readingN->Timestamp);
00099         }
00100     });
00101 }
00102
Generated on Fri Nov 15 2024 22:17:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario13.xaml.h Source File

  • ApplicationResources
  • cpp

scenario13.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario13.xaml.h
00013 // Declaration of the Scenario13 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario13.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario13 sealed
00030         {
00031         public:
00032             Scenario13();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037         private:
00038             void DXFLOptionCombo_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00039             MainPage^ rootPage;
00040         };
00041
00042 }
Generated on Fri Nov 15 2024 22:17:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.h Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario1_OvenClient.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "Scenario1_OvenClient.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     namespace WRLOutOfProcessWinRTComponent
00013     {
00014         public ref class OvenClient sealed
00015         {
00016         public:
00017             OvenClient();
00018
00019         private:
00020             void Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021             void BreadCompletedHandler1(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ args);
00022             void BreadCompletedHandler2(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ args);
00023             void BreadCompletedHandler3(Microsoft::SDKSamples::Kitchen::Oven^ oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^ args);
00024
00025             Microsoft::SDKSamples::Kitchen::Oven^ _myOven; // keep around since this is an event source
00026         };
00027     }
00028 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileSavePickerPage.xaml.cs Source File

  • FilePickerContracts
  • cs

FileSavePickerPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using Windows.ApplicationModel.Activation;
00014 using Windows.Storage.Pickers.Provider;
00015 using Windows.UI.ViewManagement;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Markup;
00019 using Windows.UI.Xaml.Navigation;
00020
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class FileSavePickerPage : Page
00028     {
00029         public const string FEATURE_NAME = "File Save Picker Page";
00030         public event System.EventHandler ScenarioLoaded;
00031         public event EventHandler<FileSavePickerPageSizeChangedEventArgs> FileSavePickerPageResized;
00032
00033         public Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs;
00034
00035         public static FileSavePickerPage Current;
00036
00037         private Frame HiddenFrame = null;
00038
00039         internal FileSavePickerUI fileSavePickerUI = null;
00040
00041         List<Scenario> scenarios = new List<Scenario>
00042         {
00043             new Scenario() { Title = "1) Save a file to app's storage", ClassType = typeof(FilePickerContracts.FileSavePicker_SaveToAppStorage) },
00044             new Scenario() { Title = "2) Fail to save a file",     ClassType = typeof(FilePickerContracts.FileSavePicker_FailToSave) },
00045             new Scenario() { Title = "3) Save to cached file",     ClassType = typeof(FilePickerContracts.FileSavePicker_SaveToCachedFile) },
00046         };
00047
00048         internal void Activate(FileSavePickerActivatedEventArgs args)
00049         {
00050             fileSavePickerUI = args.FileSavePickerUI;
00051             Window.Current.Content = this;
00052             this.OnNavigatedTo(null);
00053             Window.Current.Activate();
00054         }
00055
00056         public FileSavePickerPage()
00057         {
00058             this.InitializeComponent();
00059
00060             // This is a static public property that will allow downstream pages to get
00061             // a handle to the FileSavePickerPage instance in order to call methods that are in this class.
00062             Current = this;
00063
00064             // This frame is hidden, meaning it is never shown.  It is simply used to load
00065             // each scenario page and then pluck out the input and output sections and
00066             // place them into the UserControls on the main page.
00067             HiddenFrame = new Windows.UI.Xaml.Controls.Frame();
00068             HiddenFrame.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00069             LayoutRoot.Children.Add(HiddenFrame);
00070
00071             // Populate the sample title from the constant in the GlobalVariables.cs file.
00072             SetFeatureName(FEATURE_NAME);
00073
00074             Scenarios.SelectionChanged += Scenarios_SelectionChanged;
00075             SizeChanged += FileSavePickerPage_SizeChanged;
00076         }
00077
00078         void FileSavePickerPage_SizeChanged(object sender, SizeChangedEventArgs e)
00079         {
00080             InvalidateSize();
00081             if (FileSavePickerPageResized != null)
00082             {
00083                 FileSavePickerPageSizeChangedEventArgs args = new FileSavePickerPageSizeChangedEventArgs();
00084                 args.Width = this.ActualWidth;
00085                 FileSavePickerPageResized(this, args);
00086             }
00087         }
00088
00089         /// <summary>
00090         /// Invoked when this page is about to be displayed in a Frame.
00091         /// </summary>
00092         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00093         /// property is typically used to configure the page.</param>
00094         protected override void OnNavigatedTo(NavigationEventArgs e)
00095         {
00096             PopulateScenarios();
00097             InvalidateLayout();
00098         }
00099
00100         private void InvalidateSize()
00101         {
00102             // Get the window width
00103             double windowWidth = this.ActualWidth;
00104
00105             if (windowWidth != 0.0)
00106             {
00107                 // Get the width of the ListBox.
00108                 double listBoxWidth = Scenarios.ActualWidth;
00109
00110                 // Is the ListBox using any margins that we need to consider?
00111                 double listBoxMarginLeft = Scenarios.Margin.Left;
00112                 double listBoxMarginRight = Scenarios.Margin.Right;
00113
00114                 // Figure out how much room is left after considering the list box width
00115                 double availableWidth = windowWidth - listBoxWidth;
00116
00117                 // Is the top most child using margins?
00118                 double layoutRootMarginLeft = ContentRoot.Margin.Left;
00119                 double layoutRootMarginRight = ContentRoot.Margin.Right;
00120
00121                 // We have different widths to use depending on the view state
00122                 if (this.ActualWidth >= 768)
00123                 {
00124                     // Make us as big as the the left over space, factoring in the ListBox width, the ListBox margins.
00125                     // and the LayoutRoot's margins
00126                     InputSection.Width = ((availableWidth) - (layoutRootMarginLeft + layoutRootMarginRight + listBoxMarginLeft + listBoxMarginRight));
00127                 }
00128                 else
00129                 {
00130                     // Make us as big as the left over space, factoring in just the LayoutRoot's margins.
00131                         InputSection.Width = (windowWidth - (layoutRootMarginLeft + layoutRootMarginRight));
00132
00133                 }
00134             }
00135             InvalidateLayout();
00136         }
00137
00138         private void InvalidateLayout()
00139         {
00140
00141             if (this.ActualWidth < 768)
00142             {
00143                 Grid.SetRow(DescriptionText, 3);
00144                 Grid.SetColumn(DescriptionText, 0);
00145
00146                 Grid.SetRow(InputSection, 4);
00147                 Grid.SetColumn(InputSection, 0);
00148
00149                 Grid.SetRow(FooterPanel, 2);
00150                 Grid.SetColumn(FooterPanel, 0);
00151             }
00152             else
00153             {
00154                 Grid.SetRow(DescriptionText, 1);
00155                 Grid.SetColumn(DescriptionText, 1);
00156
00157                 Grid.SetRow(InputSection, 2);
00158                 Grid.SetColumn(InputSection, 1);
00159
00160                 Grid.SetRow(FooterPanel, 1);
00161                 Grid.SetColumn(FooterPanel, 1);
00162             }
00163         }
00164
00165         private void PopulateScenarios()
00166         {
00167             // Bind the ListBox to the scenario list.
00168             Scenarios.ItemsSource = scenarios;
00169             Scenarios.SelectedIndex = 0;
00170         }
00171
00172         /// <summary>
00173         /// This method is responsible for loading the individual input and output sections for each scenario.  This
00174         /// is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input
00175         /// and output sections into the respective UserControl on the main page.
00176         /// </summary>
00177         /// <param name="scenarioName"></param>
00178         public void LoadScenario(Type scenarioClass)
00179         {
00180
00181             // Load the ScenarioX.xaml file into the Frame.
00182             HiddenFrame.Navigate(scenarioClass, this);
00183
00184             // Get the top element, the Page, so we can look up the elements
00185             // that represent the input and output sections of the ScenarioX file.
00186             Page hiddenPage = HiddenFrame.Content as Page;
00187
00188             // Get each element.
00189             UIElement input = hiddenPage.FindName("Input") as UIElement;
00190             UIElement output = hiddenPage.FindName("Output") as UIElement;
00191
00192             if (input == null)
00193             {
00194                 // Malformed input section.
00195                 NotifyUser(String.Format(
00196                     "Cannot load scenario input section for {0}.  Make sure root of input section markup has x:Name of 'Input'",
00197                     scenarioClass.Name), NotifyType.ErrorMessage);
00198                 return;
00199             }
00200
00201             if (output == null)
00202             {
00203                 // Malformed output section.
00204                 NotifyUser(String.Format(
00205                     "Cannot load scenario output section for {0}.  Make sure root of output section markup has x:Name of 'Output'",
00206                     scenarioClass.Name), NotifyType.ErrorMessage);
00207                 return;
00208             }
00209
00210             // Find the LayoutRoot which parents the input and output sections in the main page.
00211             Panel panel = hiddenPage.FindName("LayoutRoot") as Panel;
00212
00213             if (panel != null)
00214             {
00215                 // Get rid of the content that is currently in the intput and output sections.
00216                 panel.Children.Remove(input);
00217                 panel.Children.Remove(output);
00218
00219                 // Populate the input and output sections with the newly loaded content.
00220                 InputSection.Content = input;
00221                 OutputSection.Content = output;
00222
00223                 if (ScenarioLoaded != null)
00224                 {
00225                     ScenarioLoaded(this, new EventArgs());
00226                 }
00227             }
00228             else
00229             {
00230                 // Malformed Scenario file.
00231                 NotifyUser(String.Format(
00232                     "Cannot load scenario: '{0}'.  Make sure root tag in the '{0}' file has an x:Name of 'LayoutRoot'",
00233                     scenarioClass.Name), NotifyType.ErrorMessage);
00234             }
00235
00236         }
00237
00238         void Scenarios_SelectionChanged(object sender, SelectionChangedEventArgs e)
00239         {
00240             if (Scenarios.SelectedItem != null)
00241             {
00242                 NotifyUser("", NotifyType.StatusMessage);
00243
00244                 Scenario scenario = Scenarios.SelectedItem as Scenario;
00245                 LoadScenario(scenario.ClassType);
00246                 InvalidateSize();
00247             }
00248         }
00249
00250         public void NotifyUser(string strMessage, NotifyType type)
00251         {
00252             switch (type)
00253             {
00254                 // Use the status message style.
00255                 case NotifyType.StatusMessage:
00256                     StatusBlock.Style = Resources["StatusStyle"] as Style;
00257                     break;
00258                 // Use the error message style.
00259                 case NotifyType.ErrorMessage:
00260                     StatusBlock.Style = Resources["ErrorStyle"] as Style;
00261                     break;
00262             }
00263             StatusBlock.Text = strMessage;
00264
00265             // Collapse the StatusBlock if it has no text to conserve real estate.
00266             if (StatusBlock.Text != String.Empty)
00267             {
00268                 StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
00269             }
00270             else
00271             {
00272                 StatusBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00273             }
00274         }
00275
00276         async void Footer_Click(object sender, RoutedEventArgs e)
00277         {
00278             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00279         }
00280
00281         private void SetFeatureName(string str)
00282         {
00283             FeatureName.Text = str;
00284         }
00285     }
00286
00287     public class FileSavePickerPageSizeChangedEventArgs : EventArgs
00288     {
00289         private double width;
00290
00291         public double Width
00292         {
00293             get { return width; }
00294             set { width = value; }
00295         }
00296     }
00297 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareHtml.xaml.cpp Source File

  • ShareSource
  • cpp

ShareHtml.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareHtml.xaml.cpp
00014 // Implementation of the ShareHtml class
00015 //
00016
00017 #include "pch.h"
00018 #include "ShareHtml.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::ApplicationModel::DataTransfer;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace concurrency;
00030
00031 ShareHtml::ShareHtml()
00032 {
00033     InitializeComponent();
00034     ShareWebView->Navigate(ref new Uri("http://msdn.microsoft.com"));
00035 }
00036
00037 void ShareHtml::ShareWebView_NavigationCompleted(Object^ sender, WebViewNavigationCompletedEventArgs^ e)
00038 {
00039     ShareWebView->Visibility = Windows::UI::Xaml::Visibility::Visible;
00040     BlockingRect->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00041     LoadingProgressRing->IsActive = false;
00042 }
00043
00044 bool ShareHtml::GetShareContent(DataRequest^ request)
00045 {
00046     // Get the user's selection from the WebView. Since this is an asynchronous operation we need to acquire the deferral first.
00047     auto deferral = request->GetDeferral();
00048     create_task(ShareWebView->CaptureSelectedContentToDataPackageAsync()).then([this, request, deferral](task<DataPackage^> requestDataTask)
00049     {
00050         try
00051         {
00052             auto requestData = requestDataTask.get();
00053             if ((requestData != nullptr) && (requestData->GetView()->AvailableFormats->Size > 0))
00054             {
00055                 requestData->Properties->Title = "A web snippet for you";
00056                 requestData->Properties->Description = "HTML selection from a WebView control"; // The description is optional.
00057                 requestData->Properties->ContentSourceApplicationLink = ApplicationLink;
00058                 requestData->Properties->ContentSourceWebLink = ShareWebView->Source;
00059                 request->Data = requestData;
00060                 deferral->Complete();
00061             }
00062             else
00063             {
00064                 // FailWithDisplayText calls Complete on the deferral.
00065                 request->FailWithDisplayText("Make a selection in the WebView control and try again.");
00066             }
00067         }
00068         catch (Exception^)
00069         {
00070             deferral->Complete();
00071         }
00072     });
00073
00074     // At this point, we haven't populated the data package yet. It's done asynchronously above.
00075     return false;
00076 }
Generated on Fri Nov 15 2024 22:21:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/ViewModel/Model.cs Source File

  • XamlStateTriggers
  • cs
  • ViewModel

Model.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006
00007 namespace StateTriggersSample.ViewModel
00008 {
00009     public class Model
00010     {
00011         public string Name { get; set; }
00012         public string Description { get; set; }
00013         public Boolean IsColorEnabled { get; set; }
00014     }
00015 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonSendNotification_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cs/ShareText.xaml.cs Source File

  • ShareSource
  • cs

ShareText.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel.DataTransfer;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class ShareText
00018     {
00019         public ShareText()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         protected override bool GetShareContent(DataRequest request)
00025         {
00026             bool succeeded = false;
00027
00028             string dataPackageText = TextToShare.Text;
00029             if (!String.IsNullOrEmpty(dataPackageText))
00030             {
00031                 DataPackage requestData = request.Data;
00032                 requestData.Properties.Title = TitleInputBox.Text;
00033                 requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
00034                 requestData.Properties.ContentSourceApplicationLink = ApplicationLink;
00035                 requestData.SetText(dataPackageText);
00036                 succeeded = true;
00037             }
00038             else
00039             {
00040                 request.FailWithDisplayText("Enter the text you would like to share and try again.");
00041             }
00042             return succeeded;
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Barometer/cpp/SampleConfiguration.cpp Source File

  • Barometer
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" }
00022 };
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/Server/App_Start/RouteConfig.cs Source File

  • MicrosoftPassport
  • Server
  • App_Start

RouteConfig.cs

Go to the documentation of this file.
00001 ﻿using System.Web.Mvc;
00002 using System.Web.Routing;
00003
00004 namespace MicrosoftPassport.Server
00005 {
00006     public class RouteConfig
00007     {
00008         public static void RegisterRoutes(RouteCollection routes)
00009         {
00010             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
00011
00012             routes.MapRoute(
00013                 name: "Default",
00014                 url: "{controller}/{action}/{id}",
00015                 defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
00016             );
00017         }
00018     }
00019 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario2_Upload.xaml.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario2_Upload.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Upload.xaml.cpp
00014 // Implementation of the Scenario2_Upload class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Upload.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Platform::Collections;
00025 using namespace SDKTemplate;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::ViewManagement;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace Windows::Networking::BackgroundTransfer;
00032 using namespace Windows::Web;
00033 using namespace Windows::Foundation;
00034 using namespace Windows::Foundation::Collections;
00035 using namespace Windows::Storage;
00036 using namespace Windows::Storage::Pickers;
00037 using namespace Windows::Storage::FileProperties;
00038
00039 Scenario2_Upload::Scenario2_Upload()
00040 {
00041     InitializeComponent();
00042     cancellationToken = new cancellation_token_source();
00043 }
00044
00045 Scenario2_Upload::~Scenario2_Upload()
00046 {
00047     if (cancellationToken != nullptr)
00048     {
00049         delete cancellationToken;
00050     }
00051 }
00052
00053 /// <summary>
00054 /// Invoked when this page is about to be displayed in a Frame.
00055 /// </summary>
00056 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00057 /// property is typically used to configure the page.</param>
00058 void Scenario2_Upload::OnNavigatedTo(NavigationEventArgs^ e)
00059 {
00060     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00061     // as NotifyUser()
00062     rootPage = MainPage::Current;
00063 }
00064
00065
00066 // Enumerate the uploads that were going on in the background while the app was closed.
00067 void Scenario2_Upload::DiscoverActiveUploads()
00068 {
00069     create_task(BackgroundUploader::GetCurrentUploadsAsync()).then([this] (IVectorView<UploadOperation^>^ uploads)
00070     {
00071         Log("Loading background downloads: " + uploads->Size);
00072
00073         for (unsigned int i = 0; i < uploads->Size; i++)
00074         {
00075             UploadOperation^ upload = uploads->GetAt(i);
00076             Log("Discovered background upload: " + upload->Guid + ", Status: " + upload->Progress.Status.ToString());
00077
00078             // Attach progress and completion handlers.
00079             HandleUploadAsync(upload, false);
00080         }
00081     }).then([this] (task<void> previousTask)
00082     {
00083         try
00084         {
00085             previousTask.get();
00086         }
00087         catch (Exception^ ex)
00088         {
00089             LogException("Discovery error", ex);
00090         }
00091     });
00092 }
00093
00094 void Scenario2_Upload::StartUpload_Click(Object^ sender, RoutedEventArgs^ e)
00095 {
00096     // Validating the URI is required since it was received from an untrusted source (user input).
00097     // The URI is validated by calling TryGetUri() that will return 'false' for strings that are not valid URIs.
00098     // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require the
00099     // "Private Networks (Client and Server)" capability.
00100     Uri^ uri;
00101     if (!rootPage->TryGetUri(serverAddressField->Text, &uri))
00102     {
00103         return;
00104     }
00105
00106     FileOpenPicker^ picker = ref new FileOpenPicker();
00107     picker->FileTypeFilter->Append("*");
00108
00109     create_task(picker->PickSingleFileAsync()).then([this, uri](StorageFile^ file)
00110     {
00111         return UploadSingleFileAsync(uri, file);
00112     }).then([this] (task<void> previousTask)
00113     {
00114         try
00115         {
00116             previousTask.get();
00117         }
00118         catch (Exception^ ex)
00119         {
00120             LogException("Upload Error", ex);
00121         }
00122         catch (task_canceled&)
00123         {
00124             // Do nothing - we canceled the task.
00125         }
00126     }, task_continuation_context::use_current());
00127 }
00128
00129 void Scenario2_Upload::StartMultipartUpload_Click(Object^ sender, RoutedEventArgs^ e)
00130 {
00131     // Validating the URI is required (like TryGetUri) since it was received from an untrusted source (user input).
00132     // The URI is validated by calling TryGetUri() that will return 'false' for strings that are not valid URIs.
00133     // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require the
00134     // "Private Networks (Client and Server)" capability.
00135     Uri^ uri;
00136     if (!rootPage->TryGetUri(serverAddressField->Text, &uri))
00137     {
00138         return;
00139     }
00140
00141     FileOpenPicker^ picker = ref new FileOpenPicker();
00142     picker->FileTypeFilter->Append("*");
00143
00144     create_task(picker->PickMultipleFilesAsync()).then([this, uri](IVectorView<StorageFile^>^ files)
00145     {
00146         return UploadMultipleFilesAsync(uri, files);
00147     }).then([this] (task<void> previousTask)
00148     {
00149         try
00150         {
00151             previousTask.get();
00152         }
00153         catch (Exception^ ex)
00154         {
00155             LogException("Upload Error", ex);
00156         }
00157         catch (task_canceled&)
00158         {
00159             // Do nothing - we canceled the task.
00160         }
00161     }, task_continuation_context::use_current());
00162 }
00163
00164 task<void> Scenario2_Upload::UploadSingleFileAsync(Uri^ uri, IStorageFile^ file)
00165 {
00166     if (file == nullptr)
00167     {
00168         rootPage->NotifyUser("Error: No file selected.", NotifyType::ErrorMessage);
00169         cancel_current_task();
00170     }
00171
00172     return create_task(file->GetBasicPropertiesAsync()).then([this, uri, file](BasicProperties^ properties)
00173     {
00174         if (properties->Size > maxUploadFileSize)
00175         {
00176             rootPage->NotifyUser(
00177                 "Selected file exceeds max. upload file size (" + (maxUploadFileSize / (1024 * 1024)) + " MB).",
00178                 NotifyType::ErrorMessage);
00179             cancel_current_task();
00180         }
00181
00182         BackgroundUploader^ uploader = ref new BackgroundUploader();
00183         uploader->SetRequestHeader("Filename", file->Name);
00184
00185         UploadOperation^ upload = uploader->CreateUpload(uri, file);
00186         Log("Uploading " + file->Name + " to " + uri->AbsoluteUri + ", " + upload->Guid);
00187
00188         // Attach progress and completion handlers.
00189         HandleUploadAsync(upload, true);
00190     });
00191 }
00192
00193 task<void> Scenario2_Upload::UploadMultipleFilesAsync(Uri^ uri, IVectorView<StorageFile^>^ files)
00194 {
00195     return create_task(CreatePartsAsync(files)).then(
00196         [this, uri, files](Vector<BackgroundTransferContentPart^>^ parts)
00197     {
00198         BackgroundUploader^ uploader = ref new BackgroundUploader();
00199         return create_task(uploader->CreateUploadAsync(uri, parts)).then(
00200             [this, uri, files](UploadOperation^ upload)
00201         {
00202             String^ fileNames = files->GetAt(0)->Name;
00203             for (unsigned int i = 1; i < files->Size; i++)
00204             {
00205                 fileNames += ", " + files->GetAt(i)->Name;
00206             }
00207
00208             Log("Uploading " + fileNames + " to " + uri->AbsoluteUri + ", " + upload->Guid);
00209
00210             // Attach progress and completion handlers.
00211             HandleUploadAsync(upload, true);
00212         });
00213     });
00214 }
00215
00216 task<Vector<BackgroundTransferContentPart^>^> Scenario2_Upload::CreatePartsAsync(IVectorView<StorageFile^>^ files)
00217 {
00218     if (files->Size == 0)
00219     {
00220         rootPage->NotifyUser("Error: No file selected.", NotifyType::ErrorMessage);
00221         cancel_current_task();
00222     }
00223
00224     std::vector<task<void>> getPropertiesTasks;
00225     SizeCounter^ sizeCounter = ref new SizeCounter();
00226     task<void> current;
00227
00228     // Get file size of all files. If the sum exceeds the max. upload size, fail the operation.
00229     for (unsigned int i = 0; i < files->Size; i++)
00230     {
00231         current = create_task(files->GetAt(i)->GetBasicPropertiesAsync()).then([sizeCounter] (BasicProperties^ properties)
00232         {
00233             sizeCounter->Add(properties->Size);
00234         });
00235
00236         getPropertiesTasks.push_back(current);
00237     }
00238
00239     return when_all(getPropertiesTasks.begin(), getPropertiesTasks.end()).then([this, sizeCounter, files]
00240     {
00241         if (sizeCounter->GetSize() > maxUploadFileSize)
00242         {
00243             rootPage->NotifyUser(
00244                 "Size of selected files exceeds max. upload file size (" + (maxUploadFileSize / (1024 * 1024)) + " MB).",
00245                 NotifyType::ErrorMessage);
00246             cancel_current_task();
00247         }
00248
00249         Vector<BackgroundTransferContentPart^>^ parts = ref new Vector<BackgroundTransferContentPart^>;
00250         for (unsigned int i = 0; i < files->Size; i++)
00251         {
00252             BackgroundTransferContentPart^ part = ref new BackgroundTransferContentPart("File" + i, files->GetAt(i)->Name);
00253             part->SetFile(files->GetAt(i));
00254             parts->Append(part);
00255         }
00256
00257         return parts;
00258     });
00259 }
00260
00261 void Scenario2_Upload::CancelAll_Click(Object^ sender, RoutedEventArgs^ e)
00262 {
00263     Log("Cancelling all Uploads");
00264
00265     cancellationToken->cancel();
00266     cancellationToken = new cancellation_token_source();
00267 }
00268
00269 // Note that this event is invoked on a background thread, so we cannot access the UI directly.
00270 void Scenario2_Upload::UploadProgress(IAsyncOperationWithProgress<UploadOperation^, UploadOperation^>^ operation, UploadOperation^ upload)
00271 {
00272     // UploadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00273     // we must make a local copy so that we can have a consistent view of that ever-changing state
00274     // throughout this method's lifetime.
00275     BackgroundUploadProgress currentProgress = upload->Progress;
00276
00277     MarshalLog("Progress: " + upload->Guid + ", Status: " + currentProgress.Status.ToString());
00278
00279     UINT64 percentSent = 100;
00280     if (currentProgress.TotalBytesToSend > 0)
00281     {
00282         percentSent = currentProgress.BytesSent * 100 / currentProgress.TotalBytesToSend;
00283     }
00284
00285     MarshalLog(" - Sent bytes: " + currentProgress.BytesSent + " of " + currentProgress.TotalBytesToSend +
00286         " (" + percentSent + "%), Received bytes: " + currentProgress.BytesReceived + " of " +
00287         currentProgress.TotalBytesToReceive);
00288
00289     if (currentProgress.HasRestarted)
00290     {
00291         MarshalLog(" - Upload restarted");
00292     }
00293
00294     if (currentProgress.HasResponseChanged)
00295     {
00296         // We've received new response headers from the server.
00297         MarshalLog(" - Response updated; Header count: " + upload->GetResponseInformation()->Headers->Size);
00298
00299         // If you want to stream the response data this is a good time to start.
00300         // upload.GetResultStreamAt(0);
00301     }
00302 }
00303
00304 void Scenario2_Upload::HandleUploadAsync(UploadOperation^ upload, bool start)
00305 {
00306     IAsyncOperationWithProgress<UploadOperation^, UploadOperation^>^ async;
00307
00308     LogStatus("Running: " + upload->Guid, NotifyType::StatusMessage);
00309
00310     if (start)
00311     {
00312         async = upload->StartAsync();
00313     }
00314     else
00315     {
00316         async = upload->AttachAsync();
00317     }
00318
00319     async->Progress = ref new AsyncOperationProgressHandler<UploadOperation^, UploadOperation^>(this, &Scenario2_Upload::UploadProgress);
00320     create_task(async, cancellationToken->get_token()).then([this] (UploadOperation^ upload)
00321     {
00322         ResponseInformation^ response = upload->GetResponseInformation();
00323         LogStatus("Completed: " + upload->Guid + ", Status Code: " + response->StatusCode,
00324             NotifyType::StatusMessage);
00325     }).then([this, upload] (task<void> previousTask)
00326     {
00327         try
00328         {
00329             previousTask.get();
00330         }
00331         catch (Exception^ ex)
00332         {
00333             LogException("Handle download", ex);
00334         }
00335         catch (const task_canceled&)
00336         {
00337             LogStatus("Canceled: " + upload->Guid, NotifyType::StatusMessage);
00338         }
00339     });
00340 }
00341
00342 void Scenario2_Upload::LogException(String^ title, Exception^ ex)
00343 {
00344     WebErrorStatus error = BackgroundTransferError::GetStatus(ex->HResult);
00345     if (error == WebErrorStatus::Unknown)
00346     {
00347         LogStatus(title + ": " + ex, NotifyType::ErrorMessage);
00348     }
00349     else
00350     {
00351         LogStatus(title + ": " + error.ToString(), NotifyType::ErrorMessage);
00352     }
00353 }
00354
00355 // When operations happen on a background thread we have to marshal UI updates back to the UI thread.
00356 void Scenario2_Upload::MarshalLog(String^ value)
00357 {
00358     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, value] ()
00359     {
00360         Log(value);
00361     }));
00362 }
00363
00364 void Scenario2_Upload::Log(String^ message)
00365 {
00366     outputField->Text += message + "\r\n";
00367 }
00368
00369 void Scenario2_Upload::LogStatus(String^ message, NotifyType type)
00370 {
00371     rootPage->NotifyUser(message, type);
00372     outputField->Text += message + "\r\n";
00373 }
00374
00375 Scenario2_Upload::SizeCounter::SizeCounter() : size(0)
00376 {
00377 }
00378
00379 void Scenario2_Upload::SizeCounter::Add(INT64 sizeValue)
00380 {
00381     // Use interlocked since multiple threads may try to increase the size concurrently.
00382     InterlockedAdd64(&this->size, sizeValue);
00383 }
00384
00385 INT64 Scenario2_Upload::SizeCounter::GetSize()
00386 {
00387     return this->size;
00388 }
00389
Generated on Fri Nov 15 2024 22:18:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicReaderWriter.cpp Source File

  • Simple3DGameDX
  • cpp
  • Common

BasicReaderWriter.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "BasicReaderWriter.h"
00010
00011 using namespace Microsoft::WRL;
00012 using namespace Windows::Storage;
00013 using namespace Windows::Storage::FileProperties;
00014 using namespace Windows::Storage::Streams;
00015 using namespace Windows::Foundation;
00016 using namespace Windows::ApplicationModel;
00017 using namespace concurrency;
00018
00019 BasicReaderWriter::BasicReaderWriter()
00020 {
00021     m_location = Package::Current->InstalledLocation;
00022 }
00023
00024 BasicReaderWriter::BasicReaderWriter(
00025     _In_ Windows::Storage::StorageFolder^ folder
00026     )
00027 {
00028     m_location = folder;
00029     Platform::String^ path = m_location->Path;
00030     if (path->Length() == 0)
00031     {
00032         // Applications are not permitted to access certain
00033         // folders, such as the Documents folder, using this
00034         // code path.  In such cases, the Path property for
00035         // the folder will be an empty string.
00036         throw ref new Platform::FailureException();
00037     }
00038 }
00039
00040 Platform::Array<byte>^ BasicReaderWriter::ReadData(
00041     _In_ Platform::String^ filename
00042     )
00043 {
00044     CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
00045     extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
00046     extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
00047     extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
00048     extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
00049     extendedParams.lpSecurityAttributes = nullptr;
00050     extendedParams.hTemplateFile = nullptr;
00051
00052     Wrappers::FileHandle file(
00053         CreateFile2(
00054             filename->Data(),
00055             GENERIC_READ,
00056             FILE_SHARE_READ,
00057             OPEN_EXISTING,
00058             &extendedParams
00059             )
00060         );
00061     if (file.Get() == INVALID_HANDLE_VALUE)
00062     {
00063         throw ref new Platform::FailureException();
00064     }
00065
00066     FILE_STANDARD_INFO fileInfo = {0};
00067     if (!GetFileInformationByHandleEx(
00068         file.Get(),
00069         FileStandardInfo,
00070         &fileInfo,
00071         sizeof(fileInfo)
00072         ))
00073     {
00074         throw ref new Platform::FailureException();
00075     }
00076
00077     if (fileInfo.EndOfFile.HighPart != 0)
00078     {
00079         throw ref new Platform::OutOfMemoryException();
00080     }
00081
00082     Platform::Array<byte>^ fileData = ref new Platform::Array<byte>(fileInfo.EndOfFile.LowPart);
00083
00084     if (!ReadFile(
00085         file.Get(),
00086         fileData->Data,
00087         fileData->Length,
00088         nullptr,
00089         nullptr
00090         ))
00091     {
00092         throw ref new Platform::FailureException();
00093     }
00094
00095     return fileData;
00096 }
00097
00098 task<Platform::Array<byte>^> BasicReaderWriter::ReadDataAsync(
00099     _In_ Platform::String^ filename
00100     )
00101 {
00102     return task<StorageFile^>(m_location->GetFileAsync(filename)).then([=](StorageFile^ file)
00103     {
00104         return FileIO::ReadBufferAsync(file);
00105     }).then([=](IBuffer^ buffer)
00106     {
00107         auto fileData = ref new Platform::Array<byte>(buffer->Length);
00108         DataReader::FromBuffer(buffer)->ReadBytes(fileData);
00109         return fileData;
00110     });
00111 }
00112
00113 uint32 BasicReaderWriter::WriteData(
00114     _In_ Platform::String^ filename,
00115     _In_ const Platform::Array<byte>^ fileData
00116     )
00117 {
00118     CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
00119     extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
00120     extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
00121     extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
00122     extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
00123     extendedParams.lpSecurityAttributes = nullptr;
00124     extendedParams.hTemplateFile = nullptr;
00125
00126     Wrappers::FileHandle file(
00127         CreateFile2(
00128             filename->Data(),
00129             GENERIC_WRITE,
00130             0,
00131             CREATE_ALWAYS,
00132             &extendedParams
00133             )
00134         );
00135     if (file.Get() == INVALID_HANDLE_VALUE)
00136     {
00137         throw ref new Platform::FailureException();
00138     }
00139
00140     DWORD numBytesWritten;
00141     if (
00142         !WriteFile(
00143             file.Get(),
00144             fileData->Data,
00145             fileData->Length,
00146             &numBytesWritten,
00147             nullptr
00148             ) ||
00149         numBytesWritten != fileData->Length
00150         )
00151     {
00152         throw ref new Platform::FailureException();
00153     }
00154
00155     return numBytesWritten;
00156 }
00157
00158 task<void> BasicReaderWriter::WriteDataAsync(
00159     _In_ Platform::String^ filename,
00160     _In_ const Platform::Array<byte>^ fileData
00161     )
00162 {
00163     return task<StorageFile^>(m_location->CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting)).then([=](StorageFile^ file)
00164     {
00165         FileIO::WriteBytesAsync(file, fileData);
00166     });
00167 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PopToastControl Member List

This is the complete list of members for PopToastControl, including all inherited members.
ButtonPopToast_Click(object sender, RoutedEventArgs e) | PopToastControl | [inline, private]
ButtonToggleShowPayload_Click(object sender, RoutedEventArgs e) | PopToastControl | [inline, private]
Payload | PopToastControl |
PayloadProperty | PopToastControl | [private, static]
PopToastControl() | PopToastControl | [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/SampleConfiguration.h Source File

  • Inclinometer
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Inclinometer";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/SampleConfiguration.h Source File

  • XamlBottomUpList
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "XAML bottom-up list C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047
00048     namespace Helpers
00049     {
00050         Platform::String^ GetCurrentDateTimeAsString();
00051         Windows::Foundation::TimeSpan TimeSpanFromSeconds(int seconds);
00052         Concurrency::task<void> DelayAsync(Windows::Foundation::TimeSpan duration,
00053             Concurrency::cancellation_token cancel = Concurrency::cancellation_token::none());
00054     }
00055 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/Scenario1_Discovery.xaml.cs Source File

  • BluetoothLE
  • cs

Scenario1_Discovery.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.Diagnostics;
00016 using Windows.Devices.Bluetooth;
00017 using Windows.Devices.Enumeration;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     // This scenario uses a DeviceWatcher to enumerate nearby Bluetooth Low Energy devices,
00026     // displays them in a ListView, and lets the user select a device and pair it.
00027     // This device will be used by future scenarios.
00028     // For more information about device discovery and pairing, including examples of
00029     // customizing the pairing process, see the DeviceEnumerationAndPairing sample.
00030     public sealed partial class Scenario1_Discovery : Page
00031     {
00032         private MainPage rootPage = MainPage.Current;
00033
00034         private ObservableCollection<BluetoothLEDeviceDisplay> KnownDevices = new ObservableCollection<BluetoothLEDeviceDisplay>();
00035         private List<DeviceInformation> UnknownDevices = new List<DeviceInformation>();
00036
00037         private DeviceWatcher deviceWatcher;
00038
00039         #region UI Code
00040         public Scenario1_Discovery()
00041         {
00042             InitializeComponent();
00043         }
00044
00045         protected override void OnNavigatedFrom(NavigationEventArgs e)
00046         {
00047             StopBleDeviceWatcher();
00048
00049             // Save the selected device's ID for use in other scenarios.
00050             var bleDeviceDisplay = ResultsListView.SelectedItem as BluetoothLEDeviceDisplay;
00051             if (bleDeviceDisplay != null)
00052             {
00053                 rootPage.SelectedBleDeviceId = bleDeviceDisplay.Id;
00054                 rootPage.SelectedBleDeviceName = bleDeviceDisplay.Name;
00055             }
00056         }
00057         private void EnumerateButton_Click()
00058         {
00059             if (deviceWatcher == null)
00060             {
00061                 StartBleDeviceWatcher();
00062                 EnumerateButton.Content = "Stop enumerating";
00063                 rootPage.NotifyUser($"Device watcher started.", NotifyType.StatusMessage);
00064             }
00065             else
00066             {
00067                 StopBleDeviceWatcher();
00068                 EnumerateButton.Content = "Start enumerating";
00069                 rootPage.NotifyUser($"Device watcher stopped.", NotifyType.StatusMessage);
00070             }
00071         }
00072
00073         private bool Not(bool value) => !value;
00074
00075         #endregion
00076
00077         #region Device discovery
00078
00079         /// <summary>
00080         /// Starts a device watcher that looks for all nearby Bluetooth devices (paired or unpaired).
00081         /// Attaches event handlers to populate the device collection.
00082         /// </summary>
00083         private void StartBleDeviceWatcher()
00084         {
00085             // Additional properties we would like about the device.
00086             // Property strings are documented here https://msdn.microsoft.com/en-us/library/windows/desktop/ff521659(v=vs.85).aspx
00087             string[] requestedProperties = { "System.Devices.Aep.DeviceAddress", "System.Devices.Aep.IsConnected", "System.Devices.Aep.Bluetooth.Le.IsConnectable" };
00088
00089             // BT_Code: Example showing paired and non-paired in a single query.
00090             string aqsAllBluetoothLEDevices = "(System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\")";
00091
00092             deviceWatcher =
00093                     DeviceInformation.CreateWatcher(
00094                         aqsAllBluetoothLEDevices,
00095                         requestedProperties,
00096                         DeviceInformationKind.AssociationEndpoint);
00097
00098             // Register event handlers before starting the watcher.
00099             deviceWatcher.Added += DeviceWatcher_Added;
00100             deviceWatcher.Updated += DeviceWatcher_Updated;
00101             deviceWatcher.Removed += DeviceWatcher_Removed;
00102             deviceWatcher.EnumerationCompleted += DeviceWatcher_EnumerationCompleted;
00103             deviceWatcher.Stopped += DeviceWatcher_Stopped;
00104
00105             // Start over with an empty collection.
00106             KnownDevices.Clear();
00107
00108             // Start the watcher. Active enumeration is limited to approximately 30 seconds.
00109             // This limits power usage and reduces interference with other Bluetooth activities.
00110             // To monitor for the presence of Bluetooth LE devices for an extended period,
00111             // use the BluetoothLEAdvertisementWatcher runtime class. See the BluetoothAdvertisement
00112             // sample for an example.
00113             deviceWatcher.Start();
00114         }
00115
00116         /// <summary>
00117         /// Stops watching for all nearby Bluetooth devices.
00118         /// </summary>
00119         private void StopBleDeviceWatcher()
00120         {
00121             if (deviceWatcher != null)
00122             {
00123                 // Unregister the event handlers.
00124                 deviceWatcher.Added -= DeviceWatcher_Added;
00125                 deviceWatcher.Updated -= DeviceWatcher_Updated;
00126                 deviceWatcher.Removed -= DeviceWatcher_Removed;
00127                 deviceWatcher.EnumerationCompleted -= DeviceWatcher_EnumerationCompleted;
00128                 deviceWatcher.Stopped -= DeviceWatcher_Stopped;
00129
00130                 // Stop the watcher.
00131                 deviceWatcher.Stop();
00132                 deviceWatcher = null;
00133             }
00134         }
00135
00136         private BluetoothLEDeviceDisplay FindBluetoothLEDeviceDisplay(string id)
00137         {
00138             foreach (BluetoothLEDeviceDisplay bleDeviceDisplay in KnownDevices)
00139             {
00140                 if (bleDeviceDisplay.Id == id)
00141                 {
00142                     return bleDeviceDisplay;
00143                 }
00144             }
00145             return null;
00146         }
00147
00148         private DeviceInformation FindUnknownDevices(string id)
00149         {
00150             foreach (DeviceInformation bleDeviceInfo in UnknownDevices)
00151             {
00152                 if (bleDeviceInfo.Id == id)
00153                 {
00154                     return bleDeviceInfo;
00155                 }
00156             }
00157             return null;
00158         }
00159
00160         private async void DeviceWatcher_Added(DeviceWatcher sender, DeviceInformation deviceInfo)
00161         {
00162             // We must update the collection on the UI thread because the collection is databound to a UI element.
00163             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00164             {
00165                 lock (this)
00166                 {
00167                     Debug.WriteLine(String.Format("Added {0}{1}", deviceInfo.Id, deviceInfo.Name));
00168
00169                     // Protect against race condition if the task runs after the app stopped the deviceWatcher.
00170                     if (sender == deviceWatcher)
00171                     {
00172                         // Make sure device isn't already present in the list.
00173                         if (FindBluetoothLEDeviceDisplay(deviceInfo.Id) == null)
00174                         {
00175                             if (deviceInfo.Name != string.Empty)
00176                             {
00177                                 // If device has a friendly name display it immediately.
00178                                 KnownDevices.Add(new BluetoothLEDeviceDisplay(deviceInfo));
00179                             }
00180                             else
00181                             {
00182                                 // Add it to a list in case the name gets updated later.
00183                                 UnknownDevices.Add(deviceInfo);
00184                             }
00185                         }
00186
00187                     }
00188                 }
00189             });
00190         }
00191
00192         private async void DeviceWatcher_Updated(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00193         {
00194             // We must update the collection on the UI thread because the collection is databound to a UI element.
00195             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00196             {
00197                 lock (this)
00198                 {
00199                     Debug.WriteLine(String.Format("Updated {0}{1}", deviceInfoUpdate.Id, ""));
00200
00201                     // Protect against race condition if the task runs after the app stopped the deviceWatcher.
00202                     if (sender == deviceWatcher)
00203                     {
00204                         BluetoothLEDeviceDisplay bleDeviceDisplay = FindBluetoothLEDeviceDisplay(deviceInfoUpdate.Id);
00205                         if (bleDeviceDisplay != null)
00206                         {
00207                             // Device is already being displayed - update UX.
00208                             bleDeviceDisplay.Update(deviceInfoUpdate);
00209                             return;
00210                         }
00211
00212                         DeviceInformation deviceInfo = FindUnknownDevices(deviceInfoUpdate.Id);
00213                         if (deviceInfo != null)
00214                         {
00215                             deviceInfo.Update(deviceInfoUpdate);
00216                             // If device has been updated with a friendly name it's no longer unknown.
00217                             if (deviceInfo.Name != String.Empty)
00218                             {
00219                                 KnownDevices.Add(new BluetoothLEDeviceDisplay(deviceInfo));
00220                                 UnknownDevices.Remove(deviceInfo);
00221                             }
00222                         }
00223                     }
00224                 }
00225             });
00226         }
00227
00228         private async void DeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00229         {
00230             // We must update the collection on the UI thread because the collection is databound to a UI element.
00231             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00232             {
00233                 lock (this)
00234                 {
00235                     Debug.WriteLine(String.Format("Removed {0}{1}", deviceInfoUpdate.Id,""));
00236
00237                     // Protect against race condition if the task runs after the app stopped the deviceWatcher.
00238                     if (sender == deviceWatcher)
00239                     {
00240                         // Find the corresponding DeviceInformation in the collection and remove it.
00241                         BluetoothLEDeviceDisplay bleDeviceDisplay = FindBluetoothLEDeviceDisplay(deviceInfoUpdate.Id);
00242                         if (bleDeviceDisplay != null)
00243                         {
00244                             KnownDevices.Remove(bleDeviceDisplay);
00245                         }
00246
00247                         DeviceInformation deviceInfo = FindUnknownDevices(deviceInfoUpdate.Id);
00248                         if (deviceInfo != null)
00249                         {
00250                             UnknownDevices.Remove(deviceInfo);
00251                         }
00252                     }
00253                 }
00254             });
00255         }
00256
00257         private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object e)
00258         {
00259             // We must update the collection on the UI thread because the collection is databound to a UI element.
00260             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00261             {
00262                 // Protect against race condition if the task runs after the app stopped the deviceWatcher.
00263                 if (sender == deviceWatcher)
00264                 {
00265                     rootPage.NotifyUser($"{KnownDevices.Count} devices found. Enumeration completed.",
00266                         NotifyType.StatusMessage);
00267                 }
00268             });
00269         }
00270
00271         private async void DeviceWatcher_Stopped(DeviceWatcher sender, object e)
00272         {
00273             // We must update the collection on the UI thread because the collection is databound to a UI element.
00274             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00275             {
00276                 // Protect against race condition if the task runs after the app stopped the deviceWatcher.
00277                 if (sender == deviceWatcher)
00278                 {
00279                     rootPage.NotifyUser($"No longer watching for devices.",
00280                             sender.Status == DeviceWatcherStatus.Aborted ? NotifyType.ErrorMessage : NotifyType.StatusMessage);
00281                 }
00282             });
00283         }
00284         #endregion
00285
00286         #region Pairing
00287
00288         private bool isBusy = false;
00289
00290         private async void PairButton_Click()
00291         {
00292             // Do not allow a new Pair operation to start if an existing one is in progress.
00293             if (isBusy)
00294             {
00295                 return;
00296             }
00297
00298             isBusy = true;
00299
00300             rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);
00301
00302             // For more information about device pairing, including examples of
00303             // customizing the pairing process, see the DeviceEnumerationAndPairing sample.
00304
00305             // Capture the current selected item in case the user changes it while we are pairing.
00306             var bleDeviceDisplay = ResultsListView.SelectedItem as BluetoothLEDeviceDisplay;
00307
00308             // BT_Code: Pair the currently selected device.
00309             DevicePairingResult result = await bleDeviceDisplay.DeviceInformation.Pairing.PairAsync();
00310             rootPage.NotifyUser($"Pairing result = {result.Status}",
00311                 result.Status == DevicePairingResultStatus.Paired || result.Status == DevicePairingResultStatus.AlreadyPaired
00312                     ? NotifyType.StatusMessage
00313                     : NotifyType.ErrorMessage);
00314
00315             isBusy = false;
00316         }
00317
00318         #endregion
00319     }
00320 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario07_PostStreamWithProgress.cpp Source File

  • HttpClient
  • cppwinrt

Scenario07_PostStreamWithProgress.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario07_PostStreamWithProgress.h"
00014 #include "Scenario07_PostStreamWithProgress.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include "Helpers.h"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::Windows::Web::Http;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario07_PostStreamWithProgress::Scenario07_PostStreamWithProgress()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario07_PostStreamWithProgress::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         httpClient = Helpers::CreateHttpClientWithCustomHeaders();
00034     }
00035
00036     void Scenario07_PostStreamWithProgress::OnNavigatedFrom(NavigationEventArgs const&)
00037     {
00038         httpClient.Close();
00039     }
00040
00041     void Scenario07_PostStreamWithProgress::UpdateAddressField()
00042     {
00043         // Tell the server we want a transfer-encoding chunked response.
00044         hstring queryString{};
00045         if (ChunkedResponseToggle().IsOn())
00046         {
00047             queryString = L"?chunkedResponse=1";
00048         }
00049
00050         Helpers::ReplaceQueryString(AddressField(), queryString);
00051     }
00052
00053     void Scenario07_PostStreamWithProgress::ChunkedResponseToggle_Toggled(IInspectable const&, RoutedEventArgs const&)
00054     {
00055         UpdateAddressField();
00056     }
00057
00058     fire_and_forget Scenario07_PostStreamWithProgress::Start_Click(IInspectable const&, RoutedEventArgs const&)
00059     {
00060         auto lifetime = get_strong();
00061
00062         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00063         // valid, absolute URI, we'll notify the user about the incorrect input.
00064         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00065         if (!resourceUri)
00066         {
00067             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00068             return;
00069         }
00070
00071         Helpers::ScenarioStarted(StartButton(), CancelButton(), nullptr);
00072         ResetFields();
00073         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00074
00075         static constexpr uint32_t streamLength = 100000;
00076         HttpStreamContent streamContent{ SlowInputStream(streamLength) };
00077
00078         // If stream length is unknown, the request is chunked transfer encoded.
00079         if (!ChunkedRequestToggle().IsOn())
00080         {
00081             streamContent.Headers().ContentLength(streamLength);
00082         }
00083
00084         // This sample uses a "try" in order to support cancellation.
00085         // If you don't need to support cancellation, then the "try" is not needed.
00086         try
00087         {
00088             pendingAction = CancelableRequestAsync(resourceUri, streamContent);
00089             co_await pendingAction;
00090         }
00091         catch (hresult_canceled const&)
00092         {
00093             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00094         }
00095
00096         Helpers::ScenarioCompleted(StartButton(), CancelButton());
00097     }
00098
00099     IAsyncAction Scenario07_PostStreamWithProgress::CancelableRequestAsync(Uri resourceUri, IHttpContent content)
00100     {
00101         auto lifetime = get_strong();
00102         auto cancellation = co_await get_cancellation_token();
00103         cancellation.enable_propagation();
00104
00105         IAsyncOperationWithProgress<HttpRequestResult, HttpProgress> operation = httpClient.TryPostAsync(resourceUri, content);
00106         operation.Progress({ get_weak(), &Scenario07_PostStreamWithProgress::ProgressHandler });
00107
00108         HttpRequestResult result = co_await operation;
00109
00110         if (result.Succeeded())
00111         {
00112             rootPage.NotifyUser(L"Completed", NotifyType::StatusMessage);
00113         }
00114         else
00115         {
00116             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00117         }
00118     }
00119
00120     void Scenario07_PostStreamWithProgress::ResetFields()
00121     {
00122         StageField().Text(L"");
00123         RetriesField().Text(L"0");
00124         BytesSentField().Text(L"0");
00125         TotalBytesToSendField().Text(L"0");
00126         BytesReceivedField().Text(L"0");
00127         TotalBytesToReceiveField().Text(L"0");
00128         RequestProgressBar().Value(0);
00129     }
00130
00131     fire_and_forget Scenario07_PostStreamWithProgress::ProgressHandler(
00132         IAsyncOperationWithProgress<HttpRequestResult, HttpProgress> const&,
00133         HttpProgress progress)
00134     {
00135         auto lifetime = get_strong();
00136
00137         co_await resume_foreground(Dispatcher());
00138
00139         StageField().Text(to_hstring(progress.Stage));
00140         RetriesField().Text(to_hstring(progress.Retries));
00141         BytesSentField().Text(to_hstring(progress.BytesSent));
00142         BytesReceivedField().Text(to_hstring(progress.BytesReceived));
00143
00144         uint64_t totalBytesToSend = 0;
00145         if (progress.TotalBytesToSend != nullptr)
00146         {
00147             totalBytesToSend = progress.TotalBytesToSend.Value();
00148             TotalBytesToSendField().Text(to_hstring(totalBytesToSend));
00149         }
00150         else
00151         {
00152             TotalBytesToSendField().Text(L"unknown");
00153         }
00154
00155         uint64_t totalBytesToReceive = 0;
00156         if (progress.TotalBytesToReceive != nullptr)
00157         {
00158             totalBytesToReceive = progress.TotalBytesToReceive.Value();
00159             TotalBytesToReceiveField().Text(to_hstring(totalBytesToReceive));
00160         }
00161         else
00162         {
00163             TotalBytesToReceiveField().Text(L"unknown");
00164         }
00165
00166         double requestProgress = 0.0;
00167         if (progress.Stage == HttpProgressStage::SendingContent && totalBytesToSend > 0)
00168         {
00169             requestProgress = progress.BytesSent * 50.0 / totalBytesToSend;
00170         }
00171         else if (progress.Stage == HttpProgressStage::ReceivingContent)
00172         {
00173             // Start with 50 percent, request content was already sent.
00174             requestProgress += 50.0;
00175
00176             if (totalBytesToReceive > 0)
00177             {
00178                 requestProgress += progress.BytesReceived * 50.0 / totalBytesToReceive;
00179             }
00180         }
00181         else
00182         {
00183             return;
00184         }
00185
00186         RequestProgressBar().Value(requestProgress);
00187     }
00188
00189     void Scenario07_PostStreamWithProgress::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00190     {
00191         if (pendingAction)
00192         {
00193             pendingAction.Cancel();
00194         }
00195     }
00196 }
Generated on Fri Nov 15 2024 22:19:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MFSampleGenerator.h Source File

  • WindowsAudioSession
  • cpp

MFSampleGenerator.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // MFSampleGenerator.h
00013 //
00014
00015 #include <windows.h>
00016 #include <mfapi.h>
00017 #include <mfidl.h>
00018 #include <mfreadwrite.h>
00019 #include <mferror.h>
00020 #include "MainPage.xaml.h"
00021
00022 using namespace Windows::Storage::Streams;
00023
00024 #define PREROLL_DURATION_SEC 3     // Arbitrary value for seconds of data in preroll buffer
00025
00026
00027 #pragma once
00028
00029 namespace SDKSample
00030 {
00031     namespace WASAPIAudio
00032     {
00033         class MFSampleGenerator :
00034             public IMFSourceReaderCallback
00035         {
00036         public:
00037             enum ReaderState
00038             {
00039                 ReaderStateStopped,
00040                 ReaderStatePreRoll,
00041                 ReaderStatePlaying,
00042                 ReaderStateEOS
00043             };
00044
00045             MFSampleGenerator();
00046
00047             // IUnknown
00048             STDMETHODIMP_ (ULONG) AddRef()
00049             {
00050                 return InterlockedIncrement(&m_Ref);
00051             }
00052
00053             STDMETHODIMP_ (ULONG) Release()
00054             {
00055                 LONG ref = InterlockedDecrement(&m_Ref);
00056
00057                 if (ref == 0)
00058                 {
00059                     delete this;
00060                 }
00061
00062                 return ref;
00063             }
00064
00065             STDMETHODIMP_ (HRESULT) QueryInterface(const IID &riid, void ** ppv)
00066             {
00067                 HRESULT hr = E_NOINTERFACE;
00068                 *ppv = NULL;
00069
00070                 if (riid == IID_IMFSourceReaderCallback || riid == IID_IUnknown)
00071                 {
00072                     *ppv = static_cast<IMFSourceReaderCallback *>(this);
00073                     ((IUnknown*) *ppv)->AddRef();
00074                     hr = S_OK;
00075                 }
00076
00077                 return hr;
00078             }
00079
00080             // IMFSourceReaderCallback
00081             STDMETHODIMP_ (HRESULT) OnEvent(_In_ DWORD dwStreamIndex, _In_ IMFMediaEvent *pEvent);
00082             STDMETHODIMP_ (HRESULT) OnFlush(_In_ DWORD dwStreamIndex);
00083             STDMETHODIMP_ (HRESULT) OnReadSample(_In_ HRESULT hrStatus, _In_ DWORD dwStreamIndex, _In_ DWORD dwStreamFlags, _In_ LONGLONG llTimestamp, _In_opt_ IMFSample *pSample);
00084
00085             // MFSampleGenerator
00086             HRESULT StartSource();
00087             void StopSource();
00088
00089             HRESULT Initialize( IRandomAccessStream^ stream, UINT32 FramesPerPeriod, WAVEFORMATEX *wfx );
00090             void Shutdown();
00091             HRESULT FillSampleBuffer( UINT32 BytesToRead, BYTE *Data, UINT32 *cbWritten );
00092             void Flush();
00093
00094             Platform::Boolean IsEOF()
00095             {
00096                 if ( ( m_SampleQueue == nullptr ) &&
00097                      ( m_ReaderState == ReaderStateEOS ) )
00098                     return true;
00099
00100                 return false;
00101             }
00102
00103         private:
00104             ~MFSampleGenerator();
00105
00106             HRESULT ConfigureStreams();
00107             HRESULT CreateAudioType( IMFMediaType **MediaType );
00108             HRESULT AddSamplesToQueue( IMFSample *MFSample );
00109             Platform::Boolean IsPreRollFilled();
00110
00111         private:
00112             volatile ULONG          m_Ref;
00113             IRandomAccessStream^    m_ContentStream;
00114             WAVEFORMATEX           *m_MixFormat;
00115             UINT32                  m_BytesPerPeriod;
00116             Platform::Boolean       m_IsInitialized;
00117
00118             IMFSourceReader        *m_MFSourceReader;
00119             IMFMediaType           *m_AudioMT;
00120             ReaderState             m_ReaderState;
00121
00122             RenderBuffer           *m_SampleQueue;
00123             RenderBuffer          **m_SampleQueueTail;
00124         };
00125     }
00126 }
00127
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/pch.cpp Source File

  • AnimationMetrics
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_FilePlayback Member List

This is the complete list of members for Scenario1_FilePlayback, including all inherited members.
CreateAudioGraph() | Scenario1_FilePlayback | [inline, private]
deviceOutput | Scenario1_FilePlayback | [private]
File_Click(object sender, RoutedEventArgs e) | Scenario1_FilePlayback | [inline, private]
fileInput | Scenario1_FilePlayback | [private]
graph | Scenario1_FilePlayback | [private]
Graph_Click(object sender, RoutedEventArgs e) | Scenario1_FilePlayback | [inline, private]
LoopToggle_Toggled(object sender, RoutedEventArgs e) | Scenario1_FilePlayback | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_FilePlayback | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_FilePlayback | [inline, protected]
PlaySpeedSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) | Scenario1_FilePlayback | [inline, private]
rootPage | Scenario1_FilePlayback | [private]
Scenario1_FilePlayback() | Scenario1_FilePlayback | [inline]
TogglePlay() | Scenario1_FilePlayback | [inline, private]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ApduResponse Member List

This is the complete list of members for ApduResponse, including all inherited members.
ApduResponse() | ApduResponse | [inline]
ExtractResponse(IBuffer response) | ApduResponse | [inline, virtual]
ExtractTlvDataObject(byte[] referenceTag) | ApduResponse | [inline]
ResponseData | ApduResponse |
Succeeded | ApduResponse |
SW | ApduResponse |
SW1 | ApduResponse |
SW2 | ApduResponse |
SWTranslation | ApduResponse |
TAG_COMPREHENSION_MASK | ApduResponse |
TAG_LENGTH_MULTI_BYTE_MASK | ApduResponse |
TAG_MULTI_BYTE_MASK | ApduResponse |
ToString() | ApduResponse | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/SampleOverlay.cpp Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

SampleOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleOverlay.h"
00014
00015 using namespace CustomVertexShader;
00016
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::Foundation;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::Graphics::Display;
00022 using namespace D2D1;
00023
00024 SampleOverlay::SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption) :
00025     m_deviceResources(deviceResources),
00026     m_caption(caption),
00027     m_drawOverlay(true)
00028 {
00029     m_padding = 8.0f;
00030     m_textVerticalOffset = 7.0f;
00031     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00032     m_overlayWidth = 0.0f;
00033
00034     CreateDeviceDependentResources();
00035     CreateWindowSizeDependentResources();
00036 }
00037
00038 void SampleOverlay::CreateDeviceDependentResources()
00039 {
00040     DX::ThrowIfFailed(
00041         m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
00042         );
00043
00044     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00045     DX::ThrowIfFailed(
00046         m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
00047             L"Assets\\storelogo-sdk.png",
00048             nullptr,
00049             GENERIC_READ,
00050             WICDecodeMetadataCacheOnDemand,
00051             &wicBitmapDecoder
00052             )
00053         );
00054
00055     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00056     DX::ThrowIfFailed(
00057         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00058         );
00059
00060     ComPtr<IWICFormatConverter> wicFormatConverter;
00061     DX::ThrowIfFailed(
00062         m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
00063         );
00064
00065     DX::ThrowIfFailed(
00066         wicFormatConverter->Initialize(
00067             wicBitmapFrame.Get(),
00068             GUID_WICPixelFormat32bppPBGRA,
00069             WICBitmapDitherTypeNone,
00070             nullptr,
00071             0.0,
00072             WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
00073             )
00074         );
00075
00076     double dpiX = 96.0;
00077     double dpiY = 96.0;
00078     DX::ThrowIfFailed(
00079         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00080         );
00081
00082     DX::ThrowIfFailed(
00083         m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
00084             wicFormatConverter.Get(),
00085             BitmapProperties(
00086                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00087                 static_cast<float>(dpiX),
00088                 static_cast<float>(dpiY)
00089                 ),
00090             &m_logoBitmap
00091             )
00092         );
00093
00094     m_logoSize = m_logoBitmap->GetSize();
00095
00096     ComPtr<IDWriteTextFormat> nameTextFormat;
00097     DX::ThrowIfFailed(
00098         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00099             L"Segoe UI",
00100             nullptr,
00101             DWRITE_FONT_WEIGHT_LIGHT,
00102             DWRITE_FONT_STYLE_NORMAL,
00103             DWRITE_FONT_STRETCH_NORMAL,
00104             36.0f,
00105             L"en-US",
00106             &nameTextFormat
00107             )
00108         );
00109
00110     DX::ThrowIfFailed(
00111         nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00112         );
00113
00114     DX::ThrowIfFailed(
00115         nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00116         );
00117
00118     DX::ThrowIfFailed(
00119         m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00120             m_caption.c_str(),
00121             static_cast<UINT32>(m_caption.size()),
00122             nameTextFormat.Get(),
00123             4096.0f,
00124             4096.0f,
00125             &m_textLayout
00126             )
00127         );
00128
00129     DWRITE_TEXT_METRICS metrics = {0};
00130     DX::ThrowIfFailed(
00131         m_textLayout->GetMetrics(&metrics)
00132         );
00133
00134     m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;
00135
00136     DX::ThrowIfFailed(
00137         m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
00138         );
00139 }
00140
00141 void SampleOverlay::CreateWindowSizeDependentResources()
00142 {
00143     if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
00144     {
00145         m_drawOverlay = false;
00146     }
00147     else
00148     {
00149         m_drawOverlay = true;
00150     }
00151 }
00152
00153 // Release all references to resources that depend on the graphics device.
00154 // This method is invoked when the device is lost and resources are no longer usable.
00155 void SampleOverlay::ReleaseDeviceDependentResources()
00156 {
00157     m_whiteBrush.Reset();
00158     m_logoBitmap.Reset();
00159 }
00160
00161 void SampleOverlay::Render()
00162 {
00163     if (m_drawOverlay)
00164     {
00165         m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());
00166
00167         m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00168         m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00169         m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
00170             m_logoBitmap.Get(),
00171             D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
00172             );
00173
00174         m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
00175             Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
00176             m_textLayout.Get(),
00177             m_whiteBrush.Get()
00178             );
00179
00180         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00181         // is lost. It will be handled during the next call to Present.
00182         HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00183         if (hr != D2DERR_RECREATE_TARGET)
00184         {
00185             DX::ThrowIfFailed(hr);
00186         }
00187
00188         m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
00189     }
00190 }
00191
00192 float SampleOverlay::GetTitleHeightInDips()
00193 {
00194     return m_logoSize.height + m_padding;
00195 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSendOperationStatus Member List

This is the complete list of members for CSendOperationStatus, including all inherited members.
__pad0__ | CSendOperationStatus |
_error | CSendOperationStatus | [private]
CheckException() | CSendOperationStatus | [inline]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingConsumer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace org { namespace alljoyn { namespace Onboarding {
00024
00025 public interface class IOnboardingConsumer
00026 {
00027 };
00028
00029 public ref class OnboardingConsumer sealed  : [Windows::Foundation::Metadata::Default] IOnboardingConsumer, ISignalEmitter
00030 {
00031 public:
00032     OnboardingConsumer(Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00033     virtual ~OnboardingConsumer();
00034
00035     // Create a consumer from a device Id asynchronously.
00036     //
00037     // This is usually called to create a consumer after the unique name of a producer has been reported
00038     // in the Added callback on the DeviceWatcher.
00039     static Windows::Foundation::IAsyncOperation<OnboardingConsumer^>^ FromIdAsync(_In_ Platform::String^ deviceId);
00040
00041     // Create a consumer from a device Id asynchronously with the provided bus attachment.
00042     //
00043     // This is usually called to create a consumer after the unique name of a producer has been reported
00044     // in the Added callback on the DeviceWatcher.
00045     static Windows::Foundation::IAsyncOperation<OnboardingConsumer^>^ FromIdAsync(_In_ Platform::String^ deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00046
00047     int32 OnboardingConsumer::Initialize(_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^ serviceInfo);
00048
00049     // "Sends the personal AP information to the onboardee"
00050     // Call the ConfigureWiFi method
00051     Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^>^ ConfigureWiFiAsync(_In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType);
00052     // "Tells the onboardee to connect to the personal AP"
00053     // Call the Connect method
00054     Windows::Foundation::IAsyncOperation<OnboardingConnectResult^>^ ConnectAsync();
00055     // "Tells the onboardee to disconnect from the personal AP"
00056     // Call the Offboard method
00057     Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^>^ OffboardAsync();
00058     // "Scans all the Wi-Fi access points in the onboardee's proximity"
00059     // Call the GetScanInfo method
00060     Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^>^ GetScanInfoAsync();
00061
00062     // "Interface version number"
00063     // Get the value of the Version property.
00064     Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^>^ GetVersionAsync();
00065
00066     // "The configuration state"
00067     // Get the value of the State property.
00068     Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^>^ GetStateAsync();
00069
00070     // "The last error code and error message"
00071     // Get the value of the LastError property.
00072     Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^>^ GetLastErrorAsync();
00073
00074
00075     // Used to send signals or register functions to handle received signals.
00076     property OnboardingSignals^ Signals
00077     {
00078         OnboardingSignals^ get() { return m_signals; }
00079     }
00080
00081     // Used to get the name of the interface this consumer implements.
00082     static property Platform::String^ InterfaceName
00083     {
00084         Platform::String^ get() { return AllJoynHelpers::MultibyteToPlatformString(m_interfaceName); }
00085     }
00086
00087     virtual property Windows::Devices::AllJoyn::AllJoynBusObject^ BusObject
00088     {
00089         Windows::Devices::AllJoyn::AllJoynBusObject^ get() { return m_busObject; }
00090     }
00091
00092     virtual property Windows::Devices::AllJoyn::AllJoynSession^ Session
00093     {
00094         Windows::Devices::AllJoyn::AllJoynSession^ get() { return m_session; }
00095     }
00096
00097 internal:
00098     // Consumers do not support property get.
00099     QStatus OnPropertyGet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val)
00100     {
00101         UNREFERENCED_PARAMETER(interfaceName); UNREFERENCED_PARAMETER(propertyName); UNREFERENCED_PARAMETER(val);
00102         return ER_NOT_IMPLEMENTED;
00103     }
00104
00105     // Consumers do not support property set.
00106     QStatus OnPropertySet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val)
00107     {
00108         UNREFERENCED_PARAMETER(interfaceName); UNREFERENCED_PARAMETER(propertyName); UNREFERENCED_PARAMETER(val);
00109         return ER_NOT_IMPLEMENTED;
00110     }
00111
00112     void OnPropertyChanged(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated);
00113
00114     property Platform::String^ ServiceObjectPath
00115     {
00116         Platform::String^ get() { return m_ServiceObjectPath; }
00117         void set(Platform::String^ value) { m_ServiceObjectPath = value; }
00118     }
00119
00120     property alljoyn_proxybusobject ProxyBusObject
00121     {
00122         alljoyn_proxybusobject get() { return m_proxyBusObject; }
00123         void set(alljoyn_proxybusobject value) { m_proxyBusObject = value; }
00124     }
00125
00126 private:
00127     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionLost;
00128     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberAdded;
00129     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberRemoved;
00130
00131     // Register a callback function to handle incoming signals.
00132     QStatus AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler);
00133
00134     // "This signal is emitted when the connection attempt against the personal AP is completed"
00135     static void CallConnectionResultSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message);
00136
00137     Windows::Devices::AllJoyn::AllJoynBusAttachment^ m_busAttachment;
00138     Windows::Devices::AllJoyn::AllJoynBusObject^ m_busObject;
00139     Windows::Devices::AllJoyn::AllJoynSession^ m_session;
00140     OnboardingSignals^ m_signals;
00141     Platform::String^ m_ServiceObjectPath;
00142
00143     alljoyn_proxybusobject m_proxyBusObject;
00144     alljoyn_sessionlistener m_sessionListener;
00145     alljoyn_busobject m_nativeBusObject;
00146     alljoyn_busattachment m_nativeBusAttachment;
00147
00148     // Used to pass a pointer to this class to callbacks
00149     Platform::WeakReference* m_weak;
00150
00151     // This map is required because we need a way to pass the consumer to the signal
00152     // handlers, but the current AllJoyn C API does not allow passing a context to these
00153     // callbacks.
00154     static std::map<alljoyn_interfacedescription, Platform::WeakReference*> SourceInterfaces;
00155
00156     // The name of the interface this consumer implements.
00157     static PCSTR m_interfaceName;
00158 };
00159
00160 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Scenario1_CustomDry.xaml.cpp Source File

  • ComplexInk
  • cpp

Scenario1_CustomDry.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_CustomDry.xaml.h"
00013
00014 using namespace Platform;
00015 using namespace Windows::Foundation;
00016 using namespace Windows::Foundation::Collections;
00017 using namespace Windows::UI::Input::Inking;
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::UI::Xaml::Controls;
00020 using namespace Windows::UI::Xaml::Controls::Primitives;
00021 using namespace Windows::UI::Xaml::Data;
00022 using namespace Windows::UI::Xaml::Input;
00023 using namespace Windows::UI::Xaml::Media;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::UI::Xaml::Media::Imaging;
00026 using namespace Windows::UI::Input::Inking::Core;
00027 using namespace Windows::UI::Input::Inking;
00028 using namespace SDKTemplate;
00029
00030 // InkCanvas has a limit for the content width/height to be no more than 2^21 physical pixels.
00031 // Here we set the large canvas’s size according to that limit.
00032 const float LARGE_CANVAS_WIDTH = 1 << 21;
00033 const float LARGE_CANVAS_HEIGHT = 1 << 21;
00034
00035 SDKTemplate::Scenario1_CustomDry::Scenario1_CustomDry() : rootPage(MainPage::Current)
00036 {
00037     InitializeComponent();
00038
00039     // Configure the message logging to log all types. User can filter them later using the menuflyout.
00040     _isLoggingEnabled = false;
00041     _eventLogger = new InkEventLogger();
00042     if (_eventLogger != nullptr)
00043     {
00044         _eventLogger->SetConfiguration((LogEventTypes)(LogEventTypes::IndependentInputEventType |
00045             LogEventTypes::InkingEventType |
00046             LogEventTypes::StrokeEventType |
00047             LogEventTypes::UnprocessedInputEventType));
00048     }
00049
00050     // Page specific handlers
00051     this->SizeChanged +=
00052         ref new Windows::UI::Xaml::SizeChangedEventHandler(
00053             this, &SDKTemplate::Scenario1_CustomDry::OnSizeChanged);
00054
00055     this->Loaded +=
00056         ref new Windows::UI::Xaml::RoutedEventHandler(
00057             this, &SDKTemplate::Scenario1_CustomDry::OnLoaded);
00058
00059     // DPI change event handler
00060     Windows::Graphics::Display::DisplayInformation^ displayInformation = Windows::Graphics::Display::DisplayInformation::GetForCurrentView();
00061     displayInformation->DpiChanged += ref new Windows::Foundation::TypedEventHandler<
00062         Windows::Graphics::Display::DisplayInformation^, Platform::Object^>(
00063             this, &SDKTemplate::Scenario1_CustomDry::OnDpiChanged);
00064
00065     // Suspending event handler
00066     Windows::ApplicationModel::Core::CoreApplication::Suspending += ref new EventHandler<
00067         Windows::ApplicationModel::SuspendingEventArgs^>(
00068             this, &SDKTemplate::Scenario1_CustomDry::OnSuspending);
00069
00070     // VSIS has a limit for it width/height to be no more
00071     // than 2^24 physical pixels. Therefore, we should
00072     // ensure to be within that limit by taking into consideration of
00073     // the ink canvas size, pinch zoom ratio, and DPI scaling ratio. The
00074     // physical pixel width/height of the virtual surface used to draw dry
00075     // ink is computed as
00076     // VirtualSurfacePixelWidth/Height =
00077     //     LARGE_CANVAS_Width/Height * Zoom_Factor * DPI_Scaling_Factor
00078     //
00079     // Given the large canvas’s width/height specified above, we set the
00080     // ScrollViewer's maximum zoom factor to 4 to accommodate the VSIS
00081     // limit when DPI scaling is up to 200%.
00082     inkScrollViewer->MaxZoomFactor = 4.0f;
00083     inkScrollViewer->MinZoomFactor = 0.25f;   // 1/4
00084
00085     // ScrollViewer event handler for pinch-zoom related scenario
00086     inkScrollViewer->ViewChanged += ref new Windows::Foundation::EventHandler<Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^>(
00087         this, &SDKTemplate::Scenario1_CustomDry::OnViewChanged);
00088
00089     // Configure Gesture Recognizer to get gestures that will bring up the context menu for cut/copy/paste
00090     _gestureRecognizer = ref new Windows::UI::Input::GestureRecognizer();
00091     _gestureRecognizer->GestureSettings = Windows::UI::Input::GestureSettings::Hold | Windows::UI::Input::GestureSettings::RightTap;
00092     _gestureRecognizer->ShowGestureFeedback = false;
00093
00094     // Gesture recognizer event handlers
00095     _gestureRecognizer->RightTapped +=
00096         ref new Windows::Foundation::TypedEventHandler<
00097         Windows::UI::Input::GestureRecognizer^, Windows::UI::Input::RightTappedEventArgs^>(
00098             this, &SDKTemplate::Scenario1_CustomDry::OnRightTapped);
00099
00100     _gestureRecognizer->Holding +=
00101         ref new Windows::Foundation::TypedEventHandler<
00102         Windows::UI::Input::GestureRecognizer^, Windows::UI::Input::HoldingEventArgs^>(
00103             this, &SDKTemplate::Scenario1_CustomDry::OnHolding);
00104
00105     // Activate custom drying and retrieve an InkSynchronizer that will be used to dry ink seamlessly
00106     Windows::UI::Input::Inking::InkSynchronizer^ inkSynchronizer = inkCanvas->InkPresenter->ActivateCustomDrying();
00107
00108     // InkCanvas and input processing configuration. Note that we cache the configuration in a member variable
00109     // because the InkPresenter->InputProcessingConfiguration can be queried only from the XAML UI thread.
00110     // Having retrieved it from there, we will then be able to access it from another thread, such as from the
00111     // independent input handler which runs on a background thread.
00112     // We don't need a lock to protect the configuration mode here because no other thread will have access to it
00113     // at the root page loading time.
00114     _config = inkCanvas->InkPresenter->InputProcessingConfiguration;
00115
00116     // Initially the mode is set to inking since we don't have a need to process the input through unprocessed handlers.
00117     // There is just one special case where we want unprocessed input in inking mode, and that is when the user wants to do
00118     // selection using barrel button. For this scenario we specify the right drag action to leave unprocessed.
00119     _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::Inking;
00120     _config->RightDragAction = Windows::UI::Input::Inking::InkInputRightDragAction::LeaveUnprocessed;
00121
00122     _inputMode = InputModes::InkingMode;
00123
00124     // Add Handlers
00125     EnableInkingEventHandlers();
00126     EnableIndependentInputEventHandlers();
00127     EnableUnprocessedInputEventHandlers();
00128     EnableLoggingIndependentInputEventHandlers(true);
00129     EnableLoggingUnprocessedInputEventHandlers(true);
00130     EnableLoggingStrokeEventHandlers(true);
00131
00132     // Collection of points for creating the selection rectangle
00133     _selectionPoints = ref new Platform::Collections::Vector<Windows::Foundation::Point>();
00134
00135     // Main component to render ink and shape objects
00136     _sceneComposer = std::make_unique<SceneComposer>();
00137
00138     assert(_sceneComposer != nullptr && inkSynchronizer != nullptr);
00139     _sceneComposer->SetInkSynchronizer(inkSynchronizer);
00140
00141     // Create the context menu flyout for copy, cut, and paste
00142     _contextMenuFlyout = ref new ContextMenuFlyout(_sceneComposer);
00143
00144     // Event handler for selection change in the input mode combobox
00145     InputMode->SelectionChanged += ref new Windows::UI::Xaml::Controls::SelectionChangedEventHandler(this, &SDKTemplate::Scenario1_CustomDry::InkingModeSelectionChanged);
00146 }
00147
00148
00149 //-----------------------------------------------------------------------------
00150 // Navigation And sizing
00151 //-----------------------------------------------------------------------------
00152
00153 void Scenario1_CustomDry::OnNavigatedTo(NavigationEventArgs^ e)
00154 {
00155 }
00156
00157 void SDKTemplate::Scenario1_CustomDry::OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
00158 {
00159     assert(_sceneComposer != nullptr);
00160     _sceneComposer->OnViewSizeChanged(Windows::Foundation::Size(e->NewSize.Width, e->NewSize.Height));
00161 }
00162
00163 //-----------------------------------------------------------------------------
00164 // Scenario UI Handlers  (Called on UI thread)
00165 //-----------------------------------------------------------------------------
00166
00167 void SDKTemplate::Scenario1_CustomDry::OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00168 {
00169     Point canvasSize = { 0, 0 };
00170
00171     // Get the viewport size of current window
00172     canvasSize.X = (float)(Window::Current->Bounds.Width);
00173     canvasSize.Y = (float)(Window::Current->Bounds.Height);
00174
00175     assert(_sceneComposer != nullptr);
00176
00177     // Set the VirtualSurfaceImageSource to the background of the Output grid
00178     _imageSource = _sceneComposer->Initialize(Windows::Foundation::Size(0, 0),
00179         Windows::Foundation::Size(canvasSize.X, canvasSize.Y));
00180
00181     ImageBrush^ imageBrush = ref new ImageBrush();
00182     imageBrush->ImageSource = _imageSource;
00183     Output->Background = imageBrush;
00184
00185     _sceneComposer->SetContentSize(Windows::Foundation::Size(LARGE_CANVAS_WIDTH, LARGE_CANVAS_HEIGHT));
00186
00187     // Set grid to the same size of the content
00188     Output->Width = LARGE_CANVAS_WIDTH;
00189     Output->Height = LARGE_CANVAS_HEIGHT;
00190 }
00191
00192 void SDKTemplate::Scenario1_CustomDry::OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^)
00193 {
00194     assert(_sceneComposer != nullptr);
00195     _sceneComposer->SetDPI(sender->LogicalDpi);
00196 }
00197
00198 void SDKTemplate::Scenario1_CustomDry::OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e)
00199 {
00200     assert(_sceneComposer != nullptr);
00201     _sceneComposer->Trim();
00202 }
00203
00204 void SDKTemplate::Scenario1_CustomDry::OnClear(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00205 {
00206     assert(_sceneComposer != nullptr);
00207     _sceneComposer->ClearScene();
00208
00209     if (_eventLogger != nullptr)
00210     {
00211         _eventLogger->ClearLog();
00212         MessageLog->Text = "";
00213     }
00214 }
00215
00216 void SDKTemplate::Scenario1_CustomDry::OnInsertShape(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00217 {
00218     assert(_sceneComposer != nullptr);
00219     _sceneComposer->UpdateShape();
00220 }
00221
00222 void SDKTemplate::Scenario1_CustomDry::InkingModeSelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00223 {
00224     assert(_sceneComposer != nullptr);
00225     if (!_sceneComposer->GetSceneSelectionRect().IsEmpty)
00226     {
00227         _sceneComposer->UnselectSceneObjects();
00228     }
00229
00230     Concurrency::critical_section::scoped_lock lock(_criticalSection);
00231
00232     if (InputMode->SelectedIndex == 3)
00233     {
00234         // Show InkToolbar
00235         inkToolbar->Visibility = Windows::UI::Xaml::Visibility::Visible;
00236         _inputMode = InputModes::InkToolbarMode;
00237     }
00238     else
00239     {
00240         inkToolbar->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00241         if (InputMode->SelectedIndex == 0)
00242         {
00243             _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::Inking;
00244             // We set the right drag action to leave unprocessed so that we can enable barrel button selection
00245             _config->RightDragAction = Windows::UI::Input::Inking::InkInputRightDragAction::LeaveUnprocessed;
00246             _inputMode = InputModes::InkingMode;
00247         }
00248         else if (InputMode->SelectedIndex == 1)
00249         {
00250             _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::None;
00251             _inputMode = InputModes::ErasingMode;
00252         }
00253         else if (InputMode->SelectedIndex == 2)
00254         {
00255             _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::None;
00256             _inputMode = InputModes::SelectingMode;
00257         }
00258     }
00259 }
00260
00261 void SDKTemplate::Scenario1_CustomDry::TouchInking_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00262 {
00263     inkCanvas->InkPresenter->InputDeviceTypes = Windows::UI::Core::CoreInputDeviceTypes::Pen |
00264         Windows::UI::Core::CoreInputDeviceTypes::Mouse |
00265         Windows::UI::Core::CoreInputDeviceTypes::Touch;
00266 }
00267
00268 void SDKTemplate::Scenario1_CustomDry::TouchInking_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00269 {
00270     inkCanvas->InkPresenter->InputDeviceTypes = Windows::UI::Core::CoreInputDeviceTypes::Pen |
00271         Windows::UI::Core::CoreInputDeviceTypes::Mouse;
00272 }
00273
00274 void SDKTemplate::Scenario1_CustomDry::InkingEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00275 {
00276     if (_eventLogger != nullptr)
00277     {
00278         _eventLogger->EnableLoggingConfiguration(InkingEventType, InkingEvent->IsChecked);
00279         // Don't enable/disable inking event handlers here since the strokes collected event is needs to be always on for custom dry.
00280     }
00281 }
00282
00283 void SDKTemplate::Scenario1_CustomDry::IndependentEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00284 {
00285     if (_eventLogger != nullptr)
00286     {
00287         _eventLogger->EnableLoggingConfiguration(IndependentInputEventType, IndependentEvent->IsChecked);
00288         EnableLoggingIndependentInputEventHandlers(IndependentEvent->IsChecked);
00289     }
00290 }
00291
00292 void SDKTemplate::Scenario1_CustomDry::UnprocessedEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00293 {
00294     if (_eventLogger != nullptr)
00295     {
00296         _eventLogger->EnableLoggingConfiguration(UnprocessedInputEventType, UnprocessedEvent->IsChecked);
00297         EnableLoggingUnprocessedInputEventHandlers(UnprocessedEvent->IsChecked);
00298     }
00299 }
00300
00301 void SDKTemplate::Scenario1_CustomDry::StrokeEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00302 {
00303     if (_eventLogger != nullptr)
00304     {
00305         _eventLogger->EnableLoggingConfiguration(StrokeEventType, StrokeEvent->IsChecked);
00306         EnableLoggingStrokeEventHandlers(StrokeEvent->IsChecked);
00307     }
00308 }
00309
00310 void SDKTemplate::Scenario1_CustomDry::LogToggleSwitch_Toggled(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00311 {
00312     _isLoggingEnabled = LogToggleSwitch->IsOn;
00313     MessageFilter->Visibility = _isLoggingEnabled ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00314     LogBorder->Visibility = _isLoggingEnabled ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
00315 }
00316
00317 //-----------------------------------------------------------------------------
00318 // Inking Event Handlers  (Called on UI thread)
00319 //-----------------------------------------------------------------------------
00320
00321 void SDKTemplate::Scenario1_CustomDry::OnStrokesCollected(Windows::UI::Input::Inking::InkPresenter^ sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^ args)
00322 {
00323     assert(_sceneComposer != nullptr);
00324     _sceneComposer->DoCustomDry();
00325
00326     Log(StrokeCollected);
00327 }
00328
00329 //-----------------------------------------------------------------------------
00330 // Unprocessed Input Event Handlers  (Called on UI thread)
00331 //-----------------------------------------------------------------------------
00332
00333 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerEntered(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00334 {
00335     Log(UnprocessedInputEntered);
00336 }
00337
00338 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerHovered(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00339 {
00340     Log(UnprocessedInputHover);
00341 }
00342
00343 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerPressed(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00344 {
00345     Windows::UI::Input::PointerPoint^ pointerPoint = args->CurrentPoint;
00346     _pointerId = pointerPoint->PointerId;
00347     _initialPointerPoint = pointerPoint;
00348
00349     _currentHitTestState = GetHitTestState(pointerPoint->Position);
00350     switch (_currentHitTestState)
00351     {
00352     case PointerHitTestStates::InsideSelectionRect:
00353         // If we are inside the selection rectangle we allow two types of interaction to bring up the context menu:
00354         // 1. Press and hold using touch
00355         // 2. Right click using pen and barrel button
00356         _gestureRecognizer->ProcessDownEvent(pointerPoint);
00357         break;
00358
00359     case PointerHitTestStates::InsideInkingArea:
00360         // There are two ways we reach this point:
00361         // 1. We are in selection mode and start a new selection
00362         // 2. We are in inking mode and start a right drag action using pen
00363
00364         // Note that when Paste is enabled we need to feed the gesture reco
00365         // as well as start a lasso selection since we don't know the intention
00366         // of the user yet.
00367         _currentHitTestSubState = GetInkingSubstate(args);
00368         switch (_currentHitTestSubState)
00369         {
00370         case InkingAreaSubStates::Erasing:
00371             _prevErasingPoint = pointerPoint->Position;
00372             break;
00373         case InkingAreaSubStates::Selecting:
00374             // In this state we are in barrel button selection and
00375             // paste is not enabled, so just do selection.
00376             StartStrokeSelection(pointerPoint->Position);
00377             break;
00378         case InkingAreaSubStates::SelectingOrPasting:
00379             // The user could be starting a selection or starting a
00380             // gesture to bring up the context menu to paste. So we
00381             // start selection but also feed the gesture recognizer.
00382             _gestureRecognizer->ProcessDownEvent(pointerPoint);
00383             StartStrokeSelection(pointerPoint->Position);
00384             break;
00385         default:
00386             break;
00387         }
00388         break;
00389
00390     default:
00391         break;
00392     }
00393
00394     Log(UnprocessedInputPressed);
00395 }
00396
00397 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerMoved(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00398 {
00399     Windows::UI::Input::PointerPoint^ pointerPoint = args->CurrentPoint;
00400
00401     if (_pointerId == pointerPoint->PointerId)
00402     {
00403         Windows::Foundation::Collections::IVector<Windows::UI::Input::PointerPoint^>^ pointerPoints = args->GetIntermediatePoints();
00404         assert(_sceneComposer != nullptr);
00405
00406         switch (_currentHitTestState)
00407         {
00408         case PointerHitTestStates::InsideSelectionRect:
00409             _gestureRecognizer->ProcessMoveEvents(pointerPoints);
00410             break;
00411
00412         case PointerHitTestStates::InsideInkingArea:
00413             switch (_currentHitTestSubState)
00414             {
00415             case InkingAreaSubStates::Erasing:
00416                 _sceneComposer->DoErase(_prevErasingPoint, args->CurrentPoint->Position);
00417                 _prevErasingPoint = pointerPoint->Position;
00418                 break;
00419             case InkingAreaSubStates::SelectingOrPasting:
00420                 _gestureRecognizer->ProcessMoveEvents(pointerPoints);
00421                 // We cascade to the logic of selecting below
00422                 // since we also want to do lasso selection
00423             case InkingAreaSubStates::Selecting:
00424                 _sceneComposer->DrawLasso(pointerPoint->Position);
00425             default:
00426                 break;
00427             }
00428             break;
00429
00430         default:
00431             break;
00432         }
00433     }
00434
00435     Log(UnprocessedInputMoved);
00436 }
00437
00438 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerReleased(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00439 {
00440     Windows::UI::Input::PointerPoint^ pointerPoint = args->CurrentPoint;
00441     assert(_sceneComposer != nullptr);
00442
00443     if (_pointerId == pointerPoint->PointerId)
00444     {
00445         switch (_currentHitTestState)
00446         {
00447         case PointerHitTestStates::InsideSelectionRect:
00448             _gestureRecognizer->ProcessUpEvent(pointerPoint);
00449             break;
00450
00451         case PointerHitTestStates::InsideInkingArea:
00452             switch (_currentHitTestSubState)
00453             {
00454             case InkingAreaSubStates::SelectingOrPasting:
00455                 _gestureRecognizer->ProcessUpEvent(pointerPoint);
00456                 // We cascade to the logic of selecting below
00457                 // since we also want to finish lasso selection
00458             case InkingAreaSubStates::Selecting:
00459                 assert(_selectionPoints != nullptr);
00460                 _selectionPoints->Clear();
00461                 // Create a rectangle with the initial and last position. This will be passed to the selectwithpolyline function
00462                 // on the stroke container, to determine the strokes within the rectangle and mark them as selected.
00463                 _selectionPoints->Append(_initialPointerPoint->Position);
00464                 _selectionPoints->Append(Windows::Foundation::Point(_initialPointerPoint->Position.X, pointerPoint->Position.Y));
00465                 _selectionPoints->Append(pointerPoint->Position);
00466                 _selectionPoints->Append(Windows::Foundation::Point(pointerPoint->Position.X, _initialPointerPoint->Position.Y));
00467
00468                 _sceneComposer->SelectSceneObjects(_selectionPoints);
00469                 _sceneComposer->Invalidate();
00470                 break;
00471             default:
00472                 break;
00473             }
00474             break;
00475
00476         default:
00477             break;
00478         }
00479     }
00480
00481     Log(UnprocessedInputReleased);
00482 }
00483
00484 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerExited(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00485 {
00486     Log(UnprocessedInputExited);
00487 }
00488
00489 void SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerLost(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00490 {
00491     // If we were maintaining any state that we would clean up on PointerReleased, we would also do it on PointerLost.
00492     // The only difference is that PointerReleased completes the operation while PointerLost aborts the operation.
00493     // Here we force an invalidation to remove any temporary drawing, e.g. the selection lasso.
00494     assert(_sceneComposer != nullptr);
00495     _sceneComposer->Invalidate();
00496     Log(UnprocessedInputLost);
00497 }
00498
00499 //-----------------------------------------------------------------------------
00500 // Independent Input Event Handlers  (Called on Background thread)
00501 //-----------------------------------------------------------------------------
00502
00503 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerPressing(CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00504 {
00505     assert(_sceneComposer != nullptr);
00506
00507     PointerHitTestStates currentHitTestState = GetHitTestState(args->CurrentPoint->Position);
00508     // When input is inside a selection rect, we don't want InkPresenter to handle it, e.g. generate ink.
00509     // Instead we want to treat it as unprocessed input so it can be handled by our own logic in unprocessed
00510     // input handler, such as used to move or resize selected ink (code not covered in this sample).
00511     if (currentHitTestState == PointerHitTestStates::InsideSelectionRect)
00512     {
00513         {
00514             Concurrency::critical_section::scoped_lock lock(_criticalSection);
00515             _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::None;
00516         }
00517     }
00518     else
00519     {
00520         // If input is outside of a selection rect, we need to restore the configuration mode based on the
00521         // UI setting since we may have changed it if the previous input was inside a selection rect.
00522         {
00523             Concurrency::critical_section::scoped_lock lock(_criticalSection);
00524             if (_inputMode == InputModes::InkingMode)
00525             {
00526                 _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::Inking;
00527             }
00528             else if (_inputMode != InputModes::InkToolbarMode)
00529             {
00530                 _config->Mode = Windows::UI::Input::Inking::InkInputProcessingMode::None;
00531             }
00532         }
00533         // We will always dismiss the selection rect if a new input is received outside of it, e.g. when user
00534         // starts to write a new stroke.
00535         if (!_sceneComposer->GetSceneSelectionRect().IsEmpty)
00536         {
00537             Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]()
00538             {
00539                 _sceneComposer->UnselectSceneObjects();
00540             }));
00541         }
00542     }
00543
00544     Log(IndependentInputPressed);
00545 }
00546
00547 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerMoving(CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00548 {
00549     Log(IndependentInputMoved);
00550 }
00551
00552 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerReleasing(CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00553 {
00554     Log(IndependentInputReleased);
00555 }
00556
00557 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerExiting(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00558 {
00559     Log(IndependentInputExited);
00560 }
00561
00562 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerEntering(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00563 {
00564     Log(IndependentInputEntered);
00565 }
00566
00567 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerHovering(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00568 {
00569     Log(IndependentInputHover);
00570 }
00571
00572 void SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerLost(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args)
00573 {
00574     Log(IndependentInputLost);
00575 }
00576
00577 //-----------------------------------------------------------------------------
00578 // Stroke Event Handlers  (Called on UI thread)
00579 //-----------------------------------------------------------------------------
00580
00581 void SDKTemplate::Scenario1_CustomDry::OnStrokeStarted(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00582 {
00583     Log(StrokeStarted);
00584 }
00585
00586 void SDKTemplate::Scenario1_CustomDry::OnStrokeContinued(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00587 {
00588     Log(StrokeContinued);
00589 }
00590
00591 void SDKTemplate::Scenario1_CustomDry::OnStrokeEnded(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00592 {
00593     Log(StrokeEnded);
00594 }
00595
00596 void SDKTemplate::Scenario1_CustomDry::OnStrokeCanceled(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args)
00597 {
00598     Log(StrokeCanceled);
00599 }
00600
00601 //-----------------------------------------------------------------------------
00602 // Gesture Recognizer Event Handlers  (Called on UI thread)
00603 //-----------------------------------------------------------------------------
00604
00605 void SDKTemplate::Scenario1_CustomDry::OnRightTapped(Windows::UI::Input::GestureRecognizer^ sender, Windows::UI::Input::RightTappedEventArgs^ args)
00606 {
00607     LaunchContextMenu(_initialPointerPoint->Position);
00608 }
00609
00610 void SDKTemplate::Scenario1_CustomDry::OnHolding(Windows::UI::Input::GestureRecognizer^ sender, Windows::UI::Input::HoldingEventArgs^ args)
00611 {
00612     // We only allow touch hold gesture to bring up context menu.
00613     if (args->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Touch && args->HoldingState == Windows::UI::Input::HoldingState::Started)
00614     {
00615         LaunchContextMenu(_initialPointerPoint->Position);
00616         _gestureRecognizer->CompleteGesture();
00617     }
00618 }
00619
00620 //-----------------------------------------------------------------------------
00621 // View Event Handlers  (Called on UI thread)
00622 //-----------------------------------------------------------------------------
00623
00624 void SDKTemplate::Scenario1_CustomDry::OnViewChanged(Platform::Object^, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e)
00625 {
00626     assert(_sceneComposer != nullptr);
00627     assert(inkScrollViewer->ZoomFactor >= 0.25 && inkScrollViewer->ZoomFactor <= 4);
00628     if (!e->IsIntermediate)
00629     {
00630         // content has been scaled during manipulation
00631         _sceneComposer->SetContentZoomFactor(inkScrollViewer->ZoomFactor);
00632     }
00633 }
00634
00635 //-----------------------------------------------------------------------------
00636 // Helper Methods
00637 //-----------------------------------------------------------------------------
00638
00639 void SDKTemplate::Scenario1_CustomDry::EnableInkingEventHandlers()
00640 {
00641     _strokesCollectedToken = inkCanvas->InkPresenter->StrokesCollected +=
00642         ref new Windows::Foundation::TypedEventHandler<
00643         Windows::UI::Input::Inking::InkPresenter^, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^>(
00644             this, &SDKTemplate::Scenario1_CustomDry::OnStrokesCollected);
00645 }
00646
00647 // Enable the PointerPressing handler for hit-testing.
00648 void SDKTemplate::Scenario1_CustomDry::EnableIndependentInputEventHandlers()
00649 {
00650     if (_independentInput == nullptr)
00651     {
00652         // Create Independent Input Source to handle input in background thread needed for
00653         // gesture detection
00654         _independentInput = CoreInkIndependentInputSource::Create(inkCanvas->InkPresenter);
00655     }
00656
00657     assert(_independentInput != nullptr);
00658     _independentInputPressingToken = _independentInput->PointerPressing +=
00659         ref new Windows::Foundation::TypedEventHandler<
00660         CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00661             this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerPressing);
00662 }
00663
00664 // Enable/disable the handlers that are used only for logging. The rest we
00665 // need in order to preserve inking functionality.
00666 void SDKTemplate::Scenario1_CustomDry::EnableLoggingIndependentInputEventHandlers(bool enable)
00667 {
00668     if (_independentInput == nullptr)
00669     {
00670         // Create Independent Input Source to handle input in background thread needed for
00671         // gesture detection
00672         _independentInput = CoreInkIndependentInputSource::Create(inkCanvas->InkPresenter);
00673     }
00674
00675     assert(_independentInput != nullptr);
00676     if (enable)
00677     {
00678         _independentInputMovingToken = _independentInput->PointerMoving +=
00679             ref new Windows::Foundation::TypedEventHandler<
00680             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00681                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerMoving);
00682
00683         _independentInputReleasingToken = _independentInput->PointerReleasing +=
00684             ref new Windows::Foundation::TypedEventHandler<
00685             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00686                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerReleasing);
00687
00688         _independentInputExitingToken = _independentInput->PointerExiting +=
00689             ref new Windows::Foundation::TypedEventHandler<
00690             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00691                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerExiting);
00692
00693         _independentInputEnteringToken = _independentInput->PointerEntering +=
00694             ref new Windows::Foundation::TypedEventHandler<
00695             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00696                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerEntering);
00697
00698         _independentInputHoveringToken = _independentInput->PointerHovering +=
00699             ref new Windows::Foundation::TypedEventHandler<
00700             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00701                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerHovering);
00702
00703         _independentInputLostToken = _independentInput->PointerLost +=
00704             ref new Windows::Foundation::TypedEventHandler<
00705             CoreInkIndependentInputSource^, Windows::UI::Core::PointerEventArgs^>(
00706                 this, &SDKTemplate::Scenario1_CustomDry::IndependentInputOnPointerLost);
00707     }
00708     else
00709     {
00710         _independentInput->PointerMoving -= _independentInputMovingToken;
00711         _independentInput->PointerReleasing -= _independentInputReleasingToken;
00712         _independentInput->PointerExiting -= _independentInputExitingToken;
00713         _independentInput->PointerEntering -= _independentInputEnteringToken;
00714         _independentInput->PointerHovering -= _independentInputHoveringToken;
00715         _independentInput->PointerLost -= _independentInputLostToken;
00716     }
00717 }
00718
00719 // Enable unprocessed input handlers used for interacting with ink.
00720 void SDKTemplate::Scenario1_CustomDry::EnableUnprocessedInputEventHandlers()
00721 {
00722     _unprocessedInputPressedToken = inkCanvas->InkPresenter->UnprocessedInput->PointerPressed +=
00723         ref new Windows::Foundation::TypedEventHandler<
00724         InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00725             this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerPressed);
00726
00727     _unprocessedInputMovedToken = inkCanvas->InkPresenter->UnprocessedInput->PointerMoved +=
00728         ref new Windows::Foundation::TypedEventHandler<
00729         InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00730             this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerMoved);
00731
00732     _unprocessedInputReleasedToken = inkCanvas->InkPresenter->UnprocessedInput->PointerReleased +=
00733         ref new Windows::Foundation::TypedEventHandler<
00734         InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00735             this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerReleased);
00736
00737     _unprocessedInputLostToken = inkCanvas->InkPresenter->UnprocessedInput->PointerLost +=
00738         ref new Windows::Foundation::TypedEventHandler<
00739         Windows::UI::Input::Inking::InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00740             this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerLost);
00741 }
00742
00743 // Enable/disable the handlers that are used only for logging. The rest we
00744 // need in order to preserve inking functionality.
00745 void SDKTemplate::Scenario1_CustomDry::EnableLoggingUnprocessedInputEventHandlers(bool enable)
00746 {
00747     if (enable)
00748     {
00749         _unprocessedInputEnteredToken = inkCanvas->InkPresenter->UnprocessedInput->PointerEntered +=
00750             ref new Windows::Foundation::TypedEventHandler<
00751             InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00752                 this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerEntered);
00753
00754         _unprocessedInputHoveredToken = inkCanvas->InkPresenter->UnprocessedInput->PointerHovered +=
00755             ref new Windows::Foundation::TypedEventHandler<
00756             InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00757                 this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerHovered);
00758
00759         _unprocessedInputExitedToken = inkCanvas->InkPresenter->UnprocessedInput->PointerExited +=
00760             ref new Windows::Foundation::TypedEventHandler<
00761             InkUnprocessedInput^, Windows::UI::Core::PointerEventArgs^>(
00762                 this, &SDKTemplate::Scenario1_CustomDry::UnprocessedInputOnPointerExited);
00763     }
00764     else
00765     {
00766         inkCanvas->InkPresenter->UnprocessedInput->PointerEntered -= _unprocessedInputEnteredToken;
00767         inkCanvas->InkPresenter->UnprocessedInput->PointerHovered -= _unprocessedInputHoveredToken;
00768         inkCanvas->InkPresenter->UnprocessedInput->PointerExited -= _unprocessedInputExitedToken;
00769     }
00770 }
00771
00772 void SDKTemplate::Scenario1_CustomDry::EnableLoggingStrokeEventHandlers(bool enable)
00773 {
00774     if (enable)
00775     {
00776         _strokeStartedToken = inkCanvas->InkPresenter->StrokeInput->StrokeStarted +=
00777             ref new Windows::Foundation::TypedEventHandler<
00778             InkStrokeInput^, Windows::UI::Core::PointerEventArgs^>(
00779                 this, &SDKTemplate::Scenario1_CustomDry::OnStrokeStarted);
00780
00781         _stokeContinuedToken = inkCanvas->InkPresenter->StrokeInput->StrokeContinued +=
00782             ref new Windows::Foundation::TypedEventHandler<
00783             InkStrokeInput^, Windows::UI::Core::PointerEventArgs^>(
00784                 this, &SDKTemplate::Scenario1_CustomDry::OnStrokeContinued);
00785
00786         _strokeEndedToken = inkCanvas->InkPresenter->StrokeInput->StrokeEnded +=
00787             ref new Windows::Foundation::TypedEventHandler<
00788             InkStrokeInput^, Windows::UI::Core::PointerEventArgs^>(
00789                 this, &SDKTemplate::Scenario1_CustomDry::OnStrokeEnded);
00790
00791         _strokeCanceledToken = inkCanvas->InkPresenter->StrokeInput->StrokeCanceled +=
00792             ref new Windows::Foundation::TypedEventHandler<
00793             Windows::UI::Input::Inking::InkStrokeInput^, Windows::UI::Core::PointerEventArgs^>(
00794                 this, &SDKTemplate::Scenario1_CustomDry::OnStrokeCanceled);
00795     }
00796     else
00797     {
00798         inkCanvas->InkPresenter->StrokeInput->StrokeStarted -= _strokeStartedToken;
00799         inkCanvas->InkPresenter->StrokeInput->StrokeContinued -= _stokeContinuedToken;
00800         inkCanvas->InkPresenter->StrokeInput->StrokeEnded -= _strokeEndedToken;
00801         inkCanvas->InkPresenter->StrokeInput->StrokeCanceled -= _strokeCanceledToken;
00802     }
00803 }
00804
00805 void SDKTemplate::Scenario1_CustomDry::Log(LogEventAction action)
00806 {
00807     if (_eventLogger != nullptr)
00808     {
00809         // Call dispatcher only if we are not in the UI Thread
00810         if (Dispatcher->HasThreadAccess)
00811         {
00812             UpdateMessageLog(action);
00813         }
00814         else
00815         {
00816             Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this, action]()
00817             {
00818                 UpdateMessageLog(action);
00819             }));
00820         }
00821     }
00822 }
00823
00824 void SDKTemplate::Scenario1_CustomDry::UpdateMessageLog(LogEventAction action)
00825 {
00826     if (_isLoggingEnabled)
00827     {
00828         _eventLogger->Log(action);
00829         MessageLog->Text = ref new Platform::String(_eventLogger->GetLog().c_str());
00830     }
00831 }
00832
00833 // Note that this method can be called on either UI thread (unprocessed input handlers) or Background thread (independent input handlers)
00834 Scenario1_CustomDry::PointerHitTestStates SDKTemplate::Scenario1_CustomDry::GetHitTestState(Windows::Foundation::Point position)
00835 {
00836     Concurrency::critical_section::scoped_lock lock(_criticalSection);
00837
00838     PointerHitTestStates currentMode = PointerHitTestStates::None;
00839
00840     // Determine the area and mode where the point landed
00841     if (_sceneComposer->GetSceneSelectionRect().Contains(position))
00842     {
00843         currentMode = PointerHitTestStates::InsideSelectionRect;
00844     }
00845     else
00846     {
00847         currentMode = PointerHitTestStates::InsideInkingArea;
00848     }
00849     return currentMode;
00850 }
00851
00852 // This method is used to determine the substate of inking when the input is not inside a selection rectangle.
00853 // It could be either
00854 // 1) Erasing with eraser button or in erasing mode;
00855 // 2) In inking mode with barrel button or in selection mode. The user could be starting a new selection or doing
00856 //    a paste if paste is enabled, i.e. user has performed copy/cut before.
00857 Scenario1_CustomDry::InkingAreaSubStates SDKTemplate::Scenario1_CustomDry::GetInkingSubstate(Windows::UI::Core::PointerEventArgs^ args)
00858 {
00859     InkingAreaSubStates state = InkingAreaSubStates::AreaNone;
00860
00861     if (_inputMode == InputModes::ErasingMode || args->CurrentPoint->Properties->IsEraser)
00862     {
00863         state = InkingAreaSubStates::Erasing;
00864     }
00865     else if ((_inputMode == InputModes::InkToolbarMode) &&
00866              (inkToolbar->ActiveTool == inkToolbar->GetToolButton(InkToolbarTool::Eraser)))
00867     {
00868         state = InkingAreaSubStates::Erasing;
00869     }
00870     else
00871     {
00872         // We're either in inking mode with barrel button or in selection mode so
00873         // determine the substate based on whether we can paste
00874         if (_sceneComposer->CanPaste())
00875         {
00876             state = InkingAreaSubStates::SelectingOrPasting;
00877         }
00878         else
00879         {
00880             state = InkingAreaSubStates::Selecting;
00881         }
00882     }
00883
00884     return state;
00885 }
00886
00887 void SDKTemplate::Scenario1_CustomDry::StartStrokeSelection(Windows::Foundation::Point position)
00888 {
00889     assert(_sceneComposer != nullptr);
00890     _sceneComposer->UnselectSceneObjects();
00891     _sceneComposer->StartLassoSelection(position);
00892 }
00893
00894 void SDKTemplate::Scenario1_CustomDry::LaunchContextMenu(Windows::Foundation::Point contextMenuPosition)
00895 {
00896     if (_contextMenuFlyout != nullptr)
00897     {
00898         // We enable Copy and Cut (but no Paste) over a selection. Everywhere else we enable only Paste.
00899         bool enablePasteMenuItem = (_currentHitTestState != PointerHitTestStates::InsideSelectionRect);
00900         _contextMenuFlyout->EnablePasteItemOnly(enablePasteMenuItem, contextMenuPosition);
00901         _contextMenuFlyout->ShowAt(inkCanvas, contextMenuPosition);
00902     }
00903 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ApplicationTriggerTask Member List

This is the complete list of members for ApplicationTriggerTask, including all inherited members.
ApplicationTriggerTask() | ApplicationTriggerTask | [inline]
ApplicationTriggerTask() | ApplicationTriggerTask | [inline]
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | ApplicationTriggerTask | [inline, private]
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | ApplicationTriggerTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | ApplicationTriggerTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | ApplicationTriggerTask | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | ApplicationTriggerTask | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | ApplicationTriggerTask | [inline, protected]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | ApplicationTriggerTask | [inline, private]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | ApplicationTriggerTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
rootPage | ApplicationTriggerTask | [private]
SignalBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
SignalBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
trigger | ApplicationTriggerTask | [private]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | ApplicationTriggerTask | [inline, private]
UpdateUI() | ApplicationTriggerTask | [inline, private]
UpdateUI() | ApplicationTriggerTask | [inline, private]
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

JsonRequest Member List

This is the complete list of members for JsonRequest, including all inherited members.
AddString(string key, string value) | JsonRequest | [inline]
Create() | JsonRequest | [inline, static]
E_WINHTTP_CANNOT_CONNECT | JsonRequest | [private]
E_WINHTTP_CONNECTION_ERROR | JsonRequest | [private]
E_WINHTTP_NAME_NOT_RESOLVED | JsonRequest | [private]
E_WINHTTP_TIMEOUT | JsonRequest | [private]
message | JsonRequest | [private]
PostAsync(string relativeUri) | JsonRequest | [inline]
serverBaseUri | JsonRequest | [private, static]
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/SampleConfiguration.cs Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "WRL Out-of-process Runtime Component";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Using Custom Components", ClassType=typeof(WRLOutOfProcessWinRTComponent.OvenClient)},
00025             new Scenario() { Title="Handling Windows Runtime Exceptions", ClassType=typeof(WRLOutOfProcessWinRTComponent.CustomException)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EmployeeDictionary Member List

This is the complete list of members for EmployeeDictionary, including all inherited members.
Add(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
Add(string key, IEmployee value) | EmployeeDictionary | [inline]
Add(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
Add(string key, IEmployee value) | EmployeeDictionary | [inline]
Clear() | EmployeeDictionary | [inline]
Clear() | EmployeeDictionary | [inline]
Contains(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
Contains(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
ContainsKey(string key) | EmployeeDictionary | [inline]
ContainsKey(string key) | EmployeeDictionary | [inline]
CopyTo(KeyValuePair< string, IEmployee >[] array, int arrayIndex) | EmployeeDictionary | [inline]
CopyTo(KeyValuePair< string, IEmployee >[] array, int arrayIndex) | EmployeeDictionary | [inline]
Count | EmployeeDictionary |
data | EmployeeDictionary | [private]
FireMapChanged(CollectionChange change, string key) | EmployeeDictionary | [inline, private]
FireMapChanged(CollectionChange change, string key) | EmployeeDictionary | [inline, private]
GetEnumerator() | EmployeeDictionary | [inline]
GetEnumerator() | EmployeeDictionary | [inline, private]
GetEnumerator() | EmployeeDictionary | [inline]
GetEnumerator() | EmployeeDictionary | [inline, private]
IsReadOnly | EmployeeDictionary |
Keys | EmployeeDictionary |
MapChanged | EmployeeDictionary |
Remove(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
Remove(string key) | EmployeeDictionary | [inline]
Remove(KeyValuePair< string, IEmployee > item) | EmployeeDictionary | [inline]
Remove(string key) | EmployeeDictionary | [inline]
this | EmployeeDictionary |
TryGetValue(string key, out IEmployee value) | EmployeeDictionary | [inline]
TryGetValue(string key, out IEmployee value) | EmployeeDictionary | [inline]
Values | EmployeeDictionary |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/ViewModels/PlaybackSessionViewModel.cs Source File

  • BackgroundMediaPlayback
  • cs
  • ViewModels

PlaybackSessionViewModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Media.Playback;
00008 using Windows.UI.Core;
00009
00010 namespace BackgroundMediaPlayback.ViewModels
00011 {
00012     public class PlaybackSessionViewModel : INotifyPropertyChanged, IDisposable
00013     {
00014         bool disposed;
00015         MediaPlayer player;
00016         MediaPlaybackSession playbackSession;
00017         CoreDispatcher dispatcher;
00018
00019         public MediaPlaybackState PlaybackState => playbackSession.PlaybackState;
00020         public event PropertyChangedEventHandler PropertyChanged;
00021
00022         public PlaybackSessionViewModel(MediaPlaybackSession playbackSession, CoreDispatcher dispatcher)
00023         {
00024             this.player = playbackSession.MediaPlayer;
00025             this.playbackSession = playbackSession;
00026             this.dispatcher = dispatcher;
00027
00028             playbackSession.PlaybackStateChanged += PlaybackSession_PlaybackStateChanged;
00029         }
00030
00031         private async void PlaybackSession_PlaybackStateChanged(MediaPlaybackSession sender, object args)
00032         {
00033             if (disposed) return;
00034             await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00035             {
00036                 if (disposed) return;
00037                 RaisePropertyChanged("PlaybackState");
00038             });
00039         }
00040
00041         public void Dispose()
00042         {
00043             if (disposed)
00044                 return;
00045
00046             playbackSession.PlaybackStateChanged -= PlaybackSession_PlaybackStateChanged;
00047
00048             disposed = true;
00049         }
00050
00051         private void RaisePropertyChanged(string propertyName)
00052         {
00053             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario3_AdaptiveSync.xaml.cs Source File

  • VideoPlaybackSynchronization
  • cs

Scenario3_AdaptiveSync.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Media;
00015 using Windows.Media.Core;
00016 using Windows.Media.Playback;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// Multi-video live playback synchronization using an AdaptiveMediaSource.
00025     ///
00026     /// Live sync has not been extensively tested for this release. There are limitations on the
00027     /// seekable and buffered ranges of data that are available to the MediaTimelineController.
00028     /// Exceeding these limits can cause stuttering or buffering.  This scenario is provided as
00029     /// a technology demonstration and is not intended for production use.
00030     /// </summary>
00031     public sealed partial class Scenario3_AdaptiveSync : Page
00032     {
00033         private MainPage rootPage = MainPage.Current;
00034
00035         private List<MediaPlayerElement> mediaPlayerElements;
00036         private MediaTimelineController timelineController = null;
00037         private TimeSpan maxNaturalDurationForController = TimeSpan.Zero;
00038         private int openedMediaCount = 0;
00039
00040         public Scenario3_AdaptiveSync()
00041         {
00042             this.InitializeComponent();
00043
00044             mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeCopy };
00045
00046             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00047             {
00048                 // Create a corresponding MediaPlayer for each MediaPlayerElement.
00049                 mpe.SetMediaPlayer(new MediaPlayer());
00050             }
00051         }
00052
00053         private void Page_OnUnloaded(object sender, RoutedEventArgs e)
00054         {
00055             // Dispose the MediaPlayer objects so they will stop streaming.
00056             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00057             {
00058                 MediaPlayer mp = mpe.MediaPlayer;
00059                 mp.MediaOpened -= MediaPlayer_MediaOpened;
00060                 mp.Dispose();
00061             }
00062         }
00063
00064         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00065         {
00066             // Create a single MediaTimelineController which will control all of the MediaPlayers.
00067             timelineController = new MediaTimelineController();
00068
00069             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00070             {
00071                 MediaPlayer mp = mpe.MediaPlayer;
00072
00073                 // The CommandManager object must be disabled when attaching a MediaTimelineController.
00074                 // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
00075                 // and apply additional business logic.
00076                 // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
00077                 mp.CommandManager.IsEnabled = false;
00078                 // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
00079                 mp.TimelineController = timelineController;
00080
00081                 // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
00082                 // To avoid confusing the user, it is best to turn them off.
00083                 mpe.AreTransportControlsEnabled = false;
00084
00085                 // MediaOpened is the right time to find the highest natural duration.
00086                 mp.MediaOpened += MediaPlayer_MediaOpened;
00087             }
00088
00089             // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
00090             timelineController.StateChanged += MediaTimelineController_StateChanged;
00091
00092             // Since this is a sample of video on demand, constrain the MediaTimelineController
00093             // to pause when it reaches the natural end of the last video.
00094             timelineController.PositionChanged += MediaTimelineController_PositionChanged;
00095
00096             // We are now set up to load content.
00097             Load.IsEnabled = true;
00098         }
00099
00100         private async void MediaPlayer_MediaOpened(MediaPlayer mediaPlayer, object args)
00101         {
00102             // maxNaturalDurationForController is the longest media source of fixed duration.
00103             if (mediaPlayer.PlaybackSession.NaturalDuration != TimeSpan.MaxValue)
00104             {
00105                 var naturalDurationForController = mediaPlayer.PlaybackSession.NaturalDuration - mediaPlayer.TimelineControllerPositionOffset;
00106                 if (naturalDurationForController > maxNaturalDurationForController)
00107                 {
00108                     maxNaturalDurationForController = naturalDurationForController;
00109                 }
00110             }
00111
00112             // If both media sources have resolved, update our UI with the duration information.
00113             if (System.Threading.Interlocked.Increment(ref openedMediaCount) == 2)
00114             {
00115                 string message =
00116                     (maxNaturalDurationForController == TimeSpan.Zero) ?
00117                     " (live stream)" :
00118                     $" / {(int)maxNaturalDurationForController.TotalSeconds}";
00119                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => NaturalDuration.Text = message);
00120             }
00121         }
00122
00123         private async void MediaTimelineController_StateChanged(MediaTimelineController sender, object args)
00124         {
00125             // Update the Play/Pause button based on the new state.
00126             Symbol newSymbol;
00127             switch (sender.State)
00128             {
00129                 case MediaTimelineControllerState.Paused:
00130                     newSymbol = Symbol.Play;
00131                     break;
00132
00133                 case MediaTimelineControllerState.Running:
00134                     newSymbol = Symbol.Pause;
00135                     break;
00136
00137                 default:
00138                     return;
00139             }
00140             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
00141         }
00142
00143         private void EnablePlaybackControls(bool enabled)
00144         {
00145             Seek30SecondsBack.IsEnabled = enabled;
00146             Seek2SecondsBack.IsEnabled = enabled;
00147             PlayPause.IsEnabled = enabled;
00148             Seek2SecondsForward.IsEnabled = enabled;
00149             Seek30SecondsForward.IsEnabled = enabled;
00150         }
00151
00152         /// <summary>
00153         /// Sets the content on the MediaPlayers
00154         /// </summary>
00155         private void Load_Click(object sender, RoutedEventArgs e)
00156         {
00157             EnablePlaybackControls(false);
00158
00159             // First reset some app logic.
00160             timelineController.Pause();
00161             maxNaturalDurationForController = TimeSpan.Zero;
00162             openedMediaCount = 0;
00163             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00164             {
00165                 MainPage.CleanUpMediaPlayerSource(mpe.MediaPlayer);
00166             }
00167             timelineController.Position = TimeSpan.Zero;
00168
00169             // Apply any requested for offset between two videos.
00170             // Do this before setting the Source on the MediaPlayer to avoid a visible seek on MediaOpened.
00171             double d = 0.0;
00172             if (Double.TryParse(mpeCopyOffset.Text, out d))
00173             {
00174                 mpeCopy.MediaPlayer.TimelineControllerPositionOffset = TimeSpan.FromSeconds(d);
00175             }
00176             else
00177             {
00178                 mpeCopy.MediaPlayer.TimelineControllerPositionOffset = TimeSpan.Zero;
00179                 mpeCopyOffset.Text = "0.0";
00180             }
00181
00182             // Set the sources. For this demonstration, we play audio only from the first video.
00183             Uri uri;
00184             if (!Uri.TryCreate(mpeMainUri.Text, UriKind.Absolute, out uri))
00185             {
00186                 rootPage.NotifyUser("Invalid URI for first source.", NotifyType.ErrorMessage);
00187                 return;
00188             }
00189             mpeMain.MediaPlayer.Source = MediaSource.CreateFromUri(uri);
00190             mpeMain.MediaPlayer.IsMuted = false;
00191
00192             if (!Uri.TryCreate(mpeCopyUri.Text, UriKind.Absolute, out uri))
00193             {
00194                 rootPage.NotifyUser("Invalid URI for second source.", NotifyType.ErrorMessage);
00195                 return;
00196             }
00197             mpeCopy.MediaPlayer.Source = MediaSource.CreateFromUri(uri);
00198             mpeMain.MediaPlayer.IsMuted = true;
00199
00200             // Enable our custom playback controls now that everything is set up.
00201             EnablePlaybackControls(true);
00202         }
00203
00204         private void PlayPause_Click(object sender, RoutedEventArgs e)
00205         {
00206             if (timelineController.State == MediaTimelineControllerState.Paused)
00207             {
00208                 timelineController.Resume();
00209             }
00210             else if (timelineController.State == MediaTimelineControllerState.Running)
00211             {
00212                 timelineController.Pause();
00213             }
00214         }
00215
00216         #region Seek and Position management
00217
00218         TimeSpan LastPositionUpdate = TimeSpan.Zero;
00219         TimeSpan PositionChangeThreshold = TimeSpan.FromSeconds(1);
00220         private async void MediaTimelineController_PositionChanged(MediaTimelineController sender, object args)
00221         {
00222             if (Math.Abs(sender.Position.Ticks - LastPositionUpdate.Ticks) > PositionChangeThreshold.Ticks)
00223             {
00224                 LastPositionUpdate = sender.Position;
00225                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => SeekPosition.Text = $"{(int)LastPositionUpdate.TotalSeconds}");
00226             }
00227
00228             // Pause when playback reaches the maximum duration, if there is one.
00229             if (maxNaturalDurationForController != TimeSpan.Zero && sender.Position > maxNaturalDurationForController)
00230             {
00231                 sender.Pause();
00232             }
00233         }
00234
00235         private void Seek2SecondsForward_Click(object sender, RoutedEventArgs e)
00236         {
00237             SeekDelta(TimeSpan.FromSeconds(2));
00238         }
00239         private void Seek30SecondsForward_Click(object sender, RoutedEventArgs e)
00240         {
00241             SeekDelta(TimeSpan.FromSeconds(30));
00242         }
00243
00244         private void Seek2SecondsBack_Click(object sender, RoutedEventArgs e)
00245         {
00246             SeekDelta(TimeSpan.FromSeconds(-2));
00247         }
00248
00249         private void Seek30SecondsBack_Click(object sender, RoutedEventArgs e)
00250         {
00251             SeekDelta(TimeSpan.FromSeconds(-30));
00252         }
00253
00254         private void SeekDelta(TimeSpan amount)
00255         {
00256             var requestedPosition = timelineController.Position + amount;
00257             if (maxNaturalDurationForController > TimeSpan.Zero)
00258             {
00259                 if (requestedPosition <= maxNaturalDurationForController)
00260                 {
00261                     timelineController.Position = requestedPosition;
00262                 }
00263                 else
00264                 {
00265                     timelineController.Position = maxNaturalDurationForController;
00266                 }
00267             }
00268             else
00269             {
00270                 timelineController.Position = requestedPosition;
00271             }
00272         }
00273         #endregion
00274     }
00275 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetUid Member List

This is the complete list of members for GetUid, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetUid() | GetUid | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/SampleConfiguration.h Source File

  • WindowsAudioSession
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKSample
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return ref new Platform::String(L"Windows Audio Session API (WASAPI) Sample");
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/AppResourceClassLibrary/class1.cs Source File

  • ApplicationResources
  • cs
  • AppResourceClassLibrary

class1.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006
00007 using Windows.ApplicationModel.Resources;
00008 namespace AppResourceClassLibrary
00009 {
00010     public static class LocalizedNamesLibrary
00011     {
00012         static ResourceLoader  resourceLoader = null;
00013
00014         public static string LibraryName {
00015             get
00016             {
00017                 String name;
00018                 GetLibraryName("string1", out name);
00019                 return name;
00020             }
00021         }
00022
00023         private static void GetLibraryName(string resourceName, out string resourceValue)
00024         {
00025             if (resourceLoader == null)
00026             {
00027                 resourceLoader = ResourceLoader.GetForCurrentView("AppResourceClassLibrary/Resources");
00028             }
00029             resourceValue = resourceLoader.GetString(resourceName);
00030         }
00031
00032     }
00033 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario12_DisableCookies Member List

This is the complete list of members for Scenario12_DisableCookies, including all inherited members.
Cancel_Click(object sender, RoutedEventArgs e) | Scenario12_DisableCookies | [inline, private]
cts | Scenario12_DisableCookies | [private]
Dispose() | Scenario12_DisableCookies | [inline]
filter | Scenario12_DisableCookies | [private]
httpClient | Scenario12_DisableCookies | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario12_DisableCookies | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario12_DisableCookies | [inline, protected]
rootPage | Scenario12_DisableCookies | [private]
Scenario12_DisableCookies() | Scenario12_DisableCookies | [inline]
SendInitialGetButton_Click(object sender, RoutedEventArgs e) | Scenario12_DisableCookies | [inline, private]
SendNextRequestButton_Click(object sender, RoutedEventArgs e) | Scenario12_DisableCookies | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_TimeZone Member List

This is the complete list of members for Scenario6_TimeZone, including all inherited members.
Display() | Scenario6_TimeZone | [inline, private]
Scenario6_TimeZone() | Scenario6_TimeZone | [inline]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Add Member List

This is the complete list of members for Scenario2_Add, including all inherited members.
Add_Click(object sender, RoutedEventArgs e) | Scenario2_Add | [inline, private]
rootPage | Scenario2_Add | [private]
Scenario2_Add() | Scenario2_Add | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/Model/IScenario.cs Source File

  • Notifications
  • cs
  • Notifications
  • Model

IScenario.cs

Go to the documentation of this file.
00001 ﻿using System;
00002
00003 namespace Notifications.Model
00004 {
00005     public interface IScenario
00006     {
00007         string Name { get; }
00008
00009         bool Contains(Type scenarioType);
00010
00011         Scenario FindScenario(Type scenarioType);
00012     }
00013 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • Inclinometer
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     inclinometer = Inclinometer::GetDefault();
00035     if (inclinometer != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = inclinometer->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041     }
00042     else
00043     {
00044         rootPage->NotifyUser("No inclinometer found", NotifyType::ErrorMessage);
00045     }
00046 }
00047
00048 /// <summary>
00049 /// Invoked when this page is about to be displayed in a Frame.
00050 /// </summary>
00051 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00052 /// property is typically used to configure the page.</param>
00053 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00054 {
00055     ScenarioEnableButton->IsEnabled = true;
00056     ScenarioDisableButton->IsEnabled = false;
00057 }
00058
00059 /// <summary>
00060 /// Invoked when this page is no longer displayed.
00061 /// </summary>
00062 /// <param name="e"></param>
00063 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00064 {
00065     // If the navigation is external to the app do not clean up.
00066     // This can occur on Phone when suspending the app.
00067     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00068     {
00069         return;
00070     }
00071
00072     if (ScenarioDisableButton->IsEnabled)
00073     {
00074         Window::Current->VisibilityChanged::remove(visibilityToken);
00075         inclinometer->ReadingChanged::remove(readingToken);
00076
00077         // Restore the default report interval to release resources while the sensor is not in use
00078         inclinometer->ReportInterval = 0;
00079     }
00080 }
00081
00082 /// <summary>
00083 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00084 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00085 /// </summary>
00086 /// <param name="sender"></param>
00087 /// <param name="e">
00088 /// Event data that can be examined for the current visibility state.
00089 /// </param>
00090 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00091 {
00092     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00093     if (ScenarioDisableButton->IsEnabled)
00094     {
00095         if (e->Visible)
00096         {
00097             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00098             readingToken = inclinometer->ReadingChanged::add(ref new TypedEventHandler<Inclinometer^, InclinometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00099         }
00100         else
00101         {
00102             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00103             inclinometer->ReadingChanged::remove(readingToken);
00104         }
00105     }
00106 }
00107
00108 void Scenario1_DataEvents::ReadingChanged(Inclinometer^ sender, InclinometerReadingChangedEventArgs^ e)
00109 {
00110     // We need to dispatch to the UI thread to display the output
00111     Dispatcher->RunAsync(
00112         CoreDispatcherPriority::Normal,
00113         ref new DispatchedHandler(
00114             [this, e]()
00115             {
00116                 InclinometerReading^ reading = e->Reading;
00117
00118                 ScenarioOutput_X->Text = reading->PitchDegrees.ToString();
00119                 ScenarioOutput_Y->Text = reading->RollDegrees.ToString();
00120                 ScenarioOutput_Z->Text = reading->YawDegrees.ToString();
00121                 switch (reading->YawAccuracy)
00122                 {
00123                     case MagnetometerAccuracy::Unknown:
00124                         ScenarioOutput_YawAccuracy->Text = "Unknown";
00125                         break;
00126                     case MagnetometerAccuracy::Unreliable:
00127                         ScenarioOutput_YawAccuracy->Text = "Unreliable";
00128                         break;
00129                     case MagnetometerAccuracy::Approximate:
00130                         ScenarioOutput_YawAccuracy->Text = "Approximate";
00131                         break;
00132                     case MagnetometerAccuracy::High:
00133                         ScenarioOutput_YawAccuracy->Text = "High";
00134                         break;
00135                     default:
00136                         ScenarioOutput_YawAccuracy->Text = "No data";
00137                         break;
00138                 }
00139             },
00140             CallbackContext::Any
00141             )
00142         );
00143 }
00144
00145 void Scenario1_DataEvents::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00146 {
00147     if (inclinometer != nullptr)
00148     {
00149         // Establish the report interval
00150         inclinometer->ReportInterval = desiredReportInterval;
00151
00152         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged));
00153         readingToken = inclinometer->ReadingChanged::add(ref new TypedEventHandler<Inclinometer^, InclinometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00154
00155         ScenarioEnableButton->IsEnabled = false;
00156         ScenarioDisableButton->IsEnabled = true;
00157     }
00158     else
00159     {
00160         rootPage->NotifyUser("No inclinometer found", NotifyType::ErrorMessage);
00161     }
00162 }
00163
00164 void Scenario1_DataEvents::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00165 {
00166     Window::Current->VisibilityChanged::remove(visibilityToken);
00167     inclinometer->ReadingChanged::remove(readingToken);
00168
00169     // Restore the default report interval to release resources while the sensor is not in use
00170     inclinometer->ReportInterval = 0;
00171
00172     ScenarioEnableButton->IsEnabled = true;
00173     ScenarioDisableButton->IsEnabled = false;
00174 }
Generated on Fri Nov 15 2024 22:17:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cs/AdventureWorks.shared/Model/Trip.cs Source File

  • CortanaVoiceCommand
  • cs
  • AdventureWorks.shared
  • Model

Trip.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.ComponentModel;
00015 using System.Linq;
00016 using System.Text;
00017 using System.Threading.Tasks;
00018
00019 namespace AdventureWorks.Model
00020 {
00021     /// <summary>
00022     /// Trip model. Stores basic details about individual trips, retreived from the TripStore.
00023     /// Implements INotifyPropertyChanged to allow two-way data-binding at the UI layer.
00024     /// </summary>
00025     public class Trip : INotifyPropertyChanged
00026     {
00027         private string destination;
00028         private string description;
00029         private DateTime? startDate;
00030         private DateTime? endDate;
00031         private string notes;
00032
00033         public event PropertyChangedEventHandler PropertyChanged;
00034
00035         /// <summary>
00036         /// Trip Destination. Should not be an empty string.
00037         /// </summary>
00038         public string Destination
00039         {
00040             get
00041             {
00042                 return destination;
00043             }
00044             set
00045             {
00046                 destination = value;
00047                 NotifyPropertyChanged("Destination");
00048             }
00049         }
00050
00051         /// <summary>
00052         /// Description of a trip. Shown to users as a basic description in the UI.
00053         /// </summary>
00054         public string Description
00055         {
00056             get
00057             {
00058                 return description;
00059             }
00060             set
00061             {
00062                 description = value;
00063                 NotifyPropertyChanged("Description");
00064             }
00065         }
00066
00067         /// <summary>
00068         /// The beginning date of a trip.
00069         /// </summary>
00070         public DateTime? StartDate
00071         {
00072             get
00073             {
00074                 return startDate;
00075             }
00076             set
00077             {
00078                 startDate = value;
00079                 NotifyPropertyChanged("StartDate");
00080             }
00081         }
00082
00083         /// <summary>
00084         /// The ending date of a trip.
00085         /// </summary>
00086         public DateTime? EndDate
00087         {
00088             get
00089             {
00090                 return endDate;
00091             }
00092             set
00093             {
00094                 endDate = value;
00095                 NotifyPropertyChanged("EndDate");
00096             }
00097         }
00098
00099         /// <summary>
00100         /// Any notes about a trip, such as things to take, activities, etc.
00101         /// </summary>
00102         public string Notes
00103         {
00104             get
00105             {
00106                 return notes;
00107             }
00108             set
00109             {
00110                 notes = value;
00111                 NotifyPropertyChanged("Notes");
00112             }
00113         }
00114
00115         /// <summary>
00116         /// Notify any subscribers to the INotifyPropertyChanged interface that a property
00117         /// was updated. This allows the UI to automatically update (for instance, if Cortana
00118         /// triggers an update to a trip, or removal of a trip).
00119         /// </summary>
00120         /// <param name="propertyName">The case-sensitive name of the property that was updated.</param>
00121         private void NotifyPropertyChanged(string propertyName)
00122         {
00123             PropertyChangedEventHandler handler = PropertyChanged;
00124             if (handler != null)
00125             {
00126                 PropertyChangedEventArgs args = new PropertyChangedEventArgs(propertyName);
00127                 handler(this, args);
00128             }
00129         }
00130     }
00131 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
App() | sealed |
CheckBoxChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e) | sealed |
ComboChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::SelectionChangedEventArgs^e) | sealed |
ConvertACKindToString(Windows::Graphics::Display::AdvancedColorKind kind) | sealed |
DirectXPage() | sealed |
EffectOption(Platform::String^description, RenderEffectKind kind) | sealed | [inline]
kind | sealed |
LoadDefaultImage() | sealed |
LoadImage(_In_ Windows::Storage::StorageFile^imageFile) | sealed |
LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | sealed |
m_deviceResources | sealed |
m_directXPage | sealed | [private]
m_dispInfo | sealed |
m_gestureRecognizer | sealed |
m_imageInfo | sealed |
m_imageMaxCLL | sealed |
m_isImageValid | sealed |
m_isWindowVisible | sealed |
m_renderer | sealed |
m_renderOptionsViewModel | sealed |
OnAdvancedColorInfoChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnCompositionScaleChanged(_In_ Windows::UI::Xaml::Controls::SwapChainPanel^sender, _In_ Object^args) | sealed |
OnDisplayContentsInvalidated(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnDpiChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnFileActivated(Windows::ApplicationModel::Activation::FileActivatedEventArgs^e) override | sealed | [virtual]
OnKeyUp(_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::KeyEventArgs^args) | sealed |
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [virtual]
OnManipulationCompleted(_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationCompletedEventArgs^args) | sealed |
OnManipulationStarted(_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationStartedEventArgs^args) | sealed |
OnManipulationUpdated(_In_ Windows::UI::Input::GestureRecognizer^sender, _In_ Windows::UI::Input::ManipulationUpdatedEventArgs^args) | sealed |
OnOrientationChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnPointerCanceled(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed |
OnPointerMoved(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed |
OnPointerPressed(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed |
OnPointerReleased(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed |
OnPointerWheelChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^e) | sealed |
OnRendering(_In_ Platform::Object^sender, _In_ Platform::Object^args) | sealed |
OnResizeCompleted(_In_ Windows::UI::Core::CoreWindow^sender, _In_ Platform::Object^args) | sealed |
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
OnSwapChainPanelSizeChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^e) | sealed |
OnVisibilityChanged(_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed |
RenderOptionsViewModel() | sealed | [inline]
ResetButtonClick(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e) | sealed |
SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | sealed |
SliderChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed |
UpdateDefaultRenderOptions() | sealed |
UpdateDisplayACState(_In_ Windows::Graphics::Display::AdvancedColorInfo^info) | sealed |
UpdateRenderOptions() | sealed |
~DirectXPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceStateChangedEventArgs Member List

This is the complete list of members for DeviceStateChangedEventArgs, including all inherited members.
DeviceState() | DeviceStateChangedEventArgs | [inline]
DeviceStateChangedEventArgs(enum DeviceState deviceState, hresult error) | DeviceStateChangedEventArgs | [inline]
ExtendedError() | DeviceStateChangedEventArgs | [inline]
m_deviceState | DeviceStateChangedEventArgs | [private]
m_error | DeviceStateChangedEventArgs | [private]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/AdventureworksVoiceCommandService.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

AdventureworksVoiceCommandService.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "AdventureWorksVoiceCommandService.h"
00013
00014 using namespace VoiceCommandService;
00015
00016 using namespace AdventureWorks_Shared;
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace Platform::Collections;
00021 using namespace Windows::ApplicationModel::AppService;
00022 using namespace Windows::ApplicationModel::Background;
00023 using namespace Windows::ApplicationModel::Resources::Core;
00024 using namespace Windows::ApplicationModel::VoiceCommands;
00025 using namespace Windows::Globalization;
00026 using namespace Windows::Globalization::DateTimeFormatting;
00027 using namespace Windows::Foundation;
00028 using namespace Windows::Storage;
00029
00030 /// <summary>
00031 /// Background task entrypoint. Voice Commands using the <VoiceCommandService Target="...">
00032 /// tag will invoke this when they are recognized by Cortana, passing along details of the
00033 /// invocation.
00034 ///
00035 /// Background tasks must respond to activation by Cortana within 0.5 seconds, and must
00036 /// report progress to Cortana every 5 seconds (unless Cortana is waiting for user
00037 /// input). There is no execution time limit on the background task managed by Cortana,
00038 /// which is in contrast to typical background task execution limits.
00039 ///
00040 /// Typically, Cortana dismisses its UI if it loses focus. This will cause it to terminate
00041 /// the background task under normal circumstances. However, while debugging, Cortana's UI
00042 /// will not dismiss, and background execution timeouts are suspended, allowing developers
00043 /// easily debug Cortana's behavior.
00044 /// In some cases, Remote Debugging may make the process easier (a Virtual Machine and
00045 /// Remote Desktop Connection with remote audio configured for example), but should not
00046 /// be required.
00047 /// </summary>
00048 /// <param name="taskInstance">Connection to the hosting background service process.</param>
00049 void AdventureWorksVoiceCommandService::Run(IBackgroundTaskInstance ^taskInstance)
00050 {
00051     serviceDeferral = taskInstance->GetDeferral();
00052
00053     // Register to receive an event if Cortana dismisses the background task. This will
00054     // occur if the task takes too long to respond, or if Cortana's UI is dismissed.
00055     // Any pending operations should be cancelled or waited on to clean up where possible.
00056     taskCancelledToken = taskInstance->Canceled +=
00057         ref new BackgroundTaskCanceledEventHandler(
00058             this,
00059             &AdventureWorksVoiceCommandService::OnCanceled);
00060
00061     AppServiceTriggerDetails^ triggerDetails = dynamic_cast<AppServiceTriggerDetails^>(taskInstance->TriggerDetails);
00062
00063     // This should match the uap:AppService and VoiceCommandService references from the
00064     // package manifest and VCD files, respectively. Make sure we've been launched by
00065     // a Cortana Voice Command.
00066     if (triggerDetails != nullptr && triggerDetails->Name == "AdventureWorksVoiceCommandService")
00067     {
00068         try
00069         {
00070             voiceServiceConnection = VoiceCommandServiceConnection::FromAppServiceTriggerDetails(triggerDetails);
00071
00072             voiceServiceConnection->VoiceCommandCompleted +=
00073                 ref new TypedEventHandler<
00074                 VoiceCommandServiceConnection ^,
00075                 VoiceCommandCompletedEventArgs ^>(
00076                     this,
00077                     &AdventureWorksVoiceCommandService::OnVoiceCommandCompleted);
00078
00079             resourceMap = ResourceManager::Current->MainResourceMap->GetSubtree("Resources");
00080             // Select the system language, which is what Cortana should be running as.
00081             context = ResourceContext::GetForViewIndependentUse();
00082
00083             // GetVoiceCommandAsync establishes initial connection to Cortana, and must be called prior to any
00084             // messages sent to Cortana. Attempting to use ReportSuccessAsync, ReportProgressAsync, etc
00085             // prior to calling this will produce undefined behavior.
00086             // Note, since this is running synchronously, and not part of the UI thread, blocking
00087             // with .wait() is ideal in most cases.
00088             create_task(voiceServiceConnection->GetVoiceCommandAsync())
00089                 .then([this](VoiceCommand^ voiceCommand)
00090             {
00091                 // Depending on the operation (defined in AdventureWorks:AdventureWorksCommands.xml)
00092                 // perform the appropriate command.
00093                 if (voiceCommand->CommandName == L"whenIsTripToDestination")
00094                 {
00095                     auto destination = voiceCommand->Properties->Lookup(L"destination")->GetAt(0);
00096                     this->SendCompletionMessageForDestination(destination);
00097                 }
00098                 else if (voiceCommand->CommandName == L"cancelTripToDestination")
00099                 {
00100                     auto destination = voiceCommand->Properties->Lookup(L"destination")->GetAt(0);
00101                     this->SendCompletionMessageForCancellation(destination);
00102                 }
00103                 else
00104                 {
00105                     // As with app activation VCDs, we need to handle the possibility that
00106                     // an app update may remove a voice command that is still registered.
00107                     // This can happen if the user hasn't run an app since an update.
00108                     this->LaunchAppInForeground();
00109                 }
00110             }).wait();
00111         }
00112         catch (Exception^ ex)
00113         {
00114             OutputDebugStringW(ex->ToString()->Data());
00115         }
00116     }
00117 }
00118
00119 /// <summary>
00120 /// When the background task is cancelled, clean up/cancel any ongoing long-running operations.
00121 /// This cancellation notice may not be due to Cortana directly. The voice command connection will
00122 /// typically already be destroyed by this point and should not be expected to be active.
00123 /// </summary>
00124 /// <param name="sender">This background task instance</param>
00125 /// <param name="reason">Contains an enumeration with the reason for task cancellation</param>
00126 void AdventureWorksVoiceCommandService::OnCanceled(IBackgroundTaskInstance ^sender, BackgroundTaskCancellationReason reason)
00127 {
00128     OutputDebugStringW(L"Task cancelled, cleaning up");
00129     if (this->serviceDeferral.Get() != nullptr)
00130     {
00131         this->serviceDeferral->Complete();
00132     }
00133 }
00134
00135 /// <summary>
00136 /// Handle the completion of the voice command. Your app may be cancelled
00137 /// for a variety of reasons, such as user cancellation or not providing
00138 /// progress to Cortana in a timely fashion. Clean up any pending long-running
00139 /// operations (eg, network requests).
00140 /// </summary>
00141 /// <param name="sender">The voice connection associated with the command.</param>
00142 /// <param name="args">Contains an Enumeration indicating why the command was terminated.</param>
00143 void AdventureWorksVoiceCommandService::OnVoiceCommandCompleted(VoiceCommandServiceConnection ^sender, VoiceCommandCompletedEventArgs ^args)
00144 {
00145     if (this->serviceDeferral.Get() != nullptr)
00146     {
00147         this->serviceDeferral->Complete();
00148     }
00149 }
00150
00151 /// <summary>
00152 /// Handle the Trip Cancellation task. This task demonstrates how to prompt a user
00153 /// for confirmation of an operation, show users a progress screen while performing
00154 /// a long-running task, and showing a completion screen.
00155 /// </summary>
00156 /// <param name="destination">The name of a destination, expected to match the phrase list.</param>
00157 /// <returns></returns>
00158 void AdventureWorksVoiceCommandService::SendCompletionMessageForDestination(String^ destination)
00159 {
00160     // Begin loading data to search for the target trip. If this operation is going to take
00161     // a non-trivial amount of time, show a progress screen in order to prevent Cortana
00162     // from timing this background operation out.
00163     String^ progressMessage = GetResourceStringAndFormat(L"LoadingTripToDestination", destination);
00164     this->ShowProgressScreen(progressMessage);
00165
00166     TripStore^ store = ref new TripStore();
00167     store->LoadTripsSync();
00168
00169     std::vector<Trip^> trips;
00170     for (unsigned int i = 0; i < store->Trips->Size; i++)
00171     {
00172         if (store->Trips->GetAt(i)->Destination == destination)
00173         {
00174             trips.push_back(store->Trips->GetAt(i));
00175         }
00176     }
00177
00178     VoiceCommandUserMessage^ userMessage = ref new VoiceCommandUserMessage();
00179     Vector<VoiceCommandContentTile^>^ destinationContentTiles = ref new Vector<VoiceCommandContentTile^>();
00180
00181     if (trips.size() == 0)
00182     {
00183         String^ foundNoTripToDestination = GetResourceStringAndFormat(L"NoSuchTripToDestination", destination);
00184         userMessage->DisplayMessage = foundNoTripToDestination;
00185         userMessage->SpokenMessage = foundNoTripToDestination;
00186     }
00187     else
00188     {
00189         String^ message = "";
00190         if (trips.size() > 1)
00191         {
00192       message = GetResourceString(L"PluralUpcomingTrips");
00193         }
00194         else
00195         {
00196       message = GetResourceString(L"SingularUpcomingTrip");
00197         }
00198
00199         userMessage->DisplayMessage = message;
00200         userMessage->SpokenMessage = message;
00201
00202         std::for_each(begin(trips), end(trips), [destinationContentTiles, destination](Trip^ trip) {
00203             int i = 0;
00204
00205             auto destinationTile = ref new VoiceCommandContentTile();
00206             destinationTile->ContentTileType = VoiceCommandContentTileType::TitleWith68x68IconAndText;
00207
00208             create_task(StorageFile::GetFileFromApplicationUriAsync(ref new Uri(L"ms-appx:///VoiceCommandService/Images/GreyTile.png")))
00209                 .then([destinationTile](StorageFile^ imageFileRef)
00210             {
00211                 destinationTile->Image = imageFileRef;
00212             }).wait();
00213
00214             destinationTile->AppLaunchArgument = destination;
00215             destinationTile->Title = trip->Destination;
00216
00217             if (trip->StartDate != nullptr)
00218             {
00219                 auto formatter = ref new DateTimeFormatter("longdate");
00220
00221                 destinationTile->TextLine1 = formatter->Format(trip->StartDate->GetDateTime());
00222             }
00223             else
00224             {
00225                 destinationTile->TextLine1 = trip->Destination + L" " + i.ToString();
00226             }
00227
00228             destinationContentTiles->Append(destinationTile);
00229             i++;
00230         });
00231     }
00232
00233     auto response = VoiceCommandResponse::CreateResponse(userMessage, destinationContentTiles);
00234
00235     if (trips.size() > 0)
00236     {
00237         response->AppLaunchArgument = destination;
00238     }
00239
00240     create_task(voiceServiceConnection->ReportSuccessAsync(response)).wait();
00241 }
00242
00243 /// <summary>
00244 /// Handle the Trip Cancellation task. This task demonstrates how to prompt a user
00245 /// for confirmation of an operation, show users a progress screen while performing
00246 /// a long-running task, and showing a completion screen.
00247 /// </summary>
00248 /// <param name="destination">The name of a destination, expected to match the phrase list.</param>
00249 /// <returns></returns>
00250 void AdventureWorksVoiceCommandService::SendCompletionMessageForCancellation(String^ destination)
00251 {
00252     // Begin loading data to search for the target trip. If this operation is going to take
00253     // a non-trivial amount of time, show a progress screen in order to prevent Cortana
00254     // from timing this background operation out.
00255     String^ progressMessage = GetResourceStringAndFormat(L"LoadingTripToDestination", destination);
00256     this->ShowProgressScreen(progressMessage);
00257
00258     TripStore^ store = ref new TripStore();
00259     store->LoadTripsSync();
00260
00261     std::vector<Trip^> trips;
00262     for (unsigned int i = 0; i < store->Trips->Size; i++)
00263     {
00264         if (store->Trips->GetAt(i)->Destination == destination)
00265         {
00266             trips.push_back(store->Trips->GetAt(i));
00267         }
00268     }
00269
00270     Trip^ trip = nullptr;
00271     if (trips.size() > 1)
00272     {
00273         // If we have more than one trip, provide a disambiguation screen rather than just picking one
00274         // or deleting all of them. If there's more than three items, you may just decide to show a
00275         // link to a deeper search in your app's experience.
00276         String^ disambiguationMessage = GetResourceStringAndFormat(L"DisambiguationWhichTripToDest", destination);
00277     String^ secondDisambiguationMessage = GetResourceString(L"DisambiguationRepeat");
00278         trip = DisambiguateTrips(trips, disambiguationMessage, secondDisambiguationMessage);
00279     }
00280     else if (trips.size() == 1)
00281     {
00282         trip = trips.at(0);
00283     }
00284
00285     if (trip == nullptr)
00286     {
00287         auto userMessage = ref new VoiceCommandUserMessage();
00288
00289         userMessage->DisplayMessage = GetResourceStringAndFormat(L"FoundNoTripToDestination", destination);
00290
00291         auto response = VoiceCommandResponse::CreateResponse(userMessage);
00292         create_task(voiceServiceConnection->ReportFailureAsync(response)).wait();
00293     }
00294     else
00295     {
00296         String^ cancelTripToDestination = GetResourceStringAndFormat(L"CancelTripToDestination", destination);
00297         auto userPrompt = ref new VoiceCommandUserMessage();
00298
00299         userPrompt->DisplayMessage = cancelTripToDestination;
00300         userPrompt->SpokenMessage = cancelTripToDestination;
00301
00302         auto userReprompt = ref new VoiceCommandUserMessage();
00303         String^ repromptMessage = GetResourceStringAndFormat(L"ConfirmCancelTripToDestination", destination);
00304         userReprompt->DisplayMessage = repromptMessage;
00305         userReprompt->SpokenMessage = repromptMessage;
00306
00307         auto response = VoiceCommandResponse::CreateResponseForPrompt(userPrompt, userReprompt);
00308
00309         VoiceCommandConfirmationResult^ voiceCommandConfirmation;
00310
00311         create_task(voiceServiceConnection->RequestConfirmationAsync(response))
00312             .then([&voiceCommandConfirmation](VoiceCommandConfirmationResult^ confirmation)
00313         {
00314             voiceCommandConfirmation = confirmation;
00315         }).wait();
00316
00317         // If the result of the Confirmation is null, likely Cortana was dismissed without giving a response.
00318         if (voiceCommandConfirmation != nullptr)
00319         {
00320             if (voiceCommandConfirmation->Confirmed)
00321             {
00322                 String^ cancellingTripToDestination = GetResourceStringAndFormat(L"CancellingTripToDestination", destination);
00323                 ShowProgressScreen(cancellingTripToDestination);
00324
00325                 create_task(store->DeleteTripAsync(trip)).wait();
00326
00327                 auto userMessage = ref new VoiceCommandUserMessage();
00328                 String^ successMessage = GetResourceStringAndFormat(L"CancelledTripToDestination", destination);
00329                 userMessage->DisplayMessage = successMessage;
00330                 userMessage->SpokenMessage = successMessage;
00331
00332                 auto response = VoiceCommandResponse::CreateResponse(userMessage);
00333                 create_task(voiceServiceConnection->ReportSuccessAsync(response)).wait();
00334             }
00335             else
00336             {
00337                 auto userMessage = ref new VoiceCommandUserMessage();
00338                 String^ cancelMessage = GetResourceStringAndFormat(L"KeepingTripToDestination", destination);
00339                 userMessage->DisplayMessage = cancelMessage;
00340                 userMessage->SpokenMessage = cancelMessage;
00341
00342                 auto response = VoiceCommandResponse::CreateResponse(userMessage);
00343                 create_task(voiceServiceConnection->ReportSuccessAsync(response)).wait();
00344             }
00345         }
00346     }
00347 }
00348
00349 /// <summary>
00350 /// Demonstrates providing the user with a choice between multiple items. In this case, if a user
00351 /// has two trips to the same destination with different dates, this will provide a way to differentiate
00352 /// them. Provide a way to choose between the items.
00353 /// </summary>
00354 /// <param name="trips">The set of trips to choose between</param>
00355 /// <param name="disambiguationMessage">The initial disambiguation message</param>
00356 /// <param name="secondDisambiguationMessage">Repeat prompt retry message</param>
00357 /// <returns></returns>
00358 Trip^ VoiceCommandService::AdventureWorksVoiceCommandService::DisambiguateTrips(std::vector<Trip^> trips, Platform::String ^ disambiguationMessage, String ^ secondDisambiguationMessage)
00359 {
00360     auto userPrompt = ref new VoiceCommandUserMessage();
00361     userPrompt->DisplayMessage = disambiguationMessage;
00362     userPrompt->SpokenMessage = disambiguationMessage;
00363
00364     auto userReprompt = ref new VoiceCommandUserMessage();
00365     userReprompt->DisplayMessage = secondDisambiguationMessage;
00366     userReprompt->SpokenMessage = secondDisambiguationMessage;
00367
00368     Vector<VoiceCommandContentTile^>^ destinationContentTiles = ref new Vector<VoiceCommandContentTile^>();
00369     int i = 1;
00370     std::for_each(begin(trips), end(trips), [destinationContentTiles, &i](Trip^ trip) {
00371         auto destinationTile = ref new VoiceCommandContentTile();
00372
00373         destinationTile->ContentTileType = VoiceCommandContentTileType::TitleWith68x68IconAndText;
00374         create_task(StorageFile::GetFileFromApplicationUriAsync(ref new Uri(L"ms-appx:///VoiceCommandService/Images/GreyTile.png")))
00375             .then([destinationTile](StorageFile^ imageFileRef)
00376         {
00377             destinationTile->Image = imageFileRef;
00378         }).wait();
00379
00380         destinationTile->AppContext = trip;
00381         String^ dateFormat;
00382         if (trip->StartDate != nullptr)
00383         {
00384             auto formatter = ref new DateTimeFormatter("longdate");
00385
00386             dateFormat = formatter->Format(trip->StartDate->GetDateTime());
00387         }
00388         else
00389         {
00390             dateFormat = i.ToString();
00391         }
00392
00393         destinationTile->Title = trip->Destination + L" " + dateFormat;
00394         destinationTile->TextLine1 = trip->Description;
00395
00396         destinationContentTiles->Append(destinationTile);
00397         i++;
00398     });
00399
00400     auto response = VoiceCommandResponse::CreateResponseForPrompt(userPrompt, userReprompt, destinationContentTiles);
00401
00402     Trip^ selectedTrip = nullptr;
00403     create_task(voiceServiceConnection->RequestDisambiguationAsync(response))
00404         .then([&selectedTrip](VoiceCommandDisambiguationResult^ result) {
00405         if (result != nullptr)
00406         {
00407             selectedTrip = dynamic_cast<Trip^>(result->SelectedItem->AppContext);
00408         }
00409     }).wait();
00410     return selectedTrip;
00411 }
00412
00413 /// <summary>
00414 /// Provide a simple response that launches the app. Expected to be used in the
00415 /// case where the voice command could not be recognized (eg, a VCD/code mismatch.)
00416 /// </summary>
00417 void VoiceCommandService::AdventureWorksVoiceCommandService::LaunchAppInForeground()
00418 {
00419     auto userProgressMessage = ref new VoiceCommandUserMessage();
00420   userProgressMessage->SpokenMessage = GetResourceString(L"LaunchingAdventureWorks");
00421
00422     VoiceCommandResponse^ response = VoiceCommandResponse::CreateResponse(userProgressMessage);
00423     response->AppLaunchArgument = L"";
00424     create_task(voiceServiceConnection->ReportProgressAsync(response));
00425 }
00426
00427 /// <summary>
00428 /// Show a progress screen. These should be posted at least every 5 seconds for a
00429 /// long-running operation, such as accessing network resources over a mobile
00430 /// carrier network.
00431 /// </summary>
00432 /// <param name="message">The message to display, relating to the task being performed.</param>
00433 /// <returns></returns>
00434 void VoiceCommandService::AdventureWorksVoiceCommandService::ShowProgressScreen(Platform::String ^ progressMessage)
00435 {
00436     auto userProgressMessage = ref new VoiceCommandUserMessage();
00437     userProgressMessage->DisplayMessage = progressMessage;
00438     userProgressMessage->SpokenMessage = progressMessage;
00439
00440     VoiceCommandResponse^ response = VoiceCommandResponse::CreateResponse(userProgressMessage);
00441     create_task(voiceServiceConnection->ReportProgressAsync(response));
00442 }
00443
00444 /// <Summary> Look up a resource string and return it. </Summary>
00445 /// <returns>The resource string requested for the current context</returns>
00446 String ^ AdventureWorksVoiceCommandService::GetResourceString(String ^ resourceName)
00447 {
00448   return resourceMap->GetValue(resourceName, context)->ValueAsString;
00449 }
00450
00451 /// <Summary> Look up a resource string and replace {0} with the parameter provided (simple string.format) </Summary>
00452 /// <returns>The resource string requested for the current context, with substitution</returns>
00453 String ^ AdventureWorksVoiceCommandService::GetResourceStringAndFormat(String ^ resourceName, Platform::String ^ param)
00454 {
00455   String^ resource = GetResourceString(resourceName);
00456   std::wstring str = resource->Data();
00457   std::wstring to = param->Data();
00458   std::wstring positionText = L"{0}";
00459   size_t pos = str.find(positionText, 0);
00460   if (pos != std::string::npos)
00461   {
00462     str.replace(pos, positionText.length(), to);
00463   }
00464
00465   String^ outString = ref new String(str.data());
00466   return outString;
00467 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario3_Size.h Source File

  • AppWindow
  • cppwinrt

Scenario3_Size.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Size.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario3_Size : Scenario3_SizeT<Scenario3_Size>
00019     {
00020         Scenario3_Size();
00021
00022         fire_and_forget OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023
00024         fire_and_forget ShowWindowBtn_Click(IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025
00026     private:
00027         Windows::UI::WindowManagement::AppWindow appWindow{ nullptr };
00028         Windows::UI::Xaml::Controls::Frame appWindowFrame{};
00029
00030         void OnWindowClosed(Windows::UI::WindowManagement::AppWindow const& sender, IInspectable const&);
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario3_Size : Scenario3_SizeT<Scenario3_Size, implementation::Scenario3_Size>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:18:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario7_CustomContent.xaml.h Source File

  • XamlCommanding
  • cpp

Scenario7_CustomContent.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // Scenario7_CustomContent.xaml.h
00003 // Declaration of the Scenario7_CustomContent class
00004 //
00005
00006 #pragma once
00007
00008 #include "Scenario7_CustomContent.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class Scenario7_CustomContent sealed
00017     {
00018     public:
00019         Scenario7_CustomContent();
00020     private:
00021         void CommandBar_Opening(Platform::Object^ sender, Platform::Object^ e);
00022         void CommandBar_Closed(Platform::Object^ sender, Platform::Object^ e);
00023     };
00024 }
Generated on Fri Nov 15 2024 22:22:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TextRenderer Member List

This is the complete list of members for TextRenderer, including all inherited members.
CreateDeviceDependentResourcesAsync() override | TextRenderer | [virtual]
GetSampler() const | TextRenderer | [inline]
GetTexture() const | TextRenderer | [inline]
m_d2dRenderTarget | TextRenderer | [private]
m_deviceResources | Resource | [protected]
m_pointSampler | TextRenderer | [private]
m_renderTargetView | TextRenderer | [private]
m_shaderResourceView | TextRenderer | [private]
m_textFormat | TextRenderer | [private]
m_texture | TextRenderer | [private]
m_textureHeight | TextRenderer | [private]
m_textureWidth | TextRenderer | [private]
m_whiteBrush | TextRenderer | [private]
ReleaseDeviceDependentResources() override | TextRenderer | [virtual]
RenderTextOffscreen(std::wstring const &str) | TextRenderer |
Resource(std::shared_ptr< DeviceResources > deviceResources) | Resource | [inline]
TextRenderer(std::shared_ptr< DX::DeviceResources > deviceResources, uint32_t textureWidth, uint32_t textureHeight) | TextRenderer |
~Resource() | Resource | [virtual]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ProactiveViewModel Member List

This is the complete list of members for ProactiveViewModel, including all inherited members.
CmdGetLicense | ProactiveViewModel |
CmdPlayMovie | ProactiveViewModel |
CmdStopMovie | ProactiveViewModel |
GetLicense(Guid kid) | ProactiveViewModel | [inline, private]
IndividualizeIfNeeded() | ProactiveViewModel | [inline, private]
IsLicenseAvailable(Guid kid) | ProactiveViewModel | [inline, private]
KeyId | ProactiveViewModel |
keyId | ProactiveViewModel | [private]
licenseUrl | ProactiveViewModel | [private]
Log(string message) | ViewModelBase | [inline, static]
moviePath | ProactiveViewModel | [private]
MoviePath | ProactiveViewModel |
OutputLog | ViewModelBase |
PlaybackEnabled | ViewModelBase |
PlayReadyInfo | ProactiveViewModel |
ProactiveViewModel(MediaElement mediaElement) | ProactiveViewModel | [inline]
ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest) | ProactiveViewModel | [inline, private]
PropertyChanged | ViewModelBase |
ProtectionManager | ViewModelBase |
RaisePropertyChanged([CallerMemberName] string propertyName="") | ViewModelBase | [inline, protected]
serviceCompletionNotifier | ProactiveViewModel | [private]
ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent) | ProactiveViewModel | [inline, private]
SetPlaybackEnabled(bool enabled) | ViewModelBase | [inline]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Check Member List

This is the complete list of members for Scenario1_Check, including all inherited members.
accessChangedToken | Scenario1_Check | [private]
OnCapabilityAccessChanged(Windows::Security::Authorization::AppCapabilityAccess::AppCapability const &, Windows::Foundation::IInspectable const &) | Scenario1_Check | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_Check |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_Check |
Scenario1_Check() | Scenario1_Check |
StreamLocationAsync() | Scenario1_Check | [private]
StreamLocationButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_Check |
UpdateCapabilityStatus() | Scenario1_Check | [private]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/Scenario1.xaml.cs Source File

  • Projection
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using SecondaryViewsHelpers;
00014 using System;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.UI.Core;
00017 using Windows.UI.ViewManagement;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace SDKSample
00024 {
00025     internal class ProjectionViewPageInitializationData
00026     {
00027         public CoreDispatcher MainDispatcher;
00028         public ViewLifetimeControl ProjectionViewPageControl;
00029         public int MainViewId;
00030     }
00031
00032     /// <summary>
00033     /// An empty page that can be used on its own or navigated to within a Frame.
00034     /// </summary>
00035     public sealed partial class Scenario1
00036     {
00037         MainPage rootPage = MainPage.Current;
00038         int thisViewId;
00039
00040         public Scenario1()
00041         {
00042             this.InitializeComponent();
00043             thisViewId = ApplicationView.GetForCurrentView().Id;
00044         }
00045
00046         private async void StartProjecting_Click(object sender, RoutedEventArgs e)
00047         {
00048             // If projection is already in progress, then it could be shown on the monitor again
00049             // Otherwise, we need to create a new view to show the presentation
00050             if (rootPage.ProjectionViewPageControl == null)
00051             {
00052                 // First, create a new, blank view
00053                 var thisDispatcher = Window.Current.Dispatcher;
00054                 await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00055                 {
00056                     // ViewLifetimeControl is a wrapper to make sure the view is closed only
00057                     // when the app is done with it
00058                     rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();
00059
00060                     // Assemble some data necessary for the new page
00061                     var initData = new ProjectionViewPageInitializationData();
00062                     initData.MainDispatcher = thisDispatcher;
00063                     initData.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
00064                     initData.MainViewId = thisViewId;
00065
00066                     // Display the page in the view. Note that the view will not become visible
00067                     // until "StartProjectingAsync" is called
00068                     var rootFrame = new Frame();
00069                     rootFrame.Navigate(typeof(ProjectionViewPage), initData);
00070                     Window.Current.Content = rootFrame;
00071
00072                     // The call to Window.Current.Activate is required starting in Windos 10.
00073                     // Without it, the view will never appear.
00074                     Window.Current.Activate();
00075                 });
00076             }
00077
00078             try
00079             {
00080                 // Start/StopViewInUse are used to signal that the app is interacting with the
00081                 // view, so it shouldn't be closed yet, even if the user loses access to it
00082                 rootPage.ProjectionViewPageControl.StartViewInUse();
00083
00084                 // Show the view on a second display (if available) or on the primary display
00085                 await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId);
00086
00087                 rootPage.ProjectionViewPageControl.StopViewInUse();
00088
00089                 rootPage.NotifyUser("Projection started with success", NotifyType.StatusMessage);
00090             }
00091             catch (InvalidOperationException)
00092             {
00093                 rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
00094             }
00095         }
00096
00097     }
00098 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/MediaReader.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

MediaReader.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // MediaReader:
00015 // This is a helper class for the SoundEffect class. It reads small audio files
00016 // synchronously from the package installed folder and returns sound data as a
00017 // vector of bytes.
00018
00019 class MediaReader
00020 {
00021 public:
00022     MediaReader();
00023
00024     std::vector<byte> LoadMedia(_In_ winrt::hstring const& filename);
00025     WAVEFORMATEX* GetOutputWaveFormatEx();
00026
00027 private:
00028     winrt::Windows::Storage::StorageFolder  m_installedLocation{ nullptr };
00029     winrt::hstring                          m_installedLocationPath;
00030     WAVEFORMATEX                            m_waveFormat;
00031 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_EventAndMenuHookup Member List

This is the complete list of members for Scenario1_EventAndMenuHookup, including all inherited members.
activeItemIndex | Scenario1_EventAndMenuHookup | [private]
AddCustomIconItems() | Scenario1_EventAndMenuHookup | [inline, private]
AddFontGlyphItems() | Scenario1_EventAndMenuHookup | [inline, private]
AddItem(object sender, RoutedEventArgs e) | Scenario1_EventAndMenuHookup | [inline, private]
AddKnownIconItems() | Scenario1_EventAndMenuHookup | [inline, private]
Controller | Scenario1_EventAndMenuHookup | [private]
Controller_ButtonClicked(RadialController sender, RadialControllerButtonClickedEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_ControlAcquired(RadialController sender, RadialControllerControlAcquiredEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_ControlLost(RadialController sender, object args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_RotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_ScreenContactContinued(RadialController sender, RadialControllerScreenContactContinuedEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_ScreenContactEnded(RadialController sender, object args) | Scenario1_EventAndMenuHookup | [inline, private]
Controller_ScreenContactStarted(RadialController sender, RadialControllerScreenContactStartedEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
CreateMenuItems() | Scenario1_EventAndMenuHookup | [inline, private]
GetRadialControllerMenuItemFromSender(object sender) | Scenario1_EventAndMenuHookup | [inline, private]
InitializeController() | Scenario1_EventAndMenuHookup | [inline, private]
LogContactInfo(RadialControllerScreenContact contact) | Scenario1_EventAndMenuHookup | [inline, private]
menuItems | Scenario1_EventAndMenuHookup | [private]
OnItemInvoked(int selectedItemIndex) | Scenario1_EventAndMenuHookup | [inline, private]
OnLogSizeChanged(object sender, object e) | Scenario1_EventAndMenuHookup | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_EventAndMenuHookup | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_EventAndMenuHookup | [inline, protected]
PrintSelectedItem(object sender, RoutedEventArgs e) | Scenario1_EventAndMenuHookup | [inline, private]
PrintSelectedItem() | Scenario1_EventAndMenuHookup | [inline, private]
RemoveItem(object sender, RoutedEventArgs e) | Scenario1_EventAndMenuHookup | [inline, private]
rootPage | Scenario1_EventAndMenuHookup | [private]
Scenario1_EventAndMenuHookup() | Scenario1_EventAndMenuHookup | [inline]
SelectItem(object sender, RoutedEventArgs e) | Scenario1_EventAndMenuHookup | [inline, private]
SelectPreviouslySelectedItem(object sender, RoutedEventArgs e) | Scenario1_EventAndMenuHookup | [inline, private]
sliders | Scenario1_EventAndMenuHookup | [private]
ToggleMenuSuppression(Object sender, RoutedEventArgs args) | Scenario1_EventAndMenuHookup | [inline, private]
toggles | Scenario1_EventAndMenuHookup | [private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario8_VisitsBackgroundTask.h Source File

  • Geolocation
  • cppwinrt

Scenario8_VisitsBackgroundTask.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario8_VisitsBackgroundTask.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario8_VisitsBackgroundTask : Scenario8_VisitsBackgroundTaskT<Scenario8_VisitsBackgroundTask>
00019     {
00020         Scenario8_VisitsBackgroundTask();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023
00024         void RegisterBackgroundTask(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025         void UnregisterBackgroundTask(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026
00027     private:
00028         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00029         Windows::ApplicationModel::Background::IBackgroundTaskRegistration m_visitTask;
00030         event_token m_taskCompletedToken{};
00031
00032         static constexpr wchar_t BackgroundTaskName[] = L"SampleVisitBackgroundTask";
00033         static constexpr std::wstring_view BackgroundTaskEntryPoint = name_of<BackgroundTask::VisitBackgroundTask>();
00034
00035         fire_and_forget OnCompleted(Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e);
00036         void UpdateButtonStates();
00037         void FillEventListBoxWithExistingEvents();
00038     };
00039 }
00040
00041 namespace winrt::SDKTemplate::factory_implementation
00042 {
00043     struct Scenario8_VisitsBackgroundTask : Scenario8_VisitsBackgroundTaskT<Scenario8_VisitsBackgroundTask, implementation::Scenario8_VisitsBackgroundTask>
00044     {
00045     };
00046 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AudioEchoEffect Member List

This is the complete list of members for AudioEchoEffect, including all inherited members.
AudioEchoEffect() | AudioEchoEffect | [inline]
Close(MediaEffectClosedReason reason) | AudioEchoEffect | [inline]
currentActiveSampleIndex | AudioEchoEffect | [private]
currentEncodingProperties | AudioEchoEffect | [private]
DiscardQueuedFrames() | AudioEchoEffect | [inline]
echoBuffer | AudioEchoEffect | [private]
Mix | AudioEchoEffect | [private]
ProcessFrame(ProcessAudioFrameContext context) | AudioEchoEffect | [inline]
propertySet | AudioEchoEffect | [private]
SetEncodingProperties(AudioEncodingProperties encodingProperties) | AudioEchoEffect | [inline]
SetProperties(IPropertySet configuration) | AudioEchoEffect | [inline]
SupportedEncodingProperties | AudioEchoEffect |
supportedEncodingProperties | AudioEchoEffect | [private]
UseInputFrameForOutput | AudioEchoEffect |
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/pch.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/ReactiveViewModel.cs Source File

  • PlayReady
  • cs
  • ViewModels

ReactiveViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Shared;
00013 using System;
00014 using Windows.Media.Protection;
00015 using Windows.Media.Protection.PlayReady;
00016 using Windows.UI.Xaml.Controls;
00017
00018
00019 namespace SDKTemplate.ViewModels
00020 {
00021     public class ReactiveViewModel : ViewModelBase
00022     {
00023         // The sample is a protected H264 Dash (OnDemand) asset.
00024         private string moviePath = MainPage.SampleMovieURL;
00025         private string licenseURL = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?UseSimpleNonPersistentLicense=1";
00026
00027         public RelayCommand CmdPlayMovie { get; private set; }
00028         public RelayCommand CmdStopMovie { get; private set; }
00029
00030         // PlayReadyInfo is just used to show PlayReadyStatistics and debug info in the UI
00031         public PlayReadyInfoViewModel PlayReadyInfo { get; private set; }
00032
00033         /// <summary>
00034         /// A view model class for the ReactiveRequest Scenario.
00035         /// The ViewModel takes a UI MediaElement in the contructor to wire up commands and events to simplify the sample.
00036         /// Decoupling the MediaElement from the ViewModel would require addtional MVVM infrastucture.
00037         /// </summary>
00038         public ReactiveViewModel(MediaElement mediaElement)
00039         {
00040
00041             /// The ProtectionManager provides communication between the player and PlayReady DRM.
00042             /// The helper class will configure the protection manager for PlayReady and assign an
00043             /// event handler for Service requests.
00044             this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
00045             mediaElement.ProtectionManager = this.ProtectionManager;
00046             /// The PlayReadyInfoViewModel is used in this sample app to show PlayReadyStatistics such as
00047             /// SecurityLevel and hardware support in the UI.
00048             PlayReadyInfo = new PlayReadyInfoViewModel();
00049             PlayReadyInfo.RefreshStatics();
00050
00051             /// Reactive license acqusition will happen automatically when setting the source of
00052             /// a MediaElement to protected content.
00053             CmdPlayMovie = new RelayCommand( () => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); });
00054             /// The licenseUrl in the sample is set to return a non-peristent license. When there is a
00055             /// hard Stop() on the playback, a new license will be requested on Play().
00056             CmdStopMovie = new RelayCommand(() => { mediaElement.Stop(); SetPlaybackEnabled(false); });
00057
00058             mediaElement.CurrentStateChanged += (s, a) => {
00059                 ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
00060             };
00061
00062             mediaElement.MediaFailed += (s, a) => {
00063                 ViewModelBase.Log("Err::" + a.ErrorMessage);
00064             };
00065         }
00066
00067
00068         /// <summary>
00069         /// The ProtectionManager defers the service call to the ServiceReqested handler.
00070         /// This handler will enable the application to customize the communication (custom data, http headers, manual request)
00071         /// The ServiceCompletion instance will notify the ProtectionManager in the case of queued requests.
00072         /// </summary>
00073         MediaProtectionServiceCompletion serviceCompletionNotifier = null;
00074         void ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)
00075         {
00076             serviceCompletionNotifier = srEvent.Completion;
00077             IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
00078             ViewModelBase.Log(serviceRequest.GetType().Name);
00079             ProcessServiceRequest(serviceRequest);
00080         }
00081
00082         /// <summary>
00083         /// The helper class will determine the exact type of ServiceRequest in order to customize and send
00084         /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
00085         /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
00086         /// and manually send the challenge.
00087         /// </summary>
00088         void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
00089         {
00090             //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
00091             if (serviceRequest is PlayReadyIndividualizationServiceRequest)
00092             {
00093                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
00094                PlayReadyInfo.RefreshStatics();
00095             }
00096             else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
00097             {
00098                 var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
00099                 // The inital service request url was taken from the playready header from the dash manifest.
00100                 // This can overridden to a different license service prior to sending the request (staging, production,...).
00101                 licenseRequest.Uri = new Uri(licenseURL);
00102
00103                 PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest,  serviceCompletionNotifier);
00104                 SetPlaybackEnabled(true);
00105             }
00106
00107             // Here are the additional service calls available to support other scenarios
00108             //PlayReadySecureStopServiceRequest
00109             //PlayReadyDomainJoinServiceRequest
00110             //PlayReadyDomainLeaveServiceRequest
00111             //PlayReadyMeteringReportServiceRequest
00112
00113             //PlayReadyRevocationServiceRequest
00114
00115         }
00116
00117
00118         public string MoviePath
00119         {
00120             get
00121             {
00122                 return moviePath;
00123             }
00124             set
00125             {
00126                 if (moviePath != value)
00127                 {
00128                     moviePath = value;
00129                     RaisePropertyChanged();
00130                 }
00131             }
00132         }
00133
00134         // Method not used in this sample.
00135         // This shows the minimal configuration for basic reactive playback.
00136         public void MinConfig(MediaElement mediaElement)
00137         {
00138             var manager = new MediaProtectionManager();
00139             var props = new Windows.Foundation.Collections.PropertySet();
00140             props.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput");
00141             manager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", props);
00142             manager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
00143             manager.Properties.Add("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");
00144
00145             MediaProtectionServiceCompletion completionNotifer = null;
00146             manager.ServiceRequested += async (sender, srEvent) =>
00147             {
00148                 completionNotifer = srEvent.Completion;
00149                 var serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
00150
00151                 ProcessServiceRequest(serviceRequest);
00152                 if (serviceRequest is PlayReadyIndividualizationServiceRequest)
00153                 {
00154                     var indivRequest = serviceRequest as PlayReadyIndividualizationServiceRequest;
00155                     await indivRequest.BeginServiceRequest();
00156                     serviceCompletionNotifier.Complete(true);
00157                 }
00158                 else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
00159                 {
00160                     var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
00161                     //licenseRequest.
00162                     await licenseRequest.BeginServiceRequest();
00163                     serviceCompletionNotifier.Complete(true);
00164                     serviceCompletionNotifier = null;
00165                 }
00166
00167             };
00168             mediaElement.ProtectionManager = manager;
00169         }
00170     }
00171 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/UserSelect.xaml.h Source File

  • KeyCredentialManager
  • cpp

UserSelect.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002 #pragma once
00003 #include "UserSelect.g.h"
00004 #include "MainPage.xaml.h"
00005 #include "Account.h"
00006
00007 namespace SDKTemplate
00008 {
00009     /// <summary>
00010     /// TODO
00011     /// </summary>
00012     [Windows::Foundation::Metadata::WebHostHidden]
00013     public ref class UserSelect sealed
00014     {
00015     public:
00016         UserSelect();
00017
00018     internal:
00019         property static Platform::Collections::Vector<Account^>^ m_accountList;
00020         property static Windows::UI::Xaml::Controls::ListView^ m_accountListView;
00021
00022     private:
00023         MainPage^ rootPage;
00024
00025         void OnLoadedActions(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00026         void Button_SelectUser_Click(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00027         void Button_AddUser_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028         void SetUpAccounts();
00029     };
00030 }
Generated on Fri Nov 15 2024 22:20:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cs/Server/BreadServer.cs Source File

  • ProxyStubsForWinRTComponents
  • cs
  • Server

BreadServer.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using System.Collections.Generic;
00009 using System.Text;
00010 using Windows.Foundation;
00011 using Windows.Foundation.Metadata;
00012
00013 namespace Microsoft.SDKSamples.Kitchen
00014 {
00015     // Explicitly declare IIDs to make it easier to author the proxy stub interface registration
00016     [Guid(0x699B1394, 0x3CEB, 0x4A14, 0xAE, 0x23, 0xEF, 0xEC, 0x51, 0x8B, 0x08, 0x8B)]
00017     public interface IBread
00018     {
00019         String Flavor { get; }
00020     }
00021
00022     public sealed class Bread : IBread
00023     {
00024         public String Flavor
00025         {
00026             get
00027             {
00028                 return _flavor;
00029             }
00030         }
00031
00032         internal Bread(String flavor)
00033         {
00034             _flavor = flavor;
00035         }
00036
00037         private String _flavor;
00038     }
00039 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/DataModels/MusicItem.cs Source File

  • BackgroundMediaPlayback
  • cs
  • DataModels

MusicItem.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.Data.Json;
00007 using Windows.Media;
00008 using Windows.Media.Playback;
00009
00010 namespace BackgroundMediaPlayback.DataModels
00011 {
00012     class MusicItem : MediaItem
00013     {
00014         public Uri AlbumArtUri { get; set; }
00015
00016         public override Uri PreviewImageUri
00017         {
00018             get
00019             {
00020                 return AlbumArtUri;
00021             }
00022
00023             set
00024             {
00025                 AlbumArtUri = value;
00026             }
00027         }
00028
00029         public MusicItem() : base()
00030         {
00031         }
00032
00033         public MusicItem(JsonObject json) : base(json)
00034         {
00035             if (json.Keys.Contains("albumArtUri"))
00036                 AlbumArtUri = new Uri(json.GetNamedString("albumArtUri"));
00037         }
00038
00039         public override MediaPlaybackItem ToPlaybackItem()
00040         {
00041             var playbackItem = base.ToPlaybackItem();
00042
00043             var displayProperties = playbackItem.GetDisplayProperties();
00044             displayProperties.Type = MediaPlaybackType.Music;
00045             displayProperties.MusicProperties.Title = Title;
00046             playbackItem.ApplyDisplayProperties(displayProperties);
00047
00048             return playbackItem;
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Simple3DGame.h Source File

  • Simple3DGameDX
  • cppwinrt

Simple3DGame.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Simple3DGame:
00015 // This is the main game class. It controls game play logic and game state.
00016 // Some of the key object classes used by Simple3DGame are:
00017 //     MoveLookController - for handling all input to control player movement, aiming,
00018 //         and firing.
00019 //     GameRenderer - for handling all graphics presentation.
00020 //     Camera - for handling view projections.
00021 //     Audio - for handling sound output.
00022 // This class maintains several lists of objects:
00023 //     m_ammo <Sphere> - is the list of the balls used to throw at targets. Simple3DGame
00024 //         cycles through the list in a LRU fashion each time a ball is thrown by the player.
00025 //     m_objects <GameObject> - is the list of all objects in the scene that participate in
00026 //         game physics. This includes m_player <Sphere> to represent the player in the scene.
00027 //         The player object (m_player) is not visible in the scene so it is not rendered.
00028 //     m_renderObjects <GameObject> - is the list of all objects in the scene that may be
00029 //         rendered. It includes both the m_ammo list, most of the m_objects list excluding m_player
00030 //         object and the objects representing the bounding world.
00031
00032 #include "GameConstants.h"
00033 #include "Audio.h"
00034 #include "Camera.h"
00035 #include "Level.h"
00036 #include "GameTimer.h"
00037 #include "Sphere.h"
00038 #include "MoveLookController.h"
00039
00040 enum class GameState
00041 {
00042     Waiting,
00043     Active,
00044     LevelComplete,
00045     TimeExpired,
00046     GameComplete,
00047 };
00048
00049 struct HighScoreEntry
00050 {
00051     std::wstring tag;
00052     int totalHits = 0;
00053     int totalShots = 0;
00054     int levelCompleted = 0;
00055 };
00056
00057 class GameRenderer;
00058
00059 class Simple3DGame
00060 {
00061 public:
00062     Simple3DGame();
00063
00064     void Initialize(
00065         _In_ std::shared_ptr<MoveLookController> const& controller,
00066         _In_ std::shared_ptr<GameRenderer> const& renderer
00067         );
00068
00069     void LoadGame();
00070     winrt::Windows::Foundation::IAsyncAction LoadLevelAsync();
00071     void FinalizeLoadLevel();
00072     void StartLevel();
00073     void PauseGame();
00074     void ContinueGame();
00075     GameState RunGame();
00076     void SetCurrentLevelToSavedState();
00077
00078     void OnSuspending();
00079     void OnResuming();
00080
00081     bool IsActivePlay() { return m_timer.Active(); }
00082     int LevelCompleted() { return m_currentLevel; };
00083     int TotalShots() { return m_totalShots; };
00084     int TotalHits() { return m_totalHits; };
00085     float BonusTime() { return m_levelBonusTime; };
00086     bool GameActive() { return m_gameActive; };
00087     bool LevelActive() { return m_levelActive; };
00088     HighScoreEntry HighScore() { return m_topScore; };
00089     std::shared_ptr<Level> const& CurrentLevel() { return m_level[m_currentLevel]; };
00090     float TimeRemaining() { return m_levelTimeRemaining; };
00091     Camera& GameCamera() { return m_camera; };
00092     std::vector<std::shared_ptr<GameObject>> const& RenderObjects() { return m_renderObjects; };
00093
00094 private:
00095     void LoadState();
00096     void SaveState();
00097     void SaveHighScore();
00098     void LoadHighScore();
00099     void InitializeAmmo();
00100     void UpdateDynamics();
00101
00102     std::shared_ptr<MoveLookController>      m_controller;
00103     std::shared_ptr<GameRenderer>            m_renderer;
00104     Camera                                   m_camera;
00105
00106     Audio                                    m_audioController;
00107
00108     std::vector<std::shared_ptr<Sphere>>     m_ammo;
00109     uint32_t                                 m_ammoCount;
00110     uint32_t                                 m_ammoNext;
00111
00112     HighScoreEntry                           m_topScore;
00113     PersistentState                          m_savedState;
00114
00115     GameTimer                                m_timer;
00116     bool                                     m_gameActive;
00117     bool                                     m_levelActive;
00118     int                                      m_totalHits;
00119     int                                      m_totalShots;
00120     float                                    m_levelDuration;
00121     float                                    m_levelBonusTime;
00122     float                                    m_levelTimeRemaining;
00123     std::vector<std::shared_ptr<Level>>      m_level;
00124     uint32_t                                 m_levelCount;
00125     uint32_t                                 m_currentLevel;
00126
00127     std::shared_ptr<Sphere>                  m_player;
00128     std::vector<std::shared_ptr<GameObject>> m_objects;       // List of all objects to be included in intersection calculations.
00129     std::vector<std::shared_ptr<GameObject>> m_renderObjects; // List of all objects to be rendered.
00130
00131     DirectX::XMFLOAT3                        m_minBound;
00132     DirectX::XMFLOAT3                        m_maxBound;
00133 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/SignIn.xaml.h Source File

  • KeyCredentialManager
  • cpp

SignIn.xaml.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "SignIn.g.h"
00003 #include "MainPage.xaml.h"
00004 #include "Account.h"
00005 #include "pch.h"
00006 #include "SignIn.xaml.h"
00007 #include "MainPage.xaml.h"
00008 #include "UserSelect.xaml.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// TODO
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class SignIn sealed
00017     {
00018     public:
00019         SignIn();
00020
00021     protected:
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00023
00024     private:
00025         void Button_SignIn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00026         void Button_Passport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00027         concurrency::task<void> PassportAvailableCheckAsync();
00028         concurrency::task<void> SignInPassportAsync(bool passportIsPrimaryLogin);
00029         concurrency::task<bool> SignInPasswordAsync(bool calledFromPassport);
00030         concurrency::task<bool> AuthenticatePasswordCredentialsAsync();
00031         concurrency::task<bool> AuthenticatePassportAsync();
00032         concurrency::task<bool> AddPassportToAccountOnServerAsync();
00033         void SuccessfulSignIn(Account^ account);
00034         concurrency::task<bool> CreatePassportKeyAsync(Platform::String^ accountId);
00035         concurrency::task<Windows::Storage::Streams::IBuffer^> GetPassportAuthenticationMessageAsync(Windows::Storage::Streams::IBuffer^ message, Platform::String^ accountId);
00036
00037         MainPage^ rootPage;
00038         bool m_addingAccount = true;
00039         Account^ m_account;
00040         bool m_passportAvailable = true;
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario9.xaml.h Source File

  • SimpleInk
  • cpp

Scenario9.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario9.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario9 sealed
00024     {
00025     public:
00026         Scenario9();
00027     protected:
00028         void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00029     private:
00030         void InkPresenter_StrokesCollected(Windows::UI::Input::Inking::InkPresenter^ sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^ e);
00031         void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
00032         void OnReset(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void OnReplay(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void InkReplayTimer_Tick(Platform::Object^ sender, Platform::Object^ e);
00035
00036         void StopReplay();
00037         void ClearCanvasStrokeCache();
00038         Windows::UI::Input::Inking::InkStrokeContainer^ GetCurrentStrokesView(Windows::Foundation::DateTime time);
00039         Windows::UI::Input::Inking::InkStroke^ GetPartialStroke(Windows::UI::Input::Inking::InkStroke^ stroke, Windows::Foundation::DateTime time);
00040
00041         MainPage^ rootPage = MainPage::Current;
00042
00043         static const int FPS = 60;
00044
00045         Windows::Foundation::DateTime beginTimeOfRecordedSession;
00046         Windows::Foundation::DateTime endTimeOfRecordedSession;
00047         Windows::Foundation::TimeSpan durationOfRecordedSession;
00048         Windows::Foundation::DateTime beginTimeOfReplay;
00049
00050         Windows::UI::Xaml::DispatcherTimer^ inkReplayTimer;
00051
00052         Windows::UI::Input::Inking::InkStrokeBuilder^ strokeBuilder;
00053         Windows::Foundation::Collections::IVectorView<Windows::UI::Input::Inking::InkStroke^>^ strokesToReplay;
00054     };
00055 }
Generated on Fri Nov 15 2024 22:20:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDashApp/Views/Log.xaml.cs Source File

  • LiveDash
  • cs
  • LiveDashApp
  • Views

Log.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using LiveDash.Util;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005 using Windows.Storage;
00006
00007 #if DEBUG
00008 namespace LiveDashApp
00009 {
00010     public sealed partial class Log : Page
00011     {
00012         private DispatcherTimer logTimer;
00013         public Log()
00014         {
00015             this.InitializeComponent();
00016             logTimer = new DispatcherTimer();
00017             scrollview.HorizontalScrollMode = ScrollMode.Enabled;
00018             scrollview.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
00019             SetupLogging();
00020         }
00021
00022         private void SetupLogging()
00023         {
00024             logTimer.Interval = TimeSpan.FromSeconds(0.25);
00025
00026             logTimer.Tick += (sender, e) => output.Text = Logger.GetLog();
00027             logTimer.Start();
00028         }
00029
00030     }
00031 }
00032 #endif
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/SampleConfiguration.cpp Source File

  • CameraFrames
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Shared mode access to color, depth and infrared frame sources", "SDKTemplate.Scenario1_DisplayDepthColorIR" },
00021     { "Find and display camera sources", "SDKTemplate.Scenario2_FindAvailableSourceGroups" }
00022 };
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cpp/Scenario3_ParameterizedTemplate.xaml.h Source File

  • DateTimeFormatting
  • cpp

Scenario3_ParameterizedTemplate.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario3_ParameterizedTemplate.g.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario3_ParameterizedTemplate sealed
00021     {
00022     public:
00023         Scenario3_ParameterizedTemplate();
00024         void Display();
00025     };
00026 }
Generated on Fri Nov 15 2024 22:19:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_PredefinedDictationGrammar Member List

This is the complete list of members for Scenario_PredefinedDictationGrammar, including all inherited members.
cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario_PredefinedDictationGrammar | [inline, private]
HResultPrivacyStatementDeclined | Scenario_PredefinedDictationGrammar | [private, static]
InitializeRecognizer(Language recognizerLanguage) | Scenario_PredefinedDictationGrammar | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario_PredefinedDictationGrammar | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario_PredefinedDictationGrammar | [inline, protected]
openPrivacySettings_Click(Hyperlink sender, HyperlinkClickEventArgs args) | Scenario_PredefinedDictationGrammar | [inline, private]
PopulateLanguageDropdown() | Scenario_PredefinedDictationGrammar | [inline, private]
recognitionOperation | Scenario_PredefinedDictationGrammar | [private]
RecognizeWithoutUIDictationGrammar_Click(object sender, RoutedEventArgs e) | Scenario_PredefinedDictationGrammar | [inline, private]
RecognizeWithUIDictationGrammar_Click(object sender, RoutedEventArgs e) | Scenario_PredefinedDictationGrammar | [inline, private]
Scenario_PredefinedDictationGrammar() | Scenario_PredefinedDictationGrammar | [inline]
speechContext | Scenario_PredefinedDictationGrammar | [private]
speechRecognizer | Scenario_PredefinedDictationGrammar | [private]
SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) | Scenario_PredefinedDictationGrammar | [inline, private]
speechResourceMap | Scenario_PredefinedDictationGrammar | [private]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario11_CPDNoUI.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario11_CPDNoUI.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using System.Threading.Tasks;
00017 using SDKTemplate;
00018 using Windows.Security.EnterpriseData;
00019
00020 namespace EdpSample
00021 {
00022
00023     public sealed partial class Scenario11_CPDNoUI : Page
00024     {
00025         private MainPage rootPage;
00026
00027         public Scenario11_CPDNoUI()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         protected override void OnNavigatedTo(NavigationEventArgs e)
00033         {
00034             rootPage = MainPage.Current;
00035
00036             var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
00037             protectionPolicyManager.Identity = ""; // personal
00038             InputTxtBox.PlaceholderText = "Paste any text here";
00039         }
00040
00041         private async void Set_ClipboardNoUI(object sender, TextControlPasteEventArgs e)
00042         {
00043             // Mark the event as handled first. Otherwise, the
00044             // default paste action will happen, then the custom paste
00045             // action, and the user will see the text box content change.
00046             e.Handled = true;
00047
00048             // Get content from the clipboard.
00049             var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
00050             if (dataPackageView.Contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.Text))
00051             {
00052                 string outputStr = "";
00053
00054                 var policyResult = dataPackageView.UnlockAndAssumeEnterpriseIdentity();
00055                 if (policyResult != ProtectionPolicyEvaluationResult.Allowed)
00056                 {
00057                     outputStr += "Policy does not allow accessing clipboard";
00058                 }
00059                 var text = await dataPackageView.GetTextAsync();
00060                 var txtBox = sender as TextBox;
00061                 txtBox.Text = text;
00062                 outputStr += text != null ? "Successfully pasted" : "Pasting text failed";
00063                 rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00064             }
00065         }
00066     }
00067 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GetHistoricalBytes Member List

This is the complete list of members for GetHistoricalBytes, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetData(GetDataDataType type) | GetData | [inline]
GetDataDataType enum name | GetData |
GetHistoricalBytes() | GetHistoricalBytes | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Type | GetData |
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/DeviceResources.h Source File

  • HolographicVoiceInput
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include "CameraResources.h"
00014
00015 namespace DX
00016 {
00017     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00018     interface IDeviceNotify
00019     {
00020         virtual void OnDeviceLost()     = 0;
00021         virtual void OnDeviceRestored() = 0;
00022     };
00023
00024     // Creates and manages a Direct3D device and immediate context, Direct2D device and context (for debug), and the holographic swap chain.
00025     class DeviceResources
00026     {
00027     public:
00028         DeviceResources();
00029
00030         // Public methods related to Direct3D devices.
00031         void HandleDeviceLost();
00032         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00033         void Trim();
00034         void Present(Windows::Graphics::Holographic::HolographicFrame^ frame);
00035
00036         // Public methods related to holographic devices.
00037         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ space);
00038         void EnsureCameraResources(
00039             Windows::Graphics::Holographic::HolographicFrame^ frame,
00040             Windows::Graphics::Holographic::HolographicFramePrediction^ prediction);
00041
00042         void AddHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00043         void RemoveHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00044
00045         // Holographic accessors.
00046         template<typename RetType, typename LCallback>
00047         RetType                 UseHolographicCameraResources(const LCallback& callback);
00048
00049         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^
00050                                 GetD3DInteropDevice() const             { return m_d3dInteropDevice;    }
00051
00052         // D3D accessors.
00053         ID3D11Device4*          GetD3DDevice() const                    { return m_d3dDevice.Get();     }
00054         ID3D11DeviceContext3*   GetD3DDeviceContext() const             { return m_d3dContext.Get();    }
00055         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel;     }
00056         bool                    GetDeviceSupportsVprt() const           { return m_supportsVprt;        }
00057
00058         // DXGI acessors.
00059         IDXGIAdapter3*          GetDXGIAdapter() const                  { return m_dxgiAdapter.Get();   }
00060
00061         // D2D accessors.
00062         ID2D1Factory2*          GetD2DFactory() const                   { return m_d2dFactory.Get();    }
00063         IDWriteFactory2*        GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00064         IWICImagingFactory2*    GetWicImagingFactory() const            { return m_wicFactory.Get();    }
00065
00066     private:
00067         // Private methods related to the Direct3D device, and resources based on that device.
00068         void CreateDeviceIndependentResources();
00069         void InitializeUsingHolographicSpace();
00070         void CreateDeviceResources();
00071
00072         // Direct3D objects.
00073         Microsoft::WRL::ComPtr<ID3D11Device4>                   m_d3dDevice;
00074         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>            m_d3dContext;
00075         Microsoft::WRL::ComPtr<IDXGIAdapter3>                   m_dxgiAdapter;
00076
00077         // Direct3D interop objects.
00078         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^ m_d3dInteropDevice;
00079
00080         // Direct2D factories.
00081         Microsoft::WRL::ComPtr<ID2D1Factory2>                   m_d2dFactory;
00082         Microsoft::WRL::ComPtr<IDWriteFactory2>                 m_dwriteFactory;
00083         Microsoft::WRL::ComPtr<IWICImagingFactory2>             m_wicFactory;
00084
00085         // The holographic space provides a preferred DXGI adapter ID.
00086         Windows::Graphics::Holographic::HolographicSpace^       m_holographicSpace = nullptr;
00087
00088         // Properties of the Direct3D device currently in use.
00089         D3D_FEATURE_LEVEL                                       m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0;
00090
00091         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00092         IDeviceNotify*                                          m_deviceNotify = nullptr;
00093
00094         // Whether or not the current Direct3D device supports the optional feature
00095         // for setting the render target array index from the vertex shader stage.
00096         bool                                                    m_supportsVprt = false;
00097
00098         // Back buffer resources, etc. for attached holographic cameras.
00099         std::map<UINT32, std::unique_ptr<CameraResources>>      m_cameraResources;
00100         std::mutex                                              m_cameraResourcesLock;
00101     };
00102 }
00103
00104 // Device-based resources for holographic cameras are stored in a std::map. Access this list by providing a
00105 // callback to this function, and the std::map will be guarded from add and remove
00106 // events until the callback returns. The callback is processed immediately and must
00107 // not contain any nested calls to UseHolographicCameraResources.
00108 // The callback takes a parameter of type std::map<UINT32, std::unique_ptr<DX::CameraResources>>&
00109 // through which the list of cameras will be accessed.
00110 template<typename RetType, typename LCallback>
00111 RetType DX::DeviceResources::UseHolographicCameraResources(const LCallback& callback)
00112 {
00113     std::lock_guard<std::mutex> guard(m_cameraResourcesLock);
00114     return callback(m_cameraResources);
00115 }
00116
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Conditional Member List

This is the complete list of members for Scenario2_Conditional, including all inherited members.
_compositor | Scenario2_Conditional | [private]
_destinationEffectsPresent | Scenario2_Conditional | [private]
_destVisual | Scenario2_Conditional | [private]
_rootVisual | Scenario2_Conditional | [private]
Flyout_Closed(object sender, object e) | Scenario2_Conditional | [inline, private]
Flyout_Opened(object sender, object e) | Scenario2_Conditional | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Conditional | [inline, protected]
rootPage | Scenario2_Conditional | [private]
Scenario2_Conditional() | Scenario2_Conditional | [inline]
SetupBlur() | Scenario2_Conditional | [inline]
SetupDestinationEffect(Compositor compositor) | Scenario2_Conditional | [inline]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Constants Member List

This is the complete list of members for Constants, including all inherited members.
ConnectEntryPoint | Constants | [inline]
ConnectTaskName | Constants | [inline]
DeviceWatcherTaskName | Constants | [inline]
MetadataUpdateEntryPoint | Constants | [inline]
MetadataUpdateTaskName | Constants | [inline]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario3_DeviceIO.xaml.h Source File

  • CustomCapability
  • cpp

Scenario3_DeviceIO.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario3_DeviceIO.g.h"
00014
00015 namespace SDKTemplate
00016 {
00017     [Windows::Foundation::Metadata::WebHostHidden]
00018     public ref class DeviceIO sealed
00019     {
00020     public:
00021         DeviceIO();
00022
00023     private:
00024         MainPage^ rootPage = MainPage::Current;
00025         void DeviceIOGet_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00026         void DeviceIOSet_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00027     };
00028 }
Generated on Fri Nov 15 2024 22:19:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario5_IsSupported.cpp Source File

  • JumpList
  • cppwinrt

Scenario5_IsSupported.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_IsSupported.h"
00014 #include "Scenario5_IsSupported.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::StartScreen;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario5_IsSupported::Scenario5_IsSupported()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario5_IsSupported::OnNavigatedTo(NavigationEventArgs const&)
00030     {
00031         Supported().Text(JumpList::IsSupported() ? L"supports" : L"does not support");
00032     }
00033 }
Generated on Fri Nov 15 2024 22:20:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario3_NetworkConnectivityChanges.cpp Source File

  • NetworkConnectivity
  • cppwinrt

Scenario3_NetworkConnectivityChanges.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_NetworkConnectivityChanges.h"
00014 #include "Scenario3_NetworkConnectivityChanges.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::Foundation::Collections;
00020 using namespace winrt::Windows::Networking::Connectivity;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Controls;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024 using namespace winrt::Windows::Web::Http;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario3_NetworkConnectivityChanges::Scenario3_NetworkConnectivityChanges()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     void Scenario3_NetworkConnectivityChanges::OnNavigatedTo(NavigationEventArgs const&)
00034     {
00035         UpdateButtonStates();
00036     }
00037
00038     void Scenario3_NetworkConnectivityChanges::OnNavigatedFrom(NavigationEventArgs const&)
00039     {
00040         if (m_networkStatusChangeEventToken)
00041         {
00042             UnregisterNetworkStatusChanged();
00043         }
00044     }
00045
00046     fire_and_forget Scenario3_NetworkConnectivityChanges::UpdateNetworkStatus()
00047     {
00048         // This code runs on the UI thread, so there are no race conditions on these
00049         // member variables.
00050         if (m_isUpdatingNetworkStatus)
00051         {
00052             // Update is already in progress. Let it finish before we re-evaluate.
00053             m_isNetworkStatusUpdatePending = true;
00054             co_return;
00055         }
00056
00057         auto lifetime = get_strong();
00058
00059         m_isUpdatingNetworkStatus = true;
00060
00061         do
00062         {
00063             m_isNetworkStatusUpdatePending = false;
00064             ResultsText().Text(L"");
00065
00066             ConnectionProfile internetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();
00067             NetworkConnectivityLevel connectivityLevel = NetworkConnectivityLevel::None;
00068             if (internetConnectionProfile != nullptr)
00069             {
00070                 connectivityLevel = internetConnectionProfile.GetNetworkConnectivityLevel();
00071             }
00072
00073             AppendLine(ResultsText(), L"Current connectivity is " + to_hstring(connectivityLevel) + L".");
00074             if (ShouldAttemptToConnectToInternet(connectivityLevel))
00075             {
00076                 AppendLine(ResultsText(), L"Checking network cost before connecting to the Internet.");
00077                 co_await EvaluateCostAndConnectAsync(internetConnectionProfile.GetConnectionCost(), OptedInToNetworkUsageToggle().IsOn(), ResultsText());
00078             }
00079             else
00080             {
00081                 AppendLine(ResultsText(), L"Not attempting to connect to the Internet.");
00082             }
00083         }
00084         while (m_isNetworkStatusUpdatePending);
00085         m_isUpdatingNetworkStatus = false;
00086     }
00087
00088     fire_and_forget Scenario3_NetworkConnectivityChanges::OnNetworkStatusChanged(IInspectable const&)
00089     {
00090         auto lifetime = get_strong();
00091
00092         co_await resume_foreground(Dispatcher());
00093
00094         UpdateNetworkStatus();
00095     }
00096
00097     void Scenario3_NetworkConnectivityChanges::RegisterNetworkStatusChanged()
00098     {
00099         m_networkStatusChangeEventToken = NetworkInformation::NetworkStatusChanged({ get_weak(), &Scenario3_NetworkConnectivityChanges::OnNetworkStatusChanged });
00100         UpdateNetworkStatus();
00101     }
00102
00103     void Scenario3_NetworkConnectivityChanges::UnregisterNetworkStatusChanged()
00104     {
00105         NetworkInformation::NetworkStatusChanged(std::exchange(m_networkStatusChangeEventToken, {}));
00106     }
00107
00108     void Scenario3_NetworkConnectivityChanges::RegisterUnregisterButton_Click(IInspectable const&, RoutedEventArgs const&)
00109     {
00110         if (m_networkStatusChangeEventToken)
00111         {
00112             UnregisterNetworkStatusChanged();
00113         }
00114         else
00115         {
00116             RegisterNetworkStatusChanged();
00117         }
00118         UpdateButtonStates();
00119     }
00120
00121     /// <summary>
00122     /// Update the UI based on whether we are registered for the event.
00123     /// </summary>
00124     void Scenario3_NetworkConnectivityChanges::UpdateButtonStates()
00125     {
00126         VisualStateManager::GoToState(*this, m_networkStatusChangeEventToken ? L"Registered" : L"Unregistered", false);
00127     }
00128 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomUsbDeviceAccess/cs/Scenario1_ConnectDisconnect.xaml.cs Source File

  • CustomUsbDeviceAccess
  • cs

Scenario1_ConnectDisconnect.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016
00017 using System;
00018 using System.IO;
00019 using System.Collections.Generic;
00020 using System.Collections.ObjectModel;
00021
00022 using Windows.ApplicationModel;
00023 using Windows.Foundation;
00024
00025 using Windows.UI.Core;
00026
00027 using Windows.Devices.Enumeration;
00028 using Windows.Devices.Usb;
00029 using CustomUsbDeviceAccess;
00030
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 namespace CustomUsbDeviceAccess
00035 {
00036     /// <summary>
00037     /// Demonstrates how to connect to a USB Device and respond to device disconnects, app suspending and resuming events.
00038     ///
00039     /// To use this sample with your device:
00040     /// 1) Include the device in the Package.appxmanifest. For instructions, see Package.appxmanifest documentation.
00041     /// 2) Create a DeviceWatcher object for your device. See the InitializeDeviceWatcher method in this sample.
00042     /// </summary>
00043     public sealed partial class Scenario1_ConnectDisconnect : Page
00044     {
00045         private const String ButtonNameDisconnectFromDevice = "Disconnect from device";
00046         private const String ButtonNameDisableReconnectToDevice = "Do not automatically reconnect to device that was just closed";
00047
00048         // Pointer back to the main page
00049         private MainPage rootPage = MainPage.Current;
00050
00051         private SuspendingEventHandler appSuspendEventHandler;
00052         private EventHandler<Object> appResumeEventHandler;
00053
00054         private ObservableCollection<DeviceListEntry> listOfDevices;
00055
00056         private Dictionary<DeviceWatcher, String> mapDeviceWatchersToDeviceSelector;
00057         private Boolean watchersSuspended;
00058         private Boolean watchersStarted;
00059
00060         // Has all the devices enumerated by the device watcher?
00061         private Boolean isAllDevicesEnumerated;
00062
00063         public Scenario1_ConnectDisconnect()
00064         {
00065             this.InitializeComponent();
00066
00067             listOfDevices = new ObservableCollection<DeviceListEntry>();
00068
00069             mapDeviceWatchersToDeviceSelector = new Dictionary<DeviceWatcher, String>();
00070             watchersStarted = false;
00071             watchersSuspended = false;
00072
00073             isAllDevicesEnumerated = false;
00074         }
00075
00076         /// <summary>
00077         /// Invoked when this page is about to be displayed in a Frame.
00078         ///
00079         /// Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.
00080         /// </summary>
00081         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00082         /// property is typically used to configure the page.</param>
00083         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00084         {
00085             // If we are connected to the device or planning to reconnect, we should disable the list of devices
00086             // to prevent the user from opening a device without explicitly closing or disabling the auto reconnect
00087             if (EventHandlerForDevice.Current.IsDeviceConnected
00088                 || (EventHandlerForDevice.Current.IsEnabledAutoReconnect
00089                 && EventHandlerForDevice.Current.DeviceInformation != null))
00090             {
00091                 UpdateConnectDisconnectButtonsAndList(false);
00092
00093                 // These notifications will occur if we are waiting to reconnect to device when we start the page
00094                 EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
00095                 EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00096             }
00097             else
00098             {
00099                 UpdateConnectDisconnectButtonsAndList(true);
00100             }
00101
00102             // Begin watching out for events
00103             StartHandlingAppEvents();
00104
00105             // Initialize the desired device watchers so that we can watch for when devices are connected/removed
00106             InitializeDeviceWatchers();
00107             StartDeviceWatchers();
00108
00109             DeviceListSource.Source = listOfDevices;
00110         }
00111
00112         /// <summary>
00113         /// Unregister from App events and DeviceWatcher events because this page will be unloaded.
00114         /// </summary>
00115         /// <param name="eventArgs"></param>
00116         protected override void OnNavigatedFrom(NavigationEventArgs eventArgs)
00117         {
00118             StopDeviceWatchers();
00119             StopHandlingAppEvents();
00120
00121             // We no longer care about the device being connected
00122             EventHandlerForDevice.Current.OnDeviceConnected = null;
00123             EventHandlerForDevice.Current.OnDeviceClose = null;
00124         }
00125
00126         private async void ConnectToDevice_Click(Object sender, RoutedEventArgs eventArgs)
00127         {
00128             var selection = ConnectDevices.SelectedItems;
00129             DeviceListEntry entry = null;
00130
00131             if (selection.Count > 0)
00132             {
00133                 var obj = selection[0];
00134                 entry = (DeviceListEntry)obj;
00135
00136                 if (entry != null)
00137                 {
00138                     // Create an EventHandlerForDevice to watch for the device we are connecting to
00139                     EventHandlerForDevice.CreateNewEventHandlerForDevice();
00140
00141                     // Get notified when the device was successfully connected to or about to be closed
00142                     EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
00143                     EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00144
00145                     // It is important that the FromIdAsync call is made on the UI thread because the consent prompt, when present,
00146                     // can only be displayed on the UI thread. Since this method is invoked by the UI, we are already in the UI thread.
00147                     Boolean openSuccess = await EventHandlerForDevice.Current.OpenDeviceAsync(entry.DeviceInformation, entry.DeviceSelector);
00148
00149                     // Disable connect button if we connected to the device
00150                     UpdateConnectDisconnectButtonsAndList(!openSuccess);
00151                 }
00152             }
00153         }
00154
00155         private void DisconnectFromDevice_Click(Object sender, RoutedEventArgs eventArgs)
00156         {
00157             var selection = ConnectDevices.SelectedItems;
00158             DeviceListEntry entry = null;
00159
00160             // Prevent auto reconnect because we are voluntarily closing it
00161             // Re-enable the ConnectDevice list and ConnectToDevice button if the connected/opened device was removed.
00162             EventHandlerForDevice.Current.IsEnabledAutoReconnect = false;
00163
00164             if (selection.Count > 0)
00165             {
00166                 var obj = selection[0];
00167                 entry = (DeviceListEntry)obj;
00168
00169                 if (entry != null)
00170                 {
00171                     EventHandlerForDevice.Current.CloseDevice();
00172                 }
00173             }
00174
00175             UpdateConnectDisconnectButtonsAndList(true);
00176         }
00177
00178         /// <summary>
00179         /// Initialize device watchers to watch for the OSRFX2 and the SuperMUTT.
00180         /// Several other ways of using a device selector to get the desired devices (the devices are really DeviceInformation objects):
00181         /// 1) Using the interface class guid
00182         /// 2) Using the Vendor Id and the Product Id
00183         /// 3) Using the Device class
00184         ///
00185         /// GetDeviceClassSelector and GetDeviceSelector both return an AQS string that can be passed directly into
00186         /// DeviceWatcher.createWatcher() or  DeviceInformation.createFromIdAsync(). The AQS defines the search parameters
00187         /// so that only our device is queried
00188         ///
00189         /// In this sample, a DeviceWatcher will be used to watch for devices because we can detect surprise device removals.
00190         /// </summary>
00191         private void InitializeDeviceWatchers()
00192         {
00193             InitializeOsrFx2DeviceWatcher();
00194             InitializeSuperMuttDeviceWatcher();
00195         }
00196
00197         /// <summary>
00198         /// Please see IntializeDeviceWatchers for more information on using device selectors
00199         /// </summary>
00200         private void InitializeOsrFx2DeviceWatcher()
00201         {
00202             var osrFx2Selector = UsbDevice.GetDeviceSelector(OsrFx2.DeviceVid, OsrFx2.DevicePid);
00203
00204             // Create a device watcher to look for instances of the OSRFX2 device
00205             var osrFx2Watcher = DeviceInformation.CreateWatcher(osrFx2Selector);
00206
00207             // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
00208             AddDeviceWatcher(osrFx2Watcher, osrFx2Selector);
00209         }
00210
00211         /// <summary>
00212         /// Please see IntializeDeviceWatchers for more information on using device selectors
00213         /// </summary>
00214         private void InitializeSuperMuttDeviceWatcher()
00215         {
00216             // SuperMutt's Interface class {875D47FC-D331-4663-B339-624001A2DC5E}
00217             // This is the most specific type of DeviceSelector.
00218             var superMuttSelector = UsbDevice.GetDeviceSelector(SuperMutt.DeviceVid, SuperMutt.DevicePid, SuperMutt.DeviceInterfaceClass);
00219
00220             // Create a device watcher to look for instances of the SuperMUTT device
00221             var superMuttWatcher = DeviceInformation.CreateWatcher(superMuttSelector);
00222
00223             // Allow the EventHandlerForDevice to handle device watcher events that relates or effects our device (i.e. device removal, addition, app suspension/resume)
00224             AddDeviceWatcher(superMuttWatcher, superMuttSelector);
00225         }
00226
00227         private void StartHandlingAppEvents()
00228         {
00229             appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension);
00230             appResumeEventHandler = new EventHandler<Object>(this.OnAppResume);
00231
00232             // This event is raised when the app is exited and when the app is suspended
00233             App.Current.Suspending += appSuspendEventHandler;
00234
00235             App.Current.Resuming += appResumeEventHandler;
00236         }
00237
00238         private void StopHandlingAppEvents()
00239         {
00240             // This event is raised when the app is exited and when the app is suspended
00241             App.Current.Suspending -= appSuspendEventHandler;
00242
00243             App.Current.Resuming -= appResumeEventHandler;
00244         }
00245
00246         /// <summary>
00247         /// Registers for Added, Removed, and Enumerated events on the provided deviceWatcher before adding it to an internal list.
00248         /// </summary>
00249         /// <param name="deviceWatcher"></param>
00250         /// <param name="deviceSelector">The AQS used to create the device watcher</param>
00251         private void AddDeviceWatcher(DeviceWatcher deviceWatcher, String deviceSelector)
00252         {
00253             deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(this.OnDeviceAdded);
00254             deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(this.OnDeviceRemoved);
00255             deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(this.OnDeviceEnumerationComplete);
00256
00257             mapDeviceWatchersToDeviceSelector.Add(deviceWatcher, deviceSelector);
00258         }
00259
00260         /// <summary>
00261         /// Starts all device watchers including ones that have been individually stopped.
00262         /// </summary>
00263         private void StartDeviceWatchers()
00264         {
00265             // Start all device watchers
00266             watchersStarted = true;
00267             isAllDevicesEnumerated = false;
00268
00269             foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
00270             {
00271                 if ((deviceWatcher.Status != DeviceWatcherStatus.Started)
00272                     && (deviceWatcher.Status != DeviceWatcherStatus.EnumerationCompleted))
00273                 {
00274                     deviceWatcher.Start();
00275                 }
00276             }
00277         }
00278
00279         /// <summary>
00280         /// Stops all device watchers.
00281         /// </summary>
00282         private void StopDeviceWatchers()
00283         {
00284             // Stop all device watchers
00285             foreach (DeviceWatcher deviceWatcher in mapDeviceWatchersToDeviceSelector.Keys)
00286             {
00287                 if ((deviceWatcher.Status == DeviceWatcherStatus.Started)
00288                     || (deviceWatcher.Status == DeviceWatcherStatus.EnumerationCompleted))
00289                 {
00290                     deviceWatcher.Stop();
00291                 }
00292             }
00293
00294             // Clear the list of devices so we don't have potentially disconnected devices around
00295             ClearDeviceEntries();
00296
00297             watchersStarted = false;
00298         }
00299
00300         /// <summary>
00301         /// Creates a DeviceListEntry for a device and adds it to the list of devices in the UI
00302         /// </summary>
00303         /// <param name="deviceInformation">DeviceInformation on the device to be added to the list</param>
00304         /// <param name="deviceSelector">The AQS used to find this device</param>
00305         private void AddDeviceToList(DeviceInformation deviceInformation, String deviceSelector)
00306         {
00307             // search the device list for a device with a matching interface ID
00308             var match = FindDevice(deviceInformation.Id);
00309
00310             // Add the device if it's new
00311             if (match == null)
00312             {
00313                 // Create a new element for this device interface, and queue up the query of its
00314                 // device information
00315                 match = new DeviceListEntry(deviceInformation, deviceSelector);
00316
00317                 // Add the new element to the end of the list of devices
00318                 listOfDevices.Add(match);
00319             }
00320         }
00321
00322         private void RemoveDeviceFromList(String deviceId)
00323         {
00324             // Removes the device entry from the interal list; therefore the UI
00325             var deviceEntry = FindDevice(deviceId);
00326
00327             listOfDevices.Remove(deviceEntry);
00328         }
00329
00330         private void ClearDeviceEntries()
00331         {
00332             listOfDevices.Clear();
00333         }
00334
00335         /// <summary>
00336         /// Searches through the existing list of devices for the first DeviceListEntry that has
00337         /// the specified device Id.
00338         /// </summary>
00339         /// <param name="deviceId">Id of the device that is being searched for</param>
00340         /// <returns>DeviceListEntry that has the provided Id; else a nullptr</returns>
00341         private DeviceListEntry FindDevice(String deviceId)
00342         {
00343             if (deviceId != null)
00344             {
00345                 foreach (DeviceListEntry entry in listOfDevices)
00346                 {
00347                     if (entry.DeviceInformation.Id == deviceId)
00348                     {
00349                         return entry;
00350                     }
00351                 }
00352             }
00353
00354             return null;
00355         }
00356
00357         /// <summary>
00358         /// We must stop the DeviceWatchers because device watchers will continue to raise events even if
00359         /// the app is in suspension, which is not desired (drains battery). We resume the device watcher once the app resumes again.
00360         /// </summary>
00361         /// <param name="sender"></param>
00362         /// <param name="eventArgs"></param>
00363         private void OnAppSuspension(Object sender, SuspendingEventArgs args)
00364         {
00365             if (watchersStarted)
00366             {
00367                 watchersSuspended = true;
00368                 StopDeviceWatchers();
00369             }
00370             else
00371             {
00372                 watchersSuspended = false;
00373             }
00374         }
00375
00376         /// <summary>
00377         /// See OnAppSuspension for why we are starting the device watchers again
00378         /// </summary>
00379         /// <param name="sender"></param>
00380         /// <param name="args"></param>
00381         private void OnAppResume(Object sender, Object args)
00382         {
00383             if (watchersSuspended)
00384             {
00385                 watchersSuspended = false;
00386                 StartDeviceWatchers();
00387             }
00388         }
00389
00390         /// <summary>
00391         /// We will remove the device from the UI
00392         /// </summary>
00393         /// <param name="sender"></param>
00394         /// <param name="deviceInformationUpdate"></param>
00395         private async void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
00396         {
00397             await rootPage.Dispatcher.RunAsync(
00398                 CoreDispatcherPriority.Normal,
00399                 new DispatchedHandler(() =>
00400                 {
00401                     rootPage.NotifyUser("Device removed - " + deviceInformationUpdate.Id, NotifyType.StatusMessage);
00402
00403                     RemoveDeviceFromList(deviceInformationUpdate.Id);
00404                 }));
00405         }
00406
00407         /// <summary>
00408         /// This function will add the device to the listOfDevices so that it shows up in the UI
00409         /// </summary>
00410         /// <param name="sender"></param>
00411         /// <param name="deviceInformation"></param>
00412         private async void OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInformation)
00413         {
00414             await rootPage.Dispatcher.RunAsync(
00415                 CoreDispatcherPriority.Normal,
00416                 new DispatchedHandler(() =>
00417                 {
00418                     rootPage.NotifyUser("Device added - " + deviceInformation.Id, NotifyType.StatusMessage);
00419
00420                     AddDeviceToList(deviceInformation, mapDeviceWatchersToDeviceSelector[sender]);
00421                 }));
00422         }
00423
00424         /// <summary>
00425         /// Notify the UI whether or not we are connected to a device
00426         /// </summary>
00427         /// <param name="sender"></param>
00428         /// <param name="args"></param>
00429         private async void OnDeviceEnumerationComplete(DeviceWatcher sender, Object args)
00430         {
00431             await rootPage.Dispatcher.RunAsync(
00432                 CoreDispatcherPriority.Normal,
00433                 new DispatchedHandler(() =>
00434                 {
00435                     isAllDevicesEnumerated = true;
00436
00437                     // If we finished enumerating devices and the device has not been connected yet, the OnDeviceConnected method
00438                     // is responsible for selecting the device in the device list (UI); otherwise, this method does that.
00439                     if (EventHandlerForDevice.Current.IsDeviceConnected)
00440                     {
00441                         SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);
00442
00443                         ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
00444
00445                         rootPage.NotifyUser("Connected to - " +
00446                                             EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00447                     }
00448                     else if (EventHandlerForDevice.Current.IsEnabledAutoReconnect && EventHandlerForDevice.Current.DeviceInformation != null)
00449                     {
00450                         // We will be reconnecting to a device
00451                         ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
00452
00453                         rootPage.NotifyUser("Waiting to reconnect to device -  " + EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00454                     }
00455                     else
00456                     {
00457                         rootPage.NotifyUser("No device is currently connected", NotifyType.StatusMessage);
00458                     }
00459                 }));
00460         }
00461
00462         /// <summary>
00463         /// If all the devices have been enumerated, select the device in the list we connected to. Otherwise let the EnumerationComplete event
00464         /// from the device watcher handle the device selection
00465         /// </summary>
00466         /// <param name="sender"></param>
00467         /// <param name="deviceInformation"></param>
00468         private void OnDeviceConnected(EventHandlerForDevice sender, DeviceInformation deviceInformation)
00469         {
00470             // Find and select our connected device
00471             if (isAllDevicesEnumerated)
00472             {
00473                 SelectDeviceInList(EventHandlerForDevice.Current.DeviceInformation.Id);
00474
00475                 ButtonDisconnectFromDevice.Content = ButtonNameDisconnectFromDevice;
00476             }
00477
00478             rootPage.NotifyUser("Connected to - " +
00479                                 EventHandlerForDevice.Current.DeviceInformation.Id, NotifyType.StatusMessage);
00480         }
00481
00482         /// <summary>
00483         /// The device was closed. If we will autoreconnect to the device, reflect that in the UI
00484         /// </summary>
00485         /// <param name="sender"></param>
00486         /// <param name="deviceInformation"></param>
00487         private async void OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation)
00488         {
00489             await rootPage.Dispatcher.RunAsync(
00490                 CoreDispatcherPriority.Normal,
00491                 new DispatchedHandler(() =>
00492                 {
00493                     // We were connected to the device that was unplugged, so change the "Disconnect from device" button
00494                     // to "Do not reconnect to device"
00495                     if (ButtonDisconnectFromDevice.IsEnabled && EventHandlerForDevice.Current.IsEnabledAutoReconnect)
00496                     {
00497                         ButtonDisconnectFromDevice.Content = ButtonNameDisableReconnectToDevice;
00498                     }
00499                 }));
00500         }
00501
00502         /// <summary>
00503         /// Selects the item in the UI's listbox that corresponds to the provided device id. If there are no
00504         /// matches, we will deselect anything that is selected.
00505         /// </summary>
00506         /// <param name="deviceIdToSelect">The device id of the device to select on the list box</param>
00507         private void SelectDeviceInList(String deviceIdToSelect)
00508         {
00509             // Don't select anything by default.
00510             ConnectDevices.SelectedIndex = -1;
00511
00512             for (int deviceListIndex = 0; deviceListIndex < listOfDevices.Count; deviceListIndex++)
00513             {
00514                 if (listOfDevices[deviceListIndex].DeviceInformation.Id == deviceIdToSelect)
00515                 {
00516                     ConnectDevices.SelectedIndex = deviceListIndex;
00517
00518                     break;
00519                 }
00520             }
00521         }
00522
00523         /// <summary>
00524         /// When ButtonConnectToDevice is disabled, ConnectDevices list will also be disabled.
00525         /// </summary>
00526         /// <param name="enableConnectButton">The state of ButtonConnectToDevice</param>
00527         private void UpdateConnectDisconnectButtonsAndList(Boolean enableConnectButton)
00528         {
00529             ButtonConnectToDevice.IsEnabled = enableConnectButton;
00530             ButtonDisconnectFromDevice.IsEnabled = !ButtonConnectToDevice.IsEnabled;
00531
00532             ConnectDevices.IsEnabled = ButtonConnectToDevice.IsEnabled;
00533         }
00534     }
00535 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/pch.cpp Source File

  • HolographicSpatialStage
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/Scenario2_ConfigureDevice.xaml.cs Source File

  • CustomSerialDeviceAccess
  • cs

Scenario2_ConfigureDevice.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using Windows.Devices.SerialCommunication;
00016 using SDKTemplate;
00017 using CustomSerialDeviceAccess;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace CustomSerialDeviceAccess
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario2_ConfigureDevice : Page
00027     {
00028
00029         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00030         // as NotifyUser()
00031         private MainPage rootPage = MainPage.Current;
00032
00033         public Scenario2_ConfigureDevice()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         /// <summary>
00039         /// Invoked when this page is about to be displayed in a Frame.
00040         ///
00041         /// We will enable/disable parts of the UI if the device doesn't support it.
00042         /// </summary>
00043         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00046         {
00047
00048             if (EventHandlerForDevice.Current.Device == null)
00049             {
00050                 ConfigureDeviceScrollViewer.Visibility = Visibility.Collapsed;
00051                 MainPage.Current.NotifyUser("Device is not connected", NotifyType.ErrorMessage);
00052             }
00053             else
00054             {
00055                 if (EventHandlerForDevice.Current.Device.PortName != "")
00056                 {
00057                     MainPage.Current.NotifyUser("Connected to " + EventHandlerForDevice.Current.Device.PortName,
00058                                                 NotifyType.StatusMessage);
00059                 }
00060
00061                 UpdateBaudRateView();
00062                 UpdateParityView();
00063                 UpdateHandShakeView();
00064                 UpdateBreakStateSignalView();
00065                 UpdateCarrierDetectStateView();
00066                 UpdateDataBitsView();
00067                 UpdateDataSetReadyStateView();
00068                 UpdateDataTerminalReadyEnabledView();
00069                 UpdateRequestToSendEnabledView();
00070                 UpdateStopBitCountView();
00071             }
00072         }
00073
00074         private void UpdateBaudRateView()
00075         {
00076             BaudRateValue.Text = EventHandlerForDevice.Current.Device.BaudRate.ToString();
00077         }
00078
00079         private void BaudRateSetButton_Click(object sender, RoutedEventArgs e)
00080         {
00081             uint BaudRateInput = uint.Parse(BaudRateInputValue.Text);
00082             if (BaudRateInput != 0)
00083             {
00084                 EventHandlerForDevice.Current.Device.BaudRate = BaudRateInput;
00085             }
00086             UpdateBaudRateView();
00087         }
00088
00089         private void UpdateParityView()
00090         {
00091             ParityValue.Text = EventHandlerForDevice.Current.Device.Parity.ToString();
00092             ParityComboBox.SelectedIndex = ParityComboBox.Items.IndexOf(ParityValue.Text);
00093         }
00094
00095         private void ParityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00096         {
00097             if (ParityComboBox.SelectedItem.Equals("None"))
00098             {
00099                 EventHandlerForDevice.Current.Device.Parity = SerialParity.None;
00100             }
00101             else if (ParityComboBox.SelectedItem.Equals("Even"))
00102             {
00103                 EventHandlerForDevice.Current.Device.Parity = SerialParity.Even;
00104             }
00105             else if (ParityComboBox.SelectedItem.Equals("Odd"))
00106             {
00107                 EventHandlerForDevice.Current.Device.Parity = SerialParity.Odd;
00108             }
00109             else if (ParityComboBox.SelectedItem.Equals("Mark"))
00110             {
00111                 EventHandlerForDevice.Current.Device.Parity = SerialParity.Mark;
00112             }
00113             else if (ParityComboBox.SelectedItem.Equals("Space"))
00114             {
00115                 EventHandlerForDevice.Current.Device.Parity = SerialParity.Space;
00116             }
00117             UpdateParityView();
00118         }
00119
00120         private void UpdateStopBitCountView()
00121         {
00122             StopBitCountValue.Text = EventHandlerForDevice.Current.Device.StopBits.ToString();
00123             if (StopBitCountValue.Text.Equals("None") == false)
00124             {
00125                 StopBitCountComboBox.SelectedIndex = StopBitCountComboBox.Items.IndexOf(StopBitCountValue.Text);
00126             }
00127         }
00128
00129         private void StopBitCountComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00130         {
00131             if (StopBitCountComboBox.SelectedItem.Equals("One"))
00132             {
00133                 EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.One;
00134             }
00135             else if (StopBitCountComboBox.SelectedItem.Equals("OnePointFive"))
00136             {
00137                 EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.OnePointFive;
00138             }
00139             else if (StopBitCountComboBox.SelectedItem.Equals("Two"))
00140             {
00141                 EventHandlerForDevice.Current.Device.StopBits = SerialStopBitCount.Two;
00142             }
00143             UpdateStopBitCountView();
00144         }
00145
00146         private void UpdateHandShakeView()
00147         {
00148             HandShakeValue.Text = EventHandlerForDevice.Current.Device.Handshake.ToString();
00149             HandShakeComboBox.SelectedIndex = HandShakeComboBox.Items.IndexOf(HandShakeValue.Text);
00150         }
00151
00152         private void HandShakeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00153         {
00154             if (HandShakeComboBox.SelectedItem.Equals("None"))
00155             {
00156                 EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.None;
00157             }
00158             else if (HandShakeComboBox.SelectedItem.Equals("RequestToSend"))
00159             {
00160                 EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.RequestToSend;
00161             }
00162             else if (HandShakeComboBox.SelectedItem.Equals("XOnXOff"))
00163             {
00164                 EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.XOnXOff;
00165             }
00166             else if (HandShakeComboBox.SelectedItem.Equals("RequestToSendXOnXOff"))
00167             {
00168                 EventHandlerForDevice.Current.Device.Handshake = SerialHandshake.RequestToSendXOnXOff;
00169             }
00170             UpdateHandShakeView();
00171         }
00172
00173         private void UpdateBreakStateSignalView()
00174         {
00175             bool currentState = EventHandlerForDevice.Current.Device.BreakSignalState;
00176             if (currentState)
00177             {
00178                 BreakStateSignalValue.Text = " On";
00179             }
00180             else
00181             {
00182                 BreakStateSignalValue.Text = " Off";
00183             }
00184             BreakStateSignalToggleSwitch.IsOn = currentState;
00185         }
00186
00187         private void BreakStateSignalToggleSwitch_Toggled(object sender, RoutedEventArgs e)
00188         {
00189             EventHandlerForDevice.Current.Device.BreakSignalState = BreakStateSignalToggleSwitch.IsOn;
00190             UpdateBreakStateSignalView();
00191         }
00192
00193         private void UpdateDataTerminalReadyEnabledView()
00194         {
00195             bool currentState = EventHandlerForDevice.Current.Device.IsDataTerminalReadyEnabled;
00196             if (currentState)
00197             {
00198                 DataTerminalReadyEnabledValue.Text = "On";
00199             }
00200             else
00201             {
00202                 DataTerminalReadyEnabledValue.Text = "Off";
00203             }
00204             DataTerminalReadyEnabledToggleSwitch.IsOn = currentState;
00205         }
00206
00207         private void DataTerminalReadyEnabledToggleSwitch_Toggled(object sender, RoutedEventArgs e)
00208         {
00209             EventHandlerForDevice.Current.Device.IsDataTerminalReadyEnabled = DataTerminalReadyEnabledToggleSwitch.IsOn;
00210             UpdateDataTerminalReadyEnabledView();
00211         }
00212
00213         private void UpdateRequestToSendEnabledView()
00214         {
00215             bool currentState = EventHandlerForDevice.Current.Device.IsRequestToSendEnabled;
00216             if (currentState)
00217             {
00218                 RequestToSendEnabledValue.Text = "On";
00219             }
00220             else
00221             {
00222                 RequestToSendEnabledValue.Text = "Off";
00223             }
00224             RequestToSendEnabledToggleSwitch.IsOn = currentState;
00225         }
00226
00227         private void RequestToSendEnabledToggleSwitch_Toggled(object sender, RoutedEventArgs e)
00228         {
00229             EventHandlerForDevice.Current.Device.IsRequestToSendEnabled = RequestToSendEnabledToggleSwitch.IsOn;
00230             UpdateRequestToSendEnabledView();
00231         }
00232
00233         private void UpdateCarrierDetectStateView()
00234         {
00235             if (EventHandlerForDevice.Current.Device.CarrierDetectState)
00236             {
00237                 CarrierDetectStateValue.Text = "On";
00238             }
00239             else
00240             {
00241                 CarrierDetectStateValue.Text = "Off";
00242             }
00243         }
00244
00245         private void UpdateDataSetReadyStateView()
00246         {
00247             if (EventHandlerForDevice.Current.Device.DataSetReadyState)
00248             {
00249                 DataSetReadyStateValue.Text = "On";
00250             }
00251             else
00252             {
00253                 DataSetReadyStateValue.Text = "Off";
00254             }
00255         }
00256
00257         private void UpdateDataBitsView()
00258         {
00259             ushort dataBits = EventHandlerForDevice.Current.Device.DataBits;
00260             DataBitsValue.Text = dataBits.ToString();
00261             if (dataBits <= 8)
00262             {
00263                 DataBitsComboBox.SelectedIndex = dataBits;
00264             }
00265         }
00266
00267         private void DataBitsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00268         {
00269             EventHandlerForDevice.Current.Device.DataBits = ushort.Parse(DataBitsComboBox.SelectedValue.ToString());
00270             UpdateDataBitsView();
00271         }
00272
00273     }
00274 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/SampleOverlay.cpp Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

SampleOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleOverlay.h"
00014
00015 using namespace CustomComputeShader;
00016
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::Foundation;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::Graphics::Display;
00022 using namespace D2D1;
00023
00024 SampleOverlay::SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption) :
00025     m_deviceResources(deviceResources),
00026     m_caption(caption),
00027     m_drawOverlay(true)
00028 {
00029     m_padding = 8.0f;
00030     m_textVerticalOffset = 7.0f;
00031     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00032     m_overlayWidth = 0.0f;
00033
00034     CreateDeviceDependentResources();
00035     CreateWindowSizeDependentResources();
00036 }
00037
00038 void SampleOverlay::CreateDeviceDependentResources()
00039 {
00040     DX::ThrowIfFailed(
00041         m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
00042         );
00043
00044     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00045     DX::ThrowIfFailed(
00046         m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
00047             L"Assets\\storelogo-sdk.png",
00048             nullptr,
00049             GENERIC_READ,
00050             WICDecodeMetadataCacheOnDemand,
00051             &wicBitmapDecoder
00052             )
00053         );
00054
00055     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00056     DX::ThrowIfFailed(
00057         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00058         );
00059
00060     ComPtr<IWICFormatConverter> wicFormatConverter;
00061     DX::ThrowIfFailed(
00062         m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
00063         );
00064
00065     DX::ThrowIfFailed(
00066         wicFormatConverter->Initialize(
00067             wicBitmapFrame.Get(),
00068             GUID_WICPixelFormat32bppPBGRA,
00069             WICBitmapDitherTypeNone,
00070             nullptr,
00071             0.0,
00072             WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
00073             )
00074         );
00075
00076     double dpiX = 96.0;
00077     double dpiY = 96.0;
00078     DX::ThrowIfFailed(
00079         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00080         );
00081
00082     DX::ThrowIfFailed(
00083         m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
00084             wicFormatConverter.Get(),
00085             BitmapProperties(
00086                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00087                 static_cast<float>(dpiX),
00088                 static_cast<float>(dpiY)
00089                 ),
00090             &m_logoBitmap
00091             )
00092         );
00093
00094     m_logoSize = m_logoBitmap->GetSize();
00095
00096     ComPtr<IDWriteTextFormat> nameTextFormat;
00097     DX::ThrowIfFailed(
00098         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00099             L"Segoe UI",
00100             nullptr,
00101             DWRITE_FONT_WEIGHT_LIGHT,
00102             DWRITE_FONT_STYLE_NORMAL,
00103             DWRITE_FONT_STRETCH_NORMAL,
00104             36.0f,
00105             L"en-US",
00106             &nameTextFormat
00107             )
00108         );
00109
00110     DX::ThrowIfFailed(
00111         nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00112         );
00113
00114     DX::ThrowIfFailed(
00115         nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00116         );
00117
00118     DX::ThrowIfFailed(
00119         m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00120             m_caption.c_str(),
00121             static_cast<UINT32>(m_caption.size()),
00122             nameTextFormat.Get(),
00123             4096.0f,
00124             4096.0f,
00125             &m_textLayout
00126             )
00127         );
00128
00129     DWRITE_TEXT_METRICS metrics = {0};
00130     DX::ThrowIfFailed(
00131         m_textLayout->GetMetrics(&metrics)
00132         );
00133
00134     m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;
00135
00136     DX::ThrowIfFailed(
00137         m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
00138         );
00139 }
00140
00141 void SampleOverlay::CreateWindowSizeDependentResources()
00142 {
00143     if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
00144     {
00145         m_drawOverlay = false;
00146     }
00147     else
00148     {
00149         m_drawOverlay = true;
00150     }
00151 }
00152
00153 // Release all references to resources that depend on the graphics device.
00154 // This method is invoked when the device is lost and resources are no longer usable.
00155 void SampleOverlay::ReleaseDeviceDependentResources()
00156 {
00157     m_whiteBrush.Reset();
00158     m_logoBitmap.Reset();
00159 }
00160
00161 void SampleOverlay::Render()
00162 {
00163     if (m_drawOverlay)
00164     {
00165         m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());
00166
00167         m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00168         m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00169         m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
00170             m_logoBitmap.Get(),
00171             D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
00172             );
00173
00174         m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
00175             Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
00176             m_textLayout.Get(),
00177             m_whiteBrush.Get()
00178             );
00179
00180         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00181         // is lost. It will be handled during the next call to Present.
00182         HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00183         if (hr != D2DERR_RECREATE_TARGET)
00184         {
00185             DX::ThrowIfFailed(hr);
00186         }
00187
00188         m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
00189     }
00190 }
00191
00192 float SampleOverlay::GetTitleHeightInDips()
00193 {
00194     return m_logoSize.height + m_padding;
00195 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario3_ShowHideMethods.cpp Source File

  • TouchKeyboard
  • cppwinrt

Scenario3_ShowHideMethods.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_ShowHideMethods.h"
00014 #include "Scenario3_ShowHideMethods.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::ViewManagement;
00019 using namespace winrt::Windows::UI::Xaml;
00020 using namespace winrt::Windows::UI::Xaml::Input;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario3_ShowHideMethods::Scenario3_ShowHideMethods()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario3_ShowHideMethods::OnNavigatedFrom(NavigationEventArgs const&)
00031     {
00032         FadeOutResults().Stop();
00033     }
00034
00035     void Scenario3_ShowHideMethods::WordListBox_OnKeyUp(IInspectable const&, KeyRoutedEventArgs const& e)
00036     {
00037         if (e.Key() == Windows::System::VirtualKey::Enter)
00038         {
00039             hstring text = WordListBox().Text();
00040             if (!text.empty())
00041             {
00042                 InputPane::GetForCurrentView().TryHide();
00043                 ResultsTextBlock().Text(text);
00044                 FadeOutResults().Begin();
00045             }
00046         }
00047     }
00048
00049     void Scenario3_ShowHideMethods::OnFadeOutCompleted(IInspectable const&, IInspectable const&)
00050     {
00051         ResultsTextBlock().Text({});
00052         InputPane::GetForCurrentView().TryShow();
00053     }
00054
00055 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AssociationLaunching/cs/Scenario3_ReceiveFile.xaml.cs Source File

  • AssociationLaunching
  • cs

Scenario3_ReceiveFile.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Activation;
00016 using Windows.Storage;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario3_ReceiveFile : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031
00032         string Extension = "alsdkcs";
00033
00034         public Scenario3_ReceiveFile()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override async void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046             // Display the result of the file activation if we got here as a result of being activated for a file.
00047             var args = e.Parameter as FileActivatedEventArgs;
00048
00049             if (args != null)
00050             {
00051                 string output = "Files received: " + args.Files.Count + "\n";
00052                 foreach (StorageFile file in args.Files)
00053                 {
00054                     output = output + file.Name + "\n";
00055                 }
00056
00057                 if (args.NeighboringFilesQuery != null)
00058                 {
00059                     // If supported, we receive the pictures from the same folder as the file that was launched
00060                     // because we declared the picturesLibrary capability. The order of the neighboring
00061                     // files matches the sort order of the folder from which the file was launched.
00062                     IReadOnlyList<StorageFile> neighboringFiles = await args.NeighboringFilesQuery.GetFilesAsync();
00063                     if (neighboringFiles.Count > 0)
00064                     {
00065                         output = output + "\nNeighboring files: " + neighboringFiles.Count + "\n";
00066                         int i;
00067                         for (i = 0; i < Math.Min(neighboringFiles.Count, 3); i++)
00068                         {
00069                             output = output + neighboringFiles[i].Name + "\n";
00070                         }
00071                         int remaining = neighboringFiles.Count - i;
00072                         if (remaining > 0)
00073                         {
00074                             output = output + "and " + remaining + " more.";
00075                         }
00076                     }
00077                 }
00078                 rootPage.NotifyUser(output, NotifyType.StatusMessage);
00079             }
00080         }
00081
00082         private async void CreateTestFile()
00083         {
00084             StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
00085             await folder.CreateFileAsync("Test " + Extension + " file." + Extension, CreationCollisionOption.ReplaceExisting);
00086             await Windows.System.Launcher.LaunchFolderAsync(folder);
00087         }
00088
00089         private async void CreateTestFileWithNoExtension()
00090         {
00091             StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
00092             await folder.CreateFileAsync("Test file with no extension", CreationCollisionOption.ReplaceExisting);
00093             await Windows.System.Launcher.LaunchFolderAsync(folder);
00094         }
00095
00096         private async void RemoveTestFiles()
00097         {
00098             StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);
00099             try
00100             {
00101                 StorageFile file = await folder.GetFileAsync("Test " + Extension + " file." + Extension);
00102                 await file.DeleteAsync();
00103             }
00104             catch (Exception)
00105             {
00106                 // File I/O errors are reported as exceptions.
00107                 // Ignore errors here.
00108             }
00109
00110             try
00111             {
00112                 StorageFile file = await folder.GetFileAsync("Test file with no extension");
00113                 await file.DeleteAsync();
00114             }
00115             catch (Exception)
00116             {
00117                 // File I/O errors are reported as exceptions.
00118                 // Ignore errors here.
00119             }
00120         }
00121     }
00122 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/DetailPage.xaml.cs Source File

  • XamlMasterDetail
  • cs

DetailPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using MasterDetailApp.Data;
00002 using MasterDetailApp.ViewModels;
00003 using System;
00004 using System.Collections.Generic;
00005 using System.IO;
00006 using System.Linq;
00007 using System.Runtime.InteropServices.WindowsRuntime;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Core;
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Controls.Primitives;
00014 using Windows.UI.Xaml.Data;
00015 using Windows.UI.Xaml.Input;
00016 using Windows.UI.Xaml.Media;
00017 using Windows.UI.Xaml.Media.Animation;
00018 using Windows.UI.Xaml.Navigation;
00019
00020
00021 namespace MasterDetailApp
00022 {
00023
00024     public sealed partial class DetailPage : Page
00025     {
00026         private static DependencyProperty s_itemProperty
00027             = DependencyProperty.Register("Item", typeof(ItemViewModel), typeof(DetailPage), new PropertyMetadata(null));
00028
00029         public static DependencyProperty ItemProperty
00030         {
00031             get { return s_itemProperty; }
00032         }
00033
00034         public ItemViewModel Item
00035         {
00036             get { return (ItemViewModel)GetValue(s_itemProperty); }
00037             set { SetValue(s_itemProperty, value); }
00038         }
00039
00040         public DetailPage()
00041         {
00042             this.InitializeComponent();
00043         }
00044
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             base.OnNavigatedTo(e);
00048
00049             // Parameter is item ID
00050             Item = ItemViewModel.FromItem(ItemsDataSource.GetItemById((int)e.Parameter));
00051
00052             ReplaceLastBackStackEntryParameter(e.Parameter);
00053
00054             // Register for hardware and software back request from the system
00055             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00056             systemNavigationManager.BackRequested += DetailPage_BackRequested;
00057             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
00058         }
00059
00060         protected override void OnNavigatedFrom(NavigationEventArgs e)
00061         {
00062             base.OnNavigatedFrom(e);
00063
00064             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00065             systemNavigationManager.BackRequested -= DetailPage_BackRequested;
00066             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
00067         }
00068
00069         private void OnBackRequested()
00070         {
00071             // Page above us will be our master view.
00072             // Make sure we are using the "drill out" animation in this transition.
00073             ReplaceLastBackStackEntryParameter(null);
00074             Frame.GoBack(new DrillInNavigationTransitionInfo());
00075         }
00076
00077         // Doctor the navigation parameter for the master page so it
00078         // will show the correct item in the side-by-side view.
00079         void ReplaceLastBackStackEntryParameter(object parameter)
00080         {
00081             var backStack = Frame.BackStack;
00082             var backStackCount = backStack.Count;
00083
00084             if (backStackCount > 0)
00085             {
00086                 var entry = backStack[backStackCount - 1];
00087                 backStack[backStackCount - 1] = new PageStackEntry(
00088                     entry.SourcePageType, parameter, entry.NavigationTransitionInfo);
00089             }
00090         }
00091
00092         void NavigateBackForWideState(bool useTransition)
00093         {
00094             // Evict this page from the cache as we may not need it again.
00095             NavigationCacheMode = NavigationCacheMode.Disabled;
00096
00097             if (useTransition)
00098             {
00099                 Frame.GoBack(new EntranceNavigationTransitionInfo());
00100             }
00101             else
00102             {
00103                 Frame.GoBack(new SuppressNavigationTransitionInfo());
00104             }
00105         }
00106
00107         private bool ShouldGoToWideState()
00108         {
00109             return Window.Current.Bounds.Width >= 720;
00110         }
00111
00112         private void PageRoot_Loaded(object sender, RoutedEventArgs e)
00113         {
00114             if (ShouldGoToWideState())
00115             {
00116                 // We shouldn't see this page since we are in "wide master-detail" mode.
00117                 // Play a transition as we are navigating from a separate page.
00118                 NavigateBackForWideState(useTransition:true);
00119             }
00120             else
00121             {
00122                 // Realize the main page content.
00123                 FindName("RootPanel");
00124             }
00125
00126             Window.Current.SizeChanged += Window_SizeChanged;
00127         }
00128
00129         private void PageRoot_Unloaded(object sender, RoutedEventArgs e)
00130         {
00131             Window.Current.SizeChanged -= Window_SizeChanged;
00132         }
00133
00134         private void Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
00135         {
00136             if (ShouldGoToWideState())
00137             {
00138                 // Make sure we are no longer listening to window change events.
00139                 Window.Current.SizeChanged -= Window_SizeChanged;
00140
00141                 // We shouldn't see this page since we are in "wide master-detail" mode.
00142                 NavigateBackForWideState(useTransition:false);
00143             }
00144         }
00145
00146         private void DetailPage_BackRequested(object sender, BackRequestedEventArgs e)
00147         {
00148             // Mark event as handled so we don't get bounced out of the app.
00149             e.Handled = true;
00150
00151             OnBackRequested();
00152         }
00153     }
00154 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/OnboardingEnumTypes.cs Source File

  • AllJoyn
  • ConsumerExperiences
  • cs

OnboardingEnumTypes.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml.Data;
00014
00015 namespace AllJoynConsumerExperiences
00016 {
00017     // All the Enums below as per the Onboarding interface spec
00018     // For more info: https://allseenalliance.org/developers/learn/base-services/onboarding/interface
00019
00020     enum OnboardingAuthenticationType
00021     {
00022         Wpa2Auto = -3,
00023         WpaAuto = -2,
00024         Any = -1,
00025         Open = 0,
00026         Wep = 1,
00027         WpaTkip = 2,
00028         WpaCcmp = 3,
00029         Wpa2Tkip = 4,
00030         Wpa2Ccmp = 5,
00031         Wps = 6,
00032     }
00033
00034     enum ConfigureWiFiResultStatus
00035     {
00036         NotConcurrent = 1,
00037         Concurrent = 2,
00038     }
00039
00040     enum ConnectionResultCode
00041     {
00042         Validated = 0,
00043         Unreachable,
00044         UnsupportedProtocol,
00045         Unauthorized,
00046         ErrorMessage,
00047     }
00048
00049     public class AuthTypeToStringConverter : IValueConverter
00050     {
00051         public object Convert(object value, Type targetType, object parameter, string language)
00052         {
00053             return value.ToString();
00054         }
00055
00056         public object ConvertBack(object value, Type targetType, object parameter, string language)
00057         {
00058             OnboardingAuthenticationType returnValue;
00059
00060             if (Enum.TryParse(value.ToString(), true, out returnValue))
00061             {
00062                 return returnValue;
00063             }
00064             else
00065             {
00066                 return OnboardingAuthenticationType.Any;
00067             }
00068         }
00069     }
00070 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/SampleConfiguration.cpp Source File

  • Compass
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" },
00022     { "Calibration", "SDKTemplate.Scenario3_Calibration" }
00023 };
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/MFSampleGenerator.h Source File

  • WindowsAudioSession
  • cppwinrt

MFSampleGenerator.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     struct MFSampleGenerator : implements<MFSampleGenerator, IMFSourceReaderCallback>
00018     {
00019         enum ReaderState
00020         {
00021             Stopped,
00022             PreRoll,
00023             Playing,
00024             EndOfStream
00025         };
00026
00027         MFSampleGenerator() = default;
00028         ~MFSampleGenerator() = default;
00029
00030         // IMFSourceReaderCallback
00031         STDMETHODIMP_(HRESULT) OnEvent(_In_ DWORD streamIndex, _In_ IMFMediaEvent* event);
00032         STDMETHODIMP_(HRESULT) OnFlush(_In_ DWORD streamIndex);
00033         STDMETHODIMP_(HRESULT) OnReadSample(HRESULT error, DWORD streamIndex, DWORD streamFlags, LONGLONG timestamp, IMFSample* sample);
00034
00035         // MFSampleGenerator
00036         void StartSource();
00037         void StopSource();
00038
00039         void Initialize(Windows::Storage::Streams::IRandomAccessStream const& stream, UINT32 FramesPerPeriod, WAVEFORMATEX* wfx);
00040         void Shutdown();
00041         bool FillSampleBuffer(array_view<uint8_t> buffer, uint32_t* cbWritten);
00042
00043         bool IsEOF()
00044         {
00045             return m_sampleQueue.empty() && m_readerState == ReaderState::EndOfStream;
00046         }
00047
00048     private:
00049         static com_ptr<IMFMediaType> ConfigureStreams(com_ptr<IMFSourceReader> const& reader, WAVEFORMATEX* wfx);
00050         static com_ptr<IMFMediaType> CreateAudioType(WAVEFORMATEX* wfx);
00051         void AddSamplesToQueue(IMFSample* MFSample);
00052         bool IsPreRollFilled();
00053
00054     private:
00055         uint32_t m_bytesPerPeriod;
00056         uint32_t m_bytesPerSecond = 0;
00057         bool m_isInitialized = false;
00058
00059         com_ptr<IMFSourceReader> m_sourceReader;
00060         com_ptr<IMFMediaType> m_audioMediaType;
00061         ReaderState m_readerState = ReaderState::Stopped;
00062
00063         std::forward_list<RenderBuffer> m_sampleQueue;
00064         std::forward_list<RenderBuffer>::iterator m_sampleQueueTail = m_sampleQueue.before_begin();
00065     };
00066 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/Scenario1_Enable.xaml.cpp Source File

  • DisablingScreenCapture
  • cpp

Scenario1_Enable.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Enable.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 Scenario1_Enable::Scenario1_Enable()
00018 {
00019     this->InitializeComponent();
00020 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LiveSourceBufferManager Member List

This is the complete list of members for LiveSourceBufferManager, including all inherited members.
activeDownload | SourceBufferManager | [protected]
Appending | SourceBufferManager |
DesiredLiveOffset | LiveSourceBufferManager |
determinedStartingSegmentIndex | LiveSourceBufferManager | [private]
DetermineStartingSegmentIndex() | LiveSourceBufferManager | [inline, private]
GetNewSegmentIndexFromNewStream() | LiveSourceBufferManager | [inline, private]
GetNextSegment() | LiveSourceBufferManager | [inline, private]
GoToLiveEdge() | LiveSourceBufferManager | [inline, private]
HandleManifestReload() | LiveSourceBufferManager | [inline, private]
hnsDesiredLiveOffset | LiveSourceBufferManager | [private]
internalAppending | SourceBufferManager | [protected]
IsAudio | SourceBufferManager |
IsEndOfStream | SourceBufferManager |
isEndOfStream | SourceBufferManager | [protected]
isFirstSegment | SourceBufferManager | [protected]
isInitialized | SourceBufferManager | [protected]
IsVideo | SourceBufferManager |
IterativeSearch(List< MediaSegment > segmentList, int minIndex, int maxIndex, ulong increment, bool isForwardSearch) | LiveSourceBufferManager | [inline, private]
LiveSourceBufferManager(string mimeType, MediaStream stream) | LiveSourceBufferManager | [inline, private]
Manifest | LiveSourceBufferManager | [private]
manifest | LiveSourceBufferManager | [private]
MaxBuffering | SourceBufferManager | [protected]
MaxGap | SourceBufferManager | [protected]
mimeType | SourceBufferManager | [protected]
mse | SourceBufferManager | [protected]
MseSourceBuffer | SourceBufferManager |
nextSegmentIndex | LiveSourceBufferManager | [private]
NextSegmentIndex | LiveSourceBufferManager | [private]
NextSegmentNumber | LiveSourceBufferManager | [private]
nextSegmentNumber | LiveSourceBufferManager | [private]
ReloadManifest() | LiveSourceBufferManager | [inline, private]
sb | SourceBufferManager | [protected]
SearchForSegment() | LiveSourceBufferManager | [inline, private]
segmentCursor | SourceBufferManager | [protected]
SendMediaSegment(TimeSpan now) | LiveSourceBufferManager | [inline, protected, virtual]
stream | SourceBufferManager | [protected]
totalSegmentCount | LiveSourceBufferManager | [private]
TryDownloadBuffer(Uri url) | LiveSourceBufferManager | [inline, private]
UpdateData(TimeSpan now) | LiveSourceBufferManager | [inline, private, virtual]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/SampleConfiguration.cpp Source File

  • FilePicker
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Pick a single photo",   "SDKTemplate.Scenario1_SingleFile" },
00012     { "Pick multiple files",   "SDKTemplate.Scenario2_MultiFile" },
00013     { "Pick a folder",         "SDKTemplate.Scenario3_SingleFolder" },
00014     { "Save a file",           "SDKTemplate.Scenario4_SaveFile" },
00015     { "Trigger CFU",           "SDKTemplate.Scenario5_TriggerCFU" }
00016 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DetailPage Member List

This is the complete list of members for DetailPage, including all inherited members.
DetailPage() | DetailPage |
DetailPage_BackRequested(Windows::Foundation::IInspectable const &sender, Windows::UI::Core::BackRequestedEventArgs const &args) | DetailPage |
Item() | DetailPage | [inline]
Item(ViewModels::ItemViewModel value) | DetailPage | [inline]
ItemProperty() | DetailPage | [inline, static]
NavigateBackForWideState(bool useTransition) | DetailPage | [private]
OnBackRequested() | DetailPage | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | DetailPage |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | DetailPage |
PageRoot_Loaded(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | DetailPage |
PageRoot_Unloaded(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | DetailPage |
RegisterDependencyProperties() | DetailPage | [static]
ReplaceLastBackStackEntryParameter(Windows::Foundation::IInspectable const &parameter) | DetailPage | [private]
s_itemProperty | DetailPage | [private, static]
ShouldGoToWideState() | DetailPage | [private]
Window_SizeChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Core::WindowSizeChangedEventArgs const &e) | DetailPage |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SmartCardListItem Member List

This is the complete list of members for SmartCardListItem, including all inherited members.
CardName | SmartCardListItem
ReaderName | SmartCardListItem
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SceneObject Member List

This is the complete list of members for SceneObject, including all inherited members.
c_cubeIndices | SceneObject | [private]
c_cubeVertices | SceneObject | [private]
CreateDeviceDependentResources() | SceneObject |
EnableWireframe() | SceneObject | [inline]
m_canRenderThisFrame | SceneObject | [private]
m_coordinateSystem | SceneObject | [private]
m_defaultRasterizerState | SceneObject | [private]
m_deviceResources | SceneObject | [private]
m_geometryShader | SceneObject | [private]
m_indexBuffer | SceneObject | [private]
m_indexCount | SceneObject | [private]
m_indices | SceneObject | [private]
m_inputLayout | SceneObject | [private]
m_loadingComplete | SceneObject | [private]
m_modelConstantBuffer | SceneObject | [private]
m_modelConstantBufferData | SceneObject | [private]
m_pixelShader | SceneObject | [private]
m_useWireframe | SceneObject | [private]
m_usingVprtShaders | SceneObject | [private]
m_vertexBuffer | SceneObject | [private]
m_vertexShader | SceneObject | [private]
m_vertices | SceneObject | [private]
m_wireframeRasterizerState | SceneObject | [private]
ReleaseDeviceDependentResources() | SceneObject |
Render() | SceneObject |
SceneObject(const std::shared_ptr< DX::DeviceResources > &deviceResources, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | SceneObject |
SceneObject(const std::shared_ptr< DX::DeviceResources > &deviceResources, std::vector< DirectX::XMFLOAT3 > const &vertices, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | SceneObject |
SceneObject(const std::shared_ptr< DX::DeviceResources > &deviceResources, std::vector< DirectX::XMFLOAT3 > const &vertices, std::vector< unsigned short > const &indices, DirectX::XMFLOAT3 const &color, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | SceneObject |
Update(const DX::StepTimer &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^viewCoords) | SceneObject |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_SynthesizeSSML Member List

This is the complete list of members for Scenario_SynthesizeSSML, including all inherited members.
FillTextBox(SpeechCue cue) | Scenario_SynthesizeSSML | [inline, private]
InitializeListboxVoiceChooser() | Scenario_SynthesizeSSML | [inline, private]
ListboxVoiceChooser_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario_SynthesizeSSML | [inline, private]
media_MediaEnded(MediaPlayer sender, object e) | Scenario_SynthesizeSSML | [inline, private]
metadata_MarkCueEntered(TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args) | Scenario_SynthesizeSSML | [inline, private]
RegisterForMarkEvents(MediaPlaybackItem mediaPlaybackItem) | Scenario_SynthesizeSSML | [inline, private]
RegisterMetadataHandlerForMarks(MediaPlaybackItem mediaPlaybackItem, int index) | Scenario_SynthesizeSSML | [inline, private]
Scenario_SynthesizeSSML() | Scenario_SynthesizeSSML | [inline]
Speak_Click(object sender, RoutedEventArgs e) | Scenario_SynthesizeSSML | [inline, private]
speechContext | Scenario_SynthesizeSSML | [private]
speechResourceMap | Scenario_SynthesizeSSML | [private]
synthesizer | Scenario_SynthesizeSSML | [private]
UpdateSSMLText() | Scenario_SynthesizeSSML | [inline, private]
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/Scenario1_OvenClient.xaml.cpp Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario1_OvenClient.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace Microsoft::SDKSamples::Kitchen;
00013 using namespace SDKTemplate::WRLInProcessWinRTComponent;
00014 using namespace Windows::Foundation;
00015 using namespace Windows::UI::Core;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018
00019 OvenClient::OvenClient()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void OvenClient::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00025 {
00026     Dimensions dimensions;
00027     dimensions.Width = 2;
00028     dimensions.Height = 2;
00029     dimensions.Depth = 2;
00030
00031     // Component Creation
00032     if (!_myOven)
00033     {
00034         _myOven = ref new Oven(dimensions);
00035     }
00036
00037     // Getters and setters are accessed using property syntax
00038     OvenClientOutput->Text += "Oven volume is: " + _myOven->Volume.ToString() + "\n";
00039
00040     // Registering event listeners
00041     _myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler1);
00042     _myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler2);
00043
00044     // C++ projections expose the tokens used to register and remove event handlers
00045     auto eventRegistrationToken = (_myOven->BreadBaked += ref new TypedEventHandler<Oven^, BreadBakedEventArgs^>(this, &OvenClient::BreadCompletedHandler3));
00046     _myOven->BreadBaked -= eventRegistrationToken;
00047
00048     // Bake a loaf of bread. This will trigger the BreadBaked event.
00049     _myOven->BakeBread("Sourdough");
00050
00051     // Trigger the event again with a different preheat time
00052     _myOven->ConfigurePreheatTemperature(OvenTemperature::High);
00053     _myOven->BakeBread("Wheat");
00054 }
00055
00056 void OvenClient::BreadCompletedHandler1(Oven^ oven, BreadBakedEventArgs^ args)
00057 {
00058     // Event comes in on a background thread, need to use dispatcher to get to the UI thread.
00059     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00060         ref new DispatchedHandler([this, oven, args]() -> void
00061     {
00062         OvenClientOutput->Text += "Event Handler 1: Invoked\n";
00063         OvenClientOutput->Text += "Event Handler 1: Oven volume is: " + oven->Volume.ToString() + "\n";
00064         OvenClientOutput->Text += "Event Handler 1: Bread flavor is: " + args->Bread->Flavor + "\n";
00065     }));
00066 }
00067
00068 void OvenClient::BreadCompletedHandler2(Oven^ oven, BreadBakedEventArgs^ args)
00069 {
00070     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00071         ref new DispatchedHandler([this, oven, args]() -> void
00072     {
00073         OvenClientOutput->Text += "Event Handler 2: Invoked\n";
00074     }));
00075 }
00076
00077 void OvenClient::BreadCompletedHandler3(Oven^ oven, BreadBakedEventArgs^ args)
00078 {
00079     // Event handler 3 was removed and will not be invoked
00080     OvenClientOutput->Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00081         ref new DispatchedHandler([this, oven, args]() -> void
00082     {
00083         OvenClientOutput->Text += "Event Handler 3: Invoked\n";
00084     }));
00085 }
00086
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ChangeEvents Member List

This is the complete list of members for Scenario3_ChangeEvents, including all inherited members.
_activitySensor | Scenario3_ChangeEvents | [private]
_deviceAccessInformation | Scenario3_ChangeEvents | [private]
AccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs e) | Scenario3_ChangeEvents | [inline, private]
ActivitySensorClassId | Scenario3_ChangeEvents | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_ChangeEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario3_ChangeEvents | [inline, protected]
ReadingChanged(object sender, ActivitySensorReadingChangedEventArgs e) | Scenario3_ChangeEvents | [inline, private]
rootPage | Scenario3_ChangeEvents | [private]
Scenario3_ChangeEvents() | Scenario3_ChangeEvents | [inline]
ScenarioDisableReadingChanged(object sender, RoutedEventArgs e) | Scenario3_ChangeEvents | [inline, private]
ScenarioEnableReadingChanged(object sender, RoutedEventArgs e) | Scenario3_ChangeEvents | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdaptiveStreaming/cs/Scenario3_RequestModification.xaml.cs Source File

  • AdaptiveStreaming
  • cs

Scenario3_RequestModification.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Helpers;
00013 using SDKTemplate.Logging;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.Linq;
00017 using System.Threading;
00018 using System.Threading.Tasks;
00019 using Windows.Foundation;
00020 using Windows.Media.Core;
00021 using Windows.Media.Playback;
00022 using Windows.Media.Protection;
00023 using Windows.Media.Streaming.Adaptive;
00024 using Windows.UI.Core;
00025 using Windows.UI.Xaml;
00026 using Windows.UI.Xaml.Controls;
00027 using Windows.UI.Xaml.Navigation;
00028 using Windows.Web.Http;
00029 using Windows.Web.Http.Filters;
00030 using Windows.Web.Http.Headers;
00031
00032 namespace SDKTemplate
00033 {
00034     /// See the README.md for discussion of this scenario.
00035     ///
00036     /// Note: We register but do not unregister event handlers in this scenario, see the EventHandler
00037     ///       scenario for patterns that can be used to clean up.
00038     public sealed partial class Scenario3_RequestModification : Page
00039     {
00040
00041         private AzureKeyAcquisitionMethod tokenMethod;
00042         private CancellationTokenSource ctsForAppHttpClientForKeys = new CancellationTokenSource();
00043
00044         public Scenario3_RequestModification()
00045         {
00046             this.InitializeComponent();
00047         }
00048
00049         protected override void OnNavigatedFrom(NavigationEventArgs e)
00050         {
00051             // Cancel any HTTP requests the app was making:
00052             ctsForAppHttpClientForKeys.Cancel();
00053
00054             // Release handles on various media objects to ensure a quick clean-up
00055             ContentSelectorControl.MediaPlaybackItem = null;
00056             var mediaPlayer = mediaPlayerElement.MediaPlayer;
00057             if (mediaPlayer != null)
00058             {
00059                 mediaPlayerLogger?.Dispose();
00060                 mediaPlayerLogger = null;
00061
00062                 UnregisterHandlers(mediaPlayer);
00063
00064                 mediaPlayerElement.SetMediaPlayer(null);
00065                 mediaPlayer.Dispose();
00066             }
00067
00068             // We clean up HDCP explicitly. Otherwise, the OutputProtectionManager
00069             // will continue to impose our policy until it is finalized by the
00070             // garbage collector.
00071             hdcpSession?.Dispose();
00072             hdcpSession = null;
00073         }
00074
00075         private void UnregisterHandlers(MediaPlayer mediaPlayer)
00076         {
00077             AdaptiveMediaSource adaptiveMediaSource = null;
00078             MediaPlaybackItem mpItem = mediaPlayer.Source as MediaPlaybackItem;
00079             if (mpItem != null)
00080             {
00081                 adaptiveMediaSource = mpItem.Source.AdaptiveMediaSource;
00082             }
00083             MediaSource source = mediaPlayer.Source as MediaSource;
00084             if (source != null)
00085             {
00086                 adaptiveMediaSource = source.AdaptiveMediaSource;
00087             }
00088
00089             mediaPlaybackItemLogger?.Dispose();
00090             mediaPlaybackItemLogger = null;
00091
00092             mediaSourceLogger?.Dispose();
00093             mediaSourceLogger = null;
00094
00095             adaptiveMediaSourceLogger?.Dispose();
00096             adaptiveMediaSourceLogger = null;
00097
00098             UnregisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00099         }
00100
00101         AddAuthorizationHeaderFilter httpClientFilter;
00102         HdcpSession hdcpSession;
00103         AdaptiveMediaSource adaptiveMediaSource;
00104
00105         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00106         {
00107             // We enforce HDCP in this scenario that uses encryption but not PlayReady.
00108             hdcpSession = new HdcpSession();
00109
00110             // The protection level may change if screens are plugged or unplugged from the system or
00111             // if explicitly set in the radio buttons in the UI.
00112             hdcpSession.ProtectionChanged += (HdcpSession session, object args) =>
00113             {
00114                 // After a change, impose a maximum bitrate based on the actual protection level.
00115                 HdcpProtection? protection = session.GetEffectiveProtection();
00116                 SetMaxBitrateForProtectionLevel(protection, adaptiveMediaSource);
00117             };
00118
00119             // Explicitly create the instance of MediaPlayer if you need to register for its events
00120             // (like MediaOpened / MediaFailed) prior to setting an IMediaPlaybackSource.
00121             var mediaPlayer = new MediaPlayer();
00122
00123             // We use a helper class that logs all the events for the MediaPlayer:
00124             mediaPlayerLogger = new MediaPlayerLogger(LoggerControl, mediaPlayer);
00125
00126             mediaPlayerElement.SetMediaPlayer(mediaPlayer);
00127
00128             ContentSelectorControl.Initialize(
00129                 mediaPlayer,
00130                 MainPage.ContentManagementSystemStub.Where(m =>!m.PlayReady),
00131                 null,
00132                 LoggerControl,
00133                 LoadSourceFromUriAsync);
00134
00135             ContentSelectorControl.HideLoadUri(); // Avoid free text URIs for this scenario.
00136
00137             // Initialize tokenMethod based on the default selected radio button.
00138             var defaultRadioButton = AzureAuthorizationMethodPanel.Children.OfType<RadioButton>().First(button => button.IsChecked.Value);
00139             Enum.TryParse((string)defaultRadioButton.Tag, out tokenMethod);
00140
00141             Log("Content Id 13 and 14 require that you choose an authorization method.");
00142             ContentSelectorControl.SetSelectedModel(MainPage.ContentManagementSystemStub.Where(m => m.Id == 13).FirstOrDefault());
00143         }
00144
00145
00146         #region Content Loading
00147
00148         private async Task<MediaPlaybackItem> LoadSourceFromUriAsync(Uri uri, HttpClient httpClient = null)
00149         {
00150             UnregisterHandlers(mediaPlayerElement.MediaPlayer);
00151
00152             if (tokenMethod == AzureKeyAcquisitionMethod.AuthorizationHeader)
00153             {
00154                 if (ContentSelectorControl.SelectedModel == null)
00155                 {
00156                     return null;
00157                 }
00158                 // Use an IHttpFilter to identify key request URIs and insert an Authorization header with the Bearer token.
00159                 var baseProtocolFilter = new HttpBaseProtocolFilter();
00160                 baseProtocolFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;  // Always set WriteBehavior = NoCache
00161                 httpClientFilter = new AddAuthorizationHeaderFilter(baseProtocolFilter);
00162                 httpClientFilter.AuthorizationHeader = new HttpCredentialsHeaderValue("Bearer", ContentSelectorControl.SelectedModel.AesToken);
00163                 httpClient = new HttpClient(httpClientFilter);
00164
00165                 // Here is where you can add any required custom CDN headers.
00166                 httpClient.DefaultRequestHeaders.Append("X-HeaderKey", "HeaderValue");
00167                 // NOTE: It is not recommended to set Authorization headers needed for key request on the
00168                 // default headers of the HttpClient, as these will also be used on non-HTTPS calls
00169                 // for media segments and manifests -- and thus will be easily visible.
00170             }
00171
00172             AdaptiveMediaSourceCreationResult result = null;
00173             if (httpClient != null)
00174             {
00175                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri, httpClient);
00176             }
00177             else
00178             {
00179                 result = await AdaptiveMediaSource.CreateFromUriAsync(uri);
00180             }
00181
00182             MediaSource source;
00183             if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
00184             {
00185                 adaptiveMediaSource = result.MediaSource;
00186
00187                 // We use a helper class that logs all the events for the AdaptiveMediaSource:
00188                 adaptiveMediaSourceLogger = new AdaptiveMediaSourceLogger(LoggerControl, adaptiveMediaSource);
00189
00190                 // In addition to logging, we use the callbacks to update some UI elements in this scenario:
00191                 RegisterForAdaptiveMediaSourceEvents(adaptiveMediaSource);
00192
00193                 // At this point, we have read the manifest of the media source, and all bitrates are known.
00194                 // Now that we have bitrates, attempt to cap them based on HdcpProtection.
00195                 HdcpProtection? protection = hdcpSession.GetEffectiveProtection();
00196                 SetMaxBitrateForProtectionLevel(protection, adaptiveMediaSource);
00197
00198                 source = MediaSource.CreateFromAdaptiveMediaSource(adaptiveMediaSource);
00199
00200             }
00201             else
00202             {
00203                 Log($"Error creating the AdaptiveMediaSource. Status: {result.Status}, ExtendedError.Message: {result.ExtendedError.Message}, ExtendedError.HResult: {result.ExtendedError.HResult.ToString("X8")}");
00204                 return null;
00205             }
00206
00207             // We use a helper class that logs all the events for the MediaSource:
00208             mediaSourceLogger = new MediaSourceLogger(LoggerControl, source);
00209
00210             // Save the original Uri.
00211             source.CustomProperties["uri"] = uri.ToString();
00212
00213             // You're likely to put a content tracking id into the CustomProperties.
00214             source.CustomProperties["contentId"] = Guid.NewGuid().ToString();
00215
00216             var mpItem = new MediaPlaybackItem(source);
00217
00218             // We use a helper class that logs all the events for the MediaPlaybackItem:
00219             mediaPlaybackItemLogger = new MediaPlaybackItemLogger(LoggerControl, mpItem);
00220
00221             HideDescriptionOnSmallScreen();
00222
00223             return mpItem;
00224         }
00225
00226         private async void HideDescriptionOnSmallScreen()
00227         {
00228             // On small screens, hide the description text to make room for the video.
00229             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00230             {
00231                 DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;
00232             });
00233         }
00234         #endregion
00235
00236
00237         #region AdaptiveMediaSource Event Handlers
00238
00239         private void RegisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00240         {
00241             adaptiveMediaSource.DownloadRequested += DownloadRequested;
00242             adaptiveMediaSource.DownloadFailed += DownloadFailed;
00243         }
00244
00245         private void UnregisterForAdaptiveMediaSourceEvents(AdaptiveMediaSource adaptiveMediaSource)
00246         {
00247             if (adaptiveMediaSource != null)
00248             {
00249                 adaptiveMediaSource.DownloadRequested -= DownloadRequested;
00250                 adaptiveMediaSource.DownloadFailed -= DownloadFailed;
00251             }
00252         }
00253
00254         private async void DownloadRequested(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadRequestedEventArgs args)
00255         {
00256             if (args.ResourceType == AdaptiveMediaSourceResourceType.Key)
00257             {
00258                 switch (tokenMethod)
00259                 {
00260                     case AzureKeyAcquisitionMethod.None:
00261                         break;
00262                     case AzureKeyAcquisitionMethod.AuthorizationHeader:
00263                         // By updating the IHttpFilter KeyHost property here, we ensure it's up to date
00264                         // before the network request is made.  It is the IHttpFilter that will insert
00265                         // the Authorization header.
00266                         if (httpClientFilter != null)
00267                         {
00268                             httpClientFilter.KeyHost = args.ResourceUri.Host;
00269                         }
00270                         break;
00271                     case AzureKeyAcquisitionMethod.UrlQueryParameter:
00272                         ModifyKeyRequestUri(args);
00273                         break;
00274                     case AzureKeyAcquisitionMethod.ApplicationDownloaded:
00275                         await AppDownloadedKeyRequest(args);
00276                         break;
00277                     default:
00278                         break;
00279                 }
00280             }
00281         }
00282
00283         private void ModifyKeyRequestUri(AdaptiveMediaSourceDownloadRequestedEventArgs args)
00284         {
00285             if (ContentSelectorControl.SelectedModel == null)
00286             {
00287                 return;
00288             }
00289
00290             // This pattern can be used to modify Uris, for example:
00291             //   To a redirect traffic to a secondary endpoint
00292             //   To change an segment request into a byte-range Uri into another resource
00293
00294             // Add the Bearer token to the Uri and modify the args.Result.ResourceUri
00295             string armoredAuthToken = System.Net.WebUtility.UrlEncode("Bearer=" + ContentSelectorControl.SelectedModel.AesToken);
00296             string uriWithTokenParameter = $"{args.ResourceUri.AbsoluteUri}&token={armoredAuthToken}";
00297             args.Result.ResourceUri = new Uri(uriWithTokenParameter);
00298         }
00299
00300         private async Task AppDownloadedKeyRequest(AdaptiveMediaSourceDownloadRequestedEventArgs args)
00301         {
00302             if (ContentSelectorControl.SelectedModel == null)
00303             {
00304                 return;
00305             }
00306
00307             // For AzureKeyAcquisitionMethod.ApplicationDownloaded we do the following:
00308             //   Call .GetDeferral() to allow asynchronous work to be performed
00309             //   Get the requested network resource using app code
00310             //   Set .Result.InputStream or .Result.Buffer with the response data
00311             //   Complete the deferral to indicate that we are done.
00312             // With this pattern, the app has complete control over any downloaded content.
00313
00314             // Obtain a deferral so we can perform asynchronous operations.
00315             var deferral = args.GetDeferral();
00316             try
00317             {
00318                 var appHttpClientForKeys = new HttpClient();
00319                 appHttpClientForKeys.DefaultRequestHeaders.Authorization = new HttpCredentialsHeaderValue("Bearer", ContentSelectorControl.SelectedModel.AesToken);
00320
00321                 HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, args.ResourceUri);
00322
00323                 HttpResponseMessage response = await appHttpClientForKeys.SendRequestAsync(
00324                     request, HttpCompletionOption.ResponseHeadersRead).AsTask(ctsForAppHttpClientForKeys.Token);
00325
00326                 if (response.IsSuccessStatusCode)
00327                 {
00328                     args.Result.InputStream = await response.Content.ReadAsInputStreamAsync();
00329                     // Alternatively, we could use:
00330                     // args.Result.Buffer = await response.Content.ReadAsBufferAsync();
00331                 }
00332                 else
00333                 {
00334                     // The app code failed. Report this by setting the args.Result.ExtendedStatus.
00335                     // This will ensure that the AdaptiveMediaSource does not attempt to download the resource
00336                     // itself, and instead treats the download as having failed.
00337                     switch (response.StatusCode)
00338                     {
00339                         case HttpStatusCode.Unauthorized:
00340                             // HTTP_E_STATUS_DENIED
00341                             args.Result.ExtendedStatus = 0x80190191;
00342                             break;
00343                         case HttpStatusCode.NotFound:
00344                             // HTTP_E_STATUS_NOT_FOUND
00345                             args.Result.ExtendedStatus = 0x80190194;
00346                             break;
00347                         default:
00348                             // HTTP_E_STATUS_UNEXPECTED
00349                             args.Result.ExtendedStatus = 0x80190001;
00350                             break;
00351                     }
00352                     Log($"Key Download Failed: {response.StatusCode} {args.ResourceUri}");
00353                 }
00354             }
00355             catch (TaskCanceledException)
00356             {
00357                 Log($"Request canceled: {args.ResourceUri}");
00358
00359             }
00360             catch (Exception e)
00361             {
00362                 Log($"Key Download Failed: {e.Message} {args.ResourceUri}");
00363             }
00364             finally
00365             {
00366                 // Complete the deferral when done.
00367                 deferral.Complete();
00368             }
00369         }
00370
00371         private void DownloadFailed(AdaptiveMediaSource sender, AdaptiveMediaSourceDownloadFailedEventArgs args)
00372         {
00373             Log($"DownloadFailed: {args.HttpResponseMessage}, {args.ResourceType}, {args.ResourceUri}");
00374         }
00375         #endregion
00376
00377
00378         #region AzureKeyAcquisitionMethod
00379
00380         enum AzureKeyAcquisitionMethod
00381         {
00382             None,
00383             AuthorizationHeader,
00384             UrlQueryParameter,
00385             ApplicationDownloaded,
00386         }
00387
00388         private void AzureMethodSelected_Click(object sender, RoutedEventArgs e)
00389         {
00390             AzureKeyAcquisitionMethod selectedMethod;
00391             string selected = (sender as RadioButton).Tag.ToString();
00392             if (Enum.TryParse(selected, out selectedMethod))
00393             {
00394                 tokenMethod = selectedMethod;
00395             }
00396         }
00397         #endregion
00398
00399
00400         #region HdcpDesiredMinimumProtection
00401
00402         /// <summary>
00403         /// Handles the radio button selections from the UI and imposes that minimum desired protection
00404         /// </summary>
00405         private async void HdcpDesiredMinimumProtection_Click(object sender, RoutedEventArgs e)
00406         {
00407             HdcpProtection desiredMinimumProtection = HdcpProtection.Off;
00408             string selected = (sender as RadioButton).Tag.ToString();
00409             if (Enum.TryParse(selected, out desiredMinimumProtection))
00410             {
00411                 var result = await hdcpSession.SetDesiredMinProtectionAsync(desiredMinimumProtection);
00412                 HdcpProtection? actualProtection = hdcpSession.GetEffectiveProtection();
00413                 if (result != HdcpSetProtectionResult.Success)
00414                 {
00415                     Log($"ERROR: Unable to set HdcpProtection.{desiredMinimumProtection}, Error: {result}, Actual HDCP: {actualProtection}");
00416                 }
00417                 else
00418                 {
00419                     Log($"HDCP Requested Minimum: {desiredMinimumProtection}, Actual: {actualProtection}");
00420                 }
00421             }
00422         }
00423
00424         /// <summary>
00425         /// Enforces a fictitious content publisher's rules for bandwidth maximums based on HDCP protection levels.
00426         /// </summary>
00427         /// <param name="protection">Protection level to use when imposing bandwidth restriction.</param>
00428         /// <param name="ams">AdaptiveMediaSource on which to impose restrictions</param>
00429         private async void SetMaxBitrateForProtectionLevel(HdcpProtection? protection, AdaptiveMediaSource ams)
00430         {
00431             await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00432             {
00433                 EffectiveHdcpProtectionText.Text = protection.ToString();
00434
00435                 if (ams != null && ams.AvailableBitrates.Count > 1)
00436                 {
00437                     // Get a sorted list of available bitrates.
00438                     var bitrates = new List<uint>(ams.AvailableBitrates);
00439                     bitrates.Sort();
00440
00441                     // Apply maximum bitrate policy based on a fictitious content publisher's rules.
00442                     switch (protection)
00443                     {
00444                         case HdcpProtection.OnWithTypeEnforcement:
00445                             // Allow full bitrate.
00446                             ams.DesiredMaxBitrate = bitrates[bitrates.Count - 1];
00447                             DesiredMaxBitrateText.Text = "full bitrate allowed";
00448                             break;
00449                         case HdcpProtection.On:
00450                             // When there is no HDCP Type 1, make the highest bitrate unavailable.
00451                             ams.DesiredMaxBitrate = bitrates[bitrates.Count - 2];
00452                             DesiredMaxBitrateText.Text = "highest bitrate is unavailable";
00453                             break;
00454                         case HdcpProtection.Off:
00455                         case null:
00456                         default:
00457                             // When there is no HDCP at all (Off), or the system is still trying to determine what
00458                             // HDCP protection level to apply (null), then make only the lowest bitrate available.
00459                             ams.DesiredMaxBitrate = bitrates[0];
00460                             DesiredMaxBitrateText.Text = "lowest bitrate only";
00461                             break;
00462                     }
00463                     Log($"Imposed DesiredMaxBitrate={ams.DesiredMaxBitrate} for HdcpProtection.{protection}");
00464                 }
00465             });
00466         }
00467         #endregion
00468
00469
00470         #region Utilities
00471         private void Log(string message)
00472         {
00473             LoggerControl.Log(message);
00474         }
00475         MediaPlayerLogger mediaPlayerLogger;
00476         MediaSourceLogger mediaSourceLogger;
00477         MediaPlaybackItemLogger mediaPlaybackItemLogger;
00478         AdaptiveMediaSourceLogger adaptiveMediaSourceLogger;
00479         #endregion
00480     }
00481
00482
00483     #region IHttpFilter to add an authorization header
00484
00485     public class AddAuthorizationHeaderFilter : IHttpFilter
00486     {
00487         public AddAuthorizationHeaderFilter(IHttpFilter innerFilter)
00488         {
00489             if (innerFilter == null)
00490             {
00491                 throw new ArgumentException("innerFilter cannot be null.");
00492             }
00493             this.innerFilter = innerFilter;
00494         }
00495
00496         internal HttpCredentialsHeaderValue AuthorizationHeader;
00497         private IHttpFilter innerFilter;
00498
00499         // NOTE: In production, an app might need logic for several failover key-delivery hosts.
00500         public string KeyHost { get; set; }
00501
00502         public IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> SendRequestAsync(HttpRequestMessage request)
00503         {
00504             bool isKeyRequest = String.Equals(request.RequestUri.Host, KeyHost, StringComparison.OrdinalIgnoreCase);
00505             if (isKeyRequest && AuthorizationHeader != null)
00506             {
00507                 request.Headers.Authorization = AuthorizationHeader;
00508             }
00509
00510             return innerFilter.SendRequestAsync(request);
00511         }
00512
00513         public void Dispose()
00514         {
00515         }
00516     }
00517     #endregion
00518 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VectorChangedEventArgs Member List

This is the complete list of members for VectorChangedEventArgs, including all inherited members.
CollectionChange | VectorChangedEventArgs
Index | VectorChangedEventArgs
Generated on Fri Nov 15 2024 22:24:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/CustomTitleBar.h Source File

  • TitleBar
  • cppwinrt

CustomTitleBar.h

Go to the documentation of this file.
00001 ﻿//
00002 // Declaration of the CustomTitleBar class.
00003 //
00004
00005 #pragma once
00006
00007 #include "CustomTitleBar.g.h"
00008
00009 namespace winrt::SDKTemplate::implementation
00010 {
00011     struct CustomTitleBar : CustomTitleBarT<CustomTitleBar>
00012     {
00013         CustomTitleBar();
00014
00015         Windows::UI::Xaml::UIElement SetPageContent(Windows::UI::Xaml::UIElement const& newContent);
00016         void EnableControlsInTitleBar(bool enable);
00017
00018         event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler) { return propertyChanged.add(handler); }
00019
00020         void PropertyChanged(event_token const& token) noexcept { propertyChanged.remove(token); }
00021
00022         Windows::UI::Xaml::Thickness CoreTitleBarPadding();
00023         double CoreTitleBarHeight() { return coreTitleBar.Height(); }
00024
00025         void CustomTitleBar_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         void CustomTitleBar_Unloaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027     private:
00028         Windows::ApplicationModel::Core::CoreApplicationViewTitleBar coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView().TitleBar();
00029         Windows::UI::Xaml::UIElement pageContent{ nullptr };
00030
00031         event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> propertyChanged;
00032
00033         event_token layoutMetricsChangedToken;
00034         event_token isVisibleChangedToken;
00035         event_token windowSizeChangedToken;
00036
00037         void UpdateLayoutMetrics();
00038         void UpdatePositionAndVisibility();
00039     };
00040 }
00041
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct CustomTitleBar : CustomTitleBarT<CustomTitleBar, implementation::CustomTitleBar>
00045     {
00046     };
00047 }
Generated on Fri Nov 15 2024 22:21:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/VideoRenderer.cpp Source File

  • 360VideoPlayback
  • cpp
  • Content

VideoRenderer.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "VideoRenderer.h"
00003 #include "Common\DirectXHelper.h"
00004 #include "Windows.Graphics.DirectX.Direct3D11.interop.h"
00005 #include "AppView.h"
00006
00007 using namespace _360VideoPlayback;
00008 using namespace concurrency;
00009 using namespace DirectX;
00010 using namespace Microsoft::WRL;
00011 using namespace std::placeholders;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Numerics;
00014 using namespace Windows::Graphics::DirectX::Direct3D11;
00015 using namespace Windows::Media::Core;
00016 using namespace Windows::Media::Playback;
00017 using namespace Windows::UI::Input::Spatial;
00018
00019 // Loads vertex and pixel shaders from files and instantiates the cube geometry.
00020 VideoRenderer::VideoRenderer()
00021
00022 {
00023     m_deviceResources = _360VideoPlaybackMain::GetDeviceResources();
00024     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00025     DX::ThrowIfFailed(
00026         m_deviceResources->GetD3DDevice()->CreateBuffer(
00027             &constantBufferDesc,
00028             nullptr,
00029             &m_modelConstantBuffer));
00030 }
00031
00032 // Called once per frame.
00033 void VideoRenderer::Update(const DX::StepTimer& timer)
00034 {
00035     float3 scale = 10.0f;
00036     const XMMATRIX modelScale = XMMatrixScalingFromVector(XMLoadFloat3(&scale));
00037     const XMMATRIX localTransform = modelScale;
00038     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(localTransform));
00039 }
00040
00041 // Renders one frame using the vertex and pixel shaders.
00042 // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00043 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00044 // a pass-through geometry shader is also used to set the render
00045 // target array index.
00046 void VideoRenderer::Render()
00047 {
00048     critical_section::scoped_lock lock(m_critical);
00049     // Loading is asynchronous. Resources must be created before drawing can occur.
00050     if (!m_loadingComplete)
00051     {
00052         return;
00053     }
00054
00055     // Use the D3D device context to update Direct3D device-based resources.
00056     const auto context = m_deviceResources->GetD3DDeviceContext();
00057
00058     // Update the model transform buffer for the hologram.
00059     context->UpdateSubresource(
00060         m_modelConstantBuffer.Get(),
00061         0,
00062         nullptr,
00063         &m_modelConstantBufferData,
00064         0,
00065         0
00066     );
00067
00068
00069     // Each vertex is one instance of the VertexPositionColor struct.
00070     const UINT stride = sizeof(VertexPositionTexture);
00071     const UINT offset = 0;
00072     context->IASetVertexBuffers(
00073         0,
00074         1,
00075         m_vertexBuffer.GetAddressOf(),
00076         &stride,
00077         &offset
00078     );
00079     context->IASetIndexBuffer(
00080         m_indexBuffer.Get(),
00081         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00082         0
00083     );
00084     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00085     context->IASetInputLayout(m_inputLayout.Get());
00086
00087     // Attach the vertex shader.
00088     context->VSSetShader(
00089         m_vertexShader.Get(),
00090         nullptr,
00091         0
00092     );
00093     // Apply the model constant buffer to the vertex shader.
00094     context->VSSetConstantBuffers(
00095         0,
00096         1,
00097         m_modelConstantBuffer.GetAddressOf()
00098     );
00099
00100     if (!m_usingVprtShaders)
00101     {
00102         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00103         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00104         // a pass-through geometry shader is used to set the render target
00105         // array index.
00106         context->GSSetShader(
00107             m_geometryShader.Get(),
00108             nullptr,
00109             0
00110         );
00111     }
00112     else
00113     {
00114         // Make sure that there is no geometry shader bound to the graphics
00115         // pipeline on devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00116         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature.
00117         context->GSSetShader(
00118             nullptr,
00119             nullptr,
00120             0
00121         );
00122     }
00123
00124     // Attach the pixel shader.
00125     context->PSSetShader(
00126         m_pixelShader.Get(),
00127         nullptr,
00128         0
00129     );
00130
00131     // Set the Texture Shader resource and samplers
00132     context->PSSetShaderResources(0, 1, m_textureView.GetAddressOf());
00133     context->PSSetSamplers(
00134         0,
00135         1,
00136         m_quadTextureSamplerState.GetAddressOf()
00137     );
00138
00139
00140     // Draw the objects.
00141     context->DrawIndexedInstanced(
00142         m_indexCount,   // Index count per instance.
00143         2,              // Instance count.
00144         0,              // Start index location.
00145         0,              // Base vertex location.
00146         0               // Start instance location.
00147     );
00148
00149 }
00150
00151 void VideoRenderer::CreateDeviceDependentResources()
00152 {
00153     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00154
00155     // Create the Texture, ShaderResource and Sampler state
00156
00157     DX::ThrowIfFailed(
00158         m_deviceResources->GetD3DDevice()->CreateTexture2D(
00159             &CD3D11_TEXTURE2D_DESC(
00160                 DXGI_FORMAT_R8G8B8A8_UNORM,
00161                 AppView::GetMediaPlayer()->PlaybackSession->NaturalVideoWidth,        // Width
00162                 AppView::GetMediaPlayer()->PlaybackSession->NaturalVideoHeight,        // Height
00163                 1,          // MipLevels
00164                 1,          // ArraySize
00165                 D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
00166             ),
00167             nullptr,
00168             &m_texture
00169         )
00170     );
00171
00172     DX::ThrowIfFailed(
00173         m_deviceResources->GetD3DDevice()->CreateShaderResourceView(
00174             m_texture.Get(), nullptr,
00175             &m_textureView
00176         )
00177     );
00178
00179
00180     D3D11_SAMPLER_DESC desc;
00181     ZeroMemory(&desc, sizeof(D3D11_SAMPLER_DESC));
00182
00183
00184     desc.Filter = D3D11_FILTER_ANISOTROPIC;
00185     desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
00186     desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
00187     desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
00188     desc.MaxAnisotropy = 3;
00189     desc.MinLOD = 0;
00190     desc.MaxLOD = 3;
00191     desc.MipLODBias = 0.f;
00192     desc.BorderColor[0] = 0.f;
00193     desc.BorderColor[1] = 0.f;
00194     desc.BorderColor[2] = 0.f;
00195     desc.BorderColor[3] = 0.f;
00196     desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
00197
00198     DX::ThrowIfFailed(
00199         m_deviceResources->GetD3DDevice()->CreateSamplerState(
00200             &desc,
00201             &m_quadTextureSamplerState
00202         )
00203     );
00204
00205     CreateD3D11Surface();
00206     LoadShaders();
00207 }
00208
00209 void VideoRenderer::LoadShaders()
00210 {
00211     // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00212     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00213     // we can avoid using a pass-through geometry shader to set the render
00214     // target array index, thus avoiding any overhead that would be
00215     // incurred by setting the geometry shader stage.
00216     std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";
00217
00218     // Load shaders asynchronously.
00219     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
00220     task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");
00221
00222     task<std::vector<byte>> loadGSTask;
00223     if (!m_usingVprtShaders)
00224     {
00225         // Load the pass-through geometry shader.
00226         loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
00227     }
00228
00229     // After the vertex shader file is loaded, create the shader and input layout.
00230     task<void> createVSTask = loadVSTask.then([this](const std::vector<byte>& fileData)
00231     {
00232         DX::ThrowIfFailed(
00233             m_deviceResources->GetD3DDevice()->CreateVertexShader(
00234                 fileData.data(),
00235                 fileData.size(),
00236                 nullptr,
00237                 &m_vertexShader
00238             )
00239         );
00240
00241         constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
00242         { {
00243             { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00244                         { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT,    0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00245         } };
00246
00247         DX::ThrowIfFailed(
00248             m_deviceResources->GetD3DDevice()->CreateInputLayout(
00249                 vertexDesc.data(),
00250                 static_cast<UINT>(vertexDesc.size()),
00251                 fileData.data(),
00252                 static_cast<UINT>(fileData.size()),
00253                 &m_inputLayout
00254             )
00255         );
00256     });
00257
00258     // After the pixel shader file is loaded, create the shader and constant buffer.
00259     task<void> createPSTask = loadPSTask.then([this](const std::vector<byte>& fileData)
00260     {
00261         DX::ThrowIfFailed(
00262             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00263                 fileData.data(),
00264                 fileData.size(),
00265                 nullptr,
00266                 &m_pixelShader
00267             )
00268         );
00269
00270
00271     });
00272
00273     task<void> createGSTask;
00274     if (!m_usingVprtShaders)
00275     {
00276         // After the pass-through geometry shader file is loaded, create the shader.
00277         createGSTask = loadGSTask.then([this](const std::vector<byte>& fileData)
00278         {
00279             DX::ThrowIfFailed(
00280                 m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00281                     fileData.data(),
00282                     fileData.size(),
00283                     nullptr,
00284                     &m_geometryShader
00285                 )
00286             );
00287         });
00288     }
00289
00290     // Once all shaders are loaded, create the mesh.
00291     task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
00292     task<void> createSphereTask = shaderTaskGroup.then([this]()
00293     {
00294         ComputeSphere(16, true);
00295     });
00296
00297     // Once the Sphere is created, the object is ready to be rendered.
00298     createSphereTask.then([this]()
00299     {
00300         m_loadingComplete = true;
00301     });
00302 }
00303
00304 void VideoRenderer::ReleaseDeviceDependentResources()
00305 {
00306     m_loadingComplete = false;
00307     m_usingVprtShaders = false;
00308     m_vertexShader.Reset();
00309     m_inputLayout.Reset();
00310     m_pixelShader.Reset();
00311     m_geometryShader.Reset();
00312     m_modelConstantBuffer.Reset();
00313     m_vertexBuffer.Reset();
00314     m_indexBuffer.Reset();
00315     if (m_videoFrameAvailToken.Value)
00316     {
00317         if (AppView::GetMediaPlayer() != nullptr)
00318         {
00319             AppView::GetMediaPlayer()->VideoFrameAvailable -= m_videoFrameAvailToken;
00320         }
00321     }
00322 }
00323
00324 void VideoRenderer::ComputeSphere(unsigned short tessellation, bool invertn)
00325 {
00326     if (tessellation < 3)
00327         throw std::out_of_range("tesselation parameter out of range");
00328
00329     unsigned short verticalSegments = tessellation;
00330     unsigned short horizontalSegments = tessellation * 2;
00331     const unsigned short vertCount = (verticalSegments + 1) * (horizontalSegments + 1);
00332     unsigned short indexCount = (verticalSegments) * (horizontalSegments + 1) * 6;
00333
00334     float radius = 0.5f; // Diameter of the default Sphere will always be 1 to stay aligned
00335
00336     std::vector<VertexPositionTexture> sphereVertices;
00337
00338     for (unsigned short i = 0; i <= verticalSegments; i++)
00339     {
00340         float v = 1 - (float)i / verticalSegments;
00341
00342         float latitude = (i * XM_PI / verticalSegments) - XM_PIDIV2;
00343         float dy, dxz;
00344
00345         XMScalarSinCos(&dy, &dxz, latitude);
00346
00347         // Create a single ring of vertices at this latitude.
00348         for (unsigned short j = 0; j <= horizontalSegments; j++)
00349         {
00350             float u = (float)j / horizontalSegments;
00351
00352             float longitude = j * XM_2PI / horizontalSegments;
00353             float dx, dz;
00354
00355             XMScalarSinCos(&dx, &dz, longitude);
00356
00357             dx *= dxz;
00358             dz *= dxz;
00359
00360             XMVECTOR normal = XMVectorSet(dx, dy, dz, 0) * radius;
00361             XMFLOAT3 normalFloat3;
00362             XMStoreFloat3(&normalFloat3, normal);
00363             VertexPositionTexture vert;
00364             vert.position = normalFloat3;
00365
00366             vert.textureCoordinate = XMFLOAT2(1.0f - u, v);
00367
00368             sphereVertices.push_back(vert);
00369         }
00370     }
00371
00372
00373     std::vector<unsigned short> sphereIndices;
00374
00375     // Fill the index buffer with triangles joining each pair of latitude rings.
00376     unsigned short stride = horizontalSegments + 1;
00377     for (unsigned short i = 0; i < verticalSegments; i++)
00378     {
00379         for (unsigned short j = 0; j <= horizontalSegments; j++)
00380         {
00381             unsigned short nextI = i + 1;
00382             unsigned short nextJ = (j + 1) % stride;
00383             if (!invertn)
00384             {
00385                 sphereIndices.push_back(i * stride + j);
00386                 sphereIndices.push_back(nextI * stride + j);
00387                 sphereIndices.push_back(i * stride + nextJ);
00388
00389                 sphereIndices.push_back(i * stride + nextJ);
00390                 sphereIndices.push_back(nextI * stride + j);
00391                 sphereIndices.push_back(nextI * stride + nextJ);
00392             }
00393             else
00394             {
00395                 sphereIndices.push_back(nextI * stride + j);
00396                 sphereIndices.push_back(i * stride + j);
00397                 sphereIndices.push_back(i * stride + nextJ);
00398
00399                 sphereIndices.push_back(nextI * stride + j);
00400                 sphereIndices.push_back(i * stride + nextJ);
00401                 sphereIndices.push_back(nextI * stride + nextJ);
00402             }
00403         }
00404     }
00405
00406     D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
00407     vertexBufferData.pSysMem = sphereVertices.data();
00408     vertexBufferData.SysMemPitch = 0;
00409     vertexBufferData.SysMemSlicePitch = 0;
00410     const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionTexture) * vertCount, D3D11_BIND_VERTEX_BUFFER);
00411     DX::ThrowIfFailed(
00412         m_deviceResources->GetD3DDevice()->CreateBuffer(
00413             &vertexBufferDesc,
00414             &vertexBufferData,
00415             &m_vertexBuffer
00416         )
00417     );
00418
00419     m_indexCount = indexCount;
00420
00421     D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
00422     indexBufferData.pSysMem = sphereIndices.data();
00423     indexBufferData.SysMemPitch = 0;
00424     indexBufferData.SysMemSlicePitch = 0;
00425     CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * indexCount, D3D11_BIND_INDEX_BUFFER);
00426     DX::ThrowIfFailed(
00427         m_deviceResources->GetD3DDevice()->CreateBuffer(
00428             &indexBufferDesc,
00429             &indexBufferData,
00430             &m_indexBuffer
00431         )
00432     );
00433 }
00434
00435 void VideoRenderer::CreateD3D11Surface()
00436 {
00437     Microsoft::WRL::ComPtr<IDXGISurface> spDXGIInterfaceAccess;
00438     DX::ThrowIfFailed(m_texture->QueryInterface(IID_PPV_ARGS(&spDXGIInterfaceAccess)));
00439     m_surface = CreateDirect3DSurface(spDXGIInterfaceAccess.Get());
00440     m_videoFrameAvailToken =
00441         AppView::GetMediaPlayer()->VideoFrameAvailable +=
00442         ref new TypedEventHandler<MediaPlayer^, Platform::Object^>(
00443             std::bind(&VideoRenderer::OnVideoFrameAvailable, this));
00444     AppView::GetMediaPlayer()->Play();
00445 }
00446
00447 void VideoRenderer::OnVideoFrameAvailable()
00448 {
00449     critical_section::scoped_lock lock(m_critical);
00450     AppView::GetMediaPlayer()->CopyFrameToVideoSurface(m_surface);
00451 }
00452
Generated on Fri Nov 15 2024 22:16:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_InterruptPipes Member List

This is the complete list of members for Scenario3_InterruptPipes, including all inherited members.
ClearSwitchStateTable() | Scenario3_InterruptPipes | [inline, private]
CreateBooleanChartInTable(InlineCollection table, List< Boolean > newValues, List< Boolean > oldValues, String trueValue, String falseValue) | Scenario3_InterruptPipes | [inline, static]
interruptEventHandler | Scenario3_InterruptPipes | [private]
navigatedAway | Scenario3_InterruptPipes | [private]
numInterruptsReceived | Scenario3_InterruptPipes | [private]
OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation) | Scenario3_InterruptPipes | [inline, private]
OnGeneralInterruptEvent(UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, protected]
OnOsrFx2SwitchStateChangeEvent(UsbInterruptInPipe sender, UsbInterruptInEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
previousSwitchStates | Scenario3_InterruptPipes | [private]
registeredInterrupt | Scenario3_InterruptPipes | [private]
registeredInterruptPipeIndex | Scenario3_InterruptPipes | [private]
RegisterForInterruptEvent(UInt32 pipeIndex, TypedEventHandler< UsbInterruptInPipe, UsbInterruptInEventArgs > eventHandler) | Scenario3_InterruptPipes | [inline, private]
RegisterOsrFx2InterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
RegisterSuperMuttInterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
rootPage | Scenario3_InterruptPipes | [private]
Scenario3_InterruptPipes() | Scenario3_InterruptPipes | [inline]
totalNumberBytesReceived | Scenario3_InterruptPipes | [private]
totalNumberBytesWritten | Scenario3_InterruptPipes | [private]
UnregisterFromInterruptEvent() | Scenario3_InterruptPipes | [inline, private]
UnregisterInterruptEvent_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
UpdateRegisterEventButton() | Scenario3_InterruptPipes | [inline, private]
UpdateSwitchStateTable(List< Boolean > states) | Scenario3_InterruptPipes | [inline, private]
WriteSuperMuttInterruptOut_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs) | Scenario3_InterruptPipes | [inline, private]
WriteToInterruptOut(UInt32 pipeIndex, UInt32 bytesToWrite) | Scenario3_InterruptPipes | [inline, private]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColor Member List

This is the complete list of members for VertexPositionColor, including all inherited members.
color | VertexPositionColor
pos | VertexPositionColor
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario6_ClearScenario.h Source File

  • ApplicationData
  • cppwinrt

Scenario6_ClearScenario.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6_ClearScenario.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario6_ClearScenario : Scenario6_ClearScenarioT<Scenario6_ClearScenario>
00020     {
00021         Scenario6_ClearScenario();
00022
00023         fire_and_forget Clear_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00024     };
00025 }
00026
00027 namespace winrt::SDKTemplate::factory_implementation
00028 {
00029     struct Scenario6_ClearScenario : Scenario6_ClearScenarioT<Scenario6_ClearScenario, implementation::Scenario6_ClearScenario>
00030     {
00031     };
00032 }
00033
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/CylinderMesh.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

CylinderMesh.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // CylinderMesh:
00015 // This class derives from MeshObject and creates a ID3D11Buffer of
00016 // vertices and indices to represent a canonical cylinder (capped at
00017 // both ends) that is positioned at the origin with a radius of 1.0,
00018 // a height of 1.0 and with its axis in the +Z direction.
00019
00020 #include "MeshObject.h"
00021
00022 class CylinderMesh : public MeshObject
00023 {
00024 public:
00025     CylinderMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device, uint16_t segments);
00026 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DiscoveredDevice Member List

This is the complete list of members for DiscoveredDevice, including all inherited members.
DeviceInfo | DiscoveredDevice |
DiscoveredDevice(DeviceInformation deviceInfo) | DiscoveredDevice | [inline]
DisplayName | DiscoveredDevice |
PropertyChanged | DiscoveredDevice |
ToString() | DiscoveredDevice |
UpdateDeviceInfo(DeviceInformationUpdate update) | DiscoveredDevice | [inline]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DocumentFonts Member List

This is the complete list of members for Scenario2_DocumentFonts, including all inherited members.
ApplyFonts_Click(object sender, RoutedEventArgs e) | Scenario2_DocumentFonts | [inline, private]
Scenario2_DocumentFonts() | Scenario2_DocumentFonts | [inline]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HandHandler Member List

This is the complete list of members for HandHandler, including all inherited members.
ComposeStroke() | SourceHandler | [protected, virtual]
GetCurrentTool() const | SourceHandler | [inline]
GetPosition() const | SourceHandler | [inline]
GetSourceKind() const | SourceHandler | [inline]
GetToolPosition() const | SourceHandler | [inline, virtual]
GetToolScale() const | SourceHandler | [inline, virtual]
HandHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | HandHandler |
HitTestTargetWithGaze(Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose) | HandHandler | [private]
IsPositionCurrent() const | SourceHandler | [inline]
m_coordinateSystem | HandHandler | [private]
m_currentMode | SourceHandler | [protected]
m_currentStroke | SourceHandler | [protected]
m_currentTool | SourceHandler | [protected]
m_eventsHandler | SourceHandler | [protected]
m_gestureRecognizer | HandHandler | [private]
m_initialPosition | HandHandler | [private]
m_manipulationCanceledToken | HandHandler | [private]
m_manipulationCompletedToken | HandHandler | [private]
m_manipulationStartedToken | HandHandler | [private]
m_manipulationUpdatedToken | HandHandler | [private]
m_modelConstantBufferData | SourceHandler | [protected]
m_navigationCompletedToken | HandHandler | [private]
m_navigationStartedToken | HandHandler | [private]
m_position | SourceHandler | [protected]
m_refreshModelConstantBufferData | SourceHandler | [protected]
m_sourceId | SourceHandler | [protected]
m_sourceKind | SourceHandler | [protected]
m_tappedToken | HandHandler | [private]
m_targetBoard | SourceHandler | [protected]
m_toolPosition | SourceHandler | [protected]
Make(std::shared_ptr< SourceHandler > *handler, Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | SourceHandler | [static]
OnInteractionDetected(Windows::UI::Input::Spatial::SpatialInteraction^interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) override | HandHandler | [virtual]
OnManipulationCanceled(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationCanceledEventArgs^args) | HandHandler | [private]
OnManipulationCompleted(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationCompletedEventArgs^args) | HandHandler | [private]
OnManipulationStarted(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationStartedEventArgs^args) | HandHandler | [private]
OnManipulationUpdated(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialManipulationUpdatedEventArgs^args) | HandHandler | [private]
OnNavigationCompleted(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialNavigationCompletedEventArgs^args) | HandHandler | [private]
OnNavigationStarted(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialNavigationStartedEventArgs^args) | HandHandler | [private]
OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^args) | SourceHandler | [inline, virtual]
OnSourceUpdated(Windows::UI::Input::Spatial::SpatialInteractionSourceState^state, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | HandHandler | [virtual]
OnTapped(Windows::UI::Input::Spatial::SpatialGestureRecognizer^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs^args) | HandHandler | [private]
Render(ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override | SourceHandler | [virtual]
SetApplicationMode(ApplicationMode newMode) | SourceHandler | [inline]
SetCurrentTool(std::shared_ptr< Tool > tool) | SourceHandler |
SourceHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^source, ISourceCommandHandler *eventsHandler, std::shared_ptr< Whiteboard > &target) | SourceHandler | [protected]
SourceId() const | SourceHandler | [inline]
TerminateStroke() | SourceHandler | [protected, virtual]
Update(ID3D11DeviceContext *pDeviceContext) override | SourceHandler | [virtual]
~HandHandler() | HandHandler |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_LiveSeekableRange Member List

This is the complete list of members for Scenario7_LiveSeekableRange, including all inherited members.
adaptiveMediaSourceLogger | Scenario7_LiveSeekableRange | [private]
DesiredLiveOffsetButton_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
DesiredSeekableWindowSizeButton_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
GetPlaybackPosition(double sliderPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition) | Scenario7_LiveSeekableRange | [inline]
GetSliderPositionAtPlaybackPosition(TimeSpan playbackPosition, double sliderFullScale, TimeSpan MinPosition, TimeSpan MaxPosition) | Scenario7_LiveSeekableRange | [inline]
GoToLive_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
GoToStart_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
HideDescriptionOnSmallScreen() | Scenario7_LiveSeekableRange | [inline, private]
LoadSourceFromUriAsync(Uri uri, HttpClient httpClient=null) | Scenario7_LiveSeekableRange | [inline, private]
Log(string message) | Scenario7_LiveSeekableRange | [inline, private]
LogCurrentTimeCorrelation_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
m_PlaybackPositionMaxTime | Scenario7_LiveSeekableRange | [private]
m_PlaybackPositionMinTime | Scenario7_LiveSeekableRange | [private]
m_SliderFullScale | Scenario7_LiveSeekableRange | [private]
mediaPlaybackItemLogger | Scenario7_LiveSeekableRange | [private]
MediaPlayer_PlaybackSession_PlaybackStateChanged(MediaPlaybackSession sender, object args) | Scenario7_LiveSeekableRange | [inline, private]
mediaPlayerLogger | Scenario7_LiveSeekableRange | [private]
mediaSourceLogger | Scenario7_LiveSeekableRange | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario7_LiveSeekableRange | [inline, protected]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
Pause_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
Play_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
PositionUpdateControl_PositionChanged(MediaPlaybackSession sender, object args) | Scenario7_LiveSeekableRange | [inline, private]
PositionUpdateControl_SeekableRangesChanged(MediaPlaybackSession sender, object args) | Scenario7_LiveSeekableRange | [inline, private]
PositionUpdateControl_SourceChanged(MediaPlayer sender, object args) | Scenario7_LiveSeekableRange | [inline, private]
RegisterForDiscreteControls(MediaPlayer mediaPlayer) | Scenario7_LiveSeekableRange | [inline, private]
RegisterForPositionUpdateControls(MediaPlayer mp) | Scenario7_LiveSeekableRange | [inline, private]
Scenario7_LiveSeekableRange() | Scenario7_LiveSeekableRange | [inline]
SeekFixedAmount_Click(object sender, RoutedEventArgs e) | Scenario7_LiveSeekableRange | [inline, private]
SeekToRequestedPosition(TimeSpan requestedPosition) | Scenario7_LiveSeekableRange | [inline, private]
UnregisterForDiscreteControls(MediaPlayer mediaPlayer) | Scenario7_LiveSeekableRange | [inline, private]
UnregisterForPositionUpdateControl(MediaPlayer mp) | Scenario7_LiveSeekableRange | [inline, private]
UnregisterHandlers(MediaPlayer mediaPlayer) | Scenario7_LiveSeekableRange | [inline, private]
UpdateSeekableRangesControl(IReadOnlyList< MediaTimeRange > SeekableRanges) | Scenario7_LiveSeekableRange | [inline, private]
UpdateSeekableWindowControls() | Scenario7_LiveSeekableRange | [inline, private]
UpdateSeekableWindowControls(AdaptiveMediaSource adaptiveMediaSource) | Scenario7_LiveSeekableRange | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cppwinrt/pch.h Source File

  • DisablingScreenCapture
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Media.Capture.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.ViewManagement.h"
00011 #include "winrt/Windows.UI.Xaml.h"
00012 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario02 Member List

This is the complete list of members for Scenario02, including all inherited members.
connection | Scenario02 | [private]
Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) | Scenario02 | [inline, private]
Connection_StateChanged(CastingConnection sender, object args) | Scenario02 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario02 | [inline, protected]
picker | Scenario02 | [private]
Picker_CastingDevicePickerDismissed(CastingDevicePicker sender, object args) | Scenario02 | [inline, private]
Picker_CastingDeviceSelected(CastingDevicePicker sender, CastingDeviceSelectedEventArgs args) | Scenario02 | [inline, private]
Player_CurrentStateChanged(object sender, RoutedEventArgs e) | Scenario02 | [inline, private]
Player_MediaFailed(object sender, ExceptionRoutedEventArgs e) | Scenario02 | [inline, private]
Player_MediaOpened(object sender, RoutedEventArgs e) | Scenario02 | [inline, private]
rootPage | Scenario02 | [private]
Scenario02() | Scenario02 | [inline]
TransportControls_CastButtonClicked(object sender, EventArgs e) | Scenario02 | [inline, private]
video | Scenario02 | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/pch.h Source File

  • HttpClient
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/HttpFilters.h"
00005 #include "winrt/Windows.ApplicationModel.Activation.h"
00006 #include "winrt/Windows.Data.Json.h"
00007 #include "winrt/Windows.Data.Xml.Dom.h"
00008 #include "winrt/Windows.Foundation.h"
00009 #include "winrt/Windows.Foundation.Collections.h"
00010 #include "winrt/Windows.Security.Cryptography.h"
00011 #include "winrt/Windows.Security.Cryptography.Certificates.h"
00012 #include "winrt/Windows.Storage.Streams.h"
00013 #include "winrt/Windows.System.h"
00014 #include "winrt/Windows.UI.Core.h"
00015 #include "winrt/Windows.UI.Xaml.h"
00016 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00017 #include "winrt/Windows.UI.Xaml.Controls.h"
00018 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00019 #include "winrt/Windows.UI.Xaml.Documents.h"
00020 #include "winrt/Windows.UI.Xaml.Interop.h"
00021 #include "winrt/Windows.UI.Xaml.Markup.h"
00022 #include "winrt/Windows.UI.Xaml.Media.h"
00023 #include "winrt/Windows.UI.Xaml.Navigation.h"
00024 #include "winrt/Windows.Web.h"
00025 #include "winrt/Windows.Web.Http.h"
00026 #include "winrt/Windows.Web.Http.Filters.h"
00027 #include "winrt/Windows.Web.Http.Headers.h"
00028 #include <sstream>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MicrosoftPassport/cs/AccountOverviewPage.xaml.cs Source File

  • MicrosoftPassport
  • cs

AccountOverviewPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 // Please refer to the Microsoft Passport and Windows Hello
00012 // whitepaper on the Windows Dev Center for a complete
00013 // explanation of Microsoft Passport and Windows Hello
00014 // implementation:
00015 // http://go.microsoft.com/fwlink/p/?LinkId=522066
00016 //*********************************************************
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class AccountOverviewPage : Page
00023     {
00024         public AccountOverviewPage()
00025         {
00026             InitializeComponent();
00027         }
00028
00029         private void SignOut()
00030         {
00031             while (Frame.CanGoBack)
00032                 Frame.GoBack();
00033         }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S3_RetrieveWithAPI.xaml.cs Source File

  • ContentIndexer
  • cs

S3_RetrieveWithAPI.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using System.Collections.Generic;
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     public sealed partial class S3_RetrieveWithAPI
00024     {
00025         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00026         // as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         public S3_RetrieveWithAPI()
00030         {
00031             this.InitializeComponent();
00032             Helpers.InitializeRevisionNumber();
00033         }
00034
00035         /// <summary>
00036         /// Invoked when this page is about to be displayed in a Frame.
00037         /// </summary>
00038         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042         }
00043
00044         private async void AddToIndex_Click(object sender, RoutedEventArgs e)
00045         {
00046             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00047             string outputString = await Helpers.AddItemsToIndex(indexer);
00048             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00049         }
00050
00051         private async void ExecuteQueryHelper(string queryString)
00052         {
00053             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00054             string[] propertyKeys =
00055             {
00056                 Windows.Storage.SystemProperties.ItemNameDisplay,
00057                 Windows.Storage.SystemProperties.Keywords,
00058                 Windows.Storage.SystemProperties.Comment
00059             };
00060             var query = indexer.CreateQuery(queryString, propertyKeys);
00061             var documents = await query.GetAsync();
00062             string outputString = "";
00063             foreach (var document in documents)
00064             {
00065                 outputString += Helpers.CreateItemString(document.Id, propertyKeys, document.Properties) + "\n";
00066             }
00067             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00068         }
00069
00070         /// <summary>
00071         /// This function retrieves all items added to the index by this app via the ContentIndexer.
00072         /// </summary>
00073         private void RetrieveAllItems_Click(object sender, RoutedEventArgs e)
00074         {
00075             ExecuteQueryHelper("*");
00076         }
00077
00078         /// <summary>
00079         /// This function retrieves all items added to the index by this app via the ContentIndexer which contain the work "0" in
00080         /// either the ItemNameDisplay, Keywords, or Comment properties.
00081         /// </summary>
00082         private void RetrieveMatchingItems_Click(object sender, RoutedEventArgs e)
00083         {
00084             ExecuteQueryHelper("0");
00085         }
00086     }
00087 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/pch.cpp Source File

  • CustomHidDeviceAccess
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/SampleConfiguration.h Source File

  • OCR
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContextMenu/cpp/Scenario2.xaml.h Source File

  • ContextMenu
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public ref class Scenario2 sealed
00028     {
00029     public:
00030         Scenario2();
00031
00032     private:
00033         SDKTemplate::MainPage^ rootPage;
00034
00035         Windows::Foundation::Rect Scenario2::GetTextboxSelectionRect(Windows::UI::Xaml::Controls::TextBox^ textbox);
00036         void ReadOnlyTextBox_ContextMenuOpening(Platform::Object^ sender, Windows::UI::Xaml::Controls::ContextMenuEventArgs^ e);
00037     };
00038 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MusicItem Member List

This is the complete list of members for MusicItem, including all inherited members.
AlbumArtUri | MusicItem |
ItemId | MediaItem |
MediaItem() | MediaItem | [inline]
MediaItem(JsonObject json) | MediaItem | [inline]
MediaItemIdKey | MediaItem |
MediaUri | MediaItem |
MusicItem() | MusicItem | [inline]
MusicItem(JsonObject json) | MusicItem | [inline]
PreviewImageUri | MusicItem |
Title | MediaItem |
ToPlaybackItem() | MusicItem | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cs/Scenario5_SendData.xaml.cs Source File

  • WiFiDirectServices
  • cs

Scenario5_SendData.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Globalization;
00014 using Windows.UI.Core;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00019
00020 namespace SDKTemplate
00021 {
00022     namespace WiFiDirectServices
00023     {
00024         /// <summary>
00025         /// UI that exposes a way to open TCP/UDP ports and connect sockets between two devices connected over Wi-Fi Direct Services
00026         /// This sample just demonstrates setting up the connection and sending strings
00027         /// A real application would likely open pre-determined ports for application communication
00028         ///
00029         /// Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.cs and WiFiDirectServicesWrappers.cs
00030         /// </summary>
00031         public sealed partial class Scenario5 : Page
00032         {
00033             private Object thisLock = new Object();
00034
00035             private MainPage rootPage;
00036             private SessionWrapper session = null;
00037
00038             public Scenario5()
00039             {
00040                 this.InitializeComponent();
00041             }
00042
00043             protected override void OnNavigatedTo(NavigationEventArgs e)
00044             {
00045                 lock (thisLock)
00046                 {
00047                     rootPage = MainPage.Current;
00048
00049                     MainUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00050                     PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
00051
00052                     session = WiFiDirectServiceManager.Instance.CurrentSession;
00053
00054                     if (session != null)
00055                     {
00056                         AdvertisementId.Text = session.AdvertisementId.ToString(CultureInfo.InvariantCulture);
00057                         ServiceAddress.Text = session.ServiceAddress;
00058                         SessionId.Text = session.SessionId.ToString(CultureInfo.InvariantCulture);
00059                         SessionAddress.Text = session.SessionAddress;
00060                         SessionStatus.Text = session.Session.Status.ToString();
00061
00062                         ConnectedSockets.Items.Clear();
00063                         foreach (var socket in session.SocketList)
00064                         {
00065                             ConnectedSockets.Items.Add(socket);
00066                         }
00067
00068                         MainUI.Visibility = Windows.UI.Xaml.Visibility.Visible;
00069                         PlaceholderUI.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00070                     }
00071                     else
00072                     {
00073                         AdvertisementId.Text = "##";
00074                         ServiceAddress.Text = "XX:XX:XX:XX:XX:XX";
00075                         SessionId.Text = "##";
00076                         SessionAddress.Text = "XX:XX:XX:XX:XX:XX";
00077                         SessionStatus.Text = "???";
00078
00079                         ConnectedSockets.Items.Clear();
00080                     }
00081                 }
00082                 WiFiDirectServiceManager.Instance.Scenario5 = this;
00083             }
00084
00085             protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00086             {
00087                 WiFiDirectServiceManager.Instance.Scenario5 = null;
00088             }
00089
00090             public async void AddSocket(SocketWrapper socket)
00091             {
00092                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00093                 {
00094                     lock (thisLock)
00095                     {
00096                         ConnectedSockets.Items.Add(socket);
00097                     }
00098                 });
00099             }
00100
00101             public async void RemoveSocket(int index)
00102             {
00103                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00104                 {
00105                     lock (thisLock)
00106                     {
00107                         if (index > ConnectedSockets.Items.Count - 1)
00108                         {
00109                             throw new IndexOutOfRangeException("Attempted to remove socket no longer in list");
00110                         }
00111
00112                         ConnectedSockets.Items.RemoveAt(index);
00113                     }
00114                 });
00115             }
00116
00117             private void AddPort_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00118             {
00119                 if (session != null)
00120                 {
00121                     ushort port = 0;
00122                     if (ushort.TryParse(Port.Text, out port))
00123                     {
00124                         // Create socket asynchronously, will get callback when it is complete to add the socket to the list
00125                         if (((ComboBoxItem)Protocol.SelectedItem).Content.ToString() == "TCP")
00126                         {
00127                             session.AddStreamSocketListenerAsync(port);
00128                         }
00129                         else
00130                         {
00131                             session.AddDatagramSocketAsync(port);
00132                         }
00133                     }
00134                 }
00135             }
00136
00137             private async void DoSend_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00138             {
00139                 if (ConnectedSockets.Items.Count > 0 && session != null)
00140                 {
00141                     int index = ConnectedSockets.SelectedIndex;
00142                     if (index >= 0)
00143                     {
00144                         string message = SendData.Text;
00145                         SendData.Text = "";
00146
00147                         await session.SocketList[index].SendMessageAsync(message);
00148                     }
00149                 }
00150             }
00151         }
00152     }
00153 }
Generated on Fri Nov 15 2024 22:22:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/SampleConfiguration.h Source File

  • FileSearch
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "File search C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.cpp Source File

  • ActivitySensor
  • cpp

Scenario3_ChangeEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_ChangeEvents.xaml.cpp
00014 // Implementation of the Scenario3_ChangeEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_ChangeEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Devices::Enumeration;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Globalization::DateTimeFormatting;
00028 using namespace Windows::UI::Core;
00029 using namespace Windows::UI::Xaml;
00030 using namespace Windows::UI::Xaml::Controls;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 Scenario3_ChangeEvents::Scenario3_ChangeEvents() : rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036
00037     // Register for access changed notifications for activity sensors
00038     m_deviceAccessInfo = DeviceAccessInformation::CreateFromDeviceClassId(GUID_ActivitySensor_ClassId);
00039     m_deviceAccessInfo->AccessChanged += ref new TypedEventHandler<DeviceAccessInformation ^, DeviceAccessChangedEventArgs ^>(this, &Scenario3_ChangeEvents::AccessChanged);
00040 }
00041
00042 /// <summary>
00043 /// Invoked when this page is about to be displayed in a Frame.
00044 /// </summary>
00045 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00046 /// property is typically used to configure the page.</param>
00047 void Scenario3_ChangeEvents::OnNavigatedTo(NavigationEventArgs^ e)
00048 {
00049     ScenarioEnableReadingChangedButton->IsEnabled = true;
00050     ScenarioDisableReadingChangedButton->IsEnabled = false;
00051 }
00052
00053 /// <summary>
00054 /// Invoked when this page is no longer displayed.
00055 /// </summary>
00056 /// <param name="e"></param>
00057 void Scenario3_ChangeEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00058 {
00059     // If the navigation is external to the app do not clean up.
00060     // This can occur on Phone when suspending the app.
00061     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00062     {
00063         return;
00064     }
00065
00066     if (ScenarioDisableReadingChangedButton->IsEnabled)
00067     {
00068         if (m_activitySensor != nullptr)
00069         {
00070             m_activitySensor->ReadingChanged::remove(m_readingToken);
00071             m_readingToken = {};
00072         }
00073     }
00074 }
00075
00076 /// <summary>
00077 /// This is the event handler for ReadingChanged events.
00078 /// </summary>
00079 /// <param name="sender"></param>
00080 /// <param name="e"></param>
00081 void Scenario3_ChangeEvents::ReadingChanged(ActivitySensor^ sender, ActivitySensorReadingChangedEventArgs^ e)
00082 {
00083     // We need to dispatch to the UI thread to display the output
00084     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, e]()
00085     {
00086         ActivitySensorReading^ reading = e->Reading;
00087
00088         ScenarioOutput_Activity->Text = reading->Activity.ToString();
00089         ScenarioOutput_Confidence->Text = reading->Confidence.ToString();
00090
00091         auto timestampFormatter = ref new DateTimeFormatter("day month year hour minute second");
00092         ScenarioOutput_ReadingTimestamp->Text = timestampFormatter->Format(reading->Timestamp);
00093     }));
00094 }
00095
00096 /// <summary>
00097 /// This is the click handler for the 'Reading Changed On' button.
00098 /// </summary>
00099 /// <param name="sender"></param>
00100 /// <param name="e"></param>
00101 void Scenario3_ChangeEvents::ScenarioEnableReadingChanged(Object^ sender, RoutedEventArgs^ e)
00102 {
00103     // Determine if we can access activity sensors
00104     if (m_deviceAccessInfo->CurrentStatus == DeviceAccessStatus::Allowed)
00105     {
00106         create_task(GetActivitySensorAsync()).then([this](ActivitySensor^ sensor)
00107         {
00108             m_activitySensor = sensor;
00109             if (m_activitySensor != nullptr)
00110             {
00111                 m_activitySensor->SubscribedActivities->Append(ActivityType::Walking);
00112                 m_activitySensor->SubscribedActivities->Append(ActivityType::Running);
00113                 m_activitySensor->SubscribedActivities->Append(ActivityType::InVehicle);
00114                 m_activitySensor->SubscribedActivities->Append(ActivityType::Biking);
00115                 m_activitySensor->SubscribedActivities->Append(ActivityType::Fidgeting);
00116
00117                 m_readingToken = m_activitySensor->ReadingChanged::add(
00118                     ref new TypedEventHandler<ActivitySensor^, ActivitySensorReadingChangedEventArgs^>(this,
00119                         &Scenario3_ChangeEvents::ReadingChanged));
00120
00121                 // Update the buttons in the UI thread
00122                 Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00123                 {
00124                     ScenarioEnableReadingChangedButton->IsEnabled = false;
00125                     ScenarioDisableReadingChangedButton->IsEnabled = true;
00126                     rootPage->NotifyUser("Subscribed to reading changes", NotifyType::StatusMessage);
00127                 }));
00128             }
00129             else
00130             {
00131                 rootPage->NotifyUser("No activity sensors found", NotifyType::ErrorMessage);
00132             }
00133         });
00134     }
00135     else
00136     {
00137         rootPage->NotifyUser("Access denied to activity sensors", NotifyType::ErrorMessage);
00138     }
00139 }
00140
00141 /// <summary>
00142 /// This is the click handler for the 'Reading Changed Off' button.
00143 /// </summary>
00144 /// <param name="sender"></param>
00145 /// <param name="e"></param>
00146 void Scenario3_ChangeEvents::ScenarioDisableReadingChanged(Object^ sender, RoutedEventArgs^ e)
00147 {
00148     if (m_activitySensor != nullptr)
00149     {
00150         m_activitySensor->ReadingChanged::remove(m_readingToken);
00151         rootPage->NotifyUser("Unsubscribed from reading changes", NotifyType::StatusMessage);
00152     }
00153     m_readingToken = {};
00154
00155     ScenarioEnableReadingChangedButton->IsEnabled = true;
00156     ScenarioDisableReadingChangedButton->IsEnabled = false;
00157 }
00158
00159 /// <summary>
00160 /// Invoked when the access to pedometers has changed
00161 /// </summary>
00162 /// <param name="sender"></param>
00163 /// <param name="e"></param>
00164 void Scenario3_ChangeEvents::AccessChanged(DeviceAccessInformation ^sender, DeviceAccessChangedEventArgs ^args)
00165 {
00166     if (args->Status != DeviceAccessStatus::Allowed)
00167     {
00168         m_activitySensor = nullptr;
00169
00170         Dispatcher->RunAsync(
00171             CoreDispatcherPriority::Normal,
00172             ref new DispatchedHandler(
00173                 [this]()
00174         {
00175             ScenarioEnableReadingChangedButton->IsEnabled = true;
00176             ScenarioDisableReadingChangedButton->IsEnabled = false;
00177
00178             rootPage->NotifyUser("Access to the activity sensor has been denied", NotifyType::ErrorMessage);
00179         },
00180         CallbackContext::Any));
00181     }
00182 }
00183
00184 /// <summary>
00185 /// A helper function to return the activity sensor asynchronously.
00186 /// </summary>
00187 task<ActivitySensor^> Scenario3_ChangeEvents::GetActivitySensorAsync()
00188 {
00189     if (nullptr == m_activitySensor)
00190     {
00191         return create_task(ActivitySensor::GetDefaultAsync());
00192     }
00193     else
00194     {
00195         return create_task([this]() -> ActivitySensor^
00196         {
00197             return m_activitySensor;
00198         });
00199     }
00200 }
Generated on Fri Nov 15 2024 22:17:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HeroArticlesViewModel Member List

This is the complete list of members for HeroArticlesViewModel, including all inherited members.
_article0 | HeroArticlesViewModel | [private]
_article1 | HeroArticlesViewModel | [private]
Article0 | HeroArticlesViewModel |
Article1 | HeroArticlesViewModel |
HeroArticlesViewModel() | HeroArticlesViewModel | [inline]
NotifyPropertyChanged(string propertyName) | HeroArticlesViewModel | [inline, private]
PropertyChanged | HeroArticlesViewModel |
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario4_CustomExceptionWRL.xaml.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario4_CustomExceptionWRL.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario4_CustomExceptionWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKSample;
00013 using namespace SDKSample::ProxyStubsForWinRTComponents;
00014
00015 using namespace Microsoft::SDKSamples::Kitchen;
00016
00017 using namespace Windows::UI::Xaml;
00018 using namespace Windows::UI::Xaml::Controls;
00019
00020 CustomExceptionWRL::CustomExceptionWRL()
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void SDKSample::ProxyStubsForWinRTComponents::CustomExceptionWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> spMyOven;
00028     HRESULT hr = Windows::Foundation::ActivateInstance(Microsoft::WRL::Wrappers::HStringReference(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &spMyOven);
00029     if (SUCCEEDED(hr))
00030     {
00031         // Intentionally pass an invalid value
00032         hr = spMyOven->ConfigurePreheatTemperature((ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature)5);
00033         if (hr == E_INVALIDARG)
00034         {
00035             CustomExceptionWRLOutput->Text += L"Error handled. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
_myOven | sealed | [private]
_myOven | sealed | [private]
BreadCompletedHandler1(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args) | sealed | [private]
BreadCompletedHandler2(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args) | sealed | [private]
BreadCompletedHandler3(Microsoft::SDKSamples::Kitchen::Oven^oven, Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs^args) | sealed | [private]
CustomException() | sealed |
CustomExceptionWRL() | sealed |
OvenClient() | sealed |
OvenClientWRL() | sealed |
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Start_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
_random | MainPage | [private]
_updateTimer | MainPage | [private]
MainPage() | MainPage | [inline]
OnNavigatedTo(NavigationEventArgs e) | MainPage | [inline, protected]
SectionView_ArticleSelected(object sender, ArticleViewModel e) | MainPage | [inline, private]
UpdateRandomSection() | MainPage | [inline, private]
UpdateTimer_Tick(object sender, object e) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/pch.cpp Source File

  • Calendar
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Tasks/BackgroundDeviceWatcherTask.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp
  • Tasks

BackgroundDeviceWatcherTask.cpp

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft Corporation. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "BackgroundDeviceWatcherTask.h"
00005
00006 using namespace Platform;
00007 using namespace Windows::Storage;
00008 using namespace Windows::Devices::Enumeration;
00009
00010 void BackgroundDeviceWatcherTaskCpp::BackgroundDeviceWatcher::Run(IBackgroundTaskInstance^ taskInstance)
00011 {
00012     String^ outputString;
00013
00014     OutputDebugStringW(L"BackgroundDeviceWatcher::Run called\r\n");
00015
00016     uint32 eventCount = 0;
00017     ApplicationDataContainer^ settings = ApplicationData::Current->LocalSettings;
00018     DeviceWatcherTriggerDetails^ triggerDetails = (DeviceWatcherTriggerDetails^)taskInstance->TriggerDetails;
00019
00020     outputString = L"Trigger contains " + triggerDetails->DeviceWatcherEvents->Size + L" events\r\n";
00021     OutputDebugStringW(outputString->Data());
00022
00023     std::for_each(begin(triggerDetails->DeviceWatcherEvents), end(triggerDetails->DeviceWatcherEvents), [&](DeviceWatcherEvent^ event)
00024     {
00025         switch (event->Kind)
00026         {
00027         case DeviceWatcherEventKind::Add:
00028             outputString = L"Add: " + event->DeviceInformation->Id + L"\r\n";
00029             OutputDebugStringW(outputString->Data());
00030             break;
00031
00032         case DeviceWatcherEventKind::Update:
00033             outputString = L"Update: " + event->DeviceInformationUpdate->Id + L"\r\n";
00034             OutputDebugStringW(outputString->Data());
00035             break;
00036
00037         case DeviceWatcherEventKind::Remove:
00038             outputString = L"Remove: " + event->DeviceInformationUpdate->Id + L"\r\n";
00039             OutputDebugStringW(outputString->Data());
00040             break;
00041         };
00042     });
00043
00044     if (nullptr != settings->Values->Lookup("eventCount"))
00045     {
00046         eventCount = (uint32)settings->Values->Lookup("eventCount");
00047     }
00048
00049     // Add the number of events for this trigger to the number of events received in the past
00050     eventCount += (uint32)triggerDetails->DeviceWatcherEvents->Size;
00051
00052     outputString = eventCount + L" events process for the lifetime of the trigger\r\n";
00053     OutputDebugStringW(outputString->Data());
00054
00055     settings->Values->Insert("eventCount", eventCount);
00056 }
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/Scenario1.xaml.h Source File

  • Logging
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario1 sealed
00021     {
00022     public:
00023         Scenario1();
00024     private:
00025         SDKTemplate::MainPage^ rootPage;
00026         void DoWin81Mode(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00027         void DoWin10Mode(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028     };
00029 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicMediaCasting/cs/Scenario2_CastingDevicePicker.xaml.cs Source File

  • BasicMediaCasting
  • cs

Scenario2_CastingDevicePicker.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.Foundation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.UI.Xaml.Media;
00019 using Windows.Storage;
00020 using Windows.Storage.Pickers;
00021 using Windows.Storage.Streams;
00022 using Windows.Media.Casting;
00023
00024 namespace BasicMediaCasting
00025 {
00026     public sealed partial class Scenario2 : Page
00027     {
00028         private MainPage rootPage;
00029         private CastingDevicePicker picker;
00030
00031         public Scenario2()
00032         {
00033             this.InitializeComponent();
00034
00035             //Initialize our picker object
00036             picker = new CastingDevicePicker();
00037
00038             //Set the picker to filter to video capable casting devices
00039             picker.Filter.SupportsVideo = true;
00040
00041             //Hook up device selected event
00042             picker.CastingDeviceSelected += Picker_CastingDeviceSelected;
00043         }
00044
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             rootPage = MainPage.Current;
00048         }
00049
00050         private async void loadButton_Click(object sender, RoutedEventArgs e)
00051         {
00052             //Create a new picker
00053             FileOpenPicker filePicker = new FileOpenPicker();
00054
00055             //Add filetype filters.  In this case wmv and mp4.
00056             filePicker.FileTypeFilter.Add(".wmv");
00057             filePicker.FileTypeFilter.Add(".mp4");
00058
00059             //Set picker start location to the video library
00060             filePicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
00061
00062             //Retrieve file from picker
00063             StorageFile file = await filePicker.PickSingleFileAsync();
00064
00065             //If we got a file, load it into the media lement
00066             if (file != null)
00067             {
00068                 IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
00069                 video.SetSource(stream, file.ContentType);
00070                 rootPage.NotifyUser("Content Selected", NotifyType.StatusMessage);
00071             }
00072         }
00073
00074         private void castButton_Click(object sender, RoutedEventArgs e)
00075         {
00076             //Retrieve the location of the casting button
00077             GeneralTransform transform = castButton.TransformToVisual(Window.Current.Content as UIElement);
00078             Point pt = transform.TransformPoint(new Point(0, 0));
00079
00080             //Show the picker above our casting button
00081             picker.Show(new Rect(pt.X, pt.Y, castButton.ActualWidth, castButton.ActualHeight), Windows.UI.Popups.Placement.Above);
00082
00083             rootPage.NotifyUser("Cast Button Clicked", NotifyType.StatusMessage);
00084         }
00085
00086         private async void Picker_CastingDeviceSelected(CastingDevicePicker sender, CastingDeviceSelectedEventArgs args)
00087         {
00088             //Casting must occur from the UI thread.  This dispatches the casting calls to the UI thread.
00089             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00090             {
00091                 //Create a casting conneciton from our selected casting device
00092                 CastingConnection connection = args.SelectedCastingDevice.CreateCastingConnection();
00093
00094                 //Hook up the casting events
00095                 connection.ErrorOccurred += Connection_ErrorOccurred;
00096                 connection.StateChanged += Connection_StateChanged;
00097
00098                 //Cast the content loaded in the media element to the selected casting device
00099                 await connection.RequestStartCastingAsync(video.GetAsCastingSource());
00100             });
00101         }
00102
00103         private async void Connection_StateChanged(CastingConnection sender, object args)
00104         {
00105             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00106             {
00107                 rootPage.NotifyUser("Casting Connection State Changed: " + sender.State, NotifyType.StatusMessage);
00108             });
00109         }
00110
00111         private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args)
00112         {
00113             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00114             {
00115                 rootPage.NotifyUser("Casting Error Occured: " + args.Message, NotifyType.ErrorMessage);
00116             });
00117         }
00118     }
00119 }
Generated on Fri Nov 15 2024 22:18:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario2_RequestMany.cpp Source File

  • Capabilities
  • cppwinrt

Scenario2_RequestMany.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_RequestMany.h"
00014 #include "Scenario2_RequestMany.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::Windows::Security::Authorization::AppCapabilityAccess;
00020 using namespace winrt::Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario2_RequestMany::Scenario2_RequestMany()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     fire_and_forget Scenario2_RequestMany::RequestAccessButton_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto lifetime = get_strong();
00032
00033         // This will prompt for any capabilities whose current status is UserPromptRequired.
00034         IMapView<hstring, AppCapabilityAccessStatus> result =
00035             co_await AppCapability::RequestAccessForCapabilitiesAsync({ L"location", L"webcam" });
00036         hstring locationMessage;
00037         if (result.Lookup(L"location") == AppCapabilityAccessStatus::Allowed)
00038         {
00039             locationMessage = L"Location access is granted. ";
00040         }
00041         else
00042         {
00043             // We could inspect the specific status to provide better feedback,
00044             // but for the purpose of this sample, we merely report whether access was granted
00045             // and do not study the reason why.
00046             locationMessage = L"Location access is not granted. ";
00047         }
00048         hstring webcamMessage;
00049         if (result.Lookup(L"webcam") == AppCapabilityAccessStatus::Allowed)
00050         {
00051             webcamMessage = L"Webcam access is granted. ";
00052         }
00053         else
00054         {
00055             // We could inspect the specific status to provide better feedback,
00056             // but for the purpose of this sample, we merely report whether access was granted
00057             // and do not study the reason why.
00058             webcamMessage = L"Webcam access is not granted. ";
00059         }
00060         rootPage.NotifyUser(locationMessage + webcamMessage, NotifyType::StatusMessage);
00061     }
00062 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario2_Polling.xaml.cs Source File

  • Gyrometer
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.Sensors;
00018 using Windows.Foundation;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Core;
00021
00022 namespace GyrometerCS
00023 {
00024     public sealed partial class Scenario2_Polling : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private Gyrometer _gyrometer;
00031         private uint _desiredReportInterval;
00032         private DispatcherTimer _dispatcherTimer;
00033
00034         public Scenario2_Polling()
00035         {
00036             this.InitializeComponent();
00037
00038             _gyrometer = Gyrometer.GetDefault();
00039             if (_gyrometer != null)
00040             {
00041                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00042                 // This value will be used later to activate the sensor.
00043                 uint minReportInterval = _gyrometer.MinimumReportInterval;
00044                 _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00045
00046                 // Set up a DispatchTimer
00047                 _dispatcherTimer = new DispatcherTimer();
00048                 _dispatcherTimer.Tick += DisplayCurrentReading;
00049                 _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)_desiredReportInterval);
00050             }
00051             else
00052             {
00053                 rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
00054             }
00055         }
00056
00057         /// <summary>
00058         /// Invoked when this page is about to be displayed in a Frame.
00059         /// </summary>
00060         /// <param name="e">Event data that describes how this page was reached. The Parameter
00061         /// property is typically used to configure the page.</param>
00062         protected override void OnNavigatedTo(NavigationEventArgs e)
00063         {
00064             ScenarioEnableButton.IsEnabled = true;
00065             ScenarioDisableButton.IsEnabled = false;
00066         }
00067
00068         /// <summary>
00069         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00070         /// </summary>
00071         /// <param name="e">
00072         /// Event data that can be examined by overriding code. The event data is representative
00073         /// of the navigation that will unload the current Page unless canceled. The
00074         /// navigation can potentially be canceled by setting Cancel.
00075         /// </param>
00076         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00077         {
00078             if (ScenarioDisableButton.IsEnabled)
00079             {
00080                 Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00081
00082                 // Stop the dispatcher
00083                 _dispatcherTimer.Stop();
00084
00085                 // Restore the default report interval to release resources while the sensor is not in use
00086                 _gyrometer.ReportInterval = 0;
00087             }
00088
00089             base.OnNavigatingFrom(e);
00090         }
00091
00092         /// <summary>
00093         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00094         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00095         /// </summary>
00096         /// <param name="sender"></param>
00097         /// <param name="e">
00098         /// Event data that can be examined for the current visibility state.
00099         /// </param>
00100         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00101         {
00102             if (ScenarioDisableButton.IsEnabled)
00103             {
00104                 if (e.Visible)
00105                 {
00106                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00107                     _dispatcherTimer.Start();
00108                 }
00109                 else
00110                 {
00111                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00112                     _dispatcherTimer.Stop();
00113                 }
00114             }
00115         }
00116
00117         /// <summary>
00118         /// This is the dispatcher callback.
00119         /// </summary>
00120         /// <param name="sender"></param>
00121         /// <param name="args"></param>
00122         private void DisplayCurrentReading(object sender, object args)
00123         {
00124             GyrometerReading reading = _gyrometer.GetCurrentReading();
00125             if (reading != null)
00126             {
00127                 ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
00128                 ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
00129                 ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
00130             }
00131         }
00132
00133         /// <summary>
00134         /// This is the click handler for the 'Enable' button.
00135         /// </summary>
00136         /// <param name="sender"></param>
00137         /// <param name="e"></param>
00138         private void ScenarioEnable(object sender, RoutedEventArgs e)
00139         {
00140             if (_gyrometer != null)
00141             {
00142                 // Set the report interval to enable the sensor for polling
00143                 _gyrometer.ReportInterval = _desiredReportInterval;
00144
00145                 Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
00146                 _dispatcherTimer.Start();
00147
00148                 ScenarioEnableButton.IsEnabled = false;
00149                 ScenarioDisableButton.IsEnabled = true;
00150             }
00151             else
00152             {
00153                 rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
00154             }
00155         }
00156
00157         /// <summary>
00158         /// This is the click handler for the 'Disable' button.
00159         /// </summary>
00160         /// <param name="sender"></param>
00161         /// <param name="e"></param>
00162         private void ScenarioDisable(object sender, RoutedEventArgs e)
00163         {
00164             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00165
00166             // Stop the dispatcher
00167             _dispatcherTimer.Stop();
00168
00169             // Restore the default report interval to release resources while the sensor is not in use
00170             _gyrometer.ReportInterval = 0;
00171
00172             ScenarioEnableButton.IsEnabled = true;
00173             ScenarioDisableButton.IsEnabled = false;
00174         }
00175     }
00176 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/Button.cpp Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

Button.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Button.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 using namespace HolographicMRCSample;
00006 using namespace Concurrency;
00007 using namespace DirectX;
00008 using namespace Windows::Foundation::Numerics;
00009 using namespace Windows::UI::Input::Spatial;
00010
00011 Button::Button(const Windows::Foundation::Numerics::float3 size,
00012                const Windows::Foundation::Numerics::float4 color,
00013                const Windows::Foundation::Numerics::float4 focusColor,
00014                const Windows::Foundation::Numerics::float4 turnedOnColor,
00015                const DX::TextureIndex textureId) :
00016     m_size(size),
00017     m_color(color),
00018     m_colorFocus(focusColor),
00019     m_colorOn(turnedOnColor),
00020     m_textureIndex(textureId)
00021 {
00022     m_type = Control_Button;
00023 }
00024
00025 // Called once per frame. Rotates the cube, and calculates and sets the model matrix
00026 // relative to the position transform indicated by hologramPositionTransform.
00027 void Button::DoUpdate(
00028     const DX::StepTimer& timer,
00029     HolographicFrame^ holographicFrame,
00030     SpatialCoordinateSystem^ currentCoordinateSystem,
00031     SpatialInteractionSourceState^ interactionSource,
00032     const DirectX::XMMATRIX &parentTransform)
00033 {
00034     // Rotate the cube.
00035     const XMMATRIX modelRotation    = XMMatrixRotationRollPitchYawFromVector(XMLoadFloat3(&m_rotation));
00036
00037     // Position the cube.
00038     const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00039
00040     // Multiply to get the transform matrix.
00041     // Note that this transform does not enforce a particular coordinate system. The calling
00042     // class is responsible for rendering this content in a consistent manner.
00043     const XMMATRIX modelTransform = modelRotation * modelTranslation * parentTransform;
00044     XMStoreFloat4x4(&m_transform, modelTransform);
00045
00046     // The view and projection matrices are provided by the system; they are associated
00047     // with holographic cameras, and updated on a per-camera basis.
00048     // Here, we provide the model transform for the sample hologram. The model transform
00049     // matrix is transposed to prepare it for the shader.
00050     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
00051
00052     auto pointerPose = SpatialPointerPose::TryGetAtTimestamp(currentCoordinateSystem, holographicFrame->CurrentPrediction->Timestamp);
00053     if (pointerPose != nullptr)
00054     {
00055         // Get the gaze direction relative to the given coordinate system.
00056         const float3 position = pointerPose->Head->Position;
00057         const float3 direction = pointerPose->Head->ForwardDirection;
00058
00059         XMFLOAT3 headPosition = XMFLOAT3(position.x, position.y, position.z);
00060         XMFLOAT3 headDirection = XMFLOAT3(direction.x, direction.y, direction.z);
00061         float distance = 0.0f;
00062
00063         BoundingOrientedBox currentBoundingBox;
00064         GetBoundingBox(currentBoundingBox);
00065
00066         m_focused = currentBoundingBox.Intersects(XMLoadFloat3(&headPosition), XMLoadFloat3(&headDirection), distance);
00067     }
00068
00069     if (m_enabled)
00070     {
00071         if (m_focused)
00072         {
00073             m_modelConstantBufferData.color.x = m_colorFocus.x;
00074             m_modelConstantBufferData.color.y = m_colorFocus.y;
00075             m_modelConstantBufferData.color.z = m_colorFocus.z;
00076             m_modelConstantBufferData.color.w = m_colorFocus.w;
00077         }
00078         else
00079         {
00080             if (m_turnedOn)
00081             {
00082                 m_modelConstantBufferData.color.x = m_colorOn.x;
00083                 m_modelConstantBufferData.color.y = m_colorOn.y;
00084                 m_modelConstantBufferData.color.z = m_colorOn.z;
00085                 m_modelConstantBufferData.color.w = m_colorOn.w;
00086             }
00087             else
00088             {
00089                 m_modelConstantBufferData.color.x = m_color.x;
00090                 m_modelConstantBufferData.color.y = m_color.y;
00091                 m_modelConstantBufferData.color.z = m_color.z;
00092                 m_modelConstantBufferData.color.w = m_color.w;
00093             }
00094         }
00095     }
00096     else
00097     {
00098         m_modelConstantBufferData.color.x = 0.5f;
00099         m_modelConstantBufferData.color.y = 0.5f;
00100         m_modelConstantBufferData.color.z = 0.5f;
00101         m_modelConstantBufferData.color.w = 1.0f;
00102     }
00103
00104     if (interactionSource)
00105     {
00106         if (m_focused && m_enabled && interactionSource->IsPressed && m_onAirTapCallback != nullptr)
00107         {
00108             Concurrency::task<void> callbackTask = Concurrency::create_task([this]()
00109             {
00110                 m_onAirTapCallback();
00111             });
00112         }
00113     }
00114 }
00115
00116 // Renders one frame using the vertex and pixel shaders.
00117 // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00118 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00119 // a pass-through geometry shader is also used to set the render
00120 // target array index.
00121 void Button::DoRender()
00122 {
00123     // Loading is asynchronous. Resources must be created before drawing can occur.
00124     if (!m_loadingComplete)
00125     {
00126         return;
00127     }
00128
00129     const auto context = m_deviceResources->GetD3DDeviceContext();
00130
00131     // Update the model transform buffer for the hologram.
00132     context->UpdateSubresource(
00133         m_modelConstantBuffer.Get(),
00134         0,
00135         nullptr,
00136         &m_modelConstantBufferData,
00137         0,
00138         0
00139         );
00140
00141     // Each vertex is one instance of the VertexPositionTexture struct.
00142     const UINT stride = sizeof(VertexPositionTexture);
00143     const UINT offset = 0;
00144     context->IASetVertexBuffers(
00145         0,
00146         1,
00147         m_vertexBuffer.GetAddressOf(),
00148         &stride,
00149         &offset
00150         );
00151     context->IASetIndexBuffer(
00152         m_indexBuffer.Get(),
00153         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00154         0
00155         );
00156     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00157     context->IASetInputLayout(m_inputLayout.Get());
00158
00159     // Attach the vertex shader.
00160     context->VSSetShader(
00161         m_vertexShader.Get(),
00162         nullptr,
00163         0
00164         );
00165     // Apply the model constant buffer to the vertex shader.
00166     context->VSSetConstantBuffers(
00167         0,
00168         1,
00169         m_modelConstantBuffer.GetAddressOf()
00170         );
00171
00172     if (!m_usingVprtShaders)
00173     {
00174         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00175         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00176         // a pass-through geometry shader is used to set the render target
00177         // array index.
00178         context->GSSetShader(
00179             m_geometryShader.Get(),
00180             nullptr,
00181             0
00182             );
00183     }
00184
00185     // Set Texture Resource view
00186     context->PSSetShaderResources(0, 1, m_textureView.GetAddressOf());
00187
00188     // Set Sampler
00189     context->PSSetSamplers(0, 1, m_samplerState.GetAddressOf());
00190
00191     // Attach the pixel shader.
00192     context->PSSetShader(
00193         m_pixelShader.Get(),
00194         nullptr,
00195         0
00196         );
00197
00198     // Draw the objects.
00199     context->DrawIndexedInstanced(
00200         m_indexCount,   // Index count per instance.
00201         2,              // Instance count.
00202         0,              // Start index location.
00203         0,              // Base vertex location.
00204         0               // Start instance location.
00205         );
00206 }
00207
00208 void Button::DoCreateDeviceDependentResources()
00209 {
00210     if (m_loadingComplete)
00211     {
00212         return;
00213     }
00214
00215     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00216
00217     // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00218     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00219     // we can avoid using a pass-through geometry shader to set the render
00220     // target array index, thus avoiding any overhead that would be
00221     // incurred by setting the geometry shader stage.
00222
00223     m_vertexShader = m_deviceResources->GetVertexShader(DX::VertexShader_Texture);
00224     m_inputLayout = m_deviceResources->GetInputLayout(DX::VertexShader_Texture);
00225     m_pixelShader = m_deviceResources->GetPixelShader(DX::PixelShader_Texture);
00226
00227     D3D11_TEXTURE2D_DESC texDesc;
00228     D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
00229     ZeroMemory(&viewDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
00230     const auto context = m_deviceResources->GetD3DDeviceContext();
00231
00232     // Load Pressed Button texture and create resource view
00233     Microsoft::WRL::ComPtr<ID3D11Resource> spResource;
00234     Microsoft::WRL::ComPtr<ID3D11Texture2D> spTexture;
00235     spResource = m_deviceResources->GetTexture(m_textureIndex);
00236     DX::ThrowIfFailed(spResource.As(&spTexture));
00237
00238     spTexture->GetDesc(&texDesc);
00239     viewDesc.Format = texDesc.Format;
00240     viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
00241     viewDesc.Texture2D.MostDetailedMip = 0;
00242     viewDesc.Texture2D.MipLevels = 1;
00243     DX::ThrowIfFailed(m_deviceResources->GetD3DDevice()->CreateShaderResourceView(spResource.Get(), &viewDesc, m_textureView.ReleaseAndGetAddressOf()));
00244
00245     if (!m_usingVprtShaders)
00246     {
00247         // Get the pass-through geometry shader.
00248         m_geometryShader = m_deviceResources->GetGeometryShader(DX::GeometryShader_Texture);
00249     }
00250
00251     // After the pixel shader file is loaded, create the shader and constant buffer.
00252     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelColorConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00253     DX::ThrowIfFailed(
00254         m_deviceResources->GetD3DDevice()->CreateBuffer(
00255             &constantBufferDesc,
00256             nullptr,
00257             &m_modelConstantBuffer));
00258
00259     // Once all shaders are loaded, create the mesh.
00260     {
00261         float halfWidth  = m_size.x * 0.5f;
00262         float halfHeight = m_size.y * 0.5f;
00263         float halfDepth  = m_size.z * 0.5f;
00264         XMFLOAT3 color(m_color.x, m_color.y, m_color.z);
00265
00266         m_boundingBox = BoundingOrientedBox(XMFLOAT3(0.0f, 0.0f, 0.0f), XMFLOAT3(halfWidth, halfHeight, halfDepth), XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f));
00267
00268         // Load mesh vertices. Each vertex has a position and a color.
00269         const VertexPositionTexture cubeVertices[] =
00270         {
00271             { XMFLOAT3(-halfWidth, -halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 0
00272             { XMFLOAT3(-halfWidth, -halfHeight,  halfDepth), XMFLOAT2(0.0f, 1.0f) }, // 1
00273             { XMFLOAT3(-halfWidth,  halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 2
00274             { XMFLOAT3(-halfWidth,  halfHeight,  halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 3
00275             { XMFLOAT3( halfWidth, -halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 4
00276             { XMFLOAT3( halfWidth, -halfHeight,  halfDepth), XMFLOAT2(1.0f, 1.0f) }, // 5
00277             { XMFLOAT3( halfWidth,  halfHeight, -halfDepth), XMFLOAT2(0.0f, 0.0f) }, // 6
00278             { XMFLOAT3( halfWidth,  halfHeight,  halfDepth), XMFLOAT2(1.0f, 0.0f) }, // 7
00279         };
00280
00281         D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
00282         vertexBufferData.pSysMem = cubeVertices;
00283         vertexBufferData.SysMemPitch = 0;
00284         vertexBufferData.SysMemSlicePitch = 0;
00285         const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER);
00286         DX::ThrowIfFailed(
00287             m_deviceResources->GetD3DDevice()->CreateBuffer(
00288                 &vertexBufferDesc,
00289                 &vertexBufferData,
00290                 &m_vertexBuffer
00291                 )
00292             );
00293
00294         // Load mesh indices. Each trio of indices represents
00295         // a triangle to be rendered on the screen.
00296         // For example: 2,1,0 means that the vertices with indexes
00297         // 2, 1, and 0 from the vertex buffer compose the
00298         // first triangle of this mesh.
00299         // Note that the winding order is clockwise by default.
00300         static const unsigned short cubeIndices [] =
00301         {
00302             2,1,0, // -x
00303             2,3,1,
00304
00305             6,4,5, // +x
00306             6,5,7,
00307
00308             0,1,5, // -y
00309             0,5,4,
00310
00311             2,6,7, // +y
00312             2,7,3,
00313
00314             0,4,6, // -z
00315             0,6,2,
00316
00317             1,3,7, // +z
00318             1,7,5,
00319         };
00320
00321         m_indexCount = ARRAYSIZE(cubeIndices);
00322
00323         D3D11_SUBRESOURCE_DATA indexBufferData = {0};
00324         indexBufferData.pSysMem          = cubeIndices;
00325         indexBufferData.SysMemPitch      = 0;
00326         indexBufferData.SysMemSlicePitch = 0;
00327         const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER);
00328         DX::ThrowIfFailed(
00329             m_deviceResources->GetD3DDevice()->CreateBuffer(
00330                 &indexBufferDesc,
00331                 &indexBufferData,
00332                 &m_indexBuffer
00333                 )
00334             );
00335     }
00336
00337     // Create the sample state
00338     D3D11_SAMPLER_DESC sampDesc;
00339     ZeroMemory(&sampDesc, sizeof(sampDesc));
00340     sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
00341     sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
00342     sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
00343     sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
00344     sampDesc.MaxLOD = D3D11_FLOAT32_MAX;
00345     sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
00346
00347     DX::ThrowIfFailed(
00348         m_deviceResources->GetD3DDevice()->CreateSamplerState(
00349             &sampDesc,
00350             m_samplerState.ReleaseAndGetAddressOf()));
00351
00352
00353     // Once the cube is loaded, the object is ready to be rendered.
00354     m_loadingComplete = true;
00355 }
00356
00357 void Button::DoReleaseDeviceDependentResources()
00358 {
00359     m_inputLayout.Reset();
00360     m_vertexBuffer.Reset();
00361     m_indexBuffer.Reset();
00362     m_vertexShader.Reset();
00363     m_geometryShader.Reset();
00364     m_pixelShader.Reset();
00365     m_modelConstantBuffer.Reset();
00366     m_samplerState.Reset();
00367     m_textureView.Reset();
00368
00369     m_loadingComplete = false;
00370     m_usingVprtShaders = false;
00371 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/PrimaryTile/Sending/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • PrimaryTile
  • Sending

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Linq;
00003 using Windows.Data.Xml.Dom;
00004 using Windows.UI.Notifications;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007
00008 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00009
00010 namespace Notifications.ScenarioPages.LiveTiles.Notifications.PrimaryTile.Sending
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     public sealed partial class ScenarioElement : UserControl
00016     {
00017         public ScenarioElement()
00018         {
00019             this.InitializeComponent();
00020         }
00021
00022         private void ButtonSendNotification_Click(object sender, RoutedEventArgs e)
00023         {
00024             string xml = $@"
00025                 <tile version='3'>
00026                     <visual branding='nameAndLogo'>
00027
00028                         <binding template='TileMedium'>
00029                             <text hint-wrap='true'>New tile notification</text>
00030                             <text hint-wrap='true' hint-style='captionSubtle'/>
00031                         </binding>
00032
00033                         <binding template='TileWide'>
00034                             <text hint-wrap='true'>New tile notification</text>
00035                             <text hint-wrap='true' hint-style='captionSubtle'/>
00036                         </binding>
00037
00038                         <binding template='TileLarge'>
00039                             <text hint-wrap='true'>New tile notification</text>
00040                             <text hint-wrap='true' hint-style='captionSubtle'/>
00041                         </binding>
00042
00043                 </visual>
00044             </tile>";
00045
00046             XmlDocument doc = new XmlDocument();
00047             doc.LoadXml(xml);
00048
00049             string nowTimeString = DateTime.Now.ToString();
00050
00051             // Assign date/time values through XmlDocument to avoid any xml escaping issues
00052             foreach (XmlElement textEl in doc.SelectNodes("//text").OfType<XmlElement>())
00053                 if (textEl.InnerText.Length == 0)
00054                     textEl.InnerText = nowTimeString;
00055
00056             TileNotification notification = new TileNotification(doc);
00057             TileUpdateManager.CreateTileUpdaterForApplication().Update(notification);
00058         }
00059     }
00060 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TextRenderer Member List

This is the complete list of members for TextRenderer, including all inherited members.
BottomLeft enum value | TextRenderer |
BottomRight enum value | TextRenderer |
CreateDeviceDependentResources() | TextRenderer |
m_deviceResources | TextRenderer | [private]
m_stateBlock | TextRenderer | [private]
m_textFormat | TextRenderer | [private]
m_textLayout | TextRenderer | [private]
m_textMetrics | TextRenderer | [private]
m_whiteBrush | TextRenderer | [private]
ReleaseDeviceDependentResources() | TextRenderer |
Render(TextAlignment alignment) | TextRenderer |
TextAlignment enum name | TextRenderer |
TextRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | TextRenderer |
TopLeft enum value | TextRenderer |
TopRight enum value | TextRenderer |
Update(std::wstring_view text) | TextRenderer |
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/BasicReaderWriter.cpp Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

BasicReaderWriter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "BasicReaderWriter.h"
00014
00015 using namespace Microsoft::WRL;
00016 using namespace Windows::Storage;
00017 using namespace Windows::Storage::FileProperties;
00018 using namespace Windows::Storage::Streams;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::ApplicationModel;
00021 using namespace concurrency;
00022
00023 BasicReaderWriter::BasicReaderWriter()
00024 {
00025     m_location = Package::Current->InstalledLocation;
00026 }
00027
00028 BasicReaderWriter::BasicReaderWriter(
00029     _In_ Windows::Storage::StorageFolder^ folder
00030     )
00031 {
00032     m_location = folder;
00033     Platform::String^ path = m_location->Path;
00034     if (path->Length() == 0)
00035     {
00036         // Applications are not permitted to access certain
00037         // folders, such as the Documents folder, using this
00038         // code path.  In such cases, the Path property for
00039         // the folder will be an empty string.
00040         throw ref new Platform::FailureException();
00041     }
00042 }
00043
00044 Platform::Array<byte>^ BasicReaderWriter::ReadData(
00045     _In_ Platform::String^ filename
00046     )
00047 {
00048     CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
00049     extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
00050     extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
00051     extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
00052     extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
00053     extendedParams.lpSecurityAttributes = nullptr;
00054     extendedParams.hTemplateFile = nullptr;
00055
00056     Wrappers::FileHandle file(
00057         CreateFile2(
00058             filename->Data(),
00059             GENERIC_READ,
00060             FILE_SHARE_READ,
00061             OPEN_EXISTING,
00062             &extendedParams
00063             )
00064         );
00065     if (file.Get() == INVALID_HANDLE_VALUE)
00066     {
00067         throw ref new Platform::FailureException();
00068     }
00069
00070     FILE_STANDARD_INFO fileInfo = {0};
00071     if (!GetFileInformationByHandleEx(
00072         file.Get(),
00073         FileStandardInfo,
00074         &fileInfo,
00075         sizeof(fileInfo)
00076         ))
00077     {
00078         throw ref new Platform::FailureException();
00079     }
00080
00081     if (fileInfo.EndOfFile.HighPart != 0)
00082     {
00083         throw ref new Platform::OutOfMemoryException();
00084     }
00085
00086     Platform::Array<byte>^ fileData = ref new Platform::Array<byte>(fileInfo.EndOfFile.LowPart);
00087
00088     if (!ReadFile(
00089         file.Get(),
00090         fileData->Data,
00091         fileData->Length,
00092         nullptr,
00093         nullptr
00094         ))
00095     {
00096         throw ref new Platform::FailureException();
00097     }
00098
00099     return fileData;
00100 }
00101
00102 task<Platform::Array<byte>^> BasicReaderWriter::ReadDataAsync(
00103     _In_ Platform::String^ filename
00104     )
00105 {
00106     return task<StorageFile^>(m_location->GetFileAsync(filename)).then([=](StorageFile^ file)
00107     {
00108         return FileIO::ReadBufferAsync(file);
00109     }).then([=](IBuffer^ buffer)
00110     {
00111         auto fileData = ref new Platform::Array<byte>(buffer->Length);
00112         DataReader::FromBuffer(buffer)->ReadBytes(fileData);
00113         return fileData;
00114     });
00115 }
00116
00117 uint32 BasicReaderWriter::WriteData(
00118     _In_ Platform::String^ filename,
00119     _In_ const Platform::Array<byte>^ fileData
00120     )
00121 {
00122     CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
00123     extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
00124     extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
00125     extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
00126     extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
00127     extendedParams.lpSecurityAttributes = nullptr;
00128     extendedParams.hTemplateFile = nullptr;
00129
00130     Wrappers::FileHandle file(
00131         CreateFile2(
00132             filename->Data(),
00133             GENERIC_WRITE,
00134             0,
00135             CREATE_ALWAYS,
00136             &extendedParams
00137             )
00138         );
00139     if (file.Get() == INVALID_HANDLE_VALUE)
00140     {
00141         throw ref new Platform::FailureException();
00142     }
00143
00144     DWORD numBytesWritten;
00145     if (
00146         !WriteFile(
00147             file.Get(),
00148             fileData->Data,
00149             fileData->Length,
00150             &numBytesWritten,
00151             nullptr
00152             ) ||
00153         numBytesWritten != fileData->Length
00154         )
00155     {
00156         throw ref new Platform::FailureException();
00157     }
00158
00159     return numBytesWritten;
00160 }
00161
00162 task<void> BasicReaderWriter::WriteDataAsync(
00163     _In_ Platform::String^ filename,
00164     _In_ const Platform::Array<byte>^ fileData
00165     )
00166 {
00167     return task<StorageFile^>(m_location->CreateFileAsync(filename, CreationCollisionOption::ReplaceExisting)).then([=](StorageFile^ file)
00168     {
00169         FileIO::WriteBytesAsync(file, fileData);
00170     });
00171 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/LinkList.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

LinkList.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // File: Linklist.h
00003 // Desc: Linked list class.
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 //  Copyright (C) Microsoft Corporation. All rights reserved.
00011 //-----------------------------------------------------------------------------
00012
00013 #pragma once
00014
00015 // Notes:
00016 //
00017 // The List class template implements a simple double-linked list.
00018 // It uses STL's copy semantics.
00019
00020 // There are two versions of the Clear() method:
00021 //  Clear(void) clears the list w/out cleaning up the object.
00022 //  Clear(FN fn) takes a functor object that releases the objects, if they need cleanup.
00023
00024 // The List class supports enumeration. Example of usage:
00025 //
00026 // List<T>::POSIITON pos = list.GetFrontPosition();
00027 // while (pos != list.GetEndPosition())
00028 // {
00029 //     T item;
00030 //     hr = list.GetItemPos(&item);
00031 //     pos = list.Next(pos);
00032 // }
00033
00034 // The ComPtrList class template derives from List<> and implements a list of COM pointers.
00035
00036 template <class T>
00037 struct NoOp
00038 {
00039     void operator()(T& t)
00040     {
00041     }
00042 };
00043
00044 template <class T>
00045 class List
00046 {
00047 protected:
00048
00049     // Nodes in the linked list
00050     struct Node
00051     {
00052         Node *prev;
00053         Node *next;
00054         T    item;
00055
00056         Node() : prev(nullptr), next(nullptr)
00057         {
00058         }
00059
00060         Node(T item) : prev(nullptr), next(nullptr)
00061         {
00062             this->item = item;
00063         }
00064
00065         T Item() const { return item; }
00066     };
00067
00068 public:
00069
00070     // Object for enumerating the list.
00071     class POSITION
00072     {
00073         friend class List<T>;
00074
00075     public:
00076         POSITION() : pNode(nullptr)
00077         {
00078         }
00079
00080         bool operator==(const POSITION &p) const
00081         {
00082             return pNode == p.pNode;
00083         }
00084
00085         bool operator!=(const POSITION &p) const
00086         {
00087             return pNode != p.pNode;
00088         }
00089
00090     private:
00091         const Node *pNode;
00092
00093         POSITION(Node *p) : pNode(p)
00094         {
00095         }
00096     };
00097
00098 protected:
00099     Node    m_anchor;  // Anchor node for the linked list.
00100     DWORD   m_count;   // Number of items in the list.
00101
00102     Node* Front() const
00103     {
00104         return m_anchor.next;
00105     }
00106
00107     Node* Back() const
00108     {
00109         return m_anchor.prev;
00110     }
00111
00112     virtual HRESULT InsertAfter(T item, Node *pBefore)
00113     {
00114         if (pBefore == nullptr)
00115         {
00116             return E_POINTER;
00117         }
00118
00119         Node *pNode = new Node(item);
00120         if (pNode == nullptr)
00121         {
00122             return E_OUTOFMEMORY;
00123         }
00124
00125         Node *pAfter = pBefore->next;
00126
00127         pBefore->next = pNode;
00128         pAfter->prev = pNode;
00129
00130         pNode->prev = pBefore;
00131         pNode->next = pAfter;
00132
00133         m_count++;
00134
00135         return S_OK;
00136     }
00137
00138     virtual HRESULT GetItem(const Node *pNode, T* ppItem)
00139     {
00140         if (pNode == nullptr || ppItem == nullptr)
00141         {
00142             return E_POINTER;
00143         }
00144
00145         *ppItem = pNode->item;
00146         return S_OK;
00147     }
00148
00149     // RemoveItem:
00150     // Removes a node and optionally returns the item.
00151     // ppItem can be nullptr.
00152     virtual HRESULT RemoveItem(Node *pNode, T *ppItem)
00153     {
00154         if (pNode == nullptr)
00155         {
00156             return E_POINTER;
00157         }
00158
00159         assert(pNode != &m_anchor); // We should never try to remove the anchor node.
00160         if (pNode == &m_anchor)
00161         {
00162             return E_INVALIDARG;
00163         }
00164
00165
00166         T item;
00167
00168         // The next node's previous is this node's previous.
00169         pNode->next->prev = pNode->prev;
00170
00171         // The previous node's next is this node's next.
00172         pNode->prev->next = pNode->next;
00173
00174         item = pNode->item;
00175         delete pNode;
00176
00177         m_count--;
00178
00179         if (ppItem)
00180         {
00181             *ppItem = item;
00182         }
00183
00184         return S_OK;
00185     }
00186
00187 public:
00188
00189     List()
00190     {
00191         m_anchor.next = &m_anchor;
00192         m_anchor.prev = &m_anchor;
00193
00194         m_count = 0;
00195     }
00196
00197     virtual ~List()
00198     {
00199         Clear();
00200     }
00201
00202     // Insertion functions
00203     HRESULT InsertBack(T item)
00204     {
00205         return InsertAfter(item, m_anchor.prev);
00206     }
00207
00208
00209     HRESULT InsertFront(T item)
00210     {
00211         return InsertAfter(item, &m_anchor);
00212     }
00213
00214     HRESULT InsertPos(POSITION pos, T item)
00215     {
00216         if (pos.pNode == nullptr)
00217         {
00218             return InsertBack(item);
00219         }
00220
00221         return InsertAfter(item, pos.pNode->prev);
00222     }
00223
00224     // RemoveBack: Removes the tail of the list and returns the value.
00225     // ppItem can be nullptr if you don't want the item back. (But the method does not release the item.)
00226     HRESULT RemoveBack(T *ppItem)
00227     {
00228         if (IsEmpty())
00229         {
00230             return E_FAIL;
00231         }
00232         else
00233         {
00234             return RemoveItem(Back(), ppItem);
00235         }
00236     }
00237
00238     // RemoveFront: Removes the head of the list and returns the value.
00239     // ppItem can be nullptr if you don't want the item back. (But the method does not release the item.)
00240     HRESULT RemoveFront(T *ppItem)
00241     {
00242         if (IsEmpty())
00243         {
00244             return E_FAIL;
00245         }
00246         else
00247         {
00248             return RemoveItem(Front(), ppItem);
00249         }
00250     }
00251
00252     // GetBack: Gets the tail item.
00253     HRESULT GetBack(T *ppItem)
00254     {
00255         if (IsEmpty())
00256         {
00257             return E_FAIL;
00258         }
00259         else
00260         {
00261             return GetItem(Back(), ppItem);
00262         }
00263     }
00264
00265     // GetFront: Gets the front item.
00266     HRESULT GetFront(T *ppItem)
00267     {
00268         if (IsEmpty())
00269         {
00270             return E_FAIL;
00271         }
00272         else
00273         {
00274             return GetItem(Front(), ppItem);
00275         }
00276     }
00277
00278
00279     // GetCount: Returns the number of items in the list.
00280     DWORD GetCount() const { return m_count; }
00281
00282     bool IsEmpty() const
00283     {
00284         return (GetCount() == 0);
00285     }
00286
00287     // Clear: Takes a functor object whose operator()
00288     // frees the object on the list.
00289     template <class FN>
00290     void Clear(FN& clear_fn)
00291     {
00292         Node *n = m_anchor.next;
00293
00294         // Delete the nodes
00295         while (n != &m_anchor)
00296         {
00297             clear_fn(n->item);
00298
00299             Node *tmp = n->next;
00300             delete n;
00301             n = tmp;
00302         }
00303
00304         // Reset the anchor to point at itself
00305         m_anchor.next = &m_anchor;
00306         m_anchor.prev = &m_anchor;
00307
00308         m_count = 0;
00309     }
00310
00311     // Clear: Clears the list. (Does not delete or release the list items.)
00312     virtual void Clear()
00313     {
00314         NoOp<T> clearOp;
00315         Clear<>(clearOp);
00316     }
00317
00318
00319     // Enumerator functions
00320
00321     POSITION FrontPosition()
00322     {
00323         if (IsEmpty())
00324         {
00325             return POSITION(nullptr);
00326         }
00327         else
00328         {
00329             return POSITION(Front());
00330         }
00331     }
00332
00333     POSITION EndPosition() const
00334     {
00335         return POSITION();
00336     }
00337
00338     HRESULT GetItemPos(POSITION pos, T *ppItem)
00339     {
00340         if (pos.pNode)
00341         {
00342             return GetItem(pos.pNode, ppItem);
00343         }
00344         else
00345         {
00346             return E_FAIL;
00347         }
00348     }
00349
00350     POSITION Next(const POSITION pos)
00351     {
00352         if (pos.pNode && (pos.pNode->next != &m_anchor))
00353         {
00354             return POSITION(pos.pNode->next);
00355         }
00356         else
00357         {
00358             return POSITION(nullptr);
00359         }
00360     }
00361
00362     // Remove an item at a position.
00363     // The item is returns in ppItem, unless ppItem is nullptr.
00364     // NOTE: This method invalidates the POSITION object.
00365     HRESULT Remove(POSITION& pos, T *ppItem)
00366     {
00367         if (pos.pNode)
00368         {
00369             // Remove const-ness temporarily...
00370             Node *pNode = const_cast<Node*>(pos.pNode);
00371
00372             pos = POSITION();
00373
00374             return RemoveItem(pNode, ppItem);
00375         }
00376         else
00377         {
00378             return E_INVALIDARG;
00379         }
00380     }
00381
00382 };
00383
00384
00385
00386 // Typical functors for Clear method.
00387
00388 // ComAutoRelease: Releases COM pointers.
00389 // MemDelete: Deletes pointers to new'd memory.
00390
00391 class ComAutoRelease
00392 {
00393 public:
00394     void operator()(IUnknown *p)
00395     {
00396         if (p)
00397         {
00398             p->Release();
00399         }
00400     }
00401 };
00402
00403 class MemDelete
00404 {
00405 public:
00406     void operator()(void *p)
00407     {
00408         if (p)
00409         {
00410             delete p;
00411         }
00412     }
00413 };
00414
00415
00416 // ComPtrList class
00417 // Derived class that makes it safer to store COM pointers in the List<> class.
00418 // It automatically AddRef's the pointers that are inserted onto the list
00419 // (unless the insertion method fails).
00420 //
00421 // T must be a COM interface type.
00422 // example: ComPtrList<IUnknown>
00423 //
00424 // NULLABLE: If true, client can insert nullptr pointers. This means GetItem can
00425 // succeed but return a nullptr pointer. By default, the list does not allow nullptr
00426 // pointers.
00427
00428 template <class T, bool NULLABLE = FALSE>
00429 class ComPtrList : public List<T*>
00430 {
00431 public:
00432
00433     typedef T* Ptr;
00434
00435     void Clear()
00436     {
00437         ComAutoRelease car;
00438         List<Ptr>::Clear(car);
00439     }
00440
00441     ~ComPtrList()
00442     {
00443         Clear();
00444     }
00445
00446 protected:
00447     HRESULT InsertAfter(Ptr item, Node *pBefore)
00448     {
00449         // Do not allow nullptr item pointers unless NULLABLE is true.
00450         if (item == nullptr && !NULLABLE)
00451         {
00452             return E_POINTER;
00453         }
00454
00455         if (item)
00456         {
00457             item->AddRef();
00458         }
00459
00460         HRESULT hr = List<Ptr>::InsertAfter(item, pBefore);
00461         if (FAILED(hr) && item != nullptr)
00462         {
00463             item->Release();
00464         }
00465         return hr;
00466     }
00467
00468     HRESULT GetItem(const Node *pNode, Ptr* ppItem)
00469     {
00470         Ptr pItem = nullptr;
00471
00472         // The base class gives us the pointer without AddRef'ing it.
00473         // If we return the pointer to the caller, we must AddRef().
00474         HRESULT hr = List<Ptr>::GetItem(pNode, &pItem);
00475         if (SUCCEEDED(hr))
00476         {
00477             assert(pItem || NULLABLE);
00478             if (pItem)
00479             {
00480                 *ppItem = pItem;
00481                 (*ppItem)->AddRef();
00482             }
00483         }
00484         return hr;
00485     }
00486
00487     HRESULT RemoveItem(Node *pNode, Ptr *ppItem)
00488     {
00489         // ppItem can be nullptr, but we need to get the
00490         // item so that we can release it.
00491
00492         // If ppItem is not nullptr, we will AddRef it on the way out.
00493
00494         Ptr pItem = nullptr;
00495
00496         HRESULT hr = List<Ptr>::RemoveItem(pNode, &pItem);
00497
00498         if (SUCCEEDED(hr))
00499         {
00500             assert(pItem || NULLABLE);
00501             if (ppItem && pItem)
00502             {
00503                 *ppItem = pItem;
00504                 (*ppItem)->AddRef();
00505             }
00506
00507             if (pItem)
00508             {
00509                 pItem->Release();
00510                 pItem = nullptr;
00511             }
00512         }
00513
00514         return hr;
00515     }
00516 };
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario06_PostMultipart.h Source File

  • HttpClient
  • cppwinrt

Scenario06_PostMultipart.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario06_PostMultipart.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario06_PostMultipart : Scenario06_PostMultipartT<Scenario06_PostMultipart>
00020     {
00021         Scenario06_PostMultipart();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00025
00026         fire_and_forget Start_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void Cancel_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031         Windows::Web::Http::HttpClient httpClient{ nullptr };
00032         Windows::Foundation::IAsyncAction pendingAction{ nullptr };
00033
00034         Windows::Foundation::IAsyncAction CancelableRequestAsync(
00035             Windows::Foundation::Uri resourceUri,
00036             Windows::Web::Http::HttpMultipartFormDataContent form);
00037     };
00038 }
00039
00040 namespace winrt::SDKTemplate::factory_implementation
00041 {
00042     struct Scenario06_PostMultipart : Scenario06_PostMultipartT<Scenario06_PostMultipart, implementation::Scenario06_PostMultipart>
00043     {
00044     };
00045 }
Generated on Fri Nov 15 2024 22:19:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareCustomProvider.xaml.h Source File

  • ShareSource
  • cpp

ShareCustomProvider.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareCustomProvider.xaml.h
00014 // Declaration of the ShareCustomProvider class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "SharePage.h"
00021 #include "ShareCustomProvider.g.h"
00022 #include "MainPage.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     public ref class ShareCustomProvider sealed
00027     {
00028     public:
00029         ShareCustomProvider();
00030
00031     protected:
00032         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00034         virtual bool GetShareContent(Windows::ApplicationModel::DataTransfer::DataRequest^ request) override;
00035
00036     private:
00037         Windows::Foundation::EventRegistrationToken shareProvidersRequestedToken{};
00038
00039         void OnShareProvidersRequested(Windows::ApplicationModel::DataTransfer::DataTransferManager^ sender, Windows::ApplicationModel::DataTransfer::ShareProvidersRequestedEventArgs^ e);
00040         void OnShareToContosoChat(Windows::ApplicationModel::DataTransfer::ShareProviderOperation^ operation);
00041     };
00042 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_CloudFontOverview.xaml.h Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_CloudFontOverview.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_CloudFontOverview.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario_CloudFontOverview sealed
00020     {
00021     public:
00022         Scenario_CloudFontOverview();
00023     };
00024 }
Generated on Fri Nov 15 2024 22:19:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs Source File

  • SpeechRecognitionAndSynthesis
  • cs

Scenario_ContinuousDictation.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using Windows.UI.Core;
00017 using Windows.Media.SpeechRecognition;
00018 using System;
00019 using System.Collections.Generic;
00020 using System.Text;
00021 using Windows.UI.Xaml.Media;
00022 using Windows.Globalization;
00023 using Windows.UI.Xaml.Documents;
00024 using System.Threading.Tasks;
00025
00026 namespace SDKTemplate
00027 {
00028     public sealed partial class Scenario_ContinuousDictation : Page
00029     {
00030         // Reference to the main sample page in order to post status messages.
00031         private MainPage rootPage;
00032
00033         // The speech recognizer used throughout this sample.
00034         private SpeechRecognizer speechRecognizer;
00035
00036         // Keep track of whether the continuous recognizer is currently running, so it can be cleaned up appropriately.
00037         private bool isListening;
00038
00039         // Keep track of existing text that we've accepted in ContinuousRecognitionSession_ResultGenerated(), so
00040         // that we can combine it and Hypothesized results to show in-progress dictation mid-sentence.
00041         private StringBuilder dictatedTextBuilder;
00042
00043         /// <summary>
00044         /// This HResult represents the scenario where a user is prompted to allow in-app speech, but
00045         /// declines. This should only happen on a Phone device, where speech is enabled for the entire device,
00046         /// not per-app.
00047         /// </summary>
00048         private static uint HResultPrivacyStatementDeclined = 0x80045509;
00049
00050         public Scenario_ContinuousDictation()
00051         {
00052             this.InitializeComponent();
00053             isListening = false;
00054             dictatedTextBuilder = new StringBuilder();
00055         }
00056
00057         /// <summary>
00058         /// Upon entering the scenario, ensure that we have permissions to use the Microphone. This may entail popping up
00059         /// a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to
00060         /// prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers
00061         /// should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow
00062         /// audio input.
00063         /// </summary>
00064         /// <param name="e">Unused navigation parameters</param>
00065         protected async override void OnNavigatedTo(NavigationEventArgs e)
00066         {
00067             rootPage = MainPage.Current;
00068
00069             // Prompt the user for permission to access the microphone. This request will only happen
00070             // once, it will not re-prompt if the user rejects the permission.
00071             bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
00072             if (permissionGained)
00073             {
00074                 btnContinuousRecognize.IsEnabled = true;
00075
00076                 PopulateLanguageDropdown();
00077                 await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
00078             }
00079             else
00080             {
00081                 this.dictationTextBox.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
00082                 btnContinuousRecognize.IsEnabled = false;
00083                 cbLanguageSelection.IsEnabled = false;
00084             }
00085
00086         }
00087
00088         /// <summary>
00089         /// Look up the supported languages for this speech recognition scenario,
00090         /// that are installed on this machine, and populate a dropdown with a list.
00091         /// </summary>
00092         private void PopulateLanguageDropdown()
00093         {
00094             Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
00095             IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedTopicLanguages;
00096             foreach (Language lang in supportedLanguages)
00097             {
00098                 ComboBoxItem item = new ComboBoxItem();
00099                 item.Tag = lang;
00100                 item.Content = lang.DisplayName;
00101
00102                 cbLanguageSelection.Items.Add(item);
00103                 if (lang.LanguageTag == defaultLanguage.LanguageTag)
00104                 {
00105                     item.IsSelected = true;
00106                     cbLanguageSelection.SelectedItem = item;
00107                 }
00108             }
00109         }
00110
00111         /// <summary>
00112         /// When a user changes the speech recognition language, trigger re-initialization of the
00113         /// speech engine with that language, and change any speech-specific UI assets.
00114         /// </summary>
00115         /// <param name="sender">Ignored</param>
00116         /// <param name="e">Ignored</param>
00117         private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
00118         {
00119             if (speechRecognizer != null)
00120             {
00121                 ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
00122                 Language newLanguage = (Language)item.Tag;
00123                 if (speechRecognizer.CurrentLanguage != newLanguage)
00124                 {
00125                     // trigger cleanup and re-initialization of speech.
00126                     try
00127                     {
00128                         await InitializeRecognizer(newLanguage);
00129                     }
00130                     catch (Exception exception)
00131                     {
00132                         var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
00133                         await messageDialog.ShowAsync();
00134                     }
00135                 }
00136             }
00137         }
00138
00139         /// <summary>
00140         /// Initialize Speech Recognizer and compile constraints.
00141         /// </summary>
00142         /// <param name="recognizerLanguage">Language to use for the speech recognizer</param>
00143         /// <returns>Awaitable task.</returns>
00144         private async Task InitializeRecognizer(Language recognizerLanguage)
00145         {
00146             if (speechRecognizer != null)
00147             {
00148                 // cleanup prior to re-initializing this scenario.
00149                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00150                 speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
00151                 speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
00152                 speechRecognizer.HypothesisGenerated -= SpeechRecognizer_HypothesisGenerated;
00153
00154                 this.speechRecognizer.Dispose();
00155                 this.speechRecognizer = null;
00156             }
00157
00158             this.speechRecognizer = new SpeechRecognizer(recognizerLanguage);
00159
00160             // Provide feedback to the user about the state of the recognizer. This can be used to provide visual feedback in the form
00161             // of an audio indicator to help the user understand whether they're being heard.
00162             speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;
00163
00164             // Apply the dictation topic constraint to optimize for dictated freeform speech.
00165             var dictationConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "dictation");
00166             speechRecognizer.Constraints.Add(dictationConstraint);
00167             SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();
00168             if (result.Status != SpeechRecognitionResultStatus.Success)
00169             {
00170                 rootPage.NotifyUser("Grammar Compilation Failed: " + result.Status.ToString(), NotifyType.ErrorMessage);
00171                 btnContinuousRecognize.IsEnabled = false;
00172             }
00173
00174             // Handle continuous recognition events. Completed fires when various error states occur. ResultGenerated fires when
00175             // some recognized phrases occur, or the garbage rule is hit. HypothesisGenerated fires during recognition, and
00176             // allows us to provide incremental feedback based on what the user's currently saying.
00177             speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;
00178             speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;
00179             speechRecognizer.HypothesisGenerated += SpeechRecognizer_HypothesisGenerated;
00180         }
00181
00182         /// <summary>
00183         /// Upon leaving, clean up the speech recognizer. Ensure we aren't still listening, and disable the event
00184         /// handlers to prevent leaks.
00185         /// </summary>
00186         /// <param name="e">Unused navigation parameters.</param>
00187         protected async override void OnNavigatedFrom(NavigationEventArgs e)
00188         {
00189             if (this.speechRecognizer != null)
00190             {
00191                 if (isListening)
00192                 {
00193                     await this.speechRecognizer.ContinuousRecognitionSession.CancelAsync();
00194                     isListening = false;
00195                     DictationButtonText.Text = " Dictate";
00196                     cbLanguageSelection.IsEnabled = true;
00197                 }
00198
00199                 dictationTextBox.Text = "";
00200
00201                 speechRecognizer.ContinuousRecognitionSession.Completed -= ContinuousRecognitionSession_Completed;
00202                 speechRecognizer.ContinuousRecognitionSession.ResultGenerated -= ContinuousRecognitionSession_ResultGenerated;
00203                 speechRecognizer.HypothesisGenerated -= SpeechRecognizer_HypothesisGenerated;
00204                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00205
00206                 this.speechRecognizer.Dispose();
00207                 this.speechRecognizer = null;
00208             }
00209         }
00210
00211         /// <summary>
00212         /// Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if
00213         /// some transient issues occur.
00214         /// </summary>
00215         /// <param name="sender">The continuous recognition session</param>
00216         /// <param name="args">The state of the recognizer</param>
00217         private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
00218         {
00219             if (args.Status != SpeechRecognitionResultStatus.Success)
00220             {
00221                 // If TimeoutExceeded occurs, the user has been silent for too long. We can use this to
00222                 // cancel recognition if the user in dictation mode and walks away from their device, etc.
00223                 // In a global-command type scenario, this timeout won't apply automatically.
00224                 // With dictation (no grammar in place) modes, the default timeout is 20 seconds.
00225                 if (args.Status == SpeechRecognitionResultStatus.TimeoutExceeded)
00226                 {
00227                     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00228                     {
00229                         rootPage.NotifyUser("Automatic Time Out of Dictation", NotifyType.StatusMessage);
00230                         DictationButtonText.Text = " Dictate";
00231                         cbLanguageSelection.IsEnabled = true;
00232                         dictationTextBox.Text = dictatedTextBuilder.ToString();
00233                         isListening = false;
00234                     });
00235                 }
00236                 else
00237                 {
00238                     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00239                     {
00240                         rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
00241                         DictationButtonText.Text = " Dictate";
00242                         cbLanguageSelection.IsEnabled = true;
00243                         isListening = false;
00244                     });
00245                 }
00246             }
00247         }
00248
00249         /// <summary>
00250         /// While the user is speaking, update the textbox with the partial sentence of what's being said for user feedback.
00251         /// </summary>
00252         /// <param name="sender">The recognizer that has generated the hypothesis</param>
00253         /// <param name="args">The hypothesis formed</param>
00254         private async void SpeechRecognizer_HypothesisGenerated(SpeechRecognizer sender, SpeechRecognitionHypothesisGeneratedEventArgs args)
00255         {
00256             string hypothesis = args.Hypothesis.Text;
00257
00258             // Update the textbox with the currently confirmed text, and the hypothesis combined.
00259             string textboxContent = dictatedTextBuilder.ToString() + " " + hypothesis + " ...";
00260             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00261             {
00262                 dictationTextBox.Text = textboxContent;
00263                 btnClearText.IsEnabled = true;
00264             });
00265         }
00266
00267         /// <summary>
00268         /// Handle events fired when a result is generated. Check for high to medium confidence, and then append the
00269         /// string to the end of the stringbuffer, and replace the content of the textbox with the string buffer, to
00270         /// remove any hypothesis text that may be present.
00271         /// </summary>
00272         /// <param name="sender">The Recognition session that generated this result</param>
00273         /// <param name="args">Details about the recognized speech</param>
00274         private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
00275         {
00276             // We may choose to discard content that has low confidence, as that could indicate that we're picking up
00277             // noise via the microphone, or someone could be talking out of earshot.
00278             if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
00279                 args.Result.Confidence == SpeechRecognitionConfidence.High)
00280             {
00281                 dictatedTextBuilder.Append(args.Result.Text + " ");
00282
00283                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00284                 {
00285                     discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00286
00287                     dictationTextBox.Text = dictatedTextBuilder.ToString();
00288                     btnClearText.IsEnabled = true;
00289                 });
00290             }
00291             else
00292             {
00293                 // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
00294                 // is not the primary input mechanism for the application.
00295                 // Here, just remove any hypothesis text by resetting it to the last known good.
00296                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00297                 {
00298                     dictationTextBox.Text = dictatedTextBuilder.ToString();
00299                     string discardedText = args.Result.Text;
00300                     if (!string.IsNullOrEmpty(discardedText))
00301                     {
00302                         discardedText = discardedText.Length <= 25 ? discardedText : (discardedText.Substring(0, 25) + "...");
00303
00304                         discardedTextBlock.Text = "Discarded due to low/rejected Confidence: " + discardedText;
00305                         discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
00306                     }
00307                 });
00308             }
00309         }
00310
00311         /// <summary>
00312         /// Provide feedback to the user based on whether the recognizer is receiving their voice input.
00313         /// </summary>
00314         /// <param name="sender">The recognizer that is currently running.</param>
00315         /// <param name="args">The current state of the recognizer.</param>
00316         private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
00317         {
00318             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
00319                 rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
00320             });
00321         }
00322
00323         /// <summary>
00324         /// Begin recognition, or finish the recognition session.
00325         /// </summary>
00326         /// <param name="sender">The button that generated this event</param>
00327         /// <param name="e">Unused event details</param>
00328         public async void ContinuousRecognize_Click(object sender, RoutedEventArgs e)
00329         {
00330             btnContinuousRecognize.IsEnabled = false;
00331             if (isListening == false)
00332             {
00333                 // The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
00334                 // This prevents an exception from occurring.
00335                 if (speechRecognizer.State == SpeechRecognizerState.Idle)
00336                 {
00337                     DictationButtonText.Text = " Stop Dictation";
00338                     cbLanguageSelection.IsEnabled = false;
00339                     hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
00340                     discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00341
00342                     try
00343                     {
00344                         isListening = true;
00345                         await speechRecognizer.ContinuousRecognitionSession.StartAsync();
00346                     }
00347                     catch (Exception ex)
00348                     {
00349                         if ((uint)ex.HResult == HResultPrivacyStatementDeclined)
00350                         {
00351                             // Show a UI link to the privacy settings.
00352                             hlOpenPrivacySettings.Visibility = Visibility.Visible;
00353                         }
00354                         else
00355                         {
00356                             var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
00357                             await messageDialog.ShowAsync();
00358                         }
00359
00360                         isListening = false;
00361                         DictationButtonText.Text = " Dictate";
00362                         cbLanguageSelection.IsEnabled = true;
00363
00364                     }
00365                 }
00366             }
00367             else
00368             {
00369                 isListening = false;
00370                 DictationButtonText.Text = " Dictate";
00371                 cbLanguageSelection.IsEnabled = true;
00372
00373                 if (speechRecognizer.State != SpeechRecognizerState.Idle)
00374                 {
00375                     // Cancelling recognition prevents any currently recognized speech from
00376                     // generating a ResultGenerated event. StopAsync() will allow the final session to
00377                     // complete.
00378                     try
00379                     {
00380                         await speechRecognizer.ContinuousRecognitionSession.StopAsync();
00381
00382                         // Ensure we don't leave any hypothesis text behind
00383                         dictationTextBox.Text = dictatedTextBuilder.ToString();
00384                     }
00385                     catch (Exception exception)
00386                     {
00387                         var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
00388                         await messageDialog.ShowAsync();
00389                     }
00390                 }
00391             }
00392             btnContinuousRecognize.IsEnabled = true;
00393         }
00394
00395         /// <summary>
00396         /// Clear the dictation textbox.
00397         /// </summary>
00398         /// <param name="sender">Ignored</param>
00399         /// <param name="e">Ignored</param>
00400         private void btnClearText_Click(object sender, RoutedEventArgs e)
00401         {
00402             btnClearText.IsEnabled = false;
00403             dictatedTextBuilder.Clear();
00404             dictationTextBox.Text = "";
00405             discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
00406
00407
00408             // Avoid setting focus on the text box, since it's a non-editable control.
00409             btnContinuousRecognize.Focus(FocusState.Programmatic);
00410         }
00411
00412         /// <summary>
00413         /// Automatically scroll the textbox down to the bottom whenever new dictated text arrives
00414         /// </summary>
00415         /// <param name="sender">The dictation textbox</param>
00416         /// <param name="e">Unused text changed arguments</param>
00417         private void dictationTextBox_TextChanged(object sender, TextChangedEventArgs e)
00418         {
00419             var grid = (Grid)VisualTreeHelper.GetChild(dictationTextBox, 0);
00420             for (var i = 0; i <= VisualTreeHelper.GetChildrenCount(grid) - 1; i++)
00421             {
00422                 object obj = VisualTreeHelper.GetChild(grid, i);
00423                 if (!(obj is ScrollViewer))
00424                 {
00425                     continue;
00426                 }
00427
00428                 ((ScrollViewer)obj).ChangeView(0.0f, ((ScrollViewer)obj).ExtentHeight, 1.0f);
00429                 break;
00430             }
00431         }
00432
00433         /// <summary>
00434         /// Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the
00435         /// Microsoft Privacy Policy, and enable personalization.
00436         /// </summary>
00437         /// <param name="sender">Ignored</param>
00438         /// <param name="args">Ignored</param>
00439         private async void openPrivacySettings_Click(Hyperlink sender, HyperlinkClickEventArgs args)
00440         {
00441             await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-speech"));
00442         }
00443     }
00444 }
Generated on Fri Nov 15 2024 22:21:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ActivationTypes/System/Snooze/Snoozing/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ActivationTypes
  • System
  • Snooze
  • Snoozing

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using System;
00003 using Windows.UI.Notifications;
00004 using Windows.UI.Popups;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007
00008 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00009
00010 namespace Notifications.ScenarioPages.Toasts.ActivationTypes.System.Snooze.Snoozing
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     public sealed partial class ScenarioElement : UserControl
00016     {
00017         public ScenarioElement()
00018         {
00019             this.InitializeComponent();
00020         }
00021
00022         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00023         {
00024             Initialize();
00025         }
00026
00027
00028         private void Initialize()
00029         {
00030             // Clear all existing notifications
00031             ToastNotificationManager.History.Clear();
00032
00033             // Pop one to be snoozed for 1 min
00034             ToastHelper.PopCustomToast(
00035                 $@"
00036                 <toast scenario='reminder' launch='args'>
00037                     <visual>
00038                         <binding template='ToastGeneric'>
00039                             <text>System Snoozing (1 min)</text>
00040                             <text>Make sure ""1 minute - PICK ME"" is selected, and click ""snooze"". This was created at {DateTime.Now.ToString("t")}.</text>
00041                         </binding>
00042                     </visual>
00043
00044                     <actions>
00045
00046                         <input id='snoozeTime' type='selection' defaultInput='1'>
00047                             <selection id='1' content = '1 minute - PICK ME'/>
00048                             <selection id='2' content = '2 minutes'/>
00049                             <selection id='5' content = '5 minutes'/>
00050                         </input>
00051
00052                         <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content='snooze' />
00053
00054                         <action activationType='system' arguments='dismiss' content='dismiss' />
00055
00056                     </actions>
00057                 </toast>"
00058                 );
00059
00060             // And another to be snoozed for 2 mins
00061             ToastHelper.PopCustomToast(
00062                 $@"
00063                 <toast scenario='reminder' launch='args'>
00064                     <visual>
00065                         <binding template='ToastGeneric'>
00066                             <text>System Snoozing (2 min)</text>
00067                             <text>Make sure ""2 minutes - PICK ME"" is selected, and click ""snooze"". This was created at {DateTime.Now.ToString("t")}</text>
00068                         </binding>
00069                     </visual>
00070
00071                     <actions>
00072
00073                         <input id='snoozeTime' type='selection' defaultInput='2'>
00074                             <selection id='1' content = '1 minute'/>
00075                             <selection id='2' content = '2 minutes -  PICK ME'/>
00076                             <selection id='5' content = '5 minutes'/>
00077                         </input>
00078
00079                         <action activationType='system' arguments='snooze' hint-inputId='snoozeTime' content='snooze' />
00080
00081                         <action activationType='system' arguments='dismiss' content='dismiss' />
00082
00083                     </actions>
00084                 </toast>"
00085                 );
00086
00087             DispatcherTimer timerWaitForTwoMins = new DispatcherTimer()
00088             {
00089                 Interval = TimeSpan.FromMinutes(2)
00090             };
00091             timerWaitForTwoMins.Tick += TimerWaitForTwoMins_Tick;
00092             timerWaitForTwoMins.Start();
00093         }
00094
00095         private void TimerWaitForTwoMins_Tick(object sender, object e)
00096         {
00097             (sender as DispatcherTimer).Stop();
00098
00099             stepsControl.IsNextEnabled = true;
00100         }
00101
00102         private async void Error(string message)
00103         {
00104             await new MessageDialog(message, "ERROR").ShowAsync();
00105         }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomComputeShaderMain Member List

This is the complete list of members for CustomComputeShaderMain, including all inherited members.
CreateWindowSizeDependentResources() | CustomComputeShaderMain |
CustomComputeShaderMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | CustomComputeShaderMain |
LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | CustomComputeShaderMain |
m_deviceResources | CustomComputeShaderMain | [private]
m_sampleOverlay | CustomComputeShaderMain | [private]
m_sceneRenderer | CustomComputeShaderMain | [private]
OnDeviceLost() | CustomComputeShaderMain | [virtual]
OnDeviceRestored() | CustomComputeShaderMain | [virtual]
Render() | CustomComputeShaderMain |
SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | CustomComputeShaderMain |
Update() | CustomComputeShaderMain |
~CustomComputeShaderMain() | CustomComputeShaderMain |
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Content/SpatialInputHandler.cpp Source File

  • HolographicSpatialMapping
  • cpp
  • Content

SpatialInputHandler.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SpatialInputHandler.h"
00014 #include <functional>
00015
00016 using namespace HolographicSpatialMapping;
00017
00018 using namespace Windows::Foundation;
00019 using namespace Windows::UI::Input::Spatial;
00020 using namespace std::placeholders;
00021
00022 // Creates and initializes a GestureRecognizer that listens to a Person.
00023 SpatialInputHandler::SpatialInputHandler()
00024 {
00025     // The interaction manager provides an event that informs the app when
00026     // spatial interactions are detected.
00027     m_interactionManager = SpatialInteractionManager::GetForCurrentView();
00028
00029     // Bind a handler to the SourcePressed event.
00030     m_sourcePressedEventToken =
00031         m_interactionManager->SourcePressed +=
00032             ref new TypedEventHandler<SpatialInteractionManager^, SpatialInteractionSourceEventArgs^>(
00033                 bind(&SpatialInputHandler::OnSourcePressed, this, _1, _2)
00034                 );
00035 }
00036
00037 SpatialInputHandler::~SpatialInputHandler()
00038 {
00039     // Unregister our handler for the OnSourcePressed event.
00040     m_interactionManager->SourcePressed -= m_sourcePressedEventToken;
00041 }
00042
00043 // Checks if the user performed an input gesture since the last call to this method.
00044 // Allows the main update loop to check for asynchronous changes to the user
00045 // input state.
00046 SpatialInteractionSourceState^ SpatialInputHandler::CheckForInput()
00047 {
00048     SpatialInteractionSourceState^ sourceState = m_sourceState;
00049     m_sourceState = nullptr;
00050     return sourceState;
00051 }
00052
00053 void SpatialInputHandler::OnSourcePressed(SpatialInteractionManager^ sender, SpatialInteractionSourceEventArgs^ args)
00054 {
00055     m_sourceState = args->State;
00056 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Tasks/Helpers.cs Source File

  • Geolocation
  • cs
  • Tasks

Helpers.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using Windows.Data.Json;
00013 using Windows.Data.Xml.Dom;
00014 using Windows.UI.Notifications;
00015
00016 namespace BackgroundTask
00017 {
00018     static class Helpers
00019     {
00020         /// <summary>
00021         /// Look up a string in the saved LocalSettings, or a default value if no string is found.
00022         /// </summary>
00023         /// <param name="key">The key to look up</param>
00024         /// <param name="defaultValue">The fallback value to use if the key is not found or the value is not a string</param>
00025         /// <returns></returns>
00026         public static string LookupSavedString(string key, string defaultValue = "")
00027         {
00028             var values = Windows.Storage.ApplicationData.Current.LocalSettings.Values;
00029             object o;
00030             values.TryGetValue(key, out o);
00031             string s = o as string;
00032             return (s == null) ? defaultValue : s;
00033         }
00034
00035         /// <summary>
00036         /// Looks up a JsonArray from the saved LocalSettings, or an empty JsonArray if not found.
00037         /// </summary>
00038         /// <param name="key"></param>
00039         /// <returns></returns>
00040         public static JsonArray LoadSavedJson(string key)
00041         {
00042             string json = LookupSavedString(key);
00043             if (string.IsNullOrEmpty(json))
00044             {
00045                 // Not present. Return an empty array.
00046                 return new JsonArray();
00047             }
00048             else
00049             {
00050                 return JsonValue.Parse(json).GetArray();
00051             }
00052         }
00053
00054
00055         /// <summary>
00056         /// Helper method to display a toast notification.
00057         /// </summary>
00058         public static void DisplayToast(string message)
00059         {
00060             ToastNotifier ToastNotifier = ToastNotificationManager.CreateToastNotifier();
00061
00062             // Create a two line toast and add audio reminder
00063
00064             // Here the xml that will be passed to the
00065             // ToastNotification for the toast is retrieved
00066             XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
00067
00068             // Set both lines of text
00069             XmlNodeList toastNodeList = toastXml.GetElementsByTagName("text");
00070             toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode("Geolocation Sample"));
00071             toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));
00072
00073             // now create a xml node for the audio source
00074             IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
00075             XmlElement audio = toastXml.CreateElement("audio");
00076             audio.SetAttribute("src", "ms-winsoundevent:Notification.SMS");
00077
00078             ToastNotification toast = new ToastNotification(toastXml);
00079             ToastNotifier.Show(toast);
00080         }
00081     }
00082 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/SampleConfiguration.cpp Source File

  • UserConsentVerifier
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"UserConsentVerifier C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Check Consent Availability", xaml_typename<SDKTemplate::Scenario1_CheckConsentAvailability>() },
00029     Scenario{ L"Request Consent", xaml_typename<SDKTemplate::Scenario2_RequestConsent>() },
00030 });
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DeviceWatcher Member List

This is the complete list of members for Scenario2_DeviceWatcher, including all inherited members.
deviceWatcherHelper | Scenario2_DeviceWatcher | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_DeviceWatcher | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_DeviceWatcher | [inline, protected]
resultCollection | Scenario2_DeviceWatcher | [private]
rootPage | Scenario2_DeviceWatcher | [private]
Scenario2_DeviceWatcher() | Scenario2_DeviceWatcher | [inline]
StartWatcher() | Scenario2_DeviceWatcher | [inline, private]
StartWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario2_DeviceWatcher | [inline, private]
StopWatcher() | Scenario2_DeviceWatcher | [inline, private]
StopWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario2_DeviceWatcher | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario9 Member List

This is the complete list of members for Scenario9, including all inherited members.
beginTimeOfRecordedSession | Scenario9 | [private]
beginTimeOfReplay | Scenario9 | [private]
ClearCanvasStrokeCache() | Scenario9 | [inline, private]
CompareFilesButton_Click(object sender, RoutedEventArgs e) | Scenario9 | [inline, private]
durationOfRecordedSession | Scenario9 | [private]
endTimeOfRecordedSession | Scenario9 | [private]
FPS | Scenario9 | [private]
GetCurrentStrokesView(DateTimeOffset time) | Scenario9 | [inline, private]
GetPartialStroke(InkStroke stroke, DateTimeOffset time) | Scenario9 | [inline, private]
InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs e) | Scenario9 | [inline, private]
inkReplayTimer | Scenario9 | [private]
InkReplayTimer_Tick(object sender, object e) | Scenario9 | [inline, private]
MyMap_Loaded(object sender, RoutedEventArgs e) | Scenario9 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario9 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario9 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario9 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario9 | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario9 | [inline, protected]
OnReplay(object sender, RoutedEventArgs e) | Scenario9 | [inline, private]
OnReset(object sender, RoutedEventArgs e) | Scenario9 | [inline, private]
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario9 | [inline, private]
rootPage | Scenario9 | [private]
Scenario9() | Scenario9 | [inline]
Scenario9() | Scenario9 | [inline]
Scenario9() | Scenario9 | [inline]
Scenario9() | Scenario9 | [inline]
Scenario9Button_Show_Click(object sender, RoutedEventArgs e) | Scenario9 | [inline, private]
SetDefaultStyleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario9 | [inline, private]
SetMapStyleSheet() | Scenario9 | [inline, private]
StopReplay() | Scenario9 | [inline, private]
strokeBuilder | Scenario9 | [private]
strokesToReplay | Scenario9 | [private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SecondaryAppWindowPage Member List

This is the complete list of members for SecondaryAppWindowPage, including all inherited members.
SecondaryAppWindowPage() SecondaryAppWindowPage [inline]
Generated on Fri Nov 15 2024 22:24:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/SampleConfiguration.cpp Source File

  • SimpleOrientationSensor
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" }
00022 };
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraManualControls/cs/MainPage.Focus.xaml.cs Source File

  • CameraManualControls
  • cs

MainPage.Focus.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Diagnostics;
00015 using System.Linq;
00016 using System.Text;
00017 using System.Threading.Tasks;
00018 using Windows.Foundation;
00019 using Windows.Graphics.Display;
00020 using Windows.Media.Capture;
00021 using Windows.Media.Devices;
00022 using Windows.Media.MediaProperties;
00023 using Windows.UI;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Media;
00027
00028 namespace CameraManualControls
00029 {
00030     public sealed partial class MainPage : Page
00031     {
00032
00033         private void UpdateFocusControlCapabilities()
00034         {
00035             var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
00036
00037             if (focusControl.Supported)
00038             {
00039                 FocusButton.Tag = Visibility.Visible;
00040
00041                 // Unhook the event handler, so that changing properties on the slider won't trigger an API call
00042                 FocusSlider.ValueChanged -= FocusSlider_ValueChanged;
00043
00044                 var value = focusControl.Value;
00045                 FocusSlider.Minimum = focusControl.Min;
00046                 FocusSlider.Maximum = focusControl.Max;
00047                 FocusSlider.StepFrequency = focusControl.Step;
00048                 FocusSlider.Value = value;
00049
00050                 FocusSlider.ValueChanged += FocusSlider_ValueChanged;
00051
00052                 CafFocusRadioButton.Visibility = focusControl.SupportedFocusModes.Contains(FocusMode.Continuous) ? Visibility.Visible : Visibility.Collapsed;
00053
00054                 // Tap to focus requires support for RegionsOfInterest
00055                 TapFocusRadioButton.Visibility = (_mediaCapture.VideoDeviceController.RegionsOfInterestControl.AutoFocusSupported &&
00056                                                   _mediaCapture.VideoDeviceController.RegionsOfInterestControl.MaxRegions > 0) ? Visibility.Visible : Visibility.Collapsed;
00057
00058                 // Show the focus assist light only if the device supports it. Note that it exists under the FlashControl (not the FocusControl), so check for support there first
00059                 FocusLightCheckBox.Visibility = (_mediaCapture.VideoDeviceController.FlashControl.Supported &&
00060                                                  _mediaCapture.VideoDeviceController.FlashControl.AssistantLightSupported) ? Visibility.Visible : Visibility.Collapsed;
00061
00062                 ManualFocusRadioButton.IsChecked = true;
00063             }
00064             else
00065             {
00066                 FocusButton.Visibility = Visibility.Collapsed;
00067                 FocusButton.Tag = Visibility.Collapsed;
00068             }
00069         }
00070
00071         private void FocusLightCheckBox_CheckedChanged(object sender, RoutedEventArgs e)
00072         {
00073             var flashControl = _mediaCapture.VideoDeviceController.FlashControl;
00074
00075             flashControl.AssistantLightEnabled = (FocusLightCheckBox.IsChecked == true);
00076         }
00077
00078         private async void FocusSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
00079         {
00080             if (_settingUpUi) return;
00081
00082             var value = (sender as Slider).Value;
00083
00084             await _mediaCapture.VideoDeviceController.FocusControl.SetValueAsync((uint)value);
00085         }
00086
00087         private async void ManualFocusRadioButton_Checked(object sender, RoutedEventArgs e)
00088         {
00089             // The below check is necessary because this event triggers during initialization of the page, before the MediaCapture is up
00090             if (!_isPreviewing) return;
00091
00092             // Reset tap-to-focus status
00093             _isFocused = false;
00094             FocusRectangle.Visibility = Visibility.Collapsed;
00095
00096             // Lock focus in case Continuous Autofocus was active when switching to Manual
00097             var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
00098             await focusControl.LockAsync();
00099         }
00100
00101         private async void CafFocusRadioButton_Checked(object sender, RoutedEventArgs e)
00102         {
00103             // Reset tap-to-focus status
00104             _isFocused = false;
00105             FocusRectangle.Visibility = Visibility.Collapsed;
00106
00107             var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
00108
00109             await focusControl.UnlockAsync();
00110
00111             var settings = new FocusSettings { Mode = FocusMode.Continuous, AutoFocusRange = AutoFocusRange.FullRange };
00112             focusControl.Configure(settings);
00113             await focusControl.FocusAsync();
00114         }
00115
00116         private async void TapFocusRadioButton_Checked(object sender, RoutedEventArgs e)
00117         {
00118             // Lock focus in case Continuous Autofocus was active when switching to Tap-to-focus
00119             var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
00120             await focusControl.LockAsync();
00121
00122             // Wait for user tap, which will be handled in PreviewControl_Tapped
00123         }
00124
00125         /// <summary>
00126         /// Focus the camera on the given rectangle of the preview, defined by the position and size parameters, in UI coordinates within the CaptureElement
00127         /// </summary>
00128         /// <param name="position">The position of the tap, to become the center of the focus rectangle</param>
00129         /// <param name="size">the size of the rectangle around the tap</param>
00130         /// <returns></returns>
00131         public async Task TapToFocus(Point position, Size size)
00132         {
00133             // Transition to the "focused" state
00134             _isFocused = true;
00135
00136             var previewEncodingProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
00137             var previewRect = GetPreviewStreamRectInControl(previewEncodingProperties, PreviewControl, _displayOrientation);
00138
00139             // Build UI rect that will highlight the tapped area
00140             FocusRectangle.Width = size.Width;
00141             FocusRectangle.Height = size.Height;
00142
00143             // Adjust for the rect to be centered around the tap position
00144             var left = position.X - FocusRectangle.Width / 2;
00145             var top = position.Y - FocusRectangle.Height / 2;
00146
00147             // Move it so it's contained within the preview stream in the UI and doesn't reach into letterboxing area or outside of window bounds
00148
00149             // The left and right edges should not be outside the active preview area within the CaptureElement
00150             left = Math.Max(previewRect.Left, left);
00151             left = Math.Min(previewRect.Width - FocusRectangle.Width + previewRect.Left, left);
00152
00153             // The top and bottom edges should not be outside the active preview area within the CaptureElement
00154             top = Math.Max(previewRect.Top, top);
00155             top = Math.Min(previewRect.Height - FocusRectangle.Height + previewRect.Top, top);
00156
00157             // Apply the adjusted position to the FocusRectangle
00158             Canvas.SetLeft(FocusRectangle, left);
00159             Canvas.SetTop(FocusRectangle, top);
00160
00161             FocusRectangle.Stroke = new SolidColorBrush(Colors.White);
00162             FocusRectangle.Visibility = Visibility.Visible;
00163
00164             // FocusRectangle exists in UI coordinates, need to convert to preview coordinates and adjust for rotation if necessary
00165             var focusPreview = ConvertUiTapToPreviewRect(position, size, previewRect);
00166
00167             // Note that this Region Of Interest could be configured to also calculate exposure and white balance within the region
00168             var regionOfInterest = new RegionOfInterest
00169             {
00170                 AutoFocusEnabled = true,
00171                 BoundsNormalized = true,
00172                 Bounds = focusPreview,
00173                 Type = RegionOfInterestType.Unknown,
00174                 Weight = 100,
00175             };
00176
00177             var result = await FocusCamera(regionOfInterest);
00178
00179             // Update the UI based on the result of the focusing operation
00180             FocusRectangle.Stroke = (result == MediaCaptureFocusState.Focused ? new SolidColorBrush(Colors.Lime) : new SolidColorBrush(Colors.Red));
00181         }
00182
00183         private async Task TapUnfocus()
00184         {
00185             _isFocused = false;
00186             FocusRectangle.Visibility = Visibility.Collapsed;
00187             await FocusCamera(null);
00188         }
00189
00190         /// <summary>
00191         /// Sets camera to focus on the passed in region of interest
00192         /// </summary>
00193         /// <param name="region">The region to focus on, or null to focus on the default region</param>
00194         /// <returns></returns>
00195         private async Task<MediaCaptureFocusState> FocusCamera(RegionOfInterest region)
00196         {
00197             var roiControl = _mediaCapture.VideoDeviceController.RegionsOfInterestControl;
00198             var focusControl = _mediaCapture.VideoDeviceController.FocusControl;
00199
00200             if (region != null)
00201             {
00202                 // If the call provided a region, then set it
00203                 await roiControl.SetRegionsAsync(new[] { region }, true);
00204
00205                 var focusRange = focusControl.SupportedFocusRanges.Contains(AutoFocusRange.FullRange) ? AutoFocusRange.FullRange : focusControl.SupportedFocusRanges.FirstOrDefault();
00206                 var focusMode = focusControl.SupportedFocusModes.Contains(FocusMode.Single) ? FocusMode.Single : focusControl.SupportedFocusModes.FirstOrDefault();
00207
00208                 var settings = new FocusSettings { Mode = focusMode, AutoFocusRange = focusRange };
00209
00210                 focusControl.Configure(settings);
00211             }
00212             else
00213             {
00214                 // If no region provided, clear any regions and reset focus
00215                 await roiControl.ClearRegionsAsync();
00216             }
00217
00218             await focusControl.FocusAsync();
00219
00220             return focusControl.FocusState;
00221         }
00222
00223         /// <summary>
00224         /// Applies the necessary rotation to a tap on a CaptureElement (with Stretch mode set to Uniform) to account for device orientation
00225         /// </summary>
00226         /// <param name="tap">The location, in UI coordinates, of the user tap</param>
00227         /// <param name="size">The size, in UI coordinates, of the desired focus rectangle</param>
00228         /// <param name="previewRect">The area within the CaptureElement that is actively showing the preview, and is not part of the letterboxed area</param>
00229         /// <returns>A Rect that can be passed to the MediaCapture Focus and RegionsOfInterest APIs, with normalized bounds in the orientation of the native stream</returns>
00230         private Rect ConvertUiTapToPreviewRect(Point tap, Size size, Rect previewRect)
00231         {
00232             // Adjust for the resulting focus rectangle to be centered around the position
00233             double left = tap.X - size.Width / 2, top = tap.Y - size.Height / 2;
00234
00235             // Get the information about the active preview area within the CaptureElement (in case it's letterboxed)
00236             double previewWidth = previewRect.Width, previewHeight = previewRect.Height;
00237             double previewLeft = previewRect.Left, previewTop = previewRect.Top;
00238
00239             // Transform the left and top of the tap to account for rotation
00240             switch (_displayOrientation)
00241             {
00242                 case DisplayOrientations.Portrait:
00243                     var tempLeft = left;
00244
00245                     left = top;
00246                     top = previewRect.Width - tempLeft;
00247                     break;
00248                 case DisplayOrientations.LandscapeFlipped:
00249                     left = previewRect.Width - left;
00250                     top = previewRect.Height - top;
00251                     break;
00252                 case DisplayOrientations.PortraitFlipped:
00253                     var tempTop = top;
00254
00255                     top = left;
00256                     left = previewRect.Width - tempTop;
00257                     break;
00258             }
00259
00260             // For portrait orientations, the information about the active preview area needs to be rotated
00261             if (_displayOrientation == DisplayOrientations.Portrait || _displayOrientation == DisplayOrientations.PortraitFlipped)
00262             {
00263                 previewWidth = previewRect.Height;
00264                 previewHeight = previewRect.Width;
00265                 previewLeft = previewRect.Top;
00266                 previewTop = previewRect.Left;
00267             }
00268
00269             // Normalize width and height of the focus rectangle
00270             var width = size.Width / previewWidth;
00271             var height = size.Height / previewHeight;
00272
00273             // Shift rect left and top to be relative to just the active preview area
00274             left -= previewLeft;
00275             top -= previewTop;
00276
00277             // Normalize left and top
00278             left /= previewWidth;
00279             top /= previewHeight;
00280
00281             // Ensure rectangle is fully contained within the active preview area horizontally
00282             left = Math.Max(left, 0);
00283             left = Math.Min(1 - width, left);
00284
00285             // Ensure rectangle is fully contained within the active preview area vertically
00286             top = Math.Max(top, 0);
00287             top = Math.Min(1 - height, top);
00288
00289             // Create and return resulting rectangle
00290             return new Rect(left, top, width, height);
00291         }
00292
00293     }
00294 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cs/Scenario_SampleOverview.xaml.cs Source File

  • XamlCloudFontIntegration
  • cs

Scenario_SampleOverview.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario_SampleOverview : Page
00020     {
00021         public Scenario_SampleOverview()
00022         {
00023             this.InitializeComponent();
00024         }
00025     }
00026 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Load Member List

This is the complete list of members for Scenario2_Load, including all inherited members.
conversation | Scenario2_Load | [private]
MessageTextBox_KeyUp(object sender, KeyRoutedEventArgs e) | Scenario2_Load | [inline, private]
OnChatViewContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args) | Scenario2_Load | [inline, private]
Scenario2_Load() | Scenario2_Load | [inline]
SendTextMessage() | Scenario2_Load | [inline, private]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/pch.h Source File

  • DisablingScreenCapture
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothAdvertisement/cs/Scenario2_Publisher.xaml.cs Source File

  • BluetoothAdvertisement
  • cs

Scenario2_Publisher.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Storage.Streams;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 using Windows.Devices.Bluetooth;
00020 using Windows.Devices.Bluetooth.Advertisement;
00021
00022 using SDKTemplate;
00023
00024 namespace BluetoothAdvertisement
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class Scenario2_Publisher : Page
00030     {
00031         // The Bluetooth LE advertisement publisher class is used to control and customize Bluetooth LE advertising.
00032         private BluetoothLEAdvertisementPublisher publisher;
00033
00034         // A pointer back to the main page is required to display status messages.
00035         private MainPage rootPage;
00036
00037         /// <summary>
00038         /// Initializes the singleton application object.  This is the first line of authored code
00039         /// executed, and as such is the logical equivalent of main() or WinMain().
00040         /// </summary>
00041         public Scenario2_Publisher()
00042         {
00043             this.InitializeComponent();
00044
00045             // Create and initialize a new publisher instance.
00046             publisher = new BluetoothLEAdvertisementPublisher();
00047
00048             // We need to add some payload to the advertisement. A publisher without any payload
00049             // or with invalid ones cannot be started. We only need to configure the payload once
00050             // for any publisher.
00051
00052             // Add a manufacturer-specific section:
00053             // First, let create a manufacturer data section
00054             var manufacturerData = new BluetoothLEManufacturerData();
00055
00056             // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
00057             manufacturerData.CompanyId = 0xFFFE;
00058
00059             // Finally set the data payload within the manufacturer-specific section
00060             // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
00061             var writer = new DataWriter();
00062             UInt16 uuidData = 0x1234;
00063             writer.WriteUInt16(uuidData);
00064
00065             // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
00066             manufacturerData.Data = writer.DetachBuffer();
00067
00068             // Add the manufacturer data to the advertisement publisher:
00069             publisher.Advertisement.ManufacturerData.Add(manufacturerData);
00070
00071             // Display the information about the published payload
00072             PublisherPayloadBlock.Text = string.Format("Published payload information: CompanyId=0x{0}, ManufacturerData=0x{1}",
00073                 manufacturerData.CompanyId.ToString("X"),
00074                 uuidData.ToString("X"));
00075
00076             // Display the current status of the publisher
00077             PublisherStatusBlock.Text = string.Format("Published Status: {0}, Error: {1}",
00078                 publisher.Status,
00079                 BluetoothError.Success);
00080         }
00081
00082         /// <summary>
00083         /// Invoked when this page is about to be displayed in a Frame.
00084         ///
00085         /// We will enable/disable parts of the UI if the device doesn't support it.
00086         /// </summary>
00087         /// <param name="eventArgs">Event data that describes how this page was reached. The Parameter
00088         /// property is typically used to configure the page.</param>
00089         protected override void OnNavigatedTo(NavigationEventArgs e)
00090         {
00091             rootPage = MainPage.Current;
00092
00093             // Attach a event handler to monitor the status of the publisher, which
00094             // can tell us whether the advertising has been serviced or is waiting to be serviced
00095             // due to lack of resources. It will also inform us of unexpected errors such as the Bluetooth
00096             // radio being turned off by the user.
00097             publisher.StatusChanged += OnPublisherStatusChanged;
00098
00099             // Attach handlers for suspension to stop the publisher when the App is suspended.
00100             App.Current.Suspending += App_Suspending;
00101             App.Current.Resuming += App_Resuming;
00102
00103             rootPage.NotifyUser("Press Run to start publisher.", NotifyType.StatusMessage);
00104         }
00105
00106         /// <summary>
00107         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00108         /// </summary>
00109         /// <param name="e">
00110         /// Event data that can be examined by overriding code. The event data is representative
00111         /// of the navigation that will unload the current Page unless canceled. The
00112         /// navigation can potentially be canceled by setting Cancel.
00113         /// </param>
00114         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00115         {
00116             // Remove local suspension handlers from the App since this page is no longer active.
00117             App.Current.Suspending -= App_Suspending;
00118             App.Current.Resuming -= App_Resuming;
00119
00120             // Make sure to stop the publisher when leaving the context. Even if the publisher is not stopped,
00121             // advertising will be stopped automatically if the publisher is destroyed.
00122             publisher.Stop();
00123             // Always unregister the handlers to release the resources to prevent leaks.
00124             publisher.StatusChanged -= OnPublisherStatusChanged;
00125
00126             rootPage.NotifyUser("Navigating away. Publisher stopped.", NotifyType.StatusMessage);
00127             base.OnNavigatingFrom(e);
00128         }
00129
00130         /// <summary>
00131         /// Invoked when application execution is being suspended.  Application state is saved
00132         /// without knowing whether the application will be terminated or resumed with the contents
00133         /// of memory still intact.
00134         /// </summary>
00135         /// <param name="sender">The source of the suspend request.</param>
00136         /// <param name="e">Details about the suspend request.</param>
00137         private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00138         {
00139             // Make sure to stop the publisher on suspend.
00140             publisher.Stop();
00141             // Always unregister the handlers to release the resources to prevent leaks.
00142             publisher.StatusChanged -= OnPublisherStatusChanged;
00143
00144             rootPage.NotifyUser("App suspending. Publisher stopped.", NotifyType.StatusMessage);
00145         }
00146
00147         /// <summary>
00148         /// Invoked when application execution is being resumed.
00149         /// </summary>
00150         /// <param name="sender">The source of the resume request.</param>
00151         /// <param name="e"></param>
00152         private void App_Resuming(object sender, object e)
00153         {
00154             publisher.StatusChanged += OnPublisherStatusChanged;
00155         }
00156
00157         /// <summary>
00158         /// Invoked as an event handler when the Run button is pressed.
00159         /// </summary>
00160         /// <param name="sender">Instance that triggered the event.</param>
00161         /// <param name="e">Event data describing the conditions that led to the event.</param>
00162         private void RunButton_Click(object sender, RoutedEventArgs e)
00163         {
00164             // Calling publisher start will start the advertising if resources are available to do so
00165             publisher.Start();
00166
00167             rootPage.NotifyUser("Publisher started.", NotifyType.StatusMessage);
00168         }
00169
00170         /// <summary>
00171         /// Invoked as an event handler when the Stop button is pressed.
00172         /// </summary>
00173         /// <param name="sender">Instance that triggered the event.</param>
00174         /// <param name="e">Event data describing the conditions that led to the event.</param>
00175         private void StopButton_Click(object sender, RoutedEventArgs e)
00176         {
00177             // Stopping the publisher will stop advertising the published payload
00178             publisher.Stop();
00179
00180             rootPage.NotifyUser("Publisher stopped.", NotifyType.StatusMessage);
00181         }
00182
00183         /// <summary>
00184         /// Invoked as an event handler when the status of the publisher changes.
00185         /// </summary>
00186         /// <param name="publisher">Instance of publisher that triggered the event.</param>
00187         /// <param name="eventArgs">Event data containing information about the publisher status change event.</param>
00188         private async void OnPublisherStatusChanged(
00189             BluetoothLEAdvertisementPublisher publisher,
00190             BluetoothLEAdvertisementPublisherStatusChangedEventArgs eventArgs)
00191         {
00192             // This event handler can be used to monitor the status of the publisher.
00193             // We can catch errors if the publisher is aborted by the system
00194             BluetoothLEAdvertisementPublisherStatus status = eventArgs.Status;
00195             BluetoothError error = eventArgs.Error;
00196
00197             // Update the publisher status displayed in the sample
00198             // Serialize UI update to the main UI thread
00199             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00200             {
00201                 PublisherStatusBlock.Text = string.Format("Published Status: {0}, Error: {1}",
00202                     status.ToString(),
00203                     error.ToString());
00204             });
00205         }
00206     }
00207 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

App Member List

This is the complete list of members for App, including all inherited members.
App() | App | [inline]
ONEHANDEDSIZE | App | [private]
OnLaunched(LaunchActivatedEventArgs e) | App | [inline, protected]
OnNavigationFailed(object sender, NavigationFailedEventArgs e) | App | [inline, private]
OnSuspending(object sender, SuspendingEventArgs e) | App | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
Scenario2() | Scenario2 | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/SampleConfiguration.cpp Source File

  • TextSuggestion
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Scenario 1 Conversion", "SDKTemplate.Scenario1_Conversion" },
00012     { "Scenario 2 Prediction", "SDKTemplate.Scenario2_Prediction" },
00013     { "Scenario 3 ReverseConversion", "SDKTemplate.Scenario3_ReverseConversion" }
00014 };
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/SampleConfiguration.cpp Source File

  • XamlBind
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Collections::Vector<Scenario^>^ MainPage::scenariosInner = ref new Platform::Collections::Vector<Scenario^>(
00010     ref new Platform::Array<Scenario^>
00011 {
00012     //{ "Add Scenario 1 here", "SDKTemplate.Scenario1_ShortName" },
00013     //{ "Add Scenario 2 here", "SDKTemplate.Scenario2_ShortName" },
00014     //{ "Add Scenario 3 here", "SDKTemplate.Scenario3_ShortName" }
00015     ref new Scenario(
00016         "Basic Bindings",
00017         "Demonstrates simple OneTime and OneWay bindings against a model. Buttons are provided to adjust the model which will cause the OneWay bindings against properties with notifications to update.",
00018         "SDKTemplate.BasicTests"
00019     ),
00020     ref new Scenario(
00021         "Other Bindings",
00022         "Demonstrates a more complex set of bindings including TwoWay, Converters, TargetNullValue, FallbackValue and bindings used in a variety of places in markup.",
00023         "SDKTemplate.OtherBindings"
00024     ),
00025         ref new Scenario(
00026         "List & Templates",
00027         "Demonstrates using bindings in data templates, consumed by a list and as the content template of a button. The templates are defined inline to the list, in the page's resources and in a seperate resource dictionary.",
00028         "SDKTemplate.ListsAndTemplates"
00029     ),
00030     ref new Scenario(
00031         "List phasing using x:Phase",
00032         "Demonstrates using x:Phase to achieve incremenatal rendering of the list items.",
00033         "SDKTemplate.PhasingTests"
00034     ),
00035     ref new Scenario(
00036         "Event Binding",
00037         "Demonstrates using x:Bind with Events",
00038         "SDKTemplate.EventTests"
00039     ),
00040     ref new Scenario(
00041         "Function Binding",
00042         "Demonstrates using x:Bind to bind to functions which is an easier way to do value conversions than using IValueConverter",
00043         "SDKTemplate.Functions"
00044     )
00045 });
00046
00047 Scenario::Scenario(Platform::String^ title, Platform::String^ description, Platform::String^ className)
00048 {
00049     this->Title = title;
00050     this->Description = description;
00051     this->ClassName = className;
00052 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario2_OvenClientWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010
00011 using namespace Microsoft::WRL;
00012 using namespace Microsoft::WRL::Wrappers;
00013 using namespace Microsoft::SDKSamples::Kitchen;
00014 using namespace SDKTemplate::WRLOutOfProcessWinRTComponent;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::Foundation;
00018
00019 OvenClientWRL::OvenClientWRL()
00020 {
00021     InitializeComponent();
00022 }
00023
00024 void OvenClientWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00025 {
00026     try
00027     {
00028         HRESULT hr = S_OK;
00029
00030         if (!_myOven)
00031         {
00032             ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOvenFactory> ovenFactory;
00033             // Component Creation: Get the activation factory
00034             hr = GetActivationFactory(HStringReference(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &ovenFactory);
00035             if (FAILED(hr)) throw ref new Platform::COMException(hr);
00036
00037             ABI::Microsoft::SDKSamples::Kitchen::Dimensions dimensions;
00038             dimensions.Width = 2;
00039             dimensions.Height = 2;
00040             dimensions.Depth = 2;
00041
00042             // Component Creation: Call the factory method to produce an oven object
00043             hr = ovenFactory->CreateOven(dimensions, &_myOven);
00044             if (FAILED(hr)) throw ref new Platform::COMException(hr);
00045         }
00046
00047         ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> myAppliance;
00048         hr = _myOven.As(&myAppliance);
00049         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00050
00051         // Getters and setters are accessed using the get_ or put_ methods
00052         double volume;
00053         hr = myAppliance->get_Volume(&volume);
00054         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00055
00056         OvenClientWRLOutput->Text += "Oven volume is: " + volume.ToString() + "\n";
00057
00058         // Declare handlers for event callbacks
00059         auto handler1 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00060             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* pOven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00061         {
00062             HRESULT hr = S_OK;
00063             try
00064             {
00065                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00066                 OvenClientWRLOutput->Text += "Event Handler 1: Invoked\n";
00067
00068                 ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> appliance;
00069                 hr = pOven->QueryInterface(IID_PPV_ARGS(&appliance));
00070                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00071
00072                 double volume;
00073                 hr = appliance->get_Volume(&volume);
00074                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00075
00076                 OvenClientWRLOutput->Text += "Event Handler 1: Oven volume is: " + volume.ToString() + "\n";
00077
00078                 ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IBread> bread;
00079                 hr = args->get_Bread(&bread);
00080                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00081
00082                 HString flavor;
00083                 hr = bread->get_Flavor(flavor.GetAddressOf());
00084                 if (FAILED(hr)) throw ref new Platform::COMException(hr);
00085
00086                 OvenClientWRLOutput->Text += "Event Handler 1: Bread flavor is: " + ref new Platform::String(flavor.Get()) + "\n";
00087             }
00088             catch (Platform::COMException^ e)
00089             {
00090                 hr = e->HResult;
00091             }
00092             return hr;
00093         });
00094
00095         auto handler2 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00096             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* oven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00097         {
00098             HRESULT hr = S_OK;
00099             try
00100             {
00101                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00102                 OvenClientWRLOutput->Text += "Event Handler 2: Invoked\n";
00103             }
00104             catch (Platform::COMException^ e)
00105             {
00106                 hr = e->HResult;
00107             }
00108             return hr;
00109         });
00110
00111         auto handler3 = Callback<ABI::Windows::Foundation::ITypedEventHandler<ABI::Microsoft::SDKSamples::Kitchen::Oven*, ABI::Microsoft::SDKSamples::Kitchen::BreadBakedEventArgs*>>(
00112             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven* oven, ABI::Microsoft::SDKSamples::Kitchen::IBreadBakedEventArgs* args) -> HRESULT
00113         {
00114             // Event handler 3 was removed and will not be invoked
00115             HRESULT hr = S_OK;
00116             try
00117             {
00118                 // To append to the output text a C++\CX call is made. Catch any Windows Runtime exceptions and turn them into HRESULTS.
00119                 OvenClientWRLOutput->Text += "Event Handler 3: Invoked\n";
00120             }
00121             catch (Platform::COMException^ e)
00122             {
00123                 hr = e->HResult;
00124             }
00125             return hr;
00126         });
00127
00128         // Registering event listeners
00129         ::EventRegistrationToken token1;
00130         ::EventRegistrationToken token2;
00131         ::EventRegistrationToken token3;
00132         hr = _myOven->add_BreadBaked(handler1.Get(), &token1);
00133         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00134         hr = _myOven->add_BreadBaked(handler2.Get(), &token2);
00135         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00136         hr = _myOven->add_BreadBaked(handler3.Get(), &token3);
00137         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00138
00139         // Unregister from an event using the registration token
00140         hr = _myOven->remove_BreadBaked(token3);
00141         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00142
00143         // Bake a loaf of bread. This will trigger the BreadBaked event.
00144         hr = _myOven->BakeBread(HStringReference(L"Sourdough").Get());
00145         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00146
00147         // Trigger the event again with a different preheat time
00148         hr = _myOven->ConfigurePreheatTemperature(ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature_High);
00149         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00150
00151         hr = _myOven->BakeBread(HStringReference(L"Wheat").Get());
00152         if (FAILED(hr)) throw ref new Platform::COMException(hr);
00153     }
00154     catch (Platform::COMException^ e)
00155     {
00156         e->HResult;
00157     }
00158 }
00159
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario2_ChangePIN.xaml.cs Source File

  • SmartCard
  • cs

Scenario2_ChangePIN.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.SmartCards;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario2_ChangePIN : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         public Scenario2_ChangePIN()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         /// <summary>
00029         /// Click handler for the 'ChangePin' button.
00030         /// </summary>
00031         /// <param name="sender"></param>
00032         /// <param name="e"></param>
00033         private async void ChangePin_Click(object sender, RoutedEventArgs e)
00034         {
00035             if (!rootPage.ValidateTPMSmartCard())
00036             {
00037                 rootPage.NotifyUser("Use Scenario One to create a TPM virtual smart card.", NotifyType.ErrorMessage);
00038                 return;
00039             }
00040
00041             Button b = sender as Button;
00042             b.IsEnabled = false;
00043
00044             try
00045             {
00046                 SmartCard card = await rootPage.GetSmartCard();
00047                 SmartCardProvisioning provisioning = await SmartCardProvisioning.FromSmartCardAsync(card);
00048
00049                 rootPage.NotifyUser("Changing smart card PIN...", NotifyType.StatusMessage);
00050
00051                 bool result = await provisioning.RequestPinChangeAsync();
00052
00053                 if (result)
00054                 {
00055                     rootPage.NotifyUser("Smart card change PIN operation completed.", NotifyType.StatusMessage);
00056                 }
00057                 else
00058                 {
00059                     rootPage.NotifyUser("Smart card change PIN operation was canceled by the user.", NotifyType.StatusMessage);
00060                 }
00061             }
00062             catch (Exception ex)
00063             {
00064                 rootPage.NotifyUser("Changing smart card PIN failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
00065             }
00066             finally
00067             {
00068                 b.IsEnabled = true;
00069             }
00070         }
00071     }
00072 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario2_Scan.xaml.cs Source File

  • WiFiScan
  • cs

Scenario2_Scan.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.Devices.WiFi;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Navigation;
00017 using SDKTemplate;
00018 using System.Collections.ObjectModel;
00019
00020 namespace WiFiScan
00021 {
00022     public sealed partial class Scenario2_Scan : Page
00023     {
00024         private WiFiAdapter firstAdapter;
00025         MainPage rootPage;
00026         public ObservableCollection<WiFiNetworkDisplay> ResultCollection
00027         {
00028             get;
00029             private set;
00030         }
00031
00032         public Scenario2_Scan()
00033         {
00034             this.InitializeComponent();
00035         }
00036
00037         protected override async void OnNavigatedTo(NavigationEventArgs e)
00038         {
00039             ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
00040             rootPage = MainPage.Current;
00041
00042             // RequestAccessAsync must have been called at least once by the app before using the API
00043             // Calling it multiple times is fine but not necessary
00044             // RequestAccessAsync must be called from the UI thread
00045             var access = await WiFiAdapter.RequestAccessAsync();
00046             if (access != WiFiAccessStatus.Allowed)
00047             {
00048                 rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
00049             }
00050             else
00051             {
00052                 DataContext = this;
00053
00054                 var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
00055                 if (result.Count >= 1)
00056                 {
00057                     firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
00058
00059                     var button = new Button();
00060                     button.Content = string.Format("Scan");
00061                     button.Click += Button_Click;
00062                     Buttons.Children.Add(button);
00063                 }
00064                 else
00065                 {
00066                     rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
00067                 }
00068             }
00069         }
00070
00071         private async void Button_Click(object sender, RoutedEventArgs e)
00072         {
00073             await firstAdapter.ScanAsync();
00074             DisplayNetworkReport(firstAdapter.NetworkReport);
00075         }
00076
00077         private async void DisplayNetworkReport(WiFiNetworkReport report)
00078         {
00079             rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);
00080
00081             ResultCollection.Clear();
00082
00083             foreach (var network in report.AvailableNetworks)
00084             {
00085                 var networkDisplay = new WiFiNetworkDisplay(network, firstAdapter);
00086                 await networkDisplay.UpdateConnectivityLevel();
00087                 ResultCollection.Add(networkDisplay);
00088             }
00089         }
00090     }
00091 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMediaStream Member List

This is the complete list of members for CMediaStream, including all inherited members.
_cRef | CMediaStream | [private]
_dwId | CMediaStream | [private]
_eDropMode | CMediaStream | [private]
_eSourceState | CMediaStream | [private]
_fActive | CMediaStream | [private]
_fDiscontinuity | CMediaStream | [private]
_fDropTime | CMediaStream | [private]
_fInitDropTime | CMediaStream | [private]
_flRate | CMediaStream | [private]
_fVideo | CMediaStream | [private]
_fWaitingForCleanPoint | CMediaStream | [private]
_hnsAmountToDrop | CMediaStream | [private]
_hnsStartDroppingAt | CMediaStream | [private]
_samples | CMediaStream | [private]
_spEventQueue | CMediaStream | [private]
_spSource | CMediaStream | [private]
_spStreamDescriptor | CMediaStream | [private]
_tokens | CMediaStream | [private]
BeginGetEvent(IMFAsyncCallback *pCallback, IUnknown *punkState) | CMediaStream |
CheckShutdown() const | CMediaStream | [inline, private]
CleanSampleQueue() | CMediaStream | [private]
CMediaStream(CMediaSource *pSource) | CMediaStream | [protected]
CreateInstance(StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer, CMediaSource *pSource, CMediaStream **ppStream) | CMediaStream | [static]
DeliverSamples() | CMediaStream | [private]
DropTime(_In_ LONGLONG hnsAmountToDrop) | CMediaStream |
EndGetEvent(IMFAsyncResult *pResult, IMFMediaEvent **ppEvent) | CMediaStream |
Flush() | CMediaStream |
GetDropMode(_Out_ MF_QUALITY_DROP_MODE *peDropMode) | CMediaStream |
GetEvent(DWORD dwFlags, IMFMediaEvent **ppEvent) | CMediaStream |
GetId() const | CMediaStream | [inline]
GetMediaSource(IMFMediaSource **ppMediaSource) | CMediaStream |
GetQualityLevel(_Out_ MF_QUALITY_LEVEL *peQualityLevel) | CMediaStream |
GetService(_In_ REFGUID guidService, _In_ REFIID riid, _Out_ LPVOID *ppvObject) | CMediaStream |
GetState() const | CMediaStream | [inline]
GetStreamDescriptor(IMFStreamDescriptor **ppStreamDescriptor) | CMediaStream |
HandleError(HRESULT hErrorCode) | CMediaStream | [private]
IFACEMETHOD_(ULONG, AddRef)() | CMediaStream |
IFACEMETHOD_(ULONG, Release)() | CMediaStream |
Initialize(StspStreamDescription *pStreamDescription, Network::IBufferPacket *pAttributesBuffer) | CMediaStream | [private]
IsActive() const | CMediaStream | [inline]
NotifyQualityEvent(_In_opt_ IMFMediaEvent *pEvent, _Out_ DWORD *pdwFlags) | CMediaStream |
ProcessFormatChange(IMFMediaType *pMediaType) | CMediaStream |
ProcessSample(StspSampleHeader *pSampleHeader, IMFSample *pSample) | CMediaStream |
QueryInterface(REFIID iid, void **ppv) | CMediaStream |
QueueEvent(MediaEventType met, REFGUID guidExtendedType, HRESULT hrStatus, const PROPVARIANT *pvValue) | CMediaStream |
RequestSample(IUnknown *pToken) | CMediaStream |
ResetDropTime() | CMediaStream | [private]
SetActive(bool fActive) | CMediaStream |
SetDropMode(_In_ MF_QUALITY_DROP_MODE eDropMode) | CMediaStream |
SetQualityLevel(_In_ MF_QUALITY_LEVEL eQualityLevel) | CMediaStream |
SetRate(float flRate) | CMediaStream |
SetSampleAttributes(StspSampleHeader *pSampleHeader, IMFSample *pSample) | CMediaStream | [private]
ShouldDropSample(IMFSample *pSample) | CMediaStream | [private]
Shutdown() | CMediaStream |
Start() | CMediaStream |
Stop() | CMediaStream |
~CMediaStream(void) | CMediaStream | [protected]
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/pch.cpp Source File

  • ContentIndexer
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/HsaService.cpp Source File

  • CustomCapability
  • Service
  • Server

HsaService.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "stdafx.h"
00013
00014 #pragma region Includes
00015 #include <stdio.h>
00016 #include <windows.h>
00017 #include "ServiceInstaller.h"
00018 #include "ServiceBase.h"
00019 #include "SampleService.h"
00020 #pragma endregion
00021
00022 //
00023 // Settings of the service
00024 //
00025
00026 // Internal name of the service
00027 #define SERVICE_NAME             L"HsaService"
00028
00029 // Displayed name of the service
00030 #define SERVICE_DISPLAY_NAME     L"Hsa Sample Service"
00031
00032 // Service start options.
00033 #define SERVICE_START_TYPE       SERVICE_DEMAND_START
00034
00035 // List of service dependencies - "dep1\0dep2\0\0"
00036 #define SERVICE_DEPENDENCIES     L""
00037
00038 // The name of the account under which the service should run - NULL uses LocalSystem account.
00039 #define SERVICE_ACCOUNT          NULL
00040
00041 // The password to the service account name
00042 #define SERVICE_PASSWORD         NULL
00043
00044
00045 //
00046 //  FUNCTION: wmain(int, wchar_t *[])
00047 //
00048 //  PURPOSE: entrypoint for the application.
00049 //
00050 //  PARAMETERS:
00051 //    argc - number of command line arguments
00052 //    argv - array of command line arguments
00053 //
00054 //  RETURN VALUE:
00055 //    none
00056 //
00057 //  COMMENTS:
00058 //    wmain() either performs the command line task, or run the service.
00059 //
00060 int wmain(_In_ int argc, _In_ wchar_t *argv[])
00061 {
00062     bool invalidArgs = false;
00063
00064     if ((argc > 1) && ((*argv[1] == L'-' || (*argv[1] == L'/'))))
00065     {
00066         if (_wcsicmp(L"install", argv[1] + 1) == 0)
00067         {
00068             // Install the service when the command is
00069             // "-install" or "/install".
00070             InstallService(
00071                 SERVICE_NAME,               // Name of service
00072                 SERVICE_DISPLAY_NAME,       // Name to display
00073                 SERVICE_START_TYPE,         // Service start type
00074                 SERVICE_DEPENDENCIES,       // Dependencies
00075                 SERVICE_ACCOUNT,            // Service running account
00076                 SERVICE_PASSWORD            // Password of the account
00077             );
00078         }
00079         else if (_wcsicmp(L"remove", argv[1] + 1) == 0)
00080         {
00081             // Uninstall the service when the command is
00082             // "-remove" or "/remove".
00083             UninstallService(SERVICE_NAME);
00084         }
00085         else if (_wcsicmp(L"console", argv[1] + 1) == 0)
00086         {
00087             // Uninstall the service when the command is
00088             // "-remove" or "/remove".
00089             CSampleService service(SERVICE_NAME);
00090             service.ConsoleRun();
00091         }
00092         else
00093         {
00094             invalidArgs = true;
00095         }
00096     }
00097     else
00098     {
00099         invalidArgs = true;
00100         CSampleService service(SERVICE_NAME);
00101         if (!CServiceBase::Run(service))
00102         {
00103             wprintf(L"Service failed to run w/err 0x%08lx\n", GetLastError());
00104         }
00105     }
00106
00107     if (invalidArgs)
00108     {
00109         wprintf(L"Parameters:\n");
00110         wprintf(L" -install  to install the service.\n");
00111         wprintf(L" -remove   to remove the service.\n");
00112         wprintf(L" -console  to run in console mode.\n");
00113     }
00114
00115     return 0;
00116 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_SupportedTactileFeedback Member List

This is the complete list of members for Scenario2_SupportedTactileFeedback, including all inherited members.
hapticsController | Scenario2_SupportedTactileFeedback | [private]
penDevice | Scenario2_SupportedTactileFeedback | [private]
Pointer_Entered(object sender, PointerRoutedEventArgs e) | Scenario2_SupportedTactileFeedback | [inline, private]
Pointer_Exited(object sender, PointerRoutedEventArgs e) | Scenario2_SupportedTactileFeedback | [inline, private]
Scenario2_SupportedTactileFeedback() | Scenario2_SupportedTactileFeedback | [inline]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ChangeSystemGroup Member List

This is the complete list of members for Scenario4_ChangeSystemGroup, including all inherited members.
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario4_ChangeSystemGroup
PrepareSampleFiles_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_ChangeSystemGroup
Scenario4_ChangeSystemGroup() | Scenario4_ChangeSystemGroup
SystemGroup_Frequent_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_ChangeSystemGroup
SystemGroup_None_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_ChangeSystemGroup
SystemGroup_Recent_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario4_ChangeSystemGroup
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleImaging/cs/Helpers.cs Source File

  • SimpleImaging
  • cs

Helpers.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using Windows.Graphics.Imaging;
00014 using Windows.Storage.FileProperties;
00015
00016 namespace SimpleImaging
00017 {
00018     /// <summary>
00019     /// Contains helper functionality, including handling/converting EXIF orientation values.
00020     /// </summary>
00021     public static class Helpers
00022     {
00023         /// <summary>
00024         /// Retrieves all of the file extensions supported by the bitmap codecs on the system,
00025         /// and inserts them into the provided fileTypeFilter parameter.
00026         /// </summary>
00027         /// <param name="fileTypeFilter">FileOpenPicker.FileTypeFilter member</param>
00028         public static void FillDecoderExtensions(IList<string> fileTypeFilter)
00029         {
00030             IReadOnlyList<BitmapCodecInformation> codecInfoList =
00031                 BitmapDecoder.GetDecoderInformationEnumerator();
00032
00033             foreach (BitmapCodecInformation decoderInfo in codecInfoList)
00034             {
00035                 // Each bitmap codec contains a list of file extensions it supports; add each
00036                 // list item to fileTypeFilter.
00037                 foreach (string extension in decoderInfo.FileExtensions)
00038                 {
00039                     fileTypeFilter.Add(extension);
00040                 }
00041             }
00042         }
00043
00044         /// <summary>
00045         /// Converts a PhotoOrientation value into a human-readable string.
00046         /// The text is adapted from the EXIF specification.
00047         /// Note that PhotoOrientation uses a counterclockwise convention,
00048         /// while the EXIF spec uses a clockwise convention.
00049         /// </summary>
00050         public static string GetOrientationString(PhotoOrientation input)
00051         {
00052             switch (input)
00053             {
00054                 case PhotoOrientation.Normal:
00055                     return "No rotation";
00056                 case PhotoOrientation.FlipHorizontal:
00057                     return "Flip horizontally";
00058                 case PhotoOrientation.Rotate180:
00059                     return "Rotate 180˚ clockwise";
00060                 case PhotoOrientation.FlipVertical:
00061                     return "Flip vertically";
00062                 case PhotoOrientation.Transpose:
00063                     return "Rotate 270˚ clockwise, then flip horizontally";
00064                 case PhotoOrientation.Rotate270:
00065                     return "Rotate 90˚ clockwise";
00066                 case PhotoOrientation.Transverse:
00067                     return "Rotate 90˚ clockwise, then flip horizontally";
00068                 case PhotoOrientation.Rotate90:
00069                     return "Rotate 270˚ clockwise";
00070                 case PhotoOrientation.Unspecified:
00071                 default:
00072                     return "Unspecified";
00073             }
00074         }
00075
00076         /// <summary>
00077         /// Converts a Windows.Storage.FileProperties.PhotoOrientation value into a
00078         /// Windows.Graphics.Imaging.BitmapRotation value.
00079         /// For PhotoOrientation values reflecting a flip/mirroring operation, returns "None";
00080         /// therefore this is a potentially lossy transformation.
00081         /// Note that PhotoOrientation uses a counterclockwise convention,
00082         /// while BitmapRotation uses a clockwise convention.
00083         /// </summary>
00084         public static BitmapRotation ConvertToBitmapRotation(PhotoOrientation input)
00085         {
00086             switch (input)
00087             {
00088                 case PhotoOrientation.Normal:
00089                     return BitmapRotation.None;
00090                 case PhotoOrientation.Rotate270:
00091                     return BitmapRotation.Clockwise90Degrees;
00092                 case PhotoOrientation.Rotate180:
00093                     return BitmapRotation.Clockwise180Degrees;
00094                 case PhotoOrientation.Rotate90:
00095                     return BitmapRotation.Clockwise270Degrees;
00096                 default:
00097                     // Ignore any flip/mirrored values.
00098                     return BitmapRotation.None;
00099             }
00100         }
00101
00102         /// <summary>
00103         /// Converts a Windows.Graphics.Imaging.BitmapRotation value into a
00104         /// Windows.Storage.FileProperties.PhotoOrientation value.
00105         /// Note that PhotoOrientation uses a counterclockwise convention,
00106         /// while BitmapRotation uses a clockwise convention.
00107         /// </summary>
00108         public static PhotoOrientation ConvertToPhotoOrientation(BitmapRotation input)
00109         {
00110             switch (input)
00111             {
00112                 case BitmapRotation.None:
00113                     return PhotoOrientation.Normal;
00114                 case BitmapRotation.Clockwise90Degrees:
00115                     return PhotoOrientation.Rotate270;
00116                 case BitmapRotation.Clockwise180Degrees:
00117                     return PhotoOrientation.Rotate180;
00118                 case BitmapRotation.Clockwise270Degrees:
00119                     return PhotoOrientation.Rotate90;
00120                 default:
00121                     return PhotoOrientation.Normal;
00122             }
00123         }
00124
00125         /// <summary>
00126         /// Converts an unsigned integer, corresponding to the EXIF orientation flag, to a
00127         /// Windows.Storage.FileProperties.PhotoOrientation value. Note that the actual
00128         /// PhotoOrientation enumeration values directly map to the EXIF orientation flag;
00129         /// this method simply provides a typesafe means of converting between the two in C#,
00130         /// in addition to handling the Unspecified case.
00131         /// </summary>
00132         public static PhotoOrientation ConvertToPhotoOrientation(ushort input)
00133         {
00134             switch (input)
00135             {
00136                 case 1:
00137                     return PhotoOrientation.Normal;
00138                 case 2:
00139                     return PhotoOrientation.FlipHorizontal;
00140                 case 3:
00141                     return PhotoOrientation.Rotate180;
00142                 case 4:
00143                     return PhotoOrientation.FlipVertical;
00144                 case 5:
00145                     return PhotoOrientation.Transpose;
00146                 case 6:
00147                     return PhotoOrientation.Rotate270;
00148                 case 7:
00149                     return PhotoOrientation.Transverse;
00150                 case 8:
00151                     return PhotoOrientation.Rotate90;
00152                 default:
00153                     return PhotoOrientation.Unspecified;
00154             }
00155         }
00156
00157         /// <summary>
00158         /// Counterpart to ConvertToPhotoOrientation(ushort input), maps PhotoOrientation enum
00159         /// values to an unsigned 16-bit integer representing the EXIF orientation flag.
00160         /// </summary>
00161         public static ushort ConvertToExifOrientationFlag(PhotoOrientation input)
00162         {
00163             switch (input)
00164             {
00165                 case PhotoOrientation.Normal:
00166                     return 1;
00167                 case PhotoOrientation.FlipHorizontal:
00168                     return 2;
00169                 case PhotoOrientation.Rotate180:
00170                     return 3;
00171                 case PhotoOrientation.FlipVertical:
00172                     return 4;
00173                 case PhotoOrientation.Transpose:
00174                     return 5;
00175                 case PhotoOrientation.Rotate270:
00176                     return 6;
00177                 case PhotoOrientation.Transverse:
00178                     return 7;
00179                 case PhotoOrientation.Rotate90:
00180                     return 8;
00181                 default:
00182                     return 1;
00183             }
00184         }
00185
00186         /// <summary>
00187         /// "Adds" two PhotoOrientation values. For simplicity, does not handle any values with
00188         /// flip/mirroring; therefore this is a potentially lossy transformation.
00189         /// Note that PhotoOrientation uses a counterclockwise convention.
00190         /// </summary>
00191         public static PhotoOrientation AddPhotoOrientation(
00192             PhotoOrientation value1,
00193             PhotoOrientation value2
00194             )
00195         {
00196             switch (value2)
00197             {
00198                 case PhotoOrientation.Rotate90:
00199                     return Add90DegreesCCW(value1);
00200                 case PhotoOrientation.Rotate180:
00201                     return Add90DegreesCCW(Add90DegreesCCW(value1));
00202                 case PhotoOrientation.Rotate270:
00203                     return Add90DegreesCW(value1);
00204                 case PhotoOrientation.Normal:
00205                 default:
00206                     // Ignore any values with flip/mirroring.
00207                     return value1;
00208             }
00209         }
00210
00211         /// <summary>
00212         /// "Add" 90 degrees clockwise rotation to a PhotoOrientation value.
00213         /// For simplicity, does not handle any values with flip/mirroring; therefore this can be
00214         /// a lossy transformation.
00215         /// Note that PhotoOrientation uses a counterclockwise convention.
00216         /// </summary>
00217         public static PhotoOrientation Add90DegreesCW(PhotoOrientation input)
00218         {
00219             switch (input)
00220             {
00221                 case PhotoOrientation.Normal:
00222                     return PhotoOrientation.Rotate270;
00223                 case PhotoOrientation.Rotate90:
00224                     return PhotoOrientation.Normal;
00225                 case PhotoOrientation.Rotate180:
00226                     return PhotoOrientation.Rotate90;
00227                 case PhotoOrientation.Rotate270:
00228                     return PhotoOrientation.Rotate180;
00229                 default:
00230                     // Ignore any values with flip/mirroring.
00231                     return PhotoOrientation.Unspecified;
00232             }
00233         }
00234
00235         /// <summary>
00236         /// "Add" 90 degrees counter-clockwise rotation to a PhotoOrientation value.
00237         /// For simplicity, does not handle any values with flip/mirroring; therefore this can be
00238         /// a lossy transformation.
00239         /// Note that PhotoOrientation uses a counterclockwise convention.
00240         /// </summary>
00241         public static PhotoOrientation Add90DegreesCCW(PhotoOrientation input)
00242         {
00243             switch (input)
00244             {
00245                 case PhotoOrientation.Normal:
00246                     return PhotoOrientation.Rotate90;
00247                 case PhotoOrientation.Rotate90:
00248                     return PhotoOrientation.Rotate180;
00249                 case PhotoOrientation.Rotate180:
00250                     return PhotoOrientation.Rotate270;
00251                 case PhotoOrientation.Rotate270:
00252                     return PhotoOrientation.Normal;
00253                 default:
00254                     // Ignore any values with flip/mirroring.
00255                     return PhotoOrientation.Unspecified;
00256             }
00257         }
00258     }
00259 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/SampleConfiguration.h Source File

  • Calendar
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/SampleConfiguration.h Source File

  • CashDrawer
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Cash Drawer";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047
00048     namespace DeviceHelpers
00049     {
00050         // By default, use all connections types.
00051         Concurrency::task<Windows::Devices::PointOfService::CashDrawer^> GetFirstCashDrawerAsync(
00052             Windows::Devices::PointOfService::PosConnectionTypes connectionTypes = Windows::Devices::PointOfService::PosConnectionTypes::All);
00053     }
00054 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RegisterMessage Member List

This is the complete list of members for RegisterMessage, including all inherited members.
DeviceName | RegisterMessage
PublicKey | RegisterMessage
UserId | RegisterMessage
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario12_DisableCookies.cpp Source File

  • HttpClient
  • cppwinrt

Scenario12_DisableCookies.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario12_DisableCookies.h"
00014 #include "Scenario12_DisableCookies.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include "Helpers.h"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::Windows::Web::Http;
00023 using namespace winrt::Windows::Web::Http::Filters;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario12_DisableCookies::Scenario12_DisableCookies()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario12_DisableCookies::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         filter = HttpBaseProtocolFilter();
00035         httpClient = HttpClient(filter);
00036     }
00037
00038     void Scenario12_DisableCookies::OnNavigatedFrom(NavigationEventArgs const&)
00039     {
00040         httpClient.Close();
00041         filter.Close();
00042     }
00043
00044     fire_and_forget Scenario12_DisableCookies::SendInitialGetButton_Click(IInspectable const&, RoutedEventArgs const&)
00045     {
00046         auto lifetime = get_strong();
00047
00048         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00049         // valid, absolute URI, we'll notify the user about the incorrect input.
00050         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00051         if (!resourceUri)
00052         {
00053             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00054             return;
00055         }
00056
00057         Helpers::ScenarioStarted(SendInitialGetButton(), CancelButton(), OutputField());
00058         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00059
00060         // This sample uses a "try" in order to support cancellation.
00061         // If you don't need to support cancellation, then the "try" is not needed.
00062         try
00063         {
00064             pendingAction = CancelableInitialRequestAsync(resourceUri);
00065             co_await pendingAction;
00066         }
00067         catch (hresult_canceled const&)
00068         {
00069             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00070         }
00071
00072         Helpers::ScenarioCompleted(SendInitialGetButton(), CancelButton());
00073     }
00074
00075     IAsyncAction Scenario12_DisableCookies::CancelableInitialRequestAsync(Uri resourceUri)
00076     {
00077         auto lifetime = get_strong();
00078         auto cancellation = co_await get_cancellation_token();
00079         cancellation.enable_propagation();
00080
00081         HttpRequestResult result = co_await httpClient.TryGetAsync(resourceUri);
00082
00083         if (result.Succeeded())
00084         {
00085             std::wostringstream output;
00086
00087             HttpCookieCollection cookieCollection = filter.CookieManager().GetCookies(resourceUri);
00088             output << cookieCollection.Size() << L" cookies found.\n";
00089             for (HttpCookie cookie : cookieCollection)
00090             {
00091                 output
00092                     << L"--------------------\n"
00093                     << L"Name: " << std::wstring_view(cookie.Name()) << L"\n"
00094                     << L"Domain: " << std::wstring_view(cookie.Domain()) << L"\n"
00095                     << L"Path: " << std::wstring_view(cookie.Path()) << L"\n"
00096                     << L"Value: " << std::wstring_view(cookie.Value()) << L"\n";
00097                 if (auto expires = cookie.Expires())
00098                 {
00099                     output << L"Expires: " << std::wstring_view(Helpers::ToSimpleString(expires.Value())) << L"\n";
00100                 }
00101                 output
00102                     << L"Secure: " << cookie.Secure() << L"\n"
00103                     << L"HttpOnly: " << cookie.HttpOnly() << L"\n";
00104             }
00105             OutputField().Text(output.str());
00106
00107             SendNextRequestButton().IsEnabled(true);
00108         }
00109         else
00110         {
00111             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00112         }
00113     }
00114
00115     fire_and_forget Scenario12_DisableCookies::SendNextRequestButton_Click(IInspectable const&, RoutedEventArgs const&)
00116     {
00117         auto lifetime = get_strong();
00118
00119         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00120         // valid, absolute URI, we'll notify the user about the incorrect input.
00121         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00122         if (!resourceUri)
00123         {
00124             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00125             return;
00126         }
00127
00128         Helpers::ScenarioStarted(SendNextRequestButton(), CancelButton(), OutputField());
00129         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00130
00131         if (CookieUsageBehaviorToggle().IsOn())
00132         {
00133             filter.CookieUsageBehavior(HttpCookieUsageBehavior::Default);
00134         }
00135         else
00136         {
00137             // Disable cookie handling - this will do two things: no cookies are attached to outgoing request, and
00138             // cookies contained in incoming server responses are not added to the CookieManager of the HttpBaseProtocolFilter.
00139             filter.CookieUsageBehavior(HttpCookieUsageBehavior::NoCookies);
00140         }
00141
00142         // This sample uses a "try" in order to support cancellation.
00143         // If you don't need to support cancellation, then the "try" is not needed.
00144         try
00145         {
00146             pendingAction = CancelableNextRequestAsync(resourceUri);
00147             co_await pendingAction;
00148         }
00149         catch (hresult_canceled const&)
00150         {
00151             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00152         }
00153
00154         Helpers::ScenarioCompleted(SendNextRequestButton(), CancelButton());
00155     }
00156
00157     IAsyncAction Scenario12_DisableCookies::CancelableNextRequestAsync(Uri resourceUri)
00158     {
00159         auto lifetime = get_strong();
00160         auto cancellation = co_await get_cancellation_token();
00161         cancellation.enable_propagation();
00162
00163         HttpRequestResult result = co_await httpClient.TryGetAsync(resourceUri);
00164
00165         if (result.Succeeded())
00166         {
00167             co_await Helpers::DisplayTextResultAsync(result.ResponseMessage(), OutputField());
00168
00169             rootPage.NotifyUser(L"Completed. Response came from " +
00170                 to_hstring(result.ResponseMessage().Source()) + L".",
00171                 NotifyType::StatusMessage);
00172         }
00173         else
00174         {
00175             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00176         }
00177     }
00178
00179     void Scenario12_DisableCookies::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00180     {
00181         if (pendingAction)
00182         {
00183             pendingAction.Cancel();
00184         }
00185     }
00186 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Default/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Default

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.Branding.Default
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
00017             string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";
00018
00019             updateFourTilesControl.SetTilePayload($@"
00020                 <tile>
00021                     <visual>
00022
00023                         <binding template='TileSmall'>
00024                             <text>default</text>
00025                             {fillerText}
00026                         </binding>
00027
00028                         <binding template='TileMedium'>
00029                             <text hint-wrap='true'>branding: default</text>
00030                             {fillerText}
00031                         </binding>
00032
00033                         <binding template='TileWide'>
00034                             <text hint-wrap='true'>branding: default</text>
00035                             {fillerText}
00036                         </binding>
00037
00038                         <binding template='TileLarge'>
00039                             <text hint-wrap='true'>branding: default</text>
00040                             {fillerText}
00041                         </binding>
00042
00043                     </visual>
00044                 </tile>");
00045         }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaTypeValidationDescriptor Member List

This is the complete list of members for MediaTypeValidationDescriptor, including all inherited members.
attributes | MediaTypeValidationDescriptor
cAttributes | MediaTypeValidationDescriptor
fVideo | MediaTypeValidationDescriptor
guidSubtype | MediaTypeValidationDescriptor
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario1_Download.xaml.cpp Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario1_Download.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_Download.xaml.cpp
00014 // Implementation of the Scenario1_Download class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_Download.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Platform::Collections;
00025 using namespace SDKTemplate;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030 using namespace Windows::Networking::BackgroundTransfer;
00031 using namespace Windows::Web;
00032 using namespace Windows::Foundation;
00033 using namespace Windows::Foundation::Collections;
00034 using namespace Windows::Storage;
00035
00036 Scenario1_Download::Scenario1_Download()
00037 {
00038     InitializeComponent();
00039     cancellationToken = new cancellation_token_source();
00040 }
00041
00042 Scenario1_Download::~Scenario1_Download()
00043 {
00044     if (cancellationToken != nullptr)
00045     {
00046         delete cancellationToken;
00047     }
00048 }
00049
00050 /// <summary>
00051 /// Invoked when this page is about to be displayed in a Frame.
00052 /// </summary>
00053 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00054 /// property is typically used to configure the page.</param>
00055 void Scenario1_Download::OnNavigatedTo(NavigationEventArgs^ e)
00056 {
00057     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00058     // as NotifyUser()
00059     rootPage = MainPage::Current;
00060     DiscoverActiveDownloads();
00061 }
00062
00063 // Enumerate the downloads that were going on in the background while the app was closed.
00064 void Scenario1_Download::DiscoverActiveDownloads()
00065 {
00066     create_task(BackgroundDownloader::GetCurrentDownloadsAsync()).then([this] (IVectorView<DownloadOperation^>^ downloads)
00067     {
00068         Log("Loading background downloads: " + downloads->Size);
00069
00070         for (unsigned int i = 0; i < downloads->Size; i++)
00071         {
00072             DownloadOperation^ download = downloads->GetAt(i);
00073             Log("Discovered background download: " + download->Guid + ", Status: " + download->Progress.Status.ToString());
00074
00075             // Attach progress and completion handlers.
00076             HandleDownloadAsync(download, false);
00077         }
00078     }).then([this] (task<void> previousTask)
00079     {
00080         try
00081         {
00082             previousTask.get();
00083         }
00084         catch (Exception^ ex)
00085         {
00086             LogException("Discovery error", ex);
00087         }
00088     });
00089 }
00090
00091 void Scenario1_Download::HandleDownloadAsync(DownloadOperation^ download, boolean start)
00092 {
00093     IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ async;
00094     activeDownloads[download->Guid.GetHashCode()] = download;
00095
00096     LogStatus("Running: " + download->Guid, NotifyType::StatusMessage);
00097
00098     if (start)
00099     {
00100         async = download->StartAsync();
00101     }
00102     else
00103     {
00104         async = download->AttachAsync();
00105     }
00106
00107     async->Progress = ref new AsyncOperationProgressHandler<DownloadOperation^, DownloadOperation^>(this, &Scenario1_Download::DownloadProgress);
00108     create_task(async, cancellationToken->get_token()).then([this] (DownloadOperation^ download)
00109     {
00110         ResponseInformation^ response = download->GetResponseInformation();
00111
00112         // GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
00113         String^ statusCode = response != nullptr ? response->StatusCode.ToString() : "";
00114
00115         LogStatus("Completed: " + download->Guid + ", Status Code: " + statusCode, NotifyType::StatusMessage);
00116     }).then([this, download] (task<void> previousTask)
00117     {
00118         try
00119         {
00120             previousTask.get();
00121         }
00122         catch (Exception^ ex)
00123         {
00124             LogException("Handle download", ex);
00125         }
00126         catch (const task_canceled&)
00127         {
00128             LogStatus("Canceled: " + download->Guid, NotifyType::StatusMessage);
00129         }
00130
00131         // It is important to note, that this method executes on UI thread. This guarantees that
00132         // access to the activeDownloads is synchronized.
00133         activeDownloads.erase(download->Guid.GetHashCode());
00134     });
00135 }
00136
00137 void Scenario1_Download::DownloadProgress(IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ operation, DownloadOperation^ download)
00138 {
00139     // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00140     // we must make a local copy so that we can have a consistent view of that ever-changing state
00141     // throughout this method's lifetime.
00142     BackgroundDownloadProgress currentProgress = download->Progress;
00143
00144     MarshalLog("Progress: " + download->Guid + ", Status: " + currentProgress.Status.ToString());
00145
00146     UINT64 percent = 0;
00147     if (currentProgress.TotalBytesToReceive > 0)
00148     {
00149         percent = currentProgress.BytesReceived * 100 / currentProgress.TotalBytesToReceive;
00150     }
00151
00152     MarshalLog(" - Transfered bytes: " + currentProgress.BytesReceived + " of " +
00153         currentProgress.TotalBytesToReceive + ", " + percent + "%");
00154
00155     if (currentProgress.HasRestarted)
00156     {
00157         MarshalLog(" - Download restarted");
00158     }
00159
00160     if (currentProgress.HasResponseChanged)
00161     {
00162         // We have received new response headers from the server.
00163         // Be aware that GetResponseInformation() returns null for non-HTTP transfers (e.g., FTP).
00164         ResponseInformation^ response = download->GetResponseInformation();
00165         int headersCount = response != nullptr ? response->Headers->Size : 0;
00166
00167         MarshalLog(" - Response updated; Header count: " + headersCount);
00168
00169         // If you want to stream the response data this is a good time to start.
00170         // download->GetResultStreamAt(0);
00171     }
00172 }
00173
00174 void Scenario1_Download::StartDownload(BackgroundTransferPriority priority)
00175 {
00176     // By default 'serverAddressField' is disabled and URI validation is not required. When enabling the text box
00177     // validating the URI is required since it was received from an untrusted source (user input).
00178     // The URI is validated by calling TryGetUri() that will return 'false' for strings that are not valid URIs.
00179     // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require the
00180     // "Private Networks (Client and Server)" capability.
00181     Uri^ source;
00182     if (!rootPage->TryGetUri(serverAddressField->Text, &source))
00183     {
00184         return;
00185     }
00186
00187     String^ destination = StringTrimmer::Trim(fileNameField->Text);
00188
00189     if (destination == "")
00190     {
00191         rootPage->NotifyUser("A local file name is required.", NotifyType::ErrorMessage);
00192         return;
00193     }
00194
00195     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
00196         .then([destination](StorageFolder^ picturesLibrary)
00197     {
00198         return picturesLibrary->CreateFileAsync(destination, CreationCollisionOption::GenerateUniqueName);
00199     }).then([this, source, priority] (StorageFile^ destinationFile)
00200     {
00201         BackgroundDownloader^ downloader = ref new BackgroundDownloader();
00202         DownloadOperation^ download = downloader->CreateDownload(source, destinationFile);
00203
00204         Log("Downloading " + source->AbsoluteUri + " to " + destinationFile->Name + " with " +
00205             ((priority == BackgroundTransferPriority::Default) ? "default" : "high") +
00206             " priority, " + download->Guid);
00207
00208         download->Priority = priority;
00209
00210         // Attach progress and completion handlers.
00211         HandleDownloadAsync(download, true);
00212     }).then([this] (task<void> previousTask)
00213     {
00214         try
00215         {
00216             previousTask.get();
00217         }
00218         catch (Exception^ ex)
00219         {
00220             LogException("Error", ex);
00221         }
00222     });
00223 }
00224
00225 void Scenario1_Download::StartDownload_Click(Object^ sender, RoutedEventArgs^ e)
00226 {
00227     StartDownload(BackgroundTransferPriority::Default);
00228 }
00229
00230 void Scenario1_Download::StartHighPriorityDownload_Click(Object^ sender, RoutedEventArgs^ e)
00231 {
00232     StartDownload(BackgroundTransferPriority::High);
00233 }
00234
00235 void Scenario1_Download::PauseAll_Click(Object^ sender, RoutedEventArgs^ e)
00236 {
00237     Log("Downloads: " + activeDownloads.size());
00238     for (auto iterator = activeDownloads.begin(); iterator != activeDownloads.end(); iterator++)
00239     {
00240         DownloadOperation^ download = iterator->second;
00241
00242         // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00243         // we must make a local copy so that we can have a consistent view of that ever-changing state
00244         // throughout this method's lifetime.
00245         BackgroundDownloadProgress currentProgress = download->Progress;
00246
00247         if (currentProgress.Status == BackgroundTransferStatus::Running)
00248         {
00249             download->Pause();
00250             Log("Paused: " + download->Guid);
00251         }
00252         else
00253         {
00254             Log("Skipped: " + download->Guid + ", Status: " + currentProgress.Status.ToString());
00255         }
00256     }
00257 }
00258
00259 void Scenario1_Download::ResumeAll_Click(Object^ sender, RoutedEventArgs^ e)
00260 {
00261     Log("Downloads: " + activeDownloads.size());
00262     for (auto iterator = activeDownloads.begin(); iterator != activeDownloads.end(); iterator++)
00263     {
00264         DownloadOperation^ download = iterator->second;
00265
00266         // DownloadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00267         // we must make a local copy so that we can have a consistent view of that ever-changing state
00268         // throughout this method's lifetime.
00269         BackgroundDownloadProgress currentProgress = download->Progress;
00270
00271         if (currentProgress.Status == BackgroundTransferStatus::PausedByApplication)
00272         {
00273             download->Resume();
00274             Log("Resumed: " + download->Guid);
00275         }
00276         else
00277         {
00278             Log("Skipped: " + download->Guid + ", Status: " + currentProgress.Status.ToString());
00279         }
00280     }
00281 }
00282
00283 void Scenario1_Download::CancelAll_Click(Object^ sender, RoutedEventArgs^ e)
00284 {
00285     Log("Cancelling Downloads: " + activeDownloads.size());
00286
00287     cancellationToken->cancel();
00288     cancellationToken = new cancellation_token_source();
00289     activeDownloads.clear();
00290 }
00291
00292 void Scenario1_Download::LogException(String^ title, Exception^ ex)
00293 {
00294     WebErrorStatus error = BackgroundTransferError::GetStatus(ex->HResult);
00295     if (error == WebErrorStatus::Unknown)
00296     {
00297         LogStatus(title + ": " + ex, NotifyType::ErrorMessage);
00298     }
00299     else
00300     {
00301         LogStatus(title + ": " + error.ToString(), NotifyType::ErrorMessage);
00302     }
00303 }
00304
00305 // When operations happen on a background thread we have to marshal UI updates back to the UI thread.
00306 void Scenario1_Download::MarshalLog(String^ value)
00307 {
00308     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, value] ()
00309     {
00310         Log(value);
00311     }));
00312 }
00313
00314 void Scenario1_Download::Log(String^ message)
00315 {
00316     outputField->Text += message + "\r\n";
00317 }
00318
00319 void Scenario1_Download::LogStatus(String^ message, NotifyType type)
00320 {
00321     rootPage->NotifyUser(message, type);
00322     outputField->Text += message + "\r\n";
00323 }
Generated on Fri Nov 15 2024 22:18:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cppwinrt/Scenario1_Toggle.cpp Source File

  • RadioManager
  • cppwinrt

Scenario1_Toggle.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "RadioModel.h"
00014 #include "Scenario1_Toggle.h"
00015 #include "Scenario1_Toggle.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Devices::Radios;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario1_Toggle::Scenario1_Toggle()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     fire_and_forget Scenario1_Toggle::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         // RequestAccessAsync must be called at least one from the UI thread.
00033         RadioAccessStatus accessLevel = co_await Radio::RequestAccessAsync();
00034         if (accessLevel != RadioAccessStatus::Allowed)
00035         {
00036             rootPage.NotifyUser(L"App is not allowed to control radios.", NotifyType::ErrorMessage);
00037         }
00038         else
00039         {
00040             // An alternative to Radio.GetRadiosAsync is to use the Windows.Devices.Enumeration pattern,
00041             // passing Radio.GetDeviceSelector as the AQS string.
00042             for (Radio radio : co_await Radio::GetRadiosAsync())
00043             {
00044                 RadioSwitchList().Items().Append(make<RadioModel>(radio, Dispatcher()));
00045             }
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario4_SeekerSession.xaml.h Source File

  • WiFiDirectServices
  • cpp

Scenario4_SeekerSession.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_SeekerSession.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     namespace WiFiDirectServices
00019     {
00020         /// <summary>
00021         /// UI that shows connected Wi-Fi Direct service sessions and allows a user to choose one to close or interact with
00022         ///
00023         /// Most of the actual logic for Wi-Fi Direct Services is in WiFiDirectServicesManager.h/cpp and WiFiDirectServicesWrappers.h/cpp
00024         /// </summary>
00025         [Windows::Foundation::Metadata::WebHostHidden]
00026         public ref class Scenario4 sealed
00027         {
00028         public:
00029             Scenario4();
00030
00031             void AddSession(SessionWrapper^ session);
00032
00033             void RemoveSession(unsigned int index);
00034
00035         protected:
00036             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038             virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00039
00040         private:
00041             SDKTemplate::MainPage^ _rootPage;
00042             std::mutex _mutex;
00043
00044             void SelectSession_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045
00046             void CloseSession_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         };
00048     }
00049 }
Generated on Fri Nov 15 2024 22:22:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/pch.h Source File

  • TextSuggestion
  • cpp

pch.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include <collection.h>
00006 #include <ppltasks.h>
00007
00008 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cs/Scenario1_BasicFunctionality.xaml.cs Source File

  • BarcodeScanner
  • cs

Scenario1_BasicFunctionality.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using Windows.Devices.PointOfService;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario1_BasicFunctionality : Page
00027     {
00028         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00029         // as NotifyUser()
00030         MainPage rootPage = MainPage.Current;
00031
00032         BarcodeScanner scanner = null;
00033         ClaimedBarcodeScanner claimedScanner = null;
00034
00035         public Scenario1_BasicFunctionality()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Invoked when this page is about to be displayed in a Frame.
00042         /// </summary>
00043         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00044         /// property is typically used to configure the page.</param>
00045         protected override void OnNavigatedTo(NavigationEventArgs e)
00046         {
00047             ResetTheScenarioState();
00048         }
00049
00050         /// <summary>
00051         /// Invoked when this page is no longer displayed.
00052         /// </summary>
00053         /// <param name="e">Event data that describes how this page was exited.  The Parameter
00054         /// property is typically used to configure the page.</param>
00055         protected override void OnNavigatedFrom(NavigationEventArgs e)
00056         {
00057             ResetTheScenarioState();
00058         }
00059
00060         /// <summary>
00061         /// Event Handler for Start Scan Button Click.
00062         /// Sets up the barcode scanner to be ready to receive the data events from the scan.
00063         /// </summary>
00064         /// <param name="sender"></param>
00065         /// <param name="e"></param>
00066         private async void ScenarioStartScanButton_Click(object sender, RoutedEventArgs e)
00067         {
00068             ScenarioStartScanButton.IsEnabled = false;
00069
00070             rootPage.NotifyUser("Acquiring barcode scanner object.", NotifyType.StatusMessage);
00071
00072             // Acquire the barcode scanner.
00073             scanner = await DeviceHelpers.GetFirstBarcodeScannerAsync();
00074             if (scanner != null)
00075             {
00076                 // after successful creation, claim the scanner for exclusive use and enable it so that data reveived events are received.
00077                 claimedScanner = await scanner.ClaimScannerAsync();
00078
00079                 if (claimedScanner != null)
00080                 {
00081                     // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
00082                     // claim ownership of the barcode scanner.
00083                     claimedScanner.ReleaseDeviceRequested += claimedScanner_ReleaseDeviceRequested;
00084
00085                     // after successfully claiming, attach the datareceived event handler.
00086                     claimedScanner.DataReceived += claimedScanner_DataReceived;
00087
00088                     // Ask the API to decode the data by default. By setting this, API will decode the raw data from the barcode scanner and
00089                     // send the ScanDataLabel and ScanDataType in the DataReceived event
00090                     claimedScanner.IsDecodeDataEnabled = true;
00091
00092                     // enable the scanner.
00093                     // The scanner must be enabled in order to receive the DataReceived event.
00094                     await claimedScanner.EnableAsync();
00095
00096                     rootPage.NotifyUser("Ready to scan. Device ID: " + claimedScanner.DeviceId, NotifyType.StatusMessage);
00097                     ScenarioEndScanButton.IsEnabled = true;
00098
00099                     // If the scanner is a software scanner, show the software trigger buttons.
00100                     if (!string.IsNullOrEmpty(scanner.VideoDeviceId))
00101                     {
00102                         ScenarioSoftwareTriggerPanel.Visibility = Visibility.Visible;
00103                         ScenarioStartTriggerButton.IsEnabled = true;
00104                         ScenarioStopTriggerButton.IsEnabled = false;
00105                     }
00106                 }
00107                 else
00108                 {
00109                     rootPage.NotifyUser("Claim barcode scanner failed.", NotifyType.ErrorMessage);
00110                     ScenarioStartScanButton.IsEnabled = true;
00111                 }
00112             }
00113             else
00114             {
00115                 rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage);
00116                 ScenarioStartScanButton.IsEnabled = true;
00117             }
00118         }
00119
00120         /// <summary>
00121         /// Event handler for the Release Device Requested event fired when barcode scanner receives Claim request from another application
00122         /// </summary>
00123         /// <param name="sender"></param>
00124         /// <param name="args"> Contains the ClamiedBarcodeScanner that is sending this request</param>
00125         void claimedScanner_ReleaseDeviceRequested(object sender, ClaimedBarcodeScanner e)
00126         {
00127             // always retain the device
00128             e.RetainDevice();
00129
00130             rootPage.NotifyUser("Event ReleaseDeviceRequested received. Retaining the barcode scanner.", NotifyType.StatusMessage);
00131         }
00132
00133         /// <summary>
00134         /// Event handler for the DataReceived event fired when a barcode is scanned by the barcode scanner
00135         /// </summary>
00136         /// <param name="sender"></param>
00137         /// <param name="args"> Contains the BarcodeScannerReport which contains the data obtained in the scan</param>
00138         async void claimedScanner_DataReceived(ClaimedBarcodeScanner sender, BarcodeScannerDataReceivedEventArgs args)
00139         {
00140             // need to update the UI data on the dispatcher thread.
00141             // update the UI with the data received from the scan.
00142             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00143             {
00144                 // read the data from the buffer and convert to string.
00145                 ScenarioOutputScanDataLabel.Text = DataHelpers.GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType);
00146                 ScenarioOutputScanData.Text = DataHelpers.GetDataString(args.Report.ScanData);
00147                 ScenarioOutputScanDataType.Text = BarcodeSymbologies.GetName(args.Report.ScanDataType);
00148             });
00149         }
00150
00151         /// <summary>
00152         /// Reset the Scenario state
00153         /// </summary>
00154         private void ResetTheScenarioState()
00155         {
00156             if (claimedScanner != null)
00157             {
00158                 // Detach the event handlers
00159                 claimedScanner.DataReceived -= claimedScanner_DataReceived;
00160                 claimedScanner.ReleaseDeviceRequested -= claimedScanner_ReleaseDeviceRequested;
00161                 // Release the Barcode Scanner and set to null
00162                 claimedScanner.Dispose();
00163                 claimedScanner = null;
00164             }
00165
00166             if (scanner != null)
00167             {
00168                 scanner.Dispose();
00169                 scanner = null;
00170             }
00171
00172             // Reset the UI if we are still the current page.
00173             if (Frame.Content == this)
00174             {
00175                 rootPage.NotifyUser("Click the start scanning button to begin.", NotifyType.StatusMessage);
00176                 this.ScenarioOutputScanData.Text = "No data";
00177                 this.ScenarioOutputScanDataLabel.Text = "No data";
00178                 this.ScenarioOutputScanDataType.Text = "No data";
00179
00180                 // reset the button state
00181                 ScenarioEndScanButton.IsEnabled = false;
00182                 ScenarioStartScanButton.IsEnabled = true;
00183                 ScenarioSoftwareTriggerPanel.Visibility = Visibility.Collapsed;
00184             }
00185         }
00186
00187         /// <summary>
00188         /// Event handler for End Scan Button Click.
00189         /// Releases the Barcode Scanner and resets the text in the UI
00190         /// </summary>
00191         /// <param name="sender"></param>
00192         /// <param name="e"></param>
00193         private void ScenarioEndScanButton_Click(object sender, RoutedEventArgs e)
00194         {
00195             // reset the scenario state
00196             this.ResetTheScenarioState();
00197         }
00198
00199         /// <summary>
00200         /// Event handler for Start Software Trigger button click.
00201         /// Presses the software trigger button.
00202         /// </summary>
00203         private async void ScenarioStartTriggerButton_Click(object sender, RoutedEventArgs e)
00204         {
00205             ScenarioStartTriggerButton.IsEnabled = false;
00206             await claimedScanner.StartSoftwareTriggerAsync();
00207             ScenarioStopTriggerButton.IsEnabled = true;
00208         }
00209
00210         /// <summary>
00211         /// Event handler for Stop Software Trigger button click.
00212         /// Releases the software trigger button.
00213         /// </summary>
00214         private async void ScenarioStopTriggerButton_Click(object sender, RoutedEventArgs e)
00215         {
00216             ScenarioStopTriggerButton.IsEnabled = false;
00217             await claimedScanner.StopSoftwareTriggerAsync();
00218             ScenarioStartTriggerButton.IsEnabled = true;
00219         }
00220     }
00221 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cs/SampleConfiguration.cs Source File

  • FilePicker
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "File picker C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Pick a single photo",   ClassType = typeof(Scenario1_SingleFile) },
00025             new Scenario() { Title = "Pick multiple files",   ClassType = typeof(Scenario2_MultiFile) },
00026             new Scenario() { Title = "Pick a folder",         ClassType = typeof(Scenario3_SingleFolder) },
00027             new Scenario() { Title = "Save a file",           ClassType = typeof(Scenario4_SaveFile) },
00028             new Scenario() { Title = "Trigger CFU",           ClassType = typeof(Scenario5_TriggerCFU) },
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Data/Azure/AzureDataProvider.cs Source File

  • AdvancedCasting
  • cs
  • Data
  • Azure

AzureDataProvider.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017 using Windows.Web.Syndication;
00018 using ScreenCasting.Data.Common;
00019
00020 namespace ScreenCasting.Data.Azure
00021 {
00022     public class AzureDataProvider : ItemsDataProvider
00023     {
00024         private static Dictionary<string, VideoMetaData> s_metaDataList = null;
00025         private const int MAX_RESULTS = 10;
00026         public override VideoMetaData GetRandomVideo ()
00027         {
00028             List<VideoMetaData> videos = GetAll(MAX_RESULTS);
00029             Random indexRandomizer = new Random();
00030
00031             // Pick a random video
00032             return videos[indexRandomizer.Next(0, videos.Count - 1)];
00033         }
00034         public override List<VideoMetaData> GetAll(int max_results)
00035         {
00036             if (s_metaDataList == null)
00037             {
00038                 Dictionary<string, VideoMetaData> l = new Dictionary<string, VideoMetaData>();
00039
00040                 VideoMetaData video1 = new VideoMetaData();
00041                 video1.Id = "AzureMediaServicesOverview";
00042                 video1.PubDate = DateTime.Now;
00043                 video1.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=m3u8-aapl)");
00044                 video1.Title = "Azure Media Services Overview";
00045                 video1.WebPageLink = new Uri("http://amsplayer.azurewebsites.net/amssamples.html");
00046                 video1.License = "(C) Microsoft Coorporation | All Rights Reserved";
00047                 video1.Thumbnail = new Uri("http://t3.gstatic.com/images?q=tbn:ANd9GcRoTu81vs8GuQtJBGUZ0pLEiNHVVx3dFwHsu7JCkvGop8Z-98EsPg");
00048                 l.Add(video1.Id, video1);
00049
00050                 VideoMetaData video2 = new VideoMetaData();
00051                 video2.Id = "BigBuckBunnyTrailer";
00052                 video2.PubDate = DateTime.Now;
00053                 video2.VideoLink = new Uri("http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi");
00054                 video2.Title = "Big Buck Bunny";
00055                 video2.WebPageLink = new Uri("https://peach.blender.org/");
00056                 video2.License = "(CC) Blender Foundation | peach.blender.org";
00057                 video2.Thumbnail = new Uri("http://t0.gstatic.com/images?q=tbn:ANd9GcQT54UKh0zX5OUDNLRyXOOwt3pqj0lpaLCJebucva2LSV49aGjRfg");
00058                 l.Add(video2.Id, video2);
00059
00060                 VideoMetaData video3 = new VideoMetaData();
00061                 video3.Id = "bc57e088-27ec-44e0-ac20-a85ccbcd50da";
00062                 video3.PubDate = DateTime.Now;
00063                 video3.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TearsOfSteel.ism/manifest(format=mpd-time-csf)");
00064                 video3.Title = "Tears of Steel";
00065                 video3.WebPageLink = new Uri("https://mango.blender.org/");
00066                 video3.License = "(CC) Blender Foundation | durian.blender.org/";
00067                 video3.Thumbnail = new Uri("http://t3.gstatic.com/images?q=tbn:ANd9GcQO0MMO_vXf8Q1zjZWLHa1_566Mf_jty6vJKRi9R-C_0W-gXnNOog");
00068                 l.Add(video3.Id, video3);
00069
00070                 //VideoMetaData video4 = new VideoMetaData();
00071                 //video4.Id = "b6822ec8-5c2b-4ae0-a851-fd46a78294e9";
00072                 //video4.PubDate = DateTime.Now;
00073                 //video4.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/b6822ec8-5c2b-4ae0-a851-fd46a78294e9/ElephantsDream.ism/manifest(filtername=FirstFilter,format=mpd-time-csf)");
00074                 //video4.Title = "Elephants Dream";
00075                 //video4.WebPageLink = new Uri("https://orange.blender.org/");
00076                 //video4.License = "(c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org";
00077                 //video4.Thumbnail = new Uri("https://orange.blender.org/wp-content/uploads/2006/05/edscore_cover_l.jpg");
00078                 //l.Add(video4.Id, video4);
00079
00080
00081                 VideoMetaData video5 = new VideoMetaData();
00082                 video5.Id = "49b57c87-f5f3-48b3-ba22-c55cfdffa9cb";
00083                 video5.PubDate = DateTime.Now;
00084                 video5.VideoLink = new Uri("http://amssamples.streaming.mediaservices.windows.net/49b57c87-f5f3-48b3-ba22-c55cfdffa9cb/Sintel.ism/manifest(format=m3u8-aapl)");
00085                 video5.Title = "Sintel";
00086                 video5.WebPageLink = new Uri("https://durian.blender.org/");
00087                 video5.License = "© copyright Blender Foundation | www.sintel.org";
00088                 video5.Thumbnail = new Uri("https://durian.blender.org/wp-content/uploads/2010/05/sintel_trailer_1080.jpg");
00089                 l.Add(video5.Id, video5);
00090                 s_metaDataList = l;
00091             }
00092             return s_metaDataList.Values.ToList<VideoMetaData>();
00093         }
00094
00095         public override VideoMetaData GetFromID(string id)
00096         {
00097             if (s_metaDataList == null)
00098                 GetAll(20);
00099
00100             VideoMetaData video = s_metaDataList[id];
00101
00102             return video;
00103         }
00104
00105     }
00106 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cs/Scenario2_DocumentFonts.xaml.cs Source File

  • LanguageFont
  • cs

Scenario2_DocumentFonts.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml.Navigation;
00012 using SDKTemplate;
00013 using System;
00014 using Windows.Globalization.Fonts;
00015 using Windows.Graphics.Display;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Text;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Data;
00020 using Windows.UI.Xaml.Media;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class Scenario2_DocumentFonts : Page
00028     {
00029         public Scenario2_DocumentFonts()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private void ApplyFonts_Click(object sender, RoutedEventArgs e)
00035         {
00036             var languageFontGroup = new LanguageFontGroup("hi");
00037
00038             MainPage.ApplyLanguageFont(HeadingTextBlock, languageFontGroup.DocumentHeadingFont);
00039
00040             // Not all scripts have recommended fonts for "document alternate"
00041             // categories, so need to verify before using it. Note that Hindi does
00042             // have document alternate fonts, so in this case the fallback logic is
00043             // unnecessary, but (for example) Japanese does not have recommendations
00044             // for the document alternate 2 category.
00045             MainPage.ApplyLanguageFont(DocumentTextBlock,
00046                 languageFontGroup.DocumentAlternate2Font ??
00047                 languageFontGroup.DocumentAlternate1Font ??
00048                 languageFontGroup.ModernDocumentFont);
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/SampleConfiguration.cpp Source File

  • JumpList
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Windows::ApplicationModel::Activation;
00018
00019 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00020 {
00021     { "Respond to being launched", "SDKTemplate.Scenario1_Launched" },
00022     { "Remove the jump list", "SDKTemplate.Scenario2_Remove" },
00023     { "Creating custom items", "SDKTemplate.Scenario3_CustomItems" },
00024     { "Change the system group", "SDKTemplate.Scenario4_ChangeSystemGroup" },
00025     { "Check if the platform is supported", "SDKTemplate.Scenario5_IsSupported" },
00026 };
00027
00028 void MainPage::LaunchParam::set(Platform::String^ value)
00029 {
00030     launchParam = value;
00031     if (value != nullptr && !value->IsEmpty())
00032     {
00033         if (ScenarioControl->SelectedIndex == 0)
00034         {
00035             ScenarioControl->SelectedIndex = -1;
00036         }
00037
00038         ScenarioControl->SelectedIndex = 0;
00039     }
00040 }
00041
00042 void App::Partial_LaunchCompleted(LaunchActivatedEventArgs^ e)
00043 {
00044     if (!e->Arguments->IsEmpty())
00045     {
00046         MainPage::Current->LaunchParam = "arguments: " + e->Arguments;
00047     }
00048 }
00049
00050 void App::OnFileActivated(FileActivatedEventArgs^ args)
00051 {
00052     if (args->Files->Size == 1)
00053     {
00054         MainPage::Current->LaunchParam = "file: " + args->Files->GetAt(0)->Name;
00055     }
00056 }
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario3_Size.cpp Source File

  • AppWindow
  • cppwinrt

Scenario3_Size.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_Size.h"
00014 #include "Scenario3_Size.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include "MainPage.h"
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::UI::WindowManagement;
00021 using namespace Windows::UI::WindowManagement::Preview;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Hosting;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario3_Size::Scenario3_Size()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     fire_and_forget Scenario3_Size::OnNavigatedFrom(NavigationEventArgs const&)
00034     {
00035         if (appWindow != nullptr)
00036         {
00037             co_await appWindow.CloseAsync();
00038         }
00039     }
00040
00041     // Lower bounds on window size to keep things from being unreasonably tiny.
00042     constexpr float MinWindowWidth = 192;
00043     constexpr float MinWindowHeight = 48;
00044
00045     fire_and_forget Scenario3_Size::ShowWindowBtn_Click(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         auto lifetime = get_strong();
00048
00049         // Clear any previous message.
00050         auto rootPage = MainPage::Current();
00051         rootPage.NotifyUser({}, NotifyType::StatusMessage);
00052
00053         float windowWidth = 0.0f;
00054         float windowHeight = 0.0f;
00055         if (!TryParseFloat(windowWidthTxt().Text(), windowWidth) ||
00056             !TryParseFloat(windowHeightTxt().Text(), windowHeight) ||
00057             windowWidth < MinWindowWidth || windowHeight < MinWindowHeight)
00058         {
00059             rootPage.NotifyUser(L"Please specify a width of at least " + to_hstring(MinWindowWidth) +
00060                 L" and a height of at least " + to_hstring(MinWindowHeight) + L".", NotifyType::ErrorMessage);
00061             co_return;
00062         }
00063         unique_disabled_control re_enabled{ showWindowBtn() };
00064
00065         // Only ever create one window. If the AppWindow already exists call TryShow on it to bring it to foreground.
00066         if (appWindow == nullptr)
00067         {
00068             // Create a new window
00069             appWindow = co_await AppWindow::TryCreateAsync();
00070             // Clean up when the window is closced
00071             appWindow.Closed({ get_weak(), &Scenario3_Size::OnWindowClosed });
00072             // Navigate the frame to the page we want to show in the new window
00073             appWindowFrame.Navigate(xaml_typename<SDKTemplate::SecondaryAppWindowPage>());
00074             // Attach the XAML content to our window
00075             ElementCompositionPreview::SetAppWindowContent(appWindow, appWindowFrame);
00076         }
00077
00078         // If specified size is smaller than the default min size for a window we need to set a new preferred min size first.
00079         // Let's set it to the smallest allowed and leave it at that.
00080         if (windowWidth < 500 || windowHeight < 320)
00081         {
00082             WindowManagementPreview::SetPreferredMinSize(appWindow, { MinWindowWidth, MinWindowHeight });
00083         }
00084         // Request the size of our window
00085         appWindow.RequestSize({ windowWidth, windowHeight });
00086         // Attach the XAML content to our window
00087         ElementCompositionPreview::SetAppWindowContent(appWindow, appWindowFrame);
00088
00089         // If the window is not visible, show it and/or bring it to foreground
00090         if (!appWindow.IsVisible())
00091         {
00092             co_await appWindow.TryShowAsync();
00093         }
00094     }
00095
00096     void Scenario3_Size::OnWindowClosed(AppWindow const&, IInspectable const&)
00097     {
00098         // Make sure we release the reference to this window, and release XAML resources.
00099         appWindow = nullptr;
00100         appWindowFrame.Content(nullptr);
00101     }
00102 }
Generated on Fri Nov 15 2024 22:18:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario3_Region.h Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario3_Region.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_Region.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario3_Region : Scenario3_RegionT<Scenario3_Region>
00019     {
00020         Scenario3_Region();
00021
00022         void ShowResults_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario3_Region : Scenario3_RegionT<Scenario3_Region, implementation::Scenario3_Region>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkRenderer Member List

This is the complete list of members for InkRenderer, including all inherited members.
_selectionRect | InkRenderer | [private]
_spInkD2DRenderer | InkRenderer | [private]
_strokeContainer | InkRenderer | [private]
_StrokeContainerForTemp | InkRenderer | [private]
_strokeStyle | InkRenderer | [private]
Clear() | InkRenderer |
ClearStrokeContainerForTemp() | InkRenderer | [inline]
DeleteSelectedStrokes() | InkRenderer |
DrawSelectionRect(Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext, Microsoft::WRL::ComPtr< ID2D1Factory > d2dFactory) | InkRenderer |
GetSelectedStrokes() | InkRenderer |
GetSelectionRectangle() | InkRenderer | [inline]
GetStrokeContainer() | InkRenderer | [inline]
GetStrokeContainerForTemp() | InkRenderer | [inline]
HasStrokesToErase(Windows::Foundation::Point prevPt, Windows::Foundation::Point currPt) | InkRenderer |
InkRenderer() | InkRenderer |
IsEmptyRect(Windows::Foundation::Rect &updateRect) | InkRenderer | [inline]
Render(Platform::Collections::Vector< Windows::UI::Input::Inking::InkStroke^>^, Microsoft::WRL::ComPtr< ID2D1DeviceContext > d2dContext) | InkRenderer |
Select(Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^selectionPoints) | InkRenderer |
UnselectAll() | InkRenderer |
Update(Windows::UI::Input::Inking::InkStroke^strokeContainer) | InkRenderer |
UpdateSelectionRectangle(Windows::Foundation::Rect newSelectionRect) | InkRenderer |
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_SecondaryWindow Member List

This is the complete list of members for Scenario1_SecondaryWindow, including all inherited members.
Button_Click(IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_SecondaryWindow |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_SecondaryWindow |
OnWindowClosed(Windows::UI::WindowManagement::AppWindow const &sender, IInspectable const &) | Scenario1_SecondaryWindow | [private]
Scenario1_SecondaryWindow() | Scenario1_SecondaryWindow |
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/SampleConfiguration.cpp Source File

  • LineDisplay
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Platform;
00018 using namespace Windows::Devices::PointOfService;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00025 {
00026     { "Selecting a Line Display", "SDKTemplate.Scenario1_SelectDisplay" },
00027     { "Displaying text", "SDKTemplate.Scenario2_DisplayText" },
00028     { "Using windows to control layout", "SDKTemplate.Scenario3_UsingWindows" },
00029     { "Updating line display attributes", "SDKTemplate.Scenario4_UpdatingLineDisplayAttributes" },
00030     { "Defining custom glyphs", "SDKTemplate.Scenario5_DefiningCustomGlyphs" },
00031     { "Modifying the display cursor", "SDKTemplate.Scenario6_ManipulatingCursorAttributes" },
00032     { "Scrolling content using marquee", "SDKTemplate.Scenario7_ScrollingContentUsingMarquee" }
00033 };
00034
00035 Concurrency::task<ClaimedLineDisplay^> MainPage::ClaimScenarioLineDisplayAsync()
00036 {
00037     ClaimedLineDisplay^ lineDisplay;
00038     if (LineDisplayId->IsEmpty())
00039     {
00040         NotifyUser("You must use scenario 1 to select a line display", NotifyType::ErrorMessage);
00041     }
00042     else
00043     {
00044         lineDisplay = co_await ClaimedLineDisplay::FromIdAsync(LineDisplayId);
00045         if (lineDisplay == nullptr)
00046         {
00047             NotifyUser("Unable to claim selected LineDisplay from id.", NotifyType::ErrorMessage);
00048         }
00049     }
00050     return lineDisplay;
00051 }
00052
00053 void Helpers::AddItem(ComboBox^ comboBox, Object^ value, String^ name)
00054 {
00055     auto item = ref new ComboBoxItem();
00056     item->Content = name;
00057     item->Tag = value;
00058     comboBox->Items->Append(item);
00059 }
Generated on Fri Nov 15 2024 22:17:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/Scenario3.xaml.h Source File

  • XamlContextMenu
  • cpp

Scenario3.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "SampleDataModel.h"
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario3 sealed
00022     {
00023     public:
00024         Scenario3();
00025
00026         property Windows::Foundation::Collections::IVector<SampleDataModel^>^ AllItems;
00027
00028     private:
00029         MainPage^ rootPage = MainPage::Current;
00030         Windows::UI::Xaml::Controls::MenuFlyout^ sharedFlyout;
00031
00032         void ListView_ContextRequested(Windows::UI::Xaml::UIElement^ sender, Windows::UI::Xaml::Input::ContextRequestedEventArgs^ e);
00033         void ListView_ContextCanceled(Windows::UI::Xaml::UIElement^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         SampleDataModel^ GetDataModelForCurrentListViewFlyout();
00035
00036         void OpenMenuItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00037         void PrintMenuItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038         void DeleteMenuItem_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario6_ClearScenario.cpp Source File

  • ApplicationData
  • cppwinrt

Scenario6_ClearScenario.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_ClearScenario.h"
00014 #include "Scenario6_ClearScenario.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::Storage;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario6_ClearScenario::Scenario6_ClearScenario()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     fire_and_forget Scenario6_ClearScenario::Clear_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         try
00031         {
00032             co_await ApplicationData::Current().ClearAsync();
00033             OutputTextBlock().Text(L"ApplicationData has been cleared.  Visit the other scenarios to see that their data has been cleared.");
00034         }
00035         catch (...)
00036         {
00037             OutputTextBlock().Text(L"Unable to clear settings. This can happen when files are in use.");
00038         }
00039     }
00040 }
00041
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModelConstantBuffer Member List

This is the complete list of members for ModelConstantBuffer, including all inherited members.
model ModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/DeviceResources.cpp Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DeviceResources.h"
00014 #include "DirectXHelper.h"
00015 #include <windows.ui.xaml.media.dxinterop.h>
00016
00017 using namespace D2D1;
00018 using namespace DirectX;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Graphics::Display;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Platform;
00025
00026 // Instead of the typical 8 bits-per-channel, UNORM pixel format, this app will use the
00027 // 16 bits-per-channel, floating-point format. This format should be used for swap chains
00028 // and intermediate surfaces that will be representing content in the scRGB color space.
00029 // Direct3D and Direct2D natively support rendering to this pixel format.
00030 static const DXGI_FORMAT sc_swapChainFormat = DXGI_FORMAT_R16G16B16A16_FLOAT;
00031
00032 // Constants used to calculate screen rotations
00033 namespace ScreenRotation
00034 {
00035     // 0-degree Z-rotation
00036     static const XMFLOAT4X4 Rotation0(
00037         1.0f, 0.0f, 0.0f, 0.0f,
00038         0.0f, 1.0f, 0.0f, 0.0f,
00039         0.0f, 0.0f, 1.0f, 0.0f,
00040         0.0f, 0.0f, 0.0f, 1.0f
00041         );
00042
00043     // 90-degree Z-rotation
00044     static const XMFLOAT4X4 Rotation90(
00045         0.0f, 1.0f, 0.0f, 0.0f,
00046         -1.0f, 0.0f, 0.0f, 0.0f,
00047         0.0f, 0.0f, 1.0f, 0.0f,
00048         0.0f, 0.0f, 0.0f, 1.0f
00049         );
00050
00051     // 180-degree Z-rotation
00052     static const XMFLOAT4X4 Rotation180(
00053         -1.0f, 0.0f, 0.0f, 0.0f,
00054         0.0f, -1.0f, 0.0f, 0.0f,
00055         0.0f, 0.0f, 1.0f, 0.0f,
00056         0.0f, 0.0f, 0.0f, 1.0f
00057         );
00058
00059     // 270-degree Z-rotation
00060     static const XMFLOAT4X4 Rotation270(
00061         0.0f, -1.0f, 0.0f, 0.0f,
00062         1.0f, 0.0f, 0.0f, 0.0f,
00063         0.0f, 0.0f, 1.0f, 0.0f,
00064         0.0f, 0.0f, 0.0f, 1.0f
00065         );
00066 };
00067
00068 // Constructor for DeviceResources.
00069 DX::DeviceResources::DeviceResources() :
00070     m_screenViewport(),
00071     m_d3dFeatureLevel(D3D_FEATURE_LEVEL_9_1),
00072     m_d3dRenderTargetSize(),
00073     m_outputSize(),
00074     m_logicalSize(),
00075     m_nativeOrientation(DisplayOrientations::None),
00076     m_currentOrientation(DisplayOrientations::None),
00077     m_dpi(-1.0f),
00078     m_compositionScaleX(1.0f),
00079     m_compositionScaleY(1.0f),
00080     m_deviceNotify(nullptr)
00081 {
00082     CreateDeviceIndependentResources();
00083     CreateDeviceResources();
00084 }
00085
00086 // Configures resources that don't depend on the Direct3D device.
00087 void DX::DeviceResources::CreateDeviceIndependentResources()
00088 {
00089     // Initialize Direct2D resources.
00090     D2D1_FACTORY_OPTIONS options;
00091     ZeroMemory(&options, sizeof(options));
00092
00093 #if defined(_DEBUG)
00094     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00095     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00096 #endif
00097
00098     // Initialize the Direct2D Factory.
00099     DX::ThrowIfFailed(
00100         D2D1CreateFactory(
00101             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00102             __uuidof(ID2D1Factory6),
00103             &options,
00104             &m_d2dFactory
00105             )
00106         );
00107
00108     // Initialize the DirectWrite Factory.
00109     DX::ThrowIfFailed(
00110         DWriteCreateFactory(
00111             DWRITE_FACTORY_TYPE_SHARED,
00112             __uuidof(IDWriteFactory2),
00113             &m_dwriteFactory
00114             )
00115         );
00116
00117     // Initialize the Windows Imaging Component (WIC) Factory.
00118     DX::ThrowIfFailed(
00119         CoCreateInstance(
00120             CLSID_WICImagingFactory2,
00121             nullptr,
00122             CLSCTX_INPROC_SERVER,
00123             IID_PPV_ARGS(&m_wicFactory)
00124             )
00125         );
00126 }
00127
00128 // Configures the Direct3D device, and stores handles to it and the device context.
00129 void DX::DeviceResources::CreateDeviceResources()
00130 {
00131     // This flag adds support for surfaces with a different color channel ordering
00132     // than the API default. It is required for compatibility with Direct2D.
00133     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00134
00135 #if defined(_DEBUG)
00136     if (DX::SdkLayersAvailable())
00137     {
00138         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00139         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00140     }
00141 #endif
00142
00143     // This array defines the set of DirectX hardware feature levels this app will support.
00144     // Note the ordering should be preserved.
00145     // Don't forget to declare your application's minimum required feature level in its
00146     // description.  All applications are assumed to support 9.1 unless otherwise stated.
00147     D3D_FEATURE_LEVEL featureLevels[] =
00148     {
00149         D3D_FEATURE_LEVEL_11_1,
00150         D3D_FEATURE_LEVEL_11_0,
00151         D3D_FEATURE_LEVEL_10_1,
00152         D3D_FEATURE_LEVEL_10_0,
00153         D3D_FEATURE_LEVEL_9_3,
00154         D3D_FEATURE_LEVEL_9_2,
00155         D3D_FEATURE_LEVEL_9_1
00156     };
00157
00158     // Create the Direct3D 11 API device object and a corresponding context.
00159     ComPtr<ID3D11Device> device;
00160     ComPtr<ID3D11DeviceContext> context;
00161
00162     HRESULT hr = D3D11CreateDevice(
00163         nullptr,                    // Specify nullptr to use the default adapter.
00164         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00165         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00166         creationFlags,              // Set debug and Direct2D compatibility flags.
00167         featureLevels,              // List of feature levels this app can support.
00168         ARRAYSIZE(featureLevels),   // Size of the list above.
00169         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00170         &device,                    // Returns the Direct3D device created.
00171         &m_d3dFeatureLevel,         // Returns feature level of device created.
00172         &context                    // Returns the device immediate context.
00173         );
00174
00175     if (FAILED(hr))
00176     {
00177         // If the initialization fails, fall back to the WARP device.
00178         // For more information on WARP, see:
00179         // http://go.microsoft.com/fwlink/?LinkId=286690
00180         DX::ThrowIfFailed(
00181             D3D11CreateDevice(
00182                 nullptr,
00183                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00184                 0,
00185                 creationFlags,
00186                 featureLevels,
00187                 ARRAYSIZE(featureLevels),
00188                 D3D11_SDK_VERSION,
00189                 &device,
00190                 &m_d3dFeatureLevel,
00191                 &context
00192                 )
00193             );
00194     }
00195
00196     // Store pointers to the Direct3D 11.1 API device and immediate context.
00197     DX::ThrowIfFailed(
00198         device.As(&m_d3dDevice)
00199         );
00200
00201     DX::ThrowIfFailed(
00202         context.As(&m_d3dContext)
00203         );
00204
00205     // Create the Direct2D device object and a corresponding context.
00206     ComPtr<IDXGIDevice3> dxgiDevice;
00207     DX::ThrowIfFailed(
00208         m_d3dDevice.As(&dxgiDevice)
00209         );
00210
00211     DX::ThrowIfFailed(
00212         m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
00213         );
00214
00215     DX::ThrowIfFailed(
00216         m_d2dDevice->CreateDeviceContext(
00217             D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
00218             &m_d2dContext
00219             )
00220         );
00221 }
00222
00223 // These resources need to be recreated every time the window size is changed.
00224 void DX::DeviceResources::CreateWindowSizeDependentResources()
00225 {
00226     // Clear the previous window size specific context.
00227     ID3D11RenderTargetView* nullViews[] = {nullptr};
00228     m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00229     m_d3dRenderTargetView = nullptr;
00230     m_d2dContext->SetTarget(nullptr);
00231     m_d2dTargetBitmap = nullptr;
00232     m_d3dDepthStencilView = nullptr;
00233     m_d3dContext->Flush();
00234
00235     // Calculate the necessary swap chain and render target size in pixels.
00236     m_outputSize.Width = m_logicalSize.Width * m_compositionScaleX;
00237     m_outputSize.Height = m_logicalSize.Height * m_compositionScaleY;
00238
00239     // Prevent zero size DirectX content from being created.
00240     m_outputSize.Width = max(m_outputSize.Width, 1);
00241     m_outputSize.Height = max(m_outputSize.Height, 1);
00242
00243     // The width and height of the swap chain must be based on the window's
00244     // natively-oriented width and height. If the window is not in the native
00245     // orientation, the dimensions must be reversed.
00246     DXGI_MODE_ROTATION displayRotation = ComputeDisplayRotation();
00247
00248     bool swapDimensions = displayRotation == DXGI_MODE_ROTATION_ROTATE90 || displayRotation == DXGI_MODE_ROTATION_ROTATE270;
00249     m_d3dRenderTargetSize.Width = swapDimensions ? m_outputSize.Height : m_outputSize.Width;
00250     m_d3dRenderTargetSize.Height = swapDimensions ? m_outputSize.Width : m_outputSize.Height;
00251
00252     if (m_swapChain != nullptr)
00253     {
00254         // If the swap chain already exists, resize it.
00255         HRESULT hr = m_swapChain->ResizeBuffers(
00256             2, // Double-buffered swap chain.
00257             lround(m_d3dRenderTargetSize.Width),
00258             lround(m_d3dRenderTargetSize.Height),
00259             sc_swapChainFormat,
00260             0
00261             );
00262
00263         if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00264         {
00265             // If the device was removed for any reason, a new device and swap chain will need to be created.
00266             HandleDeviceLost();
00267
00268             // Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method
00269             // and correctly set up the new device.
00270             return;
00271         }
00272         else
00273         {
00274             DX::ThrowIfFailed(hr);
00275         }
00276     }
00277     else
00278     {
00279         // Otherwise, create a new one using the same adapter as the existing Direct3D device.
00280         DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
00281
00282         swapChainDesc.Width = lround(m_d3dRenderTargetSize.Width); // Match the size of the window.
00283         swapChainDesc.Height = lround(m_d3dRenderTargetSize.Height);
00284         swapChainDesc.Format = sc_swapChainFormat;
00285         swapChainDesc.Stereo = false;
00286         swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
00287         swapChainDesc.SampleDesc.Quality = 0;
00288         swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
00289         swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
00290         swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Runtime apps must use this SwapEffect.
00291         swapChainDesc.Flags = 0;
00292         swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
00293         swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
00294
00295         // This sequence obtains the DXGI factory that was used to create the Direct3D device above.
00296         ComPtr<IDXGIDevice3> dxgiDevice;
00297         DX::ThrowIfFailed(
00298             m_d3dDevice.As(&dxgiDevice)
00299             );
00300
00301         ComPtr<IDXGIAdapter> dxgiAdapter;
00302         DX::ThrowIfFailed(
00303             dxgiDevice->GetAdapter(&dxgiAdapter)
00304             );
00305
00306         DX::ThrowIfFailed(
00307             dxgiAdapter->GetParent(IID_PPV_ARGS(&m_dxgiFactory))
00308             );
00309
00310         // When using XAML interop, the swap chain must be created for composition.
00311         ComPtr<IDXGISwapChain1> swapChain;
00312
00313         DX::ThrowIfFailed(
00314             m_dxgiFactory->CreateSwapChainForComposition(
00315                 m_d3dDevice.Get(),
00316                 &swapChainDesc,
00317                 nullptr,
00318                 &swapChain
00319                 )
00320             );
00321
00322         DX::ThrowIfFailed(
00323             swapChain.As(&m_swapChain)
00324             );
00325
00326         // Check the swap chain's color space support. This app needs to use the scRGB color space.
00327         UINT colorSpaceSupport;
00328         DX::ThrowIfFailed(
00329             m_swapChain->CheckColorSpaceSupport(DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709, &colorSpaceSupport)
00330             );
00331
00332         if ((colorSpaceSupport & DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT) == DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)
00333         {
00334             // Set the swap chain's color space to scRGB.
00335             DX::ThrowIfFailed(
00336                 m_swapChain->SetColorSpace1(DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709)
00337                 );
00338         }
00339         else
00340         {
00341             // This sample app does not handle the unsupported case.
00342             throw ref new NotImplementedException();
00343         }
00344
00345         // Associate the swap chain with SwapChainPanel.
00346         // UI changes will need to be dispatched back to the UI thread.
00347         m_swapChainPanel->Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([=]()
00348         {
00349             // Get backing native interface for SwapChainPanel.
00350             ComPtr<ISwapChainPanelNative> panelNative;
00351             DX::ThrowIfFailed(
00352                 reinterpret_cast<IUnknown*>(m_swapChainPanel)->QueryInterface(IID_PPV_ARGS(&panelNative))
00353                 );
00354
00355             DX::ThrowIfFailed(
00356                 panelNative->SetSwapChain(m_swapChain.Get())
00357                 );
00358         }, CallbackContext::Any));
00359
00360         // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
00361         // ensures that the application will only render after each VSync, minimizing power consumption.
00362         DX::ThrowIfFailed(
00363             dxgiDevice->SetMaximumFrameLatency(1)
00364             );
00365     }
00366
00367     // Set the proper orientation for the swap chain, and generate 2D and
00368     // 3D matrix transformations for rendering to the rotated swap chain.
00369     // Note the rotation angle for the 2D and 3D transforms are different.
00370     // This is due to the difference in coordinate spaces.  Additionally,
00371     // the 3D matrix is specified explicitly to avoid rounding errors.
00372
00373     switch (displayRotation)
00374     {
00375     case DXGI_MODE_ROTATION_IDENTITY:
00376         m_orientationTransform2D = Matrix3x2F::Identity();
00377         m_orientationTransform3D = ScreenRotation::Rotation0;
00378         break;
00379
00380     case DXGI_MODE_ROTATION_ROTATE90:
00381         m_orientationTransform2D =
00382             Matrix3x2F::Rotation(90.0f) *
00383             Matrix3x2F::Translation(m_logicalSize.Height, 0.0f);
00384         m_orientationTransform3D = ScreenRotation::Rotation270;
00385         break;
00386
00387     case DXGI_MODE_ROTATION_ROTATE180:
00388         m_orientationTransform2D =
00389             Matrix3x2F::Rotation(180.0f) *
00390             Matrix3x2F::Translation(m_logicalSize.Width, m_logicalSize.Height);
00391         m_orientationTransform3D = ScreenRotation::Rotation180;
00392         break;
00393
00394     case DXGI_MODE_ROTATION_ROTATE270:
00395         m_orientationTransform2D =
00396             Matrix3x2F::Rotation(270.0f) *
00397             Matrix3x2F::Translation(0.0f, m_logicalSize.Width);
00398         m_orientationTransform3D = ScreenRotation::Rotation90;
00399         break;
00400
00401     default:
00402         throw ref new FailureException();
00403     }
00404
00405     DX::ThrowIfFailed(
00406         m_swapChain->SetRotation(displayRotation)
00407         );
00408
00409     // Set an inverse scale on the swap chain.
00410     DXGI_MATRIX_3X2_F inverseScale = { 0 };
00411     inverseScale._11 = 1.0f / m_compositionScaleX;
00412     inverseScale._22 = 1.0f / m_compositionScaleY;
00413     ComPtr<IDXGISwapChain2> spSwapChain2;
00414     DX::ThrowIfFailed(
00415         m_swapChain.As<IDXGISwapChain2>(&spSwapChain2)
00416         );
00417
00418     DX::ThrowIfFailed(
00419         spSwapChain2->SetMatrixTransform(&inverseScale)
00420         );
00421
00422
00423     // Create a render target view of the swap chain back buffer.
00424     ComPtr<ID3D11Texture2D> backBuffer;
00425     DX::ThrowIfFailed(
00426         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
00427         );
00428
00429     DX::ThrowIfFailed(
00430         m_d3dDevice->CreateRenderTargetView(
00431             backBuffer.Get(),
00432             nullptr,
00433             &m_d3dRenderTargetView
00434             )
00435         );
00436
00437     // Create a depth stencil view for use with 3D rendering if needed.
00438     CD3D11_TEXTURE2D_DESC depthStencilDesc(
00439         DXGI_FORMAT_D24_UNORM_S8_UINT,
00440         lround(m_d3dRenderTargetSize.Width),
00441         lround(m_d3dRenderTargetSize.Height),
00442         1, // This depth stencil view has only one texture.
00443         1, // Use a single mipmap level.
00444         D3D11_BIND_DEPTH_STENCIL
00445         );
00446
00447     ComPtr<ID3D11Texture2D> depthStencil;
00448     DX::ThrowIfFailed(
00449         m_d3dDevice->CreateTexture2D(
00450             &depthStencilDesc,
00451             nullptr,
00452             &depthStencil
00453             )
00454         );
00455
00456     CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
00457     DX::ThrowIfFailed(
00458         m_d3dDevice->CreateDepthStencilView(
00459             depthStencil.Get(),
00460             &depthStencilViewDesc,
00461             &m_d3dDepthStencilView
00462             )
00463         );
00464
00465     // Set the 3D rendering viewport to target the entire window.
00466     m_screenViewport = CD3D11_VIEWPORT(
00467         0.0f,
00468         0.0f,
00469         m_d3dRenderTargetSize.Width,
00470         m_d3dRenderTargetSize.Height
00471         );
00472
00473     m_d3dContext->RSSetViewports(1, &m_screenViewport);
00474
00475     // Create a Direct2D target bitmap associated with the
00476     // swap chain back buffer and set it as the current target.
00477     D2D1_BITMAP_PROPERTIES1 bitmapProperties =
00478         D2D1::BitmapProperties1(
00479             D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
00480             D2D1::PixelFormat(sc_swapChainFormat, D2D1_ALPHA_MODE_PREMULTIPLIED),
00481             m_dpi,
00482             m_dpi
00483             );
00484
00485     ComPtr<IDXGISurface2> dxgiBackBuffer;
00486     DX::ThrowIfFailed(
00487         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
00488         );
00489
00490     DX::ThrowIfFailed(
00491         m_d2dContext->CreateBitmapFromDxgiSurface(
00492             dxgiBackBuffer.Get(),
00493             &bitmapProperties,
00494             &m_d2dTargetBitmap
00495             )
00496         );
00497
00498     m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
00499
00500     // Grayscale text anti-aliasing is recommended for all Windows Runtime apps.
00501     m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
00502 }
00503
00504 // This method is called when the XAML control is created (or re-created).
00505 void DX::DeviceResources::SetSwapChainPanel(SwapChainPanel^ panel)
00506 {
00507     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00508
00509     m_swapChainPanel = panel;
00510     m_logicalSize = Windows::Foundation::Size(static_cast<float>(panel->ActualWidth), static_cast<float>(panel->ActualHeight));
00511     m_nativeOrientation = currentDisplayInformation->NativeOrientation;
00512     m_currentOrientation = currentDisplayInformation->CurrentOrientation;
00513     m_compositionScaleX = panel->CompositionScaleX;
00514     m_compositionScaleY = panel->CompositionScaleY;
00515     m_dpi = currentDisplayInformation->LogicalDpi;
00516     m_d2dContext->SetDpi(m_dpi, m_dpi);
00517
00518     CreateWindowSizeDependentResources();
00519 }
00520
00521 // This method is called in the event handler for the SizeChanged event.
00522 void DX::DeviceResources::SetLogicalSize(Windows::Foundation::Size logicalSize)
00523 {
00524     if (m_logicalSize != logicalSize)
00525     {
00526         m_logicalSize = logicalSize;
00527         CreateWindowSizeDependentResources();
00528     }
00529 }
00530
00531 // This method is called in the event handler for the DpiChanged event.
00532 void DX::DeviceResources::SetDpi(float dpi)
00533 {
00534     if (dpi != m_dpi)
00535     {
00536         m_dpi = dpi;
00537
00538         m_d2dContext->SetDpi(m_dpi, m_dpi);
00539         CreateWindowSizeDependentResources();
00540     }
00541 }
00542
00543 // This method is called in the event handler for the OrientationChanged event.
00544 void DX::DeviceResources::SetCurrentOrientation(DisplayOrientations currentOrientation)
00545 {
00546     if (m_currentOrientation != currentOrientation)
00547     {
00548         m_currentOrientation = currentOrientation;
00549         CreateWindowSizeDependentResources();
00550     }
00551 }
00552
00553 // This method is called in the event handler for the CompositionScaleChanged event.
00554 void DX::DeviceResources::SetCompositionScale(float compositionScaleX, float compositionScaleY)
00555 {
00556     if (m_compositionScaleX != compositionScaleX ||
00557         m_compositionScaleY != compositionScaleY)
00558     {
00559         m_compositionScaleX = compositionScaleX;
00560         m_compositionScaleY = compositionScaleY;
00561         CreateWindowSizeDependentResources();
00562     }
00563 }
00564
00565 // This method is called in the event handler for the DisplayContentsInvalidated event.
00566 void DX::DeviceResources::ValidateDevice()
00567 {
00568     // The D3D Device is no longer valid if the default adapter changed since the device
00569     // was created or if the device has been removed.
00570
00571     // First, get the information for the default adapter from when the device was created.
00572
00573     ComPtr<IDXGIAdapter1> previousDefaultAdapter;
00574     DX::ThrowIfFailed(m_dxgiFactory->EnumAdapters1(0, &previousDefaultAdapter));
00575
00576     DXGI_ADAPTER_DESC previousDesc;
00577     DX::ThrowIfFailed(previousDefaultAdapter->GetDesc(&previousDesc));
00578
00579     // Next, get the information for the current default adapter.
00580
00581     ComPtr<IDXGIFactory2> currentFactory;
00582     DX::ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&currentFactory)));
00583
00584     ComPtr<IDXGIAdapter1> currentDefaultAdapter;
00585     DX::ThrowIfFailed(currentFactory->EnumAdapters1(0, &currentDefaultAdapter));
00586
00587     DXGI_ADAPTER_DESC currentDesc;
00588     DX::ThrowIfFailed(currentDefaultAdapter->GetDesc(&currentDesc));
00589
00590     // If the adapter LUIDs don't match, or if the device reports that it has been removed,
00591     // a new D3D device must be created.
00592
00593     if (previousDesc.AdapterLuid.LowPart != currentDesc.AdapterLuid.LowPart ||
00594         previousDesc.AdapterLuid.HighPart != currentDesc.AdapterLuid.HighPart ||
00595         FAILED(m_d3dDevice->GetDeviceRemovedReason()))
00596     {
00597         // Release references to resources related to the old device.
00598         m_dxgiFactory = nullptr;
00599         previousDefaultAdapter = nullptr;
00600
00601         // Create a new device and swap chain.
00602         HandleDeviceLost();
00603     }
00604 }
00605
00606 // Recreate all device resources and set them back to the current state.
00607 void DX::DeviceResources::HandleDeviceLost()
00608 {
00609     m_swapChain = nullptr;
00610
00611     if (m_deviceNotify != nullptr)
00612     {
00613         m_deviceNotify->OnDeviceLost();
00614     }
00615
00616     CreateDeviceResources();
00617     m_d2dContext->SetDpi(m_dpi, m_dpi);
00618     CreateWindowSizeDependentResources();
00619
00620     if (m_deviceNotify != nullptr)
00621     {
00622         m_deviceNotify->OnDeviceRestored();
00623     }
00624 }
00625
00626 // Register our DeviceNotify to be informed on device lost and creation.
00627 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00628 {
00629     m_deviceNotify = deviceNotify;
00630 }
00631
00632 // Call this method when the app suspends. It provides a hint to the driver that the app
00633 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00634 void DX::DeviceResources::Trim()
00635 {
00636     ComPtr<IDXGIDevice3> dxgiDevice;
00637     m_d3dDevice.As(&dxgiDevice);
00638
00639     dxgiDevice->Trim();
00640 }
00641
00642 // Present the contents of the swap chain to the screen.
00643 void DX::DeviceResources::Present()
00644 {
00645     // The first argument instructs DXGI to block until VSync, putting the application
00646     // to sleep until the next VSync. This ensures we don't waste any cycles rendering
00647     // frames that will never be displayed to the screen.
00648     HRESULT hr = m_swapChain->Present(1, 0);
00649
00650     // Discard the contents of the render target.
00651     // This is a valid operation only when the existing contents will be entirely
00652     // overwritten. If dirty or scroll rects are used, this call should be removed.
00653     m_d3dContext->DiscardView(m_d3dRenderTargetView.Get());
00654
00655     // Discard the contents of the depth stencil.
00656     m_d3dContext->DiscardView(m_d3dDepthStencilView.Get());
00657
00658     // If the device was removed either by a disconnection or a driver upgrade, we
00659     // must recreate all device resources.
00660     if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00661     {
00662         HandleDeviceLost();
00663     }
00664     else
00665     {
00666         DX::ThrowIfFailed(hr);
00667     }
00668 }
00669
00670 // This method determines the rotation between the display device's native Orientation and the
00671 // current display orientation.
00672 DXGI_MODE_ROTATION DX::DeviceResources::ComputeDisplayRotation()
00673 {
00674     DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
00675
00676     // Note: NativeOrientation can only be Landscape or Portrait even though
00677     // the DisplayOrientations enum has other values.
00678     switch (m_nativeOrientation)
00679     {
00680     case DisplayOrientations::Landscape:
00681         switch (m_currentOrientation)
00682         {
00683         case DisplayOrientations::Landscape:
00684             rotation = DXGI_MODE_ROTATION_IDENTITY;
00685             break;
00686
00687         case DisplayOrientations::Portrait:
00688             rotation = DXGI_MODE_ROTATION_ROTATE270;
00689             break;
00690
00691         case DisplayOrientations::LandscapeFlipped:
00692             rotation = DXGI_MODE_ROTATION_ROTATE180;
00693             break;
00694
00695         case DisplayOrientations::PortraitFlipped:
00696             rotation = DXGI_MODE_ROTATION_ROTATE90;
00697             break;
00698         }
00699         break;
00700
00701     case DisplayOrientations::Portrait:
00702         switch (m_currentOrientation)
00703         {
00704         case DisplayOrientations::Landscape:
00705             rotation = DXGI_MODE_ROTATION_ROTATE90;
00706             break;
00707
00708         case DisplayOrientations::Portrait:
00709             rotation = DXGI_MODE_ROTATION_IDENTITY;
00710             break;
00711
00712         case DisplayOrientations::LandscapeFlipped:
00713             rotation = DXGI_MODE_ROTATION_ROTATE270;
00714             break;
00715
00716         case DisplayOrientations::PortraitFlipped:
00717             rotation = DXGI_MODE_ROTATION_ROTATE180;
00718             break;
00719         }
00720         break;
00721     }
00722     return rotation;
00723 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
App_Activated(object sender, IActivatedEventArgs e) | ScenarioElement | [inline, private]
Error(string message) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
validateStep1(ValueSet result) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario3_RegisterForUpdates.xaml.cs Source File

  • WiFiScan
  • cs

Scenario3_RegisterForUpdates.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.Devices.WiFi;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Navigation;
00018 using SDKTemplate;
00019 using System.Collections.ObjectModel;
00020
00021 namespace WiFiScan
00022 {
00023     public sealed partial class Scenario3_RegisterForUpdates : Page
00024     {
00025         private WiFiAdapter firstAdapter;
00026
00027         MainPage rootPage;
00028         public ObservableCollection<WiFiNetworkDisplay> ResultCollection
00029         {
00030             get;
00031             private set;
00032         }
00033
00034         public Scenario3_RegisterForUpdates()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override async void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
00042             rootPage = MainPage.Current;
00043
00044             // RequestAccessAsync must have been called at least once by the app before using the API
00045             // Calling it multiple times is fine but not necessary
00046             // RequestAccessAsync must be called from the UI thread
00047             var access = await WiFiAdapter.RequestAccessAsync();
00048             if (access != WiFiAccessStatus.Allowed)
00049             {
00050                 rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
00051             }
00052             else
00053             {
00054                 DataContext = this;
00055
00056                 var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
00057                 if (result.Count >= 1)
00058                 {
00059                     firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
00060                     RegisterButton.IsEnabled = true;
00061                 }
00062                 else
00063                 {
00064                     rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
00065                 }
00066             }
00067         }
00068
00069         private void FirstAdapter_AvailableNetworksChanged(WiFiAdapter sender, object args)
00070         {
00071             DisplayNetworkReport(sender.NetworkReport, sender);
00072         }
00073
00074         private async void DisplayNetworkReport(WiFiNetworkReport report, WiFiAdapter adapter)
00075         {
00076             await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00077             {
00078                 rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);
00079
00080                 ResultCollection.Clear();
00081
00082                 foreach (var network in report.AvailableNetworks)
00083                 {
00084                     var networkDisplay = new WiFiNetworkDisplay(network, adapter);
00085                     await networkDisplay.UpdateConnectivityLevel();
00086                     ResultCollection.Add(networkDisplay);
00087                 }
00088             });
00089         }
00090
00091         private void Button_Click_Register(object sender, RoutedEventArgs e)
00092         {
00093             firstAdapter.AvailableNetworksChanged += FirstAdapter_AvailableNetworksChanged;
00094             RegisterButton.IsEnabled = false;
00095             UnregisterButton.IsEnabled = true;
00096         }
00097
00098         private void Button_Click_Unregister(object sender, RoutedEventArgs e)
00099         {
00100             firstAdapter.AvailableNetworksChanged -= FirstAdapter_AvailableNetworksChanged;
00101             UnregisterButton.IsEnabled = false;
00102             RegisterButton.IsEnabled = true;
00103         }
00104     }
00105 }
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TransparentExchangeResponse Member List

This is the complete list of members for TransparentExchangeResponse, including all inherited members.
ApduResponse() | ApduResponse | [inline]
DataObjectType enum name | TransparentExchangeResponse |
ExtractResponse(IBuffer response) | ApduResponse | [inline, virtual]
ExtractTlvDataObject(byte[] referenceTag) | ApduResponse | [inline]
IccResponse | TransparentExchangeResponse |
ResponseData | ApduResponse |
ResponseStatus | TransparentExchangeResponse |
Succeeded | TransparentExchangeResponse |
SW | ApduResponse |
SW1 | ApduResponse |
SW2 | ApduResponse |
SWTranslation | ApduResponse |
TAG_COMPREHENSION_MASK | ApduResponse |
TAG_LENGTH_MULTI_BYTE_MASK | ApduResponse |
TAG_MULTI_BYTE_MASK | ApduResponse |
ToString() | ApduResponse | [inline]
TransparentExchangeResponse() | TransparentExchangeResponse | [inline]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_RequestMany Member List

This is the complete list of members for Scenario2_RequestMany, including all inherited members.
RequestAccessButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario2_RequestMany
Scenario2_RequestMany() | Scenario2_RequestMany
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/Scenario1_DefaultSpacing.xaml.h Source File

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

Scenario1_DefaultSpacing.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_DefaultSpacing.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 using namespace DWriteTextLayoutImplementation;
00018
00019 namespace SDKTemplate
00020 {
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario1_DefaultSpacing sealed
00023     {
00024     public:
00025         Scenario1_DefaultSpacing();
00026
00027         // Bindable view-model properties:
00028
00029         property bool IsFontLineGapUsageEnabled
00030         {
00031             bool get() { return (m_textLayout->FontLineGapUsage == FontLineGapUsage::Enabled); }
00032             void set(bool value);
00033         }
00034
00035         property Platform::String^ TextLayoutHeight
00036         {
00037             Platform::String^ get() { return m_textLayoutLineMetrics[0]->height.ToString(); }
00038         }
00039
00040         property Platform::String^ TextLayoutBaseline
00041         {
00042             Platform::String^ get() { return m_textLayoutLineMetrics[0]->baseline.ToString(); }
00043         }
00044
00045         property Platform::String^ TextLayoutLeadingBefore
00046         {
00047             Platform::String^ get() { return m_textLayoutLineMetrics[0]->leadingBefore.ToString(); }
00048         }
00049
00050         property Platform::String^ TextLayoutLeadingAfter
00051         {
00052             Platform::String^ get() { return m_textLayoutLineMetrics[0]->leadingAfter.ToString(); }
00053         }
00054
00055     private:
00056         TextLayout^                                     m_textLayout;
00057         TextLayoutImageSource^                          m_textLayoutImageSource;
00058         Platform::Array<LineMetrics^>^                  m_textLayoutLineMetrics;
00059     };
00060 }
Generated on Fri Nov 15 2024 22:19:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario1_PercentPermilleFormatting.cpp Source File

  • NumberFormatting
  • cppwinrt

Scenario1_PercentPermilleFormatting.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_PercentPermilleFormatting.h"
00014 #include "Scenario1_PercentPermilleFormatting.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization::NumberFormatting;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario1_PercentPermilleFormatting::Scenario1_PercentPermilleFormatting()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     void Scenario1_PercentPermilleFormatting::Display_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         // This scenario uses the Windows.Globalization.NumberFormatting.PercentFormatter and
00031         // the Windows.Globalization.NumberFormatting.PermilleFormatter classes to format numbers
00032         // as a percent or a permille.
00033
00034         // Create formatters initialized using the current user's preference settings.
00035         PercentFormatter percentFormat;
00036         PermilleFormatter permilleFormat;
00037
00038         // Make a random number.
00039         float randomNumber = (float)rand() / RAND_MAX;
00040
00041         // Format with current user preferences.
00042         hstring percent = percentFormat.Format(randomNumber);
00043         hstring permille = permilleFormat.Format(randomNumber);
00044
00045         // Get a fixed number.
00046         long long fixedNumber = 500;
00047
00048         // Format with grouping using default.
00049         PercentFormatter percentFormat1;
00050         percentFormat1.IsGrouped(true);
00051         hstring percent1 = percentFormat1.Format(fixedNumber);
00052
00053         // Format with grouping using French.
00054         PercentFormatter percentFormatFR({ L"fr-FR" }, L"ZZ");
00055         percentFormatFR.IsGrouped(true);
00056         hstring percentFR1 = percentFormatFR.Format(randomNumber);
00057         hstring percentFR2 = percentFormatFR.Format(fixedNumber);
00058
00059         // Format with grouping using Arabic.
00060         PercentFormatter percentFormatAR({ L"ar" }, L"ZZ");
00061         percentFormatAR.IsGrouped(true);
00062         percentFormatAR.FractionDigits(2);
00063         hstring percentAR = percentFormatAR.Format(fixedNumber);
00064         PermilleFormatter permilleFormatAR({ L"ar" }, L"ZZ");
00065         hstring permilleAR = permilleFormatAR.Format(randomNumber);
00066
00067         // Format with no fractional digits using default.
00068         PercentFormatter percentFormat2;
00069         percentFormat2.FractionDigits(0);
00070         hstring percent2 = percentFormat2.Format(fixedNumber);
00071
00072         // Format always with a decimal point.
00073         PercentFormatter percentFormat3;
00074         percentFormat3.IsDecimalPointAlwaysDisplayed(true);
00075         percentFormat3.FractionDigits(0);
00076         hstring percent3 = percentFormat3.Format(fixedNumber);
00077
00078         // Display the results.
00079         std::wostringstream results;
00080         results <<
00081             L"Random number (" << randomNumber << L")" << std::endl <<
00082             L"Percent formatted: " << std::wstring_view(percent) << std::endl <<
00083             L"Permille formatted: " << std::wstring_view(permille) << std::endl <<
00084             std::endl <<
00085             L"Language-specific percent formatted: " << std::wstring_view(percentFR1) << std::endl <<
00086             L"Language-specific permille formatted: " << std::wstring_view(permilleAR) << std::endl <<
00087             std::endl <<
00088             L"Fixed number (" << fixedNumber << L")" << std::endl <<
00089             L"Percent formatted (grouped): " << std::wstring_view(percent1) << std::endl <<
00090             L"Percent formatted (grouped as fr-FR): " << std::wstring_view(percentFR2) << std::endl <<
00091             L"Percent formatted (grouped w/digits as ar): " << std::wstring_view(percentAR) << std::endl <<
00092             L"Percent formatted (no fractional digits): " << std::wstring_view(percent2) << std::endl <<
00093             L"Percent formatted (always with a decimal point): " << std::wstring_view(percent3);
00094
00095         OutputTextBlock().Text(results.str());
00096     }
00097 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkClient.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

NetworkClient.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007 #pragma once
00008 #include "NetworkChannel.h"
00009
00010 namespace Microsoft { namespace Samples { namespace SimpleCommunication { namespace Network {
00011
00012     ref class CNetworkClient sealed:
00013         public CNetworkChannel,
00014         public INetworkClient
00015     {
00016     public:
00017         virtual ~CNetworkClient();
00018
00019         // INetworkClient
00020         virtual Windows::Foundation::IAsyncAction ^ConnectAsync(String ^url, WORD wPort);
00021
00022     internal:
00023         CNetworkClient();
00024     };
00025
00026 }}}}
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemDetails Member List

This is the complete list of members for ItemDetails, including all inherited members.
FormattedTitle | ItemDetails |
InCollection | ItemDetails |
ItemDetails(Windows.Services.Store.StoreProduct product) | ItemDetails | [inline]
Price | ItemDetails |
ProductKind | ItemDetails |
StoreId | ItemDetails |
Title | ItemDetails |
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/pch.cpp Source File

  • BackButton
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/SampleConfiguration.cpp Source File

  • LinguisticServices
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"LinguisticServices C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Language Detection", xaml_typename<SDKTemplate::Scenario1_LanguageDetection>() },
00029     Scenario{ L"Script Detection", xaml_typename<SDKTemplate::Scenario2_ScriptDetection>() },
00030     Scenario{ L"Transliteration", xaml_typename<SDKTemplate::Scenario3_Transliteration>() },
00031     Scenario{ L"Character Grouping", xaml_typename<SDKTemplate::Scenario4_CharacterGrouping>() },
00032 });
Generated on Fri Nov 15 2024 22:17:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/RpcClient.cpp Source File

  • CustomCapability
  • Service
  • Client

RpcClient.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012
00013 #pragma push_macro("WINAPI_FAMILY")
00014 #undef WINAPI_FAMILY
00015 #define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
00016 #include "RpcClient.h"
00017 #pragma pop_macro("WINAPI_FAMILY")
00018
00019 //
00020 // Open metering service RPC endpoint
00021 //
00022 __int64 RpcClient::Initialize()
00023 {
00024     RPC_STATUS status;
00025     RPC_WSTR pszStringBinding = nullptr;
00026
00027     status = RpcStringBindingCompose(
00028         NULL,
00029         reinterpret_cast<RPC_WSTR>(L"ncalrpc"),
00030         NULL,
00031         reinterpret_cast<RPC_WSTR>(RPC_STATIC_ENDPOINT),
00032         NULL,
00033         &pszStringBinding);
00034
00035     if (status)
00036     {
00037         goto error_status;
00038     }
00039
00040     status = RpcBindingFromStringBinding(
00041         pszStringBinding,
00042         &hRpcBinding);
00043
00044     if (status)
00045     {
00046         goto error_status;
00047     }
00048
00049     status = RpcStringFree(&pszStringBinding);
00050
00051     if (status)
00052     {
00053         goto error_status;
00054     }
00055
00056     RpcTryExcept
00057     {
00058         ::RemoteOpen(hRpcBinding, &phContext);
00059     }
00060     RpcExcept(1)
00061     {
00062         status = RpcExceptionCode();
00063     }
00064     RpcEndExcept
00065
00066 error_status :
00067
00068     return status;
00069 }
00070
00071 //
00072 // Make RPC call to start metering. This is a blocking call and
00073 // will return only after StopMetering is called.
00074 //
00075 __int64 RpcClient::StartMeteringAndWaitForStop(__int64 samplePeriod)
00076 {
00077     __int64 ulCode = 0;
00078     CallbackCount = 0;
00079     MeteringData = 0;
00080
00081     RpcTryExcept
00082     {
00083         ::StartMetering(phContext, samplePeriod, (__int64)this);
00084     }
00085     RpcExcept(1)
00086     {
00087         ulCode = RpcExceptionCode();
00088     }
00089     RpcEndExcept
00090
00091     return ulCode;
00092 }
00093
00094 //
00095 // Make rpc call SetSampleRate
00096 //
00097 __int64 RpcClient::SetSampleRate(int rate)
00098 {
00099     __int64 ulCode = 0;
00100     RpcTryExcept
00101     {
00102         ::SetSamplePeriod(phContext, rate);
00103     }
00104     RpcExcept(1)
00105     {
00106         ulCode = RpcExceptionCode();
00107     }
00108     RpcEndExcept
00109
00110     return ulCode;
00111 }
00112
00113 //
00114 // Make rpc call StopMetering
00115 //
00116 __int64 RpcClient::StopMetering()
00117 {
00118     __int64 ulCode = 0;
00119     RpcTryExcept
00120     {
00121         ::StopMetering(phContext);
00122     }
00123     RpcExcept(1)
00124     {
00125         ulCode = RpcExceptionCode();
00126     }
00127     RpcEndExcept
00128
00129     return ulCode;
00130 }
00131
00132 //
00133 // dtor
00134 //
00135 RpcClient::~RpcClient()
00136 {
00137     RPC_STATUS status;
00138
00139     if (hRpcBinding != NULL)
00140     {
00141         RpcTryExcept
00142         {
00143             ::RemoteClose(&phContext);
00144         }
00145         RpcExcept(1)
00146         {
00147             // Ignoring the result of RemoteClose as nothing can be
00148             // done on the client side with this return code
00149             status = RpcExceptionCode();
00150         }
00151         RpcEndExcept
00152
00153         status = RpcBindingFree(&hRpcBinding);
00154         hRpcBinding = NULL;
00155     }
00156 }
00157
00158 //
00159 // Metering rpc callback
00160 //
00161 void MeteringDataEvent(__int64 data, __int64 context)
00162 {
00163     RpcClient* client = static_cast<RpcClient*>((PVOID)context);
00164     client->MeteringData = data;
00165     ++client->CallbackCount;
00166 }
00167
00168 ///******************************************************/
00169 ///*         MIDL allocate and free                     */
00170 ///******************************************************/
00171
00172 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00173 {
00174     return(malloc(len));
00175 }
00176
00177 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00178 {
00179     free(ptr);
00180 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/School.h Source File

  • Json
  • cppwinrt

School.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "School.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct School : SchoolT<School>
00018     {
00019         School() = default;
00020         School(winrt::Windows::Data::Json::JsonObject const& jsonObject);
00021
00022         winrt::Windows::Data::Json::JsonObject ToJsonObject();
00023
00024         hstring Id() { return m_id; }
00025         void Id(hstring const& value) { m_id = value; }
00026         hstring Name() { return m_name; }
00027         void Name(hstring const& value) { m_name = value; }
00028         hstring Type() { return m_type; }
00029         void Type(hstring const& value) { m_type = value; }
00030
00031     private:
00032         static constexpr inline wchar_t idKey[] = L"id";
00033         static constexpr inline wchar_t schoolKey[] = L"school";
00034         static constexpr inline wchar_t nameKey[] = L"name";
00035         static constexpr inline wchar_t typeKey[] = L"type";
00036
00037         hstring m_id;
00038         hstring m_name;
00039         hstring m_type;
00040     };
00041 }
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct School : SchoolT<School, implementation::School>
00045     {
00046     };
00047 }
Generated on Fri Nov 15 2024 22:20:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario1_Events.xaml.h Source File

  • Pedometer
  • cpp

Scenario1_Events.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Events.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// 'Events' scenario page that gets navigated to when the user selected the 'Events' scenario.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_Events sealed
00024     {
00025     public:
00026         Scenario1_Events();
00027     protected:
00028         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029     private:
00030         void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void OnAccessChanged(Windows::Devices::Enumeration::DeviceAccessInformation ^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs ^args);
00032         void OnReadingChanged(Windows::Devices::Sensors::Pedometer ^sender, Windows::Devices::Sensors::PedometerReadingChangedEventArgs ^args);
00033         void UpdateEventRegistration(bool registerForEvents);
00034
00035         SDKTemplate::MainPage^ rootPage;
00036         Windows::Devices::Enumeration::DeviceAccessInformation^ deviceAccessInfo;
00037         Windows::Devices::Sensors::Pedometer^ pedometer;
00038         Windows::Foundation::EventRegistrationToken readingToken;
00039         bool registeredForEvents;
00040
00041         int32 totalCumulativeSteps;
00042         int32 unknownStepCount;
00043         int32 walkingStepCount;
00044         int32 runningStepCount;
00045     };
00046 }
Generated on Fri Nov 15 2024 22:20:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DefaultKeys Member List

This is the complete list of members for DefaultKeys, including all inherited members.
FactoryDefault DefaultKeys [static]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ArduinoDevice Member List

This is the complete list of members for ArduinoDevice, including all inherited members.
Pid | ArduinoDevice
Vid | ArduinoDevice
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/UserViewModel.cpp Source File

  • UserInfo
  • cppwinrt

UserViewModel.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "UserViewModel.h"
00014 #include "UserViewModel.g.cpp"
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ServiceViewModel Member List

This is the complete list of members for ServiceViewModel, including all inherited members.
actualRpcCallbackRate | ServiceViewModel | [private]
ActualRpcCallbackRate | ServiceViewModel | [private]
Current | ServiceViewModel | [static]
dispatcher | ServiceViewModel | [private]
ExpectedRpcCallbackRate | ServiceViewModel | [private]
expectedRpcCallbackRate | ServiceViewModel | [private]
GetCallbackCount(IntPtr RpcClientHandle, ref long MeteringData) | ServiceViewModel | [private]
GetMeteringData(IntPtr RpcClientHandle, ref long MeteringData) | ServiceViewModel | [private]
GetSystemTimeAsFileTime(ref FILETIME lpSystemTimeAsFileTime) | ServiceViewModel | [private]
isSupported | ServiceViewModel | [private]
lastUpdateTime | ServiceViewModel | [private]
LoadPackagedLibrary(string filename, uint reserved) | ServiceViewModel | [private]
meteringOn | ServiceViewModel | [private]
meteringOnWhileSuspension | ServiceViewModel | [private]
NotifyIfAnyError(long errCode) | ServiceViewModel | [inline]
NotifyPropertyChangedAsync(string prop) | ServiceViewModel | [inline, private]
NotifyStatusMessage(string message, NotifyType messageType) | ServiceViewModel | [inline, private]
PropertyChanged | ServiceViewModel |
ResumeMeteringService(object sender, object e) | ServiceViewModel | [inline, private]
rpcClient | ServiceViewModel | [private]
RpcClientClose(IntPtr rpcClient) | ServiceViewModel | [private]
RpcClientInitialize(out IntPtr rpcClient) | ServiceViewModel | [private]
rpcDataCountOld | ServiceViewModel | [private]
sampleArray | ServiceViewModel | [private]
SampleMessage | ServiceViewModel | [private]
sampleMessage | ServiceViewModel | [private]
samplePeriod | ServiceViewModel | [private]
sampleRefreshCount | ServiceViewModel | [private]
ServiceViewModel() | ServiceViewModel | [inline, private, static]
ServiceViewModel() | ServiceViewModel | [inline, private]
SetSamplePeriod(int value) | ServiceViewModel | [inline, private]
SetSampleRate(IntPtr rpcClient, int rate) | ServiceViewModel | [private]
sliderEnabled | ServiceViewModel | [private]
SliderEnabled | ServiceViewModel | [private]
sliderValue | ServiceViewModel | [private]
SliderValue | ServiceViewModel | [private]
startButtonEnabled | ServiceViewModel | [private]
StartButtonEnabled | ServiceViewModel | [private]
StartMetering(int sampleRate) | ServiceViewModel | [inline, private]
StartMeteringAndWaitForStop(IntPtr RpcClientHandle, long samplePeriod) | ServiceViewModel | [private]
stopButtonEnabled | ServiceViewModel | [private]
StopButtonEnabled | ServiceViewModel | [private]
StopMetering() | ServiceViewModel | [inline, private]
StopMeteringData(IntPtr RpcClientHandle) | ServiceViewModel | [private]
stopMeteringRequested | ServiceViewModel | [private]
SuspendMeteringService(object sender, SuspendingEventArgs e) | ServiceViewModel | [inline, private]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario1.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.cpp
00013 // Implementation of the Scenario1 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario1.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024
00025 Scenario1::Scenario1()
00026 {
00027     InitializeComponent();
00028 }
00029
00030 /// <summary>
00031 /// Invoked when this page is about to be displayed in a Frame.
00032 /// </summary>
00033 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00034 /// property is typically used to configure the page.</param>
00035 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00036 {
00037     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00038     // as NotifyUser()
00039     rootPage = MainPage::Current;
00040 }
00041
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/04_DIAL_Receiver_App.xaml.cs Source File

  • AdvancedCasting
  • cs

04_DIAL_Receiver_App.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using ScreenCasting.Data.Azure;
00013 using ScreenCasting.Data.Common;
00014 using ScreenCasting.Util;
00015 using System;
00016 using Windows.ApplicationModel.Activation;
00017 using Windows.Storage;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace ScreenCasting
00023 {
00024     public sealed partial class Scenario04 : Page
00025     {
00026         private MainPage rootPage;
00027         private VideoMetaData video = null;
00028         private TimeSpan originalPosition = new TimeSpan(0);
00029         public Scenario04()
00030         {
00031             this.InitializeComponent();
00032
00033             rootPage = MainPage.Current;
00034             rootPage.SizeChanged += RootPage_SizeChanged;
00035         }
00036
00037         protected async override void OnNavigatedTo(NavigationEventArgs e)
00038         {
00039             rootPage = MainPage.Current;
00040
00041             //Subscribe to player events
00042             player.MediaOpened += Player_MediaOpened;
00043             player.MediaFailed += Player_MediaFailed;
00044             player.CurrentStateChanged += Player_CurrentStateChanged;
00045             player.MediaEnded += Player_MediaEnded;
00046
00047             if (e.Parameter is DialReceiverActivatedEventArgs)
00048             {
00049                 DialReceiverActivatedEventArgs activationArgs = (DialReceiverActivatedEventArgs)e.Parameter;
00050
00051                 //Parse the DIAL arguments from the activation arguments
00052                 DialLaunchArguments dialArgs = DialLaunchArguments.Parse(activationArgs.Arguments);
00053
00054                 // Get the list of available Azure videos.
00055                 AzureDataProvider dataProvider = new AzureDataProvider();
00056                 // Get the vide that is playing
00057                 video = dataProvider.GetFromID(dialArgs.VideoId);
00058                 //Set the source on the player
00059                 rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
00060                 this.player.Source = video.VideoLink;
00061                 this.LicenseText.Text = "License: " + video.License;
00062
00063                 player.Position = dialArgs.Position;
00064             }
00065             else
00066             {
00067                 StorageFile localVideo = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/casting.mp4"));
00068                 var stream = await localVideo.OpenAsync(FileAccessMode.Read);
00069                 this.player.SetSource(stream, localVideo.FileType);
00070             }
00071         }
00072
00073         private void Player_MediaEnded(object sender, RoutedEventArgs e)
00074         {
00075             if (video == null)
00076             {
00077                 this.player.Position = new TimeSpan(0);
00078                 this.player.Play();
00079             }
00080         }
00081
00082         private void RootPage_SizeChanged(object sender, SizeChangedEventArgs e)
00083         {
00084             this.player.Height = this.Height;
00085             this.player.Width = this.Width;
00086         }
00087
00088         #region MediaElement Status Changes
00089         private void Player_CurrentStateChanged(object sender, RoutedEventArgs e)
00090         {
00091             if (video == null)
00092                 rootPage.NotifyUser(string.Format("{0}", this.player.CurrentState), NotifyType.StatusMessage);
00093             else
00094                 rootPage.NotifyUser(string.Format("{0} '{1}'", this.player.CurrentState, video.Title), NotifyType.StatusMessage);
00095         }
00096
00097         private void Player_MediaFailed(object sender, ExceptionRoutedEventArgs e)
00098         {
00099             if (video == null)
00100                 rootPage.NotifyUser(string.Format("Failed to load"), NotifyType.ErrorMessage);
00101             else
00102                 rootPage.NotifyUser(string.Format("Failed to load '{0}'", video.Title), NotifyType.ErrorMessage);
00103         }
00104
00105         private void Player_MediaOpened(object sender, RoutedEventArgs e)
00106         {
00107             if (video == null)
00108                 rootPage.NotifyUser(string.Format("Openend"), NotifyType.StatusMessage);
00109             else
00110                 rootPage.NotifyUser(string.Format("Openend '{0}'", "Title"), NotifyType.StatusMessage);
00111
00112             player.Play();
00113         }
00114
00115         #endregion
00116     }
00117 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ClientDeviceInformation/cpp/Scenario1_GetDeviceInformation.xaml.cpp Source File

  • ClientDeviceInformation
  • cpp

Scenario1_GetDeviceInformation.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario1_GetDeviceInformation.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Windows::Foundation;
00010 using namespace Windows::Foundation::Collections;
00011 using namespace Windows::Security::ExchangeActiveSyncProvisioning;
00012 using namespace Windows::UI::Xaml;
00013 using namespace Windows::UI::Xaml::Controls;
00014 using namespace Windows::UI::Xaml::Controls::Primitives;
00015 using namespace Windows::UI::Xaml::Data;
00016 using namespace Windows::UI::Xaml::Input;
00017 using namespace Windows::UI::Xaml::Media;
00018 using namespace Windows::UI::Xaml::Navigation;
00019
00020 Scenario1_GetDeviceInformation::Scenario1_GetDeviceInformation() : rootPage(MainPage::Current)
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void Scenario1_GetDeviceInformation::Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     DeviceID->Text = "";
00028     FriendlyName->Text = "";
00029     SystemManufacturer->Text = "";
00030     SystemProductName->Text = "";
00031     SystemSku->Text = "";
00032     OperatingSystem->Text = "";
00033     try
00034     {
00035
00036         EasClientDeviceInformation^ CurrentDeviceInfor = ref new EasClientDeviceInformation();
00037
00038         DeviceID->Text = CurrentDeviceInfor->Id.ToString();
00039         OperatingSystem->Text = CurrentDeviceInfor->OperatingSystem;
00040         FriendlyName->Text = CurrentDeviceInfor->FriendlyName;
00041         SystemManufacturer->Text = CurrentDeviceInfor->SystemManufacturer;
00042         SystemProductName->Text = CurrentDeviceInfor->SystemProductName;
00043         SystemSku->Text = CurrentDeviceInfor->SystemSku;
00044
00045     }
00046     catch (Platform::Exception^ ex)
00047     {
00048         MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
00049     }
00050
00051 }
00052
00053 void Scenario1_GetDeviceInformation::Reset_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00054 {
00055     try
00056     {
00057         DeviceID->Text = "";
00058         FriendlyName->Text = "";
00059         SystemManufacturer->Text = "";
00060         SystemProductName->Text = "";
00061         SystemSku->Text = "";
00062         OperatingSystem->Text = "";
00063     }
00064     catch (Platform::Exception^ ex)
00065     {
00066         MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
00067     }
00068 }
00069
Generated on Fri Nov 15 2024 22:18:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario1_Prefs.xaml.cs Source File

  • GlobalizationPreferences
  • cs

Scenario1_Prefs.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.System.UserProfile;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario1_Prefs : Page
00020     {
00021         public Scenario1_Prefs()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         private void ShowResults_Click(object sender, RoutedEventArgs e)
00027         {
00028             // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
00029             // obtain the user's globalization preferences.
00030             OutputTextBlock.Text = "Languages: " + string.Join(", ", GlobalizationPreferences.Languages) + "\n" +
00031                 "Home Region: " + GlobalizationPreferences.HomeGeographicRegion + "\n" +
00032                 "Calendar System: " + string.Join(", ", GlobalizationPreferences.Calendars) + "\n" +
00033                 "Clock: " + string.Join(", ", GlobalizationPreferences.Clocks) + "\n" +
00034                 "First Day of the Week: " + GlobalizationPreferences.WeekStartsOn.ToString();
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario1_AddAccount.xaml.h Source File

  • UserDataAccountManager
  • cpp

Scenario1_AddAccount.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_AddAccount.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_AddAccount sealed
00024     {
00025     public:
00026         Scenario1_AddAccount();
00027     private:
00028         MainPage^ rootPage;
00029         bool addAccountLaunched;
00030
00031         void AddAccount_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         Concurrency::task<void> DisplayUserInformationAsync(Platform::String^ userID);
00033     };
00034 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewLifetimeControl Member List

This is the complete list of members for ViewLifetimeControl, including all inherited members.
CreateForCurrentView() | ViewLifetimeControl | [static]
Dispatcher() | ViewLifetimeControl | [inline]
FinalizeRelease() | ViewLifetimeControl | [private]
Id() | ViewLifetimeControl | [inline]
m_consolidatedToken | ViewLifetimeControl | [private]
m_internalReleased | ViewLifetimeControl | [private]
m_mutex | ViewLifetimeControl | [private]
m_propertyChanged | ViewLifetimeControl | [private]
m_refCount | ViewLifetimeControl | [private]
m_released | ViewLifetimeControl | [private]
m_title | ViewLifetimeControl | [private]
m_viewId | ViewLifetimeControl | [private]
m_window | ViewLifetimeControl | [private]
PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const &handler) | ViewLifetimeControl |
PropertyChanged(event_token const &token) | ViewLifetimeControl |
RegisterForEvents() | ViewLifetimeControl | [private]
Released(Windows::Foundation::TypedEventHandler< SDKTemplate::ViewLifetimeControl, Windows::Foundation::IInspectable > const &handler) | ViewLifetimeControl |
Released(event_token const &token) | ViewLifetimeControl |
StartViewInUse() | ViewLifetimeControl |
StopViewInUse() | ViewLifetimeControl |
Title() | ViewLifetimeControl |
Title(hstring const &value) | ViewLifetimeControl |
UnregisterForEvents() | ViewLifetimeControl | [private]
ViewConsolidated(Windows::UI::ViewManagement::ApplicationView const &sender, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs const &e) | ViewLifetimeControl | [private]
ViewLifetimeControl(Windows::UI::Core::CoreWindow const &newWindow) | ViewLifetimeControl |
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario10.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario10.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario10.xaml.cpp
00013 // Implementation of the Scenario10 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario10.xaml.h"
00018
00019 using namespace SDKTemplate;
00020 using namespace Platform;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024 using namespace Windows::ApplicationModel::Resources::Core;
00025
00026
00027 Scenario10::Scenario10()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 /// <summary>
00033 /// Invoked when this page is about to be displayed in a Frame.
00034 /// </summary>
00035 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00036 /// property is typically used to configure the page.</param>
00037 void Scenario10::OnNavigatedTo(NavigationEventArgs^ e)
00038 {
00039     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00040     // as NotifyUser()
00041     rootPage = MainPage::Current;
00042 }
00043
00044 void SDKTemplate::Scenario10::Scenario10Button_Show_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00045 {
00046     Button^ b = safe_cast<Button^>(sender);
00047     if (b != nullptr)
00048     {
00049         // use a cloned context for this scenario so that qualifier values set
00050         // in this scenario don't impact behaviour in other scenarios that
00051         // use a default context for the view (crossover effects between
00052         // the scenarios will not be expected)
00053         auto context = ResourceContext::GetForCurrentView()->Clone();
00054
00055         auto selectedLanguage = Scenario10ComboBox_Language->SelectedValue;
00056         auto selectedScale = Scenario10ComboBox_Scale->SelectedValue;
00057         auto selectedContrast = Scenario10ComboBox_Contrast->SelectedValue;
00058         auto selectedHomeRegion = Scenario10ComboBox_HomeRegion->SelectedValue;
00059
00060         if (selectedLanguage != nullptr)
00061         {
00062             context->QualifierValues->Insert("language", selectedLanguage->ToString());
00063         }
00064         if (selectedScale != nullptr)
00065         {
00066             context->QualifierValues->Insert("scale", selectedScale->ToString());
00067         }
00068         if (selectedContrast != nullptr)
00069         {
00070             context->QualifierValues->Insert("contrast", selectedContrast->ToString());
00071         }
00072         if (selectedHomeRegion != nullptr)
00073         {
00074             context->QualifierValues->Insert("homeregion", selectedHomeRegion->ToString());
00075         }
00076
00077         Platform::Collections::Vector<String^>^ resourceIds = ref new Platform::Collections::Vector<String^>();
00078         //auto resourceIds = new list<String^>();
00079         resourceIds->Append("LanguageOnly");
00080         resourceIds->Append("ScaleOnly");
00081         resourceIds->Append("ContrastOnly");
00082         resourceIds->Append("HomeRegionOnly");
00083         resourceIds->Append("MultiDimensional");
00084         Scenario10_SearchMultipleResourceIds(context, resourceIds);
00085     }
00086 }
00087
00088
00089 void SDKTemplate::Scenario10::Scenario10_SearchMultipleResourceIds(ResourceContext^ context, Platform::Collections::Vector<String^>^ resourceIds)
00090 {
00091     Scenario10TextBlock->Text = "";
00092     auto dimensionMap = ResourceManager::Current->MainResourceMap->GetSubtree("dimensions");
00093
00094     for (unsigned int it = 0; it < resourceIds->Size; it++)
00095     {
00096         String^ id = resourceIds->GetAt(it);
00097         NamedResource^ namedResource = dimensionMap->Lookup(id);
00098         if (namedResource)
00099         {
00100             auto resourceCandidates = namedResource->ResolveAll(context);
00101             Scenario10_ShowCandidates(resourceIds->GetAt(it), resourceCandidates);
00102         }
00103     }
00104 }
00105
00106 void SDKTemplate::Scenario10::Scenario10_ShowCandidates(String^ resourceId, Windows::Foundation::Collections::IVectorView<ResourceCandidate^>^ resourceCandidates)
00107 {
00108     // print 'resourceId', 'found value', 'qualifer info', 'matching condition'
00109     String^ outText = "resourceId: dimensions\\" + resourceId + "\r\n";
00110
00111     for(unsigned int i =0; i < resourceCandidates->Size; i++)
00112     {
00113         ResourceCandidate^ candidate = resourceCandidates->GetAt(i);
00114         auto value = candidate->ValueAsString;
00115
00116         outText += "    Candidate " + i.ToString() + ":" + value + "\r\n";
00117         for (unsigned int j = 0; j < candidate->Qualifiers->Size; j++)
00118         {
00119             auto qualifier = candidate->Qualifiers->GetAt(j);
00120             auto qualifierName = qualifier->QualifierName;
00121             auto qualifierValue = qualifier->QualifierValue;
00122             outText += "        Qualifer: " + qualifierName + ": " + qualifierValue + "\r\n";
00123             outText += "        Matching: IsMatch (" + qualifier->IsMatch.ToString() + ")  " + "IsDefault (" + qualifier->IsDefault.ToString() + ")" + "\r\n";
00124         }
00125     }
00126
00127     this->Scenario10TextBlock->Text += outText + "\r\n";
00128
00129 }
Generated on Fri Nov 15 2024 22:17:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/Manifest.cs Source File

  • LiveDash
  • cs
  • LiveDash
  • Models

Manifest.cs

Go to the documentation of this file.
00001 ﻿using LiveDash.Util;
00002 using System;
00003 using System.Collections.Generic;
00004 using System.IO;
00005 using System.Linq;
00006 using System.Text;
00007 using System.Threading.Tasks;
00008 using Windows.Storage.Streams;
00009
00010 namespace LiveDash.Models
00011 {
00012     /// <summary>
00013     /// Represents a DASH manifest of type .mpd
00014     /// </summary>
00015     public class Manifest
00016     {
00017         private bool isLive;
00018         private bool isSupportedProfile; //only support urn:mpeg:dash:profile:isoff-live:2011
00019         private DateTimeOffset availabilityStartTime; //anchor for computation of earliest availibility time for any segment
00020         private TimeSpan minBufferTime; //amount of data to buffer before start of playback
00021         private TimeSpan minimumUpdatePeriod; //amount of time to elapse before reloading a new manifest (for dynamic content only)
00022         private TimeSpan timeShiftBufferDepth; //for live playback, specifies duration of the smallist time shifting buffer
00023         private DateTimeOffset publishTime; //for the publish time of a new manifest
00024         private TimeSpan mediaPresentationDuration;
00025         private TimeSpan lastPeriodDuration;
00026         private List<Period> periods;
00027         private string sourceUrl;
00028         private string baseUrl;
00029         private bool hasPresentationDuration;
00030         private bool hasMinimumUpdatePeriod;
00031         private bool hasMultiplePeriods;
00032         private bool treatAsOnDemand;
00033
00034         public static string VideoMimeType = "video/mp4";
00035         public static string AudioMimeType = "audio/mp4";
00036         public static double MinMinimumUpdatePeriod = 3; //3 seconds
00037
00038
00039         internal Manifest(string url)
00040         {
00041             periods = new List<Period>();
00042             sourceUrl = url;
00043             //trim the filename of the url
00044             int index = url.LastIndexOf("/");
00045             int lastChunkLength = url.Length - index;
00046             int baseUrlEndIndex = url.Length - lastChunkLength;
00047             baseUrl = url.Substring(0, baseUrlEndIndex);
00048         }
00049
00050         #region properties
00051         internal string BaseUrl
00052         {
00053             get { return baseUrl; }
00054             set { baseUrl = value; }
00055         }
00056
00057         internal string SourceUrl
00058         {
00059             get { return sourceUrl; }
00060         }
00061
00062         internal bool IsLive
00063         {
00064             get { return isLive; }
00065
00066             set { isLive = value; }
00067         }
00068
00069         internal bool IsSupportedProfile
00070         {
00071             get { return isSupportedProfile; }
00072
00073             set { isSupportedProfile = value; }
00074         }
00075
00076         internal DateTimeOffset AvailibilityStartTime
00077         {
00078             get { return availabilityStartTime; }
00079
00080             set { availabilityStartTime = value; }
00081         }
00082
00083         internal TimeSpan MinBufferTime
00084         {
00085             get { return minBufferTime; }
00086
00087             set { minBufferTime = value; }
00088         }
00089
00090         internal TimeSpan MinimumUpdatePeriod
00091         {
00092             get { return minimumUpdatePeriod; }
00093
00094             set { minimumUpdatePeriod = value; }
00095         }
00096
00097         internal bool HasMinimumUpdatePeriod
00098         {
00099             get { return hasMinimumUpdatePeriod; }
00100
00101             set { hasMinimumUpdatePeriod = value; }
00102         }
00103
00104         internal TimeSpan TimeShiftBufferDepth
00105         {
00106             get { return (timeShiftBufferDepth.TotalMilliseconds == 0) ? TimeSpan.MinValue : timeShiftBufferDepth; }
00107
00108             set { timeShiftBufferDepth = value; }
00109         }
00110
00111         internal TimeSpan MediaPresentationDuration
00112         {
00113             get { return mediaPresentationDuration; }
00114
00115             set { mediaPresentationDuration = value; }
00116         }
00117
00118         internal TimeSpan LastPeriodDuration
00119         {
00120             get { return lastPeriodDuration; }
00121
00122             set { lastPeriodDuration = value; }
00123         }
00124
00125         internal bool HasMultiplePeriods
00126         {
00127             get { return hasMultiplePeriods; }
00128
00129             set { hasMultiplePeriods = value; }
00130         }
00131
00132         internal bool HasPresentationDuration
00133         {
00134             get { return hasPresentationDuration; }
00135
00136             set { hasPresentationDuration = value; }
00137         }
00138
00139         public DateTimeOffset PublishTime
00140         {
00141             get { return publishTime; }
00142
00143             set { publishTime = value; }
00144         }
00145
00146         public bool TreatAsOnDemand
00147         {
00148             get { return treatAsOnDemand; }
00149
00150             set { treatAsOnDemand = value; }
00151         }
00152
00153         #endregion
00154
00155         internal void AddPeriod(Period period)
00156         {
00157             periods.Add(period);
00158         }
00159
00160         internal Period GetSelectedPeriod()
00161         {
00162             foreach (var period in periods)
00163             {
00164                 if (period.IsSelected)
00165                 {
00166                     return period;
00167                 }
00168             }
00169             return null;
00170         }
00171
00172         internal async Task<Windows.Data.Xml.Dom.XmlDocument> LoadManifestAsync(string url)
00173         {
00174             Uri uri = null;
00175             IBuffer buffer = null;
00176             try
00177             {
00178                 uri = new Uri(url);
00179             }
00180             catch
00181             {
00182 #if DEBUG
00183                 Logger.Log("Bad url: " + url);
00184 #endif
00185                 throw new Exception("Invalid URL");
00186             }
00187
00188             buffer = await Downloader.DownloadBufferAsync(uri);
00189
00190             if (buffer == null)
00191             {
00192 #if DEBUG
00193                 Logger.Log("Failed to get buffer of manifest");
00194 #endif
00195                 throw new Exception("Failed to get buffer from url");
00196             }
00197             Windows.Data.Xml.Dom.XmlDocument document = new Windows.Data.Xml.Dom.XmlDocument();
00198
00199             try
00200             {
00201
00202                 var bufferString = DataReader.FromBuffer(buffer).ReadString(buffer.Length);
00203                 document.LoadXmlFromBuffer(buffer);
00204             }
00205             catch (Exception e)
00206             {
00207 #if DEBUG
00208                 Logger.Log("Failed to load XML from buffer = " + Logger.Display(e));
00209 #endif
00210                 throw new Exception("Invalid XML file");
00211             }
00212
00213             return document;
00214         }
00215
00216         internal void AppendToBaseUrl(string url)
00217         {
00218             if (!baseUrl.EndsWith("/"))
00219             {
00220                 baseUrl += "/";
00221             }
00222
00223             baseUrl += url;
00224         }
00225
00226         internal void SetFirstSelectedPeriod()
00227         {
00228             if (periods.Count() > 0)
00229             {
00230                 periods.First<Period>().IsSelected = true;
00231             }
00232         }
00233
00234         internal void SetNextSelectedPeriod()
00235         {
00236             var periodCount = periods.Count();
00237             for (int x = 0; x < periodCount; x++)
00238             {
00239                 if (periods.ElementAt(x).IsSelected && (x + 1) < periodCount)
00240                 {
00241                     periods.ElementAt(x).IsSelected = false;
00242                     periods.ElementAt(x + 1).IsSelected = true;
00243                     return;
00244                 }
00245             }
00246             HasMultiplePeriods = false;
00247
00248         }
00249     }
00250
00251
00252 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/DirectXHelper.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

DirectXHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 namespace DX
00017 {
00018     inline void ThrowIfFailed(HRESULT hr)
00019     {
00020         if (FAILED(hr))
00021         {
00022             // Set a breakpoint on this line to catch Win32 API errors.
00023             throw Platform::Exception::CreateException(hr);
00024         }
00025     }
00026
00027     // Function that reads from a binary file asynchronously.
00028     inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
00029     {
00030         using namespace Windows::Storage;
00031         using namespace Concurrency;
00032
00033         auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
00034
00035         return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([] (StorageFile^ file)
00036         {
00037             return FileIO::ReadBufferAsync(file);
00038         }).then([] (Streams::IBuffer^ fileBuffer) -> std::vector<byte>
00039         {
00040             std::vector<byte> returnBuffer;
00041             returnBuffer.resize(fileBuffer->Length);
00042             Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
00043             return returnBuffer;
00044         });
00045     }
00046
00047     // Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00048     inline float ConvertDipsToPixels(float dips, float dpi)
00049     {
00050         static const float dipsPerInch = 96.0f;
00051         return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
00052     }
00053
00054     // Converts a length in physical pixels to a length in device-independent pixels (DIPs).
00055     inline float ConvertPixelsToDips(float pixels)
00056     {
00057         static const float dipsPerInch = 96.0f;
00058         return pixels * dipsPerInch / Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->LogicalDpi; // Do not round.
00059     }
00060
00061     // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
00062     // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().
00063     inline float ConvertPixelsToDips(float pixels, float dpi)
00064     {
00065         static const float dipsPerInch = 96.0f;
00066         return pixels * dipsPerInch / dpi; // Do not round.
00067     }
00068
00069 #if defined(_DEBUG)
00070     // Check for SDK Layer support.
00071     inline bool SdkLayersAvailable()
00072     {
00073         HRESULT hr = D3D11CreateDevice(
00074             nullptr,
00075             D3D_DRIVER_TYPE_NULL,       // There is no need to create a real hardware device.
00076             0,
00077             D3D11_CREATE_DEVICE_DEBUG,  // Check for the SDK layers.
00078             nullptr,                    // Any feature level will do.
00079             0,
00080             D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00081             nullptr,                    // No need to keep the D3D device reference.
00082             nullptr,                    // No need to know the feature level.
00083             nullptr                     // No need to keep the D3D device context reference.
00084             );
00085
00086         return SUCCEEDED(hr);
00087     }
00088 #endif
00089 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DesfireCommand Member List

This is the complete list of members for DesfireCommand, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
Command | DesfireCommand |
CommandData | ApduCommand |
CommandType enum name | DesfireCommand |
Data | DesfireCommand |
DesfireCommand() | DesfireCommand | [inline]
DesfireCommand(CommandType cmd, byte[] data) | DesfireCommand | [inline]
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ToString() | ApduCommand | [inline]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuspensionManager Member List

This is the complete list of members for SuspensionManager, including all inherited members.
_knownTypes | SuspensionManager | [private, static]
_registeredFrames | SuspensionManager | [private, static]
_sessionState | SuspensionManager | [private, static]
FrameSessionBaseKeyProperty | SuspensionManager | [private, static]
FrameSessionStateKeyProperty | SuspensionManager | [private, static]
FrameSessionStateProperty | SuspensionManager | [private, static]
KnownTypes | SuspensionManager | [static]
RegisterFrame(Frame frame, String sessionStateKey, String sessionBaseKey=null) | SuspensionManager | [inline, static]
RegisterFrame(Frame frame, String sessionStateKey, String sessionBaseKey=null) | SuspensionManager | [inline, static]
RestoreAsync(String sessionBaseKey=null) | SuspensionManager | [inline, static]
RestoreAsync(String sessionBaseKey=null) | SuspensionManager | [inline, static]
RestoreFrameNavigationState(Frame frame) | SuspensionManager | [inline, private, static]
RestoreFrameNavigationState(Frame frame) | SuspensionManager | [inline, private, static]
SaveAsync() | SuspensionManager | [inline, static]
SaveAsync() | SuspensionManager | [inline, static]
SaveFrameNavigationState(Frame frame) | SuspensionManager | [inline, private, static]
SaveFrameNavigationState(Frame frame) | SuspensionManager | [inline, private, static]
SessionState | SuspensionManager | [static]
sessionStateFilename | SuspensionManager | [private]
SessionStateForFrame(Frame frame) | SuspensionManager | [inline, static]
SessionStateForFrame(Frame frame) | SuspensionManager | [inline, static]
UnregisterFrame(Frame frame) | SuspensionManager | [inline, static]
UnregisterFrame(Frame frame) | SuspensionManager | [inline, static]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/CustomComputeShaderRenderer.cpp Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

CustomComputeShaderRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CustomComputeShaderRenderer.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace CustomComputeShader;
00017
00018 using namespace DirectX;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Graphics::Display;
00023 using namespace Windows::UI::Core;
00024
00025 CustomComputeShaderRenderer::CustomComputeShaderRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00026     m_deviceResources(deviceResources)
00027 {
00028     CreateDeviceIndependentResources();
00029     CreateDeviceDependentResources();
00030     CreateWindowSizeDependentResources();
00031 }
00032
00033 void CustomComputeShaderRenderer::CreateDeviceIndependentResources()
00034 {
00035     auto wicFactory = m_deviceResources->GetWicImagingFactory();
00036     auto d2dFactory = m_deviceResources->GetD2DFactory();
00037
00038     // Create WIC Decoder to read JPG file.
00039     ComPtr<IWICBitmapDecoder> decoder;
00040     DX::ThrowIfFailed(
00041         wicFactory->CreateDecoderFromFilename(
00042         L"Assets\\rainier.jpg",
00043         nullptr,
00044         GENERIC_READ,
00045         WICDecodeMetadataCacheOnDemand,
00046         &decoder
00047         ));
00048
00049     ComPtr<IWICBitmapFrameDecode> frame;
00050     DX::ThrowIfFailed(decoder->GetFrame(0, &frame));
00051
00052     DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
00053     DX::ThrowIfFailed(m_formatConvert->Initialize(
00054         frame.Get(),
00055         GUID_WICPixelFormat32bppPBGRA, // 32bppPBGRA is used by Direct2D.
00056         WICBitmapDitherTypeNone,
00057         nullptr,
00058         0.0f,
00059         WICBitmapPaletteTypeCustom
00060         ));
00061
00062     UINT width;
00063     UINT height;
00064     DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
00065     m_imageSize = D2D1::SizeU(width, height);
00066
00067     // Register the custom discrete Fourier transform effect.
00068     DX::ThrowIfFailed(DftEffect::Register(d2dFactory));
00069 }
00070
00071 void CustomComputeShaderRenderer::CreateDeviceDependentResources()
00072 {
00073     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00074
00075     // Load the image from WIC using ImageSource. The image is scaled using
00076     // ID2D1TransformedImageSource which is dependent on the scale factor.
00077     DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));
00078
00079     DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_CustomDftEffect, &m_dftEffect));
00080 }
00081
00082 void CustomComputeShaderRenderer::ReleaseDeviceDependentResources()
00083 {
00084     m_imageSource.Reset();
00085     m_transformedImage.Reset();
00086     m_dftEffect.Reset();
00087 }
00088
00089 void CustomComputeShaderRenderer::CreateWindowSizeDependentResources()
00090 {
00091     // Scale using pixel (not DIPs) because layout calculations are pixel-dependent.
00092     auto size = m_deviceResources->GetOutputSize();
00093
00094     m_scale = min(
00095         (size.Width / m_imageSize.width) / 2.0f,
00096         (size.Height / m_imageSize.height) / 2.0f
00097         );
00098
00099     UpdateImageScale(m_scale);
00100 }
00101
00102 // Sets up the image effect pipeline to reflect the new scale factor.
00103 void CustomComputeShaderRenderer::UpdateImageScale(float scale)
00104 {
00105     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00106
00107     // When using ID2D1ImageSource, the recommend method of applying a transform
00108     // is to use ID2D1TransformedImageSource. It is inexpensive to recreate this object.
00109     D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
00110     {
00111         D2D1_ORIENTATION_DEFAULT,
00112         scale,
00113         scale,
00114         D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
00115         D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE // Does not apply the context's DPI.
00116     };
00117
00118     DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
00119         m_imageSource.Get(),
00120         &props,
00121         &m_transformedImage));
00122
00123     m_dftEffect->SetInput(0, m_transformedImage.Get());
00124 }
00125
00126 void CustomComputeShaderRenderer::Render()
00127 {
00128     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00129     auto renderTargetSize = m_deviceResources->GetOutputSize();
00130
00131     d2dContext->BeginDraw();
00132     m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00133     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));
00134
00135     // Calculate display positioning for the scaled image and DFT effect.
00136     float scaledWidth = m_imageSize.width * m_scale;
00137     float scaledHeight = m_imageSize.height * m_scale;
00138     float horizontalMargin = ((renderTargetSize.Width / 2 - scaledWidth) / 2.0f);
00139
00140     // Clip values nearest whole pixel to prevent effect output from being anti-aliased.
00141     scaledWidth = floor(scaledWidth);
00142     scaledHeight = floor(scaledHeight);
00143     horizontalMargin = floor(horizontalMargin);
00144
00145     // Convert values to DIPs to preserve layout at different DPIs.
00146     scaledHeight = DX::ConvertPixelsToDips(scaledHeight);
00147     scaledWidth = DX::ConvertPixelsToDips(scaledWidth);
00148     horizontalMargin = DX::ConvertPixelsToDips(horizontalMargin);
00149
00150     // Calculate whole pixel offset of screen midpoint before converting to DIPs to
00151     // prevent effect output from being antialiased.
00152     float screenMidpoint = floor(DX::ConvertPixelsToDips(renderTargetSize.Width / 2.0f));
00153
00154     // Draw the original image on the left side of the window.
00155     d2dContext->DrawImage(m_transformedImage.Get(), D2D1::Point2F(horizontalMargin, 0.0f));
00156
00157     // Draw the DFT of the image on the right side of the window.
00158     // Because image output is fully opaque, it should be blended with BOUNDED_SOURCE_COPY, which allows
00159     // the compute shader output to be written directly to the render target instead of blended.
00160     d2dContext->DrawImage(
00161         m_dftEffect.Get(),
00162         D2D1::Point2F(screenMidpoint + horizontalMargin, 0.0f),
00163         D2D1::RectF(0.0f, 0.0f, scaledWidth, scaledHeight),
00164         D2D1_INTERPOLATION_MODE_LINEAR,
00165         D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY
00166         );
00167
00168     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00169     // is lost. It will be handled during the next call to Present.
00170     HRESULT hr = d2dContext->EndDraw();
00171     if (hr != D2DERR_RECREATE_TARGET)
00172     {
00173         DX::ThrowIfFailed(hr);
00174     }
00175 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/pch.h Source File

  • XmlLite
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <shcore.h>
00004 #include <xmllite.h>
00005 #include <hstring.h>
00006 #include "winrt/Windows.Foundation.h"
00007 #include "winrt/Windows.Foundation.Collections.h"
00008 #include "winrt/Windows.ApplicationModel.h"
00009 #include "winrt/Windows.ApplicationModel.Activation.h"
00010 #include "winrt/Windows.Storage.h"
00011 #include "winrt/Windows.Storage.Streams.h"
00012 #include "winrt/Windows.System.h"
00013 #include "winrt/Windows.UI.Core.h"
00014 #include "winrt/Windows.UI.Xaml.h"
00015 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00016 #include "winrt/Windows.UI.Xaml.Controls.h"
00017 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00018 #include "winrt/Windows.UI.Xaml.Documents.h"
00019 #include "winrt/Windows.UI.Xaml.Interop.h"
00020 #include "winrt/Windows.UI.Xaml.Markup.h"
00021 #include "winrt/Windows.UI.Xaml.Media.h"
00022 #include "winrt/Windows.UI.Xaml.Navigation.h"
00023 #include <sstream>
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/AppView.cpp Source File

  • HolographicMixedRealityCapture
  • cpp

AppView.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "AppView.h"
00003
00004 #include <ppltasks.h>
00005
00006 using namespace HolographicMRCSample;
00007
00008 using namespace concurrency;
00009 using namespace Windows::ApplicationModel;
00010 using namespace Windows::ApplicationModel::Activation;
00011 using namespace Windows::ApplicationModel::Core;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Graphics::Holographic;
00014 using namespace Windows::UI::Core;
00015
00016 // The main function is only used to initialize our IFrameworkView class.
00017 // Under most circumstances, you should not need to modify this function.
00018 [Platform::MTAThread]
00019 int main(Platform::Array<Platform::String^>^)
00020 {
00021     AppViewSource^ appViewSource = ref new ::AppViewSource();
00022     CoreApplication::Run(appViewSource);
00023     return 0;
00024 }
00025
00026 IFrameworkView^ AppViewSource::CreateView()
00027 {
00028     return ref new AppView();
00029 }
00030
00031 AppView::AppView()
00032 {
00033 }
00034
00035
00036 // IFrameworkView methods
00037
00038 // The first method called when the IFrameworkView is being created.
00039 // Use this method to subscribe for Windows shell events and to initialize your app.
00040 void AppView::Initialize(CoreApplicationView^ applicationView)
00041 {
00042     applicationView->Activated +=
00043         ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &AppView::OnViewActivated);
00044
00045     // Register event handlers for app lifecycle.
00046     CoreApplication::Suspending +=
00047         ref new EventHandler<SuspendingEventArgs^>(this, &AppView::OnSuspending);
00048
00049     CoreApplication::Resuming +=
00050         ref new EventHandler<Platform::Object^>(this, &AppView::OnResuming);
00051
00052     // At this point we have access to the device and we can create device-dependent
00053     // resources.
00054     m_deviceResources = std::make_shared<DX::DeviceResources>();
00055
00056     m_main = std::make_unique<HolographicMRCSampleMain>(m_deviceResources);
00057 }
00058
00059 // Called when the CoreWindow object is created (or re-created).
00060 void AppView::SetWindow(CoreWindow^ window)
00061 {
00062     // Register for keypress notifications.
00063     window->KeyDown +=
00064         ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &AppView::OnKeyPressed);
00065
00066     // Register for notification that the app window is being closed.
00067     window->Closed +=
00068         ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &AppView::OnWindowClosed);
00069
00070     // Register for notifications that the app window is losing focus.
00071     window->VisibilityChanged +=
00072         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &AppView::OnVisibilityChanged);
00073
00074     // Create a holographic space for the core window for the current view.
00075     // Presenting holographic frames that are created by this holographic space will put
00076     // the app into exclusive mode.
00077     m_holographicSpace = HolographicSpace::CreateForCoreWindow(window);
00078
00079     // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
00080     // space (when available) to create a Direct3D device. The HolographicSpace
00081     // uses this ID3D11Device to create and manage device-based resources such as
00082     // swap chains.
00083     m_deviceResources->SetHolographicSpace(m_holographicSpace).then([this]()
00084     {
00085         // The main class uses the holographic space for updates and rendering.
00086         m_main->SetHolographicSpace(m_holographicSpace);
00087     });
00088 }
00089
00090 // The Load method can be used to initialize scene resources or to load a
00091 // previously saved app state.
00092 void AppView::Load(Platform::String^ entryPoint)
00093 {
00094 }
00095
00096 // This method is called after the window becomes active. It oversees the
00097 // update, draw, and present loop, and it also oversees window message processing.
00098 void AppView::Run()
00099 {
00100     while (!m_windowClosed)
00101     {
00102         if (m_windowVisible && (m_holographicSpace != nullptr))
00103         {
00104             CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
00105
00106             HolographicFrame^ holographicFrame = m_main->Update();
00107
00108             if (holographicFrame)
00109             {
00110                 if (m_main->Render(holographicFrame))
00111                 {
00112                     // The holographic frame has an API that presents the swap chain for each
00113                     // holographic camera.
00114                     m_deviceResources->Present(holographicFrame);
00115                 }
00116             }
00117         }
00118         else
00119         {
00120             CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00121         }
00122     }
00123 }
00124
00125 // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00126 // class is torn down while the app is in the foreground.
00127 // This method is not often used, but IFrameworkView requires it and it will be called for
00128 // holographic apps.
00129 void AppView::Uninitialize()
00130 {
00131
00132 }
00133
00134
00135 // Application lifecycle event handlers
00136
00137 // Called when the app view is activated. Activates the app's CoreWindow.
00138 void AppView::OnViewActivated(CoreApplicationView^ sender, IActivatedEventArgs^ args)
00139 {
00140     // Run() won't start until the CoreWindow is activated.
00141     sender->CoreWindow->Activate();
00142 }
00143
00144 void AppView::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
00145 {
00146     // Save app state asynchronously after requesting a deferral. Holding a deferral
00147     // indicates that the application is busy performing suspending operations. Be
00148     // aware that a deferral may not be held indefinitely; after about five seconds,
00149     // the app will be forced to exit.
00150     SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
00151
00152     create_task([this, deferral] ()
00153     {
00154         m_deviceResources->Trim();
00155
00156         if (m_main != nullptr)
00157         {
00158             m_main->SaveAppState();
00159         }
00160
00161         deferral->Complete();
00162     });
00163 }
00164
00165 void AppView::OnResuming(Platform::Object^ sender, Platform::Object^ args)
00166 {
00167     // Restore any data or state that was unloaded on suspend. By default, data
00168     // and state are persisted when resuming from suspend. Note that this event
00169     // does not occur if the app was previously terminated.
00170
00171     if (m_main != nullptr)
00172     {
00173         m_main->LoadAppState();
00174     }
00175 }
00176
00177
00178 // Window event handlers
00179
00180 void AppView::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
00181 {
00182     m_windowVisible = args->Visible;
00183 }
00184
00185 void AppView::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
00186 {
00187     m_windowClosed = true;
00188 }
00189
00190
00191 // Input event handlers
00192
00193 void AppView::OnKeyPressed(CoreWindow^ sender, KeyEventArgs^ args)
00194 {
00195 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/BackgroundTask/pch.h Source File

  • OnDemandHotspot
  • cppwinrt
  • BackgroundTask

pch.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002 #include <unknwn.h>
00003 #include <winrt/Windows.Foundation.h>
00004 #include <winrt/Windows.Foundation.Collections.h>
00005 #include "winrt/Windows.ApplicationModel.Background.h"
00006 #include "winrt/Windows.Data.Xml.Dom.h"
00007 #include "winrt/Windows.Devices.WiFi.h"
00008 #include "winrt/Windows.Security.Credentials.h"
00009 #include "winrt/Windows.Storage.h"
00010 #include "winrt/Windows.UI.Notifications.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario1_BuildNewRss.xaml.cs Source File

  • XmlDocument
  • cs

Scenario1_BuildNewRss.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00019
00020 namespace Xml
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class BuildNewRss : Page
00026     {
00027         private MainPage rootPage;
00028
00029         public BuildNewRss()
00030         {
00031             this.InitializeComponent();
00032
00033             Scenario1Init();
00034         }
00035
00036         /// <summary>
00037         /// Invoked when this page is about to be displayed in a Frame.
00038         /// </summary>
00039         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040         /// property is typically used to configure the page.</param>
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             rootPage = MainPage.Current;
00044         }
00045
00046         /// <summary>
00047         /// This is the click handler for the 'Scenario1BtnDefault' button.
00048         /// </summary>
00049         /// <param name="sender"></param>
00050         /// <param name="e"></param>
00051         private void Scenario1BtnDefault_Click(object sender, RoutedEventArgs e)
00052         {
00053             String rss = scenario1RssInput.Text;
00054             if (null != rss && "" != rss)
00055             {
00056                 String xml;
00057                 var doc = new Windows.Data.Xml.Dom.XmlDocument();
00058                 scenario1OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
00059                 doc.LoadXml(xml);
00060
00061                 // create a rss CDataSection and insert into DOM tree
00062                 var cdata = doc.CreateCDataSection(rss);
00063                 var element = doc.GetElementsByTagName("content").Item(0);
00064                 element.AppendChild(cdata);
00065
00066                 Scenario.RichEditBoxSetMsg(scenario1Result, doc.GetXml(), true);
00067             }
00068             else
00069             {
00070                 Scenario.RichEditBoxSetError(scenario1Result, "Please type in RSS content in the [RSS Content] box firstly.");
00071             }
00072         }
00073
00074         private async void Scenario1Init()
00075         {
00076             try
00077             {
00078                 Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("buildRss", "rssTemplate.xml");
00079                 Scenario.RichEditBoxSetMsg(scenario1OriginalData, doc.GetXml(), true);
00080             }
00081             catch (Exception exp)
00082             {
00083                 Scenario.RichEditBoxSetError(scenario1Result, exp.Message);
00084                 rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
00085             }
00086         }
00087     }
00088 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cpp/Scenario2_Binary.xaml.cpp Source File

  • WebSocket
  • cpp

Scenario2_Binary.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2.xaml.cpp
00014 // Implementation of the Scenario2 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Binary.xaml.h"
00019
00020 using namespace concurrency;
00021 using namespace Platform;
00022 using namespace SDKTemplate;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Networking::Sockets;
00026 using namespace Windows::Security::Cryptography;
00027 using namespace Windows::Security::Cryptography::Certificates;
00028 using namespace Windows::Storage::Streams;
00029 using namespace Windows::System::Threading;
00030 using namespace Windows::UI::Core;
00031 using namespace Windows::UI::Xaml;
00032 using namespace Windows::UI::Xaml::Controls;
00033 using namespace Windows::UI::Xaml::Navigation;
00034 using namespace Windows::Web;
00035
00036 Scenario2::Scenario2()
00037 {
00038     InitializeComponent();
00039     UpdateVisualState();
00040 }
00041
00042 void Scenario2::OnNavigatedFrom(NavigationEventArgs^ e)
00043 {
00044     CloseSocket();
00045 }
00046
00047 void Scenario2::UpdateVisualState()
00048 {
00049     if (busy)
00050     {
00051         VisualStateManager::GoToState(this, "Busy", false);
00052     }
00053     else
00054     {
00055         bool connected = (streamWebSocket != nullptr);
00056         VisualStateManager::GoToState(this, connected ? "Connected" : "Disconnected", false);
00057     }
00058 }
00059
00060 void Scenario2::SetBusy(bool value)
00061 {
00062     busy = value;
00063     UpdateVisualState();
00064 }
00065
00066 void Scenario2::OnStart()
00067 {
00068     SetBusy(true);
00069     StartAsync().then([this]()
00070     {
00071         SetBusy(false);
00072     });
00073 }
00074
00075 task<void> Scenario2::StartAsync()
00076 {
00077     // Validating the URI is required since it was received from an untrusted source (user input).
00078     // The URI is validated by calling TryGetUri() that will return 'nullptr' for strings that are not
00079     // valid WebSocket URIs.
00080     // Note that when enabling the text box users may provide URIs to machines on the intrAnet or intErnet. In
00081     // these cases the app requires the "Home or Work Networking" or "Internet (Client)" capability respectively.
00082     Uri^ server = rootPage->TryGetUri(ServerAddressField->Text);
00083     if (!server)
00084     {
00085         return task_from_result();
00086     }
00087
00088     streamWebSocket = ref new StreamWebSocket();
00089     streamWebSocket->Closed += ref new TypedEventHandler<IWebSocket^, WebSocketClosedEventArgs^>(this, &Scenario2::OnClosed);
00090
00091     // If we are connecting to wss:// endpoint, by default, the OS performs validation of
00092     // the server certificate based on well-known trusted CAs. We can perform additional custom
00093     // validation if needed.
00094     if (SecureWebSocketCheckBox->IsChecked->Value)
00095     {
00096         // WARNING: Only test applications should ignore SSL errors.
00097         // In real applications, ignoring server certificate errors can lead to Man-In-The-Middle
00098         // attacks. (Although the connection is secure, the server is not authenticated.)
00099         // Note that not all certificate validation errors can be ignored.
00100         // In this case, we are ignoring these errors since the certificate assigned to the localhost
00101         // URI is self-signed and has subject name = fabrikam.com
00102         streamWebSocket->Control->IgnorableServerCertificateErrors->Append(ChainValidationResult::Untrusted);
00103         streamWebSocket->Control->IgnorableServerCertificateErrors->Append(ChainValidationResult::InvalidName);
00104
00105         // Add event handler to listen to the ServerCustomValidationRequested event. This enables performing
00106         // custom validation of the server certificate. The event handler must implement the desired
00107         // custom certificate validation logic.
00108         streamWebSocket->ServerCustomValidationRequested +=
00109             ref new TypedEventHandler<
00110             StreamWebSocket^,
00111             WebSocketServerCustomValidationRequestedEventArgs^>(
00112                 this,
00113                 &Scenario2::OnServerCustomValidationRequested);
00114
00115         // Certificate validation occurs only for secure connections.
00116         if (server->SchemeName != "wss")
00117         {
00118             AppendOutputLine("Note: Certificate validation is performed only for the wss: scheme.");
00119         }
00120     }
00121
00122     AppendOutputLine("Connecting to " + server->DisplayUri + "...");
00123
00124     return create_task(streamWebSocket->ConnectAsync(server))
00125         .then([this](task<void> previousTask)
00126     {
00127         try
00128         {
00129             // Reraise any exception that occurred in the task.
00130             previousTask.get();
00131         }
00132         catch (Exception^ ex)
00133         {
00134             // Error happened during connect operation.
00135             delete streamWebSocket;
00136             streamWebSocket = nullptr;
00137
00138             AppendOutputLine(MainPage::BuildWebSocketError(ex));
00139             AppendOutputLine(ex->Message);
00140             return;
00141         }
00142
00143         // Start a task to continuously read for incoming data
00144         StartReceiveData(streamWebSocket);
00145
00146         // Start a task to continuously write outgoing data
00147         StartSendData(streamWebSocket);
00148     });
00149 }
00150
00151 void Scenario2::OnServerCustomValidationRequested(
00152     StreamWebSocket^ sender,
00153     WebSocketServerCustomValidationRequestedEventArgs^ args)
00154 {
00155     // In order to call async APIs in this handler, you must first take a deferral and then
00156     // complete it once you are done validating the certificate.
00157     auto deferral = args->GetDeferral();
00158
00159     // Get the server certificate and certificate chain from the args parameter.
00160     MainPage::AreCertificateAndCertChainValidAsync(args->ServerCertificate, args->ServerIntermediateCertificates)
00161         .then([this, args, deferral](bool isValid)
00162     {
00163         if (!isValid)
00164         {
00165             args->Reject();
00166         }
00167         deferral->Complete();
00168
00169         // Continue on the UI thread so we can update UI.
00170         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, isValid]()
00171         {
00172             if (isValid)
00173             {
00174                 AppendOutputLine("Custom validation of server certificate passed.");
00175             }
00176             else
00177             {
00178                 AppendOutputLine("Custom validation of server certificate failed.");
00179             }
00180         }));
00181     });
00182 }
00183
00184 void Scenario2::StartSendData(StreamWebSocket^ activeSocket)
00185 {
00186     // Start a loop to continuously write outgoing data.
00187     BYTE bytes[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
00188     auto data = ref new Platform::Array<byte>(ARRAYSIZE(bytes));
00189     memcpy(data->Data, bytes, ARRAYSIZE(bytes));
00190     IBuffer^ sendBuffer = CryptographicBuffer::CreateFromByteArray(data);
00191
00192     AppendOutputLine("Background write starting.");
00193
00194     SendDataLoop(streamWebSocket, sendBuffer, 0);
00195 }
00196
00197 void Scenario2::SendDataLoop(StreamWebSocket^ activeSocket, IBuffer^ sendBuffer, UINT32 bytesSentSoFar)
00198 {
00199     if (streamWebSocket != activeSocket) {
00200         // Our socket is no longer active. Stop sending.
00201         AppendOutputLine("Background write stopped.");
00202         return;
00203     }
00204
00205     create_task(activeSocket->OutputStream->WriteAsync(sendBuffer))
00206         .then([this, activeSocket, sendBuffer, bytesSentSoFar](task<UINT32> previousTask)
00207     {
00208         UINT32 bytesSentThisCall = 0;
00209         try
00210         {
00211             // Reraise any exception that occurred in the task.
00212             bytesSentThisCall = previousTask.get();
00213         }
00214         catch (Exception^ ex)
00215         {
00216             WebErrorStatus status = WebSocketError::GetStatus(ex->HResult);
00217             if (status == WebErrorStatus::OperationCanceled)
00218             {
00219                 AppendOutputLine("Background write canceled.");
00220             }
00221             else
00222             {
00223                 AppendOutputLine("Error: " + status.ToString());
00224                 AppendOutputLine(ex->Message);
00225             }
00226             return;
00227         }
00228
00229         UINT32 totalBytesSent = bytesSentSoFar + bytesSentThisCall;
00230         DataSentField->Text = totalBytesSent.ToString();
00231
00232         // Delay so the user can watch what's going on.
00233         ThreadPoolTimer::CreateTimer(ref new TimerElapsedHandler(
00234             [this, activeSocket, sendBuffer, totalBytesSent](ThreadPoolTimer^ timer)
00235         {
00236             SendDataLoop(activeSocket, sendBuffer, totalBytesSent);
00237         }, CallbackContext::Same), TimeSpan{ 10000000 }); // 1 second
00238     });
00239 }
00240
00241 // Continuously read incoming data.
00242 void Scenario2::StartReceiveData(StreamWebSocket^ activeSocket)
00243 {
00244     AppendOutputLine("Background read starting.");
00245     ReceiveDataLoop(activeSocket, ref new Buffer(1000), 0);
00246 }
00247
00248 void Scenario2::ReceiveDataLoop(StreamWebSocket^ activeSocket, IBuffer^ readBuffer, UINT32 bytesReceivedSoFar)
00249 {
00250     if (streamWebSocket != activeSocket) {
00251         // Our socket is no longer active. Stop reading.
00252         AppendOutputLine("Background read stopped.");
00253         return;
00254     }
00255
00256     create_task(activeSocket->InputStream->ReadAsync(readBuffer, readBuffer->Capacity, InputStreamOptions::Partial))
00257         .then([this, activeSocket, readBuffer, bytesReceivedSoFar](task<IBuffer^> previousTask)
00258     {
00259         IBuffer^ resultBuffer;
00260         try
00261         {
00262             // Reraise any exception that occurred in the task.
00263             resultBuffer = previousTask.get();
00264         }
00265         catch (Exception^ ex)
00266         {
00267             AppendOutputLine("During read: " + rootPage->BuildWebSocketError(ex));
00268             AppendOutputLine(ex->Message);
00269             return;
00270         }
00271
00272         UINT32 totalBytesReceived = bytesReceivedSoFar + resultBuffer->Length;
00273         DataReceivedField->Text = totalBytesReceived.ToString();
00274
00275         // Do something with the data.
00276
00277         // Continue reading until closed and ReadAsync fails.
00278         ReceiveDataLoop(activeSocket, readBuffer, totalBytesReceived);
00279     });
00280 }
00281
00282 void Scenario2::OnStop()
00283 {
00284     SetBusy(true);
00285     rootPage->NotifyUser("Stopping", NotifyType::StatusMessage);
00286     CloseSocket();
00287     SetBusy(false);
00288     rootPage->NotifyUser("Stopped", NotifyType::StatusMessage);
00289 }
00290
00291 // The method may be triggered remotely by the server sending unsolicited close frame or locally by Close()/delete operator.
00292 void Scenario2::OnClosed(IWebSocket^ sender, WebSocketClosedEventArgs^ args)
00293 {
00294     // Dispatch the event to the UI thread so we do not need to synchronize access to streamWebSocket.
00295     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, sender, args]()
00296     {
00297         AppendOutputLine("Closed; Code: " + args->Code.ToString() + ", Reason: " + args->Reason);
00298
00299         if (streamWebSocket == sender)
00300         {
00301             CloseSocket();
00302             UpdateVisualState();
00303         }
00304     }));
00305 }
00306
00307 void Scenario2::CloseSocket()
00308 {
00309     if (streamWebSocket != nullptr)
00310     {
00311         try
00312         {
00313             streamWebSocket->Close(1000, "Closed due to user request.");
00314         }
00315         catch (Exception^ ex)
00316         {
00317             AppendOutputLine(MainPage::BuildWebSocketError(ex));
00318             AppendOutputLine(ex->Message);
00319         }
00320         streamWebSocket = nullptr;
00321     }
00322 }
00323
00324 void Scenario2::AppendOutputLine(String^ value)
00325 {
00326     OutputField->Text += value + "\r\n";
00327 }
Generated on Fri Nov 15 2024 22:22:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CopyText Member List

This is the complete list of members for CopyText, including all inherited members.
CopyButton_Click(object sender, RoutedEventArgs e) | CopyText | [inline, private]
CopyText() | CopyText | [inline]
DisplayResourceMapAsync(DataPackageView dataPackageView) | CopyText | [inline, private]
htmlFragment | CopyText | [private]
imgSrc | CopyText | [private]
PasteButton_Click(object sender, RoutedEventArgs e) | CopyText | [inline, private]
rootPage | CopyText | [private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

S1_GetAFeed Member List

This is the complete list of members for S1_GetAFeed, including all inherited members.
currentFeed | S1_GetAFeed | [private]
currentItemIndex | S1_GetAFeed | [private]
DisplayCurrentItem() | S1_GetAFeed | [inline, private]
DisplayFeed() | S1_GetAFeed | [inline, private]
GetFeed_Click(object sender, RoutedEventArgs e) | S1_GetAFeed | [inline, private]
LinkField_Click(object sender, RoutedEventArgs e) | S1_GetAFeed | [inline, private]
NextItem_Click(object sender, RoutedEventArgs e) | S1_GetAFeed | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | S1_GetAFeed | [inline, protected]
PreviousItem_Click(object sender, RoutedEventArgs e) | S1_GetAFeed | [inline, private]
rootPage | S1_GetAFeed | [private]
S1_GetAFeed() | S1_GetAFeed | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_DeleteTPM Member List

This is the complete list of members for Scenario6_DeleteTPM, including all inherited members.
Delete_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario6_DeleteTPM |
HandleCardRemoved(Windows::Devices::SmartCards::SmartCardReader const &evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs const &) | Scenario6_DeleteTPM | [private]
m_cardRemovedToken | Scenario6_DeleteTPM | [private]
Scenario6_DeleteTPM() | Scenario6_DeleteTPM |
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_GetAndSetPin Member List

This is the complete list of members for Scenario1_GetAndSetPin, including all inherited members.
GetPinValue_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_GetAndSetPin |
LED_PIN | Scenario1_GetAndSetPin | [private, static]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario1_GetAndSetPin |
Scenario1_GetAndSetPin() | Scenario1_GetAndSetPin |
SetPinHigh_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_GetAndSetPin |
SetPinLow_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_GetAndSetPin |
StartScenario() | Scenario1_GetAndSetPin | [private]
StartStopScenario_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_GetAndSetPin |
StopScenario() | Scenario1_GetAndSetPin | [private]
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/SampleConfiguration.cs Source File

  • SimpleInk
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "SimpleInk sample";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Scenario 1", ClassType=typeof(Scenario1)},
00026             new Scenario() { Title="Scenario 2", ClassType=typeof(Scenario2)},
00027             new Scenario() { Title="Scenario 3", ClassType=typeof(Scenario3)},
00028             new Scenario() { Title="Scenario 4", ClassType=typeof(Scenario4)},
00029             new Scenario() { Title="Scenario 5", ClassType=typeof(Scenario5)},
00030             new Scenario() { Title="Scenario 6", ClassType=typeof(Scenario6)},
00031             new Scenario() { Title="Scenario 7", ClassType=typeof(Scenario7)},
00032             new Scenario() { Title="Scenario 8", ClassType=typeof(Scenario8)},
00033             new Scenario() { Title="Scenario 9", ClassType=typeof(Scenario9)},
00034             new Scenario() { Title="Scenario 10", ClassType=typeof(Scenario10)},
00035             new Scenario() { Title="Scenario 11", ClassType=typeof(Scenario11)},
00036             new Scenario() { Title="Scenario 12", ClassType=typeof(Scenario12)},
00037         };
00038     }
00039
00040     public class Scenario
00041     {
00042         public string Title { get; set; }
00043         public Type ClassType { get; set; }
00044     }
00045
00046     static class HelperFunctions
00047     {
00048         public static void UpdateCanvasSize(FrameworkElement root, FrameworkElement output, FrameworkElement inkCanvas)
00049         {
00050             output.Width = root.ActualWidth;
00051             output.Height = root.ActualHeight / 2;
00052             inkCanvas.Width = root.ActualWidth;
00053             inkCanvas.Height = root.ActualHeight / 2;
00054         }
00055     }
00056
00057     static class MoreSymbols
00058     {
00059         static public Symbol CalligraphyPen = (Symbol)0xEDFB;
00060         static public Symbol LassoSelect = (Symbol)0xEF20;
00061         static public Symbol TouchWriting = (Symbol)0xED5F;
00062     }
00063 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/pch.h Source File

  • HolographicSpatialMapping
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <agile.h>
00015 #include <concrt.h>
00016 #include <d2d1_2.h>
00017 #include <d2d1effects_1.h>
00018 #include <d3d11_4.h>
00019 #include <DirectXColors.h>
00020 #include <DirectXMath.h>
00021 #include <dwrite_2.h>
00022 #include <dxgi1_5.h>
00023 #include <wincodec.h>
00024 #include <WindowsNumerics.h>
00025 #include <wrl.h>
00026 #include <memory>
00027 #include <map>
00028 #include <mutex>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/PoseTrackingFrame.cpp Source File

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

PoseTrackingFrame.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <initguid.h>
00014 #include "PoseTrackingFrame.h"
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Media::Capture::Frames;
00021 using namespace Windows::Storage::Streams;
00022 using namespace Microsoft::WRL;
00023 using namespace WindowsPreview::Media::Capture::Frames;
00024
00025 static const wchar_t *UnknownMediaType= L"Unknown";
00026 static const wchar_t *PerceptionMediaType= L"Perception";
00027
00028 // Formatted Guid strings are 38 characters long, not including the terminator
00029 const unsigned int GuidBufferLength = 40;
00030 static wchar_t PoseTrackingFormat[GuidBufferLength] = { 0 };
00031 static wchar_t PerceptionTypeGuid[GuidBufferLength] = { 0 };
00032
00033 static bool g_staticInitialize = []()
00034 {
00035     (void)StringFromGUID2(MFPoseTrackingPreview::MFPerceptionFormat_PoseTracking, PoseTrackingFormat, _countof(PoseTrackingFormat));
00036     (void)StringFromGUID2(MFMediaType_Perception, PerceptionTypeGuid, _countof(PerceptionTypeGuid));
00037     return true;
00038 }();
00039
00040 // Because we are doing a reinterpret cast between different definitions, let's check that they match
00041 static_assert(sizeof(MFPoseTrackingPreview::TrackedPose) == sizeof(WindowsPreview::Media::Capture::Frames::TrackedPose), "Error: Mismatched size of TrackedPose");
00042 static_assert(offsetof(MFPoseTrackingPreview::TrackedPose, PositionStatus) == offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, PositionStatus), "Error: Mismatched offset of PositionStatus in TrackedPose");
00043 static_assert(offsetof(MFPoseTrackingPreview::TrackedPose, Position) == offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Position), "Error: Mismatched offset of Position in TrackedPose");
00044 static_assert(offsetof(MFPoseTrackingPreview::TrackedPose, OrientationStatus) == offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, OrientationStatus), "Error: Mismatched offset of OrientationStatus in TrackedPose");
00045 static_assert(offsetof(MFPoseTrackingPreview::TrackedPose, Orientation) == offsetof(WindowsPreview::Media::Capture::Frames::TrackedPose, Orientation), "Error: Mismatched offset of v in TrackedPose");
00046
00047 PoseTrackingEntity::PoseTrackingEntity(_In_ Windows::Storage::Streams::IBuffer^ frameBuffer, _In_ unsigned int entityIndex, _In_ const MFPoseTrackingPreview::PoseTrackingEntityData* entityHeader)
00048     : _frameBuffer(frameBuffer),
00049     _entityIndex(entityIndex),
00050     _entityId(entityHeader->EntityId),
00051     _poseSetId(entityHeader->PoseSet),
00052     _posesCount(entityHeader->PosesCount),
00053     _dataSize(entityHeader->DataSizeInBytes),
00054     _isTracked(entityHeader->IsTracked != 0)
00055 {
00056 }
00057
00058 void PoseTrackingEntity::GetPoses(_Out_ Platform::WriteOnlyArray<TrackedPose>^ poses)
00059 {
00060     if (poses == nullptr)
00061     {
00062         throw ref new NullReferenceException(StringReference(L"poses"));
00063     }
00064     if (poses->Length < _posesCount)
00065     {
00066         throw ref new InvalidArgumentException(StringReference(L"poses array is too small"));
00067     }
00068
00069     BufferHelper helper(_frameBuffer);
00070     auto frameHeader = helper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingFrameHeader>(0);
00071     auto entityHeader = helper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingEntityData>(frameHeader->EntityOffsets[_entityIndex]);
00072     helper.CheckBufferSize<MFPoseTrackingPreview::PoseTrackingEntityData, MFPoseTrackingPreview::TrackedPose>(entityHeader, _posesCount - 1);
00073     CopyMemory(poses->Data, entityHeader->Poses, sizeof(TrackedPose) * _posesCount);
00074 }
00075
00076 void PoseTrackingEntity::GetPoses(_In_ const Platform::Array<unsigned int>^ indices, _Out_ Platform::WriteOnlyArray<TrackedPose>^ poses)
00077 {
00078     if (indices == nullptr)
00079     {
00080         throw ref new InvalidArgumentException(StringReference(L"indices"));
00081     }
00082     if (poses == nullptr)
00083     {
00084         throw ref new NullReferenceException(StringReference(L"poses"));
00085     }
00086     if (poses->Length < indices->Length)
00087     {
00088         throw ref new InvalidArgumentException(StringReference(L"poses array is to small"));
00089     }
00090
00091     BufferHelper helper(_frameBuffer);
00092     auto frameHeader = helper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingFrameHeader>(0);
00093     auto entityHeader = helper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingEntityData>(frameHeader->EntityOffsets[_entityIndex]);
00094     helper.CheckBufferSize<MFPoseTrackingPreview::PoseTrackingEntityData, MFPoseTrackingPreview::TrackedPose>(entityHeader, _posesCount - 1);
00095
00096     // The compatibility of the two types has been verified with the static_assert above.
00097     auto sourcePoses = reinterpret_cast<const TrackedPose*>(entityHeader->Poses);
00098
00099     for (unsigned int i = 0; i < indices->Length; i++)
00100     {
00101         auto index = indices[i];
00102         if (index >= _posesCount)
00103         {
00104             std::wstring message(L"Invalid Pose Index: ");
00105             message += std::to_wstring(index);
00106             throw ref new InvalidArgumentException(ref new String(message.c_str()));
00107         }
00108         else
00109         {
00110             poses[i] = sourcePoses[index];
00111         }
00112     }
00113 }
00114
00115 BufferView^ PoseTrackingEntity::GetCustomData()
00116 {
00117     BufferHelper bufferHelper(_frameBuffer);
00118     auto frameHeader = bufferHelper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingFrameHeader>(0);
00119     auto entityHeader = bufferHelper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingEntityData>(frameHeader->EntityOffsets[_entityIndex]);
00120     auto entityCommonDataSize = sizeof_composedStructure<MFPoseTrackingPreview::PoseTrackingEntityData, MFPoseTrackingPreview::TrackedPose>(entityHeader->PosesCount);
00121
00122     auto bufferOffset = frameHeader->EntityOffsets[_entityIndex] + entityCommonDataSize;
00123     auto bufferLength = entityHeader->DataSizeInBytes - entityCommonDataSize;
00124     return ref new BufferView(_frameBuffer, bufferOffset, bufferLength);
00125 }
00126
00127 PoseTrackingFrame::PoseTrackingFrame(Windows::Media::Capture::Frames::MediaFrameReference^ mediaFrameReference,
00128                     _In_ REFIID customDataType,
00129                     _In_ Windows::Storage::Streams::IBuffer^ frameBuffer,
00130                     _In_ Windows::Foundation::Collections::IVectorView<PoseTrackingEntity^>^ entities)
00131     : _mediaFrameReference(mediaFrameReference), _customDataType(customDataType), _frameBuffer(frameBuffer), _entities(entities)
00132 {}
00133
00134 PoseTrackingFrameCreationResult^ PoseTrackingFrame::Create(_In_ Windows::Media::Capture::Frames::MediaFrameReference^ mediaFrameReference)
00135 {
00136     if (mediaFrameReference == nullptr)
00137     {
00138         throw ref new InvalidArgumentException(StringReference(L"mediaFrameReference"));
00139     }
00140
00141     // UnknownMediaType may be returned as the MajorType.
00142     if ((0 != _wcsicmp(mediaFrameReference->Format->MajorType->Data(), UnknownMediaType))
00143         && (0 != _wcsicmp(mediaFrameReference->Format->MajorType->Data(), PerceptionTypeGuid))
00144         && (0 != _wcsicmp(mediaFrameReference->Format->MajorType->Data(), PerceptionMediaType))
00145         )
00146     {
00147         return ref new PoseTrackingFrameCreationResult(nullptr, PoseTrackingFrameCreationStatus::NotAPerceptionMediaType);
00148     }
00149
00150
00151     if (0 != _wcsicmp(mediaFrameReference->Format->Subtype->Data(), PoseTrackingFormat))
00152     {
00153         return ref new PoseTrackingFrameCreationResult(nullptr, PoseTrackingFrameCreationStatus::NotAPoseTrackingFrame);
00154     }
00155
00156     auto bmf = mediaFrameReference->BufferMediaFrame;
00157     if (bmf == nullptr)
00158     {
00159         return ref new PoseTrackingFrameCreationResult(nullptr, PoseTrackingFrameCreationStatus::FrameBufferReleased);
00160     }
00161     auto buffer = bmf->Buffer;
00162     if (buffer == nullptr)
00163     {
00164         return ref new PoseTrackingFrameCreationResult(nullptr, PoseTrackingFrameCreationStatus::FrameBufferReleased);
00165     }
00166
00167     BufferHelper bufferHelper(buffer);
00168     auto frameHeader = bufferHelper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingFrameHeader>(0);
00169     auto entities = ref new Vector<PoseTrackingEntity^>(frameHeader->EntitiesCount);
00170
00171     for (unsigned int index = 0; index < frameHeader->EntitiesCount; index++)
00172     {
00173         auto entityHeader = bufferHelper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingEntityData>(frameHeader->EntityOffsets[index]);
00174         entities->SetAt(index, ref new PoseTrackingEntity(buffer, index, entityHeader));
00175     }
00176
00177     return ref new PoseTrackingFrameCreationResult(ref new PoseTrackingFrame(mediaFrameReference, frameHeader->CustomDataTypeGuid, buffer, entities->GetView()), PoseTrackingFrameCreationStatus::Success);
00178 }
00179
00180 BufferView^ PoseTrackingFrame::GetCustomData()
00181 {
00182     BufferHelper bufferHelper(_frameBuffer);
00183     auto frameHeader = bufferHelper.GetPtrAt<MFPoseTrackingPreview::PoseTrackingFrameHeader>(0);
00184
00185     auto bufferOffset = sizeof_composedStructure<MFPoseTrackingPreview::PoseTrackingFrameHeader, uint32_t>(frameHeader->EntitiesCount);
00186     auto bufferLength = frameHeader->EntityOffsets[0] - bufferOffset;
00187     return ref new BufferView(_frameBuffer, bufferOffset, bufferLength);
00188 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cs/Scenario1_FindId.xaml.cs Source File

  • Unicode
  • cs

Scenario1_FindId.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using Windows.Foundation;
00016 using Windows.Data.Text;
00017 using System;
00018 using System.Text;
00019 using System.Collections;
00020 using System.Collections.Generic;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario1_FindId : Page
00025     {
00026         public Scenario1_FindId()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         /// <summary>
00032         // This is a helper method that an app could create to find one or all available
00033         // ids within a string.  An id begins with a character for which IsIdStart,
00034         // and continues with characters that are IsIdContinue. Invalid sequences are ignored.
00035         /// </summary>
00036         /// <param name="inputString">String from which to extract ids</param>
00037         /// <returns>List of individual ids found in the input string</returns>
00038         private List<String> FindIdsInString(String inputString)
00039         {
00040             // List where we maintain the ids found in the input string
00041             List<String> idList = new List<String>();
00042
00043             // Maintains the beginning index of the id found in the input string
00044             int indexIdStart = -1;
00045
00046             // Iterate through each of the characters in the string
00047             int i = 0;
00048             while (i < inputString.Length)
00049             {
00050                 int nextIndex;
00051                 uint codepoint = inputString[i];
00052
00053                 if (UnicodeCharacters.IsHighSurrogate(codepoint))
00054                 {
00055                     // If the character is a high surrogate, then the next characters must be a low surrogate.
00056                     if ((i < inputString.Length) && (UnicodeCharacters.IsLowSurrogate(inputString[i+1])))
00057                     {
00058                         // Update the code point with the surrogate pair.
00059                         codepoint = UnicodeCharacters.GetCodepointFromSurrogatePair(codepoint, inputString[i+1]);
00060                         nextIndex = i + 2;
00061                     }
00062                     else
00063                     {
00064                         // Warning: High surrogate not followed by low surrogate.
00065                         codepoint = 0;
00066                         nextIndex = i + 1;
00067                     }
00068                 }
00069                 else
00070                 {
00071                     // Not a surrogate pair.
00072                     nextIndex = i + 1;
00073                 }
00074
00075                 if (indexIdStart == -1)
00076                 {
00077                     // Not in an id. Have we found an id start?
00078                     if (UnicodeCharacters.IsIdStart(codepoint))
00079                     {
00080                         indexIdStart = i;
00081                     }
00082                 }
00083                 else if (!UnicodeCharacters.IsIdContinue(codepoint))
00084                 {
00085                     // We have not found an id continue, so the id is complete.  We need to
00086                     // create the identifier string
00087                     idList.Add(inputString.Substring(indexIdStart, i - indexIdStart));
00088
00089                     // Reset back the index start and re-examine the current code point
00090                     // in next iteration
00091                     indexIdStart = -1;
00092                     nextIndex = i;
00093                 }
00094                 i = nextIndex;
00095             }
00096
00097             // Do we have a pending id at the end of the string?
00098             if (indexIdStart != -1)
00099             {
00100                 //  We need to create the identifier string
00101                 idList.Add(inputString.Substring(indexIdStart, i - indexIdStart));
00102             }
00103
00104             // Return the list of identifiers found in the string
00105             return idList;
00106         }
00107
00108         /// <summary>
00109         /// This is the click handler for the 'Extract Identifiers' button.
00110         /// It relies on the FindIdsInString method to implement the logic.
00111         /// </summary>
00112         /// <param name="sender"></param>
00113         /// <param name="e"></param>
00114         private void Default_Click(object sender, RoutedEventArgs e)
00115         {
00116             var results = FindIdsInString(TextInput.Text);
00117             TextOutput.Text = String.Join(", ", results);
00118         }
00119
00120     }
00121 }
Generated on Fri Nov 15 2024 22:21:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/pch.cpp Source File

  • KeyCredentialManager
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/SampleConfiguration.cs Source File

  • CredentialPicker
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using CredentialPicker;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "CredentialPicker";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Message", ClassType=typeof(Scenario1_Message)},
00026             new Scenario() { Title="Message+Caption", ClassType=typeof(Scenario2_MessageCaption)},
00027             new Scenario() { Title="CredentialPickerOptions", ClassType=typeof(Scenario3_CredentialPickerOptions)}
00028         };
00029     }
00030
00031     public class Scenario
00032     {
00033         public string Title { get; set; }
00034         public Type ClassType { get; set; }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/Scenario4.h Source File

  • FolderEnumeration
  • cppwinrt

Scenario4.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario4 : Scenario4T<Scenario4>
00020     {
00021         Scenario4();
00022         fire_and_forget GetFilesButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario4 : Scenario4T<Scenario4, implementation::Scenario4>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/Scenario2StandardOptons.xaml.cs Source File

  • Printing
  • cs

Scenario2StandardOptons.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using Windows.Graphics.Printing;
00018 using SDKTemplate;
00019
00020 namespace PrintSample
00021 {
00022     class StandardOptionsPrintHelper : PrintHelper
00023     {
00024         public StandardOptionsPrintHelper(Page scenarioPage) : base(scenarioPage) { }
00025
00026         /// <summary>
00027         /// This is the event handler for PrintManager.PrintTaskRequested.
00028         /// In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline.
00029         /// Therefore, we use this handler to only create the print task.
00030         /// The print settings customization can be done when the print document source is requested.
00031         /// </summary>
00032         /// <param name="sender">PrintManager</param>
00033         /// <param name="e">PrintTaskRequestedEventArgs</param>
00034         protected override void PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e)
00035         {
00036             PrintTask printTask = null;
00037             printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequestedArgs =>
00038             {
00039                 IList<string> displayedOptions = printTask.Options.DisplayedOptions;
00040
00041                 // Choose the printer options to be shown.
00042                 // The order in which the options are appended determines the order in which they appear in the UI
00043                 displayedOptions.Clear();
00044                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
00045                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
00046                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
00047                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Collation);
00048                 displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Duplex);
00049
00050                 // Preset the default value of the printer option
00051                 printTask.Options.MediaSize = PrintMediaSize.NorthAmericaLegal;
00052
00053                 // Print Task event handler is invoked when the print job is completed.
00054                 printTask.Completed += async (s, args) =>
00055                 {
00056                     // Notify the user when the print operation fails.
00057                     if (args.Completion == PrintTaskCompletion.Failed)
00058                     {
00059                         await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00060                         {
00061                             MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
00062                         });
00063                     }
00064                 };
00065
00066                 sourceRequestedArgs.SetSource(printDocumentSource);
00067             });
00068         }
00069     }
00070
00071     /// <summary>
00072     /// Scenario that demos how to add customizations in the displayed options list.
00073     /// </summary>
00074     public sealed partial class Scenario2StandardOptions : Page
00075     {
00076         private StandardOptionsPrintHelper printHelper;
00077
00078         public Scenario2StandardOptions()
00079         {
00080             this.InitializeComponent();
00081         }
00082
00083         /// <summary>
00084         /// This is the click handler for the 'Print' button.
00085         /// </summary>
00086         /// <param name="sender"></param>
00087         /// <param name="e"></param>
00088         private async void OnPrintButtonClick(object sender, RoutedEventArgs e)
00089         {
00090             await printHelper.ShowPrintUIAsync();
00091         }
00092
00093         protected override void OnNavigatedTo(NavigationEventArgs e)
00094         {
00095             if (PrintManager.IsSupported())
00096             {
00097                 // Tell the user how to print
00098                 MainPage.Current.NotifyUser("Print contract registered with customization, use the Print button to print.", NotifyType.StatusMessage);
00099             }
00100             else
00101             {
00102                 // Remove the print button
00103                 InvokePrintingButton.Visibility = Visibility.Collapsed;
00104
00105                 // Inform user that Printing is not supported
00106                 MainPage.Current.NotifyUser("Printing is not supported.", NotifyType.ErrorMessage);
00107
00108                 // Printing-related event handlers will never be called if printing
00109                 // is not supported, but it's okay to register for them anyway.
00110             }
00111
00112             // Initalize common helper class and register for printing
00113             printHelper = new StandardOptionsPrintHelper(this);
00114             printHelper.RegisterForPrinting();
00115
00116             // Initialize print content for this scenario
00117             printHelper.PreparePrintContent(new PageToPrint());
00118         }
00119
00120         protected override void OnNavigatedFrom(NavigationEventArgs e)
00121         {
00122             if (printHelper != null)
00123             {
00124                 printHelper.UnregisterForPrinting();
00125             }
00126         }
00127     }
00128 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GameRenderer Member List

This is the complete list of members for GameRenderer, including all inherited members.
__pad0__ | GameRenderer |
CreateDeviceDependentResources() | GameRenderer |
CreateDeviceDependentResources() | GameRenderer |
CreateDeviceDependentResources() | GameRenderer |
CreateGameDeviceResourcesAsync(_In_ Simple3DGame^game) | GameRenderer |
CreateGameDeviceResourcesAsync(_In_ std::shared_ptr< Simple3DGame > game) | GameRenderer |
CreateGameDeviceResourcesAsync(_In_ Simple3DGame^game) | GameRenderer |
CreateWindowSizeDependentResources() | GameRenderer |
CreateWindowSizeDependentResources() | GameRenderer |
CreateWindowSizeDependentResources() | GameRenderer |
FinalizeCreateGameDeviceResources() | GameRenderer |
FinalizeCreateGameDeviceResources() | GameRenderer |
FinalizeCreateGameDeviceResources() | GameRenderer |
FinalizeLoadLevelResources() | GameRenderer |
FinalizeLoadLevelResources() | GameRenderer |
FinalizeLoadLevelResources() | GameRenderer |
GameInfoOverlayLowerRight() | GameRenderer | [inline]
GameInfoOverlayLowerRight() | GameRenderer | [inline]
GameInfoOverlayUpperLeft() | GameRenderer | [inline]
GameInfoOverlayUpperLeft() | GameRenderer | [inline]
GameInfoOverlayVisible() | GameRenderer | [inline]
GameInfoOverlayVisible() | GameRenderer | [inline]
GameRenderer(std::shared_ptr< DX::DeviceResources > const &deviceResources) | GameRenderer |
GameUIControl() | GameRenderer | [inline]
GameUIControl() | GameRenderer | [inline]
Hud() | GameRenderer | [inline]
LoadLevelResourcesAsync() | GameRenderer |
LoadLevelResourcesAsync() | GameRenderer |
LoadLevelResourcesAsync() | GameRenderer |
m_ceilingTexture | GameRenderer | [private]
m_ceilingTexture | GameRenderer | [private]
m_constantBufferChangeOnResize | GameRenderer | [private]
m_constantBufferChangeOnResize | GameRenderer | [private]
m_constantBufferChangesEveryFrame | GameRenderer | [private]
m_constantBufferChangesEveryFrame | GameRenderer | [private]
m_constantBufferChangesEveryPrim | GameRenderer | [private]
m_constantBufferChangesEveryPrim | GameRenderer | [private]
m_constantBufferNeverChanges | GameRenderer | [private]
m_constantBufferNeverChanges | GameRenderer | [private]
m_cylinderTexture | GameRenderer | [private]
m_cylinderTexture | GameRenderer | [private]
m_deviceResources | GameRenderer | [private]
m_floorTexture | GameRenderer | [private]
m_floorTexture | GameRenderer | [private]
m_game | GameRenderer | [private]
m_game | GameRenderer | [private]
m_gameHud | GameRenderer | [private]
m_gameInfoOverlay | GameRenderer | [private]
m_gameInfoOverlayRect | GameRenderer | [private]
m_gameInfoOverlaySize | GameRenderer | [private]
m_gameResourcesLoaded | GameRenderer | [private]
m_initialized | GameRenderer | [private]
m_levelResourcesLoaded | GameRenderer | [private]
m_pixelShader | GameRenderer | [private]
m_pixelShader | GameRenderer | [private]
m_pixelShaderFlat | GameRenderer | [private]
m_pixelShaderFlat | GameRenderer | [private]
m_samplerLinear | GameRenderer | [private]
m_samplerLinear | GameRenderer | [private]
m_sphereTexture | GameRenderer | [private]
m_sphereTexture | GameRenderer | [private]
m_vertexLayout | GameRenderer | [private]
m_vertexLayout | GameRenderer | [private]
m_vertexShader | GameRenderer | [private]
m_vertexShader | GameRenderer | [private]
m_vertexShaderFlat | GameRenderer | [private]
m_vertexShaderFlat | GameRenderer | [private]
m_wallsTexture | GameRenderer | [private]
m_wallsTexture | GameRenderer | [private]
ReleaseDeviceDependentResources() | GameRenderer |
ReleaseDeviceDependentResources() | GameRenderer |
ReleaseDeviceDependentResources() | GameRenderer |
Render() | GameRenderer |
Render() | GameRenderer |
Render() | GameRenderer |
SetBackground(uint32 background) | GameRenderer |
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EmbeddedMFAsyncCallback< Callback > Member List

This is the complete list of members for EmbeddedMFAsyncCallback< Callback >, including all inherited members.
EmbeddedMFAsyncCallback(ParentPtr parent) | EmbeddedMFAsyncCallback< Callback > | [inline]
GetParameters(DWORD *flags, DWORD *queueId) final | EmbeddedMFAsyncCallback< Callback > | [inline]
Invoke(IMFAsyncResult *result) final | EmbeddedMFAsyncCallback< Callback > | [inline]
m_parent | EmbeddedMFAsyncCallback< Callback > |
m_queueId | EmbeddedMFAsyncCallback< Callback > |
parent_finder(HRESULT(Parent::*)(IMFAsyncResult *)) | EmbeddedMFAsyncCallback< Callback > | [inline, static]
QueryInterface(REFIID riid, void **ppvObject) final | EmbeddedMFAsyncCallback< Callback > | [inline]
SetQueueID(DWORD queueId) | EmbeddedMFAsyncCallback< Callback > | [inline]
STDMETHOD_(ULONG, AddRef)() final | EmbeddedMFAsyncCallback< Callback > | [inline]
STDMETHOD_(ULONG, Release)() final | EmbeddedMFAsyncCallback< Callback > | [inline]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario4_Input.h Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario4_Input.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_Input.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario4_Input : Scenario4_InputT<Scenario4_Input>
00019     {
00020         Scenario4_Input();
00021
00022         void ShowResults_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario4_Input : Scenario4_InputT<Scenario4_Input, implementation::Scenario4_Input>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/DeviceResources.cpp Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DeviceResources.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace D2D1;
00017 using namespace DirectX;
00018 using namespace Microsoft::WRL;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Graphics::Display;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Platform;
00024
00025 // Constants used to calculate screen rotations
00026 namespace ScreenRotation
00027 {
00028     // 0-degree Z-rotation
00029     static const XMFLOAT4X4 Rotation0(
00030         1.0f, 0.0f, 0.0f, 0.0f,
00031         0.0f, 1.0f, 0.0f, 0.0f,
00032         0.0f, 0.0f, 1.0f, 0.0f,
00033         0.0f, 0.0f, 0.0f, 1.0f
00034         );
00035
00036     // 90-degree Z-rotation
00037     static const XMFLOAT4X4 Rotation90(
00038         0.0f, 1.0f, 0.0f, 0.0f,
00039         -1.0f, 0.0f, 0.0f, 0.0f,
00040         0.0f, 0.0f, 1.0f, 0.0f,
00041         0.0f, 0.0f, 0.0f, 1.0f
00042         );
00043
00044     // 180-degree Z-rotation
00045     static const XMFLOAT4X4 Rotation180(
00046         -1.0f, 0.0f, 0.0f, 0.0f,
00047         0.0f, -1.0f, 0.0f, 0.0f,
00048         0.0f, 0.0f, 1.0f, 0.0f,
00049         0.0f, 0.0f, 0.0f, 1.0f
00050         );
00051
00052     // 270-degree Z-rotation
00053     static const XMFLOAT4X4 Rotation270(
00054         0.0f, -1.0f, 0.0f, 0.0f,
00055         1.0f, 0.0f, 0.0f, 0.0f,
00056         0.0f, 0.0f, 1.0f, 0.0f,
00057         0.0f, 0.0f, 0.0f, 1.0f
00058         );
00059 };
00060
00061 // Constructor for DeviceResources.
00062 DX::DeviceResources::DeviceResources() :
00063     m_screenViewport(),
00064     m_d3dFeatureLevel(D3D_FEATURE_LEVEL_9_1),
00065     m_d3dRenderTargetSize(),
00066     m_outputSize(),
00067     m_logicalSize(),
00068     m_nativeOrientation(DisplayOrientations::None),
00069     m_currentOrientation(DisplayOrientations::None),
00070     m_dpi(-1.0f),
00071     m_deviceNotify(nullptr)
00072 {
00073     CreateDeviceIndependentResources();
00074     CreateDeviceResources();
00075 }
00076
00077 // Configures resources that don't depend on the Direct3D device.
00078 void DX::DeviceResources::CreateDeviceIndependentResources()
00079 {
00080     // Initialize Direct2D resources.
00081     D2D1_FACTORY_OPTIONS options;
00082     ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
00083
00084 #if defined(_DEBUG)
00085     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00086     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00087 #endif
00088
00089     // Initialize the Direct2D Factory.
00090     DX::ThrowIfFailed(
00091         D2D1CreateFactory(
00092             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00093             __uuidof(ID2D1Factory2),
00094             &options,
00095             &m_d2dFactory
00096             )
00097         );
00098
00099     // Initialize the DirectWrite Factory.
00100     DX::ThrowIfFailed(
00101         DWriteCreateFactory(
00102             DWRITE_FACTORY_TYPE_SHARED,
00103             __uuidof(IDWriteFactory2),
00104             &m_dwriteFactory
00105             )
00106         );
00107
00108     // Initialize the Windows Imaging Component (WIC) Factory.
00109     DX::ThrowIfFailed(
00110         CoCreateInstance(
00111             CLSID_WICImagingFactory2,
00112             nullptr,
00113             CLSCTX_INPROC_SERVER,
00114             IID_PPV_ARGS(&m_wicFactory)
00115             )
00116         );
00117 }
00118
00119 // Configures the Direct3D device, and stores handles to it and the device context.
00120 void DX::DeviceResources::CreateDeviceResources()
00121 {
00122     // This flag adds support for surfaces with a different color channel ordering
00123     // than the API default. It is required for compatibility with Direct2D.
00124     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00125
00126 #if defined(_DEBUG)
00127     if (DX::SdkLayersAvailable())
00128     {
00129         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00130         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00131     }
00132 #endif
00133
00134     // This array defines the set of DirectX hardware feature levels this app will support.
00135     // Note the ordering should be preserved.
00136     // Don't forget to declare your application's minimum required feature level in its
00137     // description.  All applications are assumed to support 9.1 unless otherwise stated.
00138     D3D_FEATURE_LEVEL featureLevels[] =
00139     {
00140         D3D_FEATURE_LEVEL_11_1,
00141         D3D_FEATURE_LEVEL_11_0,
00142         D3D_FEATURE_LEVEL_10_1,
00143         D3D_FEATURE_LEVEL_10_0,
00144         D3D_FEATURE_LEVEL_9_3,
00145         D3D_FEATURE_LEVEL_9_2,
00146         D3D_FEATURE_LEVEL_9_1
00147     };
00148
00149     // Create the Direct3D 11 API device object and a corresponding context.
00150     ComPtr<ID3D11Device> device;
00151     ComPtr<ID3D11DeviceContext> context;
00152
00153     HRESULT hr = D3D11CreateDevice(
00154         nullptr,                    // Specify nullptr to use the default adapter.
00155         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00156         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00157         creationFlags,              // Set debug and Direct2D compatibility flags.
00158         featureLevels,              // List of feature levels this app can support.
00159         ARRAYSIZE(featureLevels),   // Size of the list above.
00160         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00161         &device,                    // Returns the Direct3D device created.
00162         &m_d3dFeatureLevel,         // Returns feature level of device created.
00163         &context                    // Returns the device immediate context.
00164         );
00165
00166     if (FAILED(hr))
00167     {
00168         // If the initialization fails, fall back to the WARP device.
00169         // For more information on WARP, see:
00170         // http://go.microsoft.com/fwlink/?LinkId=286690
00171         DX::ThrowIfFailed(
00172             D3D11CreateDevice(
00173                 nullptr,
00174                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00175                 0,
00176                 creationFlags,
00177                 featureLevels,
00178                 ARRAYSIZE(featureLevels),
00179                 D3D11_SDK_VERSION,
00180                 &device,
00181                 &m_d3dFeatureLevel,
00182                 &context
00183                 )
00184             );
00185     }
00186
00187     // Store pointers to the Direct3D 11.1 API device and immediate context.
00188     DX::ThrowIfFailed(
00189         device.As(&m_d3dDevice)
00190         );
00191
00192     DX::ThrowIfFailed(
00193         context.As(&m_d3dContext)
00194         );
00195
00196     // Create the Direct2D device object and a corresponding context.
00197     ComPtr<IDXGIDevice3> dxgiDevice;
00198     DX::ThrowIfFailed(
00199         m_d3dDevice.As(&dxgiDevice)
00200         );
00201
00202     DX::ThrowIfFailed(
00203         m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
00204         );
00205
00206     DX::ThrowIfFailed(
00207         m_d2dDevice->CreateDeviceContext(
00208             D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
00209             &m_d2dContext
00210             )
00211         );
00212 }
00213
00214 // These resources need to be recreated every time the window size is changed.
00215 void DX::DeviceResources::CreateWindowSizeDependentResources()
00216 {
00217     // Clear the previous window size specific context.
00218     ID3D11RenderTargetView* nullViews[] = {nullptr};
00219     m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00220     m_d3dRenderTargetView = nullptr;
00221     m_d2dContext->SetTarget(nullptr);
00222     m_d2dTargetBitmap = nullptr;
00223     m_d3dDepthStencilView = nullptr;
00224     m_d3dContext->Flush();
00225
00226     // Calculate the necessary render target size in pixels.
00227     m_outputSize.Width = DX::ConvertDipsToPixels(m_logicalSize.Width, m_dpi);
00228     m_outputSize.Height = DX::ConvertDipsToPixels(m_logicalSize.Height, m_dpi);
00229
00230     // Prevent zero size DirectX content from being created.
00231     m_outputSize.Width = max(m_outputSize.Width, 1);
00232     m_outputSize.Height = max(m_outputSize.Height, 1);
00233
00234     // The width and height of the swap chain must be based on the window's
00235     // natively-oriented width and height. If the window is not in the native
00236     // orientation, the dimensions must be reversed.
00237     DXGI_MODE_ROTATION displayRotation = ComputeDisplayRotation();
00238
00239     bool swapDimensions = displayRotation == DXGI_MODE_ROTATION_ROTATE90 || displayRotation == DXGI_MODE_ROTATION_ROTATE270;
00240     m_d3dRenderTargetSize.Width = swapDimensions ? m_outputSize.Height : m_outputSize.Width;
00241     m_d3dRenderTargetSize.Height = swapDimensions ? m_outputSize.Width : m_outputSize.Height;
00242
00243     if (m_swapChain != nullptr)
00244     {
00245         // If the swap chain already exists, resize it.
00246         HRESULT hr = m_swapChain->ResizeBuffers(
00247             2, // Double-buffered swap chain.
00248             lround(m_d3dRenderTargetSize.Width),
00249             lround(m_d3dRenderTargetSize.Height),
00250             DXGI_FORMAT_B8G8R8A8_UNORM,
00251             0
00252             );
00253
00254         if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00255         {
00256             // If the device was removed for any reason, a new device and swap chain will need to be created.
00257             HandleDeviceLost();
00258
00259             // Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method
00260             // and correctly set up the new device.
00261             return;
00262         }
00263         else
00264         {
00265             DX::ThrowIfFailed(hr);
00266         }
00267     }
00268     else
00269     {
00270         // Otherwise, create a new one using the same adapter as the existing Direct3D device.
00271         DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
00272
00273         swapChainDesc.Width = lround(m_d3dRenderTargetSize.Width); // Match the size of the window.
00274         swapChainDesc.Height = lround(m_d3dRenderTargetSize.Height);
00275         swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
00276         swapChainDesc.Stereo = false;
00277         swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
00278         swapChainDesc.SampleDesc.Quality = 0;
00279         swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
00280         swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
00281         swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Runtime apps must use this SwapEffect.
00282         swapChainDesc.Flags = 0;
00283         swapChainDesc.Scaling = DXGI_SCALING_NONE;
00284         swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
00285
00286         // This sequence obtains the DXGI factory that was used to create the Direct3D device above.
00287         ComPtr<IDXGIDevice3> dxgiDevice;
00288         DX::ThrowIfFailed(
00289             m_d3dDevice.As(&dxgiDevice)
00290             );
00291
00292         ComPtr<IDXGIAdapter> dxgiAdapter;
00293         DX::ThrowIfFailed(
00294             dxgiDevice->GetAdapter(&dxgiAdapter)
00295             );
00296
00297         ComPtr<IDXGIFactory2> dxgiFactory;
00298         DX::ThrowIfFailed(
00299             dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
00300             );
00301
00302         DX::ThrowIfFailed(
00303             dxgiFactory->CreateSwapChainForCoreWindow(
00304                 m_d3dDevice.Get(),
00305                 reinterpret_cast<IUnknown*>(m_window.Get()),
00306                 &swapChainDesc,
00307                 nullptr,
00308                 &m_swapChain
00309                 )
00310             );
00311
00312         // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
00313         // ensures that the application will only render after each VSync, minimizing power consumption.
00314         DX::ThrowIfFailed(
00315             dxgiDevice->SetMaximumFrameLatency(1)
00316             );
00317     }
00318
00319     // Set the proper orientation for the swap chain, and generate 2D and
00320     // 3D matrix transformations for rendering to the rotated swap chain.
00321     // Note the rotation angle for the 2D and 3D transforms are different.
00322     // This is due to the difference in coordinate spaces.  Additionally,
00323     // the 3D matrix is specified explicitly to avoid rounding errors.
00324
00325     switch (displayRotation)
00326     {
00327     case DXGI_MODE_ROTATION_IDENTITY:
00328         m_orientationTransform2D = Matrix3x2F::Identity();
00329         m_orientationTransform3D = ScreenRotation::Rotation0;
00330         break;
00331
00332     case DXGI_MODE_ROTATION_ROTATE90:
00333         m_orientationTransform2D =
00334             Matrix3x2F::Rotation(90.0f) *
00335             Matrix3x2F::Translation(m_logicalSize.Height, 0.0f);
00336         m_orientationTransform3D = ScreenRotation::Rotation270;
00337         break;
00338
00339     case DXGI_MODE_ROTATION_ROTATE180:
00340         m_orientationTransform2D =
00341             Matrix3x2F::Rotation(180.0f) *
00342             Matrix3x2F::Translation(m_logicalSize.Width, m_logicalSize.Height);
00343         m_orientationTransform3D = ScreenRotation::Rotation180;
00344         break;
00345
00346     case DXGI_MODE_ROTATION_ROTATE270:
00347         m_orientationTransform2D =
00348             Matrix3x2F::Rotation(270.0f) *
00349             Matrix3x2F::Translation(0.0f, m_logicalSize.Width);
00350         m_orientationTransform3D = ScreenRotation::Rotation90;
00351         break;
00352
00353     default:
00354         throw ref new FailureException();
00355     }
00356
00357     DX::ThrowIfFailed(
00358         m_swapChain->SetRotation(displayRotation)
00359         );
00360
00361     // Create a render target view of the swap chain back buffer.
00362     ComPtr<ID3D11Texture2D> backBuffer;
00363     DX::ThrowIfFailed(
00364         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
00365         );
00366
00367     DX::ThrowIfFailed(
00368         m_d3dDevice->CreateRenderTargetView(
00369             backBuffer.Get(),
00370             nullptr,
00371             &m_d3dRenderTargetView
00372             )
00373         );
00374
00375     // Create a depth stencil view for use with 3D rendering if needed.
00376     CD3D11_TEXTURE2D_DESC depthStencilDesc(
00377         DXGI_FORMAT_D24_UNORM_S8_UINT,
00378         lround(m_d3dRenderTargetSize.Width),
00379         lround(m_d3dRenderTargetSize.Height),
00380         1, // This depth stencil view has only one texture.
00381         1, // Use a single mipmap level.
00382         D3D11_BIND_DEPTH_STENCIL
00383         );
00384
00385     ComPtr<ID3D11Texture2D> depthStencil;
00386     DX::ThrowIfFailed(
00387         m_d3dDevice->CreateTexture2D(
00388             &depthStencilDesc,
00389             nullptr,
00390             &depthStencil
00391             )
00392         );
00393
00394     CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
00395     DX::ThrowIfFailed(
00396         m_d3dDevice->CreateDepthStencilView(
00397             depthStencil.Get(),
00398             &depthStencilViewDesc,
00399             &m_d3dDepthStencilView
00400             )
00401         );
00402
00403     // Set the 3D rendering viewport to target the entire window.
00404     m_screenViewport = CD3D11_VIEWPORT(
00405         0.0f,
00406         0.0f,
00407         m_d3dRenderTargetSize.Width,
00408         m_d3dRenderTargetSize.Height
00409         );
00410
00411     m_d3dContext->RSSetViewports(1, &m_screenViewport);
00412
00413     // Create a Direct2D target bitmap associated with the
00414     // swap chain back buffer and set it as the current target.
00415     D2D1_BITMAP_PROPERTIES1 bitmapProperties =
00416         D2D1::BitmapProperties1(
00417             D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
00418             D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00419             m_dpi,
00420             m_dpi
00421             );
00422
00423     ComPtr<IDXGISurface2> dxgiBackBuffer;
00424     DX::ThrowIfFailed(
00425         m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
00426         );
00427
00428     DX::ThrowIfFailed(
00429         m_d2dContext->CreateBitmapFromDxgiSurface(
00430             dxgiBackBuffer.Get(),
00431             &bitmapProperties,
00432             &m_d2dTargetBitmap
00433             )
00434         );
00435
00436     m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
00437
00438     // Grayscale text anti-aliasing is recommended for all Windows Runtime apps.
00439     m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
00440 }
00441
00442 // This method is called when the CoreWindow is created (or re-created).
00443 void DX::DeviceResources::SetWindow(CoreWindow^ window)
00444 {
00445     DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
00446
00447     m_window = window;
00448     m_logicalSize = Windows::Foundation::Size(window->Bounds.Width, window->Bounds.Height);
00449     m_nativeOrientation = currentDisplayInformation->NativeOrientation;
00450     m_currentOrientation = currentDisplayInformation->CurrentOrientation;
00451     m_dpi = currentDisplayInformation->LogicalDpi;
00452     m_d2dContext->SetDpi(m_dpi, m_dpi);
00453
00454     CreateWindowSizeDependentResources();
00455 }
00456
00457 // This method is called in the event handler for the SizeChanged event.
00458 void DX::DeviceResources::SetLogicalSize(Windows::Foundation::Size logicalSize)
00459 {
00460     if (m_logicalSize != logicalSize)
00461     {
00462         m_logicalSize = logicalSize;
00463         CreateWindowSizeDependentResources();
00464     }
00465 }
00466
00467 // This method is called in the event handler for the DpiChanged event.
00468 void DX::DeviceResources::SetDpi(float dpi)
00469 {
00470     if (dpi != m_dpi)
00471     {
00472         m_dpi = dpi;
00473
00474         // When the display DPI changes, the logical size of the window (measured in Dips) also changes and needs to be updated.
00475         m_logicalSize = Windows::Foundation::Size(m_window->Bounds.Width, m_window->Bounds.Height);
00476
00477         m_d2dContext->SetDpi(m_dpi, m_dpi);
00478         CreateWindowSizeDependentResources();
00479     }
00480 }
00481
00482 // This method is called in the event handler for the OrientationChanged event.
00483 void DX::DeviceResources::SetCurrentOrientation(DisplayOrientations currentOrientation)
00484 {
00485     if (m_currentOrientation != currentOrientation)
00486     {
00487         m_currentOrientation = currentOrientation;
00488         CreateWindowSizeDependentResources();
00489     }
00490 }
00491
00492 // This method is called in the event handler for the DisplayContentsInvalidated event.
00493 void DX::DeviceResources::ValidateDevice()
00494 {
00495     // The D3D Device is no longer valid if the default adapter changed since the device
00496     // was created or if the device has been removed.
00497
00498     // First, get the information for the default adapter from when the device was created.
00499
00500     ComPtr<IDXGIDevice3> dxgiDevice;
00501     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00502
00503     ComPtr<IDXGIAdapter> deviceAdapter;
00504     DX::ThrowIfFailed(dxgiDevice->GetAdapter(&deviceAdapter));
00505
00506     ComPtr<IDXGIFactory2> deviceFactory;
00507     DX::ThrowIfFailed(deviceAdapter->GetParent(IID_PPV_ARGS(&deviceFactory)));
00508
00509     ComPtr<IDXGIAdapter1> previousDefaultAdapter;
00510     DX::ThrowIfFailed(deviceFactory->EnumAdapters1(0, &previousDefaultAdapter));
00511
00512     DXGI_ADAPTER_DESC previousDesc;
00513     DX::ThrowIfFailed(previousDefaultAdapter->GetDesc(&previousDesc));
00514
00515     // Next, get the information for the current default adapter.
00516
00517     ComPtr<IDXGIFactory2> currentFactory;
00518     DX::ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&currentFactory)));
00519
00520     ComPtr<IDXGIAdapter1> currentDefaultAdapter;
00521     DX::ThrowIfFailed(currentFactory->EnumAdapters1(0, &currentDefaultAdapter));
00522
00523     DXGI_ADAPTER_DESC currentDesc;
00524     DX::ThrowIfFailed(currentDefaultAdapter->GetDesc(&currentDesc));
00525
00526     // If the adapter LUIDs don't match, or if the device reports that it has been removed,
00527     // a new D3D device must be created.
00528
00529     if (previousDesc.AdapterLuid.LowPart != currentDesc.AdapterLuid.LowPart ||
00530         previousDesc.AdapterLuid.HighPart != currentDesc.AdapterLuid.HighPart ||
00531         FAILED(m_d3dDevice->GetDeviceRemovedReason()))
00532     {
00533         // Release references to resources related to the old device.
00534         dxgiDevice = nullptr;
00535         deviceAdapter = nullptr;
00536         deviceFactory = nullptr;
00537         previousDefaultAdapter = nullptr;
00538
00539         // Create a new device and swap chain.
00540         HandleDeviceLost();
00541     }
00542 }
00543
00544 // Recreate all device resources and set them back to the current state.
00545 void DX::DeviceResources::HandleDeviceLost()
00546 {
00547     m_swapChain = nullptr;
00548
00549     if (m_deviceNotify != nullptr)
00550     {
00551         m_deviceNotify->OnDeviceLost();
00552     }
00553
00554     CreateDeviceResources();
00555     m_d2dContext->SetDpi(m_dpi, m_dpi);
00556     CreateWindowSizeDependentResources();
00557
00558     if (m_deviceNotify != nullptr)
00559     {
00560         m_deviceNotify->OnDeviceRestored();
00561     }
00562 }
00563
00564 // Register our DeviceNotify to be informed on device lost and creation.
00565 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00566 {
00567     m_deviceNotify = deviceNotify;
00568 }
00569
00570 // Call this method when the app suspends. It provides a hint to the driver that the app
00571 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00572 void DX::DeviceResources::Trim()
00573 {
00574     ComPtr<IDXGIDevice3> dxgiDevice;
00575     m_d3dDevice.As(&dxgiDevice);
00576
00577     dxgiDevice->Trim();
00578 }
00579
00580 // Present the contents of the swap chain to the screen.
00581 void DX::DeviceResources::Present()
00582 {
00583     // The first argument instructs DXGI to block until VSync, putting the application
00584     // to sleep until the next VSync. This ensures we don't waste any cycles rendering
00585     // frames that will never be displayed to the screen.
00586     HRESULT hr = m_swapChain->Present(1, 0);
00587
00588     // Discard the contents of the render target.
00589     // This is a valid operation only when the existing contents will be entirely
00590     // overwritten. If dirty or scroll rects are used, this call should be removed.
00591     m_d3dContext->DiscardView(m_d3dRenderTargetView.Get());
00592
00593     // Discard the contents of the depth stencil.
00594     m_d3dContext->DiscardView(m_d3dDepthStencilView.Get());
00595
00596     // If the device was removed either by a disconnection or a driver upgrade, we
00597     // must recreate all device resources.
00598     if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
00599     {
00600         HandleDeviceLost();
00601     }
00602     else
00603     {
00604         DX::ThrowIfFailed(hr);
00605     }
00606 }
00607
00608 // This method determines the rotation between the display device's native Orientation and the
00609 // current display orientation.
00610 DXGI_MODE_ROTATION DX::DeviceResources::ComputeDisplayRotation()
00611 {
00612     DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
00613
00614     // Note: NativeOrientation can only be Landscape or Portrait even though
00615     // the DisplayOrientations enum has other values.
00616     switch (m_nativeOrientation)
00617     {
00618     case DisplayOrientations::Landscape:
00619         switch (m_currentOrientation)
00620         {
00621         case DisplayOrientations::Landscape:
00622             rotation = DXGI_MODE_ROTATION_IDENTITY;
00623             break;
00624
00625         case DisplayOrientations::Portrait:
00626             rotation = DXGI_MODE_ROTATION_ROTATE270;
00627             break;
00628
00629         case DisplayOrientations::LandscapeFlipped:
00630             rotation = DXGI_MODE_ROTATION_ROTATE180;
00631             break;
00632
00633         case DisplayOrientations::PortraitFlipped:
00634             rotation = DXGI_MODE_ROTATION_ROTATE90;
00635             break;
00636         }
00637         break;
00638
00639     case DisplayOrientations::Portrait:
00640         switch (m_currentOrientation)
00641         {
00642         case DisplayOrientations::Landscape:
00643             rotation = DXGI_MODE_ROTATION_ROTATE90;
00644             break;
00645
00646         case DisplayOrientations::Portrait:
00647             rotation = DXGI_MODE_ROTATION_IDENTITY;
00648             break;
00649
00650         case DisplayOrientations::LandscapeFlipped:
00651             rotation = DXGI_MODE_ROTATION_ROTATE270;
00652             break;
00653
00654         case DisplayOrientations::PortraitFlipped:
00655             rotation = DXGI_MODE_ROTATION_ROTATE180;
00656             break;
00657         }
00658         break;
00659     }
00660     return rotation;
00661 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario1_XmlReader.cpp Source File

  • XmlLite
  • cppwinrt

Scenario1_XmlReader.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_XmlReader.h"
00014 #include "Scenario1_XmlReader.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Storage;
00021 using namespace winrt::Windows::Storage::Streams;
00022 using namespace winrt::Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario1_XmlReader::Scenario1_XmlReader()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     fire_and_forget Scenario1_XmlReader::ReadXmlClick(IInspectable const&, RoutedEventArgs const&)
00032     {
00033         auto lifetime = get_strong();
00034
00035         std::wostringstream result;
00036         try
00037         {
00038             StorageFolder installFolder = Package::Current().InstalledLocation();
00039             StorageFile file = co_await installFolder.GetFileAsync(L"Stocks.xml");
00040             IRandomAccessStream randomAccessReadStream = co_await file.OpenAsync(FileAccessMode::Read);
00041             com_ptr<IStream> readStream = capture<IStream>(::CreateStreamOverRandomAccessStream, winrt::get_unknown(randomAccessReadStream));
00042             ReadXml(result, readStream);
00043         }
00044         catch (hresult_error const& e)
00045         {
00046             result << L"Exception occured while reading the xml file: " << std::wstring_view(e.message()) <<
00047                 L"\nError code: " + e.code();
00048         }
00049         XmlTextbox().Text(result.str());
00050     }
00051
00052     void Scenario1_XmlReader::ReadXml(std::wostream& result, com_ptr<IStream> const& readStream)
00053     {
00054         XmlNodeType nodeType;
00055
00056         com_ptr<IXmlReader> reader;
00057         check_hresult(::CreateXmlReader(IID_PPV_ARGS(&reader), nullptr));
00058         check_hresult(reader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit));
00059         check_hresult(reader->SetInput(readStream.get()));
00060
00061         // Reads until there are no more nodes.
00062         while (check_enumerator(reader->Read(&nodeType)))
00063         {
00064             PCWSTR prefix = nullptr;
00065             PCWSTR localName = nullptr;
00066             PCWSTR value = nullptr;
00067
00068             UINT prefixSize = 0;
00069             UINT localNameSize = 0;
00070             UINT valueSize = 0;
00071
00072             switch (nodeType)
00073             {
00074             case XmlNodeType_XmlDeclaration:
00075                 result << L"XmlDeclaration\n";
00076                 ReadAttributes(result, reader);
00077                 break;
00078
00079             case XmlNodeType_Element:
00080                 check_hresult(reader->GetPrefix(&prefix, &prefixSize));
00081                 check_hresult(reader->GetLocalName(&localName, &localNameSize));
00082                 result << L"Element: ";
00083                 if (prefixSize > 0)
00084                 {
00085                     result << std::wstring_view(prefix, prefixSize) << L':';
00086                 }
00087                 result << std::wstring_view(localName, localNameSize) << L"\n";
00088
00089                 ReadAttributes(result, reader);
00090                 if (reader->IsEmptyElement())
00091                 {
00092                     result << L" (empty)";
00093                 }
00094                 break;
00095
00096             case XmlNodeType_EndElement:
00097                 check_hresult(reader->GetPrefix(&prefix, &prefixSize));
00098                 check_hresult(reader->GetLocalName(&localName, &localNameSize));
00099                 result << L"End Element: ";
00100                 if (prefixSize > 0)
00101                 {
00102                     result << std::wstring_view(prefix, prefixSize) << L':';
00103                 }
00104                 result << std::wstring_view(localName, localNameSize) << L"\n";
00105                 break;
00106
00107             case XmlNodeType_Text:
00108                 check_hresult(reader->GetValue(&value, &valueSize));
00109                 result << L"Text: >" << std::wstring_view(value, valueSize) << L"<\n";
00110                 break;
00111
00112             case XmlNodeType_CDATA:
00113                 check_hresult(reader->GetValue(&value, &valueSize));
00114                 result << L"CDATA: " << std::wstring_view(value, valueSize) << L"\n";
00115                 break;
00116
00117             case XmlNodeType_ProcessingInstruction:
00118                 check_hresult(reader->GetLocalName(&localName, &localNameSize));
00119                 check_hresult(reader->GetValue(&value, &valueSize));
00120                 result << L"Processing Instruction name:" << std::wstring_view(localName, localNameSize) << L", ";
00121                 result << L"value:" << std::wstring_view(value, valueSize) << L"\n";
00122                 break;
00123
00124             case XmlNodeType_Comment:
00125                 check_hresult(reader->GetValue(&value, &valueSize));
00126                 result << L"Comment: " << std::wstring_view(value, valueSize) << L"\n";
00127                 break;
00128
00129             case XmlNodeType_DocumentType:
00130                 result << L"DOCTYPE is not printed\n";
00131                 break;
00132
00133             case XmlNodeType_Whitespace:
00134                 check_hresult(reader->GetValue(&value, &valueSize));
00135                 result << L"WhiteSpace: " << std::wstring_view(value, valueSize) << L"\n";
00136                 break;
00137
00138             default:
00139                 break;
00140             }
00141         }
00142     }
00143
00144     void Scenario1_XmlReader::ReadAttributes(std::wostream& result, com_ptr<IXmlReader> const& reader)
00145     {
00146         check_hresult(reader->MoveToFirstAttribute());
00147
00148         do
00149         {
00150             if (!reader->IsDefault())
00151             {
00152                 PCWSTR prefix = nullptr;
00153                 PCWSTR localName = nullptr;
00154                 PCWSTR value = nullptr;
00155
00156                 UINT prefixSize = 0;
00157                 UINT localNameSize = 0;
00158                 UINT valueSize = 0;
00159
00160                 check_hresult(reader->GetPrefix(&prefix, &prefixSize));
00161                 check_hresult(reader->GetLocalName(&localName, &localNameSize));
00162                 check_hresult(reader->GetValue(&value, &valueSize));
00163
00164                 result << L"Attr: ";
00165                 if (prefixSize > 0)
00166                 {
00167                     result << std::wstring_view(prefix, prefixSize) << L':';
00168                 }
00169                 result << std::wstring_view(localName, localNameSize) <<
00170                     L"=\"" << std::wstring_view(value, valueSize) << L"\"\n";
00171             }
00172         } while (check_enumerator(reader->MoveToNextAttribute()));
00173     }
00174 }
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebSocket/cs/SampleConfiguration.cs Source File

  • WebSocket
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Networking.Sockets;
00016 using Windows.Security.Cryptography.Certificates;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.Web;
00019
00020 namespace SDKTemplate
00021 {
00022     public partial class MainPage : Page
00023     {
00024         public const string FEATURE_NAME = "WebSocket C# Sample";
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title = "UTF-8 text messages", ClassType = typeof(Scenario1_UTF8) },
00029             new Scenario() { Title = "Binary data stream", ClassType = typeof(Scenario2_Binary) },
00030             new Scenario() { Title = "Client authentication", ClassType = typeof(Scenario3_ClientAuthentication) },
00031             new Scenario() { Title = "Partial and Complete Messages", ClassType = typeof(Scenario4_PartialReadWrite) },
00032         };
00033
00034         public Uri TryGetUri(string uriString)
00035         {
00036             Uri webSocketUri;
00037             if (!Uri.TryCreate(uriString.Trim(), UriKind.Absolute, out webSocketUri))
00038             {
00039                 NotifyUser("Error: Invalid URI", NotifyType.ErrorMessage);
00040                 return null;
00041             }
00042
00043             // Fragments are not allowed in WebSocket URIs.
00044             if (!String.IsNullOrEmpty(webSocketUri.Fragment))
00045             {
00046                 NotifyUser("Error: URI fragments not supported in WebSocket URIs.", NotifyType.ErrorMessage);
00047                 return null;
00048             }
00049
00050             // Uri.SchemeName returns the canonicalized scheme name so we can use case-sensitive, ordinal string
00051             // comparison.
00052             if ((webSocketUri.Scheme != "ws") && (webSocketUri.Scheme != "wss"))
00053             {
00054                 NotifyUser("Error: WebSockets only support ws:// and wss:// schemes.", NotifyType.ErrorMessage);
00055                 return null;
00056             }
00057
00058             return webSocketUri;
00059         }
00060
00061         public static string BuildWebSocketError(Exception ex)
00062         {
00063             ex = ex.GetBaseException();
00064
00065             if ((uint)ex.HResult == 0x800C000EU)
00066             {
00067                 // INET_E_SECURITY_PROBLEM - our custom certificate validator rejected the request.
00068                 return "Error: Rejected by custom certificate validation.";
00069             }
00070
00071             WebErrorStatus status = WebSocketError.GetStatus(ex.HResult);
00072
00073             // Normally we'd use the HResult and status to test for specific conditions we want to handle.
00074             // In this sample, we'll just output them for demonstration purposes.
00075             switch (status)
00076             {
00077                 case WebErrorStatus.CannotConnect:
00078                 case WebErrorStatus.NotFound:
00079                 case WebErrorStatus.RequestTimeout:
00080                     return "Cannot connect to the server. Please make sure " +
00081                         "to run the server setup script before running the sample.";
00082
00083                 case WebErrorStatus.Unknown:
00084                     return "COM error: " + ex.HResult;
00085
00086                 default:
00087                     return "Error: " + status;
00088             }
00089         }
00090
00091         // All the certificates in the certificate chain as well as the final certificate itself
00092         // must all be valid.
00093         static public async Task<bool> AreCertificateAndCertChainValidAsync(Certificate serverCert, IReadOnlyList<Certificate> certChain)
00094         {
00095             foreach (Certificate cert in certChain)
00096             {
00097                 if (!await IsCertificateValidAsync(cert))
00098                 {
00099                     return false;
00100                 }
00101             }
00102             return await IsCertificateValidAsync(serverCert);
00103         }
00104
00105         static async Task<bool> IsCertificateValidAsync(Certificate serverCert)
00106         {
00107             // This is a placeholder call to simulate long-running async calls. Note that this code runs synchronously as part
00108             // of the SSL/TLS handshake. Avoid performing lengthy operations here - else, the remote server may terminate the
00109             // connection abruptly.
00110             await Task.Delay(100);
00111
00112             // In this sample, we check the issuer of the certificate - this is purely for illustration
00113             // purposes and should not be considered as a recommendation for certificate validation.
00114             return serverCert.Issuer == "www.fabrikam.com";
00115         }
00116     }
00117
00118     public class Scenario
00119     {
00120         public string Title { get; set; }
00121
00122         public Type ClassType { get; set; }
00123
00124         public override string ToString()
00125         {
00126             return Title;
00127         }
00128     }
00129 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneController.cpp Source File

  • HolographicSpatialStage
  • cpp
  • Content

SceneController.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002
00003 #include "SceneController.h"
00004 #include "Common\DirectXHelper.h"
00005
00006 using namespace HolographicSpatialStage;
00007 using namespace Windows::Perception::Spatial;
00008
00009 SceneController::SceneController(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00010     m_deviceResources(deviceResources)
00011 {
00012 }
00013
00014 void SceneController::Update(const DX::StepTimer& timer, SpatialCoordinateSystem^ viewCoords)
00015 {
00016     for (auto& object : m_sceneObjects)
00017     {
00018         object->Update(timer, viewCoords);
00019     }
00020 }
00021
00022 void SceneController::Render()
00023 {
00024     for (auto& object : m_sceneObjects)
00025     {
00026         object->Render();
00027     }
00028 }
00029
00030 void SceneController::CreateDeviceDependentResources()
00031 {
00032     for (auto& object : m_sceneObjects)
00033     {
00034         object->CreateDeviceDependentResources();
00035     }
00036 }
00037
00038 void SceneController::ReleaseDeviceDependentResources()
00039 {
00040     for (auto& object : m_sceneObjects)
00041     {
00042         object->ReleaseDeviceDependentResources();
00043     }
00044 }
00045
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicFaceTracking/cpp/pch.cpp Source File

  • HolographicFaceTracking
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cs/Scenario3_DisplayOnOff.xaml.cs Source File

  • ProximitySensor
  • cs

Scenario3_DisplayOnOff.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using Windows.Devices.Enumeration;
00015 using Windows.Devices.Sensors;
00016 using Windows.Foundation;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace ProximityCS
00023 {
00024     public sealed partial class Scenario3_DisplayOnOff : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private ProximitySensor sensor;
00031         private ProximitySensorDisplayOnOffController displayController;
00032         private DeviceWatcher watcher;
00033
00034         public Scenario3_DisplayOnOff()
00035         {
00036             this.InitializeComponent();
00037
00038             watcher = DeviceInformation.CreateWatcher(ProximitySensor.GetDeviceSelector());
00039             watcher.Added += OnProximitySensorAdded;
00040             watcher.Start();
00041         }
00042
00043         /// <summary>
00044         /// Invoked when the device watcher finds a proximity sensor
00045         /// </summary>
00046         /// <param name="sender">The device watcher</param>
00047         /// <param name="device">Device information for the proximity sensor that was found</param>
00048         private async void OnProximitySensorAdded(DeviceWatcher sender, DeviceInformation device)
00049         {
00050             if (null == sensor)
00051             {
00052                 ProximitySensor foundSensor = ProximitySensor.FromId(device.Id);
00053                 if (null != foundSensor)
00054                 {
00055                     sensor = foundSensor;
00056                 }
00057                 else
00058                 {
00059                     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00060                     {
00061                         rootPage.NotifyUser("Could not get a proximity sensor from the device id", NotifyType.ErrorMessage);
00062                     });
00063                 }
00064             }
00065         }
00066
00067         /// <summary>
00068         /// Invoked when this page is about to be displayed in a Frame.
00069         /// </summary>
00070         /// <param name="e">Event data that describes how this page was reached. The Parameter
00071         /// property is typically used to configure the page.</param>
00072         protected override void OnNavigatedTo(NavigationEventArgs e)
00073         {
00074             ScenarioEnableButton.IsEnabled = true;
00075             ScenarioDisableButton.IsEnabled = false;
00076         }
00077
00078         /// <summary>
00079         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00080         /// </summary>
00081         /// <param name="e">
00082         /// Event data that can be examined by overriding code. The event data is representative
00083         /// of the navigation that will unload the current Page unless canceled. The
00084         /// navigation can potentially be canceled by setting Cancel.
00085         /// </param>
00086         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00087         {
00088             if (ScenarioDisableButton.IsEnabled)
00089             {
00090                 if (null != displayController)
00091                 {
00092                     displayController.Dispose(); // closes the controller
00093                     displayController = null;
00094                 }
00095             }
00096
00097             base.OnNavigatingFrom(e);
00098         }
00099
00100         /// <summary>
00101         /// This is the click handler for the 'Enable' button.
00102         /// </summary>
00103         /// <param name="sender"></param>
00104         /// <param name="e"></param>
00105         private void ScenarioEnable(object sender, RoutedEventArgs e)
00106         {
00107             if (null != sensor)
00108             {
00109                 // Acquires the display on/off controller for this proximity sensor.
00110                 // This tells the system to use the sensor's IsDetected state to
00111                 // turn the screen on or off.  If the display does not support this
00112                 // feature, this code will do nothing.
00113                 displayController = sensor.CreateDisplayOnOffController();
00114
00115                 ScenarioEnableButton.IsEnabled = false;
00116                 ScenarioDisableButton.IsEnabled = true;
00117             }
00118             else
00119             {
00120                 rootPage.NotifyUser("No proximity sensors found", NotifyType.ErrorMessage);
00121             }
00122         }
00123
00124         /// <summary>
00125         /// This is the click handler for the 'Disable' button.
00126         /// </summary>
00127         /// <param name="sender"></param>
00128         /// <param name="e"></param>
00129         private void ScenarioDisable(object sender, RoutedEventArgs e)
00130         {
00131             // Releases the display on/off controller that is previously acquired.
00132             // This tells the system to stop using the sensor's IsDetected state to
00133             // turn the screen on or off.  If the display does not support this
00134             // feature, this code will do nothing.
00135             if (null != displayController)
00136             {
00137                 displayController.Dispose(); // closes the controller
00138                 displayController = null;
00139             }
00140
00141             ScenarioEnableButton.IsEnabled = true;
00142             ScenarioDisableButton.IsEnabled = false;
00143         }
00144     }
00145 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/VeryObservableCollection.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

VeryObservableCollection.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections;
00003 using System.Collections.Generic;
00004 using System.Collections.ObjectModel;
00005 using System.Collections.Specialized;
00006 using System.Linq;
00007 using System.Text;
00008 using System.Threading.Tasks;
00009 using Windows.Foundation.Collections;
00010
00011 namespace BindTestbedModel
00012 {
00013     internal class VeryObservableCollection<T> : INotifyCollectionChanged, IList<T>, Windows.Foundation.Collections.IObservableVector<T>, IList
00014     {
00015         private ObservableCollection<T> data;
00016
00017         public VeryObservableCollection()
00018         {
00019             data = new ObservableCollection<T>();
00020             data.CollectionChanged += Data_CollectionChanged;
00021         }
00022
00023         #region NotifyCollectionChanged
00024
00025         public event VectorChangedEventHandler<T> VectorChanged;
00026
00027         public event NotifyCollectionChangedEventHandler CollectionChanged;
00028
00029         private void Data_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
00030         {
00031             if (VectorChanged != null)
00032             {
00033                 VectorChangedEventAgrs args = new VectorChangedEventAgrs();
00034                 args.CollectionChange = CollectionChange.Reset;
00035                 VectorChanged(this, args);
00036             }
00037
00038             if (CollectionChanged != null)
00039             {
00040                 CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
00041                 CollectionChanged(this, e);
00042             }
00043         }
00044
00045         #endregion
00046         #region IList<T>
00047
00048         public T this[int index]
00049         {
00050             get { return data[index]; }
00051             set { data[index] = value; }
00052         }
00053
00054         public int Count { get { return data.Count; } }
00055
00056         public bool IsReadOnly
00057         {
00058             get
00059             {
00060                 throw new NotImplementedException();
00061             }
00062         }
00063
00064         public void Add(T item)
00065         {
00066             data.Add(item);
00067         }
00068
00069         public void Clear()
00070         {
00071             data.Clear();
00072         }
00073
00074         public bool Contains(T item)
00075         {
00076             return data.Contains(item);
00077         }
00078
00079         public void CopyTo(T[] array, int arrayIndex)
00080         {
00081             data.CopyTo(array, arrayIndex);
00082         }
00083
00084         public IEnumerator<T> GetEnumerator()
00085         {
00086             return data.GetEnumerator();
00087         }
00088
00089         public int IndexOf(T item)
00090         {
00091             return data.IndexOf(item);
00092         }
00093
00094         public void Insert(int index, T item)
00095         {
00096             data.Insert(index, item);
00097         }
00098
00099         public bool Remove(T item)
00100         {
00101             return data.Remove(item);
00102         }
00103
00104         public void RemoveAt(int index)
00105         {
00106             data.RemoveAt(index);
00107         }
00108
00109         IEnumerator IEnumerable.GetEnumerator()
00110         {
00111             return data.GetEnumerator();
00112         }
00113         #endregion
00114         #region IList
00115
00116         bool IList.IsFixedSize { get { return false; } }
00117
00118         bool IList.IsReadOnly { get { return false; } }
00119
00120         int ICollection.Count { get { return data.Count; } }
00121         bool ICollection.IsSynchronized { get { return false; } }
00122
00123         object ICollection.SyncRoot { get { throw new NotImplementedException(); } }
00124
00125         object IList.this[int index]
00126         {
00127             get { return data[index]; }
00128             set { data[index] = (T)value; }
00129         }
00130         int IList.Add(object item)
00131         {
00132             data.Add((T)item);
00133             return data.Count;
00134         }
00135
00136         bool IList.Contains(object item) { return data.Contains((T)item); }
00137
00138         int IList.IndexOf(object item) { return data.IndexOf((T)item); }
00139
00140
00141         void IList.Insert(int index, object item)
00142         {
00143             data.Insert(index, (T)item);
00144         }
00145
00146         void IList.Remove(object item)
00147         {
00148             data.Remove((T)item);
00149         }
00150         void IList.Clear()
00151         {
00152             data.Clear();
00153         }
00154
00155         void IList.RemoveAt(int index)
00156         {
00157             data.RemoveAt(index);
00158         }
00159
00160         void ICollection.CopyTo(Array dest, int index)
00161         {
00162             data.CopyTo((T[])dest, index);
00163         }
00164         #endregion
00165            }
00166 }
00167
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario4_DeviceEvents.xaml.h Source File

  • CustomCapability
  • cpp

Scenario4_DeviceEvents.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario4_DeviceEvents.g.h"
00014
00015 namespace SDKTemplate
00016 {
00017     /// <summary>
00018     /// An empty page that can be used on its own or navigated to within a Frame.
00019     /// </summary>
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class DeviceEvents sealed
00022     {
00023     public:
00024         DeviceEvents();
00025
00026     protected:
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032
00033         Concurrency::cancellation_token_source cancelSource;
00034         bool running = false;
00035
00036         Windows::Foundation::EventRegistrationToken switchChangedEventsHandler;
00037         Platform::Array<bool>^ previousSwitchValues;
00038
00039         void deviceEventsGet_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void deviceEventsBegin_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void deviceEventsCancel_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042
00043         void StartInterruptMessageWorker(Windows::Devices::Custom::CustomDevice^ fx2Device);
00044         void InterruptMessageWorker(Windows::Devices::Custom::CustomDevice^ fx2Device,
00045                                     Windows::Storage::Streams::IBuffer^ switchMessageBuffer);
00046
00047         void UpdateRegisterButton();
00048
00049         void ClearSwitchStateTable();
00050         void UpdateSwitchStateTable(Platform::Array<bool>^ SwitchStateArray);
00051
00052         Platform::Array<bool>^ CreateSwitchStateArray(byte output[])
00053         {
00054             auto switchStateArray = ref new Platform::Array<bool>(8);
00055
00056             for (auto i = 0; i < 8; i += 1)
00057             {
00058                 switchStateArray[i] = (output[0] & (1 << i)) != 0;
00059             }
00060
00061             return switchStateArray;
00062         }
00063     };
00064 }
Generated on Fri Nov 15 2024 22:19:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SocketActivityStreamSocket/cs/Server/Scenario1_Send.xaml.cs Source File

  • SocketActivityStreamSocket
  • cs
  • Server

Scenario1_Send.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using SDKTemplate;
00017 using Windows.Networking.Sockets;
00018 using Windows.Storage.Streams;
00019 using System.Text;
00020 using Windows.Foundation;
00021
00022
00023 namespace StreamSocketListenerServer
00024 {
00025     public sealed partial class Scenario1_Send : Page
00026     {
00027         private MainPage rootPage;
00028         private StreamSocketListener tcpListener;
00029         private StreamSocket connectedSocket = null;
00030         private const string port = "40404";
00031
00032         public Scenario1_Send()
00033         {
00034             this.InitializeComponent();
00035             SendMessageTextBox.IsEnabled = false;
00036             SendButton.IsEnabled = false;
00037         }
00038
00039         private async void OnConnected(
00040            StreamSocketListener sender,
00041            StreamSocketListenerConnectionReceivedEventArgs args)
00042         {
00043             if (connectedSocket != null)
00044             {
00045                 connectedSocket.Dispose();
00046                 connectedSocket = null;
00047             }
00048             connectedSocket = args.Socket;
00049             await SendMessageTextBox.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00050             {
00051                 rootPage.NotifyUser("Client has connected, go ahead and send a message...", NotifyType.StatusMessage);
00052                 SendMessageTextBox.IsEnabled = true;
00053                 SendButton.IsEnabled = true;
00054             });
00055         }
00056
00057         protected override async void OnNavigatedTo(NavigationEventArgs e)
00058         {
00059             rootPage = MainPage.Current;
00060             rootPage.NotifyUser("Waiting for client to connect...", NotifyType.StatusMessage);
00061             tcpListener = new StreamSocketListener();
00062             tcpListener.ConnectionReceived += OnConnected;
00063             await tcpListener.BindEndpointAsync(null, port);
00064         }
00065
00066         private async void SendButton_Click(object sender, RoutedEventArgs e)
00067         {
00068             try
00069             {
00070                 DataWriter writer = new DataWriter(connectedSocket.OutputStream);
00071                 writer.WriteBytes(Encoding.UTF8.GetBytes(SendMessageTextBox.Text));
00072                 SendMessageTextBox.Text = "";
00073                 await writer.StoreAsync();
00074                 writer.DetachStream();
00075                 writer.Dispose();
00076             }
00077             catch(Exception exception)
00078             {
00079                 rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
00080             }
00081         }
00082     }
00083 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_UnicodeExtensions Member List

This is the complete list of members for Scenario4_UnicodeExtensions, including all inherited members.
Scenario4_UnicodeExtensions() | Scenario4_UnicodeExtensions
ShowResults_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_UnicodeExtensions
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlGamepadNavigation/cs/TransportOptions.xaml.cs Source File

  • XamlGamepadNavigation
  • cs

TransportOptions.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004 using Windows.UI.Xaml.Media;
00005
00006 namespace SDKTemplate
00007 {
00008     public sealed partial class TransportOptions : UserControl
00009     {
00010         // For demonstration purposes, this control can simulate an old-style
00011         // control that does not support gamepad navigation. This mode
00012         // is used in Scenario 3.
00013         bool IsGamepadSupported = true;
00014
00015         public TransportOptions()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         // When the user engages the control, put initial focus on the first item.
00021         void OnFocusEngaged(Control sender, FocusEngagedEventArgs e)
00022         {
00023             if (IsGamepadSupported)
00024             {
00025                 InitialButton.Focus(FocusState.Programmatic);
00026             }
00027         }
00028
00029         void OnLoaded(object sender, RoutedEventArgs e)
00030         {
00031             IsGamepadSupported = (Tag as string) != "Legacy";
00032
00033             // In "legacy mode", remove the tab stops from all child controls.
00034             if (!IsGamepadSupported)
00035             {
00036                 RemoveTabStops(this);
00037             }
00038         }
00039
00040         void RemoveTabStops(DependencyObject root)
00041         {
00042             for (int i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
00043             {
00044                 DependencyObject child = VisualTreeHelper.GetChild(root, i);
00045                 Control control = child as Control;
00046                 if (control != null)
00047                 {
00048                     control.IsTabStop = false;
00049                 }
00050                 RemoveTabStops(child);
00051             }
00052         }
00053     }
00054 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario3_InputReportEvents.xaml.cs Source File

  • CustomHidDeviceAccess
  • cs

Scenario3_InputReportEvents.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using System.Collections.Generic;
00009 using Windows.Devices.Enumeration;
00010 using Windows.Devices.HumanInterfaceDevice;
00011 using Windows.Foundation;
00012 using Windows.Storage.Streams;
00013 using Windows.UI.Core;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using SDKTemplate;
00018
00019 namespace CustomHidDeviceAccess
00020 {
00021     /// <summary>
00022     /// This scenario demonstrates to how register and utilize input reports
00023     /// </summary>
00024     public sealed partial class InputReportEvents : Page
00025     {
00026         private TypedEventHandler<HidDevice, HidInputReportReceivedEventArgs> inputReportEventHandler;
00027         Boolean isRegisteredForInputReportEvents;
00028         private UInt32 numInputReportEventsReceived;
00029         private UInt32 totalNumberBytesReceived;
00030
00031         // Device that we registered for events with
00032         private HidDevice registeredDevice;
00033
00034         // Did we navigate away from this page?
00035         private Boolean navigatedAway;
00036
00037         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00038         // as NotifyUser()
00039         private MainPage rootPage = MainPage.Current;
00040
00041         public InputReportEvents()
00042         {
00043             numInputReportEventsReceived = 0;
00044             isRegisteredForInputReportEvents = false;
00045
00046             this.InitializeComponent();
00047         }
00048
00049         /// <summary>
00050         /// Invoked when this page is about to be displayed in a Frame.
00051         ///
00052         /// We will enable/disable parts of the UI if the device doesn't support it.
00053         ///
00054         /// The SuperMutt requires an output report to tell the device to start sending interrupts, so we will start it
00055         /// just in case we register for the events. We want this to be transparent because it doesn't demonstrate how
00056         /// to register for events.
00057         /// </summary>
00058         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00059         /// property is typically used to configure the page.</param>
00060         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00061         {
00062             navigatedAway = false;
00063
00064             // We will disable the scenario that is not supported by the device.
00065             // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00066             Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
00067             deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);
00068
00069             Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00070
00071             // Get notified when the device is about to be closed so we can unregister events
00072             EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
00073
00074             UpdateRegisterEventButtons();
00075         }
00076
00077         /// <summary>
00078         /// Reset the device into a known state by undoing everything we did to the device (unregister interrupts and
00079         /// stop the device from creating interrupts)
00080         /// </summary>
00081         /// <param name="eventArgs"></param>
00082         protected override void OnNavigatedFrom(NavigationEventArgs eventArgs)
00083         {
00084             navigatedAway = true;
00085
00086             if (EventHandlerForDevice.Current.IsDeviceConnected)
00087             {
00088                 UnregisterFromInputReportEvent();
00089
00090                 // Stop interrupts after unregistering so that device interrupts do not effect the scenario (stopping before unregistering
00091                 // will cause events to stop being raised, which will be noticable by the app; we want this to be transparent)
00092                 StopSuperMuttInputReports();
00093             }
00094
00095             // We are leaving and no longer care about the device closing
00096             EventHandlerForDevice.Current.OnDeviceClose = null;
00097         }
00098
00099         private async void OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation)
00100         {
00101             UnregisterFromInputReportEvent();
00102
00103             await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
00104             {
00105                 UpdateRegisterEventButtons();
00106             }));
00107         }
00108
00109         private void RegisterForInputReportEvents_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00110         {
00111             if (EventHandlerForDevice.Current.IsDeviceConnected)
00112             {
00113                 // Start the interrupts on the SuperMutt device (by default the device doesn't generate interrupts)
00114                 StartSuperMuttInputReports();
00115
00116                 RegisterForInputReportEvents();
00117
00118                 UpdateRegisterEventButtons();
00119             }
00120             else
00121             {
00122                 Utilities.NotifyDeviceNotConnected();
00123             }
00124
00125         }
00126
00127         private void UnregisterFromInputReportEvents_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00128         {
00129             if (EventHandlerForDevice.Current.IsDeviceConnected)
00130             {
00131                 UnregisterFromInputReportEvent();
00132
00133                 StopSuperMuttInputReports();
00134
00135                 UpdateRegisterEventButtons();
00136             }
00137             else
00138             {
00139                 Utilities.NotifyDeviceNotConnected();
00140             }
00141         }
00142
00143         /// <summary>
00144         /// Tells the SuperMutt device to start creating interrupts. The app won't get any interrupts until after we register for the event.
00145         ///
00146         /// We are using an output report to start the interrupts, please go to Scenario4_InputOutputReports for more information on how to use
00147         /// output reports.
00148         /// </summary>
00149         private async void StartSuperMuttInputReports()
00150         {
00151             var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.DeviceInputReportControlInformation.ReportId);
00152
00153             var dataWriter = new DataWriter();
00154
00155             // First byte is always the report id
00156             dataWriter.WriteByte((Byte)outputReport.Id);
00157             dataWriter.WriteByte(SuperMutt.DeviceInputReportControlInformation.DataTurnOn);
00158
00159             outputReport.Data = dataWriter.DetachBuffer();
00160
00161             await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
00162         }
00163
00164         /// <summary>
00165         /// Tells the SuperMutt device to stop creating interrupts. The app will stop getting event raises unless we start the interrupts again.
00166         ///
00167         /// We are using an output report to start the interrupts, please go to Scenario4_InputOutputReports for more information on how to use
00168         /// output reports.
00169         /// </summary>
00170         private async void StopSuperMuttInputReports()
00171         {
00172             var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.DeviceInputReportControlInformation.ReportId);
00173
00174             var dataWriter = new DataWriter();
00175
00176             // First byte is always the report id
00177             dataWriter.WriteByte((Byte)outputReport.Id);
00178             dataWriter.WriteByte(SuperMutt.DeviceInputReportControlInformation.DataTurnOff);
00179
00180             outputReport.Data = dataWriter.DetachBuffer();
00181
00182             await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
00183         }
00184
00185         /// <summary>
00186         /// This callback only increments the total number of events received and prints it
00187         ///
00188         /// This method is called whenever the device's state changes and sends a report. Since all input reports share the same event in
00189         /// HidDevice, the app needs to get the HidInputReport from eventArgs.Report and compare report ids and usages with the desired
00190         /// report.
00191         /// </summary>
00192         /// <param name="sender">HidDevice that the event is being raised from</param>
00193         /// <param name="eventArgs">Contains the HidInputReport that caused the event to raise</param>
00194         private async void OnInputReportEvent(HidDevice sender, HidInputReportReceivedEventArgs eventArgs)
00195         {
00196             // If we navigated away from this page, we don't need to process this event
00197             // This also prevents output from spilling into another page
00198             if (!navigatedAway)
00199             {
00200                 numInputReportEventsReceived++;
00201
00202                 // The data from the InputReport
00203                 HidInputReport inputReport = eventArgs.Report;
00204                 IBuffer buffer = inputReport.Data;
00205
00206                 totalNumberBytesReceived += buffer.Length;
00207
00208                 // Create a DispatchedHandler for the because we are interracting with the UI directly and the
00209                 // thread that this function is running on may not be the UI thread; if a non-UI thread modifies
00210                 // the UI, an exception is thrown
00211                 await rootPage.Dispatcher.RunAsync(
00212                     CoreDispatcherPriority.Normal,
00213                     new DispatchedHandler(() =>
00214                     {
00215                         // If we navigated away from this page, do not print anything. The dispatch may be handled after
00216                         // we move to a different page.
00217                         if (!navigatedAway)
00218                         {
00219                             rootPage.NotifyUser(
00220                                 "Total number of input report events received: " + numInputReportEventsReceived.ToString()
00221                                 + "\nTotal number of bytes received: " + totalNumberBytesReceived.ToString(),
00222                                 NotifyType.StatusMessage);
00223                         }
00224                     }));
00225             }
00226         }
00227
00228         /// <summary>
00229         /// Register for the event that is triggered when the device sends a report to us.
00230         ///
00231         /// All input reports share the same event in HidDevice, so once we register the event, all HidInputReports (regardless of the report id) will
00232         /// raise the event. Read the comment above OnInputReportEvent for more information on how to distinguish input reports.
00233         ///
00234         /// The function also saves the event token so that we can unregister from the event later on.
00235         /// </summary>
00236         private void RegisterForInputReportEvents()
00237         {
00238             if (!isRegisteredForInputReportEvents)
00239             {
00240                 inputReportEventHandler = new TypedEventHandler<HidDevice, HidInputReportReceivedEventArgs>(this.OnInputReportEvent);
00241
00242                 // Remember which device we are registering the device with, in case there is a device disconnect and reconnect. We want to avoid unregistering
00243                 // an event handler that is not registered with the device object.
00244                 // Ideally, one should remove the event token (e.g. assign to null) upon the device removal to avoid using it again.
00245                 registeredDevice = EventHandlerForDevice.Current.Device;
00246
00247                 registeredDevice.InputReportReceived += inputReportEventHandler;
00248
00249                 numInputReportEventsReceived = 0;
00250                 totalNumberBytesReceived = 0;
00251
00252                 isRegisteredForInputReportEvents = true;
00253             }
00254         }
00255
00256         /// <summary>
00257         /// Unregisters from the HidDevice's InputReportReceived event that was registered for in the RegisterForInputReportEvents();
00258         /// </summary>
00259         private void UnregisterFromInputReportEvent()
00260         {
00261             if (isRegisteredForInputReportEvents)
00262             {
00263                 // Don't unregister event if the device was removed and reconnected because the endpoint event no longer contains our event handler
00264                 if (registeredDevice == EventHandlerForDevice.Current.Device)
00265                 {
00266                     registeredDevice.InputReportReceived -= inputReportEventHandler;
00267                 }
00268
00269                 registeredDevice = null;
00270                 isRegisteredForInputReportEvents = false;
00271             }
00272         }
00273
00274         private void UpdateRegisterEventButtons()
00275         {
00276             ButtonRegisterForInputReportEvents.IsEnabled = !isRegisteredForInputReportEvents;
00277             ButtonUnregisterFromInputReportEvents.IsEnabled = isRegisteredForInputReportEvents;
00278         }
00279     }
00280 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.h Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_Document1.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_Document1.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario_Document1 sealed
00020     {
00021     public:
00022         Scenario_Document1();
00023     private:
00024         void Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00025     };
00026 }
Generated on Fri Nov 15 2024 22:19:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario4.cpp Source File

  • WindowsAudioSession
  • cppwinrt

Scenario4.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "Scenario4.h"
00013 #include "Scenario4.g.cpp"
00014
00015 using namespace winrt::Windows::Foundation;
00016 using namespace winrt::Windows::Storage::Streams;
00017 using namespace winrt::Windows::UI::Xaml;
00018 using namespace winrt::Windows::UI::Xaml::Navigation;
00019
00020 namespace winrt::SDKTemplate::implementation
00021 {
00022     static constexpr float OSC_START_X = 100.0f;
00023     static constexpr float OSC_START_Y = 100.0f;
00024     static constexpr float OSC_X_LENGTH = 700.0f;
00025     static constexpr float OSC_TOTAL_HEIGHT = 200.0f;
00026
00027     Scenario4::Scenario4()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario4::OnNavigatedFrom(NavigationEventArgs const&)
00033     {
00034         ClearCapture();
00035     }
00036
00037     void Scenario4::ClearCapture()
00038     {
00039         if (m_deviceStateChangeToken)
00040         {
00041             m_capture->DeviceStateChanged(std::exchange(m_deviceStateChangeToken, {}));
00042         }
00043
00044         if (m_plotDataReadyToken)
00045         {
00046             m_capture->PlotDataReady(std::exchange(m_plotDataReadyToken, {}));
00047         }
00048
00049         StopCapture();
00050         m_capture = nullptr;
00051     }
00052
00053 #pragma region UI Related Code
00054     // Updates transport controls based on current playstate
00055     void Scenario4::UpdateMediaControlUI(DeviceState deviceState)
00056     {
00057         switch (deviceState)
00058         {
00059         case DeviceState::Capturing:
00060             btnStartCapture().IsEnabled(false);
00061             btnStopCapture().IsEnabled(true);
00062             toggleMinimumLatency().IsEnabled(false);
00063             break;
00064
00065         case DeviceState::Stopped:
00066             btnStartCapture().IsEnabled(true);
00067             btnStopCapture().IsEnabled(false);
00068             toggleMinimumLatency().IsEnabled(true);
00069             break;
00070
00071         case DeviceState::Initialized:
00072         case DeviceState::Starting:
00073         case DeviceState::Stopping:
00074         case DeviceState::Flushing:
00075         case DeviceState::Error:
00076             btnStartCapture().IsEnabled(false);
00077             btnStopCapture().IsEnabled(false);
00078             break;
00079         }
00080     }
00081 #pragma endregion
00082
00083 #pragma region UI Event Handlers
00084     void Scenario4::btnStartCapture_Click(IInspectable const&, RoutedEventArgs const&)
00085     {
00086         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00087         InitializeCapture();
00088     }
00089
00090     void Scenario4::btnStopCapture_Click(IInspectable const&, RoutedEventArgs const&)
00091     {
00092         StopCapture();
00093     }
00094 #pragma endregion
00095
00096     // Event callback from WASAPI capture for changes in device state
00097     fire_and_forget Scenario4::OnDeviceStateChange(IDeviceStateSource const&, SDKTemplate::DeviceStateChangedEventArgs e)
00098     {
00099         auto lifetime = get_strong();
00100
00101         // Get the current time for messages
00102         std::time_t now = clock::to_time_t(clock::now());
00103         char buffer[26];
00104         ctime_s(buffer, ARRAYSIZE(buffer), &now);
00105
00106         // Continue on UI thread.
00107         co_await resume_foreground(Dispatcher());
00108
00109         // Update Control Buttons
00110         DeviceState state = e.DeviceState();
00111         UpdateMediaControlUI(state);
00112
00113         // Handle state specific messages
00114         switch (state)
00115         {
00116         case DeviceState::Initialized:
00117             m_capture->AsyncStartCapture();
00118             break;
00119
00120         case DeviceState::Capturing:
00121             if (m_isLowLatency)
00122             {
00123                 rootPage.NotifyUser(L"Capture Started (minimum latency) at " + to_hstring(buffer), NotifyType::StatusMessage);
00124             }
00125             else
00126             {
00127                 rootPage.NotifyUser(L"Capture Started (normal latency) at " + to_hstring(buffer), NotifyType::StatusMessage);
00128             }
00129             break;
00130
00131         case DeviceState::Discontinuity:
00132         {
00133             m_discontinuityCount++;
00134
00135             if (m_discontinuityCount > 0)
00136             {
00137                 rootPage.NotifyUser(L"DISCONTINUITY DETECTED: " + to_hstring(buffer) + L" (Count = " + to_hstring(m_discontinuityCount) + L")", NotifyType::StatusMessage);
00138             }
00139         }
00140         break;
00141
00142         case DeviceState::Flushing:
00143             if (m_plotDataReadyToken)
00144             {
00145                 m_capture->PlotDataReady(std::exchange(m_plotDataReadyToken, {}));
00146             }
00147
00148             rootPage.NotifyUser(L"Finalizing WAV Header.  This may take a few minutes...", NotifyType::StatusMessage);
00149
00150             Oscilloscope().Points().ReplaceAll({ { OSC_START_X, OSC_START_Y }, { OSC_X_LENGTH, OSC_START_Y } });
00151             break;
00152
00153         case DeviceState::Stopped:
00154             // For the stopped state, completely tear down the audio device
00155             ClearCapture();
00156
00157             rootPage.NotifyUser(L"Capture Stopped", NotifyType::StatusMessage);
00158             break;
00159
00160         case DeviceState::Error:
00161             ClearCapture();
00162
00163             // Specifically handle a couple of known errors
00164             switch (hresult error = e.ExtendedError(); error)
00165             {
00166             case __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND):
00167                 rootPage.NotifyUser(L"ERROR: Check the Sound control panel for an active recording device.", NotifyType::ErrorMessage);
00168                 break;
00169
00170             case AUDCLNT_E_RESOURCES_INVALIDATED:
00171                 rootPage.NotifyUser(L"ERROR: Endpoint Lost Access To Resources", NotifyType::ErrorMessage);
00172                 break;
00173
00174             case E_ACCESSDENIED:
00175                 rootPage.NotifyUser(L"ERROR: Access Denied.  Check 'Settings->Permissions' for access to Microphone.", NotifyType::ErrorMessage);
00176                 break;
00177
00178             default:
00179                 rootPage.NotifyUser(L"ERROR: " + hresult_error(error).message(), NotifyType::ErrorMessage);
00180                 break;
00181             }
00182         }
00183     }
00184
00185     // Event callback when visualization data is ready to be plotted
00186     fire_and_forget Scenario4::OnPlotDataReady(IPlotDataSource const&, SDKTemplate::PlotDataReadyEventArgs e)
00187     {
00188         auto lifetime = get_strong();
00189
00190         co_await resume_foreground(Dispatcher());
00191
00192         IBuffer buffer = e.Points();
00193         size_t pointCount = buffer.Length() / sizeof(int16_t);
00194         int16_t* points = reinterpret_cast<int16_t*>(buffer.data());
00195
00196         // Scale the incoming point list so that it fills our scope.
00197         float y_range = static_cast<float>((std::numeric_limits<int16_t>::max)()) - std::numeric_limits<int16_t>::lowest();
00198         float x_inc = pointCount > 0 ? OSC_X_LENGTH / static_cast<float>(pointCount - 1) : 0.0f;
00199
00200         UINT32 existingPoints = Oscilloscope().Points().Size();
00201
00202         for (UINT32 i = 0; i < pointCount; i++)
00203         {
00204             Point p;
00205
00206             // Fixup the x and y coordinates and set it back into the collection
00207             p.X = OSC_START_X + i * x_inc;
00208             p.Y = OSC_START_Y - (points[i] * OSC_TOTAL_HEIGHT) / y_range;
00209
00210             if (i < existingPoints)
00211             {
00212                 Oscilloscope().Points().SetAt(i, p);
00213             }
00214             else
00215             {
00216                 Oscilloscope().Points().Append(p);
00217             }
00218         }
00219     }
00220
00221     //
00222     //  InitializeCapture()
00223     //
00224     void Scenario4::InitializeCapture()
00225     {
00226         m_capture = nullptr;
00227
00228         // Create a new WASAPI capture instance
00229         m_capture = make_self<WASAPICapture>();
00230
00231         // Register for events
00232         m_deviceStateChangeToken = m_capture->DeviceStateChanged({ get_weak(), &Scenario4::OnDeviceStateChange });
00233         m_plotDataReadyToken = m_capture->PlotDataReady({ get_weak(), &Scenario4::OnPlotDataReady });
00234
00235         // There is an initial discontinuity when we start, so reset discontinuity counter
00236         // to -1 so that we ignore that initial discontinuity.
00237         m_discontinuityCount = -1;
00238
00239         // Configure whether we are using low-latency capture
00240         m_isLowLatency = toggleMinimumLatency().IsOn();
00241         m_capture->SetLowLatencyCapture(m_isLowLatency);
00242
00243         // Perform the initialization
00244         m_capture->AsyncInitializeAudioDevice();
00245     }
00246
00247     //
00248     //  StopCapture()
00249     //
00250     void Scenario4::StopCapture()
00251     {
00252         if (m_capture)
00253         {
00254             // Set the event to stop playback
00255             m_capture->AsyncStopCapture();
00256         }
00257     }
00258 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Level6 Member List

This is the complete list of members for Level6, including all inherited members.
Initialize(std::vector< std::shared_ptr< GameObject >> const &objects) override | Level5 | [virtual]
Level3() | Level3 |
Level5() | Level5 |
Level6() | Level6 |
LoadState(PersistentState &state) | Level | [virtual]
m_objective | Level | [protected]
m_timeLimit | Level | [protected]
Objective() | Level |
SaveState(PersistentState &state) | Level | [virtual]
TimeLimit() | Level |
Update(float time, float elapsedTime, float timeRemaining, std::vector< std::shared_ptr< GameObject >> const &objects) override | Level6 | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario11_TryGet.xaml.cpp Source File

  • FileAccess
  • cpp

Scenario11_TryGet.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario11_TryGet.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace concurrency;
00018 using namespace Windows::Storage;
00019 using namespace Windows::UI::Xaml;
00020
00021 Scenario11::Scenario11()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 void Scenario11::GetFileButton_Click(Object^ sender, RoutedEventArgs^ e)
00027 {
00028     create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary)).then([](StorageFolder^ picturesFolder)
00029     {
00030         // Gets a file without throwing an exception
00031         return picturesFolder->TryGetItemAsync("sample.dat");
00032     }).then([this](IStorageItem^ item)
00033     {
00034         if (item != nullptr)
00035         {
00036             rootPage->NotifyUser("Operation result: " + item->Name, NotifyType::StatusMessage);
00037         }
00038         else
00039         {
00040             rootPage->NotifyUser("Operation result: null", NotifyType::StatusMessage);
00041         }
00042     });
00043 }
Generated on Fri Nov 15 2024 22:19:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CalibrationBar Member List

This is the complete list of members for CalibrationBar, including all inherited members.
_barDismissed | CalibrationBar | [private]
_calibrationTimer | CalibrationBar | [private]
_lastCalibrationTime | CalibrationBar | [private]
CALIBRATION_POPUP_AUTO_DIMSMISS_TIME | CalibrationBar | [private]
CalibrationBar() | CalibrationBar | [inline]
CanShowCalibrationBar(MagnetometerAccuracy accuracy) | CalibrationBar | [inline, private]
DismissPopup_Click(object sender, RoutedEventArgs e) | CalibrationBar | [inline, private]
Hide() | CalibrationBar | [inline]
HideGuidance() | CalibrationBar | [inline, private]
HideGuidanceButton_Click(object sender, RoutedEventArgs e) | CalibrationBar | [inline, private]
InvalidateLayout() | CalibrationBar | [inline, private]
LAYOUT_WIDTH_768 | CalibrationBar | [private]
OnAutoDismissTimerExpired(object sender, object e) | CalibrationBar | [inline, private]
OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) | CalibrationBar | [inline, private]
RequestCalibration(MagnetometerAccuracy accuracy) | CalibrationBar | [inline]
ShowGuidance() | CalibrationBar | [inline, private]
ShowGuidanceButton_Click(object sender, RoutedEventArgs e) | CalibrationBar | [inline, private]
SUPPRESS_DURATION_APPROXIMATE_MIN | CalibrationBar | [private]
SUPPRESS_DURATION_UNRELIABLE_MIN | CalibrationBar | [private]
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ViewModels/ArticleViewModel.cs Source File

  • XamlTransform3DAnimations
  • cs
  • ViewModels

ArticleViewModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.UI.Xaml.Media;
00007 using Windows.UI.Xaml.Media.Imaging;
00008
00009 namespace Transform3DAnimations.ViewModels
00010 {
00011     public class ArticleViewModel
00012     {
00013         private static Random s_random = new Random();
00014         private string _headline;
00015         private Uri _imageUri;
00016
00017         public string Headline
00018         {
00019             get { return _headline; }
00020             set { _headline = value; }
00021         }
00022
00023         public ImageSource ImageSource
00024         {
00025             get { return new BitmapImage(_imageUri); }
00026         }
00027
00028         public string FullText
00029         {
00030             get
00031             {
00032                 return @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed nibh ac nisl porta ornare. Vivamus a mollis leo. Proin eu leo at justo aliquam porttitor id nec arcu. Aenean ornare ligula a orci vulputate, sit amet hendrerit leo commodo. Suspendisse interdum porta ante, sit amet tristique enim fringilla sed. Fusce pulvinar eget sem nec iaculis. In euismod malesuada sem eget dignissim. Nulla interdum vulputate mi vel tempor. Aliquam tempor efficitur mi at dictum.
00033
00034 Vestibulum sollicitudin arcu at elementum tempor. Sed suscipit luctus massa, et cursus arcu malesuada vitae. Donec venenatis elit ex, quis iaculis elit vehicula aliquam. Suspendisse sed purus nisl. Aliquam aliquet leo sed erat ultricies consequat. Aliquam ac pellentesque urna, id fringilla sapien. Fusce imperdiet nisl nec lectus placerat sagittis. Sed nibh ipsum, cursus at ultrices molestie, ornare id augue. Quisque augue tortor, rutrum et sodales vestibulum, elementum ut nunc. Nunc eu nunc a nisi laoreet laoreet. Nunc nec diam non eros tempor tristique. Maecenas a sollicitudin felis. In tortor nisi, bibendum non lectus id, malesuada tincidunt nibh. Ut consequat elit nulla, vitae maximus odio ornare a.
00035
00036 Praesent placerat velit vel eleifend tristique. Sed vulputate aliquet risus, ac ultrices sapien volutpat in. Donec blandit congue dictum. In in sapien id augue elementum condimentum. Pellentesque maximus felis eu efficitur convallis. Vestibulum augue leo, elementum ac urna at, luctus finibus leo. Sed venenatis augue et laoreet vehicula. Nulla facilisi. Nulla eu mauris nec augue congue semper vel in ipsum. Aenean gravida tempus lobortis. Sed sodales ac lectus pellentesque tempor. Nulla ut ipsum sit amet magna euismod porttitor condimentum fringilla urna. Curabitur sit amet hendrerit metus. Proin gravida accumsan urna, ut porta est placerat efficitur. Nullam iaculis libero ex, ac accumsan tortor placerat at.
00037 ";
00038             }
00039         }
00040
00041         public ArticleViewModel()
00042         {
00043             _headline = new[]
00044                 {
00045                     "Lorem Ipsum",
00046                     "Dolor Sit",
00047                     "Consectetus Adipiscing",
00048                     "Etiam Sed Nibh",
00049                     "Vivamus a Mollis Leo",
00050                     "Vestibulum Sollicitudin Arcu",
00051                     "Sed Suscipit Luctus",
00052                     "Arcu Malesuada Vitae",
00053                     "Sed Vulputate Aliquet",
00054                     "Donec Blandit Congue Dictum"
00055                 }[s_random.Next(10)];
00056
00057             var imagePath = "Images/circle_image" + (s_random.Next(3) + 1).ToString() + ".jpg";
00058             _imageUri = new Uri("ms-appx:///" + imagePath);
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
DefaultBlankOnProtectedContent | sealed | [static]
DefaultGlobalOpacityCoefficient | sealed | [static]
DefaultHologramCompositionEnabled | sealed | [static]
DefaultLoopBackGain | sealed | [static]
DefaultMicrophoneGain | sealed | [static]
DefaultOutputSize | sealed | [private]
DefaultPreferredHologramPerspective | sealed | [static]
DefaultRecordingIndicatorEnabled | sealed | [static]
DefaultShowHiddenMesh | sealed | [static]
DefaultVideoStabilizationBufferLength | sealed | [static]
DefaultVideoStabilizationEnabled | sealed | [static]
m_activatableClassId | sealed | [private]
m_propertySet | sealed | [private]
MrcAudioEffectDefinition() | sealed |
MrcVideoEffectDefinition() | sealed |
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario3_EnumerateTiles.h Source File

  • SecondaryTiles
  • cppwinrt

Scenario3_EnumerateTiles.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_EnumerateTiles.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3_EnumerateTiles : Scenario3_EnumerateTilesT<Scenario3_EnumerateTiles>
00020     {
00021         Scenario3_EnumerateTiles();
00022
00023         fire_and_forget EnumerateSecondaryTiles_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario3_EnumerateTiles : Scenario3_EnumerateTilesT<Scenario3_EnumerateTiles, implementation::Scenario3_EnumerateTiles>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/pch.cpp Source File

  • NetworkConnectivity
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // pch.cpp
00014 // Include the standard header and generate the precompiled header.
00015 //
00016
00017 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/pch.h Source File

  • DataReaderWriter
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp Source File

  • PersonalDataEncryption
  • cppwinrt

Scenario1_Files.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Files.h"
00014 #include "Scenario1_Files.g.cpp"
00015
00016 using namespace winrt::Windows::Foundation;
00017 using namespace winrt::Windows::Security::DataProtection;
00018 using namespace winrt::Windows::Storage;
00019 using namespace winrt::Windows::Storage::Pickers;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario1_Files::Scenario1_Files()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario1_Files::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         userDataProtectionManager = UserDataProtectionManager::TryGetDefault();
00033         if (userDataProtectionManager)
00034         {
00035             AvailablePanel().Visibility(Visibility::Visible);
00036             UnavailablePanel().Visibility(Visibility::Collapsed);
00037         }
00038         else
00039         {
00040             AvailablePanel().Visibility(Visibility::Collapsed);
00041             UnavailablePanel().Visibility(Visibility::Visible);
00042         }
00043     }
00044
00045     fire_and_forget Scenario1_Files::ChooseFile_Click(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         auto lifetime = get_strong();
00048         FileOpenPicker picker;
00049         picker.FileTypeFilter().Append(L"*");
00050         UpdateItem(co_await picker.PickSingleFileAsync());
00051     }
00052
00053     fire_and_forget Scenario1_Files::ChooseFolder_Click(IInspectable const&, RoutedEventArgs const&)
00054     {
00055         auto lifetime = get_strong();
00056         FolderPicker picker;
00057         UpdateItem(co_await picker.PickSingleFolderAsync());
00058     }
00059
00060     void Scenario1_Files::UpdateItem(IStorageItem const& item)
00061     {
00062         selectedItem = item;
00063         if (selectedItem != nullptr)
00064         {
00065             ItemOperationsPanel().Visibility(Visibility::Visible);
00066             ItemNameBlock().Text(item.Path());
00067         }
00068         else
00069         {
00070             ItemOperationsPanel().Visibility(Visibility::Collapsed);
00071         }
00072     }
00073
00074     fire_and_forget Scenario1_Files::ProtectL1_Click(IInspectable const&, RoutedEventArgs const&)
00075     {
00076         auto lifetime = get_strong();
00077         UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::AfterFirstUnlock);
00078         ReportStatus(L"Protect L1", status);
00079     }
00080
00081     fire_and_forget Scenario1_Files::ProtectL2_Click(IInspectable const&, RoutedEventArgs const&)
00082     {
00083         auto lifetime = get_strong();
00084         UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::WhileUnlocked);
00085         ReportStatus(L"Protect L2", status);
00086     }
00087
00088     fire_and_forget Scenario1_Files::Unprotect_Click(IInspectable const&, RoutedEventArgs const&)
00089     {
00090         auto lifetime = get_strong();
00091         UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::Always);
00092         ReportStatus(L"Protect L2", status);
00093     }
00094
00095     void Scenario1_Files::ReportStatus(hstring const& operation, UserDataStorageItemProtectionStatus status)
00096     {
00097         switch (status)
00098         {
00099         case UserDataStorageItemProtectionStatus::Succeeded:
00100             rootPage.NotifyUser(operation + L" succeeded", NotifyType::StatusMessage);
00101             break;
00102
00103         case UserDataStorageItemProtectionStatus::NotProtectable:
00104             rootPage.NotifyUser(operation + L" failed: Not protectable", NotifyType::ErrorMessage);
00105             break;
00106
00107         case UserDataStorageItemProtectionStatus::DataUnavailable:
00108             rootPage.NotifyUser(operation + L" failed: Data unavailable", NotifyType::ErrorMessage);
00109             break;
00110
00111         default:
00112             rootPage.NotifyUser(operation + L" failed: Unknown failure", NotifyType::ErrorMessage);
00113             break;
00114         }
00115     }
00116 }
Generated on Fri Nov 15 2024 22:17:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LARGE_INTEGER Member List

This is the complete list of members for LARGE_INTEGER, including all inherited members.
HighPart | LARGE_INTEGER
LowPart | LARGE_INTEGER
QuadPart | LARGE_INTEGER
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/SampleConfiguration.cs Source File

  • Clipboard
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Text;
00015 using Windows.ApplicationModel.DataTransfer;
00016 using Windows.Data.Xml.Dom;
00017 using Windows.UI.Core;
00018 using Windows.UI.Notifications;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021
00022 namespace SDKTemplate
00023 {
00024     public partial class MainPage : Page
00025     {
00026         public const string FEATURE_NAME = "Clipboard C# sample";
00027
00028         public bool IsClipboardContentChangedEnabled { get; private set; } = false;
00029         private bool needToPrintClipboardFormat;
00030         private bool isApplicationWindowActive = true;
00031
00032         List<Scenario> scenarios = new List<Scenario>
00033         {
00034             new Scenario() { Title = "Copy and paste text",        ClassType = typeof(CopyText) },
00035             new Scenario() { Title = "Copy and paste an image",    ClassType = typeof(CopyImage) },
00036             new Scenario() { Title = "Copy and paste files",       ClassType = typeof(CopyFiles) },
00037             new Scenario() { Title = "History and roaming",        ClassType = typeof(HistoryAndRoaming) },
00038             new Scenario() { Title = "Other Clipboard operations", ClassType = typeof(OtherScenarios) }
00039         };
00040
00041         public static ToastNotification DisplayToast(string message)
00042         {
00043             string xml = @"<toast activationType='foreground'>
00044                                 <visual>
00045                                     <binding template='ToastGeneric'/>
00046                                 </visual>
00047                             </toast>";
00048
00049             XmlDocument doc = new XmlDocument();
00050             doc.LoadXml(xml);
00051
00052             var binding = doc.SelectSingleNode("//binding");
00053
00054             var el = doc.CreateElement("text");
00055             el.InnerText = FEATURE_NAME;
00056             binding.AppendChild(el);
00057
00058             el = doc.CreateElement("text");
00059             el.InnerText = message;
00060             binding.AppendChild(el);
00061
00062             var toast = new ToastNotification(doc);
00063
00064             ToastNotificationManager.CreateToastNotifier().Show(toast); //Show the toast
00065
00066             return toast;
00067         }
00068
00069         public bool EnableClipboardContentChangedNotifications(bool enable)
00070         {
00071             if (IsClipboardContentChangedEnabled == enable)
00072             {
00073                 return false;
00074             }
00075
00076             IsClipboardContentChangedEnabled = enable;
00077             if (enable)
00078             {
00079                 Clipboard.ContentChanged += OnClipboardChanged;
00080                 Window.Current.Activated += OnWindowActivated;
00081             }
00082             else
00083             {
00084                 Clipboard.ContentChanged -= OnClipboardChanged;
00085                 Window.Current.Activated -= OnWindowActivated;
00086             }
00087             return true;
00088         }
00089
00090         public string BuildClipboardFormatsOutputString()
00091         {
00092             DataPackageView clipboardContent = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
00093             StringBuilder output = new StringBuilder();
00094
00095             if (clipboardContent != null && clipboardContent.AvailableFormats.Count > 0)
00096             {
00097                 output.Append("Available formats in the clipboard:");
00098                 foreach (var format in clipboardContent.AvailableFormats)
00099                 {
00100                     output.Append(Environment.NewLine + " * " + format);
00101                 }
00102             }
00103             else
00104             {
00105                 output.Append("The clipboard is empty");
00106             }
00107             return output.ToString();
00108         }
00109
00110         private void DisplayChangedFormats()
00111         {
00112             string output = "Clipboard content has changed!" + Environment.NewLine;
00113             output += BuildClipboardFormatsOutputString();
00114             NotifyUser(output, NotifyType.StatusMessage);
00115         }
00116
00117         private void HandleClipboardChanged()
00118         {
00119             if (this.isApplicationWindowActive)
00120             {
00121                 DisplayChangedFormats();
00122             }
00123             else
00124             {
00125                 // Background applications can't access clipboard
00126                 // Deferring processing of update notification until the application returns to foreground
00127                 this.needToPrintClipboardFormat = true;
00128             }
00129         }
00130
00131         private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
00132         {
00133             this.isApplicationWindowActive = (e.WindowActivationState != CoreWindowActivationState.Deactivated);
00134             if (this.needToPrintClipboardFormat)
00135             {
00136                 // The clipboard was updated while the sample was in the background. If the sample is now in the foreground,
00137                 // display the new content.
00138                 HandleClipboardChanged();
00139             }
00140         }
00141
00142         private void OnClipboardChanged(Object sender, Object e)
00143         {
00144             DisplayToast("Clipboard changed.");
00145             HandleClipboardChanged();
00146         }
00147     }
00148
00149     public class Scenario
00150     {
00151         public string Title { get; set; }
00152         public Type ClassType { get; set; }
00153     }
00154 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/CustomVertexShaderMain.cpp Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

CustomVertexShaderMain.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CustomVertexShaderMain.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace CustomVertexShader;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::System::Threading;
00020 using namespace Windows::UI::Input;
00021 using namespace Concurrency;
00022
00023 // Loads and initializes application assets when the application is loaded.
00024 CustomVertexShaderMain::CustomVertexShaderMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00025     m_deviceResources(deviceResources)
00026 {
00027     // Register to be notified if the Device is lost or recreated.
00028     m_deviceResources->RegisterDeviceNotify(this);
00029
00030     m_sceneRenderer = std::unique_ptr<CustomVertexShaderRenderer>(new CustomVertexShaderRenderer(m_deviceResources));
00031     m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D Custom Vertex Shader Effect"));
00032 }
00033
00034 CustomVertexShaderMain::~CustomVertexShaderMain()
00035 {
00036     // Deregister device notification.
00037     m_deviceResources->RegisterDeviceNotify(nullptr);
00038 }
00039
00040 // Updates application state when the window size changes (e.g. device orientation change)
00041 void CustomVertexShaderMain::CreateWindowSizeDependentResources()
00042 {
00043     m_sceneRenderer->CreateWindowSizeDependentResources();
00044     m_sampleOverlay->CreateWindowSizeDependentResources();
00045 }
00046
00047 void CustomVertexShaderMain::UpdateManipulationState(_In_ ManipulationUpdatedEventArgs ^ args)
00048 {
00049     m_sceneRenderer->UpdateManipulationState(args);
00050 }
00051
00052 // Updates the application state once per frame.
00053 void CustomVertexShaderMain::Update()
00054 {
00055     m_sceneRenderer->Update();
00056 }
00057
00058 // Renders the current frame according to the current application state.
00059 // Returns true if the frame was rendered and is ready to be displayed.
00060 bool CustomVertexShaderMain::Render()
00061 {
00062     m_sceneRenderer->Render();
00063     m_sampleOverlay->Render();
00064
00065     return true;
00066 }
00067
00068 // Notifies renderers that device resources need to be released.
00069 void CustomVertexShaderMain::OnDeviceLost()
00070 {
00071     m_sceneRenderer->ReleaseDeviceDependentResources();
00072     m_sampleOverlay->ReleaseDeviceDependentResources();
00073 }
00074
00075 // Notifies renderers that device resources may now be recreated.
00076 void CustomVertexShaderMain::OnDeviceRestored()
00077 {
00078     m_sceneRenderer->CreateDeviceDependentResources();
00079     m_sampleOverlay->CreateDeviceDependentResources();
00080     CreateWindowSizeDependentResources();
00081 }
00082
00083 void CustomVertexShaderMain::SaveInternalState(_In_ IPropertySet ^ state)
00084 {
00085     m_sceneRenderer->SaveInternalState(state);
00086 }
00087
00088 void CustomVertexShaderMain::LoadInternalState(_In_ IPropertySet ^ state)
00089 {
00090     m_sceneRenderer->LoadInternalState(state);
00091 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisplayOrientation/cppwinrt/Project.idl Source File

  • DisplayOrientation
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Orientation : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Orientation();
00018     }
00019 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NavigationService Member List

This is the complete list of members for NavigationService, including all inherited members.
frame | NavigationService | [private]
GoBack() | NavigationService | [inline]
Navigate(Type t, object parameter=null) | NavigationService | [inline]
Navigate< T >(object parameter=null) | NavigationService | [inline]
NavigationService(Frame frame) | NavigationService | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Collections Member List

This is the complete list of members for Collections, including all inherited members.
Collections() | Collections | [inline]
vm | Collections | [private]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CredentialPicker/cs/Scenario2_MessageCaption.xaml.cs Source File

  • CredentialPicker
  • cs

Scenario2_MessageCaption.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009 using SDKTemplate;
00010 using System;
00011 using Windows.Security.Credentials.UI;
00012
00013 namespace CredentialPicker
00014 {
00015     public sealed partial class Scenario2_MessageCaption : Page
00016     {
00017         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00018         // as NotifyUser()
00019         MainPage rootPage = MainPage.Current;
00020
00021         public Scenario2_MessageCaption()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         void SetError(string err)
00027         {
00028             rootPage.NotifyUser(err, NotifyType.ErrorMessage);
00029         }
00030
00031         void SetResult(CredentialPickerResults res)
00032         {
00033             if (res.ErrorCode == 0)
00034             {
00035                 Status.Text = String.Format("OK");
00036             }
00037             else
00038             {
00039                 Status.Text = String.Format("Error returned from CredPicker API: {0}", res.ErrorCode);
00040             }
00041
00042             Domain.Text = res.CredentialDomainName;
00043             Username.Text = res.CredentialUserName;
00044             Password.Text = res.CredentialPassword;
00045             CredentialSaved.Text = (res.CredentialSaved ? "true" : "false");
00046             switch (res.CredentialSaveOption)
00047             {
00048                 case CredentialSaveOption.Hidden:
00049                     CheckboxState.Text = "Hidden";
00050                     break;
00051                 case CredentialSaveOption.Selected:
00052                     CheckboxState.Text = "Selected";
00053                     break;
00054                 case CredentialSaveOption.Unselected:
00055                     CheckboxState.Text = "Unselected";
00056                     break;
00057             }
00058         }
00059
00060
00061         #region Click Handlers
00062         private async void Launch_Click(object sender, RoutedEventArgs e)
00063         {
00064             if ((Target.Text != "") && (Message.Text != "") && (Caption.Text != ""))
00065             {
00066                 var credPickerResults = await Windows.Security.Credentials.UI.CredentialPicker.PickAsync(Target.Text, Message.Text, Caption.Text);
00067                 SetResult(credPickerResults);
00068             }
00069         }
00070
00071         #endregion
00072
00073     }
00074 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/FileOpenPicker_PickCachedFile.xaml.cs Source File

  • FilePickerContracts
  • cs

FileOpenPicker_PickCachedFile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012
00013 using System;
00014 using Windows.ApplicationModel;
00015 using Windows.Foundation;
00016 using Windows.Storage;
00017 using Windows.Storage.Pickers.Provider;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022 using Windows.Storage.Provider;
00023
00024 namespace FilePickerContracts
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class FileOpenPicker_PickCachedFile : Page
00030     {
00031         private const string id = "MyCachedFile";
00032         FileOpenPickerUI fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI;
00033         CoreDispatcher dispatcher = Window.Current.Dispatcher;
00034
00035         public FileOpenPicker_PickCachedFile()
00036         {
00037             this.InitializeComponent();
00038             AddFileButton.Click += new RoutedEventHandler(AddFileButton_Click);
00039             RemoveFileButton.Click += new RoutedEventHandler(RemoveFileButton_Click);
00040         }
00041
00042         private void UpdateButtonState(bool fileInBasket)
00043         {
00044             AddFileButton.IsEnabled = !fileInBasket;
00045             RemoveFileButton.IsEnabled = fileInBasket;
00046         }
00047
00048         protected override void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             UpdateButtonState(fileOpenPickerUI.ContainsFile(id));
00051         }
00052
00053         private async void AddFileButton_Click(object sender, RoutedEventArgs e)
00054         {
00055             StorageFile file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync(@"BeforeAccessConflictingFile.txt", CreationCollisionOption.ReplaceExisting);
00056             await Windows.Storage.FileIO.WriteTextAsync(file, @"Cached file created...");
00057             // Note: BeforeAccess triggers CFU activations only for files accessed from the Most Recently Used list and Future Access list.
00058             CachedFileUpdater.SetUpdateInformation(file, "CachedFile", ReadActivationMode.BeforeAccess, WriteActivationMode.NotNeeded, CachedFileOptions.RequireUpdateOnAccess);
00059
00060             bool inBasket;
00061             switch (fileOpenPickerUI.AddFile(id, file))
00062             {
00063                 case AddFileResult.Added:
00064                 case AddFileResult.AlreadyAdded:
00065                     inBasket = true;
00066                     OutputTextBlock.Text = Status.FileAdded;
00067                     break;
00068
00069                 default:
00070                     inBasket = false;
00071                     OutputTextBlock.Text = Status.FileAddFailed;
00072                     break;
00073             }
00074             UpdateButtonState(inBasket);
00075         }
00076
00077         private void RemoveFileButton_Click(object sender, RoutedEventArgs e)
00078         {
00079             if (fileOpenPickerUI.ContainsFile(id))
00080             {
00081                 fileOpenPickerUI.RemoveFile(id);
00082                 OutputTextBlock.Text = Status.FileRemoved;
00083             }
00084             UpdateButtonState(false);
00085         }
00086     }
00087 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario13_ShareTarget.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario13_ShareTarget.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Text;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel;
00016 using Windows.ApplicationModel.DataTransfer;
00017 using Windows.ApplicationModel.DataTransfer.ShareTarget;
00018 using Windows.Data.Json;
00019 using Windows.Storage;
00020 using Windows.Storage.Streams;
00021 using Windows.UI;
00022 using Windows.UI.Core;
00023 using Windows.UI.Text;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Documents;
00027 using Windows.UI.Xaml.Input;
00028 using Windows.UI.Xaml.Media;
00029 using Windows.UI.Xaml.Media.Imaging;
00030 using Windows.UI.Xaml.Navigation;
00031 using Windows.Security.EnterpriseData;
00032 using SDKTemplate;
00033
00034 namespace EdpSample
00035 {
00036     public sealed partial class Scenario13_ShareTarget : Page
00037     {
00038         private MainPage rootPage;
00039         ShareOperation m_shareOperation;
00040         private string m_sharedDataTitle;
00041         private string m_sharedDataDescription;
00042         private string m_sharedDataPackageFamilyName;
00043         private Uri m_sharedDataContentSourceWebLink;
00044         private Uri m_sharedDataContentSourceApplicationLink;
00045         private Color m_sharedDataLogoBackgroundColor;
00046         private IRandomAccessStreamReference m_sharedDataSquare30x30Logo;
00047         private string shareQuickLinkId;
00048         private string m_sharedText;
00049         private Uri m_sharedWebLink;
00050         private Uri m_sharedApplicationLink;
00051         private IReadOnlyList<IStorageItem> m_sharedStorageItems;
00052         private string m_sharedCustomData;
00053         private string m_sharedHtmlFormat;
00054         private IReadOnlyDictionary<string, RandomAccessStreamReference> m_sharedResourceMap;
00055         private IRandomAccessStreamReference m_sharedBitmapStreamRef;
00056         private IRandomAccessStreamReference m_sharedThumbnailStreamRef;
00057         private const string dataFormatName = "http://schema.org/Book";
00058
00059         public Scenario13_ShareTarget()
00060         {
00061             this.InitializeComponent();
00062         }
00063
00064         protected override async void OnNavigatedTo(NavigationEventArgs e)
00065         {
00066             rootPage = MainPage.Current;
00067
00068             // It is recommended to only retrieve the m_shareOperation object in the activation handler, return as
00069             // quickly as possible, and retrieve all data from the share target asynchronously.
00070
00071             m_shareOperation = (ShareOperation)e.Parameter;
00072             if (m_shareOperation == null)
00073             {
00074                 return;
00075             }
00076
00077             var result = await ProtectionPolicyManager.RequestAccessAsync(Scenario1.m_enterpriseId,
00078                                                                              m_shareOperation.Data.Properties.EnterpriseId);
00079             if (result == ProtectionPolicyEvaluationResult.Blocked)
00080             {
00081                 rootPage.NotifyUser("\nSharing is blocked by policy from your Enterprise", NotifyType.ErrorMessage);
00082             }
00083
00084             await Task.Factory.StartNew(async () =>
00085             {
00086                 // Retrieve the data package properties.
00087                 m_sharedDataTitle = m_shareOperation.Data.Properties.Title;
00088                 m_sharedDataDescription = m_shareOperation.Data.Properties.Description;
00089                 m_sharedDataPackageFamilyName = m_shareOperation.Data.Properties.PackageFamilyName;
00090                 m_sharedDataContentSourceWebLink = m_shareOperation.Data.Properties.ContentSourceWebLink;
00091                 m_sharedDataContentSourceApplicationLink = m_shareOperation.Data.Properties.ContentSourceApplicationLink;
00092                 m_sharedDataLogoBackgroundColor = m_shareOperation.Data.Properties.LogoBackgroundColor;
00093                 m_sharedDataSquare30x30Logo = m_shareOperation.Data.Properties.Square30x30Logo;
00094                 m_sharedThumbnailStreamRef = m_shareOperation.Data.Properties.Thumbnail;
00095                 shareQuickLinkId = m_shareOperation.QuickLinkId;
00096
00097                 // Retrieve the data package content.
00098                 // The GetWebLinkAsync(), GetTextAsync(), GetStorageItemsAsync(), etc. APIs will throw if there was an error retrieving the data from the source app.
00099                 // In this sample, we just display the error. It is recommended that a share target app handles these in a way appropriate for that particular app.
00100                 if (m_shareOperation.Data.Contains(StandardDataFormats.WebLink))
00101                 {
00102                     try
00103                     {
00104                         m_sharedWebLink = await m_shareOperation.Data.GetWebLinkAsync();
00105                     }
00106                     catch (Exception ex)
00107                     {
00108                         NotifyUserBackgroundThread("Failed GetWebLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
00109                     }
00110                 }
00111                 if (m_shareOperation.Data.Contains(StandardDataFormats.ApplicationLink))
00112                 {
00113                     try
00114                     {
00115                         m_sharedApplicationLink = await m_shareOperation.Data.GetApplicationLinkAsync();
00116                     }
00117                     catch (Exception ex)
00118                     {
00119                         NotifyUserBackgroundThread("Failed GetApplicationLinkAsync - " + ex.Message, NotifyType.ErrorMessage);
00120                     }
00121                 }
00122                 if (m_shareOperation.Data.Contains(StandardDataFormats.Text))
00123                 {
00124                     try
00125                     {
00126                         m_sharedText = await m_shareOperation.Data.GetTextAsync();
00127                     }
00128                     catch (Exception ex)
00129                     {
00130                         NotifyUserBackgroundThread("Failed GetTextAsync - " + ex.Message, NotifyType.ErrorMessage);
00131                     }
00132                 }
00133                 if (m_shareOperation.Data.Contains(StandardDataFormats.StorageItems))
00134                 {
00135                     try
00136                     {
00137                         m_sharedStorageItems = await m_shareOperation.Data.GetStorageItemsAsync();
00138                     }
00139                     catch (Exception ex)
00140                     {
00141                         NotifyUserBackgroundThread("Failed GetStorageItemsAsync - " + ex.Message, NotifyType.ErrorMessage);
00142                     }
00143                 }
00144                 if (m_shareOperation.Data.Contains(dataFormatName))
00145                 {
00146                     try
00147                     {
00148                         m_sharedCustomData = await m_shareOperation.Data.GetTextAsync(dataFormatName);
00149                     }
00150                     catch (Exception ex)
00151                     {
00152                         NotifyUserBackgroundThread("Failed GetTextAsync(" + dataFormatName + ") - " + ex.Message, NotifyType.ErrorMessage);
00153                     }
00154                 }
00155                 if (m_shareOperation.Data.Contains(StandardDataFormats.Html))
00156                 {
00157                     try
00158                     {
00159                         m_sharedHtmlFormat = await m_shareOperation.Data.GetHtmlFormatAsync();
00160                     }
00161                     catch (Exception ex)
00162                     {
00163                         NotifyUserBackgroundThread("Failed GetHtmlFormatAsync - " + ex.Message, NotifyType.ErrorMessage);
00164                     }
00165
00166                     try
00167                     {
00168                         m_sharedResourceMap = await m_shareOperation.Data.GetResourceMapAsync();
00169                     }
00170                     catch (Exception ex)
00171                     {
00172                         NotifyUserBackgroundThread("Failed GetResourceMapAsync - " + ex.Message, NotifyType.ErrorMessage);
00173                     }
00174                 }
00175                 if (m_shareOperation.Data.Contains(StandardDataFormats.Bitmap))
00176                 {
00177                     try
00178                     {
00179                         m_sharedBitmapStreamRef = await m_shareOperation.Data.GetBitmapAsync();
00180                     }
00181                     catch (Exception ex)
00182                     {
00183                         NotifyUserBackgroundThread("Failed GetBitmapAsync - " + ex.Message, NotifyType.ErrorMessage);
00184                     }
00185                 }
00186
00187                 // In this sample, we just display the m_shared data content.
00188
00189                 // Get back to the UI thread using the dispatcher.
00190                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00191                 {
00192                     DataPackageTitle.Text = m_sharedDataTitle;
00193                     DataPackageDescription.Text = m_sharedDataDescription;
00194                     DataPackagePackageFamilyName.Text = m_sharedDataPackageFamilyName;
00195                     if (m_sharedDataContentSourceWebLink != null)
00196                     {
00197                         DataPackageContentSourceWebLink.Text = m_sharedDataContentSourceWebLink.AbsoluteUri;
00198                     }
00199                     if (m_sharedDataContentSourceApplicationLink != null)
00200                     {
00201                         DataPackageContentSourceApplicationLink.Text = m_sharedDataContentSourceApplicationLink.AbsoluteUri;
00202                     }
00203
00204                     if (m_sharedDataSquare30x30Logo != null)
00205                     {
00206                         IRandomAccessStreamWithContentType logoStream = await m_sharedDataSquare30x30Logo.OpenReadAsync();
00207                         BitmapImage bitmapImage = new BitmapImage();
00208                         bitmapImage.SetSource(logoStream);
00209                         LogoHolder.Source = bitmapImage;
00210                         LogoBackground.Background = new SolidColorBrush(m_sharedDataLogoBackgroundColor);
00211                         LogoArea.Visibility = Visibility.Visible;
00212                     }
00213
00214                     if (!String.IsNullOrEmpty(m_shareOperation.QuickLinkId))
00215                     {
00216                         SelectedQuickLinkId.Text = shareQuickLinkId;
00217                     }
00218
00219                     if (m_sharedThumbnailStreamRef != null)
00220                     {
00221                         IRandomAccessStreamWithContentType thumbnailStream = await m_sharedThumbnailStreamRef.OpenReadAsync();
00222                         BitmapImage bitmapImage = new BitmapImage();
00223                         bitmapImage.SetSource(thumbnailStream);
00224                         ThumbnailHolder.Source = bitmapImage;
00225                         ThumbnailArea.Visibility = Visibility.Visible;
00226                     }
00227
00228                     if (m_sharedWebLink != null)
00229                     {
00230                         AddContentValue("WebLink: ", m_sharedWebLink.AbsoluteUri);
00231                     }
00232                     if (m_sharedApplicationLink != null)
00233                     {
00234                         AddContentValue("ApplicationLink: ", m_sharedApplicationLink.AbsoluteUri);
00235                     }
00236                     if (m_sharedText != null)
00237                     {
00238                         AddContentValue("Text: ", m_sharedText);
00239                     }
00240                     if (m_sharedStorageItems != null)
00241                     {
00242                         // Display the name of the files being m_shared.
00243                         StringBuilder fileNames = new StringBuilder();
00244                         for (int index = 0; index < m_sharedStorageItems.Count; index++)
00245                         {
00246                             fileNames.Append(m_sharedStorageItems[index].Name);
00247                             if (index < m_sharedStorageItems.Count - 1)
00248                             {
00249                                 fileNames.Append(", ");
00250                             }
00251                         }
00252                         fileNames.Append(".");
00253
00254                         AddContentValue("StorageItems: ", fileNames.ToString());
00255                     }
00256                     if (m_sharedCustomData != null)
00257                     {
00258                         // This is an area to be especially careful parsing data from the source app to avoid buffer overruns.
00259                         // This sample doesn't perform data validation but will catch any exceptions thrown.
00260                         try
00261                         {
00262                             StringBuilder receivedStrings = new StringBuilder();
00263                             JsonObject customObject = JsonObject.Parse(m_sharedCustomData);
00264                             if (customObject.ContainsKey("type"))
00265                             {
00266                                 if (customObject["type"].GetString() == "http://schema.org/Book")
00267                                 {
00268                                     // This sample expects the custom format to be of type http://schema.org/Book
00269                                     receivedStrings.AppendLine("Type: " + customObject["type"].Stringify());
00270                                     JsonObject properties = customObject["properties"].GetObject();
00271                                     receivedStrings.AppendLine("Image: " + properties["image"].Stringify());
00272                                     receivedStrings.AppendLine("Name: " + properties["name"].Stringify());
00273                                     receivedStrings.AppendLine("Book Format: " + properties["bookFormat"].Stringify());
00274                                     receivedStrings.AppendLine("Author: " + properties["author"].Stringify());
00275                                     receivedStrings.AppendLine("Number of Pages: " + properties["numberOfPages"].Stringify());
00276                                     receivedStrings.AppendLine("Publisher: " + properties["publisher"].Stringify());
00277                                     receivedStrings.AppendLine("Date Published: " + properties["datePublished"].Stringify());
00278                                     receivedStrings.AppendLine("In Language: " + properties["inLanguage"].Stringify());
00279                                     receivedStrings.Append("ISBN: " + properties["isbn"].Stringify());
00280
00281                                     AddContentValue("Custom format data:" + Environment.NewLine, receivedStrings.ToString());
00282                                 }
00283                                 else
00284                                 {
00285                                     rootPage.NotifyUser("The custom format from the source app is not of type http://schema.org/Book", NotifyType.ErrorMessage);
00286                                 }
00287                             }
00288                             else
00289                             {
00290                                 rootPage.NotifyUser("The custom format from the source app doesn't contain a type", NotifyType.ErrorMessage);
00291                             }
00292                         }
00293                         catch (Exception ex)
00294                         {
00295                             rootPage.NotifyUser("Failed to parse the custom data - " + ex.Message, NotifyType.ErrorMessage);
00296                         }
00297                     }
00298                     if (m_sharedHtmlFormat != null)
00299                     {
00300                         string htmlFragment = HtmlFormatHelper.GetStaticFragment(m_sharedHtmlFormat);
00301                         if (!String.IsNullOrEmpty(htmlFragment))
00302                         {
00303                             AddContentValue("HTML: ");
00304                             ShareWebView.Visibility = Visibility.Visible;
00305                             ShareWebView.NavigateToString("<html><body>" + htmlFragment + "</body></html>");
00306                         }
00307                         else
00308                         {
00309                             rootPage.NotifyUser("GetStaticFragment failed to parse the HTML from the source app", NotifyType.ErrorMessage);
00310                         }
00311
00312                         // Check if there are any local images in the resource map.
00313                         if (m_sharedResourceMap.Count > 0)
00314                         {
00315                             //ResourceMapValue.Text = "";
00316                             foreach (KeyValuePair<string, RandomAccessStreamReference> item in m_sharedResourceMap)
00317                             {
00318                                 ResourceMapValue.Text += "\nKey: " + item.Key;
00319                             }
00320                             ResourceMapArea.Visibility = Visibility.Visible;
00321                         }
00322                     }
00323                     if (m_sharedBitmapStreamRef != null)
00324                     {
00325                         IRandomAccessStreamWithContentType bitmapStream = await m_sharedBitmapStreamRef.OpenReadAsync();
00326                         BitmapImage bitmapImage = new BitmapImage();
00327                         bitmapImage.SetSource(bitmapStream);
00328                         ImageHolder.Source = bitmapImage;
00329                         ImageArea.Visibility = Visibility.Visible;
00330                     }
00331                 });
00332             });
00333         }
00334
00335         private void QuickLinkSectionLabel_Tapped(object sender, TappedRoutedEventArgs e)
00336         {
00337             // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
00338             AddQuickLink.IsChecked = !AddQuickLink.IsChecked;
00339         }
00340
00341         private void AddQuickLink_Checked(object sender, RoutedEventArgs e)
00342         {
00343             QuickLinkCustomization.Visibility = Visibility.Visible;
00344         }
00345
00346         private void AddQuickLink_Unchecked(object sender, RoutedEventArgs e)
00347         {
00348             QuickLinkCustomization.Visibility = Visibility.Collapsed;
00349         }
00350
00351         async void ReportCompleted_Click(object sender, RoutedEventArgs e)
00352         {
00353             if (AddQuickLink.IsChecked.Equals(true))
00354             {
00355                 QuickLink quickLinkInfo = new QuickLink
00356                 {
00357                     Id = QuickLinkId.Text,
00358                     Title = QuickLinkTitle.Text,
00359
00360                     // For QuickLinks, the supported FileTypes and DataFormats are set independently from the manifest.
00361                     SupportedFileTypes = { "*" },
00362                     SupportedDataFormats =
00363                     {
00364                         StandardDataFormats.Text,
00365                         StandardDataFormats.WebLink,
00366                         StandardDataFormats.ApplicationLink,
00367                         StandardDataFormats.Bitmap,
00368                         StandardDataFormats.StorageItems,
00369                         StandardDataFormats.Html,
00370                         dataFormatName
00371                     }
00372                 };
00373
00374                 try
00375                 {
00376                     StorageFile iconFile = await Package.Current.InstalledLocation.CreateFileAsync("assets\\user.png", CreationCollisionOption.OpenIfExists);
00377                     quickLinkInfo.Thumbnail = RandomAccessStreamReference.CreateFromFile(iconFile);
00378                     m_shareOperation.ReportCompleted(quickLinkInfo);
00379                 }
00380                 catch (Exception)
00381                 {
00382                     // Even if the QuickLink cannot be created it is important to call ReportCompleted. Otherwise, if this is a long-running share,
00383                     // the app will stick around in the long-running share progress list.
00384                     m_shareOperation.ReportCompleted();
00385                     throw;
00386                 }
00387             }
00388             else
00389             {
00390                 m_shareOperation.ReportCompleted();
00391             }
00392         }
00393
00394         private void DismissUI_Click(object sender, RoutedEventArgs e)
00395         {
00396             m_shareOperation.DismissUI();
00397         }
00398
00399         private void LongRunningShareLabel_Tapped(object sender, TappedRoutedEventArgs e)
00400         {
00401             // Trigger the appropriate Checked/Unchecked event if the user taps on the text instead of the checkbox.
00402             ExpandLongRunningShareSection.IsChecked = !ExpandLongRunningShareSection.IsChecked;
00403         }
00404
00405         private void ExpandLongRunningShareSection_Checked(object sender, RoutedEventArgs e)
00406         {
00407             ExtendedSharingArea.Visibility = Visibility.Visible;
00408         }
00409
00410         private void ExpandLongRunningShareSection_Unchecked(object sender, RoutedEventArgs e)
00411         {
00412             ExtendedSharingArea.Visibility = Visibility.Collapsed;
00413         }
00414
00415         private void ReportStarted_Click(object sender, RoutedEventArgs e)
00416         {
00417             m_shareOperation.ReportStarted();
00418             rootPage.NotifyUser("Started...", NotifyType.StatusMessage);
00419         }
00420
00421         private void ReportDataRetrieved_Click(object sender, RoutedEventArgs e)
00422         {
00423             m_shareOperation.ReportDataRetrieved();
00424             rootPage.NotifyUser("Data retrieved...", NotifyType.StatusMessage);
00425         }
00426
00427         private void ReportSubmittedBackgroundTask_Click(object sender, RoutedEventArgs e)
00428         {
00429             m_shareOperation.ReportSubmittedBackgroundTask();
00430             rootPage.NotifyUser("Submitted background task...", NotifyType.StatusMessage);
00431         }
00432
00433         private void ReportErrorButton_Click(object sender, RoutedEventArgs e)
00434         {
00435             m_shareOperation.ReportError(ReportError.Text);
00436         }
00437
00438         async private void NotifyUserBackgroundThread(string message, NotifyType type)
00439         {
00440             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00441             {
00442                 rootPage.NotifyUser(message, type);
00443             });
00444         }
00445
00446         private void AddContentValue(string title, string description = null)
00447         {
00448             Run contentType = new Run();
00449             contentType.FontWeight = FontWeights.Bold;
00450             contentType.Text = title;
00451             ContentValue.Inlines.Add(contentType);
00452
00453             if (description != null)
00454             {
00455                 Run contentValue = new Run();
00456                 contentValue.Text = description + Environment.NewLine;
00457                 ContentValue.Inlines.Add(contentValue);
00458             }
00459         }
00460     }
00461 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameInfoOverlay.cpp Source File

  • Simple3DGameDX
  • cppwinrt

GameInfoOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameUIConstants.h"
00014 #include "DeviceResources.h"
00015 #include "GameInfoOverlay.h"
00016
00017 using namespace Simple3DGameDX;
00018
00019 static const int bufferLength = 1000;
00020 static wchar_t wsbuffer[bufferLength];
00021
00022 GameInfoOverlay::GameInfoOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00023     m_deviceResources(deviceResources),
00024     m_visible(false),
00025     m_titleString(L"Title"),
00026     m_bodyString(L"Body"),
00027     m_actionString(L"Action")
00028 {
00029     auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00030
00031     // Create D2D Resources
00032     winrt::check_hresult(
00033         dwriteFactory->CreateTextFormat(
00034             L"Segoe UI",
00035             nullptr,
00036             DWRITE_FONT_WEIGHT_MEDIUM,
00037             DWRITE_FONT_STYLE_NORMAL,
00038             DWRITE_FONT_STRETCH_NORMAL,
00039             GameInfoOverlayConstant::TitlePointSize,
00040             L"en-us",   // locale
00041             m_textFormatTitle.put()
00042             )
00043         );
00044
00045     winrt::check_hresult(
00046         dwriteFactory->CreateTextFormat(
00047             L"Segoe UI",
00048             nullptr,
00049             DWRITE_FONT_WEIGHT_LIGHT,
00050             DWRITE_FONT_STYLE_NORMAL,
00051             DWRITE_FONT_STRETCH_NORMAL,
00052             GameInfoOverlayConstant::BodyPointSize,
00053             L"en-us",   // locale
00054             m_textFormatBody.put()
00055             )
00056         );
00057
00058     winrt::check_hresult(
00059         m_textFormatTitle->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER)
00060         );
00061     winrt::check_hresult(
00062         m_textFormatTitle->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00063         );
00064     winrt::check_hresult(
00065         m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00066         );
00067     winrt::check_hresult(
00068         m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00069         );
00070 }
00071
00072 void GameInfoOverlay::CreateDeviceDependentResources()
00073 {
00074     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00075
00076     winrt::check_hresult(
00077         d2dContext->CreateSolidColorBrush(
00078             D2D1::ColorF(D2D1::ColorF::White),
00079             m_textBrush.put()
00080             )
00081         );
00082     winrt::check_hresult(
00083         d2dContext->CreateSolidColorBrush(
00084             D2D1::ColorF(D2D1::ColorF::Black),
00085             m_backgroundBrush.put()
00086             )
00087         );
00088     winrt::check_hresult(
00089         d2dContext->CreateSolidColorBrush(
00090             D2D1::ColorF(0xdb7100, 1.0f),
00091             m_actionBrush.put()
00092             )
00093         );
00094 }
00095
00096 void GameInfoOverlay::CreateWindowSizeDependentResources(D2D_SIZE_F overlaySize)
00097 {
00098     auto dpi = m_deviceResources->GetDpi();
00099     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00100     auto windowSize = m_deviceResources->GetLogicalSize();
00101
00102     m_levelBitmap = nullptr;
00103     m_tooSmallBitmap = nullptr;
00104
00105     m_titleRectangle = D2D1::RectF(
00106         GameInfoOverlayConstant::SideMargin,
00107         GameInfoOverlayConstant::TopMargin,
00108         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00109         GameInfoOverlayConstant::TopMargin + GameInfoOverlayConstant::TitleHeight
00110         );
00111     m_actionRectangle = D2D1::RectF(
00112         GameInfoOverlayConstant::SideMargin,
00113         overlaySize.height - (GameInfoOverlayConstant::ActionHeight + GameInfoOverlayConstant::BottomMargin),
00114         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00115         overlaySize.height - GameInfoOverlayConstant::BottomMargin
00116         );
00117     m_bodyRectangle = D2D1::RectF(
00118         GameInfoOverlayConstant::SideMargin,
00119         m_titleRectangle.bottom + GameInfoOverlayConstant::Separator,
00120         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00121         m_actionRectangle.top - GameInfoOverlayConstant::Separator
00122         );
00123
00124     // Create a D2D Bitmap to be used for Game Info Overlay when waiting to
00125     // start a level or when display game statistics.
00126     D2D1_BITMAP_PROPERTIES1 properties;
00127     properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
00128     properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
00129     properties.dpiX = dpi;
00130     properties.dpiY = dpi;
00131     properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
00132     properties.colorContext = nullptr;
00133     winrt::check_hresult(
00134         d2dContext->CreateBitmap(
00135             D2D1::SizeU(
00136                 static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
00137                 static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
00138                 ),
00139             nullptr,
00140             0,
00141             &properties,
00142             m_levelBitmap.put()
00143             )
00144         );
00145     d2dContext->SetTarget(m_levelBitmap.get());
00146     d2dContext->BeginDraw();
00147     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00148     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
00149     d2dContext->DrawText(
00150         m_titleString.c_str(),
00151         m_titleString.size(),
00152         m_textFormatTitle.get(),
00153         m_titleRectangle,
00154         m_textBrush.get()
00155         );
00156     d2dContext->DrawText(
00157         m_bodyString.c_str(),
00158         m_bodyString.size(),
00159         m_textFormatBody.get(),
00160         m_bodyRectangle,
00161         m_textBrush.get()
00162         );
00163     d2dContext->DrawText(
00164         m_actionString.c_str(),
00165         m_actionString.size(),
00166         m_textFormatBody.get(),
00167         m_actionRectangle,
00168         m_actionBrush.get()
00169         );
00170     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00171     // is lost. It will be handled during the next call to Present.
00172     HRESULT hr = d2dContext->EndDraw();
00173     if (hr != D2DERR_RECREATE_TARGET)
00174     {
00175         winrt::check_hresult(hr);
00176     }
00177
00178     // Create the TooSmall Bitmap.
00179     winrt::check_hresult(
00180         d2dContext->CreateBitmap(
00181             D2D1::SizeU(
00182                 static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
00183                 static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
00184                 ),
00185             nullptr,
00186             0,
00187             &properties,
00188             m_tooSmallBitmap.put()
00189             )
00190         );
00191     d2dContext->SetTarget(m_tooSmallBitmap.get());
00192     d2dContext->BeginDraw();
00193     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00194     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
00195     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00196     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00197     std::wstring string = L"Paused";
00198
00199     d2dContext->DrawText(
00200         string.c_str(),
00201         string.size(),
00202         m_textFormatTitle.get(),
00203         m_bodyRectangle,
00204         m_textBrush.get()
00205         );
00206     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00207     // is lost. It will be handled during the next call to Present.
00208     hr = d2dContext->EndDraw();
00209     if (hr != D2DERR_RECREATE_TARGET)
00210     {
00211         winrt::check_hresult(hr);
00212     }
00213 }
00214
00215 ID2D1Bitmap1* GameInfoOverlay::Bitmap()
00216 {
00217     if (m_tooSmallActive)
00218     {
00219         return m_tooSmallBitmap.get();
00220     }
00221     else
00222     {
00223         return m_levelBitmap.get();
00224     }
00225 }
00226
00227 void GameInfoOverlay::ReleaseDeviceDependentResources()
00228 {
00229     m_levelBitmap = nullptr;
00230     m_tooSmallBitmap = nullptr;
00231     m_textBrush = nullptr;
00232     m_backgroundBrush = nullptr;
00233     m_actionBrush = nullptr;
00234 }
00235
00236 void GameInfoOverlay::SetGameLoading(uint32_t dots)
00237 {
00238     int length;
00239     m_titleString = L"Loading Resources";
00240     m_bodyString = L"";
00241
00242     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00243
00244     d2dContext->SetTarget(m_levelBitmap.get());
00245     d2dContext->BeginDraw();
00246     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00247     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00248     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00249     d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.get());
00250
00251     d2dContext->DrawText(
00252         m_titleString.c_str(),
00253         m_titleString.size(),
00254         m_textFormatTitle.get(),
00255         m_titleRectangle,
00256         m_textBrush.get()
00257         );
00258
00259     dots = dots % 10;
00260     for (length = 0; length < 25; length++)
00261     {
00262         wsbuffer[length] = L' ';
00263     }
00264     for (uint32_t i = 0; i < dots; i++)
00265     {
00266         wsbuffer[length++] = 0x25CF;   // This is a Dot character in the font.
00267         wsbuffer[length++] = L' ';
00268         wsbuffer[length++] = L' ';
00269         wsbuffer[length++] = L' ';
00270     }
00271
00272     m_bodyString = std::wstring(wsbuffer, length);
00273     d2dContext->DrawText(
00274         m_bodyString.c_str(),
00275         m_bodyString.size(),
00276         m_textFormatBody.get(),
00277         m_bodyRectangle,
00278         m_actionBrush.get()
00279         );
00280
00281     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00282     // is lost. It will be handled during the next call to Present.
00283     HRESULT hr = d2dContext->EndDraw();
00284     if (hr != D2DERR_RECREATE_TARGET)
00285     {
00286         winrt::check_hresult(hr);
00287     }
00288 }
00289
00290 void GameInfoOverlay::SetGameStats(int maxLevel, int hitCount, int shotCount)
00291 {
00292     int length;
00293
00294     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00295
00296     d2dContext->SetTarget(m_levelBitmap.get());
00297     d2dContext->BeginDraw();
00298     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00299     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00300     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00301     m_titleString = L"High Score";
00302
00303     d2dContext->DrawText(
00304         m_titleString.c_str(),
00305         m_titleString.size(),
00306         m_textFormatTitle.get(),
00307         m_titleRectangle,
00308         m_textBrush.get()
00309         );
00310     length = swprintf_s(
00311         wsbuffer,
00312         bufferLength,
00313         L"Levels Completed %d\nTotal Points %d\nTotal Shots %d",
00314         maxLevel,
00315         hitCount,
00316         shotCount
00317         );
00318     m_bodyString = std::wstring(wsbuffer, length);
00319     d2dContext->DrawText(
00320         m_bodyString.c_str(),
00321         m_bodyString.size(),
00322         m_textFormatBody.get(),
00323         m_bodyRectangle,
00324         m_textBrush.get()
00325         );
00326
00327     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00328     // is lost. It will be handled during the next call to Present.
00329     HRESULT hr = d2dContext->EndDraw();
00330     if (hr != D2DERR_RECREATE_TARGET)
00331     {
00332         winrt::check_hresult(hr);
00333     }
00334 }
00335
00336 void GameInfoOverlay::SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore)
00337 {
00338     int length;
00339
00340     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00341
00342     d2dContext->SetTarget(m_levelBitmap.get());
00343     d2dContext->BeginDraw();
00344     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00345     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00346     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00347     if (win)
00348     {
00349         m_titleString = L"You WON!";
00350     }
00351     else
00352     {
00353         m_titleString = L"Game Over";
00354     }
00355     d2dContext->DrawText(
00356         m_titleString.c_str(),
00357         m_titleString.size(),
00358         m_textFormatTitle.get(),
00359         m_titleRectangle,
00360         m_textBrush.get()
00361         );
00362     length = swprintf_s(
00363         wsbuffer,
00364         bufferLength,
00365         L"Levels Completed %d\nTotal Points %d\nTotal Shots %d\n\nHigh Score %d\n",
00366         maxLevel,
00367         hitCount,
00368         shotCount,
00369         highScore
00370         );
00371     m_bodyString = std::wstring(wsbuffer, length);
00372     d2dContext->DrawText(
00373         m_bodyString.c_str(),
00374         m_bodyString.size(),
00375         m_textFormatBody.get(),
00376         m_bodyRectangle,
00377         m_textBrush.get()
00378         );
00379
00380     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00381     // is lost. It will be handled during the next call to Present.
00382     HRESULT hr = d2dContext->EndDraw();
00383     if (hr != D2DERR_RECREATE_TARGET)
00384     {
00385         winrt::check_hresult(hr);
00386     }
00387 }
00388
00389 void GameInfoOverlay::SetLevelStart(int level, std::wstring const& objective, float timeLimit, float bonusTime)
00390 {
00391     int length;
00392
00393     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00394
00395     d2dContext->SetTarget(m_levelBitmap.get());
00396     d2dContext->BeginDraw();
00397     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00398     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00399     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00400     length = swprintf_s(wsbuffer, bufferLength, L"Level %d", level);
00401     m_titleString = std::wstring(wsbuffer, length);
00402     d2dContext->DrawText(
00403         m_titleString.c_str(),
00404         m_titleString.size(),
00405         m_textFormatTitle.get(),
00406         m_titleRectangle,
00407         m_textBrush.get()
00408         );
00409
00410     if (bonusTime > 0.0f)
00411     {
00412         length = swprintf_s(
00413             wsbuffer,
00414             bufferLength,
00415             L"Objective: %ls\nTime  Limit: %6.1f sec\nBonus Time: %6.1f sec\n",
00416             objective.c_str(),
00417             timeLimit,
00418             bonusTime
00419             );
00420     }
00421     else
00422     {
00423         length = swprintf_s(
00424             wsbuffer,
00425             bufferLength,
00426             L"Objective: %ls\nTime  Limit: %6.1f sec\n",
00427             objective.c_str(),
00428             timeLimit
00429             );
00430     }
00431     m_bodyString = winrt::hstring(wsbuffer, length);
00432     d2dContext->DrawText(
00433         m_bodyString.c_str(),
00434         m_bodyString.size(),
00435         m_textFormatBody.get(),
00436         m_bodyRectangle,
00437         m_textBrush.get()
00438         );
00439
00440     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00441     // is lost. It will be handled during the next call to Present.
00442     HRESULT hr = d2dContext->EndDraw();
00443     if (hr != D2DERR_RECREATE_TARGET)
00444     {
00445         winrt::check_hresult(hr);
00446     }
00447 }
00448
00449 void GameInfoOverlay::SetPause(int /* level */, int /* hitCount */, int /* shotCount */, float /*timeRemaining */)
00450 {
00451     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00452
00453     d2dContext->SetTarget(m_levelBitmap.get());
00454     d2dContext->BeginDraw();
00455     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00456     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.get());
00457     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.get());
00458     m_titleString = L"Game Paused";
00459     m_bodyString = L"";
00460
00461     d2dContext->DrawText(
00462         m_titleString.c_str(),
00463         m_titleString.size(),
00464         m_textFormatTitle.get(),
00465         m_bodyRectangle,
00466         m_textBrush.get()
00467         );
00468
00469     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00470     // is lost. It will be handled during the next call to Present.
00471     HRESULT hr = d2dContext->EndDraw();
00472     if (hr != D2DERR_RECREATE_TARGET)
00473     {
00474         winrt::check_hresult(hr);
00475     }
00476 }
00477
00478 void GameInfoOverlay::ShowTooSmall()
00479 {
00480     m_visible = true;
00481     m_tooSmallActive = true;
00482 }
00483
00484 void GameInfoOverlay::HideTooSmall()
00485 {
00486     m_visible = false;
00487     m_tooSmallActive = false;
00488 }
00489
00490 void GameInfoOverlay::SetAction(GameInfoOverlayCommand action)
00491 {
00492     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00493
00494     d2dContext->SetTarget(m_levelBitmap.get());
00495     d2dContext->BeginDraw();
00496     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00497     d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.get());
00498
00499     switch (action)
00500     {
00501     case GameInfoOverlayCommand::PlayAgain:
00502         m_actionString = L"Tap to play again ...";
00503         break;
00504     case GameInfoOverlayCommand::PleaseWait:
00505         m_actionString = L"Level loading, please wait ...";
00506         break;
00507     case GameInfoOverlayCommand::TapToContinue:
00508         m_actionString = L"Tap to continue ...";
00509         break;
00510     default:
00511         m_actionString = L"";
00512         break;
00513     }
00514     if (action != GameInfoOverlayCommand::None)
00515     {
00516         d2dContext->DrawText(
00517             m_actionString.c_str(),
00518             m_actionString.size(),
00519             m_textFormatBody.get(),
00520             m_actionRectangle,
00521             m_actionBrush.get()
00522             );
00523     }
00524
00525     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00526     // is lost. It will be handled during the next call to Present.
00527     HRESULT hr = d2dContext->EndDraw();
00528     if (hr != D2DERR_RECREATE_TARGET)
00529     {
00530         winrt::check_hresult(hr);
00531     }
00532 }
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ChangeAdminKey Member List

This is the complete list of members for Scenario4_ChangeAdminKey, including all inherited members.
ChangeAdminKey_Click(object sender, RoutedEventArgs e) | Scenario4_ChangeAdminKey | [inline, private]
rootPage | Scenario4_ChangeAdminKey | [private]
Scenario4_ChangeAdminKey() | Scenario4_ChangeAdminKey | [inline]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S4_CheckIndexRevision.xaml.cpp Source File

  • ContentIndexer
  • cpp

S4_CheckIndexRevision.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S4_CheckIndexRevision.xaml.cpp
00014 // Implementation of the S4_CheckIndexRevision class
00015 //
00016
00017 #include "pch.h"
00018 #include "S4_CheckIndexRevision.xaml.h"
00019 #include "MainPage.xaml.h"
00020 #include "Helpers.h"
00021
00022 using namespace SDKTemplate;
00023
00024 using namespace concurrency;
00025 using namespace Platform;
00026 using namespace Platform::Collections;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::Foundation;
00030 using namespace Windows::Foundation::Collections;
00031
00032 S4_CheckIndexRevision::S4_CheckIndexRevision()
00033 {
00034     InitializeComponent();
00035
00036     // This initializes the value used throughout the sample which tracks the expected index revision number. This
00037     // value is used to check if the app's expected revision number matches the actual index revision number and is
00038     // stored in the app's local settings to allow it to persist across termination.
00039     auto localSettings = Windows::Storage::ApplicationData::Current->LocalSettings;
00040     if (!localSettings->Values->HasKey(L"expectedIndexRevision"))
00041     {
00042         localSettings->Values->Insert(L"expectedIndexRevision", ref new Platform::Box<unsigned long long>(0));
00043     }
00044 }
00045
00046 // This function displays the app's expected index revision number and the actual index revision number reported by
00047 // the index. For purposes of this sample, this is done in reaction to a button being pressed. In practice, this should
00048 // be done when an app is activated.
00049 // If the reported index revision number is 0, it means the index has been reset and an app should re-push all of its
00050 // data.
00051 // If the reported index revision number is not 0, but doesn't match the app's expected index revision number, it
00052 // indicates that not all of the app's adds/deletes/updates were successfully processed. This should be an edge case,
00053 // but when hit, the app should re-do the missed operations. Tracking the expected index revision number can be used to
00054 // create checkpoints in the app so it can only re-do the operations required to match the expected index revision
00055 // number.
00056 void S4_CheckIndexRevision::CheckIndexRevision_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00057 {
00058     auto indexer = Windows::Storage::Search::ContentIndexer::GetIndexer();
00059     auto localSettings = Windows::Storage::ApplicationData::Current->LocalSettings;
00060     String^ outputString = L"Expected Index Revision Number: " + localSettings->Values->Lookup(L"expectedIndexRevision");
00061     outputString += L"\nReported Index Revision Number: " + indexer->Revision;
00062     if (localSettings->Values->Lookup(L"expectedIndexRevision") != indexer->Revision)
00063     {
00064         // There is a mismatch between the expected and reported index revision numbers.
00065         if (indexer->Revision == 0)
00066         {
00067             // The index has been reset, so code would be added here to re-push all data.
00068         }
00069         else
00070         {
00071             // The index hasn't been reset, but it doesn't contain all expected updates, so add code to get the index
00072             // back into the expected state.
00073         }
00074
00075         // After doing the necessary work to get back to a synchronized state, set the expected index revision number
00076         // to match the reported revision number.
00077         localSettings->Values->Insert(L"expectedIndexRevision", indexer->Revision);
00078     }
00079     MainPage::Current->NotifyUser(outputString, NotifyType::StatusMessage);
00080 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CompletedCallback.xaml.h Source File

  • MessageDialog
  • cpp

CompletedCallback.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // CompletedCallback.xaml.h
00013 // Declaration of the CompletedCallback class
00014 //
00015
00016 #pragma once
00017
00018 #include "CompletedCallback.g.h"
00019 #include "MainPage.xaml.h"
00020
00021 namespace SDKTemplate
00022 {
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class CompletedCallback sealed
00025     {
00026     public:
00027         CompletedCallback();
00028
00029     protected:
00030         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031     private:
00032         MainPage^ rootPage;
00033         void CompletedCallbackButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034     };
00035 }
Generated on Fri Nov 15 2024 22:20:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BooleanToVisibilityConverter Member List

This is the complete list of members for BooleanToVisibilityConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | BooleanToVisibilityConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | BooleanToVisibilityConverter | [inline]
IsInverse | BooleanToVisibilityConverter |
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NfcProvisioner/cs/SampleConfiguration.cs Source File

  • NfcProvisioner
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using NfcProvisioner;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "NfcProvisioner";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Provision Peer Device", ClassType=typeof(Scenario1)}
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Audio/OmnidirectionalSound.cpp Source File

  • HolographicVoiceInput
  • cpp
  • Audio

OmnidirectionalSound.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #include "OmnidirectionalSound.h"
00015 #include "XAudio2Helpers.h"
00016
00017 using namespace Microsoft::WRL;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Numerics;
00020 using namespace Windows::Media::SpeechSynthesis;
00021
00022 #define HRTF_2PI 6.283185307f
00023
00024 _Use_decl_annotations_
00025 HRESULT OmnidirectionalSound::Initialize(LPCWSTR filename, UINT32 const& loopCount)
00026 {
00027     auto hr = _audioFile.Initialize(filename);
00028
00029     if (SUCCEEDED(hr))
00030     {
00031         _sourceType = SoundSourceType::File;
00032     }
00033
00034     ComPtr<IXAPO> xapo;
00035     if (SUCCEEDED(hr))
00036     {
00037         // Passing in nullptr as the first arg for HrtfApoInit initializes the APO with defaults of
00038         // omnidirectional sound with natural distance decay behavior.
00039         // CreateHrtfApo will fail with E_NOTIMPL on unsupported platforms.
00040         hr = CreateHrtfApo(nullptr, &xapo);
00041     }
00042
00043     if (SUCCEEDED(hr))
00044     {
00045         hr = xapo.As(&_hrtfParams);
00046     }
00047
00048     // Set the default environment.
00049     if (SUCCEEDED(hr))
00050     {
00051         hr = _hrtfParams->SetEnvironment(_environment);
00052     }
00053
00054     // Initialize an XAudio2 graph that hosts the HRTF xAPO.
00055     // The source voice is used to submit audio data and control playback.
00056     if (SUCCEEDED(hr))
00057     {
00058         hr = SetupXAudio2(_audioFile.GetFormat(), xapo.Get(), &_xaudio2, &_sourceVoice);
00059     }
00060
00061     // Submit audio data to the source voice.
00062     if (SUCCEEDED(hr))
00063     {
00064         XAUDIO2_BUFFER buffer{};
00065         buffer.AudioBytes = static_cast<UINT32>(_audioFile.GetSize());
00066         buffer.pAudioData = _audioFile.GetData();
00067         buffer.LoopCount = loopCount;
00068         hr = _sourceVoice->SubmitSourceBuffer(&buffer);
00069
00070         const WAVEFORMATEX* format = _audioFile.GetFormat();
00071         unsigned int streamSize = _audioFile.GetSize();
00072
00073         // compute audio length, in seconds
00074         unsigned int numSamples =
00075             streamSize * 8 /                            // number of bits
00076             format->wBitsPerSample;                     // bits per sample
00077
00078         float numSeconds =
00079             static_cast<float>(numSamples) /            // number of samples
00080             static_cast<float>(format->nSamplesPerSec); // samples per second
00081
00082         _duration = numSeconds;
00083     }
00084
00085     return (_initStatus = hr);
00086 }
00087
00088 _Use_decl_annotations_
00089 HRESULT OmnidirectionalSound::Initialize(SpeechSynthesisStream^ stream, UINT32 const& loopCount)
00090 {
00091     auto hr = _audioStream.Initialize(stream);
00092
00093     if (SUCCEEDED(hr))
00094     {
00095         _sourceType = SoundSourceType::Stream;
00096     }
00097
00098     ComPtr<IXAPO> xapo;
00099     if (SUCCEEDED(hr))
00100     {
00101         // Passing in nullptr as the first arg for HrtfApoInit initializes the APO with defaults of
00102         // omnidirectional sound with natural distance decay behavior.
00103         // CreateHrtfApo will fail with E_NOTIMPL on unsupported platforms.
00104         hr = CreateHrtfApo(nullptr, &xapo);
00105     }
00106
00107     if (SUCCEEDED(hr))
00108     {
00109         hr = xapo.As(&_hrtfParams);
00110     }
00111
00112     // Set the default environment.
00113     if (SUCCEEDED(hr))
00114     {
00115         hr = _hrtfParams->SetEnvironment(_environment);
00116     }
00117
00118     // Initialize an XAudio2 graph that hosts the HRTF xAPO.
00119     // The source voice is used to submit audio data and control playback.
00120     if (SUCCEEDED(hr))
00121     {
00122         hr = SetupXAudio2(_audioStream.GetFormat(), xapo.Get(), &_xaudio2, &_sourceVoice);
00123     }
00124
00125     // Set the initial position.
00126     if (SUCCEEDED(hr))
00127     {
00128         auto hrtfPosition = HrtfPosition{ 0.f, 0.f, 0.f };
00129         hr = _hrtfParams->SetSourcePosition(&hrtfPosition);
00130     }
00131
00132     // Submit audio data to the source voice.
00133     if (SUCCEEDED(hr))
00134     {
00135         XAUDIO2_BUFFER buffer{};
00136         buffer.AudioBytes = static_cast<UINT32>(_audioStream.GetSize());
00137         buffer.pAudioData = _audioStream.GetData();
00138         buffer.LoopCount = loopCount;
00139         hr = _sourceVoice->SubmitSourceBuffer(&buffer);
00140
00141         const WAVEFORMATEX* format = _audioStream.GetFormat();
00142         unsigned int streamSize = _audioStream.GetSize();
00143
00144         // compute audio length, in seconds
00145         unsigned int numSamples =
00146             streamSize * 8 /                            // number of bits
00147             format->wBitsPerSample;                     // bits per sample
00148
00149         float numSeconds =
00150             static_cast<float>(numSamples) /            // number of samples
00151             static_cast<float>(format->nSamplesPerSec); // samples per second
00152
00153         _duration = numSeconds;
00154     }
00155
00156     return (_initStatus = hr);
00157 }
00158
00159 OmnidirectionalSound::~OmnidirectionalSound()
00160 {
00161     if (_sourceVoice)
00162     {
00163         _sourceVoice->DestroyVoice();
00164     }
00165 }
00166
00167 HRESULT OmnidirectionalSound::Start()
00168 {
00169     _lastTick = GetTickCount64();
00170     return _sourceVoice->Start();
00171 }
00172
00173 HRESULT OmnidirectionalSound::Stop()
00174 {
00175     return _sourceVoice->Stop();
00176 }
00177
00178 _Use_decl_annotations_
00179 HRESULT OmnidirectionalSound::SetEnvironment(HrtfEnvironment environment)
00180 {
00181     // Environment can be changed at any time.
00182     return _hrtfParams->SetEnvironment(environment);
00183 }
00184
00185 //
00186 // This method is called on every dispatcher timer tick.
00187 // Caller passes in the information necessary to compute the source position.
00188 //
00189 _Use_decl_annotations_
00190 HRESULT OmnidirectionalSound::OnUpdate(float angularVelocity, float height, float radius)
00191 {
00192     auto tick = GetTickCount64();
00193     auto elapsedTime = tick - _lastTick;
00194     _lastTick = tick;
00195     _angle += elapsedTime * angularVelocity;
00196     _angle = _angle > HRTF_2PI ? (_angle - HRTF_2PI) : _angle;
00197     auto position = ComputePositionInOrbit(height, radius, _angle);
00198     return _hrtfParams->SetSourcePosition(&position);
00199 }
00200
00201
00202 HRESULT OmnidirectionalSound::OnUpdate(_In_ float3 position)
00203 {
00204     auto hrtfPosition = HrtfPosition{ position.x, position.y, position.z };
00205     return _hrtfParams->SetSourcePosition(&hrtfPosition);
00206 }
00207
00208 _Use_decl_annotations_
00209 HrtfPosition OmnidirectionalSound::ComputePositionInOrbit(float height, float radius, float angle)
00210 {
00211     // Calculate the position of the source based on height relative to listerner's head, radius of orbit and angle relative to the listener.
00212     // APO uses right-handed coordinate system where -ve z-axis is forward and +ve z-axis is backward.
00213     // All coordinates use real-world units (meters).
00214     float x = radius * sin(angle);
00215     float z = -radius * cos(angle);
00216     return HrtfPosition{x, height ,z};
00217 }
00218
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceSelectorInfo Member List

This is the complete list of members for DeviceSelectorInfo, including all inherited members.
DeviceSelectorInfo(hstring displayName, Windows::Devices::Enumeration::DeviceClass deviceClassSelector, Windows::Devices::Enumeration::DeviceInformationKind kind=Windows::Devices::Enumeration::DeviceInformationKind::Unknown, hstring selector={}) | DeviceSelectorInfo | [inline]
DeviceSelectorInfo(hstring const &displayName, hstring const &selector, Windows::Devices::Enumeration::DeviceInformationKind kind=Windows::Devices::Enumeration::DeviceInformationKind::Unknown) | DeviceSelectorInfo | [inline]
kind | DeviceSelectorInfo |
m_deviceClassSelector | DeviceSelectorInfo |
m_kind | DeviceSelectorInfo |
m_selector | DeviceSelectorInfo |
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/pch.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/SampleConfiguration.h Source File

  • BackButton
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "SystemBack C++ Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/Scenario2_Polling.xaml.h Source File

  • Altimeter
  • cpp

Scenario2_Polling.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.h
00014 // Declaration of the Scenario2_Polling class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2_Polling.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario2_Polling sealed
00030     {
00031     public:
00032         Scenario2_Polling();
00033
00034     private:
00035         SDKTemplate::MainPage^ rootPage;
00036         Windows::UI::Core::CoreDispatcher^ dispatcher;
00037         Windows::Devices::Sensors::Altimeter^ sensor;
00038         void ScenarioGetData(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039     };
00040 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • Compass
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     compass = Compass::GetDefault();
00035     if (compass != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = compass->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041     }
00042     else
00043     {
00044         rootPage->NotifyUser("No compass found", NotifyType::ErrorMessage);
00045     }
00046 }
00047
00048 /// <summary>
00049 /// Invoked when this page is about to be displayed in a Frame.
00050 /// </summary>
00051 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00052 /// property is typically used to configure the page.</param>
00053 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00054 {
00055     ScenarioEnableButton->IsEnabled = true;
00056     ScenarioDisableButton->IsEnabled = false;
00057 }
00058
00059 /// <summary>
00060 /// Invoked when this page is no longer displayed.
00061 /// </summary>
00062 /// <param name="e"></param>
00063 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00064 {
00065     // If the navigation is external to the app do not clean up.
00066     // This can occur on Phone when suspending the app.
00067     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00068     {
00069         return;
00070     }
00071
00072     if (ScenarioDisableButton->IsEnabled)
00073     {
00074         Window::Current->VisibilityChanged::remove(visibilityToken);
00075         compass->ReadingChanged::remove(readingToken);
00076
00077         // Restore the default report interval to release resources while the sensor is not in use
00078         compass->ReportInterval = 0;
00079     }
00080 }
00081
00082 /// <summary>
00083 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00084 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00085 /// </summary>
00086 /// <param name="sender"></param>
00087 /// <param name="e">
00088 /// Event data that can be examined for the current visibility state.
00089 /// </param>
00090 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00091 {
00092     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00093     if (ScenarioDisableButton->IsEnabled)
00094     {
00095         if (e->Visible)
00096         {
00097             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00098             readingToken = compass->ReadingChanged::add(ref new TypedEventHandler<Compass^, CompassReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00099         }
00100         else
00101         {
00102             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00103             compass->ReadingChanged::remove(readingToken);
00104         }
00105     }
00106 }
00107
00108 void Scenario1_DataEvents::ReadingChanged(Compass^ sender, CompassReadingChangedEventArgs^ e)
00109 {
00110     // We need to dispatch to the UI thread to display the output
00111     Dispatcher->RunAsync(
00112         CoreDispatcherPriority::Normal,
00113         ref new DispatchedHandler(
00114             [this, e]()
00115             {
00116                 CompassReading^ reading = e->Reading;
00117
00118                 ScenarioOutput_MagneticNorth->Text = reading->HeadingMagneticNorth.ToString();
00119                 if (reading->HeadingTrueNorth != nullptr)
00120                 {
00121                     ScenarioOutput_TrueNorth->Text = reading->HeadingTrueNorth->Value.ToString();
00122                 }
00123                 else
00124                 {
00125                     ScenarioOutput_TrueNorth->Text = "No data";
00126                 }
00127                 switch (reading->HeadingAccuracy)
00128                 {
00129                     case MagnetometerAccuracy::Unknown:
00130                         ScenarioOutput_HeadingAccuracy->Text = "Unknown";
00131                         break;
00132                     case MagnetometerAccuracy::Unreliable:
00133                         ScenarioOutput_HeadingAccuracy->Text = "Unreliable";
00134                         break;
00135                     case MagnetometerAccuracy::Approximate:
00136                         ScenarioOutput_HeadingAccuracy->Text = "Approximate";
00137                         break;
00138                     case MagnetometerAccuracy::High:
00139                         ScenarioOutput_HeadingAccuracy->Text = "High";
00140                         break;
00141                     default:
00142                         ScenarioOutput_HeadingAccuracy->Text = "No data";
00143                         break;
00144                 }
00145             },
00146             CallbackContext::Any
00147             )
00148         );
00149 }
00150
00151 void Scenario1_DataEvents::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00152 {
00153     if (compass != nullptr)
00154     {
00155         // Establish the report interval
00156         compass->ReportInterval = desiredReportInterval;
00157
00158         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged));
00159         readingToken = compass->ReadingChanged::add(ref new TypedEventHandler<Compass^, CompassReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
00160
00161         ScenarioEnableButton->IsEnabled = false;
00162         ScenarioDisableButton->IsEnabled = true;
00163     }
00164     else
00165     {
00166         rootPage->NotifyUser("No compass found", NotifyType::ErrorMessage);
00167     }
00168 }
00169
00170 void Scenario1_DataEvents::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00171 {
00172     Window::Current->VisibilityChanged::remove(visibilityToken);
00173     compass->ReadingChanged::remove(readingToken);
00174
00175     // Restore the default report interval to release resources while the sensor is not in use
00176     compass->ReportInterval = 0;
00177
00178     ScenarioEnableButton->IsEnabled = true;
00179     ScenarioDisableButton->IsEnabled = false;
00180 }
Generated on Fri Nov 15 2024 22:17:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Sphere.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Sphere.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Sphere.h"
00014
00015 using namespace DirectX;
00016
00017 Sphere::Sphere()
00018 {
00019     m_position = XMFLOAT3(0.0f, 0.0f, 0.0f);
00020     m_radius = 1.0f;
00021     Update();
00022 }
00023
00024 Sphere::Sphere(
00025     DirectX::XMFLOAT3 position,
00026     float radius
00027     )
00028 {
00029     m_position = position;
00030     m_radius = radius;
00031     Update();
00032 }
00033
00034 void Sphere::Update()
00035 {
00036     XMStoreFloat4x4(
00037         &m_modelMatrix,
00038         XMMatrixScaling(m_radius, m_radius, m_radius) *
00039         XMMatrixTranslation(m_position.x, m_position.y, m_position.z)
00040         );
00041 }
00042
00043 bool Sphere::IsTouching(
00044     XMFLOAT3 point,
00045     float radius,
00046     _Out_ XMFLOAT3* contact,
00047     _Out_ XMFLOAT3* normal
00048     )
00049 {
00050     // Check collision between instances One and Two.
00051     // oneToTwo is the collision normal vector.
00052     XMVECTOR oneToTwo = XMLoadFloat3(&m_position) - XMLoadFloat3(&point);
00053
00054     float distance = XMVectorGetX(XMVector3Length(oneToTwo));
00055
00056     oneToTwo = XMVector3Normalize(oneToTwo);
00057     XMStoreFloat3(normal, oneToTwo);
00058     XMStoreFloat3(contact, oneToTwo * m_radius);
00059
00060     if (distance < 0.0f)
00061     {
00062         distance *= -1.0f;
00063     }
00064
00065     if (distance < (radius + m_radius))
00066     {
00067         return true;
00068     }
00069     else
00070     {
00071         return false;
00072     }
00073 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

S6_DeleteWithAppContent Member List

This is the complete list of members for S6_DeleteWithAppContent, including all inherited members.
AddToIndex_Click(object sender, RoutedEventArgs e) | S6_DeleteWithAppContent | [inline, private]
DeleteAllItems_Click(object sender, RoutedEventArgs e) | S6_DeleteWithAppContent | [inline, private]
DeleteSingleItem_Click(object sender, RoutedEventArgs e) | S6_DeleteWithAppContent | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | S6_DeleteWithAppContent | [inline, protected]
rootPage | S6_DeleteWithAppContent | [private]
S6_DeleteWithAppContent() | S6_DeleteWithAppContent | [inline]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EventHandlerForDevice Member List

This is the complete list of members for EventHandlerForDevice, including all inherited members.
appResumeEventHandler | EventHandlerForDevice | [private]
appSuspendEventHandler | EventHandlerForDevice | [private]
CloseCurrentlyConnectedDevice() | EventHandlerForDevice | [inline, private]
CloseDevice() | EventHandlerForDevice | [inline]
ConfigureCurrentlyConnectedDevice() | EventHandlerForDevice | [inline]
CreateNewEventHandlerForDevice() | EventHandlerForDevice | [inline, static]
Current | EventHandlerForDevice | [static]
device | EventHandlerForDevice | [private]
Device | EventHandlerForDevice |
deviceAccessEventHandler | EventHandlerForDevice | [private]
DeviceAccessInformation | EventHandlerForDevice |
deviceAccessInformation | EventHandlerForDevice | [private]
deviceAddedEventHandler | EventHandlerForDevice | [private]
deviceCloseCallback | EventHandlerForDevice | [private]
deviceConnectedCallback | EventHandlerForDevice | [private]
DeviceInformation | EventHandlerForDevice |
deviceInformation | EventHandlerForDevice | [private]
deviceRemovedEventHandler | EventHandlerForDevice | [private]
deviceSelector | EventHandlerForDevice | [private]
DeviceSelector | EventHandlerForDevice |
deviceWatcher | EventHandlerForDevice | [private]
EventHandlerForDevice() | EventHandlerForDevice | [inline, private]
eventHandlerForDevice | EventHandlerForDevice | [private, static]
IsDeviceConnected | EventHandlerForDevice |
isEnabledAutoReconnect | EventHandlerForDevice | [private]
IsEnabledAutoReconnect | EventHandlerForDevice |
OnAppResume(Object sender, Object args) | EventHandlerForDevice | [inline, private]
OnAppSuspension(Object sender, SuspendingEventArgs args) | EventHandlerForDevice | [inline, private]
OnDeviceAccessChanged(DeviceAccessInformation sender, DeviceAccessChangedEventArgs eventArgs) | EventHandlerForDevice | [inline, private]
OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInfo) | EventHandlerForDevice | [inline, private]
OnDeviceClose | EventHandlerForDevice |
OnDeviceConnected | EventHandlerForDevice |
OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate) | EventHandlerForDevice | [inline, private]
OpenDeviceAsync(DeviceInformation deviceInfo, String deviceSelector) | EventHandlerForDevice | [inline]
RegisterForAppEvents() | EventHandlerForDevice | [inline, private]
RegisterForDeviceAccessStatusChange() | EventHandlerForDevice | [inline, private]
RegisterForDeviceWatcherEvents() | EventHandlerForDevice | [inline, private]
rootPage | EventHandlerForDevice | [private]
singletonCreationLock | EventHandlerForDevice | [private, static]
StartDeviceWatcher() | EventHandlerForDevice | [inline, private]
StopDeviceWatcher() | EventHandlerForDevice | [inline, private]
UnregisterFromAppEvents() | EventHandlerForDevice | [inline, private]
UnregisterFromDeviceAccessStatusChange() | EventHandlerForDevice | [inline, private]
UnregisterFromDeviceWatcherEvents() | EventHandlerForDevice | [inline, private]
watcherStarted | EventHandlerForDevice | [private]
watcherSuspended | EventHandlerForDevice | [private]
Generated on Fri Nov 15 2024 22:24:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NavigationHelper Member List

This is the complete list of members for NavigationHelper, including all inherited members.
_pageKey | NavigationHelper | [private]
Frame | NavigationHelper | [private]
LoadState | NavigationHelper |
NavigationHelper(Page page) | NavigationHelper | [inline]
OnNavigatedFrom(NavigationEventArgs e) | NavigationHelper | [inline]
OnNavigatedTo(NavigationEventArgs e) | NavigationHelper | [inline]
Page | NavigationHelper | [private]
SaveState | NavigationHelper |
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ToastActivationTypeBackgroundClosedTask Member List

This is the complete list of members for ToastActivationTypeBackgroundClosedTask, including all inherited members.
Run(IBackgroundTaskInstance taskInstance) ToastActivationTypeBackgroundClosedTask [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/Scenario3_Porting.xaml.cpp Source File

  • Gyrometer
  • cpp

Scenario3_Porting.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Porting.xaml.cpp
00014 // Implementation of the Scenario3_Porting class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_Porting.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario3_Porting::Scenario3_Porting() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033
00034     // Get two instances of the gyrometer:
00035     // One that returns the raw gyrometer data
00036     gyrometerWindows = Gyrometer::GetDefault();
00037     // Other on which the 'ReadingTransform' is updated so that data returned aligns with the native WP orientation (portrait)
00038     gyrometerWP = Gyrometer::GetDefault();
00039
00040     if (nullptr == gyrometerWP || nullptr == gyrometerWindows)
00041     {
00042         rootPage->NotifyUser("No gyrometer found", NotifyType::ErrorMessage);
00043     }
00044     else
00045     {
00046         // Assumption is that this app has been developed for Windows Phone 8.1 (or earlier)
00047         // and hence assumes that the sensor returns readings in Portrait Mode, which may
00048         // not be true when the app or sensor logic is being ported over to a
00049         // Landscape-First Windows device
00050         // While we encourage you to re-design your app as a universal app to gain access
00051         // to many other advantages of developing a universal app, this scenario demonstrates
00052         // a simple approach to let the runtime honor your assumption on the
00053         // "native orientation" of the sensor.
00054         gyrometerWP->ReadingTransform = Windows::Graphics::Display::DisplayOrientations::Portrait;
00055         // If you were to go the route of universal app, make no assumptions about the
00056         // native orientation of the device. Instead rely on using a display orientation
00057         // (absolute or current) to enforce the reference frame for the sensor readings.
00058         // (which is done by updating 'ReadingTransform' property with the appropriate orientation)
00059     }
00060 }
00061
00062 /// <summary>
00063 /// Invoked when this page is about to be displayed in a Frame.
00064 /// </summary>
00065 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00066 /// property is typically used to configure the page.</param>
00067 void Scenario3_Porting::OnNavigatedTo(NavigationEventArgs^ e)
00068 {
00069     if (nullptr == gyrometerWP || nullptr == gyrometerWindows)
00070     {
00071         GetSampleButton->IsEnabled = false;
00072     }
00073     else
00074     {
00075         GetSampleButton->IsEnabled = true;
00076     }
00077 }
00078
00079 /// <summary>
00080 /// Invoked when this page is no longer displayed.
00081 /// </summary>
00082 /// <param name="e"></param>
00083 void Scenario3_Porting::OnNavigatedFrom(NavigationEventArgs^ e)
00084 {
00085     // If the navigation is external to the app do not clean up.
00086     // This can occur on Phone when suspending the app.
00087     if (NavigationMode::Forward == e->NavigationMode && nullptr == e->Uri)
00088     {
00089         return;
00090     }
00091 }
00092
00093
00094
00095 /// <summary>
00096 /// Invoked when 'Get Sample' button is pressed.
00097 /// </summary>
00098 /// <param name="sender"></param>
00099 /// <param name="e"></param>
00100 void Scenario3_Porting::GetGyrometerSample(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00101 {
00102     GyrometerReading^ wpReading;
00103     GyrometerReading^ windowsReading;
00104     GetSampleButton->IsEnabled = false;
00105
00106     // Establish the report interval
00107     gyrometerWP->ReportInterval = gyrometerWindows->MinimumReportInterval;
00108     gyrometerWindows->ReportInterval = gyrometerWindows->MinimumReportInterval;
00109
00110     wpReading = gyrometerWP->GetCurrentReading();
00111     windowsReading = gyrometerWindows->GetCurrentReading();
00112
00113     if (nullptr != wpReading)
00114     {
00115         ScenarioOutput_X_WP->Text = wpReading->AngularVelocityX.ToString();
00116         ScenarioOutput_Y_WP->Text = wpReading->AngularVelocityY.ToString();
00117         ScenarioOutput_Z_WP->Text = wpReading->AngularVelocityZ.ToString();
00118     }
00119
00120     if (nullptr != windowsReading)
00121     {
00122         ScenarioOutput_X_Windows->Text = windowsReading->AngularVelocityX.ToString();
00123         ScenarioOutput_Y_Windows->Text = windowsReading->AngularVelocityY.ToString();
00124         ScenarioOutput_Z_Windows->Text = windowsReading->AngularVelocityZ.ToString();
00125     }
00126
00127     gyrometerWP->ReportInterval = 0;
00128     gyrometerWindows->ReportInterval = 0;
00129
00130     GetSampleButton->IsEnabled = true;
00131 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ExtractTextSegments Member List

This is the complete list of members for Scenario1_ExtractTextSegments, including all inherited members.
rootPage | Scenario1_ExtractTextSegments | [private]
Scenario1_ExtractTextSegments() | Scenario1_ExtractTextSegments | [inline]
SelectionSegmentsButton_Click(object sender, RoutedEventArgs e) | Scenario1_ExtractTextSegments | [inline, private]
WordSegmentsButton_Click(object sender, RoutedEventArgs e) | Scenario1_ExtractTextSegments | [inline, private]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.h Source File

  • TouchKeyboard
  • cppwinrt

Scenario2_ShowHideEvents.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_ShowHideEvents.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     /// <summary>
00020     /// Sample page to subscribe show/hide event of Touch Keyboard.
00021     /// </summary>
00022     struct Scenario2_ShowHideEvents : Scenario2_ShowHideEventsT<Scenario2_ShowHideEvents>
00023     {
00024         Scenario2_ShowHideEvents();
00025
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00027         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00028
00029     private:
00030         event_token showingEventToken{};
00031         event_token hidingEventToken{};
00032
00033         void OnShowing(Windows::UI::ViewManagement::InputPane const& sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const& e);
00034         void OnHiding(Windows::UI::ViewManagement::InputPane const& sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const& e);
00035     };
00036 }
00037
00038 namespace winrt::SDKTemplate::factory_implementation
00039 {
00040     struct Scenario2_ShowHideEvents : Scenario2_ShowHideEventsT<Scenario2_ShowHideEvents, implementation::Scenario2_ShowHideEvents>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cppwinrt/SampleConfiguration.h Source File

  • ResizeAppView
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario4.xaml.cs Source File

  • SimpleInk
  • cs

Scenario4.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Globalization;
00015 using Windows.UI.Input.Inking;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019 using Windows.UI.Text.Core;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// This page shows the code to do ink recognition
00025     /// </summary>
00026     public sealed partial class Scenario4 : Page
00027     {
00028         private MainPage rootPage = MainPage.Current;
00029         InkRecognizerContainer inkRecognizerContainer = null;
00030         private IReadOnlyList<InkRecognizer> recoView = null;
00031         private Language previousInputLanguage = null;
00032         private CoreTextServicesManager textServiceManager = null;
00033
00034         public Scenario4()
00035         {
00036             this.InitializeComponent();
00037
00038             // Initialize drawing attributes. These are used in inking mode.
00039             InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
00040             drawingAttributes.Color = Windows.UI.Colors.Red;
00041             double penSize = 4;
00042             drawingAttributes.Size = new Windows.Foundation.Size(penSize, penSize);
00043             drawingAttributes.IgnorePressure = false;
00044             drawingAttributes.FitToCurve = true;
00045
00046             // Show the available recognizers
00047             inkRecognizerContainer = new InkRecognizerContainer();
00048             recoView = inkRecognizerContainer.GetRecognizers();
00049             if (recoView.Count > 0)
00050             {
00051                 foreach (InkRecognizer recognizer in recoView)
00052                 {
00053                     RecoName.Items.Add(recognizer.Name);
00054                 }
00055             }
00056             else
00057             {
00058                 RecoName.IsEnabled = false;
00059                 RecoName.Items.Add("No Recognizer Available");
00060             }
00061             RecoName.SelectedIndex = 0;
00062             // Set the text services so we can query when language changes
00063             textServiceManager = CoreTextServicesManager.GetForCurrentView();
00064             SetDefaultRecognizerByCurrentInputMethodLanguageTag();
00065
00066             // Initialize the InkCanvas
00067             inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
00068             inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch;
00069         }
00070
00071         protected override void OnNavigatedTo(NavigationEventArgs e)
00072         {
00073             // Registering handlers for InputLanguageChanged event
00074             textServiceManager.InputLanguageChanged += TextServiceManager_InputLanguageChanged;
00075         }
00076
00077         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00078         {
00079             InstallReco.IsOpen = false;
00080             textServiceManager.InputLanguageChanged -= TextServiceManager_InputLanguageChanged;
00081         }
00082
00083         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00084         {
00085             HelperFunctions.UpdateCanvasSize(RootGrid, Output, inkCanvas);
00086         }
00087
00088         void OnRecognizerChanged(object sender, RoutedEventArgs e)
00089         {
00090             string selectedValue = (string)RecoName.SelectedValue;
00091             SetRecognizerByName(selectedValue);
00092         }
00093
00094         async void OnRecognizeAsync(object sender, RoutedEventArgs e)
00095         {
00096             IReadOnlyList<InkStroke> currentStrokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
00097             if (currentStrokes.Count > 0)
00098             {
00099                 RecognizeBtn.IsEnabled = false;
00100                 ClearBtn.IsEnabled = false;
00101                 RecoName.IsEnabled = false;
00102
00103                 var recognitionResults = await inkRecognizerContainer.RecognizeAsync(inkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All);
00104
00105                 if (recognitionResults.Count > 0)
00106                 {
00107                     // Display recognition result
00108                     string str = "Recognition result:";
00109                     foreach (var r in recognitionResults)
00110                     {
00111                         str += " " + r.GetTextCandidates()[0];
00112                     }
00113                     rootPage.NotifyUser(str, NotifyType.StatusMessage);
00114                 }
00115                 else
00116                 {
00117                     rootPage.NotifyUser("No text recognized.", NotifyType.StatusMessage);
00118                 }
00119
00120                 RecognizeBtn.IsEnabled = true;
00121                 ClearBtn.IsEnabled = true;
00122                 RecoName.IsEnabled = true;
00123             }
00124             else
00125             {
00126                 rootPage.NotifyUser("Must first write something.", NotifyType.ErrorMessage);
00127             }
00128         }
00129
00130         void OnClear(object sender, RoutedEventArgs e)
00131         {
00132             inkCanvas.InkPresenter.StrokeContainer.Clear();
00133             rootPage.NotifyUser("Cleared Canvas.", NotifyType.StatusMessage);
00134         }
00135
00136         bool SetRecognizerByName(string recognizerName)
00137         {
00138             bool recognizerFound = false;
00139
00140             foreach (InkRecognizer reco in recoView)
00141             {
00142                 if (recognizerName == reco.Name)
00143                 {
00144                     inkRecognizerContainer.SetDefaultRecognizer(reco);
00145                     recognizerFound = true;
00146                     break;
00147                 }
00148             }
00149
00150             if (!recognizerFound && rootPage != null)
00151             {
00152                 rootPage.NotifyUser("Could not find target recognizer.", NotifyType.ErrorMessage);
00153             }
00154
00155             return recognizerFound;
00156         }
00157
00158         private void TextServiceManager_InputLanguageChanged(CoreTextServicesManager sender, object args)
00159         {
00160             SetDefaultRecognizerByCurrentInputMethodLanguageTag();
00161         }
00162
00163         private void SetDefaultRecognizerByCurrentInputMethodLanguageTag()
00164         {
00165             // Query recognizer name based on current input method language tag (bcp47 tag)
00166             Language currentInputLanguage = textServiceManager.InputLanguage;
00167
00168             if (currentInputLanguage != previousInputLanguage)
00169             {
00170                 // try query with the full BCP47 name
00171                 string recognizerName = RecognizerHelper.LanguageTagToRecognizerName(currentInputLanguage.LanguageTag);
00172
00173                 if (recognizerName != string.Empty)
00174                 {
00175                     for (int index = 0; index < recoView.Count; index++)
00176                     {
00177                         if (recoView[index].Name == recognizerName)
00178                         {
00179                             inkRecognizerContainer.SetDefaultRecognizer(recoView[index]);
00180                             RecoName.SelectedIndex = index;
00181                             previousInputLanguage = currentInputLanguage;
00182                             break;
00183                         }
00184                     }
00185                 }
00186             }
00187         }
00188
00189         private void RecoButton_Click(object sender, RoutedEventArgs e)
00190         {
00191             InstallReco.IsOpen = !InstallReco.IsOpen;
00192         }
00193     }
00194 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/RenderOptions.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

RenderOptions.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015
00016 namespace D2DAdvancedColorImages
00017 {
00018     /// <summary>
00019     /// Supported render effects which are inserted into the render pipeline.
00020     /// Includes HDR tonemappers and useful visual tools.
00021     /// Each render effect is implemented as a custom Direct2D effect.
00022     /// </summary>
00023     public enum class RenderEffectKind
00024     {
00025         ReinhardTonemap,
00026         FilmicTonemap,
00027         None,
00028         SdrOverlay,
00029         LuminanceHeatmap
00030     };
00031
00032     /// <summary>
00033     /// Associates a effect type used by the renderer to a descriptive string bound to UI.
00034     /// </summary>
00035     public ref class EffectOption sealed
00036     {
00037     public:
00038         EffectOption(Platform::String^ description, RenderEffectKind kind)
00039         {
00040             this->description = description;
00041             this->kind = kind;
00042         }
00043
00044         property Platform::String^ Description
00045         {
00046             Platform::String^ get() { return description; }
00047         }
00048
00049         property RenderEffectKind Kind
00050         {
00051             RenderEffectKind get() { return kind; }
00052         }
00053
00054     private:
00055         Platform::String^       description;
00056         RenderEffectKind        kind;
00057     };
00058
00059      /// <summary>
00060     /// Allows databinding of render options to the UI: image colorspace and render effect/tonemapper.
00061     /// </summary>
00062     public ref class RenderOptionsViewModel sealed
00063     {
00064     public:
00065         RenderOptionsViewModel()
00066         {
00067             // The first index is chosen by default. Ensure this is in sync with DirectXPage.
00068             renderEffects = ref new Platform::Collections::VectorView<EffectOption^>
00069             {
00070                 ref new EffectOption(L"ACES Filmic Tonemap", RenderEffectKind::FilmicTonemap),
00071                 ref new EffectOption(L"Reinhard Tonemap", RenderEffectKind::ReinhardTonemap),
00072                 ref new EffectOption(L"No effect", RenderEffectKind::None),
00073                 ref new EffectOption(L"Draw SDR as grayscale", RenderEffectKind::SdrOverlay),
00074                 ref new EffectOption(L"Draw luminance as heatmap", RenderEffectKind::LuminanceHeatmap)
00075             };
00076         }
00077
00078         property Windows::Foundation::Collections::IVectorView<EffectOption^>^ RenderEffects
00079         {
00080             Windows::Foundation::Collections::IVectorView<EffectOption^>^ get()
00081             {
00082                 return this->renderEffects;
00083             }
00084         }
00085
00086     private:
00087         Platform::Collections::VectorView<EffectOption^>^ renderEffects;
00088     };
00089 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SpatialControllerHandler.h Source File

  • SpatialInteractionSource
  • cpp

SpatialControllerHandler.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "SourceHandler.h"
00003
00004 namespace HolographicPaint
00005 {
00006     // Implements handling of interactions for Controllers
00007     class SpatialControllerHandler : public SourceHandler
00008     {
00009     public:
00010         SpatialControllerHandler(Windows::UI::Input::Spatial::SpatialInteractionSource^ source, ISourceCommandHandler* eventsHandler, std::shared_ptr<Whiteboard>& target);
00011         ~SpatialControllerHandler();
00012
00013         virtual void OnInteractionDetected(Windows::UI::Input::Spatial::SpatialInteraction^ interaction, Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem) override;
00014         virtual void OnSourceUpdated(Windows::UI::Input::Spatial::SpatialInteractionSourceState^ state, Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem) override;
00015         virtual void OnSourcePressed(Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args) override;
00016
00017         virtual Windows::Foundation::Numerics::float3 GetToolScale() const override;
00018
00019         void TryGetContinousBuzz(Windows::Devices::Haptics::SimpleHapticsController^ controller);
00020
00021     protected:
00022         bool m_insideTargetBoard = false;
00023         bool m_strokeInsideTargetBoard = false;
00024         bool m_waitForRelease = false;
00025
00026         std::shared_ptr<IDPadHelper> m_spDPadHelper;
00027         Windows::Devices::Haptics::SimpleHapticsController^ m_hapticsController;
00028         Windows::Devices::Haptics::SimpleHapticsControllerFeedback^ m_hapticsBuzzFeedback;
00029
00030         Windows::UI::Input::Spatial::SpatialGestureRecognizer^ m_gestureRecognizer;
00031         Windows::Foundation::EventRegistrationToken m_tappedToken;
00032
00033         void OnTapped(Windows::UI::Input::Spatial::SpatialGestureRecognizer ^sender, Windows::UI::Input::Spatial::SpatialTappedEventArgs ^args);
00034     };
00035
00036 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Helpers Member List

This is the complete list of members for Helpers, including all inherited members.
CreateFromHeadingPitchRoll(double heading, double pitch, double roll) | Helpers | [inline, static]
DegreetoRadians(double degree) | Helpers | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlaybackStateToButtonIconConverter Member List

This is the complete list of members for PlaybackStateToButtonIconConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | PlaybackStateToButtonIconConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | PlaybackStateToButtonIconConverter | [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Custom/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Custom

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Notifications.Helpers;
00002 using System;
00003 using Windows.Data.Xml.Dom;
00004 using Windows.UI.Notifications;
00005 using Windows.UI.Popups;
00006 using Windows.UI.StartScreen;
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009
00010 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00011
00012 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.Custom
00013 {
00014     /// <summary>
00015     /// An empty page that can be used on its own or navigated to within a Frame.
00016     /// </summary>
00017     public sealed partial class ScenarioElement : UserControl
00018     {
00019         public ScenarioElement()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         private async void ButtonUpdate_Click(object sender, RoutedEventArgs e)
00025         {
00026             try
00027             {
00028                 XmlDocument doc = new XmlDocument();
00029                 doc.LoadXml(TextBoxTilePayload.Text);
00030
00031                 Update("CustomSmall", doc);
00032                 Update("CustomMedium", doc);
00033                 Update("CustomWide", doc);
00034                 Update("CustomLarge", doc);
00035             }
00036
00037             catch (Exception ex)
00038             {
00039                 await new MessageDialog(ex.ToString(), "ERROR").ShowAsync();
00040             }
00041         }
00042
00043         private void Update(string tileId, XmlDocument doc)
00044         {
00045             if (SecondaryTile.Exists(tileId))
00046                 TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId).Update(new TileNotification(doc));
00047         }
00048
00049         private async void ButtonPin_Click(object sender, RoutedEventArgs e)
00050         {
00051             await TilesHelper.GenerateSecondaryTile("CustomSmall", "Small").RequestCreateAsync();
00052             await TilesHelper.GenerateSecondaryTile("CustomMedium", "Medium").RequestCreateAsync();
00053             await TilesHelper.GenerateSecondaryTile("CustomWide", "Wide").RequestCreateAsync();
00054             await TilesHelper.GenerateSecondaryTile("CustomLarge", "Large").RequestCreateAsync();
00055         }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Vector3< T > Member List

This is the complete list of members for Vector3< T >, including all inherited members.
b | Vector3< T > |
color | Vector3< T > |
coord | Vector3< T > |
g | Vector3< T > |
operator[](unsigned int index) | Vector3< T > | [inline]
operator[](unsigned int index) | Vector3< T > | [inline]
operator[](unsigned int index) | Vector3< T > | [inline]
r | Vector3< T > |
texcoord | Vector3< T > |
u | Vector3< T > |
v | Vector3< T > |
Vector3(T _x=0, T _y=0, T _z=0) | Vector3< T > | [inline]
Vector3(T _x=0, T _y=0, T _z=0) | Vector3< T > | [inline]
Vector3(T _x=0, T _y=0, T _z=0) | Vector3< T > | [inline]
w | Vector3< T > |
x | Vector3< T > |
y | Vector3< T > |
z | Vector3< T > |
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Binary Member List

This is the complete list of members for Scenario2_Binary, including all inherited members.
AppendOutputLine(string value) | Scenario2_Binary | [inline, private]
busy | Scenario2_Binary | [private]
CloseSocket() | Scenario2_Binary | [inline, private]
OnClosed(IWebSocket sender, WebSocketClosedEventArgs args) | Scenario2_Binary | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_Binary | [inline, protected]
OnServerCustomValidationRequested(StreamWebSocket sender, WebSocketServerCustomValidationRequestedEventArgs args) | Scenario2_Binary | [inline, private]
OnStart(object sender, RoutedEventArgs args) | Scenario2_Binary | [inline, private]
OnStop(object sender, RoutedEventArgs args) | Scenario2_Binary | [inline, private]
ReceiveDataAsync(StreamWebSocket activeSocket) | Scenario2_Binary | [inline, private]
rootPage | Scenario2_Binary | [private]
Scenario2_Binary() | Scenario2_Binary | [inline]
SendDataAsync(StreamWebSocket activeSocket) | Scenario2_Binary | [inline, private]
SetBusy(bool value) | Scenario2_Binary | [inline, private]
StartAsync() | Scenario2_Binary | [inline, private]
streamWebSocket | Scenario2_Binary | [private]
UpdateVisualState() | Scenario2_Binary | [inline, private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DecimalFormatting Member List

This is the complete list of members for Scenario2_DecimalFormatting, including all inherited members.
Display_Click(object sender, RoutedEventArgs e) | Scenario2_DecimalFormatting | [inline, private]
Scenario2_DecimalFormatting() | Scenario2_DecimalFormatting | [inline]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario6_DeleteTPM.h Source File

  • SmartCard
  • cppwinrt

Scenario6_DeleteTPM.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6_DeleteTPM.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario6_DeleteTPM : Scenario6_DeleteTPMT<Scenario6_DeleteTPM>
00019     {
00020         Scenario6_DeleteTPM();
00021
00022         fire_and_forget Delete_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage m_rootPage{ SDKTemplate::MainPage::Current() };
00026
00027         Windows::Devices::SmartCards::SmartCardReader m_reader{ nullptr };
00028         Windows::Devices::SmartCards::SmartCardReader::CardRemoved_revoker m_cardRemovedToken;
00029
00030         void HandleCardRemoved(Windows::Devices::SmartCards::SmartCardReader const& evtReader, Windows::Devices::SmartCards::CardRemovedEventArgs const&);
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario6_DeleteTPM : Scenario6_DeleteTPMT<Scenario6_DeleteTPM, implementation::Scenario6_DeleteTPM>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/WiFiDirectServicesManager.h Source File

  • WiFiDirectServices
  • cpp

WiFiDirectServicesManager.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include "WiFiDirectServicesWrappers.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     namespace WiFiDirectServices
00021     {
00022         ref class Scenario1;
00023         ref class Scenario2;
00024         ref class Scenario3;
00025         ref class Scenario4;
00026         ref class Scenario5;
00027
00028         /// <summary>
00029         /// Common class to wrap all of the services objects and state behind the UI
00030         /// </summary>
00031         public ref class WiFiDirectServiceManager sealed
00032         {
00033         private:
00034             MainPage^ _rootPage;
00035
00036             // UI Integration
00037             // Keep track of known UI frames and update them when we have any changes
00038             // NOTE: UI pages may not exist and the UI will need to update itself when it initializes
00039             Scenario1^ _scenario1 = nullptr;
00040             Scenario2^ _scenario2 = nullptr;
00041             Scenario3^ _scenario3 = nullptr;
00042             Scenario4^ _scenario4 = nullptr;
00043             Scenario5^ _scenario5 = nullptr;
00044
00045             // Keep list of all advertised services currently active
00046             Windows::Foundation::Collections::IVector<AdvertisementWrapper^>^ _advertisers = ref new Platform::Collections::Vector<AdvertisementWrapper^>();
00047
00048             // Keep track of all devices found during previous discovery
00049             Windows::Foundation::Collections::IVector<DiscoveredDeviceWrapper^>^ _discoveredDevices = ref new Platform::Collections::Vector<DiscoveredDeviceWrapper^>();
00050
00051             // Keep track of all sessions that are connected to this device
00052             // NOTE: it may make sense to track sessions per-advertiser and a second list for the seeker, but this sample keeps a global list
00053             Windows::Foundation::Collections::IVector<SessionWrapper^>^ _connectedSessions = ref new Platform::Collections::Vector<SessionWrapper^>();
00054
00055             // Keep track of the selected session for the UI
00056             // The UI will choose this session from the session list and use it for sending/receiving data
00057             int _selectedSession = -1;
00058
00059             // Singleton
00060             static WiFiDirectServiceManager^ _instance;
00061             WiFiDirectServiceManager();
00062
00063             std::mutex _managerMutex;
00064
00065         internal:
00066             // Singleton access
00067             static property WiFiDirectServiceManager^ Instance
00068             {
00069                 WiFiDirectServiceManager^ get();
00070             }
00071
00072             void NotifyUser(Platform::String^ strMessage, NotifyType type);
00073
00074             property MainPage^ RootPage
00075             {
00076                 MainPage^ get();
00077             }
00078
00079             property Scenario1^ CurrentScenario1
00080             {
00081                 Scenario1^ get() { return _scenario1; }
00082                 void set(Scenario1^ value) { _scenario1 = value; }
00083             }
00084
00085             property Scenario2^ CurrentScenario2
00086             {
00087                 Scenario2^ get() { return _scenario2; }
00088                 void set(Scenario2^ value) { _scenario2 = value; }
00089             }
00090
00091             property Scenario3^ CurrentScenario3
00092             {
00093                 Scenario3^ get() { return _scenario3; }
00094                 void set(Scenario3^ value) { _scenario3 = value; }
00095             }
00096
00097             property Scenario4^ CurrentScenario4
00098             {
00099                 Scenario4^ get() { return _scenario4; }
00100                 void set(Scenario4^ value) { _scenario4 = value; }
00101             }
00102
00103             property Scenario5^ CurrentScenario5
00104             {
00105                 Scenario5^ get() { return _scenario5; }
00106                 void set(Scenario5^ value) { _scenario5 = value; }
00107             }
00108
00109             property Windows::Foundation::Collections::IVector<AdvertisementWrapper^>^ Advertisers
00110             {
00111                 Windows::Foundation::Collections::IVector<AdvertisementWrapper^>^ get() { return _advertisers; }
00112             }
00113
00114             property SessionWrapper^ CurrentSession
00115             {
00116                 SessionWrapper^ get()
00117                 {
00118                     if (_selectedSession >= 0 &&
00119                         static_cast<unsigned int>(_selectedSession) < _connectedSessions->Size)
00120                     {
00121                         return _connectedSessions->GetAt(_selectedSession);
00122                     }
00123                     return nullptr;
00124                 }
00125             }
00126
00127             property Windows::Foundation::Collections::IVector<DiscoveredDeviceWrapper^>^ DiscoveredDevices
00128             {
00129                 Windows::Foundation::Collections::IVector<DiscoveredDeviceWrapper^>^ get() { return _discoveredDevices; }
00130             }
00131
00132             property Windows::Foundation::Collections::IVector<SessionWrapper^>^ ConnectedSessionList
00133             {
00134                 Windows::Foundation::Collections::IVector<SessionWrapper^>^ get() { return _connectedSessions; }
00135             }
00136
00137             void StartAdvertisement(
00138                 Platform::String^ serviceName,
00139                 bool autoAccept,
00140                 bool preferGO,
00141                 Platform::String^ pin,
00142                 Windows::Foundation::Collections::IVector<Windows::Devices::WiFiDirect::Services::WiFiDirectServiceConfigurationMethod>^ configMethods,
00143                 Windows::Devices::WiFiDirect::Services::WiFiDirectServiceStatus status,
00144                 unsigned int customStatus,
00145                 Platform::String^ serviceInfo,
00146                 Platform::String^ deferredServiceInfo,
00147                 Windows::Foundation::Collections::IVector<Platform::String^>^ prefixList
00148                 );
00149
00150             void UnpublishService(unsigned int index);
00151
00152             void DiscoverServicesAsync(
00153                 Platform::String^ serviceName,
00154                 Platform::String^ requestedServiceInfo = ""
00155                 );
00156
00157             void RemoveAdvertiser(AdvertisementWrapper^ advertiser);
00158
00159             void AddSessionRequest(
00160                 Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ request,
00161                 AdvertisementWrapper^ advertiser
00162                 );
00163
00164             void RemoveSessionRequest(
00165                 Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^ request,
00166                 AdvertisementWrapper^ advertiser
00167                 );
00168
00169             void AdvertiserStatusChanged(AdvertisementWrapper^ advertiser);
00170
00171             void AddSession(SessionWrapper^ session);
00172
00173             void RemoveSession(unsigned int index);
00174
00175             void RemoveSession(SessionWrapper^ session);
00176
00177             void CloseSession(unsigned int index);
00178
00179             void SelectSession(unsigned int index);
00180
00181             void AddSocket(SocketWrapper^ socket);
00182
00183         private:
00184             void AddAdvertiser(AdvertisementWrapper^ advertiser);
00185
00186             void RemoveAdvertiser(unsigned int index);
00187         };
00188     }
00189 }
Generated on Fri Nov 15 2024 22:22:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Content/RectRenderer.cpp Source File

  • LowLatencyInput
  • cpp
  • Content

RectRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "RectRenderer.h"
00014
00015 #include "..\Common\DirectXHelper.h"
00016 #include "..\Common\Constants.h"
00017
00018 using namespace SDKTemplate;
00019
00020 using namespace DirectX;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI::Input;
00024 using namespace Microsoft::WRL;
00025
00026 // Initialization.
00027 RectRenderer::RectRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00028     deviceResources(deviceResources),
00029     rect(),
00030     rectTransform()
00031 {
00032     CreateDeviceDependentResources();
00033
00034     //Initialize start position and rect size
00035     rectTransform = D2D1::Matrix3x2F::Identity();
00036     rectSize = bigRectSize;
00037 }
00038
00039 void RectRenderer::CreateDeviceDependentResources()
00040 {
00041     // Create a brush with which to draw the rect.
00042     DX::ThrowIfFailed(
00043         deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(
00044             D2D1::ColorF(D2D1::ColorF::LightSlateGray),
00045             &brush
00046             )
00047         );
00048 }
00049
00050 // Release all references to resources that depend on the graphics device.
00051 // This method is invoked when the device is lost and resources are no longer usable.
00052 void RectRenderer::ReleaseDeviceDependentResources()
00053 {
00054     brush.Reset();
00055 }
00056
00057 // Renders one frame.
00058 void RectRenderer::Render()
00059 {
00060     ComPtr<ID2D1DeviceContext1> deviceContext = deviceResources->GetD2DDeviceContext();
00061
00062     deviceContext->BeginDraw();
00063
00064     // Rotate the rendered scene based on the current orientation of the device and rotation of the rect
00065     deviceContext->SetTransform(rectTransform * deviceResources->GetOrientationTransform2D());
00066
00067     // Draw the rect at its current position.
00068     rect = D2D1::RectF(0, 0, rectSize, rectSize);
00069     deviceContext->FillRectangle(rect, brush.Get());
00070
00071     // Restore the transform to nothing.
00072     deviceContext->SetTransform(D2D1::Matrix3x2F::Identity());
00073
00074     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00075     // is lost. It will be handled during the next call to Present.
00076     HRESULT hr = deviceContext->EndDraw();
00077     if (hr != D2DERR_RECREATE_TARGET)
00078     {
00079         DX::ThrowIfFailed(hr);
00080     }
00081 }
00082
00083 // Update the rect transform based on input
00084 void RectRenderer::UpdateRectTransform(Point newPosition, Windows::UI::Input::ManipulationDelta delta)
00085 {
00086     D2D1_POINT_2F center = D2D1::Point2F(newPosition.X, newPosition.Y);
00087
00088     D2D1::Matrix3x2F deltaTransform =
00089         D2D1::Matrix3x2F::Scale(delta.Scale, delta.Scale, center) *
00090         D2D1::Matrix3x2F::Rotation(delta.Rotation, center) *
00091         D2D1::Matrix3x2F::Translation(delta.Translation.X, delta.Translation.Y);
00092
00093     rectTransform = rectTransform * deltaTransform;
00094 }
00095
00096 bool RectRenderer::HitTest(Point position)
00097 {
00098     D2D1::Matrix3x2F localInverseTransform = rectTransform;
00099     if (D2D1InvertMatrix(&localInverseTransform))
00100     {
00101         // "Untransform" (x, y) from parent coordinate system to object's initial principal axes coordinate system.
00102         D2D1_POINT_2F pt = localInverseTransform.TransformPoint(D2D1::Point2F(position.X, position.Y));
00103
00104         // Hit test point against rectangle
00105         D2D1_RECT_F rect = D2D1::RectF(0, 0, rectSize, rectSize);   //initial rectangle
00106         return (pt.x >= rect.left) && (pt.x <= rect.right) &&
00107                (pt.y >= rect.top)  && (pt.y <= rect.bottom);
00108     }
00109
00110     return false;
00111 }
00112
00113 void RectRenderer::SetRectSize(float newSize)
00114 {
00115     rectSize = newSize;
00116 }
00117
00118 void RectRenderer::ResetRect()
00119 {
00120     rectTransform = D2D1::Matrix3x2F::Identity() * D2D1::Matrix3x2F::Translation(0, 0);
00121 }
00122
00123 void RectRenderer::SetBrushColor(D2D1::ColorF color)
00124 {
00125     brush->SetColor(color);
00126 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cs/Scenario2_InAppPurchase.xaml.cs Source File

  • Store
  • cs

Scenario2_InAppPurchase.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Services.Store;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario2_InAppPurchase : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022         private StoreContext storeContext = StoreContext.GetDefault();
00023
00024         public Scenario2_InAppPurchase()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         private async void GetAssociatedProductsButton_Click(object sender, RoutedEventArgs e)
00030         {
00031             // Create a filtered list of the product AddOns I care about
00032             string[] filterList = new string[] { "Consumable", "Durable", "UnmanagedConsumable" };
00033
00034             // Get list of Add Ons this app can sell, filtering for the types we know about
00035             StoreProductQueryResult addOns = await storeContext.GetAssociatedStoreProductsAsync(filterList);
00036
00037             ProductsListView.ItemsSource = Utils.CreateProductListFromQueryResult(addOns, "Add-Ons");
00038         }
00039
00040         private async void PurchaseAddOnButton_Click(object sender, RoutedEventArgs e)
00041         {
00042             var item = (ItemDetails)ProductsListView.SelectedItem;
00043
00044             StorePurchaseResult result = await storeContext.RequestPurchaseAsync(item.StoreId);
00045             if (result.ExtendedError != null)
00046             {
00047                 Utils.ReportExtendedError(result.ExtendedError);
00048                 return;
00049             }
00050
00051             switch (result.Status)
00052             {
00053                 case StorePurchaseStatus.AlreadyPurchased:
00054                     rootPage.NotifyUser($"You already bought this AddOn.", NotifyType.ErrorMessage);
00055                     break;
00056
00057                 case StorePurchaseStatus.Succeeded:
00058                     rootPage.NotifyUser($"You bought {item.Title}.", NotifyType.StatusMessage);
00059                     break;
00060
00061                 case StorePurchaseStatus.NotPurchased:
00062                     rootPage.NotifyUser("Product was not purchased, it may have been canceled.", NotifyType.ErrorMessage);
00063                     break;
00064
00065                 case StorePurchaseStatus.NetworkError:
00066                     rootPage.NotifyUser("Product was not purchased due to a network error.", NotifyType.ErrorMessage);
00067                     break;
00068
00069                 case StorePurchaseStatus.ServerError:
00070                     rootPage.NotifyUser("Product was not purchased due to a server error.", NotifyType.ErrorMessage);
00071                     break;
00072
00073                 default:
00074                     rootPage.NotifyUser("Product was not purchased due to an unknown error.", NotifyType.ErrorMessage);
00075                     break;
00076             }
00077         }
00078     }
00079 }
Generated on Fri Nov 15 2024 22:21:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_RequestConsent Member List

This is the complete list of members for Scenario2_RequestConsent, including all inherited members.
RequestConsent_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_RequestConsent
Scenario2_RequestConsent() | Scenario2_RequestConsent
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/SampleConfiguration.cpp Source File

  • CashDrawer
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace SDKTemplate;
00020 using namespace Windows::Devices::PointOfService;
00021 using namespace Windows::Foundation;
00022
00023 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00024 {
00025     { "Drawer Claim and Open", "SDKTemplate.Scenario1_OpenDrawer" },
00026     { "Wait for Drawer Close", "SDKTemplate.Scenario2_CloseDrawer" },
00027     { "Drawer Retain", "SDKTemplate.Scenario3_MultipleDrawers" }
00028 };
00029
00030 task<CashDrawer^> DeviceHelpers::GetFirstCashDrawerAsync(PosConnectionTypes connectionTypes)
00031 {
00032     return DeviceHelpers::GetFirstDeviceAsync(CashDrawer::GetDeviceSelector(connectionTypes),
00033         [](String^ id) { return create_task(CashDrawer::FromIdAsync(id)); });
00034 }
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario2_MultiFile.xaml.cpp Source File

  • FilePicker
  • cpp

Scenario2_MultiFile.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2.xaml.cpp
00014 // Implementation of the Scenario2 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_MultiFile.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Storage;
00026 using namespace Windows::Storage::Pickers;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 Scenario2_MultiFile::Scenario2_MultiFile()
00032 {
00033     InitializeComponent();
00034     rootPage = MainPage::Current;
00035 }
00036
00037 void Scenario2_MultiFile::PickFilesButton_Click(Object^ sender, RoutedEventArgs^ e)
00038 {
00039     // Clear any previously returned files between iterations of this scenario
00040     OutputTextBlock->Text = "";
00041
00042     FileOpenPicker^ openPicker = ref new FileOpenPicker();
00043     openPicker->ViewMode = PickerViewMode::List;
00044     openPicker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
00045     openPicker->FileTypeFilter->Append("*");
00046
00047     create_task(openPicker->PickMultipleFilesAsync()).then([this](IVectorView<StorageFile^>^ files)
00048     {
00049         if (files->Size > 0)
00050         {
00051             String^ output = "Picked files:\n";
00052             std::for_each(begin(files), end(files), [this, &output](StorageFile ^file)
00053             {
00054                 output += file->Name + "\n";
00055             });
00056             OutputTextBlock->Text = output;
00057         }
00058         else
00059         {
00060             OutputTextBlock->Text = "Operation cancelled.";
00061         }
00062     });
00063 }
Generated on Fri Nov 15 2024 22:19:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ShowConnection.xaml.cs Source File

  • MobileBroadband
  • cs

ShowConnection.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Networking.NetworkOperators;
00018 using System.Collections.Generic;
00019
00020 namespace MobileBroadband
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class ShowConnection : Page
00026     {
00027         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00028         // as NotifyUser()
00029         MainPage rootPage = MainPage.Current;
00030
00031         private IReadOnlyList<string> deviceAccountId = null;
00032
00033         public ShowConnection()
00034         {
00035             this.InitializeComponent();
00036         }
00037
00038         /// <summary>
00039         /// Invoked when this page is about to be displayed in a Frame.
00040         /// </summary>
00041         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00042         /// property is typically used to configure the page.</param>
00043         protected override void OnNavigatedTo(NavigationEventArgs e)
00044         {
00045             PrepareScenario();
00046         }
00047
00048
00049         /// <summary>
00050         /// This is the click handler for the 'Default' button.  You would replace this with your own handler
00051         /// if you have a button or buttons on this page.
00052         /// </summary>
00053         /// <param name="sender"></param>
00054         /// <param name="e"></param>
00055         private void ShowConnectionUI_Click(object sender, RoutedEventArgs e)
00056         {
00057             Button b = sender as Button;
00058             if (b != null)
00059             {
00060                 try
00061                 {
00062                     var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(deviceAccountId[0]);
00063                     mobileBroadbandAccount.CurrentNetwork.ShowConnectionUI();
00064                 }
00065                 catch (Exception ex)
00066                 {
00067                     rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00068                 }
00069             }
00070         }
00071
00072
00073         void PrepareScenario()
00074         {
00075             rootPage.NotifyUser("", NotifyType.StatusMessage);
00076
00077             try
00078             {
00079                 deviceAccountId = MobileBroadbandAccount.AvailableNetworkAccountIds;
00080
00081                 if (deviceAccountId.Count != 0)
00082                 {
00083                     ShowConnectionUI.Content = "Show Connection UI";
00084                     ShowConnectionUI.IsEnabled = true;
00085                 }
00086                 else
00087                 {
00088                     ShowConnectionUI.Content = "No available accounts detected";
00089                     ShowConnectionUI.IsEnabled = false;
00090                 }
00091             }
00092             catch (Exception ex)
00093             {
00094                 rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00095             }
00096         }
00097
00098     }
00099 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Polling Member List

This is the complete list of members for Scenario2_Polling, including all inherited members.
GetData(object sender, object args) | Scenario2_Polling | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Polling | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario2_Polling | [inline, protected]
RootPage | Scenario2_Polling | [private]
Scenario2_Polling() | Scenario2_Polling | [inline]
Sensor | Scenario2_Polling | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_DataEvents Member List

This is the complete list of members for Scenario1_DataEvents, including all inherited members.
_accelerometer | Scenario1_DataEvents | [private]
_compass | Scenario1_DataEvents | [private]
_desiredReportInterval | Scenario1_DataEvents | [private]
_magnetometer | Scenario1_DataEvents | [private]
_sensor | Scenario1_DataEvents | [private]
desiredReportIntervalMs | Scenario1_DataEvents | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
ReadingChanged(object sender, AccelerometerReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(object sender, AltimeterReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(object sender, BarometerReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(object sender, CompassReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(object sender, MagnetometerReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(object sender, OrientationSensorReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
ReadingChanged(HumanPresenceSensor sender, HumanPresenceSensorReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
rootPage | Scenario1_DataEvents | [private]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
ScenarioDisable() | Scenario1_DataEvents | [inline, private]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioDisable() | Scenario1_DataEvents | [inline, private]
ScenarioEnable() | Scenario1_DataEvents | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioEnable() | Scenario1_DataEvents | [inline, private]
ScenarioGetSensor_Click(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
sensor | Scenario1_DataEvents | [private]
sensor | Scenario1_DataEvents | [private]
sensor | Scenario1_DataEvents | [private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/SimCard.xaml.cs Source File

  • MobileBroadband
  • cs

SimCard.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using System.Linq;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Text;
00018 using Windows.Foundation;
00019 using Windows.Foundation.Collections;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Controls.Primitives;
00023 using Windows.UI.Xaml.Data;
00024 using Windows.UI.Xaml.Input;
00025 using Windows.UI.Xaml.Media;
00026 using Windows.UI.Xaml.Navigation;
00027 using Windows.Networking.NetworkOperators;
00028 using Windows.Networking.Connectivity;
00029 using SDKTemplate;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 namespace MobileBroadband
00034 {
00035     /// <summary>
00036     /// An empty page that can be used on its own or navigated to within a Frame.
00037     /// </summary>
00038     public sealed partial class SimCard : Page
00039     {
00040         MainPage rootPage = MainPage.Current;
00041         MobileBroadbandUiccApp currentUiccApp = null;
00042
00043         public SimCard()
00044         {
00045             this.InitializeComponent();
00046         }
00047
00048         private async void btnGetUICC_Click(object sender, RoutedEventArgs e)
00049         {
00050             try
00051             {
00052                 var modem = MobileBroadbandModem.GetDefault();
00053                 MobileBroadbandModemConfiguration modemCfg = await modem.GetCurrentConfigurationAsync();
00054                 MobileBroadbandUicc uicc = modemCfg.Uicc;
00055                 if (uicc != null)
00056                 {
00057                     StringBuilder sb = new StringBuilder();
00058                     sb.AppendLine("SIM Card ICCID:" + uicc.SimIccId);
00059
00060
00061                     MobileBroadbandUiccAppsResult appsResult = await uicc.GetUiccAppsAsync();
00062                     System.Collections.ObjectModel.ObservableCollection<object> AppList = new System.Collections.ObjectModel.ObservableCollection<object>();
00063                     foreach (var uiccApp in appsResult.UiccApps)
00064                     {
00065                         ListBoxItem item = new ListBoxItem();
00066                         item.Name = uiccApp.Kind.ToString();
00067                         item.Content = uiccApp;
00068                         AppList.Add(item);
00069                     }
00070
00071                     listUiccApps.ItemsSource = AppList;
00072                     if (AppList.Count > 0)
00073                     {
00074                         listUiccApps.SelectedIndex = 0;
00075                     }
00076                     else
00077                     {
00078                         sb.AppendLine("No UICC app found.");
00079                     }
00080
00081                     txtUICCInformation.Text = sb.ToString();
00082                 }
00083             }
00084             catch (Exception ex)
00085             {
00086                 rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00087             }
00088         }
00089
00090         private void listUiccApps_SelectionChanged(object sender, SelectionChangedEventArgs e)
00091         {
00092             if (null != listUiccApps.SelectedItem)
00093             {
00094                 ListBoxItem item = listUiccApps.SelectedItem as ListBoxItem;
00095                 currentUiccApp = (MobileBroadbandUiccApp)item.Content;
00096                 btnGetRecord.IsEnabled = true;
00097                 byte[] appIdByteBuffer = currentUiccApp.Id.ToArray();
00098                 StringBuilder sb = new StringBuilder();
00099                 sb.AppendLine("AppId:");
00100                 foreach(var v in appIdByteBuffer)
00101                 {
00102                     sb.Append(v.ToString("X") + ", ");
00103                 }
00104                 txtUICCAppId.Text = sb.ToString();
00105
00106             }
00107             else
00108             {
00109                 btnGetRecord.IsEnabled = false;
00110             }
00111
00112             labelRecordInformation.Text = "";
00113         }
00114
00115         private async void btnGetRecord_Click(object sender, RoutedEventArgs e)
00116         {
00117             List<uint> iccidFilePath = new List<uint>{ 0x3F00, 0x2FE2}; // The wellknown file path for IccId
00118             MobileBroadbandUiccAppRecordDetailsResult recordDetails = await currentUiccApp.GetRecordDetailsAsync(iccidFilePath);
00119             StringBuilder sb = new StringBuilder();
00120             sb.AppendLine("Record Details");
00121             sb.AppendLine("Record Type:" + recordDetails.Kind.ToString());
00122             sb.AppendLine("Record Size:" + recordDetails.RecordSize.ToString());
00123             sb.AppendLine("Read result:");
00124
00125             MobileBroadbandUiccAppReadRecordResult readRecord = await currentUiccApp.ReadRecordAsync(iccidFilePath, 1);
00126             sb.AppendLine(readRecord.Status.ToString());
00127
00128             if (readRecord.Status == MobileBroadbandUiccAppOperationStatus.Success)
00129             {
00130                 sb.AppendLine("IccId record content:");
00131                 byte[] iccidByteArray = readRecord.Data.ToArray();
00132                 foreach (var v in iccidByteArray)
00133                 {
00134                     sb.Append(v.ToString("X") + ", ");
00135                 }
00136             }
00137
00138             labelRecordInformation.Text = sb.ToString();
00139         }
00140     }
00141 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6 Member List

This is the complete list of members for Scenario6, including all inherited members.
Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario6 | [inline, private]
Scenario6() | Scenario6 | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/SampleConfiguration.cpp Source File

  • Geolocation
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel::Background;
00019 using namespace winrt::Windows::Data::Json;
00020 using namespace winrt::Windows::Devices::Geolocation;
00021 using namespace winrt::Windows::Devices::Geolocation::Geofencing;
00022 using namespace winrt::Windows::Foundation;
00023 using namespace winrt::Windows::Foundation::Collections;
00024 using namespace winrt::Windows::Globalization::DateTimeFormatting;
00025 using namespace winrt::Windows::UI::Xaml::Controls;
00026 using namespace winrt::SDKTemplate;
00027
00028 hstring implementation::MainPage::FEATURE_NAME()
00029 {
00030     return L"Geolocation C++/WinRT Sample";
00031 }
00032
00033 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00034 {
00035     Scenario{ L"Track position", xaml_typename<SDKTemplate::Scenario1_TrackPosition>() },
00036     Scenario{ L"Get position", xaml_typename<SDKTemplate::Scenario2_GetPosition>() },
00037     Scenario{ L"Background position", xaml_typename<SDKTemplate::Scenario3_BackgroundTask>() },
00038     Scenario{ L"Foreground geofencing", xaml_typename<SDKTemplate::Scenario4_ForegroundGeofence>() },
00039     Scenario{ L"Background geofencing", xaml_typename<SDKTemplate::Scenario5_GeofenceBackgroundTask>() },
00040     Scenario{ L"Get last visit", xaml_typename<SDKTemplate::Scenario6_GetLastVisit>() },
00041     Scenario{ L"Foreground visit monitoring", xaml_typename<SDKTemplate::Scenario7_ForegroundVisits>() },
00042     Scenario{ L"Background visit monitoring", xaml_typename<SDKTemplate::Scenario8_VisitsBackgroundTask>() },
00043 });
00044
00045 // Utility function to convert as much of a string as possible to a uint32_t and detect bad input
00046 wchar_t* SDKTemplate::TryParseUIntPrefix(const wchar_t* str, uint32_t& result)
00047 {
00048     wchar_t* end;
00049     errno = 0;
00050     result = std::wcstoul(str, &end, 0);
00051
00052     if (str == end)
00053     {
00054         // Not parseable.
00055         return nullptr;
00056     }
00057
00058     if (errno == ERANGE)
00059     {
00060         // Out of range.
00061         return nullptr;
00062     }
00063
00064     return end;
00065 }
00066
00067 // Utility function to convert a string to a uint32_t and detect bad input
00068 bool SDKTemplate::TryParseUInt(const wchar_t* str, uint32_t& result)
00069 {
00070     wchar_t* end = TryParseUIntPrefix(str, result);
00071     if (!end || *end != L'\0')
00072     {
00073         result = 0;
00074         return false;
00075     }
00076
00077     return true;
00078 }
00079 // Utility function to convert a string to a double and detect bad input
00080 bool SDKTemplate::TryParseDouble(const wchar_t* str, double& result)
00081 {
00082     wchar_t* end;
00083     errno = 0;
00084     result = std::wcstod(str, &end);
00085
00086     if (str == end)
00087     {
00088         // Not parseable.
00089         return false;
00090     }
00091
00092     if (errno == ERANGE)
00093     {
00094         // Out of range.
00095         result = 0;
00096         return false;
00097     }
00098
00099     if (*end != L'\0')
00100     {
00101         // Extra unparseable characters at the end.
00102         result = 0;
00103         return false;
00104     }
00105
00106     // Disallow infinity and NaN.
00107     if (!std::isfinite(result))
00108     {
00109         return false;
00110     }
00111
00112     return true;
00113 }
00114
00115 // Look up a background task by name.
00116 // If found, then also report whether the user has granted background execution access.
00117 IBackgroundTaskRegistration SDKTemplate::LookupBackgroundTask(hstring const& name)
00118 {
00119     IBackgroundTaskRegistration found;
00120     // Loop through all background tasks to find one with the matching name
00121     for (auto [taskGuid, task] : BackgroundTaskRegistration::AllTasks())
00122     {
00123         if (task.Name() == name)
00124         {
00125             found = task;
00126             break;
00127         }
00128     }
00129
00130     if (found != nullptr)
00131     {
00132         // Check whether the user has already granted background execution access.
00133         BackgroundAccessStatus backgroundAccessStatus = BackgroundExecutionManager::GetAccessStatus();
00134
00135         SDKTemplate::MainPage rootPage = SDKTemplate::MainPage::Current();
00136
00137         switch (backgroundAccessStatus)
00138         {
00139         case BackgroundAccessStatus::AlwaysAllowed:
00140         case BackgroundAccessStatus::AllowedSubjectToSystemPolicy:
00141             rootPage.NotifyUser(L"Background task is already registered. Waiting for next update...", NotifyType::StatusMessage);
00142             break;
00143
00144         default:
00145             rootPage.NotifyUser(L"Background tasks may be disabled for this app", NotifyType::ErrorMessage);
00146             break;
00147         }
00148     }
00149
00150     return found;
00151 }
00152
00153 // Check and report whether the user has granted background execution access.
00154 // If so, then also request location access so that the background task can do its work.
00155 fire_and_forget SDKTemplate::CheckBackgroundAndRequestLocationAccess()
00156 {
00157     // Get permission for a background task from the user. If the user has already answered once,
00158     // this does nothing and the user must manually update their preference via Settings.
00159     BackgroundAccessStatus backgroundAccessStatus = co_await BackgroundExecutionManager::RequestAccessAsync();
00160
00161     SDKTemplate::MainPage rootPage = SDKTemplate::MainPage::Current();
00162
00163     switch (backgroundAccessStatus)
00164     {
00165     case BackgroundAccessStatus::AlwaysAllowed:
00166     case BackgroundAccessStatus::AllowedSubjectToSystemPolicy:
00167         // BackgroundTask is allowed
00168         rootPage.NotifyUser(L"Background task registered.", NotifyType::StatusMessage);
00169
00170         // Need to request access to location.
00171         // This must be done when we create the background task registration
00172         // because the background task cannot display UI.
00173         // If the user has already answered once,
00174         // this does nothing and the user must manually update their preference via Settings.
00175         switch (co_await Geolocator::RequestAccessAsync())
00176         {
00177         case GeolocationAccessStatus::Allowed:
00178             break;
00179
00180         case GeolocationAccessStatus::Denied:
00181             rootPage.NotifyUser(L"Access to location is denied.", NotifyType::ErrorMessage);
00182             break;
00183
00184         case GeolocationAccessStatus::Unspecified:
00185             rootPage.NotifyUser(L"Unspecified error!", NotifyType::ErrorMessage);
00186             break;
00187         }
00188         break;
00189
00190     default:
00191         rootPage.NotifyUser(L"Background tasks may be disabled for this app", NotifyType::ErrorMessage);
00192         break;
00193     }
00194 }
00195
00196 void SDKTemplate::FillItemsFromSavedJson(ItemsControl const& control, hstring const& key)
00197 {
00198     auto values = Windows::Storage::ApplicationData::Current().LocalSettings().Values();
00199     hstring json = values.TryLookup(key).try_as<hstring>().value_or(L"");
00200     if (!json.empty())
00201     {
00202         // remove all entries and repopulate
00203         IVector<IInspectable> items = control.Items();
00204         items.Clear();
00205
00206         for (IJsonValue element : JsonValue::Parse(json).GetArray())
00207         {
00208             items.Append(box_value(element.GetString()));
00209         }
00210     }
00211 }
00212
00213 void SDKTemplate::ReportSavedStatus()
00214 {
00215     auto values = Windows::Storage::ApplicationData::Current().LocalSettings().Values();
00216     hstring status = values.TryLookup(L"Status").try_as<hstring>().value_or(L"");
00217     if (!status.empty())
00218     {
00219         SDKTemplate::MainPage::Current().NotifyUser(status, NotifyType::StatusMessage);
00220     }
00221 }
00222
00223 // Extract a message for the current exception.
00224 hstring SDKTemplate::to_message()
00225 {
00226     try
00227     {
00228         throw;
00229     }
00230     catch (hresult_error const& e)
00231     {
00232         return e.message();
00233     }
00234     catch (std::exception const& ex)
00235     {
00236         return winrt::to_hstring(ex.what());
00237     }
00238     catch (...)
00239     {
00240         std::terminate();
00241     }
00242 }
00243
00244 hstring SDKTemplate::FormatDateTime(DateTime value, hstring const& format)
00245 {
00246     return DateTimeFormatter(format).Format(value);
00247 }
00248
00249 hstring winrt::to_hstring(IReference<double> const& value)
00250 {
00251     return value ? to_hstring(value.Value()) : L"N/A";
00252 }
00253
00254 hstring winrt::to_hstring(TimeSpan value)
00255 {
00256     uint32_t days = static_cast<uint32_t>(value / std::chrono::hours(24));
00257     value = value % std::chrono::hours(24);
00258     uint32_t hours = static_cast<uint32_t>(value / std::chrono::hours(1));
00259     value = value % std::chrono::hours(1);
00260     uint32_t minutes = static_cast<uint32_t>(value / std::chrono::minutes(1));
00261     value = value % std::chrono::minutes(1);
00262     uint32_t seconds = static_cast<uint32_t>(value / std::chrono::seconds(1));
00263
00264     return to_hstring(days) + L":" + to_hstring(hours) + L":" + to_hstring(minutes) + L":" + to_hstring(seconds);
00265 }
00266
00267 hstring winrt::to_hstring(PositionSource value)
00268 {
00269     switch (value)
00270     {
00271     case PositionSource::Cellular:
00272         return L"Cellular";
00273     case PositionSource::Satellite:
00274         return L"Satellite";
00275     case PositionSource::WiFi:
00276         return L"WiFi";
00277     case PositionSource::IPAddress:
00278         return L"IPAddress";
00279     case PositionSource::Unknown:
00280         return L"Unknown";
00281     case PositionSource::Default:
00282         return L"Default";
00283     case PositionSource::Obfuscated:
00284         return L"Obfuscated";
00285     }
00286     return to_hstring(static_cast<uint32_t>(value));
00287 }
00288
00289 hstring winrt::to_hstring(VisitStateChange value)
00290 {
00291     switch (value)
00292     {
00293     case VisitStateChange::TrackingLost:
00294         return L"TrackingLost";
00295     case VisitStateChange::Arrived:
00296         return L"Arrived";
00297     case VisitStateChange::Departed:
00298         return L"Departed";
00299     case VisitStateChange::OtherMovement:
00300         return L"OtherMovement";
00301     }
00302     return to_hstring(static_cast<uint32_t>(value));
00303 }
00304
00305 hstring winrt::to_hstring(GeofenceState value)
00306 {
00307     if (value == GeofenceState::None)
00308     {
00309         return L"None";
00310     }
00311
00312     std::wstring result;
00313
00314     if ((value & GeofenceState::Entered) == GeofenceState::Entered)
00315     {
00316         value &= ~GeofenceState::Entered;
00317         result.append(L" | Entered");
00318     }
00319     if ((value & GeofenceState::Exited) == GeofenceState::Exited)
00320     {
00321         value &= ~GeofenceState::Exited;
00322         result.append(L" | Exited");
00323     }
00324     if ((value & GeofenceState::Removed) == GeofenceState::Removed)
00325     {
00326         value &= ~GeofenceState::Removed;
00327         result.append(L" | Removed");
00328     }
00329     if (value != GeofenceState::None)
00330     {
00331         result.append(L" | ");
00332         result.append(std::to_wstring(static_cast<uint32_t>(value)));
00333     }
00334
00335     return hstring{ result.substr(3) };
00336 }
00337
00338 hstring winrt::to_hstring(GeofenceMonitorStatus value)
00339 {
00340     switch (value)
00341     {
00342     case GeofenceMonitorStatus::Ready:
00343         return L"Ready";
00344     case GeofenceMonitorStatus::Initializing:
00345         return L"Initializing";
00346     case GeofenceMonitorStatus::NoData:
00347         return L"NoData";
00348     case GeofenceMonitorStatus::Disabled:
00349         return L"Disabled";
00350     case GeofenceMonitorStatus::NotInitialized:
00351         return L"NotInitialized";
00352     case GeofenceMonitorStatus::NotAvailable:
00353         return L"NotAvailable";
00354     }
00355     return to_hstring(static_cast<uint32_t>(value));
00356 }
00357
00358 hstring winrt::to_hstring(GeofenceRemovalReason value)
00359 {
00360     switch (value)
00361     {
00362     case GeofenceRemovalReason::Used:
00363         return L"Used";
00364     case GeofenceRemovalReason::Expired:
00365         return L"Expired";
00366     }
00367     return to_hstring(static_cast<uint32_t>(value));
00368 }
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Speech and TTS";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicSuspension/cs/Common/NavigationHelper.cs Source File

  • BasicSuspension
  • cs
  • Common

NavigationHelper.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using System.Windows.Input;
00007 using Windows.System;
00008 using Windows.UI.Core;
00009 using Windows.UI.Xaml;
00010 using Windows.UI.Xaml.Controls;
00011 using Windows.UI.Xaml.Navigation;
00012
00013 namespace SDKTemplate.Common
00014 {
00015     /// <summary>
00016     /// NavigationHelper aids in navigation between pages. It manages
00017     /// the backstack and integrates SuspensionManager to handle process
00018     /// lifetime management and state management when navigating between pages.
00019     /// </summary>
00020     /// <example>
00021     /// To make use of NavigationHelper, follow these two steps or
00022     /// start with a BasicPage or any other Page item template other than BlankPage.
00023     ///
00024     /// 1) Create an instance of the NavigationHelper somewhere such as in the
00025     ///     constructor for the page and register a callback for the LoadState and
00026     ///     SaveState events.
00027     /// <code>
00028     ///     public MyPage()
00029     ///     {
00030     ///         this.InitializeComponent();
00031     ///         this.navigationHelper = new NavigationHelper(this);
00032     ///         this.navigationHelper.LoadState += navigationHelper_LoadState;
00033     ///         this.navigationHelper.SaveState += navigationHelper_SaveState;
00034     ///     }
00035     ///
00036     ///     private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
00037     ///     { }
00038     ///     private void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
00039     ///     { }
00040     /// </code>
00041     ///
00042     /// 2) Register the page to call into the NavigationManager whenever the page participates
00043     ///     in navigation by overriding the <see cref="Windows.UI.Xaml.Controls.Page.OnNavigatedTo"/>
00044     ///     and <see cref="Windows.UI.Xaml.Controls.Page.OnNavigatedFrom"/> events.
00045     /// <code>
00046     ///     protected override void OnNavigatedTo(NavigationEventArgs e)
00047     ///     {
00048     ///         navigationHelper.OnNavigatedTo(e);
00049     ///     }
00050     ///
00051     ///     protected override void OnNavigatedFrom(NavigationEventArgs e)
00052     ///     {
00053     ///         navigationHelper.OnNavigatedFrom(e);
00054     ///     }
00055     /// </code>
00056     /// </example>
00057     [Windows.Foundation.Metadata.WebHostHidden]
00058     public class NavigationHelper : DependencyObject
00059     {
00060         private Page Page { get; set; }
00061         private Frame Frame { get { return this.Page.Frame; } }
00062
00063         /// <summary>
00064         /// Initializes a new instance of the <see cref="NavigationHelper"/> class.
00065         /// </summary>
00066         /// <param name="page">A reference to the current page used for navigation.
00067         /// This reference allows for frame manipulation.</param>
00068         public NavigationHelper(Page page)
00069         {
00070             this.Page = page;
00071         }
00072
00073         #region Process lifetime management
00074
00075         private String _pageKey;
00076
00077         /// <summary>
00078         /// Handle this event to populate the page using content passed
00079         /// during navigation as well as any state that was saved by
00080         /// the SaveState event handler.
00081         /// </summary>
00082         public event LoadStateEventHandler LoadState;
00083         /// <summary>
00084         /// Handle this event to save state that can be used by
00085         /// the LoadState event handler. Save the state in case
00086         /// the application is suspended or the page is discarded
00087         /// from the navigation cache.
00088         /// </summary>
00089         public event SaveStateEventHandler SaveState;
00090
00091         /// <summary>
00092         /// Invoked when this page is about to be displayed in a Frame.
00093         /// This method calls <see cref="LoadState"/>, where all page specific
00094         /// navigation and process lifetime management logic should be placed.
00095         /// </summary>
00096         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00097         /// property provides the group to be displayed.</param>
00098         public void OnNavigatedTo(NavigationEventArgs e)
00099         {
00100             var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
00101             this._pageKey = "Page-" + this.Frame.BackStackDepth;
00102
00103             if (e.NavigationMode == NavigationMode.New)
00104             {
00105                 // Clear existing state for forward navigation when adding a new page to the
00106                 // navigation stack
00107                 var nextPageKey = this._pageKey;
00108                 int nextPageIndex = this.Frame.BackStackDepth;
00109                 while (frameState.Remove(nextPageKey))
00110                 {
00111                     nextPageIndex++;
00112                     nextPageKey = "Page-" + nextPageIndex;
00113                 }
00114
00115                 // Pass the navigation parameter to the new page
00116                 if (this.LoadState != null)
00117                 {
00118                     this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
00119                 }
00120             }
00121             else
00122             {
00123                 // Pass the navigation parameter and preserved page state to the page, using
00124                 // the same strategy for loading suspended state and recreating pages discarded
00125                 // from cache
00126                 if (this.LoadState != null)
00127                 {
00128                     this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary<String, Object>)frameState[this._pageKey]));
00129                 }
00130             }
00131         }
00132
00133         /// <summary>
00134         /// Invoked when this page will no longer be displayed in a Frame.
00135         /// This method calls <see cref="SaveState"/>, where all page specific
00136         /// navigation and process lifetime management logic should be placed.
00137         /// </summary>
00138         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00139         /// property provides the group to be displayed.</param>
00140         public void OnNavigatedFrom(NavigationEventArgs e)
00141         {
00142             var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
00143             var pageState = new Dictionary<String, Object>();
00144             if (this.SaveState != null)
00145             {
00146                 this.SaveState(this, new SaveStateEventArgs(pageState));
00147             }
00148             frameState[_pageKey] = pageState;
00149         }
00150
00151         #endregion
00152     }
00153
00154     /// <summary>
00155     /// RootFrameNavigationHelper registers for standard mouse and keyboard
00156     /// shortcuts used to go back and forward. There should be only one
00157     /// RootFrameNavigationHelper per view, and it should be associated with the
00158     /// root frame.
00159     /// </summary>
00160     /// <example>
00161     /// To make use of RootFrameNavigationHelper, create an instance of the
00162     /// RootNavigationHelper such as in the constructor of your root page.
00163     /// <code>
00164     ///     public MyRootPage()
00165     ///     {
00166     ///         this.InitializeComponent();
00167     ///         this.rootNavigationHelper = new RootNavigationHelper(MyFrame);
00168     ///     }
00169     /// </code>
00170     /// </example>
00171     [Windows.Foundation.Metadata.WebHostHidden]
00172     public class RootFrameNavigationHelper
00173     {
00174         private Frame Frame { get; set; }
00175         SystemNavigationManager systemNavigationManager;
00176
00177         /// <summary>
00178         /// Initializes a new instance of the <see cref="RootNavigationHelper"/> class.
00179         /// </summary>
00180         /// <param name="rootFrame">A reference to the top-level frame.
00181         /// This reference allows for frame manipulation and to register navigation handlers.</param>
00182         public RootFrameNavigationHelper(Frame rootFrame)
00183         {
00184             this.Frame = rootFrame;
00185
00186             // Handle keyboard and mouse navigation requests
00187             this.systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00188             systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested;
00189             UpdateBackButton();
00190
00191             // Listen to the window directly so we will respond to hotkeys regardless
00192             // of which element has focus.
00193             Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
00194                 CoreDispatcher_AcceleratorKeyActivated;
00195             Window.Current.CoreWindow.PointerPressed +=
00196                 this.CoreWindow_PointerPressed;
00197
00198             // Update the Back button whenever a navigation occurs.
00199             this.Frame.Navigated += (s, e) => UpdateBackButton();
00200         }
00201
00202         private bool TryGoBack()
00203         {
00204             bool navigated = false;
00205             if (this.Frame.CanGoBack)
00206             {
00207                 this.Frame.GoBack();
00208                 navigated = true;
00209             }
00210             return navigated;
00211         }
00212
00213         private bool TryGoForward()
00214         {
00215             bool navigated = false;
00216             if (this.Frame.CanGoForward)
00217             {
00218                 this.Frame.GoForward();
00219                 navigated = true;
00220             }
00221             return navigated;
00222         }
00223
00224
00225         private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e)
00226         {
00227             if (!e.Handled)
00228             {
00229                 e.Handled = TryGoBack();
00230             }
00231         }
00232
00233         private void UpdateBackButton()
00234         {
00235             systemNavigationManager.AppViewBackButtonVisibility =
00236                 this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
00237         }
00238
00239         /// <summary>
00240         /// Invoked on every keystroke, including system keys such as Alt key combinations.
00241         /// Used to detect keyboard navigation between pages even when the page itself
00242         /// doesn't have focus.
00243         /// </summary>
00244         /// <param name="sender">Instance that triggered the event.</param>
00245         /// <param name="e">Event data describing the conditions that led to the event.</param>
00246         private void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender,
00247             AcceleratorKeyEventArgs e)
00248         {
00249             var virtualKey = e.VirtualKey;
00250
00251             // Only investigate further when Left, Right, or the dedicated Previous or Next keys
00252             // are pressed
00253             if ((e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown ||
00254                 e.EventType == CoreAcceleratorKeyEventType.KeyDown) &&
00255                 (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right ||
00256                 (int)virtualKey == 166 || (int)virtualKey == 167))
00257             {
00258                 var coreWindow = Window.Current.CoreWindow;
00259                 var downState = CoreVirtualKeyStates.Down;
00260                 bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState;
00261                 bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState;
00262                 bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState;
00263                 bool noModifiers = !menuKey && !controlKey && !shiftKey;
00264                 bool onlyAlt = menuKey && !controlKey && !shiftKey;
00265
00266                 if (((int)virtualKey == 166 && noModifiers) ||
00267                     (virtualKey == VirtualKey.Left && onlyAlt))
00268                 {
00269                     // When the previous key or Alt+Left are pressed navigate back
00270                     e.Handled = TryGoBack();
00271                 }
00272                 else if (((int)virtualKey == 167 && noModifiers) ||
00273                     (virtualKey == VirtualKey.Right && onlyAlt))
00274                 {
00275                     // When the next key or Alt+Right are pressed navigate forward
00276                     e.Handled = TryGoForward();
00277                 }
00278             }
00279         }
00280
00281         /// <summary>
00282         /// Invoked on every mouse click, touch screen tap, or equivalent interaction.
00283         /// Used to detect browser-style next and previous mouse button clicks
00284         /// to navigate between pages.
00285         /// </summary>
00286         /// <param name="sender">Instance that triggered the event.</param>
00287         /// <param name="e">Event data describing the conditions that led to the event.</param>
00288         private void CoreWindow_PointerPressed(CoreWindow sender,
00289             PointerEventArgs e)
00290         {
00291             var properties = e.CurrentPoint.Properties;
00292
00293             // Ignore button chords with the left, right, and middle buttons
00294             if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
00295                 properties.IsMiddleButtonPressed)
00296                 return;
00297
00298             // If back or foward are pressed (but not both) navigate appropriately
00299             bool backPressed = properties.IsXButton1Pressed;
00300             bool forwardPressed = properties.IsXButton2Pressed;
00301             if (backPressed ^ forwardPressed)
00302             {
00303                 e.Handled = true;
00304                 if (backPressed) this.TryGoBack();
00305                 if (forwardPressed) this.TryGoForward();
00306             }
00307         }
00308     }
00309
00310     /// <summary>
00311     /// Represents the method that will handle the <see cref="NavigationHelper.LoadState"/>event
00312     /// </summary>
00313     public delegate void LoadStateEventHandler(object sender, LoadStateEventArgs e);
00314     /// <summary>
00315     /// Represents the method that will handle the <see cref="NavigationHelper.SaveState"/>event
00316     /// </summary>
00317     public delegate void SaveStateEventHandler(object sender, SaveStateEventArgs e);
00318
00319     /// <summary>
00320     /// Class used to hold the event data required when a page attempts to load state.
00321     /// </summary>
00322     public class LoadStateEventArgs : EventArgs
00323     {
00324         /// <summary>
00325         /// The parameter value passed to <see cref="Frame.Navigate(Type, Object)"/>
00326         /// when this page was initially requested.
00327         /// </summary>
00328         public Object NavigationParameter { get; private set; }
00329         /// <summary>
00330         /// A dictionary of state preserved by this page during an earlier
00331         /// session.  This will be null the first time a page is visited.
00332         /// </summary>
00333         public Dictionary<string, Object> PageState { get; private set; }
00334
00335         /// <summary>
00336         /// Initializes a new instance of the <see cref="LoadStateEventArgs"/> class.
00337         /// </summary>
00338         /// <param name="navigationParameter">
00339         /// The parameter value passed to <see cref="Frame.Navigate(Type, Object)"/>
00340         /// when this page was initially requested.
00341         /// </param>
00342         /// <param name="pageState">
00343         /// A dictionary of state preserved by this page during an earlier
00344         /// session.  This will be null the first time a page is visited.
00345         /// </param>
00346         public LoadStateEventArgs(Object navigationParameter, Dictionary<string, Object> pageState)
00347             : base()
00348         {
00349             this.NavigationParameter = navigationParameter;
00350             this.PageState = pageState;
00351         }
00352     }
00353     /// <summary>
00354     /// Class used to hold the event data required when a page attempts to save state.
00355     /// </summary>
00356     public class SaveStateEventArgs : EventArgs
00357     {
00358         /// <summary>
00359         /// An empty dictionary to be populated with serializable state.
00360         /// </summary>
00361         public Dictionary<string, Object> PageState { get; private set; }
00362
00363         /// <summary>
00364         /// Initializes a new instance of the <see cref="SaveStateEventArgs"/> class.
00365         /// </summary>
00366         /// <param name="pageState">An empty dictionary to be populated with serializable state.</param>
00367         public SaveStateEventArgs(Dictionary<string, Object> pageState)
00368             : base()
00369         {
00370             this.PageState = pageState;
00371         }
00372     }
00373 }
Generated on Fri Nov 15 2024 22:18:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-I2C/cppwinrt/Scenario1_ReadData.h Source File

  • IoT-I2C
  • cppwinrt

Scenario1_ReadData.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_ReadData.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_ReadData : Scenario1_ReadDataT<Scenario1_ReadData>
00019     {
00020         Scenario1_ReadData();
00021         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00022
00023         fire_and_forget StartStopScenario_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         Windows::Devices::I2c::I2cDevice htu21dSensor{ nullptr };
00027         Windows::UI::Xaml::DispatcherTimer timer{ nullptr };
00028         event_token timerEventToken{};
00029
00030         Windows::Foundation::IAsyncAction StartScenarioAsync();
00031         void StopScenario();
00032         void Timer_Tick(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00033     };
00034 }
00035
00036 namespace winrt::SDKTemplate::factory_implementation
00037 {
00038     struct Scenario1_ReadData : Scenario1_ReadDataT<Scenario1_ReadData, implementation::Scenario1_ReadData>
00039     {
00040     };
00041 }
Generated on Fri Nov 15 2024 22:20:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/App.xaml.h Source File

  • XamlBind
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// Provides application-specific behavior to supplement the default Application class.
00020     /// </summary>
00021     ref class App sealed
00022     {
00023     protected:
00024         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00025
00026     internal:
00027         App();
00028
00029     private:
00030         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00031         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00032     };
00033 }
00034
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/pch.h Source File

  • UserDataAccountManager
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactPicker/cs/SampleConfiguration.cs Source File

  • ContactPicker
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Text;
00015 using Windows.ApplicationModel.Contacts;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Contact picker C# sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Pick a contact", ClassType=typeof(Scenario1_Single)},
00027             new Scenario() { Title="Pick multiple contacts", ClassType=typeof(Scenario2_Multiple)},
00028         };
00029
00030         static public string GetContactResult(Contact contact)
00031         {
00032             var result = new StringBuilder();
00033             result.AppendFormat("Display name: {0}", contact.DisplayName);
00034             result.AppendLine();
00035
00036             foreach (ContactEmail email in contact.Emails)
00037             {
00038                 result.AppendFormat("Email address ({0}): {1}", email.Kind, email.Address);
00039                 result.AppendLine();
00040             }
00041
00042             foreach (ContactPhone phone in contact.Phones)
00043             {
00044                 result.AppendFormat("Phone ({0}): {1}", phone.Kind, phone.Number);
00045                 result.AppendLine();
00046             }
00047
00048             return result.ToString();
00049         }
00050     }
00051
00052     public class Scenario
00053     {
00054         public string Title { get; set; }
00055         public Type ClassType { get; set; }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_CachedNetworks Member List

This is the complete list of members for Scenario1_CachedNetworks, including all inherited members.
Button_Click(object sender, RoutedEventArgs e) | Scenario1_CachedNetworks | [inline, private]
DisplayNetworkReport(WiFiNetworkReport report, WiFiAdapter adapter) | Scenario1_CachedNetworks | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_CachedNetworks | [inline, protected]
ResultCollection | Scenario1_CachedNetworks |
rootPage | Scenario1_CachedNetworks | [private]
Scenario1_CachedNetworks() | Scenario1_CachedNetworks | [inline]
wiFiAdapters | Scenario1_CachedNetworks | [private]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/Scenario4_SaveFile.xaml.cpp Source File

  • FilePicker
  • cpp

Scenario4_SaveFile.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_SaveFile.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Storage;
00020 using namespace Windows::Storage::Pickers;
00021 using namespace Windows::Storage::Provider;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 Scenario4_SaveFile::Scenario4_SaveFile()
00027 {
00028     InitializeComponent();
00029     rootPage = MainPage::Current;
00030 }
00031
00032 void Scenario4_SaveFile::SaveFileButton_Click(Object^ sender, RoutedEventArgs^ e)
00033 {
00034     // Clear previous returned file name, if it exists, between iterations of this scenario
00035     OutputTextBlock->Text = "";
00036
00037     FileSavePicker^ savePicker = ref new FileSavePicker();
00038     savePicker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
00039
00040     auto plainTextExtensions = ref new Platform::Collections::Vector<String^>();
00041     plainTextExtensions->Append(".txt");
00042     savePicker->FileTypeChoices->Insert("Plain Text", plainTextExtensions);
00043     savePicker->SuggestedFileName = "New Document";
00044
00045     create_task(savePicker->PickSaveFileAsync()).then([this](StorageFile^ file)
00046     {
00047         if (file != nullptr)
00048         {
00049             // Prevent updates to the remote version of the file until we finish making changes and call CompleteUpdatesAsync.
00050             CachedFileManager::DeferUpdates(file);
00051             // write to file
00052             create_task(FileIO::WriteTextAsync(file, file->Name)).then([this, file]()
00053             {
00054                 // Let Windows know that we're finished changing the file so the other app can update the remote version of the file.
00055                 // Completing updates may require Windows to ask for user input.
00056                 create_task(CachedFileManager::CompleteUpdatesAsync(file)).then([this, file](FileUpdateStatus status)
00057                 {
00058                     if (status == FileUpdateStatus::Complete)
00059                     {
00060                         OutputTextBlock->Text = "File " + file->Name + " was saved.";
00061                     }
00062                     else
00063                     {
00064                         OutputTextBlock->Text = "File " + file->Name + " couldn't be saved.";
00065                     }
00066                 });
00067             });
00068         }
00069         else
00070         {
00071             OutputTextBlock->Text = "Operation cancelled.";
00072         }
00073     });
00074 }
Generated on Fri Nov 15 2024 22:19:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ConstantBufferChangesEveryPrim Member List

This is the complete list of members for ConstantBufferChangesEveryPrim, including all inherited members.
diffuseColor | ConstantBufferChangesEveryPrim
meshColor | ConstantBufferChangesEveryPrim
specularColor | ConstantBufferChangesEveryPrim
specularPower | ConstantBufferChangesEveryPrim
worldMatrix | ConstantBufferChangesEveryPrim
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
Scenario1() | Scenario1 | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/Notifications/ExpiringNotification/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • Notifications
  • ExpiringNotification

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Linq;
00003 using Windows.Data.Xml.Dom;
00004 using Windows.UI.Notifications;
00005 using Windows.UI.Popups;
00006 using Windows.UI.StartScreen;
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009
00010 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00011
00012 namespace Notifications.ScenarioPages.LiveTiles.Notifications.ExpiringNotification
00013 {
00014     /// <summary>
00015     /// An empty page that can be used on its own or navigated to within a Frame.
00016     /// </summary>
00017     public sealed partial class ScenarioElement : UserControl
00018     {
00019         public ScenarioElement()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         private string _tileId;
00025
00026         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00027         {
00028             base.IsEnabled = false;
00029
00030             _tileId = DateTime.Now.Ticks.ToString();
00031
00032             SecondaryTile tile = new SecondaryTile(_tileId, "Expiring Notification", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
00033             tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00034             tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00035             tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00036             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00037             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00038             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00039             await tile.RequestCreateAsync();
00040
00041             base.IsEnabled = true;
00042         }
00043
00044         private async void ButtonSendNotification_Click(object sender, RoutedEventArgs e)
00045         {
00046             base.IsEnabled = false;
00047
00048             try
00049             {
00050                 if (_tileId == null)
00051                 {
00052                     await new MessageDialog("No secondary tile was pinned. In the previous step, you had to pin the tile.", "Error").ShowAsync();
00053                     return;
00054                 }
00055
00056                 SecondaryTile tile = (await SecondaryTile.FindAllAsync()).FirstOrDefault(i => i.TileId.Equals(_tileId));
00057                 if (tile == null)
00058                 {
00059                     await new MessageDialog("The secondary tile that was previously pinned could not be found. Has it been removed from Start?", "Error").ShowAsync();
00060                     return;
00061                 }
00062
00063                 // Decide expiration time
00064                 Windows.Globalization.Calendar cal = new Windows.Globalization.Calendar();
00065                 cal.SetToNow();
00066                 cal.AddSeconds(20);
00067
00068                 // Get expiration time and date
00069                 var longTime = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("longtime");
00070                 DateTimeOffset expiryTime = cal.GetDateTime();
00071                 string expiryTimeString = longTime.Format(expiryTime);
00072
00073                 // Create the custom tile that will expire
00074                 string tileXmlString =
00075                 "<tile>"
00076                 + "<visual>"
00077                 + "<binding template='TileMedium'>"
00078                 + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
00079                 + "</binding>"
00080                 + "<binding template='TileWide'>"
00081                 + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
00082                 + "</binding>"
00083                 + "<binding template='TileLarge'>"
00084                 + "<text hint-wrap='true'>This notification will expire at " + expiryTimeString + "</text>"
00085                 + "</binding>"
00086                 + "</visual>"
00087                 + "</tile>";
00088
00089                 XmlDocument xmlDoc = new XmlDocument();
00090                 xmlDoc.LoadXml(tileXmlString);
00091
00092                 // Create the notification
00093                 TileNotification notifyTile = new TileNotification(xmlDoc);
00094
00095                 // Set expiration time for the notification
00096                 notifyTile.ExpirationTime = expiryTime;
00097
00098                 // And send the notification to the tile
00099                 TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notifyTile);
00100             }
00101
00102             catch (Exception ex)
00103             {
00104                 await new MessageDialog(ex.ToString(), "Error updating tile").ShowAsync();
00105             }
00106
00107             finally
00108             {
00109                 base.IsEnabled = true;
00110             }
00111         }
00112     }
00113 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario4.xaml.h Source File

  • StreamSocket
  • cpp

Scenario4.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4.xaml.h
00014 // Declaration of the Scenario4 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario4.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace StreamSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario4 sealed
00032         {
00033         public:
00034             Scenario4();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             MainPage^ rootPage;
00040             void CloseSockets_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         };
00042     }
00043 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario7_ListSmartCards.xaml.h Source File

  • SmartCard
  • cpp

Scenario7_ListSmartCards.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario7_ListSmartCards.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::UI::Xaml::Data::Bindable]
00011     [Windows::Foundation::Metadata::WebHostHiddenAttribute]
00012     public ref class SmartCardItem sealed
00013     {
00014     public:
00015         property Platform::String^ ReaderName
00016         {
00017             Platform::String^  get()
00018             {
00019                 return readerName;
00020             }
00021
00022             void set(Platform::String^  value)
00023             {
00024                 readerName = value;
00025             }
00026         }
00027
00028         property Platform::String^ CardName
00029         {
00030             Platform::String^  get()
00031             {
00032                 return cardName;
00033             }
00034
00035             void set(Platform::String^  value)
00036             {
00037                 cardName = value;
00038             }
00039         }
00040     private:
00041         Platform::String^ readerName;
00042         Platform::String^ cardName;
00043     };
00044
00045     [Windows::Foundation::Metadata::WebHostHidden]
00046     public ref class Scenario7_ListSmartCards sealed
00047     {
00048     public:
00049         Scenario7_ListSmartCards();
00050     private:
00051         void ListSmartCards_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00052         Platform::Collections::Vector<SmartCardItem^>^ smartCardItems;
00053     };
00054 }
Generated on Fri Nov 15 2024 22:21:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomEditControl Member List

This is the complete list of members for CustomEditControl, including all inherited members.
_coreWindow | CustomEditControl | [private]
_editContext | CustomEditControl | [private]
_extendingLeft | CustomEditControl | [private]
_inputPane | CustomEditControl | [private]
_internalFocus | CustomEditControl | [private]
_selection | CustomEditControl | [private]
_text | CustomEditControl | [private]
AdjustSelectionEndpoint(int direction) | CustomEditControl | [inline, private]
CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args) | CustomEditControl | [inline, private]
CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args) | CustomEditControl | [inline, private]
CustomEditControl() | CustomEditControl | [inline]
EditContext_CompositionCompleted(CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs args) | CustomEditControl | [inline, private]
EditContext_CompositionStarted(CoreTextEditContext sender, CoreTextCompositionStartedEventArgs args) | CustomEditControl | [inline, private]
EditContext_FocusRemoved(CoreTextEditContext sender, object args) | CustomEditControl | [inline, private]
EditContext_FormatUpdating(CoreTextEditContext sender, CoreTextFormatUpdatingEventArgs args) | CustomEditControl | [inline, private]
EditContext_LayoutRequested(CoreTextEditContext sender, CoreTextLayoutRequestedEventArgs args) | CustomEditControl | [inline, private]
EditContext_SelectionRequested(CoreTextEditContext sender, CoreTextSelectionRequestedEventArgs args) | CustomEditControl | [inline, private]
EditContext_SelectionUpdating(CoreTextEditContext sender, CoreTextSelectionUpdatingEventArgs args) | CustomEditControl | [inline, private]
EditContext_TextRequested(CoreTextEditContext sender, CoreTextTextRequestedEventArgs args) | CustomEditControl | [inline, private]
EditContext_TextUpdating(CoreTextEditContext sender, CoreTextTextUpdatingEventArgs args) | CustomEditControl | [inline, private]
Element_Unloaded(object sender, RoutedEventArgs e) | CustomEditControl | [inline, private]
GetElementRect(FrameworkElement element) | CustomEditControl | [inline, private, static]
HasSelection() | CustomEditControl | [inline, private]
PreserveTrailingSpaces(string s) | CustomEditControl | [inline, private, static]
RemoveInternalFocus() | CustomEditControl | [inline, private]
RemoveInternalFocusWorker() | CustomEditControl | [inline, private]
ReplaceText(CoreTextRange modifiedRange, string text) | CustomEditControl | [inline, private]
ScaleRect(Rect rect, double scale) | CustomEditControl | [inline, private, static]
SetInternalFocus() | CustomEditControl | [inline, private]
SetSelection(CoreTextRange selection) | CustomEditControl | [inline, private]
SetSelectionAndNotify(CoreTextRange selection) | CustomEditControl | [inline, private]
UpdateFocusUI() | CustomEditControl | [inline, private]
UpdateTextUI() | CustomEditControl | [inline, private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Capabilities/cppwinrt/Scenario1_Check.cpp Source File

  • Capabilities
  • cppwinrt

Scenario1_Check.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Check.h"
00014 #include "Scenario1_Check.g.cpp"
00015 #include <sstream>
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Devices::Geolocation;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Security::Authorization::AppCapabilityAccess;
00021 using namespace winrt::Windows::System;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024 using namespace std::literals::chrono_literals;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario1_Check::Scenario1_Check()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     void Scenario1_Check::OnNavigatedTo(NavigationEventArgs const&)
00034     {
00035         // Specify which capability we want to query/monitor.
00036         locationCapability = AppCapability::Create(L"location");
00037
00038         // Register a handler to be called when access changes.
00039         accessChangedToken = locationCapability.AccessChanged({ get_weak(), &Scenario1_Check::OnCapabilityAccessChanged });
00040
00041         // Update UI to match current access.
00042         UpdateCapabilityStatus();
00043     }
00044
00045     void Scenario1_Check::OnNavigatedFrom(NavigationEventArgs const&)
00046     {
00047         locationCapability.AccessChanged(accessChangedToken);
00048     }
00049
00050     fire_and_forget Scenario1_Check::OnCapabilityAccessChanged(AppCapability const&, IInspectable const&)
00051     {
00052         auto lifetime = get_strong();
00053         co_await resume_foreground(Dispatcher());
00054         UpdateCapabilityStatus();
00055     }
00056
00057     fire_and_forget Scenario1_Check::StreamLocationButton_Click(IInspectable const&, RoutedEventArgs const&)
00058     {
00059         auto lifetime = get_strong();
00060
00061         switch (locationCapability.CheckAccess())
00062         {
00063         case AppCapabilityAccessStatus::Allowed:
00064             // Access was already granted.
00065             // AccessChanged event will trigger a recalc.
00066             co_await StreamLocationAsync();
00067             break;
00068
00069         case AppCapabilityAccessStatus::UserPromptRequired:
00070             // Request access directly for a better experience than going to Settings.
00071             // This is equivalent to calling Geolocator::RequestAccessAsync().
00072             if (co_await locationCapability.RequestAccessAsync() == AppCapabilityAccessStatus::Allowed)
00073             {
00074                 // The user granted access.
00075                 // AccessChanged event will trigger a recalc.
00076                 co_await StreamLocationAsync();
00077             }
00078             break;
00079
00080         case AppCapabilityAccessStatus::DeniedByUser:
00081         case AppCapabilityAccessStatus::DeniedBySystem:
00082         default:
00083             // Send user to Settings to obtain location permission
00084             // or explain why access is denied.
00085             co_await Launcher::LaunchUriAsync(Uri(L"ms-settings:privacy-location"));
00086             break;
00087         }
00088     }
00089
00090     IAsyncAction Scenario1_Check::StreamLocationAsync()
00091     {
00092         auto lifetime = get_strong();
00093
00094         if (co_await Geolocator::RequestAccessAsync() == GeolocationAccessStatus::Allowed)
00095         {
00096             // Need try/catch because we can lose geolocator access at any time.
00097             try
00098             {
00099                 // Specify a message to explain to the user why we are tracking their location.
00100                 locationCapability.DisplayMessage(winrt::hstring(L"Streaming location"));
00101
00102                 LocationTextBlock().Text(L"Finding your current location...");
00103                 Geolocator geolocator;
00104
00105                 for (int i = 0; i < 4; i++)
00106                 {
00107                     Geoposition pos = co_await geolocator.GetGeopositionAsync();
00108
00109                     if (pos == nullptr)
00110                     {
00111                         LocationTextBlock().Text(L"Current location unknown.");
00112                     }
00113                     else
00114                     {
00115                         std::wostringstream output;
00116                         output << L"Your location is: Latitude " << pos.Coordinate().Point().Position().Latitude <<
00117                             L", Longitude" << pos.Coordinate().Point().Position().Longitude;
00118                         LocationTextBlock().Text(output.str());
00119                     }
00120
00121                     co_await winrt::resume_after(500ms);
00122                     co_await resume_foreground(Dispatcher());
00123
00124                     // You can change the message as your app's usage changes.
00125                     locationCapability.DisplayMessage(L"Tracking your current location...");
00126                 }
00127             }
00128             catch (hresult_access_denied const&)
00129             {
00130                 // Lost access in the middle of the operation.
00131                 // AccessChanged event will trigger a recalc.
00132             }
00133
00134             LocationTextBlock().Text(L"");
00135
00136             // Even though we clear the message immediately, it will take time before the message
00137             // disappear from the system. The system has a minimum display time for the message,
00138             // so that users can observe brief usage.
00139             locationCapability.DisplayMessage(L"");
00140         }
00141         else
00142         {
00143             // Lost access before operation started.
00144             // AccessChanged event will trigger a recalc.
00145         }
00146     }
00147
00148     void Scenario1_Check::UpdateCapabilityStatus()
00149     {
00150         auto lifetime = get_strong();
00151
00152         AppCapabilityAccessStatus status = locationCapability.CheckAccess();
00153         if (status == AppCapabilityAccessStatus::Allowed)
00154         {
00155             LocationAccessBlock().Visibility(Visibility::Collapsed);
00156             LocationTextBlock().Visibility(Visibility::Visible);
00157         }
00158         else
00159         {
00160             LocationTextBlock().Visibility(Visibility::Collapsed);
00161
00162             switch (status)
00163             {
00164             case AppCapabilityAccessStatus::NotDeclaredByApp:
00165                 // The app neglected to declare the capability in its manifest.
00166                 // This is a developer error.
00167                 LocationAccessBlock().Text(L"App misconfiguration error. Contact vendor for support.");
00168                 LocationAccessBlock().Visibility(Visibility::Visible);
00169                 break;
00170
00171             default:
00172             case AppCapabilityAccessStatus::DeniedBySystem:
00173                 // We can send the user to the Settings page to obtain access
00174                 // or at least explain why access is denied.
00175                 LocationAccessBlock().Text(L"The system has blocked access to location.");
00176                 LocationAccessBlock().Visibility(Visibility::Visible);
00177                 break;
00178
00179             case AppCapabilityAccessStatus::DeniedByUser:
00180                 // We can send the user to the Settings page to obtain access.
00181                 LocationAccessBlock().Text(L"You must enable location access in Settings.");
00182                 LocationAccessBlock().Visibility(Visibility::Visible);
00183                 break;
00184
00185             case AppCapabilityAccessStatus::UserPromptRequired:
00186                 // We can prompt the user to give us access.
00187                 LocationAccessBlock().Visibility(Visibility::Collapsed);
00188                 break;
00189             }
00190         }
00191     }
00192 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceProducer.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceProducer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 extern PCSTR c_SecureInterfaceIntrospectionXml;
00026
00027 ref class SecureInterfaceProducer;
00028
00029 public interface class ISecureInterfaceProducer
00030 {
00031     event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^>^ Stopped;
00032     event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^>^ SessionLost;
00033     event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^>^ SessionMemberAdded;
00034     event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^>^ SessionMemberRemoved;
00035 };
00036
00037 public ref class SecureInterfaceProducer sealed : [Windows::Foundation::Metadata::Default] ISecureInterfaceProducer
00038 {
00039 public:
00040     SecureInterfaceProducer(Windows::Devices::AllJoyn::AllJoynBusAttachment^ busAttachment);
00041     virtual ~SecureInterfaceProducer();
00042
00043     // The implementation of ISecureInterfaceService that will handle method calls and property requests.
00044     property ISecureInterfaceService^ Service
00045     {
00046         ISecureInterfaceService^ get() { return m_serviceInterface; }
00047         void set(ISecureInterfaceService^ value) { m_serviceInterface = value; }
00048     }
00049
00050     // Used to send signals or register functions to handle received signals.
00051     property SecureInterfaceLegacySignals^ Signals
00052     {
00053         SecureInterfaceLegacySignals^ get() { return m_signals; }
00054     }
00055
00056     // This event will fire whenever this producer is stopped.
00057     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^>^ Stopped
00058     {
00059         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^>^ handler)
00060         {
00061             return _Stopped += ref new Windows::Foundation::EventHandler<Platform::Object^>
00062             ([handler](Platform::Object^ sender, Platform::Object^ args)
00063             {
00064                 handler->Invoke(safe_cast<SecureInterfaceProducer^>(sender), safe_cast<Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^>(args));
00065             }, Platform::CallbackContext::Same);
00066         }
00067         void remove(Windows::Foundation::EventRegistrationToken token)
00068         {
00069             _Stopped -= token;
00070         }
00071     internal:
00072         void raise(SecureInterfaceProducer^ sender, Windows::Devices::AllJoyn::AllJoynProducerStoppedEventArgs^ args)
00073         {
00074             _Stopped(sender, args);
00075         }
00076     }
00077
00078     // This event will fire whenever the producer loses the session that it created.
00079     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^>^ SessionLost
00080     {
00081         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^>^ handler)
00082         {
00083             return _SessionLost += ref new Windows::Foundation::EventHandler<Platform::Object^>
00084             ([handler](Platform::Object^ sender, Platform::Object^ args)
00085             {
00086                 handler->Invoke(safe_cast<SecureInterfaceProducer^>(sender), safe_cast<Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^>(args));
00087             }, Platform::CallbackContext::Same);
00088         }
00089         void remove(Windows::Foundation::EventRegistrationToken token)
00090         {
00091             _SessionLost -= token;
00092         }
00093     internal:
00094         void raise(SecureInterfaceProducer^ sender, Windows::Devices::AllJoyn::AllJoynSessionLostEventArgs^ args)
00095         {
00096             _SessionLost(sender, args);
00097         }
00098     }
00099
00100     // This event will fire whenever a member joins the session.
00101     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^>^ SessionMemberAdded
00102     {
00103         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^>^ handler)
00104         {
00105             return _SessionMemberAdded += ref new Windows::Foundation::EventHandler<Platform::Object^>
00106             ([handler](Platform::Object^ sender, Platform::Object^ args)
00107             {
00108                 handler->Invoke(safe_cast<SecureInterfaceProducer^>(sender), safe_cast<Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^>(args));
00109             }, Platform::CallbackContext::Same);
00110         }
00111         void remove(Windows::Foundation::EventRegistrationToken token)
00112         {
00113             _SessionMemberAdded -= token;
00114         }
00115     internal:
00116         void raise(SecureInterfaceProducer^ sender, Windows::Devices::AllJoyn::AllJoynSessionMemberAddedEventArgs^ args)
00117         {
00118             _SessionMemberAdded(sender, args);
00119         }
00120     }
00121
00122     // This event will fire whenever a member leaves the session.
00123     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^>^ SessionMemberRemoved
00124     {
00125         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceProducer^, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^>^ handler)
00126         {
00127             return _SessionMemberRemoved += ref new Windows::Foundation::EventHandler<Platform::Object^>
00128             ([handler](Platform::Object^ sender, Platform::Object^ args)
00129             {
00130                 handler->Invoke(safe_cast<SecureInterfaceProducer^>(sender), safe_cast<Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^>(args));
00131             }, Platform::CallbackContext::Same);
00132         }
00133         void remove(Windows::Foundation::EventRegistrationToken token)
00134         {
00135             _SessionMemberRemoved -= token;
00136         }
00137     internal:
00138         void raise(SecureInterfaceProducer^ sender, Windows::Devices::AllJoyn::AllJoynSessionMemberRemovedEventArgs^ args)
00139         {
00140             _SessionMemberRemoved(sender, args);
00141         }
00142     }
00143
00144     // Send a signal to all members of the session to notify them that the value of IsUpperCaseEnabled has changed.
00145     void EmitIsUpperCaseEnabledChanged();
00146
00147     // Start advertising the service.
00148     void Start();
00149
00150     // Stop advertising the service.
00151     void Stop();
00152
00153     // Remove a member that has joined this session.
00154     int32 RemoveMemberFromSession(_In_ Platform::String^ uniqueName);
00155
00156 internal:
00157     bool OnAcceptSessionJoiner(_In_ alljoyn_sessionport sessionPort, _In_ PCSTR joiner, _In_ const alljoyn_sessionopts opts);
00158     void OnSessionJoined(_In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner);
00159     QStatus OnPropertyGet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val);
00160     QStatus OnPropertySet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val);
00161     void OnSessionLost(_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason);
00162     void OnSessionMemberAdded(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName);
00163     void OnSessionMemberRemoved(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName);
00164
00165     property Platform::String^ ServiceObjectPath
00166     {
00167         Platform::String^ get() { return m_ServiceObjectPath; }
00168         void set(Platform::String^ value) { m_ServiceObjectPath = value; }
00169     }
00170
00171     property alljoyn_busobject BusObject
00172     {
00173         alljoyn_busobject get() { return m_busObject; }
00174         void set(alljoyn_busobject value) { m_busObject = value; }
00175     }
00176
00177     property alljoyn_sessionportlistener SessionPortListener
00178     {
00179         alljoyn_sessionportlistener get() { return m_sessionPortListener; }
00180         void set(alljoyn_sessionportlistener value) { m_sessionPortListener = value; }
00181     }
00182
00183     property alljoyn_sessionlistener SessionListener
00184     {
00185         alljoyn_sessionlistener get() { return m_sessionListener; }
00186         void set(alljoyn_sessionlistener value) { m_sessionListener = value; }
00187     }
00188
00189     property alljoyn_sessionport SessionPort
00190     {
00191         alljoyn_sessionport get() { return m_sessionPort; }
00192     internal:
00193         void set(alljoyn_sessionport value) { m_sessionPort = value; }
00194     }
00195
00196     property alljoyn_sessionid SessionId
00197     {
00198         alljoyn_sessionid get() { return m_sessionId; }
00199     }
00200
00201     // Stop advertising the service and pass status to anyone listening for the Stopped event.
00202     void StopInternal(int32 status);
00203
00204     void BusAttachmentStateChanged(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^ sender, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^ args);
00205
00206 private:
00207     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _Stopped;
00208     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionLost;
00209     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberAdded;
00210     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _SessionMemberRemoved;
00211
00212     // "Concatenate two input strings and returns the concatenated string as output"
00213     static void CallConcatenateHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message);
00214     // "This signal is emitted when producer sends a text message to consumer"
00215     static void CallTextSentSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message);
00216
00217     // Register a callback function to handle methods.
00218     QStatus AddMethodHandler(_In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_methodhandler_ptr handler);
00219     // Register a callback function to handle incoming signals.
00220     QStatus AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler);
00221
00222     void UnregisterFromBus();
00223
00224     Windows::Devices::AllJoyn::AllJoynBusAttachment^ m_busAttachment;
00225     Windows::Foundation::EventRegistrationToken m_busAttachmentStateChangedToken;
00226     SecureInterfaceLegacySignals^ m_signals;
00227     ISecureInterfaceService^ m_serviceInterface;
00228     Platform::String^ m_ServiceObjectPath;
00229
00230     alljoyn_busobject m_busObject;
00231     alljoyn_sessionportlistener m_sessionPortListener;
00232     alljoyn_sessionlistener m_sessionListener;
00233     alljoyn_sessionport m_sessionPort;
00234     alljoyn_sessionid m_sessionId;
00235
00236     // Used to pass a pointer to this class to callbacks
00237     Platform::WeakReference* m_weak;
00238
00239     // These maps are required because we need a way to pass the producer to the method
00240     // and signal handlers, but the current AllJoyn C API does not allow passing a context to these
00241     // callbacks.
00242     static std::map<alljoyn_busobject, Platform::WeakReference*> SourceObjects;
00243     static std::map<alljoyn_interfacedescription, Platform::WeakReference*> SourceInterfaces;
00244 };
00245
00246 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/RandomNumberService/RandomNumberGeneratorTask.cs Source File

  • AppServices
  • cs
  • RandomNumberService

RandomNumberGeneratorTask.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.ApplicationModel.AppService;
00003 using Windows.ApplicationModel.Background;
00004 using Windows.Foundation.Collections;
00005
00006 namespace RandomNumberService
00007 {
00008     public sealed class RandomNumberGeneratorTask : IBackgroundTask
00009     {
00010         BackgroundTaskDeferral serviceDeferral;
00011         AppServiceConnection connection;
00012         Random randomNumberGenerator;
00013
00014         public void Run(IBackgroundTaskInstance taskInstance)
00015         {
00016             //Take a service deferral so the service isn't terminated
00017             serviceDeferral = taskInstance.GetDeferral();
00018
00019             taskInstance.Canceled += OnTaskCanceled;
00020
00021             //Initialize the random number generator
00022             randomNumberGenerator = new Random((int)DateTime.Now.Ticks);
00023
00024             var details = taskInstance.TriggerDetails as AppServiceTriggerDetails;
00025             connection = details.AppServiceConnection;
00026
00027             //Listen for incoming app service requests
00028             connection.RequestReceived += OnRequestReceived;
00029         }
00030
00031         private void OnTaskCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
00032         {
00033             if (connection != null)
00034             {
00035                 connection.Dispose();
00036                 connection = null;
00037             }
00038
00039             if (serviceDeferral != null)
00040             {
00041                 //Complete the service deferral
00042                 serviceDeferral.Complete();
00043                 serviceDeferral = null;
00044             }
00045         }
00046
00047         async void OnRequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
00048         {
00049             //Get a deferral so we can use an awaitable API to respond to the message
00050             var messageDeferral = args.GetDeferral();
00051
00052             try
00053             {
00054                 var input = args.Request.Message;
00055                 int minValue = (int)input["minvalue"];
00056                 int maxValue = (int)input["maxvalue"];
00057
00058                 //Create the response
00059                 var result = new ValueSet();
00060                 result.Add("result", randomNumberGenerator.Next(minValue, maxValue));
00061
00062                 //Send the response
00063                 await args.Request.SendResponseAsync(result);
00064
00065             }
00066             finally
00067             {
00068                 //Complete the message deferral so the platform knows we're done responding
00069                 messageDeferral.Complete();
00070             }
00071         }
00072     }
00073 }
Generated on Fri Nov 15 2024 22:18:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario1_Prefs.cpp Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario1_Prefs.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Prefs.h"
00014 #include "Scenario1_Prefs.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::System::UserProfile;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1_Prefs::Scenario1_Prefs()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario1_Prefs::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
00032         // obtain the user's globalization preferences.
00033         OutputTextBlock().Text(L"Languages: " + StringJoin(L", ", GlobalizationPreferences::Languages()) + L"\n" +
00034             L"Home Region: " + GlobalizationPreferences::HomeGeographicRegion() + L"\n" +
00035             L"Calendar System: " + StringJoin(L", ", GlobalizationPreferences::Calendars()) + L"\n" +
00036             L"Clock: " + StringJoin(L", ", GlobalizationPreferences::Clocks()) + L"\n" +
00037             L"First Day of the Week: " + to_hstring(GlobalizationPreferences::WeekStartsOn()));
00038     }
00039 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario5_TriggerCFU.cpp Source File

  • FilePicker
  • cppwinrt

Scenario5_TriggerCFU.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario5_TriggerCFU.h"
00014 #include "Scenario5_TriggerCFU.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Storage;
00019 using namespace Windows::Storage::AccessCache;
00020 using namespace Windows::Storage::Pickers;
00021 using namespace Windows::Storage::Provider;
00022 using namespace Windows::UI::Xaml;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario5_TriggerCFU::Scenario5_TriggerCFU()
00027     {
00028         InitializeComponent();
00029         UpdateButtons();
00030     }
00031
00032     void Scenario5_TriggerCFU::UpdateButtons()
00033     {
00034         WriteToFileButton().IsEnabled(m_afterWriteFile != nullptr);
00035         WriteToFileWithCFUButton().IsEnabled(m_afterWriteFile != nullptr);
00036
00037         SaveToFutureAccessListButton().IsEnabled(m_beforeReadFile != nullptr);
00038         GetFileFromFutureAccessListButton().IsEnabled(!m_faToken.empty());
00039     }
00040
00041     fire_and_forget Scenario5_TriggerCFU::CreateFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         auto lifetime = get_strong();
00044
00045         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00046
00047         FileSavePicker savePicker;
00048         savePicker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
00049
00050         savePicker.FileTypeChoices().Insert(L"Plain Text", single_threaded_vector<hstring>({ L".txt" }));
00051         savePicker.SuggestedFileName(L"New Document");
00052
00053         m_afterWriteFile = co_await savePicker.PickSaveFileAsync();
00054         if (m_afterWriteFile != nullptr)
00055         {
00056             rootPage.NotifyUser(L"File created.", NotifyType::StatusMessage);
00057         }
00058         else
00059         {
00060             rootPage.NotifyUser(L"Operation cancelled.", NotifyType::ErrorMessage);
00061         }
00062         UpdateButtons();
00063     }
00064
00065     fire_and_forget Scenario5_TriggerCFU::WriteToFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00066     {
00067         auto lifetime = get_strong();
00068
00069         co_await FileIO::WriteTextAsync(m_afterWriteFile, L"The File Picker App just wrote to the file!");
00070         rootPage.NotifyUser(L"File write complete. If applicable, a WriteActivationMode.AfterWrite activation will occur in approximately 60 seconds on desktop.", NotifyType::StatusMessage);
00071     }
00072
00073     fire_and_forget Scenario5_TriggerCFU::WriteToFileWithExplicitCFUButton_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         auto lifetime = get_strong();
00076
00077         StorageFile file = m_afterWriteFile;
00078         CachedFileManager::DeferUpdates(file);
00079         co_await FileIO::WriteTextAsync(file, L"The File Picker App just wrote to the file!");
00080         rootPage.NotifyUser(L"File write complete. Explicitly completing updates.", NotifyType::StatusMessage);
00081         FileUpdateStatus status = co_await CachedFileManager::CompleteUpdatesAsync(file);
00082         switch (status)
00083         {
00084         case FileUpdateStatus::Complete:
00085             rootPage.NotifyUser(L"File " + file.Name() + L" was saved.", NotifyType::StatusMessage);
00086             break;
00087
00088         case FileUpdateStatus::CompleteAndRenamed:
00089             rootPage.NotifyUser(L"File " + file.Name() + L" was renamed and saved.", NotifyType::StatusMessage);
00090             break;
00091
00092         default:
00093             rootPage.NotifyUser(L"File " + file.Name() + L" couldn't be saved.", NotifyType::ErrorMessage);
00094             break;
00095         }
00096     }
00097
00098     fire_and_forget Scenario5_TriggerCFU::PickAFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00099     {
00100         auto lifetime = get_strong();
00101
00102         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00103
00104         FileOpenPicker openPicker;
00105         openPicker.ViewMode(PickerViewMode::Thumbnail);
00106         openPicker.FileTypeFilter().Append(L".txt");
00107
00108         StorageFile file = co_await openPicker.PickSingleFileAsync();
00109         if (file != nullptr)
00110         {
00111             m_beforeReadFile = file;
00112             rootPage.NotifyUser(L"Picked file: " + file.Name(), NotifyType::StatusMessage);
00113         }
00114         else
00115         {
00116             m_beforeReadFile = nullptr;
00117             rootPage.NotifyUser(L"Operation cancelled.", NotifyType::ErrorMessage);
00118         }
00119         UpdateButtons();
00120     }
00121
00122     void Scenario5_TriggerCFU::SaveToFutureAccessListButton_Click(IInspectable const&, RoutedEventArgs const&)
00123     {
00124         m_faToken = StorageApplicationPermissions::FutureAccessList().Add(m_beforeReadFile);
00125         rootPage.NotifyUser(L"Saved to Future Access List", NotifyType::StatusMessage);
00126         m_beforeReadFile = nullptr;
00127         UpdateButtons();
00128
00129     }
00130
00131     fire_and_forget Scenario5_TriggerCFU::GetFileFromFutureAccessListButton_Click(IInspectable const&, RoutedEventArgs const&)
00132     {
00133         auto lifetime = get_strong();
00134
00135         rootPage.NotifyUser(L"Getting the file from the Future Access List. If applicable, a ReadActivationMode.BeforeAccess activation will occur in approximately 60 seconds on desktop.", NotifyType::StatusMessage);
00136         StorageFile file = co_await StorageApplicationPermissions::FutureAccessList().GetFileAsync(m_faToken);
00137         if (file != nullptr)
00138         {
00139             rootPage.NotifyUser(L"Retrieved file from Future Access List: " + file.Name(), NotifyType::StatusMessage);
00140             m_beforeReadFile = file;
00141         }
00142         else
00143         {
00144             rootPage.NotifyUser(L"Unable to retrieve file from Future Access List.", NotifyType::ErrorMessage);
00145         }
00146         UpdateButtons();
00147
00148     }
00149 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/Scenario3_ReverseConversion.xaml.h Source File

  • TextSuggestion
  • cpp

Scenario3_ReverseConversion.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario3_ReverseConversion.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario3_ReverseConversion sealed
00015     {
00016     public:
00017         Scenario3_ReverseConversion();
00018     private:
00019         void CreateGeneratorButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00020         void Execute_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00021
00022         Windows::Data::Text::TextReverseConversionGenerator^ generator;
00023     };
00024 }
Generated on Fri Nov 15 2024 22:21:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AddAuthorizationHeaderFilter Member List

This is the complete list of members for AddAuthorizationHeaderFilter, including all inherited members.
AddAuthorizationHeaderFilter(IHttpFilter innerFilter) | AddAuthorizationHeaderFilter | [inline]
AuthorizationHeader | AddAuthorizationHeaderFilter | [private]
Dispose() | AddAuthorizationHeaderFilter | [inline]
innerFilter | AddAuthorizationHeaderFilter | [private]
KeyHost | AddAuthorizationHeaderFilter |
SendRequestAsync(HttpRequestMessage request) | AddAuthorizationHeaderFilter | [inline]
Generated on Fri Nov 15 2024 22:23:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingSessionScenario.h Source File

  • Logging
  • cpp

LoggingSessionScenario.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "LoggingScenarioEventArgs.h"
00009
00010 namespace SDKTemplate
00011 {
00012     ref class LoggingSessionScenario sealed
00013     {
00014     internal:
00015
00016         event StatusChangedHandler^ StatusChanged;
00017
00018         static property LoggingSessionScenario^ Instance
00019         {
00020             LoggingSessionScenario^ get()
00021             {
00022                 if (_instance == nullptr)
00023                 {
00024                     _instance = ref new LoggingSessionScenario();
00025                 }
00026                 return _instance;
00027             }
00028         }
00029
00030         property bool IsBusy
00031         {
00032             bool get() { return _isBusy; }
00033
00034         private:
00035
00036             void set(bool value)
00037             {
00038                 _isBusy = value;
00039                 StatusChanged(this, ref new LoggingScenarioEventArgs(LoggingScenarioEventType::BusyStatusChanged));
00040             }
00041         }
00042
00043         property int LogFileGeneratedCount
00044         {
00045             int get() { return _logFileGeneratedCount; }
00046         }
00047
00048         property bool LoggingEnabled
00049         {
00050             bool get() { return _session != nullptr; }
00051         }
00052
00053         bool ToggleLoggingEnabledDisabled();
00054         void StartLogging();
00055
00056         void PrepareToSuspend();
00057         void ResumeLoggingIfApplicable();
00058
00059         concurrency::task<void> DoScenarioAsync();
00060
00061     private:
00062
00063         LoggingSessionScenario();
00064         ~LoggingSessionScenario();
00065
00066         static void SetAppLocalSettingsValue(Platform::String^ key, Platform::Object^ value)
00067         {
00068             if (Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key))
00069             {
00070                 Windows::Storage::ApplicationData::Current->LocalSettings->Values->Remove(key);
00071             }
00072             Windows::Storage::ApplicationData::Current->LocalSettings->Values->Insert(key, value);
00073         }
00074
00075         static bool IsAppLocalSettingsValue(Platform::String^ key)
00076         {
00077             return Windows::Storage::ApplicationData::Current->LocalSettings->Values->HasKey(key);
00078         }
00079
00080         static Platform::Object^ GetAppLocalSettingsValueAsObject(Platform::String^ key)
00081         {
00082             return Windows::Storage::ApplicationData::Current->LocalSettings->Values->Lookup(key);
00083         }
00084
00085         static bool GetAppLocalSettingsValueAsBool(Platform::String^ key)
00086         {
00087             Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
00088             return safe_cast<bool>(obj);
00089         }
00090
00091         static Platform::String^ GetAppLocalSettingsValueAsString(Platform::String^ key)
00092         {
00093             Platform::Object^ obj = GetAppLocalSettingsValueAsObject(key);
00094             return safe_cast<Platform::String^>(obj);
00095         }
00096
00097         static LoggingSessionScenario^ _instance;
00098         Windows::Foundation::Diagnostics::LoggingSession^ _session;
00099         Windows::Foundation::Diagnostics::LoggingChannel^ _channel;
00100
00101         long _logFileGeneratedCount;
00102         bool _isBusy;
00103
00104         // The following are set when a LoggingChannel
00105         // calls OnChannelLoggingEnabled:
00106         bool _isChannelEnabled;
00107         Windows::Foundation::Diagnostics::LoggingLevel _channelLoggingLevel;
00108         Windows::Foundation::EventRegistrationToken _onChannelLoggingEnabledToken;
00109         void OnChannelLoggingEnabled(Windows::Foundation::Diagnostics::ILoggingChannel ^sender, Platform::Object ^args);
00110
00111         concurrency::task<Windows::Storage::StorageFile^> SaveLogInMemoryToFileAsync();
00112         void OnAppSuspending(Platform::Object ^sender, Windows::ApplicationModel::SuspendingEventArgs ^e);
00113         void OnAppResuming(Platform::Object ^sender, Platform::Object ^args);
00114     };
00115 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.h Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

GraphicsCamera.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 ref class FirstPersonCamera sealed
00015 {
00016 public:
00017     FirstPersonCamera();
00018
00019     void Update(float dt);
00020     void Reset();
00021
00022     Windows::Foundation::Numerics::float4x4 GetWorldToCamera();
00023     Windows::Foundation::Numerics::float4x4 GetCameraToWorld();
00024
00025 private:
00026     void OnPointerMoved(
00027         Windows::UI::Core::CoreWindow^ window,
00028         Windows::UI::Core::PointerEventArgs^ args);
00029
00030     void RotateYaw(float radians);
00031     void RotatePitch(float radians);
00032
00033     void MoveAlongX(float distance);
00034     void MoveAlongY(float distance);
00035     void MoveAlongZ(float distance);
00036
00037     // Parameters for configuring the camera movement speed
00038     static constexpr float cPixelsToRadians = 0.00125f;
00039     static constexpr float cPixelsToMeters = 0.005f;
00040     static constexpr float cMovementMetersPerSecond = 1.0f;
00041     static constexpr float cRotationRadiansPerSecond = 1.0f;
00042     static constexpr float cPixelsToRadiansPerSecond = cPixelsToRadians * cRotationRadiansPerSecond;
00043     static constexpr float cPixelsToMetersPerSecond = cPixelsToMeters * cMovementMetersPerSecond;
00044
00045     Windows::Foundation::Numerics::float3 m_position;
00046     Windows::Foundation::Point m_prevCursor;
00047
00048     float m_yawAngle;
00049     float m_pitchAngle;
00050 };
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario4_Snapshot.xaml.h Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario4_Snapshot.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario4_Snapshot.g.h"
00006 #include "MainPage.xaml.h"
00007 #include "DisplayHelpers.h"
00008
00009 namespace SDKTemplate
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     [Windows::Foundation::Metadata::WebHostHidden]
00015     public ref class Scenario4_Snapshot sealed
00016     {
00017     public:
00018         Scenario4_Snapshot();
00019
00020     protected:
00021         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00022
00023     private:
00024         void FindButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00025
00026         MainPage^ rootPage = MainPage::Current;
00027         Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>();
00028     };
00029 }
Generated on Fri Nov 15 2024 22:19:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/SampleConfiguration.h Source File

  • FileSearch
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlDocument/cs/Scenario4_GiftDispatch.xaml.cs Source File

  • XmlDocument
  • cs

Scenario4_GiftDispatch.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Text;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace Xml
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class GiftDispatch : Page
00027     {
00028         private MainPage rootPage;
00029
00030         public GiftDispatch()
00031         {
00032             this.InitializeComponent();
00033
00034             Scenario4Init();
00035         }
00036
00037         /// <summary>
00038         /// Invoked when this page is about to be displayed in a Frame.
00039         /// </summary>
00040         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00041         /// property is typically used to configure the page.</param>
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             rootPage = MainPage.Current;
00045         }
00046
00047         async void Scenario4Init()
00048         {
00049             try
00050             {
00051                 Windows.Data.Xml.Dom.XmlDocument doc = await Scenario.LoadXmlFile("giftDispatch", "employees.xml");
00052                 Scenario.RichEditBoxSetMsg(scenario4OriginalData, doc.GetXml(), true);
00053             }
00054             catch (Exception exp)
00055             {
00056                 Scenario.RichEditBoxSetError(scenario4Result, exp.Message);
00057                 rootPage.NotifyUser("Exception occured while loading xml file!", NotifyType.ErrorMessage);
00058             }
00059         }
00060
00061         /// <summary>
00062         /// This is the click handler for the 'Scenario4BtnDefault' button.
00063         /// </summary>
00064         /// <param name="sender"></param>
00065         /// <param name="e"></param>
00066         private void Scenario4BtnDefault_Click(object sender, RoutedEventArgs e)
00067         {
00068             String xml;
00069             scenario4OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
00070
00071             var doc = new Windows.Data.Xml.Dom.XmlDocument();
00072             doc.LoadXml(xml);
00073
00074             var thisYear = 2012;    // Here we don't use DateTime.Now.Year to get the current year so that all gifts can be delivered.
00075             var previousOneYear = thisYear - 1;
00076             var previousFiveYear = thisYear - 5;
00077             var previousTenYear = thisYear - 10;
00078
00079             var xpathArray = new String[3];
00080             // select >= 1 year and < 5 years
00081             xpathArray[0] = "descendant::employee[startyear <= " + previousOneYear + " and startyear > " + previousFiveYear + "]";
00082             // select >= 5 years and < 10 years
00083             xpathArray[1] = "descendant::employee[startyear <= " + previousFiveYear + " and startyear > " + previousTenYear + "]";
00084             // select >= 10 years
00085             xpathArray[2] = "descendant::employee[startyear <= " + previousTenYear + "]";
00086
00087             var Gifts = new String[3] { "Gift Card", "XBOX", "Windows Phone" };
00088
00089             var output = new StringBuilder();
00090             uint i = 0;
00091             foreach (var xpath in xpathArray)
00092             {
00093                 var employees = doc.SelectNodes(xpath);
00094                 foreach (var emplopyee in employees)
00095                 {
00096                     var employeeName = emplopyee.SelectSingleNode("descendant::name");
00097                     var department = emplopyee.SelectSingleNode("descendant::department");
00098
00099                     output.AppendFormat("[{0}]/[{1}]/[{2}]\n", employeeName.FirstChild.NodeValue, department.FirstChild.NodeValue, Gifts[(i++) % 3]);
00100                 }
00101             }
00102
00103             Scenario.RichEditBoxSetMsg(scenario4Result, output.ToString(), true);
00104         }
00105     }
00106 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario7_ScrollingContentUsingMarquee.xaml.h Source File

  • LineDisplay
  • cpp

Scenario7_ScrollingContentUsingMarquee.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario7_ScrollingContentUsingMarquee.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     [Windows::UI::Xaml::Data::Bindable]
00021     public ref class Scenario7_ScrollingContentUsingMarquee sealed
00022     {
00023     public:
00024         Scenario7_ScrollingContentUsingMarquee();
00025
00026     protected:
00027         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         MainPage^ rootPage = MainPage::Current;
00032         Windows::Devices::PointOfService::ClaimedLineDisplay^ lineDisplay;
00033
00034         Windows::Devices::PointOfService::LineDisplayWindow^ horizontalScrollableWindow;
00035         Windows::Devices::PointOfService::LineDisplayWindow^ verticalScrollableWindow;
00036
00037         Concurrency::task<void> InitializeAsync();
00038         Concurrency::task<void> StopAllScrollingAsync();
00039
00040         void ResetButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void StartScrollingButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void StopScrollingButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043     };
00044 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario3_HardwareDRM.xaml.cs Source File

  • PlayReady
  • cs

Scenario3_HardwareDRM.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.ViewModels;
00013 using Windows.UI.Xaml.Controls;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario3_HardwareDRM : Page
00018     {
00019         public Scenario3_HardwareDRM()
00020         {
00021             this.InitializeComponent();
00022             this.DataContext = new HardwareDRMViewModel(mediaElement);
00023         }
00024     }
00025 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario3_Calibration.xaml.cpp Source File

  • OrientationSensor
  • cpp

Scenario3_Calibration.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_Calibration.xaml.cpp
00014 // Implementation of the Scenario3_Calibration class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_Calibration.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario3_Calibration::Scenario3_Calibration() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033     calibrationBar = ref new CalibrationBar();
00034
00035     if (rootPage->SensorReadingType == SensorReadingType::Relative)
00036     {
00037         EnabledContent->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00038         DisabledContent->Visibility = Windows::UI::Xaml::Visibility::Visible;
00039     }
00040 }
00041
00042 void Scenario3_Calibration::OnNavigatedFrom(NavigationEventArgs^ e)
00043 {
00044     calibrationBar->Hide();
00045 }
00046
00047 /// <summary>
00048 /// This is the click handler for high accuracy. Acceptable accuracy met, so
00049 /// hide the calibration bar.
00050 /// </summary>
00051 /// <param name="sender"></param>
00052 /// <param name="e"></param>
00053 void Scenario3_Calibration::OnHighAccuracy()
00054 {
00055     calibrationBar->Hide();
00056 }
00057
00058 /// <summary>
00059 /// This is the click handler for approximate accuracy. Acceptable accuracy met, so
00060 /// hide the calibration bar.
00061 /// </summary>
00062 /// <param name="sender"></param>
00063 /// <param name="e"></param>
00064 void Scenario3_Calibration::OnApproximateAccuracy()
00065 {
00066     calibrationBar->Hide();
00067 }
00068
00069 /// <summary>
00070 /// This is the click handler for unreliable accuracy. Sensor does not meet accuracy
00071 /// requirements. Request to show the calibration bar per the calibration guidance.
00072 /// </summary>
00073 /// <param name="sender"></param>
00074 /// <param name="e"></param>
00075 void Scenario3_Calibration::OnUnreliableAccuracy()
00076 {
00077     calibrationBar->RequestCalibration(MagnetometerAccuracy::Unreliable);
00078 }
Generated on Fri Nov 15 2024 22:18:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTailoredMultipleViews/cs/TailoredMultipleViews/MainPage_OneHanded.xaml.cs Source File

  • XamlTailoredMultipleViews
  • cs
  • TailoredMultipleViews

MainPage_OneHanded.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.Foundation;
00007 using Windows.Foundation.Collections;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Controls.Primitives;
00011 using Windows.UI.Xaml.Data;
00012 using Windows.UI.Xaml.Input;
00013 using Windows.UI.Xaml.Media;
00014 using Windows.UI.Xaml.Navigation;
00015
00016 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00017
00018 namespace OneHandedUse_TailoredMultipleViews
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     public sealed partial class MainPage_OneHanded : Page
00024     {
00025         public MainPage_OneHanded()
00026         {
00027             this.InitializeComponent();
00028         }
00029     }
00030 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cs/Scenario3_MultipleDrawers.xaml.cs Source File

  • CashDrawer
  • cs

Scenario3_MultipleDrawers.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.PointOfService;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class Scenario3_MultipleDrawers : Page
00028     {
00029         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00030         // as NotifyUser()
00031         MainPage rootPage = MainPage.Current;
00032
00033         CashDrawer cashDrawerInstance1 = null;
00034         CashDrawer cashDrawerInstance2 = null;
00035         ClaimedCashDrawer claimedCashDrawerInstance1 = null;
00036         ClaimedCashDrawer claimedCashDrawerInstance2 = null;
00037
00038
00039         public Scenario3_MultipleDrawers()
00040         {
00041             this.InitializeComponent();
00042         }
00043
00044         /// <summary>
00045         /// Enumerator for current active Instance.
00046         /// </summary>
00047         private enum CashDrawerInstance
00048         {
00049             Instance1,
00050             Instance2
00051         }
00052
00053         /// <summary>
00054         /// Invoked when this page is about to be displayed in a Frame.
00055         /// </summary>
00056         /// <param name="e">Event data that describes how this page was reached.</param>
00057         protected override void OnNavigatedTo(NavigationEventArgs e)
00058         {
00059             ResetScenarioState();
00060             base.OnNavigatedTo(e);
00061         }
00062
00063         /// <summary>
00064         /// Invoked before the page is unloaded and is no longer the current source of a Frame.
00065         /// </summary>
00066         /// <param name="e">Event data describing the navigation that was requested.</param>
00067         protected override void OnNavigatedFrom(NavigationEventArgs e)
00068         {
00069             ResetScenarioState();
00070             base.OnNavigatedFrom(e);
00071         }
00072
00073         /// <summary>
00074         /// Creates the default cash drawer.
00075         /// </summary>
00076         /// <param name="instance">Specifies the cash drawer instance that should be used.</param>
00077         /// <returns>True if the cash drawer was created, false otherwise.</returns>
00078         private async Task<bool> CreateDefaultCashDrawerObject(CashDrawerInstance instance)
00079         {
00080             rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage);
00081
00082             CashDrawer tempDrawer = null;
00083             tempDrawer = await DeviceHelpers.GetFirstCashDrawerAsync();
00084
00085             if (tempDrawer == null)
00086             {
00087                 rootPage.NotifyUser("Cash drawer not found. Please connect a cash drawer.", NotifyType.ErrorMessage);
00088                 return false;
00089             }
00090
00091             switch (instance)
00092             {
00093                 case CashDrawerInstance.Instance1:
00094                     cashDrawerInstance1 = tempDrawer;
00095                     break;
00096                 case CashDrawerInstance.Instance2:
00097                     cashDrawerInstance2 = tempDrawer;
00098                     break;
00099                 default:
00100                     return false;
00101             }
00102
00103             return true;
00104         }
00105
00106         /// <summary>
00107         /// Attempt to claim the connected cash drawer.
00108         /// </summary>
00109         /// <param name="instance">Specifies the cash drawer instance that should be used.</param>
00110         /// <returns>True if the cash drawer was successfully claimed, false otherwise.</returns>
00111         private async Task<bool> ClaimCashDrawer(CashDrawerInstance instance)
00112         {
00113             bool claimAsyncStatus = false;
00114
00115             switch (instance)
00116             {
00117                 case CashDrawerInstance.Instance1:
00118
00119                     claimedCashDrawerInstance1 = await cashDrawerInstance1.ClaimDrawerAsync();
00120                     if (claimedCashDrawerInstance1 != null)
00121                     {
00122                         rootPage.NotifyUser("Successfully claimed instance 1.", NotifyType.StatusMessage);
00123                         claimAsyncStatus = true;
00124                     }
00125                     else
00126                     {
00127                         rootPage.NotifyUser("Failed to claim instance 1.", NotifyType.ErrorMessage);
00128                     }
00129                     break;
00130
00131                 case CashDrawerInstance.Instance2:
00132
00133                     claimedCashDrawerInstance2 = await cashDrawerInstance2.ClaimDrawerAsync();
00134                     if (claimedCashDrawerInstance2 != null)
00135                     {
00136                         rootPage.NotifyUser("Successfully claimed instance 2.", NotifyType.StatusMessage);
00137                         claimAsyncStatus = true;
00138                     }
00139                     else
00140                     {
00141                         rootPage.NotifyUser("Failed to claim instance 2.", NotifyType.ErrorMessage);
00142                     }
00143                     break;
00144
00145                 default:
00146                     break;
00147             }
00148
00149             return claimAsyncStatus;
00150         }
00151
00152         /// <summary>
00153         /// Event callback for claim instance 1 button.
00154         /// </summary>
00155         /// <param name="sender">Button that was clicked.</param>
00156         /// <param name="e">Event data associated with click event.</param>
00157         private async void ClaimButton1_Click(object sender, RoutedEventArgs e)
00158         {
00159             if (await CreateDefaultCashDrawerObject(CashDrawerInstance.Instance1))
00160             {
00161                 if (await ClaimCashDrawer(CashDrawerInstance.Instance1))
00162                 {
00163                     claimedCashDrawerInstance1.ReleaseDeviceRequested += claimedCashDrawerInstance1_ReleaseDeviceRequested;
00164                     SetClaimedUI(CashDrawerInstance.Instance1);
00165                 }
00166                 else
00167                 {
00168                     cashDrawerInstance2 = null;
00169                 }
00170             }
00171         }
00172
00173         /// <summary>
00174         /// Event callback for claim instance 2 button.
00175         /// </summary>
00176         /// <param name="sender">Button that was clicked.</param>
00177         /// <param name="e">Event data associated with click event.</param>
00178         private async void ClaimButton2_Click(object sender, RoutedEventArgs e)
00179         {
00180             if (await CreateDefaultCashDrawerObject(CashDrawerInstance.Instance2))
00181             {
00182                 if (await ClaimCashDrawer(CashDrawerInstance.Instance2))
00183                 {
00184                     claimedCashDrawerInstance2.ReleaseDeviceRequested += claimedCashDrawerInstance2_ReleaseDeviceRequested;
00185                     SetClaimedUI(CashDrawerInstance.Instance2);
00186                 }
00187                 else
00188                 {
00189                     cashDrawerInstance2 = null;
00190                 }
00191             }
00192         }
00193
00194         /// <summary>
00195         /// Event callback for release instance 1 button.
00196         /// </summary>
00197         /// <param name="sender">Button that was clicked.</param>
00198         /// <param name="e">Event data associated with click event.</param>
00199         private void ReleaseButton1_Click(object sender, RoutedEventArgs e)
00200         {
00201             if (claimedCashDrawerInstance1 != null)
00202             {
00203                 claimedCashDrawerInstance1.Dispose();
00204                 claimedCashDrawerInstance1 = null;
00205
00206                 SetReleasedUI(CashDrawerInstance.Instance1);
00207
00208                 rootPage.NotifyUser("Claimed instance 1 was released.", NotifyType.StatusMessage);
00209             }
00210
00211             if (cashDrawerInstance1 != null)
00212             {
00213                 cashDrawerInstance1.Dispose();
00214                 cashDrawerInstance1 = null;
00215             }
00216         }
00217
00218         /// <summary>
00219         /// Event callback for release instance 2 button.
00220         /// </summary>
00221         /// <param name="sender">Button that was clicked.</param>
00222         /// <param name="e">Event data associated with click event.</param>
00223         private void ReleaseButton2_Click(object sender, RoutedEventArgs e)
00224         {
00225             if (claimedCashDrawerInstance2 != null)
00226             {
00227                 claimedCashDrawerInstance2.Dispose();
00228                 claimedCashDrawerInstance2 = null;
00229
00230                 SetReleasedUI(CashDrawerInstance.Instance2);
00231
00232                 rootPage.NotifyUser("Claimed instance 2 was released.", NotifyType.StatusMessage);
00233             }
00234
00235             if (cashDrawerInstance2 != null)
00236             {
00237                 cashDrawerInstance2.Dispose();
00238                 cashDrawerInstance2 = null;
00239             }
00240         }
00241
00242         /// <summary>
00243         /// Event callback for a release device request for instance 1.
00244         /// </summary>
00245         /// <param name="sender">The drawer receiving the release device request.</param>
00246         /// <param name="e">Unused for ReleaseDeviceRequested events.</param>
00247         private async void claimedCashDrawerInstance1_ReleaseDeviceRequested(ClaimedCashDrawer sender, object e)
00248         {
00249             await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00250             {
00251                 rootPage.NotifyUser("Release instance 1 requested.", NotifyType.StatusMessage);
00252
00253                 if (RetainCheckBox1.IsChecked == true)
00254                 {
00255                     if (await claimedCashDrawerInstance1.RetainDeviceAsync() == false)
00256                         rootPage.NotifyUser("Cash drawer instance 1 retain failed.", NotifyType.ErrorMessage);
00257                 }
00258                 else
00259                 {
00260                     claimedCashDrawerInstance1.Dispose();
00261                     claimedCashDrawerInstance1 = null;
00262
00263                     if (cashDrawerInstance1 != null)
00264                     {
00265                         cashDrawerInstance1.Dispose();
00266                         cashDrawerInstance1 = null;
00267                     }
00268
00269                     SetReleasedUI(CashDrawerInstance.Instance1);
00270                 }
00271             });
00272         }
00273
00274         /// <summary>
00275         /// Event callback for a release device request for instance 2.
00276         /// </summary>
00277         /// <param name="sender">The drawer receiving the release device request.</param>
00278         /// <param name="e">Unused for ReleaseDeviceRequested events.</param>
00279         private async void claimedCashDrawerInstance2_ReleaseDeviceRequested(ClaimedCashDrawer drawer, object e)
00280         {
00281             await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
00282             {
00283                 rootPage.NotifyUser("Release instance 2 requested.", NotifyType.StatusMessage);
00284
00285                 if (RetainCheckBox2.IsChecked == true)
00286                 {
00287                     if (await claimedCashDrawerInstance2.RetainDeviceAsync() == false)
00288                         rootPage.NotifyUser("Cash drawer instance 2 retain failed.", NotifyType.ErrorMessage);
00289                 }
00290                 else
00291                 {
00292                     claimedCashDrawerInstance2.Dispose();
00293                     claimedCashDrawerInstance2 = null;
00294
00295                     if (cashDrawerInstance2 != null)
00296                     {
00297                         cashDrawerInstance2.Dispose();
00298                         cashDrawerInstance2 = null;
00299                     }
00300
00301                     SetReleasedUI(CashDrawerInstance.Instance2);
00302                 }
00303             });
00304         }
00305
00306         /// <summary>
00307         /// Resets the display elements to original state
00308         /// </summary>
00309         private void ResetScenarioState()
00310         {
00311             if (claimedCashDrawerInstance1 != null)
00312             {
00313                 claimedCashDrawerInstance1.Dispose();
00314                 claimedCashDrawerInstance1 = null;
00315             }
00316
00317             if (claimedCashDrawerInstance2 != null)
00318             {
00319                 claimedCashDrawerInstance2.Dispose();
00320                 claimedCashDrawerInstance2 = null;
00321             }
00322
00323             if (cashDrawerInstance1 != null)
00324             {
00325                 cashDrawerInstance1.Dispose();
00326                 cashDrawerInstance1 = null;
00327             }
00328
00329             if (cashDrawerInstance2 != null)
00330             {
00331                 cashDrawerInstance2.Dispose();
00332                 cashDrawerInstance2 = null;
00333             }
00334
00335             ClaimButton1.IsEnabled = true;
00336             ClaimButton2.IsEnabled = true;
00337             ReleaseButton1.IsEnabled = false;
00338             ReleaseButton2.IsEnabled = false;
00339             RetainCheckBox1.IsChecked = true;
00340             RetainCheckBox2.IsChecked = true;
00341
00342             rootPage.NotifyUser("Click a claim button to begin.", NotifyType.StatusMessage);
00343         }
00344
00345         /// <summary>
00346         /// Sets the UI elements to a state corresponding to the specified instace being claimed.
00347         /// </summary>
00348         /// <param name="instance">Corresponds to instance that has been claimed.</param>
00349         private void SetClaimedUI(CashDrawerInstance instance)
00350         {
00351             switch (instance)
00352             {
00353                 case CashDrawerInstance.Instance1:
00354                     ClaimButton1.IsEnabled = false;
00355                     ClaimButton2.IsEnabled = true;
00356                     ReleaseButton1.IsEnabled = true;
00357                     ReleaseButton2.IsEnabled = false;
00358                     break;
00359
00360                 case CashDrawerInstance.Instance2:
00361                     ClaimButton1.IsEnabled = true;
00362                     ClaimButton2.IsEnabled = false;
00363                     ReleaseButton1.IsEnabled = false;
00364                     ReleaseButton2.IsEnabled = true;
00365                     break;
00366
00367                 default:
00368                     break;
00369             }
00370         }
00371
00372         /// <summary>
00373         /// Sets the UI elements to a state corresponding to the specified instace being released.
00374         /// </summary>
00375         /// <param name="instance">Corresponds to instance that has been released.</param>
00376         private void SetReleasedUI(CashDrawerInstance instance)
00377         {
00378             switch (instance)
00379             {
00380                 case CashDrawerInstance.Instance1:
00381                     ClaimButton1.IsEnabled = true;
00382                     ReleaseButton1.IsEnabled = false;
00383                     break;
00384
00385                 case CashDrawerInstance.Instance2:
00386                     ClaimButton2.IsEnabled = true;
00387                     ReleaseButton2.IsEnabled = false;
00388                     break;
00389
00390                 default:
00391                     break;
00392             }
00393         }
00394     }
00395 }
Generated on Fri Nov 15 2024 22:18:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/DeviceResources.h Source File

  • HolographicSpatialMapping
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "CameraResources.h"
00015
00016 namespace DX
00017 {
00018     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00019     interface IDeviceNotify
00020     {
00021         virtual void OnDeviceLost()     = 0;
00022         virtual void OnDeviceRestored() = 0;
00023     };
00024
00025     // Creates and manages a Direct3D device and immediate context, Direct2D device and context (for debug), and the holographic swap chain.
00026     class DeviceResources
00027     {
00028     public:
00029         DeviceResources();
00030
00031         // Public methods related to Direct3D devices.
00032         void HandleDeviceLost();
00033         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00034         void Trim();
00035         void Present(Windows::Graphics::Holographic::HolographicFrame^ frame);
00036
00037         // Public methods related to holographic devices.
00038         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ space);
00039         void EnsureCameraResources(
00040             Windows::Graphics::Holographic::HolographicFrame^ frame,
00041             Windows::Graphics::Holographic::HolographicFramePrediction^ prediction);
00042
00043         void AddHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00044         void RemoveHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00045
00046         // Holographic accessors.
00047         template<typename RetType, typename LCallback>
00048         RetType                 UseHolographicCameraResources(const LCallback& callback);
00049
00050         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^
00051                                 GetD3DInteropDevice() const             { return m_d3dInteropDevice;    }
00052
00053         // D3D accessors.
00054         ID3D11Device4*          GetD3DDevice() const                    { return m_d3dDevice.Get();     }
00055         ID3D11DeviceContext3*   GetD3DDeviceContext() const             { return m_d3dContext.Get();    }
00056         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel;     }
00057         bool                    GetDeviceSupportsVprt() const           { return m_supportsVprt;        }
00058
00059         // DXGI acessors.
00060         IDXGIAdapter3*          GetDXGIAdapter() const                  { return m_dxgiAdapter.Get();   }
00061
00062         // D2D accessors.
00063         ID2D1Factory2*          GetD2DFactory() const                   { return m_d2dFactory.Get();    }
00064         IDWriteFactory2*        GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00065         IWICImagingFactory2*    GetWicImagingFactory() const            { return m_wicFactory.Get();    }
00066
00067     private:
00068         // Private methods related to the Direct3D device, and resources based on that device.
00069         void CreateDeviceIndependentResources();
00070         void InitializeUsingHolographicSpace();
00071         void CreateDeviceResources();
00072
00073         // Direct3D objects.
00074         Microsoft::WRL::ComPtr<ID3D11Device4>                   m_d3dDevice;
00075         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>            m_d3dContext;
00076         Microsoft::WRL::ComPtr<IDXGIAdapter3>                   m_dxgiAdapter;
00077
00078         // Direct3D interop objects.
00079         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^ m_d3dInteropDevice;
00080
00081         // Direct2D factories.
00082         Microsoft::WRL::ComPtr<ID2D1Factory2>                   m_d2dFactory;
00083         Microsoft::WRL::ComPtr<IDWriteFactory2>                 m_dwriteFactory;
00084         Microsoft::WRL::ComPtr<IWICImagingFactory2>             m_wicFactory;
00085
00086         // The holographic space provides a preferred DXGI adapter ID.
00087         Windows::Graphics::Holographic::HolographicSpace^       m_holographicSpace = nullptr;
00088
00089         // Properties of the Direct3D device currently in use.
00090         D3D_FEATURE_LEVEL                                       m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0;
00091
00092         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00093         IDeviceNotify*                                          m_deviceNotify = nullptr;
00094
00095         // Whether or not the current Direct3D device supports the optional feature
00096         // for setting the render target array index from the vertex shader stage.
00097         bool                                                    m_supportsVprt = false;
00098
00099         // Back buffer resources, etc. for attached holographic cameras.
00100         std::map<UINT32, std::unique_ptr<CameraResources>>      m_cameraResources;
00101         std::mutex                                              m_cameraResourcesLock;
00102     };
00103 }
00104
00105 // Device-based resources for holographic cameras are stored in a std::map. Access this list by providing a
00106 // callback to this function, and the std::map will be guarded from add and remove
00107 // events until the callback returns. The callback is processed immediately and must
00108 // not contain any nested calls to UseHolographicCameraResources.
00109 // The callback takes a parameter of type std::map<UINT32, std::unique_ptr<DX::CameraResources>>&
00110 // through which the list of cameras will be accessed.
00111 template<typename RetType, typename LCallback>
00112 RetType DX::DeviceResources::UseHolographicCameraResources(const LCallback& callback)
00113 {
00114     std::lock_guard<std::mutex> guard(m_cameraResourcesLock);
00115     return callback(m_cameraResources);
00116 }
00117
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/Tasks/pch.h Source File

  • BackgroundTask
  • cpp
  • Tasks

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include <collection.h>
00014 #include <ppltasks.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/pch.h Source File

  • HolographicSpatialStage
  • cpp

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <agile.h>
00004 #include <array>
00005 #include <d2d1_2.h>
00006 #include <d3d11_4.h>
00007 #include <DirectXColors.h>
00008 #include <dwrite_2.h>
00009 #include <map>
00010 #include <mutex>
00011 #include <vector>
00012 #include <wincodec.h>
00013 #include <WindowsNumerics.h>
00014
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/Account.cs Source File

  • KeyCredentialManager
  • cs

Account.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006
00007 namespace SDKTemplate
00008 {
00009     public class Account
00010     {
00011         public string Name { get; set; }
00012         public string Email { get; set; }
00013         public bool UsesPassport { get; set; }
00014     }
00015 }
Generated on Fri Nov 15 2024 22:20:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/Remove/ByTagAndGroup/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • Remove
  • ByTagAndGroup

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.Toasts.ToastNotificationManagerHistory.Remove.ByTagAndGroup
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         private static readonly string TAG_1 = "tag1";
00016         private static readonly string TAG_2 = "tag2";
00017         private static readonly string TAG_3 = "tag3";
00018
00019         private static readonly string GROUP_1 = "group1";
00020         private static readonly string GROUP_2 = "group2";
00021
00022         public ScenarioElement()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00028         {
00029             Initialize();
00030         }
00031
00032         private void Initialize()
00033         {
00034             // Clear all existing notifications
00035             ToastNotificationManager.History.Clear();
00036
00037             // Pop the toasts
00038             ToastHelper.PopToast("Group 1, Toast 1", "This is the first toast in group one", TAG_1, GROUP_1);
00039             ToastHelper.PopToast("Group 1, Toast 2 - TO BE REMOVED", "This is the second toast in group one, should be removed when you click the button", TAG_2, GROUP_1);
00040             ToastHelper.PopToast("Group 1, Toast 3", "This is the third toast in group one", TAG_3, GROUP_1);
00041
00042             ToastHelper.PopToast("Group 2, Toast 1", "This is the first toast in group two", TAG_1, GROUP_2);
00043             ToastHelper.PopToast("Group 2, Toast 2", "This is the second toast in group two", TAG_2, GROUP_2);
00044         }
00045
00046         private void ButtonRemoveToast2_Click(object sender, RoutedEventArgs e)
00047         {
00048             ToastNotificationManager.History.Remove(TAG_2, GROUP_1);
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NfcProvHeader Member List

This is the complete list of members for NfcProvHeader, including all inherited members.
index | NfcProvHeader
leading | NfcProvHeader
total | NfcProvHeader
version | NfcProvHeader
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LocationBackgroundTask Member List

This is the complete list of members for LocationBackgroundTask, including all inherited members.
LocationBackgroundTask() | LocationBackgroundTask |
m_mutex | LocationBackgroundTask | [private]
m_pendingOperation | LocationBackgroundTask | [private]
OnCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason) | LocationBackgroundTask | [private]
Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance) | LocationBackgroundTask |
WipeGeolocDataFromAppData() | LocationBackgroundTask | [private]
WriteGeolocToAppData(Windows::Devices::Geolocation::Geoposition const &pos) | LocationBackgroundTask | [private]
WriteStatusToAppData(hstring const &status) | LocationBackgroundTask | [private]
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/pch.h Source File

  • CameraFrames
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009 #include <shared_mutex>
00010
00011 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlaybackSynchronization/cs/Scenario1_MultiVideoPlayback.xaml.cs Source File

  • VideoPlaybackSynchronization
  • cs

Scenario1_MultiVideoPlayback.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Media;
00015 using Windows.Media.Core;
00016 using Windows.Media.Playback;
00017 using Windows.UI.Core;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// Multi-video playback control.
00026     /// </summary>
00027     public sealed partial class Scenario1_MultiVideoPlayback : Page
00028     {
00029         private MainPage rootPage = MainPage.Current;
00030
00031         private List<MediaPlayerElement> mediaPlayerElements;
00032         private MediaTimelineController timelineController = null;
00033         private TimeSpan maxNaturalDurationForController = TimeSpan.Zero;
00034
00035         // These videos will be played in the corresponding MediaPlayerElements.
00036         private Uri[] mediaUris = new Uri[5]
00037         {
00038                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right.mp4"),
00039                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-back-high.mp4"),
00040                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-back-low.mp4"),
00041                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-back.mp4"),
00042                 new Uri("https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/multiangle-right-shoulder.mp4"),
00043         };
00044
00045         public Scenario1_MultiVideoPlayback()
00046         {
00047             this.InitializeComponent();
00048             mediaPlayerElements = new List<MediaPlayerElement>() { mpeMain, mpeTL, mpeTR, mpeBL, mpeBR };
00049
00050             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00051             {
00052                 // Create a corresponding MediaPlayer for each MediaPlayerElement.
00053                 mpe.SetMediaPlayer(new MediaPlayer());
00054             }
00055         }
00056
00057         private void Page_OnUnloaded(object sender, RoutedEventArgs e)
00058         {
00059             // Dispose the MediaPlayer objects so they will stop streaming.
00060             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00061             {
00062                 MediaPlayer mp = mpe.MediaPlayer;
00063                 mp.MediaOpened -= MediaPlayer_MediaOpened;
00064                 mp.Dispose();
00065             }
00066         }
00067
00068         private void Page_OnLoaded(object sender, RoutedEventArgs e)
00069         {
00070             // Create a single MediaTimelineController which will control all of the MediaPlayers.
00071             timelineController = new MediaTimelineController();
00072
00073             foreach (MediaPlayerElement mpe in mediaPlayerElements)
00074             {
00075                 MediaPlayer mp = mpe.MediaPlayer;
00076
00077                 // The CommandManager object must be disabled when attaching a MediaTimelineController.
00078                 // The CommandManager is usually used to route play/pause/seek commands to the MediaPlayer,
00079                 // and apply additional business logic.
00080                 // In a TimelineController scenario, it is important to control the MediaPlayer via a single mechanism.
00081                 mp.CommandManager.IsEnabled = false;
00082                 // Similarly, adding a MediaTimelineController to MediaPlayer will disable media transport controls in the UI.
00083                 mp.TimelineController = timelineController;
00084
00085                 // As noted above, the transport controls are partially disabled due to the MediaTimelineController.
00086                 // To avoid confusing the user, it is best to turn them off.
00087                 mpe.AreTransportControlsEnabled = false;
00088
00089                 // MediaOpened is the right time to find the highest natural duration.
00090                 mp.MediaOpened += MediaPlayer_MediaOpened;
00091             }
00092
00093             // Use the MediaTimelineController.StateChanged to control the Play/Pause button content.
00094             timelineController.StateChanged += MediaTimelineController_StateChanged;
00095
00096             // Since this is a sample of video on demand, constrain the MediaTimelineController
00097             // to pause when it reaches the natural end of the last video.
00098             timelineController.PositionChanged += MediaTimelineController_PositionChanged;
00099
00100             // We are now set up to load content.
00101             Load.IsEnabled = true;
00102         }
00103
00104         private void MediaPlayer_MediaOpened(MediaPlayer sender, object args)
00105         {
00106             // Maintain maxNaturalDurationForController so it is as long as the longest media source.
00107             var naturalDurationForController = sender.PlaybackSession.NaturalDuration - sender.TimelineControllerPositionOffset;
00108             if (naturalDurationForController > maxNaturalDurationForController)
00109             {
00110                 maxNaturalDurationForController = naturalDurationForController;
00111             }
00112         }
00113
00114         private async void MediaTimelineController_StateChanged(MediaTimelineController sender, object args)
00115         {
00116             // Update the Play/Pause button based on the new state.
00117             Symbol newSymbol;
00118             switch (sender.State)
00119             {
00120                 case MediaTimelineControllerState.Paused:
00121                     newSymbol = Symbol.Play;
00122                     break;
00123
00124                 case MediaTimelineControllerState.Running:
00125                     newSymbol = Symbol.Pause;
00126                     break;
00127
00128                 default:
00129                     return;
00130             }
00131             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => PlayPauseIcon.Symbol = newSymbol);
00132         }
00133
00134         private void MediaTimelineController_PositionChanged(MediaTimelineController sender, object args)
00135         {
00136             // Pause when playback reaches the maximum duration.
00137             if (sender.Position > maxNaturalDurationForController)
00138             {
00139                 sender.Pause();
00140             }
00141         }
00142
00143         private void EnablePlaybackControls(bool enabled)
00144         {
00145             Seek10SecondsBack.IsEnabled = enabled;
00146             PlayPause.IsEnabled = enabled;
00147             Seek10SecondsForward.IsEnabled = enabled;
00148         }
00149
00150         /// <summary>
00151         /// Sets the content on the MediaPlayers
00152         /// </summary>
00153         private void Load_Click(object sender, RoutedEventArgs e)
00154         {
00155             EnablePlaybackControls(false);
00156
00157             // First reset the max duration, as the content is about to change.
00158             maxNaturalDurationForController = TimeSpan.Zero;
00159
00160             for (int i = 0; i < mediaUris.Length; i++)
00161             {
00162                 MediaPlayer mp = mediaPlayerElements[i].MediaPlayer;
00163
00164                 // Set the Source property to a MediaSource, MediaPlaybackItem or MediaPlaybackList.
00165                 mp.Source = MediaSource.CreateFromUri(mediaUris[i]);
00166
00167                 // In this demo, all of the videos has the same audio track, so mute all but the first one.
00168                 mp.IsMuted = (i != 0);
00169             }
00170
00171             // Enable our custom playback controls now that everything is set up.
00172             EnablePlaybackControls(true);
00173         }
00174
00175         private void PlayPause_Click(object sender, RoutedEventArgs e)
00176         {
00177             if (timelineController.State == MediaTimelineControllerState.Paused)
00178             {
00179                 timelineController.Resume();
00180             }
00181             else if (timelineController.State == MediaTimelineControllerState.Running)
00182             {
00183                 timelineController.Pause();
00184             }
00185         }
00186
00187         private void Seek10SecondsForward_Click(object sender, RoutedEventArgs e)
00188         {
00189             // Go forward 10 seconds, but not beyond our maximum value.
00190             var requestedPosition = timelineController.Position + TimeSpan.FromSeconds(10);
00191             if (requestedPosition <= maxNaturalDurationForController)
00192             {
00193                 timelineController.Position = requestedPosition;
00194             }
00195             else
00196             {
00197                 timelineController.Position = maxNaturalDurationForController;
00198             }
00199         }
00200
00201         private void Seek10SecondsBack_Click(object sender, RoutedEventArgs e)
00202         {
00203             timelineController.Position -= TimeSpan.FromSeconds(10);
00204         }
00205
00206     }
00207 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Item.cpp Source File

  • XamlListView
  • cppwinrt

Item.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Item.h"
00014 #include "Item.g.cpp"
00015
00016 using namespace winrt::Windows::Foundation;
00017 using namespace winrt::Windows::Foundation::Collections;
00018 using namespace winrt::Windows::UI::Xaml::Media;
00019 using namespace winrt::Windows::UI::Xaml::Media::Imaging;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     ImageSource Item::GenerateImageSource(int index)
00024     {
00025         static std::vector<BitmapImage> sources({
00026             BitmapImage(Uri(L"ms-appx:///Assets/cliff.jpg")),
00027             BitmapImage(Uri(L"ms-appx:///Assets/grapes_background.jpg")),
00028             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage13.jpg")),
00029             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage2.jpg")),
00030             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage24.jpg")),
00031             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage3.jpg")),
00032             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage6.jpg")),
00033             BitmapImage(Uri(L"ms-appx:///Assets/LandscapeImage7.jpg")),
00034             BitmapImage(Uri(L"ms-appx:///Assets/Ring01.jpg")),
00035             BitmapImage(Uri(L"ms-appx:///Assets/Ring03Part1.jpg")),
00036             BitmapImage(Uri(L"ms-appx:///Assets/Ring03Part3.jpg")),
00037             BitmapImage(Uri(L"ms-appx:///Assets/sunset.jpg")),
00038             });
00039
00040         return sources[index % sources.size()];
00041     }
00042
00043     IObservableVector<SDKTemplate::Item> Item::GetItems(int count)
00044     {
00045         std::vector<SDKTemplate::Item> items;
00046         std::generate_n(std::back_inserter(items), count, [i = 0]() mutable { return make<Item>(i++); });
00047         return single_threaded_observable_vector(std::move(items));
00048     }
00049 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/Scenario1_ReactiveRequest.xaml.cs Source File

  • PlayReady
  • cs

Scenario1_ReactiveRequest.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.ViewModels;
00013 using Windows.UI.Xaml.Controls;
00014
00015 namespace SDKTemplate
00016 {
00017     /// <summary>
00018     /// This Scenario demonstrates simple Reactive license Acquisition
00019     /// </summary>
00020     public sealed partial class Scenario1_ReactiveRequest : Page
00021     {
00022         public Scenario1_ReactiveRequest()
00023         {
00024             this.InitializeComponent();
00025             this.DataContext = new ReactiveViewModel(mediaElement);
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/SampleConfiguration.cpp Source File

  • ApplicationData
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"ApplicationData C++/WinRT Sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Files", xaml_typename<SDKTemplate::Scenario1_Files>() },
00029     Scenario{ L"Settings", xaml_typename<SDKTemplate::Scenario2_Settings>() },
00030     Scenario{ L"Setting Containers", xaml_typename<SDKTemplate::Scenario3_SettingContainer>() },
00031     Scenario{ L"Composite Settings", xaml_typename<SDKTemplate::Scenario4_CompositeSettings>() },
00032     Scenario{ L"ms-appdata:// Protocol", xaml_typename<SDKTemplate::Scenario5_Msappdata>() },
00033     Scenario{ L"Clear", xaml_typename<SDKTemplate::Scenario6_ClearScenario>() },
00034     Scenario{ L"SetVersion", xaml_typename<SDKTemplate::Scenario7_SetVersion>() },
00035 });
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonClearBadge_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_DeviceUse Member List

This is the complete list of members for Scenario1_DeviceUse, including all inherited members.
_deviceUseBackgroundTaskRegistration | Scenario1_DeviceUse | [private]
_deviceUseTrigger | Scenario1_DeviceUse | [private]
_refreshTimer | Scenario1_DeviceUse | [private]
Accelerometer | Scenario1_DeviceUse | [private]
FindAndCancelExistingBackgroundTask() | Scenario1_DeviceUse | [inline, private]
OnBackgroundTaskCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e) | Scenario1_DeviceUse | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DeviceUse | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DeviceUse | [inline, protected]
RefreshTimer_Tick(object sender, object e) | Scenario1_DeviceUse | [inline, private]
rootPage | Scenario1_DeviceUse | [private]
Scenario1_DeviceUse() | Scenario1_DeviceUse | [inline]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DeviceUse | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DeviceUse | [inline, private]
StartSensorBackgroundTaskAsync(String deviceId) | Scenario1_DeviceUse | [inline, private]
VisibilityChanged(object sender, VisibilityChangedEventArgs e) | Scenario1_DeviceUse | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/PoseTrackingPreview/pch.h Source File

  • CameraStreamCorrelation
  • cpp
  • PoseTrackingPreview

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016 #include <Windows.Foundation.Numerics.h>
00017 #include <robuffer.h>
00018 #include <wrl.h>
00019
00020 #include <Mfobjects.h>
00021 #include <Mfapi.h>
00022
00023 #include <string>
00024 #include "BufferHelper.h"
00025
00026 // Because this function is only used to check the size of an IBuffer - which uses a capacity of type int, not size_t -
00027 // we return a uint32_t here.
00028 template<typename parentType, typename repeatedType, uint32_t declaredCount = 1>
00029 uint32_t sizeof_composedStructure(uint32_t effectiveCount)
00030 {
00031     return static_cast<uint32_t>(sizeof(parentType) + (static_cast<int32_t>(effectiveCount) - static_cast<int32_t>(declaredCount)) * sizeof(repeatedType));
00032 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cpp/Scenario1_Geotag.xaml.h Source File

  • Geotag
  • cpp

Scenario1_Geotag.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario1_Geotag.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario1_Geotag sealed
00015     {
00016     public:
00017         Scenario1_Geotag();
00018     protected:
00019         void ChooseFileButton_Click();
00020         void GetGeotagButton_Click();
00021         void SetGeotagFromGeolocatorButton_Click();
00022         void SetGeotagButton_Click();
00023     private:
00024         MainPage^ rootPage = MainPage::Current;
00025         Windows::Storage::StorageFile^ file = nullptr;
00026     };
00027 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePickerContracts/cs/Tasks/UpdateFileTask.cs Source File

  • FilePickerContracts
  • cs
  • Tasks

UpdateFileTask.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Threading.Tasks;
00003 using Windows.ApplicationModel.Background;
00004 using Windows.Storage.Provider;
00005 using Windows.UI.Notifications;
00006
00007 namespace FilePickerContractsTasks
00008 {
00009     public sealed class UpdateFileTask : IBackgroundTask
00010     {
00011         public void Run(IBackgroundTaskInstance taskInstance)
00012         {
00013             ShowToast("SampleFileProviderBackgroundTask.Run fired ");
00014
00015             var taskDeferral = taskInstance.GetDeferral();
00016
00017             CachedFileUpdaterTriggerDetails cachedFileUpdaterTriggerDetails = (CachedFileUpdaterTriggerDetails) taskInstance.TriggerDetails;
00018
00019             FileUpdateRequest fileUpdateRequest = cachedFileUpdaterTriggerDetails.UpdateRequest;
00020
00021             if (cachedFileUpdaterTriggerDetails.UpdateRequest.File.Name.Contains("ConflictingFile"))
00022             {
00023                 fileUpdateRequest.UserInputNeededMessage = "Need to Launch the app to resolve an update conflict.";
00024                 fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
00025             }
00026             else
00027             {
00028                 fileUpdateRequest.Status = FileUpdateStatus.Complete;
00029             }
00030
00031             taskDeferral.Complete();
00032         }
00033
00034         private void ShowToast(string message)
00035         {
00036             var toastXmlString = string.Format("<toast><visual version='1'><binding template='ToastText01'><text id='1'>{0}</text></binding></visual></toast>", message);
00037             var xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();
00038             xmlDoc.LoadXml(toastXmlString);
00039             var toast = new ToastNotification(xmlDoc);
00040             ToastNotificationManager.CreateToastNotifier().Show(toast);
00041         }
00042     }
00043 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/MyUserControl1.xaml.cpp Source File

  • XamlBind
  • cpp

MyUserControl1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // MyUserControl1.xaml.cpp
00003 // Implementation of the MyUserControl1 class
00004 //
00005
00006 #include "pch.h"
00007 #include "MyUserControl1.xaml.h"
00008
00009 using namespace SDKTemplate;
00010
00011 using namespace Platform;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::UI::Xaml;
00015 using namespace Windows::UI::Xaml::Controls;
00016 using namespace Windows::UI::Xaml::Controls::Primitives;
00017 using namespace Windows::UI::Xaml::Data;
00018 using namespace Windows::UI::Xaml::Input;
00019 using namespace Windows::UI::Xaml::Media;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00023
00024 MyUserControl1::MyUserControl1()
00025 {
00026     this->_nonDPProperty = "Value not set";
00027     InitializeComponent();
00028 }
Generated on Fri Nov 15 2024 22:22:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cpp/SampleConfiguration.h Source File

  • TextSuggestion
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Text Suggestion";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpinningCubeRenderer.cpp Source File

  • BasicHologram
  • cppwinrt
  • Content

SpinningCubeRenderer.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SpinningCubeRenderer.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 using namespace BasicHologram;
00006 using namespace DirectX;
00007 using namespace winrt::Windows::Foundation::Numerics;
00008 using namespace winrt::Windows::UI::Input::Spatial;
00009
00010 // Loads vertex and pixel shaders from files and instantiates the cube geometry.
00011 SpinningCubeRenderer::SpinningCubeRenderer(std::shared_ptr<DX::DeviceResources> const& deviceResources) :
00012     m_deviceResources(deviceResources)
00013 {
00014     CreateDeviceDependentResources();
00015 }
00016
00017 // This function uses a SpatialPointerPose to position the world-locked hologram
00018 // two meters in front of the user's heading.
00019 void SpinningCubeRenderer::PositionHologram(SpatialPointerPose const& pointerPose)
00020 {
00021     if (pointerPose != nullptr)
00022     {
00023         // Get the gaze direction relative to the given coordinate system.
00024         const float3 headPosition = pointerPose.Head().Position();
00025         const float3 headDirection = pointerPose.Head().ForwardDirection();
00026
00027         // The hologram is positioned two meters along the user's gaze direction.
00028         constexpr float distanceFromUser = 2.0f; // meters
00029         const float3 gazeAtTwoMeters = headPosition + (distanceFromUser * headDirection);
00030
00031         // This will be used as the translation component of the hologram's
00032         // model transform.
00033         SetPosition(gazeAtTwoMeters);
00034     }
00035 }
00036
00037 // Called once per frame. Rotates the cube, and calculates and sets the model matrix
00038 // relative to the position transform indicated by hologramPositionTransform.
00039 void SpinningCubeRenderer::Update(DX::StepTimer const& timer)
00040 {
00041     // Rotate the cube.
00042     // Convert degrees to radians, then convert seconds to rotation angle.
00043     const float    radiansPerSecond = XMConvertToRadians(m_degreesPerSecond);
00044     const double   totalRotation = timer.GetTotalSeconds() * radiansPerSecond;
00045     const float    radians = static_cast<float>(fmod(totalRotation, XM_2PI));
00046     const XMMATRIX modelRotation = XMMatrixRotationY(-radians);
00047
00048     // Position the cube.
00049     const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00050
00051     // Multiply to get the transform matrix.
00052     // Note that this transform does not enforce a particular coordinate system. The calling
00053     // class is responsible for rendering this content in a consistent manner.
00054     const XMMATRIX modelTransform = XMMatrixMultiply(modelRotation, modelTranslation);
00055
00056     // The view and projection matrices are provided by the system; they are associated
00057     // with holographic cameras, and updated on a per-camera basis.
00058     // Here, we provide the model transform for the sample hologram. The model transform
00059     // matrix is transposed to prepare it for the shader.
00060     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(modelTransform));
00061
00062     // Loading is asynchronous. Resources must be created before they can be updated.
00063     if (!m_loadingComplete)
00064     {
00065         return;
00066     }
00067
00068     // Use the D3D device context to update Direct3D device-based resources.
00069     const auto context = m_deviceResources->GetD3DDeviceContext();
00070
00071     // Update the model transform buffer for the hologram.
00072     context->UpdateSubresource(
00073         m_modelConstantBuffer.Get(),
00074         0,
00075         nullptr,
00076         &m_modelConstantBufferData,
00077         0,
00078         0
00079     );
00080 }
00081
00082 // Renders one frame using the vertex and pixel shaders.
00083 // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00084 // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00085 // a pass-through geometry shader is also used to set the render
00086 // target array index.
00087 void SpinningCubeRenderer::Render()
00088 {
00089     // Loading is asynchronous. Resources must be created before drawing can occur.
00090     if (!m_loadingComplete)
00091     {
00092         return;
00093     }
00094
00095     const auto context = m_deviceResources->GetD3DDeviceContext();
00096
00097     // Each vertex is one instance of the VertexPositionColor struct.
00098     const UINT stride = sizeof(VertexPositionColor);
00099     const UINT offset = 0;
00100     context->IASetVertexBuffers(
00101         0,
00102         1,
00103         m_vertexBuffer.GetAddressOf(),
00104         &stride,
00105         &offset
00106     );
00107     context->IASetIndexBuffer(
00108         m_indexBuffer.Get(),
00109         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00110         0
00111     );
00112     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00113     context->IASetInputLayout(m_inputLayout.Get());
00114
00115     // Attach the vertex shader.
00116     context->VSSetShader(
00117         m_vertexShader.Get(),
00118         nullptr,
00119         0
00120     );
00121     // Apply the model constant buffer to the vertex shader.
00122     context->VSSetConstantBuffers(
00123         0,
00124         1,
00125         m_modelConstantBuffer.GetAddressOf()
00126     );
00127
00128     if (!m_usingVprtShaders)
00129     {
00130         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00131         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00132         // a pass-through geometry shader is used to set the render target
00133         // array index.
00134         context->GSSetShader(
00135             m_geometryShader.Get(),
00136             nullptr,
00137             0
00138         );
00139     }
00140
00141     // Attach the pixel shader.
00142     context->PSSetShader(
00143         m_pixelShader.Get(),
00144         nullptr,
00145         0
00146     );
00147
00148     // Draw the objects.
00149     context->DrawIndexedInstanced(
00150         m_indexCount,   // Index count per instance.
00151         2,              // Instance count.
00152         0,              // Start index location.
00153         0,              // Base vertex location.
00154         0               // Start instance location.
00155     );
00156 }
00157
00158 std::future<void> SpinningCubeRenderer::CreateDeviceDependentResources()
00159 {
00160     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00161
00162     // On devices that do support the D3D11_FEATURE_D3D11_OPTIONS3::
00163     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature
00164     // we can avoid using a pass-through geometry shader to set the render
00165     // target array index, thus avoiding any overhead that would be
00166     // incurred by setting the geometry shader stage.
00167     std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";
00168
00169     // Shaders will be loaded asynchronously.
00170
00171     // After the vertex shader file is loaded, create the shader and input layout.
00172     std::vector<byte> vertexShaderFileData = await DX::ReadDataAsync(vertexShaderFileName);
00173     winrt::check_hresult(
00174         m_deviceResources->GetD3DDevice()->CreateVertexShader(
00175             vertexShaderFileData.data(),
00176             vertexShaderFileData.size(),
00177             nullptr,
00178             &m_vertexShader
00179         ));
00180
00181     constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 2> vertexDesc =
00182         { {
00183             { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00184             { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00185         } };
00186
00187     winrt::check_hresult(
00188         m_deviceResources->GetD3DDevice()->CreateInputLayout(
00189             vertexDesc.data(),
00190             static_cast<UINT>(vertexDesc.size()),
00191             vertexShaderFileData.data(),
00192             static_cast<UINT>(vertexShaderFileData.size()),
00193             &m_inputLayout
00194         ));
00195
00196     // After the pixel shader file is loaded, create the shader and constant buffer.
00197     std::vector<byte> pixelShaderFileData = await DX::ReadDataAsync(L"ms-appx:///PixelShader.cso");
00198     winrt::check_hresult(
00199         m_deviceResources->GetD3DDevice()->CreatePixelShader(
00200             pixelShaderFileData.data(),
00201             pixelShaderFileData.size(),
00202             nullptr,
00203             &m_pixelShader
00204         ));
00205
00206     const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00207     winrt::check_hresult(
00208         m_deviceResources->GetD3DDevice()->CreateBuffer(
00209             &constantBufferDesc,
00210             nullptr,
00211             &m_modelConstantBuffer
00212         ));
00213
00214
00215     if (!m_usingVprtShaders)
00216     {
00217         // Load the pass-through geometry shader.
00218         std::vector<byte> geometryShaderFileData = await DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
00219
00220         // After the pass-through geometry shader file is loaded, create the shader.
00221         winrt::check_hresult(
00222             m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00223                 geometryShaderFileData.data(),
00224                 geometryShaderFileData.size(),
00225                 nullptr,
00226                 &m_geometryShader
00227             ));
00228     }
00229
00230     // Load mesh vertices. Each vertex has a position and a color.
00231     // Note that the cube size has changed from the default DirectX app
00232     // template. Windows Holographic is scaled in meters, so to draw the
00233     // cube at a comfortable size we made the cube width 0.2 m (20 cm).
00234     static const std::array<VertexPositionColor, 8> cubeVertices =
00235         { {
00236             { XMFLOAT3(-0.1f, -0.1f, -0.1f), XMFLOAT3(0.0f, 0.0f, 0.0f) },
00237             { XMFLOAT3(-0.1f, -0.1f,  0.1f), XMFLOAT3(0.0f, 0.0f, 1.0f) },
00238             { XMFLOAT3(-0.1f,  0.1f, -0.1f), XMFLOAT3(0.0f, 1.0f, 0.0f) },
00239             { XMFLOAT3(-0.1f,  0.1f,  0.1f), XMFLOAT3(0.0f, 1.0f, 1.0f) },
00240             { XMFLOAT3( 0.1f, -0.1f, -0.1f), XMFLOAT3(1.0f, 0.0f, 0.0f) },
00241             { XMFLOAT3( 0.1f, -0.1f,  0.1f), XMFLOAT3(1.0f, 0.0f, 1.0f) },
00242             { XMFLOAT3( 0.1f,  0.1f, -0.1f), XMFLOAT3(1.0f, 1.0f, 0.0f) },
00243             { XMFLOAT3( 0.1f,  0.1f,  0.1f), XMFLOAT3(1.0f, 1.0f, 1.0f) },
00244         } };
00245
00246     D3D11_SUBRESOURCE_DATA vertexBufferData = { 0 };
00247     vertexBufferData.pSysMem = cubeVertices.data();
00248     vertexBufferData.SysMemPitch = 0;
00249     vertexBufferData.SysMemSlicePitch = 0;
00250     const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionColor) * static_cast<UINT>(cubeVertices.size()), D3D11_BIND_VERTEX_BUFFER);
00251     winrt::check_hresult(
00252         m_deviceResources->GetD3DDevice()->CreateBuffer(
00253             &vertexBufferDesc,
00254             &vertexBufferData,
00255             &m_vertexBuffer
00256         ));
00257
00258     // Load mesh indices. Each trio of indices represents
00259     // a triangle to be rendered on the screen.
00260     // For example: 2,1,0 means that the vertices with indexes
00261     // 2, 1, and 0 from the vertex buffer compose the
00262     // first triangle of this mesh.
00263     // Note that the winding order is clockwise by default.
00264     constexpr std::array<unsigned short, 36> cubeIndices =
00265         { {
00266             2,1,0, // -x
00267             2,3,1,
00268
00269             6,4,5, // +x
00270             6,5,7,
00271
00272             0,1,5, // -y
00273             0,5,4,
00274
00275             2,6,7, // +y
00276             2,7,3,
00277
00278             0,4,6, // -z
00279             0,6,2,
00280
00281             1,3,7, // +z
00282             1,7,5,
00283         } };
00284
00285     m_indexCount = static_cast<unsigned int>(cubeIndices.size());
00286
00287     D3D11_SUBRESOURCE_DATA indexBufferData = { 0 };
00288     indexBufferData.pSysMem = cubeIndices.data();
00289     indexBufferData.SysMemPitch = 0;
00290     indexBufferData.SysMemSlicePitch = 0;
00291     CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * static_cast<UINT>(cubeIndices.size()), D3D11_BIND_INDEX_BUFFER);
00292     winrt::check_hresult(
00293         m_deviceResources->GetD3DDevice()->CreateBuffer(
00294             &indexBufferDesc,
00295             &indexBufferData,
00296             &m_indexBuffer
00297         ));
00298
00299     // Once the cube is loaded, the object is ready to be rendered.
00300     m_loadingComplete = true;
00301 }
00302
00303 void SpinningCubeRenderer::ReleaseDeviceDependentResources()
00304 {
00305     m_loadingComplete = false;
00306     m_usingVprtShaders = false;
00307     m_vertexShader.Reset();
00308     m_inputLayout.Reset();
00309     m_pixelShader.Reset();
00310     m_geometryShader.Reset();
00311     m_modelConstantBuffer.Reset();
00312     m_vertexBuffer.Reset();
00313     m_indexBuffer.Reset();
00314 }
Generated on Fri Nov 15 2024 22:18:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AllJoynHelpers Member List

This is the complete list of members for AllJoynHelpers, including all inherited members.
AcceptSessionJoinerHandler(_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ PCSTR joiner, _In_ const alljoyn_sessionopts opts) | AllJoynHelpers | [inline, static]
AcceptSessionJoinerHandler(_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ PCSTR joiner, _In_ const alljoyn_sessionopts opts) | AllJoynHelpers | [inline, static]
CanSecure(_In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^authenticationMechanisms) | AllJoynHelpers | [static]
CanSecure(_In_ Windows::Foundation::Collections::IVector< Windows::Devices::AllJoyn::AllJoynAuthenticationMechanism >^authenticationMechanisms) | AllJoynHelpers | [static]
CreateBusObject(_Inout_ Platform::WeakReference *target) | AllJoynHelpers | [inline, static]
CreateBusObject(_Inout_ Platform::WeakReference *target) | AllJoynHelpers | [inline, static]
CreateInterfaces(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _In_ PCSTR introspectionXml) | AllJoynHelpers | [static]
CreateInterfaces(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _In_ PCSTR introspectionXml) | AllJoynHelpers | [static]
CreateProducerSession(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _Inout_ Platform::WeakReference *target) | AllJoynHelpers | [inline, static]
CreateProducerSession(_Inout_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment, _Inout_ Platform::WeakReference *target) | AllJoynHelpers | [inline, static]
GetInternalBusAttachment(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | AllJoynHelpers | [static]
GetInternalBusAttachment(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | AllJoynHelpers | [static]
GetInternalBusObject(_In_ Windows::Devices::AllJoyn::AllJoynBusObject^busObject) | AllJoynHelpers | [static]
GetInternalBusObject(_In_ Windows::Devices::AllJoyn::AllJoynBusObject^busObject) | AllJoynHelpers | [static]
GetObjectPath(_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName) | AllJoynHelpers | [static]
GetObjectPath(_In_ alljoyn_aboutobjectdescription objectDescription, _In_ PCSTR interfaceName) | AllJoynHelpers | [static]
MultibyteToPlatformString(_In_ PCSTR) | AllJoynHelpers | [static]
MultibyteToPlatformString(_In_ PCSTR) | AllJoynHelpers | [static]
PlatformToMultibyteString(_In_ Platform::String^str) | AllJoynHelpers | [static]
PlatformToMultibyteString(_In_ Platform::String^str) | AllJoynHelpers | [static]
PropertyChangedHandler(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated, _In_ void *context) | AllJoynHelpers | [inline, static]
PropertyChangedHandler(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated, _In_ void *context) | AllJoynHelpers | [inline, static]
PropertyGetHandler(_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value) | AllJoynHelpers | [inline, static]
PropertyGetHandler(_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value) | AllJoynHelpers | [inline, static]
PropertySetHandler(_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value) | AllJoynHelpers | [inline, static]
PropertySetHandler(_In_ const void *context, _In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg value) | AllJoynHelpers | [inline, static]
SessionJoinedHandler(_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner) | AllJoynHelpers | [inline, static]
SessionJoinedHandler(_In_ const void *context, _In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner) | AllJoynHelpers | [inline, static]
SessionLostHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason) | AllJoynHelpers | [inline, static]
SessionLostHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason) | AllJoynHelpers | [inline, static]
SessionMemberAddedHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | AllJoynHelpers | [inline, static]
SessionMemberAddedHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | AllJoynHelpers | [inline, static]
SessionMemberRemovedHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | AllJoynHelpers | [inline, static]
SessionMemberRemovedHandler(_In_ const void *context, _In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | AllJoynHelpers | [inline, static]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cs/Scenario5_RoundingAndPadding.xaml.cs Source File

  • NumberFormatting
  • cs

Scenario5_RoundingAndPadding.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Text;
00013 using Windows.Globalization.NumberFormatting;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario5_RoundingAndPadding : Page
00020     {
00021         public Scenario5_RoundingAndPadding()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         /// <summary>
00027         /// Used to display the rounding algorithm in a string format.  Used by the different scenarios when
00028         /// displaying results for the scenario
00029         /// </summary>
00030         /// <param name="roundingAlgorithm"></param>
00031         private string DisplayRoundingAlgorithmAsString(Windows.Globalization.NumberFormatting.RoundingAlgorithm roundingAlgorithm)
00032         {
00033             String roundingAsString = "";
00034
00035             // Convert the enumeration value into a string representation
00036             switch (roundingAlgorithm)
00037             {
00038                 case RoundingAlgorithm.None:
00039                     roundingAsString = "no";
00040                     break;
00041                 case RoundingAlgorithm.RoundAwayFromZero:
00042                     roundingAsString = "away from zero";
00043                     break;
00044                 case RoundingAlgorithm.RoundDown:
00045                     roundingAsString = "down";
00046                     break;
00047                 case RoundingAlgorithm.RoundHalfAwayFromZero:
00048                     roundingAsString = "half away from zero";
00049                     break;
00050                 case RoundingAlgorithm.RoundHalfDown:
00051                     roundingAsString = "half down";
00052                     break;
00053                 case RoundingAlgorithm.RoundHalfToEven:
00054                     roundingAsString = "half to even";
00055                     break;
00056                 case RoundingAlgorithm.RoundHalfToOdd:
00057                     roundingAsString = "half to odd";
00058                     break;
00059                 case RoundingAlgorithm.RoundHalfTowardsZero:
00060                     roundingAsString = "half towards zero";
00061                     break;
00062                 case RoundingAlgorithm.RoundHalfUp:
00063                     roundingAsString = "half up";
00064                     break;
00065                 case RoundingAlgorithm.RoundTowardsZero:
00066                     roundingAsString = "toward zero";
00067                     break;
00068                 case RoundingAlgorithm.RoundUp:
00069                     roundingAsString = "up";
00070                     break;
00071                 default:
00072                     roundingAsString = "unknown";
00073                     break;
00074             }
00075             return roundingAsString;
00076         }
00077
00078         /// <summary>
00079         /// Executes the padding scenarios.
00080         /// </summary>
00081         /// <param name="formatter">
00082         /// The formatter parameter can be either a DecimalFormatter, PercentFormatter
00083         /// PerMilleFormatter or CurrencyFormatter
00084         /// </param>
00085         private string DoPaddingScenarios(INumberFormatter formatter)
00086         {
00087             // Display the properties of the scenario
00088             StringBuilder results = new StringBuilder();
00089             results.Append("Padding with ");
00090             results.Append(((ISignificantDigitsOption) formatter).SignificantDigits + " significant digits, ");
00091             results.Append(((INumberFormatterOptions) formatter).IntegerDigits + " integer digits, ");
00092             results.Append(((INumberFormatterOptions) formatter).FractionDigits + " fractional digits\n\n");
00093
00094             // Iterate through the numbers to pad, format them and add them to the results
00095             double[] numbersToPad = new double[] { 0.12, 1.2, 10.2, 102 };
00096             foreach (double numberToPad in numbersToPad)
00097             {
00098                 string paddedNumber = formatter.Format(numberToPad);
00099                 results.Append("Value: " + numberToPad + " Padded: " + paddedNumber + "\n");
00100             }
00101
00102             // Add a carriage return at the end of the scenario for readability
00103             results.AppendLine();
00104             return results.ToString();
00105         }
00106
00107         /// <summary>
00108         /// Demonstrates how to perform padding and rounding by using the DecimalFormatter class (can be any of the
00109         /// formatter classes in the Windows.Globalization.Numberformatting namespace) and the IncrementNumberRounder
00110         /// to do so.  The SignificantDigitsNumberRounder can also be used instead of the latter.
00111         /// </summary>
00112         /// <param name="roundingAlgorithm"></param>
00113         /// <param name="significantDigits"></param>
00114         /// <param name="integerDigits"></param>
00115         /// <param name="fractionalDigits"></param>
00116         string DoPaddingAndRoundingScenarios(RoundingAlgorithm roundingAlgorithm, int significantDigits, int integerDigits, int fractionalDigits)
00117         {
00118             // Create the rounder and set the rounding algorithm provided as a parameter
00119             IncrementNumberRounder rounder = new Windows.Globalization.NumberFormatting.IncrementNumberRounder();
00120             rounder.RoundingAlgorithm = roundingAlgorithm;
00121
00122             // Create the formatter, set the padding properties provided as parameters and associate the rounder
00123             // we have just created
00124             DecimalFormatter formatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
00125             formatter.SignificantDigits = significantDigits;
00126             formatter.IntegerDigits = integerDigits;
00127             formatter.FractionDigits = fractionalDigits;
00128             formatter.NumberRounder = rounder;
00129
00130             // Stores the results
00131             StringBuilder results = new StringBuilder();
00132
00133             // Iterate through the increments we have defined in the scenario
00134             double[] incrementsToRound = new double[] { 0.001, 0.01, 0.1, 1.0 };
00135             foreach (double incrementToRound in incrementsToRound)
00136             {
00137                 // Set the increment to round to
00138                 rounder.Increment = incrementToRound;
00139
00140                 // Display the properties of the scenario
00141                 results.Append("Padding and rounding with ");
00142                 results.Append(formatter.SignificantDigits + " significant digits, ");
00143                 results.Append(formatter.IntegerDigits + " integer digits, ");
00144                 results.Append(formatter.FractionDigits + " fractional digits, ");
00145                 results.Append(rounder.Increment + " increment and ");
00146                 results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");
00147
00148                 // Iterate through the numbers to round and pad, format them and add them to the results
00149                 double[] numbersToFormat = new double[]  {0.1458, 1.458, 14.58, 145.8 };
00150                 foreach (double numberToFormat in numbersToFormat)
00151                 {
00152                     string formattedNumber = formatter.Format(numberToFormat);
00153                     results.Append("Value: " + numberToFormat + " Formatted: " + formattedNumber + "\n");
00154                 }
00155
00156                 // Add a carriage return at the end of the scenario for readability
00157                 results.AppendLine();
00158             }
00159
00160             return results.ToString();
00161         }
00162
00163         /// <summary>
00164         /// This scenario illustrates how to provide a rounding algorithm to a CurrencyFormatter class by means of the
00165         /// applyRoundingForCurrency method.  This will associate an IncrementNumberRounder using the same increment as the
00166         /// fractionDigits appropriate for the currency and language.  You can always choose to provide a different rounding
00167         /// algorithm by setting the numberRounder property, as depicted in the doPaddingAndRoundingScenarios function.
00168         /// The mechanism provided here is better suited for currencies.
00169         /// </summary>
00170         /// <param name="currencyCode"></param>
00171         /// <param name="roundingAlgorithm"></param>
00172         private string DoCurrencyRoundingScenarios(string currencyCode, RoundingAlgorithm roundingAlgorithm)
00173         {
00174             // Create the currency formatter and set the rounding algorithm provided as a parameter
00175             CurrencyFormatter currencyFormatter = new Windows.Globalization.NumberFormatting.CurrencyFormatter(currencyCode);
00176             currencyFormatter.ApplyRoundingForCurrency(roundingAlgorithm);
00177
00178             // Display the properties of the scenario
00179             StringBuilder results = new StringBuilder();
00180             results.Append("Currency formatting for ");
00181             results.Append(currencyFormatter.Currency + " currency and using the ");
00182             results.Append(DisplayRoundingAlgorithmAsString(roundingAlgorithm) + " rounding algorithm\n\n");
00183
00184             // Iterate through the numbers to round and add them to the results
00185             double[] numbersToFormat = new double[] { 14.55, 3.345, 16.2, 175.8 };
00186             foreach (double numberToFormat in numbersToFormat)
00187             {
00188                 string formattedNumber = currencyFormatter.Format(numberToFormat);
00189                 results.Append("Value: " + numberToFormat + " Formatted: " + formattedNumber + "\n");
00190             }
00191
00192             // Add a carriage return at the end of the scenario for readability
00193             results.AppendLine();
00194             return results.ToString();
00195         }
00196
00197         /// <summary>
00198         /// Shows how to do number rounding using the IncrementNumberRounding class.
00199         ///</summary>
00200         ///<param name="roundingAlgorithm"></param>
00201         private string DoIncrementRoundingScenarios(RoundingAlgorithm roundingAlgorithm)
00202         {
00203             // Create the rounder and set the rounding algorithm provided as a parameter
00204             IncrementNumberRounder rounder = new Windows.Globalization.NumberFormatting.IncrementNumberRounder();
00205             rounder.RoundingAlgorithm = roundingAlgorithm;
00206
00207             // Formatter to display the rounded value.  It is recommended to use the increment number
00208             // rounder within a formatter object to avoid precision issues when displaying.
00209             DecimalFormatter formatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
00210             formatter.NumberRounder = rounder;
00211
00212             // Stores the results
00213             StringBuilder results = new StringBuilder();
00214
00215             // Iterate through the increments we have defined in the scenario
00216             double[] incrementsToRound = new double[] { 0.001, 0.01, 0.1, 1.0 };
00217             foreach (double incrementToRound in incrementsToRound)
00218             {
00219                 // Set the significant digits to round to
00220                 rounder.Increment = incrementToRound;
00221
00222                 // Display the properties of the scenario
00223                 results.Append("Rounding with ");
00224                 results.Append(rounder.Increment + " increment and ");
00225                 results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");
00226
00227                 // Iterate through the numbers to round and add them to the results
00228                 double[] numbersToRound = new double[] { 0.1458, 1.458, 14.58, 145.8 };
00229                 foreach (double numberToRound in numbersToRound)
00230                 {
00231                     results.Append("Value: " + numberToRound + " Rounded: " + formatter.Format(numberToRound) + "\n");
00232                 }
00233
00234                 // Add a carriage return at the end of the scenario for readability
00235                 results.AppendLine();
00236             }
00237
00238             return results.ToString();
00239         }
00240
00241         /// <summary>
00242         /// Shows how to do number rounding using the SignificantDigitsNumberRounder class.
00243         /// </summary>
00244         /// <param name="roundingAlgorithm"></param>
00245         private string DoSignificantDigitRoundingScenarios(RoundingAlgorithm roundingAlgorithm)
00246         {
00247             // Create the rounder and set the rounding algorithm provided as a parameter.
00248             SignificantDigitsNumberRounder rounder = new Windows.Globalization.NumberFormatting.SignificantDigitsNumberRounder();
00249             rounder.RoundingAlgorithm = roundingAlgorithm;
00250
00251             // Stores the results
00252             StringBuilder results = new StringBuilder();
00253
00254             // Iterate through the significant digits we have defined in the scenario
00255             uint[] digitsToRound = new uint[] { 3, 2, 1 };
00256             foreach (uint digitToRound in digitsToRound)
00257             {
00258                 // Set the significant digits to round to
00259                 rounder.SignificantDigits = digitToRound;
00260
00261                 // Display the properties of the scenario
00262                 results.Append("Rounding with ");
00263                 results.Append(rounder.SignificantDigits + " significant digits and ");
00264                 results.Append(DisplayRoundingAlgorithmAsString(rounder.RoundingAlgorithm) + " rounding algorithm\n\n");
00265
00266                 // Iterate through the numbers to round and add them to the results
00267                 double[] numbersToRound = new double[] { 0.1458, 1.458, 14.58, 145.8 };
00268                 foreach (double numberToRound in numbersToRound)
00269                 {
00270                     double roundedValue = rounder.RoundDouble(numberToRound);
00271                     results.Append("Value: " + numberToRound + " Rounded: " + roundedValue + "\n");
00272                 }
00273
00274                 // Add a carriage return at the end of the scenario for readability
00275                 results.AppendLine();
00276             }
00277
00278             return results.ToString();
00279         }
00280
00281         /// <summary>
00282         /// This is the click handler for the 'Display' button.
00283         /// </summary>
00284         /// <param name="sender"></param>
00285         /// <param name="e"></param>
00286         private void Display_Click(object sender, RoutedEventArgs e)
00287         {
00288             // Variable where we keep results to display
00289             StringBuilder results = new StringBuilder();
00290
00291             // Create a decimal formatter used to do padding with only 4 significant digits.  We zero the
00292             // integerDigits and fractionDigits to only show the behavior of the significantDigits property
00293             // when formatting.
00294             DecimalFormatter decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
00295             decimalFormatter.SignificantDigits = 4;
00296             decimalFormatter.IntegerDigits = 0;
00297             decimalFormatter.FractionDigits = 0;
00298
00299             // Run through the scenarios with padding
00300             results.Append(DoPaddingScenarios(decimalFormatter));
00301
00302             // Create a percent formatter used to do padding with 4 significant digits, 2 minimum integer
00303             // digits, 2 minimum factional digits.  This will show how the behavior of the significantDigits
00304             // property in conjunction with the integerDigits and fractionDigits properties.
00305             PercentFormatter percentFormatter = new Windows.Globalization.NumberFormatting.PercentFormatter();
00306             percentFormatter.SignificantDigits = 4;
00307             percentFormatter.IntegerDigits = 2;
00308             percentFormatter.FractionDigits = 2;
00309
00310             // Run through the scenarios
00311             results.Append(DoPaddingScenarios(percentFormatter));
00312
00313             // Do the significant rounding scenarios with round up algorithm
00314             results.Append(DoSignificantDigitRoundingScenarios(RoundingAlgorithm.RoundUp));
00315
00316             // Do the significant rounding scenarios with round down algorithm
00317             results.Append(DoSignificantDigitRoundingScenarios(RoundingAlgorithm.RoundDown));
00318
00319             // Do the increment rounding scenarios with round half up algorithm
00320             results.Append(DoIncrementRoundingScenarios(RoundingAlgorithm.RoundHalfUp));
00321
00322             // Do the increment rounding scenarios with round half down algorithm
00323             results.Append(DoIncrementRoundingScenarios(RoundingAlgorithm.RoundHalfDown));
00324
00325             // Do currency formatting with rounding for Japanese Yen with round half to odd algorithm
00326             results.Append(DoCurrencyRoundingScenarios("JPY", RoundingAlgorithm.RoundHalfToOdd));
00327
00328             // Do currency formatting with rounding for Euro with round half to even algorithm
00329             results.Append(DoCurrencyRoundingScenarios("EUR", RoundingAlgorithm.RoundHalfToEven));
00330
00331             // Do padding and rounding scenarios using round half up algorithm
00332             results.Append(DoPaddingAndRoundingScenarios(RoundingAlgorithm.RoundHalfUp, 4, 3, 2));
00333
00334             // Do padding and rounding scenarios using round half down algorithm
00335             results.Append(DoPaddingAndRoundingScenarios(RoundingAlgorithm.RoundHalfDown, 4, 3, 2));
00336
00337             // Display the results
00338             OutputTextBlock.Text = results.ToString();
00339         }
00340     }
00341 }
Generated on Fri Nov 15 2024 22:20:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario9.xaml.cpp Source File

  • MapControl
  • cpp

Scenario9.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario9.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Maps;
00023
00024 Scenario9::Scenario9()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 void Scenario9::MyMap_Loaded(Object^ sender, RoutedEventArgs^ e)
00030 {
00031     myMap->Center = MainPage::SeattleGeopoint;
00032     myMap->ZoomLevel = 12;
00033     SetMapStyleSheet();
00034 }
00035
00036 void Scenario9::SetDefaultStyleCombobox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00037 {
00038     // Protect against events that are raised before we are fully initialized.
00039     if (myMap != nullptr)
00040     {
00041         SetMapStyleSheet();
00042     }
00043 }
00044
00045 void Scenario9::SetMapStyleSheet()
00046 {
00047     switch (setDefaultStyleCombobox->SelectedIndex)
00048     {
00049     case 0:
00050         myMap->StyleSheet = MapStyleSheet::Aerial();
00051         break;
00052     case 1:
00053         myMap->StyleSheet = MapStyleSheet::AerialWithOverlay();
00054         break;
00055     case 2:
00056         myMap->StyleSheet = MapStyleSheet::RoadDark();
00057         break;
00058     case 3:
00059         myMap->StyleSheet = MapStyleSheet::RoadLight();
00060         break;
00061     case 4:
00062         myMap->StyleSheet = MapStyleSheet::RoadHighContrastDark();
00063         break;
00064     case 5:
00065         myMap->StyleSheet = MapStyleSheet::RoadHighContrastLight();
00066         break;
00067     case 6:
00068         myMap->StyleSheet = MapStyleSheet::ParseFromJson(R"(
00069                 {
00070                     "version": "1.0",
00071                     "settings": {
00072                         "landColor": "#FFFFFF",
00073                         "spaceColor": "#000000"
00074                     },
00075                     "elements": {
00076                         "mapElement": {
00077                             "labelColor": "#000000",
00078                             "labelOutlineColor": "#FFFFFF"
00079                         },
00080                         "water": {
00081                             "fillColor": "#DDDDDD"
00082                         },
00083                         "area": {
00084                             "fillColor": "#EEEEEE"
00085                         },
00086                         "political": {
00087                             "borderStrokeColor": "#CCCCCC",
00088                             "borderOutlineColor": "#00000000"
00089                         }
00090                     }
00091                 }
00092             )");
00093         break;
00094     }
00095 }
Generated on Fri Nov 15 2024 22:20:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario1.xaml.cpp Source File

  • Compression
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.cpp
00013 // Implementation of the Scenario1 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario1.xaml.h"
00018 #include "CompressionUtils.h"
00019 #include <robuffer.h>
00020
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Navigation;
00024 using namespace Windows::UI::ViewManagement;
00025 using namespace Windows::Storage;
00026 using namespace Windows::Storage::Pickers;
00027 using namespace Windows::Storage::Streams;
00028 using namespace Windows::Storage::Compression;
00029 using namespace Windows::Foundation;
00030
00031 using namespace SDKTemplate::Compression;
00032
00033 using namespace concurrency;
00034
00035 using namespace std;
00036
00037 Scenario1::Scenario1()
00038 {
00039     InitializeComponent();
00040 }
00041
00042 /// <summary>
00043 /// Invoked when this page is about to be displayed in a Frame.
00044 /// </summary>
00045 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00046 /// property is typically used to configure the page.</param>
00047 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00048 {
00049     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00050     // as NotifyUser()
00051     rootPage = MainPage::Current;
00052 }
00053
00054 byte* GetUnderlyingBuffer(IBuffer^ buf)
00055 {
00056     Microsoft::WRL::ComPtr<IBufferByteAccess> bufferByteAccess;
00057     HRESULT hr = reinterpret_cast<IUnknown*>(buf)->QueryInterface(IID_PPV_ARGS(&bufferByteAccess));
00058     byte* raw_buffer;
00059     hr = bufferByteAccess->Buffer(&raw_buffer);
00060     return raw_buffer;
00061 }
00062
00063 struct PipeEvents {
00064     task_completion_event<IBuffer^> on_write;
00065     task_completion_event<void> on_read;
00066     IBuffer^ unread_buffer;
00067     unsigned int read_bytes;
00068     unsigned long long total_pipe_bytes;
00069 };
00070
00071 ref class PipeOut : IOutputStream
00072 {
00073 internal:
00074     PipeOut(shared_ptr<PipeEvents> e)
00075     {
00076         events = e;
00077     }
00078
00079 public:
00080     virtual IAsyncOperationWithProgress<unsigned int, unsigned int>^ WriteAsync(IBuffer^ buf)
00081     {
00082         return create_async([this, buf](progress_reporter<unsigned int> reporter) -> unsigned int
00083         {
00084             events->total_pipe_bytes += buf->Length;
00085             events->on_write.set(buf);
00086             create_task(events->on_read).wait();
00087             events->on_read = task_completion_event<void>();
00088             return buf->Length;
00089         });
00090     }
00091
00092     virtual IAsyncOperation<bool>^ FlushAsync()
00093     {
00094         return create_async([this]()
00095         {
00096             return true;
00097         });
00098     }
00099     virtual ~PipeOut() { }
00100 private:
00101     shared_ptr<PipeEvents> events;
00102 };
00103
00104 ref class PipeIn : IInputStream
00105 {
00106 internal:
00107     PipeIn(shared_ptr<PipeEvents> e)
00108     {
00109         events = e;
00110     }
00111 public:
00112     virtual IAsyncOperationWithProgress<IBuffer^, unsigned int>^ ReadAsync(IBuffer^ buf, unsigned int count, InputStreamOptions options)
00113     {
00114         return create_async([this, buf, count](progress_reporter<unsigned int> reporter) -> IBuffer^
00115         {
00116             buf->Length = 0;
00117             while (buf->Length < count)
00118             {
00119                 if (events->unread_buffer == nullptr)
00120                 {
00121                     events->unread_buffer = create_task(events->on_write).get();
00122                     events->on_write = task_completion_event<IBuffer^>();
00123                     events->read_bytes = 0;
00124                 }
00125                 unsigned int to_copy = min(min(count, buf->Capacity) - buf->Length, events->unread_buffer->Length - events->read_bytes);
00126                 memcpy(GetUnderlyingBuffer(buf) + buf->Length, GetUnderlyingBuffer(events->unread_buffer) + events->read_bytes, to_copy);
00127                 buf->Length += to_copy;
00128                 events->read_bytes += to_copy;
00129                 if (events->read_bytes >= events->unread_buffer->Length)
00130                 {
00131                     events->unread_buffer = nullptr;
00132                     events->on_read.set();
00133                 }
00134             }
00135             return buf;
00136         });
00137     }
00138     virtual ~PipeIn() { }
00139 private:
00140     shared_ptr<PipeEvents> events;
00141 };
00142
00143 void ::SDKTemplate::Compression::Scenario1::DoScenario(CompressAlgorithm Algorithm)
00144 {
00145     Progress->Text = "";
00146     rootPage->NotifyUser("Working...", NotifyType::StatusMessage);
00147
00148     auto picker = ref new Pickers::FileOpenPicker();
00149     picker->FileTypeFilter->Append("*");
00150
00151     auto events = make_shared<PipeEvents>();
00152     events->total_pipe_bytes = 0;
00153
00154     // First pick a test file and open it for reading
00155     create_task(picker->PickSingleFileAsync()).then([=](StorageFile^ OriginalFile)
00156     {
00157         if (!OriginalFile)
00158         {
00159             throw std::runtime_error("No file has been selected");
00160         }
00161
00162         Progress->Text += "File \"" + OriginalFile->Name + "\" has been picked\n";
00163
00164         return create_task(OriginalFile->OpenAsync(FileAccessMode::Read)) && create_task(OriginalFile->OpenAsync(FileAccessMode::Read));
00165
00166     }).then([=](vector<IRandomAccessStream^> FileStream)
00167     {
00168
00169         auto out_pipe = ref new PipeOut(events);
00170         auto in_pipe = ref new PipeIn(events);
00171
00172         Compressor^ compressor;
00173
00174         // Use default constructor if you don't need any specific algorithm and/or block size, use
00175         // "extended" constructor otherwise. This samples shows both versions for demonstration
00176         // purposes only.
00177         if (Algorithm == CompressAlgorithm::InvalidAlgorithm)
00178         {
00179             compressor = ref new Compressor(out_pipe);
00180         }
00181         else
00182         {
00183             compressor = ref new Compressor(out_pipe, Algorithm, 0);
00184         }
00185
00186         Decompressor^ decompressor = ref new Decompressor(in_pipe);
00187
00188         return create_task([=]()
00189         {
00190             // Use a 1MB buffer to read file content in, compress, then decompress.
00191             unsigned int total = 0;
00192             IBuffer^ buf = ref new Buffer(1024 * 1024);
00193             for (;;)
00194             {
00195                 create_task(FileStream[0]->ReadAsync(buf, buf->Capacity, InputStreamOptions::None)).wait();
00196                 if (buf->Length == 0)
00197                 {
00198                     break;
00199                 }
00200                 total += buf->Length;
00201                 create_task(compressor->WriteAsync(buf)).wait();
00202             }
00203             create_task(compressor->FinishAsync()).wait();
00204             return total;
00205         }) &&
00206             create_task([=]()
00207             {
00208                 unsigned int total = 0;
00209                 IBuffer^ buf = ref new Buffer(256 * 1024);
00210                 IBuffer^ file_buf = ref new Buffer(buf->Capacity);
00211                 for (;;)
00212                 {
00213                     create_task(decompressor->ReadAsync(buf, buf->Capacity, InputStreamOptions::Partial)).wait();
00214                     if (buf->Length == 0)
00215                     {
00216                         break;
00217                     }
00218
00219                     create_task(FileStream[1]->ReadAsync(file_buf, buf->Length, InputStreamOptions::None)).wait();
00220                     if (file_buf->Length != buf->Length)
00221                     {
00222                         throw runtime_error("unexpected read length");
00223                     }
00224
00225                     if (memcmp(GetUnderlyingBuffer(buf), GetUnderlyingBuffer(file_buf), buf->Length) != 0)
00226                     {
00227                         throw runtime_error("compression mismatch!");
00228                     }
00229                     total += buf->Length;
00230                 }
00231                 return total;
00232         });
00233     })
00234
00235     .then([=](task<vector<unsigned int> > x)
00236     {
00237         try {
00238             if (x.get()[0] != x.get()[1]) {
00239                 rootPage->NotifyUser("size mismatch", NotifyType::ErrorMessage);
00240             }
00241             else
00242             {
00243                 Progress->Text += "Original size: " + x.get()[0] + "\nCompressed size: " + events->total_pipe_bytes + "\n";
00244                 rootPage->NotifyUser("Done", NotifyType::StatusMessage);
00245             }
00246         }
00247         catch (Platform::Exception ^e)
00248         {
00249             rootPage->NotifyUser(e->Message, NotifyType::ErrorMessage);
00250         }
00251         catch (const std::exception &e)
00252         {
00253             std::wstringstream wss;
00254             wss << e.what();
00255             rootPage->NotifyUser(ref new Platform::String(wss.str().c_str()), NotifyType::ErrorMessage);
00256         }
00257         catch (...)
00258         {
00259             rootPage->NotifyUser("unknown exception", NotifyType::ErrorMessage);
00260         }
00261     });
00262 }
00263
00264 void ::SDKTemplate::Compression::Scenario1::CompressFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00265 {
00266     ComboBoxItem^ item = safe_cast<ComboBoxItem^>(CompressAlgorithmComboBox->SelectedItem);
00267
00268     if (item == nullptr)
00269     {
00270         return;
00271     }
00272
00273     CompressAlgorithm Algorithm = (CompressAlgorithm) CompressAlgorithmFromComboBoxItem(item);
00274
00275     if (Algorithm == CompressAlgorithm::InvalidAlgorithm)
00276     {
00277         return;
00278     }
00279
00280     DoScenario(Algorithm);
00281 }
00282
00283 void ::SDKTemplate::Compression::Scenario1::CompressAlgorithmComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00284 {
00285     SelectionChangedEventArgs^ args = safe_cast<SelectionChangedEventArgs^>(e);
00286
00287     if (args == nullptr)
00288     {
00289         return;
00290     }
00291     if (CompressAlgorithmComboBox == nullptr)
00292     {
00293         return;
00294     }
00295
00296     if (args->AddedItems->Size != 0 && args->RemovedItems->Size == 0)
00297     {
00298         ComboBoxItem^ addedItem = safe_cast<ComboBoxItem^>(args->AddedItems->GetAt(0));
00299         if (addedItem->Content->Equals("Default"))
00300         {
00301                 UpdateDescriptionVisibility(addedItem, Windows::UI::Xaml::Visibility::Visible);
00302         }
00303         return;
00304     }
00305     else
00306     {
00307         ComboBoxItem^ addedItem = safe_cast<ComboBoxItem^>(args->AddedItems->GetAt(0));
00308         ComboBoxItem^ removedItem = safe_cast<ComboBoxItem^>(args->RemovedItems->GetAt(0));
00309
00310         UpdateDescriptionVisibility(addedItem, Windows::UI::Xaml::Visibility::Visible);
00311         UpdateDescriptionVisibility(removedItem, Windows::UI::Xaml::Visibility::Collapsed);
00312     }
00313 }
00314
00315 void ::SDKTemplate::Compression::Scenario1::UpdateDescriptionVisibility(ComboBoxItem^ item, Windows::UI::Xaml::Visibility visibility)
00316 {
00317     TextBlock^ textBlock = nullptr;
00318
00319     CompressAlgorithm algorithm = (CompressAlgorithm) CompressAlgorithmFromComboBoxItem(item);
00320     switch (algorithm)
00321     {
00322     case CompressAlgorithm::NullAlgorithm:
00323         textBlock = DefaultTextBlock;
00324         break;
00325     case CompressAlgorithm::Xpress:
00326         textBlock = XpressTextBlock;
00327         break;
00328     case CompressAlgorithm::XpressHuff:
00329         textBlock = XpressHuffTextBlock;
00330         break;
00331     case CompressAlgorithm::Mszip:
00332         textBlock = MszipTextBlock;
00333         break;
00334     case CompressAlgorithm::Lzms:
00335         textBlock = LzmsTextBlock;
00336         break;
00337     default:
00338         return;
00339     }
00340
00341     textBlock->Visibility = visibility;
00342 }
00343
00344 int ::SDKTemplate::Compression::Scenario1::CompressAlgorithmFromComboBoxItem(ComboBoxItem^ item)
00345 {
00346     CompressAlgorithm Algorithm = CompressAlgorithm::NullAlgorithm;
00347
00348     if (item == DefaultComboBoxItem)
00349     {
00350         Algorithm = CompressAlgorithm::NullAlgorithm;
00351     }
00352     else if (item == XpressComboBoxItem)
00353     {
00354         Algorithm = CompressAlgorithm::Xpress;
00355     }
00356     else if (item == XpressHuffComboBoxItem)
00357     {
00358         Algorithm = CompressAlgorithm::XpressHuff;
00359     }
00360     else if (item == MszipComboBoxItem)
00361     {
00362         Algorithm = CompressAlgorithm::Mszip;
00363     }
00364     else if (item == LzmsComboBoxItem)
00365     {
00366         Algorithm = CompressAlgorithm::Lzms;
00367     }
00368     else
00369     {
00370         Algorithm = CompressAlgorithm::InvalidAlgorithm;
00371     }
00372
00373     return (int) Algorithm;
00374 }
Generated on Fri Nov 15 2024 22:17:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSuggestion/cs/Scenario3_ReverseConversion.xaml.cs Source File

  • TextSuggestion
  • cs

Scenario3_ReverseConversion.xaml.cs

Go to the documentation of this file.
00001 // Copyright (c) Microsoft Corporation. All rights reserved
00002
00003 using System;
00004 using System.Collections.Generic;
00005 using Windows.Data.Text;
00006 using Windows.UI.Xaml;
00007 using Windows.UI.Xaml.Controls;
00008 using Windows.UI.Xaml.Navigation;
00009 using SDKTemplate;
00010
00011 namespace TextSuggestion
00012 {
00013     public sealed partial class Scenario3_ReverseConversion : Page
00014     {
00015         private MainPage rootPage;
00016         private TextReverseConversionGenerator generator;
00017
00018         /// <summary>
00019         /// Page initializer.
00020         /// </summary>
00021         public Scenario3_ReverseConversion()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         /// <summary>
00027         /// Clean up the notification area when user navigate to prediction page
00028         /// </summary>
00029         /// <param name="e">Event data that describes the click action on the button.</param>
00030         protected override void OnNavigatedTo(NavigationEventArgs e)
00031         {
00032             rootPage = MainPage.Current;
00033
00034             // Clean notification area.
00035             rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00036         }
00037
00038         /// <summary>
00039         /// This is the click handler for the 'Execute' button.
00040         /// When this button is activated, the text suggestion generator will get
00041         /// the reverse conversion result for given input string and language tag, then
00042         /// print them in result column.
00043         /// Using 'async' keyword to indicate that this method runs asynchronously
00044         /// and contains one 'await' expression.
00045         /// </summary>
00046         /// <param name="sender">The object that raised the event.</param>
00047         /// <param name="e">Event data that describes the click action on the button.</param>
00048         private async void Execute_Click(object sender, RoutedEventArgs e)
00049         {
00050             // Clean up result column.
00051             resultView.ItemsSource = null;
00052
00053             // Clean notification area.
00054             rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00055
00056             var input = Input.Text;
00057
00058             ComboBoxItem selectedItem = methods.SelectedItem as ComboBoxItem;
00059
00060             if ((generator != null) && (selectedItem != null) && (!String.IsNullOrEmpty(input)))
00061             {
00062                 if ((selectedItem.Tag != null) && selectedItem.Tag.ToString().Equals("segmented"))
00063                 {
00064                     // Get the reverse conversion result per phoneme through calling the API and print it in result area.
00065                     // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
00066                     IReadOnlyList<TextPhoneme> phonemes = await generator.GetPhonemesAsync(input);
00067                     List<string> results = new List<string>();
00068                     foreach (TextPhoneme phoneme in phonemes)
00069                     {
00070                         results.Add(string.Format("{0} -> {1}", phoneme.DisplayText, phoneme.ReadingText));
00071                     }
00072                     resultView.ItemsSource = results;
00073
00074                     if (phonemes.Count == 0)
00075                     {
00076                         rootPage.NotifyUser(string.Format("No results"), NotifyType.StatusMessage);
00077                     }
00078                 }
00079                 else
00080                 {
00081                     // Get the reverse conversion result through calling the API and print it in result area.
00082                     // Using 'await' expression here to suspend the execution of this method until the awaited task completes.
00083                     string result = await generator.ConvertBackAsync(input);
00084                     resultView.ItemsSource = new List<string> { result };
00085
00086                     if (result.Length == 0)
00087                     {
00088                         rootPage.NotifyUser(string.Format("No results"), NotifyType.StatusMessage);
00089                     }
00090                 }
00091             }
00092         }
00093
00094         /// <summary>
00095         /// This is the click handler for the 'Create Generator' button.
00096         /// When this button is activated, the Text Suggestion API will try
00097         /// to resolve the language tag provided by the user, and create a
00098         /// Reverse Conversion Generator.
00099         /// </summary>
00100         /// <param name="sender">The object that raised the event.</param>
00101         /// <param name="e">Event data that describes the click action on the button.</param>
00102         private void CreateGeneratorButton_Click(object sender, RoutedEventArgs e)
00103         {
00104             // Try to parse the language and create generator accordingly.
00105             generator = new TextReverseConversionGenerator(langTag.Text);
00106
00107             // Only allow generator operation when the language is available and installed.
00108             if (generator == null)
00109             {
00110                 if (GeneratorOperationArea != null)
00111                 {
00112                     GeneratorOperationArea.Visibility = Visibility.Collapsed;
00113                 }
00114
00115                 rootPage.NotifyUser(string.Format("Failed to instantiate a generator."), NotifyType.ErrorMessage);
00116             }
00117             else if (generator.ResolvedLanguage == "und")
00118             {
00119                 if (GeneratorOperationArea != null)
00120                 {
00121                     GeneratorOperationArea.Visibility = Visibility.Collapsed;
00122                 }
00123
00124                 rootPage.NotifyUser(string.Format("Unsupported language."), NotifyType.ErrorMessage);
00125             }
00126             else if (generator.LanguageAvailableButNotInstalled)
00127             {
00128                 if (GeneratorOperationArea != null)
00129                 {
00130                     GeneratorOperationArea.Visibility = Visibility.Collapsed;
00131                 }
00132
00133                 rootPage.NotifyUser(string.Format("Language available but not installed."), NotifyType.ErrorMessage);
00134             }
00135             else
00136             {
00137                 if (GeneratorOperationArea != null)
00138                 {
00139                     GeneratorOperationArea.Visibility = Visibility.Visible;
00140                 }
00141
00142                 rootPage.NotifyUser(string.Format("Successfully instantiated a generator."), NotifyType.StatusMessage);
00143             }
00144         }
00145     }
00146 }
Generated on Fri Nov 15 2024 22:21:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewModelBase Member List

This is the complete list of members for ViewModelBase, including all inherited members.
Log(string message) | ViewModelBase | [inline, static]
outputLog | ViewModelBase | [private, static]
OutputLog | ViewModelBase |
playbackEnabled | ViewModelBase | [private]
PlaybackEnabled | ViewModelBase |
PropertyChanged | ViewModelBase |
ProtectionManager | ViewModelBase |
protectionManager | ViewModelBase | [private]
RaisePropertyChanged([CallerMemberName] string propertyName="") | ViewModelBase | [inline, protected]
SetPlaybackEnabled(bool enabled) | ViewModelBase | [inline]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cpp/SampleConfiguration.h Source File

  • Compass
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Compass";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/HintPresentation/Contact/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • HintPresentation
  • Contact

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.HintPresentation.Contact
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
00017             updateFourTilesControl.SetTilePayload($@"
00018                 <tile>
00019                     <visual>
00020
00021                         <binding template='TileSmall' hint-presentation='contact'>
00022                             <image src='Assets/Photos/1.jpg'/>
00023                         </binding>
00024
00025                         <binding template='TileMedium' hint-presentation='contact'>
00026                             <image src='Assets/Photos/1.jpg'/>
00027                             <image src='Assets/Photos/2.jpg'/>
00028                             <text>CONTACT_TEXT01</text>
00029                             <text>CONTACT_TEXT02</text>
00030                             <text>CONTACT_TEXT03</text>
00031                         </binding>
00032
00033                         <binding template='TileWide' hint-presentation='contact'>
00034                             <image src='Assets/Photos/1.jpg'/>
00035                             <image src='Assets/Photos/2.jpg'/>
00036                             <text>CONTACT_TEXT01</text>
00037                             <text>CONTACT_TEXT02</text>
00038                             <text>CONTACT_TEXT03</text>
00039                         </binding>
00040
00041                         <binding template='TileLarge' hint-presentation='contact'>
00042                             <image src='Assets/Photos/1.jpg'/>
00043                             <image src='Assets/Photos/2.jpg'/>
00044                             <text>CONTACT_TEXT01</text>
00045                             <text>CONTACT_TEXT02</text>
00046                             <text>CONTACT_TEXT03</text>
00047                         </binding>
00048
00049                     </visual>
00050                 </tile>");
00051         }
00052     }
00053 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/pch.cpp Source File

  • Clipboard
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/pch.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/SampleConfiguration.h Source File

  • OCR
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "OCR CPP sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ConsumableProduct Member List

This is the complete list of members for Scenario4_ConsumableProduct, including all inherited members.
FulfillConsumableButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_ConsumableProduct | [inline, private]
GetConsumableBalanceButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_ConsumableProduct | [inline, private]
GetManagedConsumablesButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_ConsumableProduct | [inline, private]
PurchaseAddOnButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario4_ConsumableProduct | [inline, private]
rootPage | Scenario4_ConsumableProduct | [private]
Scenario4_ConsumableProduct() | Scenario4_ConsumableProduct | [inline]
storeContext | Scenario4_ConsumableProduct | [private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cs/Scenario2_Polling.xaml.cs Source File

  • OrientationSensor
  • cs

Scenario2_Polling.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using Windows.Devices.Sensors;
00018 using Windows.Foundation;
00019 using System.Threading.Tasks;
00020 using Windows.UI.Core;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2_Polling : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         private OrientationSensor _sensor;
00031         private uint _desiredReportInterval;
00032         private DispatcherTimer _dispatcherTimer;
00033
00034         public Scenario2_Polling()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             _sensor = OrientationSensor.GetDefault(rootPage.SensorReadingType, rootPage.SensorOptimizationGoal);
00042             if (_sensor != null)
00043             {
00044                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00045                 // This value will be used later to activate the sensor.
00046                 _desiredReportInterval = Math.Max(_sensor.MinimumReportInterval, 16);
00047
00048                 // Set up a DispatchTimer
00049                 _dispatcherTimer = new DispatcherTimer();
00050                 _dispatcherTimer.Tick += DisplayCurrentReading;
00051                 _dispatcherTimer.Interval = TimeSpan.FromMilliseconds(_desiredReportInterval);
00052
00053                 rootPage.NotifyUser(rootPage.SensorDescription + " is ready", NotifyType.StatusMessage);
00054                 ScenarioEnableButton.IsEnabled = true;
00055             }
00056             else
00057             {
00058                 rootPage.NotifyUser(rootPage.SensorDescription + " not found", NotifyType.ErrorMessage);
00059             }
00060         }
00061
00062         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00063         {
00064             if (ScenarioDisableButton.IsEnabled)
00065             {
00066                 ScenarioDisable();
00067             }
00068         }
00069
00070         /// <summary>
00071         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00072         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00073         /// </summary>
00074         /// <param name="sender"></param>
00075         /// <param name="e">
00076         /// Event data that can be examined for the current visibility state.
00077         /// </param>
00078         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00079         {
00080             if (ScenarioDisableButton.IsEnabled)
00081             {
00082                 if (e.Visible)
00083                 {
00084                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00085                     _dispatcherTimer.Start();
00086                 }
00087                 else
00088                 {
00089                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00090                     _dispatcherTimer.Stop();
00091                 }
00092             }
00093         }
00094
00095         /// <summary>
00096         /// This is the dispatcher callback.
00097         /// </summary>
00098         /// <param name="sender"></param>
00099         /// <param name="args"></param>
00100         private void DisplayCurrentReading(object sender, object args)
00101         {
00102             OrientationSensorReading reading = _sensor.GetCurrentReading();
00103             if (reading != null)
00104             {
00105                 MainPage.SetReadingText(ScenarioOutput, reading);
00106             }
00107         }
00108
00109         /// <summary>
00110         /// This is the click handler for the 'Enable' button.
00111         /// </summary>
00112         private void ScenarioEnable()
00113         {
00114             // Set the report interval to enable the sensor for polling
00115             _sensor.ReportInterval = _desiredReportInterval;
00116
00117             Window.Current.VisibilityChanged += VisibilityChanged;
00118             _dispatcherTimer.Start();
00119
00120             ScenarioEnableButton.IsEnabled = false;
00121             ScenarioDisableButton.IsEnabled = true;
00122         }
00123
00124         /// <summary>
00125         /// This is the click handler for the 'Disable' button.
00126         /// </summary>
00127         private void ScenarioDisable()
00128         {
00129             Window.Current.VisibilityChanged -= VisibilityChanged;
00130
00131             // Stop the dispatcher
00132             _dispatcherTimer.Stop();
00133
00134             // Restore the default report interval to release resources while the sensor is not in use
00135             _sensor.ReportInterval = 0;
00136
00137             ScenarioEnableButton.IsEnabled = true;
00138             ScenarioDisableButton.IsEnabled = false;
00139         }
00140     }
00141 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/DeviceWatcherHelper.h Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

DeviceWatcherHelper.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace winrt::SDKTemplate
00015 {
00016     struct DeviceWatcherHelper : implements<DeviceWatcherHelper, Windows::Foundation::IInspectable>
00017     {
00018         DeviceWatcherHelper(
00019             Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> const& resultCollection,
00020             Windows::UI::Core::CoreDispatcher const& dispatcher) :
00021             resultCollection(resultCollection), dispatcher(dispatcher) { }
00022
00023         event_token DeviceChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Enumeration::DeviceWatcher, hstring> const& handler)
00024         {
00025             return deviceChanged.add(handler);
00026         }
00027
00028         void DeviceChanged(event_token const& token)
00029         {
00030             deviceChanged.remove(token);
00031         };
00032
00033         void UpdateStatus(bool update)
00034         {
00035             updateStatus = update;
00036         }
00037
00038         void StartWatcher(Windows::Devices::Enumeration::DeviceWatcher const& deviceWatcher);
00039         void StopWatcher();
00040         void Reset();
00041         bool IsWatcherRunning();
00042
00043     private:
00044         Windows::Devices::Enumeration::DeviceWatcher deviceWatcher{ nullptr };
00045         Windows::Foundation::Collections::IObservableVector<SDKTemplate::DeviceInformationDisplay> resultCollection{ nullptr };
00046         Windows::UI::Core::CoreDispatcher dispatcher{ nullptr };
00047         bool updateStatus = true;
00048         event<Windows::Foundation::TypedEventHandler<Windows::Devices::Enumeration::DeviceWatcher, hstring>> deviceChanged;
00049
00050         static bool IsWatcherStarted(Windows::Devices::Enumeration::DeviceWatcher const& deviceWatcher);
00051         fire_and_forget Watcher_DeviceAdded(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformation deviceInfo);
00052         fire_and_forget Watcher_DeviceUpdated(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate);
00053         fire_and_forget Watcher_DeviceRemoved(Windows::Devices::Enumeration::DeviceWatcher sender, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate);
00054         fire_and_forget Watcher_EnumerationCompleted(Windows::Devices::Enumeration::DeviceWatcher sender, IInspectable const&);
00055         fire_and_forget Watcher_Stopped(Windows::Devices::Enumeration::DeviceWatcher sender, IInspectable const&);
00056         void RaiseDeviceChanged(Windows::Devices::Enumeration::DeviceWatcher const& sender, hstring const& id);
00057     };
00058 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoItem Member List

This is the complete list of members for VideoItem, including all inherited members.
ItemId | MediaItem |
MediaItem() | MediaItem | [inline]
MediaItem(JsonObject json) | MediaItem | [inline]
MediaItemIdKey | MediaItem |
MediaUri | MediaItem |
PreviewImageUri | VideoItem |
Title | MediaItem |
ToPlaybackItem() | VideoItem | [inline, virtual]
VideoItem() | VideoItem | [inline]
VideoItem(JsonObject json) | VideoItem | [inline]
VideoPreviewImageUri | VideoItem |
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario5_UnicodeExtensions.h Source File

  • DateTimeFormatting
  • cppwinrt

Scenario5_UnicodeExtensions.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_UnicodeExtensions.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario5_UnicodeExtensions : Scenario5_UnicodeExtensionsT<Scenario5_UnicodeExtensions>
00019     {
00020         Scenario5_UnicodeExtensions();
00021
00022         void Display_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario5_UnicodeExtensions : Scenario5_UnicodeExtensionsT<Scenario5_UnicodeExtensions, implementation::Scenario5_UnicodeExtensions>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cs/Scenario3_Send.xaml.cs Source File

  • DatagramSocket
  • cs

Scenario3_Send.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Diagnostics;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Sockets;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace DatagramSocketSample
00024 {
00025     /// <summary>
00026     /// A page for third scenario.
00027     /// </summary>
00028     public sealed partial class Scenario3 : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public Scenario3()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046         }
00047
00048         /// <summary>
00049         /// This is the click handler for the 'SendHello' button.
00050         /// </summary>
00051         /// <param name="sender">Object for which the event was generated.</param>
00052         /// <param name="e">Event's parameters.</param>
00053         private async void SendHello_Click(object sender, RoutedEventArgs e)
00054         {
00055             if (!CoreApplication.Properties.ContainsKey("connected"))
00056             {
00057                 rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
00058                 return;
00059             }
00060
00061             object outValue;
00062             DatagramSocket socket;
00063             if (!CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
00064             {
00065                 rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
00066                 return;
00067             }
00068
00069             socket = (DatagramSocket)outValue;
00070
00071             // Create a DataWriter if we did not create one yet. Otherwise use one that is already cached.
00072             DataWriter writer;
00073             if (!CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
00074             {
00075                 writer = new DataWriter(socket.OutputStream);
00076                 CoreApplication.Properties.Add("clientDataWriter", writer);
00077             }
00078             else
00079             {
00080                 writer = (DataWriter)outValue;
00081             }
00082
00083             // Prepare the message to be sent. Writing data to the writer will just store data in memory.
00084             string stringToSend = "Hello";
00085             writer.WriteString(stringToSend);
00086
00087             // Write the locally buffered data to the network.
00088             try
00089             {
00090                 await writer.StoreAsync();
00091                 SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
00092             }
00093             catch (Exception exception)
00094             {
00095                 // If this is an unknown status it means that the error if fatal and retry will likely fail.
00096                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00097                 {
00098                     throw;
00099                 }
00100
00101                 rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
00102             }
00103         }
00104     }
00105 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
_tileId | ScenarioElement | [private]
BACKGROUND_TASK_NAME | ScenarioElement | [private, static]
ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
RegisterBackgroundTask() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
UnregisterBackgroundTask() | ScenarioElement | [inline, private, static]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cppwinrt/Scenario1_Data.cpp Source File

  • Calendar
  • cppwinrt

Scenario1_Data.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Data.h"
00014 #include "Scenario1_Data.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace
00022 {
00023     void ReportCalendarData(std::wostream& results, Calendar const& calendar, PCWSTR calendarLabel)
00024     {
00025         results << calendarLabel << L": " << std::wstring_view(calendar.GetCalendarSystem()) << L"\n" <<
00026         L"Name of Month: " << std::wstring_view(calendar.MonthAsSoloString()) << L"\n" <<
00027         L"Day of Month: " << std::wstring_view(calendar.DayAsPaddedString(2)) << L"\n" <<
00028         L"Day of Week: " << std::wstring_view(calendar.DayOfWeekAsSoloString()) << L"\n" <<
00029         L"Year: " << std::wstring_view(calendar.YearAsString()) << L"\n\n";
00030     }
00031 }
00032
00033 namespace winrt::SDKTemplate::implementation
00034 {
00035     Scenario1_Data::Scenario1_Data()
00036     {
00037         InitializeComponent();
00038     }
00039
00040     void Scenario1_Data::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00041     {
00042         // This scenario uses the Windows.Globalization.Calendar class to display the parts of a date.
00043
00044         // Create Calendar objects using different constructors.
00045         Calendar calendar;
00046         Calendar japaneseCalendar({ L"ja-JP" }, CalendarIdentifiers::Japanese(), ClockIdentifiers::TwelveHour());
00047         Calendar hebrewCalendar({ L"he-IL" }, CalendarIdentifiers::Hebrew(), ClockIdentifiers::TwentyFourHour());
00048
00049         // Generate the results
00050         std::wostringstream results;
00051         ReportCalendarData(results, calendar, L"User's default calendar system");
00052         ReportCalendarData(results, japaneseCalendar, L"Calendar system");
00053         ReportCalendarData(results, hebrewCalendar, L"Calendar system");
00054         OutputTextBlock().Text(results.str());
00055     }
00056 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cs/Scenario2_DragUICustomization.xaml.cs Source File

  • XamlDragAndDrop
  • cs

Scenario2_DragUICustomization.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Controls.Primitives;
00014 using Windows.UI.Xaml.Media.Imaging;
00015 using System;
00016 using Windows.Graphics.Imaging;
00017 using Windows.Foundation;
00018 using Windows.UI.Xaml;
00019 using Windows.ApplicationModel.DataTransfer;
00020
00021 namespace DragAndDropSampleManaged
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario2_DragUICustomization : Page
00027     {
00028         public Scenario2_DragUICustomization()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// Start of the Drag and Drop operation: we set some content and change the DragUI
00035         /// depending on the selected options
00036         /// </summary>
00037         /// <param name="sender"></param>
00038         /// <param name="args"></param>
00039         private async void SourceGrid_DragStarting(Windows.UI.Xaml.UIElement sender, Windows.UI.Xaml.DragStartingEventArgs args)
00040         {
00041             args.Data.SetText(SourceTextBox.Text);
00042             if ((bool)DataPackageRB.IsChecked)
00043             {
00044                 // Standard icon will be used as the DragUIContent
00045                 args.DragUI.SetContentFromDataPackage();
00046             }
00047             else if ((bool)CustomContentRB.IsChecked)
00048             {
00049                 // Generate a bitmap with only the TextBox
00050                 // We need to take the deferral as the rendering won't be completed synchronously
00051                 var deferral = args.GetDeferral();
00052                 var rtb = new RenderTargetBitmap();
00053                 await rtb.RenderAsync(SourceTextBox);
00054                 var buffer = await rtb.GetPixelsAsync();
00055                 var bitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer,
00056                     BitmapPixelFormat.Bgra8,
00057                     rtb.PixelWidth,
00058                     rtb.PixelHeight,
00059                     BitmapAlphaMode.Premultiplied);
00060                 args.DragUI.SetContentFromSoftwareBitmap(bitmap);
00061                 deferral.Complete();
00062             }
00063             // else just show the dragged UIElement
00064         }
00065
00066         /// <summary>
00067         /// Entering the Target, we'll change its background and optionally change the DragUI as well
00068         /// </summary>
00069         /// <param name="sender"></param>
00070         /// <param name="e"></param>
00071         private void TargetTextBox_DragEnter(object sender, Windows.UI.Xaml.DragEventArgs e)
00072         {
00073             /// Change the background of the target
00074             VisualStateManager.GoToState(this, "Inside", true);
00075             bool hasText = e.DataView.Contains(StandardDataFormats.Text);
00076             e.AcceptedOperation = hasText ? DataPackageOperation.Copy : DataPackageOperation.None;
00077             if (hasText)
00078             {
00079                 e.DragUIOverride.Caption = "Drop here to insert text";
00080                 // Now customize the content
00081                 if ((bool)HideRB.IsChecked)
00082                 {
00083                     e.DragUIOverride.IsGlyphVisible = false;
00084                     e.DragUIOverride.IsContentVisible = false;
00085                 }
00086                 else if ((bool)CustomRB.IsChecked)
00087                 {
00088                     var bitmap = new BitmapImage(new Uri("ms-appx:///Assets/dropcursor.png", UriKind.RelativeOrAbsolute));
00089                     // Anchor will define how to position the image relative to the pointer
00090                     Point anchor = new Point(0,52); // lower left corner of the image
00091                     e.DragUIOverride.SetContentFromBitmapImage(bitmap, anchor);
00092                     e.DragUIOverride.IsGlyphVisible = false;
00093                     e.DragUIOverride.IsCaptionVisible = false;
00094                 }
00095                 // else keep the DragUI Content set by the source
00096             }
00097         }
00098
00099         /// <summary>
00100         /// DragLeave: Restore previous background
00101         /// </summary>
00102         /// <param name="sender"></param>
00103         /// <param name="e"></param>
00104         private void TargetTextBox_DragLeave(object sender, Windows.UI.Xaml.DragEventArgs e)
00105         {
00106             VisualStateManager.GoToState(this, "Outside", true);
00107         }
00108
00109         /// <summary>
00110         /// Drop: restore the background and append the dragged text
00111         /// </summary>
00112         /// <param name="sender"></param>
00113         /// <param name="e"></param>
00114         private async void TargetTextBox_Drop(object sender, Windows.UI.Xaml.DragEventArgs e)
00115         {
00116             VisualStateManager.GoToState(this, "Outside", true);
00117             bool hasText = e.DataView.Contains(StandardDataFormats.Text);
00118             // if the result of the drop is not too important (and a text copy should have no impact on source)
00119             // we don't need to take the deferral and this will complete the operation faster
00120             e.AcceptedOperation = hasText ? DataPackageOperation.Copy : DataPackageOperation.None;
00121             if (hasText)
00122             {
00123                 var text = await e.DataView.GetTextAsync();
00124                 TargetTextBox.Text += text;
00125             }
00126         }
00127     }
00128 }
Generated on Fri Nov 15 2024 22:22:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario6_ScrollIntoView.cpp Source File

  • XamlListView
  • cppwinrt

Scenario6_ScrollIntoView.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario6_ScrollIntoView.h"
00014 #include "Scenario6_ScrollIntoView.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::Xaml;
00019 using namespace winrt::Windows::UI::Xaml::Controls;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario6_ScrollIntoView::Scenario6_ScrollIntoView()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     void Scenario6_ScrollIntoView::Scroll_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&)
00029     {
00030         hstring text = scrollId().Text();
00031         wchar_t* end;
00032         unsigned long index = std::wcstoul(text.c_str(), &end, 10);
00033         if (text.c_str() == end)
00034         {
00035             index = ~0UL; // invalid
00036         }
00037         if (index < ItemsListView().Items().Size())
00038         {
00039             ScrollIntoViewAlignment alignment = ScrollAlignment().SelectedItem().as<FrameworkElement>().Tag().as<ScrollIntoViewAlignment>();
00040             ItemsListView().ScrollIntoView(ItemsListView().Items().GetAt(index), alignment);
00041             scrollId().BorderBrush(ValidFormatBrush());
00042         }
00043         else
00044         {
00045             scrollId().BorderBrush(InvalidFormatBrush());
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:22:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_LaunchedFromSecondaryTile Member List

This is the complete list of members for Scenario5_LaunchedFromSecondaryTile, including all inherited members.
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario5_LaunchedFromSecondaryTile
Scenario5_LaunchedFromSecondaryTile() | Scenario5_LaunchedFromSecondaryTile
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/ToneSampleGenerator.h Source File

  • WindowsAudioSession
  • cppwinrt

ToneSampleGenerator.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #define _USE_MATH_DEFINES
00014 #include <math.h>
00015 #include <limits.h>
00016
00017 namespace winrt::SDKTemplate
00018 {
00019     class ToneSampleGenerator
00020     {
00021     public:
00022         bool IsEOF() noexcept { return m_sampleQueue.empty(); };
00023         uint32_t GetBufferLength() noexcept { return m_sampleQueue.empty() ? 0 : m_sampleQueue.front().BufferSize; };
00024         void Flush() { m_sampleQueue.clear(); }
00025
00026         void GenerateSampleBuffer(double Frequency, UINT32 FramesPerPeriod, WAVEFORMATEX* wfx);
00027         void FillSampleBuffer(array_view<uint8_t> buffer);
00028
00029     private:
00030         struct SineSampleInfo
00031         {
00032             double Frequency;
00033             WORD ChannelCount;
00034             DWORD SamplesPerSecond;
00035             double Amplitude;
00036             double Theta = 0.0;
00037             size_t SampleSize;
00038             void (*StoreSample)(uint8_t* buffer, double value);
00039
00040             void GenerateSamples(array_view<uint8_t> buffer) noexcept;
00041         };
00042
00043     private:
00044         std::forward_list<RenderBuffer> m_sampleQueue;
00045     };
00046 }
Generated on Fri Nov 15 2024 22:22:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TripListViewModel Member List

This is the complete list of members for TripListViewModel, including all inherited members.
AddTrip() | TripListViewModel | [inline, private]
addTripCommand | TripListViewModel | [private]
AddTripCommand | TripListViewModel |
LoadTrips() | TripListViewModel | [inline, private]
NotifyPropertyChanged(string propertyName) | ViewModelBase | [inline, protected]
PropertyChanged | ViewModelBase |
SelectedTrip | TripListViewModel |
selectedTrip | TripListViewModel | [private]
SelectionChanged() | TripListViewModel | [inline, private]
store | TripListViewModel | [private]
TripListViewModel(TripStore store) | TripListViewModel | [inline]
trips | TripListViewModel | [private]
Trips | TripListViewModel |
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/MainPage.xaml.h Source File

  • WindowsAudioSession
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MainPage.g.h"
00015 #include "SampleConfiguration.h"
00016
00017 namespace SDKSample
00018 {
00019     public enum class NotifyType
00020     {
00021         StatusMessage,
00022         ErrorMessage
00023     };
00024
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public ref class MainPage sealed
00029     {
00030     public:
00031         MainPage();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035
00036     private:
00037         void ScenarioControl_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00038         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00039         void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040
00041     internal:
00042         static MainPage^ Current;
00043         void NotifyUser(Platform::String^ strMessage, NotifyType type);
00044     };
00045 }
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/pch.h Source File

  • PosPrinter
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/shared/AllJoynBusObjectManager.cpp Source File

  • AllJoyn
  • shared

AllJoynBusObjectManager.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 std::mutex AllJoynBusObjectManager::ModifyBusObjectMap;
00024 std::map<alljoyn_busattachment, std::shared_ptr<std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>>> AllJoynBusObjectManager::BusAttachmentMap;
00025
00026 QStatus AllJoynBusObjectManager::GetBusObject(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _Out_ alljoyn_busobject* busObject)
00027 {
00028     // Ensure thread safety when creating BusObjects so that for each BusAttachment there is
00029     // at most one BusObject with any given ObjectPath.
00030     std::unique_lock<std::mutex> lock(AllJoynBusObjectManager::ModifyBusObjectMap);
00031
00032     if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
00033     {
00034         std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
00035         *busObject = std::get<0>(busObjectEntry);
00036
00037         // Increment the reference counter for this entry.
00038         std::get<2>(busObjectEntry)++;
00039         return ER_OK;
00040     }
00041     // If a matching BusObject does not exist, create and save one.
00042     RETURN_IF_QSTATUS_ERROR(AllJoynBusObjectManager::CreateBusObject(objectPath, busObject));
00043     return AllJoynBusObjectManager::SaveBusObject(busAttachment, objectPath, *busObject);
00044 }
00045
00046 QStatus AllJoynBusObjectManager::ReleaseBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)
00047 {
00048     // Ensure thread safety when releasing BusObjects. Otherwise, BusObjects may continue to
00049     // exist and be registered on BusAttachments even when they have no references.
00050     std::unique_lock<std::mutex> lock(AllJoynBusObjectManager::ModifyBusObjectMap);
00051
00052     if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
00053     {
00054         std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
00055
00056         // Decrement the reference counter for this entry.
00057         std::get<2>(busObjectEntry)--;
00058
00059         // If there are no remaining references to this BusObject, unregister and destroy it.
00060         if (0 == std::get<2>(busObjectEntry))
00061         {
00062             return AllJoynBusObjectManager::UnregisterAndDestroyBusObject(busAttachment, objectPath);
00063         }
00064         return ER_OK;
00065     }
00066     return ER_OK;
00067 }
00068
00069 QStatus AllJoynBusObjectManager::TryRegisterBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject, _In_ const bool secure)
00070 {
00071     PCSTR objectPath = alljoyn_busobject_getpath(busObject);
00072
00073     // To register this BusObject, it must first be created using GetBusObject so that a reference exists in BusAttachmentMap.
00074     if (!AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
00075     {
00076         return ER_BUS_OBJ_NOT_FOUND;
00077     }
00078
00079     if (!AllJoynBusObjectManager::BusObjectIsRegistered(busAttachment, busObject))
00080     {
00081         if (secure)
00082         {
00083             RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_registerbusobject_secure(busAttachment, busObject));
00084         }
00085         else
00086         {
00087             RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_registerbusobject(busAttachment, busObject));
00088         }
00089         std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
00090
00091         // Record that the BusObject in this entry has been registered with its associated BusAttachment.
00092         std::get<1>(busObjectEntry) = true;
00093         return ER_OK;
00094     }
00095     return ER_OK;
00096 }
00097
00098 bool AllJoynBusObjectManager::BusObjectExists(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)
00099 {
00100     // If a BusObject map exists for this BusAttachment, search for an entry with the specified ObjectPath.
00101     auto busObjectMapIterator = AllJoynBusObjectManager::BusAttachmentMap.find(busAttachment);
00102     if (AllJoynBusObjectManager::BusAttachmentMap.end() != busObjectMapIterator)
00103     {
00104         auto existingBusObject = busObjectMapIterator->second->find(std::string(objectPath));
00105         if (busObjectMapIterator->second->end() != existingBusObject)
00106         {
00107             return true;
00108         }
00109     }
00110
00111     // If nothing is found above, the specified BusObject has not been saved yet.
00112     return false;
00113 }
00114
00115 bool AllJoynBusObjectManager::BusObjectIsRegistered(_In_ const alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject)
00116 {
00117     if (nullptr == busObject)
00118     {
00119         return false;
00120     }
00121
00122     PCSTR objectPath = alljoyn_busobject_getpath(busObject);
00123     if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
00124     {
00125         std::tuple<alljoyn_busobject, bool, int> busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
00126         return std::get<1>(busObjectEntry);
00127     }
00128     return false;
00129 }
00130
00131 QStatus AllJoynBusObjectManager::CreateBusObject(_In_ const PCSTR objectPath, _Out_ alljoyn_busobject* busObject)
00132 {
00133     alljoyn_busobject_callbacks callbacks =
00134     {
00135         nullptr,
00136         nullptr,
00137         nullptr,
00138         nullptr
00139     };
00140     *busObject = alljoyn_busobject_create(objectPath, false, &callbacks, nullptr);
00141     if (*busObject == nullptr)
00142     {
00143         return ER_OUT_OF_MEMORY;
00144     }
00145     return ER_OK;
00146 }
00147
00148 QStatus AllJoynBusObjectManager::SaveBusObject(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _In_ const alljoyn_busobject busObject)
00149 {
00150     std::shared_ptr<std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>> busObjectMap;
00151
00152     // Create a BusObject entry for this BusAttachment if it does not exist.
00153     auto busObjectMapIterator = AllJoynBusObjectManager::BusAttachmentMap.find(busAttachment);
00154     if (AllJoynBusObjectManager::BusAttachmentMap.end() != busObjectMapIterator)
00155     {
00156         busObjectMap = busObjectMapIterator->second;
00157     }
00158     else
00159     {
00160         busObjectMap = std::shared_ptr<std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>> (
00161             new std::map<std::string, std::tuple<alljoyn_busobject, bool, int>>);
00162         AllJoynBusObjectManager::BusAttachmentMap.insert(std::make_pair(busAttachment, busObjectMap));
00163     }
00164
00165     // Insert this BusObject into busObjectMap if it does not exist.
00166     auto existingBusObject = busObjectMap->find(std::string(objectPath));
00167     if (busObjectMap->end() == existingBusObject)
00168     {
00169         // Initialize the BusObject entry as "not registered" and with a single reference.
00170         busObjectMap->insert(std::make_pair(std::string(objectPath), std::make_tuple(busObject, false, 1)));
00171     }
00172     return ER_OK;
00173 }
00174
00175 QStatus AllJoynBusObjectManager::UnregisterAndDestroyBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath)
00176 {
00177     if (AllJoynBusObjectManager::BusObjectExists(busAttachment, objectPath))
00178     {
00179         std::tuple<alljoyn_busobject, bool, int>& busObjectEntry = (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment])[objectPath];
00180
00181         // Unregister and destroy the specified BusObject, then remove its entry from the containing map.
00182         alljoyn_busattachment_unregisterbusobject(busAttachment, std::get<0>(busObjectEntry));
00183         alljoyn_busobject_destroy(std::get<0>(busObjectEntry));
00184         (*AllJoynBusObjectManager::BusAttachmentMap[busAttachment]).erase(objectPath);
00185
00186         // If the associated BusAttachment contains no more BusObjects, also remove the BusAttachment from BusAttachmentMap.
00187         if (AllJoynBusObjectManager::BusAttachmentMap[busAttachment]->size() == 0)
00188         {
00189             AllJoynBusObjectManager::BusAttachmentMap.erase(busAttachment);
00190         }
00191     }
00192     return ER_OK;
00193 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario5_RoundingAndPadding.h Source File

  • NumberFormatting
  • cppwinrt

Scenario5_RoundingAndPadding.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_RoundingAndPadding.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario5_RoundingAndPadding : Scenario5_RoundingAndPaddingT<Scenario5_RoundingAndPadding>
00019     {
00020         Scenario5_RoundingAndPadding();
00021
00022         void Display_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario5_RoundingAndPadding : Scenario5_RoundingAndPaddingT<Scenario5_RoundingAndPadding, implementation::Scenario5_RoundingAndPadding>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/NetworkChannel.cpp Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

NetworkChannel.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "NetworkChannel.h"
00010
00011 using namespace Microsoft::Samples::SimpleCommunication::Network;
00012
00013 namespace
00014 {
00015     ref class CSendOperationStatus
00016     {
00017     internal:
00018         CSendOperationStatus()
00019         {
00020         }
00021
00022         void SetException(Exception ^error)
00023         {
00024             if (_error == nullptr)
00025             {
00026                 _error = error;
00027             }
00028         }
00029
00030         void CheckException()
00031         {
00032             if (_error != nullptr)
00033             {
00034                 throw _error;
00035             }
00036         }
00037
00038     private:
00039         Exception ^_error;
00040     };
00041 }
00042
00043 CNetworkChannel::CNetworkChannel()
00044     : _isClosed(false)
00045 {
00046 }
00047
00048 CNetworkChannel::~CNetworkChannel()
00049 {
00050     Disconnect();
00051 }
00052
00053 Windows::Foundation::IAsyncAction ^CNetworkChannel::SendAsync(_In_ IBufferPacket *pPacket)
00054 {
00055     if (pPacket == nullptr)
00056     {
00057         throw ref new InvalidArgumentException();
00058     }
00059
00060     return concurrency::create_async([this, spPacket = ComPtr<IBufferPacket>(pPacket)](){
00061         AutoLock lock(_critSec);
00062         CheckClosed();
00063         IStreamSocket ^socket = GetSocket();
00064         if (socket == nullptr)
00065         {
00066             throw ref new Exception(MF_E_NET_NOCONNECTION);
00067         }
00068
00069         auto outputStream = socket->OutputStream;
00070         ComPtr<IBufferEnumerator> spEn;
00071         ThrowIfError(spPacket->GetEnumerator(&spEn));
00072         if (!spEn->IsValid())
00073         {
00074             // Packet is empty
00075             Throw(E_INVALIDARG);
00076         }
00077
00078         std::list<concurrency::task<void>> tasks;
00079         CSendOperationStatus ^status = ref new CSendOperationStatus();
00080
00081         for (; spEn->IsValid(); spEn->MoveNext())
00082         {
00083             ComPtr<IMediaBufferWrapper> spBuffer;
00084             ComPtr<IInspectable> spInspectable;
00085             DWORD dwLen = 0;
00086
00087             ThrowIfError(spEn->GetCurrent(&spBuffer));
00088
00089             ThrowIfError(spBuffer.As(&spInspectable));
00090             IBuffer ^buffer = safe_cast<IBuffer^>(reinterpret_cast<Object^>(spInspectable.Get()));
00091
00092             ThrowIfError(spBuffer->GetCurrentLength(&dwLen));
00093
00094             tasks.push_back(concurrency::create_task(outputStream->WriteAsync(buffer)).
00095                 then([this, status](concurrency::task<unsigned int>& task)
00096                 {
00097                     try
00098                     {
00099                         // We want when_all to finish when all task finish so remember error.
00100                         // Otherwise if any of the tasks throws when_all finishes earlier.
00101                         task.get();
00102                     }
00103                     catch(Exception ^exc)
00104                     {
00105                         status->SetException(exc);
00106                     }
00107                 }));
00108         }
00109
00110         return concurrency::when_all(tasks.begin(), tasks.end())
00111             .then([this, status](concurrency::task<void>& task)
00112         {
00113             status->CheckException();
00114         });
00115     });
00116 }
00117
00118 Windows::Foundation::IAsyncAction ^CNetworkChannel::ReceiveAsync(_In_ IMediaBufferWrapper *pBuffer)
00119 {
00120     if (pBuffer == nullptr)
00121     {
00122         throw ref new InvalidArgumentException();
00123     }
00124     ComPtr<IMediaBufferWrapper> spBuffer = pBuffer;
00125
00126     return concurrency::create_async([this, spBuffer](){
00127         AutoLock lock(_critSec);
00128         CheckClosed();
00129         IStreamSocket ^socket = GetSocket();
00130         IInputStream ^inputStream;
00131         ComPtr<IInspectable> spInspectable;
00132         DWORD cbBufferLen = 0;
00133
00134         if (socket == nullptr)
00135         {
00136             Throw(MF_E_NET_NOCONNECTION);
00137         }
00138
00139         inputStream = socket->InputStream;
00140
00141         ThrowIfError(spBuffer->GetMediaBuffer()->GetMaxLength(&cbBufferLen));
00142
00143         ThrowIfError(spBuffer.As(&spInspectable));
00144
00145         return concurrency::create_task(inputStream->ReadAsync(safe_cast<IBuffer^>(reinterpret_cast<Object^>(spInspectable.Get())), cbBufferLen, InputStreamOptions::Partial))
00146             .then([this](IBuffer ^buffer)
00147         {
00148             if (buffer->Length  == 0)
00149             {
00150                 Throw(MF_E_NET_READ);
00151             }
00152         });
00153     });
00154 }
00155
00156 void CNetworkChannel::Close()
00157 {
00158     AutoLock lock(_critSec);
00159
00160     Disconnect();
00161
00162     OnClose();
00163
00164     _isClosed = true;
00165 }
00166
00167 void CNetworkChannel::Disconnect()
00168 {
00169     AutoLock lock(_critSec);
00170
00171     if (_socket != nullptr)
00172     {
00173         delete _socket;
00174         _socket = nullptr;
00175     }
00176 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_ForegroundVisits Member List

This is the complete list of members for Scenario7_ForegroundVisits, including all inherited members.
_rootPage | Scenario7_ForegroundVisits | [private]
_visitMonitor | Scenario7_ForegroundVisits | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario7_ForegroundVisits | [inline, protected]
OnVisitStateChanged(GeovisitMonitor sender, GeovisitStateChangedEventArgs args) | Scenario7_ForegroundVisits | [inline, private]
Scenario7_ForegroundVisits() | Scenario7_ForegroundVisits | [inline]
StartMonitoring(object sender, RoutedEventArgs e) | Scenario7_ForegroundVisits | [inline, private]
StopMonitoring(object sender, RoutedEventArgs e) | Scenario7_ForegroundVisits | [inline, private]
UpdateVisitData(Geovisit visit) | Scenario7_ForegroundVisits | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_VerifyResponse Member List

This is the complete list of members for Scenario5_VerifyResponse, including all inherited members.
Scenario5_VerifyResponse() | Scenario5_VerifyResponse
VerifyResponse_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_VerifyResponse
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_Document2.xaml.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_Document2.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_Document2.xaml.h"
00014 #include "DocumentPresenter.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace DWriteTextLayoutCloudFontImplementation;
00018
00019 using Platform::Object;
00020 using Platform::String;
00021 using Windows::UI::Color;
00022 using Windows::UI::ColorHelper;
00023 using Windows::UI::Xaml::SizeChangedEventArgs;
00024
00025
00026 // The DocumentPresenter class is used to handle, at a high level, the text layout that
00027 // uses downloadable fonts, the display of that layout, and interaction with DirectWrite's
00028 // font download mechanisms. The lower-level implementation is handled in classes that the
00029 // DocumentPresenter class uses. The TextLayout and FontDownloadListener classes are the
00030 // primary focus for this sample.
00031
00032
00033 Scenario_Document2::Scenario_Document2()
00034 {
00035     InitializeComponent();
00036
00037     String^ text =
00038         L"住山掲性蘇際連際不派人集国重五。開分由生理捕普路武踏芭星通捕員会配。視写勢象東部終味真働京請童木産目価準騰地。勝年格予国御稿質格堂表東込紅統驚繰都。障続択写反香雨形混化会安気予又営呼供内役。易世鳴王実少快妻代生重禁寄試早注会夫要。読覆直豊月関事止発番激皇護守反兵目。東日抽徳在転法円制聞店大県特不社衣秋。" L"\xd\xa\xd\xa"
00039         L"福子会況皇経病展確典盤無果層告逃。与事講責批連値現覧否死昔現兆同禁合徒入。分界走陽輝知明筋明尽申演総際男未天会占。測要家門宅投告毎丘上拡変県後校望憲気酸足。真近前国支界踊情提継底説級写世提秀米要歩。時止治際将表熊詳動学演名能。俳安体亮月見街十載備承前雲楽載媒戦婚米質。皇何果泰機同相暮田善世転。";
00040
00041     String^ downloadableFontName = ref new String(L"FangSong");
00042
00043     // Set the colors to be used for the text layout. Also apply to the frame background.
00044     Color textColor = ColorHelper::FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
00045     Color textBackgroundColor = ColorHelper::FromArgb(0xFF, 0x30, 0x30, 0x30);
00046
00047     // Create the DocumentPresenter for our document.
00048     m_documentPresenter = ref new DocumentPresenter(
00049         text,
00050         downloadableFontName,
00051         L"zh-Hans", // Language tag for the content (Simplified Chinese).
00052         textColor,
00053         textBackgroundColor,
00054         TextLayoutImage // The target image control for the SurfaceImageSource presenting the text layout.
00055     );
00056 }
00057
00058
00059
00060 // Event handlers:
00061
00062 void Scenario_Document2::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00063 {
00064     m_documentPresenter = nullptr;
00065 }
00066
00067
00068 void Scenario_Document2::TextLayoutFrame_SizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00069 {
00070     // Get the current available width and update the TextLayout if different.
00071     // The available width will be the actual width less the left and right padding.
00072     //
00073     // A MinWidth set in the XAML markup ensures we have valid width after deducting
00074     // the padding.
00075
00076     double width = TextLayoutFrame->ActualWidth;
00077     auto padding = TextLayoutFrame->Padding;
00078     width -= (padding.Left + padding.Right);
00079
00080     // XAML uses DIPs expressed as double. DirectWrite uses DIPs expressed as float.
00081     // casting here.
00082     m_documentPresenter->SetLayoutWidth(static_cast<float>(width));
00083 }
Generated on Fri Nov 15 2024 22:19:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario03_GetList.cpp Source File

  • HttpClient
  • cppwinrt

Scenario03_GetList.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario03_GetList.h"
00014 #include "Scenario03_GetList.g.cpp"
00015 #include "Helpers.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Data::Xml::Dom;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::Windows::Web::Http;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario03_GetList::Scenario03_GetList()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario03_GetList::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         httpClient = Helpers::CreateHttpClientWithCustomHeaders();
00034     }
00035
00036     void Scenario03_GetList::OnNavigatedFrom(NavigationEventArgs const&)
00037     {
00038         httpClient.Close();
00039     }
00040
00041     fire_and_forget Scenario03_GetList::Start_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         auto lifetime = get_strong();
00044
00045         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00046         // valid, absolute URI, we'll notify the user about the incorrect input.
00047         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00048         if (!resourceUri)
00049         {
00050             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00051             return;
00052         }
00053
00054         Helpers::ScenarioStarted(StartButton(), CancelButton(), OutputField());
00055         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00056
00057         // This sample uses a "try" in order to support cancellation.
00058         // If you don't need to support cancellation, then the "try" is not needed.
00059         try
00060         {
00061             pendingAction = CancelableRequestAsync(resourceUri);
00062             co_await pendingAction;
00063         }
00064         catch (hresult_canceled const&)
00065         {
00066             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00067         }
00068         catch (hresult_error const& ex)
00069         {
00070             rootPage.NotifyUser(L"Error: " + ex.message() , NotifyType::ErrorMessage);
00071         }
00072
00073         Helpers::ScenarioCompleted(StartButton(), CancelButton());
00074     }
00075
00076     IAsyncAction Scenario03_GetList::CancelableRequestAsync(Uri resourceUri)
00077     {
00078         auto lifetime = get_strong();
00079         auto cancellation = co_await get_cancellation_token();
00080         cancellation.enable_propagation();
00081
00082         HttpRequestResult result = co_await httpClient.TryGetAsync(resourceUri);
00083
00084         if (result.Succeeded())
00085         {
00086             co_await Helpers::DisplayTextResultAsync(result.ResponseMessage(), OutputField());
00087             hstring contentString = co_await result.ResponseMessage().Content().ReadAsStringAsync();
00088
00089             XmlDocument xmlDocument;
00090             try
00091             {
00092                 xmlDocument.LoadXml(contentString);
00093             }
00094             catch (hresult_error const&)
00095             {
00096                 // Invalid XML.
00097             }
00098
00099             // Create a collection to bind to the view.
00100             std::vector<hstring> items;
00101             for (IXmlNode node : xmlDocument.GetElementsByTagName(L"item"))
00102             {
00103                 items.push_back(node.as<XmlElement>().GetAttribute(L"name"));
00104             }
00105             OutputList().ItemsSource(single_threaded_observable_vector(std::move(items)));
00106
00107             rootPage.NotifyUser(L"Completed", NotifyType::StatusMessage);
00108         }
00109         else
00110         {
00111             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00112         }
00113     }
00114
00115     void Scenario03_GetList::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00116     {
00117         if (pendingAction)
00118         {
00119             pendingAction.Cancel();
00120         }
00121     }
00122 }
Generated on Fri Nov 15 2024 22:19:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameInfoOverlay.cpp Source File

  • Simple3DGameDX
  • cpp

GameInfoOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameUIConstants.h"
00014 #include "DeviceResources.h"
00015 #include "DirectXSample.h"
00016 #include "GameInfoOverlay.h"
00017
00018 using namespace Windows::UI::Core;
00019 using namespace Windows::Foundation;
00020 using namespace Microsoft::WRL;
00021 using namespace Windows::UI::ViewManagement;
00022 using namespace Windows::Graphics::Display;
00023 using namespace D2D1;
00024 using namespace Simple3DGameDX;
00025
00026
00027 static const int bufferLength = 1000;
00028 static char16 wsbuffer[bufferLength];
00029
00030 GameInfoOverlay::GameInfoOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00031     m_deviceResources(deviceResources),
00032     m_visible(false),
00033     m_titleString("Title"),
00034     m_bodyString("Body"),
00035     m_actionString("Action")
00036 {
00037     auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00038
00039     // Create D2D Resources
00040     DX::ThrowIfFailed(
00041         dwriteFactory->CreateTextFormat(
00042             L"Segoe UI",
00043             nullptr,
00044             DWRITE_FONT_WEIGHT_MEDIUM,
00045             DWRITE_FONT_STYLE_NORMAL,
00046             DWRITE_FONT_STRETCH_NORMAL,
00047             GameInfoOverlayConstant::TitlePointSize,
00048             L"en-us",   // locale
00049             &m_textFormatTitle
00050             )
00051         );
00052
00053     DX::ThrowIfFailed(
00054         dwriteFactory->CreateTextFormat(
00055             L"Segoe UI",
00056             nullptr,
00057             DWRITE_FONT_WEIGHT_LIGHT,
00058             DWRITE_FONT_STYLE_NORMAL,
00059             DWRITE_FONT_STRETCH_NORMAL,
00060             GameInfoOverlayConstant::BodyPointSize,
00061             L"en-us",   // locale
00062             &m_textFormatBody
00063             )
00064         );
00065
00066     DX::ThrowIfFailed(
00067         m_textFormatTitle->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER)
00068         );
00069     DX::ThrowIfFailed(
00070         m_textFormatTitle->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00071         );
00072     DX::ThrowIfFailed(
00073         m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00074         );
00075     DX::ThrowIfFailed(
00076         m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00077         );
00078 }
00079
00080 //----------------------------------------------------------------------
00081
00082 void GameInfoOverlay::CreateDeviceDependentResources()
00083 {
00084     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00085
00086     DX::ThrowIfFailed(
00087         d2dContext->CreateSolidColorBrush(
00088             D2D1::ColorF(D2D1::ColorF::White),
00089             &m_textBrush
00090             )
00091         );
00092     DX::ThrowIfFailed(
00093         d2dContext->CreateSolidColorBrush(
00094             D2D1::ColorF(D2D1::ColorF::Black),
00095             &m_backgroundBrush
00096             )
00097         );
00098     DX::ThrowIfFailed(
00099         d2dContext->CreateSolidColorBrush(
00100             D2D1::ColorF(0xdb7100, 1.0f),
00101             &m_actionBrush
00102             )
00103         );
00104 }
00105
00106 //----------------------------------------------------------------------
00107
00108 void GameInfoOverlay::CreateWindowSizeDependentResources(D2D_SIZE_F overlaySize)
00109 {
00110     auto dpi = m_deviceResources->GetDpi();
00111     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00112     auto windowSize = m_deviceResources->GetLogicalSize();
00113
00114     m_levelBitmap = nullptr;
00115     m_tooSmallBitmap = nullptr;
00116
00117     m_titleRectangle = D2D1::RectF(
00118         GameInfoOverlayConstant::SideMargin,
00119         GameInfoOverlayConstant::TopMargin,
00120         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00121         GameInfoOverlayConstant::TopMargin + GameInfoOverlayConstant::TitleHeight
00122         );
00123     m_actionRectangle = D2D1::RectF(
00124         GameInfoOverlayConstant::SideMargin,
00125         overlaySize.height - (GameInfoOverlayConstant::ActionHeight + GameInfoOverlayConstant::BottomMargin),
00126         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00127         overlaySize.height - GameInfoOverlayConstant::BottomMargin
00128         );
00129     m_bodyRectangle = D2D1::RectF(
00130         GameInfoOverlayConstant::SideMargin,
00131         m_titleRectangle.bottom + GameInfoOverlayConstant::Separator,
00132         overlaySize.width - GameInfoOverlayConstant::SideMargin,
00133         m_actionRectangle.top - GameInfoOverlayConstant::Separator
00134         );
00135
00136     // Create a D2D Bitmap to be used for Game Info Overlay when waiting to
00137     // start a level or when display game statistics.
00138     D2D1_BITMAP_PROPERTIES1 properties;
00139     properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
00140     properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
00141     properties.dpiX = dpi;
00142     properties.dpiY = dpi;
00143     properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
00144     properties.colorContext = nullptr;
00145     DX::ThrowIfFailed(
00146         d2dContext->CreateBitmap(
00147             D2D1::SizeU(
00148                 static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
00149                 static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
00150                 ),
00151             nullptr,
00152             0,
00153             &properties,
00154             &m_levelBitmap
00155             )
00156         );
00157     d2dContext->SetTarget(m_levelBitmap.Get());
00158     d2dContext->BeginDraw();
00159     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00160     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
00161     d2dContext->DrawText(
00162         m_titleString->Data(),
00163         m_titleString->Length(),
00164         m_textFormatTitle.Get(),
00165         m_titleRectangle,
00166         m_textBrush.Get()
00167         );
00168     d2dContext->DrawText(
00169         m_bodyString->Data(),
00170         m_bodyString->Length(),
00171         m_textFormatBody.Get(),
00172         m_bodyRectangle,
00173         m_textBrush.Get()
00174         );
00175     d2dContext->DrawText(
00176         m_actionString->Data(),
00177         m_actionString->Length(),
00178         m_textFormatBody.Get(),
00179         m_actionRectangle,
00180         m_actionBrush.Get()
00181         );
00182     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00183     // is lost. It will be handled during the next call to Present.
00184     HRESULT hr = d2dContext->EndDraw();
00185     if (hr != D2DERR_RECREATE_TARGET)
00186     {
00187         DX::ThrowIfFailed(hr);
00188     }
00189
00190     // Create the TooSmall Bitmap.
00191     DX::ThrowIfFailed(
00192         d2dContext->CreateBitmap(
00193         D2D1::SizeU(
00194         static_cast<UINT32>(overlaySize.width * dpi / 96.0f),
00195         static_cast<UINT32>(overlaySize.height * dpi / 96.0f)
00196         ),
00197         nullptr,
00198         0,
00199         &properties,
00200         &m_tooSmallBitmap
00201         )
00202         );
00203     d2dContext->SetTarget(m_tooSmallBitmap.Get());
00204     d2dContext->BeginDraw();
00205     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00206     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
00207     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00208     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00209     Platform::String^ string = "Paused";
00210
00211     d2dContext->DrawText(
00212         string->Data(),
00213         string->Length(),
00214         m_textFormatTitle.Get(),
00215         m_bodyRectangle,
00216         m_textBrush.Get()
00217         );
00218     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00219     // is lost. It will be handled during the next call to Present.
00220     hr = d2dContext->EndDraw();
00221     if (hr != D2DERR_RECREATE_TARGET)
00222     {
00223         DX::ThrowIfFailed(hr);
00224     }
00225 }
00226
00227 //----------------------------------------------------------------------
00228
00229 ID2D1Bitmap1* GameInfoOverlay::Bitmap()
00230 {
00231     if (m_tooSmallActive)
00232     {
00233         return m_tooSmallBitmap.Get();
00234     }
00235     else
00236     {
00237         return m_levelBitmap.Get();
00238     }
00239 }
00240
00241 //----------------------------------------------------------------------
00242
00243 void GameInfoOverlay::ReleaseDeviceDependentResources()
00244 {
00245     m_levelBitmap.Reset();
00246     m_tooSmallBitmap.Reset();
00247     m_textBrush.Reset();
00248     m_backgroundBrush.Reset();
00249     m_actionBrush.Reset();
00250 }
00251
00252 //----------------------------------------------------------------------
00253
00254 void GameInfoOverlay::SetGameLoading(uint32 dots)
00255 {
00256     int length;
00257     m_titleString = "Loading Resources";
00258     m_bodyString = "";
00259
00260     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00261
00262     d2dContext->SetTarget(m_levelBitmap.Get());
00263     d2dContext->BeginDraw();
00264     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00265     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00266     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00267     d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.Get());
00268
00269     d2dContext->DrawText(
00270         m_titleString->Data(),
00271         m_titleString->Length(),
00272         m_textFormatTitle.Get(),
00273         m_titleRectangle,
00274         m_textBrush.Get()
00275         );
00276
00277     dots = dots % 10;
00278     for (length = 0; length < 25; length++)
00279     {
00280         wsbuffer[length] = L' ';
00281     }
00282     for (uint32 i = 0; i < dots; i++)
00283     {
00284         wsbuffer[length++] = 0x25CF;   // This is a Dot character in the font.
00285         wsbuffer[length++] = L' ';
00286         wsbuffer[length++] = L' ';
00287         wsbuffer[length++] = L' ';
00288     }
00289
00290     m_bodyString = ref new Platform::String(wsbuffer, length);
00291     d2dContext->DrawText(
00292         m_bodyString->Data(),
00293         m_bodyString->Length(),
00294         m_textFormatBody.Get(),
00295         m_bodyRectangle,
00296         m_actionBrush.Get()
00297         );
00298
00299     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00300     // is lost. It will be handled during the next call to Present.
00301     HRESULT hr = d2dContext->EndDraw();
00302     if (hr != D2DERR_RECREATE_TARGET)
00303     {
00304         DX::ThrowIfFailed(hr);
00305     }
00306 }
00307
00308 //----------------------------------------------------------------------
00309
00310 void GameInfoOverlay::SetGameStats(int maxLevel, int hitCount, int shotCount)
00311 {
00312     int length;
00313
00314     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00315
00316     d2dContext->SetTarget(m_levelBitmap.Get());
00317     d2dContext->BeginDraw();
00318     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00319     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00320     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00321     m_titleString = "High Score";
00322
00323     d2dContext->DrawText(
00324         m_titleString->Data(),
00325         m_titleString->Length(),
00326         m_textFormatTitle.Get(),
00327         m_titleRectangle,
00328         m_textBrush.Get()
00329         );
00330     length = swprintf_s(
00331         wsbuffer,
00332         bufferLength,
00333         L"Levels Completed %d\nTotal Points %d\nTotal Shots %d",
00334         maxLevel,
00335         hitCount,
00336         shotCount
00337         );
00338     m_bodyString = ref new Platform::String(wsbuffer, length);
00339     d2dContext->DrawText(
00340         m_bodyString->Data(),
00341         m_bodyString->Length(),
00342         m_textFormatBody.Get(),
00343         m_bodyRectangle,
00344         m_textBrush.Get()
00345         );
00346
00347     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00348     // is lost. It will be handled during the next call to Present.
00349     HRESULT hr = d2dContext->EndDraw();
00350     if (hr != D2DERR_RECREATE_TARGET)
00351     {
00352         DX::ThrowIfFailed(hr);
00353     }
00354 }
00355
00356 //----------------------------------------------------------------------
00357
00358 void GameInfoOverlay::SetGameOver(bool win, int maxLevel, int hitCount, int shotCount, int highScore)
00359 {
00360     int length;
00361
00362     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00363
00364     d2dContext->SetTarget(m_levelBitmap.Get());
00365     d2dContext->BeginDraw();
00366     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00367     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00368     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00369     if (win)
00370     {
00371         m_titleString = "You WON!";
00372     }
00373     else
00374     {
00375         m_titleString = "Game Over";
00376     }
00377     d2dContext->DrawText(
00378         m_titleString->Data(),
00379         m_titleString->Length(),
00380         m_textFormatTitle.Get(),
00381         m_titleRectangle,
00382         m_textBrush.Get()
00383         );
00384     length = swprintf_s(
00385         wsbuffer,
00386         bufferLength,
00387         L"Levels Completed %d\nTotal Points %d\nTotal Shots %d\n\nHigh Score %d\n",
00388         maxLevel,
00389         hitCount,
00390         shotCount,
00391         highScore
00392         );
00393     m_bodyString = ref new Platform::String(wsbuffer, length);
00394     d2dContext->DrawText(
00395         m_bodyString->Data(),
00396         m_bodyString->Length(),
00397         m_textFormatBody.Get(),
00398         m_bodyRectangle,
00399         m_textBrush.Get()
00400         );
00401
00402     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00403     // is lost. It will be handled during the next call to Present.
00404     HRESULT hr = d2dContext->EndDraw();
00405     if (hr != D2DERR_RECREATE_TARGET)
00406     {
00407         DX::ThrowIfFailed(hr);
00408     }
00409 }
00410
00411 //----------------------------------------------------------------------
00412
00413 void GameInfoOverlay::SetLevelStart(int level, Platform::String^ objective, float timeLimit, float bonusTime)
00414 {
00415     int length;
00416
00417     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00418
00419     d2dContext->SetTarget(m_levelBitmap.Get());
00420     d2dContext->BeginDraw();
00421     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00422     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00423     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00424     length = swprintf_s(wsbuffer, bufferLength, L"Level %d", level);
00425     m_titleString = ref new Platform::String(wsbuffer, length);
00426     d2dContext->DrawText(
00427         m_titleString->Data(),
00428         m_titleString->Length(),
00429         m_textFormatTitle.Get(),
00430         m_titleRectangle,
00431         m_textBrush.Get()
00432         );
00433
00434     if (bonusTime > 0.0f)
00435     {
00436         length = swprintf_s(
00437             wsbuffer,
00438             bufferLength,
00439             L"Objective: %ls\nTime  Limit: %6.1f sec\nBonus Time: %6.1f sec\n",
00440             objective->Data(),
00441             timeLimit,
00442             bonusTime
00443             );
00444     }
00445     else
00446     {
00447         length = swprintf_s(
00448             wsbuffer,
00449             bufferLength,
00450             L"Objective: %ls\nTime  Limit: %6.1f sec\n",
00451             objective->Data(),
00452             timeLimit
00453             );
00454     }
00455     m_bodyString = ref new Platform::String(wsbuffer, length);
00456     d2dContext->DrawText(
00457         m_bodyString->Data(),
00458         m_bodyString->Length(),
00459         m_textFormatBody.Get(),
00460         m_bodyRectangle,
00461         m_textBrush.Get()
00462         );
00463
00464     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00465     // is lost. It will be handled during the next call to Present.
00466     HRESULT hr = d2dContext->EndDraw();
00467     if (hr != D2DERR_RECREATE_TARGET)
00468     {
00469         DX::ThrowIfFailed(hr);
00470     }
00471 }
00472
00473 //----------------------------------------------------------------------
00474
00475 void GameInfoOverlay::SetPause(int /* level */, int /* hitCount */, int /* shotCount */, float /*timeRemaining */)
00476 {
00477     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00478
00479     d2dContext->SetTarget(m_levelBitmap.Get());
00480     d2dContext->BeginDraw();
00481     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00482     d2dContext->FillRectangle(&m_titleRectangle, m_backgroundBrush.Get());
00483     d2dContext->FillRectangle(&m_bodyRectangle, m_backgroundBrush.Get());
00484     m_titleString = "Game Paused";
00485     m_bodyString = "";
00486
00487     d2dContext->DrawText(
00488         m_titleString->Data(),
00489         m_titleString->Length(),
00490         m_textFormatTitle.Get(),
00491         m_bodyRectangle,
00492         m_textBrush.Get()
00493         );
00494
00495     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00496     // is lost. It will be handled during the next call to Present.
00497     HRESULT hr = d2dContext->EndDraw();
00498     if (hr != D2DERR_RECREATE_TARGET)
00499     {
00500         DX::ThrowIfFailed(hr);
00501     }
00502 }
00503
00504 //----------------------------------------------------------------------
00505
00506 void GameInfoOverlay::ShowTooSmall()
00507 {
00508     m_visible = true;
00509     m_tooSmallActive = true;
00510 }
00511
00512 //----------------------------------------------------------------------
00513
00514 void GameInfoOverlay::HideTooSmall()
00515 {
00516     m_visible = false;
00517     m_tooSmallActive = false;
00518 }
00519
00520 //----------------------------------------------------------------------
00521
00522 void GameInfoOverlay::SetAction(GameInfoOverlayCommand action)
00523 {
00524     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00525
00526     d2dContext->SetTarget(m_levelBitmap.Get());
00527     d2dContext->BeginDraw();
00528     d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00529     d2dContext->FillRectangle(&m_actionRectangle, m_backgroundBrush.Get());
00530
00531     switch (action)
00532     {
00533     case GameInfoOverlayCommand::PlayAgain:
00534         m_actionString = "Tap to play again ...";
00535         break;
00536     case GameInfoOverlayCommand::PleaseWait:
00537         m_actionString = "Level loading, please wait ...";
00538         break;
00539     case GameInfoOverlayCommand::TapToContinue:
00540         m_actionString = "Tap to continue ...";
00541         break;
00542     default:
00543         m_actionString = "";
00544         break;
00545     }
00546     if (action != GameInfoOverlayCommand::None)
00547     {
00548         d2dContext->DrawText(
00549             m_actionString->Data(),
00550             m_actionString->Length(),
00551             m_textFormatBody.Get(),
00552             m_actionRectangle,
00553             m_actionBrush.Get()
00554             );
00555     }
00556
00557     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00558     // is lost. It will be handled during the next call to Present.
00559     HRESULT hr = d2dContext->EndDraw();
00560     if (hr != D2DERR_RECREATE_TARGET)
00561     {
00562         DX::ThrowIfFailed(hr);
00563     }
00564 }
00565
00566 //----------------------------------------------------------------------
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/AppView.cpp Source File

  • 360VideoPlayback
  • cpp

AppView.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "AppView.h"
00003 #include "VideoGallery.xaml.h"
00004 #include <ppltasks.h>
00005
00006 using namespace _360VideoPlayback;
00007 using namespace concurrency;
00008 using namespace Platform;
00009 using namespace std;
00010 using namespace Windows::ApplicationModel;
00011 using namespace Windows::ApplicationModel::Activation;
00012 using namespace Windows::ApplicationModel::Core;
00013 using namespace Windows::Foundation;
00014 using namespace Windows::Graphics::Holographic;
00015 using namespace Windows::Media::Core;
00016 using namespace Windows::Media::Playback;
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::UI::ViewManagement;
00019
00020 MediaPlayer^ AppView::m_mediaPlayer = nullptr;
00021
00022 MediaPlayer^ AppView::GetMediaPlayer()
00023 {
00024     return m_mediaPlayer;
00025 }
00026
00027 AppViewSource::AppViewSource(Uri^ sourceUri)
00028     : m_sourceUri(sourceUri)
00029 {
00030 }
00031
00032 IFrameworkView^ AppViewSource::CreateView()
00033 {
00034     return ref new AppView(m_sourceUri);
00035 }
00036
00037 AppView::AppView(Uri^ sourceUri)
00038     : m_sourceUri(sourceUri)
00039 {
00040     m_mediaPlayer = ref new MediaPlayer();
00041 }
00042
00043 // IFrameworkView methods
00044
00045 // The first method called when the IFrameworkView is being created.
00046 // Use this method to subscribe for Windows shell events and to initialize your app.
00047 void AppView::Initialize(CoreApplicationView^ applicationView)
00048 {
00049     CoreWindow^ window = CoreWindow::GetForCurrentThread();
00050     if (window != nullptr)
00051     {
00052         window->Activated += ref new TypedEventHandler<CoreWindow^, WindowActivatedEventArgs^>(this, &AppView::OnMainViewActivated);
00053     }
00054     applicationView->Activated +=
00055         ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &AppView::OnViewActivated);
00056 }
00057
00058 void AppView::OnMainViewActivated(CoreWindow^ sender, WindowActivatedEventArgs^ args)
00059 {
00060     m_mainWindowReactivated = true;
00061     m_windowClosed = true;
00062     TryCloseWindow();
00063 }
00064
00065 // Called when the CoreWindow object is created (or re-created).
00066 void AppView::SetWindow(CoreWindow^ window)
00067 {
00068     ApplicationView::GetForCurrentView()->Consolidated +=
00069         ref new TypedEventHandler<ApplicationView^, ApplicationViewConsolidatedEventArgs^>(this, &AppView::OnConsolidated);
00070
00071     // Register event handlers for app lifecycle.
00072     CoreApplication::Suspending +=
00073         ref new EventHandler<SuspendingEventArgs^>(this, &AppView::OnSuspending);
00074
00075     CoreApplication::Resuming +=
00076         ref new EventHandler<Object^>(this, &AppView::OnResuming);
00077
00078     // Register for keypress notifications.
00079     window->KeyDown +=
00080         ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &AppView::OnKeyPressed);
00081
00082     // Register for notification that the app window is being closed.
00083     window->Closed +=
00084         ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &AppView::OnWindowClosed);
00085
00086     // Register for notifications that the app window is losing focus.
00087     window->VisibilityChanged +=
00088         ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &AppView::OnVisibilityChanged);
00089
00090     // At this point we have access to the device and we can create device-dependent
00091     // resources.
00092     m_deviceResources = _360VideoPlaybackMain::GetDeviceResources();
00093
00094     m_main = std::make_unique<_360VideoPlaybackMain>();
00095
00096     // Create a holographic space for the core window for the current view.
00097     // Presenting holographic frames that are created by this holographic space will put
00098     // the app into exclusive mode.
00099     m_holographicSpace = HolographicSpace::CreateForCoreWindow(window);
00100
00101     // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
00102     // space (when available) to create a Direct3D device. The HolographicSpace
00103     // uses this ID3D11Device to create and manage device-based resources such as
00104     // swap chains.
00105     m_deviceResources->SetHolographicSpace(m_holographicSpace);
00106
00107     // The main class uses the holographic space for updates and rendering.
00108     m_main->SetHolographicSpace(m_holographicSpace);
00109
00110     MediaSource^ source = MediaSource::CreateFromUri(m_sourceUri);
00111     m_mediaPlayer->MediaOpened += ref new TypedEventHandler<MediaPlayer^, Object^>(this, &AppView::OnMediaOpened);
00112     m_mediaPlayer->Source = source;
00113
00114     m_mediaPlayer->IsVideoFrameServerEnabled = true;
00115     m_mediaPlayer->IsLoopingEnabled = true;
00116 }
00117
00118 // The Load method can be used to initialize scene resources or to load a
00119 // previously saved app state.
00120 void AppView::Load(String^ entryPoint)
00121 {
00122 }
00123
00124 // This method is called after the window becomes active. It oversees the
00125 // update, draw, and present loop, and it also oversees window message processing.
00126 void AppView::Run()
00127 {
00128     CoreWindow^ window = CoreWindow::GetForCurrentThread();
00129     window->Activate();
00130
00131     while (!m_windowClosed)
00132     {
00133         if (m_ShadersNeed)
00134         {
00135             if (!m_ShadersCreated)
00136             {
00137                 m_main->CreateVideoShaders();
00138                 m_ShadersCreated = true;
00139             }
00140         }
00141         else
00142         {
00143             window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00144             continue;
00145         }
00146
00147         if (m_appViewConsolidated || m_mainWindowReactivated)
00148         {
00149             m_windowClosed = true;
00150             TryCloseWindow();
00151         }
00152         else
00153         {
00154             window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
00155             if (m_windowVisible && (m_holographicSpace != nullptr))
00156             {
00157                 HolographicFrame^ holographicFrame = m_main->Update();
00158
00159                 if (m_main->Render(holographicFrame))
00160                 {
00161                     // The holographic frame has an API that presents the swap chain for each
00162                     // holographic camera.
00163                     m_deviceResources->Present(holographicFrame);
00164                 }
00165             }
00166         }
00167     }
00168 }
00169
00170 // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00171 // class is torn down while the app is in the foreground.
00172 // This method is not often used, but IFrameworkView requires it and it will be called for
00173 // holographic apps.
00174 void AppView::Uninitialize()
00175 {
00176     if (m_mediaPlayer != nullptr)
00177     {
00178         m_mediaPlayer->Source = nullptr;
00179         m_mediaPlayer = nullptr;
00180     }
00181     if (m_main != nullptr)
00182     {
00183         m_main->UnregisterHolographicEventHandlers();
00184     }
00185 }
00186
00187
00188 // Application lifecycle event handlers
00189
00190 // Called when the app view is activated. Activates the app's CoreWindow.
00191 void AppView::OnViewActivated(CoreApplicationView^ sender, IActivatedEventArgs^ args)
00192 {
00193     // Run() won't start until the CoreWindow is activated.
00194     sender->CoreWindow->Activate();
00195 }
00196
00197 void AppView::OnSuspending(Object^ sender, SuspendingEventArgs^ args)
00198 {
00199     // Save app state asynchronously after requesting a deferral. Holding a deferral
00200     // indicates that the application is busy performing suspending operations. Be
00201     // aware that a deferral may not be held indefinitely; after about five seconds,
00202     // the app will be forced to exit.
00203     SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
00204
00205     create_task([this, deferral]()
00206     {
00207         m_deviceResources->Trim();
00208
00209         if (m_main != nullptr)
00210         {
00211             m_main->SaveAppState();
00212         }
00213
00214         //
00215         // TODO: Insert code here to save your app state.
00216         //
00217
00218         deferral->Complete();
00219     });
00220 }
00221
00222 void AppView::OnResuming(Object^ sender, Object^ args)
00223 {
00224     // Restore any data or state that was unloaded on suspend. By default, data
00225     // and state are persisted when resuming from suspend. Note that this event
00226     // does not occur if the app was previously terminated.
00227
00228     if (m_main != nullptr)
00229     {
00230         m_main->LoadAppState();
00231     }
00232
00233     //
00234     // TODO: Insert code here to load your app state.
00235     //
00236 }
00237
00238
00239 // Window event handlers
00240
00241 void AppView::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
00242 {
00243     m_windowVisible = args->Visible;
00244 }
00245
00246 void AppView::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
00247 {
00248     m_windowClosed = true;
00249 }
00250
00251
00252 // Input event handlers
00253
00254 void AppView::OnKeyPressed(CoreWindow^ sender, KeyEventArgs^ args)
00255 {
00256     //
00257     // TODO: Bluetooth keyboards are supported by HoloLens. You can use this method for
00258     //       keyboard input if you want to support it as an optional input method for
00259     //       your holographic app.
00260     //
00261
00262     if (args->VirtualKey == Windows::System::VirtualKey::Escape)
00263     {
00264         ApplicationViewSwitcher::SwitchAsync(VideoGallery::GetMainViewId(), ApplicationView::GetForCurrentView()->Id, ApplicationViewSwitchingOptions::ConsolidateViews);
00265     }
00266 }
00267
00268
00269 void AppView::OnConsolidated(ApplicationView^ sender, ApplicationViewConsolidatedEventArgs^ args)
00270 {
00271     m_appViewConsolidated = true;
00272     m_windowClosed = true;
00273     TryCloseWindow();
00274     Uninitialize();
00275 }
00276
00277 void AppView::OnMediaOpened(MediaPlayer^ sender, Object^ args)
00278 {
00279     m_ShadersNeed = true;
00280 }
00281
00282 void AppView::TryCloseWindow()
00283 {
00284     CoreWindow^ window = CoreWindow::GetForCurrentThread();
00285     if (window != nullptr)
00286     {
00287         window->Close();
00288     }
00289 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/DeviceWatcherHelper.h Source File

  • DeviceEnumerationAndPairing
  • cpp

DeviceWatcherHelper.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "DisplayHelpers.h"
00005
00006 namespace SDKTemplate
00007 {
00008     /// <summary>
00009     /// Updates an IObservableVector based on events from a DeviceWatcher.
00010     /// </summary>
00011     /// <remarks>
00012     /// Encapsulates the work necessary to register for watcher events,
00013     /// start and stop the watcher, handle race conditions, and break cycles.
00014     /// </remarks>
00015     public ref class DeviceWatcherHelper sealed
00016     {
00017     public:
00018         DeviceWatcherHelper(
00019             Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection,
00020             Windows::UI::Core::CoreDispatcher^ dispatcher) :
00021             resultCollection(resultCollection),
00022             dispatcher(dispatcher)
00023         {
00024             UpdateStatus = true;
00025         }
00026
00027         event Windows::Foundation::TypedEventHandler<Windows::Devices::Enumeration::DeviceWatcher^, Platform::String^>^ DeviceChanged;
00028         property bool UpdateStatus;
00029
00030         void StartWatcher(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher);
00031         void StopWatcher();
00032         void Reset();
00033         bool IsWatcherRunning();
00034
00035     private:
00036         Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher;
00037         Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection;
00038         Windows::UI::Core::CoreDispatcher^ dispatcher;
00039
00040         static bool IsWatcherStarted(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher);
00041         void Watcher_DeviceAdded(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Windows::Devices::Enumeration::DeviceInformation^ deviceInfo);
00042         void Watcher_DeviceUpdated(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^ deviceInfoUpdate);
00043         void Watcher_DeviceRemoved(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Windows::Devices::Enumeration::DeviceInformationUpdate^ deviceInfoUpdate);
00044         void Watcher_EnumerationCompleted(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Platform::Object^ e);
00045         void Watcher_Stopped(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Platform::Object^ e);
00046         void RaiseDeviceChanged(Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher, Platform::String^ id);
00047     };
00048 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario5_RoundingAndPadding.xaml.h Source File

  • NumberFormatting
  • cpp

Scenario5_RoundingAndPadding.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "pch.h"
00006 #include "Scenario5_RoundingAndPadding.g.h"
00007
00008 namespace SDKTemplate
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     [Windows::Foundation::Metadata::WebHostHidden]
00014     public ref class Scenario5_RoundingAndPadding sealed
00015     {
00016     public:
00017         Scenario5_RoundingAndPadding();
00018
00019     private:
00020         // Class methods that implement the scenarios
00021         Platform::String^ DisplayRoundingAlgorithmAsString(Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm);
00022         Platform::String^ DoPaddingScenarios(Windows::Globalization::NumberFormatting::INumberFormatter^ formatter);
00023         Platform::String^ DoPaddingAndRoundingScenarios(Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm, unsigned int significantDigits, int integerDigits, int fractionalDigits);
00024         Platform::String^ DoCurrencyRoundingScenarios(Platform::String^ currencyCode, Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm);
00025         Platform::String^ DoIncrementRoundingScenarios(Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm);
00026         Platform::String^ DoSignificantDigitRoundingScenarios(Windows::Globalization::NumberFormatting::RoundingAlgorithm roundingAlgorithm);
00027
00028         void Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:20:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cppwinrt/Project.idl Source File

  • UserConsentVerifier
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_CheckConsentAvailability : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_CheckConsentAvailability();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_RequestConsent : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_RequestConsent();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/pch.h Source File

  • Playlists
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/CalibrationBar.xaml.cpp Source File

  • OrientationSensor
  • cpp

CalibrationBar.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // CalibrationBar.xaml.cpp
00014 // Implementation of the CalibrationBar class
00015 //
00016
00017 #include "pch.h"
00018 #include "CalibrationBar.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Media::Imaging;
00025 using namespace Windows::UI::Xaml::Navigation;
00026 using namespace Windows::Devices::Sensors;
00027 using namespace Windows::Foundation;
00028 using namespace Windows::UI::Core;
00029 using namespace Platform;
00030
00031 static const double LAYOUT_WIDTH_768 = 768.0;
00032
00033 CalibrationBar::CalibrationBar() : _barDismissed(false)
00034 {
00035     InitializeComponent();
00036
00037     _lastCalibrationTime.QuadPart = 0;
00038
00039     TimeSpan span;
00040     span.Duration = CALIBRATION_POPUP_AUTO_DISMISS_TIME_TICKS;
00041     _calibrationTimer = ref new DispatcherTimer();
00042     _calibrationTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &CalibrationBar::OnAutoDismissTimerExpired);
00043     _calibrationTimer->Interval = span;
00044 }
00045
00046 /// <summary>
00047 /// Called when the application would like to show the calibration bar to the user
00048 /// to improve sensor accuracy.
00049 /// </summary>
00050 /// <param name="accuracy">Current accuracy of the sensor.</param>
00051 void CalibrationBar::RequestCalibration(MagnetometerAccuracy accuracy)
00052 {
00053     // Only show the calibration bar if it is hidden and sufficient
00054     // time has passed since it was last hidden.
00055     if (!CalibrationPopup->IsOpen && CanShowCalibrationBar(accuracy))
00056     {
00057         InvalidateLayout();
00058         _windowSizeEventToken = Window::Current->SizeChanged += ref new WindowSizeChangedEventHandler(this, &CalibrationBar::OnWindowSizeChanged);
00059         HideGuidance(); // Calibration image hidden by default
00060         CalibrationPopup->IsOpen = true;
00061         _calibrationTimer->Start();
00062     }
00063 }
00064
00065 /// <summary>
00066 /// Called when sensor accuracy is sufficient and the application would like to
00067 /// hide the calibration bar.
00068 /// </summary>
00069 void CalibrationBar::Hide()
00070 {
00071     if (CalibrationPopup->IsOpen)
00072     {
00073         // Hide the calibration bar and save the current time.
00074         FILETIME filetime;
00075         GetSystemTimeAsFileTime(&filetime);
00076         _lastCalibrationTime.HighPart = filetime.dwHighDateTime;
00077         _lastCalibrationTime.LowPart = filetime.dwLowDateTime;
00078         HideGuidance();
00079         CalibrationPopup->IsOpen = false;
00080         Window::Current->SizeChanged -= _windowSizeEventToken;
00081         _calibrationTimer->Stop();
00082     }
00083 }
00084
00085 /// <summary>
00086 /// Invoked when the window size is updated.
00087 /// </summary>
00088 /// <param name="sender">Instance that triggered the event.</param>
00089 /// <param name="e">Event data describing the conditions that led to the event.</param>
00090 void CalibrationBar::OnWindowSizeChanged(Object^ sender, WindowSizeChangedEventArgs^ e)
00091 {
00092     InvalidateLayout();
00093 }
00094
00095 /// <summary>
00096 /// Updates the calibration bar layout based on the current window width.
00097 /// </summary>
00098 void CalibrationBar::InvalidateLayout()
00099 {
00100     CalibrationGrid->Width = Window::Current->Bounds.Width;
00101
00102     if (CalibrationGrid->Width < LAYOUT_WIDTH_768)
00103     {
00104         Grid::SetRow(DismissPopup, 1);
00105         Grid::SetColumn(DismissPopup, 1);
00106
00107         CalibrationGridTop->Margin = Thickness(0, 24, 20, 15);
00108         DismissPopup->Margin = Thickness(66, 15, 0, 0);
00109     }
00110     else
00111     {
00112         Grid::SetRow(DismissPopup, 0);
00113         Grid::SetColumn(DismissPopup, 2);
00114
00115         CalibrationGridTop->Margin = Thickness(0, 19, 66, 19);
00116         DismissPopup->Margin = Thickness(66, 0, 0, 0);
00117     }
00118 }
00119
00120 /// <summary>
00121 /// Called to determine if sufficient time has passed since the calibration bar
00122 /// was hidden to show the calibration bar again. This suppression time is
00123 /// dependent on the current sensor accuracy.
00124 /// </summary>
00125 /// <param name="accuracy">Current accuracy of the sensor.</param>
00126 bool CalibrationBar::CanShowCalibrationBar(MagnetometerAccuracy accuracy)
00127 {
00128     bool showBar = false;
00129     if (!_barDismissed)
00130     {
00131         FILETIME filetime;
00132         ULARGE_INTEGER now;
00133         GetSystemTimeAsFileTime(&filetime);
00134         now.HighPart = filetime.dwHighDateTime;
00135         now.LowPart = filetime.dwLowDateTime;
00136
00137         if ((accuracy == MagnetometerAccuracy::Approximate) &&
00138             (_lastCalibrationTime.QuadPart + SUPPRESS_DURATION_APPROXIMATE_TICKS <= now.QuadPart))
00139         {
00140             showBar = true;
00141         }
00142         else if ((accuracy == MagnetometerAccuracy::Unreliable) &&
00143             (_lastCalibrationTime.QuadPart + SUPPRESS_DURATION_UNRELIABLE_TICKS <= now.QuadPart))
00144         {
00145             showBar = true;
00146         }
00147     }
00148     return showBar;
00149 }
00150
00151 /// <summary>
00152 /// This is the click handler for the show guidance button.
00153 /// </summary>
00154 /// <param name="sender"></param>
00155 /// <param name="e"></param>
00156 void CalibrationBar::ShowGuidanceButton_Click(Object^ sender, RoutedEventArgs^ e)
00157 {
00158     if (Guidance->Visibility == Windows::UI::Xaml::Visibility::Collapsed)
00159     {
00160         ShowGuidance();
00161     }
00162 }
00163
00164 /// <summary>
00165 /// This is the click handler for the hide guidance button.
00166 /// </summary>
00167 /// <param name="sender"></param>
00168 /// <param name="e"></param>
00169 void CalibrationBar::HideGuidanceButton_Click(Object^ sender, RoutedEventArgs^ e)
00170 {
00171     if (Guidance->Visibility == Windows::UI::Xaml::Visibility::Visible)
00172     {
00173         HideGuidance();
00174     }
00175 }
00176
00177 /// <summary>
00178 /// This is the click handler for the dismiss popup button. It hides the
00179 /// calibration bar and prevents it from being shown again for the lifetime
00180 /// of the app.
00181 /// </summary>
00182 /// <param name="sender"></param>
00183 /// <param name="e"></param>
00184 void CalibrationBar::DismissPopup_Click(Object^ sender, RoutedEventArgs^ e)
00185 {
00186     // Don't show the calibration bar again.
00187     _barDismissed = true;
00188     Hide();
00189 }
00190
00191 /// <summary>
00192 /// Expands the calibration bar to show the calibration image to the user.
00193 /// </summary>
00194 /// <param name="sender"></param>
00195 /// <param name="e"></param>
00196 void CalibrationBar::ShowGuidance()
00197 {
00198     ShowGuidanceButton->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00199     HideGuidanceButton->Visibility = Windows::UI::Xaml::Visibility::Visible;
00200     Guidance->Visibility = Windows::UI::Xaml::Visibility::Visible;
00201 }
00202
00203 /// <summary>
00204 /// Collapses the calibration bar to hide the calibration image from the user.
00205 /// </summary>
00206 /// <param name="sender"></param>
00207 /// <param name="e"></param>
00208 void CalibrationBar::HideGuidance()
00209 {
00210     HideGuidanceButton->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00211     ShowGuidanceButton->Visibility = Windows::UI::Xaml::Visibility::Visible;
00212     Guidance->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00213 }
00214
00215 /// <summary>
00216 /// This is the handler for the auto dismiss timer. After the calibraiton bar
00217 /// has been shown for the maximum time, it is automatically hidden.
00218 /// </summary>
00219 /// <param name="sender"></param>
00220 /// <param name="e"></param>
00221 void CalibrationBar::OnAutoDismissTimerExpired(Object^ sender, Object^ e)
00222 {
00223     Hide();
00224 }
Generated on Fri Nov 15 2024 22:18:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/AppView.h Source File

  • BasicHologram
  • cpp

AppView.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "BasicHologramMain.h"
00005
00006 namespace BasicHologram
00007 {
00008     // IFrameworkView class. Connects the app with the Windows shell and handles application lifecycle events.
00009     ref class AppView sealed : public Windows::ApplicationModel::Core::IFrameworkView
00010     {
00011     public:
00012         AppView();
00013
00014         // IFrameworkView methods.
00015         virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
00016         virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
00017         virtual void Load(Platform::String^ entryPoint);
00018         virtual void Run();
00019         virtual void Uninitialize();
00020
00021     protected:
00022         // Application lifecycle event handlers.
00023         void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args);
00024         void OnViewActivated(Windows::ApplicationModel::Core::CoreApplicationView^ sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
00025         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
00026         void OnResuming(Platform::Object^ sender, Platform::Object^ args);
00027
00028         // Window event handlers.
00029         void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
00030         void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
00031
00032         // CoreWindow input event handlers.
00033         void OnKeyPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
00034         void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
00035
00036     private:
00037         std::unique_ptr<BasicHologramMain> m_main;
00038
00039         std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00040         bool                                                m_windowClosed  = false;
00041         bool                                                m_windowVisible = true;
00042
00043         // The holographic space the app will use for rendering.
00044         Windows::Graphics::Holographic::HolographicSpace^   m_holographicSpace = nullptr;
00045     };
00046
00047     // The entry point for the app.
00048     ref class AppViewSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
00049     {
00050     public:
00051         virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
00052     };
00053 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/Scenario1_SetRecordProfile.xaml.cs Source File

  • CameraProfile
  • cs

Scenario1_SetRecordProfile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace CameraProfile
00013 {
00014     using System;
00015     using System.Collections.Generic;
00016     using System.Globalization;
00017     using System.Linq;
00018     using System.Threading.Tasks;
00019     using Windows.Devices.Enumeration;
00020     using Windows.Media.Capture;
00021     using Windows.UI.Xaml;
00022     using Windows.UI.Xaml.Controls;
00023     using Windows.UI.Xaml.Navigation;
00024     using SDKTemplate;
00025
00026     /// <summary>
00027     /// SetRecordProfile page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     public sealed partial class Scenario1_SetRecordProfile : Page
00030     {
00031         /// <summary>
00032         /// Private MainPage object for status updates
00033         /// </summary>
00034         private MainPage rootPage;
00035
00036         /// <summary>
00037         /// Initializes a new instance of the <see cref="Scenario1_SetRecordProfile"/> class.
00038         /// </summary>
00039         public Scenario1_SetRecordProfile()
00040         {
00041             this.InitializeComponent();
00042         }
00043
00044         /// <summary>
00045         /// Override default OnNavigateTo to initialize
00046         /// the rootPage object for Status message updates
00047         /// </summary>
00048         /// <param name="e">Contains state information and event data associated with the event</param>
00049         protected override void OnNavigatedTo(NavigationEventArgs e)
00050         {
00051             rootPage = MainPage.Current;
00052         }
00053
00054         /// <summary>
00055         /// Locates a video profile for the back camera and then queries if
00056         /// the discovered profile supports 640x480 30 FPS recording.
00057         /// If a supported profile is located, then we configure media
00058         /// settings to the matching profile. Else we use default profile.
00059         /// </summary>
00060         /// <param name="sender">Contains information regarding button that fired event</param>
00061         /// <param name="e">Contains state information and event data associated with the event</param>
00062         private async void InitRecordProfileBtn_Click(object sender, RoutedEventArgs e)
00063         {
00064             MediaCapture mediaCapture = new MediaCapture();
00065             MediaCaptureInitializationSettings mediaInitSettings = new MediaCaptureInitializationSettings();
00066             string videoDeviceId = string.Empty;
00067
00068             // Look for a video capture device Id with a video profile matching panel location
00069             videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);
00070
00071             if (string.IsNullOrEmpty(videoDeviceId))
00072             {
00073                 await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
00074                 return;
00075             }
00076
00077             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Found video capture device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
00078             await LogStatusToOutputBox("Retrieving all Video Profiles");
00079             IReadOnlyList<MediaCaptureVideoProfile> profiles = MediaCapture.FindAllVideoProfiles(videoDeviceId);
00080
00081             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of Video Profiles found: {0}", profiles.Count));
00082
00083             // Output all Video Profiles found, frame rate is rounded up for display purposes
00084             foreach (var profile in profiles)
00085             {
00086                 var description = profile.SupportedRecordMediaDescription;
00087                 foreach (var desc in description)
00088                 {
00089                     await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture,
00090                         "Video Profile Found: Profile Id: {0}\r\n Width: {1} Height: {2} FrameRate: {3}", profile.Id, desc.Width, desc.Height, Math.Round(desc.FrameRate).ToString()));
00091                 }
00092             }
00093
00094             // Look for WVGA 30FPS profile
00095             await LogStatusToOutputBox("Querying for matching WVGA 30FPS Profile");
00096             var match = (from profile in profiles
00097                          from desc in profile.SupportedRecordMediaDescription
00098                          where desc.Width == 640 && desc.Height == 480 && Math.Round(desc.FrameRate) == 30
00099                          select new { profile, desc }).FirstOrDefault();
00100
00101             if (match != null)
00102             {
00103                 mediaInitSettings.VideoProfile = match.profile;
00104                 mediaInitSettings.RecordMediaDescription = match.desc;
00105                 await LogStatus(string.Format(CultureInfo.InvariantCulture,
00106                         "Matching WVGA 30FPS Video Profile found: \r\n Profile Id: {0}\r\n Width: {1} Height: {2} FrameRate: {3}",
00107                         mediaInitSettings.VideoProfile.Id, mediaInitSettings.RecordMediaDescription.Width,
00108                         mediaInitSettings.RecordMediaDescription.Height, Math.Round(mediaInitSettings.RecordMediaDescription.FrameRate).ToString()), NotifyType.StatusMessage);
00109             }
00110             else
00111             {
00112                 // Could not locate a WVGA 30FPS profile, use default video recording profile
00113                 mediaInitSettings.VideoProfile = profiles[0];
00114                 await LogStatus("Could not locate a matching profile, setting to default recording profile", NotifyType.ErrorMessage);
00115             }
00116
00117             await mediaCapture.InitializeAsync(mediaInitSettings);
00118             await LogStatusToOutputBox("Media Capture settings initialized to selected profile");
00119
00120         }
00121
00122         /// <summary>
00123         /// Locates a video profile for the back camera and then queries if
00124         /// the discovered profile is a matching custom profile.
00125         /// If a custom profile is located, we configure media
00126         /// settings to the custom profile. Else we use default profile.
00127         /// </summary>
00128         /// <param name="sender">Contains information regarding button that fired event</param>
00129         /// <param name="e">Contains state information and event data associated with the event</param>
00130         private async void InitCustomProfileBtn_Click(object sender, RoutedEventArgs e)
00131         {
00132             MediaCapture mediaCapture = new MediaCapture();
00133             MediaCaptureInitializationSettings mediaInitSettings = new MediaCaptureInitializationSettings();
00134             string videoDeviceId = string.Empty;
00135
00136             // For demonstration purposes, we use the Profile Id from WVGA 640x480 30 FPS profile available
00137             // on desktop simulator and phone emulators
00138             string customProfileId = "{A0E517E8-8F8C-4F6F-9A57-46FC2F647EC0},0";
00139
00140             videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);
00141
00142             if (string.IsNullOrEmpty(videoDeviceId))
00143             {
00144                 await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
00145                 return;
00146             }
00147
00148             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Found video capture device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
00149             await LogStatusToOutputBox("Querying device for custom profile support");
00150             mediaInitSettings.VideoProfile =  (from profile in MediaCapture.FindAllVideoProfiles(videoDeviceId)
00151                                  where profile.Id == customProfileId
00152                                  select profile).FirstOrDefault();
00153
00154             // In the event the profile isn't located, we set Video Profile to the default
00155             if (mediaInitSettings.VideoProfile == null)
00156             {
00157                 await LogStatus("Could not locate a matching profile, setting to default recording profile", NotifyType.ErrorMessage);
00158                 mediaInitSettings.VideoProfile = MediaCapture.FindAllVideoProfiles(videoDeviceId).FirstOrDefault();
00159             }
00160
00161             await LogStatus(string.Format(CultureInfo.InvariantCulture, "Custom recording profile located: {0}", customProfileId), NotifyType.StatusMessage);
00162             await mediaCapture.InitializeAsync(mediaInitSettings);
00163         }
00164
00165         /// <summary>
00166         /// Helper method to obtain a device Id that supports a Video Profile.
00167         /// If no Video Profile is found we return empty string indicating that there isn't a device on
00168         /// the desired panel with a supported Video Profile.
00169         /// </summary>
00170         /// <param name="panel">Contains Device Enumeration information regarding camera panel we are looking for</param>
00171         /// <returns>Device Information Id string</returns>
00172         public async Task<string> GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel panel)
00173         {
00174             string deviceId = string.Empty;
00175
00176             // Find all video capture devices
00177             await LogStatusToOutputBox("Looking for all video capture devices");
00178             DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00179             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of video capture devices found: {0}", devices.Count.ToString()));
00180
00181             // Loop through devices looking for device that supports Video Profile
00182             foreach (var device in devices)
00183             {
00184                 // Check if the device on the requested panel supports Video Profile
00185                 if (MediaCapture.IsVideoProfileSupported(device.Id) && device.EnclosureLocation.Panel == panel)
00186                 {
00187                     // We've located a device that supports Video Profiles on expected panel
00188                     deviceId = device.Id;
00189                     break;
00190                 }
00191             }
00192
00193             return deviceId;
00194         }
00195
00196         /// <summary>
00197         /// Marshall log message to the UI thread
00198         /// and update outputBox, this method is for more general messages
00199         /// </summary>
00200         /// <param name="message">Message to log to the outputBox</param>
00201         private async Task LogStatusToOutputBox(string message)
00202         {
00203             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00204             {
00205                 outputBox.Text += message + "\r\n";
00206                 outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
00207             });
00208         }
00209
00210         /// <summary>
00211         /// Method to log Status to Main Status block,
00212         /// this method is for important status messages to be
00213         /// displayed at bottom of scenario page
00214         /// </summary>
00215         /// <param name="message">Message to log to the output box</param>
00216         /// <param name="type">Notification Type for status message</param>
00217         private async Task LogStatus(string message, NotifyType type)
00218         {
00219             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00220             {
00221                 rootPage.NotifyUser(message, type);
00222             });
00223             await LogStatusToOutputBox(message);
00224         }
00225
00226
00227     }
00228 }
Generated on Fri Nov 15 2024 22:18:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LampArrayInfo Member List

This is the complete list of members for LampArrayInfo, including all inherited members.
availabilityChangedRevoker | LampArrayInfo |
displayName | LampArrayInfo |
id | LampArrayInfo |
lampArray | LampArrayInfo |
LampArrayInfo(winrt::hstring const &id, winrt::hstring const &displayName, winrt::Windows::Devices::Lights::LampArray const &lampArray) | LampArrayInfo | [inline]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario1.cpp Source File

  • FileAccess
  • cppwinrt

Scenario1.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1.h"
00014 #include "Scenario1.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario1::Scenario1()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     fire_and_forget Scenario1::CreateFileButton_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         auto lifetime = get_strong();
00032         StorageFolder storageFolder = co_await KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary);
00033         try
00034         {
00035             SampleState::SampleFile(co_await storageFolder.CreateFileAsync(SampleState::FileName(), CreationCollisionOption::ReplaceExisting));
00036             rootPage.NotifyUser(L"The file '" + SampleState::SampleFile().Name() + L"' was created.", NotifyType::StatusMessage);
00037         }
00038         catch (const hresult_error& ex)
00039         {
00040             // I/O errors are reported as exceptions.
00041             rootPage.NotifyUser(
00042                 L"Error creating file '" + SampleState::FileName() + L"': " + ex.message(), NotifyType::ErrorMessage);
00043         }
00044     }
00045 }
Generated on Fri Nov 15 2024 22:19:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/pch.h Source File

  • ExtendedExecution
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario4.xaml.cs Source File

  • ApplicationResources
  • cs

scenario4.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class Scenario4 : Page
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public Scenario4()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// Invoked when this page is about to be displayed in a Frame.
00035         /// </summary>
00036         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037         /// property is typically used to configure the page.</param>
00038         protected override void OnNavigatedTo(NavigationEventArgs e)
00039         {
00040         }
00041     }
00042 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

App Member List

This is the complete list of members for App, including all inherited members.
CreateView() | App | [inline]
Initialize(CoreApplicationView const &applicationView) | App | [inline]
Load(winrt::hstring const &) | App | [inline]
m_deviceResources | App | [private]
m_main | App | [private]
OnActivated(CoreApplicationView const &, IActivatedEventArgs const &) | App | [inline]
OnDisplayContentsInvalidated(DisplayInformation const &, IInspectable const &) | App | [inline]
OnDpiChanged(DisplayInformation const &sender, IInspectable const &) | App | [inline]
OnOrientationChanged(DisplayInformation const &sender, IInspectable const &) | App | [inline]
OnResuming(IInspectable const &, IInspectable const &) | App | [inline]
OnStereoEnabledChanged(DisplayInformation const &, IInspectable const &) | App | [inline]
OnSuspending(IInspectable const &, SuspendingEventArgs const &args) | App | [inline]
OnVisibilityChanged(CoreWindow const &, VisibilityChangedEventArgs const &args) | App | [inline]
OnWindowActivationChanged(CoreWindow const &, WindowActivatedEventArgs const &args) | App | [inline]
OnWindowClosed(CoreWindow const &, CoreWindowEventArgs const &) | App | [inline]
OnWindowSizeChanged(CoreWindow const &, WindowSizeChangedEventArgs const &args) | App | [inline]
Run() | App | [inline]
SetWindow(CoreWindow const &window) | App | [inline]
Uninitialize() | App | [inline]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/SampleConfiguration.cpp Source File

  • PosPrinter
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace SDKTemplate;
00020 using namespace Windows::Devices::PointOfService;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::UI::Core;
00023
00024 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00025 {
00026     { "Find, claim, and enable printer", "SDKTemplate.Scenario1_FindClaimEnable" },
00027     { "Print receipt", "SDKTemplate.Scenario2_PrintReceipt" },
00028     { "Multiple claims", "SDKTemplate.Scenario3_MultipleClaims" },
00029 };
00030
00031 void MainPage::SubscribeToReleaseDeviceRequested()
00032 {
00033     releaseDeviceRequestedToken = ClaimedPrinter->ReleaseDeviceRequested += ref new TypedEventHandler<ClaimedPosPrinter^, PosPrinterReleaseDeviceRequestedEventArgs^>(this, &MainPage::ClaimedPrinter_ReleaseDeviceRequested);
00034 }
00035
00036 void MainPage::ReleaseClaimedPrinter()
00037 {
00038     if (ClaimedPrinter != nullptr)
00039     {
00040         ClaimedPrinter->ReleaseDeviceRequested -= releaseDeviceRequestedToken;
00041         delete ClaimedPrinter;
00042         ClaimedPrinter = nullptr;
00043         if (StateChanged) StateChanged();
00044     }
00045 }
00046
00047 void MainPage::ReleaseAllPrinters()
00048 {
00049     ReleaseClaimedPrinter();
00050
00051     if (Printer != nullptr)
00052     {
00053         delete Printer;
00054         Printer = nullptr;
00055         if (StateChanged) StateChanged();
00056     }
00057 }
00058
00059 /// <summary>
00060 /// If the "Retain device" checkbox is checked, we retain the device.
00061 /// Otherwise, we allow the other claimant to claim the device.
00062 /// </summary>
00063 void MainPage::ClaimedPrinter_ReleaseDeviceRequested(ClaimedPosPrinter^ sender, PosPrinterReleaseDeviceRequestedEventArgs^ args)
00064 {
00065     if (IsAnImportantTransaction)
00066     {
00067         create_task(sender->RetainDeviceAsync());
00068     }
00069     else
00070     {
00071         create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00072         {
00073             NotifyUser("Lost printer claim.", NotifyType::ErrorMessage);
00074             ReleaseClaimedPrinter();
00075         })));
00076     }
00077 }
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/DeviceResources.h Source File

  • Simple3DGameDX
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetWindow(Windows::UI::Core::CoreWindow^ window);
00029         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void UpdateStereoState();
00033         void ValidateDevice();
00034         void HandleDeviceLost();
00035         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00036         void Trim();
00037         void Present();
00038
00039         // Device Accessors.
00040         Windows::Foundation::Size GetOutputSize() const                     { return m_outputSize; }
00041         Windows::Foundation::Size GetLogicalSize() const                    { return m_logicalSize; }
00042         Windows::Foundation::Size GetRenderTargetSize() const               { return m_d3dRenderTargetSize; }
00043         bool                    GetStereoState() const                      { return m_stereoEnabled; }
00044         float                   GetDpi() const                              { return m_dpi; }
00045
00046         // D3D Accessors.
00047         ID3D11Device3*          GetD3DDevice() const                        { return m_d3dDevice.Get(); }
00048         ID3D11DeviceContext3*   GetD3DDeviceContext() const                 { return m_d3dContext.Get(); }
00049         IDXGISwapChain1*        GetSwapChain() const                        { return m_swapChain.Get(); }
00050         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const               { return m_d3dFeatureLevel; }
00051         ID3D11RenderTargetView* GetBackBufferRenderTargetView() const       { return m_d3dRenderTargetView.Get(); }
00052         ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight() const  { return m_d3dRenderTargetViewRight.Get(); }
00053         ID3D11DepthStencilView* GetDepthStencilView() const                 { return m_d3dDepthStencilView.Get(); }
00054         D3D11_VIEWPORT          GetScreenViewport() const                   { return m_screenViewport; }
00055         DirectX::XMFLOAT4X4     GetOrientationTransform3D() const           { return m_orientationTransform3D; }
00056
00057         // D2D Accessors.
00058         ID2D1Factory3*          GetD2DFactory() const                       { return m_d2dFactory.Get(); }
00059         ID2D1Device2*           GetD2DDevice() const                        { return m_d2dDevice.Get(); }
00060         ID2D1DeviceContext2*    GetD2DDeviceContext() const                 { return m_d2dContext.Get(); }
00061         ID2D1Bitmap1*           GetD2DTargetBitmap() const                  { return m_d2dTargetBitmap.Get(); }
00062         ID2D1Bitmap1*           GetD2DTargetBitmapRight() const             { return m_d2dTargetBitmapRight.Get(); }
00063         IDWriteFactory3*        GetDWriteFactory() const                    { return m_dwriteFactory.Get(); }
00064         IWICImagingFactory2*    GetWicImagingFactory() const                { return m_wicFactory.Get(); }
00065         D2D1::Matrix3x2F        GetOrientationTransform2D() const           { return m_orientationTransform2D; }
00066
00067     private:
00068         void CreateDeviceIndependentResources();
00069         void CreateDeviceResources();
00070         void CreateWindowSizeDependentResources();
00071         DXGI_MODE_ROTATION ComputeDisplayRotation();
00072         void CheckStereoEnabledStatus();
00073
00074         // Direct3D objects.
00075         Microsoft::WRL::ComPtr<ID3D11Device3>           m_d3dDevice;
00076         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>    m_d3dContext;
00077         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00078
00079         // Direct3D rendering objects. Required for 3D.
00080         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00081         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>  m_d3dRenderTargetViewRight;
00082         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00083         D3D11_VIEWPORT                                  m_screenViewport;
00084
00085         // Direct2D drawing components.
00086         Microsoft::WRL::ComPtr<ID2D1Factory3>           m_d2dFactory;
00087         Microsoft::WRL::ComPtr<ID2D1Device2>            m_d2dDevice;
00088         Microsoft::WRL::ComPtr<ID2D1DeviceContext2>     m_d2dContext;
00089         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmap;
00090         Microsoft::WRL::ComPtr<ID2D1Bitmap1>            m_d2dTargetBitmapRight;
00091
00092         // DirectWrite drawing components.
00093         Microsoft::WRL::ComPtr<IDWriteFactory3>         m_dwriteFactory;
00094         Microsoft::WRL::ComPtr<IWICImagingFactory2>     m_wicFactory;
00095
00096         // Cached reference to the Window.
00097         Platform::Agile<Windows::UI::Core::CoreWindow>  m_window;
00098
00099         // Cached device properties.
00100         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00101         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00102         Windows::Foundation::Size                       m_outputSize;
00103         Windows::Foundation::Size                       m_logicalSize;
00104         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00105         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00106         float                                           m_dpi;
00107         bool                                            m_stereoEnabled;
00108
00109         // Transforms used for display orientation.
00110         D2D1::Matrix3x2F                                m_orientationTransform2D;
00111         DirectX::XMFLOAT4X4                             m_orientationTransform3D;
00112
00113         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00114         IDeviceNotify*                                  m_deviceNotify;
00115     };
00116 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario3_LocationTrackingReason.xaml.cpp Source File

  • ExtendedExecution
  • cpp

Scenario3_LocationTrackingReason.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_LocationTrackingReason.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::ApplicationModel;
00021 using namespace Windows::ApplicationModel::ExtendedExecution;
00022 using namespace Windows::Devices::Geolocation;
00023 using namespace Windows::System::Threading;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 LocationTrackingReason::LocationTrackingReason()
00030 {
00031     InitializeComponent();
00032 }
00033
00034 void LocationTrackingReason::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00035 {
00036     // End the Extended Execution Session.
00037     // Only one extended execution session can be held by an application at one time.
00038     ClearExtendedExecution();
00039 }
00040
00041 void LocationTrackingReason::ClearExtendedExecution()
00042 {
00043     if (session)
00044     {
00045         session->Revoked -= sessionRevokedToken;
00046         delete session;
00047         session = nullptr;
00048     }
00049
00050     if (periodicTimer)
00051     {
00052         periodicTimer->Cancel();
00053         periodicTimer = nullptr;
00054     }
00055
00056     geolocator = nullptr;
00057 }
00058
00059 void LocationTrackingReason::UpdateUI()
00060 {
00061     if (!session)
00062     {
00063         Status->Text = "Not requested";
00064         RequestButton->IsEnabled = true;
00065         CloseButton->IsEnabled = false;
00066     }
00067     else
00068     {
00069         Status->Text = "Requested";
00070         RequestButton->IsEnabled = false;
00071         CloseButton->IsEnabled = true;
00072     }
00073 }
00074
00075 task<void> LocationTrackingReason::StartLocationTrackingAsync()
00076 {
00077     // Request permission to access location
00078     return create_task(Geolocator::RequestAccessAsync()).then([this](GeolocationAccessStatus accessStatus)
00079     {
00080         switch (accessStatus)
00081         {
00082         case GeolocationAccessStatus::Allowed:
00083             // See the Geolocation sample for more information on using the Geolocator class.
00084             geolocator = ref new Geolocator();
00085             geolocator->ReportInterval = 2000;
00086             break;
00087
00088         case GeolocationAccessStatus::Denied:
00089             rootPage->NotifyUser("Access to location is denied.", NotifyType::ErrorMessage);
00090             break;
00091
00092         default:
00093         case GeolocationAccessStatus::Unspecified:
00094             rootPage->NotifyUser("Couldn't access the geolocator.", NotifyType::ErrorMessage);
00095             break;
00096         }
00097     });
00098 }
00099
00100 void LocationTrackingReason::BeginExtendedExecution()
00101 {
00102     // The previous Extended Execution must be closed before a new one can be requested.
00103     // This code is redundant here because the sample doesn't allow a new extended
00104     // execution to begin until the previous one ends, but we leave it here for illustration.
00105     ClearExtendedExecution();
00106
00107     auto newSession = ref new ExtendedExecutionSession();
00108     newSession->Reason = ExtendedExecutionReason::LocationTracking;
00109     newSession->Description = "Tracking your location";
00110     sessionRevokedToken = newSession->Revoked += ref new TypedEventHandler<Object^, ExtendedExecutionRevokedEventArgs^>(
00111         this, &LocationTrackingReason::SessionRevoked);
00112     create_task(newSession->RequestExtensionAsync()).then([this, newSession](ExtendedExecutionResult result)
00113     {
00114         switch (result)
00115         {
00116         case ExtendedExecutionResult::Allowed:
00117             rootPage->NotifyUser("Extended execution allowed.", NotifyType::StatusMessage);
00118             session = newSession;
00119             return StartLocationTrackingAsync();
00120             break;
00121
00122         default:
00123         case ExtendedExecutionResult::Denied:
00124             rootPage->NotifyUser("Extended execution denied.", NotifyType::ErrorMessage);
00125             delete newSession;
00126             return task_from_result();
00127             break;
00128         }
00129     }, task_continuation_context::get_current_winrt_context()).then([this]()
00130     {
00131         if (geolocator)
00132         {
00133             periodicTimer = ThreadPoolTimer::CreatePeriodicTimer(ref new TimerElapsedHandler(this, &LocationTrackingReason::OnTimer), Helpers::TimeSpanFromSeconds(10));
00134         }
00135         UpdateUI();
00136     }, task_continuation_context::get_current_winrt_context());
00137 }
00138
00139 void LocationTrackingReason::OnTimer(ThreadPoolTimer^ timer)
00140 {
00141     task<String^> messageTask;
00142
00143     if (geolocator == nullptr)
00144     {
00145         messageTask = task_from_result<String^>("No geolocator");
00146     }
00147     else
00148     {
00149         messageTask = create_task(geolocator->GetGeopositionAsync()).then([this](Geoposition^ geoposition)
00150         {
00151             String^ message;
00152             if (geoposition == nullptr)
00153             {
00154                 message = "Cannot get current location";
00155             }
00156             else
00157             {
00158                 BasicGeoposition basicPosition = geoposition->Coordinate->Point->Position;
00159                 message = "Longitude = " + basicPosition.Longitude.ToString() + ", Latitude = " + basicPosition.Latitude.ToString();
00160             }
00161             return message;
00162         });
00163     }
00164
00165     messageTask.then([this](String^ message)
00166     {
00167         MainPage::DisplayToast(message);
00168     });
00169 }
00170
00171 void LocationTrackingReason::EndExtendedExecution()
00172 {
00173     ClearExtendedExecution();
00174     UpdateUI();
00175 }
00176
00177 void LocationTrackingReason::SessionRevoked(Object^ sender, ExtendedExecutionRevokedEventArgs^ args)
00178 {
00179     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00180     {
00181         switch (args->Reason)
00182         {
00183         case ExtendedExecutionRevokedReason::Resumed:
00184             rootPage->NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType::StatusMessage);
00185             break;
00186
00187         case ExtendedExecutionRevokedReason::SystemPolicy:
00188             rootPage->NotifyUser("Extended execution revoked due to system policy.", NotifyType::StatusMessage);
00189             break;
00190         }
00191
00192         EndExtendedExecution();
00193     }));
00194 }
Generated on Fri Nov 15 2024 22:19:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cpp/Scenario7_UsingUnicodeExtensions.xaml.cpp Source File

  • NumberFormatting
  • cpp

Scenario7_UsingUnicodeExtensions.xaml.cpp

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario7_UsingUnicodeExtensions.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Windows::UI::Xaml;
00010 using namespace Windows::UI::Xaml::Controls;
00011 using namespace Windows::UI::Xaml::Navigation;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::Globalization;
00015 using namespace Windows::Globalization::NumberFormatting;
00016
00017 Scenario7_UsingUnicodeExtensions::Scenario7_UsingUnicodeExtensions()
00018 {
00019     InitializeComponent();
00020 }
00021
00022 /// <summary>
00023 /// This is the click handler for the 'Display' button.
00024 /// </summary>
00025 /// <param name="sender"></param>
00026 /// <param name="e"></param>
00027 void Scenario7_UsingUnicodeExtensions::Display_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00028 {
00029     // This scenario uses language tags with unicode extensions to construct and use the various
00030     // formatters and NumeralSystemTranslator in Windows.Globalization.NumberFormatting to format numbers
00031
00032     // Variable where we keep results to display
00033     String^ results = "";
00034
00035     // Create number to format.
00036     float randomNumber = (float)rand() / RAND_MAX * 100000.0f;
00037     DecimalFormatter^ randomNumberFormatter = ref new DecimalFormatter();
00038     String^ randomNumberFormatted = randomNumberFormatter->Format(randomNumber);
00039
00040     results = results + "Random number used by formatters: " + randomNumberFormatted + "\n";
00041
00042     // Create a string to translate
00043     String^ stringToTranslate = "These are the 10 digits of a numeral system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
00044     results = results + "String used by NumeralSystemTranslater: " + stringToTranslate + "\n";
00045     // Create the rounder and set its increment to 0.01
00046     IncrementNumberRounder^ rounder = ref new IncrementNumberRounder();
00047     rounder->Increment = 0.001;
00048     results = results + "CurrencyFormatter will be using Euro symbol and all formatters rounding to 0.001 increments\n\n";
00049
00050     // The list of language tags with unicode extensions we want to test
00051     auto languages = ref new Platform::Collections::Vector<String^>();
00052     languages->Append("de-DE-u-nu-telu-ca-buddist-co-phonebk-cu-usd");
00053     languages->Append("ja-jp-u-nu-arab");
00054
00055     // Create the various formatters, now using the language list with unicode extensions
00056     results = results + "Creating formatters using following languages in the language list: \n";
00057     for(unsigned int i =0; i<languages->Size; i++)
00058     {
00059         results = results + "\t" + languages->GetAt(i) + "\n";
00060     }
00061     results = results + "\n";
00062
00063     // Create the various formatters.
00064     DecimalFormatter^ decimalFormatter = ref new DecimalFormatter(languages, "ZZ");
00065     decimalFormatter->NumberRounder = rounder; decimalFormatter->FractionDigits = 2;
00066     CurrencyFormatter^ currencyFormatter = ref new CurrencyFormatter(CurrencyIdentifiers::EUR, languages, "ZZ");
00067     currencyFormatter->NumberRounder = rounder; currencyFormatter->FractionDigits = 2;
00068     PercentFormatter^ percentFormatter = ref new PercentFormatter(languages, "ZZ");
00069     percentFormatter->NumberRounder = rounder; percentFormatter->FractionDigits = 2;
00070     PermilleFormatter^ permilleFormatter = ref new PermilleFormatter(languages, "ZZ");
00071     permilleFormatter->NumberRounder = rounder; permilleFormatter->FractionDigits = 2;
00072     NumeralSystemTranslator^ numeralTranslator = ref new NumeralSystemTranslator(languages);
00073
00074     results = results + "Using resolved language  " + decimalFormatter->ResolvedLanguage + "  : (note that all extension tags other than nu are ignored)\n";
00075     // Format using formatters and translate using NumeralSystemTranslator.
00076     results = results + "Decimal Formatter:   " + decimalFormatter->Format(randomNumber) + "\n";
00077     results = results + "Currency formatted:   " + currencyFormatter->Format(randomNumber) + "\n";
00078     results = results + "Percent formatted:   " + percentFormatter->Format(randomNumber) + "\n";
00079     results = results + "Permille formatted:   " + permilleFormatter->Format(randomNumber) + "\n";
00080     results = results + "NumeralTranslator translated:   " + numeralTranslator->TranslateNumerals(stringToTranslate) + "\n";
00081
00082     // Display the results.
00083     OutputTextBlock->Text = results;
00084 }
Generated on Fri Nov 15 2024 22:20:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.cpp Source File

  • DWriteColorGlyph
  • cpp

DWriteColorTextRendererRenderer.cpp

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "DWriteColorTextRendererRenderer.h"
00010
00011 #include "DirectXHelper.h"
00012
00013 using namespace DWriteColorTextRenderer;
00014
00015 using namespace DirectX;
00016 using namespace Windows::Foundation;
00017
00018 // Creates a DWriteTextFormat with our text properties. This includes setting our flow and reading direction.
00019 DWriteColorTextRendererRenderer::DWriteColorTextRendererRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00020     m_deviceResources(deviceResources)
00021 {
00022     // Create a DirectWrite text format object.
00023     DX::ThrowIfFailed(
00024         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00025             L"Segoe UI Emoji",
00026             nullptr,
00027             DWRITE_FONT_WEIGHT_REGULAR,
00028             DWRITE_FONT_STYLE_NORMAL,
00029             DWRITE_FONT_STRETCH_NORMAL,
00030             32.0f,
00031             L"en-US", // locale
00032             &m_dwriteTextFormat
00033             )
00034         );
00035
00036     // Center the text horizontally.
00037     DX::ThrowIfFailed(
00038         m_dwriteTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00039         );
00040
00041     // Center the text vertically.
00042     DX::ThrowIfFailed(
00043         m_dwriteTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER)
00044         );
00045
00046     CreateDeviceDependentResources();
00047     CreateWindowSizeDependentResources();
00048 }
00049
00050 // Initialization.
00051 void DWriteColorTextRendererRenderer::CreateDeviceDependentResources()
00052 {
00053     m_textRenderer = new (std::nothrow) CustomTextRenderer(
00054         m_deviceResources->GetD2DFactory(),
00055         m_deviceResources->GetD2DDeviceContext()
00056         );
00057 }
00058
00059 // Initialization.
00060 void DWriteColorTextRendererRenderer::CreateWindowSizeDependentResources()
00061 {
00062     Platform::String^ text = L"🌂🌃🌄🌅🌆🌇🌈🌉🌊🌋🌍🌎🌏🌒🌓🌔🌕🌖🌗🌘🌝🌞🌱🌲🌳🌴🌷🌹🌻🌽🌾🍅🍆🍇🍈🍉🍌🍍🍎🍏🍐🍑🍒🍓🍔🍕🍖🍗🍘🍛🍜🍝🍟🍠🍡🍢🍣🍤🍥🍦🍧🍨🍩🍪🍫🍬🍭🍮🍯🍰🍱🍲🍳🍵🍹🍺🍻🍼🎂🎃🎄🎅🎆🎇🎉🎊🎋🎌🎍🎎🎐🎑🎓🎠🎡🎢🎣🎤🎦🎨🎯🎰🎱🎳🎴🎻🎼🎾🎿🏀🏁🏂🏄🏇🏊🏡🏤🏦🏧🏩🏫🏬🐌🐓🐝🐠🐡🐢🐣🐳🐵🐶🐸🐹👆👇👈👉👊👒👔👛👝👦👧👨👩👮👯👰👱👲👳👴👵👶👷👸👹👺👼👾💂💄💅💆💇💈💉💊💋💌💐💑💒💘💝💟💨💩💱💹💺💾📈📉📊📌📍📑📓📔📛📝📟📣📵🔞🔫😁😂😃😄😅😆😇😈😉😊😋😌😍😎😏😐😒😓😔😖😘😚😜😝😞😠😡😢😣😤😥😨😩😪😫😭😰😱😲😳😵😶😷🙅🙆🙇🙈🙉🙊🙋🙌🙍🙎🙏🚀🚃🚄🚅🚆🚈🚉🚊🚋🚌🚍🚎🚏🚐";
00063     auto size = m_deviceResources->GetLogicalSize();
00064
00065     DX::ThrowIfFailed(
00066         m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00067             text->Data(),                              // Text to be displayed
00068             text->Length(),                            // Length of the text
00069             m_dwriteTextFormat.Get(),                  // DirectWrite Text Format object
00070             size.Width,                                // Width of the Text Layout
00071             size.Height,                               // Height of the Text Layout
00072             &m_dwriteTextLayout
00073             )
00074         );
00075 }
00076
00077 // Release all references to resources that depend on the graphics device.
00078 // This method is invoked when the device is lost and resources are no longer usable.
00079 void DWriteColorTextRendererRenderer::ReleaseDeviceDependentResources()
00080 {
00081     m_textRenderer.Reset();
00082 }
00083
00084 // Renders one frame.
00085 void DWriteColorTextRendererRenderer::Render()
00086 {
00087     m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00088
00089     m_deviceResources->GetD2DDeviceContext()->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));
00090
00091     m_deviceResources->GetD2DDeviceContext()->SetTransform(
00092         m_deviceResources->GetOrientationTransform2D()
00093         );
00094
00095     D2D1_POINT_2F origin = D2D1::Point2F(0.0f, 0.0f);
00096
00097     DX::ThrowIfFailed(
00098         m_dwriteTextLayout->Draw(
00099             m_deviceResources->GetD2DDeviceContext(),
00100             m_textRenderer.Get(),
00101             origin.x,
00102             origin.y
00103             )
00104         );
00105
00106     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00107     // is lost. It will be handled during the next call to Present.
00108     HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00109     if (hr != D2DERR_RECREATE_TARGET)
00110     {
00111         DX::ThrowIfFailed(hr);
00112     }
00113 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TripViewModel Member List

This is the complete list of members for TripViewModel, including all inherited members.
DeleteTrip() | TripViewModel | [inline, private]
deleteTripCommand | TripViewModel | [private]
DeleteTripCommand | TripViewModel |
DestinationValidationError | TripViewModel |
destinationValidationError | TripViewModel | [private]
LoadTripFromStore(string destination) | TripViewModel | [inline, private]
NewTrip() | TripViewModel | [inline, private]
NotifyPropertyChanged(string propertyName) | ViewModelBase | [inline, protected]
PropertyChanged | ViewModelBase |
SaveTrip() | TripViewModel | [inline, private]
saveTripCommand | TripViewModel | [private]
SaveTripCommand | TripViewModel |
ShowDelete | TripViewModel |
showDelete | TripViewModel | [private]
showDestinationValidation | TripViewModel | [private]
ShowDestinationValidation | TripViewModel |
ShowTrip(Trip trip) | TripViewModel | [inline, private]
store | TripViewModel | [private]
Trip | TripViewModel |
trip | TripViewModel | [private]
TripViewModel(TripStore store) | TripViewModel | [inline]
UpdateDestinationPhraseList() | TripViewModel | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/SampleConfiguration.cpp Source File

  • HttpClient
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::SDKTemplate;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::Foundation::Collections;
00021 //using namespace winrt::Windows::UI::Xaml::Controls;
00022 using namespace winrt::Windows::Web;
00023 using namespace winrt::Windows::Web::Http;
00024 //using namespace winrt::Windows::Web::Http::Filters;
00025 //using namespace winrt::Windows::Web::Http::Headers;
00026
00027 hstring implementation::MainPage::FEATURE_NAME()
00028 {
00029     return L"HttpClient C++/WinRT Sample";
00030 }
00031
00032 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00033 {
00034     Scenario{ L"GET Text With Cache Control", xaml_typename<SDKTemplate::Scenario01_GetText>() },
00035     Scenario{ L"GET Stream", xaml_typename<SDKTemplate::Scenario02_GetStream>() },
00036     Scenario{ L"GET List", xaml_typename<SDKTemplate::Scenario03_GetList>() },
00037     Scenario{ L"POST Text", xaml_typename<SDKTemplate::Scenario04_PostText>() },
00038     Scenario{ L"POST Stream", xaml_typename<SDKTemplate::Scenario05_PostStream>() },
00039     Scenario{ L"POST Multipart", xaml_typename<SDKTemplate::Scenario06_PostMultipart>() },
00040     Scenario{ L"POST Stream With Progress", xaml_typename<SDKTemplate::Scenario07_PostStreamWithProgress>() },
00041     Scenario{ L"POST Custom Content", xaml_typename<SDKTemplate::Scenario08_PostCustomContent>() },
00042     Scenario{ L"Get Cookies", xaml_typename<SDKTemplate::Scenario09_GetCookie>() },
00043     Scenario{ L"Set Cookie", xaml_typename<SDKTemplate::Scenario10_SetCookie>() },
00044     Scenario{ L"Delete Cookie", xaml_typename<SDKTemplate::Scenario11_DeleteCookie>() },
00045     Scenario{ L"Disable Cookies", xaml_typename<SDKTemplate::Scenario12_DisableCookies>() },
00046     Scenario{ L"Retry Filter", xaml_typename<SDKTemplate::Scenario13_RetryFilter>() },
00047     Scenario{ L"Metered Connection Filter", xaml_typename<SDKTemplate::Scenario14_MeteredConnectionFilter>() },
00048     Scenario{ L"Server Certificate Validation", xaml_typename<SDKTemplate::Scenario15_ServerCertificateValidation>() },
00049 });
00050
00051 hstring winrt::to_hstring(WebErrorStatus value)
00052 {
00053     switch (value)
00054     {
00055     case WebErrorStatus::Unknown: return L"Unknown";
00056     case WebErrorStatus::CertificateCommonNameIsIncorrect: return L"CertificateCommonNameIsIncorrect";
00057     case WebErrorStatus::CertificateExpired: return L"CertificateExpired";
00058     case WebErrorStatus::CertificateContainsErrors: return L"CertificateContainsErrors";
00059     case WebErrorStatus::CertificateRevoked: return L"CertificateRevoked";
00060     case WebErrorStatus::CertificateIsInvalid: return L"CertificateIsInvalid";
00061     case WebErrorStatus::ServerUnreachable: return L"ServerUnreachable";
00062     case WebErrorStatus::Timeout: return L"Timeout";
00063     case WebErrorStatus::ErrorHttpInvalidServerResponse: return L"ErrorHttpInvalidServerResponse";
00064     case WebErrorStatus::ConnectionAborted: return L"ConnectionAborted";
00065     case WebErrorStatus::ConnectionReset: return L"ConnectionReset";
00066     case WebErrorStatus::Disconnected: return L"Disconnected";
00067     case WebErrorStatus::HttpToHttpsOnRedirection: return L"HttpToHttpsOnRedirection";
00068     case WebErrorStatus::HttpsToHttpOnRedirection: return L"HttpsToHttpOnRedirection";
00069     case WebErrorStatus::CannotConnect: return L"CannotConnect";
00070     case WebErrorStatus::HostNameNotResolved: return L"HostNameNotResolved";
00071     case WebErrorStatus::OperationCanceled: return L"OperationCanceled";
00072     case WebErrorStatus::RedirectFailed: return L"RedirectFailed";
00073     case WebErrorStatus::UnexpectedStatusCode: return L"UnexpectedStatusCode";
00074     case WebErrorStatus::UnexpectedRedirection: return L"UnexpectedRedirection";
00075     case WebErrorStatus::UnexpectedClientError: return L"UnexpectedClientError";
00076     case WebErrorStatus::UnexpectedServerError: return L"UnexpectedServerError";
00077     case WebErrorStatus::InsufficientRangeSupport: return L"InsufficientRangeSupport";
00078     case WebErrorStatus::MissingContentLengthSupport: return L"MissingContentLengthSupport";
00079     }
00080     return to_hstring(static_cast<int32_t>(value));
00081 }
00082
00083 hstring winrt::to_hstring(HttpResponseMessageSource value)
00084 {
00085     switch (value)
00086     {
00087     case HttpResponseMessageSource::None: return L"None";
00088     case HttpResponseMessageSource::Cache: return L"Cache";
00089     case HttpResponseMessageSource::Network: return L"Network";
00090     }
00091     return to_hstring(static_cast<int32_t>(value));
00092 }
00093
00094 hstring winrt::to_hstring(HttpVersion value)
00095 {
00096     switch (value)
00097     {
00098     case HttpVersion::None: return L"None";
00099     case HttpVersion::Http10: return L"HTTP 1.0";
00100     case HttpVersion::Http11: return L"HTTP 1.1";
00101     case HttpVersion::Http20: return L"HTTP 2.0";
00102     }
00103     return to_hstring(static_cast<int32_t>(value));
00104 }
00105
00106 hstring winrt::to_hstring(HttpProgressStage value)
00107 {
00108     switch (value)
00109     {
00110     case HttpProgressStage::None: return L"None";
00111     case HttpProgressStage::DetectingProxy: return L"Detecting proxy";
00112     case HttpProgressStage::ResolvingName: return L"Resolving name";
00113     case HttpProgressStage::ConnectingToServer: return L"Connecting to server";
00114     case HttpProgressStage::NegotiatingSsl: return L"Negotiating SSL";
00115     case HttpProgressStage::SendingHeaders: return L"Sending headers";
00116     case HttpProgressStage::SendingContent: return L"Sending content";
00117     case HttpProgressStage::WaitingForResponse: return L"Waiting for response";
00118     case HttpProgressStage::ReceivingHeaders: return L"Receiving headers";
00119     case HttpProgressStage::ReceivingContent: return L"Receiving content";
00120     }
00121     return to_hstring(static_cast<int32_t>(value));
00122 }
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/pch.h Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <wrl.h>
00015 #include <wrl/client.h>
00016 #include <memory>
00017 #include <agile.h>
00018 #include <concrt.h>
00019
00020 #include <d3d11_3.h>
00021 #include <d2d1_3.h>
00022 #include <d2d1effects_2.h>
00023 #include <dwrite_3.h>
00024 #include <wincodec.h>
00025 #include <DirectXMath.h>
00026
00027 #include <d2d1effectauthor_1.h>
00028 #include <d2d1effecthelpers.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/ProjectionViewPage.xaml.h Source File

  • Projection
  • cpp

ProjectionViewPage.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "ProjectionViewPage.g.h"
00015
00016 #include "ViewLifetimeControl.h"
00017
00018 namespace SDKSample
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class ProjectionViewPage sealed
00022     {
00023     public:
00024         ProjectionViewPage();
00025
00026     protected:
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028
00029     private:
00030         void SwapViews_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void StopProjecting_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void thisViewControl_Released(Platform::Object^ sender, Platform::Object^ e);
00033         SDKSample::SecondaryViewsHelpers::ViewLifetimeControl^ thisViewControl;
00034         Windows::UI::Core::CoreDispatcher^ mainDispatcher;
00035         int mainViewId;
00036         Windows::Foundation::EventRegistrationToken releasedToken;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SceneComposer Member List

This is the complete list of members for SceneComposer, including all inherited members.
_deviceResources | SceneComposer | [private]
_EndDryPending | SceneComposer | [private]
_inkRenderer | SceneComposer | [private]
_inkSynchronizer | SceneComposer | [private]
_inLassoSelection | SceneComposer | [private]
_ptCurrent | SceneComposer | [private]
_ptInitial | SceneComposer | [private]
_refCount | SceneComposer | [private]
_sceneObjects | SceneComposer | [private]
_selectionBrush | SceneComposer | [private]
_shapeRenderer | SceneComposer | [private]
_strokeStyle | SceneComposer | [private]
AddRef() override | SceneComposer | [virtual]
CanPaste() | SceneComposer | [inline]
ClearScene() | SceneComposer |
ConvertUpdateRect(Windows::Foundation::Rect const &updateRect) | SceneComposer | [private]
CopySelected() | SceneComposer |
CutSelected() | SceneComposer |
DeleteSceneObjects() | SceneComposer | [private]
DeleteSelectedAndUpdate() | SceneComposer | [private]
DoCustomDry() | SceneComposer |
DoErase(Windows::Foundation::Point prevPt, Windows::Foundation::Point currPt) | SceneComposer |
Draw(_In_opt_ const RECT *pUpdateRect=nullptr) | SceneComposer | [private]
DrawLasso(Windows::Foundation::Point pt) | SceneComposer |
GetDPI() | SceneComposer | [inline]
GetSceneSelectionRect() | SceneComposer |
Initialize(Windows::Foundation::Size sizeContent, Windows::Foundation::Size sizeViewPort) | SceneComposer |
Invalidate(_In_opt_ RECT *pInvalidateRect=nullptr) | SceneComposer |
OnViewSizeChanged(Windows::Foundation::Size newSize) | SceneComposer |
PasteSelected(Windows::Foundation::Point pastePosition) | SceneComposer |
QueryInterface(REFIID uuid, _Outptr_ void **object) override | SceneComposer | [virtual]
Release() override | SceneComposer | [virtual]
RemoveSelectedStrokesFromSceneObjects() | SceneComposer | [private]
Render() | SceneComposer | [private]
RestoreDefaultStrokeSize() | SceneComposer | [private]
SceneComposer() | SceneComposer | [inline]
SCENEOBJECT_TYPES enum name | SceneComposer | [private]
SelectInkSceneObject() | SceneComposer | [private]
SelectSceneObjects(Windows::Foundation::Collections::IVector< Windows::Foundation::Point >^selectionPoints) | SceneComposer |
SetContentSize(Windows::Foundation::Size contentSize) | SceneComposer | [inline]
SetContentZoomFactor(float contentZoomFactor) | SceneComposer | [inline]
SetDPI(float dpi) | SceneComposer | [inline]
SetInkSynchronizer(Windows::UI::Input::Inking::InkSynchronizer^inkSynchronizer) | SceneComposer | [inline]
SOT_Generic enum value | SceneComposer | [private]
SOT_Ink enum value | SceneComposer | [private]
SOT_Shape enum value | SceneComposer | [private]
StartLassoSelection(Windows::Foundation::Point pt) | SceneComposer |
Trim() | SceneComposer | [inline]
UnselectSceneObjects() | SceneComposer |
UpdateInk(Windows::Foundation::Collections::IVectorView< Windows::UI::Input::Inking::InkStroke^>^strokes) | SceneComposer |
UpdateShape() | SceneComposer |
UpdatesNeeded() override | SceneComposer | [virtual]
~SceneComposer() | SceneComposer |
Generated on Fri Nov 15 2024 22:24:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario4_ChangeSystemGroup.xaml.h Source File

  • JumpList
  • cpp

Scenario4_ChangeSystemGroup.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_ChangeSystemGroup.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario4_ChangeSystemGroup sealed
00021     {
00022     public:
00023         Scenario4_ChangeSystemGroup();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027
00028     private:
00029         void SystemGroup_Recent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030         void SystemGroup_Frequent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void SystemGroup_None_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void PrepareSampleFiles_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033     };
00034 }
Generated on Fri Nov 15 2024 22:20:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_ForegroundVisits Member List

This is the complete list of members for Scenario7_ForegroundVisits, including all inherited members.
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario7_ForegroundVisits |
OnVisitStateChanged(Windows::Devices::Geolocation::GeovisitMonitor const &, Windows::Devices::Geolocation::GeovisitStateChangedEventArgs args) | Scenario7_ForegroundVisits | [private]
Scenario7_ForegroundVisits() | Scenario7_ForegroundVisits |
StartMonitoring(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario7_ForegroundVisits |
StopMonitoring(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario7_ForegroundVisits |
UpdateVisitData(Windows::Devices::Geolocation::Geovisit const &visit) | Scenario7_ForegroundVisits | [private]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/Scenario1_MoveCertificate.h Source File

  • UserCertificateStore
  • cppwinrt

Scenario1_MoveCertificate.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_MoveCertificate.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_MoveCertificate : Scenario1_MoveCertificateT<Scenario1_MoveCertificate>
00019     {
00020         Scenario1_MoveCertificate();
00021
00022         fire_and_forget OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023
00024         fire_and_forget MoveUserCertificateToAppCertificateStore(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         fire_and_forget MoveAppCertificateToUserCertificateStore(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026
00027     private:
00028         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00029         Windows::Security::Cryptography::Certificates::CertificateStore appStore;
00030         Windows::Security::Cryptography::Certificates::UserCertificateStore userStore;
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario1_MoveCertificate : Scenario1_MoveCertificateT<Scenario1_MoveCertificate, implementation::Scenario1_MoveCertificate>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:21:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/pch.h Source File

  • LinguisticServices
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.Globalization.Collation.h"
00007 #include "winrt/Windows.ApplicationModel.Activation.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00014 #include "winrt/Windows.UI.Xaml.Documents.h"
00015 #include "winrt/Windows.UI.Xaml.Interop.h"
00016 #include "winrt/Windows.UI.Xaml.Markup.h"
00017 #include "winrt/Windows.UI.Xaml.Media.h"
00018 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoRenderer Member List

This is the complete list of members for VideoRenderer, including all inherited members.
ComputeSphere(unsigned short tessellation, bool invertn) | VideoRenderer |
CreateD3D11Surface() | VideoRenderer |
CreateDeviceDependentResources() | VideoRenderer |
LoadShaders() | VideoRenderer |
m_critical | VideoRenderer | [private]
m_degreesPerSecond | VideoRenderer | [private]
m_deviceResources | VideoRenderer | [private]
m_geometryShader | VideoRenderer | [private]
m_indexBuffer | VideoRenderer | [private]
m_indexCount | VideoRenderer | [private]
m_inputLayout | VideoRenderer | [private]
m_loadingComplete | VideoRenderer | [private]
m_modelConstantBuffer | VideoRenderer | [private]
m_modelConstantBufferData | VideoRenderer | [private]
m_pixelShader | VideoRenderer | [private]
m_quadTextureSamplerState | VideoRenderer | [private]
m_surface | VideoRenderer | [private]
m_texture | VideoRenderer | [private]
m_textureView | VideoRenderer | [private]
m_usingVprtShaders | VideoRenderer | [private]
m_vertexBuffer | VideoRenderer | [private]
m_vertexShader | VideoRenderer | [private]
m_videoFrameAvailToken | VideoRenderer | [private]
OnVideoFrameAvailable() | VideoRenderer | [private]
ReleaseDeviceDependentResources() | VideoRenderer |
Render() | VideoRenderer |
Update(const DX::StepTimer &timer) | VideoRenderer |
VideoRenderer() | VideoRenderer |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/WaveEffect.h Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

WaveEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // GUIDs for the shader, vertex buffers, and effect itself.
00013 DEFINE_GUID(GUID_WaveTransformVertexShader,
00014             0x65fa2492, 0x9478, 0x4c4d, 0x95, 0x67, 0xf6, 0x96, 0x72, 0x6a, 0x83, 0xa4
00015             );
00016 DEFINE_GUID(GUID_WaveTransformVertexBuffer,
00017             0xa9149e76, 0xc708, 0x4b3a, 0xad, 0x59, 0x56, 0x72, 0x3b, 0x65, 0x33, 0x44
00018             );
00019 DEFINE_GUID(CLSID_CustomWaveEffect,
00020             0x7b4c948b, 0xfcf2, 0x4c6b, 0xa0, 0x93, 0xdb, 0x4e, 0x59, 0x99, 0x42, 0x43
00021             );
00022
00023 enum WAVE_PROP
00024 {
00025     WAVE_PROP_OFFSET      = 0,
00026     WAVE_PROP_SKEW_X      = 1,
00027     WAVE_PROP_SKEW_Y      = 2,
00028     WAVE_PROP_FORCE_DWORD = 0xFFFFFFFF
00029 };
00030
00031 // Our effect contains one transform, which is simply a wrapper around a vertex shader.
00032 // As such, we can simply make the effect itself act as the transform.
00033 class WaveEffect : public ID2D1EffectImpl, public ID2D1DrawTransform
00034 {
00035 public:
00036     // Declare effect registration methods.
00037     static HRESULT Register(_In_ ID2D1Factory1* pFactory);
00038     static HRESULT __stdcall CreateWaveImpl(_Outptr_ IUnknown** ppEffectImpl);
00039
00040     // Declare property getter/setter methods.
00041     float GetWaveOffset() const;
00042     HRESULT SetWaveOffset(float waveOffset);
00043
00044     float GetSkewX() const;
00045     HRESULT SetSkewX(float skew);
00046
00047     float GetSkewY() const;
00048     HRESULT SetSkewY(float skew);
00049
00050     // Declare ID2D1EffectImpl implementation methods.
00051     IFACEMETHODIMP Initialize(
00052         _In_ ID2D1EffectContext* pEffectContext,
00053         _In_ ID2D1TransformGraph* pTransformGraph
00054         );
00055
00056     IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE changeType);
00057
00058     IFACEMETHODIMP SetGraph(_In_ ID2D1TransformGraph* pTransformGraph)
00059     {
00060         return E_NOTIMPL; // There's no need to implement this on effects with static input counts.
00061     }
00062
00063     // Declare ID2D1DrawTransform implementation methods.
00064     IFACEMETHODIMP SetDrawInfo(_In_ ID2D1DrawInfo* pDrawInfo);
00065
00066     // Declare ID2D1Transform implementation methods.
00067     IFACEMETHODIMP MapOutputRectToInputRects(
00068         _In_ const D2D1_RECT_L* pOutputRect,
00069         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00070         UINT32 inputRectCount
00071         ) const;
00072
00073     IFACEMETHODIMP MapInputRectsToOutputRect(
00074         _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputRects,
00075         _In_reads_(inputRectCount) CONST D2D1_RECT_L *pInputOpaqueSubRects,
00076         UINT32 inputRectCount,
00077         _Out_ D2D1_RECT_L *pOutputRect,
00078         _Out_ D2D1_RECT_L *pOutputOpaqueSubRect
00079         );
00080
00081     IFACEMETHODIMP MapInvalidRect(
00082         UINT32 inputIndex,
00083         D2D1_RECT_L invalidInputRect,
00084         _Out_ D2D1_RECT_L *pInvalidOutputRect
00085         ) const;
00086
00087
00088     // Declare ID2D1TransformNode implementation methods.
00089     IFACEMETHODIMP_(UINT32) GetInputCount() const { return 1; }
00090
00091     // Declare IUnknown implementation methods.
00092     IFACEMETHODIMP_(ULONG) AddRef();
00093     IFACEMETHODIMP_(ULONG) Release();
00094     IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppOutput);
00095
00096 private:
00097     WaveEffect();
00098
00099     inline static float Clamp(float v, float low, float high)
00100     {
00101         return (v < low) ? low : (v > high) ? high : v;
00102     }
00103
00104     struct Vertex
00105     {
00106         float x;
00107         float y;
00108     };
00109
00110     // This is a grid mesh in unit space, 0 to 1, with texture coordinates.
00111     // Deformations of this geometry will be performed in the vertex shader.
00112     HRESULT GenerateMesh(_Outptr_ Vertex** ppMesh);
00113
00114     // Updates the constant buffer when effect properties are changed.
00115     HRESULT UpdateConstants();
00116
00117     float                                       m_waveOffset;
00118     float                                       m_sizeX;
00119     float                                       m_sizeY;
00120     float                                       m_skewX;
00121     float                                       m_skewY;
00122
00123     Microsoft::WRL::ComPtr<ID2D1VertexBuffer>   m_vertexBuffer;
00124     Microsoft::WRL::ComPtr<ID2D1DrawInfo>       m_drawInfo;
00125     UINT                                        m_numVertices;
00126     D2D_RECT_L                                  m_inputRect;
00127
00128     LONG                                        m_refCount;
00129
00130     // Used to update the constant buffer for the vertex shader.
00131     struct
00132     {
00133         D2D_MATRIX_4X4_F matrix;
00134         float sizeX;
00135         float sizeY;
00136         float waveOffset;
00137         float skewX;
00138         float skewY;
00139     } m_constants;
00140 };
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_BgChatServer Member List

This is the complete list of members for Scenario3_BgChatServer, including all inherited members.
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | Scenario3_BgChatServer | [inline, private]
Disconnect() | Scenario3_BgChatServer | [inline, private]
DisconnectButton_Click(object sender, RoutedEventArgs e) | Scenario3_BgChatServer | [inline, private]
KeyboardKey_Pressed(object sender, KeyRoutedEventArgs e) | Scenario3_BgChatServer | [inline]
ListenButton_Click(object sender, RoutedEventArgs e) | Scenario3_BgChatServer | [inline, private]
OnCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args) | Scenario3_BgChatServer | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_BgChatServer | [inline, protected]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | Scenario3_BgChatServer | [inline, private]
rootPage | Scenario3_BgChatServer | [private]
Scenario3_BgChatServer() | Scenario3_BgChatServer | [inline]
sdpRecordBlob | Scenario3_BgChatServer | [private]
SendButton_Click(object sender, RoutedEventArgs e) | Scenario3_BgChatServer | [inline, private]
SendMessage() | Scenario3_BgChatServer | [inline, private]
taskEntryPoint | Scenario3_BgChatServer | [private]
taskName | Scenario3_BgChatServer | [private]
taskRegistration | Scenario3_BgChatServer | [private]
trigger | Scenario3_BgChatServer | [private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8 Member List

This is the complete list of members for Scenario8, including all inherited members.
Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario8 | [inline, private]
Scenario8() | Scenario8 | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/pch.cpp Source File

  • FileAccess
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cpp/SampleConfiguration.cpp Source File

  • PasswordVault
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Save credentials", "SDKTemplate.Scenario1_Save" },
00012     { "Manage credentials", "SDKTemplate.Scenario2_Manage" },
00013 };
00014
00015 bool MainPage::InitializePasswordVaultInTheBackground()
00016 {
00017     concurrency::create_async([]()
00018     {
00019         // any call to the password vault will load the vault.
00020         auto vault = ref new Windows::Security::Credentials::PasswordVault();
00021         vault->RetrieveAll();
00022     });
00023     return true;
00024
00025 }
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ConnectionSettingsPanel Member List

This is the complete list of members for ConnectionSettingsPanel, including all inherited members.
_supportedConfigMethods | ConnectionSettingsPanel | [private]
btnAddConfigMethods_Click(object sender, RoutedEventArgs e) | ConnectionSettingsPanel | [inline, private]
ConnectionSettingsPanel() | ConnectionSettingsPanel | [inline]
OnPairingRequested(DeviceInformationCustomPairing sender, DevicePairingRequestedEventArgs args) | ConnectionSettingsPanel | [inline, private]
RequestPairDeviceAsync(DeviceInformationPairing pairing) | ConnectionSettingsPanel | [inline]
Reset() | ConnectionSettingsPanel | [inline]
rootPage | ConnectionSettingsPanel | [private]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrFileImage.cpp Source File

  • OCR
  • cppwinrt

OcrFileImage.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "OcrFileImage.h"
00003 #include "OcrFileImage.g.cpp"
00004 #include <sstream>
00005
00006 using namespace winrt;
00007 using namespace Windows::Foundation;
00008 using namespace Windows::Globalization;
00009 using namespace Windows::Graphics::Imaging;
00010 using namespace Windows::Media;
00011 using namespace Windows::Media::Ocr;
00012 using namespace Windows::Storage;
00013 using namespace Windows::Storage::Pickers;
00014 using namespace Windows::UI::Xaml;
00015 using namespace Windows::UI::Xaml::Controls;
00016 using namespace Windows::UI::Xaml::Media;
00017 using namespace Windows::UI::Xaml::Media::Imaging;
00018 using namespace Windows::UI::Xaml::Navigation;
00019 using namespace SDKTemplate;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     OcrFileImage::OcrFileImage()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     /// <summary>
00029        /// Invoked when this page is about to be displayed in a Frame.
00030        /// Updates OCR available languages and loads sample image.
00031        /// </summary>
00032        /// <param name="e"></param>
00033     fire_and_forget OcrFileImage::OnNavigatedTo(NavigationEventArgs const&)
00034     {
00035         auto lifetime = get_strong();
00036
00037         UpdateAvailableLanguages();
00038
00039         co_await LoadSampleImageAsync();
00040     }
00041
00042
00043     /// <summary>
00044     /// Updates list of ocr languages available on device.
00045     /// </summary>
00046     void OcrFileImage::UpdateAvailableLanguages()
00047     {
00048         if (!UserLanguageToggle().IsOn())
00049         {
00050             std::vector<IInspectable> items;
00051             for (auto&& language : OcrEngine::AvailableRecognizerLanguages())
00052             {
00053                 ComboBoxItem item;
00054                 item.Content(box_value(language.DisplayName()));
00055                 item.Tag(language);
00056                 items.push_back(item);
00057             }
00058             // Check if any OCR language is available on device.
00059             if (items.size() > 0)
00060             {
00061                 LanguageList().ItemsSource(winrt::single_threaded_vector<IInspectable>(std::move(items)));
00062                 LanguageList().SelectedIndex(0);
00063                 LanguageList().IsEnabled(true);
00064             }
00065             else
00066             {
00067                 // Prevent OCR if no OCR languages are available on device.
00068                 UserLanguageToggle().IsEnabled(false);
00069                 LanguageList().IsEnabled(false);
00070                 ExtractButton().IsEnabled(false);
00071                 rootPage.NotifyUser(L"No available OCR languages.", NotifyType::ErrorMessage);
00072             }
00073         }
00074         else
00075         {
00076             LanguageList().ItemsSource(nullptr);
00077             LanguageList().IsEnabled(false);
00078
00079             rootPage.NotifyUser(
00080                 L"Run OCR in first OCR available language from UserProfile.GlobalizationPreferences.Languages list.",
00081                 NotifyType::StatusMessage);
00082         }
00083     }
00084
00085     /// <summary>
00086     /// Loads image from file to bitmap and displays it in UI.
00087     /// </summary>
00088     /// <param name="file"></param>
00089     /// <returns></returns>
00090     IAsyncAction OcrFileImage::LoadImageAsync(StorageFile const& file)
00091     {
00092         auto lifetime = get_strong();
00093
00094         auto stream = co_await file.OpenAsync(winrt::Windows::Storage::FileAccessMode::Read);
00095
00096         auto decoder = co_await BitmapDecoder::CreateAsync(stream);
00097
00098         bitmap = co_await decoder.GetSoftwareBitmapAsync(BitmapPixelFormat::Bgra8, BitmapAlphaMode::Premultiplied);
00099
00100         auto imgSource = WriteableBitmap(bitmap.PixelWidth(), bitmap.PixelHeight());
00101         bitmap.CopyToBuffer(imgSource.PixelBuffer());
00102         PreviewImage().Source(imgSource);
00103     }
00104
00105     IAsyncAction OcrFileImage::LoadSampleImageAsync()
00106     {
00107         auto lifetime = get_strong();
00108
00109         StorageFile file = co_await Windows::ApplicationModel::Package::Current().InstalledLocation().GetFileAsync(L"Assets\\splash-sdk.png");
00110         co_await LoadImageAsync(file);
00111     }
00112
00113     /// <summary>
00114     /// Clears extracted text and text overlay from previous OCR.
00115     /// </summary>
00116     void OcrFileImage::ClearResults()
00117     {
00118         TextOverlay().RenderTransform(nullptr);
00119         ExtractedTextBox().Text({});
00120         TextOverlay().Children().Clear();
00121         wordBoxes.clear();
00122     }
00123
00124     /// <summary>
00125     ///  Update word box transform to match current UI size.
00126     /// </summary>
00127     void OcrFileImage::UpdateWordBoxTransform()
00128     {
00129         // Used for text overlay.
00130         // Prepare scale transform for words since image is not displayed in original size
00131         ScaleTransform scaleTransform;
00132         scaleTransform.CenterX(0);
00133         scaleTransform.CenterY(0);
00134         scaleTransform.ScaleX(PreviewImage().ActualWidth() / bitmap.PixelWidth());
00135         scaleTransform.ScaleY(PreviewImage().ActualHeight() / bitmap.PixelHeight());
00136
00137         for (auto&& item : wordBoxes)
00138         {
00139             item->Transform(scaleTransform);
00140         }
00141     }
00142
00143     /// <summary>
00144     /// This is event handler for 'Extract' button.
00145     /// Recognizes text from image and displays it.
00146     /// </summary>
00147     /// <param name="e"></param>
00148     fire_and_forget OcrFileImage::ExtractButton_Click(IInspectable const&, RoutedEventArgs const&)
00149     {
00150         auto lifetime = get_strong();
00151
00152         ClearResults();
00153
00154         // Check if OcrEngine supports image resolution.
00155
00156         if (static_cast<uint32_t>(bitmap.PixelWidth()) > OcrEngine::MaxImageDimension() ||
00157             static_cast<uint32_t>(bitmap.PixelHeight()) > OcrEngine::MaxImageDimension())
00158         {
00159             rootPage.NotifyUser(
00160                 L"Bitmap dimensions (" + to_hstring(bitmap.PixelWidth()) + L"x" + to_hstring(bitmap.PixelHeight()) + L"are too big for OCR. Max image dimension is " + to_hstring(OcrEngine::MaxImageDimension()) + L".",
00161                 NotifyType::ErrorMessage);
00162
00163             return;
00164         }
00165
00166         OcrEngine ocrEngine = nullptr;
00167
00168         if (UserLanguageToggle().IsOn())
00169         {
00170             // Try to create OcrEngine for first supported language from UserProfile.GlobalizationPreferences.Languages list.
00171             // If none of the languages are available on device, method returns null.
00172             ocrEngine = OcrEngine::TryCreateFromUserProfileLanguages();
00173         }
00174         else
00175         {
00176             // Try to create OcrEngine for specified language.
00177             // If language is not supported on device, method returns null.
00178             auto lang = LanguageList().SelectedValue().as<ComboBoxItem>().Tag().as<Windows::Globalization::Language>();
00179             ocrEngine = OcrEngine::TryCreateFromLanguage(lang);
00180         }
00181
00182         if (ocrEngine != nullptr)
00183         {
00184             // Recognize text from image.
00185             auto ocrResult = co_await ocrEngine.RecognizeAsync(bitmap);
00186
00187             // Display recognized text.
00188             ExtractedTextBox().Text(ocrResult.Text());
00189
00190             auto angle = unbox_value_or<double>(ocrResult.TextAngle(), 0.0);
00191             if (angle != 0.0)
00192             {
00193                 // If text is detected under some angle in this sample scenario we want to
00194                 // overlay word boxes over original image, so we rotate overlay boxes.
00195
00196                 RotateTransform rotateTransform;
00197
00198                 rotateTransform.Angle(angle);
00199                 rotateTransform.CenterX(PreviewImage().ActualWidth() / 2);
00200                 rotateTransform.CenterY(PreviewImage().ActualWidth() / 2);
00201
00202                 TextOverlay().RenderTransform(rotateTransform);
00203
00204             }
00205
00206             // Create overlay boxes over recognized words.
00207             for (auto&& line : ocrResult.Lines())
00208             {
00209                 // Determine if line is horizontal or vertical.
00210                 // Vertical lines are supported only in Chinese Traditional and Japanese languages.
00211                 Rect lineRect = RectHelper::Empty();
00212                 for (auto&& word : line.Words())
00213                 {
00214                     lineRect = RectHelper::Union(lineRect, word.BoundingRect());
00215                 }
00216                 bool isVerticalLine = lineRect.Height > lineRect.Width;
00217                 auto style = isVerticalLine ? HighlightedWordBoxVerticalLineStyle() : HighlightedWordBoxHorizontalLineStyle();
00218
00219                 for (auto&& word : line.Words())
00220                 {
00221                     com_ptr<WordOverlay> wordBoxOverlay = make_self<WordOverlay>(word);
00222
00223                     // Keep references to word boxes.
00224                     wordBoxes.push_back(wordBoxOverlay);
00225
00226                     // Create a box to highlight the word.
00227                     TextOverlay().Children().Append(wordBoxOverlay->CreateBorder(style));
00228                 }
00229             }
00230
00231             // Rescale word boxes to match current UI size.
00232             UpdateWordBoxTransform();
00233
00234             rootPage.NotifyUser(
00235                 L"Image is OCRed for " + ocrEngine.RecognizerLanguage().DisplayName() + L" language.",
00236                 NotifyType::StatusMessage);
00237         }
00238         else
00239         {
00240             rootPage.NotifyUser(L"Selected language is not available.", NotifyType::ErrorMessage);
00241         }
00242     }
00243
00244     /// <summary>
00245     /// Occures when user language toggle state is changed.
00246     /// </summary>
00247     /// <param name="sender"></param>
00248     /// <param name="e"></param>
00249     void OcrFileImage::UserLanguageToggle_Toggled(IInspectable const&, RoutedEventArgs const&)
00250     {
00251         UpdateAvailableLanguages();
00252     }
00253
00254     /// <summary>
00255     /// This is event handler for 'Sample' button.
00256     /// It loads sample image and displays it in UI.
00257     /// </summary>
00258     /// <param name="sender"></param>
00259     /// <param name="e"></param>
00260     fire_and_forget OcrFileImage::SampleButton_Click(IInspectable const&, RoutedEventArgs const&)
00261     {
00262         auto lifetime = get_strong();
00263
00264         ClearResults();
00265
00266         co_await LoadSampleImageAsync();
00267
00268         rootPage.NotifyUser(L"Loaded sample image.", NotifyType::StatusMessage);
00269     }
00270
00271     /// <summary>
00272     /// This is event handler for 'Load' button.
00273     /// It opens file picked and load selected image in UI..
00274     /// </summary>
00275     /// <param name="sender"></param>
00276     /// <param name="e"></param>
00277     IAsyncAction OcrFileImage::LoadButton_Click(IInspectable const&, RoutedEventArgs const&)
00278     {
00279         auto lifetime = get_strong();
00280
00281         FileOpenPicker picker;
00282         picker.SuggestedStartLocation(PickerLocationId::PicturesLibrary);
00283         picker.FileTypeFilter().ReplaceAll({ L".jpg", L".jpeg", L".png" });
00284
00285         auto file = co_await picker.PickSingleFileAsync();
00286         if (file != nullptr)
00287         {
00288             ClearResults();
00289
00290             co_await LoadImageAsync(file);
00291
00292             rootPage.NotifyUser(
00293                 L"Loaded image from file: " + file.Name() + L" (" + to_hstring(bitmap.PixelWidth()) + L"x" + to_hstring(bitmap.PixelHeight()) + L").",
00294                 NotifyType::StatusMessage);
00295         }
00296     }
00297
00298     /// <summary>
00299     /// Occurs when selected language is changed in available languages combo box.
00300     /// </summary>
00301     /// <param name="sender"></param>
00302     /// <param name="e"></param>
00303     void OcrFileImage::LanguageList_SelectionChanged(IInspectable const&, RoutedEventArgs const&)
00304     {
00305         ClearResults();
00306     }
00307
00308     /// <summary>
00309     /// Occurs when displayed image size changes.
00310     /// </summary>
00311     /// <param name="sender"></param>
00312     /// <param name="e"></param>
00313     void OcrFileImage::PreviewImage_SizeChanged(IInspectable const&, RoutedEventArgs const&)
00314     {
00315         // Update word overlay boxes.
00316         UpdateWordBoxTransform();
00317
00318         // Update image rotation center.
00319         auto rotate = TextOverlay().RenderTransform().try_as<RotateTransform>();
00320         if (rotate != nullptr)
00321         {
00322             rotate.CenterX(PreviewImage().ActualWidth() / 2);
00323             rotate.CenterY(PreviewImage().ActualHeight() / 2);
00324         }
00325     }
00326 }
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleBackgroundTask Member List

This is the complete list of members for SampleBackgroundTask, including all inherited members.
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | SampleBackgroundTask | [inline, private]
AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task) | SampleBackgroundTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | SampleBackgroundTask | [inline, private]
OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args) | SampleBackgroundTask | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | SampleBackgroundTask | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | SampleBackgroundTask | [inline, protected]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | SampleBackgroundTask | [inline, private]
OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args) | SampleBackgroundTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | SampleBackgroundTask | [inline, private]
RegisterBackgroundTask(object sender, RoutedEventArgs e) | SampleBackgroundTask | [inline, private]
rootPage | SampleBackgroundTask | [private]
SampleBackgroundTask() | SampleBackgroundTask | [inline]
SampleBackgroundTask() | SampleBackgroundTask | [inline]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | SampleBackgroundTask | [inline, private]
UnregisterBackgroundTask(object sender, RoutedEventArgs e) | SampleBackgroundTask | [inline, private]
UpdateUI() | SampleBackgroundTask | [inline, private]
UpdateUI() | SampleBackgroundTask | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Scenario4_CompactOverlay.h Source File

  • AppWindow
  • cppwinrt

Scenario4_CompactOverlay.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_CompactOverlay.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario4_CompactOverlay : Scenario4_CompactOverlayT<Scenario4_CompactOverlay>
00019     {
00020         Scenario4_CompactOverlay();
00021
00022         fire_and_forget OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023
00024         fire_and_forget ShowWindowBtn_Click(IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025
00026     private:
00027         Windows::UI::WindowManagement::AppWindow appWindow{ nullptr };
00028         Windows::UI::Xaml::Controls::Frame appWindowFrame{};
00029
00030         void OnWindowClosed(Windows::UI::WindowManagement::AppWindow const& sender, IInspectable const&);
00031     };
00032 }
00033
00034 namespace winrt::SDKTemplate::factory_implementation
00035 {
00036     struct Scenario4_CompactOverlay : Scenario4_CompactOverlayT<Scenario4_CompactOverlay, implementation::Scenario4_CompactOverlay>
00037     {
00038     };
00039 }
Generated on Fri Nov 15 2024 22:18:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LookupTable< T, LookupTableSize > Member List

This is the complete list of members for LookupTable< T, LookupTableSize >, including all inherited members.
GetValue(float value) | LookupTable< T, LookupTableSize > | [inline]
LookupTable(LookupTableGenerator Generator) | LookupTable< T, LookupTableSize > | [inline]
LookupTableGenerator typedef | LookupTable< T, LookupTableSize > |
m_lookuptable | LookupTable< T, LookupTableSize > | [private]
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/VideoGallery.xaml.cpp Source File

  • 360VideoPlayback
  • cpp

VideoGallery.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // VideoGallery.xaml.cpp
00003 // Implementation of the VideoGallery class
00004 //
00005
00006 #include "pch.h"
00007 #include "VideoGallery.xaml.h"
00008 #include "PlaybackPage.xaml.h"
00009 #include "AppView.h"
00010
00011 using namespace _360VideoPlayback;
00012 using namespace Platform;
00013 using namespace Platform::Collections;
00014 using namespace Windows::ApplicationModel::Core;
00015 using namespace Windows::Foundation;
00016 using namespace Windows::Foundation::Collections;
00017 using namespace Windows::Graphics::Holographic;
00018 using namespace Windows::Perception::Spatial::Surfaces;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Interop;
00024
00025 // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
00026
00027 int _360VideoPlayback::VideoGallery::mainviewId = 0;
00028
00029 VideoGallery::VideoGallery()
00030 {
00031     InitializeComponent();
00032     mainviewId = ApplicationView::GetForCurrentView()->Id;
00033     this->Loaded += ref new RoutedEventHandler(this, &_360VideoPlayback::VideoGallery::OnLoaded);
00034 }
00035
00036
00037 void _360VideoPlayback::VideoGallery::GalleryGridView_ItemClick(Object^ sender, ItemClickEventArgs^ e)
00038 {
00039     if (e->ClickedItem != nullptr)
00040     {
00041         VideoItem^ selectedVideoItem = safe_cast<VideoItem^>(e->ClickedItem);
00042
00043         if ((HolographicSpace::IsSupported && HolographicSpace::IsAvailable)
00044             || SpatialSurfaceObserver::IsSupported())
00045         {
00046             // If VR or Hololens(or emulator) all attached to then it will play in immersive mode.
00047             // Make sure enable Mixed Reality portal on the PC
00048             auto appViewSource = ref new AppViewSource(selectedVideoItem->SourceUri);
00049             auto appView = CoreApplication::CreateNewView(appViewSource);
00050             appView->Dispatcher->RunAsync(
00051                 CoreDispatcherPriority::Normal,
00052                 ref new DispatchedHandler([this]()
00053             {
00054                 int appviewId = ApplicationView::GetForCurrentView()->Id;
00055                 ApplicationViewSwitcher::TryShowAsStandaloneAsync(
00056                     appviewId, ViewSizePreference::Default, mainviewId, ViewSizePreference::Default);
00057             }));
00058         }
00059         else
00060         {
00061             Frame->Navigate(TypeName(PlaybackPage::typeid), selectedVideoItem->SourceUri);
00062         }
00063     }
00064 }
00065
00066 struct VideoItemInfo
00067 {
00068     const wchar_t* title;
00069     const wchar_t* source;
00070 };
00071
00072 const VideoItemInfo sampleVideos[] = {
00073     // You can add more sample videos here.
00074     {
00075         L"Sample Video",
00076         L"https://mediaplatstorage1.blob.core.windows.net/windows-universal-samples-media/SampleVideo.mp4",
00077     }
00078 };
00079
00080 void _360VideoPlayback::VideoGallery::OnLoaded(Object^ sender, RoutedEventArgs^ e)
00081 {
00082     auto videoItemList = ref new Vector<Object^>();
00083     for (auto const& info : sampleVideos)
00084     {
00085         auto videoItem = ref new VideoItem(ref new String(info.title), ref new Uri(ref new String(info.source)));
00086         videoItemList->Append(videoItem);
00087     }
00088
00089     this->GalleryGridView->ItemsSource = videoItemList;
00090 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/CompressionUtils.h Source File

  • Compression
  • cpp

CompressionUtils.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 // Reads Stream into Destination. It's up to caller to ensure that Destination is not destructed until
00004 // ReadStreamTask::GetTask() is completed. If error is encountered during read Destination doesn't
00005 // change and Stream state is undefined.
00006 // NOTE: Generally you don't need to read entire stream into memory - we only use this task in order to
00007 //       interoperate with Compression API style buffer compression/decompression. Recommended way to
00008 //       work with WinRT streams of unknown length (including Comressor/Decompressor) is processing
00009 //       data chunk by chunk as it arrives.
00010 class ReadStreamTask
00011 {
00012 public:
00013     ReadStreamTask(Windows::Storage::Streams::IInputStream^ Stream, std::vector<byte> &Destination);
00014     ReadStreamTask(const ReadStreamTask& Task);
00015     ReadStreamTask &operator=(const ReadStreamTask& Task);
00016
00017     concurrency::task<size_t> RunTask();
00018
00019 private:
00020     static const unsigned int MinReadChunkSize = 0x10000;
00021
00022     struct ReadStreamTaskImpl;
00023     ReadStreamTaskImpl *_Impl;
00024 };
00025
00026 // Common context for all scenarios for simplicity - not all fields are used by every scenario
00027 struct ScenarioContext
00028 {
00029     Windows::Storage::Streams::InMemoryRandomAccessStream^  raStream;
00030     Windows::Storage::Compression::Compressor^              compressor;
00031     Windows::Storage::Streams::DataWriter^                  writer;
00032     std::vector<byte>                                       originalData;
00033     std::vector<byte>                                       compressedData;
00034     std::vector<byte>                                       decompressedData;
00035 };
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/Settings.cs Source File

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers

Settings.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Foundation.Collections;
00003 using Windows.Storage;
00004
00005 namespace BackgroundTasks.Helpers
00006 {
00007     public static class Settings
00008     {
00009         private static IPropertySet currentSettings = ApplicationData.Current.LocalSettings.CreateContainer("Settings", ApplicationDataCreateDisposition.Always).Values;
00010
00011         public static IPropertySet Current
00012         {
00013             get
00014             {
00015                 return currentSettings;
00016             }
00017         }
00018
00019         private static readonly string SCENARIO_TO_OPEN_WHEN_LAUNCHED_OR_ACTIVATED = "ScenarioToOpenWhenLaunchedOrActivated";
00020
00021         public static Type ScenarioToOpenWhenLaunchedOrActivated
00022         {
00023             get
00024             {
00025                 if (Current.ContainsKey(SCENARIO_TO_OPEN_WHEN_LAUNCHED_OR_ACTIVATED))
00026                 {
00027                     string s = Current[SCENARIO_TO_OPEN_WHEN_LAUNCHED_OR_ACTIVATED] as string;
00028                     return Type.GetType(s);
00029                 }
00030
00031                 return null;
00032             }
00033
00034             set
00035             {
00036                 if (value == null)
00037                     Current.Remove(SCENARIO_TO_OPEN_WHEN_LAUNCHED_OR_ACTIVATED);
00038
00039                 else
00040                     Current[SCENARIO_TO_OPEN_WHEN_LAUNCHED_OR_ACTIVATED] = value.AssemblyQualifiedName;
00041             }
00042         }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShareImage Member List

This is the complete list of members for ShareImage, including all inherited members.
GetShareContent(DataRequest request) | ShareImage | [inline, protected]
imageFile | ShareImage | [private]
SelectImageButton_Click(object sender, RoutedEventArgs e) | ShareImage | [inline, private]
ShareImage() | ShareImage | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp Source File

  • PersonalDataEncryption
  • cppwinrt

Scenario2_Memory.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Memory.h"
00014 #include "Scenario2_Memory.g.cpp"
00015
00016 using namespace winrt::Windows::Foundation;
00017 using namespace winrt::Windows::Security::Cryptography;
00018 using namespace winrt::Windows::Security::DataProtection;
00019 using namespace winrt::Windows::Storage::Streams;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario2_Memory::Scenario2_Memory()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario2_Memory::OnNavigatedTo(NavigationEventArgs const&)
00031     {
00032         userDataProtectionManager = UserDataProtectionManager::TryGetDefault();
00033         if (userDataProtectionManager)
00034         {
00035             AvailablePanel().Visibility(Visibility::Visible);
00036             UnavailablePanel().Visibility(Visibility::Collapsed);
00037         }
00038         else
00039         {
00040             AvailablePanel().Visibility(Visibility::Collapsed);
00041             UnavailablePanel().Visibility(Visibility::Visible);
00042         }
00043     }
00044
00045     fire_and_forget Scenario2_Memory::ProtectL1_Click(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         auto lifetime = get_strong();
00048         hstring text = DataTextBox().Text();
00049         if (text.empty())
00050         {
00051             // Cannot protect a zero-length buffer.
00052             rootPage.NotifyUser(L"Please enter data to protect", NotifyType::ErrorMessage);
00053             co_return;
00054         }
00055
00056         IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(text, BinaryStringEncoding::Utf8);
00057
00058         IBuffer result = co_await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability::AfterFirstUnlock);
00059         ReportProtectedBuffer(result);
00060     }
00061
00062     fire_and_forget Scenario2_Memory::ProtectL2_Click(IInspectable const&, RoutedEventArgs const&)
00063     {
00064         auto lifetime = get_strong();
00065         hstring text = DataTextBox().Text();
00066         if (text.empty())
00067         {
00068             // Cannot protect a zero-length buffer.
00069             rootPage.NotifyUser(L"Please enter data to protect", NotifyType::ErrorMessage);
00070             co_return;
00071         }
00072
00073         IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(text, BinaryStringEncoding::Utf8);
00074
00075         IBuffer result = co_await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability::WhileUnlocked);
00076         ReportProtectedBuffer(result);
00077     }
00078
00079     void Scenario2_Memory::ReportProtectedBuffer(IBuffer const& buffer)
00080     {
00081         protectedBuffer = buffer;
00082         ProtectedDataTextBlock().Text(CryptographicBuffer::EncodeToHexString(buffer));
00083         UnprotectPanel().Visibility(Visibility::Visible);
00084         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00085     }
00086
00087     fire_and_forget Scenario2_Memory::Unprotect_Click(IInspectable const&, RoutedEventArgs const&)
00088     {
00089         auto lifetime = get_strong();
00090         UnprotectedDataTextBlock().Text(L"");
00091         UserDataBufferUnprotectResult result = co_await userDataProtectionManager.UnprotectBufferAsync(protectedBuffer);
00092         switch (result.Status())
00093         {
00094         case UserDataBufferUnprotectStatus::Succeeded:
00095             rootPage.NotifyUser(L"Unprotected successfully", NotifyType::StatusMessage);
00096             UnprotectedDataTextBlock().Text(CryptographicBuffer::ConvertBinaryToString(BinaryStringEncoding::Utf8, result.UnprotectedBuffer()));
00097             break;
00098
00099         case UserDataBufferUnprotectStatus::Unavailable:
00100             rootPage.NotifyUser(L"Unable to unprotect: Unavailable", NotifyType::ErrorMessage);
00101             break;
00102
00103         default:
00104             rootPage.NotifyUser(L"Unable to unprotect: Unknown error", NotifyType::ErrorMessage);
00105             break;
00106         }
00107     }
00108 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/pch.h Source File

  • SpatialSound
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020
00021 #include <XAudio2.h>
00022 #include <xapo.h>
00023 #include <hrtfapoapi.h>
00024 #include <DirectXMath.h>
00025 #include <wrl\client.h>
00026 #include <wrl\implements.h>
00027 #include <mfapi.h>
00028 #include <mfidl.h>
00029 #include <mfreadwrite.h>
00030 #include <strsafe.h>
00031
00032 using namespace Microsoft::WRL;
00033 using namespace Windows::UI::Xaml;
00034 using namespace Windows::Foundation;
00035
00036 #include "AudioFileReader.h"
00037 #include "XAudio2Helpers.h"
00038 #include "App.xaml.h"
00039 #include "OmnidirectionalSound.h"
00040 #include "CardioidSound.h"
00041 #include "CustomDecay.h"
00042
00043 #define HRTF_2PI    6.283185307f
00044
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/SampleConfiguration.cpp Source File

  • IoT-GPIO
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016
00017 Platform::Array<SDKTemplate::Scenario>^ SDKTemplate::MainPage::scenariosInner = ref new Platform::Array<SDKTemplate::Scenario>
00018 {
00019     { "Get and set GPIO pin value", "SDKTemplate.Scenario1_GetAndSetPin" },
00020     { "Listen for changes in GPIO pin value", "SDKTemplate.Scenario2_Listen" },
00021 };
00022
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/ShowPackageFamilyName.cpp Source File

  • AppServices
  • cppwinrt
  • AppServicesProvider

ShowPackageFamilyName.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "ShowPackageFamilyName.h"
00014 #include "ShowPackageFamilyName.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::ApplicationModel;
00018
00019 namespace winrt::SDKTemplate::implementation
00020 {
00021     ShowPackageFamilyName::ShowPackageFamilyName()
00022     {
00023         InitializeComponent();
00024         PackageFamilyName().Text(Package::Current().Id().FamilyName());
00025     }
00026 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario1_SampleBackgroundTask.xaml.cpp Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario1_SampleBackgroundTask.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1_SampleBackgroundTask.xaml.cpp
00013 // Implementation of the SampleBackgroundTask class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario1_SampleBackgroundTask.xaml.h"
00018 #include "SampleConfiguration.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::ApplicationModel::Background;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 SampleBackgroundTask::SampleBackgroundTask()
00029 {
00030     InitializeComponent();
00031 }
00032
00033 /// <summary>
00034 /// Invoked when this page is about to be displayed in a Frame.
00035 /// </summary>
00036 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037 /// property is typically used to configure the page.</param>
00038 void SampleBackgroundTask::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00041     // as NotifyUser()
00042     rootPage = MainPage::Current;
00043
00044     //
00045     // Attach progress and completed handlers to any existing tasks.
00046     //
00047     for (auto pair : BackgroundTaskRegistration::AllTasks)
00048     {
00049         auto task = pair->Value;
00050         if (task->Name == SampleBackgroundTaskName)
00051         {
00052             BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, true);
00053             AttachProgressAndCompletedHandlers(task);
00054             break;
00055         }
00056     }
00057
00058     UpdateUI();
00059 }
00060
00061 /// <summary>
00062 /// Attach progress and completed handers to a background task.
00063 /// </summary>
00064 /// <param name="task">The task to attach progress and completed handlers to.</param>
00065 void SampleBackgroundTask::AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration^ task)
00066 {
00067     task->Progress += ref new BackgroundTaskProgressEventHandler(this, &SampleBackgroundTask::OnProgress);
00068     task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &SampleBackgroundTask::OnCompleted);
00069 }
00070
00071 /// <summary>
00072 /// Register a SampleBackgroundTask.
00073 /// </summary>
00074 /// <param name="sender"></param>
00075 /// <param name="e"></param>
00076 void SampleBackgroundTask::RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00077 {
00078     auto task = BackgroundTaskSample::RegisterBackgroundTask(SampleBackgroundTaskEntryPoint,
00079                                                              SampleBackgroundTaskName,
00080                                                              ref new SystemTrigger(SystemTriggerType::TimeZoneChange, false),
00081                                                              nullptr);
00082     AttachProgressAndCompletedHandlers(task);
00083     UpdateUI();
00084 }
00085
00086 /// <summary>
00087 /// Unregister a SampleBackgroundTask.
00088 /// </summary>
00089 /// <param name="sender"></param>
00090 /// <param name="e"></param>
00091 void SampleBackgroundTask::UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00092 {
00093     BackgroundTaskSample::UnregisterBackgroundTasks(SampleBackgroundTaskName);
00094     UpdateUI();
00095 }
00096
00097 /// <summary>
00098 /// Handle background task progress.
00099 /// </summary>
00100 /// <param name="task">The task that is reporting progress.</param>
00101 /// <param name="args">Arguments of the progress report.</param>
00102 void SampleBackgroundTask::OnProgress(BackgroundTaskRegistration^ task, BackgroundTaskProgressEventArgs^ args)
00103 {
00104     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00105     {
00106         auto progress = "Progress: " + args->Progress + "%";
00107         BackgroundTaskSample::SampleBackgroundTaskProgress = progress;
00108         UpdateUI();
00109     }));
00110 }
00111
00112 /// <summary>
00113 /// Handle background task completion.
00114 /// </summary>
00115 /// <param name="task">The task that is reporting completion.</param>
00116 /// <param name="args">Arguments of the completion report.</param>
00117 void SampleBackgroundTask::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00118 {
00119     UpdateUI();
00120 }
00121
00122 /// <summary>
00123 /// Update the scenario UI.
00124 /// </summary>
00125 void SampleBackgroundTask::UpdateUI()
00126 {
00127     auto uiDelegate = [this]()
00128     {
00129         RegisterButton->IsEnabled = !BackgroundTaskSample::SampleBackgroundTaskRegistered;
00130         UnregisterButton->IsEnabled = BackgroundTaskSample::SampleBackgroundTaskRegistered;
00131         Progress->Text = BackgroundTaskSample::SampleBackgroundTaskProgress;
00132         Status->Text = BackgroundTaskSample::GetBackgroundTaskStatus(SampleBackgroundTaskName);
00133     };
00134     auto handler = ref new Windows::UI::Core::DispatchedHandler(uiDelegate, Platform::CallbackContext::Any);
00135
00136     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, handler);
00137 }
Generated on Fri Nov 15 2024 22:18:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VideoPlayback/cs/Scenario7_VideoComposition.xaml.cs Source File

  • VideoPlayback
  • cs

Scenario7_VideoComposition.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Numerics;
00014 using Windows.Media.Core;
00015 using Windows.Media.Playback;
00016 using Windows.Storage;
00017 using Windows.Storage.Pickers;
00018 using Windows.UI.Composition;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Hosting;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// Demonstrates basic rendering of a MediaPlayer to a Composition surface.
00028     ///
00029     /// This is a copy of scenario 1, but with UI Composition techniques.
00030     ///
00031     /// Not shown in this sample are re-sizing a button to the video size, nor
00032     /// resizing video to button size, nor resizing operations as the UI changes.
00033     /// </summary>
00034     public sealed partial class Scenario7 : Page
00035     {
00036         private MainPage rootPage = MainPage.Current;
00037         private MediaPlayer mediaPlayer;
00038
00039         public Scenario7()
00040         {
00041             this.InitializeComponent();
00042             Loaded += Scenario8_Loaded;
00043         }
00044
00045         private void Scenario8_Loaded(object sender, RoutedEventArgs e)
00046         {
00047             mediaPlayer = new MediaPlayer();
00048             mediaPlayer.Source = MediaSource.CreateFromUri(rootPage.CaptionedMediaUri);
00049             mediaPlayer.Play();
00050
00051             // Bind to the element in the Loaded event after the layout
00052             // pass has run and sized elements
00053             BindMediaPlayerToUIElement(mediaPlayer, mediaPlayerButton);
00054         }
00055
00056         protected override void OnNavigatedFrom(NavigationEventArgs e)
00057         {
00058             // Dispose the media player so it doesn't continue to play audio
00059             // after the page is unloaded
00060             mediaPlayer.Dispose();
00061
00062             base.OnNavigatedFrom(e);
00063         }
00064
00065         private void mediaPlayerButton_Click(object sender, RoutedEventArgs e)
00066         {
00067             if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
00068                 mediaPlayer.Pause();
00069             else if (mediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
00070                 mediaPlayer.Play();
00071         }
00072
00073         private void BindMediaPlayerToUIElement(MediaPlayer mediaPlayer, UIElement uiElement)
00074         {
00075             // Get the backing composition visual for the passed in UIElement
00076             Visual hostVisual = ElementCompositionPreview.GetElementVisual(uiElement);
00077
00078             // Get the compositor the visual belongs to
00079             Compositor compositor = hostVisual.Compositor;
00080
00081             // Create a new container and make it a child of the element
00082             ContainerVisual container = compositor.CreateContainerVisual();
00083             ElementCompositionPreview.SetElementChildVisual(uiElement, container);
00084
00085             // Add a new sprite visual to paint the player onto
00086             var playerVisual = compositor.CreateSpriteVisual();
00087             playerVisual.Size = uiElement.RenderSize.ToVector2();
00088             container.Children.InsertAtTop(playerVisual);
00089
00090             // Get the player's surface
00091             var mediaSurface = mediaPlayer.GetSurface(compositor);
00092             var compositionSurface = mediaSurface.CompositionSurface;
00093
00094             // Convert the surface to a brush used to paint the visual
00095             playerVisual.Brush = compositor.CreateSurfaceBrush(compositionSurface);
00096         }
00097
00098         /// <summary>
00099         /// Handles the pick file button click event to load a video.
00100         /// </summary>
00101         private async void pickFileButton_Click(object sender, RoutedEventArgs e)
00102         {
00103             // Clear previous returned file name, if it exists, between iterations of this scenario
00104             rootPage.NotifyUser("", NotifyType.StatusMessage);
00105
00106             // Create and open the file picker
00107             FileOpenPicker openPicker = new FileOpenPicker();
00108             openPicker.ViewMode = PickerViewMode.Thumbnail;
00109             openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
00110             openPicker.FileTypeFilter.Add(".mp4");
00111             openPicker.FileTypeFilter.Add(".mkv");
00112             openPicker.FileTypeFilter.Add(".avi");
00113
00114             StorageFile file = await openPicker.PickSingleFileAsync();
00115             if (file != null)
00116             {
00117                 rootPage.NotifyUser("Picked video: " + file.Name, NotifyType.StatusMessage);
00118                 mediaPlayer.Source = MediaSource.CreateFromStorageFile(file);
00119                 mediaPlayer.Play();
00120             }
00121             else
00122             {
00123                 rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);
00124             }
00125         }
00126     }
00127 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AdaptiveContentModel Member List

This is the complete list of members for AdaptiveContentModel, including all inherited members.
AdaptiveContentModel(int id, string displayName, string manifestUri) | AdaptiveContentModel | [inline, private]
Aes | AdaptiveContentModel |
AesToken | AdaptiveContentModel |
Captions | AdaptiveContentModel |
DisplayName | AdaptiveContentModel |
GetKnownAzureMediaServicesModels() | AdaptiveContentModel | [inline, static]
Id | AdaptiveContentModel |
knownAzureMediaServiceModels | AdaptiveContentModel | [static]
Live | AdaptiveContentModel |
ManifestUri | AdaptiveContentModel |
PlayReady | AdaptiveContentModel |
Subtitles | AdaptiveContentModel |
ToString() | AdaptiveContentModel | [inline]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cs/SampleConfiguration.cs Source File

  • WebAccountManagement
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using Accounts;
00016
00017 // Important Note for running this sample:
00018 // The sample as-is will not be able to get tokens without having it's app manifest being
00019 // modified to use the App Identity of a registered Microsoft Store/registered AAD app.
00020 //
00021 // See 'Related Topics' in the README.md for instructions on how to register an app.
00022
00023 namespace SDKTemplate
00024 {
00025     public partial class MainPage : Page
00026     {
00027         public const string FEATURE_NAME = "Web account management";
00028
00029         List<Scenario> scenarios = new List<Scenario>
00030         {
00031             new Scenario() { Title="Default account", ClassType=typeof(DefaultAccountScenario)},
00032             new Scenario() { Title="Single Microsoft account", ClassType=typeof(SingleMicrosoftAccountScenario)},
00033             new Scenario() { Title="Single AzureAD account", ClassType=typeof(SingleAzureADScenario)},
00034             new Scenario() { Title="Single account of any provider", ClassType=typeof(SingleAccountScenario)},
00035             new Scenario() { Title="Multiple accounts", ClassType=typeof(MultipleAccountsScenario)},
00036         };
00037     }
00038
00039     public class Scenario
00040     {
00041         public string Title { get; set; }
00042         public Type ClassType { get; set; }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario2_ShowHideEvents.cpp Source File

  • TouchKeyboard
  • cppwinrt

Scenario2_ShowHideEvents.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_ShowHideEvents.h"
00014 #include "Scenario2_ShowHideEvents.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::ViewManagement;
00019 using namespace winrt::Windows::UI::Xaml;
00020 using namespace winrt::Windows::UI::Xaml::Navigation;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario2_ShowHideEvents::Scenario2_ShowHideEvents()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario2_ShowHideEvents::OnNavigatedTo(NavigationEventArgs const&)
00030     {
00031         InputPane currentInputPane = InputPane::GetForCurrentView();
00032
00033         // Subscribe to Showing/Hiding events
00034         showingEventToken = currentInputPane.Showing({ get_weak(), &Scenario2_ShowHideEvents::OnShowing });
00035         hidingEventToken = currentInputPane.Hiding({ get_weak(), &Scenario2_ShowHideEvents::OnHiding });
00036     }
00037
00038     void Scenario2_ShowHideEvents::OnNavigatedFrom(NavigationEventArgs const&)
00039     {
00040         InputPane currentInputPane = InputPane::GetForCurrentView();
00041
00042         // Unsubscribe from Showing/Hiding events
00043         currentInputPane.Showing(showingEventToken);
00044         currentInputPane.Hiding(hidingEventToken);
00045     }
00046
00047     void Scenario2_ShowHideEvents::OnShowing(InputPane const&, InputPaneVisibilityEventArgs const&)
00048     {
00049         LastInputPaneEventRun().Text(L"Showing");
00050     }
00051
00052     void Scenario2_ShowHideEvents::OnHiding(InputPane const&, InputPaneVisibilityEventArgs const&)
00053     {
00054         LastInputPaneEventRun().Text(L"Hiding");
00055     }
00056 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/AppView.cpp Source File

  • BasicHologram
  • cppwinrt

AppView.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "AppView.h"
00003
00004 using namespace BasicHologram;
00005
00006 using namespace concurrency;
00007 using namespace std::placeholders;
00008 using namespace winrt::Windows::ApplicationModel;
00009 using namespace winrt::Windows::ApplicationModel::Activation;
00010 using namespace winrt::Windows::ApplicationModel::Core;
00011 using namespace winrt::Windows::Foundation;
00012 using namespace winrt::Windows::Graphics::Holographic;
00013 using namespace winrt::Windows::UI::Core;
00014
00015 // The main function bootstraps into the IFrameworkView.
00016 int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
00017 {
00018     winrt::init_apartment();
00019     CoreApplication::Run(AppViewSource());
00020     return 0;
00021 }
00022
00023 // IFrameworkViewSource methods
00024
00025 IFrameworkView AppViewSource::CreateView()
00026 {
00027     return holographicView;
00028 }
00029
00030 // IFrameworkView methods
00031
00032 // The first method called when the IFrameworkView is being created.
00033 // Use this method to subscribe for Windows shell events and to initialize your app.
00034 void AppView::Initialize(CoreApplicationView const& applicationView)
00035 {
00036     applicationView.Activated(std::bind(&AppView::OnViewActivated, this, _1, _2));
00037
00038     // Register event handlers for app lifecycle.
00039     m_suspendingEventToken = CoreApplication::Suspending(bind(&AppView::OnSuspending, this, _1, _2));
00040     m_resumingEventToken = CoreApplication::Resuming(bind(&AppView::OnResuming, this, _1, _2));
00041
00042     // At this point we have access to the device and we can create device-dependent
00043     // resources.
00044     m_deviceResources = std::make_shared<DX::DeviceResources>();
00045
00046     m_main = std::make_unique<BasicHologramMain>(m_deviceResources);
00047 }
00048
00049 // Called when the CoreWindow object is created (or re-created).
00050 void AppView::SetWindow(CoreWindow const& window)
00051 {
00052     // Register for keypress notifications.
00053     m_keyDownEventToken = window.KeyDown(bind(&AppView::OnKeyPressed, this, _1, _2));
00054
00055     // Register for pointer pressed notifications.
00056     m_pointerPressedEventToken = window.PointerPressed(bind(&AppView::OnPointerPressed, this, _1, _2));
00057
00058     // Register for notification that the app window is being closed.
00059     m_windowClosedEventToken = window.Closed(bind(&AppView::OnWindowClosed, this, _1, _2));
00060
00061     // Register for notifications that the app window is losing focus.
00062     m_visibilityChangedEventToken = window.VisibilityChanged(bind(&AppView::OnVisibilityChanged, this, _1, _2));
00063
00064     // Create a holographic space for the core window for the current view.
00065     // Presenting holographic frames that are created by this holographic space will put
00066     // the app into exclusive mode.
00067     m_holographicSpace = HolographicSpace::CreateForCoreWindow(window);
00068
00069     // The DeviceResources class uses the preferred DXGI adapter ID from the holographic
00070     // space (when available) to create a Direct3D device. The HolographicSpace
00071     // uses this ID3D11Device to create and manage device-based resources such as
00072     // swap chains.
00073     m_deviceResources->SetHolographicSpace(m_holographicSpace);
00074
00075     // The main class uses the holographic space for updates and rendering.
00076     m_main->SetHolographicSpace(m_holographicSpace);
00077 }
00078
00079 // The Load method can be used to initialize scene resources or to load a
00080 // previously saved app state.
00081 void AppView::Load(winrt::hstring const& entryPoint)
00082 {
00083 }
00084
00085 // This method is called after the window becomes active. It oversees the
00086 // update, draw, and present loop, and it also oversees window message processing.
00087 void AppView::Run()
00088 {
00089     while (!m_windowClosed)
00090     {
00091         if (m_windowVisible && (m_holographicSpace != nullptr))
00092         {
00093             CoreWindow::GetForCurrentThread().Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
00094
00095             HolographicFrame holographicFrame = m_main->Update();
00096
00097             if (m_main->Render(holographicFrame))
00098             {
00099                 // The holographic frame has an API that presents the swap chain for each
00100                 // holographic camera.
00101                 m_deviceResources->Present(holographicFrame);
00102             }
00103         }
00104         else
00105         {
00106             CoreWindow::GetForCurrentThread().Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
00107         }
00108     }
00109 }
00110
00111 // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
00112 // class is torn down while the app is in the foreground, for example if the Run method exits.
00113 void AppView::Uninitialize()
00114 {
00115     m_main.reset();
00116     m_deviceResources.reset();
00117
00118     CoreApplication::Suspending(m_suspendingEventToken);
00119     CoreApplication::Resuming(m_resumingEventToken);
00120
00121     auto const& window = CoreWindow::GetForCurrentThread();
00122     window.KeyDown(m_keyDownEventToken);
00123     window.PointerPressed(m_pointerPressedEventToken);
00124     window.Closed(m_windowClosedEventToken);
00125     window.VisibilityChanged(m_visibilityChangedEventToken);
00126 }
00127
00128
00129 // Application lifecycle event handlers
00130
00131 // Called when the app is prelaunched. Use this method to load resources ahead of time
00132 // and enable faster launch times.
00133 void AppView::OnLaunched(LaunchActivatedEventArgs const& args)
00134 {
00135     if (args.PrelaunchActivated())
00136     {
00137         //
00138         // TODO: Insert code to preload resources here.
00139         //
00140     }
00141 }
00142
00143 // Called when the app view is activated. Activates the app's CoreWindow.
00144 void AppView::OnViewActivated(CoreApplicationView const& sender, IActivatedEventArgs const& args)
00145 {
00146     // Run() won't start until the CoreWindow is activated.
00147     sender.CoreWindow().Activate();
00148 }
00149
00150 void AppView::OnSuspending(winrt::Windows::Foundation::IInspectable const& sender, SuspendingEventArgs const& args)
00151 {
00152     // Save app state asynchronously after requesting a deferral. Holding a deferral
00153     // indicates that the application is busy performing suspending operations. Be
00154     // aware that a deferral may not be held indefinitely; after about five seconds,
00155     // the app will be forced to exit.
00156     SuspendingDeferral deferral = args.SuspendingOperation().GetDeferral();
00157
00158     create_task([this, deferral]()
00159     {
00160         m_deviceResources->Trim();
00161
00162         if (m_main != nullptr)
00163         {
00164             m_main->SaveAppState();
00165         }
00166
00167         //
00168         // TODO: Insert code here to save your app state.
00169         //
00170
00171         deferral.Complete();
00172     });
00173 }
00174
00175 void AppView::OnResuming(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::Foundation::IInspectable const& args)
00176 {
00177     // Restore any data or state that was unloaded on suspend. By default, data
00178     // and state are persisted when resuming from suspend. Note that this event
00179     // does not occur if the app was previously terminated.
00180
00181     if (m_main != nullptr)
00182     {
00183         m_main->LoadAppState();
00184     }
00185
00186     //
00187     // TODO: Insert code here to load your app state.
00188     //
00189 }
00190
00191
00192 // Window event handlers
00193
00194 void AppView::OnVisibilityChanged(CoreWindow const& sender, VisibilityChangedEventArgs const& args)
00195 {
00196     m_windowVisible = args.Visible();
00197 }
00198
00199 void AppView::OnWindowClosed(CoreWindow const& sender, CoreWindowEventArgs const& args)
00200 {
00201     m_windowClosed = true;
00202 }
00203
00204
00205 // Input event handlers
00206
00207 void AppView::OnKeyPressed(CoreWindow const& sender, KeyEventArgs const& args)
00208 {
00209     //
00210     // TODO: Bluetooth keyboards are supported by HoloLens. You can use this method for
00211     //       keyboard input if you want to support it as an optional input method for
00212     //       your holographic app.
00213     //
00214 }
00215
00216 void AppView::OnPointerPressed(CoreWindow const& sender, PointerEventArgs const& args)
00217 {
00218     // Allow the user to interact with the holographic world using the mouse.
00219     if (m_main != nullptr)
00220     {
00221         m_main->OnPointerPressed();
00222     }
00223 }
00224
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/pch.cpp Source File

  • JapanesePhoneticAnalysis
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario2_Polling.xaml.h Source File

  • OrientationSensor
  • cpp

Scenario2_Polling.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.h
00014 // Declaration of the Scenario2_Polling class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario2_Polling.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario2_Polling sealed
00030     {
00031     public:
00032         Scenario2_Polling();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038         void ScenarioEnable();
00039         void ScenarioDisable();
00040
00041     private:
00042         SDKTemplate::MainPage^ rootPage;
00043         Windows::UI::Core::CoreDispatcher^ dispatcher;
00044         Windows::Devices::Sensors::OrientationSensor^ sensor;
00045         Windows::Foundation::EventRegistrationToken visibilityToken;
00046         uint32 desiredReportInterval;
00047         Windows::UI::Xaml::DispatcherTimer^ dispatcherTimer;
00048
00049         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00050         void DisplayCurrentReading(Platform::Object^ sender, Platform::Object^ e);
00051     };
00052 }
Generated on Fri Nov 15 2024 22:17:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/pch.h Source File

  • XamlCloudFontIntegration
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020
00021 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/SampleConfiguration.h Source File

  • BasicFaceDetection
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate::SampleHelpers
00016 {
00017     void HighlightFaces(
00018         Windows::UI::Xaml::Media::Imaging::WriteableBitmap const& displaySource,
00019         Windows::Foundation::Collections::IVector<Windows::Media::FaceAnalysis::DetectedFace> const& foundFaces,
00020         Windows::UI::Xaml::Controls::Canvas const& canvas,
00021         Windows::UI::Xaml::DataTemplate const& dataTemplate);
00022     void RepositionFaces(
00023         Windows::UI::Xaml::Media::Imaging::WriteableBitmap const& displaySource,
00024         Windows::UI::Xaml::Controls::Canvas const& canvas);
00025 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario1.xaml.cs Source File

  • AllJoyn
  • ConsumerExperiences
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace AllJoynConsumerExperiences
00016 {
00017     public sealed partial class Scenario1 : Page
00018     {
00019         private Scenario1ViewModel m_scenario1ViewModel = null;
00020
00021         public Scenario1()
00022         {
00023             InitializeComponent();
00024             m_scenario1ViewModel = new Scenario1ViewModel();
00025             DataContext = m_scenario1ViewModel;
00026         }
00027
00028         // Cleanup scenario when it is about to be unloaded.
00029         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00030         {
00031             if (m_scenario1ViewModel != null)
00032             {
00033                 m_scenario1ViewModel.ScenarioCleanup();
00034             }
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cs/Scenario10.xaml.cs Source File

  • MapControl
  • cs

Scenario10.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using System.Collections.ObjectModel;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Controls.Maps;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario10 : Page
00021     {
00022         MapElementsLayer myLayer1;
00023         MapElementsLayer myLayer2;
00024         IList<MapLayer> myLayers = new ObservableCollection<MapLayer>();
00025
00026         // This scenario creates two layers. The user can select a layer by clicking on an
00027         // element in that layer or by using one of the buttons.
00028
00029         public Scenario10()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         private void MyMap_Loaded(object sender, RoutedEventArgs e)
00035         {
00036             myMap.Center = MainPage.SeattleGeopoint;
00037             myMap.ZoomLevel = 16;
00038             CreateLayers();
00039         }
00040
00041         private void CreateLayers()
00042         {
00043             // Populate multiple layers containing points and connect up the click to events.
00044             AddLayer1();
00045             AddLayer2();
00046
00047             // Style the layers so that layer 1 is selected and layer 2 is deselected.
00048             SelectLayer(this.myLayer1);
00049
00050             // Connect the layers to the map.
00051             myMap.Layers = this.myLayers;
00052         }
00053
00054         private void AddLayer1()
00055         {
00056             this.myLayer1 = new MapElementsLayer();
00057             this.myLayer1.MapElements = MainPage.CreateCityBuildingsCollection();
00058             this.myLayer1.MapElementClick += (sender, args) => SelectLayer(this.myLayer1);
00059
00060             this.myLayers.Add(this.myLayer1);
00061         }
00062
00063         private void AddLayer2()
00064         {
00065             this.myLayer2 = new MapElementsLayer();
00066             this.myLayer2.MapElements = MainPage.CreateCityParksCollection();
00067             this.myLayer2.MapElementClick += (sender, args) => SelectLayer(this.myLayer2);
00068
00069             this.myLayers.Add(this.myLayer2);
00070         }
00071
00072         private void mapElementsLayer1Button_Click(object sender, RoutedEventArgs e)
00073         {
00074             SelectLayer(this.myLayer1);
00075         }
00076
00077         private void mapElementsLayer2Button_Click(object sender, RoutedEventArgs e)
00078         {
00079             SelectLayer(this.myLayer2);
00080         }
00081
00082         private void SelectLayer(MapElementsLayer selectedLayer)
00083         {
00084             // Ignore layer changes if no layers have been created.
00085             if (selectedLayer == null) return;
00086
00087             // The other layer becomes deselected.
00088             MapElementsLayer deselectedLayer = (selectedLayer == this.myLayer1) ? this.myLayer2 : this.myLayer1;
00089
00090             // The deselected layer goes to z-index 0, and its elements appear disabled.
00091             deselectedLayer.ZIndex = 0;
00092             foreach (MapElement e in deselectedLayer.MapElements)
00093             {
00094                 e.MapStyleSheetEntryState = MapStyleSheetEntryStates.Disabled;
00095             }
00096
00097             // The selected layer goes to z-index 1, and its elements appear normal.
00098             selectedLayer.ZIndex = 1;
00099             foreach (MapElement e in selectedLayer.MapElements)
00100             {
00101                 e.MapStyleSheetEntryState = "";
00102             }
00103         }
00104     }
00105 }
Generated on Fri Nov 15 2024 22:18:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
_applicationResumingEventToken | sealed | [private]
_applicationSuspendingEventToken | sealed | [private]
_captureFolder | sealed | [private]
_deviceOrientation | sealed | [private]
_displayInformation | sealed | [private]
_displayInformationEventToken | sealed | [private]
_displayOrientation | sealed | [private]
_displayRequest | sealed | [private]
_encodingProfile | sealed | [private]
_externalCamera | sealed | [private]
_hardwareCameraButtonEventToken | sealed | [private]
_inputPropertiesBackup | sealed | [private]
_isInitialized | sealed | [private]
_isPreviewing | sealed | [private]
_isRecording | sealed | [private]
_mediaCapture | sealed | [private]
_mediaCaptureFailedEventToken | sealed | [private]
_mediaControlPropChangedEventToken | sealed | [private]
_mirroringPreview | sealed | [private]
_orientationChangedEventToken | sealed | [private]
_orientationSensor | sealed | [private]
_outputPropertiesBackup | sealed | [private]
_recordLimitationExceededEventToken | sealed | [private]
_systemMediaControls | sealed | [private]
_videoStabilizationEffect | sealed | [private]
_videoStabilizationEnabledToken | sealed | [private]
Application_Resuming(Object^sender, Object^args) | sealed | [private]
Application_Suspending(Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
CleanupCameraAsync() | sealed | [private]
CleanupUiAsync() | sealed | [private]
CleanUpVideoStabilizationEffectAsync() | sealed | [private]
ConvertDeviceOrientationToDegrees(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
ConvertDisplayOrientationToDegrees(Windows::Graphics::Display::DisplayOrientations orientation) | sealed | [private]
ConvertOrientationToPhotoOrientation(Windows::Devices::Sensors::SimpleOrientation orientation) | sealed | [private]
CreateVideoStabilizationEffectAsync() | sealed | [private]
DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation^sender, Object^args) | sealed | [private]
EmptyTask() | sealed | [private]
FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel) | sealed | [private]
GetCameraOrientation() | sealed | [private]
HardwareButtons_CameraPressed(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
InitializeCameraAsync() | sealed | [private]
MainPage() | sealed |
MediaCapture_Failed(Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs) | sealed | [private]
MediaCapture_RecordLimitationExceeded(Windows::Media::Capture::MediaCapture^currentCaptureObject) | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
OrientationSensor_OrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^) | sealed | [private]
RegisterEventHandlers() | sealed | [private]
RotationKey | sealed | [private]
SetPreviewRotationAsync() | sealed | [private]
SetupUiAsync() | sealed | [private]
SetUpVideoStabilizationRecommendationAsync() | sealed | [private]
StartPreviewAsync() | sealed | [private]
StartRecordingAsync() | sealed | [private]
StopPreviewAsync() | sealed | [private]
StopRecordingAsync() | sealed | [private]
SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args) | sealed | [private]
UnregisterEventHandlers() | sealed | [private]
UpdateButtonOrientation() | sealed | [private]
UpdateCaptureControls() | sealed | [private]
VideoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
VideoStabilizationEffect_EnabledChanged(Windows::Media::Core::VideoStabilizationEffect^sender, Windows::Media::Core::VideoStabilizationEffectEnabledChangedEventArgs^args) | sealed | [private]
VsToggleButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
WriteException(Platform::Exception^ex) | sealed | [private]
WriteLine(Platform::String^str) | sealed | [private]
~MainPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/CameraResources.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Common

CameraResources.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace DX
00004 {
00005     class DeviceResources;
00006
00007     // Constant buffer used to send the view-projection matrices to the shader pipeline.
00008     struct ViewProjectionConstantBuffer
00009     {
00010         DirectX::XMFLOAT4X4 viewProjection[2];
00011     };
00012
00013     // Assert that the constant buffer remains 16-byte aligned (best practice).
00014     static_assert((sizeof(ViewProjectionConstantBuffer) % (sizeof(float) * 4)) == 0, "ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00015
00016     // Manages DirectX device resources that are specific to a holographic camera, such as the
00017     // back buffer, ViewProjection constant buffer, and viewport.
00018     class CameraResources
00019     {
00020     public:
00021         CameraResources(Windows::Graphics::Holographic::HolographicCamera^ holographicCamera);
00022
00023         void CreateResourcesForBackBuffer(
00024             DX::DeviceResources* pDeviceResources,
00025             Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ cameraParameters
00026             );
00027         void ReleaseResourcesForBackBuffer(
00028             DX::DeviceResources* pDeviceResources
00029             );
00030
00031         void UpdateViewProjectionBuffer(
00032             std::shared_ptr<DX::DeviceResources> deviceResources,
00033             Windows::Graphics::Holographic::HolographicCameraPose^ cameraPose,
00034             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00035
00036         bool AttachViewProjectionBuffer(
00037             std::shared_ptr<DX::DeviceResources> deviceResources);
00038
00039         // Direct3D device resources.
00040         ID3D11RenderTargetView* GetBackBufferRenderTargetView()     const { return m_d3dRenderTargetView.Get();     }
00041         ID3D11DepthStencilView* GetDepthStencilView()               const { return m_d3dDepthStencilView.Get();     }
00042         ID3D11Texture2D*        GetBackBufferTexture2D()            const { return m_d3dBackBuffer.Get();           }
00043         D3D11_VIEWPORT          GetViewport()                       const { return m_d3dViewport;                   }
00044         DXGI_FORMAT             GetBackBufferDXGIFormat()           const { return m_dxgiFormat;                    }
00045         ID3D11BlendState*       GetBlendState()                     const { return m_blendState.Get();              }
00046
00047         // Render target properties.
00048         Windows::Foundation::Size GetRenderTargetSize()             const { return m_d3dRenderTargetSize;           }
00049         bool                    IsRenderingStereoscopic()           const { return m_isStereo;                      }
00050
00051         // The holographic camera these resources are for.
00052         Windows::Graphics::Holographic::HolographicCamera^ GetHolographicCamera() const { return m_holographicCamera; }
00053
00054     private:
00055         // Direct3D rendering objects. Required for 3D.
00056         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>      m_d3dRenderTargetView;
00057         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>      m_d3dDepthStencilView;
00058         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_d3dBackBuffer;
00059         Microsoft::WRL::ComPtr<ID3D11BlendState>            m_blendState;
00060
00061         // Device resource to store view and projection matrices.
00062         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_viewProjectionConstantBuffer;
00063
00064         // Direct3D rendering properties.
00065         DXGI_FORMAT                                         m_dxgiFormat;
00066         Windows::Foundation::Size                           m_d3dRenderTargetSize;
00067         D3D11_VIEWPORT                                      m_d3dViewport;
00068
00069         // Indicates whether the camera supports stereoscopic rendering.
00070         bool                                                m_isStereo = false;
00071
00072         // Indicates whether this camera has a pending frame.
00073         bool                                                m_framePending = false;
00074
00075         // Pointer to the holographic camera these resources are for.
00076         Windows::Graphics::Holographic::HolographicCamera^  m_holographicCamera = nullptr;
00077     };
00078 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneController.h Source File

  • HolographicSpatialStage
  • cpp
  • Content

SceneController.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "..\Common\DeviceResources.h"
00004 #include "..\Common\StepTimer.h"
00005 #include "ShaderStructures.h"
00006 #include "SceneObject.h"
00007
00008 namespace HolographicSpatialStage
00009 {
00010     // This sample renderer instantiates a basic rendering pipeline.
00011     class SceneController
00012     {
00013     public:
00014         SceneController(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00015         void CreateDeviceDependentResources();
00016         void ReleaseDeviceDependentResources();
00017         void Update(const DX::StepTimer& timer, Windows::Perception::Spatial::SpatialCoordinateSystem^ viewCoords);
00018         void Render();
00019
00020         void AddSceneObject(std::shared_ptr<SceneObject>& newObject) { m_sceneObjects.push_back(newObject); }
00021         void ClearSceneObjects() { m_sceneObjects.clear(); }
00022
00023     private:
00024         // Cached pointer to device resources.
00025         std::shared_ptr<DX::DeviceResources>        m_deviceResources;
00026         std::vector<std::shared_ptr<SceneObject>>   m_sceneObjects;
00027     };
00028 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/Scenario3_SecondaryTiles.xaml.cs Source File

  • LockScreenApps
  • cs

Scenario3_SecondaryTiles.xaml.cs

Go to the documentation of this file.
00001 ﻿// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 using NotificationsExtensions;
00009 using NotificationsExtensions.Badges;
00010 using NotificationsExtensions.Tiles;
00011 using System;
00012 using Windows.Foundation;
00013 using Windows.UI.Notifications;
00014 using Windows.UI.Popups;
00015 using Windows.UI.StartScreen;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Media;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario3_SecondaryTiles : Page
00024     {
00025         MainPage rootPage = MainPage.Current;
00026         private const String BADGE_TILE_ID = "ST_BADGE";
00027         private const String TEXT_TILE_ID = "ST_BADGE_AND_TEXT";
00028
00029         public Scenario3_SecondaryTiles()
00030         {
00031             InitializeComponent();
00032         }
00033
00034         private async void CreateBadgeTile_Click(object sender, RoutedEventArgs e)
00035         {
00036             if (!SecondaryTile.Exists(BADGE_TILE_ID)) {
00037                 SecondaryTile secondTile = new SecondaryTile(
00038                     BADGE_TILE_ID,
00039                     "LockScreen CS - Badge only",
00040                     "BADGE_ARGS",
00041                     new Uri("ms-appx:///Assets/squareTile-sdk.png"),
00042                     TileSize.Square150x150
00043                 );
00044                 secondTile.LockScreenBadgeLogo = new Uri("ms-appx:///Assets/badgelogo-sdk.png");
00045
00046                 bool isPinned = await secondTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement)sender), Placement.Above);
00047                 if (isPinned)
00048                 {
00049                     BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(2);
00050                     BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(BADGE_TILE_ID).Update(new BadgeNotification(badgeContent.GetXml()));
00051                     rootPage.NotifyUser("Secondary tile created and badge updated. Go to PC settings to add it to the lock screen.", NotifyType.StatusMessage);
00052                 }
00053                 else
00054                 {
00055                     rootPage.NotifyUser("Tile not created.", NotifyType.ErrorMessage);
00056                 }
00057
00058             } else {
00059                 rootPage.NotifyUser("Badge secondary tile already exists.", NotifyType.ErrorMessage);
00060             }
00061         }
00062
00063         private async void CreateBadgeAndTextTile_Click(object sender, RoutedEventArgs e)
00064         {
00065             if (!SecondaryTile.Exists(TEXT_TILE_ID))
00066             {
00067                 SecondaryTile secondTile = new SecondaryTile(
00068                     TEXT_TILE_ID,
00069                     "LockScreen CS - Badge and tile text",
00070                     "TEXT_ARGS",
00071                     new Uri("ms-appx:///Assets/squareTile-sdk.png"),
00072                     TileSize.Wide310x150
00073                 );
00074                 secondTile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/tile-sdk.png");
00075                 secondTile.LockScreenBadgeLogo = new Uri("ms-appx:///Assets/badgelogo-sdk.png");
00076                 secondTile.LockScreenDisplayBadgeAndTileText = true;
00077
00078                 bool isPinned = await secondTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement)sender), Placement.Above);
00079                 if (isPinned)
00080                 {
00081                     var tileDOM = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Text03);
00082                     tileDOM.SelectSingleNode("//text[@id=1]").InnerText = "Text for the lock screen";
00083
00084                     TileUpdateManager.CreateTileUpdaterForSecondaryTile(TEXT_TILE_ID).Update(new TileNotification(tileDOM));
00085                     rootPage.NotifyUser("Secondary tile created and updated. Go to PC settings to add it to the lock screen.", NotifyType.StatusMessage);
00086                 }
00087                 else
00088                 {
00089                     rootPage.NotifyUser("Tile not created.", NotifyType.ErrorMessage);
00090                 }
00091             }
00092             else
00093             {
00094                 rootPage.NotifyUser("Badge and text secondary tile already exists.", NotifyType.ErrorMessage);
00095             }
00096         }
00097
00098         private Rect GetElementRect(FrameworkElement element)
00099         {
00100             GeneralTransform buttonTransform = element.TransformToVisual(null);
00101             return buttonTransform.TransformBounds(new Rect(0, 0, element.ActualWidth, element.ActualHeight));
00102         }
00103     }
00104 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cppwinrt/OcrCapturedImage.h Source File

  • OCR
  • cppwinrt

OcrCapturedImage.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include "pch.h"
00004 #include "MainPage.h"
00005 #include "WordOverlay.h"
00006 #include "OcrCapturedImage.g.h"
00007
00008 using namespace winrt;
00009 using namespace Windows::Devices::Enumeration;
00010 using namespace Windows::Foundation::Collections;
00011 using namespace Windows::Graphics::Display;
00012 using namespace Windows::UI::Xaml::Navigation;
00013
00014 namespace winrt::SDKTemplate::implementation
00015 {
00016     struct OcrCapturedImage : OcrCapturedImageT<OcrCapturedImage>
00017     {
00018         OcrCapturedImage();
00019
00020         fire_and_forget OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00021         fire_and_forget OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const& e);
00022         fire_and_forget Application_Suspending(Windows::Foundation::IInspectable const& sender, Windows::ApplicationModel::SuspendingEventArgs const& e);
00023         fire_and_forget Application_Resuming(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00024         void DisplayInformation_OrientationChanged(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
00025
00026         fire_and_forget CameraButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         fire_and_forget ExtractButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029         void PreviewImage_SizeChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::SizeChangedEventArgs const& e);
00030
00031     private:
00032         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00033
00034         // Language for OCR.
00035         Windows::Globalization::Language ocrLanguage{ Windows::Globalization::Language(L"en") };
00036
00037         // Recognized words overlay boxes.
00038         std::vector<com_ptr<WordOverlay>> wordBoxes;
00039
00040         // Receive notifications about rotation of the UI and apply any necessary rotation to the preview stream.
00041         Windows::Graphics::Display::DisplayInformation displayInformation{ Windows::Graphics::Display::DisplayInformation::GetForCurrentView() };
00042
00043         // Rotation metadata to apply to the preview stream (MF_MT_VIDEO_ROTATION).
00044         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00045         static constexpr GUID RotationKey{ 0xC380465D, 0x2271, 0x428C,{ 0x9B, 0x83, 0xEC, 0xEA, 0x3B, 0x4A, 0x85, 0xC1} };
00046
00047         // Prevent the screen from sleeping while the camera is running.
00048         Windows::System::Display::DisplayRequest displayRequest;
00049
00050         // MediaCapture and its state variables.
00051         Windows::Media::Capture::MediaCapture mediaCapture{ nullptr };
00052         bool isInitialized = false;
00053         bool isPreviewing = false;
00054
00055         // Information about the camera device.
00056         bool mirroringPreview = false;
00057         bool externalCamera = false;
00058
00059         event_token orientationChangedEventToken;
00060         event_token mediaCaptureFailedToken;
00061         event_token applicationSuspendingToken;
00062         event_token applicationResumingToken;
00063
00064     private:
00065         Windows::Foundation::IAsyncAction StartCameraAsync();
00066         Windows::Foundation::IAsyncAction InitializeCameraAsync();
00067         Windows::Foundation::IAsyncAction StartPreviewAsync();
00068         Windows::Foundation::IAsyncAction SetPreviewRotationAsync();
00069         Windows::Foundation::IAsyncAction StopPreviewAsync();
00070         Windows::Foundation::IAsyncAction CleanupCameraAsync();
00071
00072         void UpdateWordBoxTransform();
00073         Windows::Foundation::IAsyncOperation<DeviceInformation> FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel desiredPanel);
00074         std::pair<Windows::Media::Capture::VideoRotation, int> CalculatePreviewRotation();
00075         fire_and_forget MediaCapture_Failed(Windows::Media::Capture::MediaCapture const& sender, Windows::Media::Capture::MediaCaptureFailedEventArgs const& errorEventArgs);
00076     };
00077 }
00078
00079 namespace winrt::SDKTemplate::factory_implementation
00080 {
00081     struct OcrCapturedImage : OcrCapturedImageT<OcrCapturedImage, implementation::OcrCapturedImage>
00082     {
00083     };
00084 }
Generated on Fri Nov 15 2024 22:20:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario15_DPLFileCreateEvents.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario15_DPLFileCreateEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.Generic;
00005 using System.IO;
00006 using System.Linq;
00007 using System.Runtime.InteropServices.WindowsRuntime;
00008 using Windows.ApplicationModel.Background;
00009 using Windows.Foundation;
00010 using Windows.Foundation.Collections;
00011 using Windows.Networking.PushNotifications;
00012 using Windows.Storage;
00013 using Windows.UI.Core;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Controls.Primitives;
00018 using Windows.UI.Xaml.Data;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Media;
00021 using Windows.UI.Xaml.Navigation;
00022 using SDKTemplate;
00023 using Windows.Security.EnterpriseData;
00024 using System.Threading.Tasks;
00025
00026 namespace EdpSample
00027 {
00028     /// <summary>
00029     /// Registering a background task and notification channel for raw notifications
00030     /// </summary>
00031     public sealed partial class Scenario15_DPLCreateFileEvents : Page
00032     {
00033         private MainPage rootPage = null;
00034         private const string SAMPLE_TASK_NAME = "DPLTask";
00035         private const string SAMPLE_TASK_ENTRY_POINT = "Tasks.EdpBackgroundTask";
00036
00037         public Scenario15_DPLCreateFileEvents()
00038         {
00039             this.InitializeComponent();
00040         }
00041
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             rootPage = MainPage.Current;
00045         }
00046
00047         void OutputToTextBox(String text)
00048         {
00049         }
00050
00051         private void Register_Click(object sender, RoutedEventArgs e)
00052         {
00053             bool found = false;
00054
00055             foreach (var iter in BackgroundTaskRegistration.AllTasks)
00056             {
00057                 IBackgroundTaskRegistration task = iter.Value;
00058                 if (task.Name == SAMPLE_TASK_NAME)
00059                 {
00060                     found = true;
00061                     AttachProgressAndCompletedHandlers(task);
00062                 }
00063             }
00064
00065             if (!found)
00066             {
00067                 BackgroundTaskRegistration task = RegisterBackgroundTask();
00068                 if (task != null)
00069                 {
00070                     AttachProgressAndCompletedHandlers(task);
00071                 }
00072             }
00073
00074             // Remove previous completion status from local settings.
00075             // Pass Enterprise ID to background task
00076
00077             var settings = ApplicationData.Current.LocalSettings;
00078             settings.Values.Remove(SAMPLE_TASK_NAME);
00079             settings.Values.Add(SAMPLE_TASK_NAME, Scenario1.m_enterpriseId);
00080
00081             rootPage.NotifyUser("Task registered", NotifyType.StatusMessage);
00082         }
00083
00084         private void UnRegister_Click(object sender, RoutedEventArgs e)
00085         {
00086             if (UnregisterBackgroundTask())
00087             {
00088                 rootPage.NotifyUser("Task unregistered", NotifyType.StatusMessage);
00089             }
00090             else
00091             {
00092                 rootPage.NotifyUser("No task is registered", NotifyType.ErrorMessage);
00093             }
00094         }
00095
00096         private BackgroundTaskRegistration RegisterBackgroundTask()
00097         {
00098             return RegisterBackgroundTask(SAMPLE_TASK_ENTRY_POINT, SAMPLE_TASK_NAME,
00099                 new SystemTrigger(SystemTriggerType.UserAway, false), null);
00100         }
00101
00102
00103         public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntryPoint,
00104                                                                         String name,
00105                                                                         IBackgroundTrigger trigger,
00106                                                                         IBackgroundCondition condition)
00107         {
00108             var builder = new BackgroundTaskBuilder();
00109
00110             builder.Name = name;
00111             builder.TaskEntryPoint = taskEntryPoint;
00112             builder.SetTrigger(trigger);
00113
00114             if (condition != null)
00115             {
00116                 builder.AddCondition(condition);
00117
00118                 // If the condition changes while the background task is executing then it will
00119                 // be canceled.
00120                 builder.CancelOnConditionLoss = true;
00121             }
00122
00123             return builder.Register();
00124         }
00125
00126         private bool UnregisterBackgroundTask()
00127         {
00128             bool result = false;
00129
00130             foreach (var iter in BackgroundTaskRegistration.AllTasks)
00131             {
00132                 IBackgroundTaskRegistration task = iter.Value;
00133                 if (task.Name == SAMPLE_TASK_NAME)
00134                 {
00135                     task.Unregister(true);
00136                     result = true;
00137                 }
00138             }
00139             return result;
00140         }
00141
00142         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00143         {
00144             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00145             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00146         }
00147
00148         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00149         {
00150         }
00151
00152         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00153         {
00154             UpdateStatus();
00155         }
00156
00157         private async void UpdateStatus()
00158         {
00159             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00160             {
00161                var settings = ApplicationData.Current.LocalSettings;
00162                rootPage.NotifyUser("CreateProtectedAndOpenAsync status: " + settings.Values[SAMPLE_TASK_NAME], NotifyType.StatusMessage);
00163             });
00164         }
00165     }
00166 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspDefs.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspDefs.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009 #ifndef DECLSPEC_UUID
00010 #define DECLSPEC_UUID(x)    __declspec(uuid(x))
00011 #endif
00012
00013 #ifndef DECLSPEC_NOVTABLE
00014 #define DECLSPEC_NOVTABLE   __declspec(novtable)
00015 #endif
00016
00017 namespace Microsoft { namespace Samples { namespace SimpleCommunication {
00018
00019 interface DECLSPEC_UUID("09CFFBBF-67AC-4AD6-8463-9CF82CA3E52F") DECLSPEC_NOVTABLE IStspSinkInternal : public IUnknown
00020 {
00021     virtual void TriggerAcceptConnection(DWORD connectionId) = 0;
00022     virtual void TriggerRefuseConnection(DWORD connectionId) = 0;
00023 };
00024
00025 interface DECLSPEC_UUID("3AC82233-933C-43a9-AF3D-ADC94EABF406") DECLSPEC_NOVTABLE IMarker : public IUnknown
00026 {
00027     IFACEMETHOD (GetMarkerType) (MFSTREAMSINK_MARKER_TYPE *pType) = 0;
00028     IFACEMETHOD (GetMarkerValue) (PROPVARIANT *pvar) = 0;
00029     IFACEMETHOD (GetContext) (PROPVARIANT *pvar) = 0;
00030 };
00031
00032 enum StspOperation
00033 {
00034     StspOperation_Unknown,
00035     StspOperation_ClientRequestDescription,
00036     StspOperation_ClientRequestStart,
00037     StspOperation_ClientRequestStop,
00038     StspOperation_ServerDescription,
00039     StspOperation_ServerSample,
00040     StspOperation_ServerFormatChange,
00041     StspOperation_Last,
00042 };
00043
00044 struct StspOperationHeader
00045 {
00046     DWORD cbDataSize;
00047     StspOperation eOperation;
00048 };
00049
00050 struct StspStreamDescription
00051 {
00052     GUID guiMajorType;
00053     GUID guiSubType;
00054     DWORD dwStreamId;
00055     UINT32 cbAttributesSize;
00056 };
00057
00058 struct StspDescription
00059 {
00060     UINT32 cNumStreams;
00061     StspStreamDescription aStreams[1];
00062 };
00063
00064 enum StspSampleFlags
00065 {
00066     StspSampleFlag_BottomFieldFirst = 1,
00067     StspSampleFlag_CleanPoint = 2,
00068     StspSampleFlag_DerivedFromTopField = 4,
00069     StspSampleFlag_Discontinuity = 8,
00070     StspSampleFlag_Interlaced = 16,
00071     StspSampleFlag_RepeatFirstField = 32,
00072     StspSampleFlag_SingleField = 64,
00073 };
00074
00075 struct StspSampleHeader
00076 {
00077     DWORD dwStreamId;
00078     LONGLONG ullTimestamp;
00079     LONGLONG ullDuration;
00080     DWORD dwFlags;
00081     DWORD dwFlagMasks;
00082 };
00083
00084 enum StspNetworkType
00085 {
00086     StspNetworkType_IPv4,
00087     StspNetworkType_IPv6,
00088 };
00089
00090 // Possible states of the stsp source object
00091 enum SourceState
00092 {
00093     // Invalid state, source cannot be used
00094     SourceState_Invalid,
00095     // Opening the connection
00096     SourceState_Opening,
00097     // Streaming started
00098     SourceState_Starting,
00099     // Streaming started
00100     SourceState_Started,
00101     // Streanung stopped
00102     SourceState_Stopped,
00103     // Source is shut down
00104     SourceState_Shutdown,
00105 };
00106
00107 extern wchar_t const __declspec(selectany) c_szStspScheme[] = L"stsp";
00108 extern wchar_t const __declspec(selectany) c_szStspSchemeWithColon[] = L"stsp:";
00109 unsigned short const c_wStspDefaultPort = 10010;
00110
00111 void FilterOutputMediaType(IMFMediaType *pSourceMediaType, IMFMediaType *pDestinationMediaType);
00112 void ValidateInputMediaType(REFGUID guidMajorType, REFGUID guidSubtype, IMFMediaType *pMediaType);
00113 HRESULT CreateMarker(
00114     MFSTREAMSINK_MARKER_TYPE eMarkerType,
00115     const PROPVARIANT *pvarMarkerValue,     // Can be NULL.
00116     const PROPVARIANT *pvarContextValue,    // Can be NULL.
00117     IMarker **ppMarker
00118     );
00119 }}} // namespace Microsoft::Samples::SimpleCommunication
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RelayCommand Member List

This is the complete list of members for RelayCommand, including all inherited members.
_canExecute | RelayCommand | [private]
_execute | RelayCommand | [private]
CanExecute(object parameter) | RelayCommand | [inline]
CanExecuteChanged | RelayCommand |
Execute(object parameter) | RelayCommand | [inline]
RaiseCanExecuteChanged() | RelayCommand | [inline]
RelayCommand(Action execute) | RelayCommand | [inline]
RelayCommand(Action execute, Func< bool > canExecute) | RelayCommand | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Inclinometer/cpp/Scenario2_Polling.xaml.cpp Source File

  • Inclinometer
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033
00034     inclinometer = Inclinometer::GetDefault();
00035     if (inclinometer != nullptr)
00036     {
00037         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00038         // This value will be used later to activate the sensor.
00039         uint32 minReportInterval = inclinometer->MinimumReportInterval;
00040         desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00041
00042         // Set up a DispatchTimer
00043         TimeSpan span;
00044         span.Duration = static_cast<int32>(desiredReportInterval) * 10000;   // convert to 100ns ticks
00045         dispatcherTimer = ref new DispatcherTimer();
00046         dispatcherTimer->Interval = span;
00047         dispatcherTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2_Polling::DisplayCurrentReading);
00048     }
00049     else
00050     {
00051         rootPage->NotifyUser("No inclinometer found", NotifyType::ErrorMessage);
00052     }
00053 }
00054
00055 /// <summary>
00056 /// Invoked when this page is about to be displayed in a Frame.
00057 /// </summary>
00058 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00059 /// property is typically used to configure the page.</param>
00060 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00061 {
00062     ScenarioEnableButton->IsEnabled = true;
00063     ScenarioDisableButton->IsEnabled = false;
00064 }
00065
00066 /// <summary>
00067 /// Invoked when this page is no longer displayed.
00068 /// </summary>
00069 /// <param name="e"></param>
00070 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00071 {
00072     // If the navigation is external to the app do not clean up.
00073     // This can occur on Phone when suspending the app.
00074     if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
00075     {
00076         return;
00077     }
00078
00079     if (ScenarioDisableButton->IsEnabled)
00080     {
00081         Window::Current->VisibilityChanged::remove(visibilityToken);
00082         dispatcherTimer->Stop();
00083
00084         // Restore the default report interval to release resources while the sensor is not in use
00085         inclinometer->ReportInterval = 0;
00086     }
00087 }
00088
00089 /// <summary>
00090 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00091 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00092 /// </summary>
00093 /// <param name="sender"></param>
00094 /// <param name="e">
00095 /// Event data that can be examined for the current visibility state.
00096 /// </param>
00097 void Scenario2_Polling::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00098 {
00099     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00100     if (ScenarioDisableButton->IsEnabled)
00101     {
00102         if (e->Visible)
00103         {
00104             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00105             dispatcherTimer->Start();
00106         }
00107         else
00108         {
00109             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00110             dispatcherTimer->Stop();
00111         }
00112     }
00113 }
00114
00115 void Scenario2_Polling::DisplayCurrentReading(Object^ sender, Object^ e)
00116 {
00117     InclinometerReading^ reading = inclinometer->GetCurrentReading();
00118     if (reading != nullptr)
00119     {
00120         ScenarioOutput_X->Text = reading->PitchDegrees.ToString();
00121         ScenarioOutput_Y->Text = reading->RollDegrees.ToString();
00122         ScenarioOutput_Z->Text = reading->YawDegrees.ToString();
00123         switch (reading->YawAccuracy)
00124         {
00125             case MagnetometerAccuracy::Unknown:
00126                 ScenarioOutput_YawAccuracy->Text = "Unknown";
00127                 break;
00128             case MagnetometerAccuracy::Unreliable:
00129                 ScenarioOutput_YawAccuracy->Text = "Unreliable";
00130                 break;
00131             case MagnetometerAccuracy::Approximate:
00132                 ScenarioOutput_YawAccuracy->Text = "Approximate";
00133                 break;
00134             case MagnetometerAccuracy::High:
00135                 ScenarioOutput_YawAccuracy->Text = "High";
00136                 break;
00137             default:
00138                 ScenarioOutput_YawAccuracy->Text = "No data";
00139                 break;
00140         }
00141     }
00142 }
00143
00144 void Scenario2_Polling::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00145 {
00146     if (inclinometer != nullptr)
00147     {
00148         visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario2_Polling::VisibilityChanged));
00149
00150         // Set the report interval to enable the sensor for polling
00151         inclinometer->ReportInterval = desiredReportInterval;
00152
00153         dispatcherTimer->Start();
00154
00155         ScenarioEnableButton->IsEnabled = false;
00156         ScenarioDisableButton->IsEnabled = true;
00157     }
00158     else
00159     {
00160         rootPage->NotifyUser("No inclinometer found", NotifyType::ErrorMessage);
00161     }
00162 }
00163
00164 void Scenario2_Polling::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00165 {
00166     Window::Current->VisibilityChanged::remove(visibilityToken);
00167
00168     dispatcherTimer->Stop();
00169
00170     // Restore the default report interval to release resources while the sensor is not in use
00171     inclinometer->ReportInterval = 0;
00172
00173     ScenarioEnableButton->IsEnabled = true;
00174     ScenarioDisableButton->IsEnabled = false;
00175 }
Generated on Fri Nov 15 2024 22:17:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicTagAlong/cpp/Content/QuadRenderer.cpp Source File

  • HolographicTagAlong
  • cpp
  • Content

QuadRenderer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DDSTextureLoader.h"
00014 #include "QuadRenderer.h"
00015 #include "Common\DirectXHelper.h"
00016
00017 using namespace HolographicTagAlongSample;
00018 using namespace Concurrency;
00019 using namespace DirectX;
00020 using namespace Windows::Foundation::Numerics;
00021 using namespace Windows::UI::Input::Spatial;
00022
00023 // Loads vertex and pixel shaders from files and instantiates the quad geometry.
00024 QuadRenderer::QuadRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00025     m_deviceResources(deviceResources)
00026 {
00027     CreateDeviceDependentResources();
00028
00029     StartFadeIn();
00030 }
00031
00032 // This function uses a SpatialPointerPose to position the world-locked hologram
00033 // two meters in front of the user's heading.
00034 void QuadRenderer::UpdateHologramPosition(SpatialPointerPose^ pointerPose, const DX::StepTimer& timer)
00035 {
00036     const float& deltaTime = static_cast<float>(timer.GetElapsedSeconds());
00037
00038     if (pointerPose != nullptr)
00039     {
00040         // Get the gaze direction relative to the given coordinate system.
00041         const float3 headPosition = pointerPose->Head->Position;
00042         const float3 headDirection = pointerPose->Head->ForwardDirection;
00043
00044 //#define USE_HORIZONTAL_OFFSET
00045 #ifndef USE_HORIZONTAL_OFFSET
00046         // The tag-along hologram follows a point 2.0m in front of the user's gaze direction.
00047         constexpr float distanceFromUser = 2.0f; // meters
00048         const float3 gazeAtTwoMeters = headPosition + (distanceFromUser * headDirection);
00049
00050         // Use linear interpolation to smooth the position over time. This keeps the hologram
00051         // comfortably stable.
00052         const float3 smoothedPosition = lerp(m_position, gazeAtTwoMeters, deltaTime * c_lerpRate);
00053
00054 #else // USE_HORIZONTAL_OFFSET
00055         // If you're making a debug view, you might not want the tag-along to be directly in the
00056         // center of your field of view. Use this code to position the hologram to the right of
00057         // the user's gaze direction - moving it out of the way of your content.
00058         const float3 offset = float3(0.13f, 0.0f, 0.f);
00059         constexpr float offsetDistanceFromUser = 2.2f; // meters
00060         const float3 offsetFromGazeAtTwoMeters = headPosition + (float3(offsetDistanceFromUser) * (headDirection + offset));
00061
00062         // Use linear interpolation to smooth the position over time. This keeps the hologram
00063         // comfortably stable.
00064         const float3 smoothedPosition = lerp(m_position, offsetFromGazeAtTwoMeters, deltaTime * c_lerpRate);
00065 #endif // USE_HORIZONTAL_OFFSET
00066
00067         // This will be used as the translation component of the hologram's
00068         // model transform.
00069         m_lastPosition = m_position;
00070         m_position = smoothedPosition;
00071     }
00072 }
00073
00074 // Called once per frame. Rotates the quad, and calculates and sets the model matrix
00075 // relative to the position transform indicated by hologramPositionTransform.
00076 void QuadRenderer::Update(const DX::StepTimer& timer)
00077 {
00078     // Seconds elapsed since previous frame.
00079     const float deltaTime = static_cast<float>(timer.GetElapsedSeconds());
00080     const float oneOverDeltaTime = 1.f / deltaTime;
00081
00082     // Create a direction normal from the hologram's position to the origin of person space.
00083     // This is the z-axis of our rotated coordinate system in unrotated space.
00084     XMVECTOR facingNormal = XMVector3Normalize(-XMLoadFloat3(&m_position));
00085
00086     // Rotate the x-axis around the y-axis.
00087     // This rotation is achieved by projecting the normal into the xz-plane.
00088     // This is the x-axis of our rotated coordinate system in unrotated space.
00089     XMVECTOR xAxisRotation = XMVector3Normalize(XMVectorSet(XMVectorGetZ(facingNormal), 0.f, -XMVectorGetX(facingNormal), 0.f));
00090
00091     // Create a third normal to satisfy the conditions of a rotation matrix.
00092     // The cross product of the other two normals is at a 90-degree angle to
00093     // both normals. The cross product is normalized to avoid floating-point
00094     // math errors.
00095     // Note how the cross product will never be null because the two axis
00096     // normals we generated above will always be at a 90-degree angle from
00097     // one another.
00098     XMVECTOR yAxisRotation = XMVector3Normalize(XMVector3Cross(facingNormal, xAxisRotation));
00099
00100     // Construct the 4x4 rotation matrix.
00101
00102     // Rotate the quad to face the user.
00103     XMMATRIX rotationMatrix = XMMATRIX(
00104         xAxisRotation,
00105         yAxisRotation,
00106         facingNormal,
00107         XMVectorSet(0.f, 0.f, 0.f, 1.f)
00108         );
00109
00110     // Position the quad.
00111     const XMMATRIX modelTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&m_position));
00112
00113     // The view and projection matrices are provided by the system; they are associated
00114     // with holographic cameras, and updated on a per-camera basis.
00115     // Here, we provide the model transform for the sample hologram. The model transform
00116     // matrix is transposed to prepare it for the shader.
00117     XMStoreFloat4x4(&m_modelConstantBufferData.model, XMMatrixTranspose(rotationMatrix * modelTranslation));
00118
00119     if (m_fadeTime > 0.f)
00120     {
00121         // Fade the quad in, or out.
00122         if (m_fadingIn)
00123         {
00124             const float fadeLerp = 1.f - (m_fadeTime / c_maxFadeTime);
00125             m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(fadeLerp, fadeLerp, fadeLerp, 1.f);
00126         }
00127         else
00128         {
00129             const float fadeLerp = (m_fadeTime / c_maxFadeTime);
00130             m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(fadeLerp, fadeLerp, fadeLerp, 1.f);
00131         }
00132         m_fadeTime -= deltaTime;
00133     }
00134     else
00135     {
00136         // Set a value directly.
00137         if (m_fadingIn)
00138         {
00139             m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(1.f, 1.f, 1.f, 1.f);
00140         }
00141         else
00142         {
00143             m_modelConstantBufferData.hologramColorFadeMultiplier = XMFLOAT4(0.f, 0.f, 0.f, 0.f);
00144         }
00145     }
00146
00147     // Determine velocity.
00148     // Even though the motion is spherical, the velocity is still linear
00149     // for image stabilization.
00150     const float3 deltaPosition = m_position - m_lastPosition; // meters
00151     m_velocity = deltaPosition * oneOverDeltaTime; // meters per second
00152
00153     // Loading is asynchronous. Resources must be created before they can be updated.
00154     if (!m_loadingComplete)
00155     {
00156         return;
00157     }
00158
00159     // Use the D3D device context to update Direct3D device-based resources.
00160     const auto context = m_deviceResources->GetD3DDeviceContext();
00161
00162     // Update the model transform buffer for the hologram.
00163     context->UpdateSubresource(
00164         m_modelConstantBuffer.Get(),
00165         0,
00166         nullptr,
00167         &m_modelConstantBufferData,
00168         0,
00169         0
00170         );
00171 }
00172
00173 void QuadRenderer::Render()
00174 {
00175     Render(m_quadTextureView.Get());
00176 }
00177
00178 // Renders one frame using the vertex and pixel shaders.
00179 // For Direct3D devices that do not support the optional feature level
00180 // 11.3 VPRT feature, this function also uses a geometry shader.
00181 void QuadRenderer::Render(ID3D11ShaderResourceView* texture)
00182 {
00183     // Loading is asynchronous. Resources must be created before drawing can occur.
00184     if (!m_loadingComplete)
00185     {
00186         return;
00187     }
00188
00189     const auto context = m_deviceResources->GetD3DDeviceContext();
00190
00191     // Each vertex is one instance of the VertexPositionColor struct.
00192     const UINT stride = sizeof(VertexPositionColorTex);
00193     const UINT offset = 0;
00194     context->IASetVertexBuffers(
00195         0,
00196         1,
00197         m_vertexBuffer.GetAddressOf(),
00198         &stride,
00199         &offset
00200         );
00201     context->IASetIndexBuffer(
00202         m_indexBuffer.Get(),
00203         DXGI_FORMAT_R16_UINT, // Each index is one 16-bit unsigned integer (short).
00204         0
00205         );
00206     context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
00207     context->IASetInputLayout(m_inputLayout.Get());
00208
00209     // Attach the vertex shader.
00210     context->VSSetShader(
00211         m_vertexShader.Get(),
00212         nullptr,
00213         0
00214         );
00215     // Apply the model constant buffer to the vertex shader.
00216     context->VSSetConstantBuffers(
00217         0,
00218         1,
00219         m_modelConstantBuffer.GetAddressOf()
00220         );
00221
00222     if (!m_usingVprtShaders)
00223     {
00224         // On devices that do not support the D3D11_FEATURE_D3D11_OPTIONS3::
00225         // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer optional feature,
00226         // a pass-through geometry shader sets the render target ID.
00227         context->GSSetShader(
00228             m_geometryShader.Get(),
00229             nullptr,
00230             0
00231             );
00232     }
00233
00234     // Attach the pixel shader.
00235     context->PSSetShader(
00236         m_pixelShader.Get(),
00237         nullptr,
00238         0
00239         );
00240     context->PSSetShaderResources(
00241         0,
00242         1,
00243         (texture != nullptr) ? &texture : m_quadTextureView.GetAddressOf()
00244         );
00245     context->PSSetSamplers(
00246         0,
00247         1,
00248         m_quadTextureSamplerState.GetAddressOf()
00249         );
00250
00251     // Draw the objects.
00252     context->DrawIndexedInstanced(
00253         m_indexCount,   // Index count per instance.
00254         2,              // Instance count.
00255         0,              // Start index location.
00256         0,              // Base vertex location.
00257         0               // Start instance location.
00258         );
00259 }
00260
00261 void QuadRenderer::StartFadeIn()
00262 {
00263     if (!m_fadingIn)
00264     {
00265         m_fadeTime = c_maxFadeTime;
00266         m_fadingIn = true;
00267     }
00268 }
00269
00270 void QuadRenderer::StartFadeOut()
00271 {
00272     if (m_fadingIn)
00273     {
00274         m_fadeTime = c_maxFadeTime;
00275         m_fadingIn = false;
00276     }
00277 }
00278
00279 void QuadRenderer::CreateDeviceDependentResources()
00280 {
00281     m_usingVprtShaders = m_deviceResources->GetDeviceSupportsVprt();
00282
00283     // If the optional VPRT feature is supported by the graphics device, we
00284     // can avoid using geometry shaders to set the render target array index.
00285     std::wstring vertexShaderFileName = m_usingVprtShaders ? L"ms-appx:///VprtVertexShader.cso" : L"ms-appx:///VertexShader.cso";
00286
00287     // Load shaders asynchronously.
00288     task<std::vector<byte>> loadVSTask = DX::ReadDataAsync(vertexShaderFileName);
00289     task<std::vector<byte>> loadPSTask = DX::ReadDataAsync(L"ms-appx:///UseDistanceFieldPixelShader.cso");
00290
00291     task<std::vector<byte>> loadGSTask;
00292     if (!m_usingVprtShaders)
00293     {
00294         // Load the pass-through geometry shader.
00295         loadGSTask = DX::ReadDataAsync(L"ms-appx:///GeometryShader.cso");
00296     }
00297
00298     // After the vertex shader file is loaded, create the shader and input layout.
00299     task<void> createVSTask = loadVSTask.then([this] (const std::vector<byte>& fileData)
00300     {
00301         DX::ThrowIfFailed(
00302             m_deviceResources->GetD3DDevice()->CreateVertexShader(
00303                 fileData.data(),
00304                 fileData.size(),
00305                 nullptr,
00306                 &m_vertexShader
00307                 )
00308             );
00309
00310         constexpr std::array<D3D11_INPUT_ELEMENT_DESC, 3> vertexDesc =
00311         {{
00312             { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00313             { "COLOR",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00314             { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT,    0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
00315         }};
00316
00317         DX::ThrowIfFailed(
00318             m_deviceResources->GetD3DDevice()->CreateInputLayout(
00319                 vertexDesc.data(),
00320                 vertexDesc.size(),
00321                 fileData.data(),
00322                 fileData.size(),
00323                 &m_inputLayout
00324                 )
00325             );
00326     });
00327
00328     // After the pixel shader file is loaded, create the shader and constant buffer.
00329     task<void> createPSTask = loadPSTask.then([this] (const std::vector<byte>& fileData)
00330     {
00331         DX::ThrowIfFailed(
00332             m_deviceResources->GetD3DDevice()->CreatePixelShader(
00333                 fileData.data(),
00334                 fileData.size(),
00335                 nullptr,
00336                 &m_pixelShader
00337                 )
00338             );
00339
00340         const CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00341         DX::ThrowIfFailed(
00342             m_deviceResources->GetD3DDevice()->CreateBuffer(
00343                 &constantBufferDesc,
00344                 nullptr,
00345                 &m_modelConstantBuffer
00346                 )
00347             );
00348     });
00349
00350     task<void> createGSTask;
00351     if (!m_usingVprtShaders)
00352     {
00353         // After the geometry shader file is loaded, create the shader.
00354         createGSTask = loadGSTask.then([this] (const std::vector<byte>& fileData)
00355         {
00356             DX::ThrowIfFailed(
00357                 m_deviceResources->GetD3DDevice()->CreateGeometryShader(
00358                     fileData.data(),
00359                     fileData.size(),
00360                     nullptr,
00361                     &m_geometryShader
00362                     )
00363                 );
00364         });
00365     }
00366
00367     // Once all shaders are loaded, create the mesh.
00368     task<void> shaderTaskGroup = m_usingVprtShaders ? (createPSTask && createVSTask) : (createPSTask && createVSTask && createGSTask);
00369     task<void> finishLoadingTask = shaderTaskGroup.then([this] ()
00370     {
00371         // Load mesh vertices. Each vertex has a position and a color.
00372         // Note that the quad size has changed from the default DirectX app
00373         // template. Windows Holographic is scaled in meters, so to draw the
00374         // quad at a comfortable size we made the quad width 0.2 m (20 cm).
00375         static const std::array<VertexPositionColorTex, 4> quadVertices =
00376         {{
00377             { XMFLOAT3(-0.2f,  0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(0.f, 0.f) },
00378             { XMFLOAT3( 0.2f,  0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(1.f, 0.f) },
00379             { XMFLOAT3( 0.2f, -0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(1.f, 1.f) },
00380             { XMFLOAT3(-0.2f, -0.2f, 0.f), XMFLOAT3(1.0f, 1.0f, 1.0f), XMFLOAT2(0.f, 1.f) },
00381         }};
00382
00383         D3D11_SUBRESOURCE_DATA vertexBufferData = {0};
00384         vertexBufferData.pSysMem                = quadVertices.data();
00385         vertexBufferData.SysMemPitch            = 0;
00386         vertexBufferData.SysMemSlicePitch       = 0;
00387         const CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(VertexPositionColorTex) * quadVertices.size(), D3D11_BIND_VERTEX_BUFFER);
00388         DX::ThrowIfFailed(
00389             m_deviceResources->GetD3DDevice()->CreateBuffer(
00390                 &vertexBufferDesc,
00391                 &vertexBufferData,
00392                 &m_vertexBuffer
00393                 )
00394             );
00395
00396         // Load mesh indices. Each trio of indices represents
00397         // a triangle to be rendered on the screen.
00398         // For example: 2,1,0 means that the vertices with indexes
00399         // 2, 1, and 0 from the vertex buffer compose the
00400         // first triangle of this mesh.
00401         // Note that the winding order is clockwise by default.
00402         constexpr std::array<unsigned short, 12> quadIndices =
00403         {{
00404             // -z
00405             0,2,3,
00406             0,1,2,
00407
00408             // +z
00409             2,0,3,
00410             1,0,2,
00411         }};
00412
00413         m_indexCount = quadIndices.size();
00414
00415         D3D11_SUBRESOURCE_DATA indexBufferData = {0};
00416         indexBufferData.pSysMem          = quadIndices.data();
00417         indexBufferData.SysMemPitch      = 0;
00418         indexBufferData.SysMemSlicePitch = 0;
00419         const CD3D11_BUFFER_DESC indexBufferDesc(sizeof(unsigned short) * quadIndices.size(), D3D11_BIND_INDEX_BUFFER);
00420         DX::ThrowIfFailed(
00421             m_deviceResources->GetD3DDevice()->CreateBuffer(
00422                 &indexBufferDesc,
00423                 &indexBufferData,
00424                 &m_indexBuffer
00425                 )
00426             );
00427
00428         DX::ThrowIfFailed(CreateDDSTextureFromFile(
00429                 m_deviceResources->GetD3DDevice(),
00430                 L"placeholder.dds",
00431                 m_quadTexture.GetAddressOf(),
00432                 m_quadTextureView.GetAddressOf()
00433                 )
00434             );
00435
00436         D3D11_SAMPLER_DESC desc;
00437         ZeroMemory(&desc, sizeof(D3D11_SAMPLER_DESC));
00438
00439         desc.Filter         = D3D11_FILTER_ANISOTROPIC;
00440         desc.AddressU       = D3D11_TEXTURE_ADDRESS_CLAMP;
00441         desc.AddressV       = D3D11_TEXTURE_ADDRESS_CLAMP;
00442         desc.AddressW       = D3D11_TEXTURE_ADDRESS_CLAMP;
00443         desc.MaxAnisotropy  = 3;
00444         desc.MinLOD         = 0;
00445         desc.MaxLOD         = 3;
00446         desc.MipLODBias     = 0.f;
00447         desc.BorderColor[0] = 0.f;
00448         desc.BorderColor[1] = 0.f;
00449         desc.BorderColor[2] = 0.f;
00450         desc.BorderColor[3] = 0.f;
00451         desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
00452
00453         DX::ThrowIfFailed(
00454             m_deviceResources->GetD3DDevice()->CreateSamplerState(
00455                 &desc,
00456                 &m_quadTextureSamplerState
00457                 )
00458             );
00459
00460         // After the assets are loaded, the quad is ready to be rendered.
00461         m_loadingComplete = true;
00462     });
00463 }
00464
00465 void QuadRenderer::ReleaseDeviceDependentResources()
00466 {
00467     m_loadingComplete  = false;
00468     m_usingVprtShaders = false;
00469
00470     m_vertexShader.Reset();
00471     m_inputLayout.Reset();
00472     m_pixelShader.Reset();
00473     m_geometryShader.Reset();
00474
00475     m_modelConstantBuffer.Reset();
00476
00477     m_vertexBuffer.Reset();
00478     m_indexBuffer.Reset();
00479
00480     m_quadTexture.Reset();
00481     m_quadTextureView.Reset();
00482     m_quadTextureSamplerState.Reset();
00483 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/EventTests.xaml.cs Source File

  • XamlBind
  • cs

EventTests.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Popups;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004 using xBindSampleModel;
00005
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00008
00009 namespace xBindSampleCS
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class EventTests : Page
00015     {
00016         public DataModel Model { get; set; }
00017         public RoutedEventHandler clickDelegate;
00018
00019         public EventTests()
00020         {
00021             this.InitializeComponent();
00022             this.Model = new DataModel();
00023             clickDelegate = this.Click_RegularArgs;
00024         }
00025
00026         private void Click_RegularArgs(object sender, RoutedEventArgs e)
00027         {
00028             MessageDialog dlg = new MessageDialog("Clicked - Regular Args");
00029             var t = dlg.ShowAsync();
00030         }
00031
00032         private void Click_NoArgs()
00033         {
00034             MessageDialog dlg = new MessageDialog("Clicked - No args");
00035             var t = dlg.ShowAsync();
00036         }
00037
00038         private void Click_BaseArgs(object sender, object e)
00039         {
00040             MessageDialog dlg = new MessageDialog("Clicked - Base args");
00041             var t = dlg.ShowAsync();
00042         }
00043     }
00044 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/Scenario2_FindAvailableSourceGroups.xaml.cs Source File

  • CameraFrames
  • cs

Scenario2_FindAvailableSourceGroups.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Threading.Tasks;
00016 using Windows.Media.Capture;
00017 using Windows.Media.Capture.Frames;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2_FindAvailableSourceGroups : Page
00025     {
00026         private MediaCapture _mediaCapture;
00027         private MediaFrameSource _source;
00028         private MediaFrameReader _reader;
00029         private FrameRenderer _frameRenderer;
00030         private bool _streaming = false;
00031
00032         private SourceGroupCollection _groupCollection;
00033         private readonly SimpleLogger _logger;
00034
00035         public Scenario2_FindAvailableSourceGroups()
00036         {
00037             InitializeComponent();
00038             _logger = new SimpleLogger(outputTextBlock);
00039             _frameRenderer = new FrameRenderer(PreviewImage);
00040         }
00041
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             /// SourceGroupCollection will setup device watcher to monitor
00045             /// SourceGroup devices enabled or disabled from the system.
00046             _groupCollection = new SourceGroupCollection(this.Dispatcher);
00047             GroupComboBox.ItemsSource = _groupCollection.FrameSourceGroups;
00048         }
00049
00050         protected override async void OnNavigatedFrom(NavigationEventArgs e)
00051         {
00052             _groupCollection?.Dispose();
00053             await StopReaderAsync();
00054             DisposeMediaCapture();
00055         }
00056
00057         private async Task UpdateButtonStateAsync()
00058         {
00059             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00060             {
00061                 StartButton.IsEnabled = _source != null && !_streaming;
00062                 StopButton.IsEnabled = _source != null && _streaming;
00063             });
00064         }
00065
00066         /// <summary>
00067         /// Disposes of the MediaCapture object and clears the items from the Format and Source ComboBoxes.
00068         /// </summary>
00069         private void DisposeMediaCapture()
00070         {
00071             FormatComboBox.ItemsSource = null;
00072             SourceComboBox.ItemsSource = null;
00073
00074             _source = null;
00075
00076             _mediaCapture?.Dispose();
00077             _mediaCapture = null;
00078         }
00079
00080         /// <summary>
00081         /// Stops reading from the previous selection and starts reading frames from the newly selected source group.
00082         /// </summary>
00083         private async void GroupComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00084         {
00085             await StopReaderAsync();
00086             DisposeMediaCapture();
00087
00088             var group = GroupComboBox.SelectedItem as FrameSourceGroupModel;
00089             if (group != null)
00090             {
00091                 await InitializeCaptureAsync();
00092
00093                 SourceComboBox.ItemsSource = group.SourceInfos;
00094                 SourceComboBox.SelectedIndex = 0;
00095             }
00096         }
00097
00098         /// <summary>
00099         /// Starts reading from the newly selected source.
00100         /// </summary>
00101         private async void SourceComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00102         {
00103             await StopReaderAsync();
00104
00105             if (SourceComboBox.SelectedItem != null)
00106             {
00107                 await StartReaderAsync();
00108
00109                 // Get the formats supported by the selected source into the FormatComboBox.
00110                 IEnumerable<FrameFormatModel> formats = null;
00111                 if (_mediaCapture != null && _source != null)
00112                 {
00113                     // Limit ourselves to formats that we can render.
00114                     formats = _source.SupportedFormats
00115                         .Where(format => FrameRenderer.GetSubtypeForFrameReader(_source.Info.SourceKind, format) != null)
00116                         .Select(format => new FrameFormatModel(format));
00117                 }
00118
00119                 FormatComboBox.ItemsSource = formats;
00120             }
00121         }
00122
00123         /// <summary>
00124         /// Sets the video format for the current frame source.
00125         /// </summary>
00126         private async void FormatComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
00127         {
00128             var format = FormatComboBox.SelectedItem as FrameFormatModel;
00129             await ChangeMediaFormatAsync(format);
00130         }
00131
00132         /// <summary>
00133         /// Starts reading frames from the current reader.
00134         /// </summary>
00135         private async Task StartReaderAsync()
00136         {
00137             await CreateReaderAsync();
00138
00139             if (_reader != null && !_streaming)
00140             {
00141                 MediaFrameReaderStartStatus result = await _reader.StartAsync();
00142                 _logger.Log($"Start reader with result: {result}");
00143
00144                 if (result == MediaFrameReaderStartStatus.Success)
00145                 {
00146                     _streaming = true;
00147                     await UpdateButtonStateAsync();
00148                 }
00149             }
00150         }
00151
00152         /// <summary>
00153         /// Creates a frame reader from the current frame source and registers to handle its frame events.
00154         /// </summary>
00155         private async Task CreateReaderAsync()
00156         {
00157             await InitializeCaptureAsync();
00158
00159             UpdateFrameSource();
00160
00161             if (_source != null)
00162             {
00163                 // Ask the MediaFrameReader to use a subtype that we can render.
00164                 string requestedSubtype = FrameRenderer.GetSubtypeForFrameReader(_source.Info.SourceKind, _source.CurrentFormat);
00165                 if (requestedSubtype != null)
00166                 {
00167                     _reader = await _mediaCapture.CreateFrameReaderAsync(_source, requestedSubtype);
00168
00169                     _reader.FrameArrived += Reader_FrameArrived;
00170
00171                     _logger.Log($"Reader created on source: {_source.Info.Id}");
00172                 }
00173                 else
00174                 {
00175                     _logger.Log($"Cannot render current format on source: {_source.Info.Id}");
00176                 }
00177             }
00178         }
00179
00180         /// <summary>
00181         /// Updates the current frame source to the one corresponding to the user's selection.
00182         /// </summary>
00183         private void UpdateFrameSource()
00184         {
00185             var info = SourceComboBox.SelectedItem as FrameSourceInfoModel;
00186             if (_mediaCapture != null && info != null && info.SourceGroup != null)
00187             {
00188                 var groupModel = GroupComboBox.SelectedItem as FrameSourceGroupModel;
00189                 if (groupModel == null || groupModel.Id != info.SourceGroup.Id)
00190                 {
00191                     SourceComboBox.SelectedItem = null;
00192                     return;
00193                 }
00194
00195                 if (_source == null || _source.Info.Id != info.SourceInfo.Id)
00196                 {
00197                     _mediaCapture.FrameSources.TryGetValue(info.SourceInfo.Id, out _source);
00198                 }
00199             }
00200             else
00201             {
00202                 _source = null;
00203             }
00204         }
00205
00206         /// <summary>
00207         /// Initializes the MediaCapture object with the current source group.
00208         /// </summary>
00209         private async Task InitializeCaptureAsync()
00210         {
00211             var groupModel = GroupComboBox.SelectedItem as FrameSourceGroupModel;
00212             if (_mediaCapture == null && groupModel != null)
00213             {
00214                 // Create a new media capture object.
00215                 _mediaCapture = new MediaCapture();
00216
00217                 var settings = new MediaCaptureInitializationSettings()
00218                 {
00219                     // Select the source we will be reading from.
00220                     SourceGroup = groupModel.SourceGroup,
00221
00222                     // This media capture has exclusive control of the source.
00223                     SharingMode = MediaCaptureSharingMode.ExclusiveControl,
00224
00225                     // Set to CPU to ensure frames always contain CPU SoftwareBitmap images,
00226                     // instead of preferring GPU D3DSurface images.
00227                     MemoryPreference = MediaCaptureMemoryPreference.Cpu,
00228
00229                     // Capture only video. Audio device will not be initialized.
00230                     StreamingCaptureMode = StreamingCaptureMode.Video,
00231                 };
00232
00233                 try
00234                 {
00235                     // Initialize MediaCapture with the specified group.
00236                     // This can raise an exception if the source no longer exists,
00237                     // or if the source could not be initialized.
00238                     await _mediaCapture.InitializeAsync(settings);
00239                     _logger.Log($"Successfully initialized MediaCapture for {groupModel.DisplayName}");
00240                 }
00241                 catch (Exception exception)
00242                 {
00243                     _logger.Log(exception.Message);
00244                     DisposeMediaCapture();
00245                 }
00246             }
00247         }
00248
00249         /// <summary>
00250         /// Sets the frame format of the current frame source.
00251         /// </summary>
00252         private async Task ChangeMediaFormatAsync(FrameFormatModel format)
00253         {
00254             if (_source == null)
00255             {
00256                 _logger.Log("Unable to set format when source is not set.");
00257                 return;
00258             }
00259
00260             // Set the source format if the selected one is different from the current one.
00261             if (format != null && !format.HasSameFormat(_source.CurrentFormat))
00262             {
00263                 await _source.SetFormatAsync(format.Format);
00264                 _logger.Log($"Format set to {format.DisplayName}");
00265             }
00266         }
00267
00268         /// <summary>
00269         /// Stops reading from the frame reader, disposes of the reader and updates the button state.
00270         /// </summary>
00271         private async Task StopReaderAsync()
00272         {
00273             _streaming = false;
00274
00275             if (_reader != null)
00276             {
00277                 await _reader.StopAsync();
00278                 _reader.FrameArrived -= Reader_FrameArrived;
00279                 _reader.Dispose();
00280                 _reader = null;
00281
00282                 _logger.Log("Reader stopped.");
00283             }
00284
00285             await UpdateButtonStateAsync();
00286         }
00287
00288         /// <summary>
00289         /// Bound to the click of the Start button.
00290         /// </summary>
00291         private async void StartButton_Click(object sender, RoutedEventArgs e)
00292         {
00293             await StartReaderAsync();
00294         }
00295
00296         /// <summary>
00297         /// Bound to the click of the Stop button.
00298         /// </summary>
00299         private async void StopButton_Click(object sender, RoutedEventArgs e)
00300         {
00301             await StopReaderAsync();
00302         }
00303
00304         /// <summary>
00305         /// Handles the frame arrived event by converting the frame to a displayable
00306         /// format and rendering it to the screen.
00307         /// </summary>
00308         private void Reader_FrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args)
00309         {
00310             // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
00311             // This can return null if there is no such frame, or if the reader is not in the
00312             // "Started" state. The latter can occur if a FrameArrived event was in flight
00313             // when the reader was stopped.
00314             using (var frame = sender.TryAcquireLatestFrame())
00315             {
00316                 _frameRenderer.ProcessFrame(frame);
00317             }
00318         }
00319     }
00320 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

App Member List

This is the complete list of members for App, including all inherited members.
Activated | App |
ActivatedEventArgs | App | [static]
App() | App | [inline]
Application_UnhandledException(object sender, UnhandledExceptionEventArgs e) | App | [inline, private]
Initialize(IActivatedEventArgs e) | App | [inline, private]
LaunchedEventArgs | App | [static]
OnActivated(IActivatedEventArgs args) | App | [inline, protected]
OnLaunched(LaunchActivatedEventArgs e) | App | [inline, protected]
OnNavigationFailed(object sender, NavigationFailedEventArgs e) | App | [inline, private]
OnSuspending(object sender, SuspendingEventArgs e) | App | [inline, private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/VoiceCommandService/pch.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • VoiceCommandService

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/DeviceWatcherHelper.cs Source File

  • DeviceEnumerationAndPairing
  • cs

DeviceWatcherHelper.cs

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.ObjectModel;
00005 using Windows.Devices.Enumeration;
00006 using Windows.Foundation;
00007 using Windows.UI.Core;
00008
00009 namespace SDKTemplate
00010 {
00011     /// <summary>
00012     /// Updates an ObservableCollection based on events from a DeviceWatcher.
00013     /// </summary>
00014     /// <remarks>
00015     /// Encapsulates the work necessary to register for watcher events,
00016     /// start and stop the watcher, handle race conditions, and break cycles.
00017     /// </remarks>
00018     class DeviceWatcherHelper
00019     {
00020         public DeviceWatcherHelper(
00021             ObservableCollection<DeviceInformationDisplay> resultCollection,
00022             CoreDispatcher dispatcher)
00023         {
00024             this.resultCollection = resultCollection;
00025             this.dispatcher = dispatcher;
00026         }
00027
00028         public delegate void DeviceChangedHandler(DeviceWatcher deviceWatcher, string id);
00029         public event DeviceChangedHandler DeviceChanged;
00030
00031         public DeviceWatcher DeviceWatcher => deviceWatcher;
00032         public bool UpdateStatus = true;
00033
00034         public void StartWatcher(DeviceWatcher deviceWatcher)
00035         {
00036             this.deviceWatcher = deviceWatcher;
00037
00038             // Connect events to update our collection as the watcher report results.
00039             deviceWatcher.Added += Watcher_DeviceAdded;
00040             deviceWatcher.Updated += Watcher_DeviceUpdated;
00041             deviceWatcher.Removed += Watcher_DeviceRemoved;
00042             deviceWatcher.EnumerationCompleted += Watcher_EnumerationCompleted;
00043             deviceWatcher.Stopped += Watcher_Stopped;
00044
00045             deviceWatcher.Start();
00046         }
00047
00048         public void StopWatcher()
00049         {
00050             // Since the device watcher runs in the background, it is possible that
00051             // a notification is "in flight" at the time we stop the watcher.
00052             // In other words, it is possible for the watcher to become stopped while a
00053             // handler is running, or for a handler to run after the watcher has stopped.
00054
00055             if (IsWatcherStarted(deviceWatcher))
00056             {
00057                 // We do not null out the deviceWatcher yet because we want to receive
00058                 // the Stopped event.
00059                 deviceWatcher.Stop();
00060             }
00061         }
00062
00063         public void Reset()
00064         {
00065             if (deviceWatcher != null)
00066             {
00067                 StopWatcher();
00068                 deviceWatcher = null;
00069             }
00070         }
00071
00072         DeviceWatcher deviceWatcher = null;
00073         ObservableCollection<DeviceInformationDisplay> resultCollection;
00074         CoreDispatcher dispatcher;
00075
00076         static bool IsWatcherStarted(DeviceWatcher watcher)
00077         {
00078             return (watcher.Status == DeviceWatcherStatus.Started) ||
00079                 (watcher.Status == DeviceWatcherStatus.EnumerationCompleted);
00080         }
00081
00082         public bool IsWatcherRunning()
00083         {
00084             if (deviceWatcher == null)
00085             {
00086                 return false;
00087             }
00088
00089             DeviceWatcherStatus status = deviceWatcher.Status;
00090             return (status == DeviceWatcherStatus.Started) ||
00091                 (status == DeviceWatcherStatus.EnumerationCompleted) ||
00092                 (status == DeviceWatcherStatus.Stopping);
00093         }
00094
00095         private async void Watcher_DeviceAdded(DeviceWatcher sender, DeviceInformation deviceInfo)
00096         {
00097             // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00098             await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00099             {
00100                 // Watcher may have stopped while we were waiting for our chance to run.
00101                 if (IsWatcherStarted(sender))
00102                 {
00103                     resultCollection.Add(new DeviceInformationDisplay(deviceInfo));
00104                     RaiseDeviceChanged(sender, deviceInfo.Id);
00105                 }
00106             });
00107         }
00108
00109         private async void Watcher_DeviceUpdated(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00110         {
00111             // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00112             await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00113             {
00114                 // Watcher may have stopped while we were waiting for our chance to run.
00115                 if (IsWatcherStarted(sender))
00116                 {
00117                     // Find the corresponding updated DeviceInformation in the collection and pass the update object
00118                     // to the Update method of the existing DeviceInformation. This automatically updates the object
00119                     // for us.
00120                     foreach (DeviceInformationDisplay deviceInfoDisp in resultCollection)
00121                     {
00122                         if (deviceInfoDisp.Id == deviceInfoUpdate.Id)
00123                         {
00124                             deviceInfoDisp.Update(deviceInfoUpdate);
00125                             RaiseDeviceChanged(sender, deviceInfoUpdate.Id);
00126                             break;
00127                         }
00128                     }
00129                 }
00130             });
00131         }
00132
00133         private async void Watcher_DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
00134         {
00135             // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00136             await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00137             {
00138                 // Watcher may have stopped while we were waiting for our chance to run.
00139                 if (IsWatcherStarted(sender))
00140                 {
00141                     // Find the corresponding DeviceInformation in the collection and remove it
00142                     foreach (DeviceInformationDisplay deviceInfoDisp in resultCollection)
00143                     {
00144                         if (deviceInfoDisp.Id == deviceInfoUpdate.Id)
00145                         {
00146                             resultCollection.Remove(deviceInfoDisp);
00147                             break;
00148                         }
00149                     }
00150
00151                     RaiseDeviceChanged(sender, deviceInfoUpdate.Id);
00152                 }
00153             });
00154         }
00155
00156         private async void Watcher_EnumerationCompleted(DeviceWatcher sender, object obj)
00157         {
00158             await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00159             {
00160                 RaiseDeviceChanged(sender, string.Empty);
00161             });
00162         }
00163
00164         private async void Watcher_Stopped(DeviceWatcher sender, object obj)
00165         {
00166             await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00167             {
00168                 RaiseDeviceChanged(sender, string.Empty);
00169             });
00170         }
00171
00172         private void RaiseDeviceChanged(DeviceWatcher sender, string id)
00173         {
00174             if (UpdateStatus)
00175             {
00176                 // Display a default status message.
00177                 string message = string.Empty;
00178                 switch (sender.Status)
00179                 {
00180                     case DeviceWatcherStatus.Started:
00181                         message = $"{resultCollection.Count} devices found.";
00182                         break;
00183
00184                     case DeviceWatcherStatus.EnumerationCompleted:
00185                         message = $"{resultCollection.Count} devices found. Enumeration completed. Watching for updates...";
00186                         break;
00187
00188                     case DeviceWatcherStatus.Stopped:
00189                         message = $"{resultCollection.Count} devices found. Watcher stopped.";
00190                         break;
00191
00192                     case DeviceWatcherStatus.Aborted:
00193                         message = $"{resultCollection.Count} devices found. Watcher aborted.";
00194                         break;
00195                 }
00196
00197                 if (!string.IsNullOrEmpty(message))
00198                 {
00199                     MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
00200                 }
00201             }
00202
00203             DeviceChanged?.Invoke(sender, id);
00204         }
00205     }
00206 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/SampleConfiguration.h Source File

  • CustomHidDeviceAccess
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include "pch.h"
00009
00010 namespace SDKTemplate
00011 {
00012     public value struct Scenario
00013     {
00014         Platform::String^ Title;
00015         Platform::String^ ClassName;
00016     };
00017
00018     partial ref class MainPage
00019     {
00020     internal:
00021         static property Platform::String^ FEATURE_NAME
00022         {
00023             Platform::String^ get()
00024             {
00025                 return "Custom Hid Device Access";
00026             }
00027         }
00028
00029         static property Platform::Array<Scenario>^ scenarios
00030         {
00031             Platform::Array<Scenario>^ get()
00032             {
00033                 return scenariosInner;
00034             }
00035         }
00036     private:
00037         static Platform::Array<Scenario>^ scenariosInner;
00038     };
00039 }
00040
00041 namespace SDKTemplate
00042 {
00043     // All possible hex digits where the index is the decimal value of the char
00044     static const Platform::String^ HexDigits = "0123456789ABCDEF";
00045
00046     public enum class DeviceType
00047     {
00048         SuperMutt,
00049         All,    // Can be any device
00050         None
00051     };
00052
00053     public ref class OnDeviceConnectedEventArgs sealed
00054     {
00055     public:
00056         OnDeviceConnectedEventArgs(bool isDeviceSuccessfullyConnected, Windows::Devices::Enumeration::DeviceInformation^ deviceInformation)
00057         {
00058             this->isDeviceSuccessfullyConnected = isDeviceSuccessfullyConnected;
00059             this->deviceInformation = deviceInformation;
00060         }
00061
00062         property bool IsDeviceSuccessfullyConnected
00063         {
00064             bool get(void)
00065             {
00066                 return isDeviceSuccessfullyConnected;
00067             }
00068         }
00069
00070         property Windows::Devices::Enumeration::DeviceInformation^ DeviceInformation
00071         {
00072             Windows::Devices::Enumeration::DeviceInformation^ get(void)
00073             {
00074                 return deviceInformation;
00075             }
00076         }
00077
00078     private:
00079         bool isDeviceSuccessfullyConnected;
00080         Windows::Devices::Enumeration::DeviceInformation^ deviceInformation;
00081     };
00082
00083     namespace DeviceProperties
00084     {
00085         static const Platform::String^ const DeviceInstanceId = "System.Devices.DeviceInstanceId";
00086     }
00087
00088     /// <summary>
00089     /// This is the report descriptor for the support SuperMutt device
00090     ///
00091     /// 0x06, 0xAA, 0xFF,             // USAGE_PAGE (Vendor Defined Page 1)
00092     /// 0x09, 0x01,                   // USAGE (Vendor Usage  1)
00093     /// 0xa1, 0x01,                   // COLLECTION (Application)
00094     /// 0x85, 0x01,                   //     REPORT_ID (1)
00095     /// 0xa1, 0x00,                   //  COLLECTION (Physical)
00096     /// 0x05, 0x09,                   //     USAGE_PAGE (Button)
00097     /// 0x19, 0x01,                   //     USAGE_MINIMUM (Button 1)
00098     /// 0x29, 0x04,                   //     USAGE_MAXIMUM (Button 4)
00099     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00100     /// 0x25, 0x01,                   //     LOGICAL_MAXIMUM (1)
00101     /// 0x75, 0x01,                   //     REPORT_SIZE (1)
00102     /// 0x95, 0x04,                   //     REPORT_COUNT (4)
00103     /// 0x81, 0x02,                   //     INPUT (Data,Var,Abs)
00104     /// 0x05, 0x0c,                   //     USAGE_PAGE (Consumer Devices)
00105     /// 0x09, 0xe0,                   //     USAGE (Volume)
00106     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00107     /// 0x25, 0x0a,                   //     LOGICAL_MAXIMUM (10)
00108     /// 0x35, 0x00,                   //     PHYSICAL_MINIMUM (0)
00109     /// 0x45, 0x64,                   //     PHYSICAL_MAXIMUM (100)
00110     /// 0x75, 0x04,                   //     REPORT_SIZE (4)
00111     /// 0x95, 0x01,                   //     REPORT_COUNT (1)
00112     /// 0x81, 0x02,                   //     INPUT (Data,Var,Abs)
00113     /// 0xc0,                         //  END_COLLECTION
00114     /// 0xa1, 0x00,                   //  COLLECTION (Physical)
00115     /// 0x05, 0x09,                   //     USAGE_PAGE (Button)
00116     /// 0x19, 0x01,                   //     USAGE_MINIMUM (Button 1)
00117     /// 0x29, 0x04,                   //     USAGE_MAXIMUM (Button 4)
00118     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00119     /// 0x25, 0x01,                   //     LOGICAL_MAXIMUM (1)
00120     /// 0x75, 0x01,                   //     REPORT_SIZE (1)
00121     /// 0x95, 0x04,                   //     REPORT_COUNT (4)
00122     /// 0x91, 0x02,                   //     OUTPUT (Data,Var,Abs)
00123     /// 0x05, 0x0c,                   //     USAGE_PAGE (Consumer Devices)
00124     /// 0x09, 0xe0,                   //     USAGE (Volume)
00125     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00126     /// 0x25, 0x0a,                   //     LOGICAL_MAXIMUM (10)
00127     /// 0x35, 0x00,                   //     PHYSICAL_MINIMUM (0)
00128     /// 0x45, 0x64,                   //     PHYSICAL_MAXIMUM (100)
00129     /// 0x75, 0x04,                   //     REPORT_SIZE (4)
00130     /// 0x95, 0x01,                   //     REPORT_COUNT (1)
00131     /// 0x91, 0x02,                   //     OUTPUT (Data,Var,Abs)
00132     /// 0xc0,                         //  END_COLLECTION
00133     /// 0xa1, 0x02,                   //  COLLECTION (Logical)
00134     /// 0x85, 0x03,                   //     REPORT_ID (3)
00135     /// 0x06, 0xAA, 0xff,             //     USAGE_PAGE (Vendor Defined Page 1)
00136     /// 0x09, 0x01,                   //     USAGE (Vendor Usage  1)
00137     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00138     /// 0x25, 0x01,                   //     LOGICAL_MAXIMUM (1)
00139     /// 0x75, 0x01,                   //     REPORT_SIZE (1)
00140     /// 0x95, 0x01,                   //     REPORT_COUNT (1)
00141     /// 0x91, 0x02,                   //     OUTPUT (Data,Var,Abs)
00142     /// 0x95, 0x07,                   //     REPORT_COUNT (7)
00143     /// 0x91, 0x07,                   //     OUTPUT (Cnst,Var,Rel)
00144     /// 0xc0,                         //    END_COLLECTION
00145     /// 0xa1, 0x02,                   //  COLLECTION (Logical)
00146     /// 0x85, 0x04,                   //     REPORT_ID (4)
00147     /// 0x06, 0xAA, 0xff,             //     USAGE_PAGE (Vendor Defined Page 1)
00148     /// 0x09, 0x01,                   //     USAGE (Vendor Usage  1)
00149     /// 0x15, 0x00,                   //     LOGICAL_MINIMUM (0)
00150     /// 0x26, 0xff, 0x00,             //     LOGICAL_MAXIMUM (255)
00151     /// 0x75, 0x08,                   //     REPORT_SIZE (8)
00152     /// 0x95, 0x01,                   //     REPORT_COUNT (1)
00153     /// 0xb1, 0x02,                   //     FEATURE (Data,Var,Abs)
00154     /// 0xc0,                         //    END_COLLECTION
00155     /// 0x06, 0xDD, 0xff,             //   USAGE_PAGE (Vendor Defined Page 1)
00156     /// 0x09, 0x01,                   //   USAGE (Vendor Usage  1)
00157     /// 0xa1, 0x02,                   //  COLLECTION (Logical)
00158     /// 0x85, 0xff,                   //   REPORT_ID (255)
00159     /// 0x09, 0x01,                   //   USAGE (Vendor Usage  1)
00160     /// 0x15, 0x00,                   //   LOGICAL_MINIMUM (0)
00161     /// 0x26, 0xff, 0x00,             //   LOGICAL_MAXIMUM (255)
00162     /// 0x75, 0x08,                   //   REPORT_SIZE (8)
00163     /// 0x95, 0x01,                   //   REPORT_COUNT (1)
00164     /// 0xb1, 0x02,                   //   FEATURE (Data,Var,Abs)
00165     /// 0xc0,                          //  END_COLLECTION
00166     /// 0xc0                          // END_COLLECTION
00167     /// </summary>
00168     namespace SuperMutt
00169     {
00170         namespace Device
00171         {
00172             static const uint16 Vid = 0x045E;
00173             static const uint16 Pid = 0x0610;
00174             static const uint16 UsagePage = 0xFFAA;
00175             static const uint16 UsageId = 0x0001;
00176         }
00177
00178         /// <summary>
00179         /// Only available for Feature Reports
00180         /// </summary>
00181         namespace LedPattern
00182         {
00183             static const uint16 ReportId = 0x04;
00184             static const uint16 UsagePage = 0xFF00;
00185             static const uint16 UsageId = 0x01;
00186         }
00187
00188         /// <summary>
00189         /// Only available for Input/Output Reports
00190         /// </summary>
00191         namespace ReadWriteBufferControlInformation
00192         {
00193             static const uint16 ReportId = 0x01;
00194
00195             static const uint16 VolumeUsagePage = 0x0C;
00196             static const uint16 VolumeUsageId = 0xE0;
00197             static const uint8 VolumeDataStartBit = 4; // Numeric data starts on bit 4
00198
00199             static const uint16 ButtonUsagePage = 0x09;
00200
00201             /// <summary>
00202             /// Usage id corresponding to each button
00203             /// 0x19, 0x01,         //      USAGE_MINIMUM (Button 1)
00204             /// 0x29, 0x04,         //      USAGE_MAXIMUM (Button 4)
00205             /// </summary>
00206             static const uint16 ButtonUsageId[] = { 1, 2, 3, 4 };
00207
00208             static const uint8 ButtonDataMask[] = {
00209                 0x01,   // Button 1
00210                 0x02,   // Button 2
00211                 0x04,   // Button 3
00212                 0x08    // Button 4
00213             };
00214         }
00215
00216         /// <summary>
00217         /// Only available for output reports. The report Id is used to start and stop
00218         /// device input reports.
00219         /// Data:   0x01 will enable input reports
00220         //          0x00 will disable input reports
00221         /// </summary>
00222         namespace DeviceInputReportControlInformation
00223         {
00224             static const uint16 ReportId = 0x03;
00225             static const uint16 UsagePage = 0xFF00;
00226             static const uint16 UsageId = 0x01;
00227
00228             /// <summary>
00229             /// Values used to turn on/off the device interrupts
00230             /// </summary>
00231             static const uint8 DataTurnOn = 0x01;
00232             static const uint8 DataTurnOff = 0x00;
00233         }
00234     }
00235 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario3_UnmanagedConsumable.xaml.h Source File

  • Store
  • cpp

Scenario3_UnmanagedConsumable.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario3_UnmanagedConsumable.g.h"
00016 #include "MainPage.xaml.h"
00017 #include "ItemsListViewModel.h"
00018
00019 namespace SDKTemplate
00020 {
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     public ref class Scenario3_UnmanagedConsumable sealed
00023     {
00024     public:
00025         Scenario3_UnmanagedConsumable();
00026
00027     private:
00028         MainPage^ rootPage = MainPage::Current;
00029         Windows::Services::Store::StoreContext^ storeContext;
00030
00031         void GetUnmanagedConsumablesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void PurchaseAddOnButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void GetConsumableBalanceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034         void FulfillConsumableButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035     };
00036 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ToneSampleGenerator::SineSampleInfo Member List

This is the complete list of members for ToneSampleGenerator::SineSampleInfo, including all inherited members.
Amplitude | ToneSampleGenerator::SineSampleInfo
ChannelCount | ToneSampleGenerator::SineSampleInfo
Frequency | ToneSampleGenerator::SineSampleInfo
GenerateSamples(array_view< uint8_t > buffer) noexcept | ToneSampleGenerator::SineSampleInfo
SampleSize | ToneSampleGenerator::SineSampleInfo
SamplesPerSecond | ToneSampleGenerator::SineSampleInfo
StoreSample | ToneSampleGenerator::SineSampleInfo
Theta | ToneSampleGenerator::SineSampleInfo
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadioManager/cs/RadioModel.cs Source File

  • RadioManager
  • cs

RadioModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.ComponentModel;
00014 using System.Runtime.CompilerServices;
00015 using Windows.Devices.Radios;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018
00019 namespace SDKTemplate
00020 {
00021     public class RadioModel : INotifyPropertyChanged
00022     {
00023         private Radio radio;
00024         private bool isEnabled;
00025         private CoreDispatcher dispatcher;
00026
00027         public RadioModel(Radio radio, CoreDispatcher dispatcher)
00028         {
00029             this.radio = radio;
00030             // Controlling the mobile broadband radio requires the cellularDeviceControl restricted capability, which we do not have.
00031             this.isEnabled = (radio.Kind != RadioKind.MobileBroadband);
00032             this.dispatcher = dispatcher;
00033             this.radio.StateChanged += Radio_StateChanged;
00034         }
00035
00036         private async void Radio_StateChanged(Radio sender, object args)
00037         {
00038             // The Radio StateChanged event doesn't run from the UI thread, so we must use the dispatcher
00039             // to run NotifyPropertyChanged
00040             await this.dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00041             {
00042                 NotifyPropertyChanged("IsRadioOn");
00043             });
00044         }
00045
00046         public string Name
00047         {
00048             get
00049             {
00050                 return this.radio.Name;
00051             }
00052         }
00053
00054         public bool IsRadioOn
00055         {
00056             get
00057             {
00058                 return this.radio.State == RadioState.On;
00059             }
00060             set
00061             {
00062                 SetRadioState(value);
00063             }
00064         }
00065
00066         public bool IsEnabled
00067         {
00068             get
00069             {
00070                 return this.isEnabled;
00071             }
00072             set
00073             {
00074                 this.isEnabled = value;
00075                 NotifyPropertyChanged();
00076             }
00077         }
00078
00079         public event PropertyChangedEventHandler PropertyChanged;
00080
00081         private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
00082         {
00083             if (PropertyChanged != null)
00084             {
00085                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
00086             }
00087         }
00088
00089         private async void SetRadioState(bool isRadioOn)
00090         {
00091             if (isRadioOn != IsRadioOn)
00092             {
00093                 var radioState = isRadioOn ? RadioState.On : RadioState.Off;
00094                 IsEnabled = false;
00095                 await this.radio.SetStateAsync(radioState);
00096                 NotifyPropertyChanged("IsRadioOn");
00097                 IsEnabled = true;
00098             }
00099         }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/SampleConfiguration.h Source File

  • DatagramSocket
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015
00016 namespace SDKTemplate
00017 {
00018     public value struct Scenario
00019     {
00020         Platform::String^ Title;
00021         Platform::String^ ClassName;
00022     };
00023
00024     partial ref class MainPage
00025     {
00026     public:
00027         static property Platform::String^ FEATURE_NAME
00028         {
00029             Platform::String^ get()
00030             {
00031                 return ref new Platform::String(L"DatagramSocket");
00032             }
00033         }
00034
00035         static property Platform::Array<Scenario>^ scenarios
00036         {
00037             Platform::Array<Scenario>^ get()
00038             {
00039                 return scenariosInner;
00040             }
00041         }
00042     private:
00043         static Platform::Array<Scenario>^ scenariosInner;
00044     };
00045 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlWebView/cs/Scenario5_NavToFiles.xaml.cs Source File

  • XamlWebView
  • cs

Scenario5_NavToFiles.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Storage;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using System;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario5_NavToFiles : Page
00021     {
00022         private MainPage rootPage = MainPage.Current;
00023
00024         public Scenario5_NavToFiles()
00025         {
00026             this.InitializeComponent();
00027         }
00028
00029         /// <summary>
00030         /// Navigates the webview to the application package
00031         /// </summary>
00032         /// <param name="sender"></param>
00033         /// <param name="e"></param>
00034         private void LoadFromPackage_Click()
00035         {
00036             string url = "ms-appx-web:///html/html_example2.html";
00037             WebViewControl.Navigate(new Uri(url));
00038             rootPage.NotifyUser($"Navigated to {url}", NotifyType.StatusMessage);
00039         }
00040
00041         /// <summary>
00042         /// Navigates the webview to the local state directory
00043         /// </summary>
00044         /// <param name="sender"></param>
00045         /// <param name="e"></param>
00046         private async void LoadFromLocalState_Click()
00047         {
00048             // Create a file in a subdirectory.
00049             // The ms-appdata protocol isolates top-level subdirectories from each other.
00050
00051             StorageFolder stateFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("NavigateToState", CreationCollisionOption.OpenIfExists);
00052             StorageFile htmlFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///html/html_example2.html"));
00053
00054             await htmlFile.CopyAsync(stateFolder, "test.html", NameCollisionOption.ReplaceExisting);
00055
00056             string url = "ms-appdata:///local/NavigateToState/test.html";
00057             WebViewControl.Navigate(new Uri(url));
00058             rootPage.NotifyUser($"Navigated to {url}", NotifyType.StatusMessage);
00059         }
00060     }
00061 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCustomMediaTransportControls/cs/MainPage.xaml.cs Source File

  • XamlCustomMediaTransportControls
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.Foundation;
00007 using Windows.Foundation.Collections;
00008 using Windows.Media.Core;
00009 using Windows.UI.Popups;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00019
00020 namespace CustomMediaTransportControls
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class MainPage : Page
00026     {
00027         private int likes = 0;
00028
00029         public MainPage()
00030         {
00031             this.InitializeComponent();
00032
00033             //This following line is setting the source for the MediaPlayerElement
00034             this.MainMPE.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/fishes.wmv"));
00035         }
00036
00037         private async void CustomMTC_Liked(object sender, EventArgs e)
00038         {
00039             var messageDialog = new MessageDialog("You liked this video " + (++likes) + " times.");
00040             await messageDialog.ShowAsync();
00041         }
00042     }
00043 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed |
_ConcatenateCalled | sealed | [private]
_GetIsUpperCaseEnabledRequested | sealed | [private]
_IsUpperCaseEnabledChanged | sealed |
_SessionLost | sealed | [private]
_SessionMemberAdded | sealed |
_SessionMemberRemoved | sealed |
_SetIsUpperCaseEnabledRequested | sealed | [private]
_Stopped | sealed | [private]
_TextSentReceived | sealed | [private]
AddMethodHandler(_In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_methodhandler_ptr handler) | sealed | [private]
AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler) | sealed |
AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler) | sealed | [private]
AllJoynMessageArgStructure() | sealed | [inline]
BusAttachmentStateChanged(_In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^sender, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachmentStateChangedEventArgs^args) | sealed |
CallConcatenateHandler(_Inout_ alljoyn_busobject busObject, _In_ alljoyn_message message) | sealed | [private, static]
CallTextSentReceived(_In_ SecureInterfaceLegacySignals^sender, _In_ SecureInterfaceTextSentReceivedEventArgs^args) | sealed |
CallTextSentReceived(_In_ SecureInterfaceSignals^sender, _In_ SecureInterfaceTextSentReceivedEventArgs^args) | sealed |
CallTextSentSignalHandler(_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message) | sealed | [static]
CallTextSentSignalHandler(_In_ const alljoyn_interfacedescription_member *member, _In_ alljoyn_message message) | sealed | [private, static]
Complete() | sealed | [private]
Complete() | sealed | [private]
Complete() | sealed | [private]
ConcatenateAsync(_In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2) | sealed |
First() | sealed | [inline, virtual]
FromIdAsync(_In_ Platform::String^deviceId) | sealed | [static]
FromIdAsync(_In_ Platform::String^deviceId, _In_ Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed | [static]
GetAt(unsigned int index) | sealed | [inline, virtual]
GetIsUpperCaseEnabledAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed | [virtual]
GetResultAsync(SecureInterfaceConcatenateCalledEventArgs^args) | sealed | [inline, static]
GetResultAsync(SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs^args) | sealed | [inline, static]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeAllFinished() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
InvokeCompleteHandler() | sealed | [private]
joiner | sealed |
m_busAttachment | sealed |
m_busAttachmentStateChangedToken | sealed | [private]
m_busObject | sealed |
m_busObject | sealed | [private]
m_completionsRequired | sealed | [private]
m_consumer | sealed | [private]
m_emitter | sealed | [private]
m_interfaceMemberInStr1 | sealed | [private]
m_interfaceMemberInStr2 | sealed | [private]
m_interfaceMemberMessage | sealed |
m_interfaceMemberOutStr | sealed | [private]
m_interfaceName | sealed | [static]
m_lock | sealed | [private]
m_memberTextSent | sealed | [private]
m_messageInfo | sealed | [private]
m_nativeBusAttachment | sealed |
m_nativeBusObject | sealed |
m_proxyBusObject | sealed |
m_raised | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_result | sealed | [private]
m_serviceInterface | sealed | [private]
m_ServiceObjectPath | sealed |
m_session | sealed |
m_sessionId | sealed | [private]
m_sessionListener | sealed |
m_sessionPort | sealed | [private]
m_sessionPortListener | sealed | [private]
m_signals | sealed |
m_signals | sealed | [private]
m_status | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_tce | sealed | [private]
m_value | sealed | [private]
m_weak | sealed |
OnPropertyGet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _Inout_ alljoyn_msgarg val) | sealed |
OnPropertySet(_In_ PCSTR interfaceName, _In_ PCSTR propertyName, _In_ alljoyn_msgarg val) | sealed |
OnSessionJoined(_In_ alljoyn_sessionport sessionPort, _In_ alljoyn_sessionid id, _In_ PCSTR joiner) | sealed |
OnSessionLost(_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason) | sealed |
OnSessionMemberAdded(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | sealed |
OnSessionMemberRemoved(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName) | sealed |
opts | sealed |
RemoveMemberFromSession(_In_ Platform::String^uniqueName) | sealed |
SecureInterfaceConcatenateCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ Platform::String^interfaceMemberInStr1, _In_ Platform::String^interfaceMemberInStr2) | sealed |
SecureInterfaceConsumer(Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed |
SecureInterfaceConsumer::Initialize(_In_ Windows::Devices::AllJoyn::AllJoynServiceInfo^serviceInfo) | sealed |
SecureInterfaceGetIsUpperCaseEnabledRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info) | sealed |
SecureInterfaceProducer(Windows::Devices::AllJoyn::AllJoynBusAttachment^busAttachment) | sealed |
SecureInterfaceSetIsUpperCaseEnabledRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ bool value) | sealed |
SetIsUpperCaseEnabledAsync(_In_ bool value) | sealed |
SetIsUpperCaseEnabledAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^info, _In_ bool value) | sealed | [virtual]
SourceInterfaces | sealed | [static]
SourceObjects | sealed | [private, static]
Start() | sealed |
Stop() | sealed |
TextSent(_In_ Platform::String^interfaceMemberMessage) | sealed |
TextSent(_In_ Platform::String^interfaceMemberMessage) | sealed |
UnregisterFromBus() | sealed | [private]
~SecureInterfaceConsumer() | sealed | [virtual]
~SecureInterfaceProducer() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_UsingUnicodeExtensions Member List

This is the complete list of members for Scenario7_UsingUnicodeExtensions, including all inherited members.
Display_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario7_UsingUnicodeExtensions
Scenario7_UsingUnicodeExtensions() | Scenario7_UsingUnicodeExtensions
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ThumbstickDPadHelper Member List

This is the complete list of members for ThumbstickDPadHelper, including all inherited members.
m_threshold | ThumbstickDPadHelper | [private]
m_waitForCenter | ThumbstickDPadHelper | [private]
SourcePressed(Windows::UI::Input::Spatial::SpatialInteractionPressKind pressKind, Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) | IDPadHelper | [inline, virtual]
ThumbstickDPadHelper(double threshold=.5) | ThumbstickDPadHelper |
Update(Windows::UI::Input::Spatial::SpatialInteractionControllerProperties^controllerState) override | ThumbstickDPadHelper | [virtual]
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario2_Load.xaml.h Source File

  • XamlBottomUpList
  • cpp

Scenario2_Load.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Load.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     // Bindable class representing a single text message.
00019     public ref class TextMessage sealed
00020     {
00021     public:
00022         property Platform::String^ Body
00023         {
00024             Platform::String^ get() { return _message; }
00025             void set(Platform::String^ value) { _message = value; }
00026         }
00027
00028         property Platform::String^ DisplayTime
00029         {
00030             Platform::String^ get() { return _displayTime; }
00031             void set(Platform::String^ value) { _displayTime = value; }
00032         }
00033
00034         property bool IsSent
00035         {
00036             bool get() { return _isSent; }
00037             void set(bool value) { _isSent = value; }
00038         }
00039
00040         property bool IsReceived
00041         {
00042             bool get() { return !_isSent; }
00043         }
00044
00045     private:
00046         Platform::String^ _message;
00047         Platform::String^ _displayTime;
00048         bool _isSent;
00049     };
00050
00051     /// <summary>
00052     /// This ListView is tailored to a Chat experience where the focus is on the last item in the list
00053     /// and as the user scrolls up the older messages are incrementally loaded.  We're performing our
00054     /// own logic to trigger loading more data.
00055     /// //
00056     /// Note: This is just delay loading the data, but isn't true data virtualization.  A user that
00057     /// scrolls all the way to the beginning of the list will cause all the data to be loaded.
00058     /// </summary>
00059     public ref class ChatListView sealed : public Windows::UI::Xaml::Controls::ListView
00060     {
00061     public:
00062         ChatListView();
00063
00064     protected:
00065         void OnApplyTemplate() override;
00066         Windows::Foundation::Size ArrangeOverride(Windows::Foundation::Size finalSize) override;
00067
00068     private:
00069         typedef Windows::Foundation::TypedEventHandler<Windows::UI::Xaml::Controls::ListViewBase^, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^> CCCEventHandler;
00070
00071         unsigned int itemsSeen;
00072         double averageContainerHeight = 0.0;
00073         bool processingScrollOffsets = false;
00074         bool processingScrollOffsetsDeferred = false;
00075         CCCEventHandler^ UpdateRunningAverageContainerHeightHandler = ref new CCCEventHandler(this, &ChatListView::UpdateRunningAverageContainerHeight);
00076
00077         void StartProcessingDataVirtualizationScrollOffsets(double actualHeight);
00078         Concurrency::task<void> ProcessDataVirtualizationScrollOffsetsAsync(double actualHeight);
00079         void UpdateRunningAverageContainerHeight(Windows::UI::Xaml::Controls::ListViewBase^ sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^ args);
00080         void ScrollViewer_ViewChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ args);
00081     };
00082
00083     [Windows::Foundation::Metadata::WebHostHidden]
00084     public ref class Scenario2_Load sealed
00085     {
00086     public:
00087         Scenario2_Load();
00088     protected:
00089         void SendTextMessage();
00090         void MessageTextBox_KeyUp(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
00091     private:
00092         Windows::UI::Xaml::Interop::IBindableObservableVector^ conversation;
00093
00094         void OnChatViewContainerContentChanging(Windows::UI::Xaml::Controls::ListViewBase^ sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^ args);
00095     };
00096 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario2/FileDataSource2.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario2

FileDataSource2.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.Specialized;
00004 using System.Diagnostics;
00005 using System.Linq;
00006 using System.Threading;
00007 using System.Threading.Tasks;
00008 using Windows.Storage;
00009 using Windows.Storage.Search;
00010 using Windows.UI.Core;
00011 using Windows.UI.Xaml.Data;
00012
00013 namespace DataVirtualizationSample
00014 {
00015     //********************************************************************************************
00016     //*
00017     //* Note: This sample uses a custom compiler constant to enable tracing. If you add
00018     //* TRACE_DATASOURCE to the Conditional compilation symbols of the Build tab of the
00019     //* Project Properties window, then the application will spit out trace data to the
00020     //* Output window while debugging.
00021     //*
00022     //********************************************************************************************
00023
00024     /// <summary>
00025     /// A custom datasource over the file system that supports data virtualization
00026     /// </summary>
00027     class FileDataSource2 : INotifyCollectionChanged, System.Collections.IList, IItemsRangeInfo, ISelectionInfo
00028     {
00029         // Folder that we are browsing
00030         private StorageFolder _folder;
00031         // Query object that will tell us if the folder content changed
00032         private StorageFileQueryResult _queryResult;
00033         // Dispatcher so we can marshal calls back to the UI thread
00034         private CoreDispatcher _dispatcher;
00035
00036         // Cache for the file data that is currently being used
00037         private ItemCacheManager<FileItem> itemCache;
00038
00039         // Total number of files available
00040         private int _count = 1;
00041
00042         public event NotifyCollectionChangedEventHandler CollectionChanged;
00043
00044         private FileDataSource2()
00045         {
00046             //Setup the dispatcher for the UI thread
00047             _dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;
00048
00049             // The ItemCacheManager does most of the heavy lifting. We pass it a callback that it will use to actually fetch data, and the max size of a request
00050             this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
00051             this.itemCache.CacheChanged += ItemCache_CacheChanged;
00052
00053             // Create another ItemCacheManager for the keys for selection
00054             this.selectionCache = new ItemCacheManager<string>(fetchSelectionDataCallback, 50, "selectionCache");
00055         }
00056
00057         // Handles a change notification for the list of files from the OS
00058         public async void ResetCollection()
00059         {
00060             // Update the selection cache to match the filesystem after the updates
00061             await RemapSelection();
00062
00063             // Unhook the old change notification
00064             if (itemCache != null)
00065             {
00066                 this.itemCache.CacheChanged -= ItemCache_CacheChanged;
00067             }
00068
00069             // Create a new instance of the cache manager
00070             this.itemCache = new ItemCacheManager<FileItem>(fetchDataCallback, 50);
00071             this.itemCache.CacheChanged += ItemCache_CacheChanged;
00072             if (CollectionChanged != null)
00073             {
00074                 CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
00075             }
00076         }
00077
00078
00079         //
00080         // Implementation of ISelectionInfo
00081         //
00082
00083         // Storage for the keys of the selected items
00084         private ItemCacheManager<string> selectionCache;
00085         // List of ranges that form the selection
00086         private ItemIndexRangeList selection = new ItemIndexRangeList();
00087
00088         // Called when an item (or items) are selected
00089         public void SelectRange(ItemIndexRange range)
00090         {
00091             selection.Add(range);
00092             selectionCache.UpdateRanges(selection.ToArray());
00093         }
00094
00095         // Called when an item (or items) are deselected
00096         public void DeselectRange(ItemIndexRange range)
00097         {
00098             selection.Subtract(range);
00099             selectionCache.UpdateRanges(selection.ToArray());
00100         }
00101
00102         //  Called to determine if an item is selected
00103         public bool IsSelected(int index)
00104         {
00105             foreach (ItemIndexRange range in selection)
00106             {
00107                 if (index >= range.FirstIndex && index <= range.LastIndex) return true;
00108             }
00109             return false;
00110         }
00111
00112         // Called to get the selected ranges
00113         public IReadOnlyList<ItemIndexRange> GetSelectedRanges()
00114         {
00115             return selection.ToList();
00116         }
00117
00118         // Callback from the selection cache manager
00119         // Retrieves the keys for selected items
00120         private async Task<string[]> fetchSelectionDataCallback(ItemIndexRange batch, CancellationToken ct)
00121         {
00122 #if TRACE_DATASOURCE
00123             Debug.WriteLine("# SelectionDataCallback: " + batch.FirstIndex + "->" + batch.LastIndex);
00124 #endif
00125             // See if we already have the item in the data cache, if so get the key from there so we don't need to go to the filesystem
00126             var file = itemCache[batch.FirstIndex];
00127             if (file != null)
00128             {
00129                 return new string[] { file.Key };
00130             }
00131
00132             // Go get the keys from the file system if necessary
00133             IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)batch.FirstIndex, batch.Length).AsTask(ct);
00134             List<string> keys = new List<string>();
00135             if (results != null)
00136             {
00137                 for (int i = 0; i < results.Count; i++)
00138                 {
00139                     ct.ThrowIfCancellationRequested();
00140                     keys.Add(results[i].FolderRelativeId);
00141                 }
00142             }
00143             return keys.ToArray();
00144         }
00145
00146         // Called after a reset to figure out the new indexes for the selected items
00147         private async Task RemapSelection()
00148         {
00149             ItemIndexRangeList oldSelection = selection;
00150             ItemCacheManager<string> oldSelectionCache = selectionCache;
00151             ItemIndexRangeList newSelection = new ItemIndexRangeList();
00152             ItemCacheManager<string> newSelectionCache = new ItemCacheManager<string>(fetchSelectionDataCallback, 50, "newSelectionCache");
00153
00154             foreach (ItemIndexRange r in oldSelection)
00155             {
00156                 IReadOnlyList<StorageFile> results = null;
00157                 int lastResultOffset = 0, lastResultsItemIndex = 0;
00158                 for (int i = 0; i < r.Length; i++)
00159                 {
00160                     int origIndex = r.FirstIndex + i;
00161                     string fileid = oldSelectionCache[origIndex];
00162                     bool matched = false;
00163
00164                     // Optimization to be able to work in batches. Once we get a batch of files from the filesystem we use that to hunt
00165                     // for matches rather than having to go ask for the index of each file
00166                     if (results != null)
00167                     {
00168                         for (int j = lastResultOffset + 1; j < results.Count; j++)
00169                         {
00170                             if (results[j].FolderRelativeId == fileid)
00171                             {
00172                                 lastResultOffset = j;
00173                                 int itemIndex = lastResultsItemIndex + j;
00174                                 newSelection.Add((uint)itemIndex, 1);
00175                                 newSelectionCache[itemIndex] = oldSelectionCache[origIndex];
00176                                 matched = true;
00177                                 break;
00178                             }
00179                         }
00180                     }
00181                     if (!matched)
00182                     {
00183                         // Get a starting point for the index of the file
00184                         lastResultsItemIndex = (int)(await _queryResult.FindStartIndexAsync(fileid.Substring(fileid.LastIndexOf('\\') + 1)));
00185                         lastResultOffset = 0;
00186                         // Get the files at that point and see if the keys actually match
00187                         results = await _queryResult.GetFilesAsync((uint)lastResultsItemIndex, 50);
00188                         if (results[lastResultOffset].FolderRelativeId == fileid)
00189                         {
00190                             newSelection.Add((uint)lastResultsItemIndex, 1);
00191                             newSelectionCache[lastResultsItemIndex] = oldSelectionCache[origIndex];
00192                         }
00193                         else
00194                         {
00195                             // We can't find the item, so its no longer part of the selection
00196                         }
00197                     }
00198                 }
00199             }
00200             // Update the fields for the new selection
00201             selection = newSelection;
00202             selectionCache = newSelectionCache;
00203         }
00204
00205         #region Filesystem specific implementation details
00206
00207         // Factory method to create the datasource
00208         // Requires async work which is why it needs a factory rather than being part of the constructor
00209         public static async Task<FileDataSource2> GetDataSoure(string path)
00210         {
00211             FileDataSource2 ds = new FileDataSource2();
00212             StorageFolder f = await StorageFolder.GetFolderFromPathAsync(path);
00213             await ds.SetFolder(f);
00214             return ds;
00215         }
00216
00217         // Set functionality for the folder
00218         public async Task SetFolder(StorageFolder folder)
00219         {
00220             //unhook the old contents changed event if applicable
00221             if (_queryResult != null)
00222             {
00223                 _queryResult.ContentsChanged -= QueryResult_ContentsChanged;
00224             }
00225             // Initialize the query and register for changes
00226             _folder = folder;
00227             QueryOptions options = new QueryOptions();
00228             // options.IndexerOption = IndexerOption.DoNotUseIndexer;
00229             _queryResult = _folder.CreateFileQueryWithOptions(options);
00230             _queryResult.ContentsChanged += QueryResult_ContentsChanged;
00231             await UpdateCount();
00232         }
00233
00234         // Handler for when the filesystem notifies us of a change to the file list
00235         private void QueryResult_ContentsChanged(IStorageQueryResultBase sender, object args)
00236         {
00237             // This callback can occur on a different thread so we need to marshal it back to the UI thread
00238             if (!_dispatcher.HasThreadAccess)
00239             {
00240                 var t = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, ResetCollection);
00241             }
00242             else
00243             {
00244                 ResetCollection();
00245             }
00246         }
00247         async Task UpdateCount()
00248         {
00249             _count = (int)await _queryResult.GetItemCountAsync();
00250             if (CollectionChanged != null)
00251             {
00252                 CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
00253             }
00254         }
00255
00256         //Event fired when items are inserted in the cache
00257         //Used to fire our collection changed event
00258         private void ItemCache_CacheChanged(object sender, CacheChangedEventArgs<FileItem> args)
00259         {
00260             if (CollectionChanged != null)
00261             {
00262                 CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, args.oldItem, args.newItem, args.itemIndex));
00263             }
00264         }
00265         #endregion
00266
00267         #region IList Implementation
00268
00269         public bool Contains(object value)
00270         {
00271             return IndexOf(value) != -1;
00272         }
00273
00274         public int IndexOf(object value)
00275         {
00276             return (value != null) ? itemCache.IndexOf((FileItem)value) : -1;
00277         }
00278
00279         public object this[int index]
00280         {
00281             get
00282             {
00283                 // The cache will return null if it doesn't have the item. Once the item is fetched it will fire a changed event so that we can inform the list control
00284                 return itemCache[index];
00285             }
00286             set
00287             {
00288                 throw new NotImplementedException();
00289             }
00290         }
00291         public int Count
00292         {
00293             get { return _count; }
00294         }
00295
00296         #endregion
00297
00298         #region IItemsRangeInfo Implementation
00299         //Required for the IItemsRangeInfo interface
00300         public void Dispose()
00301         {
00302             itemCache = null;
00303         }
00304
00305         /// <summary>
00306         /// Primary method for IItemsRangeInfo interface
00307         /// Is called when the list control's view is changed
00308         /// </summary>
00309         /// <param name="visibleRange">The range of items that are actually visible</param>
00310         /// <param name="trackedItems">Additional set of ranges that the list is using, for example the buffer regions and focussed element</param>
00311         public void RangesChanged(ItemIndexRange visibleRange, IReadOnlyList<ItemIndexRange> trackedItems)
00312         {
00313 #if TRACE_DATASOURCE
00314             string s = string.Format("* RangesChanged fired: Visible {0}->{1}", visibleRange.FirstIndex, visibleRange.LastIndex);
00315             foreach (ItemIndexRange r in trackedItems) { s += string.Format(" {0}->{1}", r.FirstIndex, r.LastIndex); }
00316             Debug.WriteLine(s);
00317 #endif
00318             // We know that the visible range is included in the broader range so don't need to hand it to the UpdateRanges call
00319             // Update the cache of items based on the new set of ranges. It will callback for additional data if required
00320             itemCache.UpdateRanges(trackedItems.ToArray());
00321         }
00322
00323
00324         // Callback from itemcache that it needs items to be retrieved
00325         private async Task<FileItem[]> fetchDataCallback(ItemIndexRange batch, CancellationToken ct)
00326         {
00327             // Fetch file objects from filesystem
00328             IReadOnlyList<StorageFile> results = await _queryResult.GetFilesAsync((uint)batch.FirstIndex, Math.Max(batch.Length, 20)).AsTask(ct);
00329             List<FileItem> files = new List<FileItem>();
00330             if (results != null)
00331             {
00332                 for (int i = 0; i < results.Count; i++)
00333                 {
00334                     ct.ThrowIfCancellationRequested();
00335                     // Create our FileItem object with the file data and thumbnail
00336                     FileItem newItem = await FileItem.fromStorageFile(results[i], ct);
00337                     files.Add(newItem);
00338                 }
00339             }
00340             return files.ToArray();
00341         }
00342
00343         #endregion
00344
00345         #region Parts of IList Not Implemented
00346
00347         public int Add(object value)
00348         {
00349             throw new NotImplementedException();
00350         }
00351
00352         public void Clear()
00353         {
00354             throw new NotImplementedException();
00355         }
00356
00357         public void Insert(int index, object value)
00358         {
00359             throw new NotImplementedException();
00360         }
00361
00362         public bool IsFixedSize
00363         {
00364             get { return false; }
00365         }
00366
00367         public bool IsReadOnly
00368         {
00369             get { return false; }
00370         }
00371
00372         public void Remove(object value)
00373         {
00374             throw new NotImplementedException();
00375         }
00376
00377         public void RemoveAt(int index)
00378         {
00379             throw new NotImplementedException();
00380         }
00381         public void CopyTo(Array array, int index)
00382         {
00383             throw new NotImplementedException();
00384         }
00385
00386         public bool IsSynchronized
00387         {
00388             get { throw new NotImplementedException(); }
00389         }
00390
00391         public object SyncRoot
00392         {
00393             get { throw new NotImplementedException(); }
00394         }
00395
00396         public System.Collections.IEnumerator GetEnumerator()
00397         {
00398             throw new NotImplementedException();
00399         }
00400
00401         #endregion
00402
00403     }
00404
00405 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Interface/RpcInterface.Idl Source File

  • CustomCapability
  • Service
  • Interface

RpcInterface.Idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 import "oaidl.idl";
00013 import "unknwn.idl";
00014
00015 [uuid (F72945BF-CB3E-403E-B198-6149328304EF), // You must change this when you change the interface
00016 version(1.0),
00017 pointer_default(unique),
00018 ]
00019 interface RpcInterface
00020 {
00021
00022     // context_handle_noserialize in acf for RPC to call rundown when the client goes away
00023     typedef [context_handle] void* PCONTEXT_HANDLE_TYPE;
00024     typedef [ref] PCONTEXT_HANDLE_TYPE * PPCONTEXT_HANDLE_TYPE;
00025
00026     //
00027     // RPC methods to retrieve/clean client context
00028     //
00029     void RemoteOpen([in] handle_t hBinding,
00030         [out] PPCONTEXT_HANDLE_TYPE pphContext);
00031
00032     void RemoteClose([in, out] PPCONTEXT_HANDLE_TYPE pphContext);
00033
00034     //
00035     // Metering Interface
00036     //
00037     void StartMetering(
00038         [in] PCONTEXT_HANDLE_TYPE phContext,
00039         [in] __int64 samplePeriod,
00040         [in, optional] __int64 context);
00041
00042     void SetSamplePeriod(
00043         [in] PCONTEXT_HANDLE_TYPE phContext,
00044         [in] __int64 samplePeriod);
00045
00046     void StopMetering([in] PCONTEXT_HANDLE_TYPE phContext);
00047
00048     [callback] void MeteringDataEvent(
00049         [in] __int64 data,
00050         [in, optional] __int64 context);
00051 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cppwinrt/Scenario4_SaveFile.h Source File

  • FilePicker
  • cppwinrt

Scenario4_SaveFile.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_SaveFile.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario4_SaveFile : Scenario4_SaveFileT<Scenario4_SaveFile>
00020     {
00021         Scenario4_SaveFile();
00022         fire_and_forget SaveFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario4_SaveFile : Scenario4_SaveFileT<Scenario4_SaveFile, implementation::Scenario4_SaveFile>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario09_GetCookie Member List

This is the complete list of members for Scenario09_GetCookie, including all inherited members.
Cancel_Click(object sender, RoutedEventArgs e) | Scenario09_GetCookie | [inline, private]
cts | Scenario09_GetCookie | [private]
GetCookies_Click(object sender, RoutedEventArgs e) | Scenario09_GetCookie | [inline, private]
httpClient | Scenario09_GetCookie | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario09_GetCookie | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario09_GetCookie | [inline, protected]
rootPage | Scenario09_GetCookie | [private]
Scenario09_GetCookie() | Scenario09_GetCookie | [inline]
SendHttpGetButton_Click(object sender, RoutedEventArgs e) | Scenario09_GetCookie | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cpp/pch.cpp Source File

  • BasicHologram
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cs/Scenario2_Disable.xaml.cs Source File

  • DisablingScreenCapture
  • cs

Scenario2_Disable.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario2_Disable : Page
00018     {
00019         public Scenario2_Disable()
00020         {
00021             this.InitializeComponent();
00022         }
00023
00024         protected override void OnNavigatedTo(NavigationEventArgs e)
00025         {
00026             // Disable screen capture when the user navigates to this page.
00027             Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
00028         }
00029
00030         protected override void OnNavigatedFrom(NavigationEventArgs e)
00031         {
00032             // Re-enable screen capture when the user navigates away from this page.
00033             Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = true;
00034         }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FrameFormatModel Member List

This is the complete list of members for FrameFormatModel, including all inherited members.
DisplayName | FrameFormatModel |
Format | FrameFormatModel |
FrameFormatModel(MediaFrameFormat format) | FrameFormatModel | [inline]
HasSameFormat(MediaFrameFormat otherFormat) | FrameFormatModel | [inline]
ToString() | FrameFormatModel | [inline]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SelectCommand Member List

This is the complete list of members for SelectCommand, including all inherited members.
AID | SelectCommand |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
SelectCommand(byte[] aid, byte?le) | SelectCommand | [inline]
ToString() | SelectCommand | [inline]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/Scenario2_ManageAccount.xaml.cs Source File

  • UserDataAccountManager
  • cs

Scenario2_ManageAccount.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.ApplicationModel.UserDataAccounts;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using System.Collections.Generic;
00017 using Windows.UI.Xaml;
00018 using System.Collections.ObjectModel;
00019 using System.Collections.Specialized;
00020 using System.Threading.Tasks;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario2_ManageAccount : Page
00025     {
00026         private MainPage rootPage = MainPage.Current;
00027         private bool isLaunched = false;
00028
00029         public Scenario2_ManageAccount()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         protected override async void OnNavigatedTo(NavigationEventArgs e)
00035         {
00036             await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
00037         }
00038
00039         private async void Manage_Click(object sender, RoutedEventArgs e)
00040         {
00041             // only one instance of the UserDataAccountManager pane can be launched at once per thread
00042             if (isLaunched == false)
00043             {
00044                 isLaunched = true;
00045
00046                 var selectedAccount = (UserDataAccount)AccountsListComboBox.SelectedValue;
00047                 if (selectedAccount != null)
00048                 {
00049                     await UserDataAccountManager.ShowAccountSettingsAsync(selectedAccount.Id);
00050
00051                     // User may have deleted the account
00052                     await rootPage.LoadDataAccountsAsync(AccountsListComboBox);
00053                 }
00054
00055                 isLaunched = false;
00056             }
00057         }
00058     }
00059 }
00060
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Manage Member List

This is the complete list of members for Scenario2_Manage, including all inherited members.
ElementNotFound | Scenario2_Manage | [private]
RemoveCredentials_Click(Object sender, RoutedEventArgs args) | Scenario2_Manage | [inline, private]
RetrieveCredentials_Click(Object sender, RoutedEventArgs args) | Scenario2_Manage | [inline, private]
RevealPasswords_Click(Object sender, RoutedEventArgs args) | Scenario2_Manage | [inline, private]
rootPage | Scenario2_Manage | [private]
Scenario2_Manage() | Scenario2_Manage | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ScopedViews Member List

This is the complete list of members for Scenario2_ScopedViews, including all inherited members.
Scenario2_ScopedViews() Scenario2_ScopedViews [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/CustomPixelShaderRenderer.cpp Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

CustomPixelShaderRenderer.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "CustomPixelShaderRenderer.h"
00014 #include "DirectXHelper.h"
00015
00016 using namespace CustomPixelShader;
00017 using namespace DirectX;
00018 using namespace Microsoft::WRL;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Graphics::Display;
00022 using namespace Windows::UI::Core;
00023
00024 CustomPixelShaderRenderer::CustomPixelShaderRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00025     m_deviceResources(deviceResources),
00026     m_isRippleAnimating(false)
00027 {
00028     m_timer = ref new BasicTimer();
00029
00030     CreateDeviceIndependentResources();
00031     CreateDeviceDependentResources();
00032     CreateWindowSizeDependentResources();
00033 }
00034
00035 void CustomPixelShaderRenderer::CreateDeviceIndependentResources()
00036 {
00037     auto wicFactory = m_deviceResources->GetWicImagingFactory();
00038     auto d2dFactory = m_deviceResources->GetD2DFactory();
00039
00040     // Create WIC Decoder to read JPG file.
00041     ComPtr<IWICBitmapDecoder> decoder;
00042     DX::ThrowIfFailed(
00043         wicFactory->CreateDecoderFromFilename(
00044         L"Assets\\rainier.jpg",
00045         nullptr,
00046         GENERIC_READ,
00047         WICDecodeMetadataCacheOnDemand,
00048         &decoder
00049         ));
00050
00051     ComPtr<IWICBitmapFrameDecode> frame;
00052     DX::ThrowIfFailed(decoder->GetFrame(0, &frame));
00053
00054     DX::ThrowIfFailed(wicFactory->CreateFormatConverter(&m_formatConvert));
00055     DX::ThrowIfFailed(m_formatConvert->Initialize(
00056         frame.Get(),
00057         GUID_WICPixelFormat32bppPBGRA, // 32bppPBGRA is used by Direct2D.
00058         WICBitmapDitherTypeNone,
00059         nullptr,
00060         0.0f,
00061         WICBitmapPaletteTypeCustom
00062         ));
00063
00064     UINT width;
00065     UINT height;
00066     DX::ThrowIfFailed(m_formatConvert->GetSize(&width, &height));
00067     m_imageSize = D2D1::SizeU(width, height);
00068
00069     // Register the custom ripple effect.
00070     DX::ThrowIfFailed(RippleEffect::Register(d2dFactory));
00071 }
00072
00073 void CustomPixelShaderRenderer::CreateDeviceDependentResources()
00074 {
00075     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00076
00077     // Load the image from WIC using ImageSource. The image is scaled using
00078     // ID2D1TransformedImageSource which is dependent on the scale factor.
00079     DX::ThrowIfFailed(d2dContext->CreateImageSourceFromWic(m_formatConvert.Get(), &m_imageSource));
00080
00081     DX::ThrowIfFailed(d2dContext->CreateEffect(CLSID_CustomRippleEffect, &m_rippleEffect));
00082 }
00083
00084 void CustomPixelShaderRenderer::ReleaseDeviceDependentResources()
00085 {
00086     m_imageSource.Reset();
00087     m_rippleEffect.Reset();
00088     m_transformedImage.Reset();
00089 }
00090
00091 void CustomPixelShaderRenderer::CreateWindowSizeDependentResources()
00092 {
00093     auto size = m_deviceResources->GetLogicalSize();
00094     float scale = size.Width / m_imageSize.width;
00095
00096     UpdateImageScale(scale);
00097 }
00098
00099 // Sets up the image effect pipeline to reflect the new scale factor.
00100 void CustomPixelShaderRenderer::UpdateImageScale(float scale)
00101 {
00102     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00103
00104     // When using ID2D1ImageSource, the recommend method of applying a transform
00105     // is to use ID2D1TransformedImageSource. It is inexpensive to recreate this object.
00106     D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES props =
00107     {
00108         D2D1_ORIENTATION_DEFAULT,
00109         scale,
00110         scale,
00111         D2D1_INTERPOLATION_MODE_LINEAR, // This is ignored when using DrawImage.
00112         D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE
00113     };
00114
00115     DX::ThrowIfFailed(d2dContext->CreateTransformedImageSource(
00116         m_imageSource.Get(),
00117         &props,
00118         &m_transformedImage));
00119
00120     m_rippleEffect->SetInput(0, m_transformedImage.Get());
00121 }
00122
00123 void CustomPixelShaderRenderer::UpdatePointer(_In_ PointerEventArgs^ args)
00124 {
00125     // Reset the timer to the start of the animation.
00126     m_timer->Reset();
00127
00128     // Since the custom ripple effect expects positioning in pixels, convert the event position from DIPs to pixels.
00129     float dpi = DisplayInformation::GetForCurrentView()->LogicalDpi;
00130     D2D1_POINT_2F position = D2D1::Point2F(
00131         DX::ConvertDipsToPixels(args->CurrentPoint->Position.X, dpi),
00132         DX::ConvertDipsToPixels(args->CurrentPoint->Position.Y, dpi)
00133         );
00134
00135     DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_CENTER, position));
00136
00137     // While ripple is animating, the program needs to both continuously render
00138     // and continuously poll for inputs.
00139     m_isRippleAnimating = true;
00140 }
00141
00142 void CustomPixelShaderRenderer::Update()
00143 {
00144     if (m_isRippleAnimating)
00145     {
00146         m_timer->Update();
00147         float delta = m_timer->Total;
00148
00149         // Stop animating after four seconds.
00150         if (delta >= 4)
00151         {
00152             delta = 4;
00153             m_isRippleAnimating = false;
00154         }
00155
00156         // Increase the spread over time to make the visible area of the waves spread out.
00157         DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_SPREAD, 0.01f + delta / 10.0f));
00158
00159         // Reduce the amplitude over time to make the waves decay in intensity.
00160         DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_AMPLITUDE, 60.0f - delta * 15.0f));
00161
00162         // Reduce the frequency over time to make each individual wave spread out.
00163         DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_FREQUENCY, 140.0f - delta * 30.0f));
00164
00165         // Change the phase over time to make each individual wave travel away from the center.
00166         DX::ThrowIfFailed(m_rippleEffect->SetValue(RIPPLE_PROP_PHASE, -delta * 20.0f));
00167     }
00168 }
00169
00170 void CustomPixelShaderRenderer::Render()
00171 {
00172     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00173
00174     d2dContext->BeginDraw();
00175     m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00176     d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));
00177
00178     d2dContext->DrawImage(m_rippleEffect.Get());
00179
00180     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00181     // is lost. It will be handled during the next call to Present.
00182     HRESULT hr = d2dContext->EndDraw();
00183     if (hr != D2DERR_RECREATE_TARGET)
00184     {
00185         DX::ThrowIfFailed(hr);
00186     }
00187 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

QuadRenderer Member List

This is the complete list of members for QuadRenderer, including all inherited members.
CreateDeviceDependentResources() | QuadRenderer |
CreateWindowSizeDependentResources() | QuadRenderer |
m_constantBuffer | QuadRenderer | [private]
m_constantBufferData | QuadRenderer | [private]
m_deviceResources | QuadRenderer | [private]
m_indexBuffer | QuadRenderer | [private]
m_indexCount | QuadRenderer | [private]
m_inputLayout | QuadRenderer | [private]
m_pixelShader | QuadRenderer | [private]
m_samplerState | QuadRenderer | [private]
m_vertexBuffer | QuadRenderer | [private]
m_vertexShader | QuadRenderer | [private]
QuadRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | QuadRenderer |
ReleaseDeviceDependentResources() | QuadRenderer |
Render(ID3D11ShaderResourceView *texture, float aspectRatio) | QuadRenderer |
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario10.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario10.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario10.xaml.h"
00013 #include <robuffer.h> // IBufferByteAccess
00014
00015 using namespace Concurrency;
00016 using namespace Microsoft::WRL;
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace SDKTemplate;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Graphics::Imaging;
00023 using namespace Windows::Storage;
00024 using namespace Windows::Storage::Streams;
00025 using namespace Windows::UI;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Media::Imaging;
00031
00032 Scenario10::Scenario10()
00033 {
00034     InitializeComponent();
00035
00036     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00037 }
00038
00039 static inline void ThrowIfFailed(HRESULT hr)
00040 {
00041     if (FAILED(hr))
00042     {
00043         throw Exception::CreateException(hr);
00044     }
00045 }
00046
00047 task<void> Scenario10::ColorizeCustomButtonAsync(Windows::UI::Color newColor)
00048 {
00049     // Get the bitmap from the png
00050     auto sourceUri = ref new Uri("ms-appx:///Assets/ButtonIconFill.png");
00051     return create_task(StorageFile::GetFileFromApplicationUriAsync(sourceUri))
00052         .then([](StorageFile^ storageFile)
00053     {
00054         return create_task(storageFile->OpenAsync(FileAccessMode::Read));
00055     }).then([](IRandomAccessStream^ readableStream)
00056     {
00057         return create_task(BitmapDecoder::CreateAsync(readableStream));
00058     }).then([newColor](BitmapDecoder^ bitmapDecoder)
00059     {
00060         BitmapTransform^ dummyTransform = ref new BitmapTransform();
00061         return create_task(bitmapDecoder->GetPixelDataAsync(
00062             BitmapPixelFormat::Bgra8,
00063             BitmapAlphaMode::Straight,
00064             dummyTransform,
00065             ExifOrientationMode::RespectExifOrientation,
00066             ColorManagementMode::DoNotColorManage))
00067             .then([newColor, bitmapDecoder](PixelDataProvider^ pixelDataProvider)
00068         {
00069             // We now have direct access to the pixels.
00070             Platform::Array<byte>^ pixelData = pixelDataProvider->DetachPixelData();
00071
00072             // Put everything into local variables to help the compiler optimize
00073             // this inner loop.
00074             byte* rawPixelData = pixelData->Data;
00075             unsigned pixelHeight = bitmapDecoder->PixelHeight;
00076             unsigned pixelWidth = bitmapDecoder->PixelWidth;
00077
00078             for (unsigned row = 0; row < pixelHeight; row++)
00079             {
00080                 for (unsigned col = 0; col < pixelWidth; col++)
00081                 {
00082                     int offset = (row * (int)pixelWidth * 4) + (col * 4);
00083
00084                     // Replace the pixel with newColor if it is our color key.
00085                     if ((rawPixelData[offset] <= 0x01) &&
00086                         (rawPixelData[offset + 1] <= 0x01) &&
00087                         (rawPixelData[offset + 2] <= 0x01) &&
00088                         (rawPixelData[offset + 3] != 0x00))
00089                     {
00090                         rawPixelData[offset] = newColor.B;
00091                         rawPixelData[offset + 1] = newColor.G;
00092                         rawPixelData[offset + 2] = newColor.R;
00093                         rawPixelData[offset + 3] = newColor.A;
00094                     }
00095                 }
00096             }
00097
00098             // Create a bitmap from our modified pixel data.
00099             auto bitmap = ref new WriteableBitmap((int)bitmapDecoder->PixelWidth, (int)bitmapDecoder->PixelHeight);
00100
00101             ComPtr<IInspectable> bufferAsInspectable(reinterpret_cast<IInspectable*>(bitmap->PixelBuffer));
00102             ComPtr<IBufferByteAccess> bufferAsByteAccess;
00103             ThrowIfFailed(bufferAsInspectable.As(&bufferAsByteAccess));
00104
00105             byte* pixels;
00106             ThrowIfFailed(bufferAsByteAccess->Buffer(&pixels));
00107             memcpy(pixels, pixelData->Data, pixelData->Length);
00108             bitmap->Invalidate();
00109
00110             return bitmap;
00111         });
00112     }).then([this](WriteableBitmap^ bitmap)
00113     {
00114         CustomButtonFill->Source = bitmap;
00115     });
00116 }
00117
00118 void Scenario10::inkToolbar_InkDrawingAttributesChanged(InkToolbar^ sender, Object^ args)
00119 {
00120     // Change the color of the button icon for the calligraphic pen button
00121     if (CalligraphicPenButton == inkToolbar->ActiveTool)
00122     {
00123         ColorizeCustomButtonAsync(sender->InkDrawingAttributes->Color);
00124     }
00125 }
00126
00127 void Scenario10::inkToolbar_Loaded(Object^ sender, RoutedEventArgs^ e)
00128 {
00129     auto selectedBrush = safe_cast<SolidColorBrush^>(CalligraphicPenButton->SelectedBrush);
00130     ColorizeCustomButtonAsync(selectedBrush->Color);
00131 }
00132
00133 void Scenario10::OnSizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00134 {
00135     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00136 }
00137
Generated on Fri Nov 15 2024 22:17:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario2_Stats.xaml.h Source File

  • Calendar
  • cpp

Scenario2_Stats.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Stats.g.h"
00015
00016 namespace SDKTemplate
00017 {
00018     [Windows::Foundation::Metadata::WebHostHidden]
00019     public ref class Scenario2_Stats sealed
00020     {
00021     public:
00022         Scenario2_Stats();
00023         void ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00024
00025     private:
00026         Platform::String^ ReportCalendarData(Windows::Globalization::Calendar^ calendar, Platform::String^ calendarLabel);
00027     };
00028 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_SampleOverview.xaml.cpp Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_SampleOverview.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_SampleOverview.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028
00029 Scenario_SampleOverview::Scenario_SampleOverview()
00030 {
00031     InitializeComponent();
00032 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceConnect Member List

This is the complete list of members for DeviceConnect, including all inherited members.
AddDeviceToList(DeviceInformation deviceInformation, String deviceSelector) | DeviceConnect | [inline, private]
AddDeviceWatcher(DeviceWatcher deviceWatcher, String deviceSelector) | DeviceConnect | [inline, private]
appResumeEventHandler | DeviceConnect | [private]
appSuspendEventHandler | DeviceConnect | [private]
ButtonNameDisableReconnectToDevice | DeviceConnect | [private]
ButtonNameDisconnectFromDevice | DeviceConnect | [private]
ClearDeviceEntries() | DeviceConnect | [inline, private]
ConnectToDevice_Click(Object sender, RoutedEventArgs eventArgs) | DeviceConnect | [inline, private]
DeviceConnect() | DeviceConnect | [inline]
DisconnectFromDevice_Click(Object sender, RoutedEventArgs eventArgs) | DeviceConnect | [inline, private]
FindDevice(String deviceId) | DeviceConnect | [inline, private]
InitializeDeviceWatchers() | DeviceConnect | [inline, private]
isAllDevicesEnumerated | DeviceConnect | [private]
listOfDevices | DeviceConnect | [private]
mapDeviceWatchersToDeviceSelector | DeviceConnect | [private]
OnAppResume(Object sender, Object args) | DeviceConnect | [inline, private]
OnAppSuspension(Object sender, SuspendingEventArgs args) | DeviceConnect | [inline, private]
OnDeviceAdded(DeviceWatcher sender, DeviceInformation deviceInformation) | DeviceConnect | [inline, private]
OnDeviceClosing(EventHandlerForDevice sender, DeviceInformation deviceInformation) | DeviceConnect | [inline, private]
OnDeviceConnected(EventHandlerForDevice sender, OnDeviceConnectedEventArgs onDeviceConnectedEventArgs) | DeviceConnect | [inline, private]
OnDeviceEnumerationComplete(DeviceWatcher sender, Object args) | DeviceConnect | [inline, private]
OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate) | DeviceConnect | [inline, private]
OnNavigatedFrom(NavigationEventArgs eventArgs) | DeviceConnect | [inline, protected]
OnNavigatedTo(NavigationEventArgs eventArgs) | DeviceConnect | [inline, protected]
RemoveDeviceFromList(String deviceId) | DeviceConnect | [inline, private]
rootPage | DeviceConnect | [private]
SelectDeviceInList(String deviceIdToSelect) | DeviceConnect | [inline, private]
StartDeviceWatchers() | DeviceConnect | [inline, private]
StartHandlingAppEvents() | DeviceConnect | [inline, private]
StopDeviceWatchers() | DeviceConnect | [inline, private]
StopHandlingAppEvents() | DeviceConnect | [inline, private]
UpdateConnectDisconnectButtonsAndList(Boolean enableConnectButton) | DeviceConnect | [inline, private]
watchersStarted | DeviceConnect | [private]
watchersSuspended | DeviceConnect | [private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TrackedPose Member List

This is the complete list of members for TrackedPose, including all inherited members.
Orientation | TrackedPose
OrientationStatus | TrackedPose
Position | TrackedPose
PositionStatus | TrackedPose
Generated on Fri Nov 15 2024 22:23:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Region Member List

This is the complete list of members for Scenario3_Region, including all inherited members.
Scenario3_Region() | Scenario3_Region
ShowResults_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_Region
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Button Member List

This is the complete list of members for Button, including all inherited members.
AddChild(const std::shared_ptr< IControl > &object) | ControlBase | [inline, virtual]
Button(const Windows::Foundation::Numerics::float3 size, const Windows::Foundation::Numerics::float4 color, const Windows::Foundation::Numerics::float4 focusColor, const Windows::Foundation::Numerics::float4 turnedOnColor, const DX::TextureIndex textureId) | Button |
ControlBase() | ControlBase |
CreateDeviceDependentResources() | ControlBase | [virtual]
DoCreateDeviceDependentResources() | Button | [protected, virtual]
DoReleaseDeviceDependentResources() | Button | [protected, virtual]
DoRender() | Button | [protected, virtual]
DoUpdate(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform) | Button | [protected, virtual]
GetBoundingBox(DirectX::BoundingOrientedBox &boundingBox) | ControlBase | [inline, virtual]
GetPosition() | ControlBase | [inline, virtual]
GetRotation() | ControlBase | [inline, virtual]
GetScale() | ControlBase | [inline, virtual]
GetSwitch() | Button | [inline]
Initialize(const std::shared_ptr< DX::DeviceResources > &deviceResources) | ControlBase | [virtual]
IsEnabled() | ControlBase | [inline, virtual]
IsFocused() | ControlBase | [inline, virtual]
m_boundingBox | ControlBase | [protected]
m_children | ControlBase | [protected]
m_color | Button | [private]
m_colorFocus | Button | [private]
m_colorOn | Button | [private]
m_deviceResources | ControlBase | [protected]
m_enabled | ControlBase | [protected]
m_focused | ControlBase | [protected]
m_geometryShader | Button | [private]
m_indexBuffer | Button | [private]
m_indexCount | Button | [private]
m_inputLayout | Button | [private]
m_loadingComplete | Button | [private]
m_modelConstantBuffer | Button | [private]
m_modelConstantBufferData | Button | [private]
m_onAirTapCallback | ControlBase | [protected]
m_pixelShader | Button | [private]
m_position | ControlBase | [protected]
m_rotation | ControlBase | [protected]
m_samplerState | Button | [private]
m_scale | ControlBase | [protected]
m_size | Button | [private]
m_textureIndex | Button | [private]
m_textureView | Button | [private]
m_transform | ControlBase | [protected]
m_turnedOn | Button | [private]
m_type | ControlBase | [protected]
m_usingVprtShaders | Button | [private]
m_vertexBuffer | Button | [private]
m_vertexShader | Button | [private]
ReleaseDeviceDependentResources() | ControlBase | [virtual]
Render() | ControlBase | [virtual]
SetEnabled(const bool enabled) | ControlBase | [inline, virtual]
SetOnAirTapCallback(std::function< void()> callback) | ControlBase | [inline, virtual]
SetPosition(Windows::Foundation::Numerics::float3 pos) | ControlBase | [inline, virtual]
SetRotation(Windows::Foundation::Numerics::float3 rot) | ControlBase | [inline, virtual]
SetScale(Windows::Foundation::Numerics::float3 scale) | ControlBase | [inline, virtual]
SetSwitch(const bool isOn) | Button | [inline]
Type() | ControlBase | [inline, virtual]
Update(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource) | ControlBase | [virtual]
Update(const DX::StepTimer &timer, HolographicFrame^holographicFrame, SpatialCoordinateSystem^currentCoordinateSystem, SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform) | ControlBase | [virtual]
HolographicMRCSample::IControl::Update(const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource)=0 | IControl | [pure virtual]
HolographicMRCSample::IControl::Update(const DX::StepTimer &timer, Windows::Graphics::Holographic::HolographicFrame^holographicFrame, Windows::Perception::Spatial::SpatialCoordinateSystem^currentCoordinateSystem, Windows::UI::Input::Spatial::SpatialInteractionSourceState^interactionSource, const DirectX::XMMATRIX &parentTransform)=0 | IControl | [pure virtual]
~ControlBase() | ControlBase | [virtual]
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cs/Scenario1_TrackPosition.xaml.cs Source File

  • Geolocation
  • cs

Scenario1_TrackPosition.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Geolocation;
00014 using Windows.Foundation;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario1_TrackPosition : Page
00023     {
00024         // Proides access to location data
00025         private Geolocator _geolocator = null;
00026
00027         // A pointer to the main page
00028         private MainPage _rootPage = MainPage.Current;
00029
00030         public Scenario1_TrackPosition()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         protected override void OnNavigatedFrom(NavigationEventArgs e)
00036         {
00037             if (_geolocator != null)
00038             {
00039                 _geolocator.PositionChanged -= OnPositionChanged;
00040                 _geolocator.StatusChanged -= OnStatusChanged;
00041             }
00042         }
00043
00044         /// <summary>
00045         /// This is the click handler for the 'StartTracking' button.
00046         /// </summary>
00047         /// <param name="sender"></param>
00048         /// <param name="e"></param>
00049         private async void StartTracking(object sender, RoutedEventArgs e)
00050         {
00051             // Request permission to access location
00052             var accessStatus = await Geolocator.RequestAccessAsync();
00053
00054             switch (accessStatus)
00055             {
00056                 case GeolocationAccessStatus.Allowed:
00057                     // You should set MovementThreshold for distance-based tracking
00058                     // or ReportInterval for periodic-based tracking before adding event
00059                     // handlers. If none is set, a ReportInterval of 1 second is used
00060                     // as a default and a position will be returned every 1 second.
00061                     //
00062                     // Value of 2000 milliseconds (2 seconds)
00063                     // isn't a requirement, it is just an example.
00064                     _geolocator = new Geolocator { ReportInterval = 2000 };
00065
00066                     // Subscribe to PositionChanged event to get updated tracking positions
00067                     _geolocator.PositionChanged += OnPositionChanged;
00068
00069                     // Subscribe to StatusChanged event to get updates of location status changes
00070                     _geolocator.StatusChanged += OnStatusChanged;
00071
00072                     _rootPage.NotifyUser("Waiting for update...", NotifyType.StatusMessage);
00073                     LocationDisabledMessage.Visibility = Visibility.Collapsed;
00074                     StartTrackingButton.IsEnabled = false;
00075                     StopTrackingButton.IsEnabled = true;
00076                     break;
00077
00078                 case GeolocationAccessStatus.Denied:
00079                     _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
00080                     LocationDisabledMessage.Visibility = Visibility.Visible;
00081                     break;
00082
00083                 case GeolocationAccessStatus.Unspecified:
00084                     _rootPage.NotifyUser("Unspecificed error!", NotifyType.ErrorMessage);
00085                     LocationDisabledMessage.Visibility = Visibility.Collapsed;
00086                     break;
00087             }
00088         }
00089
00090         /// <summary>
00091         /// This is the click handler for the 'StopTracking' button.
00092         /// </summary>
00093         /// <param name="sender"></param>
00094         /// <param name="e"></param>
00095         private void StopTracking(object sender, RoutedEventArgs e)
00096         {
00097             _geolocator.PositionChanged -= OnPositionChanged;
00098             _geolocator.StatusChanged -= OnStatusChanged;
00099             _geolocator = null;
00100
00101             StartTrackingButton.IsEnabled = true;
00102             StopTrackingButton.IsEnabled = false;
00103
00104             // Clear status
00105             _rootPage.NotifyUser("", NotifyType.StatusMessage);
00106         }
00107
00108         /// <summary>
00109         /// Event handler for PositionChanged events. It is raised when
00110         /// a location is available for the tracking session specified.
00111         /// </summary>
00112         /// <param name="sender">Geolocator instance</param>
00113         /// <param name="e">Position data</param>
00114         async private void OnPositionChanged(Geolocator sender, PositionChangedEventArgs e)
00115         {
00116             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00117             {
00118                 _rootPage.NotifyUser("Location updated.", NotifyType.StatusMessage);
00119                 UpdateLocationData(e.Position);
00120             });
00121         }
00122
00123         /// <summary>
00124         /// Event handler for StatusChanged events. It is raised when the
00125         /// location status in the system changes.
00126         /// </summary>
00127         /// <param name="sender">Geolocator instance</param>
00128         /// <param name="e">Statu data</param>
00129         async private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs e)
00130         {
00131             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00132             {
00133                 // Show the location setting message only if status is disabled.
00134                 LocationDisabledMessage.Visibility = Visibility.Collapsed;
00135
00136                 switch (e.Status)
00137                 {
00138                     case PositionStatus.Ready:
00139                         // Location platform is providing valid data.
00140                         ScenarioOutput_Status.Text = "Ready";
00141                         _rootPage.NotifyUser("Location platform is ready.", NotifyType.StatusMessage);
00142                         break;
00143
00144                     case PositionStatus.Initializing:
00145                         // Location platform is attempting to acquire a fix.
00146                         ScenarioOutput_Status.Text = "Initializing";
00147                         _rootPage.NotifyUser("Location platform is attempting to obtain a position.", NotifyType.StatusMessage);
00148                         break;
00149
00150                     case PositionStatus.NoData:
00151                         // Location platform could not obtain location data.
00152                         ScenarioOutput_Status.Text = "No data";
00153                         _rootPage.NotifyUser("Not able to determine the location.", NotifyType.ErrorMessage);
00154                         break;
00155
00156                     case PositionStatus.Disabled:
00157                         // The permission to access location data is denied by the user or other policies.
00158                         ScenarioOutput_Status.Text = "Disabled";
00159                         _rootPage.NotifyUser("Access to location is denied.", NotifyType.ErrorMessage);
00160
00161                         // Show message to the user to go to location settings
00162                         LocationDisabledMessage.Visibility = Visibility.Visible;
00163
00164                         // Clear cached location data if any
00165                         UpdateLocationData(null);
00166                         break;
00167
00168                     case PositionStatus.NotInitialized:
00169                         // The location platform is not initialized. This indicates that the application
00170                         // has not made a request for location data.
00171                         ScenarioOutput_Status.Text = "Not initialized";
00172                         _rootPage.NotifyUser("No request for location is made yet.", NotifyType.StatusMessage);
00173                         break;
00174
00175                     case PositionStatus.NotAvailable:
00176                         // The location platform is not available on this version of the OS.
00177                         ScenarioOutput_Status.Text = "Not available";
00178                         _rootPage.NotifyUser("Location is not available on this version of the OS.", NotifyType.ErrorMessage);
00179                         break;
00180
00181                     default:
00182                         ScenarioOutput_Status.Text = "Unknown";
00183                         _rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
00184                         break;
00185                 }
00186             });
00187         }
00188
00189         /// <summary>
00190         /// Updates the user interface with the Geoposition data provided
00191         /// </summary>
00192         /// <param name="position">Geoposition to display its details</param>
00193         private void UpdateLocationData(Geoposition position)
00194         {
00195             if (position == null)
00196             {
00197                 ScenarioOutput_Latitude.Text = "No data";
00198                 ScenarioOutput_Longitude.Text = "No data";
00199                 ScenarioOutput_Accuracy.Text = "No data";
00200                 ScenarioOutput_Source.Text = "No data";
00201                 ScenarioOutput_IsRemoteSource.Text = "No data";
00202             }
00203             else
00204             {
00205                 ScenarioOutput_Latitude.Text = position.Coordinate.Point.Position.Latitude.ToString();
00206                 ScenarioOutput_Longitude.Text = position.Coordinate.Point.Position.Longitude.ToString();
00207                 ScenarioOutput_Accuracy.Text = position.Coordinate.Accuracy.ToString();
00208                 ScenarioOutput_Source.Text = position.Coordinate.PositionSource.ToString();
00209                 ScenarioOutput_IsRemoteSource.Text = position.Coordinate.IsRemoteSource.ToString();
00210             }
00211         }
00212     }
00213 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/DOModel.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

DOModel.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Linq;
00005 using System.Runtime.CompilerServices;
00006 using System.Text;
00007 using System.Threading.Tasks;
00008 using Windows.UI.Xaml;
00009
00010 namespace xBindSampleModel
00011 {
00012     public sealed class DOModel : DependencyObject
00013     {
00014         public DOModel()
00015         {
00016             YangObj = new YangContainer(this);
00017         }
00018
00019         public void UpdateValues()
00020         {
00021             this.IntPropertyDP++;
00022             YinPropertyDP = 65;
00023         }
00024
00025         public YangContainer YangObj
00026         {
00027             get;
00028             set;
00029         }
00030
00031         public int IntPropertyDP
00032         {
00033             get { return (int)GetValue(IntPropertyDPProperty); }
00034             set { SetValue(IntPropertyDPProperty, value); }
00035         }
00036         #region IntPropertyDP DP
00037         private const string IntPropertyDPName = "IntPropertyDP";
00038         private static readonly DependencyProperty _IntPropertyDPProperty =
00039             DependencyProperty.Register(IntPropertyDPName, typeof(int), typeof(DataModel), new PropertyMetadata(0));
00040         public static DependencyProperty IntPropertyDPProperty {  get { return _IntPropertyDPProperty; } }
00041         #endregion
00042
00043         public double YinPropertyDP
00044         {
00045             get { return (double)GetValue(YinPropertyDPProperty); }
00046             set { SetValue(YinPropertyDPProperty, value); }
00047         }
00048         #region YinPropertyDP DP
00049         private const string YinPropertyDPName = "YinPropertyDP";
00050         private static readonly DependencyProperty _YinPropertyDPProperty =
00051             DependencyProperty.Register(YinPropertyDPName, typeof(double), typeof(DataModel), new PropertyMetadata(0, YinCallback));
00052         public static DependencyProperty YinPropertyDPProperty { get { return _YinPropertyDPProperty; } }
00053         #endregion
00054
00055
00056         public static void YinCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
00057         {
00058             DOModel inst = d as DOModel;
00059             double value = (double)e.NewValue;
00060             if (inst.YangObj.Value != value)
00061             {
00062                 inst.YangObj.Value = value;
00063             }
00064         }
00065     }
00066
00067     public sealed class YangContainer : INotifyPropertyChanged
00068     {
00069         private DOModel _parent;
00070
00071         public YangContainer(DOModel parent)
00072         {
00073             _parent = parent;
00074         }
00075
00076         private double _value;
00077         public double Value
00078         {
00079             get { return _value; }
00080             set
00081             {
00082                 if (value != _value)
00083                 {
00084                     _value = value;
00085                     NotifyPropertyChanged();
00086                     _parent.YinPropertyDP = value;
00087                 }
00088             }
00089         }
00090
00091
00092         #region INPC
00093
00094         public event PropertyChangedEventHandler PropertyChanged;
00095
00096         private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
00097         {
00098             if (PropertyChanged != null)
00099             {
00100                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
00101             }
00102         }
00103         #endregion
00104     }
00105 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/Metering.h Source File

  • CustomCapability
  • Service
  • Server

Metering.h

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include <windows.h>
00003
00004 #include <iostream>       // std::cout
00005 #include <thread>         // std::thread
00006 #include <mutex>
00007
00008 namespace RpcServer
00009 {
00010     class Metering
00011     {
00012     public:
00013         Metering(__int64 period);
00014         void SetSamplePeriod(__int64 period);
00015         __int64 GetMeteringData() const;
00016         void MeteringWorker();
00017         void WaitForMeteringData() const;
00018         void StartMetering(__int64 samplePeriod, __int64 context);
00019         void StopMetering();
00020         ~Metering();
00021
00022     private:
00023         volatile __int64 _data;
00024         volatile __int64 samplePeriod;
00025         PTP_TIMER tpTimer = nullptr;
00026         HANDLE event;
00027         volatile bool stopMeteringRequested = false;
00028     };
00029 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario3_CurrentStepCount.xaml.cpp Source File

  • Pedometer
  • cpp

Scenario3_CurrentStepCount.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_CurrentStepCount.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Devices::Enumeration;
00020 using namespace Windows::Devices::Sensors;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Globalization::DateTimeFormatting;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 /// <summary>
00033 /// CurrentStepCount page that the user is navigated to when 'Current step count' scenario is selected.
00034 /// </summary>
00035 Scenario3_CurrentStepCount::Scenario3_CurrentStepCount() : rootPage(MainPage::Current)
00036 {
00037     InitializeComponent();
00038
00039     // Disable buttons until we can access a pedometer
00040     GetCurrentButton->IsEnabled = false;
00041
00042     // Determine if we can access pedometers
00043     auto deviceAccessInfo = DeviceAccessInformation::CreateFromDeviceClassId(GUID_Pedometer_ClassId);
00044     if (deviceAccessInfo->CurrentStatus == DeviceAccessStatus::Allowed)
00045     {
00046         // Determine if a pedometer is present
00047         // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
00048         create_task(Pedometer::GetDefaultAsync).then([this](task<Pedometer^> task)
00049         {
00050             pedometer = task.get();
00051             if (nullptr == pedometer)
00052             {
00053                 rootPage->NotifyUser("No pedometers available", NotifyType::ErrorMessage);
00054             }
00055             else
00056             {
00057                 rootPage->NotifyUser("Hit the 'Get steps count' Button", NotifyType::StatusMessage);
00058                 GetCurrentButton->IsEnabled = true;
00059             }
00060         });
00061     }
00062 }
00063
00064 /// <summary>
00065 /// Invoked when 'GetCurrentButton' is clicked.
00066 /// 'ReadingChanged' will not be fired when there is no activity on the pedometer
00067 /// and hence can't be reliably used to get the current step count. This handler makes
00068 /// use of pedometer history on the system to get the current step count of the parameter
00069 /// </summary>
00070 /// <param name="sender">unused</param>
00071 /// <param name="e">unused</param>
00072 void Scenario3_CurrentStepCount::GetCurrentButton_Click(Platform::Object^ /*sender*/, Windows::UI::Xaml::RoutedEventArgs^ /*e*/)
00073 {
00074     // Disable the button while we get the history
00075     GetCurrentButton->IsEnabled = false;
00076
00077     auto currentReadings = pedometer->GetCurrentReadings();
00078
00079     // To define the step goal, figure out the current step count
00080     auto totalStepCount = 0;
00081     bool updateTimestamp = true;
00082     for (auto kind = PedometerStepKind::Unknown; kind <= PedometerStepKind::Running; kind++)
00083     {
00084         if (currentReadings->HasKey(kind))
00085         {
00086             auto reading = currentReadings->Lookup(kind);
00087             totalStepCount += reading->CumulativeSteps;
00088
00089             if (updateTimestamp)
00090             {
00091                 auto timestampFormatter = ref new DateTimeFormatter("day month year hour minute second");
00092                 ScenarioOutput_Timestamp->Text = timestampFormatter->Format(reading->Timestamp);
00093                 updateTimestamp = false;
00094             }
00095         }
00096     }
00097     ScenarioOutput_TotalStepCount->Text = totalStepCount.ToString();
00098
00099     // Re-enable the button
00100     GetCurrentButton->IsEnabled = true;
00101 }
Generated on Fri Nov 15 2024 22:20:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/CameraResources.cpp Source File

  • 360VideoPlayback
  • cpp
  • Common

CameraResources.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002
00003 #include "CameraResources.h"
00004 #include "Common\DirectXHelper.h"
00005 #include "DeviceResources.h"
00006 #include <windows.graphics.directx.direct3d11.interop.h>
00007
00008 using namespace DirectX;
00009 using namespace Microsoft::WRL;
00010 using namespace Windows::Graphics::DirectX::Direct3D11;
00011 using namespace Windows::Graphics::Holographic;
00012 using namespace Windows::Perception::Spatial;
00013
00014 DX::CameraResources::CameraResources(HolographicCamera^ camera) :
00015     m_holographicCamera(camera),
00016     m_isStereo(camera->IsStereo),
00017     m_d3dRenderTargetSize(camera->RenderTargetSize)
00018 {
00019     m_d3dViewport = CD3D11_VIEWPORT(
00020         0.f, 0.f,
00021         m_d3dRenderTargetSize.Width,
00022         m_d3dRenderTargetSize.Height
00023         );
00024 };
00025
00026 // Updates resources associated with a holographic camera's swap chain.
00027 // The app does not access the swap chain directly, but it does create
00028 // resource views for the back buffer.
00029 void DX::CameraResources::CreateResourcesForBackBuffer(
00030     DX::DeviceResources* pDeviceResources,
00031     HolographicCameraRenderingParameters^ cameraParameters
00032     )
00033 {
00034     const auto device = pDeviceResources->GetD3DDevice();
00035
00036     // Get the WinRT object representing the holographic camera's back buffer.
00037     IDirect3DSurface^ surface = cameraParameters->Direct3D11BackBuffer;
00038
00039     // Get a DXGI interface for the holographic camera's back buffer.
00040     // Holographic cameras do not provide the DXGI swap chain, which is owned
00041     // by the system. The Direct3D back buffer resource is provided using WinRT
00042     // interop APIs.
00043     ComPtr<ID3D11Resource> resource;
00044     ThrowIfFailed(
00045         GetDXGIInterfaceFromObject(surface, IID_PPV_ARGS(&resource))
00046         );
00047
00048     // Get a Direct3D interface for the holographic camera's back buffer.
00049     ComPtr<ID3D11Texture2D> cameraBackBuffer;
00050     ThrowIfFailed(
00051         resource.As(&cameraBackBuffer)
00052         );
00053
00054     // Determine if the back buffer has changed. If so, ensure that the render target view
00055     // is for the current back buffer.
00056     if (m_d3dBackBuffer.Get() != cameraBackBuffer.Get())
00057     {
00058         // This can change every frame as the system moves to the next buffer in the
00059         // swap chain. This mode of operation will occur when certain rendering modes
00060         // are activated.
00061         m_d3dBackBuffer = cameraBackBuffer;
00062
00063         // Create a render target view of the back buffer.
00064         // Creating this resource is inexpensive, and is better than keeping track of
00065         // the back buffers in order to pre-allocate render target views for each one.
00066         DX::ThrowIfFailed(
00067             device->CreateRenderTargetView(
00068                 m_d3dBackBuffer.Get(),
00069                 nullptr,
00070                 &m_d3dRenderTargetView
00071                 )
00072             );
00073
00074         // Get the DXGI format for the back buffer.
00075         // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
00076         D3D11_TEXTURE2D_DESC backBufferDesc;
00077         m_d3dBackBuffer->GetDesc(&backBufferDesc);
00078         m_dxgiFormat = backBufferDesc.Format;
00079
00080         // Check for render target size changes.
00081         Windows::Foundation::Size currentSize = m_holographicCamera->RenderTargetSize;
00082         if (m_d3dRenderTargetSize != currentSize)
00083         {
00084             // Set render target size.
00085             m_d3dRenderTargetSize = currentSize;
00086
00087             // A new depth stencil view is also needed.
00088             m_d3dDepthStencilView.Reset();
00089         }
00090     }
00091
00092     // Refresh depth stencil resources, if needed.
00093     if (m_d3dDepthStencilView == nullptr)
00094     {
00095         // Create a depth stencil view for use with 3D rendering if needed.
00096         CD3D11_TEXTURE2D_DESC depthStencilDesc(
00097             DXGI_FORMAT_D16_UNORM,
00098             static_cast<UINT>(m_d3dRenderTargetSize.Width),
00099             static_cast<UINT>(m_d3dRenderTargetSize.Height),
00100             m_isStereo ? 2 : 1, // Create two textures when rendering in stereo.
00101             1, // Use a single mipmap level.
00102             D3D11_BIND_DEPTH_STENCIL
00103             );
00104
00105         ComPtr<ID3D11Texture2D> depthStencil;
00106         DX::ThrowIfFailed(
00107             device->CreateTexture2D(
00108                 &depthStencilDesc,
00109                 nullptr,
00110                 &depthStencil
00111                 )
00112             );
00113
00114         CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(
00115             m_isStereo ? D3D11_DSV_DIMENSION_TEXTURE2DARRAY : D3D11_DSV_DIMENSION_TEXTURE2D
00116             );
00117         DX::ThrowIfFailed(
00118             device->CreateDepthStencilView(
00119                 depthStencil.Get(),
00120                 &depthStencilViewDesc,
00121                 &m_d3dDepthStencilView
00122                 )
00123             );
00124     }
00125
00126     // Create the constant buffer, if needed.
00127     if (m_viewProjectionConstantBuffer == nullptr)
00128     {
00129         // Create a constant buffer to store view and projection matrices for the camera.
00130         CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00131         DX::ThrowIfFailed(
00132             device->CreateBuffer(
00133                 &constantBufferDesc,
00134                 nullptr,
00135                 &m_viewProjectionConstantBuffer
00136                 )
00137             );
00138     }
00139 }
00140
00141 // Releases resources associated with a back buffer.
00142 void DX::CameraResources::ReleaseResourcesForBackBuffer(DX::DeviceResources* pDeviceResources)
00143 {
00144     const auto context = pDeviceResources->GetD3DDeviceContext();
00145
00146     // Release camera-specific resources.
00147     m_d3dBackBuffer.Reset();
00148     m_d3dRenderTargetView.Reset();
00149     m_d3dDepthStencilView.Reset();
00150     m_viewProjectionConstantBuffer.Reset();
00151
00152     // Ensure system references to the back buffer are released by clearing the render
00153     // target from the graphics pipeline state, and then flushing the Direct3D context.
00154     ID3D11RenderTargetView* nullViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { nullptr };
00155     context->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00156     context->Flush();
00157 }
00158
00159 // Updates the view/projection constant buffer for a holographic camera.
00160 void DX::CameraResources::UpdateViewProjectionBuffer(
00161     std::shared_ptr<DX::DeviceResources> deviceResources,
00162     HolographicCameraPose^ cameraPose,
00163     SpatialCoordinateSystem^ coordinateSystem
00164     )
00165 {
00166     // The system changes the viewport on a per-frame basis for system optimizations.
00167     m_d3dViewport = CD3D11_VIEWPORT(
00168         cameraPose->Viewport.Left,
00169         cameraPose->Viewport.Top,
00170         cameraPose->Viewport.Width,
00171         cameraPose->Viewport.Height
00172         );
00173
00174     // The projection transform for each frame is provided by the HolographicCameraPose.
00175     HolographicStereoTransform cameraProjectionTransform = cameraPose->ProjectionTransform;
00176
00177     // Get a container object with the view and projection matrices for the given
00178     // pose in the given coordinate system.
00179     Platform::IBox<HolographicStereoTransform>^ viewTransformContainer = cameraPose->TryGetViewTransform(coordinateSystem);
00180
00181     // If TryGetViewTransform returns a null pointer, that means the pose and coordinate
00182     // system cannot be understood relative to one another; content cannot be rendered
00183     // in this coordinate system for the duration of the current frame.
00184     // This usually means that positional tracking is not active for the current frame, in
00185     // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
00186     // content that is not world-locked instead.
00187     DX::ViewProjectionConstantBuffer viewProjectionConstantBufferData;
00188     bool viewTransformAcquired = viewTransformContainer != nullptr;
00189     if (viewTransformAcquired)
00190     {
00191         // Otherwise, the set of view transforms can be retrieved.
00192         HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer->Value;
00193
00194         // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
00195         // constantly moving relative to the world. The view matrices need to be updated
00196         // every frame.
00197         XMStoreFloat4x4(
00198             &viewProjectionConstantBufferData.viewProjection[0],
00199             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Left) * XMLoadFloat4x4(&cameraProjectionTransform.Left))
00200             );
00201         XMStoreFloat4x4(
00202             &viewProjectionConstantBufferData.viewProjection[1],
00203             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Right) * XMLoadFloat4x4(&cameraProjectionTransform.Right))
00204             );
00205     }
00206
00207     // Use the D3D device context to update Direct3D device-based resources.
00208     const auto context = deviceResources->GetD3DDeviceContext();
00209
00210     // Loading is asynchronous. Resources must be created before they can be updated.
00211     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || !viewTransformAcquired)
00212     {
00213         m_framePending = false;
00214     }
00215     else
00216     {
00217         // Update the view and projection matrices.
00218         context->UpdateSubresource(
00219             m_viewProjectionConstantBuffer.Get(),
00220             0,
00221             nullptr,
00222             &viewProjectionConstantBufferData,
00223             0,
00224             0
00225             );
00226
00227         m_framePending = true;
00228     }
00229 }
00230
00231 // Gets the view-projection constant buffer for the HolographicCamera and attaches it
00232 // to the shader pipeline.
00233 bool DX::CameraResources::AttachViewProjectionBuffer(
00234     std::shared_ptr<DX::DeviceResources> deviceResources
00235     )
00236 {
00237     // This method uses Direct3D device-based resources.
00238     const auto context = deviceResources->GetD3DDeviceContext();
00239
00240     // Loading is asynchronous. Resources must be created before they can be updated.
00241     // Cameras can also be added asynchronously, in which case they must be initialized
00242     // before they can be used.
00243     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
00244     {
00245         return false;
00246     }
00247
00248     // Set the viewport for this camera.
00249     context->RSSetViewports(1, &m_d3dViewport);
00250
00251     // Send the constant buffer to the vertex shader.
00252     context->VSSetConstantBuffers(
00253         1,
00254         1,
00255         m_viewProjectionConstantBuffer.GetAddressOf()
00256         );
00257
00258     // The template includes a pass-through geometry shader that is used by
00259     // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
00260     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
00261     // will be enabled at run-time on systems that require it.
00262     // If your app will also use the geometry shader for other tasks and those
00263     // tasks require the view/projection matrix, uncomment the following line
00264     // of code to send the constant buffer to the geometry shader as well.
00265     /*context->GSSetConstantBuffers(
00266         1,
00267         1,
00268         m_viewProjectionConstantBuffer.GetAddressOf()
00269         );*/
00270
00271     m_framePending = false;
00272
00273     return true;
00274 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/AudioCreation/SampleConfiguration.cs Source File

  • AudioCreation
  • cs
  • AudioCreation

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using AudioCreation;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "AudioCreation";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="File Playback", ClassType=typeof(Scenario1_FilePlayback)},
00026             new Scenario() { Title="Capture From Device", ClassType=typeof(Scenario2_DeviceCapture)},
00027             new Scenario() { Title="Using A FrameInput Node", ClassType=typeof(Scenario3_FrameInput)},
00028             new Scenario() { Title="Using A Submix Node", ClassType=typeof(Scenario4_Submix)},
00029             new Scenario() { Title="Inbox Effects", ClassType=typeof(Scenario5_InboxEffects)},
00030             new Scenario() { Title="Custom Effects", ClassType=typeof(Scenario6_CustomEffects)}
00031         };
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cs/Scenario1_AddAccount.xaml.cs Source File

  • UserDataAccountManager
  • cs

Scenario1_AddAccount.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using Windows.ApplicationModel.UserDataAccounts;
00016 using System;
00017 using System.Threading;
00018 using System.Threading.Tasks;
00019 using System.Collections.Generic;
00020 using Windows.ApplicationModel.Email;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario1_AddAccount : Page
00025     {
00026         private MainPage rootPage;
00027         private bool isLaunched;
00028
00029         public Scenario1_AddAccount()
00030         {
00031             this.InitializeComponent();
00032             isLaunched = false;
00033         }
00034
00035         protected override void OnNavigatedTo(NavigationEventArgs e)
00036         {
00037             rootPage = MainPage.Current;
00038         }
00039
00040         private async void AddAccount_Click(object sender, RoutedEventArgs e)
00041         {
00042             // only one instance of the UserDataAccountManager pane can be launched at once per thread
00043             if (isLaunched == false)
00044             {
00045                 isLaunched = true;
00046
00047                 // Allow user to add email, contacts and appointment providing accounts.
00048                 String userDataAccountId = await UserDataAccountManager.ShowAddAccountAsync(UserDataAccountContentKinds.Email | UserDataAccountContentKinds.Appointment | UserDataAccountContentKinds.Contact);
00049
00050                 if (String.IsNullOrEmpty(userDataAccountId))
00051                 {
00052                     rootPage.NotifyUser("User cancelled or add account failed", NotifyType.StatusMessage);
00053                 }
00054                 else
00055                 {
00056                     await DisplayUserInformationAsync(userDataAccountId);
00057                 }
00058
00059                 isLaunched = false;
00060             }
00061         }
00062
00063         private async Task DisplayUserInformationAsync(String id)
00064         {
00065
00066             // Requires the email, contacts, or appointments in the app's manifest
00067             UserDataAccountStore store = await UserDataAccountManager.RequestStoreAsync(UserDataAccountStoreAccessType.AllAccountsReadOnly);
00068
00069             // If the store is null, that means all access to Contacts, Calendar and Email data
00070             // has been revoked.
00071             if (store == null)
00072             {
00073                 rootPage.NotifyUser("Access to Contacts, Calendar and Email has been revoked", NotifyType.ErrorMessage);
00074                 return;
00075             }
00076
00077             UserDataAccount account = await store.GetAccountAsync(id);
00078             rootPage.NotifyUser("Added account: " + account.UserDisplayName, NotifyType.StatusMessage);
00079
00080         }
00081
00082     }
00083 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/SampleConfiguration.cs Source File

  • TextSegmentation
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Text segmentation C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Extract Text Segments", ClassType = typeof(Scenario1_ExtractTextSegments) },
00025             new Scenario() { Title = "Get Current Text Segment From Index", ClassType = typeof(Scenario2_GetCurrentTextSegmentFromIndex) }
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario3.xaml.h Source File

  • StreamSocket
  • cpp

Scenario3.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.h
00014 // Declaration of the Scenario3 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario3.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace StreamSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario3 sealed
00032         {
00033         public:
00034             Scenario3();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             MainPage^ rootPage;
00040             void SendHello_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         };
00042     }
00043 }
Generated on Fri Nov 15 2024 22:18:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SetErrorMessage.xaml.cpp Source File

  • ShareSource
  • cpp

SetErrorMessage.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // FailWithError.xaml.cpp
00014 // Implementation of the FailWithError class
00015 //
00016
00017 #include "pch.h"
00018 #include "SharePage.h"
00019 #include "SetErrorMessage.xaml.h"
00020 #include "MainPage.xaml.h"
00021
00022 using namespace SDKTemplate;
00023
00024 using namespace Platform;
00025 using namespace Windows::ApplicationModel::DataTransfer;
00026
00027 SetErrorMessage::SetErrorMessage()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 bool SetErrorMessage::GetShareContent(DataRequest^ request)
00033 {
00034     auto errorMessage = CustomErrorText->Text;
00035     if (errorMessage == nullptr)
00036     {
00037         errorMessage = ref new String(L"Enter a failure display text and try again.");
00038     }
00039     request->FailWithDisplayText(errorMessage);
00040     return false;
00041 }
Generated on Fri Nov 15 2024 22:21:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SourceBufferManager Member List

This is the complete list of members for SourceBufferManager, including all inherited members.
AbortDownload() | SourceBufferManager | [inline, private]
activeDownload | SourceBufferManager | [protected]
Appending | SourceBufferManager |
CleanBuffer(TimeSpan now) | SourceBufferManager | [inline, private]
Close() | SourceBufferManager | [inline, private]
Initialize(MseStreamSource mse) | SourceBufferManager | [inline, private]
internalAppending | SourceBufferManager | [protected]
IsAudio | SourceBufferManager |
IsEndOfStream | SourceBufferManager |
isEndOfStream | SourceBufferManager | [protected]
isFirstSegment | SourceBufferManager | [protected]
isInitialized | SourceBufferManager | [protected]
IsVideo | SourceBufferManager |
MaxBuffering | SourceBufferManager | [protected]
MaxGap | SourceBufferManager | [protected]
mimeType | SourceBufferManager | [protected]
mse | SourceBufferManager | [protected]
MseSourceBuffer | SourceBufferManager |
sb | SourceBufferManager | [protected]
segmentCursor | SourceBufferManager | [protected]
SendInitSegment(TimeSpan now) | SourceBufferManager | [inline, private]
SendMediaSegment(TimeSpan now) | SourceBufferManager | [inline, protected, virtual]
SourceBufferManager(string mimeType, MediaStream stream) | SourceBufferManager | [inline, private]
stream | SourceBufferManager | [protected]
UpdateData(TimeSpan now) | SourceBufferManager | [inline, private, virtual]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ClearTool Member List

This is the complete list of members for ClearTool, including all inherited members.
ClearTool(Windows::UI::Color color, float diameter) | ClearTool |
GetColor() const | Tool | [inline]
GetDiameter() const | Tool | [inline]
m_color | Tool | [protected]
m_diameter | Tool | [protected]
m_indexBuffer | ClearTool | [protected]
m_indexCount | ClearTool | [protected]
m_modelConstantBufferData | Tool | [protected]
m_orientation | Tool | [protected]
m_position | Tool | [protected]
m_refreshModelConstantBufferData | Tool | [protected]
m_resetBuffers | ClearTool | [protected]
m_vertexBuffer | ClearTool | [protected]
Render(ID3D11DeviceContext *pDeviceContext, IRenderer *pRenderingHelper) override | ClearTool | [virtual]
SetOrientation(Windows::Foundation::Numerics::quaternion orientation) | Tool |
SetPosition(Windows::Foundation::Numerics::float3 position) | Tool |
Tool(Windows::UI::Color color, float diameter) | Tool |
Update(ID3D11DeviceContext *pDeviceContext) override | ClearTool | [virtual]
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/SampleConfiguration.h Source File

  • 3DPrinting
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/cs/SampleConfiguration.cs Source File

  • MixedRealityModel
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Mixed Reality Model C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Place 3D model", ClassType=typeof(SDKTemplate.Scenario1_CreateTile)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/SampleConfiguration.h Source File

  • Projection
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014 #include "ViewLifetimeControl.h"
00015
00016 namespace SDKSample
00017 {
00018     value struct Scenario;
00019
00020     partial ref class MainPage
00021     {
00022     internal:
00023         SecondaryViewsHelpers::ViewLifetimeControl^ ProjectionViewPageControl;
00024
00025         static property Platform::String^ FEATURE_NAME
00026         {
00027             Platform::String^ get()
00028             {
00029                 return "Projection";
00030             }
00031         }
00032
00033         static property Platform::Array<Scenario>^ scenarios
00034         {
00035             Platform::Array<Scenario>^ get()
00036             {
00037                 return scenariosInner;
00038             }
00039         }
00040
00041     private:
00042         static Platform::Array<Scenario>^ scenariosInner;
00043     };
00044
00045     public value struct Scenario
00046     {
00047         Platform::String^ Title;
00048         Platform::String^ ClassName;
00049     };
00050
00051     // This is a simple container for a set of data used to initialize the projection view
00052     [Windows::Foundation::Metadata::WebHostHidden]
00053     public ref class ProjectionViewPageInitializationData sealed
00054     {
00055     internal:
00056         Windows::UI::Core::CoreDispatcher^ MainDispatcher;
00057         SecondaryViewsHelpers::ViewLifetimeControl^ ProjectionViewPageControl;
00058         int MainViewId;
00059     };
00060
00061 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/pch.cpp Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTask/cpp/BackgroundTask/Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp Source File

  • BackgroundTask
  • cpp
  • BackgroundTask

Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2_SampleBackgroundTaskWithCondition.xaml.cpp
00013 // Implementation of the SampleBackgroundTaskWithCondition class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario2_SampleBackgroundTaskWithCondition.xaml.h"
00018 #include "SampleConfiguration.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::ApplicationModel::Background;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 SampleBackgroundTaskWithCondition::SampleBackgroundTaskWithCondition()
00029 {
00030     InitializeComponent();
00031 }
00032
00033 /// <summary>
00034 /// Invoked when this page is about to be displayed in a Frame.
00035 /// </summary>
00036 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037 /// property is typically used to configure the page.</param>
00038 void SampleBackgroundTaskWithCondition::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00041     // as NotifyUser()
00042     rootPage = MainPage::Current;
00043
00044     //
00045     // Attach progress and completed handlers to any existing tasks.
00046     //
00047     for (auto pair : BackgroundTaskRegistration::AllTasks)
00048     {
00049         auto task = pair->Value;
00050         if (task->Name == SampleBackgroundTaskWithConditionName)
00051         {
00052             BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, true);
00053             AttachProgressAndCompletedHandlers(task);
00054             break;
00055         }
00056     }
00057
00058     UpdateUI();
00059 }
00060
00061 /// <summary>
00062 /// Attach progress and completed handers to a background task.
00063 /// </summary>
00064 /// <param name="task">The task to attach progress and completed handlers to.</param>
00065 void SampleBackgroundTaskWithCondition::AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration^ task)
00066 {
00067     task->Progress += ref new BackgroundTaskProgressEventHandler(this, &SampleBackgroundTaskWithCondition::OnProgress);
00068     task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &SampleBackgroundTaskWithCondition::OnCompleted);
00069 }
00070
00071 /// <summary>
00072 /// Register a SampleBackgroundTaskWithCondition.
00073 /// </summary>
00074 /// <param name="sender"></param>
00075 /// <param name="e"></param>
00076 void SampleBackgroundTaskWithCondition::RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00077 {
00078     auto task = BackgroundTaskSample::RegisterBackgroundTask(SampleBackgroundTaskEntryPoint,
00079                                                              SampleBackgroundTaskWithConditionName,
00080                                                              ref new SystemTrigger(SystemTriggerType::TimeZoneChange, false),
00081                                                              ref new SystemCondition(SystemConditionType::InternetAvailable));
00082     AttachProgressAndCompletedHandlers(task);
00083     UpdateUI();
00084 }
00085
00086 /// <summary>
00087 /// Unregister a SampleBackgroundTaskWithCondition.
00088 /// </summary>
00089 /// <param name="sender"></param>
00090 /// <param name="e"></param>
00091 void SampleBackgroundTaskWithCondition::UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00092 {
00093     BackgroundTaskSample::UnregisterBackgroundTasks(SampleBackgroundTaskWithConditionName);
00094     UpdateUI();
00095 }
00096
00097 /// <summary>
00098 /// Handle background task progress.
00099 /// </summary>
00100 /// <param name="task">The task that is reporting progress.</param>
00101 /// <param name="args">Arguments of the progress report.</param>
00102 void SampleBackgroundTaskWithCondition::OnProgress(BackgroundTaskRegistration^ task, BackgroundTaskProgressEventArgs^ args)
00103 {
00104     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00105     {
00106         auto progress = "Progress: " + args->Progress + "%";
00107         BackgroundTaskSample::SampleBackgroundTaskWithConditionProgress = progress;
00108         UpdateUI();
00109     }));
00110 }
00111
00112 /// <summary>
00113 /// Handle background task completion.
00114 /// </summary>
00115 /// <param name="task">The task that is reporting completion.</param>
00116 /// <param name="args">Arguments of the completion report.</param>
00117 void SampleBackgroundTaskWithCondition::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00118 {
00119     UpdateUI();
00120 }
00121
00122 /// <summary>
00123 /// Update the scenario UI.
00124 /// </summary>
00125 void SampleBackgroundTaskWithCondition::UpdateUI()
00126 {
00127     auto uiDelegate = [this]()
00128     {
00129         RegisterButton->IsEnabled = !BackgroundTaskSample::SampleBackgroundTaskWithConditionRegistered;
00130         UnregisterButton->IsEnabled = BackgroundTaskSample::SampleBackgroundTaskWithConditionRegistered;
00131         Progress->Text = BackgroundTaskSample::SampleBackgroundTaskWithConditionProgress;
00132         Status->Text = BackgroundTaskSample::GetBackgroundTaskStatus(SampleBackgroundTaskWithConditionName);
00133     };
00134     auto handler = ref new Windows::UI::Core::DispatchedHandler(uiDelegate, Platform::CallbackContext::Any);
00135
00136     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, handler);
00137 }
Generated on Fri Nov 15 2024 22:18:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/HistoryChangedTrigger/BadgeControl/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • HistoryChangedTrigger
  • BadgeControl

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks;
00002 using BackgroundTasks.Helpers;
00003 using System;
00004 using System.Collections.Generic;
00005 using System.Linq;
00006 using System.Threading.Tasks;
00007 using Windows.ApplicationModel.Background;
00008 using Windows.UI.Notifications;
00009 using Windows.UI.Popups;
00010 using Windows.UI.StartScreen;
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace Notifications.ScenarioPages.Toasts.HistoryChangedTrigger.BadgeControl
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class ScenarioElement : UserControl
00022     {
00023         private static readonly string BACKGROUND_TASK_NAME = "ToastNotificationHistoryChangedTriggerTask";
00024
00025         public ScenarioElement()
00026         {
00027             this.InitializeComponent();
00028
00029             Initialize();
00030         }
00031
00032         private async void Initialize()
00033         {
00034             base.IsEnabled = false;
00035
00036             // Clear all existing notifications
00037             ToastNotificationManager.History.Clear();
00038
00039             // Register background task
00040             if (!await RegisterBackgroundTask())
00041             {
00042                 await new MessageDialog("ERROR: Couldn't register background task.").ShowAsync();
00043                 return;
00044             }
00045
00046
00047             base.IsEnabled = true;
00048         }
00049
00050         private async Task<bool> RegisterBackgroundTask()
00051         {
00052             // Unregister any previous exising background task
00053             UnregisterBackgroundTask();
00054
00055             // Request access
00056             BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
00057
00058             // If denied
00059             if (status != BackgroundAccessStatus.AlwaysAllowed && status != BackgroundAccessStatus.AllowedSubjectToSystemPolicy)
00060                 return false;
00061
00062             // Construct the background task
00063             BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
00064             {
00065                 Name = BACKGROUND_TASK_NAME,
00066                 TaskEntryPoint = "BackgroundTasks.BadgeNotificationHistoryChangedTriggerTask"
00067             };
00068
00069             // Set trigger for Toast History Changed
00070             builder.SetTrigger(new ToastNotificationHistoryChangedTrigger());
00071
00072             // And register the background task
00073             BackgroundTaskRegistration registration = builder.Register();
00074
00075             return true;
00076         }
00077
00078         private static void UnregisterBackgroundTask()
00079         {
00080             var task = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(i => i.Name.Equals(BACKGROUND_TASK_NAME));
00081
00082             if (task != null)
00083                 task.Unregister(true);
00084         }
00085
00086         private string _tileId;
00087         private async void ButtonPinSecondaryTile_Click(object sender, RoutedEventArgs e)
00088         {
00089             _tileId = "ScenarioBadgeControl";
00090
00091             SecondaryTile tile = new SecondaryTile(_tileId, "Name 1", "args", new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Medium.png"), TileSize.Default);
00092             tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Small.png");
00093             tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Wide.png");
00094             tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/DefaultSecondaryTileAssests/Large.png");
00095             tile.VisualElements.ShowNameOnSquare150x150Logo = true;
00096             tile.VisualElements.ShowNameOnSquare310x310Logo = true;
00097             tile.VisualElements.ShowNameOnWide310x150Logo = true;
00098             await tile.RequestCreateAsync();
00099
00100             //Prepare for next Step:
00101
00102             // Pop all the notifications
00103             ToastHelper.PopToast("Toast 1", "Content of Toast 1");
00104             ToastHelper.PopToast("Toast 2", "Content of Toast 2");
00105             ToastHelper.PopToast("Toast 3", "Content of Toast 3");
00106
00107             //Update badge
00108             IReadOnlyList<ToastNotification> TNList = ToastNotificationManager.History.GetHistory();
00109
00110             BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent((uint)TNList.Count);
00111
00112             // Send the notification to the application’s tile.
00113             BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(_tileId).Update(badgeContent.CreateNotification());
00114
00115             // Move the UI to the next step
00116             stepsControl.Step++;
00117             stepsControl.NextButtonVisibility = Visibility.Collapsed;
00118         }
00119     }
00120 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModemInformation Member List

This is the complete list of members for ModemInformation, including all inherited members.
btnRefresh_Click(object sender, RoutedEventArgs e) | ModemInformation | [inline, private]
CheckForNullOrEmptyField(object input) | ModemInformation | [inline, private]
ModemInformation() | ModemInformation | [inline]
OnNavigatedTo(NavigationEventArgs e) | ModemInformation | [inline, protected]
rootPage | ModemInformation | [private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ItemViewModel Member List

This is the complete list of members for ItemViewModel, including all inherited members.
ItemViewModel(MasterDetailApp::Data::Item const &item) | ItemViewModel | [inline]
m_dateCreated | ItemViewModel |
m_text | ItemViewModel |
m_title | ItemViewModel |
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/SampleConfiguration.cpp Source File

  • RelativeInclinometer
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" }
00022 };
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/Common/BasicLoader.h Source File

  • Simple3DGameDX
  • cpp
  • Common

BasicLoader.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "BasicReaderWriter.h"
00011
00012 // A simple loader class that provides support for loading shaders, textures,
00013 // and meshes from files on disk. Provides synchronous and asynchronous methods.
00014 ref class BasicLoader
00015 {
00016 internal:
00017     BasicLoader(
00018         _In_ ID3D11Device* d3dDevice,
00019         _In_opt_ IWICImagingFactory2* wicFactory = nullptr
00020         );
00021
00022     void LoadTexture(
00023         _In_ Platform::String^ filename,
00024         _Out_opt_ ID3D11Texture2D** texture,
00025         _Out_opt_ ID3D11ShaderResourceView** textureView
00026         );
00027
00028     concurrency::task<void> LoadTextureAsync(
00029         _In_ Platform::String^ filename,
00030         _Out_opt_ ID3D11Texture2D** texture,
00031         _Out_opt_ ID3D11ShaderResourceView** textureView
00032         );
00033
00034     void LoadShader(
00035         _In_ Platform::String^ filename,
00036         _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[],
00037         _In_ uint32 layoutDescNumElements,
00038         _Out_ ID3D11VertexShader** shader,
00039         _Out_opt_ ID3D11InputLayout** layout
00040         );
00041
00042     concurrency::task<void> LoadShaderAsync(
00043         _In_ Platform::String^ filename,
00044         _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC layoutDesc[],
00045         _In_ uint32 layoutDescNumElements,
00046         _Out_ ID3D11VertexShader** shader,
00047         _Out_opt_ ID3D11InputLayout** layout
00048         );
00049
00050     void LoadShader(
00051         _In_ Platform::String^ filename,
00052         _Out_ ID3D11PixelShader** shader
00053         );
00054
00055     concurrency::task<void> LoadShaderAsync(
00056         _In_ Platform::String^ filename,
00057         _Out_ ID3D11PixelShader** shader
00058         );
00059
00060     void LoadShader(
00061         _In_ Platform::String^ filename,
00062         _Out_ ID3D11ComputeShader** shader
00063         );
00064
00065     concurrency::task<void> LoadShaderAsync(
00066         _In_ Platform::String^ filename,
00067         _Out_ ID3D11ComputeShader** shader
00068         );
00069
00070     void LoadShader(
00071         _In_ Platform::String^ filename,
00072         _Out_ ID3D11GeometryShader** shader
00073         );
00074
00075     concurrency::task<void> LoadShaderAsync(
00076         _In_ Platform::String^ filename,
00077         _Out_ ID3D11GeometryShader** shader
00078         );
00079
00080     void LoadShader(
00081         _In_ Platform::String^ filename,
00082         _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY* streamOutDeclaration,
00083         _In_ uint32 numEntries,
00084         _In_reads_opt_(numStrides) const uint32* bufferStrides,
00085         _In_ uint32 numStrides,
00086         _In_ uint32 rasterizedStream,
00087         _Out_ ID3D11GeometryShader** shader
00088         );
00089
00090     concurrency::task<void> LoadShaderAsync(
00091         _In_ Platform::String^ filename,
00092         _In_reads_opt_(numEntries) const D3D11_SO_DECLARATION_ENTRY* streamOutDeclaration,
00093         _In_ uint32 numEntries,
00094         _In_reads_opt_(numStrides) const uint32* bufferStrides,
00095         _In_ uint32 numStrides,
00096         _In_ uint32 rasterizedStream,
00097         _Out_ ID3D11GeometryShader** shader
00098         );
00099
00100     void LoadShader(
00101         _In_ Platform::String^ filename,
00102         _Out_ ID3D11HullShader** shader
00103         );
00104
00105     concurrency::task<void> LoadShaderAsync(
00106         _In_ Platform::String^ filename,
00107         _Out_ ID3D11HullShader** shader
00108         );
00109
00110     void LoadShader(
00111         _In_ Platform::String^ filename,
00112         _Out_ ID3D11DomainShader** shader
00113         );
00114
00115     concurrency::task<void> LoadShaderAsync(
00116         _In_ Platform::String^ filename,
00117         _Out_ ID3D11DomainShader** shader
00118         );
00119
00120     void LoadMesh(
00121         _In_ Platform::String^ filename,
00122         _Out_ ID3D11Buffer** vertexBuffer,
00123         _Out_ ID3D11Buffer** indexBuffer,
00124         _Out_opt_ uint32* vertexCount,
00125         _Out_opt_ uint32* indexCount
00126         );
00127
00128     concurrency::task<void> LoadMeshAsync(
00129         _In_ Platform::String^ filename,
00130         _Out_ ID3D11Buffer** vertexBuffer,
00131         _Out_ ID3D11Buffer** indexBuffer,
00132         _Out_opt_ uint32* vertexCount,
00133         _Out_opt_ uint32* indexCount
00134         );
00135
00136 private:
00137     Microsoft::WRL::ComPtr<ID3D11Device> m_d3dDevice;
00138     Microsoft::WRL::ComPtr<IWICImagingFactory2> m_wicFactory;
00139     BasicReaderWriter^ m_basicReaderWriter;
00140
00141     template <class DeviceChildType>
00142     inline void SetDebugName(
00143         _In_ DeviceChildType* object,
00144         _In_ Platform::String^ name
00145         );
00146
00147     Platform::String^ GetExtension(
00148         _In_ Platform::String^ filename
00149         );
00150
00151     void CreateTexture(
00152         _In_ bool decodeAsDDS,
00153         _In_reads_bytes_(dataSize) byte* data,
00154         _In_ uint32 dataSize,
00155         _Out_opt_ ID3D11Texture2D** texture,
00156         _Out_opt_ ID3D11ShaderResourceView** textureView,
00157         _In_opt_ Platform::String^ debugName
00158         );
00159
00160     void CreateInputLayout(
00161         _In_reads_bytes_(bytecodeSize) byte* bytecode,
00162         _In_ uint32 bytecodeSize,
00163         _In_reads_opt_(layoutDescNumElements) D3D11_INPUT_ELEMENT_DESC* layoutDesc,
00164         _In_ uint32 layoutDescNumElements,
00165         _Out_ ID3D11InputLayout** layout
00166         );
00167
00168     void CreateMesh(
00169         _In_ byte* meshData,
00170         _Out_ ID3D11Buffer** vertexBuffer,
00171         _Out_ ID3D11Buffer** indexBuffer,
00172         _Out_opt_ uint32* vertexCount,
00173         _Out_opt_ uint32* indexCount,
00174         _In_opt_ Platform::String^ debugName
00175         );
00176 };
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonClearNotifications_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/pch.h Source File

  • LibraryManagement
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/SoundEffect.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

SoundEffect.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SoundEffect.h"
00014
00015 SoundEffect::SoundEffect() :
00016     m_audioAvailable(false)
00017 {
00018 }
00019
00020 void SoundEffect::Initialize(
00021     _In_ IXAudio2* masteringEngine,
00022     _In_ WAVEFORMATEX* sourceFormat,
00023     _In_ std::vector<byte> const& soundData)
00024 {
00025     m_soundData = soundData;
00026
00027     if (masteringEngine == nullptr)
00028     {
00029         // Audio is not available so just return.
00030         m_audioAvailable = false;
00031         return;
00032     }
00033
00034     // Create a source voice for this sound effect.
00035     winrt::check_hresult(
00036         masteringEngine->CreateSourceVoice(
00037             &m_sourceVoice,
00038             sourceFormat
00039             )
00040         );
00041     m_audioAvailable = true;
00042 }
00043
00044 void SoundEffect::PlaySound(_In_ float volume)
00045 {
00046     XAUDIO2_BUFFER buffer = { 0 };
00047
00048     if (!m_audioAvailable)
00049     {
00050         // Audio is not available so just return.
00051         return;
00052     }
00053
00054     // Interrupt sound effect if it is currently playing.
00055     winrt::check_hresult(
00056         m_sourceVoice->Stop()
00057         );
00058     winrt::check_hresult(
00059         m_sourceVoice->FlushSourceBuffers()
00060         );
00061
00062     // Queue the memory buffer for playback and start the voice.
00063     buffer.AudioBytes = (UINT32)m_soundData.size();
00064     buffer.pAudioData = m_soundData.data();
00065     buffer.Flags = XAUDIO2_END_OF_STREAM;
00066
00067     winrt::check_hresult(
00068         m_sourceVoice->SetVolume(volume)
00069         );
00070     winrt::check_hresult(
00071         m_sourceVoice->SubmitSourceBuffer(&buffer)
00072         );
00073     winrt::check_hresult(
00074         m_sourceVoice->Start()
00075         );
00076 }
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Project.idl Source File

  • FullScreenMode
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_Basic : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_Basic();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_Launch : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_Launch();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.h Source File

  • ProximitySensor
  • cpp

Scenario4_BackgroundProximitySensor.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4_BackgroundProximitySensor.xaml.h
00014 // Declaration of the Scenario4_BackgroundProximitySesnsor class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario4_BackgroundProximitySensor.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     static Platform::String^ SampleBackgroundTaskName = "ProximitySensorBackgroundTask";
00026     static Platform::String^ SampleBackgroundTaskEntryPoint = "Tasks.ProximitySensorBackgroundTask";
00027
00028   [Windows::Foundation::Metadata::WebHostHidden]
00029   public ref class Scenario4_BackgroundProximitySensor sealed
00030   {
00031   public:
00032     Scenario4_BackgroundProximitySensor();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037     private:
00038         SDKTemplate::MainPage^ rootPage;
00039         Windows::Devices::Enumeration::DeviceWatcher^ watcher;
00040         Windows::Devices::Sensors::ProximitySensor^ sensor;
00041         bool backgroundTaskRegistered;
00042
00043         void OnProximitySensorAdded(Windows::Devices::Enumeration::DeviceWatcher^ sender, Windows::Devices::Enumeration::DeviceInformation^ device);
00044         void ScenarioRegisterTask_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00045         void ScenarioUnregisterTask_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00047         void RegisterBackgroundTask();
00048         void UpdateUIAsync(Platform::String^ status);
00049   };
00050 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameRenderer.h Source File

  • Simple3DGameDX
  • cppwinrt

GameRenderer.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // GameRenderer:
00015 // This is the renderer for the game.
00016 // It is responsble for creating and maintaining all the D3D11 and D2D objects
00017 // used to generate the game visuals. It maintains a reference to the Simple3DGame
00018 // object to retrieve the list of objects to render as well as status of the
00019 // game for the Heads Up Display (HUD).
00020 //
00021 // The renderer is designed to use a standard vertex layout across all objects. This
00022 // simplifies the shader design and allows for easy changes between shaders independent
00023 // of the objects' geometry. Each vertex is defined by a position, a normal and one set of
00024 // 2D texture coordinates. The shaders all expect one 2D texture and 4 constant buffers:
00025 //     m_constantBufferNeverChanges - general parameters that are set only once. This includes
00026 //         all the lights used in scene generation.
00027 //     m_constantBufferChangeOnResize - the projection matrix. It is typically only changed when
00028 //         the window is resized, however it will be changed 2x per frame when rendering
00029 //         in 3D stereo.
00030 //     m_constantBufferChangesEveryFrame - the view transformation matrix. This is set once per frame.
00031 //     m_constantBufferChangesEveryPrim - the parameters for each object. It includes the object to world
00032 //         transformation matrix as well as material properties like color and specular exponent for lighting
00033 //         calculations.
00034 //
00035 // The renderer also maintains a set of texture resources that will be associated with particular game objects.
00036 // It knows which textures are to be associated with which objects and will do that association once the
00037 // textures have been loaded.
00038 //
00039 // The renderer provides a set of methods to allow for a "standard" sequence to be executed for loading general
00040 // game resources and for level specific resources. Because D3D11 allows free threaded creation of objects,
00041 // textures will be loaded asynchronously and in parallel, however D3D11 does not allow for multiple threads to
00042 // be using the DeviceContext at the same time.
00043 //
00044 // Use co_await with IAsyncAction to perform a sequence of asynchronous operations in the same thread context.
00045
00046 #include "GameHud.h"
00047 #include "GameInfoOverlay.h"
00048 #include "GameUIConstants.h"
00049
00050 class GameRenderer : public std::enable_shared_from_this<GameRenderer>
00051 {
00052 public:
00053     GameRenderer(std::shared_ptr<DX::DeviceResources> const& deviceResources);
00054
00055     void CreateDeviceDependentResources();
00056     void CreateWindowSizeDependentResources();
00057     void ReleaseDeviceDependentResources();
00058     void Render();
00059
00060     winrt::Windows::Foundation::IAsyncAction CreateGameDeviceResourcesAsync(_In_ std::shared_ptr<Simple3DGame> game);
00061     void FinalizeCreateGameDeviceResources();
00062     winrt::Windows::Foundation::IAsyncAction LoadLevelResourcesAsync();
00063     void FinalizeLoadLevelResources();
00064
00065     Simple3DGameDX::IGameUIControl* GameUIControl() { return &m_gameInfoOverlay; };
00066
00067     DirectX::XMFLOAT2 GameInfoOverlayUpperLeft()
00068     {
00069         return DirectX::XMFLOAT2(m_gameInfoOverlayRect.left, m_gameInfoOverlayRect.top);
00070     };
00071     DirectX::XMFLOAT2 GameInfoOverlayLowerRight()
00072     {
00073         return DirectX::XMFLOAT2(m_gameInfoOverlayRect.right, m_gameInfoOverlayRect.bottom);
00074     };
00075     bool GameInfoOverlayVisible() { return m_gameInfoOverlay.Visible(); }
00076
00077 #if defined(_DEBUG)
00078     void ReportLiveDeviceObjects();
00079 #endif
00080
00081 private:
00082     // Cached pointer to device resources.
00083     std::shared_ptr<DX::DeviceResources>        m_deviceResources;
00084
00085     bool                                        m_initialized;
00086     bool                                        m_gameResourcesLoaded;
00087     bool                                        m_levelResourcesLoaded;
00088     GameInfoOverlay                             m_gameInfoOverlay;
00089     GameHud                                     m_gameHud;
00090     std::shared_ptr<Simple3DGame>               m_game;
00091     D2D_RECT_F                                  m_gameInfoOverlayRect;
00092     D2D_SIZE_F                                  m_gameInfoOverlaySize;
00093
00094     winrt::com_ptr<ID3D11ShaderResourceView>    m_sphereTexture;
00095     winrt::com_ptr<ID3D11ShaderResourceView>    m_cylinderTexture;
00096     winrt::com_ptr<ID3D11ShaderResourceView>    m_ceilingTexture;
00097     winrt::com_ptr<ID3D11ShaderResourceView>    m_floorTexture;
00098     winrt::com_ptr<ID3D11ShaderResourceView>    m_wallsTexture;
00099
00100     // Constant Buffers
00101     winrt::com_ptr<ID3D11Buffer>                m_constantBufferNeverChanges;
00102     winrt::com_ptr<ID3D11Buffer>                m_constantBufferChangeOnResize;
00103     winrt::com_ptr<ID3D11Buffer>                m_constantBufferChangesEveryFrame;
00104     winrt::com_ptr<ID3D11Buffer>                m_constantBufferChangesEveryPrim;
00105     winrt::com_ptr<ID3D11SamplerState>          m_samplerLinear;
00106     winrt::com_ptr<ID3D11VertexShader>          m_vertexShader;
00107     winrt::com_ptr<ID3D11VertexShader>          m_vertexShaderFlat;
00108     winrt::com_ptr<ID3D11PixelShader>           m_pixelShader;
00109     winrt::com_ptr<ID3D11PixelShader>           m_pixelShaderFlat;
00110     winrt::com_ptr<ID3D11InputLayout>           m_vertexLayout;
00111 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/TargetTexture.cpp Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

TargetTexture.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "TargetTexture.h"
00014
00015 TargetTexture::TargetTexture(
00016     _In_ winrt::com_ptr<ID3D11Device3> d3dDevice,
00017     _In_ ID2D1Factory1* d2dFactory,
00018     _In_ IDWriteFactory1* dwriteFactory,
00019     _In_ ID2D1DeviceContext* d2dContext
00020     ) :
00021     m_d3dDevice(std::move(d3dDevice))
00022 {
00023     m_d2dFactory.copy_from(d2dFactory);
00024     m_dwriteFactory.copy_from(dwriteFactory);
00025     m_d2dContext.copy_from(d2dContext);
00026
00027     winrt::check_hresult(
00028         m_d2dContext->CreateSolidColorBrush(
00029             D2D1::ColorF(D2D1::ColorF::Red, 1.f),
00030             m_redBrush.put()
00031             )
00032         );
00033
00034     winrt::check_hresult(
00035         m_d2dContext->CreateSolidColorBrush(
00036             D2D1::ColorF(D2D1::ColorF::CornflowerBlue, 1.0f),
00037             m_blueBrush.put()
00038             )
00039         );
00040
00041     winrt::check_hresult(
00042         m_d2dContext->CreateSolidColorBrush(
00043             D2D1::ColorF(D2D1::ColorF::Green, 1.f),
00044             m_greenBrush.put()
00045             )
00046         );
00047
00048     winrt::check_hresult(
00049         m_d2dContext->CreateSolidColorBrush(
00050             D2D1::ColorF(D2D1::ColorF::White, 1.f),
00051             m_whiteBrush.put()
00052             )
00053         );
00054
00055     winrt::check_hresult(
00056         m_d2dContext->CreateSolidColorBrush(
00057             D2D1::ColorF(D2D1::ColorF::Black, 1.f),
00058             m_blackBrush.put()
00059             )
00060         );
00061
00062     winrt::check_hresult(
00063         m_d2dContext->CreateSolidColorBrush(
00064             D2D1::ColorF(D2D1::ColorF::Yellow, 1.f),
00065             m_yellowBrush.put()
00066             )
00067         );
00068
00069     winrt::check_hresult(
00070         m_d2dContext->CreateSolidColorBrush(
00071             D2D1::ColorF(D2D1::ColorF::White, 0.0f),
00072             m_clearBrush.put()
00073             )
00074         );
00075
00076     winrt::check_hresult(
00077         m_d2dFactory->CreateEllipseGeometry(
00078             D2D1::Ellipse(
00079                 D2D1::Point2F(256.0f, 256.0f),
00080                 50.0f,
00081                 50.0f
00082                 ),
00083             m_circleGeometry1.put()
00084             )
00085         );
00086
00087     winrt::check_hresult(
00088         m_d2dFactory->CreateEllipseGeometry(
00089             D2D1::Ellipse(
00090                 D2D1::Point2F(256.0f, 256.0f),
00091                 100.0f,
00092                 100.0f
00093                 ),
00094             m_circleGeometry2.put()
00095             )
00096         );
00097
00098     winrt::check_hresult(
00099         m_d2dFactory->CreateEllipseGeometry(
00100             D2D1::Ellipse(
00101                 D2D1::Point2F(256.0f, 256.0f),
00102                 150.0f,
00103                 150.0f
00104                 ),
00105             m_circleGeometry3.put()
00106             )
00107         );
00108
00109     winrt::check_hresult(
00110         m_d2dFactory->CreateEllipseGeometry(
00111             D2D1::Ellipse(
00112                 D2D1::Point2F(256.0f, 256.0f),
00113                 200.0f,
00114                 200.0f
00115                 ),
00116             m_circleGeometry4.put()
00117             )
00118         );
00119
00120     winrt::check_hresult(
00121         m_d2dFactory->CreateEllipseGeometry(
00122             D2D1::Ellipse(
00123                 D2D1::Point2F(256.0f, 256.0f),
00124                 250.0f,
00125                 250.0f
00126                 ),
00127             m_circleGeometry5.put()
00128             )
00129         );
00130
00131     winrt::check_hresult(
00132         m_dwriteFactory->CreateTextFormat(
00133             L"Segoe UI",
00134             nullptr,
00135             DWRITE_FONT_WEIGHT_LIGHT,
00136             DWRITE_FONT_STYLE_NORMAL,
00137             DWRITE_FONT_STRETCH_NORMAL,
00138             425,        // fontsize
00139             L"en-US",   // locale
00140             m_textFormat.put()
00141             )
00142         );
00143
00144     // Center the text horizontally.
00145     winrt::check_hresult(
00146         m_textFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER)
00147         );
00148
00149     // Center the text vertically.
00150     winrt::check_hresult(
00151         m_textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER)
00152         );
00153 }
00154
00155 void TargetTexture::CreateTextureResourceView(
00156     _In_ winrt::hstring const& name,
00157     _Out_ ID3D11ShaderResourceView** textureResourceView
00158     )
00159 {
00160     // Allocate a offscreen D3D surface for D2D to render our 2D content into
00161     D3D11_TEXTURE2D_DESC texDesc;
00162     texDesc.ArraySize = 1;
00163     texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
00164     texDesc.CPUAccessFlags = 0;
00165     texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
00166     texDesc.Height = 512;
00167     texDesc.Width = 512;
00168     texDesc.MipLevels = 1;
00169     texDesc.MiscFlags = 0;
00170     texDesc.SampleDesc.Count = 1;
00171     texDesc.SampleDesc.Quality = 0;
00172     texDesc.Usage = D3D11_USAGE_DEFAULT;
00173
00174     winrt::com_ptr<ID3D11Texture2D> offscreenTexture;
00175     winrt::check_hresult(
00176         m_d3dDevice->CreateTexture2D(&texDesc, nullptr, offscreenTexture.put())
00177         );
00178
00179     // Convert the Direct2D texture into a Shader Resource View
00180     winrt::com_ptr<ID3D11ShaderResourceView> texture;
00181     winrt::check_hresult(
00182         m_d3dDevice->CreateShaderResourceView(offscreenTexture.get(), nullptr, texture.put())
00183         );
00184 #if defined(_DEBUG)
00185     {
00186         char debugName[100];
00187         int l = sprintf_s(debugName, sizeof(debugName) / sizeof(debugName[0]), "Simple3DGame Target %ls", name.c_str());
00188         winrt::check_hresult(
00189             texture->SetPrivateData(WKPDID_D3DDebugObjectName, l, debugName)
00190             );
00191     }
00192 #endif
00193
00194     winrt::com_ptr<IDXGISurface> dxgiSurface;
00195     dxgiSurface = offscreenTexture.as<IDXGISurface>();
00196
00197     // Create a D2D render target which can draw into our offscreen D3D
00198     // surface. Given that we use a constant size for the texture, we
00199     // fix the DPI at 96.
00200
00201     D2D1_BITMAP_PROPERTIES1 properties;
00202     properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
00203     properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
00204     properties.dpiX = 96;
00205     properties.dpiY = 96;
00206     properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
00207     properties.colorContext = nullptr;
00208
00209     winrt::com_ptr<ID2D1Bitmap1> renderTarget;
00210     winrt::check_hresult(
00211         m_d2dContext->CreateBitmapFromDxgiSurface(
00212             dxgiSurface.get(),
00213             &properties,
00214             renderTarget.put()
00215             )
00216         );
00217
00218     m_d2dContext->SetTarget(renderTarget.get());
00219     float saveDpiX;
00220     float saveDpiY;
00221
00222     m_d2dContext->GetDpi(&saveDpiX, &saveDpiY);
00223     m_d2dContext->SetDpi(96.0f, 96.0f);
00224
00225     m_d2dContext->BeginDraw();
00226     m_d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00227
00228     D2D1_SIZE_F renderTargetSize = renderTarget->GetSize();
00229
00230     m_d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::White));
00231     m_d2dContext->FillGeometry(m_circleGeometry5.get(), m_redBrush.get());
00232     m_d2dContext->FillGeometry(m_circleGeometry4.get(), m_blueBrush.get());
00233     m_d2dContext->FillGeometry(m_circleGeometry3.get(), m_greenBrush.get());
00234     m_d2dContext->FillGeometry(m_circleGeometry2.get(), m_yellowBrush.get());
00235     m_d2dContext->FillGeometry(m_circleGeometry1.get(), m_blackBrush.get());
00236     m_d2dContext->DrawText(
00237         name.c_str(),
00238         name.size(),
00239         m_textFormat.get(),
00240         D2D1::RectF(0, 0, renderTargetSize.width, renderTargetSize.height),
00241         m_whiteBrush.get()
00242         );
00243
00244     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00245     // is lost. It will be handled during the next call to Present.
00246     HRESULT hr = m_d2dContext->EndDraw();
00247     if (hr != D2DERR_RECREATE_TARGET)
00248     {
00249         winrt::check_hresult(hr);
00250     }
00251
00252     m_d2dContext->SetTarget(nullptr);
00253     m_d2dContext->SetDpi(saveDpiX, saveDpiY);
00254
00255     *textureResourceView = texture.detach();
00256 }
00257
00258 void TargetTexture::CreateHitTextureResourceView(
00259     _In_ winrt::hstring const& name,
00260     _Out_ ID3D11ShaderResourceView** textureResourceView
00261     )
00262 {
00263     // Allocate a offscreen D3D surface for D2D to render our 2D content into
00264     D3D11_TEXTURE2D_DESC texDesc;
00265     texDesc.ArraySize = 1;
00266     texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
00267     texDesc.CPUAccessFlags = 0;
00268     texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
00269     texDesc.Height = 512;
00270     texDesc.Width = 512;
00271     texDesc.MipLevels = 1;
00272     texDesc.MiscFlags = 0;
00273     texDesc.SampleDesc.Count = 1;
00274     texDesc.SampleDesc.Quality = 0;
00275     texDesc.Usage = D3D11_USAGE_DEFAULT;
00276
00277     winrt::com_ptr<ID3D11Texture2D> offscreenTexture;
00278     winrt::check_hresult(
00279         m_d3dDevice->CreateTexture2D(&texDesc, nullptr, offscreenTexture.put())
00280         );
00281
00282     // Convert the Direct2D texture into a Shader Resource View
00283     winrt::com_ptr<ID3D11ShaderResourceView> texture;
00284     winrt::check_hresult(
00285         m_d3dDevice->CreateShaderResourceView(offscreenTexture.get(), nullptr, texture.put())
00286         );
00287 #if defined(_DEBUG)
00288     {
00289         char debugName[100];
00290         int l = sprintf_s(debugName, sizeof(debugName) / sizeof(debugName[0]), "Simple3DGame HitTarget %ls", name.c_str());
00291         winrt::check_hresult(
00292             texture->SetPrivateData(WKPDID_D3DDebugObjectName, l, debugName)
00293             );
00294     }
00295 #endif
00296
00297     winrt::com_ptr<IDXGISurface> dxgiSurface;
00298     dxgiSurface = offscreenTexture.as<IDXGISurface>();
00299
00300     // Create a D2D render target which can draw into our offscreen D3D
00301     // surface. Given that we use a constant size for the texture, we
00302     // fix the DPI at 96.
00303
00304     D2D1_BITMAP_PROPERTIES1 properties;
00305     properties.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
00306     properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
00307     properties.dpiX = 96;
00308     properties.dpiY = 96;
00309     properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
00310     properties.colorContext = nullptr;
00311
00312     winrt::com_ptr<ID2D1Bitmap1> renderTarget;
00313     winrt::check_hresult(
00314         m_d2dContext->CreateBitmapFromDxgiSurface(
00315             dxgiSurface.get(),
00316             &properties,
00317             renderTarget.put()
00318             )
00319         );
00320
00321     m_d2dContext->SetTarget(renderTarget.get());
00322     float saveDpiX;
00323     float saveDpiY;
00324
00325     m_d2dContext->GetDpi(&saveDpiX, &saveDpiY);
00326     m_d2dContext->SetDpi(96.0f, 96.0f);
00327
00328     m_d2dContext->BeginDraw();
00329     m_d2dContext->SetTransform(D2D1::Matrix3x2F::Identity());
00330
00331     D2D1_SIZE_F renderTargetSize = renderTarget->GetSize();
00332
00333     m_d2dContext->Clear(D2D1::ColorF(D2D1::ColorF::Black));
00334     m_d2dContext->FillGeometry(m_circleGeometry5.get(), m_yellowBrush.get());
00335     m_d2dContext->FillGeometry(m_circleGeometry4.get(), m_greenBrush.get());
00336     m_d2dContext->FillGeometry(m_circleGeometry3.get(), m_blueBrush.get());
00337     m_d2dContext->FillGeometry(m_circleGeometry2.get(), m_redBrush.get());
00338     m_d2dContext->FillGeometry(m_circleGeometry1.get(), m_whiteBrush.get());
00339     m_d2dContext->DrawText(
00340         name.c_str(),
00341         name.size(),
00342         m_textFormat.get(),
00343         D2D1::RectF(0, 0, renderTargetSize.width, renderTargetSize.height),
00344         m_blackBrush.get()
00345         );
00346
00347     // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00348     // is lost. It will be handled during the next call to Present.
00349     HRESULT hr = m_d2dContext->EndDraw();
00350     if (hr != D2DERR_RECREATE_TARGET)
00351     {
00352         winrt::check_hresult(hr);
00353     }
00354
00355     m_d2dContext->SetTarget(nullptr);
00356     m_d2dContext->SetDpi(saveDpiX, saveDpiY);
00357
00358     *textureResourceView = texture.detach();
00359 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_CreateTile Member List

This is the complete list of members for Scenario1_CreateTile, including all inherited members.
CreateSecondaryTile() | Scenario1_CreateTile | [inline, private]
GenerateTileId() | Scenario1_CreateTile | [inline, private]
GetFromFile() | Scenario1_CreateTile | [inline, private]
GetFromPackage() | Scenario1_CreateTile | [inline, private]
glbName | Scenario1_CreateTile | [private]
glbUri | Scenario1_CreateTile | [private]
lastFileName | Scenario1_CreateTile | [private]
lastFileUri | Scenario1_CreateTile | [private]
ParseFloatOrDefault(string input) | Scenario1_CreateTile | [inline, private]
PickFile() | Scenario1_CreateTile | [inline, private]
rootPage | Scenario1_CreateTile | [private]
Scenario1_CreateTile() | Scenario1_CreateTile | [inline]
UpdateSourceRun() | Scenario1_CreateTile | [inline, private]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cs/SampleConfiguration.cs Source File

  • AnimationMetrics
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Animation metrics C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Retrieving Animation Metrics", ClassType=typeof(Scenario1_Metrics)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/DesfireCommand.cs Source File

  • Nfc
  • PcscSdk

DesfireCommand.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace Desfire
00013 {
00014     /// <summary>
00015     /// Class DesfireCommand extends the Iso7816.ApduCommand and provides
00016     /// mappings to Iso7816 command fields
00017     /// </summary>
00018     public class DesfireCommand : Iso7816.ApduCommand
00019     {
00020         public byte Command
00021         {
00022             set { base.INS = value; }
00023             get { return base.INS; }
00024         }
00025         public byte[] Data
00026         {
00027             set { base.CommandData = value; }
00028             get { return base.CommandData; }
00029         }
00030         public enum CommandType : byte
00031         {
00032             GetVersion = 0x60,
00033             GetAdditionalFrame = 0xAF,
00034             SelectApplication = 0x5A,
00035             ReadData = 0xBD,
00036             ReadRecord = 0xBB
00037         };
00038
00039         public DesfireCommand()
00040             : base((byte)Iso7816.Cla.ProprietaryCla9x, 0, 0, 0, null, 0)
00041         {
00042             ApduResponseType = typeof(Desfire.DesfireResponse);
00043         }
00044         public DesfireCommand(CommandType cmd, byte[] data)
00045             : base((byte)Iso7816.Cla.ProprietaryCla9x, (byte)cmd, 0x00, 0x00, data, 0x00)
00046         {
00047             ApduResponseType = typeof(Desfire.DesfireResponse);
00048         }
00049     }
00050     /// <summary>
00051     /// Class DesfireResponse extends the Iso7816.ApduResponse.
00052     /// </summary>
00053     public class DesfireResponse : Iso7816.ApduResponse
00054     {
00055         public DesfireResponse()
00056             : base()
00057         { }
00058         public override string SWTranslation
00059         {
00060             get
00061             {
00062                 if (SW1 != 0x91)
00063                 {
00064                     return "Unknown";
00065                 }
00066                 switch (SW2)
00067                 {
00068                     case 0x00:
00069                         return "Success";
00070
00071                     case 0xAF:
00072                         return "Additional frames expected";
00073
00074                     default:
00075                         return "Unknown";
00076                 }
00077             }
00078         }
00079         public override bool Succeeded
00080         {
00081             get
00082             {
00083                 return SW == 0x9100;
00084             }
00085         }
00086         public bool SubsequentFrame
00087         {
00088             get
00089             {
00090                 return SW == 0x91AF;
00091             }
00092         }
00093         public bool BoundaryError
00094         {
00095             get
00096             {
00097                 return SW == 0x91BE;
00098             }
00099         }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Prefs Member List

This is the complete list of members for Scenario1_Prefs, including all inherited members.
Scenario1_Prefs() | Scenario1_Prefs
ShowResults_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Prefs
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/DocumentPresenter.h Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

DocumentPresenter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     public ref class DocumentPresenter sealed
00018     {
00019     public:
00020         DocumentPresenter(
00021             Platform::String^ text,
00022             Platform::String^ downloadableFontName,
00023             Platform::String^ languageTag,
00024             Windows::UI::Color textColor,
00025             Windows::UI::Color textBackgroundColor,
00026             Windows::UI::Xaml::Controls::Image^ imageTarget
00027         );
00028
00029         virtual ~DocumentPresenter();
00030
00031         void SetLayoutWidth(float width);
00032
00033     private:
00034         Platform::String^                                                   m_downloadableFontName; // Storing the requested font so we can later check whether it's the one actually used in the layout.
00035         Windows::UI::Color                                                  m_textColor;
00036         Windows::UI::Color                                                  m_textBackgroundColor;
00037         DWriteTextLayoutCloudFontImplementation::TextLayout^                m_textLayout;
00038         DWriteTextLayoutCloudFontImplementation::TextLayoutImageSource^     m_textLayoutImageSource;
00039         Windows::UI::Xaml::Controls::Image^                                 m_imageTarget; // The control in the owner page that will use the surface image source as its source.
00040         DWriteTextLayoutCloudFontImplementation::FontDownloadListener^      m_fontDownloadListener;
00041         float                                                               m_dpi = 96.0f;
00042         Windows::Graphics::Display::DisplayInformation^                     m_displayInformation;
00043         bool                                                                m_layoutUpdateInProgress = false;
00044
00045         Windows::Foundation::EventRegistrationToken                         m_downloadCompletedEventToken;
00046         Windows::Foundation::EventRegistrationToken                         m_dpiChangedEventToken;
00047         Windows::Foundation::EventRegistrationToken                         m_visibilityChangedEventToken;
00048
00049         void PresentTextLayout();
00050         void RequestTextLayoutUpdate();
00051         void UpdateStatus();
00052         void UpdateTextLayout();
00053
00054         void DisplayInformation_DpiChanged(Windows::Graphics::Display::DisplayInformation^ displayInformation, Platform::Object^ e);
00055         void FontDownloadListener_DownloadCompleted();
00056         void Window_VisibilityChanged(Platform::Object ^sender, Windows::UI::Core::VisibilityChangedEventArgs ^e);
00057     }; // class DocumentPresenter
00058
00059 } // namespace SDKTemplate
Generated on Fri Nov 15 2024 22:19:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LampDevice/cpp/Scenario1_GetLamp.xaml.cpp Source File

  • LampDevice
  • cpp

Scenario1_GetLamp.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_GetLamp.xaml.h"
00014 #include <sstream>
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace SDKTemplate;
00019 using namespace Windows::Devices;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Media::Capture;
00024 using namespace Windows::UI::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Controls::Primitives;
00028 using namespace Windows::UI::Xaml::Data;
00029 using namespace Windows::UI::Xaml::Input;
00030 using namespace Windows::UI::Xaml::Media;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 /// <summary>
00034 /// Initializes a new instance of the <see cref="Scenario1_GetLamp"/> class.
00035 /// </summary>
00036 Scenario1_GetLamp::Scenario1_GetLamp() : _rootPage(MainPage::Current)
00037 {
00038     InitializeComponent();
00039 }
00040
00041 /// <summary>
00042 /// Event handler for the OnNavigatedTo event. In this scenario, we want
00043 /// to get a lamp object for the lifetime of the page, so when we first
00044 /// navigate to the page, we Initialize a private lamp object
00045 /// </summary>
00046 /// <param name="e">Contains state information and event data associated with the event</param>
00047 void Scenario1_GetLamp::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00048 {
00049     _rootPage = MainPage::Current;
00050     Windows::UI::Xaml::Controls::Page::OnNavigatedTo(e);
00051 }
00052
00053 /// <summary>
00054 /// acquires Lamp instance by getting class selection string
00055 /// for Lamp devices, then selecting the first lamp device on
00056 /// the back of the device
00057 /// </summary>
00058 /// <param name="sender">Contains information regarding button that fired event</param>
00059 /// <param name="e">Contains state information and event data associated with the event</param>
00060 void Scenario1_GetLamp::InitLampBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00061 {
00062     LogStatusToOutputBoxAsync("Getting class selection string for lamp devices...");
00063
00064     // Returns class selection string for Lamp devices
00065     String^ selectorStr = Lights::Lamp::GetDeviceSelector();
00066     std::wstringstream ss;
00067     ss << "Lamp class selection string:\n " << selectorStr->Data();
00068     LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00069
00070     LogStatusToOutputBoxAsync("Finding all lamp devices...");
00071
00072     // Finds all devices based on lamp class selector string
00073     create_task(DeviceInformation::FindAllAsync(selectorStr))
00074         .then([this](DeviceInformationCollection^ devices)
00075     {
00076         std::wstringstream ss;
00077         ss << "Number of lamp devices found: " << devices->Size;
00078         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00079
00080         // Select the first lamp device found on the back of the device
00081         LogStatusToOutputBoxAsync("Selecting first lamp device found on back of the device");
00082         DeviceInformation^ deviceInfo = nullptr;
00083         for (auto device : devices)
00084         {
00085             if (device->EnclosureLocation != nullptr && device->EnclosureLocation->Panel == Windows::Devices::Enumeration::Panel::Back)
00086             {
00087                 deviceInfo = device;
00088             }
00089         }
00090         if (deviceInfo == nullptr)
00091         {
00092             LogStatusAsync("Error: No lamp device was found", NotifyType::ErrorMessage);
00093             return;
00094         }
00095
00096         ss.str(std::wstring());
00097         ss << "Acquiring Lamp instance from Id:\n " << deviceInfo->Id->Data();
00098         LogStatusToOutputBoxAsync(ref new String(ss.str().c_str()));
00099         create_task(Lights::Lamp::FromIdAsync(deviceInfo->Id))
00100             .then([this](Lights::Lamp^ lamp)
00101         {
00102             std::wstringstream ss;
00103             ss << "Lamp instance acquired, Device Id:\n " << lamp->DeviceId->Data();
00104             LogStatusAsync(ref new String(ss.str().c_str()), NotifyType::StatusMessage);
00105
00106             // Here we must Dispose of the lamp object once we are no longer
00107             // using it to release any native resources
00108             LogStatusToOutputBoxAsync("Disposing of lamp instance");
00109             lamp = nullptr;
00110             LogStatusToOutputBoxAsync("Disposed");
00111         });
00112     });
00113 }
00114
00115 /// <summary>
00116 /// Gets the Default Lamp instance
00117 /// </summary>
00118 /// <param name="sender">Contains information regarding button that fired event</param>
00119 /// <param name="e">Contains state information and event data associated with the event</param>
00120 void Scenario1_GetLamp::GetDefaultAsyncBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00121 {
00122     LogStatusToOutputBoxAsync("Initializing lamp");
00123
00124     create_task(Lights::Lamp::GetDefaultAsync())
00125         .then([this](Lights::Lamp^ lamp)
00126     {
00127         if (lamp == nullptr)
00128         {
00129             LogStatusAsync("Error: No Lamp device found", NotifyType::ErrorMessage);
00130             return;
00131         }
00132
00133         std::wstringstream ss;
00134         ss << "Default lamp instance acquired, Device Id: " << lamp->DeviceId->Data();
00135         LogStatusAsync(ref new String(ss.str().c_str()), NotifyType::StatusMessage);
00136     });
00137 }
00138
00139 /// <summary>
00140 /// Marshall log message to the UI thread and update outputBox, this method is for more general messages
00141 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00142 /// which they were called without task chaining
00143 /// </summary>
00144 /// <param name="message">Message to log to the outputBox</param>
00145 task<void> Scenario1_GetLamp::LogStatusToOutputBoxAsync(String^ message)
00146 {
00147     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message]()
00148     {
00149         outputBox->Text += message + "\r\n";
00150         outputScrollViewer->ChangeView(0.0, outputBox->ActualHeight, 1.0f);
00151     })));
00152 }
00153
00154 /// <summary>
00155 /// Method to log Status to Main Status block, this method is for important status messages to be
00156 /// displayed at bottom of scenario page
00157 /// Note: This method is asynchronous and is not guaranteed to display messages in the order in
00158 /// which they were called without task chaining
00159 /// </summary>
00160 /// <param name="message">Message to log to the output box</param>
00161 /// <param name="type">Notification Type for status message</param>
00162 task<void> Scenario1_GetLamp::LogStatusAsync(String^ message, NotifyType type)
00163 {
00164     return create_task(Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type]()
00165     {
00166         _rootPage->NotifyUser(message, type);
00167     }))).then([this, message]()
00168     {
00169             return LogStatusToOutputBoxAsync(message);
00170     });
00171 }
Generated on Fri Nov 15 2024 22:20:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/pch.h Source File

  • BackgroundActivation
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include <vccorlib.h>
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include "App.g.h"
00018
00019 namespace SDKTemplate
00020 {
00021     partial ref class App
00022     {
00023         /// <summary>
00024         /// Override the Application OnBackgroundActivated method to handle background activation in
00025         /// the main process. This entry point is used when BackgroundTaskBuilder TaskEntryPoint is
00026         /// not set during background task registration.
00027         /// </summary>
00028         /// <param name="args"></param>
00029     protected:
00030         virtual void OnBackgroundActivated(Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^ args) override;
00031
00032     private:
00033         void Partial_Construct();
00034     };
00035 }
00036
00037 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/ComputeShader/App.h Source File

  • D2DCustomEffects
  • cpp
  • ComputeShader

App.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "DeviceResources.h"
00016 #include "CustomComputeShaderMain.h"
00017
00018 namespace CustomComputeShader
00019 {
00020     // Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
00021     ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
00022     {
00023     public:
00024         App();
00025
00026         // IFrameworkView Methods.
00027         virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
00028         virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
00029         virtual void Load(Platform::String^ entryPoint);
00030         virtual void Run();
00031         virtual void Uninitialize();
00032
00033     protected:
00034         // Application lifecycle event handlers.
00035         void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
00036         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
00037         void OnResuming(Platform::Object^ sender, Platform::Object^ args);
00038
00039         // Window event handlers.
00040         void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
00041         void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
00042         void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
00043
00044         // DisplayInformation event handlers.
00045         void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
00046         void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
00047         void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
00048
00049     private:
00050         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00051         std::unique_ptr<CustomComputeShaderMain> m_main;
00052         bool m_windowClosed;
00053         bool m_windowVisible;
00054     };
00055 }
00056
00057 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
00058 {
00059 public:
00060     virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
00061 };
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario2_Lang.xaml.cpp Source File

  • GlobalizationPreferences
  • cpp

Scenario2_Lang.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario2_Lang.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020
00021 Scenario2_Lang::Scenario2_Lang()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 String^ Scenario2_Lang::ReportLanguageData(Windows::Globalization::Language^ lang)
00027 {
00028     return "Display Name: " + lang->DisplayName + "\n" +
00029         "Language Tag: " + lang->LanguageTag + "\n" +
00030         "Native Name: " + lang->NativeName + "\n" +
00031         "Script Code: " + lang->Script + "\n\n";
00032
00033 }
00034 void Scenario2_Lang::ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00035 {
00036     // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
00037     // obtain the user's preferred language characteristics.
00038     String^ topUserLanguage = Windows::System::UserProfile::GlobalizationPreferences::Languages->GetAt(0);
00039     auto userLanguage = ref new Windows::Globalization::Language(topUserLanguage);
00040
00041     // This obtains the language characteristics by providing a BCP47 tag.
00042     auto exampleLanguage = ref new Windows::Globalization::Language("ja");
00043
00044     // Display the results
00045     OutputTextBlock->Text = "User's Preferred Language\n" + ReportLanguageData(userLanguage) +
00046         "Example Language by BCP47 tag (ja)\n" + ReportLanguageData(exampleLanguage);
00047 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Helpers Member List

This is the complete list of members for Helpers, including all inherited members.
CreateHeaderTextBlock(param::hstring const &contents) | Helpers | [static]
CreateLineItemTextBlock(param::hstring const &contents) | Helpers | [static]
DisplayResult(Windows::UI::Xaml::Controls::Image const &image, Windows::UI::Xaml::Controls::TextBlock const &textBlock, Windows::Storage::FileProperties::ThumbnailMode thumbnailMode, uint32_t size, Windows::Storage::IStorageItem const &item, Windows::Storage::FileProperties::StorageItemThumbnail const &thumbnail, bool isGroup) | Helpers | [static]
PlaceholderImage() | Helpers | [static]
ResetOutput(MainPage const &rootPage, Windows::UI::Xaml::Controls::Image const &image, Windows::UI::Xaml::Controls::TextBlock const &output, Windows::UI::Xaml::Controls::TextBlock const &outputDetails=nullptr) | Helpers | [static]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario1.xaml.cpp Source File

  • DatagramSocket
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.cpp
00014 // Implementation of the Scenario1 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1.xaml.h"
00019
00020 using namespace SDKTemplate;
00021 using namespace SDKTemplate::DatagramSocketSample;
00022
00023 using namespace Platform;
00024 using namespace Concurrency;
00025 using namespace Platform::Collections;
00026 using namespace Windows::ApplicationModel::Core;
00027 using namespace Windows::Foundation;
00028 using namespace Windows::Networking;
00029 using namespace Windows::Networking::Connectivity;
00030 using namespace Windows::Networking::Sockets;
00031 using namespace Windows::Storage::Streams;
00032 using namespace Windows::UI::Core;
00033 using namespace Windows::UI::Xaml;
00034 using namespace Windows::UI::Xaml::Controls;
00035 using namespace Windows::UI::Xaml::Navigation;
00036
00037 Scenario1::Scenario1()
00038 {
00039     InitializeComponent();
00040     this->localHostItems = ref new Vector<LocalHostItem^>();
00041 }
00042
00043 /// <summary>
00044 /// Invoked when this page is about to be displayed in a Frame.
00045 /// </summary>
00046 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00047 /// property is typically used to configure the page.</param>
00048 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00049 {
00050     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00051     // as NotifyUser()
00052     rootPage = MainPage::Current;
00053     BindToAny->IsChecked = true;
00054     PopulateAdapterList();
00055 }
00056
00057 void Scenario1::BindToAny_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00058 {
00059     AdapterList->IsEnabled = false;
00060 }
00061
00062 void Scenario1::BindToAny_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00063 {
00064     AdapterList->IsEnabled = true;
00065 }
00066
00067 void Scenario1::StartListener_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00068 {
00069     if (CoreApplication::Properties->HasKey("listener"))
00070     {
00071         rootPage->NotifyUser(
00072             "This step has already been executed. Please move to the next one.",
00073             NotifyType::ErrorMessage);
00074         return;
00075     }
00076
00077     if (ServiceNameForListener->Text == nullptr)
00078     {
00079         rootPage->NotifyUser("Please provide a service name.", NotifyType::ErrorMessage);
00080         return;
00081     }
00082
00083     DatagramSocket^ listener = ref new DatagramSocket();
00084
00085     if (!InboundBufferSize->Text->IsEmpty())
00086     {
00087         int inboundBufferSize = 0;
00088         inboundBufferSize = _wtoi(InboundBufferSize->Text->Data());
00089         if (inboundBufferSize <= 0)
00090         {
00091             rootPage->NotifyUser("Please provide a positive numeric Inbound buffer size.", NotifyType::ErrorMessage);
00092             return;
00093         }
00094
00095         try
00096         {
00097             // Running both client and server on localhost will most likely not reach the buffer limit.
00098             // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
00099             listener->Control->InboundBufferSizeInBytes = inboundBufferSize;
00100         }
00101         catch (InvalidArgumentException^)
00102         {
00103             rootPage->NotifyUser("Please provide a valid Inbound buffer size.", NotifyType::ErrorMessage);
00104             return;
00105         }
00106     }
00107
00108     LocalHostItem^ selectedLocalHost = nullptr;
00109     if (BindToAddress->IsChecked->Value || BindToAdapter->IsChecked->Value)
00110     {
00111         selectedLocalHost = static_cast<LocalHostItem^>(AdapterList->SelectedItem);
00112         if (selectedLocalHost == nullptr)
00113         {
00114             rootPage->NotifyUser("Please select an address / adapter.", NotifyType::ErrorMessage);
00115             return;
00116         }
00117
00118         // The user selected an address. For demo purposes, we ensure that connect will be using the same address.
00119         CoreApplication::Properties->Insert("serverAddress", selectedLocalHost->LocalHost->CanonicalName);
00120     }
00121     else
00122     {
00123         // Clear up any previous serverAddress or adapter used by the client part of the demo.
00124         CoreApplication::Properties->Insert("serverAddress", nullptr);
00125     }
00126
00127     ListenerContext^ listenerContext = ref new ListenerContext(rootPage, listener);
00128     listener->MessageReceived += ref new TypedEventHandler<DatagramSocket^, DatagramSocketMessageReceivedEventArgs^>(
00129         listenerContext,
00130         &ListenerContext::OnMessage);
00131
00132     // Events cannot be hooked up directly to the ScenarioInput1 object, as the object can fall out-of-scope and be
00133     // deleted. This would render any event hooked up to the object ineffective. The ListenerContext guarantees that
00134     // both the socket and object that serves its events have the same lifetime.
00135     CoreApplication::Properties->Insert("listener", listenerContext);
00136
00137     if (BindToAny->IsChecked->Value)
00138     {
00139         // Don't limit traffic to an address or an adapter.
00140         create_task(listener->BindServiceNameAsync(ServiceNameForListener->Text)).then([this] (task<void> previousTask)
00141         {
00142             try
00143             {
00144                 // Try getting an exception.
00145                 previousTask.get();
00146                 rootPage->NotifyUser("Listening", NotifyType::StatusMessage);
00147             }
00148             catch (Exception^ exception)
00149             {
00150                 CoreApplication::Properties->Remove("listener");
00151                 rootPage->NotifyUser(
00152                     "Start listening failed with error: " + exception->Message,
00153                     NotifyType::ErrorMessage);
00154             }
00155         });
00156     }
00157     else if (BindToAddress->IsChecked->Value)
00158     {
00159         // Try to bind to a specific address.
00160         create_task(listener->BindEndpointAsync(selectedLocalHost->LocalHost, ServiceNameForListener->Text)).then(
00161             [this, selectedLocalHost] (task<void> previousTask)
00162         {
00163             try
00164             {
00165                 // Try getting an exception.
00166                 previousTask.get();
00167                 rootPage->NotifyUser(
00168                     "Listening on address " + selectedLocalHost->LocalHost->CanonicalName,
00169                     NotifyType::StatusMessage);
00170             }
00171             catch (Exception^ exception)
00172             {
00173                 CoreApplication::Properties->Remove("listener");
00174                 rootPage->NotifyUser(
00175                     "Start listening failed with error: " + exception->Message,
00176                     NotifyType::ErrorMessage);
00177             }
00178         });
00179     }
00180     else if (BindToAdapter->IsChecked->Value)
00181     {
00182         // Try to limit traffic to the selected adapter.
00183         // This option will be overridden by interfaces with weak-host or forwarding modes enabled.
00184         NetworkAdapter^ selectedAdapter = selectedLocalHost->LocalHost->IPInformation->NetworkAdapter;
00185
00186         create_task(listener->BindServiceNameAsync(
00187             ServiceNameForListener->Text,
00188             selectedAdapter)).then([this, selectedAdapter] (task<void> previousTask)
00189         {
00190             try
00191             {
00192                 // Try getting an exception.
00193                 previousTask.get();
00194                 rootPage->NotifyUser(
00195                     "Listening on adapter" + selectedAdapter->NetworkAdapterId,
00196                     NotifyType::StatusMessage);
00197             }
00198             catch (Exception^ exception)
00199             {
00200                 CoreApplication::Properties->Remove("listener");
00201                 rootPage->NotifyUser(
00202                     "Start listening failed with error: " + exception->Message,
00203                     NotifyType::ErrorMessage);
00204             }
00205         });
00206     }
00207 }
00208
00209 void Scenario1::PopulateAdapterList()
00210 {
00211     localHostItems->Clear();
00212     AdapterList->ItemsSource = localHostItems;
00213     AdapterList->DisplayMemberPath = "DisplayString";
00214
00215     for (HostName^ localHostInfo : NetworkInformation::GetHostNames())
00216     {
00217         if (localHostInfo->IPInformation != nullptr)
00218         {
00219             LocalHostItem^ adapterItem = ref new LocalHostItem(localHostInfo);
00220             localHostItems->Append(adapterItem);
00221         }
00222     }
00223 }
00224
00225 void ListenerContext::OnMessage(DatagramSocket^ socket, DatagramSocketMessageReceivedEventArgs^ eventArguments)
00226 {
00227     if (outputStream != nullptr)
00228     {
00229         EchoMessage(eventArguments);
00230         return;
00231     }
00232
00233     // We do not have an output stream yet so create one.
00234     create_task(socket->GetOutputStreamAsync(eventArguments->RemoteAddress, eventArguments->RemotePort)).then(
00235         [this, socket, eventArguments] (IOutputStream^ stream)
00236     {
00237         // It might happen that the OnMessage was invoked more than once before the GetOutputStreamAsync call
00238         // completed. In this case we will end up with multiple streams - just keep one of them.
00239         EnterCriticalSection(&lock);
00240
00241         if (outputStream == nullptr)
00242         {
00243             outputStream = stream;
00244             hostName = eventArguments->RemoteAddress;
00245             port = eventArguments->RemotePort;
00246         }
00247
00248         LeaveCriticalSection(&lock);
00249
00250         EchoMessage(eventArguments);
00251     }).then([this, socket, eventArguments] (task<void> previousTask)
00252     {
00253         try
00254         {
00255             // Try getting all exceptions from the continuation chain above this point.
00256             previousTask.get();
00257         }
00258         catch (Exception^ exception)
00259         {
00260             NotifyUserFromAsyncThread(
00261                 "Getting an output stream failed with error: " + exception->Message,
00262                 NotifyType::ErrorMessage);
00263         }
00264     });
00265 }
00266
00267 ListenerContext::ListenerContext(MainPage^ rootPage, DatagramSocket^ listener)
00268 {
00269     this->rootPage = rootPage;
00270     this->listener = listener;
00271     InitializeCriticalSectionEx(&lock, 0, 0);
00272 }
00273
00274 ListenerContext::~ListenerContext()
00275 {
00276     // A DatagramSocket can be closed in two ways:
00277     //  - explicitly: using the 'delete' keyword (listener is closed even if there are outstanding references to it).
00278     //  - implicitly: removing the last reference to it (i.e., falling out-of-scope).
00279     //
00280     // When a DatagramSocket is closed implicitly, it can take several seconds for the local UDP port being used
00281     // by it to be freed/reclaimed by the lower networking layers. During that time, other UDP sockets on the machine
00282     // will not be able to use the port. Thus, it is strongly recommended that DatagramSocket instances be explicitly
00283     // closed before they go out of scope(e.g., before application exit). The call below explicitly closes the socket.
00284     delete listener;
00285     listener = nullptr;
00286
00287     DeleteCriticalSection(&lock);
00288 }
00289
00290 void ListenerContext::EchoMessage(DatagramSocketMessageReceivedEventArgs^ eventArguments)
00291 {
00292     if (!IsMatching(eventArguments->RemoteAddress, eventArguments->RemotePort))
00293     {
00294         // In the sample we are communicating with just one peer. To communicate with multiple peers, an application
00295         // should cache output streams (e.g., by using a hash map), because creating an output stream for each
00296         // received datagram is costly. Keep in mind though, that every cache requires logic to remove old
00297         // or unused elements; otherwise, the cache will turn into a memory leaking structure.
00298         NotifyUserFromAsyncThread("Got datagram from " + eventArguments->RemoteAddress->DisplayName + ":" +
00299             eventArguments->RemotePort + ", but already 'connected' to " + hostName->DisplayName + ":" +
00300             port, NotifyType::ErrorMessage);
00301     }
00302
00303     create_task(outputStream->WriteAsync(eventArguments->GetDataReader()->DetachBuffer())).then(
00304         [this] (task<unsigned int> writeTask)
00305     {
00306         try
00307         {
00308             // Try getting an exception.
00309             writeTask.get();
00310         }
00311         catch (Exception^ exception)
00312         {
00313             NotifyUserFromAsyncThread(
00314                 "Echoing a message failed with error: " + exception->Message,
00315                 NotifyType::ErrorMessage);
00316         }
00317     });
00318 }
00319
00320 bool ListenerContext::IsMatching(HostName^ hostName, String^ port)
00321 {
00322     return (this->hostName == hostName && this->port == port);
00323 }
00324
00325 void ListenerContext::NotifyUserFromAsyncThread(String^ message, NotifyType type)
00326 {
00327     rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type] ()
00328     {
00329         rootPage->NotifyUser(message, type);
00330     }));
00331 }
00332
00333 LocalHostItem::LocalHostItem(HostName^ localHostName)
00334 {
00335     if (localHostName == nullptr)
00336     {
00337         throw ref new InvalidArgumentException("localHostName cannot be null");
00338     }
00339
00340     if (localHostName->IPInformation == nullptr)
00341     {
00342         throw ref new InvalidArgumentException("Adapter information not found");
00343     }
00344
00345     this->localHost = localHostName;
00346     this->displayString = "Address: " + localHostName->DisplayName +
00347         " Adapter: " + localHostName->IPInformation->NetworkAdapter->NetworkAdapterId;
00348 }
Generated on Fri Nov 15 2024 22:17:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario3_DeviceIO.xaml.cs Source File

  • CustomCapability
  • cs

Scenario3_DeviceIO.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Runtime.InteropServices.WindowsRuntime;
00014 using Windows.UI.Xaml;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class DeviceIO
00019     {
00020         MainPage rootPage = MainPage.Current;
00021
00022         public DeviceIO()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         private async void DeviceIOGet_Click(object sender, RoutedEventArgs e)
00028         {
00029             var fx2Device = DeviceList.Current.GetSelectedDevice();
00030
00031             if (fx2Device == null)
00032             {
00033                 rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
00034                 return;
00035             }
00036
00037             byte[] outputBuffer = new byte[1];
00038
00039             try
00040             {
00041                 await fx2Device.SendIOControlAsync(Fx2Driver.GetSevenSegmentDisplay,
00042                                                    null,
00043                                                    outputBuffer.AsBuffer());
00044
00045                 rootPage.NotifyUser($"The segment display value is {Fx2Driver.SevenSegmentToDigit(outputBuffer[0])}", NotifyType.StatusMessage);
00046             }
00047             catch (ArgumentException)
00048             {
00049                 rootPage.NotifyUser("The segment display value is not yet initialized", NotifyType.StatusMessage);
00050             }
00051             catch (Exception exception)
00052             {
00053                 rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
00054             }
00055         }
00056
00057
00058         private async void DeviceIOSet_Click(object sender, RoutedEventArgs e)
00059         {
00060             var fx2Device = DeviceList.Current.GetSelectedDevice();
00061
00062             if (fx2Device == null)
00063             {
00064                 rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage);
00065                 return;
00066             }
00067
00068             byte val = (byte)(DeviceIOSegmentInput.SelectedIndex + 1);
00069
00070             byte[] input = new byte[] { Fx2Driver.DigitToSevenSegment(val) };
00071
00072             try
00073             {
00074                 await fx2Device.SendIOControlAsync(
00075                                     Fx2Driver.SetSevenSegmentDisplay,
00076                                     input.AsBuffer(),
00077                                     null
00078                                     );
00079
00080                 rootPage.NotifyUser($"The segment display is set to {val}", NotifyType.StatusMessage);
00081             }
00082             catch (Exception exception)
00083             {
00084                 rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage);
00085             }
00086         }
00087     }
00088 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomEditControl/cs/CustomEditControl.xaml.cs Source File

  • CustomEditControl
  • cs

CustomEditControl.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Foundation;
00003 using Windows.Graphics.Display;
00004 using Windows.System;
00005 using Windows.UI.Core;
00006 using Windows.UI.Text.Core;
00007 using Windows.UI.ViewManagement;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Input;
00011 using Windows.UI.Xaml.Media;
00012
00013 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
00014
00015 namespace SDKTemplate
00016 {
00017     // This class implements a custom edit control that is entirely
00018     // standalone. It does not integrate with XAML focus. Instead,
00019     // it manages focus explicitly by tracking pointer activity.
00020     public sealed partial class CustomEditControl : UserControl
00021     {
00022         // The _editContext lets us communicate with the input system.
00023         CoreTextEditContext _editContext;
00024
00025         // We will use a plain text string to represent the
00026         // content of the custom text edit control.
00027         string _text = String.Empty;
00028
00029         // If the _selection starts and ends at the same point,
00030         // then it represents the location of the caret (insertion point).
00031         CoreTextRange _selection;
00032
00033         // _internalFocus keeps track of whether our control acts like it has focus.
00034         bool _internalFocus = false;
00035
00036         // If there is a nonempty selection, then _extendingLeft is true if the user
00037         // is using shift+arrow to adjust the starting point of the selection,
00038         // or false if the user is adjusting the ending point of the selection.
00039         bool _extendingLeft = false;
00040
00041         // The input pane object indicates the visibility of the on screen keyboard.
00042         // Apps can also ask the keyboard to show or hide.
00043         InputPane _inputPane;
00044
00045         // The CoreWindow that contains our control.
00046         CoreWindow _coreWindow;
00047
00048         public CustomEditControl()
00049         {
00050             this.InitializeComponent();
00051
00052             // The CoreTextEditContext processes text input, but other keys are
00053             // the apps's responsibility.
00054             _coreWindow = CoreWindow.GetForCurrentThread();
00055             _coreWindow.KeyDown += CoreWindow_KeyDown;
00056             _coreWindow.PointerPressed += CoreWindow_PointerPressed;
00057
00058             // Create a CoreTextEditContext for our custom edit control.
00059             CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
00060             _editContext = manager.CreateEditContext();
00061
00062             // Get the Input Pane so we can programmatically hide and show it.
00063             _inputPane = InputPane.GetForCurrentView();
00064
00065             // For demonstration purposes, this sample sets the Input Pane display policy to Manual
00066             // so that it can manually show the software keyboard when the control gains focus and
00067             // dismiss it when the control loses focus. If you leave the policy as Automatic, then
00068             // the system will hide and show the Input Pane for you. Note that on Desktop, you will
00069             // need to implement the UIA text pattern to get expected automatic behavior.
00070             _editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;
00071
00072             // Set the input scope to Text because this text box is for any text.
00073             // This also informs software keyboards to show their regular
00074             // text entry layout.  There are many other input scopes and each will
00075             // inform a keyboard layout and text behavior.
00076             _editContext.InputScope = CoreTextInputScope.Text;
00077
00078             // The system raises this event to request a specific range of text.
00079             _editContext.TextRequested += EditContext_TextRequested;
00080
00081             // The system raises this event to request the current selection.
00082             _editContext.SelectionRequested += EditContext_SelectionRequested;
00083
00084             // The system raises this event when it wants the edit control to remove focus.
00085             _editContext.FocusRemoved += EditContext_FocusRemoved;
00086
00087             // The system raises this event to update text in the edit control.
00088             _editContext.TextUpdating += EditContext_TextUpdating;
00089
00090             // The system raises this event to change the selection in the edit control.
00091             _editContext.SelectionUpdating += EditContext_SelectionUpdating;
00092
00093             // The system raises this event when it wants the edit control
00094             // to apply formatting on a range of text.
00095             _editContext.FormatUpdating += EditContext_FormatUpdating;
00096
00097             // The system raises this event to request layout information.
00098             // This is used to help choose a position for the IME candidate window.
00099             _editContext.LayoutRequested += EditContext_LayoutRequested;
00100
00101             // The system raises this event to notify the edit control
00102             // that the string composition has started.
00103             _editContext.CompositionStarted += EditContext_CompositionStarted;
00104
00105             // The system raises this event to notify the edit control
00106             // that the string composition is finished.
00107             _editContext.CompositionCompleted += EditContext_CompositionCompleted;
00108
00109             // The system raises this event when the NotifyFocusLeave operation has
00110             // completed. Our sample does not use this event.
00111             // _editContext.NotifyFocusLeaveCompleted += EditContext_NotifyFocusLeaveCompleted;
00112
00113             // Set our initial UI.
00114             UpdateTextUI();
00115             UpdateFocusUI();
00116         }
00117
00118         #region Focus management
00119         void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
00120         {
00121             // See whether the pointer is inside or outside the control.
00122             Rect contentRect = GetElementRect(BorderPanel);
00123             if (contentRect.Contains(args.CurrentPoint.Position))
00124             {
00125                 // The user tapped inside the control. Give it focus.
00126                 SetInternalFocus();
00127
00128                 // Tell XAML that this element has focus, so we don't have two
00129                 // focus elements. That is the extent of our integration with XAML focus.
00130                 Focus(FocusState.Programmatic);
00131
00132                 // A more complete custom control would move the caret to the
00133                 // pointer position. It would also provide some way to select
00134                 // text via touch. We do neither in this sample.
00135
00136             }
00137             else
00138             {
00139                 // The user tapped outside the control. Remove focus.
00140                 RemoveInternalFocus();
00141             }
00142         }
00143
00144         void SetInternalFocus()
00145         {
00146             if (!_internalFocus)
00147             {
00148                 // Update internal notion of focus.
00149                 _internalFocus = true;
00150
00151                 // Update the UI.
00152                 UpdateTextUI();
00153                 UpdateFocusUI();
00154
00155                 // Notify the CoreTextEditContext that the edit context has focus,
00156                 // so it should start processing text input.
00157                 _editContext.NotifyFocusEnter();
00158             }
00159
00160             // Ask the software keyboard to show.  The system will ultimately decide if it will show.
00161             // For example, it will not show if there is a keyboard attached.
00162             _inputPane.TryShow();
00163
00164         }
00165
00166         void RemoveInternalFocus()
00167         {
00168             if (_internalFocus)
00169             {
00170                 //Notify the system that this edit context is no longer in focus
00171                 _editContext.NotifyFocusLeave();
00172
00173                 RemoveInternalFocusWorker();
00174             }
00175         }
00176
00177         void RemoveInternalFocusWorker()
00178         {
00179             //Update the internal notion of focus
00180             _internalFocus = false;
00181
00182             // Ask the software keyboard to dismiss.
00183             _inputPane.TryHide();
00184
00185             // Update our UI.
00186             UpdateTextUI();
00187             UpdateFocusUI();
00188         }
00189
00190         void EditContext_FocusRemoved(CoreTextEditContext sender, object args)
00191         {
00192             RemoveInternalFocusWorker();
00193         }
00194
00195         void Element_Unloaded(object sender, RoutedEventArgs e)
00196         {
00197             _coreWindow.KeyDown -= CoreWindow_KeyDown;
00198             _coreWindow.PointerPressed -= CoreWindow_PointerPressed;
00199         }
00200         #endregion
00201
00202         #region Text management
00203         // Replace the text in the specified range.
00204         void ReplaceText(CoreTextRange modifiedRange, string text)
00205         {
00206             // Modify the internal text store.
00207             _text = _text.Substring(0, modifiedRange.StartCaretPosition) +
00208               text +
00209               _text.Substring(modifiedRange.EndCaretPosition);
00210
00211             // Move the caret to the end of the replacement text.
00212             _selection.StartCaretPosition = modifiedRange.StartCaretPosition + text.Length;
00213             _selection.EndCaretPosition = _selection.StartCaretPosition;
00214
00215             // Update the selection of the edit context.  There is no need to notify the system
00216             // of the selection change because we are going to call NotifyTextChanged soon.
00217             SetSelection(_selection);
00218
00219             // Let the CoreTextEditContext know what changed.
00220             _editContext.NotifyTextChanged(modifiedRange, text.Length, _selection);
00221         }
00222
00223         bool HasSelection()
00224         {
00225             return _selection.StartCaretPosition != _selection.EndCaretPosition;
00226         }
00227
00228         // Change the selection without notifying CoreTextEditContext of the new selection.
00229         void SetSelection(CoreTextRange selection)
00230         {
00231             // Modify the internal selection.
00232             _selection = selection;
00233
00234             //Update the UI to show the new selection.
00235             UpdateTextUI();
00236         }
00237
00238         // Change the selection and notify CoreTextEditContext of the new selection.
00239         void SetSelectionAndNotify(CoreTextRange selection)
00240         {
00241             SetSelection(selection);
00242             _editContext.NotifySelectionChanged(_selection);
00243         }
00244
00245         // Return the specified range of text. Note that the system may ask for more text
00246         // than exists in the text buffer.
00247         void EditContext_TextRequested(CoreTextEditContext sender, CoreTextTextRequestedEventArgs args)
00248         {
00249             CoreTextTextRequest request = args.Request;
00250             request.Text = _text.Substring(
00251                 request.Range.StartCaretPosition,
00252                 Math.Min(request.Range.EndCaretPosition, _text.Length) - request.Range.StartCaretPosition);
00253         }
00254
00255         // Return the current selection.
00256         void EditContext_SelectionRequested(CoreTextEditContext sender, CoreTextSelectionRequestedEventArgs args)
00257         {
00258             CoreTextSelectionRequest request = args.Request;
00259             request.Selection = _selection;
00260         }
00261
00262         void EditContext_TextUpdating(CoreTextEditContext sender, CoreTextTextUpdatingEventArgs args)
00263         {
00264             CoreTextRange range = args.Range;
00265             string newText = args.Text;
00266             CoreTextRange newSelection = args.NewSelection;
00267
00268             // Modify the internal text store.
00269             _text = _text.Substring(0, range.StartCaretPosition) +
00270                 newText +
00271                 _text.Substring(Math.Min(_text.Length, range.EndCaretPosition));
00272
00273             // You can set the proper font or direction for the updated text based on the language by checking
00274             // args.InputLanguage.  We will not do that in this sample.
00275
00276             // Modify the current selection.
00277             newSelection.EndCaretPosition = newSelection.StartCaretPosition;
00278
00279             // Update the selection of the edit context. There is no need to notify the system
00280             // because the system itself changed the selection.
00281             SetSelection(newSelection);
00282         }
00283
00284         void EditContext_SelectionUpdating(CoreTextEditContext sender, CoreTextSelectionUpdatingEventArgs args)
00285         {
00286             // Set the new selection to the value specified by the system.
00287             CoreTextRange range = args.Selection;
00288
00289             // Update the selection of the edit context. There is no need to notify the system
00290             // because the system itself changed the selection.
00291             SetSelection(range);
00292         }
00293         #endregion
00294
00295         #region Formatting and layout
00296         void EditContext_FormatUpdating(CoreTextEditContext sender, CoreTextFormatUpdatingEventArgs args)
00297         {
00298             // The following code specifies how you would apply any formatting to the specified range of text
00299             // For this sample, we do not make any changes to the format.
00300
00301             // Apply text color if specified.
00302             // A null value indicates that the default should be used.
00303             if (args.TextColor != null)
00304             {
00305                 //InternalSetTextColor(args.Range, args.TextColor.Value);
00306             }
00307             else
00308             {
00309                 //InternalSetDefaultTextColor(args.Range);
00310             }
00311
00312             // Apply background color if specified.
00313             // A null value indicates that the default should be used.
00314             if (args.BackgroundColor != null)
00315             {
00316                 //InternalSetBackgroundColor(args.Range, args.BackgroundColor.Value);
00317             }
00318             else
00319             {
00320                 //InternalSetDefaultBackgroundColor(args.Range);
00321             }
00322
00323             // Apply underline if specified.
00324             // A null value indicates that the default should be used.
00325             if (args.UnderlineType != null)
00326             {
00327                 //TextDecoration underline = new TextDecoration(args.Range,args.UnderlineType.Value,args.UnderlineColor.Value);
00328
00329                 //InternalAddTextDecoration(underline);
00330             }
00331             else
00332             {
00333                 //InternalRemoveTextDecoration(args.Range);
00334             }
00335         }
00336
00337         static Rect ScaleRect(Rect rect, double scale)
00338         {
00339             rect.X *= scale;
00340             rect.Y *= scale;
00341             rect.Width *= scale;
00342             rect.Height *= scale;
00343             return rect;
00344         }
00345
00346         void EditContext_LayoutRequested(CoreTextEditContext sender, CoreTextLayoutRequestedEventArgs args)
00347         {
00348             CoreTextLayoutRequest request = args.Request;
00349
00350             // Get the screen coordinates of the entire control and the selected text.
00351             // This information is used to position the IME candidate window.
00352
00353             // First, get the coordinates of the edit control and the selection
00354             // relative to the Window.
00355             Rect contentRect = GetElementRect(ContentPanel);
00356             Rect selectionRect = GetElementRect(SelectionText);
00357
00358             // Next, convert to screen coordinates in view pixels.
00359             Rect windowBounds = Window.Current.CoreWindow.Bounds;
00360             contentRect.X += windowBounds.X;
00361             contentRect.Y += windowBounds.Y;
00362             selectionRect.X += windowBounds.X;
00363             selectionRect.Y += windowBounds.Y;
00364
00365             // Finally, scale up to raw pixels.
00366             double scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
00367
00368             contentRect = ScaleRect(contentRect, scaleFactor);
00369             selectionRect = ScaleRect(selectionRect, scaleFactor);
00370
00371             // This is the bounds of the selection.
00372             // Note: If you return bounds with 0 width and 0 height, candidates will not appear while typing.
00373             request.LayoutBounds.TextBounds = selectionRect;
00374
00375             //This is the bounds of the whole control
00376             request.LayoutBounds.ControlBounds = contentRect;
00377         }
00378         #endregion
00379
00380         #region Input
00381         // This indicates that an IME has started composition.  If there is no handler for this event,
00382         // then composition will not start.
00383         void EditContext_CompositionStarted(CoreTextEditContext sender, CoreTextCompositionStartedEventArgs args)
00384         {
00385         }
00386
00387         void EditContext_CompositionCompleted(CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs args)
00388         {
00389         }
00390
00391         void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
00392         {
00393             // Do not process keyboard input if the custom edit control does not
00394             // have focus.
00395             if (!_internalFocus)
00396             {
00397                 return;
00398             }
00399
00400             // This holds the range we intend to operate on, or which we intend
00401             // to become the new selection. Start with the current selection.
00402             CoreTextRange range = _selection;
00403
00404             // For the purpose of this sample, we will support only the left and right
00405             // arrow keys and the backspace key. A more complete text edit control
00406             // would also handle keys like Home, End, and Delete, as well as
00407             // hotkeys like Ctrl+V to paste.
00408             //
00409             // Note that this sample does not properly handle surrogate pairs
00410             // nor does it handle grapheme clusters.
00411
00412             switch (args.VirtualKey)
00413             {
00414                 // Backspace
00415                 case VirtualKey.Back:
00416                     // If there is a selection, then delete the selection.
00417                     if (HasSelection())
00418                     {
00419                         // Set the text in the selection to nothing.
00420                         ReplaceText(range, "");
00421                     }
00422                     else
00423                     {
00424                         // Delete the character to the left of the caret, if one exists,
00425                         // by creating a range that encloses the character to the left
00426                         // of the caret, and setting the contents of that range to nothing.
00427                         range.StartCaretPosition = Math.Max(0, range.StartCaretPosition - 1);
00428                         ReplaceText(range, "");
00429                     }
00430                     break;
00431
00432                 // Left arrow
00433                 case VirtualKey.Left:
00434                     // If the shift key is down, then adjust the size of the selection.
00435                     if (_coreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down))
00436                     {
00437                         // If this is the start of a selection, then remember which edge we are adjusting.
00438                         if (!HasSelection())
00439                         {
00440                             _extendingLeft = true;
00441                         }
00442
00443                         // Adjust the selection and notify CoreTextEditContext.
00444                         AdjustSelectionEndpoint(-1);
00445                     }
00446                     else
00447                     {
00448                         // The shift key is not down. If there was a selection, then snap the
00449                         // caret at the left edge of the selection.
00450                         if (HasSelection())
00451                         {
00452                             range.EndCaretPosition = range.StartCaretPosition;
00453                             SetSelectionAndNotify(range);
00454                         }
00455                         else
00456                         {
00457                             // There was no selection. Move the caret left one code unit if possible.
00458                             range.StartCaretPosition = Math.Max(0, range.StartCaretPosition - 1);
00459                             range.EndCaretPosition = range.StartCaretPosition;
00460                             SetSelectionAndNotify(range);
00461                         }
00462                     }
00463                     break;
00464
00465                 // Right arrow
00466                 case VirtualKey.Right:
00467                     // If the shift key is down, then adjust the size of the selection.
00468                     if (_coreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down))
00469                     {
00470                         // If this is the start of a selection, then remember which edge we are adjusting.
00471                         if (!HasSelection())
00472                         {
00473                             _extendingLeft = false;
00474                         }
00475
00476                         // Adjust the selection and notify CoreTextEditContext.
00477                         AdjustSelectionEndpoint(+1);
00478                     }
00479                     else
00480                     {
00481                         // The shift key is not down. If there was a selection, then snap the
00482                         // caret at the right edge of the selection.
00483                         if (HasSelection())
00484                         {
00485                             range.StartCaretPosition = range.EndCaretPosition;
00486                             SetSelectionAndNotify(range);
00487                         }
00488                         else
00489                         {
00490                             // There was no selection. Move the caret right one code unit if possible.
00491                             range.StartCaretPosition = Math.Min(_text.Length, range.StartCaretPosition + 1);
00492                             range.EndCaretPosition = range.StartCaretPosition;
00493                             SetSelectionAndNotify(range);
00494                         }
00495                     }
00496                     break;
00497             }
00498         }
00499
00500         // Adjust the active endpoint of the selection in the specified direction.
00501         void AdjustSelectionEndpoint(int direction)
00502         {
00503             CoreTextRange range = _selection;
00504             if (_extendingLeft)
00505             {
00506                 range.StartCaretPosition = Math.Max(0, range.StartCaretPosition + direction);
00507             }
00508             else
00509             {
00510                 range.EndCaretPosition = Math.Min(_text.Length, range.EndCaretPosition + direction);
00511             }
00512
00513             SetSelectionAndNotify(range);
00514         }
00515         #endregion
00516
00517         #region UI
00518         // Helper function to put a zero-width non-breaking space at the end of a string.
00519         // This prevents TextBlock from trimming trailing spaces.
00520         static string PreserveTrailingSpaces(string s)
00521         {
00522             return s + "\ufeff";
00523         }
00524
00525         void UpdateFocusUI()
00526         {
00527             BorderPanel.BorderBrush = _internalFocus ? new SolidColorBrush(Windows.UI.Colors.Green) : null;
00528         }
00529
00530         void UpdateTextUI()
00531         {
00532             // The raw materials we have are a string (_text) and information about
00533             // where the caret/selection is (_selection). We can render the control
00534             // any way we like.
00535
00536             BeforeSelectionText.Text = PreserveTrailingSpaces(_text.Substring(0, _selection.StartCaretPosition));
00537             if (HasSelection())
00538             {
00539                 // There is a selection. Draw that.
00540                 CaretText.Visibility = Visibility.Collapsed;
00541                 SelectionText.Text = PreserveTrailingSpaces(
00542                     _text.Substring(_selection.StartCaretPosition, _selection.EndCaretPosition - _selection.StartCaretPosition));
00543             }
00544             else
00545             {
00546                 // There is no selection. Remove it.
00547                 SelectionText.Text = "";
00548
00549                 // Draw the caret if we have focus.
00550                 CaretText.Visibility = _internalFocus ? Visibility.Visible : Visibility.Collapsed;
00551             }
00552
00553             AfterSelectionText.Text = PreserveTrailingSpaces(_text.Substring(_selection.EndCaretPosition));
00554
00555             // Update statistics for demonstration purposes.
00556             FullText.Text = _text;
00557             SelectionStartIndexText.Text = _selection.StartCaretPosition.ToString();
00558             SelectionEndIndexText.Text = _selection.EndCaretPosition.ToString();
00559         }
00560
00561         static Rect GetElementRect(FrameworkElement element)
00562         {
00563             GeneralTransform transform = element.TransformToVisual(null);
00564             Point point = transform.TransformPoint(new Point());
00565             return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
00566         }
00567 #endregion
00568     }
00569 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cpp/SampleConfiguration.h Source File

  • FolderEnumeration
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Folder enumeration C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_SynchronizingPlayers Member List

This is the complete list of members for Scenario2_SynchronizingPlayers, including all inherited members.
EnablePlaybackControls(bool enabled) | Scenario2_SynchronizingPlayers | [inline, private]
Load_Click(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
maxNaturalDurationForController | Scenario2_SynchronizingPlayers | [private]
MediaPlayer_MediaOpened(MediaPlayer sender, object args) | Scenario2_SynchronizingPlayers | [inline, private]
mediaPlayerElements | Scenario2_SynchronizingPlayers | [private]
MediaTimelineController_PositionChanged(MediaTimelineController sender, object args) | Scenario2_SynchronizingPlayers | [inline, private]
MediaTimelineController_StateChanged(MediaTimelineController sender, object args) | Scenario2_SynchronizingPlayers | [inline, private]
mediaUris | Scenario2_SynchronizingPlayers | [private]
Page_OnLoaded(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
Page_OnUnloaded(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
PlayPause_Click(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
Scenario2_SynchronizingPlayers() | Scenario2_SynchronizingPlayers | [inline]
Seek2SecondsBack_Click(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
Seek2SecondsForward_Click(object sender, RoutedEventArgs e) | Scenario2_SynchronizingPlayers | [inline, private]
timelineController | Scenario2_SynchronizingPlayers | [private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario6_TimeZone.xaml.cs Source File

  • DateTimeFormatting
  • cs

Scenario6_TimeZone.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Text;
00014 using Windows.Foundation;
00015 using Windows.Foundation.Collections;
00016 using Windows.Globalization;
00017 using Windows.Globalization.DateTimeFormatting;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario6_TimeZone : Page
00025     {
00026         public Scenario6_TimeZone()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         /// <summary>
00032         /// This is the click handler for the 'Display' button.
00033         /// </summary>
00034         private void Display()
00035         {
00036             // This scenario illustrates time zone support in DateTimeFormatter class
00037
00038             // Displayed time zones (other than local time zone)
00039             String[] timeZones = new String[] { "UTC", "America/New_York", "Asia/Kolkata" };
00040
00041             // Store results here.
00042             StringBuilder results = new StringBuilder();
00043
00044             // Create formatter object using longdate and longtime template
00045             DateTimeFormatter formatter = new DateTimeFormatter("longdate longtime");
00046
00047             // Create date/time to format and display.
00048             DateTime dateTime = DateTime.Now;
00049
00050             // Show current time.
00051             results.AppendLine("Current date and time");
00052             results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
00053             foreach (String timeZone in timeZones)
00054             {
00055                 results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
00056             }
00057             results.AppendLine();
00058
00059             // Show a time on 14th day of second month of next year.
00060             // Note the effect of daylight saving on the results.
00061             results.AppendLine("Same time on 14th day of second month of next year");
00062             dateTime = new DateTime(dateTime.Year + 1, 2, 14, dateTime.Hour, dateTime.Minute, dateTime.Second);
00063             results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
00064             foreach (String timeZone in timeZones)
00065             {
00066                 results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
00067             }
00068             results.AppendLine();
00069
00070             // Show a time on 14th day of tenth month of next year.
00071             // Note the effect of daylight saving on the results.
00072             results.AppendLine("Same time on 14th day of tenth month of next year");
00073             dateTime = dateTime.AddMonths(8);
00074             results.AppendLine("In Local time zone: " + formatter.Format(dateTime));
00075             foreach (String timeZone in timeZones)
00076             {
00077                 results.AppendLine("In " + timeZone + " time zone: " + formatter.Format(dateTime, timeZone));
00078             }
00079             results.AppendLine();
00080
00081             // Display the results
00082             OutputTextBlock.Text = results.ToString();
00083         }
00084     }
00085 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/SpatialStageManager.h Source File

  • HolographicSpatialStage
  • cpp

SpatialStageManager.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "Content\SceneController.h"
00005
00006 namespace HolographicSpatialStage
00007 {
00008     class SpatialStageManager
00009     {
00010     public:
00011         SpatialStageManager(std::shared_ptr<DX::DeviceResources> const& deviceResources, std::shared_ptr<SceneController> const& sceneController);
00012         SpatialStageManager(const SpatialStageManager&) = delete;
00013         SpatialStageManager(SpatialStageManager&&) = default;
00014         ~SpatialStageManager();
00015
00016         Windows::Perception::Spatial::SpatialCoordinateSystem^ GetCoordinateSystemForCurrentStage();
00017
00018     private:
00019         void OnCurrentChanged(Platform::Object^ /*o*/);
00020
00021         std::vector<Windows::Foundation::Numerics::float3> CreateCircle(Windows::Foundation::Numerics::float3 center, float radius, int divisions, float radians);
00022         std::vector<unsigned short> TriangulatePoints(std::vector<Windows::Foundation::Numerics::float3> const& vertices);
00023
00024         std::shared_ptr<DX::DeviceResources>                                m_deviceResources;
00025         std::shared_ptr<SceneController>                                    m_sceneController;
00026
00027         Windows::Foundation::EventRegistrationToken                         m_spatialStageChangedEventToken;
00028
00029         std::shared_ptr<SceneObject>                                        m_stageBoundsShape;
00030         std::shared_ptr<SceneObject>                                        m_stageVisibleAreaIndicatorShape;
00031
00032         Windows::Perception::Spatial::SpatialCoordinateSystem^              m_currentCoordinateSystem;
00033         Windows::Perception::Spatial::SpatialStageFrameOfReference^         m_currentStage;
00034         Windows::Perception::Spatial::SpatialStationaryFrameOfReference^    m_stationaryFrameOfReference;
00035     };
00036 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/Item.cs Source File

  • XamlListView
  • cs

Item.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Collections.ObjectModel;
00014 using Windows.UI.Xaml.Media.Imaging;
00015
00016 namespace SDKTemplate
00017 {
00018     public class Item
00019     {
00020         private static List<BitmapImage> sources = new List<BitmapImage>()
00021             {
00022                 new BitmapImage(new Uri("ms-appx:///Assets/cliff.jpg")),
00023                 new BitmapImage(new Uri("ms-appx:///Assets/grapes_background.jpg")),
00024                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage13.jpg")),
00025                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage2.jpg")),
00026                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage24.jpg")),
00027                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage3.jpg")),
00028                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage6.jpg")),
00029                 new BitmapImage(new Uri("ms-appx:///Assets/LandscapeImage7.jpg")),
00030                 new BitmapImage(new Uri("ms-appx:///Assets/Ring01.jpg")),
00031                 new BitmapImage(new Uri("ms-appx:///Assets/Ring03Part1.jpg")),
00032                 new BitmapImage(new Uri("ms-appx:///Assets/Ring03Part3.jpg")),
00033                 new BitmapImage(new Uri("ms-appx:///Assets/sunset.jpg"))
00034             };
00035
00036         public BitmapImage ImageSource { get; set; } = new BitmapImage();
00037
00038         public string Id { get; set; } = string.Empty;
00039
00040         public static Item GetNewItem(int i, int j)
00041         {
00042             return new Item()
00043             {
00044                 ImageSource = GenerateImageSource(j),
00045                 Id = i.ToString()
00046             };
00047         }
00048
00049         public static ObservableCollection<Item> GetItems(int count)
00050         {
00051             ObservableCollection<Item> items = new ObservableCollection<Item>();
00052
00053             for (int i = 0; i < count; i++)
00054             {
00055                 items.Add(GetNewItem(i, i % 11));
00056             }
00057             return items;
00058         }
00059
00060         private static BitmapImage GenerateImageSource(int i)
00061         {
00062             return sources[i];
00063         }
00064     }
00065 }
Generated on Fri Nov 15 2024 22:22:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/SampleConfiguration.cs Source File

  • BackgroundMediaPlayback
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using BackgroundMediaPlayback;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "BackgroundMediaPlayback";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Background Media Playback", ClassType=typeof(Scenario1) },
00026             new Scenario() { Title="Settings", ClassType=typeof(Settings) }
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario1_LanguageDetection.h Source File

  • LinguisticServices
  • cppwinrt

Scenario1_LanguageDetection.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_LanguageDetection.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_LanguageDetection : Scenario1_LanguageDetectionT<Scenario1_LanguageDetection>
00020     {
00021         Scenario1_LanguageDetection();
00022
00023         void Go_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024     };
00025 }
00026
00027 namespace winrt::SDKTemplate::factory_implementation
00028 {
00029     struct Scenario1_LanguageDetection : Scenario1_LanguageDetectionT<Scenario1_LanguageDetection, implementation::Scenario1_LanguageDetection>
00030     {
00031     };
00032 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LockScreenApps/cs/Scenario1_Configure.xaml.cs Source File

  • LockScreenApps
  • cs

Scenario1_Configure.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.System;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario1_Configure : Page
00020     {
00021         public Scenario1_Configure()
00022         {
00023             InitializeComponent();
00024         }
00025
00026         private async void OpenAppSettings(object sender, RoutedEventArgs e)
00027         {
00028             await Launcher.LaunchUriAsync(new Uri("ms-settings:appsfeatures-app"));
00029         }
00030
00031         private async void OpenLockscreenSettings(object sender, RoutedEventArgs e)
00032         {
00033             await Launcher.LaunchUriAsync(new Uri("ms-settings:lockscreen"));
00034         }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PageRangePrintHelper Member List

This is the complete list of members for PageRangePrintHelper, including all inherited members.
AddOnePrintPreviewPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription) | PrintHelper | [inline, protected, virtual]
AddPrintPages(object sender, AddPagesEventArgs e) | PageRangePrintHelper | [inline, protected, virtual]
ApplicationContentMarginLeft | PrintHelper | [protected]
ApplicationContentMarginTop | PrintHelper | [protected]
CreatePrintPreviewPages(object sender, PaginateEventArgs e) | PageRangePrintHelper | [inline, protected, virtual]
firstPage | PrintHelper | [protected]
GetPrintPreviewPage(object sender, GetPreviewPageEventArgs e) | PrintHelper | [inline, protected, virtual]
PageRangePrintHelper(Page scenarioPage) | PageRangePrintHelper | [inline]
PreparePrintContent(Page page) | PrintHelper | [inline, virtual]
PreviewPagesCreated | PrintHelper | [protected]
PrintCanvas | PrintHelper | [protected]
printDetailedOptions_OptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args) | PageRangePrintHelper | [inline, private]
printDocument | PrintHelper | [protected]
printDocumentSource | PrintHelper | [protected]
PrintHelper(Page scenarioPage) | PrintHelper | [inline]
PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e) | PageRangePrintHelper | [inline, protected, virtual]
RegisterForPrinting() | PrintHelper | [inline, virtual]
scenarioPage | PrintHelper | [protected]
ShowPrintUIAsync() | PrintHelper | [inline]
UnregisterForPrinting() | PrintHelper | [inline, virtual]
ValidatePageRangeOption(PrintPageRangeOptionDetails pageRangeOption) | PageRangePrintHelper | [inline, private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario6.xaml.cs Source File

  • SimpleInk
  • cs

Scenario6.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.UI;
00014 using Windows.UI.Core;
00015 using Windows.UI.Input.Inking;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Media;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// This page shows the code to control multiple InkCanvas controls with only one Inktoolbar.
00025     /// </summary>
00026     public sealed partial class Scenario6 : Page
00027     {
00028         long selectedStencilChangedToken;
00029
00030         public Scenario6()
00031         {
00032             this.InitializeComponent();
00033
00034             // Initialize the InkCanvas controls
00035             inkCanvas.InkPresenter.InputDeviceTypes =
00036             inkCanvas2.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             // Registering handlers for PointerEntered event
00042             inkCanvas.InkPresenter.UnprocessedInput.PointerEntered += UnprocessedInput_PointerEntered;
00043             inkCanvas2.InkPresenter.UnprocessedInput.PointerEntered += UnprocessedInput_PointerEntered1;
00044         }
00045
00046         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00047         {
00048             // Unregistering handlers for PointerEntered event
00049             inkCanvas.InkPresenter.UnprocessedInput.PointerEntered -= UnprocessedInput_PointerEntered;
00050             inkCanvas2.InkPresenter.UnprocessedInput.PointerEntered -= UnprocessedInput_PointerEntered1;
00051         }
00052
00053         private void UnprocessedInput_PointerEntered(InkUnprocessedInput sender, PointerEventArgs args)
00054         {
00055             border1.BorderBrush = new SolidColorBrush(Colors.Blue);
00056             border2.BorderBrush = new SolidColorBrush(Colors.Gray);
00057             inkToolbar.TargetInkCanvas = inkCanvas;
00058         }
00059
00060         private void UnprocessedInput_PointerEntered1(InkUnprocessedInput sender, PointerEventArgs args)
00061         {
00062             border1.BorderBrush = new SolidColorBrush(Colors.Gray);
00063             border2.BorderBrush = new SolidColorBrush(Colors.Blue);
00064             inkToolbar.TargetInkCanvas = inkCanvas2;
00065         }
00066
00067         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00068         {
00069             SetCanvasSize();
00070         }
00071
00072         private void SetCanvasSize()
00073         {
00074             outputGrid.Width = RootGrid.ActualWidth / 2;
00075             outputGrid.Height = RootGrid.ActualHeight / 2;
00076             inkCanvas.Width = RootGrid.ActualWidth / 2;
00077             inkCanvas.Height = RootGrid.ActualHeight / 2;
00078             outputGrid2.Width = RootGrid.ActualWidth / 2;
00079             outputGrid2.Height = RootGrid.ActualHeight / 2;
00080             inkCanvas2.Width = RootGrid.ActualWidth / 2;
00081             inkCanvas2.Height = RootGrid.ActualHeight / 2;
00082         }
00083
00084         private void ToggleLogs(object sender, RoutedEventArgs e)
00085         {
00086             var stencilButton = (InkToolbarStencilButton)inkToolbar.GetMenuButton(InkToolbarMenuKind.Stencil);
00087
00088             if (toggleLog.IsOn)
00089             {
00090                 LogBorder.Visibility = Visibility.Visible;
00091                 inkToolbar.ActiveToolChanged += InkToolbar_ActiveToolChanged;
00092                 inkToolbar.InkDrawingAttributesChanged += InkToolbar_InkDrawingAttributesChanged;
00093                 inkToolbar.EraseAllClicked += InkToolbar_EraseAllClicked;
00094                 inkToolbar.IsStencilButtonCheckedChanged += InkToolbar_IsStencilButtonCheckedChanged;
00095                 selectedStencilChangedToken = stencilButton.RegisterPropertyChangedCallback(InkToolbarStencilButton.SelectedStencilProperty, InkToolbar_SelectedStencilChanged);
00096             }
00097             else
00098             {
00099                 LogBorder.Visibility = Visibility.Collapsed;
00100                 textLogs.Text = string.Empty;
00101                 inkToolbar.ActiveToolChanged -= InkToolbar_ActiveToolChanged;
00102                 inkToolbar.InkDrawingAttributesChanged -= InkToolbar_InkDrawingAttributesChanged;
00103                 inkToolbar.EraseAllClicked -= InkToolbar_EraseAllClicked;
00104                 inkToolbar.IsStencilButtonCheckedChanged -= InkToolbar_IsStencilButtonCheckedChanged;
00105                 stencilButton.UnregisterPropertyChangedCallback(InkToolbarStencilButton.SelectedStencilProperty, selectedStencilChangedToken);
00106             }
00107         }
00108
00109         private void InkToolbar_IsStencilButtonCheckedChanged(InkToolbar sender, InkToolbarIsStencilButtonCheckedChangedEventArgs args)
00110         {
00111             textLogs.Text = $"IsStencilButtonCheckedChanged(Kind = {args.StencilKind}, IsChecked = {args.StencilButton.IsChecked.Value})\n" + textLogs.Text;
00112         }
00113
00114         private void InkToolbar_SelectedStencilChanged(DependencyObject sender, DependencyProperty dp)
00115         {
00116             var stencilButton = (InkToolbarStencilButton)sender;
00117             textLogs.Text = $"SelectedStencil changed to {stencilButton.SelectedStencil}\n" + textLogs.Text;
00118         }
00119
00120         private void InkToolbar_EraseAllClicked(InkToolbar sender, object args)
00121         {
00122             textLogs.Text = "EraseAllClicked\n" + textLogs.Text;
00123         }
00124
00125         private void InkToolbar_InkDrawingAttributesChanged(InkToolbar sender, object args)
00126         {
00127             textLogs.Text = "InkDrawingAttributesChanged\n" + textLogs.Text;
00128         }
00129
00130         private void InkToolbar_ActiveToolChanged(InkToolbar sender, object args)
00131         {
00132             textLogs.Text = "ActiveToolChanged\n" + textLogs.Text;
00133         }
00134     }
00135 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/pch.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 #pragma once
00014
00015 #include <collection.h>
00016 #include <ppltasks.h>
00017
00018 #include <iostream>
00019 #include <sstream>
00020 #include <locale>
00021 #include <iomanip>
00022
00023 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserConsentVerifier/cpp/SampleConfiguration.h Source File

  • UserConsentVerifier
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "Your feature name here";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RadialController/cs/Scenario1_EventAndMenuHookup.xaml.cs Source File

  • RadialController
  • cs

Scenario1_EventAndMenuHookup.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using Windows.UI.Input;
00016 using Windows.Storage.Streams;
00017 using System;
00018 using System.Linq;
00019 using System.Collections.Generic;
00020 using System.Windows.Input;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario1_EventAndMenuHookup : Page
00025     {
00026         private MainPage rootPage;
00027         private RadialController Controller;
00028
00029         private int activeItemIndex;
00030         private List<RadialControllerMenuItem> menuItems = new List<RadialControllerMenuItem>();
00031         private List<Slider> sliders = new List<Slider>();
00032         private List<ToggleSwitch> toggles = new List<ToggleSwitch>();
00033
00034         public Scenario1_EventAndMenuHookup()
00035         {
00036             this.InitializeComponent();
00037
00038             InitializeController();
00039             CreateMenuItems();
00040         }
00041
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             rootPage = MainPage.Current;
00045         }
00046
00047         protected override void OnNavigatedFrom(NavigationEventArgs e)
00048         {
00049             if (Controller != null)
00050             {
00051                 Controller.Menu.Items.Clear();
00052             }
00053         }
00054
00055         private void InitializeController()
00056         {
00057             Controller = RadialController.CreateForCurrentView();
00058             Controller.RotationResolutionInDegrees = 1;
00059
00060             // Wire events
00061             Controller.RotationChanged += Controller_RotationChanged;
00062             Controller.ButtonClicked += Controller_ButtonClicked;
00063             Controller.ScreenContactStarted += Controller_ScreenContactStarted;
00064             Controller.ScreenContactContinued += Controller_ScreenContactContinued;
00065             Controller.ScreenContactEnded += Controller_ScreenContactEnded;
00066             Controller.ControlAcquired += Controller_ControlAcquired;
00067             Controller.ControlLost += Controller_ControlLost;
00068         }
00069
00070         private void CreateMenuItems()
00071         {
00072             AddKnownIconItems();
00073             AddCustomIconItems();
00074             AddFontGlyphItems();
00075
00076             // Set the invoked callbacks for each menu item
00077             for (int i = 0; i < menuItems.Count; ++i)
00078             {
00079                 RadialControllerMenuItem radialControllerItem = menuItems[i];
00080                 int index = i;
00081
00082                 radialControllerItem.Invoked += (sender, args) => { OnItemInvoked(index); };
00083             }
00084         }
00085
00086         private void AddKnownIconItems()
00087         {
00088             menuItems.Add(RadialControllerMenuItem.CreateFromKnownIcon("Item0", RadialControllerMenuKnownIcon.InkColor));
00089             sliders.Add(slider0);
00090             toggles.Add(toggle0);
00091
00092             menuItems.Add(RadialControllerMenuItem.CreateFromKnownIcon("Item1", RadialControllerMenuKnownIcon.NextPreviousTrack));
00093             sliders.Add(slider1);
00094             toggles.Add(toggle1);
00095         }
00096
00097         private void AddCustomIconItems()
00098         {
00099             menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item2", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item2.png"))));
00100             sliders.Add(slider2);
00101             toggles.Add(toggle2);
00102
00103             menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item3", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item3.png"))));
00104             sliders.Add(slider3);
00105             toggles.Add(toggle3);
00106         }
00107
00108         private void AddFontGlyphItems()
00109         {
00110             // Using system font
00111             menuItems.Add(RadialControllerMenuItem.CreateFromFontGlyph("Item4", "\x2764", "Segoe UI Emoji"));
00112             sliders.Add(slider4);
00113             toggles.Add(toggle4);
00114
00115             // Using custom font
00116             menuItems.Add(RadialControllerMenuItem.CreateFromFontGlyph("Item5", "\ue102", "Symbols", new Uri("ms-appx:///Assets/Symbols.ttf")));
00117             sliders.Add(slider5);
00118             toggles.Add(toggle5);
00119         }
00120
00121         private void OnItemInvoked(int selectedItemIndex)
00122         {
00123             if (activeItemIndex != selectedItemIndex)
00124             {
00125                 activeItemIndex = selectedItemIndex;
00126                 PrintSelectedItem();
00127             }
00128         }
00129
00130         private void AddItem(object sender, RoutedEventArgs e)
00131         {
00132             RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);
00133
00134             if (!Controller.Menu.Items.Contains(radialControllerMenuItem))
00135             {
00136                 Controller.Menu.Items.Add(radialControllerMenuItem);
00137                 log.Text += "\n Added : " + radialControllerMenuItem.DisplayText;
00138             }
00139         }
00140
00141         private void RemoveItem(object sender, RoutedEventArgs e)
00142         {
00143             RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);
00144
00145             if (Controller.Menu.Items.Contains(radialControllerMenuItem))
00146             {
00147                 Controller.Menu.Items.Remove(radialControllerMenuItem);
00148                 log.Text += "\n Removed : " + radialControllerMenuItem.DisplayText;
00149             }
00150         }
00151
00152         private void SelectItem(object sender, RoutedEventArgs e)
00153         {
00154             RadialControllerMenuItem radialControllerMenuItem = GetRadialControllerMenuItemFromSender(sender);
00155
00156             if (Controller.Menu.Items.Contains(radialControllerMenuItem))
00157             {
00158                 Controller.Menu.SelectMenuItem(radialControllerMenuItem);
00159                 PrintSelectedItem();
00160             }
00161         }
00162
00163         private void SelectPreviouslySelectedItem(object sender, RoutedEventArgs e)
00164         {
00165             Controller.Menu.TrySelectPreviouslySelectedMenuItem();
00166             PrintSelectedItem();
00167         }
00168
00169         private RadialControllerMenuItem GetRadialControllerMenuItemFromSender(object sender)
00170         {
00171             Button button = sender as Button;
00172             int index = Convert.ToInt32(button.CommandParameter);
00173
00174             return menuItems[index];
00175         }
00176
00177         private void PrintSelectedItem(object sender, RoutedEventArgs e)
00178         {
00179             PrintSelectedItem();
00180         }
00181
00182         private void PrintSelectedItem()
00183         {
00184             RadialControllerMenuItem selectedMenuItem = Controller.Menu.GetSelectedMenuItem();
00185             string itemName = string.Empty;
00186
00187             if (selectedMenuItem == menuItems[activeItemIndex])
00188             {
00189                 itemName = selectedMenuItem.DisplayText;
00190             }
00191             else if (selectedMenuItem == null)
00192             {
00193                 itemName = "System Item";
00194             }
00195
00196             if (itemName != string.Empty)
00197             {
00198                 log.Text += "\n Selected : " + itemName;
00199             }
00200         }
00201
00202         private void OnLogSizeChanged(object sender, object e)
00203         {
00204             logViewer.ChangeView(null, logViewer.ExtentHeight, null);
00205         }
00206
00207         private void Controller_ControlAcquired(RadialController sender, RadialControllerControlAcquiredEventArgs args)
00208         {
00209             log.Text += "\n Control Acquired";
00210             LogContactInfo(args.Contact);
00211         }
00212
00213         private void Controller_ControlLost(RadialController sender, object args)
00214         {
00215             log.Text += "\n Control Lost";
00216         }
00217
00218         private void Controller_ScreenContactStarted(RadialController sender, RadialControllerScreenContactStartedEventArgs args)
00219         {
00220             log.Text += "\n Contact Started ";
00221             LogContactInfo(args.Contact);
00222         }
00223
00224         private void Controller_ScreenContactContinued(RadialController sender, RadialControllerScreenContactContinuedEventArgs args)
00225         {
00226
00227             log.Text += "\n Contact Continued ";
00228             LogContactInfo(args.Contact);
00229         }
00230
00231         private void Controller_ScreenContactEnded(RadialController sender, object args)
00232         {
00233             log.Text += "\n Contact Ended";
00234         }
00235
00236         private void ToggleMenuSuppression(Object sender, RoutedEventArgs args)
00237         {
00238             RadialControllerConfiguration radialControllerConfig = RadialControllerConfiguration.GetForCurrentView();
00239
00240             if (MenuSuppressionToggleSwitch.IsOn)
00241             {
00242                 radialControllerConfig.ActiveControllerWhenMenuIsSuppressed = Controller;
00243             }
00244
00245             radialControllerConfig.IsMenuSuppressed = MenuSuppressionToggleSwitch.IsOn;
00246         }
00247
00248         private void Controller_ButtonClicked(RadialController sender, RadialControllerButtonClickedEventArgs args)
00249         {
00250             log.Text += "\n Button Clicked ";
00251             LogContactInfo(args.Contact);
00252
00253             ToggleSwitch toggle = toggles[activeItemIndex];
00254             toggle.IsOn = !toggle.IsOn;
00255         }
00256
00257         private void Controller_RotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args)
00258         {
00259             log.Text += "\n Rotation Changed Delta = " + args.RotationDeltaInDegrees;
00260             LogContactInfo(args.Contact);
00261
00262             sliders[activeItemIndex].Value += args.RotationDeltaInDegrees;
00263         }
00264
00265         private void LogContactInfo(RadialControllerScreenContact contact)
00266         {
00267             if (contact != null)
00268             {
00269                 log.Text += "\n Bounds = " + contact.Bounds.ToString();
00270                 log.Text += "\n Position = " + contact.Position.ToString();
00271             }
00272         }
00273     }
00274 }
Generated on Fri Nov 15 2024 22:21:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AccessHandler Member List

This is the complete list of members for AccessHandler, including all inherited members.
AccessHandler(SmartCardConnection ScConnection) | AccessHandler | [inline]
connectionObject | AccessHandler | [private]
desfireCommand | AccessHandler | [private]
desfireResponse | AccessHandler | [private]
ReadCardDetailsAsync() | AccessHandler | [inline]
ReadDataAsync(byte fileNumber, ulong offset, ulong length) | AccessHandler | [inline]
ReadRecordAsync(byte fileNumber, ulong offset, ulong numberOfRecords) | AccessHandler | [inline]
SelectApplicationAsync(byte[] aid) | AccessHandler | [inline]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DisablingScreenCapture/cpp/SampleConfiguration.h Source File

  • DisablingScreenCapture
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Disabling screen capture C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Content/SpatialInputHandler.cs Source File

  • 360VideoPlayback
  • cs
  • Content

SpatialInputHandler.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Input.Spatial;
00002
00003 namespace _360VideoPlayback.Common
00004 {
00005     // Sample gesture handler.
00006     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00007     public class SpatialInputHandler
00008     {
00009         // API objects used to process gesture input, and generate gesture events.
00010         private SpatialInteractionManager interactionManager;
00011
00012         // Used to indicate that a Pressed input event was received this frame.
00013         private SpatialInteractionSourceState sourceState;
00014
00015         // Creates and initializes a GestureRecognizer that listens to a Person.
00016         public SpatialInputHandler()
00017         {
00018             // The interaction manager provides an event that informs the app when
00019             // spatial interactions are detected.
00020             interactionManager = SpatialInteractionManager.GetForCurrentView();
00021
00022             // Bind a handler to the SourcePressed event.
00023             interactionManager.SourcePressed += this.OnSourcePressed;
00024
00025             //
00026             // TODO: Expand this class to use other gesture-based input events as applicable to
00027             //       your app.
00028             //
00029         }
00030
00031         // Checks if the user performed an input gesture since the last call to this method.
00032         // Allows the main update loop to check for asynchronous changes to the user
00033         // input state.
00034         public SpatialInteractionSourceState CheckForInput()
00035         {
00036             SpatialInteractionSourceState sourceState = this.sourceState;
00037             this.sourceState = null;
00038             return sourceState;
00039         }
00040
00041         public void OnSourcePressed(SpatialInteractionManager sender, SpatialInteractionSourceEventArgs args)
00042         {
00043             sourceState = args.State;
00044
00045             //
00046             // TODO: In your app or game engine, rewrite this method to queue
00047             //       input events in your input class or event handler.
00048             //
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/SampleConfiguration.h Source File

  • BarcodeScanner
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks.Shared/TripStore.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks.Shared

TripStore.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012 #include "Trip.h"
00013
00014 namespace AdventureWorks_Shared
00015 {
00016     [Windows::UI::Xaml::Data::Bindable]
00017     [Windows::Foundation::Metadata::WebHostHidden]
00018     public ref class TripStore sealed
00019     {
00020     public:
00021         TripStore();
00022
00023         property Windows::Foundation::Collections::IObservableVector<Trip^>^ Trips
00024         {
00025             Windows::Foundation::Collections::IObservableVector<Trip^>^ get();
00026         }
00027
00028         void LoadTrips();
00029         void LoadTripsSync();
00030         Windows::Foundation::IAsyncAction^ DeleteTripAsync(Trip^ trip);
00031         Windows::Foundation::IAsyncAction^ SaveTripAsync(Trip^ trip);
00032         Windows::Foundation::IAsyncAction^ LoadTripsAsync();
00033
00034     private:
00035         Windows::Foundation::Collections::IObservableVector<Trip^>^ trips;
00036         void WriteTrips();
00037         HRESULT ReadXml(Windows::Storage::Streams::IRandomAccessStream^ randomAccessReadStream);
00038
00039         Concurrency::task<void> LoadTripsTask();
00040
00041         bool loaded;
00042     };
00043 }
00044
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cs/Scenario4_ShowView.xaml.cs Source File

  • TouchKeyboard
  • cs

Scenario4_ShowView.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.ViewManagement.Core;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class Scenario4_ShowView : Page
00019     {
00020         private MainPage rootPage = MainPage.Current;
00021
00022         public Scenario4_ShowView()
00023         {
00024             InitializeComponent();
00025         }
00026
00027         void TextBox_GotFocus(object sender, RoutedEventArgs e)
00028         {
00029             CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Emoji);
00030         }
00031     }
00032 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonPin_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/SampleConfiguration.h Source File

  • TouchKeyboard
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/Properties/AssemblyInfo.cs Source File

  • XamlStateTriggers
  • cs
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("StateTriggersSample")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("StateTriggersSample")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/HolographicApp1Main.cs Source File

  • 360VideoPlayback
  • cs

HolographicApp1Main.cs

Go to the documentation of this file.
00001 ﻿//
00002 // Comment out this preprocessor definition to disable all of the
00003 // sample content.
00004 //
00005 // To remove the content after disabling it:
00006 //     * Remove the unused code from this file.
00007 //     * Delete the Content folder provided with this template.
00008 //
00009 #define DRAW_SAMPLE_CONTENT
00010
00011 using System;
00012 using System.Numerics;
00013 using System.Diagnostics;
00014 using Windows.Graphics.Holographic;
00015 using Windows.Perception.Spatial;
00016 using Windows.UI.Input.Spatial;
00017
00018 using HolographicApp2.Common;
00019 using System.Threading.Tasks;
00020 using Windows.Foundation;
00021 using System.Collections.Generic;
00022
00023 #if DRAW_SAMPLE_CONTENT
00024 using HolographicApp2.Content;
00025 #endif
00026
00027 namespace HolographicApp2
00028 {
00029     /// <summary>
00030     /// Updates, renders, and presents holographic content using Direct3D.
00031     /// </summary>
00032     internal class HolographicApp1Main : IDisposable
00033     {
00034
00035 #if DRAW_SAMPLE_CONTENT
00036         // Renders a colorful holographic cube that's 20 centimeters wide. This sample content
00037         // is used to demonstrate world-locked rendering.
00038         private SpinningCubeRenderer        spinningCubeRenderer;
00039
00040         private SpatialInputHandler         spatialInputHandler;
00041 #endif
00042
00043         // Cached reference to device resources.
00044         private DeviceResources             deviceResources;
00045
00046         // Render loop timer.
00047         private StepTimer                   timer = new StepTimer();
00048
00049         // Represents the holographic space around the user.
00050         HolographicSpace                    holographicSpace;
00051
00052         // SpatialLocator that is attached to the primary camera.
00053         SpatialLocator                      locator;
00054
00055         // A reference frame attached to the holographic camera.
00056         SpatialStationaryFrameOfReference   referenceFrame;
00057
00058         SpatialLocatorAttachedFrameOfReference attachreferenceFrame;
00059
00060         /// <summary>
00061         /// Loads and initializes application assets when the application is loaded.
00062         /// </summary>
00063         /// <param name="deviceResources"></param>
00064         public HolographicApp1Main(DeviceResources deviceResources)
00065         {
00066             this.deviceResources = deviceResources;
00067
00068             // Register to be notified if the Direct3D device is lost.
00069             this.deviceResources.DeviceLost     += this.OnDeviceLost;
00070             this.deviceResources.DeviceRestored += this.OnDeviceRestored;
00071         }
00072
00073         public void SetHolographicSpace(HolographicSpace holographicSpace)
00074         {
00075             this.holographicSpace = holographicSpace;
00076
00077             //
00078             // TODO: Add code here to initialize your content.
00079             //
00080
00081 #if DRAW_SAMPLE_CONTENT
00082             // Initialize the sample hologram.
00083             spinningCubeRenderer = new SpinningCubeRenderer(deviceResources);
00084
00085             spatialInputHandler = new SpatialInputHandler();
00086 #endif
00087
00088             // Use the default SpatialLocator to track the motion of the device.
00089             locator = SpatialLocator.GetDefault();
00090
00091             // Be able to respond to changes in the positional tracking state.
00092             locator.LocatabilityChanged += this.OnLocatabilityChanged;
00093
00094             // Respond to camera added events by creating any resources that are specific
00095             // to that camera, such as the back buffer render target view.
00096             // When we add an event handler for CameraAdded, the API layer will avoid putting
00097             // the new camera in new HolographicFrames until we complete the deferral we created
00098             // for that handler, or return from the handler without creating a deferral. This
00099             // allows the app to take more than one frame to finish creating resources and
00100             // loading assets for the new holographic camera.
00101             // This function should be registered before the app creates any HolographicFrames.
00102             holographicSpace.CameraAdded += this.OnCameraAdded;
00103
00104             // Respond to camera removed events by releasing resources that were created for that
00105             // camera.
00106             // When the app receives a CameraRemoved event, it releases all references to the back
00107             // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
00108             // The app must also ensure that the back buffer is not attached as a render target, as
00109             // shown in DeviceResources.ReleaseResourcesForBackBuffer.
00110             holographicSpace.CameraRemoved += this.OnCameraRemoved;
00111
00112             // The simplest way to render world-locked holograms is to create a stationary reference frame
00113             // when the app is launched. This is roughly analogous to creating a "world" coordinate system
00114             // with the origin placed at the device's position as the app is launched.
00115             referenceFrame = locator.CreateStationaryFrameOfReferenceAtCurrentLocation();
00116             attachreferenceFrame = locator.CreateAttachedFrameOfReferenceAtCurrentHeading();
00117
00118             // Notes on spatial tracking APIs:
00119             // * Stationary reference frames are designed to provide a best-fit position relative to the
00120             //   overall space. Individual positions within that reference frame are allowed to drift slightly
00121             //   as the device learns more about the environment.
00122             // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
00123             //   anchor the individual hologram to a position in the real world - for example, a point the user
00124             //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
00125             //   anchor will use the corrected position starting in the next frame after the correction has
00126             //   occurred.
00127         }
00128
00129         public void Dispose()
00130         {
00131 #if DRAW_SAMPLE_CONTENT
00132             if (spinningCubeRenderer != null)
00133             {
00134                 spinningCubeRenderer.ReleaseDeviceDependentResources();
00135                 spinningCubeRenderer.Dispose();
00136                 spinningCubeRenderer = null;
00137             }
00138 #endif
00139         }
00140
00141         /// <summary>
00142         /// Updates the application state once per frame.
00143         /// </summary>
00144         public HolographicFrame Update()
00145         {
00146             // Before doing the timer update, there is some work to do per-frame
00147             // to maintain holographic rendering. First, we will get information
00148             // about the current frame.
00149
00150             // The HolographicFrame has information that the app needs in order
00151             // to update and render the current frame. The app begins each new
00152             // frame by calling CreateNextFrame.
00153             HolographicFrame holographicFrame = holographicSpace.CreateNextFrame();
00154
00155             // Get a prediction of where holographic cameras will be when this frame
00156             // is presented.
00157             HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;
00158
00159             // Back buffers can change from frame to frame. Validate each buffer, and recreate
00160             // resource views and depth buffers as needed.
00161             deviceResources.EnsureCameraResources(holographicFrame, prediction);
00162
00163             // Next, we get a coordinate system from the attached frame of reference that is
00164             // associated with the current frame. Later, this coordinate system is used for
00165             // for creating the stereo view matrices when rendering the sample content.
00166             SpatialCoordinateSystem currentCoordinateSystem = attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp);//referenceFrame.CoordinateSystem;
00167
00168
00169 #if DRAW_SAMPLE_CONTENT
00170
00171             // Check for new input state since the last frame.
00172             SpatialInteractionSourceState pointerState = spatialInputHandler.CheckForInput();
00173             if (null != pointerState)
00174             {
00175                 // When a Pressed gesture is detected, the sample hologram will be repositioned
00176                 // two meters in front of the user.
00177                 spinningCubeRenderer.PositionHologram(
00178                   //  pointerState.TryGetPointerPose(currentCoordinateSystem)
00179                     SpatialPointerPose.TryGetAtTimestamp(currentCoordinateSystem, prediction.Timestamp)
00180                     );
00181             }
00182
00183             //var downstate = Windows.UI.Core.CoreVirtualKeyStates.Down;
00184             //bool rightclick = (Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.Escape) & downstate) == downstate;
00185             //System.Diagnostics.Debug.WriteLine("Windows.System.VirtualKey.Escape  " + Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.Escape).ToString() + " downstate" + downstate);
00186             //System.Diagnostics.Debug.WriteLine("Windows.System.VirtualKey.A  " + Windows.UI.Core.CoreWindow.GetForCurrentThread().GetKeyState(Windows.System.VirtualKey.A).ToString() + " downstate" + downstate);
00187             //if (rightclick)
00188             //{
00189             //    Windows.UI.ViewManagement.ApplicationViewSwitcher.SwitchAsync(VideoGallery.mainId, VideoGallery.appId, Windows.UI.ViewManagement.ApplicationViewSwitchingOptions.ConsolidateViews);
00190             //}
00191 #endif
00192
00193
00194
00195             timer.Tick(() =>
00196             {
00197                 //
00198                 // TODO: Update scene objects.
00199                 //
00200                 // Put time-based updates here. By default this code will run once per frame,
00201                 // but if you change the StepTimer to use a fixed time step this code will
00202                 // run as many times as needed to get to the current step.
00203                 //
00204
00205 #if DRAW_SAMPLE_CONTENT
00206                 spinningCubeRenderer.Update(timer);
00207 #endif
00208             });
00209
00210             // We complete the frame update by using information about our content positioning
00211             // to set the focus point.
00212             foreach (var cameraPose in prediction.CameraPoses)
00213             {
00214 #if DRAW_SAMPLE_CONTENT
00215                 // The HolographicCameraRenderingParameters class provides access to set
00216                 // the image stabilization parameters.
00217                 HolographicCameraRenderingParameters renderingParameters = holographicFrame.GetRenderingParameters(cameraPose);
00218
00219                 // SetFocusPoint informs the system about a specific point in your scene to
00220                 // prioritize for image stabilization. The focus point is set independently
00221                 // for each holographic camera.
00222                 // You should set the focus point near the content that the user is looking at.
00223                 // In this example, we put the focus point at the center of the sample hologram,
00224                 // since that is the only hologram available for the user to focus on.
00225                 // You can also set the relative velocity and facing of that content; the sample
00226                 // hologram is at a fixed point so we only need to indicate its position.
00227                 Vector3 position = new Vector3(0.0f, 0.0f, -3.0f);
00228                     renderingParameters.SetFocusPoint(
00229                     currentCoordinateSystem, position
00230                     /*spinningCubeRenderer.Position*/
00231                     );
00232 #endif
00233             }
00234
00235             // The holographic frame will be used to get up-to-date view and projection matrices and
00236             // to present the swap chain.
00237             return holographicFrame;
00238         }
00239
00240         /// <summary>
00241         /// Renders the current frame to each holographic display, according to the
00242         /// current application and spatial positioning state. Returns true if the
00243         /// frame was rendered to at least one display.
00244         /// </summary>
00245         public bool Render(ref HolographicFrame holographicFrame)
00246         {
00247             // Don't try to render anything before the first Update.
00248             if (timer.FrameCount == 0)
00249             {
00250                 return false;
00251             }
00252
00253             //
00254             // TODO: Add code for pre-pass rendering here.
00255             //
00256             // Take care of any tasks that are not specific to an individual holographic
00257             // camera. This includes anything that doesn't need the final view or projection
00258             // matrix, such as lighting maps.
00259             //
00260
00261             // Up-to-date frame predictions enhance the effectiveness of image stablization and
00262             // allow more accurate positioning of holograms.
00263             holographicFrame.UpdateCurrentPrediction();
00264             HolographicFramePrediction prediction = holographicFrame.CurrentPrediction;
00265
00266             // Lock the set of holographic camera resources, then draw to each camera
00267             // in this frame.
00268             return deviceResources.UseHolographicCameraResources(
00269                 (Dictionary<uint, CameraResources> cameraResourceDictionary) =>
00270             {
00271                 bool atLeastOneCameraRendered = false;
00272
00273                 foreach (var cameraPose in prediction.CameraPoses)
00274                 {
00275                     // This represents the device-based resources for a HolographicCamera.
00276                     CameraResources cameraResources = cameraResourceDictionary[cameraPose.HolographicCamera.Id];
00277
00278                     // Get the device context.
00279                     var context = deviceResources.D3DDeviceContext;
00280                     var renderTargetView = cameraResources.BackBufferRenderTargetView;
00281                     var depthStencilView = cameraResources.DepthStencilView;
00282
00283                     // Set render targets to the current holographic camera.
00284                     context.OutputMerger.SetRenderTargets(depthStencilView, renderTargetView);
00285
00286                     // Clear the back buffer and depth stencil view.
00287                     SharpDX.Mathematics.Interop.RawColor4 transparent = new SharpDX.Mathematics.Interop.RawColor4(0.0f, 0.0f, 0.0f, 0.0f);
00288                     context.ClearRenderTargetView(renderTargetView, transparent);
00289                     context.ClearDepthStencilView(
00290                         depthStencilView,
00291                         SharpDX.Direct3D11.DepthStencilClearFlags.Depth | SharpDX.Direct3D11.DepthStencilClearFlags.Stencil,
00292                         1.0f,
00293                         0);
00294
00295                     //
00296                     // TODO: Replace the sample content with your own content.
00297                     //
00298                     // Notes regarding holographic content:
00299                     //    * For drawing, remember that you have the potential to fill twice as many pixels
00300                     //      in a stereoscopic render target as compared to a non-stereoscopic render target
00301                     //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
00302                     //      and only draw holograms that the user can see.
00303                     //    * To help occlude hologram geometry, you can create a depth map using geometry
00304                     //      data obtained via the surface mapping APIs. You can use this depth map to avoid
00305                     //      rendering holograms that are intended to be hidden behind tables, walls,
00306                     //      monitors, and so on.
00307                     //    * Black pixels will appear transparent to the user wearing the device, but you
00308                     //      should still use alpha blending to draw semitransparent holograms. You should
00309                     //      also clear the screen to Transparent as shown above.
00310                     //
00311
00312
00313                     // The view and projection matrices for each holographic camera will change
00314                     // every frame. This function refreshes the data in the constant buffer for
00315                     // the holographic camera indicated by cameraPose.
00316                     cameraResources.UpdateViewProjectionBuffer(deviceResources, cameraPose, attachreferenceFrame.GetStationaryCoordinateSystemAtTimestamp(prediction.Timestamp)/*referenceFrame.CoordinateSystem*/);
00317
00318                     // Attach the view/projection constant buffer for this camera to the graphics pipeline.
00319                     bool cameraActive = cameraResources.AttachViewProjectionBuffer(deviceResources);
00320
00321 #if DRAW_SAMPLE_CONTENT
00322                     // Only render world-locked content when positional tracking is active.
00323                     if (cameraActive)
00324                     {
00325                         // Draw the sample hologram.
00326                         spinningCubeRenderer.Render();
00327                     }
00328 #endif
00329                     atLeastOneCameraRendered = true;
00330                 }
00331
00332                 return atLeastOneCameraRendered;
00333             });
00334         }
00335
00336         public void SaveAppState()
00337         {
00338             //
00339             // TODO: Insert code here to save your app state.
00340             //       This method is called when the app is about to suspend.
00341             //
00342             //       For example, store information in the SpatialAnchorStore.
00343             //
00344         }
00345
00346         public void LoadAppState()
00347         {
00348             //
00349             // TODO: Insert code here to load your app state.
00350             //       This method is called when the app resumes.
00351             //
00352             //       For example, load information from the SpatialAnchorStore.
00353             //
00354         }
00355
00356
00357         /// <summary>
00358         /// Notifies renderers that device resources need to be released.
00359         /// </summary>
00360         public void OnDeviceLost(Object sender, EventArgs e)
00361         {
00362
00363 #if DRAW_SAMPLE_CONTENT
00364             spinningCubeRenderer.ReleaseDeviceDependentResources();
00365 #endif
00366
00367         }
00368
00369         /// <summary>
00370         /// Notifies renderers that device resources may now be recreated.
00371         /// </summary>
00372         public void OnDeviceRestored(Object sender, EventArgs e)
00373         {
00374 #if DRAW_SAMPLE_CONTENT
00375             spinningCubeRenderer.CreateDeviceDependentResourcesAsync();
00376 #endif
00377         }
00378
00379         void OnLocatabilityChanged(SpatialLocator sender, Object args)
00380         {
00381             switch (sender.Locatability)
00382             {
00383                 case SpatialLocatability.Unavailable:
00384                     // Holograms cannot be rendered.
00385                     {
00386                         String message = "Warning! Positional tracking is " + sender.Locatability + ".";
00387                         Debug.WriteLine(message);
00388                     }
00389                     break;
00390
00391                 // In the following three cases, it is still possible to place holograms using a
00392                 // SpatialLocatorAttachedFrameOfReference.
00393                 case SpatialLocatability.PositionalTrackingActivating:
00394                 // The system is preparing to use positional tracking.
00395
00396                 case SpatialLocatability.OrientationOnly:
00397                 // Positional tracking has not been activated.
00398
00399                 case SpatialLocatability.PositionalTrackingInhibited:
00400                     // Positional tracking is temporarily inhibited. User action may be required
00401                     // in order to restore positional tracking.
00402                     break;
00403
00404                 case SpatialLocatability.PositionalTrackingActive:
00405                     // Positional tracking is active. World-locked content can be rendered.
00406                     break;
00407             }
00408         }
00409
00410         public void OnCameraAdded(
00411             HolographicSpace sender,
00412             HolographicSpaceCameraAddedEventArgs args
00413             )
00414         {
00415             Deferral deferral = args.GetDeferral();
00416             HolographicCamera holographicCamera = args.Camera;
00417
00418             Task task1 = new Task(() =>
00419             {
00420                 //
00421                 // TODO: Allocate resources for the new camera and load any content specific to
00422                 //       that camera. Note that the render target size (in pixels) is a property
00423                 //       of the HolographicCamera object, and can be used to create off-screen
00424                 //       render targets that match the resolution of the HolographicCamera.
00425                 //
00426
00427                 // Create device-based resources for the holographic camera and add it to the list of
00428                 // cameras used for updates and rendering. Notes:
00429                 //   * Since this function may be called at any time, the AddHolographicCamera function
00430                 //     waits until it can get a lock on the set of holographic camera resources before
00431                 //     adding the new camera. At 60 frames per second this wait should not take long.
00432                 //   * A subsequent Update will take the back buffer from the RenderingParameters of this
00433                 //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
00434                 //     Content can then be rendered for the HolographicCamera.
00435                 deviceResources.AddHolographicCamera(holographicCamera);
00436
00437                 // Holographic frame predictions will not include any information about this camera until
00438                 // the deferral is completed.
00439                 deferral.Complete();
00440             });
00441             task1.Start();
00442         }
00443
00444         public void OnCameraRemoved(
00445             HolographicSpace sender,
00446             HolographicSpaceCameraRemovedEventArgs args
00447             )
00448         {
00449             Task task2 = new Task(() =>
00450             {
00451                 //
00452                 // TODO: Asynchronously unload or deactivate content resources (not back buffer
00453                 //       resources) that are specific only to the camera that was removed.
00454                 //
00455             });
00456             task2.Start();
00457
00458             // Before letting this callback return, ensure that all references to the back buffer
00459             // are released.
00460             // Since this function may be called at any time, the RemoveHolographicCamera function
00461             // waits until it can get a lock on the set of holographic camera resources before
00462             // deallocating resources for this camera. At 60 frames per second this wait should
00463             // not take long.
00464             deviceResources.RemoveHolographicCamera(args.Camera);
00465         }
00466         public void CreateVideoShaders()
00467         {
00468             spinningCubeRenderer.CreateDeviceDependentResourcesAsync();
00469         }
00470     }
00471 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraGetPreviewFrame/cpp/App.xaml.h Source File

  • CameraGetPreviewFrame
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015
00016 namespace CameraGetPreviewFrame
00017 {
00018     /// <summary>
00019     /// Provides application-specific behavior to supplement the default Application class.
00020     /// </summary>
00021     ref class App sealed
00022     {
00023     protected:
00024         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00025
00026     internal:
00027         App();
00028
00029     private:
00030         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00031     };
00032 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/SampleConfiguration.cpp Source File

  • PdfDocument
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016 #include <winrt/SDKTemplate.h>
00017
00018 using namespace winrt;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace SDKTemplate;
00021
00022 hstring implementation::MainPage::FEATURE_NAME()
00023 {
00024     return L"PDF Document C++/WinRT Sample";
00025 }
00026
00027 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00028 {
00029     Scenario{ L"Render Document", xaml_typename<SDKTemplate::Scenario1_Render>() },
00030 });
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FirmwareAccess Member List

This is the complete list of members for FirmwareAccess, including all inherited members.
ERROR_INVALID_FUNCTION | FirmwareAccess | [private]
ERROR_SUCCESS | FirmwareAccess | [private]
FirmwareAccess() | FirmwareAccess | [inline]
GetFirmwareEnvironmentVariable(string name, string guid,[Out, MarshalAs(UnmanagedType.LPArray)] char[] lpszBuffer, int size) | FirmwareAccess |
GetLastError() | FirmwareAccess |
GetManufacturerName_Click(Object sender, RoutedEventArgs e) | FirmwareAccess | [inline, private]
GetManufacturerNameFromSmbios(StringBuilder ManufacturerName, uint Size) | FirmwareAccess | [private, static]
GetSecureBootEnabledFromUefi([MarshalAs(UnmanagedType.U1)] ref bool SecureBootEnabled) | FirmwareAccess | [private, static]
rootPage | FirmwareAccess | [private]
SecureBootState_Click(Object sender, RoutedEventArgs e) | FirmwareAccess | [inline, private]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraOpenCV/shared/OpenCVBridge/OpenCVHelper.h Source File

  • CameraOpenCV
  • shared
  • OpenCVBridge

OpenCVHelper.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 // OpenCVHelper.h
00012
00013 #pragma once
00014 #include <opencv2\core\core.hpp>
00015 #include <opencv2\imgproc\imgproc.hpp>
00016 #include <opencv2\video.hpp>
00017
00018 namespace OpenCVBridge
00019 {
00020     public ref class OpenCVHelper sealed
00021     {
00022     public:
00023         OpenCVHelper();
00024
00025         // Image processing operators
00026         void Blur(
00027             Windows::Graphics::Imaging::SoftwareBitmap^ input,
00028             Windows::Graphics::Imaging::SoftwareBitmap^ output);
00029         void HoughLines(
00030             Windows::Graphics::Imaging::SoftwareBitmap^ input,
00031             Windows::Graphics::Imaging::SoftwareBitmap^ output);
00032         void Contours(
00033             Windows::Graphics::Imaging::SoftwareBitmap^ input,
00034             Windows::Graphics::Imaging::SoftwareBitmap^ output);
00035         void Histogram(
00036             Windows::Graphics::Imaging::SoftwareBitmap^ input,
00037             Windows::Graphics::Imaging::SoftwareBitmap^ output);
00038         void MotionDetector(
00039             Windows::Graphics::Imaging::SoftwareBitmap^ input,
00040             Windows::Graphics::Imaging::SoftwareBitmap^ output);
00041     private:
00042         // used only for the background subtraction operation
00043         cv::Mat fgMaskMOG2;
00044         cv::Ptr<cv::BackgroundSubtractor> pMOG2;
00045
00046         // helper functions for getting a cv::Mat from SoftwareBitmap
00047         bool GetPointerToPixelData(Windows::Graphics::Imaging::SoftwareBitmap^ bitmap,
00048             unsigned char** pPixelData, unsigned int* capacity);
00049
00050         bool TryConvert(Windows::Graphics::Imaging::SoftwareBitmap^ from, cv::Mat& convertedMat);
00051     };
00052 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SubjectPublicKeyInfo::SafeLocalAllocHandle Member List

This is the complete list of members for SubjectPublicKeyInfo::SafeLocalAllocHandle, including all inherited members.
Alloc(int cb) | SubjectPublicKeyInfo::SafeLocalAllocHandle | [inline, static]
AllocCore(int cb) | SubjectPublicKeyInfo::SafeLocalAllocHandle | [inline, private]
ReleaseHandle() | SubjectPublicKeyInfo::SafeLocalAllocHandle | [inline, protected]
SafeLocalAllocHandle() | SubjectPublicKeyInfo::SafeLocalAllocHandle | [inline, private]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
AllItems | Scenario1 |
FlaggedItems | Scenario1 |
ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario1 | [inline, private]
NewItems | Scenario1 |
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
Scenario2_Click(Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args) | Scenario1 | [inline, private]
Scenario3_Click(Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args) | Scenario1 | [inline, private]
ShowItem(SampleDataModel model) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IncrementalLoadingBase Member List

This is the complete list of members for IncrementalLoadingBase, including all inherited members.
_busy | IncrementalLoadingBase | [private]
_storage | IncrementalLoadingBase | [private]
Add(object value) | IncrementalLoadingBase | [inline]
Clear() | IncrementalLoadingBase | [inline]
CollectionChanged | IncrementalLoadingBase |
Contains(object value) | IncrementalLoadingBase | [inline]
CopyTo(Array array, int index) | IncrementalLoadingBase | [inline]
Count | IncrementalLoadingBase |
GetEnumerator() | IncrementalLoadingBase | [inline]
HasMoreItems | IncrementalLoadingBase |
HasMoreItemsOverride() | IncrementalLoadingBase | [protected, pure virtual]
IndexOf(object value) | IncrementalLoadingBase | [inline]
Insert(int index, object value) | IncrementalLoadingBase | [inline]
IsFixedSize | IncrementalLoadingBase |
IsReadOnly | IncrementalLoadingBase |
IsSynchronized | IncrementalLoadingBase |
LoadMoreItemsAsync(uint count) | IncrementalLoadingBase | [inline]
LoadMoreItemsAsync(CancellationToken c, uint count) | IncrementalLoadingBase | [inline, private]
LoadMoreItemsOverrideAsync(CancellationToken c, uint count) | IncrementalLoadingBase | [protected, pure virtual]
NotifyOfInsertedItems(int baseIndex, int count) | IncrementalLoadingBase | [inline, private]
Remove(object value) | IncrementalLoadingBase | [inline]
RemoveAt(int index) | IncrementalLoadingBase | [inline]
SyncRoot | IncrementalLoadingBase |
this | IncrementalLoadingBase |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_SecondaryTiles Member List

This is the complete list of members for Scenario3_SecondaryTiles, including all inherited members.
BADGE_TILE_ID | Scenario3_SecondaryTiles | [private, static]
CreateBadgeAndTextTile_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_SecondaryTiles |
CreateBadgeTile_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3_SecondaryTiles |
GetElementRect(Windows::UI::Xaml::FrameworkElement const &element) | Scenario3_SecondaryTiles | [private, static]
Scenario3_SecondaryTiles() | Scenario3_SecondaryTiles |
TEXT_TILE_ID | Scenario3_SecondaryTiles | [private, static]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PresenceSensor/cppwinrt/pch.cpp Source File

  • PresenceSensor
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/SampleConfiguration.h Source File

  • ExtendedExecution
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Extended Execution";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         static Windows::UI::Notifications::ToastNotification^ DisplayToast(Platform::String^ content);
00039
00040     private:
00041         static Platform::Array<Scenario>^ scenariosInner;
00042     };
00043
00044     public value struct Scenario
00045     {
00046         Platform::String^ Title;
00047         Platform::String^ ClassName;
00048     };
00049
00050     namespace Helpers
00051     {
00052         Windows::Foundation::TimeSpan TimeSpanFromSeconds(int seconds);
00053         Concurrency::task<void> DelayAsync(Windows::Foundation::TimeSpan duration,
00054             Concurrency::cancellation_token cancel = Concurrency::cancellation_token::none());
00055     }
00056 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LanguageFont/cppwinrt/Project.idl Source File

  • LanguageFont
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_UIFonts : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_UIFonts();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_DocumentFonts : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_DocumentFonts();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cpp/SampleConfiguration.h Source File

  • LibraryManagement
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Library management C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
_imagePath | ScenarioElement | [private]
ButtonPickImage_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ButtonPinTile_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
App_Activated(object sender, IActivatedEventArgs e) | ScenarioElement | [inline, private]
Error(string message) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
ScenarioElement_Loaded(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
validateStep1(ValueSet result) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/pch.cpp Source File

  • MapControl
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceResources Member List

This is the complete list of members for DeviceResources, including all inherited members.
AddHolographicCamera(HolographicCamera camera) | DeviceResources | [inline]
cameraResourcesDictionary | DeviceResources | [private]
cameraResourcesLock | DeviceResources | [private]
CreateDeviceIndependentResources() | DeviceResources | [inline, private]
CreateDeviceResources() | DeviceResources | [inline, private]
D2DFactory | DeviceResources |
d2dFactory | DeviceResources | [private]
d3dContext | DeviceResources | [private]
d3dDevice | DeviceResources | [private]
D3DDevice | DeviceResources |
D3DDeviceContext | DeviceResources |
D3DDeviceFeatureLevel | DeviceResources |
D3DDeviceSupportsVprt | DeviceResources |
d3dDeviceSupportsVprt | DeviceResources | [private]
d3dFeatureLevel | DeviceResources | [private]
D3DInteropDevice | DeviceResources |
d3dInteropDevice | DeviceResources | [private]
DeviceLost | DeviceResources |
DeviceResources() | DeviceResources | [inline]
DeviceRestored | DeviceResources |
Dispose() | Disposer | [inline]
Dispose(bool disposeManagedResources) | Disposer | [inline, protected, virtual]
DisposeDeviceAndContext() | DeviceResources | [inline, private]
Disposer() | Disposer | [inline, protected]
dwriteFactory | DeviceResources | [private]
DWriteFactory | DeviceResources |
DxgiAdapter | DeviceResources |
dxgiAdapter | DeviceResources | [private]
EnsureCameraResources(HolographicFrame frame, HolographicFramePrediction prediction) | DeviceResources | [inline]
HandleDeviceLost() | DeviceResources | [inline]
holographicSpace | DeviceResources | [private]
InitializeUsingHolographicSpace() | DeviceResources | [inline]
IsDisposed | Disposer | [protected]
Present(ref HolographicFrame frame) | DeviceResources | [inline]
RemoveAndDispose< T >(ref T objectToDispose) | Disposer | [inline, protected]
RemoveHolographicCamera(HolographicCamera camera) | DeviceResources | [inline]
RemoveToDispose< T >(T objectToRemove) | Disposer | [inline, protected]
SetHolographicSpace(HolographicSpace holographicSpace) | DeviceResources | [inline]
SwapChainAction(Dictionary< uint, CameraResources > cameraResourcesDictionary) | DeviceResources |
SwapChainActionWithResult(Dictionary< uint, CameraResources > cameraResourcesDictionary) | DeviceResources |
ToDispose< T >(T objectToDispose) | Disposer | [inline, protected]
Trim() | DeviceResources | [inline]
UseHolographicCameraResources(SwapChainActionWithResult callback) | DeviceResources | [inline]
UseHolographicCameraResources(SwapChainAction callback) | DeviceResources | [inline]
wicFactory | DeviceResources | [private]
WicImagingFactory | DeviceResources |
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_SingleFolder Member List

This is the complete list of members for Scenario3_SingleFolder, including all inherited members.
PickFolderButton_Click(object sender, RoutedEventArgs e) | Scenario3_SingleFolder | [inline, private]
rootPage | Scenario3_SingleFolder | [private]
Scenario3_SingleFolder() | Scenario3_SingleFolder | [inline]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/SampleConfiguration.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Using this sample app", "SDKTemplate.Scenario_SampleOverview" },
00021     { "Downloadable fonts overview", "SDKTemplate.Scenario_CloudFontOverview" },
00022     { "Document 1", "SDKTemplate.Scenario_Document1" },
00023     { "Document 2", "SDKTemplate.Scenario_Document2" },
00024     { "Document 3", "SDKTemplate.Scenario_Document3" }
00025 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario2_Manage.h Source File

  • PasswordVault
  • cppwinrt

Scenario2_Manage.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Manage.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Manage : Scenario2_ManageT<Scenario2_Manage>
00020     {
00021         Scenario2_Manage();
00022
00023         void RetrieveCredentials_Click(Windows::Foundation::IInspectable const&, Windows::Foundation::IInspectable const&);
00024         void RevealPasswords_Click(Windows::Foundation::IInspectable const&, Windows::Foundation::IInspectable const&);
00025         void RemoveCredentials_Click(Windows::Foundation::IInspectable const&, Windows::Foundation::IInspectable const&);
00026
00027     private:
00028         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00029     };
00030 }
00031
00032 namespace winrt::SDKTemplate::factory_implementation
00033 {
00034     struct Scenario2_Manage : Scenario2_ManageT<Scenario2_Manage, implementation::Scenario2_Manage>
00035     {
00036     };
00037 }
00038
Generated on Fri Nov 15 2024 22:20:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GameConfig Member List

This is the complete list of members for GameConfig, including all inherited members.
autoFire | GameConfig
backgroundAvailable | GameConfig
isTrial | GameConfig
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ConfigureMobileHotspot Member List

This is the complete list of members for Scenario1_ConfigureMobileHotspot, including all inherited members.
AddComboBoxItem(ComboBox comboBox, string name, object value, bool selected) | Scenario1_ConfigureMobileHotspot | [inline, private]
ApplyChanges_Click(object sender, RoutedEventArgs e) | Scenario1_ConfigureMobileHotspot | [inline, private]
DiscardChanges_Click(object sender, RoutedEventArgs e) | Scenario1_ConfigureMobileHotspot | [inline, private]
InitializeTetheringControls() | Scenario1_ConfigureMobileHotspot | [inline, private]
m_applying | Scenario1_ConfigureMobileHotspot | [private]
m_tetheringManager | Scenario1_ConfigureMobileHotspot | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_ConfigureMobileHotspot | [inline, protected]
Scenario1_ConfigureMobileHotspot() | Scenario1_ConfigureMobileHotspot | [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_AdaptiveCard Member List

This is the complete list of members for Scenario3_AdaptiveCard, including all inherited members.
_currentSession | Scenario3_AdaptiveCard | [private]
CreateUserActivityAsync() | Scenario3_AdaptiveCard | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_AdaptiveCard | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_AdaptiveCard | [inline, protected]
Scenario3_AdaptiveCard() | Scenario3_AdaptiveCard | [inline]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/Scenario3_ParameterizedTemplate.cpp Source File

  • DateTimeFormatting
  • cppwinrt

Scenario3_ParameterizedTemplate.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_ParameterizedTemplate.h"
00014 #include "Scenario3_ParameterizedTemplate.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::DateTimeFormatting;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace
00023 {
00024     void GenerateResult(std::wostream& results, DateTimeFormatter const& formatter, DateTime dateToFormat)
00025     {
00026         // Perform the actual formatting.
00027         results << std::wstring_view(formatter.Template()) << L": " << std::wstring_view(formatter.Format(dateToFormat)) << std::endl;
00028     }
00029 }
00030
00031 namespace winrt::SDKTemplate::implementation
00032 {
00033     Scenario3_ParameterizedTemplate::Scenario3_ParameterizedTemplate()
00034     {
00035         InitializeComponent();
00036     }
00037
00038     void Scenario3_ParameterizedTemplate::Display_Click(IInspectable const&, RoutedEventArgs const&)
00039     {
00040         // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00041         // to format a date/time by specifying a template via parameters.  Note that the current application language
00042         // language and region value will determine the pattern of the date returned based on the
00043         // specified parts.
00044
00045         //Get the current application context language
00046         hstring currentLanguage = ApplicationLanguages::Languages().GetAt(0);
00047
00048         // Formatters for dates
00049         std::array dateFormatters{
00050             DateTimeFormatter(
00051                 YearFormat::Full,
00052                 MonthFormat::Abbreviated,
00053                 DayFormat::Default,
00054                 DayOfWeekFormat::Abbreviated),
00055
00056             DateTimeFormatter(
00057                 YearFormat::Abbreviated,
00058                 MonthFormat::Abbreviated,
00059                 DayFormat::Default,
00060                 DayOfWeekFormat::None),
00061
00062             DateTimeFormatter(
00063                 YearFormat::Full,
00064                 MonthFormat::Full,
00065                 DayFormat::None,
00066                 DayOfWeekFormat::None),
00067
00068             DateTimeFormatter(
00069                 YearFormat::None,
00070                 MonthFormat::Full,
00071                 DayFormat::Default,
00072                 DayOfWeekFormat::None),
00073         };
00074
00075         // Formatters for times
00076         std::array timeFormatters{
00077             DateTimeFormatter(
00078                 HourFormat::Default,
00079                 MinuteFormat::Default,
00080                 SecondFormat::Default),
00081
00082             DateTimeFormatter(
00083                 HourFormat::Default,
00084                 MinuteFormat::Default,
00085                 SecondFormat::None),
00086
00087             DateTimeFormatter(
00088                 HourFormat::Default,
00089                 MinuteFormat::None,
00090                 SecondFormat::None),
00091         };
00092
00093         // Obtain the date that will be formatted.
00094         DateTime dateToFormat = clock::now();
00095
00096         // Keep the results here
00097         std::wostringstream results;
00098         results << L"Current application context language: " << std::wstring_view(currentLanguage) << std::endl << std::endl;
00099         results << L"Dates:" << std::endl;
00100
00101         // Generate the results.
00102         for (auto&& formatter : dateFormatters)
00103         {
00104             GenerateResult(results, formatter, dateToFormat);
00105         }
00106
00107         results << std::endl;
00108         results << L"Times:" << std::endl;
00109
00110         // Generate the results.
00111         for (auto&& formatter : timeFormatters)
00112         {
00113             GenerateResult(results, formatter, dateToFormat);
00114         }
00115
00116         // Display the results.
00117         OutputTextBlock().Text(results.str());
00118     }
00119 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameMain.cpp Source File

  • Simple3DGameXaml
  • cpp

GameMain.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MoveLookController.h"
00014 #include "GameMain.h"
00015 #include "GameUIConstants.h"
00016
00017 using namespace Simple3DGameXaml;
00018 using namespace GameControl;
00019 using namespace concurrency;
00020 using namespace DirectX;
00021 using namespace Windows::ApplicationModel;
00022 using namespace Windows::ApplicationModel::Activation;
00023 using namespace Windows::ApplicationModel::Core;
00024 using namespace Windows::ApplicationModel::Store;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Graphics::Display;
00027 using namespace Windows::Storage;
00028 using namespace Windows::UI::Core;
00029 using namespace Windows::UI::Input;
00030 using namespace Windows::UI::ViewManagement;
00031 using namespace Windows::UI::Xaml;
00032 using namespace Windows::UI::Xaml::Media;
00033 using namespace Windows::System::Threading;
00034 using namespace Concurrency;
00035
00036
00037 GameMain::GameMain(const std::shared_ptr<DX::DeviceResources>& deviceResources, Simple3DGameXaml::IGameUIControl^ UIControl) :
00038     m_deviceResources(deviceResources),
00039     m_uiControl(UIControl)
00040 {
00041     m_deviceResources->RegisterDeviceNotify(this);
00042
00043     m_renderer = ref new GameRenderer(m_deviceResources);
00044     m_game = ref new Simple3DGame();
00045
00046     m_controller = ref new MoveLookController(Window::Current->CoreWindow, m_deviceResources->GetSwapChainPanel()->Dispatcher);
00047
00048     m_controller->AutoFire(false);
00049
00050     auto bounds = m_deviceResources->GetLogicalSize();
00051
00052     m_controller->SetMoveRect(
00053         XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
00054         XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
00055         );
00056     m_controller->SetFireRect(
00057         XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
00058         XMFLOAT2(bounds.Width, bounds.Height)
00059         );
00060
00061     SetGameInfoOverlay(GameInfoOverlayState::Loading);
00062     m_uiControl->SetAction(GameInfoOverlayCommand::None);
00063     m_uiControl->ShowGameInfoOverlay();
00064
00065     create_task([this]()
00066     {
00067         // Asynchronously initialize the game class and load the renderer device resources.
00068         // By doing all this asynchronously, the game gets to its main loop more quickly
00069         // and in parallel all the necessary resources are loaded on other threads.
00070         m_game->Initialize(m_controller, m_renderer);
00071
00072         return m_renderer->CreateGameDeviceResourcesAsync(m_game);
00073
00074     }).then([this]()
00075     {
00076         // The finalize code needs to run in the same thread context
00077         // as the m_renderer object was created because the D3D device context
00078         // can ONLY be accessed on a single thread.
00079         {
00080             critical_section::scoped_lock lock(m_criticalSection);
00081             m_renderer->FinalizeCreateGameDeviceResources();
00082         }
00083
00084         InitializeGameState();
00085
00086         if (m_updateState == UpdateEngineState::WaitingForResources)
00087         {
00088             return m_game->LoadLevelAsync().then([this]()
00089             {
00090                 // The m_game object may need to deal with D3D device context work so
00091                 // again the finalize code needs to run in the same thread
00092                 // context as the m_renderer object was created because the D3D
00093                 // device context can ONLY be accessed on a single thread.
00094                 critical_section::scoped_lock lock(m_criticalSection);
00095                 m_game->FinalizeLoadLevel();
00096                 m_game->SetCurrentLevelToSavedState();
00097                 m_updateState = UpdateEngineState::ResourcesLoaded;
00098
00099             }, task_continuation_context::use_current());
00100         }
00101         else
00102         {
00103             // The game is not in the middle of a level so there aren't any level
00104             // resources to load.  Creating a no-op task so that in both cases
00105             // the same continuation logic is used.
00106             return create_task([]()
00107             {
00108             });
00109         }
00110     }, task_continuation_context::use_current()).then([this]()
00111     {
00112         // Since Game loading is an async task, the app visual state
00113         // may be too small or not have focus.  Put the state machine
00114         // into the correct state to reflect these cases.
00115
00116         if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
00117         {
00118             m_updateStateNext = m_updateState;
00119             m_updateState = UpdateEngineState::TooSmall;
00120             m_controller->Active(false);
00121             m_uiControl->HideGameInfoOverlay();
00122             m_uiControl->ShowTooSmall();
00123         }
00124         else if (!m_haveFocus)
00125         {
00126             m_updateStateNext = m_updateState;
00127             m_updateState = UpdateEngineState::Deactivated;
00128             m_controller->Active(false);
00129             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00130         }
00131
00132         if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00133         {
00134             StartRenderLoop();
00135         }
00136     }, task_continuation_context::use_current());
00137 }
00138
00139 //--------------------------------------------------------------------------------------
00140
00141 GameMain::~GameMain()
00142 {
00143     // Deregister device notification
00144     m_deviceResources->RegisterDeviceNotify(nullptr);
00145 }
00146
00147 //--------------------------------------------------------------------------------------
00148
00149 void GameMain::StartRenderLoop()
00150 {
00151     // If the animation render loop is already running then do not start another thread.
00152     if (m_renderLoopWorker != nullptr && m_renderLoopWorker->Status == AsyncStatus::Started)
00153     {
00154         return;
00155     }
00156
00157     // Create a task that will be run on a background thread.
00158     auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^ action)
00159     {
00160         // Calculate the updated frame and render once per vertical blanking interval.
00161         while (action->Status == AsyncStatus::Started)
00162         {
00163             critical_section::scoped_lock lock(m_criticalSection);
00164             Update();
00165             m_renderer->Render();
00166             m_deviceResources->Present();
00167
00168             if (!m_haveFocus || (m_updateState == UpdateEngineState::TooSmall))
00169             {
00170                 // The app is in an inactive state so stop rendering
00171                 // This optimizes for power and allows the framework to become more queiecent
00172                 break;
00173             }
00174         }
00175     });
00176
00177     // Run task on a dedicated high priority background thread.
00178     m_renderLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
00179 }
00180
00181 //--------------------------------------------------------------------------------------
00182
00183 void GameMain::StopRenderLoop()
00184 {
00185     m_renderLoopWorker->Cancel();
00186 }
00187
00188 //--------------------------------------------------------------------------------------
00189
00190 void GameMain::InitializeGameState()
00191 {
00192     // Set up the initial state machine for handling Game playing state.
00193     if (m_game->GameActive() && m_game->LevelActive())
00194     {
00195         // The last time the game terminated it was in the middle
00196         // of a level.
00197         // We are waiting for the user to continue the game.
00198         m_updateState = UpdateEngineState::WaitingForResources;
00199         m_pressResult = PressResultState::ContinueLevel;
00200         SetGameInfoOverlay(GameInfoOverlayState::Pause);
00201         m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00202     }
00203     else if (!m_game->GameActive() && (m_game->HighScore().totalHits > 0))
00204     {
00205         // The last time the game terminated the game had been completed.
00206         // Show the high score.
00207         // We are waiting for the user to acknowledge the high score and start a new game.
00208         // The level resources for the first level will be loaded later.
00209         m_updateState = UpdateEngineState::WaitingForPress;
00210         m_pressResult = PressResultState::LoadGame;
00211         SetGameInfoOverlay(GameInfoOverlayState::GameStats);
00212         m_controller->WaitForPress();
00213         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00214     }
00215     else
00216     {
00217         // This is either the first time the game has run or
00218         // the last time the game terminated the level was completed.
00219         // We are waiting for the user to begin the next level.
00220         m_updateState = UpdateEngineState::WaitingForResources;
00221         m_pressResult = PressResultState::PlayLevel;
00222         SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00223         m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00224     }
00225     m_uiControl->ShowGameInfoOverlay();
00226 }
00227
00228 //--------------------------------------------------------------------------------------
00229
00230 void GameMain::Update()
00231 {
00232     m_controller->Update();
00233
00234     switch (m_updateState)
00235     {
00236     case UpdateEngineState::ResourcesLoaded:
00237         switch (m_pressResult)
00238         {
00239         case PressResultState::LoadGame:
00240             SetGameInfoOverlay(GameInfoOverlayState::GameStats);
00241             break;
00242
00243         case PressResultState::PlayLevel:
00244             SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00245             break;
00246
00247         case PressResultState::ContinueLevel:
00248             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00249             break;
00250         }
00251         m_updateState = UpdateEngineState::WaitingForPress;
00252         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00253         m_controller->WaitForPress();
00254         m_uiControl->ShowGameInfoOverlay();
00255         break;
00256
00257     case UpdateEngineState::WaitingForPress:
00258         if (m_controller->IsPressComplete() || m_pressComplete)
00259         {
00260             m_pressComplete = false;
00261
00262             switch (m_pressResult)
00263             {
00264             case PressResultState::LoadGame:
00265                 m_updateState = UpdateEngineState::WaitingForResources;
00266                 m_pressResult = PressResultState::PlayLevel;
00267                 m_controller->Active(false);
00268                 m_game->LoadGame();
00269                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00270                 SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00271                 m_uiControl->ShowGameInfoOverlay();
00272
00273                 m_game->LoadLevelAsync().then([this]()
00274                 {
00275                     critical_section::scoped_lock lock(m_criticalSection);
00276                     m_game->FinalizeLoadLevel();
00277                     m_updateState = UpdateEngineState::ResourcesLoaded;
00278                 }, task_continuation_context::use_current());
00279                 break;
00280
00281             case PressResultState::PlayLevel:
00282                 m_updateState = UpdateEngineState::Dynamics;
00283                 m_uiControl->HideGameInfoOverlay();
00284                 m_controller->Active(true);
00285                 m_game->StartLevel();
00286                 break;
00287
00288             case PressResultState::ContinueLevel:
00289                 m_updateState = UpdateEngineState::Dynamics;
00290                 m_uiControl->HideGameInfoOverlay();
00291                 m_controller->Active(true);
00292                 m_game->ContinueGame();
00293                 break;
00294             }
00295         }
00296         break;
00297
00298     case UpdateEngineState::Dynamics:
00299         if (m_controller->IsPauseRequested() || m_pauseRequested)
00300         {
00301             m_pauseRequested = false;
00302
00303             m_game->PauseGame();
00304             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00305             m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00306             m_updateState = UpdateEngineState::WaitingForPress;
00307             m_pressResult = PressResultState::ContinueLevel;
00308             m_uiControl->ShowGameInfoOverlay();
00309         }
00310         else
00311         {
00312             GameState runState = m_game->RunGame();
00313             switch (runState)
00314             {
00315             case GameState::TimeExpired:
00316                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00317                 SetGameInfoOverlay(GameInfoOverlayState::GameOverExpired);
00318                 m_uiControl->ShowGameInfoOverlay();
00319                 m_updateState = UpdateEngineState::WaitingForPress;
00320                 m_pressResult = PressResultState::LoadGame;
00321                 break;
00322
00323             case GameState::LevelComplete:
00324                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00325                 SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00326                 m_uiControl->ShowGameInfoOverlay();
00327                 m_updateState = UpdateEngineState::WaitingForResources;
00328                 m_pressResult = PressResultState::PlayLevel;
00329
00330                 m_game->LoadLevelAsync().then([this]()
00331                 {
00332                     critical_section::scoped_lock lock(m_criticalSection);
00333                     m_game->FinalizeLoadLevel();
00334                     m_updateState = UpdateEngineState::ResourcesLoaded;
00335
00336                 }, task_continuation_context::use_current());
00337                 break;
00338
00339             case GameState::GameComplete:
00340                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00341                 SetGameInfoOverlay(GameInfoOverlayState::GameOverCompleted);
00342                 m_uiControl->ShowGameInfoOverlay();
00343                 m_updateState = UpdateEngineState::WaitingForPress;
00344                 m_pressResult = PressResultState::LoadGame;
00345                 break;
00346             }
00347         }
00348
00349         if (m_updateState == UpdateEngineState::WaitingForPress)
00350         {
00351             // Transitioning state, so enable waiting for the press event
00352             m_controller->WaitForPress();
00353         }
00354         if (m_updateState == UpdateEngineState::WaitingForResources)
00355         {
00356             // Transitioning state, so shut down the input controller until resources are loaded
00357             m_controller->Active(false);
00358         }
00359         break;
00360     }
00361 }
00362
00363 //--------------------------------------------------------------------------------------
00364
00365 void GameMain::CreateWindowSizeDependentResources()
00366 {
00367     UpdateLayoutState();
00368     m_renderer->CreateWindowSizeDependentResources();
00369
00370     // The location of the Control regions may have changed with the size change so update the controller.
00371     auto bounds = m_deviceResources->GetLogicalSize();
00372
00373     m_controller->SetMoveRect(
00374         XMFLOAT2(0.0f, bounds.Height - GameConstants::TouchRectangleSize),
00375         XMFLOAT2(GameConstants::TouchRectangleSize, bounds.Height)
00376         );
00377     m_controller->SetFireRect(
00378         XMFLOAT2(bounds.Width - GameConstants::TouchRectangleSize, bounds.Height - GameConstants::TouchRectangleSize),
00379         XMFLOAT2(bounds.Width, bounds.Height)
00380         );
00381
00382     if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00383     {
00384         StartRenderLoop();
00385     }
00386 }
00387
00388 //--------------------------------------------------------------------------------------
00389
00390 void GameMain::OnDeviceLost()
00391 {
00392     if (m_updateState == UpdateEngineState::Dynamics)
00393     {
00394         // Game is in the active game play state, Stop Game Timer and Pause play and save state
00395         m_game->PauseGame();
00396     }
00397     StopRenderLoop();
00398     m_renderer->ReleaseDeviceDependentResources();
00399 }
00400
00401 //--------------------------------------------------------------------------------------
00402
00403 void GameMain::OnDeviceRestored()
00404 {
00405     m_renderer->CreateDeviceDependentResources();
00406     m_renderer->CreateWindowSizeDependentResources();
00407
00408     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00409     SetGameInfoOverlay(GameInfoOverlayState::Loading);
00410     m_updateState = UpdateEngineState::WaitingForResources;
00411
00412     if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00413     {
00414         StartRenderLoop();
00415     }
00416
00417     create_task([this]()
00418     {
00419         return m_renderer->CreateGameDeviceResourcesAsync(m_game);
00420
00421     }).then([this]()
00422     {
00423         // The finalize code needs to run in the same thread context
00424         // as the m_renderer object was created because the D3D device context
00425         // can ONLY be accessed on a single thread.
00426         {
00427             critical_section::scoped_lock lock(m_criticalSection);
00428             m_renderer->FinalizeCreateGameDeviceResources();
00429         }
00430
00431         // Reset the main state machine based on the current game state now
00432         // that the device resources have been restored.
00433         InitializeGameState();
00434
00435         if (m_updateState == UpdateEngineState::WaitingForResources)
00436         {
00437             // In the middle of a game so spin up the async task to load the level.
00438             return m_game->LoadLevelAsync().then([this]()
00439             {
00440                 // The m_game object may need to deal with D3D device context work so
00441                 // again the finalize code needs to run in the same thread
00442                 // context as the m_renderer object was created because the D3D
00443                 // device context can ONLY be accessed on a single thread.
00444                 critical_section::scoped_lock lock(m_criticalSection);
00445                 m_game->FinalizeLoadLevel();
00446                 m_game->SetCurrentLevelToSavedState();
00447                 m_updateState = UpdateEngineState::ResourcesLoaded;
00448
00449             }, task_continuation_context::use_current());
00450         }
00451         else
00452         {
00453             // The game is not in the middle of a level so there aren't any level
00454             // resources to load.  Creating a no-op task so that in both cases
00455             // the same continuation logic is used.
00456             return create_task([]()
00457             {
00458             });
00459         }
00460
00461     }, task_continuation_context::use_current()).then([this]()
00462     {
00463         // Since Device lost is an unexpected event, the app visual state
00464         // may be TooSmall or not have focus.  Put the state machine
00465         // into the correct state to reflect these cases.
00466         auto bounds = m_deviceResources->GetLogicalSize();
00467         if (bounds.Width < GameConstants::MinPlayableWidth)
00468         {
00469             m_updateStateNext = m_updateState;
00470             m_updateState = UpdateEngineState::TooSmall;
00471             m_controller->Active(false);
00472             m_uiControl->HideGameInfoOverlay();
00473             m_uiControl->ShowTooSmall();
00474         }
00475         else if (!m_haveFocus)
00476         {
00477             m_updateStateNext = m_updateState;
00478             m_updateState = UpdateEngineState::Deactivated;
00479             m_controller->Active(false);
00480             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00481         }
00482
00483         if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00484         {
00485             StartRenderLoop();
00486         }
00487     }, task_continuation_context::use_current());
00488 }
00489
00490 //--------------------------------------------------------------------------------------
00491
00492 void GameMain::UpdateLayoutState()
00493 {
00494     if (m_deviceResources->GetLogicalSize().Width < GameConstants::MinPlayableWidth)
00495     {
00496         switch (m_updateState)
00497         {
00498         case UpdateEngineState::Dynamics:
00499             // From Dynamic mode, when coming out of TooSmall layout rather than going directly back into game play
00500             // go to the paused state waiting for user input to continue
00501             m_updateStateNext = UpdateEngineState::WaitingForPress;
00502             m_pressResult = PressResultState::ContinueLevel;
00503             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00504             m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00505             m_game->PauseGame();
00506             break;
00507
00508         case UpdateEngineState::WaitingForResources:
00509             // There is outstanding async loading in progress.  This state change will be picked up after the
00510             // async task is completed.
00511             return;
00512
00513         case UpdateEngineState::WaitingForPress:
00514             // Avoid corrupting the m_updateStateNext on a transition from TooSmall -> TooSmall.
00515             // Otherwise just cache the current state and return to it when leaving TooSmall layout
00516
00517             m_updateStateNext = m_updateState;
00518             break;
00519
00520         default:
00521             break;
00522         }
00523
00524         m_updateState = UpdateEngineState::TooSmall;
00525         m_controller->Active(false);
00526         m_uiControl->HideGameInfoOverlay();
00527         m_uiControl->ShowTooSmall();
00528     }
00529     else
00530     {
00531         if (m_updateState == UpdateEngineState::TooSmall)
00532         {
00533             m_uiControl->HideTooSmall();
00534             m_uiControl->ShowGameInfoOverlay();
00535
00536             if (m_haveFocus)
00537             {
00538                 if (m_updateStateNext == UpdateEngineState::WaitingForPress)
00539                 {
00540                     m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00541                     m_controller->WaitForPress();
00542                 }
00543                 else if (m_updateStateNext == UpdateEngineState::WaitingForResources)
00544                 {
00545                     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00546                 }
00547
00548                 m_updateState = m_updateStateNext;
00549             }
00550             else
00551             {
00552                 m_updateState = UpdateEngineState::Deactivated;
00553                 m_uiControl->SetAction(GameInfoOverlayCommand::None);
00554             }
00555         }
00556         else if (m_updateState == UpdateEngineState::Dynamics)
00557         {
00558             // In Dynamic mode, when a resize event happens, go to the paused state waiting for user input to continue.
00559             m_pressResult = PressResultState::ContinueLevel;
00560             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00561             m_game->PauseGame();
00562             if (m_haveFocus)
00563             {
00564                 m_updateState = UpdateEngineState::WaitingForPress;
00565                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00566                 m_controller->WaitForPress();
00567             }
00568             else
00569             {
00570                 m_updateState = UpdateEngineState::Deactivated;
00571                 m_uiControl->SetAction(GameInfoOverlayCommand::None);
00572             }
00573             m_uiControl->ShowGameInfoOverlay();
00574         }
00575
00576         if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00577         {
00578             StartRenderLoop();
00579         }
00580     }
00581 }
00582
00583 //--------------------------------------------------------------------------------------
00584
00585 void GameMain::ResetGame()
00586 {
00587     m_updateState = UpdateEngineState::WaitingForResources;
00588     m_pressResult = PressResultState::PlayLevel;
00589     m_controller->Active(false);
00590     m_game->LoadGame();
00591     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00592     SetGameInfoOverlay(GameInfoOverlayState::LevelStart);
00593     m_uiControl->ShowGameInfoOverlay();
00594
00595     m_game->LoadLevelAsync().then([this]()
00596     {
00597         critical_section::scoped_lock lock(m_criticalSection);
00598         m_game->FinalizeLoadLevel();
00599         m_updateState = UpdateEngineState::ResourcesLoaded;
00600
00601     }, task_continuation_context::use_current());
00602 }
00603
00604 //--------------------------------------------------------------------------------------
00605
00606 void GameMain::SetGameInfoOverlay(GameInfoOverlayState state)
00607 {
00608     m_gameInfoOverlayState = state;
00609     switch (state)
00610     {
00611     case GameInfoOverlayState::Loading:
00612         m_uiControl->SetGameLoading();
00613         break;
00614
00615     case GameInfoOverlayState::GameStats:
00616         m_uiControl->SetGameStats(
00617             m_game->HighScore().levelCompleted + 1,
00618             m_game->HighScore().totalHits,
00619             m_game->HighScore().totalShots
00620             );
00621         break;
00622
00623     case GameInfoOverlayState::LevelStart:
00624         m_uiControl->SetLevelStart(
00625             m_game->LevelCompleted() + 1,
00626             m_game->CurrentLevel()->Objective(),
00627             m_game->CurrentLevel()->TimeLimit(),
00628             m_game->BonusTime()
00629             );
00630         break;
00631
00632     case GameInfoOverlayState::GameOverCompleted:
00633         m_uiControl->SetGameOver(
00634             true,
00635             m_game->LevelCompleted() + 1,
00636             m_game->TotalHits(),
00637             m_game->TotalShots(),
00638             m_game->HighScore().totalHits
00639             );
00640         break;
00641
00642     case GameInfoOverlayState::GameOverExpired:
00643         m_uiControl->SetGameOver(
00644             false,
00645             m_game->LevelCompleted(),
00646             m_game->TotalHits(),
00647             m_game->TotalShots(),
00648             m_game->HighScore().totalHits
00649             );
00650         break;
00651
00652     case GameInfoOverlayState::Pause:
00653         m_uiControl->SetPause(
00654             m_game->LevelCompleted() + 1,
00655             m_game->TotalHits(),
00656             m_game->TotalShots(),
00657             m_game->TimeRemaining()
00658             );
00659         break;
00660     }
00661 }
00662
00663 //--------------------------------------------------------------------------------------
00664
00665 void GameMain::WindowActivationChanged(CoreWindowActivationState activationState)
00666 {
00667     if (activationState == CoreWindowActivationState::Deactivated)
00668     {
00669         m_haveFocus = false;
00670
00671         switch (m_updateState)
00672         {
00673         case UpdateEngineState::Dynamics:
00674             // From Dynamic mode, when coming out of Deactivated rather than going directly back into game play
00675             // go to the paused state waiting for user input to continue
00676             m_updateStateNext = UpdateEngineState::WaitingForPress;
00677             m_pressResult = PressResultState::ContinueLevel;
00678             SetGameInfoOverlay(GameInfoOverlayState::Pause);
00679             m_uiControl->ShowGameInfoOverlay();
00680             m_game->PauseGame();
00681             m_updateState = UpdateEngineState::Deactivated;
00682             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00683             break;
00684
00685         case UpdateEngineState::WaitingForResources:
00686         case UpdateEngineState::WaitingForPress:
00687             m_updateStateNext = m_updateState;
00688             m_updateState = UpdateEngineState::Deactivated;
00689             m_uiControl->SetAction(GameInfoOverlayCommand::None);
00690             m_uiControl->ShowGameInfoOverlay();
00691             break;
00692         }
00693         // Don't have focus so shutdown input processing
00694         m_controller->Active(false);
00695     }
00696     else if (activationState == CoreWindowActivationState::CodeActivated
00697         || activationState == CoreWindowActivationState::PointerActivated)
00698     {
00699         m_haveFocus = true;
00700
00701         if (m_updateState == UpdateEngineState::Deactivated)
00702         {
00703             m_updateState = m_updateStateNext;
00704
00705             if (m_updateState == UpdateEngineState::WaitingForPress)
00706             {
00707                 m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00708                 m_controller->WaitForPress();
00709             }
00710             else if (m_updateStateNext == UpdateEngineState::WaitingForResources)
00711             {
00712                 m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00713             }
00714
00715             if (m_renderLoopWorker == nullptr || m_renderLoopWorker->Status != AsyncStatus::Started)
00716             {
00717                 StartRenderLoop();
00718             }
00719         }
00720     }
00721 }
00722
00723 //--------------------------------------------------------------------------------------
00724
00725 void GameMain::Suspend()
00726 {
00727     // Save application state.
00728     switch (m_updateState)
00729     {
00730     case UpdateEngineState::Dynamics:
00731         // Game is in the active game play state, Stop Game Timer and Pause play and save state
00732         m_uiControl->SetAction(GameInfoOverlayCommand::None);
00733         SetGameInfoOverlay(GameInfoOverlayState::Pause);
00734         m_updateStateNext = UpdateEngineState::WaitingForPress;
00735         m_pressResult = PressResultState::ContinueLevel;
00736         m_game->PauseGame();
00737         break;
00738
00739     case UpdateEngineState::WaitingForResources:
00740     case UpdateEngineState::WaitingForPress:
00741         m_updateStateNext = m_updateState;
00742         break;
00743
00744     default:
00745         // any other state don't save as next state as they are trancient states and have already set m_updateStateNext
00746         break;
00747     }
00748     m_updateState = UpdateEngineState::Suspended;
00749
00750     m_controller->Active(false);
00751     m_game->OnSuspending();
00752 }
00753
00754 //--------------------------------------------------------------------------------------
00755
00756 void GameMain::Resume()
00757 {
00758     if (m_haveFocus)
00759     {
00760         m_updateState = m_updateStateNext;
00761     }
00762     else
00763     {
00764         m_updateState = UpdateEngineState::Deactivated;
00765     }
00766
00767     if (m_updateState == UpdateEngineState::WaitingForPress)
00768     {
00769         m_uiControl->SetAction(GameInfoOverlayCommand::TapToContinue);
00770         m_controller->WaitForPress();
00771     }
00772     m_game->OnResuming();
00773     m_uiControl->ShowGameInfoOverlay();
00774 }
00775
00776 //--------------------------------------------------------------------------------------
00777
00778 void GameMain::SetBackground(unsigned int background)
00779 {
00780     m_game->SetBackground(background);
00781 }
00782
00783 //--------------------------------------------------------------------------------------
00784
00785 void GameMain::CycleBackground()
00786 {
00787     m_game->CycleBackground();
00788
00789
00790     m_uiControl->SetAction(GameInfoOverlayCommand::PleaseWait);
00791     SetGameInfoOverlay(GameInfoOverlayState::Loading);
00792     m_updateState = UpdateEngineState::WaitingForResources;
00793
00794     create_task([this]()
00795     {
00796         return m_renderer->LoadLevelResourcesAsync();
00797
00798     }).then([this]()
00799     {
00800         // The finalize code needs to run in the same thread context
00801         // as the m_renderer object was created because the D3D device context
00802         // can ONLY be accessed on a single thread.
00803         critical_section::scoped_lock lock(m_criticalSection);
00804         m_renderer->FinalizeLoadLevelResources();
00805         m_updateState = UpdateEngineState::ResourcesLoaded;
00806
00807     }, task_continuation_context::use_current());
00808
00809 }
00810
00811 //--------------------------------------------------------------------------------------
00812
00813 void GameMain::LicenseChanged(
00814     ListingInformation^ listing,
00815     LicenseInformation^ license
00816     )
00817 {
00818     m_listingInformation = listing;
00819     m_licenseInformation = license;
00820
00821     m_game->UpdateGameConfig(m_licenseInformation);
00822
00823     if (m_licenseInformation->IsActive)
00824     {
00825         if (m_licenseInformation->IsTrial)
00826         {
00827             m_renderer->Hud()->SetLicenseInfo("Trial Version");
00828         }
00829         else
00830         {
00831             m_renderer->Hud()->SetLicenseInfo("Full Version");
00832         }
00833     }
00834     else
00835     {
00836         m_renderer->Hud()->SetLicenseInfo("License Inactive - defaulting to Trial Version");
00837     }
00838 }
00839
00840 //--------------------------------------------------------------------------------------
00841
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlugInFilter Member List

This is the complete list of members for PlugInFilter, including all inherited members.
Close() | PlugInFilter |
m_innerFilter | PlugInFilter | [private]
PlugInFilter(Windows::Web::Http::Filters::IHttpFilter const &innerFilter) | PlugInFilter |
SendRequestAsync(Windows::Web::Http::HttpRequestMessage request) | PlugInFilter |
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Print Member List

This is the complete list of members for Scenario1_Print, including all inherited members.
CreateFromXml_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Print |
CreateProgrammatically_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Print |
EnablePackageOperationButtons() | Scenario1_Print | [private]
LoadPackageFromFile_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Print |
OnTaskRequested(Windows::Graphics::Printing3D::Print3DManager const &sender, Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs const &args) | Scenario1_Print | [private]
PrintPackage_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Print |
SavePackage_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Print |
Scenario1_Print() | Scenario1_Print |
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario1.h Source File

  • WindowsAudioSession
  • cppwinrt

Scenario1.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include "Scenario1.g.h"
00014 #include "MainPage.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1 : Scenario1T<Scenario1>
00019     {
00020         Scenario1();
00021
00022         fire_and_forget Enumerate_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023
00024     private:
00025         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct Scenario1 : Scenario1T<Scenario1, implementation::Scenario1>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario3.h Source File

  • Logging
  • cppwinrt

Scenario3.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3.g.h"
00015 #include "FileLoggingSessionScenario.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario3 : Scenario3T<Scenario3>
00020     {
00021         Scenario3();
00022
00023         fire_and_forget
00024         DoScenario(
00025             Windows::Foundation::IInspectable const& sender,
00026             Windows::UI::Xaml::RoutedEventArgs const& args);
00027
00028         fire_and_forget
00029         EnableDisableLogging(
00030             Windows::Foundation::IInspectable const& sender,
00031             Windows::UI::Xaml::RoutedEventArgs const& args);
00032
00033         void
00034             OnNavigatedTo(
00035                 Windows::UI::Xaml::Navigation::NavigationEventArgs const& args);
00036
00037         void
00038             OnNavigatedFrom(
00039                 Windows::UI::Xaml::Navigation::NavigationEventArgs const& args);
00040
00041     private:
00042
00043         void
00044         UpdateControls();
00045
00046         void
00047         AddMessage(_In_ LPCWSTR message);
00048
00049         void
00050         AddLogFileMessage(
00051             _In_ LPCWSTR message,
00052             _In_opt_ LPCWSTR logFileFullPath);
00053
00054         fire_and_forget
00055         OnStatusChanged(SDKTemplate::LoggingScenarioEventArgs args);
00056
00057         FileLoggingSessionScenario& _instance = FileLoggingSessionScenario::Instance();
00058         event_token _statusChangedToken;
00059     };
00060 }
00061
00062 namespace winrt::SDKTemplate::factory_implementation
00063 {
00064     struct Scenario3 : Scenario3T<Scenario3, implementation::Scenario3>
00065     {
00066     };
00067 }
Generated on Fri Nov 15 2024 22:19:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_ConfigureMobileHotspot Member List

This is the complete list of members for Scenario1_ConfigureMobileHotspot, including all inherited members.
AddComboBoxItem(Windows::UI::Xaml::Controls::ComboBox const &comboBox, hstring name, Windows::Foundation::IInspectable const &tag, bool selected) | Scenario1_ConfigureMobileHotspot | [private]
AddComboBoxItem(Windows::UI::Xaml::Controls::ComboBox const &comboBox, T value, bool selected) | Scenario1_ConfigureMobileHotspot | [inline, private]
ApplyChanges_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_ConfigureMobileHotspot |
DiscardChanges_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario1_ConfigureMobileHotspot |
InitializeTetheringControls() | Scenario1_ConfigureMobileHotspot | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_ConfigureMobileHotspot |
Scenario1_ConfigureMobileHotspot() | Scenario1_ConfigureMobileHotspot |
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/Scenario1_Colors.xaml.cs Source File

  • TitleBar
  • cs

Scenario1_Colors.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.ComponentModel;
00013 using Windows.UI;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public sealed partial class Scenario1_Colors : Page, INotifyPropertyChanged
00021     {
00022         public Scenario1_Colors()
00023         {
00024             this.InitializeComponent();
00025             titleBar = ApplicationView.GetForCurrentView().TitleBar;
00026
00027             // Infer the radio button selection from the title bar colors.
00028             if (titleBar.ButtonBackgroundColor == null)
00029             {
00030                 UseStandardColors.IsChecked = true;
00031             }
00032             else if (titleBar.ButtonBackgroundColor.Value.A > 0)
00033             {
00034                 UseCustomColors.IsChecked = true;
00035             }
00036             else
00037             {
00038                 TransparentWhenExtended.IsChecked = true;
00039             }
00040         }
00041
00042         #region Data binding
00043         public event PropertyChangedEventHandler PropertyChanged;
00044
00045         private ApplicationViewTitleBar titleBar;
00046
00047         public ApplicationViewTitleBar TitleBar
00048         {
00049             get { return titleBar; }
00050         }
00051         #endregion
00052
00053         private void UseCustomColors_Click(object sender, RoutedEventArgs e)
00054         {
00055             UpdateColors();
00056         }
00057
00058         private void UpdateColors()
00059         {
00060             if (UseStandardColors.IsChecked.Value)
00061             {
00062                 // Setting colors to null returns them to system defaults.
00063                 titleBar.BackgroundColor = null;
00064                 titleBar.ForegroundColor = null;
00065                 titleBar.InactiveBackgroundColor = null;
00066                 titleBar.InactiveForegroundColor = null;
00067
00068                 titleBar.ButtonBackgroundColor = null;
00069                 titleBar.ButtonHoverBackgroundColor = null;
00070                 titleBar.ButtonPressedBackgroundColor = null;
00071                 titleBar.ButtonInactiveBackgroundColor = null;
00072
00073                 titleBar.ButtonForegroundColor = null;
00074                 titleBar.ButtonHoverForegroundColor = null;
00075                 titleBar.ButtonPressedForegroundColor = null;
00076                 titleBar.ButtonInactiveForegroundColor = null;
00077             }
00078             else
00079             {
00080                 // Title bar colors. Alpha must be 255.
00081                 titleBar.BackgroundColor = new Color() { A = 255, R = 54, G = 60, B = 116 };
00082                 titleBar.ForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
00083                 titleBar.InactiveBackgroundColor = new Color() { A = 255, R = 135, G = 141, B = 199 };
00084                 titleBar.InactiveForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
00085
00086                 // Title bar button background colors. Alpha is respected when the view is extended
00087                 // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
00088                 byte buttonAlpha = (byte)(TransparentWhenExtended.IsChecked.Value ? 0 : 255);
00089                 titleBar.ButtonBackgroundColor = new Color() { A = buttonAlpha, R = 54, G = 60, B = 116 };
00090                 titleBar.ButtonHoverBackgroundColor = new Color() { A = buttonAlpha, R = 19, G = 21, B = 40 };
00091                 titleBar.ButtonPressedBackgroundColor = new Color() { A = buttonAlpha, R = 232, G = 211, B = 162 };
00092                 titleBar.ButtonInactiveBackgroundColor = new Color() { A = buttonAlpha, R = 135, G = 141, B = 199 };
00093
00094                 // Title bar button foreground colors. Alpha must be 255.
00095                 titleBar.ButtonForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
00096                 titleBar.ButtonHoverForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
00097                 titleBar.ButtonPressedForegroundColor = new Color() { A = 255, R = 54, G = 60, B = 116 };
00098                 titleBar.ButtonInactiveForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
00099             }
00100
00101             if (PropertyChanged != null)
00102             {
00103                 PropertyChanged(this, new PropertyChangedEventArgs("TitleBar"));
00104             }
00105         }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:21:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DPhotoAdjustment/cpp/App.xaml.h Source File

  • D2DPhotoAdjustment
  • cpp

App.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015 #include "DirectXPage.xaml.h"
00016
00017 namespace D2DPhotoAdjustment
00018 {
00019     /// <summary>
00020     /// Provides application-specific behavior to supplement the default Application class.
00021     /// </summary>
00022     ref class App sealed
00023     {
00024     public:
00025         App();
00026         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00027
00028     private:
00029         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00030         void OnResuming(Platform::Object ^sender, Platform::Object ^args);
00031         DirectXPage^ m_directXPage;
00032     };
00033 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario1_WriteReadStream.xaml.cpp Source File

  • DataReaderWriter
  • cpp

Scenario1_WriteReadStream.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // WriteReadStream.xaml.cpp
00014 // Implementation of the WriteReadStream class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_WriteReadStream.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Storage::Streams;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 Array<String^>^ _inputElements = ref new Array<String^>
00030 {
00031     "Hello", "World", "1 2 3 4 5", "Très bien!", "Goodbye"
00032 };
00033
00034 WriteReadStream::WriteReadStream()
00035 {
00036     InitializeComponent();
00037
00038     // Populate the text block with the input elements.
00039     ElementsToWrite->Text = "";
00040     for (unsigned int i = 0; i < _inputElements->Length; i++)
00041     {
00042         ElementsToWrite->Text += _inputElements[i] + ";";
00043     }
00044 }
00045
00046 /// <summary>
00047 /// Invoked when this page is about to be displayed in a Frame.
00048 /// </summary>
00049 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00050 /// property is typically used to configure the page.</param>
00051 void WriteReadStream::OnNavigatedTo(NavigationEventArgs^ e)
00052 {
00053     // Get a pointer to our main page.
00054     rootPage = MainPage::Current;
00055 }
00056
00057 /// <summary>
00058 /// This is the click handler for the 'Copy Strings' button.  Here we will parse the
00059 /// strings contained in the ElementsToWrite text block, write them to a stream using
00060 /// DataWriter, retrieve them using DataReader, and output the results in the
00061 /// ElementsRead text block.
00062 /// </summary>
00063 /// <param name="sender">Contains information about the button that fired the event.</param>
00064 /// <param name="e">Contains state information and event data associated with a routed event.</param>
00065 void WriteReadStream::TransferData(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00066 {
00067     // Initialize the in-memory stream where data will be stored.
00068     InMemoryRandomAccessStream^ stream = ref new InMemoryRandomAccessStream();
00069
00070     // Create the DataWriter object backed by the in-memory stream.  When
00071     // dataWriter is deleted, it will also close the underlying stream.
00072     DataWriter^ dataWriter = ref new DataWriter(stream);
00073     dataWriter->UnicodeEncoding = UnicodeEncoding::Utf8;
00074     dataWriter->ByteOrder = ByteOrder::LittleEndian;
00075
00076     // Create the data reader by using the input stream set at position 0 so that
00077     // the stream will be read from the beginning regardless of where the position
00078     // the original stream ends up in after the store.
00079     DataReader^ dataReader = ref new DataReader(stream);
00080     // The encoding and byte order need to match the settings of the writer we previously used.
00081     dataReader->UnicodeEncoding = UnicodeEncoding::Utf8;
00082     dataReader->ByteOrder = ByteOrder::LittleEndian;
00083
00084     // Write the input data to the output stream.  Serialize the elements by writing
00085     // each string separately, preceded by its length.
00086     for (unsigned int i = 0; i < _inputElements->Length; i++)
00087     {
00088         unsigned int inputElementSize = dataWriter->MeasureString(_inputElements[i]);
00089         dataWriter->WriteUInt32(inputElementSize);
00090         dataWriter->WriteString(_inputElements[i]);
00091     }
00092
00093     // Send the contents of the writer to the backing stream.
00094     create_task(dataWriter->StoreAsync()).then([this, dataWriter](unsigned int bytesStored)
00095     {
00096         // For the in-memory stream implementation we are using, the FlushAsync() call is superfluous,
00097         // but other types of streams may require it.
00098         return dataWriter->FlushAsync();
00099     }).then([this, dataReader, stream, dataWriter](bool flushOp)
00100     {
00101         // In order to prolong the lifetime of the stream, detach it from the DataWriter so that it
00102         // will not be closed when the dataWriter is destructed. Were we to fail to detach the
00103         // stream, the dataWriter destructor would close the underlying stream, preventing
00104         // its subsequent use by the DataReader below.
00105         dataWriter->DetachStream();
00106
00107         // Put the stream back at its start for the DataReader::LoadAsync call.
00108         stream->Seek(0);
00109
00110         // Once we have written the contents successfully we load the stream.
00111         return dataReader->LoadAsync((unsigned int)(stream->Size));
00112     }).then([this, dataReader](task<unsigned int> bytesLoaded)
00113     {
00114         try
00115         {
00116             // Check for possible exceptions that could have been thrown in the async call chain.
00117             bytesLoaded.get();
00118
00119             String^ readFromStream = "";
00120
00121             // Keep reading until we consume the complete stream.
00122             while (dataReader->UnconsumedBufferLength > 0)
00123             {
00124                 // Note that the call to ReadString requires a length of "code units" to read. This
00125                 // is the reason each string is preceded by its length when "on the wire".
00126                 unsigned int bytesToRead = dataReader->ReadUInt32();
00127                 readFromStream += dataReader->ReadString(bytesToRead) + "\n";
00128             }
00129
00130             // Populate the ElementsRead text block with the items we read from the stream
00131             ElementsRead->Text = readFromStream;
00132         }
00133         catch (Exception^ e)
00134         {
00135             ElementsRead->Text = "Error: " + e->Message;
00136         }
00137     });
00138 }
Generated on Fri Nov 15 2024 22:19:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SettingsViewModel Member List

This is the complete list of members for SettingsViewModel, including all inherited members.
PropertyChanged | SettingsViewModel |
RaisePropertyChanged(string propertyName) | SettingsViewModel | [inline, private]
ToastOnAppEvents | SettingsViewModel |
UseCustomControls | SettingsViewModel |
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeDecoder/Properties/AssemblyInfo.cs Source File

  • BarcodeScannerProvider
  • cs
  • BarcodeDecoder
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BarcodeDecoder")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BarcodeDecoder")]
00013 [assembly: AssemblyCopyright("Copyright ©  2018")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cs/SampleConfiguration.cs Source File

  • FileSearch
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "File search C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Obtain all files that match a search query", ClassType = typeof(Scenario1) },
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/ToastNotificationManagerHistory/ClearAll/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • ToastNotificationManagerHistory
  • ClearAll

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using BackgroundTasks.Helpers;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.Toasts.ToastNotificationManagerHistory.ClearAll
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         public ScenarioElement()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         private void ButtonPopToasts_Click(object sender, RoutedEventArgs e)
00021         {
00022             ButtonPopToasts.IsEnabled = false;
00023
00024             ToastHelper.PopToast("First toast", "This is the first toast");
00025             ToastHelper.PopToast("Second toast", "This is the second toast");
00026             ToastHelper.PopToast("Third toast", "This is the third toast");
00027
00028             ButtonPopToasts.IsEnabled = true;
00029         }
00030
00031         private void ButtonClearAll_Click(object sender, RoutedEventArgs e)
00032         {
00033             ButtonClearAll.IsEnabled = false;
00034
00035             ToastNotificationManager.History.Clear();
00036
00037             ButtonClearAll.IsEnabled = true;
00038         }
00039     }
00040 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cppwinrt/SampleConfiguration.h Source File

  • FolderEnumeration
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     struct Helpers
00018     {
00019         static Windows::UI::Xaml::Controls::TextBlock CreateHeaderTextBlock(param::hstring const& contents);
00020         static Windows::UI::Xaml::Controls::TextBlock CreateLineItemTextBlock(param::hstring const& contents);
00021     };
00022 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/Scenario4_OrientationChanged.xaml.cs Source File

  • Accelerometer
  • cs

Scenario4_OrientationChanged.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.Sensors;
00014 using Windows.Graphics.Display;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario4_OrientationChanged : Page
00026     {
00027         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00028         // as NotifyUser()
00029         MainPage rootPage = MainPage.Current;
00030
00031         Accelerometer accelerometerOriginal;
00032         Accelerometer accelerometerReadingTransform;
00033         DisplayInformation displayInformation;
00034
00035         public Scenario4_OrientationChanged()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042             // Get two instances of the accelerometer:
00043             // One that returns the raw accelerometer data
00044             accelerometerOriginal = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
00045             // Other on which the 'ReadingTransform' is updated so that data returned aligns with the request transformation.
00046             accelerometerReadingTransform = Accelerometer.GetDefault(rootPage.AccelerometerReadingType);
00047
00048             if (accelerometerOriginal == null || accelerometerReadingTransform == null)
00049             {
00050                 rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer not found", NotifyType.ErrorMessage);
00051             }
00052             else
00053             {
00054                 rootPage.NotifyUser(rootPage.AccelerometerReadingType + " accelerometer ready", NotifyType.StatusMessage);
00055                 ScenarioEnableButton.IsEnabled = true;
00056             }
00057
00058             // Register for orientation change
00059             displayInformation = DisplayInformation.GetForCurrentView();
00060             displayInformation.OrientationChanged += displayInformation_OrientationChanged;
00061         }
00062
00063         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00064         {
00065             if (ScenarioDisableButton.IsEnabled)
00066             {
00067                 ScenarioDisable();
00068             }
00069
00070             displayInformation.OrientationChanged -= displayInformation_OrientationChanged;
00071         }
00072
00073
00074         /// <summary>
00075         /// Invoked when there is a change in the display orientation.
00076         /// </summary>
00077         /// <param name="sender">
00078         /// DisplayInformation object from which the new Orientation can be determined
00079         /// </param>
00080         /// <param name="e"></param>
00081         void displayInformation_OrientationChanged(DisplayInformation sender, object args)
00082         {
00083             if (null != accelerometerReadingTransform)
00084             {
00085                 accelerometerReadingTransform.ReadingTransform = sender.CurrentOrientation;
00086             }
00087         }
00088
00089         /// <summary>
00090         /// This is the click handler for the 'Enable' button.
00091         /// </summary>
00092         void ScenarioEnable()
00093         {
00094             // Establish the report interval
00095             accelerometerOriginal.ReportInterval = accelerometerOriginal.MinimumReportInterval;
00096             accelerometerReadingTransform.ReportInterval = accelerometerReadingTransform.MinimumReportInterval;
00097
00098             // Establish the ReadingTransform to align with the current display orientation, so
00099             // that the accelerometer data from 'accelerometerReadingTransform' will align with the
00100             // current display orientation
00101             accelerometerReadingTransform.ReadingTransform = displayInformation.CurrentOrientation;
00102
00103             Window.Current.VisibilityChanged += Current_VisibilityChanged;
00104             accelerometerOriginal.ReadingChanged += _accelerometerOriginal_ReadingChanged;
00105             accelerometerReadingTransform.ReadingChanged += _accelerometerReadingTransform_ReadingChanged;
00106
00107             ScenarioEnableButton.IsEnabled = false;
00108             ScenarioDisableButton.IsEnabled = true;
00109         }
00110
00111         /// <summary>
00112         /// This is the event handler for ReadingChanged event of the 'accelerometerOriginal' and should
00113         /// notify of the accelerometer reading changes.
00114         /// </summary>
00115         /// <param name="sender"></param>
00116         /// <param name="args">
00117         /// Event data represents the accelerometer reading in its original reference frame.
00118         /// </param>
00119         async void _accelerometerOriginal_ReadingChanged(Accelerometer sender, AccelerometerReadingChangedEventArgs args)
00120         {
00121             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00122             {
00123                 MainPage.SetReadingText(ScenarioOutputOriginal, args.Reading);
00124             });
00125         }
00126
00127
00128         /// <summary>
00129         /// This is the event handler for ReadingChanged event of the 'accelerometerReadingTransform' and should
00130         /// notify of the accelerometer reading changes.
00131         /// </summary>
00132         /// <param name="sender"></param>
00133         /// <param name="args">
00134         /// Event data represents the accelerometer reading in its original reference frame.
00135         /// </param>
00136         async void _accelerometerReadingTransform_ReadingChanged(Accelerometer sender, AccelerometerReadingChangedEventArgs args)
00137         {
00138             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00139             {
00140                 MainPage.SetReadingText(ScenarioOutputReadingTransform, args.Reading);
00141             });
00142         }
00143
00144         /// <summary>
00145         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00146         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00147         /// </summary>
00148         /// <param name="sender"></param>
00149         /// <param name="e">
00150         /// Event data that can be examined for the current visibility state.
00151         /// </param>
00152         void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00153         {
00154             if (ScenarioDisableButton.IsEnabled)
00155             {
00156                 if (e.Visible)
00157                 {
00158                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00159                     accelerometerOriginal.ReadingChanged += _accelerometerOriginal_ReadingChanged;
00160                     accelerometerReadingTransform.ReadingChanged += _accelerometerReadingTransform_ReadingChanged;
00161                 }
00162                 else
00163                 {
00164                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00165                     accelerometerOriginal.ReadingChanged -= _accelerometerOriginal_ReadingChanged;
00166                     accelerometerReadingTransform.ReadingChanged -= _accelerometerReadingTransform_ReadingChanged;
00167                 }
00168             }
00169         }
00170
00171         /// <summary>
00172         /// This is the click handler for the 'Disable' button.
00173         /// </summary>
00174         void ScenarioDisable()
00175         {
00176             Window.Current.VisibilityChanged -= Current_VisibilityChanged;
00177             accelerometerOriginal.ReadingChanged -= _accelerometerOriginal_ReadingChanged;
00178             accelerometerReadingTransform.ReadingChanged -= _accelerometerReadingTransform_ReadingChanged;
00179
00180             // Restore the default report interval to release resources while the sensor is not in use
00181             accelerometerOriginal.ReportInterval = 0;
00182             accelerometerReadingTransform.ReportInterval = 0;
00183
00184             ScenarioEnableButton.IsEnabled = true;
00185             ScenarioDisableButton.IsEnabled = false;
00186         }
00187     }
00188 }
Generated on Fri Nov 15 2024 22:17:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario2_ManageAccount.xaml.cpp Source File

  • UserDataAccountManager
  • cpp

Scenario2_ManageAccount.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_ManageAccount.xaml.h"
00014 #include <ppltasks.h>
00015
00016 using namespace SDKTemplate;
00017 using namespace concurrency;
00018
00019 using namespace Platform;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace Windows::ApplicationModel;
00030 using namespace Windows::ApplicationModel::UserDataAccounts;
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 Scenario2_ManageAccount::Scenario2_ManageAccount() : rootPage(MainPage::Current)
00035 {
00036     InitializeComponent();
00037 }
00038
00039 void Scenario2_ManageAccount::OnNavigatedTo(NavigationEventArgs^ e)
00040 {
00041     rootPage->LoadDataAccountsAsync(AccountsListComboBox);
00042
00043 }
00044
00045 void Scenario2_ManageAccount::Manage_Click(Object^ sender, RoutedEventArgs^ e)
00046 {
00047     auto selectedAccount = safe_cast<UserDataAccountViewModel^>(AccountsListComboBox->SelectedValue);
00048     if (selectedAccount != nullptr)
00049     {
00050         // only one instance of the UserDataAccountManager pane can be launched at once per thread
00051         if (isLaunched == false)
00052         {
00053             isLaunched = true;
00054             create_task(UserDataAccounts::UserDataAccountManager::ShowAccountSettingsAsync(selectedAccount->Account->Id)).then([this]()
00055             {
00056                 // User may have deleted the account
00057                 return rootPage->LoadDataAccountsAsync(AccountsListComboBox);
00058             }).then([this]()
00059             {
00060                 isLaunched = false;
00061             });
00062         }
00063     }
00064 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario2.xaml.h Source File

  • DpiScaling
  • cpp

Scenario2.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     [Windows::Foundation::Metadata::WebHostHidden]
00028     public ref class Scenario2 sealed
00029     {
00030     public:
00031         Scenario2();
00032
00033     protected:
00034         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00035         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037     private:
00038         // Helpers to convert between points and pixels.
00039         double PtFromPx(double pixel);
00040         double PxFromPt(double pt);
00041
00042         Platform::String^ StringFromDouble(double);
00043         void OutputSettings(double rawPixelsPerViewPixel, Windows::UI::Xaml::FrameworkElement^ rectangle, Windows::UI::Xaml::Controls::TextBlock^ relativePxText,
00044                             Windows::UI::Xaml::Controls::TextBlock^ physicalPxText, Windows::UI::Xaml::Controls::TextBlock^ fontTextBlock);
00045         void ResetOutput();
00046         void DisplayProperties_DpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
00047
00048         Windows::Foundation::EventRegistrationToken token;
00049     };
00050 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cpp/Content.xaml.cpp Source File

  • KeyCredentialManager
  • cpp

Content.xaml.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Content.xaml.h"
00003 #include "UserSelect.xaml.h"
00004 #include "MainPage.xaml.h"
00005
00006 using namespace SDKTemplate;
00007 using namespace Platform;
00008 using namespace Windows::UI::Xaml::Navigation;
00009 using namespace Windows::UI::Xaml::Interop;
00010 using namespace Windows::UI::Xaml;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Foundation::Collections;
00013 using namespace Windows::UI::Xaml::Controls;
00014 using namespace Windows::UI::Xaml::Controls::Primitives;
00015 using namespace Windows::UI::Xaml::Data;
00016 using namespace Windows::UI::Xaml::Input;
00017 using namespace Windows::UI::Xaml::Media;
00018 using namespace Windows::Security::Credentials;
00019
00020 Content::Content()
00021 {
00022     InitializeComponent();
00023     rootPage = MainPage::Current;
00024 }
00025
00026 void Content::OnNavigatedTo(NavigationEventArgs^ e)
00027 {
00028     m_activeAccount = (Account^) e->Parameter;
00029 }
00030
00031 void Content::Button_Restart_Click(Object^ sender, RoutedEventArgs^ e)
00032 {
00033     TypeName userSelectType = { "SDKTemplate.UserSelect", TypeKind::Custom };
00034     this->Frame->Navigate(userSelectType);
00035 }
00036
00037 void Content::Button_Forget_Click(Object^ sender, RoutedEventArgs^ e)
00038 {
00039     PassportDelete();
00040
00041     //Remove account from the in-memory account list
00042     for (unsigned int i = 0; i < UserSelect::m_accountList->Size; i++)
00043     {
00044         Account^ a = UserSelect::m_accountList->GetAt(i);
00045         if (a->Email == m_activeAccount->Email)
00046         {
00047             UserSelect::m_accountList->RemoveAt(i);
00048             break;
00049         }
00050     }
00051 }
00052
00053 /// <summary>
00054 /// Checks the KeyCredentialManager to see if there is a Passport for the current user and
00055 /// sends the informaton to the server to unregister it.
00056 ///
00057 /// Then deletes the local key associated with the Passport.
00058 /// </summary>
00059 void Content::PassportDelete()
00060 {
00061     if (m_activeAccount->UsesPassport == true)
00062     {
00063         concurrency::create_task(KeyCredentialManager::OpenAsync(m_activeAccount->Email))
00064             .then([this](KeyCredentialRetrievalResult^ keyOpenResult)
00065         {
00066             if (keyOpenResult->Status == KeyCredentialStatus::Success)
00067             {
00068                 auto userKey = keyOpenResult->Credential;
00069                 auto publicKey = userKey->RetrievePublicKey();
00070
00071                 // Send key information to server to unregister it
00072                 DeletePassportServerSide();
00073
00074                 concurrency::create_task(KeyCredentialManager::DeleteAsync(m_activeAccount->Email))
00075                     .get();
00076             }
00077         });
00078     }
00079
00080     rootPage->NotifyUser("User " + m_activeAccount->Email + " deleted.", NotifyType::StatusMessage);
00081     button_Forget->IsEnabled = false;
00082     button_Forget->Content = "User Forgotten.";
00083 }
00084
00085 /// <summary>
00086 /// Function used to unregister user's Passport on the server side
00087 /// </summary>
00088 /// <returns></returns>
00089 bool Content::DeletePassportServerSide()
00090 {
00091     return true;
00092 }
Generated on Fri Nov 15 2024 22:20:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFaceDetection/cpp/MainPage.xaml.h Source File

  • CameraFaceDetection
  • cpp

MainPage.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MainPage.g.h"
00015
00016 namespace FaceDetection
00017 {
00018     ref class ReencodeState sealed
00019     {
00020     internal:
00021         Windows::Graphics::Imaging::BitmapDecoder^ Decoder;
00022         Windows::Graphics::Imaging::BitmapEncoder^ Encoder;
00023         Windows::Storage::StorageFile^ File;
00024         Windows::Storage::FileProperties::PhotoOrientation Orientation;
00025     };
00026
00027     public ref class MainPage sealed
00028     {
00029     private:
00030         // Receive notifications about rotation of the device and UI and apply any necessary rotation to the preview stream and UI controls
00031         Windows::Devices::Sensors::SimpleOrientationSensor^ _orientationSensor;
00032         Windows::Graphics::Display::DisplayInformation^ _displayInformation;
00033         Windows::Devices::Sensors::SimpleOrientation _deviceOrientation;
00034         Windows::Graphics::Display::DisplayOrientations _displayOrientation;
00035
00036         // Prevent the screen from sleeping while the camera is running
00037         Windows::System::Display::DisplayRequest^ _displayRequest;
00038
00039         // For listening to media property changes
00040         Windows::Media::SystemMediaTransportControls^ _systemMediaControls;
00041
00042         // MediaCapture and its state variables
00043         Platform::Agile<Windows::Media::Capture::MediaCapture^> _mediaCapture;
00044         Windows::Media::MediaProperties::IMediaEncodingProperties^ _previewProperties;
00045         bool _isInitialized;
00046         bool _isRecording;
00047
00048         // Information about the camera device
00049         bool _externalCamera;
00050         bool _mirroringPreview;
00051
00052         Windows::Media::Core::FaceDetectionEffect^ _faceDetectionEffect;
00053
00054         // Rotation metadata to apply to the preview stream and recorded videos (MF_MT_VIDEO_ROTATION)
00055         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00056         const GUID RotationKey;
00057
00058         // Folder in which the captures will be stored (availability check performed in SetupUiAsync)
00059         Windows::Storage::StorageFolder^ _captureFolder;
00060
00061         // Event tokens
00062         Windows::Foundation::EventRegistrationToken _applicationSuspendingEventToken;
00063         Windows::Foundation::EventRegistrationToken _applicationResumingEventToken;
00064         Windows::Foundation::EventRegistrationToken _mediaControlPropChangedEventToken;
00065         Windows::Foundation::EventRegistrationToken _displayInformationEventToken;
00066         Windows::Foundation::EventRegistrationToken _recordLimitationExceededEventToken;
00067         Windows::Foundation::EventRegistrationToken _mediaCaptureFailedEventToken;
00068         Windows::Foundation::EventRegistrationToken _orientationChangedEventToken;
00069         Windows::Foundation::EventRegistrationToken _hardwareCameraButtonEventToken;
00070         Windows::Foundation::EventRegistrationToken _faceDetectedEventToken;
00071
00072         // MediaCapture methods
00073         Concurrency::task<void> InitializeCameraAsync();
00074         Concurrency::task<void> CleanupCameraAsync();
00075         Concurrency::task<void> StartPreviewAsync();
00076         Concurrency::task<void> SetPreviewRotationAsync();
00077         Concurrency::task<void> StopPreviewAsync();
00078         Concurrency::task<void> CreateFaceDetectionEffectAsync();
00079         Concurrency::task<void> CleanUpFaceDetectionEffectAsync();
00080         Concurrency::task<void> TakePhotoAsync();
00081         Concurrency::task<void> StartRecordingAsync();
00082         Concurrency::task<void> StopRecordingAsync();
00083
00084         // Helpers
00085         Concurrency::task<Windows::Devices::Enumeration::DeviceInformation^> FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel);
00086         Concurrency::task<void> ReencodeAndSavePhotoAsync(Windows::Storage::Streams::IRandomAccessStream^ stream, Windows::Storage::StorageFile^ file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation);
00087         void UpdateCaptureControls();
00088         Concurrency::task<void> SetupUiAsync();
00089         Concurrency::task<void> CleanupUiAsync();
00090         void RegisterEventHandlers();
00091         void UnregisterEventHandlers();
00092         void WriteLine(Platform::String^ str);
00093         void WriteException(Platform::Exception^ ex);
00094         Concurrency::task<void> EmptyTask();
00095
00096         // Rotation helpers
00097         Windows::Devices::Sensors::SimpleOrientation GetCameraOrientation();
00098         Windows::Storage::FileProperties::PhotoOrientation ConvertOrientationToPhotoOrientation(Windows::Devices::Sensors::SimpleOrientation orientation);
00099         int ConvertDeviceOrientationToDegrees(Windows::Devices::Sensors::SimpleOrientation orientation);
00100         int ConvertDisplayOrientationToDegrees(Windows::Graphics::Display::DisplayOrientations orientation);
00101         void UpdateButtonOrientation();
00102         void SetFacesCanvasRotation();
00103
00104         // Face detection helpers
00105         void HighlightDetectedFaces(Windows::Foundation::Collections::IVectorView<Windows::Media::FaceAnalysis::DetectedFace^>^ faces);
00106         Windows::UI::Xaml::Shapes::Rectangle^ ConvertPreviewToUiRectangle(Windows::Graphics::Imaging::BitmapBounds faceBoxInPreviewCoordinates);
00107         Windows::Foundation::Rect GetPreviewStreamRectInControl(Windows::Media::MediaProperties::VideoEncodingProperties^ previewResolution, Windows::UI::Xaml::Controls::CaptureElement^ previewControl);
00108
00109         // UI event handlers
00110         void Application_Suspending(Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00111         void Application_Resuming(Object^ sender, Object^ args);
00112         void DisplayInformation_OrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Object^ args);
00113         void PhotoButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00114         void VideoButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00115         void SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^ sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^ args);
00116         void FaceDetectionButton_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00117         void OrientationSensor_OrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^);
00118         void HardwareButtons_CameraPressed(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^);
00119
00120         // Camera event handlers
00121         void HardwareButtons_CameraPress(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^);
00122         void MediaCapture_RecordLimitationExceeded(Windows::Media::Capture::MediaCapture ^currentCaptureObject);
00123         void MediaCapture_Failed(Windows::Media::Capture::MediaCapture ^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^ errorEventArgs);
00124         void FaceDetectionEffect_FaceDetected(Windows::Media::Core::FaceDetectionEffect^ sender, Windows::Media::Core::FaceDetectedEventArgs^ args);
00125
00126     protected:
00127         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00128         virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00129
00130     public:
00131         MainPage();
00132         virtual ~MainPage();
00133     };
00134 }
Generated on Fri Nov 15 2024 22:17:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/StspNetwork.h Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

StspNetwork.h

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007 #pragma once
00008
00009 namespace Microsoft { namespace Samples { namespace SimpleCommunication { namespace Network {
00010     interface DECLSPEC_UUID("D30E9A4E-31BD-484C-940D-0E5FF536036D") DECLSPEC_NOVTABLE IMediaBufferWrapper : public IUnknown
00011     {
00012         IFACEMETHOD_(IMFMediaBuffer *, GetMediaBuffer) () const = 0;
00013         IFACEMETHOD_(BYTE *, GetBuffer) () const = 0;
00014
00015         IFACEMETHOD(SetOffset) (DWORD nOffset) = 0;
00016         IFACEMETHOD_(DWORD, GetOffset) () const = 0;
00017
00018         IFACEMETHOD(GetCurrentLength) (DWORD *pcbCurrentLength) = 0;
00019         IFACEMETHOD(SetCurrentLength) (DWORD cbCurrentLength) = 0;
00020
00021         IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0;
00022         IFACEMETHOD(TrimRight) (DWORD cbSize, _Out_ IMediaBufferWrapper **pWrapper) = 0;
00023
00024         IFACEMETHOD(Reset) () = 0;
00025     };
00026
00027     interface DECLSPEC_UUID("3FEBFE65-E515-4448-8DB4-10D7DBC030A8") DECLSPEC_NOVTABLE IBufferEnumerator : public IUnknown
00028     {
00029         IFACEMETHOD_(bool, IsValid) ();
00030         IFACEMETHOD(GetCurrent) (_Out_ IMediaBufferWrapper **ppBuffer);
00031         IFACEMETHOD(MoveNext) ();
00032         IFACEMETHOD(Reset) ();
00033     };
00034
00035     interface DECLSPEC_UUID("E6D1193E-8B68-4526-885A-9C858613807D") DECLSPEC_NOVTABLE IBufferPacket : public IUnknown
00036     {
00037         IFACEMETHOD(AddBuffer) (IMediaBufferWrapper *pBuffer) = 0;
00038         IFACEMETHOD(InsertBuffer) (unsigned int nIndex, _In_ IMediaBufferWrapper *pBuffer) = 0;
00039         IFACEMETHOD(RemoveBuffer) (unsigned int nIndex, _Outptr_ IMediaBufferWrapper **ppBuffer) = 0;
00040         IFACEMETHOD(Clear) () = 0;
00041         IFACEMETHOD_(size_t, GetBufferCount) () const = 0;
00042
00043         IFACEMETHOD(GetTotalLength) (_Out_ DWORD *pcbTotalLength) = 0;
00044         IFACEMETHOD(CopyTo) (DWORD nOffset, DWORD cbSize, _In_reads_bytes_(cbSize) void *pDest, _Out_ DWORD *pcbCopied) = 0;
00045         IFACEMETHOD(MoveLeft) (DWORD cbSize, _Out_writes_bytes_(cbSize) void *pDest) = 0;
00046         IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0;
00047         IFACEMETHOD(ToMFSample) (IMFSample **ppSample) = 0;
00048
00049         IFACEMETHOD(GetEnumerator) (_Out_ IBufferEnumerator **pEnumerator) = 0;
00050     };
00051
00052     ref class INetworkChannel abstract
00053     {
00054     internal:
00055         virtual Windows::Foundation::IAsyncAction ^SendAsync(_In_ IBufferPacket *pPacket) = 0;
00056         virtual Windows::Foundation::IAsyncAction ^ReceiveAsync(_In_ IMediaBufferWrapper *pBuffer) = 0;
00057         virtual void Close() = 0;
00058         virtual void Disconnect() = 0;
00059     };
00060
00061     interface class INetworkServer
00062     {
00063         Windows::Foundation::IAsyncOperation<Windows::Networking::Sockets::StreamSocketInformation^>^ AcceptAsync();
00064     };
00065
00066     interface class INetworkClient
00067     {
00068         Windows::Foundation::IAsyncAction ^ConnectAsync(String ^url, WORD wPort);
00069     };
00070
00071     HRESULT CreateMediaBufferWrapper(DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper);
00072     HRESULT CreateMediaBufferWrapper(_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper);
00073     HRESULT CreateBufferPacketFromMFSample(_In_ IMFSample *pSample, _Outptr_ IBufferPacket **ppBufferPacket);
00074     HRESULT CreateBufferPacket(_Outptr_ IBufferPacket **ppBufferPacket);
00075
00076     INetworkServer ^CreateNetworkServer(unsigned short listeningPort);
00077     INetworkClient ^CreateNetworkClient();
00078 }}}}
Generated on Fri Nov 15 2024 22:21:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WebApiApplication Member List

This is the complete list of members for WebApiApplication, including all inherited members.
Application_Start() WebApiApplication [inline, protected]
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/Helpers.cpp Source File

  • Geolocation
  • cppwinrt
  • Tasks

Helpers.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "Helpers.h"
00003
00004 using namespace winrt;
00005 using namespace winrt::BackgroundTask;
00006 using namespace winrt::Windows::Data::Json;
00007 using namespace winrt::Windows::Data::Xml::Dom;
00008 using namespace winrt::Windows::Devices::Geolocation;
00009 using namespace winrt::Windows::Globalization::DateTimeFormatting;
00010 using namespace winrt::Windows::UI::Notifications;
00011
00012 hstring BackgroundTask::FormatDateTime(Windows::Foundation::DateTime value, hstring const& format)
00013 {
00014     return DateTimeFormatter(format).Format(value);
00015 }
00016
00017 // The "brief" format carries only 6 significant digits.
00018 hstring BackgroundTask::to_brief_hstring(double value)
00019 {
00020     char temp[32];
00021     std::to_chars_result result = std::to_chars(std::begin(temp), std::end(temp), value, std::chars_format::general, 6);
00022     WINRT_ASSERT(result.ec == std::errc{});
00023     return to_hstring(std::string_view(temp, result.ptr - temp));
00024 }
00025
00026 // Looks up a JsonArray from the saved LocalSettings, or an empty JsonArray if not found.
00027 JsonArray BackgroundTask::LoadSavedJson(hstring const& key)
00028 {
00029     auto values = Windows::Storage::ApplicationData::Current().LocalSettings().Values();
00030     hstring json = values.TryLookup(key).try_as<hstring>().value_or(L"");
00031
00032     if (json.empty())
00033     {
00034         // Not present. Return an empty array.
00035         return JsonArray();
00036     }
00037     else
00038     {
00039         return JsonValue::Parse(json).GetArray();
00040     }
00041 }
00042
00043 void BackgroundTask::DisplayToast(hstring const& message)
00044 {
00045     // Display a toast for each geofence event.
00046     ToastNotifier ToastNotifier = ToastNotificationManager::CreateToastNotifier();
00047
00048     // Create a two line toast and add audio reminder
00049
00050     // Here the xml that will be passed to the
00051     // ToastNotification for the toast is retrieved
00052     XmlDocument toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText02);
00053
00054     // Set both lines of text
00055     XmlNodeList toastNodeList = toastXml.GetElementsByTagName(L"text");
00056     toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode(L"Geolocation Sample"));
00057     toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));
00058
00059     // now create a xml node for the audio source
00060     IXmlNode toastNode = toastXml.SelectSingleNode(L"/toast");
00061     XmlElement audio = toastXml.CreateElement(L"audio");
00062     audio.SetAttribute(L"src", L"ms-winsoundevent:Notification.SMS");
00063
00064     ToastNotification toast(toastXml);
00065     ToastNotifier.Show(toast);
00066 }
00067
00068 hstring winrt::to_hstring(Windows::Devices::Geolocation::VisitStateChange value)
00069 {
00070     switch (value)
00071     {
00072     case VisitStateChange::TrackingLost:
00073         return L"TrackingLost";
00074     case VisitStateChange::Arrived:
00075         return L"Arrived";
00076     case VisitStateChange::Departed:
00077         return L"Departed";
00078     case VisitStateChange::OtherMovement:
00079         return L"OtherMovement";
00080     }
00081     return to_hstring(static_cast<uint32_t>(value));
00082 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Default/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Default

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Notifications;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00006
00007 namespace Notifications.ScenarioPages.Toasts.Scenarios.Default
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class ScenarioElement : UserControl
00013     {
00014         public ScenarioElement()
00015         {
00016             this.InitializeComponent();
00017         }
00018
00019         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00020         {
00021             Initialize();
00022         }
00023
00024         private void Initialize()
00025         {
00026             // Clear all existing notifications
00027             ToastNotificationManager.History.Clear();
00028
00029             // Pop incoming call notification
00030             popToastControl.Payload =
00031                 $@"
00032                 <toast launch='args'>
00033                     <visual>
00034                         <binding template='ToastGeneric'>
00035                             <text>Default</text>
00036                             <text>Second Line of Text</text>
00037                         </binding>
00038                     </visual>
00039                     <actions>
00040
00041                         <action arguments = 'ok'
00042                                 content = 'ok' />
00043
00044                         <action arguments = 'cancel'
00045                                 content = 'cancel' />
00046
00047                     </actions>
00048                 </toast>";
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/PhasingTests.xaml.h Source File

  • XamlBind
  • cpp

PhasingTests.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // PhasingTests.xaml.h
00003 // Declaration of the PhasingTests class
00004 //
00005
00006 #pragma once
00007
00008 #include "PhasingTests.g.h"
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// An empty page that can be used on its own or navigated to within a Frame.
00014     /// </summary>
00015     [Windows::Foundation::Metadata::WebHostHidden]
00016     public ref class PhasingTests sealed
00017     {
00018     public:
00019         PhasingTests();
00020
00021
00022     private:
00023         Windows::Foundation::EventRegistrationToken _CCToken;
00024         Windows::Foundation::EventRegistrationToken _CCCToken;
00025         xBindSampleModel::FileDataSource^ _dataSource;
00026         bool initialized;
00027
00028         property xBindSampleModel::FileDataSource^ dataSource
00029         {
00030             xBindSampleModel::FileDataSource^ get()
00031             {
00032                 if (_dataSource == nullptr)
00033                 {
00034                     _dataSource = ref new xBindSampleModel::FileDataSource();
00035                     _CCToken= _dataSource->VectorChanged += ref new Windows::Foundation::Collections::VectorChangedEventHandler<xBindSampleModel::FileItem^>(this, &PhasingTests::DataSource_VectorChanged);
00036                 }
00037                 return _dataSource;
00038             }
00039             void set(xBindSampleModel::FileDataSource^ value)
00040             {
00041                 if (value != _dataSource)
00042                 {
00043                     _dataSource->CollectionChanged -= _CCToken;
00044                     _dataSource = value;
00045                     _CCToken = _dataSource->VectorChanged += ref new Windows::Foundation::Collections::VectorChangedEventHandler<xBindSampleModel::FileItem^>(this, &PhasingTests::DataSource_VectorChanged);
00046                 }
00047             }
00048         }
00049
00050         void CreateTestData();
00051
00052         void myGridView_ContainerContentChanging(Windows::UI::Xaml::Controls::ListViewBase^ sender, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^ args);
00053
00054         void DataSource_VectorChanged(Windows::Foundation::Collections::IObservableVector<xBindSampleModel::FileItem^>^ sender, Windows::Foundation::Collections::IVectorChangedEventArgs^ e);
00055
00056         void Reset_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00057         void ChangeFolderClick(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00058         void SlowPhasing_UnChecked(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00059         void SlowPhasing_Checked(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00060         void PhasedTemplate_Checked(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00061         void Sleep(int time);
00062     };
00063 }
Generated on Fri Nov 15 2024 22:22:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDataVirtualization/cs/Scenario1/ItemIndexRangeExtensions.cs Source File

  • XamlDataVirtualization
  • cs
  • Scenario1

ItemIndexRangeExtensions.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Collections.Specialized;
00004 using System.Linq;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Storage;
00008 using Windows.UI.Xaml.Data;
00009 using Windows.UI.Xaml.Media.Imaging;
00010 using System.Diagnostics;
00011 using Windows.Storage.Search;
00012 using Windows.Storage.FileProperties;
00013 using Windows.UI.Core;
00014
00015 namespace DataVirtualizationSample
00016 {
00017     // Extension methods for ItemIndexRange
00018     public static class ItemIndexRangeExtensions
00019     {
00020         public static bool Equals(this ItemIndexRange This, ItemIndexRange range)
00021         {
00022             return (This.FirstIndex == range.FirstIndex && This.Length == range.Length);
00023         }
00024
00025         public static bool ContiguousOrOverlaps(this ItemIndexRange This, ItemIndexRange range)
00026         {
00027             // This is left
00028             if(This.FirstIndex < range.FirstIndex)
00029             {
00030                 return (range.FirstIndex <= This.LastIndex + 1);
00031             }
00032             // This is right
00033             else if (This.FirstIndex > range.FirstIndex)
00034             {
00035                 return (This.FirstIndex <= range.LastIndex + 1);
00036             }
00037
00038             // Aligned
00039             return true;
00040         }
00041
00042         public static bool Intersects(this ItemIndexRange This, ItemIndexRange range)
00043         {
00044             return (range.FirstIndex >= This.FirstIndex && range.FirstIndex <= This.LastIndex) || (range.LastIndex >= This.FirstIndex && range.LastIndex <= This.LastIndex);
00045         }
00046
00047         public static bool Intersects(this ItemIndexRange This, int FirstIndex, uint Length)
00048         {
00049             int LastIndex = FirstIndex + (int)Length - 1;
00050             return (FirstIndex >= This.FirstIndex && FirstIndex <= This.LastIndex) || (LastIndex >= This.FirstIndex && LastIndex <= This.LastIndex);
00051         }
00052
00053         public static ItemIndexRange Combine(this ItemIndexRange This, ItemIndexRange range)
00054         {
00055             int start = Math.Min(This.FirstIndex, range.FirstIndex);
00056             int end = Math.Max(This.LastIndex, range.LastIndex);
00057
00058             return new ItemIndexRange(start, 1 + (uint)Math.Abs(end - start));
00059         }
00060
00061         public static bool DiffRanges(this ItemIndexRange RangeA, ItemIndexRange RangeB, out ItemIndexRange InBothAandB, out ItemIndexRange[] OnlyInRangeA, out ItemIndexRange[] OnlyInRangeB)
00062         {
00063             List<ItemIndexRange> exA = new List<ItemIndexRange>();
00064             List<ItemIndexRange> exB = new List<ItemIndexRange>();
00065             int i, j;
00066             i = Math.Max(RangeA.FirstIndex, RangeB.FirstIndex);
00067             j = Math.Min(RangeA.LastIndex, RangeB.LastIndex);
00068
00069             if (i <= j)
00070             {
00071                 // Ranges intersect
00072                 InBothAandB = new ItemIndexRange(i, (uint)(1 + j - i));
00073                 if (RangeA.FirstIndex < i) exA.Add(new ItemIndexRange(RangeA.FirstIndex, (uint)(i - RangeA.FirstIndex)));
00074                 if (RangeA.LastIndex > j) exA.Add(new ItemIndexRange(j + 1, (uint)(RangeA.LastIndex - j)));
00075                 if (RangeB.FirstIndex < i) exB.Add(new ItemIndexRange(RangeB.FirstIndex, (uint)(i - RangeB.FirstIndex)));
00076                 if (RangeB.LastIndex > j) exB.Add(new ItemIndexRange(j + 1, (uint)(RangeB.LastIndex - j)));
00077                 OnlyInRangeA = exA.ToArray();
00078                 OnlyInRangeB = exB.ToArray();
00079                 return true;
00080             }
00081             else
00082             {
00083                 InBothAandB = default(ItemIndexRange);
00084                 OnlyInRangeA = new ItemIndexRange[] { RangeA };
00085                 OnlyInRangeB = new ItemIndexRange[] { RangeB };
00086                 return false;
00087             }
00088         }
00089
00090         public static ItemIndexRange Overlap(this ItemIndexRange RangeA, ItemIndexRange RangeB)
00091         {
00092             int i, j;
00093             i = Math.Max(RangeA.FirstIndex, RangeB.FirstIndex);
00094             j = Math.Min(RangeA.LastIndex, RangeB.LastIndex);
00095
00096             if (i <= j)
00097             {
00098                 // Ranges intersect
00099                 return new ItemIndexRange(i, (uint)(1 + j - i));
00100             }
00101             else
00102             {
00103                 return null;
00104             }
00105         }
00106
00107     }
00108 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/Iso7816Defs.cs Source File

  • Nfc
  • PcscSdk

Iso7816Defs.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace Iso7816
00013 {
00014     /// <summary>
00015     /// Enumeration of possible ISO 7816 Command
00016     /// </summary>
00017     public enum Cla : byte
00018     {
00019         CompliantCmd0x          = 0x00,
00020         AppCompliantCmdAx       = 0xA0,
00021         ProprietaryCla8x        = 0x80,
00022         ProprietaryCla9x        = 0x90,
00023         ReservedForPts          = 0xFF,           // Protocol Type Selelction
00024     }
00025     /// <summary>
00026     /// Enumeration of lower nibbile of CLA
00027     /// </summary>
00028     public enum ClaXx : byte
00029     {
00030         NoSmOrNoSmIndication    = 0x00,
00031         ProprietarySmFormat     = 0x01,
00032         SecureMessageNoHeaderSM = 0x10,
00033         SecureMessage1p6        = 0x11,
00034     }
00035     /// <summary>
00036     /// Enumeration of possible instructions
00037     /// </summary>
00038     public enum Ins : byte
00039     {
00040         EraseBinary             = 0x0E,
00041         Verify                  = 0x20,
00042         ManageChannel           = 0x70,
00043         ExternalAuthenticate    = 0x82,
00044         GetChallenge            = 0x84,
00045         InternalAuthenticate    = 0x88,
00046         SelectFile              = 0xA4,
00047         ReadBinary              = 0xB0,
00048         ReadRecords             = 0xB2,
00049         GetResponse             = 0xC0,
00050         Envelope                = 0xC2,
00051         GetData                 = 0xCA,
00052         WriteBinary             = 0xD0,
00053         WriteRecord             = 0xD2,
00054         UpdateBinary            = 0xD6,
00055         PutData                 = 0xDA,
00056         UpdateData              = 0xDC,
00057         AppendRecord            = 0xE2,
00058     }
00059 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_Region Member List

This is the complete list of members for Scenario3_Region, including all inherited members.
ReportRegionData(GeographicRegion region) | Scenario3_Region | [inline, private]
Scenario3_Region() | Scenario3_Region | [inline]
ShowResults_Click(object sender, RoutedEventArgs e) | Scenario3_Region | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/LocationBackgroundTask.cpp Source File

  • Geolocation
  • cppwinrt
  • Tasks

LocationBackgroundTask.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "Helpers.h"
00003 #include "LocationBackgroundTask.h"
00004 #include "LocationBackgroundTask.g.cpp"
00005
00006 using namespace winrt;
00007 using namespace winrt::Windows::ApplicationModel::Background;
00008 using namespace winrt::Windows::Devices::Geolocation;
00009 using namespace winrt::Windows::Foundation;
00010 using namespace winrt::Windows::Storage;
00011
00012 namespace winrt::BackgroundTask::implementation
00013 {
00014     fire_and_forget LocationBackgroundTask::Run(IBackgroundTaskInstance const& taskInstance)
00015     {
00016         auto lifetime = get_strong();
00017
00018         BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
00019
00020         try
00021         {
00022             // Associate a cancellation handler with the background task.
00023             taskInstance.Canceled({ get_weak(), &LocationBackgroundTask::OnCanceled });
00024
00025             // Create geolocator object
00026             Geolocator geolocator;
00027
00028             // Make the request for the current position
00029             auto operation = geolocator.GetGeopositionAsync();
00030             {
00031                 auto guard = slim_lock_guard(m_mutex);
00032                 m_pendingOperation = operation;
00033             }
00034             Geoposition pos = co_await operation;
00035             {
00036                 auto guard = slim_lock_guard(m_mutex);
00037                 m_pendingOperation = nullptr;
00038             }
00039
00040             WriteStatusToAppData(L"Time: " + FormatDateTime(clock::now(), L"shortdate shorttime"));
00041             WriteGeolocToAppData(pos);
00042         }
00043         catch (hresult_access_denied const&)
00044         {
00045             WriteStatusToAppData(L"Disabled");
00046             WipeGeolocDataFromAppData();
00047         }
00048         catch (hresult_error const& ex)
00049         {
00050             WriteStatusToAppData(ex.message());
00051             WipeGeolocDataFromAppData();
00052         }
00053         catch (std::exception const& ex)
00054         {
00055             WriteStatusToAppData(to_hstring(ex.what()));
00056             WipeGeolocDataFromAppData();
00057         }
00058         deferral.Complete();
00059     }
00060
00061     void LocationBackgroundTask::WriteGeolocToAppData(Geoposition const& position)
00062     {
00063         m_values.Insert(L"Latitude", box_value(to_hstring(position.Coordinate().Point().Position().Latitude)));
00064         m_values.Insert(L"Longitude", box_value(to_hstring(position.Coordinate().Point().Position().Longitude)));
00065         m_values.Insert(L"Accuracy", box_value(to_hstring(position.Coordinate().Accuracy())));
00066     }
00067
00068     void LocationBackgroundTask::WipeGeolocDataFromAppData()
00069     {
00070         m_values.TryRemove(L"Latitude");
00071         m_values.TryRemove(L"Longitude");
00072         m_values.TryRemove(L"Accuracy");
00073     }
00074
00075     void LocationBackgroundTask::WriteStatusToAppData(hstring const& status)
00076     {
00077         m_values.Insert(L"Status", box_value(status));
00078     }
00079
00080     void LocationBackgroundTask::OnCanceled(IBackgroundTaskInstance const&, BackgroundTaskCancellationReason)
00081     {
00082         IAsyncOperation<Geoposition> operation;
00083         {
00084             auto guard = slim_lock_guard(m_mutex);
00085             operation = m_pendingOperation;
00086         }
00087         if (operation)
00088         {
00089             operation.Cancel();
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/Scenario2_AamvaCards.xaml.cpp Source File

  • MagneticStripeReader
  • cpp

Scenario2_AamvaCards.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_AamvaCards.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Devices::PointOfService;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::Storage::Streams;
00023 using namespace Windows::UI::Core;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034
00035 Scenario2_AamvaCards::Scenario2_AamvaCards()
00036 {
00037     InitializeComponent();
00038     rootPage = MainPage::Current;
00039 }
00040
00041 /// <summary>
00042 /// Creates the default magnetic stripe reader.
00043 /// </summary>
00044 task<void> Scenario2_AamvaCards::CreateDefaultReaderObject()
00045 {
00046     return create_task(DeviceHelpers::GetFirstMagneticStripeReaderAsync()).then([this](MagneticStripeReader^ reader)
00047     {
00048         delete _reader;
00049         _reader = reader;
00050         if (_reader == nullptr)
00051         {
00052             rootPage->NotifyUser("Magnetic Stripe Reader not found. Please connect a Magnetic Stripe Reader.", NotifyType::ErrorMessage);
00053         }
00054     });
00055 }
00056
00057 /// <summary>
00058 /// This method claims the magnetic stripe reader.
00059 /// </summary>
00060 task<void> Scenario2_AamvaCards::ClaimReader()
00061 {
00062     // claim the magnetic stripe reader
00063     return create_task(_reader->ClaimReaderAsync()).then([this](ClaimedMagneticStripeReader^ claimedReader)
00064     {
00065         delete _claimedReader;
00066         _claimedReader = claimedReader;
00067         if (_claimedReader == nullptr)
00068         {
00069             rootPage->NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType::ErrorMessage);
00070         }
00071     });
00072 }
00073
00074 void Scenario2_AamvaCards::ScenarioStartReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00075 {
00076     create_task(CreateDefaultReaderObject()).then([this](void)
00077     {
00078         if (_reader != nullptr)
00079         {
00080             // after successful creation, claim the reader for exclusive use and enable it so that data reveived events are received.
00081             create_task(ClaimReader()).then([this](void)
00082             {
00083                 if (_claimedReader)
00084                 {
00085                     // It is always a good idea to have a release device requested event handler. If this event is not handled, there are chances of another app can
00086                     // claim ownsership of the magnetic stripe reader.
00087                     _releaseDeviceRequestedToken = _claimedReader->ReleaseDeviceRequested::add(ref new EventHandler<ClaimedMagneticStripeReader^>(this, &Scenario2_AamvaCards::OnReleaseDeviceRequested));
00088
00089                     // after successfully claiming and enabling, attach the AamvaCardDataReceived event handler.
00090                     // Note: If the scanner is not enabled (i.e. EnableAsync not called), attaching the event handler will not be any useful because the API will not fire the event
00091                     // if the claimedScanner has not beed Enabled
00092                     _aamvaCardDataReceivedToken = _claimedReader->AamvaCardDataReceived::add(ref new TypedEventHandler<ClaimedMagneticStripeReader^, MagneticStripeReaderAamvaCardDataReceivedEventArgs^>(this, &Scenario2_AamvaCards::OnAamvaCardDataReceived));
00093
00094                     // Ask the API to decode the data by default. By setting this, API will decode the raw data from the magnetic stripe reader
00095                     _claimedReader->IsDecodeDataEnabled = true;
00096
00097                     create_task(_claimedReader->EnableAsync()).then([this](void)
00098                     {
00099                         rootPage->NotifyUser("Ready to swipe. Device ID: " + _claimedReader->DeviceId, NotifyType::StatusMessage);
00100
00101                         // reset the button state
00102                         ScenarioEndReadButton->IsEnabled = true;
00103                         ScenarioStartReadButton->IsEnabled = false;
00104                     });
00105                 }
00106             });
00107         }
00108     });
00109 }
00110
00111 /// <summary>
00112 /// Event handler for End button
00113 /// </summary>
00114 /// <param name="sender"></param>
00115 /// <param name="e"></param>
00116 void Scenario2_AamvaCards::ScenarioEndReadButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00117 {
00118     ResetTheScenarioState();
00119 }
00120
00121 /// <summary>
00122 /// Event handler for the Release Device Requested event fired when magnetic stripe reader receives Claim request from another application
00123 /// </summary>
00124 /// <param name="sender"></param>
00125 /// <param name="args"> Contains the ClaimedMagneticStripeReader that is sending this request</param>
00126 void Scenario2_AamvaCards::OnReleaseDeviceRequested(Platform::Object ^sender, Windows::Devices::PointOfService::ClaimedMagneticStripeReader ^args)
00127 {
00128     // let us retain the device always. If it is not retained, this exclusive claim will be lost.
00129     args->RetainDevice();
00130 }
00131
00132 /// <summary>
00133 /// Event handler for the DataReceived event fired when a AAMVA card is read by the magnetic stripe reader
00134 /// </summary>
00135 /// <param name="sender"></param>
00136 /// <param name="args"> Contains the MagneticStripeReaderAamvaCardDataReceivedEventArgs which contains the data obtained in the scan</param>
00137 void Scenario2_AamvaCards::OnAamvaCardDataReceived(Windows::Devices::PointOfService::ClaimedMagneticStripeReader^sender, Windows::Devices::PointOfService::MagneticStripeReaderAamvaCardDataReceivedEventArgs^args)
00138 {
00139     // read the data and display
00140     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00141         [this, args]()
00142     {
00143         rootPage->NotifyUser("Got data.", NotifyType::StatusMessage);
00144
00145         ScenarioOutputAddress->Text = args->Address;
00146         ScenarioOutputBirthDate->Text = args->BirthDate;
00147         ScenarioOutputCity->Text = args->City;
00148         ScenarioOutputClass->Text = args->Class;
00149         ScenarioOutputEndorsements->Text = args->Endorsements;
00150         ScenarioOutputExpirationDate->Text = args->ExpirationDate;
00151         ScenarioOutputEyeColor->Text = args->EyeColor;
00152         ScenarioOutputFirstName->Text = args->FirstName;
00153         ScenarioOutputGender->Text = args->Gender;
00154         ScenarioOutputHairColor->Text = args->HairColor;
00155         ScenarioOutputHeight->Text = args->Height;
00156         ScenarioOutputLicenseNumber->Text = args->LicenseNumber;
00157         ScenarioOutputPostalCode->Text = args->PostalCode;
00158         ScenarioOutputRestrictions->Text = args->Restrictions;
00159         ScenarioOutputState->Text = args->State;
00160         ScenarioOutputSuffix->Text = args->Suffix;
00161         ScenarioOutputSurname->Text = args->Surname;
00162         ScenarioOutputWeight->Text = args->Weight;
00163     }));
00164
00165 }
00166
00167 /// <summary>
00168 /// Invoked when this page is about to be displayed in a Frame.
00169 /// </summary>
00170 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00171 /// property is typically used to configure the page.</param>
00172 void Scenario2_AamvaCards::OnNavigatedTo(NavigationEventArgs^ e)
00173 {
00174     ResetTheScenarioState();
00175     Page::OnNavigatedTo(e);
00176 }
00177
00178 /// <summary>
00179 /// Invoked when this page is no longer displayed.
00180 /// </summary>
00181 /// <param name="e"></param>
00182 void Scenario2_AamvaCards::OnNavigatedFrom(NavigationEventArgs^ e)
00183 {
00184     ResetTheScenarioState();
00185     Page::OnNavigatedTo(e);
00186 }
00187
00188
00189 /// <summary>
00190 /// Reset the Scenario state
00191 /// </summary>
00192 void Scenario2_AamvaCards::ResetTheScenarioState()
00193 {
00194     if (_claimedReader != nullptr)
00195     {
00196         // Detach the datareceived event handler and releasedevicerequested event handler
00197         _claimedReader->AamvaCardDataReceived::remove(_aamvaCardDataReceivedToken);
00198         _claimedReader->ReleaseDeviceRequested::remove(_releaseDeviceRequestedToken);
00199
00200         // release the Claimed Magnetic Stripe Reader and set to null
00201         delete _claimedReader;
00202         _claimedReader = nullptr;
00203     }
00204
00205     if (_reader != nullptr)
00206     {
00207         // release the Magnetic Stripe Reader and set to null
00208         delete _reader;
00209         _reader = nullptr;
00210     }
00211
00212     // Reset the strings in the UI
00213     rootPage->NotifyUser("Click the Start Receiving Data Button.", NotifyType::StatusMessage);
00214
00215     ScenarioOutputAddress->Text = "No data";
00216     ScenarioOutputBirthDate->Text = "No data";
00217     ScenarioOutputCity->Text = "No data";
00218     ScenarioOutputClass->Text = "No data";
00219     ScenarioOutputEndorsements->Text = "No data";
00220     ScenarioOutputExpirationDate->Text = "No data";
00221     ScenarioOutputEyeColor->Text = "No data";
00222     ScenarioOutputFirstName->Text = "No data";
00223     ScenarioOutputGender->Text = "No data";
00224     ScenarioOutputHairColor->Text = "No data";
00225     ScenarioOutputHeight->Text = "No data";
00226     ScenarioOutputLicenseNumber->Text = "No data";
00227     ScenarioOutputPostalCode->Text = "No data";
00228     ScenarioOutputRestrictions->Text = "No data";
00229     ScenarioOutputState->Text = "No data";
00230     ScenarioOutputSuffix->Text = "No data";
00231     ScenarioOutputSurname->Text = "No data";
00232     ScenarioOutputWeight->Text = "No data";
00233
00234     // reset the button state
00235     ScenarioEndReadButton->IsEnabled = false;
00236     ScenarioStartReadButton->IsEnabled = true;
00237 }
Generated on Fri Nov 15 2024 22:20:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/None/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • None

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.Branding.None
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
00017             string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";
00018
00019             updateFourTilesControl.SetTilePayload($@"
00020                 <tile version='3'>
00021                     <visual>
00022
00023                         <binding template='TileSmall' branding='none'>
00024                             <text>none</text>
00025                             {fillerText}
00026                         </binding>
00027
00028                         <binding template='TileMedium' branding='none'>
00029                             <text hint-wrap='true'>branding: none</text>
00030                             {fillerText}
00031                         </binding>
00032
00033                         <binding template='TileWide' branding='none'>
00034                             <text hint-wrap='true'>branding: none</text>
00035                             {fillerText}
00036                         </binding>
00037
00038                         <binding template='TileLarge' branding='none'>
00039                             <text hint-wrap='true'>branding: none</text>
00040                             {fillerText}
00041                         </binding>
00042
00043                     </visual>
00044                 </tile>");
00045         }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/CameraResources.h Source File

  • HolographicSpatialStage
  • cpp
  • Common

CameraResources.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace DX
00004 {
00005     class DeviceResources;
00006
00007     // Constant buffer used to send the view-projection matrices to the shader pipeline.
00008     struct ViewProjectionConstantBuffer
00009     {
00010         DirectX::XMFLOAT4X4 viewProjection[2];
00011     };
00012
00013     // Assert that the constant buffer remains 16-byte aligned (best practice).
00014     static_assert((sizeof(ViewProjectionConstantBuffer) % (sizeof(float) * 4)) == 0, "ViewProjection constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00015
00016     // Manages DirectX device resources that are specific to a holographic camera, such as the
00017     // back buffer, ViewProjection constant buffer, and viewport.
00018     class CameraResources
00019     {
00020     public:
00021         CameraResources(Windows::Graphics::Holographic::HolographicCamera^ holographicCamera);
00022
00023         void CreateResourcesForBackBuffer(
00024             DX::DeviceResources* pDeviceResources,
00025             Windows::Graphics::Holographic::HolographicCameraRenderingParameters^ cameraParameters
00026             );
00027         void ReleaseResourcesForBackBuffer(
00028             DX::DeviceResources* pDeviceResources
00029             );
00030
00031         void UpdateViewProjectionBuffer(
00032             std::shared_ptr<DX::DeviceResources> deviceResources,
00033             Windows::Graphics::Holographic::HolographicCameraPose^ cameraPose,
00034             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00035
00036         bool AttachViewProjectionBuffer(
00037             std::shared_ptr<DX::DeviceResources> deviceResources);
00038
00039         // Direct3D device resources.
00040         ID3D11RenderTargetView* GetBackBufferRenderTargetView()     const { return m_d3dRenderTargetView.Get();     }
00041         ID3D11DepthStencilView* GetDepthStencilView()               const { return m_d3dDepthStencilView.Get();     }
00042         ID3D11Texture2D*        GetDepthBufferTexture2D()           const { return m_d3dDepthBuffer.Get();          }
00043         ID3D11Texture2D*        GetBackBufferTexture2D()            const { return m_d3dBackBuffer.Get();           }
00044         D3D11_VIEWPORT          GetViewport()                       const { return m_d3dViewport;                   }
00045         DXGI_FORMAT             GetBackBufferDXGIFormat()           const { return m_dxgiFormat;                    }
00046
00047         // Render target properties.
00048         Windows::Foundation::Size GetRenderTargetSize()             const { return m_d3dRenderTargetSize;           }
00049         bool                    IsRenderingStereoscopic()           const { return m_isStereo;                      }
00050
00051         // The holographic camera these resources are for.
00052         Windows::Graphics::Holographic::HolographicCamera^ GetHolographicCamera() const { return m_holographicCamera; }
00053
00054     private:
00055         // Direct3D rendering objects. Required for 3D.
00056         Microsoft::WRL::ComPtr<ID3D11RenderTargetView>      m_d3dRenderTargetView;
00057         Microsoft::WRL::ComPtr<ID3D11DepthStencilView>      m_d3dDepthStencilView;
00058         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_d3dBackBuffer;
00059         Microsoft::WRL::ComPtr<ID3D11Texture2D>             m_d3dDepthBuffer;
00060
00061         // Device resource to store view and projection matrices.
00062         Microsoft::WRL::ComPtr<ID3D11Buffer>                m_viewProjectionConstantBuffer;
00063
00064         // Direct3D rendering properties.
00065         DXGI_FORMAT                                         m_dxgiFormat;
00066         Windows::Foundation::Size                           m_d3dRenderTargetSize;
00067         D3D11_VIEWPORT                                      m_d3dViewport;
00068
00069         // Indicates whether the camera supports stereoscopic rendering.
00070         bool                                                m_isStereo = false;
00071
00072         // Indicates whether this camera has a pending frame.
00073         bool                                                m_framePending = false;
00074
00075         // Pointer to the holographic camera these resources are for.
00076         Windows::Graphics::Holographic::HolographicCamera^  m_holographicCamera = nullptr;
00077     };
00078 }
Generated on Fri Nov 15 2024 22:16:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlFocusVisuals/cs/MainPage.xaml.cs Source File

  • XamlFocusVisuals
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Data;
00017 using Windows.UI.Xaml.Media;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// An empty page that can be used on its own or navigated to within a Frame.
00026     /// </summary>
00027     public sealed partial class MainPage : Page
00028     {
00029         public static MainPage Current;
00030
00031         public MainPage()
00032         {
00033             this.InitializeComponent();
00034
00035             // This is a static public property that allows downstream pages to get a handle to the MainPage instance
00036             // in order to call methods that are in this class.
00037             Current = this;
00038             SampleTitle.Text = FEATURE_NAME;
00039         }
00040
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043             // Populate the scenario list from the SampleConfiguration.cs file
00044             ScenarioControl.ItemsSource = scenarios;
00045             if (Window.Current.Bounds.Width < 640)
00046             {
00047                 ScenarioControl.SelectedIndex = -1;
00048             }
00049             else
00050             {
00051                 ScenarioControl.SelectedIndex = 0;
00052             }
00053         }
00054
00055         /// <summary>
00056         /// Called whenever the user changes selection in the scenarios list.  This method will navigate to the respective
00057         /// sample scenario page.
00058         /// </summary>
00059         /// <param name="sender"></param>
00060         /// <param name="e"></param>
00061         private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
00062         {
00063             ListBox scenarioListBox = sender as ListBox;
00064             Scenario s = scenarioListBox.SelectedItem as Scenario;
00065             if (s != null)
00066             {
00067                 ScenarioFrame.Navigate(s.ClassType);
00068                 if (Window.Current.Bounds.Width < 640)
00069                 {
00070                     Splitter.IsPaneOpen = false;
00071                 }
00072             }
00073         }
00074
00075         public List<Scenario> Scenarios
00076         {
00077             get { return this.scenarios; }
00078         }
00079
00080         async void Footer_Click(object sender, RoutedEventArgs e)
00081         {
00082             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00083         }
00084
00085         private void Button_Click(object sender, RoutedEventArgs e)
00086         {
00087             Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
00088         }
00089     }
00090     public enum NotifyType
00091     {
00092         StatusMessage,
00093         ErrorMessage
00094     };
00095
00096     public class ScenarioBindingConverter : IValueConverter
00097     {
00098         public object Convert(object value, Type targetType, object parameter, string language)
00099         {
00100             Scenario s = value as Scenario;
00101             return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
00102         }
00103
00104         public object ConvertBack(object value, Type targetType, object parameter, string language)
00105         {
00106             return true;
00107         }
00108     }
00109 }
00110
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sync Member List

This is the complete list of members for Sync, including all inherited members.
BytesToWriteAtATime | Sync
NumberOfTimesToWrite | Sync
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Launched Member List

This is the complete list of members for Scenario1_Launched, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1_Launched | [inline, protected]
Scenario1_Launched() | Scenario1_Launched | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Settings Member List

This is the complete list of members for Scenario2_Settings, including all inherited members.
DeleteSetting_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario2_Settings |
DisplayOutput() | Scenario2_Settings | [private]
localSettings | Scenario2_Settings | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario2_Settings |
Scenario2_Settings() | Scenario2_Settings |
SettingName | Scenario2_Settings | [inline, private, static]
WriteSetting_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Settings |
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Effects Member List

This is the complete list of members for Scenario2_Effects, including all inherited members.
CleanupPreviousEffect() | Scenario2_Effects | [private]
CustomEffect_UpdateRequested(CustomEffectState *state, winrt::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs const &args) | Scenario2_Effects | [private, static]
CustomEffectButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
CycleButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
FadeButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
GeneratedBitmapButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
GeneratedBitmapEffect_UpdateRequested(GeneratedBitmapState *state, winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const &args) | Scenario2_Effects | [private, static]
GetLampArrayIndices(winrt::Windows::Devices::Lights::LampArray const &lampArray) | Scenario2_Effects | [private, static]
LampArray_AvailabilityChanged(winrt::Windows::Devices::Lights::LampArray const &sender, winrt::Windows::Foundation::IInspectable const &) | Scenario2_Effects | [private]
m_attachedLampArrays | Scenario2_Effects | [private]
m_emptyList | Scenario2_Effects | [private]
m_readyPlaylists | Scenario2_Effects | [private]
OnNavigatedFrom(winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario2_Effects |
OnNavigatedTo(winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario2_Effects |
PauseButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
PlayButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
Scenario2_Effects() | Scenario2_Effects |
StartStopAllEffects(bool shouldStart) | Scenario2_Effects | [private]
StaticBitmapButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
StaticBitmapEffect_BitmapRequested(winrt::Windows::Graphics::Imaging::SoftwareBitmap const &bitmap, winrt::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs const &args) | Scenario2_Effects | [private, static]
StopButton_Click(winrt::Windows::Foundation::IInspectable const &sender, winrt::Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Effects |
UpdateLampArrayList() | Scenario2_Effects | [private]
Watcher_Added(winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformation const &deviceInformation) | Scenario2_Effects | [private]
Watcher_Removed(winrt::Windows::Devices::Enumeration::DeviceWatcher const &, winrt::Windows::Devices::Enumeration::DeviceInformationUpdate deviceInformationUpdate) | Scenario2_Effects | [private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventAdapter.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingServiceEventAdapter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace org { namespace alljoyn { namespace Onboarding {
00024
00025 // This class, and the associated EventArgs classes, exist for the benefit of JavaScript developers who
00026 // do not have the ability to implement IOnboardingService. Instead, OnboardingServiceEventAdapter
00027 // provides the Interface implementation and exposes a set of compatible events to the developer.
00028 public ref class OnboardingServiceEventAdapter sealed : [Windows::Foundation::Metadata::Default] IOnboardingService
00029 {
00030 public:
00031     // Method Invocation Events
00032     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConfigureWiFiCalledEventArgs^>^ ConfigureWiFiCalled
00033     {
00034         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConfigureWiFiCalledEventArgs^>^ handler)
00035         {
00036             return _ConfigureWiFiCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
00037             ([handler](Platform::Object^ sender, Platform::Object^ args)
00038             {
00039                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingConfigureWiFiCalledEventArgs^>(args));
00040             }, Platform::CallbackContext::Same);
00041         }
00042         void remove(Windows::Foundation::EventRegistrationToken token)
00043         {
00044             _ConfigureWiFiCalled -= token;
00045         }
00046     internal:
00047         void raise(OnboardingServiceEventAdapter^ sender, OnboardingConfigureWiFiCalledEventArgs^ args)
00048         {
00049             _ConfigureWiFiCalled(sender, args);
00050         }
00051     }
00052
00053     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConnectCalledEventArgs^>^ ConnectCalled
00054     {
00055         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConnectCalledEventArgs^>^ handler)
00056         {
00057             return _ConnectCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
00058             ([handler](Platform::Object^ sender, Platform::Object^ args)
00059             {
00060                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingConnectCalledEventArgs^>(args));
00061             }, Platform::CallbackContext::Same);
00062         }
00063         void remove(Windows::Foundation::EventRegistrationToken token)
00064         {
00065             _ConnectCalled -= token;
00066         }
00067     internal:
00068         void raise(OnboardingServiceEventAdapter^ sender, OnboardingConnectCalledEventArgs^ args)
00069         {
00070             _ConnectCalled(sender, args);
00071         }
00072     }
00073
00074     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingOffboardCalledEventArgs^>^ OffboardCalled
00075     {
00076         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingOffboardCalledEventArgs^>^ handler)
00077         {
00078             return _OffboardCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
00079             ([handler](Platform::Object^ sender, Platform::Object^ args)
00080             {
00081                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingOffboardCalledEventArgs^>(args));
00082             }, Platform::CallbackContext::Same);
00083         }
00084         void remove(Windows::Foundation::EventRegistrationToken token)
00085         {
00086             _OffboardCalled -= token;
00087         }
00088     internal:
00089         void raise(OnboardingServiceEventAdapter^ sender, OnboardingOffboardCalledEventArgs^ args)
00090         {
00091             _OffboardCalled(sender, args);
00092         }
00093     }
00094
00095     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetScanInfoCalledEventArgs^>^ GetScanInfoCalled
00096     {
00097         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetScanInfoCalledEventArgs^>^ handler)
00098         {
00099             return _GetScanInfoCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
00100             ([handler](Platform::Object^ sender, Platform::Object^ args)
00101             {
00102                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetScanInfoCalledEventArgs^>(args));
00103             }, Platform::CallbackContext::Same);
00104         }
00105         void remove(Windows::Foundation::EventRegistrationToken token)
00106         {
00107             _GetScanInfoCalled -= token;
00108         }
00109     internal:
00110         void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetScanInfoCalledEventArgs^ args)
00111         {
00112             _GetScanInfoCalled(sender, args);
00113         }
00114     }
00115
00116     // Property Read Events
00117     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetVersionRequestedEventArgs^>^ GetVersionRequested
00118     {
00119         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetVersionRequestedEventArgs^>^ handler)
00120         {
00121             return _GetVersionRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
00122             ([handler](Platform::Object^ sender, Platform::Object^ args)
00123             {
00124                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetVersionRequestedEventArgs^>(args));
00125             }, Platform::CallbackContext::Same);
00126         }
00127         void remove(Windows::Foundation::EventRegistrationToken token)
00128         {
00129             _GetVersionRequested -= token;
00130         }
00131     internal:
00132         void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetVersionRequestedEventArgs^ args)
00133         {
00134             _GetVersionRequested(sender, args);
00135         }
00136     }
00137
00138     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetStateRequestedEventArgs^>^ GetStateRequested
00139     {
00140         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetStateRequestedEventArgs^>^ handler)
00141         {
00142             return _GetStateRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
00143             ([handler](Platform::Object^ sender, Platform::Object^ args)
00144             {
00145                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetStateRequestedEventArgs^>(args));
00146             }, Platform::CallbackContext::Same);
00147         }
00148         void remove(Windows::Foundation::EventRegistrationToken token)
00149         {
00150             _GetStateRequested -= token;
00151         }
00152     internal:
00153         void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetStateRequestedEventArgs^ args)
00154         {
00155             _GetStateRequested(sender, args);
00156         }
00157     }
00158
00159     event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetLastErrorRequestedEventArgs^>^ GetLastErrorRequested
00160     {
00161         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetLastErrorRequestedEventArgs^>^ handler)
00162         {
00163             return _GetLastErrorRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
00164             ([handler](Platform::Object^ sender, Platform::Object^ args)
00165             {
00166                 handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetLastErrorRequestedEventArgs^>(args));
00167             }, Platform::CallbackContext::Same);
00168         }
00169         void remove(Windows::Foundation::EventRegistrationToken token)
00170         {
00171             _GetLastErrorRequested -= token;
00172         }
00173     internal:
00174         void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetLastErrorRequestedEventArgs^ args)
00175         {
00176             _GetLastErrorRequested(sender, args);
00177         }
00178     }
00179
00180     // Property Write Events
00181     // IOnboardingService Implementation
00182     virtual Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^>^ ConfigureWiFiAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType);
00183     virtual Windows::Foundation::IAsyncOperation<OnboardingConnectResult^>^ ConnectAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00184     virtual Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^>^ OffboardAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00185     virtual Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^>^ GetScanInfoAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00186
00187     virtual Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^>^ GetVersionAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00188     virtual Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^>^ GetStateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00189     virtual Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^>^ GetLastErrorAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00190
00191
00192 private:
00193     event Windows::Foundation::EventHandler<Platform::Object^>^ _ConfigureWiFiCalled;
00194     event Windows::Foundation::EventHandler<Platform::Object^>^ _ConnectCalled;
00195     event Windows::Foundation::EventHandler<Platform::Object^>^ _OffboardCalled;
00196     event Windows::Foundation::EventHandler<Platform::Object^>^ _GetScanInfoCalled;
00197     event Windows::Foundation::EventHandler<Platform::Object^>^ _GetVersionRequested;
00198     event Windows::Foundation::EventHandler<Platform::Object^>^ _GetStateRequested;
00199     event Windows::Foundation::EventHandler<Platform::Object^>^ _GetLastErrorRequested;
00200 };
00201
00202 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cpp/BackgroundTransfer/Scenario5_RandomAccess.xaml.h Source File

  • BackgroundTransfer
  • cpp
  • BackgroundTransfer

Scenario5_RandomAccess.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "pch.h"
00015 #include "Scenario5_RandomAccess.g.h"
00016 #include "MainPage.xaml.h"
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario5_RandomAccess sealed
00022     {
00023     public:
00024         Scenario5_RandomAccess();
00025
00026     protected:
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030         void PauseDownload_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00031         void ResumeDownload_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00032         void SeekDownload_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00033         void StartDownload_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034
00035     private:
00036         MainPage^ rootPage = MainPage::Current;
00037
00038         static constexpr unsigned BytesPerMegaByte = 1000000;
00039
00040         // Scenario instance state.
00041         Windows::Networking::BackgroundTransfer::DownloadOperation^ download;
00042         Windows::Storage::Streams::IRandomAccessStreamWithContentType^ randomAccessStream;
00043         Concurrency::task<Windows::Storage::Streams::IBuffer^> readOperation;
00044         Concurrency::cancellation_token_source readCancellationTokenSource;
00045
00046         static Platform::String^ FormatDownloadedRanges(Windows::Foundation::Collections::IIterable<Windows::Networking::BackgroundTransfer::BackgroundTransferFileRange>^ ranges);
00047
00048         Concurrency::task<void> CancelActiveDownloadsAsync();
00049         Concurrency::task<void> StartDownloadAndReadContentsAsync();
00050         Concurrency::task<void> ReadStreamAsync(
00051             Concurrency::task<Windows::Networking::BackgroundTransfer::DownloadOperation^> downloadTask,
00052             Windows::Storage::Streams::Buffer^ readBuffer);
00053
00054         bool IsWebException(Platform::String^ title, Platform::Exception^ ex);
00055
00056         void OnDownloadProgress(
00057             Windows::Foundation::IAsyncOperationWithProgress<Windows::Networking::BackgroundTransfer::DownloadOperation^, Windows::Networking::BackgroundTransfer::DownloadOperation^>^ sender,
00058             Windows::Networking::BackgroundTransfer::DownloadOperation^ progress);
00059         void OnRangesDownloaded(
00060             Windows::Networking::BackgroundTransfer::DownloadOperation^ sender,
00061             Windows::Networking::BackgroundTransfer::BackgroundTransferRangesDownloadedEventArgs^ args);
00062     };
00063 }
Generated on Fri Nov 15 2024 22:18:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Tasks/BackgroundDeviceWatcher.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt
  • Tasks

BackgroundDeviceWatcher.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "BackgroundDeviceWatcher.h"
00003 #include "BackgroundDeviceWatcher.g.cpp"
00004
00005 using namespace winrt;
00006 using namespace winrt::Windows::ApplicationModel::Background;
00007 using namespace winrt::Windows::Devices::Enumeration;
00008 using namespace winrt::Windows::Storage;
00009
00010 namespace winrt::BackgroundDeviceWatcherTask::implementation
00011 {
00012     void DebugWriteLine(const hstring& message)
00013     {
00014         OutputDebugStringW(message.c_str());
00015         OutputDebugStringW(L"\r\n");
00016     }
00017
00018     void BackgroundDeviceWatcher::Run(IBackgroundTaskInstance const& taskInstance)
00019     {
00020         DebugWriteLine(L"BackgroundDeviceWatcher.Run called");
00021
00022         ApplicationDataContainer settings = ApplicationData::Current().LocalSettings();
00023         DeviceWatcherTriggerDetails triggerDetails = taskInstance.TriggerDetails().as<DeviceWatcherTriggerDetails>();
00024
00025         uint32_t newEventCount = triggerDetails.DeviceWatcherEvents().Size();
00026         DebugWriteLine(L"Trigger contains " + to_hstring(newEventCount) + L" events");
00027
00028         for (DeviceWatcherEvent const& e : triggerDetails.DeviceWatcherEvents())
00029         {
00030             switch (e.Kind())
00031             {
00032             case DeviceWatcherEventKind::Add:
00033                 DebugWriteLine(L"Add: " + e.DeviceInformation().Id());
00034                 break;
00035
00036             case DeviceWatcherEventKind::Update:
00037                 DebugWriteLine(L"Update: " + e.DeviceInformationUpdate().Id());
00038                 break;
00039
00040             case DeviceWatcherEventKind::Remove:
00041                 DebugWriteLine(L"Remove: " + e.DeviceInformationUpdate().Id());
00042                 break;
00043             }
00044         }
00045
00046         uint32_t eventCount = unbox_value_or<uint32_t>(settings.Values().TryLookup(L"eventCount"), 0);
00047
00048         // Add the number of events for this trigger to the number of events received in the past
00049         eventCount += newEventCount;
00050
00051         DebugWriteLine(to_hstring(eventCount) + L" events processed for lifetime of trigger");
00052
00053         settings.Values().Insert(L"eventCount", box_value(eventCount));
00054     }
00055 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/SceneObject.h Source File

  • HolographicSpatialStage
  • cpp
  • Content

SceneObject.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "Common\DeviceResources.h"
00004 #include "Common\StepTimer.h"
00005 #include "Content\ShaderStructures.h"
00006
00007 namespace HolographicSpatialStage
00008 {
00009     class SceneObject
00010     {
00011     public:
00012         SceneObject(
00013             const std::shared_ptr<DX::DeviceResources>& deviceResources,
00014             DirectX::XMFLOAT3 const& color,
00015             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00016
00017         SceneObject(
00018             const std::shared_ptr<DX::DeviceResources>& deviceResources,
00019             std::vector<DirectX::XMFLOAT3> const& vertices,
00020             DirectX::XMFLOAT3 const& color,
00021             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00022
00023         SceneObject(
00024             const std::shared_ptr<DX::DeviceResources>& deviceResources,
00025             std::vector<DirectX::XMFLOAT3> const& vertices,
00026             std::vector<unsigned short> const& indices,
00027             DirectX::XMFLOAT3 const& color,
00028             Windows::Perception::Spatial::SpatialCoordinateSystem^ coordinateSystem);
00029
00030         void CreateDeviceDependentResources();
00031         void ReleaseDeviceDependentResources();
00032         void Update(const DX::StepTimer& timer, Windows::Perception::Spatial::SpatialCoordinateSystem^ viewCoords);
00033         void Render();
00034
00035         void EnableWireframe() { m_useWireframe = true; }
00036
00037     private:
00038         // Cached pointer to device resources.
00039         std::shared_ptr<DX::DeviceResources>            m_deviceResources;
00040
00041         // Direct3D resources.
00042         Microsoft::WRL::ComPtr<ID3D11InputLayout>       m_inputLayout;
00043         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_vertexBuffer;
00044         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_indexBuffer;
00045         Microsoft::WRL::ComPtr<ID3D11VertexShader>      m_vertexShader;
00046         Microsoft::WRL::ComPtr<ID3D11GeometryShader>    m_geometryShader;
00047         Microsoft::WRL::ComPtr<ID3D11PixelShader>       m_pixelShader;
00048         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_modelConstantBuffer;
00049
00050         // Rasterizer states, for different rendering modes.
00051         Microsoft::WRL::ComPtr<ID3D11RasterizerState>   m_defaultRasterizerState;
00052         Microsoft::WRL::ComPtr<ID3D11RasterizerState>   m_wireframeRasterizerState;
00053
00054         // System resources.
00055         ModelConstantBuffer                             m_modelConstantBufferData;
00056         std::vector<VertexPositionColor>                m_vertices;
00057         std::vector<unsigned short>                     m_indices;
00058         unsigned int                                    m_indexCount;
00059
00060         Windows::Perception::Spatial::SpatialCoordinateSystem^ m_coordinateSystem;
00061
00062         // Variables used with the rendering loop.
00063         bool                                            m_loadingComplete = false;
00064         bool                                            m_canRenderThisFrame = false;
00065         bool                                            m_useWireframe = false;
00066
00067         // If the current D3D Device supports VPRT, we can avoid using a geometry
00068         // shader just to set the render target array index.
00069         bool                                            m_usingVprtShaders = false;
00070
00071         // Vertices for a cube.
00072         const std::vector<DirectX::XMFLOAT3> c_cubeVertices =
00073             { {
00074                 { DirectX::XMFLOAT3(-0.01f, -0.01f, -0.01f) },
00075                 { DirectX::XMFLOAT3(-0.01f, -0.01f,  0.01f) },
00076                 { DirectX::XMFLOAT3(-0.01f,  0.01f, -0.01f) },
00077                 { DirectX::XMFLOAT3(-0.01f,  0.01f,  0.01f) },
00078                 { DirectX::XMFLOAT3( 0.01f, -0.01f, -0.01f) },
00079                 { DirectX::XMFLOAT3( 0.01f, -0.01f,  0.01f) },
00080                 { DirectX::XMFLOAT3( 0.01f,  0.01f, -0.01f) },
00081                 { DirectX::XMFLOAT3( 0.01f,  0.01f,  0.01f) },
00082             } };
00083
00084         // Indices for a six-sided shape.
00085         const std::vector<unsigned short> c_cubeIndices =
00086             { {
00087                 2,1,0, // -x
00088                 2,3,1,
00089
00090                 6,4,5, // +x
00091                 6,5,7,
00092
00093                 0,1,5, // -y
00094                 0,5,4,
00095
00096                 2,6,7, // +y
00097                 2,7,3,
00098
00099                 0,4,6, // -z
00100                 0,6,2,
00101
00102                 1,3,7, // +z
00103                 1,7,5,
00104             } };
00105     };
00106 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/PedometerBackgroundTask.cs Source File

  • Pedometer
  • cs
  • Tasks

PedometerBackgroundTask.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Devices.Sensors;
00016 using Windows.Storage;
00017
00018 namespace Tasks
00019 {
00020     public sealed class PedometerBackgroundTask : IBackgroundTask
00021     {
00022         /// <summary>
00023         /// The entry point of a background task.
00024         /// </summary>
00025         /// <param name="taskInstance">The current background task instance.</param>
00026         public void Run(IBackgroundTaskInstance taskInstance)
00027         {
00028             // Associate a cancellation handler with the background task.
00029             // Even though this task isn't performing much work, it can still be cancelled.
00030             taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
00031
00032             // Read the pedometer reports from the trigger
00033             SensorDataThresholdTriggerDetails triggerDetails = taskInstance.TriggerDetails as SensorDataThresholdTriggerDetails;
00034             // Ensure that this trigger is of Pedometer type
00035             if (SensorType.Pedometer == triggerDetails.SensorType)
00036             {
00037                 var nThFromLast = 1;
00038                 var reports = Pedometer.GetReadingsFromTriggerDetails(triggerDetails);
00039                 var settings = ApplicationData.Current.LocalSettings;
00040                 var lastReading = reports[reports.Count - nThFromLast];
00041                 var knownTimestamp = lastReading.Timestamp;
00042
00043                 settings.Values["ReportCount"] = reports.Count.ToString();
00044                 settings.Values["LastTimestamp"] = lastReading.Timestamp;
00045
00046                 // insert this step kind count
00047                 settings.Values[lastReading.StepKind.ToString()] = lastReading.CumulativeSteps.ToString();
00048
00049                 // All reports that have the same timestamp correspond to step counts
00050                 // of different step kinds supported by the sensor - Parse each one of
00051                 // them and save in the application data
00052                 while (nThFromLast < reports.Count)
00053                 {
00054                     // get the next reading from the last
00055                     nThFromLast++;
00056                     lastReading = reports[reports.Count - nThFromLast];
00057
00058                     if (knownTimestamp.UtcTicks == lastReading.Timestamp.UtcTicks)
00059                     {
00060                         // captured at the same time indicates that this step-kind data belongs to the same sample
00061                         // insert this step kind count
00062                         settings.Values[lastReading.StepKind.ToString()] = lastReading.CumulativeSteps.ToString();
00063                     }
00064                     else
00065                     {
00066                         break;
00067                     }
00068                 }
00069
00070                 settings.Values["TaskStatus"] = "Completed at " + DateTime.Now.ToString("u");
00071             }
00072             // No deferral is held on taskInstance because we are returning immediately.
00073         }
00074
00075         /// <summary>
00076         /// Handles background task cancellation.
00077         /// </summary>
00078         /// <param name="sender">The background task instance being cancelled.</param>
00079         /// <param name="reason">The cancellation reason.</param>
00080         private void OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
00081         {
00082             var settings = ApplicationData.Current.LocalSettings;
00083             settings.Values["TaskStatus"] = reason.ToString() + " at " + DateTime.Now.ToString("u");
00084         }
00085     }
00086 }
Generated on Fri Nov 15 2024 22:20:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ToastNotificationHistoryChangedTriggerTask Member List

This is the complete list of members for ToastNotificationHistoryChangedTriggerTask, including all inherited members.
Run(IBackgroundTaskInstance taskInstance) ToastNotificationHistoryChangedTriggerTask [inline]
Generated on Fri Nov 15 2024 22:23:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ListViewEdgeTappedEventArgs Member List

This is the complete list of members for ListViewEdgeTappedEventArgs, including all inherited members.
ListViewEdgeTappedEventArgs(ListViewItem listViewItem) | ListViewEdgeTappedEventArgs | [inline]
listViewItem | ListViewEdgeTappedEventArgs | [private]
ListViewItem | ListViewEdgeTappedEventArgs |
Generated on Fri Nov 15 2024 22:23:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario9_CustomPairDevice.xaml.cpp Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario9_CustomPairDevice.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario9_CustomPairDevice.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Platform::Collections;
00011 using namespace Windows::Foundation;
00012 using namespace Windows::Foundation::Collections;
00013 using namespace Windows::UI::Core;
00014 using namespace Windows::UI::Popups;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Security::Credentials;
00024
00025 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00026
00027 Scenario9_CustomPairDevice::Scenario9_CustomPairDevice()
00028 {
00029     InitializeComponent();
00030     deviceWatcherHelper = ref new DeviceWatcherHelper(resultCollection, Dispatcher);
00031     deviceWatcherHelper->DeviceChanged += ref new TypedEventHandler<DeviceWatcher^, String^>(this, &Scenario9_CustomPairDevice::OnDeviceListChanged);
00032 }
00033
00034 void Scenario9_CustomPairDevice::OnNavigatedTo(NavigationEventArgs^ e)
00035 {
00036     resultsListView->ItemsSource = resultCollection;
00037
00038     selectorComboBox->ItemsSource = DeviceSelectorChoices::PairingSelectors;
00039     selectorComboBox->SelectedIndex = 0;
00040
00041     protectionLevelComboBox->ItemsSource = ProtectionSelectorChoices::Selectors;
00042     protectionLevelComboBox->SelectedIndex = 0;
00043 }
00044
00045 void Scenario9_CustomPairDevice::OnNavigatedFrom(NavigationEventArgs^ e)
00046 {
00047     deviceWatcherHelper->Reset();
00048 }
00049
00050 void Scenario9_CustomPairDevice::StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00051 {
00052     StartWatcher();
00053 }
00054
00055 void Scenario9_CustomPairDevice::StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00056 {
00057     StopWatcher();
00058 }
00059
00060 void Scenario9_CustomPairDevice::StartWatcher()
00061 {
00062     startWatcherButton->IsEnabled = false;
00063     resultCollection->Clear();
00064
00065     // Get the device selector chosen by the UI then add additional constraints for devices that
00066     // can be paired or are already paired.
00067     DeviceSelectorInfo^ deviceSelectorInfo = static_cast<DeviceSelectorInfo^>(selectorComboBox->SelectedItem);
00068     String^ selector = "(" + deviceSelectorInfo->Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";
00069
00070     DeviceWatcher^ deviceWatcher;
00071     if (deviceSelectorInfo->Kind == DeviceInformationKind::Unknown)
00072     {
00073         // Kind will be determined by the selector
00074         deviceWatcher = DeviceInformation::CreateWatcher(
00075             selector,
00076             nullptr); // don't request additional properties for this sample
00077     }
00078     else
00079     {
00080         // Kind is specified in the selector info
00081         deviceWatcher = DeviceInformation::CreateWatcher(
00082             selector,
00083             nullptr, // don't request additional properties for this sample
00084             deviceSelectorInfo->Kind);
00085     }
00086
00087     rootPage->NotifyUser("Starting Watcher...", NotifyType::StatusMessage);
00088     deviceWatcherHelper->StartWatcher(deviceWatcher);
00089     stopWatcherButton->IsEnabled = true;
00090 }
00091
00092 void Scenario9_CustomPairDevice::OnDeviceListChanged(DeviceWatcher^ sender, String^ id)
00093 {
00094     // If the item being updated is currently "selected", then update the pairing buttons
00095     DeviceInformationDisplay^ selectedDeviceInfoDisp = safe_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00096     if ((selectedDeviceInfoDisp != nullptr) && (selectedDeviceInfoDisp->Id == id))
00097     {
00098         UpdatePairingButtons();
00099     }
00100 }
00101
00102 void Scenario9_CustomPairDevice::StopWatcher()
00103 {
00104     stopWatcherButton->IsEnabled = false;
00105
00106     deviceWatcherHelper->StopWatcher();
00107
00108     startWatcherButton->IsEnabled = true;
00109 }
00110
00111 void Scenario9_CustomPairDevice::PairButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00112 {
00113     // Gray out the pair button and results view while pairing is in progress.
00114     resultsListView->IsEnabled = false;
00115     pairButton->IsEnabled = false;
00116     rootPage->NotifyUser("Pairing started. Please wait...", NotifyType::StatusMessage);
00117
00118     DeviceInformationDisplay^ deviceInfoDisp = static_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00119
00120     // Get ceremony type and protection level selections
00121     DevicePairingKinds ceremoniesSelected = GetSelectedCeremonies();
00122     ProtectionLevelSelectorInfo^ protectionLevelInfo = static_cast<ProtectionLevelSelectorInfo^>(protectionLevelComboBox->SelectedItem);
00123     DevicePairingProtectionLevel protectionLevel = protectionLevelInfo->ProtectionLevel;
00124
00125     DeviceInformationCustomPairing^ customPairing = deviceInfoDisp->DeviceInfo->Pairing->Custom;
00126
00127     // Hook up handlers for the pairing events before starting the pairing
00128     EventRegistrationToken handlerPairingRequestedToken = customPairing->PairingRequested += ref new TypedEventHandler<DeviceInformationCustomPairing^, DevicePairingRequestedEventArgs^>(this, &Scenario9_CustomPairDevice::PairingRequestedHandler);
00129
00130     create_task(customPairing->PairAsync(ceremoniesSelected, protectionLevel)).then(
00131         [this, customPairing, handlerPairingRequestedToken](DevicePairingResult^ pairingResult)
00132     {
00133         rootPage->NotifyUser(
00134             "Pairing result = " + (pairingResult->Status == DevicePairingResultStatus::Paired ? "Paired" : "NotPaired"),
00135             pairingResult->Status == DevicePairingResultStatus::Paired ? NotifyType::StatusMessage : NotifyType::ErrorMessage);
00136
00137         customPairing->PairingRequested -= handlerPairingRequestedToken;
00138
00139         HidePairingPanel();
00140         UpdatePairingButtons();
00141         resultsListView->IsEnabled = true;
00142     }, task_continuation_context::use_current());
00143 }
00144
00145 void Scenario9_CustomPairDevice::UnpairButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00146 {
00147     // Gray out the unpair button and results view while unpairing is in progress.
00148     resultsListView->IsEnabled = false;
00149     unpairButton->IsEnabled = false;
00150     rootPage->NotifyUser("Unpairing started. Please wait...", NotifyType::StatusMessage);
00151
00152     DeviceInformationDisplay^ deviceInfoDisp = static_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00153
00154     create_task(deviceInfoDisp->DeviceInfo->Pairing->UnpairAsync()).then(
00155         [this](DeviceUnpairingResult^ unpairingResult)
00156     {
00157         rootPage->NotifyUser(
00158             "Unpairing result = " + (unpairingResult->Status == DeviceUnpairingResultStatus::Unpaired ? "Unpaired" : "Failed"),
00159             unpairingResult->Status == DeviceUnpairingResultStatus::Unpaired ? NotifyType::StatusMessage : NotifyType::ErrorMessage);
00160
00161         UpdatePairingButtons();
00162         resultsListView->IsEnabled = true;
00163     }, task_continuation_context::use_current());
00164 }
00165
00166 void Scenario9_CustomPairDevice::PairingRequestedHandler(DeviceInformationCustomPairing^ sender, DevicePairingRequestedEventArgs^ args)
00167 {
00168     switch (args->PairingKind)
00169     {
00170     case DevicePairingKinds::ConfirmOnly:
00171         // Windows itself will pop the confirmation dialog as part of "consent" if this is running on Desktop or Mobile
00172         // If this is an App for 'Windows IoT Core' where there is no Windows Consent UX, you may want to provide your own confirmation.
00173         args->Accept();
00174         break;
00175
00176     case DevicePairingKinds::DisplayPin:
00177         // We just show the PIN on this side. The ceremony is actually completed when the user enters the PIN
00178         // on the target device. We automatically accept here since we can't really "cancel" the operation
00179         // from this side.
00180         args->Accept();
00181
00182         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00183             [this, args]()
00184         {
00185             ShowPairingPanel(
00186                 "Please enter this PIN on the device you are pairing with: " + args->Pin,
00187                 args->PairingKind);
00188         }));
00189         break;
00190
00191     case DevicePairingKinds::ProvidePin:
00192         {
00193             // A PIN may be shown on the target device and the user needs to enter the matching PIN on
00194             // this Windows device. Get a deferral so we can perform the async request to the user.
00195             auto collectPinDeferral = args->GetDeferral();
00196
00197             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00198                 [this, collectPinDeferral, args]()
00199             {
00200                 GetPinFromUserAsync().then([this, collectPinDeferral, args](String^ pin)
00201                 {
00202                     if (pin != nullptr)
00203                     {
00204                         args->Accept(pin);
00205                     }
00206
00207                     collectPinDeferral->Complete();
00208                 }, task_continuation_context::use_current());
00209             }));
00210         }
00211         break;
00212
00213     case DevicePairingKinds::ProvidePasswordCredential:
00214         {
00215             auto collectCredentialDeferral = args->GetDeferral();
00216             rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00217                 [this, collectCredentialDeferral, args]()
00218             {
00219                 GetPasswordCredentialFromUserAsync().then([this, collectCredentialDeferral, args](PasswordCredential^ credential)
00220                 {
00221                     if (credential != nullptr)
00222                     {
00223                         args->AcceptWithPasswordCredential(credential);
00224                     }
00225                     collectCredentialDeferral->Complete();
00226
00227                 }, task_continuation_context::use_current());
00228             }));
00229         }
00230         break;
00231
00232     case DevicePairingKinds::ConfirmPinMatch:
00233         {
00234             // We show the PIN here and the user responds with whether the PIN matches what they see
00235             // on the target device. Response comes back and we set it on the PinComparePairingRequestedData
00236             // then complete the deferral.
00237             auto displayMessageDeferral = args->GetDeferral();
00238
00239             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler(
00240                 [this, displayMessageDeferral, args]()
00241             {
00242                 GetUserConfirmationAsync(args->Pin).then([this, displayMessageDeferral, args](bool accept)
00243                 {
00244                     if (accept)
00245                     {
00246                         args->Accept();
00247                     }
00248
00249                     displayMessageDeferral->Complete();
00250                 }, task_continuation_context::use_current());
00251             }));
00252         }
00253         break;
00254     }
00255 }
00256
00257 void Scenario9_CustomPairDevice::ShowPairingPanel(Platform::String^ text, Windows::Devices::Enumeration::DevicePairingKinds pairingKind)
00258 {
00259     pairingPanel->Visibility = ::Visibility::Collapsed;
00260     pinEntryTextBox->Visibility = ::Visibility::Collapsed;
00261     okButton->Visibility = ::Visibility::Collapsed;
00262     usernameEntryTextBox->Visibility = ::Visibility::Collapsed;
00263     passwordEntryTextBox->Visibility = ::Visibility::Collapsed;
00264     verifyButton->Visibility = ::Visibility::Collapsed;
00265     yesButton->Visibility = ::Visibility::Collapsed;
00266     noButton->Visibility = ::Visibility::Collapsed;
00267     pairingTextBlock->Text = text;
00268
00269     switch (pairingKind)
00270     {
00271     case DevicePairingKinds::ConfirmOnly:
00272     case DevicePairingKinds::DisplayPin:
00273         // Don't need any buttons
00274         break;
00275     case DevicePairingKinds::ProvidePin:
00276         pinEntryTextBox->Text = "";
00277         pinEntryTextBox->Visibility = ::Visibility::Visible;
00278         okButton->Visibility = ::Visibility::Visible;
00279         break;
00280     case DevicePairingKinds::ConfirmPinMatch:
00281         yesButton->Visibility = ::Visibility::Visible;
00282         noButton->Visibility = ::Visibility::Visible;
00283         break;
00284     case DevicePairingKinds::ProvidePasswordCredential:
00285         usernameEntryTextBox->Text = "";
00286         passwordEntryTextBox->Text = "";
00287         passwordEntryTextBox->Visibility = ::Visibility::Visible;
00288         usernameEntryTextBox->Visibility = ::Visibility::Visible;
00289         verifyButton->Visibility = ::Visibility::Visible;
00290         break;
00291     }
00292
00293     pairingPanel->Visibility = ::Visibility::Visible;
00294 }
00295
00296 void Scenario9_CustomPairDevice::HidePairingPanel()
00297 {
00298     pairingPanel->Visibility = ::Visibility::Collapsed;
00299     pairingTextBlock->Text = "";
00300 }
00301
00302 concurrency::task<Platform::String^> Scenario9_CustomPairDevice::GetPinFromUserAsync()
00303 {
00304     HidePairingPanel();
00305     CompleteProvidePinTask();
00306     providePinTaskSrc = task_completion_event<String^>();
00307
00308     ShowPairingPanel(
00309         "Please enter the PIN shown on the device you're pairing with",
00310         DevicePairingKinds::ProvidePin);
00311
00312     return concurrency::task<String^>(providePinTaskSrc);
00313 }
00314
00315 void Scenario9_CustomPairDevice::CompleteProvidePinTask(Platform::String^ pin)
00316 {
00317     providePinTaskSrc.set(pin);
00318 }
00319
00320 concurrency::task<PasswordCredential^> Scenario9_CustomPairDevice::GetPasswordCredentialFromUserAsync()
00321 {
00322     HidePairingPanel();
00323     CompletePasswordCredential(); // Abandon any previous pin request.
00324
00325     ShowPairingPanel(
00326         "Please enter the username and password",
00327         DevicePairingKinds::ProvidePasswordCredential);
00328
00329     providePasswordCredentialSrc = task_completion_event<PasswordCredential^>();
00330
00331     return concurrency::task<PasswordCredential^>(providePasswordCredentialSrc);
00332 }
00333
00334 void Scenario9_CustomPairDevice::CompletePasswordCredential(Platform::String^ username, Platform::String^ password)
00335 {
00336     if (username)
00337     {
00338         auto passwordCredential = ref new PasswordCredential();
00339         passwordCredential->UserName = username;
00340         passwordCredential->Password = password;
00341         providePasswordCredentialSrc.set(passwordCredential);
00342     }
00343     else
00344     {
00345         providePasswordCredentialSrc.set(nullptr);
00346     }
00347 }
00348
00349 concurrency::task<bool> Scenario9_CustomPairDevice::GetUserConfirmationAsync(Platform::String^ pin)
00350 {
00351     HidePairingPanel();
00352     CompleteConfirmPinTask(false);
00353     confirmPinTaskSrc = task_completion_event<bool>();
00354
00355     ShowPairingPanel(
00356         "Does the following PIN match the one shown on the device you are pairing?: " + pin,
00357         DevicePairingKinds::ConfirmPinMatch);
00358
00359     return concurrency::task<bool>(confirmPinTaskSrc);
00360 }
00361
00362 void Scenario9_CustomPairDevice::CompleteConfirmPinTask(bool accept)
00363 {
00364     confirmPinTaskSrc.set(accept);
00365 }
00366
00367 void Scenario9_CustomPairDevice::okButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00368 {
00369     // OK button is only used for the ProvidePin scenario
00370     CompleteProvidePinTask(pinEntryTextBox->Text);
00371     HidePairingPanel();
00372 }
00373
00374 void SDKTemplate::Scenario9_CustomPairDevice::verifyButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00375 {
00376     // verify button is only used for the ProvidePin scenario
00377     CompletePasswordCredential(usernameEntryTextBox->Text, passwordEntryTextBox->Text);
00378     HidePairingPanel();
00379 }
00380
00381 void Scenario9_CustomPairDevice::yesButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00382 {
00383     CompleteConfirmPinTask(true);
00384     HidePairingPanel();
00385 }
00386
00387 void Scenario9_CustomPairDevice::noButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00388 {
00389     CompleteConfirmPinTask(false);
00390     HidePairingPanel();
00391 }
00392
00393 DevicePairingKinds Scenario9_CustomPairDevice::GetSelectedCeremonies()
00394 {
00395     DevicePairingKinds ceremonySelection = DevicePairingKinds::None;
00396
00397     if (confirmOnlyOption->IsChecked->Value)
00398     {
00399         ceremonySelection = ceremonySelection | DevicePairingKinds::ConfirmOnly;
00400     }
00401     if (displayPinOption->IsChecked->Value)
00402     {
00403         ceremonySelection = ceremonySelection | DevicePairingKinds::DisplayPin;
00404     }
00405     if (providePinOption->IsChecked->Value)
00406     {
00407         ceremonySelection = ceremonySelection | DevicePairingKinds::ProvidePin;
00408     }
00409     if (confirmPinMatchOption->IsChecked->Value)
00410     {
00411         ceremonySelection = ceremonySelection | DevicePairingKinds::ConfirmOnly;
00412     }
00413     if (passwordCredentialOption->IsChecked->Value)
00414     {
00415         ceremonySelection = ceremonySelection | DevicePairingKinds::ProvidePasswordCredential;
00416     }
00417
00418     return ceremonySelection;
00419 }
00420
00421 void Scenario9_CustomPairDevice::ResultsListView_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00422 {
00423     UpdatePairingButtons();
00424 }
00425
00426 void Scenario9_CustomPairDevice::UpdatePairingButtons()
00427 {
00428     DeviceInformationDisplay^ deviceInfoDisp = static_cast<DeviceInformationDisplay^>(resultsListView->SelectedItem);
00429
00430     if (nullptr != deviceInfoDisp &&
00431         deviceInfoDisp->DeviceInfo->Pairing->CanPair &&
00432         !deviceInfoDisp->DeviceInfo->Pairing->IsPaired)
00433     {
00434         pairButton->IsEnabled = true;
00435     }
00436     else
00437     {
00438         pairButton->IsEnabled = false;
00439     }
00440
00441     if (nullptr != deviceInfoDisp &&
00442         deviceInfoDisp->DeviceInfo->Pairing->IsPaired)
00443     {
00444         unpairButton->IsEnabled = true;
00445     }
00446     else
00447     {
00448         unpairButton->IsEnabled = false;
00449     }
00450 }
00451
Generated on Fri Nov 15 2024 22:19:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cs/SampleConfiguration.cs Source File

  • Json
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Json";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Parse and Stringify", ClassType=typeof(Scenario1_ParseAndStringify)}
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BackgroundTaskSample Member List

This is the complete list of members for BackgroundTaskSample, including all inherited members.
ApplicationTriggerTaskName | BackgroundTaskSample |
ApplicationTriggerTaskProgress | BackgroundTaskSample | [static]
ApplicationTriggerTaskProgress | BackgroundTaskSample | [static]
ApplicationTriggerTaskRegistered | BackgroundTaskSample | [static]
ApplicationTriggerTaskResult | BackgroundTaskSample | [static]
ApplicationTriggerTaskResult | BackgroundTaskSample | [static]
BackgroundTaskGroupFriendlyName | BackgroundTaskSample |
BackgroundTaskGroupId | BackgroundTaskSample |
GetBackgroundTaskStatus(String^name) | BackgroundTaskSample | [static]
GetBackgroundTaskStatus(String name) | BackgroundTaskSample | [inline, static]
GetBackgroundTaskStatus(String^name) | BackgroundTaskSample | [static]
GetBackgroundTaskStatus(String name) | BackgroundTaskSample | [inline, static]
GetTaskGroup(String^id, String^groupName) | BackgroundTaskSample | [static]
GetTaskGroup(string id, string groupName) | BackgroundTaskSample | [inline, static]
GetTaskGroup(String^id, String^groupName) | BackgroundTaskSample | [static]
GetTaskGroup(string id, string groupName) | BackgroundTaskSample | [inline, static]
GroupedBackgroundTaskName | BackgroundTaskSample |
GroupedBackgroundTaskProgress | BackgroundTaskSample | [static]
GroupedBackgroundTaskProgress | BackgroundTaskSample | [static]
GroupedBackgroundTaskRegistered | BackgroundTaskSample | [static]
RegisterBackgroundTask(String^taskEntryPoint, String^name, IBackgroundTrigger^trigger, IBackgroundCondition^condition, BackgroundTaskRegistrationGroup^group=nullptr) | BackgroundTaskSample | [static]
RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group=null) | BackgroundTaskSample | [inline, static]
RegisterBackgroundTask(String^taskEntryPoint, String^name, IBackgroundTrigger^trigger, IBackgroundCondition^condition, BackgroundTaskRegistrationGroup^group=nullptr) | BackgroundTaskSample | [static]
RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group=null) | BackgroundTaskSample | [inline, static]
RemoveBackgroundTaskStatus(String^name) | BackgroundTaskSample | [static]
SampleBackgroundTaskEntryPoint | BackgroundTaskSample |
SampleBackgroundTaskName | BackgroundTaskSample |
SampleBackgroundTaskProgress | BackgroundTaskSample | [static]
SampleBackgroundTaskProgress | BackgroundTaskSample | [static]
SampleBackgroundTaskRegistered | BackgroundTaskSample | [static]
SampleBackgroundTaskWithConditionName | BackgroundTaskSample |
SampleBackgroundTaskWithConditionProgress | BackgroundTaskSample | [static]
SampleBackgroundTaskWithConditionProgress | BackgroundTaskSample | [static]
SampleBackgroundTaskWithConditionRegistered | BackgroundTaskSample | [static]
ServicingCompleteTaskEntryPoint | BackgroundTaskSample |
ServicingCompleteTaskName | BackgroundTaskSample |
ServicingCompleteTaskProgress | BackgroundTaskSample | [static]
ServicingCompleteTaskProgress | BackgroundTaskSample | [static]
ServicingCompleteTaskRegistered | BackgroundTaskSample | [static]
TaskRequiresBackgroundAccess(String^name) | BackgroundTaskSample | [static]
TaskRequiresBackgroundAccess(String name) | BackgroundTaskSample | [inline, static]
TaskRequiresBackgroundAccess(String^name) | BackgroundTaskSample | [static]
TaskRequiresBackgroundAccess(String name) | BackgroundTaskSample | [inline, static]
TaskStatuses | BackgroundTaskSample | [static]
TaskStatuses | BackgroundTaskSample | [static]
TimeTriggeredTaskName | BackgroundTaskSample |
TimeTriggeredTaskProgress | BackgroundTaskSample | [static]
TimeTriggeredTaskProgress | BackgroundTaskSample | [static]
TimeTriggeredTaskRegistered | BackgroundTaskSample | [static]
UnregisterBackgroundTasks(String^name, BackgroundTaskRegistrationGroup^group=nullptr) | BackgroundTaskSample | [static]
UnregisterBackgroundTasks(String name, BackgroundTaskRegistrationGroup group=null) | BackgroundTaskSample | [inline, static]
UnregisterBackgroundTasks(String^name, BackgroundTaskRegistrationGroup^group=nullptr) | BackgroundTaskSample | [static]
UnregisterBackgroundTasks(String name, BackgroundTaskRegistrationGroup group=null) | BackgroundTaskSample | [inline, static]
UpdateBackgroundTaskRegistrationStatus(String^name, bool registered) | BackgroundTaskSample | [static]
UpdateBackgroundTaskRegistrationStatus(String name, bool registered) | BackgroundTaskSample | [inline, static]
UpdateBackgroundTaskRegistrationStatus(String^name, bool registered) | BackgroundTaskSample | [static]
UpdateBackgroundTaskRegistrationStatus(String name, bool registered) | BackgroundTaskSample | [inline, static]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/ProductItem.h Source File

  • Simple3DGameXaml
  • cpp

ProductItem.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace Simple3DGameXaml
00015 {
00016     [Windows::UI::Xaml::Data::Bindable]
00017     [Windows::Foundation::Metadata::WebHostHidden]
00018     public ref class ProductItem sealed :
00019         public Windows::UI::Xaml::Data::INotifyPropertyChanged
00020     {
00021     internal:
00022         ProductItem(
00023             Windows::ApplicationModel::Store::ListingInformation^ listing,
00024             Windows::ApplicationModel::Store::LicenseInformation^ license,
00025             Platform::String^ productId,
00026             bool isApp
00027             );
00028
00029     public:
00030         virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00031
00032         property Platform::String^ Title
00033         {
00034             Platform::String^ get()
00035             {
00036                 return m_title;
00037             }
00038         }
00039
00040         property Platform::String^ Price
00041         {
00042             Platform::String^ get()
00043             {
00044                 return m_formattedPrice;
00045             }
00046         }
00047
00048         property Platform::String^ Status
00049         {
00050             Platform::String^ get()
00051             {
00052                 return m_status;
00053             }
00054         }
00055
00056         property int BuyVisibility
00057         {
00058             int get()
00059             {
00060                 return static_cast<int>(m_isAvailableForPurchase ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed);
00061             }
00062         }
00063
00064         property Platform::String^ ProductId
00065         {
00066             Platform::String^ get()
00067             {
00068                 return m_productId;
00069             }
00070         }
00071
00072         property Platform::String^ Foreground
00073         {
00074             Platform::String^ get()
00075             {
00076                 return m_foreground;
00077             }
00078         }
00079
00080         [Windows::Foundation::Metadata::DefaultOverload]
00081         void UpdateContent(Windows::ApplicationModel::Store::LicenseInformation^ license);
00082         void UpdateContent(Windows::ApplicationModel::Store::ListingInformation^ listing);
00083
00084     private:
00085         void SetStatus(Windows::ApplicationModel::Store::LicenseInformation^ license);
00086
00087         Platform::String^ m_title;
00088         Platform::String^ m_formattedPrice;
00089         Platform::String^ m_productId;
00090         Platform::String^ m_status;
00091         Platform::String^ m_foreground;
00092         bool              m_isApp;
00093         bool              m_isAppActive;
00094         bool              m_isAppTrial;
00095         bool              m_isProductActive;
00096         bool              m_isAvailableForPurchase;
00097     };
00098 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cs/SampleConfiguration.cs Source File

  • XamlListView
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "ListView/GridView C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Simple ListView", ClassType=typeof(Scenario1_SimpleListView)},
00025             new Scenario() { Title="Simple GridView", ClassType=typeof(Scenario2_SimpleGridView)},
00026             new Scenario() { Title="Master Detail and Selection", ClassType=typeof(Scenario3_MasterDetail)},
00027             new Scenario() { Title="Edge Tapped ListView", ClassType=typeof(Scenario4_EdgeTappedListView)},
00028             new Scenario() { Title="Restore Scroll Position", ClassType=typeof(Scenario5_RestoreScrollPosition)},
00029             new Scenario() { Title="Scroll Into View", ClassType=typeof(Scenario6_ScrollIntoView)},
00030         };
00031     }
00032
00033     public class Scenario
00034     {
00035         public string Title { get; set; }
00036         public Type ClassType { get; set; }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PlayReadyHelpers Member List

This is the complete list of members for PlayReadyHelpers, including all inherited members.
ComponentLoadFailed(MediaProtectionManager sender, ComponentLoadFailedEventArgs e) | PlayReadyHelpers | [inline, private, static]
createLicenseSession() | PlayReadyHelpers | [inline, static]
InitializeProtectionManager(ServiceRequestedEventHandler serviceRequestHandler) | PlayReadyHelpers | [inline, static]
IsIndividualized | PlayReadyHelpers | [static]
ProactiveIndividualization(Action callback) | PlayReadyHelpers | [inline, static]
ProactiveLicenseAcquisition(PlayReadyContentHeader contentHeader, Action callback=null) | PlayReadyHelpers | [inline, static]
ReactiveIndividualization(PlayReadyIndividualizationServiceRequest indivRequest, MediaProtectionServiceCompletion serviceCompletionNotifier, Action callback=null) | PlayReadyHelpers | [inline, static]
ReactiveLicenseAcquisition(IPlayReadyLicenseAcquisitionServiceRequest licenseRequest, MediaProtectionServiceCompletion serviceCompletionNotifier, Action callback=null) | PlayReadyHelpers | [inline, static]
Generated on Fri Nov 15 2024 22:24:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/Level1.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

Level1.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 // Level1:
00015 // This class defines the first level of the game. There are nine active targets.
00016 // Each of the targets is stationary and can be hit in any order.
00017
00018 #include "Level.h"
00019
00020 class Level1 : public Level
00021 {
00022 public:
00023     Level1();
00024     virtual void Initialize(std::vector<std::shared_ptr<GameObject>> const& objects) override;
00025 };
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario4_BackgroundProximitySensor.xaml.cpp Source File

  • ProximitySensor
  • cpp

Scenario4_BackgroundProximitySensor.xaml.cpp

Go to the documentation of this file.
00001 ﻿////*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4_BackgroundProximitySensor.xaml.cpp
00014 // Implementation of the Scenario4_BackgroundProximitySensor class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario4_BackgroundProximitySensor.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Enumeration;
00024 using namespace Windows::Devices::Sensors;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Globalization::DateTimeFormatting;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Navigation;
00031 using namespace Windows::ApplicationModel::Background;
00032 using namespace Windows::Storage;
00033 using namespace Concurrency;
00034
00035 Scenario4_BackgroundProximitySensor::Scenario4_BackgroundProximitySensor() : rootPage(MainPage::Current), sensor(nullptr), backgroundTaskRegistered(false)
00036 {
00037     InitializeComponent();
00038
00039     watcher = DeviceInformation::CreateWatcher(ProximitySensor::GetDeviceSelector());
00040     watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(this, &Scenario4_BackgroundProximitySensor::OnProximitySensorAdded);
00041     watcher->Start();
00042 }
00043
00044 /// <summary>
00045 /// Invoked when the device watcher finds a proximity sensor
00046 /// </summary>
00047 /// <param name="sender">The device watcher</param>
00048 /// <param name="device">Device information for the proximity sensor that was found</param>
00049 void Scenario4_BackgroundProximitySensor::OnProximitySensorAdded(DeviceWatcher^ /*sender*/, DeviceInformation^ device)
00050 {
00051     if (nullptr == sensor)
00052     {
00053         ProximitySensor^ foundSensor = ProximitySensor::FromId(device->Id);
00054         if (nullptr != foundSensor)
00055         {
00056             sensor = foundSensor;
00057         }
00058         else
00059         {
00060             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00061             {
00062                 rootPage->NotifyUser("Could not get a proximity sensor from the device id", NotifyType::ErrorMessage);
00063             }, CallbackContext::Any));
00064         }
00065     }
00066 }
00067
00068 /// <summary>
00069 /// Invoked when this page is about to be displayed in a Frame.
00070 /// </summary>
00071 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00072 /// property is typically used to configure the page.</param>
00073 void Scenario4_BackgroundProximitySensor::OnNavigatedTo(NavigationEventArgs^ e)
00074 {
00075     for each (auto cur in BackgroundTaskRegistration::AllTasks)
00076     {
00077         auto registration = dynamic_cast<BackgroundTaskRegistration^>(cur->Value);
00078         if (SampleBackgroundTaskName == registration->Name)
00079         {
00080             backgroundTaskRegistered = true;
00081             break;
00082         }
00083     }
00084     UpdateUIAsync(backgroundTaskRegistered ? "Registered" : "Unregistered");
00085 }
00086
00087 /// <summary>
00088 /// This is the click handler for the 'Enable' button.
00089 /// </summary>
00090 /// <param name="sender"></param>
00091 /// <param name="e"></param>
00092 void Scenario4_BackgroundProximitySensor::ScenarioRegisterTask_Click(Object^ /*sender*/, RoutedEventArgs^ /*e*/)
00093 {
00094     if (nullptr != sensor)
00095     {
00096         create_task(BackgroundExecutionManager::RequestAccessAsync()).then([this](BackgroundAccessStatus status) {
00097
00098             if ((BackgroundAccessStatus::AlwaysAllowed == status) ||
00099                 (BackgroundAccessStatus::AllowedSubjectToSystemPolicy == status))
00100             {
00101                 RegisterBackgroundTask();
00102             }
00103             else
00104             {
00105                 rootPage->NotifyUser("Background tasks may be disabled for this app", NotifyType::ErrorMessage);
00106             }
00107         });
00108     }
00109     else
00110     {
00111         rootPage->NotifyUser("No proximity sensor found", NotifyType::ErrorMessage);
00112     }
00113 }
00114
00115 /// <summary>
00116 /// This is the click handler for the 'Disable' button.
00117 /// </summary>
00118 /// <param name="sender"></param>
00119 /// <param name="e"></param>
00120 void Scenario4_BackgroundProximitySensor::ScenarioUnregisterTask_Click(Object^ sender, RoutedEventArgs^ e)
00121 {
00122     for each (auto cur in BackgroundTaskRegistration::AllTasks)
00123     {
00124         auto registration = dynamic_cast<BackgroundTaskRegistration^>(cur->Value);
00125         if (SampleBackgroundTaskName == registration->Name)
00126         {
00127             registration->Unregister(true);
00128             backgroundTaskRegistered = false;
00129             break;
00130         }
00131     }
00132     UpdateUIAsync("Unregistered");
00133 }
00134
00135 /// <summary>
00136 /// This is the event handler for background task completion.
00137 /// </summary>
00138 /// <param name="task">The task that is reporting completion.</param>
00139 /// <param name="args">The completion report arguments.</param>
00140 void Scenario4_BackgroundProximitySensor::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
00141 {
00142     String^ status = "Completed";
00143     try
00144     {
00145         args->CheckResult();
00146     }
00147     catch (Exception^ e)
00148     {
00149         status = e->Message;
00150     }
00151     UpdateUIAsync(status);
00152 }
00153
00154 /// <summary>
00155 /// Registers the background task.
00156 /// </summary>
00157 void Scenario4_BackgroundProximitySensor::RegisterBackgroundTask()
00158 {
00159     // Make sure we have a proximity sensor we want to listen to
00160     if (nullptr != sensor)
00161     {
00162         auto builder = ref new BackgroundTaskBuilder();
00163         builder->Name = SampleBackgroundTaskName;
00164         builder->TaskEntryPoint = SampleBackgroundTaskEntryPoint;
00165
00166         // create a Proximity sensor data threshold, which simply uses the sensor to listen-to
00167         auto threshold = ref new ProximitySensorDataThreshold(sensor);
00168         // create a sensor trigger using the data threshold created above
00169         auto trigger = ref new SensorDataThresholdTrigger(threshold);
00170
00171         // set the trigger and register
00172         builder->SetTrigger(trigger);
00173         auto task = builder->Register();
00174         task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &Scenario4_BackgroundProximitySensor::OnCompleted);
00175
00176         backgroundTaskRegistered = true;
00177         UpdateUIAsync("Registered");
00178     }
00179     else
00180     {
00181         UpdateUIAsync("No Proximity Sensor is available");
00182     }
00183 }
00184
00185 /// <summary>
00186 /// Updates the scenario UI.
00187 /// </summary>
00188 /// <param name="status">The status string to display.</param>
00189 void Scenario4_BackgroundProximitySensor::UpdateUIAsync(String^ status)
00190 {
00191     // Update the status in the UI thread
00192     Dispatcher->RunAsync(
00193         CoreDispatcherPriority::Normal,
00194         ref new DispatchedHandler(
00195             [this, status]()
00196     {
00197         ScenarioRegisterTaskButton->IsEnabled = !backgroundTaskRegistered;
00198         ScenarioUnregisterTaskButton->IsEnabled = backgroundTaskRegistered;
00199         ScenarioOutput_TaskRegistration->Text = status;
00200         auto settings = ApplicationData::Current->LocalSettings;
00201
00202         // update the UI based on the data that the background task saved in the application cache
00203         if (settings->Values->HasKey("TaskStatus"))
00204         {
00205             ScenarioOutput_TaskStatus->Text = safe_cast<String^>(settings->Values->Lookup("TaskStatus"));
00206         }
00207         if (settings->Values->HasKey("ReportCount"))
00208         {
00209             ScenarioOutput_ReportCount->Text = safe_cast<String^>(settings->Values->Lookup("ReportCount"));
00210         }
00211         if (settings->Values->HasKey("LastTimestamp"))
00212         {
00213             ScenarioOutput_LastTimestamp->Text = safe_cast<String^>(settings->Values->Lookup("LastTimestamp"));
00214         }
00215         if (settings->Values->HasKey("Detected"))
00216         {
00217             ScenarioOutput_Detected->Text = safe_cast<String^>(settings->Values->Lookup("Detected"));
00218         }
00219     },
00220             CallbackContext::Any
00221         )
00222         );
00223 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cs/BarcodeScannerProvider/Scenario1_Configuration.xaml.cs Source File

  • BarcodeScannerProvider
  • cs
  • BarcodeScannerProvider

Scenario1_Configuration.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using Windows.Globalization;
00014 using Windows.Media.Ocr;
00015 using Windows.Storage;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class Scenario1_Configuration : Page
00027     {
00028         // A pointer back to the main page.
00029         // This is needed if you want to call methods in MainPage such as NotifyUser()
00030         private MainPage rootPage = MainPage.Current;
00031
00032         private static ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
00033
00034         public Scenario1_Configuration()
00035         {
00036             this.InitializeComponent();
00037
00038             IReadOnlyList<Language> availableLanguages = OcrEngine.AvailableRecognizerLanguages;
00039
00040             LanguageList.ItemsSource = availableLanguages;
00041
00042             if (availableLanguages.Count > 0)
00043             {
00044                 // Select the one that the user selected last time, if any.
00045                 if (localSettings.Values["decoderLanguage"] is string languageTag)
00046                 {
00047                     foreach (Language language in availableLanguages)
00048                     {
00049                         if (language.LanguageTag == languageTag)
00050                         {
00051                             LanguageList.SelectedItem = language;
00052                             break;
00053                         }
00054                     }
00055                 }
00056
00057                 // If not found (or user had never set a preference), then select the first one.
00058                 if (LanguageList.SelectedIndex < 0)
00059                 {
00060                     LanguageList.SelectedIndex = 0;
00061                 }
00062             }
00063         }
00064
00065         /// <summary>
00066         /// Occurs when selected language is changed in available languages combo box.
00067         /// </summary>
00068         /// <param name="sender"></param>
00069         /// <param name="e"></param>
00070         private void LanguageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
00071         {
00072             var selectedLanguage = LanguageList.SelectedItem as Language;
00073             if (selectedLanguage != null)
00074             {
00075                 rootPage.NotifyUser($"Selected decoder language is {selectedLanguage.DisplayName}.", NotifyType.StatusMessage);
00076
00077                 localSettings.Values["decoderLanguage"] = selectedLanguage.LanguageTag;
00078             }
00079         }
00080     }
00081 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/DynamicCommandBar.cpp Source File

  • XamlCommanding
  • cpp

DynamicCommandBar.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // DynamicCommandBar.cpp
00003 // Implementation of the DynamicCommandBar class.
00004 //
00005
00006 #include "pch.h"
00007 #include "DynamicCommandBar.h"
00008
00009 using namespace Platform;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::UI::Xaml;
00013 using namespace Windows::UI::Xaml::Controls;
00014 using namespace Windows::UI::Xaml::Data;
00015 using namespace Windows::UI::Xaml::Documents;
00016 using namespace Windows::UI::Xaml::Input;
00017 using namespace Windows::UI::Xaml::Interop;
00018 using namespace Windows::UI::Xaml::Media;
00019
00020 namespace SDKTemplate
00021 {
00022     DependencyProperty^ DynamicCommandBar::_contentMinWidthProperty =
00023         DependencyProperty::Register(
00024             "ContentMinWidth",
00025             TypeName(double::typeid),
00026             TypeName(DynamicCommandBar::typeid),
00027             ref new PropertyMetadata(0.0));
00028
00029     void DynamicCommandBar::OnApplyTemplate()
00030     {
00031         CommandBar::OnApplyTemplate();
00032         _moreButton = dynamic_cast<Button^>(GetTemplateChild("ExpandButton"));
00033     }
00034
00035     Size DynamicCommandBar::MeasureOverride(Size availableSize)
00036     {
00037         static const Size infiniteBounds = { std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity() };
00038         auto sizeToReport = CommandBar::MeasureOverride(availableSize);
00039
00040         // Account for the size of the Content area
00041         auto contentWidth = this->ContentMinWidth;
00042
00043         // Account for the size of the More button
00044         auto expandButtonWidth = 0.0;
00045         if (_moreButton != nullptr && _moreButton->Visibility == Windows::UI::Xaml::Visibility::Visible)
00046         {
00047             expandButtonWidth = _moreButton->DesiredSize.Width;
00048         }
00049
00050         double requestedWidth = expandButtonWidth + contentWidth;
00051
00052         // Include the size of all the PrimaryCommands
00053         for (ICommandBarElement^ cmd : PrimaryCommands)
00054         {
00055             auto uie = dynamic_cast<UIElement^>(cmd);
00056             requestedWidth += uie->DesiredSize.Width;
00057         }
00058
00059         // First, move items to the overflow until the remaining PrimaryCommands fit
00060         for (auto i = PrimaryCommands->Size - 1; i >= 0 && requestedWidth > availableSize.Width; i--)
00061         {
00062             auto item = PrimaryCommands->GetAt(i);
00063             auto element = dynamic_cast<UIElement^>(item);
00064
00065             if (element == nullptr)
00066             {
00067                 continue;
00068             }
00069
00070             requestedWidth -= element->DesiredSize.Width;
00071
00072             if (overflow.size() == 0 && SecondaryCommands->Size > 0 && dynamic_cast<AppBarSeparator^>(element) == nullptr)
00073             {
00074                 // Insert a separator to differentiate between the items that were already in the overflow versus
00075                 // those we moved
00076                 auto abs = ref new AppBarSeparator();
00077                 abs->Measure(infiniteBounds);
00078                 separatorQueue.push(std::tuple<ICommandBarElement^, double>(abs, abs->DesiredSize.Width));
00079                 separatorQueueWidth += abs->DesiredSize.Width;
00080             }
00081
00082             PrimaryCommands->RemoveAt(i);
00083
00084             // move separators we've queued up
00085             while (!separatorQueue.empty())
00086             {
00087                 auto next = separatorQueue.front();
00088                 separatorQueue.pop();
00089
00090                 separatorQueueWidth -= std::get<1>(next);
00091                 overflow.push(next);
00092                 SecondaryCommands->InsertAt(0, std::get<0>(next));
00093             }
00094
00095             // We store the measured size before it moves to overflow and will rely on that value
00096             // when determining how many items to move back out the overflow.
00097             overflow.push(std::tuple<ICommandBarElement^, double>(item, element->DesiredSize.Width));
00098
00099             SecondaryCommands->InsertAt(0, reinterpret_cast<ICommandBarElement^>(element));
00100
00101             // if a separator was adjacent to the one we removed then move the separator to our holding queue so
00102             // that it doesn't appear without actually separating the content
00103             AppBarSeparator^ last = nullptr;
00104             if (PrimaryCommands->Size > 0)
00105             {
00106                 auto item = PrimaryCommands->GetAt(PrimaryCommands->Size - 1);
00107                 last = dynamic_cast<AppBarSeparator^>(item);
00108             }
00109
00110             if (last != nullptr)
00111             {
00112                 PrimaryCommands->RemoveAtEnd();
00113                 separatorQueue.push(std::tuple<ICommandBarElement^, double>(last, last->DesiredSize.Width));
00114                 separatorQueueWidth += last->DesiredSize.Width;
00115                 requestedWidth -= last->DesiredSize.Width;
00116             }
00117         }
00118
00119         // Next move items out of the overflow if room is available
00120         while (overflow.size() > 0 && requestedWidth + separatorQueueWidth + std::get<1>(overflow.top()) <= availableSize.Width)
00121         {
00122             auto top = overflow.top();
00123             auto topItem = std::get<0>(top);
00124             auto topWidth = std::get<1>(top);
00125             overflow.pop();
00126
00127             SecondaryCommands->RemoveAt(0);
00128
00129             if (overflow.size() == 1 && SecondaryCommands->Size > 1)
00130             {
00131                 // must be the separator injected earlier
00132                 overflow.pop();
00133                 SecondaryCommands->RemoveAt(0);
00134             }
00135
00136             if (dynamic_cast<AppBarSeparator^>(topItem) != nullptr)
00137             {
00138                 separatorQueue.push(top);
00139                 separatorQueueWidth += topWidth;
00140                 continue;
00141             }
00142             else
00143             {
00144                 while (separatorQueue.size() > 0)
00145                 {
00146                     auto next = separatorQueue.front();
00147                     auto nextItem = std::get<0>(next);
00148                     auto nextWidth = std::get<1>(next);
00149                     separatorQueue.pop();
00150
00151                     PrimaryCommands->Append(nextItem);
00152                     separatorQueueWidth -= nextWidth;
00153                     requestedWidth += nextWidth;
00154                 }
00155             }
00156
00157             // Sometimes this property is being set to disabled
00158             auto ctrl = reinterpret_cast<Control^>(topItem);
00159             ctrl->IsEnabled = true;
00160
00161             PrimaryCommands->Append(topItem);
00162             requestedWidth += topWidth;
00163
00164             // check to see if after moving this item we leave a separator at the top of the overflow
00165             if (overflow.size() > 0)
00166             {
00167                 if (dynamic_cast<AppBarSeparator^>(std::get<0>(overflow.top())) != nullptr)
00168                 {
00169                     // we won't leave an orphaned separator
00170                     SecondaryCommands->RemoveAt(0);
00171                     auto top = overflow.top();
00172                     overflow.pop();
00173
00174                     auto element = dynamic_cast<UIElement^>(topItem);
00175                     element->Measure(infiniteBounds);
00176                     separatorQueue.push(std::tuple<ICommandBarElement^, double>(std::get<0>(top), element->DesiredSize.Width));
00177                     separatorQueueWidth += element->DesiredSize.Width;
00178                 }
00179             }
00180         }
00181
00182         return sizeToReport;
00183     }
00184 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OnDeviceConnectedEventArgs Member List

This is the complete list of members for OnDeviceConnectedEventArgs, including all inherited members.
deviceInformation | OnDeviceConnectedEventArgs | [private]
DeviceInformation | OnDeviceConnectedEventArgs |
isDeviceSuccessfullyConnected | OnDeviceConnectedEventArgs | [private]
IsDeviceSuccessfullyConnected | OnDeviceConnectedEventArgs |
OnDeviceConnectedEventArgs(Boolean isDeviceSuccessfullyConnected, Windows.Devices.Enumeration.DeviceInformation deviceInformation) | OnDeviceConnectedEventArgs | [inline]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8_PairDevice Member List

This is the complete list of members for Scenario8_PairDevice, including all inherited members.
deviceWatcherHelper | Scenario8_PairDevice | [private]
OnDeviceListChanged(DeviceWatcher sender, string id) | Scenario8_PairDevice | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario8_PairDevice | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario8_PairDevice | [inline, protected]
PairButton_Click(object sender, RoutedEventArgs e) | Scenario8_PairDevice | [inline, private]
resultCollection | Scenario8_PairDevice | [private]
ResultsListView_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario8_PairDevice | [inline, private]
rootPage | Scenario8_PairDevice | [private]
Scenario8_PairDevice() | Scenario8_PairDevice | [inline]
StartWatcher() | Scenario8_PairDevice | [inline, private]
StartWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario8_PairDevice | [inline, private]
StopWatcher() | Scenario8_PairDevice | [inline, private]
StopWatcherButton_Click(object sender, RoutedEventArgs e) | Scenario8_PairDevice | [inline, private]
UnpairButton_Click(object sender, RoutedEventArgs e) | Scenario8_PairDevice | [inline, private]
UpdatePairingButtons() | Scenario8_PairDevice | [inline, private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteTextLayoutImplementation/pch.h Source File

  • DWriteLineSpacingModes
  • cpp
  • DWriteTextLayoutImplementation

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <collection.h>
00015 #include <ppltasks.h>
00016
00017 #include <d3d11_3.h>
00018 #include <d2d1_3.h>
00019 #include <dwrite_3.h>
00020 #include <math.h>
00021
00022 #include <windows.ui.xaml.media.dxinterop.h>
00023
00024 #include <string>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/pch.cpp Source File

  • PosPrinter
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SampleConstants Member List

This is the complete list of members for SampleConstants, including all inherited members.
Scenario1_DeviceUse_TaskEntryPoint | SampleConstants |
Scenario1_DeviceUse_TaskName | SampleConstants |
Scenario1_TaskEntryPoint | SampleConstants | [static]
Scenario1_TaskName | SampleConstants | [static]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/Scenario8_PairDevice.xaml.cs Source File

  • DeviceEnumerationAndPairing
  • cs

Scenario8_PairDevice.xaml.cs

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.ObjectModel;
00005 using Windows.Devices.Enumeration;
00006 using Windows.Foundation;
00007 using Windows.UI.Core;
00008 using Windows.UI.Xaml;
00009 using Windows.UI.Xaml.Controls;
00010 using Windows.UI.Xaml.Navigation;
00011
00012 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00013
00014 namespace SDKTemplate
00015 {
00016     /// <summary>
00017     /// An empty page that can be used on its own or navigated to within a Frame.
00018     /// </summary>
00019     public sealed partial class Scenario8_PairDevice : Page
00020     {
00021         private MainPage rootPage = MainPage.Current;
00022
00023         private DeviceWatcherHelper deviceWatcherHelper;
00024
00025         private ObservableCollection<DeviceInformationDisplay> resultCollection = new ObservableCollection<DeviceInformationDisplay>();
00026
00027         public Scenario8_PairDevice()
00028         {
00029             this.InitializeComponent();
00030
00031             deviceWatcherHelper = new DeviceWatcherHelper(resultCollection, Dispatcher);
00032             deviceWatcherHelper.DeviceChanged += OnDeviceListChanged;
00033         }
00034
00035         protected override void OnNavigatedTo(NavigationEventArgs e)
00036         {
00037             resultsListView.ItemsSource = resultCollection;
00038
00039             selectorComboBox.ItemsSource = DeviceSelectorChoices.PairingSelectors;
00040             selectorComboBox.SelectedIndex = 0;
00041         }
00042
00043         protected override void OnNavigatedFrom(NavigationEventArgs e)
00044         {
00045             deviceWatcherHelper.Reset();
00046         }
00047
00048         private void StartWatcherButton_Click(object sender, RoutedEventArgs e)
00049         {
00050             StartWatcher();
00051         }
00052
00053         private void StopWatcherButton_Click(object sender, RoutedEventArgs e)
00054         {
00055             StopWatcher();
00056         }
00057
00058         private void StartWatcher()
00059         {
00060             startWatcherButton.IsEnabled = false;
00061             resultCollection.Clear();
00062
00063             // Get the device selector chosen by the UI then add additional constraints for devices that
00064             // can be paired or are already paired.
00065             DeviceSelectorInfo deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;
00066             string selector = "(" + deviceSelectorInfo.Selector + ")" + " AND (System.Devices.Aep.CanPair:=System.StructuredQueryType.Boolean#True OR System.Devices.Aep.IsPaired:=System.StructuredQueryType.Boolean#True)";
00067
00068             DeviceWatcher deviceWatcher;
00069             if (deviceSelectorInfo.Kind == DeviceInformationKind.Unknown)
00070             {
00071                 // Kind will be determined by the selector
00072                 deviceWatcher = DeviceInformation.CreateWatcher(
00073                     selector,
00074                     null // don't request additional properties for this sample
00075                     );
00076             }
00077             else
00078             {
00079                 // Kind is specified in the selector info
00080                 deviceWatcher = DeviceInformation.CreateWatcher(
00081                     selector,
00082                     null, // don't request additional properties for this sample
00083                     deviceSelectorInfo.Kind);
00084             }
00085
00086             rootPage.NotifyUser("Starting Watcher...", NotifyType.StatusMessage);
00087             deviceWatcherHelper.StartWatcher(deviceWatcher);
00088             stopWatcherButton.IsEnabled = true;
00089         }
00090
00091         private void StopWatcher()
00092         {
00093             stopWatcherButton.IsEnabled = false;
00094
00095             deviceWatcherHelper.StopWatcher();
00096
00097             startWatcherButton.IsEnabled = true;
00098         }
00099
00100         private void OnDeviceListChanged(DeviceWatcher sender, string id)
00101         {
00102             // If the item being updated is currently "selected", then update the pairing buttons
00103             DeviceInformationDisplay selectedDeviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
00104             if ((selectedDeviceInfoDisp != null) && (selectedDeviceInfoDisp.Id == id))
00105             {
00106                 UpdatePairingButtons();
00107             }
00108         }
00109
00110         private async void PairButton_Click(object sender, RoutedEventArgs e)
00111         {
00112             // Gray out the pair button and results view while pairing is in progress.
00113             resultsListView.IsEnabled = false;
00114             pairButton.IsEnabled = false;
00115             rootPage.NotifyUser("Pairing started. Please wait...", NotifyType.StatusMessage);
00116
00117             DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;
00118
00119             DevicePairingResult dpr = await deviceInfoDisp.DeviceInformation.Pairing.PairAsync();
00120
00121             rootPage.NotifyUser(
00122                 "Pairing result = " + dpr.Status.ToString(),
00123                 dpr.Status == DevicePairingResultStatus.Paired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);
00124
00125             UpdatePairingButtons();
00126             resultsListView.IsEnabled = true;
00127         }
00128
00129         private async void UnpairButton_Click(object sender, RoutedEventArgs e)
00130         {
00131             // Gray out the unpair button and results view while unpairing is in progress.
00132             resultsListView.IsEnabled = false;
00133             unpairButton.IsEnabled = false;
00134             rootPage.NotifyUser("Unpairing started. Please wait...", NotifyType.StatusMessage);
00135
00136             DeviceInformationDisplay deviceInfoDisp = resultsListView.SelectedItem as DeviceInformationDisplay;
00137
00138             DeviceUnpairingResult dupr = await deviceInfoDisp.DeviceInformation.Pairing.UnpairAsync();
00139
00140             rootPage.NotifyUser(
00141                 "Unpairing result = " + dupr.Status.ToString(),
00142                 dupr.Status == DeviceUnpairingResultStatus.Unpaired ? NotifyType.StatusMessage : NotifyType.ErrorMessage);
00143
00144             UpdatePairingButtons();
00145             resultsListView.IsEnabled = true;
00146         }
00147
00148         private void ResultsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
00149         {
00150             UpdatePairingButtons();
00151         }
00152
00153         private void UpdatePairingButtons()
00154         {
00155             DeviceInformationDisplay deviceInfoDisp = (DeviceInformationDisplay)resultsListView.SelectedItem;
00156
00157             if (null != deviceInfoDisp &&
00158                 deviceInfoDisp.DeviceInformation.Pairing.CanPair &&
00159                 !deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
00160             {
00161                 pairButton.IsEnabled = true;
00162             }
00163             else
00164             {
00165                 pairButton.IsEnabled = false;
00166             }
00167
00168             if (null != deviceInfoDisp &&
00169                 deviceInfoDisp.DeviceInformation.Pairing.IsPaired)
00170             {
00171                 unpairButton.IsEnabled = true;
00172             }
00173             else
00174             {
00175                 unpairButton.IsEnabled = false;
00176             }
00177         }
00178     }
00179 }
Generated on Fri Nov 15 2024 22:19:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Scenario4_FilePMgr.xaml.cs Source File

  • EnterpriseDataProtection
  • cs

Scenario4_FilePMgr.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Storage;
00014 using Windows.Storage.Streams;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018 using Windows.Security.EnterpriseData;
00019 using Windows.Storage.Pickers;
00020 using System.Threading.Tasks;
00021 using SDKTemplate;
00022
00023 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00024
00025 namespace EdpSample
00026 {
00027     /// <summary>
00028     /// An empty page that can be used on its own or navigated to within a Frame.
00029     /// </summary>
00030     public sealed partial class Scenario4 : Page
00031     {
00032         private MainPage rootPage;
00033         private string m_protectScenarioDesc = "App is an enterprise enlightened app.When it retrieves enterprise data in a file, it must protect the file " +
00034                                              "that contains said data.It does so by protecting the file to an enterprise identity. After this, the app " +
00035                                              "can use standard APIs to read or write from the file.The app generally gets the enterprise identity from an " +
00036                                              "external resource such as a mailbox";
00037         private string m_getProtectScenarioDesc = "\n\nAn app has attempted to access a resource that it previously protected. It is denied access and wants to "  +
00038                                                   "check the status of the file to see what went wrong.The app calls the GetProtectionInfoAsync API to query the status.";
00039         private string m_isRoamableScenarioDesc =  "\n\nAn app wants to roam its protected file to other devices.In order to do so, it must check if the file’s protection " +
00040                                                   "can be roamed.The app calls GetProtectionInfoAsync on the file to retrieve this information.";
00041         private string m_copyProtectionScenarioDesc = "\n\nAn app wants to create multiple copies of a protected file in which enterprise data is stored.It can use the CopyProtectionAsync" +
00042                                                       "API to replicate protection from one file to another.";
00043
00044         private StorageFile m_file = null;
00045         private string m_FileCopyName =  "Edpcopy.txt";
00046
00047         public Scenario4()
00048         {
00049             this.InitializeComponent();
00050         }
00051
00052         protected override void OnNavigatedTo(NavigationEventArgs e)
00053         {
00054             ScenarioText.Text = m_protectScenarioDesc + m_getProtectScenarioDesc +
00055                                m_isRoamableScenarioDesc + m_copyProtectionScenarioDesc;
00056             rootPage = MainPage.Current;
00057         }
00058
00059         private async void FilePickerBt_Click(object sender, RoutedEventArgs e)
00060         {
00061             string outputStr = "";
00062
00063             FileOpenPicker openPicker = new FileOpenPicker();
00064             openPicker.ViewMode = PickerViewMode.Thumbnail;
00065             openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
00066             openPicker.FileTypeFilter.Add("*");
00067             m_file = await openPicker.PickSingleFileAsync();
00068             if (m_file != null)
00069             {
00070                 // Application now has read/write access to the picked file
00071                 outputStr += "\nPicked file: " + m_file.Path;
00072                 rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00073             }
00074             else
00075             {
00076                 outputStr += "\nPlease pick a file";
00077                 rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
00078             }
00079         }
00080
00081         private async void CreateFileAndProtect()
00082         {
00083             string outputStr = "";
00084
00085             FileProtectionInfo procInfo =  await FileProtectionManager.GetProtectionInfoAsync(m_file);
00086             if (procInfo.Status != FileProtectionStatus.Protected)
00087             {
00088                 outputStr += "\nProtecting File: ";
00089                 await FileProtectionManager.ProtectAsync(m_file, Scenario1.m_enterpriseId);
00090                 procInfo =  await FileProtectionManager.GetProtectionInfoAsync(m_file);
00091                 outputStr += "\nProtected File: " + m_file.Path + "Status:" + procInfo.Status;
00092             }
00093             else
00094             {
00095                 outputStr += "\nFile protection status is: " + procInfo.Status;
00096             }
00097
00098             rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00099         }
00100
00101         public async void CopyProtectionAsync()
00102         {
00103             if (m_file != null)
00104             {
00105                 StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00106                 StorageFile destFile = await localFolder.CreateFileAsync(m_FileCopyName, CreationCollisionOption.OpenIfExists);
00107
00108                 if (destFile != null)
00109                 {
00110                     await destFile.DeleteAsync();
00111                 }
00112
00113                 // Recreate file
00114                 destFile = await localFolder.CreateFileAsync(m_FileCopyName, CreationCollisionOption.ReplaceExisting);
00115
00116                 string outputStr = "Copying protection from source: " + m_file.Path + "\nTo destination: " + destFile.Path;
00117                 bool result = await FileProtectionManager.CopyProtectionAsync(m_file, destFile);
00118                 if (!result)
00119                 {
00120                     rootPage.NotifyUser(outputStr + " Copy protection Failed", NotifyType.ErrorMessage);
00121                 }
00122                 else
00123                 {
00124                     FileProtectionInfo sourceInfo = await FileProtectionManager.GetProtectionInfoAsync(m_file);
00125                     FileProtectionInfo destInfo = await FileProtectionManager.GetProtectionInfoAsync(destFile);
00126                     if (sourceInfo.Status != destInfo.Status)
00127                     {
00128                         outputStr += "\nsource and destination don't have same protection source status:" +
00129                                             sourceInfo.Status + " Destination status:" + destInfo.Status;
00130                         rootPage.NotifyUser(outputStr, NotifyType.ErrorMessage);
00131                     }
00132                     else
00133                     {
00134                         outputStr += "\nCopying protection succeeded";
00135                         rootPage.NotifyUser(outputStr, NotifyType.StatusMessage);
00136                     }
00137                 }
00138             }
00139             else
00140             {
00141                 rootPage.NotifyUser("Please pick a source file", NotifyType.ErrorMessage);
00142             }
00143         }
00144
00145         public async Task<string> GetFileStatusStringAsync()
00146         {
00147             string outputStr = "";
00148
00149             FileProtectionInfo protectionInfo = await FileProtectionManager.GetProtectionInfoAsync(m_file);
00150             if (protectionInfo.Status == FileProtectionStatus.Revoked)
00151             {
00152                 outputStr += "\nFile " + m_file.Path + " is revoked";
00153             }
00154             else
00155             {
00156                 outputStr += "\nFile protection status of: " + m_file.Path + " is " + protectionInfo.Status;
00157             }
00158
00159             if (protectionInfo.IsRoamable)
00160             {
00161                 outputStr += "\nFile " + m_file.Path + " is roamable";
00162             }
00163             else
00164             {
00165                 outputStr += "\nFile " + m_file.Path + " is not roamable";
00166             }
00167
00168             return outputStr;
00169         }
00170
00171         private async void ProtectAsyncFileStatus_Click(object sender, RoutedEventArgs e)
00172         {
00173             if (m_file != null)
00174             {
00175                 rootPage.NotifyUser(await GetFileStatusStringAsync(), NotifyType.StatusMessage);
00176             }
00177             else
00178             {
00179                 rootPage.NotifyUser("Please pick a file", NotifyType.ErrorMessage);
00180             }
00181         }
00182
00183         private void ProtectAsyncFile_Click(object sender, RoutedEventArgs e)
00184         {
00185             if (m_file != null)
00186             {
00187                 CreateFileAndProtect();
00188             }
00189             else
00190             {
00191                 rootPage.NotifyUser("Please pick a file", NotifyType.ErrorMessage);
00192             }
00193         }
00194
00195         private void CopyProtectionAsync_Click(object sender, RoutedEventArgs e)
00196         {
00197             CopyProtectionAsync();
00198         }
00199     }
00200 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/MasterDetailPage.xaml.cs Source File

  • XamlMasterDetail
  • cs

MasterDetailPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using MasterDetailApp.Data;
00002 using MasterDetailApp.ViewModels;
00003 using System;
00004 using System.Collections.Generic;
00005 using System.Diagnostics;
00006 using System.IO;
00007 using System.Linq;
00008 using System.Runtime.InteropServices.WindowsRuntime;
00009 using Windows.Foundation;
00010 using Windows.Foundation.Collections;
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Controls.Primitives;
00014 using Windows.UI.Xaml.Data;
00015 using Windows.UI.Xaml.Input;
00016 using Windows.UI.Xaml.Media;
00017 using Windows.UI.Xaml.Media.Animation;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace MasterDetailApp
00021 {
00022     public sealed partial class MasterDetailPage : Page
00023     {
00024         private ItemViewModel _lastSelectedItem;
00025
00026         public MasterDetailPage()
00027         {
00028             this.InitializeComponent();
00029         }
00030
00031         protected override void OnNavigatedTo(NavigationEventArgs e)
00032         {
00033             base.OnNavigatedTo(e);
00034
00035             var items = MasterListView.ItemsSource as List<ItemViewModel>;
00036
00037             if (items == null)
00038             {
00039                 items = new List<ItemViewModel>();
00040
00041                 foreach (var item in ItemsDataSource.GetAllItems())
00042                 {
00043                     items.Add(ItemViewModel.FromItem(item));
00044                 }
00045
00046                 MasterListView.ItemsSource = items;
00047             }
00048
00049             if (e.Parameter != null)
00050             {
00051                 // Parameter is item ID
00052                 var id = (int)e.Parameter;
00053                 _lastSelectedItem =
00054                     items.Where((item) => item.ItemId == id).FirstOrDefault();
00055             }
00056             else
00057             {
00058                 _lastSelectedItem = null;
00059             }
00060
00061             UpdateForVisualState(AdaptiveStates.CurrentState);
00062
00063             // Don't play a content transition for first item load.
00064             // Sometimes, this content will be animated as part of the page transition.
00065             DisableContentTransitions();
00066         }
00067
00068         private void AdaptiveStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
00069         {
00070             UpdateForVisualState(e.NewState, e.OldState);
00071         }
00072
00073         private void UpdateForVisualState(VisualState newState, VisualState oldState = null)
00074         {
00075             var isNarrow = newState == NarrowState;
00076
00077             if (isNarrow && oldState == DefaultState && _lastSelectedItem != null)
00078             {
00079                 // Resize down to the detail item. Don't play a transition.
00080                 Frame.Navigate(typeof(DetailPage), _lastSelectedItem.ItemId, new SuppressNavigationTransitionInfo());
00081             }
00082
00083             EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow);
00084             if (DetailContentPresenter != null)
00085             {
00086                 EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow);
00087             }
00088         }
00089
00090         private void MasterListView_ItemClick(object sender, ItemClickEventArgs e)
00091         {
00092             var clickedItem = (ItemViewModel)e.ClickedItem;
00093             _lastSelectedItem = clickedItem;
00094
00095             if (AdaptiveStates.CurrentState == NarrowState)
00096             {
00097                 // Use "drill in" transition for navigating from master list to detail view
00098                 Frame.Navigate(typeof(DetailPage), clickedItem.ItemId, new DrillInNavigationTransitionInfo());
00099             }
00100             else
00101             {
00102                 // Play a refresh animation when the user switches detail items.
00103                 EnableContentTransitions();
00104             }
00105         }
00106
00107         private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
00108         {
00109             // Assure we are displaying the correct item. This is necessary in certain adaptive cases.
00110             MasterListView.SelectedItem = _lastSelectedItem;
00111         }
00112
00113         private void EnableContentTransitions()
00114         {
00115             DetailContentPresenter.ContentTransitions.Clear();
00116             DetailContentPresenter.ContentTransitions.Add(new EntranceThemeTransition());
00117         }
00118
00119         private void DisableContentTransitions()
00120         {
00121             if (DetailContentPresenter != null)
00122             {
00123                 DetailContentPresenter.ContentTransitions.Clear();
00124             }
00125         }
00126     }
00127 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario_ContinuousRecognitionSRGSGrammar Member List

This is the complete list of members for Scenario_ContinuousRecognitionSRGSGrammar, including all inherited members.
cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
colorLookup | Scenario_ContinuousRecognitionSRGSGrammar | [private]
ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
ContinuousRecognize_Click(object sender, RoutedEventArgs e) | Scenario_ContinuousRecognitionSRGSGrammar | [inline]
getColor(string colorString) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
HandleRecognitionResult(SpeechRecognitionResult recoResult) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
HResultRecognizerNotFound | Scenario_ContinuousRecognitionSRGSGrammar | [private, static]
InitializeRecognizer(Language recognizerLanguage) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
isPopulatingLanguages | Scenario_ContinuousRecognitionSRGSGrammar | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, protected]
PopulateLanguageDropdown() | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
rootPage | Scenario_ContinuousRecognitionSRGSGrammar | [private]
Scenario_ContinuousRecognitionSRGSGrammar() | Scenario_ContinuousRecognitionSRGSGrammar | [inline]
speechContext | Scenario_ContinuousRecognitionSRGSGrammar | [private]
speechRecognizer | Scenario_ContinuousRecognitionSRGSGrammar | [private]
SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) | Scenario_ContinuousRecognitionSRGSGrammar | [inline, private]
speechResourceMap | Scenario_ContinuousRecognitionSRGSGrammar | [private]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/SampleConfiguration.h Source File

  • TitleBar
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     struct SampleState
00018     {
00019         static void AreControlsInTitleBar(bool value);
00020         static bool AreControlsInTitleBar() { return areControlsInTitleBar; }
00021         static void AddCustomTitleBar();
00022         static void RemoveCustomTitleBar();
00023
00024     private:
00025         static bool areControlsInTitleBar;
00026         static CustomTitleBar customTitleBar;
00027     };
00028 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripViewModel.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

TripViewModel.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "TripViewModel.h"
00013 #include "Common\RelayCommand.h"
00014 #include "View\TripListView.xaml.h"
00015
00016 using namespace AdventureWorks;
00017
00018 using namespace Concurrency;
00019 using namespace AdventureWorks_Shared;
00020 using namespace Platform;
00021 using namespace Platform::Collections;
00022 using namespace Windows::ApplicationModel::VoiceCommands;
00023 using namespace Windows::Globalization;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Input;
00027
00028 /// <summary> Handle initialization of command data binding </summary>
00029 TripViewModel::TripViewModel(TripStore^ store)
00030 {
00031     this->store = store;
00032     saveTripCommand = ref new RelayCommand(
00033         [this](Object^ parameter) {return true; },
00034         [this](Object^ parameter) {this->SaveTrip(); });
00035
00036     deleteTripCommand = ref new RelayCommand(
00037         [this](Object^ parameter) {return true; },
00038         [this](Object^ parameter) {this->DeleteTrip(); });
00039
00040 }
00041
00042 AdventureWorks_Shared::Trip^ TripViewModel::Trip::get()
00043 {
00044     return this->trip;
00045 }
00046
00047 void TripViewModel::Trip::set(AdventureWorks_Shared::Trip^ value)
00048 {
00049     this->trip = value;
00050     NotifyPropertyChanged("Trip");
00051 }
00052
00053 String^ TripViewModel::DestinationValidationError::get()
00054 {
00055     return this->destinationValidationError;
00056 }
00057
00058 void TripViewModel::setDestinationValidation(String^ value)
00059 {
00060     this->destinationValidationError = value;
00061     NotifyPropertyChanged("DestinationValidationError");
00062 }
00063
00064 bool TripViewModel::ShowDestinationValidation::get()
00065 {
00066     return this->showDestinationValidation;
00067 }
00068
00069 void TripViewModel::setShowDestinationValidation(bool value)
00070 {
00071     this->showDestinationValidation = value;
00072     NotifyPropertyChanged("ShowDestinationValidation");
00073 }
00074
00075 bool TripViewModel::ShowDelete::get()
00076 {
00077     return this->showDelete;
00078 }
00079
00080 void TripViewModel::setShowDelete(bool value)
00081 {
00082     this->showDelete = value;
00083     NotifyPropertyChanged("ShowDelete");
00084 }
00085
00086 ICommand^ TripViewModel::SaveTripCommand::get()
00087 {
00088     return this->saveTripCommand;
00089 }
00090
00091 ICommand^ TripViewModel::DeleteTripCommand::get()
00092 {
00093     return this->deleteTripCommand;
00094 }
00095
00096 /// <summary>
00097 /// Load trip data (if required), and then search the store for the specified trip.
00098 /// Does not disambiguate, just displays the first match, for simplicity in this sample.
00099 /// Navigates back to the main page if it can't be found (covers the case where a trip was removed
00100 /// but the phrase list was not updated.)
00101 /// <summary>
00102 /// <param name="destination">The destination to search for</param>
00103 void TripViewModel::LoadTripFromStore(String^ destination)
00104 {
00105     create_task(store->LoadTripsAsync()).then([this, destination]() {
00106
00107         for (unsigned int i = 0; i < store->Trips->Size; i++)
00108         {
00109             AdventureWorks_Shared::Trip^ t = store->Trips->GetAt(i);
00110             if (t->Destination == destination)
00111             {
00112                 this->ShowTrip(t);
00113                 return;
00114             }
00115         }
00116
00117         String^ errorMsg = ref new String(L"Sorry, couldn't find a trip with Destination ") + destination;
00118         auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00119         rootFrame->Navigate(TripListView::typeid, errorMsg);
00120     });
00121 }
00122
00123 /// <summary>Set the data-bound trip (and show delete button)</summary>
00124 /// <param name="trip">The trip to show</param>
00125 void TripViewModel::ShowTrip(AdventureWorks_Shared::Trip^ trip)
00126 {
00127     setShowDelete(true);
00128     this->Trip = trip;
00129 }
00130
00131 /// <summary>Create a new trip, hide the delete button.</summary>
00132 void TripViewModel::NewTrip()
00133 {
00134     setShowDelete(false);
00135     Trip = ref new AdventureWorks_Shared::Trip();
00136 }
00137
00138 ///<summary> Delete the currently displayed trip from the trip store,
00139 /// trigger update of phrase list.</summary>
00140 void TripViewModel::DeleteTrip()
00141 {
00142     store->DeleteTripAsync(this->Trip);
00143
00144     this->UpdateDestinationPhraseList();
00145     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00146     rootFrame->Navigate(TripListView::typeid);
00147
00148 }
00149
00150 /// <summary> Update the phrase list, issued on initial startup of the app, and
00151 /// whenever a trip is modified and saved.</summary>
00152 void TripViewModel::UpdateDestinationPhraseList()
00153 {
00154     VoiceCommandDefinition^ commandDefinitions;
00155   auto languages = Windows::Globalization::ApplicationLanguages::Languages;
00156   String^ countryCode = L"en-US";
00157   if (languages->Size > 0)
00158   {
00159     // Languages is ordered by the preference order that's specified in settings.
00160     countryCode = languages->GetAt(0);
00161   }
00162
00163     if (VoiceCommandDefinitionManager::InstalledCommandDefinitions->HasKey(L"AdventureWorksCommandSet_" + countryCode))
00164     {
00165         commandDefinitions = VoiceCommandDefinitionManager::InstalledCommandDefinitions->Lookup(L"AdventureWorksCommandSet_" + countryCode);
00166
00167         Vector<String^>^ destinations = ref new Vector<String^>();
00168         int size = this->store->Trips->Size;
00169         for (int i = 0; i < size; i++)
00170         {
00171             AdventureWorks_Shared::Trip^ t = this->store->Trips->GetAt(i);
00172             String^ destination = t->Destination;
00173             unsigned int unused;
00174             if (!destinations->IndexOf(destination, &unused))
00175             {
00176                 destinations->Append(destination);
00177             }
00178         }
00179
00180         create_task(commandDefinitions->SetPhraseListAsync(L"destination", destinations))
00181             .then([](Concurrency::task<void> t) {
00182             try
00183             {
00184                 t.get();
00185             }
00186             catch (Platform::Exception^ ex)
00187             {
00188                 OutputDebugStringW(L"Failed to install phrase set into AdventureWorksCommandSet_en-us\n");
00189                 OutputDebugStringW(ex->Message->Data());
00190             }
00191         });
00192     }
00193 }
00194
00195 /// <summary> Save a trip to the store, trigger an update of the phrase list,
00196 /// then navigate back to the main page </summary>
00197 void TripViewModel::SaveTrip()
00198 {
00199     setShowDestinationValidation(false);
00200     bool valid = true;
00201
00202     if ((Trip->Destination->IsEmpty()))
00203     {
00204         valid = false;
00205         setShowDestinationValidation(true);
00206         setDestinationValidation(L"Destination cannot be blank");
00207     }
00208
00209     if (valid)
00210     {
00211         create_task(store->SaveTripAsync(this->Trip), task_continuation_context::use_current()).then(
00212             [this](task<void> saveTripTask)
00213         {
00214             saveTripTask.get();
00215             this->UpdateDestinationPhraseList();
00216             auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00217             rootFrame->Navigate(TripListView::typeid);
00218         });
00219     }
00220 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PlayReady/cs/ViewModels/SecureStopViewModel.cs Source File

  • PlayReady
  • cs
  • ViewModels

SecureStopViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate.Shared;
00013 using System;
00014 using System.Linq;
00015 using System.Net.Http;
00016 using System.Xml.Linq;
00017 using Windows.Media.Protection;
00018 using Windows.Media.Protection.PlayReady;
00019 using Windows.Storage;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Media;
00022
00023 namespace SDKTemplate.ViewModels
00024 {
00025     public class SecureStopViewModel : ViewModelBase
00026     {
00027         private string moviePath = SDKTemplate.MainPage.SampleMovieURL;
00028         private string licenseUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx?SecureStop=1&UseSimpleNonPersistentLicense=1&RealTimeExpiration=1&FirstPlayExpiration=300";
00029
00030         private string secureStopServiceUrl = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx";
00031
00032         // publisherID and cert used by the test license service
00033         private string publisherID = "xw6TjIuUUmvdCcl00t4RBA==";
00034         private byte[] publisherCert;
00035
00036         public RelayCommand CmdPlayMovie { get; private set; }
00037         public RelayCommand CmdStopMovie { get; private set; }
00038         public RelayCommand CmdGetPublisherCert { get; private set; }
00039         public RelayCommand CmdRenewLicense { get; private set; }
00040
00041         public PlayReadyInfoViewModel PlayReadyInfo { get; private set; }
00042         // The PlayReadyLicenseSession instance needs to be in scope until playback has completed.
00043         // To handle this the following instance is maintained.
00044         public PlayReadyLicenseSession licenseSession { get; private set; }
00045         // The ContentHeader for the actively playing asset is tracked to support
00046         //
00047         public PlayReadyContentHeader activePlayReadyHeader { get; private set; }
00048
00049         /// <summary>
00050         /// A view model class for the IndivReactive Scenario.
00051         /// </summary>
00052         public SecureStopViewModel(MediaElement mediaElement)
00053         {
00054             this.ProtectionManager = PlayReadyHelpers.InitializeProtectionManager(ServiceRequested);
00055             mediaElement.ProtectionManager = this.ProtectionManager;
00056
00057             licenseSession = PlayReadyHelpers.createLicenseSession();
00058             licenseSession.ConfigureMediaProtectionManager(mediaElement.ProtectionManager);
00059
00060             PlayReadyInfo = new PlayReadyInfoViewModel();
00061             PlayReadyInfo.RefreshStatics();
00062
00063             CmdPlayMovie = new RelayCommand(
00064                                     () => { mediaElement.Source = new Uri(moviePath); SetPlaybackEnabled(true); },
00065                                     () => publisherCert != null);
00066
00067             CmdStopMovie = new RelayCommand(() => { mediaElement.Stop();},
00068                                             () => publisherCert != null);
00069
00070             CmdGetPublisherCert = new RelayCommand(() =>
00071                                             {
00072                                                 GetPublisherCert(publisherID, (cert) =>
00073                                                 {
00074                                                     CmdPlayMovie.RaiseCanExecuteChanged();
00075                                                     CmdStopMovie.RaiseCanExecuteChanged();
00076                                                     CmdRenewLicense.RaiseCanExecuteChanged();
00077                                                 });
00078                                             });
00079
00080             CmdRenewLicense = new RelayCommand(() => RenewActiveLicense(),
00081                                                () => publisherCert != null);
00082
00083             mediaElement.CurrentStateChanged += (s, a) =>
00084             {
00085                 ViewModelBase.Log("Media State::" + mediaElement.CurrentState);
00086
00087                 switch (mediaElement.CurrentState)
00088                 {
00089                     case MediaElementState.Closed:
00090                         SendSecureStopRecords();
00091                         activePlayReadyHeader = null;
00092                         SetPlaybackEnabled(false);
00093                         // renewing the licenseSession for subsequent Plays since the
00094                         // session is stopped
00095                         licenseSession = PlayReadyHelpers.createLicenseSession();
00096                         licenseSession.ConfigureMediaProtectionManager(mediaElement.ProtectionManager);
00097                         break;
00098                     default:
00099                         break;
00100                 }
00101
00102             };
00103
00104             mediaElement.MediaFailed += (s, a) =>
00105             {
00106                 ViewModelBase.Log("Err::" + a.ErrorMessage);
00107             };
00108
00109             var localSettings = ApplicationData.Current.LocalSettings;
00110             ApplicationDataContainer container;
00111             localSettings.Containers.TryGetValue("PublisherCerts", out container);
00112             if (container != null && container.Values.ContainsKey(publisherID))
00113             {
00114                 publisherCert = (byte[])container.Values[publisherID];
00115             }
00116
00117             try
00118             {
00119                 var securityVersion = PlayReadyStatics.PlayReadySecurityVersion;
00120                 SendSecureStopRecords();
00121             }
00122             catch {
00123                 PlayReadyHelpers.ProactiveIndividualization(() =>
00124                 {
00125                     PlayReadyInfo.RefreshStatics();
00126                 });
00127             }
00128         }
00129
00130         private async void SendSecureStopRecords()
00131         {
00132             if (publisherCert == null) { return; }
00133
00134             //// The following code will send all secure stop sessions at once
00135             var secureStopRequest = new PlayReadySecureStopServiceRequest(publisherCert);
00136             // setting the uri is optional. the uri defaults to whats in the cert
00137             try
00138             {
00139                 secureStopRequest.Uri = new Uri(secureStopServiceUrl);
00140                 await secureStopRequest.BeginServiceRequest();
00141             }
00142             catch (Exception e)
00143             {
00144
00145                 ViewModelBase.Log(e.Message);
00146             }
00147
00148
00149             // The following code can be used to iterate the secure stop sessions
00150             // which can be then be processed individually
00151             //PlayReadySecureStopIterable secureStopIterable = new PlayReadySecureStopIterable(publisherCert);
00152             //foreach (var secureStopReq in secureStopIterable)
00153             //{
00154             //    secureStopReq.Uri = new Uri(secureStopServiceUrl);
00155             //    await secureStopReq.BeginServiceRequest();
00156             //}
00157         }
00158
00159         //...
00160         MediaProtectionServiceCompletion serviceCompletionNotifier = null;
00161         void ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent)
00162         {
00163             serviceCompletionNotifier = srEvent.Completion;
00164             IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request;
00165             ViewModelBase.Log(serviceRequest.GetType().Name);
00166             ProcessServiceRequest(serviceRequest);
00167         }
00168
00169         /// <summary>
00170         /// ...
00171         /// </summary>
00172         void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
00173         {
00174             //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
00175             if (serviceRequest is PlayReadyIndividualizationServiceRequest)
00176             {
00177                 PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
00178                 PlayReadyInfo.RefreshStatics();
00179             }
00180             else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
00181             {
00182                 var licenseServiceRequestNotUsed = (serviceRequest as PlayReadyLicenseAcquisitionServiceRequest);
00183                 activePlayReadyHeader = licenseServiceRequestNotUsed.ContentHeader;
00184
00185                 var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
00186                 licenseServiceRequest.ContentHeader = activePlayReadyHeader;
00187                 licenseServiceRequest.Uri = new Uri(licenseUrl);
00188                 PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, serviceCompletionNotifier);
00189             }
00190         }
00191
00192         void RenewActiveLicense()
00193         {
00194             if (activePlayReadyHeader != null)
00195             {
00196                 var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
00197                 licenseServiceRequest.ContentHeader = activePlayReadyHeader;
00198                 licenseServiceRequest.Uri = new Uri(licenseUrl);
00199                 PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, null);
00200             }
00201         }
00202
00203         private async void GetPublisherCert(string publisherID, Action<byte[]> callback)
00204         {
00205             var localSettings = ApplicationData.Current.LocalSettings;
00206             if (!localSettings.Containers.ContainsKey("PublisherCerts"))
00207             {
00208                 localSettings.CreateContainer("PublisherCerts", Windows.Storage.ApplicationDataCreateDisposition.Always);
00209             }
00210
00211             if (!localSettings.Containers["PublisherCerts"].Values.ContainsKey(publisherID))
00212             {
00213                 var xDoc = XDocument.Load("Data/MeteringChallenge.xml");
00214                 XNamespace ns = "http://schemas.microsoft.com/DRM/2007/03/protocols";
00215                 xDoc.Descendants(ns + "MID").FirstOrDefault().Value = publisherID;
00216
00217                 var content = new StringContent(xDoc.ToString(), System.Text.Encoding.UTF8, "text/xml");
00218
00219                 var client = new HttpClient();
00220                 client.DefaultRequestHeaders.Add("SOAPAction", "http://schemas.microsoft.com/DRM/2007/03/protocols/GetMeteringCertificate");
00221                 var response = await client.PostAsync(secureStopServiceUrl, content);
00222
00223                 string soapXml = await response.Content.ReadAsStringAsync();
00224                 var xMeteringDoc = XDocument.Parse(soapXml);
00225
00226                 var base64Cert = xMeteringDoc.Descendants(ns + "MeterCert").FirstOrDefault().Value;
00227                 var cert = Convert.FromBase64String(base64Cert);
00228                 localSettings.Containers["PublisherCerts"].Values[publisherID] = cert;
00229             }
00230
00231             this.publisherCert = (byte [])localSettings.Containers["PublisherCerts"].Values[publisherID];
00232             callback(this.publisherCert);
00233         }
00234
00235         public string MoviePath
00236         {
00237             get
00238             {
00239                 return moviePath;
00240             }
00241             set
00242             {
00243                 if (moviePath != value)
00244                 {
00245                     moviePath = value;
00246                     RaisePropertyChanged();
00247                 }
00248             }
00249         }
00250
00251     }
00252 }
00253
00254
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/BasicTimer.cpp Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

BasicTimer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "BasicTimer.h"
00014
00015 BasicTimer::BasicTimer()
00016 {
00017     if (!QueryPerformanceFrequency(&m_frequency))
00018     {
00019         throw ref new Platform::FailureException();
00020     }
00021     Reset();
00022 }
00023
00024 void BasicTimer::Reset()
00025 {
00026     Update();
00027     m_startTime = m_currentTime;
00028     m_total = 0.0f;
00029     m_delta = 1.0f / 60.0f;
00030 }
00031
00032 void BasicTimer::Update()
00033 {
00034     if (!QueryPerformanceCounter(&m_currentTime))
00035     {
00036         throw ref new Platform::FailureException();
00037     }
00038
00039     m_total = static_cast<float>(
00040         static_cast<double>(m_currentTime.QuadPart-m_startTime.QuadPart) /
00041         static_cast<double>(m_frequency.QuadPart)
00042         );
00043
00044     if (m_lastTime.QuadPart == m_startTime.QuadPart)
00045     {
00046         // If the timer was just reset, report a time delta equivalent to 60Hz frame time.
00047         m_delta = 1.0f / 60.0f;
00048     }
00049     else
00050     {
00051         m_delta = static_cast<float>(
00052             static_cast<double>(m_currentTime.QuadPart-m_lastTime.QuadPart) /
00053             static_cast<double>(m_frequency.QuadPart)
00054             );
00055     }
00056
00057     m_lastTime = m_currentTime;
00058 }
00059
00060 float BasicTimer::Total::get()
00061 {
00062     return m_total;
00063 }
00064
00065 float BasicTimer::Delta::get()
00066 {
00067     return m_delta;
00068 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-SPI/cpp/pch.cpp Source File

  • IoT-SPI
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Include the standard header and generate the precompiled header.
00014 //
00015
00016 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/Project.idl Source File

  • TextSegmentation
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_ExtractTextSegments : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_ExtractTextSegments();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_GetCurrentTextSegmentFromIndex : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_GetCurrentTextSegmentFromIndex();
00024     }
00025 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/pch.h Source File

  • TitleBar
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "SampleConfiguration.h"
00011 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cs/Scenario4_InputOutputReports.xaml.cs Source File

  • CustomHidDeviceAccess
  • cs

Scenario4_InputOutputReports.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using System.Collections.Generic;
00009 using System.Globalization;
00010 using System.Threading.Tasks;
00011 using Windows.Storage.Streams;
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016
00017 namespace CustomHidDeviceAccess
00018 {
00019     /// <summary>
00020     /// This scenario demonstrates how to get input reports and how to send output reports
00021     /// </summary>
00022     public sealed partial class InputOutputReports : Page
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         private MainPage rootPage = MainPage.Current;
00027
00028         public InputOutputReports()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// Invoked when this page is about to be displayed in a Frame.
00035         ///
00036         /// We will enable/disable parts of the UI if the device doesn't support it.
00037         /// </summary>
00038         /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
00041         {
00042             // We will disable the scenario that is not supported by the device.
00043             // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00044             Dictionary<DeviceType, UIElement> deviceScenarios = new Dictionary<DeviceType, UIElement>();
00045             deviceScenarios.Add(DeviceType.SuperMutt, SuperMuttScenario);
00046
00047             Utilities.SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00048         }
00049
00050         private async void GetNumericInputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00051         {
00052             if (EventHandlerForDevice.Current.IsDeviceConnected)
00053             {
00054                 // Don't allow multiple reads at the same time
00055                 ButtonGetNumericInputReport.IsEnabled = false;
00056
00057                 await GetNumericInputReportAsync();
00058
00059                 ButtonGetNumericInputReport.IsEnabled = true;
00060             }
00061             else
00062             {
00063                 Utilities.NotifyDeviceNotConnected();
00064             }
00065         }
00066
00067         private async void SendNumericOutputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00068         {
00069             if (EventHandlerForDevice.Current.IsDeviceConnected)
00070             {
00071                 ButtonSendNumericOutputReport.IsEnabled = false;
00072
00073                 Byte valueToWrite = (Byte)NumericValueToWrite.SelectedIndex;
00074
00075                 await SendNumericOutputReportAsync(valueToWrite);
00076
00077                 ButtonSendNumericOutputReport.IsEnabled = true;
00078             }
00079             else
00080             {
00081                 Utilities.NotifyDeviceNotConnected();
00082             }
00083         }
00084
00085         private async void GetBooleanInputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00086         {
00087             if (EventHandlerForDevice.Current.IsDeviceConnected)
00088             {
00089                 // Don't allow multiple reads at the same time
00090                 ButtonGetBooleanInputReport.IsEnabled = false;
00091
00092                 // This sample will only demonstrate using the first button
00093                 await GetBooleanInputReportAsync(1);
00094
00095                 ButtonGetBooleanInputReport.IsEnabled = true;
00096             }
00097             else
00098             {
00099                 Utilities.NotifyDeviceNotConnected();
00100             }
00101         }
00102
00103         private async void SendBooleanOutputReport_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs eventArgs)
00104         {
00105             if (EventHandlerForDevice.Current.IsDeviceConnected)
00106             {
00107                 ButtonSendBooleanOutputReport.IsEnabled = false;
00108
00109                 Boolean valueToWrite = BooleanValueToWrite.SelectedIndex == 1 ? true : false;
00110
00111                 // We will only demonstrate modifying button 1
00112                 await SendBooleanOutputReportAsync(valueToWrite, 1);
00113
00114                 ButtonSendBooleanOutputReport.IsEnabled = true;
00115             }
00116             else
00117             {
00118                 Utilities.NotifyDeviceNotConnected();
00119             }
00120         }
00121
00122         /// <summary>
00123         /// Uses an input report to get the value that was previously written to the device with output report.
00124         ///
00125         /// We will be using controls to modify the data buffer. See SendNumericOutputReportAsync for how to modify the data buffer directly.
00126         ///
00127         /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00128         /// at the end of the task chain.
00129         /// </summary>
00130         /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00131         private async Task GetNumericInputReportAsync()
00132         {
00133             var inputReport = await EventHandlerForDevice.Current.Device.GetInputReportAsync(SuperMutt.ReadWriteBufferControlInformation.ReportId);
00134
00135             var inputReportControl = inputReport.GetNumericControl(SuperMutt.ReadWriteBufferControlInformation.VolumeUsagePage, SuperMutt.ReadWriteBufferControlInformation.VolumeUsageId);
00136
00137             var data = inputReportControl.Value;
00138
00139             rootPage.NotifyUser("Value read: " + data.ToString(), NotifyType.StatusMessage);
00140         }
00141
00142         /// <summary>
00143         /// Uses an output report to write data to the device so that it can be read back using input report.
00144         ///
00145         /// Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying
00146         /// data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing (
00147         /// all bits are zeroed out except for the bits we care about).
00148         ///
00149         /// We will modify the data buffer directly. See GetNumericInputReportAsync for how to use controls.
00150         ///
00151         /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00152         /// at the end of the task chain.
00153         /// </summary>
00154         /// <param name="valueToWrite"></param>
00155         /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00156         private async Task SendNumericOutputReportAsync(Byte valueToWrite)
00157         {
00158             var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.ReadWriteBufferControlInformation.ReportId);
00159
00160             Byte dataByte = (Byte)(valueToWrite << SuperMutt.ReadWriteBufferControlInformation.VolumeDataStartBit);
00161
00162             var dataWriter = new DataWriter();
00163
00164             // First byte is always the report id
00165             dataWriter.WriteByte((Byte)outputReport.Id);
00166             dataWriter.WriteByte(dataByte);
00167
00168             outputReport.Data = dataWriter.DetachBuffer();
00169
00170             uint bytesWritten = await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
00171
00172             rootPage.NotifyUser("Value written: " + valueToWrite, NotifyType.StatusMessage);
00173         }
00174
00175         /// <summary>
00176         /// Uses an input report to get the value that was previously written to the device with output report.
00177         ///
00178         /// We will be using controls to modify the data buffer. See SendBooleanOutputReportAsync for how to modify the data buffer directly.
00179         ///
00180         /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00181         /// at the end of the task chain.
00182         /// </summary>
00183         /// <param name="buttonNumber">Button to get the value of (1-4)</param>
00184         /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00185         private async Task GetBooleanInputReportAsync(Byte buttonNumber)
00186         {
00187             var inputReport = await EventHandlerForDevice.Current.Device.GetInputReportAsync(SuperMutt.ReadWriteBufferControlInformation.ReportId);
00188
00189             // Use the first button
00190             var inputReportControl = inputReport.GetBooleanControl(SuperMutt.ReadWriteBufferControlInformation.ButtonUsagePage, SuperMutt.ReadWriteBufferControlInformation.ButtonUsageId[buttonNumber - 1]);
00191
00192             var value = inputReportControl.IsActive ? "1" : "0";
00193
00194             rootPage.NotifyUser("Bit value: " + value, NotifyType.StatusMessage);
00195         }
00196
00197         /// <summary>
00198         /// Uses an output report to write data to the device so that it can be read back using input report.
00199         ///
00200         /// Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying
00201         /// data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing (
00202         /// all bits are zeroed out except for the bits we care about).
00203         ///
00204         /// We will modify the data buffer directly. See GetBooleanInputReportAsync for how to use controls.
00205         ///
00206         /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00207         /// at the end of the task chain.
00208         /// </summary>
00209         /// <param name="bitValue"></param>
00210         /// <param name="buttonNumber">Button to change value of (1-4)</param>
00211         /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00212         private async Task SendBooleanOutputReportAsync(Boolean bitValue, Byte buttonNumber)
00213         {
00214             var buttonIndex = buttonNumber - 1;
00215
00216             var outputReport = EventHandlerForDevice.Current.Device.CreateOutputReport(SuperMutt.ReadWriteBufferControlInformation.ReportId);
00217
00218             Byte byteToMask = (Byte)(bitValue ? 0xFF : 0x00);
00219             Byte dataByte = (Byte)(byteToMask & SuperMutt.ReadWriteBufferControlInformation.ButtonDataMask[buttonIndex]);
00220
00221             var dataWriter = new DataWriter();
00222
00223             // First byte is always the report id
00224             dataWriter.WriteByte((Byte)outputReport.Id);
00225             dataWriter.WriteByte(dataByte);
00226
00227             outputReport.Data = dataWriter.DetachBuffer();
00228
00229             UInt32 bytesWritten = await EventHandlerForDevice.Current.Device.SendOutputReportAsync(outputReport);
00230
00231             var valueWritten = bitValue ? "1" : "0";
00232             rootPage.NotifyUser("Bit value written: " + valueWritten, NotifyType.StatusMessage);
00233         }
00234     }
00235 }
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCloudFontIntegration/cpp/Scenario_Document1.xaml.cpp Source File

  • XamlCloudFontIntegration
  • cpp

Scenario_Document1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_Document1.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028
00029 Scenario_Document1::Scenario_Document1()
00030 {
00031     InitializeComponent();
00032 }
00033
00034
00035 void Scenario_Document1::Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00036 {
00037     // Font formatting is being applied on page load rather than in XAML markup
00038     // so that the on-demand cloud font behavior can be experienced when the
00039     // app runs rather than when the XAML file is viewed in Visual Studio.
00040
00041     // Formatting will be applied to all content elements in the page that don't
00042     // already have FontFamily set.
00043     this->FontFamily = ref new Windows::UI::Xaml::Media::FontFamily("Neue Haas Grotesk Text Pro");
00044 }
Generated on Fri Nov 15 2024 22:19:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario4.xaml.h Source File

  • MapControl
  • cpp

Scenario4.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario4 sealed
00021     {
00022     public:
00023         Scenario4();
00024     private:
00025         MainPage^ rootPage = MainPage::Current;
00026         void showSpaceNeedleButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00027         void myMap_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028     };
00029 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/pch.cpp Source File

  • CustomCapability
  • Service
  • Client

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/FrameSourceViewModels.cs Source File

  • CameraFrames
  • cs

FrameSourceViewModels.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Collections.ObjectModel;
00014 using System.Linq;
00015 using System.Threading.Tasks;
00016 using Windows.ApplicationModel.Core;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Media.Capture.Frames;
00019 using Windows.UI.Core;
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// View model for MediaFrameSourceGroup used in XAML ContentControl.
00025     /// </summary>
00026     public class FrameSourceGroupModel
00027     {
00028         public string Id { get; }
00029         public string DisplayName { get; }
00030         public MediaFrameSourceGroup SourceGroup { get; }
00031         public IReadOnlyList<FrameSourceInfoModel> SourceInfos { get; }
00032
00033         public FrameSourceGroupModel(MediaFrameSourceGroup group)
00034         {
00035             SourceGroup = group;
00036             this.Id = group.Id;
00037             this.DisplayName = group.DisplayName;
00038             this.SourceInfos = group.SourceInfos.Select(
00039                 sourceInfo => new FrameSourceInfoModel(sourceInfo)).ToArray();
00040         }
00041
00042         public override string ToString()
00043         {
00044             return this.DisplayName;
00045         }
00046     }
00047
00048     /// <summary>
00049     /// View model for MediaFrameSourceInfo used in XAML ContentControl.
00050     /// </summary>
00051     public class FrameSourceInfoModel
00052     {
00053         public string DisplayName { get; }
00054         public string Id { get; }
00055         public MediaFrameSourceGroup SourceGroup { get; }
00056         public MediaFrameSourceInfo SourceInfo { get; }
00057
00058         public FrameSourceInfoModel(MediaFrameSourceInfo sourceInfo)
00059         {
00060             this.SourceInfo = sourceInfo;
00061             this.SourceGroup = this.SourceInfo.SourceGroup;
00062
00063             this.Id = sourceInfo.Id;
00064
00065             var kind = sourceInfo.SourceKind.ToString();
00066             var type = sourceInfo.MediaStreamType.ToString();
00067             this.DisplayName = $"{kind} {type}";
00068         }
00069
00070         public override string ToString()
00071         {
00072             return this.DisplayName;
00073         }
00074     }
00075
00076     /// <summary>
00077     /// View model for MediaFrameFormat used in XAML ContentControl.
00078     /// </summary>
00079     public class FrameFormatModel
00080     {
00081         public MediaFrameFormat Format { get; }
00082
00083         public string DisplayName { get; }
00084
00085         public FrameFormatModel(MediaFrameFormat format)
00086         {
00087             this.Format = format;
00088             this.DisplayName = string.Format("{0} | {1} | {2} x {3} | {4:#.##}fps",
00089                 format.MajorType,
00090                 format.Subtype,
00091                 format.VideoFormat?.Width,
00092                 format.VideoFormat?.Height,
00093                 Math.Round((double)format.FrameRate.Numerator / format.FrameRate.Denominator, 2));
00094         }
00095
00096         public override string ToString()
00097         {
00098             return this.DisplayName;
00099         }
00100
00101         /// <summary>
00102         /// Compares the Format contained by this view model to the given format for equivalency.
00103         /// </summary>
00104         /// <param name="otherFormat">The MediaFrameFormat to compare to the MediaFrameFormat in this view model.</param>
00105         /// <returns></returns>
00106         public bool HasSameFormat(MediaFrameFormat otherFormat)
00107         {
00108             if (otherFormat == null)
00109             {
00110                 return (Format == null);
00111             }
00112
00113             return this.Format.MajorType == otherFormat.MajorType &&
00114                 this.Format.Subtype == otherFormat.Subtype &&
00115                 this.Format.FrameRate.Numerator == otherFormat.FrameRate.Numerator &&
00116                 this.Format.FrameRate.Denominator == otherFormat.FrameRate.Denominator &&
00117                 this.Format.VideoFormat?.Width == otherFormat.VideoFormat?.Width &&
00118                 this.Format.VideoFormat?.Height == otherFormat.VideoFormat?.Height;
00119         }
00120     }
00121
00122     /// <summary>
00123     /// View model for a collection of MediaFrameSourceGroup used in XAML ItemsControl.
00124     /// </summary>
00125     public class SourceGroupCollection : IDisposable
00126     {
00127         private CoreDispatcher _dispatcher;
00128         private DeviceWatcher _watcher;
00129         private ObservableCollection<FrameSourceGroupModel> _sourceCollection;
00130
00131         public SourceGroupCollection(CoreDispatcher uiDispatcher)
00132         {
00133             _dispatcher = uiDispatcher;
00134             _sourceCollection = new ObservableCollection<FrameSourceGroupModel>();
00135
00136             // Only listen to devices with type of MediaFrameSourceGroup
00137             var deviceSelector = MediaFrameSourceGroup.GetDeviceSelector();
00138             _watcher = DeviceInformation.CreateWatcher(deviceSelector);
00139             _watcher.Added += Watcher_Added;
00140             _watcher.Removed += Watcher_Removed;
00141             _watcher.Updated += Watcher_Updated;
00142             _watcher.Start();
00143         }
00144
00145         public void Dispose()
00146         {
00147             _watcher.Stop();
00148             _watcher.Updated -= Watcher_Updated;
00149             _watcher.Removed -= Watcher_Removed;
00150             _watcher.Added -= Watcher_Added;
00151         }
00152
00153         public IReadOnlyList<FrameSourceGroupModel> FrameSourceGroups
00154         {
00155             get { return _sourceCollection; }
00156         }
00157
00158         /// <summary>
00159         /// Updates a device when a change occurs.
00160         /// </summary>
00161         private async void Watcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args)
00162         {
00163             await RemoveDevice(args.Id);
00164             await AddDeviceAsync(args.Id);
00165         }
00166
00167         /// <summary>
00168         /// Removes a device from the collection when one disconnected.
00169         /// </summary>
00170         private async void Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
00171         {
00172             await RemoveDevice(args.Id);
00173         }
00174
00175         /// <summary>
00176         /// Adds a device to the collection when one connected.
00177         /// </summary>
00178         private async void Watcher_Added(DeviceWatcher sender, DeviceInformation args)
00179         {
00180             await AddDeviceAsync(args.Id);
00181         }
00182
00183         /// <summary>
00184         /// Adds a SourceGroup with given Id to the collection.
00185         /// </summary>
00186         private async Task AddDeviceAsync(string id)
00187         {
00188             var group = await MediaFrameSourceGroup.FromIdAsync(id);
00189             if (group != null)
00190             {
00191                 await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00192                     {
00193                         _sourceCollection.Add(new FrameSourceGroupModel(group));
00194                     });
00195             }
00196         }
00197
00198         /// <summary>
00199         /// Removes a SourceGroup with given id from the collection if it exists
00200         /// </summary>
00201         private async Task RemoveDevice(string id)
00202         {
00203             await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00204                 {
00205                     var existing = _sourceCollection.FirstOrDefault(item => item.Id == id);
00206                     if (existing != null)
00207                     {
00208                         _sourceCollection.Remove(existing);
00209                     }
00210                 });
00211         }
00212     }
00213 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5 Member List

This is the complete list of members for Scenario5, including all inherited members.
m_revokeEventScenarioText | Scenario5 | [private]
m_revokeScenarioTxt | Scenario5 | [private]
OnNavigatedTo(NavigationEventArgs e) | Scenario5 | [inline, protected]
ProtectedContentRevoked(Object sender, ProtectedContentRevokedEventArgs args) | Scenario5 | [inline, private]
Revoke_Click(object sender, RoutedEventArgs e) | Scenario5 | [inline, private]
rootPage | Scenario5 | [private]
Scenario5() | Scenario5 | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario13_RetryFilter Member List

This is the complete list of members for Scenario13_RetryFilter, including all inherited members.
Cancel_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario13_RetryFilter |
CancelableRequestAsync(Windows::Foundation::Uri resourceUri) | Scenario13_RetryFilter | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario13_RetryFilter |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario13_RetryFilter |
RetryAfterSwitch_Toggled(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario13_RetryFilter |
Scenario13_RetryFilter() | Scenario13_RetryFilter |
Start_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario13_RetryFilter |
UpdateAddressField() | Scenario13_RetryFilter | [private]
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Project.idl Source File

  • SmartCard
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_ProvisionTPM : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_ProvisionTPM();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_ChangePIN : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_ChangePIN();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_ResetPIN : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_ResetPIN();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_ChangeAdminKey : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_ChangeAdminKey();
00036     }
00037
00038     [default_interface]
00039     runtimeclass Scenario5_VerifyResponse : Windows.UI.Xaml.Controls.Page
00040     {
00041         Scenario5_VerifyResponse();
00042     }
00043
00044     [default_interface]
00045     runtimeclass Scenario6_DeleteTPM : Windows.UI.Xaml.Controls.Page
00046     {
00047         Scenario6_DeleteTPM();
00048     }
00049
00050     [default_interface]
00051     runtimeclass Scenario7_ListAllCards : Windows.UI.Xaml.Controls.Page
00052     {
00053         Scenario7_ListAllCards();
00054     }
00055
00056     [Windows.UI.Xaml.Data.Bindable]
00057     runtimeclass SmartCardListItem
00058     {
00059         SmartCardListItem(String readerName, String cardName);
00060
00061         String ReaderName { get; };
00062         String CardName{ get; };
00063     }
00064
00065     [default_interface]
00066     runtimeclass Scenario8_TransmitAPDU : Windows.UI.Xaml.Controls.Page
00067     {
00068         Scenario8_TransmitAPDU();
00069     }
00070 }
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RootFrameNavigationHelper Member List

This is the complete list of members for RootFrameNavigationHelper, including all inherited members.
CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs e) | RootFrameNavigationHelper | [inline, private]
CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e) | RootFrameNavigationHelper | [inline, private]
Frame | RootFrameNavigationHelper | [private]
RootFrameNavigationHelper(Frame rootFrame) | RootFrameNavigationHelper | [inline]
systemNavigationManager | RootFrameNavigationHelper | [private]
SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e) | RootFrameNavigationHelper | [inline, private]
TryGoBack() | RootFrameNavigationHelper | [inline, private]
TryGoForward() | RootFrameNavigationHelper | [inline, private]
UpdateBackButton() | RootFrameNavigationHelper | [inline, private]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario4_ChangeAdminKey.h Source File

  • SmartCard
  • cppwinrt

Scenario4_ChangeAdminKey.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once;
00013
00014 #include "Scenario4_ChangeAdminKey.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario4_ChangeAdminKey : Scenario4_ChangeAdminKeyT<Scenario4_ChangeAdminKey>
00019     {
00020         SDKTemplate::MainPage m_rootPage{ SDKTemplate::MainPage::Current() };
00021
00022         Scenario4_ChangeAdminKey();
00023
00024         fire_and_forget ChangeAdminKey_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&);
00025     };
00026 }
00027
00028 namespace winrt::SDKTemplate::factory_implementation
00029 {
00030     struct Scenario4_ChangeAdminKey : Scenario4_ChangeAdminKeyT<Scenario4_ChangeAdminKey, implementation::Scenario4_ChangeAdminKey>
00031     {
00032     };
00033 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/Scenario1_Basic.cpp Source File

  • FullScreenMode
  • cppwinrt

Scenario1_Basic.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_Basic.h"
00014 #include "Scenario1_Basic.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::UI::ViewManagement;
00019 using namespace Windows::UI::Xaml;
00020 using namespace Windows::UI::Xaml::Controls;
00021 using namespace Windows::UI::Xaml::Input;
00022 using namespace Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario1_Basic::Scenario1_Basic()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario1_Basic::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         windowResizeToken = Window::Current().SizeChanged([this](auto&&, auto&&)
00034         {
00035             UpdateContent();
00036         });
00037         keyDownToken = rootPage.KeyDown({ this, &Scenario1_Basic::RootPage_OnKeyDown });
00038
00039         UpdateContent();
00040     }
00041
00042     void Scenario1_Basic::OnNavigatedFrom(NavigationEventArgs const&)
00043     {
00044         Window::Current().SizeChanged(windowResizeToken);
00045         rootPage.KeyDown(keyDownToken);
00046     }
00047
00048     void Scenario1_Basic::ToggleFullScreenModeButton_Click(IInspectable const&, RoutedEventArgs const&)
00049     {
00050         ApplicationView view = ApplicationView::GetForCurrentView();
00051         if (view.IsFullScreenMode())
00052         {
00053             view.ExitFullScreenMode();
00054             rootPage.NotifyUser(L"Exiting full screen mode", NotifyType::StatusMessage);
00055             isLastKnownFullScreen = false;
00056             // The SizeChanged event will be raised when the exit from full screen mode is complete.
00057         }
00058         else
00059         {
00060             if (view.TryEnterFullScreenMode())
00061             {
00062                 rootPage.NotifyUser(L"Entering full screen mode", NotifyType::StatusMessage);
00063                 isLastKnownFullScreen = true;
00064                 // The SizeChanged event will be raised when the entry to full screen mode is complete.
00065             }
00066             else
00067             {
00068                 rootPage.NotifyUser(L"Failed to enter full screen mode", NotifyType::ErrorMessage);
00069             }
00070         }
00071     }
00072
00073     void Scenario1_Basic::ShowStandardSystemOverlaysButton_Click(IInspectable const&, RoutedEventArgs const&)
00074     {
00075         ApplicationView view = ApplicationView::GetForCurrentView();
00076         view.ShowStandardSystemOverlays();
00077     }
00078
00079     void Scenario1_Basic::UseMinimalOverlaysCheckBox_Click(IInspectable const&, RoutedEventArgs const&)
00080     {
00081         ApplicationView view = ApplicationView::GetForCurrentView();
00082         view.FullScreenSystemOverlayMode(UseMinimalOverlaysCheckBox().IsChecked().Value() ? FullScreenSystemOverlayMode::Minimal : FullScreenSystemOverlayMode::Standard);
00083     }
00084
00085     void Scenario1_Basic::UpdateContent()
00086     {
00087         ApplicationView view = ApplicationView::GetForCurrentView();
00088         bool isFullScreenMode = view.IsFullScreenMode();
00089         ToggleFullScreenModeSymbol().Symbol(isFullScreenMode ? Symbol::BackToWindow : Symbol::FullScreen);
00090         ReportFullScreenMode().Text(isFullScreenMode ? L"is in" : L"is not in");
00091         FullScreenOptionsPanel().Visibility(isFullScreenMode ? Visibility::Visible : Visibility::Collapsed);
00092
00093         // Did the system force a change in full screen mode?
00094         if (isLastKnownFullScreen != isFullScreenMode)
00095         {
00096             isLastKnownFullScreen = isFullScreenMode;
00097             // Clear any stray messages that talked about the mode we are no longer in.
00098             rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00099         }
00100     }
00101
00102     void Scenario1_Basic::RootPage_OnKeyDown(IInspectable const&, KeyRoutedEventArgs const& e)
00103     {
00104         if (e.Key() == Windows::System::VirtualKey::Escape)
00105         {
00106             ApplicationView view = ApplicationView::GetForCurrentView();
00107             if (view.IsFullScreenMode())
00108             {
00109                 view.ExitFullScreenMode();
00110                 rootPage.NotifyUser(L"Exited full screen mode due to keypress", NotifyType::StatusMessage);
00111                 isLastKnownFullScreen = false;
00112             }
00113         }
00114     }
00115 }
Generated on Fri Nov 15 2024 22:19:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/WorldMesh.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

WorldMesh.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "MeshObject.h"
00015
00016 // WorldCeilingMesh:
00017 // This class derives from MeshObject and creates a ID3D11Buffer of
00018 // vertices and indices to represent the ceiling of the bounding cube
00019 // of the world.
00020 // The vertices are defined by a position, a normal and a single
00021 // 2D texture coordinate.
00022
00023 class WorldCeilingMesh : public MeshObject
00024 {
00025 public:
00026     WorldCeilingMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device);
00027 };
00028
00029 // WorldFloorMesh:
00030 // This class derives from MeshObject and creates a ID3D11Buffer of
00031 // vertices and indices to represent the floor of the bounding cube
00032 // of the world.
00033
00034 class WorldFloorMesh : public MeshObject
00035 {
00036 public:
00037     WorldFloorMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device);
00038 };
00039
00040 // WorldWallsMesh:
00041 // This class derives from MeshObject and creates a ID3D11Buffer of
00042 // vertices and indices to represent the walls of the bounding cube
00043 // of the world.
00044
00045 class WorldWallsMesh : public MeshObject
00046 {
00047 public:
00048     WorldWallsMesh(_In_ winrt::com_ptr<ID3D11Device3> const& device);
00049 };
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication/BufferPacket.cpp Source File

  • SimpleCommunication
  • common
  • MediaExtensions
  • Microsoft.Samples.SimpleCommunication

BufferPacket.cpp

Go to the documentation of this file.
00001 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "BufferPacket.h"
00010
00011 using namespace Microsoft::Samples::SimpleCommunication::Network;
00012
00013 HRESULT Microsoft::Samples::SimpleCommunication::Network::CreateBufferPacketFromMFSample(_In_ IMFSample *pSample, _Outptr_ IBufferPacket **ppBufferPacket)
00014 {
00015     return CBufferPacket::FromMFSample(pSample, ppBufferPacket);
00016 }
00017
00018 HRESULT Microsoft::Samples::SimpleCommunication::Network::CreateBufferPacket(_Outptr_ IBufferPacket **ppBufferPacket)
00019 {
00020     return CBufferPacket::CreateInstance(ppBufferPacket);
00021 }
00022
00023 CBufferPacket::CBufferPacket(void)
00024     : _cRef(1)
00025 {
00026 }
00027
00028
00029 CBufferPacket::~CBufferPacket(void)
00030 {
00031 }
00032
00033 // IUnknown methods
00034
00035 IFACEMETHODIMP CBufferPacket::QueryInterface(REFIID riid, void **ppv)
00036 {
00037     if (ppv == nullptr)
00038     {
00039         return E_POINTER;
00040     }
00041     (*ppv) = nullptr;
00042
00043     HRESULT hr = S_OK;
00044     if (riid == IID_IUnknown || riid == __uuidof(IBufferPacket))
00045     {
00046         (*ppv) = static_cast<IBufferPacket*>(this);
00047         AddRef();
00048         hr = S_OK;
00049     }
00050     else
00051     {
00052         hr = E_NOINTERFACE;
00053     }
00054
00055     return hr;
00056 }
00057
00058 IFACEMETHODIMP_(ULONG) CBufferPacket::AddRef()
00059 {
00060     return InterlockedIncrement(&_cRef);
00061 }
00062
00063 IFACEMETHODIMP_(ULONG) CBufferPacket::Release()
00064 {
00065     long cRef = InterlockedDecrement(&_cRef);
00066     if (cRef == 0)
00067     {
00068         delete this;
00069     }
00070     return cRef;
00071 }
00072
00073 HRESULT CBufferPacket::FromMFSample(IMFSample *pSample, IBufferPacket **ppBufferPacket)
00074 {
00075     if (pSample == nullptr || ppBufferPacket == nullptr)
00076     {
00077         return E_INVALIDARG;
00078     }
00079
00080     ComPtr<IBufferPacket> spPacket;
00081     DWORD cBuffers = 0;
00082     HRESULT hr = CBufferPacket::CreateInstance(&spPacket);
00083
00084     if (SUCCEEDED(hr))
00085     {
00086         hr = pSample->GetBufferCount(&cBuffers);
00087     }
00088
00089     if (SUCCEEDED(hr))
00090     {
00091         for (DWORD nIndex = 0; nIndex < cBuffers; ++nIndex)
00092         {
00093             ComPtr<IMFMediaBuffer> spMediaBuffer;
00094             ComPtr<IMediaBufferWrapper> spBufferWrapper;
00095
00096             // Get buffer from the sample
00097             hr = pSample->GetBufferByIndex(nIndex, &spMediaBuffer);
00098             if (FAILED(hr))
00099             {
00100                 break;
00101             }
00102
00103             // Create buffer wrapper
00104             hr = CreateMediaBufferWrapper(spMediaBuffer.Get(), &spBufferWrapper);
00105             if (FAILED(hr))
00106             {
00107                 break;
00108             }
00109
00110             // Add buffer to the package
00111             hr = spPacket->AddBuffer(spBufferWrapper.Get());
00112             if (FAILED(hr))
00113             {
00114                 break;
00115             }
00116         }
00117     }
00118
00119     if (SUCCEEDED(hr))
00120     {
00121         *ppBufferPacket = spPacket.Detach();
00122     }
00123
00124     TRACEHR_RET(hr);
00125 }
00126
00127 HRESULT CBufferPacket::CreateInstance(IBufferPacket **ppBufferPacket)
00128 {
00129     if (ppBufferPacket == nullptr)
00130     {
00131         return E_INVALIDARG;
00132     }
00133
00134     ComPtr<IBufferPacket> spPacket;
00135     HRESULT hr = S_OK;
00136
00137     spPacket.Attach(new CBufferPacket());
00138
00139     if (!spPacket)
00140     {
00141         hr = E_OUTOFMEMORY;
00142     }
00143
00144     if (SUCCEEDED(hr))
00145     {
00146         *ppBufferPacket = spPacket.Detach();
00147     }
00148
00149     TRACEHR_RET(hr);
00150 }
00151
00152 // IBufferPacket methods
00153 IFACEMETHODIMP CBufferPacket::AddBuffer(IMediaBufferWrapper *pBuffer)
00154 {
00155     _buffers.push_back(pBuffer);
00156
00157     return S_OK;
00158 }
00159
00160 IFACEMETHODIMP CBufferPacket::InsertBuffer(unsigned int nIndex, IMediaBufferWrapper *pBuffer)
00161 {
00162     if (nIndex > _buffers.size() || pBuffer == nullptr)
00163     {
00164         return E_INVALIDARG;
00165     }
00166
00167     Iterator it = _buffers.begin();
00168     Iterator itEnd = _buffers.end();
00169
00170     for (DWORD nCurrent = 1; nCurrent < nIndex && it != itEnd; ++nCurrent, ++it);
00171
00172     _buffers.insert(it, pBuffer);
00173
00174     return S_OK;
00175 }
00176
00177 IFACEMETHODIMP CBufferPacket::RemoveBuffer(unsigned int nIndex, IMediaBufferWrapper **ppBuffer)
00178 {
00179     if (nIndex > _buffers.size() || ppBuffer == nullptr)
00180     {
00181         return E_INVALIDARG;
00182     }
00183
00184     Iterator it = _buffers.begin();
00185     Iterator itEnd = _buffers.end();
00186
00187     for (DWORD nCurrent = 1; nCurrent < nIndex && it != itEnd; ++nCurrent, ++it);
00188
00189     *ppBuffer = (*it).Get();
00190     (*ppBuffer)->AddRef();
00191
00192     _buffers.erase(it);
00193
00194     return S_OK;
00195 }
00196
00197 IFACEMETHODIMP CBufferPacket::Clear()
00198 {
00199     _buffers.clear();
00200     return S_OK;
00201 }
00202
00203 IFACEMETHODIMP_(size_t) CBufferPacket::GetBufferCount() const
00204 {
00205     return _buffers.size();
00206 }
00207
00208 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
00209 IFACEMETHODIMP CBufferPacket::FillWSABUF(WSABUF *pBuffers, size_t cBuffers)
00210 {
00211     if (pBuffers == nullptr)
00212     {
00213         return E_INVALIDARG;
00214     }
00215
00216     if (cBuffers < GetBufferCount())
00217     {
00218         return MF_E_INSUFFICIENT_BUFFER;
00219     }
00220
00221     HRESULT hr = S_OK;
00222     Iterator it = _buffers.begin();
00223     Iterator itEnd = _buffers.end();
00224     size_t pos = 0;
00225
00226     for (;it != itEnd; ++it, ++pos)
00227     {
00228         DWORD cbLen;
00229         hr = (*it)->GetCurrentLength(&cbLen);
00230         if (FAILED(hr))
00231         {
00232             break;
00233         }
00234         pBuffers[pos].buf = reinterpret_cast<CHAR *>((*it)->GetBuffer());
00235         pBuffers[pos].len = cbLen;
00236     }
00237
00238     TRACEHR_RET(hr);
00239 }
00240
00241 IFACEMETHODIMP CBufferPacket::SaveToFile(LPCWSTR pszFileName)
00242 {
00243     HANDLE hFile = CreateFile(pszFileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
00244
00245     HRESULT hr = S_OK;
00246     if (hFile == INVALID_HANDLE_VALUE)
00247     {
00248         hr = HRESULT_FROM_WIN32(GetLastError());
00249     }
00250
00251     if (SUCCEEDED(hr))
00252     {
00253         Container::iterator it = _buffers.begin();
00254         Container::iterator endIt = _buffers.end();
00255
00256         for(;it != endIt; ++it)
00257         {
00258             IMediaBufferWrapper *pBuffer = (*it);
00259             DWORD cbSize;
00260
00261             hr = pBuffer->GetCurrentLength(&cbSize);
00262
00263             if (SUCCEEDED(hr) && !WriteFile(hFile, pBuffer->GetBuffer(), cbSize, &cbSize, nullptr))
00264             {
00265                 hr = HRESULT_FROM_WIN32(GetLastError());
00266             }
00267         }
00268     }
00269
00270     CloseHandle(hFile);
00271
00272     return hr;
00273 }
00274 #endif
00275
00276 IFACEMETHODIMP CBufferPacket::GetTotalLength(_Out_ DWORD *pcbTotalLength)
00277 {
00278     if (pcbTotalLength == nullptr)
00279     {
00280         return E_INVALIDARG;
00281     }
00282
00283     HRESULT hr = S_OK;
00284     Iterator it = _buffers.begin();
00285     Iterator itEnd = _buffers.end();
00286     DWORD cbSize = 0;
00287
00288     for (;it != itEnd; ++it)
00289     {
00290         DWORD cbLen;
00291         hr = (*it)->GetCurrentLength(&cbLen);
00292         if (FAILED(hr))
00293         {
00294             break;
00295         }
00296         cbSize += cbLen;
00297     }
00298
00299     *pcbTotalLength = cbSize;
00300
00301     TRACEHR_RET(hr);
00302 }
00303
00304 IFACEMETHODIMP CBufferPacket::CopyTo(DWORD nOffset, DWORD cbSize, _In_reads_bytes_(cbSize) void *pDest, _Out_ DWORD *pcbCopied)
00305 {
00306     if (pDest == nullptr || pcbCopied == nullptr)
00307     {
00308         return E_INVALIDARG;
00309     }
00310
00311     HRESULT hr = S_OK;
00312     Iterator it = _buffers.begin();
00313     Iterator itEnd = _buffers.end();
00314     DWORD cbSkipped = 0;
00315     DWORD cbCopied = 0;
00316
00317     // Skip to the offset
00318     for (;cbSkipped < nOffset && it != itEnd; ++it)
00319     {
00320         DWORD cbLen;
00321         DWORD nStart = 0;
00322         DWORD cbCopy = 0;
00323         hr = (*it)->GetCurrentLength(&cbLen);
00324         if (FAILED(hr))
00325         {
00326             break;
00327         }
00328         if (cbSkipped + cbLen <= nOffset)
00329         {
00330             cbSkipped += cbLen;
00331             if (cbSkipped == nOffset)
00332             {
00333                 break;
00334             }
00335             continue;
00336         }
00337         else
00338         {
00339             nStart = nOffset - cbSkipped;
00340             cbCopy = min(cbSize, cbLen - nStart);
00341         }
00342
00343        CopyMemory(pDest, (*it)->GetBuffer() + nStart, cbCopy);
00344
00345        cbCopied = cbCopy;
00346        cbSkipped += nStart;
00347     }
00348
00349     if (SUCCEEDED(hr))
00350     {
00351         for (;it != itEnd && cbCopied < cbSize; ++it)
00352         {
00353             DWORD cbLen;
00354             hr = (*it)->GetCurrentLength(&cbLen);
00355             if (FAILED(hr))
00356             {
00357                 break;
00358             }
00359             DWORD cbCopy = min(cbLen, cbSize - cbCopied);
00360
00361             CopyMemory(static_cast<BYTE *>(pDest) + cbCopied, (*it)->GetBuffer(), cbCopy);
00362
00363            cbCopied += cbCopy;
00364         }
00365     }
00366
00367     *pcbCopied = cbCopied;
00368
00369     TRACEHR_RET(hr);
00370 }
00371
00372 IFACEMETHODIMP CBufferPacket::MoveLeft(DWORD cbSize, _Out_writes_bytes_(cbSize) void *pDest)
00373 {
00374     DWORD cbCopied = 0;
00375     HRESULT hr = CopyTo(0, cbSize, pDest, &cbCopied);
00376
00377     if (SUCCEEDED(hr) && cbCopied != cbSize)
00378     {
00379         hr = E_INVALIDARG;
00380     }
00381
00382     if (SUCCEEDED(hr))
00383     {
00384         hr = TrimLeft(cbSize);
00385     }
00386
00387     TRACEHR_RET(hr);
00388 }
00389
00390 IFACEMETHODIMP CBufferPacket::TrimLeft(DWORD cbSize)
00391 {
00392     DWORD cbTotalLength = 0;
00393     HRESULT hr = GetTotalLength(&cbTotalLength);
00394
00395     if (SUCCEEDED(hr) && cbSize > cbTotalLength)
00396     {
00397         return E_INVALIDARG;
00398     }
00399
00400     Iterator it = _buffers.begin();
00401     Iterator itEnd = _buffers.end();
00402     DWORD cbSkipped = 0;
00403
00404     for (;cbSkipped < cbSize; it = _buffers.begin())
00405     {
00406         DWORD cbLen;
00407         DWORD nStart = 0;
00408         DWORD cbCopy = 0;
00409         hr = (*it)->GetCurrentLength(&cbLen);
00410         if (FAILED(hr))
00411         {
00412             break;
00413         }
00414         if (cbSkipped + cbLen <= cbSize)
00415         {
00416             _buffers.pop_front();
00417             cbSkipped += cbLen;
00418         }
00419         else
00420         {
00421             // skip the rest
00422             hr = (*it)->TrimLeft(cbSize-cbSkipped);
00423             break;
00424         }
00425     }
00426
00427     TRACEHR_RET(hr);
00428 }
00429
00430 // Convert buffer packet to IMFSample
00431 IFACEMETHODIMP CBufferPacket::ToMFSample(IMFSample **ppSample)
00432 {
00433     ComPtr<IMFSample> spSample;
00434
00435     HRESULT hr = MFCreateSample(&spSample);
00436
00437     if (SUCCEEDED(hr))
00438     {
00439         Container::iterator it = _buffers.begin();
00440         Container::iterator endIt = _buffers.end();
00441
00442         for(;it != endIt; ++it)
00443         {
00444             IMediaBufferWrapper *pBuffer = (*it).Get();
00445             ComPtr<IMFMediaBuffer> spMediaBuffer;
00446
00447             if (pBuffer->GetOffset() == 0)
00448             {
00449                 // If offset is zero we can just use embedded media buffer
00450                 spMediaBuffer = pBuffer->GetMediaBuffer();
00451             }
00452             else
00453             {
00454                 // We have to create MF media buffer wrapper to include offset
00455                 DWORD cbLen;
00456                 hr = pBuffer->GetCurrentLength(&cbLen);
00457                 if (FAILED(hr))
00458                 {
00459                     break;
00460                 }
00461                 hr = MFCreateMediaBufferWrapper(pBuffer->GetMediaBuffer(), pBuffer->GetOffset(), cbLen, &spMediaBuffer);
00462                 if (FAILED(hr))
00463                 {
00464                     break;
00465                 }
00466             }
00467
00468             // Add media buffer to the sample
00469             hr = spSample->AddBuffer(spMediaBuffer.Get());
00470             if (FAILED(hr))
00471             {
00472                 break;
00473             }
00474         }
00475     }
00476
00477     if (SUCCEEDED(hr))
00478     {
00479         *ppSample = spSample.Detach();
00480     }
00481
00482     TRACEHR_RET(hr);
00483 }
00484
00485 IFACEMETHODIMP CBufferPacket::GetEnumerator (_Out_ IBufferEnumerator **ppEnumerator)
00486 {
00487     return CBufferEnumerator::CreateInstance(_buffers, this, ppEnumerator);
00488 }
00489
00490 HRESULT CBufferEnumerator::CreateInstance(CBufferPacket::Container &container, IUnknown *pParent, IBufferEnumerator **ppEnumerator)
00491 {
00492     ComPtr<IBufferEnumerator> spResult;
00493
00494     if (ppEnumerator == nullptr)
00495     {
00496         return E_INVALIDARG;
00497     }
00498
00499     spResult.Attach(new CBufferEnumerator(container, pParent));
00500
00501     if (!spResult)
00502     {
00503         return E_OUTOFMEMORY;
00504     }
00505     else
00506     {
00507         *ppEnumerator = spResult.Detach();
00508     }
00509
00510     return S_OK;
00511 }
00512
00513 CBufferEnumerator::CBufferEnumerator(CBufferPacket::Container &container, IUnknown *pParent)
00514     : _cRef(1)
00515     , _buffers(container)
00516     , _spParent(pParent)
00517     , _currentIt(container.begin())
00518 {
00519 }
00520
00521 CBufferEnumerator::~CBufferEnumerator()
00522 {
00523 }
00524
00525 // IUnknown methods
00526 IFACEMETHODIMP CBufferEnumerator::QueryInterface(REFIID riid, void **ppv)
00527 {
00528     if (ppv == nullptr)
00529     {
00530         return E_POINTER;
00531     }
00532     (*ppv) = nullptr;
00533
00534     HRESULT hr = S_OK;
00535     if (riid == IID_IUnknown || riid == __uuidof(IBufferEnumerator))
00536     {
00537         (*ppv) = static_cast<IBufferEnumerator*>(this);
00538         AddRef();
00539     }
00540     else
00541     {
00542         hr = E_NOINTERFACE;
00543     }
00544
00545     return hr;
00546 }
00547
00548 IFACEMETHODIMP_(ULONG) CBufferEnumerator::AddRef()
00549 {
00550     return InterlockedIncrement(&_cRef);
00551 }
00552
00553 IFACEMETHODIMP_(ULONG) CBufferEnumerator::Release()
00554 {
00555     long cRef = InterlockedDecrement(&_cRef);
00556     if (cRef == 0)
00557     {
00558         delete this;
00559     }
00560     return cRef;
00561 }
00562
00563 // IBufferEnumerator methods
00564 IFACEMETHODIMP_ (bool) CBufferEnumerator::IsValid ()
00565 {
00566     return _currentIt != _buffers.end();
00567 }
00568
00569 IFACEMETHODIMP CBufferEnumerator::GetCurrent (_Out_ IMediaBufferWrapper **ppBuffer)
00570 {
00571     if (ppBuffer == nullptr)
00572     {
00573         return E_INVALIDARG;
00574     }
00575
00576     if (!IsValid())
00577     {
00578         return MF_E_OUT_OF_RANGE;
00579     }
00580
00581     *ppBuffer = (*_currentIt).Get();
00582     (*ppBuffer)->AddRef();
00583
00584     return S_OK;
00585 }
00586
00587 IFACEMETHODIMP CBufferEnumerator::MoveNext ()
00588 {
00589     if (!IsValid())
00590     {
00591         return MF_E_OUT_OF_RANGE;
00592     }
00593
00594     ++_currentIt;
00595
00596     if (!IsValid())
00597     {
00598         return MF_E_OUT_OF_RANGE;
00599     }
00600
00601     return S_OK;
00602 }
00603
00604 IFACEMETHODIMP CBufferEnumerator::Reset ()
00605 {
00606     _currentIt = _buffers.begin();
00607
00608     if (!IsValid())
00609     {
00610         return MF_E_OUT_OF_RANGE;
00611     }
00612
00613     return S_OK;
00614 }
Generated on Fri Nov 15 2024 22:21:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Personalization/cs/SampleConfiguration.cs Source File

  • Personalization
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Lock screen personalization C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title = "Pick and set lock screen image", ClassType = typeof(SetLockScreenImage) },
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cpp/Scenario2_History.xaml.cpp Source File

  • Pedometer
  • cpp

Scenario2_History.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_History.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Globalization;
00021 using namespace Windows::Globalization::DateTimeFormatting;
00022 using namespace Windows::Devices::Enumeration;
00023 using namespace Windows::Devices::Sensors;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Collections;
00026 using namespace Windows::UI::Core;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Controls::Primitives;
00030 using namespace Windows::UI::Xaml::Data;
00031 using namespace Windows::UI::Xaml::Input;
00032 using namespace Windows::UI::Xaml::Media;
00033 using namespace Windows::UI::Xaml::Navigation;
00034
00035 Scenario2_History::Scenario2_History() : rootPage(MainPage::Current)
00036 {
00037     InitializeComponent();
00038
00039     // Disable buttons until we can access a pedometer
00040     GetHistory->IsEnabled = false;
00041
00042     // Determine if we can access pedometers
00043     auto deviceAccessInfo = DeviceAccessInformation::CreateFromDeviceClassId(GUID_Pedometer_ClassId);
00044     if (deviceAccessInfo->CurrentStatus == DeviceAccessStatus::Allowed)
00045     {
00046         // Determine if a pedometer is present
00047         // This can also be done using Windows::Devices::Enumeration::DeviceInformation::FindAllAsync
00048         create_task(Pedometer::GetDefaultAsync).then([this](task<Pedometer^> task)
00049         {
00050             auto pedometer = task.get();
00051             if (nullptr == pedometer)
00052             {
00053                 rootPage->NotifyUser("No pedometers available", NotifyType::ErrorMessage);
00054             }
00055             else
00056             {
00057                 historyRecords = ref new Vector<HistoryRecord^>();
00058                 historyRecordsList->DataContext = historyRecords;
00059                 rootPage->NotifyUser("Choose time span for history", NotifyType::StatusMessage);
00060                 GetHistory->IsEnabled = true;
00061             }
00062         });
00063     }
00064     else
00065     {
00066         rootPage->NotifyUser("Access to pedometer is denied", NotifyType::ErrorMessage);
00067     }
00068 }
00069
00070 /// <summary>
00071 /// Invoked when history span radio buttons are checked. This one handles the
00072 /// case when user selects 'All of the History' radio button.
00073 /// we collapse the date and time pickers here and is used to make a note of the
00074 /// user selection
00075 /// </summary>
00076 /// <param name="sender">unused</param>
00077 /// <param name="e">unused</param>
00078 void Scenario2_History::AllHistory_Checked(Platform::Object^ /*sender*/, Windows::UI::Xaml::RoutedEventArgs^ /*e*/)
00079 {
00080     // Collapse SpanPicker - SpanPicker will not be created yet the first time the page is loading
00081     if (nullptr != SpanPicker)
00082     {
00083         SpanPicker->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00084     }
00085     getAllHistory = true;
00086     rootPage->NotifyUser("This will retrieve all the step count history available on the system", NotifyType::StatusMessage);
00087 }
00088
00089 /// <summary>
00090 /// Invoked when history span radio buttons are checked. This one handles the
00091 /// case when user selects 'History for given time span' radio button.
00092 /// we make the date and time pickers visible here for user selection.
00093 /// </summary>
00094 /// <param name="sender">unused</param>
00095 /// <param name="e">unused</param>
00096 void Scenario2_History::SpecificHistory_Checked(Platform::Object^ /*sender*/, Windows::UI::Xaml::RoutedEventArgs^ /*e*/)
00097 {
00098     SpanPicker->Visibility = Windows::UI::Xaml::Visibility::Visible;
00099     getAllHistory = false;
00100     rootPage->NotifyUser("This will retrieve all the step count history for the selected time span", NotifyType::StatusMessage);
00101 }
00102
00103 /// <summary>
00104 /// Invoked when 'Get History' button is clicked.
00105 /// Depending on the user selection, this handler uses one of the overloaded
00106 /// 'GetSystemHistoryAsync' APIs to retrieve the pedometer history of the user
00107 /// </summary>
00108 /// <param name="sender">unused</param>
00109 /// <param name="e">unused</param>
00110 void Scenario2_History::GetHistory_Click(Platform::Object^ /*sender*/, Windows::UI::Xaml::RoutedEventArgs^ /*e*/)
00111 {
00112     IAsyncOperation<IVectorView<PedometerReading^>^>^ getHistoryAsyncOp = nullptr;
00113     String^ notificationString = ref new String();
00114     DateTimeFormatter^ timestampFormatter = ref new DateTimeFormatter("shortdate longtime");
00115
00116     // clear previous content being displayed
00117     historyRecords->Clear();
00118
00119     // Disable subsequent history retrieval while the async operation is in progress
00120     GetHistory->IsEnabled = false;
00121
00122     if (getAllHistory)
00123     {
00124         DateTime fromBeginning = {};
00125         getHistoryAsyncOp = Pedometer::GetSystemHistoryAsync(fromBeginning);
00126         notificationString += L" Retrieving all available History";
00127     }
00128     else
00129     {
00130         // Calculate the timepsan from the user selection of the history span.
00131         // you may skip this part to follow the 'GetSystemHistoryAsync' API usage
00132         notificationString += L"Retrieving history from: ";
00133         Calendar^ calendar = ref new Calendar();
00134         calendar->ChangeClock("24HourClock");
00135
00136         // DateTime picker will also include hour, minute and seconds from the the system time.
00137         // Decrement the same to be able to correctly add TimePicker values.
00138         calendar->SetDateTime(FromDate->Date);
00139         calendar->AddNanoseconds(-calendar->Nanosecond);
00140         calendar->AddSeconds(-calendar->Second);
00141         calendar->AddMinutes(-calendar->Minute);
00142         calendar->AddHours(-calendar->Hour);
00143
00144         DateTime fromTime = {};
00145         fromTime.UniversalTime = (calendar->GetDateTime()).UniversalTime + FromTime->Time.Duration;
00146
00147         calendar->SetDateTime(ToDate->Date);
00148         calendar->AddNanoseconds(-calendar->Nanosecond);
00149         calendar->AddSeconds(-calendar->Second);
00150         calendar->AddMinutes(-calendar->Minute);
00151         calendar->AddHours(-calendar->Hour);
00152
00153         DateTime toTime = {};
00154         toTime.UniversalTime = (calendar->GetDateTime()).UniversalTime + ToTime->Time.Duration;
00155
00156         notificationString += timestampFormatter->Format(fromTime);
00157         notificationString += L" To ";
00158         notificationString += timestampFormatter->Format(toTime);
00159
00160         if (toTime.UniversalTime < fromTime.UniversalTime)
00161         {
00162             rootPage->NotifyUser("Invalid time span. 'To Time' must be equal or more than 'From Time'", NotifyType::ErrorMessage);
00163             // Enable subsequent history retrieval while the async operation is in progress
00164             GetHistory->IsEnabled = true;
00165         }
00166         else
00167         {
00168             TimeSpan span;
00169             span.Duration = toTime.UniversalTime - fromTime.UniversalTime;
00170             getHistoryAsyncOp = Pedometer::GetSystemHistoryAsync(fromTime, span);
00171         }
00172     }
00173
00174     if (getHistoryAsyncOp != nullptr)
00175     {
00176         rootPage->NotifyUser(notificationString, NotifyType::StatusMessage);
00177         create_task(getHistoryAsyncOp).then([this](task<IVectorView<PedometerReading^>^> task)
00178         {
00179             try
00180             {
00181                 auto historyReadings = task.get();
00182
00183                 if (historyReadings != nullptr)
00184                 {
00185                     // Get at most 100 records (number is arbitrary chosen for demonstration purposes)
00186                     unsigned int count = min(100, historyReadings->Size);
00187
00188                     for (unsigned int index = 0; index < count; index++)
00189                     {
00190                         HistoryRecord^ record = ref new HistoryRecord(historyReadings->GetAt(index));
00191                         historyRecords->Append(record);
00192                     }
00193                 }
00194
00195                 rootPage->NotifyUser("History retrieval completed", NotifyType::StatusMessage);
00196             }
00197             catch (AccessDeniedException^)
00198             {
00199                 rootPage->NotifyUser("Access to the default pedometer is denied", NotifyType::ErrorMessage);
00200             }
00201         });
00202     }
00203
00204     // Finally, re-enable history retrieval
00205     GetHistory->IsEnabled = true;
00206 }
Generated on Fri Nov 15 2024 22:17:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/SampleConfiguration.h Source File

  • ContactCards
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Contact cards C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         Windows::ApplicationModel::Contacts::Contact^ CreateContactFromUserInput(
00039             Windows::UI::Xaml::Controls::TextBox^ EmailAddress,
00040             Windows::UI::Xaml::Controls::TextBox^ PhoneNumber);
00041
00042         static Windows::Foundation::Rect GetElementRect(Windows::UI::Xaml::FrameworkElement^ element);
00043
00044     private:
00045         static Platform::Array<Scenario>^ scenariosInner;
00046     };
00047
00048     public value struct Scenario
00049     {
00050         Platform::String^ Title;
00051         Platform::String^ ClassName;
00052     };
00053 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cs/Scenario3_Region.xaml.cs Source File

  • GlobalizationPreferences
  • cs

Scenario3_Region.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.Foundation;
00013 using Windows.Globalization;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario3_Region : Page
00020     {
00021         public Scenario3_Region()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         private string ReportRegionData(GeographicRegion region)
00027         {
00028             return "Display Name: " + region.DisplayName + "\n" +
00029                 "Native Name: " + region.NativeName + "\n" +
00030                 "Currencies in use: " + string.Join(", ", region.CurrenciesInUse) + "\n" +
00031                 "Codes: " + region.CodeTwoLetter + ", " + region.CodeThreeLetter + ", " + region.CodeThreeDigit + "\n\n";
00032         }
00033
00034         private void ShowResults_Click(object sender, RoutedEventArgs e)
00035         {
00036             // This scenario uses the Windows.Globalization.GeographicRegion class to
00037             // obtain the geographic region characteristics.
00038             var userGeoRegion = new GeographicRegion();
00039
00040             // This obtains the geographic region characteristics by providing a country or region code.
00041             var exampleGeoRegion = new GeographicRegion("JP");
00042
00043             // Display the results
00044             OutputTextBlock.Text = "User's Preferred Geographic Region\n" + ReportRegionData(userGeoRegion) +
00045                 "Example Geographic Region by region/country code (JP)\n" + ReportRegionData(exampleGeoRegion);
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cs/LoggingChannelScenario.cs Source File

  • Logging
  • cs

LoggingChannelScenario.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using System;
00008 using Windows.Foundation.Diagnostics;
00009
00010 namespace SDKTemplate
00011 {
00012     /// <summary>
00013     /// Demonstrate usage of LoggingChannel and LoggingActivity.
00014     /// </summary>
00015     internal class LoggingChannelScenario
00016     {
00017         /// <summary>
00018         /// Construct a LoggingChannel with the Windows 8.1 constructor, then
00019         /// use the LoggingChannel for the scenario.
00020         /// See this sample's README for further discussion.
00021         /// </summary>
00022         public void LogWithWin81Constructor()
00023         {
00024             /*
00025             If a LoggingChannel is used as a local or member variable, it should
00026             be closed (disposed) when no longer needed. C# will do this automatically
00027             if you enclose the usage in a using block.
00028             */
00029
00030             // The 1-parameter constructor creates a channel with Windows 8.1 semantics.
00031 #pragma warning disable 618 // Disable warning for use of obsolete LoggingChannel constructor.
00032             using (var channel = new LoggingChannel("SampleProvider"))
00033             {
00034                 // The Id for a Windows 8.1-mode channel is always the same.
00035                 // channel.Id == 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a
00036
00037                 this.DemonstrateLogging(channel);
00038             }
00039 #pragma warning restore 618
00040         }
00041
00042         /// <summary>
00043         /// Construct a LoggingChannel with the Windows 10 constructor, then
00044         /// use the LoggingChannel for the scenario. Also show the use cases
00045         /// for the two Windows 10 constructors.
00046         /// See this sample's README for further discussion.
00047         /// </summary>
00048         public void LogWithWin10Constructor()
00049         {
00050             /*
00051             If a LoggingChannel is used as a local or member variable, it should
00052             be closed (disposed) when no longer needed. C# will do this automatically
00053             if you enclose the usage in a using block.
00054             */
00055
00056             // The 2-parameter constructor creates a channel with Windows 10 semantics.
00057             using (var channel = new LoggingChannel(
00058                 "SampleProvider",
00059                 null)) // null means use default options.
00060             {
00061                 // The Id is generated by hashing the string "SampleProvider".
00062                 // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
00063
00064                 this.DemonstrateLogging(channel);
00065             }
00066
00067             /*
00068             Demonstrate other (less-common) constructor scenarios:
00069             */
00070
00071             // This creates a channel with Windows 10 semantics and declared
00072             // membership in a provider group.
00073             using (var channel = new LoggingChannel(
00074                 "SampleProvider",
00075                 new LoggingChannelOptions(new Guid("2e0582f3-d1b6-516a-9de3-9fd79ef952f8")))) // Join a provider group
00076             {
00077                 // The Id is generated by hashing the string "SampleProvider".
00078                 // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
00079             }
00080
00081             // This creates a channel with Windows 10 semantics and a specific
00082             // provider Id.
00083             using (var channel = new LoggingChannel(
00084                 "SampleProvider",
00085                 null,
00086                 new Guid("2e0582f3-d1b6-516a-9de3-9fd79ef952f8")))
00087             {
00088                 // channel.Id == 2e0582f3-d1b6-516a-9de3-9fd79ef952f8
00089             }
00090         }
00091
00092         /// <summary>
00093         /// This method demonstrates the LoggingChannel and LoggingActivity APIs.
00094         /// </summary>
00095         /// <param name="channel">
00096         /// The channel to use for the demonstration. This channel may have been
00097         /// constructed using a Windows 8.1 constructor or a Windows 10 constructor.
00098         /// The same APIs are supported in both cases, but the ETL events will be
00099         /// formatted a bit differently depending on how the channel was constructed.
00100         /// </param>
00101         private void DemonstrateLogging(LoggingChannel channel)
00102         {
00103             // Whenever any ETW session changes the way it is listening to this
00104             // channel, the LoggingEnable event is fired. For example, this might
00105             // be called when a session begins listening, changes the level at
00106             // which it is listening, or stops listening.
00107             channel.LoggingEnabled += this.OnLoggingEnabled;
00108
00109             // Log simple string events
00110             channel.LogMessage("Simple message"); // default level is Verbose
00111             channel.LogMessage("Simple error", LoggingLevel.Error);
00112
00113             // Log simple string + integer events.
00114             channel.LogValuePair("Simple message", 123); // default level is Verbose
00115             channel.LogValuePair("Simple error", 456, LoggingLevel.Error);
00116
00117             // The channel.Name property returns the name that was used when the
00118             // channel was constructed. When running in Windows 10 mode, the name
00119             // is already set as the provider name, so no LoggingChannelName is
00120             // automatically added to the event.
00121             channel.LogMessage(channel.Name);
00122
00123             // The channel.Id property is new to Windows 10.
00124             channel.LogMessage(channel.Id.ToString());
00125
00126             // If you want to avoid the overhead of collecting data when nobody is
00127             // listening to your channel, check the Enabled property before logging.
00128             if (channel.Enabled)
00129             {
00130                 channel.LogMessage(this.CollectExpensiveData());
00131             }
00132
00133             // The IsEnabled() method is exactly the same as the Enabled property,
00134             // except that it is a new Windows 10 API.
00135             if (channel.IsEnabled())
00136             {
00137                 channel.LogMessage(this.CollectExpensiveData());
00138             }
00139
00140             // If you want to only collect data if somebody is listening at a specific
00141             // level, you need to check both Enabled and Level. Note that the value of
00142             // the Level is unspecified when Enabled is false.
00143             if (channel.Enabled && channel.Level <= LoggingLevel.Warning)
00144             {
00145                 channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Warning);
00146             }
00147
00148             // The IsEnabled(LoggingLevel) method is a bit nicer than checking both
00149             // Enabled and Level, but it is only available on Windows 10 or later.
00150             if (channel.IsEnabled(LoggingLevel.Warning))
00151             {
00152                 channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Warning);
00153             }
00154
00155             // You can also use IsEnabled to check for keywords.
00156             if (channel.IsEnabled(LoggingLevel.Information, 0x10))
00157             {
00158                 channel.LogMessage(this.CollectExpensiveData(), LoggingLevel.Information);
00159             }
00160
00161             // Use LoggingFields with the LogEvent method to write complex events.
00162             var fields = new LoggingFields();
00163             fields.AddDouble("pi", 3.14159);
00164             channel.LogEvent(
00165                 "ComplexEvent",
00166                 fields,
00167                 LoggingLevel.Verbose,
00168                 new LoggingOptions(0x10)); // Keywords = 0x10
00169
00170             // You can add any number of name-value pairs to a fields object, though
00171             // you may encounter ETW limitations if you add too many. For example,
00172             // ETW is limited to a maximum event size of 64KB, and the current
00173             // TraceLogging decoder can handle no more than 128 fields.
00174
00175             // Performance optimization: You can reuse a LoggingFields object to
00176             // avoid unnecessary allocations. Don't forget to call Clear()
00177             // between uses, and don't try to share a LoggingFields object between
00178             // threads.
00179             fields.Clear();
00180             fields.AddDateTime("Date", DateTimeOffset.Now);
00181             channel.LogEvent("Now", fields);
00182
00183             fields.Clear();
00184
00185             // You can add a formatting hint to affect the way a value is decoded.
00186             // Not all combinations are useful, and the hint may be ignored.
00187             // For example, you can encode an MBCS string by writing a byte array
00188             // with a String hint.
00189             fields.AddUInt8Array(
00190                 "AnsiString",
00191                 new byte[] { 65, 66, 67, 49, 50, 51 }, // "ABC123"
00192                 LoggingFieldFormat.String);
00193
00194             // You can add "tag" bits to a field. These are user-defined bits that
00195             // can be used to communicate with an event processing tool. For example,
00196             // you might define a tag bit to indicate that a field contains private
00197             // data that should not be displayed on-screen.
00198             fields.AddString("Password", "12345", LoggingFieldFormat.Default, 0x10);
00199
00200             // You can add a "structure" to an event. A structure is a name for a
00201             // group of fields. Structures can nest. Call BeginStruct to add a level
00202             // of nesting, and call EndStruct after the last field of the structure.
00203             fields.BeginStruct("Nested");
00204                 fields.AddInt16("Nested-1", 1);
00205                 fields.AddInt16("Nested-2", 2);
00206                 fields.BeginStruct("Nested-Nested");
00207                     fields.AddInt16("Nested-Nested-3", 3);
00208                 fields.EndStruct();
00209                 fields.AddInt16("Nested-4", 4);
00210             fields.EndStruct();
00211
00212             // Advanced scenarios: you can use a LoggingOptions object to control
00213             // detailed event settings such as keywords, opcodes, and activity Ids.
00214             // These have their normal ETW semantics. You can also set event tags,
00215             // which are bit values that can be used to communicate with the event
00216             // processor.
00217             channel.LogEvent(
00218                 "VeryComplexEvent",
00219                 fields,
00220                 LoggingLevel.Information,
00221                 new LoggingOptions { Keywords = 0x123, Tags = 0x10 });
00222
00223             // Windows 10 introduces the ILoggingTarget interface. LoggingChannel
00224             // implements this interface. This interface allows components to accept
00225             // a logger as an parameter.
00226             this.DoSomething(channel);
00227
00228             /*
00229             If a LoggingActivity is created using a LoggingActivity constructor,
00230             it will use Windows 8.1 semantics:
00231
00232             - If an activity is destroyed (garbage-collected) without being closed
00233               and the associated LoggingChannel is still open, the activity will
00234               write a default Stop event.
00235             - The default Stop event (written by the destructor or by the Close()
00236               method) is encoded as a "simple" event.
00237
00238             The 8.1 semantics are deprecated because the automatic generation of
00239             a Stop event at garbage-collection can be misleading. The Stop event
00240             is intended to mark the a precise point at which an activity is
00241             completed, while the garbage-collection of an abandoned activity is
00242             inherently imprecise and unpredictable.
00243
00244             If a LoggingActivity is created using a StartActivity method, it will
00245             use Windows 10 semantics:
00246
00247             - If an activity is destroyed (garbage-collected) without being closed,
00248               there will be no Stop event for the activity.
00249             - The default Stop event (written by the Close() method) is encoded as
00250               a TraceLogging event with name "ActivityClosed".
00251             */
00252
00253             // This activity is created with Windows 8.1 semantics.
00254             using (var a1 = new LoggingActivity("Activity1", channel))
00255             {
00256                 // The activity Start event is written by the LoggingActivity constructor.
00257                 // You would do your activity's work here.
00258                 // The activity Stop event is written when the activity is closed (disposed).
00259
00260                 // The Windows 10 LoggingActivity adds new methods for writing events
00261                 // that are marked as associated with the activity.
00262                 a1.LogEvent("Activity event");
00263
00264                 // LoggingActivity also implements the ILoggingTarget interface, so you can
00265                 // use either a channel or an activity as a logging target.
00266                 this.DoSomething(a1);
00267
00268                 // The Windows 10 LoggingActivity adds new methods for creating nested activities.
00269                 // Note that nested activities are always created with Windows 10 semantics,
00270                 // even when nested under an activity that is using Windows 8.1 semantics.
00271                 using (var a2 = a1.StartActivity("Activity2"))
00272                 {
00273                     // Nested task occurs here.
00274
00275                     // The Windows 10 LoggingActivity allows you to customize the Stop event.
00276                     a2.StopActivity("Activity 2 stop");
00277                 }
00278
00279                 // Because a1 is using Windows 8.1 semantics, if we did not call Dispose(),
00280                 // it would attempt to write a Stop event when it is garbage collected.
00281                 // Writing Stop events during garbage collection is not useful, so be sure
00282                 // to properly stop, close, or dispose activities.
00283             }
00284
00285             // The Windows 10 StartActivity method creates a new activity, optionally with
00286             // specified fields and characteristics.
00287             // This activity is created with Windows 10 semantics.
00288             using (var a3 = channel.StartActivity("Activity3"))
00289             {
00290                 // Because a3 is using Windows 10 semantics, if we did not call Dispose(),
00291                 // there would be no Stop event (not even when the activity is garbage
00292                 // collected). To get a Stop event, be sure to stop, close, or dispose the
00293                 // activity.
00294             }
00295         }
00296
00297         private string CollectExpensiveData()
00298         {
00299             return "ExpensiveData";
00300         }
00301
00302         private void DoSomething(ILoggingTarget logger)
00303         {
00304             logger.LogEvent("Did something");
00305         }
00306
00307         private void OnLoggingEnabled(ILoggingChannel sender, object args)
00308         {
00309             // Here, you could note a change in the level or keywords.
00310         }
00311     }
00312 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RawSMBIOSTable Member List

This is the complete list of members for RawSMBIOSTable, including all inherited members.
Handle | RawSMBIOSTable
Length | RawSMBIOSTable
Type | RawSMBIOSTable
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/Scenario5_ApplicationTriggerTask.xaml.h Source File

  • BackgroundActivation
  • cpp

Scenario5_ApplicationTriggerTask.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario5_ApplicationTriggerTask.xaml.h
00013 // Declaration of the ApplicationTriggerTask class
00014 //
00015
00016 #pragma once
00017
00018 #include <ppltasks.h>
00019 #include "pch.h"
00020 #include "Scenario5_ApplicationTriggerTask.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class ApplicationTriggerTask sealed
00030     {
00031     public:
00032         ApplicationTriggerTask();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036     private:
00037         SDKTemplate::MainPage^ rootPage;
00038         ApplicationTrigger^ trigger = nullptr;
00039
00040         void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
00041         void RegisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void UnregisterBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043         void SignalBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044         void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
00045         void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
00046         void UpdateUI();
00047     };
00048 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Scenarios/Alarm/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Scenarios
  • Alarm

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Notifications;
00002 using Windows.UI.Xaml;
00003 using Windows.UI.Xaml.Controls;
00004
00005 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00006
00007 namespace Notifications.ScenarioPages.Toasts.Scenarios.Alarm
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class ScenarioElement : UserControl
00013     {
00014         public ScenarioElement()
00015         {
00016             this.InitializeComponent();
00017         }
00018
00019         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00020         {
00021             Initialize();
00022         }
00023
00024         private void Initialize()
00025         {
00026             // Clear all existing notifications
00027             ToastNotificationManager.History.Clear();
00028
00029             // Pop incoming call notification
00030             popToastControl.Payload =
00031                 $@"
00032                 <toast launch='args' scenario='alarm'>
00033                     <visual>
00034                         <binding template='ToastGeneric'>
00035                             <text>Alarm</text>
00036                             <text>Second Line of Text</text>
00037                         </binding>
00038                     </visual>
00039                     <actions>
00040
00041                         <action arguments = 'snooze'
00042                                 content = 'snooze' />
00043
00044                         <action arguments = 'dismiss'
00045                                 content = 'dismiss' />
00046
00047                     </actions>
00048                 </toast>";
00049         }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.cpp Source File

  • UserDataAccountManager
  • cpp

Scenario3_FixAccount.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_FixAccount.xaml.h"
00014
00015 #include <ppltasks.h>
00016
00017 using namespace SDKTemplate;
00018 using namespace concurrency;
00019
00020 using namespace Platform;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Controls::Primitives;
00026 using namespace Windows::UI::Xaml::Data;
00027 using namespace Windows::UI::Xaml::Input;
00028 using namespace Windows::UI::Xaml::Media;
00029 using namespace Windows::UI::Xaml::Navigation;
00030 using namespace Windows::ApplicationModel;
00031 using namespace Windows::ApplicationModel::UserDataAccounts;
00032
00033 Scenario3_FixAccount::Scenario3_FixAccount() : rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036 }
00037
00038 void Scenario3_FixAccount::OnNavigatedTo(NavigationEventArgs^ e)
00039 {
00040     rootPage->LoadDataAccountsAsync(AccountsListComboBox);
00041 }
00042
00043 void Scenario3_FixAccount::Fix_Click(Object^ sender, RoutedEventArgs^ e)
00044 {
00045     auto selectedAccount = safe_cast<UserDataAccountViewModel^>(AccountsListComboBox->SelectedValue);
00046     if (selectedAccount != nullptr)
00047     {
00048         // only one instance of the UserDataAccountManager pane can be launched at once per thread
00049         if (isLaunched == false)
00050         {
00051             isLaunched = true;
00052             rootPage->NotifyUser("", NotifyType::StatusMessage);
00053
00054             auto account = selectedAccount->Account;
00055             IsFixNeededAsync(account).then([this, account](bool result)
00056             {
00057                 if (result)
00058                 {
00059                     return create_task(UserDataAccountManager::ShowAccountErrorResolverAsync(account->Id));
00060                 }
00061                 else
00062                 {
00063                     rootPage->NotifyUser("Account is not in an error state", NotifyType::ErrorMessage);
00064                     return create_task([] {});
00065                 }
00066
00067             }).then([this]()
00068             {
00069                 return rootPage->LoadDataAccountsAsync(AccountsListComboBox);
00070             }).then([this]()
00071             {
00072                 isLaunched = false;
00073             });
00074         }
00075     }
00076 }
00077
00078 /// Check the mailboxes, calendars, and contact lists for sync errors
00079
00080 Concurrency::task<bool> Scenario3_FixAccount::IsFixNeededAsync(UserDataAccount^ account)
00081 {
00082     return create_task(account->FindEmailMailboxesAsync()).then([this, account](IVectorView<Email::EmailMailbox^>^ mailboxes)
00083     {
00084         for (Email::EmailMailbox^ mailbox : mailboxes)
00085         {
00086             if (mailbox->SyncManager != nullptr)
00087             {
00088                 switch (mailbox->SyncManager->Status)
00089                 {
00090                 case Email::EmailMailboxSyncStatus::AuthenticationError:
00091                 case Email::EmailMailboxSyncStatus::PolicyError:
00092                 case Email::EmailMailboxSyncStatus::UnknownError:
00093                     return true;
00094                 }
00095             }
00096         }
00097         return false;
00098     }).then([this, account](bool isFixNeeded)
00099     {
00100         if (isFixNeeded)
00101         {
00102             return create_task([] { return true; });
00103         }
00104         else
00105         {
00106             return create_task(account->FindAppointmentCalendarsAsync()).then([this, account](IVectorView<Appointments::AppointmentCalendar^>^ calendars)
00107             {
00108                 for (Appointments::AppointmentCalendar^ calendar : calendars)
00109                 {
00110                     if (calendar->SyncManager != nullptr)
00111                     {
00112                         switch (calendar->SyncManager->Status)
00113                         {
00114                         case Appointments::AppointmentCalendarSyncStatus::AuthenticationError:
00115                         case Appointments::AppointmentCalendarSyncStatus::PolicyError:
00116                         case Appointments::AppointmentCalendarSyncStatus::UnknownError:
00117                             return true;
00118                         }
00119                     }
00120                 }
00121                 return false;
00122             });
00123         }
00124     }).then([this, account](bool isFixNeeded)
00125     {
00126         if (isFixNeeded)
00127         {
00128             return create_task([] { return true; });
00129         }
00130         else
00131         {
00132             return create_task(account->FindContactListsAsync()).then([this, account](IVectorView<Contacts::ContactList^>^ contacts)
00133             {
00134                 for (Contacts::ContactList^ contactList : contacts)
00135                 {
00136                     if (contactList->SyncManager != nullptr)
00137                     {
00138                         switch (contactList->SyncManager->Status)
00139                         {
00140                         case Contacts::ContactListSyncStatus::AuthenticationError:
00141                         case Contacts::ContactListSyncStatus::PolicyError:
00142                         case Contacts::ContactListSyncStatus::UnknownError:
00143                             return true;
00144                         }
00145                     }
00146                 }
00147                 return false;
00148             });
00149         }
00150     });
00151 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario3_SeekerDiscover.xaml.cpp Source File

  • WiFiDirectServices
  • cpp

Scenario3_SeekerDiscover.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_SeekerDiscover.xaml.h"
00014
00015 using namespace SDKTemplate::WiFiDirectServices;
00016
00017 using namespace Platform;
00018 using namespace Windows::Devices::WiFiDirect::Services;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace std;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 Scenario3::Scenario3() : _rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036 }
00037
00038 void Scenario3::SessionConnected()
00039 {
00040     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00041         ref new DispatchedHandler([this]()
00042         {
00043             // Force navigation to the next page for smoother experience
00044             _rootPage->GoToScenario(3);
00045         }));
00046 }
00047
00048 void Scenario3::UpdateDiscoveryList(IVector<DiscoveredDeviceWrapper^>^ devices)
00049 {
00050     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00051         ref new DispatchedHandler([this, devices]()
00052         {
00053             lock_guard<mutex> lock(_mutex);
00054
00055             DiscoveredServices->Items->Clear();
00056             for (auto&& device : devices)
00057             {
00058                 DiscoveredServices->Items->Append(device);
00059             }
00060         }));
00061 }
00062
00063 void Scenario3::OnNavigatedTo(NavigationEventArgs^ e)
00064 {
00065     lock_guard<mutex> lock(_mutex);
00066     _rootPage = MainPage::Current;
00067
00068     // Cleanup past discoveries
00069     DiscoveredServices->Items->Clear();
00070     _provisioningInfo = nullptr;
00071
00072     UpdateDiscoveryList(WiFiDirectServiceManager::Instance->DiscoveredDevices);
00073     WiFiDirectServiceManager::Instance->CurrentScenario3 = this;
00074 }
00075
00076 void Scenario3::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00077 {
00078     WiFiDirectServiceManager::Instance->CurrentScenario3 = nullptr;
00079 }
00080
00081 void Scenario3::Discover_Click(Object^ sender, RoutedEventArgs^ e)
00082 {
00083     WiFiDirectServiceManager::Instance->DiscoverServicesAsync(
00084         ServiceName->Text,
00085         RequestedServiceInfo->Text
00086         );
00087 }
00088
00089 void Scenario3::GetProvisioningInfo_Click(Object^ sender, RoutedEventArgs^ e)
00090 {
00091     if (DiscoveredServices->Items->Size > 0)
00092     {
00093         int index = DiscoveredServices->SelectedIndex;
00094         if (index >= 0)
00095         {
00096             DiscoveredDeviceWrapper^ service = dynamic_cast<DiscoveredDeviceWrapper^>(DiscoveredServices->Items->GetAt(index));
00097
00098             WiFiDirectServiceConfigurationMethod configMethod = WiFiDirectServiceConfigurationMethod::Default;
00099             auto selectedConfigMethod = dynamic_cast<ComboBoxItem^>(SelectedConfigMethod->SelectedItem);
00100
00101             if (selectedConfigMethod->Content->ToString() == "WFDS Default")
00102             {
00103                 configMethod = WiFiDirectServiceConfigurationMethod::Default;
00104             }
00105             else if (selectedConfigMethod->Content->ToString() == "PIN Keypad")
00106             {
00107                 configMethod = WiFiDirectServiceConfigurationMethod::PinEntry;
00108             }
00109             else if (selectedConfigMethod->Content->ToString() == "PIN Display")
00110             {
00111                 configMethod = WiFiDirectServiceConfigurationMethod::PinDisplay;
00112             }
00113
00114             service->OpenSessionAsync()
00115             .then([this, service]()
00116             {
00117                 return service->SetServiceOptionsAsync(
00118                     (PreferGO->IsChecked != nullptr) ? PreferGO->IsChecked->Value : false,
00119                     SessionInfo->Text
00120                     );
00121             }, Concurrency::task_continuation_context::use_current()).then([this, service, configMethod]()
00122             {
00123                 return service->GetProvisioningInfoAsync(configMethod);
00124             }).then([this](WiFiDirectServiceProvisioningInfo^ provisioningInfo)
00125             {
00126                 _provisioningInfo = provisioningInfo;
00127             }).then([this](Concurrency::task<void> previousTask)
00128             {
00129                 try
00130                 {
00131                     // Try getting all exceptions from the continuation chain above this point.
00132                     previousTask.get();
00133                 }
00134                 catch (Exception^ ex)
00135                 {
00136                     _rootPage->NotifyUser("GetProvisioningInfoAsync Failed: " + ex->Message, NotifyType::ErrorMessage);
00137                 }
00138             }, Concurrency::task_continuation_context::use_current());
00139         }
00140     }
00141 }
00142
00143 void Scenario3::DoConnect_Click(Object^ sender, RoutedEventArgs^ e)
00144 {
00145     if (DiscoveredServices->Items->Size > 0)
00146     {
00147         int index = DiscoveredServices->SelectedIndex;
00148         if (index >= 0)
00149         {
00150             DiscoveredDeviceWrapper^ service = dynamic_cast<DiscoveredDeviceWrapper^>(DiscoveredServices->Items->GetAt(index));
00151
00152             service->SetServiceOptionsAsync(
00153                 (PreferGO->IsChecked != nullptr) ? PreferGO->IsChecked->Value : false,
00154                 SessionInfo->Text
00155                 )
00156             .then([this, service]()
00157             {
00158                 if (_provisioningInfo != nullptr &&
00159                     _provisioningInfo->IsGroupFormationNeeded &&
00160                     _provisioningInfo->SelectedConfigurationMethod != WiFiDirectServiceConfigurationMethod::Default)
00161                 {
00162                     // These are the conditions under which a PIN is required
00163                     return service->ConnectAsync(ConnectPin->Text);
00164                 }
00165                 else
00166                 {
00167                     // No PIN required
00168                     return service->ConnectAsync();
00169                 }
00170             }, Concurrency::task_continuation_context::use_current()).then([this](Concurrency::task<void> previousTask)
00171             {
00172                 try
00173                 {
00174                     // Try getting all exceptions from the continuation chain above this point.
00175                     previousTask.get();
00176                 }
00177                 catch (Exception^ ex)
00178                 {
00179                     _rootPage->NotifyUser("ConnectAsync Failed: " + ex->Message, NotifyType::ErrorMessage);
00180                 }
00181             }, Concurrency::task_continuation_context::use_current());
00182         }
00183     }
00184 }
Generated on Fri Nov 15 2024 22:22:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PhotosPrintHelper Member List

This is the complete list of members for PhotosPrintHelper, including all inherited members.
AddOnePrintPreviewPage(RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription) | PrintHelper | [inline, protected, virtual]
AddPrintPages(object sender, AddPagesEventArgs e) | PhotosPrintHelper | [inline, protected, virtual]
ApplicationContentMarginLeft | PrintHelper | [protected]
ApplicationContentMarginTop | PrintHelper | [protected]
ClearPageCollection() | PhotosPrintHelper | [inline, private]
CreatePrintPreviewPages(object sender, Windows.UI.Xaml.Printing.PaginateEventArgs e) | PhotosPrintHelper | [inline, protected]
PrintSample::PrintHelper::CreatePrintPreviewPages(object sender, PaginateEventArgs e) | PrintHelper | [inline, protected, virtual]
currentPageDescription | PhotosPrintHelper | [private]
DPI96 | PhotosPrintHelper | [private]
firstPage | PrintHelper | [protected]
GeneratePageAsync(int photoNumber, PageDescription pageDescription) | PhotosPrintHelper | [inline, private]
GetPrintPreviewPage(object sender, GetPreviewPageEventArgs e) | PhotosPrintHelper | [inline, protected, virtual]
LoadBitmapAsync(Uri source, bool landscape) | PhotosPrintHelper | [inline, private]
NumberOfPhotos | PhotosPrintHelper | [private]
pageCollection | PhotosPrintHelper | [private]
photoScale | PhotosPrintHelper | [private]
photoSize | PhotosPrintHelper | [private]
PhotosPrintHelper(Page scenarioPage) | PhotosPrintHelper | [inline]
PreparePrintContent(Page page) | PrintHelper | [inline, virtual]
PreviewPagesCreated | PrintHelper | [protected]
PrintCanvas | PrintHelper | [protected]
PrintDetailedOptionsOptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args) | PhotosPrintHelper | [inline, private]
printDocument | PrintHelper | [protected]
printDocumentSource | PrintHelper | [protected]
PrintHelper(Page scenarioPage) | PrintHelper | [inline]
printSync | PhotosPrintHelper | [private, static]
PrintTaskRequested(Windows.Graphics.Printing.PrintManager sender, Windows.Graphics.Printing.PrintTaskRequestedEventArgs e) | PhotosPrintHelper | [inline, protected]
PrintSample::PrintHelper::PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e) | PrintHelper | [inline, protected, virtual]
RegisterForPrinting() | PrintHelper | [inline, virtual]
requestCount | PhotosPrintHelper | [private]
scenarioPage | PrintHelper | [protected]
ShowPrintUIAsync() | PrintHelper | [inline]
Swap< T >(ref T v1, ref T v2) | PhotosPrintHelper | [inline, private, static]
UnregisterForPrinting() | PrintHelper | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario4_Input.cpp Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario4_Input.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_Input.h"
00014 #include "Scenario4_Input.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario4_Input::Scenario4_Input()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     void Scenario4_Input::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         // This scenario uses the Windows.Globalization.Language class to obtain the user's current
00031         // input language.  The language tag returned reflects the current input language specified
00032         // by the user.
00033         hstring userInputLanguage = Language::CurrentInputMethodLanguageTag();
00034
00035         // Display the results
00036         OutputTextBlock().Text(L"User's current input language: " + userInputLanguage);
00037     }
00038 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaImport/cs/ImportableItemWrapper.cs Source File

  • MediaImport
  • cs

ImportableItemWrapper.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Diagnostics;
00005 using System.Linq;
00006 using System.Text;
00007 using System.Threading.Tasks;
00008 using Windows.Media.Import;
00009 using Windows.Storage;
00010 using Windows.UI.Xaml.Media.Imaging;
00011
00012 namespace ImportSample
00013 {
00014     /// <summary>
00015     /// Wrapper for the thumbnail and the ImportableItem
00016     /// </summary>
00017     class ImportableItemWrapper : INotifyPropertyChanged
00018     {
00019         private BitmapImage thumbnail;
00020         public BitmapImage Thumbnail
00021         {
00022             get
00023             {
00024                 return thumbnail;
00025             }
00026             private set
00027             {
00028                 if (thumbnail != value)
00029                 {
00030                     thumbnail = value;
00031                     NotifyProperty("Thumbnail");
00032                 }
00033             }
00034         }
00035
00036         public PhotoImportItem ImportableItem
00037         {
00038             get;
00039             private set;
00040         }
00041
00042         public ImportableItemWrapper(PhotoImportItem importableItem)
00043         {
00044             ImportableItem = importableItem;
00045             LoadThumbnail();
00046         }
00047
00048         public event PropertyChangedEventHandler PropertyChanged;
00049
00050         private void NotifyProperty(string propertyName)
00051         {
00052             this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
00053         }
00054
00055         public async void LoadThumbnail()
00056         {
00057            var thumbnailResult = await ImportableItem.Thumbnail.OpenReadAsync();
00058
00059            // if there is contention accessing the device the thumbnail will be null.
00060            if (thumbnailResult != null)
00061            {
00062                 var thumb = new BitmapImage();
00063                 thumb.SetSource(thumbnailResult);
00064                 this.Thumbnail = thumb;
00065            }
00066         }
00067     }
00068 }
Generated on Fri Nov 15 2024 22:20:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/ReinhardEffect.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

ReinhardEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 DEFINE_GUID(GUID_ReinhardEffectPixelShader, 0x6716FB29, 0x06A0, 0x460F, 0xAA, 0x9C, 0x8B, 0x8F, 0xF0, 0x33, 0x5E, 0xA6);
00013 DEFINE_GUID(CLSID_CustomReinhardEffect, 0xB7B36C92, 0x3498, 0x4A94, 0x9E, 0x95, 0x9F, 0x24, 0x6F, 0x92, 0x45, 0xBF);
00014
00015 // Our effect contains one transform, which is simply a wrapper around a pixel shader. As such,
00016 // we can simply make the effect itself act as the transform.
00017 class ReinhardEffect : public ID2D1EffectImpl, public ID2D1DrawTransform
00018 {
00019 public:
00020     // Declare effect registration methods.
00021     static HRESULT Register(_In_ ID2D1Factory1* pFactory);
00022
00023     static HRESULT __stdcall CreateReinhardImpl(_Outptr_ IUnknown** ppEffectImpl);
00024
00025     // Declare ID2D1EffectImpl implementation methods.
00026     IFACEMETHODIMP Initialize(
00027         _In_ ID2D1EffectContext* pContextInternal,
00028         _In_ ID2D1TransformGraph* pTransformGraph
00029         );
00030
00031     IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE changeType);
00032
00033     IFACEMETHODIMP SetGraph(_In_ ID2D1TransformGraph* pGraph);
00034
00035     // Declare ID2D1DrawTransform implementation methods.
00036     IFACEMETHODIMP SetDrawInfo(_In_ ID2D1DrawInfo* pRenderInfo);
00037
00038     // Declare ID2D1Transform implementation methods.
00039     IFACEMETHODIMP MapOutputRectToInputRects(
00040         _In_ const D2D1_RECT_L* pOutputRect,
00041         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00042         UINT32 inputRectCount
00043         ) const;
00044
00045     IFACEMETHODIMP MapInputRectsToOutputRect(
00046         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00047         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00048         UINT32 inputRectCount,
00049         _Out_ D2D1_RECT_L* pOutputRect,
00050         _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00051         );
00052
00053     IFACEMETHODIMP MapInvalidRect(
00054         UINT32 inputIndex,
00055         D2D1_RECT_L invalidInputRect,
00056         _Out_ D2D1_RECT_L* pInvalidOutputRect
00057         ) const;
00058
00059     // Declare ID2D1TransformNode implementation methods.
00060     IFACEMETHODIMP_(UINT32) GetInputCount() const;
00061
00062     // Declare IUnknown implementation methods.
00063     IFACEMETHODIMP_(ULONG) AddRef();
00064     IFACEMETHODIMP_(ULONG) Release();
00065     IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppOutput);
00066
00067 private:
00068     ReinhardEffect();
00069     HRESULT UpdateConstants();
00070
00071     inline static float Clamp(float v, float low, float high)
00072     {
00073         return (v < low) ? low : (v > high) ? high : v;
00074     }
00075
00076     inline static float Round(float v)
00077     {
00078         return floor(v + 0.5f);
00079     }
00080
00081     // Prevents over/underflows when adding longs.
00082     inline static long SafeAdd(long base, long valueToAdd)
00083     {
00084         if (valueToAdd >= 0)
00085         {
00086             return ((base + valueToAdd) >= base) ? (base + valueToAdd) : LONG_MAX;
00087         }
00088         else
00089         {
00090             return ((base + valueToAdd) <= base) ? (base + valueToAdd) : LONG_MIN;
00091         }
00092     }
00093
00094     // This struct defines the constant buffer of our pixel shader.
00095     struct
00096     {
00097         float dpi;
00098     } m_constants;
00099
00100     Microsoft::WRL::ComPtr<ID2D1DrawInfo>      m_drawInfo;
00101     Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext;
00102     LONG                                       m_refCount;
00103     D2D1_RECT_L                                m_inputRect;
00104     float                                      m_dpi;
00105 };
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/pch.h Source File

  • BasicFaceTracking
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Graphics.Imaging.h"
00008 #include "winrt/Windows.Media.h"
00009 #include "winrt/Windows.Media.Capture.h"
00010 #include "winrt/Windows.Media.Devices.h"
00011 #include "winrt/Windows.Media.FaceAnalysis.h"
00012 #include "winrt/Windows.Media.MediaProperties.h"
00013 #include "winrt/Windows.System.Threading.h"
00014 #include "winrt/Windows.System.h"
00015 #include "winrt/Windows.UI.h"
00016 #include "winrt/Windows.UI.Core.h"
00017 #include "winrt/Windows.UI.Xaml.h"
00018 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00019 #include "winrt/Windows.UI.Xaml.Controls.h"
00020 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00021 #include "winrt/Windows.UI.Xaml.Documents.h"
00022 #include "winrt/Windows.UI.Xaml.Interop.h"
00023 #include "winrt/Windows.UI.Xaml.Markup.h"
00024 #include "winrt/Windows.UI.Xaml.Media.h"
00025 #include "winrt/Windows.UI.Xaml.Media.Imaging.h"
00026 #include "winrt/Windows.UI.Xaml.Navigation.h"
00027 #include "winrt/Windows.UI.Xaml.Shapes.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererMain.cpp Source File

  • DWriteColorGlyph
  • cpp

DWriteColorTextRendererMain.cpp

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #include "pch.h"
00009 #include "DWriteColorTextRendererMain.h"
00010
00011 #include <DirectXColors.h>
00012 #include "DirectXHelper.h"
00013
00014 using namespace DWriteColorTextRenderer;
00015
00016 // Loads and initializes application assets when the application is loaded.
00017 DWriteColorTextRendererMain::DWriteColorTextRendererMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00018     m_deviceResources(deviceResources)
00019 {
00020     // Register to be notified if the Device is lost or recreated.
00021     m_deviceResources->RegisterDeviceNotify(this);
00022
00023     m_sceneRenderer = std::unique_ptr<DWriteColorTextRendererRenderer>(new DWriteColorTextRendererRenderer(m_deviceResources));
00024     m_sampleOverlay = std::unique_ptr<SampleOverlay>(new SampleOverlay(m_deviceResources, L"Direct2D color fonts sample"));
00025 }
00026
00027 DWriteColorTextRendererMain::~DWriteColorTextRendererMain()
00028 {
00029     // Deregister device notification.
00030     m_deviceResources->RegisterDeviceNotify(nullptr);
00031 }
00032
00033 // Updates application state when the window size changes (e.g. device orientation change)
00034 void DWriteColorTextRendererMain::UpdateForWindowSizeChange()
00035 {
00036     m_sceneRenderer->CreateWindowSizeDependentResources();
00037     m_sampleOverlay->CreateWindowSizeDependentResources();
00038 }
00039
00040 // Renders the current frame according to the current application state.
00041 // Returns true if the frame was rendered and is ready to be displayed.
00042 bool DWriteColorTextRendererMain::Render()
00043 {
00044     // Render the scene objects.
00045     m_sceneRenderer->Render();
00046     m_sampleOverlay->Render();
00047
00048     return true;
00049 }
00050
00051 // Notifies renderers that device resources need to be released.
00052 void DWriteColorTextRendererMain::OnDeviceLost()
00053 {
00054     m_sceneRenderer->ReleaseDeviceDependentResources();
00055     m_sampleOverlay->ReleaseDeviceDependentResources();
00056 }
00057
00058 // Notifies renderers that device resources may now be re-created.
00059 void DWriteColorTextRendererMain::OnDeviceRestored()
00060 {
00061     m_sceneRenderer->CreateDeviceDependentResources();
00062     m_sampleOverlay->CreateDeviceDependentResources();
00063     UpdateForWindowSizeChange();
00064 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/GeofenceBackgroundTask.cpp Source File

  • Geolocation
  • cppwinrt
  • Tasks

GeofenceBackgroundTask.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "Helpers.h"
00003 #include "GeofenceBackgroundTask.h"
00004 #include "GeofenceBackgroundTask.g.cpp"
00005
00006 using namespace winrt;
00007 using namespace winrt::Windows::ApplicationModel::Background;
00008 using namespace winrt::Windows::Data::Json;
00009 using namespace winrt::Windows::Devices::Geolocation;
00010 using namespace winrt::Windows::Devices::Geolocation::Geofencing;
00011 using namespace winrt::Windows::Foundation;
00012 using namespace winrt::Windows::Foundation::Collections;
00013 using namespace winrt::Windows::Storage;
00014 using namespace winrt::Windows::UI::Notifications;
00015
00016 namespace winrt::BackgroundTask::implementation
00017 {
00018     void GeofenceBackgroundTask::Run(IBackgroundTaskInstance const& taskInstance)
00019     {
00020         BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
00021
00022         try
00023         {
00024             ProcessGeofenceStateChangedReports();
00025         }
00026         catch (hresult_access_denied const&)
00027         {
00028             // Report the error as "Status".
00029             m_values.Insert(L"Status", box_value(L"Location permissions are disabled. Enable access through Settings."));
00030             m_values.TryRemove(L"BackgroundGeofenceEventCollection");
00031         }
00032         deferral.Complete();
00033     }
00034
00035     void GeofenceBackgroundTask::ProcessGeofenceStateChangedReports()
00036     {
00037         // Load the values saved from last time.
00038         JsonArray geofenceBackgroundEvents = LoadSavedJson(L"BackgroundGeofenceEventCollection");
00039
00040         // Process the state changes that have occurred since the last time we ran.
00041         hstring description;
00042         GeofenceMonitor monitor = GeofenceMonitor::Current();
00043         IVectorView<GeofenceStateChangeReport> reports = monitor.ReadReports();
00044         for (GeofenceStateChangeReport report : reports)
00045         {
00046             description = GenerateReportDescription(report);
00047
00048             // Add to the collection, trimming old events if necessary.
00049             if (geofenceBackgroundEvents.Size() == maxEventDescriptors)
00050             {
00051                 geofenceBackgroundEvents.RemoveAtEnd();
00052             }
00053
00054             geofenceBackgroundEvents.InsertAt(0, JsonValue::CreateStringValue(description));
00055         }
00056
00057         uint32_t numReports = reports.Size();
00058         if (numReports > 0)
00059         {
00060             // Save the modified results for next time.
00061             m_values.Insert(L"BackgroundGeofenceEventCollection", box_value(geofenceBackgroundEvents.Stringify()));
00062
00063             if (numReports > 1)
00064             {
00065                 description = L"There are " + to_hstring(numReports) + L" new geofence events";
00066             }
00067             DisplayToast(description);
00068         }
00069     }
00070
00071     hstring GeofenceBackgroundTask::GenerateReportDescription(GeofenceStateChangeReport const& report)
00072     {
00073         GeofenceState state = report.NewState();
00074
00075         DateTime timestamp = report.Geoposition().Coordinate().Timestamp();
00076         hstring result = report.Geofence().Id() + L" " + FormatDateTime(timestamp, L"shortdate shorttime");
00077
00078         if (state == GeofenceState::Removed)
00079         {
00080             GeofenceRemovalReason reason = report.RemovalReason();
00081             if (reason == GeofenceRemovalReason::Expired)
00082             {
00083                 result = result + L" (Removed/Expired)";
00084             }
00085             else if (reason == GeofenceRemovalReason::Used)
00086             {
00087                 result = result + L" (Removed/Used)";
00088             }
00089         }
00090         else if (state == GeofenceState::Entered)
00091         {
00092             result = result + L" (Entered)";
00093         }
00094         else if (state == GeofenceState::Exited)
00095         {
00096             result = result + L" (Exited)";
00097         }
00098
00099         return result;
00100     }
00101 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/pch.h Source File

  • UserInfo
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Storage.Streams.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00014 #include "winrt/Windows.UI.Xaml.Data.h"
00015 #include "winrt/Windows.UI.Xaml.Documents.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Media.Imaging.h"
00020 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ApduResponse Member List

This is the complete list of members for ApduResponse, including all inherited members.
ApduResponse() | ApduResponse | [inline]
ExtractResponse(IBuffer response) | ApduResponse | [inline, virtual]
ExtractTlvDataObject(byte[] referenceTag) | ApduResponse | [inline]
ResponseData | ApduResponse |
Succeeded | ApduResponse |
SW | ApduResponse |
SW1 | ApduResponse |
SW2 | ApduResponse |
SWTranslation | ApduResponse |
TAG_COMPREHENSION_MASK | ApduResponse |
TAG_LENGTH_MULTI_BYTE_MASK | ApduResponse |
TAG_MULTI_BYTE_MASK | ApduResponse |
ToString() | ApduResponse | [inline]
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/MifareStandardCommands.cs Source File

  • Nfc
  • PcscSdk

MifareStandardCommands.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013
00014 namespace MifareStandard
00015 {
00016     /// <summary>
00017     /// Mifare Standard Read commad when sent to the card the card is expected to return 16 bytes
00018     /// </summary>
00019     public class Read : Pcsc.ReadBinary
00020     {
00021         public Read(ushort address)
00022             : base(address, 16)
00023         {
00024         }
00025     }
00026     /// <summary>
00027     /// Mifare Standard Write commad when sent to the card, writes 16 bytes at a time
00028     /// </summary>
00029     public class Write : Pcsc.UpdateBinary
00030     {
00031         public byte[] Data
00032         {
00033             set { base.CommandData = ((value.Length != 16) ? ResizeArray(value, 16) : value); }
00034             get { return base.CommandData; }
00035         }
00036         private static byte[] ResizeArray(byte[] data, int size)
00037         {
00038             Array.Resize<byte>(ref data, size);
00039             return data;
00040         }
00041         public Write(byte address, ref byte[] data)
00042             : base(address, ((data.Length != 16) ? ResizeArray(data, 16) : data))
00043         {
00044         }
00045     }
00046     /// <summary>
00047     /// Mifare Standard GetUid command
00048     /// </summary>
00049     public class GetUid : Pcsc.GetUid
00050     {
00051         public GetUid()
00052             : base()
00053         {
00054         }
00055     }
00056     /// <summary>
00057     /// Mifare Standard GetHistoricalBytes command
00058     /// </summary>
00059     public class GetHistoricalBytes : Pcsc.GetHistoricalBytes
00060     {
00061         public GetHistoricalBytes()
00062             : base()
00063         {
00064         }
00065     }
00066     /// <summary>
00067     /// Mifare Standard Load Keys commad which stores the supplied key into the specified numbered key slot
00068     /// for subsequent use by the General Authenticate command.
00069     /// </summary>
00070     public class LoadKey : Pcsc.LoadKeys
00071     {
00072         public LoadKey(byte[] mifareKey, byte keySlotNumber)
00073             : base(LoadKeysKeyType.CardKey, null, LoadKeysTransmissionType.Plain, LoadKeysStorageType.Volatile, keySlotNumber, mifareKey)
00074         {
00075         }
00076     }
00077     /// <summary>
00078     /// Mifare Standard GetHistoricalBytes command
00079     /// </summary>
00080     public class GeneralAuthenticate : Pcsc.GeneralAuthenticate
00081     {
00082         public GeneralAuthenticate(ushort address, byte keySlotNumber, GeneralAuthenticateKeyType keyType)
00083             : base(GeneralAuthenticateVersionNumber.VersionOne, address, keyType, keySlotNumber)
00084         {
00085             if (keyType != GeneralAuthenticateKeyType.MifareKeyA && keyType != GeneralAuthenticateKeyType.PicoTagPassKeyB)
00086             {
00087                 throw new Exception("Invalid key type for MIFARE Standard General Authenticate");
00088             }
00089         }
00090     }
00091     /// <summary>
00092     /// Mifare response APDU
00093     /// </summary>
00094     public class ApduResponse : Pcsc.ApduResponse
00095     {
00096         public ApduResponse()
00097             : base()
00098         {
00099         }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • AdaptiveTemplates
  • Image
  • Src
  • FromAppData

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.Storage;
00003 using Windows.UI.Notifications;
00004 using Windows.UI.Popups;
00005 using Windows.UI.Xaml;
00006 using Windows.UI.Xaml.Controls;
00007 using Windows.UI.Xaml.Media.Imaging;
00008
00009 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00010
00011 namespace Notifications.ScenarioPages.Toasts.AdaptiveTemplates.Image.Src.FromAppData
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public sealed partial class ScenarioElement : UserControl
00017     {
00018         private static readonly string FILE_NAME = typeof(ScenarioElement).FullName + ".jpg";
00019         private static readonly string ABSOLUTE_FILE_NAME = "ms-appdata:///local/" + FILE_NAME;
00020
00021         public ScenarioElement()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00027         {
00028             Initialize();
00029         }
00030
00031         private async void Initialize()
00032         {
00033             // Clear all existing notifications
00034             ToastNotificationManager.History.Clear();
00035
00036             // Load the image from our package files
00037             StorageFile fromPackage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ScenarioPages/Toasts/AdaptiveTemplates/Image/Src/FromAppData/Image.jpg"));
00038             if (fromPackage == null)
00039             {
00040                 Error("Failed to open image from application package. Normally, this would open the image from the app package, and then save it to local app data.");
00041                 return;
00042             }
00043
00044             try
00045             {
00046                 await fromPackage.CopyAsync(ApplicationData.Current.LocalFolder, FILE_NAME, NameCollisionOption.ReplaceExisting);
00047             }
00048
00049             catch
00050             {
00051                 Error("Failed to copy the image from application package to local app data.");
00052                 return;
00053             }
00054
00055             image.Source = new BitmapImage(new Uri(ABSOLUTE_FILE_NAME));
00056
00057             // Pop notifications
00058             popToastControl.Payload =
00059                 $@"
00060                 <toast scenario='reminder'>
00061                     <visual>
00062                         <binding template='ToastGeneric'>
00063                             <text>Image Src - From App Data</text>
00064                             <text>Make sure an image is displayed below this text.</text>
00065                             <image src='{ABSOLUTE_FILE_NAME}'/>
00066                         </binding>
00067                     </visual>
00068                 </toast>";
00069         }
00070
00071         private async void Error(string message)
00072         {
00073             await new MessageDialog(message, "ERROR").ShowAsync();
00074         }
00075     }
00076 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/App.xaml.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks

App.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "App.g.h"
00015 #include "ViewModel\ViewModelLocator.h"
00016
00017 namespace AdventureWorks
00018 {
00019     /// <summary>
00020     /// Provides application-specific behavior to supplement the default Application class.
00021     /// </summary>
00022     ref class App sealed
00023     {
00024     protected:
00025         virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
00026         virtual void OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs^ e) override;
00027
00028     internal:
00029         App();
00030
00031     private:
00032         void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
00033         void OnNavigated(Platform::Object^ sender, Windows::UI::Xaml::Navigation::NavigationEventArgs^ e);
00034         void OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e);
00035
00036         Platform::String^ SemanticInterpretation(Platform::String^ tag, Windows::Media::SpeechRecognition::SpeechRecognitionResult^ result);
00037     };
00038 }
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario2_Polling.xaml.cpp Source File

  • OrientationSensor
  • cpp

Scenario2_Polling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2_Polling.xaml.cpp
00014 // Implementation of the Scenario2_Polling class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2_Polling.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario2_Polling::Scenario2_Polling() : rootPage(MainPage::Current), desiredReportInterval(0)
00031 {
00032     InitializeComponent();
00033 }
00034
00035 void Scenario2_Polling::OnNavigatedTo(NavigationEventArgs^ e)
00036 {
00037     sensor = OrientationSensor::GetDefault();
00038     if (sensor != nullptr)
00039     {
00040         // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00041         // This value will be used later to activate the sensor.
00042         desiredReportInterval = (std::max)(sensor->MinimumReportInterval, 16U);
00043
00044         // Set up a DispatchTimer
00045         TimeSpan span;
00046         span.Duration = static_cast<int32>(desiredReportInterval) * 10000;   // convert to 100ns ticks
00047         dispatcherTimer = ref new DispatcherTimer();
00048         dispatcherTimer->Interval = span;
00049         dispatcherTimer->Tick += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2_Polling::DisplayCurrentReading);
00050
00051         rootPage->NotifyUser(rootPage->SensorDescription + " is ready", NotifyType::StatusMessage);
00052         ScenarioEnableButton->IsEnabled = true;
00053     }
00054     else
00055     {
00056         rootPage->NotifyUser(rootPage->SensorDescription + " not found", NotifyType::ErrorMessage);
00057     }
00058 }
00059
00060 void Scenario2_Polling::OnNavigatedFrom(NavigationEventArgs^ e)
00061 {
00062     if (ScenarioDisableButton->IsEnabled)
00063     {
00064         ScenarioDisable();
00065     }
00066 }
00067
00068 /// <summary>
00069 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00070 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00071 /// </summary>
00072 /// <param name="sender"></param>
00073 /// <param name="e">
00074 /// Event data that can be examined for the current visibility state.
00075 /// </param>
00076 void Scenario2_Polling::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00077 {
00078     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00079     if (ScenarioDisableButton->IsEnabled)
00080     {
00081         if (e->Visible)
00082         {
00083             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00084             dispatcherTimer->Start();
00085         }
00086         else
00087         {
00088             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00089             dispatcherTimer->Stop();
00090         }
00091     }
00092 }
00093
00094 void Scenario2_Polling::DisplayCurrentReading(Object^ sender, Object^ e)
00095 {
00096     OrientationSensorReading^ reading = sensor->GetCurrentReading();
00097     if (reading != nullptr)
00098     {
00099         MainPage::SetReadingText(ScenarioOutput, reading);
00100     }
00101 }
00102
00103 void Scenario2_Polling::ScenarioEnable()
00104 {
00105     visibilityToken = Window::Current->VisibilityChanged += ref new WindowVisibilityChangedEventHandler(this, &Scenario2_Polling::VisibilityChanged);
00106
00107     // Set the report interval to enable the sensor for polling
00108     sensor->ReportInterval = desiredReportInterval;
00109
00110     dispatcherTimer->Start();
00111
00112     ScenarioEnableButton->IsEnabled = false;
00113     ScenarioDisableButton->IsEnabled = true;
00114 }
00115
00116 void Scenario2_Polling::ScenarioDisable()
00117 {
00118     Window::Current->VisibilityChanged -= visibilityToken;
00119
00120     dispatcherTimer->Stop();
00121
00122     // Restore the default report interval to release resources while the sensor is not in use
00123     sensor->ReportInterval = 0;
00124
00125     ScenarioEnableButton->IsEnabled = true;
00126     ScenarioDisableButton->IsEnabled = false;
00127 }
Generated on Fri Nov 15 2024 22:17:42 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cpp/Scenario1_Colors.xaml.h Source File

  • TitleBar
  • cpp

Scenario1_Colors.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Colors.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_Colors sealed
00024     {
00025     public:
00026         Scenario1_Colors();
00027
00028     private:
00029         void UseCustomColors_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs e)
00030         {
00031             UpdateColors();
00032         }
00033
00034         void UpdateColors();
00035         void ReportColors();
00036
00037     private:
00038         MainPage^ rootPage;
00039         Windows::UI::ViewManagement::ApplicationViewTitleBar^ titleBar;
00040     };
00041 }
Generated on Fri Nov 15 2024 22:21:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SingleMicrosoftAccountScenario Member List

This is the complete list of members for SingleMicrosoftAccountScenario, including all inherited members.
AccountClientId | SingleMicrosoftAccountScenario | [private]
AccountScopeRequested | SingleMicrosoftAccountScenario | [private]
AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
AddWebAccount(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
AddWebAccountProvider(AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
Button_Reset(object sender, RoutedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
Button_ShowAccountSettings(object sender, RoutedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
ConsumerAuthority | SingleMicrosoftAccountScenario | [private]
LogoffAndRemoveAccount() | SingleMicrosoftAccountScenario | [inline, private]
MicrosoftAccountProviderId | SingleMicrosoftAccountScenario | [private]
OnAccountCommandsRequested(AccountsSettingsPane sender, AccountsSettingsPaneCommandsRequestedEventArgs e) | SingleMicrosoftAccountScenario | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | SingleMicrosoftAccountScenario | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | SingleMicrosoftAccountScenario | [inline, protected]
OtherLinkInvoked(IUICommand command) | SingleMicrosoftAccountScenario | [inline, private]
OutputTokenResult(WebTokenRequestResult result) | SingleMicrosoftAccountScenario | [inline, private]
PrivacyPolicyInvoked(IUICommand command) | SingleMicrosoftAccountScenario | [inline, private]
RequestTokenAndSaveAccount(WebAccountProvider Provider, String Scope, String ClientID) | SingleMicrosoftAccountScenario | [inline, private]
rootPage | SingleMicrosoftAccountScenario | [private]
SingleMicrosoftAccountScenario() | SingleMicrosoftAccountScenario | [inline]
StoredAccountKey | SingleMicrosoftAccountScenario | [private]
WebAccountInvoked(WebAccountCommand command, WebAccountInvokedArgs args) | SingleMicrosoftAccountScenario | [inline, private]
WebAccountProviderCommandInvoked(WebAccountProviderCommand command) | SingleMicrosoftAccountScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario3_Send.xaml.cs Source File

  • StreamSocket
  • cs

Scenario3_Send.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Diagnostics;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Sockets;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace StreamSocketSample
00024 {
00025     /// <summary>
00026     /// A page for third scenario.
00027     /// </summary>
00028     public sealed partial class Scenario3 : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public Scenario3()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046         }
00047
00048         /// <summary>
00049         /// This is the click handler for the 'SendHello' button.
00050         /// </summary>
00051         /// <param name="sender">Object for which the event was generated.</param>
00052         /// <param name="e">Event's parameters.</param>
00053         private async void SendHello_Click(object sender, RoutedEventArgs e)
00054         {
00055             if (!CoreApplication.Properties.ContainsKey("connected"))
00056             {
00057                 rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
00058                 return;
00059             }
00060
00061             object outValue;
00062             StreamSocket socket;
00063             if (!CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
00064             {
00065                 rootPage.NotifyUser("Please run previous steps before doing this one.", NotifyType.ErrorMessage);
00066                 return;
00067             }
00068
00069             socket = (StreamSocket)outValue;
00070
00071             // Create a DataWriter if we did not create one yet. Otherwise use one that is already cached.
00072             DataWriter writer;
00073             if (!CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
00074             {
00075                 writer = new DataWriter(socket.OutputStream);
00076                 CoreApplication.Properties.Add("clientDataWriter", writer);
00077             }
00078             else
00079             {
00080                 writer = (DataWriter)outValue;
00081             }
00082
00083             // Write first the length of the string as UINT32 value followed up by the string.
00084             // Writing data to the writer will just store data in memory.
00085             string stringToSend = "Hello";
00086             writer.WriteUInt32(writer.MeasureString(stringToSend));
00087             writer.WriteString(stringToSend);
00088
00089             // Write the locally buffered data to the network.
00090             try
00091             {
00092                 await writer.StoreAsync();
00093                 SendOutput.Text = "\"" + stringToSend + "\" sent successfully.";
00094             }
00095             catch (Exception exception)
00096             {
00097                 // If this is an unknown status it means that the error if fatal and retry will likely fail.
00098                 if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
00099                 {
00100                     throw;
00101                 }
00102
00103                 rootPage.NotifyUser("Send failed with error: " + exception.Message, NotifyType.ErrorMessage);
00104             }
00105         }
00106     }
00107 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Utilities Member List

This is the complete list of members for Utilities, including all inherited members.
GetDeviceType(UsbDevice device) | Utilities | [inline, static]
IsSuperMuttDevice(UsbDevice device) | Utilities | [inline, static]
NotifyDeviceNotConnected() | Utilities | [inline, static]
SetUpDeviceScenarios(Dictionary< DeviceType, UIElement > scenarios, UIElement scenarioContainer) | Utilities | [inline, static]
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/DirectXHelper.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

DirectXHelper.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "Common\DirectXHelper.h"
00003 #include "Common\DeviceResources.h"
00004
00005 using namespace Microsoft::WRL;
00006
00007 ComPtr<ID3D11VertexShader> DX::CreateVertexShader(
00008     ID3D11Device* device,
00009     const void* data,
00010     size_t dataSize)
00011 {
00012     if (dataSize > std::numeric_limits<UINT>::max())
00013     {
00014         throw std::invalid_argument("size is larger than UINT");
00015     }
00016
00017     ComPtr<ID3D11VertexShader> result;
00018     DX::ThrowIfFailed(device->CreateVertexShader(
00019         data,
00020         static_cast<UINT>(dataSize),
00021         nullptr,
00022         &result));
00023
00024     return result;
00025 }
00026
00027 ComPtr<ID3D11PixelShader> DX::CreatePixelShader(
00028     ID3D11Device* device,
00029     const void* data,
00030     size_t dataSize)
00031 {
00032     if (dataSize > std::numeric_limits<UINT>::max())
00033     {
00034         throw std::invalid_argument("size is larger than UINT");
00035     }
00036
00037     ComPtr<ID3D11PixelShader> result;
00038     DX::ThrowIfFailed(device->CreatePixelShader(
00039         data,
00040         static_cast<UINT>(dataSize),
00041         nullptr,
00042         &result));
00043
00044     return result;
00045 }
00046
00047 ComPtr<ID3D11InputLayout> DX::CreateInputLayout(
00048     ID3D11Device* device,
00049     const D3D11_INPUT_ELEMENT_DESC* vertexDesc,
00050     size_t vertexDescCount,
00051     const void* vertexShaderData,
00052     size_t vertexShaderDataSize)
00053 {
00054     if (vertexShaderDataSize > std::numeric_limits<UINT>::max() ||
00055         vertexDescCount > std::numeric_limits<UINT>::max())
00056     {
00057         throw std::invalid_argument("size is larger than UINT");
00058     }
00059
00060     ComPtr<ID3D11InputLayout> result;
00061     DX::ThrowIfFailed(device->CreateInputLayout(
00062         vertexDesc,
00063         static_cast<UINT>(vertexDescCount),
00064         vertexShaderData,
00065         static_cast<UINT>(vertexShaderDataSize),
00066         &result));
00067
00068     return result;
00069 }
00070
00071 ComPtr<ID3D11SamplerState> DX::CreateSamplerState(
00072     ID3D11Device* device,
00073     const D3D11_SAMPLER_DESC& samplerDesc)
00074 {
00075     ComPtr<ID3D11SamplerState> result;
00076
00077     DX::ThrowIfFailed(device->CreateSamplerState(
00078         &samplerDesc,
00079         &result));
00080
00081     return result;
00082 }
00083
00084 ComPtr<ID3D11Texture2D> DX::CreateTexture(
00085     ID3D11Device* device,
00086     UINT width,
00087     UINT height,
00088     DXGI_FORMAT format,
00089     std::optional<DX::TextureData> textureData,
00090     std::optional<UINT> bindFlags,
00091     std::optional<D3D11_USAGE> usage,
00092     std::optional<UINT> cpuFlags)
00093 {
00094     const CD3D11_TEXTURE2D_DESC desc{
00095         format,
00096         width,
00097         height,
00098         1u,
00099         1u,
00100         bindFlags.value_or(D3D11_BIND_SHADER_RESOURCE),
00101         usage.value_or(D3D11_USAGE_DEFAULT),
00102         cpuFlags.value_or(0x0)
00103     };
00104
00105     D3D11_SUBRESOURCE_DATA data = {};
00106
00107     if (textureData)
00108     {
00109         data.pSysMem = textureData->buffer;
00110         data.SysMemPitch = textureData->bytesPerPixel * width;
00111     }
00112
00113     const D3D11_SUBRESOURCE_DATA* pData = (textureData) ? &data : nullptr;
00114
00115     ComPtr<ID3D11Texture2D> result;
00116     DX::ThrowIfFailed(device->CreateTexture2D(&desc, pData, &result));
00117     return result;
00118 }
00119
00120 ComPtr<ID3D11Buffer> DX::CreateBuffer(
00121     ID3D11Device* device,
00122     const size_t size,
00123     const void* buffer,
00124     std::optional<UINT> bindFlags,
00125     std::optional<D3D11_USAGE> usage,
00126     std::optional<UINT> cpuFlags)
00127 {
00128     if (size > std::numeric_limits<UINT>::max())
00129     {
00130         throw std::invalid_argument("size is larger than UINT");
00131     }
00132
00133     const CD3D11_BUFFER_DESC desc{
00134         static_cast<UINT>(size),
00135         bindFlags.value_or(D3D11_BIND_CONSTANT_BUFFER),
00136         usage.value_or(D3D11_USAGE_DEFAULT),
00137         cpuFlags.value_or(0x0),
00138     };
00139
00140     const D3D11_SUBRESOURCE_DATA data{
00141         buffer,
00142         0u,
00143         0u
00144     };
00145
00146     const D3D11_SUBRESOURCE_DATA* pData = (buffer) ? &data : nullptr;
00147
00148     ComPtr<ID3D11Buffer> result;
00149     DX::ThrowIfFailed(device->CreateBuffer(&desc, pData, &result));
00150     return result;
00151 }
00152
00153 ComPtr<ID3D11ShaderResourceView> DX::CreateShaderResourceView(
00154     ID3D11Texture2D* texture,
00155     std::optional<DXGI_FORMAT> format)
00156 {
00157     ComPtr<ID3D11Device> device;
00158     texture->GetDevice(&device);
00159
00160     const CD3D11_SHADER_RESOURCE_VIEW_DESC desc{
00161         texture,
00162         D3D11_SRV_DIMENSION_TEXTURE2D,
00163         format.value_or(DXGI_FORMAT_UNKNOWN)
00164     };
00165
00166     ComPtr<ID3D11ShaderResourceView> result;
00167     DX::ThrowIfFailed(device->CreateShaderResourceView(texture, &desc, &result));
00168     return result;
00169 }
00170
00171 ComPtr<ID3D11RenderTargetView> DX::CreateRenderTargetView(
00172     ID3D11Texture2D* texture)
00173 {
00174     ComPtr<ID3D11Device> device;
00175     texture->GetDevice(&device);
00176
00177     const CD3D11_RENDER_TARGET_VIEW_DESC desc{
00178         texture,
00179         D3D11_RTV_DIMENSION_TEXTURE2D
00180     };
00181
00182     ComPtr<ID3D11RenderTargetView> result;
00183     DX::ThrowIfFailed(device->CreateRenderTargetView(texture, &desc, &result));
00184     return result;
00185 }
00186
00187 ComPtr<ID3D11DepthStencilView> DX::CreateDepthStencilView(
00188     ID3D11Texture2D* texture,
00189     std::optional<DXGI_FORMAT> format)
00190 {
00191     ComPtr<ID3D11Device> device;
00192     texture->GetDevice(&device);
00193
00194     const CD3D11_DEPTH_STENCIL_VIEW_DESC desc{
00195         texture,
00196         D3D11_DSV_DIMENSION_TEXTURE2D,
00197         format.value_or(DXGI_FORMAT_UNKNOWN)
00198     };
00199
00200     ComPtr<ID3D11DepthStencilView> result;
00201     DX::ThrowIfFailed(device->CreateDepthStencilView(texture, &desc, &result));
00202     return result;
00203 }
00204
00205 DX::GpuPerformanceTimer::GpuPerformanceTimer(
00206     const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00207     m_deviceResources(deviceResources)
00208 {
00209     ID3D11Device* device = m_deviceResources->GetD3DDevice();
00210
00211     const D3D11_QUERY_DESC timestampQuery = CD3D11_QUERY_DESC(D3D11_QUERY_TIMESTAMP);
00212     const D3D11_QUERY_DESC disjointQuery = CD3D11_QUERY_DESC(D3D11_QUERY_TIMESTAMP_DISJOINT);
00213
00214     for (uint32_t i = 0; i < QueryCount; ++i)
00215     {
00216         device->CreateQuery(&timestampQuery, m_startTimestampQuery[i].ReleaseAndGetAddressOf());
00217         device->CreateQuery(&timestampQuery, m_endTimestampQuery[i].ReleaseAndGetAddressOf());
00218         device->CreateQuery(&disjointQuery, m_disjointQuery[i].ReleaseAndGetAddressOf());
00219     }
00220 }
00221
00222 void DX::GpuPerformanceTimer::StartTimerForFrame()
00223 {
00224     ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();
00225
00226     // Just some book-keeping to see how long this algorithm is running
00227     m_currentQuery = (m_currentQuery + 1) % QueryCount;
00228     const uint32_t ReadQuery = (m_currentQuery + 1) % QueryCount;
00229
00230     if (m_currentFrameIndex >= QueryCount)
00231     {
00232         D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjointData;
00233         while (context->GetData(m_disjointQuery[ReadQuery].Get(), &disjointData, sizeof(disjointData), 0) != S_OK);
00234
00235         if (disjointData.Disjoint == 0)
00236         {
00237             uint64_t start;
00238             while (context->GetData(m_startTimestampQuery[ReadQuery].Get(), &start, sizeof(start), 0) != S_OK);
00239
00240             uint64_t end;
00241             while (context->GetData(m_endTimestampQuery[ReadQuery].Get(), &end, sizeof(end), 0) != S_OK);
00242
00243             constexpr float secondsToMilliseconds = 1000.0f;
00244             const float ticksToSeconds = 1.0f / static_cast<float>(disjointData.Frequency);
00245             const uint64_t ticksElapsed = end - start;
00246
00247             m_processingTimeMs = static_cast<float>(ticksElapsed) * ticksToSeconds * secondsToMilliseconds;
00248
00249             // Reset every ~10 seconds so the min/max has a chance to update
00250             if (m_currentFrameIndex % 300 == 0)
00251             {
00252                 m_processingTimeMinMs = +std::numeric_limits<float>::infinity();
00253                 m_processingTimeMaxMs = -std::numeric_limits<float>::infinity();
00254             }
00255
00256             m_processingTimeMinMs = std::min(m_processingTimeMinMs, m_processingTimeMs);
00257             m_processingTimeMaxMs = std::max(m_processingTimeMaxMs, m_processingTimeMs);
00258         }
00259         else
00260         {
00261             m_processingTimeMs = std::numeric_limits<float>::quiet_NaN();;
00262         }
00263
00264         m_processingTimeHistory[m_processingTimeHistoryIndex] = m_processingTimeMs;
00265         m_processingTimeHistoryIndex = (m_processingTimeHistoryIndex + 1) % TimeHistoryCount;
00266
00267         m_processingTimeAvgMs = std::accumulate(m_processingTimeHistory, m_processingTimeHistory + TimeHistoryCount, 0.0f) / static_cast<float>(TimeHistoryCount);
00268     }
00269
00270     ++m_currentFrameIndex;
00271
00272     context->Begin(m_disjointQuery[m_currentQuery].Get());
00273     context->End(m_startTimestampQuery[m_currentQuery].Get());
00274 }
00275
00276 void DX::GpuPerformanceTimer::EndTimerForFrame()
00277 {
00278     ID3D11DeviceContext* context = m_deviceResources->GetD3DDeviceContext();
00279     context->End(m_endTimestampQuery[m_currentQuery].Get());
00280     context->End(m_disjointQuery[m_currentQuery].Get());
00281 }
00282
00283 float DX::GpuPerformanceTimer::GetFrameTime() const
00284 {
00285     return m_processingTimeMs;
00286 }
00287
00288 float DX::GpuPerformanceTimer::GetAvgFrameTime() const
00289 {
00290     return m_processingTimeAvgMs;
00291 }
00292
00293 float DX::GpuPerformanceTimer::GetMinFrameTime() const
00294 {
00295     return m_processingTimeMinMs;
00296 }
00297
00298 float DX::GpuPerformanceTimer::GetMaxFrameTime() const
00299 {
00300     return m_processingTimeMaxMs;
00301 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialInteractionSource/cpp/SpatialControllerHandler.cpp Source File

  • SpatialInteractionSource
  • cpp

SpatialControllerHandler.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002 #include "SpatialControllerHandler.h"
00003 #include "Common\DirectXHelper.h"
00004
00005 using namespace HolographicPaint;
00006 using namespace DirectX;
00007 using namespace Windows::Foundation;
00008 using namespace Windows::Foundation::Collections;
00009 using namespace Windows::Foundation::Numerics;
00010 using namespace Windows::Devices::Haptics;
00011 using namespace Windows::Perception::Spatial;
00012 using namespace Windows::UI::Input::Spatial;
00013 using namespace std::placeholders;
00014
00015 SpatialControllerHandler::SpatialControllerHandler(SpatialInteractionSource^ source, ISourceCommandHandler* eventsHandler, std::shared_ptr<Whiteboard>& target)
00016     : SourceHandler(source, eventsHandler, target)
00017 {
00018     SpatialInteractionController^ controller = source->Controller;
00019     if (controller != nullptr)
00020     {
00021         // Give Thumbstuck priority over Touchpad for tool selection.
00022         if (controller->HasThumbstick)
00023         {
00024             m_spDPadHelper = std::make_shared<ThumbstickDPadHelper>();
00025         }
00026         else if (controller->HasTouchpad)
00027         {
00028             m_spDPadHelper = std::make_shared<TouchpadDPadHelper>();
00029         }
00030         // Find out of the controller support haptics to be able to send vibrations when entering / leaving the board
00031         TryGetContinousBuzz(controller->SimpleHapticsController);
00032     }
00033
00034     m_gestureRecognizer = ref new SpatialGestureRecognizer(SpatialGestureSettings::Tap);
00035     // Handle Tap Gesture to leave tool selection mode
00036     m_tappedToken =
00037         m_gestureRecognizer->Tapped
00038             += ref new TypedEventHandler<SpatialGestureRecognizer^, SpatialTappedEventArgs^>(
00039                 std::bind(&SpatialControllerHandler::OnTapped, this, _1, _2));
00040 }
00041
00042 SpatialControllerHandler::~SpatialControllerHandler()
00043 {
00044     m_gestureRecognizer->Tapped -= m_tappedToken;
00045 }
00046
00047 float3 SpatialControllerHandler::GetToolScale() const
00048 {
00049     if (m_currentTool == nullptr)
00050     {
00051         return float3(DefaultControllerScale);
00052     }
00053     // Make the tool almost flat (5mm) as we are joinging squares when drawing
00054     return float3(m_currentTool->GetDiameter(), 0.005f, m_currentTool->GetDiameter());
00055 }
00056
00057 void SpatialControllerHandler::OnInteractionDetected(SpatialInteraction^ interaction, SpatialCoordinateSystem^ coordinateSystem)
00058 {
00059     switch (m_currentMode)
00060     {
00061     case ApplicationMode::ChooseTool:
00062         m_gestureRecognizer->TrySetGestureSettings(SpatialGestureSettings::Tap);
00063         m_gestureRecognizer->CaptureInteraction(interaction);
00064         break;
00065     }
00066 }
00067
00068 void SpatialControllerHandler::OnSourceUpdated(SpatialInteractionSourceState^ state, SpatialCoordinateSystem^ coordinateSystem)
00069 {
00070     // Update the source position
00071     __super::OnSourceUpdated(state, coordinateSystem);
00072
00073     switch (m_currentMode)
00074     {
00075         case ApplicationMode::Drawing:
00076         {
00077             // Update the Pointing Pose
00078             bool insideTargetBoard = false;
00079
00080             // Try to get the pointing ray and hit test the wall
00081             m_toolPosition.IsCurrent = false;
00082             SpatialPointerPose^ pointerPose = state->TryGetPointerPose(coordinateSystem);
00083             if (pointerPose != nullptr)
00084             {
00085                 SpatialPointerInteractionSourcePose^ interactionSourcePose = pointerPose->TryGetInteractionSourcePose(state->Source);
00086                 if (interactionSourcePose != nullptr)
00087                 {
00088                     m_toolPosition.IsCurrent = true;
00089                     m_toolPosition.HasValue = true;
00090                     m_refreshModelConstantBufferData = true;
00091
00092                     const float3& forwardDirection = interactionSourcePose->ForwardDirection;
00093
00094                     // Try to hit test the drawing board
00095                     float targetDistance = 0.0f;
00096                     insideTargetBoard = m_targetBoard->Intersects(interactionSourcePose->Position, forwardDirection, &targetDistance);
00097
00098                     if (!insideTargetBoard)
00099                     {
00100                         // Display and draw a few centimeters in front of the controller as we do not target the board
00101                         targetDistance = 0.05f;
00102                     }
00103
00104                     m_toolPosition.Position = interactionSourcePose->Position + targetDistance * forwardDirection;
00105
00106                     // Now compute the orientation of the tool using upDirection as well
00107                     // Compute the orientation based on the ray
00108                     const XMVECTOR orientationVector = DX::GetQuaternionVectorFromRay(forwardDirection, interactionSourcePose->UpDirection);
00109                     XMStoreQuaternion(&m_toolPosition.Orientation, orientationVector);
00110                 }
00111             }
00112             m_toolPosition.CheckIfObsolete(state->Timestamp->TargetTime.UniversalTime);
00113
00114             // If we just switched from inside the board to outside it and the controllers supports haptics, send a quick vibration
00115             if ((m_insideTargetBoard != insideTargetBoard) && (m_hapticsController != nullptr))
00116             {
00117                 TimeSpan buzzDuration;
00118                 buzzDuration.Duration = 1000000; // 1 == 100-nanosecond, therefore 0.1 second here...
00119                 m_hapticsController->SendHapticFeedbackForDuration(m_hapticsBuzzFeedback, 1.0, buzzDuration);
00120             }
00121
00122             if (state->IsSelectPressed)
00123             {
00124                 if (!m_waitForRelease)
00125                 {
00126                     if (!m_currentStroke)
00127                     {
00128                         // Start drawing
00129                         m_strokeInsideTargetBoard = m_insideTargetBoard;
00130                         ComposeStroke();
00131                     }
00132                     else if (m_strokeInsideTargetBoard == m_insideTargetBoard)
00133                     {
00134                         // Continue Drawing
00135                         ComposeStroke();
00136                     }
00137                     else
00138                     {
00139                         // Transition in/out the target, stop drawing
00140                         TerminateStroke();
00141                         // And wait for the button to be released to start a new Stroke
00142                         m_waitForRelease = true;
00143                     }
00144                 }
00145             }
00146             else
00147             {
00148                 m_waitForRelease = false;
00149                 if (m_currentStroke)
00150                 {
00151                     TerminateStroke();
00152                 }
00153             }
00154         }
00155         break;
00156     case ApplicationMode::ChooseTool:
00157         {
00158             SpatialInteractionControllerProperties^ controllerProperties = (m_spDPadHelper ? state->ControllerProperties : nullptr);
00159             if (controllerProperties != nullptr)
00160             {
00161                 DPadAction dpadAction = m_spDPadHelper->Update(controllerProperties);
00162                 if (dpadAction != DPadAction::None)
00163                 {
00164                     m_eventsHandler->OnDPadAction(this, dpadAction);
00165                 }
00166             }
00167         }
00168         break;
00169     }
00170 }
00171
00172 void SpatialControllerHandler::OnSourcePressed(SpatialInteractionSourceEventArgs^ args)
00173 {
00174     SpatialInteractionSourceState^ state = args->State;
00175     SpatialInteractionControllerProperties^ controllerProperties = (m_spDPadHelper ? state->ControllerProperties : nullptr);
00176     if (controllerProperties != nullptr)
00177     {
00178         DPadAction dpadAction = m_spDPadHelper->SourcePressed(args->PressKind, controllerProperties);
00179         if (dpadAction != DPadAction::None)
00180         {
00181             m_eventsHandler->OnDPadAction(this, dpadAction);
00182         }
00183     }
00184
00185     switch (m_currentMode)
00186     {
00187     case ApplicationMode::Drawing:
00188         switch (args->PressKind)
00189         {
00190         case SpatialInteractionPressKind::Menu:
00191             m_eventsHandler->OnEnterToolChoice(this, args->State->Timestamp);
00192             break;
00193         }
00194         break;
00195     case ApplicationMode::ChooseTool:
00196         switch (args->PressKind)
00197         {
00198         case SpatialInteractionPressKind::Menu:
00199             m_eventsHandler->OnSelectTool(this);
00200             break;
00201         }
00202         break;
00203     }
00204 }
00205
00206 void SpatialControllerHandler::TryGetContinousBuzz(SimpleHapticsController^ controller)
00207 {
00208     if ((controller != nullptr) && controller->IsPlayDurationSupported)
00209     {
00210         IVectorView<SimpleHapticsControllerFeedback^>^ feedbacks = controller->SupportedFeedback;
00211         // Only ContinousBuzz is supported and therefore we can use the first feedback of the collection
00212         if (feedbacks->Size > 0)
00213         {
00214             m_hapticsController = controller;
00215             m_hapticsBuzzFeedback = feedbacks->GetAt(0);
00216         }
00217     }
00218 }
00219
00220 void SpatialControllerHandler::OnTapped(SpatialGestureRecognizer ^sender, SpatialTappedEventArgs ^args)
00221 {
00222     switch (m_currentMode)
00223     {
00224     case ApplicationMode::ChooseTool:
00225         m_eventsHandler->OnSelectTool(this);
00226         break;
00227     }
00228 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/MainPage.xaml.cpp Source File

  • BackButton
  • cpp

MainPage.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014
00015 using namespace SDKTemplate;
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027 using namespace Windows::UI::Xaml::Interop;
00028
00029 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00030
00031 MainPage^ MainPage::Current = nullptr;
00032
00033 MainPage::MainPage()
00034 {
00035     InitializeComponent();
00036     SampleTitle->Text = FEATURE_NAME;
00037
00038     // This is a static public property that allows downstream pages to get a handle to the MainPage instance
00039     // in order to call methods that are in this class.
00040     MainPage::Current = this;
00041
00042     // Caching your main page is good practice, this makes it snappy for the user to return to "home" of your app.
00043     NavigationCacheMode = Navigation::NavigationCacheMode::Required;
00044 }
00045
00046 void MainPage::OnNavigatedTo(NavigationEventArgs^ e)
00047 {
00048     // Populate the ListBox with the scenarios as defined in SampleConfiguration.cpp.
00049     auto itemCollection = ref new Platform::Collections::Vector<Object^>();
00050     int i = 1;
00051     for (auto const& s : MainPage::Current->scenarios)
00052     {
00053         // Create a textBlock to hold the content and apply the ListItemTextStyle from Styles.xaml
00054         TextBlock^ textBlock = ref new TextBlock();
00055         ListBoxItem^ item = ref new ListBoxItem();
00056         auto style = App::Current->Resources->Lookup("ListItemTextStyle");
00057
00058         textBlock->Text = (i++).ToString() + ") " + s.Title;
00059         textBlock->Style = safe_cast<Windows::UI::Xaml::Style ^>(style);
00060
00061         item->Name = s.ClassName;
00062         item->Content = textBlock;
00063         itemCollection->Append(item);
00064     }
00065
00066     // Set the newly created itemCollection as the ListBox ItemSource.
00067     ScenarioControl->ItemsSource = itemCollection;
00068     int startingScenarioIndex;
00069
00070     if (Window::Current->Bounds.Width < 640)
00071     {
00072         startingScenarioIndex = -1;
00073     }
00074     else
00075     {
00076         startingScenarioIndex = 0;
00077     }
00078
00079     ScenarioControl->SelectedIndex = startingScenarioIndex;
00080     ScenarioControl->ScrollIntoView(ScenarioControl->SelectedItem);
00081
00082     // This page is always at the top of our in-app back stack.
00083     // Once it is reached there is no further back so we can always disable the title bar back UI when navigated here.
00084     // If you want to you can always to the Frame.CanGoBack check for all your pages and act accordingly.
00085     SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Collapsed;
00086 }
00087
00088
00089 void MainPage::ScenarioControl_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00090 {
00091     ListBox^ scenarioListBox = safe_cast<ListBox^>(sender); //as ListBox;
00092     ListBoxItem^ item = dynamic_cast<ListBoxItem^>(scenarioListBox->SelectedItem);
00093     if (item != nullptr)
00094     {
00095         // Clear the status block when changing scenarios
00096         NotifyUser("", NotifyType::StatusMessage);
00097
00098         // Navigate to the selected scenario.
00099         TypeName scenarioType = { item->Name, TypeKind::Custom };
00100         ScenarioFrame->Navigate(scenarioType, this);
00101
00102         if (Window::Current->Bounds.Width < 640)
00103         {
00104             Splitter->IsPaneOpen = false;
00105         }
00106     }
00107 }
00108
00109 void MainPage::NotifyUser(String^ strMessage, NotifyType type)
00110 {
00111     switch (type)
00112     {
00113     case NotifyType::StatusMessage:
00114         StatusBorder->Background = ref new SolidColorBrush(Windows::UI::Colors::Green);
00115         break;
00116     case NotifyType::ErrorMessage:
00117         StatusBorder->Background = ref new SolidColorBrush(Windows::UI::Colors::Red);
00118         break;
00119     default:
00120         break;
00121     }
00122     StatusBlock->Text = strMessage;
00123
00124     // Collapse the StatusBlock if it has no text to conserve real estate.
00125     if (StatusBlock->Text != "")
00126     {
00127         StatusBorder->Visibility = Windows::UI::Xaml::Visibility::Visible;
00128         StatusPanel->Visibility = Windows::UI::Xaml::Visibility::Visible;
00129     }
00130     else
00131     {
00132         StatusBorder->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00133         StatusPanel->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00134     }
00135 }
00136
00137 void MainPage::Footer_Click(Object^ sender, RoutedEventArgs^ e)
00138 {
00139     auto uri = ref new Uri((String^)((HyperlinkButton^)sender)->Tag);
00140     Windows::System::Launcher::LaunchUriAsync(uri);
00141 }
00142
00143 void MainPage::Button_Click(Object^ sender, RoutedEventArgs^ e)
00144 {
00145     Splitter->IsPaneOpen = !Splitter->IsPaneOpen;
00146 }
Generated on Fri Nov 15 2024 22:16:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripDetails.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "View\TripDetails.g.h"
00015 #include "ViewModel\TripViewModel.h"
00016 #include "Common\CalendarConverter.h"
00017 #include "Common\BoolToVisibilityConverter.h"
00018
00019 namespace AdventureWorks
00020 {
00021     [Windows::Foundation::Metadata::WebHostHidden]
00022     [Windows::UI::Xaml::Data::Bindable]
00023     public ref class TripDetails sealed
00024     {
00025     public:
00026         TripDetails();
00027
00028         property TripViewModel^ DefaultViewModel
00029         {
00030             TripViewModel^ get();
00031         }
00032
00033     protected:
00034         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00035         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036
00037     private:
00038         TripViewModel^ defaultViewModel;
00039     };
00040 }
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario2_Load.xaml.cpp Source File

  • XamlBottomUpList
  • cpp

Scenario2_Load.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleConfiguration.h"
00014 #include "Scenario2_Load.xaml.h"
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Concurrency;
00019 using namespace Platform;
00020 using namespace Platform::Collections;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Data;
00027 using namespace Windows::UI::Xaml::Input;
00028 using namespace Windows::UI::Xaml::Interop;
00029 using namespace Windows::UI::Xaml::Media;
00030
00031 namespace SDKTemplate
00032 {
00033     // Observable collection representing a text message conversation
00034     // that can load more items incrementally.
00035     public ref class Conversation sealed : IBindableObservableVector, ISupportIncrementalLoading
00036     {
00037     public:
00038         Conversation()
00039         {
00040             _token = _storage->VectorChanged += ref new VectorChangedEventHandler<TextMessage^>(this, &Conversation::Storage_VectorChanged);
00041         }
00042
00043         virtual ~Conversation()
00044         {
00045             _storage->VectorChanged -= _token;
00046         }
00047
00048 #pragma region ISupportIncrementalLoading
00049         property bool HasMoreItems { virtual bool get() { return true; } }
00050
00051         virtual IAsyncOperation<LoadMoreItemsResult>^ LoadMoreItemsAsync(unsigned int count)
00052         {
00053             CreateMessages(count);
00054             return create_async([count]()
00055             {
00056                 //return task_from_result(LoadMoreItemsResult{ count });
00057                 return LoadMoreItemsResult{ count };
00058             });
00059         }
00060 #pragma endregion
00061
00062 #pragma region IBindableObservableVector
00063
00064         virtual event BindableVectorChangedEventHandler^ VectorChanged
00065         {
00066             virtual EventRegistrationToken add(BindableVectorChangedEventHandler^ e)
00067             {
00068                 return _storageChanged += e;
00069             }
00070
00071             virtual void remove(EventRegistrationToken t)
00072             {
00073                 _storageChanged -= t;
00074             }
00075         }
00076
00077 #pragma endregion
00078
00079 #pragma region IBindableIterator
00080
00081         virtual IBindableIterator^ First()
00082         {
00083             return dynamic_cast<IBindableIterator^>(_storage->First());
00084         }
00085
00086 #pragma endregion
00087
00088 #pragma region IBindableVector
00089
00090         virtual void Append(Object^ value)
00091         {
00092             _storage->Append(safe_cast<TextMessage^>(value));
00093         }
00094
00095         virtual void Clear()
00096         {
00097             _storage->Clear();
00098         }
00099
00100         virtual Object^ GetAt(unsigned int index)
00101         {
00102             return _storage->GetAt(index);
00103         }
00104
00105         virtual IBindableVectorView^ GetView()
00106         {
00107             return safe_cast<IBindableVectorView^>(_storage->GetView());
00108         }
00109
00110         virtual bool IndexOf(Object^ value, unsigned int* index)
00111         {
00112             return _storage->IndexOf(safe_cast<TextMessage^>(value), index);
00113         }
00114
00115         virtual void InsertAt(unsigned int index, Object^ value)
00116         {
00117             _storage->InsertAt(index, safe_cast<TextMessage^>(value));
00118         }
00119
00120         virtual void RemoveAt(unsigned int index)
00121         {
00122             _storage->RemoveAt(index);
00123         }
00124
00125         virtual void RemoveAtEnd()
00126         {
00127             _storage->RemoveAtEnd();
00128         }
00129
00130         virtual void SetAt(unsigned int index, Object^ value)
00131         {
00132             _storage->SetAt(index, safe_cast<TextMessage^>(value));
00133         }
00134
00135         virtual property unsigned int Size
00136         {
00137             unsigned int get() { return _storage->Size; }
00138         }
00139 #pragma endregion
00140
00141         static String^ CreateRandomMessage()
00142         {
00143             static auto fillerText = L"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
00144             int length = wcslen(fillerText);
00145             int randomLength = 5 + rand() % (length - 5);
00146             return ref new String(fillerText, randomLength);
00147         }
00148
00149     private:
00150         void CreateMessages(unsigned int count)
00151         {
00152             for (unsigned int i = 0; i < count; i++)
00153             {
00154                 auto message = ref new TextMessage();
00155                 message->Body = messageCount.ToString() + ": " + CreateRandomMessage();
00156                 message->IsSent = 0 == messageCount++ % 2;
00157                 message->DisplayTime = Helpers::GetCurrentDateTimeAsString();
00158                 _storage->InsertAt(0, message);
00159             }
00160         }
00161
00162         void Storage_VectorChanged(IObservableVector<TextMessage^>^ sender, IVectorChangedEventArgs^ args)
00163         {
00164             _storageChanged(this, args);
00165         }
00166
00167         unsigned int messageCount = 0;
00168         Vector<TextMessage^>^ _storage = ref new Vector<TextMessage^>();
00169         event BindableVectorChangedEventHandler^ _storageChanged;
00170         EventRegistrationToken _token;
00171     };
00172 }
00173
00174 ChatListView::ChatListView()
00175 {
00176     // We'll manually trigger the loading of data incrementally and buffer for 2 pages worth of data
00177     IncrementalLoadingTrigger = Windows::UI::Xaml::Controls::IncrementalLoadingTrigger::None;
00178
00179     // Since we'll have variable sized items we compute a running average of height to help estimate
00180     // how much data to request for incremental loading
00181     ContainerContentChanging += UpdateRunningAverageContainerHeightHandler;
00182 }
00183
00184 void ChatListView::OnApplyTemplate()
00185 {
00186     auto scrollViewer = dynamic_cast<ScrollViewer^>(GetTemplateChild("ScrollViewer"));
00187
00188     if (scrollViewer != nullptr)
00189     {
00190         scrollViewer->ViewChanged += ref new EventHandler<ScrollViewerViewChangedEventArgs^>(this, &ChatListView::ScrollViewer_ViewChanged);
00191     }
00192
00193     __super::OnApplyTemplate();
00194 }
00195
00196 void ChatListView::ScrollViewer_ViewChanged(Object^ sender, ScrollViewerViewChangedEventArgs^ args)
00197 {
00198     // Check if we should load more data when the scroll position changes.
00199     // We only get this once the content/panel is large enough to be scrollable.
00200     StartProcessingDataVirtualizationScrollOffsets(ActualHeight);
00201 };
00202
00203 // We use ArrangeOverride to trigger incrementally loading data (if needed) when the panel is too small to be scrollable.
00204 Size ChatListView::ArrangeOverride(Size finalSize)
00205 {
00206     // Allow the panel to arrange first
00207     Size result = __super::ArrangeOverride(finalSize);
00208
00209     StartProcessingDataVirtualizationScrollOffsets(finalSize.Height);
00210
00211     return result;
00212 }
00213
00214 void ChatListView::StartProcessingDataVirtualizationScrollOffsets(double actualHeight)
00215 {
00216     // Avoid re-entrancy. If we are already processing, then defer this request.
00217     if (processingScrollOffsets)
00218     {
00219         processingScrollOffsetsDeferred = true;
00220         return;
00221     }
00222
00223     processingScrollOffsets = true;
00224     ProcessDataVirtualizationScrollOffsetsAsync(actualHeight);
00225 }
00226
00227 task<void> ChatListView::ProcessDataVirtualizationScrollOffsetsAsync(double actualHeight)
00228 {
00229     task<void> loadTask = task_from_result();
00230
00231     processingScrollOffsetsDeferred = false;
00232
00233     auto panel = dynamic_cast<ItemsStackPanel^>(ItemsPanelRoot);
00234     if (panel != nullptr)
00235     {
00236         if ((panel->FirstVisibleIndex != -1 && panel->FirstVisibleIndex * averageContainerHeight < actualHeight * IncrementalLoadingThreshold) ||
00237             (Items->Size == 0))
00238         {
00239             auto virtualizingDataSource = dynamic_cast<ISupportIncrementalLoading^>(ItemsSource);
00240             if (virtualizingDataSource != nullptr)
00241             {
00242                 if (virtualizingDataSource->HasMoreItems)
00243                 {
00244                     unsigned int itemsToLoad;
00245                     if (averageContainerHeight == 0.0)
00246                     {
00247                         // We don't have any items yet. Load the first one so we can get an
00248                         // estimate of the height of one item, and then we can load the rest.
00249                         itemsToLoad = 1;
00250                     }
00251                     else
00252                     {
00253                         double avgItemsPerPage = actualHeight / averageContainerHeight;
00254                         // We know there's data to be loaded so load at least one item
00255                         itemsToLoad = (std::max)((unsigned int)(DataFetchSize * avgItemsPerPage), 1U);
00256                     }
00257
00258                     loadTask = create_task(virtualizingDataSource->LoadMoreItemsAsync(itemsToLoad)).then([](LoadMoreItemsResult) {});
00259                 }
00260             }
00261         }
00262     }
00263
00264     return loadTask.then([this, actualHeight]()
00265     {
00266         // If a request to process scroll offsets occurred while we were processing
00267         // the previous request, then process the deferred request now.
00268         if (processingScrollOffsetsDeferred)
00269         {
00270             return ProcessDataVirtualizationScrollOffsetsAsync(actualHeight);
00271         }
00272
00273         // We have finished. Allow new requests to be processed.
00274         processingScrollOffsets = false;
00275         return task_from_result();
00276     }, task_continuation_context::get_current_winrt_context());
00277 }
00278
00279 void ChatListView::UpdateRunningAverageContainerHeight(ListViewBase^ sender, ContainerContentChangingEventArgs^ args)
00280 {
00281     if (args->ItemContainer != nullptr && !args->InRecycleQueue)
00282     {
00283         switch (args->Phase)
00284         {
00285         case 0:
00286             // use the size of the very first placeholder as a starting point until
00287             // we've seen the first item
00288             if (averageContainerHeight == 0)
00289             {
00290                 averageContainerHeight = args->ItemContainer->DesiredSize.Height;
00291             }
00292
00293             args->RegisterUpdateCallback(1, UpdateRunningAverageContainerHeightHandler);
00294             args->Handled = true;
00295             break;
00296
00297         case 1:
00298             // set the content
00299             args->ItemContainer->Content = args->Item;
00300             args->RegisterUpdateCallback(2, UpdateRunningAverageContainerHeightHandler);
00301             args->Handled = true;
00302             break;
00303
00304         case 2:
00305             // refine the estimate based on the item's DesiredSize
00306             averageContainerHeight = (averageContainerHeight * itemsSeen + args->ItemContainer->DesiredSize.Height) / ++itemsSeen;
00307             args->Handled = true;
00308         }
00309     }
00310 }
00311
00312 Scenario2_Load::Scenario2_Load() : conversation(ref new Conversation())
00313 {
00314     InitializeComponent();
00315     chatView->ItemsSource = conversation;
00316     chatView->ContainerContentChanging += ref new TypedEventHandler<ListViewBase^, ContainerContentChangingEventArgs^>(
00317         this, &Scenario2_Load::OnChatViewContainerContentChanging);
00318 }
00319
00320 void Scenario2_Load::SendTextMessage()
00321 {
00322     if (MessageTextBox->Text->Length() > 0)
00323     {
00324         auto message = ref new TextMessage();
00325         message->Body = MessageTextBox->Text;
00326         message->DisplayTime = Helpers::GetCurrentDateTimeAsString();
00327         message->IsSent = true;
00328         conversation->Append(message);
00329
00330         MessageTextBox->Text = "";
00331
00332         // Send a simulated reply after a brief delay.
00333         create_task(Helpers::DelayAsync(Helpers::TimeSpanFromSeconds(2))
00334             .then([this]()
00335         {
00336             auto message = ref new TextMessage();
00337             message->Body = Conversation::CreateRandomMessage();
00338             message->DisplayTime = Helpers::GetCurrentDateTimeAsString();
00339             message->IsSent = false;
00340             conversation->Append(message);
00341         }, task_continuation_context::get_current_winrt_context()));
00342     }
00343 }
00344
00345 void Scenario2_Load::OnChatViewContainerContentChanging(ListViewBase^ sender, ContainerContentChangingEventArgs^ args)
00346 {
00347     if (args->InRecycleQueue) return;
00348     TextMessage^ message = safe_cast<TextMessage^>(args->Item);
00349     args->ItemContainer->HorizontalAlignment = message->IsSent ? Windows::UI::Xaml::HorizontalAlignment::Right : Windows::UI::Xaml::HorizontalAlignment::Left;
00350 }
00351
00352 void Scenario2_Load::MessageTextBox_KeyUp(Object^ sender, KeyRoutedEventArgs^ e)
00353 {
00354     if (e->Key == Windows::System::VirtualKey::Enter)
00355     {
00356         SendTextMessage();
00357     }
00358 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpatialSound/cpp/OmnidirectionalSound.h Source File

  • SpatialSound
  • cpp

OmnidirectionalSound.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 //
00015 // Sound with omnidirectional radiation pattern i.e. emits sound equally in all directions.
00016 //
00017 class OmnidirectionalSound
00018 {
00019 public:
00020     virtual ~OmnidirectionalSound();
00021     HRESULT Initialize(_In_ LPCWSTR filename);
00022
00023     HRESULT Start();
00024     HRESULT Stop();
00025     HRESULT OnUpdate(_In_ float angularVelocity, _In_ float height, _In_ float radius);
00026     HRESULT SetEnvironment(_In_ HrtfEnvironment environment);
00027     HrtfEnvironment GetEnvironment() { return _environment; }
00028
00029 private:
00030     HrtfPosition ComputePositionInOrbit(_In_ float height, _In_ float radius, _In_ float angle);
00031
00032 private:
00033     AudioFileReader                 _audioFile;
00034     ComPtr<IXAudio2>                _xaudio2;
00035     IXAudio2SourceVoice*            _sourceVoice = nullptr;
00036     ComPtr<IXAPOHrtfParameters>     _hrtfParams;
00037     HrtfEnvironment                 _environment = HrtfEnvironment::Outdoors;
00038     ULONGLONG                       _lastTick = 0;
00039     float                           _angle = 0;
00040 };
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
App() | sealed |
DirectXPage() | sealed |
LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | sealed |
m_deviceResources | sealed |
m_directXPage | sealed | [private]
m_isWindowVisible | sealed |
m_properties | sealed |
m_renderer | sealed |
m_suppressRendererUpdates | sealed |
OnColorProfileChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnCompositionScaleChanged(_In_ Windows::UI::Xaml::Controls::SwapChainPanel^sender, _In_ Object^args) | sealed |
OnDisplayContentsInvalidated(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnDpiChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [virtual]
OnOrientationChanged(_In_ Windows::Graphics::Display::DisplayInformation^sender, _In_ Platform::Object^args) | sealed |
OnPropertyChanged(Platform::String^propertyName) | sealed |
OnRendering(_In_ Platform::Object^sender, _In_ Platform::Object^args) | sealed |
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
OnSwapChainPanelSizeChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::SizeChangedEventArgs^e) | sealed |
OnVisibilityChanged(_In_ Windows::UI::Core::CoreWindow^sender, _In_ Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed |
PropertyChanged | sealed |
Reset_Click(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::RoutedEventArgs^e) | sealed |
ResetPhotoAdjustmentValues() | sealed |
SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | sealed |
Slider_ValueChanged(_In_ Platform::Object^sender, _In_ Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^e) | sealed |
TryUpdateRenderer() | sealed |
~DirectXPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_InkCanvasTactileFeedback Member List

This is the complete list of members for Scenario1_InkCanvasTactileFeedback, including all inherited members.
OnSizeChanged(object sender, SizeChangedEventArgs e) | Scenario1_InkCanvasTactileFeedback | [inline, private]
Scenario1_InkCanvasTactileFeedback() | Scenario1_InkCanvasTactileFeedback | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario8.xaml.cpp Source File

  • ApplicationResources
  • cpp

scenario8.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario8.xaml.cpp
00013 // Implementation of the Scenario8 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario8.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Platform;
00022 using namespace Windows::ApplicationModel::Resources::Core;
00023 using namespace Windows::Globalization;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 Scenario8::Scenario8()
00029 {
00030     InitializeComponent();
00031     PopulateComboBox();
00032     UpdateCurrentAppLanguageMessage();
00033 }
00034
00035 void Scenario8::ShowText()
00036 {
00037     ResourceContext^ defaultContextForCurrentView = ResourceContext::GetForCurrentView();
00038     auto resourceStringMap = ResourceManager::Current->MainResourceMap->GetSubtree("Resources");
00039     Scenario8MessageTextBlock->Text = resourceStringMap->GetValue("string1", defaultContextForCurrentView)->ValueAsString;
00040 }
00041
00042
00043 void Scenario8::LanguageOverrideCombo_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00044 {
00045     auto combo = safe_cast<ComboBox^>(sender);
00046     auto item = safe_cast<ComboBoxItem^>(combo->SelectedValue);
00047     auto languageTag = safe_cast<String^>(item->Tag);
00048
00049     // Ignore the divider ((tag = "-")
00050     if (languageTag == "-")
00051     {
00052         combo->SelectedIndex = lastSelectedIndex;
00053     }
00054     else
00055     {
00056         lastSelectedIndex = combo->SelectedIndex;
00057
00058         // Set the persistent language override
00059         ApplicationLanguages::PrimaryLanguageOverride = languageTag;
00060
00061         // update current app languages message
00062         UpdateCurrentAppLanguageMessage();
00063     }
00064 }
00065
00066 void Scenario8::AddItemForLanguageTag(String^ languageTag)
00067 {
00068     auto language = ref new Windows::Globalization::Language(languageTag);
00069     auto item = ref new ComboBoxItem();
00070     item->Content = language->DisplayName;
00071     item->Tag = languageTag;
00072     LanguageOverrideCombo->Items->Append(item);
00073
00074     // Select this item if it is the primary language override.
00075     if (languageTag == ApplicationLanguages::PrimaryLanguageOverride)
00076     {
00077         LanguageOverrideCombo->SelectedItem = item;
00078     }
00079 }
00080
00081
00082 void Scenario8::PopulateComboBox()
00083 {
00084     // First, show the default setting
00085     auto defaultItem = ref new ComboBoxItem();
00086     defaultItem->Content = "Use language preferences (recommended)";
00087     defaultItem->Tag = "";
00088     LanguageOverrideCombo->Items->Append(defaultItem);
00089     LanguageOverrideCombo->SelectedIndex = 0;
00090
00091     // If there are app languages that the user speaks, show them next
00092
00093     // Note: the first (non-override) language, if set as the primary language override
00094     // would give the same result as not having any primary language override. There's
00095     // still a difference, though: If the user changes their language preferences, the
00096     // default setting (no override) would mean that the actual primary app language
00097     // could change. But if it's set as an override, then it will remain the primary
00098     // app language after the user changes their language preferences.
00099
00100     for (auto languageTag : ApplicationLanguages::Languages)
00101     {
00102         AddItemForLanguageTag(languageTag);
00103     }
00104
00105     // Now add a divider followed by all the app manifest languages (in case the user
00106     // wants to pick a language not currently in their profile)
00107
00108     // NOTE: If an app is deployed using a bundle with resource packages, the following
00109     // addition to the list may not be useful: The set of languages returned by
00110     // ApplicationLanguages.ManifestLanguages will consist of only those manifest
00111     // languages in the main app package or in the resource packages that are installed
00112     // and registered for the current user. Language resource packages get deployed for
00113     // the user if the language is in the user's profile. Therefore, the only difference
00114     // from the set returned by ApplicationLanguages.Languages above would depend on
00115     // which languages are included in the main app package.
00116
00117     auto dividerItem = ref new ComboBoxItem();
00118     dividerItem->Content = "——————";
00119     dividerItem->Tag = "-";
00120     LanguageOverrideCombo->Items->Append(dividerItem);
00121
00122     // In a production app, this list should be sorted, but that's beyond the
00123     // focus of this sample.
00124     for (auto languageTag : ApplicationLanguages::ManifestLanguages)
00125     {
00126         AddItemForLanguageTag(languageTag);
00127     }
00128
00129     LanguageOverrideCombo->SelectionChanged += ref new SelectionChangedEventHandler(this, &Scenario8::LanguageOverrideCombo_SelectionChanged);
00130
00131     lastSelectedIndex = LanguageOverrideCombo->SelectedIndex;
00132 }
00133
00134 void Scenario8::UpdateCurrentAppLanguageMessage()
00135 {
00136     Scenario8AppLanguagesTextBlock->Text = "Current app language(s): " + GetAppLanguagesAsFormattedString();
00137 }
00138
00139 Platform::String^ Scenario8::GetAppLanguagesAsFormattedString()
00140 {
00141     Platform::String^ appLanguages = "";
00142
00143     for (auto languageTag : ApplicationLanguages::Languages)
00144     {
00145         if (appLanguages->Length() == 0)
00146         {
00147             appLanguages = languageTag;
00148         }
00149         else
00150         {
00151             appLanguages = appLanguages + ", " + languageTag;
00152         }
00153     }
00154     return appLanguages;
00155 }
Generated on Fri Nov 15 2024 22:18:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackButton/cpp/Scenario1.xaml.cpp Source File

  • BackButton
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1.xaml.h"
00013 #include "SecondaryPage.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Core;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023 using namespace Windows::UI::Xaml::Controls::Primitives;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Input;
00026 using namespace Windows::UI::Xaml::Media;
00027 using namespace Windows::UI::Xaml::Navigation;
00028
00029 bool Scenario1::optedIn = false;
00030
00031 Scenario1::Scenario1() : rootPage(MainPage::Current)
00032 {
00033     InitializeComponent();
00034
00035     // I want this page to be always cached so that we don't have to add logic to save/restore state for the checkbox.
00036     NavigationCacheMode = Navigation::NavigationCacheMode::Required;
00037 }
00038
00039 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00040 {
00041     rootPage = MainPage::Current;
00042 }
00043
00044 void SDKTemplate::Scenario1::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00045 {
00046     auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content);
00047
00048     // Navigate to the next page, with info in the parameters whether to enable the title bar UI or not.
00049     rootFrame->Navigate(SecondaryPage::typeid, optedIn);
00050 }
00051
00052 void Scenario1::CheckBox_Toggle(Platform::Object^ sender, RoutedEventArgs e)
00053 {
00054     optedIn = !optedIn;
00055 }
00056
Generated on Fri Nov 15 2024 22:17:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/SampleConfiguration.h Source File

  • BackgroundActivation
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012
00013 #include <collection.h>
00014 #include "App.g.h"
00015 #include "BackgroundActivity.h"
00016
00017 using namespace Platform;
00018 using namespace Windows::ApplicationModel::Background;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Storage;
00021
00022 #define SampleBackgroundTaskName "SampleBackgroundTask"
00023 #define SampleBackgroundTaskWithConditionName "SampleBackgroundTaskWithCondition"
00024 #define ServicingCompleteTaskName "ServicingCompleteTask"
00025 #define TimeTriggeredTaskName "TimeTriggeredTask"
00026 #define ApplicationTriggerTaskName "ApplicationTriggerTask"
00027 #define GroupedBackgroundTaskName "GroupedBackgroundTask"
00028 #define BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
00029 #define BackgroundTaskGroupFriendlyName "Background Task Group"
00030
00031
00032 namespace SDKTemplate
00033 {
00034     public value struct Scenario
00035     {
00036         String^ Title;
00037         String^ ClassName;
00038     };
00039
00040     partial ref class MainPage
00041     {
00042     public:
00043         static property String^ FEATURE_NAME
00044         {
00045             String^ get()
00046             {
00047                 return L"Background Activation";
00048             }
00049         }
00050
00051         static property Array<Scenario>^ scenarios
00052         {
00053             Array<Scenario>^ get()
00054             {
00055                 return scenariosInner;
00056             }
00057         }
00058     private:
00059         static Array<Scenario>^ scenariosInner;
00060     };
00061
00062     class BackgroundTaskSample
00063     {
00064     public:
00065         static String^ GetBackgroundTaskStatus(String^ name);
00066         static BackgroundTaskRegistration^ RegisterBackgroundTask(String^ taskEntryPoint, String^ name, IBackgroundTrigger^ trigger, IBackgroundCondition^ condition, BackgroundTaskRegistrationGroup^ group = nullptr);
00067         static bool TaskRequiresBackgroundAccess(String^ name);
00068         static void UnregisterBackgroundTasks(String^ name, BackgroundTaskRegistrationGroup^ group = nullptr);
00069         static BackgroundTaskRegistrationGroup^ GetTaskGroup(String^ id, String^ groupName);
00070         static void UpdateBackgroundTaskRegistrationStatus(String^ name, bool registered);
00071         static void RemoveBackgroundTaskStatus(String^ name);
00072
00073         static String^ SampleBackgroundTaskProgress;
00074         static bool SampleBackgroundTaskRegistered;
00075
00076         static String^ SampleBackgroundTaskWithConditionProgress;
00077         static bool SampleBackgroundTaskWithConditionRegistered;
00078
00079         static String^ ServicingCompleteTaskProgress;
00080         static bool ServicingCompleteTaskRegistered;
00081
00082         static String^ TimeTriggeredTaskProgress;
00083         static bool TimeTriggeredTaskRegistered;
00084
00085         static String^ ApplicationTriggerTaskProgress;
00086         static bool ApplicationTriggerTaskRegistered;
00087         static String^ ApplicationTriggerTaskResult;
00088
00089         static String^ GroupedBackgroundTaskProgress;
00090         static bool GroupedBackgroundTaskRegistered;
00091
00092         static Windows::Foundation::Collections::PropertySet^ TaskStatuses;
00093     };
00094 }
00095
00096
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cs/SampleConfiguration.cs Source File

  • UserInfo
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Collections.ObjectModel;
00015 using System.ComponentModel;
00016 using System.Threading.Tasks;
00017 using Windows.System;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public partial class MainPage : Page
00023     {
00024         public const string FEATURE_NAME = "Account picture name C# sample";
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title = "Find users", ClassType = typeof(Scenario1_FindUsers) },
00029             new Scenario() { Title = "Watch users", ClassType = typeof(Scenario2_WatchUsers) },
00030             new Scenario() { Title = "Check user consent group", ClassType = typeof(Scenario3_CheckUserConsentGroup) },
00031         };
00032
00033         public static async Task<ObservableCollection<UserViewModel>> GetUserViewModelsAsync()
00034         {
00035             // Populate the list of users.
00036             IReadOnlyList<User> users = await User.FindAllAsync();
00037             var observableUsers = new ObservableCollection<UserViewModel>();
00038             int userNumber = 1;
00039             foreach (User user in users)
00040             {
00041                 string displayName = (string)await user.GetPropertyAsync(KnownUserProperties.DisplayName);
00042
00043                 // Choose a generic name if we do not have access to the actual name.
00044                 if (String.IsNullOrEmpty(displayName))
00045                 {
00046                     displayName = "User #" + userNumber.ToString();
00047                     userNumber++;
00048                 }
00049                 observableUsers.Add(new UserViewModel(user.NonRoamableId, displayName));
00050             }
00051             return observableUsers;
00052         }
00053     }
00054
00055     public class Scenario
00056     {
00057         public string Title { get; set; }
00058         public Type ClassType { get; set; }
00059     }
00060
00061     // This is an observable object that we data-bind the combo box / list box to.
00062     public class UserViewModel : INotifyPropertyChanged
00063     {
00064         public UserViewModel(String userId, String displayName)
00065         {
00066             this.UserId = userId;
00067             this.displayName = displayName;
00068         }
00069
00070         public event PropertyChangedEventHandler PropertyChanged;
00071
00072         public String UserId { get; private set; }
00073         public String DisplayName
00074         {
00075             get
00076             {
00077                 return displayName;
00078             }
00079             set
00080             {
00081                 displayName = value;
00082                 if (PropertyChanged != null)
00083                 {
00084                     PropertyChanged(this, new PropertyChangedEventArgs("DisplayName"));
00085                 }
00086             }
00087         }
00088
00089         String displayName;
00090     }
00091 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/ViewModel/TripVoiceCommand.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • ViewModel

TripVoiceCommand.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 namespace AdventureWorks
00014 {
00015     ref class TripVoiceCommand sealed
00016     {
00017     public:
00018         TripVoiceCommand(
00019             Platform::String^ voiceCommandName,
00020             Platform::String^ commandMode,
00021             Platform::String^ textSpoken,
00022             Platform::String^ destination);
00023
00024         property Platform::String^ VoiceCommandName
00025         {
00026             Platform::String^ get();
00027         }
00028
00029         property Platform::String^ CommandMode
00030         {
00031             Platform::String^ get();
00032         }
00033
00034         property Platform::String^ TextSpoken
00035         {
00036             Platform::String^ get();
00037         }
00038
00039         property Platform::String^ Destination
00040         {
00041             Platform::String^ get();
00042         }
00043
00044     private:
00045         Platform::String^ voiceCommandName;
00046         Platform::String^ commandMode;
00047         Platform::String^ textSpoken;
00048         Platform::String^ destination;
00049     };
00050 }
00051
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/DirectXHelper.cs Source File

  • BasicHologram
  • cs
  • Common

DirectXHelper.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.IO;
00005 using System.Text;
00006 using System.Threading.Tasks;
00007 using Windows.Storage;
00008 using System.Numerics;
00009
00010 namespace BasicHologram.Common
00011 {
00012     internal static class DirectXHelper
00013     {
00014         /// <summary>
00015         /// Function that reads from a binary file asynchronously.
00016         /// </summary>
00017         internal static async Task<byte[]> ReadDataAsync(StorageFile file)
00018         {
00019             using (var stream = await file.OpenStreamForReadAsync())
00020             {
00021                 byte[] buffer = new byte[stream.Length];
00022                 await stream.ReadAsync(buffer, 0, buffer.Length);
00023                 return buffer;
00024             }
00025         }
00026
00027         private const float DipsPerInch = 96.0f;
00028
00029         /// <summary>
00030         /// Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00031         /// </summary>
00032         internal static double ConvertDipsToPixels(double dips, double dpi)
00033         {
00034             return Math.Floor(dips * dpi / DipsPerInch + 0.5f); // Round to nearest integer.
00035         }
00036
00037 #if DEBUG
00038         /// <summary>
00039         /// Check for SDK Layer support.
00040         /// </summary>
00041         internal static bool SdkLayersAvailable()
00042         {
00043             try
00044             {
00045                 using (var device = new SharpDX.Direct3D11.Device(SharpDX.Direct3D.DriverType.Null, SharpDX.Direct3D11.DeviceCreationFlags.Debug))
00046                 {
00047                     return true;
00048                 }
00049             }
00050             catch
00051             {
00052                 return false;
00053             }
00054         }
00055 #endif
00056     }
00057 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_AdvancedUserActivity Member List

This is the complete list of members for Scenario2_AdvancedUserActivity, including all inherited members.
_currentSession | Scenario2_AdvancedUserActivity | [private]
CreateUserActivityAsync() | Scenario2_AdvancedUserActivity | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_AdvancedUserActivity | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_AdvancedUserActivity | [inline, protected]
Scenario2_AdvancedUserActivity() | Scenario2_AdvancedUserActivity | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/pch.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //-----------------------------------------------------------------------------
00013 // <auto-generated>
00014 //   This code was generated by a tool.
00015 //
00016 //   Changes to this file may cause incorrect behavior and will be lost if
00017 //   the code is regenerated.
00018 //
00019 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00020 // </auto-generated>
00021 //-----------------------------------------------------------------------------
00022 #pragma once
00023
00024 #include <windows.h>
00025 #include <ppltasks.h>
00026 #include <concrt.h>
00027 #include <collection.h>
00028 #include <windows.devices.alljoyn.interop.h>
00029 #include <map>
00030
00031 #include <alljoyn_c/busattachment.h>
00032 #include <alljoyn_c/dbusstddefines.h>
00033 #include <alljoyn_c/AboutData.h>
00034 #include <alljoyn_c/AboutObj.h>
00035 #include <alljoyn_c/AboutObjectDescription.h>
00036
00037 #include "AllJoynHelpers.h"
00038 #include "AllJoynBusObjectManager.h"
00039
00040 #define PROJECT_NAMESPACE org::alljoyn::Onboarding
00041
00042 #include "OnboardingStructures.h"
00043 #include "TypeConversionHelpers.h"
00044 #include "OnboardingMethodResults.h"
00045 #include "OnboardingEventArgs.h"
00046 #include "IOnboardingService.h"
00047 #include "OnboardingSignals.h"
00048 #include "OnboardingLegacySignals.h"
00049 #include "OnboardingProducer.h"
00050 #include "OnboardingConsumer.h"
00051 #include "OnboardingServiceEventArgs.h"
00052 #include "OnboardingServiceEventAdapter.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InvertBoolConverter Member List

This is the complete list of members for InvertBoolConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | InvertBoolConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | InvertBoolConverter | [inline]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_InkingAndInteractionFeedback Member List

This is the complete list of members for Scenario5_InkingAndInteractionFeedback, including all inherited members.
deltaTransform | Scenario5_InkingAndInteractionFeedback | [private]
GetSnappedPoint() | Scenario5_InkingAndInteractionFeedback | [inline, private]
gridSize | Scenario5_InkingAndInteractionFeedback | [private]
hapticsController | Scenario5_InkingAndInteractionFeedback | [private]
InitializeGridLines() | Scenario5_InkingAndInteractionFeedback | [inline, private]
InitializeManipulationTransforms() | Scenario5_InkingAndInteractionFeedback | [inline, private]
IsInSnapRange() | Scenario5_InkingAndInteractionFeedback | [inline, private]
MovableRect_Entered(object sender, PointerRoutedEventArgs e) | Scenario5_InkingAndInteractionFeedback | [inline, private]
MovableRect_Exited(object sender, PointerRoutedEventArgs e) | Scenario5_InkingAndInteractionFeedback | [inline, private]
MovableRect_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) | Scenario5_InkingAndInteractionFeedback | [inline, private]
MovableRect_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) | Scenario5_InkingAndInteractionFeedback | [inline, private]
MovableRect_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) | Scenario5_InkingAndInteractionFeedback | [inline, private]
penDevice | Scenario5_InkingAndInteractionFeedback | [private]
previewTopLeft | Scenario5_InkingAndInteractionFeedback | [private]
previousTransform | Scenario5_InkingAndInteractionFeedback | [private]
Scenario5_InkingAndInteractionFeedback() | Scenario5_InkingAndInteractionFeedback | [inline]
snapDistance | Scenario5_InkingAndInteractionFeedback | [private]
SnapMovableRectToGridLines() | Scenario5_InkingAndInteractionFeedback | [inline, private]
topLeft | Scenario5_InkingAndInteractionFeedback | [private]
transforms | Scenario5_InkingAndInteractionFeedback | [private]
UpdatePreviewRect() | Scenario5_InkingAndInteractionFeedback | [inline, private]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VideoGallery Member List

This is the complete list of members for VideoGallery, including all inherited members.
GalleryGridView_ItemClick(object sender, ItemClickEventArgs e) | VideoGallery | [inline, private]
mainviewId | VideoGallery | [static]
sampleVideos | VideoGallery | [private, static]
VideoGallery() | VideoGallery | [inline]
VideoGallery_Loaded(object sender, RoutedEventArgs e) | VideoGallery | [inline, private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8_TransmitAPDU Member List

This is the complete list of members for Scenario8_TransmitAPDU, including all inherited members.
Scenario8_TransmitAPDU() | Scenario8_TransmitAPDU
Transmit_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario8_TransmitAPDU
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Utilities.h Source File

  • CustomHidDeviceAccess
  • cpp

Utilities.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008
00009 #include "pch.h"
00010 #include "SampleConfiguration.h"
00011 #include "EventHandlerForDevice.h"
00012
00013 namespace SDKTemplate
00014 {
00015     class Utilities
00016     {
00017     public:
00018         static void SetUpDeviceScenarios(
00019             Windows::Foundation::Collections::IMap<SDKTemplate::DeviceType, Windows::UI::Xaml::UIElement^>^ scenarios,
00020             Windows::UI::Xaml::UIElement^ scenarioContainer);
00021
00022         static void NotifyDeviceNotConnected(void);
00023
00024         static DeviceType GetDeviceType(Windows::Devices::HumanInterfaceDevice::HidDevice^ device);
00025
00026         static bool IsSuperMuttDevice(Windows::Devices::HumanInterfaceDevice::HidDevice^ device);
00027
00028         static Platform::String^ ConvertToHex16Bit(uint16 value);
00029
00030         static Platform::String^ ConvertToHex8Bit(uint8 value);
00031
00032         static Platform::String^ ConvertToHex(uint32 value);
00033     };
00034 }
00035
Generated on Fri Nov 15 2024 22:19:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/SampleConfiguration.cs Source File

  • CustomCapability
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "CustomCapability";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Connect to an NT Service",           ClassType=typeof(MeteringData)},
00025             new Scenario() { Title="Connect to the FX2 Device",          ClassType=typeof(DeviceConnect) },
00026             new Scenario() { Title="Send IOCTLs to the device",          ClassType=typeof(DeviceIO) },
00027             new Scenario() { Title="Handle asynchronous device events",  ClassType=typeof(DeviceEvents) },
00028             new Scenario() { Title="Read and Write operations",          ClassType=typeof(DeviceReadWrite) },
00029             new Scenario() { Title="Custom system event trigger",        ClassType=typeof(CustomTrigger) },
00030             new Scenario() { Title="Firmware access",                    ClassType=typeof(FirmwareAccess) },
00031         };
00032     }
00033
00034     public class Scenario
00035     {
00036         public string Title { get; set; }
00037         public Type ClassType { get; set; }
00038     }
00039 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
DisplaySizeClass() | sealed
GetDisplaySizeInInches() | sealed
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AccessHandler Member List

This is the complete list of members for AccessHandler, including all inherited members.
AccessHandler(SmartCardConnection ScConnection) | AccessHandler | [inline]
connectionObject | AccessHandler | [private]
GetUidAsync() | AccessHandler | [inline]
ReadAsync(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList) | AccessHandler | [inline]
TransparentExchangeAsync(byte[] commandData) | AccessHandler | [inline]
WriteAsync(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData) | AccessHandler | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compass/cs/Scenario1_DataEvents.xaml.cs Source File

  • Compass
  • cs

Scenario1_DataEvents.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.Sensors;
00015 using Windows.Foundation;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario1_DataEvents : Page
00024     {
00025         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00026         // as NotifyUser()
00027         MainPage rootPage = MainPage.Current;
00028
00029         private Compass _compass;
00030         private uint _desiredReportInterval;
00031
00032         public Scenario1_DataEvents()
00033         {
00034             this.InitializeComponent();
00035
00036             _compass = Compass.GetDefault();
00037             if (_compass != null)
00038             {
00039                 // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00040                 // This value will be used later to activate the sensor.
00041                 uint minReportInterval = _compass.MinimumReportInterval;
00042                 _desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
00043             }
00044             else
00045             {
00046                 rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
00047             }
00048         }
00049
00050         /// <summary>
00051         /// Invoked when this page is about to be displayed in a Frame.
00052         /// </summary>
00053         /// <param name="e">Event data that describes how this page was reached. The Parameter
00054         /// property is typically used to configure the page.</param>
00055         protected override void OnNavigatedTo(NavigationEventArgs e)
00056         {
00057             ScenarioEnableButton.IsEnabled = true;
00058             ScenarioDisableButton.IsEnabled = false;
00059         }
00060
00061         /// <summary>
00062         /// Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
00063         /// </summary>
00064         /// <param name="e">
00065         /// Event data that can be examined by overriding code. The event data is representative
00066         /// of the navigation that will unload the current Page unless canceled. The
00067         /// navigation can potentially be canceled by setting Cancel.
00068         /// </param>
00069         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00070         {
00071             if (ScenarioDisableButton.IsEnabled)
00072             {
00073                 Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00074                 _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
00075
00076                 // Restore the default report interval to release resources while the sensor is not in use
00077                 _compass.ReportInterval = 0;
00078             }
00079
00080             base.OnNavigatingFrom(e);
00081         }
00082
00083         /// <summary>
00084         /// This is the event handler for VisibilityChanged events. You would register for these notifications
00085         /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00086         /// </summary>
00087         /// <param name="sender"></param>
00088         /// <param name="e">
00089         /// Event data that can be examined for the current visibility state.
00090         /// </param>
00091         private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
00092         {
00093             if (ScenarioDisableButton.IsEnabled)
00094             {
00095                 if (e.Visible)
00096                 {
00097                     // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00098                     _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
00099                 }
00100                 else
00101                 {
00102                     // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00103                     _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
00104                 }
00105             }
00106         }
00107
00108         /// <summary>
00109         /// This is the event handler for ReadingChanged events.
00110         /// </summary>
00111         /// <param name="sender"></param>
00112         /// <param name="e"></param>
00113         async private void ReadingChanged(object sender, CompassReadingChangedEventArgs e)
00114         {
00115             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00116             {
00117                 CompassReading reading = e.Reading;
00118                 ScenarioOutput_MagneticNorth.Text = String.Format("{0,5:0.00}", reading.HeadingMagneticNorth);
00119                 if (reading.HeadingTrueNorth != null)
00120                 {
00121                     ScenarioOutput_TrueNorth.Text = String.Format("{0,5:0.00}", reading.HeadingTrueNorth);
00122                 }
00123                 else
00124                 {
00125                     ScenarioOutput_TrueNorth.Text = "No data";
00126                 }
00127                 switch (reading.HeadingAccuracy)
00128                 {
00129                     case MagnetometerAccuracy.Unknown:
00130                         ScenarioOutput_HeadingAccuracy.Text = "Unknown";
00131                         break;
00132                     case MagnetometerAccuracy.Unreliable:
00133                         ScenarioOutput_HeadingAccuracy.Text = "Unreliable";
00134                         break;
00135                     case MagnetometerAccuracy.Approximate:
00136                         ScenarioOutput_HeadingAccuracy.Text = "Approximate";
00137                         break;
00138                     case MagnetometerAccuracy.High:
00139                         ScenarioOutput_HeadingAccuracy.Text = "High";
00140                         break;
00141                     default:
00142                         ScenarioOutput_HeadingAccuracy.Text = "No data";
00143                         break;
00144                 }
00145             });
00146         }
00147
00148         /// <summary>
00149         /// This is the click handler for the 'Enable' button.
00150         /// </summary>
00151         /// <param name="sender"></param>
00152         /// <param name="e"></param>
00153         private void ScenarioEnable(object sender, RoutedEventArgs e)
00154         {
00155             if (_compass != null)
00156             {
00157                 // Establish the report interval
00158                 _compass.ReportInterval = _desiredReportInterval;
00159
00160                 Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(VisibilityChanged);
00161                 _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
00162
00163                 ScenarioEnableButton.IsEnabled = false;
00164                 ScenarioDisableButton.IsEnabled = true;
00165             }
00166             else
00167             {
00168                 rootPage.NotifyUser("No compass found", NotifyType.ErrorMessage);
00169             }
00170         }
00171
00172         /// <summary>
00173         /// This is the click handler for the 'Disable' button.
00174         /// </summary>
00175         /// <param name="sender"></param>
00176         /// <param name="e"></param>
00177         private void ScenarioDisable(object sender, RoutedEventArgs e)
00178         {
00179             Window.Current.VisibilityChanged -= new WindowVisibilityChangedEventHandler(VisibilityChanged);
00180             _compass.ReadingChanged -= new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);
00181
00182             // Restore the default report interval to release resources while the sensor is not in use
00183             _compass.ReportInterval = 0;
00184
00185             ScenarioEnableButton.IsEnabled = true;
00186             ScenarioDisableButton.IsEnabled = false;
00187         }
00188     }
00189 }
Generated on Fri Nov 15 2024 22:17:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/SampleConfiguration.h Source File

  • SimpleInk
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "SimpleInk C++ Sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047
00048     class HelperFunctions
00049     {
00050     public:
00051         static void UpdateCanvasSize(Windows::UI::Xaml::FrameworkElement^ root, Windows::UI::Xaml::FrameworkElement^ output, Windows::UI::Xaml::FrameworkElement^ inkCanvas);
00052     };
00053 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/SampleConfiguration.h Source File

  • Logging
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace winrt::SDKTemplate
00015 {
00016 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ImagePage Member List

This is the complete list of members for ImagePage, including all inherited members.
ImagePage() | ImagePage | [inline]
OnBackRequested(object sender, BackRequestedEventArgs e) | ImagePage | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | ImagePage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | ImagePage | [inline, protected]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/pch.h Source File

  • Json
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include <winrt/Windows.Foundation.h>
00005 #include <winrt/Windows.Foundation.Collections.h>
00006 #include <winrt/Windows.ApplicationModel.Activation.h>
00007 #include <winrt/Windows.Data.Json.h>
00008 #include <winrt/Windows.System.h>
00009 #include <winrt/Windows.UI.Core.h>
00010 #include <winrt/Windows.UI.Xaml.h>
00011 #include <winrt/Windows.UI.Xaml.Automation.Peers.h>
00012 #include <winrt/Windows.UI.Xaml.Controls.h>
00013 #include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
00014 #include <winrt/Windows.UI.Xaml.Documents.h>
00015 #include <winrt/Windows.UI.Xaml.Interop.h>
00016 #include <winrt/Windows.UI.Xaml.Markup.h>
00017 #include <winrt/Windows.UI.Xaml.Media.h>
00018 #include <winrt/Windows.UI.Xaml.Navigation.h>
00019 #include "School.h"
00020 #include "User.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Tasks/LocationBackgroundTask.h Source File

  • Geolocation
  • cppwinrt
  • Tasks

LocationBackgroundTask.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 #include "LocationBackgroundTask.g.h"
00004
00005 namespace winrt::BackgroundTask::implementation
00006 {
00007     struct LocationBackgroundTask : LocationBackgroundTaskT<LocationBackgroundTask>
00008     {
00009         LocationBackgroundTask() = default;
00010
00011         fire_and_forget Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const& taskInstance);
00012
00013     private:
00014         slim_mutex m_mutex;
00015         Windows::Foundation::IAsyncOperation<Windows::Devices::Geolocation::Geoposition> m_pendingOperation;
00016         Windows::Foundation::Collections::IPropertySet m_values{ Windows::Storage::ApplicationData::Current().LocalSettings().Values() };
00017
00018         void WriteGeolocToAppData(Windows::Devices::Geolocation::Geoposition const& pos);
00019         void WipeGeolocDataFromAppData();
00020         void WriteStatusToAppData(hstring const& status);
00021         void OnCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance const&, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason);
00022     };
00023 }
00024
00025 namespace winrt::BackgroundTask::factory_implementation
00026 {
00027     struct LocationBackgroundTask : LocationBackgroundTaskT<LocationBackgroundTask, implementation::LocationBackgroundTask>
00028     {
00029     };
00030 }
Generated on Fri Nov 15 2024 22:19:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Lang Member List

This is the complete list of members for Scenario2_Lang, including all inherited members.
Scenario2_Lang() | Scenario2_Lang
ShowResults_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Lang
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/Scenario6_Styling.xaml.cpp Source File

  • XamlCommanding
  • cpp

Scenario6_Styling.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // Scenario6_Styling.xaml.cpp
00003 // Implementation of the Scenario6_Styling class
00004 //
00005
00006 #include "pch.h"
00007 #include "Scenario6_Styling.xaml.h"
00008
00009 using namespace SDKTemplate;
00010
00011 using namespace Platform;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::UI::Xaml;
00015 using namespace Windows::UI::Xaml::Controls;
00016 using namespace Windows::UI::Xaml::Controls::Primitives;
00017 using namespace Windows::UI::Xaml::Data;
00018 using namespace Windows::UI::Xaml::Input;
00019 using namespace Windows::UI::Xaml::Media;
00020 using namespace Windows::UI::Xaml::Navigation;
00021
00022 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00023
00024 Scenario6_Styling::Scenario6_Styling()
00025 {
00026     InitializeComponent();
00027 }
Generated on Fri Nov 15 2024 22:22:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario1.xaml.cs Source File

  • XamlCommanding
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016
00017 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00018
00019 namespace Commanding
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class Scenario1 : Page
00025     {
00026         public Scenario1()
00027         {
00028             this.InitializeComponent();
00029         }
00030     }
00031 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • OrientationSensor
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::Sensors;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::UI::Core;
00028 using namespace Platform;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents()
00031 {
00032     InitializeComponent();
00033 }
00034
00035 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00036 {
00037     sensor = OrientationSensor::GetDefault(rootPage->SensorReadingType, rootPage->SensorOptimizationGoal);
00038     if (sensor != nullptr)
00039     {
00040         rootPage->NotifyUser(rootPage->SensorDescription + " is ready", NotifyType::StatusMessage);
00041         ScenarioEnableButton->IsEnabled = true;
00042     }
00043     else
00044     {
00045         rootPage->NotifyUser(rootPage->SensorDescription + " not found", NotifyType::ErrorMessage);
00046     }
00047 }
00048
00049 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00050 {
00051     if (ScenarioDisableButton->IsEnabled)
00052     {
00053         ScenarioDisable();
00054     }
00055 }
00056
00057 /// <summary>
00058 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00059 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00060 /// </summary>
00061 /// <param name="sender"></param>
00062 /// <param name="e">
00063 /// Event data that can be examined for the current visibility state.
00064 /// </param>
00065 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00066 {
00067     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00068     if (ScenarioDisableButton->IsEnabled)
00069     {
00070         if (e->Visible)
00071         {
00072             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00073             readingToken = sensor->ReadingChanged += ref new TypedEventHandler<OrientationSensor^, OrientationSensorReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);
00074         }
00075         else
00076         {
00077             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00078             sensor->ReadingChanged -= readingToken;
00079         }
00080     }
00081 }
00082
00083 void Scenario1_DataEvents::ReadingChanged(OrientationSensor^ sender, OrientationSensorReadingChangedEventArgs^ e)
00084 {
00085     // We need to dispatch to the UI thread to display the output
00086     Dispatcher->RunAsync(
00087         CoreDispatcherPriority::Normal,
00088         ref new DispatchedHandler(
00089             [this, e]()
00090             {
00091                 MainPage::SetReadingText(ScenarioOutput, e->Reading);
00092             },
00093             CallbackContext::Any
00094             )
00095         );
00096 }
00097
00098 void Scenario1_DataEvents::ScenarioEnable()
00099 {
00100     // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00101     sensor->ReportInterval = (std::max)(sensor->MinimumReportInterval, 16U);
00102
00103     visibilityToken = Window::Current->VisibilityChanged += ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged);
00104     readingToken = sensor->ReadingChanged += ref new TypedEventHandler<OrientationSensor^, OrientationSensorReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);
00105
00106     ScenarioEnableButton->IsEnabled = false;
00107     ScenarioDisableButton->IsEnabled = true;
00108 }
00109
00110 void Scenario1_DataEvents::ScenarioDisable()
00111 {
00112     Window::Current->VisibilityChanged -= visibilityToken;
00113     sensor->ReadingChanged -= readingToken;
00114
00115     // Restore the default report interval to release resources while the sensor is not in use
00116     sensor->ReportInterval = 0;
00117
00118     ScenarioEnableButton->IsEnabled = true;
00119     ScenarioDisableButton->IsEnabled = false;
00120 }
Generated on Fri Nov 15 2024 22:17:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Scenario4_InputOutputReports.xaml.cpp Source File

  • CustomHidDeviceAccess
  • cpp

Scenario4_InputOutputReports.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 //
00008 // Scenario4_InputOutputReports.xaml.cpp
00009 // Implementation of the Scenario4_InputOutputReports class
00010 //
00011
00012 #include "pch.h"
00013 #include "Utilities.h"
00014 #include "EventHandlerForDevice.h"
00015 #include "Scenario4_InputOutputReports.xaml.h"
00016 #include "MainPage.xaml.h"
00017
00018 using namespace SDKTemplate;
00019
00020 using namespace Platform;
00021 using namespace Platform::Collections;
00022 using namespace Concurrency;
00023 using namespace Windows::Devices::HumanInterfaceDevice;
00024 using namespace Windows::Storage::Streams;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Navigation;
00027 using namespace Windows::UI::Xaml::Controls;
00028
00029 InputOutputReports::InputOutputReports()
00030 {
00031     InitializeComponent();
00032 }
00033
00034 /// <summary>
00035 /// Invoked when this page is about to be displayed in a Frame.
00036 ///
00037 /// We will enable/disable parts of the UI if the device doesn't support it.
00038 /// </summary>
00039 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040 /// property is typically used to configure the page.</param>
00041 void InputOutputReports::OnNavigatedTo(NavigationEventArgs^ /* e */)
00042 {
00043     // We will disable the scenario that is not supported by the device.
00044     // If no devices are connected, none of the scenarios will be shown and an error will be displayed
00045     Platform::Collections::Map<DeviceType, UIElement^>^ deviceScenarios = ref new Platform::Collections::Map<DeviceType, UIElement^>();
00046     deviceScenarios->Insert(DeviceType::SuperMutt, SuperMuttScenario);
00047
00048     Utilities::SetUpDeviceScenarios(deviceScenarios, DeviceScenarioContainer);
00049 }
00050
00051
00052 void InputOutputReports::GetNumericInputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs)
00053 {
00054     if (EventHandlerForDevice::Current->IsDeviceConnected)
00055     {
00056         ButtonGetNumericInputReport->IsEnabled = false;
00057
00058         // Re-enable get button after completing the set regardless of there was an error or not
00059         GetNumericInputReportAsync().then([this](task<void> getInputReportTask)
00060         {
00061             ButtonGetNumericInputReport->IsEnabled = true;
00062
00063             getInputReportTask.get();   // May throw exception if there was an error reading
00064         });
00065     }
00066     else
00067     {
00068         Utilities::NotifyDeviceNotConnected();
00069     }
00070 }
00071
00072 void InputOutputReports::SendNumericOutputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs)
00073 {
00074     if (EventHandlerForDevice::Current->IsDeviceConnected)
00075     {
00076         ButtonSendNumericOutputReport->IsEnabled = false;
00077
00078         uint8 pattern = static_cast<uint8>(NumericValueToWrite->SelectedIndex);
00079
00080         // Re-enable set button after completing the set regardless of there was an error or not
00081         SendNumericOutputReportAsync(pattern).then([this](task<void> sendOutputReportTask)
00082         {
00083             ButtonSendNumericOutputReport->IsEnabled = true;
00084
00085             sendOutputReportTask.get();   // May throw exception if there was an error reading
00086         });
00087     }
00088     else
00089     {
00090         Utilities::NotifyDeviceNotConnected();
00091     }
00092 }
00093
00094 void InputOutputReports::GetBooleanInputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs)
00095 {
00096     if (EventHandlerForDevice::Current->IsDeviceConnected)
00097     {
00098         ButtonGetBooleanInputReport->IsEnabled = false;
00099
00100         // Re-enable get button after completing the set regardless of there was an error or not
00101         // This sample will only demonstrate the first button
00102         GetBooleanInputReportAsync(1).then([this](task<void> getInputReportTask)
00103         {
00104             ButtonGetBooleanInputReport->IsEnabled = true;
00105
00106             getInputReportTask.get();   // May throw exception if there was an error reading
00107         });
00108     }
00109     else
00110     {
00111         Utilities::NotifyDeviceNotConnected();
00112     }
00113 }
00114
00115 void InputOutputReports::SendBooleanOutputReport_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ eventArgs)
00116 {
00117     if (EventHandlerForDevice::Current->IsDeviceConnected)
00118     {
00119         ButtonSendBooleanOutputReport->IsEnabled = false;
00120
00121         uint8 pattern = static_cast<uint8>(BooleanValueToWrite->SelectedIndex);
00122
00123         // Re-enable set button after completing the set regardless of there was an error or not
00124         // The sample will only demonstrate writing to the first button because writing to all other buttons are the same
00125         SendBooleanOutputReportAsync(pattern == 1 ? true : false, 1).then([this](task<void> sendOutputReportTask)
00126         {
00127             ButtonSendBooleanOutputReport->IsEnabled = true;
00128
00129             sendOutputReportTask.get();   // May throw exception if there was an error reading
00130         });
00131     }
00132     else
00133     {
00134         Utilities::NotifyDeviceNotConnected();
00135     }
00136 }
00137
00138 /// <summary>
00139 /// Uses an input report to get the value that was previously written to the device with output report.
00140 ///
00141 /// We will be using controls to modify the data buffer. See SendNumericOutputReportAsync for how to modify the data buffer directly.
00142 ///
00143 /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00144 /// at the end of the task chain.
00145 /// </summary>
00146 /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00147 task<void> InputOutputReports::GetNumericInputReportAsync(void)
00148 {
00149     return create_task(EventHandlerForDevice::Current->Device->GetInputReportAsync(SuperMutt::ReadWriteBufferControlInformation::ReportId))
00150         .then([](task<HidInputReport^> inputReportTask)
00151     {
00152         auto inputReport = inputReportTask.get(); // Pass down the error if one occurred
00153         auto inputReportControl = inputReport->GetNumericControl(SuperMutt::ReadWriteBufferControlInformation::VolumeUsagePage, SuperMutt::ReadWriteBufferControlInformation::VolumeUsageId);
00154
00155         auto data = inputReportControl->Value;
00156
00157         MainPage::Current->NotifyUser("Value read: " + data, NotifyType::StatusMessage);
00158     });
00159 }
00160
00161 /// <summary>
00162 /// Uses an output report to write data to the device so that it can be read back using input report.
00163 ///
00164 /// Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying
00165 /// data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing (
00166 /// all bits are zeroed out except for the bits we care about).
00167 ///
00168 /// We will modify the data buffer directly. See GetNumericInputReportAsync for how to use controls.
00169 ///
00170 /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00171 /// at the end of the task chain.
00172 /// </summary>
00173 /// <param name="valueToWrite"></param>
00174 /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00175 task<void> InputOutputReports::SendNumericOutputReportAsync(uint8 valueToWrite)
00176 {
00177     auto outputReport = EventHandlerForDevice::Current->Device->CreateOutputReport(SuperMutt::ReadWriteBufferControlInformation::ReportId);
00178
00179     // Our data is supposed to be stored in the upper 4 bits of the byte
00180     uint8 byteToWrite = (uint8)(valueToWrite << SuperMutt::ReadWriteBufferControlInformation::VolumeDataStartBit);
00181
00182     auto dataWriter = ref new DataWriter();
00183
00184     // Report Id is always the first byte
00185     dataWriter->WriteByte((uint8)outputReport->Id);
00186     dataWriter->WriteByte(byteToWrite);
00187
00188     outputReport->Data = dataWriter->DetachBuffer();
00189
00190     return create_task(EventHandlerForDevice::Current->Device->SendOutputReportAsync(outputReport))
00191         .then([valueToWrite](task<uint32> bytesWrittenTask)
00192     {
00193         // bytesWrittenTask.get() either returns the number of bytes written or throws an exception
00194         // if SendOutputReportAsync() failed.
00195         bytesWrittenTask.get();
00196
00197         MainPage::Current->NotifyUser("Value written: " + valueToWrite.ToString(), NotifyType::StatusMessage);
00198     });
00199 }
00200
00201 /// <summary>
00202 /// Uses an input report to get the value that was previously written to the device with output report.
00203 ///
00204 /// We will be using controls to modify the data buffer. See SendBooleanOutputReportAsync for how to modify the data buffer directly.
00205 ///
00206 /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00207 /// at the end of the task chain.
00208 /// </summary>
00209 /// <param name="buttonNumber">Button to get the value of (1-4)</param>
00210 /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00211 task<void> InputOutputReports::GetBooleanInputReportAsync(uint8 buttonNumber)
00212 {
00213     return create_task(EventHandlerForDevice::Current->Device->GetInputReportAsync(SuperMutt::ReadWriteBufferControlInformation::ReportId))
00214         .then([buttonNumber](task<HidInputReport^> inputReportTask)
00215     {
00216         auto inputReport = inputReportTask.get(); // Pass down the error if one occurred
00217         auto inputReportControl = inputReport->GetBooleanControl(
00218             SuperMutt::ReadWriteBufferControlInformation::ButtonUsagePage,
00219             SuperMutt::ReadWriteBufferControlInformation::ButtonUsageId[buttonNumber - 1]);
00220
00221         String^ data = inputReportControl->IsActive ? "1" : "0";
00222
00223         MainPage::Current->NotifyUser("Bit value: " + data, NotifyType::StatusMessage);
00224     });
00225 }
00226
00227 /// <summary>
00228 /// Uses an output report to write data to the device so that it can be read back using input report.
00229 ///
00230 /// Please note that when we create an OutputReport, all data is nulled out in the report. Since we will only be modifying
00231 /// data we care about, the other bits that we don't care about, will be zeroed out. Controls will effectively do the same thing (
00232 /// all bits are zeroed out except for the bits we care about).
00233 ///
00234 /// We will modify the data buffer directly. See GetBooleanInputReportAsync for how to use controls.
00235 ///
00236 /// Any errors in async function will be passed down the task chain and will not be caught here because errors should be handled
00237 /// at the end of the task chain.
00238 /// </summary>
00239 /// <param name="bitValue"></param>
00240 /// <param name="buttonNumber">Button to change value of (1-4)</param>
00241 /// <returns>A task that can be used to chain more methods after completing the scenario</returns>
00242 task<void> InputOutputReports::SendBooleanOutputReportAsync(bool bitValue, uint8 buttonNumber)
00243 {
00244     auto buttonIndex = buttonNumber - 1;    // Make 0 based index
00245
00246     auto outputReport = EventHandlerForDevice::Current->Device->CreateOutputReport(SuperMutt::ReadWriteBufferControlInformation::ReportId);
00247
00248     uint8 bitNumericValue = (uint8)(bitValue ? 0xFF : 0x00);
00249
00250     // Clear our button's data
00251     uint8 valueAfterSettingBit = (uint8)(bitNumericValue & SuperMutt::ReadWriteBufferControlInformation::ButtonDataMask[buttonIndex]);
00252
00253     auto dataWriter = ref new DataWriter();
00254
00255     // Report Id is always the first byte
00256     dataWriter->WriteByte((uint8)outputReport->Id);
00257     dataWriter->WriteByte(valueAfterSettingBit);
00258
00259     outputReport->Data = dataWriter->DetachBuffer();
00260
00261     return create_task(EventHandlerForDevice::Current->Device->SendOutputReportAsync(outputReport))
00262         .then([bitValue](task<uint32> bytesWrittenTask)
00263     {
00264         // bytesWrittenTask.get() either returns the number of bytes written or throws an exception
00265         // if SendOutputReportAsync() failed.
00266         bytesWrittenTask.get();
00267
00268         String^ valueWritten = bitValue ? "1" : "0";
00269         MainPage::Current->NotifyUser("Bit value written: " + valueWritten, NotifyType::StatusMessage);
00270     });
00271 }
Generated on Fri Nov 15 2024 22:19:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geolocation/cppwinrt/Scenario3_BackgroundTask.cpp Source File

  • Geolocation
  • cppwinrt

Scenario3_BackgroundTask.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_BackgroundTask.h"
00014 #include "Scenario3_BackgroundTask.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel::Background;
00019 using namespace winrt::Windows::Devices::Geolocation;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::Storage;
00022 using namespace winrt::Windows::UI::Xaml;
00023 using namespace winrt::Windows::UI::Xaml::Navigation;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario3_BackgroundTask::Scenario3_BackgroundTask()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario3_BackgroundTask::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034        // See if our background task is already registered.
00035         m_geolocTask = LookupBackgroundTask(BackgroundTaskName);
00036
00037         if (m_geolocTask != nullptr)
00038         {
00039             // Associate an event handler with the existing background task
00040             m_taskCompletedToken = m_geolocTask.Completed({ get_weak(), &Scenario3_BackgroundTask::OnCompleted });
00041         }
00042         UpdateButtonStates();
00043     }
00044
00045     void Scenario3_BackgroundTask::OnNavigatedFrom(NavigationEventArgs const&)
00046     {
00047         if (m_geolocTask != nullptr)
00048         {
00049             // Remove the event handler
00050             m_geolocTask.Completed(m_taskCompletedToken);
00051         }
00052     }
00053
00054     void Scenario3_BackgroundTask::RegisterBackgroundTask(IInspectable const&, RoutedEventArgs const&)
00055     {
00056         // Register the background task without checking whether the user has enabled background execution.
00057         // If it's disabled, and then the user later enables background execution, the background task will be ready to run.
00058         // Create a new background task builder
00059         BackgroundTaskBuilder geolocTaskBuilder;
00060
00061         geolocTaskBuilder.Name(BackgroundTaskName);
00062         geolocTaskBuilder.TaskEntryPoint(BackgroundTaskEntryPoint);
00063
00064         // Create a new timer triggering at a 15 minute interval
00065         TimeTrigger trigger(15, false);
00066
00067         // Associate the timer trigger with the background task builder
00068         geolocTaskBuilder.SetTrigger(trigger);
00069
00070         // Register the background task
00071         m_geolocTask = geolocTaskBuilder.Register();
00072
00073         // Associate an event handler with the new background task
00074         m_taskCompletedToken = m_geolocTask.Completed({ get_weak(), &Scenario3_BackgroundTask::OnCompleted });
00075
00076         UpdateButtonStates();
00077         CheckBackgroundAndRequestLocationAccess();
00078     }
00079
00080     void Scenario3_BackgroundTask::UnregisterBackgroundTask(IInspectable const&, RoutedEventArgs const&)
00081     {
00082         // Unregister the background task
00083         if (m_geolocTask != nullptr)
00084         {
00085             m_geolocTask.Unregister(true);
00086             m_geolocTask = nullptr;
00087         }
00088
00089         ScenarioOutput_Latitude().Text(L"No data");
00090         ScenarioOutput_Longitude().Text(L"No data");
00091         ScenarioOutput_Accuracy().Text(L"No data");
00092         UpdateButtonStates();
00093         m_rootPage.NotifyUser(L"Background task unregistered", NotifyType::StatusMessage);
00094     }
00095
00096     // This event handler is called when the background task is completed.
00097     fire_and_forget Scenario3_BackgroundTask::OnCompleted(IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs e)
00098     {
00099         auto lifetime = get_strong();
00100
00101         // Update the UI with progress reported by the background task
00102         co_await resume_foreground(Dispatcher());
00103
00104         try
00105         {
00106             // Rethrow any exception that occurred in the background task.
00107             e.CheckResult();
00108
00109             // Update the UI with the completion status of the background task
00110             // The Run method of the background task sets this status.
00111             ReportSavedStatus();
00112
00113             // Extract and display location data set by the background task if not null
00114             auto values = ApplicationData::Current().LocalSettings().Values();
00115             ScenarioOutput_Latitude().Text(unbox_value_or(values.TryLookup(L"Latitude"), L"No data"));
00116             ScenarioOutput_Longitude().Text(unbox_value_or(values.TryLookup(L"Longitude"), L"No data"));
00117             ScenarioOutput_Accuracy().Text(unbox_value_or(values.TryLookup(L"Accuracy"), L"No data"));
00118         }
00119         catch (...)
00120         {
00121             // The background task had an error
00122             m_rootPage.NotifyUser(to_message(), NotifyType::ErrorMessage);
00123         }
00124     }
00125
00126     // Update the enable state of the register/unregister buttons
00127     // based on whether we have already registered a task.
00128     void Scenario3_BackgroundTask::UpdateButtonStates()
00129     {
00130         bool registered = (m_geolocTask != nullptr);
00131         RegisterBackgroundTaskButton().IsEnabled(!registered);
00132         UnregisterBackgroundTaskButton().IsEnabled(registered);
00133     }
00134 }
Generated on Fri Nov 15 2024 22:19:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cpp/SampleConfiguration.h Source File

  • Gyrometer
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Gyrometer";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cs/SampleConfiguration.cs Source File

  • Accelerometer
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Devices.Sensors;
00015 using Windows.UI.Xaml.Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Accelerometer C# Sample";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title = "Choose accelerometer", ClassType = typeof(Scenario0_Choose) },
00026             new Scenario() { Title = "Data events", ClassType = typeof(Scenario1_DataEvents) },
00027             new Scenario() { Title = "Shake events", ClassType = typeof(Scenario2_ShakeEvents) },
00028             new Scenario() { Title = "Polling", ClassType = typeof(Scenario3_Polling) },
00029             new Scenario() { Title = "Orientation change", ClassType = typeof(Scenario4_OrientationChanged) },
00030             new Scenario() { Title = "Data events batching", ClassType = typeof(Scenario5_DataEventsBatching)}
00031         };
00032
00033         public static void SetReadingText(TextBlock textBlock, AccelerometerReading reading)
00034         {
00035             textBlock.Text = string.Format("X: {0,5:0.00}, Y: {1,5:0.00}, Z: {2,5:0.00}",
00036                 reading.AccelerationX, reading.AccelerationY, reading.AccelerationZ);
00037         }
00038
00039         public AccelerometerReadingType AccelerometerReadingType { get; set; } = AccelerometerReadingType.Standard;
00040     }
00041
00042     public class Scenario
00043     {
00044         public string Title { get; set; }
00045         public Type ClassType { get; set; }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_Input Member List

This is the complete list of members for Scenario4_Input, including all inherited members.
Scenario4_Input() | Scenario4_Input | [inline]
ShowResults_Click(object sender, RoutedEventArgs e) | Scenario4_Input | [inline, private]
Generated on Fri Nov 15 2024 22:23:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cppwinrt/Project.idl Source File

  • Clipboard
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass CopyText : Windows.UI.Xaml.Controls.Page
00016     {
00017         CopyText();
00018     }
00019
00020     [default_interface]
00021     runtimeclass CopyImage : Windows.UI.Xaml.Controls.Page
00022     {
00023         CopyImage();
00024     }
00025
00026     [default_interface]
00027     runtimeclass CopyFiles : Windows.UI.Xaml.Controls.Page
00028     {
00029         CopyFiles();
00030     }
00031
00032     [default_interface]
00033     runtimeclass HistoryAndRoaming : Windows.UI.Xaml.Controls.Page
00034     {
00035         HistoryAndRoaming();
00036     }
00037
00038     [default_interface]
00039     runtimeclass OtherScenarios : Windows.UI.Xaml.Controls.Page
00040     {
00041         OtherScenarios();
00042     }
00043 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cppwinrt/pch.h Source File

  • FullScreenMode
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.System.h"
00008 #include "winrt/Windows.UI.Core.h"
00009 #include "winrt/Windows.UI.ViewManagement.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00014 #include "winrt/Windows.UI.Xaml.Documents.h"
00015 #include "winrt/Windows.UI.Xaml.Input.h"
00016 #include "winrt/Windows.UI.Xaml.Interop.h"
00017 #include "winrt/Windows.UI.Xaml.Markup.h"
00018 #include "winrt/Windows.UI.Xaml.Media.h"
00019 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Connector Member List

This is the complete list of members for Scenario2_Connector, including all inherited members.
btnClose_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
btnFromId_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
btnIe_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
btnSendMessage_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
btnUnpair_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
btnWatcher_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_Connector |
ConnectedDevices() | Scenario2_Connector | [inline]
DiscoveredDevices() | Scenario2_Connector | [inline]
OnConnectionStatusChanged(Windows::Devices::WiFiDirect::WiFiDirectDevice const &sender, Windows::Foundation::IInspectable const &) | Scenario2_Connector | [private]
OnDeviceAdded(Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformation deviceInfo) | Scenario2_Connector | [private]
OnDeviceRemoved(Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate) | Scenario2_Connector | [private]
OnDeviceUpdated(Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Devices::Enumeration::DeviceInformationUpdate deviceInfoUpdate) | Scenario2_Connector | [private]
OnEnumerationCompleted(Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Foundation::IInspectable const &) | Scenario2_Connector | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_Connector |
OnStopped(Windows::Devices::Enumeration::DeviceWatcher const &, Windows::Foundation::IInspectable const &) | Scenario2_Connector | [private]
publisher | Scenario2_Connector | [private]
Scenario2_Connector() | Scenario2_Connector |
StopWatcher() | Scenario2_Connector | [private]
watcherAddedToken | Scenario2_Connector | [private]
watcherEnumerationCompletedToken | Scenario2_Connector | [private]
watcherRemovedToken | Scenario2_Connector | [private]
watcherStoppedToken | Scenario2_Connector | [private]
watcherUpdatedToken | Scenario2_Connector | [private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Json/cppwinrt/pch.cpp Source File

  • Json
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cppwinrt/SampleConfiguration.h Source File

  • MultipleViews
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014 #include "App.h"
00015
00016 namespace winrt::SDKTemplate
00017 {
00018     struct SampleState
00019     {
00020         static implementation::App* CurrentApp;
00021         static Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> SecondaryViews;
00022         static Windows::UI::Core::CoreDispatcher MainDispatcher;
00023         static int32_t MainViewId;
00024         static void UpdateTitle(hstring newTitle, int32_t viewId);
00025     };
00026
00027     inline void App_Construct(implementation::App* app) { SampleState::CurrentApp = app; }
00028     bool App_OverrideOnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const& e);
00029     fire_and_forget App_OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs const&);
00030 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Unicode/cppwinrt/Scenario1_FindId.cpp Source File

  • Unicode
  • cppwinrt

Scenario1_FindId.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_FindId.h"
00014 #include "Scenario1_FindId.g.cpp"
00015 #include <sstream>
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Data::Text;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace
00023 {
00024     // This is a helper method that an app could create to find one or all available
00025     // ids within a string.  An id begins with a character for which IsIdStart,
00026     // and continues with characters that are IsIdContinue. Invalid sequences are ignored.
00027     std::vector<std::wstring> FindIdsInString(std::wstring_view const& inputString)
00028     {
00029         // Vector where we maintain the ids found in the input string
00030         std::vector<std::wstring> idList;
00031
00032         // Maintains the beginning index of the id found in the input string
00033         size_t indexIdStart = std::wstring_view::npos;
00034
00035         // Iterate through each of the characters in the string
00036         size_t i = 0;
00037         while (i < inputString.size())
00038         {
00039             size_t nextIndex;
00040             uint32_t codepoint = inputString[i];
00041
00042             if (UnicodeCharacters::IsHighSurrogate(codepoint))
00043             {
00044                 // If the character is a high surrogate, then the next characters must be a low surrogate.
00045                 if ((i < inputString.size()) && (UnicodeCharacters::IsLowSurrogate(inputString[i + 1])))
00046                 {
00047                     // Update the code point with the surrogate pair.
00048                     codepoint = UnicodeCharacters::GetCodepointFromSurrogatePair(codepoint, inputString[i + 1]);
00049                     nextIndex = i + 2;
00050                 }
00051                 else
00052                 {
00053                     // Warning: High surrogate not followed by low surrogate.
00054                     codepoint = 0;
00055                     nextIndex = i + 1;
00056                 }
00057             }
00058             else
00059             {
00060                 // Not a surrogate pair.
00061                 nextIndex = i + 1;
00062             }
00063
00064             if (indexIdStart == std::wstring_view::npos)
00065             {
00066                 // Not in an id. Have we found an id start?
00067                 if (UnicodeCharacters::IsIdStart(codepoint))
00068                 {
00069                     indexIdStart = i;
00070                 }
00071             }
00072             else if (!UnicodeCharacters::IsIdContinue(codepoint))
00073             {
00074                 // We have not found an id continue, so the id is complete.  We need to
00075                 // create the identifier string
00076                 idList.emplace_back(inputString.substr(indexIdStart, i - indexIdStart));
00077
00078                 // Reset back the index start and re-examine the current code point
00079                 // in next iteration
00080                 indexIdStart = std::wstring::npos;
00081                 nextIndex = i;
00082             }
00083             i = nextIndex;
00084         }
00085
00086         // Do we have a pending id at the end of the string?
00087         if (indexIdStart != std::wstring_view::npos)
00088         {
00089             //  We need to create the identifier string
00090             idList.emplace_back(inputString.substr(indexIdStart, i - indexIdStart));
00091         }
00092
00093         // Return the list of identifiers found in the string
00094         return idList;
00095     }
00096 }
00097
00098 namespace winrt::SDKTemplate::implementation
00099 {
00100     Scenario1_FindId::Scenario1_FindId()
00101     {
00102         InitializeComponent();
00103     }
00104
00105
00106     void Scenario1_FindId::Default_Click(IInspectable const&, RoutedEventArgs const&)
00107     {
00108         std::wstringstream result;
00109         bool first = true;
00110         for (auto id : FindIdsInString(TextInput().Text()))
00111         {
00112             if (!first)
00113             {
00114                 result << L", ";
00115             }
00116             first = false;
00117             result << id;
00118         }
00119
00120         TextOutput().Text(result.str());
00121     }
00122 }
Generated on Fri Nov 15 2024 22:21:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/pch.h Source File

  • PdfDocument
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.Data.Pdf.h"
00008 #include "winrt/Windows.Storage.h"
00009 #include "winrt/Windows.Storage.Pickers.h"
00010 #include "winrt/Windows.Storage.Streams.h"
00011 #include "winrt/Windows.System.h"
00012 #include "winrt/Windows.UI.Core.h"
00013 #include "winrt/Windows.UI.Xaml.h"
00014 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00015 #include "winrt/Windows.UI.Xaml.Controls.h"
00016 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00017 #include "winrt/Windows.UI.Xaml.Documents.h"
00018 #include "winrt/Windows.UI.Xaml.Interop.h"
00019 #include "winrt/Windows.UI.Xaml.Markup.h"
00020 #include "winrt/Windows.UI.Xaml.Media.h"
00021 #include "winrt/Windows.UI.Xaml.Media.Imaging.h"
00022 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MultipleViews/cs/App.xaml.cs Source File

  • MultipleViews
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Activation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// Provides application-specific behavior to supplement the default Application class.
00026     /// </summary>
00027     sealed partial class App : Application
00028     {
00029         /// <summary>
00030         /// Initializes the singleton application object.  This is the first line of authored code
00031         /// executed, and as such is the logical equivalent of main() or WinMain().
00032         /// </summary>
00033         public App()
00034         {
00035             this.InitializeComponent();
00036             this.Construct();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when the application is launched normally by the end user.  Other entry points
00041         /// will be used when the application is launched to open a specific file, to display
00042         /// search results, and so forth.
00043         /// </summary>
00044         /// <param name="e">Details about the launch request and process.</param>
00045         protected override void OnLaunched(LaunchActivatedEventArgs e)
00046         {
00047 #if DEBUG
00048             if (System.Diagnostics.Debugger.IsAttached)
00049             {
00050                 this.DebugSettings.EnableFrameRateCounter = false;
00051             }
00052 #endif
00053
00054             // A sample can inject code into OnLaunched by implementing OverrideOnLaunched.
00055             bool handled = false;
00056             OverrideOnLaunched(e, ref handled);
00057
00058             if (!handled)
00059             {
00060                 // We don't have the specified view in the collection, likely because it's the main view
00061                 // that got shown. Set up the main view to display.
00062                 InitializeMainPage(e.PreviousExecutionState, "");
00063
00064                 // This is the usual path at application startup
00065                 Window.Current.Activate();
00066             }
00067         }
00068
00069         private void InitializeMainPage(ApplicationExecutionState previousExecutionState, String arguments)
00070         {
00071             Frame rootFrame = CreateRootFrame();
00072
00073             if (rootFrame.Content == null || !string.IsNullOrEmpty(arguments))
00074             {
00075                 // When the navigation stack isn't restored or there are launch arguments
00076                 // indicating an alternate launch (e.g.: via toast or secondary tile),
00077                 // navigate to the appropriate page, configuring the new page by passing required
00078                 // information as a navigation parameter
00079                 rootFrame.Navigate(typeof(MainPage), arguments);
00080             }
00081         }
00082
00083         private Frame CreateRootFrame()
00084         {
00085             Frame rootFrame = Window.Current.Content as Frame;
00086
00087             // Do not repeat app initialization when the Window already has content,
00088             // just ensure that the window is active
00089             if (rootFrame == null)
00090             {
00091                 // Create a Frame to act as the navigation context and navigate to the first page
00092                 rootFrame = new Frame();
00093
00094                 // Set the default language
00095                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00096                 rootFrame.NavigationFailed += OnNavigationFailed;
00097
00098                 InitializeRootFrame(rootFrame);
00099
00100                 // Place the frame in the current Window
00101                 Window.Current.Content = rootFrame;
00102             }
00103
00104             return rootFrame;
00105         }
00106
00107         /// <summary>
00108         /// Invoked when Navigation to a certain page fails
00109         /// </summary>
00110         /// <param name="sender">The Frame which failed navigation</param>
00111         /// <param name="e">Details about the navigation failure</param>
00112         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00113         {
00114             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00115         }
00116
00117         // Add any application contructor code in here.
00118         partial void Construct();
00119
00120         // Hook into OnLaunched here.
00121         partial void OverrideOnLaunched(LaunchActivatedEventArgs args, ref bool handled);
00122
00123         // Hook into InitializeMainPage here.
00124         partial void InitializeRootFrame(Frame frame);
00125     }
00126 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/InteropStatics.cs Source File

  • BasicHologram
  • cs
  • Common

InteropStatics.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Runtime.InteropServices;
00003 using Windows.Graphics.DirectX.Direct3D11;
00004
00005 namespace BasicHologram.Common
00006 {
00007     public static class InteropStatics
00008     {
00009         public static Guid IInspectable   = new Guid("AF86E2E0-B12D-4c6a-9C5A-D7AA65101E90");
00010         public static Guid ID3D11Resource = new Guid("dc8e63f3-d12b-4952-b47b-5e45026a862d");
00011         public static Guid IDXGIAdapter3  = new Guid("645967A4-1392-4310-A798-8053CE3E93FD");
00012
00013         [DllImport(
00014             "d3d11.dll",
00015             EntryPoint          = "CreateDirect3D11DeviceFromDXGIDevice",
00016             SetLastError        = true,
00017             CharSet             = CharSet.Unicode,
00018             ExactSpelling       = true,
00019             CallingConvention   = CallingConvention.StdCall
00020             )]
00021         public static extern UInt32 CreateDirect3D11DeviceFromDXGIDevice(IntPtr dxgiDevice, out IntPtr graphicsDevice);
00022
00023         [DllImport(
00024             "d3d11.dll",
00025             EntryPoint = "CreateDirect3D11SurfaceFromDXGISurface",
00026             SetLastError = true,
00027             CharSet = CharSet.Unicode,
00028             ExactSpelling = true,
00029             CallingConvention = CallingConvention.StdCall
00030             )]
00031         public static extern UInt32 CreateDirect3D11SurfaceFromDXGISurface(IntPtr dxgiSurface, out IntPtr direct3DSurface);
00032
00033         [ComImport]
00034         [Guid("A9B3D012-3DF2-4EE3-B8D1-8695F457D3C1")]
00035         [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
00036         [ComVisible(true)]
00037         public interface IDirect3DDxgiInterfaceAccess : IDisposable
00038         {
00039             IntPtr GetInterface([In] ref Guid iid);
00040         };
00041
00042         public static IDirect3DSurface CreateDirect3DSurface(IntPtr dxgiSurface)
00043         {
00044             IntPtr inspectableSurface;
00045             uint hr = CreateDirect3D11SurfaceFromDXGISurface(dxgiSurface, out inspectableSurface);
00046
00047             IDirect3DSurface depthD3DSurface = null;
00048             if (hr == 0)
00049             {
00050                 depthD3DSurface = (IDirect3DSurface)Marshal.GetObjectForIUnknown(inspectableSurface);
00051                 Marshal.Release(inspectableSurface);
00052             }
00053
00054             return depthD3DSurface;
00055         }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VertexPositionColor Member List

This is the complete list of members for VertexPositionColor, including all inherited members.
color | VertexPositionColor |
pos | VertexPositionColor |
VertexPositionColor(Vector3 pos, Vector3 color) | VertexPositionColor | [inline]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BackgroundActivity Member List

This is the complete list of members for BackgroundActivity, including all inherited members.
_cancelReason | BackgroundActivity | [private]
_cancelRequested | BackgroundActivity | [private]
_deferral | BackgroundActivity | [private]
_periodicTimer | BackgroundActivity | [private]
_progress | BackgroundActivity | [private]
_taskInstance | BackgroundActivity | [private]
OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) | BackgroundActivity | [inline, private]
PeriodicTimerCallback(ThreadPoolTimer timer) | BackgroundActivity | [inline, private]
Run(IBackgroundTaskInstance taskInstance) | BackgroundActivity | [inline]
Start(BackgroundTaskRegistrationGroup sender, BackgroundActivatedEventArgs args) | BackgroundActivity | [inline, static]
Start(IBackgroundTaskInstance taskInstance) | BackgroundActivity | [inline, static]
Generated on Fri Nov 15 2024 22:23:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario1.xaml.cpp Source File

  • FileThumbnails
  • cpp

Scenario1.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.cpp
00014 // Implementation of the Scenario1 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Storage;
00025 using namespace Windows::Storage::FileProperties;
00026 using namespace Windows::Storage::Pickers;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 Scenario1::Scenario1()
00032 {
00033     InitializeComponent();
00034     rootPage = MainPage::Current;
00035 }
00036
00037 void Scenario1::OnNavigatedTo(NavigationEventArgs^ e)
00038 {
00039     rootPage->ResetOutput(ThumbnailImage, OutputTextBlock, nullptr);
00040 }
00041
00042 void Scenario1::GetThumbnailButton_Click(Object^ sender, RoutedEventArgs^ e)
00043 {
00044     rootPage->ResetOutput(ThumbnailImage, OutputTextBlock, nullptr);
00045
00046     // Pick a photo
00047     FileOpenPicker^ openPicker = ref new FileOpenPicker();
00048     Array<String^>^ extensions = FileExtensions::Image;
00049     for (unsigned int i = 0; i < extensions->Length; i++)
00050     {
00051         openPicker->FileTypeFilter->Append(extensions[i]);
00052     }
00053
00054     String^ thumbnailModeName = ((ComboBoxItem^)ModeComboBox->SelectedItem)->Name;
00055     ThumbnailMode thumbnailMode = ThumbnailMode::ListView;
00056     if (thumbnailModeName == "ListView")
00057     {
00058         thumbnailMode = ThumbnailMode::ListView;
00059     }
00060     if (thumbnailModeName == "PicturesView")
00061     {
00062         thumbnailMode = ThumbnailMode::PicturesView;
00063     }
00064     else if (thumbnailModeName == "SingleItem")
00065     {
00066         thumbnailMode = ThumbnailMode::SingleItem;
00067     }
00068
00069     bool fastThumbnail = FastThumbnailCheckBox->IsChecked->Value;
00070     ThumbnailOptions thumbnailOptions = ThumbnailOptions::UseCurrentScale;
00071     if (fastThumbnail)
00072     {
00073         thumbnailOptions = thumbnailOptions | ThumbnailOptions::ReturnOnlyIfCached;
00074     }
00075
00076     create_task(openPicker->PickSingleFileAsync()).then([this, thumbnailMode, thumbnailModeName, thumbnailOptions, fastThumbnail](StorageFile^ file)
00077     {
00078         if (file != nullptr)
00079         {
00080             const size_t size = 200;
00081             create_task(file->GetThumbnailAsync(thumbnailMode, size, thumbnailOptions)).then([this, file, thumbnailMode, thumbnailModeName, thumbnailOptions, fastThumbnail, size](StorageItemThumbnail^ thumbnail)
00082             {
00083                 if (thumbnail != nullptr)
00084                 {
00085                     MainPage::DisplayResult(ThumbnailImage, OutputTextBlock, thumbnailModeName, size, file, thumbnail, false);
00086                 }
00087                 else if (fastThumbnail)
00088                 {
00089                     rootPage->NotifyUser(Errors::NoExifThumbnail, NotifyType::StatusMessage);
00090                 }
00091                 else
00092                 {
00093                     rootPage->NotifyUser(Errors::NoThumbnail, NotifyType::StatusMessage);
00094                 }
00095             });
00096         }
00097         else
00098         {
00099             rootPage->NotifyUser(Errors::Cancel, NotifyType::StatusMessage);
00100         }
00101     });
00102 }
Generated on Fri Nov 15 2024 22:17:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LibraryManagement/cs/S2_ListFolders.xaml.cs Source File

  • LibraryManagement
  • cs

S2_ListFolders.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation.Collections;
00014 using Windows.Storage;
00015 using Windows.UI.Core;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario2 : Page
00026     {
00027         StorageLibrary picturesLibrary;
00028
00029         public Scenario2()
00030         {
00031             this.InitializeComponent();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when this page is about to be displayed in a Frame.
00036         /// </summary>
00037         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00038         /// property is typically used to configure the page.</param>
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041         }
00042
00043         /// <summary>
00044         /// Obtains the list of folders that make up the Pictures library and binds the FoldersListView
00045         /// to this list.
00046         /// </summary>
00047         /// <param name="sender"></param>
00048         /// <param name="e"></param>
00049         private async void ListFoldersButton_Click(object sender, RoutedEventArgs e)
00050         {
00051             ListFoldersButton.IsEnabled = false;
00052             picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
00053
00054             // Bind the FoldersListView to the list of folders that make up the library
00055             FoldersListView.ItemsSource = picturesLibrary.Folders;
00056
00057             // Register for the DefinitionChanged event to be notified if other apps modify the library
00058             picturesLibrary.DefinitionChanged += async (StorageLibrary innerSender, object innerEvent) =>
00059                 {
00060                     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00061                     {
00062                         UpdateHeaderText();
00063                     });
00064                 };
00065             UpdateHeaderText();
00066         }
00067
00068         /// <summary>
00069         /// Updates the FoldersListHeaderTextBlock with the count of folders in the Pictures library.
00070         /// </summary>
00071         private void UpdateHeaderText()
00072         {
00073             FoldersListHeaderTextBlock.Text = "Pictures library (" + picturesLibrary.Folders.Count + " folders)";
00074         }
00075     }
00076 }
Generated on Fri Nov 15 2024 22:20:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainViewModel Member List

This is the complete list of members for MainViewModel, including all inherited members.
_items | MainViewModel | [private]
Items | MainViewModel |
MainViewModel() | MainViewModel | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: IoT-GPIO/cpp/pch.h Source File

  • IoT-GPIO
  • cpp

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020
00021 #include "SampleConfiguration.h"
00022 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/Scenario5_ManyProvidersManyAccounts.xaml.cpp Source File

  • WebAccountManagement
  • cpp

Scenario5_ManyProvidersManyAccounts.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario5_ManyProvidersManyAccounts.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace Platform;
00009 using namespace Platform::Collections;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::Security::Authentication::Web::Core;
00013 using namespace Windows::Security::Credentials;
00014 using namespace Windows::Storage;
00015 using namespace Windows::UI::Popups;
00016 using namespace Windows::UI::Xaml;
00017 using namespace Windows::UI::Xaml::Controls;
00018 using namespace Windows::UI::Xaml::Controls::Primitives;
00019 using namespace Windows::UI::Xaml::Data;
00020 using namespace Windows::UI::Xaml::Input;
00021 using namespace Windows::UI::Xaml::Media;
00022 using namespace Windows::UI::Xaml::Navigation;
00023 using namespace Windows::UI::ApplicationSettings;
00024
00025 Scenario5_ManyProvidersManyAccounts::Scenario5_ManyProvidersManyAccounts() : rootPage(MainPage::Current)
00026 {
00027     InitializeComponent();
00028     InitalizeAccountsControlDialog();
00029 }
00030
00031 void Scenario5_ManyProvidersManyAccounts::OnNavigatedFrom(NavigationEventArgs^ e)
00032 {
00033     CleanupAccountsControlDialog();
00034     LogoffAndRemoveAllAccounts();
00035 }
00036
00037 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::Button_AddNewAccount_Click(Object^ sender, RoutedEventArgs^ e)
00038 {
00039     m_selectedAccountAction = AccountAction::AddAccount;
00040     AccountsSettingsPane::Show();
00041 }
00042
00043 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::Button_ManageSignedInAccounts_Click(Object^ sender, RoutedEventArgs^ e)
00044 {
00045     m_selectedAccountAction = AccountAction::ManageAccount;
00046     AccountsSettingsPane::Show();
00047 }
00048
00049 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::Button_Reset_Click(Object^ sender, RoutedEventArgs^ e)
00050 {
00051     rootPage->NotifyUser("Resetting", NotifyType::StatusMessage);
00052
00053     LogoffAndRemoveAllAccounts();
00054
00055     rootPage->NotifyUser("Done Resetting", NotifyType::StatusMessage);
00056 }
00057
00058 // Create local storage containers for the ID strings. These will be used to recreate
00059 // WebAccounts.
00060 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::CreateLocalDataContainers()
00061 {
00062     ApplicationData::Current->LocalSettings->CreateContainer(ACCOUNTS_CONTAINER, ApplicationDataCreateDisposition::Always);
00063     ApplicationData::Current->LocalSettings->Containers->Lookup(ACCOUNTS_CONTAINER)->CreateContainer(PROVIDER_ID_SUBCONTAINER, ApplicationDataCreateDisposition::Always);
00064     ApplicationData::Current->LocalSettings->Containers->Lookup(ACCOUNTS_CONTAINER)->CreateContainer(AUTHORITY_SUBCONTAINER, ApplicationDataCreateDisposition::Always);
00065 }
00066
00067 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::InitalizeAccountsControlDialog()
00068 {
00069     // Add to the event AccountCommandsRequested to load our list of providers into the AccountSettingsPane
00070     m_accountCommandsRequestedRegistrationToken = AccountsSettingsPane::GetForCurrentView()->AccountCommandsRequested +=
00071         ref new TypedEventHandler<AccountsSettingsPane^, AccountsSettingsPaneCommandsRequestedEventArgs^>(
00072             this, &SDKTemplate::Scenario5_ManyProvidersManyAccounts::OnAccountCommandsRequested);
00073
00074     CreateLocalDataContainers();
00075     GetProviders();
00076     GetAccounts();
00077 }
00078
00079 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::CleanupAccountsControlDialog()
00080 {
00081     // Remove the event handler from the AccountCommandsRequested
00082     AccountsSettingsPane::GetForCurrentView()->AccountCommandsRequested -= m_accountCommandsRequestedRegistrationToken;
00083 }
00084
00085 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::OnAccountCommandsRequested(
00086     AccountsSettingsPane^ sender,
00087     AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00088 {
00089     // Add all the accounts, providers, and descriptive elements to the AccountControl picker
00090     if (m_selectedAccountAction == AccountAction::AddAccount)
00091     {
00092         AddWebAccountProviders(e);
00093     }
00094     else
00095     {
00096         AddWebAccounts(e);
00097     }
00098     AddLinksAndDescription(e);
00099 }
00100
00101 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::GetProviders()
00102 {
00103     // Instantiate the provider list
00104     m_providers = ref new Map<String^, WebAccountProvider^>();
00105
00106     // Make tasks to get the MSA and AAD providers by their IDs
00107     auto appSpecificProvider = ref new WebAccountProvider( APP_SPECIFIC_PROVIDER_ID, APP_SPECIFIC_PROVIDER_NAME,
00108         ref new Uri(this->BaseUri->ToString(), "Assets/smallTile-sdk.png"));
00109
00110     // When that task completes, save the providers found to the provider list
00111     concurrency::create_task(WebAuthenticationCoreManager::FindAccountProviderAsync(MICROSOFT_PROVIDER_ID, CONSUMER_AUTHORITY)).
00112         then([this](WebAccountProvider^ foundMsaProvider)
00113     {
00114         if (foundMsaProvider)
00115         {
00116             m_providers->Insert(foundMsaProvider->Id + foundMsaProvider->Authority, foundMsaProvider);
00117         }
00118     });
00119
00120     concurrency::create_task(WebAuthenticationCoreManager::FindAccountProviderAsync(MICROSOFT_PROVIDER_ID, ORGANIZATION_AUTHORITY)).
00121         then([this](WebAccountProvider^ foundAadProvider)
00122     {
00123         if (foundAadProvider)
00124         {
00125             m_providers->Insert(foundAadProvider->Id + foundAadProvider->Authority, foundAadProvider);
00126         }
00127     });
00128
00129     m_providers->Insert(appSpecificProvider->Id, appSpecificProvider);
00130 }
00131
00132 // Iterate through our saved Account Ids and create WebAccounts for each of them,
00133 // then save them in our list of WebAccounts
00134 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::GetAccounts()
00135 {
00136     m_accounts = ref new Map<String^, WebAccount^>();
00137
00138     auto accountListContainer = ApplicationData::Current->LocalSettings->Containers->Lookup(ACCOUNTS_CONTAINER);
00139
00140     for (Object^ value : accountListContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values)
00141     {
00142         auto accountID = safe_cast<String^>(value);
00143         auto providerID = safe_cast<String^>(accountListContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values->Lookup(accountID));
00144         auto authority = safe_cast<String^>(accountListContainer->Containers->Lookup(AUTHORITY_SUBCONTAINER)->Values->Lookup(accountID));
00145
00146         if (accountID == nullptr || providerID == nullptr || authority == nullptr)
00147         {
00148             continue;
00149         }
00150
00151         concurrency::create_task(WebAuthenticationCoreManager::FindAccountProviderAsync(providerID, authority))
00152             .then([this, accountID](WebAccountProvider^ provider)
00153         {
00154             if (provider->Id == APP_SPECIFIC_PROVIDER_ID)
00155             {
00156                 SaveAccount(ref new WebAccount(provider, accountID, WebAccountState::None));
00157             }
00158             else
00159             {
00160                 concurrency::create_task(WebAuthenticationCoreManager::FindAccountAsync(provider, accountID))
00161                     .then([this](WebAccount^ foundAccount)
00162                 {
00163                     SaveAccount(foundAccount);
00164                 });
00165             }
00166         });
00167     }
00168 }
00169
00170 // Similar to Scenario 1, but with a loop for the different providers we now support and declared earlier
00171 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::AddWebAccountProviders(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00172 {
00173     for (const auto& pair : m_providers)
00174     {
00175         // Create a new WebAccountProviderCommandInvokedHandler for the event fired when a user clicks on a provider in the AccountSettingsPane
00176         auto handler = ref new WebAccountProviderCommandInvokedHandler(this, &SDKTemplate::Scenario5_ManyProvidersManyAccounts::WebAccountProviderCommandInvoked);
00177
00178         // Make a new command based on the provider and the click handler we just created
00179         auto providerCommand = ref new WebAccountProviderCommand(pair->Value, handler);
00180
00181         // Append that command to the WebAccountProviderCommands list for the AccountSettingsPane
00182         e->WebAccountProviderCommands->Append(providerCommand);
00183     }
00184 }
00185
00186 // Iterate through the web accounts we have and add a WebAccountsCommand for each to the AccountControl's list of web accounts
00187 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::AddWebAccounts(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00188 {
00189     for (const auto& account : m_accounts)
00190     {
00191         auto handler = ref new WebAccountCommandInvokedHandler(this, &SDKTemplate::Scenario5_ManyProvidersManyAccounts::WebAccountCommandInvoked);
00192         auto command = ref new WebAccountCommand(account->Value, handler, SupportedWebAccountActions::Remove | SupportedWebAccountActions::Manage);
00193         e->WebAccountCommands->Append(command);
00194     }
00195 }
00196
00197 // You can add links and descriptive text such as privacy policy, help, general account settings
00198 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::AddLinksAndDescription(AccountsSettingsPaneCommandsRequestedEventArgs^ e)
00199 {
00200     e->HeaderText = "Describe what adding an account to your application will do for the user.";
00201
00202     e->Commands->Append(ref new SettingsCommand("privacypolicy", "Privacy Policy", ref new UICommandInvokedHandler(this, &SDKTemplate::Scenario5_ManyProvidersManyAccounts::PrivacyPolicyInvoked)));
00203     e->Commands->Append(ref new SettingsCommand("otherlink", "Other Link", ref new UICommandInvokedHandler(this, &SDKTemplate::Scenario5_ManyProvidersManyAccounts::OtherLinkInvoked)));
00204 }
00205
00206 // The function that will be called with the WebAccountProviderCommand passed from AccountSettingsPane
00207 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::WebAccountProviderCommandInvoked(WebAccountProviderCommand^ command)
00208 {
00209     if (command->WebAccountProvider->Authority == "organizations")
00210     {
00211         AuthenticateWithRequestToken(command->WebAccountProvider, AAD_SCOPE_REQUESTED, AAD_CLIENT_ID);
00212     }
00213     else
00214     {
00215         AuthenticateWithRequestToken(command->WebAccountProvider, MSA_SCOPE_REQUESTED, MSA_CLIENT_ID);
00216     }
00217 }
00218
00219 // Handler function for when users select different commands for accounts in the AccountControl
00220 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::WebAccountCommandInvoked(WebAccountCommand^ command, WebAccountInvokedArgs^ args)
00221 {
00222     if (args->Action == WebAccountAction::Remove)
00223     {
00224         LogoffAndRemoveAccount(command->WebAccount);
00225     }
00226     else if (args->Action == WebAccountAction::Manage)
00227     {
00228         // Display user management UI for this account
00229         rootPage->NotifyUser("Manage invoked for user: " + command->WebAccount->UserName, NotifyType::StatusMessage);
00230     }
00231 }
00232
00233 // Displays privacy policy message on clicking it in the AccountsControl
00234 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::PrivacyPolicyInvoked(IUICommand^ command)
00235 {
00236     rootPage->NotifyUser("Privacy policy clicked by user", NotifyType::StatusMessage);
00237 }
00238
00239 // Displays other link message on clicking it in the AccountsControl
00240 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::OtherLinkInvoked(IUICommand^ command)
00241 {
00242     rootPage->NotifyUser("Other link pressed by user", NotifyType::StatusMessage);
00243 }
00244
00245 // Create a new WebAccountManager WebTokenRequest based on the Provider, Scope, ClientID and then create a task to send
00246 // that request asynchronously to WebAccountManager's RequestTokenAsync
00247 //
00248 // WebAccountManager will then try three steps, in order:
00249 //        (1): Check it's local cache to see if it has a valid token
00250 //        (2): Try to silently request a new token from the MSA service
00251 //        (3): Show the MSA UI for user interaction required (user credentials) before it may return a token.
00252 //
00253 // Because of WebAccountManager's ability to cache tokens, you should only need to call WebAccountManager when making token
00254 // based requests and not require the ability to store a cached token within your app.
00255 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::AuthenticateWithRequestToken(WebAccountProvider^ provider, String^ scope, String^ clientID)
00256 {
00257     rootPage->NotifyUser("Requested " + provider->DisplayName + " from AccountsManager dialog.", NotifyType::StatusMessage);
00258
00259     auto wtr = ref new WebTokenRequest(provider, scope, clientID);
00260
00261     // When our task finishes it will return result of the operation, and if successful it will contain a token
00262     // and WebAccount. We save the WebAccount as the "active" account.
00263     concurrency::create_task(WebAuthenticationCoreManager::RequestTokenAsync(wtr)).then([this](WebTokenRequestResult^ webTokenRequestResult)
00264     {
00265         if (webTokenRequestResult->ResponseStatus == WebTokenRequestStatus::Success)
00266         {
00267             if (webTokenRequestResult->ResponseData->GetAt(0)->WebAccount)
00268             {
00269                 SaveAccount(webTokenRequestResult->ResponseData->GetAt(0)->WebAccount);
00270             }
00271         }
00272
00273         OutputTokenResult(webTokenRequestResult);
00274     });
00275 }
00276
00277 // Displays the result of requesting a token asynchronously to the main page
00278 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::OutputTokenResult(WebTokenRequestResult^ result)
00279 {
00280     if (result->ResponseStatus == WebTokenRequestStatus::Success)
00281     {
00282         rootPage->NotifyUser(result->ResponseStatus.ToString() + "!\nUser: " + result->ResponseData->GetAt(0)->WebAccount->Id + "\n    Token returned was: " + result->ResponseData->GetAt(0)->Token, NotifyType::StatusMessage);
00283     }
00284     else if (result->ResponseStatus == WebTokenRequestStatus::ProviderError)
00285     {
00286         // The account provider has passed us an error and we should handle it.
00287         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00288     }
00289     else if (result->ResponseStatus == WebTokenRequestStatus::AccountProviderNotAvailable)
00290     {
00291         // The account provider is unavailable, this is a temporary error.
00292         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::ErrorMessage);
00293     }
00294     else if (result->ResponseStatus == WebTokenRequestStatus::UserInteractionRequired)
00295     {
00296         // The account provider needs to display a UI, since we called request token silently we should call it
00297         // with RequestTokenAsync.
00298         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00299     }
00300     else if (result->ResponseStatus == WebTokenRequestStatus::UserCancel)
00301     {
00302         // The user cancelled the sign in process for the account provider, handle
00303         // that how you need to.
00304         rootPage->NotifyUser(result->ResponseStatus.ToString(), NotifyType::StatusMessage);
00305     }
00306     else
00307     {
00308         // An unexpected error was encountered
00309         rootPage->NotifyUser(result->ResponseStatus.ToString() + " " + result->ResponseError->ErrorCode + ": " + result->ResponseError->ErrorMessage, NotifyType::ErrorMessage);
00310     }
00311 }
00312
00313 // Saves the ProviderId, Authority, and AccountId in LocalSettings as we can handle
00314 // different types of account providers in Scenario 2.
00315 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::SaveAccount(WebAccount^ account)
00316 {
00317     ApplicationDataContainer^ accountsContainer = ApplicationData::Current->LocalSettings->Containers->Lookup(ACCOUNTS_CONTAINER);
00318
00319     // If ID isn't empty then this is an account based on either MSA or AAD and we need to save the account id and provider information. Otherwise
00320     // it is an app-specific provider.
00321     if (account->Id != "")
00322     {
00323         accountsContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values->Insert(account->Id, account->WebAccountProvider->Id);
00324         accountsContainer->Containers->Lookup(AUTHORITY_SUBCONTAINER)->Values->Insert(account->Id, account->WebAccountProvider->Authority);
00325         m_accounts->Insert(account->UserName, account);
00326     }
00327     else
00328     {
00329         accountsContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values->Insert(account->UserName, account->WebAccountProvider->Id);
00330         m_accounts->Insert(account->Id, account);
00331     }
00332
00333     // Update UI
00334     button_ManageSignedInAccounts->IsEnabled = true;
00335     textblock_SignedInStatus->Text = "Signed in with:";
00336     textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Green);
00337     listview_SignedInAccounts->Items->Append(account->Id);
00338 }
00339
00340 // When we sign out, then remove all our saved keys as well.
00341 IAsyncAction^ SDKTemplate::Scenario5_ManyProvidersManyAccounts::LogoffAndRemoveAccount(WebAccount^ account)
00342 {
00343     ApplicationDataContainer^ accountsContainer = ApplicationData::Current->LocalSettings->Containers->Lookup(ACCOUNTS_CONTAINER);
00344
00345     unsigned int indexOfAccount = 0;
00346
00347     // For the MSA and AAD providers we need to remove the account id, otherwise we need to remove the app-specific account username.
00348     if (account->WebAccountProvider->Id != APP_SPECIFIC_PROVIDER_ID)
00349     {
00350         //concurrency::create_task(account->SignOutAsync( MSA_SCOPE_REQUESTED));
00351
00352         accountsContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values->Remove(account->Id);
00353         accountsContainer->Containers->Lookup(AUTHORITY_SUBCONTAINER)->Values->Remove(account->Id);
00354
00355         // Find the index of the account Id in the list of signed in accounts, if indexOf is true then remove it.
00356         if (listview_SignedInAccounts->Items->IndexOf(account->Id, &indexOfAccount))
00357         {
00358             listview_SignedInAccounts->Items->RemoveAt(indexOfAccount);
00359         }
00360     }
00361     else
00362     {
00363         // perform any actions needed to log off the app specific account
00364         accountsContainer->Containers->Lookup(PROVIDER_ID_SUBCONTAINER)->Values->Remove(account->UserName);
00365
00366         // Find the index of the account username in the list of signed in accounts, if indexOf is true then remove it.
00367         if (listview_SignedInAccounts->Items->IndexOf(account->UserName, &indexOfAccount))
00368         {
00369             listview_SignedInAccounts->Items->RemoveAt(indexOfAccount);
00370         }
00371     }
00372
00373     if (listview_SignedInAccounts->Items->Size == 0)
00374     {
00375         // Update UI
00376         button_AddAccount->IsEnabled = true;
00377         button_ManageSignedInAccounts->IsEnabled = false;
00378         textblock_SignedInStatus->Text = "Not signed in.";
00379         textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Red);
00380     }
00381
00382     return nullptr;
00383 }
00384
00385 // When we sign out, then remove all our saved keys as well.
00386 void SDKTemplate::Scenario5_ManyProvidersManyAccounts::LogoffAndRemoveAllAccounts()
00387 {
00388     for (const auto& account : m_accounts)
00389     {
00390        //concurrency::create_task(LogoffAndRemoveAccount(account->Value));
00391     }
00392
00393     m_accounts->Clear();
00394
00395     // Update UI
00396     button_AddAccount->IsEnabled = true;
00397     button_ManageSignedInAccounts->IsEnabled = false;
00398     textblock_SignedInStatus->Text = "Not signed in.";
00399     textblock_SignedInStatus->Foreground = ref new SolidColorBrush(Windows::UI::Colors::Red);
00400     listview_SignedInAccounts->Items->Clear();
00401 }
Generated on Fri Nov 15 2024 22:21:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FilledEllipse Member List

This is the complete list of members for FilledEllipse, including all inherited members.
AddChildElement(const std::shared_ptr< BaseElement > &childElement) | BaseElement |
ArrangeElements() | BaseElement | [virtual]
BaseElement() | BaseElement |
FilledEllipse(FLOAT radiusX, FLOAT radiusY, D2D1::ColorF brushColor) | FilledEllipse |
GetElementMargin() | BaseElement | [inline]
GetElementSize() | BaseElement | [inline]
GetIgnoreLayout() | BaseElement | [inline]
GetIsRenderPassNeeded() | BaseElement | [inline]
GetIsVisible() | BaseElement | [inline]
Initialize() override | FilledEllipse | [virtual]
m_brushColor | FilledEllipse | [private]
m_deviceResources | BaseElement | [protected]
m_elementMargin | BaseElement | [protected]
m_elementSize | BaseElement | [protected]
m_ellipse | FilledEllipse | [private]
m_ignoreLayout | BaseElement | [protected]
m_isInitialized | BaseElement | [protected]
m_isLayoutHorizontal | BaseElement | [protected]
m_isRenderPassNeeded | BaseElement | [protected]
m_isVisible | BaseElement | [protected]
m_parentTranslation | BaseElement | [protected]
m_radiusX | FilledEllipse | [private]
m_radiusY | FilledEllipse | [private]
m_transformedTranslation | BaseElement | [protected]
m_transformMatrix | BaseElement | [protected]
m_transformRecalculationNeeded | BaseElement | [protected]
m_translation | BaseElement | [protected]
Render() override | FilledEllipse | [protected, virtual]
SetBrush(ID2D1SolidColorBrush *brush) | BaseElement |
SetElementMargin(ElementMargin margin) | BaseElement | [inline]
SetElementSize(Windows::Foundation::Numerics::float2 size) | BaseElement | [inline]
SetIgnoreLayout(bool ignoreLayout) | BaseElement | [inline]
SetIsVisible(bool visible) | BaseElement |
SetLayoutHorizontal(bool isLayoutHorizontal) | BaseElement | [inline]
SetParentTransform(Windows::Foundation::Numerics::float2 translation) | BaseElement |
SetRadius(FLOAT x, FLOAT y) | FilledEllipse |
SetTranslation(Windows::Foundation::Numerics::float2 translation) | BaseElement | [virtual]
TryRender() | BaseElement |
Update(const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) | BaseElement | [virtual]
~BaseElement() | BaseElement | [virtual]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6DisablePreview Member List

This is the complete list of members for Scenario6DisablePreview, including all inherited members.
OnNavigatedFrom(NavigationEventArgs e) | Scenario6DisablePreview | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario6DisablePreview | [inline, protected]
OnPrintButtonClick(object sender, RoutedEventArgs e) | Scenario6DisablePreview | [inline, private]
printHelper | Scenario6DisablePreview | [private]
Scenario6DisablePreview() | Scenario6DisablePreview | [inline]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/pch.h Source File

  • XamlAnimatedGif
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AnimationMetrics/cpp/SampleConfiguration.cpp Source File

  • AnimationMetrics
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Retrieving Animation Metrics", "SDKTemplate.Scenario1_Metrics" },
00012 };
Generated on Fri Nov 15 2024 22:17:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_LanguageDetection Member List

This is the complete list of members for Scenario1_LanguageDetection, including all inherited members.
Go_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_LanguageDetection
Scenario1_LanguageDetection() | Scenario1_LanguageDetection
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cs/SimpleLogger.cs Source File

  • CameraFrames
  • cs

SimpleLogger.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Core;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// A simple logger to display text to TextBlock asynchronisely.
00020     /// </summary>
00021     class SimpleLogger
00022     {
00023         private CoreDispatcher _dispatcher;
00024         private TextBlock _textBlock;
00025         private string _messageText = string.Empty;
00026         private readonly object _messageLock = new object();
00027         private int _messageCount;
00028
00029         public SimpleLogger(TextBlock textBlock)
00030         {
00031             _textBlock = textBlock;
00032             _dispatcher = _textBlock.Dispatcher;
00033         }
00034
00035         /// <summary>
00036         /// Logs a message to be displayed.
00037         /// </summary>
00038         internal async void Log(string message)
00039         {
00040             var newMessage = $"[{_messageCount ++}] {DateTime.Now.ToString("hh:MM:ss")} : {message}\n{_messageText}";
00041
00042             lock(_messageLock)
00043             {
00044                 _messageText = newMessage;
00045             }
00046
00047             await _dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00048             {
00049                 lock (_messageLock)
00050                 {
00051                     _textBlock.Text = _messageText;
00052                 }
00053             });
00054         }
00055     }
00056 }
Generated on Fri Nov 15 2024 22:18:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cppwinrt/pch.cpp Source File

  • JapanesePhoneticAnalysis
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_NetworkConnectivityChanges Member List

This is the complete list of members for Scenario3_NetworkConnectivityChanges, including all inherited members.
m_isNetworkStatusChangeCallbackRegistered | Scenario3_NetworkConnectivityChanges | [private]
m_isNetworkStatusUpdatePending | Scenario3_NetworkConnectivityChanges | [private]
m_isUpdatingNetworkStatus | Scenario3_NetworkConnectivityChanges | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_NetworkConnectivityChanges | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_NetworkConnectivityChanges | [inline, protected]
OnNetworkStatusChanged(object sender) | Scenario3_NetworkConnectivityChanges | [inline, private]
RegisterNetworkStatusChanged() | Scenario3_NetworkConnectivityChanges | [inline, private]
RegisterUnregisterButton_Click(object sender, RoutedEventArgs e) | Scenario3_NetworkConnectivityChanges | [inline, private]
Scenario3_NetworkConnectivityChanges() | Scenario3_NetworkConnectivityChanges | [inline]
UnregisterNetworkStatusChanged() | Scenario3_NetworkConnectivityChanges | [inline, private]
UpdateButtonStates() | Scenario3_NetworkConnectivityChanges | [inline, private]
UpdateNetworkStatus() | Scenario3_NetworkConnectivityChanges | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OcrCapturedImage Member List

This is the complete list of members for OcrCapturedImage, including all inherited members.
Application_Resuming(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e) | OcrCapturedImage |
Application_Suspending(Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e) | OcrCapturedImage |
applicationResumingToken | OcrCapturedImage | [private]
applicationSuspendingToken | OcrCapturedImage | [private]
CalculatePreviewRotation() | OcrCapturedImage | [private]
CameraButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | OcrCapturedImage |
CleanupCameraAsync() | OcrCapturedImage | [private]
DisplayInformation_OrientationChanged(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &e) | OcrCapturedImage |
displayRequest | OcrCapturedImage | [private]
externalCamera | OcrCapturedImage | [private]
ExtractButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | OcrCapturedImage |
FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel desiredPanel) | OcrCapturedImage | [private]
InitializeCameraAsync() | OcrCapturedImage | [private]
isInitialized | OcrCapturedImage | [private]
isPreviewing | OcrCapturedImage | [private]
MediaCapture_Failed(Windows::Media::Capture::MediaCapture const &sender, Windows::Media::Capture::MediaCaptureFailedEventArgs const &errorEventArgs) | OcrCapturedImage | [private]
mediaCaptureFailedToken | OcrCapturedImage | [private]
mirroringPreview | OcrCapturedImage | [private]
OcrCapturedImage() | OcrCapturedImage |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | OcrCapturedImage |
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &e) | OcrCapturedImage |
orientationChangedEventToken | OcrCapturedImage | [private]
PreviewImage_SizeChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e) | OcrCapturedImage |
SetPreviewRotationAsync() | OcrCapturedImage | [private]
StartCameraAsync() | OcrCapturedImage | [private]
StartPreviewAsync() | OcrCapturedImage | [private]
StopPreviewAsync() | OcrCapturedImage | [private]
UpdateWordBoxTransform() | OcrCapturedImage | [private]
wordBoxes | OcrCapturedImage | [private]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/SampleConfiguration.h Source File

  • AppWindow
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     struct unique_disabled_control
00018     {
00019         unique_disabled_control(Windows::UI::Xaml::Controls::Control const& control) : c{ control }
00020         {
00021             c.IsEnabled(false);
00022         }
00023
00024         unique_disabled_control(const unique_disabled_control&) = delete;
00025         void operator=(unique_disabled_control const&) = delete;
00026
00027         ~unique_disabled_control()
00028         {
00029             c.IsEnabled(true);
00030         }
00031         Windows::UI::Xaml::Controls::Control c;
00032     };
00033
00034     bool TryParseFloat(hstring const& str, float& result);
00035 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModelConstantBuffer Member List

This is the complete list of members for ModelConstantBuffer, including all inherited members.
model ModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/Scenario1.xaml.h Source File

  • WindowsAudioSession
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.h
00013 // Declaration of the Scenario1 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario1.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 using namespace Windows::Devices::Enumeration;
00023
00024 namespace SDKSample
00025 {
00026     namespace WASAPIAudio
00027     {
00028         // Custom properties defined in mmdeviceapi.h in the format "{GUID} PID"
00029         static Platform::String^ PKEY_AudioEndpoint_Supports_EventDriven_Mode = "{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 7";
00030
00031         [Windows::Foundation::Metadata::WebHostHidden]
00032         public ref class Scenario1 sealed
00033         {
00034         public:
00035             Scenario1();
00036
00037         protected:
00038             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00039
00040         private:
00041             void ShowStatusMessage( Platform::String^ str, NotifyType messageType );
00042             void Enumerate_Click( Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e );
00043             void EnumerateAudioDevicesAsync();
00044
00045         private:
00046             MainPage^                               rootPage;
00047             Windows::UI::Xaml::Controls::ListBox^   m_DevicesList;
00048         };
00049     }
00050 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario01_GetText.cpp Source File

  • HttpClient
  • cppwinrt

Scenario01_GetText.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario01_GetText.h"
00014 #include "Scenario01_GetText.g.cpp"
00015 #include "SampleConfiguration.h"
00016 #include "Helpers.h"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Security::Cryptography::Certificates;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Navigation;
00023 using namespace winrt::Windows::Web::Http;
00024 using namespace winrt::Windows::Web::Http::Filters;
00025
00026 namespace winrt::SDKTemplate::implementation
00027 {
00028     Scenario01_GetText::Scenario01_GetText()
00029     {
00030         InitializeComponent();
00031     }
00032
00033     void Scenario01_GetText::OnNavigatedTo(NavigationEventArgs const&)
00034     {
00035         // In this scenario we just create an HttpClient instance with default settings. I.e. no custom filters.
00036         // For examples on how to use custom filters see other scenarios.
00037         filter = HttpBaseProtocolFilter();
00038
00039         // Setting the starting state of the toggle based on the default HTTP version in the OS
00040         if (filter.MaxVersion() >= HttpVersion::Http20)
00041         {
00042             MaxHttpVersionToggle().IsOn(true);
00043         }
00044         else
00045         {
00046             MaxHttpVersionToggle().IsOn(false);
00047         }
00048
00049         httpClient = HttpClient(filter);
00050         isFilterUsed = false;
00051     }
00052
00053     void Scenario01_GetText::OnNavigatedFrom(NavigationEventArgs const&)
00054     {
00055         filter.Close();
00056         httpClient.Close();
00057     }
00058
00059     fire_and_forget Scenario01_GetText::Start_Click(IInspectable const&, RoutedEventArgs const&)
00060     {
00061         auto lifetime = get_strong();
00062
00063         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00064         // valid, absolute URI, we'll notify the user about the incorrect input.
00065         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00066         if (!resourceUri)
00067         {
00068             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00069             return;
00070         }
00071
00072         Helpers::ScenarioStarted(StartButton(), CancelButton(), OutputField());
00073         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00074
00075         if (ReadDefaultRadio().IsChecked().Value())
00076         {
00077             filter.CacheControl().ReadBehavior(HttpCacheReadBehavior::Default);
00078         }
00079         else if (ReadMostRecentRadio().IsChecked().Value())
00080         {
00081             filter.CacheControl().ReadBehavior(HttpCacheReadBehavior::MostRecent);
00082         }
00083         else if (ReadOnlyFromCacheRadio().IsChecked().Value())
00084         {
00085             filter.CacheControl().ReadBehavior(HttpCacheReadBehavior::OnlyFromCache);
00086         }
00087         else if (ReadNoCacheRadio().IsChecked().Value())
00088         {
00089             filter.CacheControl().ReadBehavior(HttpCacheReadBehavior::NoCache);
00090         }
00091
00092         if (WriteDefaultRadio().IsChecked().Value())
00093         {
00094             filter.CacheControl().WriteBehavior(HttpCacheWriteBehavior::Default);
00095         }
00096         else if (WriteNoCacheRadio().IsChecked().Value())
00097         {
00098             filter.CacheControl().WriteBehavior(HttpCacheWriteBehavior::NoCache);
00099         }
00100
00101         // ---------------------------------------------------------------------------
00102         // WARNING: Only test applications should ignore SSL errors.
00103         // In real applications, ignoring server certificate errors can lead to MITM
00104         // attacks (while the connection is secure, the server is not authenticated).
00105         //
00106         // The SetupServer script included with this sample creates a server certificate that is self-signed
00107         // and issued to fabrikam.com, and hence we need to ignore these errors here.
00108         // ---------------------------------------------------------------------------
00109         filter.IgnorableServerCertificateErrors().ReplaceAll({ ChainValidationResult::Untrusted, ChainValidationResult::InvalidName });
00110
00111         // This sample uses a "try" in order to support cancellation.
00112         // If you don't need to support cancellation, then the "try" is not needed.
00113         try
00114         {
00115             pendingAction = CancelableRequestAsync(resourceUri);
00116             co_await pendingAction;
00117         }
00118         catch (hresult_canceled const&)
00119         {
00120             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00121         }
00122
00123         Helpers::ScenarioCompleted(StartButton(), CancelButton());
00124     }
00125
00126     IAsyncAction Scenario01_GetText::CancelableRequestAsync(Uri resourceUri)
00127     {
00128         auto lifetime = get_strong();
00129         auto cancellation = co_await get_cancellation_token();
00130         cancellation.enable_propagation();
00131
00132         isFilterUsed = true;
00133
00134         HttpRequestResult result = co_await httpClient.TryGetAsync(resourceUri);
00135
00136         if (result.Succeeded())
00137         {
00138             co_await Helpers::DisplayTextResultAsync(result.ResponseMessage(), OutputField());
00139
00140             rootPage.NotifyUser(
00141                 L"Completed. Response came from " + to_hstring(result.ResponseMessage().Source()) + L". HTTP version used: " + to_hstring(result.ResponseMessage().Version()) + L".",
00142                 NotifyType::StatusMessage);
00143         }
00144         else
00145         {
00146             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00147         }
00148     }
00149
00150
00151     void Scenario01_GetText::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00152     {
00153         if (pendingAction)
00154         {
00155             pendingAction.Cancel();
00156         }
00157     }
00158
00159     void Scenario01_GetText::MaxHttpVersionToggle_Toggled(IInspectable const&, RoutedEventArgs const&)
00160     {
00161         HttpVersion httpVersion = HttpVersion::Http11;
00162         if (MaxHttpVersionToggle().IsOn())
00163         {
00164             httpVersion = HttpVersion::Http20;
00165         }
00166
00167         // In general, for best memory utilization, HttpBaseProtocolFilter and HttpClient objects should be reused for multiple requests.
00168         // However, if the user has already used the filter object to send at least one request, the HTTP version of the filter cannot be changed.
00169         // Hence, we need to create new client and filter objects.
00170         if (isFilterUsed)
00171         {
00172             filter.Close();
00173             httpClient.Close();
00174             filter = HttpBaseProtocolFilter();
00175             httpClient = HttpClient(filter);
00176             isFilterUsed = false;
00177         }
00178         filter.MaxVersion(httpVersion);
00179     }
00180
00181 }
Generated on Fri Nov 15 2024 22:19:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/HolographicSpatialMappingMain.h Source File

  • HolographicSpatialMapping
  • cpp

HolographicSpatialMappingMain.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 //
00015 // Comment out this preprocessor definition to disable all of the
00016 // sample content.
00017 //
00018 #define DRAW_SAMPLE_CONTENT
00019
00020 #include "Common\DeviceResources.h"
00021 #include "Common\StepTimer.h"
00022
00023 #ifdef DRAW_SAMPLE_CONTENT
00024 #include "Content\SpatialInputHandler.h"
00025 #include "Content\RealtimeSurfaceMeshRenderer.h"
00026 #endif
00027
00028 // Updates, renders, and presents holographic content using Direct3D.
00029 namespace HolographicSpatialMapping
00030 {
00031     class HolographicSpatialMappingMain : public DX::IDeviceNotify
00032     {
00033     public:
00034         HolographicSpatialMappingMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00035         ~HolographicSpatialMappingMain();
00036
00037         // Sets the holographic space. This is our closest analogue to setting a new window
00038         // for the app.
00039         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ holographicSpace);
00040
00041         // Starts the holographic frame and updates the content.
00042         Windows::Graphics::Holographic::HolographicFrame^ Update();
00043
00044         // Renders holograms, including world-locked content.
00045         bool Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame);
00046
00047         // Handle saving and loading of app state owned by AppMain.
00048         void SaveAppState();
00049         void LoadAppState();
00050
00051         // IDeviceNotify
00052         virtual void OnDeviceLost();
00053         virtual void OnDeviceRestored();
00054
00055         // Handle surface change events.
00056         void OnSurfacesChanged(Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver^ sender, Platform::Object^ args);
00057
00058     private:
00059         // Asynchronously creates resources for new holographic cameras.
00060         void OnCameraAdded(
00061             Windows::Graphics::Holographic::HolographicSpace^ sender,
00062             Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs^ args);
00063
00064         // Synchronously releases resources for holographic cameras that are no longer
00065         // attached to the system.
00066         void OnCameraRemoved(
00067             Windows::Graphics::Holographic::HolographicSpace^ sender,
00068             Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs^ args);
00069
00070         // Used to prevent the device from deactivating positional tracking, which is
00071         // necessary to continue to receive spatial mapping data.
00072         void OnPositionalTrackingDeactivating(
00073             Windows::Perception::Spatial::SpatialLocator^ sender,
00074             Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs^ args);
00075
00076         // Clears event registration state. Used when changing to a new HolographicSpace
00077         // and when tearing down AppMain.
00078         void UnregisterHolographicEventHandlers();
00079
00080 #ifdef DRAW_SAMPLE_CONTENT
00081         // Listens for the Pressed spatial input event.
00082         std::shared_ptr<SpatialInputHandler>                                m_spatialInputHandler;
00083
00084         // A data handler for surface meshes.
00085         std::unique_ptr<WindowsHolographicCodeSamples::RealtimeSurfaceMeshRenderer> m_meshRenderer;
00086 #endif
00087
00088         // Cached pointer to device resources.
00089         std::shared_ptr<DX::DeviceResources>                                m_deviceResources;
00090
00091         // Render loop timer.
00092         DX::StepTimer                                                       m_timer;
00093
00094         // Represents the holographic space around the user.
00095         Windows::Graphics::Holographic::HolographicSpace^                   m_holographicSpace;
00096
00097         // SpatialLocator that is attached to the primary camera.
00098         Windows::Perception::Spatial::SpatialLocator^                       m_locator;
00099
00100         // A reference frame attached to the holographic camera.
00101         Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference^ m_referenceFrame;
00102
00103         // Event registration tokens.
00104         Windows::Foundation::EventRegistrationToken                         m_cameraAddedToken;
00105         Windows::Foundation::EventRegistrationToken                         m_cameraRemovedToken;
00106         Windows::Foundation::EventRegistrationToken                         m_positionalTrackingDeactivatingToken;
00107         Windows::Foundation::EventRegistrationToken                         m_surfacesChangedToken;
00108
00109         // Indicates whether access to spatial mapping data has been granted.
00110         bool                                                                m_surfaceAccessAllowed = false;
00111
00112         // Indicates whether the surface observer initialization process was started.
00113         bool                                                                m_spatialPerceptionAccessRequested = false;
00114
00115         // Obtains spatial mapping data from the device in real time.
00116         Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver^     m_surfaceObserver;
00117         Windows::Perception::Spatial::Surfaces::SpatialSurfaceMeshOptions^  m_surfaceMeshOptions;
00118
00119         // Determines the rendering mode.
00120         bool                                                                m_drawWireframe = true;
00121     };
00122 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cppwinrt/Content/SpinningCubeRenderer.h Source File

  • BasicHologram
  • cppwinrt
  • Content

SpinningCubeRenderer.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "..\Common\DeviceResources.h"
00004 #include "..\Common\StepTimer.h"
00005 #include "ShaderStructures.h"
00006
00007 namespace BasicHologram
00008 {
00009     // This sample renderer instantiates a basic rendering pipeline.
00010     class SpinningCubeRenderer
00011     {
00012     public:
00013         SpinningCubeRenderer(std::shared_ptr<DX::DeviceResources> const& deviceResources);
00014         std::future<void> CreateDeviceDependentResources();
00015         void ReleaseDeviceDependentResources();
00016         void Update(DX::StepTimer const& timer);
00017         void Render();
00018
00019         // Repositions the sample hologram.
00020         void PositionHologram(winrt::Windows::UI::Input::Spatial::SpatialPointerPose const& pointerPose);
00021
00022         // Property accessors.
00023         void SetPosition(winrt::Windows::Foundation::Numerics::float3 const& pos)   { m_position = pos;  }
00024         winrt::Windows::Foundation::Numerics::float3 const& GetPosition()           { return m_position; }
00025
00026     private:
00027         // Cached pointer to device resources.
00028         std::shared_ptr<DX::DeviceResources>            m_deviceResources;
00029
00030         // Direct3D resources for cube geometry.
00031         Microsoft::WRL::ComPtr<ID3D11InputLayout>       m_inputLayout;
00032         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_vertexBuffer;
00033         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_indexBuffer;
00034         Microsoft::WRL::ComPtr<ID3D11VertexShader>      m_vertexShader;
00035         Microsoft::WRL::ComPtr<ID3D11GeometryShader>    m_geometryShader;
00036         Microsoft::WRL::ComPtr<ID3D11PixelShader>       m_pixelShader;
00037         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_modelConstantBuffer;
00038
00039         // System resources for cube geometry.
00040         ModelConstantBuffer                             m_modelConstantBufferData;
00041         uint32_t                                        m_indexCount = 0;
00042
00043         // Variables used with the rendering loop.
00044         bool                                            m_loadingComplete = false;
00045         float                                           m_degreesPerSecond = 45.f;
00046         winrt::Windows::Foundation::Numerics::float3    m_position = { 0.f, 0.f, -2.f };
00047
00048         // If the current D3D Device supports VPRT, we can avoid using a geometry
00049         // shader just to set the render target array index.
00050         bool                                            m_usingVprtShaders = false;
00051     };
00052 }
Generated on Fri Nov 15 2024 22:18:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLInProcessWinRTComponent/cpp/cpp/SampleConfiguration.cpp Source File

  • WRLInProcessWinRTComponent
  • cpp
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     // The format here is the following:
00012     { "Using Custom Components",                                     "SDKTemplate.WRLInProcessWinRTComponent.OvenClient" },
00013     { "Using Custom Components (Implemented using WRL)",             "SDKTemplate.WRLInProcessWinRTComponent.OvenClientWRL" },
00014     { "Handling Windows Runtime Exceptions",                         "SDKTemplate.WRLInProcessWinRTComponent.CustomException" },
00015     { "Handling Windows Runtime Exceptions (Implemented using WRL)", "SDKTemplate.WRLInProcessWinRTComponent.CustomExceptionWRL" }
00016 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/Server/BreadServer.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • Server

BreadServer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008
00009 namespace Microsoft { namespace SDKSamples { namespace Kitchen {
00010
00011     Bread::Bread(Platform::String^ flavor) :
00012         _flavor(flavor)
00013     {
00014     }
00015
00016     Platform::String^ Bread::Flavor::get()
00017     {
00018         return _flavor;
00019     }
00020
00021 } /* Kitchen */ } /* SDKSamples */ } /* Microsoft */
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/SampleConfiguration.h Source File

  • WiFiDirect
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Wi-Fi Direct";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         void NotifyUserFromBackground(Platform::String^ strMessage, SDKTemplate::NotifyType type);
00039
00040     private:
00041         static Platform::Array<Scenario>^ scenariosInner;
00042     };
00043
00044     public value struct Scenario
00045     {
00046         Platform::String^ Title;
00047         Platform::String^ ClassName;
00048     };
00049 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StspDescription Member List

This is the complete list of members for StspDescription, including all inherited members.
aStreams | StspDescription
cNumStreams | StspDescription
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • ActivitySensor
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Resources;
00002 using System.Reflection;
00003 using System.Runtime.CompilerServices;
00004 using System.Runtime.InteropServices;
00005
00006 // General Information about an assembly is controlled through the following
00007 // set of attributes. Change these attribute values to modify the information
00008 // associated with an assembly.
00009 [assembly: AssemblyTitle("Tasks")]
00010 [assembly: AssemblyDescription("")]
00011 [assembly: AssemblyConfiguration("")]
00012 [assembly: AssemblyCompany("Microsoft Corporation")]
00013 [assembly: AssemblyProduct("")]
00014 [assembly: AssemblyCopyright("")]
00015 [assembly: AssemblyTrademark("")]
00016 [assembly: AssemblyCulture("")]
00017
00018 // Version information for an assembly consists of the following four values:
00019 //
00020 //      Major Version
00021 //      Minor Version
00022 //      Build Number
00023 //      Revision
00024 //
00025 // You can specify all the values or you can default the Build and Revision Numbers
00026 // by using the '*' as shown below:
00027 // [assembly: AssemblyVersion("1.0.*")]
00028 [assembly: AssemblyVersion("1.0.0.0")]
00029 [assembly: AssemblyFileVersion("1.0.0.0")]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cpp/PreviewUnavailable.xaml.h Source File

  • Printing
  • cpp

PreviewUnavailable.xaml.h

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "PreviewUnavailable.g.h"
00005
00006 namespace SDKTemplate
00007 {
00008     /// <summary>
00009     /// Used in scenario 5 to display a custom print preview unavailable page
00010     /// </summary>
00011     [Windows::Foundation::Metadata::WebHostHidden]
00012     public ref class PreviewUnavailable sealed
00013     {
00014     public:
00015         PreviewUnavailable();
00016
00017         /// <summary>
00018         /// Preview unavailable page constructor
00019         /// </summary>
00020         /// <param name="paperSize">The printing page paper size</param>
00021         /// <param name="printableSize">The usable/"printable" area on the page</param>
00022         PreviewUnavailable(Windows::Foundation::Size paperSize, Windows::Foundation::Size printableSize);
00023     };
00024 }
Generated on Fri Nov 15 2024 22:20:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlListView/cppwinrt/Scenario3_MasterDetail.h Source File

  • XamlListView
  • cppwinrt

Scenario3_MasterDetail.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario3_MasterDetail.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct Scenario3_MasterDetail : Scenario3_MasterDetailT<Scenario3_MasterDetail>
00018     {
00019         Scenario3_MasterDetail();
00020
00021         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00022         void OnLoaded(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00023         void OnCurrentStateChanged(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::VisualStateChangedEventArgs const&);
00024         void OnSelectionChanged(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const&);
00025         void OnItemClick(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::ItemClickEventArgs const& e);
00026         void AddItem(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027         void DeleteItem(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028         void DeleteItems(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00029         void SelectItems(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00030         void CancelSelection(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00031
00032     private:
00033         Windows::Foundation::Collections::IObservableVector<SDKTemplate::Contact> Contacts;
00034
00035         void EnableContentTransitions();
00036         void SelectSomethingIfPossible();
00037     };
00038 }
00039
00040 namespace winrt::SDKTemplate::factory_implementation
00041 {
00042     struct Scenario3_MasterDetail : Scenario3_MasterDetailT<Scenario3_MasterDetail, implementation::Scenario3_MasterDetail>
00043     {
00044     };
00045 }
Generated on Fri Nov 15 2024 22:22:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ActivitySensor/cpp/Scenario3_ChangeEvents.xaml.h Source File

  • ActivitySensor
  • cpp

Scenario3_ChangeEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_ChangeEvents.xaml.h
00014 // Declaration of the Scenario3_ChangeEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario3_ChangeEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario3_ChangeEvents sealed
00030     {
00031     public:
00032         Scenario3_ChangeEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Enumeration::DeviceAccessInformation^ m_deviceAccessInfo;
00041         Windows::Devices::Sensors::ActivitySensor^ m_activitySensor;
00042         Windows::Foundation::EventRegistrationToken m_readingToken;
00043
00044         void ReadingChanged(Windows::Devices::Sensors::ActivitySensor^ sender, Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs^ e);
00045         void ScenarioEnableReadingChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00046         void ScenarioDisableReadingChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00047         void AccessChanged(Windows::Devices::Enumeration::DeviceAccessInformation ^sender, Windows::Devices::Enumeration::DeviceAccessChangedEventArgs ^args);
00048
00049         Concurrency::task<Windows::Devices::Sensors::ActivitySensor^> GetActivitySensorAsync();
00050     };
00051 }
Generated on Fri Nov 15 2024 22:17:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario10_Delete.xaml.cs Source File

  • FileAccess
  • cs

Scenario10_Delete.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using Windows.Storage;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// Deleting a file.
00023     /// </summary>
00024     public sealed partial class Scenario10 : Page
00025     {
00026         MainPage rootPage = MainPage.Current;
00027
00028         public Scenario10()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             rootPage.ValidateFile();
00036         }
00037
00038         private async void DeleteFileButton_Click(object sender, RoutedEventArgs e)
00039         {
00040             StorageFile file = rootPage.sampleFile;
00041             if (file != null)
00042             {
00043                 try
00044                 {
00045                     string filename = file.Name;
00046                     await file.DeleteAsync();
00047                     rootPage.sampleFile = null;
00048                     rootPage.NotifyUser($"The file '{filename}' was deleted", NotifyType.StatusMessage);
00049                 }
00050                 catch (FileNotFoundException)
00051                 {
00052                     rootPage.NotifyUserFileNotExist();
00053                 }
00054                 catch (Exception ex)
00055                 {
00056                     // I/O errors are reported as exceptions.
00057                     rootPage.NotifyUser($"Error deleting file '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
00058                 }
00059             }
00060             else
00061             {
00062                 rootPage.NotifyUserFileNotExist();
00063             }
00064         }
00065     }
00066 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cs/Scenario1_WriteReadStream.xaml.cs Source File

  • DataReaderWriter
  • cs

Scenario1_WriteReadStream.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using SDKTemplate;
00012 using System;
00013 using System.Diagnostics;
00014 using Windows.Foundation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class WriteReadStream : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         string[] inputElements = new string[] {
00031             "Hello", "World", "1 2 3 4 5", "Très bien!", "Goodbye"
00032         };
00033
00034         public WriteReadStream()
00035         {
00036             this.InitializeComponent();
00037
00038             // Populate the text block with the input elements.
00039             ElementsToWrite.Text = String.Join(";", inputElements);
00040         }
00041
00042         /// <summary>
00043         /// Invoked when this page is about to be displayed in a Frame.
00044         /// </summary>
00045         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00046         /// property is typically used to configure the page.</param>
00047         protected override void OnNavigatedTo(NavigationEventArgs e)
00048         {
00049         }
00050
00051         /// <summary>
00052         /// This is the click handler for the 'Copy Strings' button.  Here we will parse the
00053         /// strings contained in the ElementsToWrite text block, write them to a stream using
00054         /// DataWriter, retrieve them using DataReader, and output the results in the
00055         /// ElementsRead text block.
00056         /// </summary>
00057         /// <param name="sender">Contains information about the button that fired the event.</param>
00058         /// <param name="e">Contains state information and event data associated with a routed event.</param>
00059         private async void TransferData(object sender, RoutedEventArgs e)
00060         {
00061             // Initialize the in-memory stream where data will be stored.
00062             using (var stream = new Windows.Storage.Streams.InMemoryRandomAccessStream())
00063             {
00064                 // Create the data writer object backed by the in-memory stream.
00065                 using (var dataWriter = new Windows.Storage.Streams.DataWriter(stream))
00066                 {
00067                     dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
00068                     dataWriter.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;
00069
00070                     // Write each element separately.
00071                     foreach (string inputElement in inputElements)
00072                     {
00073                         uint inputElementSize = dataWriter.MeasureString(inputElement);
00074                         dataWriter.WriteUInt32(inputElementSize);
00075                         dataWriter.WriteString(inputElement);
00076                     }
00077
00078                     // Send the contents of the writer to the backing stream.
00079                     await dataWriter.StoreAsync();
00080
00081                     // For the in-memory stream implementation we are using, the flushAsync call is superfluous,
00082                     // but other types of streams may require it.
00083                     await dataWriter.FlushAsync();
00084
00085                     // In order to prolong the lifetime of the stream, detach it from the DataWriter so that it
00086                     // will not be closed when Dispose() is called on dataWriter. Were we to fail to detach the
00087                     // stream, the call to dataWriter.Dispose() would close the underlying stream, preventing
00088                     // its subsequent use by the DataReader below.
00089                     dataWriter.DetachStream();
00090                 }
00091
00092                 // Create the input stream at position 0 so that the stream can be read from the beginning.
00093                 stream.Seek(0);
00094                 using (var dataReader = new Windows.Storage.Streams.DataReader(stream))
00095                 {
00096                     // The encoding and byte order need to match the settings of the writer we previously used.
00097                     dataReader.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
00098                     dataReader.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;
00099
00100                     // Once we have written the contents successfully we load the stream.
00101                     await dataReader.LoadAsync((uint)stream.Size);
00102
00103                     var receivedStrings = "";
00104
00105                     // Keep reading until we consume the complete stream.
00106                     while (dataReader.UnconsumedBufferLength > 0)
00107                     {
00108                         // Note that the call to readString requires a length of "code units" to read. This
00109                         // is the reason each string is preceded by its length when "on the wire".
00110                         uint bytesToRead = dataReader.ReadUInt32();
00111                         receivedStrings += dataReader.ReadString(bytesToRead) + "\n";
00112                     }
00113
00114                     // Populate the ElementsRead text block with the items we read from the stream.
00115                     ElementsRead.Text = receivedStrings;
00116                 }
00117             }
00118         }
00119     }
00120 }
Generated on Fri Nov 15 2024 22:19:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ConstantBufferNeverChanges Member List

This is the complete list of members for ConstantBufferNeverChanges, including all inherited members.
lightColor | ConstantBufferNeverChanges
lightPosition | ConstantBufferNeverChanges
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlPivot/cs/Scenario1.xaml.cs Source File

  • XamlPivot
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Linq;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Media.Imaging;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace PivotCS
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario1 : Page
00029     {
00030         private MainPage rootPage;
00031         public List<SampleDataModel> NewItems = null;
00032         public List<SampleDataModel> FlaggedItems = null;
00033         public List<SampleDataModel> AllItems = null;
00034
00035         public Scenario1()
00036         {
00037             this.InitializeComponent();
00038
00039             NewItems = SampleDataModel.GetSampleData().Where(x => x.IsNew).ToList();
00040             FlaggedItems = SampleDataModel.GetSampleData().Where(x => x.IsFlagged).ToList();
00041             AllItems = SampleDataModel.GetSampleData().ToList();
00042
00043             this.DataContext = this;
00044         }
00045
00046         protected override void OnNavigatedTo(NavigationEventArgs e)
00047         {
00048             rootPage = MainPage.Current;
00049         }
00050
00051
00052         private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
00053         {
00054             SampleDataModel SelectedItem = null;
00055
00056             if (e.AddedItems.Count >= 1)
00057             {
00058                 SelectedItem = e.AddedItems[0] as SampleDataModel;
00059                 (sender as ListView).SelectedItem = null;
00060                 ShowItem(SelectedItem);
00061             }
00062
00063         }
00064         async private void ShowItem(SampleDataModel model)
00065         {
00066             var MyDialog = new ContentDialog();
00067
00068             if (model != null)
00069             {
00070                 var MyImage = new Image();
00071                 MyImage.Source = new BitmapImage(new Uri(model.ImagePath));
00072                 MyImage.HorizontalAlignment = HorizontalAlignment.Stretch;
00073                 MyImage.VerticalAlignment = VerticalAlignment.Stretch;
00074                 MyImage.Stretch = Windows.UI.Xaml.Media.Stretch.UniformToFill;
00075                 MyDialog.Title = String.Format("You have selected {0}", model.ToString());
00076                 MyDialog.Content = MyImage;
00077             }
00078             else
00079             {
00080                 MyDialog.Title = "No item found";
00081
00082             }
00083
00084             MyDialog.PrimaryButtonText = "OK";
00085             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => await MyDialog.ShowAsync());
00086         }
00087         private void Scenario2_Click(Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args)
00088         {
00089             this.Frame.Navigate(typeof(Scenario2));
00090         }
00091         private void Scenario3_Click(Windows.UI.Xaml.Documents.Hyperlink sender, Windows.UI.Xaml.Documents.HyperlinkClickEventArgs args)
00092         {
00093             this.Frame.Navigate(typeof(Scenario3));
00094         }
00095     }
00096 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/pch.h Source File

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

pch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Header for standard system include files.
00014 //
00015
00016 #pragma once
00017
00018 #include <collection.h>
00019 #include <ppltasks.h>
00020
00021 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpatialStageManager Member List

This is the complete list of members for SpatialStageManager, including all inherited members.
CreateCircle(Windows::Foundation::Numerics::float3 center, float radius, int divisions, float radians) | SpatialStageManager | [private]
GetCoordinateSystemForCurrentStage() | SpatialStageManager |
m_currentCoordinateSystem | SpatialStageManager | [private]
m_currentStage | SpatialStageManager | [private]
m_deviceResources | SpatialStageManager | [private]
m_sceneController | SpatialStageManager | [private]
m_spatialStageChangedEventToken | SpatialStageManager | [private]
m_stageBoundsShape | SpatialStageManager | [private]
m_stageVisibleAreaIndicatorShape | SpatialStageManager | [private]
m_stationaryFrameOfReference | SpatialStageManager | [private]
OnCurrentChanged(Platform::Object^) | SpatialStageManager | [private]
SpatialStageManager(std::shared_ptr< DX::DeviceResources > const &deviceResources, std::shared_ptr< SceneController > const &sceneController) | SpatialStageManager |
SpatialStageManager(const SpatialStageManager &) | SpatialStageManager |
SpatialStageManager(SpatialStageManager &&) | SpatialStageManager |
TriangulatePoints(std::vector< Windows::Foundation::Numerics::float3 > const &vertices) | SpatialStageManager | [private]
~SpatialStageManager() | SpatialStageManager |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cppwinrt/Scenario3_SettingContainer.cpp Source File

  • ApplicationData
  • cppwinrt

Scenario3_SettingContainer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <sstream>
00014 #include "Scenario3_SettingContainer.h"
00015 #include "Scenario3_SettingContainer.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario3_SettingContainer::Scenario3_SettingContainer()
00026     {
00027         InitializeComponent();
00028     }
00029
00030     void Scenario3_SettingContainer::CreateContainer_Click(IInspectable const&, RoutedEventArgs const&)
00031     {
00032         ApplicationDataContainer container = localSettings.CreateContainer(containerName, ApplicationDataCreateDisposition::Always);
00033
00034         DisplayOutput();
00035     }
00036
00037     void Scenario3_SettingContainer::DeleteContainer_Click(IInspectable const&, RoutedEventArgs const&)
00038     {
00039         localSettings.DeleteContainer(containerName);
00040
00041         DisplayOutput();
00042     }
00043
00044     void Scenario3_SettingContainer::WriteSetting_Click(IInspectable const&, RoutedEventArgs const&)
00045     {
00046         localSettings.Containers().Lookup(containerName).Values().Insert(settingName, box_value(L"Hello World")); // example value
00047
00048         DisplayOutput();
00049     }
00050
00051     void Scenario3_SettingContainer::DeleteSetting_Click(IInspectable const&, RoutedEventArgs const&)
00052     {
00053         localSettings.Containers().Lookup(containerName).Values().Remove(settingName);
00054
00055         DisplayOutput();
00056     }
00057
00058     void Scenario3_SettingContainer::DisplayOutput()
00059     {
00060         ApplicationDataContainer container = localSettings.Containers().TryLookup(containerName);
00061         bool hasSetting = container ? container.Values().HasKey(settingName) : false;
00062
00063         std::wstringstream formatted;
00064         formatted << std::boolalpha << L"Container Exists: " << (container != nullptr) << std::endl;
00065         formatted << L"Setting Exists: " << hasSetting << std::endl;
00066
00067         OutputTextBlock().Text(formatted.str());
00068
00069         WriteSetting().IsEnabled(container != nullptr);
00070         DeleteSetting().IsEnabled(container != nullptr);
00071     }
00072
00073     void Scenario3_SettingContainer::OnNavigatedTo(NavigationEventArgs const&)
00074     {
00075         DisplayOutput();
00076     }
00077 }
00078
Generated on Fri Nov 15 2024 22:17:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cpp/pch.cpp Source File

  • BackgroundActivation
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cs/SampleConfiguration.cs Source File

  • BasicFaceDetection
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.Graphics.Imaging;
00015 using Windows.Media.FaceAnalysis;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Media.Imaging;
00019
00020 namespace SDKTemplate
00021 {
00022     public partial class MainPage : Page
00023     {
00024         public const string FEATURE_NAME = "Face detection C# sample";
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title="Detect Faces in Photos", ClassType=typeof(Scenario1_DetectInPhoto)},
00029             new Scenario() { Title="Detect Faces in Webcam", ClassType=typeof(Scenario2_DetectInWebcam)},
00030         };
00031
00032         /// <summary>
00033         /// Rescale the size and position of the face highlight box
00034         /// to account for the difference between the size of the image and
00035         /// the canvas.
00036         /// </summary>
00037         /// <param name="box">The element to rescale</param>
00038         /// <param name="widthScale">Horizontal adjustment factor</param>
00039         /// <param name="heightScale">Vertical adjustment factor</param>
00040         static void ApplyScale(FrameworkElement box, double widthScale, double heightScale)
00041         {
00042             // We saved the original size of the face box in the element's Tag field.
00043             BitmapBounds faceBox = (BitmapBounds)box.Tag;
00044             box.Width = faceBox.Width * widthScale;
00045             box.Height = faceBox.Height * heightScale;
00046             box.Margin = new Thickness(faceBox.X * widthScale, faceBox.Y * heightScale, 0, 0);
00047         }
00048
00049         public static void HighlightFaces(WriteableBitmap displaySource, IList<DetectedFace> foundFaces, Canvas canvas, DataTemplate template)
00050         {
00051             double widthScale = canvas.ActualWidth / displaySource.PixelWidth;
00052             double heightScale = canvas.ActualHeight / displaySource.PixelHeight;
00053
00054             foreach (DetectedFace face in foundFaces)
00055             {
00056                 // Create an  element for displaying the face box but since we're using a Canvas
00057                 // we must scale it according to the image's actual size.
00058                 // The original FaceBox values are saved in the element's Tag field so we can update the
00059                 // boxes when the Canvas is resized.
00060                 var box = (FrameworkElement)template.LoadContent();
00061                 box.Tag = face.FaceBox;
00062                 ApplyScale(box, widthScale, heightScale);
00063
00064                 canvas.Children.Add(box);
00065             }
00066
00067             string message;
00068             if (foundFaces.Count == 0)
00069             {
00070                 message = "Didn't find any human faces in the image";
00071             }
00072             else if (foundFaces.Count == 1)
00073             {
00074                 message = "Found a human face in the image";
00075             }
00076             else
00077             {
00078                 message = "Found " + foundFaces.Count + " human faces in the image";
00079             }
00080
00081             MainPage.Current.NotifyUser(message, NotifyType.StatusMessage);
00082         }
00083
00084         public static void RepositionFaces(WriteableBitmap displaySource, Canvas canvas)
00085         {
00086             double widthScale = canvas.ActualWidth / displaySource.PixelWidth;
00087             double heightScale = canvas.ActualHeight / displaySource.PixelHeight;
00088
00089             foreach (var item in canvas.Children)
00090             {
00091                 ApplyScale((FrameworkElement)item, widthScale, heightScale);
00092             }
00093         }
00094     }
00095
00096     public class Scenario
00097     {
00098         public string Title { get; set; }
00099         public Type ClassType { get; set; }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cs/DisplayHelpers.cs Source File

  • DeviceEnumerationAndPairing
  • cs

DisplayHelpers.cs

Go to the documentation of this file.
00001 ﻿// Copyright (c) Microsoft. All rights reserved.
00002
00003 using System;
00004 using System.Collections.Generic;
00005 using System.ComponentModel;
00006 using Windows.Devices.Enumeration;
00007 using Windows.UI.Xaml.Data;
00008 using Windows.UI.Xaml.Media.Imaging;
00009
00010 // NOTE: The following using statements are only needed in order to demonstrate many of the
00011 // different device selectors available from Windows Runtime APIs. You will only need to include
00012 // the namespace for the Windows Runtime API your actual scenario needs.
00013 using Windows.Devices.HumanInterfaceDevice;
00014 using Windows.Networking.Proximity;
00015 using Windows.Devices.Bluetooth;
00016 using Windows.Devices.WiFiDirect;
00017 using Windows.Media.Casting;
00018 using Windows.Media.DialProtocol;
00019 using Windows.Devices.Sensors;
00020 using Windows.Devices.PointOfService;
00021
00022 namespace SDKTemplate
00023 {
00024     public class DeviceSelectorInfo
00025     {
00026         public string DisplayName { get; set; }
00027         public DeviceClass DeviceClassSelector { get; set; } = DeviceClass.All;
00028         public DeviceInformationKind Kind { get; set; } = DeviceInformationKind.Unknown;
00029         public string Selector { get; set; }
00030     }
00031
00032     public static class DeviceSelectorChoices
00033     {
00034
00035         public static List<DeviceSelectorInfo> CommonDeviceSelectors => new List<DeviceSelectorInfo>()
00036         {
00037             // Pre-canned device class selectors
00038             new DeviceSelectorInfo() { DisplayName = "All Device Interfaces (default)", DeviceClassSelector = DeviceClass.All, Selector = null },
00039             new DeviceSelectorInfo() { DisplayName = "Audio Capture", DeviceClassSelector = DeviceClass.AudioCapture, Selector = null },
00040             new DeviceSelectorInfo() { DisplayName = "Audio Render", DeviceClassSelector = DeviceClass.AudioRender, Selector = null },
00041             new DeviceSelectorInfo() { DisplayName = "Image Scanner", DeviceClassSelector = DeviceClass.ImageScanner, Selector = null },
00042             new DeviceSelectorInfo() { DisplayName = "Location", DeviceClassSelector = DeviceClass.Location, Selector = null },
00043             new DeviceSelectorInfo() { DisplayName = "Portable Storage", DeviceClassSelector = DeviceClass.PortableStorageDevice, Selector = null },
00044             new DeviceSelectorInfo() { DisplayName = "Video Capture", DeviceClassSelector = DeviceClass.VideoCapture, Selector = null },
00045
00046             // A few examples of selectors built dynamically by windows runtime apis.
00047             new DeviceSelectorInfo() { DisplayName = "Human Interface (HID)", Selector = HidDevice.GetDeviceSelector(0, 0) },
00048             new DeviceSelectorInfo() { DisplayName = "Activity Sensor", Selector = ActivitySensor.GetDeviceSelector() },
00049             new DeviceSelectorInfo() { DisplayName = "Pedometer", Selector = Pedometer.GetDeviceSelector() },
00050             new DeviceSelectorInfo() { DisplayName = "Proximity", Selector = ProximityDevice.GetDeviceSelector() },
00051             new DeviceSelectorInfo() { DisplayName = "Proximity Sensor", Selector = ProximitySensor.GetDeviceSelector() },
00052         };
00053
00054         // Currently Bluetooth APIs don't provide a selector to get ALL devices that are both paired and non-paired.
00055         // Typically you wouldn't need this for common scenarios, but it's convenient to demonstrate the
00056         // various sample scenarios.
00057         public static DeviceSelectorInfo Bluetooth =>
00058             new DeviceSelectorInfo() { DisplayName = "Bluetooth", Selector = "System.Devices.Aep.ProtocolId:=\"{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\"", Kind = DeviceInformationKind.AssociationEndpoint };
00059
00060         public static DeviceSelectorInfo BluetoothUnpairedOnly =>
00061             new DeviceSelectorInfo() { DisplayName = "Bluetooth (unpaired)", Selector = BluetoothDevice.GetDeviceSelectorFromPairingState(false) };
00062
00063         public static DeviceSelectorInfo BluetoothPairedOnly =>
00064             new DeviceSelectorInfo() { DisplayName = "Bluetooth (paired)", Selector = BluetoothDevice.GetDeviceSelectorFromPairingState(true) };
00065
00066         // Currently Bluetooth APIs don't provide a selector to get ALL devices that are both paired and non-paired.
00067         // Typically you wouldn't need this for common scenarios, but it's convenient to demonstrate the
00068         // various sample scenarios.
00069         public static DeviceSelectorInfo BluetoothLE =>
00070             new DeviceSelectorInfo() { DisplayName = "Bluetooth LE", Selector = "System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\"", Kind = DeviceInformationKind.AssociationEndpoint };
00071
00072         public static DeviceSelectorInfo BluetoothLEUnpairedOnly =>
00073             new DeviceSelectorInfo() { DisplayName = "Bluetooth LE (unpaired)", Selector = BluetoothLEDevice.GetDeviceSelectorFromPairingState(false) };
00074
00075         public static DeviceSelectorInfo BluetoothLEPairedOnly =>
00076             new DeviceSelectorInfo() { DisplayName = "Bluetooth LE (paired)", Selector = BluetoothLEDevice.GetDeviceSelectorFromPairingState(true) };
00077
00078         public static DeviceSelectorInfo WiFiDirect =>
00079             new DeviceSelectorInfo() { DisplayName = "Wi-Fi Direct", Selector = WiFiDirectDevice.GetDeviceSelector(WiFiDirectDeviceSelectorType.AssociationEndpoint) };
00080
00081         public static DeviceSelectorInfo WiFiDirectPairedOnly =>
00082             new DeviceSelectorInfo() { DisplayName = "Wi-Fi Direct (paired)", Selector = WiFiDirectDevice.GetDeviceSelector() };
00083
00084         public static DeviceSelectorInfo PointOfServicePrinter =>
00085             new DeviceSelectorInfo() { DisplayName = "Point of Service Printer", Selector = PosPrinter.GetDeviceSelector() };
00086
00087         public static DeviceSelectorInfo VideoCasting =>
00088             new DeviceSelectorInfo() { DisplayName = "Video Casting", Selector = CastingDevice.GetDeviceSelector(CastingPlaybackTypes.Video) };
00089
00090         public static DeviceSelectorInfo DialAllApps =>
00091             new DeviceSelectorInfo() { DisplayName = "DIAL (All apps)", Selector = DialDevice.GetDeviceSelector("") };
00092
00093         // WSD and UPnP are unique in that there are currently no general WSD or UPnP APIs to USE the devices once you've discovered them.
00094         // You can pair the devices using DeviceInformation.Pairing.PairAsync etc, and you can USE them with the sockets APIs. However, since
00095         // there's no specific API right now, there's no *.GetDeviceSelector available.  That's why we just simply build the device selector
00096         // ourselves and specify the correct DeviceInformationKind (AssociationEndpoint).
00097         public static DeviceSelectorInfo Wsd =>
00098             new DeviceSelectorInfo() { DisplayName = "Web Services on Devices (WSD)", Selector = "System.Devices.Aep.ProtocolId:=\"{782232aa-a2f9-4993-971b-aedc551346b0}\"", Kind = DeviceInformationKind.AssociationEndpoint };
00099
00100         public static DeviceSelectorInfo Upnp =>
00101             new DeviceSelectorInfo() { DisplayName = "UPnP", Selector = "System.Devices.Aep.ProtocolId:=\"{0e261de4-12f0-46e6-91ba-428607ccef64}\"", Kind = DeviceInformationKind.AssociationEndpoint };
00102
00103         public static DeviceSelectorInfo NetworkCamera =>
00104             new DeviceSelectorInfo() { DisplayName = "Web Services on Devices (NetworkCamera)", Selector = "System.Devices.Aep.ProtocolId:=\"{43cc0de4-8ca8-4a56-805a-86fc63f21602}\"", Kind = DeviceInformationKind.AssociationEndpoint };
00105
00106         public static void AddVideoCastingIfSupported(List<DeviceSelectorInfo> selectors)
00107         {
00108             try
00109             {
00110                 selectors.Add(VideoCasting);
00111             }
00112             catch (Exception ex) when (ex.HResult == unchecked((int)0x80070032)) // HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
00113             {
00114                 // Video casting is not supported by the system.
00115             }
00116         }
00117
00118         public static List<DeviceSelectorInfo> DevicePickerSelectors
00119         {
00120             get
00121             {
00122                 // Add all selectors that can be used with the DevicePicker
00123                 List<DeviceSelectorInfo> selectors = new List<DeviceSelectorInfo>(CommonDeviceSelectors);
00124                 selectors.Add(BluetoothPairedOnly);
00125                 selectors.Add(BluetoothUnpairedOnly);
00126                 selectors.Add(BluetoothLEPairedOnly);
00127                 selectors.Add(BluetoothLEUnpairedOnly);
00128                 selectors.Add(WiFiDirect);
00129                 selectors.Add(PointOfServicePrinter);
00130                 AddVideoCastingIfSupported(selectors);
00131                 selectors.Add(DialAllApps);
00132
00133                 return selectors;
00134             }
00135         }
00136
00137         // Add all selectors that are reasonable to use with FindAllAsync
00138         public static List<DeviceSelectorInfo> FindAllAsyncSelectors =>
00139             new List<DeviceSelectorInfo>(CommonDeviceSelectors)
00140             {
00141                 BluetoothPairedOnly,
00142                 BluetoothLEPairedOnly,
00143                 WiFiDirectPairedOnly
00144             };
00145
00146         public static List<DeviceSelectorInfo> DeviceWatcherSelectors
00147         {
00148             get
00149             {
00150                 // Add all selectors that can be used with the DeviceWatcher
00151                 List<DeviceSelectorInfo> selectors = new List<DeviceSelectorInfo>(CommonDeviceSelectors);
00152                 selectors.Add(Bluetooth);
00153                 selectors.Add(BluetoothLE);
00154                 selectors.Add(WiFiDirect);
00155                 selectors.Add(PointOfServicePrinter);
00156                 AddVideoCastingIfSupported(selectors);
00157                 selectors.Add(DialAllApps);
00158                 selectors.Add(Wsd);
00159                 selectors.Add(Upnp);
00160
00161                 return selectors;
00162             }
00163         }
00164
00165         public static List<DeviceSelectorInfo> BackgroundDeviceWatcherSelectors
00166         {
00167             get
00168             {
00169                 // Add all selectors that can be used with the BackgroundDeviceWatcher
00170                 List<DeviceSelectorInfo> selectors = new List<DeviceSelectorInfo>(CommonDeviceSelectors);
00171                 selectors.Add(BluetoothPairedOnly);
00172                 selectors.Add(BluetoothLEPairedOnly);
00173                 selectors.Add(WiFiDirectPairedOnly);
00174                 selectors.Add(PointOfServicePrinter);
00175                 AddVideoCastingIfSupported(selectors);
00176                 selectors.Add(DialAllApps);
00177                 selectors.Add(Wsd);
00178                 selectors.Add(Upnp);
00179
00180                 return selectors;
00181             }
00182         }
00183
00184         /// <summary>
00185         /// Selectors for use in the pairing scenarios
00186         /// </summary>
00187         public static List<DeviceSelectorInfo> PairingSelectors
00188         {
00189             get
00190             {
00191                 // Add selectors that can be used in pairing scenarios
00192                 List<DeviceSelectorInfo> selectors = new List<DeviceSelectorInfo>();
00193                 selectors.Add(Bluetooth);
00194                 selectors.Add(BluetoothLE);
00195                 selectors.Add(WiFiDirect);
00196                 selectors.Add(PointOfServicePrinter);
00197                 AddVideoCastingIfSupported(selectors);
00198                 selectors.Add(Wsd);
00199                 selectors.Add(Upnp);
00200                 selectors.Add(NetworkCamera);
00201
00202                 return selectors;
00203             }
00204         }
00205     }
00206
00207     public struct DeviceInformationKindChoice
00208     {
00209         public string DisplayName { get; set; }
00210         public DeviceInformationKind[] DeviceInformationKinds { get; set; }
00211     }
00212
00213     public static class DeviceInformationKindChoices
00214     {
00215         public static List<DeviceInformationKindChoice> Choices =>
00216             new List<DeviceInformationKindChoice>()
00217             {
00218                 new DeviceInformationKindChoice() { DisplayName = "DeviceContainer", DeviceInformationKinds = new[] { DeviceInformationKind.DeviceContainer } },
00219                 new DeviceInformationKindChoice() { DisplayName = "Device", DeviceInformationKinds = new[] { DeviceInformationKind.Device } },
00220                 new DeviceInformationKindChoice() { DisplayName = "DeviceInterface (Default)", DeviceInformationKinds = new[] { DeviceInformationKind.DeviceInterface } },
00221                 new DeviceInformationKindChoice() { DisplayName = "DeviceInterfaceClass", DeviceInformationKinds = new[] { DeviceInformationKind.DeviceInterfaceClass } },
00222                 new DeviceInformationKindChoice() { DisplayName = "AssociationEndpointContainer", DeviceInformationKinds = new[] { DeviceInformationKind.AssociationEndpointContainer } },
00223                 new DeviceInformationKindChoice() { DisplayName = "AssociationEndpoint", DeviceInformationKinds = new[] { DeviceInformationKind.AssociationEndpoint } },
00224                 new DeviceInformationKindChoice() { DisplayName = "AssociationEndpointService", DeviceInformationKinds = new[] { DeviceInformationKind.AssociationEndpointService } },
00225                 new DeviceInformationKindChoice() { DisplayName = "AssociationEndpointService and DeviceInterface", DeviceInformationKinds = new[] { DeviceInformationKind.AssociationEndpointService, DeviceInformationKind.DeviceInterface } },
00226             };
00227     }
00228
00229     public struct ProtectionLevelSelectorInfo
00230     {
00231         public string DisplayName { get; set; }
00232         public DevicePairingProtectionLevel ProtectionLevel { get; set; }
00233     }
00234
00235     public static class ProtectionSelectorChoices
00236     {
00237         public static List<ProtectionLevelSelectorInfo> Selectors =>
00238             new List<ProtectionLevelSelectorInfo>()
00239             {
00240                 new ProtectionLevelSelectorInfo() { DisplayName = "Default", ProtectionLevel = DevicePairingProtectionLevel.Default },
00241                 new ProtectionLevelSelectorInfo() { DisplayName = "None", ProtectionLevel = DevicePairingProtectionLevel.None },
00242                 new ProtectionLevelSelectorInfo() { DisplayName = "Encryption", ProtectionLevel = DevicePairingProtectionLevel.Encryption },
00243                 new ProtectionLevelSelectorInfo() { DisplayName = "Encryption and authentication", ProtectionLevel = DevicePairingProtectionLevel.EncryptionAndAuthentication },
00244             };
00245     }
00246
00247     public class DeviceInformationDisplay : INotifyPropertyChanged
00248     {
00249         public DeviceInformationDisplay(DeviceInformation deviceInfoIn)
00250         {
00251             DeviceInformation = deviceInfoIn;
00252             UpdateGlyphBitmapImage();
00253         }
00254
00255         public DeviceInformationKind Kind => DeviceInformation.Kind;
00256         public string Id => DeviceInformation.Id;
00257         public string Name => DeviceInformation.Name;
00258         public BitmapImage GlyphBitmapImage { get; private set; }
00259         public bool CanPair => DeviceInformation.Pairing.CanPair;
00260         public bool IsPaired => DeviceInformation.Pairing.IsPaired;
00261         public IReadOnlyDictionary<string, object> Properties => DeviceInformation.Properties;
00262         public DeviceInformation DeviceInformation { get; private set; }
00263
00264         public void Update(DeviceInformationUpdate deviceInfoUpdate)
00265         {
00266             DeviceInformation.Update(deviceInfoUpdate);
00267
00268             OnPropertyChanged("Kind");
00269             OnPropertyChanged("Id");
00270             OnPropertyChanged("Name");
00271             OnPropertyChanged("DeviceInformation");
00272             OnPropertyChanged("CanPair");
00273             OnPropertyChanged("IsPaired");
00274             OnPropertyChanged("GetPropertyForDisplay");
00275
00276             UpdateGlyphBitmapImage();
00277         }
00278
00279         public string GetPropertyForDisplay(string key) => Properties[key]?.ToString();
00280
00281         private async void UpdateGlyphBitmapImage()
00282         {
00283             DeviceThumbnail deviceThumbnail = await DeviceInformation.GetGlyphThumbnailAsync();
00284             BitmapImage glyphBitmapImage = new BitmapImage();
00285             await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
00286             GlyphBitmapImage = glyphBitmapImage;
00287             OnPropertyChanged("GlyphBitmapImage");
00288         }
00289
00290         public event PropertyChangedEventHandler PropertyChanged;
00291         protected void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
00292     }
00293 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cs/Scenario1_ExtractTextSegments.xaml.cs Source File

  • TextSegmentation
  • cs

Scenario1_ExtractTextSegments.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using System;
00015 using System.Text;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class Scenario1_ExtractTextSegments
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public Scenario1_ExtractTextSegments()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// This is the click handler for the 'Word Segments' button.
00035         ///
00036         /// When this button is activated, the Text Segmentation API will calculate
00037         /// the word segments from the given input string and language tag, and then
00038         /// print out the word and alternate-form segments for that language.
00039         ///
00040         /// </summary>
00041         /// <param name="sender">The object that raised the event.</param>
00042         /// <param name="e">Event data that describes the click action on the button.</param>
00043         private void WordSegmentsButton_Click(object sender, RoutedEventArgs e)
00044         {
00045             // Initialize and obtain input values
00046             StringBuilder notifyText = new StringBuilder();
00047
00048             // Obtain the input string value, check for non-emptiness
00049             String inputStringText = inputStringBox.Text;
00050             if (String.IsNullOrEmpty(inputStringText))
00051             {
00052                 notifyText = new StringBuilder("Cannot compute word segments: input string is empty.");
00053                 rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00054                 return;
00055             }
00056
00057             // Obtain the language tag value, check for non-emptiness
00058             // Ex. Valid Values:
00059             //     "en-US" (English (United States))
00060             //     "fr-FR" (French (France))
00061             //     "de-DE" (German (Germany))
00062             //     "ja-JP" (Japanese (Japan))
00063             //     "ar-SA" (Arabic (Saudi Arabia))
00064             //     "zh-CN" (China (PRC))
00065             String languageTagText = languageTagBox.Text;
00066             if (String.IsNullOrEmpty(languageTagText))
00067             {
00068                 notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
00069                 languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
00070             }
00071             else
00072             {
00073                 if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
00074                 {
00075                     notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
00076                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00077                     return;
00078                 }
00079             }
00080
00081             // Notify that we are going to calculate word segments
00082             notifyText.AppendLine("\nCalculating word segments ...\n");
00083             notifyText.AppendLine("Input: \"" + inputStringText + "\"");
00084             notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
00085
00086             // Construct the WordsSegmenter instance
00087             var segmenter = new Windows.Data.Text.WordsSegmenter(languageTagText);
00088             var wordSegments = segmenter.GetTokens(inputStringText);
00089
00090             // Iterate over the tokenized segments
00091             foreach (var wordSegment in wordSegments)
00092             {
00093                 notifyText.AppendLine("\tWord---->\"" + wordSegment.Text + "\"");
00094                 foreach (var alternateForm in wordSegment.AlternateForms)
00095                 {
00096                     notifyText.AppendLine("\t\tAlternate---->\"" + alternateForm.AlternateText + "\"");
00097                 }
00098             }
00099
00100             // send notifyText to the output pane
00101             rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
00102         }
00103
00104         /// <summary>
00105         /// This is the click handler for the 'Selection Segments' button.
00106         ///
00107         /// When this button is activated, the Text Segmentation API will calculate
00108         /// the selection segments from the given input string and language tag, and then
00109         /// print out the word and alternate-form segments for that language.
00110         ///
00111         /// Selection segments differ from word segments in that they describe the bounds
00112         /// between active-selection snapping behavior.
00113         ///
00114         /// </summary>
00115         /// <param name="sender">The object that raised the event.</param>
00116         /// <param name="e">Event data that describes the click action on the button.</param>
00117         private void SelectionSegmentsButton_Click(object sender, RoutedEventArgs e)
00118         {
00119             // Initialize and obtain input values
00120             StringBuilder notifyText = new StringBuilder();
00121
00122             // Obtain the input string value, check for non-emptiness
00123             String inputStringText = inputStringBox.Text;
00124             if (String.IsNullOrEmpty(inputStringText))
00125             {
00126                 notifyText = new StringBuilder("Cannot compute selection segments: input string is empty.");
00127                 rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00128                 return;
00129             }
00130
00131             // Obtain the language tag value, check for non-emptiness
00132             // Ex. Valid Values:
00133             //     "en-US" (English (United States))
00134             //     "fr-FR" (French (France))
00135             //     "de-DE" (German (Germany))
00136             //     "ja-JP" (Japanese (Japan))
00137             //     "ar-SA" (Arabic (Saudi Arabia))
00138             //     "zh-CN" (China (PRC))
00139             String languageTagText = languageTagBox.Text;
00140             if (String.IsNullOrEmpty(languageTagText))
00141             {
00142                 notifyText.AppendLine("Language tag input is empty ... using generic-language segmentation rules.");
00143                 languageTagText = "und";    // This is used for non language-specific locales. 'und' is short for 'undetermined'.
00144             }
00145             else
00146             {
00147                 if (!Windows.Globalization.Language.IsWellFormed(languageTagText))
00148                 {
00149                     notifyText = new StringBuilder("Language tag is not well formed: \"" + languageTagText + "\"");
00150                     rootPage.NotifyUser(notifyText.ToString(), NotifyType.ErrorMessage);
00151                     return;
00152                 }
00153             }
00154
00155             // Notify that we are going to calculate selection segments
00156             notifyText.AppendLine("\nCalculating selection segments ...\n");
00157             notifyText.AppendLine("Input: \"" + inputStringText + "\"");
00158             notifyText.AppendLine("Language Tag: \"" + languageTagText + "\"");
00159
00160             // Construct the SelectableWordsSegmenter instance
00161             var segmenter = new Windows.Data.Text.SelectableWordsSegmenter(languageTagText);
00162             var selectionSegments = segmenter.GetTokens(inputStringText);
00163
00164             // Iterate over the tokenized segments
00165             foreach (var selectionSegment in selectionSegments)
00166             {
00167                 notifyText.AppendLine("\tWord---->\"" + selectionSegment.Text + "\"");
00168             }
00169
00170             // Set output box text to the contents of the StringBuilder instance
00171             rootPage.NotifyUser(notifyText.ToString(), NotifyType.StatusMessage);
00172         }
00173     }
00174 }
Generated on Fri Nov 15 2024 22:21:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CompositionVisual/cpp/VisualProperties.h Source File

  • CompositionVisual
  • cpp

VisualProperties.h

Go to the documentation of this file.
00001 #pragma once
00002
00003
00004 ref class VisualProperties sealed : public Windows::ApplicationModel::Core::IFrameworkView
00005 {
00006   Windows::ApplicationModel::Core::CoreApplicationView^ _view;
00007   Windows::UI::Core::CoreWindow^ _window;
00008   Windows::UI::Composition::Compositor^ _compositor;
00009   Windows::UI::Composition::ContainerVisual^ _root;
00010   Windows::UI::Composition::CompositionTarget^ _compositionTarget;
00011   Windows::UI::Composition::ContainerVisual^ _currentVisual;
00012   Windows::Foundation::Numerics::float2* _offsetBias;
00013   bool _dragging;
00014
00015   void InitNewComposition();
00016   Windows::UI::Composition::Visual^ CreateChildElement();
00017
00018 public:
00019   VisualProperties();
00020
00021     // IFrameworkView
00022   void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ view) override;
00023     void SetWindow(Windows::UI::Core::CoreWindow^ window) override;
00024     void Load(Platform::String^ unused) override;
00025     void Run() override;
00026     void Uninitialize() override;
00027
00028   void OnPointerPressed(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args);
00029   void OnPointerMoved(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args);
00030   void OnPointerReleased(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::PointerEventArgs^ args);
00031 };
00032
00033
00034 ref class VisualPropertiesFactory : Windows::ApplicationModel::Core::IFrameworkViewSource
00035 {
00036   //------------------------------------------------------------------------------
00037   //
00038   // VisualPropertiesFactory.CreateView
00039   //
00040   // This method is called by CoreApplication to provide a new IFrameworkView for
00041   // a CoreWindow that is being created.
00042   //
00043   //------------------------------------------------------------------------------
00044 public:
00045   virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView()
00046   {
00047     return ref new VisualProperties();
00048   }
00049 };
00050
00051
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ImageInfo Member List

This is the complete list of members for ImageInfo, including all inherited members.
bitsPerChannel | ImageInfo
bitsPerPixel | ImageInfo
imageKind | ImageInfo
isFloat | ImageInfo
numProfiles | ImageInfo
size | ImageInfo
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAuthenticationBroker/cpp/pch.cpp Source File

  • WebAuthenticationBroker
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cs/Scenario11.xaml.cs Source File

  • SimpleInk
  • cs

Scenario11.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 using Windows.UI.Input.Inking;
00012 using Windows.UI.ViewManagement;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     ///
00021     /// </summary>
00022     public sealed partial class Scenario11 : Page
00023     {
00024         AccessibilitySettings accessibility = new AccessibilitySettings();
00025
00026         public Scenario11()
00027         {
00028             this.InitializeComponent();
00029
00030             // Initialize the InkCanvas
00031             inkCanvas.InkPresenter.InputDeviceTypes =
00032                 Windows.UI.Core.CoreInputDeviceTypes.Mouse |
00033                 Windows.UI.Core.CoreInputDeviceTypes.Pen;
00034
00035             ContrastingColorButton.IsChecked = true;
00036             ContrastingColorButton.Visibility = accessibility.HighContrast ? Visibility.Visible : Visibility.Collapsed;
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             accessibility.HighContrastChanged += Accessibility_HighContrastChanged;
00042         }
00043
00044         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00045         {
00046             accessibility.HighContrastChanged -= Accessibility_HighContrastChanged;
00047         }
00048
00049         private void Accessibility_HighContrastChanged(AccessibilitySettings sender, object args)
00050         {
00051             ContrastingColorButton.Visibility = accessibility.HighContrast ? Visibility.Visible : Visibility.Collapsed;
00052         }
00053
00054         private void ContrastingColorButtonCheckedChanged(object sender, RoutedEventArgs e)
00055         {
00056             if (ContrastingColorButton.IsChecked.Value)
00057             {
00058                 inkCanvas.InkPresenter.HighContrastAdjustment = InkHighContrastAdjustment.UseSystemColorsWhenNecessary;
00059             }
00060             else
00061             {
00062                 inkCanvas.InkPresenter.HighContrastAdjustment = InkHighContrastAdjustment.UseOriginalColors;
00063             }
00064         }
00065
00066         private void OnSizeChanged(object sender, SizeChangedEventArgs e)
00067         {
00068             HelperFunctions.UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00069         }
00070
00071
00072     }
00073 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RoundingConverter Member List

This is the complete list of members for RoundingConverter, including all inherited members.
Convert(object value, Type targetType, object parameter, string language) | RoundingConverter | [inline]
ConvertBack(object value, Type targetType, object parameter, string language) | RoundingConverter | [inline]
Generated on Fri Nov 15 2024 22:23:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/pch.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/PlugInFilter.h Source File

  • HttpClient
  • cppwinrt

PlugInFilter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "PlugInFilter.g.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct PlugInFilter : PlugInFilterT<PlugInFilter>
00018     {
00019         PlugInFilter(Windows::Web::Http::Filters::IHttpFilter const& innerFilter);
00020         Windows::Foundation::IAsyncOperationWithProgress<Windows::Web::Http::HttpResponseMessage, Windows::Web::Http::HttpProgress>
00021             SendRequestAsync(Windows::Web::Http::HttpRequestMessage request);
00022         void Close();
00023
00024     private:
00025         Windows::Web::Http::Filters::IHttpFilter m_innerFilter;
00026     };
00027 }
00028
00029 namespace winrt::SDKTemplate::factory_implementation
00030 {
00031     struct PlugInFilter : PlugInFilterT<PlugInFilter, implementation::PlugInFilter>
00032     {
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Errors Member List

This is the complete list of members for Errors, including all inherited members.
Cancel | Errors | [static]
FileGroupEmpty | Errors | [static]
FileGroupLocation | Errors | [static]
InvalidSize | Errors | [static]
NoAlbumArt | Errors | [static]
NoExifThumbnail | Errors | [static]
NoIcon | Errors | [static]
NoImages | Errors | [static]
NoThumbnail | Errors | [static]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/DoubleToIntConverter.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

DoubleToIntConverter.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.UI.Xaml.Data;
00007
00008 namespace xBindSampleModel
00009 {
00010     public sealed class DoubleToIntConverter : IValueConverter
00011     {
00012         object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
00013         {
00014             if (!value.GetType().Equals(typeof(double)))
00015             {
00016                 throw new ArgumentException("Only Double is supported");
00017             }
00018             if (targetType.Equals(typeof(Int32)))
00019             {
00020                 return (Int32)((double)value);
00021             }
00022             else if (targetType.Equals(typeof(UInt32)))
00023             {
00024                 return (UInt32)((double)value);
00025             }
00026             else
00027             {
00028                 throw new ArgumentException("Unsuported type {0}", targetType.FullName);
00029             }
00030         }
00031
00032         object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
00033         {
00034             return (double)((Int32)value);
00035         }
00036     }
00037
00038     public sealed class IntToDoubleConverter : IValueConverter
00039     {
00040         public object Convert(object value, Type targetType, object parameter, string language)
00041         {
00042             return (double)((Int32)value);
00043         }
00044
00045         public object ConvertBack(object value, Type targetType, object parameter, string language)
00046         {
00047             return (Int32)((double)value);
00048         }
00049     }
00050 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/SampleOverlay.cpp Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

SampleOverlay.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleOverlay.h"
00014
00015 using namespace CustomPixelShader;
00016
00017 using namespace Windows::UI::Core;
00018 using namespace Windows::Foundation;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::UI::ViewManagement;
00021 using namespace Windows::Graphics::Display;
00022 using namespace D2D1;
00023
00024 SampleOverlay::SampleOverlay(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& caption) :
00025     m_deviceResources(deviceResources),
00026     m_caption(caption),
00027     m_drawOverlay(true)
00028 {
00029     m_padding = 8.0f;
00030     m_textVerticalOffset = 7.0f;
00031     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00032     m_overlayWidth = 0.0f;
00033
00034     CreateDeviceDependentResources();
00035     CreateWindowSizeDependentResources();
00036 }
00037
00038 void SampleOverlay::CreateDeviceDependentResources()
00039 {
00040     DX::ThrowIfFailed(
00041         m_deviceResources->GetD2DDeviceContext()->CreateSolidColorBrush(ColorF(ColorF::White), &m_whiteBrush)
00042         );
00043
00044     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00045     DX::ThrowIfFailed(
00046         m_deviceResources->GetWicImagingFactory()->CreateDecoderFromFilename(
00047             L"Assets\\storelogo-sdk.png",
00048             nullptr,
00049             GENERIC_READ,
00050             WICDecodeMetadataCacheOnDemand,
00051             &wicBitmapDecoder
00052             )
00053         );
00054
00055     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00056     DX::ThrowIfFailed(
00057         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00058         );
00059
00060     ComPtr<IWICFormatConverter> wicFormatConverter;
00061     DX::ThrowIfFailed(
00062         m_deviceResources->GetWicImagingFactory()->CreateFormatConverter(&wicFormatConverter)
00063         );
00064
00065     DX::ThrowIfFailed(
00066         wicFormatConverter->Initialize(
00067             wicBitmapFrame.Get(),
00068             GUID_WICPixelFormat32bppPBGRA,
00069             WICBitmapDitherTypeNone,
00070             nullptr,
00071             0.0,
00072             WICBitmapPaletteTypeCustom  // the BGRA format has no palette so this value is ignored
00073             )
00074         );
00075
00076     double dpiX = 96.0;
00077     double dpiY = 96.0;
00078     DX::ThrowIfFailed(
00079         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00080         );
00081
00082     DX::ThrowIfFailed(
00083         m_deviceResources->GetD2DDeviceContext()->CreateBitmapFromWicBitmap(
00084             wicFormatConverter.Get(),
00085             BitmapProperties(
00086                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00087                 static_cast<float>(dpiX),
00088                 static_cast<float>(dpiY)
00089                 ),
00090             &m_logoBitmap
00091             )
00092         );
00093
00094     m_logoSize = m_logoBitmap->GetSize();
00095
00096     ComPtr<IDWriteTextFormat> nameTextFormat;
00097     DX::ThrowIfFailed(
00098         m_deviceResources->GetDWriteFactory()->CreateTextFormat(
00099             L"Segoe UI",
00100             nullptr,
00101             DWRITE_FONT_WEIGHT_LIGHT,
00102             DWRITE_FONT_STYLE_NORMAL,
00103             DWRITE_FONT_STRETCH_NORMAL,
00104             36.0f,
00105             L"en-US",
00106             &nameTextFormat
00107             )
00108         );
00109
00110     DX::ThrowIfFailed(
00111         nameTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING)
00112         );
00113
00114     DX::ThrowIfFailed(
00115         nameTextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
00116         );
00117
00118     DX::ThrowIfFailed(
00119         m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00120             m_caption.c_str(),
00121             static_cast<UINT32>(m_caption.size()),
00122             nameTextFormat.Get(),
00123             4096.0f,
00124             4096.0f,
00125             &m_textLayout
00126             )
00127         );
00128
00129     DWRITE_TEXT_METRICS metrics = {0};
00130     DX::ThrowIfFailed(
00131         m_textLayout->GetMetrics(&metrics)
00132         );
00133
00134     m_overlayWidth = m_padding * 3.0f + m_logoSize.width + metrics.width;
00135
00136     DX::ThrowIfFailed(
00137         m_deviceResources->GetD2DFactory()->CreateDrawingStateBlock(&m_stateBlock)
00138         );
00139 }
00140
00141 void SampleOverlay::CreateWindowSizeDependentResources()
00142 {
00143     if (CoreWindow::GetForCurrentThread()->Bounds.Width < m_overlayWidth)
00144     {
00145         m_drawOverlay = false;
00146     }
00147     else
00148     {
00149         m_drawOverlay = true;
00150     }
00151 }
00152
00153 // Release all references to resources that depend on the graphics device.
00154 // This method is invoked when the device is lost and resources are no longer usable.
00155 void SampleOverlay::ReleaseDeviceDependentResources()
00156 {
00157     m_whiteBrush.Reset();
00158     m_logoBitmap.Reset();
00159 }
00160
00161 void SampleOverlay::Render()
00162 {
00163     if (m_drawOverlay)
00164     {
00165         m_deviceResources->GetD2DDeviceContext()->SaveDrawingState(m_stateBlock.Get());
00166
00167         m_deviceResources->GetD2DDeviceContext()->BeginDraw();
00168         m_deviceResources->GetD2DDeviceContext()->SetTransform(m_deviceResources->GetOrientationTransform2D());
00169         m_deviceResources->GetD2DDeviceContext()->DrawBitmap(
00170             m_logoBitmap.Get(),
00171             D2D1::RectF(m_padding, m_padding, m_logoSize.width + m_padding, m_logoSize.height + m_padding)
00172             );
00173
00174         m_deviceResources->GetD2DDeviceContext()->DrawTextLayout(
00175             Point2F(m_logoSize.width + 2.0f * m_padding, m_textVerticalOffset),
00176             m_textLayout.Get(),
00177             m_whiteBrush.Get()
00178             );
00179
00180         // We ignore D2DERR_RECREATE_TARGET here. This error indicates that the device
00181         // is lost. It will be handled during the next call to Present.
00182         HRESULT hr = m_deviceResources->GetD2DDeviceContext()->EndDraw();
00183         if (hr != D2DERR_RECREATE_TARGET)
00184         {
00185             DX::ThrowIfFailed(hr);
00186         }
00187
00188         m_deviceResources->GetD2DDeviceContext()->RestoreDrawingState(m_stateBlock.Get());
00189     }
00190 }
00191
00192 float SampleOverlay::GetTitleHeightInDips()
00193 {
00194     return m_logoSize.height + m_padding;
00195 }
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.cpp Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingConsumer.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #include "pch.h"
00022
00023 using namespace concurrency;
00024 using namespace Microsoft::WRL;
00025 using namespace Platform;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Devices::AllJoyn;
00028 using namespace org::alljoyn::Onboarding;
00029
00030 std::map<alljoyn_interfacedescription, WeakReference*> OnboardingConsumer::SourceInterfaces;
00031 PCSTR OnboardingConsumer::m_interfaceName = "org.alljoyn.Onboarding";
00032
00033 OnboardingConsumer::OnboardingConsumer(AllJoynBusAttachment^ busAttachment)
00034     : m_busAttachment(busAttachment),
00035     m_proxyBusObject(nullptr),
00036     m_busObject(nullptr)
00037 {
00038     m_weak = new WeakReference(this);
00039     m_signals = ref new OnboardingSignals();
00040     m_nativeBusAttachment = AllJoynHelpers::GetInternalBusAttachment(m_busAttachment);
00041
00042     GUID result;
00043     HRESULT hr = CoCreateGuid(&result);
00044
00045     if (FAILED(hr))
00046     {
00047         throw ref new Exception(hr);
00048     }
00049
00050     // The consumer needs a bus object to share signals, and its object path must be unique in
00051     // case multiple consumers are created using the same bus attachment.
00052     Guid gd(result);
00053     ServiceObjectPath = gd.ToString();
00054 }
00055
00056 OnboardingConsumer::~OnboardingConsumer()
00057 {
00058     if (nullptr != ProxyBusObject)
00059     {
00060         alljoyn_proxybusobject_destroy(ProxyBusObject);
00061     }
00062     delete m_weak;
00063 }
00064
00065 QStatus OnboardingConsumer::AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
00066 {
00067     alljoyn_interfacedescription_member member;
00068     if (!alljoyn_interfacedescription_getmember(interfaceDescription, methodName, &member))
00069     {
00070         return ER_BUS_INTERFACE_NO_SUCH_MEMBER;
00071     }
00072
00073     return alljoyn_busattachment_registersignalhandler(busAttachment, handler, member, NULL);
00074 }
00075
00076 IAsyncOperation<OnboardingConsumer^>^ OnboardingConsumer::FromIdAsync(_In_ Platform::String^ deviceId)
00077 {
00078     return OnboardingConsumer::FromIdAsync(deviceId, AllJoynBusAttachment::GetDefault());
00079 }
00080
00081 IAsyncOperation<OnboardingConsumer^>^ OnboardingConsumer::FromIdAsync(_In_ Platform::String^ deviceId, _In_ AllJoynBusAttachment^ busAttachment)
00082 {
00083     return create_async([deviceId, busAttachment]() -> OnboardingConsumer^
00084     {
00085         OnboardingConsumer^ result;
00086         create_task(AllJoynServiceInfo::FromIdAsync(deviceId)).then([busAttachment, &result](AllJoynServiceInfo^ serviceInfo)
00087         {
00088             if (serviceInfo != nullptr)
00089             {
00090                 int32 status = AllJoynStatus::Ok;
00091                 if (busAttachment->State == AllJoynBusAttachmentState::Disconnected)
00092                 {
00093                     event connectedEvent;
00094                     auto token = busAttachment->StateChanged += ref new TypedEventHandler<AllJoynBusAttachment^, AllJoynBusAttachmentStateChangedEventArgs^>([&connectedEvent](AllJoynBusAttachment^, AllJoynBusAttachmentStateChangedEventArgs^ arg)
00095                     {
00096                         if (arg->State == AllJoynBusAttachmentState::Connected)
00097                         {
00098                             connectedEvent.set();
00099                         }
00100                     });
00101
00102                     status = AllJoynHelpers::CreateInterfaces(busAttachment, c_OnboardingIntrospectionXml);
00103                     if (status == AllJoynStatus::Ok)
00104                     {
00105                         busAttachment->Connect();
00106                         connectedEvent.wait();
00107                     }
00108                     busAttachment->StateChanged -= token;
00109                 }
00110
00111                 if (status == AllJoynStatus::Ok)
00112                 {
00113                     auto consumer = ref new OnboardingConsumer(busAttachment);
00114                     status = consumer->Initialize(serviceInfo);
00115                     if (status == AllJoynStatus::Ok)
00116                     {
00117                         result = consumer;
00118                     }
00119                 }
00120             }
00121         }).wait();
00122
00123         return result;
00124     });
00125 }
00126
00127 IAsyncOperation<OnboardingConfigureWiFiResult^>^ OnboardingConsumer::ConfigureWiFiAsync(_In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
00128 {
00129     return create_async([this, interfaceMemberSSID, interfaceMemberPassphrase, interfaceMemberAuthType]() -> OnboardingConfigureWiFiResult^
00130     {
00131         auto result = ref new OnboardingConfigureWiFiResult();
00132
00133         alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
00134         size_t argCount = 3;
00135         alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
00136
00137         QStatus status = ER_OK;
00138         status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 0), "s", interfaceMemberSSID));
00139         if (ER_OK == status)
00140         {
00141             status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 1), "s", interfaceMemberPassphrase));
00142         }
00143         if (ER_OK == status)
00144         {
00145             status = static_cast<QStatus>(TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 2), "n", interfaceMemberAuthType));
00146         }
00147         if (ER_OK == status)
00148         {
00149             status = alljoyn_proxybusobject_methodcall(
00150                 ProxyBusObject,
00151                 m_interfaceName,
00152                 "ConfigureWiFi",
00153                 inputs,
00154                 argCount,
00155                 message,
00156                 c_MessageTimeoutInMilliseconds,
00157                 0);
00158         }
00159         result->Status = static_cast<int>(status);
00160         if (ER_OK == status)
00161         {
00162             result->Status = AllJoynStatus::Ok;
00163             int16 argument0;
00164             status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "n", &argument0));
00165             result->Status2 = argument0;
00166
00167             if (ER_OK != status)
00168             {
00169                 result->Status = static_cast<int>(status);
00170             }
00171         }
00172         else if (ER_BUS_REPLY_IS_ERROR_MESSAGE == status)
00173         {
00174             alljoyn_msgarg errorArg = alljoyn_message_getarg(message, 1);
00175             if (nullptr != errorArg)
00176             {
00177                 uint16 errorStatus;
00178                 status = alljoyn_msgarg_get_uint16(errorArg, &errorStatus);
00179                 if (ER_OK == status)
00180                 {
00181                     status = static_cast<QStatus>(errorStatus);
00182                 }
00183             }
00184             result->Status = static_cast<int>(status);
00185         }
00186
00187         alljoyn_message_destroy(message);
00188         alljoyn_msgarg_destroy(inputs);
00189
00190         return result;
00191     });
00192 }
00193 IAsyncOperation<OnboardingConnectResult^>^ OnboardingConsumer::ConnectAsync()
00194 {
00195     return create_async([this]() -> OnboardingConnectResult^
00196     {
00197         auto result = ref new OnboardingConnectResult();
00198
00199         alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
00200         size_t argCount = 0;
00201         alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
00202
00203         QStatus status = ER_OK;
00204         if (ER_OK == status)
00205         {
00206             status = alljoyn_proxybusobject_methodcall(
00207                 ProxyBusObject,
00208                 m_interfaceName,
00209                 "Connect",
00210                 inputs,
00211                 argCount,
00212                 message,
00213                 c_MessageTimeoutInMilliseconds,
00214                 0);
00215         }
00216         result->Status = static_cast<int>(status);
00217
00218         alljoyn_message_destroy(message);
00219         alljoyn_msgarg_destroy(inputs);
00220
00221         return result;
00222     });
00223 }
00224 IAsyncOperation<OnboardingOffboardResult^>^ OnboardingConsumer::OffboardAsync()
00225 {
00226     return create_async([this]() -> OnboardingOffboardResult^
00227     {
00228         auto result = ref new OnboardingOffboardResult();
00229
00230         alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
00231         size_t argCount = 0;
00232         alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
00233
00234         QStatus status = ER_OK;
00235         if (ER_OK == status)
00236         {
00237             status = alljoyn_proxybusobject_methodcall(
00238                 ProxyBusObject,
00239                 m_interfaceName,
00240                 "Offboard",
00241                 inputs,
00242                 argCount,
00243                 message,
00244                 c_MessageTimeoutInMilliseconds,
00245                 0);
00246         }
00247         result->Status = static_cast<int>(status);
00248
00249         alljoyn_message_destroy(message);
00250         alljoyn_msgarg_destroy(inputs);
00251
00252         return result;
00253     });
00254 }
00255 IAsyncOperation<OnboardingGetScanInfoResult^>^ OnboardingConsumer::GetScanInfoAsync()
00256 {
00257     return create_async([this]() -> OnboardingGetScanInfoResult^
00258     {
00259         auto result = ref new OnboardingGetScanInfoResult();
00260
00261         alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
00262         size_t argCount = 0;
00263         alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
00264
00265         QStatus status = ER_OK;
00266         if (ER_OK == status)
00267         {
00268             status = alljoyn_proxybusobject_methodcall(
00269                 ProxyBusObject,
00270                 m_interfaceName,
00271                 "GetScanInfo",
00272                 inputs,
00273                 argCount,
00274                 message,
00275                 c_MessageTimeoutInMilliseconds,
00276                 0);
00277         }
00278         result->Status = static_cast<int>(status);
00279         if (ER_OK == status)
00280         {
00281             result->Status = AllJoynStatus::Ok;
00282             uint16 argument0;
00283             status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "q", &argument0));
00284             result->Age = argument0;
00285
00286             if (ER_OK != status)
00287             {
00288                 result->Status = static_cast<int>(status);
00289             }
00290             Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ argument1;
00291             status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 1), "a(sn)", &argument1));
00292             result->ScanList = argument1;
00293
00294             if (ER_OK != status)
00295             {
00296                 result->Status = static_cast<int>(status);
00297             }
00298         }
00299         else if (ER_BUS_REPLY_IS_ERROR_MESSAGE == status)
00300         {
00301             alljoyn_msgarg errorArg = alljoyn_message_getarg(message, 1);
00302             if (nullptr != errorArg)
00303             {
00304                 uint16 errorStatus;
00305                 status = alljoyn_msgarg_get_uint16(errorArg, &errorStatus);
00306                 if (ER_OK == status)
00307                 {
00308                     status = static_cast<QStatus>(errorStatus);
00309                 }
00310             }
00311             result->Status = static_cast<int>(status);
00312         }
00313
00314         alljoyn_message_destroy(message);
00315         alljoyn_msgarg_destroy(inputs);
00316
00317         return result;
00318     });
00319 }
00320
00321 IAsyncOperation<OnboardingGetVersionResult^>^ OnboardingConsumer::GetVersionAsync()
00322 {
00323     return create_async([this]() -> OnboardingGetVersionResult^
00324     {
00325         PropertyGetContext<uint16> getContext;
00326
00327         alljoyn_proxybusobject_getpropertyasync(
00328             ProxyBusObject,
00329             m_interfaceName,
00330             "Version",
00331             [](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
00332             {
00333                 UNREFERENCED_PARAMETER(obj);
00334                 auto propertyContext = static_cast<PropertyGetContext<uint16>*>(context);
00335
00336                 if (ER_OK == status)
00337                 {
00338                     uint16 argument;
00339                     status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(value, "q", &argument));
00340
00341                     propertyContext->SetValue(argument);
00342                 }
00343                 propertyContext->SetStatus(status);
00344                 propertyContext->SetEvent();
00345             },
00346             c_MessageTimeoutInMilliseconds,
00347             &getContext);
00348
00349         getContext.Wait();
00350
00351         auto result = ref new OnboardingGetVersionResult();
00352         result->Status = getContext.GetStatus();
00353         result->Version = getContext.GetValue();
00354         return result;
00355     });
00356 }
00357
00358 IAsyncOperation<OnboardingGetStateResult^>^ OnboardingConsumer::GetStateAsync()
00359 {
00360     return create_async([this]() -> OnboardingGetStateResult^
00361     {
00362         PropertyGetContext<int16> getContext;
00363
00364         alljoyn_proxybusobject_getpropertyasync(
00365             ProxyBusObject,
00366             m_interfaceName,
00367             "State",
00368             [](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
00369             {
00370                 UNREFERENCED_PARAMETER(obj);
00371                 auto propertyContext = static_cast<PropertyGetContext<int16>*>(context);
00372
00373                 if (ER_OK == status)
00374                 {
00375                     int16 argument;
00376                     status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(value, "n", &argument));
00377
00378                     propertyContext->SetValue(argument);
00379                 }
00380                 propertyContext->SetStatus(status);
00381                 propertyContext->SetEvent();
00382             },
00383             c_MessageTimeoutInMilliseconds,
00384             &getContext);
00385
00386         getContext.Wait();
00387
00388         auto result = ref new OnboardingGetStateResult();
00389         result->Status = getContext.GetStatus();
00390         result->State = getContext.GetValue();
00391         return result;
00392     });
00393 }
00394
00395 IAsyncOperation<OnboardingGetLastErrorResult^>^ OnboardingConsumer::GetLastErrorAsync()
00396 {
00397     return create_async([this]() -> OnboardingGetLastErrorResult^
00398     {
00399         PropertyGetContext<OnboardingLastError^> getContext;
00400
00401         alljoyn_proxybusobject_getpropertyasync(
00402             ProxyBusObject,
00403             m_interfaceName,
00404             "LastError",
00405             [](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
00406             {
00407                 UNREFERENCED_PARAMETER(obj);
00408                 auto propertyContext = static_cast<PropertyGetContext<OnboardingLastError^>*>(context);
00409
00410                 if (ER_OK == status)
00411                 {
00412                     OnboardingLastError^ argument;
00413                     status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(value, "(ns)", &argument));
00414
00415                     propertyContext->SetValue(argument);
00416                 }
00417                 propertyContext->SetStatus(status);
00418                 propertyContext->SetEvent();
00419             },
00420             c_MessageTimeoutInMilliseconds,
00421             &getContext);
00422
00423         getContext.Wait();
00424
00425         auto result = ref new OnboardingGetLastErrorResult();
00426         result->Status = getContext.GetStatus();
00427         result->LastError = getContext.GetValue();
00428         return result;
00429     });
00430 }
00431
00432 void OnboardingConsumer::OnPropertyChanged(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated)
00433 {
00434     UNREFERENCED_PARAMETER(obj);
00435     UNREFERENCED_PARAMETER(interfaceName);
00436     UNREFERENCED_PARAMETER(changed);
00437     UNREFERENCED_PARAMETER(invalidated);
00438 }
00439
00440 void OnboardingConsumer::CallConnectionResultSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message)
00441 {
00442     auto source = SourceInterfaces.find(member->iface);
00443     if (source == SourceInterfaces.end())
00444     {
00445         return;
00446     }
00447
00448     auto consumer = source->second->Resolve<OnboardingConsumer>();
00449     if (consumer->Signals != nullptr)
00450     {
00451         auto callInfo = ref new AllJoynMessageInfo(AllJoynHelpers::MultibyteToPlatformString(alljoyn_message_getsender(message)));
00452         auto eventArgs = ref new OnboardingConnectionResultReceivedEventArgs();
00453         eventArgs->MessageInfo = callInfo;
00454
00455         Onboarding^ argument0;
00456         (void)TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "(ns)", &argument0);
00457
00458         eventArgs->Arg = argument0;
00459
00460         consumer->Signals->CallConnectionResultReceived(consumer->Signals, eventArgs);
00461     }
00462 }
00463
00464 int32 OnboardingConsumer::Initialize(_In_ AllJoynServiceInfo^ serviceInfo)
00465 {
00466     std::vector<char> sessionNameUtf8 = AllJoynHelpers::PlatformToMultibyteString(serviceInfo->UniqueName);
00467
00468     ServiceObjectPath = serviceInfo->ObjectPath;
00469     std::vector<char> objectPath = AllJoynHelpers::PlatformToMultibyteString(ServiceObjectPath);
00470
00471     RETURN_IF_QSTATUS_ERROR(AllJoynHelpers::CreateInterfaces(m_busAttachment, c_OnboardingIntrospectionXml));
00472
00473     m_session = create_task(AllJoynSession::GetFromServiceInfoAsync(serviceInfo, m_busAttachment)).get();
00474     if (nullptr == m_session)
00475     {
00476         return AllJoynStatus::Fail;
00477     }
00478     else if (m_session->Status != AllJoynStatus::Ok)
00479     {
00480         return m_session->Status;
00481     }
00482
00483     if (objectPath.empty())
00484     {
00485         return AllJoynStatus::Fail;
00486     }
00487
00488     ProxyBusObject = alljoyn_proxybusobject_create(m_nativeBusAttachment, &sessionNameUtf8[0], &objectPath[0], m_session->Id);
00489     if (nullptr == ProxyBusObject)
00490     {
00491         return AllJoynStatus::Fail;
00492     }
00493
00494
00495     alljoyn_interfacedescription description = alljoyn_busattachment_getinterface(m_nativeBusAttachment, m_interfaceName);
00496     if (nullptr == description)
00497     {
00498         return AllJoynStatus::Fail;
00499     }
00500
00501     m_busObject = ref new Windows::Devices::AllJoyn::AllJoynBusObject(ServiceObjectPath, m_busAttachment);
00502     m_nativeBusObject = AllJoynHelpers::GetInternalBusObject(m_busObject);
00503
00504     QStatus status = alljoyn_busobject_addinterface(m_nativeBusObject, description);
00505     if ((status != ER_OK) && (status != ER_BUS_IFACE_ALREADY_EXISTS))
00506     {
00507         return status;
00508     }
00509
00510
00511     QStatus result = AddSignalHandler(
00512         m_nativeBusAttachment,
00513         description,
00514         "ConnectionResult",
00515         [](const alljoyn_interfacedescription_member* member, PCSTR srcPath, alljoyn_message message) { UNREFERENCED_PARAMETER(srcPath); CallConnectionResultSignalHandler(member, message); });
00516
00517     if (ER_OK != result)
00518     {
00519         return static_cast<int32>(result);
00520     }
00521
00522     SourceInterfaces[description] = m_weak;
00523
00524     unsigned int noneMechanismIndex = 0;
00525     bool authenticationMechanismsContainsNone = m_busAttachment->AuthenticationMechanisms->IndexOf(AllJoynAuthenticationMechanism::None, &noneMechanismIndex);
00526     QCC_BOOL interfaceIsSecure = alljoyn_interfacedescription_issecure(description);
00527
00528     // If the current set of AuthenticationMechanisms supports authentication,
00529     // determine whether to secure the connection.
00530     if (AllJoynHelpers::CanSecure(m_busAttachment->AuthenticationMechanisms))
00531     {
00532         // Secure the connection if the org.alljoyn.Bus.Secure XML annotation
00533         // is specified, or if None is not present in AuthenticationMechanisms.
00534         if (!authenticationMechanismsContainsNone || interfaceIsSecure)
00535         {
00536             RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_secureconnection(ProxyBusObject, QCC_FALSE));
00537             m_busObject->Start();
00538         }
00539         else
00540         {
00541             m_busObject->Start();
00542         }
00543     }
00544     else
00545     {
00546         // If the current set of AuthenticationMechanisms does not support authentication
00547         // but the interface requires security, report an error.
00548         if (interfaceIsSecure)
00549         {
00550             return static_cast<int32>(ER_BUS_NO_AUTHENTICATION_MECHANISM);
00551         }
00552         else
00553         {
00554             m_busObject->Start();
00555         }
00556     }
00557
00558     RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_addinterface(ProxyBusObject, description));
00559
00560     m_signals->Initialize(this);
00561
00562     return AllJoynStatus::Ok;
00563 }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScannerProvider/cpp/BarcodeScannerProvider/Scenario1_Configuration.xaml.cpp Source File

  • BarcodeScannerProvider
  • cpp
  • BarcodeScannerProvider

Scenario1_Configuration.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Configuration.xaml.h"
00013
00014 using namespace Concurrency;
00015 using namespace Platform;
00016 using namespace SDKTemplate;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::Media::Ocr;
00020 using namespace Windows::Storage;
00021 using namespace Windows::UI::Xaml;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Scenario1_Configuration::Scenario1_Configuration()
00025 {
00026     InitializeComponent();
00027
00028     IVectorView<Windows::Globalization::Language^>^ availableLanguages = OcrEngine::AvailableRecognizerLanguages;
00029
00030     // Check if any OCR language is available on device.
00031     if (availableLanguages->Size > 0)
00032     {
00033         String^ languageTag = (String^)ApplicationData::Current->LocalSettings->Values->Lookup("decoderLanguage");
00034         for (Windows::Globalization::Language^ language : availableLanguages)
00035         {
00036             auto item = ref new ComboBoxItem();
00037             item->Content = language->DisplayName;
00038             item->Tag = language;
00039             LanguageList->Items->Append(item);
00040             if (languageTag == language->LanguageTag)
00041             {
00042                 LanguageList->SelectedItem = item;
00043                 break;
00044             }
00045         }
00046
00047         // If not found (or user had never set a preference), then select the first one.
00048         if (LanguageList->SelectedIndex < 0)
00049         {
00050             LanguageList->SelectedIndex = 0;
00051         }
00052     }
00053 }
00054
00055 /// <summary>
00056 /// Occurs when selected language is changed in available languages combo box.
00057 /// </summary>
00058 /// <param name="sender"></param>
00059 /// <param name="e"></param>
00060 void Scenario1_Configuration::LanguageList_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
00061 {
00062     auto selectedItem = safe_cast<ComboBoxItem^>(LanguageList->SelectedItem);
00063     if (selectedItem != nullptr)
00064     {
00065         auto selectedLanguage = safe_cast<Windows::Globalization::Language^>(selectedItem->Tag);
00066         m_rootPage->NotifyUser(
00067             "Selected OCR language is " + selectedLanguage->DisplayName + ".",
00068             NotifyType::StatusMessage);
00069
00070         ApplicationData::Current->LocalSettings->Values->Insert("decoderLanguage", selectedLanguage->LanguageTag);
00071     }
00072 }
Generated on Fri Nov 15 2024 22:18:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario6_NumeralSystemTranslation.h Source File

  • NumberFormatting
  • cppwinrt

Scenario6_NumeralSystemTranslation.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6_NumeralSystemTranslation.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario6_NumeralSystemTranslation : Scenario6_NumeralSystemTranslationT<Scenario6_NumeralSystemTranslation>
00019     {
00020         Scenario6_NumeralSystemTranslation();
00021
00022         void Display_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario6_NumeralSystemTranslation : Scenario6_NumeralSystemTranslationT<Scenario6_NumeralSystemTranslation, implementation::Scenario6_NumeralSystemTranslation>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/GameHud.cpp Source File

  • Simple3DGameXaml
  • cpp

GameHud.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameHud.h"
00014 #include "GameConstants.h"
00015 #include "GameUIConstants.h"
00016
00017 using namespace Microsoft::WRL;
00018 using namespace Windows::UI::Core;
00019 using namespace Windows::ApplicationModel;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Storage;
00022 using namespace Windows::UI::ViewManagement;
00023 using namespace Windows::Graphics::Display;
00024 using namespace D2D1;
00025
00026 //----------------------------------------------------------------------
00027
00028 GameHud::GameHud(
00029     _In_ const std::shared_ptr<DX::DeviceResources>& deviceResources,
00030     _In_ Platform::String^ titleHeader,
00031     _In_ Platform::String^ titleBody,
00032     _In_ Platform::String^ titleLicenseInfo
00033     ) :
00034     m_deviceResources(deviceResources),
00035     m_titleHeader(titleHeader),
00036     m_titleBody(titleBody),
00037     m_titleLicenseInfo(titleLicenseInfo),
00038     m_licenseInfoChanged(true)
00039 {
00040     m_showTitle = true;
00041     m_titleBodyVerticalOffset = GameConstants::Margin;
00042     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00043
00044     auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00045
00046     DX::ThrowIfFailed(
00047         dwriteFactory->CreateTextFormat(
00048             L"Segoe UI",
00049             nullptr,
00050             DWRITE_FONT_WEIGHT_LIGHT,
00051             DWRITE_FONT_STYLE_NORMAL,
00052             DWRITE_FONT_STRETCH_NORMAL,
00053             GameConstants::HudBodyPointSize,
00054             L"en-us",
00055             &m_textFormatBody
00056             )
00057         );
00058     DX::ThrowIfFailed(
00059         dwriteFactory->CreateTextFormat(
00060             L"Segoe UI Symbol",
00061             nullptr,
00062             DWRITE_FONT_WEIGHT_LIGHT,
00063             DWRITE_FONT_STYLE_NORMAL,
00064             DWRITE_FONT_STRETCH_NORMAL,
00065             GameConstants::HudBodyPointSize,
00066             L"en-us",
00067             &m_textFormatBodySymbol
00068             )
00069         );
00070     DX::ThrowIfFailed(
00071         dwriteFactory->CreateTextFormat(
00072             L"Segoe UI Light",
00073             nullptr,
00074             DWRITE_FONT_WEIGHT_LIGHT,
00075             DWRITE_FONT_STYLE_NORMAL,
00076             DWRITE_FONT_STRETCH_NORMAL,
00077             GameConstants::HudTitleHeaderPointSize,
00078             L"en-us",
00079             &m_textFormatTitleHeader
00080             )
00081         );
00082     DX::ThrowIfFailed(
00083         dwriteFactory->CreateTextFormat(
00084             L"Segoe UI Light",
00085             nullptr,
00086             DWRITE_FONT_WEIGHT_LIGHT,
00087             DWRITE_FONT_STYLE_NORMAL,
00088             DWRITE_FONT_STRETCH_NORMAL,
00089             GameConstants::HudTitleBodyPointSize,
00090             L"en-us",
00091             &m_textFormatTitleBody
00092             )
00093         );
00094     DX::ThrowIfFailed(
00095         dwriteFactory->CreateTextFormat(
00096             L"Segoe UI Bold",
00097             nullptr,
00098             DWRITE_FONT_WEIGHT_BOLD,
00099             DWRITE_FONT_STYLE_NORMAL,
00100             DWRITE_FONT_STRETCH_NORMAL,
00101             GameConstants::HudLicensePointSize,
00102             L"en-us",
00103             &m_textFormatTitleLicense
00104             )
00105         );
00106
00107     DX::ThrowIfFailed(m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00108     DX::ThrowIfFailed(m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00109     DX::ThrowIfFailed(m_textFormatBodySymbol->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00110     DX::ThrowIfFailed(m_textFormatBodySymbol->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00111     DX::ThrowIfFailed(m_textFormatTitleHeader->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00112     DX::ThrowIfFailed(m_textFormatTitleHeader->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00113     DX::ThrowIfFailed(m_textFormatTitleBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00114     DX::ThrowIfFailed(m_textFormatTitleBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00115     DX::ThrowIfFailed(m_textFormatTitleLicense->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00116     DX::ThrowIfFailed(m_textFormatTitleLicense->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00117 }
00118
00119 //----------------------------------------------------------------------
00120
00121 void GameHud::CreateDeviceDependentResources()
00122 {
00123     auto location = Package::Current->InstalledLocation;
00124     Platform::String^ path = Platform::String::Concat(location->Path, "\\");
00125     path = Platform::String::Concat(path, "Assets\\windows-sdk.png");
00126
00127     auto wicFactory = m_deviceResources->GetWicImagingFactory();
00128
00129     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00130     DX::ThrowIfFailed(
00131         wicFactory->CreateDecoderFromFilename(
00132             path->Data(),
00133             nullptr,
00134             GENERIC_READ,
00135             WICDecodeMetadataCacheOnDemand,
00136             &wicBitmapDecoder
00137             )
00138         );
00139
00140     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00141     DX::ThrowIfFailed(
00142         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00143         );
00144
00145     ComPtr<IWICFormatConverter> wicFormatConverter;
00146     DX::ThrowIfFailed(
00147         wicFactory->CreateFormatConverter(&wicFormatConverter)
00148         );
00149
00150     DX::ThrowIfFailed(
00151         wicFormatConverter->Initialize(
00152             wicBitmapFrame.Get(),
00153             GUID_WICPixelFormat32bppPBGRA,
00154             WICBitmapDitherTypeNone,
00155             nullptr,
00156             0.0,
00157             WICBitmapPaletteTypeCustom  // The BGRA format has no palette so this value is ignored.
00158             )
00159         );
00160
00161     double dpiX = 96.0f;
00162     double dpiY = 96.0f;
00163     DX::ThrowIfFailed(
00164         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00165         );
00166
00167     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00168
00169     // Create D2D Resources
00170     DX::ThrowIfFailed(
00171         d2dContext->CreateBitmapFromWicBitmap(
00172             wicFormatConverter.Get(),
00173             BitmapProperties(
00174                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00175                 static_cast<float>(dpiX),
00176                 static_cast<float>(dpiY)
00177                 ),
00178             &m_logoBitmap
00179             )
00180         );
00181
00182     m_logoSize = m_logoBitmap->GetSize();
00183
00184     DX::ThrowIfFailed(
00185         d2dContext->CreateSolidColorBrush(
00186             D2D1::ColorF(D2D1::ColorF::White),
00187             &m_textBrush
00188             )
00189         );
00190     DX::ThrowIfFailed(
00191         d2dContext->CreateSolidColorBrush(
00192             D2D1::ColorF(0xaaaaaa, 1.0f),
00193             &m_textBrushGrey
00194             )
00195         );
00196 }
00197
00198 //----------------------------------------------------------------------
00199
00200 void GameHud::CreateWindowSizeDependentResources()
00201 {
00202     auto windowBounds = m_deviceResources->GetLogicalSize();
00203
00204     m_maxTitleSize.width = windowBounds.Width - GameConstants::HudSafeWidth;
00205     m_maxTitleSize.height = windowBounds.Height;
00206
00207     float headerWidth = m_maxTitleSize.width - (m_logoSize.width + 2 * GameConstants::Margin);
00208
00209     if (headerWidth > 0)
00210     {
00211         auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00212
00213         // Only resize the text layout for the Title area when there is enough space.
00214         m_showTitle = true;
00215
00216         DX::ThrowIfFailed(
00217             dwriteFactory->CreateTextLayout(
00218                 m_titleHeader->Data(),
00219                 m_titleHeader->Length(),
00220                 m_textFormatTitleHeader.Get(),
00221                 headerWidth,
00222                 m_maxTitleSize.height,
00223                 &m_titleHeaderLayout
00224                 )
00225             );
00226
00227         DWRITE_TEXT_METRICS metrics = {0};
00228         DX::ThrowIfFailed(
00229             m_titleHeaderLayout->GetMetrics(&metrics)
00230             );
00231
00232         // Compute the vertical size of the laid out Header and logo.  This could change
00233         // based on the window size and the layout of the text.  In some cases the text
00234         // may wrap.
00235         m_titleBodyVerticalOffset = max(m_logoSize.height + GameConstants::Margin * 2, metrics.height + 2 * GameConstants::Margin);
00236
00237         DX::ThrowIfFailed(
00238             dwriteFactory->CreateTextLayout(
00239                 m_titleBody->Data(),
00240                 m_titleBody->Length(),
00241                 m_textFormatTitleBody.Get(),
00242                 m_maxTitleSize.width,
00243                 m_maxTitleSize.height - m_titleBodyVerticalOffset,
00244                 &m_titleBodyLayout
00245                 )
00246             );
00247
00248         DX::ThrowIfFailed(
00249             m_titleBodyLayout->GetMetrics(&metrics)
00250             );
00251
00252         m_titleLicenseVerticalOffset = m_titleBodyVerticalOffset + metrics.height + GameConstants::Margin;
00253
00254         m_licenseInfoChanged = false;
00255         DX::ThrowIfFailed(
00256             dwriteFactory->CreateTextLayout(
00257                 m_titleLicenseInfo->Data(),
00258                 m_titleLicenseInfo->Length(),
00259                 m_textFormatTitleLicense.Get(),
00260                 m_maxTitleSize.width,
00261                 m_maxTitleSize.height - m_titleLicenseVerticalOffset,
00262                 &m_titleLicenseInfoLayout
00263                 )
00264             );
00265     }
00266     else
00267     {
00268         // Not enough horizontal space for the titles so just turn it off.
00269         m_showTitle = false;
00270     }
00271 }
00272
00273 //----------------------------------------------------------------------
00274
00275 void GameHud::SetLicenseInfo(_In_ Platform::String^ licenseInfo)
00276 {
00277     m_titleLicenseInfo = licenseInfo;
00278     m_licenseInfoChanged = true;
00279 }
00280
00281 //----------------------------------------------------------------------
00282
00283 void GameHud::Render(_In_ Simple3DGame^ game)
00284 {
00285     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00286     auto windowBounds = m_deviceResources->GetLogicalSize();
00287
00288     if (m_showTitle)
00289     {
00290         if (m_licenseInfoChanged)
00291         {
00292             DX::ThrowIfFailed(
00293                 m_deviceResources->GetDWriteFactory()->CreateTextLayout(
00294                     m_titleLicenseInfo->Data(),
00295                     m_titleLicenseInfo->Length(),
00296                     m_textFormatTitleLicense.Get(),
00297                     m_maxTitleSize.width,
00298                     m_maxTitleSize.height - m_titleLicenseVerticalOffset,
00299                     &m_titleLicenseInfoLayout
00300                     )
00301                 );
00302             m_licenseInfoChanged = false;
00303         }
00304
00305         d2dContext->DrawBitmap(
00306             m_logoBitmap.Get(),
00307             D2D1::RectF(
00308                 GameConstants::Margin,
00309                 GameConstants::Margin,
00310                 m_logoSize.width + GameConstants::Margin,
00311                 m_logoSize.height + GameConstants::Margin
00312                 )
00313             );
00314         d2dContext->DrawTextLayout(
00315             Point2F(m_logoSize.width + 2.0f * GameConstants::Margin, GameConstants::Margin),
00316             m_titleHeaderLayout.Get(),
00317             m_textBrush.Get()
00318             );
00319         d2dContext->DrawTextLayout(
00320             Point2F(GameConstants::Margin, m_titleBodyVerticalOffset),
00321             m_titleBodyLayout.Get(),
00322             m_textBrush.Get()
00323             );
00324         d2dContext->DrawTextLayout(
00325             Point2F(GameConstants::Margin, m_titleLicenseVerticalOffset),
00326             m_titleLicenseInfoLayout.Get(),
00327             m_textBrush.Get()
00328             );
00329     }
00330
00331     if (game != nullptr)
00332     {
00333         // This section is only used after the game state has been initialized.
00334         static const int bufferLength = 256;
00335         static char16 wsbuffer[bufferLength];
00336         int length = swprintf_s(
00337             wsbuffer,
00338             bufferLength,
00339             L"Hits:\t%10d\nShots:\t%10d\nTime:\t%8.1f",
00340             game->TotalHits(),
00341             game->TotalShots(),
00342             game->TimeRemaining()
00343             );
00344
00345         d2dContext->DrawText(
00346             wsbuffer,
00347             length,
00348             m_textFormatBody.Get(),
00349             D2D1::RectF(
00350                 windowBounds.Width - GameConstants::HudRightOffset,
00351                 GameConstants::HudTopOffset,
00352                 windowBounds.Width,
00353                 GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3
00354                 ),
00355             m_textBrush.Get()
00356             );
00357
00358         // Using the unicode characters starting at 0x2780 ( ➀ ) for the consecutive levels of the game.
00359         // For completed levels start with 0x278A ( ➊ ) (This is 0x2780 + 10).
00360         uint32 levelCharacter[6];
00361         for (uint32 i = 0; i < 6; i++)
00362         {
00363             levelCharacter[i] = 0x2780 + i + ((static_cast<uint32>(game->LevelCompleted()) == i) ? 10 : 0);
00364         }
00365
00366         if (game->IsTrial())
00367         {
00368             length = swprintf_s(
00369                 wsbuffer,
00370                 bufferLength,
00371                 L"%lc %lc",
00372                 levelCharacter[0],
00373                 levelCharacter[1]
00374                 );
00375             d2dContext->DrawText(
00376                 wsbuffer,
00377                 length,
00378                 m_textFormatBodySymbol.Get(),
00379                 D2D1::RectF(
00380                     windowBounds.Width - GameConstants::HudRightOffset,
00381                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3 + GameConstants::Margin,
00382                     windowBounds.Width,
00383                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 4
00384                     ),
00385                 m_textBrush.Get()
00386                 );
00387
00388             length = swprintf_s(
00389                 wsbuffer,
00390                 bufferLength,
00391                 L"%lc %lc %lc %lc",
00392                 levelCharacter[2],
00393                 levelCharacter[3],
00394                 levelCharacter[4],
00395                 levelCharacter[5]
00396                 );
00397
00398             d2dContext->DrawText(
00399                 wsbuffer,
00400                 length,
00401                 m_textFormatBodySymbol.Get(),
00402                 D2D1::RectF(
00403                     windowBounds.Width - GameConstants::HudRightOffset + 52.0f,
00404                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3 + GameConstants::Margin,
00405                     windowBounds.Width,
00406                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize+ GameConstants::Margin) * 4
00407                     ),
00408                 m_textBrushGrey.Get()
00409                 );
00410         }
00411         else
00412         {
00413             length = swprintf_s(
00414                 wsbuffer,
00415                 bufferLength,
00416                 L"%lc %lc %lc %lc %lc %lc",
00417                 levelCharacter[0],
00418                 levelCharacter[1],
00419                 levelCharacter[2],
00420                 levelCharacter[3],
00421                 levelCharacter[4],
00422                 levelCharacter[5]
00423                 );
00424             d2dContext->DrawText(
00425                 wsbuffer,
00426                 length,
00427                 m_textFormatBodySymbol.Get(),
00428                 D2D1::RectF(
00429                     windowBounds.Width - GameConstants::HudRightOffset,
00430                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3 + GameConstants::Margin,
00431                     windowBounds.Width,
00432                     GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize+ GameConstants::Margin) * 4
00433                     ),
00434                 m_textBrush.Get()
00435                 );
00436         }
00437
00438         if (game->IsActivePlay())
00439         {
00440             // Draw a rectangle for the touch input for the move control.
00441             d2dContext->DrawRectangle(
00442                 D2D1::RectF(
00443                     0.0f,
00444                     windowBounds.Height - GameConstants::TouchRectangleSize,
00445                     GameConstants::TouchRectangleSize,
00446                     windowBounds.Height
00447                     ),
00448                 m_textBrush.Get()
00449                 );
00450             // Draw a rectangle for the touch input for the fire control.
00451             d2dContext->DrawRectangle(
00452                 D2D1::RectF(
00453                     windowBounds.Width - GameConstants::TouchRectangleSize,
00454                     windowBounds.Height - GameConstants::TouchRectangleSize,
00455                     windowBounds.Width,
00456                     windowBounds.Height
00457                     ),
00458                 m_textBrush.Get()
00459                 );
00460
00461             // Draw the cross hairs
00462             d2dContext->DrawLine(
00463                 D2D1::Point2F(windowBounds.Width / 2.0f - GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00464                 D2D1::Point2F(windowBounds.Width / 2.0f + GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00465                 m_textBrush.Get(),
00466                 3.0f
00467                 );
00468             d2dContext->DrawLine(
00469                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f - GameConstants::CrossHairHalfSize),
00470                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f + GameConstants::CrossHairHalfSize),
00471                 m_textBrush.Get(),
00472                 3.0f
00473                 );
00474         }
00475     }
00476 }
00477
00478 //----------------------------------------------------------------------
00479
00480 void GameHud::ReleaseDeviceDependentResources()
00481 {
00482     m_textBrush.Reset();
00483     m_textBrushGrey.Reset();
00484     m_logoBitmap.Reset();
00485 }
00486 //----------------------------------------------------------------------
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
Browse_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
CancelTransfer_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
ConvertToNfcMessageAsync(IBuffer content, ProximityDevice device, Func< ProximityDevice, IBuffer, CancellationToken, Task > messageHandlerAsync, CancellationToken ct) | Scenario1 | [inline, private, static]
currentTransferCancelToken | Scenario1 | [private]
GetBytes(NfcProvHeader header) | Scenario1 | [inline, private, static]
GetNfcProvHeaderSize() | Scenario1 | [inline, private, static]
InternalTransferHandlerAsync(CancellationToken ct) | Scenario1 | [inline, private]
INVALID_PUBLISHED_MESSAGE_ID | Scenario1 | [private]
NFC_PROV_MESSAGE_CURRENT_VERSION | Scenario1 | [private]
NFC_PROV_MESSAGE_LEADING_BYTE | Scenario1 | [private]
NFC_PROV_MESSAGE_PROTOCOL_NAME | Scenario1 | [private]
NfcMessageHandlerAsync(ProximityDevice proximityDevice, IBuffer chuckData, CancellationToken ct) | Scenario1 | [inline, private, static]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
provisioningPackageFile | Scenario1 | [private]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
Transfer_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Save Member List

This is the complete list of members for Scenario1_Save, including all inherited members.
rootPage | Scenario1_Save | [private]
SaveCredential_Click(Object sender, RoutedEventArgs args) | Scenario1_Save | [inline, private]
Scenario1_Save() | Scenario1_Save | [inline]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario5_Msappdata.xaml.cs Source File

  • ApplicationData
  • cs

Scenario5_Msappdata.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Media.Imaging;
00013 using Windows.UI.Xaml.Navigation;
00014 using System;
00015 using Windows.Storage;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario5_Msappdata : Page
00020     {
00021         public Scenario5_Msappdata()
00022         {
00023             InitializeComponent();
00024         }
00025
00026         protected override async void OnNavigatedTo(NavigationEventArgs e)
00027         {
00028             ApplicationData appData = ApplicationData.Current;
00029
00030             StorageFile sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataLocal.png"));
00031             try
00032             {
00033                 await sourceFile.CopyAsync(appData.LocalFolder);
00034             }
00035             catch (Exception)
00036             {
00037                 // If the image has already been copied the CopyAsync() method above will fail.
00038                 // Ignore this error.
00039             }
00040
00041             sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataRoaming.png"));
00042             try
00043             {
00044                 await sourceFile.CopyAsync(appData.RoamingFolder);
00045             }
00046             catch (Exception)
00047             {
00048                 // If the image has already been copied the CopyAsync() method above will fail.
00049                 // Ignore this error.
00050             }
00051
00052             sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/appDataTemp.png"));
00053             try
00054             {
00055                 await sourceFile.CopyAsync(appData.TemporaryFolder);
00056             }
00057             catch (Exception)
00058             {
00059                 // If the image has already been copied the CopyAsync() method above will fail.
00060                 // Ignore this error.
00061             }
00062
00063             LocalImage.Source = new BitmapImage(new Uri("ms-appdata:///local/appDataLocal.png"));
00064             RoamingImage.Source = new BitmapImage(new Uri("ms-appdata:///roaming/appDataRoaming.png"));
00065             TempImage.Source = new BitmapImage(new Uri("ms-appdata:///temp/appDataTemp.png"));
00066         }
00067
00068         protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
00069         {
00070             LocalImage.Source = null;
00071             RoamingImage.Source = null;
00072             TempImage.Source = null;
00073         }
00074     }
00075 }
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario1.xaml.h Source File

  • ApplicationResources
  • cpp

scenario1.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.h
00013 // Declaration of the Scenario1 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario1.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario1 sealed
00030         {
00031         public:
00032             Scenario1();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         private:
00037             MainPage^ rootPage;
00038         };
00039 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Calendar/cpp/Scenario3_Enum.xaml.cpp Source File

  • Calendar
  • cpp

Scenario3_Enum.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario3_Enum.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Globalization;
00021 using namespace Windows::Globalization::DateTimeFormatting;
00022
00023 Scenario3_Enum::Scenario3_Enum()
00024 {
00025     InitializeComponent();
00026 }
00027 void Scenario3_Enum::ShowResults_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00028 {
00029     // This scenario uses the Windows.Globalization.Calendar class to enumerate through a calendar and
00030     // perform calendar math
00031     String^ results = "";
00032
00033     results += "The number of years in each era of the Japanese era calendar is not regular. " +
00034         "It is determined by the length of the given imperial era:\n";
00035
00036     // Create Japanese calendar.
00037     Calendar^ calendar = ref new Calendar(ref new Vector<String^>({ "en-US" }), CalendarIdentifiers::Japanese, ClockIdentifiers::TwentyFourHour);
00038
00039     // Enumerate all supported years in all supported Japanese eras.
00040     for (calendar->Era = calendar->FirstEra; true; calendar->AddYears(1))
00041     {
00042         // Process current era.
00043         results += "Era " + calendar->EraAsString() + " contains " + calendar->NumberOfYearsInThisEra + " year(s)\n";
00044
00045
00046         // Enumerate all years in this era.
00047         for (calendar->Year = calendar->FirstYearInThisEra; true; calendar->AddYears(1))
00048         {
00049             // Begin sample processing of current year.
00050
00051             // Move to first day of year. Change of month can affect day so order of assignments is important.
00052             calendar->Month = calendar->FirstMonthInThisYear;
00053             calendar->Day = calendar->FirstDayInThisMonth;
00054
00055             // Set time to midnight (local).
00056             calendar->Period = calendar->FirstPeriodInThisDay;    // All days have 1 or 2 periods depending on clock type
00057             calendar->Hour = calendar->FirstHourInThisPeriod;     // Hours start from 12 or 0 depending on clock type
00058             calendar->Minute = 0;
00059             calendar->Second = 0;
00060             calendar->Nanosecond = 0;
00061
00062             if (calendar->Year % 1000 == 0)
00063             {
00064                 results += "\n";
00065             }
00066             else if (calendar->Year % 10 == 0)
00067             {
00068                 results += ".";
00069             }
00070
00071             // End sample processing of current year.
00072
00073             // Break after processing last year.
00074             if (calendar->Year == calendar->LastYearInThisEra)
00075             {
00076                 break;
00077             }
00078         }
00079         results += "\n";
00080
00081         // Break after processing last era.
00082         if (calendar->Era == calendar->LastEra)
00083         {
00084             break;
00085         }
00086     }
00087     results += "\n";
00088
00089     // This section shows enumeration through the hours in a day to demonstrate that the number of time units in a given period (hours in a day, minutes in an hour, etc.)
00090     // should not be regarded as fixed. With Daylight Saving Time and other local calendar adjustments, a given day may have not have 24 hours, and
00091     // a given hour may not have 60 minutes, etc.
00092     results += "The number of hours in a day is not constant. " +
00093         "The US calendar transitions from daylight saving time to standard time on 4 November 2012:\n\n";
00094
00095     // Create a DateTimeFormatter to display dates
00096     DateTimeFormatter^ displayDate = ref new DateTimeFormatter("longdate");
00097
00098     // Create a Gregorian calendar for the US with 12-hour clock format
00099     Calendar^ currentCal = ref new Calendar(ref new Vector<String^>({ "en-US" }), CalendarIdentifiers::Gregorian, ClockIdentifiers::TwentyFourHour, "America/Los_Angeles");
00100
00101     // Set the calendar to a the date of the Daylight Saving Time-to-Standard Time transition for the US in 2012.
00102     // An easier way to set the calendar date and time is to set the currentCal->Year, Month, etc. properties.
00103     // However, we calculate it the complicated way to demonstrate interoperability between Calendar and Windows::Foundation::DateTime.
00104     // DST ends in the America/Los_Angeles time zone at 4 November 2012 02:00 PDT = 4 November 2012 09:00 UTC.
00105     SYSTEMTIME dstSystemTime;
00106     dstSystemTime.wYear = 2012;
00107     dstSystemTime.wMonth = 11;
00108     dstSystemTime.wDay = 4;
00109     dstSystemTime.wHour = 9;
00110     dstSystemTime.wMinute = 0;
00111     dstSystemTime.wSecond = 0;
00112     dstSystemTime.wMilliseconds = 0;
00113     FILETIME dstFileTime;
00114     SystemTimeToFileTime(&dstSystemTime, &dstFileTime);
00115     DateTime dstDate;
00116     dstDate.UniversalTime = (static_cast<UINT64>(dstFileTime.dwHighDateTime) << 32) + dstFileTime.dwLowDateTime;
00117     currentCal->SetDateTime(dstDate);
00118
00119     // Set the current calendar to one day before DST change. Create a second calendar for comparision and set it to one day after DST change.
00120     Calendar^ endDate = currentCal->Clone();
00121     currentCal->AddDays(-1);
00122     endDate->AddDays(1);
00123
00124     // Enumerate the day before, the day of, and the day after the 2012 DST-to-Standard time transition
00125     while (currentCal->Day <= endDate->Day)
00126     {
00127         // Process current day.
00128         DateTime date = currentCal->GetDateTime();
00129         results += displayDate->Format(date) + " contains " + currentCal->NumberOfHoursInThisPeriod.ToString() + " hour(s)\n";
00130
00131         // Enumerate all hours in this day.
00132         // Create a calendar to represent the following day.
00133         Calendar^ nextDay = currentCal->Clone();
00134         nextDay->AddDays(1);
00135         for (currentCal->Hour = currentCal->FirstHourInThisPeriod; true; currentCal->AddHours(1))
00136         {
00137             // Display the hour for each hour in the day.
00138             results += currentCal->HourAsPaddedString(2) + " ";
00139
00140             // Break upon reaching the next period (i.e. the first period in the following day).
00141             if (currentCal->Day == nextDay->Day && currentCal->Period == nextDay->Period)
00142             {
00143                 break;
00144             }
00145         }
00146         results += "\n";
00147     }
00148
00149     // Display results
00150     OutputTextBlock->Text = results;
00151 }
Generated on Fri Nov 15 2024 22:18:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PresentationFormats Member List

This is the complete list of members for PresentationFormats, including all inherited members.
Description | PresentationFormats
Exponent | PresentationFormats
NamespaceId enum name | PresentationFormats
Units enum name | PresentationFormats
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Project.idl Source File

  • NetworkConnectivity
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_NetworkConnectivity : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_NetworkConnectivity();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_NetworkCost : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_NetworkCost();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_NetworkConnectivityChanges : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_NetworkConnectivityChanges();
00030     }
00031 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_CompositeSettings Member List

This is the complete list of members for Scenario4_CompositeSettings, including all inherited members.
DeleteCompositeSetting_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_CompositeSettings |
DisplayOutput() | Scenario4_CompositeSettings | [private]
localSettings | Scenario4_CompositeSettings | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_CompositeSettings |
Scenario4_CompositeSettings() | Scenario4_CompositeSettings |
settingName | Scenario4_CompositeSettings | [inline, private, static]
settingName1 | Scenario4_CompositeSettings | [inline, private, static]
settingName2 | Scenario4_CompositeSettings | [inline, private, static]
WriteCompositeSetting_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_CompositeSettings |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/pch.h Source File

  • CustomCapability
  • Service
  • Client

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012
00013 #include "targetver.h"
00014
00015 #ifndef WIN32_LEAN_AND_MEAN
00016 #define WIN32_LEAN_AND_MEAN
00017 #endif
00018
00019 #include <windows.h>
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cs/xBindSampleModel/Model.cs Source File

  • XamlBind
  • cs
  • xBindSampleModel

Model.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Linq;
00005 using System.Runtime.CompilerServices;
00006 using Windows.UI;
00007 using Windows.UI.Xaml;
00008
00009 namespace xBindSampleModel
00010 {
00011     public sealed class DataModel : DependencyObject, INotifyPropertyChanged
00012     {
00013         public DataModel()
00014         {
00015             InitializeValues();
00016         }
00017
00018         public string StringPropNoINPC { get; set; }
00019         public string StringPropAsInteger { get; set; }
00020         public int IntPropNoINPC { get; set; }
00021         public IEmployee EmployeePropNoINPC { get; set; }
00022
00023         private string _StringPropWithINPC;
00024         public string StringPropWithINPC
00025         {
00026             get { return _StringPropWithINPC; }
00027             set
00028             {
00029                 if (value != _StringPropWithINPC)
00030                 {
00031                     _StringPropWithINPC = value;
00032                     NotifyPropertyChanged();
00033                 }
00034             }
00035         }
00036
00037         private int _IntPropWithINPC;
00038         public int IntPropWithINPC
00039         {
00040             get { return _IntPropWithINPC; }
00041             set
00042             {
00043                 if (value != _IntPropWithINPC)
00044                 {
00045                     _IntPropWithINPC = value;
00046                     NotifyPropertyChanged();
00047                 }
00048             }
00049         }
00050
00051         private Color _ColorPropWithINPC;
00052         public Color ColorPropWithINPC
00053         {
00054             get { return _ColorPropWithINPC; }
00055             set
00056             {
00057                 if (value != _ColorPropWithINPC)
00058                 {
00059                     _ColorPropWithINPC = value;
00060                     NotifyPropertyChanged();
00061                 }
00062             }
00063         }
00064
00065         private IEmployee _EmployeePropWithINPC;
00066         public IEmployee EmployeePropWithINPC
00067         {
00068             get { return _EmployeePropWithINPC; }
00069             set
00070             {
00071                 if (value != _EmployeePropWithINPC)
00072                 {
00073                     _EmployeePropWithINPC = value;
00074                     NotifyPropertyChanged();
00075                 }
00076             }
00077         }
00078
00079         private EmployeeCollection _Employees;
00080         public EmployeeCollection Employees
00081         {
00082             get { return _Employees; }
00083             set
00084             {
00085                 if (value != _Employees)
00086                 {
00087                     _Employees = value;
00088                     NotifyPropertyChanged();
00089                 }
00090             }
00091         }
00092
00093         private Manager _ManagerProp;
00094         public Manager ManagerProp
00095         {
00096             get { return _ManagerProp; }
00097             set
00098             {
00099                 if (value != _ManagerProp)
00100                 {
00101                     _ManagerProp = value;
00102                     NotifyPropertyChanged();
00103                 }
00104             }
00105         }
00106
00107         private bool _BoolPropWithINPC;
00108         public bool BoolPropWithINPC
00109         {
00110             get { return _BoolPropWithINPC; }
00111             set
00112             {
00113                 if (value != _BoolPropWithINPC)
00114                 {
00115                     _BoolPropWithINPC = value;
00116                     NotifyPropertyChanged();
00117                 }
00118             }
00119         }
00120
00121         public int IntPropertyDP
00122         {
00123             get { return (int)GetValue(IntPropertyDPProperty); }
00124             set { SetValue(IntPropertyDPProperty, value); }
00125         }
00126         #region IntPropertyDP DP
00127         private const string IntPropertyDPName = "IntPropertyDP";
00128         private static readonly DependencyProperty _IntPropertyDPProperty =
00129             DependencyProperty.Register(IntPropertyDPName, typeof(int), typeof(DataModel), new PropertyMetadata(0));
00130         public static DependencyProperty IntPropertyDPProperty { get { return _IntPropertyDPProperty; } }
00131         #endregion
00132
00133         public string StringPropertyDP
00134         {
00135             get { return (string)GetValue(StringPropertyDPProperty); }
00136             set { SetValue(StringPropertyDPProperty, value); }
00137         }
00138         #region StringPropertyDP DP
00139         private const string StringPropertyDPName = "StringPropertyDP";
00140         private static readonly DependencyProperty _StringPropertyDPProperty =
00141             DependencyProperty.Register(StringPropertyDPName, typeof(string), typeof(DataModel), new PropertyMetadata(""));
00142         public static DependencyProperty StringPropertyDPProperty { get { return _StringPropertyDPProperty; } }
00143         #endregion
00144
00145         public IEmployee EmployeePropertyDP
00146         {
00147             get { return (IEmployee)GetValue(EmployeePropertyDPProperty); }
00148             set { SetValue(EmployeePropertyDPProperty, value); }
00149         }
00150         #region EmployeePropertyDP DP
00151         private const string EmployeePropertyDPName = "EmployeePropertyDP";
00152         private static readonly DependencyProperty _EmployeePropertyDPProperty =
00153             DependencyProperty.Register(EmployeePropertyDPName, typeof(IEmployee), typeof(DataModel), new PropertyMetadata(0));
00154         public static DependencyProperty EmployeePropertyDPProperty { get { return _EmployeePropertyDPProperty; } }
00155
00156         #endregion
00157
00158
00159         public void InitializeValues()
00160         {
00161             ManagerProp = CreateManagerEmployeeTree();
00162             Employees = ManagerProp.ReportsOC;
00163
00164             StringPropNoINPC = "String Property without INPC";
00165             StringPropWithINPC = "String Property with INPC";
00166             ColorPropWithINPC = Colors.Red;
00167             IntPropNoINPC = 42;
00168             IntPropWithINPC = 2;
00169             IntPropertyDP = 42;
00170             StringPropertyDP = "String Property as a DP";
00171             StringPropAsInteger = "65";
00172             EmployeePropNoINPC = Employees[0];
00173             EmployeePropWithINPC = Employees[1];
00174
00175         }
00176         public void UpdateValues()
00177         {
00178             this.BoolPropWithINPC = !this.BoolPropWithINPC;
00179             this.IntPropNoINPC = IntPropNoINPC + 10 % 100;
00180             this.IntPropWithINPC = IntPropWithINPC + 1 % 10;
00181             this.IntPropertyDP = IntPropertyDP + 10 % 100;
00182
00183             string name = ", " + lnames[(new Random()).Next(lnames.Length)];
00184             this.StringPropNoINPC += name;
00185             this.StringPropWithINPC += name;
00186             this.StringPropertyDP += name;
00187
00188             EmployeePropWithINPC = Employees[IntPropWithINPC % Employees.Count];
00189             EmployeePropertyDP = Employees[(IntPropWithINPC + 1) % Employees.Count];
00190             // Swap Manager Reports [0], [2]
00191             var temp = ManagerProp.ReportsOC[0];
00192             ManagerProp.ReportsOC[0] = ManagerProp.ReportsOC[2];
00193             ManagerProp.ReportsOC[2] = temp;
00194         }
00195
00196
00197         #region Employee Tree Creation
00198         private static string[] fnames = { "Alice", "Brian", "Chris", "David", "Emily", "Freda", "Garry", "Harriet", "Isobel", "John", "Keith", "Lisa", "Mark", "Nathan", "Olivia", "Penelope", "Quentin", "Robert", "Simon", "Tom", "Veronica", "Will", "Xavier", "Yvette", "Zach" };
00199         private static string[] lnames = { "Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller", "Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White", "Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson", "Clark", "Rodriguez", "Lewis", "Lee", "Walker" };
00200
00201         public static Manager CreateManagerEmployeeTree()
00202         {
00203             Random rnd = new Random(4524); // Passing in a seed guarantees the same values each time
00204             Manager CEO = new Manager() { FirstName = fnames[rnd.Next(fnames.Length)], LastName = lnames[rnd.Next(lnames.Length)] };
00205             CreateReports(5, CEO, rnd);
00206             return CEO;
00207         }
00208
00209         private static void CreateReports(int depth, Manager m, Random rnd)
00210         {
00211             int count = rnd.Next(10) + 3;
00212             for (int i = 0; i < count; i++)
00213             {
00214                 int j = rnd.Next(10);
00215                 IEmployee e = (j > 2 && depth > 1) ? (IEmployee)new Manager() : (IEmployee)new Employee();
00216                 e.LastName = lnames[rnd.Next(lnames.Length)];
00217                 e.FirstName = fnames[rnd.Next(fnames.Length)];
00218                 e.DirectManager = m;
00219                 m.ReportsList.Add(e);
00220                 m.ReportsDict.Add(e.FirstName + i, e);
00221                 if (e.IsManager) CreateReports(depth - 1, (Manager)e, rnd);
00222             }
00223         }
00224
00225         #endregion
00226         #region INPC
00227
00228         public event PropertyChangedEventHandler PropertyChanged;
00229
00230         private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
00231         {
00232             if (PropertyChanged != null)
00233             {
00234                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
00235             }
00236         }
00237         #endregion
00238
00239     }
00240
00241 }
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/App.xaml.cs Source File

  • BackgroundMediaPlayback
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.ApplicationModel;
00014 using Windows.ApplicationModel.Activation;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00020
00021 // Most samples use a standard App.xaml.cs but this one demonstrates
00022 // additional features for One Process background applications
00023 // and is therefore unique to this project.
00024
00025 namespace SDKTemplate
00026 {
00027     /// <summary>
00028     /// Provides application-specific behavior to supplement the default Application class.
00029     /// </summary>
00030     sealed partial class App : Application
00031     {
00032         /// <summary>
00033         /// Initializes the singleton application object.  This is the first line of authored code
00034         /// executed, and as such is the logical equivalent of main() or WinMain().
00035         /// </summary>
00036         public App()
00037         {
00038             this.InitializeComponent();
00039             this.Construct();
00040         }
00041
00042         /// <summary>
00043         /// Invoked when the application is launched normally by the end user.  Other entry points
00044         /// will be used such as when the application is launched to open a specific file.
00045         /// </summary>
00046         /// <param name="e">Details about the launch request and process.</param>
00047         protected override void OnLaunched(LaunchActivatedEventArgs e)
00048         {
00049
00050 #if DEBUG
00051             if (System.Diagnostics.Debugger.IsAttached)
00052             {
00053                 this.DebugSettings.EnableFrameRateCounter = false;
00054             }
00055 #endif
00056
00057             CreateRootFrame(e.PreviousExecutionState, e.Arguments);
00058
00059             // Ensure the current window is active
00060             Window.Current.Activate();
00061         }
00062
00063         /// <summary>
00064         /// Creates the frame containing the view
00065         /// </summary>
00066         /// <remarks>
00067         /// This is the same code that was in OnLaunched() initially.
00068         /// It is moved to a separate method so the view can be restored
00069         /// when leaving the background if it was unloaded when the app
00070         /// entered the background.
00071         /// </remarks>
00072         void CreateRootFrame(ApplicationExecutionState previousExecutionState, string arguments)
00073         {
00074             Frame rootFrame = Window.Current.Content as Frame;
00075
00076             // Do not repeat app initialization when the Window already has content,
00077             // just ensure that the window is active
00078             if (rootFrame == null)
00079             {
00080                 System.Diagnostics.Debug.WriteLine("CreateFrame: Initializing root frame ...");
00081
00082                 // Create a Frame to act as the navigation context and navigate to the first page
00083                 rootFrame = new Frame();
00084
00085                 // Set the default language
00086                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00087
00088                 rootFrame.NavigationFailed += OnNavigationFailed;
00089
00090                 if (previousExecutionState == ApplicationExecutionState.Terminated)
00091                 {
00092                     //TODO: Load state from previously suspended application
00093                 }
00094
00095                 // Place the frame in the current Window
00096                 Window.Current.Content = rootFrame;
00097             }
00098
00099             if (rootFrame.Content == null)
00100             {
00101                 // When the navigation stack isn't restored navigate to the first page,
00102                 // configuring the new page by passing required information as a navigation
00103                 // parameter
00104                 rootFrame.Navigate(typeof(MainPage), arguments);
00105             }
00106         }
00107
00108         /// <summary>
00109         /// Invoked when Navigation to a certain page fails
00110         /// </summary>
00111         /// <param name="sender">The Frame which failed navigation</param>
00112         /// <param name="e">Details about the navigation failure</param>
00113         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00114         {
00115             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00116         }
00117
00118         // Add any application contructor code in here.
00119         partial void Construct();
00120     }
00121 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
ButtonUnpinEverything_Click(object sender, RoutedEventArgs e) | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Gyrometer/cs/Scenario3_Porting.xaml.cs Source File

  • Gyrometer
  • cs

Scenario3_Porting.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml;
00002 using Windows.UI.Xaml.Controls;
00003 using Windows.UI.Xaml.Navigation;
00004 using SDKTemplate;
00005 using System;
00006 using Windows.Devices.Sensors;
00007 using Windows.Foundation;
00008 using System.Threading.Tasks;
00009 using Windows.UI.Core;
00010
00011 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556
00012
00013 namespace GyrometerCS
00014 {
00015     /// <summary>
00016     /// An empty page that can be used on its own or navigated to within a Frame.
00017     /// </summary>
00018     public sealed partial class Scenario3_Porting : Page
00019     {
00020         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00021         // as NotifyUser()
00022         MainPage rootPage = MainPage.Current;
00023         Gyrometer gyrometerWP;
00024         Gyrometer gyrometerWindows;
00025
00026         public Scenario3_Porting()
00027         {
00028             this.InitializeComponent();
00029
00030             // Get two instances of the gyrometer:
00031             // One that returns the raw gyrometer data
00032             gyrometerWindows = Gyrometer.GetDefault();
00033             // Other on which the 'ReadingTransform' is updated so that data returned aligns with the native WP orientation (portrait)
00034             gyrometerWP = Gyrometer.GetDefault();
00035
00036             if (gyrometerWP == null || gyrometerWindows == null)
00037             {
00038                 rootPage.NotifyUser("No gyrometer found", NotifyType.ErrorMessage);
00039             }
00040             else
00041             {
00042                 // Assumption is that this app has been developed for Windows Phone 8.1 (or earlier)
00043                 // and hence assumes that the sensor returns readings in Portrait Mode, which may
00044                 // not be true when the app or sensor logic is being ported over to a
00045                 // Landscape-First Windows device
00046                 // While we encourage you to re-design your app as a universal app to gain access
00047                 // to many other advantages of developing a universal app, this scenario demonstrates
00048                 // a simple approach to let the runtime honor your assumption on the
00049                 // "native orientation" of the sensor.
00050                 gyrometerWP.ReadingTransform = Windows.Graphics.Display.DisplayOrientations.Portrait;
00051                 // If you were to go the route of universal app, make no assumptions about the
00052                 // native orientation of the device. Instead rely on using a display orientation
00053                 // (absolute or current) to enforce the reference frame for the sensor readings.
00054                 // (which is done by updating 'ReadingTransform' property with the appropriate orientation)
00055             }
00056         }
00057
00058         /// <summary>
00059         /// Invoked when this page is about to be displayed in a Frame.
00060         /// </summary>
00061         /// <param name="e">Event data that describes how this page was reached.
00062         /// This parameter is typically used to configure the page.</param>
00063         protected override void OnNavigatedTo(NavigationEventArgs e)
00064         {
00065             if (gyrometerWP ==null || gyrometerWindows == null)
00066             {
00067                 GetSampleButton.IsEnabled = false;
00068             }
00069             else
00070             {
00071                 GetSampleButton.IsEnabled = true;
00072             }
00073         }
00074
00075
00076         /// <summary>
00077         /// Invoked when 'Get Sample' button is pressed.
00078         /// </summary>
00079         /// <param name="sender"></param>
00080         /// <param name="e"></param>
00081         void GetGyrometerSample(object sender, RoutedEventArgs e)
00082         {
00083             GyrometerReading wpReading;
00084             GyrometerReading windowsReading;
00085             GetSampleButton.IsEnabled = false;
00086
00087             // Establish the report interval
00088             gyrometerWP.ReportInterval = gyrometerWindows.MinimumReportInterval;
00089             gyrometerWindows.ReportInterval = gyrometerWindows.MinimumReportInterval;
00090
00091             wpReading = gyrometerWP.GetCurrentReading();
00092             windowsReading = gyrometerWindows.GetCurrentReading();
00093
00094             if (null != wpReading)
00095             {
00096                 ScenarioOutput_X_WP.Text = wpReading.AngularVelocityX.ToString();
00097                 ScenarioOutput_Y_WP.Text = wpReading.AngularVelocityY.ToString();
00098                 ScenarioOutput_Z_WP.Text = wpReading.AngularVelocityZ.ToString();
00099             }
00100
00101             if (null != windowsReading)
00102             {
00103                 ScenarioOutput_X_Windows.Text = windowsReading.AngularVelocityX.ToString();
00104                 ScenarioOutput_Y_Windows.Text = windowsReading.AngularVelocityY.ToString();
00105                 ScenarioOutput_Z_Windows.Text = windowsReading.AngularVelocityZ.ToString();
00106             }
00107
00108             gyrometerWP.ReportInterval = 0;
00109             gyrometerWindows.ReportInterval = 0;
00110
00111             GetSampleButton.IsEnabled = true;
00112         }
00113     }
00114 }
Generated on Fri Nov 15 2024 22:19:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UssdProtcol/cs/RequestResponse.xaml.cs Source File

  • UssdProtcol
  • cs

RequestResponse.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using SDKTemplate;
00016 using System;
00017 using System.Collections.Generic;
00018 using Windows.Networking.NetworkOperators;
00019
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace UssdApi
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class RequestResponse : Page
00029     {
00030         private MainPage rootPage;
00031
00032         public RequestResponse()
00033         {
00034             this.InitializeComponent();
00035         }
00036
00037         protected override void OnNavigatedTo(NavigationEventArgs e)
00038         {
00039             rootPage = MainPage.Current;
00040         }
00041
00042         private async void SendButton_Click(object sender, RoutedEventArgs e)
00043         {
00044             // Get the USSD message text.
00045             if (MessageText.Text == "")
00046             {
00047                 rootPage.NotifyUser("Message cannot be empty", NotifyType.ErrorMessage);
00048                 return;
00049             }
00050
00051             try
00052             {
00053                 // Get the network account ID.
00054                 IReadOnlyList<string> networkAccIds = Windows.Networking.NetworkOperators.MobileBroadbandAccount.AvailableNetworkAccountIds;
00055
00056                 if (networkAccIds.Count == 0)
00057                 {
00058                     rootPage.NotifyUser("No network account ID found", NotifyType.ErrorMessage);
00059                     return;
00060                 }
00061                 // For the sake of simplicity, assume we want to use the first account.
00062                 // Refer to the MobileBroadbandAccount API's for how to select a specific account ID.
00063                 string networkAccountId = networkAccIds[0];
00064
00065                 SendButton.IsEnabled = false;
00066                 rootPage.NotifyUser("Sending USSD request", NotifyType.StatusMessage);
00067
00068                 // Create a USSD session for the specified network acccount ID.
00069                 UssdSession session = UssdSession.CreateFromNetworkAccountId(networkAccountId);
00070
00071                 // Send a message to the network and wait for the reply. This message is
00072                 // specific to the network operator and must be selected accordingly.
00073                 UssdReply reply = await session.SendMessageAndGetReplyAsync(new UssdMessage(MessageText.Text));
00074
00075                 // Display the network reply. The reply always contains a ResultCode.
00076                 UssdResultCode code = reply.ResultCode;
00077                 if (code == UssdResultCode.ActionRequired || code == UssdResultCode.NoActionRequired)
00078                 {
00079                     // If the actionRequired or noActionRequired ResultCode is returned, the reply contains
00080                     // a message from the network.
00081                     UssdMessage replyMessage = reply.Message;
00082                     string payloadAsText = replyMessage.PayloadAsText;
00083                     if (payloadAsText != "")
00084                     {
00085                         // The message may be sent using various encodings. If Windows supports
00086                         // the encoding, the message can be accessed as text and will not be empty.
00087                         // Therefore, the test for an empty string is sufficient.
00088                         rootPage.NotifyUser("Response: " + payloadAsText, NotifyType.StatusMessage);
00089                     }
00090                     else
00091                     {
00092                         // If Windows does not support the encoding, the application may check
00093                         // the DataCodingScheme used for encoding and access the raw message
00094                         // through replyMessage.GetPayload
00095                         rootPage.NotifyUser("Unsupported data coding scheme 0x" + replyMessage.DataCodingScheme.ToString("X"),
00096                             NotifyType.StatusMessage);
00097                     }
00098                 }
00099                 else
00100                 {
00101                     rootPage.NotifyUser("Request failed: " + code.ToString(), NotifyType.StatusMessage);
00102                 }
00103                 if (code == UssdResultCode.ActionRequired)
00104                 {
00105                     session.Close(); // Close the session from our end
00106                 }
00107             }
00108             catch (Exception ex)
00109             {
00110                 rootPage.NotifyUser("Unexpected exception occured: " + ex.ToString(), NotifyType.ErrorMessage);
00111             }
00112             SendButton.IsEnabled = true;
00113         }
00114     }
00115 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Directions Member List

This is the complete list of members for Scenario1_Directions, including all inherited members.
Scenario1_Directions() Scenario1_Directions [inline]
Generated on Fri Nov 15 2024 22:23:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/PlaybackPage.xaml.h Source File

  • 360VideoPlayback
  • cpp

PlaybackPage.xaml.h

Go to the documentation of this file.
00001 ﻿//
00002 // PlaybackPage.xaml.h
00003 // Declaration of the PlaybackPage class
00004 //
00005
00006 #pragma once
00007
00008 #include "PlaybackPage.g.h"
00009 #include "Common\StepTimer.h"
00010
00011 namespace _360VideoPlayback
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public ref class PlaybackPage sealed
00017     {
00018     public:
00019         PlaybackPage();
00020
00021     protected:
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00024
00025     private:
00026
00027         Windows::Media::Playback::MediaPlayer^ m_player;
00028         // positions hold the center of the window
00029         double m_centerX = 0, m_centerY = 0;
00030         // MTC grid to ignore mouse event on the MTC Panel
00031         Windows::UI::Xaml::Controls::Grid^ m_mtcGrid;
00032         double m_pitch;
00033         double m_heading;
00034         // Framebased timer.
00035         DX::StepTimer m_timer;
00036
00037         Windows::Media::Playback::MediaPlaybackSphericalVideoProjection^ videoProjection;
00038         bool m_isPointerPress = false;
00039         Windows::Foundation::IAsyncAction^ m_inputLoopWorker;
00040         Windows::Gaming::Input::Gamepad^ m_activeGamePad;
00041         double m_rotationdelta;
00042         Windows::Foundation::EventRegistrationToken OnLayoutUpdatedToken;
00043         void OnLayoutUpdated(Platform::Object^ sender, Platform::Object^ args);
00044         bool IsMediaAlreadyOpened();
00045         void ResetState();
00046         void StartInputLoop();
00047
00048         void OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00049         Windows::Foundation::EventRegistrationToken OnPointerPressedToken;
00050         Windows::Foundation::EventRegistrationToken OnMTCPointerPressedToken;
00051         void OnPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00052         Windows::Foundation::EventRegistrationToken OnPointerReleasedToken;
00053         Windows::Foundation::EventRegistrationToken OnMTCPointerReleasedToken;
00054         void OnPointerWheelChanged(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00055         Windows::Foundation::EventRegistrationToken OnPointerWheelChangedToken;
00056         Windows::Foundation::EventRegistrationToken OnMTCPointerWheelChangedToken;
00057         void OnPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00058         Windows::Foundation::EventRegistrationToken OnPointerMovedToken;
00059         Windows::Foundation::EventRegistrationToken OnMTCPointerMovedToken;
00060         void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
00061         Windows::Foundation::EventRegistrationToken OnKeyDownToken;
00062         void OnMediaOpened(Windows::Media::Playback::MediaPlayer^ sender, Platform::Object^ args);
00063         Windows::Foundation::EventRegistrationToken OnMediaOpenedToken;
00064         void OnPlaybackStateChanged(Windows::Media::Playback::MediaPlaybackSession^ sender, Platform::Object^ args);
00065         Windows::Foundation::EventRegistrationToken OnPlaybackStateChangedToken;
00066     };
00067 }
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Remove Member List

This is the complete list of members for Scenario2_Remove, including all inherited members.
RemoveJumpList_Click(object sender, RoutedEventArgs e) | Scenario2_Remove | [inline, private]
Scenario2_Remove() | Scenario2_Remove | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CameraResources Member List

This is the complete list of members for CameraResources, including all inherited members.
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > &deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
AttachViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(winrt::Windows::Graphics::Holographic::HolographicCamera const &holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CameraResources(Windows::Graphics::Holographic::HolographicCamera^holographicCamera) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, winrt::Windows::Graphics::Holographic::HolographicCameraRenderingParameters const &cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
CreateResourcesForBackBuffer(DX::DeviceResources *pDeviceResources, Windows::Graphics::Holographic::HolographicCameraRenderingParameters^cameraParameters) | CameraResources |
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferDXGIFormat() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferRenderTargetView() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBackBufferTexture2D() const | CameraResources | [inline]
GetBlendState() const | CameraResources | [inline]
GetBlendState() const | CameraResources | [inline]
GetDepthBufferTexture2D() const | CameraResources | [inline]
GetDepthStencilTexture2D() const | CameraResources | [inline]
GetDepthStencilTexture2D() const | CameraResources | [inline]
GetDepthStencilTexture2D() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetDepthStencilView() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetHolographicCamera() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const & | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetRenderTargetSize() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
GetViewport() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
IsRenderingStereoscopic() const | CameraResources | [inline]
m_blendState | CameraResources | [private]
m_d3dBackBuffer | CameraResources | [private]
m_d3dDepthBuffer | CameraResources | [private]
m_d3dDepthStencil | CameraResources | [private]
m_d3dDepthStencilView | CameraResources | [private]
m_d3dRenderTargetSize | CameraResources | [private]
m_d3dRenderTargetSize | CameraResources | [private]
m_d3dRenderTargetView | CameraResources | [private]
m_d3dViewport | CameraResources | [private]
m_dxgiFormat | CameraResources | [private]
m_framePending | CameraResources | [private]
m_holographicCamera | CameraResources | [private]
m_holographicCamera | CameraResources | [private]
m_isStereo | CameraResources | [private]
m_viewProjectionConstantBuffer | CameraResources | [private]
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
ReleaseResourcesForBackBuffer(DX::DeviceResources *pDeviceResources) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, winrt::Windows::Graphics::Holographic::HolographicCameraPose const &cameraPose, winrt::Windows::Perception::Spatial::SpatialCoordinateSystem const &coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
UpdateViewProjectionBuffer(std::shared_ptr< DX::DeviceResources > deviceResources, Windows::Graphics::Holographic::HolographicCameraPose^cameraPose, Windows::Perception::Spatial::SpatialCoordinateSystem^coordinateSystem) | CameraResources |
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: VersionAdaptiveCode/cs/Scenario3_ChooseControl.xaml.cs Source File

  • VersionAdaptiveCode
  • cs

Scenario3_ChooseControl.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation.Metadata;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     /// <summary>
00019     /// This scenario shows how to choose a user control based on whether a class is present.
00020     /// You can create two implementations of a user control, one that relies on a new feature,
00021     /// and one that does not, and choose the control to use at runtime.
00022     /// </summary>
00023     public sealed partial class Scenario3_ChooseControl : Page
00024     {
00025         public Scenario3_ChooseControl()
00026         {
00027             this.InitializeComponent();
00028
00029             UserControl mediaControl;
00030
00031             // If the MediaPlayerElement class is available, then create a user control that uses it.
00032             // Otherwise, create a user control that uses the older MediaElement control.
00033             if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Controls.MediaPlayerElement"))
00034             {
00035                 mediaControl = new MPEUserControl();
00036             }
00037             else
00038             {
00039                 mediaControl = new MEUserControl();
00040             }
00041
00042             // Insert the control into our page.
00043             MediaPlayerPlacement.Children.Add(mediaControl);
00044         }
00045
00046     }
00047 }
Generated on Fri Nov 15 2024 22:21:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_LongAndShortFormats Member List

This is the complete list of members for Scenario1_LongAndShortFormats, including all inherited members.
Display_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_LongAndShortFormats
Scenario1_LongAndShortFormats() | Scenario1_LongAndShortFormats
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/Scenario2_CustomException.xaml.cs Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cs

Scenario2_CustomException.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Microsoft.SDKSamples.Kitchen;
00008
00009 using Windows.UI.Xaml;
00010 using Windows.UI.Xaml.Controls;
00011 using Windows.UI.Xaml.Navigation;
00012 using SDKTemplate;
00013 using System;
00014
00015 namespace ProxyStubsForWinRTComponents
00016 {
00017     public sealed partial class CustomException : Page
00018     {
00019         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00020         // as NotifyUser()
00021         MainPage rootPage = MainPage.Current;
00022
00023         public CustomException()
00024         {
00025             this.InitializeComponent();
00026         }
00027
00028         /// <summary>
00029         /// Invoked when this page is about to be displayed in a Frame.
00030         /// </summary>
00031         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00032         /// property is typically used to configure the page.</param>
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035         }
00036
00037         /// <summary>
00038         /// Handle a Windows Runtime error originated by the Oven Windows Runtime component.
00039         /// </summary>
00040         /// <param name="sender">Contains information about the button that fired the event.</param>
00041         /// <param name="e">Contains state information and event data associated with a routed event.</param>
00042         private void Start_Click(object sender, RoutedEventArgs e)
00043         {
00044             Oven myOven = new Oven();
00045
00046             try
00047             {
00048                 // Intentionally pass a bad parameter
00049                 myOven.ConfigurePreheatTemperature((OvenTemperature)5);
00050             }
00051             catch (System.ArgumentException)
00052             {
00053                 CustomExceptionOutput.Text += "Exception caught. Please attach a debugger and enable first chance native exceptions to view exception details.\n";
00054             }
00055         }
00056     }
00057 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameMain.h Source File

  • Simple3DGameDX
  • cppwinrt

GameMain.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // GameMain:
00013 // This class is the main class required for Windows Runtime apps.
00014 // It it called on Launch activation and maintains the overall state of the game.
00015 // The GameMain class drives and maintains a state machine for the game. It can be in
00016 // one of seven major states defined by the UpdateEngineState enum class.
00017 // These are:
00018 //     WaitingForResources - the game has requested the game object or the renderer object
00019 //         to load resources asynchronously.
00020 //     ResourcesLoaded - the asynchronous loading of resources has been completed. This
00021 //         is a transient state.
00022 //     WaitingForPress - the game is waiting for the player to indicate they are ready to proceed.
00023 //         There are three possible actions from this state. This is controlled by m_pressResult.
00024 //         The possible outcomes are:
00025 //             LoadGame - The player is ready to start a new game and has acknowledged the status
00026 //                 information provided about the previous state.
00027 //             PlayLevel - The player is ready to play the next level. The level has already been
00028 //                 loaded so active game play will start.
00029 //             ContinueLevel - The player is ready to continue playing the current level. Part of the
00030 //                 current level has already been played.
00031 //     Dynamics - the game is active play mode.
00032 //     TooSmall - the window is currently too small to play the game.
00033 //     Suspended - the game was suspended by PLM.
00034 //     Deactivated - the game has lost focus.
00035 //
00036 // GameMain creates and maintains references to three major objects used for the game:
00037 //     MoveLookController (m_controller) - this object handles all the game specific user input and
00038 //         aggregates touch, mouse/keyboard and Xbox controller input into a unified input control.
00039 //     Simple3DGame (m_game) - this object handles all the game specific logic and game dynamics.
00040 //     GameRenderer (m_renderer) - This object handles all the graphics rendering for the game.
00041 //
00042
00043 #pragma once
00044
00045 #include "GameRenderer.h"
00046
00047 namespace GameControl
00048 {
00049     enum class UpdateEngineState
00050     {
00051         WaitingForResources,
00052         ResourcesLoaded,
00053         WaitingForPress,
00054         Dynamics,
00055         TooSmall,
00056         Suspended,
00057         Deactivated,
00058     };
00059
00060     enum class PressResultState
00061     {
00062         LoadGame,
00063         PlayLevel,
00064         ContinueLevel,
00065     };
00066
00067     enum class GameInfoOverlayState
00068     {
00069         Loading,
00070         GameStats,
00071         GameOverExpired,
00072         GameOverCompleted,
00073         LevelStart,
00074         Pause,
00075     };
00076 };
00077
00078 class GameMain : public winrt::implements<GameMain, winrt::Windows::Foundation::IInspectable>, DX::IDeviceNotify
00079 {
00080 public:
00081     GameMain(std::shared_ptr<DX::DeviceResources> const& deviceResources);
00082     ~GameMain();
00083     void CreateWindowSizeDependentResources();
00084     void Run();
00085     void Suspend();
00086     void Resume();
00087     void Visibility(bool visible);
00088     void Close() { m_windowClosed = true; }
00089
00090     // IDeviceNotify
00091     virtual void OnDeviceLost();
00092     virtual void OnDeviceRestored();
00093
00094     void PauseRequested() { if (m_updateState == GameControl::UpdateEngineState::Dynamics) m_pauseRequested = true; };
00095     void PressComplete() { if (m_updateState == GameControl::UpdateEngineState::WaitingForPress) m_pressComplete = true; };
00096     void ResetGame();
00097
00098     void WindowActivationChanged(winrt::Windows::UI::Core::CoreWindowActivationState activationState);
00099
00100 private:
00101     winrt::fire_and_forget ConstructInBackground();
00102     winrt::fire_and_forget HandleDeviceRestored();
00103     void SetGameInfoOverlay(GameControl::GameInfoOverlayState state);
00104     void InitializeGameState();
00105     void UpdateLayoutState();
00106     void Update();
00107     winrt::fire_and_forget LoadAndFinalizeLevelInBackground(bool renderNeeded = false);
00108     void WaitingForResourceLoading();
00109
00110 private:
00111     bool                                                m_windowClosed;
00112     bool                                                m_pauseRequested;
00113     bool                                                m_pressComplete;
00114     bool                                                m_renderNeeded;
00115     bool                                                m_haveFocus;
00116     bool                                                m_visible;
00117
00118     std::shared_ptr<DX::DeviceResources>                m_deviceResources;
00119     Simple3DGameDX::IGameUIControl* m_uiControl;
00120
00121     std::shared_ptr<MoveLookController>                 m_controller;
00122     std::shared_ptr<GameRenderer>                       m_renderer;
00123     std::shared_ptr<Simple3DGame>                       m_game;
00124
00125     GameControl::UpdateEngineState                      m_updateState;
00126     GameControl::UpdateEngineState                      m_updateStateNext;
00127     GameControl::PressResultState                       m_pressResult;
00128     GameControl::GameInfoOverlayState                   m_gameInfoOverlayState;
00129     Simple3DGameDX::GameInfoOverlayCommand              m_gameInfoOverlayCommand;
00130     uint32_t                                            m_loadingCount;
00131 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

User Member List

This is the complete list of members for User, including all inherited members.
Education | User |
educationKey | User | [private]
Id | User |
idKey | User | [private]
Name | User |
nameKey | User | [private]
Phone | User |
phoneKey | User | [private]
Stringify() | User | [inline]
Timezone | User |
timezoneKey | User | [private]
User() | User | [inline]
User(string jsonString) | User | [inline]
Verified | User |
verifiedKey | User | [private]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Item Member List

This is the complete list of members for Item, including all inherited members.
GenerateImageSource(int index) | Item | [private, static]
GetItems(int count) | Item | [static]
id | Item | [private]
Id() | Item | [inline]
ImageSource() | Item | [inline]
Item(int index) | Item | [inline]
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InputTypeTrigger Member List

This is the complete list of members for InputTypeTrigger, including all inherited members.
_lastPointerType | InputTypeTrigger | [private]
_targetElement | InputTypeTrigger | [private]
_targetElement_PointerPressed(object sender, PointerRoutedEventArgs e) | InputTypeTrigger | [inline, private]
_triggerPointerType | InputTypeTrigger | [private]
PointerType | InputTypeTrigger |
TargetElement | InputTypeTrigger |
UpdateTrigger() | InputTypeTrigger | [inline]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/Scenario4_Close.xaml.cs Source File

  • StreamSocket
  • cs

Scenario4_Close.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Diagnostics;
00015 using Windows.ApplicationModel.Core;
00016 using Windows.Networking;
00017 using Windows.Networking.Sockets;
00018 using Windows.Storage.Streams;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace StreamSocketSample
00024 {
00025     /// <summary>
00026     /// A page for fourth scenario.
00027     /// </summary>
00028     public sealed partial class Scenario4 : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public Scenario4()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046         }
00047
00048         /// <summary>
00049         /// This is the click handler for the 'CloseSockets' button.
00050         /// </summary>
00051         /// <param name="sender">Object for which the event was generated.</param>
00052         /// <param name="e">Event's parameters.</param>
00053         private void CloseSockets_Click(object sender, RoutedEventArgs e)
00054         {
00055             object outValue;
00056             if (CoreApplication.Properties.TryGetValue("clientDataWriter", out outValue))
00057             {
00058                 // Remove the data writer from the list of application properties as we are about to close it.
00059                 CoreApplication.Properties.Remove("clientDataWriter");
00060                 DataWriter dataWriter = (DataWriter)outValue;
00061
00062                 // To reuse the socket with another data writer, the application must detach the stream from the
00063                 // current writer before disposing it. This is added for completeness, as this sample closes the socket
00064                 // in the very next block.
00065                 dataWriter.DetachStream();
00066                 dataWriter.Dispose();
00067             }
00068
00069             if (CoreApplication.Properties.TryGetValue("clientSocket", out outValue))
00070             {
00071                 // Remove the socket from the list of application properties as we are about to close it.
00072                 CoreApplication.Properties.Remove("clientSocket");
00073                 StreamSocket socket = (StreamSocket)outValue;
00074
00075                 // StreamSocket.Close() is exposed through the Dispose() method in C#.
00076                 // The call below explicitly closes the socket.
00077                 socket.Dispose();
00078             }
00079
00080             if (CoreApplication.Properties.TryGetValue("listener", out outValue))
00081             {
00082                 // Remove the listener from the list of application properties as we are about to close it.
00083                 CoreApplication.Properties.Remove("listener");
00084                 StreamSocketListener listener = (StreamSocketListener)outValue;
00085
00086                 // StreamSocketListener.Close() is exposed through the Dispose() method in C#.
00087                 // The call below explicitly closes the socket.
00088                 listener.Dispose();
00089             }
00090
00091             CoreApplication.Properties.Remove("connected");
00092             CoreApplication.Properties.Remove("adapter");
00093             CoreApplication.Properties.Remove("serverAddress");
00094
00095             rootPage.NotifyUser("Socket and listener closed", NotifyType.StatusMessage);
00096         }
00097
00098     }
00099 }
Generated on Fri Nov 15 2024 22:19:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Pedometer/cs/Tasks/Properties/AssemblyInfo.cs Source File

  • Pedometer
  • cs
  • Tasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("Tasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("Tasks")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
AppView() | sealed |
CreateView() | sealed | [virtual]
Initialize(Windows::ApplicationModel::Core::CoreApplicationView^applicationView) | sealed | [virtual]
Load(Platform::String^entryPoint) | sealed | [virtual]
m_deviceResources | sealed | [private]
m_holographicSpace | sealed | [private]
m_main | sealed | [private]
m_windowClosed | sealed | [private]
m_windowVisible | sealed | [private]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^args) | sealed | [protected]
OnResuming(Platform::Object^sender, Platform::Object^args) | sealed | [protected]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^args) | sealed | [protected]
OnViewActivated(Windows::ApplicationModel::Core::CoreApplicationView^sender, Windows::ApplicationModel::Activation::IActivatedEventArgs^args) | sealed | [protected]
OnVisibilityChanged(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::VisibilityChangedEventArgs^args) | sealed | [protected]
OnWindowClosed(Windows::UI::Core::CoreWindow^sender, Windows::UI::Core::CoreWindowEventArgs^args) | sealed | [protected]
Run() | sealed | [virtual]
SetWindow(Windows::UI::Core::CoreWindow^window) | sealed | [virtual]
Uninitialize() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomCommand Member List

This is the complete list of members for CustomCommand, including all inherited members.
CustomCommand() | CustomCommand | [inline]
CustomCommandButton_Click(object sender, RoutedEventArgs e) | CustomCommand | [inline, private]
rootPage | CustomCommand | [private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario7_SetVersion Member List

This is the complete list of members for Scenario7_SetVersion, including all inherited members.
appData | Scenario7_SetVersion | [private]
DisplayOutput() | Scenario7_SetVersion | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario7_SetVersion | [inline, protected]
Scenario7_SetVersion() | Scenario7_SetVersion | [inline]
settingName | Scenario7_SetVersion | [private]
settingValue0 | Scenario7_SetVersion | [private]
settingValue1 | Scenario7_SetVersion | [private]
SetVersion0_Click(Object sender, RoutedEventArgs e) | Scenario7_SetVersion | [inline, private]
SetVersion1_Click(Object sender, RoutedEventArgs e) | Scenario7_SetVersion | [inline, private]
SetVersionHandler0(SetVersionRequest request) | Scenario7_SetVersion | [inline, private]
SetVersionHandler1(SetVersionRequest request) | Scenario7_SetVersion | [inline, private]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesClient/pch.h Source File

  • AppServices
  • cppwinrt
  • AppServicesClient

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.ApplicationModel.AppService.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.Core.h"
00010 #include "winrt/Windows.UI.Xaml.h"
00011 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00012 #include "winrt/Windows.UI.Xaml.Controls.h"
00013 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00014 #include "winrt/Windows.UI.Xaml.Documents.h"
00015 #include "winrt/Windows.UI.Xaml.Interop.h"
00016 #include "winrt/Windows.UI.Xaml.Markup.h"
00017 #include "winrt/Windows.UI.Xaml.Media.h"
00018 #include "winrt/Windows.UI.Xaml.Navigation.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cs/Scenario4_UpdatingLineDisplayAttributes.xaml.cs Source File

  • LineDisplay
  • cs

Scenario4_UpdatingLineDisplayAttributes.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.PointOfService;
00015 using Windows.Foundation;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Navigation;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario4_UpdatingLineDisplayAttributes : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025         private ClaimedLineDisplay lineDisplay;
00026
00027         public Scenario4_UpdatingLineDisplayAttributes()
00028         {
00029             this.InitializeComponent();
00030             DataContext = this;
00031         }
00032
00033         protected override async void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             await InitializeAsync();
00036         }
00037
00038         protected override void OnNavigatedFrom(NavigationEventArgs e)
00039         {
00040             lineDisplay?.Dispose();
00041             lineDisplay = null;
00042         }
00043
00044         private async Task InitializeAsync()
00045         {
00046             lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync();
00047
00048             BlinkRateSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeBlinkRate;
00049             BrightnessSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.IsBrightnessSupported;
00050
00051             SupportedScreenSizesComboBox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeScreenSize;
00052
00053             if (SupportedScreenSizesComboBox.IsEnabled)
00054             {
00055                 foreach (Size screenSize in lineDisplay.SupportedScreenSizesInCharacters)
00056                 {
00057                     SupportedScreenSizesComboBox.Items.Add(new ComboBoxItem { Content = $"{screenSize.Width} x {screenSize.Height}", Tag = screenSize });
00058                 }
00059
00060                 if (SupportedScreenSizesComboBox.Items.Count > 0)
00061                 {
00062                     SupportedScreenSizesComboBox.SelectedIndex = 0;
00063                 }
00064             }
00065
00066             CharacterSetMappingEnabledCheckbox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanMapCharacterSets;
00067
00068             UpdateButton.IsEnabled = (lineDisplay != null);
00069
00070             if (UpdateButton.IsEnabled)
00071             {
00072                 SetValuesFromLineDisplay();
00073
00074                 if (lineDisplay.Capabilities.CanBlink == LineDisplayTextAttributeGranularity.NotSupported)
00075                 {
00076                     await lineDisplay.DefaultWindow.TryDisplayTextAsync("Regular Text");
00077                 }
00078                 else
00079                 {
00080                     await lineDisplay.DefaultWindow.TryDisplayTextAsync("Blinking Text", LineDisplayTextAttribute.Blink);
00081                 }
00082             }
00083         }
00084
00085         private void SetValuesFromLineDisplay()
00086         {
00087             LineDisplayAttributes attributes = lineDisplay.GetAttributes();
00088             BlinkRateSlider.Value = attributes.BlinkRate.TotalMilliseconds;
00089             BrightnessSlider.Value = attributes.Brightness;
00090             CharacterSetMappingEnabledCheckbox.IsChecked = attributes.IsCharacterSetMappingEnabled;
00091         }
00092
00093         private async void UpdateButton_Click(object sender, RoutedEventArgs e)
00094         {
00095             LineDisplayAttributes attributes = lineDisplay.GetAttributes();
00096
00097             if (lineDisplay.Capabilities.CanChangeBlinkRate)
00098             {
00099                 attributes.BlinkRate = TimeSpan.FromMilliseconds(BlinkRateSlider.Value);
00100             }
00101
00102             if (lineDisplay.Capabilities.IsBrightnessSupported)
00103             {
00104                 attributes.Brightness = (int)BrightnessSlider.Value;
00105             }
00106
00107             if (lineDisplay.Capabilities.CanChangeScreenSize)
00108             {
00109                 attributes.ScreenSizeInCharacters = Helpers.GetSelectedItemTag<Size>(SupportedScreenSizesComboBox);
00110             }
00111
00112             if (lineDisplay.Capabilities.CanMapCharacterSets)
00113             {
00114                 attributes.IsCharacterSetMappingEnabled = CharacterSetMappingEnabledCheckbox.IsChecked.Value;
00115             }
00116
00117             if (await lineDisplay.TryUpdateAttributesAsync(attributes))
00118             {
00119                 rootPage.NotifyUser("Attributes updated successfully.", NotifyType.StatusMessage);
00120
00121                 // The resulting attributes may not match our request.
00122                 // For example, the Line Display will choose the closest available blink rate.
00123                 // Update the controls to show what the Line Display actually used.
00124                 SetValuesFromLineDisplay();
00125             }
00126             else
00127             {
00128                 // We probably lost our claim.
00129                 rootPage.NotifyUser("Failed to update attributes.", NotifyType.ErrorMessage);
00130             }
00131         }
00132     }
00133 }
Generated on Fri Nov 15 2024 22:20:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/SampleConfiguration.cs Source File

  • PasswordVault
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Security.Credentials;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Password vault C# sample";
00023
00024         List<Scenario> scenarios = new List<Scenario>
00025         {
00026             new Scenario() { Title="Save credentials", ClassType=typeof(Scenario1_Save) },
00027             new Scenario() { Title="Manage credentials", ClassType=typeof(Scenario2_Manage) },
00028         };
00029
00030         // Value is not important. This is just a trick to run code at construction.
00031         private bool initialize = InitializePasswordVaultInTheBackground();
00032
00033         static bool InitializePasswordVaultInTheBackground()
00034         {
00035             // Explicitly place this task on a background thread.
00036             Task.Factory.StartNew(() =>
00037             {
00038                 // any call to the password vault will load the vault.
00039                 var vault = new PasswordVault();
00040                 vault.RetrieveAll();
00041             });
00042             return true;
00043         }
00044     }
00045
00046     public class Scenario
00047     {
00048         public string Title { get; set; }
00049         public Type ClassType { get; set; }
00050     }
00051 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cs/Scenario4_Connect.xaml.cs Source File

  • WiFiScan
  • cs

Scenario4_Connect.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.ObjectModel;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.WiFi;
00017 using Windows.Networking.Connectivity;
00018 using Windows.Security.Credentials;
00019 using Windows.UI.Core;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Navigation;
00023
00024 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00025
00026 namespace WiFiScan
00027 {
00028     /// <summary>
00029     /// An empty page that can be used on its own or navigated to within a Frame.
00030     /// </summary>
00031     public sealed partial class Scenario4_Connect : Page
00032     {
00033         MainPage rootPage;
00034         private WiFiAdapter firstAdapter;
00035         private string savedProfileName = null;
00036
00037         public ObservableCollection<WiFiNetworkDisplay> ResultCollection
00038         {
00039             get;
00040             private set;
00041         }
00042
00043         public Scenario4_Connect()
00044         {
00045             this.InitializeComponent();
00046         }
00047
00048         protected override async void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
00051             rootPage = MainPage.Current;
00052
00053             // RequestAccessAsync must have been called at least once by the app before using the API
00054             // Calling it multiple times is fine but not necessary
00055             // RequestAccessAsync must be called from the UI thread
00056             var access = await WiFiAdapter.RequestAccessAsync();
00057             if (access != WiFiAccessStatus.Allowed)
00058             {
00059                 rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
00060             }
00061             else
00062             {
00063                 DataContext = this;
00064
00065                 var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
00066                 if (result.Count >= 1)
00067                 {
00068                     firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
00069
00070                     var scanButton = new Button();
00071                     scanButton.Content = string.Format("Scan");
00072                     scanButton.Click += ScanButton_Click;
00073                     Buttons.Children.Add(scanButton);
00074
00075                     var disconnectButton = new Button();
00076                     disconnectButton.Content = string.Format("Disconnect");
00077                     disconnectButton.Click += DisconnectButton_Click; ;
00078                     Buttons.Children.Add(disconnectButton);
00079
00080                     // Monitor network status changes
00081                     await UpdateConnectivityStatusAsync();
00082                     NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged;
00083                 }
00084                 else
00085                 {
00086                     rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
00087                 }
00088             }
00089         }
00090
00091         private void DisconnectButton_Click(object sender, RoutedEventArgs e)
00092         {
00093             firstAdapter.Disconnect();
00094         }
00095
00096         private async void NetworkInformation_NetworkStatusChanged(object sender)
00097         {
00098             await UpdateConnectivityStatusAsync();
00099
00100             // Update the connectivity level displayed for each
00101             foreach (var network in ResultCollection)
00102             {
00103                 await network.UpdateConnectivityLevel();
00104             }
00105         }
00106
00107         private async Task UpdateConnectivityStatusAsync()
00108         {
00109             var connectedProfile = await firstAdapter.NetworkAdapter.GetConnectedProfileAsync();
00110             if (connectedProfile != null && !connectedProfile.ProfileName.Equals(savedProfileName))
00111             {
00112                 savedProfileName = connectedProfile.ProfileName;
00113                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00114                 {
00115                     rootPage.NotifyUser(string.Format("WiFi adapter connected to: {0} ({1})", connectedProfile.ProfileName, connectedProfile.GetNetworkConnectivityLevel()), NotifyType.StatusMessage);
00116                 });
00117             }
00118             else if (connectedProfile == null && savedProfileName != null)
00119             {
00120                 savedProfileName = null;
00121                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00122                 {
00123                     rootPage.NotifyUser("WiFi adapter disconnected", NotifyType.StatusMessage);
00124                 });
00125             }
00126         }
00127
00128         private async void ScanButton_Click(object sender, RoutedEventArgs e)
00129         {
00130             await firstAdapter.ScanAsync();
00131             ConnectionBar.Visibility = Visibility.Collapsed;
00132             DisplayNetworkReport(firstAdapter.NetworkReport);
00133         }
00134
00135         private async void DisplayNetworkReport(WiFiNetworkReport report)
00136         {
00137             rootPage.NotifyUser(string.Format("Network Report Timestamp: {0}", report.Timestamp), NotifyType.StatusMessage);
00138
00139             ResultCollection.Clear();
00140
00141             foreach (var network in report.AvailableNetworks)
00142             {
00143                 var networkDisplay = new WiFiNetworkDisplay(network, firstAdapter);
00144                 await networkDisplay.UpdateConnectivityLevel();
00145                 ResultCollection.Add(networkDisplay);
00146             }
00147         }
00148
00149         private void ResultsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
00150         {
00151             var selectedNetwork = ResultsListView.SelectedItem as WiFiNetworkDisplay;
00152             if (selectedNetwork == null)
00153             {
00154                 return;
00155             }
00156
00157             // Show the connection bar
00158             ConnectionBar.Visibility = Visibility.Visible;
00159
00160             // Only show the password box if needed
00161             if (selectedNetwork.AvailableNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211 &&
00162                 selectedNetwork.AvailableNetwork.SecuritySettings.NetworkEncryptionType == NetworkEncryptionType.None)
00163             {
00164                 NetworkKeyInfo.Visibility = Visibility.Collapsed;
00165             }
00166             else
00167             {
00168                 NetworkKeyInfo.Visibility = Visibility.Visible;
00169             }
00170         }
00171
00172         private async void ConnectButton_Click(object sender, RoutedEventArgs e)
00173         {
00174             var selectedNetwork = ResultsListView.SelectedItem as WiFiNetworkDisplay;
00175             if (selectedNetwork == null || firstAdapter == null)
00176             {
00177                 rootPage.NotifyUser("Network not selcted", NotifyType.ErrorMessage);
00178                 return;
00179             }
00180             WiFiReconnectionKind reconnectionKind = WiFiReconnectionKind.Manual;
00181             if (IsAutomaticReconnection.IsChecked.HasValue && IsAutomaticReconnection.IsChecked == true)
00182             {
00183                 reconnectionKind = WiFiReconnectionKind.Automatic;
00184             }
00185
00186             WiFiConnectionResult result;
00187             if (selectedNetwork.AvailableNetwork.SecuritySettings.NetworkAuthenticationType == NetworkAuthenticationType.Open80211 &&
00188                 selectedNetwork.AvailableNetwork.SecuritySettings.NetworkEncryptionType == NetworkEncryptionType.None)
00189             {
00190                 result = await firstAdapter.ConnectAsync(selectedNetwork.AvailableNetwork, reconnectionKind);
00191             }
00192             else
00193             {
00194                 // Only the password portion of the credential need to be supplied
00195                 var credential = new PasswordCredential();
00196
00197                 // Make sure Credential.Password property is not set to an empty string.
00198                 // Otherwise, a System.ArgumentException will be thrown.
00199                 // The default empty password string will still be passed to the ConnectAsync method,
00200                 // which should return an "InvalidCredential" error
00201                 if (!string.IsNullOrEmpty(NetworkKey.Password))
00202                 {
00203                     credential.Password = NetworkKey.Password;
00204                 }
00205
00206                 result = await firstAdapter.ConnectAsync(selectedNetwork.AvailableNetwork, reconnectionKind, credential);
00207             }
00208
00209             if (result.ConnectionStatus == WiFiConnectionStatus.Success)
00210             {
00211                 rootPage.NotifyUser(string.Format("Successfully connected to {0}.", selectedNetwork.Ssid), NotifyType.StatusMessage);
00212             }
00213             else
00214             {
00215                 rootPage.NotifyUser(string.Format("Could not connect to {0}. Error: {1}", selectedNetwork.Ssid, result.ConnectionStatus), NotifyType.ErrorMessage);
00216             }
00217         }
00218
00219     }
00220 }
00221
Generated on Fri Nov 15 2024 22:22:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/SampleConfiguration.h Source File

  • CameraResolution
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Camera Resolution C++ sample";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038         Concurrency::task<void> SetMediaStreamPropertiesAsync(Windows::Media::Capture::MediaCapture^ mediaCapture, Windows::UI::Xaml::Controls::CaptureElement^ previewControl, Windows::Media::Capture::MediaStreamType streamType, Windows::Media::MediaProperties::IMediaEncodingProperties ^ encodingProperties);
00039
00040     private:
00041         static Platform::Array<Scenario>^ scenariosInner;
00042     };
00043
00044     public value struct Scenario
00045     {
00046         Platform::String^ Title;
00047         Platform::String^ ClassName;
00048     };
00049 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/AdaptiveTemplates/Branding/Logo/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • AdaptiveTemplates
  • Branding
  • Logo

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.LiveTiles.AdaptiveTemplates.Branding.Logo
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             // Because different densities might be able to display more, we just set tons of text wrapped to make sure it overflows at some point
00017             string fillerText = "<text hint-wrap='true'>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</text>";
00018
00019             updateFourTilesControl.SetTilePayload($@"
00020                 <tile version='3'>
00021                     <visual>
00022
00023                         <binding template='TileSmall' branding='logo'>
00024                             <text>logo</text>
00025                             {fillerText}
00026                         </binding>
00027
00028                         <binding template='TileMedium' branding='logo'>
00029                             <text hint-wrap='true'>branding: logo</text>
00030                             {fillerText}
00031                         </binding>
00032
00033                         <binding template='TileWide' branding='logo'>
00034                             <text hint-wrap='true'>branding: logo</text>
00035                             {fillerText}
00036                         </binding>
00037
00038                         <binding template='TileLarge' branding='logo'>
00039                             <text hint-wrap='true'>branding: logo</text>
00040                             {fillerText}
00041                         </binding>
00042
00043                     </visual>
00044                 </tile>");
00045         }
00046     }
00047 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Common/CameraResources.cpp Source File

  • HolographicSpatialStage
  • cpp
  • Common

CameraResources.cpp

Go to the documentation of this file.
00001 #include "pch.h"
00002
00003 #include "CameraResources.h"
00004 #include "Common\DirectXHelper.h"
00005 #include "DeviceResources.h"
00006 #include <windows.graphics.directx.direct3d11.interop.h>
00007
00008 using namespace DirectX;
00009 using namespace Microsoft::WRL;
00010 using namespace Windows::Graphics::DirectX::Direct3D11;
00011 using namespace Windows::Graphics::Holographic;
00012 using namespace Windows::Perception::Spatial;
00013
00014 DX::CameraResources::CameraResources(HolographicCamera^ camera) :
00015     m_holographicCamera(camera),
00016     m_isStereo(camera->IsStereo),
00017     m_d3dRenderTargetSize(camera->RenderTargetSize)
00018 {
00019     m_d3dViewport = CD3D11_VIEWPORT(
00020         0.f, 0.f,
00021         m_d3dRenderTargetSize.Width,
00022         m_d3dRenderTargetSize.Height
00023         );
00024 };
00025
00026 // Updates resources associated with a holographic camera's swap chain.
00027 // The app does not access the swap chain directly, but it does create
00028 // resource views for the back buffer.
00029 void DX::CameraResources::CreateResourcesForBackBuffer(
00030     DX::DeviceResources* pDeviceResources,
00031     HolographicCameraRenderingParameters^ cameraParameters
00032     )
00033 {
00034     const auto device = pDeviceResources->GetD3DDevice();
00035
00036     // Get the WinRT object representing the holographic camera's back buffer.
00037     IDirect3DSurface^ surface = cameraParameters->Direct3D11BackBuffer;
00038
00039     // Get a DXGI interface for the holographic camera's back buffer.
00040     // Holographic cameras do not provide the DXGI swap chain, which is owned
00041     // by the system. The Direct3D back buffer resource is provided using WinRT
00042     // interop APIs.
00043     ComPtr<ID3D11Resource> resource;
00044     ThrowIfFailed(
00045         GetDXGIInterfaceFromObject(surface, IID_PPV_ARGS(&resource))
00046         );
00047
00048     // Get a Direct3D interface for the holographic camera's back buffer.
00049     ComPtr<ID3D11Texture2D> cameraBackBuffer;
00050     ThrowIfFailed(
00051         resource.As(&cameraBackBuffer)
00052         );
00053
00054     // Determine if the back buffer has changed. If so, ensure that the render target view
00055     // is for the current back buffer.
00056     if (m_d3dBackBuffer.Get() != cameraBackBuffer.Get())
00057     {
00058         // This can change every frame as the system moves to the next buffer in the
00059         // swap chain. This mode of operation will occur when certain rendering modes
00060         // are activated.
00061         m_d3dBackBuffer = cameraBackBuffer;
00062
00063         // Create a render target view of the back buffer.
00064         // Creating this resource is inexpensive, and is better than keeping track of
00065         // the back buffers in order to pre-allocate render target views for each one.
00066         DX::ThrowIfFailed(
00067             device->CreateRenderTargetView(
00068                 m_d3dBackBuffer.Get(),
00069                 nullptr,
00070                 &m_d3dRenderTargetView
00071                 )
00072             );
00073
00074         // Get the DXGI format for the back buffer.
00075         // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
00076         D3D11_TEXTURE2D_DESC backBufferDesc;
00077         m_d3dBackBuffer->GetDesc(&backBufferDesc);
00078         m_dxgiFormat = backBufferDesc.Format;
00079
00080         // Check for render target size changes.
00081         Windows::Foundation::Size currentSize = m_holographicCamera->RenderTargetSize;
00082         if (m_d3dRenderTargetSize != currentSize)
00083         {
00084             // Set render target size.
00085             m_d3dRenderTargetSize = currentSize;
00086
00087             // A new depth stencil view is also needed.
00088             m_d3dDepthStencilView.Reset();
00089         }
00090     }
00091
00092     // Refresh depth stencil resources, if needed.
00093     if (m_d3dDepthStencilView == nullptr)
00094     {
00095         // Create a depth stencil view for use with 3D rendering if needed.
00096         CD3D11_TEXTURE2D_DESC depthStencilDesc(
00097             DXGI_FORMAT_R16_TYPELESS,
00098             static_cast<UINT>(m_d3dRenderTargetSize.Width),
00099             static_cast<UINT>(m_d3dRenderTargetSize.Height),
00100             m_isStereo ? 2 : 1, // Create two textures when rendering in stereo.
00101             1, // Use a single mipmap level.
00102             D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE
00103             );
00104
00105         DX::ThrowIfFailed(
00106             device->CreateTexture2D(
00107                 &depthStencilDesc,
00108                 nullptr,
00109                 &m_d3dDepthBuffer
00110                 )
00111             );
00112
00113         CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(
00114             m_isStereo ? D3D11_DSV_DIMENSION_TEXTURE2DARRAY : D3D11_DSV_DIMENSION_TEXTURE2D,
00115             DXGI_FORMAT_D16_UNORM
00116             );
00117         DX::ThrowIfFailed(
00118             device->CreateDepthStencilView(
00119                 m_d3dDepthBuffer.Get(),
00120                 &depthStencilViewDesc,
00121                 &m_d3dDepthStencilView
00122                 )
00123             );
00124     }
00125
00126     // Create the constant buffer, if needed.
00127     if (m_viewProjectionConstantBuffer == nullptr)
00128     {
00129         // Create a constant buffer to store view and projection matrices for the camera.
00130         CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00131         DX::ThrowIfFailed(
00132             device->CreateBuffer(
00133                 &constantBufferDesc,
00134                 nullptr,
00135                 &m_viewProjectionConstantBuffer
00136                 )
00137             );
00138     }
00139 }
00140
00141 // Releases resources associated with a back buffer.
00142 void DX::CameraResources::ReleaseResourcesForBackBuffer(DX::DeviceResources* pDeviceResources)
00143 {
00144     const auto context = pDeviceResources->GetD3DDeviceContext();
00145
00146     // Release camera-specific resources.
00147     m_d3dBackBuffer.Reset();
00148     m_d3dDepthBuffer.Reset();
00149     m_d3dRenderTargetView.Reset();
00150     m_d3dDepthStencilView.Reset();
00151     m_viewProjectionConstantBuffer.Reset();
00152
00153     // Ensure system references to the back buffer are released by clearing the render
00154     // target from the graphics pipeline state, and then flushing the Direct3D context.
00155     ID3D11RenderTargetView* nullViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { nullptr };
00156     context->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00157     context->Flush();
00158 }
00159
00160 // Updates the view/projection constant buffer for a holographic camera.
00161 void DX::CameraResources::UpdateViewProjectionBuffer(
00162     std::shared_ptr<DX::DeviceResources> deviceResources,
00163     HolographicCameraPose^ cameraPose,
00164     SpatialCoordinateSystem^ coordinateSystem
00165     )
00166 {
00167     // The system changes the viewport on a per-frame basis for system optimizations.
00168     m_d3dViewport = CD3D11_VIEWPORT(
00169         cameraPose->Viewport.Left,
00170         cameraPose->Viewport.Top,
00171         cameraPose->Viewport.Width,
00172         cameraPose->Viewport.Height
00173         );
00174
00175     // The projection transform for each frame is provided by the HolographicCameraPose.
00176     HolographicStereoTransform cameraProjectionTransform = cameraPose->ProjectionTransform;
00177
00178     // Get a container object with the view and projection matrices for the given
00179     // pose in the given coordinate system.
00180     Platform::IBox<HolographicStereoTransform>^ viewTransformContainer = cameraPose->TryGetViewTransform(coordinateSystem);
00181
00182     // If TryGetViewTransform returns a null pointer, that means the pose and coordinate
00183     // system cannot be understood relative to one another; content cannot be rendered
00184     // in this coordinate system for the duration of the current frame.
00185     // This usually means that positional tracking is not active for the current frame, in
00186     // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
00187     // content that is not world-locked instead.
00188     DX::ViewProjectionConstantBuffer viewProjectionConstantBufferData;
00189     bool viewTransformAcquired = viewTransformContainer != nullptr;
00190     if (viewTransformAcquired)
00191     {
00192         // Otherwise, the set of view transforms can be retrieved.
00193         HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer->Value;
00194
00195         // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
00196         // constantly moving relative to the world. The view matrices need to be updated
00197         // every frame.
00198         XMStoreFloat4x4(
00199             &viewProjectionConstantBufferData.viewProjection[0],
00200             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Left) * XMLoadFloat4x4(&cameraProjectionTransform.Left))
00201             );
00202         XMStoreFloat4x4(
00203             &viewProjectionConstantBufferData.viewProjection[1],
00204             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Right) * XMLoadFloat4x4(&cameraProjectionTransform.Right))
00205             );
00206     }
00207
00208     // Use the D3D device context to update Direct3D device-based resources.
00209     const auto context = deviceResources->GetD3DDeviceContext();
00210
00211     // Loading is asynchronous. Resources must be created before they can be updated.
00212     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || !viewTransformAcquired)
00213     {
00214         m_framePending = false;
00215     }
00216     else
00217     {
00218         // Update the view and projection matrices.
00219         context->UpdateSubresource(
00220             m_viewProjectionConstantBuffer.Get(),
00221             0,
00222             nullptr,
00223             &viewProjectionConstantBufferData,
00224             0,
00225             0
00226             );
00227
00228         m_framePending = true;
00229     }
00230 }
00231
00232 // Gets the view-projection constant buffer for the HolographicCamera and attaches it
00233 // to the shader pipeline.
00234 bool DX::CameraResources::AttachViewProjectionBuffer(
00235     std::shared_ptr<DX::DeviceResources> deviceResources
00236     )
00237 {
00238     // This method uses Direct3D device-based resources.
00239     const auto context = deviceResources->GetD3DDeviceContext();
00240
00241     // Loading is asynchronous. Resources must be created before they can be updated.
00242     // Cameras can also be added asynchronously, in which case they must be initialized
00243     // before they can be used.
00244     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
00245     {
00246         return false;
00247     }
00248
00249     // Set the viewport for this camera.
00250     context->RSSetViewports(1, &m_d3dViewport);
00251
00252     // Send the constant buffer to the vertex shader.
00253     context->VSSetConstantBuffers(
00254         1,
00255         1,
00256         m_viewProjectionConstantBuffer.GetAddressOf()
00257         );
00258
00259     m_framePending = false;
00260
00261     return true;
00262 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/Tasks/EdpBackgroundTask.cs Source File

  • EnterpriseDataProtection
  • cs
  • Tasks

EdpBackgroundTask.cs

Go to the documentation of this file.
00001 ﻿// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 using System;
00009 using System.Diagnostics;
00010 using System.Threading;
00011 using System.Runtime;
00012 using Windows.ApplicationModel.Background;
00013 using Windows.Storage;
00014 using Windows.Storage.Streams;
00015 using Windows.Security.EnterpriseData;
00016 using Windows.Security.Cryptography;
00017
00018 namespace Tasks
00019 {
00020     public sealed class EdpBackgroundTask : IBackgroundTask
00021     {
00022         volatile bool m_cancelRequested = false;
00023         private string m_taskName = "";
00024         private bool m_areKeysDropped = true;
00025         private string m_fileProtStatus = "";
00026         private string m_EnterpriseID = "";
00027         private string m_SecretMessage = "This is a secret message";
00028         private IBuffer m_protectedBuffer = null;
00029
00030         public void Run(IBackgroundTaskInstance taskInstance)
00031         {
00032             Debug.WriteLine("EdpBackgroundTask " + taskInstance.Task.Name + " starting...");
00033
00034             m_taskName = taskInstance.Task.Name;
00035
00036             var settings = ApplicationData.Current.LocalSettings;
00037             var key = taskInstance.Task.Name;
00038
00039             // Get EnterpriseID
00040
00041             m_EnterpriseID = settings.Values[key].ToString();
00042             settings.Values[key] = "";
00043
00044             // Associate a cancellation handler with the background task.
00045             taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
00046
00047             ProtectionPolicyManager.ProtectedAccessSuspending += ProtectedAccessSuspending;
00048             ProtectionPolicyManager.ProtectedAccessResumed += ProtectedAccessResumed;
00049
00050             // Do background task activity.
00051             uint Progress;
00052             for (Progress = 0; Progress <= 100; Progress += 10)
00053             {
00054                 // If the cancellation handler indicated that the task was canceled, stop doing the task.
00055                 if (m_cancelRequested)
00056                 {
00057                     break;
00058                 }
00059
00060                 DoBufferWork(taskInstance);
00061                 DoFileWork(taskInstance);
00062
00063                 // Sleep for 10 seconds for testing purposes
00064
00065                 using (EventWaitHandle workEvent = new ManualResetEvent(false))
00066                 {
00067                     workEvent.WaitOne(TimeSpan.FromSeconds(10));
00068                 }
00069                 // Indicate progress to foreground application.
00070                 taskInstance.Progress = Progress;
00071             }
00072
00073             settings.Values[key] += "\nWrote Protected File at: " +
00074                                        Windows.Storage.ApplicationData.Current.LocalFolder.Path;
00075             settings.Values[key] += "\nFile protection Status:" + m_fileProtStatus;
00076
00077             Debug.WriteLine("EdpBackgroundTask " + taskInstance.Task.Name + ((Progress < 100) ? " Canceled" : " Completed"));
00078         }
00079
00080         private async void DoBufferWork(IBackgroundTaskInstance taskInstance)
00081         {
00082             string message = "Hello World!";
00083             string unprotectedMessage = "";
00084             string logFileName = "Bufferlog.txt";
00085             string logFileContent = "";
00086
00087             StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00088             StorageFile logFile = await localFolder.CreateFileAsync(logFileName, CreationCollisionOption.OpenIfExists);
00089
00090
00091             IBuffer inputBuffer = CryptographicBuffer.ConvertStringToBinary(message, BinaryStringEncoding.Utf8);
00092             BufferProtectUnprotectResult procBuffer = await DataProtectionManager.ProtectAsync(inputBuffer, m_EnterpriseID);
00093             logFileContent += "\r\n" + DateTime.Now + ":" + "ProtStatus:" + procBuffer.ProtectionInfo.Status + "\n";
00094             logFileContent += "\r\n" + "Protected Buffer:" + CryptographicBuffer.EncodeToHexString(procBuffer.Buffer).Substring(0, 5);
00095
00096             // If keys are dropped under lock, unprotectBuffer will fail so don't unprotectbuffer under lock
00097             if (!m_areKeysDropped)
00098             {
00099                 BufferProtectUnprotectResult unBuffer = await DataProtectionManager.UnprotectAsync(procBuffer.Buffer);
00100                 unprotectedMessage = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, procBuffer.Buffer);
00101                 logFileContent += "\n Unprotected string:" + unprotectedMessage;
00102                 if (message != unprotectedMessage)
00103                 {
00104                     throw new Exception("Original string does not match with unprotectedMessage!");
00105                 }
00106             }
00107
00108             await FileIO.AppendTextAsync(logFile, logFileContent);
00109
00110         }
00111
00112         private async void DoFileWork(IBackgroundTaskInstance taskInstance)
00113         {
00114             string textBody = "\nHello World";
00115             string fileName = "EdpSample.txt";
00116             string fileCopyName = "EdpSampleCopy.txt";
00117             string logFileName = "Filelog.txt";
00118
00119             StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00120
00121             StorageFile logFile = await localFolder.CreateFileAsync(logFileName, CreationCollisionOption.OpenIfExists);
00122
00123             // Create a protected file allows the creation of new files even after keys are dropped so that application
00124             // can create and continue writing to files under lock
00125
00126             var result = await FileProtectionManager.CreateProtectedAndOpenAsync(localFolder,
00127                                                                                  fileName,
00128                                                                                  m_EnterpriseID,
00129                                                                                  CreationCollisionOption.ReplaceExisting
00130                                                                                  );
00131             using (var stream = result.Stream)
00132             {
00133                 m_fileProtStatus = result.ProtectionInfo.Status.ToString();
00134
00135                 // Write to File
00136
00137                 using (IOutputStream outputStream = result.Stream.GetOutputStreamAt(0))
00138                 {
00139                     DataWriter writer = new DataWriter(outputStream);
00140                     for (int i = 0; i < 100; i++)
00141                     {
00142                         writer.WriteString(textBody);
00143                         await writer.StoreAsync();
00144                     }
00145                 }
00146             }
00147
00148             // Check and if Keys are not dropped, read and write to another file.
00149             // Read from a protected file and copy it to another one
00150
00151             if (!m_areKeysDropped)
00152             {
00153                 StorageFile edpFileSource = await localFolder.CreateFileAsync(fileName, CreationCollisionOption.OpenIfExists);
00154                 StorageFile edpFileCopy = await localFolder.CreateFileAsync(fileCopyName, CreationCollisionOption.ReplaceExisting);
00155                 string sourceContent = await FileIO.ReadTextAsync(edpFileSource);
00156                 await FileIO.WriteTextAsync(edpFileCopy, sourceContent);
00157             }
00158             else
00159             {
00160                 await FileIO.AppendTextAsync(logFile, "\r\n" + DateTime.Now + ":" + " keys are dropped. Skip reading");
00161             }
00162         }
00163
00164         private async void ProtectedAccessSuspending(object sender, ProtectedAccessSuspendingEventArgs args)
00165         {
00166             string logFileContent = "";
00167
00168             Windows.Foundation.Deferral deferal = args.GetDeferral();
00169
00170             // Protect any sensitive data in Memory so that it cannot be accessed while the device is  locked
00171             // You should encrypt or destory any copies of sensitve data while device is going to a locked state.
00172
00173             IBuffer inputBuffer = CryptographicBuffer.ConvertStringToBinary(m_SecretMessage,
00174                                                                             BinaryStringEncoding.Utf8);
00175             BufferProtectUnprotectResult procBuffer = await DataProtectionManager.ProtectAsync(inputBuffer, m_EnterpriseID);
00176             m_protectedBuffer = procBuffer.Buffer;
00177
00178             deferal.Complete();
00179
00180             m_areKeysDropped = true;
00181
00182             var settings = ApplicationData.Current.LocalSettings;
00183             settings.Values[m_taskName] += "\nApp got DPL suspend event";
00184
00185             StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00186
00187             StorageFile logFile = await localFolder.CreateFileAsync("SuspendLog.txt",
00188                                            CreationCollisionOption.OpenIfExists);
00189
00190             logFileContent += "\r\n" + DateTime.Now + ":" + "Got DPL Protected Suspended";
00191             logFileContent += "\r\n" + "Protection Status:" + procBuffer.ProtectionInfo.Status;
00192
00193             await FileIO.AppendTextAsync(logFile, logFileContent);
00194         }
00195
00196         private async void ProtectedAccessResumed(object sender, ProtectedAccessResumedEventArgs args)
00197         {
00198             // Keys are available so can read and write from a protected file
00199
00200             m_areKeysDropped = false;
00201
00202             BufferProtectUnprotectResult unBuffer = await DataProtectionManager.UnprotectAsync(m_protectedBuffer);
00203             m_SecretMessage = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8,
00204                                                                            m_protectedBuffer
00205                                                                            );
00206             string logFileContent = "\n Unprotected string:" + m_SecretMessage;
00207
00208             var settings = ApplicationData.Current.LocalSettings;
00209             settings.Values[m_taskName] += "\nApp got DPL resumed event";
00210             StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
00211             StorageFile logFile = await localFolder.CreateFileAsync("ResumeLog.txt",
00212                                                                        CreationCollisionOption.OpenIfExists);
00213             await FileIO.AppendTextAsync(logFile, "\r\n" + DateTime.Now + ":" + "Got DPL Protected resumed");
00214         }
00215
00216         private void OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
00217         {
00218             m_cancelRequested = true;
00219             Debug.WriteLine("EdpBackgroundTask " + sender.Task.Name + " Cancel Requested...");
00220         }
00221     }
00222 }
00223
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario4_InteractionFeedback.h Source File

  • PenHaptics
  • cppwinrt

Scenario4_InteractionFeedback.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4_InteractionFeedback.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario4_InteractionFeedback : Scenario4_InteractionFeedbackT<Scenario4_InteractionFeedback>
00020     {
00021         Scenario4_InteractionFeedback();
00022
00023         void MainGrid_Entered(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00024         void MainGrid_Exited(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00025         void SendFeedback_Clicked(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const& e);
00026
00027     private:
00028         Windows::Devices::Haptics::SimpleHapticsController hapticsController{ nullptr };
00029         Windows::Devices::Input::PenDevice penDevice{ nullptr };
00030         Windows::Devices::Haptics::SimpleHapticsControllerFeedback currentFeedback{ nullptr };
00031
00032         Windows::Devices::Haptics::SimpleHapticsControllerFeedback GetSelectedFeedbackOrFallback(std::wstring& message);
00033
00034     };
00035 }
00036
00037 namespace winrt::SDKTemplate::factory_implementation
00038 {
00039     struct Scenario4_InteractionFeedback : Scenario4_InteractionFeedbackT<Scenario4_InteractionFeedback, implementation::Scenario4_InteractionFeedback>
00040     {
00041     };
00042 }
Generated on Fri Nov 15 2024 22:20:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialMapping/cpp/Common/DeviceResources.cpp Source File

  • HolographicSpatialMapping
  • cpp
  • Common

DeviceResources.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "DeviceResources.h"
00014 #include "DirectXHelper.h"
00015
00016 #include <Collection.h>
00017 #include <windows.graphics.directx.direct3d11.interop.h>
00018
00019 using namespace D2D1;
00020 using namespace Microsoft::WRL;
00021 using namespace Windows::Graphics::DirectX::Direct3D11;
00022 using namespace Windows::Graphics::Display;
00023 using namespace Windows::Graphics::Holographic;
00024
00025 // Constructor for DeviceResources.
00026 DX::DeviceResources::DeviceResources()
00027 {
00028     CreateDeviceIndependentResources();
00029 }
00030
00031 // Configures resources that don't depend on the Direct3D device.
00032 void DX::DeviceResources::CreateDeviceIndependentResources()
00033 {
00034     // Initialize Direct2D resources.
00035     D2D1_FACTORY_OPTIONS options {};
00036
00037 #if defined(_DEBUG)
00038     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
00039     options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
00040 #endif
00041
00042     // Initialize the Direct2D Factory.
00043     DX::ThrowIfFailed(
00044         D2D1CreateFactory(
00045             D2D1_FACTORY_TYPE_SINGLE_THREADED,
00046             __uuidof(ID2D1Factory2),
00047             &options,
00048             &m_d2dFactory
00049             )
00050         );
00051
00052     // Initialize the DirectWrite Factory.
00053     DX::ThrowIfFailed(
00054         DWriteCreateFactory(
00055             DWRITE_FACTORY_TYPE_SHARED,
00056             __uuidof(IDWriteFactory2),
00057             &m_dwriteFactory
00058             )
00059         );
00060
00061     // Initialize the Windows Imaging Component (WIC) Factory.
00062     DX::ThrowIfFailed(
00063         CoCreateInstance(
00064             CLSID_WICImagingFactory2,
00065             nullptr,
00066             CLSCTX_INPROC_SERVER,
00067             IID_PPV_ARGS(&m_wicFactory)
00068             )
00069         );
00070 }
00071
00072 void DX::DeviceResources::SetHolographicSpace(HolographicSpace^ holographicSpace)
00073 {
00074     // Cache the holographic space. Used to re-initalize during device-lost scenarios.
00075     m_holographicSpace = holographicSpace;
00076
00077     InitializeUsingHolographicSpace();
00078 }
00079
00080 void DX::DeviceResources::InitializeUsingHolographicSpace()
00081 {
00082     // The holographic space might need to determine which adapter supports
00083     // holograms, in which case it will specify a non-zero PrimaryAdapterId.
00084     LUID id =
00085     {
00086         m_holographicSpace->PrimaryAdapterId.LowPart,
00087         m_holographicSpace->PrimaryAdapterId.HighPart
00088     };
00089
00090     // When a primary adapter ID is given to the app, the app should find
00091     // the corresponding DXGI adapter and use it to create Direct3D devices
00092     // and device contexts. Otherwise, there is no restriction on the DXGI
00093     // adapter the app can use.
00094     if ((id.HighPart != 0) && (id.LowPart != 0))
00095     {
00096         UINT createFlags = 0;
00097 #ifdef DEBUG
00098         if (DX::SdkLayersAvailable())
00099         {
00100             createFlags |= DXGI_CREATE_FACTORY_DEBUG;
00101         }
00102 #endif
00103         // Create the DXGI factory.
00104         ComPtr<IDXGIFactory1> dxgiFactory;
00105         DX::ThrowIfFailed(
00106             CreateDXGIFactory2(
00107                 createFlags,
00108                 IID_PPV_ARGS(&dxgiFactory)
00109                 )
00110             );
00111         ComPtr<IDXGIFactory4> dxgiFactory4;
00112         DX::ThrowIfFailed(dxgiFactory.As(&dxgiFactory4));
00113
00114         // Retrieve the adapter specified by the holographic space.
00115         DX::ThrowIfFailed(
00116             dxgiFactory4->EnumAdapterByLuid(
00117                 id,
00118                 IID_PPV_ARGS(&m_dxgiAdapter)
00119                 )
00120             );
00121     }
00122     else
00123     {
00124         m_dxgiAdapter.Reset();
00125     }
00126
00127     CreateDeviceResources();
00128
00129     m_holographicSpace->SetDirect3D11Device(m_d3dInteropDevice);
00130 }
00131
00132 // Configures the Direct3D device, and stores handles to it and the device context.
00133 void DX::DeviceResources::CreateDeviceResources()
00134 {
00135     // This flag adds support for surfaces with a different color channel ordering
00136     // than the API default. It is required for compatibility with Direct2D.
00137     UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
00138
00139 #if defined(_DEBUG)
00140     if (DX::SdkLayersAvailable())
00141     {
00142         // If the project is in a debug build, enable debugging via SDK Layers with this flag.
00143         creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
00144     }
00145 #endif
00146
00147     // This array defines the set of DirectX hardware feature levels this app will support.
00148     // Note the ordering should be preserved.
00149     // Note that HoloLens supports feature level 11.1. The HoloLens emulator is also capable
00150     // of running on graphics cards starting with feature level 10.0.
00151     D3D_FEATURE_LEVEL featureLevels [] =
00152     {
00153         D3D_FEATURE_LEVEL_12_1,
00154         D3D_FEATURE_LEVEL_12_0,
00155         D3D_FEATURE_LEVEL_11_1,
00156         D3D_FEATURE_LEVEL_11_0,
00157         D3D_FEATURE_LEVEL_10_1,
00158         D3D_FEATURE_LEVEL_10_0
00159     };
00160
00161     // Create the Direct3D 11 API device object and a corresponding context.
00162     ComPtr<ID3D11Device> device;
00163     ComPtr<ID3D11DeviceContext> context;
00164
00165     const HRESULT hr = D3D11CreateDevice(
00166         m_dxgiAdapter.Get(),        // Either nullptr, or the primary adapter determined by Windows Holographic.
00167         D3D_DRIVER_TYPE_HARDWARE,   // Create a device using the hardware graphics driver.
00168         0,                          // Should be 0 unless the driver is D3D_DRIVER_TYPE_SOFTWARE.
00169         creationFlags,              // Set debug and Direct2D compatibility flags.
00170         featureLevels,              // List of feature levels this app can support.
00171         ARRAYSIZE(featureLevels),   // Size of the list above.
00172         D3D11_SDK_VERSION,          // Always set this to D3D11_SDK_VERSION for Windows Runtime apps.
00173         &device,                    // Returns the Direct3D device created.
00174         &m_d3dFeatureLevel,         // Returns feature level of device created.
00175         &context                    // Returns the device immediate context.
00176         );
00177
00178     if (FAILED(hr))
00179     {
00180         // If the initialization fails, fall back to the WARP device.
00181         // For more information on WARP, see:
00182         // http://go.microsoft.com/fwlink/?LinkId=286690
00183         DX::ThrowIfFailed(
00184             D3D11CreateDevice(
00185                 nullptr,              // Use the default DXGI adapter for WARP.
00186                 D3D_DRIVER_TYPE_WARP, // Create a WARP device instead of a hardware device.
00187                 0,
00188                 creationFlags,
00189                 featureLevels,
00190                 ARRAYSIZE(featureLevels),
00191                 D3D11_SDK_VERSION,
00192                 &device,
00193                 &m_d3dFeatureLevel,
00194                 &context
00195                 )
00196             );
00197     }
00198
00199     // Store pointers to the Direct3D device and immediate context.
00200     DX::ThrowIfFailed(
00201         device.As(&m_d3dDevice)
00202         );
00203
00204     DX::ThrowIfFailed(
00205         context.As(&m_d3dContext)
00206         );
00207
00208     // Acquire the DXGI interface for the Direct3D device.
00209     ComPtr<IDXGIDevice3> dxgiDevice;
00210     DX::ThrowIfFailed(
00211         m_d3dDevice.As(&dxgiDevice)
00212         );
00213
00214     // Wrap the native device using a WinRT interop object.
00215     m_d3dInteropDevice = CreateDirect3DDevice(dxgiDevice.Get());
00216
00217     // Cache the DXGI adapter.
00218     // This is for the case of no preferred DXGI adapter, or fallback to WARP.
00219     ComPtr<IDXGIAdapter> dxgiAdapter;
00220     DX::ThrowIfFailed(
00221         dxgiDevice->GetAdapter(&dxgiAdapter)
00222         );
00223     DX::ThrowIfFailed(
00224         dxgiAdapter.As(&m_dxgiAdapter)
00225         );
00226
00227     // Check for device support for the optional feature that allows setting the render target array index from the vertex shader stage.
00228     D3D11_FEATURE_DATA_D3D11_OPTIONS3 options;
00229     m_d3dDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS3, &options, sizeof(options));
00230     if (options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer)
00231     {
00232         m_supportsVprt = true;
00233     }
00234 }
00235
00236 // Validates the back buffer for each HolographicCamera and recreates
00237 // resources for back buffers that have changed.
00238 // Locks the set of holographic camera resources until the function exits.
00239 void DX::DeviceResources::EnsureCameraResources(
00240     HolographicFrame^ frame,
00241     HolographicFramePrediction^ prediction)
00242 {
00243     UseHolographicCameraResources<void>([this, frame, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00244     {
00245         for (const auto& pose : prediction->CameraPoses)
00246         {
00247             HolographicCameraRenderingParameters^ renderingParameters = frame->GetRenderingParameters(pose);
00248             CameraResources* pCameraResources = cameraResourceMap[pose->HolographicCamera->Id].get();
00249
00250             pCameraResources->CreateResourcesForBackBuffer(this, renderingParameters);
00251         }
00252     });
00253 }
00254
00255 // Prepares to allocate resources and adds resource views for a camera.
00256 // Locks the set of holographic camera resources until the function exits.
00257 void DX::DeviceResources::AddHolographicCamera(HolographicCamera^ camera)
00258 {
00259     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00260     {
00261         cameraResourceMap[camera->Id] = std::make_unique<CameraResources>(camera);
00262     });
00263 }
00264
00265 // Deallocates resources for a camera and removes the camera from the set.
00266 // Locks the set of holographic camera resources until the function exits.
00267 void DX::DeviceResources::RemoveHolographicCamera(HolographicCamera^ camera)
00268 {
00269     UseHolographicCameraResources<void>([this, camera](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00270     {
00271         CameraResources* pCameraResources = cameraResourceMap[camera->Id].get();
00272
00273         if (pCameraResources != nullptr)
00274         {
00275             pCameraResources->ReleaseResourcesForBackBuffer(this);
00276             cameraResourceMap.erase(camera->Id);
00277         }
00278     });
00279 }
00280
00281 // Recreate all device resources and set them back to the current state.
00282 // Locks the set of holographic camera resources until the function exits.
00283 void DX::DeviceResources::HandleDeviceLost()
00284 {
00285     if (m_deviceNotify != nullptr)
00286     {
00287         m_deviceNotify->OnDeviceLost();
00288     }
00289
00290     UseHolographicCameraResources<void>([this](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00291     {
00292         for (auto& pair : cameraResourceMap)
00293         {
00294             CameraResources* pCameraResources = pair.second.get();
00295             pCameraResources->ReleaseResourcesForBackBuffer(this);
00296         }
00297     });
00298
00299     InitializeUsingHolographicSpace();
00300
00301     if (m_deviceNotify != nullptr)
00302     {
00303         m_deviceNotify->OnDeviceRestored();
00304     }
00305 }
00306
00307 // Register our DeviceNotify to be informed on device lost and creation.
00308 void DX::DeviceResources::RegisterDeviceNotify(DX::IDeviceNotify* deviceNotify)
00309 {
00310     m_deviceNotify = deviceNotify;
00311 }
00312
00313 // Call this method when the app suspends. It provides a hint to the driver that the app
00314 // is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
00315 void DX::DeviceResources::Trim()
00316 {
00317     m_d3dContext->ClearState();
00318
00319     ComPtr<IDXGIDevice3> dxgiDevice;
00320     DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
00321     dxgiDevice->Trim();
00322 }
00323
00324 // Present the contents of the swap chain to the screen.
00325 // Locks the set of holographic camera resources until the function exits.
00326 void DX::DeviceResources::Present(HolographicFrame^ frame)
00327 {
00328     // By default, this API waits for the frame to finish before it returns.
00329     // Holographic apps should wait for the previous frame to finish before
00330     // starting work on a new frame. This allows for better results from
00331     // holographic frame predictions.
00332     HolographicFramePresentResult presentResult = frame->PresentUsingCurrentPrediction();
00333
00334     HolographicFramePrediction^ prediction = frame->CurrentPrediction;
00335     UseHolographicCameraResources<void>([this, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
00336     {
00337         for (auto cameraPose : prediction->CameraPoses)
00338         {
00339             // This represents the device-based resources for a HolographicCamera.
00340             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00341
00342             // Discard the contents of the render target.
00343             // This is a valid operation only when the existing contents will be
00344             // entirely overwritten. If dirty or scroll rects are used, this call
00345             // should be removed.
00346             m_d3dContext->DiscardView(pCameraResources->GetBackBufferRenderTargetView());
00347
00348             // Discard the contents of the depth stencil.
00349             m_d3dContext->DiscardView(pCameraResources->GetDepthStencilView());
00350         }
00351     });
00352
00353     // The PresentUsingCurrentPrediction API will detect when the graphics device
00354     // changes or becomes invalid. When this happens, it is considered a Direct3D
00355     // device lost scenario.
00356     if (presentResult == HolographicFramePresentResult::DeviceRemoved)
00357     {
00358         // The Direct3D device, context, and resources should be recreated.
00359         HandleDeviceLost();
00360     }
00361 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cs/MainPage.xaml.cs Source File

  • CameraVideoStabilization
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #define USE_VS_RECOMMENDATION
00013
00014 using System;
00015 using System.Diagnostics;
00016 using System.Linq;
00017 using System.Threading.Tasks;
00018 using Windows.ApplicationModel;
00019 using Windows.Devices.Enumeration;
00020 using Windows.Devices.Sensors;
00021 using Windows.Foundation;
00022 using Windows.Foundation.Metadata;
00023 using Windows.Graphics.Display;
00024 using Windows.Media;
00025 using Windows.Media.Capture;
00026 using Windows.Media.Core;
00027 using Windows.Media.MediaProperties;
00028 using Windows.Storage;
00029 using Windows.Storage.FileProperties;
00030 using Windows.System.Display;
00031 using Windows.UI.Core;
00032 using Windows.UI.Xaml;
00033 using Windows.UI.Xaml.Controls;
00034 using Windows.UI.Xaml.Input;
00035 using Windows.UI.Xaml.Media;
00036 using Windows.UI.Xaml.Navigation;
00037
00038 namespace CameraVideoStabilization
00039 {
00040
00041     public sealed partial class MainPage : Page
00042     {
00043         // Receive notifications about rotation of the device and UI and apply any necessary rotation to the preview stream and UI controls
00044         private readonly DisplayInformation _displayInformation = DisplayInformation.GetForCurrentView();
00045         private readonly SimpleOrientationSensor _orientationSensor = SimpleOrientationSensor.GetDefault();
00046         private SimpleOrientation _deviceOrientation = SimpleOrientation.NotRotated;
00047         private DisplayOrientations _displayOrientation = DisplayOrientations.Portrait;
00048
00049         // Rotation metadata to apply to the preview stream and recorded videos (MF_MT_VIDEO_ROTATION)
00050         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00051         private static readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1");
00052
00053         // Folder in which the captures will be stored (initialized in SetupUiAsync)
00054         private StorageFolder _captureFolder = null;
00055
00056         // Prevent the screen from sleeping while the camera is running
00057         private readonly DisplayRequest _displayRequest = new DisplayRequest();
00058
00059         // For listening to media property changes
00060         private readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView();
00061
00062         // MediaCapture and its state variables
00063         private MediaCapture _mediaCapture;
00064         private bool _isInitialized;
00065         private bool _isPreviewing;
00066         private bool _isRecording;
00067         private MediaEncodingProfile _encodingProfile;
00068
00069         // Information about the camera device
00070         private bool _mirroringPreview;
00071         private bool _externalCamera;
00072
00073         private VideoStabilizationEffect _videoStabilizationEffect;
00074         private VideoEncodingProperties _inputPropertiesBackup;
00075         private VideoEncodingProperties _outputPropertiesBackup;
00076
00077         #region Constructor, lifecycle and navigation
00078
00079         public MainPage()
00080         {
00081             this.InitializeComponent();
00082
00083             // Do not cache the state of the UI when suspending/navigating
00084             NavigationCacheMode = NavigationCacheMode.Disabled;
00085
00086             // Useful to know when to initialize/clean up the camera
00087             Application.Current.Suspending += Application_Suspending;
00088             Application.Current.Resuming += Application_Resuming;
00089         }
00090
00091         private async void Application_Suspending(object sender, SuspendingEventArgs e)
00092         {
00093             // Handle global application events only if this page is active
00094             if (Frame.CurrentSourcePageType == typeof(MainPage))
00095             {
00096                 var deferral = e.SuspendingOperation.GetDeferral();
00097
00098                 await CleanupCameraAsync();
00099
00100                 await CleanupUiAsync();
00101
00102                 deferral.Complete();
00103             }
00104         }
00105
00106         private async void Application_Resuming(object sender, object o)
00107         {
00108             // Handle global application events only if this page is active
00109             if (Frame.CurrentSourcePageType == typeof(MainPage))
00110             {
00111                 await SetupUiAsync();
00112
00113                 await InitializeCameraAsync();
00114             }
00115         }
00116
00117         protected override async void OnNavigatedTo(NavigationEventArgs e)
00118         {
00119             await SetupUiAsync();
00120
00121             await InitializeCameraAsync();
00122         }
00123
00124         protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
00125         {
00126             // Handling of this event is included for completeness, as it will only fire when navigating between pages and this sample only includes one page
00127
00128             await CleanupCameraAsync();
00129
00130             await CleanupUiAsync();
00131         }
00132
00133         #endregion Constructor, lifecycle and navigation
00134
00135
00136         #region Event handlers
00137
00138         /// <summary>
00139         /// In the event of the app being minimized this method handles media property change events. If the app receives a mute
00140         /// notification, it is no longer in the foregroud.
00141         /// </summary>
00142         /// <param name="sender"></param>
00143         /// <param name="args"></param>
00144         private async void SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
00145         {
00146             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00147             {
00148                 // Only handle this event if this page is currently being displayed
00149                 if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
00150                 {
00151                     // Check to see if the app is being muted. If so, it is being minimized.
00152                     // Otherwise if it is not initialized, it is being brought into focus.
00153                     if (sender.SoundLevel == SoundLevel.Muted)
00154                     {
00155                         await CleanupCameraAsync();
00156                     }
00157                     else if (!_isInitialized)
00158                     {
00159                         await InitializeCameraAsync();
00160                     }
00161                 }
00162             });
00163         }
00164
00165         /// <summary>
00166         /// Occurs each time the simple orientation sensor reports a new sensor reading.
00167         /// </summary>
00168         /// <param name="sender">The event source.</param>
00169         /// <param name="args">The event data.</param>
00170         private async void OrientationSensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
00171         {
00172             if (args.Orientation != SimpleOrientation.Faceup && args.Orientation != SimpleOrientation.Facedown)
00173             {
00174                 // Only update the current orientation if the device is not parallel to the ground. This allows users to take pictures of documents (FaceUp)
00175                 // or the ceiling (FaceDown) in portrait or landscape, by first holding the device in the desired orientation, and then pointing the camera
00176                 // either up or down, at the desired subject.
00177                 //Note: This assumes that the camera is either facing the same way as the screen, or the opposite way. For devices with cameras mounted
00178                 //      on other panels, this logic should be adjusted.
00179                 _deviceOrientation = args.Orientation;
00180
00181                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
00182             }
00183         }
00184
00185         /// <summary>
00186         /// This event will fire when the page is rotated, when the DisplayInformation.AutoRotationPreferences value set in the SetupUiAsync() method cannot be not honored.
00187         /// </summary>
00188         /// <param name="sender">The event source.</param>
00189         /// <param name="args">The event data.</param>
00190         private async void DisplayInformation_OrientationChanged(DisplayInformation sender, object args)
00191         {
00192             _displayOrientation = sender.CurrentOrientation;
00193
00194             if (_isPreviewing)
00195             {
00196                 await SetPreviewRotationAsync();
00197             }
00198
00199             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
00200         }
00201
00202         private async void VsToggleButton_Click(object sender, RoutedEventArgs e)
00203         {
00204             // Note that for the most part, this button is disabled during recording, except when VS is turned off automatically
00205
00206             if (!_isRecording)
00207             {
00208                 // While *not* recording, either the effect doesn't exist (and should be created) or it exists and is enabled.
00209                 // This sample doesn't allow the user to disable the effect while recording. For the case that the effect disables
00210                 // itself while recording, StopRecordingAsync() will clean up the effect after the recording session ends.
00211
00212                 if (_videoStabilizationEffect == null)
00213                 {
00214                     // VS didn't exist, so create and enable the effect
00215                     await CreateVideoStabilizationEffectAsync();
00216                 }
00217                 else if (_videoStabilizationEffect.Enabled)
00218                 {
00219                     // VS was enabled, so clean it up and restore any capture settings (MediaStreamType and EncodingProfile)
00220                     await CleanUpVideoStabilizationEffectAsync();
00221                 }
00222             }
00223             else if (!_videoStabilizationEffect.Enabled)
00224             {
00225                 // While recording this button is diabled. The situation the user is allowed to tap it while recording, is when
00226                 // VS turns itself off (see VideoStabilizationEffect_EnabledChanged), so proceed to re-enable the effect
00227                 _videoStabilizationEffect.Enabled = true;
00228             }
00229
00230             UpdateCaptureControls();
00231         }
00232
00233         private async void VideoButton_Click(object sender, RoutedEventArgs e)
00234         {
00235             if (!_isRecording)
00236             {
00237                 await StartRecordingAsync();
00238             }
00239             else
00240             {
00241                 await StopRecordingAsync();
00242             }
00243
00244             // After starting or stopping video recording, update the UI to reflect the MediaCapture state
00245             UpdateCaptureControls();
00246         }
00247
00248         /// <summary>
00249         /// Triggers when the Enabled property of the VideoStabilizationEffect changes.
00250         /// </summary>
00251         /// <param name="sender">The instance of the effect firing the event.</param>
00252         /// <param name="args">Information about the event.</param>
00253         private async void VideoStabilizationEffect_EnabledChanged(VideoStabilizationEffect sender, VideoStabilizationEffectEnabledChangedEventArgs args)
00254         {
00255             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00256             {
00257                 Debug.WriteLine("VS Enabled: " + sender.Enabled + ". Reason: " + args.Reason);
00258
00259                 // Update buttons to reflect the new state
00260                 UpdateCaptureControls();
00261             });
00262         }
00263
00264         private async void MediaCapture_RecordLimitationExceeded(MediaCapture sender)
00265         {
00266             // This is a notification that recording has to stop, and the app is expected to finalize the recording
00267
00268             await StopRecordingAsync();
00269
00270             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
00271         }
00272
00273         private async void MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
00274         {
00275             Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);
00276
00277             await CleanupCameraAsync();
00278
00279             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
00280         }
00281
00282         #endregion Event handlers
00283
00284
00285         #region MediaCapture methods
00286
00287         /// <summary>
00288         /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI
00289         /// </summary>
00290         /// <returns></returns>
00291         private async Task InitializeCameraAsync()
00292         {
00293             Debug.WriteLine("InitializeCameraAsync");
00294
00295             if (_mediaCapture == null)
00296             {
00297                 // Attempt to get the back camera if one is available, but use any camera device if not
00298                 var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);
00299
00300                 if (cameraDevice == null)
00301                 {
00302                     Debug.WriteLine("No camera device found!");
00303                     return;
00304                 }
00305
00306                 // Create MediaCapture and its settings
00307                 _mediaCapture = new MediaCapture();
00308
00309                 // Register for a notification when video recording has reached the maximum time and when something goes wrong
00310                 _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
00311                 _mediaCapture.Failed += MediaCapture_Failed;
00312
00313                 var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };
00314
00315                 // Initialize MediaCapture
00316                 try
00317                 {
00318                     await _mediaCapture.InitializeAsync(settings);
00319                     _isInitialized = true;
00320                 }
00321                 catch (UnauthorizedAccessException)
00322                 {
00323                     Debug.WriteLine("The app was denied access to the camera");
00324                 }
00325
00326                 // Set up the encoding profile for video recording
00327                 _encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);
00328
00329                 // If initialization succeeded, start the preview
00330                 if (_isInitialized)
00331                 {
00332                     // Figure out where the camera is located
00333                     if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
00334                     {
00335                         // No information on the location of the camera, assume it's an external camera, not integrated on the device
00336                         _externalCamera = true;
00337                     }
00338                     else
00339                     {
00340                         // Camera is fixed on the device
00341                         _externalCamera = false;
00342
00343                         // Only mirror the preview if the camera is on the front panel
00344                         _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
00345                     }
00346
00347                     await StartPreviewAsync();
00348
00349                     UpdateCaptureControls();
00350                 }
00351             }
00352         }
00353
00354         /// <summary>
00355         /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on
00356         /// </summary>
00357         /// <returns></returns>
00358         private async Task StartPreviewAsync()
00359         {
00360             // Prevent the device from sleeping while the preview is running
00361             _displayRequest.RequestActive();
00362
00363             // Set the preview source in the UI and mirror it if necessary
00364             PreviewControl.Source = _mediaCapture;
00365             PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
00366
00367             // Start the preview
00368             await _mediaCapture.StartPreviewAsync();
00369             _isPreviewing = true;
00370
00371             // Initialize the preview to the current orientation
00372             if (_isPreviewing)
00373             {
00374                 await SetPreviewRotationAsync();
00375             }
00376         }
00377
00378         /// <summary>
00379         /// Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview
00380         /// </summary>
00381         private async Task SetPreviewRotationAsync()
00382         {
00383             // Only need to update the orientation if the camera is mounted on the device
00384             if (_externalCamera) return;
00385
00386             // Calculate which way and how far to rotate the preview
00387             int rotationDegrees = ConvertDisplayOrientationToDegrees(_displayOrientation);
00388
00389             // The rotation direction needs to be inverted if the preview is being mirrored
00390             if (_mirroringPreview)
00391             {
00392                 rotationDegrees = (360 - rotationDegrees) % 360;
00393             }
00394
00395             // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
00396             var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
00397             props.Properties.Add(RotationKey, rotationDegrees);
00398             await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
00399         }
00400
00401         /// <summary>
00402         /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes
00403         /// </summary>
00404         /// <returns></returns>
00405         private async Task StopPreviewAsync()
00406         {
00407             // Stop the preview
00408             _isPreviewing = false;
00409             await _mediaCapture.StopPreviewAsync();
00410
00411             // Use the dispatcher because this method is sometimes called from non-UI threads
00412             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00413             {
00414                 // Cleanup the UI
00415                 PreviewControl.Source = null;
00416
00417                 // Allow the device screen to sleep now that the preview is stopped
00418                 _displayRequest.RequestRelease();
00419             });
00420         }
00421
00422         /// <summary>
00423         /// Adds video stabilization to the video record stream, registers for its event, enables it, and gets the effect instance
00424         /// </summary>
00425         /// <returns></returns>
00426         private async Task CreateVideoStabilizationEffectAsync()
00427         {
00428             // No work to be done if there already is an effect
00429             if (_videoStabilizationEffect != null) return;
00430
00431             // Create the definition, which will contain some initialization settings
00432             var definition = new VideoStabilizationEffectDefinition();
00433
00434             // Add the effect to the video record stream
00435             _videoStabilizationEffect = (VideoStabilizationEffect)await _mediaCapture.AddVideoEffectAsync(definition, MediaStreamType.VideoRecord);
00436
00437             Debug.WriteLine("VS effect added to pipeline");
00438
00439             // Subscribe to notifications for changes in the enabled state for the effect
00440             _videoStabilizationEffect.EnabledChanged += VideoStabilizationEffect_EnabledChanged;
00441
00442             // Enable the effect
00443             _videoStabilizationEffect.Enabled = true;
00444
00445 #if (USE_VS_RECOMMENDATION)
00446
00447             // Configure the pipeline to use the optimal settings for VS
00448             await SetUpVideoStabilizationRecommendationAsync();
00449
00450             // At this point, one of two things has happened:
00451             //
00452             // a) If a more suitable capture resolution was available:
00453             //    1. Such resolution will have been set up for video capture ("input")
00454             //    2. The MediaEncodingProfile ("output") will have been changed to specify dimensions reflecting the amount of cropping
00455             //       done on said capture resolution (possibly even none if the new resolution offers enough padding)
00456             // b) If no better suited capture resolution was available:
00457             //    1. The video capture resolution will not have changed
00458             //    2. The MediaEncodingProfile will have been changed to specify smaller dimensions than the capture resolution
00459             //       so that the video isn't scaled back up to the capture resolution after cropping, which could cause a loss in quality
00460 #else
00461             Debug.WriteLine("Not setting up VS recommendation");
00462
00463             // Not setting up VS recommendation means that the video will be captured at the desired resolution,
00464             // then cropped by the VS effect as part of the stabilization process, and then scaled back up to the
00465             // original capture resolution
00466 #endif
00467         }
00468
00469         /// <summary>
00470         /// Configures the pipeline to use the optimal resolutions for VS based on the settings currently in use
00471         /// </summary>
00472         /// <returns></returns>
00473         private async Task SetUpVideoStabilizationRecommendationAsync()
00474         {
00475             Debug.WriteLine("Setting up VS recommendation...");
00476
00477             // Get the recommendation from the effect based on our current input and output configuration
00478             var recommendation = _videoStabilizationEffect.GetRecommendedStreamConfiguration(_mediaCapture.VideoDeviceController, _encodingProfile.Video);
00479
00480             // Handle the recommendation for the input into the effect, which can contain a larger resolution than currently configured, so cropping is minimized
00481             if (recommendation.InputProperties != null)
00482             {
00483                 // Back up the current input properties from before VS was activated
00484                 _inputPropertiesBackup = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoRecord) as VideoEncodingProperties;
00485
00486                 // Set the recommendation from the effect (a resolution higher than the current one to allow for cropping) on the input
00487                 await _mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, recommendation.InputProperties);
00488                 Debug.WriteLine("VS recommendation for the MediaStreamProperties (input) has been applied");
00489             }
00490
00491             // Handle the recommendations for the output from the effect
00492             if (recommendation.OutputProperties != null)
00493             {
00494                 // Back up the current output properties from before VS was activated
00495                 _outputPropertiesBackup = _encodingProfile.Video;
00496
00497                 // Apply the recommended encoding profile for the output, which will result in a video with the same dimensions as configured
00498                 // before VideoStabilization was added if an appropriate padded capture resolution was available. Otherwise, it will be slightly
00499                 // smaller (due to cropping). This prevents upscaling back to the original size, which can result in a loss of quality
00500                 _encodingProfile.Video = recommendation.OutputProperties;
00501                 Debug.WriteLine("VS recommendation for the MediaEncodingProfile (output) has been applied");
00502             }
00503         }
00504
00505         /// <summary>
00506         ///  Disables and removes the video stabilization effect, and unregisters the event handler for the EnabledChanged event of the effect
00507         /// </summary>
00508         /// <returns></returns>
00509         private async Task CleanUpVideoStabilizationEffectAsync()
00510         {
00511             // No work to be done if there is no effect
00512             if (_videoStabilizationEffect == null) return;
00513
00514             // Disable the effect
00515             _videoStabilizationEffect.Enabled = false;
00516
00517             _videoStabilizationEffect.EnabledChanged -= VideoStabilizationEffect_EnabledChanged;
00518
00519             // Remove the effect (see ClearEffectsAsync method to remove all effects from a stream)
00520             await _mediaCapture.RemoveEffectAsync(_videoStabilizationEffect);
00521
00522             Debug.WriteLine("VS effect removed from pipeline");
00523
00524             // If backed up settings (stream properties and encoding profile) exist, restore them and clear the backups
00525             if (_inputPropertiesBackup != null)
00526             {
00527                 await _mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoRecord, _inputPropertiesBackup);
00528                 _inputPropertiesBackup = null;
00529             }
00530
00531             if (_outputPropertiesBackup != null)
00532             {
00533                 _encodingProfile.Video = _outputPropertiesBackup;
00534                 _outputPropertiesBackup = null;
00535             }
00536
00537             // Clear the member variable that held the effect instance
00538             _videoStabilizationEffect = null;
00539         }
00540
00541         /// <summary>
00542         /// Records an MP4 video to a StorageFile and adds rotation metadata to it
00543         /// </summary>
00544         /// <returns></returns>
00545         private async Task StartRecordingAsync()
00546         {
00547             try
00548             {
00549                 // Create storage file for the capture
00550                 var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);
00551
00552                 // Calculate rotation angle, taking mirroring into account if necessary
00553                 var rotationAngle = 360 - ConvertDeviceOrientationToDegrees(GetCameraOrientation());
00554
00555                 // Add it to the encoding profile, or edit the value if the GUID was already a part of the properties
00556                 _encodingProfile.Video.Properties[RotationKey] = PropertyValue.CreateInt32(rotationAngle);
00557
00558                 Debug.WriteLine("Starting recording to " + videoFile.Path);
00559
00560                 await _mediaCapture.StartRecordToStorageFileAsync(_encodingProfile, videoFile);
00561                 _isRecording = true;
00562
00563                 Debug.WriteLine("Started recording to: " + videoFile.Path);
00564             }
00565             catch (Exception ex)
00566             {
00567                 // File I/O errors are reported as exceptions
00568                 Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
00569             }
00570         }
00571
00572         /// <summary>
00573         /// Stops recording a video
00574         /// </summary>
00575         /// <returns></returns>
00576         private async Task StopRecordingAsync()
00577         {
00578             try
00579             {
00580                 Debug.WriteLine("Stopping recording...");
00581
00582                 _isRecording = false;
00583                 await _mediaCapture.StopRecordAsync();
00584
00585                 // If VS disabled itself during recording, clean up the effect
00586                 if (_videoStabilizationEffect != null && !_videoStabilizationEffect.Enabled)
00587                 {
00588                     // Cleaning up the effect here is an implementation choice in this sample, so that, at the end of the recording, it's clearer
00589                     // to the user that the effect turned itself off. Alternatively, one could try to re-enable the effect (e.g. if the reason
00590                     // it disabled itself was RunningSlowly, there's a chance it will work next time), and/or prompt the user to choose a lower capture
00591                     // resolution / framerate instead.
00592                     await CleanUpVideoStabilizationEffectAsync();
00593                 }
00594
00595                 Debug.WriteLine("Stopped recording!");
00596             }
00597             catch (Exception ex)
00598             {
00599                 // File I/O errors are reported as exceptions
00600                 Debug.WriteLine("Exception when stopping video recording: " + ex.ToString());
00601             }
00602         }
00603
00604         /// <summary>
00605         /// Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events
00606         /// </summary>
00607         /// <returns></returns>
00608         private async Task CleanupCameraAsync()
00609         {
00610             Debug.WriteLine("CleanupCameraAsync");
00611
00612             if (_isInitialized)
00613             {
00614                 // If a recording is in progress during cleanup, stop it to save the recording
00615                 if (_isRecording)
00616                 {
00617                     await StopRecordingAsync();
00618                 }
00619
00620                 // Clear the effect if one exists
00621                 if (_videoStabilizationEffect != null)
00622                 {
00623                     await CleanUpVideoStabilizationEffectAsync();
00624                 }
00625
00626                 if (_isPreviewing)
00627                 {
00628                     // The call to stop the preview is included here for completeness, but can be
00629                     // safely removed if a call to MediaCapture.Dispose() is being made later,
00630                     // as the preview will be automatically stopped at that point
00631                     await StopPreviewAsync();
00632                 }
00633
00634                 _isInitialized = false;
00635             }
00636
00637             if (_mediaCapture != null)
00638             {
00639                 _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
00640                 _mediaCapture.Failed -= MediaCapture_Failed;
00641                 _mediaCapture.Dispose();
00642                 _mediaCapture = null;
00643             }
00644         }
00645
00646 #endregion MediaCapture methods
00647
00648
00649         #region Helper functions
00650
00651         /// <summary>
00652         /// Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors
00653         /// </summary>
00654         /// <returns></returns>
00655         private async Task SetupUiAsync()
00656         {
00657             // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
00658             DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
00659
00660             // Hide the status bar
00661             if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
00662             {
00663                 await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
00664             }
00665
00666             // Populate orientation variables with the current state
00667             _displayOrientation = _displayInformation.CurrentOrientation;
00668             if (_orientationSensor != null)
00669             {
00670                 _deviceOrientation = _orientationSensor.GetCurrentOrientation();
00671             }
00672
00673             RegisterEventHandlers();
00674
00675             var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
00676             // Fall back to the local app storage if the Pictures Library is not available
00677             _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
00678         }
00679
00680         /// <summary>
00681         /// Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock
00682         /// </summary>
00683         /// <returns></returns>
00684         private async Task CleanupUiAsync()
00685         {
00686             UnregisterEventHandlers();
00687
00688             // Show the status bar
00689             if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
00690             {
00691                 await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
00692             }
00693
00694             // Revert orientation preferences
00695             DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
00696         }
00697
00698         /// <summary>
00699         /// This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device
00700         /// </summary>
00701         private void UpdateCaptureControls()
00702         {
00703             // The button should only be enabled if the preview started sucessfully
00704             VideoButton.IsEnabled = _isPreviewing;
00705
00706             // Allow toggling VS only while not recording or when the effect exists but it has been disabled
00707             VsToggleButton.IsEnabled = (_isPreviewing && !_isRecording) ||
00708                                        (_videoStabilizationEffect != null && !_videoStabilizationEffect.Enabled);
00709
00710             // Update recording button to show "Stop" icon instead of red "Record" icon
00711             StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
00712             StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;
00713
00714             // Show "VS On" icon when effect exists and is enabled, otherwise show "VS Off icon"
00715             if (_videoStabilizationEffect != null && _videoStabilizationEffect.Enabled)
00716             {
00717                 VsOnIcon.Visibility = Visibility.Visible;
00718                 VsOffIcon.Visibility = Visibility.Collapsed;
00719             }
00720             else
00721             {
00722                 VsOnIcon.Visibility = Visibility.Collapsed;
00723                 VsOffIcon.Visibility = Visibility.Visible;
00724             }
00725         }
00726
00727         /// <summary>
00728         /// Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation
00729         /// </summary>
00730         private void RegisterEventHandlers()
00731         {
00732             // If there is an orientation sensor present on the device, register for notifications
00733             if (_orientationSensor != null)
00734             {
00735                 _orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;
00736
00737                 // Update orientation of buttons with the current orientation
00738                 UpdateButtonOrientation();
00739             }
00740
00741             _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged;
00742             _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
00743         }
00744
00745         /// <summary>
00746         /// Unregisters event handlers for hardware buttons and orientation sensors
00747         /// </summary>
00748         private void UnregisterEventHandlers()
00749         {
00750             if (_orientationSensor != null)
00751             {
00752                 _orientationSensor.OrientationChanged -= OrientationSensor_OrientationChanged;
00753             }
00754
00755             _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged;
00756             _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
00757         }
00758
00759         /// <summary>
00760         /// Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed
00761         /// </summary>
00762         /// <param name="desiredPanel">The desired panel on which the returned device should be mounted, if available</param>
00763         /// <returns></returns>
00764         private static async Task<DeviceInformation> FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel)
00765         {
00766             // Get available devices for capturing pictures
00767             var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00768
00769             // Get the desired camera by panel
00770             DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);
00771
00772             // If there is no device mounted on the desired panel, return the first device found
00773             return desiredDevice ?? allVideoDevices.FirstOrDefault();
00774         }
00775
00776         #endregion Helper functions
00777
00778
00779         #region Rotation helpers
00780
00781         /// <summary>
00782         /// Calculates the current camera orientation from the device orientation by taking into account whether the camera is external or facing the user
00783         /// </summary>
00784         /// <returns>The camera orientation in space, with an inverted rotation in the case the camera is mounted on the device and is facing the user</returns>
00785         private SimpleOrientation GetCameraOrientation()
00786         {
00787             if (_externalCamera)
00788             {
00789                 // Cameras that are not attached to the device do not rotate along with it, so apply no rotation
00790                 return SimpleOrientation.NotRotated;
00791             }
00792
00793             var result = _deviceOrientation;
00794
00795             // Account for the fact that, on portrait-first devices, the camera sensor is mounted at a 90 degree offset to the native orientation
00796             if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
00797             {
00798                 switch (result)
00799                 {
00800                     case SimpleOrientation.Rotated90DegreesCounterclockwise:
00801                         result = SimpleOrientation.NotRotated;
00802                         break;
00803                     case SimpleOrientation.Rotated180DegreesCounterclockwise:
00804                         result = SimpleOrientation.Rotated90DegreesCounterclockwise;
00805                         break;
00806                     case SimpleOrientation.Rotated270DegreesCounterclockwise:
00807                         result = SimpleOrientation.Rotated180DegreesCounterclockwise;
00808                         break;
00809                     case SimpleOrientation.NotRotated:
00810                         result = SimpleOrientation.Rotated270DegreesCounterclockwise;
00811                         break;
00812                 }
00813             }
00814
00815             // If the preview is being mirrored for a front-facing camera, then the rotation should be inverted
00816             if (_mirroringPreview)
00817             {
00818                 // This only affects the 90 and 270 degree cases, because rotating 0 and 180 degrees is the same clockwise and counter-clockwise
00819                 switch (result)
00820                 {
00821                     case SimpleOrientation.Rotated90DegreesCounterclockwise:
00822                         return SimpleOrientation.Rotated270DegreesCounterclockwise;
00823                     case SimpleOrientation.Rotated270DegreesCounterclockwise:
00824                         return SimpleOrientation.Rotated90DegreesCounterclockwise;
00825                 }
00826             }
00827
00828             return result;
00829         }
00830
00831         /// <summary>
00832         /// Converts the given orientation of the device in space to the corresponding rotation in degrees
00833         /// </summary>
00834         /// <param name="orientation">The orientation of the device in space</param>
00835         /// <returns>An orientation in degrees</returns>
00836         private static int ConvertDeviceOrientationToDegrees(SimpleOrientation orientation)
00837         {
00838             switch (orientation)
00839             {
00840                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00841                     return 90;
00842                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00843                     return 180;
00844                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00845                     return 270;
00846                 case SimpleOrientation.NotRotated:
00847                 default:
00848                     return 0;
00849             }
00850         }
00851
00852         /// <summary>
00853         /// Converts the given orientation of the app on the screen to the corresponding rotation in degrees
00854         /// </summary>
00855         /// <param name="orientation">The orientation of the app on the screen</param>
00856         /// <returns>An orientation in degrees</returns>
00857         private static int ConvertDisplayOrientationToDegrees(DisplayOrientations orientation)
00858         {
00859             switch (orientation)
00860             {
00861                 case DisplayOrientations.Portrait:
00862                     return 90;
00863                 case DisplayOrientations.LandscapeFlipped:
00864                     return 180;
00865                 case DisplayOrientations.PortraitFlipped:
00866                     return 270;
00867                 case DisplayOrientations.Landscape:
00868                 default:
00869                     return 0;
00870             }
00871         }
00872
00873         /// <summary>
00874         /// Converts the given orientation of the device in space to the metadata that can be added to captured photos
00875         /// </summary>
00876         /// <param name="orientation">The orientation of the device in space</param>
00877         /// <returns></returns>
00878         private static PhotoOrientation ConvertOrientationToPhotoOrientation(SimpleOrientation orientation)
00879         {
00880             switch (orientation)
00881             {
00882                 case SimpleOrientation.Rotated90DegreesCounterclockwise:
00883                     return PhotoOrientation.Rotate90;
00884                 case SimpleOrientation.Rotated180DegreesCounterclockwise:
00885                     return PhotoOrientation.Rotate180;
00886                 case SimpleOrientation.Rotated270DegreesCounterclockwise:
00887                     return PhotoOrientation.Rotate270;
00888                 case SimpleOrientation.NotRotated:
00889                 default:
00890                     return PhotoOrientation.Normal;
00891             }
00892         }
00893
00894         /// <summary>
00895         /// Uses the current device orientation in space and page orientation on the screen to calculate the rotation
00896         /// transformation to apply to the controls
00897         /// </summary>
00898         private void UpdateButtonOrientation()
00899         {
00900             int device = ConvertDeviceOrientationToDegrees(_deviceOrientation);
00901             int display = ConvertDisplayOrientationToDegrees(_displayOrientation);
00902
00903             if (_displayInformation.NativeOrientation == DisplayOrientations.Portrait)
00904             {
00905                 device -= 90;
00906             }
00907
00908             // Combine both rotations and make sure that 0 <= result < 360
00909             var angle = (360 + display + device) % 360;
00910
00911             // Rotate the buttons in the UI to match the rotation of the device
00912             var transform = new RotateTransform { Angle = angle };
00913
00914             // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
00915             VsToggleButton.RenderTransform = transform;
00916             VideoButton.RenderTransform = transform;
00917         }
00918
00919         #endregion Rotation helpers
00920
00921     }
00922 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/Scenario3_CustomItems.xaml.h Source File

  • JumpList
  • cpp

Scenario3_CustomItems.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_CustomItems.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario3_CustomItems sealed
00021     {
00022     public:
00023         Scenario3_CustomItems();
00024
00025     private:
00026         void DisplayNameLocalizedResource_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00027         void DescriptionLocalizedResource_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00028         void GroupNameLocalizedResource_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00029         void AddToJumpList_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_Recurrence Member List

This is the complete list of members for Scenario6_Recurrence, including all inherited members.
Create_Click(object sender, RoutedEventArgs e) | Scenario6_Recurrence | [inline, private]
rootPage | Scenario6_Recurrence | [private]
Scenario6_Recurrence() | Scenario6_Recurrence | [inline]
Generated on Fri Nov 15 2024 22:23:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/DisplayHelpers.h Source File

  • WiFiScan
  • cpp

DisplayHelpers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Objbase.h"
00014
00015 namespace SDKTemplate
00016 {
00017     namespace WiFiScan
00018     {
00019         [Windows::UI::Xaml::Data::Bindable]
00020         public ref class WiFiNetworkDisplay sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
00021         {
00022         public:
00023
00024             WiFiNetworkDisplay(Windows::Devices::WiFi::WiFiAvailableNetwork^ availableNetwork, Windows::Devices::WiFi::WiFiAdapter^ adapter);
00025
00026             property Platform::String^ Ssid
00027             {
00028                 Platform::String^ get() { return AvailableNetwork->Ssid; }
00029             }
00030
00031             property Platform::String^ Bssid
00032             {
00033                 Platform::String^ get() { return AvailableNetwork->Bssid; }
00034             }
00035
00036             property Platform::String^ ChannelCenterFrequency
00037             {
00038                 Platform::String^ get() {
00039                     return AvailableNetwork->ChannelCenterFrequencyInKilohertz + L"kHz";
00040                 }
00041             }
00042
00043             property Platform::String^ Rssi
00044             {
00045                 Platform::String^ get() {
00046                     return AvailableNetwork->NetworkRssiInDecibelMilliwatts + L"dBm";
00047                 }
00048             }
00049
00050             property Platform::String^ SecuritySettings
00051             {
00052
00053                 Platform::String^ get()
00054                 {
00055                     return L"Authentication: " + GetNetworkAuthenticationTypeAsString(AvailableNetwork->SecuritySettings->NetworkAuthenticationType) +
00056                         L"; Encryption: " + GetNetworkEncryptionTypeAsString(AvailableNetwork->SecuritySettings->NetworkEncryptionType);
00057                 }
00058             }
00059
00060             property Windows::Devices::WiFi::WiFiAvailableNetwork^ AvailableNetwork;
00061             property Platform::String^ ConnectivityLevel;
00062             property Windows::UI::Xaml::Media::Imaging::BitmapImage^ WiFiImage;
00063             virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
00064
00065         protected:
00066             void OnPropertyChanged(Platform::String^ name);
00067
00068         internal:
00069             static Platform::String^ GetConnectionStatusAsString(Windows::Devices::WiFi::WiFiConnectionStatus connectionStatus);
00070             static Platform::String^ GetConnectivityLevelAsString(Windows::Networking::Connectivity::NetworkConnectivityLevel conectivityLevel);
00071             static Concurrency::task<void> UpdateConnectivityLevels(Windows::Foundation::Collections::IObservableVector<WiFiNetworkDisplay^>^ networkCollection, UINT current);
00072
00073         private:
00074             void UpdateWiFiImage();
00075             Concurrency::task<void> UpdateConnectivityLevel();
00076             Windows::Devices::WiFi::WiFiAdapter^ adapter;
00077             Platform::String^ GetNetworkAuthenticationTypeAsString(Windows::Networking::Connectivity::NetworkAuthenticationType  authenticationType);
00078             Platform::String^ GetNetworkEncryptionTypeAsString(Windows::Networking::Connectivity::NetworkEncryptionType encryptionType);
00079         };
00080
00081     }
00082 }
Generated on Fri Nov 15 2024 22:19:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S2_UpdateAndDeleteWithAPI.xaml.cs Source File

  • ContentIndexer
  • cs

S2_UpdateAndDeleteWithAPI.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using System.Collections.Generic;
00017 using Windows.Foundation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class S2_UpdateAndDeleteWithAPI
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         public S2_UpdateAndDeleteWithAPI()
00031         {
00032             this.InitializeComponent();
00033             Helpers.InitializeRevisionNumber();
00034         }
00035
00036         /// <summary>
00037         /// Invoked when this page is about to be displayed in a Frame.
00038         /// </summary>
00039         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00040         /// property is typically used to configure the page.</param>
00041         protected override void OnNavigatedTo(NavigationEventArgs e)
00042         {
00043         }
00044
00045         private async void AddToIndex_Click(object sender, RoutedEventArgs e)
00046         {
00047             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00048             string outputString = await Helpers.AddItemsToIndex(indexer);
00049             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00050         }
00051
00052         private async void UpdatePropertyHelper(string itemKey, string propertyKey, string propertyName, object newValue)
00053         {
00054             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00055             string[] propertiesToRetrieve = { propertyKey };
00056
00057             try
00058             {
00059                 // Log the original value of the property
00060                 var retrievedProperties = await indexer.RetrievePropertiesAsync(itemKey, propertiesToRetrieve);
00061                 var outputString = "Original " + propertyName + ": " + Helpers.StringifyProperty(retrievedProperties[propertyKey]);
00062
00063                 // Create an indexable content item to update the property
00064                 var content = new Windows.Storage.Search.IndexableContent();
00065                 content.Properties.Add(propertyKey, newValue);
00066                 content.Id = itemKey;
00067
00068                 // Update the indexer
00069                 Helpers.OnIndexerOperationBegin();
00070                 await indexer.UpdateAsync(content);
00071                 Helpers.OnIndexerOperationComplete(indexer);
00072
00073                 // Log the new value of the property
00074                 retrievedProperties = await indexer.RetrievePropertiesAsync(itemKey, propertiesToRetrieve);
00075                 outputString += "\nNew " + propertyName + ": " + Helpers.StringifyProperty(retrievedProperties[propertyKey]);
00076                 rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00077             }
00078             catch (Exception err)
00079             {
00080                 rootPage.NotifyUser("Exception thrown! Did you try to retrieve or update a property on a non-existent item?" +
00081                                     "\nMessage: " + err.Message +
00082                                     "\nHRESULT: " + String.Format("{0,8:X}", err.HResult),
00083                                     NotifyType.ErrorMessage);
00084             }
00085         }
00086
00087         /// <summary>
00088         /// This function updates the ItemNameDisplay property for the indexed item with the key "Sample 0." The
00089         /// updated ItemNameDisplay property comes from the itemNameInput text box.
00090         /// </summary>
00091         private void UpdateName_Click(object sender, RoutedEventArgs e)
00092         {
00093             UpdatePropertyHelper("SampleKey0", Windows.Storage.SystemProperties.ItemNameDisplay, "item name", ItemNameInput.Text);
00094         }
00095
00096         /// <summary>
00097         /// This function deletes the Keywords property for the indexed item with the key "Sample0."
00098         /// </summary>
00099         private void DeleteKeywords_Click(object sender, RoutedEventArgs e)
00100         {
00101             UpdatePropertyHelper("SampleKey0", Windows.Storage.SystemProperties.Keywords, "keywords", null);
00102         }
00103
00104         delegate IAsyncAction DeleteFunction(Windows.Storage.Search.ContentIndexer indexer);
00105
00106         private async void DeleteItemsHelper(DeleteFunction deleteFunction)
00107         {
00108             var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
00109
00110             // Log the original number of items
00111             string[] propertiesToRetrieve = { Windows.Storage.SystemProperties.ItemNameDisplay };
00112             var query = indexer.CreateQuery("*", propertiesToRetrieve);
00113             uint count = await query.GetCountAsync();
00114             var outputString = "Original number of items: " + count;
00115             Helpers.OnIndexerOperationBegin();
00116
00117             // Call the deletion function
00118             await deleteFunction(indexer);
00119
00120             // Log the new number of items
00121             Helpers.OnIndexerOperationComplete(indexer);
00122             query = indexer.CreateQuery("*", propertiesToRetrieve);
00123             count = await query.GetCountAsync();
00124             outputString += "\nNew number of items: " + count;
00125             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00126         }
00127
00128         /// <summary>
00129         /// This function deletes the indexed item with the key "SampleKey0" added to the index by this app via the
00130         /// ContentIndexer
00131         /// </summary>
00132         private void DeleteSingleItem_Click(object sender, RoutedEventArgs e)
00133         {
00134             DeleteItemsHelper(indexer => indexer.DeleteAsync("SampleKey0"));
00135         }
00136
00137         /// <summary>
00138         /// This function deletes the indexed items with the keys "SampleKey1" and "SampleKey2" added to the index
00139         /// by this app via the ContentIndexer
00140         /// </summary>
00141         private void DeleteMultipleItems_Click(object sender, RoutedEventArgs e)
00142         {
00143             string[] keys = { "SampleKey1", "SampleKey2" };
00144             DeleteItemsHelper(indexer => indexer.DeleteMultipleAsync(keys));
00145         }
00146
00147         /// <summary>
00148         /// This function deletes all items added to the index by this app via the ContentIndexer
00149         /// </summary>
00150         private void DeleteAllItems_Click(object sender, RoutedEventArgs e)
00151         {
00152             DeleteItemsHelper(indexer => indexer.DeleteAllAsync());
00153         }
00154     }
00155 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

handle_closer Member List

This is the complete list of members for handle_closer, including all inherited members.
operator()(HANDLE h) handle_closer [inline]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cppwinrt/SampleConfiguration.h Source File

  • BluetoothLE
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017     struct Constants
00018     {
00019         static constexpr guid CalcServiceUuid{ 0xcaecface, 0xe1d9, 0x11e6, { 0xbf, 0x01, 0xfe, 0x55, 0x13, 0x50, 0x34, 0xf0 } }; // {caecface-e1d9-11e6-bf01-fe55135034f0}
00020         static constexpr guid Op1CharacteristicUuid{ 0xcaecface, 0xe1d9, 0x11e6, { 0xbf, 0x01, 0xfe, 0x55, 0x13, 0x50, 0x34, 0xf1 } }; // {caecface-e1d9-11e6-bf01-fe55135034f1}
00021         static constexpr guid Op2CharacteristicUuid{ 0xcaecface, 0xe1d9, 0x11e6, { 0xbf, 0x01, 0xfe, 0x55, 0x13, 0x50, 0x34, 0xf2 } }; // {caecface-e1d9-11e6-bf01-fe55135034f2}
00022         static constexpr guid OperatorCharacteristicUuid{ 0xcaecface, 0xe1d9, 0x11e6, { 0xbf, 0x01, 0xfe, 0x55, 0x13, 0x50, 0x34, 0xf3 } }; // {caecface-e1d9-11e6-bf01-fe55135034f3}
00023         static constexpr guid ResultCharacteristicUuid{ 0xcaecface, 0xe1d9, 0x11e6, { 0xbf, 0x01, 0xfe, 0x55, 0x13, 0x50, 0x34, 0xf4 } }; // {caecface-e1d9-11e6-bf01-fe55135034f4}
00024     };
00025
00026     struct SampleState
00027     {
00028         static hstring SelectedBleDeviceId;
00029         static hstring SelectedBleDeviceName;
00030     };
00031
00032     Windows::Foundation::Rect GetElementRect(Windows::UI::Xaml::FrameworkElement const& element);
00033 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cs/SampleConfiguration.cs Source File

  • StreamSocket
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System.Collections.Generic;
00013 using Windows.UI.Xaml.Controls;using System;
00014
00015 namespace SDKTemplate
00016 {
00017     public partial class MainPage : Page
00018     {
00019         // This is used on the main page as the title of the sample.
00020         public const string FEATURE_NAME = "StreamSocket";
00021
00022         // Change the array below to reflect the name of your scenarios.
00023         // This will be used to populate the list of scenarios on the main page with
00024         // which the user will choose the specific scenario that they are interested in.
00025         // These should be in the form: "Navigating to a web page".
00026         // The code in MainPage will take care of turning this into: "1) Navigating to a web page"
00027         List<Scenario> scenarios = new List<Scenario>
00028         {
00029             new Scenario() { Title = "Start StreamSocketListener", ClassType = typeof(StreamSocketSample.Scenario1) },
00030             new Scenario() { Title = "Connect to Listener", ClassType = typeof(StreamSocketSample.Scenario2) },
00031             new Scenario() { Title = "Send Data", ClassType = typeof(StreamSocketSample.Scenario3) },
00032             new Scenario() { Title = "Close Socket", ClassType = typeof(StreamSocketSample.Scenario4) },
00033             new Scenario() { Title = "SSL/TLS Server Certificates", ClassType = typeof(StreamSocketSample.Scenario5) }
00034         };
00035     }
00036
00037     public class Scenario
00038     {
00039         public string Title { get; set; }
00040
00041         public Type ClassType { get; set; }
00042
00043         public override string ToString()
00044         {
00045             return Title;
00046         }
00047     }
00048 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario3_Region.xaml.cpp Source File

  • GlobalizationPreferences
  • cpp

Scenario3_Region.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario3_Region.xaml.h"
00013 #include "SampleConfiguration.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Globalization;
00022
00023 Scenario3_Region::Scenario3_Region()
00024 {
00025     InitializeComponent();
00026 }
00027
00028 String^ Scenario3_Region::ReportRegionData(GeographicRegion^ region)
00029 {
00030     return "Display Name: " + region->DisplayName + "\n" +
00031         "Native Name: " + region->NativeName + "\n" +
00032         "Currencies in use: " + StringJoin(", ", region->CurrenciesInUse) + "\n" +
00033         "Codes: " + region->CodeTwoLetter + ", " + region->CodeThreeLetter + ", " + region->CodeThreeDigit + "\n\n";
00034 }
00035
00036 void Scenario3_Region::ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00037 {
00038     // This scenario uses the Windows.Globalization.GeographicRegion class to
00039     // obtain the geographic region characteristics.
00040     auto userGeoRegion = ref new GeographicRegion();
00041
00042     // This obtains the geographic region characteristics by providing a country or region code.
00043     auto exampleGeoRegion = ref new GeographicRegion("JP");
00044
00045     // Display the results
00046     OutputTextBlock->Text = "User's Preferred Geographic Region\n" + ReportRegionData(userGeoRegion) +
00047         "Example Geographic Region by region/country code (JP)\n" + ReportRegionData(exampleGeoRegion);
00048 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothLE/cs/DisplayHelpers.cs Source File

  • BluetoothLE
  • cs

DisplayHelpers.cs

Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using Windows.Devices.Bluetooth.GenericAttributeProfile;
00005 using Windows.Devices.Enumeration;
00006 using Windows.Storage.Streams;
00007 using Windows.UI.Xaml.Media.Imaging;
00008
00009 namespace SDKTemplate
00010 {
00011     /// <summary>
00012     /// Helpers for formatting information for display.
00013     /// </summary>
00014     public static class DisplayHelpers
00015     {
00016         public static string GetServiceName(GattDeviceService service)
00017         {
00018             if (IsSigDefinedUuid(service.Uuid))
00019             {
00020                 GattNativeServiceUuid serviceName;
00021                 if (Enum.TryParse(Utilities.ConvertUuidToShortId(service.Uuid).ToString(), out serviceName))
00022                 {
00023                     return serviceName.ToString();
00024                 }
00025             }
00026             return "Custom Service: " + service.Uuid;
00027         }
00028
00029         public static string GetCharacteristicName(GattCharacteristic characteristic)
00030         {
00031             if (IsSigDefinedUuid(characteristic.Uuid))
00032             {
00033                 GattNativeCharacteristicUuid characteristicName;
00034                 if (Enum.TryParse(Utilities.ConvertUuidToShortId(characteristic.Uuid).ToString(),
00035                     out characteristicName))
00036                 {
00037                     return characteristicName.ToString();
00038                 }
00039             }
00040
00041             if (!string.IsNullOrEmpty(characteristic.UserDescription))
00042             {
00043                 return characteristic.UserDescription;
00044             }
00045
00046             else
00047             {
00048                 return "Custom Characteristic: " + characteristic.Uuid;
00049             }
00050         }
00051
00052         /// <summary>
00053         ///     The SIG has a standard base value for Assigned UUIDs. In order to determine if a UUID is SIG defined,
00054         ///     zero out the unique section and compare the base sections.
00055         /// </summary>
00056         /// <param name="uuid">The UUID to determine if SIG assigned</param>
00057         /// <returns></returns>
00058         private static bool IsSigDefinedUuid(Guid uuid)
00059         {
00060             var bluetoothBaseUuid = new Guid("00000000-0000-1000-8000-00805F9B34FB");
00061
00062             var bytes = uuid.ToByteArray();
00063             // Zero out the first and second bytes
00064             // Note how each byte gets flipped in a section - 1234 becomes 34 12
00065             // Example Guid: 35918bc9-1234-40ea-9779-889d79b753f0
00066             //                   ^^^^
00067             // bytes output = C9 8B 91 35 34 12 EA 40 97 79 88 9D 79 B7 53 F0
00068             //                ^^ ^^
00069             bytes[0] = 0;
00070             bytes[1] = 0;
00071             var baseUuid = new Guid(bytes);
00072             return baseUuid == bluetoothBaseUuid;
00073         }
00074     }
00075
00076     /// <summary>
00077     ///     Display class used to represent a BluetoothLEDevice in the Device list
00078     /// </summary>
00079     public class BluetoothLEDeviceDisplay : INotifyPropertyChanged
00080     {
00081         public BluetoothLEDeviceDisplay(DeviceInformation deviceInfoIn)
00082         {
00083             DeviceInformation = deviceInfoIn;
00084             UpdateGlyphBitmapImage();
00085         }
00086
00087         public DeviceInformation DeviceInformation { get; private set; }
00088
00089         public string Id => DeviceInformation.Id;
00090         public string Name => DeviceInformation.Name;
00091         public bool IsPaired => DeviceInformation.Pairing.IsPaired;
00092         public bool IsConnected => (bool?)DeviceInformation.Properties["System.Devices.Aep.IsConnected"] == true;
00093         public bool IsConnectable => (bool?)DeviceInformation.Properties["System.Devices.Aep.Bluetooth.Le.IsConnectable"] == true;
00094
00095         public IReadOnlyDictionary<string, object> Properties => DeviceInformation.Properties;
00096
00097         public BitmapImage GlyphBitmapImage { get; private set; }
00098
00099         public event PropertyChangedEventHandler PropertyChanged;
00100
00101         public void Update(DeviceInformationUpdate deviceInfoUpdate)
00102         {
00103             DeviceInformation.Update(deviceInfoUpdate);
00104
00105             OnPropertyChanged("Id");
00106             OnPropertyChanged("Name");
00107             OnPropertyChanged("DeviceInformation");
00108             OnPropertyChanged("IsPaired");
00109             OnPropertyChanged("IsConnected");
00110             OnPropertyChanged("Properties");
00111             OnPropertyChanged("IsConnectable");
00112
00113             UpdateGlyphBitmapImage();
00114         }
00115
00116         private async void UpdateGlyphBitmapImage()
00117         {
00118             var glyphBitmapImage = new BitmapImage();
00119             try
00120             {
00121                 DeviceThumbnail deviceThumbnail = await DeviceInformation.GetGlyphThumbnailAsync();
00122                 await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
00123             }
00124             catch (Exception)
00125             {
00126                 // Something went wrong getting or decoding the device glyph.
00127             }
00128             GlyphBitmapImage = glyphBitmapImage;
00129             OnPropertyChanged("GlyphBitmapImage");
00130         }
00131
00132         protected void OnPropertyChanged(string name)
00133         {
00134             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
00135         }
00136     }
00137
00138     /// <summary>
00139     ///     This enum assists in finding a string representation of a BT SIG assigned value for Service UUIDS
00140     ///     Reference: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
00141     /// </summary>
00142     public enum GattNativeServiceUuid : ushort
00143     {
00144         None = 0,
00145         AlertNotification = 0x1811,
00146         Battery = 0x180F,
00147         BloodPressure = 0x1810,
00148         CurrentTimeService = 0x1805,
00149         CyclingSpeedandCadence = 0x1816,
00150         DeviceInformation = 0x180A,
00151         GenericAccess = 0x1800,
00152         GenericAttribute = 0x1801,
00153         Glucose = 0x1808,
00154         HealthThermometer = 0x1809,
00155         HeartRate = 0x180D,
00156         HumanInterfaceDevice = 0x1812,
00157         ImmediateAlert = 0x1802,
00158         LinkLoss = 0x1803,
00159         NextDSTChange = 0x1807,
00160         PhoneAlertStatus = 0x180E,
00161         ReferenceTimeUpdateService = 0x1806,
00162         RunningSpeedandCadence = 0x1814,
00163         ScanParameters = 0x1813,
00164         TxPower = 0x1804,
00165         SimpleKeyService = 0xFFE0
00166     }
00167
00168     /// <summary>
00169     ///     This enum is nice for finding a string representation of a BT SIG assigned value for Characteristic UUIDs
00170     ///     Reference: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx
00171     /// </summary>
00172     public enum GattNativeCharacteristicUuid : ushort
00173     {
00174         None = 0,
00175         AlertCategoryID = 0x2A43,
00176         AlertCategoryIDBitMask = 0x2A42,
00177         AlertLevel = 0x2A06,
00178         AlertNotificationControlPoint = 0x2A44,
00179         AlertStatus = 0x2A3F,
00180         Appearance = 0x2A01,
00181         BatteryLevel = 0x2A19,
00182         BloodPressureFeature = 0x2A49,
00183         BloodPressureMeasurement = 0x2A35,
00184         BodySensorLocation = 0x2A38,
00185         BootKeyboardInputReport = 0x2A22,
00186         BootKeyboardOutputReport = 0x2A32,
00187         BootMouseInputReport = 0x2A33,
00188         CSCFeature = 0x2A5C,
00189         CSCMeasurement = 0x2A5B,
00190         CurrentTime = 0x2A2B,
00191         DateTime = 0x2A08,
00192         DayDateTime = 0x2A0A,
00193         DayofWeek = 0x2A09,
00194         DeviceName = 0x2A00,
00195         DSTOffset = 0x2A0D,
00196         ExactTime256 = 0x2A0C,
00197         FirmwareRevisionString = 0x2A26,
00198         GlucoseFeature = 0x2A51,
00199         GlucoseMeasurement = 0x2A18,
00200         GlucoseMeasurementContext = 0x2A34,
00201         HardwareRevisionString = 0x2A27,
00202         HeartRateControlPoint = 0x2A39,
00203         HeartRateMeasurement = 0x2A37,
00204         HIDControlPoint = 0x2A4C,
00205         HIDInformation = 0x2A4A,
00206         IEEE11073_20601RegulatoryCertificationDataList = 0x2A2A,
00207         IntermediateCuffPressure = 0x2A36,
00208         IntermediateTemperature = 0x2A1E,
00209         LocalTimeInformation = 0x2A0F,
00210         ManufacturerNameString = 0x2A29,
00211         MeasurementInterval = 0x2A21,
00212         ModelNumberString = 0x2A24,
00213         NewAlert = 0x2A46,
00214         PeripheralPreferredConnectionParameters = 0x2A04,
00215         PeripheralPrivacyFlag = 0x2A02,
00216         PnPID = 0x2A50,
00217         ProtocolMode = 0x2A4E,
00218         ReconnectionAddress = 0x2A03,
00219         RecordAccessControlPoint = 0x2A52,
00220         ReferenceTimeInformation = 0x2A14,
00221         Report = 0x2A4D,
00222         ReportMap = 0x2A4B,
00223         RingerControlPoint = 0x2A40,
00224         RingerSetting = 0x2A41,
00225         RSCFeature = 0x2A54,
00226         RSCMeasurement = 0x2A53,
00227         SCControlPoint = 0x2A55,
00228         ScanIntervalWindow = 0x2A4F,
00229         ScanRefresh = 0x2A31,
00230         SensorLocation = 0x2A5D,
00231         SerialNumberString = 0x2A25,
00232         ServiceChanged = 0x2A05,
00233         SoftwareRevisionString = 0x2A28,
00234         SupportedNewAlertCategory = 0x2A47,
00235         SupportedUnreadAlertCategory = 0x2A48,
00236         SystemID = 0x2A23,
00237         TemperatureMeasurement = 0x2A1C,
00238         TemperatureType = 0x2A1D,
00239         TimeAccuracy = 0x2A12,
00240         TimeSource = 0x2A13,
00241         TimeUpdateControlPoint = 0x2A16,
00242         TimeUpdateState = 0x2A17,
00243         TimewithDST = 0x2A11,
00244         TimeZone = 0x2A0E,
00245         TxPowerLevel = 0x2A07,
00246         UnreadAlertStatus = 0x2A45,
00247         AggregateInput = 0x2A5A,
00248         AnalogInput = 0x2A58,
00249         AnalogOutput = 0x2A59,
00250         CyclingPowerControlPoint = 0x2A66,
00251         CyclingPowerFeature = 0x2A65,
00252         CyclingPowerMeasurement = 0x2A63,
00253         CyclingPowerVector = 0x2A64,
00254         DigitalInput = 0x2A56,
00255         DigitalOutput = 0x2A57,
00256         ExactTime100 = 0x2A0B,
00257         LNControlPoint = 0x2A6B,
00258         LNFeature = 0x2A6A,
00259         LocationandSpeed = 0x2A67,
00260         Navigation = 0x2A68,
00261         NetworkAvailability = 0x2A3E,
00262         PositionQuality = 0x2A69,
00263         ScientificTemperatureinCelsius = 0x2A3C,
00264         SecondaryTimeZone = 0x2A10,
00265         String = 0x2A3D,
00266         TemperatureinCelsius = 0x2A1F,
00267         TemperatureinFahrenheit = 0x2A20,
00268         TimeBroadcast = 0x2A15,
00269         BatteryLevelState = 0x2A1B,
00270         BatteryPowerState = 0x2A1A,
00271         PulseOximetryContinuousMeasurement = 0x2A5F,
00272         PulseOximetryControlPoint = 0x2A62,
00273         PulseOximetryFeatures = 0x2A61,
00274         PulseOximetryPulsatileEvent = 0x2A60,
00275         SimpleKeyState = 0xFFE1
00276     }
00277
00278     /// <summary>
00279     ///     This enum assists in finding a string representation of a BT SIG assigned value for Descriptor UUIDs
00280     ///     Reference: https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx
00281     /// </summary>
00282     public enum GattNativeDescriptorUuid : ushort
00283     {
00284         CharacteristicExtendedProperties = 0x2900,
00285         CharacteristicUserDescription = 0x2901,
00286         ClientCharacteristicConfiguration = 0x2902,
00287         ServerCharacteristicConfiguration = 0x2903,
00288         CharacteristicPresentationFormat = 0x2904,
00289         CharacteristicAggregateFormat = 0x2905,
00290         ValidRange = 0x2906,
00291         ExternalReportReference = 0x2907,
00292         ReportReference = 0x2908
00293     }
00294
00295     public static class Utilities
00296     {
00297         /// <summary>
00298         ///     Converts from standard 128bit UUID to the assigned 32bit UUIDs. Makes it easy to compare services
00299         ///     that devices expose to the standard list.
00300         /// </summary>
00301         /// <param name="uuid">UUID to convert to 32 bit</param>
00302         /// <returns></returns>
00303         public static ushort ConvertUuidToShortId(Guid uuid)
00304         {
00305             // Get the short Uuid
00306             var bytes = uuid.ToByteArray();
00307             var shortUuid = (ushort) (bytes[0] | (bytes[1] << 8));
00308             return shortUuid;
00309         }
00310
00311         /// <summary>
00312         ///     Converts from a buffer to a properly sized byte array
00313         /// </summary>
00314         /// <param name="buffer"></param>
00315         /// <returns></returns>
00316         public static byte[] ReadBufferToBytes(IBuffer buffer)
00317         {
00318             var dataLength = buffer.Length;
00319             var data = new byte[dataLength];
00320             using (var reader = DataReader.FromBuffer(buffer))
00321             {
00322                 reader.ReadBytes(data);
00323             }
00324             return data;
00325         }
00326     }
00327 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BackgroundDeviceWatcher Member List

This is the complete list of members for BackgroundDeviceWatcher, including all inherited members.
BackgroundDeviceWatcher() | BackgroundDeviceWatcher
Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance) | BackgroundDeviceWatcher
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/pch.cpp Source File

  • AppServices
  • cppwinrt
  • AppServicesProvider

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/NfcUtils.cs Source File

  • Nfc
  • Nfc

NfcUtils.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Linq;
00016 using System.Threading.Tasks;
00017 using Windows.ApplicationModel.Background;
00018 using Windows.Devices.SmartCards;
00019 using System.Diagnostics;
00020 using System.Runtime.InteropServices.WindowsRuntime;
00021 using Windows.Storage.Streams;
00022 using Windows.ApplicationModel;
00023
00024 namespace NfcSample
00025 {
00026     public enum NotifyType
00027     {
00028         StatusMessage,
00029         ErrorMessage
00030     };
00031
00032     public class NfcUtils
00033     {
00034         public static async Task<IBackgroundTaskRegistration> GetOrRegisterHceBackgroundTask(string bgTaskName, string taskEntryPoint, SmartCardTriggerType triggerType)
00035         {
00036             try
00037             {
00038                 // Check if there's an existing background task already registered
00039                 var bgTask = (from t in BackgroundTaskRegistration.AllTasks
00040                               where t.Value.Name.Equals(bgTaskName)
00041                               select t.Value).SingleOrDefault();
00042                 if (bgTask != null)
00043                 {
00044                     LogMessage("Background task already registered", NotifyType.StatusMessage);
00045                 }
00046                 else
00047                 {
00048                     if (!(await DoBackgroundRequestAccess()))
00049                     {
00050                         LogMessage("Background task access denied, task won't fire", NotifyType.ErrorMessage);
00051                         throw new Exception("Failed to get background access");
00052                     }
00053
00054                     var taskBuilder = new BackgroundTaskBuilder();
00055                     taskBuilder.Name = bgTaskName;
00056                     taskBuilder.TaskEntryPoint = taskEntryPoint;
00057                     taskBuilder.SetTrigger(new SmartCardTrigger(triggerType));
00058                     bgTask = taskBuilder.Register();
00059                     LogMessage("Background task registered", NotifyType.StatusMessage);
00060                 }
00061
00062                 bgTask.Completed += BgTask_Completed;
00063                 bgTask.Progress += BgTask_Progress;
00064
00065                 return bgTask;
00066             }
00067             catch (Exception ex)
00068             {
00069                 LogMessage("Failed to register background task: " + ex.ToString(), NotifyType.StatusMessage);
00070                 throw;
00071             }
00072         }
00073
00074         private static async Task<bool> DoBackgroundRequestAccess()
00075         {
00076             String appVersion = String.Format("{0}.{1}.{2}.{3}",
00077                     Package.Current.Id.Version.Build,
00078                     Package.Current.Id.Version.Major,
00079                     Package.Current.Id.Version.Minor,
00080                     Package.Current.Id.Version.Revision);
00081
00082             if ((string)Windows.Storage.ApplicationData.Current.LocalSettings.Values["AppVersion"] != appVersion)
00083             {
00084                 // Our app has been updated
00085                 Windows.Storage.ApplicationData.Current.LocalSettings.Values["AppVersion"] = appVersion;
00086
00087                 // Call RemoveAccess
00088                 BackgroundExecutionManager.RemoveAccess();
00089             }
00090
00091             BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
00092
00093             return status == BackgroundAccessStatus.AlwaysAllowed
00094                 || status == BackgroundAccessStatus.AllowedSubjectToSystemPolicy;
00095         }
00096
00097         private static void BgTask_Progress(BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args)
00098         {
00099             LogMessage("BgTask Progress: " + args.Progress, NotifyType.StatusMessage);
00100         }
00101
00102         private static void BgTask_Completed(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args)
00103         {
00104             LogMessage("BgTask Completed", NotifyType.StatusMessage);
00105         }
00106
00107         public static async Task<SmartCardAppletIdGroupRegistration> RegisterAidGroup(string displayName, IList<IBuffer> appletIds, SmartCardEmulationCategory? emulationCategory, SmartCardEmulationType emulationType, bool automaticEnablement)
00108         {
00109             try
00110             {
00111                 var cardAidGroup = new SmartCardAppletIdGroup(
00112                     displayName,
00113                     appletIds,
00114                     (SmartCardEmulationCategory)emulationCategory,
00115                     emulationType);
00116                 cardAidGroup.AutomaticEnablement = automaticEnablement;
00117
00118                 var reg = await SmartCardEmulator.RegisterAppletIdGroupAsync(cardAidGroup);
00119                 LogMessage("AID group successfully registered", NotifyType.StatusMessage);
00120
00121                 return reg;
00122             }
00123             catch (Exception ex)
00124             {
00125                 LogMessage("Failed to register AID group: " + ex.ToString(), NotifyType.StatusMessage);
00126                 throw;
00127             }
00128         }
00129
00130         public static async Task<SmartCardAppletIdGroupRegistration> GetAidGroupById(Guid id)
00131         {
00132             try
00133             {
00134                 // Find registration
00135                 var reg = (from r in await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync()
00136                            where r.Id == id
00137                            select r).SingleOrDefault();
00138                 if (reg == null)
00139                 {
00140                     LogMessage("No matching AID group found for specified ID", NotifyType.ErrorMessage);
00141                 }
00142
00143                 return reg;
00144             }
00145             catch (Exception ex)
00146             {
00147                 LogMessage("Failed to get AID group by ID: " + ex.ToString(), NotifyType.StatusMessage);
00148                 throw;
00149             }
00150         }
00151
00152         public static async Task<SmartCardActivationPolicyChangeResult> SetCardActivationPolicy(SmartCardAppletIdGroupRegistration reg, SmartCardAppletIdGroupActivationPolicy policy)
00153         {
00154             LogMessage("Previous AID group activation policy: " + reg.ActivationPolicy, NotifyType.StatusMessage);
00155
00156             // Now try to set the policy on the card, this may pop UI to the user asking them to confirm
00157             var res = await reg.RequestActivationPolicyChangeAsync(policy);
00158             if (res == SmartCardActivationPolicyChangeResult.Allowed)
00159             {
00160                 LogMessage("AID group successfully set to " + policy.ToString(), NotifyType.StatusMessage);
00161             }
00162             else
00163             {
00164                 LogMessage("AID group policy change was disallowed (perhaps due to user declining the UI popup)", NotifyType.ErrorMessage);
00165             }
00166
00167             return res;
00168         }
00169
00170         public static async Task<bool> CheckHceSupport()
00171         {
00172             // Check if the SmartCardEmulator API exists on this currently running SKU of Windows
00173             if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Devices.SmartCards.SmartCardEmulator"))
00174             {
00175                 LogMessage("This SKU of Windows does not support NFC card emulation, only phones/mobile devices support NFC card emulation", NotifyType.ErrorMessage);
00176                 return false;
00177             }
00178
00179             // Check if any NFC emulation is supported on this device
00180             var sce = await SmartCardEmulator.GetDefaultAsync();
00181             if (sce == null)
00182             {
00183                 LogMessage("NFC card emulation is not supported on this device, probably the device does not have NFC at all", NotifyType.ErrorMessage);
00184                 return false;
00185             }
00186
00187             // Check if the NFC emulation support on this device includes HCE
00188             if (!sce.IsHostCardEmulationSupported())
00189             {
00190                 LogMessage("This device's NFC does not support HCE-mode", NotifyType.ErrorMessage);
00191                 return false;
00192             }
00193             return true;
00194         }
00195
00196         public static async void LaunchNfcPaymentsSettingsPage()
00197         {
00198             await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-nfctransactions:"));
00199         }
00200
00201         public static async void LaunchNfcProximitySettingsPage()
00202         {
00203             await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-proximity:"));
00204         }
00205
00206         public static byte[] HexStringToBytes(string hexString)
00207         {
00208             if (hexString.Length % 2 != 0)
00209             {
00210                 throw new ArgumentException();
00211             }
00212             byte[] bytes = new byte[hexString.Length / 2];
00213             for (int i = 0; i < hexString.Length; i += 2)
00214             {
00215                 bytes[i / 2] = byte.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber);
00216             }
00217             return bytes;
00218         }
00219
00220         public static void LogMessage(string message, NotifyType type = NotifyType.StatusMessage)
00221         {
00222             Debug.WriteLine(message);
00223             SDKTemplate.MainPage.Current.NotifyUser(message, type);
00224         }
00225     }
00226 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario6.xaml.cs Source File

  • ApplicationResources
  • cs

scenario6.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016 using Windows.ApplicationModel.Resources;
00017 using AppResourceClassLibrary;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class Scenario6 : Page
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         public Scenario6()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         /// <summary>
00036         /// Invoked when this page is about to be displayed in a Frame.
00037         /// </summary>
00038         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042         }
00043
00044         /// <summary>
00045         /// This is the click handler for the 'Scenario6Button_Show' button.  You would replace this with your own handler
00046         /// if you have a button or buttons on this page.
00047         /// </summary>
00048         /// <param name="sender"></param>
00049         /// <param name="e"></param>
00050         private void Scenario6Button_Show_Click(object sender, RoutedEventArgs e)
00051         {
00052             Button b = sender as Button;
00053             if (b != null)
00054             {
00055                 var resourceLoader = ResourceLoader.GetForCurrentView("AppResourceClassLibrary/Resources");
00056                 this.Scenario6TextBlock.Text = "Retrieved from app: " + resourceLoader.GetString("string1");
00057                 this.Scenario6TextBlock2.Text = "Retrieved from class library: " + AppResourceClassLibrary.LocalizedNamesLibrary.LibraryName;
00058             }
00059         }
00060
00061     }
00062 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cs/Scenario1_LongAndShortFormats.xaml.cs Source File

  • DateTimeFormatting
  • cs

Scenario1_LongAndShortFormats.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Text;
00015 using Windows.Foundation;
00016 using Windows.Foundation.Collections;
00017 using Windows.Globalization;
00018 using Windows.Globalization.DateTimeFormatting;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario1_LongAndShortFormats : Page
00026     {
00027         public Scenario1_LongAndShortFormats()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         /// <summary>
00033         /// This is the click handler for the 'Display' button.
00034         /// </summary>
00035         private void Display()
00036         {
00037             // This scenario uses the Windows.Globalization.DateTimeFormatting.DateTimeFormatter class
00038             // in order to display dates and times using basic formatters.
00039
00040             // We keep results in this variable
00041             StringBuilder results = new StringBuilder();
00042             results.AppendLine("Current application context language: " + ApplicationLanguages.Languages[0]);
00043             results.AppendLine();
00044
00045             // Create basic date/time formatters.
00046             DateTimeFormatter[] basicFormatters = new[]
00047             {
00048                 // Default date formatters
00049                 new DateTimeFormatter("shortdate"),
00050                 new DateTimeFormatter("longdate"),
00051
00052                 // Default time formatters
00053                 new DateTimeFormatter("shorttime"),
00054                 new DateTimeFormatter("longtime"),
00055              };
00056
00057             // Create date/time to format and display.
00058             DateTime dateTime = DateTime.Now;
00059
00060             // Format and display date/time. Calendar will always support Now. Otherwise you may need to verify dateTime is in supported range.
00061             foreach (DateTimeFormatter formatter in basicFormatters)
00062             {
00063                 // Format and display date/time.
00064                 results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
00065             }
00066
00067             // Display the results
00068             OutputTextBlock.Text = results.ToString();
00069         }
00070     }
00071 }
Generated on Fri Nov 15 2024 22:19:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LineDisplay/cpp/Scenario4_UpdatingLineDisplayAttributes.xaml.cpp Source File

  • LineDisplay
  • cpp

Scenario4_UpdatingLineDisplayAttributes.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_UpdatingLineDisplayattributes.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Devices::PointOfService;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Data;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 Scenario4_UpdatingLineDisplayAttributes::Scenario4_UpdatingLineDisplayAttributes()
00028 {
00029     InitializeComponent();
00030     DataContext = this;
00031 }
00032
00033 void Scenario4_UpdatingLineDisplayAttributes::OnNavigatedTo(NavigationEventArgs^ e)
00034 {
00035     InitializeAsync();
00036 }
00037
00038 void Scenario4_UpdatingLineDisplayAttributes::OnNavigatedFrom(NavigationEventArgs^ e)
00039 {
00040     delete lineDisplay;
00041     lineDisplay = nullptr;
00042 }
00043
00044 task<void> Scenario4_UpdatingLineDisplayAttributes::InitializeAsync()
00045 {
00046     lineDisplay = co_await rootPage->ClaimScenarioLineDisplayAsync();
00047
00048     BlinkRateSlider->IsEnabled = (lineDisplay != nullptr) && lineDisplay->Capabilities->CanChangeBlinkRate;
00049     BrightnessSlider->IsEnabled = (lineDisplay != nullptr) && lineDisplay->Capabilities->IsBrightnessSupported;
00050
00051     SupportedScreenSizesComboBox->IsEnabled = (lineDisplay != nullptr) && lineDisplay->Capabilities->CanChangeScreenSize;
00052
00053     if (SupportedScreenSizesComboBox->IsEnabled)
00054     {
00055         for (Size screenSize : lineDisplay->SupportedScreenSizesInCharacters)
00056         {
00057             Helpers::AddItem(SupportedScreenSizesComboBox, screenSize, screenSize.Width.ToString() + " x " + screenSize.Height.ToString());
00058         }
00059
00060         if (SupportedScreenSizesComboBox->Items->Size > 0)
00061         {
00062             SupportedScreenSizesComboBox->SelectedIndex = 0;
00063         }
00064     }
00065
00066     CharacterSetMappingEnabledCheckbox->IsEnabled = (lineDisplay != nullptr) && lineDisplay->Capabilities->CanMapCharacterSets;
00067
00068     UpdateButton->IsEnabled = (lineDisplay != nullptr);
00069
00070     if (UpdateButton->IsEnabled)
00071     {
00072         SetValuesFromLineDisplay();
00073         if (lineDisplay->Capabilities->CanBlink == LineDisplayTextAttributeGranularity::NotSupported)
00074         {
00075             co_await lineDisplay->DefaultWindow->TryDisplayTextAsync("Regular Text");
00076         }
00077         else
00078         {
00079             co_await lineDisplay->DefaultWindow->TryDisplayTextAsync("Blinking Text", LineDisplayTextAttribute::Blink);
00080         }
00081     }
00082 }
00083
00084 void Scenario4_UpdatingLineDisplayAttributes::SetValuesFromLineDisplay()
00085 {
00086     LineDisplayAttributes^ attributes = lineDisplay->GetAttributes();
00087     BlinkRateSlider->Value = Helpers::MillisecondsFromTimeSpan(attributes->BlinkRate);
00088     BrightnessSlider->Value = attributes->Brightness;
00089     CharacterSetMappingEnabledCheckbox->IsChecked = attributes->IsCharacterSetMappingEnabled;
00090 }
00091
00092 void Scenario4_UpdatingLineDisplayAttributes::UpdateButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00093 {
00094     invoke_async_lambda([=]() -> task<void>
00095     {
00096         LineDisplayAttributes^ attributes = lineDisplay->GetAttributes();
00097
00098         if (lineDisplay->Capabilities->CanChangeBlinkRate)
00099         {
00100             attributes->BlinkRate = Helpers::TimeSpanFromMilliseconds(BlinkRateSlider->Value);
00101         }
00102
00103         if (lineDisplay->Capabilities->IsBrightnessSupported)
00104         {
00105             attributes->Brightness = static_cast<int>(BrightnessSlider->Value);
00106         }
00107
00108         if (lineDisplay->Capabilities->CanChangeScreenSize)
00109         {
00110             attributes->ScreenSizeInCharacters = Helpers::GetSelectedItemTag<Size>(SupportedScreenSizesComboBox);
00111         }
00112
00113         if (lineDisplay->Capabilities->CanMapCharacterSets)
00114         {
00115             attributes->IsCharacterSetMappingEnabled = CharacterSetMappingEnabledCheckbox->IsChecked->Value;
00116         }
00117
00118         if (co_await lineDisplay->TryUpdateAttributesAsync(attributes))
00119         {
00120             rootPage->NotifyUser("Attributes updated successfully.", NotifyType::StatusMessage);
00121
00122             // The resulting attributes may not match our request.
00123             // For example, the Line Display will choose the closest available blink rate.
00124             // Update the controls to show what the Line Display actually used.
00125             SetValuesFromLineDisplay();
00126         }
00127         else
00128         {
00129             rootPage->NotifyUser("Failed to update attributes.", NotifyType::ErrorMessage);
00130         }
00131     });
00132 }
Generated on Fri Nov 15 2024 22:20:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceIO Member List

This is the complete list of members for DeviceIO, including all inherited members.
DeviceIO() | DeviceIO | [inline]
DeviceIOGet_Click(object sender, RoutedEventArgs e) | DeviceIO | [inline, private]
DeviceIOSet_Click(object sender, RoutedEventArgs e) | DeviceIO | [inline, private]
rootPage | DeviceIO | [private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/Scenario1_Advertiser.h Source File

  • WiFiDirect
  • cppwinrt

Scenario1_Advertiser.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Advertiser.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Advertiser : Scenario1_AdvertiserT<Scenario1_Advertiser>
00020     {
00021         Scenario1_Advertiser();
00022
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024
00025         auto ConnectedDevices() { return connectedDevices; }
00026
00027         void btnStartAdvertisement_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void btnAddIe_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029         void btnStopAdvertisement_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00030         fire_and_forget btnSendMessage_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00031         void btnCloseDevice_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00032
00033     private:
00034         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00035         Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher publisher{ nullptr };
00036         Windows::Devices::WiFiDirect::WiFiDirectConnectionListener listener{ nullptr };
00037
00038         event_token statusChangedToken{};
00039         event_token connectionRequestedToken{};
00040         event_token connectionStatusChangedToken{};
00041
00042         Windows::Foundation::Collections::IObservableVector<SDKTemplate::ConnectedDevice> connectedDevices{ single_threaded_observable_vector<SDKTemplate::ConnectedDevice>() };
00043         std::vector<Windows::Devices::WiFiDirect::WiFiDirectInformationElement> informationElements;
00044         slim_mutex pendingConnectionsMutex;
00045         std::map<Windows::Networking::Sockets::StreamSocketListener, Windows::Devices::WiFiDirect::WiFiDirectDevice> pendingConnections;
00046
00047         void StopAdvertisement();
00048         Windows::Foundation::IAsyncOperation<bool> HandleConnectionRequestAsync(Windows::Devices::WiFiDirect::WiFiDirectConnectionRequest connectionRequest);
00049         Windows::Foundation::IAsyncOperation<bool> IsAepPairedAsync(hstring deviceId);
00050
00051         fire_and_forget OnStatusChanged(Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher sender, Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs e);
00052         fire_and_forget OnConnectionRequested(Windows::Devices::WiFiDirect::WiFiDirectConnectionListener const&, Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs const& e);
00053         void OnConnectionStatusChanged(Windows::Devices::WiFiDirect::WiFiDirectDevice const& sender, Windows::Foundation::IInspectable const&);
00054         fire_and_forget OnSocketConnectionReceived(Windows::Networking::Sockets::StreamSocketListener sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs e);
00055     };
00056 }
00057
00058 namespace winrt::SDKTemplate::factory_implementation
00059 {
00060     struct Scenario1_Advertiser : Scenario1_AdvertiserT<Scenario1_Advertiser, implementation::Scenario1_Advertiser>
00061     {
00062     };
00063 }
Generated on Fri Nov 15 2024 22:22:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_MultiFile Member List

This is the complete list of members for Scenario2_MultiFile, including all inherited members.
PickFilesButton_Click(object sender, RoutedEventArgs e) | Scenario2_MultiFile | [inline, private]
rootPage | Scenario2_MultiFile | [private]
Scenario2_MultiFile() | Scenario2_MultiFile | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5 Member List

This is the complete list of members for Scenario5, including all inherited members.
GetThumbnailButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario5
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario5
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario5
ReadFromStreamButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5
Scenario5() | Scenario5
Scenario5() | Scenario5
WriteToStreamButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cs/Scenario1_Advertiser.xaml.cs Source File

  • WiFiDirect
  • cs

Scenario1_Advertiser.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Concurrent;
00014 using System.Collections.Generic;
00015 using System.Collections.ObjectModel;
00016 using System.Threading.Tasks;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Devices.WiFiDirect;
00019 using Windows.Networking.Sockets;
00020 using Windows.Storage.Streams;
00021 using Windows.Security.Cryptography;
00022 using Windows.UI.Core;
00023 using Windows.UI.Popups;
00024 using Windows.UI.Xaml;
00025 using Windows.UI.Xaml.Controls;
00026 using Windows.UI.Xaml.Navigation;
00027
00028 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00029
00030 namespace SDKTemplate
00031 {
00032     /// <summary>
00033     /// An empty page that can be used on its own or navigated to within a Frame.
00034     /// </summary>
00035     public sealed partial class Scenario1_Advertiser : Page
00036     {
00037         private MainPage rootPage = MainPage.Current;
00038         private ObservableCollection<ConnectedDevice> ConnectedDevices = new ObservableCollection<ConnectedDevice>();
00039         WiFiDirectAdvertisementPublisher _publisher;
00040         WiFiDirectConnectionListener _listener;
00041         List<WiFiDirectInformationElement> _informationElements = new List<WiFiDirectInformationElement>();
00042         ConcurrentDictionary<StreamSocketListener, WiFiDirectDevice> _pendingConnections = new ConcurrentDictionary<StreamSocketListener, WiFiDirectDevice>();
00043
00044         public Scenario1_Advertiser()
00045         {
00046             this.InitializeComponent();
00047         }
00048
00049         protected override void OnNavigatedFrom(NavigationEventArgs e)
00050         {
00051             if (btnStopAdvertisement.IsEnabled)
00052             {
00053                 StopAdvertisement();
00054             }
00055         }
00056
00057         private void btnStartAdvertisement_Click(object sender, RoutedEventArgs e)
00058         {
00059             _publisher = new WiFiDirectAdvertisementPublisher();
00060             _publisher.StatusChanged += OnStatusChanged;
00061
00062             _listener = new WiFiDirectConnectionListener();
00063
00064             if (chkListener.IsChecked.Value)
00065             {
00066                 try
00067                 {
00068                     // This can raise an exception if the machine does not support WiFi. Sorry.
00069                     _listener.ConnectionRequested += OnConnectionRequested;
00070                 }
00071                 catch (Exception ex)
00072                 {
00073                     rootPage.NotifyUser($"Error preparing Advertisement: {ex}", NotifyType.ErrorMessage);
00074                     return;
00075                 }
00076             }
00077
00078             var discoverability = Utils.GetSelectedItemTag<WiFiDirectAdvertisementListenStateDiscoverability>(cmbListenState);
00079             _publisher.Advertisement.ListenStateDiscoverability = discoverability;
00080
00081             _publisher.Advertisement.IsAutonomousGroupOwnerEnabled = chkPreferGroupOwnerMode.IsChecked.Value;
00082
00083             // Legacy settings are meaningful only if IsAutonomousGroupOwnerEnabled is true.
00084             if (_publisher.Advertisement.IsAutonomousGroupOwnerEnabled && chkLegacySetting.IsChecked.Value)
00085             {
00086                 _publisher.Advertisement.LegacySettings.IsEnabled = true;
00087                 if (!String.IsNullOrEmpty(txtPassphrase.Text))
00088                 {
00089                     var creds = new Windows.Security.Credentials.PasswordCredential();
00090                     creds.Password = txtPassphrase.Text;
00091                     _publisher.Advertisement.LegacySettings.Passphrase = creds;
00092                 }
00093
00094                 if (!String.IsNullOrEmpty(txtSsid.Text))
00095                 {
00096                     _publisher.Advertisement.LegacySettings.Ssid = txtSsid.Text;
00097                 }
00098             }
00099
00100             // Add the information elements.
00101             foreach (WiFiDirectInformationElement informationElement in _informationElements)
00102             {
00103                 _publisher.Advertisement.InformationElements.Add(informationElement);
00104             }
00105
00106             _publisher.Start();
00107
00108             if (_publisher.Status == WiFiDirectAdvertisementPublisherStatus.Started)
00109             {
00110                 btnStartAdvertisement.IsEnabled = false;
00111                 btnStopAdvertisement.IsEnabled = true;
00112                 rootPage.NotifyUser("Advertisement started.", NotifyType.StatusMessage);
00113             }
00114             else
00115             {
00116                 rootPage.NotifyUser($"Advertisement failed to start. Status is {_publisher.Status}", NotifyType.ErrorMessage);
00117             }
00118         }
00119
00120         private void btnAddIe_Click(object sender, RoutedEventArgs e)
00121         {
00122             WiFiDirectInformationElement informationElement = new WiFiDirectInformationElement();
00123
00124             // Information element blob
00125             DataWriter dataWriter = new DataWriter();
00126             dataWriter.UnicodeEncoding = UnicodeEncoding.Utf8;
00127             dataWriter.ByteOrder = ByteOrder.LittleEndian;
00128             dataWriter.WriteUInt32(dataWriter.MeasureString(txtInformationElement.Text));
00129             dataWriter.WriteString(txtInformationElement.Text);
00130             informationElement.Value = dataWriter.DetachBuffer();
00131
00132             // Organizational unit identifier (OUI)
00133             informationElement.Oui = CryptographicBuffer.CreateFromByteArray(Globals.CustomOui);
00134
00135             // OUI Type
00136             informationElement.OuiType = Globals.CustomOuiType;
00137
00138             // Save this information element so we can add it when we advertise.
00139             _informationElements.Add(informationElement);
00140
00141             txtInformationElement.Text = "";
00142             rootPage.NotifyUser("IE added successfully", NotifyType.StatusMessage);
00143         }
00144
00145         private void btnStopAdvertisement_Click(object sender, RoutedEventArgs e)
00146         {
00147             StopAdvertisement();
00148             rootPage.NotifyUser("Advertisement stopped successfully", NotifyType.StatusMessage);
00149         }
00150
00151         private void StopAdvertisement()
00152         {
00153             _publisher.Stop();
00154             _publisher.StatusChanged -= OnStatusChanged;
00155
00156             _listener.ConnectionRequested -= OnConnectionRequested;
00157
00158             connectionSettingsPanel.Reset();
00159             _informationElements.Clear();
00160
00161             btnStartAdvertisement.IsEnabled = true;
00162             btnStopAdvertisement.IsEnabled = false;
00163         }
00164
00165         private async Task<bool> HandleConnectionRequestAsync(WiFiDirectConnectionRequest connectionRequest)
00166         {
00167             string deviceName = connectionRequest.DeviceInformation.Name;
00168
00169             bool isPaired = (connectionRequest.DeviceInformation.Pairing?.IsPaired == true) ||
00170                             (await IsAepPairedAsync(connectionRequest.DeviceInformation.Id));
00171
00172             // Show the prompt only in case of WiFiDirect reconnection or Legacy client connection.
00173             if (isPaired || _publisher.Advertisement.LegacySettings.IsEnabled)
00174             {
00175                 var messageDialog = new MessageDialog($"Connection request received from {deviceName}", "Connection Request");
00176
00177                 // Add two commands, distinguished by their tag.
00178                 // The default command is "Decline", and if the user cancels, we treat it as "Decline".
00179                 messageDialog.Commands.Add(new UICommand("Accept", null, true));
00180                 messageDialog.Commands.Add(new UICommand("Decline", null, null));
00181                 messageDialog.DefaultCommandIndex = 1;
00182                 messageDialog.CancelCommandIndex = 1;
00183
00184                 // Show the message dialog
00185                 var commandChosen = await messageDialog.ShowAsync();
00186
00187                 if (commandChosen.Id == null)
00188                 {
00189                     return false;
00190                 }
00191             }
00192
00193             rootPage.NotifyUser($"Connecting to {deviceName}...", NotifyType.StatusMessage);
00194
00195             // Pair device if not already paired and not using legacy settings
00196             if (!isPaired && !_publisher.Advertisement.LegacySettings.IsEnabled)
00197             {
00198                 if (!await connectionSettingsPanel.RequestPairDeviceAsync(connectionRequest.DeviceInformation.Pairing))
00199                 {
00200                     return false;
00201                 }
00202             }
00203
00204             WiFiDirectDevice wfdDevice = null;
00205             try
00206             {
00207                 // IMPORTANT: FromIdAsync needs to be called from the UI thread
00208                 wfdDevice = await WiFiDirectDevice.FromIdAsync(connectionRequest.DeviceInformation.Id);
00209             }
00210             catch (Exception ex)
00211             {
00212                 rootPage.NotifyUser($"Exception in FromIdAsync: {ex}", NotifyType.ErrorMessage);
00213                 return false;
00214             }
00215
00216             // Register for the ConnectionStatusChanged event handler
00217             wfdDevice.ConnectionStatusChanged += OnConnectionStatusChanged;
00218
00219             var listenerSocket = new StreamSocketListener();
00220
00221             // Save this (listenerSocket, wfdDevice) pair so we can hook it up when the socket connection is made.
00222             _pendingConnections[listenerSocket] = wfdDevice;
00223
00224             var EndpointPairs = wfdDevice.GetConnectionEndpointPairs();
00225
00226             listenerSocket.ConnectionReceived += OnSocketConnectionReceived;
00227             try
00228             {
00229                 await listenerSocket.BindEndpointAsync(EndpointPairs[0].LocalHostName, Globals.strServerPort);
00230             }
00231             catch (Exception ex)
00232             {
00233                 rootPage.NotifyUser($"Connect operation threw an exception: {ex.Message}", NotifyType.ErrorMessage);
00234                 return false;
00235             }
00236
00237             rootPage.NotifyUser($"Devices connected on L2, listening on IP Address: {EndpointPairs[0].LocalHostName}" +
00238                                 $" Port: {Globals.strServerPort}", NotifyType.StatusMessage);
00239             return true;
00240         }
00241
00242         private async void OnConnectionRequested(WiFiDirectConnectionListener sender, WiFiDirectConnectionRequestedEventArgs connectionEventArgs)
00243         {
00244             WiFiDirectConnectionRequest connectionRequest = connectionEventArgs.GetConnectionRequest();
00245             bool success = await Dispatcher.RunTaskAsync(async () =>
00246             {
00247                 return await HandleConnectionRequestAsync(connectionRequest);
00248             });
00249
00250             if (!success)
00251             {
00252                 // Decline the connection request
00253                 rootPage.NotifyUserFromBackground($"Connection request from {connectionRequest.DeviceInformation.Name} was declined", NotifyType.ErrorMessage);
00254                 connectionRequest.Dispose();
00255             }
00256         }
00257
00258         private async Task<bool> IsAepPairedAsync(string deviceId)
00259         {
00260             List<string> additionalProperties = new List<string>();
00261             additionalProperties.Add("System.Devices.Aep.DeviceAddress");
00262             String deviceSelector = $"System.Devices.Aep.AepId:=\"{deviceId}\"";
00263             DeviceInformation devInfo = null;
00264
00265             try
00266             {
00267                 devInfo = await DeviceInformation.CreateFromIdAsync(deviceId, additionalProperties);
00268             }
00269             catch (Exception ex)
00270             {
00271                 rootPage.NotifyUser("DeviceInformation.CreateFromIdAsync threw an exception: " + ex.Message, NotifyType.ErrorMessage);
00272             }
00273
00274             if (devInfo == null)
00275             {
00276                 rootPage.NotifyUser("Device Information is null", NotifyType.ErrorMessage);
00277                 return false;
00278             }
00279
00280             deviceSelector = $"System.Devices.Aep.DeviceAddress:=\"{devInfo.Properties["System.Devices.Aep.DeviceAddress"]}\"";
00281             DeviceInformationCollection pairedDeviceCollection = await DeviceInformation.FindAllAsync(deviceSelector, null, DeviceInformationKind.Device);
00282             return pairedDeviceCollection.Count > 0;
00283         }
00284
00285         private async void OnStatusChanged(WiFiDirectAdvertisementPublisher sender, WiFiDirectAdvertisementPublisherStatusChangedEventArgs statusEventArgs)
00286         {
00287             if (statusEventArgs.Status == WiFiDirectAdvertisementPublisherStatus.Started)
00288             {
00289                 await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00290                 {
00291                     if (sender.Advertisement.LegacySettings.IsEnabled)
00292                     {
00293                         // Show the autogenerated passphrase and SSID.
00294                         if (String.IsNullOrEmpty(txtPassphrase.Text))
00295                         {
00296                             txtPassphrase.Text = _publisher.Advertisement.LegacySettings.Passphrase.Password;
00297                         }
00298
00299                         if (String.IsNullOrEmpty(txtSsid.Text))
00300                         {
00301                             txtSsid.Text = _publisher.Advertisement.LegacySettings.Ssid;
00302                         }
00303                     }
00304                 });
00305             }
00306
00307             rootPage.NotifyUserFromBackground($"Advertisement: Status: {statusEventArgs.Status}, Error: {statusEventArgs.Error}", NotifyType.StatusMessage);
00308             return;
00309         }
00310
00311         private void OnSocketConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
00312         {
00313             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00314             {
00315                 rootPage.NotifyUser("Connecting to remote side on L4 layer...", NotifyType.StatusMessage);
00316                 StreamSocket serverSocket = args.Socket;
00317
00318                 // Look up the WiFiDirectDevice associated with this StreamSocketListener.
00319                 WiFiDirectDevice wfdDevice;
00320                 if (!_pendingConnections.TryRemove(sender, out wfdDevice))
00321                 {
00322                     rootPage.NotifyUser("Unexpected connection ignored.", NotifyType.ErrorMessage);
00323                     serverSocket.Dispose();
00324                     return;
00325                 }
00326
00327                 SocketReaderWriter socketRW = new SocketReaderWriter(serverSocket, rootPage);
00328
00329                 // The first message sent is the name of the connection.
00330                 string message = await socketRW.ReadMessageAsync();
00331
00332                 // Add this connection to the list of active connections.
00333                 ConnectedDevices.Add(new ConnectedDevice(message ?? "(unnamed)", wfdDevice, socketRW));
00334
00335                 while (message != null)
00336                 {
00337                     message = await socketRW.ReadMessageAsync();
00338                 }
00339             });
00340         }
00341
00342         private void OnConnectionStatusChanged(WiFiDirectDevice sender, object arg)
00343         {
00344             rootPage.NotifyUserFromBackground($"Connection status changed: {sender.ConnectionStatus}", NotifyType.StatusMessage);
00345
00346             if (sender.ConnectionStatus == WiFiDirectConnectionStatus.Disconnected)
00347             {
00348                 // TODO: Should we remove this connection from the list?
00349                 // (Yes, probably.)
00350             }
00351         }
00352
00353         private async void btnSendMessage_Click(object sender, RoutedEventArgs e)
00354         {
00355             var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
00356             await connectedDevice.SocketRW.WriteMessageAsync(txtSendMessage.Text);
00357         }
00358
00359         private void btnCloseDevice_Click(object sender, RoutedEventArgs e)
00360         {
00361             var connectedDevice = (ConnectedDevice)lvConnectedDevices.SelectedItem;
00362             ConnectedDevices.Remove(connectedDevice);
00363
00364             // Close socket and WiFiDirect object
00365             connectedDevice.Dispose();
00366         }
00367     }
00368 }
00369
Generated on Fri Nov 15 2024 22:22:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Tasks/RfcommServerTask.cs Source File

  • BluetoothRfcommChat
  • cs
  • Tasks

RfcommServerTask.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Background;
00016 using Windows.Devices.Bluetooth.Background;
00017 using Windows.Storage;
00018 using Windows.Storage.Streams;
00019 using Windows.System.Threading;
00020 using Windows.Networking.Sockets;
00021 using Windows.Devices.Bluetooth;
00022
00023 namespace BackgroundTasks
00024 {
00025     // A background task always implements the IBackgroundTask interface.
00026     public sealed class RfcommServerTask : IBackgroundTask
00027     {
00028         // Networking
00029         private StreamSocket socket = null;
00030         private DataReader reader = null;
00031         private DataWriter writer = null;
00032         private BluetoothDevice remoteDevice = null;
00033
00034         private BackgroundTaskDeferral deferral = null;
00035         private IBackgroundTaskInstance taskInstance = null;
00036         private BackgroundTaskCancellationReason cancelReason = BackgroundTaskCancellationReason.Abort;
00037         private bool cancelRequested = false;
00038
00039         ThreadPoolTimer periodicTimer = null;
00040         /// <summary>
00041         /// The entry point of a background task.
00042         /// </summary>
00043         /// <param name="taskInstance">The current background task instance.</param>
00044         public async void Run(IBackgroundTaskInstance taskInstance)
00045         {
00046             // Get the deferral to prevent the task from closing prematurely
00047             deferral = taskInstance.GetDeferral();
00048
00049             // Setup our onCanceled callback and progress
00050             this.taskInstance = taskInstance;
00051             this.taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
00052             this.taskInstance.Progress = 0;
00053
00054             // Store a setting so that the app knows that the task is running.
00055             ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = true;
00056
00057             periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(new TimerElapsedHandler(PeriodicTimerCallback), TimeSpan.FromSeconds(1));
00058
00059             try
00060             {
00061                 RfcommConnectionTriggerDetails details = (RfcommConnectionTriggerDetails)taskInstance.TriggerDetails;
00062                 if (details != null)
00063                 {
00064                     socket = details.Socket;
00065                     remoteDevice = details.RemoteDevice;
00066                     ApplicationData.Current.LocalSettings.Values["RemoteDeviceName"] = remoteDevice.Name;
00067
00068                     writer = new DataWriter(socket.OutputStream);
00069                     reader = new DataReader(socket.InputStream);
00070                 }
00071                 else
00072                 {
00073                     ApplicationData.Current.LocalSettings.Values["BackgroundTaskStatus"] = "Trigger details returned null";
00074                     deferral.Complete();
00075                 }
00076
00077                 var result = await ReceiveDataAsync();
00078             }
00079             catch (Exception ex)
00080             {
00081                 reader = null;
00082                 writer = null;
00083                 socket = null;
00084                 deferral.Complete();
00085
00086                 Debug.WriteLine("Exception occurred while initializing the connection, hr = " + ex.HResult.ToString("X"));
00087             }
00088         }
00089
00090         private void OnCanceled(IBackgroundTaskInstance taskInstance, BackgroundTaskCancellationReason reason)
00091         {
00092             cancelReason = reason;
00093             cancelRequested = true;
00094
00095             ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = cancelReason.ToString();
00096             ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
00097             ApplicationData.Current.LocalSettings.Values["ReceivedMessage"] = "";
00098             // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
00099             deferral.Complete();
00100         }
00101
00102         private async Task<int> ReceiveDataAsync()
00103         {
00104             while (true)
00105             {
00106                 uint readLength = await reader.LoadAsync(sizeof(uint));
00107                 if (readLength < sizeof(uint))
00108                 {
00109                     ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
00110                     // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
00111                     deferral.Complete();
00112                 }
00113                 uint currentLength = reader.ReadUInt32();
00114
00115                 readLength = await reader.LoadAsync(currentLength);
00116                 if (readLength < currentLength)
00117                 {
00118                     ApplicationData.Current.LocalSettings.Values["IsBackgroundTaskActive"] = false;
00119                     // Complete the background task (this raises the OnCompleted event on the corresponding BackgroundTaskRegistration).
00120                     deferral.Complete();
00121                 }
00122                 string message = reader.ReadString(currentLength);
00123
00124                 ApplicationData.Current.LocalSettings.Values["ReceivedMessage"] = message;
00125                 taskInstance.Progress += 1;
00126             }
00127         }
00128
00129         /// <summary>
00130         /// Periodically check if there's a new message and if there is, send it over the socket
00131         /// </summary>
00132         /// <param name="timer"></param>
00133
00134         private async void PeriodicTimerCallback(ThreadPoolTimer timer)
00135         {
00136             if (!cancelRequested)
00137             {
00138                 string message = (string)ApplicationData.Current.LocalSettings.Values["SendMessage"];
00139                 if (!string.IsNullOrEmpty(message))
00140                 {
00141                     try
00142                     {
00143                         // Make sure that the connection is still up and there is a message to send
00144                         if (socket != null)
00145                         {
00146                             writer.WriteUInt32((uint)message.Length);
00147                             writer.WriteString(message);
00148                             await writer.StoreAsync();
00149
00150                             ApplicationData.Current.LocalSettings.Values["SendMessage"] = null;
00151                         }
00152                         else
00153                         {
00154                             cancelReason = BackgroundTaskCancellationReason.ConditionLoss;
00155                             deferral.Complete();
00156                         }
00157                     }
00158                     catch (Exception ex)
00159                     {
00160                         ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = ex.Message;
00161                         ApplicationData.Current.LocalSettings.Values["SendMessage"] = null;
00162                         deferral.Complete();
00163                     }
00164                 }
00165             }
00166             else
00167             {
00168                 // Timer clean up
00169                 periodicTimer.Cancel();
00170                 //
00171                 // Write to LocalSettings to indicate that this background task ran.
00172                 //
00173                 ApplicationData.Current.LocalSettings.Values["TaskCancelationReason"] = cancelReason.ToString();
00174             }
00175         }
00176     }
00177 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/Scenario1_DataEvents.xaml.h Source File

  • OrientationSensor
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038         void ScenarioEnable();
00039         void ScenarioDisable();
00040
00041     private:
00042         SDKTemplate::MainPage^ rootPage = MainPage::Current;
00043         Windows::Devices::Sensors::OrientationSensor^ sensor;
00044         Windows::Foundation::EventRegistrationToken visibilityToken;
00045         Windows::Foundation::EventRegistrationToken readingToken;
00046
00047         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00048         void ReadingChanged(Windows::Devices::Sensors::OrientationSensor^ sender, Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs^ e);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameHud.cpp Source File

  • Simple3DGameDX
  • cpp

GameHud.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "GameHud.h"
00014 #include "GameConstants.h"
00015 #include "GameUIConstants.h"
00016
00017 using namespace Microsoft::WRL;
00018 using namespace Windows::UI::Core;
00019 using namespace Windows::ApplicationModel;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Storage;
00022 using namespace Windows::UI::ViewManagement;
00023 using namespace Windows::Graphics::Display;
00024 using namespace D2D1;
00025
00026 //----------------------------------------------------------------------
00027
00028 GameHud::GameHud(
00029     _In_ const std::shared_ptr<DX::DeviceResources>& deviceResources,
00030     _In_ Platform::String^ titleHeader,
00031     _In_ Platform::String^ titleBody
00032     ) :
00033     m_deviceResources(deviceResources),
00034     m_titleHeader(titleHeader),
00035     m_titleBody(titleBody)
00036 {
00037     m_showTitle = true;
00038     m_titleBodyVerticalOffset = GameConstants::Margin;
00039     m_logoSize = D2D1::SizeF(0.0f, 0.0f);
00040
00041     auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00042
00043     DX::ThrowIfFailed(
00044         dwriteFactory->CreateTextFormat(
00045             L"Segoe UI",
00046             nullptr,
00047             DWRITE_FONT_WEIGHT_LIGHT,
00048             DWRITE_FONT_STYLE_NORMAL,
00049             DWRITE_FONT_STRETCH_NORMAL,
00050             GameConstants::HudBodyPointSize,
00051             L"en-us",
00052             &m_textFormatBody
00053             )
00054         );
00055     DX::ThrowIfFailed(
00056         dwriteFactory->CreateTextFormat(
00057             L"Segoe UI Symbol",
00058             nullptr,
00059             DWRITE_FONT_WEIGHT_LIGHT,
00060             DWRITE_FONT_STYLE_NORMAL,
00061             DWRITE_FONT_STRETCH_NORMAL,
00062             GameConstants::HudBodyPointSize,
00063             L"en-us",
00064             &m_textFormatBodySymbol
00065             )
00066         );
00067     DX::ThrowIfFailed(
00068         dwriteFactory->CreateTextFormat(
00069             L"Segoe UI Light",
00070             nullptr,
00071             DWRITE_FONT_WEIGHT_LIGHT,
00072             DWRITE_FONT_STYLE_NORMAL,
00073             DWRITE_FONT_STRETCH_NORMAL,
00074             GameConstants::HudTitleHeaderPointSize,
00075             L"en-us",
00076             &m_textFormatTitleHeader
00077             )
00078         );
00079     DX::ThrowIfFailed(
00080         dwriteFactory->CreateTextFormat(
00081             L"Segoe UI Light",
00082             nullptr,
00083             DWRITE_FONT_WEIGHT_LIGHT,
00084             DWRITE_FONT_STYLE_NORMAL,
00085             DWRITE_FONT_STRETCH_NORMAL,
00086             GameConstants::HudTitleBodyPointSize,
00087             L"en-us",
00088             &m_textFormatTitleBody
00089             )
00090         );
00091
00092     DX::ThrowIfFailed(m_textFormatBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00093     DX::ThrowIfFailed(m_textFormatBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00094     DX::ThrowIfFailed(m_textFormatBodySymbol->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00095     DX::ThrowIfFailed(m_textFormatBodySymbol->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00096     DX::ThrowIfFailed(m_textFormatTitleHeader->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00097     DX::ThrowIfFailed(m_textFormatTitleHeader->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00098     DX::ThrowIfFailed(m_textFormatTitleBody->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
00099     DX::ThrowIfFailed(m_textFormatTitleBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
00100 }
00101
00102 //----------------------------------------------------------------------
00103
00104 void GameHud::CreateDeviceDependentResources()
00105 {
00106     auto location = Package::Current->InstalledLocation;
00107     Platform::String^ path = Platform::String::Concat(location->Path, "\\");
00108     path = Platform::String::Concat(path, "Assets\\windows-sdk.png");
00109
00110     auto wicFactory = m_deviceResources->GetWicImagingFactory();
00111
00112     ComPtr<IWICBitmapDecoder> wicBitmapDecoder;
00113     DX::ThrowIfFailed(
00114         wicFactory->CreateDecoderFromFilename(
00115             path->Data(),
00116             nullptr,
00117             GENERIC_READ,
00118             WICDecodeMetadataCacheOnDemand,
00119             &wicBitmapDecoder
00120             )
00121         );
00122
00123     ComPtr<IWICBitmapFrameDecode> wicBitmapFrame;
00124     DX::ThrowIfFailed(
00125         wicBitmapDecoder->GetFrame(0, &wicBitmapFrame)
00126         );
00127
00128     ComPtr<IWICFormatConverter> wicFormatConverter;
00129     DX::ThrowIfFailed(
00130         wicFactory->CreateFormatConverter(&wicFormatConverter)
00131         );
00132
00133     DX::ThrowIfFailed(
00134         wicFormatConverter->Initialize(
00135             wicBitmapFrame.Get(),
00136             GUID_WICPixelFormat32bppPBGRA,
00137             WICBitmapDitherTypeNone,
00138             nullptr,
00139             0.0,
00140             WICBitmapPaletteTypeCustom  // The BGRA format has no palette so this value is ignored.
00141             )
00142         );
00143
00144     double dpiX = 96.0f;
00145     double dpiY = 96.0f;
00146     DX::ThrowIfFailed(
00147         wicFormatConverter->GetResolution(&dpiX, &dpiY)
00148         );
00149
00150     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00151
00152     // Create D2D Resources
00153     DX::ThrowIfFailed(
00154         d2dContext->CreateBitmapFromWicBitmap(
00155             wicFormatConverter.Get(),
00156             BitmapProperties(
00157                 PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
00158                 static_cast<float>(dpiX),
00159                 static_cast<float>(dpiY)
00160                 ),
00161             &m_logoBitmap
00162             )
00163         );
00164
00165     m_logoSize = m_logoBitmap->GetSize();
00166
00167     DX::ThrowIfFailed(
00168         d2dContext->CreateSolidColorBrush(
00169             D2D1::ColorF(D2D1::ColorF::White),
00170             &m_textBrush
00171             )
00172         );
00173 }
00174
00175 //----------------------------------------------------------------------
00176
00177 void GameHud::CreateWindowSizeDependentResources()
00178 {
00179     auto windowBounds = m_deviceResources->GetLogicalSize();
00180
00181     m_maxTitleSize.width = windowBounds.Width - GameConstants::HudSafeWidth;
00182     m_maxTitleSize.height = windowBounds.Height;
00183
00184     float headerWidth = m_maxTitleSize.width - (m_logoSize.width + 2 * GameConstants::Margin);
00185
00186     if (headerWidth > 0)
00187     {
00188         auto dwriteFactory = m_deviceResources->GetDWriteFactory();
00189
00190         // Only resize the text layout for the Title area when there is enough space.
00191         m_showTitle = true;
00192
00193         DX::ThrowIfFailed(
00194             dwriteFactory->CreateTextLayout(
00195                 m_titleHeader->Data(),
00196                 m_titleHeader->Length(),
00197                 m_textFormatTitleHeader.Get(),
00198                 headerWidth,
00199                 m_maxTitleSize.height,
00200                 &m_titleHeaderLayout
00201                 )
00202             );
00203
00204         DWRITE_TEXT_METRICS metrics = {0};
00205         DX::ThrowIfFailed(
00206             m_titleHeaderLayout->GetMetrics(&metrics)
00207             );
00208
00209         // Compute the vertical size of the laid out Header and logo.  This could change
00210         // based on the window size and the layout of the text.  In some cases the text
00211         // may wrap.
00212         m_titleBodyVerticalOffset = max(m_logoSize.height + GameConstants::Margin * 2, metrics.height + 2 * GameConstants::Margin);
00213
00214         DX::ThrowIfFailed(
00215             dwriteFactory->CreateTextLayout(
00216                 m_titleBody->Data(),
00217                 m_titleBody->Length(),
00218                 m_textFormatTitleBody.Get(),
00219                 m_maxTitleSize.width,
00220                 m_maxTitleSize.height - m_titleBodyVerticalOffset,
00221                 &m_titleBodyLayout
00222                 )
00223             );
00224     }
00225     else
00226     {
00227         // Not enough horizontal space for the titles so just turn it off.
00228         m_showTitle = false;
00229     }
00230 }
00231
00232 //----------------------------------------------------------------------
00233
00234 void GameHud::Render(_In_ Simple3DGame^ game)
00235 {
00236     auto d2dContext = m_deviceResources->GetD2DDeviceContext();
00237     auto windowBounds = m_deviceResources->GetLogicalSize();
00238
00239     if (m_showTitle)
00240     {
00241         d2dContext->DrawBitmap(
00242             m_logoBitmap.Get(),
00243             D2D1::RectF(
00244                 GameConstants::Margin,
00245                 GameConstants::Margin,
00246                 m_logoSize.width + GameConstants::Margin,
00247                 m_logoSize.height + GameConstants::Margin
00248                 )
00249             );
00250         d2dContext->DrawTextLayout(
00251             Point2F(m_logoSize.width + 2.0f * GameConstants::Margin, GameConstants::Margin),
00252             m_titleHeaderLayout.Get(),
00253             m_textBrush.Get()
00254             );
00255         d2dContext->DrawTextLayout(
00256             Point2F(GameConstants::Margin, m_titleBodyVerticalOffset),
00257             m_titleBodyLayout.Get(),
00258             m_textBrush.Get()
00259             );
00260     }
00261
00262     if (game != nullptr)
00263     {
00264         // This section is only used after the game state has been initialized.
00265         static const int bufferLength = 256;
00266         static char16 wsbuffer[bufferLength];
00267         int length = swprintf_s(
00268             wsbuffer,
00269             bufferLength,
00270             L"Hits:\t%10d\nShots:\t%10d\nTime:\t%8.1f",
00271             game->TotalHits(),
00272             game->TotalShots(),
00273             game->TimeRemaining()
00274             );
00275
00276         d2dContext->DrawText(
00277             wsbuffer,
00278             length,
00279             m_textFormatBody.Get(),
00280             D2D1::RectF(
00281                 windowBounds.Width - GameConstants::HudRightOffset,
00282                 GameConstants::HudTopOffset,
00283                 windowBounds.Width,
00284                 GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3
00285                 ),
00286             m_textBrush.Get()
00287             );
00288
00289         // Using the unicode characters starting at 0x2780 ( ➀ ) for the consecutive levels of the game.
00290         // For completed levels start with 0x278A ( ➊ ) (This is 0x2780 + 10).
00291         uint32 levelCharacter[6];
00292         for (uint32 i = 0; i < 6; i++)
00293         {
00294             levelCharacter[i] = 0x2780 + i + ((static_cast<uint32>(game->LevelCompleted()) == i) ? 10 : 0);
00295         }
00296         length = swprintf_s(
00297             wsbuffer,
00298             bufferLength,
00299             L"%lc %lc %lc %lc %lc %lc",
00300             levelCharacter[0],
00301             levelCharacter[1],
00302             levelCharacter[2],
00303             levelCharacter[3],
00304             levelCharacter[4],
00305             levelCharacter[5]
00306             );
00307         d2dContext->DrawText(
00308             wsbuffer,
00309             length,
00310             m_textFormatBodySymbol.Get(),
00311             D2D1::RectF(
00312                 windowBounds.Width - GameConstants::HudRightOffset,
00313                 GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize + GameConstants::Margin) * 3 + GameConstants::Margin,
00314                 windowBounds.Width,
00315                 GameConstants::HudTopOffset + (GameConstants::HudBodyPointSize+ GameConstants::Margin) * 4
00316                 ),
00317             m_textBrush.Get()
00318             );
00319
00320         if (game->IsActivePlay())
00321         {
00322             // Draw a rectangle for the touch input for the move control.
00323             d2dContext->DrawRectangle(
00324                 D2D1::RectF(
00325                     0.0f,
00326                     windowBounds.Height - GameConstants::TouchRectangleSize,
00327                     GameConstants::TouchRectangleSize,
00328                     windowBounds.Height
00329                     ),
00330                 m_textBrush.Get()
00331                 );
00332             // Draw a rectangle for the touch input for the fire control.
00333             d2dContext->DrawRectangle(
00334                 D2D1::RectF(
00335                     windowBounds.Width - GameConstants::TouchRectangleSize,
00336                     windowBounds.Height - GameConstants::TouchRectangleSize,
00337                     windowBounds.Width,
00338                     windowBounds.Height
00339                     ),
00340                 m_textBrush.Get()
00341                 );
00342
00343             // Draw the cross hairs
00344             d2dContext->DrawLine(
00345                 D2D1::Point2F(windowBounds.Width / 2.0f - GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00346                 D2D1::Point2F(windowBounds.Width / 2.0f + GameConstants::CrossHairHalfSize, windowBounds.Height / 2.0f),
00347                 m_textBrush.Get(),
00348                 3.0f
00349                 );
00350             d2dContext->DrawLine(
00351                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f - GameConstants::CrossHairHalfSize),
00352                 D2D1::Point2F(windowBounds.Width / 2.0f, windowBounds.Height / 2.0f + GameConstants::CrossHairHalfSize),
00353                 m_textBrush.Get(),
00354                 3.0f
00355                 );
00356         }
00357     }
00358 }
00359
00360 //----------------------------------------------------------------------
00361
00362 void GameHud::ReleaseDeviceDependentResources()
00363 {
00364     m_textBrush.Reset();
00365     m_logoBitmap.Reset();
00366 }
00367 //----------------------------------------------------------------------
Generated on Fri Nov 15 2024 22:21:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_PauseAsync.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_PauseAsync.g.h"
00015 #include "MainPage.xaml.h"
00016 #include <sstream>
00017
00018 namespace SDKTemplate
00019 {
00020     [Windows::Foundation::Metadata::WebHostHidden]
00021     public ref class Scenario_PauseAsync sealed
00022     {
00023     public:
00024         Scenario_PauseAsync();
00025
00026     protected:
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00029
00030     private:
00031         static const unsigned int HResultPrivacyStatementDeclined = 0x80045509;
00032         Platform::String^ newButtonText;
00033
00034         SDKTemplate::MainPage^ rootPage;
00035         Windows::UI::Core::CoreDispatcher^ dispatcher;
00036         Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
00037         Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint^ emailConstraint;
00038         Windows::Media::SpeechRecognition::SpeechRecognitionListConstraint^ phoneConstraint;
00039
00040         void Recognize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         void EmailButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00042         void PhoneButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043
00044         void InitializeRecognizer();
00045         void EnableUI(bool newState);
00046
00047         Windows::Foundation::EventRegistrationToken stateChangedToken;
00048         Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken;
00049         Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken;
00050
00051         void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
00052         void ContinuousRecognitionSession_Completed(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs ^args);
00053         void ContinuousRecognitionSession_ResultGenerated(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs ^args);
00054     };
00055 }
Generated on Fri Nov 15 2024 22:21:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/pch.cpp Source File

  • NumberFormatting
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cpp/GameUIConstants.h Source File

  • Simple3DGameDX
  • cpp

GameUIConstants.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace GameInfoOverlayConstant
00015 {
00016     static const float Width = 750.0f;
00017     static const float Height = 380.0f;
00018     static const float TitlePointSize = 32.0f;
00019     static const float TitleHeight = 50.0f;
00020     static const float Separator = 8.0f;
00021     static const float BodyPointSize = 24.0f;
00022     static const float ActionHeight = 40.0f;
00023     static const float TopMargin = 20.0f;
00024     static const float SideMargin = 20.0f;
00025     static const float BottomMargin = 5.0f;
00026 };
00027
00028 namespace GameConstants
00029 {
00030     static const float CrossHairHalfSize = 20.0f;
00031     static const float HudSafeWidth = 200.0f;
00032     static const float HudRightOffset = 175.0f;
00033     static const float HudTopOffset = 15.0f;
00034     static const float Margin = 5.0f;
00035     static const float HudBodyPointSize = 20.0f;
00036     static const float HudTitleHeaderPointSize = 16.0f;
00037     static const float HudTitleBodyPointSize = 20.0f;
00038     static const float HudLicensePointSize = 14.0f;
00039
00040     static const float TouchRectangleSize = 125.0f;
00041     static const float MinPlayableWidth = 320.0f;
00042 };
Generated on Fri Nov 15 2024 22:21:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripListView.xaml.h Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripListView.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "View\TripListview.g.h"
00015 #include "ViewModel\TripListViewModel.h"
00016
00017 namespace AdventureWorks
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class TripListView sealed
00024     {
00025     public:
00026         TripListView();
00027
00028         property TripListViewModel^ DefaultViewModel {
00029             TripListViewModel^ get();
00030         }
00031
00032     protected:
00033         void Footer_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);
00034         void tripListBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ args);
00035
00036
00037         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038
00039     private:
00040         TripListViewModel^ defaultViewModel;
00041         bool tripsLoaded = false;
00042     };
00043 }
Generated on Fri Nov 15 2024 22:19:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SecondaryViewPage Member List

This is the complete list of members for SecondaryViewPage, including all inherited members.
ClearTitle_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | SecondaryViewPage |
CreateEnterAnimation() | SecondaryViewPage | [private]
GoToMain_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | SecondaryViewPage |
HandleProtocolLaunch(Windows::Foundation::Uri const &uri) | SecondaryViewPage |
HideView_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | SecondaryViewPage |
m_releasedToken | SecondaryViewPage | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | SecondaryViewPage |
ProtocolLaunch_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | SecondaryViewPage |
SecondaryViewPage() | SecondaryViewPage |
SetTitle(hstring newTitle) | SecondaryViewPage | [private]
SetTitle_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | SecondaryViewPage |
SwitchAndAnimate(int32_t fromViewId) | SecondaryViewPage |
View_Released(SDKTemplate::ViewLifetimeControl const &sender, Windows::Foundation::IInspectable const &) | SecondaryViewPage | [private]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/Scenario3_DeviceIO.xaml.cpp Source File

  • CustomCapability
  • cpp

Scenario3_DeviceIO.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <robuffer.h>
00014 #include "MainPage.xaml.h"
00015 #include "Scenario3_DeviceIO.xaml.h"
00016 #include "DeviceList.h"
00017 #include "Fx2Driver.h"
00018
00019 using namespace Concurrency;
00020 using namespace Platform;
00021 using namespace SDKTemplate;
00022 using namespace Windows::Devices::Custom;
00023 using namespace Windows::Storage::Streams;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026
00027 DeviceIO::DeviceIO()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void DeviceIO::DeviceIOGet_Click(Platform::Object^ sender, RoutedEventArgs^ e)
00033 {
00034     CustomDevice^ fx2Device = DeviceList::Current->GetSelectedDevice();
00035     if (fx2Device == nullptr)
00036     {
00037         rootPage->NotifyUser("Fx2 device not connected or accessible", NotifyType::ErrorMessage);
00038         return;
00039     }
00040
00041     auto outputBuffer = ref new Buffer(1);
00042
00043     // The I/O control codes and their meanings are defined by the device.
00044     create_task(fx2Device->SendIOControlAsync(
00045         Fx2Driver::GetSevenSegmentDisplay,
00046         nullptr,
00047         outputBuffer
00048     )).then([this, outputBuffer](task<unsigned int> result)
00049     {
00050         try
00051         {
00052             result.get();
00053
00054             byte* data = GetArrayFromBuffer(outputBuffer);
00055
00056             rootPage->NotifyUser(
00057                 "The segment display value is " + Fx2Driver::SevenSegmentToDigit(data[0]),
00058                 NotifyType::StatusMessage
00059             );
00060         }
00061         catch (InvalidArgumentException^)
00062         {
00063             rootPage->NotifyUser("The segment display value is not yet initialized", NotifyType::StatusMessage);
00064         }
00065         catch (Exception^ exception)
00066         {
00067             rootPage->NotifyUser(exception->Message, NotifyType::ErrorMessage);
00068         }
00069     });
00070 }
00071
00072
00073 void DeviceIO::DeviceIOSet_Click(Object^ sender, RoutedEventArgs^ e)
00074 {
00075     CustomDevice^ fx2Device = DeviceList::Current->GetSelectedDevice();
00076     if (fx2Device == nullptr)
00077     {
00078         rootPage->NotifyUser("Fx2 device not connected or accessible", NotifyType::ErrorMessage);
00079         return;
00080     }
00081
00082     byte val = (byte)(DeviceIOSegmentInput->SelectedIndex + 1);
00083
00084     auto inputBuffer = ref new Buffer(1);
00085     byte* data = GetArrayFromBuffer(inputBuffer);
00086     data[0] = Fx2Driver::DigitToSevenSegment(val);
00087     inputBuffer->Length = 1;
00088
00089     // The I/O control codes and their meanings are defined by the device.
00090     create_task(fx2Device->SendIOControlAsync(
00091         Fx2Driver::SetSevenSegmentDisplay,
00092         inputBuffer,
00093         nullptr
00094     )).then([this, val](task<unsigned int> result)
00095     {
00096         try
00097         {
00098             result.get();
00099
00100             rootPage->NotifyUser("The segment display is set to " + val.ToString(), NotifyType::StatusMessage);
00101         }
00102         catch (Exception^ exception)
00103         {
00104             rootPage->NotifyUser(exception->Message, NotifyType::ErrorMessage);
00105             return;
00106         }
00107     });
00108 }
00109
Generated on Fri Nov 15 2024 22:19:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ViewModelLocator Member List

This is the complete list of members for ViewModelLocator, including all inherited members.
InitializeStore(TripStore store) | ViewModelLocator | [inline, private]
modelSet | ViewModelLocator | [private]
TripListViewModel | ViewModelLocator |
TripViewModel | ViewModelLocator |
ViewModelLocator() | ViewModelLocator | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cpp/Scenario1.xaml.h Source File

  • Compression
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.h
00013 // Declaration of the Scenario1 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario1.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024     namespace Compression
00025     {
00026         /// <summary>
00027         /// An empty page that can be used on its own or navigated to within a Frame.
00028         /// </summary>
00029         [Windows::Foundation::Metadata::WebHostHidden]
00030         public ref class Scenario1 sealed
00031         {
00032         public:
00033             Scenario1();
00034
00035         protected:
00036             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037         private:
00038             MainPage^ rootPage;
00039
00040             void DoScenario(Windows::Storage::Compression::CompressAlgorithm Algorithm);
00041
00042             void CompressAlgorithmComboBox_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043             void CompressFileButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044             void UpdateDescriptionVisibility(Windows::UI::Xaml::Controls::ComboBoxItem^ item, Windows::UI::Xaml::Visibility visibility);
00045             int CompressAlgorithmFromComboBoxItem(Windows::UI::Xaml::Controls::ComboBoxItem^ item);
00046          };
00047     }
00048 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/PcscSdk/FelicaCommands.cs Source File

  • Nfc
  • PcscSdk

FelicaCommands.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Runtime.InteropServices.WindowsRuntime;
00014 using Windows.Storage.Streams;
00015
00016 namespace Felica
00017 {
00018     /// <summary>
00019     /// Felica Check command when sent to the card the card is expected to read the byte of blocks
00020     /// specified in the block list. The service code should be in little endian format.
00021     /// </summary>
00022     public class Check : Pcsc.ReadBinary
00023     {
00024         public byte ServiceCount { get; private set; }
00025         public byte[] ServiceCodeList { get; private set; }
00026
00027         public byte BlockCount {get; private set; }
00028         public byte[] BlockList { get; private set; }
00029
00030         public Check(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)
00031             : base(0, 0)
00032         {
00033             ServiceCount = serviceCount;
00034             ServiceCodeList = serviceCodeList;
00035             BlockCount = blockCount;
00036             BlockList = blockList;
00037             base.CommandData = GetDataIn(serviceCount, serviceCodeList, blockCount, blockList);
00038         }
00039
00040         private static byte[] GetDataIn(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList)
00041         {
00042             DataWriter dataWriter = new DataWriter();
00043
00044             dataWriter.WriteByte(serviceCount);
00045             dataWriter.WriteBytes(serviceCodeList);
00046             dataWriter.WriteByte(blockCount);
00047             dataWriter.WriteBytes(blockList);
00048
00049             return dataWriter.DetachBuffer().ToArray();
00050         }
00051     }
00052     /// <summary>
00053     /// Felica Update command when sent to the card the card is expected to write the byte of blocks
00054     /// specified in the block list. The service code should be in little endian format.
00055     /// </summary>
00056     public class Update : Pcsc.UpdateBinary
00057     {
00058         public byte ServiceCount {get; private set; }
00059         public byte[] ServiceCodeList { get; private set; }
00060
00061         public byte BlockCount {get; private set; }
00062         public byte[] BlockList { get; private set; }
00063
00064         public Update(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)
00065             : base(0, GetDataIn(serviceCount, serviceCodeList, blockCount, blockList, blockData))
00066         {
00067             ServiceCount = serviceCount;
00068             ServiceCodeList = serviceCodeList;
00069             BlockCount = blockCount;
00070             BlockList = blockList;
00071         }
00072
00073         private static byte[] GetDataIn(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData)
00074         {
00075             DataWriter dataWriter = new DataWriter();
00076
00077             dataWriter.WriteByte(serviceCount);
00078             dataWriter.WriteBytes(serviceCodeList);
00079             dataWriter.WriteByte(blockCount);
00080             dataWriter.WriteBytes(blockList);
00081             dataWriter.WriteBytes(blockData);
00082
00083             return dataWriter.DetachBuffer().ToArray();
00084         }
00085     }
00086     /// <summary>
00087     /// Felica GetUid command
00088     /// </summary>
00089     public class GetUid : Pcsc.GetUid
00090     {
00091         public GetUid()
00092             : base()
00093         {
00094         }
00095     }
00096     /// <summary>
00097     /// Felica GetHistoricalBytes command
00098     /// </summary>
00099     public class GetHistoricalBytes : Pcsc.GetHistoricalBytes
00100     {
00101         public GetHistoricalBytes()
00102             : base()
00103         {
00104         }
00105     }
00106     /// <summary>
00107     /// Felica response APDU
00108     /// </summary>
00109     public class ApduResponse : Pcsc.ApduResponse
00110     {
00111         public ApduResponse()
00112             : base()
00113         {
00114         }
00115     }
00116 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/SampleConfiguration.cs Source File

  • SmartCard
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Devices.SmartCards;
00016 using Windows.UI.Xaml.Controls;
00017
00018 namespace SDKTemplate
00019 {
00020     public partial class MainPage : Page
00021     {
00022         public const string FEATURE_NAME = "Smart Card";
00023
00024         public const int ADMIN_KEY_LENGTH_IN_BYTES = 24;
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title="Create and Provision a TPM Virtual Smart Card", ClassType=typeof(Scenario1_ProvisionTPM)},
00029             new Scenario() { Title="Change Smart Card PIN", ClassType=typeof(Scenario2_ChangePIN)},
00030             new Scenario() { Title="Reset Smart Card PIN", ClassType=typeof(Scenario3_ResetPIN)},
00031             new Scenario() { Title="Change Smart Card Admin Key", ClassType=typeof(Scenario4_ChangeAdminKey)},
00032             new Scenario() { Title="Verify Response", ClassType=typeof(Scenario5_VerifyResponse)},
00033             new Scenario() { Title="Delete TPM Virtual Smart Card", ClassType=typeof(Scenario6_DeleteTPM)},
00034             new Scenario() { Title="List All Smart Cards", ClassType=typeof(Scenario7_ListAllCards)},
00035             new Scenario() { Title="Transmit APDU to Smart Card", ClassType=typeof(Scenario8_TransmitAPDU)}
00036         };
00037
00038         public Windows.Storage.Streams.IBuffer AdminKey { get; set; }
00039
00040         public String SmartCardReaderDeviceId { get; set; }
00041
00042         public async Task<SmartCard> GetSmartCard()
00043         {
00044             SmartCardReader reader = await SmartCardReader.FromIdAsync(SmartCardReaderDeviceId);
00045             IReadOnlyList<SmartCard> cards = await reader.FindAllCardsAsync();
00046
00047             if (1 != cards.Count)
00048             {
00049                 throw new InvalidOperationException("Reader has an unexpected number of cards (" + cards.Count + ")");
00050             }
00051
00052             return cards[0];
00053         }
00054
00055         public bool ValidateTPMSmartCard()
00056         {
00057             if (string.IsNullOrEmpty(SmartCardReaderDeviceId))
00058             {
00059                 return false;
00060             }
00061             return true;
00062         }
00063     }
00064
00065     public class Scenario
00066     {
00067         public string Title { get; set; }
00068         public Type ClassType { get; set; }
00069     }
00070 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCreation/cs/CustomEffect/Properties/AssemblyInfo.cs Source File

  • AudioCreation
  • cs
  • CustomEffect
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("CustomEffect")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("CustomEffect")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cppwinrt/Scenario2_Lang.cpp Source File

  • GlobalizationPreferences
  • cppwinrt

Scenario2_Lang.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_Lang.h"
00014 #include "Scenario2_Lang.g.cpp"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Globalization;
00020 using namespace Windows::System::UserProfile;
00021 using namespace Windows::UI::Xaml;
00022
00023 namespace
00024 {
00025     hstring ReportLanguageData(Language const& lang)
00026     {
00027         return L"Display Name: " + lang.DisplayName() + L"\n" +
00028             L"Language Tag: " + lang.LanguageTag() + L"\n" +
00029             L"Native Name: " + lang.NativeName() + L"\n" +
00030             L"Script Code: " + lang.Script() + L"\n\n";
00031     }
00032 }
00033
00034 namespace winrt::SDKTemplate::implementation
00035 {
00036     Scenario2_Lang::Scenario2_Lang()
00037     {
00038         InitializeComponent();
00039     }
00040
00041     void Scenario2_Lang::ShowResults_Click(IInspectable const&, RoutedEventArgs const&)
00042     {
00043         // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to
00044         // obtain the user's preferred language characteristics.
00045         hstring topUserLanguage = GlobalizationPreferences::Languages().GetAt(0);
00046         Windows::Globalization::Language userLanguage(topUserLanguage);
00047
00048         // This obtains the language characteristics by providing a BCP47 tag.
00049         Windows::Globalization::Language exampleLanguage(L"ja");
00050
00051         // Display the results
00052         OutputTextBlock().Text(L"User's Preferred Language\n" + ReportLanguageData(userLanguage) +
00053             L"Example Language by BCP47 tag (ja)\n" + ReportLanguageData(exampleLanguage));
00054     }
00055 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SpinningCubeRenderer Member List

This is the complete list of members for SpinningCubeRenderer, including all inherited members.
CreateDeviceDependentResourcesAsync() | SpinningCubeRenderer | [inline]
degreesPerSecond | SpinningCubeRenderer | [private]
deviceResources | SpinningCubeRenderer | [private]
Dispose() | Disposer | [inline]
Dispose(bool disposeManagedResources) | Disposer | [inline, protected, virtual]
Disposer() | Disposer | [inline, protected]
geometryShader | SpinningCubeRenderer | [private]
indexBuffer | SpinningCubeRenderer | [private]
indexCount | SpinningCubeRenderer | [private]
inputLayout | SpinningCubeRenderer | [private]
IsDisposed | Disposer | [protected]
loadingComplete | SpinningCubeRenderer | [private]
modelConstantBuffer | SpinningCubeRenderer | [private]
modelConstantBufferData | SpinningCubeRenderer | [private]
pixelShader | SpinningCubeRenderer | [private]
position | SpinningCubeRenderer | [private]
Position | SpinningCubeRenderer |
PositionHologram(SpatialPointerPose pointerPose) | SpinningCubeRenderer | [inline]
ReleaseDeviceDependentResources() | SpinningCubeRenderer | [inline]
RemoveAndDispose< T >(ref T objectToDispose) | Disposer | [inline, protected]
RemoveToDispose< T >(T objectToRemove) | Disposer | [inline, protected]
Render() | SpinningCubeRenderer | [inline]
SpinningCubeRenderer(DeviceResources deviceResources) | SpinningCubeRenderer | [inline]
ToDispose< T >(T objectToDispose) | Disposer | [inline, protected]
Update(StepTimer timer) | SpinningCubeRenderer | [inline]
usingVprtShaders | SpinningCubeRenderer | [private]
vertexBuffer | SpinningCubeRenderer | [private]
vertexShader | SpinningCubeRenderer | [private]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cppwinrt/Scenario2.cpp Source File

  • Logging
  • cppwinrt

Scenario2.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2.h"
00014 #include "Scenario2.g.cpp"
00015 #include "LoggingScenarioHelpers.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation;
00019 using namespace winrt::Windows::UI::Xaml;
00020 using namespace winrt::Windows::UI::Xaml::Controls;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::SDKTemplate::implementation;
00023
00024 Scenario2::Scenario2()
00025 {
00026     InitializeComponent();
00027 }
00028
00029 fire_and_forget
00030 Scenario2::DoScenario(IInspectable const&, RoutedEventArgs const&)
00031 {
00032     MainPage::Current().NotifyUser(L"Scenario running...", NotifyType::StatusMessage);
00033     DoScenarioButton().IsEnabled(false);
00034
00035     // Run the scenario asynchronously so the UI can update.
00036     co_await resume_background();
00037     co_await _instance.DoScenarioAsync();
00038
00039     // After the scenario completes, re-enable UI controls and display a message.
00040     co_await resume_foreground(Dispatcher());
00041     DoScenarioButton().IsEnabled(true);
00042     MainPage::Current().NotifyUser(L"Scenario finished.", NotifyType::StatusMessage);
00043 }
00044
00045 void
00046 Scenario2::EnableDisableLogging(IInspectable const&, RoutedEventArgs const&)
00047 {
00048     if (_instance.LoggingEnabled())
00049     {
00050         MainPage::Current().NotifyUser(L"Disabling logging...", NotifyType::StatusMessage);
00051     }
00052     else
00053     {
00054         MainPage::Current().NotifyUser(L"Enabling logging...", NotifyType::StatusMessage);
00055     }
00056
00057     _instance.ToggleLoggingEnabledDisabled();
00058     UpdateControls();
00059
00060     if (_instance.LoggingEnabled())
00061     {
00062         MainPage::Current().NotifyUser(L"Logging enabled.", NotifyType::StatusMessage);
00063     }
00064     else
00065     {
00066         MainPage::Current().NotifyUser(L"Logging disabled.", NotifyType::StatusMessage);
00067     }
00068 }
00069
00070 void
00071 Scenario2::OnNavigatedTo(NavigationEventArgs const&)
00072 {
00073     _statusChangedToken = _instance.StatusChanged({ this, &Scenario2::OnStatusChanged });
00074     UpdateControls();
00075 }
00076
00077 void
00078 Scenario2::OnNavigatedFrom(NavigationEventArgs const&)
00079 {
00080     _instance.StatusChanged(_statusChangedToken);
00081 }
00082
00083 void
00084 Scenario2::UpdateControls()
00085 {
00086     if (_instance.LoggingEnabled())
00087     {
00088         InputTextBlock1().Text(
00089             L"Logging is enabled. Click 'Disable Logging' to disable logging. With logging enabled, you can click 'Log Messages' to use the logging API to generate log files.");
00090         EnableDisableLoggingButton().Content(box_value(L"Disable Logging"));
00091
00092         if (_instance.IsBusy())
00093         {
00094             EnableDisableLoggingButton().IsEnabled(false);
00095             DoScenarioButton().IsEnabled(false);
00096         }
00097         else
00098         {
00099             EnableDisableLoggingButton().IsEnabled(true);
00100             DoScenarioButton().IsEnabled(true);
00101         }
00102     }
00103     else
00104     {
00105         InputTextBlock1().Text(
00106             L"Logging is disabled. Click 'Enable Logging' to enable logging. After you enable logging you can click 'Log Messages' to use the logging API to generate log files.");
00107         EnableDisableLoggingButton().Content(box_value(L"Enable Logging"));
00108         DoScenarioButton().IsEnabled(false);
00109         EnableDisableLoggingButton().IsEnabled(!_instance.IsBusy());
00110     }
00111 }
00112
00113 void
00114 Scenario2::AddMessage(LPCWSTR message)
00115 {
00116     TextBox statusMessageList = StatusMessageList();
00117     std::wstring statusText(statusMessageList.Text());
00118     statusText += message;
00119     statusText += L"\r\n";
00120     statusMessageList.Text(statusText);
00121     statusMessageList.Select(static_cast<int32_t>(statusText.size()), 0);
00122
00123     ScrollViewer viewer = FindScrollViewer(statusMessageList);
00124     if (viewer != nullptr)
00125     {
00126         viewer.ChangeView(nullptr, statusMessageList.ActualHeight(), nullptr);
00127     }
00128 }
00129
00130 fire_and_forget
00131 Scenario2::OnStatusChanged(SDKTemplate::LoggingScenarioEventArgs args)
00132 {
00133     // Switch to UI thread.
00134     co_await resume_foreground(Dispatcher());
00135
00136     switch (args.Type())
00137     {
00138     case LoggingScenarioEventType::BusyStatusChanged:
00139         UpdateControls();
00140         break;
00141
00142     case LoggingScenarioEventType::LogFileGenerated:
00143     {
00144         hstring logFileFullPath = args.LogFileFullPath();
00145         if (logFileFullPath.empty())
00146         {
00147             AddMessage(L"LogFileGenerated: none, nothing logged since saving the last file.");
00148         }
00149         else
00150         {
00151             // Add a message to the UI indicating a new log file was created.
00152             std::wstring fullPath(logFileFullPath);
00153             std::wstring directoryName;
00154             std::wstring fileName;
00155             std::size_t lastSlashPos = fullPath.find_last_of(L'\\');
00156             if (lastSlashPos > 0 && lastSlashPos < fullPath.size() - 1)
00157             {
00158                 directoryName = fullPath.substr(0, lastSlashPos);
00159                 fileName = fullPath.substr(lastSlashPos + 1, fullPath.size() - (lastSlashPos + 1));
00160             }
00161
00162             ViewLogInfo().Text(
00163                 L"Log folder: \"" + directoryName + L"\"\r\n"
00164                 L"- To view with tracerpt: tracerpt.exe \"" + fullPath + L"\" -of XML -o LogFile.xml\r\n"
00165                 L"- To view with Windows Performance Toolkit (WPT):\n"
00166                 L"   xperf -merge \"" + fullPath + "\" merged.etl\n"
00167                 L"   wpa.exe merged.etl");
00168             AddMessage((L"LogFileGenerated: " + fileName).c_str());
00169         }
00170     }
00171         break;
00172
00173     case LoggingScenarioEventType::LoggingEnabledDisabled:
00174         AddMessage(args.Enabled()
00175             ? L"Logging has been enabled."
00176             : L"Logging has been disabled.");
00177         break;
00178
00179     default:
00180         AddMessage(L"Unrecognized event.");
00181         break;
00182     }
00183 }
Generated on Fri Nov 15 2024 22:19:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cppwinrt/Scenario4.h Source File

  • FileThumbnails
  • cppwinrt

Scenario4.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario4.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario4 : Scenario4T<Scenario4>
00020     {
00021         Scenario4();
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         fire_and_forget GetThumbnailButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario4 : Scenario4T<Scenario4, implementation::Scenario4>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundActivation/cs/Scenario4_TimeTriggeredTask.xaml.cs Source File

  • BackgroundActivation
  • cs

Scenario4_TimeTriggeredTask.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using SDKTemplate;
00014 using Windows.ApplicationModel.Background;
00015 using Windows.Storage;
00016 using Windows.UI.Core;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class TimeTriggeredTask : Page
00029     {
00030         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00031         // as NotifyUser()
00032         MainPage rootPage = MainPage.Current;
00033
00034         public TimeTriggeredTask()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         /// <summary>
00040         /// Invoked when this page is about to be displayed in a Frame.
00041         /// </summary>
00042         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00043         /// property is typically used to configure the page.</param>
00044         protected override void OnNavigatedTo(NavigationEventArgs e)
00045         {
00046             foreach (var task in BackgroundTaskRegistration.AllTasks)
00047             {
00048                 if (task.Value.Name == BackgroundTaskSample.TimeTriggeredTaskName)
00049                 {
00050                     AttachProgressAndCompletedHandlers(task.Value);
00051                     BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.TimeTriggeredTaskName, true);
00052                     break;
00053                 }
00054             }
00055
00056             UpdateUI();
00057         }
00058
00059         /// <summary>
00060         /// Register a TimeTriggeredTask.
00061         /// </summary>
00062         /// <param name="sender"></param>
00063         /// <param name="e"></param>
00064         private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
00065         {
00066             var task = BackgroundTaskSample.RegisterBackgroundTask(null,
00067                                                                    BackgroundTaskSample.TimeTriggeredTaskName,
00068                                                                    new TimeTrigger(15, false),
00069                                                                    null);
00070             AttachProgressAndCompletedHandlers(task);
00071             UpdateUI();
00072         }
00073
00074         /// <summary>
00075         /// Unregister a TimeTriggeredTask.
00076         /// </summary>
00077         /// <param name="sender"></param>
00078         /// <param name="e"></param>
00079         private void UnregisterBackgroundTask(object sender, RoutedEventArgs e)
00080         {
00081             BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.TimeTriggeredTaskName);
00082             UpdateUI();
00083         }
00084
00085         /// <summary>
00086         /// Attach progress and completed handers to a background task.
00087         /// </summary>
00088         /// <param name="task">The task to attach progress and completed handlers to.</param>
00089         private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
00090         {
00091             task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
00092             task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
00093         }
00094
00095         /// <summary>
00096         /// Handle background task progress.
00097         /// </summary>
00098         /// <param name="task">The task that is reporting progress.</param>
00099         /// <param name="e">Arguments of the progress report.</param>
00100         private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
00101         {
00102             var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00103             {
00104                 var progress = "Progress: " + args.Progress + "%";
00105                 BackgroundTaskSample.TimeTriggeredTaskProgress = progress;
00106                 UpdateUI();
00107             });
00108         }
00109
00110         /// <summary>
00111         /// Handle background task completion.
00112         /// </summary>
00113         /// <param name="task">The task that is reporting completion.</param>
00114         /// <param name="e">Arguments of the completion report.</param>
00115         private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
00116         {
00117             UpdateUI();
00118         }
00119
00120         /// <summary>
00121         /// Update the scenario UI.
00122         /// </summary>
00123         private async void UpdateUI()
00124         {
00125             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
00126             () =>
00127             {
00128                 RegisterButton.IsEnabled = !BackgroundTaskSample.TimeTriggeredTaskRegistered;
00129                 UnregisterButton.IsEnabled = BackgroundTaskSample.TimeTriggeredTaskRegistered;
00130                 Progress.Text = BackgroundTaskSample.TimeTriggeredTaskProgress;
00131                 Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.TimeTriggeredTaskName);
00132             });
00133         }
00134
00135     }
00136 }
Generated on Fri Nov 15 2024 22:18:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CustomCommand.xaml.cpp Source File

  • MessageDialog
  • cpp

CustomCommand.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // CustomCommand.xaml.cpp
00013 // Implementation of the CustomCommand class
00014 //
00015
00016 #include "pch.h"
00017 #include "CustomCommand.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Windows::UI::Popups;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Navigation;
00025
00026 CustomCommand::CustomCommand()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void CustomCommand::OnNavigatedTo(NavigationEventArgs^ e)
00032 {
00033     rootPage = MainPage::Current;
00034 }
00035
00036 /// <summary>
00037 /// Click handler for the 'CustomCommandButton' button.
00038 /// Demonstrates the use of a message dialog with custom commands, command callbacks, and a default command.
00039 /// A message will be displayed indicating which command was invoked on the dialog.
00040 /// In this scenario, 'Install updates' is selected as the default choice.
00041 /// </summary>
00042 /// <param name="sender">The Object that caused this event to be fired.</param>
00043 /// <param name="e">State information and event data associated with the routed event.</param>
00044 void CustomCommand::CustomCommandButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00045 {
00046     // Create the message dialog and set its content and title
00047     auto messageDialog = ref new MessageDialog("New updates have been found for this program. Would you like to install the new updates?", "Updates available");
00048
00049     // Add commands and set their callbacks
00050     messageDialog->Commands->Append(ref new UICommand("Don't install", ref new UICommandInvokedHandler([this](IUICommand^ command)
00051     {
00052         rootPage->NotifyUser("The 'Don't install' command has been selected.", NotifyType::StatusMessage);
00053     })));
00054     messageDialog->Commands->Append(ref new UICommand("Install updates", ref new UICommandInvokedHandler([this](IUICommand^ command)
00055     {
00056         rootPage->NotifyUser("The 'Install updates' command has been selected.", NotifyType::StatusMessage);
00057     })));
00058
00059     // Set the command that will be invoked by default
00060     messageDialog->DefaultCommandIndex = 1;
00061
00062     // Show the message dialog
00063     messageDialog->ShowAsync();
00064 }
Generated on Fri Nov 15 2024 22:20:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

D2DGradientMeshMain Member List

This is the complete list of members for D2DGradientMeshMain, including all inherited members.
D2DGradientMeshMain(const std::shared_ptr< DX::DeviceResources > &deviceResources) | D2DGradientMeshMain |
m_deviceResources | D2DGradientMeshMain | [private]
m_sampleOverlay | D2DGradientMeshMain | [private]
m_sceneRenderer | D2DGradientMeshMain | [private]
OnDeviceLost() | D2DGradientMeshMain | [virtual]
OnDeviceRestored() | D2DGradientMeshMain | [virtual]
Render() | D2DGradientMeshMain |
UpdateForWindowSizeChange() | D2DGradientMeshMain |
~D2DGradientMeshMain() | D2DGradientMeshMain |
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/Common/CameraResources.cpp Source File

  • HolographicVoiceInput
  • cpp
  • Common

CameraResources.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012
00013 #include "CameraResources.h"
00014 #include "Common\DirectXHelper.h"
00015 #include "DeviceResources.h"
00016 #include <windows.graphics.directx.direct3d11.interop.h>
00017
00018 using namespace DirectX;
00019 using namespace Microsoft::WRL;
00020 using namespace Windows::Graphics::DirectX::Direct3D11;
00021 using namespace Windows::Graphics::Holographic;
00022 using namespace Windows::Perception::Spatial;
00023
00024 DX::CameraResources::CameraResources(HolographicCamera^ camera) :
00025     m_holographicCamera(camera),
00026     m_isStereo(camera->IsStereo),
00027     m_d3dRenderTargetSize(camera->RenderTargetSize)
00028 {
00029     m_d3dViewport = CD3D11_VIEWPORT(
00030         0.f, 0.f,
00031         m_d3dRenderTargetSize.Width,
00032         m_d3dRenderTargetSize.Height
00033         );
00034 };
00035
00036 // Updates resources associated with a holographic camera's swap chain.
00037 // The app does not access the swap chain directly, but it does create
00038 // resource views for the back buffer.
00039 void DX::CameraResources::CreateResourcesForBackBuffer(
00040     DX::DeviceResources* pDeviceResources,
00041     HolographicCameraRenderingParameters^ cameraParameters
00042     )
00043 {
00044     const auto device = pDeviceResources->GetD3DDevice();
00045
00046     // Get the WinRT object representing the holographic camera's back buffer.
00047     IDirect3DSurface^ surface = cameraParameters->Direct3D11BackBuffer;
00048
00049     // Get a DXGI interface for the holographic camera's back buffer.
00050     // Holographic cameras do not provide the DXGI swap chain, which is owned
00051     // by the system. The Direct3D back buffer resource is provided using WinRT
00052     // interop APIs.
00053     ComPtr<ID3D11Resource> resource;
00054     ThrowIfFailed(
00055         GetDXGIInterfaceFromObject(surface, IID_PPV_ARGS(&resource))
00056         );
00057
00058     // Get a Direct3D interface for the holographic camera's back buffer.
00059     ComPtr<ID3D11Texture2D> cameraBackBuffer;
00060     ThrowIfFailed(
00061         resource.As(&cameraBackBuffer)
00062         );
00063
00064     // Determine if the back buffer has changed. If so, ensure that the render target view
00065     // is for the current back buffer.
00066     if (m_d3dBackBuffer.Get() != cameraBackBuffer.Get())
00067     {
00068         // This can change every frame as the system moves to the next buffer in the
00069         // swap chain. This mode of operation will occur when certain rendering modes
00070         // are activated.
00071         m_d3dBackBuffer = cameraBackBuffer;
00072
00073         // Create a render target view of the back buffer.
00074         // Creating this resource is inexpensive, and is better than keeping track of
00075         // the back buffers in order to pre-allocate render target views for each one.
00076         DX::ThrowIfFailed(
00077             device->CreateRenderTargetView(
00078                 m_d3dBackBuffer.Get(),
00079                 nullptr,
00080                 &m_d3dRenderTargetView
00081                 )
00082             );
00083
00084         // Get the DXGI format for the back buffer.
00085         // This information can be accessed by the app using CameraResources::GetBackBufferDXGIFormat().
00086         D3D11_TEXTURE2D_DESC backBufferDesc;
00087         m_d3dBackBuffer->GetDesc(&backBufferDesc);
00088         m_dxgiFormat = backBufferDesc.Format;
00089
00090         // Check for render target size changes.
00091         Windows::Foundation::Size currentSize = m_holographicCamera->RenderTargetSize;
00092         if (m_d3dRenderTargetSize != currentSize)
00093         {
00094             // Set render target size.
00095             m_d3dRenderTargetSize = currentSize;
00096
00097             // A new depth stencil view is also needed.
00098             m_d3dDepthStencilView.Reset();
00099         }
00100     }
00101
00102     // Refresh depth stencil resources, if needed.
00103     if (m_d3dDepthStencilView == nullptr)
00104     {
00105         // Create a depth stencil view for use with 3D rendering if needed.
00106         CD3D11_TEXTURE2D_DESC depthStencilDesc(
00107             DXGI_FORMAT_D16_UNORM,
00108             static_cast<UINT>(m_d3dRenderTargetSize.Width),
00109             static_cast<UINT>(m_d3dRenderTargetSize.Height),
00110             m_isStereo ? 2 : 1, // Create two textures when rendering in stereo.
00111             1, // Use a single mipmap level.
00112             D3D11_BIND_DEPTH_STENCIL
00113             );
00114
00115         ComPtr<ID3D11Texture2D> depthStencil;
00116         DX::ThrowIfFailed(
00117             device->CreateTexture2D(
00118                 &depthStencilDesc,
00119                 nullptr,
00120                 &depthStencil
00121                 )
00122             );
00123
00124         CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(
00125             m_isStereo ? D3D11_DSV_DIMENSION_TEXTURE2DARRAY : D3D11_DSV_DIMENSION_TEXTURE2D
00126             );
00127         DX::ThrowIfFailed(
00128             device->CreateDepthStencilView(
00129                 depthStencil.Get(),
00130                 &depthStencilViewDesc,
00131                 &m_d3dDepthStencilView
00132                 )
00133             );
00134     }
00135
00136     // Create the constant buffer, if needed.
00137     if (m_viewProjectionConstantBuffer == nullptr)
00138     {
00139         // Create a constant buffer to store view and projection matrices for the camera.
00140         CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER);
00141         DX::ThrowIfFailed(
00142             device->CreateBuffer(
00143                 &constantBufferDesc,
00144                 nullptr,
00145                 &m_viewProjectionConstantBuffer
00146                 )
00147             );
00148     }
00149 }
00150
00151 // Releases resources associated with a back buffer.
00152 void DX::CameraResources::ReleaseResourcesForBackBuffer(DX::DeviceResources* pDeviceResources)
00153 {
00154     const auto context = pDeviceResources->GetD3DDeviceContext();
00155
00156     // Release camera-specific resources.
00157     m_d3dBackBuffer.Reset();
00158     m_d3dRenderTargetView.Reset();
00159     m_d3dDepthStencilView.Reset();
00160     m_viewProjectionConstantBuffer.Reset();
00161
00162     // Ensure system references to the back buffer are released by clearing the render
00163     // target from the graphics pipeline state, and then flushing the Direct3D context.
00164     ID3D11RenderTargetView* nullViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { nullptr };
00165     context->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
00166     context->Flush();
00167 }
00168
00169 // Updates the view/projection constant buffer for a holographic camera.
00170 void DX::CameraResources::UpdateViewProjectionBuffer(
00171     std::shared_ptr<DX::DeviceResources> deviceResources,
00172     HolographicCameraPose^ cameraPose,
00173     SpatialCoordinateSystem^ coordinateSystem
00174     )
00175 {
00176     // The system changes the viewport on a per-frame basis for system optimizations.
00177     m_d3dViewport = CD3D11_VIEWPORT(
00178         cameraPose->Viewport.Left,
00179         cameraPose->Viewport.Top,
00180         cameraPose->Viewport.Width,
00181         cameraPose->Viewport.Height
00182         );
00183
00184     // The projection transform for each frame is provided by the HolographicCameraPose.
00185     HolographicStereoTransform cameraProjectionTransform = cameraPose->ProjectionTransform;
00186
00187     // Get a container object with the view and projection matrices for the given
00188     // pose in the given coordinate system.
00189     Platform::IBox<HolographicStereoTransform>^ viewTransformContainer = cameraPose->TryGetViewTransform(coordinateSystem);
00190
00191     // If TryGetViewTransform returns a null pointer, that means the pose and coordinate
00192     // system cannot be understood relative to one another; content cannot be rendered
00193     // in this coordinate system for the duration of the current frame.
00194     // This usually means that positional tracking is not active for the current frame, in
00195     // which case it is possible to use a SpatialLocatorAttachedFrameOfReference to render
00196     // content that is not world-locked instead.
00197     DX::ViewProjectionConstantBuffer viewProjectionConstantBufferData;
00198     bool viewTransformAcquired = viewTransformContainer != nullptr;
00199     if (viewTransformAcquired)
00200     {
00201         // Otherwise, the set of view transforms can be retrieved.
00202         HolographicStereoTransform viewCoordinateSystemTransform = viewTransformContainer->Value;
00203
00204         // Update the view matrices. Holographic cameras (such as Microsoft HoloLens) are
00205         // constantly moving relative to the world. The view matrices need to be updated
00206         // every frame.
00207         XMStoreFloat4x4(
00208             &viewProjectionConstantBufferData.viewProjection[0],
00209             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Left) * XMLoadFloat4x4(&cameraProjectionTransform.Left))
00210             );
00211         XMStoreFloat4x4(
00212             &viewProjectionConstantBufferData.viewProjection[1],
00213             XMMatrixTranspose(XMLoadFloat4x4(&viewCoordinateSystemTransform.Right) * XMLoadFloat4x4(&cameraProjectionTransform.Right))
00214             );
00215     }
00216
00217     // Use the D3D device context to update Direct3D device-based resources.
00218     const auto context = deviceResources->GetD3DDeviceContext();
00219
00220     // Loading is asynchronous. Resources must be created before they can be updated.
00221     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || !viewTransformAcquired)
00222     {
00223         m_framePending = false;
00224     }
00225     else
00226     {
00227         // Update the view and projection matrices.
00228         context->UpdateSubresource(
00229             m_viewProjectionConstantBuffer.Get(),
00230             0,
00231             nullptr,
00232             &viewProjectionConstantBufferData,
00233             0,
00234             0
00235             );
00236
00237         m_framePending = true;
00238     }
00239 }
00240
00241 // Gets the view-projection constant buffer for the HolographicCamera and attaches it
00242 // to the shader pipeline.
00243 bool DX::CameraResources::AttachViewProjectionBuffer(
00244     std::shared_ptr<DX::DeviceResources> deviceResources
00245     )
00246 {
00247     // This method uses Direct3D device-based resources.
00248     const auto context = deviceResources->GetD3DDeviceContext();
00249
00250     // Loading is asynchronous. Resources must be created before they can be updated.
00251     // Cameras can also be added asynchronously, in which case they must be initialized
00252     // before they can be used.
00253     if (context == nullptr || m_viewProjectionConstantBuffer == nullptr || m_framePending == false)
00254     {
00255         return false;
00256     }
00257
00258     // Set the viewport for this camera.
00259     context->RSSetViewports(1, &m_d3dViewport);
00260
00261     // Send the constant buffer to the vertex shader.
00262     context->VSSetConstantBuffers(
00263         1,
00264         1,
00265         m_viewProjectionConstantBuffer.GetAddressOf()
00266         );
00267
00268     // The template includes a pass-through geometry shader that is used by
00269     // default on systems that don't support the D3D11_FEATURE_D3D11_OPTIONS3::
00270     // VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. The shader
00271     // will be enabled at run-time on systems that require it.
00272     // If your app will also use the geometry shader for other tasks and those
00273     // tasks require the view/projection matrix, uncomment the following line
00274     // of code to send the constant buffer to the geometry shader as well.
00275     /*context->GSSetConstantBuffers(
00276         1,
00277         1,
00278         m_viewProjectionConstantBuffer.GetAddressOf()
00279         );*/
00280
00281     m_framePending = false;
00282
00283     return true;
00284 }
Generated on Fri Nov 15 2024 22:16:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStarterKit/cs/MainPage.xaml.cs Source File

  • CameraStarterKit
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using System.Linq;
00015 using System.Threading.Tasks;
00016 using Windows.ApplicationModel;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Foundation;
00019 using Windows.Foundation.Metadata;
00020 using Windows.Graphics.Display;
00021 using Windows.Graphics.Imaging;
00022 using Windows.Media;
00023 using Windows.Media.Capture;
00024 using Windows.Media.MediaProperties;
00025 using Windows.Phone.UI.Input;
00026 using Windows.Storage;
00027 using Windows.Storage.FileProperties;
00028 using Windows.Storage.Streams;
00029 using Windows.System.Display;
00030 using Windows.UI.Core;
00031 using Windows.UI.Xaml;
00032 using Windows.UI.Xaml.Controls;
00033 using Windows.UI.Xaml.Media;
00034 using Windows.UI.Xaml.Navigation;
00035
00036 namespace CameraStarterKit
00037 {
00038     public sealed partial class MainPage : Page
00039     {
00040         // Rotation metadata to apply to the preview stream and recorded videos (MF_MT_VIDEO_ROTATION)
00041         // Reference: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868174.aspx
00042         private static readonly Guid RotationKey = new Guid("C380465D-2271-428C-9B83-ECEA3B4A85C1");
00043
00044         // Folder in which the captures will be stored (initialized in SetupUiAsync)
00045         private StorageFolder _captureFolder = null;
00046         // Prevent the screen from sleeping while the camera is running
00047         private readonly DisplayRequest _displayRequest = new DisplayRequest();
00048
00049         // For listening to media property changes
00050         private readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView();
00051
00052         // MediaCapture and its state variables
00053         private MediaCapture _mediaCapture;
00054         private bool _isInitialized;
00055         private bool _isPreviewing;
00056         private bool _isRecording;
00057
00058         // UI state
00059         private bool _isSuspending;
00060         private bool _isActivePage;
00061         private bool _isUIActive;
00062         private Task _setupTask = Task.CompletedTask;
00063
00064         // Information about the camera device
00065         private bool _mirroringPreview;
00066         private bool _externalCamera;
00067
00068         // Rotation Helper to simplify handling rotation compensation for the camera streams
00069         private CameraRotationHelper _rotationHelper;
00070
00071         #region Constructor, lifecycle and navigation
00072
00073         public MainPage()
00074         {
00075             this.InitializeComponent();
00076
00077             // Do not cache the state of the UI when suspending/navigating
00078             NavigationCacheMode = NavigationCacheMode.Disabled;
00079         }
00080
00081         private void Application_Suspending(object sender, SuspendingEventArgs e)
00082         {
00083             _isSuspending = false;
00084
00085             var deferral = e.SuspendingOperation.GetDeferral();
00086             var task = Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
00087             {
00088                 await SetUpBasedOnStateAsync();
00089                 deferral.Complete();
00090             });
00091         }
00092
00093         private void Application_Resuming(object sender, object o)
00094         {
00095             _isSuspending = false;
00096
00097             var task = Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
00098             {
00099                 await SetUpBasedOnStateAsync();
00100             });
00101         }
00102
00103         protected override async void OnNavigatedTo(NavigationEventArgs e)
00104         {
00105             // Useful to know when to initialize/clean up the camera
00106             Application.Current.Suspending += Application_Suspending;
00107             Application.Current.Resuming += Application_Resuming;
00108             Window.Current.VisibilityChanged += Window_VisibilityChanged;
00109
00110             _isActivePage = true;
00111             await SetUpBasedOnStateAsync();
00112         }
00113
00114         protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
00115         {
00116             // Handling of this event is included for completenes, as it will only fire when navigating between pages and this sample only includes one page
00117             Application.Current.Suspending -= Application_Suspending;
00118             Application.Current.Resuming -= Application_Resuming;
00119             Window.Current.VisibilityChanged -= Window_VisibilityChanged;
00120
00121             _isActivePage = false;
00122             await SetUpBasedOnStateAsync();
00123         }
00124
00125         #endregion Constructor, lifecycle and navigation
00126
00127
00128         #region Event handlers
00129         private async void Window_VisibilityChanged(object sender, VisibilityChangedEventArgs args)
00130         {
00131             await SetUpBasedOnStateAsync();
00132         }
00133
00134         /// <summary>
00135         /// In the event of the app being minimized this method handles media property change events. If the app receives a mute
00136         /// notification, it is no longer in the foregroud.
00137         /// </summary>
00138         /// <param name="sender"></param>
00139         /// <param name="args"></param>
00140         private async void SystemMediaControls_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
00141         {
00142             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
00143             {
00144                 // Only handle this event if this page is currently being displayed
00145                 if (args.Property == SystemMediaTransportControlsProperty.SoundLevel && Frame.CurrentSourcePageType == typeof(MainPage))
00146                 {
00147                     // Check to see if the app is being muted. If so, it is being minimized.
00148                     // Otherwise if it is not initialized, it is being brought into focus.
00149                     if (sender.SoundLevel == SoundLevel.Muted)
00150                     {
00151                         await CleanupCameraAsync();
00152                     }
00153                     else if (!_isInitialized)
00154                     {
00155                         await InitializeCameraAsync();
00156                     }
00157                 }
00158             });
00159         }
00160
00161         private async void PhotoButton_Click(object sender, RoutedEventArgs e)
00162         {
00163             await TakePhotoAsync();
00164         }
00165
00166         private async void VideoButton_Click(object sender, RoutedEventArgs e)
00167         {
00168             if (!_isRecording)
00169             {
00170                 await StartRecordingAsync();
00171             }
00172             else
00173             {
00174                 await StopRecordingAsync();
00175             }
00176
00177             // After starting or stopping video recording, update the UI to reflect the MediaCapture state
00178             UpdateCaptureControls();
00179         }
00180
00181         private async void HardwareButtons_CameraPressed(object sender, CameraEventArgs e)
00182         {
00183             await TakePhotoAsync();
00184         }
00185
00186         private async void MediaCapture_RecordLimitationExceeded(MediaCapture sender)
00187         {
00188             // This is a notification that recording has to stop, and the app is expected to finalize the recording
00189
00190             await StopRecordingAsync();
00191
00192             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
00193         }
00194
00195         private async void MediaCapture_Failed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs)
00196         {
00197             Debug.WriteLine("MediaCapture_Failed: (0x{0:X}) {1}", errorEventArgs.Code, errorEventArgs.Message);
00198
00199             await CleanupCameraAsync();
00200
00201             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateCaptureControls());
00202         }
00203
00204         #endregion Event handlers
00205
00206
00207         #region MediaCapture methods
00208
00209         /// <summary>
00210         /// Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, starts preview and unlocks the UI
00211         /// </summary>
00212         /// <returns></returns>
00213         private async Task InitializeCameraAsync()
00214         {
00215             Debug.WriteLine("InitializeCameraAsync");
00216
00217             if (_mediaCapture == null)
00218             {
00219                 // Attempt to get the back camera if one is available, but use any camera device if not
00220                 var cameraDevice = await FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel.Back);
00221
00222                 if (cameraDevice == null)
00223                 {
00224                     Debug.WriteLine("No camera device found!");
00225                     return;
00226                 }
00227
00228                 // Create MediaCapture and its settings
00229                 _mediaCapture = new MediaCapture();
00230
00231                 // Register for a notification when video recording has reached the maximum time and when something goes wrong
00232                 _mediaCapture.RecordLimitationExceeded += MediaCapture_RecordLimitationExceeded;
00233                 _mediaCapture.Failed += MediaCapture_Failed;
00234
00235                 var settings = new MediaCaptureInitializationSettings { VideoDeviceId = cameraDevice.Id };
00236
00237                 // Initialize MediaCapture
00238                 try
00239                 {
00240                     await _mediaCapture.InitializeAsync(settings);
00241                     _isInitialized = true;
00242                 }
00243                 catch (UnauthorizedAccessException)
00244                 {
00245                     Debug.WriteLine("The app was denied access to the camera");
00246                 }
00247
00248                 // If initialization succeeded, start the preview
00249                 if (_isInitialized)
00250                 {
00251                     // Figure out where the camera is located
00252                     if (cameraDevice.EnclosureLocation == null || cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Unknown)
00253                     {
00254                         // No information on the location of the camera, assume it's an external camera, not integrated on the device
00255                         _externalCamera = true;
00256                     }
00257                     else
00258                     {
00259                         // Camera is fixed on the device
00260                         _externalCamera = false;
00261
00262                         // Only mirror the preview if the camera is on the front panel
00263                         _mirroringPreview = (cameraDevice.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front);
00264                     }
00265
00266                     // Initialize rotationHelper
00267                     _rotationHelper = new CameraRotationHelper(cameraDevice.EnclosureLocation);
00268                     _rotationHelper.OrientationChanged += RotationHelper_OrientationChanged;
00269
00270                     await StartPreviewAsync();
00271
00272                     UpdateCaptureControls();
00273                 }
00274             }
00275         }
00276
00277         /// <summary>
00278         /// Handles an orientation changed event
00279         /// </summary>
00280         private async void RotationHelper_OrientationChanged(object sender, bool updatePreview)
00281         {
00282             if (updatePreview)
00283             {
00284                 await SetPreviewRotationAsync();
00285             }
00286             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateButtonOrientation());
00287         }
00288
00289         /// <summary>
00290         /// Uses the current device orientation in space and page orientation on the screen to calculate the rotation
00291         /// transformation to apply to the controls
00292         /// </summary>
00293         private void UpdateButtonOrientation()
00294         {
00295             // Rotate the buttons in the UI to match the rotation of the device
00296             var angle = CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(_rotationHelper.GetUIOrientation());
00297             var transform = new RotateTransform { Angle = angle };
00298
00299             // The RenderTransform is safe to use (i.e. it won't cause layout issues) in this case, because these buttons have a 1:1 aspect ratio
00300             PhotoButton.RenderTransform = transform;
00301             VideoButton.RenderTransform = transform;
00302         }
00303
00304         /// <summary>
00305         /// Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on
00306         /// </summary>
00307         /// <returns></returns>
00308         private async Task StartPreviewAsync()
00309         {
00310             // Prevent the device from sleeping while the preview is running
00311             _displayRequest.RequestActive();
00312
00313             // Set the preview source in the UI and mirror it if necessary
00314             PreviewControl.Source = _mediaCapture;
00315             PreviewControl.FlowDirection = _mirroringPreview ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
00316
00317             // Start the preview
00318             await _mediaCapture.StartPreviewAsync();
00319             _isPreviewing = true;
00320
00321             // Initialize the preview to the current orientation
00322             if (_isPreviewing)
00323             {
00324                 await SetPreviewRotationAsync();
00325             }
00326         }
00327
00328         /// <summary>
00329         /// Gets the current orientation of the UI in relation to the device (when AutoRotationPreferences cannot be honored) and applies a corrective rotation to the preview
00330         /// </summary>
00331         private async Task SetPreviewRotationAsync()
00332         {
00333             // Only need to update the orientation if the camera is mounted on the device
00334             if (_externalCamera) return;
00335
00336             // Add rotation metadata to the preview stream to make sure the aspect ratio / dimensions match when rendering and getting preview frames
00337             var rotation = _rotationHelper.GetCameraPreviewOrientation();
00338             var props = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview);
00339             props.Properties.Add(RotationKey, CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(rotation));
00340             await _mediaCapture.SetEncodingPropertiesAsync(MediaStreamType.VideoPreview, props, null);
00341         }
00342
00343         /// <summary>
00344         /// Stops the preview and deactivates a display request, to allow the screen to go into power saving modes
00345         /// </summary>
00346         /// <returns></returns>
00347         private async Task StopPreviewAsync()
00348         {
00349             // Stop the preview
00350             _isPreviewing = false;
00351             await _mediaCapture.StopPreviewAsync();
00352
00353             // Use the dispatcher because this method is sometimes called from non-UI threads
00354             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00355             {
00356                 // Cleanup the UI
00357                 PreviewControl.Source = null;
00358
00359                 // Allow the device screen to sleep now that the preview is stopped
00360                 _displayRequest.RequestRelease();
00361             });
00362         }
00363
00364         /// <summary>
00365         /// Takes a photo to a StorageFile and adds rotation metadata to it
00366         /// </summary>
00367         /// <returns></returns>
00368         private async Task TakePhotoAsync()
00369         {
00370             // While taking a photo, keep the video button enabled only if the camera supports simultaneously taking pictures and recording video
00371             VideoButton.IsEnabled = _mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported;
00372
00373             // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
00374             VideoButton.Opacity = VideoButton.IsEnabled ? 1 : 0;
00375
00376             var stream = new InMemoryRandomAccessStream();
00377
00378             Debug.WriteLine("Taking photo...");
00379             await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);
00380
00381             try
00382             {
00383                 var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);
00384                 Debug.WriteLine("Photo taken! Saving to " + file.Path);
00385
00386                 var photoOrientation = CameraRotationHelper.ConvertSimpleOrientationToPhotoOrientation(_rotationHelper.GetCameraCaptureOrientation());
00387
00388                 await ReencodeAndSavePhotoAsync(stream, file, photoOrientation);
00389                 Debug.WriteLine("Photo saved!");
00390             }
00391             catch (Exception ex)
00392             {
00393                 // File I/O errors are reported as exceptions
00394                 Debug.WriteLine("Exception when taking a photo: " + ex.ToString());
00395             }
00396
00397             // Done taking a photo, so re-enable the button
00398             VideoButton.IsEnabled = true;
00399             VideoButton.Opacity = 1;
00400         }
00401
00402         /// <summary>
00403         /// Records an MP4 video to a StorageFile and adds rotation metadata to it
00404         /// </summary>
00405         /// <returns></returns>
00406         private async Task StartRecordingAsync()
00407         {
00408             try
00409             {
00410                 // Create storage file for the capture
00411                 var videoFile = await _captureFolder.CreateFileAsync("SimpleVideo.mp4", CreationCollisionOption.GenerateUniqueName);
00412
00413                 var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);
00414
00415                 // Calculate rotation angle, taking mirroring into account if necessary
00416                 var rotationAngle = CameraRotationHelper.ConvertSimpleOrientationToClockwiseDegrees(_rotationHelper.GetCameraCaptureOrientation());
00417                 encodingProfile.Video.Properties.Add(RotationKey, PropertyValue.CreateInt32(rotationAngle));
00418
00419                 Debug.WriteLine("Starting recording to " + videoFile.Path);
00420
00421                 await _mediaCapture.StartRecordToStorageFileAsync(encodingProfile, videoFile);
00422                 _isRecording = true;
00423
00424                 Debug.WriteLine("Started recording!");
00425             }
00426             catch (Exception ex)
00427             {
00428                 // File I/O errors are reported as exceptions
00429                 Debug.WriteLine("Exception when starting video recording: " + ex.ToString());
00430             }
00431         }
00432
00433         /// <summary>
00434         /// Stops recording a video
00435         /// </summary>
00436         /// <returns></returns>
00437         private async Task StopRecordingAsync()
00438         {
00439             Debug.WriteLine("Stopping recording...");
00440
00441             _isRecording = false;
00442             await _mediaCapture.StopRecordAsync();
00443
00444             Debug.WriteLine("Stopped recording!");
00445         }
00446
00447         /// <summary>
00448         /// Cleans up the camera resources (after stopping any video recording and/or preview if necessary) and unregisters from MediaCapture events
00449         /// </summary>
00450         /// <returns></returns>
00451         private async Task CleanupCameraAsync()
00452         {
00453             Debug.WriteLine("CleanupCameraAsync");
00454
00455             if (_isInitialized)
00456             {
00457                 // If a recording is in progress during cleanup, stop it to save the recording
00458                 if (_isRecording)
00459                 {
00460                     await StopRecordingAsync();
00461                 }
00462
00463                 if (_isPreviewing)
00464                 {
00465                     // The call to stop the preview is included here for completeness, but can be
00466                     // safely removed if a call to MediaCapture.Dispose() is being made later,
00467                     // as the preview will be automatically stopped at that point
00468                     await StopPreviewAsync();
00469                 }
00470
00471                 _isInitialized = false;
00472             }
00473
00474             if (_mediaCapture != null)
00475             {
00476                 _mediaCapture.RecordLimitationExceeded -= MediaCapture_RecordLimitationExceeded;
00477                 _mediaCapture.Failed -= MediaCapture_Failed;
00478                 _mediaCapture.Dispose();
00479                 _mediaCapture = null;
00480             }
00481
00482             if (_rotationHelper != null)
00483             {
00484                 _rotationHelper.OrientationChanged -= RotationHelper_OrientationChanged;
00485                 _rotationHelper = null;
00486             }
00487         }
00488
00489         #endregion MediaCapture methods
00490
00491
00492         #region Helper functions
00493
00494         /// <summary>
00495         /// Initialize or clean up the camera and our UI,
00496         /// depending on the page state.
00497         /// </summary>
00498         /// <returns></returns>
00499         private async Task SetUpBasedOnStateAsync()
00500         {
00501             // Avoid reentrancy: Wait until nobody else is in this function.
00502             while (!_setupTask.IsCompleted)
00503             {
00504                 await _setupTask;
00505             }
00506
00507             // We want our UI to be active if
00508             // * We are the current active page.
00509             // * The window is visible.
00510             // * The app is not suspending.
00511             bool wantUIActive = _isActivePage && Window.Current.Visible && !_isSuspending;
00512
00513             if (_isUIActive != wantUIActive)
00514             {
00515                 _isUIActive = wantUIActive;
00516
00517                 Func<Task> setupAsync = async () =>
00518                 {
00519                     if (wantUIActive)
00520                     {
00521                         await SetupUiAsync();
00522                         await InitializeCameraAsync();
00523                     }
00524                     else
00525                     {
00526                         await CleanupCameraAsync();
00527                         await CleanupUiAsync();
00528                     }
00529                 };
00530                 _setupTask = setupAsync();
00531             }
00532
00533             await _setupTask;
00534         }
00535
00536         /// <summary>
00537         /// Attempts to lock the page orientation, hide the StatusBar (on Phone) and registers event handlers for hardware buttons and orientation sensors
00538         /// </summary>
00539         /// <returns></returns>
00540         private async Task SetupUiAsync()
00541         {
00542             // Attempt to lock page to landscape orientation to prevent the CaptureElement from rotating, as this gives a better experience
00543             DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
00544
00545             // Hide the status bar
00546             if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
00547             {
00548                 await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
00549             }
00550
00551             RegisterEventHandlers();
00552             var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
00553             // Fall back to the local app storage if the Pictures Library is not available
00554             _captureFolder = picturesLibrary.SaveFolder ?? ApplicationData.Current.LocalFolder;
00555         }
00556
00557         /// <summary>
00558         /// Unregisters event handlers for hardware buttons and orientation sensors, allows the StatusBar (on Phone) to show, and removes the page orientation lock
00559         /// </summary>
00560         /// <returns></returns>
00561         private async Task CleanupUiAsync()
00562         {
00563             UnregisterEventHandlers();
00564
00565             // Show the status bar
00566             if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
00567             {
00568                 await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
00569             }
00570
00571             // Revert orientation preferences
00572             DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
00573         }
00574
00575         /// <summary>
00576         /// This method will update the icons, enable/disable and show/hide the photo/video buttons depending on the current state of the app and the capabilities of the device
00577         /// </summary>
00578         private void UpdateCaptureControls()
00579         {
00580             // The buttons should only be enabled if the preview started sucessfully
00581             PhotoButton.IsEnabled = _isPreviewing;
00582             VideoButton.IsEnabled = _isPreviewing;
00583
00584             // Update recording button to show "Stop" icon instead of red "Record" icon
00585             StartRecordingIcon.Visibility = _isRecording ? Visibility.Collapsed : Visibility.Visible;
00586             StopRecordingIcon.Visibility = _isRecording ? Visibility.Visible : Visibility.Collapsed;
00587
00588             // If the camera doesn't support simultaneosly taking pictures and recording video, disable the photo button on record
00589             if (_isInitialized && !_mediaCapture.MediaCaptureSettings.ConcurrentRecordAndPhotoSupported)
00590             {
00591                 PhotoButton.IsEnabled = !_isRecording;
00592
00593                 // Make the button invisible if it's disabled, so it's obvious it cannot be interacted with
00594                 PhotoButton.Opacity = PhotoButton.IsEnabled ? 1 : 0;
00595             }
00596         }
00597
00598         /// <summary>
00599         /// Registers event handlers for hardware buttons and orientation sensors, and performs an initial update of the UI rotation
00600         /// </summary>
00601         private void RegisterEventHandlers()
00602         {
00603             if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
00604             {
00605                 HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
00606             }
00607             _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged;
00608         }
00609
00610         /// <summary>
00611         /// Unregisters event handlers for hardware buttons and orientation sensors
00612         /// </summary>
00613         private void UnregisterEventHandlers()
00614         {
00615             if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
00616             {
00617                 HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed;
00618             }
00619             _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged;
00620         }
00621
00622         /// <summary>
00623         /// Attempts to find and return a device mounted on the panel specified, and on failure to find one it will return the first device listed
00624         /// </summary>
00625         /// <param name="desiredPanel">The desired panel on which the returned device should be mounted, if available</param>
00626         /// <returns></returns>
00627         private static async Task<DeviceInformation> FindCameraDeviceByPanelAsync(Windows.Devices.Enumeration.Panel desiredPanel)
00628         {
00629             // Get available devices for capturing pictures
00630             var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00631
00632             // Get the desired camera by panel
00633             DeviceInformation desiredDevice = allVideoDevices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredPanel);
00634
00635             // If there is no device mounted on the desired panel, return the first device found
00636             return desiredDevice ?? allVideoDevices.FirstOrDefault();
00637         }
00638
00639         /// <summary>
00640         /// Applies the given orientation to a photo stream and saves it as a StorageFile
00641         /// </summary>
00642         /// <param name="stream">The photo stream</param>
00643         /// <param name="file">The StorageFile in which the photo stream will be saved</param>
00644         /// <param name="photoOrientation">The orientation metadata to apply to the photo</param>
00645         /// <returns></returns>
00646         private static async Task ReencodeAndSavePhotoAsync(IRandomAccessStream stream, StorageFile file, PhotoOrientation photoOrientation)
00647         {
00648             using (var inputStream = stream)
00649             {
00650                 var decoder = await BitmapDecoder.CreateAsync(inputStream);
00651
00652                 using (var outputStream = await file.OpenAsync(FileAccessMode.ReadWrite))
00653                 {
00654                     var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);
00655
00656                     var properties = new BitmapPropertySet { { "System.Photo.Orientation", new BitmapTypedValue(photoOrientation, PropertyType.UInt16) } };
00657
00658                     await encoder.BitmapProperties.SetPropertiesAsync(properties);
00659                     await encoder.FlushAsync();
00660                 }
00661             }
00662         }
00663
00664         #endregion Helper functions
00665
00666     }
00667 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteLineSpacingModes/cpp/DWriteLineSpacingModes/SampleConfiguration.cpp Source File

  • DWriteLineSpacingModes
  • cpp
  • DWriteLineSpacingModes

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Default spacing", "SDKTemplate.Scenario1_DefaultSpacing" },
00021     { "Uniform spacing", "SDKTemplate.Scenario2_UniformSpacing" },
00022     { "Proportional spacing", "SDKTemplate.Scenario3_ProportionalSpacing" }
00023 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cs/Scenario2_Remove.xaml.cs Source File

  • JumpList
  • cs

Scenario2_Remove.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.StartScreen;
00016
00017 namespace SDKTemplate
00018 {
00019     public sealed partial class Scenario2_Remove : Page
00020     {
00021         public Scenario2_Remove()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         private async void RemoveJumpList_Click(object sender, RoutedEventArgs e)
00027         {
00028             var jumpList = await JumpList.LoadCurrentAsync();
00029             jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
00030             jumpList.Items.Clear();
00031             await jumpList.SaveAsync();
00032         }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:20:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h Source File

  • SpeechRecognitionAndSynthesis
  • cpp

Scenario_ContinuousRecognitionListGrammar.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario_ContinuousRecognitionListGrammar.g.h"
00015 #include "MainPage.xaml.h"
00016 #include <sstream>
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// An empty page that can be used on its own or navigated to within a Frame.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class Scenario_ContinuousRecognitionListGrammar sealed
00025     {
00026     public:
00027         Scenario_ContinuousRecognitionListGrammar();
00028
00029     protected:
00030         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00032
00033     private:
00034         static const unsigned int HResultPrivacyStatementDeclined = 0x80045509;
00035         static const unsigned int HResultRecognizerNotFound = 0x8004503a;
00036
00037         SDKTemplate::MainPage^ rootPage;
00038         Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
00039         Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
00040         Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
00041         bool isPopulatingLanguages = false;
00042
00043         void ContinuousRecognize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00044
00045         void InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage);
00046         void PopulateLanguageDropdown();
00047
00048         Windows::Foundation::EventRegistrationToken stateChangedToken;
00049         Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken;
00050         Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken;
00051
00052         void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
00053         void ContinuousRecognitionSession_Completed(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs ^args);
00054         void ContinuousRecognitionSession_ResultGenerated(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionResultGeneratedEventArgs ^args);
00055         void cbLanguageSelection_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00056     };
00057 }
Generated on Fri Nov 15 2024 22:21:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario2.xaml.cpp Source File

  • DatagramSocket
  • cpp

Scenario2.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario2.xaml.cpp
00014 // Implementation of the Scenario2 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2.xaml.h"
00019
00020 using namespace SDKTemplate;
00021 using namespace SDKTemplate::DatagramSocketSample;
00022
00023 using namespace Concurrency;
00024 using namespace Platform;
00025 using namespace Windows::ApplicationModel::Core;
00026 using namespace Windows::Foundation;
00027 using namespace Windows::Networking;
00028 using namespace Windows::Networking::Sockets;
00029 using namespace Windows::Storage::Streams;
00030 using namespace Windows::UI::Core;
00031 using namespace Windows::UI::Xaml;
00032 using namespace Windows::UI::Xaml::Controls;
00033 using namespace Windows::UI::Xaml::Navigation;
00034
00035 Scenario2::Scenario2()
00036 {
00037     InitializeComponent();
00038 }
00039
00040 /// <summary>
00041 /// Invoked when this page is about to be displayed in a Frame.
00042 /// </summary>
00043 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00044 /// property is typically used to configure the page.</param>
00045 void Scenario2::OnNavigatedTo(NavigationEventArgs^ e)
00046 {
00047     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00048     // as NotifyUser()
00049     rootPage = MainPage::Current;
00050
00051     if (CoreApplication::Properties->HasKey("serverAddress"))
00052     {
00053         Object^ serverAddressObject = CoreApplication::Properties->Lookup("serverAddress");
00054         String^ serverAddress = dynamic_cast<String^>(serverAddressObject);
00055         if (serverAddress)
00056         {
00057             HostNameForConnect->Text = serverAddress;
00058         }
00059     }
00060 }
00061
00062 void Scenario2::ConnectSocket_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00063 {
00064     if (ServiceNameForConnect->Text == nullptr)
00065     {
00066         rootPage->NotifyUser("Please provide a service name.", NotifyType::ErrorMessage);
00067         return;
00068     }
00069
00070     // By default 'HostNameForConnect' is disabled and host name validation is not required. When enabling the text
00071     // box validating the host name is required since it was received from an untrusted source (user input).
00072     // The host name is validated by catching ArgumentExceptions thrown by the HostName constructor for
00073     // invalid input.
00074     HostName^ hostName;
00075     try
00076     {
00077         hostName = ref new HostName(HostNameForConnect->Text);
00078     }
00079     catch (InvalidArgumentException^ e)
00080     {
00081         rootPage->NotifyUser("Error: Invalid host name.", NotifyType::ErrorMessage);
00082         return;
00083     }
00084
00085     if (CoreApplication::Properties->HasKey("clientSocket"))
00086     {
00087         rootPage->NotifyUser(
00088             "This step has already been executed. Please move to the next one.",
00089             NotifyType::ErrorMessage);
00090         return;
00091     }
00092
00093     DatagramSocket^ socket = ref new DatagramSocket();
00094
00095     if (DontFragment->IsOn)
00096     {
00097         // Set the IP DF (Don't Fragment) flag.
00098         // This won't have any effect when running both client and server on localhost.
00099         // Refer to the DatagramSocketControl class' MSDN documentation for the full list of control options.
00100         socket->Control->DontFragment = true;
00101     }
00102
00103     SocketContext^ socketContext = ref new SocketContext(rootPage, socket);
00104     socket->MessageReceived += ref new TypedEventHandler<DatagramSocket^, DatagramSocketMessageReceivedEventArgs^>(
00105         socketContext,
00106         &SocketContext::OnMessage);
00107
00108     // Events cannot be hooked up directly to the ScenarioInput2 object, as the object can fall out-of-scope and be
00109     // deleted. This would render any event hooked up to the object ineffective. The SocketContext guarantees that
00110     // both the socket and object that serves its events have the same lifetime.
00111     CoreApplication::Properties->Insert("clientSocket", socketContext);
00112
00113     rootPage->NotifyUser("Connecting to: " + HostNameForConnect->Text, NotifyType::StatusMessage);
00114
00115     // Connect to the server (by default, the listener we created in the previous step).
00116     create_task(socket->ConnectAsync(hostName, ServiceNameForConnect->Text)).then(
00117         [this, socketContext] (task<void> previousTask)
00118     {
00119         try
00120         {
00121             // Try getting an exception.
00122             previousTask.get();
00123             rootPage->NotifyUser("Connected", NotifyType::StatusMessage);
00124             socketContext->SetConnected();
00125         }
00126         catch (Exception^ exception)
00127         {
00128             rootPage->NotifyUser("Connect failed with error: " + exception->Message, NotifyType::ErrorMessage);
00129         }
00130     });
00131 }
00132
00133 SocketContext::SocketContext(MainPage^ rootPage, DatagramSocket^ socket)
00134 {
00135     this->rootPage = rootPage;
00136     this->socket = socket;
00137     this->connected = false;
00138 }
00139
00140 SocketContext::~SocketContext()
00141 {
00142     // A DatagramSocket can be closed in two ways:
00143     //  - explicitly: using the 'delete' keyword (listener is closed even if there are outstanding references to it).
00144     //  - implicitly: removing the last reference to it (i.e., falling out-of-scope).
00145     //
00146     // When a DatagramSocket is closed implicitly, it can take several seconds for the local UDP port being used
00147     // by it to be freed/reclaimed by the lower networking layers. During that time, other UDP sockets on the machine
00148     // will not be able to use the port. Thus, it is strongly recommended that DatagramSocket instances be explicitly
00149     // closed before they go out of scope(e.g., before application exit). The call below explicitly closes the socket.
00150     delete socket;
00151     socket = nullptr;
00152
00153     if (writer != nullptr)
00154     {
00155         delete writer;
00156         writer = nullptr;
00157     }
00158 }
00159
00160 void SocketContext::OnMessage(DatagramSocket^ socket, DatagramSocketMessageReceivedEventArgs^ eventArguments)
00161 {
00162     try
00163     {
00164         // Interpret the incoming datagram's entire contents as a string.
00165         unsigned int stringLength = eventArguments->GetDataReader()->UnconsumedBufferLength;
00166         String^ receivedMessage = eventArguments->GetDataReader()->ReadString(stringLength);
00167
00168         NotifyUserFromAsyncThread(
00169             "Received data from remote peer: \"" + receivedMessage + "\"",
00170             NotifyType::StatusMessage);
00171     }
00172     catch (Exception^ exception)
00173     {
00174         SocketErrorStatus socketError = SocketError::GetStatus(exception->HResult);
00175         if (socketError == SocketErrorStatus::ConnectionResetByPeer)
00176         {
00177             // This error would indicate that a previous send operation resulted in an ICMP "Port Unreachable" message.
00178             NotifyUserFromAsyncThread(
00179                 "Peer does not listen on the specific port. Please make sure that you run step 1 first " +
00180                 "or you have a server properly working on a remote server.",
00181                 NotifyType::ErrorMessage);
00182         }
00183         else if (socketError != SocketErrorStatus::Unknown)
00184         {
00185             NotifyUserFromAsyncThread(
00186                 "Error happened when receiving a datagram: " + socketError.ToString(),
00187                 NotifyType::ErrorMessage);
00188         }
00189         else
00190         {
00191             throw;
00192         }
00193     }
00194 }
00195
00196 DataWriter^ SocketContext::GetWriter()
00197 {
00198     if (writer == nullptr)
00199     {
00200         writer = ref new DataWriter(socket->OutputStream);
00201     }
00202
00203     return writer;
00204 }
00205
00206 boolean SocketContext::IsConnected()
00207 {
00208     return connected;
00209 }
00210
00211 void SocketContext::SetConnected()
00212 {
00213     connected = true;
00214 }
00215
00216 void SocketContext::NotifyUserFromAsyncThread(String^ message, NotifyType type)
00217 {
00218     rootPage->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, message, type] ()
00219     {
00220         rootPage->NotifyUser(message, type);
00221     }));
00222 }
Generated on Fri Nov 15 2024 22:17:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
App_Activated(object sender, IActivatedEventArgs e) | ScenarioElement | [inline, private]
Error(string message) | ScenarioElement | [inline, private]
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
validateStep1(ValueSet result) | ScenarioElement | [inline, private]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_CompletionGroups Member List

This is the complete list of members for Scenario4_CompletionGroups, including all inherited members.
CreateResultFileAsync(int id) | Scenario4_CompletionGroups | [inline, private]
downloadsCompleted | Scenario4_CompletionGroups | [private]
OnDownloadCompleted(Task< DownloadOperation > task) | Scenario4_CompletionGroups | [inline, private]
rootPage | Scenario4_CompletionGroups | [private]
Scenario4_CompletionGroups() | Scenario4_CompletionGroups | [inline]
SetSubstatus(string text) | Scenario4_CompletionGroups | [inline, private]
StartDownloadsButton_Click(object sender, RoutedEventArgs e) | Scenario4_CompletionGroups | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/ConsumerExperiences/cs/Scenario1ViewModel.cs Source File

  • AllJoyn
  • ConsumerExperiences
  • cs

Scenario1ViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using com.microsoft.Samples.SecureInterface;
00013 using SDKTemplate;
00014 using System;
00015 using System.Collections.Generic;
00016 using System.ComponentModel;
00017 using System.Runtime.CompilerServices;
00018 using System.Threading.Tasks;
00019 using System.Windows.Input;
00020 using Windows.Data.Xml.Dom;
00021 using Windows.Devices.AllJoyn;
00022 using Windows.Devices.Enumeration;
00023 using Windows.UI.Core;
00024 using Windows.UI.Notifications;
00025 using Windows.UI.Xaml;
00026
00027 namespace AllJoynConsumerExperiences
00028 {
00029     class Scenario1ViewModel : INotifyPropertyChanged
00030     {
00031         private MainPage m_rootPage;
00032         private CoreDispatcher m_dispatcher;
00033         private AllJoynBusAttachment m_busAttachment = null;
00034         private DeviceWatcher m_watcher = null;
00035         private SecureInterfaceConsumer m_consumer = null;
00036         private TaskCompletionSource<bool> m_authenticateClicked = null;
00037         private Visibility m_authVisibility = Visibility.Collapsed;
00038         private Visibility m_consumerOptionsVisibility = Visibility.Collapsed;
00039         private bool m_isAuthenticated = false;
00040         private bool m_isCredentialsRequested = false;
00041         private bool m_isUpperCaseEnabled = false;
00042         private bool m_callSetProperty = true;
00043         private string m_key = string.Empty;
00044
00045         public Scenario1ViewModel()
00046         {
00047             m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
00048             m_rootPage = MainPage.Current;
00049         }
00050
00051         public event PropertyChangedEventHandler PropertyChanged;
00052
00053         public Visibility AuthenticationVisibility
00054         {
00055             get
00056             {
00057                 return m_authVisibility;
00058             }
00059             private set
00060             {
00061                 m_authVisibility = value;
00062                 RaisePropertyChangedEventAsync();
00063             }
00064         }
00065
00066         public Visibility ConsumerOptionsVisibility
00067         {
00068             get
00069             {
00070                 return m_consumerOptionsVisibility;
00071             }
00072             private set
00073             {
00074                 m_consumerOptionsVisibility = value;
00075                 RaisePropertyChangedEventAsync();
00076             }
00077         }
00078
00079         public string EnteredKey
00080         {
00081             get { return m_key; }
00082             set
00083             {
00084                 if (value != m_key)
00085                 {
00086                     m_key = value;
00087                     RaisePropertyChangedEventAsync();
00088                 }
00089             }
00090         }
00091
00092         public string InputString1 { get; set; }
00093
00094         public string InputString2 { get; set; }
00095
00096         public bool IsUpperCaseEnabled
00097         {
00098             get
00099             {
00100                 return m_isUpperCaseEnabled;
00101             }
00102             set
00103             {
00104                 m_isUpperCaseEnabled = value;
00105                 RaisePropertyChangedEventAsync();
00106                 if (m_callSetProperty)
00107                 {
00108                     SetIsUpperCaseEnabledAsync(m_isUpperCaseEnabled);
00109                 }
00110                 else
00111                 {
00112                     m_callSetProperty = true;
00113                 }
00114             }
00115         }
00116
00117         public ICommand ConnectToProducer
00118         {
00119             get
00120             {
00121                 return new RelayCommand((object args) =>
00122                 {
00123                     Start();
00124                 });
00125             }
00126         }
00127
00128         public ICommand AttemptAuthentication
00129         {
00130             get
00131             {
00132                 return new RelayCommand((object args) =>
00133                 {
00134                     Authenticate();
00135                 });
00136             }
00137         }
00138
00139         public ICommand RequestConcatenate
00140         {
00141             get
00142             {
00143                 return new RelayCommand((object args) =>
00144                 {
00145                     ConcatenateAsync();
00146                 });
00147             }
00148         }
00149
00150         public void ScenarioCleanup()
00151         {
00152             DisposeConsumer();
00153             DisposeWatcher();
00154
00155             if (m_busAttachment != null)
00156             {
00157                 m_busAttachment.CredentialsRequested -= BusAttachment_CredentialsRequested;
00158                 m_busAttachment.AuthenticationComplete -= BusAttachment_AuthenticationComplete;
00159                 m_busAttachment.StateChanged -= BusAttachment_StateChanged;
00160                 m_busAttachment.Disconnect();
00161                 m_busAttachment = null;
00162             }
00163         }
00164
00165         protected async void RaisePropertyChangedEventAsync([CallerMemberName] string name = "")
00166         {
00167             await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00168             {
00169                 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
00170             });
00171         }
00172
00173         private void Start()
00174         {
00175             ScenarioCleanup();
00176
00177             m_busAttachment = new AllJoynBusAttachment();
00178             m_busAttachment.StateChanged += BusAttachment_StateChanged;
00179             m_busAttachment.AuthenticationMechanisms.Clear();
00180             m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheSpeke);
00181             m_busAttachment.AuthenticationComplete += BusAttachment_AuthenticationComplete;
00182             m_busAttachment.CredentialsRequested += BusAttachment_CredentialsRequested;
00183
00184             // Initialize a watcher object to listen for about interfaces.
00185             m_watcher = AllJoynBusAttachment.GetWatcher(new List<string> { "com.microsoft.Samples.SecureInterface" });
00186
00187             // Subscribing to the added event that will be raised whenever a producer for this service is found.
00188             m_watcher.Added += Watcher_Added;
00189
00190             UpdateStatusAsync("Searching...", NotifyType.StatusMessage);
00191
00192             // Start watching for producers advertising this service.
00193             m_watcher.Start();
00194         }
00195
00196         private void Authenticate()
00197         {
00198             if (string.IsNullOrWhiteSpace(m_key))
00199             {
00200                 UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
00201             }
00202             else
00203             {
00204                 if (m_authenticateClicked != null)
00205                 {
00206                     UpdateStatusAsync("Authenticating...", NotifyType.StatusMessage);
00207                     m_authenticateClicked.SetResult(true);
00208                 }
00209             }
00210         }
00211
00212         private async void ConcatenateAsync()
00213         {
00214             if (m_consumer != null)
00215             {
00216                 if (string.IsNullOrWhiteSpace(InputString1) || string.IsNullOrWhiteSpace(InputString2))
00217                 {
00218                     UpdateStatusAsync("Input strings cannot be empty.", NotifyType.ErrorMessage);
00219                 }
00220                 else
00221                 {
00222                     // Call the Concatenate method with the input strings arguments.
00223                     SecureInterfaceConcatenateResult catResult = await m_consumer.ConcatenateAsync(InputString1, InputString2);
00224
00225                     if (catResult.Status == AllJoynStatus.Ok)
00226                     {
00227                         UpdateStatusAsync(string.Format("Concatenation output : \"{0}\".", catResult.OutStr), NotifyType.StatusMessage);
00228                     }
00229                     else
00230                     {
00231                         UpdateStatusAsync(string.Format("AllJoyn Error : 0x{0:X}.", catResult.Status), NotifyType.ErrorMessage);
00232                     }
00233                 }
00234             }
00235             else
00236             {
00237                 UpdateStatusAsync("Consumer not connected.", NotifyType.ErrorMessage);
00238             }
00239         }
00240
00241         private void BusAttachment_StateChanged(AllJoynBusAttachment sender, AllJoynBusAttachmentStateChangedEventArgs args)
00242         {
00243             if (args.State == AllJoynBusAttachmentState.Disconnected)
00244             {
00245                 UpdateStatusAsync(string.Format("AllJoyn bus attachment has disconnected with AllJoyn error: 0x{0:X}.", args.Status), NotifyType.StatusMessage);
00246                 ConsumerOptionsVisibility = Visibility.Collapsed;
00247             }
00248         }
00249
00250         private void BusAttachment_AuthenticationComplete(AllJoynBusAttachment sender, AllJoynAuthenticationCompleteEventArgs args)
00251         {
00252             if (args.Succeeded)
00253             {
00254                 UpdateStatusAsync("Authentication was successful.", NotifyType.StatusMessage);
00255             }
00256             else
00257             {
00258                 UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
00259             }
00260
00261             m_isAuthenticated = args.Succeeded;
00262             EnteredKey = "";
00263             AuthenticationVisibility = Visibility.Collapsed;
00264         }
00265
00266         private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
00267         {
00268             Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();
00269             m_authenticateClicked = new TaskCompletionSource<bool>();
00270             m_isCredentialsRequested = true;
00271             AuthenticationVisibility = Visibility.Visible;
00272
00273             // Wait for the user to provide key and click authenticate.
00274             UpdateStatusAsync("Please enter the key.", NotifyType.StatusMessage);
00275             await m_authenticateClicked.Task;
00276             m_authenticateClicked = null;
00277
00278             if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke)
00279             {
00280                 if (!string.IsNullOrEmpty(m_key))
00281                 {
00282                     args.Credentials.PasswordCredential.Password = m_key;
00283                 }
00284                 else
00285                 {
00286                     UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
00287                 }
00288             }
00289             else
00290             {
00291                 UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
00292             }
00293
00294             credentialsDeferral.Complete();
00295         }
00296
00297         private async void Watcher_Added(DeviceWatcher sender, DeviceInformation args)
00298         {
00299             // Optional - Get the About data of the producer.
00300             AllJoynAboutDataView aboutData = await m_busAttachment.GetAboutDataAsync(await AllJoynServiceInfo.FromIdAsync(args.Id));
00301
00302             // Check to see if device name is populated in the about data, since device name is not a mandatory field.
00303             if (string.IsNullOrEmpty(aboutData.DeviceName))
00304             {
00305                 UpdateStatusAsync(string.Format("Found {0} from manufacturer: {1}. Connecting...", aboutData.AppName, aboutData.Manufacturer), NotifyType.StatusMessage);
00306             }
00307             else
00308             {
00309                 UpdateStatusAsync(string.Format("Found {0} on {1} from manufacturer: {2}. Connecting...", aboutData.AppName, aboutData.DeviceName, aboutData.Manufacturer), NotifyType.StatusMessage);
00310             }
00311
00312             DisposeConsumer();
00313             UpdateStatusAsync("Joining session...", NotifyType.StatusMessage);
00314             m_consumer = await SecureInterfaceConsumer.FromIdAsync(args.Id, m_busAttachment);
00315             if (m_consumer != null)
00316             {
00317                 m_consumer.IsUpperCaseEnabledChanged += Consumer_IsUpperCaseEnabledChanged;
00318                 m_consumer.Signals.TextSentReceived += Signals_TextSentReceived;
00319                 m_consumer.Session.Lost += Consumer_SessionLost;
00320
00321                 // At the time of connection, the request credentials callback not being invoked is an
00322                 // indication that the consumer and producer are already authenticated from a previous session.
00323                 if (!m_isCredentialsRequested)
00324                 {
00325                     UpdateStatusAsync("Connected and already authenticated from previous session.", NotifyType.StatusMessage);
00326                     UpdateIsUpperCaseEnabledAsync();
00327                 }
00328                 else
00329                 {
00330                     if (m_isAuthenticated)
00331                     {
00332                         UpdateStatusAsync("Connected with authentication.", NotifyType.StatusMessage);
00333                         UpdateIsUpperCaseEnabledAsync();
00334                     }
00335                     else
00336                     {
00337                         UpdateStatusAsync("Connected but authentication failed.", NotifyType.ErrorMessage);
00338                     }
00339                 }
00340                 ConsumerOptionsVisibility = Visibility.Visible;
00341             }
00342             else
00343             {
00344                 UpdateStatusAsync("Attempt to join session failed.", NotifyType.ErrorMessage);
00345             }
00346         }
00347
00348         private void Consumer_SessionLost(AllJoynSession sender, AllJoynSessionLostEventArgs args)
00349         {
00350             UpdateStatusAsync(string.Format("AllJoyn session with the producer lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage);
00351             ConsumerOptionsVisibility = Visibility.Collapsed;
00352             DisposeConsumer();
00353         }
00354
00355         private void Signals_TextSentReceived(SecureInterfaceSignals sender, SecureInterfaceTextSentReceivedEventArgs args)
00356         {
00357             // Show UI Toast.
00358             ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
00359             XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
00360
00361             // Populate UI Toast.
00362             XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
00363             toastTextElements[0].AppendChild(toastXml.CreateTextNode("Signal Received - " + args.Message));
00364
00365             // Create and Send UI Toast.
00366             ToastNotification toast = new ToastNotification(toastXml);
00367             ToastNotificationManager.CreateToastNotifier().Show(toast);
00368
00369             UpdateStatusAsync("Signal Received - " + args.Message, NotifyType.StatusMessage);
00370         }
00371
00372         private void Consumer_IsUpperCaseEnabledChanged(SecureInterfaceConsumer sender, object args)
00373         {
00374             UpdateIsUpperCaseEnabledAsync();
00375         }
00376
00377         private async void UpdateIsUpperCaseEnabledAsync()
00378         {
00379             SecureInterfaceGetIsUpperCaseEnabledResult getIsUpperCaseEnabledResult = await m_consumer.GetIsUpperCaseEnabledAsync();
00380             if (getIsUpperCaseEnabledResult.Status == AllJoynStatus.Ok)
00381             {
00382                 m_callSetProperty = false;
00383                 IsUpperCaseEnabled = getIsUpperCaseEnabledResult.IsUpperCaseEnabled;
00384             }
00385             else
00386             {
00387                 UpdateStatusAsync(string.Format("Get property failed with AllJoyn error: 0x{0:X}.", getIsUpperCaseEnabledResult.Status), NotifyType.ErrorMessage);
00388             }
00389         }
00390
00391         private async void SetIsUpperCaseEnabledAsync(bool value)
00392         {
00393             SecureInterfaceSetIsUpperCaseEnabledResult setIsUpperCaseEnabledResult = await m_consumer.SetIsUpperCaseEnabledAsync(value);
00394             if (setIsUpperCaseEnabledResult.Status == AllJoynStatus.Ok)
00395             {
00396                 UpdateStatusAsync("\"IsUpperCaseEnabled\" property successfully set.", NotifyType.StatusMessage);
00397             }
00398             else
00399             {
00400                 UpdateStatusAsync(string.Format("Set property failed with AllJoyn error: 0x{0:X}.", setIsUpperCaseEnabledResult.Status), NotifyType.ErrorMessage);
00401                 m_callSetProperty = false;
00402                 IsUpperCaseEnabled = !value;
00403             }
00404         }
00405
00406         private void DisposeConsumer()
00407         {
00408             if (m_consumer != null)
00409             {
00410                 m_consumer.Session.Lost -= Consumer_SessionLost;
00411                 m_consumer.Signals.TextSentReceived -= Signals_TextSentReceived;
00412                 m_consumer.IsUpperCaseEnabledChanged -= Consumer_IsUpperCaseEnabledChanged;
00413                 m_consumer.Dispose();
00414                 m_consumer = null;
00415             }
00416         }
00417
00418         private void DisposeWatcher()
00419         {
00420             if (m_watcher != null)
00421             {
00422                 m_watcher.Added -= Watcher_Added;
00423                 m_watcher.Stop();
00424                 m_watcher = null;
00425             }
00426         }
00427
00428         private async void UpdateStatusAsync(string status, NotifyType statusType)
00429         {
00430             await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00431             {
00432                 m_rootPage.NotifyUser(status, statusType);
00433             });
00434         }
00435     }
00436 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraResolution/cpp/SampleConfiguration.cpp Source File

  • CameraResolution
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace Concurrency;
00017 using namespace SDKTemplate;
00018 using namespace Windows::Devices;
00019 using namespace Windows::Devices::Enumeration;
00020 using namespace Windows::Media::Capture;
00021 using namespace Windows::Media::MediaProperties;
00022 using namespace Windows::UI::Xaml::Controls;
00023
00024 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00025 {
00026     { "Change camera preview settings", "SDKTemplate.Scenario1_PreviewSettings" },
00027     { "Change preview and photo settings", "SDKTemplate.Scenario2_PhotoSettings" },
00028     { "Match aspect ratios", "SDKTemplate.Scenario3_AspectRatio" }
00029 };
00030
00031 /// <summary>
00032 /// Sets encoding properties on a camera stream. Ensures CaptureElement and preview stream are stopped before setting properties.
00033 /// </summary>
00034 task<void> MainPage::SetMediaStreamPropertiesAsync(MediaCapture^ mediaCapture, CaptureElement^ previewControl, MediaStreamType streamType, IMediaEncodingProperties^ encodingProperties)
00035 {
00036     // Stop preview and unlink the CaptureElement from the MediaCapture object
00037     return create_task(mediaCapture->StopPreviewAsync())
00038         .then([this, mediaCapture, previewControl, streamType, encodingProperties]()
00039     {
00040         previewControl->Source = nullptr;
00041         // Apply desired stream properties
00042         return create_task(mediaCapture->VideoDeviceController->SetMediaStreamPropertiesAsync(streamType, encodingProperties));
00043     }).then([this, mediaCapture, previewControl]() {
00044         // Recreate the CaptureElement pipeline and restart the preview
00045         previewControl->Source = mediaCapture;
00046         return create_task(mediaCapture->StartPreviewAsync());
00047     });
00048 }
00049
Generated on Fri Nov 15 2024 22:17:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Common/GraphicsCamera.cpp Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Common

GraphicsCamera.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Common\GraphicsCamera.h"
00014
00015 using namespace Windows::System;
00016 using namespace Windows::Foundation;
00017 using namespace Windows::Foundation::Numerics;
00018 using namespace Windows::UI::Core;
00019
00020 FirstPersonCamera::FirstPersonCamera()
00021 {
00022     CoreWindow::GetForCurrentThread()->PointerMoved +=
00023         ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &FirstPersonCamera::OnPointerMoved);
00024 }
00025
00026 void FirstPersonCamera::OnPointerMoved(
00027     CoreWindow^ window,
00028     PointerEventArgs^ args)
00029 {
00030     if (args->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse)
00031     {
00032         const Point currCursor = args->CurrentPoint->Position;
00033
00034         // We should ignore the first mouse event as we have no previous to compare against.
00035         const bool validPrevious = !std::isnan(m_prevCursor.X) && !std::isnan(m_prevCursor.Y);
00036
00037         ////////////////////////////////////////////////////////////////////////////////
00038         // Rotation by Mouse
00039         if (args->CurrentPoint->Properties->IsLeftButtonPressed && validPrevious)
00040         {
00041             const float deltaX = currCursor.X - m_prevCursor.X;
00042             const float deltaY = currCursor.Y - m_prevCursor.Y;
00043
00044             RotateYaw(deltaX * cPixelsToRadiansPerSecond);
00045             RotatePitch(deltaY * cPixelsToRadiansPerSecond);
00046         }
00047
00048         m_prevCursor = currCursor;
00049     }
00050 }
00051
00052 void FirstPersonCamera::Update(float dt)
00053 {
00054     auto isKeyHeldDown = [](VirtualKey key) {
00055         return (CoreWindow::GetForCurrentThread()->GetKeyState(key) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
00056     };
00057
00058     ////////////////////////////////////////////////////////////////////////////////
00059     // Movement by Gamepad or Keyboard
00060
00061     if (isKeyHeldDown(VirtualKey::W) ||
00062         isKeyHeldDown(VirtualKey::GamepadLeftThumbstickUp))
00063     {
00064         MoveAlongZ(-cMovementMetersPerSecond * dt);
00065     }
00066
00067     if (isKeyHeldDown(VirtualKey::S) ||
00068         isKeyHeldDown(VirtualKey::GamepadLeftThumbstickDown))
00069     {
00070         MoveAlongZ(+cMovementMetersPerSecond * dt);
00071     }
00072
00073     if (isKeyHeldDown(VirtualKey::A) ||
00074         isKeyHeldDown(VirtualKey::GamepadLeftThumbstickLeft))
00075     {
00076         MoveAlongX(-cMovementMetersPerSecond * dt);
00077     }
00078
00079     if (isKeyHeldDown(VirtualKey::D) ||
00080         isKeyHeldDown(VirtualKey::GamepadLeftThumbstickRight))
00081     {
00082         MoveAlongX(+cMovementMetersPerSecond * dt);
00083     }
00084
00085     if (isKeyHeldDown(VirtualKey::Q) ||
00086         isKeyHeldDown(VirtualKey::GamepadLeftTrigger))
00087     {
00088         MoveAlongY(-cMovementMetersPerSecond * dt);
00089     }
00090
00091     if (isKeyHeldDown(VirtualKey::E) ||
00092         isKeyHeldDown(VirtualKey::GamepadRightTrigger))
00093     {
00094         MoveAlongY(+cMovementMetersPerSecond * dt);
00095     }
00096
00097     ////////////////////////////////////////////////////////////////////////////////
00098     // Rotation by Gamepad
00099
00100     if (isKeyHeldDown(VirtualKey::GamepadRightThumbstickLeft))
00101     {
00102         RotateYaw(-cRotationRadiansPerSecond * dt);
00103     }
00104
00105     if (isKeyHeldDown(VirtualKey::GamepadRightThumbstickRight))
00106     {
00107         RotateYaw(+cRotationRadiansPerSecond * dt);
00108     }
00109
00110     if (isKeyHeldDown(VirtualKey::GamepadRightThumbstickUp))
00111     {
00112         RotatePitch(-cRotationRadiansPerSecond * dt);
00113     }
00114
00115     if (isKeyHeldDown(VirtualKey::GamepadRightThumbstickDown))
00116     {
00117         RotatePitch(+cRotationRadiansPerSecond * dt);
00118     }
00119 }
00120
00121 void FirstPersonCamera::Reset()
00122 {
00123     m_position = Windows::Foundation::Numerics::float3::zero();
00124     m_prevCursor = {
00125         std::numeric_limits<float>::quiet_NaN(),
00126         std::numeric_limits<float>::quiet_NaN()
00127     };
00128
00129     m_yawAngle = 0.0f;
00130     m_pitchAngle = 0.0f;
00131 }
00132
00133 float4x4 FirstPersonCamera::GetWorldToCamera()
00134 {
00135     return make_float4x4_translation(-m_position) * make_float4x4_rotation_y(m_yawAngle) * make_float4x4_rotation_x(m_pitchAngle);
00136 }
00137
00138 float4x4 FirstPersonCamera::GetCameraToWorld()
00139 {
00140     return make_float4x4_rotation_x(-m_pitchAngle) * make_float4x4_rotation_y(-m_yawAngle) * make_float4x4_translation(m_position);
00141 }
00142
00143 void FirstPersonCamera::RotateYaw(float radians)
00144 {
00145     m_yawAngle += radians;
00146 }
00147
00148 void FirstPersonCamera::RotatePitch(float radians)
00149 {
00150     m_pitchAngle += radians;
00151 }
00152
00153 void FirstPersonCamera::MoveAlongX(float distance)
00154 {
00155     const float4x4 cameraToWorld = GetCameraToWorld();
00156     const float3 rightVec = { cameraToWorld.m11, cameraToWorld.m12, cameraToWorld.m13 };
00157     m_position += rightVec * distance;
00158 }
00159
00160 void FirstPersonCamera::MoveAlongY(float distance)
00161 {
00162     const float4x4 cameraToWorld = GetCameraToWorld();
00163     const float3 upVec = { cameraToWorld.m21, cameraToWorld.m22, cameraToWorld.m23 };
00164     m_position += upVec * distance;
00165 }
00166
00167 void FirstPersonCamera::MoveAlongZ(float distance)
00168 {
00169     const float4x4 cameraToWorld = GetCameraToWorld();
00170     const float3 forwardVec = { cameraToWorld.m31, cameraToWorld.m32, cameraToWorld.m33 };
00171     m_position += forwardVec * distance;
00172 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Renderers/ShapeRenderer.cpp Source File

  • ComplexInk
  • cpp
  • Renderers

ShapeRenderer.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "ShapeRenderer.h"
00005
00006 using namespace SDKTemplate;
00007 using namespace Microsoft::WRL;
00008
00009 ShapeRenderer::ShapeRenderer()
00010 {
00011     unsigned int seed = (unsigned int)time(0);
00012     srand(seed);
00013
00014     _generator = std::default_random_engine(seed);
00015 }
00016
00017 void ShapeRenderer::Render(Shape shape, Microsoft::WRL::ComPtr<ID2D1DeviceContext> d2dContext)
00018 {
00019     d2dContext->FillRectangle(&shape.shape, shape.brush.Get());
00020 }
00021
00022 void ShapeRenderer::CreateBrush(
00023     _Outptr_ ID2D1SolidColorBrush** brush, Microsoft::WRL::ComPtr<ID2D1DeviceContext> d2dContext)
00024 {
00025     int R = rand() % 256;
00026     int G = rand() % 256;
00027     int B = rand() % 256;
00028
00029     D2D1::ColorF d2dColor(R / 255.0f, G / 255.0f, B / 255.0f);
00030     *brush = nullptr;
00031     DX::ThrowIfFailed(
00032         d2dContext->CreateSolidColorBrush(
00033         d2dColor,
00034         brush
00035         )
00036         );
00037 }
00038
00039 Shape ShapeRenderer::Update(Microsoft::WRL::ComPtr<ID2D1DeviceContext> d2dContext)
00040 {
00041     Shape newShape;
00042
00043     float centerX = _shapeDistributionX(_generator);
00044     float centerY = _shapeDistributionY(_generator);
00045     float width = _shapeDistributionX.mean() * 2;
00046     float height = _shapeDistributionY.mean() * 2;
00047
00048     // The shape size is a percentage of the size of the canvas. This will create shapes that are proportional
00049     // to the canvas, regardless of the size of the screen.
00050     const float maxShapeSize = max(width, height) * MAX_SHAPE_SIZE_PERCENTAGE;
00051     const float minShapeSize = max(width, height) * MIN_SHAPE_SIZE_PERCENTAGE;
00052
00053     float shapeWidth = 0, shapeHeight = 0;
00054     if (maxShapeSize > minShapeSize)
00055     {
00056         shapeWidth = (float)(rand() % ((int)(maxShapeSize - minShapeSize))) + minShapeSize;
00057         shapeHeight = (float)(rand() % ((int)(maxShapeSize - minShapeSize))) + minShapeSize;
00058     }
00059
00060     float left = centerX - (shapeWidth / 2);
00061     float top = centerY - (shapeHeight / 2);
00062
00063     // limit the shape position to the size of the canvas
00064     if (left <  0) left = maxShapeSize;
00065     if (top < 0) top = maxShapeSize;
00066     if (left > (width - maxShapeSize)) left = width - shapeWidth;
00067     if (top > (height - maxShapeSize))  top = height - shapeHeight;
00068
00069     D2D1_RECT_F rectangle = D2D1::RectF(left, top, left + (shapeWidth / 2), top + (shapeHeight / 2));
00070
00071     Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> shapeBrush;
00072     CreateBrush(&shapeBrush, d2dContext);
00073
00074     newShape.shape = rectangle;
00075     newShape.brush = shapeBrush;
00076
00077     return newShape;
00078 }
00079
00080 void ShapeRenderer::RefreshSize(Windows::Foundation::Size newSize)
00081 {
00082     int width = static_cast<int>(newSize.Width);
00083     int height = static_cast<int>(newSize.Height);
00084
00085     if (width > 0 && height > 0)
00086     {
00087         // The mean will be the center of the viewport and the standard deviation a fourth of it
00088         _shapeDistributionX = std::normal_distribution<float>((float)width / 2, (float)width / 4);
00089         _shapeDistributionY = std::normal_distribution<float>((float)height / 2, (float)height / 4);
00090     }
00091 }
Generated on Fri Nov 15 2024 22:18:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/Scenario2_DeviceConnect.xaml.cs Source File

  • CustomCapability
  • cs

Scenario2_DeviceConnect.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.Custom;
00015 using Windows.UI.Xaml;
00016 using Windows.UI.Xaml.Controls;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 namespace SDKTemplate
00020 {
00021     /// <summary>
00022     /// An empty page that can be used on its own or navigated to within a Frame.
00023     /// </summary>
00024     public sealed partial class DeviceConnect
00025     {
00026         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00027         // as NotifyUser()
00028         MainPage rootPage = MainPage.Current;
00029
00030         public DeviceConnect()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         /// <summary>
00036         /// Invoked when this page is about to be displayed in a Frame.
00037         /// </summary>
00038         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042             UpdateStartStopButtons();
00043             listSource.Source = DeviceList.Current.Fx2Devices;
00044         }
00045
00046         private void deviceConnectStart_Click(object sender, RoutedEventArgs e)
00047         {
00048             DeviceList.Current.StartFx2Watcher();
00049             UpdateStartStopButtons();
00050         }
00051
00052         private void deviceConnectStop_Click(object sender, RoutedEventArgs e)
00053         {
00054             DeviceList.Current.StopFx2Watcher();
00055             UpdateStartStopButtons();
00056         }
00057
00058         private async void deviceConnectDevices_SelectionChanged(object sender, SelectionChangedEventArgs e)
00059         {
00060             var entry = (DeviceListEntry)deviceConnectDevices.SelectedItem;
00061             var currentlySelectedId = DeviceList.Current.GetSelectedDeviceId();
00062             var newlySelectedId = entry?.Id;
00063
00064             if (currentlySelectedId != null)
00065             {
00066                 CloseFx2Device();
00067             }
00068
00069             if (newlySelectedId != null)
00070             {
00071                 await OpenFx2DeviceAsync(newlySelectedId);
00072             }
00073         }
00074
00075         private void UpdateStartStopButtons()
00076         {
00077             this.deviceConnectStart.IsEnabled = !DeviceList.Current.WatcherStarted;
00078             this.deviceConnectStop.IsEnabled = DeviceList.Current.WatcherStarted;
00079         }
00080
00081         private async Task OpenFx2DeviceAsync(string Id)
00082         {
00083             System.Diagnostics.Debug.Assert(DeviceList.Current.GetSelectedDevice() == null);
00084
00085             try
00086             {
00087                 var device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
00088                 DeviceList.Current.SetSelectedDevice(Id, device);
00089             }
00090             catch (Exception e)
00091             {
00092                 rootPage.NotifyUser($"Error opening Fx2 device @{Id}: {e.Message}", NotifyType.ErrorMessage);
00093                 return;
00094             }
00095             rootPage.NotifyUser($"Fx2 {Id} opened", NotifyType.StatusMessage);
00096             return;
00097         }
00098
00099         private void CloseFx2Device()
00100         {
00101             if (DeviceList.Current.GetSelectedDevice() != null)
00102             {
00103                 rootPage.NotifyUser($"Fx2 {DeviceList.Current.GetSelectedDeviceId()} closed", NotifyType.StatusMessage);
00104                 DeviceList.Current.ClearSelectedDevice();
00105             }
00106         }
00107     }
00108 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserCertificateStore/cppwinrt/SampleConfiguration.h Source File

  • UserCertificateStore
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario4_MultipleTasks.xaml.cpp Source File

  • ExtendedExecution
  • cpp

Scenario4_MultipleTasks.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_MultipleTasks.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::ApplicationModel;
00021 using namespace Windows::ApplicationModel::ExtendedExecution;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 MultipleTasks::MultipleTasks()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void MultipleTasks::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00033 {
00034     // End the Extended Execution Session.
00035     // Only one extended execution session can be held by an application at one time.
00036     ClearExtendedExecution();
00037 }
00038
00039 void MultipleTasks::ClearExtendedExecution()
00040 {
00041     // Cancel any outstanding tasks.
00042     cancellationTokenSource.cancel();
00043
00044     // Dispose any outstanding session.
00045     if (session)
00046     {
00047         session->Revoked -= sessionRevokedToken;
00048         delete session;
00049         session = nullptr;
00050     }
00051 }
00052
00053 void MultipleTasks::UpdateUI()
00054 {
00055     if (session == nullptr)
00056     {
00057         Status->Text = "Not requested";
00058         RequestButton->IsEnabled = true;
00059         CloseButton->IsEnabled = false;
00060
00061     }
00062     else
00063     {
00064         Status->Text = "Requested";
00065         RequestButton->IsEnabled = false;
00066         CloseButton->IsEnabled = true;
00067     }
00068 }
00069
00070 void MultipleTasks::OnTaskCompleted()
00071 {
00072     taskCount--;
00073     if (taskCount == 0 && session != nullptr)
00074     {
00075         EndExtendedExecution();
00076         MainPage::DisplayToast("All Tasks Completed, ending Extended Execution.");
00077     }
00078 }
00079
00080 Deferral^ MultipleTasks::GetExecutionDeferral()
00081 {
00082     if (session == nullptr)
00083     {
00084         throw ref new FailureException("No extended execution session is active");
00085     }
00086
00087     taskCount++;
00088     return ref new Deferral(ref new DeferralCompletedHandler(this, &MultipleTasks::OnTaskCompleted));
00089 }
00090
00091 void MultipleTasks::BeginExtendedExecution()
00092 {
00093     // The previous Extended Execution must be closed before a new one can be requested.
00094     // This code is redundant here because the sample doesn't allow a new extended
00095     // execution to begin until the previous one ends, but we leave it here for illustration.
00096     ClearExtendedExecution();
00097
00098     auto newSession = ref new ExtendedExecutionSession();
00099     newSession->Reason = ExtendedExecutionReason::Unspecified;
00100     newSession->Description = "Running multiple tasks";
00101     sessionRevokedToken = newSession->Revoked += ref new TypedEventHandler<Object^, ExtendedExecutionRevokedEventArgs^>(
00102         this, &MultipleTasks::SessionRevoked);
00103     create_task(newSession->RequestExtensionAsync()).then([this, newSession](ExtendedExecutionResult result)
00104     {
00105         switch (result)
00106         {
00107         case ExtendedExecutionResult::Allowed:
00108             rootPage->NotifyUser("Extended execution allowed.", NotifyType::StatusMessage);
00109             session = newSession;
00110             break;
00111
00112         default:
00113         case ExtendedExecutionResult::Denied:
00114             rootPage->NotifyUser("Extended execution denied.", NotifyType::ErrorMessage);
00115             delete newSession;
00116             break;
00117         }
00118         UpdateUI();
00119
00120         if (session != nullptr)
00121         {
00122             cancellationTokenSource = cancellation_token_source();
00123
00124             // Start up a few tasks that all share this session.
00125             Deferral^ deferral = GetExecutionDeferral();
00126
00127             for (int i = 0; i < 3; i++)
00128             {
00129                 int randomDelay = 5 + rand() % 6;
00130                 RaiseToastAfterDelay(i, randomDelay);
00131             }
00132
00133             deferral->Complete();
00134         }
00135     }, task_continuation_context::get_current_winrt_context());
00136 }
00137
00138 void MultipleTasks::RaiseToastAfterDelay(int id, int seconds)
00139 {
00140     Deferral^ deferral = GetExecutionDeferral();
00141
00142     Helpers::DelayAsync(Helpers::TimeSpanFromSeconds(seconds), cancellationTokenSource.get_token())
00143         .then([this, id, seconds, deferral](task<void> previousTask)
00144     {
00145         try
00146         {
00147             // Raise the cancellation exception if the task was canceled.
00148             previousTask.get();
00149
00150             // This code runs if the task was not canceled.
00151             MainPage::DisplayToast("Task " + id.ToString() + " completed after " + seconds.ToString() + " seconds");
00152         }
00153         catch (const task_canceled&)
00154         {
00155             // This code runs if the task was canceled.
00156             MainPage::DisplayToast("Task " + id.ToString() + " canceled");
00157         }
00158
00159         deferral->Complete();
00160     }, task_continuation_context::get_current_winrt_context());
00161 }
00162
00163 void MultipleTasks::EndExtendedExecution()
00164 {
00165     ClearExtendedExecution();
00166     UpdateUI();
00167 }
00168
00169 void MultipleTasks::SessionRevoked(Object^ sender, ExtendedExecutionRevokedEventArgs^ args)
00170 {
00171     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00172     {
00173         switch (args->Reason)
00174         {
00175         case ExtendedExecutionRevokedReason::Resumed:
00176             rootPage->NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType::StatusMessage);
00177             break;
00178
00179         case ExtendedExecutionRevokedReason::SystemPolicy:
00180             rootPage->NotifyUser("Extended execution revoked due to system policy.", NotifyType::StatusMessage);
00181             break;
00182         }
00183
00184         EndExtendedExecution();
00185     }));
00186 }
Generated on Fri Nov 15 2024 22:19:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameXaml/cpp/Common/DDSTextureLoader.h Source File

  • Simple3DGameXaml
  • cpp
  • Common

DDSTextureLoader.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------------------
00002 // File: DDSTextureLoader.h
00003 //
00004 // Functions for loading a DDS texture and creating a Direct3D 11 runtime resource for it
00005 //
00006 // Note these functions are useful as a light-weight runtime loader for DDS files. For
00007 // a full-featured DDS file reader, writer, and texture processing pipeline see
00008 // the 'Texconv' sample and the 'DirectXTex' library.
00009 //
00010 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00011 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00012 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 // PARTICULAR PURPOSE.
00014 //
00015 // Copyright (c) Microsoft Corporation. All rights reserved.
00016 //
00017 // http://go.microsoft.com/fwlink/?LinkId=248926
00018 // http://go.microsoft.com/fwlink/?LinkId=248929
00019 //--------------------------------------------------------------------------------------
00020
00021 #pragma once
00022
00023 void CreateDDSTextureFromMemory(
00024     _In_ ID3D11Device* d3dDevice,
00025     _In_reads_bytes_(ddsDataSize) const byte* ddsData,
00026     _In_ size_t ddsDataSize,
00027     _Outptr_opt_ ID3D11Resource** texture,
00028     _Outptr_opt_ ID3D11ShaderResourceView** textureView,
00029     _In_ size_t maxsize = 0,
00030     _Out_opt_ D2D1_ALPHA_MODE* alphaMode = nullptr
00031     );
00032
00033 void CreateDDSTextureFromMemoryEx(
00034     _In_ ID3D11Device* d3dDevice,
00035     _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
00036     _In_ size_t ddsDataSize,
00037     _In_ size_t maxsize,
00038     _In_ D3D11_USAGE usage,
00039     _In_ unsigned int bindFlags,
00040     _In_ unsigned int cpuAccessFlags,
00041     _In_ unsigned int miscFlags,
00042     _In_ bool forceSRGB,
00043     _Outptr_opt_ ID3D11Resource** texture,
00044     _Outptr_opt_ ID3D11ShaderResourceView** textureView,
00045     _Out_opt_ D2D1_ALPHA_MODE* alphaMode = nullptr
00046     );
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MainPage Member List

This is the complete list of members for MainPage, including all inherited members.
goBack(object sender, BackRequestedEventArgs e) | MainPage | [inline, private]
MainPage() | MainPage | [inline]
MainPage_BackRequested(object sender, BackRequestedEventArgs e) | MainPage | [inline, private]
Generated on Fri Nov 15 2024 22:23:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSharpModel Member List

This is the complete list of members for CSharpModel, including all inherited members.
CSharpModel() | CSharpModel | [inline]
InitializeValues() | CSharpModel | [inline, private]
IntField | CSharpModel |
StringField | CSharpModel |
UpdateValues() | CSharpModel | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cpp/pch.h Source File

  • JumpList
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "SampleConfiguration.h"
00011 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cppwinrt/AppServicesProvider/SampleConfiguration.h Source File

  • AppServices
  • cppwinrt
  • AppServicesProvider

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/LiveTiles/UnpinEverything/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • LiveTiles
  • UnpinEverything

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.StartScreen;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.LiveTiles.UnpinEverything
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         public ScenarioElement()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         private async void ButtonUnpinEverything_Click(object sender, RoutedEventArgs e)
00021         {
00022             ButtonUnpinEverything.IsEnabled = false;
00023
00024             // Loop through every secondary tile
00025             foreach (SecondaryTile tile in await SecondaryTile.FindAllAsync())
00026             {
00027                 // Unpin each secondary tile
00028                 await tile.RequestDeleteAsync();
00029             }
00030
00031             ButtonUnpinEverything.IsEnabled = true;
00032         }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario01_GetText Member List

This is the complete list of members for Scenario01_GetText, including all inherited members.
Cancel_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario01_GetText |
CancelableRequestAsync(Windows::Foundation::Uri resourceUri) | Scenario01_GetText | [private]
isFilterUsed | Scenario01_GetText | [private]
MaxHttpVersionToggle_Toggled(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario01_GetText |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario01_GetText |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario01_GetText |
Scenario01_GetText() | Scenario01_GetText |
Start_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario01_GetText |
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Functions Member List

This is the complete list of members for Functions, including all inherited members.
ClearColorsClick(object sender, RoutedEventArgs e) | Functions | [inline, private]
ColorEntries | Functions | [private]
ColorValue(double red, double green, double blue) | Functions | [inline]
CountEmployees(IEmployee e) | Functions | [inline]
CountEmployeesinternal(IEmployee e) | Functions | [inline]
countVowels(string words) | Functions | [inline, private]
CSharpModel | Functions |
Display(string stringArg, int intArg, double floatArg, bool boolArg) | Functions | [inline, private]
Functions() | Functions | [inline]
GetTime() | Functions | [inline, private]
InitializeValues() | Functions | [inline, private]
MakeColor(double red, double green, double blue) | Functions | [inline]
Model | Functions |
NullEmployee | Functions |
NullStringProperty | Functions |
PopulateColorsClick(object sender, RoutedEventArgs e) | Functions | [inline, private]
ProcessColor(string value) | Functions | [inline]
ResetValuesClick(object sender, RoutedEventArgs e) | Functions | [inline, private]
ShowPlaceholder(int count) | Functions | [inline]
TextColor(Color c) | Functions | [inline, static]
UpdateValuesClick(object sender, RoutedEventArgs e) | Functions | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/SdrOverlayEffect.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

SdrOverlayEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // Not a tonemapper, instead demonstrates visually what would happen in SDR mode:
00013 // - Truncates values to 8 bits per channel
00014 // - Converts out of gamut colors to grayscale
00015
00016 DEFINE_GUID(GUID_SdrOverlayPixelShader, 0xfddf597e, 0x98d4, 0x4aac, 0x83, 0x49, 0x6f, 0xb8, 0x76, 0x67, 0xdc, 0xb5);
00017 DEFINE_GUID(CLSID_CustomSdrOverlayEffect, 0x376c22b8, 0xe6c3, 0x41e7, 0xb1, 0xc1, 0xfb, 0x5f, 0x7e, 0xc9, 0xee, 0x49);
00018
00019 // Our effect contains one transform, which is simply a wrapper around a pixel shader. As such,
00020 // we can simply make the effect itself act as the transform.
00021 class SdrOverlayEffect : public ID2D1EffectImpl, public ID2D1DrawTransform
00022 {
00023 public:
00024     // Declare effect registration methods.
00025     static HRESULT Register(_In_ ID2D1Factory1* pFactory);
00026
00027     static HRESULT __stdcall CreateSdrOverlayImpl(_Outptr_ IUnknown** ppEffectImpl);
00028
00029     // Declare ID2D1EffectImpl implementation methods.
00030     IFACEMETHODIMP Initialize(
00031         _In_ ID2D1EffectContext* pContextInternal,
00032         _In_ ID2D1TransformGraph* pTransformGraph
00033         );
00034
00035     IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE changeType);
00036
00037     IFACEMETHODIMP SetGraph(_In_ ID2D1TransformGraph* pGraph);
00038
00039     // Declare ID2D1DrawTransform implementation methods.
00040     IFACEMETHODIMP SetDrawInfo(_In_ ID2D1DrawInfo* pRenderInfo);
00041
00042     // Declare ID2D1Transform implementation methods.
00043     IFACEMETHODIMP MapOutputRectToInputRects(
00044         _In_ const D2D1_RECT_L* pOutputRect,
00045         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00046         UINT32 inputRectCount
00047         ) const;
00048
00049     IFACEMETHODIMP MapInputRectsToOutputRect(
00050         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00051         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00052         UINT32 inputRectCount,
00053         _Out_ D2D1_RECT_L* pOutputRect,
00054         _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00055         );
00056
00057     IFACEMETHODIMP MapInvalidRect(
00058         UINT32 inputIndex,
00059         D2D1_RECT_L invalidInputRect,
00060         _Out_ D2D1_RECT_L* pInvalidOutputRect
00061         ) const;
00062
00063     // Declare ID2D1TransformNode implementation methods.
00064     IFACEMETHODIMP_(UINT32) GetInputCount() const;
00065
00066     // Declare IUnknown implementation methods.
00067     IFACEMETHODIMP_(ULONG) AddRef();
00068     IFACEMETHODIMP_(ULONG) Release();
00069     IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppOutput);
00070
00071     // Declare property getter/setter methods.
00072
00073 private:
00074     SdrOverlayEffect();
00075     HRESULT UpdateConstants();
00076
00077     // This struct defines the constant buffer of our pixel shader.
00078     struct
00079     {
00080         float dpi;
00081     } m_constants;
00082
00083     Microsoft::WRL::ComPtr<ID2D1DrawInfo>      m_drawInfo;
00084     Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext;
00085     LONG                                       m_refCount;
00086     D2D1_RECT_L                                m_inputRect;
00087     float                                      m_dpi;
00088 };
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DataReaderWriter/cpp/Scenario2_ReadBytes.xaml.h Source File

  • DataReaderWriter
  • cpp

Scenario2_ReadBytes.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ReadBytes.xaml.h
00014 // Declaration of the ReadBytes class
00015 //
00016
00017 #pragma once
00018
00019 #include <cstring>
00020 #include "pch.h"
00021 #include "Scenario2_ReadBytes.g.h"
00022 #include "MainPage.xaml.h"
00023
00024 namespace SDKTemplate
00025 {
00026     /// <summary>
00027     /// An empty page that can be used on its own or navigated to within a Frame.
00028     /// </summary>
00029     [Windows::Foundation::Metadata::WebHostHidden]
00030     public ref class ReadBytes sealed
00031     {
00032     public:
00033         ReadBytes();
00034
00035     protected:
00036         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037     private:
00038         MainPage^ rootPage;
00039         void HexDump(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         void ReadLoop(Windows::Storage::Streams::DataReader^ dataReader);
00041         void PrintRow(Platform::Array<byte>^ bytes, int i);
00042         Platform::String^ GetAddress(int i);
00043         Platform::String^ ToHex(byte value);
00044         int static const bytesPerRow = 16;
00045         int static const bytesPerSegment = 2;
00046         int static const chunkSize = 4096;
00047         int currChunk;
00048     };
00049 }
Generated on Fri Nov 15 2024 22:19:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MessageDialog/cpp/CustomCommand.xaml.h Source File

  • MessageDialog
  • cpp

CustomCommand.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // CustomCommand.xaml.h
00013 // Declaration of the CustomCommand class
00014 //
00015
00016 #pragma once
00017
00018 #include "CustomCommand.g.h"
00019 #include "MainPage.xaml.h"
00020
00021 namespace SDKTemplate
00022 {
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class CustomCommand sealed
00025     {
00026     public:
00027         CustomCommand();
00028
00029     protected:
00030         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00031     private:
00032         MainPage^ rootPage;
00033         void CustomCommandButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00034     };
00035 }
Generated on Fri Nov 15 2024 22:20:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MIDI/cs/MidiDeviceWatcher.cs Source File

  • MIDI
  • cs

MidiDeviceWatcher.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.Devices.Enumeration;
00017 using Windows.Devices.Midi;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Navigation;
00022
00023 namespace MIDI
00024 {
00025     /// <summary>
00026     /// DeviceWatcher class to monitor adding/removing MIDI devices on the fly
00027     /// </summary>
00028     internal class MidiDeviceWatcher
00029     {
00030         internal DeviceWatcher deviceWatcher = null;
00031         internal DeviceInformationCollection deviceInformationCollection = null;
00032         bool enumerationCompleted = false;
00033         ListBox portList = null;
00034         string midiSelector = string.Empty;
00035         CoreDispatcher coreDispatcher = null;
00036
00037         /// <summary>
00038         /// Constructor: Initialize and hook up Device Watcher events
00039         /// </summary>
00040         /// <param name="midiSelectorString">MIDI Device Selector</param>
00041         /// <param name="dispatcher">CoreDispatcher instance, to update UI thread</param>
00042         /// <param name="portListBox">The UI element to update with list of devices</param>
00043         internal MidiDeviceWatcher(string midiSelectorString, CoreDispatcher dispatcher, ListBox portListBox)
00044         {
00045             this.deviceWatcher = DeviceInformation.CreateWatcher(midiSelectorString);
00046             this.portList = portListBox;
00047             this.midiSelector = midiSelectorString;
00048             this.coreDispatcher = dispatcher;
00049
00050             this.deviceWatcher.Added += DeviceWatcher_Added;
00051             this.deviceWatcher.Removed += DeviceWatcher_Removed;
00052             this.deviceWatcher.Updated += DeviceWatcher_Updated;
00053             this.deviceWatcher.EnumerationCompleted += DeviceWatcher_EnumerationCompleted;
00054         }
00055
00056         /// <summary>
00057         /// Destructor: Remove Device Watcher events
00058         /// </summary>
00059         ~MidiDeviceWatcher()
00060         {
00061             this.deviceWatcher.Added -= DeviceWatcher_Added;
00062             this.deviceWatcher.Removed -= DeviceWatcher_Removed;
00063             this.deviceWatcher.Updated -= DeviceWatcher_Updated;
00064             this.deviceWatcher.EnumerationCompleted -= DeviceWatcher_EnumerationCompleted;
00065         }
00066
00067         /// <summary>
00068         /// Start the Device Watcher
00069         /// </summary>
00070         internal void Start()
00071         {
00072             if(this.deviceWatcher.Status != DeviceWatcherStatus.Started)
00073             {
00074                 this.deviceWatcher.Start();
00075             }
00076         }
00077
00078         /// <summary>
00079         /// Stop the Device Watcher
00080         /// </summary>
00081         internal void Stop()
00082         {
00083             if(this.deviceWatcher.Status != DeviceWatcherStatus.Stopped)
00084             {
00085                 this.deviceWatcher.Stop();
00086             }
00087         }
00088
00089         /// <summary>
00090         /// Get the DeviceInformationCollection
00091         /// </summary>
00092         /// <returns></returns>
00093         internal DeviceInformationCollection GetDeviceInformationCollection()
00094         {
00095             return this.deviceInformationCollection;
00096         }
00097
00098         /// <summary>
00099         /// Add any connected MIDI devices to the list
00100         /// </summary>
00101         private async void UpdateDevices()
00102         {
00103             // Get a list of all MIDI devices
00104             this.deviceInformationCollection = await DeviceInformation.FindAllAsync(this.midiSelector);
00105
00106             // If no devices are found, update the ListBox
00107             if ((this.deviceInformationCollection == null) || (this.deviceInformationCollection.Count == 0))
00108             {
00109                 // Start with a clean list
00110                 this.portList.Items.Clear();
00111
00112                 this.portList.Items.Add("No MIDI ports found");
00113                 this.portList.IsEnabled = false;
00114             }
00115             // If devices are found, enumerate them and add them to the list
00116             else
00117             {
00118                 // Start with a clean list
00119                 this.portList.Items.Clear();
00120
00121                 foreach (var device in deviceInformationCollection)
00122                 {
00123                     this.portList.Items.Add(device.Name);
00124                 }
00125
00126                 this.portList.IsEnabled = true;
00127             }
00128         }
00129
00130         /// <summary>
00131         /// Update UI on device added
00132         /// </summary>
00133         /// <param name="sender">The active DeviceWatcher instance</param>
00134         /// <param name="args">Event arguments</param>
00135         private async void DeviceWatcher_Added(DeviceWatcher sender, DeviceInformation args)
00136         {
00137             // If all devices have been enumerated
00138             if (this.enumerationCompleted)
00139             {
00140                 await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
00141                 {
00142                     // Update the device list
00143                     UpdateDevices();
00144                 });
00145             }
00146         }
00147
00148         /// <summary>
00149         /// Update UI on device removed
00150         /// </summary>
00151         /// <param name="sender">The active DeviceWatcher instance</param>
00152         /// <param name="args">Event arguments</param>
00153         private async void DeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
00154         {
00155             // If all devices have been enumerated
00156             if (this.enumerationCompleted)
00157             {
00158                 await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
00159                 {
00160                     // Update the device list
00161                     UpdateDevices();
00162                 });
00163             }
00164         }
00165
00166         /// <summary>
00167         /// Update UI on device updated
00168         /// </summary>
00169         /// <param name="sender">The active DeviceWatcher instance</param>
00170         /// <param name="args">Event arguments</param>
00171         private async void DeviceWatcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args)
00172         {
00173             // If all devices have been enumerated
00174             if (this.enumerationCompleted)
00175             {
00176                 await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
00177                 {
00178                     // Update the device list
00179                     UpdateDevices();
00180                 });
00181             }
00182         }
00183
00184         /// <summary>
00185         /// Update UI on device enumeration completed.
00186         /// </summary>
00187         /// <param name="sender">The active DeviceWatcher instance</param>
00188         /// <param name="args">Event arguments</param>
00189         private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
00190         {
00191             this.enumerationCompleted = true;
00192             await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
00193             {
00194                 // Update the device list
00195                 UpdateDevices();
00196             });
00197         }
00198     }
00199 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cs/MainPage.xaml.cs Source File

  • Projection
  • cs

MainPage.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005 using Windows.UI.Xaml.Data;
00006 using Windows.UI.Xaml.Media;
00007 using Windows.UI.Xaml.Navigation;
00008
00009 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
00010
00011 namespace SDKTemplate
00012 {
00013     /// <summary>
00014     /// An empty page that can be used on its own or navigated to within a Frame.
00015     /// </summary>
00016     public sealed partial class MainPage : Page
00017     {
00018         public Windows.ApplicationModel.Activation.LaunchActivatedEventArgs LaunchArgs
00019         {
00020             get
00021             {
00022                 return ((App)App.Current).LaunchArgs;
00023             }
00024         }
00025
00026         public static MainPage Current;
00027
00028         public MainPage()
00029         {
00030             this.InitializeComponent();
00031
00032             // This is a static public property that allows downstream pages to get a handle to the MainPage instance
00033             // in order to call methods that are in this class.
00034             Current = this;
00035             SampleTitle.Text = FEATURE_NAME;
00036         }
00037
00038         protected override void OnNavigatedTo(NavigationEventArgs e)
00039         {
00040             // Populate the scenario list from the SampleConfiguration.cs file
00041             ScenarioControl.ItemsSource = scenarios;
00042             if (Window.Current.Bounds.Width < 640)
00043             {
00044                 ScenarioControl.SelectedIndex = -1;
00045             }
00046             else
00047             {
00048                 ScenarioControl.SelectedIndex = 0;
00049             }
00050         }
00051
00052         /// <summary>
00053         /// Called whenever the user changes selection in the scenarios list.  This method will navigate to the respective
00054         /// sample scenario page.
00055         /// </summary>
00056         /// <param name="sender"></param>
00057         /// <param name="e"></param>
00058         private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
00059         {
00060             // Clear the status block when navigating scenarios.
00061             NotifyUser(String.Empty, NotifyType.StatusMessage);
00062
00063             ListBox scenarioListBox = sender as ListBox;
00064             Scenario s = scenarioListBox.SelectedItem as Scenario;
00065             if (s != null)
00066             {
00067                 ScenarioFrame.Navigate(s.ClassType);
00068                 if (Window.Current.Bounds.Width < 640)
00069                 {
00070                     Splitter.IsPaneOpen = false;
00071                     StatusBorder.Visibility = Visibility.Collapsed;
00072                 }
00073             }
00074         }
00075
00076         public List<Scenario> Scenarios
00077         {
00078             get { return this.scenarios; }
00079         }
00080
00081         /// <summary>
00082         /// Used to display messages to the user
00083         /// </summary>
00084         /// <param name="strMessage"></param>
00085         /// <param name="type"></param>
00086         public void NotifyUser(string strMessage, NotifyType type)
00087         {
00088             switch (type)
00089             {
00090                 case NotifyType.StatusMessage:
00091                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
00092                     break;
00093                 case NotifyType.ErrorMessage:
00094                     StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
00095                     break;
00096             }
00097             StatusBlock.Text = strMessage;
00098
00099             // Collapse the StatusBlock if it has no text to conserve real estate.
00100             StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
00101         }
00102
00103         async void Footer_Click(object sender, RoutedEventArgs e)
00104         {
00105             await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
00106         }
00107
00108         private void Button_Click(object sender, RoutedEventArgs e)
00109         {
00110             Splitter.IsPaneOpen = (Splitter.IsPaneOpen == true) ? false : true;
00111             StatusBorder.Visibility = Visibility.Collapsed;
00112         }
00113     }
00114     public enum NotifyType
00115     {
00116         StatusMessage,
00117         ErrorMessage
00118     };
00119
00120     public class ScenarioBindingConverter : IValueConverter
00121     {
00122         public object Convert(object value, Type targetType, object parameter, string language)
00123         {
00124             Scenario s = value as Scenario;
00125             return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title;
00126         }
00127
00128         public object ConvertBack(object value, Type targetType, object parameter, string language)
00129         {
00130             return true;
00131         }
00132     }
00133 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/xBindSampleModel/IEmployee.cs Source File

  • XamlBind
  • cpp
  • xBindSampleModel

IEmployee.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using Windows.UI.Xaml.Data;
00005 using System.ComponentModel;
00006 using System.Runtime.CompilerServices;
00007 using System.Collections.ObjectModel;
00008
00009 using Windows.Foundation.Collections;
00010 using System.Collections;
00011 using System.Collections.Specialized;
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Popups;
00014
00015 namespace xBindSampleModel
00016 {
00017     public interface IEmployee
00018     {
00019         string FirstName { get; set; }
00020         string LastName { get; set; }
00021         Manager DirectManager { get; set; }
00022         bool IsManager { get; }
00023         string Title { get; }
00024         string Name { get; }
00025         bool Visibility { get; set; }
00026         string NullStringProperty { get; set; }
00027         Windows.UI.Xaml.Media.ImageSource NullImageSource { get; set; }
00028         void Poke(object sender, RoutedEventArgs e);
00029         string FullName();
00030     }
00031 }
00032
Generated on Fri Nov 15 2024 22:22:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/ArticlePage.xaml.cs Source File

  • XamlTransform3DAnimations
  • cs

ArticlePage.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Transform3DAnimations.ViewModels;
00007 using Windows.Foundation;
00008 using Windows.Foundation.Collections;
00009 using Windows.UI.Core;
00010 using Windows.UI.ViewManagement;
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Controls.Primitives;
00014 using Windows.UI.Xaml.Data;
00015 using Windows.UI.Xaml.Input;
00016 using Windows.UI.Xaml.Media;
00017 using Windows.UI.Xaml.Navigation;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace Transform3DAnimations
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class ArticlePage : Page
00027     {
00028         private DispatcherTimer _loadTimer;
00029         private UISettings _uiSettings;
00030
00031         private static DependencyProperty s_articleProperty =
00032             DependencyProperty.Register("Article", typeof(ArticleViewModel), typeof(ArticlePage), new PropertyMetadata(null));
00033
00034         public static DependencyProperty ArticleProperty
00035         {
00036             get { return s_articleProperty; }
00037         }
00038
00039         public ArticleViewModel Article
00040         {
00041             get { return (ArticleViewModel)GetValue(s_articleProperty); }
00042             set { SetValue(s_articleProperty, value); }
00043         }
00044
00045         public ArticlePage()
00046         {
00047             this.InitializeComponent();
00048
00049             VisualStateManager.GoToState(this, "ContentNotLoadedState", false);
00050
00051             // Simulate asynchronous loading of content
00052             _loadTimer = new DispatcherTimer();
00053             _loadTimer.Interval = TimeSpan.FromSeconds(0.55);
00054             _loadTimer.Tick += LoadTimer_Tick;
00055
00056             _uiSettings = new UISettings();
00057         }
00058
00059         private void LoadTimer_Tick(object sender, object e)
00060         {
00061             // Play content entrance animation
00062             VisualStateManager.GoToState(this, "ContentLoadedState", _uiSettings.AnimationsEnabled);
00063         }
00064
00065         protected override void OnNavigatedTo(NavigationEventArgs e)
00066         {
00067             base.OnNavigatedTo(e);
00068
00069             var article = new ArticleViewModel();
00070             article.Headline = (string)e.Parameter;
00071
00072             this.Article = article;
00073
00074             _loadTimer.Start();
00075
00076             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00077             systemNavigationManager.BackRequested += ArticlePage_BackRequested;
00078             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
00079         }
00080
00081         protected override void OnNavigatedFrom(NavigationEventArgs e)
00082         {
00083             base.OnNavigatedFrom(e);
00084
00085             SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
00086             systemNavigationManager.BackRequested -= ArticlePage_BackRequested;
00087             systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
00088         }
00089
00090         private void ArticlePage_BackRequested(object sender, BackRequestedEventArgs e)
00091         {
00092             e.Handled = true;
00093             Frame.GoBack();
00094         }
00095
00096         private void BackButton_Click(object sender, RoutedEventArgs e)
00097         {
00098             Frame.GoBack();
00099         }
00100     }
00101 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Logging/cpp/LoggingScenarioHelpers.h Source File

  • Logging
  • cpp

LoggingScenarioHelpers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008 #include <chrono>
00009 #include <string>
00010 #include <agents.h>
00011
00012 namespace SDKTemplate
00013 {
00014     // Create a time stamp to append to log file names so
00015     // each file has a unique name. The format is:
00016     //     YYMMDD-hhmmssMMM
00017     // where
00018     //     YY == year
00019     //     MM == month
00020     //     DD == day
00021     //     hh == hours
00022     //     mm == minutes
00023     //     ss == seconds
00024     //     MMM == milliseconds
00025     inline std::wstring GetTimeStamp()
00026     {
00027         std::wstring result;
00028         SYSTEMTIME timeNow;
00029         GetLocalTime(&timeNow);
00030         result.resize(16);
00031         swprintf_s(
00032             &result[0],
00033             result.size() + 1,
00034             L"%02u%02u%02u-%02u%02u%02u%03u",
00035             timeNow.wYear - 2000,
00036             timeNow.wMonth,
00037             timeNow.wDay,
00038             timeNow.wHour,
00039             timeNow.wMinute,
00040             timeNow.wSecond,
00041             timeNow.wMilliseconds);
00042         return result;
00043     }
00044
00045     // Create a task which delays for a specified duration before executing a function.
00046     template <typename Func>
00047     auto create_delayed_task(
00048         std::chrono::milliseconds delay,
00049         Func func, concurrency::cancellation_token token = concurrency::cancellation_token::none())
00050         -> decltype(create_task(func))
00051     {
00052         concurrency::task_completion_event<void> tce;
00053
00054         auto pTimer = new concurrency::timer<int>(static_cast<int>(delay.count()), 0, NULL, false);
00055         auto pCallback = new concurrency::call<int>([tce](int)
00056         {
00057             tce.set();
00058         });
00059
00060         pTimer->link_target(pCallback);
00061         pTimer->start();
00062
00063         return create_task(tce).then([pCallback, pTimer]()
00064         {
00065             delete pCallback;
00066             delete pTimer;
00067         }).then(func, token);
00068     }
00069 }
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cppwinrt/Scenario7_ListAllCards.h Source File

  • SmartCard
  • cppwinrt

Scenario7_ListAllCards.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "Scenario7_ListAllCards.g.h"
00014 #include "SmartCardListItem.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario7_ListAllCards : Scenario7_ListAllCardsT<Scenario7_ListAllCards>
00019     {
00020         SDKTemplate::MainPage m_rootPage{ SDKTemplate::MainPage::Current() };
00021
00022         Scenario7_ListAllCards();
00023
00024         fire_and_forget ListSmartCard_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&);
00025     };
00026
00027     struct SmartCardListItem : SmartCardListItemT<SmartCardListItem>
00028     {
00029         SmartCardListItem(hstring const& readerName, hstring const& cardName) :
00030             m_readerName(readerName),
00031             m_cardName(cardName)
00032         {
00033         }
00034
00035         hstring ReaderName()
00036         {
00037             return m_readerName;
00038         }
00039
00040         hstring CardName()
00041         {
00042             return m_cardName;
00043         }
00044
00045     private:
00046         hstring m_readerName;
00047         hstring m_cardName;
00048     };
00049 }
00050
00051 namespace winrt::SDKTemplate::factory_implementation
00052 {
00053     struct Scenario7_ListAllCards : Scenario7_ListAllCardsT<Scenario7_ListAllCards, implementation::Scenario7_ListAllCards>
00054     {
00055     };
00056
00057     struct SmartCardListItem : SmartCardListItemT<SmartCardListItem, implementation::SmartCardListItem>
00058     {
00059     };
00060 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [protected]
_applicationResumingEventToken | sealed | [private]
_applicationSuspendingEventToken | sealed | [private]
_cameraEnclosureLocation | sealed | [private]
_captureFolder | sealed | [private]
_displayInformation | sealed | [private]
_displayInformationEventToken | sealed | [private]
_displayRequest | sealed | [private]
_externalCamera | sealed | [private]
_hardwareCameraButtonEventToken | sealed | [private]
_isActivePage | sealed | [private]
_isInitialized | sealed | [private]
_isPreviewing | sealed | [private]
_isRecording | sealed | [private]
_isSuspending | sealed | [private]
_isUIActive | sealed | [private]
_mediaCapture | sealed | [private]
_mediaCaptureFailedEventToken | sealed | [private]
_mediaControlPropChangedEventToken | sealed | [private]
_mirroringPreview | sealed | [private]
_orientationChangedEventToken | sealed | [private]
_orientationSensor | sealed | [private]
_recordLimitationExceededEventToken | sealed | [private]
_rotationHelper | sealed | [private]
_setupTask | sealed | [private]
_systemMediaControls | sealed | [private]
_windowVisibilityChangedEventToken | sealed | [private]
AddOrientations(SimpleOrientation a, SimpleOrientation b) | sealed | [private, static]
Application_Resuming(Object^sender, Object^args) | sealed | [private]
Application_Suspending(Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
CameraRotationHelper(EnclosureLocation^cameraEnclosureLocation) | sealed |
CleanupCameraAsync() | sealed | [private]
CleanupUiAsync() | sealed | [private]
ConvertClockwiseDegreesToSimpleOrientation(int orientation) | sealed | [private, static]
ConvertDisplayOrientationToSimpleOrientation(DisplayOrientations orientation) | sealed | [private]
ConvertSimpleOrientationToClockwiseDegrees(SimpleOrientation orientation) | sealed | [static]
ConvertSimpleOrientationToPhotoOrientation(SimpleOrientation orientation) | sealed | [static]
ConvertSimpleOrientationToVideoRotation(SimpleOrientation orientation) | sealed | [private, static]
DisplayInformation_OrientationChanged(DisplayInformation^sender, Object^ref) | sealed | [private]
Encoder | sealed |
File | sealed |
FindCameraDeviceByPanelAsync(Windows::Devices::Enumeration::Panel panel) | sealed | [private]
GetCameraCaptureOrientation() | sealed |
GetCameraOrientationRelativeToNativeOrientation() | sealed | [private]
GetCameraPreviewOrientation() | sealed |
GetUIOrientation() | sealed |
HardwareButtons_CameraPress(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
HardwareButtons_CameraPressed(Platform::Object^, Windows::Phone::UI::Input::CameraEventArgs^) | sealed | [private]
InitializeCameraAsync() | sealed | [private]
IsEnclosureLocationExternal(EnclosureLocation^enclosureLocation) | sealed | [static]
MainPage() | sealed |
MediaCapture_Failed(Windows::Media::Capture::MediaCapture^currentCaptureObject, Windows::Media::Capture::MediaCaptureFailedEventArgs^errorEventArgs) | sealed | [private]
MediaCapture_RecordLimitationExceeded(Windows::Media::Capture::MediaCapture^currentCaptureObject) | sealed | [private]
MirrorOrientation(SimpleOrientation orientation) | sealed | [private, static]
OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigationFailed(Platform::Object^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs^e) | sealed | [private]
OnSuspending(Platform::Object^sender, Windows::ApplicationModel::SuspendingEventArgs^e) | sealed | [private]
Orientation | sealed |
OrientationChanged | sealed |
PhotoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ReencodeAndSavePhotoAsync(Windows::Storage::Streams::IRandomAccessStream^stream, Windows::Storage::StorageFile^file, Windows::Storage::FileProperties::PhotoOrientation photoOrientation) | sealed | [private]
RegisterEventHandlers() | sealed | [private]
RotationHelper_OrientationChanged(Object^, bool) | sealed | [private]
RotationKey | sealed | [private]
SetPreviewRotationAsync() | sealed | [private]
SetUpBasedOnStateAsync() | sealed | [private]
SetupUiAsync() | sealed | [private]
ShouldMirrorPreview() | sealed | [private]
SimpleOrientationSensor_OrientationChanged(SimpleOrientationSensor^sender, SimpleOrientationSensorOrientationChangedEventArgs^args) | sealed | [private]
StartPreviewAsync() | sealed | [private]
StartRecordingAsync() | sealed | [private]
StopPreviewAsync() | sealed | [private]
StopRecordingAsync() | sealed | [private]
SubtractOrientations(SimpleOrientation a, SimpleOrientation b) | sealed | [private, static]
SystemMediaControls_PropertyChanged(Windows::Media::SystemMediaTransportControls^sender, Windows::Media::SystemMediaTransportControlsPropertyChangedEventArgs^args) | sealed | [private]
TakePhotoAsync() | sealed | [private]
UnregisterEventHandlers() | sealed | [private]
UpdateButtonOrientation() | sealed | [private]
UpdateCaptureControls() | sealed | [private]
VideoButton_Click(Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Window_VisibilityChanged(Object^sender, Windows::UI::Core::VisibilityChangedEventArgs^e) | sealed | [private]
WriteException(Platform::Exception^ex) | sealed | [private]
WriteLine(Platform::String^str) | sealed | [private]
~MainPage() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:23:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlAnimatedGif/cpp/pch.cpp Source File

  • XamlAnimatedGif
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Altimeter/cpp/pch.h Source File

  • Altimeter
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomComputeShaderRenderer Member List

This is the complete list of members for CustomComputeShaderRenderer, including all inherited members.
CreateDeviceDependentResources() | CustomComputeShaderRenderer |
CreateDeviceIndependentResources() | CustomComputeShaderRenderer |
CreateWindowSizeDependentResources() | CustomComputeShaderRenderer |
CustomComputeShaderRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | CustomComputeShaderRenderer |
LoadInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | CustomComputeShaderRenderer | [inline]
m_deviceResources | CustomComputeShaderRenderer | [private]
m_dftEffect | CustomComputeShaderRenderer | [private]
m_formatConvert | CustomComputeShaderRenderer | [private]
m_imageSize | CustomComputeShaderRenderer | [private]
m_imageSource | CustomComputeShaderRenderer | [private]
m_isWindowClosed | CustomComputeShaderRenderer | [private]
m_scale | CustomComputeShaderRenderer | [private]
m_transformedImage | CustomComputeShaderRenderer | [private]
ReleaseDeviceDependentResources() | CustomComputeShaderRenderer |
Render() | CustomComputeShaderRenderer |
SaveInternalState(_In_ Windows::Foundation::Collections::IPropertySet^state) | CustomComputeShaderRenderer | [inline]
Update() | CustomComputeShaderRenderer | [inline]
UpdateImageScale(float scale) | CustomComputeShaderRenderer | [private]
Generated on Fri Nov 15 2024 22:23:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario1.xaml.h Source File

  • SimpleInk
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1 sealed
00024     {
00025     public:
00026         Scenario1();
00027     private:
00028         void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
00029     };
00030 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/S3_RetrieveWithAPI.xaml.cpp Source File

  • ContentIndexer
  • cpp

S3_RetrieveWithAPI.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // S3_RetrieveWithAPI.xaml.cpp
00014 // Implementation of the S3_RetrieveWithAPI class
00015 //
00016
00017 #include "pch.h"
00018 #include "S3_RetrieveWithAPI.xaml.h"
00019 #include "MainPage.xaml.h"
00020 #include "Helpers.h"
00021
00022 using namespace SDKTemplate;
00023
00024 using namespace concurrency;
00025 using namespace Platform;
00026 using namespace Platform::Collections;
00027 using namespace Windows::UI::Xaml;
00028 using namespace Windows::UI::Xaml::Controls;
00029 using namespace Windows::Foundation;
00030 using namespace Windows::Foundation::Collections;
00031
00032 S3_RetrieveWithAPI::S3_RetrieveWithAPI()
00033 {
00034     InitializeComponent();
00035     InitializeRevisionNumber();
00036 }
00037
00038 void S3_RetrieveWithAPI::AddToIndex_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00039 {
00040     auto indexer = Windows::Storage::Search::ContentIndexer::GetIndexer();
00041     AddItemsToIndex(indexer);
00042 }
00043
00044 void ExecuteQueryHelper(String^ queryString)
00045 {
00046     auto indexer = Windows::Storage::Search::ContentIndexer::GetIndexer();
00047     auto propertyKeys = ref new Vector<String^>();
00048     propertyKeys->Append(Windows::Storage::SystemProperties::ItemNameDisplay);
00049     propertyKeys->Append(Windows::Storage::SystemProperties::Keywords);
00050     propertyKeys->Append(Windows::Storage::SystemProperties::Comment);
00051     auto query = indexer->CreateQuery(queryString, propertyKeys);
00052     create_task(query->GetAsync()).then([propertyKeys](IVectorView<Windows::Storage::Search::IIndexableContent^>^ documents)
00053     {
00054         String^ itemsString;
00055         for (const auto& document : documents)
00056         {
00057             itemsString += CreateItemString(document->Id, propertyKeys, document->Properties->GetView()) + L"\n";
00058         }
00059         MainPage::Current->NotifyUser(itemsString, NotifyType::StatusMessage);
00060     });
00061 }
00062
00063 // This function retrieves all items added to the index by this app via the ContentIndexer.
00064 void S3_RetrieveWithAPI::RetrieveAllItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00065 {
00066     ExecuteQueryHelper(L"*");
00067 }
00068
00069 // This function retrieves all items added to the index by this app via the ContentIndexer which contain the work "0" in
00070 // either the ItemNameDisplay, Keywords, or Comment properties.
00071 void S3_RetrieveWithAPI::RetrieveMatchingItems_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00072 {
00073     ExecuteQueryHelper(L"0");
00074 }
Generated on Fri Nov 15 2024 22:18:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cs/Scenario1_ManageHotspot.xaml.cs Source File

  • OnDemandHotspot
  • cs

Scenario1_ManageHotspot.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Diagnostics;
00014 using Windows.UI.Xaml;
00015 using Windows.UI.Xaml.Controls;
00016 using Windows.UI.Xaml.Navigation;
00017 using Windows.ApplicationModel.Background;
00018 using Windows.Foundation.Collections;
00019 using Windows.Devices.WiFi;
00020 using Windows.Security.Credentials;
00021 using Windows.Storage;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario1_ManageHotspot : Page
00026     {
00027         WiFiOnDemandHotspotNetwork m_network;
00028         MainPage rootPage = MainPage.Current;
00029
00030         public Scenario1_ManageHotspot()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         static bool IsBackgroundTaskName(string name)
00036         {
00037             return name == Constants.MetadataUpdateTaskName ||
00038                 name == Constants.DeviceWatcherTaskName ||
00039                 name == Constants.ConnectTaskName;
00040         }
00041
00042         protected override void OnNavigatedTo(NavigationEventArgs e)
00043         {
00044             m_network = WiFiOnDemandHotspotNetwork.GetOrCreateById(Constants.SampleHotspotGuid);
00045
00046             // Copy the values from the network properties into our UI.
00047             WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
00048             DisplayNameText.Text = properties.DisplayName;
00049             AvailableToggle.IsOn = properties.Availability == WiFiOnDemandHotspotAvailability.Available;
00050             WiFiOnDemandHotspotCellularBars? bars = properties.CellularBars;
00051             CellularBarsToggle.IsOn = bars.HasValue;
00052             Debug.Assert(0 == (int)WiFiOnDemandHotspotCellularBars.ZeroBars);
00053             Debug.Assert(1 == (int)WiFiOnDemandHotspotCellularBars.OneBar);
00054             Debug.Assert(2 == (int)WiFiOnDemandHotspotCellularBars.TwoBars);
00055             Debug.Assert(3 == (int)WiFiOnDemandHotspotCellularBars.ThreeBars);
00056             Debug.Assert(4 == (int)WiFiOnDemandHotspotCellularBars.FourBars);
00057             Debug.Assert(5 == (int)WiFiOnDemandHotspotCellularBars.FiveBars);
00058             CellularBarsSlider.Value = (int)(bars ?? WiFiOnDemandHotspotCellularBars.ZeroBars);
00059             uint? batteryPercent = properties.RemainingBatteryPercent;
00060             BatteryPercentageToggle.IsOn = batteryPercent.HasValue;
00061             BatteryPercentageSlider.Value = (int)(batteryPercent ?? 0);
00062             SsidText.Text = properties.Ssid;
00063             PasswordText.Password = properties.Password?.Password ?? String.Empty;
00064
00065             // Determine whether the background tasks are registered.
00066             bool isRegistered = false;
00067             foreach (var cur in BackgroundTaskRegistration.AllTasks)
00068             {
00069                 if (IsBackgroundTaskName(cur.Value.Name))
00070                 {
00071                     isRegistered = true;
00072                     break;
00073                 }
00074             }
00075
00076             VisualStateManager.GoToState(this, isRegistered ? "Registered" : "NotRegistered", false);
00077         }
00078
00079         private void RegisterTasks_Click(object sender, RoutedEventArgs e)
00080         {
00081             // Register the background task which updates the hotspot metadata when the system
00082             // shows a list of Wi-Fi networks.
00083             var updateMetadataTrigger = new WiFiOnDemandHotspotUpdateMetadataTrigger();
00084             var backgroundTaskBuilder = new BackgroundTaskBuilder();
00085             backgroundTaskBuilder.Name = Constants.MetadataUpdateTaskName;
00086             backgroundTaskBuilder.TaskEntryPoint = Constants.MetadataUpdateEntryPoint;
00087             backgroundTaskBuilder.SetTrigger(updateMetadataTrigger);
00088             BackgroundTaskRegistration updateMetadataRegistration = backgroundTaskBuilder.Register();
00089
00090             // Register the background task which turns on the on-demand hotspot when the user
00091             // selects it.
00092             var connectTrigger = new WiFiOnDemandHotspotConnectTrigger();
00093             backgroundTaskBuilder.Name = Constants.ConnectTaskName;
00094             backgroundTaskBuilder.TaskEntryPoint = Constants.ConnectEntryPoint;
00095             backgroundTaskBuilder.SetTrigger(connectTrigger);
00096             BackgroundTaskRegistration connectRegistration = backgroundTaskBuilder.Register();
00097
00098             // In practice, you will monitor when an on-demand hotspot comes into range or goes
00099             // of range so you can update the Availability. This sample does not have a physical
00100             // hotspot device, but we leave the code here as a demonstration.
00101 #if false
00102             DeviceWatcher deviceWatcher = DeviceInformation.CreateWatcher(Contoso.Devices.OnDemandHotSpot.GetDeviceSelector());
00103             var triggerEventKinds = new List<DeviceWatcherEventKind> { DeviceWatcherEventKind.Add, DeviceWatcherEventKind.Remove, DeviceWatcherEventKind.Update };
00104             DeviceWatcherTrigger watcherTrigger = deviceWatcher.GetBackgroundTrigger(triggerEventKinds);
00105             backgroundTaskBuilder.Name = Constants.DeviceWatcherTaskName;
00106             backgroundTaskBuilder.TaskEntryPoint = Constants.DeviceWatcherEntryPoint;
00107             backgroundTaskBuilder.SetTrigger(watcherTrigger);
00108             BackgroundTaskRegistration deviceWatcherRegistration = backgroundTaskBuilder.Register();
00109 #endif
00110
00111             VisualStateManager.GoToState(this, "Registered", false);
00112         }
00113
00114         private void UnregisterTasks_Click(object sender, RoutedEventArgs e)
00115         {
00116             foreach (var cur in BackgroundTaskRegistration.AllTasks)
00117             {
00118                 if (IsBackgroundTaskName(cur.Value.Name))
00119                 {
00120                     cur.Value.Unregister(true);
00121                 }
00122             }
00123
00124             VisualStateManager.GoToState(this, "NotRegistered", false);
00125         }
00126
00127         private bool SavePropertiesForBackgroundTask()
00128         {
00129             rootPage.NotifyUser("", NotifyType.StatusMessage);
00130
00131             if (AvailableToggle.IsOn && String.IsNullOrEmpty(DisplayNameText.Text))
00132             {
00133                 rootPage.NotifyUser("An Available network must have a name.", NotifyType.ErrorMessage);
00134                 return false;
00135             }
00136
00137             if (String.IsNullOrEmpty(SsidText.Text))
00138             {
00139                 rootPage.NotifyUser("You must provide an SSID for the Wi-Fi network.", NotifyType.ErrorMessage);
00140                 return false;
00141             }
00142
00143             if (String.IsNullOrEmpty(PasswordText.Password))
00144             {
00145                 rootPage.NotifyUser("You must provide a password for the Wi-Fi network.", NotifyType.ErrorMessage);
00146                 return false;
00147             }
00148
00149
00150             IPropertySet values = ApplicationData.Current.LocalSettings.Values;
00151             values["availability"] = AvailableToggle.IsOn;
00152             values["displayName"] = DisplayNameText.Text;
00153             values["bars"] = CellularBarsToggle.IsOn ? (int?)CellularBarsSlider.Value : null;
00154             values["battery"] = BatteryPercentageToggle.IsOn ? (uint?)BatteryPercentageSlider.Value : null;
00155             values["ssid"] = SsidText.Text;
00156             values["password"] = PasswordText.Password;
00157             values["hotspotGuid"] = Constants.SampleHotspotGuid;
00158
00159             return true;
00160         }
00161
00162         private void UpdateNowButton_Click(object sender, RoutedEventArgs e)
00163         {
00164             if (SavePropertiesForBackgroundTask())
00165             {
00166                 // Copy the properties from the UI into the system network properties
00167                 // to configure how the on-demand hotspot appears in the system Wi-Fi list.
00168                 WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
00169                 properties.Availability = AvailableToggle.IsOn ? WiFiOnDemandHotspotAvailability.Available : WiFiOnDemandHotspotAvailability.Unavailable;
00170                 properties.DisplayName = DisplayNameText.Text;
00171                 properties.CellularBars = CellularBarsToggle.IsOn ? (WiFiOnDemandHotspotCellularBars?)(int?)CellularBarsSlider.Value : null;
00172                 properties.RemainingBatteryPercent = BatteryPercentageToggle.IsOn ? (uint?)BatteryPercentageSlider.Value : null;
00173                 properties.Ssid = SsidText.Text;
00174                 properties.Password = new PasswordCredential { Password = PasswordText.Password };
00175                 m_network.UpdateProperties(properties);
00176             }
00177         }
00178
00179         private void UpdateOnDemandButton_Click(object sender, RoutedEventArgs e)
00180         {
00181             SavePropertiesForBackgroundTask();
00182         }
00183     }
00184 }
00185
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DateTimeFormatting/cppwinrt/SampleConfiguration.cpp Source File

  • DateTimeFormatting
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Date and time formatting C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Format date and time using long and short", xaml_typename<SDKTemplate::Scenario1_LongAndShortFormats>() },
00029     Scenario{ L"Format using a string template", xaml_typename<SDKTemplate::Scenario2_StringTemplate>() },
00030     Scenario{ L"Format using a parameterized template", xaml_typename<SDKTemplate::Scenario3_ParameterizedTemplate>() },
00031     Scenario{ L"Override the current user's settings", xaml_typename<SDKTemplate::Scenario4_Override>() },
00032     Scenario{ L"Format using Unicode extensions", xaml_typename<SDKTemplate::Scenario5_UnicodeExtensions>() },
00033     Scenario{ L"Format using different time zones", xaml_typename<SDKTemplate::Scenario6_TimeZone>() },
00034 });
00035
00036 hstring SDKTemplate::StringJoin(std::wstring const& delimiter, IVectorView<hstring> const& vector)
00037 {
00038     std::wostringstream result;
00039
00040     bool first = true;
00041     for (hstring value : vector)
00042     {
00043         if (!first)
00044         {
00045             result << delimiter;
00046         }
00047         result << std::wstring_view(value);
00048     }
00049     return hstring(result.str());
00050 }
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ReadStreamTask::ReadStreamTaskImpl Member List

This is the complete list of members for ReadStreamTask::ReadStreamTaskImpl, including all inherited members.
_CompletionEvent | ReadStreamTask::ReadStreamTaskImpl |
_Destination | ReadStreamTask::ReadStreamTaskImpl |
_Reader | ReadStreamTask::ReadStreamTaskImpl |
_StreamData | ReadStreamTask::ReadStreamTaskImpl |
ReadChunk() | ReadStreamTask::ReadStreamTaskImpl | [inline]
ReadStreamTaskImpl(IInputStream^Stream, std::vector< byte > &Destination) | ReadStreamTask::ReadStreamTaskImpl | [inline]
RunTask() | ReadStreamTask::ReadStreamTaskImpl | [inline]
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceDetection/cppwinrt/pch.cpp Source File

  • BasicFaceDetection
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_DetectInWebcam Member List

This is the complete list of members for Scenario2_DetectInWebcam, including all inherited members.
AbandonStreaming() | Scenario2_DetectInWebcam | [private]
CameraSnapshotButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_DetectInWebcam |
CameraStreamingButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario2_DetectInWebcam |
ChangeScenarioStateAsync(ScenarioState newState) | Scenario2_DetectInWebcam | [private]
currentState | Scenario2_DetectInWebcam | [private]
Idle enum value | Scenario2_DetectInWebcam | [private]
MediaCapture_CameraStreamStateChanged(Windows::Media::Capture::MediaCapture const &sender, Windows::Foundation::IInspectable const &args) | Scenario2_DetectInWebcam | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_DetectInWebcam |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_DetectInWebcam |
OnSuspending(Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e) | Scenario2_DetectInWebcam | [private]
Scenario2_DetectInWebcam() | Scenario2_DetectInWebcam |
ScenarioState enum name | Scenario2_DetectInWebcam | [private]
SetupVisualization(Windows::UI::Xaml::Media::Imaging::WriteableBitmap const &displaySource, Windows::Foundation::Collections::IVector< Windows::Media::FaceAnalysis::DetectedFace > const &foundFaces) | Scenario2_DetectInWebcam | [private]
ShutdownWebcamAsync() | Scenario2_DetectInWebcam | [private]
Snapshot enum value | Scenario2_DetectInWebcam | [private]
SnapshotCanvas_SizeChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::SizeChangedEventArgs const &e) | Scenario2_DetectInWebcam |
StartWebcamStreamingAsync() | Scenario2_DetectInWebcam | [private]
Streaming enum value | Scenario2_DetectInWebcam | [private]
suspendingEventToken | Scenario2_DetectInWebcam | [private]
TakeSnapshotAndFindFacesAsync() | Scenario2_DetectInWebcam | [private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Geotag/cs/Scenario1_Geotag.xaml.cs Source File

  • Geotag
  • cs

Scenario1_Geotag.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Devices.Geolocation;
00015 using Windows.Storage;
00016 using Windows.Storage.FileProperties;
00017 using Windows.Storage.Pickers;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario1_Geotag : Page
00024     {
00025         private MainPage rootPage = MainPage.Current;
00026         private StorageFile file = null;
00027
00028         public Scenario1_Geotag()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         private async void ChooseFileButton_Click()
00034         {
00035             var picker = new FileOpenPicker();
00036             picker.FileTypeFilter.Add(".jpg");
00037             picker.FileTypeFilter.Add(".jpeg");
00038             picker.FileTypeFilter.Add(".mp4");
00039             picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
00040             file = await picker.PickSingleFileAsync();
00041             if (file != null)
00042             {
00043                 FileDisplayName.Text = file.DisplayName;
00044                 FileOperationsPanel.Visibility = Visibility.Visible;
00045             }
00046             else
00047             {
00048                 FileOperationsPanel.Visibility = Visibility.Collapsed;
00049             }
00050         }
00051
00052         private async void GetGeotagButton_Click()
00053         {
00054             Geopoint geopoint = await GeotagHelper.GetGeotagAsync(file);
00055             if (geopoint != null)
00056             {
00057                 rootPage.NotifyUser($"Latitude = {geopoint.Position.Latitude}, Longitude = {geopoint.Position.Longitude}", NotifyType.StatusMessage);
00058             }
00059             else
00060             {
00061                 // File I/O errors are converted to "No information".
00062                 rootPage.NotifyUser("No location information available", NotifyType.ErrorMessage);
00063             }
00064         }
00065
00066         private async void SetGeotagFromGeolocatorButton_Click()
00067         {
00068             // Call RequestAccessAsync from the UI thread to get user permission on location usage.
00069             // Otherwise SetGeotagFromGeolocator will fail.
00070             GeolocationAccessStatus status = await Geolocator.RequestAccessAsync();
00071             if (status != GeolocationAccessStatus.Allowed)
00072             {
00073                 rootPage.NotifyUser("Location access is not allowed", NotifyType.ErrorMessage);
00074                 return;
00075             }
00076
00077             Geolocator geolocator = new Geolocator();
00078             geolocator.DesiredAccuracy = PositionAccuracy.High;
00079
00080             try
00081             {
00082                 await GeotagHelper.SetGeotagFromGeolocatorAsync(file, geolocator);
00083                 rootPage.NotifyUser("Geolocation set to current location", NotifyType.StatusMessage);
00084             }
00085             catch (Exception ex)
00086             {
00087                 // File I/O errors are reported as exceptions.
00088                 // AccessDeniedExcetion can be raised if the user revoked location access
00089                 // after RequestAccessAsync completed.
00090                 rootPage.NotifyUser("Exception: " + ex.Message, NotifyType.ErrorMessage);
00091             }
00092         }
00093
00094         private async void SetGeotagButton_Click()
00095         {
00096             // Set the approximate position of the observation deck of the Seattle Space Needle.
00097             BasicGeoposition position = new BasicGeoposition();
00098             position.Latitude = 47.620491;
00099             position.Longitude = -122.349319;
00100             position.Altitude = 158.12;
00101             Geopoint geopoint = new Geopoint(position);
00102
00103             try
00104             {
00105                 await GeotagHelper.SetGeotagAsync(file, geopoint);
00106                 rootPage.NotifyUser("Geolocation set to Seattle Space Needle", NotifyType.StatusMessage);
00107             }
00108             catch (Exception ex)
00109             {
00110                 // File I/O errors are reported as exceptions
00111                 rootPage.NotifyUser("Exception: " + ex.Message, NotifyType.ErrorMessage);
00112             }
00113         }
00114     }
00115 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario2_OvenClientWRL.xaml.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario2_OvenClientWRL.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario2_OvenClientWRL.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKSample;
00013 using namespace SDKSample::ProxyStubsForWinRTComponents;
00014
00015 using namespace Microsoft::SDKSamples::Kitchen;
00016
00017 using namespace Windows::UI::Xaml;
00018 using namespace Windows::UI::Xaml::Controls;
00019
00020 OvenClientWRL::OvenClientWRL()
00021 {
00022     InitializeComponent();
00023 }
00024
00025 void SDKSample::ProxyStubsForWinRTComponents::OvenClientWRL::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00026 {
00027     Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> spMyOven;
00028     Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::__IOvenFactory> spMyOvenFactory;
00029
00030     // Component Creation: Get the activation factory
00031     HRESULT hr = Windows::Foundation::GetActivationFactory(Microsoft::WRL::Wrappers::HStringReference(RuntimeClass_Microsoft_SDKSamples_Kitchen_Oven).Get(), &spMyOvenFactory);
00032     if (SUCCEEDED(hr))
00033     {
00034         ABI::Microsoft::SDKSamples::Kitchen::Dimensions dimensions;
00035         dimensions.Width = 2;
00036         dimensions.Height = 2;
00037         dimensions.Depth = 2;
00038
00039         // Component Creation: Call the factory method to produce an oven object
00040         hr = spMyOvenFactory->CreateOven(dimensions, &spMyOven);
00041     }
00042     if (SUCCEEDED(hr))
00043     {
00044         Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> spMyAppliance;
00045         hr = spMyOven.As(&spMyAppliance);
00046         if (SUCCEEDED(hr))
00047         {
00048             // Getters and setters are accessed using the get_ or put_ methods
00049             double volume;
00050             hr = spMyAppliance->get_Volume(&volume);
00051             if (SUCCEEDED(hr))
00052             {
00053                 // To append to the output text a C++\CX call is made. This call can throw an exception.
00054                 // Catch any Windows Rutnime exceptions and turn them back into HRESULTS
00055                 try
00056                 {
00057                     OvenClientWRLOutput->Text += "Oven volume is: " + volume.ToString() + "\n";
00058                 }
00059                 catch (Platform::COMException^ e)
00060                 {
00061                     hr = e->HResult;
00062                 }
00063             }
00064         }
00065
00066         // Declare handlers for event callbacks
00067         auto spHandler1 = Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler<
00068             ABI::Microsoft::SDKSamples::Kitchen::Oven*,
00069             ABI::Microsoft::SDKSamples::Kitchen::Bread*>>(
00070             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven *pOven, ABI::Microsoft::SDKSamples::Kitchen::IBread *pBread)->HRESULT
00071         {
00072             HRESULT hr = S_OK;
00073             Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IOven> spOven(pOven);
00074             Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IBread> spBread(pBread);
00075             Microsoft::WRL::ComPtr<ABI::Microsoft::SDKSamples::Kitchen::IAppliance> spAppliance;
00076
00077             try
00078             {
00079                 // To append to the output text a C++\CX call is made. Catch any Windows Rutnime exceptions and turn them into HRESULTS.
00080                 OvenClientWRLOutput->Text += "Event Handler 1: Invoked\n";
00081             }
00082             catch (Platform::COMException^ e)
00083             {
00084                 hr = e->HResult;
00085             }
00086
00087             if (SUCCEEDED(hr))
00088             {
00089                 hr = spOven.As(&spAppliance);
00090             }
00091             if (SUCCEEDED(hr))
00092             {
00093                 double volume;
00094                 hr = spAppliance->get_Volume(&volume);
00095                 if (SUCCEEDED(hr))
00096                 {
00097                     try
00098                     {
00099                         // To append to the output text a C++\CX call is made. Catch any Windows Rutnime exceptions and turn them into HRESULTS.
00100                         OvenClientWRLOutput->Text += "Event Handler 1: Oven volume is: " + volume.ToString() + "\n";
00101                     }
00102                     catch (Platform::COMException^ e)
00103                     {
00104                         hr = e->HResult;
00105                     }
00106                 }
00107             }
00108             HSTRING hstrBreadFlavor;
00109             hr = spBread->get_Flavor(&hstrBreadFlavor);
00110             if (SUCCEEDED(hr))
00111             {
00112                 try
00113                 {
00114                     // To append to the output text a C++\CX call is made. Catch any Windows Rutnime exceptions and turn them into HRESULTS.
00115                     OvenClientWRLOutput->Text += "Event Handler 1: Bread flavor is: " + ref new Platform::String(hstrBreadFlavor) + "\n";
00116                 }
00117                 catch (Platform::COMException^ e)
00118                 {
00119                     hr = e->HResult;
00120                 }
00121             }
00122             return hr;
00123         });
00124
00125         auto spHandler2 = Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler<
00126             ABI::Microsoft::SDKSamples::Kitchen::Oven*,
00127             ABI::Microsoft::SDKSamples::Kitchen::Bread*>>(
00128             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven *pCurOven, ABI::Microsoft::SDKSamples::Kitchen::IBread *pCurBread)->HRESULT
00129         {
00130             HRESULT hr = S_OK;
00131             try
00132             {
00133                 // To append to the output text a C++\CX call is made. Catch any Windows Rutnime exceptions and turn them into HRESULTS.
00134                 OvenClientWRLOutput->Text += "Event Handler 2: Invoked\n";
00135             }
00136             catch (Platform::COMException^ e)
00137             {
00138                 hr = e->HResult;
00139             }
00140             return hr;
00141         });
00142
00143         auto spHandler3 = Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler<
00144             ABI::Microsoft::SDKSamples::Kitchen::Oven*,
00145             ABI::Microsoft::SDKSamples::Kitchen::Bread*>>(
00146             [this](ABI::Microsoft::SDKSamples::Kitchen::IOven *pCurOven, ABI::Microsoft::SDKSamples::Kitchen::IBread *pCurBread)->HRESULT
00147         {
00148             // Event handler 3 was removed and will not be invoked
00149             HRESULT hr = S_OK;
00150             try
00151             {
00152                 // To append to the output text a C++\CX call is made. Catch any Windows Rutnime exceptions and turn them into HRESULTS.
00153                 OvenClientWRLOutput->Text += "Event Handler 3: Invoked\n";
00154             }
00155             catch (Platform::COMException^ e)
00156             {
00157                 hr = e->HResult;
00158             }
00159             return hr;
00160         });
00161
00162         // Registering event listeners
00163         ::EventRegistrationToken regBread1;
00164         ::EventRegistrationToken regBread2;
00165         ::EventRegistrationToken regBread3;
00166         if (SUCCEEDED(hr))
00167         {
00168             hr = spMyOven->add_BreadBaked(spHandler1.Get(), &regBread1);
00169         }
00170         if (SUCCEEDED(hr))
00171         {
00172             hr = spMyOven->add_BreadBaked(spHandler2.Get(), &regBread2);
00173         }
00174         if (SUCCEEDED(hr))
00175         {
00176             hr = spMyOven->add_BreadBaked(spHandler3.Get(), &regBread3);
00177         }
00178
00179         // Unregister from an event using the registration token
00180         if (SUCCEEDED(hr))
00181         {
00182             hr = spMyOven->remove_BreadBaked(regBread3);
00183         }
00184
00185         // Bake a loaf of bread. This will trigger the BreadBaked event.
00186         if (SUCCEEDED(hr))
00187         {
00188             hr = spMyOven->BakeBread(Microsoft::WRL::Wrappers::HStringReference(L"Sourdough").Get());
00189         }
00190
00191         // Trigger the event again with a different preheat time
00192         if (SUCCEEDED(hr))
00193         {
00194             hr = spMyOven->ConfigurePreheatTemperature(ABI::Microsoft::SDKSamples::Kitchen::OvenTemperature_High);
00195         }
00196         if (SUCCEEDED(hr))
00197         {
00198             hr = spMyOven->BakeBread(Microsoft::WRL::Wrappers::HStringReference(L"Wheat").Get());
00199         }
00200     }
00201 }
00202
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileLoggingSessionScenario Member List

This is the complete list of members for FileLoggingSessionScenario, including all inherited members.
channel | FileLoggingSessionScenario | [private]
channelLoggingLevel | FileLoggingSessionScenario | [private]
CheckDisposed() | FileLoggingSessionScenario | [inline, private]
CloseSessionSaveFinalLogFile() | FileLoggingSessionScenario | [inline, private]
DEFAULT_CHANNEL_NAME | FileLoggingSessionScenario |
DEFAULT_SESSION_NAME | FileLoggingSessionScenario |
Dispose() | FileLoggingSessionScenario | [inline]
Dispose(bool disposing) | FileLoggingSessionScenario | [inline, protected, virtual]
DoScenarioAsync() | FileLoggingSessionScenario | [inline]
FileLoggingSessionScenario() | FileLoggingSessionScenario | [inline, private]
GetTimeStamp() | FileLoggingSessionScenario | [inline, private]
Instance | FileLoggingSessionScenario | [static]
IsBusy | FileLoggingSessionScenario |
isBusy | FileLoggingSessionScenario | [private]
isChannelEnabled | FileLoggingSessionScenario | [private]
isDisposed | FileLoggingSessionScenario | [private]
IsLoggingEnabled | FileLoggingSessionScenario |
IsPreparingForSuspend | FileLoggingSessionScenario |
LOGFILEGEN_BEFORE_SUSPEND_SETTING_KEY_NAME | FileLoggingSessionScenario | [private]
LogFileGeneratedCount | FileLoggingSessionScenario |
LogFileGeneratedHandler(IFileLoggingSession sender, LogFileGeneratedEventArgs args) | FileLoggingSessionScenario | [inline, private]
LOGGING_ENABLED_SETTING_KEY_NAME | FileLoggingSessionScenario | [private]
loggingScenario | FileLoggingSessionScenario | [private, static]
OnAppResuming(object sender, object e) | FileLoggingSessionScenario | [inline, private]
OnAppSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) | FileLoggingSessionScenario | [inline, private]
OnChannelLoggingEnabled(ILoggingChannel sender, object args) | FileLoggingSessionScenario | [inline, private]
OUR_SAMPLE_APP_LOG_FILE_FOLDER_NAME | FileLoggingSessionScenario |
Prefix | FileLoggingSessionScenario | [private]
PrepareToSuspendAsync() | FileLoggingSessionScenario | [inline]
ResumeLoggingIfApplicable() | FileLoggingSessionScenario | [inline]
session | FileLoggingSessionScenario | [private]
StartLogging() | FileLoggingSessionScenario | [inline]
StatusChanged | FileLoggingSessionScenario |
ToggleLoggingEnabledDisabledAsync() | FileLoggingSessionScenario | [inline]
~FileLoggingSessionScenario() | FileLoggingSessionScenario | [inline, private]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MapControl/cpp/Scenario10.xaml.cpp Source File

  • MapControl
  • cpp

Scenario10.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario10.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Devices::Geolocation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Maps;
00025
00026 Scenario10::Scenario10()
00027 {
00028     InitializeComponent();
00029 }
00030
00031 void Scenario10::MyMap_Loaded(Object^ sender, RoutedEventArgs^ e)
00032 {
00033     myMap->Center = MainPage::SeattleGeopoint;
00034     myMap->ZoomLevel = 16;
00035     CreateLayers();
00036 }
00037
00038 void Scenario10::CreateLayers()
00039 {
00040     // Populate multiple layers containing points and connect up the click to events.
00041     AddLayer1();
00042     AddLayer2();
00043
00044     // Style the layers so that layer 1 is selected and layer 2 is deselected.
00045     SelectLayer(this->myLayer1);
00046
00047     // Connect the layers to the map.
00048     myMap->Layers = this->MapLayers;
00049 }
00050
00051 void Scenario10::AddLayer1()
00052 {
00053     this->myLayer1 = ref new MapElementsLayer();
00054     this->myLayer1->MapElements = MainPage::CreateCityBuildingsCollection();
00055
00056     this->myLayer1->MapElementClick += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerClickEventArgs^>(this, &Scenario10::OnLayerMapElementClicked);
00057
00058     this->MapLayers->Append(this->myLayer1);
00059 }
00060
00061 void Scenario10::AddLayer2()
00062 {
00063     this->myLayer2 = ref new MapElementsLayer();
00064     this->myLayer2->MapElements = MainPage::CreateCityParksCollection();
00065
00066     this->myLayer2->MapElementClick += ref new TypedEventHandler<MapElementsLayer^, MapElementsLayerClickEventArgs^>(this, &Scenario10::OnLayerMapElementClicked);
00067
00068     this->MapLayers->Append(this->myLayer2);
00069 }
00070
00071 void Scenario10::mapElementsLayer1Button_Click(Object^ sender, RoutedEventArgs^ e)
00072 {
00073     SelectLayer(this->myLayer1);
00074 }
00075
00076 void Scenario10::mapElementsLayer2Button_Click(Object^ sender, RoutedEventArgs^ e)
00077 {
00078     SelectLayer(this->myLayer2);
00079 }
00080
00081 void Scenario10::OnLayerMapElementClicked(MapElementsLayer^ sender, MapElementsLayerClickEventArgs^ args)
00082 {
00083     SelectLayer(sender);
00084 }
00085
00086 void Scenario10::SelectLayer(MapElementsLayer^ selectedLayer)
00087 {
00088     // Ignore layer changes if no layers have been created.
00089     if (selectedLayer == nullptr) return;
00090
00091     // The other layer becomes deselected.
00092     MapElementsLayer^ deselectedLayer = (selectedLayer == this->myLayer1) ? this->myLayer2 : this->myLayer1;
00093
00094     // The deselected layer goes to z-index 0, and its elements appear disabled.
00095     deselectedLayer->ZIndex = 0;
00096     for (MapElement^ element : deselectedLayer->MapElements)
00097     {
00098         element->MapStyleSheetEntryState = MapStyleSheetEntryStates::Disabled;
00099     }
00100
00101     // The selected layer goes to z-index 1, and its elements appear normal.
00102     selectedLayer->ZIndex = 1;
00103     for (MapElement^ element : selectedLayer->MapElements)
00104     {
00105         element->MapStyleSheetEntryState = "";
00106     }
00107 }
Generated on Fri Nov 15 2024 22:17:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteTextLayoutCloudFont/cpp/DWriteTextLayoutCloudFont/Scenario_SampleOverview.xaml.cpp Source File

  • DWriteTextLayoutCloudFont
  • cpp
  • DWriteTextLayoutCloudFont

Scenario_SampleOverview.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario_SampleOverview.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028
00029 Scenario_SampleOverview::Scenario_SampleOverview()
00030 {
00031     InitializeComponent();
00032 }
Generated on Fri Nov 15 2024 22:19:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario4.xaml.h Source File

  • DatagramSocket
  • cpp

Scenario4.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario4.xaml.h
00014 // Declaration of the Scenario4 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario4.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace DatagramSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario4 sealed
00032         {
00033         public:
00034             Scenario4();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             MainPage^ rootPage;
00040             void CloseSockets_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00041         };
00042     }
00043 }
Generated on Fri Nov 15 2024 22:18:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cpp/Scenario1_Advertiser.xaml.cpp Source File

  • WiFiDirect
  • cpp

Scenario1_Advertiser.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Advertiser.xaml.h"
00013
00014 using namespace SDKTemplate;
00015 using namespace Platform;
00016 using namespace Windows::Foundation;
00017 using namespace Windows::Foundation::Collections;
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::UI::Xaml::Controls;
00020 using namespace Windows::UI::Xaml::Controls::Primitives;
00021 using namespace Windows::UI::Xaml::Data;
00022 using namespace Windows::UI::Xaml::Input;
00023 using namespace Windows::UI::Xaml::Media;
00024 using namespace Windows::UI::Xaml::Navigation;
00025 using namespace Windows::Devices::WiFiDirect;
00026 using namespace Windows::Storage::Streams;
00027 using namespace Windows::UI::Popups;
00028 using namespace Windows::Networking::Sockets;
00029 using namespace Platform::Collections;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 Scenario1_Advertiser::Scenario1_Advertiser() : rootPage(MainPage::Current)
00034 {
00035     InitializeComponent();
00036
00037     _connectedDevices = ref new Vector<ConnectedDevice^>();
00038     lvConnectedDevices->ItemsSource = _connectedDevices;
00039     lvConnectedDevices->SelectionMode = ListViewSelectionMode::Single;
00040 }
00041
00042 void SDKTemplate::Scenario1_Advertiser::btnStartAdvertisement_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00043 {
00044     try
00045     {
00046         if (!_publisher)
00047         {
00048             _publisher = ref new WiFiDirectAdvertisementPublisher();
00049         }
00050
00051         if (chkListener->IsChecked)
00052         {
00053             if (!_listener)
00054             {
00055                 _listener = ref new WiFiDirectConnectionListener();
00056             }
00057
00058             _connectionRequestedToken = _listener->ConnectionRequested += ref new TypedEventHandler<WiFiDirectConnectionListener^,
00059                 WiFiDirectConnectionRequestedEventArgs^>(this, &Scenario1_Advertiser::OnConnectionRequested, CallbackContext::Same);
00060         }
00061
00062         _publisher->Advertisement->IsAutonomousGroupOwnerEnabled = (chkPreferGroupOwnerMode->IsChecked->Value == true);
00063
00064         if (cmbListenState->SelectionBoxItem->ToString()->Equals("Normal"))
00065         {
00066             _publisher->Advertisement->ListenStateDiscoverability = WiFiDirectAdvertisementListenStateDiscoverability::Normal;
00067         }
00068         else if (cmbListenState->SelectionBoxItem->ToString()->Equals("Intensive"))
00069         {
00070             _publisher->Advertisement->ListenStateDiscoverability = WiFiDirectAdvertisementListenStateDiscoverability::Intensive;
00071         }
00072         else if (cmbListenState->SelectionBoxItem->ToString()->Equals("None"))
00073         {
00074             _publisher->Advertisement->ListenStateDiscoverability = WiFiDirectAdvertisementListenStateDiscoverability::None;
00075         }
00076
00077         _statusChangedToken = _publisher->StatusChanged += ref new TypedEventHandler<WiFiDirectAdvertisementPublisher^,
00078             WiFiDirectAdvertisementPublisherStatusChangedEventArgs^>(this, &Scenario1_Advertiser::OnStatusChanged, CallbackContext::Same);
00079
00080         _publisher->Start();
00081
00082         rootPage->NotifyUser("Advertisement started, waiting for StatusChanged callback...", NotifyType::StatusMessage);
00083     }
00084     catch (Exception^ ex)
00085     {
00086         rootPage->NotifyUser("Error starting Advertisement: " + ex->ToString(), NotifyType::ErrorMessage);
00087     }
00088 }
00089
00090 void SDKTemplate::Scenario1_Advertiser::btnAddIe_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00091 {
00092     if (!_publisher)
00093     {
00094         _publisher = ref new WiFiDirectAdvertisementPublisher();
00095     }
00096
00097     if (txtInformationElement->Text == "")
00098     {
00099         rootPage->NotifyUser("Please specifiy an IE", NotifyType::ErrorMessage);
00100         return;
00101     }
00102
00103     WiFiDirectInformationElement^ IE = ref new WiFiDirectInformationElement();
00104
00105     // IE blob
00106     DataWriter^ dataWriter = ref new DataWriter();
00107     dataWriter->UnicodeEncoding = UnicodeEncoding::Utf8;
00108     dataWriter->ByteOrder = ByteOrder::LittleEndian;
00109     dataWriter->WriteUInt32(dataWriter->MeasureString(txtInformationElement->Text));
00110     dataWriter->WriteString(txtInformationElement->Text);
00111     IE->Value = dataWriter->DetachBuffer();
00112
00113     // OUI
00114     DataWriter^ dataWriterOUI = ref new DataWriter();
00115     dataWriterOUI->WriteBytes(CustomOui);
00116     IE->Oui = dataWriterOUI->DetachBuffer();
00117
00118     // OUI Type
00119     IE->OuiType = CustomOuiType;
00120
00121     _publisher->Advertisement->InformationElements->Append(IE);
00122     txtInformationElement->Text = "";
00123
00124     rootPage->NotifyUser("IE added successfully", NotifyType::StatusMessage);
00125 }
00126
00127 void SDKTemplate::Scenario1_Advertiser::btnStopAdvertisement_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00128 {
00129     try
00130     {
00131         if (_publisher)
00132         {
00133             _publisher->Stop();
00134             _publisher->StatusChanged -= _statusChangedToken;
00135             rootPage->NotifyUser("Advertisement stopped successfully", NotifyType::StatusMessage);
00136         }
00137
00138         if (_listener)
00139         {
00140             _listener->ConnectionRequested -= _connectionRequestedToken;
00141         }
00142     }
00143     catch (Exception^ ex)
00144     {
00145         rootPage->NotifyUser("Error stopping Advertisement: " + ex->ToString(), NotifyType::ErrorMessage);
00146     }
00147 }
00148
00149 void SDKTemplate::Scenario1_Advertiser::OnConnectionRequested(WiFiDirectConnectionListener^ sender, WiFiDirectConnectionRequestedEventArgs^ connectionEventArgs)
00150 {
00151     try
00152     {
00153         WiFiDirectConnectionRequest^ connectionRequest = connectionEventArgs->GetConnectionRequest();
00154
00155         auto messageDialog = ref new MessageDialog("Connection request received from " + connectionRequest->DeviceInformation->Name, "Connection Request");
00156
00157         messageDialog->Commands->Append(ref new UICommand(
00158             "Accept",
00159             ref new UICommandInvokedHandler([this](Windows::UI::Popups::IUICommand^ command)
00160         {
00161         })));
00162
00163         messageDialog->Commands->Append(ref new UICommand(
00164             "Decline",
00165             ref new UICommandInvokedHandler([](Windows::UI::Popups::IUICommand^ command)
00166         {
00167         })));
00168
00169         messageDialog->DefaultCommandIndex = 1;
00170         messageDialog->CancelCommandIndex = 1;
00171
00172         concurrency::task<IUICommand^> promptTask(messageDialog->ShowAsync());
00173         promptTask.then([this, connectionRequest](concurrency::task<IUICommand^> resultTask)
00174         {
00175             IUICommand^ command = resultTask.get();
00176             if (command->Label == "Accept")
00177             {
00178                 rootPage->NotifyUser("Connecting to " + connectionRequest->DeviceInformation->Name + "...", NotifyType::StatusMessage);
00179
00180                 WiFiDirectConnectionParameters^ connectionParams = ref new WiFiDirectConnectionParameters();
00181                 connectionParams->GroupOwnerIntent = (short)(wcstoul(txtGOIntent->Text->Data(), nullptr, 10));
00182
00183                 try
00184                 {
00185                     concurrency::task<WiFiDirectDevice^> fromIdTask(WiFiDirectDevice::FromIdAsync(connectionRequest->DeviceInformation->Id, connectionParams));
00186                     fromIdTask.then([this](concurrency::task<WiFiDirectDevice^> fromIdResultTask)
00187                     {
00188                         WiFiDirectDevice^ wfdDevice = fromIdResultTask.get();
00189
00190                         // Register for the ConnectionStatusChanged event handler
00191                         wfdDevice->ConnectionStatusChanged += ref new TypedEventHandler<WiFiDirectDevice^, Platform::Object^>(this, &Scenario1_Advertiser::OnConnectionStatusChanged, CallbackContext::Same);
00192
00193                         ConnectedDevice^ connectedDevice = ref new ConnectedDevice("Waiting for client to connect...", wfdDevice, nullptr);
00194                         _connectedDevices->Append(connectedDevice);
00195
00196                         auto endpointPairs = wfdDevice->GetConnectionEndpointPairs();
00197
00198                         _listenerSocket = nullptr;
00199                         _listenerSocket = ref new StreamSocketListener();
00200                         _listenerSocket->ConnectionReceived += ref new TypedEventHandler<StreamSocketListener^, StreamSocketListenerConnectionReceivedEventArgs^>
00201                             (this, &Scenario1_Advertiser::OnSocketConnectionReceived, CallbackContext::Same);
00202
00203                         concurrency::task<void> listenerTask(_listenerSocket->BindEndpointAsync(endpointPairs->GetAt(0)->LocalHostName, strServerPort));
00204                         listenerTask.then([this, endpointPairs](concurrency::task<void>)
00205                         {
00206                             rootPage->NotifyUserFromBackground("Devices connected on L2, listening on IP Address: " +
00207                                                                 endpointPairs->GetAt(0)->LocalHostName->ToString() +
00208                                                                 " Port: " + strServerPort, NotifyType::StatusMessage);
00209                         });
00210                     });
00211                 }
00212                 catch (Exception^ ex)
00213                 {
00214                     rootPage->NotifyUserFromBackground("Connect operation threw an exception: " + ex->Message, NotifyType::ErrorMessage);
00215                 }
00216             }
00217             else
00218             {
00219                 // Decline the connection request
00220                 rootPage->NotifyUserFromBackground("Connection request from " + connectionRequest->DeviceInformation->Name + " was declined", NotifyType::ErrorMessage);
00221
00222                 delete connectionRequest;
00223             }
00224         });
00225     }
00226     catch (Exception^ ex)
00227     {
00228         rootPage->NotifyUserFromBackground("Connect operation threw an exception: " + ex->Message, NotifyType::ErrorMessage);
00229     }
00230 }
00231
00232 void SDKTemplate::Scenario1_Advertiser::OnStatusChanged(WiFiDirectAdvertisementPublisher^ sender, WiFiDirectAdvertisementPublisherStatusChangedEventArgs^ statusEventArgs)
00233 {
00234     rootPage->NotifyUserFromBackground("Advertisement: Status: " + statusEventArgs->Status.ToString() + " Error: " + statusEventArgs->Error.ToString(), NotifyType::StatusMessage);
00235     return;
00236 }
00237
00238 void SDKTemplate::Scenario1_Advertiser::OnSocketConnectionReceived(StreamSocketListener^ sender, StreamSocketListenerConnectionReceivedEventArgs^ connectionReceivedEventArgs)
00239 {
00240     rootPage->NotifyUserFromBackground("Connecting to remote side on L4 layer...", NotifyType::StatusMessage);
00241     StreamSocket^ serverSocket = connectionReceivedEventArgs->Socket;
00242
00243     try
00244     {
00245         SocketReaderWriter^ socketRW = ref new SocketReaderWriter(serverSocket, rootPage);
00246         socketRW->ReadMessage();
00247
00248         while (true)
00249         {
00250             String^ sessionId = socketRW->GetCurrentMessage();
00251             if (sessionId)
00252             {
00253                 rootPage->NotifyUserFromBackground("Connected with remote side on L4 layer", NotifyType::StatusMessage);
00254
00255                 for (UINT idx = 0; idx < _connectedDevices->Size; idx++)
00256                 {
00257                     ConnectedDevice^ connectedDevice = _connectedDevices->GetAt(idx);
00258                     if (connectedDevice->DisplayName->Equals("Waiting for client to connect..."))
00259                     {
00260                         _connectedDevices->RemoveAt(idx);
00261
00262                         _connectedDevices->SetAt(idx, ref new ConnectedDevice(sessionId, connectedDevice->WfdDevice, connectedDevice->SocketRW));
00263                         _connectedDevices->Append(connectedDevice);
00264                         break;
00265                     }
00266                 }
00267                 break;
00268             }
00269
00270             Sleep(100);
00271         }
00272     }
00273     catch (Exception^ ex)
00274     {
00275         rootPage->NotifyUser("Connection failed: " + ex->Message, NotifyType::ErrorMessage);
00276     }
00277 }
00278
00279
00280 void SDKTemplate::Scenario1_Advertiser::OnConnectionStatusChanged(WiFiDirectDevice^ sender, Object^ arg)
00281 {
00282     rootPage->NotifyUserFromBackground("Connection status changed: " + sender->ConnectionStatus.ToString(), NotifyType::StatusMessage);
00283 }
00284
00285 void SDKTemplate::Scenario1_Advertiser::btnSendMessage_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00286 {
00287     if (lvConnectedDevices->SelectedItems->Size == 0)
00288     {
00289         rootPage->NotifyUser("Please select a Session to send data", NotifyType::ErrorMessage);
00290         return;
00291     }
00292
00293     if (txtSendMessage->Text == "")
00294     {
00295         rootPage->NotifyUser("Please type a message to send", NotifyType::ErrorMessage);
00296         return;
00297     }
00298
00299     try
00300     {
00301         for (UINT idx = 0; idx < lvConnectedDevices->SelectedItems->Size; idx++)
00302         {
00303             ConnectedDevice^ connectedDevice = (ConnectedDevice^)(lvConnectedDevices->SelectedItems->GetAt(idx));
00304
00305             connectedDevice->SocketRW->WriteMessage(txtSendMessage->Text);
00306         }
00307     }
00308     catch (Exception^ ex)
00309     {
00310         rootPage->NotifyUser("Send threw an exception: " + ex->Message, NotifyType::ErrorMessage);
00311     }
00312
00313 }
00314
00315 void SDKTemplate::Scenario1_Advertiser::btnClose_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00316 {
00317     if (lvConnectedDevices->SelectedItems->Size == 0)
00318     {
00319         rootPage->NotifyUser("Please select a device to close", NotifyType::ErrorMessage);
00320         return;
00321     }
00322
00323     try
00324     {
00325         for (UINT idx = 0; idx < lvConnectedDevices->SelectedItems->Size; idx++)
00326         {
00327             ConnectedDevice^ connectedDevice = (ConnectedDevice^)(lvConnectedDevices->SelectedItems->GetAt(idx));
00328
00329             // Close socket
00330             connectedDevice->SocketRW->Close();
00331
00332             // Close WiFiDirectDevice object
00333             delete connectedDevice->WfdDevice;
00334
00335             UINT index = 0;
00336             if (_connectedDevices->IndexOf(connectedDevice, &index))
00337             {
00338                 _connectedDevices->RemoveAt(index);
00339             }
00340
00341             rootPage->NotifyUser(connectedDevice->DisplayName + " closed successfully", NotifyType::StatusMessage);
00342         }
00343     }
00344     catch (Exception^ ex)
00345     {
00346         rootPage->NotifyUser("Close threw an exception: " + ex->Message, NotifyType::ErrorMessage);
00347     }
00348 }
Generated on Fri Nov 15 2024 22:22:03 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceHelpers Member List

This is the complete list of members for DeviceHelpers, including all inherited members.
GetFirstBarcodeScannerAsync(PosConnectionTypes connectionTypes=PosConnectionTypes.All) | DeviceHelpers | [inline, static]
GetFirstCashDrawerAsync(PosConnectionTypes connectionTypes=PosConnectionTypes.All) | DeviceHelpers | [inline, static]
GetFirstMagneticStripeReaderAsync(PosConnectionTypes connectionTypes=PosConnectionTypes.All) | DeviceHelpers | [inline, static]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: GlobalizationPreferences/cpp/Scenario4_Input.xaml.cpp Source File

  • GlobalizationPreferences
  • cpp

Scenario4_Input.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario4_Input.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Platform::Collections;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::Globalization;
00021
00022 Scenario4_Input::Scenario4_Input()
00023 {
00024     InitializeComponent();
00025 }
00026
00027 void Scenario4_Input::ShowResults_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00028 {
00029     // This scenario uses the Windows.Globalization.Language class to obtain the user's current
00030     // input language.  The language tag returned reflects the current input language specified
00031     // by the user.
00032     String^ userInputLanguage = Windows::Globalization::Language::CurrentInputMethodLanguageTag;
00033
00034     // Display the results
00035     OutputTextBlock->Text = "User's current input language: " + userInputLanguage;
00036 }
Generated on Fri Nov 15 2024 22:19:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_DataEvents Member List

This is the complete list of members for Scenario1_DataEvents, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario1_DataEvents | [inline, protected]
OnProximitySensorAdded(DeviceWatcher sender, DeviceInformation device) | Scenario1_DataEvents | [inline, private]
ReadingChanged(ProximitySensor sender, ProximitySensorReadingChangedEventArgs e) | Scenario1_DataEvents | [inline, private]
rootPage | Scenario1_DataEvents | [private]
Scenario1_DataEvents() | Scenario1_DataEvents | [inline]
ScenarioDisable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
ScenarioEnable(object sender, RoutedEventArgs e) | Scenario1_DataEvents | [inline, private]
sensor | Scenario1_DataEvents | [private]
watcher | Scenario1_DataEvents | [private]
Generated on Fri Nov 15 2024 22:23:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Configure Member List

This is the complete list of members for Scenario1_Configure, including all inherited members.
OpenAppSettings(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Configure
OpenLockscreenSettings(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario1_Configure
Scenario1_Configure() | Scenario1_Configure
Generated on Fri Nov 15 2024 22:24:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BarcodeScanner/cppwinrt/Scenario3_ActiveSymbologies.h Source File

  • BarcodeScanner
  • cppwinrt

Scenario3_ActiveSymbologies.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_ActiveSymbologies.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario3_ActiveSymbologies : Scenario3_ActiveSymbologiesT<Scenario3_ActiveSymbologies>
00019     {
00020         Scenario3_ActiveSymbologies();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024
00025         fire_and_forget ScenarioStartScanButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00026         fire_and_forget SetActiveSymbologies_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027         void ScenarioEndScanButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00028
00029     private:
00030         SDKTemplate::MainPage m_rootPage{ MainPage::Current() };
00031         Windows::Devices::PointOfService::BarcodeScanner m_scanner{ nullptr };
00032         Windows::Devices::PointOfService::ClaimedBarcodeScanner m_claimedScanner{ nullptr };
00033
00034         Windows::Foundation::Collections::IObservableVector<SymbologyListEntry> m_listOfSymbologies{ nullptr };
00035
00036         event_token m_scannerReleaseRequestedToken;
00037         event_token m_scannerDataReceivedToken;
00038
00039         void claimedScanner_ReleaseDeviceRequested(Windows::Foundation::IInspectable const&, Windows::Devices::PointOfService::ClaimedBarcodeScanner const& e);
00040         fire_and_forget claimedScanner_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const&, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args);
00041
00042         void ResetTheScenarioState();
00043     };
00044 }
00045
00046 namespace winrt::SDKTemplate::factory_implementation
00047 {
00048     struct Scenario3_ActiveSymbologies : Scenario3_ActiveSymbologiesT<Scenario3_ActiveSymbologies, implementation::Scenario3_ActiveSymbologies>
00049     {
00050     };
00051 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cpp/Scenario1_Basic.xaml.cpp Source File

  • XamlBottomUpList
  • cpp

Scenario1_Basic.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario1_Basic.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Concurrency;
00017 using namespace Platform;
00018 using namespace Windows::Foundation;
00019 using namespace Windows::Foundation::Collections;
00020 using namespace Windows::UI::Core;
00021 using namespace Windows::UI::ViewManagement;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Input;
00025
00026 Scenario1_Basic::Scenario1_Basic()
00027 {
00028     InitializeComponent();
00029
00030     // Start with one message, so the screen doesn't look empty.
00031     AddItemToEnd();
00032 }
00033
00034 void Scenario1_Basic::AddItemToEnd()
00035 {
00036     BottomUpList->Items->Append(Helpers::GetCurrentDateTimeAsString() + ": Message " + (++messageNumber).ToString());
00037 }
00038
00039 void Scenario1_Basic::DeleteSelectedItem()
00040 {
00041     int selectedIndex = BottomUpList->SelectedIndex;
00042     if (selectedIndex >= 0)
00043     {
00044         BottomUpList->Items->RemoveAt(static_cast<unsigned int>(selectedIndex));
00045         if (static_cast<unsigned int>(selectedIndex) < BottomUpList->Items->Size)
00046         {
00047             BottomUpList->SelectedIndex = selectedIndex;
00048         }
00049     }
00050 }
00051
00052 void Scenario1_Basic::SaveScrollPosition()
00053 {
00054     // We let the item be its own key. In a more general program, the item would have
00055     // a unique ID that identifies it in the list.
00056     savedScrollPosition = ListViewPersistenceHelper::GetRelativeScrollPosition(BottomUpList,
00057         ref new ListViewItemToKeyHandler([](Object^ o) { return o->ToString(); }));
00058 }
00059
00060 void Scenario1_Basic::RestoreScrollPosition()
00061 {
00062     if (savedScrollPosition != nullptr)
00063     {
00064         ListViewPersistenceHelper::SetRelativeScrollPositionAsync(BottomUpList, savedScrollPosition,
00065             ref new ListViewKeyToItemHandler([](String^ s) { return create_async([s]() { return task_from_result<Object^>(s); }); }));
00066     }
00067 }
Generated on Fri Nov 15 2024 22:19:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/Scenario1_OvenClient.xaml.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

Scenario1_OvenClient.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Scenario1_OvenClient.xaml.h"
00009 #include "MainPage.xaml.h"
00010 #include "..\Server\Microsoft.SDKSamples.Kitchen.h"
00011
00012 using namespace SDKSample;
00013 using namespace SDKSample::ProxyStubsForWinRTComponents;
00014
00015 using namespace Microsoft::SDKSamples::Kitchen;
00016 using namespace Windows::Foundation;
00017
00018 using namespace Windows::UI::Xaml;
00019 using namespace Windows::UI::Xaml::Controls;
00020
00021 OvenClient::OvenClient()
00022 {
00023     InitializeComponent();
00024 }
00025
00026 void SDKSample::ProxyStubsForWinRTComponents::OvenClient::Start_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00027 {
00028     Dimensions dimensions;
00029     dimensions.Width = 2;
00030     dimensions.Height = 2;
00031     dimensions.Depth = 2;
00032
00033     // Component Creation
00034     Oven^ myOven = ref new Oven(dimensions);
00035
00036     // Getters and setters are accessed using property syntax
00037     OvenClientOutput->Text += "Oven volume is: " + (myOven->Volume).ToString() + "\n";
00038
00039     // Registering event listeners
00040     myOven->BreadBaked += ref new TypedEventHandler<Oven^, Bread^>(this, &OvenClient::BreadCompletedHandler1);
00041     myOven->BreadBaked += ref new TypedEventHandler<Oven^, Bread^>(this, &OvenClient::BreadCompletedHandler2);
00042
00043     // C++ projections expose the tokens used to register and remove event handlers
00044     auto eventRegistrationToken = (myOven->BreadBaked += ref new TypedEventHandler<Oven^, Bread^>(this, &OvenClient::BreadCompletedHandler3));
00045     myOven->BreadBaked -= eventRegistrationToken;
00046
00047     // Bake a loaf of bread. This will trigger the BreadBaked event.
00048     myOven->BakeBread("Sourdough");
00049
00050     // Trigger the event again with a different preheat time
00051     myOven->ConfigurePreheatTemperature(OvenTemperature::High);
00052     myOven->BakeBread("Wheat");
00053 }
00054
00055 void OvenClient::BreadCompletedHandler1(Oven^ oven, Bread^ bread)
00056 {
00057     auto updateOutputText = [this, oven, bread]() -> void
00058     {
00059         OvenClientOutput->Text += "Event Handler 1: Invoked\n";
00060         OvenClientOutput->Text += "Event Handler 1: Oven volume is: " + oven->Volume.ToString() + "\n";
00061         OvenClientOutput->Text += "Event Handler 1: Bread flavor is: " + bread->Flavor + "\n";
00062     };
00063
00064     if (OvenClientOutput->Dispatcher->HasThreadAccess)
00065     {
00066         // If the current thread is the UI thread then execute the lambda.
00067         updateOutputText();
00068     }
00069     else
00070     {
00071         // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00072         OvenClientOutput->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler(updateOutputText));
00073     }
00074 }
00075
00076 void OvenClient::BreadCompletedHandler2(Oven^ oven, Bread^ bread)
00077 {
00078     auto updateOutputText = [this, oven, bread]() -> void
00079     {
00080         OvenClientOutput->Text += "Event Handler 2: Invoked\n";
00081     };
00082
00083     if (OvenClientOutput->Dispatcher->HasThreadAccess)
00084     {
00085         // If we are running on the UI thread then just execute the lambda.
00086         updateOutputText();
00087     }
00088     else
00089     {
00090         // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00091         OvenClientOutput->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler(updateOutputText));
00092     }
00093 }
00094
00095 void OvenClient::BreadCompletedHandler3(Oven^ oven, Bread^ bread)
00096 {
00097     // Event handler 3 was removed and will not be invoked
00098     auto updateOutputText = [this, oven, bread]() -> void
00099     {
00100         OvenClientOutput->Text += "Event Handler 3: Invoked\n";
00101     };
00102
00103     if (OvenClientOutput->Dispatcher->HasThreadAccess)
00104     {
00105         // If running on the UI thread then just execute the lambda.
00106         updateOutputText();
00107     }
00108     else
00109     {
00110         // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00111         OvenClientOutput->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler(updateOutputText));
00112     }
00113 }
00114
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
BindToAny_Checked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
BindToAny_Unchecked(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
EchoMessage(RemotePeer peer, DatagramSocketMessageReceivedEventArgs eventArguments) | Scenario1 | [inline, private]
localHostItems | Scenario1 | [private]
MessageReceived(DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments) | Scenario1 | [inline, private]
NotifyUserFromAsyncThread(string strMessage, NotifyType type) | Scenario1 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
PopulateAdapterList() | Scenario1 | [inline, private]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
StartListener_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/Common/StepTimer.cs Source File

  • BasicHologram
  • cs
  • Common

StepTimer.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Diagnostics;
00004 using System.Linq;
00005 using System.Runtime.InteropServices;
00006 using System.Text;
00007 using System.Threading.Tasks;
00008
00009 namespace BasicHologram.Common
00010 {
00011     /// <summary>
00012     /// Helper class for animation and simulation timing.
00013     /// </summary>
00014     internal class StepTimer
00015     {
00016         // Integer format represents time using 10,000,000 ticks per second.
00017         private const long TicksPerSecond = 10000000;
00018
00019         // Source timing data uses QPC units.
00020         private long qpcFrequency;
00021         private long qpcLastTime;
00022         private long qpcMaxDelta;
00023
00024         // Derived timing data uses a canonical tick format.
00025         private long elapsedTicks       = 0;
00026         private long totalTicks         = 0;
00027         private long leftOverTicks      = 0;
00028
00029         // Members for tracking the framerate.
00030         private int frameCount          = 0;
00031         private int framesPerSecond     = 0;
00032         private int framesThisSecond    = 0;
00033         private long qpcSecondCounter   = 0;
00034
00035         // Members for configuring fixed timestep mode.
00036         private bool isFixedTimeStep    = false;
00037         private long targetElapsedTicks = TicksPerSecond / 60;
00038
00039         public StepTimer()
00040         {
00041             qpcFrequency = Stopwatch.Frequency;
00042             qpcLastTime = Stopwatch.GetTimestamp();
00043
00044             // Initialize max delta to 1/10 of a second.
00045             qpcMaxDelta = qpcFrequency / 10;
00046         }
00047
00048         /// <summary>
00049         /// After an intentional timing discontinuity (for instance a blocking IO operation)
00050         /// call this to avoid having the fixed timestep logic attempt a set of catch-up
00051         /// Update calls.
00052         /// </summary>
00053         public void ResetElapsedTime()
00054         {
00055             qpcLastTime = Stopwatch.GetTimestamp();
00056
00057             leftOverTicks    = 0;
00058             framesPerSecond  = 0;
00059             framesThisSecond = 0;
00060             qpcSecondCounter = 0;
00061         }
00062
00063         /// <summary>
00064         /// Get elapsed time since the previous Update call.
00065         /// </summary>
00066         public long ElapsedTicks
00067         {
00068             get { return elapsedTicks; }
00069         }
00070
00071         /// <summary>
00072         /// Get elapsed time since the previous Update call.
00073         /// </summary>
00074         public double ElapsedSeconds
00075         {
00076             get { return TicksToSeconds(elapsedTicks); }
00077         }
00078
00079         /// <summary>
00080         /// Get total time since the start of the program.
00081         /// </summary>
00082         public long TotalTicks
00083         {
00084             get { return totalTicks; }
00085         }
00086
00087         /// <summary>
00088         /// Get total time since the start of the program.
00089         /// </summary>
00090         public double TotalSeconds
00091         {
00092             get { return TicksToSeconds(totalTicks); }
00093         }
00094
00095         /// <summary>
00096         /// Get total number of updates since start of the program.
00097         /// </summary>
00098         public int FrameCount
00099         {
00100             get { return frameCount; }
00101         }
00102
00103         /// <summary>
00104         /// Get the current framerate.
00105         /// </summary>
00106         public int FramesPerSecond
00107         {
00108             get { return framesPerSecond; }
00109         }
00110
00111         /// <summary>
00112         /// Get/Set whether to use fixed or variable timestep mode.
00113         /// </summary>
00114         public bool IsFixedTimeStep
00115         {
00116             get { return isFixedTimeStep; }
00117             set { isFixedTimeStep = value; }
00118         }
00119
00120         /// <summary>
00121         /// Get/Set how often to call Update when in fixed timestep mode.
00122         /// </summary>
00123         public long TargetElapsedTicks
00124         {
00125             get { return targetElapsedTicks; }
00126             set { targetElapsedTicks = value; }
00127         }
00128
00129         /// <summary>
00130         /// Get/Set how often to call Update when in fixed timestep mode.
00131         /// </summary>
00132         public double TargetElapsedSeconds
00133         {
00134             get { return TicksToSeconds(targetElapsedTicks); }
00135             set { targetElapsedTicks = SecondsToTicks(value); }
00136         }
00137
00138         /// <summary>
00139         /// // Update timer state, calling the specified Update function the appropriate number of times.
00140         /// </summary>
00141         public void Tick(Action update)
00142         {
00143             // Query the current time.
00144             long currentTime = Stopwatch.GetTimestamp();
00145
00146             long timeDelta = currentTime - qpcLastTime;
00147
00148             qpcLastTime = currentTime;
00149             qpcSecondCounter += timeDelta;
00150
00151             // Clamp excessively large time deltas (e.g. after paused in the debugger).
00152             if (timeDelta > qpcMaxDelta)
00153             {
00154                 timeDelta = qpcMaxDelta;
00155             }
00156
00157             // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
00158             timeDelta *= TicksPerSecond;
00159             timeDelta /= qpcFrequency;
00160
00161             long lastFrameCount = frameCount;
00162
00163             if (isFixedTimeStep)
00164             {
00165                 // Fixed timestep update logic
00166
00167                 // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
00168                 // the clock to exactly match the target value. This prevents tiny and irrelevant errors
00169                 // from accumulating over time. Without this clamping, a game that requested a 60 fps
00170                 // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
00171                 // accumulate enough tiny errors that it would drop a frame. It is better to just round
00172                 // small deviations down to zero to leave things running smoothly.
00173
00174                 if (Math.Abs(timeDelta - targetElapsedTicks) < (TicksPerSecond / 4000))
00175                 {
00176                     timeDelta = targetElapsedTicks;
00177                 }
00178
00179                 leftOverTicks += timeDelta;
00180
00181                 while (leftOverTicks >= targetElapsedTicks)
00182                 {
00183                     elapsedTicks   = targetElapsedTicks;
00184                     totalTicks    += targetElapsedTicks;
00185                     leftOverTicks -= targetElapsedTicks;
00186                     frameCount++;
00187
00188                     update();
00189                 }
00190             }
00191             else
00192             {
00193                 // Variable timestep update logic.
00194                 elapsedTicks   = timeDelta;
00195                 totalTicks    += timeDelta;
00196                 leftOverTicks  = 0;
00197                 frameCount++;
00198
00199                 update();
00200             }
00201
00202             // Track the current framerate.
00203             if (frameCount != lastFrameCount)
00204             {
00205                 framesThisSecond++;
00206             }
00207
00208             if (qpcSecondCounter >= qpcFrequency)
00209             {
00210                 framesPerSecond   = framesThisSecond;
00211                 framesThisSecond  = 0;
00212                 qpcSecondCounter %= qpcFrequency;
00213             }
00214         }
00215
00216         private static double TicksToSeconds(long ticks)
00217         {
00218             return (double)ticks / TicksPerSecond;
00219         }
00220
00221         private static long SecondsToTicks(double seconds)
00222         {
00223             return (long)(seconds * TicksPerSecond);
00224         }
00225     }
00226 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IAppliance Member List

This is the complete list of members for IAppliance, including all inherited members.
Volume | IAppliance
Volume([out, retval] double *value) | IAppliance
Volume([out, retval] double *value) | IAppliance
Generated on Fri Nov 15 2024 22:23:30 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundTransfer/cs/BackgroundTransfer/Scenario2_Upload.xaml.cs Source File

  • BackgroundTransfer
  • cs
  • BackgroundTransfer

Scenario2_Upload.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Globalization;
00015 using System.Threading;
00016 using System.Threading.Tasks;
00017 using Windows.Networking.BackgroundTransfer;
00018 using Windows.Storage;
00019 using Windows.Storage.FileProperties;
00020 using Windows.Storage.Pickers;
00021 using Windows.UI.Xaml;
00022 using Windows.UI.Xaml.Controls;
00023 using Windows.UI.Xaml.Navigation;
00024 using Windows.Web;
00025
00026 namespace SDKTemplate
00027 {
00028     /// <summary>
00029     /// An empty page that can be used on its own or navigated to within a Frame.
00030     /// </summary>
00031     public sealed partial class Scenario2_Upload : Page, IDisposable
00032     {
00033         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00034         // as NotifyUser()
00035         private MainPage rootPage = MainPage.Current;
00036
00037         private CancellationTokenSource cts;
00038
00039         private const int maxUploadFileSize = 100 * 1024 * 1024; // 100 MB (arbitrary limit chosen for this sample)
00040
00041         public Scenario2_Upload()
00042         {
00043             cts = new CancellationTokenSource();
00044
00045             this.InitializeComponent();
00046         }
00047
00048         public void Dispose()
00049         {
00050             if (cts != null)
00051             {
00052                 cts.Dispose();
00053                 cts = null;
00054             }
00055
00056             GC.SuppressFinalize(this);
00057         }
00058
00059         /// <summary>
00060         /// Invoked when this page is about to be displayed in a Frame.
00061         /// </summary>
00062         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00063         /// property is typically used to configure the page.</param>
00064         protected async override void OnNavigatedTo(NavigationEventArgs e)
00065         {
00066             // An application must enumerate uploads when it gets started to prevent stale downloads/uploads.
00067             // Typically this can be done in the App class by overriding OnLaunched() and checking for
00068             // "args.Kind == ActivationKind.Launch" to detect an actual app launch.
00069             // We do it here in the sample to keep the sample code consolidated.
00070             await DiscoverActiveUploadsAsync();
00071         }
00072
00073         // Enumerate the uploads that were going on in the background while the app was closed.
00074         private async Task DiscoverActiveUploadsAsync()
00075         {
00076             IReadOnlyList<UploadOperation> uploads = null;
00077             try
00078             {
00079                 uploads = await BackgroundUploader.GetCurrentUploadsAsync();
00080             }
00081             catch (Exception ex)
00082             {
00083                 if (!IsExceptionHandled("Discovery error", ex))
00084                 {
00085                     throw;
00086                 }
00087                 return;
00088             }
00089
00090             Log("Loading background uploads: " + uploads.Count);
00091
00092             if (uploads.Count > 0)
00093             {
00094                 List<Task> tasks = new List<Task>();
00095                 foreach (UploadOperation upload in uploads)
00096                 {
00097                     Log(String.Format(CultureInfo.CurrentCulture, "Discovered background upload: {0}, Status: {1}",
00098                         upload.Guid, upload.Progress.Status));
00099
00100                     // Attach progress and completion handlers.
00101                     tasks.Add(HandleUploadAsync(upload, false));
00102                 }
00103
00104                 // Don't await HandleUploadAsync() in the foreach loop since we would attach to the second
00105                 // upload only when the first one completed; attach to the third upload when the second one
00106                 // completes etc. We want to attach to all uploads immediately.
00107                 // If there are actions that need to be taken once uploads complete, await tasks here, outside
00108                 // the loop.
00109                 await Task.WhenAll(tasks);
00110             }
00111         }
00112
00113         private void StartUpload_Click(object sender, RoutedEventArgs e)
00114         {
00115             // Validating the URI is required since it was received from an untrusted source (user input).
00116             // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
00117             // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
00118             // the "Private Networks (Client and Server)" capability.
00119             Uri uri;
00120             if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
00121             {
00122                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00123                 return;
00124             }
00125
00126             FileOpenPicker picker = new FileOpenPicker();
00127             picker.FileTypeFilter.Add("*");
00128
00129             StartSingleFileUpload(picker, uri);
00130         }
00131
00132         private async void UploadSingleFile(Uri uri, StorageFile file)
00133         {
00134             if (file == null)
00135             {
00136                 rootPage.NotifyUser("No file selected.", NotifyType.ErrorMessage);
00137                 return;
00138             }
00139
00140             BasicProperties properties = await file.GetBasicPropertiesAsync();
00141             if (properties.Size > maxUploadFileSize)
00142             {
00143                 rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
00144                     "Selected file exceeds max. upload file size ({0} MB).", maxUploadFileSize / (1024 * 1024)),
00145                     NotifyType.ErrorMessage);
00146                 return;
00147             }
00148
00149             BackgroundUploader uploader = new BackgroundUploader();
00150             uploader.SetRequestHeader("Filename", file.Name);
00151
00152             UploadOperation upload = uploader.CreateUpload(uri, file);
00153             Log(String.Format(CultureInfo.CurrentCulture, "Uploading {0} to {1}, {2}", file.Name, uri.AbsoluteUri,
00154                 upload.Guid));
00155
00156             // Attach progress and completion handlers.
00157             await HandleUploadAsync(upload, true);
00158         }
00159
00160         private void StartMultipartUpload_Click(object sender, RoutedEventArgs e)
00161         {
00162             // By default 'serverAddressField' is disabled and URI validation is not required. When enabling the text
00163             // box validating the URI is required since it was received from an untrusted source (user input).
00164             // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
00165             // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
00166             // the "Private Networks (Client and Server)" capability.
00167             Uri uri;
00168             if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
00169             {
00170                 rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
00171                 return;
00172             }
00173
00174             FileOpenPicker picker = new FileOpenPicker();
00175             picker.FileTypeFilter.Add("*");
00176
00177             StartMultipleFilesUpload(picker, uri);
00178         }
00179
00180         private async void StartSingleFileUpload(FileOpenPicker picker, Uri uri)
00181         {
00182             StorageFile file = await picker.PickSingleFileAsync();
00183             UploadSingleFile(uri, file);
00184         }
00185
00186         private async void StartMultipleFilesUpload(FileOpenPicker picker, Uri uri)
00187         {
00188             IReadOnlyList<StorageFile> files = await picker.PickMultipleFilesAsync();
00189             UploadMultipleFiles(uri, files);
00190         }
00191
00192         private async void UploadMultipleFiles(Uri uri, IReadOnlyList<StorageFile> files)
00193         {
00194             if (files.Count == 0)
00195             {
00196                 rootPage.NotifyUser("No file selected.", NotifyType.ErrorMessage);
00197                 return;
00198             }
00199
00200             ulong totalFileSize = 0;
00201             for (int i = 0; i < files.Count; i++)
00202             {
00203                 BasicProperties properties = await files[i].GetBasicPropertiesAsync();
00204                 totalFileSize += properties.Size;
00205
00206                 if (totalFileSize > maxUploadFileSize)
00207                 {
00208                     rootPage.NotifyUser(String.Format(CultureInfo.CurrentCulture,
00209                         "Size of selected files exceeds max. upload file size ({0} MB).",
00210                         maxUploadFileSize / (1024 * 1024)), NotifyType.ErrorMessage);
00211                     return;
00212                 }
00213             }
00214
00215             List<BackgroundTransferContentPart> parts = new List<BackgroundTransferContentPart>();
00216             for (int i = 0; i < files.Count; i++)
00217             {
00218                 BackgroundTransferContentPart part = new BackgroundTransferContentPart("File" + i, files[i].Name);
00219                 part.SetFile(files[i]);
00220                 parts.Add(part);
00221             }
00222
00223             BackgroundUploader uploader = new BackgroundUploader();
00224             UploadOperation upload = await uploader.CreateUploadAsync(uri, parts);
00225
00226             String fileNames = files[0].Name;
00227             for (int i = 1; i < files.Count; i++)
00228             {
00229                 fileNames += ", " + files[i].Name;
00230             }
00231
00232             Log(String.Format(CultureInfo.CurrentCulture, "Uploading {0} to {1}, {2}", fileNames, uri.AbsoluteUri,
00233                 upload.Guid));
00234
00235             // Attach progress and completion handlers.
00236             await HandleUploadAsync(upload, true);
00237         }
00238
00239         private void CancelAll_Click(object sender, RoutedEventArgs e)
00240         {
00241             Log("Canceling all active uploads");
00242
00243             cts.Cancel();
00244             cts.Dispose();
00245
00246             // Re-create the CancellationTokenSource and activeUploads for future uploads.
00247             cts = new CancellationTokenSource();
00248         }
00249
00250         // Note that this event is invoked on a background thread, so we cannot access the UI directly.
00251         private void UploadProgress(UploadOperation upload)
00252         {
00253             // UploadOperation.Progress is updated in real-time while the operation is ongoing. Therefore,
00254             // we must make a local copy so that we can have a consistent view of that ever-changing state
00255             // throughout this method's lifetime.
00256             BackgroundUploadProgress currentProgress = upload.Progress;
00257
00258             MarshalLog(String.Format(CultureInfo.CurrentCulture, "Progress: {0}, Status: {1}", upload.Guid,
00259                 currentProgress.Status));
00260
00261             double percentSent = 100;
00262             if (currentProgress.TotalBytesToSend > 0)
00263             {
00264                 percentSent = currentProgress.BytesSent * 100 / currentProgress.TotalBytesToSend;
00265             }
00266
00267             MarshalLog(String.Format(CultureInfo.CurrentCulture,
00268                 " - Sent bytes: {0} of {1} ({2}%), Received bytes: {3} of {4}", currentProgress.BytesSent,
00269                 currentProgress.TotalBytesToSend, percentSent, currentProgress.BytesReceived, currentProgress.TotalBytesToReceive));
00270
00271             if (currentProgress.HasRestarted)
00272             {
00273                 MarshalLog(" - Upload restarted");
00274             }
00275
00276             if (currentProgress.HasResponseChanged)
00277             {
00278                 // We've received new response headers from the server.
00279                 MarshalLog(" - Response updated; Header count: " + upload.GetResponseInformation().Headers.Count);
00280
00281                 // If you want to stream the response data this is a good time to start.
00282                 // upload.GetResultStreamAt(0);
00283             }
00284         }
00285
00286         private async Task HandleUploadAsync(UploadOperation upload, bool start)
00287         {
00288             try
00289             {
00290                 LogStatus("Running: " + upload.Guid, NotifyType.StatusMessage);
00291
00292                 Progress<UploadOperation> progressCallback = new Progress<UploadOperation>(UploadProgress);
00293                 if (start)
00294                 {
00295                     // Start the upload and attach a progress handler.
00296                     await upload.StartAsync().AsTask(cts.Token, progressCallback);
00297                 }
00298                 else
00299                 {
00300                     // The upload was already running when the application started, re-attach the progress handler.
00301                     await upload.AttachAsync().AsTask(cts.Token, progressCallback);
00302                 }
00303
00304                 ResponseInformation response = upload.GetResponseInformation();
00305
00306                 LogStatus(String.Format(CultureInfo.CurrentCulture, "Completed: {0}, Status Code: {1}", upload.Guid,
00307                     response.StatusCode), NotifyType.StatusMessage);
00308             }
00309             catch (TaskCanceledException)
00310             {
00311                 LogStatus("Canceled: " + upload.Guid, NotifyType.StatusMessage);
00312             }
00313             catch (Exception ex)
00314             {
00315                 if (!IsExceptionHandled("Error", ex, upload))
00316                 {
00317                     throw;
00318                 }
00319             }
00320         }
00321
00322         private bool IsExceptionHandled(string title, Exception ex, UploadOperation upload = null)
00323         {
00324             WebErrorStatus error = BackgroundTransferError.GetStatus(ex.HResult);
00325             if (error == WebErrorStatus.Unknown)
00326             {
00327                 return false;
00328             }
00329
00330             if (upload == null)
00331             {
00332                 LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0}: {1}", title, error),
00333                     NotifyType.ErrorMessage);
00334             }
00335             else
00336             {
00337                 LogStatus(String.Format(CultureInfo.CurrentCulture, "Error: {0} - {1}: {2}", upload.Guid, title,
00338                     error), NotifyType.ErrorMessage);
00339             }
00340
00341             return true;
00342         }
00343
00344         // When operations happen on a background thread we have to marshal UI updates back to the UI thread.
00345         private void MarshalLog(string value)
00346         {
00347             var ignore = this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00348             {
00349                 Log(value);
00350             });
00351         }
00352
00353         private void Log(string message)
00354         {
00355             outputField.Text += message + "\r\n";
00356         }
00357
00358         private void LogStatus(string message, NotifyType type)
00359         {
00360             rootPage.NotifyUser(message, type);
00361             Log(message);
00362         }
00363     }
00364 }
Generated on Fri Nov 15 2024 22:18:28 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs Source File

  • SpeechRecognitionAndSynthesis
  • cs

Scenario_PredefinedWebSearchGrammar.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using SDKTemplate;
00013 using System;
00014 using System.Collections.Generic;
00015 using System.Threading.Tasks;
00016 using Windows.Globalization;
00017 using Windows.Media.SpeechRecognition;
00018 using Windows.UI.Core;
00019 using Windows.UI.Xaml;
00020 using Windows.UI.Xaml.Controls;
00021 using Windows.UI.Xaml.Documents;
00022 using Windows.UI.Xaml.Navigation;
00023 using Windows.Foundation;
00024 using Windows.ApplicationModel.Resources.Core;
00025
00026 namespace SDKTemplate
00027 {
00028     public sealed partial class Scenario_PredefinedWebSearchGrammar : Page
00029     {
00030         /// <summary>
00031         /// This HResult represents the scenario where a user is prompted to allow in-app speech, but
00032         /// declines. This should only happen on a Phone device, where speech is enabled for the entire device,
00033         /// not per-app.
00034         /// </summary>
00035         private static uint HResultPrivacyStatementDeclined = 0x80045509;
00036
00037         private SpeechRecognizer speechRecognizer;
00038         private IAsyncOperation<SpeechRecognitionResult> recognitionOperation;
00039         private ResourceContext speechContext;
00040         private ResourceMap speechResourceMap;
00041
00042         public Scenario_PredefinedWebSearchGrammar()
00043         {
00044             InitializeComponent();
00045         }
00046
00047         /// <summary>
00048         /// When activating the scenario, ensure we have permission from the user to access their microphone, and
00049         /// provide an appropriate path for the user to enable access to the microphone if they haven't
00050         /// given explicit permission for it.
00051         /// </summary>
00052         /// <param name="e">The navigation event details</param>
00053         protected async override void OnNavigatedTo(NavigationEventArgs e)
00054         {
00055             bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
00056             if (permissionGained)
00057             {
00058                 // Enable the recognition buttons.
00059                 btnRecognizeWithUI.IsEnabled = true;
00060                 btnRecognizeWithoutUI.IsEnabled = true;
00061
00062                 Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
00063                 speechContext = ResourceContext.GetForCurrentView();
00064                 speechContext.Languages = new string[] { speechLanguage.LanguageTag };
00065
00066                 speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");
00067
00068                 PopulateLanguageDropDown();
00069                 await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
00070             }
00071             else
00072             {
00073                 resultTextBlock.Visibility = Visibility.Visible;
00074                 resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
00075                 btnRecognizeWithUI.IsEnabled = false;
00076                 btnRecognizeWithoutUI.IsEnabled = false;
00077                 cbLanguageSelection.IsEnabled = false;
00078             }
00079         }
00080
00081         /// <summary>
00082         /// Look up the supported languages for this speech recognition scenario,
00083         /// that are installed on this machine, and populate a dropdown with a list.
00084         /// </summary>
00085         private void PopulateLanguageDropDown()
00086         {
00087             Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
00088             IEnumerable<Language> supportedLanguages = SpeechRecognizer.SupportedTopicLanguages;
00089             foreach (Language lang in supportedLanguages)
00090             {
00091                 ComboBoxItem item = new ComboBoxItem();
00092                 item.Tag = lang;
00093                 item.Content = lang.DisplayName;
00094
00095                 cbLanguageSelection.Items.Add(item);
00096                 if (lang.LanguageTag == defaultLanguage.LanguageTag)
00097                 {
00098                     item.IsSelected = true;
00099                     cbLanguageSelection.SelectedItem = item;
00100                 }
00101             }
00102         }
00103
00104         /// <summary>
00105         /// Ensure that we clean up any state tracking event handlers created in OnNavigatedTo to prevent leaks.
00106         /// </summary>
00107         /// <param name="e">Details about the navigation event</param>
00108         protected override void OnNavigatedFrom(NavigationEventArgs e)
00109         {
00110             base.OnNavigatedFrom(e);
00111             if (speechRecognizer != null)
00112             {
00113                 if (speechRecognizer.State != SpeechRecognizerState.Idle)
00114                 {
00115                     if (recognitionOperation != null)
00116                     {
00117                         recognitionOperation.Cancel();
00118                         recognitionOperation = null;
00119                     }
00120                 }
00121
00122                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00123
00124                 this.speechRecognizer.Dispose();
00125                 this.speechRecognizer = null;
00126             }
00127         }
00128
00129         /// <summary>
00130         /// Initialize Speech Recognizer and compile constraints.
00131         /// </summary>
00132         /// <param name="recognizerLanguage">Language to use for the speech recognizer</param>
00133         /// <returns>Awaitable task.</returns>
00134         private async Task InitializeRecognizer(Language recognizerLanguage)
00135         {
00136             if (speechRecognizer != null)
00137             {
00138                 // cleanup prior to re-initializing this scenario.
00139                 speechRecognizer.StateChanged -= SpeechRecognizer_StateChanged;
00140
00141                 this.speechRecognizer.Dispose();
00142                 this.speechRecognizer = null;
00143             }
00144
00145             // Create an instance of SpeechRecognizer.
00146             speechRecognizer = new SpeechRecognizer(recognizerLanguage);
00147
00148             // Provide feedback to the user about the state of the recognizer.
00149             speechRecognizer.StateChanged += SpeechRecognizer_StateChanged;
00150
00151             // Add a web search topic constraint to the recognizer.
00152             var webSearchGrammar = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "webSearch");
00153             speechRecognizer.Constraints.Add(webSearchGrammar);
00154
00155             // RecognizeWithUIAsync allows developers to customize the prompts.
00156             speechRecognizer.UIOptions.AudiblePrompt = "Say what you want to search for...";
00157             speechRecognizer.UIOptions.ExampleText = speechResourceMap.GetValue("WebSearchUIOptionsExampleText", speechContext).ValueAsString;
00158
00159             // Compile the constraint.
00160             SpeechRecognitionCompilationResult compilationResult = await speechRecognizer.CompileConstraintsAsync();
00161
00162             // Check to make sure that the constraints were in a proper format and the recognizer was able to compile it.
00163             if (compilationResult.Status != SpeechRecognitionResultStatus.Success)
00164             {
00165                 // Disable the recognition buttons.
00166                 btnRecognizeWithUI.IsEnabled = false;
00167                 btnRecognizeWithoutUI.IsEnabled = false;
00168
00169                 // Let the user know that the grammar didn't compile properly.
00170                 resultTextBlock.Visibility = Visibility.Visible;
00171                 resultTextBlock.Text = "Unable to compile grammar.";
00172             }
00173         }
00174
00175         /// <summary>
00176         /// Handle SpeechRecognizer state changed events by updating a UI component.
00177         /// </summary>
00178         /// <param name="sender">Speech recognizer that generated this status event</param>
00179         /// <param name="args">The recognizer's status</param>
00180         private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
00181         {
00182             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00183             {
00184                 MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
00185             });
00186         }
00187
00188         /// <summary>
00189         /// Uses the recognizer constructed earlier to listen for speech from the user before displaying
00190         /// it back on the screen. Uses the built-in speech recognition UI.
00191         /// </summary>
00192         /// <param name="sender">Button that triggered this event</param>
00193         /// <param name="e">State information about the routed event</param>
00194         private async void RecognizeWithUIWebSearchGrammar_Click(object sender, RoutedEventArgs e)
00195         {
00196             heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;
00197             hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
00198
00199             // Start recognition.
00200             try
00201             {
00202                 recognitionOperation = speechRecognizer.RecognizeWithUIAsync();
00203                 SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
00204                 // If successful, display the recognition result.
00205                 if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
00206                 {
00207                     heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
00208                     resultTextBlock.Text = speechRecognitionResult.Text;
00209                 }
00210                 else
00211                 {
00212                     resultTextBlock.Visibility = Visibility.Visible;
00213                     resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
00214                 }
00215             }
00216             catch (TaskCanceledException exception)
00217             {
00218                 // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
00219                 // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00220                 // show a message dialog for this exception.
00221                 System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
00222                 System.Diagnostics.Debug.WriteLine(exception.ToString());
00223             }
00224             catch (Exception exception)
00225             {
00226                 // Handle the speech privacy policy error.
00227                 if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
00228                 {
00229                     hlOpenPrivacySettings.Visibility = Visibility.Visible;
00230                 }
00231                 else
00232                 {
00233                     var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
00234                     await messageDialog.ShowAsync();
00235                 }
00236             }
00237         }
00238
00239         /// <summary>
00240         /// Uses the recognizer constructed earlier to listen for speech from the user before displaying
00241         /// it back on the screen. Uses developer-provided UI for user feedback.
00242         /// </summary>
00243         /// <param name="sender">Button that triggered this event</param>
00244         /// <param name="e">State information about the routed event</param>
00245         private async void RecognizeWithoutUIWebSearchGrammar_Click(object sender, RoutedEventArgs e)
00246         {
00247             heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Collapsed;
00248
00249             // Disable the UI while recognition is occurring, and provide feedback to the user about current state.
00250             btnRecognizeWithUI.IsEnabled = false;
00251             btnRecognizeWithoutUI.IsEnabled = false;
00252             cbLanguageSelection.IsEnabled = false;
00253             hlOpenPrivacySettings.Visibility = Visibility.Collapsed;
00254             listenWithoutUIButtonText.Text = " listening for speech...";
00255
00256             // Start recognition.
00257             try
00258             {
00259                 recognitionOperation = speechRecognizer.RecognizeAsync();
00260                 SpeechRecognitionResult speechRecognitionResult = await recognitionOperation;
00261                 // If successful, display the recognition result.
00262                 if (speechRecognitionResult.Status == SpeechRecognitionResultStatus.Success)
00263                 {
00264                     heardYouSayTextBlock.Visibility = resultTextBlock.Visibility = Visibility.Visible;
00265                     resultTextBlock.Text = speechRecognitionResult.Text;
00266                 }
00267                 else
00268                 {
00269                     resultTextBlock.Visibility = Visibility.Visible;
00270                     resultTextBlock.Text = string.Format("Speech Recognition Failed, Status: {0}", speechRecognitionResult.Status.ToString());
00271                 }
00272             }
00273             catch (TaskCanceledException exception)
00274             {
00275                 // TaskCanceledException will be thrown if you exit the scenario while the recognizer is actively
00276                 // processing speech. Since this happens here when we navigate out of the scenario, don't try to
00277                 // show a message dialog for this exception.
00278                 System.Diagnostics.Debug.WriteLine("TaskCanceledException caught while recognition in progress (can be ignored):");
00279                 System.Diagnostics.Debug.WriteLine(exception.ToString());
00280             }
00281             catch (Exception exception)
00282             {
00283                 // Handle the speech privacy policy error.
00284                 if ((uint)exception.HResult == HResultPrivacyStatementDeclined)
00285                 {
00286                     hlOpenPrivacySettings.Visibility = Visibility.Visible;
00287                 }
00288                 else
00289                 {
00290                     var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
00291                     await messageDialog.ShowAsync();
00292                 }
00293             }
00294
00295             // Reset UI state.
00296             listenWithoutUIButtonText.Text = " without UI";
00297             btnRecognizeWithUI.IsEnabled = true;
00298             cbLanguageSelection.IsEnabled = true;
00299             btnRecognizeWithoutUI.IsEnabled = true;
00300         }
00301
00302         /// <summary>
00303         /// When a user changes the speech recognition language, trigger re-initialization of the
00304         /// speech engine with that language, and change any speech-specific UI assets.
00305         /// </summary>
00306         /// <param name="sender">Ignored</param>
00307         /// <param name="e">Ignored</param>
00308         private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
00309         {
00310             if (speechRecognizer != null)
00311             {
00312                 ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
00313                 Language newLanguage = (Language)item.Tag;
00314                 if (speechRecognizer.CurrentLanguage != newLanguage)
00315                 {
00316                     // trigger cleanup and re-initialization of speech.
00317                     try
00318                     {
00319                         speechContext.Languages = new string[] { newLanguage.LanguageTag };
00320
00321                         await InitializeRecognizer(newLanguage);
00322                     }
00323                     catch (Exception exception)
00324                     {
00325                         var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");
00326                         await messageDialog.ShowAsync();
00327                     }
00328                 }
00329             }
00330         }
00331
00332         /// <summary>
00333         /// Open the Speech, Inking and Typing page under Settings -> Privacy, enabling a user to accept the
00334         /// Microsoft Privacy Policy, and enable personalization.
00335         /// </summary>
00336         /// <param name="sender">Ignored</param>
00337         /// <param name="args">Ignored</param>
00338         private async void openPrivacySettings_Click(Hyperlink sender, HyperlinkClickEventArgs args)
00339         {
00340             await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-speech"));
00341         }
00342     }
00343 }
Generated on Fri Nov 15 2024 22:21:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirectServices/cpp/Scenario2_AdvertiserAccept.xaml.cpp Source File

  • WiFiDirectServices
  • cpp

Scenario2_AdvertiserAccept.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_AdvertiserAccept.xaml.h"
00014
00015 using namespace SDKTemplate::WiFiDirectServices;
00016
00017 using namespace Platform;
00018 using namespace Windows::Devices::WiFiDirect::Services;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029 using namespace std;
00030
00031 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00032
00033 SessionRequestWrapper::SessionRequestWrapper(
00034     WiFiDirectServiceSessionRequest^ request,
00035     AdvertisementWrapper^ advertisement
00036     )
00037 {
00038     Id = request->DeviceInformation->Id;
00039     Advertisement = advertisement;
00040     Pin = "";
00041     ProvisioningInfo = "GroupFormation? " + (request->ProvisioningInfo->IsGroupFormationNeeded ? "Yes" : "No")
00042         + ", ConfigMethod: " + request->ProvisioningInfo->SelectedConfigurationMethod.ToString();
00043
00044     if (request->ProvisioningInfo->SelectedConfigurationMethod == WiFiDirectServiceConfigurationMethod::PinDisplay)
00045     {
00046         Pin = advertisement->Pin;
00047     }
00048
00049     SessionInfo = request->SessionInfo;
00050 }
00051
00052 Scenario2::Scenario2() : _rootPage(MainPage::Current)
00053 {
00054     InitializeComponent();
00055 }
00056
00057 void Scenario2::AddSessionRequest(WiFiDirectServiceSessionRequest^ request, AdvertisementWrapper^ advertiser)
00058 {
00059     SessionRequestWrapper^ sessionRequest = ref new SessionRequestWrapper(request, advertiser);
00060     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00061         ref new DispatchedHandler([this, sessionRequest]() {
00062             lock_guard<mutex> lock(_mutex);
00063             SessionRequests->Items->Append(sessionRequest);
00064     }));
00065 }
00066
00067 void Scenario2::RemoveSessionRequest(WiFiDirectServiceSessionRequest^ request, AdvertisementWrapper^ advertiser)
00068 {
00069     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00070         ref new DispatchedHandler([this, request, advertiser]()
00071         {
00072             lock_guard<mutex> lock(_mutex);
00073             for (unsigned int i = 0; i < SessionRequests->Items->Size; ++i)
00074             {
00075                 SessionRequestWrapper^ wrapper = dynamic_cast<SessionRequestWrapper^>(SessionRequests->Items->GetAt(i));
00076                 if (wrapper->Advertisement->InternalId == advertiser->InternalId &&
00077                     wrapper->Id == request->DeviceInformation->Id)
00078                 {
00079                     SessionRequests->Items->RemoveAt(i);
00080                     break;
00081                 }
00082             }
00083         }));
00084 }
00085
00086 void Scenario2::AddAdvertiser(AdvertisementWrapper ^ advertiser)
00087 {
00088     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00089         ref new DispatchedHandler([this, advertiser]()
00090         {
00091             lock_guard<mutex> lock(_mutex);
00092             Advertisements->Items->Append(advertiser);
00093         }));
00094 }
00095
00096 void Scenario2::RemoveAdvertiser(unsigned int index)
00097 {
00098     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00099         ref new DispatchedHandler([this, index]()
00100         {
00101             lock_guard<mutex> lock(_mutex);
00102
00103             if (index > Advertisements->Items->Size - 1)
00104             {
00105                 throw ref new OutOfBoundsException("Attempted to remove advertiser no longer in list");
00106             }
00107
00108             Advertisements->Items->RemoveAt(index);
00109
00110             if (Advertisements->Items->Size == 0)
00111             {
00112                 // Force navigation to the previous page for smoother experience
00113                 // This takes us to the scenario to create a new advertisement
00114                 _rootPage->GoToScenario(0);
00115             }
00116         }));
00117 }
00118
00119 void Scenario2::AddSession(SessionWrapper ^ session)
00120 {
00121     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00122         ref new DispatchedHandler([this, session]()
00123         {
00124             lock_guard<mutex> lock(_mutex);
00125             ConnectedSessions->Items->Append(session);
00126         }));
00127 }
00128
00129 void Scenario2::RemoveSession(unsigned int index)
00130 {
00131     Dispatcher->RunAsync(CoreDispatcherPriority::Normal,
00132         ref new DispatchedHandler([this, index]()
00133         {
00134             lock_guard<mutex> lock(_mutex);
00135
00136             if (index > ConnectedSessions->Items->Size - 1)
00137             {
00138                 throw ref new OutOfBoundsException("Attempted to remove session no longer in list");
00139             }
00140
00141             ConnectedSessions->Items->RemoveAt(index);
00142         }));
00143 }
00144
00145 void Scenario2::UpdateAdvertiserStatus(AdvertisementWrapper^ advertiser)
00146 {
00147     // Update list
00148 }
00149
00150 void Scenario2::OnNavigatedTo(NavigationEventArgs^ e)
00151 {
00152     lock_guard<mutex> lock(_mutex);
00153
00154     MainUI->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00155     PlaceholderUI->Visibility = Windows::UI::Xaml::Visibility::Visible;
00156
00157     // Fill in all existing data
00158     if (WiFiDirectServiceManager::Instance->Advertisers->Size > 0)
00159     {
00160         // Session Requests
00161         SessionRequests->Items->Clear();
00162
00163         // Advertisers
00164         Advertisements->Items->Clear();
00165         for (auto&& advertiser : WiFiDirectServiceManager::Instance->Advertisers)
00166         {
00167             Advertisements->Items->Append(advertiser);
00168
00169             for (auto&& request : advertiser->SessionRequestList)
00170             {
00171                 SessionRequestWrapper^ sessionRequest = ref new SessionRequestWrapper(request, advertiser);
00172                 SessionRequests->Items->Append(sessionRequest);
00173             }
00174         }
00175
00176         // Connected Sessions
00177         ConnectedSessions->Items->Clear();
00178         for (auto&& session : WiFiDirectServiceManager::Instance->ConnectedSessionList)
00179         {
00180             ConnectedSessions->Items->Append(session);
00181         }
00182
00183         MainUI->Visibility = Windows::UI::Xaml::Visibility::Visible;
00184         PlaceholderUI->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00185     }
00186     WiFiDirectServiceManager::Instance->CurrentScenario2 = this;
00187 }
00188
00189 void Scenario2::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00190 {
00191     WiFiDirectServiceManager::Instance->CurrentScenario2 = nullptr;
00192 }
00193
00194 void Scenario2::Accept_Click(Object^ sender, RoutedEventArgs^ e)
00195 {
00196     if (SessionRequests->Items->Size > 0)
00197     {
00198         int requestIndex = SessionRequests->SelectedIndex;
00199         if (requestIndex >= 0)
00200         {
00201             SessionRequestWrapper^ request = dynamic_cast<SessionRequestWrapper^>(SessionRequests->Items->GetAt(requestIndex));
00202             request->Advertisement->AcceptSessionRequest(request->Id, AcceptPin->Text);
00203         }
00204     }
00205 }
00206
00207 void Scenario2::Decline_Click(Object^ sender, RoutedEventArgs^ e)
00208 {
00209     if (SessionRequests->Items->Size > 0)
00210     {
00211         int requestIndex = SessionRequests->SelectedIndex;
00212         if (requestIndex >= 0)
00213         {
00214             SessionRequestWrapper^ request = dynamic_cast<SessionRequestWrapper^>(SessionRequests->Items->GetAt(requestIndex));
00215             request->Advertisement->DeclineSessionRequest(request->Id);
00216         }
00217     }
00218 }
00219
00220 void Scenario2::CloseSession_Click(Object^ sender, RoutedEventArgs^ e)
00221 {
00222     if (ConnectedSessions->Items->Size > 0)
00223     {
00224         int index = ConnectedSessions->SelectedIndex;
00225         if (index >= 0)
00226         {
00227             WiFiDirectServiceManager::Instance->CloseSession(index);
00228         }
00229     }
00230 }
00231
00232 void Scenario2::SelectSession_Click(Object^ sender, RoutedEventArgs^ e)
00233 {
00234     if (ConnectedSessions->Items->Size > 0)
00235     {
00236         int index = ConnectedSessions->SelectedIndex;
00237         if (index >= 0)
00238         {
00239             WiFiDirectServiceManager::Instance->SelectSession(index);
00240
00241             // Force navigation to the next page for smoother experience
00242             // This takes us to the scenario to send and receive data for a selected session
00243             _rootPage->GoToScenario(4);
00244         }
00245     }
00246 }
00247
00248 void Scenario2::StopAdvertisement_Click(Object^ sender, RoutedEventArgs^ e)
00249 {
00250     if (Advertisements->Items->Size > 0)
00251     {
00252         int index = Advertisements->SelectedIndex;
00253         if (index >= 0)
00254         {
00255             WiFiDirectServiceManager::Instance->UnpublishService(index);
00256         }
00257     }
00258 }
Generated on Fri Nov 15 2024 22:22:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/MediaTransportControls.h Source File

  • 360VideoPlayback
  • cpp
  • Content

MediaTransportControls.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "..\Common\CameraResources.h"
00004 #include "..\Common\DeviceResources.h"
00005 #include "..\Common\StepTimer.h"
00006 #include "..\Common\BaseControl.h"
00007
00008 using namespace DX;
00009 namespace _360VideoPlayback
00010 {
00011     // Media Transport Controls (MTC) for playback in a 3D environment
00012     // Although structured to a RenderObject, the MTC itself has no Geometry, it contains other items which are renderable
00013     class MediaTransportControls
00014     {
00015     public:
00016         MediaTransportControls();
00017
00018         void Initialize();
00019         void Update(const DX::StepTimer& timer, Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose);
00020         void Render();
00021         void PerformPressedAction();
00022         void ApplyShaders();
00023         void Show(Windows::UI::Input::Spatial::SpatialPointerPose^ cameraPose, float distance);
00024         void Hide();
00025         bool IsFocused();
00026         bool IsVisible() { return m_isVisible; };
00027
00028     private:
00029         float m_inactiveSecondsCounter = 0.0f;
00030         void AddExitButton();
00031         void AddPlayPauseButton();
00032         void AddSeekbar();
00033         inline Windows::Foundation::Numerics::float4 ComputeLookAtQuaternion(Windows::Foundation::Numerics::float3 objectPosition, Windows::Foundation::Numerics::float3 targetPosition, Windows::Foundation::Numerics::float3 upVector)
00034         {
00035             // The Windows::Foundation::Numerics::make_float4x4_look_at() and DirectX::XMLookAtRH() functions are both designed to compute ViewProjection Matrices
00036             // View Projection Matrices are typically the inverse of the Camera's transform matrices and are used to convert vertices from World space to View space
00037             // To "fix" this for our application of pointing models at things, we just need to inverse the resulting ViewProjection from your inputs.
00038             // You can also roll your own vector math to just compute the rotation directly, but we'll stick with the platform calls for now since the inverse call is a minor tax.
00039             Windows::Foundation::Numerics::float4x4 lookAtViewMatrix = Windows::Foundation::Numerics::make_float4x4_look_at(targetPosition, objectPosition, upVector);
00040             Windows::Foundation::Numerics::quaternion worldSpaceLookAtQuaternion = Windows::Foundation::Numerics::inverse(Windows::Foundation::Numerics::make_quaternion_from_rotation_matrix(lookAtViewMatrix));
00041             return Windows::Foundation::Numerics::float4(worldSpaceLookAtQuaternion.x, worldSpaceLookAtQuaternion.y, worldSpaceLookAtQuaternion.z, worldSpaceLookAtQuaternion.w);
00042         };
00043
00044         std::shared_ptr<BaseControl> m_exitButtonControl;
00045         std::list<std::shared_ptr<BaseControl>> m_baseControls;
00046         std::shared_ptr<BaseControl> m_playPauseButtonControl;
00047         std::shared_ptr<BaseControl> m_seekbarControl;
00048         bool m_isVisible;
00049         bool m_shadersLoaded;
00050         Windows::Foundation::Numerics::float4 m_rotation;
00051         Windows::Foundation::Numerics::float3 m_position;
00052         Windows::Foundation::Numerics::float4x4 m_transform;
00053     };
00054
00055 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AdvancedCasting/cs/Util/DialLaunchArguments.cs Source File

  • AdvancedCasting
  • cs
  • Util

DialLaunchArguments.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Linq;
00015 using System.Text;
00016 using System.Threading.Tasks;
00017
00018 namespace ScreenCasting.Util
00019 {
00020     class DialLaunchArguments
00021     {
00022         public string VideoId { get; private set; }
00023         public string PairingCode { get; private set; }
00024         public TimeSpan Position { get; private set; }
00025
00026         private DialLaunchArguments() { }
00027
00028         public static DialLaunchArguments Parse(string arguments)
00029         {
00030             try
00031             {
00032                 DialLaunchArguments dialLaunchArgs = new DialLaunchArguments();
00033
00034                 string[] argswithkeys = arguments.Split('&');
00035
00036                 foreach (string currentArgWithKey in argswithkeys)
00037                 {
00038                     string key = currentArgWithKey.Split('=')[0];
00039                     string val = currentArgWithKey.Split('=')[1];
00040                     switch (key)
00041                     {
00042                         case "v": { dialLaunchArgs.VideoId = val; break; }
00043                         case "t": { dialLaunchArgs.Position = TimeSpan.FromTicks(long.Parse(val)); break; }
00044                         case "pairingCode": { dialLaunchArgs.PairingCode = val; break; }
00045                     }
00046                 }
00047                 return dialLaunchArgs;
00048             }
00049             catch (Exception ex){
00050                 throw new ArgumentOutOfRangeException(string.Format("Failed to parse DIAL launch arguments: '{0}'", arguments), ex);
00051                 }
00052         }
00053
00054
00055     }
00056
00057
00058 }
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationData/cs/Scenario6_ClearScenario.xaml.cs Source File

  • ApplicationData
  • cs

Scenario6_ClearScenario.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using System;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario6_ClearScenario : Page
00018     {
00019         public Scenario6_ClearScenario()
00020         {
00021             InitializeComponent();
00022         }
00023
00024         async void Clear_Click(Object sender, RoutedEventArgs e)
00025         {
00026             try
00027             {
00028                 await Windows.Storage.ApplicationData.Current.ClearAsync();
00029                 OutputTextBlock.Text = "ApplicationData has been cleared.  Visit the other scenarios to see that their data has been cleared.";
00030             }
00031             catch (Exception)
00032             {
00033                 OutputTextBlock.Text = "Unable to clear settings. This can happen when files are in use.";
00034             }
00035         }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DpiScaling/cpp/Scenario2.xaml.cpp Source File

  • DpiScaling
  • cpp

Scenario2.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.cpp
00013 // Implementation of the Scenario2 class
00014 //
00015
00016 #include "pch.h"
00017 #include "Scenario2.xaml.h"
00018
00019 using namespace SDKTemplate;
00020
00021 using namespace Platform;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Graphics::Display;
00024 using namespace Windows::UI::Text;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Controls;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 Scenario2::Scenario2()
00031 {
00032     InitializeComponent();
00033
00034     DisplayInformation^ displayInformation = DisplayInformation::GetForCurrentView();
00035     token = (displayInformation->DpiChanged += ref new TypedEventHandler<DisplayInformation^, Platform::Object^>(this, &Scenario2::DisplayProperties_DpiChanged));
00036
00037     DefaultLayoutText->FontSize = PxFromPt(20);  // xaml fontsize is in pixels.
00038 }
00039
00040 double Scenario2::PtFromPx(double pixel)
00041 {
00042     return pixel * 72 / 96;
00043 }
00044
00045 double Scenario2::PxFromPt(double pt)
00046 {
00047     return pt * 96 / 72;
00048 }
00049
00050 String^ Scenario2::StringFromDouble(double x)
00051 {
00052     // Round to the nearest tenth for display.
00053     return (((int)(x * 10 + 0.5)) / 10.0).ToString();
00054 }
00055
00056 void Scenario2::OutputSettings(double rawPixelsPerViewPixel, FrameworkElement^ rectangle, TextBlock^ viewPxText, TextBlock^ rawPxText, TextBlock^ fontTextBlock)
00057 {
00058     // Get the size of the rectangle in view pixels and calulate the size in raw pixels.
00059     double sizeInViewPx = rectangle->Width;
00060     double sizeInRawPx = sizeInViewPx * rawPixelsPerViewPixel;
00061
00062     viewPxText->Text = StringFromDouble(sizeInViewPx) + " view px";
00063     rawPxText->Text = StringFromDouble(sizeInRawPx) + " raw px";
00064
00065     double fontSize = PtFromPx(fontTextBlock->FontSize);
00066     fontTextBlock->Text = StringFromDouble(fontSize) + "pt";
00067 }
00068
00069 void Scenario2::ResetOutput()
00070 {
00071     ResolutionTextBlock->Text = StringFromDouble(Window::Current->Bounds.Width) + "x" + StringFromDouble(Window::Current->Bounds.Height);
00072
00073     DisplayInformation^ displayInformation = DisplayInformation::GetForCurrentView();
00074     double rawPixelsPerViewPixel = displayInformation->RawPixelsPerViewPixel;
00075
00076     // Set the override rectangle size and override text font size by taking our desired
00077     // size in raw pixels and converting it to view pixels.
00078     const double rectSizeInRawPx = 100;
00079     const double rectSizeInViewPx = rectSizeInRawPx / rawPixelsPerViewPixel;
00080     OverrideLayoutRect->Width = rectSizeInViewPx;
00081     OverrideLayoutRect->Height = rectSizeInViewPx;
00082
00083     const double fontSizeInRawPx = PxFromPt(20);
00084     const double fontSizeInViewPx = fontSizeInRawPx / rawPixelsPerViewPixel;
00085     OverrideLayoutText->FontSize = fontSizeInViewPx;
00086
00087     // Output settings for controls with default scaling behavior.
00088     OutputSettings(rawPixelsPerViewPixel, DefaultLayoutRect, DefaultRelativePx, DefaultPhysicalPx, DefaultLayoutText);
00089     // Output settings for override controls.
00090     OutputSettings(rawPixelsPerViewPixel, OverrideLayoutRect, OverrideRelativePx, OverridePhysicalPx, OverrideLayoutText);
00091 }
00092
00093 void Scenario2::OnNavigatedTo(NavigationEventArgs^ e)
00094 {
00095     ResetOutput();
00096 }
00097
00098 void Scenario2::OnNavigatedFrom(NavigationEventArgs^ e)
00099 {
00100     DisplayInformation^ displayInformation = DisplayInformation::GetForCurrentView();
00101     displayInformation->DpiChanged -= token;
00102 }
00103
00104 void Scenario2::DisplayProperties_DpiChanged(DisplayInformation^ sender, Platform::Object^ args)
00105 {
00106     ResetOutput();
00107 }
Generated on Fri Nov 15 2024 22:17:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AllJoynBusObjectManager Member List

This is the complete list of members for AllJoynBusObjectManager, including all inherited members.
BusAttachmentMap | AllJoynBusObjectManager | [private, static]
BusObjectExists(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath) | AllJoynBusObjectManager | [static]
BusObjectIsRegistered(_In_ const alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject) | AllJoynBusObjectManager | [static]
CreateBusObject(_In_ const PCSTR objectPath, _Out_ alljoyn_busobject *busObject) | AllJoynBusObjectManager | [private, static]
GetBusObject(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _Out_ alljoyn_busobject *busObject) | AllJoynBusObjectManager | [static]
ModifyBusObjectMap | AllJoynBusObjectManager | [private, static]
ReleaseBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath) | AllJoynBusObjectManager | [static]
SaveBusObject(_In_ const alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath, _In_ const alljoyn_busobject busObject) | AllJoynBusObjectManager | [private, static]
TryRegisterBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const alljoyn_busobject busObject, _In_ const bool secure) | AllJoynBusObjectManager | [static]
UnregisterAndDestroyBusObject(_Inout_ alljoyn_busattachment busAttachment, _In_ const PCSTR objectPath) | AllJoynBusObjectManager | [private, static]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BaseElement Member List

This is the complete list of members for BaseElement, including all inherited members.
AddChildElement(const std::shared_ptr< BaseElement > &childElement) | BaseElement |
ArrangeElements() | BaseElement | [virtual]
BaseElement() | BaseElement |
GetElementMargin() | BaseElement | [inline]
GetElementSize() | BaseElement | [inline]
GetIgnoreLayout() | BaseElement | [inline]
GetIsRenderPassNeeded() | BaseElement | [inline]
GetIsVisible() | BaseElement | [inline]
Initialize() | BaseElement | [virtual]
m_deviceResources | BaseElement | [protected]
m_elementMargin | BaseElement | [protected]
m_elementSize | BaseElement | [protected]
m_ignoreLayout | BaseElement | [protected]
m_isInitialized | BaseElement | [protected]
m_isLayoutHorizontal | BaseElement | [protected]
m_isRenderPassNeeded | BaseElement | [protected]
m_isVisible | BaseElement | [protected]
m_parentTranslation | BaseElement | [protected]
m_transformedTranslation | BaseElement | [protected]
m_transformMatrix | BaseElement | [protected]
m_transformRecalculationNeeded | BaseElement | [protected]
m_translation | BaseElement | [protected]
Render() | BaseElement | [protected, virtual]
SetBrush(ID2D1SolidColorBrush *brush) | BaseElement |
SetElementMargin(ElementMargin margin) | BaseElement | [inline]
SetElementSize(Windows::Foundation::Numerics::float2 size) | BaseElement | [inline]
SetIgnoreLayout(bool ignoreLayout) | BaseElement | [inline]
SetIsVisible(bool visible) | BaseElement |
SetLayoutHorizontal(bool isLayoutHorizontal) | BaseElement | [inline]
SetParentTransform(Windows::Foundation::Numerics::float2 translation) | BaseElement |
SetTranslation(Windows::Foundation::Numerics::float2 translation) | BaseElement | [virtual]
TryRender() | BaseElement |
Update(const DX::StepTimer &timer, Windows::UI::Input::Spatial::SpatialPointerPose^cameraPose) | BaseElement | [virtual]
~BaseElement() | BaseElement | [virtual]
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_FrameInput Member List

This is the complete list of members for Scenario3_FrameInput, including all inherited members.
Button_Click(object sender, RoutedEventArgs e) | Scenario3_FrameInput | [inline, private]
CreateAudioGraph() | Scenario3_FrameInput | [inline, private]
deviceOutputNode | Scenario3_FrameInput | [private]
frameInputNode | Scenario3_FrameInput | [private]
GenerateAudioData(uint samples) | Scenario3_FrameInput | [inline, private]
graph | Scenario3_FrameInput | [private]
node_QuantumStarted(AudioFrameInputNode sender, FrameInputNodeQuantumStartedEventArgs args) | Scenario3_FrameInput | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_FrameInput | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_FrameInput | [inline, protected]
rootPage | Scenario3_FrameInput | [private]
Scenario3_FrameInput() | Scenario3_FrameInput | [inline]
theta | Scenario3_FrameInput |
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cpp/DeviceList.h Source File

  • CustomCapability
  • cpp

DeviceList.h

Go to the documentation of this file.
00001 namespace SDKTemplate
00002 {
00003     [Windows::UI::Xaml::Data::Bindable]
00004     public ref class DeviceListEntry sealed
00005     {
00006
00007         Windows::Devices::Enumeration::DeviceInformation^ m_Device;
00008
00009     public:
00010
00011         property Platform::String^ InstanceId
00012         {
00013             Platform::String^ get(void)
00014             {
00015                 return safe_cast<Platform::String^>(m_Device->Properties->Lookup("System.Devices.DeviceInstanceId"));
00016             }
00017         }
00018
00019         property Platform::String^ Id
00020         {
00021             Platform::String^ get(void)
00022             {
00023                 return m_Device->Id;
00024             }
00025         }
00026
00027         property bool Matched;
00028
00029         DeviceListEntry(Windows::Devices::Enumeration::DeviceInformation^ DeviceInterface)
00030         {
00031             m_Device = DeviceInterface;
00032             Matched = true;
00033         }
00034     };
00035
00036     typedef Windows::Foundation::EventHandler<Windows::Devices::Custom::CustomDevice^> DeviceClosingHandler;
00037
00038     ref class DeviceList
00039     {
00040     public:
00041         static property DeviceList^ Current {DeviceList^ get();};
00042
00043         property Windows::Foundation::Collections::IObservableVector<DeviceListEntry^>^ Fx2Devices
00044         {
00045             Windows::Foundation::Collections::IObservableVector<DeviceListEntry^>^ get(void)
00046             {
00047                 return m_List;
00048             }
00049         };
00050
00051         Windows::Devices::Custom::CustomDevice^ GetSelectedDevice()
00052         {
00053             return m_Fx2Device;
00054         }
00055
00056         Platform::String^ GetSelectedDeviceId()
00057         {
00058             return m_Fx2DeviceId;
00059         }
00060
00061         void SetSelectedDevice(Platform::String^ id, Windows::Devices::Custom::CustomDevice^ device)
00062         {
00063             if (m_Fx2Device != nullptr)
00064             {
00065                 DeviceClosing(this, m_Fx2Device);
00066             }
00067
00068             m_Fx2Device = device;
00069             m_Fx2DeviceId = id;
00070         }
00071
00072         void ClearSelectedDevice()
00073         {
00074             SetSelectedDevice(nullptr, nullptr);
00075         }
00076
00077         property bool WatcherStarted
00078         {
00079             bool get(void)
00080             {
00081                 return m_WatcherStarted;
00082             }
00083             void set(bool value)
00084             {
00085                 m_WatcherStarted = value;
00086             }
00087         };
00088
00089         void StartFx2Watcher();
00090
00091         void StopFx2Watcher();
00092
00093         static void CreateBooleanTable(
00094             Windows::UI::Xaml::Documents::InlineCollection^ Table,
00095             const Platform::Array<bool>^ NewValues,
00096             const Platform::Array<bool>^ OldValues,
00097             Platform::String^ IndexTitle,
00098             Platform::String^ ValueTitle,
00099             Platform::String^ TrueValue,
00100             Platform::String^ FalseValue
00101             );
00102
00103         event DeviceClosingHandler^ DeviceClosing;
00104
00105     private:
00106         static DeviceList^ _Current;
00107         Windows::Devices::Enumeration::DeviceWatcher^ m_Fx2Watcher;
00108
00109         Platform::Collections::Vector<DeviceListEntry^>^ m_List;
00110
00111         Windows::Devices::Custom::CustomDevice^ m_Fx2Device;
00112         Platform::String^ m_Fx2DeviceId;
00113
00114         bool m_WatcherSuspended;
00115         bool m_WatcherStarted;
00116
00117         DeviceList();
00118
00119         DeviceListEntry^ FindDevice(Platform::String^ Id);
00120
00121         void InitDeviceWatcher();
00122
00123         void SuspendDeviceWatcher(Object^ Sender, Windows::ApplicationModel::SuspendingEventArgs^ Args);
00124         void ResumeDeviceWatcher(Object^ Sender, Object^ Args);
00125
00126         void OnFx2Added(Windows::Devices::Enumeration::DeviceWatcher^ Sender, Windows::Devices::Enumeration::DeviceInformation^ DevInformation);
00127         void OnFx2Removed(Windows::Devices::Enumeration::DeviceWatcher^ Sender, Windows::Devices::Enumeration::DeviceInformationUpdate^ DevInformation);
00128         void OnFx2EnumerationComplete(Windows::Devices::Enumeration::DeviceWatcher^ Sender, Object^ Args);
00129     };
00130 }
Generated on Fri Nov 15 2024 22:19:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/EventHandlerForDevice.h Source File

  • CustomHidDeviceAccess
  • cpp

EventHandlerForDevice.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #pragma once
00008
00009 #include "pch.h"
00010 #include "SampleConfiguration.h"
00011
00012 namespace SDKTemplate
00013 {
00014     /// <summary>
00015     /// The purpose of this class is to demonstrate what to do to a HidDevice when a specific app event
00016     /// is raised (app suspension and resume) or when the device is disconnected. In addition to handling
00017     /// the HidDevice, the app's state should also be saved upon app suspension (will not be demonstrated here).
00018     ///
00019     /// This class will also demonstrate how to handle device watcher events.
00020     ///
00021     /// For simplicity, this class will only allow at most one device to be connected at any given time. In order
00022     /// to make this class support multiple devices, make this class a non-singleton and create multiple instances
00023     /// of this class; each instance should watch one connected device.
00024     /// </summary>
00025     [Windows::Foundation::Metadata::WebHostHidden]
00026     public ref class EventHandlerForDevice sealed
00027     {
00028     public:
00029         static property EventHandlerForDevice^ Current
00030         {
00031             EventHandlerForDevice^ get(void);
00032         }
00033
00034         static void CreateNewEventHandlerForDevice(void);
00035
00036         property Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, Windows::Devices::Enumeration::DeviceInformation^>^ OnDeviceClose
00037         {
00038             Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, Windows::Devices::Enumeration::DeviceInformation^>^ get(void)
00039             {
00040                 return deviceCloseCallback;
00041             }
00042
00043             void set(Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, Windows::Devices::Enumeration::DeviceInformation^>^ newHandler)
00044             {
00045                 deviceCloseCallback = newHandler;
00046             }
00047         }
00048
00049         property Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>^ OnDeviceConnected
00050         {
00051             Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>^ get(void)
00052             {
00053                 return deviceConnectedCallback;
00054             }
00055
00056             void set(Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>^ newHandler)
00057             {
00058                 deviceConnectedCallback = newHandler;
00059             }
00060         }
00061
00062         property bool IsDeviceConnected
00063         {
00064             bool get(void)
00065             {
00066                 return device != nullptr;
00067             }
00068         }
00069
00070         property Windows::Devices::HumanInterfaceDevice::HidDevice^ Device
00071         {
00072             Windows::Devices::HumanInterfaceDevice::HidDevice^ get(void)
00073             {
00074                 return device;
00075             }
00076         }
00077
00078         /// <summary>
00079         /// This DeviceInformation represents which device is connected or which device will be reconnected when
00080         /// the device is plugged in again (if IsEnabledAutoReconnect is true);.
00081         /// </summary>
00082         property Windows::Devices::Enumeration::DeviceInformation^ DeviceInformation
00083         {
00084             Windows::Devices::Enumeration::DeviceInformation^ get(void)
00085             {
00086                 return deviceInformation;
00087             }
00088         }
00089
00090         /// <summary>
00091         /// Returns DeviceAccessInformation for the device that is currently connected using this EventHandlerForDevice
00092         /// object.
00093         /// </summary>
00094         property Windows::Devices::Enumeration::DeviceAccessInformation^ DeviceAccessInformation
00095         {
00096             Windows::Devices::Enumeration::DeviceAccessInformation^ get(void)
00097             {
00098                 return deviceAccessInformation;
00099             }
00100         }
00101
00102         /// <summary>
00103         /// DeviceSelector AQS used to find this device
00104         /// </summary>
00105         property Platform::String^ DeviceSelector
00106         {
00107             Platform::String^ get(void)
00108             {
00109                 return deviceSelector;
00110             }
00111         }
00112
00113         /// <summary>
00114         /// True if EventHandlerForDevice will attempt to reconnect to the device once it is plugged into the computer again
00115         /// </summary>
00116         property bool IsEnabledAutoReconnect
00117         {
00118             bool get(void)
00119             {
00120                 return isEnabledAutoReconnect;
00121             }
00122             void set(bool value)
00123             {
00124                 isEnabledAutoReconnect = value;
00125             }
00126         }
00127
00128         Windows::Foundation::IAsyncOperation<bool>^ OpenDeviceAsync(Windows::Devices::Enumeration::DeviceInformation^ deviceInfo, Platform::String^ deviceSelectorString);
00129
00130         void CloseDevice(void);
00131     private:
00132         /// <summary>
00133         /// Allows for singleton EventHandlerForDevice
00134         /// </summary>
00135         static EventHandlerForDevice^ eventHandlerForDevice;
00136
00137         /// <summary>
00138         /// Used to synchronize threads to avoid multiple instantiations of eventHandlerForDevice.
00139         /// </summary>
00140         static SRWLOCK srwSingletonCreationLock;
00141
00142         Windows::Devices::Enumeration::DeviceWatcher^ deviceWatcher;
00143         Platform::String^ deviceSelector;
00144
00145         Windows::Devices::Enumeration::DeviceInformation^ deviceInformation;
00146         Windows::Devices::Enumeration::DeviceAccessInformation^ deviceAccessInformation;
00147         Windows::Devices::HumanInterfaceDevice::HidDevice^ device;
00148
00149         Windows::Foundation::EventRegistrationToken appSuspendEventToken;
00150         Windows::Foundation::EventRegistrationToken appResumeEventToken;
00151
00152         Windows::Foundation::EventRegistrationToken deviceAddedEventToken;
00153         Windows::Foundation::EventRegistrationToken deviceRemovedEventToken;
00154
00155         Windows::Foundation::EventRegistrationToken deviceAccessChangedEventToken;
00156
00157         Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, Windows::Devices::Enumeration::DeviceInformation^>^ deviceCloseCallback;
00158         Windows::Foundation::TypedEventHandler<EventHandlerForDevice^, OnDeviceConnectedEventArgs^>^ deviceConnectedCallback;
00159
00160         bool watcherSuspended;
00161         bool watcherStarted;
00162         bool isEnabledAutoReconnect;
00163
00164         EventHandlerForDevice(void);
00165         ~EventHandlerForDevice();
00166
00167         void CloseCurrentlyConnectedDevice(void);
00168
00169         void RegisterForAppEvents(void);
00170         void UnregisterFromAppEvents(void);
00171
00172         void RegisterForDeviceAccessStatusChange();
00173         void UnregisterFromDeviceAccessStatusChange();
00174
00175         void RegisterForDeviceWatcherEvents(void);
00176         void UnregisterFromDeviceWatcherEvents(void);
00177
00178         void StartDeviceWatcher(void);
00179         void StopDeviceWatcher(void);
00180
00181         void OnAppSuspension(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
00182         void OnAppResume(Platform::Object^ sender, Platform::Object^ args);
00183
00184         void OnDeviceRemoved(
00185             Windows::Devices::Enumeration::DeviceWatcher^ sender,
00186             Windows::Devices::Enumeration::DeviceInformationUpdate^ deviceInformationUpdate);
00187
00188         void OnDeviceAdded(
00189             Windows::Devices::Enumeration::DeviceWatcher^ sender,
00190             Windows::Devices::Enumeration::DeviceInformation^ deviceInfo);
00191
00192         void OnDeviceAccessChanged(
00193             Windows::Devices::Enumeration::DeviceAccessInformation^ sender,
00194             Windows::Devices::Enumeration::DeviceAccessChangedEventArgs^ eventArgs);
00195     };
00196 }
Generated on Fri Nov 15 2024 22:19:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboardTextInput/cpp/pch.cpp Source File

  • TouchKeyboardTextInput
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cs/Scenario1_Print.xaml.cs Source File

  • 3DPrinting
  • cs

Scenario1_Print.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.IO;
00014 using System.Linq;
00015 using System.Numerics;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Threading.Tasks;
00018 using System.Xml.Linq;
00019 using Windows.Foundation;
00020 using Windows.Graphics.Printing3D;
00021 using Windows.Security.Cryptography;
00022 using Windows.Storage;
00023 using Windows.Storage.Pickers;
00024 using Windows.Storage.Streams;
00025 using Windows.UI;
00026 using Windows.UI.Xaml;
00027 using Windows.UI.Xaml.Controls;
00028
00029 namespace SDKTemplate
00030 {
00031     public sealed partial class Scenario1_Print : Page
00032     {
00033         private MainPage rootPage = MainPage.Current;
00034         private Printing3D3MFPackage currentPackage;
00035
00036         public Scenario1_Print()
00037         {
00038             this.InitializeComponent();
00039         }
00040
00041         private void EnablePackageOperationButtons()
00042         {
00043             SaveButton.IsEnabled = true;
00044             PrintButton.IsEnabled = true;
00045         }
00046
00047         private async void CreateProgrammatically_Click(object sender, RoutedEventArgs e)
00048         {
00049             currentPackage = await CreatePackageAsync();
00050             rootPage.NotifyUser("Package created programmatically.", NotifyType.StatusMessage);
00051             EnablePackageOperationButtons();
00052         }
00053
00054         #region Creating a package programmatically
00055         private static async Task<Printing3D3MFPackage> CreatePackageAsync()
00056         {
00057             var package = new Printing3D3MFPackage();
00058
00059             var model = new Printing3DModel();
00060             model.Unit = Printing3DModelUnit.Millimeter;
00061
00062             // Material indices start at 1. (0 is reserved.)
00063
00064             #region Color materials
00065             // Create color materials.
00066             var colorMaterial1 = new Printing3DColorMaterial { Color = Color.FromArgb(255, 20, 20, 90) };
00067             var colorMaterial2 = new Printing3DColorMaterial { Color = Color.FromArgb(255, 250, 120, 45) };
00068
00069             // Create a color group with id 1 and add the colors to it.
00070             var colorGroup = new Printing3DColorMaterialGroup(1);
00071             colorGroup.Colors.Add(colorMaterial1);
00072             colorGroup.Colors.Add(colorMaterial2);
00073
00074             // add the color group to the model.
00075             model.Material.ColorGroups.Add(colorGroup);
00076             #endregion
00077
00078             #region Base materials
00079             // Create base materials.
00080             var material1 = new Printing3DBaseMaterial { Name = Printing3DBaseMaterial.Pla, Color = colorMaterial1 };
00081             var material2 = new Printing3DBaseMaterial { Name = Printing3DBaseMaterial.Abs, Color = colorMaterial2 };
00082
00083             // Create a new base material group with id 2 and add the base materials to it.
00084             var materialGroup = new Printing3DBaseMaterialGroup(2);
00085             materialGroup.Bases.Add(material1);
00086             materialGroup.Bases.Add(material2);
00087
00088             // Add the material group to the base groups on the model.
00089             model.Material.BaseGroups.Add(materialGroup);
00090
00091             #endregion
00092
00093             #region Composite material groups
00094             // Create a composite material group with id 3.
00095             var compositeMaterialGroup = new Printing3DCompositeMaterialGroup(3);
00096
00097             // Add it to the metadata.
00098             // The key is the string "composite" followed by the composite material group id.
00099             // The value specifies that the default base material group to use is id 2.
00100             model.Metadata.Add("composite3", "2");
00101
00102             // The indices are relative to the material indices that will be set by SetMaterialIndicesAsync.
00103             compositeMaterialGroup.MaterialIndices.Add(0);
00104             compositeMaterialGroup.MaterialIndices.Add(1);
00105
00106             // Create new composite materials.
00107             // The Values correspond to the materials added in the compositeMaterialGroup,
00108             // and they must sum to 1.0.
00109
00110             // Composite material 1 consists of 20% material1 and 80% material2.
00111             var compositeMaterial1 = new Printing3DCompositeMaterial();
00112             compositeMaterial1.Values.Add(0.2);
00113             compositeMaterial1.Values.Add(0.8);
00114
00115             // Composite material 2 consists of 50% material1 and 50% material2.
00116             var compositeMaterial2 = new Printing3DCompositeMaterial();
00117             compositeMaterial2.Values.Add(0.5);
00118             compositeMaterial2.Values.Add(0.5);
00119
00120             // Composite material 3 consists of 80% material1 and 20% material2.
00121             var compositeMaterial3 = new Printing3DCompositeMaterial();
00122             compositeMaterial3.Values.Add(0.8);
00123             compositeMaterial3.Values.Add(0.2);
00124
00125             // Composite material 4 consists of 40% material1 and 60% material2.
00126             var compositeMaterial4 = new Printing3DCompositeMaterial();
00127             compositeMaterial4.Values.Add(0.4);
00128             compositeMaterial4.Values.Add(0.6);
00129
00130             // Add the composite materials to the compositeMaterialGroup.
00131             compositeMaterialGroup.Composites.Add(compositeMaterial1);
00132             compositeMaterialGroup.Composites.Add(compositeMaterial2);
00133             compositeMaterialGroup.Composites.Add(compositeMaterial3);
00134             compositeMaterialGroup.Composites.Add(compositeMaterial4);
00135
00136             // Add the composite material group to the model.
00137             model.Material.CompositeGroups.Add(compositeMaterialGroup);
00138             #endregion
00139
00140             #region Texture resource
00141             Printing3DTextureResource textureResource = new Printing3DTextureResource();
00142
00143             // Set the texture path in the 3MF file.
00144             textureResource.Name = "/3D/Texture/msLogo.png";
00145
00146             // Load the texture from our package.
00147             StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/msLogo.png"));
00148             textureResource.TextureData = await file.OpenReadAsync();
00149
00150             package.Textures.Add(textureResource);
00151             #endregion
00152
00153             #region 2D texture materials
00154             // Create a texture material group with id 4.
00155             var texture2CoordGroup = new Printing3DTexture2CoordMaterialGroup(4);
00156
00157             // Add it to the metadata.
00158             // The key is the string "tex" followed by the texture material group id.
00159             // The value is the name of the texture resource (see textureResource.Name above).
00160             model.Metadata.Add("tex4", "/3D/Texture/msLogo.png");
00161
00162             // Create texture materials and add them to the group.
00163             texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 0.0, V = 1.0 });
00164             texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 1.0, V = 1.0 });
00165             texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 0.0, V = 0.0 });
00166             texture2CoordGroup.Texture2Coords.Add(new Printing3DTexture2CoordMaterial() { U = 1.0, V = 0.0 });
00167
00168             // Add the texture material group to the model.
00169             model.Material.Texture2CoordGroups.Add(texture2CoordGroup);
00170             #endregion
00171
00172             #region Mesh
00173             var mesh = new Printing3DMesh();
00174
00175             await SetVerticesAsync(mesh);
00176             await SetTriangleIndicesAsync(mesh);
00177             await SetMaterialIndicesAsync(mesh);
00178
00179             // add the mesh to the model
00180             model.Meshes.Add(mesh);
00181             #endregion
00182
00183             #region Adding a component to the build
00184             // create a component.
00185             Printing3DComponent component = new Printing3DComponent();
00186
00187             // assign the mesh to the component's mesh.
00188             component.Mesh = mesh;
00189
00190             // Add the component to the model. A model can have multiple components.
00191             model.Components.Add(component);
00192
00193             // The world matrix for the component is the identity matrix.
00194             var componentWithMatrix = new Printing3DComponentWithMatrix() { Component = component, Matrix = Matrix4x4.Identity };
00195
00196             // add the componentWithMatrix to the build.
00197             // The build defines what is to be printed from within a Printing3DModel.
00198             // If you leave a mesh out of the build, it will not be printed.
00199             model.Build.Components.Add(componentWithMatrix);
00200             #endregion
00201
00202             // Save the completed model into a package.
00203             await package.SaveModelToPackageAsync(model);
00204
00205             // fix any textures in the model file.
00206             await FixTextureContentTypeAsync(package);
00207
00208             return package;
00209         }
00210
00211         #region Mesh buffers
00212
00213         // Create the buffer for vertex positions.
00214         private static async Task SetVerticesAsync(Printing3DMesh mesh)
00215         {
00216             Printing3DBufferDescription description;
00217             description.Format = Printing3DBufferFormat.Printing3DDouble;
00218             description.Stride = 3; // Three values per vertex (x, y, z).
00219             mesh.VertexPositionsDescription = description;
00220             mesh.VertexCount = 8; // 8 total vertices in the cube
00221
00222             // Create the buffer into which we will write the vertex positions.
00223             mesh.CreateVertexPositions(sizeof(double) * description.Stride * mesh.VertexCount);
00224
00225             // Fill the buffer with vertex coordinates.
00226             using (var stream = mesh.GetVertexPositions().AsStream())
00227             {
00228                 double[] vertices =
00229                 {
00230                     0, 0, 0,
00231                     10, 0, 0,
00232                     0, 10, 0,
00233                     10, 10, 0,
00234                     0, 0, 10,
00235                     10, 0, 10,
00236                     0, 10, 10,
00237                     10, 10, 10,
00238                 };
00239
00240                 byte[] vertexData = vertices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();
00241
00242                 await stream.WriteAsync(vertexData, 0, vertexData.Length);
00243             }
00244         }
00245
00246         // Create the buffer for triangle indices.
00247         private static async Task SetTriangleIndicesAsync(Printing3DMesh mesh)
00248         {
00249             Printing3DBufferDescription description;
00250             description.Format = Printing3DBufferFormat.Printing3DUInt;
00251             description.Stride = 3; // 3 vertex position indices per triangle
00252             mesh.IndexCount = 12; // 12 triangles in the cube
00253             mesh.TriangleIndicesDescription = description;
00254
00255             // Create the buffer into which we will write the triangle vertex indices.
00256             mesh.CreateTriangleIndices(sizeof(UInt32) * description.Stride * mesh.IndexCount);
00257
00258             // Fill the buffer with triangle vertex indices.
00259             using (var stream = mesh.GetTriangleIndices().AsStream())
00260             {
00261                 UInt32[] indices =
00262                 {
00263                     1, 0, 2,
00264                     1, 2, 3,
00265                     0, 1, 5,
00266                     0, 5, 4,
00267                     1, 3, 7,
00268                     1, 7, 5,
00269                     2, 7, 3,
00270                     2, 6, 7,
00271                     0, 6, 2,
00272                     0, 4, 6,
00273                     6, 5, 7,
00274                     4, 5, 6,
00275                 };
00276
00277                 var vertexData = indices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();
00278                 await stream.WriteAsync(vertexData, 0, vertexData.Length);
00279             }
00280         }
00281
00282         // Create the buffer for material  indices.
00283         private static async Task SetMaterialIndicesAsync(Printing3DMesh mesh)
00284         {
00285             Printing3DBufferDescription description;
00286             description.Format = Printing3DBufferFormat.Printing3DUInt;
00287             description.Stride = 4; // 4 indices per material
00288             mesh.IndexCount = 12; // 12 triangles with material
00289             mesh.TriangleMaterialIndicesDescription = description;
00290
00291             // Create the buffer into which we will write the material indices.
00292             mesh.CreateTriangleMaterialIndices(sizeof(UInt32) * description.Stride * mesh.IndexCount);
00293
00294             // Fill the buffer with material indices.
00295             using (var stream = mesh.GetTriangleMaterialIndices().AsStream())
00296             {
00297                 UInt32[] indices =
00298                 {
00299                     // base materials:
00300                     // in  the BaseMaterialGroup, the BaseMaterial with id=0 will be applied to these triangle vertices
00301                     2, 0, 0, 0,
00302                     2, 0, 0, 0,
00303                     // color materials:
00304                     // in the ColorMaterialGroup, the ColorMaterials with these ids will be applied to these triangle vertices
00305                     1, 1, 1, 1,
00306                     1, 1, 1, 1,
00307                     1, 0, 0, 0,
00308                     1, 0, 0, 0,
00309                     1, 0, 1, 0,
00310                     1, 0, 1, 1,
00311                     // composite materials:
00312                     // in the CompositeMaterialGroup, the CompositeMaterial with id=0 will be applied to these triangles
00313                     3,0,0,0,
00314                     3,0,0,0,
00315                     // texture materials:
00316                     // in the Texture2CoordMaterialGroup, each texture coordinate is mapped to the appropriate vertex on these
00317                     // two adjacent triangle faces, so that the square face they create displays the original rectangular image
00318                     4, 0, 3, 1,
00319                     4, 2, 3, 0,
00320                 };
00321
00322                 var vertexData = indices.SelectMany(v => BitConverter.GetBytes(v)).ToArray();
00323                 await stream.WriteAsync(vertexData, 0, vertexData.Length);
00324             }
00325         }
00326         #endregion
00327         #endregion
00328
00329         private async void CreateFromXml_Click(object sender, RoutedEventArgs e)
00330         {
00331             var rawXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
00332             "<model unit=\"millimeter\" xml:lang=\"en-US\" xmlns=\"http://schemas.microsoft.com/3dmanufacturing/2013/01\">" +
00333             "<resources><object id=\"0\" type=\"model\"><mesh><vertices>" +
00334             "<vertex x=\"0.000000\" y=\"0.000000\" z=\"10.000000\" />" +
00335             "<vertex x=\"0.000000\" y=\"10.000000\" z=\"10.000000\" />" +
00336             "<vertex x=\"0.000000\" y=\"0.000000\" z=\"0.000000\" />" +
00337             "<vertex x=\"0.000000\" y=\"10.000000\" z=\"0.000000\" />" +
00338             "<vertex x=\"10.000000\" y=\"0.000000\" z=\"10.000000\" />" +
00339             "<vertex x=\"10.000000\" y=\"10.000000\" z=\"10.000000\" />" +
00340             "<vertex x=\"10.000000\" y=\"0.000000\" z=\"0.000000\" />" +
00341             "<vertex x=\"10.000000\" y=\"10.000000\" z=\"0.000000\" />" +
00342             "</vertices><triangles>" +
00343             "<triangle v1=\"0\" v2=\"1\" v3=\"2\" />" +
00344             "<triangle v1=\"2\" v2=\"1\" v3=\"3\" />" +
00345             "<triangle v1=\"0\" v2=\"4\" v3=\"5\" />" +
00346             "<triangle v1=\"1\" v2=\"0\" v3=\"5\" />" +
00347             "<triangle v1=\"2\" v2=\"6\" v3=\"4\" />" +
00348             "<triangle v1=\"0\" v2=\"2\" v3=\"4\" />" +
00349             "<triangle v1=\"3\" v2=\"7\" v3=\"2\" />" +
00350             "<triangle v1=\"2\" v2=\"7\" v3=\"6\" />" +
00351             "<triangle v1=\"1\" v2=\"5\" v3=\"3\" />" +
00352             "<triangle v1=\"3\" v2=\"5\" v3=\"7\" />" +
00353             "<triangle v1=\"6\" v2=\"7\" v3=\"5\" />" +
00354             "<triangle v1=\"4\" v2=\"6\" v3=\"5\" />" +
00355             "</triangles></mesh></object></resources>" +
00356             "<build><item objectid=\"0\" transform=\"10 0 0 0 10 0 0 0 10 0 0 0\" /></build></model>";
00357             currentPackage = await CreatePackageFromXmlAsync(rawXml);
00358             rootPage.NotifyUser("Package created from XML.", NotifyType.StatusMessage);
00359             EnablePackageOperationButtons();
00360         }
00361
00362         private static async Task<Printing3D3MFPackage> CreatePackageFromXmlAsync(string rawXml)
00363         {
00364             var package = new Printing3D3MFPackage();
00365             package.ModelPart = await StringToStreamAsync(rawXml);
00366             return package;
00367         }
00368
00369         private async void LoadPackageFromFile_Click(object sender, RoutedEventArgs e)
00370         {
00371             rootPage.NotifyUser("", NotifyType.StatusMessage);
00372
00373             FileOpenPicker openPicker = new FileOpenPicker();
00374             openPicker.ViewMode = PickerViewMode.Thumbnail;
00375             openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
00376             openPicker.FileTypeFilter.Add(".3mf");
00377
00378             StorageFile file = await openPicker.PickSingleFileAsync();
00379             if (file == null)
00380             {
00381                 return;
00382             }
00383
00384             rootPage.NotifyUser("Loading...", NotifyType.StatusMessage);
00385
00386             var package = new Printing3D3MFPackage();
00387             using (var fileStream = await file.OpenAsync(FileAccessMode.Read))
00388             {
00389                 var model = await package.LoadModelFromPackageAsync(fileStream);
00390                 rootPage.NotifyUser("Repairing...", NotifyType.StatusMessage);
00391                 await model.RepairAsync();
00392                 rootPage.NotifyUser("Saving...", NotifyType.StatusMessage);
00393                 await package.SaveModelToPackageAsync(model);
00394                 await FixTextureContentTypeAsync(package);
00395             }
00396
00397             currentPackage = package;
00398             rootPage.NotifyUser("Package created from file.", NotifyType.StatusMessage);
00399             EnablePackageOperationButtons();
00400         }
00401
00402         private async void SavePackage_Click(object sender, RoutedEventArgs e)
00403         {
00404             rootPage.NotifyUser("", NotifyType.StatusMessage);
00405
00406             FileSavePicker savePicker = new FileSavePicker();
00407             savePicker.DefaultFileExtension = ".3mf";
00408             savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
00409             savePicker.FileTypeChoices.Add("3MF File", new[] { ".3mf" });
00410             var storageFile = await savePicker.PickSaveFileAsync();
00411             if (storageFile == null)
00412             {
00413                 return;
00414             }
00415
00416             using (var stream = await currentPackage.SaveAsync())
00417             {
00418                 stream.Seek(0);
00419                 using (var dataReader = new DataReader(stream))
00420                 {
00421                     await dataReader.LoadAsync((uint)stream.Size);
00422                     var buffer = dataReader.ReadBuffer((uint)stream.Size);
00423                     await FileIO.WriteBufferAsync(storageFile, buffer);
00424                 }
00425             }
00426
00427             rootPage.NotifyUser("Saved", NotifyType.StatusMessage);
00428         }
00429
00430         private async void PrintPackage_Click(object sender, RoutedEventArgs e)
00431         {
00432             // register the PrintTaskRequest callback to get the Printing3D3MFPackage.
00433             var print3DManager = Print3DManager.GetForCurrentView();
00434             print3DManager.TaskRequested += OnTaskRequested;
00435
00436             // show the PrintUI
00437             var result = await Print3DManager.ShowPrintUIAsync();
00438
00439             // Remove the print task request after the dialog is complete.
00440             print3DManager.TaskRequested -= OnTaskRequested;
00441         }
00442
00443         private void OnTaskRequested(Print3DManager sender, Print3DTaskRequestedEventArgs args)
00444         {
00445             Print3DTask print3dTask = args.Request.CreateTask("Sample Model", "Default", (e) => e.SetSource(currentPackage));
00446
00447             // Optional notification handlers.
00448             print3dTask.Completed += (s, e) => rootPage.NotifyUser("Printing completed.", NotifyType.StatusMessage);
00449             print3dTask.Submitting += (s, e) => rootPage.NotifyUser("Submitting print job.", NotifyType.StatusMessage);
00450         }
00451
00452         private static async Task<IRandomAccessStream> StringToStreamAsync(string data)
00453         {
00454             var buffer = CryptographicBuffer.ConvertStringToBinary(data, BinaryStringEncoding.Utf8);
00455             var outputStream = new InMemoryRandomAccessStream();
00456             await outputStream.WriteAsync(buffer);
00457             return outputStream;
00458         }
00459
00460         // Works around an issue with Printing3DTextureResource: It does not respect
00461         // the TextureData.ContentType property, and always encodes the content type as "".
00462         // Repair the XML by assuming that a path that ends with ".png" is a PNG file,
00463         // and everything else is a JPG file.
00464         private static async Task FixTextureContentTypeAsync(Printing3D3MFPackage package)
00465         {
00466             XDocument xmldoc = XDocument.Load(package.ModelPart.AsStreamForRead());
00467             XNamespace ns3d = "http://schemas.microsoft.com/3dmanufacturing/material/2015/02";
00468
00469             foreach (var node in xmldoc.Descendants(ns3d + "texture2d"))
00470             {
00471                 var contentType = node.Attribute("contenttype");
00472                 if (contentType.Value == "")
00473                 {
00474                     if (node.Attribute("path").Value.EndsWith(".png"))
00475                     {
00476                         contentType.Value = "image/png";
00477                     }
00478                     else
00479                     {
00480                         contentType.Value = "image/jpg";
00481                     }
00482                 }
00483             }
00484
00485             // Update the model with the repaired XML.
00486             package.ModelPart = await StringToStreamAsync(xmldoc.ToString());
00487         }
00488    }
00489 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicInput/cpp/1-InputEvents.xaml.h Source File

  • BasicInput
  • cpp

1-InputEvents.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "1-InputEvents.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1 sealed
00024     {
00025     public:
00026         Scenario1();
00027     private:
00028         void target_PointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00029         void target_PointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00030         void target_PointerEntered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00031         void target_PointerExited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
00032         void target_Holding(Platform::Object^ sender, Windows::UI::Xaml::Input::HoldingRoutedEventArgs^ e);
00033         void target_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
00034         void target_DoubleTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs^ e);
00035         void target_RightTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e);
00036
00037         MainPage^ rootPage = MainPage::Current;
00038     };
00039 }
Generated on Fri Nov 15 2024 22:18:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileLoggingSessionScenario::BusySetter Member List

This is the complete list of members for FileLoggingSessionScenario::BusySetter, including all inherited members.
_scenario | FileLoggingSessionScenario::BusySetter |
BusySetter(FileLoggingSessionScenario &scenario) | FileLoggingSessionScenario::BusySetter | [explicit]
~BusySetter() | FileLoggingSessionScenario::BusySetter |
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario6_NumeralSystemTranslation Member List

This is the complete list of members for Scenario6_NumeralSystemTranslation, including all inherited members.
Display_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario6_NumeralSystemTranslation
Scenario6_NumeralSystemTranslation() | Scenario6_NumeralSystemTranslation
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/pch.cpp Source File

  • XmlLite
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cs/App.xaml.cs Source File

  • XamlMasterDetail
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.ApplicationModel;
00007 using Windows.ApplicationModel.Activation;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00019
00020 namespace MasterDetailApp
00021 {
00022     /// <summary>
00023     /// Provides application-specific behavior to supplement the default Application class.
00024     /// </summary>
00025     sealed partial class App : Application
00026     {
00027
00028         /// <summary>
00029         /// Initializes the singleton application object.  This is the first line of authored code
00030         /// executed, and as such is the logical equivalent of main() or WinMain().
00031         /// </summary>
00032         public App()
00033         {
00034             this.InitializeComponent();
00035             this.Suspending += OnSuspending;
00036         }
00037
00038         /// <summary>
00039         /// Invoked when the application is launched normally by the end user.  Other entry points
00040         /// will be used such as when the application is launched to open a specific file.
00041         /// </summary>
00042         /// <param name="e">Details about the launch request and process.</param>
00043         protected override void OnLaunched(LaunchActivatedEventArgs e)
00044         {
00045             Frame rootFrame = Window.Current.Content as Frame;
00046
00047             // Do not repeat app initialization when the Window already has content,
00048             // just ensure that the window is active
00049             if (rootFrame == null)
00050             {
00051                 // Create a Frame to act as the navigation context and navigate to the first page
00052                 rootFrame = new Frame();
00053                 // Set the default language
00054                 rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
00055
00056                 rootFrame.NavigationFailed += OnNavigationFailed;
00057
00058                 if (rootFrame.Content == null)
00059                 {
00060                     rootFrame.Navigate(typeof(MasterDetailPage));
00061                 }
00062
00063                 // Place the frame in the current Window
00064                 Window.Current.Content = rootFrame;
00065             }
00066
00067             // Ensure the current window is active
00068             Window.Current.Activate();
00069         }
00070
00071         /// <summary>
00072         /// Invoked when Navigation to a certain page fails
00073         /// </summary>
00074         /// <param name="sender">The Frame which failed navigation</param>
00075         /// <param name="e">Details about the navigation failure</param>
00076         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00077         {
00078             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00079         }
00080
00081         /// <summary>
00082         /// Invoked when application execution is being suspended.  Application state is saved
00083         /// without knowing whether the application will be terminated or resumed with the contents
00084         /// of memory still intact.
00085         /// </summary>
00086         /// <param name="sender">The source of the suspend request.</param>
00087         /// <param name="e">Details about the suspend request.</param>
00088         private void OnSuspending(object sender, SuspendingEventArgs e)
00089         {
00090             var deferral = e.SuspendingOperation.GetDeferral();
00091
00092             deferral.Complete();
00093         }
00094     }
00095 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/SampleConfiguration.h Source File

  • WindowsAudioSession
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileThumbnails/cpp/Scenario6.xaml.h Source File

  • FileThumbnails
  • cpp

Scenario6.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario6.xaml.h
00014 // Declaration of the Scenario1 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario6.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     [Windows::Foundation::Metadata::WebHostHidden]
00026     public ref class Scenario6 sealed
00027     {
00028     public:
00029         Scenario6();
00030
00031     protected:
00032         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00033
00034     private:
00035         MainPage^ rootPage;
00036
00037         void SelectImageButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:19:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WRLOutOfProcessWinRTComponent/cpp/cs/Scenario1_OvenClient.xaml.cs Source File

  • WRLOutOfProcessWinRTComponent
  • cpp
  • cs

Scenario1_OvenClient.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Microsoft.SDKSamples.Kitchen;
00008
00009 using Windows.Foundation;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Navigation;
00013 using SDKTemplate;
00014 using System;
00015
00016 namespace WRLOutOfProcessWinRTComponent
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class OvenClient : Page
00022     {
00023         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00024         // as NotifyUser()
00025         MainPage rootPage = MainPage.Current;
00026
00027         // Keep a ref to the oven since it is an event source.
00028         Oven _myOven = null;
00029
00030         public OvenClient()
00031         {
00032             this.InitializeComponent();
00033         }
00034
00035         /// <summary>
00036         /// Invoked when this page is about to be displayed in a Frame.
00037         /// </summary>
00038         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00039         /// property is typically used to configure the page.</param>
00040         protected override void OnNavigatedTo(NavigationEventArgs e)
00041         {
00042         }
00043
00044         /// <summary>
00045         /// Use the custom Oven and BreadBakedEventArgs Windows Runtime components.
00046         /// </summary>
00047         /// <param name="sender">Contains information about the button that fired the event.</param>
00048         /// <param name="e">Contains state information and event data associated with a routed event.</param>
00049         private void Start_Click(object sender, RoutedEventArgs e)
00050         {
00051             // Component Creation
00052             if (_myOven == null)
00053             {
00054                 Dimensions dimensions;
00055                 dimensions.Width = 2;
00056                 dimensions.Height = 2;
00057                 dimensions.Depth = 2;
00058
00059                 _myOven = new Oven(dimensions);
00060             }
00061
00062             // Getters and setters are accessed using property syntax
00063             OvenClientOutput.Text += "Oven volume is: " + _myOven.Volume.ToString() + "\n";
00064
00065             // Register even listeners
00066             _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler1);
00067             _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler2);
00068             _myOven.BreadBaked += new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);
00069
00070             // Unregister from an event using the -= syntax and a delegate instance
00071             _myOven.BreadBaked -= new TypedEventHandler<Oven, BreadBakedEventArgs>(BreadCompletedHandler3);
00072
00073             // Bake a loaf of bread. This will trigger the BreadBaked event.
00074             _myOven.BakeBread("Sourdough");
00075
00076             // Trigger the event again with a different preheat time
00077             _myOven.ConfigurePreheatTemperature(OvenTemperature.High);
00078             _myOven.BakeBread("Wheat");
00079         }
00080
00081         async private void BreadCompletedHandler1(Oven oven, BreadBakedEventArgs args)
00082         {
00083             Action updateOutputText = () =>
00084                 {
00085                     OvenClientOutput.Text += "Event Handler 1: Invoked\n";
00086                     OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
00087                     OvenClientOutput.Text += "Event Handler 1: Bread flavor is: " + args.Bread.Flavor + "\n";
00088                 };
00089
00090             await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00091         }
00092
00093         async private void BreadCompletedHandler2(Oven oven, BreadBakedEventArgs bread)
00094         {
00095             Action updateOutputText = () =>
00096                 {
00097                     OvenClientOutput.Text += "Event Handler 2: Invoked\n";
00098                 };
00099             await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00100         }
00101
00102         async private void BreadCompletedHandler3(Oven oven, BreadBakedEventArgs bread)
00103         {
00104             // Event handler 3 was removed and will not be invoked
00105             Action updateOutputText = () =>
00106                 {
00107                     OvenClientOutput.Text += "Event Handler 3: Invoked\n";
00108                 };
00109
00110             await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00111         }
00112     }
00113 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MeshObject Member List

This is the complete list of members for MeshObject, including all inherited members.
m_indexBuffer | MeshObject | [protected]
m_indexCount | MeshObject | [protected]
m_vertexBuffer | MeshObject | [protected]
m_vertexCount | MeshObject | [protected]
MeshObject() | MeshObject |
Render(_In_ ID3D11DeviceContext *context) | MeshObject | [virtual]
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/pch.h Source File

  • MagneticStripeReader
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario4_Remove.xaml.h Source File

  • Playlists
  • cpp

Scenario4_Remove.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario4_Remove.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario4_Remove sealed
00012     {
00013     public:
00014         Scenario4_Remove();
00015     private:
00016         MainPage^ rootPage;
00017         void PickPlaylistButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00018     };
00019 }
Generated on Fri Nov 15 2024 22:20:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Printing/cs/PreviewUnavailable.xaml.cs Source File

  • Printing
  • cs

PreviewUnavailable.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.Foundation;
00002 using Windows.UI.Xaml.Controls;
00003
00004 namespace PrintSample
00005 {
00006     /// <summary>
00007     /// Used in scenario 5 to display a custom print preview unavailable page
00008     /// </summary>
00009     public sealed partial class PreviewUnavailable : Page
00010     {
00011         public PreviewUnavailable()
00012         {
00013             this.InitializeComponent();
00014         }
00015
00016         /// <summary>
00017         /// Preview unavailable page constructor
00018         /// </summary>
00019         /// <param name="paperSize">The printing page paper size</param>
00020         /// <param name="printableSize">The usable/"printable" area on the page</param>
00021         public PreviewUnavailable(Size paperSize, Size printableSize)
00022             : this()
00023         {
00024             Page.Width = paperSize.Width;
00025             Page.Height = paperSize.Height;
00026
00027             PrintablePage.Width = printableSize.Width;
00028             PrintablePage.Height = printableSize.Height;
00029         }
00030     }
00031 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TripListView Member List

This is the complete list of members for TripListView, including all inherited members.
CoreWindow_VisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args) | TripListView | [inline, private]
defaultViewModel | TripListView | [private]
DefaultViewModel | TripListView |
Footer_Click(object sender, RoutedEventArgs e) | TripListView | [inline, private]
navigationHelper | TripListView | [private]
NavigationHelper | TripListView |
navigationHelper_LoadState(object sender, LoadStateEventArgs e) | TripListView | [inline, private]
navigationHelper_SaveState(object sender, SaveStateEventArgs e) | TripListView | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | TripListView | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | TripListView | [inline, protected]
tripListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | TripListView | [inline, private]
TripListView() | TripListView | [inline]
Generated on Fri Nov 15 2024 22:23:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DeviceInformationDisplay Member List

This is the complete list of members for DeviceInformationDisplay, including all inherited members.
CanPair | DeviceInformationDisplay |
DeviceInformation | DeviceInformationDisplay |
DeviceInformationDisplay(DeviceInformation deviceInfoIn) | DeviceInformationDisplay | [inline]
GetPropertyForDisplay(string key) | DeviceInformationDisplay |
GlyphBitmapImage | DeviceInformationDisplay |
Id | DeviceInformationDisplay |
IsPaired | DeviceInformationDisplay |
Kind | DeviceInformationDisplay |
Name | DeviceInformationDisplay |
OnPropertyChanged(string name) | DeviceInformationDisplay | [protected]
Properties | DeviceInformationDisplay |
PropertyChanged | DeviceInformationDisplay |
Update(DeviceInformationUpdate deviceInfoUpdate) | DeviceInformationDisplay | [inline]
UpdateGlyphBitmapImage() | DeviceInformationDisplay | [inline, private]
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IOnboardingLegacySignals Member List

This is the complete list of members for IOnboardingLegacySignals, including all inherited members.
ConnectionResultReceived IOnboardingLegacySignals
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ShowHideEvents Member List

This is the complete list of members for Scenario2_ShowHideEvents, including all inherited members.
OnHiding(Windows::UI::ViewManagement::InputPane const &sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const &e) | Scenario2_ShowHideEvents | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_ShowHideEvents |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario2_ShowHideEvents |
OnShowing(Windows::UI::ViewManagement::InputPane const &sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs const &e) | Scenario2_ShowHideEvents | [private]
Scenario2_ShowHideEvents() | Scenario2_ShowHideEvents |
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_GeofenceBackgroundTask Member List

This is the complete list of members for Scenario5_GeofenceBackgroundTask, including all inherited members.
BackgroundTaskEntryPoint | Scenario5_GeofenceBackgroundTask | [private, static]
BackgroundTaskName | Scenario5_GeofenceBackgroundTask | [private, static]
FillEventListBoxWithExistingEvents() | Scenario5_GeofenceBackgroundTask | [private]
OnCompleted(Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e) | Scenario5_GeofenceBackgroundTask | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario5_GeofenceBackgroundTask |
RegisterBackgroundTask(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_GeofenceBackgroundTask |
Scenario5_GeofenceBackgroundTask() | Scenario5_GeofenceBackgroundTask |
UnregisterBackgroundTask(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_GeofenceBackgroundTask |
UpdateButtonStates() | Scenario5_GeofenceBackgroundTask | [private]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/LookupTable.h Source File

  • CameraFrames
  • cpp

LookupTable.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace SDKTemplate
00015 {
00016     template<typename T, UINT32 LookupTableSize>
00017     class LookupTable
00018     {
00019     public:
00020
00021         // Function type for lookup table generation.
00022         typedef std::function<T(UINT32, UINT32)> LookupTableGenerator;
00023
00024         /// <summary>
00025         /// The values of the lookup table are generated using a function passed into the constructor.
00026         /// </summary>
00027         LookupTable(LookupTableGenerator Generator)
00028         {
00029             for (int i = 0; i < LookupTableSize; i++)
00030             {
00031                 // Generate values for lookup table
00032                 m_lookuptable[i] = Generator(i, LookupTableSize);
00033             }
00034         }
00035
00036         T GetValue(float value)
00037         {
00038             int index = static_cast<int>(value * LookupTableSize);
00039             index = min(max(0, index), LookupTableSize - 1);
00040             return m_lookuptable[index];
00041         }
00042
00043     private:
00044         T m_lookuptable[LookupTableSize];
00045     };
00046 } // SDKTemplate
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cpp/Scenario3_Text.xaml.cpp Source File

  • FileAccess
  • cpp

Scenario3_Text.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_Text.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Storage;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 Scenario3::Scenario3() : rootPage(MainPage::Current)
00024 {
00025     InitializeComponent();
00026 }
00027
00028 void Scenario3::OnNavigatedTo(NavigationEventArgs^ e)
00029 {
00030     rootPage->ValidateFile();
00031 }
00032
00033 void Scenario3::WriteTextButton_Click(Object^ sender, RoutedEventArgs^ e)
00034 {
00035     StorageFile^ file = rootPage->SampleFile;
00036     if (file != nullptr)
00037     {
00038         String^ userContent = InputTextBox->Text;
00039         create_task(FileIO::WriteTextAsync(file, userContent)).then([this, file, userContent](task<void> task)
00040         {
00041             try
00042             {
00043                 task.get();
00044                 rootPage->NotifyUser("The following text was written to '" + file->Name + "':\n" + userContent, NotifyType::StatusMessage);
00045             }
00046             catch (COMException^ ex)
00047             {
00048                 // I/O errors are reported as exceptions.
00049                 rootPage->HandleIoException(ex, "Error writing to '" + file->Name + "'");
00050             }
00051         });
00052     }
00053     else
00054     {
00055         rootPage->NotifyUserFileNotExist();
00056     }
00057 }
00058
00059 void Scenario3::ReadTextButton_Click(Object^ sender, RoutedEventArgs^ e)
00060 {
00061     StorageFile^ file = rootPage->SampleFile;
00062     if (file != nullptr)
00063     {
00064         create_task(FileIO::ReadTextAsync(file)).then([this, file](task<String^> task)
00065         {
00066             try
00067             {
00068                 String^ fileContent = task.get();
00069                 rootPage->NotifyUser("The following text was read from '" + file->Name + "':\n" + fileContent, NotifyType::StatusMessage);
00070             }
00071             catch (COMException^ ex)
00072             {
00073                 if (ex->HResult == HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
00074                 {
00075                     rootPage->NotifyUser("File could not be decoded as Unicode.", NotifyType::ErrorMessage);
00076                 }
00077                 else
00078                 {
00079                     rootPage->HandleIoException(ex, "Error reading from '" + file->Name + "'");
00080                 }
00081             }
00082         });
00083     }
00084     else
00085     {
00086         rootPage->NotifyUserFileNotExist();
00087     }
00088 }
Generated on Fri Nov 15 2024 22:19:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_GetDeviceInformation Member List

This is the complete list of members for Scenario1_GetDeviceInformation, including all inherited members.
Launch_Click(object sender, RoutedEventArgs e) | Scenario1_GetDeviceInformation | [inline, private]
Reset_Click(object sender, RoutedEventArgs e) | Scenario1_GetDeviceInformation | [inline, private]
rootPage | Scenario1_GetDeviceInformation | [private]
Scenario1_GetDeviceInformation() | Scenario1_GetDeviceInformation | [inline]
Generated on Fri Nov 15 2024 22:23:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_SymbologyAttributes Member List

This is the complete list of members for Scenario4_SymbologyAttributes, including all inherited members.
claimedScanner_DataReceived(Windows::Devices::PointOfService::ClaimedBarcodeScanner const &, Windows::Devices::PointOfService::BarcodeScannerDataReceivedEventArgs args) | Scenario4_SymbologyAttributes | [private]
claimedScanner_ReleaseDeviceRequested(Windows::Foundation::IInspectable const &, Windows::Devices::PointOfService::ClaimedBarcodeScanner const &args) | Scenario4_SymbologyAttributes | [private]
m_scannerDataReceivedToken | Scenario4_SymbologyAttributes | [private]
m_scannerReleaseRequestedToken | Scenario4_SymbologyAttributes | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_SymbologyAttributes |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_SymbologyAttributes |
ResetTheScenarioState() | Scenario4_SymbologyAttributes | [private]
Scenario4_SymbologyAttributes() | Scenario4_SymbologyAttributes |
ScenarioEndScanButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_SymbologyAttributes |
ScenarioStartScanButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_SymbologyAttributes |
SetSymbologyAttributes_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_SymbologyAttributes |
SymbologySelection_Changed(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &) | Scenario4_SymbologyAttributes |
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraVideoStabilization/cpp/pch.cpp Source File

  • CameraVideoStabilization
  • cpp

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013
00014 #define USE_VS_RECOMMENDATION
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/VertexShader/pch.cpp Source File

  • D2DCustomEffects
  • cpp
  • VertexShader

pch.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cs/Scenario6_Properties.xaml.cs Source File

  • FileAccess
  • cs

Scenario6_Properties.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using System.Text;
00016 using Windows.Storage;
00017 using Windows.Storage.FileProperties;
00018 using Windows.UI.Xaml;
00019 using Windows.UI.Xaml.Controls;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     /// <summary>
00025     /// Displaying file properties.
00026     /// </summary>
00027     public sealed partial class Scenario6 : Page
00028     {
00029         MainPage rootPage = MainPage.Current;
00030
00031         static readonly string dateAccessedProperty = "System.DateAccessed";
00032         static readonly string fileOwnerProperty    = "System.FileOwner";
00033
00034         public Scenario6()
00035         {
00036             this.InitializeComponent();
00037         }
00038
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041             rootPage.ValidateFile();
00042         }
00043
00044         private async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
00045         {
00046             StorageFile file = rootPage.sampleFile;
00047             if (file != null)
00048             {
00049                 try
00050                 {
00051                     // Get top level file properties
00052                     StringBuilder outputText = new StringBuilder();
00053                     outputText.AppendLine($"File name: {file.Name}");
00054                     outputText.AppendLine($"File type: {file.FileType}");
00055
00056                     // Get basic properties
00057                     BasicProperties basicProperties = await file.GetBasicPropertiesAsync();
00058                     outputText.AppendLine($"File size: {basicProperties.Size} bytes");
00059                     outputText.AppendLine($"Date modified: {basicProperties.DateModified}");
00060
00061                     // Get extra properties
00062                     IDictionary<string, object> extraProperties = await file.Properties.RetrievePropertiesAsync(new[] { dateAccessedProperty, fileOwnerProperty });
00063                     var propValue = extraProperties[dateAccessedProperty];
00064                     if (propValue != null)
00065                     {
00066                         outputText.AppendLine($"Date accessed: {propValue}");
00067                     }
00068                     propValue = extraProperties[fileOwnerProperty];
00069                     if (propValue != null)
00070                     {
00071                         outputText.Append($"File owner: {propValue}");
00072                     }
00073
00074                     rootPage.NotifyUser(outputText.ToString(), NotifyType.StatusMessage);
00075                 }
00076                 catch (FileNotFoundException)
00077                 {
00078                     rootPage.NotifyUserFileNotExist();
00079                 }
00080                 catch (Exception ex)
00081                 {
00082                     // I/O errors are reported as exceptions.
00083                     rootPage.NotifyUser($"Error retrieving properties for '{file.Name}': {ex.Message}", NotifyType.ErrorMessage);
00084                 }
00085             }
00086             else
00087             {
00088                 rootPage.NotifyUserFileNotExist();
00089             }
00090         }
00091     }
00092 }
Generated on Fri Nov 15 2024 22:19:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/SampleConfiguration.cpp Source File

  • UserDataAccountManager
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017 using namespace Concurrency;
00018
00019 using namespace Platform;
00020 using namespace Platform::Collections;
00021 using namespace Windows::ApplicationModel::UserDataAccounts;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::UI::Xaml::Controls;
00024
00025 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00026 {
00027     { "Add an account", "SDKTemplate.Scenario1_AddAccount" },
00028     { "Manage an account", "SDKTemplate.Scenario2_ManageAccount" },
00029     { "Resolve errors for an account", "SDKTemplate.Scenario3_FixAccount" }
00030 };
00031
00032 task<void> MainPage::LoadDataAccountsAsync(ComboBox^ comboBox)
00033 {
00034     // Requires the email, contacts, or appointments capability in the app's manifest.
00035     return create_task(UserDataAccountManager::RequestStoreAsync(UserDataAccountStoreAccessType::AllAccountsReadOnly))
00036         .then([this, comboBox](UserDataAccountStore^ store)
00037     {
00038         if (store != nullptr)
00039         {
00040             return create_task(store->FindAccountsAsync()).then([this, comboBox](IVectorView<UserDataAccount^>^ accounts)
00041             {
00042                 auto userDataAccounts = ref new Vector<UserDataAccountViewModel^>();
00043                 for (UserDataAccount^ account : accounts)
00044                 {
00045                     userDataAccounts->Append(ref new UserDataAccountViewModel(account));
00046                 }
00047
00048                 comboBox->DataContext = userDataAccounts;
00049
00050                 if (userDataAccounts->Size > 0)
00051                 {
00052                     comboBox->SelectedIndex = 0;
00053                 }
00054             });
00055         }
00056         else
00057         {
00058             // If the store is null, that means all access to Contacts, Calendar and Email data
00059             // has been revoked.
00060             NotifyUser("Access to Contacts, Calendar and Email has been revoked", NotifyType::ErrorMessage);
00061             return create_task([] {});
00062         }
00063     });
00064 }
Generated on Fri Nov 15 2024 22:17:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/MasterDetailPage.h Source File

  • XamlMasterDetail
  • cppwinrt

MasterDetailPage.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "MasterDetailPage.g.h"
00014
00015 namespace winrt::MasterDetailApp::implementation
00016 {
00017     struct MasterDetailPage : MasterDetailPageT<MasterDetailPage>
00018     {
00019         MasterDetailPage();
00020
00021         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00022
00023         // These methods are public so they can be called by binding.
00024         void LayoutRoot_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void AdaptiveStates_CurrentStateChanged(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::VisualStateChangedEventArgs const& e);
00026         void MasterListView_ItemClick(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Controls::ItemClickEventArgs const& e);
00027
00028     private:
00029         Windows::Foundation::Collections::IVector<MasterDetailApp::ViewModels::ItemViewModel> m_items;
00030         MasterDetailApp::ViewModels::ItemViewModel m_lastSelectedItem{ nullptr };
00031
00032         void UpdateForVisualState(Windows::UI::Xaml::VisualState const& newState, Windows::UI::Xaml::VisualState const& oldState = nullptr);
00033         void EnableContentTransitions();
00034         void DisableContentTransitions();
00035     };
00036 }
00037
00038 namespace winrt::MasterDetailApp::factory_implementation
00039 {
00040     struct MasterDetailPage : MasterDetailPageT<MasterDetailPage, implementation::MasterDetailPage>
00041     {
00042     };
00043 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_DefiningCustomGlyphs Member List

This is the complete list of members for Scenario5_DefiningCustomGlyphs, including all inherited members.
CreateSolidGlyphBuffer(int widthInPixels, int heightInPixels) | Scenario5_DefiningCustomGlyphs | [inline, private]
DefineGlyphButton_Click(object sender, RoutedEventArgs e) | Scenario5_DefiningCustomGlyphs | [inline, private]
glyphBuffer | Scenario5_DefiningCustomGlyphs | [private]
InitializeAsync() | Scenario5_DefiningCustomGlyphs | [inline, private]
IsNonNull(object item) | Scenario5_DefiningCustomGlyphs |
lineDisplay | Scenario5_DefiningCustomGlyphs | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario5_DefiningCustomGlyphs | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario5_DefiningCustomGlyphs | [inline, protected]
ResetButton_Click(object sender, RoutedEventArgs e) | Scenario5_DefiningCustomGlyphs | [inline, private]
rootPage | Scenario5_DefiningCustomGlyphs | [private]
Scenario5_DefiningCustomGlyphs() | Scenario5_DefiningCustomGlyphs | [inline]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundSensors/cpp/pch.cpp Source File

  • BackgroundSensors
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileAccess/cppwinrt/Scenario10.h Source File

  • FileAccess
  • cppwinrt

Scenario10.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario10.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario10 : Scenario10T<Scenario10>
00020     {
00021         Scenario10();
00022
00023         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00024         fire_and_forget DeleteFileButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario10 : Scenario10T<Scenario10, implementation::Scenario10>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:19:40 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MixedRealityModel/cs/Scenario1_CreateTile.xaml.cs Source File

  • MixedRealityModel
  • cs

Scenario1_CreateTile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Numerics;
00014 using System.Threading.Tasks;
00015 using Windows.ApplicationModel.Preview.Holographic;
00016 using Windows.Perception.Spatial;
00017 using Windows.Storage;
00018 using Windows.Storage.Pickers;
00019 using Windows.UI.StartScreen;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022
00023 namespace SDKTemplate
00024 {
00025     public sealed partial class Scenario1_CreateTile : Page
00026     {
00027         MainPage rootPage = MainPage.Current;
00028         string glbName = string.Empty;
00029         Uri glbUri;
00030
00031         string lastFileName = string.Empty;
00032         Uri lastFileUri;
00033
00034         public Scenario1_CreateTile()
00035         {
00036             this.InitializeComponent();
00037             GetFromPackage();
00038         }
00039
00040         void UpdateSourceRun()
00041         {
00042             if (GlbSourceRun != null)
00043             {
00044                 GlbSourceRun.Text = glbUri == null ? String.Empty : glbUri.OriginalString;
00045             }
00046         }
00047
00048         void GetFromPackage()
00049         {
00050             glbUri = new Uri("ms-appx:///glb/microsoft-logo.glb");
00051             glbName = "Microsoft logo";
00052             UpdateSourceRun();
00053         }
00054
00055         void GetFromFile()
00056         {
00057             glbUri = lastFileUri;
00058             glbName = lastFileName;
00059             UpdateSourceRun();
00060         }
00061
00062         async void PickFile()
00063         {
00064             var picker = new FileOpenPicker();
00065             picker.ViewMode = PickerViewMode.Thumbnail;
00066             picker.SuggestedStartLocation = PickerLocationId.Objects3D;
00067             picker.FileTypeFilter.Add(".glb");
00068
00069             var file = await picker.PickSingleFileAsync();
00070             if (file == null)
00071             {
00072                 return;
00073             }
00074
00075             // ms-appdata content must be of the form ms-appdata:///local/...
00076             // Copy the picked file into our local folder.
00077
00078             const string SpecialFolder = "tilecontent";
00079             try
00080             {
00081                 StorageFolder folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(SpecialFolder,
00082                     CreationCollisionOption.OpenIfExists);
00083                 file = await file.CopyAsync(folder, file.Name, NameCollisionOption.ReplaceExisting);
00084             }
00085             catch
00086             {
00087                 // File I/O errors are reported as exceptions.
00088                 rootPage.NotifyUser("Could not copy file to local storage.", NotifyType.ErrorMessage);
00089                 return;
00090             }
00091
00092             // Escape the file name in case it contains special characters.
00093             lastFileUri = new Uri($"ms-appdata:///local/{SpecialFolder}/{Uri.EscapeDataString(file.Name)}");
00094             lastFileName = file.DisplayName;
00095             glbUri = lastFileUri;
00096             glbName = lastFileName;
00097             UpdateSourceRun();
00098         }
00099
00100         string GenerateTileId()
00101         {
00102             // Tile IDs consist of up to 64 alphanumerics, underscore, and period.
00103             // Create a guid to use as a unique tile id. Use "N" format so it consists
00104             // solely of hex digits with no extra punctuation.
00105             Guid guid = Guid.NewGuid();
00106             return guid.ToString("N");
00107         }
00108
00109         float ParseFloatOrDefault(string input)
00110         {
00111             float parsed = 0.0f;
00112             float.TryParse(input, out parsed);
00113             return parsed;
00114         }
00115
00116         async void CreateSecondaryTile()
00117         {
00118             rootPage.NotifyUser("", NotifyType.StatusMessage);
00119
00120             if (glbUri == null)
00121             {
00122                 rootPage.NotifyUser("Please pick content to be shown.", NotifyType.ErrorMessage);
00123                 return;
00124             }
00125
00126             // Create a guid to use as a unique tile id
00127             string tileId = GenerateTileId();
00128
00129             var logoUri = new Uri("ms-appx:///Assets/squareTile-sdk.png");
00130             var tile = new SecondaryTile(
00131                     tileId, // TileId
00132                     glbName, // Display Name
00133                     tileId, // Arguments
00134                     logoUri, // Square150x150Logo
00135                     TileSize.Square150x150); // DesiredSize
00136
00137             // Set the mixed reality model properties.
00138             TileMixedRealityModel model = tile.VisualElements.MixedRealityModel;
00139
00140             model.Uri = glbUri;
00141
00142             if (BoundingBoxCheckBox.IsChecked.Value)
00143             {
00144                 var boundingBox = new SpatialBoundingBox();
00145                 boundingBox.Center = new Vector3(
00146                     ParseFloatOrDefault(BoundingBoxCenterXTextBox.Text),
00147                     ParseFloatOrDefault(BoundingBoxCenterYTextBox.Text),
00148                     ParseFloatOrDefault(BoundingBoxCenterZTextBox.Text));
00149                 boundingBox.Extents = new Vector3(
00150                     ParseFloatOrDefault(BoundingBoxExtentsXTextBox.Text),
00151                     ParseFloatOrDefault(BoundingBoxExtentsYTextBox.Text),
00152                     ParseFloatOrDefault(BoundingBoxExtentsZTextBox.Text));
00153                 model.BoundingBox = boundingBox;
00154             }
00155
00156             // Create the tile
00157             bool created = await tile.RequestCreateAsync();
00158             if (created)
00159             {
00160                 // Warn the user that they need to be in the headset for anything interesting to happen.
00161                 if (!HolographicApplicationPreview.IsCurrentViewPresentedOnHolographicDisplay())
00162                 {
00163                     rootPage.NotifyUser("3D content can be created only while the view is being displayed in a Mixed Reality headset.", NotifyType.StatusMessage);
00164                 }
00165             }
00166             else
00167             {
00168                 rootPage.NotifyUser("Could not create secondary tile.", NotifyType.ErrorMessage);
00169             }
00170         }
00171     }
00172 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/pch.h Source File

  • JapanesePhoneticAnalysis
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDragAndDrop/cpp/pch.h Source File

  • XamlDragAndDrop
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009 #include <random>
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DCustomEffects/cpp/PixelShader/BasicReaderWriter.h Source File

  • D2DCustomEffects
  • cpp
  • PixelShader

BasicReaderWriter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include <ppltasks.h>
00015
00016 // A simple reader/writer class that provides support for reading and writing
00017 // files on disk. Provides synchronous and asynchronous methods.
00018 ref class BasicReaderWriter
00019 {
00020 private:
00021     Windows::Storage::StorageFolder^ m_location;
00022
00023 internal:
00024     BasicReaderWriter();
00025     BasicReaderWriter(
00026         _In_ Windows::Storage::StorageFolder^ folder
00027         );
00028
00029     Platform::Array<byte>^ ReadData(
00030         _In_ Platform::String^ filename
00031         );
00032
00033     concurrency::task<Platform::Array<byte>^> ReadDataAsync(
00034         _In_ Platform::String^ filename
00035         );
00036
00037     uint32 WriteData(
00038         _In_ Platform::String^ filename,
00039         _In_ const Platform::Array<byte>^ fileData
00040         );
00041
00042     concurrency::task<void> WriteDataAsync(
00043         _In_ Platform::String^ filename,
00044         _In_ const Platform::Array<byte>^ fileData
00045         );
00046 };
Generated on Fri Nov 15 2024 22:19:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LowLatencyInput/cpp/Content/RectRenderer.h Source File

  • LowLatencyInput
  • cpp
  • Content

RectRenderer.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "..\Common\DeviceResources.h"
00015 #include "..\Common\Constants.h"
00016
00017 namespace SDKTemplate
00018 {
00019     // This sample renderer instantiates a basic rendering pipeline.
00020     class RectRenderer
00021     {
00022
00023     public:
00024         RectRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00025         void CreateDeviceDependentResources();
00026         void ReleaseDeviceDependentResources();
00027         void Render();
00028         void UpdateRectTransform(Windows::Foundation::Point newPosition, Windows::UI::Input::ManipulationDelta newDelta);
00029         bool HitTest( Windows::Foundation::Point position);
00030         void SetRectSize(float newSize);
00031         void ResetRect();
00032         void SetBrushColor(D2D1::ColorF newColor);
00033
00034     private:
00035         // Cached pointer to device resources.
00036         std::shared_ptr<DX::DeviceResources> deviceResources;
00037
00038         // A brush with which to draw the rect.
00039         Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush;
00040
00041         // The rect to be drawn.
00042         D2D1_RECT_F rect;
00043
00044         //The rect's width/height
00045         float rectSize;
00046
00047         //Maintains the transform of the rect
00048         D2D1::Matrix3x2F rectTransform;
00049     };
00050 }
00051
Generated on Fri Nov 15 2024 22:20:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario07_PostStreamWithProgress Member List

This is the complete list of members for Scenario07_PostStreamWithProgress, including all inherited members.
Cancel_Click(object sender, RoutedEventArgs e) | Scenario07_PostStreamWithProgress | [inline, private]
ChunkedResponseToggle_Toggled(object sender, RoutedEventArgs e) | Scenario07_PostStreamWithProgress | [inline, private]
cts | Scenario07_PostStreamWithProgress | [private]
httpClient | Scenario07_PostStreamWithProgress | [private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario07_PostStreamWithProgress | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario07_PostStreamWithProgress | [inline, protected]
ProgressHandler(HttpProgress progress) | Scenario07_PostStreamWithProgress | [inline, private]
ResetFields() | Scenario07_PostStreamWithProgress | [inline, private]
rootPage | Scenario07_PostStreamWithProgress | [private]
Scenario07_PostStreamWithProgress() | Scenario07_PostStreamWithProgress | [inline]
Start_Click(object sender, RoutedEventArgs e) | Scenario07_PostStreamWithProgress | [inline, private]
UpdateAddressField() | Scenario07_PostStreamWithProgress | [inline, private]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/Scenario5.xaml.h Source File

  • StreamSocket
  • cpp

Scenario5.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario5.xaml.h
00014 // Declaration of the Scenario5 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario5.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     namespace StreamSocketSample
00026     {
00027         /// <summary>
00028         /// An empty page that can be used on its own or navigated to within a Frame.
00029         /// </summary>
00030         [Windows::Foundation::Metadata::WebHostHidden]
00031         public ref class Scenario5 sealed
00032         {
00033         public:
00034             Scenario5();
00035
00036         protected:
00037             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00038         private:
00039             static const int continueButtonId = 1;
00040             static const int abortButtonId = 0;
00041             MainPage^ rootPage;
00042             void ConnectSocket_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00043             void ConnectSocketWithRetry(Windows::Networking::HostName^ hostName, Platform::String^ serviceName);
00044             concurrency::task<void> ConnectSocketWithRetryHandleSslErrorAsync(
00045                 Windows::Networking::Sockets::StreamSocket^ socket,
00046                 Windows::Networking::HostName^ hostName,
00047                 Platform::String^ serviceName);
00048             concurrency::task<bool> ShouldIgnoreCertificateErrorsAsync(
00049                 Windows::Foundation::Collections::IVectorView<
00050                 Windows::Security::Cryptography::Certificates::ChainValidationResult>^ serverCertificateErrors);
00051             Platform::String^ GetCertificateInformation(
00052                 Windows::Security::Cryptography::Certificates::Certificate^ serverCert,
00053                 Windows::Foundation::Collections::IVectorView<
00054                 Windows::Security::Cryptography::Certificates::Certificate^>^ intermediateCertificates);
00055         };
00056     }
00057 }
Generated on Fri Nov 15 2024 22:18:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/Scenario1_DisplayDepthColorIR.xaml.cpp Source File

  • CameraFrames
  • cpp

Scenario1_DisplayDepthColorIR.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario1_DisplayDepthColorIR.xaml.h"
00014 #include "FrameRenderer.h"
00015 #include <unordered_set>
00016
00017 using namespace SDKTemplate;
00018
00019 using namespace concurrency;
00020 using namespace Platform;
00021 using namespace Platform::Collections;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::Graphics::Imaging;
00025 using namespace Windows::Media::Capture;
00026 using namespace Windows::Media::Capture::Frames;
00027 using namespace Windows::UI::Xaml::Media::Imaging;
00028
00029 Scenario1_DisplayDepthColorIR::Scenario1_DisplayDepthColorIR()
00030 {
00031     InitializeComponent();
00032
00033     m_logger = ref new SimpleLogger(outputTextBlock);
00034
00035     m_frameRenderers[MediaFrameSourceKind::Color] = ref new FrameRenderer(colorPreviewImage);
00036     m_frameRenderers[MediaFrameSourceKind::Depth] = ref new FrameRenderer(depthPreviewImage);
00037     m_frameRenderers[MediaFrameSourceKind::Infrared] = ref new FrameRenderer(infraredPreviewImage);
00038 }
00039
00040 void Scenario1_DisplayDepthColorIR::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00041 {
00042     PickNextMediaSourceAsync();
00043 }
00044
00045 void Scenario1_DisplayDepthColorIR::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00046 {
00047     CleanupMediaCaptureAsync();
00048 }
00049
00050 void Scenario1_DisplayDepthColorIR::NextButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00051 {
00052     PickNextMediaSourceAsync();
00053 }
00054
00055 task<void> Scenario1_DisplayDepthColorIR::PickNextMediaSourceAsync()
00056 {
00057     NextButton->IsEnabled = false;
00058     return PickNextMediaSourceWorkerAsync()
00059         .then([this]()
00060     {
00061         NextButton->IsEnabled = true;
00062     }, task_continuation_context::use_current());
00063 }
00064
00065 task<void> Scenario1_DisplayDepthColorIR::PickNextMediaSourceWorkerAsync()
00066 {
00067     return CleanupMediaCaptureAsync()
00068         .then([this]()
00069     {
00070         return create_task(MediaFrameSourceGroup::FindAllAsync());
00071     }, task_continuation_context::get_current_winrt_context())
00072         .then([this](IVectorView<MediaFrameSourceGroup^>^ allGroups)
00073     {
00074         if (allGroups->Size == 0)
00075         {
00076             m_logger->Log("No source groups found.");
00077             return task_from_result();
00078         }
00079
00080         // Pick next group in the array after each time the Next button is clicked.
00081         m_selectedSourceGroupIndex = (m_selectedSourceGroupIndex + 1) % allGroups->Size;
00082         MediaFrameSourceGroup^ selectedGroup = allGroups->GetAt(m_selectedSourceGroupIndex);
00083
00084         m_logger->Log("Found " + allGroups->Size.ToString() + " groups and " +
00085             "selecting index [" + m_selectedSourceGroupIndex.ToString() + "] : " +
00086             selectedGroup->DisplayName);
00087
00088         // Initialize MediaCapture with selected group.
00089         return TryInitializeMediaCaptureAsync(selectedGroup)
00090             .then([this, selectedGroup](bool initialized)
00091         {
00092             if (!initialized)
00093             {
00094                 return CleanupMediaCaptureAsync();
00095             }
00096
00097             // Set up frame readers, register event handlers and start streaming.
00098             auto startedKinds = std::make_shared<std::unordered_set<MediaFrameSourceKind>>();
00099             task<void> createReadersTask = task_from_result();
00100             for (IKeyValuePair<String^, MediaFrameSource^>^ kvp : m_mediaCapture->FrameSources)
00101             {
00102                 MediaFrameSource^ source = kvp->Value;
00103                 createReadersTask = createReadersTask.then([this, startedKinds, source]()
00104                 {
00105                     MediaFrameSourceKind kind = source->Info->SourceKind;
00106
00107                     // Ignore this source if we already have a source of this kind.
00108                     if (startedKinds->find(kind) != startedKinds->end())
00109                     {
00110                         return task_from_result();
00111                     }
00112
00113                     // Look for a format which the FrameRenderer can render.
00114                     String^ requestedSubtype = nullptr;
00115                     auto found = std::find_if(begin(source->SupportedFormats), end(source->SupportedFormats),
00116                         [&](MediaFrameFormat^ format)
00117                     {
00118                         requestedSubtype = FrameRenderer::GetSubtypeForFrameReader(kind, format);
00119                         return requestedSubtype != nullptr;
00120                     });
00121                     if (requestedSubtype == nullptr)
00122                     {
00123                         // No acceptable format was found. Ignore this source.
00124                         return task_from_result();
00125                     }
00126
00127                     // Tell the source to use the format we can render.
00128                     return create_task(source->SetFormatAsync(*found))
00129                         .then([this, source, requestedSubtype]()
00130                     {
00131                         return create_task(m_mediaCapture->CreateFrameReaderAsync(source, requestedSubtype));
00132                     }, task_continuation_context::get_current_winrt_context())
00133                         .then([this, kind](MediaFrameReader^ frameReader)
00134                     {
00135                         EventRegistrationToken token = frameReader->FrameArrived +=
00136                             ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(this, &Scenario1_DisplayDepthColorIR::FrameReader_FrameArrived);
00137
00138                         // Keep track of created reader and event handler so it can be stopped later.
00139                         m_readers.push_back(std::make_pair(frameReader, token));
00140
00141                         m_logger->Log(kind.ToString() + " reader created");
00142
00143                         return create_task(frameReader->StartAsync());
00144                     }, task_continuation_context::get_current_winrt_context())
00145                         .then([this, kind, startedKinds](MediaFrameReaderStartStatus status)
00146                     {
00147                         if (status == MediaFrameReaderStartStatus::Success)
00148                         {
00149                             m_logger->Log("Started " + kind.ToString() + " reader.");
00150                             startedKinds->insert(kind);
00151                         }
00152                         else
00153                         {
00154                             m_logger->Log("Unable to start " + kind.ToString() + "  reader. Error: " + status.ToString());
00155                         }
00156                     }, task_continuation_context::get_current_winrt_context());
00157                 }, task_continuation_context::get_current_winrt_context());
00158             }
00159             // Run the loop and see if any sources were used.
00160             return createReadersTask.then([this, startedKinds, selectedGroup]()
00161             {
00162                 if (startedKinds->size() == 0)
00163                 {
00164                     m_logger->Log("No eligible sources in " + selectedGroup->DisplayName + ".");
00165                 }
00166             }, task_continuation_context::get_current_winrt_context());
00167         }, task_continuation_context::get_current_winrt_context());
00168     }, task_continuation_context::get_current_winrt_context());
00169 }
00170
00171 task<bool> Scenario1_DisplayDepthColorIR::TryInitializeMediaCaptureAsync(MediaFrameSourceGroup^ group)
00172 {
00173     if (m_mediaCapture != nullptr)
00174     {
00175         // Already initialized.
00176         return task_from_result(true);
00177     }
00178
00179     // Initialize mediacapture with the source group.
00180     m_mediaCapture = ref new MediaCapture();
00181
00182     auto settings = ref new MediaCaptureInitializationSettings();
00183
00184     // Select the source we will be reading from.
00185     settings->SourceGroup = group;
00186
00187     // This media capture can share streaming with other apps.
00188     settings->SharingMode = MediaCaptureSharingMode::SharedReadOnly;
00189
00190     // Only stream video and don't initialize audio capture devices.
00191     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00192
00193     // Set to CPU to ensure frames always contain CPU SoftwareBitmap images,
00194     // instead of preferring GPU D3DSurface images.
00195     settings->MemoryPreference = MediaCaptureMemoryPreference::Cpu;
00196
00197     // Only stream video and don't initialize audio capture devices.
00198     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00199
00200     // Initialize MediaCapture with the specified group.
00201     // This must occur on the UI thread because some device families
00202     // (such as Xbox) will prompt the user to grant consent for the
00203     // app to access cameras.
00204     // This can raise an exception if the source no longer exists,
00205     // or if the source could not be initialized.
00206     return create_task(m_mediaCapture->InitializeAsync(settings))
00207         .then([this](task<void> initializeMediaCaptureTask)
00208     {
00209         try
00210         {
00211             // Get the result of the initialization. This call will throw if initialization failed
00212             // This pattern is docuemnted at https://msdn.microsoft.com/en-us/library/dd997692.aspx
00213             initializeMediaCaptureTask.get();
00214             m_logger->Log("MediaCapture is successfully initialized in shared mode.");
00215             return true;
00216         }
00217         catch (Exception^ exception)
00218         {
00219             m_logger->Log("Failed to initialize media capture: " + exception->Message);
00220             return false;
00221         }
00222     });
00223 }
00224
00225 /// Unregisters FrameArrived event handlers, stops and disposes frame readers
00226 /// and disposes the MediaCapture object.
00227 task<void> Scenario1_DisplayDepthColorIR::CleanupMediaCaptureAsync()
00228 {
00229     task<void> cleanupTask = task_from_result();
00230
00231     if (m_mediaCapture != nullptr)
00232     {
00233         for (auto& readerAndToken : m_readers)
00234         {
00235             MediaFrameReader^ reader = readerAndToken.first;
00236             EventRegistrationToken token = readerAndToken.second;
00237
00238             reader->FrameArrived -= token;
00239             cleanupTask = cleanupTask && create_task(reader->StopAsync());
00240         }
00241         m_readers.clear();
00242         m_mediaCapture = nullptr;
00243     }
00244     return cleanupTask;
00245 }
00246
00247 void Scenario1_DisplayDepthColorIR::FrameReader_FrameArrived(MediaFrameReader^ sender, MediaFrameArrivedEventArgs^ args)
00248 {
00249     // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
00250     // This can return null if there is no such frame, or if the reader is not in the
00251     // "Started" state. The latter can occur if a FrameArrived event was in flight
00252     // when the reader was stopped.
00253     if (MediaFrameReference^ frame = sender->TryAcquireLatestFrame())
00254     {
00255         if (frame != nullptr)
00256         {
00257             m_frameRenderers[frame->SourceKind]->ProcessFrame(frame);
00258         }
00259     }
00260 }
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraProfile/cs/Scenario3_EnableHdrProfile.xaml.cs Source File

  • CameraProfile
  • cs

Scenario3_EnableHdrProfile.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace CameraProfile
00013 {
00014     using System;
00015     using System.Collections.Generic;
00016     using System.Globalization;
00017     using Windows.Devices.Enumeration;
00018     using Windows.Media.Capture;
00019     using Windows.UI.Xaml.Controls;
00020     using Windows.UI.Xaml.Navigation;
00021     using SDKTemplate;
00022     using System.Threading.Tasks;
00023
00024
00025     /// <summary>
00026     /// EnableHDRProfile page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public sealed partial class Scenario3_EnableHdrProfile : Page
00029     {
00030         /// <summary>
00031         /// Private MainPage object for status updates
00032         /// </summary>
00033         private MainPage rootPage;
00034
00035         /// <summary>
00036         /// Initializes a new instance of the <see cref="Scenario3_EnableHdrProfile"/> class.
00037         /// </summary>
00038         public Scenario3_EnableHdrProfile()
00039         {
00040             this.InitializeComponent();
00041         }
00042
00043         /// <summary>
00044         /// Override default OnNavigateTo to initialize
00045         /// the rootPage object for Status message updates
00046         /// </summary>
00047         /// <param name="e">Contains state information and event data associated with the event</param>
00048         protected override void OnNavigatedTo(NavigationEventArgs e)
00049         {
00050             rootPage = MainPage.Current;
00051         }
00052
00053         /// <summary>
00054         /// Finds the video profiles for the back camera. Then queries for a profile that supports
00055         /// HDR video recording. If a HDR supported video profile is located, then we configure media settings to the
00056         /// matching profile. Finally we initialize media capture HDR recording mode to auto.
00057         /// </summary>
00058         /// <param name="sender">Contains information regarding button that fired event</param>
00059         /// <param name="e">Contains state information and event data associated with the event</param>
00060         private async void CheckHdrSupportBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00061         {
00062             string videoDeviceId = string.Empty;
00063             bool HdrVideoSupported = false;
00064             MediaCapture mediaCapture = new MediaCapture();
00065             MediaCaptureInitializationSettings mediaCaptureInitSetttings = new MediaCaptureInitializationSettings();
00066
00067             // Select the first video capture device found on the back of the device
00068             await LogStatusToOutputBox("Querying for video capture device on back of the device that supports Video Profile");
00069             videoDeviceId = await GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel.Back);
00070
00071             if (string.IsNullOrEmpty(videoDeviceId))
00072             {
00073                 await LogStatus("ERROR: No Video Device Id found, verify your device supports profiles", NotifyType.ErrorMessage);
00074                 return;
00075             }
00076
00077             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture,
00078                 "Found device that supports Video Profile, Device Id:\r\n {0}", videoDeviceId));
00079             IReadOnlyList<MediaCaptureVideoProfile> profiles = MediaCapture.FindKnownVideoProfiles(videoDeviceId, KnownVideoProfile.VideoRecording);
00080
00081             // Walk through available profiles, look for first profile with HDR supported Video Profile
00082             foreach (MediaCaptureVideoProfile profile in profiles)
00083             {
00084                 IReadOnlyList<MediaCaptureVideoProfileMediaDescription> recordMediaDescription = profile.SupportedRecordMediaDescription;
00085                 foreach (MediaCaptureVideoProfileMediaDescription videoProfileMediaDescription in recordMediaDescription)
00086                 {
00087                     if (videoProfileMediaDescription.IsHdrVideoSupported)
00088                     {
00089                         // We've located the profile and description for HDR Video, set profile and flag
00090                         mediaCaptureInitSetttings.VideoProfile = profile;
00091                         mediaCaptureInitSetttings.RecordMediaDescription = videoProfileMediaDescription;
00092                         HdrVideoSupported = true;
00093                         await LogStatus("HDR supported video profile found, set video profile to current HDR supported profile", NotifyType.StatusMessage);
00094                         break;
00095                     }
00096                 }
00097
00098                 if (HdrVideoSupported)
00099                 {
00100                     break;
00101                 }
00102             }
00103
00104             await LogStatusToOutputBox("Initializing Media settings to HDR Supported video profile");
00105             await mediaCapture.InitializeAsync(mediaCaptureInitSetttings);
00106             if (HdrVideoSupported)
00107             {
00108                 await LogStatusToOutputBox("Initializing HDR Video Mode to Auto");
00109                 mediaCapture.VideoDeviceController.HdrVideoControl.Mode = Windows.Media.Devices.HdrVideoMode.Auto;
00110             }
00111         }
00112
00113         /// <summary>
00114         /// Helper method to obtain a device Id that supports a Video Profile.
00115         /// If no Video Profile is found we return empty string indicating that there isn't a device on
00116         /// the desired panel with a supported Video Profile.
00117         /// </summary>
00118         /// <param name="panel">Contains Device Enumeration information regarding camera panel we are looking for</param>
00119         /// <returns>Device Information Id string</returns>
00120         public async Task<string> GetVideoProfileSupportedDeviceIdAsync(Windows.Devices.Enumeration.Panel panel)
00121         {
00122             string deviceId = string.Empty;
00123
00124             // Finds all video capture devices
00125             await LogStatusToOutputBox("Looking for all video capture devices");
00126             DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
00127             await LogStatusToOutputBox(string.Format(CultureInfo.InvariantCulture, "Number of video capture devices found: {0}", devices.Count.ToString()));
00128
00129             foreach (var device in devices)
00130             {
00131                 // Check if the device on the requested panel supports Video Profile
00132                 if (MediaCapture.IsVideoProfileSupported(device.Id) && device.EnclosureLocation.Panel == panel)
00133                 {
00134                     // We've located a device that supports Video Profiles on expected panel
00135                     deviceId = device.Id;
00136                     break;
00137                 }
00138             }
00139
00140             return deviceId;
00141         }
00142
00143         /// <summary>
00144         /// Marshall log message to the UI thread
00145         /// and update outputBox, this method is for more general messages
00146         /// </summary>
00147         /// <param name="message">Message to log to the outputBox</param>
00148         private async Task LogStatusToOutputBox(string message)
00149         {
00150             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00151             {
00152                 outputBox.Text += message + "\r\n";
00153                 outputScrollViewer.ChangeView(0, outputBox.ActualHeight, 1);
00154             });
00155         }
00156
00157         /// <summary>
00158         /// Method to log Status to Main Status block,
00159         /// this method is for important status messages to be
00160         /// displayed at bottom of scenario page
00161         /// </summary>
00162         /// <param name="message">Message to log to the output box</param>
00163         /// <param name="type">Notification Type for status message</param>
00164         private async Task LogStatus(string message, NotifyType type)
00165         {
00166             await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00167             {
00168                 rootPage.NotifyUser(message, type);
00169             });
00170             await LogStatusToOutputBox(message);
00171         }
00172     }
00173 }
00174
Generated on Fri Nov 15 2024 22:18:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cs/Scenario4_TilePinned.xaml.cs Source File

  • SecondaryTiles
  • cs

Scenario4_TilePinned.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.StartScreen;
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014
00015 namespace SDKTemplate
00016 {
00017     public sealed partial class Scenario4_TilePinned : Page
00018     {
00019         MainPage rootPage = MainPage.Current;
00020
00021         public Scenario4_TilePinned()
00022         {
00023             this.InitializeComponent();
00024         }
00025
00026         private void TileExists_Click(object sender, RoutedEventArgs e)
00027         {
00028             if (SecondaryTile.Exists(MainPage.logoSecondaryTileId))
00029             {
00030                 rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is pinned.", NotifyType.StatusMessage);
00031             }
00032             else
00033             {
00034                 rootPage.NotifyUser(MainPage.logoSecondaryTileId + " is not currently pinned.", NotifyType.ErrorMessage);
00035             }
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

QuadRenderer Member List

This is the complete list of members for QuadRenderer, including all inherited members.
c_lerpRate | QuadRenderer | [private]
c_maxFadeTime | QuadRenderer | [private]
CreateDeviceDependentResources() | QuadRenderer |
GetPosition() const | QuadRenderer | [inline]
GetVelocity() const | QuadRenderer | [inline]
m_degreesPerSecond | QuadRenderer | [private]
m_deviceResources | QuadRenderer | [private]
m_fadeTime | QuadRenderer | [private]
m_fadingIn | QuadRenderer | [private]
m_geometryShader | QuadRenderer | [private]
m_indexBuffer | QuadRenderer | [private]
m_indexCount | QuadRenderer | [private]
m_inputLayout | QuadRenderer | [private]
m_lastPosition | QuadRenderer | [private]
m_loadingComplete | QuadRenderer | [private]
m_modelConstantBuffer | QuadRenderer | [private]
m_modelConstantBufferData | QuadRenderer | [private]
m_pixelShader | QuadRenderer | [private]
m_position | QuadRenderer | [private]
m_quadTexture | QuadRenderer | [private]
m_quadTextureSamplerState | QuadRenderer | [private]
m_quadTextureView | QuadRenderer | [private]
m_usingVprtShaders | QuadRenderer | [private]
m_velocity | QuadRenderer | [private]
m_vertexBuffer | QuadRenderer | [private]
m_vertexShader | QuadRenderer | [private]
QuadRenderer(const std::shared_ptr< DX::DeviceResources > &deviceResources) | QuadRenderer |
ReleaseDeviceDependentResources() | QuadRenderer |
Render(ID3D11ShaderResourceView *texture) | QuadRenderer |
Render() | QuadRenderer |
ResetPosition(Windows::Foundation::Numerics::float3 pos) | QuadRenderer | [inline]
StartFadeIn() | QuadRenderer |
StartFadeOut() | QuadRenderer |
Update(const DX::StepTimer &timer) | QuadRenderer |
UpdateHologramPosition(Windows::UI::Input::Spatial::SpatialPointerPose^pointerPose, const DX::StepTimer &timer) | QuadRenderer |
Generated on Fri Nov 15 2024 22:23:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 3DPrinting/cppwinrt/Scenario2_Launch.h Source File

  • 3DPrinting
  • cppwinrt

Scenario2_Launch.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_Launch.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_Launch : Scenario2_LaunchT<Scenario2_Launch>
00020     {
00021         Scenario2_Launch();
00022
00023         fire_and_forget CheckIf3DBuilderIsInstalled_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         fire_and_forget LaunchFileIn3DBuilder_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025
00026     private:
00027         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00028         static constexpr wchar_t PackageFamilyName3DBuilder[] = L"Microsoft.3DBuilder_8wekyb3d8bbwe";
00029     };
00030 }
00031
00032 namespace winrt::SDKTemplate::factory_implementation
00033 {
00034     struct Scenario2_Launch : Scenario2_LaunchT<Scenario2_Launch, implementation::Scenario2_Launch>
00035     {
00036     };
00037 }
Generated on Fri Nov 15 2024 22:17:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SecondaryTiles/cppwinrt/Scenario6_SecondaryTileNotification.h Source File

  • SecondaryTiles
  • cppwinrt

Scenario6_SecondaryTileNotification.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario6_SecondaryTileNotification.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario6_SecondaryTileNotification : Scenario6_SecondaryTileNotificationT<Scenario6_SecondaryTileNotification>
00020     {
00021         Scenario6_SecondaryTileNotification();
00022
00023         fire_and_forget PinLiveTile_Click(Windows::Foundation::IInspectable sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         void SendTileNotification_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void SendBadgeNotification_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         void SendTileNotificationWithStringManipulation_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void SendBadgeNotificationWithStringManipulation_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028
00029     private:
00030         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00031
00032         bool VerifyTileIsPinned();
00033     };
00034 }
00035
00036 namespace winrt::SDKTemplate::factory_implementation
00037 {
00038     struct Scenario6_SecondaryTileNotification : Scenario6_SecondaryTileNotificationT<Scenario6_SecondaryTileNotification, implementation::Scenario6_SecondaryTileNotification>
00039     {
00040     };
00041 }
Generated on Fri Nov 15 2024 22:21:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ComplexInk/cpp/Scenario1_CustomDry.xaml.h Source File

  • ComplexInk
  • cpp

Scenario1_CustomDry.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_CustomDry.g.h"
00015 #include "MainPage.xaml.h"
00016 #include "Renderers\SceneComposer.h"
00017 #include "Controls\ContextMenuFlyout.xaml.h"
00018 #include "Common\InkEventLogger.h"
00019
00020 namespace SDKTemplate
00021 {
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_CustomDry sealed
00024     {
00025     public:
00026         Scenario1_CustomDry();
00027         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00028     private:
00029
00030         enum PointerHitTestStates
00031         {
00032             None,
00033             InsideSelectionRect,
00034             InsideInkingArea,
00035         };
00036
00037         enum InkingAreaSubStates
00038         {
00039             AreaNone,
00040             Selecting,
00041             SelectingOrPasting,
00042             Erasing
00043         };
00044
00045         enum InputModes
00046         {
00047             InkingMode,
00048             SelectingMode,
00049             ErasingMode,
00050             InkToolbarMode
00051         };
00052
00053     private:
00054
00055         SDKTemplate::MainPage^ rootPage;
00056         std::shared_ptr<SceneComposer> _sceneComposer;
00057         Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource^ _imageSource;
00058
00059         // Inking members
00060         Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ _independentInput;
00061         // Using this object to store the configuration from InkPresenter and use it when
00062         // changing modes in the Independent Input Handler
00063         Windows::UI::Input::Inking::InkInputProcessingConfiguration^ _config;
00064
00065         // Vector of points to build the stroke that will enclose the selected strokes
00066         Windows::Foundation::Collections::IVector<Windows::Foundation::Point>^ _selectionPoints;
00067
00068         // Inking State Management
00069         InkingAreaSubStates _currentHitTestSubState;
00070         PointerHitTestStates _currentHitTestState;
00071         InputModes   _inputMode;
00072
00073         // Context Menu members
00074         ContextMenuFlyout^ _contextMenuFlyout;
00075
00076         int _pointerId;
00077
00078         // Lasso selection members
00079         Windows::UI::Input::PointerPoint^ _initialPointerPoint;
00080
00081         // Erasing
00082         Windows::Foundation::Point _prevErasingPoint;
00083
00084         // Gesture Recognizer to get gestures for cut/copy/paste scenarios
00085         Windows::UI::Input::GestureRecognizer^ _gestureRecognizer;
00086
00087         // Logging of input messages
00088         InkEventLogger* _eventLogger;
00089         bool _isLoggingEnabled;
00090
00091         // concurrency lock to have thread-safe data access across multiple threads
00092         Concurrency::critical_section _criticalSection;
00093
00094         // Event Handler Tokens
00095         Windows::Foundation::EventRegistrationToken _strokesCollectedToken;
00096
00097         Windows::Foundation::EventRegistrationToken _independentInputMovingToken;
00098         Windows::Foundation::EventRegistrationToken _independentInputPressingToken;
00099         Windows::Foundation::EventRegistrationToken _independentInputReleasingToken;
00100         Windows::Foundation::EventRegistrationToken _independentInputExitingToken;
00101         Windows::Foundation::EventRegistrationToken _independentInputEnteringToken;
00102         Windows::Foundation::EventRegistrationToken _independentInputHoveringToken;
00103         Windows::Foundation::EventRegistrationToken _independentInputLostToken;
00104
00105         Windows::Foundation::EventRegistrationToken _unprocessedInputMovedToken;
00106         Windows::Foundation::EventRegistrationToken _unprocessedInputPressedToken;
00107         Windows::Foundation::EventRegistrationToken _unprocessedInputReleasedToken;
00108         Windows::Foundation::EventRegistrationToken _unprocessedInputExitedToken;
00109         Windows::Foundation::EventRegistrationToken _unprocessedInputEnteredToken;
00110         Windows::Foundation::EventRegistrationToken _unprocessedInputHoveredToken;
00111         Windows::Foundation::EventRegistrationToken _unprocessedInputLostToken;
00112
00113         Windows::Foundation::EventRegistrationToken _strokeStartedToken;
00114         Windows::Foundation::EventRegistrationToken _stokeContinuedToken;
00115         Windows::Foundation::EventRegistrationToken _strokeEndedToken;
00116         Windows::Foundation::EventRegistrationToken _strokeCanceledToken;
00117
00118     private:
00119
00120         // Page and controls event handlers
00121         void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00122         void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
00123         void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^);
00124         void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
00125         void OnClear(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00126         void OnInsertShape(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00127         void TouchInking_Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00128         void TouchInking_Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00129         void InkingModeSelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
00130
00131         // Inking input handlers
00132         void OnStrokesCollected(Windows::UI::Input::Inking::InkPresenter^ sender, Windows::UI::Input::Inking::InkStrokesCollectedEventArgs^ args);
00133
00134         // Independent input handlers
00135         void IndependentInputOnPointerMoving(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00136         void IndependentInputOnPointerPressing(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00137         void IndependentInputOnPointerReleasing(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00138         void IndependentInputOnPointerExiting(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00139         void IndependentInputOnPointerEntering(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00140         void IndependentInputOnPointerHovering(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00141         void IndependentInputOnPointerLost(Windows::UI::Input::Inking::Core::CoreInkIndependentInputSource^ sender, Windows::UI::Core::PointerEventArgs^ args);
00142
00143         // Unprocessed input handlers
00144         void UnprocessedInputOnPointerEntered(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00145         void UnprocessedInputOnPointerHovered(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00146         void UnprocessedInputOnPointerPressed(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00147         void UnprocessedInputOnPointerMoved(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00148         void UnprocessedInputOnPointerReleased(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00149         void UnprocessedInputOnPointerExited(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00150         void UnprocessedInputOnPointerLost(Windows::UI::Input::Inking::InkUnprocessedInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00151
00152         // InkStroke handlers
00153         void OnStrokeStarted(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00154         void OnStrokeContinued(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00155         void OnStrokeEnded(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00156         void OnStrokeCanceled(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ args);
00157
00158         // Gesture Recognizer event handlers
00159         void OnRightTapped(Windows::UI::Input::GestureRecognizer^ sender, Windows::UI::Input::RightTappedEventArgs^ args);
00160         void OnHolding(Windows::UI::Input::GestureRecognizer^ sender, Windows::UI::Input::HoldingEventArgs^ args);
00161
00162         // Logging event handlers
00163         void InkingEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00164         void IndependentEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00165         void UnprocessedEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00166         void StrokeEvent_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00167
00168         // View event handlers
00169         void OnViewChanged(Platform::Object^, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e);
00170
00171         // Helper methods
00172         void EnableInkingEventHandlers();
00173         void EnableIndependentInputEventHandlers();
00174         void EnableLoggingIndependentInputEventHandlers(bool enable);
00175         void EnableUnprocessedInputEventHandlers();
00176         void EnableLoggingUnprocessedInputEventHandlers(bool enable);
00177         void EnableLoggingStrokeEventHandlers(bool enable);
00178
00179         InkingAreaSubStates GetInkingSubstate(Windows::UI::Core::PointerEventArgs^ args);
00180         PointerHitTestStates GetHitTestState(Windows::Foundation::Point position);
00181         void StartStrokeSelection(Windows::Foundation::Point position);
00182         void LaunchContextMenu(Windows::Foundation::Point contextMenuPosition);
00183
00184         void Log(LogEventAction action);
00185         void UpdateMessageLog(LogEventAction action);
00186         void LogToggleSwitch_Toggled(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00187     };
00188 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/TlvEntry.cs Source File

  • Nfc
  • Nfc

TlvEntry.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012
00013 using System;
00014 using Windows.Storage.Streams;
00015 using System.Runtime.InteropServices.WindowsRuntime;
00016
00017 public class TlvEntry
00018 {
00019     public TlvEntry(ushort tag, object value)
00020     {
00021         Tag = tag;
00022         Value = value;
00023     }
00024
00025     ushort Tag
00026     {
00027         get;
00028         set;
00029     }
00030
00031     byte TagLength
00032     {
00033         get
00034         {
00035             if ((Tag & 0xFF00) != 0)
00036             {
00037                 return 2;
00038             }
00039             else
00040             {
00041                 return 1;
00042             }
00043         }
00044     }
00045
00046     object Value
00047     {
00048         get;
00049         set;
00050     }
00051
00052     int ValueLength
00053     {
00054         get
00055         {
00056             if (Value is string)
00057             {
00058                 return ((string)Value).Length;
00059             }
00060             else if (Value is IBuffer)
00061             {
00062                 return (int)((IBuffer)Value).Length;
00063             }
00064             else if(Value is byte[])
00065             {
00066                 return ((byte[])Value).Length;
00067             }
00068             else if(Value is TlvEntry)
00069             {
00070                 return ((TlvEntry)Value).Length;
00071             }
00072             else if (Value is TlvEntry[])
00073             {
00074                 int ret = 0;
00075                 foreach(var entry in (TlvEntry[])Value)
00076                 {
00077                     ret += entry.Length;
00078                 }
00079                 return ret;
00080             }
00081             throw new InvalidOperationException();
00082         }
00083     }
00084
00085     int Length
00086     {
00087         get
00088         {
00089             return TagLength
00090                 + (ValueLength > 0x7F ? 2 : 1)
00091                 + ValueLength;
00092         }
00093     }
00094
00095     public byte[] GetData(ushort? statusWord = null)
00096     {
00097         int i = 0;
00098         var ret = new byte[this.Length + (statusWord == null ? 0 : 2)];
00099
00100         if (TagLength == 2)
00101         {
00102             ret[i++] = (byte)((Tag & 0xFF00) >> 8);
00103             ret[i++] = (byte)(Tag & 0xFF);
00104         }
00105         else
00106         {
00107             ret[i++] = (byte)Tag;
00108         }
00109
00110         if (ValueLength > 0x7F)
00111         {
00112             if (ValueLength > 0xFF)
00113             {
00114                 throw new NotImplementedException();
00115             }
00116             ret[i++] = 0x81;
00117         }
00118         ret[i++] = (byte)ValueLength;
00119
00120         if (Value is string)
00121         {
00122             Value = System.Text.UTF8Encoding.UTF8.GetBytes((string)Value);
00123         }
00124         else if (Value is IBuffer)
00125         {
00126             Value = ((IBuffer)Value).ToArray();
00127         }
00128
00129
00130         if (Value is byte[])
00131         {
00132             Array.Copy((byte[])Value, 0, ret, i, ((byte[])Value).Length);
00133             i += ((byte[])Value).Length;
00134         }
00135         else if (Value is TlvEntry)
00136         {
00137             Array.Copy(((TlvEntry)Value).GetData(), 0, ret, i, ((TlvEntry)Value).Length);
00138             i += ((TlvEntry)Value).Length;
00139         }
00140         else if (Value is TlvEntry[])
00141         {
00142             foreach (var entry in (TlvEntry[])Value)
00143             {
00144                 Array.Copy(entry.GetData(), 0, ret, i, entry.Length);
00145                 i += entry.Length;
00146             }
00147         }
00148         else
00149         {
00150             throw new InvalidOperationException();
00151         }
00152
00153         if (statusWord != null)
00154         {
00155             ret[i++] = (byte)((statusWord & 0xFF00) >> 8);
00156             ret[i++] = (byte)(statusWord & 0xFF);
00157         }
00158         return ret;
00159     }
00160 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Update Member List

This is the complete list of members for Update, including all inherited members.
Address | UpdateBinary |
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
BlockCount | Update |
BlockList | Update |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
GetDataIn(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData) | Update | [inline, private, static]
INS | ApduCommand |
Le | ApduCommand |
P1 | ApduCommand |
P2 | ApduCommand |
ServiceCodeList | Update |
ServiceCount | Update |
ToString() | ApduCommand | [inline]
Update(byte serviceCount, byte[] serviceCodeList, byte blockCount, byte[] blockList, byte[] blockData) | Update | [inline]
UpdateBinary(ushort address, byte[] dataToWrite) | UpdateBinary | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DGradientMesh/cpp/DeviceResources.h Source File

  • D2DGradientMesh
  • cpp

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 namespace DX
00011 {
00012     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00013     interface IDeviceNotify
00014     {
00015         virtual void OnDeviceLost() = 0;
00016         virtual void OnDeviceRestored() = 0;
00017     };
00018
00019     // Controls all the DirectX device resources.
00020     class DeviceResources
00021     {
00022     public:
00023         DeviceResources();
00024         void SetWindow(Windows::UI::Core::CoreWindow^ window);
00025         void SetLogicalSize(Windows::Foundation::Size logicalSize);
00026         void SetCurrentOrientation(Windows::Graphics::Display::DisplayOrientations currentOrientation);
00027         void SetDpi(float dpi);
00028         void ValidateDevice();
00029         void HandleDeviceLost();
00030         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00031         void Trim();
00032         void Present();
00033
00034         // Device Accessors.
00035         Windows::Foundation::Size GetOutputSize() const                 { return m_outputSize; }
00036         Windows::Foundation::Size GetLogicalSize() const                { return m_logicalSize; }
00037         Windows::UI::Core::CoreWindow^ GetWindow() const                { return m_window.Get(); }
00038
00039         // D3D Accessors.
00040         ID3D11Device2*          GetD3DDevice() const                    { return m_d3dDevice.Get(); }
00041         ID3D11DeviceContext2*   GetD3DDeviceContext() const             { return m_d3dContext.Get(); }
00042         IDXGISwapChain1*        GetSwapChain() const                    { return m_swapChain.Get(); }
00043         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const           { return m_d3dFeatureLevel; }
00044         DirectX::XMFLOAT4X4     GetOrientationTransform3D() const       { return m_orientationTransform3D; }
00045
00046         // D2D Accessors.
00047         ID2D1Factory3*          GetD2DFactory() const                   { return m_d2dFactory.Get(); }
00048         ID2D1Device2*           GetD2DDevice() const                    { return m_d2dDevice.Get(); }
00049         ID2D1DeviceContext2*    GetD2DDeviceContext() const             { return m_d2dContext.Get(); }
00050         ID2D1Bitmap1*           GetD2DTargetBitmap() const              { return m_d2dTargetBitmap.Get(); }
00051         IDWriteFactory2*        GetDWriteFactory() const                { return m_dwriteFactory.Get(); }
00052         IWICImagingFactory2*    GetWicImagingFactory() const            { return m_wicFactory.Get(); }
00053         D2D1::Matrix3x2F        GetOrientationTransform2D() const       { return m_orientationTransform2D; }
00054
00055     private:
00056         void CreateDeviceIndependentResources();
00057         void CreateDeviceResources();
00058         void CreateWindowSizeDependentResources();
00059
00060         DXGI_MODE_ROTATION ComputeDisplayRotation();
00061
00062         // Direct3D objects.
00063         Microsoft::WRL::ComPtr<ID3D11Device2>           m_d3dDevice;
00064         Microsoft::WRL::ComPtr<ID3D11DeviceContext2>    m_d3dContext;
00065         Microsoft::WRL::ComPtr<IDXGISwapChain1>         m_swapChain;
00066
00067         // Direct2D drawing components.
00068         Microsoft::WRL::ComPtr<ID2D1Factory3>       m_d2dFactory;
00069         Microsoft::WRL::ComPtr<ID2D1Device2>        m_d2dDevice;
00070         Microsoft::WRL::ComPtr<ID2D1DeviceContext2> m_d2dContext;
00071         Microsoft::WRL::ComPtr<ID2D1Bitmap1>        m_d2dTargetBitmap;
00072
00073         // DirectWrite drawing components.
00074         Microsoft::WRL::ComPtr<IDWriteFactory2>     m_dwriteFactory;
00075         Microsoft::WRL::ComPtr<IWICImagingFactory2> m_wicFactory;
00076
00077         // Cached reference to the Window.
00078         Platform::Agile<Windows::UI::Core::CoreWindow>  m_window;
00079
00080         // Cached device properties.
00081         D3D_FEATURE_LEVEL                               m_d3dFeatureLevel;
00082         Windows::Foundation::Size                       m_d3dRenderTargetSize;
00083         Windows::Foundation::Size                       m_outputSize;
00084         Windows::Foundation::Size                       m_logicalSize;
00085         Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00086         Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00087         float                                           m_dpi;
00088
00089         // Transforms used for display orientation.
00090         D2D1::Matrix3x2F    m_orientationTransform2D;
00091         DirectX::XMFLOAT4X4 m_orientationTransform3D;
00092
00093         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00094         IDeviceNotify* m_deviceNotify;
00095     };
00096 }
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HttpClient/cppwinrt/Scenario14_MeteredConnectionFilter.cpp Source File

  • HttpClient
  • cppwinrt

Scenario14_MeteredConnectionFilter.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario14_MeteredConnectionFilter.h"
00014 #include "Scenario14_MeteredConnectionFilter.g.cpp"
00015 #include "Helpers.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::HttpFilters;
00019 using namespace winrt::Windows::Foundation;
00020 using namespace winrt::Windows::UI::Xaml;
00021 using namespace winrt::Windows::UI::Xaml::Navigation;
00022 using namespace winrt::Windows::Web::Http;
00023 using namespace winrt::Windows::Web::Http::Filters;
00024
00025 namespace winrt::SDKTemplate::implementation
00026 {
00027     Scenario14_MeteredConnectionFilter::Scenario14_MeteredConnectionFilter()
00028     {
00029         InitializeComponent();
00030     }
00031
00032     void Scenario14_MeteredConnectionFilter::OnNavigatedTo(NavigationEventArgs const&)
00033     {
00034         HttpBaseProtocolFilter baseProtocolFilter;
00035         meteredConnectionFilter = HttpMeteredConnectionFilter(baseProtocolFilter);
00036         httpClient = HttpClient(meteredConnectionFilter);
00037     }
00038
00039     void Scenario14_MeteredConnectionFilter::OnNavigatedFrom(NavigationEventArgs const&)
00040     {
00041         httpClient.Close();
00042         meteredConnectionFilter.Close();
00043     }
00044
00045     void Scenario14_MeteredConnectionFilter::OptInSwitch_Toggled(IInspectable const&, RoutedEventArgs const&)
00046     {
00047         meteredConnectionFilter.OptIn(OptInSwitch().IsOn());
00048     }
00049
00050     fire_and_forget Scenario14_MeteredConnectionFilter::Start_Click(IInspectable const&, RoutedEventArgs const&)
00051     {
00052         auto lifetime = get_strong();
00053
00054         // The value of 'AddressField' is set by the user and is therefore untrusted input. If we can't create a
00055         // valid, absolute URI, we'll notify the user about the incorrect input.
00056         Uri resourceUri = Helpers::TryParseHttpUri(AddressField().Text());
00057         if (!resourceUri)
00058         {
00059             rootPage.NotifyUser(L"Invalid URI.", NotifyType::ErrorMessage);
00060             return;
00061         }
00062
00063         Helpers::ScenarioStarted(StartButton(), CancelButton(), OutputField());
00064         rootPage.NotifyUser(L"In progress", NotifyType::StatusMessage);
00065
00066         // This sample uses a "try" in order to support cancellation.
00067         // If you don't need to support cancellation, then the "try" is not needed.
00068         try
00069         {
00070             pendingAction = CancelableRequestAsync(resourceUri);
00071             co_await pendingAction;
00072         }
00073         catch (hresult_canceled const&)
00074         {
00075             rootPage.NotifyUser(L"Request canceled.", NotifyType::ErrorMessage);
00076         }
00077
00078         Helpers::ScenarioCompleted(StartButton(), CancelButton());
00079     }
00080
00081     IAsyncAction Scenario14_MeteredConnectionFilter::CancelableRequestAsync(Uri resourceUri)
00082     {
00083         auto lifetime = get_strong();
00084         auto cancellation = co_await get_cancellation_token();
00085         cancellation.enable_propagation();
00086
00087         HttpRequestMessage request(HttpMethod::Get(), resourceUri);
00088
00089         MeteredConnectionPriority priority = MeteredConnectionPriority::Low;
00090         if (MediumRadio().IsChecked().Value())
00091         {
00092             priority = MeteredConnectionPriority::Medium;
00093         }
00094         else if (HighRadio().IsChecked().Value())
00095         {
00096             priority = MeteredConnectionPriority::High;
00097         }
00098         request.Properties().Insert(HttpMeteredConnectionFilter::MeteredConnectionPriorityPropertyName(), box_value(priority));
00099
00100         HttpRequestResult result = co_await httpClient.TrySendRequestAsync(request);
00101
00102         if (result.Succeeded())
00103         {
00104             co_await Helpers::DisplayTextResultAsync(result.ResponseMessage(), OutputField());
00105
00106             rootPage.NotifyUser(L"Completed", NotifyType::StatusMessage);
00107         }
00108         else
00109         {
00110             Helpers::DisplayWebError(rootPage, result.ExtendedError());
00111         }
00112     }
00113
00114     void Scenario14_MeteredConnectionFilter::Cancel_Click(IInspectable const&, RoutedEventArgs const&)
00115     {
00116         if (pendingAction)
00117         {
00118             pendingAction.Cancel();
00119         }
00120     }
00121 }
Generated on Fri Nov 15 2024 22:19:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SimCard Member List

This is the complete list of members for SimCard, including all inherited members.
btnGetRecord_Click(object sender, RoutedEventArgs e) | SimCard | [inline, private]
btnGetUICC_Click(object sender, RoutedEventArgs e) | SimCard | [inline, private]
currentUiccApp | SimCard | [private]
listUiccApps_SelectionChanged(object sender, SelectionChangedEventArgs e) | SimCard | [inline, private]
rootPage | SimCard | [private]
SimCard() | SimCard | [inline]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Projection/cpp/App.xaml.cpp Source File

  • Projection
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014
00015 using namespace SDKSample;
00016
00017 using namespace Platform;
00018 using namespace Windows::ApplicationModel;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Interop;
00028 using namespace Windows::UI::Xaml::Media;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00032
00033 /// <summary>
00034 /// Initializes the singleton application object.  This is the first line of authored code
00035 /// executed, and as such is the logical equivalent of main() or WinMain().
00036 /// </summary>
00037 App::App()
00038 {
00039     InitializeComponent();
00040     Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
00041 }
00042
00043 /// <summary>
00044 /// Invoked when the application is launched normally by the end user.  Other entry points
00045 /// will be used such as when the application is launched to open a specific file.
00046 /// </summary>
00047 /// <param name="e">Details about the launch request and process.</param>
00048 void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
00049 {
00050 #if _DEBUG
00051     // Show graphics profiling information while debugging.
00052     if (IsDebuggerPresent())
00053     {
00054         // Display the current frame rate counters
00055         DebugSettings->EnableFrameRateCounter = false;
00056     }
00057 #endif
00058
00059     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00060
00061     // Do not repeat app initialization when the Window already has content,
00062     // just ensure that the window is active
00063     if (rootFrame == nullptr)
00064     {
00065         // Create a Frame to act as the navigation context and associate it with
00066         // a SuspensionManager key
00067         rootFrame = ref new Frame();
00068
00069         // Set the default language
00070         rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
00071
00072         rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00073
00074         if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00075         {
00076             // TODO: Restore the saved session state only when appropriate, scheduling the
00077             // final launch steps after the restore is complete
00078         }
00079
00080         if (rootFrame->Content == nullptr)
00081         {
00082             // When the navigation stack isn't restored navigate to the first page,
00083             // configuring the new page by passing required information as a navigation
00084             // parameter
00085             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00086         }
00087         // Place the frame in the current Window
00088         Window::Current->Content = rootFrame;
00089         // Ensure the current window is active
00090         Window::Current->Activate();
00091     }
00092     else
00093     {
00094         if (rootFrame->Content == nullptr)
00095         {
00096             // When the navigation stack isn't restored navigate to the first page,
00097             // configuring the new page by passing required information as a navigation
00098             // parameter
00099             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00100         }
00101         // Ensure the current window is active
00102         Window::Current->Activate();
00103     }
00104 }
00105
00106 /// <summary>
00107 /// Invoked when application execution is being suspended.  Application state is saved
00108 /// without knowing whether the application will be terminated or resumed with the contents
00109 /// of memory still intact.
00110 /// </summary>
00111 /// <param name="sender">The source of the suspend request.</param>
00112 /// <param name="e">Details about the suspend request.</param>
00113 void App::OnSuspending(Object^ /* sender */, SuspendingEventArgs^ /* e */)
00114 {
00115     //TODO: Save application state and stop any background activity
00116 }
00117
00118 /// <summary>
00119 /// Invoked when Navigation to a certain page fails
00120 /// </summary>
00121 /// <param name="sender">The Frame which failed navigation</param>
00122 /// <param name="e">Details about the navigation failure</param>
00123 void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
00124 {
00125     throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
00126 }
Generated on Fri Nov 15 2024 22:16:49 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario8_CaptureBitmap Member List

This is the complete list of members for Scenario8_CaptureBitmap, including all inherited members.
CaptureButton_Click() | Scenario8_CaptureBitmap | [inline, private]
CreateScaledBitmapFromStreamAsync(int width, int height, IRandomAccessStream source) | Scenario8_CaptureBitmap | [inline, private, static]
OnNavigatedTo(NavigationEventArgs e) | Scenario8_CaptureBitmap | [inline, protected]
Scenario8_CaptureBitmap() | Scenario8_CaptureBitmap | [inline]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShareCustomData Member List

This is the complete list of members for ShareCustomData, including all inherited members.
GetShareContent(DataRequest request) | ShareCustomData | [inline, protected]
ShareCustomData() | ShareCustomData | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

OvenClient Member List

This is the complete list of members for OvenClient, including all inherited members.
_myOven | OvenClient | [private]
BreadCompletedHandler1(Oven oven, BreadBakedEventArgs args) | OvenClient | [inline, private]
BreadCompletedHandler2(Oven oven, BreadBakedEventArgs bread) | OvenClient | [inline, private]
BreadCompletedHandler3(Oven oven, BreadBakedEventArgs bread) | OvenClient | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | OvenClient | [inline, protected]
OvenClient() | OvenClient | [inline]
rootPage | OvenClient | [private]
Start_Click(object sender, RoutedEventArgs e) | OvenClient | [inline, private]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleOrientationSensor/cpp/SampleConfiguration.h Source File

  • SimpleOrientationSensor
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Simple orientation sensor";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GameObject Member List

This is the complete list of members for GameObject, including all inherited members.
Active(bool active) | GameObject |
Active() | GameObject |
AnimatePosition(_In_ std::shared_ptr< Animate > const &animate) | GameObject |
AnimatePosition() | GameObject |
GameObject() | GameObject |
Hit(bool hit) | GameObject |
Hit() | GameObject |
HitMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
HitMaterial() | GameObject |
HitSound(_In_ std::shared_ptr< SoundEffect > const &hitSound) | GameObject |
HitSound() | GameObject |
HitTime(float t) | GameObject |
HitTime() | GameObject |
IsTouching(DirectX::XMFLOAT3, float, _Out_ DirectX::XMFLOAT3 *contact, _Out_ DirectX::XMFLOAT3 *normal) | GameObject | [inline, virtual]
m_active | GameObject | [private]
m_animatePosition | GameObject | [private]
m_defaultXAxis | GameObject | [private]
m_defaultYAxis | GameObject | [private]
m_defaultZAxis | GameObject | [private]
m_ground | GameObject | [private]
m_hit | GameObject | [private]
m_hitMaterial | GameObject | [private]
m_hitSound | GameObject | [private]
m_hitTime | GameObject | [private]
m_mesh | GameObject | [private]
m_modelMatrix | GameObject | [protected]
m_normalMaterial | GameObject | [private]
m_position | GameObject | [protected]
m_target | GameObject | [private]
m_targetId | GameObject | [private]
m_velocity | GameObject | [private]
Mesh(_In_ std::shared_ptr< MeshObject > const &mesh) | GameObject |
ModelMatrix() | GameObject |
NormalMaterial(_In_ std::shared_ptr< Material > const &material) | GameObject |
NormalMaterial() | GameObject |
OnGround(bool ground) | GameObject |
OnGround() | GameObject |
PlaySound(float impactSpeed, DirectX::XMFLOAT3 eyePoint) | GameObject |
Position(DirectX::XMFLOAT3 position) | GameObject |
Position(DirectX::XMVECTOR position) | GameObject |
Position() | GameObject |
Render(_In_ ID3D11DeviceContext *context, _In_ ID3D11Buffer *primitiveConstantBuffer) | GameObject |
Target(bool target) | GameObject |
Target() | GameObject |
TargetId(int targetId) | GameObject |
TargetId() | GameObject |
UpdatePosition() | GameObject | [inline, private, virtual]
VectorPosition() | GameObject |
VectorVelocity() | GameObject |
Velocity(DirectX::XMFLOAT3 velocity) | GameObject |
Velocity(DirectX::XMVECTOR velocity) | GameObject |
Velocity() | GameObject |
Generated on Fri Nov 15 2024 22:23:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp Source File

  • PersonalDataEncryption
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Personal Data Encryption";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Files and folders", xaml_typename<SDKTemplate::Scenario1_Files>() },
00029     Scenario{ L"Memory", xaml_typename<SDKTemplate::Scenario2_Memory>() },
00030 });
Generated on Fri Nov 15 2024 22:17:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cppwinrt/SampleConfiguration.h Source File

  • PdfDocument
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CashDrawer/cpp/Scenario1_OpenDrawer.xaml.h Source File

  • CashDrawer
  • cpp

Scenario1_OpenDrawer.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_OpenDrawer.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario1_OpenDrawer sealed
00024     {
00025     public:
00026         Scenario1_OpenDrawer();
00027
00028     private:
00029         MainPage^ rootPage;
00030
00031         Windows::Devices::PointOfService::CashDrawer^ drawer = nullptr;
00032         Windows::Devices::PointOfService::ClaimedCashDrawer^ claimedDrawer = nullptr;
00033
00034         void InitDrawerButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035         void OpenDrawerButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036
00037         concurrency::task<bool> CreateDefaultCashDrawerObject();
00038         concurrency::task<bool> ClaimCashDrawer();
00039
00040         void ResetScenarioState();
00041
00042     protected:
00043         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00044         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00045     };
00046
00047 }
Generated on Fri Nov 15 2024 22:18:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario12_ShareData Member List

This is the complete list of members for Scenario12_ShareData, including all inherited members.
m_dTransferMgr | Scenario12_ShareData | [private]
m_ShareContent | Scenario12_ShareData | [private]
OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e) | Scenario12_ShareData | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario12_ShareData | [inline, protected]
rootPage | Scenario12_ShareData | [private]
Scenario12_ShareData() | Scenario12_ShareData | [inline]
Share_Click(object sender, RoutedEventArgs e) | Scenario12_ShareData | [inline, private]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Program Member List

This is the complete list of members for Program, including all inherited members.
Main() Program [inline, private, static]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_CurrentStepCount Member List

This is the complete list of members for Scenario3_CurrentStepCount, including all inherited members.
GetCurrentButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | Scenario3_CurrentStepCount | [inline, private]
PedometerClassId | Scenario3_CurrentStepCount | [private]
rootPage | Scenario3_CurrentStepCount | [private]
Scenario3_CurrentStepCount() | Scenario3_CurrentStepCount | [inline]
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario5.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario5.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario5.xaml.h"
00013
00014 using namespace SDKTemplate;
00015
00016 using namespace Platform;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace Windows::UI::Core;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022 using namespace Windows::UI::Xaml::Controls::Primitives;
00023 using namespace Windows::UI::Xaml::Data;
00024 using namespace Windows::UI::Xaml::Input;
00025 using namespace Windows::UI::Xaml::Media;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 Scenario5::Scenario5() : rootPage(MainPage::Current)
00029 {
00030     InitializeComponent();
00031
00032     // Initialize the InkCanvas
00033     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00034
00035 }
00036
00037
00038 void Scenario5::OnSizeChanged(Platform::Object^ sender, SizeChangedEventArgs^ e)
00039 {
00040     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00041 }
Generated on Fri Nov 15 2024 22:18:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_ChangeSystemGroup Member List

This is the complete list of members for Scenario4_ChangeSystemGroup, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario4_ChangeSystemGroup | [inline, protected]
PrepareSampleFiles_Click(object sender, RoutedEventArgs e) | Scenario4_ChangeSystemGroup | [inline, private]
Scenario4_ChangeSystemGroup() | Scenario4_ChangeSystemGroup | [inline]
SystemGroup_Frequent_Click(object sender, RoutedEventArgs e) | Scenario4_ChangeSystemGroup | [inline, private]
SystemGroup_None_Click(object sender, RoutedEventArgs e) | Scenario4_ChangeSystemGroup | [inline, private]
SystemGroup_Recent_Click(object sender, RoutedEventArgs e) | Scenario4_ChangeSystemGroup | [inline, private]
Generated on Fri Nov 15 2024 22:23:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicVoiceInput/cpp/HolographicVoiceInputMain.cpp Source File

  • HolographicVoiceInput
  • cpp

HolographicVoiceInputMain.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #include "pch.h"
00012 #include "HolographicVoiceInputMain.h"
00013 #include "Common\DirectXHelper.h"
00014
00015 #include <windows.graphics.directx.direct3d11.interop.h>
00016 #include <Collection.h>
00017
00018 #include "Audio/OmnidirectionalSound.h"
00019
00020 using namespace HolographicVoiceInput;
00021
00022 using namespace concurrency;
00023 using namespace Platform;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::Foundation::Numerics;
00026 using namespace Windows::Graphics::Holographic;
00027 using namespace Windows::Media::SpeechRecognition;
00028 using namespace Windows::Perception::Spatial;
00029 using namespace Windows::UI::Input::Spatial;
00030 using namespace std::placeholders;
00031
00032 // Loads and initializes application assets when the application is loaded.
00033 HolographicVoiceInputMain::HolographicVoiceInputMain(const std::shared_ptr<DX::DeviceResources>& deviceResources) :
00034     m_deviceResources(deviceResources)
00035 {
00036     // Register to be notified if the device is lost or recreated.
00037     m_deviceResources->RegisterDeviceNotify(this);
00038
00039     // Initialize the map of speech commands to actions - in this case, color values.
00040     InitializeSpeechCommandList();
00041
00042 }
00043
00044
00045 void HolographicVoiceInputMain::InitializeSpeechCommandList()
00046 {
00047     m_lastCommand = nullptr;
00048     m_listening = false;
00049     m_speechCommandData = ref new Platform::Collections::Map<String^, float4>();
00050
00051     m_speechCommandData->Insert(L"white", float4(1.0f, 1.0f, 1.0f, 1.f));
00052     m_speechCommandData->Insert(L"grey", float4(0.5f, 0.5f, 0.5f, 1.f));
00053     m_speechCommandData->Insert(L"green", float4(0.0f, 1.0f, 0.0f, 1.f));
00054     m_speechCommandData->Insert(L"black", float4(0.1f, 0.1f, 0.1f, 1.f));
00055     m_speechCommandData->Insert(L"red", float4(1.0f, 0.0f, 0.0f, 1.f));
00056     m_speechCommandData->Insert(L"yellow", float4(1.0f, 1.0f, 0.0f, 1.f));
00057     m_speechCommandData->Insert(L"aquamarine", float4(0.0f, 1.0f, 1.0f, 1.f));
00058     m_speechCommandData->Insert(L"blue", float4(0.0f, 0.0f, 1.0f, 1.f));
00059     m_speechCommandData->Insert(L"purple", float4(1.0f, 0.0f, 1.0f, 1.f));
00060
00061     // You can use non-dictionary words as speech commands.
00062     m_speechCommandData->Insert(L"SpeechRecognizer", float4(0.5f, 0.1f, 1.f, 1.f));
00063 }
00064
00065 void HolographicVoiceInputMain::BeginVoiceUIPrompt()
00066 {
00067     // RecognizeWithUIAsync provides speech recognition begin and end prompts, but it does not provide
00068     // synthesized speech prompts. Instead, you should provide your own speech prompts when requesting
00069     // phrase input.
00070     // Here is an example of how to do that with a speech synthesizer. You could also use a pre-recorded
00071     // voice clip, a visual UI, or other indicator of what to say.
00072     auto speechSynthesizer = ref new Windows::Media::SpeechSynthesis::SpeechSynthesizer();
00073
00074     StringReference voicePrompt;
00075
00076     // A command list is used to continuously look for one-word commands.
00077     // You need some way for the user to know what commands they can say. In this example, we provide
00078     // verbal instructions; you could also use graphical UI, etc.
00079     voicePrompt = L"Say the name of a color, at any time, to change the color of the cube.";
00080
00081     // Kick off speech synthesis.
00082     create_task(speechSynthesizer->SynthesizeTextToStreamAsync(voicePrompt), task_continuation_context::use_current())
00083         .then([this, speechSynthesizer](task<Windows::Media::SpeechSynthesis::SpeechSynthesisStream^> synthesisStreamTask)
00084     {
00085         try
00086         {
00087             // The speech synthesis is sent as a byte stream.
00088             Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ stream = synthesisStreamTask.get();
00089
00090             // We can initialize an XAudio2 voice using that byte stream.
00091             // Here, we use it to play an HRTF audio effect.
00092             auto hr = m_speechSynthesisSound.Initialize(stream, 0);
00093             if (SUCCEEDED(hr))
00094             {
00095                 m_speechSynthesisSound.SetEnvironment(HrtfEnvironment::Small);
00096                 m_speechSynthesisSound.Start();
00097
00098                 // Amount of time to pause after the audio prompt is complete, before listening
00099                 // for speech input.
00100                 static const float bufferTime = 0.15f;
00101
00102                 // Wait until the prompt is done before listening.
00103                 m_secondsUntilSoundIsComplete = m_speechSynthesisSound.GetDuration() + bufferTime;
00104                 m_waitingForSpeechPrompt = true;
00105             }
00106         }
00107         catch (Exception^ exception)
00108         {
00109             PrintWstringToDebugConsole(
00110                 std::wstring(L"Exception while trying to synthesize speech: ") +
00111                 exception->Message->Data() +
00112                 L"\n"
00113             );
00114
00115             // Handle exceptions here.
00116         }
00117     });
00118 }
00119
00120 void HolographicVoiceInputMain::PlayRecognitionBeginSound()
00121 {
00122     // The user needs a cue to begin speaking. We will play this sound effect just before starting
00123     // the recognizer.
00124     auto hr = m_startRecognitionSound.GetInitializationStatus();
00125     if (SUCCEEDED(hr))
00126     {
00127         m_startRecognitionSound.SetEnvironment(HrtfEnvironment::Small);
00128         m_startRecognitionSound.Start();
00129
00130         // Wait until the audible cue is done before starting to listen.
00131         m_secondsUntilSoundIsComplete = m_startRecognitionSound.GetDuration();
00132         m_waitingForSpeechCue = true;
00133     }
00134 }
00135
00136 void HolographicVoiceInputMain::PlayRecognitionSound()
00137 {
00138     // The user should be given a cue when recognition is complete.
00139     auto hr = m_recognitionSound.GetInitializationStatus();
00140     if (SUCCEEDED(hr))
00141     {
00142         // re-initialize the sound so it can be replayed.
00143         m_recognitionSound.Initialize(L"Audio//BasicResultsEarcon.wav", 0);
00144         m_recognitionSound.SetEnvironment(HrtfEnvironment::Small);
00145
00146         m_recognitionSound.Start();
00147     }
00148 }
00149
00150 Concurrency::task<void> HolographicVoiceInputMain::StopCurrentRecognizerIfExists()
00151 {
00152     if (m_speechRecognizer != nullptr)
00153     {
00154         return create_task(m_speechRecognizer->StopRecognitionAsync()).then([this]()
00155         {
00156             m_speechRecognizer->RecognitionQualityDegrading -= m_speechRecognitionQualityDegradedToken;
00157
00158             if (m_speechRecognizer->ContinuousRecognitionSession != nullptr)
00159             {
00160                 m_speechRecognizer->ContinuousRecognitionSession->ResultGenerated -= m_speechRecognizerResultEventToken;
00161             }
00162         });
00163     }
00164     else
00165     {
00166         return create_task([this]() { });
00167     }
00168 }
00169
00170 bool HolographicVoiceInputMain::InitializeSpeechRecognizer()
00171 {
00172     m_speechRecognizer = ref new SpeechRecognizer();
00173
00174     if (!m_speechRecognizer)
00175     {
00176         return false;
00177     }
00178
00179     m_speechRecognitionQualityDegradedToken = m_speechRecognizer->RecognitionQualityDegrading +=
00180         ref new TypedEventHandler<SpeechRecognizer^, SpeechRecognitionQualityDegradingEventArgs^>(
00181             std::bind(&HolographicVoiceInputMain::OnSpeechQualityDegraded, this, _1, _2)
00182             );
00183
00184     m_speechRecognizerResultEventToken = m_speechRecognizer->ContinuousRecognitionSession->ResultGenerated +=
00185         ref new TypedEventHandler<SpeechContinuousRecognitionSession^, SpeechContinuousRecognitionResultGeneratedEventArgs^>(
00186             std::bind(&HolographicVoiceInputMain::OnResultGenerated, this, _1, _2)
00187             );
00188
00189     return true;
00190 }
00191
00192 task<bool> HolographicVoiceInputMain::StartRecognizeSpeechCommands()
00193 {
00194     return StopCurrentRecognizerIfExists().then([this]()
00195     {
00196         if (!InitializeSpeechRecognizer())
00197         {
00198             return task_from_result<bool>(false);
00199         }
00200
00201         // Here, we compile the list of voice commands by reading them from the map.
00202         Platform::Collections::Vector<String^>^ speechCommandList = ref new Platform::Collections::Vector<String^>();
00203         for each (auto pair in m_speechCommandData)
00204         {
00205             // The speech command string is what we are looking for here. Later, we can use the
00206             // recognition result for this string to look up a color value.
00207             auto command = pair->Key;
00208
00209             // Add it to the list.
00210             speechCommandList->Append(command);
00211         }
00212
00213         SpeechRecognitionListConstraint^ spConstraint = ref new SpeechRecognitionListConstraint(speechCommandList);
00214         m_speechRecognizer->Constraints->Clear();
00215         m_speechRecognizer->Constraints->Append(spConstraint);
00216         return create_task(m_speechRecognizer->CompileConstraintsAsync()).then([this](task<SpeechRecognitionCompilationResult^> previousTask)
00217         {
00218             try
00219             {
00220                 SpeechRecognitionCompilationResult^ compilationResult = previousTask.get();
00221
00222                 if (compilationResult->Status == SpeechRecognitionResultStatus::Success)
00223                 {
00224                     // If compilation succeeds, we can start listening for results.
00225                     return create_task(m_speechRecognizer->ContinuousRecognitionSession->StartAsync()).then([this](task<void> startAsyncTask) {
00226
00227                         try
00228                         {
00229                             // StartAsync may throw an exception if your app doesn't have Microphone permissions.
00230                             // Make sure they're caught and handled appropriately (otherwise the app may silently not work as expected)
00231                             startAsyncTask.get();
00232                             return true;
00233                         }
00234                         catch (Exception^ exception)
00235                         {
00236                             PrintWstringToDebugConsole(
00237                                 std::wstring(L"Exception while trying to start speech Recognition: ") +
00238                                 exception->Message->Data() +
00239                                 L"\n"
00240                             );
00241
00242                             return false;
00243                         }
00244                     });
00245                 }
00246                 else
00247                 {
00248                     OutputDebugStringW(L"Could not initialize constraint-based speech engine!\n");
00249
00250                     // Handle errors here.
00251                     return create_task([this] {return false; });
00252                 }
00253             }
00254             catch (Exception^ exception)
00255             {
00256                 // Note that if you get an "Access is denied" exception, you might need to enable the microphone
00257                 // privacy setting on the device and/or add the microphone capability to your app manifest.
00258
00259                 PrintWstringToDebugConsole(
00260                     std::wstring(L"Exception while trying to initialize speech command list:") +
00261                     exception->Message->Data() +
00262                     L"\n"
00263                 );
00264
00265                 // Handle exceptions here.
00266                 return create_task([this] {return false; });
00267             }
00268         });
00269     });
00270 }
00271
00272
00273 void HolographicVoiceInputMain::SetHolographicSpace(HolographicSpace^ holographicSpace)
00274 {
00275     UnregisterHolographicEventHandlers();
00276
00277     m_holographicSpace = holographicSpace;
00278
00279     //
00280     // TODO: Add code here to initialize your holographic content.
00281     //
00282
00283     // Initialize the sample hologram.
00284     m_spinningCubeRenderer = std::make_unique<SpinningCubeRenderer>(m_deviceResources);
00285
00286     m_spatialInputHandler = std::make_unique<SpatialInputHandler>();
00287
00288     // Use the default SpatialLocator to track the motion of the device.
00289     m_locator = SpatialLocator::GetDefault();
00290
00291     // Be able to respond to changes in the positional tracking state.
00292     m_locatabilityChangedToken =
00293         m_locator->LocatabilityChanged +=
00294             ref new Windows::Foundation::TypedEventHandler<SpatialLocator^, Object^>(
00295                 std::bind(&HolographicVoiceInputMain::OnLocatabilityChanged, this, _1, _2)
00296                 );
00297
00298     // Respond to camera added events by creating any resources that are specific
00299     // to that camera, such as the back buffer render target view.
00300     // When we add an event handler for CameraAdded, the API layer will avoid putting
00301     // the new camera in new HolographicFrames until we complete the deferral we created
00302     // for that handler, or return from the handler without creating a deferral. This
00303     // allows the app to take more than one frame to finish creating resources and
00304     // loading assets for the new holographic camera.
00305     // This function should be registered before the app creates any HolographicFrames.
00306     m_cameraAddedToken =
00307         m_holographicSpace->CameraAdded +=
00308             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraAddedEventArgs^>(
00309                 std::bind(&HolographicVoiceInputMain::OnCameraAdded, this, _1, _2)
00310                 );
00311
00312     // Respond to camera removed events by releasing resources that were created for that
00313     // camera.
00314     // When the app receives a CameraRemoved event, it releases all references to the back
00315     // buffer right away. This includes render target views, Direct2D target bitmaps, and so on.
00316     // The app must also ensure that the back buffer is not attached as a render target, as
00317     // shown in DeviceResources::ReleaseResourcesForBackBuffer.
00318     m_cameraRemovedToken =
00319         m_holographicSpace->CameraRemoved +=
00320             ref new Windows::Foundation::TypedEventHandler<HolographicSpace^, HolographicSpaceCameraRemovedEventArgs^>(
00321                 std::bind(&HolographicVoiceInputMain::OnCameraRemoved, this, _1, _2)
00322                 );
00323
00324     // The simplest way to render world-locked holograms is to create a stationary reference frame
00325     // when the app is launched. This is roughly analogous to creating a "world" coordinate system
00326     // with the origin placed at the device's position as the app is launched.
00327     m_referenceFrame = m_locator->CreateStationaryFrameOfReferenceAtCurrentLocation();
00328
00329     // Notes on spatial tracking APIs:
00330     // * Stationary reference frames are designed to provide a best-fit position relative to the
00331     //   overall space. Individual positions within that reference frame are allowed to drift slightly
00332     //   as the device learns more about the environment.
00333     // * When precise placement of individual holograms is required, a SpatialAnchor should be used to
00334     //   anchor the individual hologram to a position in the real world - for example, a point the user
00335     //   indicates to be of special interest. Anchor positions do not drift, but can be corrected; the
00336     //   anchor will use the corrected position starting in the next frame after the correction has
00337     //   occurred.
00338
00339     // Preload audio assets for audio cues.
00340     m_startRecognitionSound.Initialize(L"Audio//BasicListeningEarcon.wav", 0);
00341     m_recognitionSound.Initialize(L"Audio//BasicResultsEarcon.wav", 0);
00342
00343     // Begin the code sample scenario.
00344     BeginVoiceUIPrompt();
00345 }
00346
00347 void HolographicVoiceInputMain::UnregisterHolographicEventHandlers()
00348 {
00349     if (m_holographicSpace != nullptr)
00350     {
00351         // Clear previous event registrations.
00352
00353         if (m_cameraAddedToken.Value != 0)
00354         {
00355             m_holographicSpace->CameraAdded -= m_cameraAddedToken;
00356             m_cameraAddedToken.Value = 0;
00357         }
00358
00359         if (m_cameraRemovedToken.Value != 0)
00360         {
00361             m_holographicSpace->CameraRemoved -= m_cameraRemovedToken;
00362             m_cameraRemovedToken.Value = 0;
00363         }
00364     }
00365
00366     if (m_locator != nullptr)
00367     {
00368         m_locator->LocatabilityChanged -= m_locatabilityChangedToken;
00369     }
00370 }
00371
00372 HolographicVoiceInputMain::~HolographicVoiceInputMain()
00373 {
00374     // Deregister device notification.
00375     m_deviceResources->RegisterDeviceNotify(nullptr);
00376
00377     UnregisterHolographicEventHandlers();
00378 }
00379
00380 // Updates the application state once per frame.
00381 HolographicFrame^ HolographicVoiceInputMain::Update()
00382 {
00383     // Before doing the timer update, there is some work to do per-frame
00384     // to maintain holographic rendering. First, we will get information
00385     // about the current frame.
00386
00387     // The HolographicFrame has information that the app needs in order
00388     // to update and render the current frame. The app begins each new
00389     // frame by calling CreateNextFrame.
00390     HolographicFrame^ holographicFrame = m_holographicSpace->CreateNextFrame();
00391
00392     // Get a prediction of where holographic cameras will be when this frame
00393     // is presented.
00394     HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00395
00396     // Back buffers can change from frame to frame. Validate each buffer, and recreate
00397     // resource views and depth buffers as needed.
00398     m_deviceResources->EnsureCameraResources(holographicFrame, prediction);
00399
00400     // Next, we get a coordinate system from the attached frame of reference that is
00401     // associated with the current frame. Later, this coordinate system is used for
00402     // for creating the stereo view matrices when rendering the sample content.
00403     SpatialCoordinateSystem^ currentCoordinateSystem = m_referenceFrame->CoordinateSystem;
00404
00405     // Check for new input state since the last frame.
00406     SpatialInteractionSourceState^ pointerState = m_spatialInputHandler->CheckForInput();
00407     if (pointerState != nullptr)
00408     {
00409         // When a Pressed gesture is detected, the sample hologram will be repositioned
00410         // two meters in front of the user.
00411         m_spinningCubeRenderer->PositionHologram(
00412             pointerState->TryGetPointerPose(currentCoordinateSystem)
00413             );
00414     }
00415
00416     // Check for new speech input since the last frame.
00417     if (m_lastCommand != nullptr)
00418     {
00419         auto command = m_lastCommand;
00420         m_lastCommand = nullptr;
00421
00422         // Check to see if the spoken word or phrase, matches up with any of the speech
00423         // commands in our speech command map.
00424         for each (auto& iter in m_speechCommandData)
00425         {
00426             std::wstring lastCommandString = command->Data();
00427             std::wstring listCommandString = iter->Key->Data();
00428
00429             if (lastCommandString.find(listCommandString) != std::wstring::npos)
00430             {
00431                 // If so, we can set the cube to the color that was spoken.
00432                 m_spinningCubeRenderer->SetColor(iter->Value);
00433                 break;
00434             }
00435         }
00436     }
00437
00438
00439     m_timer.Tick([&] ()
00440     {
00441         //
00442         // TODO: Update scene objects.
00443         //
00444         // Put time-based updates here. By default this code will run once per frame,
00445         // but if you change the StepTimer to use a fixed time step this code will
00446         // run as many times as needed to get to the current step.
00447         //
00448
00449         m_spinningCubeRenderer->Update(m_timer);
00450
00451         // Wait to listen for speech input until the audible UI prompts are complete.
00452         if ((m_waitingForSpeechPrompt == true) &&
00453             ((m_secondsUntilSoundIsComplete -= static_cast<float>(m_timer.GetElapsedSeconds())) <= 0.f))
00454         {
00455             m_waitingForSpeechPrompt = false;
00456             PlayRecognitionBeginSound();
00457         }
00458         else if ((m_waitingForSpeechCue == true) &&
00459             ((m_secondsUntilSoundIsComplete -= static_cast<float>(m_timer.GetElapsedSeconds())) <= 0.f))
00460         {
00461             m_waitingForSpeechCue = false;
00462             m_secondsUntilSoundIsComplete = 0.f;
00463             StartRecognizeSpeechCommands();
00464         }
00465
00466     });
00467
00468     // We complete the frame update by using information about our content positioning
00469     // to set the focus point.
00470
00471     for (auto cameraPose : prediction->CameraPoses)
00472     {
00473         // The HolographicCameraRenderingParameters class provides access to set
00474         // the image stabilization parameters.
00475         HolographicCameraRenderingParameters^ renderingParameters = holographicFrame->GetRenderingParameters(cameraPose);
00476
00477         // SetFocusPoint informs the system about a specific point in your scene to
00478         // prioritize for image stabilization. The focus point is set independently
00479         // for each holographic camera.
00480         // You should set the focus point near the content that the user is looking at.
00481         // In this example, we put the focus point at the center of the sample hologram,
00482         // since that is the only hologram available for the user to focus on.
00483         // You can also set the relative velocity and facing of that content; the sample
00484         // hologram is at a fixed point so we only need to indicate its position.
00485         renderingParameters->SetFocusPoint(
00486             currentCoordinateSystem,
00487             m_spinningCubeRenderer->GetPosition()
00488             );
00489     }
00490
00491     // The holographic frame will be used to get up-to-date view and projection matrices and
00492     // to present the swap chain.
00493     return holographicFrame;
00494 }
00495
00496 // Renders the current frame to each holographic camera, according to the
00497 // current application and spatial positioning state. Returns true if the
00498 // frame was rendered to at least one camera.
00499 bool HolographicVoiceInputMain::Render(Windows::Graphics::Holographic::HolographicFrame^ holographicFrame)
00500 {
00501     // Don't try to render anything before the first Update.
00502     if (m_timer.GetFrameCount() == 0)
00503     {
00504         return false;
00505     }
00506
00507     //
00508     // TODO: Add code for pre-pass rendering here.
00509     //
00510     // Take care of any tasks that are not specific to an individual holographic
00511     // camera. This includes anything that doesn't need the final view or projection
00512     // matrix, such as lighting maps.
00513     //
00514
00515     // Lock the set of holographic camera resources, then draw to each camera
00516     // in this frame.
00517     return m_deviceResources->UseHolographicCameraResources<bool>(
00518         [this, holographicFrame](std::map<UINT32, std::unique_ptr<DX::CameraResources>>& cameraResourceMap)
00519     {
00520         // Up-to-date frame predictions enhance the effectiveness of image stablization and
00521         // allow more accurate positioning of holograms.
00522         holographicFrame->UpdateCurrentPrediction();
00523         HolographicFramePrediction^ prediction = holographicFrame->CurrentPrediction;
00524
00525         bool atLeastOneCameraRendered = false;
00526         for (auto cameraPose : prediction->CameraPoses)
00527         {
00528             // This represents the device-based resources for a HolographicCamera.
00529             DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();
00530
00531             // Get the device context.
00532             const auto context = m_deviceResources->GetD3DDeviceContext();
00533             const auto depthStencilView = pCameraResources->GetDepthStencilView();
00534
00535             // Set render targets to the current holographic camera.
00536             ID3D11RenderTargetView *const targets[1] = { pCameraResources->GetBackBufferRenderTargetView() };
00537             context->OMSetRenderTargets(1, targets, depthStencilView);
00538
00539             // Clear the back buffer and depth stencil view.
00540             context->ClearRenderTargetView(targets[0], DirectX::Colors::Transparent);
00541             context->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
00542
00543             //
00544             // TODO: Replace the sample content with your own content.
00545             //
00546             // Notes regarding holographic content:
00547             //    * For drawing, remember that you have the potential to fill twice as many pixels
00548             //      in a stereoscopic render target as compared to a non-stereoscopic render target
00549             //      of the same resolution. Avoid unnecessary or repeated writes to the same pixel,
00550             //      and only draw holograms that the user can see.
00551             //    * To help occlude hologram geometry, you can create a depth map using geometry
00552             //      data obtained via the surface mapping APIs. You can use this depth map to avoid
00553             //      rendering holograms that are intended to be hidden behind tables, walls,
00554             //      monitors, and so on.
00555             //    * Black pixels will appear transparent to the user wearing the device, but you
00556             //      should still use alpha blending to draw semitransparent holograms. You should
00557             //      also clear the screen to Transparent as shown above.
00558             //
00559
00560
00561             // The view and projection matrices for each holographic camera will change
00562             // every frame. This function refreshes the data in the constant buffer for
00563             // the holographic camera indicated by cameraPose.
00564             pCameraResources->UpdateViewProjectionBuffer(m_deviceResources, cameraPose, m_referenceFrame->CoordinateSystem);
00565
00566             // Attach the view/projection constant buffer for this camera to the graphics pipeline.
00567             bool cameraActive = pCameraResources->AttachViewProjectionBuffer(m_deviceResources);
00568
00569             // Only render world-locked content when positional tracking is active.
00570             if (cameraActive)
00571             {
00572                 // Draw the sample hologram.
00573                 m_spinningCubeRenderer->Render();
00574             }
00575             atLeastOneCameraRendered = true;
00576         }
00577
00578         return atLeastOneCameraRendered;
00579     });
00580 }
00581
00582 void HolographicVoiceInputMain::SaveAppState()
00583 {
00584     //
00585     // TODO: Insert code here to save your app state.
00586     //       This method is called when the app is about to suspend.
00587     //
00588     //       For example, store information in the SpatialAnchorStore.
00589     //
00590 }
00591
00592 void HolographicVoiceInputMain::LoadAppState()
00593 {
00594     //
00595     // TODO: Insert code here to load your app state.
00596     //       This method is called when the app resumes.
00597     //
00598     //       For example, load information from the SpatialAnchorStore.
00599     //
00600 }
00601
00602 // Notifies classes that use Direct3D device resources that the device resources
00603 // need to be released before this method returns.
00604 void HolographicVoiceInputMain::OnDeviceLost()
00605 {
00606     m_spinningCubeRenderer->ReleaseDeviceDependentResources();
00607 }
00608
00609 // Notifies classes that use Direct3D device resources that the device resources
00610 // may now be recreated.
00611 void HolographicVoiceInputMain::OnDeviceRestored()
00612 {
00613     m_spinningCubeRenderer->CreateDeviceDependentResources();
00614 }
00615
00616 void HolographicVoiceInputMain::OnLocatabilityChanged(SpatialLocator^ sender, Object^ args)
00617 {
00618     switch (sender->Locatability)
00619     {
00620     case SpatialLocatability::Unavailable:
00621         // Holograms cannot be rendered.
00622         {
00623             String^ message = L"Warning! Positional tracking is " +
00624                                         sender->Locatability.ToString() + L".\n";
00625             OutputDebugStringW(message->Data());
00626         }
00627         break;
00628
00629     // In the following three cases, it is still possible to place holograms using a
00630     // SpatialLocatorAttachedFrameOfReference.
00631     case SpatialLocatability::PositionalTrackingActivating:
00632         // The system is preparing to use positional tracking.
00633
00634     case SpatialLocatability::OrientationOnly:
00635         // Positional tracking has not been activated.
00636
00637     case SpatialLocatability::PositionalTrackingInhibited:
00638         // Positional tracking is temporarily inhibited. User action may be required
00639         // in order to restore positional tracking.
00640         break;
00641
00642     case SpatialLocatability::PositionalTrackingActive:
00643         // Positional tracking is active. World-locked content can be rendered.
00644         break;
00645     }
00646 }
00647
00648 void HolographicVoiceInputMain::OnCameraAdded(
00649     HolographicSpace^ sender,
00650     HolographicSpaceCameraAddedEventArgs^ args
00651     )
00652 {
00653     Deferral^ deferral = args->GetDeferral();
00654     HolographicCamera^ holographicCamera = args->Camera;
00655     create_task([this, deferral, holographicCamera] ()
00656     {
00657         //
00658         // TODO: Allocate resources for the new camera and load any content specific to
00659         //       that camera. Note that the render target size (in pixels) is a property
00660         //       of the HolographicCamera object, and can be used to create off-screen
00661         //       render targets that match the resolution of the HolographicCamera.
00662         //
00663
00664         // Create device-based resources for the holographic camera and add it to the list of
00665         // cameras used for updates and rendering. Notes:
00666         //   * Since this function may be called at any time, the AddHolographicCamera function
00667         //     waits until it can get a lock on the set of holographic camera resources before
00668         //     adding the new camera. At 60 frames per second this wait should not take long.
00669         //   * A subsequent Update will take the back buffer from the RenderingParameters of this
00670         //     camera's CameraPose and use it to create the ID3D11RenderTargetView for this camera.
00671         //     Content can then be rendered for the HolographicCamera.
00672         m_deviceResources->AddHolographicCamera(holographicCamera);
00673
00674         // Holographic frame predictions will not include any information about this camera until
00675         // the deferral is completed.
00676         deferral->Complete();
00677     });
00678 }
00679
00680 void HolographicVoiceInputMain::OnCameraRemoved(
00681     HolographicSpace^ sender,
00682     HolographicSpaceCameraRemovedEventArgs^ args
00683     )
00684 {
00685     create_task([this]()
00686     {
00687         //
00688         // TODO: Asynchronously unload or deactivate content resources (not back buffer
00689         //       resources) that are specific only to the camera that was removed.
00690         //
00691     });
00692
00693     // Before letting this callback return, ensure that all references to the back buffer
00694     // are released.
00695     // Since this function may be called at any time, the RemoveHolographicCamera function
00696     // waits until it can get a lock on the set of holographic camera resources before
00697     // deallocating resources for this camera. At 60 frames per second this wait should
00698     // not take long.
00699     m_deviceResources->RemoveHolographicCamera(args->Camera);
00700 }
00701
00702
00703 // For speech example.
00704 // Change the cube color, if we get a valid result.
00705 void HolographicVoiceInputMain::OnResultGenerated(SpeechContinuousRecognitionSession ^sender, SpeechContinuousRecognitionResultGeneratedEventArgs ^args)
00706 {
00707     // For our list of commands, medium confidence is good enough.
00708     // We also accept results that have high confidence.
00709     if ((args->Result->Confidence == SpeechRecognitionConfidence::High) ||
00710         (args->Result->Confidence == SpeechRecognitionConfidence::Medium))
00711     {
00712         m_lastCommand = args->Result->Text;
00713
00714         // When the debugger is attached, we can print information to the debug console.
00715         PrintWstringToDebugConsole(
00716             std::wstring(L"Last command was: ") +
00717             m_lastCommand->Data() +
00718             L"\n"
00719         );
00720
00721         // Play a sound to indicate a command was understood.
00722         PlayRecognitionSound();
00723     }
00724     else
00725     {
00726         OutputDebugStringW(L"Recognition confidence not high enough.\n");
00727     }
00728 }
00729
00730 void HolographicVoiceInputMain::OnSpeechQualityDegraded(Windows::Media::SpeechRecognition::SpeechRecognizer^ recognizer, Windows::Media::SpeechRecognition::SpeechRecognitionQualityDegradingEventArgs^ args)
00731 {
00732     switch (args->Problem)
00733     {
00734     case SpeechRecognitionAudioProblem::TooFast:
00735         OutputDebugStringW(L"The user spoke too quickly.\n");
00736         break;
00737
00738     case SpeechRecognitionAudioProblem::TooSlow:
00739         OutputDebugStringW(L"The user spoke too slowly.\n");
00740         break;
00741
00742     case SpeechRecognitionAudioProblem::TooQuiet:
00743         OutputDebugStringW(L"The user spoke too softly.\n");
00744         break;
00745
00746     case SpeechRecognitionAudioProblem::TooLoud:
00747         OutputDebugStringW(L"The user spoke too loudly.\n");
00748         break;
00749
00750     case SpeechRecognitionAudioProblem::TooNoisy:
00751         OutputDebugStringW(L"There is too much noise in the signal.\n");
00752         break;
00753
00754     case SpeechRecognitionAudioProblem::NoSignal:
00755         OutputDebugStringW(L"There is no signal.\n");
00756         break;
00757
00758     case SpeechRecognitionAudioProblem::None:
00759     default:
00760         OutputDebugStringW(L"An error was reported with no information.\n");
00761         break;
00762     }
00763 }
Generated on Fri Nov 15 2024 22:19:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Audio/EmailSound/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Audio
  • EmailSound

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.UI.Xaml.Controls;
00002
00003 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00004
00005 namespace Notifications.ScenarioPages.Toasts.Audio.EmailSound
00006 {
00007     /// <summary>
00008     /// An empty page that can be used on its own or navigated to within a Frame.
00009     /// </summary>
00010     public sealed partial class ScenarioElement : UserControl
00011     {
00012         public ScenarioElement()
00013         {
00014             this.InitializeComponent();
00015
00016             Initialize();
00017         }
00018
00019         private void Initialize()
00020         {
00021             // Specify the toast payload
00022             popToastControl.Payload =
00023 $@"<toast>
00024     <visual>
00025         <binding template='ToastGeneric'>
00026             <text>Email Audio Toast</text>
00027             <text>This toast's audio uses one of the system-provided sounds: Notification.Mail</text>
00028         </binding>
00029     </visual>
00030
00031     <audio src='ms-winsoundevent:Notification.Mail'/>
00032
00033 </toast>";
00034         }
00035     }
00036 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SimpleInk/cpp/Scenario9.xaml.cpp Source File

  • SimpleInk
  • cpp

Scenario9.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #include "pch.h"
00012 #include "Scenario9.xaml.h"
00013 #include <WindowsNumerics.h>
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Platform::Collections;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Foundation::Numerics;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Input::Inking;
00024 using namespace Windows::UI::Input::Inking::Core;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::UI::Xaml::Navigation;
00027
00028 Scenario9::Scenario9()
00029 {
00030     InitializeComponent();
00031
00032     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00033     inkCanvas->InkPresenter->StrokesCollected += ref new TypedEventHandler<InkPresenter^, InkStrokesCollectedEventArgs^>(this, &Scenario9::InkPresenter_StrokesCollected);
00034 }
00035
00036 void Scenario9::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00037 {
00038     StopReplay();
00039 }
00040
00041 void Scenario9::InkPresenter_StrokesCollected(InkPresenter^ sender, InkStrokesCollectedEventArgs^ e)
00042 {
00043     IVectorView<InkStroke^>^ strokes = e->Strokes;
00044     String^ log = L"Strokes collected: " + strokes->Size.ToString();
00045
00046     auto timestampFormatter = ref new Windows::Globalization::DateTimeFormatting::DateTimeFormatter("day month year hour minute second");
00047
00048     for (InkStroke^ stroke : strokes)
00049     {
00050         log += "\nId: " + stroke->Id.ToString() +
00051             ", StartedTime: " + timestampFormatter->Format(stroke->StrokeStartedTime->Value) +
00052             ", Duration: " + (stroke->StrokeDuration->Value.Duration / 10000L) + "ms";
00053     }
00054     rootPage->NotifyUser(log, NotifyType::StatusMessage);
00055 }
00056
00057 void Scenario9::OnSizeChanged(Object^ sender, SizeChangedEventArgs^ e)
00058 {
00059     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00060 }
00061
00062 void Scenario9::OnReset(Object^ sender, RoutedEventArgs^ e)
00063 {
00064     StopReplay();
00065     inkCanvas->InkPresenter->StrokeContainer->Clear();
00066     ClearCanvasStrokeCache();
00067     rootPage->NotifyUser("Cleared Canvas", NotifyType::StatusMessage);
00068 }
00069
00070 void Scenario9::ClearCanvasStrokeCache()
00071 {
00072     // Workaround for builds prior to 17650.
00073     // Throw away the old inkCanvas and create a new one to avoid accumulation of old strokes.
00074     outputGrid->Children->Clear();
00075     inkCanvas = ref new Windows::UI::Xaml::Controls::InkCanvas();
00076     outputGrid->Children->Append(inkCanvas);
00077     inkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Pen | CoreInputDeviceTypes::Touch;
00078     inkCanvas->InkPresenter->StrokesCollected += ref new TypedEventHandler<InkPresenter^, InkStrokesCollectedEventArgs^>(this, &Scenario9::InkPresenter_StrokesCollected);
00079     HelperFunctions::UpdateCanvasSize(RootGrid, outputGrid, inkCanvas);
00080 }
00081
00082 DateTime GetCurrentDateTime()
00083 {
00084     FILETIME fileTime;
00085     GetSystemTimeAsFileTime(&fileTime);
00086     return DateTime{ (static_cast<uint64_t>(fileTime.dwHighDateTime) << 32) | fileTime.dwLowDateTime };
00087 }
00088
00089 void Scenario9::OnReplay(Object^ sender, RoutedEventArgs^ e)
00090 {
00091     if (!strokeBuilder)
00092     {
00093         strokeBuilder = ref new InkStrokeBuilder();
00094         inkReplayTimer = ref new DispatcherTimer();
00095         inkReplayTimer->Interval = TimeSpan{ 10000000 / FPS };
00096         inkReplayTimer->Tick += ref new EventHandler<Object^>(this, &Scenario9::InkReplayTimer_Tick);
00097     }
00098
00099     strokesToReplay = inkCanvas->InkPresenter->StrokeContainer->GetStrokes();
00100
00101     ReplayButton->IsEnabled = false;
00102     inkCanvas->InkPresenter->IsInputEnabled = false;
00103     ClearCanvasStrokeCache();
00104
00105     // Calculate the beginning of the earliest stroke and the end of the latest stroke.
00106     // This establishes the time period during which the strokes were collected.
00107     beginTimeOfRecordedSession = DateTime{ MAXINT64 };
00108     endTimeOfRecordedSession = DateTime{ MININT64 };
00109     for (InkStroke^ stroke : strokesToReplay)
00110     {
00111         IBox<DateTime>^ startTime = stroke->StrokeStartedTime;
00112         IBox<TimeSpan>^ duration = stroke->StrokeDuration;
00113         if (startTime && duration)
00114         {
00115             if (beginTimeOfRecordedSession.UniversalTime > startTime->Value.UniversalTime)
00116             {
00117                 beginTimeOfRecordedSession.UniversalTime = startTime->Value.UniversalTime;
00118             }
00119             if (endTimeOfRecordedSession.UniversalTime < startTime->Value.UniversalTime + duration->Value.Duration)
00120
00121             {
00122                 endTimeOfRecordedSession.UniversalTime = startTime->Value.UniversalTime + duration->Value.Duration;
00123             }
00124         }
00125     }
00126
00127     // If we found at least one stroke with a timestamp, then we can replay.
00128     if (beginTimeOfRecordedSession.UniversalTime != MAXINT64)
00129     {
00130         durationOfRecordedSession = TimeSpan{ endTimeOfRecordedSession.UniversalTime - beginTimeOfRecordedSession.UniversalTime };
00131
00132         ReplayProgress->Maximum = static_cast<double>(durationOfRecordedSession.Duration);
00133         ReplayProgress->Value = 0.0;
00134         ReplayProgress->Visibility = Windows::UI::Xaml::Visibility::Visible;
00135
00136         beginTimeOfReplay = GetCurrentDateTime();
00137         inkReplayTimer->Start();
00138
00139         rootPage->NotifyUser("Replay started.", NotifyType::StatusMessage);
00140     }
00141     else
00142     {
00143         // There was nothing to replay. Either there were no strokes at all,
00144         // or none of the strokes had timestamps.
00145         StopReplay();
00146     }
00147 }
00148
00149 void Scenario9::StopReplay()
00150 {
00151     if (inkReplayTimer)
00152     {
00153         inkReplayTimer->Stop();
00154     }
00155
00156     ReplayButton->IsEnabled = true;
00157     inkCanvas->InkPresenter->IsInputEnabled = true;
00158     ReplayProgress->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
00159
00160 }
00161
00162 void Scenario9::InkReplayTimer_Tick(Object^ sender, Object^ e)
00163 {
00164     DateTime currentTimeOfReplay = GetCurrentDateTime();
00165     TimeSpan timeElapsedInReplay = TimeSpan{ currentTimeOfReplay.UniversalTime - beginTimeOfReplay.UniversalTime };
00166
00167     ReplayProgress->Value = static_cast<double>(timeElapsedInReplay.Duration);
00168
00169     DateTime timeEquivalentInRecordedSession = DateTime{ beginTimeOfRecordedSession.UniversalTime + timeElapsedInReplay.Duration };
00170     inkCanvas->InkPresenter->StrokeContainer = GetCurrentStrokesView(timeEquivalentInRecordedSession);
00171
00172     if (timeElapsedInReplay.Duration > durationOfRecordedSession.Duration)
00173     {
00174         StopReplay();
00175         rootPage->NotifyUser("Replay finished.", NotifyType::StatusMessage);
00176     }
00177 }
00178
00179 InkStrokeContainer^ Scenario9::GetCurrentStrokesView(DateTime time)
00180 {
00181     auto inkStrokeContainer = ref new InkStrokeContainer();
00182
00183     // The purpose of this sample is to demonstrate the timestamp usage,
00184     // not the algorithm. (The time complexity of the code is O(N^2).)
00185     for (auto stroke : strokesToReplay)
00186     {
00187         InkStroke^ s = GetPartialStroke(stroke, time);
00188         if (s)
00189         {
00190             inkStrokeContainer->AddStroke(s);
00191         }
00192     }
00193
00194     return inkStrokeContainer;
00195 }
00196
00197 InkStroke^ Scenario9::GetPartialStroke(InkStroke^ stroke, DateTime time)
00198 {
00199     IBox<DateTime>^ startTime = stroke->StrokeStartedTime;
00200     IBox<TimeSpan>^ duration = stroke->StrokeDuration;
00201     if (!startTime || !duration)
00202     {
00203         // If a stroke does not have valid timestamp, then treat it as
00204         // having been drawn before the playback started.
00205         // We must return a clone of the stroke, because a single stroke cannot
00206         // exist in more than one container.
00207         return stroke->Clone();
00208     }
00209
00210     if (time.UniversalTime < startTime->Value.UniversalTime)
00211     {
00212         // Stroke has not started
00213         return nullptr;
00214     }
00215
00216     if (time.UniversalTime >= startTime->Value.UniversalTime + duration->Value.Duration)
00217     {
00218         // Stroke has already ended.
00219         // We must return a clone of the stroke, because a single stroke cannot exist in more than one container.
00220         return stroke->Clone();
00221     }
00222
00223     // Stroke has started but not yet ended.
00224     // Create a partial stroke on the assumption that the ink points are evenly distributed in time.
00225     IVectorView<InkPoint^>^ points = stroke->GetInkPoints();
00226     double portion = static_cast<double>(time.UniversalTime - startTime->Value.UniversalTime) / duration->Value.Duration;
00227     auto count = (int)((points->Size - 1) * portion) + 1;
00228     auto initialPoints = ref new VectorView<InkPoint^>(begin(points), begin(points) + count);
00229     return strokeBuilder->CreateStrokeFromInkPoints(initialPoints, float3x2::identity());
00230 }
Generated on Fri Nov 15 2024 22:20:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NetworkConnectivity/cppwinrt/Scenario2_NetworkCost.h Source File

  • NetworkConnectivity
  • cppwinrt

Scenario2_NetworkCost.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 #pragma once
00012 #include "Scenario2_NetworkCost.g.h"
00013
00014 namespace winrt::SDKTemplate::implementation
00015 {
00016     struct Scenario2_NetworkCost : Scenario2_NetworkCostT<Scenario2_NetworkCost>
00017     {
00018         Scenario2_NetworkCost();
00019         void GetNetworkCost_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00020     };
00021 }
00022
00023 namespace winrt::SDKTemplate::factory_implementation
00024 {
00025     struct Scenario2_NetworkCost : Scenario2_NetworkCostT<Scenario2_NetworkCost, implementation::Scenario2_NetworkCost>
00026     {
00027     };
00028 }
Generated on Fri Nov 15 2024 22:20:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ShowHideEvents Member List

This is the complete list of members for Scenario2_ShowHideEvents, including all inherited members.
OnHiding(InputPane sender, InputPaneVisibilityEventArgs e) | Scenario2_ShowHideEvents | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_ShowHideEvents | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_ShowHideEvents | [inline, protected]
OnShowing(InputPane sender, InputPaneVisibilityEventArgs e) | Scenario2_ShowHideEvents | [inline, private]
Scenario2_ShowHideEvents() | Scenario2_ShowHideEvents | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario4_EdgeTappedListView Member List

This is the complete list of members for Scenario4_EdgeTappedListView, including all inherited members.
AddItem(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_EdgeTappedListView |
CancelSelection(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_EdgeTappedListView |
Contacts | Scenario4_EdgeTappedListView | [private]
OnBackRequested(Windows::Foundation::IInspectable const &, Windows::UI::Core::BackRequestedEventArgs const &e) | Scenario4_EdgeTappedListView | [private]
OnEdgeTapped(SDKTemplate::EdgeTappedListView const &, SDKTemplate::ListViewEdgeTappedEventArgs const &) | Scenario4_EdgeTappedListView |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_EdgeTappedListView |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario4_EdgeTappedListView |
OnSelectionChanged(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Controls::SelectionChangedEventArgs const &) | Scenario4_EdgeTappedListView |
RemoveItem(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_EdgeTappedListView |
Scenario4_EdgeTappedListView() | Scenario4_EdgeTappedListView |
SelectItems(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario4_EdgeTappedListView |
SetCommandsVisibility(Windows::UI::Xaml::Controls::ListView const &listView) | Scenario4_EdgeTappedListView | [private]
UpdateSelectionUI() | Scenario4_EdgeTappedListView | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario6.xaml.cs Source File

  • XamlCommanding
  • cs

Scenario6.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace Commanding
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class Scenario6 : Page
00022     {
00023         public Scenario6()
00024         {
00025             this.InitializeComponent();
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SuperMutt::VendorCommand Member List

This is the complete list of members for SuperMutt::VendorCommand, including all inherited members.
GetLedBlinkPattern | SuperMutt::VendorCommand
SetLedBlinkPattern | SuperMutt::VendorCommand
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicHologram/cs/AppViewSource.cs Source File

  • BasicHologram
  • cs

AppViewSource.cs

Go to the documentation of this file.
00001 ﻿using Windows.ApplicationModel.Core;
00002
00003 namespace BasicHologram
00004 {
00005     // The entry point for the app.
00006     internal class AppViewSource : IFrameworkViewSource
00007     {
00008         public IFrameworkView CreateView()
00009         {
00010             return new AppView();
00011         }
00012     }
00013 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MediaTranscoding/cpp/SampleConfiguration.h Source File

  • MediaTranscoding
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Media Transcoding";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cs/Scenario3_MultipleClaims.xaml.cs Source File

  • PosPrinter
  • cs

Scenario3_MultipleClaims.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Devices.PointOfService;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public sealed partial class Scenario3_MultipleClaims : Page
00019     {
00020         MainPage rootPage = MainPage.Current;
00021
00022         public Scenario3_MultipleClaims()
00023         {
00024             this.InitializeComponent();
00025         }
00026
00027         async void ClaimSamePrinter_Click()
00028         {
00029             ClaimResultText.Text = "";
00030             rootPage.NotifyUser("", NotifyType.StatusMessage);
00031
00032             if (rootPage.Printer == null)
00033             {
00034                 rootPage.NotifyUser("Use scenario 1 to find a printer first.", NotifyType.ErrorMessage);
00035                 return;
00036             }
00037
00038             using (var printer = await PosPrinter.FromIdAsync(rootPage.Printer.DeviceId))
00039             {
00040                 if (printer == null)
00041                 {
00042                     rootPage.NotifyUser("Cannot create same printer as scenario 1.", NotifyType.ErrorMessage);
00043                 }
00044
00045                 using (var claimedPrinter = await printer.ClaimPrinterAsync())
00046                 {
00047                     if (claimedPrinter != null)
00048                     {
00049                         ClaimResultText.Text = "Claimed the printer.";
00050
00051                         // This scenario doesn't do anything with the printer aside from claim it.
00052                         // The "using" statement will dispose the claimed printer.
00053                     }
00054                     else
00055                     {
00056                         ClaimResultText.Text = "Did not claim the printer.";
00057                     }
00058                 }
00059                 // The "using" statement will dispose the duplicate printer.
00060             }
00061         }
00062     }
00063 }
Generated on Fri Nov 15 2024 22:20:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/SampleConfiguration.cpp Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     // The format here is the following:
00012     { "Using Custom Components",                                     "SDKSample.ProxyStubsForWinRTComponents.OvenClient" },
00013     { "Using Custom Components (Implemented using WRL)",             "SDKSample.ProxyStubsForWinRTComponents.OvenClientWRL" },
00014     { "Handling Windows Runtime Exceptions",                         "SDKSample.ProxyStubsForWinRTComponents.CustomException" },
00015     { "Handling Windows Runtime Exceptions (Implemented using WRL)", "SDKSample.ProxyStubsForWinRTComponents.CustomExceptionWRL" }
00016 };
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/ListsAndTemplates.xaml.cpp Source File

  • XamlBind
  • cpp

ListsAndTemplates.xaml.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // ListsAndTemplates.xaml.cpp
00003 // Implementation of the ListsAndTemplates class
00004 //
00005
00006 #include "pch.h"
00007 #include "ListsAndTemplates.xaml.h"
00008
00009 using namespace SDKTemplate;
00010
00011 using namespace Platform;
00012 using namespace Windows::Foundation;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::UI::Xaml;
00015 using namespace Windows::UI::Xaml::Controls;
00016 using namespace Windows::UI::Xaml::Controls::Primitives;
00017 using namespace Windows::UI::Xaml::Data;
00018 using namespace Windows::UI::Xaml::Input;
00019 using namespace Windows::UI::Xaml::Media;
00020 using namespace Windows::UI::Xaml::Navigation;
00021 using namespace Windows::UI::Xaml::Interop;
00022
00023 using namespace xBindSampleModel;
00024
00025 ListsAndTemplates::ListsAndTemplates()
00026 {
00027     this->Model = ref new DataModel();
00028     this->Employees = ref new Platform::Collections::Vector<IEmployee^>();
00029     this->InitializeComponent();
00030     this->InitializeValues();
00031 }
00032
00033 void ListsAndTemplates::InitializeValues()
00034 {
00035     this->Model->InitializeValues();
00036     this->Employees->Clear();
00037     for (IEmployee^ e : Model->ManagerProp->ReportsList)
00038     {
00039         this->Employees->Append(e);
00040     }
00041 }
00042
00043 void ListsAndTemplates::UpdateValuesClick(Object^ sender, ::Windows::UI::Xaml::RoutedEventArgs^ e)
00044 {
00045     this->Model->UpdateValues();
00046     IEmployee^ temp = Employees->GetAt(0);
00047     Employees->RemoveAt(0);
00048     Employees->Append(temp);
00049 }
00050
00051 void ListsAndTemplates::ResetValuesClick(Object^ sender, ::Windows::UI::Xaml::RoutedEventArgs^ e)
00052 {
00053     this->InitializeValues();
00054 }
Generated on Fri Nov 15 2024 22:22:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ConnectedDevice Member List

This is the complete list of members for ConnectedDevice, including all inherited members.
Close() | ConnectedDevice | [inline]
ConnectedDevice(hstring displayNameIn, Windows::Devices::WiFiDirect::WiFiDirectDevice const &wfdDeviceIn, com_ptr< SocketReaderWriter > const &socketRWIn) | ConnectedDevice | [inline]
displayName | ConnectedDevice | [private]
DisplayName() | ConnectedDevice | [inline]
SocketRW() | ConnectedDevice | [inline]
socketRW | ConnectedDevice | [private]
wfdDevice | ConnectedDevice | [private]
WfdDevice() | ConnectedDevice | [inline]
Generated on Fri Nov 15 2024 22:24:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TilesHelper Member List

This is the complete list of members for TilesHelper, including all inherited members.
FindExisting(string tileId) | TilesHelper | [inline, static]
GenerateSecondaryTile(string tileId, string displayName) | TilesHelper | [inline, static]
GenerateSecondaryTile(string displayName) | TilesHelper | [inline, static]
PinNewSecondaryTile() | TilesHelper | [inline, static]
PinNewSecondaryTile(string displayName, string xml) | TilesHelper | [inline, static]
UpdateTile(string tileId, XmlDocument doc) | TilesHelper | [inline, static]
UpdateTiles(string xml) | TilesHelper | [inline, static]
UpdateTiles(XmlDocument doc) | TilesHelper | [inline, static]
Generated on Fri Nov 15 2024 22:23:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Content Member List

This is the complete list of members for Content, including all inherited members.
activeAccount | Content | [private]
Button_Forget_Click(object sender, RoutedEventArgs e) | Content | [inline, private]
Button_Restart_Click(object sender, RoutedEventArgs e) | Content | [inline, private]
Content() | Content | [inline]
DeletePassportServerSide() | Content | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Content | [inline, protected]
PassportDelete() | Content | [inline, private]
rootPage | Content | [private]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AudioCategory/cs/AudioCategory/Scenario1.xaml.cs Source File

  • AudioCategory
  • cs
  • AudioCategory

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016 using Windows.UI.Xaml.Media;
00017
00018 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00019
00020 namespace PlaybackManager
00021 {
00022     /// <summary>
00023     /// An empty page that can be used on its own or navigated to within a Frame.
00024     /// </summary>
00025     public sealed partial class Scenario1 : Page
00026     {
00027         public Scenario1()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         private void Default_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00033         {
00034             Playback.SetAudioCategory(AudioCategory.Movie);
00035             Playback.SelectFile();
00036         }
00037     }
00038 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomHidDeviceAccess/cpp/Utilities.cpp Source File

  • CustomHidDeviceAccess
  • cpp

Utilities.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 #include "pch.h"
00008 #include "Utilities.h"
00009 #include "MainPage.xaml.h"
00010
00011 using namespace SDKTemplate;
00012 using namespace Platform;
00013 using namespace Windows::Foundation::Collections;
00014 using namespace Windows::UI::Xaml;
00015
00016 /// <summary>
00017 /// Displays the compatible scenarios and hides the non-compatible ones.
00018 /// If there are no supported devices, the scenarioContainer will be hidden and an error message
00019 /// will be displayed.
00020 /// </summary>
00021 /// <param name="scenarios">The key is the device type that the value, scenario, supports.</param>
00022 /// <param name="scenarioContainer">The container that encompasses all the scenarios that are specific to devices</param>
00023 void Utilities::SetUpDeviceScenarios(IMap<SDKTemplate::DeviceType, UIElement^>^ scenarios, UIElement^ scenarioContainer)
00024 {
00025     UIElement^ supportedScenario = nullptr;
00026
00027     if (EventHandlerForDevice::Current->IsDeviceConnected)
00028     {
00029         for (IKeyValuePair<DeviceType, UIElement^>^ deviceScenario : scenarios)
00030         {
00031             // Enable the scenario if it's generic or the device type matches
00032             if ((deviceScenario->Key == DeviceType::All)
00033                 || (deviceScenario->Key == Utilities::GetDeviceType(EventHandlerForDevice::Current->Device)))
00034             {
00035                 // Make the scenario visible in case other devices use the same scenario and collapsed it.
00036                 deviceScenario->Value->Visibility = Visibility::Visible;
00037
00038                 supportedScenario = deviceScenario->Value;
00039             }
00040             else if (deviceScenario->Value != supportedScenario)
00041             {
00042                 // Don't hide the scenario if it is supported by the current device and is shared by other devices
00043                 deviceScenario->Value->Visibility = Visibility::Collapsed;
00044             }
00045         }
00046     }
00047
00048     if (supportedScenario == nullptr)
00049     {
00050         // Hide the container so that common elements shared across scenarios are also hidden
00051         scenarioContainer->Visibility = Visibility::Collapsed;
00052
00053         NotifyDeviceNotConnected();
00054     }
00055 }
00056
00057 /// <summary>
00058 /// Will check if a device is currently connected (can be used). If there is no such device, this method will
00059 /// notify the user with an error message.
00060 /// </summary>
00061 /// <returns>True if a notification was sent to the UI (No device is connected); False otherwise</returns>
00062 void Utilities::NotifyDeviceNotConnected(void)
00063 {
00064     MainPage::Current->NotifyUser("Device is not connected, please select a plugged in device to try the scenario again", NotifyType::ErrorMessage);
00065 }
00066
00067 /// <summary>
00068 /// Attempts to match the provided device with a well known device and returns the well known type
00069 /// </summary>
00070 /// <param name="device"></param>
00071 /// <returns>Device type of the current connected device or DeviceType.None if there are no devices connected or is not recognized</returns>
00072 DeviceType Utilities::GetDeviceType(Windows::Devices::HumanInterfaceDevice::HidDevice^ device)
00073 {
00074     if (device != nullptr
00075         && device->VendorId == SuperMutt::Device::Vid
00076         && device->ProductId == SuperMutt::Device::Pid)
00077     {
00078             return DeviceType::SuperMutt;
00079     }
00080
00081     return DeviceType::None;
00082 }
00083
00084 bool Utilities::IsSuperMuttDevice(Windows::Devices::HumanInterfaceDevice::HidDevice^ device)
00085 {
00086     return (GetDeviceType(device) == DeviceType::SuperMutt);
00087 }
Generated on Fri Nov 15 2024 22:19:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SyncBackgroundTaskInformation Member List

This is the complete list of members for SyncBackgroundTaskInformation, including all inherited members.
Name | SyncBackgroundTaskInformation
TaskCanceled | SyncBackgroundTaskInformation
TaskCompleted | SyncBackgroundTaskInformation
TaskEntryPoint | SyncBackgroundTaskInformation
Generated on Fri Nov 15 2024 22:23:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileHotspot/cppwinrt/Scenario1_ConfigureMobileHotspot.h Source File

  • MobileHotspot
  • cppwinrt

Scenario1_ConfigureMobileHotspot.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_ConfigureMobileHotspot.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_ConfigureMobileHotspot : Scenario1_ConfigureMobileHotspotT<Scenario1_ConfigureMobileHotspot>
00019     {
00020         Scenario1_ConfigureMobileHotspot();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         fire_and_forget ApplyChanges_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00024         void DiscardChanges_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00025
00026     private:
00027         Windows::Networking::NetworkOperators::NetworkOperatorTetheringManager m_tetheringManager{ nullptr };
00028         bool m_applying{ false };
00029
00030         void InitializeTetheringControls();
00031
00032         void AddComboBoxItem(Windows::UI::Xaml::Controls::ComboBox const& comboBox, hstring name, Windows::Foundation::IInspectable const& tag, bool selected);
00033
00034         template<typename T>
00035         void AddComboBoxItem(Windows::UI::Xaml::Controls::ComboBox const& comboBox, T value, bool selected)
00036         {
00037             AddComboBoxItem(comboBox, SDKTemplate::GetFriendlyName(value), box_value(value), selected);
00038         }
00039     };
00040 }
00041
00042 namespace winrt::SDKTemplate::factory_implementation
00043 {
00044     struct Scenario1_ConfigureMobileHotspot : Scenario1_ConfigureMobileHotspotT<Scenario1_ConfigureMobileHotspot, implementation::Scenario1_ConfigureMobileHotspot>
00045     {
00046     };
00047 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OnDemandHotspot/cppwinrt/Scenario1_ManageHotspot.cpp Source File

  • OnDemandHotspot
  • cppwinrt

Scenario1_ManageHotspot.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "SampleConfiguration.h"
00014 #include "Scenario1_ManageHotspot.h"
00015 #include "Scenario1_ManageHotspot.g.cpp"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::ApplicationModel::Background;
00019 using namespace winrt::Windows::Devices::WiFi;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::Foundation::Collections;
00022 using namespace winrt::Windows::Security::Credentials;
00023 using namespace winrt::Windows::Storage;
00024 using namespace winrt::Windows::UI::Xaml;
00025 using namespace winrt::Windows::UI::Xaml::Navigation;
00026
00027 namespace winrt::SDKTemplate::implementation
00028 {
00029     Scenario1_ManageHotspot::Scenario1_ManageHotspot()
00030     {
00031         InitializeComponent();
00032     }
00033
00034     void Scenario1_ManageHotspot::OnNavigatedTo(NavigationEventArgs const&)
00035     {
00036         m_network = WiFiOnDemandHotspotNetwork::GetOrCreateById(Constants::SampleHotspotGuid);
00037
00038         // Copy the values from the network properties into our UI.
00039         WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
00040         DisplayNameText().Text(properties.DisplayName());
00041         AvailableToggle().IsOn(properties.Availability() == WiFiOnDemandHotspotAvailability::Available);
00042         std::optional<WiFiOnDemandHotspotCellularBars> bars = properties.CellularBars();
00043         CellularBarsToggle().IsOn(bars.has_value());
00044         static_assert(0 == (int)WiFiOnDemandHotspotCellularBars::ZeroBars);
00045         static_assert(1 == (int)WiFiOnDemandHotspotCellularBars::OneBar);
00046         static_assert(2 == (int)WiFiOnDemandHotspotCellularBars::TwoBars);
00047         static_assert(3 == (int)WiFiOnDemandHotspotCellularBars::ThreeBars);
00048         static_assert(4 == (int)WiFiOnDemandHotspotCellularBars::FourBars);
00049         static_assert(5 == (int)WiFiOnDemandHotspotCellularBars::FiveBars);
00050         CellularBarsSlider().Value(static_cast<int>(bars.value_or(WiFiOnDemandHotspotCellularBars::ZeroBars)));
00051         std::optional<uint32_t> batteryPercent = properties.RemainingBatteryPercent();
00052         BatteryPercentageToggle().IsOn(batteryPercent.has_value());
00053         BatteryPercentageSlider().Value(batteryPercent.value_or(0));
00054         SsidText().Text(properties.Ssid());
00055         PasswordCredential password = properties.Password();
00056         PasswordText().Password(password ? password.Password() : L"");
00057
00058         // Determine whether the background tasks are registered.
00059         bool isRegistered = false;
00060         for (const auto& [guid, task] : BackgroundTaskRegistration::AllTasks())
00061         {
00062             hstring name = task.Name();
00063             if (name == Constants::MetadataUpdateTaskName ||
00064                 name == Constants::DeviceWatcherTaskName ||
00065                 name == Constants::ConnectTaskName)
00066             {
00067                 isRegistered = true;
00068                 break;
00069             }
00070         }
00071
00072         VisualStateManager::GoToState(*this, isRegistered ? L"Registered" : L"NotRegistered", false);
00073     }
00074
00075     void Scenario1_ManageHotspot::RegisterTasks_Click(IInspectable const&, RoutedEventArgs const&)
00076     {
00077         // Register the background task which updates the hotspot metadata when the system
00078         // shows a list of Wi-Fi networks.
00079         WiFiOnDemandHotspotUpdateMetadataTrigger updateMetadataTrigger;
00080         BackgroundTaskBuilder backgroundTaskBuilder;
00081         backgroundTaskBuilder.Name(Constants::MetadataUpdateTaskName);
00082         backgroundTaskBuilder.TaskEntryPoint(Constants::MetadataUpdateEntryPoint);
00083         backgroundTaskBuilder.SetTrigger(updateMetadataTrigger);
00084         BackgroundTaskRegistration updateMetadataRegistration = backgroundTaskBuilder.Register();
00085
00086         // Register the background task which turns on the on-demand hotspot when the user
00087         // selects it.
00088         WiFiOnDemandHotspotConnectTrigger connectTrigger;
00089         backgroundTaskBuilder.Name(Constants::ConnectTaskName);
00090         backgroundTaskBuilder.TaskEntryPoint(Constants::ConnectEntryPoint);
00091         backgroundTaskBuilder.SetTrigger(connectTrigger);
00092         BackgroundTaskRegistration connectRegistration = backgroundTaskBuilder.Register();
00093
00094         // In practice, you will monitor when an on-demand hotspot comes into range or goes
00095         // of range so you can update the Availability. This sample does not have a physical
00096         // hotspot device, but we leave the code here as a demonstration.
00097 #if 0
00098         DeviceWatcher deviceWatcher = DeviceInformation::CreateWatcher(Contoso::Devices::OnDemandHotSpot::GetDeviceSelector());
00099         DeviceWatcherTrigger watcherTrigger = deviceWatcher.GetBackgroundTrigger({ DeviceWatcherEventKind::Add, DeviceWatcherEventKind::Remove, DeviceWatcherEventKind::Update });
00100         backgroundTaskBuilder.Name(Constants::DeviceWatcherTaskName);
00101         backgroundTaskBuilder.TaskEntryPoint(Constants::DeviceWatcherEntryPoint);
00102         backgroundTaskBuilder.SetTrigger(watcherTrigger);
00103         BackgroundTaskRegistration deviceWatcherRegistration = backgroundTaskBuilder.Register();
00104 #endif
00105
00106         VisualStateManager::GoToState(*this, L"Registered", false);
00107
00108     }
00109
00110     void Scenario1_ManageHotspot::UnregisterTasks_Click(IInspectable const&, RoutedEventArgs const&)
00111     {
00112         for (const auto& [guid, task] : BackgroundTaskRegistration::AllTasks())
00113         {
00114             hstring name = task.Name();
00115             if (name == Constants::MetadataUpdateTaskName ||
00116                 name == Constants::DeviceWatcherTaskName ||
00117                 name == Constants::ConnectTaskName)
00118             {
00119                 task.Unregister(true);
00120             }
00121         }
00122
00123         VisualStateManager::GoToState(*this, L"NotRegistered", false);
00124     }
00125
00126     bool Scenario1_ManageHotspot::SavePropertiesForBackgroundTask()
00127     {
00128         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00129
00130         if (AvailableToggle().IsOn() && DisplayNameText().Text().empty())
00131         {
00132             rootPage.NotifyUser(L"An Available network must have a name.", NotifyType::ErrorMessage);
00133             return false;
00134         }
00135
00136         if (SsidText().Text().empty())
00137         {
00138             rootPage.NotifyUser(L"You must provide an SSID for the Wi-Fi network.", NotifyType::ErrorMessage);
00139             return false;
00140         }
00141
00142         if (PasswordText().Password().empty())
00143         {
00144             rootPage.NotifyUser(L"You must provide a password for the Wi-Fi network.", NotifyType::ErrorMessage);
00145             return false;
00146         }
00147
00148         IPropertySet values = ApplicationData::Current().LocalSettings().Values();
00149         values.Insert(L"availability", box_value(AvailableToggle().IsOn()));
00150         values.Insert(L"displayName", box_value(DisplayNameText().Text()));
00151         values.Insert(L"bars", CellularBarsToggle().IsOn() ? box_value(static_cast<int>(CellularBarsSlider().Value())) : nullptr);
00152         values.Insert(L"battery", BatteryPercentageToggle().IsOn() ? box_value(static_cast<uint32_t>(BatteryPercentageSlider().Value())) : nullptr);
00153         values.Insert(L"ssid", box_value(SsidText().Text()));
00154         values.Insert(L"password", box_value(PasswordText().Password()));
00155         values.Insert(L"hotspotGuid", box_value(Constants::SampleHotspotGuid));
00156
00157         return true;
00158     }
00159
00160     void Scenario1_ManageHotspot::UpdateNowButton_Click(IInspectable const&, RoutedEventArgs const&)
00161     {
00162         if (SavePropertiesForBackgroundTask())
00163         {
00164             // Copy the properties from the UI into the system network properties
00165             // to configure how the on-demand hotspot appears in the system Wi-Fi list.
00166             WiFiOnDemandHotspotNetworkProperties properties = m_network.GetProperties();
00167             properties.Availability(AvailableToggle().IsOn() ? WiFiOnDemandHotspotAvailability::Available : WiFiOnDemandHotspotAvailability::Unavailable);
00168             properties.DisplayName(DisplayNameText().Text());
00169             properties.CellularBars(CellularBarsToggle().IsOn() ? std::optional(static_cast<WiFiOnDemandHotspotCellularBars>(CellularBarsSlider().Value())) : std::nullopt);
00170             properties.RemainingBatteryPercent(BatteryPercentageToggle().IsOn() ? std::optional(static_cast<uint32_t>(BatteryPercentageSlider().Value())) : std::nullopt);
00171             properties.Ssid(SsidText().Text());
00172
00173             PasswordCredential credential;
00174             credential.Password(PasswordText().Password());
00175             properties.Password(credential);
00176
00177             m_network.UpdateProperties(properties);
00178         }
00179     }
00180
00181     void Scenario1_ManageHotspot::UpdateOnDemandButton_Click(IInspectable const&, RoutedEventArgs const&)
00182     {
00183         SavePropertiesForBackgroundTask();
00184     }
00185 }
Generated on Fri Nov 15 2024 22:20:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SceneController Member List

This is the complete list of members for SceneController, including all inherited members.
AddSceneObject(std::shared_ptr< SceneObject > &newObject) | SceneController | [inline]
ClearSceneObjects() | SceneController | [inline]
CreateDeviceDependentResources() | SceneController |
m_deviceResources | SceneController | [private]
m_sceneObjects | SceneController | [private]
ReleaseDeviceDependentResources() | SceneController |
Render() | SceneController |
SceneController(const std::shared_ptr< DX::DeviceResources > &deviceResources) | SceneController |
Update(const DX::StepTimer &timer, Windows::Perception::Spatial::SpatialCoordinateSystem^viewCoords) | SceneController |
Generated on Fri Nov 15 2024 22:23:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3 Member List

This is the complete list of members for Scenario3, including all inherited members.
displayList_listview_SelectionChanged(object sender, SelectionChangedEventArgs e) | Scenario3 | [inline, private]
LoadAndDisplayScreens_Click(object sender, RoutedEventArgs e) | Scenario3 | [inline, private]
rootPage | Scenario3 | [private]
Scenario3() | Scenario3 | [inline]
StartProjecting(DeviceInformation selectedDisplay) | Scenario3 | [inline, private]
thisViewId | Scenario3 | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario1_UnspecifiedReason.xaml.h Source File

  • ExtendedExecution
  • cpp

Scenario1_UnspecifiedReason.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_UnspecifiedReason.g.h"
00015 #include "MainPage.xaml.h"
00016 #include <time.h>
00017
00018 namespace SDKTemplate
00019 {
00020     /// <summary>
00021     /// Page containing the Extended Execution Unspecified Reason scenario functions.
00022     /// </summary>
00023     [Windows::Foundation::Metadata::WebHostHidden]
00024     public ref class UnspecifiedReason sealed
00025     {
00026     public:
00027         UnspecifiedReason();
00028
00029     protected:
00030         void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^ e) override;
00031         void BeginExtendedExecution();
00032         void EndExtendedExecution();
00033
00034     private:
00035         MainPage^ rootPage = MainPage::Current;
00036         Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionSession^ session;
00037         Windows::System::Threading::ThreadPoolTimer^ periodicTimer;
00038         Windows::Foundation::EventRegistrationToken sessionRevokedToken;
00039         time_t startTime;
00040
00041         void ClearExtendedExecution();
00042         void UpdateUI();
00043         void OnTimer(Windows::System::Threading::ThreadPoolTimer^ timer);
00044         void SessionRevoked(Platform::Object^ sender, Windows::ApplicationModel::ExtendedExecution::ExtendedExecutionRevokedEventArgs^ args);
00045
00046     };
00047 }
Generated on Fri Nov 15 2024 22:19:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/GhostToast/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • GhostToast

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using Windows.Data.Xml.Dom;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Xaml;
00004 using Windows.UI.Xaml.Controls;
00005
00006 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00007
00008 namespace Notifications.ScenarioPages.Toasts.GhostToast
00009 {
00010     /// <summary>
00011     /// An empty page that can be used on its own or navigated to within a Frame.
00012     /// </summary>
00013     public sealed partial class ScenarioElement : UserControl
00014     {
00015         public ScenarioElement()
00016         {
00017             this.InitializeComponent();
00018         }
00019
00020         private void ButtonTriggerGhostToast_Click(object sender, RoutedEventArgs e)
00021         {
00022             XmlDocument toastXml = new XmlDocument();
00023             toastXml.LoadXml($@"
00024                 <toast>
00025                     <visual>
00026                         <binding template='ToastGeneric'>
00027                             <text>Ghost Toast</text>
00028                             <text>This toast silently appears into your Action Center.</text>
00029                         </binding>
00030                     </visual>
00031                 </toast>");
00032
00033             ToastNotification toast = new ToastNotification(toastXml)
00034             {
00035                 SuppressPopup = true
00036             };
00037             ToastNotificationManager.CreateToastNotifier().Show(toast);
00038         }
00039     }
00040 }
Generated on Fri Nov 15 2024 22:20:35 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Scenario3_DisplayOnOff.xaml.cpp Source File

  • ProximitySensor
  • cpp

Scenario3_DisplayOnOff.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3_DisplayOnOff.xaml.cpp
00014 // Implementation of the Scenario3_DisplayOnOff class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario3_DisplayOnOff.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Enumeration;
00024 using namespace Windows::Devices::Sensors;
00025 using namespace Windows::Foundation;
00026 using namespace Windows::Globalization::DateTimeFormatting;
00027 using namespace Windows::UI::Core;
00028 using namespace Windows::UI::Xaml;
00029 using namespace Windows::UI::Xaml::Controls;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 Scenario3_DisplayOnOff::Scenario3_DisplayOnOff() : rootPage(MainPage::Current), sensor(nullptr), displayController(nullptr)
00033 {
00034     InitializeComponent();
00035
00036     watcher = DeviceInformation::CreateWatcher(ProximitySensor::GetDeviceSelector());
00037     watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(this, &Scenario3_DisplayOnOff::OnProximitySensorAdded);
00038     watcher->Start();
00039 }
00040
00041 /// <summary>
00042 /// Invoked when the device watcher finds a proximity sensor
00043 /// </summary>
00044 /// <param name="sender">The device watcher</param>
00045 /// <param name="device">Device information for the proximity sensor that was found</param>
00046 void Scenario3_DisplayOnOff::OnProximitySensorAdded(DeviceWatcher^ /*sender*/, DeviceInformation^ device)
00047 {
00048     if (nullptr == sensor)
00049     {
00050         ProximitySensor^ foundSensor = ProximitySensor::FromId(device->Id);
00051         if (nullptr != foundSensor)
00052         {
00053             sensor = foundSensor;
00054         }
00055         else
00056         {
00057             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00058             {
00059                 rootPage->NotifyUser("Could not get a proximity sensor from the device id", NotifyType::ErrorMessage);
00060             }, CallbackContext::Any));
00061         }
00062     }
00063 }
00064
00065 /// <summary>
00066 /// Invoked when this page is about to be displayed in a Frame.
00067 /// </summary>
00068 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00069 /// property is typically used to configure the page.</param>
00070 void Scenario3_DisplayOnOff::OnNavigatedTo(NavigationEventArgs^ e)
00071 {
00072     ScenarioEnableButton->IsEnabled = true;
00073     ScenarioDisableButton->IsEnabled = false;
00074 }
00075
00076 /// <summary>
00077 /// Invoked when this page is no longer displayed.
00078 /// </summary>
00079 /// <param name="e"></param>
00080 void Scenario3_DisplayOnOff::OnNavigatedFrom(NavigationEventArgs^ e)
00081 {
00082     // If the navigation is external to the app do not clean up.
00083     // This can occur on Phone when suspending the app.
00084     if (NavigationMode::Forward == e->NavigationMode && nullptr == e->Uri)
00085     {
00086         return;
00087     }
00088
00089     if (ScenarioDisableButton->IsEnabled)
00090     {
00091         if (nullptr != displayController)
00092         {
00093             delete displayController; // closes the controller
00094             displayController = nullptr;
00095         }
00096     }
00097 }
00098
00099 /// <summary>
00100 /// This is the click handler for the 'Enable' button.
00101 /// </summary>
00102 /// <param name="sender"></param>
00103 /// <param name="e"></param>
00104 void Scenario3_DisplayOnOff::ScenarioEnable(Object^ sender, RoutedEventArgs^ e)
00105 {
00106     if (nullptr != sensor)
00107     {
00108         // Acquires the display on/off controller for this proximity sensor.
00109         // This tells the system to use the sensor's IsDetected state to
00110         // turn the screen on or off.  If the display does not support this
00111         // feature, this code will do nothing.
00112         displayController = sensor->CreateDisplayOnOffController();
00113
00114         ScenarioEnableButton->IsEnabled = false;
00115         ScenarioDisableButton->IsEnabled = true;
00116     }
00117     else
00118     {
00119         rootPage->NotifyUser("No proximity sensor found", NotifyType::ErrorMessage);
00120     }
00121 }
00122
00123 /// <summary>
00124 /// This is the click handler for the 'Disable' button.
00125 /// </summary>
00126 /// <param name="sender"></param>
00127 /// <param name="e"></param>
00128 void Scenario3_DisplayOnOff::ScenarioDisable(Object^ sender, RoutedEventArgs^ e)
00129 {
00130     // Releases the display on/off controller that is previously acquired.
00131     // This tells the system to stop using the sensor's IsDetected state to
00132     // turn the screen on or off.  If the display does not support this
00133     // feature, this code will do nothing.
00134     if (nullptr != displayController)
00135     {
00136         delete displayController; // closes the controller
00137         displayController = nullptr;
00138     }
00139
00140     ScenarioEnableButton->IsEnabled = true;
00141     ScenarioDisableButton->IsEnabled = false;
00142 }
Generated on Fri Nov 15 2024 22:21:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XmlLite/cppwinrt/Scenario2_XmlWriter.h Source File

  • XmlLite
  • cppwinrt

Scenario2_XmlWriter.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_XmlWriter.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario2_XmlWriter : Scenario2_XmlWriterT<Scenario2_XmlWriter>
00020     {
00021         Scenario2_XmlWriter();
00022
00023         fire_and_forget DoSomething_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00024
00025     private:
00026         void WriteXml(com_ptr<IStream> const& writeStream);
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario2_XmlWriter : Scenario2_XmlWriterT<Scenario2_XmlWriter, implementation::Scenario2_XmlWriter>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:22:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

LoadKeys Member List

This is the complete list of members for LoadKeys, including all inherited members.
ApduCommand(byte cla, byte ins, byte p1, byte p2, byte[] commandData, byte?le) | ApduCommand | [inline]
ApduResponseType | ApduCommand |
CLA | ApduCommand |
CommandData | ApduCommand |
GetBuffer() | ApduCommand | [inline]
INS | ApduCommand |
KeyData | LoadKeys |
KeyNumber | LoadKeys |
KeyType | LoadKeys |
Le | ApduCommand |
LoadKeys(LoadKeysKeyType keyType, byte?readerKeyNumber, LoadKeysTransmissionType transmissionType, LoadKeysStorageType storageType, byte keyNumber, byte[] keyData) | LoadKeys | [inline]
LoadKeysKeyType enum name | LoadKeys |
LoadKeysStorageType enum name | LoadKeys |
LoadKeysTransmissionType enum name | LoadKeys |
P1 | ApduCommand |
P2 | ApduCommand |
ReaderKeyNumber | LoadKeys |
StorageType | LoadKeys |
ToString() | ApduCommand | [inline]
TransmissionType | LoadKeys |
Generated on Fri Nov 15 2024 22:23:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario9_TransferMediaPlayer2 Member List

This is the complete list of members for Scenario9_TransferMediaPlayer2, including all inherited members.
DisposeMediaPlayer_Click(object sender, RoutedEventArgs e) | Scenario9_TransferMediaPlayer2 | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario9_TransferMediaPlayer2 | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario9_TransferMediaPlayer2 | [inline, protected]
rootPage | Scenario9_TransferMediaPlayer2 | [private]
Scenario9_TransferMediaPlayer2() | Scenario9_TransferMediaPlayer2 | [inline]
Generated on Fri Nov 15 2024 22:24:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GeneratedBitmapState Member List

This is the complete list of members for GeneratedBitmapState, including all inherited members.
bitmapHeight | GeneratedBitmapState
bitmapWidth | GeneratedBitmapState
squareLength | GeneratedBitmapState
squareY | GeneratedBitmapState
Generated on Fri Nov 15 2024 22:24:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cpp/Scenario5_VerifyResponse.xaml.h Source File

  • SmartCard
  • cpp

Scenario5_VerifyResponse.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario5_VerifyResponse.g.h"
00006 #include "MainPage.xaml.h"
00007
00008 namespace SDKTemplate
00009 {
00010     [Windows::Foundation::Metadata::WebHostHidden]
00011     public ref class Scenario5_VerifyResponse sealed
00012     {
00013     public:
00014         Scenario5_VerifyResponse();
00015     private:
00016         void VerifyResponse_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00017     };
00018 }
Generated on Fri Nov 15 2024 22:21:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CardDetails Member List

This is the complete list of members for CardDetails, including all inherited members.
HardwareMajorVersion | CardDetails |
HardwareMinorVersion | CardDetails |
HardwareProtocolType | CardDetails |
HardwareStorageSize | CardDetails |
HardwareSubType | CardDetails |
HardwareType | CardDetails |
HardwareVendorID | CardDetails |
ProductionBatchNumber | CardDetails |
SoftwareMajorVersion | CardDetails |
SoftwareMinorVersion | CardDetails |
SoftwareProtocolType | CardDetails |
SoftwareStorageSize | CardDetails |
SoftwareSubType | CardDetails |
SoftwareType | CardDetails |
SoftwareVendorID | CardDetails |
ToString() | CardDetails | [inline]
UID | CardDetails |
WeekOfProduction | CardDetails |
YearOfProduction | CardDetails |
Generated on Fri Nov 15 2024 22:23:20 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DWriteColorGlyph/cpp/DWriteColorTextRendererRenderer.h Source File

  • DWriteColorGlyph
  • cpp

DWriteColorTextRendererRenderer.h

Go to the documentation of this file.
00001 ﻿//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 //// PARTICULAR PURPOSE.
00005 ////
00006 //// Copyright (c) Microsoft Corporation. All rights reserved
00007
00008 #pragma once
00009
00010 #include "DeviceResources.h"
00011 #include "CustomTextRenderer.h"
00012
00013 namespace DWriteColorTextRenderer
00014 {
00015     // This sample renderer instantiates a basic rendering pipeline.
00016     class DWriteColorTextRendererRenderer
00017     {
00018     public:
00019         DWriteColorTextRendererRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
00020         void CreateDeviceDependentResources();
00021         void CreateWindowSizeDependentResources();
00022         void ReleaseDeviceDependentResources();
00023         void Render();
00024
00025     private:
00026         // Cached pointer to device resources.
00027         std::shared_ptr<DX::DeviceResources> m_deviceResources;
00028
00029         // Sample-specific resources.
00030         Microsoft::WRL::ComPtr<IDWriteTextLayout>  m_dwriteTextLayout;
00031         Microsoft::WRL::ComPtr<IDWriteTextFormat>  m_dwriteTextFormat;
00032         Microsoft::WRL::ComPtr<CustomTextRenderer> m_textRenderer;
00033     };
00034 }
Generated on Fri Nov 15 2024 22:19:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/InputText/RetrievingArgs/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • InputText
  • RetrievingArgs

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.ApplicationModel.Activation;
00003 using Windows.ApplicationModel.Core;
00004 using Windows.Foundation.Collections;
00005 using Windows.UI.Notifications;
00006 using Windows.UI.Popups;
00007 using Windows.UI.Xaml;
00008 using Windows.UI.Xaml.Controls;
00009
00010 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00011
00012 namespace Notifications.ScenarioPages.Toasts.Actions.InputText.RetrievingArgs
00013 {
00014     /// <summary>
00015     /// An empty page that can be used on its own or navigated to within a Frame.
00016     /// </summary>
00017     public sealed partial class ScenarioElement : UserControl
00018     {
00019         public ScenarioElement()
00020         {
00021             this.InitializeComponent();
00022
00023             Initialize();
00024         }
00025
00026         private void Initialize()
00027         {
00028             // Clear all existing notifications
00029             ToastNotificationManager.History.Clear();
00030
00031             // Listen to activation event
00032             (Application.Current as App).Activated = new EventHandler<IActivatedEventArgs>(App_Activated);
00033
00034             // Pop notifications
00035             popToastControlStep1.Payload =
00036                 $@"
00037                 <toast activationType='foreground' launch='args'>
00038                     <visual>
00039                         <binding template='ToastGeneric'>
00040                             <text>Foreground with App Open</text>
00041                             <text>Make sure ""Windows 10"" is in the text box. Press ""submit"".</text>
00042                         </binding>
00043                     </visual>
00044                     <actions>
00045
00046                         <input
00047                             id = 'message'
00048                             type = 'text'
00049                             title = 'Message'
00050                             placeHolderContent = 'Enter ""Windows 10""'
00051                             defaultInput = 'Windows 10' />
00052
00053                         <action activationType = 'foreground'
00054                                 arguments = 'quickReply'
00055                                 content = 'submit' />
00056
00057                         <action activationType = 'foreground'
00058                                 arguments = 'cancel'
00059                                 content = 'cancel' />
00060
00061                     </actions>
00062                 </toast>";
00063         }
00064
00065         private async void App_Activated(object sender, IActivatedEventArgs e)
00066         {
00067             await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
00068             {
00069                 var toastArgs = e as ToastNotificationActivatedEventArgs;
00070                 if (toastArgs == null)
00071                     return;
00072
00073                 string arguments = toastArgs.Argument;
00074
00075                 if (arguments == null || !arguments.Equals("quickReply"))
00076                 {
00077                     Error($"Expected arguments to be 'quickReply' but was '{arguments}'.");
00078                     return;
00079                 }
00080
00081                 switch (stepsControl.Step)
00082                 {
00083                     case 1:
00084                         validateStep1(toastArgs.UserInput);
00085                         break;
00086                 }
00087             });
00088         }
00089
00090         private async void Error(string message)
00091         {
00092             await new MessageDialog(message, "ERROR").ShowAsync();
00093         }
00094
00095         private async void validateStep1(ValueSet result)
00096         {
00097             if (result.Count != 1)
00098                 await new MessageDialog("ERROR: Expected 1 user input value, but there were " + result.Count).ShowAsync();
00099
00100             else if (!result.ContainsKey("message"))
00101                 await new MessageDialog("ERROR: Expected a user input value for 'message', but there was none.").ShowAsync();
00102
00103             else if (!(result["message"] as string).Equals("Windows 10"))
00104                 await new MessageDialog("ERROR: User input value for 'message' was not 'Windows 10'").ShowAsync();
00105
00106             else
00107             {
00108                 stepsControl.Step = int.MaxValue;
00109             }
00110         }
00111     }
00112 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SharePage Member List

This is the complete list of members for SharePage, including all inherited members.
ApplicationLink | SharePage | [protected]
dataTransferManager | SharePage | [private]
GetApplicationLink(Platform::String^sharePageFullName) | SharePage | [static]
GetApplicationLink(string sharePageName) | SharePage | [inline, static]
GetShareContent(Windows::ApplicationModel::DataTransfer::DataRequest^request) | SharePage | [virtual]
GetShareContent(DataRequest request) | SharePage | [protected, pure virtual]
OnDataRequested(Windows::ApplicationModel::DataTransfer::DataTransferManager^sender, Windows::ApplicationModel::DataTransfer::DataRequestedEventArgs^e) | SharePage | [private]
OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e) | SharePage | [inline, private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | SharePage | [virtual]
OnNavigatedFrom(NavigationEventArgs e) | SharePage | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | SharePage | [inline, protected]
OnShareCompleted(Windows::ApplicationModel::DataTransfer::DataPackage^sender, Windows::ApplicationModel::DataTransfer::ShareCompletedEventArgs^e) | SharePage | [private]
OnShareCompleted(DataPackage sender, ShareCompletedEventArgs e) | SharePage | [inline, private]
OnTargetApplicationChosen(Windows::ApplicationModel::DataTransfer::DataTransferManager^sender, Windows::ApplicationModel::DataTransfer::TargetApplicationChosenEventArgs^e) | SharePage | [private]
OnTargetApplicationChosen(DataTransferManager sender, TargetApplicationChosenEventArgs e) | SharePage | [inline, private]
rootPage | SharePage | [private]
ShowUIButton_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | SharePage |
ShowUIButton_Click(object sender, RoutedEventArgs e) | SharePage | [inline, protected]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Properties/AssemblyInfo.cs Source File

  • Notifications
  • cs
  • BackgroundTasks
  • Properties

AssemblyInfo.cs

Go to the documentation of this file.
00001 ﻿using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003 using System.Runtime.InteropServices;
00004
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 [assembly: AssemblyTitle("BackgroundTasks")]
00009 [assembly: AssemblyDescription("")]
00010 [assembly: AssemblyConfiguration("")]
00011 [assembly: AssemblyCompany("")]
00012 [assembly: AssemblyProduct("BackgroundTasks")]
00013 [assembly: AssemblyCopyright("Copyright ©  2015")]
00014 [assembly: AssemblyTrademark("")]
00015 [assembly: AssemblyCulture("")]
00016
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Build and Revision Numbers
00025 // by using the '*' as shown below:
00026 // [assembly: AssemblyVersion("1.0.*")]
00027 [assembly: AssemblyVersion("1.0.0.0")]
00028 [assembly: AssemblyFileVersion("1.0.0.0")]
00029 [assembly: ComVisible(false)]
Generated on Fri Nov 15 2024 22:17:37 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ReadStreamTask Member List

This is the complete list of members for ReadStreamTask, including all inherited members.
_Impl | ReadStreamTask | [private]
MinReadChunkSize | ReadStreamTask | [private, static]
operator=(const ReadStreamTask &Task) | ReadStreamTask |
ReadStreamTask(Windows::Storage::Streams::IInputStream^Stream, std::vector< byte > &Destination) | ReadStreamTask |
ReadStreamTask(const ReadStreamTask &Task) | ReadStreamTask |
RunTask() | ReadStreamTask |
Generated on Fri Nov 15 2024 22:23:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

unique_bag Member List

This is the complete list of members for unique_bag, including all inherited members.
unique_bag() | unique_bag | [inline]
~unique_bag() | unique_bag | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

unique_services Member List

This is the complete list of members for unique_services, including all inherited members.
operator MAPPING_SERVICE_INFO *() | unique_services | [inline]
operator&() | unique_services | [inline]
services | unique_services |
unique_services() | unique_services |
unique_services(unique_services const &) | unique_services |
~unique_services() | unique_services | [inline]
Generated on Fri Nov 15 2024 22:23:23 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario3_CustomItems.h Source File

  • JumpList
  • cppwinrt

Scenario3_CustomItems.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_CustomItems.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario3_CustomItems : Scenario3_CustomItemsT<Scenario3_CustomItems>
00019     {
00020         Scenario3_CustomItems();
00021
00022         // These methods are public so they can be called by binding.
00023         void DisplayNameLocalizedResource_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00024         void DescriptionLocalizedResource_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00025         void GroupNameLocalizedResource_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00026         fire_and_forget AddToJumpList_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&);
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario3_CustomItems : Scenario3_CustomItemsT<Scenario3_CustomItems, implementation::Scenario3_CustomItems>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:20:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Polling Member List

This is the complete list of members for Scenario2_Polling, including all inherited members.
_sensor | Scenario2_Polling | [private]
DisplayOrientation(TextBlock tb, SimpleOrientation orientation) | Scenario2_Polling | [inline, private]
rootPage | Scenario2_Polling | [private]
Scenario2_Polling() | Scenario2_Polling | [inline]
ScenarioGet(object sender, RoutedEventArgs e) | Scenario2_Polling | [inline, private]
Generated on Fri Nov 15 2024 22:24:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FileLoggingSessionScenario Member List

This is the complete list of members for FileLoggingSessionScenario, including all inherited members.
_isBusy | FileLoggingSessionScenario | [private]
_isChannelEnabled | FileLoggingSessionScenario | [private]
_isPreparingForSuspend | FileLoggingSessionScenario | [private]
_logFileGeneratedCount | FileLoggingSessionScenario | [private]
_statusChanged | FileLoggingSessionScenario | [private]
CloseSessionSaveFinalLogFile() | FileLoggingSessionScenario | [private]
DoScenarioAsync() | FileLoggingSessionScenario |
FileLoggingSessionScenario() | FileLoggingSessionScenario | [private]
Instance() | FileLoggingSessionScenario | [static]
IsBusy() const noexcept | FileLoggingSessionScenario |
LogFileGeneratedCount() const noexcept | FileLoggingSessionScenario |
LoggingEnabled() const noexcept | FileLoggingSessionScenario |
OnAppResuming(Windows::Foundation::IInspectable const &sender, Windows::Foundation::IInspectable const &args) | FileLoggingSessionScenario | [private]
OnAppSuspending(Windows::Foundation::IInspectable const &sender, Windows::ApplicationModel::SuspendingEventArgs const &e) | FileLoggingSessionScenario | [private]
OnChannelLoggingEnabled(Windows::Foundation::Diagnostics::ILoggingChannel const &sender, Windows::Foundation::IInspectable const &args) | FileLoggingSessionScenario | [private]
OnLogFileGenerated(Windows::Foundation::Diagnostics::IFileLoggingSession const &sender, Windows::Foundation::Diagnostics::LogFileGeneratedEventArgs const &args) | FileLoggingSessionScenario | [private]
PrepareToSuspendAsync() | FileLoggingSessionScenario | [private]
ResumeLoggingIfApplicable() | FileLoggingSessionScenario | [private]
StartLogging() | FileLoggingSessionScenario | [private]
StatusChanged(StatusChangedHandler const &handler) | FileLoggingSessionScenario |
StatusChanged(event_token const &token) noexcept | FileLoggingSessionScenario |
ToggleLoggingEnabledDisabledAsync() | FileLoggingSessionScenario |
~FileLoggingSessionScenario() | FileLoggingSessionScenario | [private]
Generated on Fri Nov 15 2024 22:24:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Clipboard/cs/CopyText.xaml.cs Source File

  • Clipboard
  • cs

CopyText.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.DataTransfer;
00015 using Windows.Data.Html;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class CopyText : Page
00023     {
00024         MainPage rootPage = MainPage.Current;
00025
00026         public CopyText()
00027         {
00028             this.InitializeComponent();
00029             Description.NavigateToString(this.htmlFragment);
00030         }
00031
00032         void CopyButton_Click(object sender, RoutedEventArgs e)
00033         {
00034             OutputText.Text = "";
00035             OutputResourceMapKeys.Text = "";
00036             OutputHtml.NavigateToString("<HTML></HTML>");
00037
00038             // Set the content to DataPackage as html format
00039             string htmlFormat = HtmlFormatHelper.CreateHtmlFormat(this.htmlFragment);
00040             var dataPackage = new DataPackage();
00041             dataPackage.SetHtmlFormat(htmlFormat);
00042
00043             // Set the content to DataPackage as (plain) text format
00044             string plainText = HtmlUtilities.ConvertToText(this.htmlFragment);
00045             dataPackage.SetText(plainText);
00046
00047             // Populate resourceMap with StreamReference objects corresponding to local image files embedded in HTML
00048             var imgUri = new Uri(imgSrc);
00049             var imgRef = RandomAccessStreamReference.CreateFromUri(imgUri);
00050             dataPackage.ResourceMap[imgSrc] = imgRef;
00051
00052             // Set the DataPackage to clipboard.
00053             if (Clipboard.SetContentWithOptions(dataPackage, null))
00054             {
00055                 rootPage.NotifyUser("Text and HTML formats have been copied to clipboard.", NotifyType.StatusMessage);
00056             }
00057             else
00058             {
00059                 // Copying data to Clipboard can potentially fail - for example, if another application is holding Clipboard open
00060                 rootPage.NotifyUser("Error copying content to clipboard.", NotifyType.ErrorMessage);
00061             }
00062         }
00063
00064         async void PasteButton_Click(object sender, RoutedEventArgs e)
00065         {
00066             rootPage.NotifyUser("", NotifyType.StatusMessage);
00067             OutputText.Text = "";
00068             OutputResourceMapKeys.Text = "";
00069             OutputHtml.NavigateToString("<HTML></HTML>");
00070
00071             var dataPackageView = Clipboard.GetContent();
00072             if (dataPackageView.Contains(StandardDataFormats.Text))
00073             {
00074                 try
00075                 {
00076                     var text = await dataPackageView.GetTextAsync();
00077                     OutputText.Text = "Text: " + Environment.NewLine + text;
00078                 }
00079                 catch (Exception ex)
00080                 {
00081                     rootPage.NotifyUser("Error retrieving Text format from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
00082                 }
00083             }
00084             else
00085             {
00086                 OutputText.Text = "Text: " + Environment.NewLine + "Text format is not available in clipboard";
00087             }
00088
00089             if (dataPackageView.Contains(StandardDataFormats.Html))
00090             {
00091                 this.DisplayResourceMapAsync(dataPackageView);
00092
00093                 string htmlFormat = null;
00094                 try
00095                 {
00096                     htmlFormat = await dataPackageView.GetHtmlFormatAsync();
00097                 }
00098                 catch (Exception ex)
00099                 {
00100                     rootPage.NotifyUser("Error retrieving HTML format from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
00101                 }
00102
00103                 if (htmlFormat != null)
00104                 {
00105                     string htmlFragment = HtmlFormatHelper.GetStaticFragment(htmlFormat);
00106                     OutputHtml.NavigateToString("HTML:<br/ > " + htmlFragment);
00107                 }
00108             }
00109             else
00110             {
00111                 OutputHtml.NavigateToString("HTML:<br/ > HTML format is not available in clipboard");
00112             }
00113         }
00114
00115         private string htmlFragment = "Use clipboard to copy and paste text in different formats, including plain text, and formatted text (HTML). <br />"
00116                                     + " To <b>copy</b>, add text formats to a <i>DataPackage</i>, and then place <i>DataPackage</i> to Clipboard.<br /> "
00117                                     + "To <b>paste</b>, get <i>DataPackageView</i> from clipboard, and retrieve the content of the desired text format from it.<br />"
00118                                     + "To handle local image files in the formatted text (such as the one below), use ResourceMap collection."
00119                                     + "<br /><img id=\"scenario1LocalImage\" src=\""
00120                                     + imgSrc
00121                                     + "\" /><br />"
00122                                     + "<i>DataPackage</i> class is also used to share or send content between applications. <br />"
00123                                     + "See the Share SDK sample for more information.";
00124
00125         private const string imgSrc = "ms-appx-web:///assets/windows-sdk.png";
00126
00127         // Note: this sample is not trying to resolve and render the HTML using resource map.
00128         // Please refer to the Clipboard JavaScript sample for an example of how to use resource map
00129         // for local images display within an HTML format. This sample will only demonstrate how to
00130         // get a resource map object and extract its key values
00131         async void DisplayResourceMapAsync(DataPackageView dataPackageView)
00132         {
00133             OutputResourceMapKeys.Text = Environment.NewLine + "Resource map: ";
00134             IReadOnlyDictionary<string, RandomAccessStreamReference> resMap = null;
00135             try
00136             {
00137                 resMap = await dataPackageView.GetResourceMapAsync();
00138             }
00139             catch (Exception ex)
00140             {
00141                 rootPage.NotifyUser("Error retrieving Resource map from Clipboard: " + ex.Message, NotifyType.ErrorMessage);
00142             }
00143
00144             if (resMap != null)
00145             {
00146                 if (resMap.Count > 0)
00147                 {
00148                     foreach (var item in resMap)
00149                     {
00150                         OutputResourceMapKeys.Text += Environment.NewLine + "Key: " + item.Key;
00151                     }
00152                 }
00153                 else
00154                 {
00155                     OutputResourceMapKeys.Text += Environment.NewLine + "Resource map is empty";
00156                 }
00157             }
00158         }
00159     }
00160 }
Generated on Fri Nov 15 2024 22:18:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FilePicker/cpp/SampleConfiguration.h Source File

  • FilePicker
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004 #include "pch.h"
00005
00006 namespace SDKTemplate
00007 {
00008     value struct Scenario;
00009
00010     partial ref class MainPage
00011     {
00012     internal:
00013         static property Platform::String^ FEATURE_NAME
00014         {
00015             Platform::String^ get()
00016             {
00017                 return "File picker C++ sample";
00018             }
00019         }
00020
00021         static property Platform::Array<Scenario>^ scenarios
00022         {
00023             Platform::Array<Scenario>^ get()
00024             {
00025                 return scenariosInner;
00026             }
00027         }
00028
00029     private:
00030         static Platform::Array<Scenario>^ scenariosInner;
00031     };
00032
00033     public value struct Scenario
00034     {
00035         Platform::String^ Title;
00036         Platform::String^ ClassName;
00037     };
00038 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CortanaVoiceCommand/cpp/AdventureWorks/View/TripDetails.xaml.cpp Source File

  • CortanaVoiceCommand
  • cpp
  • AdventureWorks
  • View

TripDetails.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "TripDetails.xaml.h"
00014 #include "View\TripListView.xaml.h"
00015 #include "ViewModel\TripVoiceCommand.h"
00016
00017 using namespace AdventureWorks;
00018
00019 using namespace AdventureWorks_Shared;
00020 using namespace Concurrency;
00021 using namespace Platform;
00022 using namespace Windows::Foundation;
00023 using namespace Windows::Foundation::Collections;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Controls;
00026 using namespace Windows::UI::Xaml::Controls::Primitives;
00027 using namespace Windows::UI::Xaml::Data;
00028 using namespace Windows::UI::Xaml::Input;
00029 using namespace Windows::UI::Xaml::Media;
00030 using namespace Windows::UI::Xaml::Navigation;
00031
00032 TripDetails::TripDetails()
00033 {
00034     InitializeComponent();
00035 }
00036
00037 void TripDetails::Footer_Click(Object^ sender, RoutedEventArgs^ args)
00038 {
00039     create_task(Windows::System::Launcher::LaunchUriAsync(ref new Uri(((HyperlinkButton^)sender)->Tag->ToString())));
00040 }
00041
00042 /// <summary>
00043 /// Invoked when navigating to view details about an individual trip, or create a new trip.
00044 /// </summary>
00045 /// <param name="e">Details about the trip to display, or null for a new trip.</param>
00046 void TripDetails::OnNavigatedTo(NavigationEventArgs^ e)
00047 {
00048     this->defaultViewModel = (TripViewModel^)this->DataContext;
00049     if (e->Parameter != nullptr)
00050     {
00051         Trip^ trip = dynamic_cast<Trip^>(e->Parameter);
00052         if (trip != nullptr)
00053         {
00054             this->DefaultViewModel->ShowTrip(trip);
00055             return;
00056         }
00057
00058         TripVoiceCommand^ voiceCommand = dynamic_cast<TripVoiceCommand^>(e->Parameter);
00059         if (voiceCommand != nullptr)
00060         {
00061             DefaultViewModel->LoadTripFromStore(voiceCommand->Destination);
00062         }
00063     }
00064     else
00065     {
00066         DefaultViewModel->NewTrip();
00067     }
00068 }
00069
00070 TripViewModel^ TripDetails::DefaultViewModel::get()
00071 {
00072     return this->defaultViewModel;
00073 }
Generated on Fri Nov 15 2024 22:18:59 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_Toggle Member List

This is the complete list of members for Scenario1_Toggle, including all inherited members.
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario1_Toggle
Scenario1_Toggle() | Scenario1_Toggle
Generated on Fri Nov 15 2024 22:24:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiDirect/cppwinrt/SampleConfiguration.cpp Source File

  • WiFiDirect
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Devices::Enumeration;
00019 using namespace Windows::Devices::WiFiDirect;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Popups;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace SDKTemplate;
00026
00027 hstring implementation::MainPage::FEATURE_NAME()
00028 {
00029     return L"Wi-Fi Direct";
00030 }
00031
00032 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00033 {
00034     Scenario{ L"Advertiser", xaml_typename<SDKTemplate::Scenario1_Advertiser>() },
00035     Scenario{ L"Connector", xaml_typename<SDKTemplate::Scenario2_Connector>() },
00036 });
00037
00038 static IAsyncAction ShowPinToUserAsync(CoreDispatcher dispatcher, hstring strPin)
00039 {
00040     co_await resume_foreground(dispatcher);
00041
00042     MessageDialog messageDialog(L"Enter this PIN on the remote device: " + strPin);
00043
00044     // Add commands
00045     messageDialog.Commands().Append(UICommand(L"OK", nullptr, 0));
00046
00047     // Set the command that will be invoked by default
00048     messageDialog.DefaultCommandIndex(0);
00049
00050     // Set the command that will be invoked if the user cancels
00051     messageDialog.CancelCommandIndex(0);
00052
00053     // Show the Pin
00054     co_await messageDialog.ShowAsync();
00055 }
00056
00057 static IAsyncOperation<hstring> GetPinFromUserAsync(CoreDispatcher dispatcher)
00058 {
00059     co_await resume_foreground(dispatcher);
00060
00061     TextBox pinBox;
00062     ContentDialog dialog;
00063     dialog.Title(box_value(L"Enter Pin"));
00064     dialog.PrimaryButtonText(L"OK");
00065     dialog.Content(pinBox);
00066
00067     co_await dialog.ShowAsync();
00068     co_return pinBox.Text();
00069 }
00070
00071 fire_and_forget winrt::SDKTemplate::HandlePairing(CoreDispatcher dispatcher, DevicePairingRequestedEventArgs e)
00072 {
00073     auto deferral = e.GetDeferral();
00074     switch (e.PairingKind())
00075     {
00076         case DevicePairingKinds::DisplayPin:
00077             co_await ShowPinToUserAsync(dispatcher, e.Pin());
00078             e.Accept();
00079             break;
00080
00081         case DevicePairingKinds::ConfirmOnly:
00082             e.Accept();
00083             break;
00084
00085         case DevicePairingKinds::ProvidePin:
00086         {
00087             hstring pin = co_await GetPinFromUserAsync(dispatcher);
00088             if (!pin.empty())
00089             {
00090                 e.Accept(pin);
00091             }
00092         }
00093             break;
00094     }
00095 }
00096
00097 hstring winrt::to_hstring(DevicePairingResultStatus status)
00098 {
00099     switch (status)
00100     {
00101     case DevicePairingResultStatus::Paired:
00102         return L"Paired";
00103     case DevicePairingResultStatus::NotReadyToPair:
00104         return L"NotReadyToPair";
00105     case DevicePairingResultStatus::NotPaired:
00106         return L"NotPaired";
00107     case DevicePairingResultStatus::AlreadyPaired:
00108         return L"AlreadyPaired";
00109     case DevicePairingResultStatus::ConnectionRejected:
00110         return L"ConnectionRejected";
00111     case DevicePairingResultStatus::TooManyConnections:
00112         return L"TooManyConnections";
00113     case DevicePairingResultStatus::HardwareFailure:
00114         return L"HardwareFailure";
00115     case DevicePairingResultStatus::AuthenticationTimeout:
00116         return L"AuthenticationTimeout";
00117     case DevicePairingResultStatus::AuthenticationNotAllowed:
00118         return L"AuthenticationNotAllowed";
00119     case DevicePairingResultStatus::AuthenticationFailure:
00120         return L"AuthenticationFailure";
00121     case DevicePairingResultStatus::NoSupportedProfiles:
00122         return L"NoSupportedProfiles";
00123     case DevicePairingResultStatus::ProtectionLevelCouldNotBeMet:
00124         return L"ProtectionLevelCouldNotBeMet";
00125     case DevicePairingResultStatus::AccessDenied:
00126         return L"AccessDenied";
00127     case DevicePairingResultStatus::InvalidCeremonyData:
00128         return L"InvalidCeremonyData";
00129     case DevicePairingResultStatus::PairingCanceled:
00130         return L"PairingCanceled";
00131     case DevicePairingResultStatus::OperationAlreadyInProgress:
00132         return L"OperationAlreadyInProgress";
00133     case DevicePairingResultStatus::RequiredHandlerNotRegistered:
00134         return L"RequiredHandlerNotRegistered";
00135     case DevicePairingResultStatus::RejectedByHandler:
00136         return L"RejectedByHandler";
00137     case DevicePairingResultStatus::RemoteDeviceHasAssociation:
00138         return L"RemoteDeviceHasAssociation";
00139     case DevicePairingResultStatus::Failed:
00140         return L"Failed";
00141     }
00142     return to_hstring(static_cast<uint32_t>(status));
00143 }
00144
00145 hstring winrt::to_hstring(DeviceUnpairingResultStatus status)
00146 {
00147     switch (status)
00148     {
00149     case DeviceUnpairingResultStatus::Unpaired:
00150         return L"Unpaired";
00151     case DeviceUnpairingResultStatus::AlreadyUnpaired:
00152         return L"AlreadyUnpaired";
00153     case DeviceUnpairingResultStatus::OperationAlreadyInProgress:
00154         return L"OperationAlreadyInProgress";
00155     case DeviceUnpairingResultStatus::AccessDenied:
00156         return L"AccessDenied";
00157     case DeviceUnpairingResultStatus::Failed:
00158         return L"Failed";
00159     }
00160     return to_hstring(static_cast<uint32_t>(status));
00161 }
00162
00163 hstring winrt::to_hstring(WiFiDirectAdvertisementPublisherStatus status)
00164 {
00165     switch (status)
00166     {
00167     case WiFiDirectAdvertisementPublisherStatus::Created:
00168         return L"Created";
00169     case WiFiDirectAdvertisementPublisherStatus::Started:
00170         return L"Started";
00171     case WiFiDirectAdvertisementPublisherStatus::Stopped:
00172         return L"Stopped";
00173     case WiFiDirectAdvertisementPublisherStatus::Aborted:
00174         return L"Aborted";
00175     }
00176     return to_hstring(static_cast<uint32_t>(status));
00177 }
00178
00179 hstring winrt::to_hstring(WiFiDirectConfigurationMethod method)
00180 {
00181     switch (method)
00182     {
00183     case WiFiDirectConfigurationMethod::ProvidePin:
00184         return L"ProvidePin";
00185     case WiFiDirectConfigurationMethod::DisplayPin:
00186         return L"DisplayPin";
00187     case WiFiDirectConfigurationMethod::PushButton:
00188         return L"PushButton";
00189     }
00190     return to_hstring(static_cast<uint32_t>(method));
00191 }
00192
00193 hstring winrt::to_hstring(WiFiDirectConnectionStatus status)
00194 {
00195     switch (status)
00196     {
00197     case WiFiDirectConnectionStatus::Disconnected:
00198         return L"Disconnected";
00199     case WiFiDirectConnectionStatus::Connected:
00200         return L"Connected";
00201     }
00202     return to_hstring(static_cast<uint32_t>(status));
00203 }
00204
00205 hstring winrt::to_hstring(WiFiDirectError error)
00206 {
00207     switch (error)
00208     {
00209     case WiFiDirectError::Success:
00210         return L"Success";
00211     case WiFiDirectError::RadioNotAvailable:
00212         return L"RadioNotAvailable";
00213     case WiFiDirectError::ResourceInUse:
00214         return L"ResourceInUse";
00215     }
00216     return to_hstring(static_cast<uint32_t>(error));
00217 }
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Compression/cs/SampleConfiguration.cs Source File

  • Compression
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using Compression;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "Compression";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Compression/Decompression sample", ClassType=typeof(Scenario1)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: D2DAdvancedColorImages/cpp/D2DAdvancedColorImages/LuminanceHeatmapEffect.h Source File

  • D2DAdvancedColorImages
  • cpp
  • D2DAdvancedColorImages

LuminanceHeatmapEffect.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 // Not a tonemapper, instead produces a colorized heatmap of the luminance of the image in SDR range.
00013 // See LuminanceHeatmapEffect.hlsl for the nits --> color mapping.
00014
00015 DEFINE_GUID(GUID_LuminanceHeatmapPixelShader, 0xced40834, 0x5bc7, 0x4cc6, 0xbe, 0xe9, 0x4f, 0x94, 0xf, 0xab, 0x7b, 0xc1);
00016 DEFINE_GUID(CLSID_CustomLuminanceHeatmapEffect, 0x52bfa892, 0x4616, 0x4b9f, 0xb6, 0x69, 0x1f, 0x4e, 0xdb, 0xfe, 0x10, 0x72);
00017
00018 // Our effect contains one transform, which is simply a wrapper around a pixel shader. As such,
00019 // we can simply make the effect itself act as the transform.
00020 class LuminanceHeatmapEffect : public ID2D1EffectImpl, public ID2D1DrawTransform
00021 {
00022 public:
00023     // Declare effect registration methods.
00024     static HRESULT Register(_In_ ID2D1Factory1* pFactory);
00025
00026     static HRESULT __stdcall CreateLuminanceHeatmapImpl(_Outptr_ IUnknown** ppEffectImpl);
00027
00028     // Declare ID2D1EffectImpl implementation methods.
00029     IFACEMETHODIMP Initialize(
00030         _In_ ID2D1EffectContext* pContextInternal,
00031         _In_ ID2D1TransformGraph* pTransformGraph
00032         );
00033
00034     IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE changeType);
00035
00036     IFACEMETHODIMP SetGraph(_In_ ID2D1TransformGraph* pGraph);
00037
00038     // Declare ID2D1DrawTransform implementation methods.
00039     IFACEMETHODIMP SetDrawInfo(_In_ ID2D1DrawInfo* pRenderInfo);
00040
00041     // Declare ID2D1Transform implementation methods.
00042     IFACEMETHODIMP MapOutputRectToInputRects(
00043         _In_ const D2D1_RECT_L* pOutputRect,
00044         _Out_writes_(inputRectCount) D2D1_RECT_L* pInputRects,
00045         UINT32 inputRectCount
00046         ) const;
00047
00048     IFACEMETHODIMP MapInputRectsToOutputRect(
00049         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputRects,
00050         _In_reads_(inputRectCount) CONST D2D1_RECT_L* pInputOpaqueSubRects,
00051         UINT32 inputRectCount,
00052         _Out_ D2D1_RECT_L* pOutputRect,
00053         _Out_ D2D1_RECT_L* pOutputOpaqueSubRect
00054         );
00055
00056     IFACEMETHODIMP MapInvalidRect(
00057         UINT32 inputIndex,
00058         D2D1_RECT_L invalidInputRect,
00059         _Out_ D2D1_RECT_L* pInvalidOutputRect
00060         ) const;
00061
00062     // Declare ID2D1TransformNode implementation methods.
00063     IFACEMETHODIMP_(UINT32) GetInputCount() const;
00064
00065     // Declare IUnknown implementation methods.
00066     IFACEMETHODIMP_(ULONG) AddRef();
00067     IFACEMETHODIMP_(ULONG) Release();
00068     IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppOutput);
00069
00070     // Declare property getter/setter methods.
00071
00072 private:
00073     LuminanceHeatmapEffect();
00074     HRESULT UpdateConstants();
00075
00076     // This struct defines the constant buffer of our pixel shader.
00077     struct
00078     {
00079         float dpi;
00080     } m_constants;
00081
00082     Microsoft::WRL::ComPtr<ID2D1DrawInfo>      m_drawInfo;
00083     Microsoft::WRL::ComPtr<ID2D1EffectContext> m_effectContext;
00084     LONG                                       m_refCount;
00085     D2D1_RECT_L                                m_inputRect;
00086     float                                      m_dpi;
00087 };
Generated on Fri Nov 15 2024 22:19:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cppwinrt/Scenario4_Snapshot.cpp Source File

  • DeviceEnumerationAndPairing
  • cppwinrt

Scenario4_Snapshot.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_Snapshot.h"
00014 #include "SampleConfiguration.h"
00015 #include "DeviceHelpers.h"
00016 #include "Scenario4_Snapshot.g.cpp"
00017
00018 using namespace winrt;
00019 using namespace winrt::Windows::Devices::Enumeration;
00020 using namespace winrt::Windows::Foundation;
00021 using namespace winrt::Windows::UI::Xaml;
00022 using namespace winrt::Windows::UI::Xaml::Navigation;
00023
00024 namespace winrt::SDKTemplate::implementation
00025 {
00026     Scenario4_Snapshot::Scenario4_Snapshot()
00027     {
00028         InitializeComponent();
00029     }
00030
00031     void Scenario4_Snapshot::OnNavigatedTo(NavigationEventArgs const&)
00032     {
00033         resultsListView().ItemsSource(resultCollection);
00034
00035         selectorComboBox().ItemsSource(DeviceSelectorChoices::FindAllAsyncSelectors());
00036         selectorComboBox().SelectedIndex(0);
00037     }
00038
00039     fire_and_forget Scenario4_Snapshot::FindButton_Click(IInspectable const&, RoutedEventArgs const&)
00040     {
00041         auto lifetime = get_strong();
00042
00043         findButton().IsEnabled(false);
00044         resultCollection.Clear();
00045
00046         // First get the device selector chosen by the UI.
00047         IInspectable item = selectorComboBox().SelectedItem();
00048         DeviceSelectorInfo* deviceSelectorInfo = FromInspectable<DeviceSelectorInfo>(item);
00049
00050         rootPage.NotifyUser(L"FindAllAsync operation started...", NotifyType::StatusMessage);
00051
00052         DeviceInformationCollection deviceInfoCollection{ nullptr };
00053
00054         if (deviceSelectorInfo->Selector().empty())
00055         {
00056             // If a pre-canned device class selector was chosen, call the DeviceClass overload
00057             deviceInfoCollection = co_await DeviceInformation::FindAllAsync(deviceSelectorInfo->DeviceClassSelector());
00058         }
00059         else if (deviceSelectorInfo->Kind() == DeviceInformationKind::Unknown)
00060         {
00061             // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
00062             // Kind will be determined by the selector
00063             deviceInfoCollection = co_await DeviceInformation::FindAllAsync(
00064                 deviceSelectorInfo->Selector(),
00065                 nullptr // don't request additional properties for this sample
00066             );
00067         }
00068         else
00069         {
00070             // Kind is specified in the selector info
00071             deviceInfoCollection = co_await DeviceInformation::FindAllAsync(
00072                 deviceSelectorInfo->Selector(),
00073                 nullptr, // don't request additional properties for this sample
00074                 deviceSelectorInfo->Kind());
00075         }
00076
00077         rootPage.NotifyUser(
00078             L"FindAllAsync operation completed. " + to_hstring(deviceInfoCollection.Size()) + L" devices found.",
00079             NotifyType::StatusMessage);
00080
00081         for (DeviceInformation const& deviceInfo : deviceInfoCollection)
00082         {
00083             resultCollection.Append(make<DeviceInformationDisplay>(deviceInfo));
00084         }
00085
00086         findButton().IsEnabled(true);
00087     }
00088 }
Generated on Fri Nov 15 2024 22:19:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppServices/cs/AppServicesClient/KeepConnectionOpenScenario.xaml.cs Source File

  • AppServices
  • cs
  • AppServicesClient

KeepConnectionOpenScenario.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.UI.Xaml;
00014 using Windows.UI.Xaml.Controls;
00015 using Windows.UI.Xaml.Navigation;
00016 using Windows.ApplicationModel.AppService;
00017 using Windows.Foundation.Collections;
00018
00019 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00020
00021 namespace SDKTemplate
00022 {
00023     /// <summary>
00024     /// An empty page that can be used on its own or navigated to within a Frame.
00025     /// </summary>
00026     public sealed partial class KeepConnectionOpenScenario : Page
00027     {
00028         private MainPage rootPage = MainPage.Current;
00029         private AppServiceConnection connection;
00030
00031         public KeepConnectionOpenScenario()
00032         {
00033             this.InitializeComponent();
00034         }
00035
00036         protected override void OnNavigatedFrom(NavigationEventArgs e)
00037         {
00038             //Dispose the connection reference we're holding
00039             if (connection != null)
00040             {
00041                 connection.Dispose();
00042                 connection = null;
00043             }
00044         }
00045
00046         private async void OpenConnection_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00047         {
00048             //Is a connection already open?
00049             if (connection != null)
00050             {
00051                 rootPage.NotifyUser("A connection already exists", NotifyType.ErrorMessage);
00052                 return;
00053             }
00054
00055             //Set up a new app service connection
00056             connection = new AppServiceConnection();
00057             connection.AppServiceName = "com.microsoft.randomnumbergenerator";
00058             connection.PackageFamilyName = "Microsoft.SDKSamples.AppServicesProvider.CS_8wekyb3d8bbwe";
00059             connection.ServiceClosed += Connection_ServiceClosed;
00060             AppServiceConnectionStatus status = await connection.OpenAsync();
00061
00062             //"connection" may have been nulled out while we were awaiting.
00063             if (connection == null)
00064             {
00065                 rootPage.NotifyUser("Connection was closed", NotifyType.ErrorMessage);
00066                 return;
00067             }
00068
00069             //If the new connection opened successfully we're done here
00070             if (status == AppServiceConnectionStatus.Success)
00071             {
00072                 rootPage.NotifyUser("Connection is open", NotifyType.StatusMessage);
00073             }
00074             else
00075             {
00076                 //Something went wrong. Lets figure out what it was and show the
00077                 //user a meaningful message
00078                 switch (status)
00079                 {
00080                     case AppServiceConnectionStatus.AppNotInstalled:
00081                         rootPage.NotifyUser("The app AppServicesProvider is not installed. Deploy AppServicesProvider to this device and try again.", NotifyType.ErrorMessage);
00082                         break;
00083
00084                     case AppServiceConnectionStatus.AppUnavailable:
00085                         rootPage.NotifyUser("The app AppServicesProvider is not available. This could be because it is currently being updated or was installed to a removable device that is no longer available.", NotifyType.ErrorMessage);
00086                         break;
00087
00088                     case AppServiceConnectionStatus.AppServiceUnavailable:
00089                         rootPage.NotifyUser(string.Format("The app AppServicesProvider is installed but it does not provide the app service {0}.", connection.AppServiceName), NotifyType.ErrorMessage);
00090                         break;
00091
00092                     default:
00093                     case AppServiceConnectionStatus.Unknown:
00094                         rootPage.NotifyUser("An unknown error occurred while we were trying to open an AppServiceConnection.", NotifyType.ErrorMessage);
00095                         break;
00096                 }
00097
00098                 //Clean up before we go
00099                 connection.Dispose();
00100                 connection = null;
00101             }
00102         }
00103
00104         private async void Connection_ServiceClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
00105         {
00106             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
00107             {
00108                 //Dispose the connection reference we're holding
00109                 if (connection != null)
00110                 {
00111                     connection.Dispose();
00112                     connection = null;
00113                 }
00114             });
00115         }
00116
00117         private void CloseConnection_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00118         {
00119             //Is there an open connection?
00120             if (connection == null)
00121             {
00122                 rootPage.NotifyUser("There's no open connection to close", NotifyType.ErrorMessage);
00123                 return;
00124             }
00125
00126             //Close the open connection
00127             connection.Dispose();
00128             connection = null;
00129
00130             //Let the user know we closed the connection
00131             rootPage.NotifyUser("Connection is closed", NotifyType.StatusMessage);
00132         }
00133
00134         private async void GenerateRandomNumber_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
00135         {
00136             //Is there an open connection?
00137             if (connection == null)
00138             {
00139                 rootPage.NotifyUser("You need to open a connection before trying to generate a random number.", NotifyType.ErrorMessage);
00140                 return;
00141             }
00142
00143             //Parse user input
00144             int minValueInput;
00145             if (!int.TryParse(MinValue.Text, out minValueInput))
00146             {
00147                 rootPage.NotifyUser("The Minimum Value should be a valid integer", NotifyType.ErrorMessage);
00148                 return;
00149             }
00150
00151             int maxValueInput;
00152             if (!int.TryParse(MaxValue.Text, out maxValueInput))
00153             {
00154                 rootPage.NotifyUser("The Maximum Value should be a valid integer", NotifyType.ErrorMessage);
00155                 return;
00156             }
00157
00158             if (maxValueInput <= minValueInput)
00159             {
00160                 rootPage.NotifyUser("Maximum Value must be larger than Minimum Value", NotifyType.ErrorMessage);
00161                 return;
00162             }
00163
00164             //Send a message to the app service
00165             var inputs = new ValueSet();
00166             inputs.Add("minvalue", minValueInput);
00167             inputs.Add("maxvalue", maxValueInput);
00168             AppServiceResponse response = await connection.SendMessageAsync(inputs);
00169
00170             //"connection" may have been nulled out while we were awaiting.
00171             if (connection == null)
00172             {
00173                 rootPage.NotifyUser("Connection was closed", NotifyType.ErrorMessage);
00174                 return;
00175             }
00176
00177             //If the service responded display the message. We're done!
00178             if (response.Status == AppServiceResponseStatus.Success)
00179             {
00180                 if (!response.Message.ContainsKey("result"))
00181                 {
00182                     rootPage.NotifyUser("The app service response message does not contain a key called \"result\"", NotifyType.StatusMessage);
00183                     return;
00184                 }
00185
00186                 var resultText = response.Message["result"].ToString();
00187                 if (!string.IsNullOrEmpty(resultText))
00188                 {
00189                     Result.Text = resultText;
00190                     rootPage.NotifyUser("App service responded with a result", NotifyType.StatusMessage);
00191                 }
00192                 else
00193                 {
00194                     rootPage.NotifyUser("App service did not respond with a result", NotifyType.ErrorMessage);
00195                 }
00196             }
00197             else
00198             {
00199                 //Something went wrong. Show the user a meaningful
00200                 //message depending upon the status
00201                 switch (response.Status)
00202                 {
00203                     case AppServiceResponseStatus.Failure:
00204                         rootPage.NotifyUser("The service failed to acknowledge the message we sent it. It may have been terminated because the client was suspended.", NotifyType.ErrorMessage);
00205                         break;
00206
00207                     case AppServiceResponseStatus.ResourceLimitsExceeded:
00208                         rootPage.NotifyUser("The service exceeded the resources allocated to it and had to be terminated.", NotifyType.ErrorMessage);
00209                         break;
00210
00211                     default:
00212                     case AppServiceResponseStatus.Unknown:
00213                         rootPage.NotifyUser("An unkown error occurred while we were trying to send a message to the service.", NotifyType.ErrorMessage);
00214                         break;
00215                 }
00216             }
00217         }
00218     }
00219 }
Generated on Fri Nov 15 2024 22:18:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Server/ServiceBase.cpp Source File

  • CustomCapability
  • Service
  • Server

ServiceBase.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "stdafx.h"
00013 #pragma region Includes
00014
00015 #include "ServiceBase.h"
00016 #include <assert.h>
00017 #include <strsafe.h>
00018 #include <evntprov.h>
00019 #include <Evntrace.h>
00020 #pragma endregion
00021
00022 //
00023 // HSA Service trace event provider
00024 // {BE2E880E-F79F-4C30-9C95-09F003A0A7EA}
00025 //
00026 EXTERN_C __declspec(selectany) const GUID HSA_SERVICE_PROVIDER_GUID = { 0xbe2e880e, 0xf79f, 0x4c30,{ 0x9c, 0x95, 0x9, 0xf0, 0x3, 0xa0, 0xa7, 0xea } };
00027
00028 #pragma region Static Members
00029
00030 // Initialize the singleton service instance.
00031 CServiceBase *CServiceBase::s_service = nullptr;
00032
00033
00034 //
00035 //   FUNCTION: CServiceBase::Run(CServiceBase &)
00036 //
00037 //   PURPOSE: Register the executable for a service with the Service Control
00038 //   Manager (SCM). After you call Run(ServiceBase), the SCM issues a Start
00039 //   command, which results in a call to the OnStart method in the service.
00040 //   This method blocks until the service has stopped.
00041 //
00042 //   PARAMETERS:
00043 //   * service - the reference to a CServiceBase object. It will become the
00044 //     singleton service instance of this service application.
00045 //
00046 //   RETURN VALUE: If the function succeeds, the return value is TRUE. If the
00047 //   function fails, the return value is FALSE. To get extended error
00048 //   information, call GetLastError.
00049 //
00050 BOOL CServiceBase::Run(CServiceBase &service)
00051 {
00052     s_service = &service;
00053
00054     SERVICE_TABLE_ENTRY serviceTable[] =
00055     {
00056         { service.m_name, ServiceMain },
00057         { nullptr, nullptr }
00058     };
00059
00060     // Connects the main thread of a service process to the service control
00061     // manager, which causes the thread to be the service control dispatcher
00062     // thread for the calling process. This call returns when the service has
00063     // stopped. The process should simply terminate when the call returns.
00064     return StartServiceCtrlDispatcher(serviceTable);
00065 }
00066
00067
00068 //
00069 //   FUNCTION: CServiceBase::ServiceMain(DWORD, PWSTR *)
00070 //
00071 //   PURPOSE: Entry point for the service. It registers the handler function
00072 //   for the service and starts the service.
00073 //
00074 //   PARAMETERS:
00075 //   * dwArgc   - number of command line arguments
00076 //   * lpszArgv - array of command line arguments
00077 //
00078 void WINAPI CServiceBase::ServiceMain(DWORD dwArgc, PWSTR *pszArgv)
00079 {
00080     assert(s_service != NULL);
00081
00082     // Register the handler function for the service
00083     s_service->m_statusHandle = RegisterServiceCtrlHandler(
00084         s_service->m_name, ServiceCtrlHandler);
00085
00086     if (s_service->m_statusHandle == NULL)
00087     {
00088         throw GetLastError();
00089     }
00090
00091     // Start the service.
00092     s_service->Start(dwArgc, pszArgv);
00093 }
00094
00095
00096 //
00097 //   FUNCTION: CServiceBase::ServiceCtrlHandler(DWORD)
00098 //
00099 //   PURPOSE: The function is called by the SCM whenever a control code is
00100 //   sent to the service.
00101 //
00102 //   PARAMETERS:
00103 //   * dwCtrlCode - the control code. This parameter can be one of the
00104 //   following values:
00105 //
00106 //     SERVICE_CONTROL_CONTINUE
00107 //     SERVICE_CONTROL_INTERROGATE
00108 //     SERVICE_CONTROL_NETBINDADD
00109 //     SERVICE_CONTROL_NETBINDDISABLE
00110 //     SERVICE_CONTROL_NETBINDREMOVE
00111 //     SERVICE_CONTROL_PARAMCHANGE
00112 //     SERVICE_CONTROL_PAUSE
00113 //     SERVICE_CONTROL_SHUTDOWN
00114 //     SERVICE_CONTROL_STOP
00115 //
00116 //   This parameter can also be a user-defined control code ranges from 128
00117 //   to 255.
00118 //
00119 void WINAPI CServiceBase::ServiceCtrlHandler(DWORD dwCtrl)
00120 {
00121     switch (dwCtrl)
00122     {
00123     case SERVICE_CONTROL_STOP: s_service->Stop(); break;
00124     case SERVICE_CONTROL_PAUSE: s_service->Pause(); break;
00125     case SERVICE_CONTROL_CONTINUE: s_service->Continue(); break;
00126     case SERVICE_CONTROL_SHUTDOWN: s_service->Shutdown(); break;
00127     case SERVICE_CONTROL_INTERROGATE: break;
00128     default: break;
00129     }
00130 }
00131
00132 #pragma endregion
00133
00134
00135 #pragma region Service Constructor and Destructor
00136
00137 //
00138 //   FUNCTION: CServiceBase::CServiceBase(PWSTR, BOOL, BOOL, BOOL)
00139 //
00140 //   PURPOSE: The constructor of CServiceBase. It initializes a new instance
00141 //   of the CServiceBase class. The optional parameters (fCanStop,
00142 ///  fCanShutdown and fCanPauseContinue) allow you to specify whether the
00143 //   service can be stopped, paused and continued, or be notified when system
00144 //   shutdown occurs.
00145 //
00146 //   PARAMETERS:
00147 //   * pszServiceName - the name of the service
00148 //   * fCanStop - the service can be stopped
00149 //   * fCanShutdown - the service is notified when system shutdown occurs
00150 //   * fCanPauseContinue - the service can be paused and continued
00151 //
00152 CServiceBase::CServiceBase(
00153     PWSTR pszServiceName,
00154     BOOL fCanStop,
00155     BOOL fCanShutdown,
00156     BOOL fCanPauseContinue)
00157 {
00158     // Service name must be a valid string and cannot be NULL.
00159     m_name = (pszServiceName == nullptr) ? L"" : pszServiceName;
00160
00161     m_statusHandle = nullptr;
00162
00163     // The service runs in its own process.
00164     m_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
00165
00166     // The service is starting.
00167     m_status.dwCurrentState = SERVICE_START_PENDING;
00168
00169     // The accepted commands of the service.
00170     DWORD dwControlsAccepted = 0;
00171     if (fCanStop)
00172         dwControlsAccepted |= SERVICE_ACCEPT_STOP;
00173     if (fCanShutdown)
00174         dwControlsAccepted |= SERVICE_ACCEPT_SHUTDOWN;
00175     if (fCanPauseContinue)
00176         dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
00177     m_status.dwControlsAccepted = dwControlsAccepted;
00178
00179     m_status.dwWin32ExitCode = NO_ERROR;
00180     m_status.dwServiceSpecificExitCode = 0;
00181     m_status.dwCheckPoint = 0;
00182     m_status.dwWaitHint = 0;
00183
00184     NTSTATUS status = EventRegister(&HSA_SERVICE_PROVIDER_GUID,
00185         nullptr,
00186         nullptr,
00187         &m_etwRegHandle);
00188     if (ERROR_SUCCESS != status)
00189     {
00190         wprintf(L"Provider not registered. EventRegister failed with %d\n", status);
00191     }
00192 }
00193
00194
00195 //
00196 //   FUNCTION: CServiceBase::~CServiceBase()
00197 //
00198 //   PURPOSE: The virtual destructor of CServiceBase.
00199 //
00200 CServiceBase::~CServiceBase(void)
00201 {
00202     if (m_etwRegHandle != NULL)
00203     {
00204         EventUnregister(m_etwRegHandle);
00205     }
00206 }
00207
00208 #pragma endregion
00209
00210
00211 #pragma region Service Start, Stop, Pause, Continue, and Shutdown
00212
00213 //
00214 //   FUNCTION: CServiceBase::Start(DWORD, PWSTR *)
00215 //
00216 //   PURPOSE: The function starts the service. It calls the OnStart virtual
00217 //   function in which you can specify the actions to take when the service
00218 //   starts. If an error occurs during the startup, the error will be logged
00219 //   in the Application event log, and the service will be stopped.
00220 //
00221 //   PARAMETERS:
00222 //   * dwArgc   - number of command line arguments
00223 //   * lpszArgv - array of command line arguments
00224 //
00225 void CServiceBase::Start(DWORD dwArgc, PWSTR *pszArgv)
00226 {
00227     WriteEventLogEntry(L"Service trying to start.", TRACE_LEVEL_ERROR);
00228     try
00229     {
00230         // Tell SCM that the service is starting.
00231         SetServiceStatus(SERVICE_START_PENDING);
00232
00233         // Perform service-specific initialization.
00234         OnStart(dwArgc, pszArgv);
00235
00236         // Tell SCM that the service is started.
00237         SetServiceStatus(SERVICE_RUNNING);
00238     }
00239     catch (DWORD dwError)
00240     {
00241         // Log the error.
00242         WriteErrorLogEntry(L"Service Start", dwError);
00243
00244         // Set the service status to be stopped.
00245         SetServiceStatus(SERVICE_STOPPED, dwError);
00246     }
00247     catch (...)
00248     {
00249         // Log the error.
00250         WriteEventLogEntry(L"Service failed to start.", TRACE_LEVEL_ERROR);
00251
00252         // Set the service status to be stopped.
00253         SetServiceStatus(SERVICE_STOPPED);
00254     }
00255 }
00256
00257
00258 //
00259 //   FUNCTION: CServiceBase::OnStart(DWORD, PWSTR *)
00260 //
00261 //   PURPOSE: When implemented in a derived class, executes when a Start
00262 //   command is sent to the service by the SCM or when the operating system
00263 //   starts (for a service that starts automatically). Specifies actions to
00264 //   take when the service starts. Be sure to periodically call
00265 //   CServiceBase::SetServiceStatus() with SERVICE_START_PENDING if the
00266 //   procedure is going to take long time. You may also consider spawning a
00267 //   new thread in OnStart to perform time-consuming initialization tasks.
00268 //
00269 //   PARAMETERS:
00270 //   * dwArgc   - number of command line arguments
00271 //   * lpszArgv - array of command line arguments
00272 //
00273 void CServiceBase::OnStart(DWORD dwArgc, PWSTR *pszArgv)
00274 {
00275 }
00276
00277
00278 //
00279 //   FUNCTION: CServiceBase::Stop()
00280 //
00281 //   PURPOSE: The function stops the service. It calls the OnStop virtual
00282 //   function in which you can specify the actions to take when the service
00283 //   stops. If an error occurs, the error will be logged in the Application
00284 //   event log, and the service will be restored to the original state.
00285 //
00286 void CServiceBase::Stop()
00287 {
00288     DWORD dwOriginalState = m_status.dwCurrentState;
00289     try
00290     {
00291         // Tell SCM that the service is stopping.
00292         SetServiceStatus(SERVICE_STOP_PENDING);
00293
00294         // Perform service-specific stop operations.
00295         OnStop();
00296
00297         // Tell SCM that the service is stopped.
00298         SetServiceStatus(SERVICE_STOPPED);
00299     }
00300     catch (DWORD dwError)
00301     {
00302         // Log the error.
00303         WriteErrorLogEntry(L"Service Stop", dwError);
00304
00305         // Set the orginal service status.
00306         SetServiceStatus(dwOriginalState);
00307     }
00308     catch (...)
00309     {
00310         // Log the error.
00311         WriteEventLogEntry(L"Service failed to stop.", TRACE_LEVEL_ERROR);
00312
00313         // Set the orginal service status.
00314         SetServiceStatus(dwOriginalState);
00315     }
00316 }
00317
00318
00319 //
00320 //   FUNCTION: CServiceBase::OnStop()
00321 //
00322 //   PURPOSE: When implemented in a derived class, executes when a Stop
00323 //   command is sent to the service by the SCM. Specifies actions to take
00324 //   when a service stops running. Be sure to periodically call
00325 //   CServiceBase::SetServiceStatus() with SERVICE_STOP_PENDING if the
00326 //   procedure is going to take long time.
00327 //
00328 void CServiceBase::OnStop()
00329 {
00330 }
00331
00332
00333 //
00334 //   FUNCTION: CServiceBase::Pause()
00335 //
00336 //   PURPOSE: The function pauses the service if the service supports pause
00337 //   and continue. It calls the OnPause virtual function in which you can
00338 //   specify the actions to take when the service pauses. If an error occurs,
00339 //   the error will be logged in the Application event log, and the service
00340 //   will become running.
00341 //
00342 void CServiceBase::Pause()
00343 {
00344     try
00345     {
00346         // Tell SCM that the service is pausing.
00347         SetServiceStatus(SERVICE_PAUSE_PENDING);
00348
00349         // Perform service-specific pause operations.
00350         OnPause();
00351
00352         // Tell SCM that the service is paused.
00353         SetServiceStatus(SERVICE_PAUSED);
00354     }
00355     catch (DWORD dwError)
00356     {
00357         // Log the error.
00358         WriteErrorLogEntry(L"Service Pause", dwError);
00359
00360         // Tell SCM that the service is still running.
00361         SetServiceStatus(SERVICE_RUNNING);
00362     }
00363     catch (...)
00364     {
00365         // Log the error.
00366         WriteEventLogEntry(L"Service failed to pause.", TRACE_LEVEL_ERROR);
00367
00368         // Tell SCM that the service is still running.
00369         SetServiceStatus(SERVICE_RUNNING);
00370     }
00371 }
00372
00373
00374 //
00375 //   FUNCTION: CServiceBase::OnPause()
00376 //
00377 //   PURPOSE: When implemented in a derived class, executes when a Pause
00378 //   command is sent to the service by the SCM. Specifies actions to take
00379 //   when a service pauses.
00380 //
00381 void CServiceBase::OnPause()
00382 {
00383 }
00384
00385
00386 //
00387 //   FUNCTION: CServiceBase::Continue()
00388 //
00389 //   PURPOSE: The function resumes normal functioning after being paused if
00390 //   the service supports pause and continue. It calls the OnContinue virtual
00391 //   function in which you can specify the actions to take when the service
00392 //   continues. If an error occurs, the error will be logged in the
00393 //   Application event log, and the service will still be paused.
00394 //
00395 void CServiceBase::Continue()
00396 {
00397     try
00398     {
00399         // Tell SCM that the service is resuming.
00400         SetServiceStatus(SERVICE_CONTINUE_PENDING);
00401
00402         // Perform service-specific continue operations.
00403         OnContinue();
00404
00405         // Tell SCM that the service is running.
00406         SetServiceStatus(SERVICE_RUNNING);
00407     }
00408     catch (DWORD dwError)
00409     {
00410         // Log the error.
00411         WriteErrorLogEntry(L"Service Continue", dwError);
00412
00413         // Tell SCM that the service is still paused.
00414         SetServiceStatus(SERVICE_PAUSED);
00415     }
00416     catch (...)
00417     {
00418         // Log the error.
00419         WriteEventLogEntry(L"Service failed to resume.", TRACE_LEVEL_ERROR);
00420
00421         // Tell SCM that the service is still paused.
00422         SetServiceStatus(SERVICE_PAUSED);
00423     }
00424 }
00425
00426
00427 //
00428 //   FUNCTION: CServiceBase::OnContinue()
00429 //
00430 //   PURPOSE: When implemented in a derived class, OnContinue runs when a
00431 //   Continue command is sent to the service by the SCM. Specifies actions to
00432 //   take when a service resumes normal functioning after being paused.
00433 //
00434 void CServiceBase::OnContinue()
00435 {
00436 }
00437
00438
00439 //
00440 //   FUNCTION: CServiceBase::Shutdown()
00441 //
00442 //   PURPOSE: The function executes when the system is shutting down. It
00443 //   calls the OnShutdown virtual function in which you can specify what
00444 //   should occur immediately prior to the system shutting down. If an error
00445 //   occurs, the error will be logged in the Application event log.
00446 //
00447 void CServiceBase::Shutdown()
00448 {
00449     try
00450     {
00451         // Perform service-specific shutdown operations.
00452         OnShutdown();
00453
00454         // Tell SCM that the service is stopped.
00455         SetServiceStatus(SERVICE_STOPPED);
00456     }
00457     catch (DWORD dwError)
00458     {
00459         // Log the error.
00460         WriteErrorLogEntry(L"Service Shutdown", dwError);
00461     }
00462     catch (...)
00463     {
00464         // Log the error.
00465         WriteEventLogEntry(L"Service failed to shut down.", TRACE_LEVEL_ERROR);
00466     }
00467 }
00468
00469
00470 //
00471 //   FUNCTION: CServiceBase::OnShutdown()
00472 //
00473 //   PURPOSE: When implemented in a derived class, executes when the system
00474 //   is shutting down. Specifies what should occur immediately prior to the
00475 //   system shutting down.
00476 //
00477 void CServiceBase::OnShutdown()
00478 {
00479 }
00480
00481 #pragma endregion
00482
00483
00484 #pragma region Helper Functions
00485
00486 //
00487 //   FUNCTION: CServiceBase::SetServiceStatus(DWORD, DWORD, DWORD)
00488 //
00489 //   PURPOSE: The function sets the service status and reports the status to
00490 //   the SCM.
00491 //
00492 //   PARAMETERS:
00493 //   * dwCurrentState - the state of the service
00494 //   * dwWin32ExitCode - error code to report
00495 //   * dwWaitHint - estimated time for pending operation, in milliseconds
00496 //
00497 void CServiceBase::SetServiceStatus(
00498     _In_ DWORD dwCurrentState,
00499     _In_ DWORD dwWin32ExitCode,
00500     _In_ DWORD dwWaitHint)
00501 {
00502     static DWORD dwCheckPoint = 1;
00503
00504     // Fill in the SERVICE_STATUS structure of the service.
00505
00506     m_status.dwCurrentState = dwCurrentState;
00507     m_status.dwWin32ExitCode = dwWin32ExitCode;
00508     m_status.dwWaitHint = dwWaitHint;
00509
00510     m_status.dwCheckPoint =
00511         ((dwCurrentState == SERVICE_RUNNING) ||
00512         (dwCurrentState == SERVICE_STOPPED)) ?
00513         0 : dwCheckPoint++;
00514
00515     // Report the status of the service to the SCM.
00516     ::SetServiceStatus(m_statusHandle, &m_status);
00517 }
00518
00519
00520 //
00521 //   FUNCTION: CServiceBase::WriteEventLogEntry(PWSTR, WORD)
00522 //
00523 //   PURPOSE: Log an event.
00524 //
00525 //   PARAMETERS:
00526 //   * pszMessage - string message to be logged.
00527 //   * wType - the type of event to be logged. The parameter can be one of
00528 //     the following values.
00529 //
00530 //     EVENTLOG_SUCCESS
00531 //     EVENTLOG_AUDIT_FAILURE
00532 //     EVENTLOG_AUDIT_SUCCESS
00533 //     EVENTLOG_ERROR_TYPE
00534 //     EVENTLOG_INFORMATION_TYPE
00535 //     EVENTLOG_WARNING_TYPE
00536 //
00537 void CServiceBase::WriteEventLogEntry(
00538     _In_ PWSTR pszMessage,
00539     _In_ BYTE bLevel)
00540 {
00541     if (m_etwRegHandle != NULL)
00542     {
00543         EventWriteString(m_etwRegHandle, bLevel, 0, pszMessage);
00544     }
00545 }
00546
00547 //
00548 //   FUNCTION: CServiceBase::WriteErrorLogEntry(PWSTR, DWORD)
00549 //
00550 //   PURPOSE: Log an event.
00551 //
00552 //   PARAMETERS:
00553 //   * pszFunction - the function that gives the error
00554 //   * dwError - the error code
00555 //
00556 void CServiceBase::WriteErrorLogEntry(
00557     _In_ PWSTR pszFunction,
00558     _In_ DWORD dwError)
00559 {
00560     wchar_t szMessage[260];
00561     StringCchPrintf(szMessage, ARRAYSIZE(szMessage),
00562         L"%s failed w/err 0x%08lx", pszFunction, dwError);
00563     WriteEventLogEntry(szMessage, TRACE_LEVEL_ERROR);
00564 }
00565
00566 #pragma endregion
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MediaTransportControlsWithCustomCastButton Member List

This is the complete list of members for MediaTransportControlsWithCustomCastButton, including all inherited members.
CastButton | MediaTransportControlsWithCustomCastButton |
CastButton_Click(object sender, RoutedEventArgs e) | MediaTransportControlsWithCustomCastButton | [inline, private]
CastButtonClicked | MediaTransportControlsWithCustomCastButton |
MediaTransportControlsWithCustomCastButton() | MediaTransportControlsWithCustomCastButton | [inline]
OnApplyTemplate() | MediaTransportControlsWithCustomCastButton | [inline, protected]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBottomUpList/cs/Scenario1_Basic.xaml.cs Source File

  • XamlBottomUpList
  • cs

Scenario1_Basic.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading.Tasks;
00014 using Windows.Foundation;
00015 using Windows.UI.Core;
00016 using Windows.UI.ViewManagement;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario1_Basic : Page
00025     {
00026         private int messageNumber = 0;
00027         private string savedScrollPosition;
00028
00029         public Scenario1_Basic()
00030         {
00031             this.InitializeComponent();
00032
00033             // Start with one message, so the screen doesn't look empty.
00034             AddItemToEnd();
00035         }
00036
00037         private void AddItemToEnd()
00038         {
00039             BottomUpList.Items.Add($"{DateTime.Now}: Message {++messageNumber}");
00040         }
00041
00042         private void DeleteSelectedItem()
00043         {
00044             int selectedIndex = BottomUpList.SelectedIndex;
00045             BottomUpList.Items.Remove(BottomUpList.SelectedItem);
00046             if (selectedIndex < BottomUpList.Items.Count)
00047             {
00048                 BottomUpList.SelectedIndex = selectedIndex;
00049             }
00050         }
00051
00052         private void SaveScrollPosition()
00053         {
00054             // We let the item be its own key. In a more general program, the item would have
00055             // a unique ID that identifies it in the list.
00056             this.savedScrollPosition = ListViewPersistenceHelper.GetRelativeScrollPosition(BottomUpList, (o) => o.ToString());
00057         }
00058
00059         private async void RestoreScrollPosition()
00060         {
00061             if (this.savedScrollPosition != null)
00062             {
00063                 await ListViewPersistenceHelper.SetRelativeScrollPositionAsync(BottomUpList, this.savedScrollPosition, (s) => Task.FromResult((object)s).AsAsyncOperation());
00064             }
00065         }
00066     }
00067 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlContextMenu/cpp/SampleConfiguration.cpp Source File

  • XamlContextMenu
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "ContextFlyout on an element", "SDKTemplate.Scenario1" },
00021     { "ContextFlyout in ListView", "SDKTemplate.Scenario2" },
00022     { "ContextRequested event", "SDKTemplate.Scenario3" },
00023 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cppwinrt/Scenario1_Save.h Source File

  • PasswordVault
  • cppwinrt

Scenario1_Save.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_Save.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario1_Save : Scenario1_SaveT<Scenario1_Save>
00020     {
00021         Scenario1_Save();
00022
00023         void SaveCredential_Click(Windows::Foundation::IInspectable const&, Windows::Foundation::IInspectable const&);
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ SDKTemplate::implementation::MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario1_Save : Scenario1_SaveT<Scenario1_Save, implementation::Scenario1_Save>
00033     {
00034     };
00035 }
00036
Generated on Fri Nov 15 2024 22:20:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/Tasks/ProximitySensorBackgroundTask.cpp Source File

  • ProximitySensor
  • cpp
  • Tasks

ProximitySensorBackgroundTask.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ProximitySensorBackgroundTask.h
00014 // Declaration of the ProximitySensorBackgroundTask class
00015 //
00016
00017 #include "pch.h"
00018 #include "ProximitySensorBackgroundTask.h"
00019
00020 using namespace Tasks;
00021 using namespace Platform;
00022 using namespace Windows::Devices::Sensors;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Globalization;
00025 using namespace Windows::Globalization::DateTimeFormatting;
00026 using namespace Windows::Storage;
00027 using namespace Windows::ApplicationModel::Background;
00028
00029 ProximitySensorBackgroundTask::ProximitySensorBackgroundTask()
00030 {
00031 }
00032
00033 /// <summary>
00034 /// The entry point of this background task.
00035 /// </summary>
00036 /// <param name="taskInstance">The current background task instance.</param>
00037 void ProximitySensorBackgroundTask::Run(IBackgroundTaskInstance^ taskInstance)
00038 {
00039     // Associate a cancellation handler with the background task.
00040     // Even though this task isn't performing much work, it can still be canceled.
00041     taskInstance->Canceled += ref new BackgroundTaskCanceledEventHandler(this, &ProximitySensorBackgroundTask::OnCanceled);
00042
00043     SensorDataThresholdTriggerDetails^ triggerDetails = safe_cast<SensorDataThresholdTriggerDetails^>(taskInstance->TriggerDetails);
00044     if (SensorType::ProximitySensor == triggerDetails->SensorType)
00045     {
00046         // read the proximity sensor readings from the trigger details
00047         auto reports = ProximitySensor::GetReadingsFromTriggerDetails(triggerDetails);
00048
00049         auto settings = ApplicationData::Current->LocalSettings;
00050         settings->Values->Insert("ReportCount", reports->Size.ToString());
00051
00052         auto timestampFormatter = ref new DateTimeFormatter("day month year hour minute second");
00053
00054         if (reports->Size > 0)
00055         {
00056             auto lastReading = reports->GetAt(reports->Size - 1);
00057             auto knownTimestamp = lastReading->Timestamp;
00058
00059             // save the details from the reports into application cache for the foreground app to read and update UI with
00060             settings->Values->Insert("LastTimestamp", timestampFormatter->Format(lastReading->Timestamp));
00061             settings->Values->Insert("Detected", lastReading->IsDetected.ToString());
00062         }
00063
00064         auto calendar = ref new Calendar();
00065         calendar->SetToNow();
00066         settings->Values->Insert("TaskStatus", "Completed at " + timestampFormatter->Format(calendar->GetDateTime()));
00067         // No deferral is held on taskInstance because we are returning immediately.
00068     }
00069 }
00070
00071 /// <summary>
00072 /// Handles background task cancellation.
00073 /// </summary>
00074 /// <param name="sender">The background task instance being canceled.</param>
00075 /// <param name="reason">The cancellation reason.</param>
00076 void ProximitySensorBackgroundTask::OnCanceled(IBackgroundTaskInstance^ /*taskInstance*/, BackgroundTaskCancellationReason reason)
00077 {
00078     auto settings = ApplicationData::Current->LocalSettings;
00079     auto timestampFormatter = ref new DateTimeFormatter("day month year hour minute second");
00080
00081     auto calendar = ref new Calendar();
00082     calendar->SetToNow();
00083     settings->Values->Insert("TaskStatus", reason.ToString() + " at " + timestampFormatter->Format(calendar->GetDateTime()));
00084 }
Generated on Fri Nov 15 2024 22:21:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TouchKeyboard/cppwinrt/Scenario4_ShowView.cpp Source File

  • TouchKeyboard
  • cppwinrt

Scenario4_ShowView.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_ShowView.h"
00014 #include "Scenario4_ShowView.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace winrt::Windows::Foundation;
00018 using namespace winrt::Windows::UI::ViewManagement::Core;
00019 using namespace winrt::Windows::UI::Xaml;
00020
00021 namespace winrt::SDKTemplate::implementation
00022 {
00023     Scenario4_ShowView::Scenario4_ShowView()
00024     {
00025         InitializeComponent();
00026     }
00027
00028     void Scenario4_ShowView::TextBox_GotFocus(IInspectable const&, RoutedEventArgs const&)
00029     {
00030         CoreInputView::GetForCurrentView().TryShow(CoreInputViewKind::Emoji);
00031     }
00032 }
Generated on Fri Nov 15 2024 22:21:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlBind/cpp/App.xaml.cpp Source File

  • XamlBind
  • cpp

App.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Platform;
00018 using namespace Windows::ApplicationModel;
00019 using namespace Windows::ApplicationModel::Activation;
00020 using namespace Windows::Foundation;
00021 using namespace Windows::Foundation::Collections;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Interop;
00028 using namespace Windows::UI::Xaml::Media;
00029 using namespace Windows::UI::Xaml::Navigation;
00030
00031 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00032
00033 /// <summary>
00034 /// Initializes the singleton application object.  This is the first line of authored code
00035 /// executed, and as such is the logical equivalent of main() or WinMain().
00036 /// </summary>
00037 App::App()
00038 {
00039     InitializeComponent();
00040     Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
00041 }
00042
00043 /// <summary>
00044 /// Invoked when the application is launched normally by the end user.  Other entry points
00045 /// will be used such as when the application is launched to open a specific file.
00046 /// </summary>
00047 /// <param name="e">Details about the launch request and process.</param>
00048 void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
00049 {
00050 #if _DEBUG
00051     // Show graphics profiling information while debugging.
00052     if (IsDebuggerPresent())
00053     {
00054         // Display the current frame rate counters
00055         DebugSettings->EnableFrameRateCounter = false;
00056     }
00057 #endif
00058
00059     auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
00060
00061     // Do not repeat app initialization when the Window already has content,
00062     // just ensure that the window is active
00063     if (rootFrame == nullptr)
00064     {
00065         // Create a Frame to act as the navigation context and associate it with
00066         // a SuspensionManager key
00067         rootFrame = ref new Frame();
00068
00069         // Set the default language
00070         rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
00071
00072         rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
00073
00074         if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
00075         {
00076             // TODO: Restore the saved session state only when appropriate, scheduling the
00077             // final launch steps after the restore is complete
00078         }
00079
00080         if (rootFrame->Content == nullptr)
00081         {
00082             // When the navigation stack isn't restored navigate to the first page,
00083             // configuring the new page by passing required information as a navigation
00084             // parameter
00085             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00086         }
00087         // Place the frame in the current Window
00088         Window::Current->Content = rootFrame;
00089         // Ensure the current window is active
00090         Window::Current->Activate();
00091     }
00092     else
00093     {
00094         if (rootFrame->Content == nullptr)
00095         {
00096             // When the navigation stack isn't restored navigate to the first page,
00097             // configuring the new page by passing required information as a navigation
00098             // parameter
00099             rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
00100         }
00101         // Ensure the current window is active
00102         Window::Current->Activate();
00103     }
00104 }
00105
00106 /// <summary>
00107 /// Invoked when application execution is being suspended.  Application state is saved
00108 /// without knowing whether the application will be terminated or resumed with the contents
00109 /// of memory still intact.
00110 /// </summary>
00111 /// <param name="sender">The source of the suspend request.</param>
00112 /// <param name="e">Details about the suspend request.</param>
00113 void App::OnSuspending(Object^ /* sender */, SuspendingEventArgs^ /* e */)
00114 {
00115     //TODO: Save application state and stop any background activity
00116 }
00117
00118 /// <summary>
00119 /// Invoked when Navigation to a certain page fails
00120 /// </summary>
00121 /// <param name="sender">The Frame which failed navigation</param>
00122 /// <param name="e">Details about the navigation failure</param>
00123 void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
00124 {
00125     throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
00126 }
00127
Generated on Fri Nov 15 2024 22:16:50 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_Extend Member List

This is the complete list of members for Scenario2_Extend, including all inherited members.
EnableControls_Click(object sender, RoutedEventArgs e) | Scenario2_Extend | [inline, private]
ExtendView_Click(object sender, RoutedEventArgs e) | Scenario2_Extend | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario2_Extend | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_Extend | [inline, protected]
OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e) | Scenario2_Extend | [inline, private]
rootPage | Scenario2_Extend | [private]
Scenario2_Extend() | Scenario2_Extend | [inline]
ToggleFullScreenModeButton_Click(object sender, RoutedEventArgs e) | Scenario2_Extend | [inline, private]
UpdateFullScreenModeStatus() | Scenario2_Extend | [inline, private]
Generated on Fri Nov 15 2024 22:23:52 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlMasterDetail/cppwinrt/SampleConfiguration.h Source File

  • XamlMasterDetail
  • cppwinrt

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace winrt::SDKTemplate
00016 {
00017 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceStructures.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceStructures.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 public ref class AllJoynMessageArgStructure sealed : Windows::Foundation::Collections::IVector<Platform::Object^>
00026 {
00027 public:
00028     AllJoynMessageArgStructure()
00029     {
00030         m_vector = ref new Platform::Collections::Vector<Platform::Object^>();
00031     }
00032
00033     virtual Windows::Foundation::Collections::IIterator<Platform::Object^>^ First()
00034     {
00035         return m_vector->First();
00036     }
00037
00038     virtual Platform::Object^ GetAt(unsigned int index)
00039     {
00040         return m_vector->GetAt(index);
00041     }
00042
00043     virtual property unsigned int Size {
00044         virtual unsigned int get()
00045         {
00046             return m_vector->Size;
00047         }
00048     }
00049
00050     virtual bool IndexOf(Platform::Object^ value, unsigned int * index)
00051     {
00052         return m_vector->IndexOf(value, index);
00053     }
00054
00055     virtual unsigned int GetMany(unsigned int startIndex, Platform::WriteOnlyArray<Platform::Object^>^ items)
00056     {
00057         return m_vector->GetMany(startIndex, items);
00058     }
00059
00060     virtual Windows::Foundation::Collections::IVectorView<Platform::Object^>^ GetView()
00061     {
00062         return m_vector->GetView();
00063     }
00064
00065     virtual void SetAt(unsigned int index, Platform::Object^ value)
00066     {
00067         return m_vector->SetAt(index, value);
00068     }
00069
00070     virtual void InsertAt(unsigned int index, Platform::Object^ value)
00071     {
00072         return m_vector->InsertAt(index, value);
00073     }
00074
00075     virtual void Append(Platform::Object^ value)
00076     {
00077         return m_vector->Append(value);
00078     }
00079
00080     virtual void RemoveAt(unsigned int index)
00081     {
00082         return m_vector->RemoveAt(index);
00083     }
00084
00085     virtual void RemoveAtEnd()
00086     {
00087         return m_vector->RemoveAtEnd();
00088     }
00089
00090     virtual void Clear()
00091     {
00092         return m_vector->Clear();
00093     }
00094
00095     virtual void ReplaceAll(const Platform::Array<Platform::Object^>^ items)
00096     {
00097         return m_vector->ReplaceAll(items);
00098     }
00099
00100 private:
00101     Platform::Collections::Vector<Platform::Object^>^ m_vector;
00102 };
00103 } } } }
00104
00105 partial ref class TypeConversionHelpers
00106 {
00107 internal:
00108 };
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JumpList/cppwinrt/Scenario5_IsSupported.h Source File

  • JumpList
  • cppwinrt

Scenario5_IsSupported.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_IsSupported.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario5_IsSupported : Scenario5_IsSupportedT<Scenario5_IsSupported>
00019     {
00020         Scenario5_IsSupported();
00021
00022         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023     };
00024 }
00025
00026 namespace winrt::SDKTemplate::factory_implementation
00027 {
00028     struct Scenario5_IsSupported : Scenario5_IsSupportedT<Scenario5_IsSupported, implementation::Scenario5_IsSupported>
00029     {
00030     };
00031 }
Generated on Fri Nov 15 2024 22:20:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Scenario4_NumberParsing.cpp Source File

  • NumberFormatting
  • cppwinrt

Scenario4_NumberParsing.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_NumberParsing.h"
00014 #include "Scenario4_NumberParsing.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization::NumberFormatting;
00019 using namespace Windows::System::UserProfile;
00020 using namespace Windows::UI::Xaml;
00021
00022 namespace winrt::SDKTemplate::implementation
00023 {
00024     Scenario4_NumberParsing::Scenario4_NumberParsing()
00025     {
00026         InitializeComponent();
00027     }
00028
00029     void Scenario4_NumberParsing::Display_Click(IInspectable const&, RoutedEventArgs const&)
00030     {
00031         // This scenario uses the Windows.Globalization.NumberFormatting.DecimalFormatter,
00032         // Windows.Globalization.NumberFormatting.CurrencyFormatter and
00033         // Windows.Globalization.NumberFormatting.PercentFormatter classes to format and parse a number
00034         // percentage or currency.
00035
00036         // Define percent formatters.
00037         PercentFormatter percentFormat;
00038         PercentFormatter percentFormatJP({ L"ja-JP" }, L"JP");
00039         PercentFormatter percentFormatFR({ L"fr-FR" }, L"FR");
00040
00041         // Define decimal formatters.
00042         DecimalFormatter decimalFormat = DecimalFormatter();
00043         decimalFormat.IsGrouped(true);
00044         DecimalFormatter decimalFormatJP({ L"ja-JP" }, L"JP");
00045         decimalFormatJP.IsGrouped(true);
00046         DecimalFormatter decimalFormatFR({ L"fr-FR" }, L"FR");
00047         decimalFormatFR.IsGrouped(true);
00048
00049         // Define currency formatters
00050         auto userCurrency = GlobalizationPreferences::Currencies().GetAt(0);
00051         CurrencyFormatter currencyFormat(userCurrency);
00052         CurrencyFormatter currencyFormatJP(L"JPY", { L"ja-JP" }, L"JP");
00053         CurrencyFormatter currencyFormatFR(L"EUR", { L"fr-FR" }, L"FR");
00054
00055         // Generate numbers for parsing.
00056         double percentNumber = 0.523;
00057         double decimalNumber = 12345.67;
00058         double currencyNumber = 1234.56;
00059
00060         // Roundtrip the percent numbers by formatting and parsing.
00061         hstring percent1 = percentFormat.Format(percentNumber);
00062         double percent1Parsed = percentFormat.ParseDouble(percent1).Value();
00063
00064         hstring percent1JP = percentFormatJP.Format(percentNumber);
00065         double percent1JPParsed = percentFormatJP.ParseDouble(percent1JP).Value();
00066
00067         hstring percent1FR = percentFormatFR.Format(percentNumber);
00068         double percent1FRParsed = percentFormatFR.ParseDouble(percent1FR).Value();
00069
00070         // Generate the results for percent parsing.
00071         std::wostringstream results;
00072         results << L"Percent parsing of " << percentNumber << std::endl <<
00073             L"Formatted for current user: " << std::wstring_view(percent1) << L" Parsed as current user: " << percent1Parsed << std::endl <<
00074             L"Formatted for ja-JP: " << std::wstring_view(percent1JP) << L" Parsed for ja-JP: " << percent1JPParsed << std::endl <<
00075             L"Formatted for fr-FR: " << std::wstring_view(percent1FR) << L" Parsed for fr-FR: " << percent1FRParsed << std::endl <<
00076             std::endl;
00077
00078         // Roundtrip the decimal numbers for formatting and parsing.
00079         hstring decimal1 = decimalFormat.Format(decimalNumber);
00080         double decimal1Parsed = decimalFormat.ParseDouble(decimal1).Value();
00081
00082         hstring decimal1JP = decimalFormatJP.Format(decimalNumber);
00083         double decimal1JPParsed = decimalFormatJP.ParseDouble(decimal1JP).Value();
00084
00085         hstring decimal1FR = decimalFormatFR.Format(decimalNumber);
00086         double decimal1FRParsed = decimalFormatFR.ParseDouble(decimal1FR).Value();
00087
00088         // Generate the results for decimal parsing.
00089         results <<  L"Decimal parsing of " << decimalNumber << std::endl <<
00090             L"Formatted for current user: " << std::wstring_view(decimal1) << L" Parsed as current user: " << decimal1Parsed << std::endl <<
00091             L"Formatted for ja-JP: " << std::wstring_view(decimal1JP) << L" Parsed for ja-JP: " << decimal1JPParsed << std::endl <<
00092             L"Formatted for fr-FR: " << std::wstring_view(decimal1FR) << L" Parsed for fr-FR: " << decimal1FRParsed << std::endl <<
00093             std::endl;
00094
00095         // Roundtrip the currency numbers for formatting and parsing.
00096         hstring currency1 = currencyFormat.Format(currencyNumber);
00097         double currency1Parsed = currencyFormat.ParseDouble(currency1).Value();
00098
00099         hstring currency1JP = currencyFormatJP.Format(currencyNumber);
00100         double currency1JPParsed = currencyFormatJP.ParseDouble(currency1JP).Value();
00101
00102         hstring currency1FR = currencyFormatFR.Format(currencyNumber);
00103         double currency1FRParsed = currencyFormatFR.ParseDouble(currency1FR).Value();
00104
00105         // Generate the results for decimal parsing.
00106         results << L"Currency parsing of " << currencyNumber << L"\n" <<
00107             L"Formatted for current user: " << std::wstring_view(currency1) << L" Parsed as current user: " << currency1Parsed << std::endl <<
00108             L"Formatted for ja-JP: " << std::wstring_view(currency1JP) << L" Parsed for ja-JP: " << currency1JPParsed << std::endl <<
00109             L"Formatted for fr-FR: " << std::wstring_view(currency1FR) << L" Parsed for fr-FR: " << currency1FRParsed << std::endl <<
00110             std::endl;
00111
00112         // Display the results.
00113         OutputTextBlock().Text(results.str());
00114     }
00115 }
Generated on Fri Nov 15 2024 22:20:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FolderEnumeration/cs/Scenario2.xaml.cs Source File

  • FolderEnumeration
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Text;
00014 using System.Threading.Tasks;
00015 using Windows.Storage;
00016 using Windows.Storage.Search;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario2 : Page
00024     {
00025         public Scenario2()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         /// <summary>
00031         /// list all the files and folders in Pictures library by month
00032         /// </summary>
00033         private async void GroupByMonthButton_Click(object sender, RoutedEventArgs e)
00034         {
00035             await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByMonth));
00036         }
00037
00038         /// <summary>
00039         /// list all the files and folders in Pictures library by rating
00040         /// </summary>
00041         private async void GroupByRatingButton_Click(object sender, RoutedEventArgs e)
00042         {
00043             await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByRating));
00044         }
00045
00046         /// <summary>
00047         /// list all the files and folders in Pictures library by tag
00048         /// </summary>
00049         private async void GroupByTagButton_Click(object sender, RoutedEventArgs e)
00050         {
00051             await GroupByHelperAsync(new QueryOptions(CommonFolderQuery.GroupByTag));
00052         }
00053
00054         /// <summary>
00055         /// helper for all list by functions
00056         /// </summary>
00057         async Task GroupByHelperAsync(QueryOptions queryOptions)
00058         {
00059             OutputPanel.Children.Clear();
00060
00061             StorageFolder picturesFolder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
00062             StorageFolderQueryResult queryResult = picturesFolder.CreateFolderQueryWithOptions(queryOptions);
00063
00064             IReadOnlyList<StorageFolder> folderList = await queryResult.GetFoldersAsync();
00065             foreach (StorageFolder folder in folderList)
00066             {
00067                 IReadOnlyList<StorageFile> fileList = await folder.GetFilesAsync();
00068                 OutputPanel.Children.Add(CreateHeaderTextBlock(folder.Name + " (" + fileList.Count + ")"));
00069                 foreach (StorageFile file in fileList)
00070                 {
00071                     OutputPanel.Children.Add(CreateLineItemTextBlock(file.Name));
00072                 }
00073             }
00074         }
00075
00076         TextBlock CreateHeaderTextBlock(string contents)
00077         {
00078             TextBlock textBlock = new TextBlock();
00079             textBlock.Text = contents;
00080             textBlock.Style = (Style)Application.Current.Resources["SampleHeaderTextStyle"];
00081             textBlock.TextWrapping = TextWrapping.Wrap;
00082             return textBlock;
00083         }
00084
00085         TextBlock CreateLineItemTextBlock(string contents)
00086         {
00087             TextBlock textBlock = new TextBlock();
00088             textBlock.Text = contents;
00089             textBlock.Style = (Style)Application.Current.Resources["BasicTextStyle"];
00090             textBlock.TextWrapping = TextWrapping.Wrap;
00091             Thickness margin = textBlock.Margin;
00092             margin.Left = 20;
00093             textBlock.Margin = margin;
00094             return textBlock;
00095         }
00096     }
00097 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2 Member List

This is the complete list of members for Scenario2, including all inherited members.
ConnectSocket_Click(object sender, RoutedEventArgs e) | Scenario2 | [inline, private]
MessageReceived(DatagramSocket socket, DatagramSocketMessageReceivedEventArgs eventArguments) | Scenario2 | [inline, private]
NotifyUserFromAsyncThread(string strMessage, NotifyType type) | Scenario2 | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2 | [inline, protected]
rootPage | Scenario2 | [private]
Scenario2() | Scenario2 | [inline]
Generated on Fri Nov 15 2024 22:23:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Content/SpatialInputHandler.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Content

SpatialInputHandler.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace HolographicMRCSample
00004 {
00005     // Sample gesture handler.
00006     // Hooks up events to recognize a tap gesture, and keeps track of input using a boolean value.
00007     class SpatialInputHandler
00008     {
00009     public:
00010         SpatialInputHandler();
00011         ~SpatialInputHandler();
00012
00013         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ CheckForInput();
00014
00015     private:
00016         // Interaction event handler.
00017         void OnSourcePressed(
00018             Windows::UI::Input::Spatial::SpatialInteractionManager^ sender,
00019             Windows::UI::Input::Spatial::SpatialInteractionSourceEventArgs^ args);
00020
00021         // API objects used to process gesture input, and generate gesture events.
00022         Windows::UI::Input::Spatial::SpatialInteractionManager^     m_interactionManager;
00023
00024         // Event registration token.
00025         Windows::Foundation::EventRegistrationToken                 m_sourcePressedEventToken;
00026
00027         // Used to indicate that a Pressed input event was received this frame.
00028         Windows::UI::Input::Spatial::SpatialInteractionSourceState^ m_sourceState = nullptr;
00029     };
00030 }
Generated on Fri Nov 15 2024 22:16:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MagneticStripeReader/cpp/SampleConfiguration.h Source File

  • MagneticStripeReader
  • cpp

SampleConfiguration.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013 #include "pch.h"
00014
00015 namespace SDKTemplate
00016 {
00017     value struct Scenario;
00018
00019     partial ref class MainPage
00020     {
00021     internal:
00022         static property Platform::String^ FEATURE_NAME
00023         {
00024             Platform::String^ get()
00025             {
00026                 return "Magnetic Stripe Reader";
00027             }
00028         }
00029
00030         static property Platform::Array<Scenario>^ scenarios
00031         {
00032             Platform::Array<Scenario>^ get()
00033             {
00034                 return scenariosInner;
00035             }
00036         }
00037
00038     private:
00039         static Platform::Array<Scenario>^ scenariosInner;
00040     };
00041
00042     public value struct Scenario
00043     {
00044         Platform::String^ Title;
00045         Platform::String^ ClassName;
00046     };
00047
00048     namespace DeviceHelpers
00049     {
00050         // By default, use all connections types.
00051         Concurrency::task<Windows::Devices::PointOfService::MagneticStripeReader^> GetFirstMagneticStripeReaderAsync(
00052             Windows::Devices::PointOfService::PosConnectionTypes connectionTypes  = Windows::Devices::PointOfService::PosConnectionTypes::All);
00053     }
00054
00055 }
Generated on Fri Nov 15 2024 22:17:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/GameContent/ConstantBuffers.h Source File

  • Simple3DGameDX
  • cppwinrt
  • GameContent

ConstantBuffers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 struct PNTVertex
00015 {
00016     DirectX::XMFLOAT3 position;
00017     DirectX::XMFLOAT3 normal;
00018     DirectX::XMFLOAT2 textureCoordinate;
00019 };
00020
00021 static D3D11_INPUT_ELEMENT_DESC PNTVertexLayout[] =
00022 {
00023     {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0},
00024     {"NORMAL",   0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
00025     {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT,    0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0},
00026 };
00027
00028 struct ConstantBufferNeverChanges
00029 {
00030     DirectX::XMFLOAT4 lightPosition[4];
00031     DirectX::XMFLOAT4 lightColor;
00032 };
00033
00034 struct ConstantBufferChangeOnResize
00035 {
00036     DirectX::XMFLOAT4X4 projection;
00037 };
00038
00039 struct ConstantBufferChangesEveryFrame
00040 {
00041     DirectX::XMFLOAT4X4 view;
00042 };
00043
00044 struct ConstantBufferChangesEveryPrim
00045 {
00046     DirectX::XMFLOAT4X4 worldMatrix;
00047     DirectX::XMFLOAT4 meshColor;
00048     DirectX::XMFLOAT4 diffuseColor;
00049     DirectX::XMFLOAT4 specularColor;
00050     float specularPower;
00051 };
00052
Generated on Fri Nov 15 2024 22:21:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Store/cpp/Scenario3_UnmanagedConsumable.xaml.cpp Source File

  • Store
  • cpp

Scenario3_UnmanagedConsumable.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario3_UnmanagedConsumable.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::Services::Store;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml;
00024
00025 Scenario3_UnmanagedConsumable::Scenario3_UnmanagedConsumable()
00026 {
00027     InitializeComponent();
00028
00029     storeContext = StoreContext::GetDefault();
00030 }
00031
00032 void Scenario3_UnmanagedConsumable::GetUnmanagedConsumablesButton_Click(Object^ sender, RoutedEventArgs^ e)
00033 {
00034     auto filterList = ref new Vector<String^>({ "UnmanagedConsumable" });
00035
00036     // Get list of Add Ons this app can sell, filtering for the types we know about.
00037     create_task(storeContext->GetAssociatedStoreProductsAsync(filterList)).then([this](StoreProductQueryResult^ addOns)
00038     {
00039         ProductsListView->ItemsSource = Utils::CreateProductListFromQueryResult(addOns, "UnmanagedConsumable Add-Ons");
00040     }, task_continuation_context::get_current_winrt_context());
00041 }
00042
00043 void Scenario3_UnmanagedConsumable::PurchaseAddOnButton_Click(Object^ sender, RoutedEventArgs^ e)
00044 {
00045     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00046
00047     create_task(storeContext->RequestPurchaseAsync(item->StoreId)).then([this, item](StorePurchaseResult^ result)
00048     {
00049         if (result->ExtendedError.Value != S_OK)
00050         {
00051             Utils::ReportExtendedError(result->ExtendedError);
00052             return;
00053         }
00054
00055         switch (result->Status)
00056         {
00057         case StorePurchaseStatus::AlreadyPurchased:
00058             rootPage->NotifyUser("You already bought this consumable and must fulfill it.", NotifyType::ErrorMessage);
00059             break;
00060
00061         case StorePurchaseStatus::Succeeded:
00062             rootPage->NotifyUser("You bought " + item->Title + ".", NotifyType::StatusMessage);
00063             break;
00064
00065         case StorePurchaseStatus::NotPurchased:
00066             rootPage->NotifyUser("Product was not purchased, it may have been canceled.", NotifyType::ErrorMessage);
00067             break;
00068
00069         case StorePurchaseStatus::NetworkError:
00070             rootPage->NotifyUser("Product was not purchased due to a network error.", NotifyType::ErrorMessage);
00071             break;
00072
00073         case StorePurchaseStatus::ServerError:
00074             rootPage->NotifyUser("Product was not purchased due to a server error.", NotifyType::ErrorMessage);
00075             break;
00076
00077         default:
00078             rootPage->NotifyUser("Product was not purchased due to an unknown error.", NotifyType::ErrorMessage);
00079             break;
00080         }
00081     }, task_continuation_context::get_current_winrt_context());
00082 }
00083
00084 void Scenario3_UnmanagedConsumable::GetConsumableBalanceButton_Click(Object^ sender, RoutedEventArgs^ e)
00085 {
00086     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00087
00088     create_task(storeContext->GetConsumableBalanceRemainingAsync(item->StoreId)).then([this](StoreConsumableResult^ result)
00089     {
00090         if (result->ExtendedError.Value != S_OK)
00091         {
00092             Utils::ReportExtendedError(result->ExtendedError);
00093             return;
00094         }
00095
00096         switch (result->Status)
00097         {
00098         case StoreConsumableStatus::InsufficentQuantity: // should never get this...
00099             rootPage->NotifyUser("Insufficient Quantity! Balance Remaining: " + result->BalanceRemaining, NotifyType::ErrorMessage);
00100             break;
00101
00102         case StoreConsumableStatus::Succeeded:
00103             rootPage->NotifyUser("Balance Remaining: " + result->BalanceRemaining, NotifyType::StatusMessage);
00104             break;
00105
00106         case StoreConsumableStatus::NetworkError:
00107             rootPage->NotifyUser("Network error retrieving consumable balance.", NotifyType::ErrorMessage);
00108             break;
00109
00110         case StoreConsumableStatus::ServerError:
00111             rootPage->NotifyUser("Server error retrieving consumable balance.", NotifyType::ErrorMessage);
00112             break;
00113
00114         default:
00115             rootPage->NotifyUser("Unknown error retrieving consumable balance.", NotifyType::ErrorMessage);
00116             break;
00117         }
00118     }, task_continuation_context::get_current_winrt_context());
00119 }
00120
00121 void Scenario3_UnmanagedConsumable::FulfillConsumableButton_Click(Object^ sender, RoutedEventArgs^ e)
00122 {
00123     auto item = safe_cast<ItemDetails^>(ProductsListView->SelectedItem);
00124
00125     // This can be used to ensure this request is never double fulfilled. The server will
00126     // only accept one report for this specific GUID.
00127     GUID guid;
00128     if (FAILED(CoCreateGuid(&guid)))
00129     {
00130         rootPage->NotifyUser("Failed to create a tracking GUID.", NotifyType::ErrorMessage);
00131         return;
00132     }
00133
00134     Guid trackingId(guid);
00135
00136     // Always use quantity of "1" to fulfill an Unmanaged consumable
00137     create_task(storeContext->ReportConsumableFulfillmentAsync(item->StoreId, 1, trackingId)).then([this](StoreConsumableResult^ result)
00138     {
00139         if (result->ExtendedError.Value != S_OK)
00140         {
00141             Utils::ReportExtendedError(result->ExtendedError);
00142             return;
00143         }
00144
00145         switch (result->Status)
00146         {
00147         case StoreConsumableStatus::InsufficentQuantity:
00148             rootPage->NotifyUser("Insufficient Quantity! Balance Remaining: " + result->BalanceRemaining, NotifyType::ErrorMessage);
00149             break;
00150
00151         case StoreConsumableStatus::Succeeded:
00152             rootPage->NotifyUser("Successful fulfillment! Balance Remaining: " + result->BalanceRemaining, NotifyType::StatusMessage);
00153             break;
00154
00155         case StoreConsumableStatus::NetworkError:
00156             rootPage->NotifyUser("Network error fulfilling consumable.", NotifyType::ErrorMessage);
00157             break;
00158
00159         case StoreConsumableStatus::ServerError:
00160             rootPage->NotifyUser("Server error fulfilling consumable.", NotifyType::ErrorMessage);
00161             break;
00162
00163         default:
00164             rootPage->NotifyUser("Unknown error fulfilling consumable.", NotifyType::ErrorMessage);
00165             break;
00166         }
00167     }, task_continuation_context::get_current_winrt_context());
00168 }
Generated on Fri Nov 15 2024 22:21:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Content/VideoRenderer.h Source File

  • 360VideoPlayback
  • cpp
  • Content

VideoRenderer.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include "..\Common\DeviceResources.h"
00004 #include "..\Common\StepTimer.h"
00005 #include "ShaderStructures.h"
00006 #include <concrt.h>
00007
00008 namespace _360VideoPlayback
00009 {
00010     // This sample renderer instantiates a basic rendering pipeline.
00011     class VideoRenderer
00012     {
00013     public:
00014         VideoRenderer();
00015         void CreateDeviceDependentResources();
00016         void ReleaseDeviceDependentResources();
00017         void Update(const DX::StepTimer& timer);
00018         void Render();
00019         void ComputeSphere(unsigned short tessellation, bool invertn);
00020         void LoadShaders();
00021         void CreateD3D11Surface();
00022     private:
00023         // Cached pointer to device resources.
00024         std::shared_ptr<DX::DeviceResources>            m_deviceResources;
00025
00026         // Direct3D resources for cube geometry.
00027         Microsoft::WRL::ComPtr<ID3D11InputLayout>       m_inputLayout;
00028         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_vertexBuffer;
00029         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_indexBuffer;
00030         Microsoft::WRL::ComPtr<ID3D11VertexShader>      m_vertexShader;
00031         Microsoft::WRL::ComPtr<ID3D11GeometryShader>    m_geometryShader;
00032         Microsoft::WRL::ComPtr<ID3D11PixelShader>       m_pixelShader;
00033         Microsoft::WRL::ComPtr<ID3D11Buffer>            m_modelConstantBuffer;
00034
00035         // System resources for cube geometry.
00036         ModelConstantBuffer                             m_modelConstantBufferData;
00037         uint32                                          m_indexCount = 0;
00038
00039         // Variables used with the rendering loop.
00040         bool                                            m_loadingComplete = false;
00041         float                                           m_degreesPerSecond = 45.f;
00042
00043         // If the current D3D Device supports VPRT, we can avoid using a geometry
00044 // shader just to set the render target array index.
00045         bool                                            m_usingVprtShaders = false;
00046
00047         Microsoft::WRL::ComPtr<ID3D11Texture2D>         m_texture;
00048         Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface^ m_surface;
00049         Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureView;
00050         Microsoft::WRL::ComPtr<ID3D11SamplerState>       m_quadTextureSamplerState;
00051         void OnVideoFrameAvailable();
00052         Windows::Foundation::EventRegistrationToken      m_videoFrameAvailToken;
00053         Concurrency::critical_section m_critical;
00054     };
00055 }
Generated on Fri Nov 15 2024 22:16:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: JapanesePhoneticAnalysis/cpp/SampleConfiguration.cpp Source File

  • JapanesePhoneticAnalysis
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Analyze Japanese text", "SDKTemplate.Scenario1_Analyze" },
00021 };
Generated on Fri Nov 15 2024 22:17:15 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/cs/ServiceViewModel.cs Source File

  • CustomCapability
  • cs

ServiceViewModel.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.ComponentModel;
00014 using System.Runtime.InteropServices;
00015 using System.Runtime.InteropServices.ComTypes;
00016 using System.Threading.Tasks;
00017 using Windows.ApplicationModel;
00018 using Windows.System.Threading;
00019
00020 [StructLayout(LayoutKind.Explicit, Size = 8)]
00021 struct LARGE_INTEGER
00022 {
00023     [FieldOffset(0)] public Int64 QuadPart;
00024     [FieldOffset(0)] public Int32 LowPart;
00025     [FieldOffset(4)] public Int32 HighPart;
00026 }
00027
00028 namespace SDKTemplate
00029 {
00030     [Windows.UI.Xaml.Data.Bindable]
00031     public class ServiceViewModel : INotifyPropertyChanged
00032     {
00033         // RpcClient API's implemented in C++ dll
00034         [DllImport("RpcClient.dll")]
00035         static extern long RpcClientInitialize(out IntPtr rpcClient);
00036
00037         [DllImport("RpcClient.dll")]
00038         static extern long RpcClientClose(IntPtr rpcClient);
00039
00040         [DllImport("RpcClient.dll")]
00041         static extern long SetSampleRate(IntPtr rpcClient, int rate);
00042
00043         [DllImport("RpcClient.dll")]
00044         static extern long StartMeteringAndWaitForStop(IntPtr RpcClientHandle, long samplePeriod);
00045
00046         [DllImport("RpcClient.dll")]
00047         static extern long GetMeteringData(IntPtr RpcClientHandle, ref long MeteringData);
00048
00049         [DllImport("RpcClient.dll")]
00050         static extern long GetCallbackCount(IntPtr RpcClientHandle, ref long MeteringData);
00051
00052         [DllImport("RpcClient.dll")]
00053         static extern long StopMeteringData(IntPtr RpcClientHandle);
00054
00055         [DllImport("api-ms-win-core-sysinfo-l1-2-1.dll")]
00056         static extern void GetSystemTimeAsFileTime(ref FILETIME lpSystemTimeAsFileTime);
00057
00058         [DllImport("api-ms-win-core-libraryloader-l2-1-0.dll", CharSet = CharSet.Unicode)]
00059         static extern IntPtr LoadPackagedLibrary(string filename, uint reserved);
00060
00061         public static ServiceViewModel Current { get; private set; }
00062
00063         static ServiceViewModel()
00064         {
00065             Current = new ServiceViewModel();
00066
00067             // Register for app suspend/resume handlers
00068             App.Current.Suspending += ServiceViewModel.Current.SuspendMeteringService;
00069             App.Current.Resuming += ServiceViewModel.Current.ResumeMeteringService;
00070         }
00071
00072         private async void ResumeMeteringService(object sender, object e)
00073         {
00074             if (meteringOnWhileSuspension) {
00075                 await StartMetering(samplePeriod);
00076                 meteringOnWhileSuspension = false;
00077             }
00078         }
00079
00080         private async void SuspendMeteringService(object sender, SuspendingEventArgs e)
00081         {
00082             var deferral = e.SuspendingOperation.GetDeferral();
00083             if (meteringOn) {
00084                 await StopMetering();
00085                 meteringOnWhileSuspension = true;
00086             }
00087             deferral.Complete();
00088         }
00089
00090         Lazy<bool> isSupported = new Lazy<bool>(() => LoadPackagedLibrary("RpcClient.dll", 0) != IntPtr.Zero);
00091         volatile bool meteringOn;
00092         volatile bool meteringOnWhileSuspension;
00093         Windows.UI.Core.CoreDispatcher dispatcher;
00094         int samplePeriod;
00095         LARGE_INTEGER lastUpdateTime;
00096         long rpcDataCountOld = 0;
00097         uint sampleRefreshCount = 0;
00098         IntPtr rpcClient;
00099         bool stopMeteringRequested;
00100         long[] sampleArray;
00101
00102         // Variables backing UI bindings
00103         string sampleMessage;
00104         string expectedRpcCallbackRate;
00105         string actualRpcCallbackRate;
00106         bool startButtonEnabled;
00107         bool stopButtonEnabled;
00108         bool sliderEnabled;
00109         double sliderValue;
00110
00111         internal string ExpectedRpcCallbackRate
00112         {
00113             get { return expectedRpcCallbackRate; }
00114             set
00115             {
00116                 expectedRpcCallbackRate = value;
00117                 NotifyPropertyChangedAsync(nameof(ExpectedRpcCallbackRate));
00118             }
00119         }
00120         internal string ActualRpcCallbackRate
00121         {
00122             get { return actualRpcCallbackRate; }
00123             set
00124             {
00125                 actualRpcCallbackRate = value;
00126                 NotifyPropertyChangedAsync(nameof(ActualRpcCallbackRate));
00127             }
00128         }
00129         internal string SampleMessage
00130         {
00131             get { return sampleMessage; }
00132             set
00133             {
00134                 sampleMessage = value;
00135                 NotifyPropertyChangedAsync(nameof(SampleMessage));
00136             }
00137         }
00138         internal bool StartButtonEnabled
00139         {
00140             get { return startButtonEnabled; }
00141             set {
00142                 startButtonEnabled = value;
00143                 NotifyPropertyChangedAsync("StartButtonEnabled");
00144             }
00145         }
00146         internal bool StopButtonEnabled
00147         {
00148             get { return stopButtonEnabled; }
00149             set
00150             {
00151                 stopButtonEnabled = value;
00152                 NotifyPropertyChangedAsync(nameof(StopButtonEnabled));
00153             }
00154         }
00155         internal bool SliderEnabled
00156         {
00157             get { return sliderEnabled; }
00158             set
00159             {
00160                 sliderEnabled = value;
00161                 NotifyPropertyChangedAsync(nameof(SliderEnabled));
00162             }
00163         }
00164         internal double SliderValue
00165         {
00166             get { return sliderValue; }
00167             set
00168             {
00169                 sliderValue = value;
00170                 NotifyPropertyChangedAsync(nameof(SliderValue));
00171             }
00172         }
00173
00174         public event PropertyChangedEventHandler PropertyChanged;
00175
00176         private ServiceViewModel()
00177         {
00178             // Set default rate
00179             samplePeriod = 100;
00180
00181             // Initialize UI state
00182             startButtonEnabled = true;
00183             stopButtonEnabled = false;
00184             sliderEnabled = true;
00185             sliderValue = samplePeriod;
00186             actualRpcCallbackRate = "0";
00187             expectedRpcCallbackRate = "0";
00188
00189             meteringOn = false;
00190             meteringOnWhileSuspension = false;
00191
00192             // Get the dispatcher for notifying property change
00193             dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;
00194
00195             sampleArray = new long[1000];
00196         }
00197
00198         //
00199         // Initializes rpcclient and metering
00200         //
00201         internal async Task StartMetering(int sampleRate)
00202         {
00203             await Task.Run(() =>
00204             {
00205                 rpcClient = IntPtr.Zero;
00206
00207                 SampleMessage = "";
00208                 StartButtonEnabled = false;
00209                 StopButtonEnabled = true;
00210                 stopMeteringRequested = false;
00211
00212                 if (!isSupported.Value)
00213                 {
00214                     NotifyStatusMessage("NT service support has not been compiled for this architecture.", NotifyType.ErrorMessage);
00215                     return;
00216                 }
00217
00218                 if (NotifyIfAnyError(RpcClientInitialize(out rpcClient))) return;
00219
00220                 meteringOn = true;
00221                 sampleRefreshCount = 0;
00222                 sampleArray[0] = 0;
00223
00224                 // Set the sample rate on server
00225                 samplePeriod = sampleRate;
00226                 long retCode = SetSampleRate(rpcClient, sampleRate);
00227
00228                 FILETIME initialSystemTime = new FILETIME();
00229                 GetSystemTimeAsFileTime(ref initialSystemTime);
00230                 lastUpdateTime = new LARGE_INTEGER();
00231                 lastUpdateTime.LowPart = initialSystemTime.dwLowDateTime;
00232                 lastUpdateTime.HighPart = initialSystemTime.dwHighDateTime;
00233
00234                 if (!NotifyIfAnyError(retCode))
00235                 {
00236                     // Set up worker for UI update.
00237                     TimeSpan span = new TimeSpan(100 * 10000); // 100ms refresh rate
00238
00239                     TimerElapsedHandler timerHandler = (ThreadPoolTimer) =>
00240                     {
00241                         long meteringData = 0;
00242                         GetMeteringData(rpcClient, ref meteringData);
00243
00244                         // If there is no new data, return
00245                         if (sampleArray[0] == meteringData)
00246                         {
00247                             return;
00248                         }
00249
00250                         // Arithmetic subtraction of time
00251                         // https://msdn.microsoft.com/en-us/library/ms724950%28VS.85%29.aspx
00252                         FILETIME currentSystemTime = new FILETIME();
00253                         LARGE_INTEGER currentTimeUi = new LARGE_INTEGER();
00254                         GetSystemTimeAsFileTime(ref currentSystemTime);
00255                         currentTimeUi.LowPart = currentSystemTime.dwLowDateTime;
00256                         currentTimeUi.HighPart = currentSystemTime.dwHighDateTime;
00257
00258                         // Calculate number of samples received since last callback
00259                         long now = 0, diff = 0;
00260                         GetCallbackCount(rpcClient, ref now);
00261
00262                         diff = now - rpcDataCountOld;
00263                         rpcDataCountOld = now;
00264
00265                         // Calculate incoming sample rate
00266                         double rate = (double)diff * 1E7 / (currentTimeUi.QuadPart - lastUpdateTime.QuadPart);
00267                         ExpectedRpcCallbackRate = (1E3 / samplePeriod).ToString() + " /sec";
00268                         lastUpdateTime = currentTimeUi;
00269
00270                         ActualRpcCallbackRate = rate.ToString() + " /sec";
00271
00272                         // Construct the sample data string
00273                         string sampleMessage = meteringData + "\n";
00274                         uint length = (uint)sampleArray.Length;
00275                         if (sampleRefreshCount < length)
00276                         {
00277                             ++sampleRefreshCount;
00278                             length = sampleRefreshCount;
00279                         }
00280
00281                         // Insert the new data point at the top of the array.
00282                         // Old data falls off the end of the array.
00283                         for (int i = 1; i < length; ++i)
00284                         {
00285                             sampleArray[i] = sampleArray[i - 1];
00286                             sampleMessage += sampleArray[i] + "\n";
00287                         }
00288                         sampleArray[0] = meteringData;
00289
00290                         SampleMessage = sampleMessage;
00291                     };
00292
00293                     ThreadPoolTimer periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(timerHandler, span);
00294                     NotifyStatusMessage("Metering start command sent successfully", NotifyType.StatusMessage);
00295                     retCode = StartMeteringAndWaitForStop(rpcClient, sampleRate);
00296                     meteringOn = false;
00297                     periodicTimer.Cancel();
00298                     if (!NotifyIfAnyError(retCode) && !stopMeteringRequested)
00299                     {
00300                         NotifyStatusMessage("Rpc server connection closed without stop metering being requested",
00301                                             NotifyType.ErrorMessage);
00302                         StartButtonEnabled = true;
00303                         StopButtonEnabled = false;
00304                     }
00305                     RpcClientClose(rpcClient);
00306                 }
00307             });
00308         }
00309
00310         void NotifyStatusMessage(string message, NotifyType messageType)
00311         {
00312             MainPage.Current.NotifyUser(message, messageType);
00313         }
00314
00315         //
00316         // if errCode represents an error, then display a message and return true.
00317         //
00318         public bool NotifyIfAnyError(long errCode)
00319         {
00320             if (errCode != 0)
00321             {
00322                 meteringOn = false;
00323                 NotifyStatusMessage("Error occured while communicating with RPC server: " + errCode.ToString(), NotifyType.ErrorMessage);
00324
00325                 // Reset button state
00326                 StartButtonEnabled = true;
00327                 StopButtonEnabled = false;
00328                 return true;
00329             }
00330             return false;
00331         }
00332
00333         internal async Task StopMetering()
00334         {
00335             await Task.Run(() =>
00336             {
00337                 StopButtonEnabled = false;
00338                 SliderEnabled = false;
00339                 stopMeteringRequested = true;
00340
00341                 if (isSupported.Value)
00342                 {
00343                     long retCode = StopMeteringData(rpcClient);
00344                     if (!NotifyIfAnyError(retCode))
00345                     {
00346                         NotifyStatusMessage("Metering stop command sent successfully",
00347                                             NotifyType.StatusMessage);
00348                     }
00349                 }
00350
00351                 SliderEnabled = true;
00352                 StartButtonEnabled = true;
00353             });
00354         }
00355
00356         internal void SetSamplePeriod(int value)
00357         {
00358             samplePeriod = value;
00359             if (meteringOn)
00360             {
00361                 long retCode = SetSampleRate(rpcClient, samplePeriod);
00362                 if (!NotifyIfAnyError(retCode))
00363                 {
00364                     NotifyStatusMessage(
00365                         "Sample period set to: " + samplePeriod,
00366                         NotifyType.StatusMessage);
00367                 }
00368             }
00369         }
00370
00371         private async void NotifyPropertyChangedAsync(string prop)
00372         {
00373             if (dispatcher != null)
00374             {
00375                 await dispatcher.RunAsync(
00376                     Windows.UI.Core.CoreDispatcherPriority.Normal,
00377                     () => PropertyChanged(this, new PropertyChangedEventArgs(prop)));
00378             }
00379         }
00380     }
00381 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_IsSupported Member List

This is the complete list of members for Scenario5_IsSupported, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario5_IsSupported | [inline, protected]
Scenario5_IsSupported() | Scenario5_IsSupported | [inline]
Generated on Fri Nov 15 2024 22:23:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/RuntimeComponent/LinguisticServices.cpp Source File

  • LinguisticServices
  • RuntimeComponent

LinguisticServices.cpp

Go to the documentation of this file.
00001 ﻿#include "pch.h"
00002 #include "LinguisticServices.h"
00003 #include "LinguisticServices.g.cpp"
00004
00005 namespace winrt::Sample::implementation
00006 {
00007     Windows::Foundation::Collections::IVectorView<hstring> LinguisticServices::RecognizeTextLanguages(hstring const& text)
00008     {
00009         std::vector<hstring> results;
00010         ELS::RecognizeTextLanguages(text.c_str(), text.size(), [&](auto lang)
00011             {
00012                 results.emplace_back(lang);
00013             });
00014         return single_threaded_vector(std::move(results)).GetView();
00015     }
00016
00017     Windows::Foundation::Collections::IVectorView<RecognizedTextRun> LinguisticServices::RecognizeTextScripts(hstring const& text)
00018     {
00019         std::vector<RecognizedTextRun> results;
00020         ELS::RecognizeTextScripts(text.c_str(), text.size(), [&](auto first, auto last, auto script)
00021             {
00022                 results.emplace_back(RecognizedTextRun{ first, last, script });
00023             });
00024         return single_threaded_vector(std::move(results)).GetView();
00025     }
00026
00027     hstring LinguisticServices::TransliterateFromCyrillicToLatin(hstring const& text)
00028     {
00029         hstring result;
00030         ELS::TransliterateFromCyrillicToLatin(text.c_str(), text.size(), [&](auto latin, auto length)
00031             {
00032                 result = hstring(latin, length);
00033             });
00034         return result;
00035     }
00036 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/Notifications/ScenarioPages/Toasts/Actions/Action/Text/ScenarioElement.xaml.cs Source File

  • Notifications
  • cs
  • Notifications
  • ScenarioPages
  • Toasts
  • Actions
  • Action
  • Text

ScenarioElement.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using Windows.UI.Notifications;
00003 using Windows.UI.Popups;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00008
00009 namespace Notifications.ScenarioPages.Toasts.Actions.Action.Text
00010 {
00011     /// <summary>
00012     /// An empty page that can be used on its own or navigated to within a Frame.
00013     /// </summary>
00014     public sealed partial class ScenarioElement : UserControl
00015     {
00016         public ScenarioElement()
00017         {
00018             this.InitializeComponent();
00019         }
00020
00021         private void UserControl_Loaded(object sender, RoutedEventArgs e)
00022         {
00023             Initialize();
00024         }
00025
00026         private void Initialize()
00027         {
00028             // Clear all existing notifications
00029             ToastNotificationManager.History.Clear();
00030
00031             // Pop notifications
00032             popToastControl.Payload =
00033                 $@"
00034                 <toast activationType='foreground' launch='args'>
00035                     <visual>
00036                         <binding template='ToastGeneric'>
00037                             <text>Action - text</text>
00038                             <text>Make sure left button on the toast has the text ""ok"" on it, and the right button has the text ""cancel"" on it.</text>
00039                         </binding>
00040                     </visual>
00041                     <actions>
00042
00043                         <action
00044                             content='ok'
00045                             activationType='foreground'
00046                             arguments='check'/>
00047
00048                         <action
00049                             content='cancel'
00050                             activationType='foreground'
00051                             arguments='cancel'/>
00052
00053                     </actions>
00054                 </toast>";
00055         }
00056
00057         private async void Error(string message)
00058         {
00059             await new MessageDialog(message, "ERROR").ShowAsync();
00060         }
00061     }
00062 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlStateTriggers/cs/CustomTriggers/ControlSizeTrigger.cs Source File

  • XamlStateTriggers
  • cs
  • CustomTriggers

ControlSizeTrigger.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.UI.Xaml;
00007
00008 namespace StateTriggersSample.CustomTriggers
00009 {
00010     public class ControlSizeTrigger : StateTriggerBase
00011     {
00012         //private variables
00013         private double _minHeight, _minWidth = -1;
00014         private FrameworkElement _targetElement;
00015         private double _currentHeight, _currentWidth;
00016         //public properties to set from XAML
00017         public double MinHeight
00018         {
00019             get
00020             {
00021                 return _minHeight;
00022             }
00023             set
00024             {
00025                 _minHeight = value;
00026             }
00027         }
00028         public double MinWidth
00029         {
00030             get
00031             {
00032                 return _minWidth;
00033             }
00034             set
00035             {
00036                 _minWidth = value;
00037             }
00038         }
00039         public FrameworkElement TargetElement
00040         {
00041             get
00042             {
00043                 return _targetElement;
00044             }
00045             set
00046             {
00047                 if (_targetElement != null)
00048                 {
00049                     _targetElement.SizeChanged -= _targetElement_SizeChanged;
00050                 }
00051                 _targetElement = value;
00052                 _targetElement.SizeChanged += _targetElement_SizeChanged;
00053             }
00054         }
00055         //Handle event to get current values
00056         private void _targetElement_SizeChanged(object sender, SizeChangedEventArgs e)
00057         {
00058             _currentHeight = e.NewSize.Height;
00059             _currentWidth = e.NewSize.Width;
00060             UpdateTrigger();
00061         }
00062         //Logic to evaluate and apply trigger value
00063         private void UpdateTrigger()
00064         {
00065             //if target is set and either minHeight or minWidth is set, proceed
00066             if (_targetElement != null && (_minWidth > 0 || _minHeight > 0))
00067             {
00068                 //if both minHeight and minWidth are set, then both conditions must be satisfied
00069                 if (_minHeight > 0 && _minWidth > 0)
00070                 {
00071                     SetActive((_currentHeight >= _minHeight) && (_currentWidth >= _minWidth));
00072                 }
00073                 //if only one of them is set, then only that condition needs to be satisfied
00074                 else if (_minHeight > 0)
00075                 {
00076                     SetActive(_currentHeight >= _minHeight);
00077                 }
00078                 else
00079                 {
00080                     SetActive(_currentWidth >= _minWidth);
00081                 }
00082             }
00083             else
00084             {
00085                 SetActive(false);
00086             }
00087         }
00088     }
00089 }
Generated on Fri Nov 15 2024 22:22:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LinguisticServices/cppwinrt/Scenario4_CharacterGrouping.cpp Source File

  • LinguisticServices
  • cppwinrt

Scenario4_CharacterGrouping.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario4_CharacterGrouping.h"
00014 #include "Scenario4_CharacterGrouping.g.cpp"
00015
00016 using namespace winrt;
00017 using namespace Windows::Foundation;
00018 using namespace Windows::Globalization;
00019 using namespace Windows::Globalization::Collation;
00020 using namespace Windows::UI::Xaml;
00021 using namespace Windows::UI::Xaml::Controls;
00022
00023 namespace winrt::SDKTemplate::implementation
00024 {
00025     Scenario4_CharacterGrouping::Scenario4_CharacterGrouping()
00026     {
00027         InitializeComponent();
00028     }
00029
00030
00031     void Scenario4_CharacterGrouping::AddGroup(hstring const& label, UIElement const& element)
00032     {
00033         Groups.try_emplace(label, element);
00034         GroupingsGrid().Items().Append(element);
00035     }
00036
00037     void Scenario4_CharacterGrouping::GetGroups_Click(IInspectable const&, RoutedEventArgs const&)
00038     {
00039         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00040
00041         hstring lang = LanguageText().Text();
00042         if (lang == L"Default")
00043         {
00044             ActiveGroupings = CharacterGroupings();
00045         }
00046         else if (Language::IsWellFormed(lang))
00047         {
00048             ActiveGroupings = CharacterGroupings(lang);
00049         }
00050         else
00051         {
00052             rootPage.NotifyUser(L"Invalid language tag.", NotifyType::ErrorMessage);
00053             return;
00054         }
00055
00056         GroupingsGrid().Items().Clear();
00057         Groups.clear();
00058         for (CharacterGrouping grouping : ActiveGroupings)
00059         {
00060             hstring label = grouping.Label();
00061             // Save the "other" group for the end.
00062             if (!label.empty())
00063             {
00064                 TextBlock textBlock;
00065                 textBlock.Text(label);
00066                 AddGroup(label, textBlock);
00067             }
00068         }
00069         SymbolIcon symbolIcon;
00070         symbolIcon.Symbol(Symbol::Globe);
00071         AddGroup(GlobeString, symbolIcon);
00072     }
00073
00074     void Scenario4_CharacterGrouping::AssignGroup_Click(IInspectable const&, RoutedEventArgs const&)
00075     {
00076         rootPage.NotifyUser(L"", NotifyType::StatusMessage);
00077
00078         if (ActiveGroupings == nullptr)
00079         {
00080             rootPage.NotifyUser(L"Select a language first.", NotifyType::ErrorMessage);
00081             return;
00082         }
00083         hstring text = CandidateText().Text();
00084         if (text.empty())
00085         {
00086             rootPage.NotifyUser(L"Enter text to assign to a group.", NotifyType::ErrorMessage);
00087             return;
00088         }
00089         hstring label = ActiveGroupings.Lookup(text);
00090         auto found = Groups.find(label);
00091         if (found == Groups.end())
00092         {
00093             label = GlobeString;
00094             found = Groups.find(label);
00095         }
00096         GroupingsGrid().SelectedItem(found->second);
00097         GroupingResult().Text(L"Group \"" + label + L"\"");
00098         found->second.StartBringIntoView();
00099     }
00100 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PosPrinter/cpp/Scenario2_PrintReceipt.xaml.h Source File

  • PosPrinter
  • cpp

Scenario2_PrintReceipt.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_PrintReceipt.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario2_PrintReceipt sealed
00024     {
00025     public:
00026         Scenario2_PrintReceipt();
00027
00028     protected:
00029         void PrintLine_Click();
00030         void PrintReceipt_Click();
00031         void PrintBitmap_Click();
00032         void PrintBarcode_Click();
00033
00034     private:
00035         MainPage^ rootPage = MainPage::Current;
00036
00037         bool IsPrinterClaimed();
00038         Concurrency::task<bool> ExecuteJobAndReportResultAsync(Windows::Devices::PointOfService::ReceiptPrintJob^ job);
00039
00040         Platform::String^ GetMerchantFooter();
00041         Platform::String^ GetCustomerFooter();
00042         void PrintLineFeedAndCutPaper(Windows::Devices::PointOfService::ReceiptPrintJob^ job, Platform::String^ receipt);
00043         Concurrency::task<Windows::Graphics::Imaging::BitmapFrame^> LoadLogoBitmapAsync();
00044     };
00045 }
Generated on Fri Nov 15 2024 22:20:57 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario13_ShareTarget Member List

This is the complete list of members for Scenario13_ShareTarget, including all inherited members.
AddContentValue(string title, string description=null) | Scenario13_ShareTarget | [inline, private]
AddQuickLink_Checked(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
AddQuickLink_Unchecked(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
dataFormatName | Scenario13_ShareTarget | [private]
DismissUI_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ExpandLongRunningShareSection_Checked(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ExpandLongRunningShareSection_Unchecked(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
LongRunningShareLabel_Tapped(object sender, TappedRoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
m_sharedApplicationLink | Scenario13_ShareTarget | [private]
m_sharedBitmapStreamRef | Scenario13_ShareTarget | [private]
m_sharedCustomData | Scenario13_ShareTarget | [private]
m_sharedDataContentSourceApplicationLink | Scenario13_ShareTarget | [private]
m_sharedDataContentSourceWebLink | Scenario13_ShareTarget | [private]
m_sharedDataDescription | Scenario13_ShareTarget | [private]
m_sharedDataLogoBackgroundColor | Scenario13_ShareTarget | [private]
m_sharedDataPackageFamilyName | Scenario13_ShareTarget | [private]
m_sharedDataSquare30x30Logo | Scenario13_ShareTarget | [private]
m_sharedDataTitle | Scenario13_ShareTarget | [private]
m_sharedHtmlFormat | Scenario13_ShareTarget | [private]
m_sharedResourceMap | Scenario13_ShareTarget | [private]
m_sharedStorageItems | Scenario13_ShareTarget | [private]
m_sharedText | Scenario13_ShareTarget | [private]
m_sharedThumbnailStreamRef | Scenario13_ShareTarget | [private]
m_sharedWebLink | Scenario13_ShareTarget | [private]
m_shareOperation | Scenario13_ShareTarget | [private]
NotifyUserBackgroundThread(string message, NotifyType type) | Scenario13_ShareTarget | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario13_ShareTarget | [inline, protected]
QuickLinkSectionLabel_Tapped(object sender, TappedRoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ReportCompleted_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ReportDataRetrieved_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ReportErrorButton_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ReportStarted_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
ReportSubmittedBackgroundTask_Click(object sender, RoutedEventArgs e) | Scenario13_ShareTarget | [inline, private]
rootPage | Scenario13_ShareTarget | [private]
Scenario13_ShareTarget() | Scenario13_ShareTarget | [inline]
shareQuickLinkId | Scenario13_ShareTarget | [private]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cppwinrt/Scenario2.h Source File

  • WindowsAudioSession
  • cppwinrt

Scenario2.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 #pragma once
00012 #include "Scenario2.g.h"
00013 #include "WASAPIRenderer.h"
00014
00015 namespace winrt::SDKTemplate::implementation
00016 {
00017     struct Scenario2 : Scenario2T<Scenario2>, MediaFoundationInitializer
00018     {
00019         Scenario2();
00020
00021         // Navigation handlers
00022         fire_and_forget OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00023         void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
00024
00025         // UI Events
00026         void btnPlay_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00027         void btnPause_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00028         void btnPlayPause_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00029         void btnStop_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00030         void btnFilePicker_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00031         void radioTone_Checked(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00032         void radioFile_Checked(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
00033         void sliderFrequency_ValueChanged(IInspectable const& sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const& e);
00034         void sliderVolume_ValueChanged(IInspectable const& sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const& e);
00035
00036         // UI Helpers
00037         void UpdateContentProps(hstring const& text);
00038         void DisableContentUI();
00039         void UpdateContentUI();
00040         void UpdateMediaControlUI(DeviceState deviceState);
00041
00042         // Handlers
00043         fire_and_forget OnDeviceStateChange(IDeviceStateSource const& sender, SDKTemplate::DeviceStateChangedEventArgs e);
00044         fire_and_forget OnPickFileAsync();
00045         void OnSetVolume(double volume);
00046
00047         void InitializeDevice();
00048         void StartDevice();
00049         void StopDevice();
00050         void PauseDevice();
00051         void PlayPauseToggleDevice();
00052
00053         fire_and_forget MediaButtonPressed(Windows::Media::SystemMediaTransportControls const& sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs e);
00054
00055     private:
00056         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00057         Windows::Media::SystemMediaTransportControls m_systemMediaControls{ nullptr };
00058         event_token m_deviceStateChangeToken;
00059         event_token m_systemMediaControlsButtonToken;
00060
00061         bool m_deviceSupportsRawMode = false;
00062
00063         Windows::Storage::Streams::IRandomAccessStream m_contentStream{ nullptr };
00064         ContentType m_contentType = ContentType::Tone;
00065         com_ptr<WASAPIRenderer> m_renderer;
00066     };
00067 }
00068
00069 namespace winrt::SDKTemplate::factory_implementation
00070 {
00071     struct Scenario2 : Scenario2T<Scenario2, implementation::Scenario2>
00072     {
00073     };
00074 }
Generated on Fri Nov 15 2024 22:19:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cppwinrt/pch.h Source File

  • TitleBar
  • cppwinrt

pch.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 #include <hstring.h>
00004 #include "winrt/Windows.Foundation.h"
00005 #include "winrt/Windows.Foundation.Collections.h"
00006 #include "winrt/Windows.ApplicationModel.Activation.h"
00007 #include "winrt/Windows.ApplicationModel.Core.h"
00008 #include "winrt/Windows.System.h"
00009 #include "winrt/Windows.UI.h"
00010 #include "winrt/Windows.UI.Core.h"
00011 #include "winrt/Windows.UI.ViewManagement.h"
00012 #include "winrt/Windows.UI.Xaml.h"
00013 #include "winrt/Windows.UI.Xaml.Automation.Peers.h"
00014 #include "winrt/Windows.UI.Xaml.Controls.h"
00015 #include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
00016 #include "winrt/Windows.UI.Xaml.Documents.h"
00017 #include "winrt/Windows.UI.Xaml.Interop.h"
00018 #include "winrt/Windows.UI.Xaml.Markup.h"
00019 #include "winrt/Windows.UI.Xaml.Media.h"
00020 #include "winrt/Windows.UI.Xaml.Navigation.h"
00021 #include "winrt/Windows.UI.Xaml.Shapes.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cppwinrt/SampleConfiguration.cpp Source File

  • FileSearch
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace Windows::Foundation::Collections;
00019 using namespace SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"File search C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Obtain all files that match a search query", xaml_typename<SDKTemplate::Scenario1>() },
00029 });
Generated on Fri Nov 15 2024 22:17:14 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ScenarioElement Member List

This is the complete list of members for ScenarioElement, including all inherited members.
Initialize() | ScenarioElement | [inline, private]
ScenarioElement() | ScenarioElement | [inline]
Generated on Fri Nov 15 2024 22:23:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ModelConstantBuffer Member List

This is the complete list of members for ModelConstantBuffer, including all inherited members.
model ModelConstantBuffer
Generated on Fri Nov 15 2024 22:23:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario2_ManageAccount Member List

This is the complete list of members for Scenario2_ManageAccount, including all inherited members.
isLaunched | Scenario2_ManageAccount | [private]
Manage_Click(object sender, RoutedEventArgs e) | Scenario2_ManageAccount | [inline, private]
OnNavigatedTo(NavigationEventArgs e) | Scenario2_ManageAccount | [inline, protected]
rootPage | Scenario2_ManageAccount | [private]
Scenario2_ManageAccount() | Scenario2_ManageAccount | [inline]
Generated on Fri Nov 15 2024 22:23:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShareDelayRenderedFiles Member List

This is the complete list of members for ShareDelayRenderedFiles, including all inherited members.
GetShareContent(DataRequest request) | ShareDelayRenderedFiles | [inline, protected]
OnDeferredImageRequestedHandler(DataProviderRequest providerRequest, StorageFile imageFile) | ShareDelayRenderedFiles | [inline, private]
selectedImage | ShareDelayRenderedFiles | [private]
SelectImageButton_Click(object sender, RoutedEventArgs e) | ShareDelayRenderedFiles | [inline, private]
ShareDelayRenderedFiles() | ShareDelayRenderedFiles | [inline]
Generated on Fri Nov 15 2024 22:24:05 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSerialDeviceAccess/cs/SampleConfiguration.cs Source File

  • CustomSerialDeviceAccess
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using CustomSerialDeviceAccess;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "CustomSerialDeviceAccess";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Connect/Disconnect", ClassType=typeof(Scenario1_ConnectDisconnect)},
00026             new Scenario() { Title="Configure Device", ClassType=typeof(Scenario2_ConfigureDevice)},
00027             new Scenario() { Title="Read/Write", ClassType=typeof(Scenario3_ReadWrite)},
00028             new Scenario() { Title="Events", ClassType=typeof(Scenario4_Events)}
00029         };
00030     }
00031
00032     public class Scenario
00033     {
00034         public string Title { get; set; }
00035         public Type ClassType { get; set; }
00036     }
00037 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cpp/scenario2.xaml.h Source File

  • ApplicationResources
  • cpp

scenario2.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario2.xaml.h
00013 // Declaration of the Scenario2 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2.g.h"
00020 #include "MainPage.xaml.h"
00021
00022 namespace SDKTemplate
00023 {
00024
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario2 sealed
00030         {
00031         public:
00032             Scenario2();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         private:
00037             MainPage^ rootPage;
00038         };
00039
00040 }
Generated on Fri Nov 15 2024 22:18:00 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_AppCapture Member List

This is the complete list of members for Scenario3_AppCapture, including all inherited members.
AllowAppCaptureCheckBox_Toggled(object sender, RoutedEventArgs e) | Scenario3_AppCapture | [inline, private]
appCapture | Scenario3_AppCapture | [private]
AppCapture_CapturingChanged(AppCapture sender, object e) | Scenario3_AppCapture | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_AppCapture | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario3_AppCapture | [inline, protected]
rootPage | Scenario3_AppCapture | [private]
Scenario3_AppCapture() | Scenario3_AppCapture | [inline]
UpdateCaptureStatus() | Scenario3_AppCapture | [inline, private]
Generated on Fri Nov 15 2024 22:23:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cs/Scenario2_DisplayRegion.xaml.cs Source File

  • AppWindow
  • cs

Scenario2_DisplayRegion.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.ViewManagement;
00015 using Windows.UI.WindowManagement;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018 using Windows.UI.Xaml.Hosting;
00019 using Windows.UI.Xaml.Navigation;
00020
00021 namespace SDKTemplate
00022 {
00023     public sealed partial class Scenario2_DisplayRegion : Page
00024     {
00025         private AppWindow appWindow;
00026         private Frame appWindowFrame = new Frame();
00027
00028         public Scenario2_DisplayRegion()
00029         {
00030             InitializeComponent();
00031         }
00032
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             // Check to see if we have more than one DisplayRegion, if not we disable the button since the scenario will not work
00036             showWindowBtn.IsEnabled = NumberOfAvailableDisplayRegions() > 1;
00037         }
00038
00039         protected override async void OnNavigatedFrom(NavigationEventArgs e)
00040         {
00041             if (appWindow != null)
00042             {
00043                 await appWindow.CloseAsync();
00044             }
00045         }
00046
00047         private int NumberOfAvailableDisplayRegions()
00048         {
00049             // Get the list of all DisplayRegions defined for the WindowingEnvironment that our application is currently in
00050             IReadOnlyList<DisplayRegion> displayRegions = ApplicationView.GetForCurrentView().WindowingEnvironment.GetDisplayRegions();
00051
00052             int availableDisplayRegions = 0;
00053             // count all the DisplayRegions that are marked as available to the app for use.
00054             foreach (DisplayRegion displayregion in displayRegions)
00055             {
00056                 if (displayregion.IsVisible)
00057                 {
00058                     availableDisplayRegions++;
00059                 }
00060             }
00061             return availableDisplayRegions;
00062         }
00063
00064         private DisplayRegion GetOtherDisplayRegion(DisplayRegion currentAppDisplayRegion)
00065         {
00066             // Get the list of all DisplayRegions defined for the WindowingEnvironment that our application is currently in
00067             IReadOnlyList<DisplayRegion> displayRegions = ApplicationView.GetForCurrentView().WindowingEnvironment.GetDisplayRegions();
00068             foreach (DisplayRegion displayRegion in displayRegions)
00069             {
00070                 if (displayRegion != currentAppDisplayRegion && displayRegion.IsVisible)
00071                 {
00072                     return displayRegion;
00073                 }
00074             }
00075
00076             return null;
00077         }
00078
00079         private async void Button_Click(object sender, RoutedEventArgs e)
00080         {
00081             showWindowBtn.IsEnabled = false;
00082
00083             // Only ever create and show one window. If the AppWindow exists call TryShow on it to bring it to foreground.
00084             if (appWindow == null)
00085             {
00086                 // Create a new window
00087                 appWindow = await AppWindow.TryCreateAsync();
00088                 // Make sure we release the reference to this window, and release XAML resources, when it's closed
00089                 appWindow.Closed += delegate { appWindow = null; appWindowFrame.Content = null; };
00090                 // Navigate the frame to the page we want to show in the new window
00091                 appWindowFrame.Navigate(typeof(SecondaryAppWindowPage));
00092                 // Attach the XAML content to our window
00093                 ElementCompositionPreview.SetAppWindowContent(appWindow, appWindowFrame);
00094             }
00095
00096             // Get DisplayRegion to position our window on
00097             DisplayRegion secondaryDisplayRegion = GetOtherDisplayRegion(ApplicationView.GetForCurrentView().GetDisplayRegions()[0]);
00098             if (secondaryDisplayRegion != null)
00099             {
00100                 appWindow.RequestMoveToDisplayRegion(secondaryDisplayRegion);
00101             }
00102
00103             // If the window is not visible, show it and/or bring it to foreground
00104             if (!appWindow.IsVisible)
00105             {
00106                 await appWindow.TryShowAsync();
00107             }
00108
00109             showWindowBtn.IsEnabled = true;
00110         }
00111     }
00112 }
Generated on Fri Nov 15 2024 22:18:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SymbologyListEntry Member List

This is the complete list of members for SymbologyListEntry, including all inherited members.
Id() | SymbologyListEntry | [inline]
IsEnabled() | SymbologyListEntry | [inline]
IsEnabled(bool enabled) | SymbologyListEntry | [inline]
m_enabled | SymbologyListEntry | [private]
m_id | SymbologyListEntry | [private]
Name() | SymbologyListEntry | [inline]
SymbologyListEntry(uint32_t symbologyId, bool symbologyEnabled=true) | SymbologyListEntry | [inline]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DeviceEnumerationAndPairing/cpp/Scenario1_DevicePicker.xaml.h Source File

  • DeviceEnumerationAndPairing
  • cpp

Scenario1_DevicePicker.xaml.h

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #pragma once
00004
00005 #include "Scenario1_DevicePicker.g.h"
00006 #include "MainPage.xaml.h"
00007 #include "DisplayHelpers.h"
00008
00009 namespace SDKTemplate
00010 {
00011     [Windows::Foundation::Metadata::WebHostHidden]
00012     public ref class Scenario1_DevicePicker sealed
00013     {
00014     public:
00015         Scenario1_DevicePicker();
00016
00017     protected:
00018         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00019
00020     private:
00021         void PickSingleDeviceButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00022         void ShowDevicePickerButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00023
00024         void ShowDevicePicker(bool pickSingle);
00025
00026         MainPage^ rootPage = MainPage::Current;
00027         Windows::Foundation::Collections::IObservableVector<DeviceInformationDisplay^>^ resultCollection = ref new Platform::Collections::Vector<DeviceInformationDisplay^>();
00028     };
00029 }
Generated on Fri Nov 15 2024 22:19:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraFrames/cpp/FrameSourceViewModels.cpp Source File

  • CameraFrames
  • cpp

FrameSourceViewModels.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the Microsoft Public License.
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "FrameSourceViewModels.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace concurrency;
00018 using namespace Platform;
00019 using namespace Platform::Collections;
00020 using namespace Windows::Devices::Enumeration;
00021 using namespace Windows::Foundation;
00022 using namespace Windows::Foundation::Collections;
00023 using namespace Windows::Media::Capture;
00024 using namespace Windows::Media::Capture::Frames;
00025
00026 FrameSourceGroupModel::FrameSourceGroupModel(MediaFrameSourceGroup^ sourceGroup)
00027 {
00028     SourceGroup = sourceGroup;
00029     Id = sourceGroup->Id;
00030     DisplayName = sourceGroup->DisplayName;
00031
00032     // Populate SourceInfos based on this groups properties.
00033     Vector<FrameSourceInfoModel^>^ vector = ref new Vector<FrameSourceInfoModel^>();
00034     for each (auto const& el in sourceGroup->SourceInfos)
00035     {
00036         vector->Append(ref new FrameSourceInfoModel(el));
00037     }
00038     SourceInfos = vector->GetView();
00039 }
00040
00041 FrameSourceInfoModel::FrameSourceInfoModel(MediaFrameSourceInfo^ sourceInfo)
00042 {
00043     SourceInfo = sourceInfo;
00044     SourceGroup = sourceInfo->SourceGroup;
00045     Id = sourceInfo->Id;
00046     DisplayName = SourceInfo->SourceKind.ToString() + " " + SourceInfo->MediaStreamType.ToString();
00047 }
00048
00049 FrameFormatModel::FrameFormatModel(MediaFrameFormat^ format)
00050 {
00051     Format = format;
00052
00053     String^ width = Format->VideoFormat ? Format->VideoFormat->Width.ToString() : "?";
00054     String^ height = Format->VideoFormat ? Format->VideoFormat->Height.ToString() : "?";
00055
00056     String^ framerate = Format->FrameRate ? round(Format->FrameRate->Numerator / Format->FrameRate->Denominator).ToString() : "?";
00057
00058     DisplayName = Format->MajorType + " | " + Format->Subtype + " | " + width + " x " + height + " | " + framerate + "fps";
00059 }
00060
00061 SourceGroupCollection::SourceGroupCollection(Windows::UI::Core::CoreDispatcher ^ uiDispatcher)
00062 {
00063     m_dispatcher = uiDispatcher;
00064     m_sourceCollection = ref new Vector<FrameSourceGroupModel^>();
00065
00066     m_watcher = DeviceInformation::CreateWatcher(MediaFrameSourceGroup::GetDeviceSelector());
00067
00068     // On source group added, add new source group to source groups collection.
00069     m_watcherDeviceAddedToken = m_watcher->Added += ref new TypedEventHandler<DeviceWatcher^, DeviceInformation^>(
00070         [this](DeviceWatcher^ sender, DeviceInformation^ args)
00071     {
00072         AddDeviceAsync(args->Id);
00073     });
00074
00075     // On source group removed, remove source group from source groups collection.
00076     m_watcherDeviceRemovedToken = m_watcher->Removed += ref new TypedEventHandler<DeviceWatcher^, DeviceInformationUpdate^>(
00077         [this](DeviceWatcher^ sender, DeviceInformationUpdate^ args)
00078     {
00079         RemoveDeviceAsync(args->Id);
00080     });
00081
00082     // On source group updated, re-add source group to source groups collection.
00083     m_watcherDeviceUpdatedToken = m_watcher->Updated += ref new TypedEventHandler<DeviceWatcher^, DeviceInformationUpdate^>(
00084         [this](DeviceWatcher^ sender, DeviceInformationUpdate^ args)
00085     {
00086         String^ id = args->Id;
00087         RemoveDeviceAsync(id).then([this, id]()
00088         {
00089             return AddDeviceAsync(id);
00090         });
00091     });
00092
00093     m_watcher->Start();
00094 }
00095
00096 SourceGroupCollection::~SourceGroupCollection()
00097 {
00098     m_watcher->Added -= m_watcherDeviceAddedToken;
00099     m_watcher->Removed -= m_watcherDeviceRemovedToken;
00100     m_watcher->Updated -= m_watcherDeviceUpdatedToken;
00101
00102     m_watcher->Stop();
00103 }
00104
00105 concurrency::task<void> SourceGroupCollection::AddDeviceAsync(Platform::String ^ id)
00106 {
00107     // If source group is present in collection already, there is no need to add it.
00108     for (UINT32 i = 0; i < m_sourceCollection->Size; i++)
00109     {
00110         if (m_sourceCollection->GetAt(i)->Id == id)
00111         {
00112             return task_from_result();
00113         }
00114     }
00115
00116     // Look up source group and add it to the collection.
00117     return create_task(MediaFrameSourceGroup::FromIdAsync(id)).then([this](MediaFrameSourceGroup^ group)
00118     {
00119         return create_task(m_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High,
00120             ref new Windows::UI::Core::DispatchedHandler([this, group]()
00121         {
00122             if (group != nullptr)
00123             {
00124                 m_sourceCollection->Append(ref new FrameSourceGroupModel(group));
00125             }
00126         })));
00127     });
00128 }
00129
00130 concurrency::task<void> SourceGroupCollection::RemoveDeviceAsync(Platform::String^ id)
00131 {
00132     return create_task(m_dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High,
00133         ref new Windows::UI::Core::DispatchedHandler([this, id]()
00134     {
00135         // Remove source group from the collection.
00136         for (UINT32 i = 0; i < m_sourceCollection->Size; i++)
00137         {
00138             if (m_sourceCollection->GetAt(i)->Id == id)
00139             {
00140                 m_sourceCollection->RemoveAt(i);
00141             }
00142         }
00143     })));
00144 }
Generated on Fri Nov 15 2024 22:18:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserInfo/cppwinrt/Scenario1_FindUsers.h Source File

  • UserInfo
  • cppwinrt

Scenario1_FindUsers.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario1_FindUsers.g.h"
00015
00016 namespace winrt::SDKTemplate::implementation
00017 {
00018     struct Scenario1_FindUsers : Scenario1_FindUsersT<Scenario1_FindUsers>
00019     {
00020         Scenario1_FindUsers();
00021
00022         fire_and_forget OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const&);
00023         fire_and_forget ShowProperties();
00024
00025     private:
00026         SDKTemplate::MainPage rootPage{ MainPage::Current() };
00027     };
00028 }
00029
00030 namespace winrt::SDKTemplate::factory_implementation
00031 {
00032     struct Scenario1_FindUsers : Scenario1_FindUsersT<Scenario1_FindUsers, implementation::Scenario1_FindUsers>
00033     {
00034     };
00035 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ResizeAppView/cs/Scenario1_Basic.xaml.cs Source File

  • ResizeAppView
  • cs

Scenario1_Basic.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using Windows.Foundation;
00014 using Windows.Storage.Streams;
00015 using Windows.UI.Core;
00016 using Windows.UI.ViewManagement;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019 using Windows.UI.Xaml.Input;
00020 using Windows.UI.Xaml.Navigation;
00021
00022 namespace SDKTemplate
00023 {
00024     public sealed partial class Scenario1_Basic : Page
00025     {
00026         private MainPage rootPage;
00027
00028         public Scenario1_Basic()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         protected override void OnNavigatedTo(NavigationEventArgs e)
00034         {
00035             rootPage = MainPage.Current;
00036
00037             Window.Current.SizeChanged += OnWindowSizeChanged;
00038             UpdateContent();
00039         }
00040
00041         protected override void OnNavigatedFrom(NavigationEventArgs e)
00042         {
00043             Window.Current.SizeChanged -= OnWindowSizeChanged;
00044         }
00045
00046
00047         IMemoryBufferReference mbrr = null;
00048         bool done = false;
00049         private void AttachRef()
00050         {
00051             var buffer = new Windows.Storage.Streams.Buffer(10);
00052             var memorybuffer = Windows.Storage.Streams.Buffer.CreateMemoryBufferOverIBuffer(buffer);
00053             memorybuffer.CreateReference().Closed += (s, _) => {
00054                 //mbrr = s;
00055                 var x = 42;
00056                 done = true;
00057             };
00058         }
00059         private void ResizeView_Click(object sender, RoutedEventArgs e)
00060         {
00061             var view = ApplicationView.GetForCurrentView();
00062             _ = Windows.System.Threading.ThreadPool.RunAsync((o) => {
00063                 AttachRef();
00064                 while (!done)
00065                 {
00066                     GC.Collect();
00067                 }
00068                 mbrr = null;
00069                 GC.Collect();
00070             });
00071         }
00072
00073         private void SetMinimumSize_Click(object sender, RoutedEventArgs e)
00074         {
00075             var view = ApplicationView.GetForCurrentView();
00076             if (SetMinimumSize.IsChecked.Value)
00077             {
00078                 // If this size is not permitted by the system, the nearest permitted value is used.
00079                 view.SetPreferredMinSize(new Size { Width = 300, Height = 200 });
00080             }
00081             else
00082             {
00083                 // Passing width = height = 0 returns to the default system behavior.
00084                 view.SetPreferredMinSize(new Size());
00085             }
00086         }
00087
00088         void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
00089         {
00090             UpdateContent();
00091         }
00092
00093         void UpdateContent()
00094         {
00095             Rect bounds = Window.Current.Bounds;
00096             ReportViewWidth.Text = bounds.Width.ToString();
00097             ReportViewHeight.Text = bounds.Height.ToString();
00098         }
00099     }
00100 }
Generated on Fri Nov 15 2024 22:19:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlTransform3DAnimations/cs/App.xaml.cs Source File

  • XamlTransform3DAnimations
  • cs

App.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.IO;
00004 using System.Linq;
00005 using System.Runtime.InteropServices.WindowsRuntime;
00006 using Windows.ApplicationModel;
00007 using Windows.ApplicationModel.Activation;
00008 using Windows.Foundation;
00009 using Windows.Foundation.Collections;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Controls.Primitives;
00013 using Windows.UI.Xaml.Data;
00014 using Windows.UI.Xaml.Input;
00015 using Windows.UI.Xaml.Media;
00016 using Windows.UI.Xaml.Navigation;
00017
00018 // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
00019
00020 namespace Transform3DAnimations
00021 {
00022     /// <summary>
00023     /// Provides application-specific behavior to supplement the default Application class.
00024     /// </summary>
00025     sealed partial class App : Application
00026     {
00027         /// <summary>
00028         /// Initializes the singleton application object.  This is the first line of authored code
00029         /// executed, and as such is the logical equivalent of main() or WinMain().
00030         /// </summary>
00031         public App()
00032         {
00033             this.InitializeComponent();
00034             this.Suspending += OnSuspending;
00035         }
00036
00037         /// <summary>
00038         /// Invoked when the application is launched normally by the end user.  Other entry points
00039         /// will be used such as when the application is launched to open a specific file.
00040         /// </summary>
00041         /// <param name="e">Details about the launch request and process.</param>
00042         protected override void OnLaunched(LaunchActivatedEventArgs e)
00043         {
00044             Frame rootFrame = Window.Current.Content as Frame;
00045
00046             // Do not repeat app initialization when the Window already has content,
00047             // just ensure that the window is active
00048             if (rootFrame == null)
00049             {
00050                 // Create a Frame to act as the navigation context and navigate to the first page
00051                 rootFrame = new Frame();
00052
00053                 rootFrame.NavigationFailed += OnNavigationFailed;
00054
00055                 // Add background to our Frame for navigation transitions
00056                 rootFrame.Background = (Brush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
00057
00058                 if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
00059                 {
00060                     //TODO: Load state from previously suspended application
00061                 }
00062
00063                 // Place the frame in the current Window
00064                 Window.Current.Content = rootFrame;
00065             }
00066
00067             if (rootFrame.Content == null)
00068             {
00069                 // When the navigation stack isn't restored navigate to the first page,
00070                 // configuring the new page by passing required information as a navigation
00071                 // parameter
00072                 rootFrame.Navigate(typeof(MainPage), e.Arguments);
00073             }
00074             // Ensure the current window is active
00075             Window.Current.Activate();
00076         }
00077
00078         /// <summary>
00079         /// Invoked when Navigation to a certain page fails
00080         /// </summary>
00081         /// <param name="sender">The Frame which failed navigation</param>
00082         /// <param name="e">Details about the navigation failure</param>
00083         void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
00084         {
00085             throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
00086         }
00087
00088         /// <summary>
00089         /// Invoked when application execution is being suspended.  Application state is saved
00090         /// without knowing whether the application will be terminated or resumed with the contents
00091         /// of memory still intact.
00092         /// </summary>
00093         /// <param name="sender">The source of the suspend request.</param>
00094         /// <param name="e">Details about the suspend request.</param>
00095         private void OnSuspending(object sender, SuspendingEventArgs e)
00096         {
00097             var deferral = e.SuspendingOperation.GetDeferral();
00098             //TODO: Save application state and stop any background activity
00099             deferral.Complete();
00100         }
00101     }
00102 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/SampleConfiguration.cs Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "Proxy and stub generation for Windows Runtime components";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Using Custom Components", ClassType=typeof(ProxyStubsForWinRTComponents.OvenClient)},
00025             new Scenario() { Title="Handling Windows Runtime Exceptions", ClassType=typeof(ProxyStubsForWinRTComponents.CustomException)},
00026         };
00027     }
00028
00029     public class Scenario
00030     {
00031         public string Title { get; set; }
00032         public Type ClassType { get; set; }
00033     }
00034 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WebAccountManagement/cpp/pch.cpp Source File

  • WebAccountManagement
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProximitySensor/cpp/SampleConfiguration.cpp Source File

  • ProximitySensor
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Data Events", "SDKTemplate.Scenario1_DataEvents" },
00021     { "Polling", "SDKTemplate.Scenario2_Polling" },
00022     { "Display On/Off", "SDKTemplate.Scenario3_DisplayOnOff" },
00023     { "Background Proximity Sensor", "SDKTemplate.Scenario4_BackgroundProximitySensor" }
00024 };
Generated on Fri Nov 15 2024 22:17:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: LiveDash/cs/LiveDash/Models/MediaStream.cs Source File

  • LiveDash
  • cs
  • LiveDash
  • Models

MediaStream.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Windows.Storage.Streams;
00007
00008 namespace LiveDash.Models
00009 {
00010     /// <summary>
00011     /// Represents a stream of data, such as audio or video
00012     /// </summary>
00013     public class MediaStream
00014     {
00015         private string language;
00016         private string mimeType;
00017         private string initSegmentUrl;
00018
00019         private SegmentInformationType m_segmentInfoType;
00020         private SegmentTemplateIdentifier m_segmentTemplateIdentifier;
00021
00022         private List<MediaSegment> m_segments;
00023
00024         private MediaSegmentInformation m_segmentInformation;
00025         private bool m_canGenerateSegmentsDynamically;
00026
00027         //  Dynamic information for streaming
00028         private IBuffer m_initSegmentData = null;
00029         private bool m_isInitSegmentDownloading = false;
00030
00031         internal enum SegmentInformationType
00032         {
00033             Base,
00034             Template,
00035             List
00036         };
00037
00038         internal enum SegmentTemplateIdentifier
00039         {
00040             Number,
00041             Time,
00042             Other
00043         };
00044
00045         internal MediaStream()
00046         {
00047             m_segments = new List<MediaSegment>();
00048         }
00049
00050         #region properties
00051         internal string Language
00052         {
00053             get { return language; }
00054
00055             set { language = value; }
00056         }
00057
00058         internal string MimeType
00059         {
00060             get { return mimeType; }
00061
00062             set { mimeType = value.Replace(" ", string.Empty); }
00063         }
00064
00065         internal string InitSegmentUrl
00066         {
00067             get{ return initSegmentUrl; }
00068
00069             set { initSegmentUrl = value; }
00070         }
00071
00072         internal List<MediaSegment> Segments
00073         {
00074             get { return m_segments; }
00075         }
00076
00077         internal IBuffer InitSegmentData
00078         {
00079             get { return m_initSegmentData; }
00080             set { m_initSegmentData = value; }
00081         }
00082
00083         internal bool isInitSegmentDownloading
00084         {
00085             get { return m_isInitSegmentDownloading; }
00086             set { m_isInitSegmentDownloading = value; }
00087         }
00088
00089         internal SegmentInformationType SegmentInfoType
00090          {
00091             get { return m_segmentInfoType; }
00092             set { m_segmentInfoType = value; }
00093         }
00094
00095         internal SegmentTemplateIdentifier SegmentTemplateBase
00096         {
00097             get { return m_segmentTemplateIdentifier; }
00098             set { m_segmentTemplateIdentifier = value; }
00099         }
00100
00101         internal MediaSegmentInformation SegmentInformation
00102         {
00103             get { return m_segmentInformation; }
00104             set { m_segmentInformation = value; }
00105         }
00106
00107         internal bool CanGenerateSegmentsDynamically
00108         {
00109             get { return m_canGenerateSegmentsDynamically; }
00110             set { m_canGenerateSegmentsDynamically = value; }
00111         }
00112
00113         #endregion
00114
00115         internal void PushBackSegment(MediaSegment segment)
00116         {
00117             m_segments.Add(segment);
00118         }
00119
00120         internal void PushFrontSegment(MediaSegment segment)
00121         {
00122             m_segments.Insert(0, segment);
00123         }
00124
00125         internal int GetStartingSegmentIndexForLive(ulong hnsDesiredLiveOffset)
00126         {
00127             if (!m_canGenerateSegmentsDynamically)
00128             {
00129                 int segmentCount = m_segments.Count();
00130
00131                 if (segmentCount > 0)
00132                 {
00133                     ulong hnsLiveOffset = 0;
00134                     for (int x = segmentCount - 1; x >= 0; x--)
00135                     {
00136                         hnsLiveOffset += m_segments.ElementAt(x).Duration * 10000000 / SegmentInformation.Timescale;
00137                         if (hnsLiveOffset >= hnsDesiredLiveOffset)
00138                         {
00139                             return x;
00140                         }
00141                     }
00142                 }
00143                 return 0;
00144             }
00145             else
00146             {
00147                 int x = 0;
00148                 ulong hnsLiveOffset = 0;
00149                 while (hnsLiveOffset < hnsDesiredLiveOffset)
00150                 {
00151                     hnsLiveOffset += m_segmentInformation.Duration * 10000000 / SegmentInformation.Timescale;
00152                     x--;
00153                 }
00154                 return x;
00155             }
00156
00157         }
00158     }
00159 }
Generated on Fri Nov 15 2024 22:20:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cpp/DynamicCommandBar.h Source File

  • XamlCommanding
  • cpp

DynamicCommandBar.h

Go to the documentation of this file.
00001 ﻿//
00002 // DynamicCommandBar.h
00003 // Declaration of the DynamicCommandBar class.
00004 //
00005
00006 #pragma once
00007
00008 #include <list>
00009 #include <queue>
00010 #include <stack>
00011 #include <tuple>
00012
00013 using namespace Windows::Foundation;
00014 using namespace Windows::UI::Xaml;
00015 using namespace Windows::UI::Xaml::Controls;
00016
00017 namespace SDKTemplate
00018 {
00019     public ref class DynamicCommandBar sealed : public CommandBar
00020     {
00021     protected:
00022         virtual void OnApplyTemplate() override;
00023         virtual Size MeasureOverride(Size desiredSize) override;
00024
00025     public:
00026         static property DependencyProperty^ ContentMinWidthProperty
00027         {
00028             DependencyProperty^ get()
00029             {
00030                 return _contentMinWidthProperty;
00031             }
00032         }
00033
00034         property double ContentMinWidth
00035         {
00036             double get()
00037             {
00038                 return (double)GetValue(ContentMinWidthProperty);
00039             }
00040
00041             void set(double value)
00042             {
00043                 SetValue(ContentMinWidthProperty, (Object^)value);
00044             }
00045         }
00046
00047     private:
00048         static DependencyProperty^ _contentMinWidthProperty;
00049         Button^ _moreButton;
00050
00051         // Store the item and the width before moving
00052         std::stack<std::tuple<ICommandBarElement^, double>> overflow = { };
00053         std::queue<std::tuple<ICommandBarElement^, double>> separatorQueue = { };
00054         double separatorQueueWidth = 0.0;
00055     };
00056 }
Generated on Fri Nov 15 2024 22:22:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicMixedRealityCapture/cpp/Common/StepTimer.h Source File

  • HolographicMixedRealityCapture
  • cpp
  • Common

StepTimer.h

Go to the documentation of this file.
00001 ﻿#pragma once
00002
00003 namespace DX
00004 {
00005     // Helper class for animation and simulation timing.
00006     class StepTimer
00007     {
00008     public:
00009         StepTimer() :
00010             m_elapsedTicks(0),
00011             m_totalTicks(0),
00012             m_leftOverTicks(0),
00013             m_frameCount(0),
00014             m_framesPerSecond(0),
00015             m_framesThisSecond(0),
00016             m_qpcSecondCounter(0),
00017             m_isFixedTimeStep(false),
00018             m_targetElapsedTicks(TicksPerSecond / 60)
00019         {
00020             m_qpcFrequency = GetPerformanceFrequency();
00021
00022             // Initialize max delta to 1/10 of a second.
00023             m_qpcMaxDelta = m_qpcFrequency / 10;
00024         }
00025
00026         // Get elapsed time since the previous Update call.
00027         uint64 GetElapsedTicks() const                        { return m_elapsedTicks;                  }
00028         double GetElapsedSeconds() const                      { return TicksToSeconds(m_elapsedTicks);  }
00029
00030         // Get total time since the start of the program.
00031         uint64 GetTotalTicks() const                          { return m_totalTicks;                    }
00032         double GetTotalSeconds() const                        { return TicksToSeconds(m_totalTicks);    }
00033
00034         // Get total number of updates since start of the program.
00035         uint32 GetFrameCount() const                          { return m_frameCount;                    }
00036
00037         // Get the current framerate.
00038         uint32 GetFramesPerSecond() const                     { return m_framesPerSecond;               }
00039
00040         // Set whether to use fixed or variable timestep mode.
00041         void SetFixedTimeStep(bool isFixedTimestep)           { m_isFixedTimeStep = isFixedTimestep;    }
00042
00043         // Set how often to call Update when in fixed timestep mode.
00044         void SetTargetElapsedTicks(uint64 targetElapsed)      { m_targetElapsedTicks = targetElapsed;   }
00045         void SetTargetElapsedSeconds(double targetElapsed)    { m_targetElapsedTicks = SecondsToTicks(targetElapsed);   }
00046
00047         // Integer format represents time using 10,000,000 ticks per second.
00048         static const uint64 TicksPerSecond = 10'000'000;
00049
00050         static double TicksToSeconds(uint64 ticks)            { return static_cast<double>(ticks) / TicksPerSecond;     }
00051         static uint64 SecondsToTicks(double seconds)          { return static_cast<uint64>(seconds * TicksPerSecond);   }
00052
00053         // Convenient wrapper for QueryPerformanceFrequency. Throws an exception if
00054         // the call to QueryPerformanceFrequency fails.
00055         static inline uint64 GetPerformanceFrequency()
00056         {
00057             LARGE_INTEGER freq;
00058             if (!QueryPerformanceFrequency(&freq))
00059             {
00060                 throw ref new Platform::FailureException();
00061             }
00062             return freq.QuadPart;
00063         }
00064
00065         // Gets the current number of ticks from QueryPerformanceCounter. Throws an
00066         // exception if the call to QueryPerformanceCounter fails.
00067         static inline int64 GetTicks()
00068         {
00069             LARGE_INTEGER ticks;
00070             if (!QueryPerformanceCounter(&ticks))
00071             {
00072                 throw ref new Platform::FailureException();
00073             }
00074             return ticks.QuadPart;
00075         }
00076
00077         // After an intentional timing discontinuity (for instance a blocking IO operation)
00078         // call this to avoid having the fixed timestep logic attempt a set of catch-up
00079         // Update calls.
00080
00081         void ResetElapsedTime()
00082         {
00083             m_qpcLastTime = GetTicks();
00084
00085             m_leftOverTicks    = 0;
00086             m_framesPerSecond  = 0;
00087             m_framesThisSecond = 0;
00088             m_qpcSecondCounter = 0;
00089         }
00090
00091         // Update timer state, calling the specified Update function the appropriate number of times.
00092         template<typename TUpdate>
00093         void Tick(const TUpdate& update)
00094         {
00095             // Query the current time.
00096             uint64 currentTime = GetTicks();
00097             uint64 timeDelta   = currentTime - m_qpcLastTime;
00098
00099             m_qpcLastTime      = currentTime;
00100             m_qpcSecondCounter += timeDelta;
00101
00102             // Clamp excessively large time deltas (e.g. after paused in the debugger).
00103             if (timeDelta > m_qpcMaxDelta)
00104             {
00105                 timeDelta = m_qpcMaxDelta;
00106             }
00107
00108             // Convert QPC units into a canonical tick format. This cannot overflow due to the previous clamp.
00109             timeDelta *= TicksPerSecond;
00110             timeDelta /= m_qpcFrequency;
00111
00112             uint32 lastFrameCount = m_frameCount;
00113
00114             if (m_isFixedTimeStep)
00115             {
00116                 // Fixed timestep update logic
00117
00118                 // If the app is running very close to the target elapsed time (within 1/4 of a millisecond) just clamp
00119                 // the clock to exactly match the target value. This prevents tiny and irrelevant errors
00120                 // from accumulating over time. Without this clamping, a game that requested a 60 fps
00121                 // fixed update, running with vsync enabled on a 59.94 NTSC display, would eventually
00122                 // accumulate enough tiny errors that it would drop a frame. It is better to just round
00123                 // small deviations down to zero to leave things running smoothly.
00124
00125                 if (abs(static_cast<int64>(timeDelta - m_targetElapsedTicks)) < TicksPerSecond / 4000)
00126                 {
00127                     timeDelta = m_targetElapsedTicks;
00128                 }
00129
00130                 m_leftOverTicks += timeDelta;
00131
00132                 while (m_leftOverTicks >= m_targetElapsedTicks)
00133                 {
00134                     m_elapsedTicks   = m_targetElapsedTicks;
00135                     m_totalTicks    += m_targetElapsedTicks;
00136                     m_leftOverTicks -= m_targetElapsedTicks;
00137                     m_frameCount++;
00138
00139                     update();
00140                 }
00141             }
00142             else
00143             {
00144                 // Variable timestep update logic.
00145                 m_elapsedTicks  = timeDelta;
00146                 m_totalTicks   += timeDelta;
00147                 m_leftOverTicks = 0;
00148                 m_frameCount++;
00149
00150                 update();
00151             }
00152
00153             // Track the current framerate.
00154             if (m_frameCount != lastFrameCount)
00155             {
00156                 m_framesThisSecond++;
00157             }
00158
00159             if (m_qpcSecondCounter >= static_cast<uint64>(m_qpcFrequency))
00160             {
00161                 m_framesPerSecond   = m_framesThisSecond;
00162                 m_framesThisSecond  = 0;
00163                 m_qpcSecondCounter %= m_qpcFrequency;
00164             }
00165         }
00166
00167     private:
00168
00169         // Source timing data uses QPC units.
00170         uint64 m_qpcFrequency;
00171         uint64 m_qpcLastTime;
00172         uint64 m_qpcMaxDelta;
00173
00174         // Derived timing data uses a canonical tick format.
00175         uint64 m_elapsedTicks;
00176         uint64 m_totalTicks;
00177         uint64 m_leftOverTicks;
00178
00179         // Members for tracking the framerate.
00180         uint32 m_frameCount;
00181         uint32 m_framesPerSecond;
00182         uint32 m_framesThisSecond;
00183         uint64 m_qpcSecondCounter;
00184
00185         // Members for configuring fixed timestep mode.
00186         bool   m_isFixedTimeStep;
00187         uint64 m_targetElapsedTicks;
00188     };
00189 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: HolographicSpatialStage/cpp/Content/ShaderStructures.h Source File

  • HolographicSpatialStage
  • cpp
  • Content

ShaderStructures.h

Go to the documentation of this file.
00001 #pragma once
00002
00003 namespace HolographicSpatialStage
00004 {
00005     // Constant buffer used to send hologram position transform to the shader pipeline.
00006     struct ModelConstantBuffer
00007     {
00008         DirectX::XMFLOAT4X4 model;
00009     };
00010
00011     // Assert that the constant buffer remains 16-byte aligned (best practice).
00012     static_assert((sizeof(ModelConstantBuffer) % (sizeof(float) * 4)) == 0, "Model constant buffer size must be 16-byte aligned (16 bytes is the length of four floats).");
00013
00014
00015     // Used to send per-vertex data to the vertex shader.
00016     struct VertexPositionColor
00017     {
00018         DirectX::XMFLOAT3 pos;
00019         DirectX::XMFLOAT3 color;
00020     };
00021 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCorrelation/cpp/Scenario1_CorrelateStreams.xaml.cpp Source File

  • CameraStreamCorrelation
  • cpp

Scenario1_CorrelateStreams.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <windowsnumerics.h>
00014 #include "Scenario1_CorrelateStreams.xaml.h"
00015 #include "FrameRenderer.h"
00016
00017 using namespace SDKTemplate;
00018
00019 using namespace concurrency;
00020 using namespace Platform;
00021 using namespace Platform::Collections;
00022 using namespace Windows::Media::Devices::Core;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::Foundation::Numerics;
00026 using namespace Windows::Graphics::Imaging;
00027 using namespace Windows::Media::Capture;
00028 using namespace Windows::Media::Capture::Frames;
00029 using namespace Windows::Perception::Spatial;
00030 using namespace Windows::UI::Xaml::Media::Imaging;
00031
00032 using namespace WindowsPreview::Media::Capture::Frames;
00033
00034 // Used to determine whether a source has a Perception major type.
00035 static String^ PerceptionMediaType = L"Perception";
00036
00037 // Returns the values from a std::map as a std::vector.
00038 template<typename K, typename T>
00039 static inline std::vector<T> values(std::map<K, T> const& inputMap)
00040 {
00041     std::vector<T> outputVector(inputMap.size());
00042     std::transform(inputMap.begin(), inputMap.end(), outputVector.begin(), [](auto const& pair)
00043     {
00044         return pair.second;
00045     });
00046     return outputVector;
00047 }
00048
00049 Scenario1_CorrelateStreams::Scenario1_CorrelateStreams() : rootPage(MainPage::Current)
00050 {
00051     InitializeComponent();
00052
00053     m_logger = ref new SimpleLogger(outputTextBlock);
00054
00055     m_correlatedFrameRenderer = std::make_unique<FrameRenderer>(previewImage);
00056 }
00057
00058 void Scenario1_CorrelateStreams::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00059 {
00060     // Start streaming from the first available source group.
00061     PickNextMediaSourceAsync();
00062 }
00063
00064 void Scenario1_CorrelateStreams::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
00065 {
00066     CleanupMediaCaptureAsync();
00067 }
00068
00069 void Scenario1_CorrelateStreams::NextButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00070 {
00071     PickNextMediaSourceAsync();
00072 }
00073
00074 void Scenario1_CorrelateStreams::ToggleDepth_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00075 {
00076     m_frameSources[MediaFrameSourceKind::Depth].enabled = !m_frameSources[MediaFrameSourceKind::Depth].enabled;
00077     UpdateUI();
00078 }
00079
00080 void Scenario1_CorrelateStreams::ToggleSkeletons_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00081 {
00082     m_frameSources[MediaFrameSourceKind::Custom].enabled = !m_frameSources[MediaFrameSourceKind::Custom].enabled;
00083     UpdateUI();
00084 }
00085
00086 void Scenario1_CorrelateStreams::UpdateUI()
00087 {
00088     ToggleDepth->IsEnabled = m_frameSources[MediaFrameSourceKind::Depth].sourceInfo != nullptr;
00089     ToggleSkeletons->IsEnabled = m_frameSources[MediaFrameSourceKind::Custom].sourceInfo != nullptr;
00090
00091     DepthMessage->Text = m_frameSources[MediaFrameSourceKind::Depth].sourceInfo != nullptr
00092         ? "Depth overlay " + (m_frameSources[MediaFrameSourceKind::Depth].enabled ? "enabled" : "disabled")
00093         : "Depth source not found";
00094     SkeletalMessage->Text = m_frameSources[MediaFrameSourceKind::Depth].sourceInfo != nullptr
00095         ? "Skeletal overlay " + (m_frameSources[MediaFrameSourceKind::Custom].enabled ? "enabled" : "disabled")
00096         : "Skeletal tracking source not found";
00097 }
00098
00099 task<void> Scenario1_CorrelateStreams::PickNextMediaSourceAsync()
00100 {
00101     NextButton->IsEnabled = false;
00102     return PickNextMediaSourceWorkerAsync()
00103         .then([this]()
00104     {
00105         NextButton->IsEnabled = true;
00106         UpdateUI();
00107     }, task_continuation_context::use_current());
00108 }
00109
00110 task<void> Scenario1_CorrelateStreams::PickNextMediaSourceWorkerAsync()
00111 {
00112     return CleanupMediaCaptureAsync().then([this]()
00113     {
00114         return create_task(MediaFrameSourceGroup::FindAllAsync());
00115     }).then([this](IVectorView<MediaFrameSourceGroup^>^ allGroups)
00116     {
00117         std::vector<MediaFrameSourceGroup^> eligableGroups;
00118         for (auto const& group : allGroups)
00119         {
00120             auto sourceInfos = group->SourceInfos;
00121
00122             // Keep this group if it at least supports color, as the other sources must be correlated with the color source.
00123             if (group != nullptr && std::any_of(begin(sourceInfos), end(sourceInfos),
00124                 [](MediaFrameSourceInfo^ sourceInfo) { return sourceInfo != nullptr && sourceInfo->SourceKind == MediaFrameSourceKind::Color; }))
00125             {
00126                 eligableGroups.push_back(group);
00127             }
00128         }
00129
00130         if (eligableGroups.size() == 0)
00131         {
00132             m_logger->Log("No valid source groups found");
00133             return task_from_result();
00134         }
00135
00136         // Pick next group in the array after each time the Next button is clicked.
00137         m_selectedSourceGroupIndex = (m_selectedSourceGroupIndex + 1) % eligableGroups.size();
00138
00139         m_logger->Log("Found " + eligableGroups.size().ToString() + " groups and " +
00140             "selecting index [" + m_selectedSourceGroupIndex.ToString() + "] : " +
00141             eligableGroups[m_selectedSourceGroupIndex]->DisplayName);
00142
00143         MediaFrameSourceGroup^ selectedGroup = eligableGroups[m_selectedSourceGroupIndex];
00144
00145         // Initialize MediaCapture with selected group.
00146         return TryInitializeMediaCaptureAsync(selectedGroup)
00147             .then([this, selectedGroup](bool initialized)
00148         {
00149             if (!initialized)
00150             {
00151                 return CleanupMediaCaptureAsync();
00152             }
00153
00154             // Try to find color, depth and skeletal sources on this source group.
00155             auto sourceInfos = selectedGroup->SourceInfos;
00156
00157             auto colorSourceInfo = std::find_if(begin(sourceInfos), end(sourceInfos), [](MediaFrameSourceInfo^ sourceInfo)
00158             {
00159                 return sourceInfo->SourceKind == MediaFrameSourceKind::Color;
00160             });
00161
00162             auto depthSourceInfo = std::find_if(begin(sourceInfos), end(sourceInfos), [](MediaFrameSourceInfo^ sourceInfo)
00163             {
00164                 return sourceInfo->SourceKind == MediaFrameSourceKind::Depth;
00165             });
00166
00167             // In order to determine whether or not the source info is a skeletal source, its major type must
00168             // be "Perception" and its subtype must be a Guid matching MFPoseTrackingPreview::MFPerceptionFormat_PoseTracking.
00169             // We muse use the initialized media capture object to look up the format and determine the major type and subtype
00170             // of the source.
00171             auto skeletalSourceInfo = std::find_if(begin(sourceInfos), end(sourceInfos), [this](MediaFrameSourceInfo^ sourceInfo)
00172             {
00173                 if (m_mediaCapture->FrameSources->HasKey(sourceInfo->Id))
00174                 {
00175                     MediaFrameFormat^ format = m_mediaCapture->FrameSources->Lookup(sourceInfo->Id)->CurrentFormat;
00176                     GUID subTypeGuid;
00177                     if (SUCCEEDED(IIDFromString(format->Subtype->Data(), &subTypeGuid)))
00178                     {
00179                         return sourceInfo->SourceKind == MediaFrameSourceKind::Custom
00180                             && format->MajorType == PerceptionMediaType
00181                             && Guid(subTypeGuid).Equals(PoseTrackingFrame::PoseTrackingSubtype);
00182                     }
00183                 }
00184
00185                 return false;
00186             });
00187
00188             // Reset our frame sources data
00189             m_frameSources[MediaFrameSourceKind::Color] = FrameSourceState();
00190             m_frameSources[MediaFrameSourceKind::Depth] = FrameSourceState();
00191             m_frameSources[MediaFrameSourceKind::Custom] = FrameSourceState();
00192
00193             // Store the source info object if a source group was found.
00194             m_frameSources[MediaFrameSourceKind::Color].sourceInfo = colorSourceInfo != end(sourceInfos) ? *colorSourceInfo : nullptr;
00195             m_frameSources[MediaFrameSourceKind::Depth].sourceInfo = depthSourceInfo != end(sourceInfos) ? *depthSourceInfo : nullptr;
00196             m_frameSources[MediaFrameSourceKind::Custom].sourceInfo = skeletalSourceInfo != end(sourceInfos) ? *skeletalSourceInfo : nullptr;
00197
00198             // Enable color always.
00199             m_frameSources[MediaFrameSourceKind::Color].enabled = true;
00200
00201             // Enable depth if depth is available.
00202             m_frameSources[MediaFrameSourceKind::Depth].enabled = m_frameSources[MediaFrameSourceKind::Depth].sourceInfo != nullptr;
00203
00204             // Create readers for found sources.
00205             std::vector<task<void>> createReadersTasks;
00206
00207             if (m_frameSources[MediaFrameSourceKind::Color].sourceInfo)
00208             {
00209                 createReadersTasks.push_back(CreateReaderAsync(m_frameSources[MediaFrameSourceKind::Color].sourceInfo));
00210             }
00211
00212             if (m_frameSources[MediaFrameSourceKind::Depth].sourceInfo)
00213             {
00214                 createReadersTasks.push_back(CreateReaderAsync(m_frameSources[MediaFrameSourceKind::Depth].sourceInfo));
00215             }
00216
00217             if (m_frameSources[MediaFrameSourceKind::Custom].sourceInfo)
00218             {
00219                 createReadersTasks.push_back(CreateReaderAsync(m_frameSources[MediaFrameSourceKind::Custom].sourceInfo));
00220             }
00221
00222             // The when_all method will execute all tasks in parallel, and call the continuation when all tasks have completed.
00223             // This async method can be called even if no readers are present. In that case the continuation will be called immediately.
00224             return when_all(begin(createReadersTasks), end(createReadersTasks));
00225         });
00226     }, task_continuation_context::get_current_winrt_context());
00227 }
00228
00229 task<void> Scenario1_CorrelateStreams::CreateReaderAsync(MediaFrameSourceInfo^ info)
00230 {
00231     // Access the initialized frame source by looking up the the Id of the source.
00232     // Verify that the Id is present, because it may have left the group while were were
00233     // busy deciding which group to use.
00234     if (!m_mediaCapture->FrameSources->HasKey(info->Id))
00235     {
00236         m_logger->Log("Unable to start " + info->SourceKind.ToString() + " reader: Frame source not found");
00237         return task_from_result();
00238     }
00239
00240     return create_task(m_mediaCapture->CreateFrameReaderAsync(m_mediaCapture->FrameSources->Lookup(info->Id)))
00241         .then([this, info](MediaFrameReader^ frameReader)
00242     {
00243         m_frameSources[info->SourceKind].frameArrivedEventToken = frameReader->FrameArrived +=
00244             ref new TypedEventHandler<MediaFrameReader^, MediaFrameArrivedEventArgs^>(this, &Scenario1_CorrelateStreams::FrameReader_FrameArrived);
00245
00246         m_logger->Log(info->SourceKind.ToString() + " reader created");
00247
00248         // Keep track of created reader and event handler so it can be stopped later.
00249         m_frameSources[info->SourceKind].reader = frameReader;
00250         return create_task(frameReader->StartAsync());
00251     }).then([this, info](MediaFrameReaderStartStatus status)
00252     {
00253         if (status != MediaFrameReaderStartStatus::Success)
00254         {
00255             m_logger->Log("Unable to start " + info->SourceKind.ToString() + "  reader. Error: " + status.ToString());
00256         }
00257     });
00258 }
00259
00260 task<bool> Scenario1_CorrelateStreams::TryInitializeMediaCaptureAsync(MediaFrameSourceGroup^ group)
00261 {
00262     if (m_mediaCapture != nullptr)
00263     {
00264         // Already initialized.
00265         return task_from_result(true);
00266     }
00267
00268     // Initialize mediacapture with the source group.
00269     m_mediaCapture = ref new MediaCapture();
00270
00271     auto settings = ref new MediaCaptureInitializationSettings();
00272
00273     // Select the source we will be reading from.
00274     settings->SourceGroup = group;
00275
00276     // This media capture can share streaming with other apps.
00277     settings->SharingMode = MediaCaptureSharingMode::SharedReadOnly;
00278
00279     // Only stream video and don't initialize audio capture devices.
00280     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00281
00282     // Set to CPU to ensure frames always contain CPU SoftwareBitmap images,
00283     // instead of preferring GPU D3DSurface images.
00284     settings->MemoryPreference = MediaCaptureMemoryPreference::Cpu;
00285
00286     // Only stream video and don't initialize audio capture devices.
00287     settings->StreamingCaptureMode = StreamingCaptureMode::Video;
00288
00289     // Initialize MediaCapture with the specified group.
00290     // This must occur on the UI thread because some device families
00291     // (such as Xbox) will prompt the user to grant consent for the
00292     // app to access cameras.
00293     // This can raise an exception if the source no longer exists,
00294     // or if the source could not be initialized.
00295     return create_task(m_mediaCapture->InitializeAsync(settings))
00296         .then([this](task<void> initializeMediaCaptureTask)
00297     {
00298         try
00299         {
00300             // Get the result of the initialization. This call will throw if initialization failed
00301             // This pattern is documented at https://msdn.microsoft.com/en-us/library/dd997692.aspx
00302             initializeMediaCaptureTask.get();
00303             m_logger->Log("MediaCapture is successfully initialized in shared mode.");
00304             return true;
00305         }
00306         catch (Exception^ exception)
00307         {
00308             m_logger->Log("Failed to initialize media capture: " + exception->Message);
00309             return false;
00310         }
00311     });
00312 }
00313
00314 task<void> Scenario1_CorrelateStreams::CleanupMediaCaptureAsync()
00315 {
00316     task<void> cleanupTask = task_from_result();
00317
00318     if (m_mediaCapture != nullptr)
00319     {
00320         for (FrameSourceState frameSourceState : values(m_frameSources))
00321         {
00322             if (frameSourceState.reader)
00323             {
00324                 frameSourceState.reader->FrameArrived -= frameSourceState.frameArrivedEventToken;
00325                 cleanupTask = cleanupTask && create_task(frameSourceState.reader->StopAsync());
00326             }
00327
00328             frameSourceState.enabled = false;
00329             frameSourceState.sourceInfo = nullptr;
00330             frameSourceState.reader = nullptr;
00331             frameSourceState.latestFrame = nullptr;
00332         }
00333
00334         m_mediaCapture = nullptr;
00335     }
00336     return cleanupTask;
00337 }
00338
00339 void Scenario1_CorrelateStreams::FrameReader_FrameArrived(MediaFrameReader^ sender, MediaFrameArrivedEventArgs^ args)
00340 {
00341     // TryAcquireLatestFrame will return the latest frame that has not yet been acquired.
00342     // This can return null if there is no such frame, or if the reader is not in the
00343     // "Started" state. The latter can occur if a FrameArrived event was in flight
00344     // when the reader was stopped.
00345     if (MediaFrameReference^ candidateFrame = sender->TryAcquireLatestFrame())
00346     {
00347         // Since multiple sources will be receiving frames, we must synchronize access to m_frameSources.
00348         auto lock = m_frameLock.LockExclusive();
00349
00350         // Buffer frame for later usage.
00351         m_frameSources[candidateFrame->SourceKind].latestFrame = candidateFrame;
00352
00353         auto frameSourceObjects = values(m_frameSources);
00354         bool allFramesBuffered = std::none_of(frameSourceObjects.begin(), frameSourceObjects.end(),
00355             [](FrameSourceState const& frameSourceState)
00356         {
00357             return frameSourceState.enabled && frameSourceState.latestFrame == nullptr;
00358         });
00359
00360         // If we have frames from currently enabled sources, render to UI.
00361         if (allFramesBuffered)
00362         {
00363             bool colorEnabled = m_frameSources[MediaFrameSourceKind::Color].enabled;
00364             bool depthEnabled = m_frameSources[MediaFrameSourceKind::Depth].enabled;
00365             bool skeletalEnabled = m_frameSources[MediaFrameSourceKind::Custom].enabled;
00366
00367             MediaFrameReference^ colorFrame = m_frameSources[MediaFrameSourceKind::Color].latestFrame;
00368             MediaFrameReference^ depthFrame = m_frameSources[MediaFrameSourceKind::Depth].latestFrame;
00369             MediaFrameReference^ skeletalFrame = m_frameSources[MediaFrameSourceKind::Custom].latestFrame;
00370
00371             // If depth and color enabled, correlate and output
00372             if (colorEnabled && depthEnabled)
00373             {
00374                 m_correlatedFrameRenderer->ProcessDepthAndColorFrames(colorFrame, depthFrame);
00375             }
00376             // Render only color if enabled and available
00377             else if (colorEnabled)
00378             {
00379                 m_correlatedFrameRenderer->ProcessColorFrame(colorFrame);
00380             }
00381
00382             // Clear the skeleton shapes if we are not rendering a skeletal frame.
00383             Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
00384                 ref new Windows::UI::Core::DispatchedHandler([this]()
00385             {
00386                 skeletalFrameRenderer->Clear();
00387             }));
00388
00389             // Render skeletal data if enabled and color and depth frames are available.
00390             // The skeletal rendering requires the color and depth coordinate systems and the
00391             // color frame's camera intrinsics to map the resulting skeleton shapes into color image space.
00392             if (skeletalEnabled && colorFrame != nullptr && depthFrame != nullptr)
00393             {
00394                 if (PoseTrackingFrameCreationResult^ result = PoseTrackingFrame::Create(skeletalFrame))
00395                 {
00396                     if (result->Status == PoseTrackingFrameCreationStatus::Success)
00397                     {
00398                         // We must map the coordinates produced by the skeletal tracker from depth space to color space.
00399                         CameraIntrinsics^ colorIntrinsics = colorFrame->VideoMediaFrame->CameraIntrinsics;
00400                         SpatialCoordinateSystem^ colorCoordinateSystem = colorFrame->CoordinateSystem;
00401                         SpatialCoordinateSystem^ depthCoordinateSystem = depthFrame->CoordinateSystem;
00402
00403                         Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
00404                             ref new Windows::UI::Core::DispatchedHandler([this, result, colorIntrinsics, colorCoordinateSystem, depthCoordinateSystem]()
00405                         {
00406                             // We must also scale up the coordinates to the size of the color image canves in order
00407                             // to map the bones onto people in the frame correctly.
00408                             float widthScale = static_cast<float>(previewImage->ActualWidth) / static_cast<float>(colorIntrinsics->ImageWidth);
00409                             float heightScale = static_cast<float>(previewImage->ActualHeight) / static_cast<float>(colorIntrinsics->ImageHeight);
00410
00411                             if (IBox<float4x4>^ boxedDepthToColorTransform = depthCoordinateSystem->TryGetTransformTo(colorCoordinateSystem))
00412                             {
00413                                 static const float4x4 leftToRight = make_float4x4_scale(1, 1, -1);
00414                                 static const float4x4 rightToLeft = leftToRight; // inverse is the same
00415
00416                                 // Camera coordinate systems are right-handed with -Z pointing forward out from the camera,
00417                                 // but camera intrinsics are left-handed with +Z pointing forward out from the camera.
00418                                 // Therefore we need to transform left-handed 3D coordinates from the intrinsics to right-handed
00419                                 // and back again when applying the coordinate system transforms which expect right-handed coordinates.
00420                                 float4x4 depthToColorTransform = leftToRight * boxedDepthToColorTransform->Value * rightToLeft;
00421
00422                                 skeletalFrameRenderer->Render(result->Frame, ref new CoordinateTransformationMethod(
00423                                     [colorIntrinsics, depthToColorTransform, widthScale, heightScale](float3 point)
00424                                 {
00425                                     // Transform the point from depth to color space.
00426                                     Point transformedPoint = colorIntrinsics->ProjectOntoFrame(transform(point, depthToColorTransform));
00427
00428                                     // Scale up the coordinates to match the color image.
00429                                     transformedPoint.X *= widthScale;
00430                                     transformedPoint.Y *= heightScale;
00431
00432                                     // Return the result to the SkeletalFrameRenderer.
00433                                     return transformedPoint;
00434                                 }));
00435                             }
00436                         }));
00437                     }
00438                     else
00439                     {
00440                         m_logger->Log("Failed to convert pose tracking frame: " + result->Status.ToString());
00441                     }
00442                 }
00443             }
00444
00445             // clear buffered frames if used
00446             if (colorEnabled)
00447             {
00448                 m_frameSources[MediaFrameSourceKind::Color].latestFrame = nullptr;
00449             }
00450             if (depthEnabled)
00451             {
00452                 m_frameSources[MediaFrameSourceKind::Depth].latestFrame = nullptr;
00453             }
00454             if (skeletalEnabled)
00455             {
00456                 m_frameSources[MediaFrameSourceKind::Custom].latestFrame = nullptr;
00457             }
00458         }
00459     }
00460     else
00461     {
00462         m_logger->Log("Unable to acquire frame");
00463     }
00464 }
Generated on Fri Nov 15 2024 22:18:46 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SceneComposer::SceneObject Member List

This is the complete list of members for SceneComposer::SceneObject, including all inherited members.
getType() SceneComposer::SceneObject [inline, virtual]
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cs/Common/DirectXHelper.cs Source File

  • 360VideoPlayback
  • cs
  • Common

DirectXHelper.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.IO;
00003 using System.Threading.Tasks;
00004 using Windows.Storage;
00005
00006 namespace _360VideoPlayback.Common
00007 {
00008     internal static class DirectXHelper
00009     {
00010         /// <summary>
00011         /// Function that reads from a binary file asynchronously.
00012         /// </summary>
00013         internal static async Task<byte[]> ReadDataAsync(StorageFile file)
00014         {
00015             using (var stream = await file.OpenStreamForReadAsync())
00016             {
00017                 byte[] buffer = new byte[stream.Length];
00018                 await stream.ReadAsync(buffer, 0, buffer.Length);
00019                 return buffer;
00020             }
00021         }
00022
00023         private const float DipsPerInch = 96.0f;
00024
00025         /// <summary>
00026         /// Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
00027         /// </summary>
00028         internal static double ConvertDipsToPixels(double dips, double dpi)
00029         {
00030             return Math.Floor(dips * dpi / DipsPerInch + 0.5f); // Round to nearest integer.
00031         }
00032
00033 #if DEBUG
00034         /// <summary>
00035         /// Check for SDK Layer support.
00036         /// </summary>
00037         internal static bool SdkLayersAvailable()
00038         {
00039             try
00040             {
00041                 using (var device = new SharpDX.Direct3D11.Device(SharpDX.Direct3D.DriverType.Null, SharpDX.Direct3D11.DeviceCreationFlags.Debug))
00042                 {
00043                     return true;
00044                 }
00045             }
00046             catch
00047             {
00048                 return false;
00049             }
00050         }
00051 #endif
00052     }
00053 }
Generated on Fri Nov 15 2024 22:17:09 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlCommanding/cs/Scenario2.xaml.cs Source File

  • XamlCommanding
  • cs

Scenario2.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml.Controls;
00013
00014 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00015
00016 namespace Commanding
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class Scenario2 : Page
00022     {
00023         public Scenario2()
00024         {
00025             this.InitializeComponent();
00026         }
00027     }
00028 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Package/cpp/scenario2_installedlocation.xaml.h Source File

  • Package
  • cpp

scenario2_installedlocation.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 //
00012 // Scenario1.xaml.h
00013 // Declaration of the Scenario1 class
00014 //
00015
00016 #pragma once
00017
00018 #include "pch.h"
00019 #include "Scenario2_InstalledLocation.g.h"
00020 #include "MainPage.xaml.h"
00021
00022
00023     namespace SDKTemplate
00024     {
00025         /// <summary>
00026         /// An empty page that can be used on its own or navigated to within a Frame.
00027         /// </summary>
00028         [Windows::Foundation::Metadata::WebHostHidden]
00029         public ref class Scenario2 sealed
00030         {
00031         public:
00032             Scenario2();
00033
00034         protected:
00035             virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         private:
00037             MainPage^ rootPage;
00038
00039             void GetInstalledLocation_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00040         };
00041 }
Generated on Fri Nov 15 2024 22:20:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cpp/pch.h Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <wrl\event.h>
00008 #include <wrl\implements.h>
00009 #include <wrl\wrappers\corewrappers.h>
00010 #include <collection.h>
00011 #include <ppltasks.h>
00012
00013 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PasswordVault/cs/Scenario1_Save.xaml.cs Source File

  • PasswordVault
  • cs

Scenario1_Save.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.Threading.Tasks;
00015 using Windows.Security.Credentials;
00016 using Windows.UI.Xaml;
00017 using Windows.UI.Xaml.Controls;
00018
00019 namespace SDKTemplate
00020 {
00021     public sealed partial class Scenario1_Save : Page
00022     {
00023         private MainPage rootPage = MainPage.Current;
00024
00025         public Scenario1_Save()
00026         {
00027             this.InitializeComponent();
00028         }
00029
00030         private void SaveCredential_Click(Object sender, RoutedEventArgs args)
00031         {
00032             var resource = InputResourceValue.Text;
00033             var userName = InputUserNameValue.Text;
00034             var password = InputPasswordValue.Password;
00035
00036             if (resource  == "" || userName == "" || password == "")
00037             {
00038                 rootPage.NotifyUser("All fields are required when saving a credential.", NotifyType.ErrorMessage);
00039             }
00040             else
00041             {
00042                 // Add a credential to PasswordVault with provided resource, user name, and password.
00043                 // Replaces any existing credential with the same resource and user name.
00044                 var vault = new PasswordVault();
00045                 var cred = new PasswordCredential(resource, userName, password);
00046                 vault.Add(cred);
00047
00048                 rootPage.NotifyUser("Credential saved successfully. Resource: " + cred.Resource + " Username: " + cred.UserName + " Password: " + cred.Password, NotifyType.StatusMessage);
00049             }
00050         }
00051     }
00052 }
Generated on Fri Nov 15 2024 22:20:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BitrateItem Member List

This is the complete list of members for BitrateItem, including all inherited members.
Bitrate | BitrateItem |
BitrateItem(uint?bitrate) | BitrateItem | [inline]
ToString() | BitrateItem | [inline]
Generated on Fri Nov 15 2024 22:23:43 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AppWindow/cppwinrt/Project.idl Source File

  • AppWindow
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_SecondaryWindow : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_SecondaryWindow();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_DisplayRegion : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_DisplayRegion();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_Size : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_Size();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_CompactOverlay : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_CompactOverlay();
00036     }
00037
00038     [default_interface]
00039     runtimeclass Scenario5_RelativePositioning : Windows.UI.Xaml.Controls.Page
00040     {
00041         Scenario5_RelativePositioning();
00042     }
00043
00044     [default_interface]
00045     runtimeclass SecondaryAppWindowPage : Windows.UI.Xaml.Controls.Page
00046     {
00047         SecondaryAppWindowPage();
00048         }
00049 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MultipleTasks Member List

This is the complete list of members for MultipleTasks, including all inherited members.
BeginExtendedExecution() | MultipleTasks | [inline, private]
cancellationTokenSource | MultipleTasks | [private]
ClearExtendedExecution() | MultipleTasks | [inline, private]
EndExtendedExecution() | MultipleTasks | [inline, private]
GetExecutionDeferral() | MultipleTasks | [inline, private]
MultipleTasks() | MultipleTasks | [inline]
OnNavigatingFrom(NavigatingCancelEventArgs e) | MultipleTasks | [inline, protected]
OnTaskCompleted() | MultipleTasks | [inline, private]
RaiseToastAfterDelay(int id, int seconds) | MultipleTasks | [inline, private]
rootPage | MultipleTasks | [private]
session | MultipleTasks | [private]
SessionRevoked(object sender, ExtendedExecutionRevokedEventArgs args) | MultipleTasks | [inline, private]
taskCount | MultipleTasks | [private]
UpdateUI() | MultipleTasks | [inline, private]
Generated on Fri Nov 15 2024 22:23:47 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3 Member List

This is the complete list of members for Scenario3, including all inherited members.
_instance | Scenario3 | [private]
_statusChangedToken | Scenario3 | [private]
AddLogFileMessage(_In_ LPCWSTR message, _In_opt_ LPCWSTR logFileFullPath) | Scenario3 | [private]
AddMessage(_In_ LPCWSTR message) | Scenario3 | [private]
AnimatedSwitch_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3 |
animationCompleteEvent | Scenario3 | [private]
btnFilePicker_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
btnPause_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
btnPlay_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
btnPlayPause_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
btnStop_Click(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
CompleteCurrentAnimation() | Scenario3 | [private]
Current_VisibilityChanged(Windows::Foundation::IInspectable const &sender, Windows::UI::Core::VisibilityChangedEventArgs const &e) | Scenario3 | [private]
DisableContentUI() | Scenario3 |
DoScenario(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args) | Scenario3 |
EnableDisableLogging(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &args) | Scenario3 |
Fade_Completed(Windows::Foundation::IInspectable const &, Windows::Foundation::IInspectable const &) | Scenario3 | [private]
fadeOutStoryboard | Scenario3 | [private]
fadeOutToken | Scenario3 | [private]
GetFilesButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3 |
GetPropertyDisplayValue(Windows::Foundation::IInspectable const &rawValue) | Scenario3 | [private, static]
GetThumbnailButton_Click(Windows::Foundation::IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
InitializeDevice() | Scenario3 |
lastFadeOutTime | Scenario3 | [private]
m_contentType | Scenario3 | [private]
m_deviceStateChangeToken | Scenario3 | [private]
m_deviceSupportsRawMode | Scenario3 | [private]
m_isMinimumLatency | Scenario3 | [private]
m_renderer | Scenario3 | [private]
m_systemMediaControlsButtonToken | Scenario3 | [private]
MediaButtonPressed(Windows::Media::SystemMediaTransportControls const &sender, Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs e) | Scenario3 |
MediaFoundationInitializer() | MediaFoundationInitializer | [inline, private]
OnDeviceStateChange(IDeviceStateSource const &sender, SDKTemplate::DeviceStateChangedEventArgs e) | Scenario3 |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &args) | Scenario3 |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3 |
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &args) | Scenario3 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3 |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e) | Scenario3 |
OnPickFileAsync() | Scenario3 |
OnSetVolume(double volume) | Scenario3 |
OnStatusChanged(SDKTemplate::LoggingScenarioEventArgs args) | Scenario3 | [private]
PauseDevice() | Scenario3 |
PlayPauseToggleDevice() | Scenario3 |
radioFile_Checked(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
radioTone_Checked(IInspectable const &sender, Windows::UI::Xaml::RoutedEventArgs const &e) | Scenario3 |
ReadTextButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3 |
Scenario3() | Scenario3 |
Scenario3() | Scenario3 |
Scenario3() | Scenario3 |
Scenario3() | Scenario3 |
Scenario3() | Scenario3 |
Scenario3() | Scenario3 |
sliderFrequency_ValueChanged(IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e) | Scenario3 |
sliderVolume_ValueChanged(IInspectable const &sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const &e) | Scenario3 |
StartDevice() | Scenario3 |
StartFadeOutContents() | Scenario3 | [private]
StopDevice() | Scenario3 |
UpdateContentProps(hstring const &text) | Scenario3 |
UpdateContentUI() | Scenario3 |
UpdateControls() | Scenario3 | [private]
UpdateMediaControlUI(DeviceState deviceState) | Scenario3 |
visibilityToken | Scenario3 | [private]
WriteTextButton_Click(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3 |
~MediaFoundationInitializer() | MediaFoundationInitializer | [inline, private]
Generated on Fri Nov 15 2024 22:24:16 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cs/S5_AddWithAppContent.xaml.cs Source File

  • ContentIndexer
  • cs

S5_AddWithAppContent.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using Windows.UI.Xaml;
00013 using Windows.UI.Xaml.Controls;
00014 using Windows.UI.Xaml.Navigation;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class S5_AddWithAppContent
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public S5_AddWithAppContent()
00029         {
00030             this.InitializeComponent();
00031             Helpers.InitializeRevisionNumber();
00032         }
00033
00034         /// <summary>
00035         /// Invoked when this page is about to be displayed in a Frame.
00036         /// </summary>
00037         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00038         /// property is typically used to configure the page.</param>
00039         protected override void OnNavigatedTo(NavigationEventArgs e)
00040         {
00041         }
00042
00043         private async void AddToIndex_Click(object sender, RoutedEventArgs e)
00044         {
00045             var outputString = await Helpers.AddAppContentFilesToIndexedFolder();
00046             rootPage.NotifyUser(outputString, NotifyType.StatusMessage);
00047         }
00048     }
00049 }
Generated on Fri Nov 15 2024 22:18:58 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: XamlDeferLoadStrategy/cs/Scenarios/AdaptivePage.xaml.cs Source File

  • XamlDeferLoadStrategy
  • cs
  • Scenarios

AdaptivePage.xaml.cs

Go to the documentation of this file.
00001 ﻿using System;
00002 using System.Collections.ObjectModel;
00003 using Windows.UI.ViewManagement;
00004 using Windows.UI.Xaml;
00005 using Windows.UI.Xaml.Controls;
00006
00007 namespace xDeferLoadStrategy
00008 {
00009     /// <summary>
00010     /// An empty page that can be used on its own or navigated to within a Frame.
00011     /// </summary>
00012     public sealed partial class AdaptivePage : Page
00013     {
00014         public ObservableCollection<Account> Accounts { get; set; }
00015         public ObservableCollection<Email> Emails { get; set; }
00016
00017         public AdaptivePage()
00018         {
00019             this.InitializeComponent();
00020
00021             Accounts = new ObservableCollection<Account>()
00022             {
00023                 new Account() { AccountName = "test@outlook.com", IconUri = @"ms-appx:///Assets/Icons/outlook.png" },
00024                 new Account() { AccountName = "test@gmail.com", IconUri = @"ms-appx:///Assets/Icons/gmail.png" },
00025                 new Account() { AccountName = "test@yahoo.com", IconUri = @"ms-appx:///Assets/Icons/yahoo.png" },
00026                 new Account() { AccountName = "test@mydomain.com", IconUri = @"ms-appx:///Assets/Icons/email.png" }
00027             };
00028
00029             Emails = new ObservableCollection<Email>()
00030             {
00031                 new Email() { From = "manager@company.com", Subject = "Weekend work", Body = "I'm going to need you to come in on Sunday too to cover for Bill.", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(1)).ToString("g")},
00032                 new Email() { From = "employee@company.com", Subject = "Project link", Body = "Hey, can I get a link to the project you told me about?", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(2)).ToString("g")},
00033                 new Email() { From = "spouse@home.com", Subject = "Groceries", Body = "Can you pick up some milk on your way home?", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(5)).ToString("g")},
00034                 new Email() { From = "coworker@company.com", Subject = "PTO", Body = "I heard you're heading to the Bahamas soon?  So jealous!", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(15)).ToString("g")},
00035                 new Email() { From = "hr@company.com", Subject = "PTO approved", Body = "Your PTO request has been approved.  Please remember to log your time.", ReceivedDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(30)).ToString("g")}
00036             };
00037             MailList.ItemsSource = Emails;
00038
00039             ApplicationView.GetForCurrentView().VisibleBoundsChanged += AdaptivePage_VisibleBoundsChanged;
00040         }
00041
00042         private void AdaptivePage_VisibleBoundsChanged(ApplicationView sender, object args)
00043         {
00044             //Here we are hiding panes when we get to certain thresholds
00045             if (ApplicationView.GetForCurrentView().VisibleBounds.Width < 768 && ReadingPane != null)
00046                 ReadingPane.Visibility = Visibility.Collapsed;
00047
00048             if (ApplicationView.GetForCurrentView().VisibleBounds.Width < 1024 && AccountsList != null)
00049                 AccountsList.Visibility = Visibility.Collapsed;
00050         }
00051
00052         private void AccountsList_Loading(FrameworkElement sender, object args)
00053         {
00054             //We need to do this in Loading for AccountsList, since it's possible that it will be created later
00055             AccountsList.ItemsSource = Accounts;
00056         }
00057     }
00058
00059     public class Account
00060     {
00061         public string AccountName { get; set; }
00062         public string IconUri { get; set; }
00063     }
00064
00065     public class Email
00066     {
00067         public string From { get; set; }
00068         public string Subject { get; set; }
00069         public string Body { get; set; }
00070         public string ReceivedDate { get; set; }
00071     }
00072 }
Generated on Fri Nov 15 2024 22:22:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Simple3DGameDX/cppwinrt/Common/DeviceResources.h Source File

  • Simple3DGameDX
  • cppwinrt
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace DX
00015 {
00016     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00017     interface IDeviceNotify
00018     {
00019         virtual void OnDeviceLost() = 0;
00020         virtual void OnDeviceRestored() = 0;
00021     };
00022
00023     // Controls all the DirectX device resources.
00024     class DeviceResources
00025     {
00026     public:
00027         DeviceResources();
00028         void SetWindow(winrt::Windows::UI::Core::CoreWindow const& window);
00029         void SetLogicalSize(winrt::Windows::Foundation::Size logicalSize);
00030         void SetCurrentOrientation(winrt::Windows::Graphics::Display::DisplayOrientations currentOrientation);
00031         void SetDpi(float dpi);
00032         void UpdateStereoState();
00033         void ValidateDevice();
00034         void HandleDeviceLost();
00035         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00036         void Trim();
00037         void Present();
00038
00039         // Device Accessors.
00040         winrt::Windows::Foundation::Size GetOutputSize() const { return m_outputSize; }
00041         winrt::Windows::Foundation::Size GetLogicalSize() const { return m_logicalSize; }
00042         winrt::Windows::Foundation::Size GetRenderTargetSize() const { return m_d3dRenderTargetSize; }
00043         bool                             GetStereoState() const { return m_stereoEnabled; }
00044         float                            GetDpi() const { return m_dpi; }
00045
00046         // D3D Accessors.
00047         winrt::com_ptr<ID3D11Device3> const& GetD3DDevice() const { return m_d3dDevice; }
00048         ID3D11DeviceContext3* GetD3DDeviceContext() const { return m_d3dContext.get(); }
00049         IDXGISwapChain1* GetSwapChain() const { return m_swapChain.get(); }
00050         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const { return m_d3dFeatureLevel; }
00051         ID3D11RenderTargetView* GetBackBufferRenderTargetView() const { return m_d3dRenderTargetView.get(); }
00052         ID3D11RenderTargetView* GetBackBufferRenderTargetViewRight() const { return m_d3dRenderTargetViewRight.get(); }
00053         ID3D11DepthStencilView* GetDepthStencilView() const { return m_d3dDepthStencilView.get(); }
00054         D3D11_VIEWPORT          GetScreenViewport() const { return m_screenViewport; }
00055         DirectX::XMFLOAT4X4     GetOrientationTransform3D() const { return m_orientationTransform3D; }
00056
00057         // D2D Accessors.
00058         ID2D1Factory3* GetD2DFactory() const { return m_d2dFactory.get(); }
00059         ID2D1Device2* GetD2DDevice() const { return m_d2dDevice.get(); }
00060         ID2D1DeviceContext2* GetD2DDeviceContext() const { return m_d2dContext.get(); }
00061         ID2D1Bitmap1* GetD2DTargetBitmap() const { return m_d2dTargetBitmap.get(); }
00062         ID2D1Bitmap1* GetD2DTargetBitmapRight() const { return m_d2dTargetBitmapRight.get(); }
00063         IDWriteFactory3* GetDWriteFactory() const { return m_dwriteFactory.get(); }
00064         IWICImagingFactory2* GetWicImagingFactory() const { return m_wicFactory.get(); }
00065         D2D1::Matrix3x2F     GetOrientationTransform2D() const { return m_orientationTransform2D; }
00066
00067     private:
00068         void CreateDeviceIndependentResources();
00069         void CreateDeviceResources();
00070         void CreateWindowSizeDependentResources();
00071         DXGI_MODE_ROTATION ComputeDisplayRotation();
00072         void CheckStereoEnabledStatus();
00073
00074         // Direct3D objects.
00075         winrt::com_ptr<ID3D11Device3>         m_d3dDevice;
00076         winrt::com_ptr<ID3D11DeviceContext3>  m_d3dContext;
00077         winrt::com_ptr<IDXGISwapChain1>       m_swapChain;
00078
00079         // Direct3D rendering objects. Required for 3D.
00080         winrt::com_ptr<ID3D11RenderTargetView>  m_d3dRenderTargetView;
00081         winrt::com_ptr<ID3D11RenderTargetView>  m_d3dRenderTargetViewRight;
00082         winrt::com_ptr<ID3D11DepthStencilView>  m_d3dDepthStencilView;
00083         D3D11_VIEWPORT                          m_screenViewport;
00084
00085         // Direct2D drawing components.
00086         winrt::com_ptr<ID2D1Factory3>       m_d2dFactory;
00087         winrt::com_ptr<ID2D1Device2>        m_d2dDevice;
00088         winrt::com_ptr<ID2D1DeviceContext2> m_d2dContext;
00089         winrt::com_ptr<ID2D1Bitmap1>        m_d2dTargetBitmap;
00090         winrt::com_ptr<ID2D1Bitmap1>        m_d2dTargetBitmapRight;
00091
00092         // DirectWrite drawing components.
00093         winrt::com_ptr<IDWriteFactory3>     m_dwriteFactory;
00094         winrt::com_ptr<IWICImagingFactory2> m_wicFactory;
00095
00096         // Cached reference to the Window.
00097         winrt::agile_ref<winrt::Windows::UI::Core::CoreWindow> m_window{ nullptr };
00098
00099         // Cached device properties.
00100         D3D_FEATURE_LEVEL                                      m_d3dFeatureLevel;
00101         winrt::Windows::Foundation::Size                       m_d3dRenderTargetSize;
00102         winrt::Windows::Foundation::Size                       m_outputSize;
00103         winrt::Windows::Foundation::Size                       m_logicalSize;
00104         winrt::Windows::Graphics::Display::DisplayOrientations m_nativeOrientation;
00105         winrt::Windows::Graphics::Display::DisplayOrientations m_currentOrientation;
00106         float                                                  m_dpi;
00107         bool                                                   m_stereoEnabled;
00108
00109         // Transforms used for display orientation.
00110         D2D1::Matrix3x2F    m_orientationTransform2D;
00111         DirectX::XMFLOAT4X4 m_orientationTransform3D;
00112
00113         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00114         IDeviceNotify* m_deviceNotify;
00115     };
00116 }
Generated on Fri Nov 15 2024 22:16:54 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: RelativeInclinometer/cpp/Scenario1_DataEvents.xaml.h Source File

  • RelativeInclinometer
  • cpp

Scenario1_DataEvents.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.h
00014 // Declaration of the Scenario1_DataEvents class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1_DataEvents.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     [Windows::Foundation::Metadata::WebHostHidden]
00029     public ref class Scenario1_DataEvents sealed
00030     {
00031     public:
00032         Scenario1_DataEvents();
00033
00034     protected:
00035         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00036         virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00037
00038     private:
00039         SDKTemplate::MainPage^ rootPage;
00040         Windows::Devices::Sensors::Inclinometer^ inclinometer;
00041         Windows::Foundation::EventRegistrationToken visibilityToken;
00042         Windows::Foundation::EventRegistrationToken readingToken;
00043         uint32 desiredReportInterval;
00044
00045         void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
00046         void ReadingChanged(Windows::Devices::Sensors::Inclinometer^ sender, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs^ e);
00047         void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00048         void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00049     };
00050 }
Generated on Fri Nov 15 2024 22:17:32 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OCR/cpp/OcrFileImage.xaml.cpp Source File

  • OCR
  • cpp

OcrFileImage.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "OcrFileImage.xaml.h"
00014 #include <ppltasks.h>
00015
00016 using namespace SDKTemplate;
00017
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::Foundation::Collections;
00021 using namespace Windows::UI::Core;
00022 using namespace Windows::UI::Xaml;
00023 using namespace Windows::UI::Xaml::Controls;
00024 using namespace Windows::UI::Xaml::Controls::Primitives;
00025 using namespace Windows::UI::Xaml::Data;
00026 using namespace Windows::UI::Xaml::Input;
00027 using namespace Windows::UI::Xaml::Media;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 OcrFileImage::OcrFileImage() : rootPage(MainPage::Current)
00031 {
00032     InitializeComponent();
00033 }
00034
00035 /// <summary>
00036 /// Invoked when this page is about to be displayed in a Frame.
00037 /// Updates OCR available languages and loads sample image.
00038 /// </summary>
00039 /// <param name="e"></param>
00040 void OcrFileImage::OnNavigatedTo(NavigationEventArgs^ e)
00041 {
00042     UpdateAvailableLanguages();
00043     LoadSampleImage();
00044 }
00045
00046 /// <summary>
00047 /// Updates list of ocr languages available on device.
00048 /// </summary>
00049 void OcrFileImage::UpdateAvailableLanguages()
00050 {
00051     if (!UserLanguageToggle->IsOn)
00052     {
00053         // Check if any OCR language is available on device.
00054         if (OcrEngine::AvailableRecognizerLanguages->Size > 0)
00055         {
00056             auto languages = ref new Vector<String^>();
00057             for (const auto& lang : OcrEngine::AvailableRecognizerLanguages)
00058             {
00059                 languages->Append(lang->DisplayName);
00060                 languageMap[lang->DisplayName] = lang;
00061             }
00062
00063             LanguageList->ItemsSource = languages;
00064             LanguageList->SelectedIndex = 0;
00065             LanguageList->IsEnabled = true;
00066         }
00067         else
00068         {
00069             // Prevent OCR if no OCR languages are available on device.
00070             UserLanguageToggle->IsEnabled = false;
00071             LanguageList->IsEnabled = false;
00072             ExtractButton->IsEnabled = false;
00073
00074             rootPage->NotifyUser("No available OCR languages.", NotifyType::ErrorMessage);
00075         }
00076     }
00077     else
00078     {
00079         LanguageList->ItemsSource = nullptr;
00080         LanguageList->IsEnabled = false;
00081
00082         rootPage->NotifyUser(
00083             "Run OCR in first OCR available language from UserProfile.GlobalizationPreferences.Languages list.",
00084             NotifyType::StatusMessage);
00085     }
00086 }
00087
00088 /// <summary>
00089 /// Loads image from file to bitmap and displays it in UI.
00090 /// </summary>
00091 /// <param name="file"></param>
00092 /// <returns></returns>
00093 task<void> OcrFileImage::LoadImage(StorageFile^ file)
00094 {
00095     return create_task(file->OpenAsync(FileAccessMode::Read)).then([this](IRandomAccessStream^ stream)
00096     {
00097         return BitmapDecoder::CreateAsync(stream);
00098     }).then([this](BitmapDecoder^ decoder) -> IAsyncOperation<SoftwareBitmap^>^
00099     {
00100         return decoder->GetSoftwareBitmapAsync();
00101     }).then([this](SoftwareBitmap^ imageBitmap)
00102     {
00103         WriteableBitmap^ wb = ref new WriteableBitmap(imageBitmap->PixelWidth, imageBitmap->PixelHeight);
00104         imageBitmap->CopyToBuffer(wb->PixelBuffer);
00105         PreviewImage->Source = wb;
00106
00107         this->bitmap = imageBitmap;
00108     });
00109 }
00110
00111 void OcrFileImage::LoadSampleImage()
00112 {
00113     // Load sample "Hello World" image.
00114     auto getFileOp = Windows::ApplicationModel::Package::Current->InstalledLocation->GetFileAsync("Assets\\splash-sdk.png");
00115     create_task(getFileOp).then([this](StorageFile^ file)
00116     {
00117         return LoadImage(file);
00118     }).then([this]()
00119     {
00120         // Use dispatcher to update UI.
00121         Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
00122         {
00123             rootPage->NotifyUser("Loaded sample image.", NotifyType::StatusMessage);
00124         }));
00125     });
00126 }
00127
00128 /// <summary>
00129 /// Clears extracted text and text overlay from previous OCR.
00130 /// </summary>
00131 void OcrFileImage::ClearResults()
00132 {
00133     isAngleDetected = false;
00134     TextOverlay->RenderTransform = nullptr;
00135     ExtractedTextBox->Text = "";
00136     TextOverlay->Children->Clear();
00137     wordBoxes.clear();
00138 }
00139
00140 /// <summary>
00141 ///  Update word box transform to match current UI size.
00142 /// </summary>
00143 void OcrFileImage::UpdateWordBoxTransform()
00144 {
00145     // Used for text overlay.
00146     // Prepare scale transform for words since image is not displayed in original size.
00147     ScaleTransform^ scaleTrasform = ref new ScaleTransform();
00148     scaleTrasform->CenterX = 0;
00149     scaleTrasform->CenterY = 0;
00150     scaleTrasform->ScaleX = PreviewImage->ActualWidth / bitmap->PixelWidth;
00151     scaleTrasform->ScaleY = PreviewImage->ActualHeight / bitmap->PixelHeight;
00152
00153     for (auto& item : wordBoxes)
00154     {
00155         item->Transform(scaleTrasform);
00156     }
00157 }
00158
00159 /// <summary>
00160 /// This is event handler for 'Extract' button.
00161 /// Recognizes text from image and displays it.
00162 /// </summary>
00163 /// <param name="sender"></param>
00164 /// <param name="e"></param>
00165 void OcrFileImage::ExtractButton_Tapped(Platform::Object^ sender, TappedRoutedEventArgs^ e)
00166 {
00167     ClearResults();
00168
00169     if (bitmap->PixelWidth > static_cast<int>(OcrEngine::MaxImageDimension) || bitmap->PixelHeight > static_cast<int>(OcrEngine::MaxImageDimension))
00170     {
00171         rootPage->NotifyUser(
00172             "Bitmap dimensions (" + bitmap->PixelWidth + "x" + bitmap->PixelHeight + ") are too big for OCR. " +
00173                 "Max image dimension is " + OcrEngine::MaxImageDimension + ".",
00174             NotifyType::ErrorMessage);
00175
00176         return;
00177     }
00178
00179     OcrEngine^ ocrEngine = nullptr;
00180
00181     if (UserLanguageToggle->IsOn)
00182     {
00183         // Try to create OcrEngine for first supported language from UserProfile.GlobalizationPreferences.Languages list.
00184         // If none of the languages are available on device, method returns null.
00185         ocrEngine = OcrEngine::TryCreateFromUserProfileLanguages();
00186     }
00187     else
00188     {
00189         // Try to create OcrEngine for specified language.
00190         // If language is not supported on device, method returns null.
00191         Windows::Globalization::Language^ language = languageMap[safe_cast<String^>(LanguageList->SelectedValue)];
00192         ocrEngine = OcrEngine::TryCreateFromLanguage(language);
00193     }
00194
00195     if (ocrEngine != nullptr)
00196     {
00197         // Recognize text from image.
00198         auto recognizeOp = ocrEngine->RecognizeAsync(bitmap);
00199         create_task(recognizeOp).then([this, ocrEngine](OcrResult^ ocrResult)
00200         {
00201             // Display recognized text.
00202             ExtractedTextBox->Text = ocrResult->Text;
00203
00204             if (ocrResult->TextAngle != nullptr)
00205             {
00206                 // If text is detected under some angle in this sample scenario we want to
00207                 // overlay word boxes over original image, so we rotate overlay boxes.
00208                 RotateTransform^ rotateTransform = ref new RotateTransform();
00209                 rotateTransform->Angle = ocrResult->TextAngle->Value;
00210                 rotateTransform->CenterX = PreviewImage->ActualWidth / 2;
00211                 rotateTransform->CenterY = PreviewImage->ActualHeight / 2;
00212                 TextOverlay->RenderTransform = rotateTransform;
00213
00214                 isAngleDetected = true;
00215             }
00216
00217             // Create overlay boxes over recognized words.
00218             for (const auto& line : ocrResult->Lines)
00219             {
00220                 Rect lineRect = line->Words->GetAt(0u)->BoundingRect;
00221                 for (const auto& word : line->Words)
00222                 {
00223                     lineRect.Union(word->BoundingRect);
00224                 }
00225
00226                 // Determine if line is horizontal or vertical.
00227                 // Vertical lines are supported only in Chinese Traditional and Japanese languages.
00228                 bool isVerticalLine = lineRect.Height > lineRect.Width;
00229
00230                 for (const auto& word : line->Words)
00231                 {
00232                     WordOverlay^ wordBoxOverlay = ref new WordOverlay(word);
00233
00234                     // Keep references to word boxes.
00235                     wordBoxes.push_back(wordBoxOverlay);
00236
00237                     // Define overlay style.
00238                     auto overlay = ref new Border();
00239
00240                     if (isVerticalLine)
00241                     {
00242                         overlay->Style = (Windows::UI::Xaml::Style^) this->Resources->Lookup("HighlightedWordBoxVerticalLine");
00243                     }
00244                     else
00245                     {
00246                         overlay->Style = (Windows::UI::Xaml::Style^) this->Resources->Lookup("HighlightedWordBoxHorizontalLine");
00247                     }
00248
00249                     // Bind word boxes to UI.
00250                     overlay->SetBinding(FrameworkElement::MarginProperty, wordBoxOverlay->CreateWordPositionBinding());
00251                     overlay->SetBinding(FrameworkElement::WidthProperty, wordBoxOverlay->CreateWordWidthBinding());
00252                     overlay->SetBinding(FrameworkElement::HeightProperty, wordBoxOverlay->CreateWordHeightBinding());
00253
00254                     // Put the filled textblock in the results grid.
00255                     TextOverlay->Children->Append(overlay);
00256                 }
00257             }
00258
00259             // Rescale word boxes to match current UI size.
00260             UpdateWordBoxTransform();
00261
00262             // Use dispatcher to update UI.
00263             Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, ocrEngine]()
00264             {
00265                 rootPage->NotifyUser(
00266                     "Image is OCRed for " + ocrEngine->RecognizerLanguage->DisplayName + " language.",
00267                     NotifyType::StatusMessage);
00268             }));
00269
00270         });
00271     }
00272     else
00273     {
00274         rootPage->NotifyUser("Selected language is not available.", NotifyType::ErrorMessage);
00275     }
00276 }
00277
00278 /// <summary>
00279 /// Occures when user language toogle state is changed.
00280 /// </summary>
00281 /// <param name="sender"></param>
00282 /// <param name="e"></param>
00283 void OcrFileImage::UserLanguageToggle_Toggled(Platform::Object^ sender, RoutedEventArgs^ e)
00284 {
00285     UpdateAvailableLanguages();
00286 }
00287
00288 /// <summary>
00289 /// This is event handler for 'Sample' button.
00290 /// It loads image with 'Hello World' text and displays it in UI.
00291 /// </summary>
00292 /// <param name="sender"></param>
00293 /// <param name="e"></param>
00294 void OcrFileImage::SampleButton_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
00295 {
00296     ClearResults();
00297
00298     // Load sample "Hello World" image.
00299     LoadSampleImage();
00300 }
00301
00302 /// <summary>
00303 /// This is event handler for 'Load' button.
00304 /// It opens file picked and load selected image in UI.
00305 /// </summary>
00306 /// <param name="sender"></param>
00307 /// <param name="e"></param>
00308 void OcrFileImage::LoadButton_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
00309 {
00310     FileOpenPicker^ picker = ref new FileOpenPicker();
00311     picker->FileTypeFilter->Append(".jpg");
00312     picker->FileTypeFilter->Append(".jpeg");
00313     picker->FileTypeFilter->Append(".png");
00314     picker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
00315
00316     create_task(picker->PickSingleFileAsync()).then([this](StorageFile^ file)
00317     {
00318         if (file != nullptr)
00319         {
00320             ClearResults();
00321
00322             create_task(LoadImage(file)).then([this, file]()
00323             {
00324                 // Use dispatcher to update UI.
00325                 Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, file]()
00326                 {
00327                     rootPage->NotifyUser("Loaded image from file: " + file->Name + ".", NotifyType::StatusMessage);
00328                 }));
00329             });
00330         }
00331     });
00332 }
00333
00334 /// <summary>
00335 /// Occures when selected language is changed in available languages combo box.
00336 /// </summary>
00337 /// <param name="sender"></param>
00338 /// <param name="e"></param>
00339 void OcrFileImage::LanguageList_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
00340 {
00341     ClearResults();
00342
00343     auto lang = safe_cast<String^>(LanguageList->SelectedValue);
00344     if (lang != nullptr)
00345     {
00346         rootPage->NotifyUser(
00347             "Selected OCR language is " + lang + ".\n" +
00348             OcrEngine::AvailableRecognizerLanguages->Size + " OCR language(s) are available.\n" +
00349             "Check combo box for full list.",
00350             NotifyType::StatusMessage);
00351     }
00352 }
00353
00354 /// <summary>
00355 /// Occurs when displayed image size changes.
00356 /// </summary>
00357 /// <param name="sender"></param>
00358 /// <param name="e"></param>
00359 void OcrFileImage::PreviewImage_SizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
00360 {
00361     // Update word overlay boxes.
00362     UpdateWordBoxTransform();
00363
00364     // Update image rotation center.
00365     if (isAngleDetected)
00366     {
00367         const auto& rotate = static_cast<RotateTransform^>(TextOverlay->RenderTransform);
00368
00369         rotate->CenterX = PreviewImage->ActualWidth / 2;
00370         rotate->CenterY = PreviewImage->ActualHeight / 2;
00371     }
00372 }
Generated on Fri Nov 15 2024 22:20:41 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Playlists/cpp/Scenario5_Clear.xaml.cpp Source File

  • Playlists
  • cpp

Scenario5_Clear.xaml.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "Scenario5_Clear.xaml.h"
00005
00006 using namespace SDKTemplate;
00007
00008 using namespace concurrency;
00009 using namespace Platform;
00010 using namespace Windows::Foundation;
00011 using namespace Windows::Foundation::Collections;
00012 using namespace Windows::Media::Playlists;
00013 using namespace Windows::Storage;
00014 using namespace Windows::Storage::Pickers;
00015 using namespace Windows::UI::Xaml;
00016 using namespace Windows::UI::Xaml::Controls;
00017 using namespace Windows::UI::Xaml::Controls::Primitives;
00018 using namespace Windows::UI::Xaml::Data;
00019 using namespace Windows::UI::Xaml::Input;
00020 using namespace Windows::UI::Xaml::Media;
00021 using namespace Windows::UI::Xaml::Navigation;
00022
00023 Scenario5_Clear::Scenario5_Clear() : rootPage(MainPage::Current)
00024 {
00025     InitializeComponent();
00026 }
00027
00028 void Scenario5_Clear::PickPlaylistButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00029 {
00030     this->rootPage->PickPlaylistAsync().then([this](Playlist^ playlist)
00031     {
00032         if (playlist != nullptr)
00033         {
00034             // Clear playlist.
00035             playlist->Files->Clear();
00036
00037             this->rootPage->TrySavePlaylistAsync(playlist).then([this](bool result)
00038             {
00039                 if (result)
00040                 {
00041                     this->rootPage->NotifyUser("Playlist cleared.", NotifyType::StatusMessage);
00042                 }
00043             });
00044         }
00045     });
00046 }
Generated on Fri Nov 15 2024 22:20:56 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: 360VideoPlayback/cpp/Common/DeviceResources.h Source File

  • 360VideoPlayback
  • cpp
  • Common

DeviceResources.h

Go to the documentation of this file.
00001 ﻿
00002 #pragma once
00003
00004 #include "CameraResources.h"
00005
00006 namespace DX
00007 {
00008     // Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
00009     interface IDeviceNotify
00010     {
00011         virtual void OnDeviceLost() = 0;
00012         virtual void OnDeviceRestored() = 0;
00013     };
00014
00015     // Creates and manages a Direct3D device and immediate context, Direct2D device and context (for debug), and the holographic swap chain.
00016     class DeviceResources
00017     {
00018     public:
00019         DeviceResources();
00020
00021         // Public methods related to Direct3D devices.
00022         void HandleDeviceLost();
00023         void RegisterDeviceNotify(IDeviceNotify* deviceNotify);
00024         void Trim();
00025         void Present(Windows::Graphics::Holographic::HolographicFrame^ frame);
00026
00027         // Public methods related to holographic devices.
00028         void SetHolographicSpace(Windows::Graphics::Holographic::HolographicSpace^ space);
00029         void EnsureCameraResources(
00030             Windows::Graphics::Holographic::HolographicFrame^ frame,
00031             Windows::Graphics::Holographic::HolographicFramePrediction^ prediction);
00032
00033         void AddHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00034         void RemoveHolographicCamera(Windows::Graphics::Holographic::HolographicCamera^ camera);
00035
00036         // Holographic accessors.
00037         template<typename RetType, typename LCallback>
00038         RetType                 UseHolographicCameraResources(const LCallback& callback);
00039
00040         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^
00041             GetD3DInteropDevice() const { return m_d3dInteropDevice; }
00042
00043         // D3D accessors.
00044         ID3D11Device4*          GetD3DDevice()          const { return m_d3dDevice.Get(); }
00045         ID3D11DeviceContext3*   GetD3DDeviceContext()   const { return m_d3dContext.Get(); }
00046         D3D_FEATURE_LEVEL       GetDeviceFeatureLevel() const { return m_d3dFeatureLevel; }
00047         bool                    GetDeviceSupportsVprt() const { return m_supportsVprt; }
00048
00049         // DXGI acessors.
00050         IDXGIAdapter3*          GetDXGIAdapter()        const { return m_dxgiAdapter.Get(); }
00051
00052         // D2D accessors.
00053         ID2D1Factory2*          GetD2DFactory()         const { return m_d2dFactory.Get(); }
00054         ID2D1Device1*           GetD2DDevice()          const { return m_d2dDevice.Get(); }
00055         ID2D1DeviceContext1*    GetD2DDeviceContext()   const { return m_d2dContext.Get(); }
00056         IDWriteFactory2*        GetDWriteFactory()      const { return m_dwriteFactory.Get(); }
00057         IWICImagingFactory2*    GetWicImagingFactory()  const { return m_wicFactory.Get(); }
00058         Windows::Foundation::Size                               m_logicalSize;
00059
00060     private:
00061         // Private methods related to the Direct3D device, and resources based on that device.
00062         void CreateDeviceIndependentResources();
00063         void InitializeUsingHolographicSpace();
00064         void CreateDeviceResources();
00065
00066         // Direct3D objects.
00067         Microsoft::WRL::ComPtr<ID3D11Device4>                   m_d3dDevice;
00068         Microsoft::WRL::ComPtr<ID3D11DeviceContext3>            m_d3dContext;
00069         Microsoft::WRL::ComPtr<IDXGIAdapter3>                   m_dxgiAdapter;
00070
00071         // Direct3D interop objects.
00072         Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice^ m_d3dInteropDevice;
00073
00074         // Direct2D factories.
00075         Microsoft::WRL::ComPtr<ID2D1Factory2>                   m_d2dFactory;
00076         Microsoft::WRL::ComPtr<ID2D1Device1>                    m_d2dDevice;
00077         Microsoft::WRL::ComPtr<ID2D1DeviceContext1>             m_d2dContext;
00078         Microsoft::WRL::ComPtr<IDWriteFactory2>                 m_dwriteFactory;
00079         Microsoft::WRL::ComPtr<IWICImagingFactory2>             m_wicFactory;
00080
00081         // The holographic space provides a preferred DXGI adapter ID.
00082         Windows::Graphics::Holographic::HolographicSpace^       m_holographicSpace = nullptr;
00083
00084         // Properties of the Direct3D device currently in use.
00085         D3D_FEATURE_LEVEL                                       m_d3dFeatureLevel = D3D_FEATURE_LEVEL_10_0;
00086
00087         // The IDeviceNotify can be held directly as it owns the DeviceResources.
00088         IDeviceNotify*                                          m_deviceNotify = nullptr;
00089
00090         // Whether or not the current Direct3D device supports the optional feature
00091         // for setting the render target array index from the vertex shader stage.
00092         bool                                                    m_supportsVprt = false;
00093
00094         // Back buffer resources, etc. for attached holographic cameras.
00095         std::map<UINT32, std::unique_ptr<CameraResources>>      m_cameraResources;
00096         std::mutex                                              m_cameraResourcesLock;
00097     };
00098 }
00099
00100 // Device-based resources for holographic cameras are stored in a std::map. Access this list by providing a
00101 // callback to this function, and the std::map will be guarded from add and remove
00102 // events until the callback returns. The callback is processed immediately and must
00103 // not contain any nested calls to UseHolographicCameraResources.
00104 // The callback takes a parameter of type std::map<UINT32, std::unique_ptr<DX::CameraResources>>&
00105 // through which the list of cameras will be accessed.
00106 template<typename RetType, typename LCallback>
00107 RetType DX::DeviceResources::UseHolographicCameraResources(const LCallback& callback)
00108 {
00109     std::lock_guard<std::mutex> guard(m_cameraResourcesLock);
00110     return callback(m_cameraResources);
00111 }
00112
Generated on Fri Nov 15 2024 22:16:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Nfc/Nfc/SampleConfiguration.cs Source File

  • Nfc
  • Nfc

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using NfcSample;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "NFC Sample";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="HCE Tap+Pay", ClassType=typeof(ManageCardScenario)},
00026             new Scenario() { Title="Card Reader", ClassType=typeof(CardReader)},
00027         };
00028     }
00029
00030     public class Scenario
00031     {
00032         public string Title { get; set; }
00033         public Type ClassType { get; set; }
00034     }
00035 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Notifications/cs/BackgroundTasks/Helpers/BadgeHelper.cs Source File

  • Notifications
  • cs
  • BackgroundTasks
  • Helpers

BadgeHelper.cs

Go to the documentation of this file.
00001 ﻿namespace BackgroundTasks.Helpers
00002 {
00003     public static class BadgeHelper
00004     {
00005     }
00006 }
Generated on Fri Nov 15 2024 22:20:34 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1_TrackInWebcam Member List

This is the complete list of members for Scenario1_TrackInWebcam, including all inherited members.
AbandonStreaming() | Scenario1_TrackInWebcam | [inline, private]
busy | Scenario1_TrackInWebcam | [private]
CameraStreamingButton_Click(object sender, RoutedEventArgs e) | Scenario1_TrackInWebcam | [inline, private]
ChangeScenarioStateAsync(ScenarioState newState) | Scenario1_TrackInWebcam | [inline, private]
currentState | Scenario1_TrackInWebcam | [private]
faceTracker | Scenario1_TrackInWebcam | [private]
frameProcessingTimer | Scenario1_TrackInWebcam | [private]
mediaCapture | Scenario1_TrackInWebcam | [private]
MediaCapture_CameraStreamFailed(MediaCapture sender, object args) | Scenario1_TrackInWebcam | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario1_TrackInWebcam | [inline, protected]
OnNavigatedTo(NavigationEventArgs e) | Scenario1_TrackInWebcam | [inline, protected]
OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) | Scenario1_TrackInWebcam | [inline, private]
ProcessCurrentVideoFrame(ThreadPoolTimer timer) | Scenario1_TrackInWebcam | [inline, private]
ProcessCurrentVideoFrameAsync() | Scenario1_TrackInWebcam | [inline, private]
rootPage | Scenario1_TrackInWebcam | [private]
Scenario1_TrackInWebcam() | Scenario1_TrackInWebcam | [inline]
ScenarioState enum name | Scenario1_TrackInWebcam | [private]
SetupVisualization(Windows.Foundation.Size framePixelSize, IList< DetectedFace > foundFaces) | Scenario1_TrackInWebcam | [inline, private]
ShutdownWebcamAsync() | Scenario1_TrackInWebcam | [inline, private]
StartWebcamStreamingAsync() | Scenario1_TrackInWebcam | [inline, private]
videoProperties | Scenario1_TrackInWebcam | [private]
Generated on Fri Nov 15 2024 22:23:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ProxyStubsForWinRTComponents/cpp/cs/Scenario1_OvenClient.xaml.cs Source File

  • ProxyStubsForWinRTComponents
  • cpp
  • cs

Scenario1_OvenClient.xaml.cs

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 //
00005 //*********************************************************
00006
00007 using Microsoft.SDKSamples.Kitchen;
00008
00009 using Windows.Foundation;
00010 using Windows.UI.Xaml;
00011 using Windows.UI.Xaml.Controls;
00012 using Windows.UI.Xaml.Navigation;
00013 using SDKTemplate;
00014 using System;
00015
00016 namespace ProxyStubsForWinRTComponents
00017 {
00018     /// <summary>
00019     /// An empty page that can be used on its own or navigated to within a Frame.
00020     /// </summary>
00021     public sealed partial class OvenClient : Page
00022     {
00023         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00024         // as NotifyUser()
00025         MainPage rootPage = MainPage.Current;
00026
00027         public OvenClient()
00028         {
00029             this.InitializeComponent();
00030         }
00031
00032         /// <summary>
00033         /// Invoked when this page is about to be displayed in a Frame.
00034         /// </summary>
00035         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00036         /// property is typically used to configure the page.</param>
00037         protected override void OnNavigatedTo(NavigationEventArgs e)
00038         {
00039         }
00040
00041         /// <summary>
00042         /// Use the custom Oven and Bread Windows Runtime components.
00043         /// </summary>
00044         /// <param name="sender">Contains information about the button that fired the event.</param>
00045         /// <param name="e">Contains state information and event data associated with a routed event.</param>
00046         private void Start_Click(object sender, RoutedEventArgs e)
00047         {
00048             Dimensions dimensions;
00049             dimensions.Width = 2;
00050             dimensions.Height = 2;
00051             dimensions.Depth = 2;
00052
00053             // Component Creation
00054             Oven myOven = new Oven(dimensions);
00055
00056             // Getters and setters are accessed using property syntax
00057             OvenClientOutput.Text += "Oven volume is: " + myOven.Volume.ToString() + "\n";
00058
00059             // Register even listeners
00060             myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler1);
00061             myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler2);
00062             myOven.BreadBaked += new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);
00063
00064             // Unregister from an event using the -= syntax and a delegate instance
00065             myOven.BreadBaked -= new TypedEventHandler<Oven, Bread>(BreadCompletedHandler3);
00066
00067             // Bake a loaf of bread. This will trigger the BreadBaked event.
00068             myOven.BakeBread("Sourdough");
00069
00070             // Trigger the event again with a different preheat time
00071             myOven.ConfigurePreheatTemperature(OvenTemperature.High);
00072             myOven.BakeBread("Wheat");
00073         }
00074
00075         async private void BreadCompletedHandler1(Oven oven, Bread bread)
00076         {
00077             Action updateOutputText = () =>
00078                 {
00079                     OvenClientOutput.Text += "Event Handler 1: Invoked\n";
00080                     OvenClientOutput.Text += "Event Handler 1: Oven volume is: " + oven.Volume.ToString() + "\n";
00081                     OvenClientOutput.Text += "Event Handler 1: Bread flavor is: " + bread.Flavor + "\n";
00082                 };
00083
00084             if (OvenClientOutput.Dispatcher.HasThreadAccess)
00085             {
00086                 // If the current thread is the UI thread then execute the lambda.
00087                 updateOutputText();
00088             }
00089             else
00090             {
00091                 // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00092                 await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00093             }
00094         }
00095
00096         async private void BreadCompletedHandler2(Oven oven, Bread bread)
00097         {
00098             Action updateOutputText = () =>
00099                 {
00100                     OvenClientOutput.Text += "Event Handler 2: Invoked\n";
00101                 };
00102
00103             if (OvenClientOutput.Dispatcher.HasThreadAccess)
00104             {
00105                 // If the current thread is the UI thread then execute the lambda.
00106                 updateOutputText();
00107             }
00108             else
00109             {
00110                 // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00111                 await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00112             }
00113         }
00114
00115         async private void BreadCompletedHandler3(Oven oven, Bread bread)
00116         {
00117             // Event handler 3 was removed and will not be invoked
00118             Action updateOutputText = () =>
00119                 {
00120                     OvenClientOutput.Text += "Event Handler 3: Invoked\n";
00121                 };
00122
00123             if (OvenClientOutput.Dispatcher.HasThreadAccess)
00124             {
00125                 // If the current thread is the UI thread then execute the lambda.
00126                 updateOutputText();
00127             }
00128             else
00129             {
00130                 // If the current thread is not the UI thread use the dispatcher to execute the lambda on the UI thread.
00131                 await OvenClientOutput.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(updateOutputText));
00132             }
00133         }
00134     }
00135 }
Generated on Fri Nov 15 2024 22:21:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FullScreenMode/cpp/pch.h Source File

  • FullScreenMode
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SlowInputStream Member List

This is the complete list of members for SlowInputStream, including all inherited members.
Close() | SlowInputStream | [inline]
m_length | SlowInputStream | [private]
m_position | SlowInputStream | [private]
ReadAsync(Windows::Storage::Streams::IBuffer buffer, uint32_t count, Windows::Storage::Streams::InputStreamOptions options) | SlowInputStream |
SlowInputStream(uint32_t length) | SlowInputStream | [inline]
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BluetoothRfcommChat/cs/Scenario1_ChatClient.xaml.cs Source File

  • BluetoothRfcommChat
  • cs

Scenario1_ChatClient.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.ObjectModel;
00014 using System.ComponentModel;
00015 using Windows.Devices.Bluetooth;
00016 using Windows.Devices.Bluetooth.Rfcomm;
00017 using Windows.Devices.Enumeration;
00018 using Windows.Foundation;
00019 using Windows.Networking.Sockets;
00020 using Windows.Storage.Streams;
00021 using Windows.UI.Core;
00022 using Windows.UI.Xaml;
00023 using Windows.UI.Xaml.Controls;
00024 using Windows.UI.Xaml.Input;
00025 using Windows.UI.Xaml.Media.Imaging;
00026 using Windows.UI.Xaml.Navigation;
00027
00028 namespace SDKTemplate
00029 {
00030     public sealed partial class Scenario1_ChatClient : Page
00031     {
00032         // A pointer back to the main page is required to display status messages.
00033         private MainPage rootPage = MainPage.Current;
00034
00035         // Used to display list of available devices to chat with
00036         public ObservableCollection<RfcommChatDeviceDisplay> ResultCollection
00037         {
00038             get;
00039             private set;
00040         }
00041
00042         private DeviceWatcher deviceWatcher = null;
00043         private StreamSocket chatSocket = null;
00044         private DataWriter chatWriter = null;
00045         private RfcommDeviceService chatService = null;
00046         private BluetoothDevice bluetoothDevice;
00047
00048         public Scenario1_ChatClient()
00049         {
00050             this.InitializeComponent();
00051             App.Current.Suspending += App_Suspending;
00052         }
00053
00054         protected override void OnNavigatedTo(NavigationEventArgs e)
00055         {
00056             rootPage = MainPage.Current;
00057             ResultCollection = new ObservableCollection<RfcommChatDeviceDisplay>();
00058             DataContext = this;
00059         }
00060
00061         protected override void OnNavigatedFrom(NavigationEventArgs e)
00062         {
00063             StopWatcher();
00064         }
00065
00066         private void StopWatcher()
00067         {
00068             if (null != deviceWatcher)
00069             {
00070                 if ((DeviceWatcherStatus.Started == deviceWatcher.Status ||
00071                      DeviceWatcherStatus.EnumerationCompleted == deviceWatcher.Status))
00072                 {
00073                     deviceWatcher.Stop();
00074                 }
00075                 deviceWatcher = null;
00076             }
00077         }
00078
00079         void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
00080         {
00081             // Make sure we clean up resources on suspend.
00082             Disconnect("App Suspension disconnects");
00083         }
00084
00085         /// <summary>
00086         /// When the user presses the run button, query for all nearby unpaired devices
00087         /// Note that in this case, the other device must be running the Rfcomm Chat Server before being paired.
00088         /// </summary>
00089         /// <param name="sender">Instance that triggered the event.</param>
00090         /// <param name="e">Event data describing the conditions that led to the event.</param>
00091         private void RunButton_Click(object sender, RoutedEventArgs e)
00092         {
00093             if (deviceWatcher == null)
00094             {
00095                 SetDeviceWatcherUI();
00096                 StartUnpairedDeviceWatcher();
00097             }
00098             else
00099             {
00100                 ResetMainUI();
00101             }
00102         }
00103
00104         private void SetDeviceWatcherUI()
00105         {
00106             // Disable the button while we do async operations so the user can't Run twice.
00107             RunButton.Content = "Stop";
00108             rootPage.NotifyUser("Device watcher started", NotifyType.StatusMessage);
00109             resultsListView.Visibility = Visibility.Visible;
00110             resultsListView.IsEnabled = true;
00111         }
00112
00113         private void ResetMainUI()
00114         {
00115             RunButton.Content = "Start";
00116             RunButton.IsEnabled = true;
00117             ConnectButton.Visibility = Visibility.Visible;
00118             resultsListView.Visibility = Visibility.Visible;
00119             resultsListView.IsEnabled = true;
00120
00121             // Re-set device specific UX
00122             ChatBox.Visibility = Visibility.Collapsed;
00123             RequestAccessButton.Visibility = Visibility.Collapsed;
00124             if (ConversationList.Items != null) ConversationList.Items.Clear();
00125             StopWatcher();
00126         }
00127
00128         private void StartUnpairedDeviceWatcher()
00129         {
00130             // Request additional properties
00131             string[] requestedProperties = new string[] { "System.Devices.Aep.DeviceAddress", "System.Devices.Aep.IsConnected" };
00132
00133             deviceWatcher = DeviceInformation.CreateWatcher("(System.Devices.Aep.ProtocolId:=\"{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\")",
00134                                                             requestedProperties,
00135                                                             DeviceInformationKind.AssociationEndpoint);
00136
00137             // Hook up handlers for the watcher events before starting the watcher
00138             deviceWatcher.Added += new TypedEventHandler<DeviceWatcher, DeviceInformation>(async (watcher, deviceInfo) =>
00139             {
00140                 // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00141                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00142                 {
00143                     // Make sure device name isn't blank
00144                     if(deviceInfo.Name != "")
00145                     {
00146                         ResultCollection.Add(new RfcommChatDeviceDisplay(deviceInfo));
00147                         rootPage.NotifyUser(
00148                             String.Format("{0} devices found.", ResultCollection.Count),
00149                             NotifyType.StatusMessage);
00150                     }
00151
00152                 });
00153             });
00154
00155             deviceWatcher.Updated += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(async (watcher, deviceInfoUpdate) =>
00156             {
00157                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00158                 {
00159                     foreach (RfcommChatDeviceDisplay rfcommInfoDisp in ResultCollection)
00160                     {
00161                         if (rfcommInfoDisp.Id == deviceInfoUpdate.Id)
00162                         {
00163                             rfcommInfoDisp.Update(deviceInfoUpdate);
00164                             break;
00165                         }
00166                     }
00167                 });
00168             });
00169
00170             deviceWatcher.EnumerationCompleted += new TypedEventHandler<DeviceWatcher, Object>(async (watcher, obj) =>
00171             {
00172                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00173                 {
00174                     rootPage.NotifyUser(
00175                         String.Format("{0} devices found. Enumeration completed. Watching for updates...", ResultCollection.Count),
00176                         NotifyType.StatusMessage);
00177                 });
00178             });
00179
00180             deviceWatcher.Removed += new TypedEventHandler<DeviceWatcher, DeviceInformationUpdate>(async (watcher, deviceInfoUpdate) =>
00181             {
00182                 // Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
00183                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00184                 {
00185                     // Find the corresponding DeviceInformation in the collection and remove it
00186                     foreach (RfcommChatDeviceDisplay rfcommInfoDisp in ResultCollection)
00187                     {
00188                         if (rfcommInfoDisp.Id == deviceInfoUpdate.Id)
00189                         {
00190                             ResultCollection.Remove(rfcommInfoDisp);
00191                             break;
00192                         }
00193                     }
00194
00195                     rootPage.NotifyUser(
00196                         String.Format("{0} devices found.", ResultCollection.Count),
00197                         NotifyType.StatusMessage);
00198                 });
00199             });
00200
00201             deviceWatcher.Stopped += new TypedEventHandler<DeviceWatcher, Object>(async (watcher, obj) =>
00202             {
00203                 await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
00204                 {
00205                     ResultCollection.Clear();
00206                 });
00207             });
00208
00209             deviceWatcher.Start();
00210         }
00211
00212         /// <summary>
00213         /// Invoked once the user has selected the device to connect to.
00214         /// Once the user has selected the device,
00215         /// </summary>
00216         /// <param name="sender"></param>
00217         /// <param name="e"></param>
00218         private async void ConnectButton_Click(object sender, RoutedEventArgs e)
00219         {
00220             // Make sure user has selected a device first
00221             if (resultsListView.SelectedItem != null)
00222             {
00223                 rootPage.NotifyUser("Connecting to remote device. Please wait...", NotifyType.StatusMessage);
00224             }
00225             else
00226             {
00227                 rootPage.NotifyUser("Please select an item to connect to", NotifyType.ErrorMessage);
00228                 return;
00229             }
00230
00231             RfcommChatDeviceDisplay deviceInfoDisp = resultsListView.SelectedItem as RfcommChatDeviceDisplay;
00232
00233             // Perform device access checks before trying to get the device.
00234             // First, we check if consent has been explicitly denied by the user.
00235             DeviceAccessStatus accessStatus = DeviceAccessInformation.CreateFromId(deviceInfoDisp.Id).CurrentStatus;
00236             if (accessStatus == DeviceAccessStatus.DeniedByUser)
00237             {
00238                 rootPage.NotifyUser("This app does not have access to connect to the remote device (please grant access in Settings > Privacy > Other Devices", NotifyType.ErrorMessage);
00239                 return;
00240             }
00241             // If not, try to get the Bluetooth device
00242             try
00243             {
00244                 bluetoothDevice = await BluetoothDevice.FromIdAsync(deviceInfoDisp.Id);
00245             }
00246             catch (Exception ex)
00247             {
00248                 rootPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
00249                 ResetMainUI();
00250                 return;
00251             }
00252             // If we were unable to get a valid Bluetooth device object,
00253             // it's most likely because the user has specified that all unpaired devices
00254             // should not be interacted with.
00255             if (bluetoothDevice == null)
00256             {
00257                 rootPage.NotifyUser("Bluetooth Device returned null. Access Status = " + accessStatus.ToString(), NotifyType.ErrorMessage);
00258             }
00259
00260             // This should return a list of uncached Bluetooth services (so if the server was not active when paired, it will still be detected by this call
00261             var rfcommServices = await bluetoothDevice.GetRfcommServicesForIdAsync(
00262                 RfcommServiceId.FromUuid(Constants.RfcommChatServiceUuid), BluetoothCacheMode.Uncached);
00263
00264             if (rfcommServices.Services.Count > 0)
00265             {
00266                 chatService = rfcommServices.Services[0];
00267             }
00268             else
00269             {
00270                 rootPage.NotifyUser(
00271                    "Could not discover the chat service on the remote device",
00272                    NotifyType.StatusMessage);
00273                 ResetMainUI();
00274                 return;
00275             }
00276
00277             // Do various checks of the SDP record to make sure you are talking to a device that actually supports the Bluetooth Rfcomm Chat Service
00278             var attributes = await chatService.GetSdpRawAttributesAsync();
00279             if (!attributes.ContainsKey(Constants.SdpServiceNameAttributeId))
00280             {
00281                 rootPage.NotifyUser(
00282                     "The Chat service is not advertising the Service Name attribute (attribute id=0x100). " +
00283                     "Please verify that you are running the BluetoothRfcommChat server.",
00284                     NotifyType.ErrorMessage);
00285                 ResetMainUI();
00286                 return;
00287             }
00288             var attributeReader = DataReader.FromBuffer(attributes[Constants.SdpServiceNameAttributeId]);
00289             var attributeType = attributeReader.ReadByte();
00290             if (attributeType != Constants.SdpServiceNameAttributeType)
00291             {
00292                 rootPage.NotifyUser(
00293                     "The Chat service is using an unexpected format for the Service Name attribute. " +
00294                     "Please verify that you are running the BluetoothRfcommChat server.",
00295                     NotifyType.ErrorMessage);
00296                 ResetMainUI();
00297                 return;
00298             }
00299             var serviceNameLength = attributeReader.ReadByte();
00300
00301             // The Service Name attribute requires UTF-8 encoding.
00302             attributeReader.UnicodeEncoding = UnicodeEncoding.Utf8;
00303
00304             StopWatcher();
00305
00306             lock (this)
00307             {
00308                 chatSocket = new StreamSocket();
00309             }
00310             try
00311             {
00312                 await chatSocket.ConnectAsync(chatService.ConnectionHostName, chatService.ConnectionServiceName);
00313
00314                 SetChatUI(attributeReader.ReadString(serviceNameLength), bluetoothDevice.Name);
00315                 chatWriter = new DataWriter(chatSocket.OutputStream);
00316
00317                 DataReader chatReader = new DataReader(chatSocket.InputStream);
00318                 ReceiveStringLoop(chatReader);
00319             }
00320             catch (Exception ex) when ((uint)ex.HResult == 0x80070490) // ERROR_ELEMENT_NOT_FOUND
00321             {
00322                 rootPage.NotifyUser("Please verify that you are running the BluetoothRfcommChat server.", NotifyType.ErrorMessage);
00323                 ResetMainUI();
00324             }
00325             catch (Exception ex) when ((uint)ex.HResult == 0x80072740) // WSAEADDRINUSE
00326             {
00327                 rootPage.NotifyUser("Please verify that there is no other RFCOMM connection to the same device.", NotifyType.ErrorMessage);
00328                 ResetMainUI();
00329             }
00330         }
00331
00332         /// <summary>
00333         ///  If you believe the Bluetooth device will eventually be paired with Windows,
00334         ///  you might want to pre-emptively get consent to access the device.
00335         ///  An explicit call to RequestAccessAsync() prompts the user for consent.
00336         ///  If this is not done, a device that's working before being paired,
00337         ///  will no longer work after being paired.
00338         /// </summary>
00339         /// <param name="sender"></param>
00340         /// <param name="e"></param>
00341         private async void RequestAccessButton_Click(object sender, RoutedEventArgs e)
00342         {
00343             // Make sure user has given consent to access device
00344             DeviceAccessStatus accessStatus = await bluetoothDevice.RequestAccessAsync();
00345
00346             if (accessStatus != DeviceAccessStatus.Allowed)
00347             {
00348                 rootPage.NotifyUser(
00349                     "Access to the device is denied because the application was not granted access",
00350                     NotifyType.StatusMessage);
00351             }
00352             else
00353             {
00354                 rootPage.NotifyUser(
00355                                     "Access granted, you are free to pair devices",
00356                                     NotifyType.StatusMessage);
00357             }
00358         }
00359         private void SendButton_Click(object sender, RoutedEventArgs e)
00360         {
00361             SendMessage();
00362         }
00363
00364         public void KeyboardKey_Pressed(object sender, KeyRoutedEventArgs e)
00365         {
00366             if (e.Key == Windows.System.VirtualKey.Enter)
00367             {
00368                 SendMessage();
00369             }
00370         }
00371
00372         /// <summary>
00373         /// Takes the contents of the MessageTextBox and writes it to the outgoing chatWriter
00374         /// </summary>
00375         private async void SendMessage()
00376         {
00377             try
00378             {
00379                 if (MessageTextBox.Text.Length != 0)
00380                 {
00381                     chatWriter.WriteUInt32((uint)MessageTextBox.Text.Length);
00382                     chatWriter.WriteString(MessageTextBox.Text);
00383
00384                     ConversationList.Items.Add("Sent: " + MessageTextBox.Text);
00385                     MessageTextBox.Text = "";
00386                     await chatWriter.StoreAsync();
00387
00388                 }
00389             }
00390             catch (Exception ex) when ((uint)ex.HResult == 0x80072745)
00391             {
00392                 // The remote device has disconnected the connection
00393                 rootPage.NotifyUser("Remote side disconnect: " + ex.HResult.ToString() + " - " + ex.Message,
00394                     NotifyType.StatusMessage);
00395             }
00396         }
00397
00398         private async void ReceiveStringLoop(DataReader chatReader)
00399         {
00400             try
00401             {
00402                 uint size = await chatReader.LoadAsync(sizeof(uint));
00403                 if (size < sizeof(uint))
00404                 {
00405                     Disconnect("Remote device terminated connection - make sure only one instance of server is running on remote device");
00406                     return;
00407                 }
00408
00409                 uint stringLength = chatReader.ReadUInt32();
00410                 uint actualStringLength = await chatReader.LoadAsync(stringLength);
00411                 if (actualStringLength != stringLength)
00412                 {
00413                     // The underlying socket was closed before we were able to read the whole data
00414                     return;
00415                 }
00416
00417                 ConversationList.Items.Add("Received: " + chatReader.ReadString(stringLength));
00418
00419                 ReceiveStringLoop(chatReader);
00420             }
00421             catch (Exception ex)
00422             {
00423                 lock (this)
00424                 {
00425                     if (chatSocket == null)
00426                     {
00427                         // Do not print anything here -  the user closed the socket.
00428                         if ((uint)ex.HResult == 0x80072745)
00429                             rootPage.NotifyUser("Disconnect triggered by remote device", NotifyType.StatusMessage);
00430                         else if ((uint)ex.HResult == 0x800703E3)
00431                             rootPage.NotifyUser("The I/O operation has been aborted because of either a thread exit or an application request.", NotifyType.StatusMessage);
00432                     }
00433                     else
00434                     {
00435                         Disconnect("Read stream failed with error: " + ex.Message);
00436                     }
00437                 }
00438             }
00439         }
00440
00441         private void DisconnectButton_Click(object sender, RoutedEventArgs e)
00442         {
00443             Disconnect("Disconnected");
00444         }
00445
00446
00447         /// <summary>
00448         /// Cleans up the socket and DataWriter and reset the UI
00449         /// </summary>
00450         /// <param name="disconnectReason"></param>
00451         private void Disconnect(string disconnectReason)
00452         {
00453             if (chatWriter != null)
00454             {
00455                 chatWriter.DetachStream();
00456                 chatWriter = null;
00457             }
00458
00459
00460             if (chatService != null)
00461             {
00462                 chatService.Dispose();
00463                 chatService = null;
00464             }
00465             lock (this)
00466             {
00467                 if (chatSocket != null)
00468                 {
00469                     chatSocket.Dispose();
00470                     chatSocket = null;
00471                 }
00472             }
00473
00474             rootPage.NotifyUser(disconnectReason, NotifyType.StatusMessage);
00475             ResetMainUI();
00476         }
00477
00478         private void SetChatUI(string serviceName, string deviceName)
00479         {
00480             rootPage.NotifyUser("Connected", NotifyType.StatusMessage);
00481             ServiceName.Text = "Service Name: " + serviceName;
00482             DeviceName.Text = "Connected to: " + deviceName;
00483             RunButton.IsEnabled = false;
00484             ConnectButton.Visibility = Visibility.Collapsed;
00485             RequestAccessButton.Visibility = Visibility.Visible;
00486             resultsListView.IsEnabled = false;
00487             resultsListView.Visibility = Visibility.Collapsed;
00488             ChatBox.Visibility = Visibility.Visible;
00489         }
00490
00491         private void ResultsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
00492         {
00493             UpdatePairingButtons();
00494         }
00495
00496         private void UpdatePairingButtons()
00497         {
00498             RfcommChatDeviceDisplay deviceDisp = (RfcommChatDeviceDisplay)resultsListView.SelectedItem;
00499
00500             if (null != deviceDisp)
00501             {
00502                 ConnectButton.IsEnabled = true;
00503             }
00504             else
00505             {
00506                 ConnectButton.IsEnabled = false;
00507             }
00508         }
00509     }
00510
00511     public class RfcommChatDeviceDisplay : INotifyPropertyChanged
00512     {
00513         private DeviceInformation deviceInfo;
00514
00515         public RfcommChatDeviceDisplay(DeviceInformation deviceInfoIn)
00516         {
00517             deviceInfo = deviceInfoIn;
00518             UpdateGlyphBitmapImage();
00519         }
00520
00521         public DeviceInformation DeviceInformation
00522         {
00523             get
00524             {
00525                 return deviceInfo;
00526             }
00527
00528             private set
00529             {
00530                 deviceInfo = value;
00531             }
00532         }
00533
00534         public string Id
00535         {
00536             get
00537             {
00538                 return deviceInfo.Id;
00539             }
00540         }
00541
00542         public string Name
00543         {
00544             get
00545             {
00546                 return deviceInfo.Name;
00547             }
00548         }
00549
00550         public BitmapImage GlyphBitmapImage
00551         {
00552             get;
00553             private set;
00554         }
00555
00556         public void Update(DeviceInformationUpdate deviceInfoUpdate)
00557         {
00558             deviceInfo.Update(deviceInfoUpdate);
00559             UpdateGlyphBitmapImage();
00560         }
00561
00562         private async void UpdateGlyphBitmapImage()
00563         {
00564             DeviceThumbnail deviceThumbnail = await deviceInfo.GetGlyphThumbnailAsync();
00565             BitmapImage glyphBitmapImage = new BitmapImage();
00566             await glyphBitmapImage.SetSourceAsync(deviceThumbnail);
00567             GlyphBitmapImage = glyphBitmapImage;
00568             OnPropertyChanged("GlyphBitmapImage");
00569         }
00570
00571         public event PropertyChangedEventHandler PropertyChanged;
00572         protected void OnPropertyChanged(string name)
00573         {
00574             PropertyChangedEventHandler handler = PropertyChanged;
00575             if (handler != null)
00576             {
00577                 handler(this, new PropertyChangedEventArgs(name));
00578             }
00579         }
00580     }
00581 }
Generated on Fri Nov 15 2024 22:18:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: StreamSocket/cpp/pch.h Source File

  • StreamSocket
  • cpp

pch.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // pch.h
00014 // Header for standard system include files.
00015 //
00016
00017 #pragma once
00018
00019 #include <ppltasks.h>
00020 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: EnterpriseDataProtection/cs/SampleConfiguration.cs Source File

  • EnterpriseDataProtection
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015 using EdpSample;
00016
00017 namespace SDKTemplate
00018 {
00019     public partial class MainPage : Page
00020     {
00021         public const string FEATURE_NAME = "EdpSample";
00022
00023         List<Scenario> scenarios = new List<Scenario>
00024         {
00025             new Scenario() { Title="Setup", ClassType=typeof(Scenario1)},
00026             new Scenario() { Title="IsIdentityManaged scenario", ClassType=typeof(Scenario2)},
00027             new Scenario() { Title="UI Policy scenarios", ClassType=typeof(Scenario3)},
00028             new Scenario() { Title="FileProtection scenarios", ClassType=typeof(Scenario4)},
00029             new Scenario() { Title="Revoke scenarios", ClassType=typeof(Scenario5)},
00030             new Scenario() { Title="Buffer protection scenarios", ClassType=typeof(Scenario6)},
00031             new Scenario() { Title="Stream protection scenarios", ClassType=typeof(Scenario7)},
00032             new Scenario() { Title="Set Clipboard Source", ClassType=typeof(Scenario8_ClipboardSource)},
00033             new Scenario() { Title="Set Clipboard Target", ClassType=typeof(Scenario9_ClipboardTarget)},
00034             new Scenario() { Title="Copy to Clipboard", ClassType=typeof(Scenario10_CpToClipboard)},
00035             new Scenario() { Title="Paste to New Doc", ClassType=typeof(Scenario11_CPDNoUI)},
00036             new Scenario() { Title="Set Share source", ClassType=typeof(Scenario12_ShareData)},
00037             new Scenario() { Title="Set Share target", ClassType=typeof(Scenario13_ShareTarget)},
00038             new Scenario() { Title="Query Copy Paste", ClassType=typeof(Scenario14_QueryCpPaste)},
00039             new Scenario() { Title="Data protection under Lock", ClassType=typeof(Scenario15_DPLCreateFileEvents)},
00040             new Scenario() { Title="Get Network Resource", ClassType=typeof(Scenario16_NetworkResource)},
00041         };
00042     }
00043
00044     public class Scenario
00045     {
00046         public string Title { get; set; }
00047         public Type ClassType { get; set; }
00048     }
00049 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ShutdownFunc Member List

This is the complete list of members for ShutdownFunc, including all inherited members.
operator()(IMFStreamSink *pStream) const ShutdownFunc [inline]
Generated on Fri Nov 15 2024 22:23:11 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_BackgroundTask Member List

This is the complete list of members for Scenario3_BackgroundTask, including all inherited members.
BackgroundTaskEntryPoint | Scenario3_BackgroundTask | [private, static]
BackgroundTaskName | Scenario3_BackgroundTask | [private, static]
m_geolocTask | Scenario3_BackgroundTask | [private]
OnCompleted(Windows::ApplicationModel::Background::IBackgroundTaskRegistration sender, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs e) | Scenario3_BackgroundTask | [private]
OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3_BackgroundTask |
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario3_BackgroundTask |
RegisterBackgroundTask(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_BackgroundTask |
Scenario3_BackgroundTask() | Scenario3_BackgroundTask |
UnregisterBackgroundTask(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario3_BackgroundTask |
UpdateButtonStates() | Scenario3_BackgroundTask | [private]
Generated on Fri Nov 15 2024 22:24:17 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Templates Member List

This is the complete list of members for Templates, including all inherited members.
Templates() Templates [inline]
Generated on Fri Nov 15 2024 22:24:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CameraStreamCoordinateMapper/cpp/Content/CameraStreamProcessor.h Source File

  • CameraStreamCoordinateMapper
  • cpp
  • Content

CameraStreamProcessor.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 namespace CameraStreamCoordinateMapper
00015 {
00016     ////////////////////////////////////////////////////////////////////////////////
00017     // CameraStreamProcessor
00018     //
00019     // This class is mostly a helper for accessing the MediaFrameReader class
00020     // and change the frame arrival events into a polling pattern
00021     //
00022     // So instead of listening for an event "FrameArrived", you can just query
00023     // with "GetLatestFrame" and check the index to see if you have seen it yet
00024
00025     class CameraStreamProcessor
00026     {
00027     public:
00028         struct FrameData
00029         {
00030             Windows::Media::Capture::Frames::MediaFrameReference^ frame;
00031             uint32_t index;
00032         };
00033
00034         static Concurrency::task<std::shared_ptr<CameraStreamProcessor>> CreateAndStartAsync(
00035             Windows::Media::Capture::Frames::MediaFrameSourceKind sourceKind,
00036             Platform::String^ format,
00037             Windows::Media::Capture::MediaCaptureMemoryPreference memoryPreference = Windows::Media::Capture::MediaCaptureMemoryPreference::Cpu);
00038
00039         CameraStreamProcessor(
00040             Windows::Media::Capture::Frames::MediaFrameSourceKind sourceKind,
00041             Platform::String^ format,
00042             Windows::Media::Capture::MediaCaptureMemoryPreference memoryPreference);
00043
00044         ~CameraStreamProcessor();
00045
00046         FrameData GetLatestFrame() const;
00047
00048         concurrency::task<void> StartAsync();
00049         concurrency::task<void> StopAsync();
00050
00051         bool IsStreaming() const;
00052
00053         void OnFrameArrived(
00054             Windows::Media::Capture::Frames::MediaFrameReader^ sender,
00055             Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs^ args);
00056
00057     private:
00058         // Media Capture
00059         Windows::Media::Capture::Frames::MediaFrameSourceKind  m_sourceKind;
00060         Platform::String^                                      m_sourceFormat;
00061         Windows::Media::Capture::MediaCaptureMemoryPreference  m_memoryPreference;
00062
00063         Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCapture;
00064         Windows::Media::Capture::Frames::MediaFrameReader^     m_mediaFrameReader;
00065
00066         mutable std::shared_mutex                              m_lock;
00067
00068         std::atomic<bool>                                      m_isStreaming = false;
00069
00070         FrameData                                              m_latestFrameData;
00071
00072         Windows::Foundation::EventRegistrationToken            m_frameArrivedToken;
00073
00074         uint32_t                                               m_frameCount = 0u;
00075     };
00076 }
Generated on Fri Nov 15 2024 22:18:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/SharePage.cpp Source File

  • ShareSource
  • cpp

SharePage.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // SharePage.cpp
00014 // Implementation of the SharePage class
00015 //
00016
00017 #include "pch.h"
00018 #include "SharePage.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Foundation;
00024 using namespace Windows::UI::Xaml;
00025 using namespace Windows::UI::Xaml::Navigation;
00026 using namespace Windows::ApplicationModel::DataTransfer;
00027
00028 void SharePage::OnNavigatedTo(NavigationEventArgs^ e)
00029 {
00030     DataTransferManager^ dataTransferManager = DataTransferManager::GetForCurrentView();
00031
00032     // Register the current page as a share source.
00033     dataRequestedToken = dataTransferManager->DataRequested += ref new TypedEventHandler<DataTransferManager^, DataRequestedEventArgs^>(this, &SharePage::OnDataRequested);
00034
00035     // Request to be notified when the user chooses a share target app.
00036     targetApplicationChosenToken = dataTransferManager->TargetApplicationChosen += ref new TypedEventHandler<DataTransferManager^, TargetApplicationChosenEventArgs^>(this, &SharePage::OnTargetApplicationChosen);
00037 }
00038
00039 void SharePage::OnNavigatedFrom(NavigationEventArgs^ e)
00040 {
00041     // Unregister our event handlers.
00042     DataTransferManager^ dataTransferManager = DataTransferManager::GetForCurrentView();
00043     dataTransferManager->DataRequested -= dataRequestedToken;
00044     dataTransferManager->TargetApplicationChosen -= targetApplicationChosenToken;
00045 }
00046
00047 // When share is invoked (by the user or programatically) the event handler we registered will be called to populate the datapackage with the
00048 // data to be shared.
00049 void SharePage::OnDataRequested(DataTransferManager^ sender, DataRequestedEventArgs^ e)
00050 {
00051     // Register to be notified if the share operation completes.
00052     e->Request->Data->ShareCompleted += ref new TypedEventHandler<DataPackage^, ShareCompletedEventArgs^>(this, &SharePage::OnShareCompleted);
00053
00054     // Call the scenario specific function to populate the datapackage with the data to be shared.
00055     if (GetShareContent(e->Request))
00056     {
00057         // Out of the datapackage properties, the title is required. If the scenario completed successfully, we need
00058         // to make sure the title is valid since the sample scenario gets the title from the user.
00059         if (e->Request->Data->Properties->Title == nullptr)
00060         {
00061             e->Request->FailWithDisplayText(MainPage::MissingTitleError);
00062         }
00063     }
00064 }
00065
00066 void SharePage::OnTargetApplicationChosen(DataTransferManager^ sender, TargetApplicationChosenEventArgs^ e)
00067 {
00068     this->rootPage->NotifyUser("User chose " + e->ApplicationName, NotifyType::StatusMessage);
00069 }
00070
00071 void SharePage::OnShareCompleted(DataPackage^ sender, ShareCompletedEventArgs^ e)
00072 {
00073     String^ shareCompletedStatus = "Shared successfully. ";
00074
00075     // Typically, this information is not displayed to the user because the
00076     // user already knows which share target was selected.
00077     if (!e->ShareTarget->AppUserModelId->IsEmpty())
00078     {
00079         // The user picked an app.
00080         shareCompletedStatus += "Target: App \"" + e->ShareTarget->AppUserModelId + "\"";
00081     }
00082     else if (e->ShareTarget->ShareProvider != nullptr)
00083     {
00084         // The user picked a ShareProvider.
00085         shareCompletedStatus += "Target: Share Provider \"" + e->ShareTarget->ShareProvider->Title + "\"";
00086     }
00087
00088     this->rootPage->NotifyUser(shareCompletedStatus, NotifyType::StatusMessage);
00089 }
00090
00091 void SharePage::ShowUIButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00092 {
00093     // If the user clicks the share button, invoke the share flow programatically.
00094     Windows::ApplicationModel::DataTransfer::DataTransferManager::ShowShareUI();
00095 }
00096
00097 // This function is implemented by each scenario to share the content specific to that scenario (text, link, image, etc.).
00098 bool SharePage::GetShareContent(DataRequest^ request)
00099 {
00100     request->FailWithDisplayText("Scenario specific class must override GetShareContent");
00101     return false;
00102 }
00103
00104 Windows::Foundation::Uri^ SharePage::GetApplicationLink(String^ sharePageFullName)
00105 {
00106     return ref new Uri("ms-sdk-sharesourcecpp:navigate?page=" + sharePageFullName);
00107 }
Generated on Fri Nov 15 2024 22:21:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario04 Member List

This is the complete list of members for Scenario04, including all inherited members.
OnNavigatedTo(NavigationEventArgs e) | Scenario04 | [inline, protected]
originalPosition | Scenario04 | [private]
Player_CurrentStateChanged(object sender, RoutedEventArgs e) | Scenario04 | [inline, private]
Player_MediaEnded(object sender, RoutedEventArgs e) | Scenario04 | [inline, private]
Player_MediaFailed(object sender, ExceptionRoutedEventArgs e) | Scenario04 | [inline, private]
Player_MediaOpened(object sender, RoutedEventArgs e) | Scenario04 | [inline, private]
rootPage | Scenario04 | [private]
RootPage_SizeChanged(object sender, SizeChangedEventArgs e) | Scenario04 | [inline, private]
Scenario04() | Scenario04 | [inline]
video | Scenario04 | [private]
Generated on Fri Nov 15 2024 22:23:36 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ConnectTask Member List

This is the complete list of members for ConnectTask, including all inherited members.
DisplayToast(const winrt::hstring &ssid) | ConnectTask
Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const &taskInstance) | ConnectTask
Generated on Fri Nov 15 2024 22:24:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Accelerometer/cpp/Scenario1_DataEvents.xaml.cpp Source File

  • Accelerometer
  • cpp

Scenario1_DataEvents.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1_DataEvents.xaml.cpp
00014 // Implementation of the Scenario1_DataEvents class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario1_DataEvents.xaml.h"
00019
00020 using namespace SDKTemplate;
00021
00022 using namespace Platform;
00023 using namespace Windows::Devices::Sensors;
00024 using namespace Windows::Foundation;
00025 using namespace Windows::UI::Core;
00026 using namespace Windows::UI::Xaml;
00027 using namespace Windows::UI::Xaml::Controls;
00028 using namespace Windows::UI::Xaml::Navigation;
00029
00030 Scenario1_DataEvents::Scenario1_DataEvents()
00031 {
00032     InitializeComponent();
00033 }
00034
00035 void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
00036 {
00037     accelerometer = Accelerometer::GetDefault(rootPage->AccelerometerReadingType);
00038     if (accelerometer != nullptr)
00039     {
00040         rootPage->NotifyUser(rootPage->AccelerometerReadingType.ToString() + " accelerometer ready", NotifyType::StatusMessage);
00041         ScenarioEnableButton->IsEnabled = true;
00042     }
00043     else
00044     {
00045         rootPage->NotifyUser(rootPage->AccelerometerReadingType.ToString() + " accelerometer not found", NotifyType::ErrorMessage);
00046     }
00047 }
00048
00049 void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
00050 {
00051     if (ScenarioDisableButton->IsEnabled)
00052     {
00053         ScenarioDisable();
00054     }
00055 }
00056
00057 /// <summary>
00058 /// This is the event handler for VisibilityChanged events. You would register for these notifications
00059 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
00060 /// </summary>
00061 /// <param name="sender"></param>
00062 /// <param name="e">
00063 /// Event data that can be examined for the current visibility state.
00064 /// </param>
00065 void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEventArgs^ e)
00066 {
00067     // The app should watch for VisibilityChanged events to disable and re-enable sensor input as appropriate
00068     if (ScenarioDisableButton->IsEnabled)
00069     {
00070         if (e->Visible)
00071         {
00072             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
00073             readingToken = accelerometer->ReadingChanged += ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);
00074         }
00075         else
00076         {
00077             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
00078             accelerometer->ReadingChanged -= readingToken;
00079         }
00080     }
00081 }
00082
00083 void Scenario1_DataEvents::ReadingChanged(Accelerometer^ sender, AccelerometerReadingChangedEventArgs^ e)
00084 {
00085     // We need to dispatch to the UI thread to display the output
00086     Dispatcher->RunAsync(
00087         CoreDispatcherPriority::Normal,
00088         ref new DispatchedHandler(
00089             [this, e]()
00090             {
00091                 MainPage::SetReadingText(ScenarioOutput, e->Reading);
00092             },
00093             CallbackContext::Any
00094             )
00095         );
00096 }
00097
00098 void Scenario1_DataEvents::ScenarioEnable()
00099 {
00100     // Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
00101     accelerometer->ReportInterval = (std::max)(accelerometer->MinimumReportInterval, 16U);
00102
00103     visibilityToken = Window::Current->VisibilityChanged += ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged);
00104     readingToken = accelerometer->ReadingChanged += ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);
00105
00106     ScenarioEnableButton->IsEnabled = false;
00107     ScenarioDisableButton->IsEnabled = true;
00108 }
00109
00110 void Scenario1_DataEvents::ScenarioDisable()
00111 {
00112     Window::Current->VisibilityChanged -= visibilityToken;
00113     accelerometer->ReadingChanged -= readingToken;
00114
00115     // Restore the default report interval to release resources while the sensor is not in use
00116     accelerometer->ReportInterval = 0;
00117
00118     ScenarioEnableButton->IsEnabled = true;
00119     ScenarioDisableButton->IsEnabled = false;
00120 }
Generated on Fri Nov 15 2024 22:17:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cpp/pch.cpp Source File

  • PdfDocument
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario1WinRTComponent/SecureInterfaceLegacySignals.h Source File

  • AllJoyn
  • Common
  • Scenario1WinRTComponent

SecureInterfaceLegacySignals.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {
00024
00025 ref class SecureInterfaceLegacySignals;
00026
00027 public interface class ISecureInterfaceLegacySignals
00028 {
00029     event Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ TextSentReceived;
00030 };
00031
00032 public ref class SecureInterfaceLegacySignals sealed : [Windows::Foundation::Metadata::Default] ISecureInterfaceLegacySignals
00033 {
00034 public:
00035     // "This signal is emitted when producer sends a text message to consumer"
00036     // Calling this method will send the TextSent signal to every member of the session.
00037     void TextSent(_In_ Platform::String^ interfaceMemberMessage);
00038
00039     // This event fires whenever the TextSent signal is sent by another member of the session.
00040     virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ TextSentReceived
00041     {
00042         Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ handler)
00043         {
00044             return _TextSentReceived += ref new Windows::Foundation::EventHandler<Platform::Object^>
00045             ([handler](Platform::Object^ sender, Platform::Object^ args)
00046             {
00047                 handler->Invoke(safe_cast<SecureInterfaceLegacySignals^>(sender), safe_cast<SecureInterfaceTextSentReceivedEventArgs^>(args));
00048             }, Platform::CallbackContext::Same);
00049         }
00050         void remove(Windows::Foundation::EventRegistrationToken token)
00051         {
00052             _TextSentReceived -= token;
00053         }
00054     internal:
00055         void raise(SecureInterfaceLegacySignals^ sender, SecureInterfaceTextSentReceivedEventArgs^ args)
00056         {
00057             _TextSentReceived(sender, args);
00058         }
00059     }
00060
00061 internal:
00062     void Initialize(_In_ alljoyn_busobject busObject, _In_ alljoyn_sessionid sessionId);
00063     void CallTextSentReceived(_In_ SecureInterfaceLegacySignals^ sender, _In_ SecureInterfaceTextSentReceivedEventArgs^ args);
00064
00065 private:
00066     alljoyn_busobject m_busObject;
00067     alljoyn_sessionid m_sessionId;
00068
00069     virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _TextSentReceived;
00070
00071     alljoyn_interfacedescription_member m_memberTextSent;
00072 };
00073
00074 } } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BackgroundMediaPlayback/cs/Scenario1.xaml.cs Source File

  • BackgroundMediaPlayback
  • cs

Scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using BackgroundMediaPlayback.DataModels;
00013 using BackgroundMediaPlayback.Services;
00014 using BackgroundMediaPlayback.ViewModels;
00015 using SDKTemplate;
00016 using System;
00017 using System.Collections.Generic;
00018 using System.ComponentModel;
00019 using System.Diagnostics;
00020 using System.Linq;
00021 using System.Threading;
00022 using System.Threading.Tasks;
00023 using Windows.Foundation;
00024 using Windows.Foundation.Collections;
00025 using Windows.Media;
00026 using Windows.Media.Core;
00027 using Windows.Media.Playback;
00028 using Windows.Storage.Streams;
00029 using Windows.UI.Core;
00030 using Windows.UI.Popups;
00031 using Windows.UI.Xaml;
00032 using Windows.UI.Xaml.Controls;
00033 using Windows.UI.Xaml.Media.Imaging;
00034 using Windows.UI.Xaml.Navigation;
00035
00036 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00037
00038 namespace BackgroundMediaPlayback
00039 {
00040     /// <summary>
00041     /// An empty page that can be used on its own or navigated to within a Frame.
00042     /// </summary>
00043     public sealed partial class Scenario1 : Page
00044     {
00045         MediaPlayer Player => PlaybackService.Instance.Player;
00046
00047         MediaPlaybackList PlaybackList
00048         {
00049             get { return Player.Source as MediaPlaybackList; }
00050             set { Player.Source = value; }
00051         }
00052         MediaList MediaList
00053         {
00054             get { return PlaybackService.Instance.CurrentPlaylist; }
00055             set { PlaybackService.Instance.CurrentPlaylist = value; }
00056         }
00057
00058         public PlayerViewModel PlayerViewModel { get; set; }
00059
00060         public Scenario1()
00061         {
00062             this.InitializeComponent();
00063
00064             // Never reuse the cached page because the model is designed to be unloaded and disposed
00065             this.NavigationCacheMode = NavigationCacheMode.Disabled;
00066
00067             // Setup MediaPlayer view model
00068             PlayerViewModel = new PlayerViewModel(Player, Dispatcher);
00069
00070             // Handle page load events
00071             Loaded += Scenario1_Loaded;
00072             Unloaded += Scenario1_Unloaded;
00073
00074             // Respond to playback rate changes.
00075             Player.MediaPlayerRateChanged += Player_MediaPlayerRateChanged;
00076             UpdatePlaybackSpeed();
00077         }
00078
00079         private async void Scenario1_Loaded(object sender, RoutedEventArgs e)
00080         {
00081             Debug.WriteLine("Scenario1_Loaded");
00082
00083             // Update controls according to settings
00084             UpdateControlVisibility();
00085             SettingsService.Instance.UseCustomControlsChanged += SettingsService_UseCustomControlsChanged;
00086
00087             // Bind player to element
00088             mediaPlayerElement.SetMediaPlayer(Player);
00089
00090             // Load the playlist data model if needed
00091             if (MediaList == null)
00092             {
00093                 // Create the playlist data model
00094                 MediaList = new MediaList();
00095                 await MediaList.LoadFromApplicationUriAsync("ms-appx:///Assets/playlist.json");
00096             }
00097
00098             // Create a new playback list matching the data model if one does not exist
00099             if (PlaybackList == null)
00100                 PlaybackList = MediaList.ToPlaybackList();
00101
00102             // Subscribe to playback list item failure events
00103             PlaybackList.ItemFailed += PlaybackList_ItemFailed;
00104
00105             // Create the view model list from the data model and playback model
00106             // and assign it to the player
00107             PlayerViewModel.MediaList = new MediaListViewModel(MediaList, PlaybackList, Dispatcher);
00108         }
00109
00110         private void Scenario1_Unloaded(object sender, RoutedEventArgs e)
00111         {
00112             Debug.WriteLine("Scenario1_Unloaded");
00113
00114             // Ensure the page is no longer holding references and force a GC
00115             // to ensure these are unloaded immediately since the app has
00116             // only a short timeframe to reduce working set to avoid suspending
00117             // on background transition.
00118
00119             SettingsService.Instance.UseCustomControlsChanged -= SettingsService_UseCustomControlsChanged;
00120
00121             PlaybackList.ItemFailed -= PlaybackList_ItemFailed;
00122             PlayerViewModel.Dispose();
00123             PlayerViewModel = null;
00124
00125             GC.Collect();
00126         }
00127
00128         private void SettingsService_UseCustomControlsChanged(object sender, EventArgs e)
00129         {
00130             UpdateControlVisibility();
00131         }
00132
00133         void UpdateControlVisibility()
00134         {
00135             if (SettingsService.Instance.UseCustomControls)
00136             {
00137                 mediaPlayerElement.AreTransportControlsEnabled = false;
00138                 customButtons.Visibility = Visibility.Visible;
00139             }
00140             else
00141             {
00142                 mediaPlayerElement.AreTransportControlsEnabled = true;
00143                 customButtons.Visibility = Visibility.Collapsed;
00144             }
00145         }
00146
00147         /// <summary>
00148         /// Handle item failures
00149         /// </summary>
00150         /// <param name="sender"></param>
00151         /// <param name="args"></param>
00152         private async void PlaybackList_ItemFailed(MediaPlaybackList sender, MediaPlaybackItemFailedEventArgs args)
00153         {
00154             // Media callbacks use a worker thread so dispatch to UI as needed
00155             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
00156             {
00157                 var error = string.Format("Item failed to play: {0} | 0x{1:x}",
00158                     args.Error.ErrorCode, args.Error.ExtendedError.HResult);
00159                 MainPage.Current.NotifyUser(error, NotifyType.ErrorMessage);
00160             });
00161         }
00162
00163         public async void speedButton_Click(object sender, RoutedEventArgs e)
00164         {
00165             // Create menu and add commands
00166             var popupMenu = new PopupMenu();
00167
00168             popupMenu.Commands.Add(new UICommand("4.0x", command => Player.PlaybackSession.PlaybackRate = 4.0));
00169             popupMenu.Commands.Add(new UICommand("2.0x", command => Player.PlaybackSession.PlaybackRate = 2.0));
00170             popupMenu.Commands.Add(new UICommand("1.5x", command => Player.PlaybackSession.PlaybackRate = 1.5));
00171             popupMenu.Commands.Add(new UICommand("1.0x", command => Player.PlaybackSession.PlaybackRate = 1.0));
00172             popupMenu.Commands.Add(new UICommand("0.5x", command => Player.PlaybackSession.PlaybackRate = 0.5));
00173
00174             // Get button transform and then offset it by half the button
00175             // width to center. This will show the popup just above the button.
00176             var control = sender as Control;
00177             var transform = control.TransformToVisual(null);
00178             var point = transform.TransformPoint(new Point(control.ActualWidth / 2, 0));
00179
00180             // Show popup
00181             var selected = await popupMenu.ShowAsync(point);
00182         }
00183
00184         private async void Player_MediaPlayerRateChanged(MediaPlayer sender, MediaPlayerRateChangedEventArgs e)
00185         {
00186             // Media callbacks use a worker thread so dispatch to UI as needed
00187             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, UpdatePlaybackSpeed);
00188         }
00189
00190         private void UpdatePlaybackSpeed()
00191         {
00192             speedButton.Content = String.Format("{0:0.0}x", Player.PlaybackSession.PlaybackRate);
00193         }
00194     }
00195 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PdfDocument/cs/SampleConfiguration.cs Source File

  • PdfDocument
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "PDF Document C# Sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Render document", ClassType=typeof(Scenario1_Render)},
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:25 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: PenHaptics/cppwinrt/Scenario5_InkingAndInteractionFeedback.h Source File

  • PenHaptics
  • cppwinrt

Scenario5_InkingAndInteractionFeedback.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario5_InkingAndInteractionFeedback.g.h"
00015 #include "MainPage.h"
00016
00017 namespace winrt::SDKTemplate::implementation
00018 {
00019     struct Scenario5_InkingAndInteractionFeedback : Scenario5_InkingAndInteractionFeedbackT<Scenario5_InkingAndInteractionFeedback>
00020     {
00021         Scenario5_InkingAndInteractionFeedback();
00022
00023         void MovableRect_Entered(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00024         void MovableRect_Exited(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
00025         void MovableRect_ManipulationStarted(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs const&);
00026         void MovableRect_ManipulationDelta(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs const& e);
00027         void MovableRect_ManipulationCompleted(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs const&);
00028
00029     private:
00030         const int gridSize = 100;
00031         const double snapDistance = 20.0;
00032         Windows::Foundation::Point topLeft;
00033         Windows::Foundation::Point previewTopLeft{ -1, -1 };
00034         Windows::UI::Xaml::Media::TransformGroup transforms{ nullptr };
00035         Windows::UI::Xaml::Media::MatrixTransform previousTransform{ nullptr };
00036         Windows::UI::Xaml::Media::CompositeTransform deltaTransform{ nullptr };
00037         Windows::Devices::Input::PenDevice penDevice{ nullptr };
00038         Windows::Devices::Haptics::SimpleHapticsController hapticsController{ nullptr };
00039
00040         void InitializeGridLines();
00041         void InitializeManipulationTransforms();
00042         void UpdatePreviewRect();
00043         void SnapMovableRectToGridLines();
00044         Windows::Foundation::Point GetSnappedPoint();
00045         bool IsInSnapRange();
00046     };
00047 }
00048
00049 namespace winrt::SDKTemplate::factory_implementation
00050 {
00051     struct Scenario5_InkingAndInteractionFeedback : Scenario5_InkingAndInteractionFeedbackT<Scenario5_InkingAndInteractionFeedback, implementation::Scenario5_InkingAndInteractionFeedback>
00052     {
00053     };
00054 }
Generated on Fri Nov 15 2024 22:20:53 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: AllJoyn/Common/Scenario2WinRTComponent/OnboardingServiceEventArgs.h Source File

  • AllJoyn
  • Common
  • Scenario2WinRTComponent

OnboardingServiceEventArgs.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011 //-----------------------------------------------------------------------------
00012 // <auto-generated>
00013 //   This code was generated by a tool.
00014 //
00015 //   Changes to this file may cause incorrect behavior and will be lost if
00016 //   the code is regenerated.
00017 //
00018 //   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
00019 // </auto-generated>
00020 //-----------------------------------------------------------------------------
00021 #pragma once
00022
00023 namespace org { namespace alljoyn { namespace Onboarding {
00024
00025 // Methods
00026 public ref class OnboardingConfigureWiFiCalledEventArgs sealed
00027 {
00028 public:
00029     OnboardingConfigureWiFiCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType);
00030
00031     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00032     {
00033         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00034     }
00035
00036     property OnboardingConfigureWiFiResult^ Result
00037     {
00038         OnboardingConfigureWiFiResult^ get() { return m_result; }
00039         void set(_In_ OnboardingConfigureWiFiResult^ value) { m_result = value; }
00040     }
00041
00042     property Platform::String^ SSID
00043     {
00044         Platform::String^ get() { return m_interfaceMemberSSID; }
00045     }
00046
00047     property Platform::String^ Passphrase
00048     {
00049         Platform::String^ get() { return m_interfaceMemberPassphrase; }
00050     }
00051
00052     property int16 AuthType
00053     {
00054         int16 get() { return m_interfaceMemberAuthType; }
00055     }
00056
00057     Windows::Foundation::Deferral^ GetDeferral();
00058
00059     static Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^>^ GetResultAsync(OnboardingConfigureWiFiCalledEventArgs^ args)
00060     {
00061         args->InvokeAllFinished();
00062         auto t = concurrency::create_task(args->m_tce);
00063         return concurrency::create_async([t]() -> concurrency::task<OnboardingConfigureWiFiResult^>
00064         {
00065             return t;
00066         });
00067     }
00068
00069 private:
00070     void Complete();
00071     void InvokeAllFinished();
00072     void InvokeCompleteHandler();
00073
00074     bool m_raised;
00075     int m_completionsRequired;
00076     concurrency::task_completion_event<OnboardingConfigureWiFiResult^> m_tce;
00077     std::mutex m_lock;
00078     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00079     OnboardingConfigureWiFiResult^ m_result;
00080     Platform::String^ m_interfaceMemberSSID;
00081     Platform::String^ m_interfaceMemberPassphrase;
00082     int16 m_interfaceMemberAuthType;
00083 };
00084
00085 public ref class OnboardingConnectCalledEventArgs sealed
00086 {
00087 public:
00088     OnboardingConnectCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00089
00090     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00091     {
00092         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00093     }
00094
00095     property OnboardingConnectResult^ Result
00096     {
00097         OnboardingConnectResult^ get() { return m_result; }
00098         void set(_In_ OnboardingConnectResult^ value) { m_result = value; }
00099     }
00100
00101     Windows::Foundation::Deferral^ GetDeferral();
00102
00103     static Windows::Foundation::IAsyncOperation<OnboardingConnectResult^>^ GetResultAsync(OnboardingConnectCalledEventArgs^ args)
00104     {
00105         args->InvokeAllFinished();
00106         auto t = concurrency::create_task(args->m_tce);
00107         return concurrency::create_async([t]() -> concurrency::task<OnboardingConnectResult^>
00108         {
00109             return t;
00110         });
00111     }
00112
00113 private:
00114     void Complete();
00115     void InvokeAllFinished();
00116     void InvokeCompleteHandler();
00117
00118     bool m_raised;
00119     int m_completionsRequired;
00120     concurrency::task_completion_event<OnboardingConnectResult^> m_tce;
00121     std::mutex m_lock;
00122     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00123     OnboardingConnectResult^ m_result;
00124 };
00125
00126 public ref class OnboardingOffboardCalledEventArgs sealed
00127 {
00128 public:
00129     OnboardingOffboardCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00130
00131     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00132     {
00133         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00134     }
00135
00136     property OnboardingOffboardResult^ Result
00137     {
00138         OnboardingOffboardResult^ get() { return m_result; }
00139         void set(_In_ OnboardingOffboardResult^ value) { m_result = value; }
00140     }
00141
00142     Windows::Foundation::Deferral^ GetDeferral();
00143
00144     static Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^>^ GetResultAsync(OnboardingOffboardCalledEventArgs^ args)
00145     {
00146         args->InvokeAllFinished();
00147         auto t = concurrency::create_task(args->m_tce);
00148         return concurrency::create_async([t]() -> concurrency::task<OnboardingOffboardResult^>
00149         {
00150             return t;
00151         });
00152     }
00153
00154 private:
00155     void Complete();
00156     void InvokeAllFinished();
00157     void InvokeCompleteHandler();
00158
00159     bool m_raised;
00160     int m_completionsRequired;
00161     concurrency::task_completion_event<OnboardingOffboardResult^> m_tce;
00162     std::mutex m_lock;
00163     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00164     OnboardingOffboardResult^ m_result;
00165 };
00166
00167 public ref class OnboardingGetScanInfoCalledEventArgs sealed
00168 {
00169 public:
00170     OnboardingGetScanInfoCalledEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00171
00172     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00173     {
00174         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00175     }
00176
00177     property OnboardingGetScanInfoResult^ Result
00178     {
00179         OnboardingGetScanInfoResult^ get() { return m_result; }
00180         void set(_In_ OnboardingGetScanInfoResult^ value) { m_result = value; }
00181     }
00182
00183     Windows::Foundation::Deferral^ GetDeferral();
00184
00185     static Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^>^ GetResultAsync(OnboardingGetScanInfoCalledEventArgs^ args)
00186     {
00187         args->InvokeAllFinished();
00188         auto t = concurrency::create_task(args->m_tce);
00189         return concurrency::create_async([t]() -> concurrency::task<OnboardingGetScanInfoResult^>
00190         {
00191             return t;
00192         });
00193     }
00194
00195 private:
00196     void Complete();
00197     void InvokeAllFinished();
00198     void InvokeCompleteHandler();
00199
00200     bool m_raised;
00201     int m_completionsRequired;
00202     concurrency::task_completion_event<OnboardingGetScanInfoResult^> m_tce;
00203     std::mutex m_lock;
00204     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00205     OnboardingGetScanInfoResult^ m_result;
00206 };
00207
00208 // Readable Properties
00209 public ref class OnboardingGetVersionRequestedEventArgs sealed
00210 {
00211 public:
00212     OnboardingGetVersionRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00213
00214     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00215     {
00216         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00217     }
00218
00219     property OnboardingGetVersionResult^ Result
00220     {
00221         OnboardingGetVersionResult^ get() { return m_result; }
00222         void set(_In_ OnboardingGetVersionResult^ value) { m_result = value; }
00223     }
00224
00225     Windows::Foundation::Deferral^ GetDeferral();
00226
00227     static Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^>^ GetResultAsync(OnboardingGetVersionRequestedEventArgs^ args)
00228     {
00229         args->InvokeAllFinished();
00230         auto t = concurrency::create_task(args->m_tce);
00231         return concurrency::create_async([t]() -> concurrency::task<OnboardingGetVersionResult^>
00232         {
00233             return t;
00234         });
00235     }
00236
00237 private:
00238     void Complete();
00239     void InvokeAllFinished();
00240     void InvokeCompleteHandler();
00241
00242     bool m_raised;
00243     int m_completionsRequired;
00244     concurrency::task_completion_event<OnboardingGetVersionResult^> m_tce;
00245     std::mutex m_lock;
00246     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00247     OnboardingGetVersionResult^ m_result;
00248 };
00249
00250 public ref class OnboardingGetStateRequestedEventArgs sealed
00251 {
00252 public:
00253     OnboardingGetStateRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00254
00255     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00256     {
00257         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00258     }
00259
00260     property OnboardingGetStateResult^ Result
00261     {
00262         OnboardingGetStateResult^ get() { return m_result; }
00263         void set(_In_ OnboardingGetStateResult^ value) { m_result = value; }
00264     }
00265
00266     Windows::Foundation::Deferral^ GetDeferral();
00267
00268     static Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^>^ GetResultAsync(OnboardingGetStateRequestedEventArgs^ args)
00269     {
00270         args->InvokeAllFinished();
00271         auto t = concurrency::create_task(args->m_tce);
00272         return concurrency::create_async([t]() -> concurrency::task<OnboardingGetStateResult^>
00273         {
00274             return t;
00275         });
00276     }
00277
00278 private:
00279     void Complete();
00280     void InvokeAllFinished();
00281     void InvokeCompleteHandler();
00282
00283     bool m_raised;
00284     int m_completionsRequired;
00285     concurrency::task_completion_event<OnboardingGetStateResult^> m_tce;
00286     std::mutex m_lock;
00287     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00288     OnboardingGetStateResult^ m_result;
00289 };
00290
00291 public ref class OnboardingGetLastErrorRequestedEventArgs sealed
00292 {
00293 public:
00294     OnboardingGetLastErrorRequestedEventArgs(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
00295
00296     property Windows::Devices::AllJoyn::AllJoynMessageInfo^ MessageInfo
00297     {
00298         Windows::Devices::AllJoyn::AllJoynMessageInfo^ get() { return m_messageInfo; }
00299     }
00300
00301     property OnboardingGetLastErrorResult^ Result
00302     {
00303         OnboardingGetLastErrorResult^ get() { return m_result; }
00304         void set(_In_ OnboardingGetLastErrorResult^ value) { m_result = value; }
00305     }
00306
00307     Windows::Foundation::Deferral^ GetDeferral();
00308
00309     static Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^>^ GetResultAsync(OnboardingGetLastErrorRequestedEventArgs^ args)
00310     {
00311         args->InvokeAllFinished();
00312         auto t = concurrency::create_task(args->m_tce);
00313         return concurrency::create_async([t]() -> concurrency::task<OnboardingGetLastErrorResult^>
00314         {
00315             return t;
00316         });
00317     }
00318
00319 private:
00320     void Complete();
00321     void InvokeAllFinished();
00322     void InvokeCompleteHandler();
00323
00324     bool m_raised;
00325     int m_completionsRequired;
00326     concurrency::task_completion_event<OnboardingGetLastErrorResult^> m_tce;
00327     std::mutex m_lock;
00328     Windows::Devices::AllJoyn::AllJoynMessageInfo^ m_messageInfo;
00329     OnboardingGetLastErrorResult^ m_result;
00330 };
00331
00332 // Writable Properties
00333 } } }
Generated on Fri Nov 15 2024 22:17:38 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario1 Member List

This is the complete list of members for Scenario1, including all inherited members.
m_EnterpriseId | Scenario1 | [private, static]
m_enterpriseId | Scenario1 | [static]
OnNavigatedTo(NavigationEventArgs e) | Scenario1 | [inline, protected]
rootPage | Scenario1 | [private]
Scenario1() | Scenario1 | [inline]
Setup_Click(object sender, RoutedEventArgs e) | Scenario1 | [inline, private]
Generated on Fri Nov 15 2024 22:23:22 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

StreamSocketListenerWrapper Member List

This is the complete list of members for StreamSocketListenerWrapper, including all inherited members.
Dispose() | StreamSocketListenerWrapper | [inline]
Dispose(bool disposing) | StreamSocketListenerWrapper | [inline, protected, virtual]
disposed | StreamSocketListenerWrapper | [private]
manager | StreamSocketListenerWrapper | [private]
OnConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args) | StreamSocketListenerWrapper | [inline, private]
session | StreamSocketListenerWrapper | [private]
streamSocketListener | StreamSocketListenerWrapper | [private]
StreamSocketListenerWrapper(WiFiDirectServiceManager manager, StreamSocketListener streamSocketListener, SessionWrapper session) | StreamSocketListenerWrapper | [inline]
ThrowIfDisposed() | StreamSocketListenerWrapper | [inline, private]
~StreamSocketListenerWrapper() | StreamSocketListenerWrapper | [inline, private]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ApplicationResources/cs/scenario1.xaml.cs Source File

  • ApplicationResources
  • cs

scenario1.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00006 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00007 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00008 //
00009 //*********************************************************
00010
00011 using Windows.UI.Xaml;
00012 using Windows.UI.Xaml.Controls;
00013 using Windows.UI.Xaml.Navigation;
00014 using SDKTemplate;
00015 using System;
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     public sealed partial class Scenario1 : Page
00023     {
00024         // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00025         // as NotifyUser()
00026         MainPage rootPage = MainPage.Current;
00027
00028         public Scenario1()
00029         {
00030             this.InitializeComponent();
00031         }
00032
00033         /// <summary>
00034         /// Invoked when this page is about to be displayed in a Frame.
00035         /// </summary>
00036         /// <param name="e">Event data that describes how this page was reached.  The Parameter
00037         /// property is typically used to configure the page.</param>
00038         protected override void OnNavigatedTo(NavigationEventArgs e)
00039         {
00040         }
00041     }
00042 }
Generated on Fri Nov 15 2024 22:17:39 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WindowsAudioSession/cpp/pch.h Source File

  • WindowsAudioSession
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
00011 #include "Common.h"
Generated on Fri Nov 15 2024 22:17:08 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ExtendedExecution/cpp/Scenario2_SavingDataReason.xaml.cpp Source File

  • ExtendedExecution
  • cpp

Scenario2_SavingDataReason.xaml.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "Scenario2_SavingDataReason.xaml.h"
00014
00015 using namespace SDKTemplate;
00016
00017 using namespace Concurrency;
00018 using namespace Platform;
00019 using namespace Windows::Foundation;
00020 using namespace Windows::ApplicationModel;
00021 using namespace Windows::ApplicationModel::ExtendedExecution;
00022 using namespace Windows::UI::Core;
00023 using namespace Windows::UI::Xaml;
00024 using namespace Windows::UI::Xaml::Controls;
00025 using namespace Windows::UI::Xaml::Navigation;
00026
00027 SavingDataReason::SavingDataReason()
00028 {
00029     InitializeComponent();
00030 }
00031
00032 void SavingDataReason::OnNavigatedTo(NavigationEventArgs^ e)
00033 {
00034     // Add a suspension handler in order to request a SavingData Extended Execution.
00035     suspendingToken = App::Current->Suspending += ref new SuspendingEventHandler(this, &SavingDataReason::OnSuspending);
00036 }
00037
00038 void SavingDataReason::OnNavigatingFrom(NavigatingCancelEventArgs^ e)
00039 {
00040     App::Current->Suspending -= suspendingToken;
00041 }
00042
00043 void SavingDataReason::OnSuspending(Object^ sender, SuspendingEventArgs^ args)
00044 {
00045     suspendDeferral = args->SuspendingOperation->GetDeferral();
00046
00047     rootPage->NotifyUser("", NotifyType::StatusMessage);
00048
00049     auto session = ref new ExtendedExecutionSession();
00050
00051     session->Reason = ExtendedExecutionReason::SavingData;
00052     session->Description = "Pretending to save data to slow storage.";
00053     EventRegistrationToken revokedToken = session->Revoked += ref new TypedEventHandler<Object^, ExtendedExecutionRevokedEventArgs^>(this, &SavingDataReason::ExtendedExecutionSessionRevoked);
00054     create_task(session->RequestExtensionAsync()).then([this](ExtendedExecutionResult result)
00055     {
00056         switch (result)
00057         {
00058         case ExtendedExecutionResult::Allowed:
00059             // We can perform a longer save operation (e.g., upload to the cloud).
00060             MainPage::DisplayToast("Performing a long save operation.");
00061             cancellationTokenSource = cancellation_token_source();
00062             return Helpers::DelayAsync(Helpers::TimeSpanFromSeconds(10), cancellationTokenSource.get_token())
00063                 .then([this]()
00064             {
00065                 MainPage::DisplayToast("Still saving.");
00066                 return Helpers::DelayAsync(Helpers::TimeSpanFromSeconds(10), cancellationTokenSource.get_token());
00067             }).then([this]()
00068             {
00069                 MainPage::DisplayToast("Long save complete.");
00070             }).then([this](task<void> previousTask)
00071             {
00072                 try
00073                 {
00074                     // Raise the cancellation exception if the task was canceled.
00075                     previousTask.get();
00076                 }
00077                 catch (const task_canceled&)
00078                 {
00079                     // The extended execution was revoked before we could finish the long save operation.
00080                 }
00081             });
00082             break;
00083
00084         default:
00085         case ExtendedExecutionResult::Denied:
00086             // We must perform a fast save operation.
00087             MainPage::DisplayToast("Performing a fast save operation.");
00088             return Helpers::DelayAsync(Helpers::TimeSpanFromSeconds(1)).then([this]()
00089             {
00090                 MainPage::DisplayToast("Fast save complete.");
00091             });
00092             break;
00093         }
00094     }).then([this, session, revokedToken]()
00095     {
00096         session->Revoked -= revokedToken;
00097         delete session;
00098         if (suspendDeferral != nullptr)
00099         {
00100             suspendDeferral->Complete();
00101             suspendDeferral = nullptr;
00102         }
00103     });
00104 }
00105
00106 void SavingDataReason::ExtendedExecutionSessionRevoked(Object^ sender, ExtendedExecutionRevokedEventArgs^ args)
00107 {
00108     // If session is revoked, make the OnSuspending event handler stop or the application will be terminated.
00109     cancellationTokenSource.cancel();
00110
00111     Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
00112     {
00113         switch (args->Reason)
00114         {
00115         case ExtendedExecutionRevokedReason::Resumed:
00116             // A resumed app has returned to the foreground
00117             rootPage->NotifyUser("Extended execution revoked due to returning to foreground.", NotifyType::StatusMessage);
00118             break;
00119
00120         case ExtendedExecutionRevokedReason::SystemPolicy:
00121             // An app can be in the foreground or background when a revocation due to system policy occurs
00122             MainPage::DisplayToast("Extended execution revoked due to system policy.");
00123             rootPage->NotifyUser("Extended execution revoked due to system policy.", NotifyType::StatusMessage);
00124             break;
00125         }
00126
00127         if (suspendDeferral != nullptr)
00128         {
00129             suspendDeferral->Complete();
00130             suspendDeferral = nullptr;
00131         }
00132     }));
00133 }
Generated on Fri Nov 15 2024 22:19:33 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContactCards/cpp/Scenario2_DelayMini.xaml.h Source File

  • ContactCards
  • cpp

Scenario2_DelayMini.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario2_DelayMini.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     [Windows::Foundation::Metadata::WebHostHidden]
00020     public ref class Scenario2_DelayMini sealed
00021     {
00022     public:
00023         Scenario2_DelayMini();
00024
00025     protected:
00026         void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00027
00028     private:
00029         MainPage^ rootPage = MainPage::Current;
00030
00031         static Windows::ApplicationModel::Contacts::Contact^ CreatePlaceholderContact();
00032         Concurrency::task<Windows::ApplicationModel::Contacts::Contact^> DownloadContactDataAsync(Windows::ApplicationModel::Contacts::Contact^ contact);
00033
00034         void ShowContactCard_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035     };
00036 }
Generated on Fri Nov 15 2024 22:18:55 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomSensors/cpp/SampleConfiguration.cpp Source File

  • CustomSensors
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "DataEvents", "SDKTemplate.Scenario1_DataEvents" },
00012     { "Polling", "SDKTemplate.Scenario2_Polling" }
00013 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: SmartCard/cs/Scenario1_ProvisionTPM.xaml.cs Source File

  • SmartCard
  • cs

Scenario1_ProvisionTPM.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Threading;
00014 using Windows.Devices.SmartCards;
00015 using Windows.Security.Cryptography;
00016 using Windows.Storage.Streams;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public sealed partial class Scenario1_ProvisionTPM : Page
00023     {
00024         private MainPage rootPage = MainPage.Current;
00025
00026         private const int NTE_DEVICE_NOT_READY = unchecked((int)0x80090030);
00027         private const int NTE_DEVICE_NOT_FOUND = unchecked((int)0x80090035);
00028
00029         private const String pinPolicyDisallowed = "Disallowed";
00030         private const String pinPolicyAllowed = "Allowed";
00031         private const String pinPolicyRequireOne = "Require At Least One";
00032
00033         private SmartCardReader reader = null;
00034
00035         public Scenario1_ProvisionTPM()
00036         {
00037             this.InitializeComponent();
00038         }
00039
00040         /// <summary>
00041         /// Click handler for the 'create' button.
00042         /// </summary>
00043         /// <param name="sender"></param>
00044         /// <param name="e"></param>
00045         private async void Create_Click(object sender, RoutedEventArgs e)
00046         {
00047             Button b = sender as Button;
00048             b.IsEnabled = false;
00049             rootPage.NotifyUser("Creating TPM virtual smart card...", NotifyType.StatusMessage);
00050
00051             try
00052             {
00053                 SmartCardPinPolicy pinPolicy = ParsePinPolicy();
00054
00055                 IBuffer adminkey = CryptographicBuffer.GenerateRandom(MainPage.ADMIN_KEY_LENGTH_IN_BYTES);
00056
00057                 SmartCardProvisioning provisioning = await SmartCardProvisioning.RequestVirtualSmartCardCreationAsync(FriendlyName.Text, adminkey, pinPolicy);
00058
00059                 // If card creation is cancelled by the user,
00060                 // RequestVirtualSmartCard will return null instead of a
00061                 // SmartCardProvisioning object.
00062                 if (null == provisioning)
00063                 {
00064                     rootPage.NotifyUser("TPM virtual smart card creation was canceled by the user.", NotifyType.StatusMessage);
00065                     b.IsEnabled = true;
00066                     return;
00067                 }
00068
00069                 // The following two lines are not directly related to TPM virtual
00070                 // smart card creation, but are used to demonstrate how to handle
00071                 // CardAdded events by registering an event handler with a
00072                 // SmartCardReader object.  Since we are using a TPM virtual smart
00073                 // card in this case, the card cannot actually be added to or
00074                 // removed from the reader, but a CardAdded event will fire as
00075                 // soon as the event handler is added, since the card is already
00076                 // inserted.
00077                 //
00078                 // We must retain a reference to the SmartCardReader object to
00079                 // which we are adding the event handler.  Hence we assign the
00080                 // reader object associated with the SmartCardProvisioning we
00081                 // received from RequestVirtualSmartCardCreationAsync to the
00082                 // class's "reader" member.  Then, we use += to add the
00083                 // HandleCardAdded method as an event handler.  The function
00084                 // will be automatically boxed in a TypedEventHandler, but
00085                 // the function signature match the template arguments for
00086                 // the specific event - in this case,
00087                 // <SmartCardReader, CardAddedEventArgs>
00088                 reader = provisioning.SmartCard.Reader;
00089                 reader.CardAdded += HandleCardAdded;
00090
00091                 // Store the reader's device ID and admin key to enable the
00092                 // following scenarios in the sample.
00093                 rootPage.SmartCardReaderDeviceId = provisioning.SmartCard.Reader.DeviceId;
00094                 rootPage.AdminKey = adminkey;
00095
00096                 // Once RequestVirtualSmartCardCreationAsync has returned, the card
00097                 // is already provisioned and ready to use.  Therefore, the steps
00098                 // in this using block are not actually necessary at this point.
00099                 // However, should you want to re-provision the card in the future,
00100                 // you would follow this sequence: acquire a challenge context,
00101                 // calculate a response, and then call ProvisionAsync on the
00102                 // challenge context with the calculated response.
00103                 using (var context = await provisioning.GetChallengeContextAsync())
00104                 {
00105                     IBuffer response = ChallengeResponseAlgorithm.CalculateResponse(context.Challenge, adminkey);
00106                     await context.ProvisionAsync(response, true);
00107                 }
00108
00109                 rootPage.NotifyUser("TPM virtual smart card is provisioned and ready for use.", NotifyType.StatusMessage);
00110             }
00111             catch (Exception ex)
00112             {
00113                 // Two potentially common error scenarios when creating a TPM
00114                 // virtual smart card are that the user's machine may not have
00115                 // a TPM, or the TPM may not be ready for use.  It is important
00116                 // to explicitly check for these scenarios by checking the
00117                 // HResult of any exceptions thrown by
00118                 // RequestVirtualSmartCardCreationAsync and gracefully
00119                 // providing a suitable message to the user.
00120                 if (NTE_DEVICE_NOT_FOUND == ex.HResult)
00121                 {
00122                     rootPage.NotifyUser("We were unable to find a Trusted Platform Module on your machine. A TPM is required to use a TPM Virtual Smart Card.", NotifyType.ErrorMessage);
00123                 }
00124                 else if (NTE_DEVICE_NOT_READY == ex.HResult)
00125                 {
00126                     rootPage.NotifyUser("Your Trusted Platform Module is not ready for use. Please contact your administrator for assistance with initializing your TPM.", NotifyType.ErrorMessage);
00127                 }
00128                 else
00129                 {
00130                     rootPage.NotifyUser("TPM virtual smart card creation failed with exception: " + ex.ToString(), NotifyType.ErrorMessage);
00131                 }
00132             }
00133             finally
00134             {
00135                 b.IsEnabled = true;
00136             }
00137         }
00138
00139         void HandleCardAdded(SmartCardReader sender, CardAddedEventArgs args)
00140         {
00141             // Note that this event is raised from a background thread.
00142             // However, the NotifyUser method is safe to call from background threads.
00143             rootPage.NotifyUser("Card added to reader " + reader.Name + ".", NotifyType.StatusMessage);
00144         }
00145
00146         private SmartCardPinPolicy ParsePinPolicy()
00147         {
00148             SmartCardPinPolicy pinPolicy = new SmartCardPinPolicy();
00149             pinPolicy.MinLength = uint.Parse(PinMinLength.Text);
00150             pinPolicy.MaxLength = uint.Parse(PinMaxLength.Text);
00151
00152             switch (PinUppercase.SelectedValue.ToString())
00153             {
00154                 case pinPolicyDisallowed:
00155                     pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.Disallow;
00156                     break;
00157                 case pinPolicyAllowed:
00158                     pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.Allow;
00159                     break;
00160                 case pinPolicyRequireOne:
00161                     pinPolicy.UppercaseLetters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
00162                     break;
00163                 default:
00164                     throw new InvalidOperationException();
00165             }
00166
00167             switch (PinLowercase.SelectedValue.ToString())
00168             {
00169                 case pinPolicyDisallowed:
00170                     pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.Disallow;
00171                     break;
00172                 case pinPolicyAllowed:
00173                     pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.Allow;
00174                     break;
00175                 case pinPolicyRequireOne:
00176                     pinPolicy.LowercaseLetters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
00177                     break;
00178                 default:
00179                     throw new InvalidOperationException();
00180             }
00181
00182             switch (PinDigits.SelectedValue.ToString())
00183             {
00184                 case pinPolicyDisallowed:
00185                     pinPolicy.Digits = SmartCardPinCharacterPolicyOption.Disallow;
00186                     break;
00187                 case pinPolicyAllowed:
00188                     pinPolicy.Digits = SmartCardPinCharacterPolicyOption.Allow;
00189                     break;
00190                 case pinPolicyRequireOne:
00191                     pinPolicy.Digits = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
00192                     break;
00193                 default:
00194                     throw new InvalidOperationException();
00195             }
00196
00197             switch (PinSpecial.SelectedValue.ToString())
00198             {
00199                 case pinPolicyDisallowed:
00200                     pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.Disallow;
00201                     break;
00202                 case pinPolicyAllowed:
00203                     pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.Allow;
00204                     break;
00205                 case pinPolicyRequireOne:
00206                     pinPolicy.SpecialCharacters = SmartCardPinCharacterPolicyOption.RequireAtLeastOne;
00207                     break;
00208                 default:
00209                     throw new InvalidOperationException();
00210             }
00211
00212             return pinPolicy;
00213         }
00214     }
00215 }
Generated on Fri Nov 15 2024 22:21:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_RestoreScrollPosition Member List

This is the complete list of members for Scenario5_RestoreScrollPosition, including all inherited members.
_items() | Scenario5_RestoreScrollPosition | [inline]
_persistedItemContainerHeight | Scenario5_RestoreScrollPosition | [private, static]
_persistedItemKey | Scenario5_RestoreScrollPosition | [private, static]
_persistedPosition | Scenario5_RestoreScrollPosition | [private, static]
GetItem(hstring const &key) | Scenario5_RestoreScrollPosition | [private]
GetKey(IInspectable const &object) | Scenario5_RestoreScrollPosition | [private]
items | Scenario5_RestoreScrollPosition | [private]
ItemsListView_ContainerContentChanging(Windows::UI::Xaml::Controls::ListViewBase const &, Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs const &args) | Scenario5_RestoreScrollPosition |
ItemsListView_ItemClick(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_RestoreScrollPosition |
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &) | Scenario5_RestoreScrollPosition |
Page_Loaded(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &) | Scenario5_RestoreScrollPosition |
Scenario5_RestoreScrollPosition() | Scenario5_RestoreScrollPosition |
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: OrientationSensor/cpp/pch.cpp Source File

  • OrientationSensor
  • cpp

pch.cpp

Go to the documentation of this file.
00001 //
00002 // Include the standard header and generate the precompiled header.
00003 //
00004
00005 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AudioStreamReader Member List

This is the complete list of members for AudioStreamReader, including all inherited members.
_audioData | AudioStreamReader | [private]
_format | AudioStreamReader | [private]
GetData() const | AudioStreamReader | [inline]
GetFormat() const | AudioStreamReader | [inline]
GetSize() const | AudioStreamReader | [inline]
Initialize(_In_ Windows::Media::SpeechSynthesis::SpeechSynthesisStream^speechSynthesisStream) | AudioStreamReader |
~AudioStreamReader() | AudioStreamReader | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:06 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: BasicFaceTracking/cppwinrt/pch.cpp Source File

  • BasicFaceTracking
  • cppwinrt

pch.cpp

Go to the documentation of this file.
00001 ﻿//
00002 // pch.cpp
00003 // Include the standard header and generate the precompiled header.
00004 //
00005
00006 #include "pch.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: WiFiScan/cpp/SampleConfiguration.cpp Source File

  • WiFiScan
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include "MainPage.xaml.h"
00014 #include "SampleConfiguration.h"
00015
00016 using namespace SDKTemplate;
00017
00018 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00019 {
00020     { "Cached Networks", "SDKTemplate.WiFiScan.Scenario1_CachedNetworks" },
00021     { "Scan", "SDKTemplate.WiFiScan.Scenario2_Scan" },
00022     { "Register for Scan Updates", "SDKTemplate.WiFiScan.Scenario3_RegisterForUpdates" },
00023     { "Connect", "SDKTemplate.WiFiScan.Scenario4_Connect" }
00024 };
Generated on Fri Nov 15 2024 22:17:21 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Manifest Member List

This is the complete list of members for Manifest, including all inherited members.
AddPeriod(Period period) | Manifest | [inline, private]
AppendToBaseUrl(string url) | Manifest | [inline, private]
AudioMimeType | Manifest | [static]
availabilityStartTime | Manifest | [private]
AvailibilityStartTime | Manifest | [private]
BaseUrl | Manifest | [private]
baseUrl | Manifest | [private]
GetSelectedPeriod() | Manifest | [inline, private]
HasMinimumUpdatePeriod | Manifest | [private]
hasMinimumUpdatePeriod | Manifest | [private]
hasMultiplePeriods | Manifest | [private]
HasMultiplePeriods | Manifest | [private]
HasPresentationDuration | Manifest | [private]
hasPresentationDuration | Manifest | [private]
IsLive | Manifest | [private]
isLive | Manifest | [private]
isSupportedProfile | Manifest | [private]
IsSupportedProfile | Manifest | [private]
lastPeriodDuration | Manifest | [private]
LastPeriodDuration | Manifest | [private]
LoadManifestAsync(string url) | Manifest | [inline, private]
Manifest(string url) | Manifest | [inline, private]
mediaPresentationDuration | Manifest | [private]
MediaPresentationDuration | Manifest | [private]
minBufferTime | Manifest | [private]
MinBufferTime | Manifest | [private]
minimumUpdatePeriod | Manifest | [private]
MinimumUpdatePeriod | Manifest | [private]
MinMinimumUpdatePeriod | Manifest | [static]
periods | Manifest | [private]
publishTime | Manifest | [private]
PublishTime | Manifest |
SetFirstSelectedPeriod() | Manifest | [inline, private]
SetNextSelectedPeriod() | Manifest | [inline, private]
sourceUrl | Manifest | [private]
SourceUrl | Manifest | [private]
TimeShiftBufferDepth | Manifest | [private]
timeShiftBufferDepth | Manifest | [private]
treatAsOnDemand | Manifest | [private]
TreatAsOnDemand | Manifest |
VideoMimeType | Manifest | [static]
Generated on Fri Nov 15 2024 22:23:27 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

sealed Member List

This is the complete list of members for sealed, including all inherited members.
__pad0__ | sealed | [private]
_advertisementStatusChangedToken | sealed | [private]
_advertiser | sealed | [private]
_advertiserMutex | sealed | [private]
_advertisers | sealed | [private]
_autoAcceptSessionConnectedToken | sealed | [private]
_connectedSessions | sealed | [private]
_connectionReceivedToken | sealed | [private]
_datagramMessageReceivedToken | sealed | [private]
_datagramSocket | sealed | [private]
_deviceInfo | sealed | [private]
_discoveredDevices | sealed | [private]
_instance | sealed | [private, static]
_manager | sealed | [private]
_managerMutex | sealed | [private]
_mutex | sealed | [private]
_nextId | sealed | [private, static]
_pin | sealed | [private]
_provisioningInfo | sealed | [private]
_reader | sealed | [private]
_remotePortAddedToken | sealed | [private]
_requestList | sealed | [private]
_rootPage | sealed | [private]
_rootPage | sealed | [private]
_scenario1 | sealed | [private]
_scenario2 | sealed | [private]
_scenario3 | sealed | [private]
_scenario4 | sealed | [private]
_scenario5 | sealed | [private]
_selectedSession | sealed | [private]
_service | sealed | [private]
_session | sealed | [private]
_session | sealed | [private]
_sessionClosedEvent | sealed | [private]
_sessionDeferredToken | sealed | [private]
_sessionMutex | sealed | [private]
_sessionRequestedToken | sealed | [private]
_sessionStatusChangedToken | sealed | [private]
_socketList | sealed | [private]
_streamSocket | sealed | [private]
_streamSocketListener | sealed | [private]
_streamSocketListeners | sealed | [private]
_uniqueInternalId | sealed | [private]
_writer | sealed | [private]
Accept_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
AddAdvertiser(AdvertisementWrapper^advertiser) | sealed |
AddAdvertiser(AdvertisementWrapper^advertiser) | sealed | [private]
AddDatagramSocketAsync(uint16 port) | sealed |
AddPort_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
AddPrefix_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
AddSession(SessionWrapper^session) | sealed |
AddSession(SessionWrapper^session) | sealed |
AddSession(SessionWrapper^session) | sealed | [private]
AddSessionRequest(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser) | sealed |
AddSessionRequest(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser) | sealed | [private]
AddSocket(SocketWrapper^socket) | sealed |
AddSocket(SocketWrapper^socket) | sealed | [private]
AddStreamSocketInternal(Windows::Networking::Sockets::StreamSocket^socket) | sealed |
AddStreamSocketListenerAsync(uint16 port) | sealed |
Advertisement | sealed |
AdvertisementId | sealed |
AdvertisementWrapper(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^advertiser, WiFiDirectServiceManager^manager, Platform::String^pin) | sealed |
AdvertiserStatusChanged(AdvertisementWrapper^advertiser) | sealed | [private]
CloseSession(unsigned int index) | sealed | [private]
CloseSession_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
CloseSession_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ConfigMethods | sealed |
ConnectAsync(Platform::String^pin="") | sealed |
CreateAdvertiser_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
Decline_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DeclineSessionRequest(Platform::String^id) | sealed |
Discover_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DiscoveredDeviceWrapper(Windows::Devices::Enumeration::DeviceInformation^deviceInfo, WiFiDirectServiceManager^manager) | sealed |
DiscoverServicesAsync(Platform::String^serviceName, Platform::String^requestedServiceInfo="") | sealed | [private]
DoConnect_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
DoSend_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
GetProvisioningInfo_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
GetProvisioningInfoAsync(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceConfigurationMethod configMethod) | sealed |
Id | sealed |
NotifyUser(Platform::String^strMessage, NotifyType type) | sealed | [private]
OnAdvertisementStatusChanged(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Platform::Object^args) | sealed | [private]
OnAutoAcceptSessionConnected(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAutoAcceptSessionConnectedEventArgs^args) | sealed | [private]
OnConnectionReceived(Windows::Networking::Sockets::StreamSocketListener^sender, Windows::Networking::Sockets::StreamSocketListenerConnectionReceivedEventArgs^args) | sealed | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs^e) override | sealed | [protected, virtual]
OnRemotePortAdded(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceRemotePortAddedEventArgs^args) | sealed | [private]
OnSessionDeferred(Windows::Devices::WiFiDirect::Services::WiFiDirectService^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionDeferredEventArgs^args) | sealed | [private]
OnSessionRequested(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceAdvertiser^sender, Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequestedEventArgs^args) | sealed | [private]
OnSessionStatusChanged(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^sender, Platform::Object^args) | sealed | [private]
OnUDPMessageReceived(Windows::Networking::Sockets::DatagramSocket^sender, Windows::Networking::Sockets::DatagramSocketMessageReceivedEventArgs^args) | sealed | [private]
ParseProperties() | sealed | [private]
Pin | sealed |
ProvisioningInfo | sealed |
ReceiveMessageAsync() | sealed |
RemoveAdvertiser(unsigned int index) | sealed |
RemoveAdvertiser(AdvertisementWrapper^advertiser) | sealed | [private]
RemoveAdvertiser(unsigned int index) | sealed | [private]
RemovePrefix_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
RemoveSession(unsigned int index) | sealed |
RemoveSession(unsigned int index) | sealed |
RemoveSession(unsigned int index) | sealed | [private]
RemoveSession(SessionWrapper^session) | sealed | [private]
RemoveSessionRequest(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser) | sealed |
RemoveSessionRequest(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertiser) | sealed | [private]
RemoveSocket(unsigned int index) | sealed |
ResetFields() | sealed | [private]
Scenario1() | sealed |
Scenario2() | sealed |
Scenario3() | sealed |
Scenario4() | sealed |
Scenario5() | sealed |
SelectSession(unsigned int index) | sealed | [private]
SelectSession_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
SelectSession_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
ServiceAddress | sealed |
ServiceInfo | sealed |
ServiceName | sealed |
SessionConnected() | sealed |
SessionInfo | sealed |
SessionRequestWrapper(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSessionRequest^request, AdvertisementWrapper^advertisement) | sealed |
SessionWrapper(Windows::Devices::WiFiDirect::Services::WiFiDirectServiceSession^session, WiFiDirectServiceManager^manager) | sealed |
SetServiceOptionsAsync(bool preferGO, Platform::String^sessionInfo) | sealed |
SocketWrapper(WiFiDirectServiceManager^manager, Windows::Networking::Sockets::StreamSocket^streamSocket, Windows::Networking::Sockets::DatagramSocket^datagramSocket, bool canSend) | sealed |
StartReceiveLoop() | sealed |
StopAdvertisement_Click(Platform::Object^sender, Windows::UI::Xaml::RoutedEventArgs^e) | sealed | [private]
StreamSocketListenerWrapper(WiFiDirectServiceManager^manager, Windows::Networking::Sockets::StreamSocketListener^streamSocketListener, SessionWrapper^session) | sealed |
UnpublishService(unsigned int index) | sealed | [private]
UpdateAdvertiserStatus(AdvertisementWrapper^advertiser) | sealed |
UpdateDiscoveryList(Windows::Foundation::Collections::IVector< DiscoveredDeviceWrapper^>^devices) | sealed |
WiFiDirectServiceManager() | sealed | [private]
~AdvertisementWrapper() | sealed | [virtual]
~DiscoveredDeviceWrapper() | sealed | [virtual]
~SessionWrapper() | sealed | [virtual]
~SocketWrapper() | sealed | [virtual]
~StreamSocketListenerWrapper() | sealed | [virtual]
Generated on Fri Nov 15 2024 22:24:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: NumberFormatting/cppwinrt/Project.idl Source File

  • NumberFormatting
  • cppwinrt

Project.idl

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 namespace SDKTemplate
00013 {
00014     [default_interface]
00015     runtimeclass Scenario1_PercentPermilleFormatting : Windows.UI.Xaml.Controls.Page
00016     {
00017         Scenario1_PercentPermilleFormatting();
00018     }
00019
00020     [default_interface]
00021     runtimeclass Scenario2_DecimalFormatting : Windows.UI.Xaml.Controls.Page
00022     {
00023         Scenario2_DecimalFormatting();
00024     }
00025
00026     [default_interface]
00027     runtimeclass Scenario3_CurrencyFormatting : Windows.UI.Xaml.Controls.Page
00028     {
00029         Scenario3_CurrencyFormatting();
00030     }
00031
00032     [default_interface]
00033     runtimeclass Scenario4_NumberParsing : Windows.UI.Xaml.Controls.Page
00034     {
00035         Scenario4_NumberParsing();
00036     }
00037
00038     [default_interface]
00039     runtimeclass Scenario5_RoundingAndPadding : Windows.UI.Xaml.Controls.Page
00040     {
00041         Scenario5_RoundingAndPadding();
00042     }
00043
00044     [default_interface]
00045     runtimeclass Scenario6_NumeralSystemTranslation : Windows.UI.Xaml.Controls.Page
00046     {
00047         Scenario6_NumeralSystemTranslation();
00048     }
00049
00050     [default_interface]
00051     runtimeclass Scenario7_UsingUnicodeExtensions : Windows.UI.Xaml.Controls.Page
00052     {
00053         Scenario7_UsingUnicodeExtensions();
00054     }
00055 }
Generated on Fri Nov 15 2024 22:17:10 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/pch.h Source File

  • FileSearch
  • cpp

pch.h

Go to the documentation of this file.
00001 //
00002 // Header for standard system include files.
00003 //
00004
00005 #pragma once
00006
00007 #include <collection.h>
00008 #include <ppltasks.h>
00009
00010 #include "App.xaml.h"
Generated on Fri Nov 15 2024 22:17:07 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: CustomCapability/Service/Client/smbios.cpp Source File

  • CustomCapability
  • Service
  • Client

smbios.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <intsafe.h>
00014 #include <string>
00015 #include "FirmwareAccess.h"
00016
00017 struct RawSMBIOSData
00018 {
00019     BYTE    Used20CallingMethod;
00020     BYTE    SMBIOSMajorVersion;
00021     BYTE    SMBIOSMinorVersion;
00022     BYTE    DmiRevision;
00023     DWORD   Length;
00024     BYTE    SMBIOSTableData[ANYSIZE_ARRAY];
00025 };
00026
00027 struct RawSMBIOSTable
00028 {
00029     BYTE    Type;
00030     BYTE    Length;
00031     WORD    Handle;
00032 };
00033
00034 struct RawSMBIOSSystemInfo : public RawSMBIOSTable
00035 {
00036     BYTE    Manufacturer;
00037     BYTE    ProductName;
00038     BYTE    Version;
00039     BYTE    SerialNumber;
00040     // Ver 2.1 beyond here
00041     BYTE    UUID[16];
00042     BYTE    Wakeup_Type;
00043     // Ver 2.4 beyond here
00044     BYTE    SKUNumber;
00045     BYTE    Family;
00046 };
00047
00048 DWORD
00049 FindSmBiosTable(
00050     _In_ const RawSMBIOSData* SMBIOSData,
00051     _In_ BYTE Type,
00052     _Out_ RawSMBIOSTable** SMBIOSTable
00053     )
00054 {
00055     DWORD error = S_OK;
00056     ULONG i = 0;
00057     RawSMBIOSTable* smbiosTable = NULL;
00058     bool properTermination = false;
00059
00060     *SMBIOSTable = NULL;
00061
00062     // Find SMBIOS Table
00063     do
00064     {
00065         properTermination = false;
00066
00067         // Check that the table header fits in the buffer.
00068         if (i + sizeof(RawSMBIOSTable) < SMBIOSData->Length)
00069         {
00070
00071             if (SMBIOSData->SMBIOSTableData[i] == Type)
00072             {
00073                 // Found table
00074                 smbiosTable = (RawSMBIOSTable*)&SMBIOSData->SMBIOSTableData[i];
00075             }
00076
00077             // Set i to the end of the formated section.
00078             i += SMBIOSData->SMBIOSTableData[i + 1];
00079
00080             // Look for the end of the struct that must be terminated by \0\0
00081             while (i + 1 < SMBIOSData->Length)
00082             {
00083                 if (0 == SMBIOSData->SMBIOSTableData[i] &&
00084                     0 == SMBIOSData->SMBIOSTableData[i + 1])
00085                 {
00086                     properTermination = true;
00087                     i += 2;
00088                     break;
00089                 }
00090
00091                 ++i;
00092             }
00093         }
00094     }
00095     while (properTermination && !smbiosTable);
00096
00097     if (properTermination) {
00098         if (!smbiosTable) {
00099             // The table was not found.
00100             error = ERROR_FILE_NOT_FOUND;
00101         }
00102     }
00103     else
00104     {
00105         // A table was not double null terminated within the buffer.
00106         error = ERROR_INVALID_DATA;
00107     }
00108
00109     if (ERROR_SUCCESS == error) {
00110         *SMBIOSTable = smbiosTable;
00111     }
00112
00113     return error;
00114 }
00115
00116 DWORD
00117 GetSmBiosString(
00118     _In_ const RawSMBIOSTable* SmBiosTable,
00119     _In_ BYTE StringIndex,
00120     _Out_ PWSTR* ResultString
00121     )
00122 {
00123     DWORD error = ERROR_SUCCESS;
00124     PSTR currentString = NULL;
00125     BYTE CurrentStringIndex = 1;
00126     ULONG stringLen = 0;
00127     ULONG bufferLen = 0;
00128     HRESULT hr = S_OK;
00129
00130     *ResultString = NULL;
00131
00132     // 0 index implies the empty string
00133     if (StringIndex <= 0)
00134     {
00135         goto exit;
00136     }
00137
00138     currentString = (PSTR)(((BYTE*)SmBiosTable) + SmBiosTable->Length);
00139
00140     // find the string in the multisz string
00141     while (*currentString)
00142     {
00143         if (CurrentStringIndex == StringIndex)
00144         {
00145             break;
00146         }
00147
00148         ++currentString;
00149
00150         if (!*currentString)
00151         {
00152             ++currentString;
00153             ++CurrentStringIndex;
00154         }
00155     }
00156
00157     if (!*currentString)
00158     {
00159         // String was not found in the string table.
00160         error = ERROR_INVALID_DATA;
00161         goto exit;
00162     }
00163
00164     // Convert the string to UNICODE
00165     stringLen = MultiByteToWideChar(
00166                     CP_ACP,
00167                     MB_PRECOMPOSED | MB_ERR_INVALID_CHARS,
00168                     currentString,
00169                     -1,
00170                     NULL,
00171                     0);
00172
00173     if (0 == stringLen)
00174     {
00175         error = GetLastError();
00176         goto exit;
00177     }
00178
00179     // SMBIOS strings are limited to 64 characters
00180     if (stringLen > 65)
00181     {
00182         error = ERROR_INVALID_DATA;
00183         goto exit;
00184     }
00185
00186     hr = ULongMult(stringLen, sizeof(WCHAR), &bufferLen);
00187     if (hr != S_OK)
00188     {
00189         error = ERROR_INVALID_DATA;
00190         goto exit;
00191     }
00192
00193     *ResultString = (PWSTR) HeapAlloc(GetProcessHeap(), 0, bufferLen);
00194     if (!*ResultString)
00195     {
00196         error = ERROR_OUTOFMEMORY;
00197         goto exit;
00198     }
00199
00200     stringLen = MultiByteToWideChar(
00201                    CP_ACP,
00202                    MB_PRECOMPOSED | MB_ERR_INVALID_CHARS,
00203                    currentString,
00204                    -1,
00205                    *ResultString,
00206                    stringLen);
00207
00208     if (0 == stringLen)
00209     {
00210         error = GetLastError();
00211     }
00212
00213 exit:
00214     if (error != ERROR_SUCCESS)
00215     {
00216         HeapFree(GetProcessHeap(),  0, *ResultString);
00217         *ResultString = NULL;
00218     }
00219
00220     return error;
00221 }
00222
00223 DWORD
00224 GetManufacturerNameFromSmbios(
00225     _Out_ wchar_t* ManufacturerName,
00226     _In_  DWORD    Size
00227     )
00228 {
00229     DWORD error = ERROR_SUCCESS;
00230     DWORD smBiosDataSize = 0;
00231     RawSMBIOSData* smBiosData = NULL;
00232     DWORD bytesWritten = 0;
00233     RawSMBIOSSystemInfo* systemInfo = NULL;
00234     PWSTR manufacturerName = NULL;
00235
00236     if (ManufacturerName == NULL)
00237     {
00238         return E_INVALIDARG;
00239     }
00240
00241     //
00242     // Query size of SMBIOS data.
00243     //
00244     smBiosDataSize = GetSystemFirmwareTable('RSMB', 0, NULL, 0);
00245     if (smBiosDataSize <= 0)
00246     {
00247         error = GetLastError();
00248         goto exit;
00249     }
00250
00251     //
00252     // Allocate memory for the smbios table
00253     //
00254     smBiosData = (RawSMBIOSData*) HeapAlloc(GetProcessHeap(), 0, smBiosDataSize);
00255     if (smBiosData == NULL)
00256     {
00257         error = ERROR_OUTOFMEMORY;
00258         goto exit;
00259     }
00260
00261     bytesWritten = GetSystemFirmwareTable('RSMB', 0, smBiosData, smBiosDataSize);
00262     if (bytesWritten != smBiosDataSize)
00263     {
00264         error = ERROR_INVALID_DATA;
00265         goto exit;
00266     }
00267
00268     error = FindSmBiosTable(smBiosData, 1, (RawSMBIOSTable**)&systemInfo);
00269     if (error != ERROR_SUCCESS)
00270     {
00271         goto exit;
00272     }
00273
00274     error = GetSmBiosString(systemInfo, systemInfo->Manufacturer, &manufacturerName);
00275     if (error != ERROR_SUCCESS)
00276     {
00277         goto exit;
00278     }
00279
00280     if (manufacturerName != NULL)
00281     {
00282         if (Size <  (DWORD) wcslen(manufacturerName))
00283         {
00284             error = ERROR_BUFFER_OVERFLOW;
00285             goto exit;
00286         }
00287
00288         wcscpy_s(ManufacturerName, Size, manufacturerName);
00289         HeapFree(GetProcessHeap(), 0, manufacturerName);
00290     }
00291     else
00292     {
00293         error = E_UNEXPECTED;
00294     }
00295
00296 exit:
00297     if (smBiosData)
00298     {
00299         HeapFree(GetProcessHeap(), 0, smBiosData);
00300     }
00301
00302     return error;
00303 }
Generated on Fri Nov 15 2024 22:19:04 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TitleBar/cs/SampleConfiguration.cs Source File

  • TitleBar
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.ApplicationModel.Core;
00015 using Windows.UI.Core;
00016 using Windows.UI.ViewManagement;
00017 using Windows.UI.Xaml;
00018 using Windows.UI.Xaml.Controls;
00019
00020 namespace SDKTemplate
00021 {
00022     public partial class MainPage : Page
00023     {
00024         public const string FEATURE_NAME = "Title bar";
00025
00026         List<Scenario> scenarios = new List<Scenario>
00027         {
00028             new Scenario() { Title="Custom colors", ClassType=typeof(Scenario1_Colors)},
00029             new Scenario() { Title="Custom drawing", ClassType=typeof(Scenario2_Extend)},
00030         };
00031
00032         #region Custom title bar
00033         CustomTitleBar customTitleBar = null;
00034
00035         public void AddCustomTitleBar()
00036         {
00037             if (customTitleBar == null)
00038             {
00039                 customTitleBar = new CustomTitleBar();
00040                 customTitleBar.EnableControlsInTitleBar(areControlsInTitleBar);
00041
00042                 // Make the main page's content a child of the title bar,
00043                 // and make the title bar the new page content.
00044                 UIElement mainContent = this.Content;
00045                 this.Content = null;
00046                 customTitleBar.SetPageContent(mainContent);
00047                 this.Content = customTitleBar;
00048             }
00049         }
00050
00051         public void RemoveCustomTitleBar()
00052         {
00053             if (customTitleBar != null)
00054             {
00055                 // Take the title bar's page content and make it
00056                 // the window content.
00057                 this.Content = customTitleBar.SetPageContent(null);
00058                 customTitleBar = null;
00059             }
00060         }
00061
00062         bool areControlsInTitleBar = false;
00063
00064         public bool AreControlsInTitleBar
00065         {
00066             get
00067             {
00068                 return areControlsInTitleBar;
00069             }
00070             set
00071             {
00072                 areControlsInTitleBar = value;
00073                 if (customTitleBar != null)
00074                 {
00075                     customTitleBar.EnableControlsInTitleBar(value);
00076                 }
00077             }
00078         }
00079
00080         #endregion
00081     }
00082
00083     public class Scenario
00084     {
00085         public string Title { get; set; }
00086         public Type ClassType { get; set; }
00087     }
00088 }
Generated on Fri Nov 15 2024 22:17:26 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario5_Msappdata Member List

This is the complete list of members for Scenario5_Msappdata, including all inherited members.
CopyAssetToFolderIfNecessaryAsync(hstring name, Windows::Storage::StorageFolder const &folder) | Scenario5_Msappdata | [private]
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &) | Scenario5_Msappdata |
OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const &) | Scenario5_Msappdata |
Scenario5_Msappdata() | Scenario5_Msappdata |
Generated on Fri Nov 15 2024 22:24:18 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: DatagramSocket/cpp/Scenario3.xaml.cpp Source File

  • DatagramSocket
  • cpp

Scenario3.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario3.xaml.cpp
00014 // Implementation of the Scenario3 class
00015 //
00016
00017 #include "pch.h"
00018 #include "Scenario2.xaml.h"
00019 #include "Scenario3.xaml.h"
00020
00021 using namespace SDKTemplate;
00022 using namespace SDKTemplate::DatagramSocketSample;
00023
00024 using namespace Concurrency;
00025 using namespace Platform;
00026 using namespace Windows::ApplicationModel::Core;
00027 using namespace Windows::Networking::Sockets;
00028 using namespace Windows::Storage::Streams;
00029 using namespace Windows::UI::Xaml;
00030 using namespace Windows::UI::Xaml::Controls;
00031 using namespace Windows::UI::Xaml::Navigation;
00032
00033 Scenario3::Scenario3()
00034 {
00035     InitializeComponent();
00036 }
00037
00038 /// <summary>
00039 /// Invoked when this page is about to be displayed in a Frame.
00040 /// </summary>
00041 /// <param name="e">Event data that describes how this page was reached.  The Parameter
00042 /// property is typically used to configure the page.</param>
00043 void Scenario3::OnNavigatedTo(NavigationEventArgs^ e)
00044 {
00045     // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
00046     // as NotifyUser()
00047     rootPage = MainPage::Current;
00048 }
00049
00050
00051 void Scenario3::SendHello_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
00052 {
00053     if (!CoreApplication::Properties->HasKey("clientSocket"))
00054     {
00055         rootPage->NotifyUser("Please run previous steps before doing this one.", NotifyType::ErrorMessage);
00056         return;
00057     }
00058
00059     SocketContext^ socketContext = dynamic_cast<SocketContext^>(CoreApplication::Properties->Lookup("clientSocket"));
00060     if (!socketContext->IsConnected())
00061     {
00062         rootPage->NotifyUser("The socket is not yet connected. Please wait.", NotifyType::ErrorMessage);
00063         return;
00064     }
00065
00066     // Prepare the message to be sent. Writing data to the writer will just store data in memory.
00067     String^ stringToSend("Hello");
00068     try
00069     {
00070         socketContext->GetWriter()->WriteString(stringToSend);
00071     }
00072     catch (Exception^ ex)
00073     {
00074         rootPage->NotifyUser("Send failed with error: " + ex->Message, NotifyType::ErrorMessage);
00075     }
00076
00077     // Write the locally buffered data to the network. Please note that write operation will succeed
00078     // even if the server is not listening.
00079     create_task(socketContext->GetWriter()->StoreAsync()).then(
00080         [this, stringToSend] (task<unsigned int> writeTask)
00081     {
00082         try
00083         {
00084             // Try getting an exception.
00085             writeTask.get();
00086             SendOutput->Text = "\"" + stringToSend + "\" sent successfully";
00087         }
00088         catch (Exception^ exception)
00089         {
00090             rootPage->NotifyUser("Send failed with error: " + exception->Message, NotifyType::ErrorMessage);
00091         }
00092     });
00093 }
Generated on Fri Nov 15 2024 22:18:01 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Disposer Member List

This is the complete list of members for Disposer, including all inherited members.
Dispose() | Disposer | [inline]
Dispose(bool disposeManagedResources) | Disposer | [inline, protected, virtual]
DisposeCollector | Disposer | [private]
Disposer() | Disposer | [inline, protected]
IsDisposed | Disposer | [protected]
RemoveAndDispose< T >(ref T objectToDispose) | Disposer | [inline, protected]
RemoveToDispose< T >(T objectToRemove) | Disposer | [inline, protected]
ToDispose< T >(T objectToDispose) | Disposer | [inline, protected]
Generated on Fri Nov 15 2024 22:23:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

School Member List

This is the complete list of members for School, including all inherited members.
Id | School |
idKey | School | [private]
Name | School |
nameKey | School | [private]
School() | School | [inline]
School(JsonObject jsonObject) | School | [inline]
schoolKey | School | [private]
ToJsonObject() | School | [inline]
Type | School |
typeKey | School | [private]
Generated on Fri Nov 15 2024 22:24:02 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ContentIndexer/cpp/SampleConfiguration.cpp Source File

  • ContentIndexer
  • cpp

SampleConfiguration.cpp

Go to the documentation of this file.
00001 // Copyright (c) Microsoft. All rights reserved.
00002
00003 #include "pch.h"
00004 #include "MainPage.xaml.h"
00005 #include "SampleConfiguration.h"
00006
00007 using namespace SDKTemplate;
00008
00009 Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
00010 {
00011     { "Add item to the index using the ContentIndexer",             "SDKTemplate.S1_AddWithAPI" },
00012     { "Update and delete indexed items using the ContentIndexer",   "SDKTemplate.S2_UpdateAndDeleteWithAPI" },
00013     { "Retrieve indexed items added using the ContentIndexer",      "SDKTemplate.S3_RetrieveWithAPI" },
00014     { "Check the index revision number",                            "SDKTemplate.S4_CheckIndexRevision" },
00015     { "Add indexed items by using appcontent-ms files",             "SDKTemplate.S5_AddWithAppContent" },
00016     { "Delete indexed appcontent-ms files",                         "SDKTemplate.S6_DeleteWithAppContent" },
00017     { "Retrieve indexed properties from appcontent-ms files",       "SDKTemplate.S7_RetrieveWithAppContent" }
00018 };
Generated on Fri Nov 15 2024 22:17:13 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: UserDataAccountManager/cpp/Scenario3_FixAccount.xaml.h Source File

  • UserDataAccountManager
  • cpp

Scenario3_FixAccount.xaml.h

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #pragma once
00013
00014 #include "Scenario3_FixAccount.g.h"
00015 #include "MainPage.xaml.h"
00016
00017 namespace SDKTemplate
00018 {
00019     /// <summary>
00020     /// An empty page that can be used on its own or navigated to within a Frame.
00021     /// </summary>
00022     [Windows::Foundation::Metadata::WebHostHidden]
00023     public ref class Scenario3_FixAccount sealed
00024     {
00025     public:
00026         Scenario3_FixAccount();
00027
00028     protected:
00029         virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
00030
00031     private:
00032         MainPage^ rootPage = MainPage::Current;
00033         bool isLaunched = false;
00034
00035         void Fix_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00036
00037         Concurrency::task<bool> IsFixNeededAsync(Windows::ApplicationModel::UserDataAccounts::UserDataAccount^ account);
00038     };
00039 }
Generated on Fri Nov 15 2024 22:21:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: FileSearch/cpp/Scenario1.xaml.h Source File

  • FileSearch
  • cpp

Scenario1.xaml.h

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // Scenario1.xaml.h
00014 // Declaration of the Scenario1 class
00015 //
00016
00017 #pragma once
00018
00019 #include "pch.h"
00020 #include "Scenario1.g.h"
00021 #include "MainPage.xaml.h"
00022
00023 namespace SDKTemplate
00024 {
00025     /// <summary>
00026     /// An empty page that can be used on its own or navigated to within a Frame.
00027     /// </summary>
00028     public ref class Scenario1 sealed
00029     {
00030     public:
00031         Scenario1();
00032
00033     private:
00034         void SearchButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
00035     };
00036 }
Generated on Fri Nov 15 2024 22:17:51 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: MobileBroadband/cs/ModemInformation.xaml.cs Source File

  • MobileBroadband
  • cs

ModemInformation.xaml.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using System.IO;
00015 using System.Linq;
00016 using System.Runtime.InteropServices.WindowsRuntime;
00017 using System.Text;
00018 using Windows.Foundation;
00019 using Windows.Foundation.Collections;
00020 using Windows.UI.Xaml;
00021 using Windows.UI.Xaml.Controls;
00022 using Windows.UI.Xaml.Controls.Primitives;
00023 using Windows.UI.Xaml.Data;
00024 using Windows.UI.Xaml.Input;
00025 using Windows.UI.Xaml.Media;
00026 using Windows.UI.Xaml.Navigation;
00027 using Windows.Networking.NetworkOperators;
00028 using Windows.Networking.Connectivity;
00029 using SDKTemplate;
00030
00031
00032 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
00033
00034 namespace MobileBroadband
00035 {
00036     /// <summary>
00037     /// An empty page that can be used on its own or navigated to within a Frame.
00038     /// </summary>
00039     public sealed partial class ModemInformation : Page
00040     {
00041         MainPage rootPage = MainPage.Current;
00042         public ModemInformation()
00043         {
00044             this.InitializeComponent();
00045         }
00046
00047         protected override void OnNavigatedTo(NavigationEventArgs e)
00048         {
00049             btnRefresh_Click(null, null);
00050             base.OnNavigatedTo(e);
00051         }
00052         private void btnRefresh_Click(object sender, RoutedEventArgs e)
00053         {
00054             try
00055             {
00056                 var modem = MobileBroadbandModem.GetDefault();
00057                 StringBuilder sb = new StringBuilder();
00058                 sb.AppendLine("Cellular Class: " + modem.DeviceInformation.CellularClass.ToString());
00059                 sb.AppendLine("Current Radio Powerstate: " + modem.DeviceInformation.CurrentRadioState.ToString());
00060                 sb.AppendLine("Custom Data Class: " + modem.DeviceInformation.CustomDataClass.ToString());
00061                 sb.AppendLine("Supported Data Classes: " + modem.DeviceInformation.DataClasses.ToString());
00062                 sb.AppendLine("Device ID: " + modem.DeviceInformation.DeviceId.ToString());
00063                 sb.AppendLine("Device Type: " + modem.DeviceInformation.DeviceType.ToString());
00064                 sb.AppendLine("Firmware Information: " + modem.DeviceInformation.FirmwareInformation);
00065                 sb.AppendLine("Manufacturer: " + modem.DeviceInformation.Manufacturer);
00066                 sb.AppendLine("IMEI (Mobile Equipment ID): " + modem.DeviceInformation.MobileEquipmentId);
00067                 sb.AppendLine("Device Model: " + modem.DeviceInformation.Model);
00068                 sb.AppendLine("Device Status: " + modem.DeviceInformation.NetworkDeviceStatus.ToString());
00069
00070                 sb.AppendLine("Suppported PINs: ");
00071                 var pinTypeList = modem.DeviceInformation.PinManager.SupportedPins;
00072                 foreach (var pinType in pinTypeList)
00073                 {
00074                     sb.AppendLine(pinType.ToString());
00075                 }
00076
00077                 sb.AppendLine("Revision: " + modem.DeviceInformation.Revision);
00078                 sb.AppendLine("Serial Number: " + modem.DeviceInformation.SerialNumber);
00079                 sb.AppendLine("SIM ICCID: " + modem.DeviceInformation.SimIccId);
00080                 sb.AppendLine("Subscriber ID: " + modem.DeviceInformation.SubscriberId);
00081
00082                 var phoneNumbers = modem.DeviceInformation.TelephoneNumbers;
00083                 foreach (var phoneNumber in phoneNumbers)
00084                 {
00085                     sb.AppendLine("Telephone Numbers: " + phoneNumber);
00086                 }
00087
00088                 txtModemInformation.Text = sb.ToString();
00089                 rootPage.NotifyUser("Success: Modem information loaded", NotifyType.StatusMessage);
00090
00091             }
00092             catch (Exception ex)
00093             {
00094                 rootPage.NotifyUser("Error:" + ex.Message, NotifyType.ErrorMessage);
00095             }
00096         }
00097         private string CheckForNullOrEmptyField(object input)
00098         {
00099             string result = "empty";
00100             switch ((input.GetType().ToString().ToLower()))
00101             {
00102                 case "string":
00103                     string val = (string)input;
00104                     if ((string.IsNullOrEmpty(val))||(string.IsNullOrWhiteSpace(val)))
00105                     {
00106                         result =val;
00107                     }
00108                     break;
00109                 case "{system._comobject}":
00110                     break;
00111                 default:
00112                     break;
00113             }
00114
00115
00116             return result;
00117         }
00118
00119     }
00120 }
Generated on Fri Nov 15 2024 22:20:31 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMediaStream::CSourceLock Member List

This is the complete list of members for CMediaStream::CSourceLock, including all inherited members.
_spSource | CMediaStream::CSourceLock | [private]
CSourceLock(CMediaSource *pSource) | CMediaStream::CSourceLock | [inline]
~CSourceLock() | CMediaStream::CSourceLock | [inline]
Generated on Fri Nov 15 2024 22:23:29 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CustomEffectState Member List

This is the complete list of members for CustomEffectState, including all inherited members.
color | CustomEffectState
frameNumber | CustomEffectState
isColorOn | CustomEffectState
lampArray | CustomEffectState
lampColors | CustomEffectState
lampNormalizedX | CustomEffectState
Generated on Fri Nov 15 2024 22:23:44 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GroupInfoList Member List

This is the complete list of members for GroupInfoList, including all inherited members.
Back() const | List< object > | [inline, protected]
Clear(FN &clear_fn) | List< object > | [inline]
Clear() | List< object > | [inline, virtual]
EndPosition() const | List< object > | [inline]
Front() const | List< object > | [inline, protected]
FrontPosition() | List< object > | [inline]
GetBack(object *ppItem) | List< object > | [inline]
GetCount() const | List< object > | [inline]
GetFront(object *ppItem) | List< object > | [inline]
GetItem(const Node *pNode, object *ppItem) | List< object > | [inline, protected, virtual]
GetItemPos(POSITION pos, object *ppItem) | List< object > | [inline]
InsertAfter(objectitem, Node *pBefore) | List< object > | [inline, protected, virtual]
InsertBack(objectitem) | List< object > | [inline]
InsertFront(objectitem) | List< object > | [inline]
InsertPos(POSITION pos, objectitem) | List< object > | [inline]
IsEmpty() const | List< object > | [inline]
Key | GroupInfoList |
List() | List< object > | [inline]
m_anchor | List< object > | [protected]
m_count | List< object > | [protected]
Next(const POSITION pos) | List< object > | [inline]
Remove(POSITION &pos, object *ppItem) | List< object > | [inline]
RemoveBack(object *ppItem) | List< object > | [inline]
RemoveFront(object *ppItem) | List< object > | [inline]
RemoveItem(Node *pNode, object *ppItem) | List< object > | [inline, protected, virtual]
~List() | List< object > | [inline, virtual]
Generated on Fri Nov 15 2024 22:23:45 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario0_Choose Member List

This is the complete list of members for Scenario0_Choose, including all inherited members.
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario0_Choose | [inline, protected]
OnNavigatingFrom(NavigatingCancelEventArgs e) | Scenario0_Choose | [inline, protected]
rootPage | Scenario0_Choose | [private]
Scenario0_Choose() | Scenario0_Choose | [inline]
Scenario0_Choose() | Scenario0_Choose | [inline]
Generated on Fri Nov 15 2024 22:23:48 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: TextSegmentation/cppwinrt/SampleConfiguration.cpp Source File

  • TextSegmentation
  • cppwinrt

SampleConfiguration.cpp

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 #include "pch.h"
00013 #include <winrt/SDKTemplate.h>
00014 #include "MainPage.h"
00015 #include "SampleConfiguration.h"
00016
00017 using namespace winrt;
00018 using namespace winrt::Windows::Foundation::Collections;
00019 using namespace winrt::SDKTemplate;
00020
00021 hstring implementation::MainPage::FEATURE_NAME()
00022 {
00023     return L"Text segmentation C++/WinRT sample";
00024 }
00025
00026 IVector<Scenario> implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector<Scenario>(
00027 {
00028     Scenario{ L"Extract Text Segments", xaml_typename<SDKTemplate::Scenario1_ExtractTextSegments>() },
00029     Scenario{ L"Get Current Text Segment From Index", xaml_typename<SDKTemplate::Scenario2_GetCurrentTextSegmentFromIndex>() },
00030 });
Generated on Fri Nov 15 2024 22:17:19 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: KeyCredentialManager/cs/SampleConfiguration.cs Source File

  • KeyCredentialManager
  • cs

SampleConfiguration.cs

Go to the documentation of this file.
00001 //*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 using System;
00013 using System.Collections.Generic;
00014 using Windows.UI.Xaml.Controls;
00015
00016 namespace SDKTemplate
00017 {
00018     public partial class MainPage : Page
00019     {
00020         public const string FEATURE_NAME = "KeyCredentialManager C# sample";
00021
00022         List<Scenario> scenarios = new List<Scenario>
00023         {
00024             new Scenario() { Title="Sign In Scenario", ClassType=typeof(UserSelect)}
00025         };
00026     }
00027
00028     public class Scenario
00029     {
00030         public string Title { get; set; }
00031         public Type ClassType { get; set; }
00032     }
00033 }
Generated on Fri Nov 15 2024 22:17:24 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: ShareSource/cpp/ShareFiles.xaml.cpp Source File

  • ShareSource
  • cpp

ShareFiles.xaml.cpp

Go to the documentation of this file.
00001 ﻿//*********************************************************
00002 //
00003 // Copyright (c) Microsoft. All rights reserved.
00004 // This code is licensed under the MIT License (MIT).
00005 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
00007 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
00008 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
00009 //
00010 //*********************************************************
00011
00012 //
00013 // ShareFiles.xaml.cpp
00014 // Implementation of the ShareFiles class
00015 //
00016
00017 #include "pch.h"
00018 #include "ShareFiles.xaml.h"
00019 #include <sstream>
00020
00021 using namespace SDKTemplate;
00022
00023 using namespace Platform;
00024 using namespace Windows::Foundation::Collections;
00025 using namespace Windows::UI::Xaml;
00026 using namespace Windows::Storage;
00027 using namespace Windows::Storage::Pickers;
00028 using namespace concurrency;
00029 using namespace Windows::ApplicationModel::DataTransfer;
00030
00031 ShareFiles::ShareFiles()
00032 {
00033     InitializeComponent();
00034 }
00035
00036 bool ShareFiles::GetShareContent(DataRequest^ request)
00037 {
00038     bool succeeded = false;
00039
00040     if (storageItems != nullptr)
00041     {
00042         auto requestData = request->Data;
00043         requestData->Properties->Title = TitleInputBox->Text;
00044         requestData->Properties->Description = DescriptionInputBox->Text; // The description is optional.
00045         requestData->Properties->ContentSourceApplicationLink = ApplicationLink;
00046         requestData->SetStorageItems(dynamic_cast<IIterable<IStorageItem^>^>(storageItems));
00047         succeeded = true;
00048     }
00049     else
00050     {
00051         request->FailWithDisplayText("Select the files you would like to share and try again.");
00052     }
00053     return succeeded;
00054 }
00055
00056 void ShareFiles::SelectFilesButton_Click(Object^ sender, RoutedEventArgs^ e)
00057 {
00058     auto filePicker = ref new FileOpenPicker();
00059     filePicker->ViewMode = PickerViewMode::List;
00060     filePicker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
00061     filePicker->FileTypeFilter->Append("*");
00062
00063     create_task(filePicker->PickMultipleFilesAsync()).then([this](IVectorView<StorageFile^>^ pickedFiles)
00064     {
00065         if (pickedFiles->Size > 0)
00066         {
00067             storageItems = pickedFiles;
00068
00069             // Display the file names in the UI.
00070             std::wstringstream sstream;
00071             sstream << L"Picked files: ";
00072             for (unsigned int i = 0; i < pickedFiles->Size; i++)
00073             {
00074                 sstream << pickedFiles->GetAt(i)->Name->Data();
00075                 if (i < pickedFiles->Size - 1)
00076                 {
00077                     sstream << L", ";
00078                 }
00079             }
00080             sstream << L".";
00081             MainPage::Current->NotifyUser(ref new String(sstream.str().c_str()), NotifyType::StatusMessage);
00082
00083             ShareStep->Visibility = Windows::UI::Xaml::Visibility::Visible;
00084         }
00085     });
00086 }
Generated on Fri Nov 15 2024 22:21:12 for Windows-Universal-Examples by doxygen 1.7.1


Windows-Universal-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Scenario3_ClientAuthentication Member List

This is the complete list of members for Scenario3_ClientAuthentication, including all inherited members.
AppendOutputLine(string value) | Scenario3_ClientAuthentication | [inline, private]
busy | Scenario3_ClientAuthentication | [private]
ClientCertFriendlyName | Scenario3_ClientAuthentication | [private, static]
ClientCertIssuerName | Scenario3_ClientAuthentication | [private, static]
ClientCertPassword | Scenario3_ClientAuthentication | [private, static]
ClientCertUriPath | Scenario3_ClientAuthentication | [private, static]
CloseSocket() | Scenario3_ClientAuthentication | [inline, private]
ConnectWebSocketAsync() | Scenario3_ClientAuthentication | [inline, private]
FindCertificateFromStoreAsync() | Scenario3_ClientAuthentication | [inline, private]
GetClientCertificateAsync() | Scenario3_ClientAuthentication | [inline, private]
InstallClientCertificateAsync() | Scenario3_ClientAuthentication | [inline, private]
OnClosed(IWebSocket sender, WebSocketClosedEventArgs args) | Scenario3_ClientAuthentication | [inline, private]
OnConnect(object sender, RoutedEventArgs e) | Scenario3_ClientAuthentication | [inline, private]
OnDisconnect(object sender, RoutedEventArgs e) | Scenario3_ClientAuthentication | [inline, private]
OnNavigatedFrom(NavigationEventArgs e) | Scenario3_ClientAuthentication | [inline, protected]
rootPage | Scenario3_ClientAuthentication | [private]
Scenario3_ClientAuthentication() | Scenario3_ClientAuthentication | [inline]
SetBusy(bool value) | Scenario3_ClientAuthentication | [inline, private]
streamWebSocket | Scenario3_ClientAuthentication | [private]
UpdateVisualState() | Scenario3_ClientAuthentication | [inline, private]
Generated on Fri Nov 15 2024 22:23:55 for Windows-Universal-Examples by doxygen 1.7.1